import{b as G}from"./chunk-3KEQAXSL.js";import{h as L}from"./chunk-UBXHYJCF.js";import{b as $,c as y}from"./chunk-HA72KDYL.js";import{A as D,B as I,d as O,g as C,h as M,m as N,p as v,s as w}from"./chunk-K34LZIA3.js";import"./chunk-BUPI2ADN.js";import{$c as g,Bg as W,Ca as S,Da as n,Ka as c,Kb as T,Va as d,Vf as h,ba as f,cb as m,cd as A,db as t,eb as E,mb as p,qb as P}from"./chunk-X3RCWQ3R.js";import{i as r}from"./chunk-SR6RTMQI.js";var b={VALIDATORS:[O.required],MESSAGES:{required:"Require a confirmaci\xF3n do contrasinal."}};var F=(()=>{let s=class s extends y{constructor(e,i,o,_,l){super();r(this,"formReactiveService");r(this,"userService");r(this,"notifier");r(this,"router");r(this,"route");r(this,"userId");r(this,"verificationString");this.formReactiveService=e,this.userService=i,this.notifier=o,this.router=_,this.route=l;}ngOnInit(){this.buildForm({password:L,"password-confirm":b}),this.userId=this.route.snapshot.queryParams.userId,this.verificationString=this.route.snapshot.queryParams.verificationString,(!this.userId||!this.verificationString)&&(this.notifier.error("Non se atopa o id da usuaria ou cadea de verificaci\xF3n."),this.router.navigate(["/"]));}resetPassword(){this.userService.resetPassword(this.userId,this.verificationString,this.form.value.password).subscribe({next:()=>{this.notifier.success("Restableceuse correctamente o contrasinal!"),this.router.navigate(["/login"]);},error:e=>this.notifier.error(e.message)});}isConfirmedPasswordValid(){let e=this.form.value;return e.password===e["password-confirm"];}};r(s,"\u0275fac",function(i){return new(i||s)(n($),n(W),n(h),n(A),n(g));}),r(s,"\u0275cmp",f({type:s,selectors:[["ng-component"]],standalone:!0,features:[c,T],decls:13,vars:4,consts:()=>{let e;e="Contrasinal";let i;i="Contrasinal confirmado";let o;o="Restablecer contrasinal";let _;_="Restablecer contrasinal";let l;l="Contrasinal";let u;return u="Confirmar contrasinal",[_,l,u,[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&&(m(0,"div",3)(1,"h1",4),p(2,0),t(),m(3,"form",5),P("ngSubmit",function(){return o.resetPassword();}),m(4,"div",6)(5,"label",7),p(6,1),t(),E(7,"my-input-text",8),t(),m(8,"div",6)(9,"label",9),p(10,2),t(),E(11,"my-input-text",10),t(),E(12,"input",11),t()()),i&2&&(S(3),d("formGroup",o.form),S(4),d("formError",o.formErrors.password),S(4),d("formError",o.formErrors["password-confirm"]),S(),d("disabled",!o.form.valid||!o.isConfirmedPasswordValid()));},dependencies:[D,N,C,M,I,v,w,G],styles:[`my-input-text[_ngcontent-%COMP%]{max-width:340px;display:block}
/*# sourceMappingURL=reset-password.component-6CW2LNIG.css.map */`]}));let R=s;return R;})();var oe=[{path:"",component:F,data:{meta:{title:"Restablecer contrasinal"}}}];export{oe as default};/**i18n:3d16453f213eb5db982e7e7dd90631843ac5d3f860726a614777c3e9e3f9b57e*///# sourceMappingURL=chunk-RIHFUWJN.js.map