1import{h as p,r as o,t as g,f as d,J as h,j as e,L as i,g as b}from"./index-CCj0ga3e.js";import{u as y}from"./useServerFn-B1wyxN8L.js";import{a as j}from"./public.functions-DNCfiw2-.js";import{f as l}from"./time-CZYeOens.js";import{l as _}from"./legacy-golf-liability.pdf.asset-D151JGwv.js";import{C as v}from"./circle-check-Mtas-ONr.js";import{P as k}from"./phone-ShGIEXPz.js";function B(){const r=p({from:"/golf-simulator/booking-confirmation"}),n=y(j),[t,u]=o.useState(null),[c,m]=o.useState(null);if(o.useEffect(()=>{if(!r.c||!r.e){m("Missing confirmation details.");return}n({data:{confirmationNumber:r.c,email:r.e}}).then(s=>u(s.booking)).catch(s=>m(s?.message??"Booking not found."))},[r.c,r.e,n]),o.useEffect(()=>{if(!t?.confirmation_number)return;const s=`golf_paid:${t.confirmation_number}`;try{if(sessionStorage.getItem(s))return;sessionStorage.setItem(s,"1")}catch{}g("golf_paid",{valueCents:t.total_cents??0,referenceType:"golf_booking",referenceId:t.id??t.confirmation_number,metadata:{payment_status:t.payment_status,duration_minutes:t.duration_minutes,party_size:t.party_size}}),d("Purchase",{value:(t.total_cents??0)/100,currency:"USD",content_type:"product",content_name:"Golf Simulator Booking",content_ids:[t.confirmation_number]}),d("Purchase",{value:(t.total_cents??0)/100,currency:"USD",content_type:"product",content_name:"Golf Simulator Booking",content_ids:[t.confirmation_number]},{pixelId:h})},[t]),c)return e.jsxs("div",{className:"pt-32 pb-24 text-center",children:[e.jsx("p",{className:"text-sm text-destructive-foreground",children:c}),e.jsx(i,{to:"/golf-simulator",className:"mt-4 inline-block text-xs uppercase tracking-[0.2em] text-gold",children:"Back to golf simulator"})]});if(!t)return e.jsx("div",{className:"pt-32 pb-24 text-center text-muted-foreground",children:"Loadingâ¦"});const x=l(t.start_datetime,{dateStyle:"full",timeStyle:"short"}),f=l(t.end_datetime,{timeStyle:"short"});return e.jsx("div",{className:"pt-28 pb-24",children:e.jsxs("div",{className:"mx-auto max-w-2xl px-6 lg:px-10",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(v,{className:"mx-auto h-14 w-14 text-gold"}),e.jsx("h1",{className:"mt-4 font-display text-4xl text-cream md:text-5xl",children:"Booking confirmed"}),e.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"Confirmation number"}),e.jsx("p",{className:"mt-1 font-display text-2xl text-gold tracking-widest",children:t.confirmation_number})]}),e.jsx("div",{className:"mt-8 rounded-sm border border-border/60 bg-card/50 p-6",children:e.jsxs("dl",{className:"grid gap-3 text-sm",children:[e.jsx(a,{k:"Simulator",v:t.resource?.name??"â"}),e.jsx(a,{k:"When",v:`${x} â ${f}`}),e.jsx(a,{k:"Duration",v:`${t.duration_minutes} minutes`}),e.jsx(a,{k:"Party",v:String(t.party_size)}),e.jsx(a,{k:"Guest",v:`${t.customer?.first_name} ${t.customer?.last_name}`}),e.jsx(a,{k:"Total",v:`$${(t.total_cents/100).toFixed(2)}`}),e.jsx(a,{k:"Payment",v:t.payment_status==="pay_at_venue"?"Pay at the venue on arrival":t.payment_status==="paid"?"Paid":t.payment_status})]})}),e.jsxs("div",{className:"mt-6 rounded-sm border border-border/60 bg-card/50 p-6",children:[e.jsx("p",{className:"eyebrow",children:"Arrival"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Please arrive 10 minutes before your start time. Check in with the front desk and mention your confirmation number."}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-4 text-sm text-cream",children:[e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(b,{className:"h-4 w-4 text-gold"})," ",t.resource?.location??"Legacy Lounge, Charleston, SC"]}),e.jsxs("a",{href:"tel:8435551234",className:"inline-flex items-center gap-2 hover:text-gold",children:[e.jsx(k,{className:"h-4 w-4 text-gold"})," Call the lounge"]})]})]}),e.jsxs("div",{className:"mt-6 rounded-sm border border-border/60 bg-card/50 p-6",children:[e.jsx("p",{className:"eyebrow",children:"Cancellation"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Cancel or reschedule at least 24 hours before your start time for a full refund. After that, cancellations are non-refundable."})]}),t.liability_agreed&&e.jsxs("div",{className:"mt-6 rounded-sm border border-border/60 bg-card/50 p-6",children:[e.jsx("p",{className:"eyebrow",children:"Liability & Damage Agreement"}),e.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["You accepted the Legacy Golf Simulator Liability & Damage Agreement on"," ",t.liability_accepted_at?l(t.liability_accepted_at,{dateStyle:"medium",timeStyle:"short"}):"file",". Keep a copy for your records."]}),e.jsx("a",{href:_.url,target:"_blank",rel:"noopener noreferrer",className:"mt-3 inline-block text-xs uppercase tracking-[0.2em] text-gold hover:underline",children:"Download signed agreement (PDF) â"})]}),e.jsxs("div",{className:"mt-8 flex flex-wrap justify-center gap-3",children:[e.jsx("button",{onClick:()=>window.print(),className:"rounded-sm border border-border/60 px-5 py-2 text-xs uppercase tracking-[0.2em] text-cream hover:border-gold hover:text-gold",children:"Print"}),e.jsx(i,{to:"/golf-simulator/manage-booking",className:"rounded-sm border border-border/60 px-5 py-2 text-xs uppercase tracking-[0.2em] text-cream hover:border-gold hover:text-gold",children:"Manage booking"}),e.jsx(i,{to:"/",className:"rounded-sm bg-gradient-gold px-5 py-2 text-xs uppercase tracking-[0.2em] text-primary-foreground",children:"Done"})]})]})})}function a({k:r,v:n}){return e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("dt",{className:"text-muted-foreground",children:r}),e.jsx("dd",{className:"text-cream",children:n})]})}export{B as component};
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.