import{aj as f,p as h,r as n,j as e,aO as d,d as x,as as b,a2 as g}from"./vendor-DyCecx-5.js";import{a as v}from"./index-DJXN7D4i.js";const N=()=>{const[l]=f(),i=h(),r=l.get("token"),o=l.get("new")==="true",[s,t]=n.useState("verifying"),[u,a]=n.useState("Verifying your email address...");return n.useEffect(()=>{(async()=>{if(o){t("sent"),a("We have sent a verification link to your email address. Please check your inbox and click the link to verify your account.");return}if(!r){t("error"),a("Invalid verification link. Token is missing.");return}await new Promise(m=>setTimeout(m,1500));const c=await v.verifyEmail(r);c.success?(t("success"),a("Your email h successfully verified! You can now access your account.")):(t("error"),a(c.message||"Verification failed. The link may be expired or invalid."))})()},[r,o]),e.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"max-w-md w-full bg-white rounded-lg shadow-sm border border-slate-100 overflow-hidden",children:[e.jsxs("div",{className:"p-8 text-center",children:[e.jsxs("div",{className:"flex justify-center mb-6",children:[s==="verifying"&&e.jsxs("div",{className:"w-20 h-20 bg-slate-50 rounded-full flex items-center justify-center relative",children:[e.jsx("div",{className:"absolute inset-0 border-4 border-slate-100 rounded-full"}),e.jsx("div",{className:"absolute inset-0 border-4 border-slate-900 rounded-full border-t-transparent animate-spin"}),e.jsx(d,{className:"w-8 h-8 text-slate-400"})]}),s==="sent"&&e.jsx("div",{className:"w-20 h-20 bg-blue-50 rounded-full flex items-center justify-center animate-in zoom-in duration-300",children:e.jsx(d,{className:"w-10 h-10 text-blue-500"})}),s==="success"&&e.jsx("div",{className:"w-20 h-20 bg-emerald-50 rounded-full flex items-center justify-center animate-in zoom-in duration-300",children:e.jsx(x,{className:"w-10 h-10 text-emerald-500"})}),s==="error"&&e.jsx("div",{className:"w-20 h-20 bg-rose-50 rounded-full flex items-center justify-center animate-in zoom-in duration-300",children:e.jsx(b,{className:"w-10 h-10 text-rose-500"})})]}),e.jsxs("h1",{className:"text-2xl font-black text-slate-900 mb-2",children:[s==="verifying"&&"Verifying Email",s==="sent"&&"Check Your Email",s==="success"&&"Email Verified!",s==="error"&&"Verification Failed"]}),e.jsx("p",{className:"text-slate-500 font-medium mb-8 leading-relaxed",children:u}),e.jsxs("div",{className:"space-y-3",children:[s==="sent"&&e.jsx("button",{onClick:()=>i("/signin"),className:"w-full py-3.5 bg-white border border-slate-200 text-slate-900 rounded font-bold hover:bg-slate-50 transition-all",children:"Back to Sign In"}),s==="success"&&e.jsxs("button",{onClick:()=>i("/signin"),className:"w-full py-3.5 bg-slate-900 text-white rounded font-bold hover:bg-slate-800 hover:-translate-y-0.5 transition-all shadow-lg shadow-slate-200 flex items-center justify-center gap-2",children:["Continue to Sign In",e.jsx(g,{className:"w-4 h-4"})]}),s==="error"&&e.jsx(e.Fragment,{children:e.jsx("button",{onClick:()=>i("/signin"),className:"w-full py-3.5 bg-white border border-slate-200 text-slate-900 rounded font-bold hover:bg-slate-50 transition-all",children:"Back to Sign In"})})]})]}),e.jsx("div",{className:"h-2 bg-gradient-to-r from-slate-900 via-slate-700 to-slate-900"})]})})};export{N as default};
