1import{j as e}from"./vendor-radix-dialog-Bajn-rmU.js";import{i as v,r as i,e as j,L as n}from"./vendor-react-3efCd3Xu.js";import{u as g,C as y,M as N,B as l,L as b,s as w}from"./index-BO2DrnSZ.js";import{I as k}from"./input-BUS4uccm.js";import{L as E}from"./label-6WfnpmaK.js";import"./vendor-monaco-CMWCqPY1.js";import"./vendor-radix-dropdown-ByCK_Pdu.js";import"./vendor-radix-tooltip-C2Li1WOL.js";import"./vendor-recharts-CTYRDcfh.js";import"./vendor-radix-select-dh3VcV8n.js";const V=()=>{const[x]=v(),[s,u]=i.useState(x.get("email")||""),[o,c]=i.useState(!1),[h,d]=i.useState(!1),f=j(),{toast:t}=g(),p=async r=>{if(r.preventDefault(),!s||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s)){t({title:"Invalid Email",description:"Please enter a valid email address.",variant:"destructive"});return}c(!0);try{const a=crypto.randomUUID(),{error:m}=await w.functions.invoke("send-verification-email",{body:{email:s,token:a}});if(m)throw m;d(!0),t({title:"Email Sent!",description:`We've sent a new verification email to ${s}. Please check your inbox (and spam folder).`})}catch(a){console.error("Resend error:",a),t({title:"Error",description:a.message||"Failed to send verification email. Please try again.",variant:"destructive"})}finally{c(!1)}};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:e.jsxs("div",{className:"w-full max-w-md
1space-y-8",children:[e.jsxs("div",{className:"text-center",children:[e.jsxs(n,{to:"/",className:"inline-flex items-center gap-2 mb-8",children:[e.jsx("div",{className:"w-12 h-12 rounded-lg bg-gradient-to-br from-primary to-secondary flex items-center justify-center",children:e.jsx(y,{className:"w-6 h-6 text-primary-foreground"})}),e.jsx("span",{className:"font-bold text-2xl",children:"CoderFile.io"})]}),e.jsx("div",{className:"w-16 h-16 mx-auto mb-4 flex items-center justify-center rounded-full bg-primary/10",children:e.jsx(N,{className:"w-8 h-8 text-primary"})}),e.jsx("h2",{className:"text-3xl font-bold",children:"Resend Verification Email"}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:"Enter your email address and we'll send you a new verification link"})]}),h?e.jsxs("div",{className:"space-y-6 text-center",children:[e.jsx("div",{className:"p-4 bg-green-500/10 border border-green-500/20 rounded-lg",children:e.jsx("p",{className:"text-sm text-foreground",children:"Check your email for the verification link. This link will remain valid until used."})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(l,{onClick:()=>d(!1),variant:"outline",className:"w-full",children:"Didn't receive it? Try again"}),e.jsx(l,{onClick:()=>f("/auth"),className:"w-full",children:"Go to Sign In"})]})]}):e.jsxs("form",{onSubmit:p,className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx(E,{htmlFor:"email",children:"Email address"}),e.jsx(k,{id:"email",type:"email",value:s,onChange:r=>u(r.target.value),required:!0,placeholder:"[email protected]",className:"mt-1"})]}),e.jsx(l,{type:"submit",className:"w-full bg-gradient-to-r from-primary to-secondary hover:opacity-90",disabled:o,children:o?e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"w-4 h-4 mr-2 animate-spin"}),"Sending..."]}):"Send Verification Email"}),e.jsx("div",{className:"text-center",children:e.jsx(n,{to:"/auth",className:"text-sm text-primary hover:underline",children:"Back to sign in"})})]}),e.jsx("div",{className:"text-center",children:e.jsx(n,{to:"/",className:"text-sm text-muted-foreground hover:text-foreground",children:"â Back to home"})})]})})};export{V 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.