1import{w as o,x as y,y as m,v as e,B as d,L as j,z as w}from"./index-QqAfTWgn.js";import{u as N}from"./index.esm-BsBl_KD5.js";import{F as u}from"./formField-B4flV2Rp.js";import{T as v}from"./textarea-kaOg9vCQ.js";try{let s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new s.Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="06d53024-f95a-49c3-8f8b-68a8931bf694",s._sentryDebugIdIdentifier="sentry-dbid-06d53024-f95a-49c3-8f8b-68a8931bf694")}catch{}function I(){const{register:s,handleSubmit:t,reset:n,formState:{isValid:c,isSubmitting:l,errors:a}}=N({mode:"all"}),[f,i]=o.useState(!1),x=o.useCallback(async({name:g,email:b,message:h,website:p})=>{const{error:r}=await y.functions.invoke("send_contact_email",{body:{name:g,email:b,message:h,website:p}});if(r){m.warning(`Failed to send message: ${r.message}`);return}m("Thanks â your message has been sent."),i(!0),n()},[n]);return f?e.jsxs("div",{className:"mx-auto flex max-w-2xl flex-col gap-4 p-6",children:[e.jsx("span",{className:"font-instrument-serif text-3xl",children:"Thank you"}),e.jsx("span",{className:"text-lg",children:"Your message has been sent. We'll get back to you as soon as we can."}),e.jsx(d,{className:"w-fit",onClick:()=>i(!1),children:"Send another"})]}):e.jsxs("div",{className:"mx-auto flex max-w-2xl flex-col gap-4 p-6",children:[e.jsx("span",{className:"font-instrument-serif text-3xl",children:"Contact us"}),e.jsx("span",{className:"text-lg",children:"Interested in Fieldbook? Send us a message and we'll be in touch."}),e.jsxs("form",{onSubmit:t(x),className:"flex flex-col gap-2",children:[e.jsx(u,{label:"Name",type:"text",autoComplete:"name",...s("name",{required:"Required",minLength:{value:2,message:"Minimum length of 2"}}),error:a.name}),e.jsx(u,{label:"Email",type:"email",autoComplete:"email",...s("email",{required:"Required",pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:"Enter a valid email"}}),error:a.email}),e.jsxs("div",{className:"grid w-full items-center gap-1.5",children:[e.jsx(j,{htmlFor:"message",children:"Message"}),e.jsx(v,{id:"message",rows:6,className:w(a.message&&"border-orange-800 focus:border-orange-500 focus:ring-orange-600"),...s("message",{required:"Required",minLength:{value:10,message:"Minimum length of 10"}})}),a.message&&e.jsx("div",{className:"flex h-4 justify-end text-xs text-orange-800",children:a.message.message}),!a.message&&e.jsx("span",{className:"h-4"})]}),e.jsxs("div",{"aria-hidden":"true",style:{position:"absolute",left:"-10000px",width:"1px",height:"1px",overflow:"hidden"},children:[e.jsx("label",{htmlFor:"website",children:"Website"}),e.jsx("input",{id:"website",type:"text",tabIndex:-1,autoComplete:"off",...s("website")})]}),e.jsx(d,{className:"w-full",type:"submit",disabled:!c||l,children:l?"Sending...":"Send message"})]})]})}export{I as component}; 2//# sourceMappingURL=contact-BiEFjIgT.js.map
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.