Files
kapp/5926.4931768770c30906.js
2026-05-21 11:19:10 -03:00

1 line
19 KiB
JavaScript

(self.webpackChunkapp=self.webpackChunkapp||[]).push([[5926],{25926:(k,w,a)=>{a.r(w),a.d(w,{IdentityCheckPageModule:()=>V});var I=a(61380),_=a(69270),f=a(15861),e=a(45449),s=a(35548),P=a(47423),i=a(69107),M=a(92198),g=a(24006),c=a(47898),p=a(90603),N=a(45944),F=a(90944),A=a(33159),R=a(38124),x=a(99826);const G=["pin"];function H(o,v){1&o&&e.\u0275\u0275element(0,"ion-icon",18)}function D(o,v){1&o&&e.\u0275\u0275element(0,"ion-icon",19)}function j(o,v){1&o&&(e.\u0275\u0275elementStart(0,"ion-label"),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&o&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"PG_IDENTITY_CHECK_TEXT_FINGER_BIOMETRIC")," "))}function L(o,v){1&o&&(e.\u0275\u0275elementStart(0,"ion-label"),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&o&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"PG_IDENTITY_CHECK_TEXT_FINGER_FACIAL")," "))}function K(o,v){if(1&o){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",13)(1,"ion-button",14),e.\u0275\u0275listener("click",function(r){e.\u0275\u0275restoreView(t);const l=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(l.showFingerPrint(r))}),e.\u0275\u0275template(2,H,1,0,"ion-icon",15),e.\u0275\u0275template(3,D,1,0,"ion-icon",16),e.\u0275\u0275template(4,j,3,3,"ion-label",17),e.\u0275\u0275template(5,L,3,3,"ion-label",17),e.\u0275\u0275elementEnd()()}if(2&o){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf","finger"===t.typeFinger||"biometric"===t.typeFinger),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","face"===t.typeFinger),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","face"!==t.typeFinger),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","face"===t.typeFinger)}}const Y=function(o){return{"min-height":o,position:"relative"}},U=[{path:"",component:(()=>{class o{constructor(t,n,r,l,h,T,E,B,Z,z,$,Q,J,X,W,q,ee,te,ne,ie){var d=this;this.formBuilder=t,this.keyboardService=n,this.platform=r,this.loadingService=l,this.authService=h,this.notificatorService=T,this.deviceInfoService=E,this.forgotPasswordModalService=B,this.apiService=Z,this.lockService=z,this.navigationService=$,this.menuController=Q,this.storageService=J,this.logService=X,this.router=W,this.activatedRoute=q,this.translateConfigService=ee,this.saveFlowStorageResetKeyService=te,this.managerTokenUaamobileService=ne,this.initRegisterHasCompanyStorageService=ie,this.screenHeight=0,this.isFingerAvaliable=!1,this.subscription$=[],this.canShowHere=!1,this.didItComeFromSideMenu=!1,this.setFocus=()=>{this.platform.is("android")?setTimeout(()=>{this.focusInput(),this.keyboardService.show()},1e3):this.focusInput()},this.focusInput=()=>{this.pinInputElement.nativeElement.focus()},this.onPinChange=()=>{this.lockService.isLock("updating-pin-value")||(this.shouldSubmit()?setTimeout(this.onSubmit,250):this.lockService.unlock("updating-pin-value"))},this.shouldSubmit=()=>4===this.pinForm.controls.pin.value.length,this.resetPin=()=>{this.pinForm.controls.pin.setValue("")},this.onSubmit=()=>{let u=null;const S=()=>{u&&u.unsubscribe();const b=this.pinForm.controls.pin.value;this.loadingService.show(this.translateConfigService.translate("LOADING_CHECKING_DATA"),"on-check-password-show"),this.authService.validatePassword(b).then(y=>Promise.resolve(y)).then(y=>{y?(this.resetPin(),this.lockService.unlock("updating-pin-value"),this.authService.setLogOff(!1).then(()=>this.authService.updateLastAccessAt()).then(()=>this.loadingService.hide(null,"on-check-password-show")).then(()=>(this.menuController.enable(!0),this.storageService.get("forward"))).then(function(){var C=(0,f.Z)(function*(m){console.log("forward:",m),yield d.handleReAuthentication(),m?(d.navigationService.root([m.route],m.navigationExtras),d.storageService.remove("forward")):d.navigationService.root(["/home"])});return function(m){return C.apply(this,arguments)}}())):(this.resetPin(),this.lockService.unlock("updating-pin-value"),this.loadingService.hide(null,"on-check-password-show").then(()=>{const C=this.translateConfigService.translate("PG_IDENTITY_CHECK_TOAST_INVALID_PIN_TITLE"),m=this.translateConfigService.translate("PG_IDENTITY_CHECK_TOAST_INVALID_PIN_MESSAGE");this.notificatorService.notify({title:C,message:m,type:"error",timeout:5e3})}))}).catch(y=>{this.resetPin(),this.lockService.unlock("updating-pin-value"),this.loadingService.hide(null,"on-check-password-show");const C=this.translateConfigService.translate("PG_IDENTITY_CHECK_TOAST_ERROR_TITLE"),m=this.translateConfigService.translate("PG_IDENTITY_CHECK_TOAST_ERROR_MESSAGE");this.notificatorService.notify({title:C,message:m,type:"error"})})};u=this.keyboardService.onHideObservable?.subscribe(S),this.keyboardService.isVisible()?this.keyboardService.hide():S()},this.openForgotPasswordModal=(0,f.Z)(function*(){d.logService.logEvent("user::forgotPinLogoutStart");const u=yield d.authService.getUUID(),S=yield d.authService.getForeigner(),b="forgot-pin";yield d.saveFlowStorageResetKeyService.setInitForgot();const y=d.initRegisterHasCompanyStorageService.get();console.log("openForgotPasswordModal",y),d.initRegisterHasCompanyStorageService.set({foreigner:S,uuid:u,context:b}),S?d.navigationService.forward(["/foreign-document"],{queryParams:{queryParams:{uuid:u,context:b}}}):d.navigationService.forward(["/identity-validator"])}),this.hideForgotPasswordModal=()=>{this.forgotPasswordModalService.hide()},this.forgotPasswordModalStateChange=u=>{this.showForgotPasswordModal=u},this.onForgotPasswordModalAccept=()=>{this.logService.logEvent("user::forgotPinLogoutConfirmed"),this.doLogout()},this.onForgotPasswordModalReject=()=>{this.logService.logEvent("user::forgotPinLogoutRejected"),this.hideForgotPasswordModal()},this.doLogout=()=>{this.hideForgotPasswordModal(),this.loadingService.show(this.translateConfigService.translate("PG_IDENTITY_CHECK_LOADING_UNREGISTER"),"unregister-show"),this.logService.logEvent("user::forgotPinDoLogout"),this.authService.getToken().then(u=>{this.apiService.accountDelete(u).subscribe(()=>{this.logService.logEvent("http::accountDeleteSuccess"),this.authService.unregister().then(()=>this.loadingService.hide(null,"unregister-show")).then(()=>(this.toastUnregisterSuccess(),this.navigationService.root(["start"])))},S=>{console.log("error:",S),this.logService.logError("http::accountDelete","",S),this.authService.unregister().then(()=>this.loadingService.hide(null,"unregister-show")).then(()=>(this.toastUnregisterSuccess(),this.navigationService.root(["start"])))})})},this.getDataParams(),this.resumeApp()}ngOnInit(){var t=this;return(0,f.Z)(function*(){t.pinForm=t.formBuilder.group({pin:[""]}),t.forgotPasswordModalService.observable.subscribe(t.forgotPasswordModalStateChange),t.showFingerPrint()})()}ngOnDestroy(){this.subscription$.forEach(t=>t.unsubscribe)}showFingerPrint(t){var n=this;this.platform.ready().then((0,f.Z)(function*(){const r=yield i.Gw.checkBiometry();if(n.isFingerAvaliable=r.isAvailable,r.isAvailable){n.isAvaliableFinger(r.biometryType);const l=setTimeout(()=>{n.didItComeFromSideMenu&&n.platform.is("ios")&&"face"===n.typeFinger&&!t||(n.showFingerprintAuthentication(),clearTimeout(l))},500)}}))}ionViewWillEnter(){this.menuController.enable(!1)}ionViewDidEnter(){this.screenHeight=Number(this.deviceInfoService.getDeviceHeight())-50}ionViewDidLoad(){this.setFocus()}showFingerprintAuthentication(){var t=this;return(0,f.Z)(function*(){const n=t.translateConfigService.translate("PG_IDENTITY_CHECK_FINGER_CANCELTITLE"),r=t.translateConfigService.translate("PG_IDENTITY_CHECK_FINGER_DESCRIPTION"),l=t.translateConfigService.translate("PG_IDENTITY_CHECK_FINGER_TITLE"),T={reason:r,androidSubtitle:t.translateConfigService.translate("PG_IDENTITY_CHECK_FINGER_SUBTITLE"),androidTitle:l,cancelTitle:n,allowDeviceCredential:!0,androidBiometryStrength:i.bO.weak,androidConfirmationRequired:!0};try{const E=yield i.Gw.authenticate(T);console.log(E),t.onSubmitFingerPrint(!0)}catch(E){return t.handleNotAvaliableFinger(E)}})()}onSubmitFingerPrint(t){var n=this;this.loadingService.show(this.translateConfigService.translate("LOADING_CHECKING_DATA"),"on-check-password-show"),this.authService.validatePassword(null,t).then(r=>Promise.resolve(r)).then(r=>{r&&(this.resetPin(),this.lockService.unlock("updating-pin-value"),this.authService.setLogOff(!1).then(()=>this.authService.updateLastAccessAt()).then(()=>this.loadingService.hide(null,"on-check-password-show")).then(()=>(this.menuController.enable(!0),this.storageService.get("forward"))).then(function(){var l=(0,f.Z)(function*(h){yield n.handleReAuthentication(),h?(n.navigationService.root([h.route],h.navigationExtras),n.storageService.remove("forward")):n.navigationService.root(["/home"])});return function(h){return l.apply(this,arguments)}}()))}).catch(r=>{this.loadingService.hide(null,"on-check-password-show");const l=this.translateConfigService.translate("PG_IDENTITY_CHECK_TOAST_ERROR_PROCESS_AUTH_TITLE"),h=this.translateConfigService.translate("PG_IDENTITY_CHECK_TOAST_ERROR_PROCESS_AUTH_MESSAGE");this.notificatorService.notify({title:l,message:h,type:"error"})})}handleNotAvaliableFinger(t){const n={title:"",message:"",type:"error",timeout:1e4};t&&t.code&&t.message&&(n.message=`${t.message}`,this.notificatorService.notify(n)),console.log("handleNotAvaliableFinger",JSON.stringify(t)),this.logService.logError("handleNotAvaliableFinger","",t)}resumeApp(){this.getCurrentRouter(),s.g.addListener("appStateChange",t=>{t.isActive&&this.canShowHere&&"ios"===P.dV.getPlatform()&&this.showFingerPrint()}).finally(()=>{s.g.removeAllListeners()})}isAvaliableFinger(t){switch(t){case i.dz.faceAuthentication:case i.dz.faceId:this.typeFinger="face";break;case i.dz.fingerprintAuthentication:this.typeFinger="biometric";break;case i.dz.touchId:this.typeFinger="finger";break;case i.dz.irisAuthentication:this.typeFinger="iris"}}getCurrentRouter(){const t=this.router.events.pipe((0,M.h)(n=>n instanceof I.NavigationEnd)).subscribe(n=>{this.canShowHere=!(!n||!n.url)&&n.url.replace(/\//,"").includes("identity-check")});this.subscription$.push(t)}getDataParams(){const t=this.activatedRoute.queryParams.subscribe(n=>{this.didItComeFromSideMenu=!(!n||!n.menuLogoff)&&n.menuLogoff});this.subscription$.push(t)}toastUnregisterSuccess(){const t=this.translateConfigService.translate("PG_IDENTITY_CHECK_TOAST_UNREGISTER_TITLE"),n=this.translateConfigService.translate("PG_IDENTITY_CHECK_TOAST_UNREGISTER_MESSAGE");this.notificatorService.notify({title:t,message:n,type:"success",timeout:6e3})}handleReAuthentication(){var t=this;return(0,f.Z)(function*(){let n=null,r=null,l=null;try{n=yield t.authService.getPasswordHash()}catch{return}try{r=yield t.authService.getUUID()}catch{return}try{l=t.authService.getDocument()}catch{return}if(n&&r&&l){t.didItComeFromSideMenu&&t.loadingService.show(t.translateConfigService.translate("LOADING_AUTHENTICATING"),"auth");try{yield t.managerTokenUaamobileService.initStartGetTokenUaaMobile(),t.navigationService.root(["/home"])}catch{t.navigationService.root(["/home"])}finally{t.loadingService.hide(null,"auth"),console.log("aqui chamou ")}}})()}}return o.\u0275fac=function(t){return new(t||o)(e.\u0275\u0275directiveInject(g.UntypedFormBuilder),e.\u0275\u0275directiveInject(c.i8),e.\u0275\u0275directiveInject(p.Platform),e.\u0275\u0275directiveInject(c.bz),e.\u0275\u0275directiveInject(c.e8),e.\u0275\u0275directiveInject(c.V6),e.\u0275\u0275directiveInject(c.Hc),e.\u0275\u0275directiveInject(c.OJ),e.\u0275\u0275directiveInject(c.sM),e.\u0275\u0275directiveInject(c.We),e.\u0275\u0275directiveInject(c.f5),e.\u0275\u0275directiveInject(p.MenuController),e.\u0275\u0275directiveInject(c.V1),e.\u0275\u0275directiveInject(c.$V),e.\u0275\u0275directiveInject(I.Router),e.\u0275\u0275directiveInject(I.ActivatedRoute),e.\u0275\u0275directiveInject(c.wK),e.\u0275\u0275directiveInject(c.RQ),e.\u0275\u0275directiveInject(c.FB),e.\u0275\u0275directiveInject(N.K))},o.\u0275cmp=e.\u0275\u0275defineComponent({type:o,selectors:[["app-identity-check"]],viewQuery:function(t,n){if(1&t&&e.\u0275\u0275viewQuery(G,5),2&t){let r;e.\u0275\u0275queryRefresh(r=e.\u0275\u0275loadQuery())&&(n.pinInputElement=r.first)}},decls:24,vars:17,consts:[[1,"fix-header-modal-ios","ion-no-border"],[3,"ngStyle"],[1,"ion-margin-vertical"],[1,"form_pin"],[1,"input-holder"],["for","pin"],[3,"formGroup","ngSubmit"],["id","pin","type","password","formControlName","pin","maxlength","4","pattern","[0-9]*","inputmode","numeric",3,"placeholder","input"],["pin",""],[1,"button-holder"],["type","button",1,"back",3,"click"],["class","fingeer_btn",4,"ngIf"],[3,"show","onRejectCallback","onSuccessCallback"],[1,"fingeer_btn"],["mode","ios","fill","clear",3,"click"],["name","finger-print",4,"ngIf"],["src","../../assets/icon/faceid.svg",4,"ngIf"],[4,"ngIf"],["name","finger-print"],["src","../../assets/icon/faceid.svg"]],template:function(t,n){1&t&&(e.\u0275\u0275element(0,"ion-header",0),e.\u0275\u0275elementStart(1,"ion-content",1)(2,"ion-grid")(3,"ion-row")(4,"ion-col",2),e.\u0275\u0275element(5,"app-full-logo"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(6,"ion-grid",3)(7,"ion-row")(8,"ion-col",2)(9,"form")(10,"div",4)(11,"label",5),e.\u0275\u0275text(12),e.\u0275\u0275pipe(13,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"form",6),e.\u0275\u0275listener("ngSubmit",function(){return n.onSubmit()}),e.\u0275\u0275elementStart(15,"input",7,8),e.\u0275\u0275listener("input",function(){return n.onPinChange()}),e.\u0275\u0275pipe(17,"translate"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(18,"div",9)(19,"button",10),e.\u0275\u0275listener("click",function(){return n.openForgotPasswordModal()}),e.\u0275\u0275text(20),e.\u0275\u0275pipe(21,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(22,K,6,4,"div",11),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275element(23,"app-forgot-password-modal",12),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(15,Y,n.screenHeight+"px")),e.\u0275\u0275advance(11),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(13,9,"PG_IDENTITY_CHECK_TEXT")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("formGroup",n.pinForm),e.\u0275\u0275advance(1),e.\u0275\u0275property("placeholder",e.\u0275\u0275pipeBind1(17,11,"PG_IDENTITY_CHECK_INPUT")),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(21,13,"PG_IDENTITY_CHECK_BTN_FORGOT")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",n.isFingerAvaliable),e.\u0275\u0275advance(1),e.\u0275\u0275property("show",n.showForgotPasswordModal)("onRejectCallback",n.onForgotPasswordModalReject)("onSuccessCallback",n.onForgotPasswordModalAccept))},dependencies:[F.NgIf,F.NgStyle,p.IonButton,p.IonCol,p.IonContent,p.IonGrid,p.IonHeader,p.IonIcon,p.IonLabel,p.IonRow,g.\u0275NgNoValidate,g.DefaultValueAccessor,g.NgControlStatus,g.NgControlStatusGroup,g.MaxLengthValidator,g.PatternValidator,g.FormGroupDirective,g.FormControlName,g.NgForm,A.R,R.I,x.X$],styles:[".input-holder[_ngcontent-%COMP%]{text-align:center;width:95%}.input-holder[_ngcontent-%COMP%] .hidden[_ngcontent-%COMP%]{height:0;width:0;padding:0;border:none}.input-holder[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{text-align:center}.input-holder[_ngcontent-%COMP%] .lonely-inputs[_ngcontent-%COMP%]{display:flex;justify-content:space-evenly;margin-top:36px}.input-holder[_ngcontent-%COMP%] .lonely-inputs[_ngcontent-%COMP%] .lonely-input-holder[_ngcontent-%COMP%]{position:relative;width:70px;height:70px}.input-holder[_ngcontent-%COMP%] .lonely-inputs[_ngcontent-%COMP%] .lonely-input-holder[_ngcontent-%COMP%] .bullet[_ngcontent-%COMP%]{position:absolute;top:35px;left:35px;height:0;width:0;background-color:#fff;border-radius:70px;box-shadow:0 0 rgba(0,0,0,0);transition:top .25s ease,left .25s ease,height .25s ease,width .25s ease,box-shadow .25s ease}.input-holder[_ngcontent-%COMP%] .lonely-inputs[_ngcontent-%COMP%] .lonely-input-holder[_ngcontent-%COMP%] .bullet.valid[_ngcontent-%COMP%]{top:17px;left:17px;height:35px;width:35px;box-shadow:0 0 8px rgba(0,0,0,.3);transition:top .25s ease,left .25s ease,height .25s ease,width .25s ease,box-shadow .25s ease}.input-holder[_ngcontent-%COMP%] .lonely-inputs[_ngcontent-%COMP%] .lonely-input-holder[_ngcontent-%COMP%] input.lonely-input[_ngcontent-%COMP%]{margin-top:0;width:70px;height:70px;border-radius:70px;padding:0;text-align:center;line-height:36px;font-size:1.75em;background-color:#eee;transition:background-color .25s ease;box-shadow:inset 0 0 8px rgba(122,122,122,.1);border:none;color:transparent;caret-color:transparent}.input-holder[_ngcontent-%COMP%] .lonely-inputs[_ngcontent-%COMP%] .lonely-input-holder[_ngcontent-%COMP%] input.lonely-input[_ngcontent-%COMP%]:focus{outline:none}.input-holder[_ngcontent-%COMP%] .lonely-inputs[_ngcontent-%COMP%] .lonely-input-holder[_ngcontent-%COMP%] input.lonely-input.current[_ngcontent-%COMP%]{animation-name:current-input;animation-duration:1.25s;animation-iteration-count:infinite}@keyframes current-input{0%{background-color:#eee}50%{background-color:#ccc}to{background-color:#eee}}.input-holder[_ngcontent-%COMP%] .lonely-inputs[_ngcontent-%COMP%] .lonely-input-holder[_ngcontent-%COMP%] input.lonely-input.valid[_ngcontent-%COMP%]{background-color:#0ec254;transition:background-color .25s ease}.button-holder[_ngcontent-%COMP%]{margin-top:48px;justify-content:center}.fingeer_btn[_ngcontent-%COMP%]{display:flex;position:relative;justify-content:center}ion-header.fix-header-modal-ios.ios[_ngcontent-%COMP%]{height:0px!important}.form_pin[_ngcontent-%COMP%]{position:relative;height:100%;display:flex;justify-content:center;justify-items:center}"]}),o})()}];let V=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=e.\u0275\u0275defineNgModule({type:o}),o.\u0275inj=e.\u0275\u0275defineInjector({imports:[_.I,I.RouterModule.forChild(U)]}),o})()},45944:(k,w,a)=>{a.d(w,{K:()=>e});var I=a(15861),_=a(45449);let f=(()=>{class s{constructor(){}set(i,M){localStorage.setItem(i,JSON.stringify(M))}get(i){return JSON.parse(localStorage.getItem(i))??null}remove(i){localStorage.removeItem(i)}clear(){localStorage.clear()}}return s.\u0275fac=function(i){return new(i||s)},s.\u0275prov=_.\u0275\u0275defineInjectable({token:s,factory:s.\u0275fac,providedIn:"root"}),s})(),e=(()=>{class s{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,I.Z)(function*(){i.simpleStorageService.remove(i.KEY),i.cache=null})()}}return s.\u0275fac=function(i){return new(i||s)(_.\u0275\u0275inject(f))},s.\u0275prov=_.\u0275\u0275defineInjectable({token:s,factory:s.\u0275fac,providedIn:"root"}),s})()}}]);