1import{r as u,j as e,a as N}from"./chunk-UH6JLGW7-BkcM59_x.js";import{t as w,E as j}from"./analytics-C4VujULg.js";import{b,E as h,c as g,T as v}from"./ui-CWTBeO6Q.js";/** 2 * @license lucide-react v0.540.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const S=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],C=b("arrow-left",S);/** 7 * @license lucide-react v0.540.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const E=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],A=b("chevron-left",E);/** 12 * @license lucide-react v0.540.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */const T=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],L=b("chevron-right",T),_=["09:00","10:00","11:00","12:00","13:00"];function y(n){return`${n.slice(0,2)}:30`}const B="/book-workshop";function z({days:n}){var t;const[i,o]=u.useState((t=n[0])==null?void 0:t.iso),[c,l]=u.useState(null),d=u.useRef(null),s=n.find(r=>r.iso===i)??n[0],m=r=>{const a=d.current;a&&a.scrollBy({left:r*a.clientWidth*.7,behavior:"smooth"})};return c!=null?e.jsx(I,{selection:c,onChangeTime:()=>l(null)}):e.jsxs(e.Fragment,{children:[e.jsx(h,{children:"Step 1 of 2"}),e.jsx("h2",{className:"mt-4 max-w-2xl",children:"Select a date and a time."}),e.jsx("p",{className:"mt-4 max-w-2xl text-ink-500",children:"Each session is 30 minutes. Sessions start on the hour, Monday to Friday, from 9:00 to 13:00, South African time (SAST). You can book up to 14 days ahead."}),e.jsxs("div",{className:"mt-10 flex items-center gap-3",children:[e.jsx("button",{type:"button","aria-label":"Earlier dates",onClick:()=>m(-1),className:"grid size-10 shrink-0 cursor-pointer place-items-center rounded-full border-[1.5px] border-brand bg-paper text-brand transition-colors hover:bg-ink-50",children:e.jsx(A,{size:18,"aria-hidden":!0})}),e.jsx("div",{ref:d,className:"flex grow snap-x gap-3 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:n.map(r=>{const a=r.iso===s.iso;return e.jsxs("button",{type:"button","aria-pressed":a,onClick:()=>o(r.iso),className:g("shrink-0 cursor-pointer snap-start rounded-md border px-5 py-3 text-left transition-colors",a?"border-brand bg-brand text-paper":"border-ink-300 bg-paper text-ink-900 hover:border-brand hover:text-brand"),children:[e.jsx("span",{className:g("block text-2xs uppercase tracking-label",a?"text-ink-300":"text-ink-500"),children:r.weekday}),e.jsx("span",{className:"mt-1 block whitespace-nowrap text-sm font-semibold",children:r.date})]},r.iso)})}),e.jsx("button",{type:"button","aria-label":"Later dates",onClick:()=>m(1),className:"grid size-10 shrink-0 cursor-pointer place-items-center rounded-full border-[1.5px] border-brand bg-paper text-brand transition-colors hover:bg-ink-50",children:e.jsx(L,{size:18,"aria-hidden":!0})})]}),e.jsxs("div",{className:"mt-8",children:[e.jsxs("p",{className:"text-2xs uppercase tracking-label text-ink-500",children:[s.weekday," ",s.date," â available times"]}),e.jsx("div",{className:"mt-4 flex flex-wrap gap-3",children:_.map(r=>e.jsxs("button",{type:"button",onClick:()=>l({day:s,start:r}),className:"cursor-pointer rounded-md border border-ink-300 bg-paper px-4 py-2.5 text-sm font-medium text-ink-900 transition-colors hover:border-brand hover:bg-ink-50 hover:text-brand",children:[r,"â",y(r)]},r))})]})]})}function I({selection:n,onChangeTime:i}){var f;const o=N(),c=u.useRef(null),l=o.state==="idle"&&((f=o.data)==null?void 0:f.ok)===!0,d=o.state!=="idle",s=o.data,m=s&&s.ok===!1?s.error:null,t=s&&s.ok===!1?s.values:void 0,r=s&&s.ok===!0?s.lead:void 0;u.useEffect(()=>{var k;l&&r&&((k=c.current)==null||k.reset(),w("workshop_booking",r))},[l,r]);const a=`${n.day.weekday} ${n.day.date}, ${n.start}â${y(n.start)} SAST`;return l?e.jsxs("div",{className:"rounded-md border border-ink-900 bg-paper p-8 md:p-10",children:[e.jsx(h,{children:"Booking received"}),e.jsxs("p",{className:"mt-4 font-serif text-2xl",children:[a," is held for you."]}),e.jsx("p",{className:"mt-4 max-w-xl text-ink-500",children:"We will confirm your workshop by email with a calendar invite, usually within one working day."})]}):e.jsxs(e.Fragment,{children:[e.jsx(h,{children:"Step 2 of 2"}),e.jsx("h2",{className:"mt-4 max-w-2xl",children:"Tell us who's coming."}),e.jsxs("div",{className:"mt-8 flex flex-wrap items-center gap-4 roun
16ded-md border border-ink-200 bg-ink-50 px-5 py-4",children:[e.jsx("p",{className:"font-medium text-ink-900",children:a}),e.jsxs("button",{type:"button",onClick:i,className:"inline-flex cursor-pointer items-center gap-1.5 text-sm text-ink-500 underline decoration-ink-300 hover:text-brand hover:decoration-brand",children:[e.jsx(C,{size:14,"aria-hidden":!0}),"Change time"]})]}),e.jsxs(o.Form,{ref:c,method:"post",action:B,className:"mt-10 grid max-w-2xl gap-8",children:[e.jsx("div",{className:"hidden","aria-hidden":!0,children:e.jsxs("label",{children:["Website",e.jsx("input",{name:"website",type:"text",tabIndex:-1,autoComplete:"off"})]})}),e.jsx("input",{type:"hidden",name:"slotDate",value:n.day.iso}),e.jsx("input",{type:"hidden",name:"slotStart",value:n.start}),e.jsxs("div",{className:"grid gap-8 md:grid-cols-2",children:[e.jsx(p,{label:"Your name",children:e.jsx("input",{name:"name",required:!0,type:"text",defaultValue:t==null?void 0:t.name,className:x,placeholder:"Jordan Mensah"})}),e.jsx(p,{label:"Startup / company name",children:e.jsx("input",{name:"company",required:!0,type:"text",defaultValue:t==null?void 0:t.company,className:x,placeholder:"Acme Inc."})})]}),e.jsx(p,{label:"Email",children:e.jsx("input",{name:"email",required:!0,type:"email",defaultValue:t==null?void 0:t.email,className:x,placeholder:"[email protected]"})}),e.jsx(p,{label:"Phone",hint:"Optional â if you'd rather we call you.",children:e.jsx("input",{name:"phone",type:"tel",defaultValue:t==null?void 0:t.phone,className:x,placeholder:"+27 82 000 0000"})}),e.jsx(p,{label:"Your project, briefly",children:e.jsx("textarea",{name:"description",required:!0,rows:4,defaultValue:t==null?void 0:t.description,className:x,placeholder:"A sentence or tw
16o about what you're building and the problem it solves."})}),m?e.jsx("p",{role:"alert",className:"rounded-md border border-ink-300 bg-ink-50 px-4 py-3 text-sm text-ink-700",children:m}):null,e.jsxs("div",{className:"flex flex-wrap items-center gap-4 pt-2",children:[e.jsxs("button",{type:"submit",disabled:d,className:"inline-flex items-center gap-2 rounded-full bg-brand px-5 py-2.5 text-sm font-medium text-paper no-underline transition-colors hover:bg-brand-hover disabled:opacity-60",children:[d?"Bookingâ¦":"Book the workshop",!d&&e.jsx("span",{"aria-hidden":!0,children:"â"})]}),e.jsxs("p",{className:"text-sm text-ink-400",children:["Or email ",e.jsx(v,{to:`mailto:${j}`,children:j})," ","directly."]})]})]})]})}const x="w-full rounded-md border border-ink-300 bg-paper px-4 py-3 text-ink-900 focus:border-brand focus:outline-none";function p({label:n,hint:i,children:o}){return e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"block font-medium text-ink-900",children:n}),i?e.jsx("span",{className:"mt-1 block text-sm text-ink-500",children:i}):null,e.jsx("div",{className:"mt-3",children:o})]})}export{C as A,z as B};
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.