1import{e as f,r as o,a4 as x,a5 as g,j as e,C as u,aE as p,aF as h,g as y,f as j,B as r}from"./index-CLYK93J7.js";import{C as w}from"./circle-check-BzTJoGHc.js";import{C as N}from"./circle-x-2V8qhJb9.js";import{M as k}from"./mail-fvrHhV4f.js";function V(){const[,l]=f(),[t,a]=o.useState("loading"),[c,m]=o.useState("");console.log("[VerifyEmail] Component mounted, status:",t);const d=x({mutationFn:async s=>(console.log("[VerifyEmail] Verifying token:",s.substring(0,10)+"..."),(await g("POST","/api/verify-email",{token:s})).json()),onSuccess:()=>{console.log("[VerifyEmail] Verification successful"),a("success")},onError:s=>{console.log("[VerifyEmail] Verification error:",s.message),a("error"),m(s.message)}});o.useEffect(()=>{console.log("[VerifyEmail] useEffect running, search:",window.location.search);const i=new URLSearchParams(window.location.search).get("token");if(!i){console.log("[VerifyEmail] No token found"),a("no-token");return}console.log("[VerifyEmail] Token found, starting verification"),d.mutate(i)},[]);const n=()=>{l("/login")};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-slate-50 via-purple-50/30 to-pink-50/30 p-4",children:e.jsxs(u,{className:"max-w-md w-full","data-testid":"card-verify-email",children:[e.jsxs(p,{className:"text-center",children:[e.jsxs("div",{className:"flex flex-col items-center mb-4",children:[e.jsxs("div",{className:"flex items-start",style:{fontFamily:"var(--font-heading)"},children:[e.jsx("span",{className:"font-bold text-[#243449]",style:{fontSize:"34px"},children:"Deploy"}),e.jsx("span",{className:"font-bold bg-gradient-to-r from-orange-500 to-pink-500 bg-clip-text text-transparent",style:{fontSize:"34px",marginLeft:"8px"},children:"IQ"}),e.jsx("span",{className:"text-[#243449] font-normal",style:{fontSize:"28px",marginTop:"0"},children:"â¢"})]}),e.jsx("span",{className:"text-gray-500 italic text-left",style:{letterSpacing:"2px",fontSize:"8px",marginTop:"-10px",marginLeft:"-28px",display:"block"},children:"Marketing. Reimagined."})]}),e.jsxs(h,{className:"text-2xl",children:[t==="loading"&&"Verifying Email...",t==="success"&&"Email Verified!",t==="error"&&"Verification Failed",t==="no-token"&&"Invalid Link"]})]}),e.jsxs(y,{className:"flex flex-col items-center space-y-6",children:[t==="loading"&&e.jsxs(e.Fragment,{children:[e.jsx(j,{className:"h-16 w-16 text-primary animate-spin"}),e.jsx("p",{className:"text-center text-muted-foreground",children:"Please wait while we verify your email address..."})]}),t==="success"&&e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"h-16 w-16 text-green-500"}),e.jsx("p",{className:"text-center text-muted-foreground",children:"Your email has been verified successfully. You can now log in to your account."}),e.jsx(r,{onClick:n,className:"w-full bg-gradient-to-r from-orange-500 to-pink-500 text-white hover:from-orange-600 hover:to-pink-600","data-testid":"button-go-to-login",children:"Continue to Login"})]}),t==="error"&&e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"h-16 w-16 text-red-500"}),e.jsx("p",{className:"text-center text-muted-foreground",children:c||"Something went wrong during verification."}),e.jsx(r,{onClick:n,variant:"outline",className:"w-full","data-testid":"button-go-to-login-error",children:"Go to Login"})]}),t==="no-token"&&e.jsxs(e.Fragment,{children:[e.jsx(k,{className:"h-16 w-16 text-yellow-500"}),e.jsx("p",{className:"text-center text-muted-foreground",children:"This verification link appears to be invalid. Please check your email for the correct link."}),e.jsx(r,{onClick:n,variant:"outline",className:"w-full","data-testid":"button-go-to-login-invalid",children:"Go to Login"})]})]})]})})}export{V as default};
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.