import{b as y}from"./chunk-UVCMNOGP.js";import{h as G}from"./chunk-JVYYBNMN.js";import{b as I,c as W}from"./chunk-2P2POCS2.js";import{A as w,B as D,d as A,g as O,h as C,m as M,p as N,s as v}from"./chunk-I267ADJP.js";import"./chunk-NIY7P74G.js";import{$a as a,Fa as S,Ga as s,La as u,Pa as c,Qf as $,bd as T,ed as g,ib as d,jb as i,kb as l,sb as E,wb as P,yg as h}from"./chunk-4JM6MIZ5.js";import{i as R}from"./chunk-QJQRWPYR.js";var L={VALIDATORS:[A.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 b=(()=>{let t=class t extends W{formReactiveService;userService;notifier;router;route;userId;verificationString;constructor(e,r,o,n,m){super(),this.formReactiveService=e,this.userService=r,this.notifier=o,this.router=n,this.route=m;}ngOnInit(){this.buildForm({password:G,"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"];}};R(t,"\u0275fac",function(r){return new(r||t)(s(I),s(h),s($),s(g),s(T));}),R(t,"\u0275cmp",u({type:t,selectors:[["ng-component"]],features:[c],decls:13,vars:4,consts:()=>{let e;e="\u0631\u0645\u0632\u0639\u0628\u0648\u0631";let r;r="\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 n;n="\u062A\u063A\u06CC\u06CC\u0631 \u0631\u0645\u0632\u0639\u0628\u0648\u0631";let m;m="\u0631\u0645\u0632\u0639\u0628\u0648\u0631";let f;return f="\u062A\u0627\u06CC\u06CC\u062F \u0631\u0645\u0632\u0639\u0628\u0648\u0631",[n,m,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",r,"autocomplete","new-password",3,"formError"],["type","submit","value",o,1,"peertube-button","primary-button",3,"disabled"]];},template:function(r,o){r&1&&(d(0,"div",3)(1,"h1",4),E(2,0),i(),d(3,"form",5),P("ngSubmit",function(){return o.resetPassword();}),d(4,"div",6)(5,"label",7),E(6,1),i(),l(7,"my-input-text",8),i(),d(8,"div",6)(9,"label",9),E(10,2),i(),l(11,"my-input-text",10),i(),l(12,"input",11),i()()),r&2&&(S(3),a("formGroup",o.form),S(4),a("formError",o.formErrors.password),S(4),a("formError",o.formErrors["password-confirm"]),S(),a("disabled",!o.form.valid||!o.isConfirmedPasswordValid()));},dependencies:[w,M,O,C,D,N,v,y],styles:[`my-input-text[_ngcontent-%COMP%]{max-width:340px;display:block}
/*# sourceMappingURL=reset-password.component-6CW2LNIG.css.map */`]}));let p=t;return p;})();var Z=[{path:"",component:b,data:{meta:{title:"\u062A\u0646\u0638\u06CC\u0645 \u0645\u062C\u062F\u062F \u0631\u0645\u0632 \u0639\u0628\u0648\u0631"}}}];export{Z as default};/**i18n:68865f44f2a527c44cf5136a17c76a0ff8308c2bae5c7c8d50070a5fb9847c44*///# sourceMappingURL=chunk-AUJD7SDA.js.map