(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{5638:function(e,t,r){Promise.resolve().then(r.bind(r,5812)),Promise.resolve().then(r.t.bind(r,8326,23))},5812:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return ContactForm}});var n=r(7437),s=r(2265),a=r(4997);function ContactForm(){let[e,t]=(0,s.useState)(""),[r,o]=(0,s.useState)(""),[i,l]=(0,s.useState)(""),[d,u]=(0,s.useState)(!1),[c,m]=(0,s.useState)(null),onSubmit=async n=>{if(n.preventDefault(),m(null),!e||!r||!i){m({type:"error",message:"Please fill in name, email, and project details."});return}try{u(!0);let n=await fetch("/api/contact",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,email:r,details:i})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error((null==e?void 0:e.error)||"Failed to send message")}m({type:"success",message:"Thanks! We'll get back to you within 1 business day."}),t(""),o(""),l("")}catch(e){m({type:"error",message:(null==e?void 0:e.message)||"Something went wrong."})}finally{u(!1)}};return(0,n.jsxs)("form",{onSubmit:onSubmit,className:"p-6 rounded-xl border bg-card space-y-4",children:[(0,n.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-sm font-medium",htmlFor:"name",children:"Name"}),(0,n.jsx)("input",{id:"name",className:"mt-1 w-full h-10 rounded-md border bg-background px-3 text-sm outline-none focus:ring-2 focus:ring-ring focus:border-transparent",placeholder:"Jane Doe",value:e,onChange:e=>t(e.target.value)})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-sm font-medium",htmlFor:"email",children:"Email"}),(0,n.jsx)("input",{id:"email",type:"email",className:"mt-1 w-full h-10 rounded-md border bg-background px-3 text-sm outline-none focus:ring-2 focus:ring-ring focus:border-transparent",placeholder:"jane@company.com",value:r,onChange:e=>o(e.target.value)})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-sm font-medium",htmlFor:"details",children:"Project Details"}),(0,n.jsx)("textarea",{id:"details",className:"mt-1 w-full min-h-[120px] rounded-md border bg-background px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-ring focus:border-transparent",placeholder:"Briefly describe your project...",value:i,onChange:e=>l(e.target.value)})]}),c&&(0,n.jsx)("p",{className:"text-sm ".concat("success"===c.type?"text-green-600":"text-red-600"),children:c.message}),(0,n.jsx)(a.z,{className:"w-full sm:w-auto",type:"submit",disabled:d,children:d?"Sending…":"Send Message"})]})}},4997:function(e,t,r){"use strict";r.d(t,{z:function(){return u}});var n=r(7437),s=r(2265),a=r(4949),o=r(6061),i=r(7042),l=r(4769);let d=(0,o.j)("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),u=s.forwardRef((e,t)=>{let{className:r,variant:s,size:o,asChild:u=!1,...c}=e,m=u?a.g7:"button";return(0,n.jsx)(m,{className:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,l.m6)((0,i.W)(t))}(d({variant:s,size:o,className:r})),ref:t,...c})});u.displayName="Button"}},function(e){e.O(0,[326,14,971,472,744],function(){return e(e.s=5638)}),_N_E=e.O()}]);