import{b as G}from"./chunk-5SLIQZK7.js";import{h as b}from"./chunk-HRZKWDAU.js";import{b as y,c as W}from"./chunk-4ZCAGUOZ.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-HFUYX2U4.js";import"./chunk-HWX42522.js";import{Db as T,Ha as _,Sa as P,Tg as h,Wa as c,Yf as I,ba as s,gb as S,la as u,ld as A,pb as a,pd as g,qb as t,rb as d,zb as m}from"./chunk-YAKH5Q6V.js";import{i as p}from"./chunk-DM5LJ7VI.js";var L={VALIDATORS:[O.required],MESSAGES:{required:"\u062A\u0623\u06CC\u06CC\u062F \u0631\u0645\u0632 \u0639\u0628\u0648\u0631 \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A."}};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("\u0642\u0627\u062F\u0631 \u0628\u0647 \u067E\u06CC\u062F\u0627 \u06A9\u0631\u062F\u0646 \u0634\u0646\u0627\u0633\u0647 \u06A9\u0627\u0631\u0628\u0631 \u06CC\u0627 \u0631\u0634\u062A\u0647 \u062A\u0623\u06CC\u06CC\u062F \u0646\u06CC\u0633\u062A."),this.router.navigate(["/"]));}resetPassword(){this.userService.resetPassword(this.userId,this.verificationString,this.form.value.password).subscribe({next:()=>{this.notifier.success("\u0631\u0645\u0632 \u0639\u0628\u0648\u0631 \u0634\u0645\u0627 \u0628\u0627\u0645\u0648\u0641\u0642\u06CC\u062A \u0631\u06CC\u0633\u062A \u0634\u062F!"),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="\u0631\u0645\u0632\u0639\u0628\u0648\u0631";let i;i="\u0631\u0645\u0632\u0639\u0628\u0648\u0631 \u062A\u0627\u06CC\u06CC\u062F \u0634\u062F\u0647";let o;o="\u062A\u063A\u06CC\u06CC\u0631 \u0631\u0645\u0632\u0639\u0628\u0648\u0631";let E;E="\u062A\u063A\u06CC\u06CC\u0631 \u0631\u0645\u0632\u0639\u0628\u0648\u0631";let R;R="\u0631\u0645\u0632\u0639\u0628\u0648\u0631";let f;return f="\u062A\u0627\u06CC\u06CC\u062F \u0631\u0645\u0632\u0639\u0628\u0648\u0631",[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:"\u062A\u0646\u0638\u06CC\u0645 \u0645\u062C\u062F\u062F \u0631\u0645\u0632 \u0639\u0628\u0648\u0631"}}}];export{re as default};/**i18n:197837fef124041a3f31333a5ea4afa44db030645e23ee7031f32704e8696a1d*///# sourceMappingURL=chunk-PAEAUX5O.js.map