import{b as G}from"./chunk-GYUUHJHO.js";import{h as b}from"./chunk-JH3E5Q4S.js";import{b as y,c as W}from"./chunk-5RZNWWZS.js";import{B as D,C as $,d as O,g as C,h as M,n as N,q as w,t as v}from"./chunk-J3Q5GF64.js";import"./chunk-FE65AIAB.js";import{Ab as T,Ga as _,Ra as P,Rg as h,Va as c,Wf as I,aa as s,db as S,jd as A,ka as u,mb as a,nb as t,nd as g,ob as d,wb as m}from"./chunk-WOSO3QBJ.js";import{i as p}from"./chunk-C2HMJUB7.js";var L={VALIDATORS:[O.required],MESSAGES:{required:"\u0E15\u0E49\u0E2D\u0E07\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19"}};var F=(()=>{let r=class r extends W{formReactiveService=s(y);userService=s(h);notifier=s(I);router=s(g);route=s(A);userId;verificationString;ngOnInit(){this.buildForm({password:b,"password-confirm":L}),this.userId=this.route.snapshot.queryParams.userId,this.verificationString=this.route.snapshot.queryParams.verificationString,(!this.userId||!this.verificationString)&&(this.notifier.error("\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E44\u0E2D\u0E14\u0E35\u0E1C\u0E39\u0E49\u0E43\u0E0A\u0E49\u0E2B\u0E23\u0E37\u0E2D\u0E23\u0E2B\u0E31\u0E2A\u0E25\u0E34\u0E07\u0E01\u0E4C\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19"),this.router.navigate(["/"]));}resetPassword(){this.userService.resetPassword(this.userId,this.verificationString,this.form.value.password).subscribe({next:()=>{this.notifier.success("\u0E23\u0E35\u0E40\u0E0B\u0E47\u0E15\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19\u0E40\u0E23\u0E35\u0E22\u0E1A\u0E23\u0E49\u0E2D\u0E22"),this.router.navigate(["/login"]);},error:e=>this.notifier.error(e.message)});}isConfirmedPasswordValid(){let e=this.form.value;return e.password===e["password-confirm"];}};p(r,"\u0275fac",(()=>{let e;return function(o){return(e||(e=u(r)))(o||r);};})()),p(r,"\u0275cmp",P({type:r,selectors:[["ng-component"]],features:[c],decls:13,vars:4,consts:()=>{let e;e="\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19";let i;i="\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19\u0E41\u0E25\u0E49\u0E27";let o;o="\u0E23\u0E35\u0E40\u0E0B\u0E47\u0E15\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19";let E;E="\u0E23\u0E35\u0E40\u0E0B\u0E47\u0E15\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19";let R;R="\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19";let f;return f="\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19",[E,R,f,[1,"margin-content"],[1,"title-page"],[3,"ngSubmit","formGroup"],[1,"form-group"],["for","password"],["formControlName","password","inputId","password","placeholder",e,"autocomplete","new-password",3,"formError"],["for","password-confirm"],["formControlName","password-confirm","inputId","password-confirm","placeholder",i,"autocomplete","new-password",3,"formError"],["type","submit","value",o,1,"peertube-button","primary-button",3,"disabled"]];},template:function(i,o){i&1&&(a(0,"div",3)(1,"h1",4),m(2,0),t(),a(3,"form",5),T("ngSubmit",function(){return o.resetPassword();}),a(4,"div",6)(5,"label",7),m(6,1),t(),d(7,"my-input-text",8),t(),a(8,"div",6)(9,"label",9),m(10,2),t(),d(11,"my-input-text",10),t(),d(12,"input",11),t()()),i&2&&(_(3),S("formGroup",o.form),_(4),S("formError",o.formErrors.password),_(4),S("formError",o.formErrors["password-confirm"]),_(),S("disabled",!o.form.valid||!o.isConfirmedPasswordValid()));},dependencies:[D,N,C,M,$,w,v,G],styles:[`my-input-text[_ngcontent-%COMP%]{max-width:340px;display:block}
/*# sourceMappingURL=reset-password.component-FAAMG2MQ.css.map */`]}));let l=r;return l;})();var re=[{path:"",component:F,data:{meta:{title:"Reset password"}}}];export{re as default};/**i18n:b44b17e72e4b9ae03afb92709eafda64a985c0c8f0453c865708cceafe42f927*///# sourceMappingURL=chunk-ALDLLOKB.js.map