import{a as G}from"./chunk-564SGFOD.js";import{b as L}from"./chunk-I35UNCSO.js";import{h as b}from"./chunk-JERELDEF.js";import{b as h}from"./chunk-TQ5ESXAX.js";import{E as $,F as D,d as A,g as O,h as M,p as N,w,x as v}from"./chunk-GE7DWA6O.js";import"./chunk-7HOLFPGE.js";import{Cb as m,Da as _,Fd as g,Gb as T,Jd as C,Na as P,Oh as W,Rg as y,Ta as c,ba as i,lb as a,mb as S,nb as s,ob as d,sa as u,th as I}from"./chunk-MOXUT4EU.js";import{i as p}from"./chunk-QQ7SJNXU.js";var F={VALIDATORS:[A.required],MESSAGES:{required:"\u30D1\u30B9\u30EF\u30FC\u30C9(\u78BA\u8A8D)\u306F\u5FC5\u9808\u3067\u3059\u3002"}};var X=(()=>{let t=class t extends G{formReactiveService=i(h);userService=i(W);serverService=i(I);notifier=i(y);router=i(C);route=i(g);userId;verificationString;ngOnInit(){let{minLength:e,maxLength:r}=this.serverService.getHTMLConfig().fieldsConstraints.users.password;this.buildForm({password:b(e,r),"password-confirm":F}),this.userId=this.route.snapshot.queryParams.userId,this.verificationString=this.route.snapshot.queryParams.verificationString,(!this.userId||!this.verificationString)&&(this.notifier.error("\u30E6\u30FC\u30B6\u30FCID\u307E\u305F\u306F\u78BA\u8A8D\u6587\u5B57\u5217\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"),this.router.navigate(["/"]));}resetPassword(){this.userService.resetPassword(this.userId,this.verificationString,this.form.value.password).subscribe({next:()=>{this.notifier.success("\u30D1\u30B9\u30EF\u30FC\u30C9\u306F\u6B63\u5E38\u306B\u30EA\u30BB\u30C3\u30C8\u3055\u308C\u307E\u3057\u305F\uFF01"),this.router.navigate(["/login"]);},error:e=>this.notifier.handleError(e)});}isConfirmedPasswordValid(){let e=this.form.value;return e.password===e["password-confirm"];}};p(t,"\u0275fac",(()=>{let e;return function(o){return(e||(e=u(t)))(o||t);};})()),p(t,"\u0275cmp",P({type:t,selectors:[["ng-component"]],features:[c],decls:13,vars:4,consts:()=>{let e;e="\u30D1\u30B9\u30EF\u30FC\u30C9";let r;r="\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u78BA\u8A8D\u3057\u307E\u3057\u305F";let o;o="\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u30EA\u30BB\u30C3\u30C8";let E;E="\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u30EA\u30BB\u30C3\u30C8";let R;R="\u30D1\u30B9\u30EF\u30FC\u30C9";let f;return f="\u30D1\u30B9\u30EF\u30FC\u30C9(\u78BA\u8A8D)",[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",r,"autocomplete","new-password",3,"formError"],["type","submit","value",o,1,"peertube-button","primary-button",3,"disabled"]];},template:function(r,o){r&1&&(S(0,"div",3)(1,"h1",4),m(2,0),s(),S(3,"form",5),T("ngSubmit",function(){return o.resetPassword();}),S(4,"div",6)(5,"label",7),m(6,1),s(),d(7,"my-input-text",8),s(),S(8,"div",6)(9,"label",9),m(10,2),s(),d(11,"my-input-text",10),s(),d(12,"input",11),s()()),r&2&&(_(3),a("formGroup",o.form),_(4),a("formError",o.formErrors.password),_(4),a("formError",o.formErrors["password-confirm"]),_(),a("disabled",!o.form.valid||!o.isConfirmedPasswordValid()));},dependencies:[$,N,O,M,D,v,w,L],styles:[`my-input-text[_ngcontent-%COMP%]{max-width:340px;display:block}
/*# sourceMappingURL=reset-password.component-ZMNUSJ3U.css.map */`]}));let l=t;return l;})();var te=[{path:"",component:X,data:{meta:{title:"\u30D1\u30B9\u30EF\u30FC\u30C9\u306E\u30EA\u30BB\u30C3\u30C8"}}}];export{te as default};/**i18n:5a85df092a135682c90bae008e37ec28160e04e5f445e29af2927333ba91ffa1*///# sourceMappingURL=chunk-ERNVUKY6.js.map