1import{a as V}from"./chunk-S7FN5OCC.js";import"./chunk-CHJZV2PX.js";import{a as I}from"./chunk-EUCP3ANT.js";import{a as N}from"./chunk-AFU5X7NI.js";import"./chunk-ASQRFPSS.js";import{V as U,ab as j,bb as w,eb as x,ha as q,nb as F,rb as H,sb as $,ta as D,tb as B,ua as R,va as A,wa as z}from"./chunk-NIXTOG6H.js";import{r as O}from"./chunk-O6C4VF2S.js";import{$b as n,Bb as M,Bd as T,Ha as g,Pb as f,Wb as L,ac as i,ba as y,bc as _,fc as k,ha as a,hc as m,ib as u,ic as v,qa as P,ra as b,vb as E,wc as p}from"./chunk-THF2YGD6.js";import"./chunk-4Y3FPIGA.js";import"./chunk-Z7HK7AOY.js";import{a as d,b as l,f as G}from"./chunk-JD2CSVPC.js";var h=G(q(),1);function J(r,S){if(r&1){let e=k();n(0,"seds-alert-basic",12),m("hasClosed",function(){P(e);let t=v();return b(t.alertMessage=null)}),i()}if(r&2){let e=v();f("color",e.alertMessage==null?null:e.alertMessage.motif)("headerTitle",e.alertMessage.title)("contentText",e.alertMessage.content)("close",!0)}}var C=class r extends N{static{this.DEFAULT_ERROR={analyticsLabel:"ErroDesconhecido",id:"unknown-error",title:"N\xE3o foi poss\xEDvel atualizar a senha",code:"01-11-008",message:"Houve um problema durante a atualiza\xE7\xE3o de senha. Por favor, tente novamente. Se o erro continuar, aguarde alguns minutos para fazer uma nova tentativa.",type:"block",motif:"error",icon:"error"}}static{this.customMessages={0:{default:l(d({},this.DEFAULT_ERROR),{code:"01-11-001"}),noConnection:l(d({},this.DEFAULT_ERROR),{code:"01-11-001"})},400:{default:l(d({},this.DEFAULT_ERROR),{code:"01-11-002"}),400:{analyticsLabel:"SenhaJaUtilizada",code:"01-11-003",id:"error-already-used-password",title:"Senha j\xE1 usada anteriormente",message:"Por seguran\xE7a, cadastre uma nova senha diferente das que voc\xEA j\xE1 usou.",type:"inline",motif:"error",icon:"error"},"LEGACY_39-GC74_3":{analyticsLabel:"SenhaInvalida",code:"01-11-009",id:"error-invalid-passphrase",title:"Crie uma senha segura",message:'N\xE3o use palavras como "Serasa", sequ\xEAncias previs\xEDveis (ex: "1234", "qwerty"), nomes de meses ou n\xFAmeros por extenso.',type:"inline",motif:"error",icon:"error"}},401:{default:l(d({},this.DEFAULT_ERROR),{code:"01-11-004"})},422:{23:{analyticsLabel:"SenhaExpiradaInvalida",code:"01-11-005",id:"error-invalid-expired-password",title:"Senha j\xE1 usada anteriormente",message:"Por seguran\xE7a, cadastre uma nova senha diferente das que voc\xEA j\xE1 usou.",type:"block",motif:"error",icon:"error"}},500:{default:l(d({},this.DEFAULT_ERROR),{code:"01-11-006"})},503:{default:l(d({},this.DEFAULT_ERROR),{code:"01-11-007"})}}}constructor(S){super(r.customMessages,S)}},Y=(()=>{class r{constructor(){this.Utils=j,this.loginService=a(x),this.sessionManager=a(w),this.envService=a(U),this.pageLoadService=a($)}load(){this.pageLoadService.doPageLoad("NL","SenhaExpirada","")}success(){let e={logon:""};e.logon=this.loginService.userLoginData.logon;let s=h.Analytics.getCustomSuccessDatalayer("CadastroSenhaExpiradaSucesso","Cadastro de senha | Senha expirada sucesso"),t=h.Analytics.getDataLayer2(`MP:LG:IN:${this.envService.env.appName}:SenhaExpirada`,this.Utils.locationHref(),this.envService.env.appName,"LG","customLink",e);t.userInfo.loginType=this.sessionManager.loginType.value||"DEFAULT",t.custom=s,this.Utils.createAndTrackDataLayer(t,"CadastroSenhaExpiradaSucesso")}error(e,s){let t={logon:""};t.logon=this.loginService.userLoginData.logon;let c=h.Analytics.getCustomErrorDatalayer(e,s,"POST"),o=h.Analytics.getDataLayer2(`MP:NL:IN:${this.envService.env.appName}:SenhaExpirada`,this.Utils.locationHref(),`${this.envService.env.appName}`,"NL","customLink",t);o.custom=c,this.Utils.createAndTrackDataLayer(o,"CustomError")}static{this.\u0275fac=function(s){return new(s||r)}}static{this.\u0275prov=y({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})(),le=(()=>{class r{constructor(){this.isLoading=g(!1),this.alertMessage=null,this.passwordIsValid=g(!1),this.newPassword=g(""),this.router=a(O),this.resetPasswordService=a(I),this.loginService=a(x),this.sessionManager=a(w),this.expiredPasswordDataLayerService=a(Y)}ngOnInit(){this.expiredPasswordDataLayerService.load()}setNewPassword(e){this.newPassword.set(e),this.resetPasswordService.newPassword=e,this.alertMessage=null}keyUpHandler(e){e.key==="Enter"&&this.submit()}submit(){this.isLoading.set(!0),this.resetPasswordService.updatePassword().subscribe({next:e=>{this.expiredPasswordDataLayerService.success(),this.loginService.setAccessToken(e?.accessToken),this.loginService.getUserAccountsMe().subscribe({next:()=>{this.sessionManager.currentUser$.value.accountStatus?.includes(F.ACCOUNT_UPDATE)?this.router.navigate(["./login/primeiro-acesso/complete-seu-cadastro"]):this.sessionManager.login({accessToken:e.accessToken})},error:s=>this._handleUpdatePasswordError(s)})},error:e=>{this._handleUpdatePasswordError(e)}})}back(){this.router.navigate(["/login"])}_handleUpdatePasswordError(e){this.isLoading.set(!1);let s=new C(e).error,t=s.title;this.alertMessage=new B({motif:s.motif,title:t,content:`${s.message} (C\xF3digo ${s.code})`,mode:s.type}),this.expiredPasswordDataLayerService.error(e,s?.analyticsLabel)}static{this.\u0275fac=function(s){return new(s||r)}}static{this.\u0275cmp=E({type:r,selectors:[["ca-expired-password"]],decls:18,vars:4,consts:[["size","small"],[1,"expired-password-form"],[1,"expired-password-form__header","seds-flex","seds-flex-col","seds-gap-3"],[1,"expired-password-form__header__title"],[1,"expired-password-form__header__message"],["display","block",3,"color","headerTitle","contentText","close"],[1,"expired-password-form__content","seds-flex","seds-flex-col","seds-gap-3"],[3,"passwordChange","keyUpEnter","passwordIsValid"],[1,"expired-password-form__footer","seds-flex","seds-flex-row"],["caAnalyticsButton","","launchSiteSection","SenhaExpirada","launchSection","Clique","launchLabel","VoltarParaLogin",1,"expired-password-form__footer__link","seds-flex","seds-flex-rows","seds-gap-1","seds-align-center",3,"click"],[1,"material-symbols-rounded"],["size","standard","color","primary",3,"click","title","loading","disabled"],["display","block",3,"hasClosed","color","headerTitle","contentText","close"]],template:function(s,t){s&1&&(_(0,"ca-login-header",0),n(1,"form",1)(2,"header",2)(3,"h1",3),p(4,"Crie uma nova senha"),i(),n(5,"p",4),p(6," Para acessar os produtos, \xE9 necess\xE1rio definir uma senha. "),_(7,"br"),p(8," Uma senha forte ajuda a proteger sua conta contra fraudes em seu nome e no nome da empresa. "),i()(),M(9,J,1,4,"seds-alert-basic",5),n(10,"section",6)(11,"ca-password-validator",7),m("passwordChange",function(o){return t.setNewPassword(o)})("keyUpEnter",function(o){return t.keyUpHandler(o)})("passwordIsValid",function(o){return t.passwordIsValid.set(o)}),i()()(),n(12,"footer",8)(13,"a",9),m("click",function(){return t.back()}),n(14,"i",10),p(15,"keyboard_arrow_left"),i(),p(16," Voltar "),i(),n(17,"seds-basic-button",11),m("click",function(){return t.submit()}),i()()),s&2&&(u(9),L(t.alertMessage?9:-1),u(8),f("title",t.isLoading()?"Salvando a senha":"Salvar senha")("loading",t.isLoading())("disabled",!t.passwordIsValid()||t.isLoading()))},dependencies:[T,R,D,V,H,z,A],styles:[".expired-password-form__header__title[_ngcontent-%COMP%]{color:var(--seds-color-text-base);font-size:var(--seds-font-size-heading-xs);font-style:normal;font-weight:500;line-height:var(--seds-font-line-height-md)}.expired-password-form[_ngcontent-%COMP%] .alert-title[_ngcontent-%COMP%]{color:var(--seds-color-feedback-error-base);font-size:var(--seds-font-size-body-sm);font-weight:400;line-height:var(--seds-font-line-height-sm)}.expired-password-form[_ngcontent-%COMP%] .alert-message[_ngcontent-%COMP%]{line-height:var(--seds-font-line-height-sm)}.expired-password-form[_ngcontent-%COMP%] .alert-message[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--seds-color-brand-primary-base);text-decoration:underline}.expired-password-form[_ngcontent-%COMP%] .alert-message[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{color:var(--seds-color-primary-600)}.expired-password-form__header__message[_ngcontent-%COMP%]{color:var(--seds-color-text-base);font-size:var(--seds-font-size-body-base);font-weight:400;line-height:var(--seds-font-line-height-sm)}.expired-password-form__footer__link[_ngcontent-%COMP%]{color:var(--seds-color-brand-primary-base);cursor:pointer;font-size:var(--seds-font-size-body-base);font-weight:400;line-height:var(--seds-font-line-height-sm)}.expired-password-form__footer[_ngcontent-%COMP%]{align-items:center;justify-content:space-between;min-width:100%}.expired-password-form__footer__link[_ngcontent-%COMP%]{align-items:center;color:var(--seds-color-brand-primary-base);cursor:pointer;font-size:var(--seds-font-size-body-sm);font-weight:500;justify-content:start;line-height:var(--seds-font-line-height-sm);text-decoration:none}[_nghost-%COMP%]{background-color:#fff;display:grid;flex-direction:column;grid-template-rows:auto 1fr 96px;margin-top:var(--seds-size-500);position:relative;min-height:calc(100dvh - var(--seds-size-500));width:100%}.expired-password-form[_ngcontent-%COMP%]{margin-top:1rem}@media only screen and (min-width:1536px){.expired-password-form[_ngcontent-%COMP%]{margin-top:2rem}}.expired-password-form__header[_ngcontent-%COMP%], .expired-password-form__content[_ngcontent-%COMP%]{margin-bottom:1.5rem}"],changeDetection:0})}}return r})();export{le as ExpiredPasswordComponent};
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.