1import{e4 as v,dY as k,e3 as E,eb as A,dl as t,aG as j,aL as C,cN as e,aj as R,d4 as d,dE as T,am as P,bd as m,ai as S}from"./index-DMpQIbDT.js";import{i as x,a as w}from"./mobileAppLink-B8CLmYDU.js";import{P as F}from"./ProfileHeader-D8xAAbAS.js";import{h as M}from"./onboardingState-Dg18i8fc.js";import D from"./mail-DyyzTJig.js";import u from"./arrow-right-B9lIk_6X.js";import L from"./arrow-left-CAHm8Y1J.js";import"./ThemeToggle-4nmDC6M4.js";import"./chevron-down-DCyJ4hqa.js";import"./sun-pJAIa7_O.js";import"./moon-J9HVY1FJ.js";import"./laptop-B1IJxlU6.js";import"./useMenuTriggerState-CAlqoILp.js";import"./chunk-IHO36JMK-BgkoB_A4.js";import"./NotificationsPopover-DqlCM640.js";import"./bell-BXRIsM1I.js";import"./trash-2-B678m4ro.js";import"./chevron-right-VIuCKNCN.js";import"./menu-DVZEydFy.js";import"./log-out-BoeCWHR6.js";const ae=()=>{const{token:o}=v(),{verifyEmail:f,user:n,userProfile:p}=k(),a=E(),{t:r}=A(),[l,i]=t.useState("loading"),[b,h]=t.useState(null),y=t.useRef(!1),s=t.useRef(null);t.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]);const c=j.useCallback(()=>n?n.role!==C.FREELANCE?"/chat":M(p)?"/profile":"/onboarding":"/",[n,p]),g=j.useCallback(()=>{s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{if(x(navigator.userAgent)){window.location.assign(w);return}a(c(),{replace:!0})},2e3)},[a,c]);return t.useEffect(()=>{(async()=>{if(!o){i("error"),h(r("account.invalidVerificationToken"));return}if(!y.current){y.current=!0;try{i("loading"),await f(o),i("success"),g()}catch(N){console.error("Error verifying email:",N),i("error"),h(r("account.verificationFailedDesc"))}}})()},[o,f,r,g]),e.jsxs("div",{className:"min-h-screen bg-background dark:bg-background flex flex-col text-gray-900 dark:text-white",children:[e.jsx(F,{showBrand:!0}),e.jsx("main",{className:"flex-1 flex flex-col items-center justify-center px-4 py-12 sm:py-16 max-w-sm mx-auto text-center w-full",children:e.jsxs(R,{mode:"wait",children:[l==="loading"&&e.jsxs(d.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},className:"w-full flex flex-col items-center justify-center space-y-6",children:[e.jsx("div",{className:"h-12 w-12 rounded-2xl bg-primary-50 dark:bg-primary-950/60 text-primary-600 dark:text-primary-400 flex items-center justify-center mx-auto shadow-2xs border border-primary-100/80 dark:border-primary-800/60",children:e.jsx(D,{className:"w-5 h-5"})}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("h1",{className:"text-xl font-bold tracking-tight text-gray-900 dark:text-white",children:r("account.verifyingEmailTitle")}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:r("account.verifyingEmailSubtitle")})]}),e.jsx("div",{className:"pt-2",children:e.jsx(T,{size:"md",color:"primary"})})]},"loading"),l==="success"&&e.jsxs(d.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"w-full flex flex-col items-center justify-center space-y-6",children:[e.jsx("div",{className:"h-12 w-12 rounded-2xl bg-emerald-50 text-emerald-600 dark:bg-emerald-950/60 dark:text-emerald-400 flex items-center justify-center mx-auto shadow-2xs border border-emerald-200/60 dark:border-emerald-800/60",children:e.jsx(P,{className:"w-6 h-6"})}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("h1",{className:"text-xl font-bold tracking-tight text-gray-900 dark:text-white",children:r("account.verificationSuccessTitle")}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:r("account.verificationSuccessDesc")})]}),e.jsxs("div",{className:"w-full pt-2",children:[x(navigator.userAgent)&&e.jsx(m,{color:"primary",onPress:()=>window.location.assign(w),className:"w-full font-medium rounded-xl h-11",endContent:e.jsx(u,{className:"w-4 h-4"}),children:r("account.openMobileApp")}),e.jsx(m,{color:x(navigator.userAgent)?"default":"primary",onPress:()=>a(c(),{replace:!0}),className:"w-full font-medium rounded-xl h-11",endContent:e.jsx(u,{className:"w-4 h-4"}),children:r("common.continue")})]})]},"success"),l==="error"&&e.jsxs(d.div,{initial:{opacity:0,scale:.95}
1,animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"w-full flex flex-col items-center justify-center space-y-6",children:[e.jsx("div",{className:"h-12 w-12 rounded-2xl bg-rose-50 text-rose-600 dark:bg-rose-950/60 dark:text-rose-400 flex items-center justify-center mx-auto shadow-2xs border border-rose-200/60 dark:border-rose-800/60",children:e.jsx(S,{className:"w-6 h-6"})}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("h1",{className:"text-xl font-bold tracking-tight text-gray-900 dark:text-white",children:r("account.verificationFailedTitle")}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:b||r("account.verificationFailedDesc")})]}),e.jsxs("div",{className:"w-full space-y-3 pt-2",children:[e.jsx(m,{color:"primary",onPress:()=>a(c(),{replace:!0}),className:"w-full font-medium rounded-xl h-11",endContent:e.jsx(u,{className:"w-4 h-4"}),children:r("common.continue")}),e.jsxs("button",{type:"button",onClick:()=>a("/",{replace:!0}),className:"inline-flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors pt-1",children:[e.jsx(L,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:r("common.backToHome")})]})]})]},"error")]})})]})};export{ae 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.