1import{r as o}from"./index-CcH0GJHK.js";function q(){o.useEffect(()=>{const a=document.querySelectorAll(".reveal"),t=new IntersectionObserver(n=>n.forEach(i=>{i.isIntersecting&&(i.target.classList.add("visible"),t.unobserve(i.target))}),{threshold:.08});return a.forEach(n=>t.observe(n)),()=>t.disconnect()},[])}const v={name:"",email:"",company:"",message:""},w=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function g(a,t){switch(a){case"name":return t.trim()?void 0:"Name is required.";case"email":return t.trim()?w.test(t.trim())?void 0:"Please enter a valid email address.":"Email is required.";case"message":return t.trim()?void 0:"This field is required.";default:return}}function T(a){const[t,n]=o.useState(v),[i,c]=o.useState("idle"),[y,f]=o.useState(""),[S,d]=o.useState({}),[E,h]=o.useState({});function p(u){const{name:l,value:s}=u.target,e=l;if(n(r=>({...r,[e]:s})),E[e]){const r=g(e,s);d(m=>({...m,[e]:r}))}}function b(u){const{name:l,value:s}=u.target,e=l;h(m=>({...m,[e]:!0}));const r=g(e,s);d(m=>({...m,[e]:r}))}async function k(u){u.preventDefault();const l=["name","email","message"],s={};for(const e of l){const r=g(e,t[e]);r&&(s[e]=r)}if(h({name:!0,email:!0,message:!0}),d(s),!(Object.keys(s).length>0)){c("submitting"),f("");try{const e=await fetch("/api/contact",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...t,formType:a})}),r=await e.json();if(!e.ok){f(r.error||r.errors?.join(", ")||"Something went wrong."),c("error");return}c("success"),n(v),d({}),h({})}catch{f("Network error. Please check your connection and try again."),c("error")}}}return{form:t,status:i,serverError:y,handleChange:p,handleBlur:b,handleSubmit:k,setStatus:c,errors:S}}export{q as a,T as u};
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.