import{A as U,h as d,i as M,z as w}from"./chunk-I7GW4F3B.js";import{wb as f,zb as A}from"./chunk-V2ECYACM.js";import{a as p,b as k}from"./chunk-SM7EQ7ST.js";import{c as h,d as y}from"./chunk-RWCAFOHA.js";import{Gk as v,Hk as T,a as u,b as C}from"./chunk-BPZQKZKD.js";import{a,b as I}from"./chunk-6B6CBPYV.js";import{b as m,c as j}from"./chunk-YBNTOQCK.js";import{Sa as D,be as E,ha as l,na as b,r as s,ta as c,x as n,xa as i}from"./chunk-WL5U2YIT.js";import{e as R}from"./chunk-ADEKKGI2.js";var J,$=R(()=>{D();b();C();k();I();M();E();T();A();U();j();y();J=(()=>{let t=class t extends p{constructor(e,r,S,P,g){super(P,g),this.assetService=e,this.dvlConfirmationService=r,this.pwnedDialogService=S}changePassword(e){return this.assetService.ChangePassword(e).pipe(l(r=>this.handleResponse(r)))}validatePassword(e){return this.assetService.ValidateLoginPassword(e).pipe(n(r=>r.isValid))}resetPassword(e){return this.assetService.ResetPassword(e).pipe(l(r=>this.handleResponse(r)))}handleResponse(e){if(e.result===a.InvalidData){if(e.passwordResult){let r={details:e.details,result:e.result,passwordResult:e.passwordResult};return this.handleInvalidPassword(r)}return this.displayError(e),s(null)}return e.result===a.Success?s(e):(this.handleApiResult(e,this.translatorService.translate(a.getEnumKey(e.result))),s(null))}handleInvalidPassword(e){let r;switch(e.passwordResult){case d.InvalidTemplate:this.dvlConfirmationService.confirm({intent:"danger",actionMode:"ok",title:this.translatorService.translate("lblError"),message:`${this.translatorService.translate("ThePasswordDoesNotMeetThePasswordPolicyRequirements")}
          ${e.details}`}),r=s(null);break;case d.PwnedInvalid:r=this.pwnedDialogService.showPwnedDialog(u.Required);break;default:r=this.pwnedDialogService.handleError(e.result);break}return r.pipe(n(()=>null))}displayError(e){this.dvlConfirmationService.confirm({intent:"danger",actionMode:"ok",title:this.translatorService.translate("lblError"),message:`${this.translatorService.translate(e.errorMessage)}`})}};t.\u0275fac=function(r){return new(r||t)(i(v),i(f),i(w),i(m),i(h))},t.\u0275prov=c({token:t,factory:t.\u0275fac,providedIn:"root"});let o=t;return o})()});export{J as a,$ as b};
