1import{a as Q}from"./chunk-D6R222ET.js";import{b as O}from"./chunk-E3H4BJ7I.js";import{a as U,f as K}from"./chunk-ASTXUBF3.js";import{B as X,D as j,E as z,F as H,H as W,J as Y,W as Z,v as q,x as l,y as B,ya as J,z as $}from"./chunk-XNTCN5LM.js";import{Da as r,Ec as k,G as w,Ha as S,Ia as g,Ib as F,Kc as M,Ma as P,Mc as D,Nb as a,Ob as h,R as v,Sb as R,Tb as E,Ub as I,aa as i,ca as C,da as x,db as m,dc as T,eb as p,ec as A,gd as L,id as N,jb as f,jd as V,kb as s,lb as o,ma as _,nd as G,tb as b,wb as y,yb as c}from"./chunk-5LGYDGR4.js";import"./chunk-HIUAR4UN.js";function ee(t,u){t&1&&(s(0,"fx-form-error"),a(1,"Password is required."),o())}function te(t,u){if(t&1&&(s(0,"fx-form-error"),a(1),o()),t&2){c();let e=I(0);r(),h(e?.errorMessage)}}function re(t,u){if(t&1&&(s(0,"fx-form-error"),a(1),o()),t&2){let e=c(2);r(),h(e.passwordInputErrorMsg)}}function oe(t,u){if(t&1){let e=b();R(0),T(1,"async"),s(2,"form",8),y("ngSubmit",function(){C(e);let d=c();return x(d.submit())}),s(3,"div",7)(4,"div",9)(5,"fx-form-password",10,0)(7,"label"),a(8,"New Password"),o(),m(9,ee,2,0,"fx-form-error"),m(10,te,2,1,"fx-form-error"),m(11,re,2,1,"fx-form-error"),o(),S(),o()(),s(12,"div",11)(13,"div",9)(14,"button",12),a(15," Update password "),o()()()()}if(t&2){let e=F(6),n=c(),d=E(A(1,5,e.errors$));r(2),f("formGroup",n.resetPasswordForm),r(3),g(),r(4),p(d?.required?9:-1),r(),p(d?.errorMessage?10:-1),r(),p(d?.pattern?11:-1),r(3),f("disabled",!n.resetPasswordForm.valid)}}function ie(t,u){if(t&1&&(s(0,"div",7)(1,"div",9)(2,"fx-button",13),a(3," Back to Login "),o()()()),t&2){let e=c();r(2),f("routerLink",e.config.routes.login)}}var ge=(()=>{class t{constructor(){this.matomo=i(K),this.fb=i(H),this.accountAPI=i(O),this.toastService=i(J),this.config=i(Q),this.route=i(L),this.authService=i(U),this.platformId=i(_),this.router=i(N),this.resetPasswordForm=this.fb.group({password:["",[l.required,l.minLength(8),l.maxLength(24),l.pattern(/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[^\w\s]).*$/)]]}),this.isSuccess=!1,this.isDestroyed=!1,this.passwordInputErrorMsg=`Increase your password strength. Use at least 8 characters; the longer the better. Try a mixture of both 2 uppercase and lowercase letters. Use a mixture of letters and numbers. Try to include at least one 3 special character, e.g., ! @ # ?`}ngOnDestroy(){this.isDestroyed=!0}ngOnInit(){D(this.platformId)||(this.authService.isAuthenticated$.pipe(w(1)).subscribe(e=>{e&&this.router.navigate(["/"])}),this.route.params.pipe(v(()=>!this.isDestroyed)).subscribe(()=>{this.activationCode=this.route.snapshot.params.activationCode}),this.matomo.trackPageView("Password Reset"))}resetFormAndSetSuccessStatus(e){this.isSuccess=e,this.resetPasswordForm.reset()}submit(){if(this.resetPasswordForm.invalid||!this.activationCode)return;let e=this.resetPasswordForm.get("password");this.accountAPI.resetPassword(this.activationCode,this.resetPasswordForm.value.password).subscribe({next:()=>{delete this.activationCode,this.resetFormAndSetSuccessStatus(!0),e?.setErrors(null),this.toastService.success("Your password has been updated.")},error:()=>{this.toastService.error("This password reset link has expired or is no longer valid. Please request a new password reset link."),e?.setErrors({errorMessage:"Invalid password reset link"}),e?.markAsTouched()}})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=P({type:t,selectors:[["fx-password-reset"]],decls:9,vars:1,consts:[["passwordInput","FxFormPassword"],[1,"container"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"container-slim"],[3,"formGroup"],[1,"row","mb-2"],[3,"ngSubmit","formGroup"],[1,"col-12"],["formControlName","password","appPasswordReveal",""],[1,"row"],["type","submit","btnType","primary",1,"w-100","text-center",3,"disabled"],["btnType","primary",1,"w-100","text-center",3,"routerLink"]],template:function(n,d){n&1&&(s(0,"div",1)(1,"div",2)(2,"div",3)(3,"h1"),a(4,"Reset password"),o()(),s(5,"div",4)(6,"div",5),m(7,oe,16,8,"form",6)(8,ie,4,1,"div",7),o()()()()),n&2&&(r(7),p(d.isSuccess?8:7))},dependencies:[W,X,B,$,z,j,Y,q,M,Z,G,V,k],styles:[`:host{display:block} 4`],encapsulation:2,changeDetection:1})}}return t})();export{ge as PasswordResetComponent};
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.