1import{a as lt}from"./chunk-FZ3BTEDS.js";import{a as st}from"./chunk-V6ZEDAN2.js";import{a as at}from"./chunk-MQLXRJLY.js";import{a as et}from"./chunk-UWTSORKH.js";import{a as $}from"./chunk-YQ2HBBL5.js";import{a as it}from"./chunk-4M3H6OJK.js";import{a as rt}from"./chunk-2NWUFIXC.js";import"./chunk-KADQP2XK.js";import{a as ot,b as nt}from"./chunk-ECMF7CC2.js";import"./chunk-C4XHNRNH.js";import{a as tt}from"./chunk-LKIIPTIG.js";import{_ as Z}from"./chunk-SRUBCUSW.js";import"./chunk-52TU3IL6.js";import"./chunk-TDIWFVPA.js";import"./chunk-MN2F2UI2.js";import"./chunk-LJV7ZYHU.js";import"./chunk-25QDB3SE.js";import"./chunk-KJ3PV2LN.js";import"./chunk-35M7AFQZ.js";import"./chunk-HCVRNL4G.js";import"./chunk-INMDLS22.js";import"./chunk-AJZMXFMA.js";import"./chunk-YE7HTOLI.js";import"./chunk-NZ4I6U2Z.js";import"./chunk-23N7CA4O.js";import"./chunk-YI7ZQONV.js";import"./chunk-54IZQ3MU.js";import"./chunk-QUO3WGUK.js";import"./chunk-GZLC4DDF.js";import"./chunk-74YMZKOK.js";import"./chunk-6IH4M65S.js";import"./chunk-NGAT3XSV.js";import"./chunk-6DMACB4X.js";import"./chunk-SXLHBEO2.js";import"./chunk-IUPWKUGB.js";import"./chunk-C5J3HTKX.js";import"./chunk-56FUNJ2L.js";import"./chunk-KORPXNVS.js";import"./chunk-W4BNGQYG.js";import{a as Y}from"./chunk-OSVOK6WL.js";import"./chunk-WXXKR7LF.js";import"./chunk-R2NO6V5K.js";import"./chunk-FV2Q4OA6.js";import"./chunk-QPZCEWML.js";import"./chunk-L44SDTPC.js";import"./chunk-CLQP3QCS.js";import{e as J}from"./chunk-TWVMK4TV.js";import"./chunk-EGNI2XJ3.js";import"./chunk-A3N634GV.js";import"./chunk-F457L6VT.js";import"./chunk-6BC3ZOBR.js";import"./chunk-4U4PLY73.js";import"./chunk-RQ4F2COW.js";import"./chunk-7RWCIHFI.js";import"./chunk-GP7G4HVV.js";import"./chunk-X5ROTD3U.js";import{a as Q}from"./chunk-V4NS6LW3.js";import{a as j}from"./chunk-VFTYDXHH.js";import"./chunk-LJSWAOQY.js";import"./chunk-RFPVTC6I.js";import"./chunk-SPFBMSSO.js";import"./chunk-TZOYHBJT.js";import"./chunk-34KEMFZC.js";import"./chunk-4BUGZAA4.js";import"./chunk-3TCRHIAB.js";import"./chunk-76JNFTGE.js";import"./chunk-C7VFP4N4.js";import{c as X,d as q}from"./chunk-CYMQMRSQ.js";import{F as z,d as L,f as G,g as B,j as V,m as N,o as W,s as H,v as K}from"./chunk-SAPP7HDL.js";import"./chunk-YJOTM47P.js";import{i as D}from"./chunk-2PJAPLDY.js";import"./chunk-UQ5LDOFJ.js";import"./chunk-C2CO7BOS.js";import"./chunk-UVTXHEDZ.js";import"./chunk-3APTCJCW.js";import"./chunk-EMVJM2S7.js";import"./chunk-KDTKTPR2.js";import{a as U}from"./chunk-TPWGF6XO.js";import{$a as v,Ab as y,Cb as a,Dc as A,Ia as E,Ic as w,Ja as T,Jc as C,Kd as O,Qa as M,Tb as k,Wc as b,Xc as d,Yb as u,Zc as m,lc as g,pd as s,qd as l,sc as S,sd as F,xa as _,xc as p,yc as c,zc as h}from"./chunk-MH4BPXDL.js";import{a as P,b as I,l as x}from"./chunk-CU44V7JF.js";function dt(t,n){t&1&&(d(0),s(1,"translate")),t&2&&m(" ",l(1,1,"AUTH.FORGOT_PASSWORD.ERRORS.REQUIRED")," ")}function mt(t,n){t&1&&(d(0),s(1,"translate")),t&2&&m(" ",l(1,1,"AUTH.FORGOT_PASSWORD.ERRORS.INVALID_EMAIL")," ")}function ct(t,n){t&1&&(d(0),s(1,"translate")),t&2&&m(" ",l(1,1,"AUTH.FORGOT_PASSWORD.ERRORS.USER_NOT_FOUND")," ")}function gt(t,n){if(t&1&&d(0),t&2){let r=C(2);m(" ",r.emailControl.errors==null?null:r.emailControl.errors.customError," ")}}function ft(t,n){if(t&1&&u(0,dt,2,3)(1,mt,2,3)(2,ct,2,3)(3,gt,1,1),t&2){let r=C();S(r.emailControl.hasError("required")?0:r.emailControl.hasError("invalidEmail")||r.emailControl.hasError("email")?1:r.emailControl.hasError("userNotFound")?2:r.emailControl.hasError("customError")?3:-1)}}function _t(t,n){if(t&1&&(h(0,"vds-alert",10),s(1,"translate"),s(2,"translate")),t&2){let r=C();g("dismissible",!1)("title",l(1,3,r.warningTitleKey()))("message",l(2,5,r.warningMessageKey()))}}function ut(t,n){if(t&1){let r=A();p(0,"vds-text",19),d(1),s(2,"translate"),p(3,"a",20),w("click",function(i){E(r);let o=C();return i.preventDefault(),T(o.openSupport())}),d(4),s(5,"translate"),c()()}t&2&&(a(),m(" ",l(2,2,"AUTH.FORGOT_PASSWORD.SUCCESS_ALERT_PREFIX")," "),a(3),m(" ",l(5,4,"AUTH.FORGOT_PASSWORD.SUCCESS_ALERT_LINK")," "))}function ht(t,n){if(t&1&&h(0,"vds-alert",17),t&2){C();
1let r=b(28);g("customTemplate",r)("dismissible",!1)}}function Ct(t,n){t&1&&h(0,"vds-container-loading",18),t&2&&g("active",!0)}var Kt=(()=>{let n=class n{constructor(){this.destroyRef=_(M),this.router=_(D),this.authService=_(Z),this.vediusSupportService=_(J),this.translation=_(Q),this.forgotPasswordForm=new V({email:new N("",{nonNullable:!0,validators:[L.required,L.email]})}),this.isLoading=v(!1),this.emailSent=v(!1),this.isLinkExpired=v(!1),this.isLinkInvalid=v(!1),this.loginUrl="/auth/login",this.warningTitleKey=O(()=>this.isLinkExpired()?"AUTH.FORGOT_PASSWORD.WARNING_EXPIRED_TITLE":"AUTH.FORGOT_PASSWORD.WARNING_INVALID_TITLE"),this.warningMessageKey=O(()=>this.isLinkExpired()?"AUTH.FORGOT_PASSWORD.WARNING_EXPIRED_MESSAGE":"AUTH.FORGOT_PASSWORD.WARNING_INVALID_MESSAGE"),this.submitButtonKey=O(()=>this.isLinkExpired()||this.isLinkInvalid()?"AUTH.FORGOT_PASSWORD.RESEND_BUTTON":"AUTH.FORGOT_PASSWORD.SUBMIT_BUTTON"),this.emailControl=this.forgotPasswordForm.controls.email,this.emailControl.valueChanges.pipe(U(this.destroyRef)).subscribe(()=>{this.stripApiErrorsFromControl()})}ngOnInit(){let e=window.history.state;this.isLinkExpired.set(!!e?.linkExpired),this.isLinkInvalid.set(!!e?.linkInvalid);let i=typeof e?.email=="string"?e.email.trim():"";i&&this.emailControl.patchValue(i,{emitEvent:!1})}onEnterKey(e){at(e,()=>void this.onSubmit())}onEscapeKey(){this.navigateToLogin()}onSubmit(){return x(this,null,function*(){if(this.isLoading())return;if(this.normalizeEmailValue(),!this.forgotPasswordForm.valid){this.forgotPasswordForm.markAllAsTouched();return}this.isLoading.set(!0),this.stripApiErrorsFromControl();let e=j.fromString(this.emailControl.value);try{yield this.authService.forgotPassword({email:e}),this.emailSent.set(!0),this.isLinkInvalid.set(!1),this.isLinkExpired.set(!1)}catch(i){this.handleSubmitError(i)}finally{this.isLoading.set(!1)}})}onBackToLogin(e){return x(this,null,function*(){e.preventDefault(),yield this.navigateToLogin()})}openSupport(){this.vediusSupportService.openCrispChat()}navigateToLogin(){return x(this,null,function*(){yield this.router.navigate([this.loginUrl])})}normalizeEmailValue(){let e=this.emailControl.value??"",i=typeof e=="string"?e.trim():e;i!==e&&this.emailControl.patchValue(i,{emitEvent:!1})}stripApiErrorsFromControl(){let e=this.emailControl.errors;if(!e)return;let i=P({},e);delete i.userNotFound,delete i.customError,this.emailControl.setErrors(Object.keys(i).length?i:null)}handleSubmitError(e){this.stripApiErrorsFromControl();let i=this.translation.get("AUTH.FORGOT_PASSWORD.ERRORS.GENERIC"),o=e instanceof Error&&e.message?.trim().length?e.message:i;this.emailControl.setErrors(I(P({},this.emailControl.errors??{}),{customError:o}))}};n.\u0275fac=function(i){return new(i||n)},n.\u0275cmp=k({type:n,selectors:[["app-auth-forgot-password"]],hostBindings:function(i,o){i&1&&w("keydown.enter",function(R){return o.onEnterKey(R)},!1,y)("keydown.escape",function(){return o.onEscapeKey()},!1,y)},decls:32,vars:28,consts:[["emailErrorTpl",""],["alertMessageTpl",""],[1,"forgot-password-container"],[1,"forgot-password-header"],["type","full",3,"height"],["variant","elevated-flat",1,"forgot-password-card"],[1,"forgot-password-card__content"],["variant","heading-lg","color","default",1,"forgot-password-card__title"],["variant","body-md","color","secondary",1,"forgot-password-card__subtitle"],[1,"forgot-password-form",3,"ngSubmit","formGroup"],["state","warning",3,"dismissible","title","message"],[1,"form-field"],["formControlName","email",3,"label","placeholder","errorTemplate"],[1,"forgot-password-form__buttons"],["type","submit","variant","primary",3,"fullWidth","loading","disabled"],["variant","tertiary",3,"click","fullWidth"],[1,"forgot-password-footer"],["state","success",1,"forgot-password-footer__success-alert",3,"customTemplate","dismissible"],["size","md",3,"active"],["variant","body-md","color","default"],["vds-link","","href","#","size","md",3,"click"]],template:function(i,o){if(i&1){let f=A();p(0,"vds-auth-layout")(1,"div",2)(2,"header",3),h(3,"vds-logo",4),c(),p(4,"vds-card",5)(5,"vds-card-content",6)(6,"vds-text",7),d(7),s(8,"translate"),c(),p(9,"vds-text",8),d(10),s(11,"translate"),c(),p(12,"form",9),w("ngSubmit",function(){return E(f),T(o.onSubmit())}),u(13,ft,4,1,"ng-template",null,0,F)(15,_t,3,7,"vds-alert",10),p(16,"div",11),h(17,"vds-email-input",12),s(18,"translate"),s(19,"translate"),c(),p(20,"div",13)(21,"vds-button",14),d(22),s(23,"translate"),c(),p(24,"vds-button",15),w("click",function(pt){return E(f),T(o.onBackToLogin(pt))}),d(25),s(26,"translate"),c()()(),u(27,ut,6,6,"ng-template",null,1,F),p(29,"footer",16),u(30,ht,1,2,"vds-alert",17),c()(),u(31,Ct,1,1,"vds-container-loading",18),c()()()}if(i&2){let f=b(14);a(3),g("height",32),a(4),m(" ",l(8,16,"AUTH.FORGOT_PASSWORD.TITLE")," "),a(3),m(" ",l(11,18,"AUTH.FORGOT_PASSWORD.SUBTITLE")," "),a(2),g("formGroup",o.forgotPasswordForm),a(3),S(o.isLinkExpired()||o.isLinkInvalid()?15:-1),a(2),g("label",l(18,20,"AUTH.FORGOT_PASSWORD.EMAIL_LABEL"))("placeholder",l(19,22,"AUTH.FORGOT_PASSWORD.EMAIL_PLACEHOLDER"))("errorTemplate",f),a(4),g("fullWidth",!0)("loading",o.isLoading())("disabled",o.isLoading()),a(),m(" ",l(23,24,o.submitButtonKey())," "),a(2),g("fullWidth",!0),a(),m(" ",l(26,26,"AUTH.FORGOT_PASSWORD.BACK_BUTTON")," "),a(5),S(o.emailSent()?30:-1),a(),S(o.isLoading()?3
11:-1)}},dependencies:[z,W,G,B,H,K,q,X,st,$,ot,nt,tt,lt,et,Y,rt,it],styles:['@charset "UTF-8";[_ngcontent-%COMP%]:root{--001: #fefefe;--002: #f1f3f5}.theme-dark[_ngcontent-%COMP%]{--001: #16191e;--002: #22262e}[_ngcontent-%COMP%]:root{--elevation-low-bottom: 0 8px 12px 0 rgba(0, 0, 0, .08);--elevation-low-above: 0 -8px 12px 0 rgba(0, 0, 0, .08);--elevation-low-left: -8px 0 12px 0 rgba(0, 0, 0, .08);--elevation-low-right: 8px 0 12px 0 rgba(0, 0, 0, .08);--elevation-high-bottom: 0 12px 40px 0 rgba(0, 0, 0, .12);--elevation-high-above: 0 -12px 40px 0 rgba(0, 0, 0, .12);--elevation-high-left: -12px 0 40px 0 rgba(0, 0, 0, .12);--elevation-high-right: 12px 0 40px 0 rgba(0, 0, 0, .12)}[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%}.forgot-password-container[_ngcontent-%COMP%]{box-sizing:border-box;display:flex;flex-direction:column;gap:1.5rem;width:100%;max-width:540px;margin:0 auto;padding-inline:1.25rem;padding-top:calc(1.5rem + env(safe-area-inset-top));padding-bottom:env(safe-area-inset-bottom,0px)}.forgot-password-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:100%;flex-shrink:0}.forgot-password-card[_ngcontent-%COMP%]{width:100%;position:relative}.forgot-password-card__content[_ngcontent-%COMP%]{padding:1.5rem 1.5rem 1.5rem 1.25rem}.forgot-password-card__title[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem}.forgot-password-card__subtitle[_ngcontent-%COMP%]{display:block;margin-bottom:1.5rem}.forgot-password-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-field[_ngcontent-%COMP%]{display:flex;flex-direction:column}.forgot-password-footer[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;gap:1rem;margin-top:1.5rem}.forgot-password-footer__success-alert[_ngcontent-%COMP%]{width:100%}.forgot-password-form__buttons[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}@media (min-width: 46.5em){[_nghost-%COMP%]{flex:1;height:100%;min-height:100%}.forgot-password-container[_ngcontent-%COMP%]{flex:1;min-height:100%;justify-content:center;padding-bottom:calc(2rem + env(safe-area-inset-bottom))}.forgot-password-card[_ngcontent-%COMP%]{margin-top:0;margin-bottom:0}.forgot-password-card__content[_ngcontent-%COMP%]{padding:3rem 3rem 1.25rem}}@media (min-width: 46.5em) and (max-width: 59.99875em){.forgot-password-container[_ngcontent-%COMP%]{padding-inline:1.5rem}}@media (min-width: 60em){.forgot-password-container[_ngcontent-%COMP%]{padding-inline:0}}'],changeDetection:0});let t=n;return t})();export{Kt as ForgotPasswordComponent};
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.