1import{r as n,j as e,z as f,W as j,B as b,f as y}from"./index-tL3yZWrw.js";import{L as o,I as l}from"./label-CjLlDpm0.js";const u=n.forwardRef(({className:s,...a},i)=>e.jsx("textarea",{className:f("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",s),ref:i,...a}));u.displayName="Textarea";function N(){const[s,a]=n.useState({name:"",email:"",subject:"",message:"",honeypot:""}),[i,c]=n.useState(!1),[x,h]=n.useState(!1),[d,m]=n.useState(null);async function p(t){t.preventDefault(),c(!0),m(null);try{const r=await fetch("/api/public/contact",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...s,pageUrl:typeof window<"u"?window.location.href:void 0})}),g=await r.json().catch(()=>({}));if(!r.ok)throw new Error(g.error||"Failed to send message");h(!0)}catch(r){m(r instanceof Error?r.message:"Failed to send")}finally{c(!1)}}return e.jsxs("div",{className:"mx-auto w-full max-w-2xl px-4 py-12 sm:py-16",children:[e.jsxs("header",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-bold tracking-tight text-foreground sm:text-4xl",children:"Contact us"}),e.jsx("p",{className:"mt-3 text-muted-foreground",children:"Questions about scans, the API, the Chrome extension, partnerships, or anything else â we read every message."})]}),x?e.jsx("div",{className:"rounded-lg border border-input bg-muted/30 p-6",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(j,{className:"mt-0.5 h-5 w-5 text-primary"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:"Message sent"}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:["Thanks â we'll get back to you within 1â2 business days. A confirmation copy is on its way to ",e.jsx("span",{className:"font-mono",children:s.email}),"."]})]})]})}):e.jsxs("form",{onSubmit:p,className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(o,{htmlFor:"c-name",children:"Name"}),e.jsx(l,{id:"c-name",required:!0,value:s.name,onChange:t=>a({...s,name:t.target.value})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(o,{htmlFor:"c-email",children:"Email"}),e.jsx(l,{id:"c-email",type:"email",required:!0,value:s.email,onChange:t=>a({...s,email:t.target.value})})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(o,{htmlFor:"c-subject",children:"Subject"}),e.jsx(l,{id:"c-subject",required:!0,value:s.subject,onChange:t=>a({...s,subject:t.target.value})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(o,{htmlFor:"c-msg",children:"Message"}),e.jsx(u,{id:"c-msg",required:!0,rows:6,value:s.message,onChange:t=>a({...s,message:t.target.value})})]}),e.jsx("input",{type:"text",tabIndex:-1,autoComplete:"off",value:s.honeypot,onChange:t=>a({...s,honeypot:t.target.value}),style:{position:"absolute",left:"-9999px",width:1,height:1},"aria-hidden":"true"}),d?e.jsx("p",{className:"text-sm text-destructive",children:d}):null,e.jsxs(b,{type:"submit",disabled:i,children:[i&&e.jsx(y,{className:"mr-2 h-4 w-4 animate-spin"}),"Send message"]})]})]})}export{N as component};
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.