1import{a as Y}from"./chunk-PZH33YYU.js";import{f as q}from"./chunk-XVEXVSHY.js";import"./chunk-LQAJVVFO.js";import"./chunk-FHRX5ITS.js";import"./chunk-UWKFGWZA.js";import"./chunk-CB2ES4ID.js";import{A as X,a as z,e as K,j as W}from"./chunk-AIGYQ4ZK.js";import{$a as P,Ba as y,Ea as F,Ga as H,Ha as k,S as B,Sa as D,_ as w,ab as G,bb as j,ea as U,fa as b,s as L}from"./chunk-GKK7I2HG.js";import{Da as T,Ja as S,N as p,Oa as r,Pa as a,Qa as R,T as _,Tb as V,U as u,Ua as v,Va as h,Wa as f,Za as g,db as c,dc as N,eb as O,fb as d,ka as i,qb as s,ra as x,rb as E,xa as A}from"./chunk-Y5LJR3O3.js";import"./chunk-Y6RRHSU5.js";import"./chunk-7KGURMOZ.js";import"./chunk-72VIP7DC.js";import"./chunk-6FHAKEBC.js";import"./chunk-XCWWZPNY.js";import"./chunk-YKDYFRO7.js";import"./chunk-G3CV3VGG.js";import"./chunk-7JEWJNYV.js";import"./chunk-LZRXDEP2.js";import"./chunk-6RNTMJIT.js";import"./chunk-4U6PRYVA.js";import"./chunk-IL4VJRLA.js";import"./chunk-JWIEPCRG.js";import"./chunk-QPVVTFFW.js";import"./chunk-J6ICYO4L.js";import"./chunk-LF5XB4YN.js";import{o as M}from"./chunk-2ULHPW3F.js";function J(t,l){t&1&&(r(0,"div",4),R(1,"ion-spinner",6),r(2,"ion-text",7),c(3),s(4,"translate"),a()()),t&2&&(i(3),d(" ",E(4,1,"MEMBERS.AUTH.EMAIL_VERIFICATION.VERIFYING")," "))}function Q(t,l){if(t&1){let m=v();r(0,"div",5),R(1,"ion-icon",8),r(2,"ion-text",9),c(3),s(4,"translate"),a(),r(5,"ion-text",10),c(6),s(7,"translate"),a(),r(8,"div",11)(9,"ion-button",12),h("click",function(){_(m);let e=f();return u(e.goToHome())}),c(10),s(11,"translate"),a()()()}t&2&&(i(3),d(" ",E(4,3,"MEMBERS.AUTH.EMAIL_VERIFICATION.SUCCESS_TITLE")," "),i(3),d(" ",E(7,5,"MEMBERS.AUTH.EMAIL_VERIFICATION.SUCCESS_MESSAGE")," "),i(4),d(" ",E(11,7,"MEMBERS.AUTH.EMAIL_VERIFICATION.DONE")," "))}function Z(t,l){if(t&1){let m=v();r(0,"ion-button",16),h("click",function(){_(m);let e=f(2);return u(e.resendVerificationEmail())}),c(1),s(2,"translate"),a()}t&2&&(i(),d(" ",E(2,1,"MEMBERS.AUTH.EMAIL_VERIFICATION.RESEND_EMAIL")," "))}function $(t,l){if(t&1){let m=v();r(0,"div",5),R(1,"ion-icon",13),r(2,"ion-text",9),c(3),s(4,"translate"),a(),r(5,"ion-text",10),c(6),a(),r(7,"div",14),A(8,Z,3,3,"ion-button",15),r(9,"ion-button",12),h("click",function(){_(m);let e=f();return u(e.goToHome())}),c(10),s(11,"translate"),a()()()}if(t&2){let m=f();i(3),d(" ",E(4,4,"MEMBERS.AUTH.EMAIL_VERIFICATION.ERROR_TITLE")," "),i(3),d(" ",m.errorMessage," "),i(2),S(m.verificationState===m.VerificationState.ERROR?8:-1),i(2),d(" ",E(11,6,"MEMBERS.AUTH.EMAIL_VERIFICATION.DONE")," ")}}var I=function(t){return t.LOADING="loading",t.SUCCESS="success",t.ERROR="error",t}(I||{}),de=(()=>{let l=class l{constructor(){this.route=p(N),this.authService=p(q),this.toastService=p(Y),this.translateService=p(P),this.navController=p(L),this.verificationState=I.LOADING,this.VerificationState=I,this.errorMessage="",z({checkmarkCircle:X,alertCircle:K,arrowForward:W})}ngOnInit(){return M(this,null,function*(){try{let o=this.route.snapshot.queryParams,e=o.mode,n=o.oobCode;if(!n){let C=new URLSearchParams(window.location.search);
1e=C.get("mode")||e,n=C.get("oobCode")||n}e==="verifyEmail"&&n?yield this.verifyEmail(n):(this.verificationState=I.ERROR,this.errorMessage=this.translateService.instant("MEMBERS.AUTH.EMAIL_VERIFICATION.ERRORS.INVALID_LINK"))}catch(o){console.error("Error in email verification initialization:",o),this.verificationState=I.ERROR,this.errorMessage=this.translateService.instant("MEMBERS.AUTH.EMAIL_VERIFICATION.ERRORS.GENERIC_ERROR")}})}verifyEmail(o){return M(this,null,function*(){try{console.log("Starting email verification with oobCode:",o);let e=yield this.authService.verifyEmailWithCode(o);console.log("Email verification result:",e);let n=this.authService.getCurrentUser();n?console.log("Current user exists, email verified status:",n.emailVerified):console.log("No authenticated user found after verification"),this.verificationState=I.SUCCESS,setTimeout(()=>{this.goToHome()},3e3)}catch(e){console.error("Error verifying email:",e),console.error("Error code:",e.code),console.error("Error message:",e.message),this.verificationState=I.ERROR,e.code==="auth/invalid-action-code"?this.errorMessage=this.translateService.instant("MEMBERS.AUTH.EMAIL_VERIFICATION.ERRORS.INVALID_CODE"):e.code==="auth/expired-action-code"?this.errorMessage=this.translateService.instant("MEMBERS.AUTH.EMAIL_VERIFICATION.ERRORS.EXPIRED_CODE"):e.code==="auth/user-disabled"?this.errorMessage=this.translateService.instant("MEMBERS.AUTH.EMAIL_VERIFICATION.ERRORS.USER_DISABLED"):e.code==="auth/user-not-found"?this.errorMessage=this.translateService.instant("MEMBERS.AUTH.EMAIL_VERIFICATION.ERRORS.USER_NOT_FOUND"):this.errorMessage=this.translateService.instant("MEMBERS.AUTH.EMAIL_VERIFICATION.ERRORS.GENERIC_ERROR")}})}goToHome(){this.navController.navigateRoot("/tabs/home")}resendVerificationEmail(){this.authService.sendEmailVerification().then(()=>{this.toastService.showSuccess(this.translateService.instant("MEMBERS.AUTH.EMAIL_VERIFICATION.VERIFICATION_EMAIL_SENT"))}).catch(o=>{console.error("Error sending verification email:",o),this.toastService.showError(this.translateService.instant("MEMBERS.AUTH.EMAIL_VERIFICATION.ERRORS.VERIFICATION_EMAIL_SENT_FAILED"))})}};l.\u0275fac=function(e){return new(e||l)},l.\u0275cmp=x({type:l,selectors:[["app-email-verification"]],decls:12,vars:10,consts:[["color","dark"],["color","primary",3,"fullscreen"],[1,"relative","ion-padding","flex","flex-col","items-center","justify-center","min-h-full"],["src","assets/cccc-logo.png",1,"w-40","h-40","absolute","top-4","left-1/2","-translate-x-1/2",3,"alt"],[1,"flex","flex-col","items-center","justify-center","space-y-4"],[1,"flex","flex-col","items-center","justify-center","space-y-6","w-full","max-w-2xl"],["name","circular",1,"w-16","h-16","text-white"],["color","light",1,"text-lg","text-center"],["name","checkmark-circle",1,"text-success","text-8xl"],["color","light",1,"text-2xl","font-bold","text-center"],["color","light",1,"text-center","text-medium"],[1,"w-full","fixed","bottom-0","left-0","right-0","p-4","bg-primary/50","backdrop-blur-sm"],["expand","block","color","secondary",3,"click"],["name","alert-circle",1,"text-warning","text-8xl"],[1,"w-full","fixed","bottom-0","left-0","right-0","p-4","space-y-2","bg-primary/50","backdrop-blur-sm"],["expand","block","color","dark"],["expand","block","color","dark",3,"click"]],template:function(e,n){e&1&&(r(0,"ion-header")(1,"ion-toolbar",0)(2,"ion-title"),c(3),s(4,"translate"),a()()(),r(5,"ion-content",1)(6,"div",2),R(7,"ion-img",3),s(8,"translate"),A(9,J,5,3,"div",4)(10,Q,12,9,"div",5)(11,$,12,8,"div",5),a()()),e&2&&(i(3),O(E(4,6,"MEMBERS.AUTH.EMAIL_VERIFICATION.TITLE")),i(2),T("fullscreen",!0),i(2),g("alt",E(8,8,"MEMBERS.IMAGES.CCCC_LOGO_ALT")),i(2),S(n.verificationState===n.VerificationState.LOADING?9:-1),i(),S(n.verificationState===n.VerificationState.SUCCESS?10:-1),i(),S(n.verificationState===n.VerificationState.ERROR?11:-1))},dependencies:[V,U,k,H,w,B,F,D,y,b,j,G],encapsulation:2});let t=l;return t})();export{de as EmailVerificationPage};
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.