1import{a as me,b as ue}from"./chunk-TH52CMGW.js";import{a as le}from"./chunk-LJNQOKOG.js";import{a as ce}from"./chunk-5PMSDMMV.js";import{a as pe}from"./chunk-ODMLTMA6.js";import{d as ae}from"./chunk-MHZTQOH5.js";import{a as re}from"./chunk-UWM2BDBG.js";import"./chunk-SLRWEHLR.js";import"./chunk-VZS4INY2.js";import"./chunk-N3Z55YGJ.js";import{b as se}from"./chunk-HEY3GL7N.js";import{G as ie,H as ne,I as oe,c as J,e as g,h as Q,i as W,p as Z,t as ee,w as te}from"./chunk-O7QABW3A.js";import"./chunk-5PT677OW.js";import{b as Y}from"./chunk-ISTCOMRU.js";import{a as j}from"./chunk-R5CO7CGQ.js";import{a as R}from"./chunk-BOE7F6ZT.js";import"./chunk-TT6QYERY.js";import{v as z,x as K}from"./chunk-BX3HVBV7.js";import"./chunk-IQ5XV3CE.js";import{e as G,f as X}from"./chunk-CXEGNT5A.js";import{Bc as m,Bd as D,Cc as N,Dc as h,Ec as P,Ed as q,Ka as S,Kc as M,La as k,Mc as A,Ob as E,Ub as p,Vd as H,Wb as O,ec as s,fc as o,gc as v,hc as x,ic as B,kc as V,nc as l,pc as d,tb as i,ub as c,za as U}from"./chunk-LJFKHX2G.js";import{h as I}from"./chunk-YAH3INPE.js";var de=a=>({"d-none":a});function he(a,L){if(a&1){let t=V();x(0),s(1,"app-countdown-timer",45),l("timeEnd",function(e){S(t);let r=d();return k(r.timeOne(e))}),o(),B()}if(a&2){let t=d();i(),p("time",t.setTimeOne)}}function fe(a,L){if(a&1){let t=V();x(0),s(1,"app-countdown-timer",45),l("timeEnd",function(e){S(t);let r=d();return k(r.timeOne(e))}),o(),B()}if(a&2){let t=d();i(),p("time",t.setTimeOne)}}function _e(a,L){if(a&1&&(s(0,"span",46),m(1),o()),a&2){let t=d();i(),h(" ",t.FLang.B014A.content.B0006," ")}}function ge(a,L){if(a&1){let t=V();x(0),s(1,"app-countdown-timer",47),l("timeEnd",function(e){S(t);let r=d();return k(r.timeTwo(e))}),o(),B()}if(a&2){let t=d();i(),p("time",t.setTimeTwo)}}function ve(a,L){if(a&1){let t=V();x(0),s(1,"app-countdown-timer",47),l("timeEnd",function(e){S(t);let r=d();return k(r.timeTwo(e))}),o(),B()}if(a&2){let t=d();i(),p("time",t.setTimeTwo)}}var Me=(()=>{class a{constructor(t,n,e,r,T,u,f,b,y,_,w,C){this.alert=t,this.fb=n,this.apiMember=e,this.cds=r,this.vi=T,this.router=u,this.auth=f,this.activatedRoute=b,this.onlineInsuranceService=y,this.platformService=_,this.storageService=w,this.commonService=C,this.emailFormat=null,this.mobileFormat=null,this.otpError=!1,this.setTimeOne=600,this.setTimeTwo=60,this.TimeOneEnd=!1,this.TimeTwoEnd=!1,this.loadTime=!1,this.FCount=1,this.FLang=this.cds.gLang,this.FLangType=this.cds.gLangType,this.platformService.isBrowserSide&&(this.cds.userInfoTemp.email&&this.cds.userInfoTemp.mobile||this.router.navigate(["login"],{replaceUrl:!0}))}formValidate(){let t={};Object.keys(this.validators).forEach(n=>{t[n]=[{value:this.validators[n][0],disabled:!1},this.validators[n][1]]}),this.group=this.fb.group(t),this.controls=this.group.controls,Object.keys(this.controls).forEach(n=>{this.controls[n].value&&this.controls[n].markAsTouched()})}keyupTwo(){this.controls.otpTwo.value||this.focusUp("otpTwo")}keyupThr(){this.controls.otpThr.value||this.focusUp("otpThr")}keyupFou(){this.controls.otpFou.value||this.focusUp("otpFou")}keyupFiv(){this.controls.otpFiv.value||this.focusUp("otpFiv")}keyupSix(){this.controls.otpSix.value||this.focusUp("otpSix")}inputOne(){/[0-9]/.test(this.controls.otpOne.value)&&(this.doFontLengthSet(this.controls.otpOne.value,"otpOne"),this.focusDown("otpOne"))}inputTwo(){/[0-9]/.test(this.controls.otpTwo.value)&&(this.doFontLengthSet(this.controls.otpTwo.value,"otpTwo"),this.focusDown("otpTwo"))}inputThr(){/[0-9]/.test(this.controls.otpThr.value)&&(this.doFontLengthSet(this.controls.otpThr.value,"otpThr"),this.focusDown("otpThr"))}inputFou(){/[0-9]/.test(this.controls.otpFou.value)&&(this.doFontLengthSet(this.controls.otpFou.value,"otpFou"),this.focusDown("otpFou"))}inputFiv(){/[0-9]/.test(this.controls.otpFiv.value)&&(this.doFontLengthSet(this.controls.otpFiv.value,"otpFiv"),this.focusDown("otpFiv"))}inputSix(){this.doFontLengthSet(this.controls.otpSix.value,"otpSix"),this.submitHandler()}doFontLengthSet(t,n){if(t.length>1&&t){let e=t.slice(1,2);switch(n){case"otpOne":this.group.patchValue({otpOne:e});break;case"otpTwo":this.group.patchValue({otpTwo:e});break;case"otpThr":this.group.patchValue({otpThr:e});break;case"otpFou":this.group.patchValue({otpFou:e});break;case"otpFiv":this.group.patchValue({otpFiv:e});break;case"otpSix":this.group.patchValue({otpSix:e});break}}}goLogin(){this.router.navigate(["login"],{replaceUrl:!0})}doRegister(){this.cds.userInfo.is_set_pw=!1,this.policyNumber?this.router.navigate(["login/change-password"],{queryParams:{xtype:"register",pol_no:this.policyNumber},replaceUrl:!0}):this.router.navigate(["login/change-password"],{queryParams:{xtype:"register"},replaceUrl:!0})}doBind(){return I(this,null,function*(){let t;if(t={seq_no:0,customer_name:this.userInfoTemp.customer_name.trim().toLocaleUpperCase(),nation_id:this.userInfoTemp.nation_id,certificate_type:this.userInfoTemp.certificate_type,certificate_number_9:this.userInfoTemp.certificate_number_9||"",certificate_number_12:this.userInfoTemp.certificate_number_12||"",birthday:this.userInfoTemp.birthday,email:this.userInfoTemp.email,email_bk:"",mobile:this.userInfoTemp.mobile,sex:this.userInfoTemp.sex,county:this.userInfoTemp.county,province:this.userInfoTemp.province,addr:this.userInfoTemp.addr,is_link_id:"N",fb_account:this.userInfoTemp.fb_account,fb_title:this.userInfoTemp.fb_title,google_account:this.userInfoTemp.google_account,google_title:this.userInfoTemp.google_title,is_link_sns:"Y",is_set_pw:"N",kor:"",is_validate_policy:"N",optional:"0",cus_acc_term:null},this.onlineInsuranceService.isOnlineInsurance()?this.cds.gTCalc_to_save?.saveorder?.recommend_code&&(t.recommend_code=this.cds.gTCalc_to_save.saveorder.recommend_code):this.userInfoTemp.recommend_code&&(t.recommend_code=this.userInfoTemp.recommend_code),(yield this.apiMember.MemberReg(t)).status===200){let e={};if(this.userInfoTemp.google_account||this.userInfoTemp.fb_account){let T={fb_account:this.userInfoTemp.fb_account?this.userInfoTemp.fb_account:"",google_account:this.userInfoTemp.google_account?this.userInfoTemp.google_account:"",name:this.userInfoTemp.google_account?this.userInfoTemp.google_title:this.userInfoTemp.fb_title||""};e=yield this.apiMember.MemberOAUTH(T)}if(yield this.onlineProject_flow(t))return;this.doUserDataClear(),this.doBindDataClear(),this.alert.open({type:"success",title:this.FLang.B055.content.B0011,content:this.FLang.B055.content.B0012,callback:()=>{e.status===200?(this.cds.userInfo=e.data,this.cds.gMobileToken=e.access_token,this.cds?.gPre_url&&this.cds.gPre_url==="/"?this.router.navigate([this.cds.gPre_url],{replaceUrl:!0}):this.router.navigateByUrl("member")):this.router.navigateByUrl("login")}})}else this.router.navigate(["login"],{replaceUrl:!0})})}doFind(){this.cds.userInfo.is_set_pw=!1,this.router.navigate(["login/change-password"],{replaceUrl:!0})}submitHandler(){return I(this,null,function*(){if(!(this.cds.userInfoTemp.email&&this.cds.userInfoTemp.mobile&&this.controls.otpOne.value&&this.controls.otpTwo.value&&this.controls.otpThr.value&&this.controls.otpFou.value&&this.controls.otpFiv.value&&this.controls.otpSix.value))return this.otpError=!0;let t=this.controls.otpOne.value+this.controls.otpTwo.value+this.controls.otpThr.value+this.controls.otpFou.value+this.controls.otpFiv.value+this.controls.otpSix.value;if(this.TimeOneEnd){this.otpError=!0;return}let n={mobile:this.cds.userInfoTemp.mobile,otp:t};if((yield this.apiMember.MemberVerifyOTP(n)).status===200)switch(this.cds.gPubCommon.gOtpAuto){case"register":this.doRegister();break;case"bind":this.doBind();break;case"find":this.doFind();break;default:this.router.navigate(["login"],{replaceUrl:!0});break}else this.otpError=!0})}onlineProject_flow(t){return I(this,null,function*(){if(this.cds.gTCalc_to_save&&this.cds.gTCalc_to_save.saveorder){let n={};this.userInfoTemp.google_account?n.google_account=this.userInfoTemp.google_account:n.fb_account=this.userInfoTemp.fb_account;let e=yield this.apiMember.MemberOAUTH(n);if(e.status===200){this.cds.gMobileToken=e.access_token,this.cds.userInfo=e.data,this.storageService.setItem(R.mobileToken,e.access_token);let r=j.ObjEncryption(e.data);return this.commonService.SaveUsertoSession(r),this.cds.gTCalc_to_save.userinfo=e.data,this.router.navigate([`/online-insurance/project-trial-${this.cds.gTCalc_to_save.type}/payment`],{queryParams:{action:"pay"},replaceUrl:!0}),this.doUserDataClear(),!0}}})}
1doUserDataClear(){Object.keys(this.cds.userInfoTemp).forEach(t=>{this.cds.userInfoTemp[t]=null})}doBindDataClear(){Object.keys(this.auth.user).forEach(t=>{this.auth.user[t]=null})}showContactService(){$("#popContactService").modal("show")}focusDown(t){switch(t){case"otpOne":document.getElementsByName("otpTwo")[0].focus();break;case"otpTwo":document.getElementsByName("otpThr")[0].focus();break;case"otpThr":document.getElementsByName("otpFou")[0].focus();break;case"otpFou":document.getElementsByName("otpFiv")[0].focus();break;case"otpFiv":document.getElementsByName("otpSix")[0].focus();break}}focusUp(t){switch(t){case"otpSix":document.getElementsByName("otpFiv")[0].focus();break;case"otpFiv":document.getElementsByName("otpFou")[0].focus();break;case"otpFou":document.getElementsByName("otpThr")[0].focus();break;case"otpThr":document.getElementsByName("otpTwo")[0].focus();break;case"otpTwo":document.getElementsByName("otpOne")[0].focus();break}}timeOne(t){this.TimeOneEnd=t,t&&$(".vcode-input").attr("disabled","disabled")}timeTwo(t){this.TimeTwoEnd=t}timeRestart(){return I(this,null,function*(){if(this.FCount<3){this.FCount=this.FCount+1,this.TimeOneEnd=!1,$(".vcode-input").removeAttr("disabled"),this.TimeTwoEnd=!1,this.loadTime=!this.loadTime,this.group.patchValue({otpOne:void 0,otpTwo:void 0,otpThr:void 0,otpFou:void 0,otpFiv:void 0,otpSix:void 0}),this.otpError=!1;let t;switch(this.cds.gPubCommon.gOtpAuto){case"register":t="reg";break;case"find":t="cantlogin";break}let n={email:this.cds.userInfoTemp.email,mobile:this.cds.userInfoTemp.mobile,notice_action:t};this.apiMember.MemberSendOTP(n),this.router.navigate(["login/otp-verification"],{replaceUrl:!0})}else this.showContactService()})}textHide(){if(!this.cds.userInfoTemp.mobile||!this.cds.userInfoTemp.email)return!1;let t=this.cds.userInfoTemp.mobile,n=t.split("").splice(0,4),e="-xxx-",r=t.split("").splice(7,9),T=n.join("")+e+r.join("");this.mobileFormat=T;let u=this.cds.userInfoTemp.email,f=u.indexOf("@");if(f<=5){let b=u.split("").splice(1,f).length,y=u.split("").splice(0,1),_=[];for(let F=0;F<b-1;F++)_.push("*");let w=u.split("").splice(f,u.length),C=y.join("")+_.join("")+w.join("");this.emailFormat=C}else{let b=u.split("").splice(2,f-4).length,y=u.split("").splice(0,2),_=[];for(let F=0;F<b;F++)_.push("*");let w=u.split("").splice(f-2,u.length),C=y.join("")+_.join("")+w.join("");this.emailFormat=C}}ngOnInit(){this.popTitle=this.FLang.B014A.content.B0014,this.popInfoOne=this.FLang.B014A.content.B0015,this.popInfoTwo=this.FLang.B014A.content.B0016,this.textHide(),this.otpCode=this.cds.otpCode,this.userInfoTemp=this.cds.userInfoTemp,this.validators={otpOne:[this.otpCode.otpOne,[g.required]],otpTwo:[this.otpCode.otpTwo,[g.required]],otpThr:[this.otpCode.otpThr,[g.required]],otpFou:[this.otpCode.otpFou,[g.required]],otpFiv:[this.otpCode.otpFiv,[g.required]],otpSix:[this.otpCode.otpSix,[g.required]]},this.formValidate(),this.activatedRoute.queryParamMap.subscribe(t=>{this.policyNumber=t.get("pol_no")?t.get("pol_no"):void 0})}static{this.\u0275fac=function(n){return new(n||a)(c(Y),c(ie),c(re),c(X),c(se),c(K),c(ae),c(z),c(pe),c(H),c(G),c(j))}}static{this.\u0275cmp=U({type:a,selectors:[["app-otp-verification"]],standalone:!0,features:[M],decls:64,vars:41,consts:[[1,"height-content"],[1,"com-content"],[1,"topbg"],[1,"topbg-box"],[1,"top-bg-story"],["src","assets/img/img-bn-password.webp","alt","X\xE1c th\u1EF1c OTP t\xE0i kho\u1EA3n Cathay Insurance Vietnam","srcset","assets/img/[email protected] 2x","fetchpriority","high","decoding","async",1,"img-fluid","d-none","d-md-block"],["src","assets/img/img-bn-password-m.webp","alt","X\xE1c th\u1EF1c OTP t\xE0i kho\u1EA3n Cathay Insurance Vietnam","srcset","assets/img/[email protected] 2x","fetchpriority","high","decoding","async",1,"img-fluid","d-md-none"],[1,"top-bg-scrap","d-none","d-md-block"],["src","assets/img/img-banner-shape.webp","alt","","srcset","assets/img/[email protected] 2x","fetchpriority","high","decoding","async",1,"img-fluid"],[1,"caption"],[1,"container"],[1,"jobdetails","mt-0"],[1,"container","remove-width"],[1,"j
1obbox","bg-white-block","login-w"],["autocomplete","off",3,"formGroup"],[1,"advisory-content"],[1,"adv-box-item","otp"],[1,"title"],[1,"vcode-box"],[1,"d-flex","align-items-center","vcode-tit"],[1,"justify-content-start","mr-auto"],[1,"justify-content-end","d-flex"],[2,"padding-right","4px"],[1,"text-green"],[4,"ngIf"],["style","padding-left: 4px",4,"ngIf"],[1,"justify-content-end","text-red",2,"color","#f00"],[1,"vcode"],["name","otpOne","type","tel","autofocus","","formControlName","otpOne","appLimitInput","",1,"vcode-input",3,"input","replace"],["name","otpTwo","type","tel","formControlName","otpTwo","appLimitInput","",1,"vcode-input",3,"keydown.backspace","input","replace"],["name","otpThr","type","tel","formControlName","otpThr","appLimitInput","",1,"vcode-input",3,"keydown.backspace","input","replace"],["name","otpFou","type","tel","formControlName","otpFou","appLimitInput","",1,"vcode-input",3,"keydown.backspace","input","replace"],["name","otpFiv","type","tel","formControlName","otpFiv","appLimitInput","",1,"vcode-input",3,"keydown.backspace","input","replace"],["name","otpSix","type","tel","formControlName","otpSix","appLimitInput","",1,"vcode-input",3,"keydown.backspace","input","replace"],[1,"message-error"],[1,"text-center","mb-4"],[1,"btn","btn-primary","disabled",3,"ngClass"],[2,"color","#aeb6bd"],[1,"text-center","mb-4",3,"ngClass"],[1,"btn","btn-primary",3,"click"],[1,"text-center"],[1,"text-green","d-inline-flex",3,"click"],[1,"text-center","d-inline-block","mr-1"],[1,"icons-ic-info","i-icon","align-self-center"],[3,"title","infoOne","infoTwo"],["timeType","minute",3,"timeEnd","time"],[2,"padding-left","4px"],["timeType","seconds",3,"timeEnd","time"]],template:function(n,e){n&1&&(s(0,"div",0)(1,"main")(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4),v(6,"img",5)(7,"img",6),o(),s(8,"div",7),v(9,"img",8),o()()(),v(10,"app-breadcrumb"),s(11,"div",9)(12,"div",10)(13,"h1"),m(14),o()()(),s(15,"section",11)(16,"div",12)(17,"div",13)(18,"form",14)(19,"div",15)(20,"div",16)(21,"div",17),m(22),o(),s(23,"p"),m(24),o(),s(25,"div",18)(26,"div",19)(27,"div",20),m(28),o(),s(29,"div",21)(30,"span",22),m(31),o(),s(32,"span",23),E(33,he,2,1,"ng-container",24),o(),s(34,"span",23),E(35,fe,2,1,"ng-container",24),o(),E(36,_e,2,1,"span",25),o(),s(37,"div",26),m(38),o()(),s(39,"div",27)(40,"input",28),l("input",function(){return e.inputOne()}),o(),s(41,"input",29),l("keydown.backspace",function(){return e.keyupTwo()})("input",function(){return e.inputTwo()}),o(),s(42,"input",30),l("keydown.backspace",function(){return e.keyupThr()})("input",function(){return e.inputThr()}),o(),s(43,"input",31),l("keydown.backspace",function(){return e.keyupFou()})("input",function(){return e.inputFou()}),o(),s(44,"input",32),l("keydown.backspace",function(){return e.keyupFiv()})("input",function(){return e.inputFiv()}),o(),s(45,"input",33),l("keydown.backspace",function(){return e.keyupSix()})("input",function(){return e.inputSix()}),o()(),s(46,"div",34),m(47),o()()(),s(48,"div",35)(49,"a",36)(50,"span",37),m(51),E(52,ge,2,1,"ng-container",24)(53,ve,2,1,"ng-container",24),m(54),o()()(),s(55,"div",38)(56,"a",39),l("click",function(){return e.timeRestart()}),m(57),o()(),s(58,"div",40)(59,"a",41),l("click",function(){return e.showContactService()}),s(60,"div",42),m(61),o(),v(62,"i",43),o()()()()()()()()(),v(63,"app-contact-service",44),o()),n&2&&(i(14),N(e.FLang.B014A.title.B0001),i(4),p("formGroup",e.group),i(4),N(e.FLang.B014A.content.B0001),i(2),P("",e.FLang.B014A.content.B0002," ",e.mobileFormat,""),i(4),h(" ",e.FLang.B014A.content.B0004," "),i(),O("message_error",e.TimeOneEnd),i(2),h(" ",e.FLang.B014A.content.B0005,""),i(2),p("ngIf",e.loadTime),i(2),p("ngIf",!e.loadTime),i(),p("ngIf",e.FLangType!=="vi-VN"),i(),O("d-none",!e.TimeOneEnd),i(),h(" ",e.FLang.B014A.content.B0007," "),i(),O("status-error",e.otpError),i(),p("replace","number"),i(),p("replace","number"),i(),p("replace","number"),i(),p("replace","number"),i(),p("replace","number"),i(),p("replace","number"),i(),O("message_error",!e.otpError),i(),h(" ",e.FLang.B014A.content.B0008," "),i(2),p("ngClass",A(37,de,e.TimeTwoEnd)),i(2),h(" ",e.FLangType==="vi-VN"||e.FLangType==="en-US"?e.FLang.B014A.content.B0021:""," "),i(),p("ngIf",e.loadTime),i(),p("ngIf",!e.loadTime),i(),h("",e.FLang.B014A.content.B0009," "),i(),p("ngClass",A(39,de,!e.TimeTwoEnd)),i(2),h(" ",e.FLang.B014A.content.B0010," "),i(4),h(" ",e.FLang.B014A.content.B0011," "),i(2),p("title",e.popTitle)("infoOne",e.popInfoOne)("infoTwo",e.popInfoTwo))},dependencies:[ce,ne,Z,J,Q,W,oe,ee,te,q,ue,le,D,me],styles:[".message_error[_ngcontent-%COMP%]{display:none!important}.vcode[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{font-size:20px}"]})}}return a})();export{Me as OtpVerificationComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.