1import{a as J}from"./chunk-FNX4D7K3.js";import{a as K}from"./chunk-D6R222ET.js";import{b as N}from"./chunk-E3H4BJ7I.js";import{a as L,f as z}from"./chunk-ASTXUBF3.js";import{B as G,D as U,E as O,F as B,H as X,O as $,W as j,v as q,x as V,xa as H,y as M,ya as Y,z as D}from"./chunk-XNTCN5LM.js";import{Da as r,Ec as E,G as f,Ha as g,Ia as C,Ib as F,Kc as I,Ma as w,Mc as R,Nb as n,Sb as y,aa as a,ca as v,da as h,db as d,dc as P,eb as c,ec as b,id as T,jb as l,jd as k,kb as o,lb as t,ma as x,nd as A,tb as _,wb as S,yb as p}from"./chunk-5LGYDGR4.js";import"./chunk-HIUAR4UN.js";function Q(e,u){e&1&&(o(0,"fx-form-error"),n(1,"Enter email or username."),t())}function W(e,u){e&1&&(o(0,"fx-form-error"),n(1,"Check if your email address is correct."),t())}function Z(e,u){e&1&&(o(0,"fx-form-error"),n(1,"Check if your username is correct."),t())}function ee(e,u){if(e&1){let i=_();y(0),P(1,"async"),o(2,"form",9),S("ngSubmit",function(){v(i);let m=p();return h(m.submit())}),o(3,"div",7)(4,"div",3)(5,"fx-form-text",10,0)(7,"label"),n(8,"Email/User Name"),t(),d(9,Q,2,0,"fx-form-error"),d(10,W,2,0,"fx-form-error"),d(11,Z,2,0,"fx-form-error"),t(),g(),t()(),o(12,"div",7)(13,"div",3)(14,"button",11),n(15," Reset my password "),t()()(),o(16,"div",7)(17,"div",12)(18,"a",13),n(19,"Need help?"),t()()()()}if(e&2){let i=F(6),s=p(),m=b(1,6,i.errors$);r(2),l("formGroup",s.forgotPasswordForm),r(3),C(),r(4),c(m?.required?9:-1),r(),c(m?.validEmail?10:-1),r(),c(m?.validUsername?11:-1),r(3),l("disabled",!s.forgotPasswordForm.valid),r(4),l("routerLink","/help")}}function te(e,u){e&1&&(o(0,"div",7)(1,"div",3)(2,"fx-toast",14),n(3," If you have registered an account with us, you will shortly receive an email with instructions to reset your password. Please check your spam folder. "),t()(),o(4,"div",3)(5,"fx-button",15),n(6,"Back to Login"),t()()()),e&2&&(r(2),l("dismissible",!1))}function oe(e,u){if(e&1&&(o(0,"div",8)(1,"div",5)(2,"div",7)(3,"div",16)(4,"p",17),n(5,"You remembered the password?"),t()(),o(6,"div",18)(7,"fx-button",19),n(8,"Login"),t()()()()()),e&2){let i=p();r(7),l("routerLink",i.config.routes.login)}}var _e=(()=>{class e{constructor(){this.fb=a(B),this.accountAPI=a(N),this.toastService=a(Y),this.config=a(K),this.matomo=a(z),this.authService=a(L),this.platformId=a(x),this.router=a(T),this.forgotPasswordForm=this.fb.group({requestPasswordResetId:["",[V.required,J.validateEitherEmailOrUsername]]}),this.errorMessage="",this.isSuccess=!1}ngOnInit(){R(this.platformId)||(this.authService.isAuthenticated$.pipe(f(1)).subscribe(i=>{i&&this.router.navigate(["/"])}),this.matomo.trackPageView("Pasword forgotten"))}resetFormAndSetResult(i){this.isSuccess=i,this.forgotPasswordForm.reset()}submit(){this.forgotPasswordForm.invalid||this.accountAPI.requestPasswordReset(this.forgotPasswordForm.value.requestPasswordResetId).subscribe({next:()=>{this.resetFormAndSetResult(!0),this.forgotPasswordForm.controls.requestPasswordResetId.setErrors(null),this.toastService.success("Link for resetting password has been sent.","Success")},error:i=>{i.error.forEach(s=>{this.toastService.error(s.description,"Something went wrong"),this.resetFormAndSetResult(!1)})}})}static{this.\u0275fac=function(s){return new(s||e)}}static{this.\u0275cmp=w({type:e,selectors:[["fx-password-forgot"]],decls:10,vars:2,consts:[["requestPasswordResetIdInput","FxFormText"],[1,"container-slim"],[1,"row","mb-5"],[1,"col-12"],[1,"card"],[1,"card-body"],[3,"formGroup"],[1,"row"],[1,"card","mt-6"],[3,"ngSubmit","formGroup"],["formControlName","requestPasswordResetId"],["type","submit","btnType","primary",1,"w-100",3,"disabled"],[1,"col-12","text-center","pt-6"],[1,"text-decoration-underline",3,"routerLink"],["type","success",3,"dismissible"],["btnType","primary","routerLink","/authentication/login",1,"w-100","text-center"],[1,"col-7","col-lg-8","my-auto"],[1,"mb-0"],[1,"col-5","col-lg-4","text-end","my-auto"],["btnType","secondary",3,"routerLink"]],template:function(s,m){s&1&&(o(0,"div",1)(1,"div",2)(2,"div",3)(3,"h1"),n(4,"Forgot Password"),t()()(),o(5,"div",4)(6,"div",5),d(7,ee,20,8,"form",6)(8,te,7,1,"div",7),t()(),d(9,oe,9,1,"div",8),t()),s&2&&(r(7),c(m.isSuccess?8:7),r(2),c(m.isSuccess?-1:9))},dependencies:[X,G,M,D,O,U,I,A,k,j,H,$,q,E],styles:[`:host{display:block} 2`],encapsulation:2,changeDetection:1})}}return e})();export{_e as PasswordForgotComponent};
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.