import{u as p,eV as m,f0 as j,r as t,n as y,N as E,e,M as S,S as n,cV as V,T as c,B as u,G as v,ei as C}from"./index-_6SmYgWK.js";const w=()=>{const s=p(m.verifyAccountEmail),[x]=j(),[f,r]=t.useState(!1),[h,a]=t.useState(""),[d,i]=t.useState(!1),g=y(),o=E();return t.useEffect(()=>{s.data&&(r(!1),a(""),i(!0),setTimeout(()=>{g("/signin")},3e3))},[s.data]),t.useEffect(()=>{s.error&&(r(!1),a(s.error),i(!1))},[s.error]),t.useEffect(()=>{const l=x.get("token");l&&(r(!0),a(""),i(!1),s.request({user:{tempToken:l}}))},[]),e.jsx(S,{children:e.jsx(n,{flexDirection:"column",sx:{width:"480px",gap:3},children:e.jsx(n,{sx:{width:"100%",alignItems:"center",justifyContent:"center",gap:4},children:e.jsxs(n,{sx:{alignItems:"center",gap:2},children:[f&&e.jsxs(e.Fragment,{children:[e.jsx(V,{sx:{width:"48px",height:"48px"}}),e.jsx(c,{variant:"h1",children:"Verifying Email..."})]}),h&&e.jsxs(e.Fragment,{children:[e.jsx(u,{sx:{width:"48px",height:"48px",borderRadius:"100%",backgroundColor:o.palette.error.main,color:"white",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(v,{})}),e.jsx(c,{variant:"h1",children:"Verification Failed."})]}),d&&e.jsxs(e.Fragment,{children:[e.jsx(u,{sx:{width:"48px",height:"48px",borderRadius:"100%",backgroundColor:o.palette.success.main,color:"white",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(C,{})}),e.jsx(c,{variant:"h1",children:"Email Verified Successfully."})]})]})})})})};export{w as default};
