1import{r as a,j as e,k as c,J as C,L as x,M as S,B as E,H as A,s as L,I as u}from"./index-DAlBnDcl.js";import{L as I,I as P,z as B}from"./index-CtQIzoX5.js";import{C as h,a as f,b as p,c as j,d as g}from"./card-DmI8eyPP.js";import{C as F}from"./circle-check-big-DB6TiGKW.js";import{A as v}from"./arrow-left-DQJxtRpt.js";const R=C("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),N=a.forwardRef(({className:s,variant:r,...t},i)=>e.jsx("div",{ref:i,role:"alert",className:c(R({variant:r}),s),...t}));N.displayName="Alert";const D=a.forwardRef(({className:s,...r},t)=>e.jsx("h5",{ref:t,className:c("mb-1 font-medium leading-none tracking-tight",s),...r}));D.displayName="AlertTitle";const y=a.forwardRef(({className:s,...r},t)=>e.jsx("div",{ref:t,className:c("text-sm [&_p]:leading-relaxed",s),...r}));y.displayName="AlertDescription";const T=B.string().email("Please enter a valid email address");function W(){const[s,r]=a.useState(""),[t,i]=a.useState(!1),[w,b]=a.useState(!1),[l,d]=a.useState(null),k=async n=>{n.preventDefault(),d(null);const o=T.safeParse(s);if(!o.success){d(o.error.errors[0].message);return}i(!0);try{const{error:m}=await L.auth.resetPasswordForEmail(s,{redirectTo:`${window.location.origin}/admin/reset-password`});if(m){u({title:"Error",description:m.message,variant:"destructive"});return}b(!0)}catch{u({title:"Error",description:"An unexpected error occurred. Please try again.",variant:"destructive"})}finally{i(!1)}};return w?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted/30 px-4",children:e.jsxs(h,{className:"w-full max-w-md",children:[e.jsxs(f,{className:"text-center",children:[e.jsx("div",{className:"mx-auto w-12 h-12 bg-primary/10 rounded-full flex items-center justify-center mb-4",children:e.jsx(F,{className:"h-6 w-6 text-primary"})}),e.jsx(p,{className:"text-2xl",children:"Check Your Email"}),e.jsxs(j,{children:["We've sent a password reset link to ",e.jsx("strong",{children:s})]})]}),e.jsxs(g,{className:"space-y-4",children:[e.jsx(N,{children:e.jsx(y,{children:"Click the link in the email to reset your password. If you don't see it, check your spam folder."})}),e.jsx("div",{className:"text-center",children:e.jsxs(x,{to:"/admin/login",className:"inline-flex items-center text-sm text-muted-foreground hover:text-primary transition-colors",children:[e.jsx(v,{className:"mr-2 h-4 w-4"}),"Back to login"]})})]})]})}):e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted/30 px-4",children:e.jsxs(h,{className:"w-full max-w-md",children:[e.jsxs(f,{className:"text-center",children:[e.jsx("div",{className:"mx-auto w-12 h-12 bg-primary/10 rounded-full flex items-center justify-center mb-4",children:e.jsx(S,{className:"h-6 w-6 text-primary"})}),e.jsx(p,{className:"text-2xl",children:"Forgot Password"}),e.jsx(j,{children:"Enter your email and we'll send you a reset link"})]}),e.jsxs(g,{children:[e.jsxs("form",{onSubmit:k,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{htmlFor:"email",children:"Email"}),e.jsx(P,{id:"email",type:"email",placeholder:"[email protected]",value:s,onChange:n=>r(n.target.value),disabled:t,className:l?"border-destructive":""}),l&&e.jsx("p",{className:"text-sm text-destructive",children:l})]}),e.jsx(E,{type:"submit",className:"w-full",disabled:t,children:t?e.jsxs(e.Fragment,{children:[e.jsx(A,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):"Send Reset Link"})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs(x,{to:"/admin/login",className:"inline-flex items-center text-sm text-muted-foreground hover:text-primary transition-colors",children:[e.jsx(v,{className:"mr-2 h-4 w-4"}),"Back to login"]})})]})]})})}export{W 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.