1import{a,j as e}from"./vendor-query-B-_nDQQY.js";import{c as V}from"./vendor-react-BUIlT3ms.js";import{C as l,c as n,M as z,a as x,d as u,n as S,q as i,I as o,m as L,h as Q,i as G,j as H,k as O,l as b,B as J,t as h,b as C}from"./index-D8ww6b7J.js";import{T as K}from"./textarea-Bhj0eADY.js";import{R as U}from"./ruler-Bcj6zKuq.js";import{M as X}from"./message-circle-Cg6XlpSC.js";import{C as T}from"./calendar-days-B-0UCuni.js";import{S as _}from"./spray-can-C63-dKVE.js";import{C as k}from"./circle-check-BXjz6L8_.js";import{C as P}from"./credit-card-CDUARo9S.js";import{P as $}from"./phone-CA5yr35z.js";import{S as Z}from"./shield-check-BAeEGIHA.js";import"./vendor-three-1K-S22da.js";import"./vendor-charts-i-522T5A.js";import"./vendor-pdf-Bwkk3Ew0.js";import"./vendor-radix-X0WMATEu.js";const A=[{id:"measurement",label:"Measurement Appointment",icon:U,desc:"We come to your home to measure"},{id:"consultation",label:"Showroom Consultation",icon:X,desc:"Visit our showroom, see materials"},{id:"quote",label:"Get a Quote",icon:T,desc:"Quick quote from your measurements"},{id:"sealing",label:"Stone Sealing Service",icon:_,desc:"Professional natural stone sealing â $199",price:199,badge:"Popular"}];function ge(){const[q]=V(),[r,v]=a.useState("");a.useEffect(()=>{const s=q.get("type");s&&A.find(t=>t.id===s)&&v(s)},[]);const[c,B]=a.useState(""),[p,D]=a.useState(""),[d,E]=a.useState(""),[g,M]=a.useState(""),[m,R]=a.useState(""),[j,Y]=a.useState(""),[f,W]=a.useState(""),[N,y]=a.useState(!1),[I,w]=a.useState(!1),F=async()=>{var s;if(!c||!d){h.error("Please fill in your name and phone at minimum");return}if(!r){h.error("Please select a service");return}y(!0);try{if(r==="sealing"){const t=await C.functions.invoke("handleSealingBooking",{customer_name:c,customer_email:p,customer_phone:d,customer_address:g,preferred_date:m,preferred_time:j,notes:f});(s=t==null?void 0:t.data)!=null&&s.success?w(!0):h.error("Something went wrong. Please try again.")}else await C.entities.Lead.create({customer_name:c,customer_email:p,customer_phone:d,source:"website",status:"new",notes:`Booking: ${r}. Date: ${m} ${j}. Address: ${g}. ${f}`,follow_up_date:m||void 0}),w(!0)}catch{h.error("Something went wrong. Please try again.")}finally{y(!1)}};if(I){const s=r==="sealing";return e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-background to-muted/20 flex items-center justify-center p-4",children:e.jsxs(l,{className:"max-w-md w-full text-center p-8 shadow-xl",children:[e.jsx("div",{className:`w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4 ${s?"bg-amber-100":"bg-green-100"}`,children:s?e.jsx(_,{className:"w-8 h-8 text-amber-600"}):e.jsx(k,{className:"w-8 h-8 text-green-600"})}),e.jsx(n,{className:"text-xl mb-2",children:s?"Sealing Request Submitted!":"Booking Requested!"}),s?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Your sealing appointment is pending approval. We'll review your request and send a payment link of ",e.jsx("strong",{children:"$199"})," within 24 hours."]}),e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-3 text-left space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-amber-800",children:[e.jsx(P,{className:"w-4 h-4"})," Next Steps"]}),e.jsxs("ol",{className:"text-xs text-amber-700 space-y-1 list-decimal list-inside",children:[e.jsx("li",{children:"We review your appointment request"}),e.jsx("li",{children:"You receive a payment link via email"}),e.jsx("li",{children:"Complete payment to confirm your slot"}),e.jsx("li",{children:"Appointment is confirmed â we'll see you then!"})]})]})]}):e.jsx("p",{className:"text-muted-foreground text-sm",children:"We'll confirm your appointment within 24 hours. You'll get a text/email once confirmed."}),e.jsxs("div",{className:"mt-4 flex items-center justify-center gap-3 text-xs text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx($,{className:"w-3 h-3"})," (555) 000-0000"]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(z,{className:"w-3 h-3"})," [email protected]"]})]})]})})}return e.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-background to-muted/20",children:[e.jsx("div",{className:"bg-card/80 backdrop-blur border-b sticky top-0 z-10",children:e.jsxs("div",{className:"max-w-xl mx-auto px-4 py-4 text-center",children:[e.jsx("h1",{className:"font-bold text-xl",children:"Book an Appointment"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Schedule a measurement, consultation, or quote"})]})}),e.jsxs("div",{className:"max-w-xl mx-auto px-4 py-8 space-y-6",children:[e.jsxs(l,{className:"shadow-lg",children:[e.jsx(x,{children:e.jsx(n,{className:"text-lg",children:"What can we help with?"})}),e.jsx(u,{className:"space-y-3",children:A.map(s=>{const t=s.icon;return e.jsxs("button",{onClick:()=>v(s.id),className:`w-full p-4 rounded-xl border-2 text-left flex items-start gap-3 transition-all ${r===s.id?"border-primary bg-primary/5":"border-border hover:border-primary/30"}`,children:[e.jsx("div",{className:`p-2 rounded-lg ${r===s.id?"bg-primary/10":"bg-muted"}`,children:e.jsx(t,{className:"w-5 h-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-sm",children:s.label}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s.desc})]})]},s.id)})})]}),r==="sealing"&&e.jsxs(l,{className:"shadow-lg border-amber-200 bg-amber-50/50",children:[e.jsx(x,{children:e.jsxs(n,{className:"text-lg flex items-center gap-2",children:[e.jsx(Z,{className:"w-5 h-5 text-amber-600"}),"Professional Stone Sealing â $199"]})}),e.jsx(u,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"Natural stone countertops need periodic sealing to prevent stains and maintain their beauty. Our professional sealing service includes:"}),e.jsx("ul",{className:"space-y-2 text-sm",children:["Deep clean of all stone surfaces","Premium penetrating sealer application","Edge and seam treatment","Full wipe-down and polish","1-year protection guarantee"].map((s,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(k,{className:"w-4 h-4 text-green-500 mt-0.5 shrink-0"}),e.jsx("span",{children:s})]},t))}),e.jsxs("div",{className:"bg-white rounded-lg p-3 border border-amber-200 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-lg",children:"$199"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Flat rate per visit"})]}),e.jsxs("div",{className:"text-right text-xs text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(P,{className:"w-3 h-3"})," Payment link sent after booking"]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(S,{className:"w-3 h-3"})," ~1.5 hours"]})]})]}),e.jsx("p",{className:"text-xs text-amber-700 bg-amber-100 rounded-lg p-2",children:"After submitting, we'll review and send you a secure payment link. Your appointment is confirmed once payment is received."})]})})]}),e.jsxs(l,{className:"shadow-lg",children:[e.jsx(x,{children:e.jsx(n,{className:"text-lg",children:"Your Details"})}),e.jsxs(u,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(i,{children:"Full Name *"}),e.jsx(o,{value:c,onChange:s=>B(s.target.value),placeholder:"Your name"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(i,{children:"Phone *"}),e.jsx(o,{value:d,onChange:s=>E(s.target.value),placeholder:"(555) 123-4567"})]}),e.jsxs("div",{children:[e.jsx(i,{children:"Email"}),e.jsx(o,{value:p,onChange:s=>D(s.target.value),type:"email",placeholder:"[email protected]"})]})]}),e.jsxs("div",{children:[e.jsxs(i,{className:"flex items-center gap-1",children:[e.jsx(L,{className:"w-3 h-3"})," Address"]}),e.jsx(o,{value:g,onChange:s=>M(s.target.value),placeholder:"Your home address"})]})]})]}),e.jsxs(l,{className:"shadow-lg",children:[e.jsx(x,{children:e.jsxs(n,{className:"text-lg flex items-center gap-2",children:[e.jsx(S,{className:"w-5 h-5 text-primary"}),"Preferred Time"]})}),e.jsxs(u,{children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(i,{children:"Date"}),e.jsx(o,{type:"date",value:m,onChange:s=>R(s.target.value)})]}),e.jsxs("div",{children:[e.jsx(i,{children:"Time"}),e.jsxs(Q,{value:j,onValueChange:Y,children:[e.jsx(G,{children:e.jsx(H,{placeholder:"Select time"})}),e.jsxs(O,{children:[e.jsx(b,{value:"morning",children:"Morning (8am-12pm)"}),e.jsx(b,{value:"afternoon",children:"Afternoon (12pm-4pm)"}),e.jsx(b,{value:"evening",children:"Evening (4pm-6pm)"})]})]})]})]}),e.jsxs("div",{className:"mt-4",children:[e.jsx(i,{children:"Additional Notes"}),e.jsx(K,{value:f,onChange:s=>W(s.target.value),placeholder:"Anything we should know...",className:"mt-1"})]})]})]}),e.jsxs(J,{className:"w-full",size:"lg",onClick:F,disabled:N,children:[N?"Submitting...":r==="sealing"?"Request Sealing Appointment â $199":"Request Appointment",!N&&e.jsx(T,{className:"w-4 h-4 ml-2"})]}),e.jsxs("p",{className:"text-center text-xs text-muted-foreground",children:[e.jsx($,{className:"w-3 h-3 inline"})," Prefer to call? (555) 000-0000"]})]})]})}export{ge 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.