1import{a as t,j as e}from"./query-vendor-BB0JUlq_.js";import{d as g,e as h}from"./react-vendor-BIjsaQ6L.js";import{g as p}from"./unsplash-gQ5iVEsL.js";function v(){const[i,a]=t.useState("loading"),[c,s]=t.useState(""),[l,u]=t.useState(null),d=g(),[x]=h(),n=x.get("token");t.useEffect(()=>{(async()=>{const m=["music success","celebration","achievement","music graduation","musical accomplishment"];let r=null;for(let o of m)if(r=await p(o),r)break;u(r)})()},[]),t.useEffect(()=>{if(!n){a("error"),s("No verification token provided");return}(async()=>{try{const r=await fetch("/api/auth/verify-email",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:n})});if(r.ok)a("success"),s("Email verified successfully! You can now log in to your account.");else{const o=await r.json();a("error"),s(o.error||"Verification failed")}}catch{a("error"),s("Network error. Please try again.")}})()},[n]);const f=async()=>{alert("Please contact support to resend verification email")};return e.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{backgroundImage:l?`linear-gradient(rgba(2,6,23,0.5), rgba(2,6,23,0.5)), url(${l})`:void 0,backgroundSize:"cover"},children:e.jsxs("div",{className:"bg-card/95 rounded-lg p-8 shadow-lg w-full max-w-md text-center",children:[i==="loading"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),e.jsx("h1",{className:"text-2xl font-bold",children:"Verifying Email"}),e.jsx("p",{className:"text-sm text-foreground/70 mt-2",children:"Please wait while we verify your email address..."})]}),i==="success"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-green-500 text-4xl mb-4",children:"â
"}),e.jsx("h1",{className:"text-2xl font-bold text-green-600",children:"Email Verified!"}),e.jsx("p",{className:"text-sm text-foreground/70 mt-2",children:c}),e.jsx("div",{className:"mt-6",children:e.jsx("button",{onClick:()=>d("/login"),className:"h-10 px-4 rounded-md bg-primary text-primary-foreground",children:"Continue to Login"})})]}),i==="error"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-red-500 text-4xl mb-4",children:"â"}),e.jsx("h1",{className:"text-2xl font-bold text-red-600",children:"Verification Failed"}),e.jsx("p",{className:"text-sm text-foreground/70 mt-2",children:c}),e.jsxs("div",{className:"mt-6 space-y-3",children:[e.jsx("button",{onClick:f,className:"w-full h-10 px-4 rounded-md border border-primary text-primary hover:bg-primary hover:text-primary-foreground",children:"Resend Verification Email"}),e.jsx("button",{onClick:()=>d("/login"),className:"w-full h-10 px-4 rounded-md bg-primary text-primary-foreground",children:"Back 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.