(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[758],{20063:(e,s,t)=>{"use strict";var a=t(47260);t.o(a,"usePathname")&&t.d(s,{usePathname:function(){return a.usePathname}}),t.o(a,"useRouter")&&t.d(s,{useRouter:function(){return a.useRouter}}),t.o(a,"useSearchParams")&&t.d(s,{useSearchParams:function(){return a.useSearchParams}})},21294:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>i});var a=t(95155),r=t(20063),n=t(12115);let i=()=>{let e=(0,r.useRouter)(),[s,t]=(0,n.useState)("");return(0,n.useEffect)(()=>{let s=new URLSearchParams(window.location.search).get("token");s?fetch("/api/emailverify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:s})}).then(e=>e.json()).then(s=>{"Account has been activated."===s.message?t("Email verified successfully!"):t("Verification failed. Please try again."),setTimeout(()=>{e.push("/login")},3e3)}).catch(s=>{throw t("An error occurred. Please try again."),setTimeout(()=>{e.push("/login")},5e3),s}):e.push("/login")},[e]),(0,a.jsx)("div",{className:"flex items-center justify-center min-h-screen bg-gray-100",children:(0,a.jsxs)("div",{className:"p-6 bg-white rounded shadow-md",children:[(0,a.jsx)("h2",{className:"mb-4 text-xl font-semibold",children:"Email Verification"}),(0,a.jsx)("p",{children:s||"Verifying your email..."})]})})}},78022:(e,s,t)=>{Promise.resolve().then(t.bind(t,21294))}},e=>{e.O(0,[8441,1255,7358],()=>e(e.s=78022)),_N_E=e.O()}]);