{"version":3,"file":"LeadForm.C4NS6aKB.mjs","names":["useState","startTransition"],"sources":["https:/framerusercontent.com/modules/y52hJziUCRoNQGe7oNZ9/h58MjyWksFXGd9Gw6Jmq/LeadForm.js"],"sourcesContent":["// Demian (11 Oct 2026): the real contact form (replaces the look-alike \"FormPlaceholder\" fields on Home + Contact).\n// Four fields, same as before: name, work email, website or Instagram, \"what takes up most of your week\" (optional).\n// Looks like the old card fields: Void inputs, hairline border, Plex Mono labels, green button (named \"Button\" so\n// HomeMotion's hover / press / corners / heart still work on it).\n// SEND (12 Oct 2026): posts to the YAC leads Worker (Cloudflare, free) which writes a row in Airtable \"YAC CRM\".\n//   Change \"Send to (endpoint)\" in the properties to use another endpoint. Empty endpoint = opens the visitor's mail\n//   app with the message already written to \"Email\" (a stop-gap that works with no setup).\n// Also sends: the page, where the visitor came from (referrer), and utm campaign tags. First touch of the visit is kept\n//   in sessionStorage (this tab only, gone when the tab closes). Nothing is stored for later visits.\n// Hidden spam trap: a field real people never see. If it's filled, we pretend it worked and send nothing.\n// Booking is a separate path (CalEmbed on Contact). This form never asks for a time.\n// Colours come in as \"rgb(...)\" strings. Motion: none except a 150 ms border change on focus. Works with motion off.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{startTransition,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const MONO='\"IBM Plex Mono\", ui-monospace, monospace';const SANS='\"Onest\", system-ui, -apple-system, sans-serif';const EMAIL_RE=/^[^\\s@]+@[^\\s@]+\\.[^\\s@]{2,}$/;const LEADS_URL=\"https://yac-leads.youragentcode.workers.dev/lead\";const TOUCH_KEY=\"yac_touch\";/** First touch of this visit: where they came from + utm tags. Safe if storage is blocked. */function readTouch(){try{const saved=window.sessionStorage.getItem(TOUCH_KEY);if(saved)return JSON.parse(saved);}catch(e){}let ref=\"\";let utm=\"\";try{ref=document.referrer||\"\";const q=new URLSearchParams(window.location.search);utm=[\"utm_source\",\"utm_medium\",\"utm_campaign\"].map(k=>q.get(k)).filter(Boolean).join(\" / \");}catch(e){}const touch={ref,utm};try{window.sessionStorage.setItem(TOUCH_KEY,JSON.stringify(touch));}catch(e){}return touch;}/**\n * Lead form\n *\n * @framerIntrinsicWidth 520\n * @framerIntrinsicHeight 520\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function LeadForm(props){const{endpoint=LEADS_URL,email=\"hello@youragentcode.com\",button=\"Send message →\",sending=\"Sending…\",thanks=\"Sent. We reply within 1 working day.\",errName=\"Add your name.\",errEmail=\"Check your email address.\",errSend=\"Didn't send. Email us instead:\",accent=\"rgb(79, 197, 103)\",field=\"rgb(0, 0, 0)\",text=\"rgb(245, 245, 240)\",mist=\"rgb(171, 171, 166)\",line=\"rgba(218, 214, 254, 0.1)\",style}=props;const[values,setValues]=useState({name:\"\",email:\"\",site:\"\",week:\"\",trap:\"\"});const[focus,setFocus]=useState(null);const[state,setState]=useState(\"idle\");const[problem,setProblem]=useState(\"\");// remember how this visit started (first touch), once the form is on screen\nReact.useEffect(()=>{if(typeof window!==\"undefined\")readTouch();},[]);const set=k=>e=>{const v=e.target.value;startTransition(()=>{setValues(s=>({...s,[k]:v}));if(problem)setProblem(\"\");if(state===\"error\")setState(\"idle\");});};const submit=async e=>{e.preventDefault();if(state===\"sending\")return;if(!values.name.trim())return startTransition(()=>(setProblem(errName),setState(\"idle\")));if(!EMAIL_RE.test(values.email.trim()))return startTransition(()=>(setProblem(errEmail),setState(\"idle\")));if(values.trap)return startTransition(()=>setState(\"done\"))// spam trap: look fine, send nothing\n;const page=typeof window!==\"undefined\"?window.location.pathname:\"\";if(!endpoint.trim()){const body=[`Name: ${values.name.trim()}`,`Email: ${values.email.trim()}`,`Website or Instagram: ${values.site.trim()}`,`What takes up most of my week: ${values.week.trim()}`,`(sent from ${page||\"the website\"})`].join(\"\\n\");if(typeof window!==\"undefined\")window.location.href=`mailto:${email}?subject=${encodeURIComponent(\"Audit request from \"+values.name.trim())}&body=${encodeURIComponent(body)}`;return startTransition(()=>setState(\"done\"));}startTransition(()=>setState(\"sending\"));try{const touch=typeof window!==\"undefined\"?readTouch():{ref:\"\",utm:\"\"};const fd=new FormData;fd.append(\"name\",values.name.trim());fd.append(\"email\",values.email.trim());fd.append(\"site\",values.site.trim());fd.append(\"week\",values.week.trim());fd.append(\"page\",page);fd.append(\"referrer\",touch.ref);fd.append(\"utm\",touch.utm);fd.append(\"_subject\",`Audit request from ${values.name.trim()}`);fd.append(\"_replyto\",values.email.trim());const res=await fetch(endpoint.trim(),{method:\"POST\",body:fd,headers:{Accept:\"application/json\"}});if(!res.ok)throw new Error(String(res.status));startTransition(()=>setState(\"done\"));}catch(err){startTransition(()=>setState(\"error\"));}};const label={fontFamily:MONO,fontSize:14,lineHeight:\"20px\",letterSpacing:\"0.08em\",textTransform:\"uppercase\",color:mist,fontWeight:500};const input=k=>({width:\"100%\",height:56,boxSizing:\"border-box\",padding:\"0 16px\",background:field,color:text,fontFamily:SANS,fontSize:18,border:`1px solid ${focus===k?accent:line}`,borderRadius:0,outline:\"none\",transition:\"border-color 150ms ease-out\"});const row=(k,title,type,auto,placeholder)=>/*#__PURE__*/_jsxs(\"label\",{style:{display:\"flex\",flexDirection:\"column\",gap:8,width:\"100%\"},children:[/*#__PURE__*/_jsx(\"span\",{style:label,children:title}),/*#__PURE__*/_jsx(\"input\",{name:k,type:type,autoComplete:auto,value:values[k],placeholder:placeholder,onChange:set(k),onFocus:()=>setFocus(k),onBlur:()=>setFocus(null),style:input(k)})]});if(state===\"done\"){return /*#__PURE__*/_jsxs(\"div\",{role:\"status\",style:{...style,width:\"100%\",display:\"flex\",flexDirection:\"column\",gap:12,fontFamily:SANS,color:text},children:[/*#__PURE__*/_jsx(\"span\",{style:{...label,color:accent},children:\"SENT\"}),/*#__PURE__*/_jsx(\"span\",{style:{fontSize:22,lineHeight:\"32px\"},children:thanks})]});}return /*#__PURE__*/_jsxs(\"form\",{onSubmit:submit,noValidate:true,style:{...style,width:\"100%\",display:\"flex\",flexDirection:\"column\",gap:20,boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsx(\"style\",{children:`.yac-lead input::placeholder{color:${mist};opacity:.5}`}),/*#__PURE__*/_jsxs(\"div\",{className:\"yac-lead\",style:{display:\"flex\",flexDirection:\"column\",gap:20},children:[row(\"name\",\"Name\",\"text\",\"name\",\"Jane Cooper\"),row(\"email\",\"Work email\",\"email\",\"email\",\"jane@company.com\"),row(\"site\",\"Website or Instagram\",\"text\",\"url\",\"company.com or @handle\"),row(\"week\",\"What takes up most of your week? \\xb7 Optional\",\"text\",\"off\",\"e.g. copying orders between apps\")]}),/*#__PURE__*/_jsx(\"input\",{name:\"company_url\",tabIndex:-1,autoComplete:\"off\",\"aria-hidden\":true,value:values.trap,onChange:set(\"trap\"),style:{position:\"absolute\",left:-9999,width:1,height:1,opacity:0,pointerEvents:\"none\"}}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:12,alignItems:\"flex-start\"},children:[/*#__PURE__*/_jsx(\"button\",{type:\"submit\",\"data-framer-name\":\"Button\",disabled:state===\"sending\",style:{background:accent,color:\"rgb(0, 0, 0)\",fontFamily:SANS,fontWeight:600,fontSize:18,lineHeight:\"24px\",padding:\"16px 28px\",border:\"none\",borderRadius:0,cursor:state===\"sending\"?\"default\":\"pointer\",opacity:state===\"sending\"?.7:1},children:state===\"sending\"?sending:button}),problem||state===\"error\"?/*#__PURE__*/_jsxs(\"span\",{role:\"alert\",style:{fontFamily:MONO,fontSize:13,lineHeight:\"18px\",letterSpacing:\"0.04em\",color:text},children:[problem||errSend,\" \",!problem?/*#__PURE__*/_jsx(\"a\",{href:`mailto:${email}`,style:{color:accent,textDecoration:\"underline\"},children:email}):null]}):null]})]});}addPropertyControls(LeadForm,{endpoint:{type:ControlType.String,title:\"Send to (endpoint)\",defaultValue:LEADS_URL,placeholder:\"https://…\"},email:{type:ControlType.String,title:\"Email\",defaultValue:\"hello@youragentcode.com\"},button:{type:ControlType.String,title:\"Button\",defaultValue:\"Send message →\"},sending:{type:ControlType.String,title:\"Sending\",defaultValue:\"Sending…\"},thanks:{type:ControlType.String,title:\"Thanks\",defaultValue:\"Sent. We reply within 1 working day.\"},errName:{type:ControlType.String,title:\"Error: name\",defaultValue:\"Add your name.\"},errEmail:{type:ControlType.String,title:\"Error: email\",defaultValue:\"Check your email address.\"},errSend:{type:ControlType.String,title:\"Error: send\",defaultValue:\"Didn't send. Email us instead:\"},accent:{type:ControlType.Color,title:\"Green\",defaultValue:\"rgb(79, 197, 103)\"},field:{type:ControlType.Color,title:\"Field\",defaultValue:\"rgb(0, 0, 0)\"},text:{type:ControlType.Color,title:\"Text\",defaultValue:\"rgb(245, 245, 240)\"},mist:{type:ControlType.Color,title:\"Muted\",defaultValue:\"rgb(171, 171, 166)\"},line:{type:ControlType.Color,title:\"Line\",defaultValue:\"rgba(218, 214, 254, 0.1)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LeadForm\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicHeight\":\"520\",\"framerIntrinsicWidth\":\"520\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LeadForm.map"],"mappings":"6MAYkhB,SAAS,GAAW,CAAC,GAAG,CAAC,IAAM,EAAM,EAAO,eAAe,QAAQ,CAAS,EAAE,GAAG,EAAM,OAAO,KAAK,MAAM,CAAK,CAAE,MAAS,CAAC,CAAC,IAAI,EAAI,GAAO,EAAI,GAAG,GAAG,CAAC,EAAI,SAAS,UAAU,GAAG,IAAM,EAAE,IAAI,gBAAgB,EAAO,SAAS,MAAM,EAAE,EAAI,CAAC,aAAa,aAAa,cAAc,CAAC,CAAC,IAAI,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,OA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