import{a as g,b as oe}from"./chunk-J7AGFEXY.js";import{a as v}from"./chunk-24YSJFPE.js";import{d as re}from"./chunk-3NE5QHKI.js";import{b as ee,c as ne}from"./chunk-IFVT3AN2.js";import{B as Z,C as Q,c as K,g as z,h as W,n as H,q as j,t as B,y as J}from"./chunk-EKD65OAZ.js";import{Ab as x,Ac as q,Bb as S,Cc as I,Ga as c,Ob as D,Pb as b,Ra as N,Rg as R,Va as L,Wf as T,Xa as d,Yb as k,aa as s,db as f,ga as O,ha as y,ib as p,jd as X,ka as U,kg as ie,mb as _,nb as r,ob as A,od as w,r as P,sa as F,sb as h,ub as V,vb as $,wb as l,wg as M,xb as G,yb as Y,zg as te}from"./chunk-XBTZE2EC.js";import{i as u}from"./chunk-WHYNGVB3.js";var ce=e=>({"input-error":e});function Ee(e,n){if(e&1&&(_(0,"div",12),D(1),r()),e&2){let o=S(2);c(),b(o.formErrors["verify-email-email"]);}}function me(e,n){if(e&1){let o=h();_(0,"form",6),x("ngSubmit",function(){O(o);let t=S();return y(t.askSendVerifyEmail());}),_(1,"div",7)(2,"label",8),l(3,1),r(),A(4,"input",9),d(5,Ee,2,1,"div",10),r(),A(6,"input",11),r();}if(e&2){let o=S();f("formGroup",o.form),c(4),f("ngClass",k(4,ce,o.formErrors["verify-email-email"])),c(),f("ngIf",o.formErrors["verify-email-email"]),c(),f("disabled",!o.form.valid);}}function ue(e,n){if(e&1&&(_(0,"div"),l(1,2),r()),e&2){let o=S();c(),G(o.instanceName),Y(1);}}var ae=(()=>{let n=class n extends ne{formReactiveService=s(ee);userService=s(R);signupService=s(g);serverService=s(M);notifier=s(T);redirectService=s(te);requiresEmailVerification=!1;get instanceName(){return this.serverService.getHTMLConfig().instance.name;}ngOnInit(){this.serverService.getConfig().subscribe(i=>{this.requiresEmailVerification=i.signup.requiresEmailVerification;}),this.buildForm({"verify-email-email":re});}askSendVerifyEmail(){let i=this.form.value["verify-email-email"];P([this.userService.askSendVerifyEmail(i),this.signupService.askSendVerifyEmail(i)]).subscribe({next:()=>{this.notifier.success("\u0E2D\u0E35\u0E40\u0E21\u0E25\u0E17\u0E35\u0E48\u0E21\u0E35\u0E25\u0E34\u0E07\u0E01\u0E4C\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E08\u0E30\u0E16\u0E39\u0E01\u0E2A\u0E48\u0E07\u0E44\u0E1B\u0E22\u0E31\u0E07 \n          "+i+"\n        "),this.redirectService.redirectToHomepage();},error:t=>this.notifier.error(t.message)});}};u(n,"\u0275fac",(()=>{let i;return function(a){return(i||(i=U(n)))(a||n);};})()),u(n,"\u0275cmp",N({type:n,selectors:[["my-verify-new-account-ask-send-email"]],features:[L],decls:5,vars:1,consts:()=>{let i;i="\u0E02\u0E2D\u0E2D\u0E35\u0E40\u0E21\u0E25\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E1A\u0E31\u0E0D\u0E0A\u0E35";let t;t="\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25";let a;a="\u0E2A\u0E48\u0E07\u0E2D\u0E35\u0E40\u0E21\u0E25\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19";let C;C="\u0E2D\u0E35\u0E40\u0E21\u0E25";let E;return E=""+"\uFFFD0\uFFFD"+" does not require email verification.",[i,C,E,[1,"margin-content"],[1,"title-page"],[3,"formGroup"],[3,"ngSubmit","formGroup"],[1,"form-group"],["for","verify-email-email"],["type","email","id","verify-email-email","placeholder",t,"required","","formControlName","verify-email-email",1,"form-control",3,"ngClass"],["class","form-error","role","alert",4,"ngIf"],["type","submit","value",a,1,"peertube-button","primary-button",3,"disabled"],["role","alert",1,"form-error"]];},template:function(t,a){t&1&&(_(0,"div",3)(1,"h1",4),l(2,0),r(),d(3,me,7,6,"form",5)(4,ue,2,1,"div"),r()),t&2&&(c(3),p(a.requiresEmailVerification?3:4));},dependencies:[I,Z,H,K,z,W,J,Q,j,B,q],styles:[`input[type=email][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;color:var(--input-fg);background-color:var(--input-bg);border:1px solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=email][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder);font-size:14px}input[type=email][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=email][_ngcontent-%COMP%]:focus, input[type=email][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=email][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width: 380px){input[type=email][_ngcontent-%COMP%]{width:100%}}
/*# sourceMappingURL=verify-new-account-ask-send-email.component-3ONSZ6YB.css.map */`]}));let e=n;return e;})();function de(e,n){e&1&&(_(0,"p"),l(1,1),r(),_(2,"p"),l(3,2),r());}function Se(e,n){e&1&&(_(0,"p"),l(1,3),r(),_(2,"p"),V(3,4),A(4,"a",7),$(),r());}var se=(()=>{let n=class n{requiresApproval=F(void 0);};u(n,"\u0275fac",function(t){return new(t||n)();}),u(n,"\u0275cmp",N({type:n,selectors:[["my-signup-success-after-email"]],inputs:{requiresApproval:[1,"requiresApproval"]},decls:6,vars:1,consts:()=>{let i;i="\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E2D\u0E35\u0E40\u0E21\u0E25\u0E41\u0E25\u0E49\u0E27!";let t;t="\u0E2D\u0E35\u0E40\u0E21\u0E25\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E41\u0E25\u0E49\u0E27 \u0E41\u0E25\u0E30\u0E2A\u0E48\u0E07\u0E04\u0E33\u0E02\u0E2D\u0E1A\u0E31\u0E0D\u0E0A\u0E35\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E41\u0E25\u0E49\u0E27!";let a;a="\u0E1C\u0E39\u0E49\u0E14\u0E39\u0E41\u0E25\u0E08\u0E30\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E04\u0E33\u0E02\u0E2D\u0E25\u0E07\u0E17\u0E30\u0E40\u0E1A\u0E35\u0E22\u0E19\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E40\u0E23\u0E47\u0E27 \u0E46 \u0E19\u0E35\u0E49 \u0E41\u0E25\u0E30\u0E04\u0E38\u0E13\u0E08\u0E30\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E2D\u0E35\u0E40\u0E21\u0E25\u0E41\u0E08\u0E49\u0E07\u0E40\u0E21\u0E37\u0E48\u0E2D\u0E21\u0E35\u0E01\u0E32\u0E23\u0E22\u0E2D\u0E21\u0E23\u0E31\u0E1A\u0E2B\u0E23\u0E37\u0E2D\u0E1B\u0E0F\u0E34\u0E40\u0E2A\u0E18";let C;C="\u0E2D\u0E35\u0E40\u0E21\u0E25\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E41\u0E25\u0E49\u0E27 \u0E41\u0E25\u0E30\u0E2A\u0E23\u0E49\u0E32\u0E07\u0E1A\u0E31\u0E0D\u0E0A\u0E35\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E41\u0E25\u0E49\u0E27!";let E;return E="\u0E2B\u0E32\u0E01\u0E04\u0E38\u0E13\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E04\u0E27\u0E32\u0E21\u0E0A\u0E48\u0E27\u0E22\u0E40\u0E2B\u0E25\u0E37\u0E2D\u0E43\u0E19\u0E01\u0E32\u0E23\u0E43\u0E0A\u0E49\u0E07\u0E32\u0E19 PeerTube \u0E04\u0E38\u0E13\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E28\u0E36\u0E01\u0E29\u0E32"+"\uFFFD#4\uFFFD"+"\u0E40\u0E2D\u0E01\u0E2A\u0E32\u0E23\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A"+"\uFFFD/#4\uFFFD"+" ",[i,t,a,C,E,["mascotImageName","success"],["type","primary"],["href","https://docs.joinpeertube.org/use/setup-account","target","_blank","rel","noopener noreferrer",1,"link-primary"]];},template:function(t,a){t&1&&(_(0,"my-signup-step-title",5)(1,"strong"),l(2,0),r()(),_(3,"my-alert",6),d(4,de,4,0)(5,Se,5,0),r()),t&2&&(c(4),p(a.requiresApproval()?4:5));},dependencies:[oe,v],styles:[`my-alert[_ngcontent-%COMP%]{display:block;font-size:18px;max-width:900px;text-align:center;margin:auto}
/*# sourceMappingURL=signup-success.component-LNJKY4EL.css.map */`]}));let e=n;return e;})();function Ce(e,n){if(e&1&&A(0,"my-signup-success-after-email",8),e&2){let o=S(3);f("requiresApproval",o.requiresApproval);}}function fe(e,n){e&1&&(_(0,"my-alert",9),l(1,1),r());}function pe(e,n){if(e&1&&d(0,Ce,1,1,"my-signup-success-after-email",8)(1,fe,2,0,"my-alert",9),e&2){let o=S(2);p(o.isRegistration()||o.isRegistrationRequest()?0:1);}}function Ae(e,n){e&1&&(_(0,"my-alert",7)(1,"span"),l(2,2),r(),_(3,"a",10),l(4,3),r()());}function Ne(e,n){if(e&1&&(_(0,"div",5)(1,"h1",6),l(2,0),r(),d(3,pe,2,1)(4,Ae,5,0,"my-alert",7),r()),e&2){let o=S();c(3),p(o.success?3:o.failed?4:-1);}}var le=(()=>{let n=class n{signupService=s(g);userService=s(R);server=s(M);authService=s(ie);notifier=s(T);route=s(X);success=!1;failed=!1;isPendingEmail=!1;requiresApproval;loaded=!1;userId;registrationId;verificationString;get instanceName(){return this.server.getHTMLConfig().instance.name;}ngOnInit(){let i=this.route.snapshot.queryParams;if(this.server.getConfig().subscribe(t=>{this.requiresApproval=t.signup.requiresApproval,this.loaded=!0;}),this.userId=i.userId,this.registrationId=i.registrationId,this.verificationString=i.verificationString,this.isPendingEmail=i.isPendingEmail==="true",!this.verificationString){this.notifier.error("Unable to find verification string in URL query.");return;}if(!this.userId&&!this.registrationId){this.notifier.error("Unable to find user id or registration id in URL query.");return;}this.verifyEmail();}isRegistration(){return!this.isPendingEmail;}isRegistrationRequest(){return!!this.registrationId;}verifyEmail(){return this.isRegistrationRequest()?this.verifyRegistrationEmail():this.verifyUserEmail();}verifyUserEmail(){let i={userId:this.userId,verificationString:this.verificationString,isPendingEmail:this.isPendingEmail};this.userService.verifyUserEmail(i).subscribe({next:()=>{this.authService.isLoggedIn()&&this.authService.refreshUserInformation(),this.success=!0;},error:t=>{this.failed=!0,this.notifier.error(t.message);}});}verifyRegistrationEmail(){let i={registrationId:this.registrationId,verificationString:this.verificationString};this.signupService.verifyRegistrationEmail(i).subscribe({next:()=>{this.success=!0;},error:t=>{this.failed=!0,this.notifier.error(t.message);}});}};u(n,"\u0275fac",function(t){return new(t||n)();}),u(n,"\u0275cmp",N({type:n,selectors:[["my-verify-account-email"]],decls:1,vars:1,consts:()=>{let i;i="Verify email";let t;t="\u0E2D\u0E31\u0E1B\u0E40\u0E14\u0E15\u0E2D\u0E35\u0E40\u0E21\u0E25\u0E41\u0E25\u0E49\u0E27";let a;a="\u0E40\u0E01\u0E34\u0E14\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14";let C;return C="\u0E02\u0E2D\u0E2D\u0E35\u0E40\u0E21\u0E25\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E43\u0E2B\u0E21\u0E48",[i,t,a,C,["class","margin-content",4,"ngIf"],[1,"margin-content"],[1,"title-page"],["type","danger"],[3,"requiresApproval"],["type","success"],["routerLink","/verify-account/ask-send-email",1,"ms-1","link-primary"]];},template:function(t,a){t&1&&d(0,Ne,5,1,"div",4),t&2&&f("ngIf",a.loaded);},dependencies:[I,se,w,v],encapsulation:2}));let e=n;return e;})();var Qe=[{path:"",providers:[g],children:[{path:"email",component:le,data:{meta:{title:"\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E1A\u0E31\u0E0D\u0E0A\u0E35\u0E1C\u0E48\u0E32\u0E19\u0E2D\u0E35\u0E40\u0E21\u0E25"}}},{path:"ask-send-email",component:ae,data:{meta:{title:"Ask to send an email to verify your account"}}}]}];export{Qe as default};/**i18n:56bde403ffba090cdb11aaac0f86ffb9ae7c2bab95df4b44d5dba510264fcf4f*///# sourceMappingURL=chunk-CDPFJZDS.js.map