1import{a as Q}from"./chunk-GCMRLLRE.js";import{j as z}from"./chunk-LLG7LFAR.js";import"./chunk-MAAJDSYV.js";import"./chunk-I6PWGF2K.js";import"./chunk-K6T4326Q.js";import"./chunk-SQYF6HYD.js";import{a as b}from"./chunk-BE3VEPGG.js";import{E as k}from"./chunk-6Z45FA5O.js";import"./chunk-P3KYTCLI.js";import"./chunk-XHDFESOD.js";import{d as h,h as B}from"./chunk-UFKPJSCY.js";import{M as w}from"./chunk-EG56UTB5.js";import{b as j}from"./chunk-NGTGFN4T.js";import{a as J,b as W}from"./chunk-E4P53QH5.js";import"./chunk-V2HCY7SI.js";import{Ab as x,Cb as H,F as G,Hb as R,I as F,Ib as n,Jb as t,Kb as f,L as D,Pb as c,R as V,Ta as l,Tb as r,Wb as N,Yb as S,ba as m,eb as $,ha as d,ia as C,k as U,lc as I,na as v,nc as Y,ta as M,vd as X}from"./chunk-6CMTVMC3.js";import"./chunk-TSX4WT5A.js";function K(e,i){if(e&1){let _=c();n(0,"div",13),f(1,"fa-duotone-icon",14),t(),n(2,"h1",15),r(3,0),t(),n(4,"p",16),r(5,1),t(),n(6,"div",17)(7,"button",18),N("click",function(){d(_);let E=S();return C(E.verifyEmail());}),r(8,2),t(),n(9,"a",19),r(10,3),t()();}if(e&2){let _=S();l(),R("icon",_.faCircleCheck);}}function Z(e,i){if(e&1&&(n(0,"div",13),f(1,"fa-icon",20),t(),n(2,"h1",15),r(3,4),t(),n(4,"p",16),r(5,5),t()),e&2){let _=S();l(),R("icon",_.faSpinner);}}function __(e,i){if(e&1){let _=c();n(0,"div",21)(1,"span",22),I(2,"!"),t()(),n(3,"h1",23),r(4,6),t(),n(5,"p",16),I(6),t(),n(7,"div",17)(8,"button",24),N("click",function(){d(_);let E=S();return C(E.verifyEmail());}),r(9,7),t(),n(10,"a",25),r(11,8),t()();}if(e&2){let _=S();l(6),Y(" ",_.errorMessage()," ");}}function e_(e,i){if(e&1&&(n(0,"div",26),f(1,"fa-duotone-icon",14),t(),n(2,"h1",27),r(3,9),t(),n(4,"p",16),r(5,10),t(),n(6,"div",28)(7,"a",29),r(8,11),t()()),e&2){let _=S();l(),R("icon",_.faCircleCheck);}}function i_(e){let i=O(e.token);if(i!==void 0)return{token:i};let _={},o=A(e.id),E=O(e.hash),a=A(e.expires),s=O(e.signature);return o!==void 0&&(_.id=o),E!==void 0&&(_.hash=E),a!==void 0&&(_.expires=a),s!==void 0&&(_.signature=s),_;}function n_(e){if(!(e instanceof X))return null;let i=e.error;if(i===null||typeof i!="object"||!("message"in i))return null;let _=i.message;if(typeof _!="string")return null;let o=_.trim();return o===""?null:o;}function A(e){if(Array.isArray(e))return A(e[0]);if(typeof e=="number")return e;if(typeof e=="string"){let i=e.trim();return i===""?void 0:i;}}function O(e){let i=A(e);return typeof i=="string"?i:void 0;}var q=class e{constructor(){this.confirmsApi=m(Q);this.route=m(h);this.toastService=m(z);this.destroyRef=m(v);this.isLoading=M(!1);this.isVerified=M(!1);this.hasError=M(!1);this.errorMessage=M("The link may have expired or become invalid. Try requesting a new confirmation email.");this.faCircleCheck=k;this.faSpinner=w;}verifyEmail(){this.isLoading()||(this.isLoading.set(!0),this.hasError.set(!1),this.errorMessage.set("The link may have expired or become invalid. Try requesting a new confirmation email."),this.route.queryParams.pipe(F(1),V(i=>{let _=i_(i);return this.confirmsApi.verifyEmail(_);}),G(i=>{let _=n_(i);return this.hasError.set(!0),this.errorMessage.set(_??this.errorMessage()),this.toastService.error(_??"Failed to verify email."),U;}),D(()=>{this.isLoading.set(!1);}),b(this.destroyRef)).subscribe(()=>{this.isVerified.set(!0);}));}static{this.ɵfac=function(_){return new(_||e)();};}static{this.ɵcmp=$({type:e,selectors:[["app-email-verify"]],decls:5,vars:1,consts:()=>{let i;i="Confirm email?";let _;_="After confirmation, the address will be linked to your account.";let o;o="Confirm";let E;E="Cancel";let a;a="Confirming email";let s;s="Please wait a few seconds.";let g;g="Failed to verify email";let T;T="Try again";let L;L="Home";let P;P="Your email has been verified";let y;y="You can now use all account features.";let p;return p="Home",[i,_,o,E,a,s,g,T,L,P,y,p,[1,"mx-auto","w-full","max-w-lg","rounded-3xl","border","border-border","bg-card","p-8","text-center","shadow-xs"],[1,"mx-auto","flex","size-16","items-center","justify-center","rounded-full","bg-primary/10","text-primary"],["size","3x",3,"icon"],[1,"mt-8","text-xl","font-semibold","text-foreground"],[1,"mt-3","text-sm","leading-6","text-muted-foreground"],[1,"mt-6","flex","flex-col","gap-3","sm:flex-row","sm:justify-center"],["uiButton","","type","button","variant","default",1,"rounded-full",3,"click"],["uiButton","","routerLink","/","variant","outline",1,"rounded-full"],["animation","spin",1,"text-3xl",3,"icon"],[1,"mx-auto","flex","size-16","items-center","justify-center","rounded-full","bg-destructive/10","text-destructive"],[1,"text-3xl","font-semibold"],[1,"mt-8","text-xl","font-semibold","text-destructive"],["uiButton","","type","button","variant","outline",1,"rounded-full",3,"click"],["uiButton","","routerLink","/","variant","default",1,"rounded-full"],[1,"mx-auto","flex","size-16","items-center","justify-center","rounded-full","bg-emerald-500/10","text-emerald-600"],[1,"mt-8","text-xl","font-semibold","text-emerald-600"],[1,"mt-6"],["uiButton","","routerLink","/","variant","default",1,"rounded-full","px-6"]];},template:function(_,o){_&1&&(n(0,"section",12),x(1,K,11,1)(2,Z,6,1)(3,__,12,1)(4,e_,9,1),t()),_&2&&(l(),H(!o.isVerified()&&!o.hasError()&&!o.isLoading()?1:o.isLoading()?2:o.hasError()?3:4));},dependencies:[B,W,J,j],encapsulation:2});}};export{q as EmailVerifyComponent,i_ as createEmailVerifyPayload,n_ as extractEmailVerifyErrorMessage};/**i18n:4a99b2d0acf14f514ec1a9ad7ce6fd8bc6ad78c9220b1d45912a08891dbf615e*/
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.