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

/***/ 25085:
/*!**************************************************************************************!*\
  !*** ./src/app/register/identity-validator-email/identity-validator-email.module.ts ***!
  \**************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "IdentityValidatorEmailPageModule": () => (/* binding */ IdentityValidatorEmailPageModule)
/* 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_5__ = __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_6__ = __webpack_require__(/*! @ionic/angular */ 93819);
/* harmony import */ var _identity_validator_email_page__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity-validator-email.page */ 51142);
/* harmony import */ var _shared_module_shared_module_module__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared-module/shared-module.module */ 69270);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/core */ 45449);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_4__);








const routes = [
    {
        path: '',
        component: _identity_validator_email_page__WEBPACK_IMPORTED_MODULE_2__.IdentityValidatorEmailPage
    }
];
class IdentityValidatorEmailPageModule {
}
IdentityValidatorEmailPageModule.ɵfac = function IdentityValidatorEmailPageModule_Factory(t) { return new (t || IdentityValidatorEmailPageModule)(); };
IdentityValidatorEmailPageModule.ɵmod = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineNgModule"]({ type: IdentityValidatorEmailPageModule });
IdentityValidatorEmailPageModule.ɵinj = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineInjector"]({ imports: [_shared_module_shared_module_module__WEBPACK_IMPORTED_MODULE_3__.SharedModuleModule,
        _angular_common__WEBPACK_IMPORTED_MODULE_0__.CommonModule,
        _angular_forms__WEBPACK_IMPORTED_MODULE_5__.FormsModule,
        _angular_forms__WEBPACK_IMPORTED_MODULE_5__.ReactiveFormsModule,
        _ionic_angular__WEBPACK_IMPORTED_MODULE_6__.IonicModule,
        _angular_router__WEBPACK_IMPORTED_MODULE_1__.RouterModule.forChild(routes)] });
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵsetNgModuleScope"](IdentityValidatorEmailPageModule, { declarations: [_identity_validator_email_page__WEBPACK_IMPORTED_MODULE_2__.IdentityValidatorEmailPage], imports: [_shared_module_shared_module_module__WEBPACK_IMPORTED_MODULE_3__.SharedModuleModule,
        _angular_common__WEBPACK_IMPORTED_MODULE_0__.CommonModule,
        _angular_forms__WEBPACK_IMPORTED_MODULE_5__.FormsModule,
        _angular_forms__WEBPACK_IMPORTED_MODULE_5__.ReactiveFormsModule,
        _ionic_angular__WEBPACK_IMPORTED_MODULE_6__.IonicModule, _angular_router__WEBPACK_IMPORTED_MODULE_1__.RouterModule] }); })();


/***/ }),

/***/ 51142:
/*!************************************************************************************!*\
  !*** ./src/app/register/identity-validator-email/identity-validator-email.page.ts ***!
  \************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "IdentityValidatorEmailPage": () => (/* binding */ IdentityValidatorEmailPage)
/* 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 _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 _ionic_angular__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ionic/angular */ 93819);
/* 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_components_privacy_footer_privacy_footer_component__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../shared/components/privacy-footer/privacy-footer.component */ 71237);
/* 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 IdentityValidatorEmailPage {
  constructor(formBuilder, api, activatedRoute, notificatorService, loadingService, keyboardService, deviceInfoService, navigationService, commonService, logService, translateConfigService, utilsService, storageService, authService, initRegisterHasCompanyStorageService) {
    var _this = this;

    this.formBuilder = formBuilder;
    this.api = api;
    this.activatedRoute = activatedRoute;
    this.notificatorService = notificatorService;
    this.loadingService = loadingService;
    this.keyboardService = keyboardService;
    this.deviceInfoService = deviceInfoService;
    this.navigationService = navigationService;
    this.commonService = commonService;
    this.logService = logService;
    this.translateConfigService = translateConfigService;
    this.utilsService = utilsService;
    this.storageService = storageService;
    this.authService = authService;
    this.initRegisterHasCompanyStorageService = initRegisterHasCompanyStorageService;

    this.onSubmit = () => {
      const validationResult = this.validateForm(this.emailForm);

      if (!validationResult) {
        const title = this.translateConfigService.translate('PG_IDENTIFY_VALIDATOR_EMAIL_TOAST_INVALID_DATA_TITLE');
        const message = this.translateConfigService.translate('PG_IDENTIFY_VALIDATOR_EMAIL_TOAST_INVALID_DATA_MESSAGE');
        const notification = {
          title,
          message,
          type: 'error'
        };
        this.notificatorService.notify(notification);
      } else {
        const uuid = this.uuid;
        const document = this.document;
        const firstName = this.firstName;
        const lastName = this.lastName;
        const foreign = this.foreign;
        const email = this.emailForm.controls.email.value;
        let onHideSubscription = null;

        const onKeyboardHideCallback = () => {
          if (onHideSubscription) {
            onHideSubscription.unsubscribe();
          }

          const loadingData = this.translateConfigService.translate('LOADING_PROCESSING_DATA');
          this.loadingService.show(loadingData, 'identity-validator-email');
          let lang = this.translateConfigService.getCurrentLang() ? this.translateConfigService.getCurrentLang() : 'en';

          if (lang === 'pt') {
            lang = 'pt-br';
          }

          this.api.accountRegister(uuid, document, firstName, lastName, email, lang, '', foreign).subscribe(this.onAccountRegisterSuccessResponse, this.onAccountRegisterErrorResponse);
        };

        onHideSubscription = this.keyboardService.onHideObservable?.subscribe(onKeyboardHideCallback);

        if (!this.keyboardService.isVisible()) {
          onKeyboardHideCallback();
        } else {
          this.keyboardService.hide();
        }
      }
    };

    this.validateForm = form => {
      const email = this.commonService.clearString(form.controls.email.value);
      return this.utilsService.validateEmail(email);
    };

    this.onAccountRegisterSuccessResponse = response => {
      this.loadingService.hide(null, 'identity-validator-email').then(() => {
        this.goToNextStep();
      });
    };

    this.onAccountRegisterErrorResponse = response => {
      console.log('onSubmitErrorResponse');
      console.log(response);
      this.logService.logError('http::onAccountRegisterErrorResponse', '', response);
      this.loadingService.hide(null, 'identity-validator-email').then();
    };

    this.goToNextStep = () => {
      const uuid = this.uuid;
      const document = this.document;
      const firstName = this.firstName;
      const lastName = this.lastName;
      const foreign = this.foreign;
      const navigationOptions = {
        queryParams: {
          uuid,
          document,
          firstName,
          lastName,
          foreign,
          context: 'validate-email'
        }
      }; // KA_APP-715

      this.initRegisterHasCompanyStorageService.set({
        document,
        firstName,
        lastName,
        uuid,
        foreign,
        context: 'validate-email'
      });
      this.navigationService.forward(['/identity-validator-code'], navigationOptions);
    };

    this.goOneStepBack = () => {
      const uuid = this.uuid;
      const document = this.document;
      const firstName = this.firstName;
      const lastName = this.lastName;
      const foreign = this.foreign;
      const navigationOptions = {
        queryParams: {
          uuid,
          document,
          firstName,
          lastName,
          foreign
        }
      }; // KA_APP-715

      this.initRegisterHasCompanyStorageService.set({
        uuid,
        document,
        firstName,
        lastName,
        foreign
      });
      this.navigationService.back(['/identity-validator-full-name'], navigationOptions);
    };

    this.activatedRoute.queryParams.subscribe( /*#__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* (params) {
        let uuidStorage = null;
        const storageIsReady = yield _this.storageService.ready();

        if (storageIsReady) {
          uuidStorage = yield _this.authService.getUUID();
        }

        _this.uuid = uuidStorage ? uuidStorage : params.uuid ? params.uuid : '';
      });

      return function (_x) {
        return _ref.apply(this, arguments);
      };
    }());
  }

  ngOnInit() {
    this.emailForm = this.formBuilder.group({
      email: ['', [_angular_forms__WEBPACK_IMPORTED_MODULE_8__.Validators.required, _angular_forms__WEBPACK_IMPORTED_MODULE_8__.Validators.email]]
    });
  }

  ionViewWillEnter() {
    // KA_APP-715
    const data = this.initRegisterHasCompanyStorageService.get();

    if (data) {
      this.uuid = data.uuid ? data.uuid : '';
      this.document = data.document ? data.document : '';
      this.firstName = data.firstName ? data.firstName : '';
      this.lastName = data.lastName ? data.lastName : '';
      this.foreign = data?.foreign === 'true' || data?.foreign === true;
    }
  }

}

IdentityValidatorEmailPage.ɵfac = function IdentityValidatorEmailPage_Factory(t) {
  return new (t || IdentityValidatorEmailPage)(_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__.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__.CommonService), _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__.UtilsService), _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__.AuthService), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_shared_services_init_register_has_company_storage_service__WEBPACK_IMPORTED_MODULE_4__.InitRegisterHasCompanyStorageService));
};

IdentityValidatorEmailPage.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({
  type: IdentityValidatorEmailPage,
  selectors: [["app-identity-validator-email"]],
  decls: 24,
  vars: 16,
  consts: [[1, "ion-no-border", 2, "height", "0"], [3, "ngStyle"], [1, "ion-margin-vertical"], [1, "flex-auto"], [3, "formGroup", "ngSubmit"], [1, "input-holder"], ["for", "email"], ["id", "email", "type", "email", "formControlName", "email", 3, "placeholder"], [1, "button-holder"], ["type", "button", 1, "back", 3, "click"], ["type", "submit"], [1, "footer-privacy"]],
  template: function IdentityValidatorEmailPage_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", 2)(8, "form", 4);
      _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("ngSubmit", function IdentityValidatorEmailPage_Template_form_ngSubmit_8_listener() {
        return ctx.onSubmit();
      });
      _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](9, "div", 5)(10, "label", 6);
      _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", 7);
      _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", 8)(16, "button", 9);
      _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click", function IdentityValidatorEmailPage_Template_button_click_16_listener() {
        return ctx.goOneStepBack();
      });
      _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", 10);
      _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](20);
      _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipe"](21, "translate");
      _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()()()()();
      _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](22, "span", 11);
      _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](23, "app-privacy-footer");
      _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.emailForm);
      _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_VALIDATOR_EMAIL_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_VALIDATOR_EMAIL_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, "PG_IDENTIFY_VALIDATOR_EMAIL_BTN_SEND"));
    }
  },
  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_components_privacy_footer_privacy_footer_component__WEBPACK_IMPORTED_MODULE_7__.PrivacyFooterComponent, _ngx_translate_core__WEBPACK_IMPORTED_MODULE_10__.TranslatePipe],
  styles: [".footer-privacy[_ngcontent-%COMP%] {\n  position: absolute;\n  bottom: calc(30px + env(safe-area-inset-bottom)) !important;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlkZW50aXR5LXZhbGlkYXRvci1lbWFpbC5wYWdlLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSxrQkFBQTtFQUNBLDJEQUFBO0FBQ0YiLCJmaWxlIjoiaWRlbnRpdHktdmFsaWRhdG9yLWVtYWlsLnBhZ2Uuc2NzcyIsInNvdXJjZXNDb250ZW50IjpbIi5mb290ZXItcHJpdmFjeSB7XG4gIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgYm90dG9tOiBjYWxjKDMwcHggKyBlbnYoc2FmZS1hcmVhLWluc2V0LWJvdHRvbSkpICFpbXBvcnRhbnQ7XG59XG4iXX0= */"]
});

/***/ }),

/***/ 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=5085.js.map