1import{a as n,j as e}from"./vendor-query-BxlSJxfF.js";import{B as L}from"./BrandHeader-BG3dLcxh.js";import{o as F}from"./feedback-Bgf_c1TA.js";import{S as q}from"./SiteFooter-BcC8Tz21.js";import{a as E,u as H,s as x,B as C,I as w,e as l}from"./index-DO0aGFYL.js";import{T as I}from"./textarea-CY9O0h4D.js";import{H as _}from"./Head-CFjoxvyt.js";import{g as A}from"./validations-BbtNobTX.js";import{t as B,f as K,C as P}from"./rate-limiter-WC2fj22N.js";import{u as T}from"./vendor-react-DdNhUK9-.js";import{M as O}from"./mail-jw7BVI6D.js";import{M as z}from"./message-square-CLxZQpIa.js";import{M as R}from"./message-square-plus-BJcrVrJI.js";import{S as U}from"./send-C6vNENnO.js";import"./KnucklLogo-DmAzyuOm.js";import"./arrow-left-DNK6fh5x.js";import"./sheet-KxRpZ2qz.js";import"./appReview-CW1-s-M2.js";import"./check-BTT3mgzE.js";import"./star-B2GJQJHh.js";import"./lightbulb-CvX2ACIS.js";import"./bug-DezHK7xq.js";import"./heart-BHSL6QMs.js";import"./vendor-supabase-Csx7YFID.js";import"./types-CASKHAAT.js";function fe(){T();const{t}=E(),{user:c}=H(),[f,d]=n.useState(""),[g,u]=n.useState(""),[p,h]=n.useState(""),[b,j]=n.useState(!1),[s,i]=n.useState({});n.useEffect(()=>{if(!c)return;let r=!1;return u(a=>a||c.email||""),(async()=>{const{data:a}=await x.from("profiles").select("full_name").eq("user_id",c.id).maybeSingle();r||a!=null&&a.full_name&&d(m=>m||a.full_name)})(),()=>{r=!0}},[c]);const M=async r=>{r.preventDefault();const a=A(t).safeParse({name:f,email:g,message:p});if(!a.success){const o={};for(const k of a.error.issues){const S=k.path[0];o[S]||(o[S]=k.message)}i(o),l.error(Object.values(o)[0]);return}i({});const m=B(P);if(!m.allowed){l.error(t.validations.tooManySubmissions.replace("{retry}",K(m.retryAfterMs)));return}const{name:N,email:v,message:y}=a.data;j(!0);try{const o=crypto.randomUUID();await x.from("contact_submissions").insert({name:N,email:v,message:y}),await x.functions.invoke("contact-form-email",{body:{submissionId:o,name:N,email:v,message:y}}),l.success(t.contact.sent),d(""),u(""),h("")}catch{l.error(t.validations.somethingWentWrong)}finally{j(!1)}};return e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx(_,{title:"Contact Us â Support & Inquiries | Knuckl",description:"Get in touch with Knuckl support. Help for contractors, subs, and workers on the Orlando construction marketplace.",canonical:"https://knuckl.com/contact"}),e.jsx(L,{}),e.jsxs("main",{className:"max-w-xl mx-auto px-4 py-12 space-y-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"font-display text-5xl mb-4",children:t.contact.title}),e.jsx("p",{className:"text-muted-foreground text-lg",children:t.contact.subtitle})]}),e.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-card border border-border rounded-lg p-4 flex items-start gap-3",children:[e.jsx(O,{className:"w-5 h-5 text-primary mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:t.contact.emailLabel}),e.jsx("a",{href:"mailto:[email protected]",className:"text-sm text-primary hover:underline",children:"[email protected]"})]})]}),e.jsxs("div",{className:"bg-card border border-border rounded-lg p-4 flex items-start gap-3",children:[e.jsx(z,{className:"w-5 h-5 text-primary mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:t.contact.supportLabel}),e.jsx("a",{href:"mailto:[email protected]",className:"text-sm text-primary hover:underline",children:"[email protected]"})]})]})]}),e.jsxs(C,{type:"button",variant:"secondary",className:"w-full gap-2",onClick:()=>F(),children:[e.jsx(R,{className:"w-4 h-4"}),t.feedback.publicCta]}),e.jsxs("form",{onSubmit:M,className:"bg-card border border-border rounded-lg p-6 space-y-4",children:[e.jsx("h2",{className:"font-display text-2xl",children:t.contact.sendMessage}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"contact-name",className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:t.contact.nameLabel}),e.jsx(w,{id:"contact-name",value:f,onChange:r=>{d(r.target.value),s.name&&i(a=>({...a,name:""}))},placeholder:t.contact.namePlaceholder,maxLength:100,autoComplete:"name",autoCapitalize:"words",enterKeyHint:"next","aria-required":"true","aria-invalid":!!s.name,className:`bg-background border-border ${s.name?"border-destructive":""}`}),s.name&&e.jsx("p",{className:"text-xs text-destructive",children:s.name})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"contact-email",className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:t.contact.emailFieldLabel}),e.jsx(w,{id:"contact-email",type:"email",value:g,onChange:r=>{u(r.target.value),s.email&&i(a=>({...a,email:""}))},placeholder:t.contact.emailPlaceholder,maxLength:255,inputMode:"email",autoComplete:"email",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,enterKeyHint:"next","aria-required":"true","aria-invalid":!!s.email,className:`bg-background border-border ${s.email?"border-destructive":""}`}),s.email&&e.jsx("p",{className:"text-xs text-destructive",children:s.email})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"contact-message",className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:t.contact.messageLabel}),e.jsx(I,{id:"contact-message",value:p,onChange:r=>{h(r.target.value),s.message&&i(a=>({...a,message:""}))},placeholder:t.contact.messagePlaceholder,maxLength:2e3,autoCapitalize:"sentences",enterKeyHint:"send","aria-required":"true","aria-invalid":!!s.message,className:`bg-background border-border min-h-[120px] ${s.message?"border-destructive":""}`}),s.message&&e.jsx("p",{className:"text-xs text-destructive",children:s.message}),e.jsxs("p",{className:"text-xs text-muted-foreground text-right",children:[p.length,"/2000"]})]}),e.jsx(C,{type:"submit",disabled:b,className:"w-full",children:b?t.contact.sending:e.jsxs(e.Fragment,{children:[e.jsx(U,{className:"w-4 h-4 mr-2"}),t.contact.sendButton]})})]})]}),e.jsx(q,{})]})}
1export{fe 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.