1 line
18 KiB
JavaScript
1 line
18 KiB
JavaScript
(self.webpackChunkapp=self.webpackChunkapp||[]).push([[3794],{13794:(G,C,c)=>{c.r(C),c.d(C,{IdentityValidatorCodePageModule:()=>X});var p=c(90944),v=c(24006),y=c(61380),g=c(90603),l=c(15861),h=c(24889),i=c(64633),e=c(45449),s=c(47898),b=c(37763),L=c(45944),K=c(33159),j=c(71237),B=c(99826);function H(d,O){if(1&d&&(e.\u0275\u0275elementStart(0,"ion-text")(1,"div",19),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd()()),2&d){const n=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(n.obfuscatedEmail)}}const $=function(d){return{"min-height":d,position:"relative"}},Y=function(d){return{"":d}},U=function(d){return{"input-holder-small-device":d}},k=function(d){return{"small-device":d}};let Z=(()=>{class d{constructor(n,r,a,m,u,_,T,F,x,M,z,Q,J,q,ee,te,ne,oe){var t=this;this.formBuilder=n,this.api=r,this.activatedRoute=a,this.notificatorService=m,this.loadingService=u,this.keyboardService=_,this.deviceInfoService=T,this.navigationService=F,this.commonService=x,this.storageService=M,this.logService=z,this.translateConfigService=Q,this.focusService=J,this.authService=q,this.saveFlowStorageResetKeyService=ee,this.showToastModalErroCodeZero=te,this.modalCtrl=ne,this.initRegisterHasCompanyStorageService=oe,this.onSubmit=()=>{if(this.codeForm.get("code").errors){const o=this.translateConfigService.translate("PG_IDENTIFY_VALIDATOR_CODE_TOAST_INVALID_CODE_TITLE"),f=this.translateConfigService.translate("PG_IDENTIFY_VALIDATOR_CODE_TOAST_INVALID_CODE_MESSAGE");this.notificatorService.notify({title:o,message:f,type:"error"})}else{this.submitted=!0;let o=null;const f=()=>{o&&o.unsubscribe(),this.loadingService.show(this.translateConfigService.translate("LOADING_PROCESSING_DATA"),"identity-validator-code");const S=this.commonService.clearString(this.codeForm.controls.code.value),E=this.uuid,P=this.document,D=this.foreign;if("validate-email"===this.context)this.api.accountActivate(S,E,P,D).subscribe(this.accountActivateSuccessResponse,this.accountActivateErrorResponse);else if("change-device-identifier"===this.context||"forgot-pin"===this.context||"has-company"===this.context)return this.forgortPinORDeviceResetFinisth(S,E,P,D)};o=this.keyboardService.onHideObservable?.subscribe(f),this.keyboardService.isVisible()?this.keyboardService.hide():f()}},this.accountActivateSuccessResponse=function(){var I=(0,l.Z)(function*(o){t.submitted=!1,yield t.loadingService.hide(null,"identity-validator-code");const f=t.translateConfigService.translate("PG_IDENTIFY_VALIDATOR_CODE_TOAST_SERVICE_ERROR_TITLE"),S=t.translateConfigService.translate("TOAST_SERVICE_TEMPORARILY_UNAVAILABLE_MESSAGE");o?"email-validation"===o.codeType?t.goToEmailValidationNextStep():"company-invite"===o.codeType?(t.storageService.set("company-invitation-data",{locator:o.locator,invitationKey:o.invitationKey}),t.goToEmailValidationNextStep()):t.notificatorService.notify({title:f,message:`${S} (cod. NoCoDeTyPe)`,type:"error"}):t.notificatorService.notify({title:f,message:`${S} (cod. NoBoDy)`,type:"error"})});return function(o){return I.apply(this,arguments)}}(),this.goToEmailValidationNextStep=()=>{this.navigationService.forward(["/identity-insert-password"],{queryParams:{uuid:this.uuid,document:this.document,foreign:this.foreign}})},this.accountActivateErrorResponse=function(){var I=(0,l.Z)(function*(o){if(console.log("accountActivateErrorResponse"),console.log(o),t.submitted=!1,yield t.loadingService.hide(null,"identity-validator-code"),t.logService.logError("http::accountActivateErrorResponse","",o),0===o?.status)return t.showToastModalErroCodeZero.showToast(),void t.logService.logError("http::accountActivateErrorResponse","Unknown error",o);if(400===o?.status){const P=o?.error&&"error.invitenotmatched"===o.error.message,D=o?.error&&"nomatch"===o?.error?.errorKey;if(o?.error&&"nomatchforeignflag"===o.error.errorKey){const A=t.foreign?"PG_IDENTIFY_COMPANY_CODE_TOAST_NOT_ENABLED_FOREINGFLAG_MESSAGE":"PG_IDENTIFY_COMPANY_CODE_TOAST_NOMATCHFOREINGFLAG_MESSAGE";t.logService.logError("http::accountActivateErrorResponseNoMatch","",o);const R=t.translateConfigService.translate("PG_IDENTIFY_COMPANY_CODE_TOAST_NOMATCHFOREINGFLAG_TITLE"),N=t.translateConfigService.translate(A);return t.notificatorService.notify({title:R,message:N,type:"error",timeout:1e4})}if(P){const A=t.translateConfigService.translate("PG_INVITE_COMPANY_CODE_TOAST_INVALID_NAME_MESSAGE_TEXT_FOREIGN"),N=`${t.translateConfigService.translate("PG_INVITE_COMPANY_CODE_TOAST_INVALID_NAME_MESSAGE")} ${t.foreign?A:"CPF"}.`,V={title:t.translateConfigService.translate("PG_INVITE_COMPANY_CODE_TOAST_INVALID_NAME_TITLE"),message:N,type:"error",timeout:12e3};return t.notificatorService.notify(V)}if(D){const N={title:t.translateConfigService.translate("PG_IDENTIFY_COMPANY_CODE_TOAST_NOMATCH_TITTLE"),message:t.translateConfigService.translate("PG_IDENTIFY_COMPANY_CODE_TOAST_NOMATCH_MESSAGE"),type:"error",timeout:1e4,action:{label:t.translateConfigService.translate("PG_IDENTIFY_COMPANY_CODE_TOAST_NOMATCH_MESSAGE_ACTION_LABEL"),customAction:t.openModalNoMatchName.bind(t)}};return t.notificatorService.notify(N)}const ie=t.translateConfigService.translate("PG_IDENTIFY_VALIDATOR_CODE_TOAST_INVALID_DATA_TITLE"),re=`${t.translateConfigService.translate("PG_IDENTIFY_VALIDATOR_CODE_TOAST_INVALID_DATA_MESSAGE")} (cod. ${o.status})`;return t.toastNotificationError(ie,re,5e3)}const{title:f,message:S}=t.getTitleAndMessage(o);t.toastNotificationError(f,S,1e3)});return function(o){return I.apply(this,arguments)}}(),this.cancel=(0,l.Z)(function*(){"forgot-pin"===t.context?(yield t.saveFlowStorageResetKeyService.clearInitForgot(),t.navigationService.root(["/identity-check"])):t.navigationService.forward(["/start"])}),this.activatedRoute.queryParams.subscribe(function(){var I=(0,l.Z)(function*(o){let f=null;(yield t.storageService.ready())&&(f=yield t.authService.getUUID()),t.uuid=f||(o.uuid?o.uuid:""),t.document=o.document?o.document:"",t.obfuscatedEmail=o.obfuscatedEmail?o.obfuscatedEmail:"",t.context=o.context?o.context:"",t.foreign="true"===o.foreign});return function(o){return I.apply(this,arguments)}}())}ionViewWillEnter(){this.submitted=!1,this.focusService.applyFocusQuerySelector("insertCode",3e3)}ngOnInit(){this.codeForm=this.formBuilder.group({code:["",[v.Validators.required,v.Validators.minLength(6),v.Validators.maxLength(8)]]})}openModal(n){var r=this;return(0,l.Z)(function*(){if(!n)return;const a=yield r.modalCtrl.create({component:"not-receive-code"===n?i.$9:i.XS,cssClass:"modal-receive-code-or-not-receive-email"});yield a.present(),yield a.onDidDismiss()})()}getTitleAndMessage(n){let r="",a="";const m=n?.status?`(cod. ${n.status})`:"";return r=this.translateConfigService.translate("PG_IDENTIFY_VALIDATOR_CODE_TOAST_SERVICE_ERROR_TITLE"),a=`${this.translateConfigService.translate("TOAST_SERVICE_TEMPORARILY_UNAVAILABLE_MESSAGE")} ${m}`,{title:r,message:a}}toastNotificationError(n,r,a){this.notificatorService.notify({title:n,message:r,type:"error",timeout:a})}forgortPinORDeviceResetFinisth(n,r,a,m){var u=this;return(0,l.Z)(function*(){let _=yield u.saveFlowStorageResetKeyService.getDataResetKeyInit();const T=yield u.saveFlowStorageResetKeyService.getInitForgot();return(T&&T?.isInitiatedForgotten||"forgot-pin"===u.context)&&_&&_?.document&&n?(_.resetKey=n,yield u.saveFlowStorageResetKeyService.setDataResetKeyInit(_),u.resetPinForget(_.newHashedPin,n)):u.api.accountDeviceResetFinish(n,r,a,m).subscribe(u.accountActivateSuccessResponse,u.accountActivateErrorResponse)})()}resetPinForget(n,r){var a=this;return(0,l.Z)(function*(){let m=null;try{yield a.api.resetPinFinish({newHashedPin:n,resetKey:r}).toPromise(),a.loadingService.hide(null,"identity-validator-code").then(()=>{a.navigationService.root(["/home"])})}catch(u){m=u,a.handleErrorResetPinFinish(u),a.logService.log("httpError::resetPinFinsh","Error request http /pins/reset-finish",u)}finally{a.loadingService.hide(null,"identity-validator-code"),m||a.saveFlowStorageResetKeyService.clearAllDataResetKeyInit(),a.initRegisterHasCompanyStorageService.remove()}})()}handleErrorResetPinFinish(n){if(this.submitted=!1,n?.error){const r=this.translateConfigService.translate("TOAST_TITLE_ERROR"),a=this.translateConfigService.translate("PG_IDENTIFY_INSERT_CODE_INVALID");"reset_key_not_found"===n.error.errorKey?(this.notificatorService.notify({title:r,message:a,type:"error",timeout:8e3}),this.logService.log("httpError::resetPinFinsh","reset_key_not_found",n)):this.logService.log("httpError::resetPinFinsh","",n)}}openModalNoMatchName(){var n=this;return(0,l.Z)(function*(){const r=n.foreign?"PG_IDENTIFY_COMPANY_CODE_NOMATCH_MESSAGE_FOREING":"PG_IDENTIFY_COMPANY_CODE_NOMATCH_MESSAGE",a=n.deviceInfoService.isSmallScreen(),m=n.deviceInfoService.isMediumSmallScreen(),F=(n.deviceInfoService.getDeviceHeight(),a?"modal-generic-component-invalidName -small":m?"modal-generic-component-invalidName -medium":"modal-generic-component-invalidName class-default"),x={title:null,description:`${n.translateConfigService.translate(r)}`,type:"error",typename:h.sX.nomatchInvalidName,img:null,actionsButton:[{label:n.translateConfigService.translate("BTN_CLOSE"),enabled:!0,action:()=>n.modalCtrl.dismiss()}]},M=yield n.modalCtrl.create({component:h.rD,cssClass:F,componentProps:{props:x}});M.style.setProperty("--height","calc(100% - 32%)"),yield M.present()})()}}return d.\u0275fac=function(n){return new(n||d)(e.\u0275\u0275directiveInject(v.UntypedFormBuilder),e.\u0275\u0275directiveInject(s.sM),e.\u0275\u0275directiveInject(y.ActivatedRoute),e.\u0275\u0275directiveInject(s.V6),e.\u0275\u0275directiveInject(s.bz),e.\u0275\u0275directiveInject(s.i8),e.\u0275\u0275directiveInject(s.Hc),e.\u0275\u0275directiveInject(s.f5),e.\u0275\u0275directiveInject(s.v_),e.\u0275\u0275directiveInject(s.V1),e.\u0275\u0275directiveInject(s.$V),e.\u0275\u0275directiveInject(s.wK),e.\u0275\u0275directiveInject(b.i),e.\u0275\u0275directiveInject(s.e8),e.\u0275\u0275directiveInject(s.RQ),e.\u0275\u0275directiveInject(s.ME),e.\u0275\u0275directiveInject(g.ModalController),e.\u0275\u0275directiveInject(L.K))},d.\u0275cmp=e.\u0275\u0275defineComponent({type:d,selectors:[["app-identity-validator-code"]],decls:38,vars:37,consts:[[1,"ion-no-border",2,"height","0"],[3,"ngStyle"],[3,"ngClass"],[1,"identy-validate-code-page"],[1,"flex-auto"],[3,"formGroup","ngSubmit"],[1,"input-holder",3,"ngClass"],[1,"text-send-code-to-email"],[4,"ngIf"],["id","code","type","code","formControlName","code",3,"maxlength","placeholder"],[1,"btns-modal"],[1,"btn-not","receive-code"],["mode","ios","shape","round",3,"click"],[1,"btn-not","existe-email"],[1,"button-holder"],["type","button","tabindex","4",1,"back",3,"click"],["type","submit",3,"disabled","click"],["tabindex","2"],["tabindex","4",1,"footer-privacy",3,"ngClass"],[1,"obfuscated-email"]],template:function(n,r){1&n&&(e.\u0275\u0275element(0,"ion-header",0),e.\u0275\u0275elementStart(1,"ion-content")(2,"ion-grid",1)(3,"ion-row")(4,"ion-col",2),e.\u0275\u0275element(5,"app-full-logo",3),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(6,"ion-row",4)(7,"ion-col",2)(8,"form",5),e.\u0275\u0275listener("ngSubmit",function(){return r.onSubmit()}),e.\u0275\u0275elementStart(9,"div",6)(10,"ion-label")(11,"ion-text",7),e.\u0275\u0275text(12),e.\u0275\u0275pipe(13,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(14,H,3,1,"ion-text",8),e.\u0275\u0275element(15,"input",9),e.\u0275\u0275pipe(16,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(17,"div",10)(18,"div",11)(19,"ion-button",12),e.\u0275\u0275listener("click",function(){return r.openModal("not-receive-code")}),e.\u0275\u0275elementStart(20,"span"),e.\u0275\u0275text(21),e.\u0275\u0275pipe(22,"translate"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(23,"div",13)(24,"ion-button",12),e.\u0275\u0275listener("click",function(){return r.openModal("not-exist-email")}),e.\u0275\u0275elementStart(25,"span"),e.\u0275\u0275text(26),e.\u0275\u0275pipe(27,"translate"),e.\u0275\u0275elementEnd()()()()()()(),e.\u0275\u0275elementStart(28,"div",14)(29,"button",15),e.\u0275\u0275listener("click",function(){return r.cancel()}),e.\u0275\u0275text(30),e.\u0275\u0275pipe(31,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(32,"button",16),e.\u0275\u0275listener("click",function(){return r.onSubmit()}),e.\u0275\u0275elementStart(33,"span",17),e.\u0275\u0275text(34),e.\u0275\u0275pipe(35,"translate"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(36,"span",18),e.\u0275\u0275element(37,"app-privacy-footer"),e.\u0275\u0275elementEnd()()()),2&n&&(e.\u0275\u0275advance(2),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(27,$,r.deviceInfoService.getDeviceHeight()+"px")),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(29,Y,r.deviceInfoService.isSmallScreen()?"ion-margin-bottom":"ion-margin-vertical")),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(31,Y,r.deviceInfoService.isSmallScreen()?"ion-no-margin":"ion-margin-vertical")),e.\u0275\u0275advance(1),e.\u0275\u0275property("formGroup",r.codeForm),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(33,U,r.deviceInfoService.isSmallScreen())),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(13,15,"SEND_CODE_EMAIL")),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.obfuscatedEmail),e.\u0275\u0275advance(1),e.\u0275\u0275property("maxlength",8)("placeholder",e.\u0275\u0275pipeBind1(16,17,"INPUT_INSERT_CODE")),e.\u0275\u0275advance(6),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(22,19,"NOT_RECEIVE_CODE")," "),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(27,21,"NOT_EXIST_EMAIL")," "),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(31,23,"PG_IDENTIFY_VALIDATOR_CODE_BTN_CANCEL")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",r.submitted),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(35,25,"PG_IDENTIFY_VALIDATOR_CODE_BTN_NEXT"),""),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(35,k,r.deviceInfoService.isSmallScreen())))},dependencies:[p.NgClass,p.NgIf,p.NgStyle,g.IonButton,g.IonCol,g.IonContent,g.IonGrid,g.IonHeader,g.IonLabel,g.IonRow,g.IonText,v.\u0275NgNoValidate,v.DefaultValueAccessor,v.NgControlStatus,v.NgControlStatusGroup,v.MaxLengthValidator,v.FormGroupDirective,v.FormControlName,K.R,j.M,B.X$],styles:[".obfuscated-email[_ngcontent-%COMP%]{text-align:center;margin:8px 0;font-weight:700}.btns-modal[_ngcontent-%COMP%]{display:flex;position:relative;flex-direction:column;align-content:center;align-items:center;margin:24px 0}.btns-modal[_ngcontent-%COMP%] .btn-not[_ngcontent-%COMP%] ion-button[_ngcontent-%COMP%]{font-size:.9em;line-height:18px;--color: #0ec254;--border-radius: 32px;--background-hover: #0ec254;--background: #ebeaea !important;--background-activated: #0ec254;--background-focused: #0ec254;--color-activated: #fff;--color-hover: #fff;--color-focused: #fff;--padding-top: 8px;--padding-bottom: 8px;height:28px;display:flex;align-items:center}.btns-modal[_ngcontent-%COMP%] .btn-not[_ngcontent-%COMP%] ion-button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-weight:700}.btns-modal[_ngcontent-%COMP%] .btn-not.receive-code[_ngcontent-%COMP%]{margin-bottom:4px}.btns-modal[_ngcontent-%COMP%] .btn-not.existe-email[_ngcontent-%COMP%]{margin-top:4px}.button-holder[_ngcontent-%COMP%]{margin:24px auto 0!important}.input-holder[_ngcontent-%COMP%]{text-align:center}.input-holder[_ngcontent-%COMP%] .text-send-code-to-email[_ngcontent-%COMP%]{font-size:1em;font-weight:400;line-height:22px;letter-spacing:0px}.input-holder.input-holder-small-device[_ngcontent-%COMP%]{width:100%;margin:32px auto 0;padding:0 8px}.input-holder[_ngcontent-%COMP%] [_ngcontent-%COMP%]::placeholder{text-transform:initial!important}input[type=code][_ngcontent-%COMP%]{text-align:center;text-transform:uppercase}.footer-privacy[_ngcontent-%COMP%]{margin-bottom:calc(30px + env(safe-area-inset-bottom))!important}.footer-privacy.small-device[_ngcontent-%COMP%]{bottom:calc(10px + env(safe-area-inset-bottom))!important}"]}),d})();var w=c(69270);const W=[{path:"",component:Z}];let X=(()=>{class d{}return d.\u0275fac=function(n){return new(n||d)},d.\u0275mod=e.\u0275\u0275defineNgModule({type:d}),d.\u0275inj=e.\u0275\u0275defineInjector({imports:[w.I,p.CommonModule,v.FormsModule,v.ReactiveFormsModule,g.IonicModule,y.RouterModule.forChild(W)]}),d})()},37763:(G,C,c)=>{c.d(C,{i:()=>h});var p=c(61380),y=c(92198),g=c(45449);let h=(()=>{class i{constructor(s){this.router=s}focusInRouterNavigate(){this.router.events.pipe((0,y.h)(s=>s instanceof p.NavigationEnd)).subscribe(()=>{const s=document.querySelector("#focusHeader");s&&s?.focus()})}applyFocusQuerySelector(s,b){setTimeout(()=>{document.querySelector(`#${s}`)?.focus()},b)}}return i.\u0275fac=function(s){return new(s||i)(g.\u0275\u0275inject(p.Router))},i.\u0275prov=g.\u0275\u0275defineInjectable({token:i,factory:i.\u0275fac,providedIn:"root"}),i})()},45944:(G,C,c)=>{c.d(C,{K:()=>g});var p=c(15861),v=c(45449);let y=(()=>{class l{constructor(){}set(i,e){localStorage.setItem(i,JSON.stringify(e))}get(i){return JSON.parse(localStorage.getItem(i))??null}remove(i){localStorage.removeItem(i)}clear(){localStorage.clear()}}return l.\u0275fac=function(i){return new(i||l)},l.\u0275prov=v.\u0275\u0275defineInjectable({token:l,factory:l.\u0275fac,providedIn:"root"}),l})(),g=(()=>{class l{constructor(i){this.simpleStorageService=i,this.KEY="REGISTER_HAS_COMPANY",this.cache=null}set(i){this.simpleStorageService.set(this.KEY,i),this.cache=i}get(){const i=this.simpleStorageService.get(this.KEY);return this.cache=i,i}remove(){var i=this;return(0,p.Z)(function*(){i.simpleStorageService.remove(i.KEY),i.cache=null})()}}return l.\u0275fac=function(i){return new(i||l)(v.\u0275\u0275inject(y))},l.\u0275prov=v.\u0275\u0275defineInjectable({token:l,factory:l.\u0275fac,providedIn:"root"}),l})()}}]); |