1import{h as g,r as o,j as e,ay as y,au as j,I as m,y as L,s as v}from"./index-Dmz6Wrx6.js";import{L as n}from"./label-DhkKtgJx.js";import{C as w}from"./circle-check-zJv_xf2J.js";async function N(r){const a=r==null?void 0:r.context;if(a)try{const s=await a.clone().json();if(s.error||s.message)return s.error||s.message}catch{try{const s=await a.clone().text();if(s)return s}catch{}}return r instanceof Error?r.message:"Something went wrong. Please try again."}function C(){const{t:r}=g(),[a,s]=o.useState({name:"",email:"",phone:"",hope:""}),[u,f]=o.useState(!1),[x,c]=o.useState(null),[p,h]=o.useState(!1),d=i=>t=>s(l=>({...l,[i]:t.target.value})),b=async i=>{if(i.preventDefault(),c(null),!a.name.trim()||!a.email.trim()){c(r("freeGuideLibrary.toasts.nameEmailRequired"));return}f(!0);try{const{data:t,error:l}=await v.functions.invoke("collect-lead",{body:a});if(l)throw new Error(await N(l));if(t!=null&&t.error)throw new Error(t.error);h(!0)}catch(t){c(t instanceof Error?t.message:r("bookDemo.errors.generic"))}finally{f(!1)}};return e.jsxs("div",{className:"relative min-h-screen bg-background",children:[e.jsx(y,{title:"Free AI-Built Guide Library for B2B Software",description:"Apply for a free spot: we'll point Stepily's AI agents at your software and build you a complete library of visual guides.",path:"/free-guide-library"}),e.jsx(j,{showSearch:!1,showNav:!1}),e.jsxs("main",{className:"max-w-lg mx-auto px-4 py-20 md:py-28",children:[e.jsx("span",{className:"inline-block mb-5 px-3 py-1 rounded-full bg-primary/10 text-primary text-xs font-semibold tracking-wide uppercase",children:r("freeGuideLibrary.badge")}),e.jsx("h1",{className:"text-3xl md:text-4xl font-semibold leading-tight text-foreground mb-3",children:r("freeGuideLibrary.headline")}),e.jsx("p",{className:"text-base text-muted-foreground mb-4 leading-relaxed",children:r("freeGuideLibrary.description")}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-muted-foreground mb-10 space-y-1.5",children:[e.jsx("li",{children:r("freeGuideLibrary.benefit1")}),e.jsx("li",{children:r("freeGuideLibrary.benefit2")})]}),p?e.jsxs("div",{className:"flex flex-col items-start gap-3 py-6",children:[e.jsx(w,{className:"w-8 h-8 text-primary"}),e.jsx("p",{className:"text-lg font-semibold text-foreground",children:r("freeGuideLibrary.successTitle")}),e.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:r("freeGuideLibrary.successDescription")})]}):e.jsxs("form",{onSubmit:b,className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(n,{htmlFor:"name",children:r("freeGuideLibrary.form.nameLabel")}),e.jsx(m,{id:"name",placeholder:"Jane Smith",value:a.name,onChange:d("name"),autoComplete:"name",required:!0})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(n,{htmlFor:"email",children:r("freeGuideLibrary.form.emailLabel")}),e.jsx(m,{id:"email",type:"email",placeholder:"[email protected]",value:a.email,onChange:d("email"),autoComplete:"email",required:!0})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(n,{htmlFor:"phone",children:r("freeGuideLibrary.form.phoneLabel")}),e.jsx(m,{id:"phone",type:"tel",placeholder:"+1 555 123 4567",value:a.phone,onChange:d("phone"),autoComplete:"tel"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(n,{htmlFor:"hope",children:r("freeGuideLibrary.form.hopeLabel")}),e.jsx("textarea",{id:"hope",placeholder:r("freeGuideLibrary.form.hopePlaceholder"),value:a.hope,onChange:i=>s(t=>({...t,hope:i.target.value})),rows:3,className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring text-foreground resize-none"})]}),x&&e.jsx("p",{className:"text-sm text-destructive",children:x}),e.jsx(L,{type:"submit",size:"lg",className:"mt-1",disabled:u,children:r(u?"freeGuideLibrary.form.submittingButton":"freeGuideLibrary.form.submitButton")}),e.jsx("p",{className:"text-xs text-muted-foreground text-center"})]})]})]})}export{C 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.