1import{c as R,e as S,m as A,n as P,ag as T,o as k,r as s,ai as C,j as e,B as a,L as m,ad as B,aj as I,ak as L,a6 as V}from"./index-OkXy-d5Y.js";import{C as o,a as d,c as u,d as h,b as x}from"./card-BOYNs0rn.js";import{M as D}from"./mail-Du3d_nkx.js";import{C as _}from"./circle-x-Bh5g1r5S.js";/** 2 * @license lucide-react v0.487.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const M=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],O=R("circle-check-big",M),W=3;function Y(){const t=S(),f=A();P();const[j]=T(),i=j.get("token"),n=j.get("email"),g=k(B),N=k(V),[c,w]=s.useState("pending"),[r,E]=s.useState(!1),[p,b]=s.useState(W);s.useEffect(()=>{i&&t(C(i)).then(l=>{w(C.fulfilled.match(l)?"success":"error")})},[i,t]),s.useEffect(()=>{if(c!=="success")return;const l=setInterval(()=>{b(y=>y<=1?(clearInterval(l),f("/auth/login"),0):y-1)},1e3);return()=>clearInterval(l)},[c,f]);const v=async()=>{n?await t(I(n)):N&&await t(L()),E(!0)};return i?c==="pending"?e.jsx(o,{children:e.jsxs(d,{className:"text-center",children:[e.jsx(u,{children:"Verifying..."}),e.jsx(h,{children:"Please wait while we verify your email."})]})}):c==="success"?e.jsxs(o,{children:[e.jsxs(d,{className:"text-center",children:[e.jsx(O,{className:"h-12 w-12 text-green-600 mx-auto mb-2"}),e.jsx(u,{children:"Email verified!"}),e.jsx(h,{children:"Your email has been successfully verified."})]}),e.jsxs(x,{className:"space-y-3",children:[e.jsxs("p",{className:"text-sm text-center text-muted-foreground",children:["Redirecting to login in ",p," second",p!==1?"s":"","..."]}),e.jsx(a,{className:"w-full",asChild:!0,children:e.jsx(m,{to:"/auth/login",children:"Continue to login"})})]})]}):e.jsxs(o,{children:[e.jsxs(d,{className:"text-center",children:[e.jsx(_,{className:"h-12 w-12 text-destructive mx-auto mb-2"}),e.jsx(u,{children:"Verification failed"}),e.jsx(h,{children:"This link may be invalid or expired."})]}),e.jsxs(x,{className:"space-y-3",children:[e.jsx(a,{variant:"outline",className:"w-full",onClick:v,disabled:g||r,children:r?"Email sent!":"Resend verification email"}),e.jsx(a,{variant:"ghost",className:"w-full",asChild:!0,children:e.jsx(m,{to:"/auth/login",children:"Back to login"})})]})]}):e.jsxs(o,{children:[e.jsxs(d,{className:"text-center",children:[e.jsx(D,{className:"h-12 w-12 text-primary mx-auto mb-2"}),e.jsx(u,{children:"Verify your email"}),e.jsx(h,{children:n?`We've sent a verification link to ${n}. Please check your inbox.`:"We've sent a verification link to your email. Please check your inbox."})]}),e.jsxs(x,{className:"space-y-3",children:[e.jsx(a,{variant:"outline",className:"w-full",onClick:v,disabled:g||r,children:r?"Email sent!":"Resend verification email"}),e.jsx(a,{variant:"ghost",className:"w-full",asChild:!0,children:e.jsx(m,{to:"/auth/login",children:"Back to login"})})]})]})}export{Y as VerifyEmailPage};
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.