PageSourceSearch

https://etaps.ai/assets/QuickBook-ElqnkG9V.js

js etaps.ai collected 2026-10-05 14:20:53 UTC 10,485 bytes, 2 lines download raw bytes

1import{r as i,j as e}from"./react-2yNL-0jO.js";import{H as F,f as I}from"./index-0I6tP8u4.js";import{c as X,d as U}from"./EtapsShell-C7F7CNZl.js";import{u as w}from"./ui-vendor-C2kPg7wM.js";import{d as Z}from"./ics-DvO21hKD.js";import{w as n}from"./proxy-Db0T5LP0.js";import{Z as D,v as q,V as Q,al as G,am as K,an as V,O as T,ao as W,_ as H,ac as Y}from"./lucide-YE_Cg0sW.js";import"./admin-vendor-CGWxZvmW.js";import"./react-router-C95oXNrA.js";import"./date-fns-VUYwK_nv.js";import"./etaps-logo.png.asset-QRzpYGtm.js";import"./index-sKpI2_Cf.js";const R="https://nwhfiiyfhcgwkhiszeqe.supabase.co/functions/v1/etaps-demo-schedule",ee="https://nwhfiiyfhcgwkhiszeqe.supabase.co/functions/v1/etaps-quick-book",h="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im53aGZpaXlmaGNnd2toaXN6ZXFlIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Nzg4NTUxODMsImV4cCI6MjA5NDQzMTE4M30.IXQMwwLd8aznQPwBmui0aJuZX1KSRJebbzo2k3gvT44";function he(){var _,C;const[m,P]=i.useState([]),[z,B]=i.useState(!0),[r,g]=i.useState(null),[o,y]=i.useState(null),[d,j]=i.useState(0),[v,J]=i.useState(""),[p,N]=i.useState(!1),[M,O]=i.useState(!1),[a,$]=i.useState(null);i.useEffect(()=>{(async()=>{var t;try{const s=await(await fetch(R,{headers:{apikey:h,Authorization:`Bearer ${h}`}})).json();P(s.slots||[]),(t=s.slots)!=null&&t[0]&&g(s.slots[0].date)}catch{w.error("Couldn't load available slots — please try refreshing")}finally{B(!1)}})()},[]);const x=5,c=i.useMemo(()=>m.slice(d*x,d*x+x),[m,d]),k=Math.max(0,Math.ceil(m.length/x)-1),u=m.find(t=>t.date===r),L=r?new Date(r).toLocaleDateString("en-US",{weekday:"long",day:"numeric",month:"long"}):null,f=v.replace(/\D/g,"").replace(/^0+/,""),S=f?`+92${f}`:"",b=!!(r&&o&&f),A=async t=>{if(t.preventDefault(),!(!b||p)){N(!0);try{const l=await fetch(ee,{method:"POST",headers:{"Content-Type":"application/json",apikey:h,Authorization:`Bearer ${h}`},body:JSON.stringify({phone:S,date:r,time:o})});let s={};try{s=await l.json()}catch{}if(!l.ok)throw new Error(s.error||s.message||`Booking failed (${l.status})`);$({meet_link:s.meet_link,html_link:s.html_link}),O(!0),s.calendar_error&&w.warning(`Booked, but the calendar event failed: ${s.calendar_error}`)}catch(l){w.error(l.message||"Could not complete booking — please try again")}finally{N(!1)}}};return e.jsxs(X,{children:[e.jsxs(F,{children:[e.jsx("title",{children:"Book a Demo — eTaps Unified eCommerce OS"}),e.jsx("meta",{name:"description",content:"Pick a time that suits you. 30-minute personalised demo of eTaps — Pakistan's first Unified eCommerce OS."}),e.jsx("link",{rel:"canonical",href:"https://etaps.me/quick-book"})]}),e.jsx(U,{eyebrow:"Book a Demo",title:"Pick a time that",gradWord:"works for you",description:"A 30-minute walk-through, tailored to your stack and order volume. No slides — just the product."}),e.jsx("section",{className:"relative px-4 sm:px-6 pb-24",children:e.jsx("div",{className:"max-w-xl mx-auto",children:M?e.jsxs(n.div,{initial:{opacity:0,scale:.96,y:16},animate:{opacity:1,scale:1,y:0},transition:{duration:.45,ease:[.16,1,.3,1]},className:"etaps-glass rounded-3xl p-8 md:p-14 text-center relative overflow-hidden",children:[e.jsxs(n.div,{className:"absolute inset-0 -z-10",initial:{opacity:0}
1,animate:{opacity:1},transition:{delay:.4,duration:.8},children:[e.jsx("div",{className:"absolute left-1/2 top-12 -translate-x-1/2 h-40 w-40 rounded-full bg-[var(--violet)]/20 blur-3xl"}),e.jsx("div",{className:"absolute left-1/4 top-24 h-24 w-24 rounded-full bg-[var(--gold)]/15 blur-2xl"}),e.jsx("div",{className:"absolute right-1/4 top-20 h-24 w-24 rounded-full bg-[var(--indigo)]/20 blur-2xl"})]}),e.jsx(n.div,{initial:{scale:0,rotate:-45},animate:{scale:1,rotate:0},transition:{delay:.12,type:"spring",stiffness:180,damping:14},className:"mx-auto h-20 w-20 rounded-full bg-gradient-to-br from-[var(--violet)] to-[var(--indigo)] flex items-center justify-center shadow-[0_20px_60px_-10px_var(--violet)]",children:e.jsx(D,{className:"h-9 w-9 text-white",strokeWidth:3})}),e.jsxs(n.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.3},children:[e.jsxs("div",{className:"inline-flex items-center gap-1.5 mt-6 px-3 py-1 rounded-full bg-[var(--gold)]/10 border border-[var(--gold)]/30 text-[var(--gold)] text-[11px] uppercase tracking-widest",children:[e.jsx(q,{className:"h-3 w-3"})," All set"]}),e.jsx("h3",{className:"mt-4 text-white font-semibold text-2xl md:text-3xl",children:"See you soon, there"}),e.jsxs("p",{className:"mt-3 text-white/65 mx-auto max-w-sm leading-relaxed",children:["We've reserved ",e.jsxs("b",{className:"text-white",children:[L," at ",o&&I(o)," PKT"]}),". We'll call you on ",e.jsx("b",{className:"text-white",children:S}),"."]})]}),e.jsxs(n.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.45},className:"mt-7 flex flex-col sm:flex-row gap-2.5 justify-center flex-wrap",children:[(a==null?void 0:a.meet_link)&&e.jsxs("a",{href:a.meet_link,target:"_blank",rel:"noreferrer",className:"etaps-btn-primary inline-flex items-center justify-center gap-2 px-5 py-3 rounded-full text-sm font-medium",children:[e.jsx(Q,{className:"h-4 w-4"})," Join Google Meet"]}),(a==null?void 0:a.html_link)&&e.jsxs("a",{href:a.html_link,target:"_blank",rel:"noreferrer",className:"inline-flex items-center justify-center gap-2 px-5 py-3 rounded-full text-sm font-medium border border-white/15 text-white/80 hover:border-white/30 hover:bg-white/5 transition-colors",children:[e.jsx(G,{className:"h-4 w-4"})," Add to Calendar"]}),e.jsxs("button",{type:"button",onClick:()=>Z({date:r,time:o,summary:"eTaps demo",description:`eTaps demo booked via quick-book.${a!=null&&a.meet_link?`
2Join: ${a.meet_link}`:""}`,location:(a==null?void 0:a.meet_link)||void 0,filename:"etaps-demo.ics"}),className:"inline-flex items-center justify-center gap-2 px-5 py-3 rounded-full text-sm font-medium border border-white/15 text-white/80 hover:border-white/30 hover:bg-white/5 transition-colors",children:[e.jsx(K,{className:"h-4 w-4"})," Download .ics"]})]}),e.jsxs(n.p,{initial:{opacity:0}
2,animate:{opacity:1},transition:{delay:.6},className:"mt-6 text-[11px] text-white/35",children:["Need a different time? ",e.jsx("a",{href:"/reschedule",className:"text-[var(--violet)]/80 underline-offset-2 hover:underline",children:"Reschedule here"}),"."]})]}):e.jsx("form",{onSubmit:A,children:e.jsxs(n.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.28},className:"etaps-glass rounded-3xl p-5 md:p-8",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"text-[11px] uppercase tracking-widest text-white/50",children:"Phone number *"}),e.jsxs("div",{className:"mt-1.5 flex items-center rounded-xl bg-white/5 border border-white/10 focus-within:border-[var(--violet)] overflow-hidden",children:[e.jsxs("span",{className:"flex items-center gap-1.5 pl-3.5 pr-3 py-2.5 border-r border-white/10 text-sm text-white/80 shrink-0",children:[e.jsx("span",{className:"text-base leading-none",children:"🇵🇰"})," +92"]}),e.jsx("input",{type:"tel",required:!0,autoComplete:"tel",placeholder:"3xx xxxxxxx",value:v,onChange:t=>J(t.target.value),className:"flex-1 min-w-0 bg-transparent px-3 py-2.5 text-sm text-white placeholder:text-white/30 focus:outline-none"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-white/85 font-medium mb-5",children:[e.jsx(V,{className:"h-4 w-4 text-[var(--gold)]"})," Choose a date"]}),z?e.jsxs("div",{className:"flex items-center justify-center text-white/50 gap-2 py-14",children:[e.jsx(T,{className:"h-4 w-4 animate-spin"})," Loading availability…"]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("button",{type:"button",onClick:()=>j(t=>Math.max(0,t-1)),disabled:d===0,className:"h-8 w-8 rounded-full border border-white/10 hover:border-white/30 disabled:opacity-30 flex items-center justify-center text-white/70",children:e.jsx(W,{className:"h-4 w-4"})}),e.jsxs("span",{className:"text-xs text-white/45",children:[(_=c[0])==null?void 0:_.label," ",c.length>1?`– ${(C=c[c.length-1])==null?void 0:C.label}`:""]}),e.jsx("button",{type:"button",onClick:()=>j(t=>Math.min(k,t+1)),disabled:d>=k,className:"h-8 w-8 rounded-full border border-white/10 hover:border-white/30 disabled:opacity-30 flex items-center justify-center text-white/70",children:e.jsx(H,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"grid grid-cols-5 gap-2",children:c.map(t=>{const l=t.date===r,s=t.slots.some(E=>E.available);return e.jsxs("button",{type:"button",disabled:!s,onClick:()=>{g(t.date),y(null)},className:`rounded-xl py-3 text-center transition-all ${l?"bg-gradient-to-br from-[var(--violet)] to-[var(--indigo)] text-white shadow-[0_10px_30px_-10px_var(--violet)]":"bg-white/[0.03] border border-white/10 text-white/75 hover:border-white/25"} ${s?"":"opacity-30 cursor-not-allowed"}`,children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider opacity-70",children:t.weekday}),e.jsx("div",{className:"mt-1 text-sm font-semibold",children:t.label})]},t.date)})}),e.jsxs("div",{className:"mt-7 flex items-center gap-2 text-white/85 font-medium",children:[e.jsx(Y,{className:"h-4 w-4 text-[var(--gold)]"})," Available times",e.jsx("span",{className:"text-xs text-white/40 font-normal",children:"(PKT)"})]}),e.jsx("div",{className:"mt-3 grid grid-cols-3 sm:grid-cols-4 gap-2",children:((u==null?void 0:u.slots)||[]).map(t=>{const l=o===t.time;return e.jsx("button",{type:"button",disabled:!t.available,onClick:()=>y(t.time),className:`py-2.5 rounded-xl text-sm font-medium transition-all ${l?"bg-white text-[var(--bg)] shadow-[0_8px_24px_-8px_rgba(255,255,255,0.4)]":"bg-white/[0.03] border border-white/10 text-white/85 hover:border-white/25"} ${t.available?"":"opacity-30 line-through cursor-not-allowed"}`,children:I(t.time)},t.time)})})]}),e.jsx("button",{type:"submit",disabled:!b||p,className:"etaps-btn-primary w-full mt-7 inline-flex items-center justify-center gap-2 px-6 py-3.5 rounded-full text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed transition-opacity",children:p?e.jsxs(e.Fragment,{children:[e.jsx(T,{className:"h-4 w-4 animate-spin"})," Booking…"]}):b?e.jsxs(e.Fragment,{children:["Confirm Booking ",e.jsx(D,{className:"h-4 w-4"})]}):"Select a date, time & phone to continue"}),e.jsx("p",{className:"text-[11px] text-white/40 text-center mt-3",children:"A calendar invite is sent on confirmation. No spam, ever."})]})})})})]})}export{he 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.