(self["webpackChunkapp"] = self["webpackChunkapp"] || []).push([[534],{ /***/ 80534: /*!**********************************************************************************************!*\ !*** ./src/app/register/identity-validator-full-name/identity-validator-full-name.module.ts ***! \**********************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "IdentityValidatorFullNamePageModule": () => (/* binding */ IdentityValidatorFullNamePageModule) /* harmony export */ }); /* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/common */ 90944); /* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_angular_common__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/forms */ 2508); /* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ 61380); /* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_angular_router__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ionic/angular */ 93819); /* harmony import */ var _identity_validator_full_name_page__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity-validator-full-name.page */ 98293); /* harmony import */ var _shared_directives__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @shared/directives */ 94221); /* harmony import */ var _shared_module_shared_module_module__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared-module/shared-module.module */ 69270); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/core */ 45449); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_5__); const routes = [ { path: '', component: _identity_validator_full_name_page__WEBPACK_IMPORTED_MODULE_2__.IdentityValidatorFullNamePage } ]; class IdentityValidatorFullNamePageModule { } IdentityValidatorFullNamePageModule.ɵfac = function IdentityValidatorFullNamePageModule_Factory(t) { return new (t || IdentityValidatorFullNamePageModule)(); }; IdentityValidatorFullNamePageModule.ɵmod = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineNgModule"]({ type: IdentityValidatorFullNamePageModule }); IdentityValidatorFullNamePageModule.ɵinj = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjector"]({ imports: [_shared_module_shared_module_module__WEBPACK_IMPORTED_MODULE_4__.SharedModuleModule, _angular_common__WEBPACK_IMPORTED_MODULE_0__.CommonModule, _angular_forms__WEBPACK_IMPORTED_MODULE_6__.FormsModule, _angular_forms__WEBPACK_IMPORTED_MODULE_6__.ReactiveFormsModule, _ionic_angular__WEBPACK_IMPORTED_MODULE_7__.IonicModule, _angular_router__WEBPACK_IMPORTED_MODULE_1__.RouterModule.forChild(routes)] }); (function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵsetNgModuleScope"](IdentityValidatorFullNamePageModule, { declarations: [_identity_validator_full_name_page__WEBPACK_IMPORTED_MODULE_2__.IdentityValidatorFullNamePage, _shared_directives__WEBPACK_IMPORTED_MODULE_3__.FullNameMaskDirective], imports: [_shared_module_shared_module_module__WEBPACK_IMPORTED_MODULE_4__.SharedModuleModule, _angular_common__WEBPACK_IMPORTED_MODULE_0__.CommonModule, _angular_forms__WEBPACK_IMPORTED_MODULE_6__.FormsModule, _angular_forms__WEBPACK_IMPORTED_MODULE_6__.ReactiveFormsModule, _ionic_angular__WEBPACK_IMPORTED_MODULE_7__.IonicModule, _angular_router__WEBPACK_IMPORTED_MODULE_1__.RouterModule], exports: [_shared_directives__WEBPACK_IMPORTED_MODULE_3__.FullNameMaskDirective] }); })(); /***/ }), /***/ 98293: /*!********************************************************************************************!*\ !*** ./src/app/register/identity-validator-full-name/identity-validator-full-name.page.ts ***! \********************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "IdentityValidatorFullNamePage": () => (/* binding */ IdentityValidatorFullNamePage) /* harmony export */ }); /* harmony import */ var _Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 71670); /* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/forms */ 2508); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 45449); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _shared_services__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @shared/services */ 17253); /* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/router */ 61380); /* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_angular_router__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ionic/angular */ 93819); /* harmony import */ var _shared_services_init_register_has_company_storage_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @shared/services/init.register.has-company.storage.service */ 91056); /* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/common */ 90944); /* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_angular_common__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _shared_components_full_logo_full_logo_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/components/full-logo/full-logo.component */ 33159); /* harmony import */ var _shared_directives__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @shared/directives */ 94221); /* harmony import */ var _ngx_translate_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ngx-translate/core */ 38699); const _c0 = function (a0) { return { "min-height": a0, "position": "relative" }; }; class IdentityValidatorFullNamePage { constructor(formBuilder, api, activatedRoute, notificatorService, loadingService, keyboardService, sendVerificationEmailModalService, warnConflictModalService, ngZoneService, deviceInfoService, navigationService, logService, translateConfigService, authService, storageService, deviceUuidService, platform, saveFlowStorageResetKeyService, utilsService, showToastModalErroCodeZero, initRegisterHasCompanyStorageService) { var _this = this; this.formBuilder = formBuilder; this.api = api; this.activatedRoute = activatedRoute; this.notificatorService = notificatorService; this.loadingService = loadingService; this.keyboardService = keyboardService; this.sendVerificationEmailModalService = sendVerificationEmailModalService; this.warnConflictModalService = warnConflictModalService; this.ngZoneService = ngZoneService; this.deviceInfoService = deviceInfoService; this.navigationService = navigationService; this.logService = logService; this.translateConfigService = translateConfigService; this.authService = authService; this.storageService = storageService; this.deviceUuidService = deviceUuidService; this.platform = platform; this.saveFlowStorageResetKeyService = saveFlowStorageResetKeyService; this.utilsService = utilsService; this.showToastModalErroCodeZero = showToastModalErroCodeZero; this.initRegisterHasCompanyStorageService = initRegisterHasCompanyStorageService; this.onSendVerificationEmailModalStateChange = /*#__PURE__*/function () { var _ref = (0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (state) { yield _this.ngZoneService.run(() => { _this.showSendVerificationEmailModal = state.show; _this.emailSendVerificationEmailModal = state.email; }); }); return function (_x) { return _ref.apply(this, arguments); }; }(); this.onWarnConflictModalStateChange = /*#__PURE__*/function () { var _ref2 = (0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (state) { yield _this.ngZoneService.run(() => { _this.showWarnConflictModal = state.show; _this.emailWarnConflictModal = state.email; }); }); return function (_x2) { return _ref2.apply(this, arguments); }; }(); this.onSubmit = /*#__PURE__*/(0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { let uuidStorage = null; uuidStorage = yield _this.getUniqueDeviceId(); _this.uuid = uuidStorage ?? ''; if (!_this.uuid || _this.uuid === null || _this.uuid === undefined || _this.uuid.length <= 0) { _this.logService.logEvent('UUIID::in_Submit', 'Null UUID - Methodo Submit'); return; } const validationResult = _this.validateForm(_this.fullNameForm); if (!validationResult) { _this.logService.logError('user::register-full-name'); const notification = { title: _this.translateConfigService.translate('PG_IDENTIFY_FULLNAME_TOAST_INVALID_DATA_TITLE'), message: _this.translateConfigService.translate('PG_IDENTIFY_FULLNAME_TOAST_INVALID_DATA_MESSAGE'), type: 'error' }; _this.notificatorService.notify(notification); } else { let onHideSubscription = null; const onKeyboardHideCallback = () => { if (onHideSubscription) { onHideSubscription.unsubscribe(); } _this.loadingService.show(_this.translateConfigService.translate('LOADING_PROCESSING_DATA'), 'identity-validator-full-name'); const firstName = _this.getFirstName(); const lastName = _this.getLastName(); // KA_APP-715 _this.initRegisterHasCompanyStorageService.set({ document: _this.document, firstName: firstName, lastName: lastName, uuid: _this.uuid, context: _this.context, foreign: _this.foreign }); if (_this.foreign) { const documentUppercase = _this.utilsService.convertToUppercase(_this.document); _this.api.verifyForeignFullName(documentUppercase, firstName, lastName, _this.foreign).subscribe(_this.verifyFullNameSuccessResponse, _this.verifyFullNameErrorResponse); } else { _this.api.verifyFullName(_this.document, firstName, lastName, _this.foreign).subscribe(_this.verifyFullNameSuccessResponse, _this.verifyFullNameErrorResponse); } }; onHideSubscription = _this.keyboardService.onHideObservable?.subscribe(onKeyboardHideCallback); if (!_this.keyboardService.isVisible()) { onKeyboardHideCallback(); } else { _this.keyboardService.hide(); } } }); this.getFirstName = () => { let fullName = this.fullNameForm.controls.fullName.value; fullName = fullName.trim(); fullName = fullName.split(' '); return fullName[0] ? fullName[0] : ''; }; this.getLastName = () => { let fullName = this.fullNameForm.controls.fullName.value; fullName = fullName.trim(); fullName = fullName.split(' '); fullName = fullName.filter((namePiece, i) => i !== 0); return fullName.join(' '); }; this.validateForm = form => { const firstName = this.getFirstName(); const lastName = this.getLastName(); if (firstName && lastName) { const firstNameLength = firstName.length; const lastNameLength = lastName.length; return firstNameLength + lastNameLength > 2 && firstNameLength + lastNameLength < 255; } else { return false; } }; this.verifyFullNameForeignSuccessResponse = response => { this.checkAccount(); }; this.verifyFullNameSuccessResponse = response => { if (this.verifyIfMatch(response)) { this.checkAccount(); } else { this.logService.logEvent('user::register-full-name-no-match'); this.showErroNoMatchNameDocument(response); } }; this.verifyFullNameErrorResponse = response => { this.logService.logError('http::register-full-name', '', response); if (response && response?.error && response?.error?.errorKey && response?.error.status === 400) { const match = response?.error?.errorKey === 'notmatched' ? false : true; if (this.verifyIfMatch({ matched: match })) { this.checkAccount(); } else { this.showErroNoMatchNameDocument(response); return; } } this.loadingService.hide(null, 'identity-validator-full-name').then(() => { if (response?.status === 0) { this.showToastModalErroCodeZero.showToast(); this.logService.logError('http::register-full-name', 'Unknown error', response); return; } if (response.status === 400) { const notification = { title: this.translateConfigService.translate('PG_IDENTIFY_FULLNAME_TOAST_ERROR_REQUEST_TITLE'), message: `${this.translateConfigService.translate('PG_IDENTIFY_FULLNAME_TOAST_ERROR_REQUEST_MESSAGE')} (cod. 400)`, type: 'error' }; return this.notificatorService.notify(notification); } else if (response.status === 404) { this.checkAccount(); } else { let message; if (this.foreign) { message = this.translateConfigService.translate('PG_IDENTIFY_FULLNAME_TOAST_NOT_FOUND_MESSAGE'); } const notification = { title: this.translateConfigService.translate('PG_IDENTIFY_FULLNAME_TOAST_SERVICE_ERROR_TITLE'), message, type: 'error' }; this.notificatorService.notify(notification); } }); }; this.checkAccount = () => { const uuid = this.uuid; const document = this.document; const foreign = this.foreign; const documentUppercase = foreign ? this.utilsService.convertToUppercase(document) : document; this.api.accountCheck(uuid, documentUppercase, foreign).subscribe(this.accountCheckSuccessResponse, this.accountCheckErrorResponse); }; this.accountCheckSuccessResponse = response => { const hasAnyCompany = response && response.hasAnyCompany; const activated = response && response.activated; const obfuscatedEmail = response && response.obfuscatedEmail ? response.obfuscatedEmail : ''; if (!this.context && hasAnyCompany && activated) { this.context = 'has-company'; } this.loadingService.hide(null, 'identity-validator-full-name').then(() => { if (this.context === 'forgot-pin' || this.context === 'has-company') { this.onSendVerificationEmail(obfuscatedEmail, response); } else { this.goToCompanyCodeStep(response); } }); }; this.goToCompanyCodeStep = response => { const activated = response.activated ? response.activated : false; const email = response.obfuscatedEmail ? response.obfuscatedEmail : ''; const uuid = this.uuid; const document = this.document; const firstName = this.getFirstName(); const lastName = this.getLastName(); const conflict = false; const foreign = this.foreign; const documentUppercase = foreign ? this.utilsService.convertToUppercase(document) : document; const navigationOptions = { queryParams: { uuid, document: documentUppercase, firstName, lastName, email, conflict, activated, foreign } }; this.navigationService.forward(['/identity-validator-company-code'], navigationOptions); }; this.accountCheckErrorResponse = response => { this.loadingService.hide(null, 'identity-validator-full-name').then(() => { if (response.status === 404) { const uuid = this.uuid; const document = this.document; const firstName = this.getFirstName(); const lastName = this.getLastName(); const foreign = this.foreign; const navigationOptions = { queryParams: { uuid, document, firstName, lastName, foreign } }; this.navigationService.forward(['/identity-validator-company-code'], navigationOptions); } else if (response.status === 409) { if (response.error.conflictType === 'notFound') { // "notFound" achou alguém com o deviceId mas não tem uma conta para esse documento const uuid = this.uuid; const document = this.document; const firstName = this.getFirstName(); const lastName = this.getLastName(); const conflict = 'notFound'; const foreign = this.foreign; const navigationOptions = { queryParams: { uuid, document, firstName, lastName, conflict, foreign } }; this.navigationService.forward(['/identity-validator-company-code'], navigationOptions); } else if (response.error.conflictType === 'found') { // "found" achou ou não achou alguém com o deviceId mas tem uma conta com esse documento const hasAnyCompany = response && response.error.hasAnyCompany; const activated = response && response.error.activated; if (!this.context && hasAnyCompany && activated) { this.context = 'has-company'; } if (this.context === 'has-company') { const email = response.error.params; const uuid = this.uuid; const document = this.document; const firstName = this.getFirstName(); const lastName = this.getLastName(); const conflict = 'found'; const foreign = this.foreign; const navigationOptions = { queryParams: { hasAnyCompany, activated, uuid, document, firstName, lastName, email, conflict, foreign, context: this.context, obfuscatedEmail: response.error.params, ...response.error } }; const data = this.initRegisterHasCompanyStorageService.get(); // KA_APP-715 this.initRegisterHasCompanyStorageService.set({ document: data?.document ?? this.document ?? '', context: this.context ?? data?.context ?? '', hasAnyCompany, activated, uuid, firstName, lastName, email, conflict, foreign, obfuscatedEmail: response.error.params }); // navigationOptions this.navigationService.forward(['has-company/identity-email-confirmation']); // this.onSendVerificationEmail(response.error.params || null); KA_APP-715 } else { const email = response.error.params; const uuid = this.uuid; const document = this.document; const firstName = this.getFirstName(); const lastName = this.getLastName(); const conflict = 'found'; const foreign = this.foreign; const navigationOptions = { queryParams: { uuid, document, firstName, lastName, email, conflict, foreign } }; this.navigationService.forward(['/identity-validator-company-code'], navigationOptions); } } } else { this.logService.logError('http::account-check', '', response); const notification = { title: this.translateConfigService.translate('PG_IDENTIFY_FULLNAME_TOAST_SERVICE_ERROR_TITLE'), message: `${this.translateConfigService.translate('PG_IDENTIFY_FULLNAME_CHECKING_DATA_ERROR_MESSAGE')} (cod. ${response.status})`, type: 'error' }; this.notificatorService.notify(notification); } }); }; this.stepBack = () => { const document = this.document; const uuid = this.uuid; const foreign = this.foreign; const context = this.context; if (foreign) { const documentUppercase = this.utilsService.convertToUppercase(document); const navigationOptions = { queryParams: { document: documentUppercase, uuid, foreign, context } }; this.navigationService.back(['/foreign-document'], navigationOptions); } else { const navigationOptions = { queryParams: { document, uuid, foreign, context } }; this.navigationService.back(['/identity-validator'], navigationOptions); } }; this.onSendVerificationEmailModalBack = () => { this.sendVerificationEmailModalService.hideModal(); }; this.onSendVerificationEmail = /*#__PURE__*/(0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (obfuscatedEmail = null, response) { const uuid = _this.uuid; const document = _this.document; const foreign = _this.foreign; const firstName = _this.getFirstName(); const lastName = _this.getLastName(); const documentUppercase = foreign ? _this.utilsService.convertToUppercase(document) : document; _this.loadingService.show(_this.translateConfigService.translate('PG_IDENTIFY_FULLNAME_LOADING_SEND_MAIL'), 'send-email-verification'); const isInitForgot = yield _this.saveFlowStorageResetKeyService.getInitForgot(); if (response && isInitForgot && isInitForgot?.isInitiatedForgotten || _this.context === 'forgot-pin') { const currentLangKey = _this.translateConfigService.getCurrentLang() === 'pt' ? 'pt-Br' : _this.translateConfigService.getCurrentLang(); // TODO: pegar do storage essas informações abaixo. (email, firstname, refid, document) const email = response?.email ?? ''; const langKey = currentLangKey; const refId = (yield _this.authService.getRefId()) ?? null; const resetKey = ''; _this.saveFlowStorageResetKeyService.setDataResetKeyInit({ refId, firstName, email, obfuscatedEmail, langKey, document, resetKey }); const documentUppercase = foreign ? _this.utilsService.convertToUppercase(document) : document; _this.api.accountDeviceResetInit(uuid, documentUppercase, foreign, { refId, firstName, email, langKey, resetKey }).subscribe(() => _this.accountDeviceResetInitSuccessResponse(obfuscatedEmail), error => _this.accountDeviceResetInitErrorResponse(error)); } else { _this.api.accountDeviceResetInit(uuid, documentUppercase, foreign, null).subscribe(() => _this.accountDeviceResetInitSuccessResponse(obfuscatedEmail), error => _this.accountDeviceResetInitErrorResponse(error)); } }); this.onWarnConflictModalBack = () => { this.warnConflictModalService.hideModal(); }; this.onWarnConflictModalAccept = () => { const email = this.email; this.warnConflictModalService.hideModal(); this.sendVerificationEmailModalService.showModal(email); }; this.accountDeviceResetInitSuccessResponse = /*#__PURE__*/(0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (obfuscatedEmail = null) { yield _this.loadingService.hide(null, 'send-email-verification'); const uuid = _this.uuid; const document = _this.document; const firstName = _this.getFirstName(); const lastName = _this.getLastName(); const email = _this.email; const context = _this.context; const foreign = _this.foreign; const documentUppercase = foreign ? _this.utilsService.convertToUppercase(document) : document; const navigationOptions = { queryParams: { uuid, document: documentUppercase, firstName, lastName, email, context, foreign, obfuscatedEmail } }; _this.sendVerificationEmailModalService.hideModal(); if (_this.context === 'forgot-pin') { _this.navigationService.forward(['/identity-insert-password'], navigationOptions); } else { _this.navigationService.forward(['/identity-validator-code'], navigationOptions); } }); this.accountDeviceResetInitErrorResponse = /*#__PURE__*/function () { var _ref6 = (0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (response) { console.log('accountCheckErrorResponse'); console.log('response:', response); _this.logService.logError('http::account-device-reset-init', '', response); yield _this.loadingService.hide(null, 'send-email-verification'); if (response?.status === 0) { _this.showToastModalErroCodeZero.showToast(); _this.logService.logError('http::account-device-reset-init', 'Unknown error', response); return; } const { title, message } = _this.getTitleAndMessage(response); _this.toastNotificationError(title, message, 1000); }); return function (_x3) { return _ref6.apply(this, arguments); }; }(); this.getUniqueDeviceId = /*#__PURE__*/(0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { let uuidStorage = ''; const storageIsReady = yield _this.storageService.ready(); if (storageIsReady) { uuidStorage = yield _this.authService.getUUID(); } if (!uuidStorage || uuidStorage === undefined || uuidStorage === null) { return _this.deviceUuidService.getUUID().then(_this.onGetUniqueDeviceIdSuccessResponse).catch(_this.onGetUniqueDeviceIdErrorResponse); } else { _this.uuid = uuidStorage; return _this.uuid; } }); this.onGetUniqueDeviceIdSuccessResponse = /*#__PURE__*/function () { var _ref8 = (0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (uuid) { try { const saveUUID = yield _this.saveUUIDStorage(uuid); _this.uuid = saveUUID.uuid; return saveUUID.uuid; } catch (error) { return error; } }); return function (_x4) { return _ref8.apply(this, arguments); }; }(); this.onGetUniqueDeviceIdErrorResponse = error => { const message = this.translateConfigService.translate('PG_START_TOAST_AUTHORIZE'); const title = this.translateConfigService.translate('PG_START_TOAST_NOTICE_TITLE'); const notification = { title, message, type: 'error' }; this.notificatorService.notify(notification); }; } ionViewWillEnter() { // KA_APP-715 const data = this.initRegisterHasCompanyStorageService.get(); if (data) { this.document = data?.document ?? ''; this.context = data?.context ?? ''; this.foreign = data?.foreign === 'true' || data?.foreign === true; } } ngOnInit() { this.fullNameForm = this.formBuilder.group({ fullName: ['', [_angular_forms__WEBPACK_IMPORTED_MODULE_8__.Validators.required, _angular_forms__WEBPACK_IMPORTED_MODULE_8__.Validators.minLength(3), _angular_forms__WEBPACK_IMPORTED_MODULE_8__.Validators.maxLength(5)]] }); this.sendVerificationEmailModalService.observable.subscribe(this.onSendVerificationEmailModalStateChange); this.warnConflictModalService.observable.subscribe(this.onWarnConflictModalStateChange); } verifyIfMatch(data) { return data.matched; } getTitleAndMessage(response) { const title = this.translateConfigService.translate('PG_IDENTIFY_FULLNAME_TOAST_SERVICE_ERROR_TITLE'); const message = `${this.translateConfigService.translate('TOAST_SERVICE_TEMPORARILY_UNAVAILABLE_MESSAGE')} (cod. ${response.status})`; return { title, message }; } toastNotificationError(title, message, timeout) { const notification = { title, message, type: 'error', timeout }; this.notificatorService.notify(notification); } saveUUIDStorage(uuid) { var _this2 = this; return (0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { let resUUID = { uuid: '', success: false }; try { yield _this2.platform.ready(); try { const storageIsReady = yield _this2.storageService.ready(); if (storageIsReady) { try { yield _this2.authService.setUUID(uuid); resUUID = { uuid, success: true }; _this2.logService.logEvent('setUUIDIdentityValidadeFullName::', 'Success save UUID in storage', resUUID); return resUUID; } catch (error) { resUUID = { ...error, uuid: null, success: false }; _this2.logService.logError('ErrorSetUUIDIdentityValidadeFullName::', 'erro save UUID in storage', resUUID); throw resUUID; } } } catch (error) { _this2.logService.logError('ErrorstorageIdentityValidadeFullName::', 'not avaliable storage ready', error); throw error; } } catch (error) { _this2.logService.logError('platformReadyStartPage::', 'not avaliable platform ready', error); } })(); } showErroNoMatchNameDocument(response) { this.logService.logError('NoMatchNameDocument', '', { data: response }); this.loadingService.hide(null, 'identity-validator-full-name').then(() => { let message; let title; if (this.foreign) { title = this.translateConfigService.translate('PG_IDENTIFY_FULLNAME_TOAST_NO_MATCH_FOREIGN_TITLE'); message = this.translateConfigService.translate('PG_IDENTIFY_FULLNAME_TOAST_NO_MATCH_FOREIGN_MESSAGE'); } else { title = this.translateConfigService.translate('PG_IDENTIFY_FULLNAME_TOAST_NO_MATCH_TITLE'); message = this.translateConfigService.translate('PG_IDENTIFY_FULLNAME_TOAST_NO_MATCH_MESSAGE'); } const notification = { title, message, type: 'error', timeout: 8000 }; this.notificatorService.notify(notification); }); } } IdentityValidatorFullNamePage.ɵfac = function IdentityValidatorFullNamePage_Factory(t) { return new (t || IdentityValidatorFullNamePage)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_forms__WEBPACK_IMPORTED_MODULE_8__.UntypedFormBuilder), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_2__.ApiService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_router__WEBPACK_IMPORTED_MODULE_3__.ActivatedRoute), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_2__.NotificatorService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_2__.LoadingService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_2__.KeyboardService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_2__.SendVerificationEmailModalService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_2__.WarnConflictModalService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_2__.NgZoneService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_2__.DeviceInfoService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_2__.NavigationService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_2__.LogService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_2__.TranslateConfigService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_2__.AuthService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_2__.StorageService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_2__.DeviceUuidService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_ionic_angular__WEBPACK_IMPORTED_MODULE_9__.Platform), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_2__.SaveFlowStorageResetKeyService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_2__.UtilsService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_2__.ShowToastAndModalErroCodeZeroService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_shared_services_init_register_has_company_storage_service__WEBPACK_IMPORTED_MODULE_4__.InitRegisterHasCompanyStorageService)); }; IdentityValidatorFullNamePage.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ type: IdentityValidatorFullNamePage, selectors: [["app-identity-validator-full-name"]], decls: 22, vars: 16, consts: [[1, "ion-no-border", 2, "height", "0"], [3, "ngStyle"], ["tabindex", "-1", 1, "ion-margin-vertical"], [1, "flex-auto"], [1, "ion-margin-vertical"], [3, "formGroup", "ngSubmit"], [1, "input-holder"], ["tabindex", "-2", "for", "fullName"], ["tabindex", "0", "id", "fullName", "type", "text", "formControlName", "fullName", "appFullName", "", 3, "placeholder"], [1, "button-holder"], ["type", "button", 1, "back", 3, "click"], ["type", "submit", "tabindex", "3"]], template: function IdentityValidatorFullNamePage_Template(rf, ctx) { if (rf & 1) { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](0, "ion-header", 0); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](1, "ion-content")(2, "ion-grid", 1)(3, "ion-row")(4, "ion-col", 2); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](5, "app-full-logo"); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()(); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](6, "ion-row", 3)(7, "ion-col", 4)(8, "form", 5); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("ngSubmit", function IdentityValidatorFullNamePage_Template_form_ngSubmit_8_listener() { return ctx.onSubmit(); }); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](9, "div", 6)(10, "label", 7); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](11); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipe"](12, "translate"); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](13, "input", 8); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipe"](14, "translate"); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](15, "div", 9)(16, "button", 10); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click", function IdentityValidatorFullNamePage_Template_button_click_16_listener() { return ctx.stepBack(); }); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](17); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipe"](18, "translate"); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"](); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](19, "button", 11); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](20); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipe"](21, "translate"); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()()()()()()(); } if (rf & 2) { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("ngStyle", _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpureFunction1"](14, _c0, ctx.deviceInfoService.getDeviceHeight() + "px")); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](6); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("formGroup", ctx.fullNameForm); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](3); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtextInterpolate1"](" ", _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipeBind1"](12, 6, "PG_IDENTIFY_FULLNAME_TEXT"), " "); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("placeholder", _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipeBind1"](14, 8, "PG_IDENTIFY_FULLNAME_INPUT")); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](4); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtextInterpolate1"](" ", _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipeBind1"](18, 10, "BTN_BACK"), " "); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](3); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtextInterpolate"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipeBind1"](21, 12, "BTN_NEXT")); } }, dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_5__.NgStyle, _ionic_angular__WEBPACK_IMPORTED_MODULE_9__.IonCol, _ionic_angular__WEBPACK_IMPORTED_MODULE_9__.IonContent, _ionic_angular__WEBPACK_IMPORTED_MODULE_9__.IonGrid, _ionic_angular__WEBPACK_IMPORTED_MODULE_9__.IonHeader, _ionic_angular__WEBPACK_IMPORTED_MODULE_9__.IonRow, _angular_forms__WEBPACK_IMPORTED_MODULE_8__["ɵNgNoValidate"], _angular_forms__WEBPACK_IMPORTED_MODULE_8__.DefaultValueAccessor, _angular_forms__WEBPACK_IMPORTED_MODULE_8__.NgControlStatus, _angular_forms__WEBPACK_IMPORTED_MODULE_8__.NgControlStatusGroup, _angular_forms__WEBPACK_IMPORTED_MODULE_8__.FormGroupDirective, _angular_forms__WEBPACK_IMPORTED_MODULE_8__.FormControlName, _shared_components_full_logo_full_logo_component__WEBPACK_IMPORTED_MODULE_6__.FullLogoComponent, _shared_directives__WEBPACK_IMPORTED_MODULE_7__.FullNameMaskDirective, _ngx_translate_core__WEBPACK_IMPORTED_MODULE_10__.TranslatePipe], styles: ["\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJpZGVudGl0eS12YWxpZGF0b3ItZnVsbC1uYW1lLnBhZ2Uuc2NzcyJ9 */"] }); /***/ }), /***/ 91056: /*!******************************************************************************!*\ !*** ./src/app/shared/services/init.register.has-company.storage.service.ts ***! \******************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "InitRegisterHasCompanyStorageService": () => (/* binding */ InitRegisterHasCompanyStorageService) /* harmony export */ }); /* harmony import */ var _Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 71670); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 45449); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _simple_storage_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./simple.storage.service */ 19725); class InitRegisterHasCompanyStorageService { constructor(simpleStorageService) { this.simpleStorageService = simpleStorageService; this.KEY = 'REGISTER_HAS_COMPANY'; this.cache = null; // Cache em memória opcional } set(data) { this.simpleStorageService.set(this.KEY, data); this.cache = data; // Atualiza o cache } get() { const data = this.simpleStorageService.get(this.KEY); this.cache = data; // Atualiza o cache return data; } remove() { var _this = this; return (0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { _this.simpleStorageService.remove(_this.KEY); _this.cache = null; // Limpa o cache })(); } } InitRegisterHasCompanyStorageService.ɵfac = function InitRegisterHasCompanyStorageService_Factory(t) { return new (t || InitRegisterHasCompanyStorageService)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_simple_storage_service__WEBPACK_IMPORTED_MODULE_2__.SimpleStorageService)); }; InitRegisterHasCompanyStorageService.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: InitRegisterHasCompanyStorageService, factory: InitRegisterHasCompanyStorageService.ɵfac, providedIn: 'root' }); /***/ }), /***/ 19725: /*!***********************************************************!*\ !*** ./src/app/shared/services/simple.storage.service.ts ***! \***********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "SimpleStorageService": () => (/* binding */ SimpleStorageService) /* 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__); class SimpleStorageService { constructor() { } set(key, value) { localStorage.setItem(key, JSON.stringify(value)); } get(key) { const item = JSON.parse(localStorage.getItem(key)); return item ?? null; } remove(key) { localStorage.removeItem(key); } clear() { localStorage.clear(); } } SimpleStorageService.ɵfac = function SimpleStorageService_Factory(t) { return new (t || SimpleStorageService)(); }; SimpleStorageService.ɵprov = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: SimpleStorageService, factory: SimpleStorageService.ɵfac, providedIn: 'root' }); /***/ }) }]) //# sourceMappingURL=534.js.map