1import{u as v,j as e,H as g,t as s}from"./app-DqW27929.js";import{L as b}from"./language-switcher-BDwkMeVg.js";import{a as _,I as y}from"./input-C2u1cOAn.js";import{T as j}from"./text-link-w4l7vT8L.js";import{u as k,B as d}from"./button-BSlNABTU.js";import{L as N}from"./label-BIKuMman.js";import{T as w}from"./theme-toggle-C6xiV8QD.js";import{A as z}from"./arrow-left-NLCkJUDz.js";import{L}from"./loader-circle-C4Bqmo-V.js";/* empty css */import"./index-woSO2jzn.js";function O({status:c}){const{t}=k(),{data:m,setData:p,post:n,processing:l,errors:x,reset:u}=v({otp:""}),h=o=>{o.preventDefault(),s.loading(t("auth.verify_otp.toasts.verify_loading"),{id:"verify-otp",duration:1e4}),n(route("verification.otp.verify"),{onFinish:()=>{u("otp"),setTimeout(()=>{s.dismiss("verify-otp")},3e3)},onSuccess:()=>{s.success(t("auth.verify_otp.toasts.verify_success"),{id:"verify-otp",description:t("auth.verify_otp.toasts.verify_success_description"),duration:3e3})},onError:r=>{console.error("Errores de verificación:",r);let a=t("auth.verify_otp.toasts.verify_error"),i=t("auth.verify_otp.toasts.verify_error_description");r.otp?(a=t("auth.verify_otp.toasts.invalid_otp"),i=r.otp):r.error&&(a=t("auth.verify_otp.toasts.server_error"),i=r.error),s.error(a,{id:"verify-otp",description:i,duration:4e3})}})},f=o=>{o.preventDefault(),s.loading(t("auth.verify_otp.toasts.resend_loading"),{id:"resend-otp",duration:1e4}),n(route("verification.otp.send"),{onFinish:()=>{setTimeout(()=>{s.dismiss("resend-otp")},3e3)},onSuccess:()=>{s.success(t("auth.verify_otp.toasts.resend_success"),{id:"resend-otp",description:t("auth.verify_otp.toasts.resend_success_description"),duration:3e3})},onError:r=>{console.error("Error al reenviar código:",r);let a=t("auth.verify_otp.toasts.resend_error"),i=t("auth.verify_otp.toasts.resend_error_description");r.error?(a=t("auth.verify_otp.toasts.server_error"),i=r.error):r.email&&(a=t("auth.verify_otp.toasts.account_error"),i=r.email),s.error(a,{id:"resend-otp",description:i,duration:4e3})}})};return e.jsxs("div",{className:"flex min-h-screen items-center justify-center overflow-hidden bg-slate-50 dark:bg-black",children:[e.jsx(g,{title:t("auth.verify_otp.meta_title")}),e.jsxs("div",{className:"relative flex w-full max-w-5xl flex-col overflow-hidden rounded-2xl bg-white shadow-lg md:flex-row dark:bg-zinc-900",children:[e.jsxs("div",{className:"relative overflow-hidden bg-slate-200 p-8 md:w-1/2 md:p-12 dark:bg-zinc-800",children:[e.jsx("div",{className:"absolute inset-0 z-10 bg-gradient-to-t from-transparent to-slate-300/10 dark:to-black/20"}),e.jsx("div",{className:"absolute -bottom-20 -left-10 z-0 h-[15rem] w-[15rem] rounded-full bg-slate-300/50 blur-md dark:bg-zinc-700/40"}),e.jsx("div",{className:"absolute -top-10 -right-10 z-0 h-[10rem] w-[10rem] rounded-full bg-slate-300/30 blur-md dark:bg-zinc-700/20"}),e.jsxs("div",{className:"relative z-20",children:[e.jsxs("a",{href:"https://getpolara.ai",className:"group mb-12 flex items-center gap-3 transition-colors",children:[e.jsx(z,{className:"h-5 w-5 text-slate-600 transition-colors group-hover:text-slate-800 dark:text-zinc-400 dark:group-hover:text-white"}),e.jsx("span",{className:"text-sm text-slate-600 transition-colors group-hover:text-slate-800 dark:text-zinc-400 dark:group-hover:text-white",children:t("auth.common.back_home")})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("h1",{className:"mt-auto mb-6 text-2xl leading-tight font-medium tracking-tight text-slate-800 md:text-3xl dark:text-white",children:t("auth.verify_otp.hero_title")}),e.jsx("p",{className:"mb-8 text-sm text-slate-600 md:text-base dark:text-zinc-300",children:t("auth.verify_otp.hero_description")}),e.jsxs("div",{className:"mt-6 flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-slate-600 dark:text-zinc-400",children:t("auth.common.change_theme")}),e.jsx(w,{className:"ml-2"}),e.jsx(b,{})]})]})]})]}),e.jsxs("div",{className:"z-10 flex flex-col bg-white p-8 text-slate-800 md:w-1/2 md:p-12 dark:bg-zinc-900 dark:text-white",children:[e.jsxs("div",{className:"mb-8 flex flex-col",children:[e.jsx("h2",{className:"mb-2 text-2xl font-medium tracking-tight",children:t("auth.verify_otp.title")}),e.jsx("p",{className:"text-slate-500 dark:text-zinc-400",children:t("auth.verify_otp.description")})]}),c==="verification-otp-sent"&&e.jsx("div",{className:"mb-6 rounded-md border border-green-200 bg-green-50 p-4 dark:border-green-900 dark:bg-green-900/20",children:e.jsx("p",{className:"text-center text-sm font-medium text-green-600 dark:text-green-400",children:t("auth.verify_otp.status_sent")}
1)}),e.jsxs("form",{className:"flex flex-col gap-6",onSubmit:h,children:[e.jsxs("div",{className:"grid gap-6",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"otp",className:"text-sm text-slate-700 dark:text-zinc-300",children:t("auth.verify_otp.otp_label")}),e.jsx(_,{id:"otp",type:"text",required:!0,autoFocus:!0,tabIndex:1,value:m.otp,onChange:o=>p("otp",o.target.value),disabled:l,placeholder:t("auth.verify_otp.otp_placeholder"),maxLength:6,pattern:"[0-9]{6}",className:"rounded-md border-slate-200 bg-slate-50 py-5 text-center text-2xl tracking-[0.5em] focus:border-slate-300 focus:ring-slate-200 dark:border-zinc-700 dark:bg-zinc-800/50 dark:focus:border-zinc-600 dark:focus:ring-zinc-800"}),e.jsx(y,{message:x.otp,className:"mt-2"})]}),e.jsxs(d,{type:"submit",className:"mt-4 w-full bg-primary py-6 text-base text-white hover:bg-primary/90 dark:bg-zinc-800 dark:hover:bg-zinc-700",tabIndex:2,disabled:l,children:[l&&e.jsx(L,{className:"mr-2 h-4 w-4 animate-spin"}),t("auth.verify_otp.submit")]}),e.jsxs("div",{className:"mt-4 text-center",children:[e.jsx("p",{className:"mb-3 text-sm text-slate-500 dark:text-zinc-400",children:t("auth.verify_otp.resend_help")}),e.jsx(d,{type:"button",variant:"outline",onClick:f,className:"w-full border-slate-200 bg-white py-5 text-slate-800 hover:bg-slate-50 md:w-3/4 dark:border-zinc-700 dark:bg-zinc-900 dark:text-white dark:hover:bg-zinc-800",tabIndex:3,disabled:l,children:t("auth.verify_otp.resend")})]})]}),e.jsx("div",{className:"text-center text-sm",children:e.jsx(j,{href:route("logout"),method:"post",tabIndex:4,className:"text-primary/90 transition-colors hover:text-primary",children:t("auth.common.logout")})})]})]})]})]})}export{O 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.