1import{a as ve}from"./chunk-U6VLCQAR.js";import{a as Pe}from"./chunk-OZMNUSOE.js";import"./chunk-H65SYPQS.js";import{a as Se}from"./chunk-JLXLJDHN.js";import"./chunk-BWUSCTTF.js";import{a as he}from"./chunk-62BDWMXF.js";import"./chunk-Q2PAEAWW.js";import"./chunk-JV3Q3B4Q.js";import"./chunk-BLLILCYP.js";import{a as _e,b as ge}from"./chunk-N6INWO2U.js";import{h as ue}from"./chunk-PDMAI7CC.js";import{a as we}from"./chunk-LZIL4M7E.js";import{a as J,e as Z,ka as ce,la as me,oa as fe}from"./chunk-5MAVA7VG.js";import{$ as ee,Ca as N,K as Q,M as X,Ta as de,c as z,ca as te,da as re,ea as ie,f as K,ga as oe,h as Y,ha as ne,i as H,ia as ae,ka as se,oa as le,pa as R,qa as S,va as pe}from"./chunk-U6GUYE3A.js";import{A as C,Ib as n,Jb as d,Kb as f,Lb as g,P as O,Pb as $,Qb as W,R as D,S as y,Sb as k,Ub as V,V as I,Wb as u,Ya as b,_a as o,ca as T,ec as h,f as E,g as M,hb as m,ia as B,ic as c,ja as q,jc as w,kc as G,na as A,nb as j,oa as U,oc as L,tb as _,tc as a,ua as F,uc as s,wc as P}from"./chunk-JEFLUBX6.js";import{a as x}from"./chunk-JHI3MBHO.js";function ye(t,p){if(t&1&&g(0,"q-alert",11),t&2){let e=p.ngIf;n("info",e)}}function Ie(t,p){t&1&&g(0,"mat-spinner",12),t&2&&n("diameter",13)}function Fe(t,p){t&1&&(c(0),a(1,"translate"),a(2,"uppercase")),t&2&&w(s(2,3,s(1,1,"*.save")))}function be(t,p){if(t&1){let e=k();$(0),d(1,"h2",4),c(2),a(3,"translate"),f(),d(4,"p",5),c(5),a(6,"translate"),f(),d(7,"p",5),c(8),f(),d(9,"form",6),V("ngSubmit",function(){B(e);let i=u();return q(i.setNewPassword())}),_(10,ye,1,1,"q-alert",7),g(11,"q-password-form",8),d(12,"button",9),_(13,Ie,1,1,"mat-spinner",10)(14,Fe,3,5,"ng-template",null,2,P),f()(),W()}if(t&2){let e=p.ngIf,r=h(15),i=u();o(2),w(s(3,10,"PASSWORD.choose_password")),o(3),w(e.message||s(6,12,"PASSWORD.force_new_password_info")),o(3),w(e.email),o(),n("formGroup",i.passwordForm),o(),n("ngIf",i.errorPasswordForm()),o(),n("formControl",i.newPasswordControl)("username",e.email),o(),n("disabled",i.passwordForm.disabled||i.passwordForm.invalid),o(),n("ngIf",i.submittingNewPassword())("ngIfElse",r)}}function Re(t,p){if(t&1&&(d(0,"q-placeholder",14)(1,"p",15),c(2),a(3,"translate"),d(4,"a",16),a(5,"translate"),c(6),a(7,"translate"),f()(),d(8,"a",17),a(9,"async"),c(10),a(11,"translate"),a(12,"uppercase"),f()()),t&2){let e=p.ngIf,r=u(2);n("info",e),o(2),G("",s(3,8,"*.need_help")," "),o(2),n("href",L("mailto:[email protected]?subject=",s(5,10,"PASSWORD.password_error")," ",e.code),b),o(2),w(s(7,12,"*.send_mail")),o(2),n("href",s(9,14,r.redirectUrl$),b),o(2),w(s(12,18,s(11,16,"*.to_questi")))}}function Ne(t,p){if(t&1&&(_(0,Re,13,20,"q-placeholder",13),a(1,"async")),t&2){let e=u(),r=h(5);n("ngIf",s(1,2,e.passwordSession.errorPlaceholder$))("ngIfElse",r)}}function Ee(t,p){t&1&&g(0,"mat-spinner")}var xe=(()=>{class t{constructor(e,r,i,l,v,Ce){this._document=e,this._passwordService=r,this._redirectService=i,this._loadingService=l,this._loginStateService=v,this._translateUtilsService=Ce,this._destroyRef=T(U),this.passwordSession=this._initPasswordSession(),this.redirectUrl$=this._redirectService.getRedirectUrl("default"),this.newPasswordControl=new oe("",{validators:ee.required,nonNullable:!0}),this.passwordForm=new ie({new_password:this.newPasswordControl}),this.errorPasswordForm=F(null),this.submittingNewPassword=F(!1)}setNewPassword(){this.passwordForm.invalid||this.passwordForm.disabled||this._passwordService.setNewFnpPassword(this.passwordForm.getRawValue()).pipe(R(()=>this.errorPasswordForm.set(null)),y(e=>de(this._document,e)),C(e=>this._loginStateService.handleSchoolRequiredError(e)),I({error:e=>this.errorPasswordForm.set(this._getSavePasswordError(e))}),S(this.passwordForm),S(this.submittingNewPassword),S(this._loadingService.loading$),we(this._destroyRef)).subscribe()}_initPasswordSession(){let e=new E(1),r=this._translateUtilsService.getCurrentLanguage().pipe(y(l=>this._passwordService.getForceNewPasswordSession(l).pipe(R(()=>e.next(null)),I({error:v=>e.next(this._getPasswordError(v))}),C(()=>M),D(null))),O({bufferSize:1,refCount:!0}));return{errorPlaceholder$:e.asObservable(),data$:r}}_getPasswordError(e){let r=N(e)?e.errorKey:void 0,i={803:pe,0:this._defaultPasswordPlaceholder},l=(i[r??0]??i[0])();return x({code:r},l)}_getSavePasswordError(e){let r=N(e)?e.errorKey:void 0,i={805:()=>this._invalidPasswordPlaceholder(),810:()=>this._sameAsOldPasswordPlaceholder(),811:()=>this._breachedPasswordPlaceholder(),0:()=>this._defaultSavePasswordPlaceholder()},l=(i[r??0]??i[0])();return delete l.icon,x({code:r},l)}_defaultPasswordPlaceholder(){return{title:["ERROR.something_wrong"],icon:"exclamation-triangle"}}_defaultSavePasswordPlaceholder(){let e=["ERROR.something_wrong"],r=["PASSWORD.ERROR.save_failed"];return{title:e,message:r}}_invalidPasswordPlaceholder(){return{message:["PASSWORD.invalid_format"]}}_sameAsOldPasswordPlaceholder(){return{message:["PASSWORD.same_as_old"]}}_breachedPasswordPlaceholder(){return{message:["PASSWORD.breached"]}}static{this.\u0275fac=function(r){return new(r||t)(m(A),m(ue),m(Z),m(J),m(he),m(fe))}}static{this.\u0275cmp=j({type:t,selectors:[["q-force-new-password"]],decls:6,vars:4,consts:[["loadingOrPlaceholder",""],["loading",""],["validateText",""],[4,"ngIf","ngIfElse"],[1,"header-title"],[1,"header-info"],[3,"ngSubmit","formGroup"],["color","danger",3,"info",4,"ngIf"],[3,"formControl","username"],["mat-flat-button","","color","primary",3,"disabled"],[3,"diameter",4,"ngIf","ngIfElse"],["color","danger",3,"info"],[3,"diameter"],[3,"info",4,"ngIf","ngIfElse"],[3,"info"],[1,"placeholder-message"],["mat-button","","type","button",1,"textual-link",3,"href"],["mat-button","","color","primary",3,"href"]],template:function(r,i){if(r&1&&(_(0,be,16,14,"ng-container",3),a(1,"async"),_(2,Ne,2,4,"ng-template",null,0,P)(4,Ee,1,0,"ng-template",null,1,P)),r&2){let l=h(3);n("ngIf",s(1,2,i.passwordSession.data$))("ngIfElse",l)}},dependencies:[H,z,le,ne,te,re,ae,se,X,ge,_e,me,ce,Pe,ve,Se,K,Y,Q],styles:["[_nghost-%COMP%]{flex:1;display:flex;flex-direction:column;position:relative;text-align:center;white-space:pre-wrap;word-break:break-word}.mat-mdc-progress-spinner[_ngcontent-%COMP%]{margin:auto}q-password-form[_ngcontent-%COMP%]{margin:0 auto 30px;width:100%}@media(min-width:768px){[_nghost-%COMP%]{width:80%;margin:0 auto}}"],changeDetection:0})}}return t})();var nt=[{path:"",component:xe}];
1export{nt as forceNewPasswordRoutes};
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.