1import{j as e,L as p,Q as v,cu as g,bd as j}from"./vendor-ui-fc56ca80.js";import{u as C,e as N,r as o}from"./vendor-react-f9ccc48d.js";import{ai as b}from"./vendor-firebase-a557f106.js";import{h as w,t as E,v as y,w as k,x as P,y as A,B as m,A as c}from"./index-90016d22.js";import{u as S}from"./vendor-utils-323b9898.js";import"./vendor-charts-9af8b7c0.js";const L=()=>{const[l]=C(),i=N(),{forceReloadUserData:d}=w(),{t:s}=S(),[a,n]=o.useState("loading"),[x,r]=o.useState(""),u=o.useRef(!1);o.useEffect(()=>{(async()=>{if(u.current)return;u.current=!0;const f=l.get("oobCode");if(!f){n("error"),r(s("verification.noCode","Código de verificación no encontrado en el link."));return}try{await b(c,f),n("success"),c.currentUser&&(await d(),setTimeout(()=>{i("/app/dashboard")},3e3))}catch(t){console.error("Error verifying email:",t),n("error"),t.code==="auth/expired-action-code"?r(s("verification.expired","El link de verificación ha expirado.")):t.code==="auth/invalid-action-code"?r(s("verification.invalid","El link de verificación es inválido o ya fue usado.")):t.code==="auth/user-disabled"?r(s("verification.disabled","El usuario ha sido deshabilitado.")):t.code==="auth/user-not-found"?r(s("verification.userNotFound","Usuario no encontrado.")):r(s("verification.genericError","Ocurrió un error al verificar el email."))}})()},[l,i,d,s]);const h=()=>{c.currentUser?i("/app/dashboard"):i("/login?verified=true")};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-slate-50 p-4",children:e.jsxs(E,{className:"w-full max-w-md
1shadow-lg border-0",children:[e.jsxs(y,{className:"text-center pb-2",children:[e.jsxs("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-slate-100",children:[a==="loading"&&e.jsx(p,{className:"h-8 w-8 animate-spin text-blue-600"}),a==="success"&&e.jsx(v,{className:"h-10 w-10 text-green-600"}),a==="error"&&e.jsx(g,{className:"h-10 w-10 text-red-600"})]}),e.jsxs(k,{className:"text-2xl font-bold text-slate-900",children:[a==="loading"&&"Verificando...",a==="success"&&"¡Email Verificado!",a==="error"&&"Error de Verificación"]}),e.jsxs(P,{className:"text-base mt-2",children:[a==="loading"&&"Por favor espera mientras validamos tu correo electrónico.",a==="success"&&"Tu cuenta ha sido activada correctamente. Ya puedes disfrutar de todas las funciones.",a==="error"&&x]})]}),e.jsxs(A,{className:"pt-6 flex flex-col gap-3",children:[a==="success"&&e.jsxs(m,{size:"lg",className:"w-full gap-2 text-base font-medium",onClick:h,children:[c.currentUser?"Ir al Panel":"Iniciar Sesión"," ",e.jsx(j,{className:"h-4 w-4"})]}),a==="error"&&e.jsx(m,{variant:"outline",className:"w-full",onClick:()=>i("/login"),children:"Volver al Inicio"}),a==="loading"&&e.jsx("p",{className:"text-center text-sm text-slate-400 italic",children:"No cierres esta ventana..."})]})]})})};export{L 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.