(self["webpackChunkapp"] = self["webpackChunkapp"] || []).push([[3762],{

/***/ 3762:
/*!********************************************************************************************************!*\
  !*** ./src/app/logistic-events/create/event-second-license-plate/event-second-license-plate.module.ts ***!
  \********************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "EventSecondLicensePlatePageModule": () => (/* binding */ EventSecondLicensePlatePageModule)
/* harmony export */ });
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/router */ 61380);
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_angular_router__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var src_app_shared_module_shared_module_module__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/shared-module/shared-module.module */ 69270);
/* harmony import */ var _event_second_license_plate_page__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./event-second-license-plate.page */ 29286);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 45449);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_3__);





const routes = [
    {
        path: '',
        component: _event_second_license_plate_page__WEBPACK_IMPORTED_MODULE_2__.EventSecondLicensePlatePage
    }
];
class EventSecondLicensePlatePageModule {
}
EventSecondLicensePlatePageModule.ɵfac = function EventSecondLicensePlatePageModule_Factory(t) { return new (t || EventSecondLicensePlatePageModule)(); };
EventSecondLicensePlatePageModule.ɵmod = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineNgModule"]({ type: EventSecondLicensePlatePageModule });
EventSecondLicensePlatePageModule.ɵinj = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineInjector"]({ imports: [src_app_shared_module_shared_module_module__WEBPACK_IMPORTED_MODULE_1__.SharedModuleModule, _angular_router__WEBPACK_IMPORTED_MODULE_0__.RouterModule.forChild(routes)] });
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵsetNgModuleScope"](EventSecondLicensePlatePageModule, { declarations: [_event_second_license_plate_page__WEBPACK_IMPORTED_MODULE_2__.EventSecondLicensePlatePage], imports: [src_app_shared_module_shared_module_module__WEBPACK_IMPORTED_MODULE_1__.SharedModuleModule, _angular_router__WEBPACK_IMPORTED_MODULE_0__.RouterModule] }); })();


/***/ }),

/***/ 29286:
/*!******************************************************************************************************!*\
  !*** ./src/app/logistic-events/create/event-second-license-plate/event-second-license-plate.page.ts ***!
  \******************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "EventSecondLicensePlatePage": () => (/* binding */ EventSecondLicensePlatePage)
/* harmony export */ });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 45449);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/forms */ 2508);
/* harmony import */ var _shared_services__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @shared/services */ 17253);
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ 90944);
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_angular_common__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ionic/angular */ 93819);
/* harmony import */ var _ngx_translate_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ngx-translate/core */ 38699);






function EventSecondLicensePlatePage_div_12_div_1_Template(rf, ctx) { if (rf & 1) {
    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 13);
    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1);
    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
} if (rf & 2) {
    const error_r2 = ctx.$implicit;
    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", error_r2.message, " ");
} }
function EventSecondLicensePlatePage_div_12_Template(rf, ctx) { if (rf & 1) {
    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 11);
    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, EventSecondLicensePlatePage_div_12_div_1_Template, 2, 1, "div", 12);
    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
} if (rf & 2) {
    const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx_r0.eventLicensePlaceTwoFormErrors);
} }
class EventSecondLicensePlatePage {
    constructor(formBuilder, notificatorService, navigationService, createLogisticEventService, commonService, translateConfigService) {
        this.formBuilder = formBuilder;
        this.notificatorService = notificatorService;
        this.navigationService = navigationService;
        this.createLogisticEventService = createLogisticEventService;
        this.commonService = commonService;
        this.translateConfigService = translateConfigService;
        this.onSubmit = () => {
            this.cleanValidationErrors();
            const licensePlateTwo = this.commonService.clearString(this.eventLicensePlateTwoForm.controls.licensePlateTwo.value);
            const data = {
                licensePlateTwo
            };
            const validationResult = this.validateInput(data);
            if (!!validationResult.length) {
                this.setValidationErrors(validationResult);
                const notification = {
                    title: this.translateConfigService.translate('TOAST_INVALID_DATA_TITLE'),
                    message: this.translateConfigService.translate('TOAST_INVALID_DATA_NESSAGE'),
                    type: 'error'
                };
                this.notificatorService.notify(notification);
            }
            else {
                this.createLogisticEventService.setLicensePlateTwo(licensePlateTwo);
                this.navigationService.forward(['/logistic-events/create/event-options']);
            }
        };
        this.validateInput = data => {
            const errors = [];
            const titleInputValidationErrors = this.validateTitleInput(data);
            if (titleInputValidationErrors) {
                errors.push(titleInputValidationErrors);
            }
            return errors;
        };
        this.validateTitleInput = data => {
            if (!data.licensePlateTwo || data.licensePlateTwo.length < 1) {
                return {
                    message: this.translateConfigService.translate('PG_CREATE_LICENCEPLATETWO_STEP_ISNEED_PLATE'),
                    field: 'licensePlateOne'
                };
            }
            return null;
        };
        this.goOneStepBack = () => {
            this.cleanValidationErrors();
            this.navigationService.back(['/logistic-events/create/event-first-license-plate']);
        };
        this.setValidationErrors = errors => {
            console.log('setValidationErrors:', errors);
            this.eventLicensePlaceTwoFormErrors = errors;
        };
        this.cleanValidationErrors = () => {
            this.eventLicensePlaceTwoFormErrors = [];
        };
        this.eventLicensePlateTwoForm = this.formBuilder.group({
            licensePlateTwo: [this.createLogisticEventService.getLicensePlateTwo()]
        });
    }
    ionViewDidEnter() {
        this.hasCart = this.createLogisticEventService.getHasCart();
    }
}
EventSecondLicensePlatePage.ɵfac = function EventSecondLicensePlatePage_Factory(t) { return new (t || EventSecondLicensePlatePage)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_forms__WEBPACK_IMPORTED_MODULE_3__.UntypedFormBuilder), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_1__.NotificatorService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_1__.NavigationService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_1__.CreateLogisticEventService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_1__.CommonService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_1__.TranslateConfigService)); };
EventSecondLicensePlatePage.ɵcmp = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ type: EventSecondLicensePlatePage, selectors: [["app-event-second-license-plate"]], decls: 20, vars: 14, consts: [[1, "centralized-content"], [1, "page-title"], [1, "title"], [1, "ion-margin-vertical"], [3, "formGroup", "ngSubmit"], [1, "input-holder"], ["type", "text", "formControlName", "licensePlateTwo", 3, "placeholder"], ["class", "errors", 4, "ngIf"], [1, "button-holder"], ["type", "button", 1, "back", 3, "click"], ["type", "submit", 3, "click"], [1, "errors"], ["class", "error", 4, "ngFor", "ngForOf"], [1, "error"]], template: function EventSecondLicensePlatePage_Template(rf, ctx) { if (rf & 1) {
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "ion-content")(1, "div", 0)(2, "div", 1)(3, "div", 2);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](4);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](5, "translate");
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()();
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](6, "ion-row")(7, "ion-col", 3)(8, "form", 4);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("ngSubmit", function EventSecondLicensePlatePage_Template_form_ngSubmit_8_listener() { return ctx.onSubmit(); });
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](9, "div", 5);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](10, "input", 6);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](11, "translate");
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](12, EventSecondLicensePlatePage_div_12_Template, 2, 1, "div", 7);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](13, "div", 8)(14, "button", 9);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function EventSecondLicensePlatePage_Template_button_click_14_listener() { return ctx.goOneStepBack(); });
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](15);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](16, "translate");
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](17, "button", 10);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function EventSecondLicensePlatePage_Template_button_click_17_listener() { return ctx.onSubmit(); });
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](18);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](19, "translate");
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()()()()()()();
    } if (rf & 2) {
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](4);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](5, 6, "PG_CREATE_LICENCEPLATETWO_STEP_TEXT_TITLE"));
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](4);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("formGroup", ctx.eventLicensePlateTwoForm);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("placeholder", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](11, 8, "PG_CREATE_LICENCEPLATETWO_STEP_INPUT"));
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.eventLicensePlaceTwoFormErrors);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](3);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](16, 10, "BTN_BACK"), " ");
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](3);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](19, 12, "BTN_NEXT"));
    } }, dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_2__.NgForOf, _angular_common__WEBPACK_IMPORTED_MODULE_2__.NgIf, _ionic_angular__WEBPACK_IMPORTED_MODULE_4__.IonCol, _ionic_angular__WEBPACK_IMPORTED_MODULE_4__.IonContent, _ionic_angular__WEBPACK_IMPORTED_MODULE_4__.IonRow, _angular_forms__WEBPACK_IMPORTED_MODULE_3__["ɵNgNoValidate"], _angular_forms__WEBPACK_IMPORTED_MODULE_3__.DefaultValueAccessor, _angular_forms__WEBPACK_IMPORTED_MODULE_3__.NgControlStatus, _angular_forms__WEBPACK_IMPORTED_MODULE_3__.NgControlStatusGroup, _angular_forms__WEBPACK_IMPORTED_MODULE_3__.FormGroupDirective, _angular_forms__WEBPACK_IMPORTED_MODULE_3__.FormControlName, _ngx_translate_core__WEBPACK_IMPORTED_MODULE_5__.TranslatePipe], styles: ["ion-toolbar[_ngcontent-%COMP%] {\n  font-family: \"Nunito\", sans-serif;\n}\nion-toolbar[_ngcontent-%COMP%]   ion-img[_ngcontent-%COMP%] {\n  height: 25px;\n  width: 25px;\n}\nion-toolbar[_ngcontent-%COMP%]   ion-title[_ngcontent-%COMP%] {\n  letter-spacing: 1px;\n}\n.centralized-content[_ngcontent-%COMP%] {\n  height: calc(100vh - 56px);\n  display: flex;\n  justify-content: flex-start;\n  flex-direction: column;\n}\n.centralized-content[_ngcontent-%COMP%]   .errors[_ngcontent-%COMP%] {\n  width: 80%;\n  margin: 12px 10% 0;\n  color: #f0181b;\n  text-align: center;\n}\n.centralized-content[_ngcontent-%COMP%]   .page-title[_ngcontent-%COMP%] {\n  margin-top: 32px;\n  margin-bottom: 32px;\n}\n.centralized-content[_ngcontent-%COMP%]   .page-title[_ngcontent-%COMP%]   .title[_ngcontent-%COMP%] {\n  font-size: initial !important;\n  font-weight: bold;\n  text-align: center;\n}\n.centralized-content[_ngcontent-%COMP%]   .page-title[_ngcontent-%COMP%]   .sub-title[_ngcontent-%COMP%] {\n  text-align: center;\n  color: #656768;\n  font-size: 0.9em;\n  margin-top: 4px;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImV2ZW50LXNlY29uZC1saWNlbnNlLXBsYXRlLnBhZ2Uuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLGlDQUFBO0FBQ0Y7QUFDRTtFQUNFLFlBQUE7RUFDQSxXQUFBO0FBQ0o7QUFFRTtFQUNFLG1CQUFBO0FBQUo7QUFJQTtFQUNFLDBCQUFBO0VBQ0EsYUFBQTtFQUNBLDJCQUFBO0VBQ0Esc0JBQUE7QUFERjtBQUdFO0VBQ0UsVUFBQTtFQUNBLGtC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