import{j as e,L as ln,r as u,f as Ct,e as St,u as nt,b as fe,a as Vr,k as zr}from"./vendor-react-DgEFbQIi.js";import{aG as Wn,b6 as Ur,b7 as Wr,b8 as Yr,N as Tt,v as Fs,bl as Qr,bm as Kr,bn as Jr,bo as on,a as ue,aX as Zr,aW as Xr,aY as Mt,bp as ea,b9 as Es,ba as $e,B as Z,bq as Bs,br as Gs,bs as sa,bt as ta,aO as na,a2 as us,bu as ra,bv as aa,bw as cn,bx as ia,by as la,bz as oa,bA as ca,G as vs,aL as Ee,b3 as Hs,b4 as Vs,_ as ze,u as kt,aw as es,ax as ss,aM as ts,ah as ns,ai as rs,bB as Ue,L as xe,bC as da,bD as ua,bE as ma,bF as xa,bG as Yn,bH as Qn,bI as Kn,bJ as Jn,bK as Zn,bL as Xn,bM as er,bc as sr,C as ha,j as pa,R as fa,X as It,be as ga,b1 as ba,bf as ja,z as ya,T as At,y as Na,bN as va,f as he,o as wa,q as Ca,aZ as Sa,bO as zs,bi as Ta,bP as Ma,I as ms,b2 as Us,a$ as ka,b0 as Ia,bQ as Aa,k as dn,x as Ea,A as La,V as Ra,aN as $a,U as ct,Z as dt,bh as qa,S as se}from"./index-DFVuS8SP.js";import{P as _a,c as tr,S as Da}from"./badges-B7hHNwsz.js";import{A as Oa,M as Pa,b as Fa,a as Ba}from"./vendor-maps-bOuA10hf.js";import{r as Ga,g as Ha,s as Va}from"./wishlists-NNbira8h.js";import"./vendor-amplify-BBi2B1tW.js";import{A as Se,B as za,C as me,D as Ua,P as Wa,u as Ya,r as Qa,F as Ws,i as Ys,c as ps,b as un,m as nr,j as ut,s as Qs,o as Ks,n as Ka,p as Et,a as Ja,d as Za,T as gt,L as Xa,k as ei,E as si,G as ti,V as ni,S as rr,g as Lt,f as ar,H as ir,h as lr,t as or,w as ri,q as ai,e as ii,x as li,y as oi,z as ci}from"./useDwellTracking-BUncROAZ.js";import{p as di}from"./listingSlug-DQN33ZKR.js";import{i as Js,I as cr,q as dr,a as bt,f as ur,L as ui,v as mi,u as xi,b as hi,c as pi}from"./index-BLTxsKAB.js";import{g as fi}from"./listing-utils-CICni2H8.js";import{a as mt,c as mr,h as rt,s as mn}from"./listingBookingMode-C1OKcUc5.js";import{g as gi,D as Rt,h as xr}from"./cancellationPolicy-CHNl_QUB.js";import{a as bi}from"./apiErrors-C7dfUGUr.js";import{i as as}from"./serviceEventLocation-BFeOjzcJ.js";import{M as ds,t as We,g as ji,a as at,c as xn,d as hn,m as yi,v as $t}from"./availability-uF5JIR8q.js";import{p as Zs}from"./parseISO-C4sM-PC7.js";import{u as hr}from"./usePendingBooking-KaX_YIhO.js";import{D as fs,T as Xs}from"./time-picker-CVBYk6mZ.js";import"./confetti.module-B5JVzsfH.js";import{A as pr,m as et}from"./vendor-motion-CzLrDd6y.js";import{C as jt}from"./calendar-7-ncaX7W.js";import{C as Je}from"./circle-check-DeY5-glE.js";import{b as Ni}from"./timelineDisplayUtils-D9E_h4yD.js";import{E as st}from"./EventAddressAutocomplete-BzvAP_c0.js";import{u as vi,a as wi,D as Ci,c as Si,S as Ti,v as Mi,b as ki,P as Ii,d as Ai}from"./sortable.esm-aFxFGYrb.js";import{f as Ei}from"./currency-C8Hrf0Fq.js";import{G as Li}from"./grip-vertical-CxwILq1z.js";import{e as fr}from"./charterEventLocation-BT_MWlQx.js";import{a as Ri,i as Ds}from"./claimRequests-54T7aAUE.js";import{I as Ns}from"./ImageWithFallback-C1HTj5IA.js";import{B as ke}from"./badge-EX7nx8Gi.js";import{C as $i}from"./clock-3-iQSrDlwG.js";import{S as qi}from"./shield-C1NFLCbG.js";import{S as qt}from"./star-C0MTo9W6.js";import{C as _i}from"./circle-alert-CyMIT59o.js";import{g as Di,f as pn}from"./timeDisplay-CqrwEP8R.js";import{B as gr}from"./badge-check-D5e4IH5i.js";import{i as fn}from"./listing-B0peEtEB.js";import{B as gn}from"./briefcase-C1c67ONC.js";import{A as Oi}from"./award-Cof2NZRE.js";import{M as Pi}from"./message-circle-DUsZlt4V.js";import{C as Fi}from"./CustomQuoteRequestModal-B1AxAMjE.js";import{u as Bi}from"./useSeo-eyKuqwK1.js";import{u as Gi}from"./prerenderSignal-6UTp3gVc.js";import{C as bn}from"./calendar-clock-BxCwcoDz.js";import"./vendor-radix-kdo0k_bv.js";import"./authHeaders-C650O0HP.js";import"./link-2-BCZlQqmz.js";import"./pencil-hVBxHOIk.js";import"./parse-DWUfxhsp.js";import"./copy-Bg4Oavyf.js";import"./send-CbUVXki9.js";import"./parseTwoModelBreakdown-C0mm51kj.js";import"./types-B9GuC8gc.js";import"./timeUtils-J6UVSYhu.js";import"./calendar-days-CNTt1Q2P.js";/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Hi=Wn("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vi=Wn("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);function zi(s,t=14){const n={size:t,strokeWidth:2.5};switch(s){case"plec_featured":return e.jsx(Fs,{...n});case"hosting_since":return e.jsx(jt,{...n});case"new":return e.jsx(Fs,{...n});case"travels_to_you":return e.jsx(Hi,{...n});case"licensed_insured":return e.jsx(Tt,{...n});default:return null}}function Ui(s,t,n){const a=`inline-flex items-center rounded-full font-medium transition-all ${{sm:"px-2 py-0.5 gap-1 text-xs",md:"px-2.5 py-1 gap-1.5 text-sm",lg:"px-3 py-1.5 gap-2 text-base"}[n]}`;if(t==="plec_featured")return`${a} bg-gradient-to-r from-amber-500 to-orange-500 text-white shadow-sm`;switch(s){case"plec":return`${a} bg-blue-50 text-blue-700 ring-1 ring-blue-200/50`;case"status":return t==="new"?`${a} bg-purple-50 text-purple-700 ring-1 ring-purple-200/50`:`${a} bg-amber-50 text-amber-700 ring-1 ring-amber-200/50`;case"feature":return`${a} bg-slate-50 text-slate-700 ring-1 ring-slate-200/50`;default:return`${a} bg-gray-50 text-gray-700 ring-1 ring-gray-200/50`}}function Wi({badge:s,size:t="sm",variant:n="default"}){const r=t==="sm"?13:t==="md"?14:16,a=zi(s.type,r),i=Ui(s.category,s.type,t);if(n==="compact"){const l=i.split(" ").filter(m=>!m.startsWith("px-")&&!m.startsWith("py-")&&!m.startsWith("gap-")).join(" ");return e.jsxs(Ur,{children:[e.jsx(Wr,{asChild:!0,children:e.jsx("div",{className:`${l} p-1.5 flex items-center justify-center`,"aria-label":s.label,children:a})}),e.jsx(Yr,{side:"bottom",sideOffset:4,children:e.jsx("p",{className:"text-xs",children:s.label})})]})}return e.jsxs("div",{className:i,children:[a,e.jsx("span",{children:s.label})]})}function Yi({badges:s,maxVisible:t=3,size:n="sm",variant:r="default"}){const a=s.slice(0,t),i=s.length-t;return e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[a.map((l,m)=>e.jsx(Wi,{badge:l,size:n,variant:r},`${l.type}-${m}`)),i>0&&e.jsxs("div",{className:`inline-flex items-center rounded-full bg-gray-100 text-gray-600 ring-1 ring-gray-200/50 ${n==="sm"?"px-2 py-0.5 text-xs":n==="md"?"px-2.5 py-1 text-sm":"px-3 py-1.5 text-base"}`,children:["+",i]})]})}const br=({badges:s,maxDisplay:t,className:n,variant:r="default"})=>{const a=t?s.slice(0,t):s;if(a.length===0)return null;const i=(n!=null&&n.includes("text-[9px]"),"sm");return e.jsx("div",{className:n,children:e.jsx(Yi,{badges:a,maxVisible:t||3,size:i,variant:r})})};function Qi(s,t,n){const r=Qr(s,t)/Kr;return Jr(n==null?void 0:n.roundingMethod)(r)}const xs=24*60,Ki=6*60,qs=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function jn(s){if(typeof s!="string")return null;const[t,n]=s.split(":").map(Number);return!Number.isFinite(t)||!Number.isFinite(n)||t<0||t>23||n<0||n>59?null:t*60+n}function yn(s){const t=(s%xs+xs)%xs;return`${String(Math.floor(t/60)).padStart(2,"0")}:${String(t%60).padStart(2,"0")}`}function Ji(s){return!s||s.enabled!==!0?[]:Array.isArray(s.windows)&&s.windows.length>0?s.windows.filter(t=>typeof(t==null?void 0:t.from)=="string"&&typeof(t==null?void 0:t.to)=="string"):typeof s.from=="string"&&typeof s.to=="string"?[{from:s.from,to:s.to}]:[]}function xt(s,t){const n=s.find(i=>(i==null?void 0:i.day)===t),r=Ji(n).map(i=>{const l=jn(i.from),m=jn(i.to);return l==null||m==null||l===m?null:{start:l,end:m<l?xs+m:m}}).filter(i=>i!=null).sort((i,l)=>i.start-l.start),a=[];for(const i of r){const l=a[a.length-1];if(l&&i.start<=l.end){l.end=Math.max(l.end,i.end);continue}a.push({...i})}return a}function Nn(s,t){const n=qs.indexOf(s??"");return n<0?"":qs[(n+t+qs.length)%qs.length]}function vn(s){const t=s[0];return!t||t.start!==0?null:t.end<=Ki?t:null}function wn(s){return s.findIndex(t=>t.end===xs)}function Zi(s,t){const n=xt(s,t),r=xt(s,Nn(t,-1));let a=vn(n)&&wn(r)>=0?n.slice(1):n;const i=vn(xt(s,Nn(t,1))),l=wn(a);return i&&l>=0&&(a=a.map((m,b)=>b===l?{start:m.start,end:xs+i.end}:m)),a.map(m=>({from:yn(m.start),to:yn(m.end),endsNextDay:m.end>xs}))}const Xi=({schedule:s,availability:t,isMobile:n})=>{const r=Di(t==null?void 0:t.timezone),a=i=>Zi(s,(i==null?void 0:i.day)??"").map(l=>`${pn(l.from)} to ${pn(l.to)}${l.endsNextDay?" (next day)":""}`);return n?e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Availability & scheduling"}),t.bookingWindowDays&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["Book up to ",t.bookingWindowDays," days in advance"]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["All times shown in ",r]})]}),e.jsxs("div",{className:"overflow-hidden rounded-2xl border border-border/70 bg-white shadow-sm",children:[e.jsx("div",{className:"divide-y divide-border/80",children:s.length>0?s.map(i=>e.jsxs("div",{className:ue("flex items-center justify-between px-4 py-3 text-xs",i!=null&&i.enabled?"bg-white":"bg-muted/40 text-muted-foreground"),children:[e.jsx("span",{className:"font-medium text-gray-900",children:on[(i==null?void 0:i.day)??""]??(i==null?void 0:i.day)}),a(i).length>0?e.jsx("span",{className:"font-medium text-gray-800",children:a(i).join(", ")}):e.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Unavailable"})]},i==null?void 0:i.day)):e.jsx("div",{className:"px-4 py-4 text-xs text-muted-foreground",children:"The host is still finalizing weekly availability. Send an inquiry to confirm your ideal date."})}),e.jsxs("div",{className:"flex items-center justify-between bg-muted/40 px-4 py-3 text-[10px] text-muted-foreground",children:[e.jsxs("span",{children:["Minimum lead time:"," ",t.minimumLeadTimeHours?`${t.minimumLeadTimeHours} hours`:"Flexible"]}),e.jsx("span",{children:t.acceptsInstantBookings===!1?"Booking request required":"Instant booking"})]})]})]}):e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Availability & scheduling"}),t.bookingWindowDays&&e.jsxs("span",{className:"text-sm text-muted-foreground",children:["Book up to ",t.bookingWindowDays," days in advance"]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["All times shown in ",r]})]}),e.jsxs("div",{className:"overflow-hidden rounded-[28px] border border-border/70 bg-white shadow-sm",children:[e.jsx("div",{className:"divide-y divide-border/80",children:s.length>0?s.map(i=>e.jsxs("div",{className:ue("flex items-center justify-between px-6 py-4 text-sm",i!=null&&i.enabled?"bg-white":"bg-muted/40 text-muted-foreground"),children:[e.jsx("span",{className:"font-medium text-gray-900",children:on[(i==null?void 0:i.day)??""]??(i==null?void 0:i.day)}),a(i).length>0?e.jsx("span",{className:"font-medium text-gray-800",children:a(i).join(", ")}):e.jsx("span",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Unavailable"})]},i==null?void 0:i.day)):e.jsx("div",{className:"px-6 py-6 text-sm text-muted-foreground",children:"The host is still finalizing weekly availability. Send an inquiry to confirm your ideal date."})}),e.jsxs("div",{className:"flex items-center justify-between bg-muted/40 px-6 py-4 text-xs text-muted-foreground",children:[e.jsxs("span",{children:["Minimum lead time:"," ",t.minimumLeadTimeHours?`${t.minimumLeadTimeHours} hours`:"Flexible"]}),e.jsxs("span",{children:["Instant booking"," ",t.acceptsInstantBookings===!1?"off":"on"]})]})]})]})};function el(s){return s.priceType==="per_person"||s.priceType==="per_guest"}function jr(s){return Mt(s)}function ws(s){return Zr(s)}function sl(s){return ea(s)}function Ls(s){var n;const t=(n=s.guestLimit)==null?void 0:n.min;return typeof t!="number"||!Number.isFinite(t)||t<2?null:{minGuests:t,perGuest:el(s)?jr(s):null}}function Ke(s){if(!s)return null;const t=`Minimum ${s.minGuests} guest${s.minGuests===1?"":"s"}`,n=Xr(s.perGuest);return n?`${t} · ${n} per guest`:t}const tt="Priced at checkout",yr=({offerings:s,onViewDetails:t,onSelectPackage:n,isMobile:r})=>s.length===0?null:r?e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Available Packages"}),e.jsx("div",{className:"space-y-3",children:s.map(a=>{const i=Ke(Ls(a)),l=Se(ws(a));return e.jsx("button",{type:"button",onClick:()=>t(a),className:"w-full rounded-2xl border border-border/70 bg-white p-4 shadow-sm hover:border-brand/50 hover:shadow-md transition-all text-left",children:e.jsxs("div",{className:"flex gap-4",children:[a.image&&e.jsx("img",{src:a.image,alt:a.name,className:"h-20 w-20 rounded-xl object-cover flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-1 line-clamp-1",children:a.name}),e.jsxs("div",{className:"text-sm text-gray-900 mb-1.5",children:[e.jsxs("span",{className:"font-medium",children:[l??tt,l&&(a.priceType==="per_person"||a.priceType==="per_guest")?" / guest":"",l&&a.priceType==="per_hour"?" / hour":"",l&&(a.priceType==="per_event"||a.priceType==="fixed")?" / event":""]}),i&&e.jsxs("span",{className:"text-muted-foreground ml-1",children:["· ",i]})]}),a.description&&e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-1 min-w-0 break-words overflow-hidden",children:a.description}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"View Details →"})]})]})},a.id)})})]}):e.jsxs("section",{className:"space-y-6 min-w-0",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Packages & Offerings"}),e.jsx("div",{className:"space-y-6",children:s.map(a=>{var p,f,h,x,y,o;const i=Ke(Ls(a)),l=Se(ws(a)),m=((p=a.duration)==null?void 0:p.hours)??0,b=((f=a.duration)==null?void 0:f.minutes)??0,d=(m>0?`${m} hour${m>1?"s":""}`:"")+(m>0&&b>0?" ":"")+(b>0?`${b} minute${b>1?"s":""}`:""),c=(h=a.guestLimit)!=null&&h.min&&((x=a.guestLimit)!=null&&x.max)?`${a.guestLimit.min} - ${a.guestLimit.max} guests`:(y=a.guestLimit)!=null&&y.min?`${a.guestLimit.min}+ guests`:(o=a.guestLimit)!=null&&o.max?`Up to ${a.guestLimit.max} guests`:null;return e.jsx("div",{className:"rounded-2xl border border-border/70 bg-white p-6 shadow-sm hover:shadow-md transition-all",children:e.jsxs("div",{className:"flex gap-6 items-stretch",children:[a.image&&e.jsx("img",{src:a.image,alt:a.name,className:"h-48 w-48 rounded-xl object-cover flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col h-48",children:[e.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-1 break-words",children:a.name}),a.description&&e.jsx("p",{className:"text-sm text-gray-700 line-clamp-3 min-w-0 break-words overflow-hidden",children:a.description})]}),(c||d)&&e.jsxs("div",{className:"flex items-center gap-4 text-sm text-gray-600 flex-shrink-0 mt-1",children:[c&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Es,{className:"h-4 w-4 flex-shrink-0"}),e.jsx("span",{children:c})]}),d&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx($e,{className:"h-4 w-4 flex-shrink-0"}),e.jsx("span",{children:d})]})]}),e.jsxs("div",{className:"flex-shrink-0 mt-1 space-y-0.5",children:[e.jsxs("div",{className:"text-lg font-semibold text-gray-900",children:[l??tt,l&&e.jsxs("span",{className:"text-sm font-normal text-muted-foreground ml-1",children:[a.priceType==="per_person"||a.priceType==="per_guest"?"/ guest":"",a.priceType==="per_hour"?"/ hour":"",a.priceType==="per_event"||a.priceType==="fixed"?"/ event":""]})]}),i&&e.jsx("p",{className:"text-sm text-gray-600",children:i})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-auto pt-2",children:[e.jsx(Z,{variant:"outline",size:"sm",className:"rounded-full",onClick:()=>t(a),children:"View Details"}),e.jsx(Z,{size:"sm",className:"rounded-full bg-brand hover:bg-brand-600 text-white",onClick:()=>n(a),children:a.pricingMode==="negotiable_range"?"Request Quote":"Select Package"})]})]})]})},a.id)})})]});function Cn(s){if(!s||typeof s!="string")return s;const n=s.replace(/\*\*([^*]+?)\s+\*\*/g,"**$1**").replace(/\*([^*]+?)\s+\*/g,"*$1*").replace(/\*\*([^*]+?)\r?\n\s*\*\*/g,"**$1**").split(/\r?\n/),r=[];for(let a=0;a<n.length;a++){const i=n[a];/^\s*\*\*[^*]+\*\*\s*$/.test(i)&&a>0&&r.push("",""),r.push(i)}return r.join(`
`)}const Sn=/\*\*([^*]+)\*\*/g;function Tn(s){const t=[];let n=0,r=null,a;for(Sn.lastIndex=0;(a=Sn.exec(s))!==null;){const i=s.slice(n,a.index).trim();(i||r!==null)&&t.push({boldHeading:r,rest:i}),r=a[1].trim(),n=a.index+a[0].length}return(n<s.length||r!==null)&&t.push({boldHeading:r,rest:s.slice(n).trim()}),t.length>0?t:[{boldHeading:null,rest:s}]}const Mn="prose prose-sm max-w-none text-gray-700 break-words prose-p:my-2 prose-ul:my-2 prose-ol:my-2 prose-strong:font-semibold prose-strong:text-gray-900",kn={ul:({children:s})=>e.jsx("ul",{className:"list-disc pl-6 my-2 space-y-0.5",children:s}),ol:({children:s})=>e.jsx("ol",{className:"list-decimal pl-6 my-2 space-y-0.5",children:s}),li:({children:s})=>e.jsx("li",{className:"pl-1",children:s})},tl=({hostDisplayName:s,serviceName:t,serviceTypeInfo:n,hostAvatar:r,hostPublicId:a,onMessageClick:i,aboutMe:l,serviceType:m,serviceData:b,verified:d=!1,isMobile:c})=>{var h;const p=Array.isArray(l.certifications)&&l.certifications.length>0,{hasAnySocial:f}=za(l);return!l.experience&&!l.qualifications&&!l.yearsOfExperience&&!p&&!s&&!f?null:c?e.jsxs("section",{className:"space-y-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900",children:["About ",t.split(" ")[t.split(" ").length-1]||t.split(" ")[0]]}),e.jsxs("div",{className:"space-y-3",children:[l.experience&&(()=>{const x=Cn(l.experience),y=Tn(x);return e.jsxs("div",{className:"rounded-2xl border border-border/70 bg-white p-4 shadow-sm",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-2",children:"Experience"}),e.jsx("div",{className:`space-y-4 ${Mn}`,children:y.map((o,E)=>e.jsxs("div",{className:"experience-block block w-full mt-4 first:mt-0",style:{display:"block"},children:[o.boldHeading!=null&&e.jsx("div",{className:"font-semibold text-gray-900 my-2 block w-full",style:{display:"block"},children:o.boldHeading}),o.rest?e.jsx("div",{className:"block w-full",style:{display:"block"},children:e.jsx(Bs,{remarkPlugins:[Gs],components:kn,children:o.rest})}):null]},E))})]})})(),l.yearsOfExperience&&e.jsx("div",{className:"rounded-2xl border border-border/70 bg-white p-4 shadow-sm",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"grid h-8 w-8 place-items-center rounded-full bg-brand/10 text-brand flex-shrink-0",children:e.jsx(Je,{className:"h-4 w-4"})}),e.jsx("div",{className:"min-w-0",children:e.jsxs("h3",{className:"text-sm font-semibold text-gray-900",children:[l.yearsOfExperience," years of experience"]})})]})}),l.qualifications&&e.jsx("div",{className:"rounded-2xl border border-border/70 bg-white p-4 shadow-sm",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"grid h-8 w-8 place-items-center rounded-full bg-brand/10 text-brand flex-shrink-0",children:e.jsx(Je,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:"Qualifications"}),e.jsx("p",{className:"mt-1 text-xs text-gray-700 whitespace-pre-line break-words",children:l.qualifications})]})]})}),p&&e.jsx("div",{className:"flex flex-wrap gap-2",children:l.certifications.map((x,y)=>e.jsx(ke,{variant:"outline",className:"rounded-full text-xs",children:me(x)},y))}),f&&e.jsxs("div",{className:"rounded-2xl border border-border/70 bg-white p-4 shadow-sm",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-2",children:"Connect online"}),e.jsx(Ua,{social:l})]})]})]}):e.jsxs("section",{className:"space-y-6 min-w-0",children:[e.jsxs("h2",{className:"text-2xl font-semibold text-gray-900",children:["Meet your ",((h=n==null?void 0:n.label)==null?void 0:h.toLowerCase())||"service provider"]}),e.jsx("div",{className:"rounded-2xl border border-border/70 bg-white p-8 shadow-sm min-w-0 overflow-hidden",children:e.jsxs("div",{className:"grid gap-8 md:grid-cols-[200px_minmax(0,1fr)] min-w-0",children:[e.jsxs("div",{className:"space-y-4 min-w-0",children:[e.jsx("div",{className:"flex justify-center",children:a?e.jsx("a",{href:`/u/${a}`,target:"_blank",rel:"noopener noreferrer",className:"block w-fit focus:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2 rounded-full","aria-label":`View ${s||"provider"}'s profile`,children:e.jsx(Ns,{src:r||void 0,alt:s,className:"h-32 w-32 rounded-full object-cover ring-2 ring-border",fallback:"/default-profile-icon.png"})}):e.jsx(Ns,{src:r||void 0,alt:s,className:"h-32 w-32 rounded-full object-cover ring-2 ring-border",fallback:"/default-profile-icon.png"})}),e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:s||t.split(" ")[t.split(" ").length-1]||t.split(" ")[0]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:(n==null?void 0:n.label)||"Service Provider"})]}),d&&e.jsx("div",{className:"flex justify-center",children:e.jsxs(ke,{className:"rounded-full bg-brand/10 text-brand border-brand/20 px-3 py-1",children:[e.jsx(Je,{className:"mr-1.5 h-3.5 w-3.5"}),"Verified"]})}),e.jsxs("div",{className:"flex items-center justify-center gap-1 text-sm",children:[e.jsx(qt,{className:"h-4 w-4 fill-amber-400 text-amber-400"}),e.jsx("span",{className:"font-medium text-gray-900",children:"New"})]}),e.jsxs("div",{className:"pt-2 flex flex-col gap-2",children:[a&&e.jsx(Z,{variant:"outline",className:"w-full rounded-full",asChild:!0,children:e.jsx("a",{href:`/u/${a}`,target:"_blank",rel:"noopener noreferrer",children:"View profile"})}),i&&e.jsxs(Z,{variant:"outline",className:"w-full rounded-full",onClick:i,children:["Message ",s.split(" ")[0]]})]}),f&&e.jsxs("div",{className:"pt-4 border-t",children:[e.jsx("p",{className:"text-xs font-medium text-gray-500 mb-3 text-center",children:"Connect online"}),e.jsx(Wa,{social:l,className:"justify-center"})]})]}),e.jsxs("div",{className:"space-y-6 min-w-0",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Qualifications & Experience"}),e.jsxs("div",{className:"space-y-5",children:[l.experience&&(()=>{const x=Cn(l.experience),y=Tn(x);return e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"grid h-10 w-10 place-items-center rounded-full bg-brand/10 text-brand flex-shrink-0",children:e.jsx(gn,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-2",children:"About"}),e.jsx("div",{className:`space-y-4 ${Mn}`,children:y.map((o,E)=>e.jsxs("div",{className:"experience-block block w-full mt-4 first:mt-0",style:{display:"block"},children:[o.boldHeading!=null&&e.jsx("div",{className:"font-semibold text-gray-900 my-2 block w-full",style:{display:"block"},children:o.boldHeading}),o.rest?e.jsx("div",{className:"block w-full",style:{display:"block"},children:e.jsx(Bs,{remarkPlugins:[Gs],components:kn,children:o.rest})}):null]},E))})]})]})})(),l.yearsOfExperience&&e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"grid h-10 w-10 place-items-center rounded-full bg-brand/10 text-brand flex-shrink-0",children:e.jsx(sa,{className:"h-5 w-5"})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("h4",{className:"text-base font-semibold text-gray-900 mb-1",children:[l.yearsOfExperience," years of experience"]})})]}),l.qualifications&&e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"grid h-10 w-10 place-items-center rounded-full bg-brand/10 text-brand flex-shrink-0",children:e.jsx(ta,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-1",children:"Education and training"}),e.jsx("p",{className:"text-sm text-gray-700 leading-relaxed whitespace-pre-line break-words",children:l.qualifications})]})]}),p&&e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"grid h-10 w-10 place-items-center rounded-full bg-brand/10 text-brand flex-shrink-0",children:e.jsx(Oi,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-2",children:"Certifications"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:l.certifications.map((x,y)=>e.jsx(ke,{variant:"outline",className:"rounded-full text-xs",children:me(x)},y))})]})]}),e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"grid h-10 w-10 place-items-center rounded-full bg-brand/10 text-brand flex-shrink-0",children:e.jsx(gn,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-2",children:"Specialization"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[n&&e.jsx(ke,{variant:"secondary",className:"rounded-full px-3 py-1 text-xs bg-gray-100 text-gray-700 border-0",children:n.label}),m==="caterer"&&(b==null?void 0:b.catererServices)&&b.catererServices.length>0&&e.jsx(e.Fragment,{children:b.catererServices.slice(0,4).map((x,y)=>e.jsx(ke,{variant:"secondary",className:"rounded-full px-3 py-1 text-xs bg-gray-100 text-gray-700 border-0",children:me(x)},y))}),m==="dj"&&(b==null?void 0:b.djEquipment)&&b.djEquipment.length>0&&e.jsx(e.Fragment,{children:b.djEquipment.slice(0,4).map((x,y)=>e.jsx(ke,{variant:"secondary",className:"rounded-full px-3 py-1 text-xs bg-gray-100 text-gray-700 border-0",children:me(x)},y))})]})]})]})]})]})]})})]})};function Nr({listing:s,isMobile:t=!1}){const n=Ri(s),{data:r}=Ya(s==null?void 0:s.listingId,n);if(!n||!(s!=null&&s.listingId))return null;const a=`/service/${s.listingId}/claim`,l=!!r?e.jsxs(Z,{variant:"outline",size:"sm",className:"rounded-full",disabled:!0,children:[e.jsx($i,{className:"mr-2 h-4 w-4"}),"Request pending"]}):e.jsx(Z,{variant:"outline",size:"sm",className:"rounded-full border-brand bg-white text-brand hover:bg-brand/5 hover:text-brand",asChild:!0,children:e.jsx(ln,{to:a,children:"Claim listing"})});return e.jsxs("section",{id:"host",className:t?"rounded-2xl border border-border/70 bg-white p-4 shadow-sm":"rounded-2xl border border-border/70 bg-white p-6 shadow-sm",children:[e.jsx("h3",{className:t?"text-sm font-semibold text-gray-900":"text-lg font-semibold text-gray-900",children:"Is this your service?"}),e.jsxs("div",{className:"mt-2 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("p",{className:"text-xs leading-relaxed text-gray-600 sm:flex-1 sm:text-sm",children:"If you own or run this business, you can claim it to take control, fix details, or request its removal."}),e.jsx("div",{className:"shrink-0",children:l})]}),e.jsxs(ln,{to:"/listing-disclosure",className:"mt-3 inline-flex items-center gap-1.5 text-xs text-muted-foreground underline-offset-2 hover:underline",children:[e.jsx(na,{className:"h-3.5 w-3.5"}),"This listing was created by PLEC"]})]})}const nl=[{field:"cuisineTypes",label:"Cuisine"},{field:"serviceStyles",label:"Service styles"},{field:"dietaryAccommodations",label:"Dietary"},{field:"staffing",label:"Staffing"},{field:"eventSpecialization",label:"Event specialization"},{field:"additionalServices",label:"Additional services"},{field:"equipmentSetup",label:"Equipment & setup"},{field:"menuServices",label:"Menu services"},{field:"certifications",label:"Certifications"}],rl={monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday",sunday:"Sunday"},al={travels_to_you:"Travels to you",you_travel_to_them:"You travel to them",both:"Both"},vr=({serviceData:s,serviceType:t,isMobile:n})=>{var z,W,q,I;const r=s,a=r.businessHours,i=r.travelPolicy,l=r.djEquipment??[],m=r.catererServices??[],b=r.catererProfile??void 0,d=nl.map(T=>({...T,values:(b==null?void 0:b[T.field])??[]})).filter(T=>T.values.length>0),c=r.musicianData,p=(c==null?void 0:c.genres)??[],f=r.requirements,h=r.photographerData,x=r.videographerData,y=r.bartenderData,o=r.cleanerData,E=r.equipmentRentalData,V=a&&Object.keys(a).length>0&&Object.values(a).some(T=>T&&!T.closed),O=!!i,N=p.length>0,M=l.length>0,D=d.length>0,C=!D&&m.length>0,v=f&&(Array.isArray(f.licenses)&&f.licenses.length>0||f.insurance===!0||Array.isArray(f.certifications)&&f.certifications.length>0),R=h&&(Array.isArray(h.photoStyles)&&h.photoStyles.length>0||Array.isArray(h.eventTypes)&&h.eventTypes.length>0||h.secondShooterAvailable!=null||!!h.shootingLocation),_=x&&(Array.isArray(x.videoStyles)&&x.videoStyles.length>0||Array.isArray(x.eventTypes)&&x.eventTypes.length>0||Array.isArray(x.cameraTypes)&&x.cameraTypes.length>0||x.droneAvailable===!0),g=y&&(!!y.serviceType||Array.isArray(y.equipmentProvided)&&y.equipmentProvided.length>0),S=o&&(Array.isArray(o.cleaningTypes)&&o.cleaningTypes.length>0||!!o.teamSize||!!o.bringsOwnSupplies),k=E&&(Array.isArray(E.rentalCategories)&&E.rentalCategories.length>0||Array.isArray(E.addOnServices)&&E.addOnServices.length>0||E.providesSetup===!0||E.providesBreakdown===!0);if(!(V||O||N||M||C||D||v||R||_||g||S||k))return null;const H=n?"rounded-2xl border border-border/70 bg-white p-4 shadow-sm space-y-4":"rounded-2xl border border-border/70 bg-white p-6 shadow-sm space-y-6",A=n?"text-lg font-semibold text-gray-900":"text-xl font-semibold text-gray-900";return e.jsxs("section",{className:"space-y-6 min-w-0",children:[e.jsx("h2",{className:A,children:"Service details"}),e.jsxs("div",{className:H,children:[V&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-2",children:[e.jsx($e,{className:"h-4 w-4 text-muted-foreground"}),"Business hours"]}),e.jsx("ul",{className:"space-y-1.5 text-sm text-gray-700",children:Object.entries(a??{}).map(([T,j])=>e.jsxs("li",{className:"flex justify-between",children:[e.jsx("span",{children:rl[T]??T}),j!=null&&j.closed?e.jsx("span",{className:"text-muted-foreground",children:"Closed"}):e.jsxs("span",{children:[(j==null?void 0:j.open)??"—"," – ",(j==null?void 0:j.close)??"—"]})]},T))})]}),O&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-1",children:[e.jsx(us,{className:"h-4 w-4 text-muted-foreground"}),"Travel"]}),e.jsx("p",{className:"text-sm text-gray-700 break-words",children:al[i]??i})]}),N&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-2",children:[e.jsx(ra,{className:"h-4 w-4 text-muted-foreground"}),"Genres"]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:p.map(T=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:me(T)},T))})]}),M&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-2",children:[e.jsx(aa,{className:"h-4 w-4 text-muted-foreground"}),"Equipment & services"]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:l.map(T=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:me(T)},T))})]}),D&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-3",children:[e.jsx(cn,{className:"h-4 w-4 text-muted-foreground"}),"Catering capabilities"]}),e.jsx("div",{className:"space-y-3",children:d.map(T=>e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:T.label}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:T.values.map(j=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:me(j)},j))})]},T.field))})]}),C&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-2",children:[e.jsx(cn,{className:"h-4 w-4 text-muted-foreground"}),"Catering services"]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:m.map(T=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:me(T)},T))})]}),v&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-2",children:[e.jsx(qi,{className:"h-4 w-4 text-muted-foreground"}),"Requirements"]}),e.jsxs("div",{className:"space-y-2",children:[(z=f.licenses)!=null&&z.length?e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Licenses"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:f.licenses.map(T=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:me(T)},T))})]}):null,f.insurance===!0?e.jsx("span",{className:"inline-flex rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:"Insured"}):null,(W=f.certifications)!=null&&W.length?e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Certifications"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:f.certifications.map(T=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:me(T)},T))})]}):null]})]}),R&&h&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-2",children:[e.jsx(ia,{className:"h-4 w-4 text-muted-foreground"}),"Photography"]}),e.jsxs("div",{className:"space-y-2",children:[Array.isArray(h.photoStyles)&&h.photoStyles.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Styles"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:h.photoStyles.map(T=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:me(T)},T))})]}),Array.isArray(h.eventTypes)&&h.eventTypes.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Event types"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:h.eventTypes.map(T=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:me(T)},T))})]}),h.secondShooterAvailable===!0&&e.jsx("span",{className:"inline-flex rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:"Second shooter available"}),h.shootingLocation&&e.jsxs("p",{className:"text-sm text-gray-700",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Shooting location: "}),me(h.shootingLocation)]})]})]}),_&&x&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-2",children:[e.jsx(la,{className:"h-4 w-4 text-muted-foreground"}),"Videography"]}),e.jsxs("div",{className:"space-y-2",children:[Array.isArray(x.videoStyles)&&x.videoStyles.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Styles"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:x.videoStyles.map(T=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:me(T)},T))})]}),Array.isArray(x.eventTypes)&&x.eventTypes.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Event types"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:x.eventTypes.map(T=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:me(T)},T))})]}),Array.isArray(x.cameraTypes)&&x.cameraTypes.length>0||Array.isArray(x.lightingEquipment)&&x.lightingEquipment.length>0?e.jsxs("div",{className:"flex flex-wrap gap-2",children:[(q=x.cameraTypes)==null?void 0:q.map(T=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:me(T)},T)),(I=x.lightingEquipment)==null?void 0:I.map(T=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:me(T)},T))]}):null,x.droneAvailable===!0&&e.jsx("span",{className:"inline-flex rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:"Drone available"})]})]}),g&&y&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-2",children:[e.jsx(oa,{className:"h-4 w-4 text-muted-foreground"}),"Bartending"]}),e.jsxs("div",{className:"space-y-2",children:[y.serviceType&&e.jsxs("p",{className:"text-sm text-gray-700",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Service type: "}),me(y.serviceType)]}),Array.isArray(y.equipmentProvided)&&y.equipmentProvided.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Equipment provided"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:y.equipmentProvided.map(T=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:me(T)},T))})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[y.offersSignatureCocktails===!0&&e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:"Signature cocktails"}),y.offersCustomCocktailMenus===!0&&e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:"Custom menus"}),y.byobAllowed===!0&&e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:"BYOB allowed"}),y.providesAlcohol===!0&&e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:"Provides alcohol"})]})]})]}),S&&o&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-2",children:[e.jsx(ca,{className:"h-4 w-4 text-muted-foreground"}),"Cleaning"]}),e.jsxs("div",{className:"space-y-2",children:[Array.isArray(o.cleaningTypes)&&o.cleaningTypes.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Cleaning types"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:o.cleaningTypes.map(T=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:me(T)},T))})]}),Array.isArray(o.specializations)&&o.specializations.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Event contexts"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:o.specializations.map(T=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:me(T)},T))})]}),o.teamSize&&e.jsxs("p",{className:"text-sm text-gray-700",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Team size: "}),me(o.teamSize)]}),o.bringsOwnSupplies&&e.jsxs("p",{className:"text-sm text-gray-700",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Supplies: "}),me(o.bringsOwnSupplies)]})]})]}),k&&E&&e.jsxs("div",{children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 mb-2",children:[e.jsx(_a,{className:"h-4 w-4 text-muted-foreground"}),"Equipment rental"]}),e.jsxs("div",{className:"space-y-2",children:[Array.isArray(E.rentalCategories)&&E.rentalCategories.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Categories"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:E.rentalCategories.map(T=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:me(T)},T))})]}),Array.isArray(E.addOnServices)&&E.addOnServices.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Operational services"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:E.addOnServices.map(T=>e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:me(T)},T))})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[E.providesSetup===!0&&e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:"Setup included"}),E.providesBreakdown===!0&&e.jsx("span",{className:"rounded-full bg-muted/60 px-3 py-1 text-xs text-gray-700",children:"Breakdown included"})]})]})]})]})]})},il=({cityCoords:s,radiusMiles:t})=>{const n=Ba(),r=u.useRef(null);return u.useEffect(()=>{if(!n||!s){r.current&&(r.current.setMap(null),r.current=null);return}if(!t||t<=0){r.current&&(r.current.setMap(null),r.current=null);return}const a=t*1609.34;r.current?(r.current.setCenter(s),r.current.setRadius(a)):r.current=new google.maps.Circle({map:n,center:s,radius:a,fillColor:"hsl(6 100% 66%)",fillOpacity:.2,strokeColor:"hsl(6 100% 66%)",strokeOpacity:.5,strokeWeight:2});const i=r.current.getBounds();i&&n.fitBounds(i)},[n,s,t]),null},ll=({cityCoords:s,radiusMiles:t,serviceArea:n,isMobile:r})=>{const a=r?"300px":"400px";return s?e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:r?"text-lg font-semibold text-gray-900":"text-xl font-semibold text-gray-900",children:"Where I'll travel"}),e.jsx("div",{className:ue("w-full overflow-hidden rounded-2xl border border-border/70"),style:{height:a},children:vs?e.jsx(Oa,{apiKey:vs,children:e.jsxs(Pa,{mapId:"53e7a282ade2ebddd8c812b0",defaultCenter:s,defaultZoom:t?t>50?8:t>25?9:10:10,gestureHandling:"cooperative",disableDefaultUI:!1,zoomControl:!0,fullscreenControl:!0,mapTypeControl:!1,streetViewControl:!1,scaleControl:!1,rotateControl:!1,children:[e.jsx(il,{cityCoords:s,radiusMiles:t||(n==null?void 0:n.radiusMiles)||(n==null?void 0:n.radius)}),e.jsx(Fa,{position:s,title:"Service Location",zIndex:1e3,children:e.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-[hsl(var(--brand))] text-white shadow-lg ring-2 ring-white pointer-events-none",children:e.jsx(us,{className:"h-4 w-4"})})})]})}):e.jsx("div",{className:"flex h-full items-center justify-center bg-muted/40 text-muted-foreground",children:e.jsxs("div",{className:"text-center",children:[e.jsx(us,{className:"mx-auto h-12 w-12 mb-4"}),e.jsx("p",{className:"text-sm",children:"Map showing service area"}),t&&e.jsxs("p",{className:"mt-2 text-xs",children:["Travel radius: ",t," miles"]})]})})}),((n==null?void 0:n.cities)||(n==null?void 0:n.radiusMiles)||(n==null?void 0:n.radius)||(n==null?void 0:n.travelFee))&&e.jsxs("div",{className:"space-y-1.5 text-sm",children:[n.cities&&n.cities.length>0&&e.jsxs("p",{className:"font-medium text-gray-900",children:["Serves: ",n.cities.join(", ")]}),(n.radiusMiles||n.radius)&&e.jsxs("p",{className:"text-muted-foreground",children:["Travel radius: ",n.radiusMiles||n.radius," miles"]}),n.travelFee&&e.jsxs("p",{className:"text-muted-foreground",children:["Travel fee: ",Se(n.travelFee)]})]})]}):e.jsx("div",{className:"h-[300px] w-full overflow-hidden rounded-2xl border border-border/70",children:e.jsx("div",{className:"flex h-full items-center justify-center bg-muted/40 text-muted-foreground",children:e.jsxs("div",{className:"text-center",children:[e.jsx(us,{className:"mx-auto h-12 w-12 mb-4"}),e.jsx("p",{className:"text-sm",children:"Map showing service area"})]})})})},wr=({cancellationPolicy:s=Rt,cancellationNotes:t,isMobile:n})=>{const r=n?"text-xs":"text-sm",a="text-sm";return e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:n?"text-lg font-semibold text-gray-900":"text-xl font-semibold text-gray-900",children:"Things to know"}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx("div",{className:"rounded-2xl border border-border/70 bg-white p-4 shadow-sm",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Tt,{className:"h-5 w-5 text-brand flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("h3",{className:`${a} font-semibold text-gray-900`,children:"Cancellation"}),e.jsx("p",{className:`mt-1 ${r} text-muted-foreground`,children:gi(s).shortLabel}),t&&t.trim()&&e.jsx("p",{className:`mt-2 ${r} text-gray-700 leading-relaxed whitespace-pre-wrap`,children:t.trim()})]})]})}),e.jsx("div",{className:"rounded-2xl border border-border/70 bg-white p-4 shadow-sm",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(qt,{className:"h-5 w-5 text-brand flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("h3",{className:`${a} font-semibold text-gray-900`,children:"Reviews"}),e.jsx("p",{className:`mt-1 ${r} text-muted-foreground`,children:"New"})]})]})})]})]})},ol="Publish this listing to accept bookings.",cl=({pricingRange:s,minimumBooking:t,onShowDates:n,cancellationPolicy:r=Rt,disabled:a=!1,disabledMessage:i=ol,onRequestCustomQuote:l,primaryActionLabel:m="Show dates",charterInline:b,verified:d=!1})=>{const c=xr(r),p=Ke(t);return e.jsx("div",{className:"rounded-[32px] border border-border/70 bg-white p-6 shadow-xl",children:e.jsxs("div",{className:"space-y-4",children:[s&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsxs("span",{className:"text-2xl font-semibold text-gray-900",children:["From ",Se(s.min),s.min!==s.max&&` - ${Se(s.max)}`]}),e.jsxs("span",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:["/ ",s.label||"per guest"]}),c&&e.jsx("div",{className:"ml-auto",children:e.jsxs(ke,{variant:"secondary",className:"rounded-full px-2 py-0.5 text-[10px] bg-green-50 text-green-700 border-green-200 font-semibold",children:[e.jsx(Je,{className:"h-3 w-3 mr-1"}),"Free cancellation"]})})]}),p&&e.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:p})]}),!s&&p&&e.jsx("div",{className:"text-sm text-muted-foreground",children:p}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"You won't be charged yet. Share your event details and get a customized proposal."}),e.jsx(Ee,{}),a?e.jsx("div",{className:"rounded-full py-6 px-4 text-center text-sm text-muted-foreground bg-muted/50 border border-border/70",children:i}):e.jsxs(e.Fragment,{children:[b||e.jsx(Z,{className:"w-full rounded-full py-6 text-base font-semibold bg-brand hover:bg-brand-600 text-white",onClick:n,children:m}),l&&e.jsx("button",{type:"button",onClick:l,className:"w-full text-sm text-center text-brand hover:text-brand-600 underline-offset-4 hover:underline mt-1",children:"Request a custom quote"})]}),e.jsx(Ee,{}),e.jsxs("div",{className:"space-y-2 text-xs text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($e,{className:"h-3 w-3 text-brand"}),e.jsx("span",{children:"Response time: Usually within 1 hour"})]}),d&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Je,{className:"h-3 w-3 text-brand"}),e.jsx("span",{children:"Verified partner"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Tt,{className:"h-3 w-3 text-brand"}),e.jsx("span",{children:"Background checked"})]})]})]})]})})},dl=({hostDisplayName:s,serviceName:t,serviceTypeInfo:n,locationLabel:r,hostAvatar:a,hostPublicId:i,aboutMe:l,tagline:m,isSaved:b,isMessaging:d=!1,verified:c=!1,onShareClick:p,onSaveClick:f,onMessageClick:h})=>{const x=s||t.split(" ")[t.split(" ").length-1]||t.split(" ")[0],y=i?`/u/${i}`:null,o=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex justify-center",children:e.jsx(Ns,{src:a||void 0,alt:s,className:"h-16 w-16 rounded-full object-cover ring-2 ring-border transition-shadow duration-200 group-hover:ring-brand",fallback:"/default-profile-icon.png"})}),e.jsxs("div",{className:"text-center space-y-1.5 min-w-0",children:[e.jsxs("h3",{className:"flex items-center justify-center gap-1 text-base font-semibold text-gray-900 break-words",children:[x,c&&e.jsx(gr,{className:"h-4 w-4 flex-shrink-0 text-blue-500","aria-label":"Verified"})]}),e.jsxs("p",{className:"text-sm text-muted-foreground break-words",children:[(n==null?void 0:n.label)||"Service Provider"," in ",r]})]})]});return e.jsx("div",{className:"rounded-[32px] border border-border/70 bg-white p-6 shadow-xl min-w-0",children:e.jsxs("div",{className:"space-y-3 min-w-0",children:[y?e.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"group block focus:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2 rounded-full w-fit mx-auto","aria-label":`View ${x}'s profile`,children:o}):o,e.jsxs("div",{className:"text-center space-y-1.5 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-muted-foreground flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(qt,{className:"h-3.5 w-3.5 fill-amber-400 text-amber-400"}),e.jsx("span",{className:"font-medium text-gray-900",children:"New"})]}),l.yearsOfExperience&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Es,{className:"h-3.5 w-3.5"}),e.jsxs("span",{children:[l.yearsOfExperience,"yr"]})]})]})]}),m&&e.jsx("p",{className:"text-sm text-gray-700 leading-relaxed min-w-0 break-words whitespace-pre-line",children:m}),e.jsxs("div",{className:"flex items-center justify-center gap-2 pt-0.5",children:[e.jsx(Z,{variant:"outline",size:"icon",className:"h-8 w-8 rounded-full",onClick:p,children:e.jsx(Hs,{className:"h-3.5 w-3.5"})}),f!=null&&e.jsx(Z,{variant:"outline",size:"icon",className:ue("h-8 w-8 rounded-full",b&&"border-brand text-brand"),onClick:f,children:e.jsx(Vs,{className:ue("h-3.5 w-3.5",b&&"fill-current")})}),e.jsx(Z,{variant:"outline",size:"icon",className:"h-8 w-8 rounded-full",onClick:h,disabled:d,children:d?e.jsx(ze,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Pi,{className:"h-3.5 w-3.5"})})]})]})]})})},ul=({package:s,isOpen:t,onOpenChange:n,onSelectPackage:r})=>{const a=kt(),i=u.useMemo(()=>s?Ke(Ls(s)):null,[s]),l=u.useMemo(()=>{if(!s)return"";const c=Se(ws(s));return c?s.priceType==="per_person"||s.priceType==="per_guest"?`${c} / per guest`:s.priceType==="per_hour"?`${c} / per hour`:`${c} / per event`:tt},[s]),m=u.useMemo(()=>!s||!s.guestLimit?null:s.guestLimit.min&&s.guestLimit.max?`${s.guestLimit.min} - ${s.guestLimit.max} guests`:s.guestLimit.min?`${s.guestLimit.min}+ guests`:s.guestLimit.max?`Up to ${s.guestLimit.max} guests`:null,[s]),b=u.useMemo(()=>{if(!s||!s.duration)return null;const c=[];return s.duration.hours>0&&c.push(`${s.duration.hours} hour${s.duration.hours>1?"s":""}`),s.duration.minutes>0&&c.push(`${s.duration.minutes} minute${s.duration.minutes>1?"s":""}`),c.join(" ")},[s]),d=(s==null?void 0:s.pricingMode)==="negotiable_range"?"Request a quote":"Select this package";return s?a?e.jsx(es,{open:t,onOpenChange:n,children:e.jsxs(ss,{hideCloseButton:!0,mobileBottomSheet:a,children:[s.image&&e.jsx("div",{className:"relative h-48 overflow-hidden -mx-4 -mt-4 mb-4",style:{width:"calc(100% + 2rem)",marginLeft:"-1rem",marginRight:"-1rem"},children:e.jsx("img",{src:s.image,alt:s.name,className:"w-full h-full object-cover"})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(ts,{className:"px-0 pt-0 pb-0 space-y-2",children:[e.jsx(ns,{className:"text-xl font-semibold text-gray-900",children:s.name}),e.jsx(rs,{children:"Package details and pricing information"}),e.jsx("div",{className:"text-base font-semibold text-brand",children:l})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[m&&e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-xl",children:[e.jsx("div",{className:"p-2 bg-white rounded-lg",children:e.jsx(Es,{className:"h-4 w-4 text-gray-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 mb-0.5",children:"Guest range"}),e.jsx("p",{className:"text-sm font-semibold text-gray-900",children:m})]})]}),b&&e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-xl",children:[e.jsx("div",{className:"p-2 bg-white rounded-lg",children:e.jsx($e,{className:"h-4 w-4 text-gray-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 mb-0.5",children:"Duration"}),e.jsx("p",{className:"text-sm font-semibold text-gray-900",children:b})]})]})]}),s.includes&&s.includes.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-900",children:"What's included:"}),e.jsx("ul",{className:"space-y-2",children:s.includes.map((c,p)=>e.jsxs("li",{className:"flex items-start gap-3 text-sm text-gray-700 min-w-0",children:[e.jsx(Je,{className:"h-5 w-5 text-brand flex-shrink-0 mt-0.5"}),e.jsx("span",{className:"break-words",children:c})]},p))})]}),s.description&&e.jsx("div",{className:"pt-2 min-w-0 overflow-visible",children:e.jsx("p",{className:"text-sm text-gray-700 leading-relaxed whitespace-pre-line min-w-0 break-words",children:s.description})}),i&&e.jsx("div",{className:"p-4 bg-brand/5 border border-brand/20 rounded-xl",children:e.jsx("p",{className:"text-sm text-gray-800 font-medium",children:i})}),e.jsx("div",{className:"pt-4 border-t border-gray-200 mt-6",children:e.jsx(Z,{className:"w-full rounded-full py-5 text-sm font-semibold bg-brand hover:bg-brand-600 text-white",onClick:r,children:d})})]})]})}):e.jsx(es,{open:t,onOpenChange:n,children:e.jsxs(ss,{className:"max-w-2xl max-h-[90vh] overflow-hidden p-0 gap-0 flex flex-col !border-0",children:[s.image&&e.jsx("div",{className:"relative h-64 overflow-hidden flex-shrink-0 -mx-1",children:e.jsx("img",{src:s.image,alt:s.name,className:"w-full h-full object-cover"})}),e.jsxs("div",{className:"flex-1 overflow-y-auto overflow-x-hidden px-6 py-6 space-y-6 min-h-0 min-w-0",children:[e.jsxs(ts,{className:"space-y-2",children:[e.jsx(ns,{className:"text-2xl font-semibold text-gray-900",children:s.name}),e.jsx(rs,{children:"Package details and pricing information"}),e.jsx("div",{className:"text-lg font-semibold text-brand",children:l})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[m&&e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-xl",children:[e.jsx("div",{className:"p-2 bg-white rounded-lg",children:e.jsx(Es,{className:"h-4 w-4 text-gray-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 mb-0.5",children:"Guest range"}),e.jsx("p",{className:"text-sm font-semibold text-gray-900",children:m})]})]}),b&&e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-xl",children:[e.jsx("div",{className:"p-2 bg-white rounded-lg",children:e.jsx($e,{className:"h-4 w-4 text-gray-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 mb-0.5",children:"Duration"}),e.jsx("p",{className:"text-sm font-semibold text-gray-900",children:b})]})]})]}),s.includes&&s.includes.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-900",children:"What's included:"}),e.jsx("ul",{className:"space-y-2",children:s.includes.map((c,p)=>e.jsxs("li",{className:"flex items-start gap-3 text-sm text-gray-700 min-w-0",children:[e.jsx(Je,{className:"h-5 w-5 text-brand flex-shrink-0 mt-0.5"}),e.jsx("span",{className:"break-words",children:c})]},p))})]}),s.description&&e.jsx("div",{className:"pt-2 min-w-0",children:e.jsx("p",{className:"text-sm text-gray-700 leading-relaxed whitespace-pre-line min-w-0 break-words",children:s.description})}),i&&e.jsx("div",{className:"p-4 bg-brand/5 border border-brand/20 rounded-xl",children:e.jsx("p",{className:"text-sm text-gray-800 font-medium",children:i})})]}),e.jsx("div",{className:"border-t border-gray-200 px-6 py-4 bg-white flex-shrink-0",children:e.jsx(Z,{className:"w-full rounded-full py-6 text-base font-semibold bg-brand hover:bg-brand-600 text-white",onClick:r,children:d})})]})}):null},ml=({offerings:s,isOpen:t,onOpenChange:n,onSelectPackage:r,onViewDetails:a})=>{const i=kt();return s.length===0?null:e.jsx(es,{open:t,onOpenChange:n,children:e.jsxs(ss,{className:i?"":"!max-w-2xl w-full max-h-[90vh] overflow-hidden p-0 gap-0 flex flex-col",mobileBottomSheet:i,hideCloseButton:i,children:[e.jsx("div",{className:`${i?"pb-4":"px-6 pt-6 pb-4"} border-b border-gray-200 flex-shrink-0`,children:e.jsxs(ts,{children:[e.jsx(ns,{className:`${i?"text-xl":"text-2xl"} font-semibold text-gray-900`,children:"Select a Package"}),e.jsx(rs,{children:"Choose a package that fits your event needs"})]})}),e.jsx("div",{className:`flex-1 overflow-y-auto overflow-x-hidden min-w-0 ${i?"pt-14 pb-4":"px-6 py-6"} space-y-4`,children:s.map((l,m)=>{var h,x,y,o;const b=Ke(Ls(l)),d=Se(ws(l)),c=l.duration&&l.duration.hours>0?`${l.duration.hours} hour${l.duration.hours>1?"s":""}`:"",p=(h=l.guestLimit)!=null&&h.min&&((x=l.guestLimit)!=null&&x.max)?`${l.guestLimit.min} - ${l.guestLimit.max} guests`:(y=l.guestLimit)!=null&&y.min?`${l.guestLimit.min}+ guests`:(o=l.guestLimit)!=null&&o.max?`Up to ${l.guestLimit.max} guests`:null,f=e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900 mb-1",children:l.name}),l.description&&e.jsx("p",{className:"text-sm text-gray-600 line-clamp-2 mb-2 min-w-0 break-words overflow-hidden",children:l.description})]}),(p||c)&&e.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-600",children:[p&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Es,{className:"h-3 w-3 flex-shrink-0"}),e.jsx("span",{children:p})]}),c&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx($e,{className:"h-3 w-3 flex-shrink-0"}),e.jsx("span",{children:c})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"text-lg font-semibold text-gray-900",children:[d??tt,d&&e.jsxs("span",{className:"text-sm font-normal text-muted-foreground ml-1",children:[l.priceType==="per_person"||l.priceType==="per_guest"?"/ guest":"",l.priceType==="per_hour"?"/ hour":"",l.priceType==="per_event"||l.priceType==="fixed"?"/ event":""]})]}),b&&e.jsx("p",{className:"text-xs text-gray-600",children:b})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-2 min-w-0",children:[e.jsx(Z,{variant:"outline",className:"rounded-full text-sm min-w-0 shrink-0",onClick:()=>{a(l),n(!1)},children:"View Details"}),e.jsx(Z,{className:"rounded-full text-sm bg-brand hover:bg-brand-600 text-white min-w-0 shrink-0",onClick:()=>{r(l)},children:l.pricingMode==="negotiable_range"?"Request Quote":"Select Package"})]})]});return e.jsx("div",{className:ue("min-w-0 rounded-2xl border border-border/70 bg-white p-4 shadow-sm hover:border-brand/50 hover:shadow-md transition-all overflow-hidden",i&&m===0&&"-mt-10"),children:i?e.jsxs(e.Fragment,{children:[l.image&&e.jsx("div",{className:"-mx-4 -mt-4 w-[calc(100%+2rem)] mb-4",children:e.jsx("img",{src:l.image,alt:l.name,className:"w-full aspect-video object-cover rounded-t-2xl"})}),e.jsx("div",{className:"flex flex-col min-w-0 space-y-2",children:f})]}):e.jsxs("div",{className:"flex gap-4 min-w-0",children:[l.image&&e.jsx("img",{src:l.image,alt:l.name,className:"h-24 w-24 rounded-xl object-cover flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0 space-y-2 overflow-hidden",children:f})]})},l.id)})})]})})},_t=s=>s&&typeof s=="object"&&!Array.isArray(s)?s:null,xl=s=>typeof s=="number"&&Number.isFinite(s)&&s>0?s:null;function hl(s){return Mt(s)}function Dt(s){const t=_t(s);if(!t)return null;const n=t.displayPriceDelta;return typeof n=="number"&&Number.isFinite(n)?n:t.priceDelta===0?0:null}function pl(s){const t=_t(s);if(!t)return!1;const n=t.priceDelta;return typeof n=="number"&&n!==0&&Dt(t)===null}function Cr(s,t){var a;if(!s)return null;const n=hl(s);if(n===null)return null;let r=n;for(const i of t??[]){const l=(a=s.options)==null?void 0:a.find(d=>d.optionId===i.optionId),m=l==null?void 0:l.choices.find(d=>d.choiceId===i.choiceId);if(!m)continue;const b=Dt(m);if(b===null)return null;r+=b}return r}function Sr(s,t,n){const r=Cr(s,t);return r===null||!Number.isFinite(n)||n<0?null:r*n}function yt(s,t){let n=0;for(const r of s){const a=Sr(t.get(r.menuItemId),r.selectedChoices,r.quantity??0);if(a===null)return null;n+=a}return n}function Tr(s){const t=_t(s);return t?xl(t.displayMinOrderAmount):null}const fl=s=>{if(!(s!=null&&s.options))return{};const t={};for(const n of s.options)n.required&&!n.multiSelect&&n.choices.length>0?t[n.optionId]=[n.choices[0].choiceId]:t[n.optionId]=[];return t},In=(s,t)=>{if(s.required&&t.length===0)return!1;const n=s.minSelections??(s.required?1:0),r=s.maxSelections??(s.multiSelect?s.choices.length:1);return t.length>=n&&t.length<=r},An=({choice:s})=>{if(pl(s))return e.jsx("span",{className:"text-xs text-muted-foreground",children:s.priceDelta>0?"adds to the price":"lowers the price"});const t=Dt(s);if(t===null||t===0)return null;const n=Ue(Math.abs(t));return e.jsxs("span",{className:"text-sm text-muted-foreground",children:[t>0?"+":"−",n]})},gl=({item:s,open:t,onOpenChange:n,onAddToCart:r,isMobile:a=!1})=>{const[i,l]=u.useState(1),[m,b]=u.useState({});u.useEffect(()=>{t&&s&&(l(s.minQuantity??1),b(fl(s)))},[t,s]);const d=u.useMemo(()=>s!=null&&s.options?s.options.every(N=>In(N,m[N.optionId]??[])):!0,[s,m]),c=(s==null?void 0:s.minQuantity)??1,p=(s==null?void 0:s.maxQuantity)??999,f=u.useMemo(()=>{if(!s)return null;const N=Object.entries(m).flatMap(([M,D])=>D.map(C=>({optionId:M,choiceId:C})));return Cr(s,N)},[s,m]),h=f===null?null:Ue(f*i),x=(N,M)=>{b(D=>{const C=D[N.optionId]??[];if(N.multiSelect){const v=N.maxSelections??N.choices.length,_=C.includes(M)?C.filter(g=>g!==M):C.length<v?[...C,M]:C;return{...D,[N.optionId]:_}}return{...D,[N.optionId]:[M]}})},y=()=>{if(!s||!d)return;const N=Object.entries(m).flatMap(([M,D])=>D.map(C=>({optionId:M,choiceId:C})));r({item:s,quantity:i,selectedChoices:N})};if(!s)return null;const o=s.itemTypeTags??[],E=o.length>0?o.map(N=>Js(N)).join(" "):null,V=e.jsxs("div",{className:"space-y-5",children:[s.imageUrl?e.jsx("img",{src:s.imageUrl,alt:s.name,className:"w-full h-48 md:h-64 rounded-xl object-cover border border-border/60"}):e.jsx("div",{className:"w-full h-48 md:h-64 rounded-xl bg-muted flex items-center justify-center text-muted-foreground",children:e.jsx(cr,{className:"h-10 w-10"})}),e.jsxs("div",{className:"space-y-2",children:[s.servesNumPeople||s.unit?e.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:s.servesNumPeople?`Serves ${s.servesNumPeople}`:dr(s.unit)}):null,s.description&&e.jsx("p",{className:"text-sm text-gray-700 leading-6",children:s.description}),(o.length>0||s.foodLabelingTags&&s.foodLabelingTags.length>0)&&e.jsxs("div",{className:"flex flex-wrap gap-1 pt-1",children:[o.map(N=>e.jsx(ke,{variant:"outline",className:"text-xs border-slate-300 text-slate-700",title:Js(N),children:bt(N)},N)),s.foodLabelingTags.map(N=>e.jsx(ke,{variant:"secondary",className:"text-xs",children:ur(N)},N))]}),E?e.jsx("p",{className:"text-xs text-muted-foreground",children:E}):null]}),(s.options??[]).length>0&&e.jsx(Ee,{}),(s.options??[]).map(N=>{const M=m[N.optionId]??[],D=!N.multiSelect,C=In(N,M);return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx(xe,{className:"text-sm font-semibold text-gray-900",children:N.name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[N.required?"Required":"Optional",N.multiSelect?` · Choose${N.minSelections?` at least ${N.minSelections}`:""}${N.maxSelections?` up to ${N.maxSelections}`:""}`:" · Choose 1"]})]}),!C&&N.required&&e.jsx("span",{className:"text-xs text-destructive",children:"Required"})]}),D?e.jsx(da,{value:M[0]??"",onValueChange:v=>x(N,v),className:"space-y-1.5",children:N.choices.map(v=>e.jsxs("label",{className:ue("flex items-center justify-between gap-3 rounded-lg border border-border/60 px-3 py-2 cursor-pointer","hover:bg-muted/50 transition-colors",M.includes(v.choiceId)&&"border-brand bg-brand/5"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ua,{value:v.choiceId,id:v.choiceId}),e.jsx("span",{className:"text-sm",children:v.name})]}),e.jsx(An,{choice:v})]},v.choiceId))}):e.jsx("div",{className:"space-y-1.5",children:N.choices.map(v=>{const R=M.includes(v.choiceId);return e.jsxs("label",{className:ue("flex items-center justify-between gap-3 rounded-lg border border-border/60 px-3 py-2 cursor-pointer","hover:bg-muted/50 transition-colors",R&&"border-brand bg-brand/5"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ma,{checked:R,onCheckedChange:()=>x(N,v.choiceId)}),e.jsx("span",{className:"text-sm",children:v.name})]}),e.jsx(An,{choice:v})]},v.choiceId)})})]},N.optionId)}),e.jsx(Ee,{}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(xe,{className:"text-sm font-semibold text-gray-900",children:"Quantity"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Z,{type:"button",variant:"outline",size:"icon",onClick:()=>l(N=>Math.max(c,N-1)),disabled:i<=c,"aria-label":"Decrease quantity",children:e.jsx(xa,{className:"h-4 w-4"})}),e.jsx("span",{className:"w-10 text-center text-sm font-semibold","aria-live":"polite",children:i}),e.jsx(Z,{type:"button",variant:"outline",size:"icon",onClick:()=>l(N=>Math.min(p,N+1)),disabled:i>=p,"aria-label":"Increase quantity",children:e.jsx(Yn,{className:"h-4 w-4"})})]})]})]}),O=e.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Total"}),e.jsx("p",{className:"font-semibold text-gray-900",children:h??"Priced when the caterer confirms"})]}),e.jsxs(Z,{type:"button",onClick:y,disabled:!d,className:"rounded-full px-5",children:["Add ",i," to your order",h?` · ${h}`:""]})]});return a?e.jsx(Qn,{open:t,onOpenChange:n,children:e.jsxs(Kn,{className:"max-h-[92vh]",children:[e.jsxs(Jn,{className:"text-left",children:[e.jsx(Zn,{children:s.name}),s.description&&e.jsx(Xn,{className:"sr-only",children:s.description})]}),e.jsx("div",{className:"px-4 overflow-y-auto",children:V}),e.jsx(er,{children:O})]})}):e.jsx(es,{open:t,onOpenChange:n,children:e.jsxs(ss,{className:"max-h-[90vh] overflow-y-auto sm:max-w-lg",children:[e.jsxs(ts,{children:[e.jsx(ns,{children:s.name}),s.description&&e.jsx(rs,{className:"sr-only",children:s.description})]}),V,e.jsx(sr,{children:O})]})})},Mr=({menu:s,items:t,onAddToCart:n,menuOrderProgress:r,interactive:a=!0,isMobile:i=!1,isRequestMode:l=!1,requestModeItems:m=[],onSubmitMenuRequest:b,onRemoveRequestModeItem:d,instantModeItems:c=[],canContinueToCheckout:p=!1,isContinuingToCheckout:f=!1,onContinueToCheckout:h})=>{const x=u.useMemo(()=>[...s.categories].sort((g,S)=>g.sortOrder-S.sortOrder||g.name.localeCompare(S.name)),[s.categories]),y=u.useMemo(()=>{const g=new Map;for(const S of t){if(S.status&&S.status!=="active")continue;const k=g.get(S.categoryId)??[];k.push(S),g.set(S.categoryId,k)}for(const[,S]of g)S.sort((k,w)=>k.sortOrder-w.sortOrder||k.name.localeCompare(w.name));return g},[t]),o=u.useMemo(()=>{const g=new Map;for(const S of t)g.set(S.itemId,S);return g},[t]),E=u.useMemo(()=>x.filter(g=>(y.get(g.categoryId)??[]).length>0),[x,y]),[V,O]=u.useState(()=>{var g;return((g=E[0])==null?void 0:g.categoryId)??""});u.useEffect(()=>{!V&&E[0]&&O(E[0].categoryId)},[V,E]);const[N,M]=u.useState(null),D=u.useRef({}),C=u.useRef(null),v=u.useRef(null),R=u.useCallback(g=>{const S=D.current[g];if(!S)return;const k=v.current,w=k?(parseFloat(getComputedStyle(k).top)||0)+k.offsetHeight:80,H=S.getBoundingClientRect().top+window.scrollY-w-8;window.scrollTo({top:H,behavior:"smooth"}),O(g)},[]);u.useEffect(()=>{if(typeof IntersectionObserver>"u")return;const g=new IntersectionObserver(S=>{const k=S.filter(w=>w.isIntersecting).sort((w,H)=>H.intersectionRatio-w.intersectionRatio)[0];if(k!=null&&k.target.id){const w=k.target.dataset.categoryId;w&&O(w)}},{rootMargin:"-20% 0px -60% 0px",threshold:[.1,.3,.6]});for(const S of E){const k=D.current[S.categoryId];k&&g.observe(k)}return()=>g.disconnect()},[E]);const _=g=>{C.current&&C.current.scrollBy({left:g*200,behavior:"smooth"})};return E.length===0?null:e.jsxs("section",{"aria-labelledby":"catering-menu-heading",className:"space-y-4 min-w-0",children:[e.jsx("div",{className:"flex items-end justify-between gap-3",children:e.jsxs("div",{children:[e.jsx("h2",{id:"catering-menu-heading",className:ue("font-semibold text-gray-900",i?"text-lg":"text-xl"),children:s.name||"Catering Menu"}),s.description&&e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:s.description}),(s.minGuests||s.leadTimeHours)&&e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[s.minGuests?e.jsxs("span",{children:[s.minGuests,"+ guests"]}):null,s.minGuests&&s.leadTimeHours?e.jsx("span",{children:"·"}):null,s.leadTimeHours?e.jsxs("span",{children:[s.leadTimeHours,"h lead time"]}):null]})]})}),a&&s.minOrderAmount?e.jsx(bl,{guestMinCents:Tr(s),progress:r,isRequestMode:l}):null,a&&!l&&h&&c.length>0?e.jsx(En,{selections:c,itemsById:o,onSubmit:h,onRemove:d,canSubmit:p,isSubmitting:f,submitLabel:"Continue to checkout"}):null,a&&l&&m.length>0?e.jsx(En,{selections:m,itemsById:o,onSubmit:b,onRemove:d,canSubmit:p,isSubmitting:f}):null,e.jsx("div",{ref:v,className:"glass sticky top-[60px] md:top-[148px] z-10 -mx-2 md:mx-0",style:{"--glass-tint-opacity":"0.72"},role:"navigation","aria-label":"Menu categories",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("button",{type:"button",onClick:()=>_(-1),className:"hidden md:flex h-8 w-8 items-center justify-center text-muted-foreground hover:text-foreground shrink-0","aria-label":"Scroll categories left",children:e.jsx(ha,{className:"h-4 w-4"})}),e.jsx("div",{ref:C,className:"flex-1 flex overflow-x-auto whitespace-nowrap px-2 py-2 scroll-smooth no-scrollbar",children:E.map(g=>{const S=g.categoryId===V;return e.jsx("button",{type:"button",onClick:()=>R(g.categoryId),className:ue("relative px-3 py-2 text-sm font-semibold transition-colors shrink-0","border-b-2 -mb-[2px]",S?"text-gray-900 border-brand":"text-muted-foreground border-transparent hover:text-gray-900 hover:bg-muted/40 rounded-t-md"),children:g.name},g.categoryId)})}),e.jsx("button",{type:"button",onClick:()=>_(1),className:"hidden md:flex h-8 w-8 items-center justify-center text-muted-foreground hover:text-foreground shrink-0","aria-label":"Scroll categories right",children:e.jsx(pa,{className:"h-4 w-4"})})]})}),e.jsx("div",{className:"space-y-8",children:E.map(g=>e.jsx(jl,{category:g,items:y.get(g.categoryId)??[],innerRef:S=>{D.current[g.categoryId]=S},interactive:a,onItemClick:a?S=>M(S):void 0},g.categoryId))}),e.jsx(gl,{item:N,open:N!==null,onOpenChange:g=>{g||M(null)},onAddToCart:g=>{n==null||n(g),M(null)},isMobile:i})]})},bl=({guestMinCents:s,progress:t,isRequestMode:n=!1})=>{const r=(t==null?void 0:t.currentCents)??0,a=(t==null?void 0:t.met)??!1,i=t?Math.min(100,Math.round(r/Math.max(t.minCents,1)*100)):0,l=Ue(s),m=(t==null?void 0:t.guestSubtotalCents)??null,b=Ue(m),d=s!==null&&m!==null?Math.max(0,s-m):null,c=d?Ue(d):null,p=a?"Minimum order met":l?`${l} minimum order`:"Minimum order",f=n?"review and send your request":"continue to checkout",h=n?"send your request":"check out";let x;if(t)a?x=b?`Order total ${b} — ${f}.`:`Minimum met — ${f}.`:r>0?x=c?`Add ${c} more to ${h}.`:b?`Order total ${b} — add more to ${h}.`:`Add more to your order to ${h}.`:x=l?`Add ${l} of items before you can ${h}.`:`Add items to reach the minimum before you can ${h}.`;else{const y=n?"before you send your request":"before checkout";x=l?`Build your order to this amount ${y}.`:`This caterer sets a minimum order. Build your order ${y}.`}return e.jsxs("div",{className:ue("rounded-xl border px-3 py-2.5 flex items-center gap-3",a?"border-green-200 bg-green-50 text-green-900":"border-amber-200 bg-amber-50 text-amber-900"),role:"status",children:[e.jsx("div",{className:"shrink-0",children:a?e.jsx(Je,{className:"h-5 w-5 text-green-700","aria-hidden":!0}):e.jsx(_i,{className:"h-5 w-5 text-amber-700","aria-hidden":!0})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold",children:p}),e.jsx("p",{className:"text-xs",children:x}),t&&!a?e.jsx("div",{className:"mt-1.5 h-1 w-full rounded-full bg-amber-200/70 overflow-hidden","aria-hidden":!0,children:e.jsx("div",{className:"h-full bg-amber-500 transition-[width] duration-300",style:{width:`${i}%`}})}):null]})]})},En=({selections:s,itemsById:t,onSubmit:n,onRemove:r,canSubmit:a=!1,isSubmitting:i=!1,submitLabel:l="Review and send request"})=>{const[m,b]=u.useState(!0),d=s.reduce((p,f)=>p+(f.quantity??0),0),c=Ue(yt(s,t));return e.jsxs("div",{className:"rounded-xl border border-brand/30 bg-brand/5 overflow-hidden",children:[e.jsxs("button",{type:"button",onClick:()=>b(p=>!p),className:"w-full flex items-center gap-3 px-4 py-3 text-left","aria-expanded":m,children:[e.jsx(Vi,{className:"h-5 w-5 text-brand shrink-0","aria-hidden":!0}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-sm font-semibold text-gray-900",children:["Your selections · ",d," ",d===1?"item":"items",c?` · ${c}`:""]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m?"Tap to collapse":"Tap to review"})]}),e.jsx(fa,{className:ue("h-4 w-4 text-muted-foreground shrink-0 transition-transform duration-200",m&&"rotate-180"),"aria-hidden":!0})]}),m&&e.jsxs("div",{className:"border-t border-brand/20 px-4 pb-4 pt-3 space-y-3",children:[e.jsx("ul",{className:"space-y-2","aria-label":"Selected items",children:s.map((p,f)=>{const h=t.get(p.menuItemId),x=p.quantity??0,y=Ue(Sr(h,p.selectedChoices,x));return e.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[e.jsxs("span",{className:"shrink-0 w-5 text-center font-semibold text-brand text-xs",children:["×",x]}),e.jsx("span",{className:"flex-1 min-w-0 text-gray-800 truncate",children:(h==null?void 0:h.name)??p.menuItemId}),e.jsx("span",{className:ue("shrink-0 text-xs tabular-nums",y?"text-gray-700 font-medium":"text-muted-foreground italic"),children:y??"Priced at checkout"}),r&&e.jsx("button",{type:"button",onClick:()=>r(p.menuItemId,p.selectedChoices??[]),className:"shrink-0 rounded-full p-0.5 text-muted-foreground hover:bg-red-50 hover:text-red-500 transition-colors","aria-label":`Remove ${(h==null?void 0:h.name)??p.menuItemId}`,children:e.jsx(It,{className:"h-3.5 w-3.5"})})]},`${p.menuItemId}-${f}`)})}),e.jsxs("div",{className:"flex items-center justify-between pt-1 border-t border-brand/20",children:[e.jsx("span",{className:"text-sm font-semibold text-gray-900",children:"Subtotal"}),e.jsx("span",{className:ue("text-sm tabular-nums",c?"font-semibold text-gray-900":"text-muted-foreground italic"),children:c??"Priced at checkout"})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Service fee and tax shown at checkout"}),e.jsx(Z,{type:"button",className:"w-full rounded-full",onClick:n,disabled:!n||!a||i,children:i?"Pricing…":l})]})]})},jl=({category:s,items:t,innerRef:n,interactive:r,onItemClick:a})=>e.jsxs("section",{ref:n,id:`menu-category-${s.categoryId}`,"data-category-id":s.categoryId,className:"scroll-mt-24",children:[e.jsxs("div",{className:"mb-3 flex items-baseline justify-between gap-2",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:s.name}),s.isPackageCategory&&e.jsx(ke,{variant:"outline",className:"text-[10px] uppercase",children:"Packages"})]}),s.description&&e.jsx("p",{className:"mb-3 text-sm text-muted-foreground",children:s.description}),e.jsx("ul",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:t.map(i=>e.jsx("li",{children:e.jsx(yl,{item:i,interactive:r,onClick:a?()=>a(i):void 0})},i.itemId))})]}),yl=({item:s,interactive:t,onClick:n})=>{var b;const r=Ue(Mt(s)),a=s.itemTypeTags??[],i=a.length>0?a.map(d=>bt(d)).join(" · "):null,l=a.length>0?a.map(d=>Js(d)).join(" "):null,m=e.jsxs("div",{className:"flex h-full gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0 space-y-1.5",children:[e.jsx("p",{className:"font-medium text-gray-900 line-clamp-1",children:s.name}),i?e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:i}):null,e.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:s.servesNumPeople?`Serves ${s.servesNumPeople}`:dr(s.unit)}),s.description&&e.jsx("p",{className:"text-sm text-muted-foreground leading-6 line-clamp-2",children:s.description}),e.jsxs("div",{className:"flex items-center gap-2 pt-1 flex-wrap",children:[r?e.jsx("p",{className:"font-semibold text-gray-900",children:r}):e.jsx("p",{className:"text-xs italic text-muted-foreground",children:"Priced at checkout"}),a.map(d=>e.jsx(ke,{variant:"outline",className:"text-[10px] font-medium border-slate-300 text-slate-700",title:Js(d),children:bt(d)},d)),(b=s.foodLabelingTags)==null?void 0:b.slice(0,3).map(d=>e.jsxs(ke,{variant:"secondary",className:"text-[10px] font-medium gap-1",children:[d==="VEGETARIAN"||d==="VEGAN"?e.jsx(ui,{className:"h-3 w-3 text-green-700"}):null,ur(d)]},d))]}),l?e.jsx("p",{className:"text-xs text-muted-foreground",children:l}):null]}),s.imageUrl?e.jsx("img",{src:s.imageUrl,alt:s.name,className:"h-24 w-24 md:h-28 md:w-28 rounded-xl object-cover shrink-0 border border-border/60",loading:"lazy"}):e.jsx("div",{className:"h-24 w-24 md:h-28 md:w-28 rounded-xl bg-muted text-muted-foreground flex items-center justify-center shrink-0",children:e.jsx(cr,{className:"h-6 w-6"})})]});return!t||!n?e.jsx("div",{className:"rounded-2xl border border-border/60 bg-white p-3 md:p-4 h-full",children:m}):e.jsx("button",{type:"button",onClick:n,className:ue("w-full text-left rounded-2xl border border-border/60 bg-white p-3 md:p-4 h-full","transition-all hover:border-brand/60 hover:shadow-md focus-visible:outline-none","focus-visible:ring-2 focus-visible:ring-brand/60"),children:m})},Os=s=>s.status!=="archived",kr=s=>s.filter(Os),Nl=s=>{if(s.pricingMode!=="negotiable_range")return null;const t=Number.isFinite(s.minPrice)&&Number.isFinite(s.maxPrice)&&(s.minPrice??0)>=0&&(s.maxPrice??0)>=(s.minPrice??0)&&s.priceUnit!=null;return{packageId:s.id,packageName:s.name,pricingMode:"negotiable_range",...t?{negotiatedFrom:{packageId:s.id,minPrice:s.minPrice,maxPrice:s.maxPrice,priceUnit:s.priceUnit}}:{}}},vl=s=>s.pricingMode==="self_service_range"?(s.sliders??[]).map(t=>({sliderId:t.id,value:t.min})):[],wl=({offerings:s,hasCharterBooking:t=!1,hasCatererMenu:n,canRequestQuote:r,hostPaymentsBlocked:a=!1})=>a?{kind:"unavailable",label:"Bookings paused",disabled:!0,disabledMessage:bi}:t?{kind:"charter",label:"Book your trip",disabled:!1}:kr(s).length>0?{kind:"packages",label:"Show dates",disabled:!1}:n?{kind:"menu",label:"View menu",disabled:!1}:r?{kind:"quote",label:"Request a quote",disabled:!1}:{kind:"unavailable",label:"Currently unavailable",disabled:!0},Ln="Service not found",Rn="We couldn't find that service. It may be unpublished or was removed.";function Cl(s){var _,g,S,k,w,H;const[t]=Ct(),n=t.get("preview")==="true",[r,a]=u.useState(null),[i,l]=u.useState(!0),[m,b]=u.useState(null);u.useEffect(()=>{let A=!0;return(async()=>{var W,q;if(!s){b("Missing service id"),l(!1);return}if(n)try{const I=await ga(s);if(!A)return;if(I.listingKind!=="service"){A&&(b("This listing is not a service. Please use the correct link."),l(!1));return}a(I),l(!1);return}catch(I){if(A){const T=I instanceof Error?I.message:String(I);b(`Failed to load service: ${T}`),l(!1)}return}try{const I=new URLSearchParams({listingId:s,listingKind:"service",limit:"1"}),j=(W=(await ba(`/public/venues?${I.toString()}`)).items)==null?void 0:W.find(L=>L.listingId===s);if(j){if(!A)return;if(j.listingKind!=="service"){A&&(b("This listing is not a service. Please use the correct link."),l(!1));return}a(j),l(!1)}else try{const L=await ja(s);if(!A)return;if(L.listingKind!=="service"){A&&(b("This listing is not a service. Please use the correct link."),l(!1));return}a(L),l(!1)}catch{let L,P=0;const Y=10;let te=!1;for(;P<Y;){const X=await ya({listingKind:"service",limit:100,cursor:L}),ve=(q=X.items)==null?void 0:q.find(ye=>ye.listingId===s);if(ve){if(!A)return;if(ve.listingKind!=="service"){A&&(b("This listing is not a service. Please use the correct link."),l(!1));return}a(ve),l(!1),te=!0;break}if(!X.nextCursor)break;L=X.nextCursor,P++}if(!A)return;te||b(Ln)}}catch(I){if(A){const T=I instanceof Error?I.message:String(I);T.includes("not found")||T.includes("404")?b(Rn):b(`Failed to load service: ${T}`),l(!1)}}finally{A&&l(!1)}})(),()=>{A=!1}},[s,n]);const d=u.useMemo(()=>fi(r??void 0),[r]),c=u.useMemo(()=>(d==null?void 0:d.serviceData)??{},[d==null?void 0:d.serviceData]),p=d==null?void 0:d.serviceType,f=u.useMemo(()=>kr(c.offerings??[]),[c.offerings]),h=(d==null?void 0:d.metadata)??{},x=((_=h==null?void 0:h.policies)==null?void 0:_.cancellationPolicy)??Rt,y=typeof((g=h==null?void 0:h.policies)==null?void 0:g.cancellationNotes)=="string"?h.policies.cancellationNotes:void 0,[o,E]=u.useState(null);u.useEffect(()=>{async function A(){if(s)try{const z=await fetch(At(`/public/venues/${s}/host`),{credentials:"include"});if(!z.ok||!(z.headers.get("content-type")||"").includes("application/json"))return;const q=await z.json();if(!q)return;E(q.profile??q)}catch(z){console.error("Failed to load host profile",z)}}A()},[s]);const V=(d==null?void 0:d.availability)??h.availability??{},O=(h==null?void 0:h.publishing)??{},N=u.useMemo(()=>{var q,I;const A=mt((q=d==null?void 0:d.availability)==null?void 0:q.acceptsInstantBookings);if(typeof A=="boolean")return A;const z=mt((I=h.availability)==null?void 0:I.acceptsInstantBookings);if(typeof z=="boolean")return z;const W=mt(O.acceptsInstantBookings);return typeof W=="boolean"?W:!1},[(S=d==null?void 0:d.availability)==null?void 0:S.acceptsInstantBookings,(k=h.availability)==null?void 0:k.acceptsInstantBookings,O.acceptsInstantBookings]);u.useEffect(()=>{var A,z,W,q;typeof window>"u"||window.localStorage.getItem("debugBookingMode")==="1"&&console.debug("[booking-mode-debug][service-detail]",{listingId:r==null?void 0:r.listingId,status:r==null?void 0:r.status,resolvedAcceptsInstantBookings:N,sources:{effectiveAvailability:(A=d==null?void 0:d.availability)==null?void 0:A.acceptsInstantBookings,metadataAvailability:(z=h.availability)==null?void 0:z.acceptsInstantBookings,metadataPublishing:O.acceptsInstantBookings},sourceTypes:{effectiveAvailability:typeof((W=d==null?void 0:d.availability)==null?void 0:W.acceptsInstantBookings),metadataAvailability:typeof((q=h.availability)==null?void 0:q.acceptsInstantBookings),metadataPublishing:typeof O.acceptsInstantBookings}})},[r==null?void 0:r.listingId,r==null?void 0:r.status,N,(w=d==null?void 0:d.availability)==null?void 0:w.acceptsInstantBookings,(H=h.availability)==null?void 0:H.acceptsInstantBookings,O.acceptsInstantBookings]);const M=u.useMemo(()=>{const A=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],z=Array.isArray(V.weeklySchedule)?V.weeklySchedule:null,W=!Array.isArray(V.weeklySchedule)&&V.weeklySchedule&&typeof V.weeklySchedule=="object"?V.weeklySchedule:null,q=j=>{if(typeof j!="string")return null;const L=j.trim().match(/^(\d{1,2}):(\d{2})/);if(!L)return null;const P=Number(L[1]),Y=Number(L[2]);return Number.isNaN(P)||Number.isNaN(Y)||P<0||P>23||Y<0||Y>59?null:`${String(P).padStart(2,"0")}:${String(Y).padStart(2,"0")}`};if(z&&z.length>0)return[...z].sort((j,L)=>{const P=((j==null?void 0:j.day)??"").toLowerCase(),Y=((L==null?void 0:L.day)??"").toLowerCase();return A.indexOf(P)-A.indexOf(Y)}).map(j=>{const L=j,P=Array.isArray(L.windows)?L.windows.map(X=>({from:q(X==null?void 0:X.from),to:q(X==null?void 0:X.to)})).filter(X=>typeof X.from=="string"&&typeof X.to=="string"):[],Y=q(L.from),te=q(L.to);return{...L,day:(L.day??"").toLowerCase(),enabled:L.enabled===!0,from:Y,to:te,windows:P.length>0?P:Y&&te?[{from:Y,to:te}]:[]}});if(W){const j=A.filter(L=>W[L]).map(L=>({day:L,enabled:W[L].enabled===!0,from:q(W[L].from),to:q(W[L].to),windows:Array.isArray(W[L].windows)?W[L].windows.map(P=>({from:q(P==null?void 0:P.from),to:q(P==null?void 0:P.to)})).filter(P=>typeof P.from=="string"&&typeof P.to=="string"):[]}));if(j.length>0)return j}const I=(d==null?void 0:d.businessHours)??(c==null?void 0:c.businessHours)??{},T=A.filter(j=>I[j]).map(j=>{const L=q(I[j].open??I[j].from),P=q(I[j].close??I[j].to);return{day:j,enabled:I[j].enabled===!0||I[j].closed!==!0,from:L,to:P,windows:L&&P?[{from:L,to:P}]:[]}});return T.length>0?T:[]},[V.weeklySchedule,d,c==null?void 0:c.businessHours]),D=Array.isArray(V.blockedDates)?V.blockedDates.filter(A=>typeof A=="string"):[],{unavailableDates:C}=Qa(r==null?void 0:r.listingId,{enabled:!0}),v=C.length>0?C:D;return{listing:r,isLoading:i,error:m,notFound:!n&&(m===Ln||m===Rn),effectiveData:d,serviceData:c,serviceType:p,offerings:f,metadata:h,hostProfileData:o,availability:V,acceptsInstantBookings:N,schedule:M,blockedDates:v,cancellationPolicy:x,cancellationNotes:y,isPreviewMode:n}}function Sl(s){return s.type==="video"&&typeof s.url=="string"&&s.url.trim().length>0}function Tl({listing:s,effectiveData:t,serviceData:n,offerings:r,hostProfileData:a,metadata:i,serviceType:l}){var M,D,C,v,R,_;const m=Na.find(g=>g.id===l),b=n.aboutMe??{},d=u.useMemo(()=>{var S,k;if(n.cardTitle)return n.cardTitle;const g=(S=n.businessInfo)==null?void 0:S.businessName;return g||(r.length>0&&r[0].name?r[0].name:`${(m==null?void 0:m.label)||"Service"}${(k=t==null?void 0:t.location)!=null&&k.city?` in ${t.location.city}`:""}`)},[n,r,m,t]),c=u.useMemo(()=>{const g=i.hostProfile??i.host??{},S=g&&typeof g=="object"?g:{},k=(a==null?void 0:a.photoURL)||(a==null?void 0:a.photoUrl)||(a==null?void 0:a.avatar)||(a==null?void 0:a.image)||void 0;return{...S,...a||{},avatar:k}},[i.hostProfile,i.host,a]),p=u.useMemo(()=>{const g=typeof c.firstName=="string"?c.firstName.trim():"",S=typeof c.lastName=="string"?c.lastName.trim():"";return g||S?`${g} ${S}`.trim():typeof c.name=="string"&&c.name.trim().length>0?c.name.trim():d.split(" ")[0]||"Service Provider"},[c.firstName,c.lastName,c.name,d]),f=typeof c.avatar=="string"&&c.avatar?c.avatar:null,h=u.useMemo(()=>{const g=t==null?void 0:t.location;return g!=null&&g.city&&(g!=null&&g.state)?`${g.city}, ${g.state}`:(s==null?void 0:s.locationLabel)||"Location not specified"},[s,t]),x=u.useMemo(()=>{var k,w,H;const g=(k=n.coverImage)==null?void 0:k.trim(),S=(H=(w=t==null?void 0:t.media)==null?void 0:w.coverImage)==null?void 0:H.trim();return g||S||(r.length>0&&r[0].image?r[0].image:Ws)},[n.coverImage,(M=t==null?void 0:t.media)==null?void 0:M.coverImage,r]),y=u.useMemo(()=>{var W,q,I,T;const g=new Set,S=new Set,k=j=>{const L=j==null?void 0:j.trim();if(!L||g.has(L))return null;const P=va(L);return S.has(P)?null:(g.add(L),S.add(P),L)},w=[],H=(W=n.coverImage)==null?void 0:W.trim(),A=(I=(q=t==null?void 0:t.media)==null?void 0:q.coverImage)==null?void 0:I.trim(),z=((T=t==null?void 0:t.media)==null?void 0:T.gallery)??[];if(H){const j=k(H);j&&w.push(j)}if(A){const j=k(A);j&&w.push(j)}return z.forEach(j=>{if(j.type==="photo"&&j.url){const L=k(j.url);L&&w.push(L)}}),r.forEach(j=>{if(j.image){const L=k(j.image);L&&w.push(L)}}),w.length>0?w:[Ws]},[n.coverImage,(D=t==null?void 0:t.media)==null?void 0:D.coverImage,(C=t==null?void 0:t.media)==null?void 0:C.gallery,r]),o=u.useMemo(()=>{var S;return(((S=t==null?void 0:t.media)==null?void 0:S.gallery)??[]).filter(Sl).sort((k,w)=>(k.order??0)-(w.order??0)).map(k=>k.url.trim())},[(v=t==null?void 0:t.media)==null?void 0:v.gallery]),E=u.useMemo(()=>{var g,S,k,w;return(g=n.description)!=null&&g.trim()?n.description.trim():(S=n.cardDescription)!=null&&S.trim()?n.cardDescription.trim():(w=(k=t==null?void 0:t.basics)==null?void 0:k.description)!=null&&w.trim()?t.basics.description.trim():"No description available."},[n.description,n.cardDescription,(R=t==null?void 0:t.basics)==null?void 0:R.description]),V=u.useMemo(()=>{var g,S,k;return(g=n.tagline)!=null&&g.trim()?n.tagline.trim():(k=(S=t==null?void 0:t.basics)==null?void 0:S.tagline)!=null&&k.trim()?t.basics.tagline.trim():null},[n.tagline,(_=t==null?void 0:t.basics)==null?void 0:_.tagline]),O=u.useMemo(()=>{var A;if(r.length===0)return null;const g=r.map(z=>ws(z)).filter(z=>typeof z=="number"&&z>0);if(g.length===0)return null;const S=Math.min(...g),k=Math.max(...g),w=(A=r[0])==null?void 0:A.priceType;return{min:S,max:k,label:w==="per_person"||w==="per_guest"?"per guest":w==="per_hour"?"per hour":w==="per_event"||w==="fixed"?"per event":""}},[r]),N=u.useMemo(()=>{var S;return((S=r.map(k=>({minimum:Ls(k),startingPrice:ws(k)})).filter(k=>k.minimum!==null).sort((k,w)=>(k.startingPrice??Number.POSITIVE_INFINITY)-(w.startingPrice??Number.POSITIVE_INFINITY)||k.minimum.minGuests-w.minimum.minGuests)[0])==null?void 0:S.minimum)??null},[r]);return{serviceName:d,hostDisplayName:p,hostAvatar:f,hostProfile:c,locationLabel:h,coverImage:x,galleryImages:y,galleryVideos:o,description:E,tagline:V,pricingRange:O,minimumBooking:N,aboutMe:b,serviceTypeInfo:m}}const Ml=s=>Math.round(s*10)/10;function kl(s){if(!s)return null;const t=Number(s.hours??0),n=Number(s.minutes??0);if(!Number.isFinite(t)||!Number.isFinite(n))return null;const r=Math.max(0,t)+Math.max(0,n)/60;return r<=0?null:r}function it({calculatedHours:s,packageDuration:t,packageName:n}){if(!Number.isFinite(s)||s<=0)return null;const r=kl(t);return r==null?null:s+1e-4<r?{title:"Duration too short",description:`${n?`"${n}"`:"This package"} requires at least ${Ml(r)} hour${r===1?"":"s"}.`}:null}const Il=s=>{var i,l;const t=(i=s==null?void 0:s.guestLimit)==null?void 0:i.min,n=(l=s==null?void 0:s.guestLimit)==null?void 0:l.max,r=Ys(t)?Math.max(1,t):1,a=Ys(n)?Math.max(r,n):void 0;return{min:r,max:a}},Cs=s=>{var i,l;const t=Il(s),n=Ys((i=s==null?void 0:s.guestLimit)==null?void 0:i.min)||Ys((l=s==null?void 0:s.guestLimit)==null?void 0:l.max),r=s==null?void 0:s.priceType;return{...t,requiresGuests:r==="per_person"||r==="per_guest"||n,hasExplicitBounds:n}},Ir=(s,t)=>s.requiresGuests?t:1,Ar=(s,t)=>typeof t.max=="number"?Math.max(t.min,Math.min(t.max,s)):Math.max(t.min,s),Al=s=>{const{enteredValue:t,adjustedValue:n,bounds:r,packageName:a}=s;return t===n?null:typeof r.max=="number"&&t>r.max?`"${a}" allows a maximum of ${r.max} guests. Adjusted to ${n}.`:t<r.min?`"${a}" requires at least ${r.min} guests. Adjusted to ${n}.`:null};function El({listing:s,selectedBookingPackage:t,selectedDate:n,startTime:r,endTime:a,guestCount:i,selectedAddOns:l,sliderSelections:m=[],eventLocation:b=null}){var C;const d=u.useMemo(()=>Cs(t),[t]),c=Ir(d,i),p=as(b)?b:null,f=u.useMemo(()=>{var v,R;if(!r||!a)return((v=t==null?void 0:t.duration)==null?void 0:v.hours)||1;try{const[_,g]=r.split(":").map(Number),[S,k]=a.split(":").map(Number),w=_*60+(g||0);let A=S*60+(k||0)-w;return A<0&&(A+=24*60),A/60}catch{return((R=t==null?void 0:t.duration)==null?void 0:R.hours)||1}},[r,a,t]),h=u.useMemo(()=>{if(!t)return 0;if(t.pricingMode==="self_service_range")return mr(t.sliders??[],m);const v=t.price||0,R=t.priceType;return R==="per_person"||R==="per_guest"?v*i:R==="per_hour"?v*f:v},[t,i,f,m]),x=u.useMemo(()=>{if(!n||!r||!a||r===a)return null;try{const v=he(n,"yyyy-MM-dd"),{startDateTime:R,endDateTime:_}=ps(v,r,a),g=new Date(R),S=new Date(_);return isNaN(g.getTime())||isNaN(S.getTime())||S<=g?null:{startDateTime:R,endDateTime:_}}catch{return null}},[n,r,a]),y=u.useMemo(()=>{if(!(s!=null&&s.listingId)||!t||!x||t.pricingMode==="negotiable_range"||!rt([t],m)||d.requiresGuests&&i<d.min||it({calculatedHours:f,packageDuration:t.duration,packageName:t.name}))return!1;const v=d.max;return!(d.requiresGuests&&typeof v=="number"&&i>v)},[s==null?void 0:s.listingId,t,x,i,f,d,m]),{data:o,status:E,error:V,isPlaceholderData:O}=wa({queryKey:["service-pricing-preview",s==null?void 0:s.listingId,t==null?void 0:t.id,x==null?void 0:x.startDateTime,x==null?void 0:x.endDateTime,c,l,m,(p==null?void 0:p.placeId)??null,(p==null?void 0:p.formattedAddress)??null],queryFn:({signal:v})=>nr({listingId:(s==null?void 0:s.listingId)??"",startTime:(x==null?void 0:x.startDateTime)??"",endTime:(x==null?void 0:x.endDateTime)??"",guestCount:c,selectedPackageId:(t==null?void 0:t.id)??"",selectedAddOns:l,sliderSelections:m,eventLocation:p,signal:v}),enabled:y,staleTime:3e4,placeholderData:Ca}),N=y?E==="pending"?{status:"loading"}:E==="error"?{status:"error",error:V instanceof Error?V.message:"Failed to fetch pricing preview"}:{status:"success",isRefreshing:O,subtotal:o==null?void 0:o.subtotal,serviceFee:o==null?void 0:o.serviceFee,total:o==null?void 0:o.total,guestTotalCents:o==null?void 0:o.guestTotalCents,twoModelBreakdown:(o==null?void 0:o.twoModelBreakdown)??null,feeDisclosure:(o==null?void 0:o.feeDisclosure)??null,deposit:(o==null?void 0:o.deposit)??null,pricingNotices:(o==null?void 0:o.pricingNotices)??[],displayBreakdown:(o==null?void 0:o.displayBreakdown)??null,taxStatus:o==null?void 0:o.taxStatus,taxAmountCents:o==null?void 0:o.taxAmountCents,taxJurisdictionCollected:o==null?void 0:o.taxJurisdictionCollected,selectionSnapshots:(C=o==null?void 0:o.selectionSnapshots)==null?void 0:C.map(v=>({selectionType:v.selectionType,sourceEntityId:v.sourceEntityId,name:v.name,priceModel:v.priceModel,quantity:v.quantity,unitPrice:v.unitPrice,baseAmount:v.baseAmount,timelineAdjustment:v.timelineAdjustment,finalAmount:v.finalAmount,includesVenueRental:v.includesVenueRental}))}:{status:"idle"},M=N.status==="success"?{subtotal:N.subtotal,serviceFee:N.serviceFee,total:N.total}:null,D=u.useMemo(()=>t?un({authoritative:M,derivedSubtotal:null,derivedServiceFee:null,derivedTotal:null,notes:"Select a date and time to see the total including service fees."}):un({notes:"Final total and applicable sales tax are confirmed in cart and checkout."}),[t,N]);return{calculatedHours:f,calculatedPrice:h,servicePricingBreakdown:D,previewState:N}}const _s=15,hs=24*60,Ll=/^(?:[01]\d|2[0-3]):[0-5]\d$/,Rl=(s,t)=>{var r;const n=((r=s.get(t))==null?void 0:r.trim())??"";return Ll.test(n)?n:""},$n=(s,t,n)=>{var l;const r=Rl(s,t);if(r)return r;const a=(l=s.get(n))==null?void 0:l.trim();if(!a)return"";const i=new Date(a);return Number.isNaN(i.getTime())?"":`${String(i.getUTCHours()).padStart(2,"0")}:${String(i.getUTCMinutes()).padStart(2,"0")}`},qn=s=>{const t=Number(s.get("guests"));return Number.isSafeInteger(t)&&t>0?t:0},$l=s=>{if(s.length===0)return[];const t=[...s].sort((r,a)=>r.start-a.start),n=[];for(const r of t){const a=n[n.length-1];if(!a){n.push({...r});continue}r.start<=a.end?a.end=Math.max(a.end,r.end):n.push({...r})}return n},ql=s=>{const t=s.map(r=>{const a=We(r.from),i=We(r.to);return i<=a?null:{start:a,end:i}}).filter(r=>r!=null).sort((r,a)=>r.start-a.start);let n=0;for(const r of t){if(r.start>n)break;n=Math.max(n,r.end)}return n},Er=(s,t)=>{var c,p;if(!s)return[];const n=new Date(s.getFullYear(),s.getMonth(),s.getDate());if(Number.isNaN(n.getTime()))return[];const r=xn(n),a=new Date(n);a.setDate(a.getDate()+1);const i=xn(a),l=((c=hn(r,t))==null?void 0:c.windows)??[],m=((p=hn(i,t))==null?void 0:p.windows)??[],b=ql(m),d=[];for(const f of l){const h=We(f.from),x=We(f.to);if(h===x)continue;if(x>h){d.push({start:h,end:x});continue}d.push({start:h,end:hs});const y=Math.min(x,b);y>0&&d.push({start:hs,end:hs+y})}return $l(d)},Nt=(s,t)=>{if(t.length===0)return null;const n=t.findIndex(a=>s>=a.start&&s<a.end);if(n<0)return null;let r=t[n].end;for(let a=n+1;a<t.length;a+=1){const i=t[a];if(i.start>r)break;r=Math.max(r,i.end)}return r},ht=(s,{minAbs:t=0,maxAbs:n=Number.POSITIVE_INFINITY,includeEnd:r=!1}={})=>{const a=[];for(const i of s){const l=Math.max(i.start,t),m=Math.min(i.end,n);if(m<=l)continue;const b=Math.ceil(l/_s)*_s,d=r?m:m-_s;for(let c=b;c<=d;c+=_s)a.push({value:yi(c),isNextDay:c>=hs})}return a},_n=s=>[...s].sort((t,n)=>We(t.value)-We(n.value));function Dn(s){if(!s.startTime||!s.endTime)return null;try{const t=new Date(s.startTime),n=new Date(s.endTime);if(Number.isNaN(t.getTime())||Number.isNaN(n.getTime()))return null;const r=he(t,"yyyy-MM-dd"),a=`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`,i=`${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}`;return{dateYmd:r,startHHmm:a,endHHmm:i}}catch{return null}}function On(s){const t=s.find(r=>(r.listingKind==="venue"||r.type==="venue")&&r.startTime&&r.endTime);return t||(s.find(r=>(r.listingKind==="service"||r.type==="service")&&r.startTime&&r.endTime)??null)}function Pn(s,t,n,r){if(!t||!n||!s)return!1;if(r.length===0)return!0;const[a,i,l]=s.split("-").map(Number);if(!a||!i||!l)return!1;const m=new Date(a,i-1,l);if(Number.isNaN(m.getTime()))return!1;const b=Er(m,r);if(b.length===0)return!1;const d=We(t),c=We(n),p=Nt(d,b);if(p==null)return!1;const f=c>d?c:c+hs;return!(f>p||d+ds*60>f)}function _l({offerings:s,schedule:t,blockedDates:n,bookingWindowDays:r,minimumLeadTimeHours:a,cartItems:i,acceptsInstantBookings:l,eventShell:m}){var ls,os,Ye,cs;const[b]=Ct(),[d,c]=u.useState(!1),[p,f]=u.useState(null),[h,x]=u.useState(()=>{const U=b.get("check_in")||b.get("date");if(!U)return null;const B=Zs(U);return isNaN(B.getTime())?null:B}),[y,o]=u.useState(()=>$n(b,"startTime","start")),[E,V]=u.useState(()=>$n(b,"endTime","end")),[O,N]=u.useState(ds*60),[M,D]=u.useState(()=>qn(b)),[C,v]=u.useState(()=>{const U=qn(b);return U>0?String(U):""}),[R,_]=u.useState([]),[g,S]=u.useState([]),[k,w]=u.useState(null),[H,A]=u.useState(null),[z,W]=u.useState(null),q=u.useRef(!1),I=u.useRef(!1),T=u.useCallback(U=>o(U),[]),j=u.useCallback(U=>V(U),[]),L=u.useCallback(U=>{const B=Math.max(ds*60,U);N(B),o(J=>{if(J){const ee=ut(J,B);ee&&V(ee)}return J})},[]),P=u.useMemo(()=>{if(!y||!E)return O;const[U,B]=y.split(":").map(Number),[J,ee]=E.split(":").map(Number);if([U,B,J,ee].some(we=>!Number.isFinite(we)))return O;let K=J*60+(ee||0)-(U*60+(B||0));return K<0&&(K+=24*60),K>0?K:O},[y,E,O]);u.useEffect(()=>{if(P<=0)return;const U=Math.max(ds*60,P);U!==O&&N(U)},[P,O]),u.useEffect(()=>{if(!y||E)return;const U=ut(y,O);U&&V(U)},[y,E]),u.useEffect(()=>{v(M>0?M.toString():"")},[M]),u.useEffect(()=>{if(!p||M>0)return;const U=Cs(p);U.hasExplicitBounds&&D(U.min)},[p,M]),u.useEffect(()=>{!p||s.some(B=>B.id===p.id&&Os(B))||(f(null),c(!1),_([]),S([]))},[s,p]);const Y=u.useMemo(()=>Er(h,t),[h,t]),te=u.useMemo(()=>Y.length===0?[]:ht(Y,{maxAbs:hs-1,includeEnd:!1}).filter(B=>{const J=We(B.value),ee=Nt(J,Y);return ee!=null&&J+ds*60<=ee}),[Y]),X=u.useMemo(()=>{if(Y.length===0)return[];if(!y)return _n(ht(Y,{maxAbs:hs-1,includeEnd:!0}));const U=We(y),B=Nt(U,Y);return B==null?[]:_n(ht(Y,{minAbs:U+ds*60,maxAbs:B,includeEnd:!0}))},[Y,y]),ve=(ls=te[0])==null?void 0:ls.value,ye=(os=te[te.length-1])==null?void 0:os.value,G=(Ye=X[0])==null?void 0:Ye.value,ne=(cs=X[X.length-1])==null?void 0:cs.value,le=u.useMemo(()=>ji({schedule:t,blockedDates:n,bookingWindowDays:r,minimumLeadTimeHours:a}),[t,n,r,a]),oe=le.minDate,ce=le.maxDate,$=le.disabledDates;u.useEffect(()=>{if(!h)return;const U=h.getTime();if(U<oe.getTime()||U>ce.getTime()){x(null),T(""),j("");return}const B=he(h,"yyyy-MM-dd"),J=t.length>0&&!at(h,t);(n.includes(B)||J)&&(x(null),T(""),j(""))},[h,n,t,oe,ce,T,j]),u.useEffect(()=>{if(!h||t.length===0)return;const U=new Set(te.map(J=>J.value)),B=new Set(X.map(J=>J.value));if(y&&!U.has(y)){T(""),j("");return}E&&!B.has(E)&&j("")},[h,t.length,y,E,te,X,T,j]),u.useEffect(()=>{var B;if(t.length===0||!y||!E)return;new Set(X.map(J=>J.value)).has(E)||j(((B=X[0])==null?void 0:B.value)??"")},[t.length,y,E,X,j]);const pe=u.useRef(!1);u.useEffect(()=>{if(pe.current)return;const U=On(i),B=U?Dn(U):null;if(B&&(!l||Pn(B.dateYmd,B.startHHmm,B.endHHmm,t)))try{T(B.startHHmm),j(B.endHHmm),pe.current=!0;return}catch{}pe.current=!0},[i,t,l,T,j]);const Me=u.useRef(!1),Te=u.useRef(h),de=u.useRef(y),Oe=u.useRef(E),qe=u.useRef(M);Te.current=h,de.current=y,Oe.current=E,qe.current=M,u.useEffect(()=>{if(!d){Me.current=!1,A(null),W(null);return}if(Me.current)return;Me.current=!0;const U=On(i),B=U?Dn(U):null;let J=null,ee=null,K=null,we=0,Le=null;if(l?(B&&U&&(J=B.dateYmd,we=U.guestCount||0,Pn(B.dateYmd,B.startHHmm,B.endHHmm,t)&&(ee=B.startHHmm,K=B.endHHmm),Le={source:"cart",dateYmd:B.dateYmd}),A(Le)):(B&&U&&(J=B.dateYmd,ee=B.startHHmm,K=B.endHHmm,we=U.guestCount||0,Le={source:"cart",dateYmd:B.dateYmd}),A(Le)),J&&!Te.current)try{const[Ce,Re,Qe]=J.split("-").map(Number),Pe=new Date(Ce,Re-1,Qe);isNaN(Pe.getTime())||x(Pe)}catch{}l&&J?ee&&K?(T(ee),j(K)):(T(""),j("")):(ee&&!de.current&&T(ee),K&&!Oe.current?j(K):ee&&!Oe.current&&j("22:00")),we>0&&qe.current===0&&D(we)},[d,i,l,t]),u.useEffect(()=>{var B,J,ee;if(!d){I.current=!1;return}if(!m||I.current)return;if(I.current=!0,m.date&&!Te.current)try{const[K,we,Le]=m.date.split("-").map(Number),Ce=new Date(K,we-1,Le);isNaN(Ce.getTime())||x(Ce)}catch{}if(m.time&&!de.current&&(T(m.time),!Oe.current)){const K=Math.max(ds*60,Math.round((m.durationHours||0)*60)),we=ut(m.time,K);we&&j(we)}m.guestCount>0&&qe.current===0&&D(m.guestCount);const U=(J=(B=m.eventLocation)==null?void 0:B.formattedAddress)==null?void 0:J.trim();U&&!((ee=k==null?void 0:k.formattedAddress)!=null&&ee.trim())&&w({formattedAddress:U})},[d,m]),u.useEffect(()=>{var we,Le;if(!d){q.current=!1;return}if(q.current||(we=k==null?void 0:k.formattedAddress)!=null&&we.trim()&&(z==null?void 0:z.source)==="cart_venue")return;const U=(h?he(h,"yyyy-MM-dd"):null)??(H==null?void 0:H.dateYmd)??null,B=i.filter(Ce=>Ce.listingKind==="venue"||Ce.type==="venue"),J=(U?B.find(Ce=>{if(!Ce.startTime)return!1;try{return he(new Date(Ce.startTime),"yyyy-MM-dd")===U}catch{return!1}}):void 0)??B[0];if(!(J!=null&&J.listingId))return;q.current=!0;let ee=!1;const K=(Le=J.location)==null?void 0:Le.trim();return K&&!ee&&(w({formattedAddress:K}),W({source:"cart_venue"})),(async()=>{var Ce,Re,Qe,Pe,Fe,F,ae,be,je,Ie,Ve,Ze;try{const Ss=await fetch(At(`/public/venues/${encodeURIComponent(J.listingId)}`));if(!Ss.ok||ee){!ee&&K?(w({formattedAddress:K}),W({source:"cart_venue"})):q.current=!1;return}const Ae=await Ss.json(),Xe=((Re=(Ce=Ae.publishedData)==null?void 0:Ce.location)==null?void 0:Re.formatted)||((Pe=(Qe=Ae.draftData)==null?void 0:Qe.location)==null?void 0:Pe.formatted),Ts=((Xe==null?void 0:Xe.trim())||K||"").trim();if(!Ts||ee){q.current=!1;return}const Ms=((F=(Fe=Ae.publishedData)==null?void 0:Fe.location)==null?void 0:F.latitude)??((be=(ae=Ae.draftData)==null?void 0:ae.location)==null?void 0:be.latitude),De=((Ie=(je=Ae.publishedData)==null?void 0:je.location)==null?void 0:Ie.longitude)??((Ze=(Ve=Ae.draftData)==null?void 0:Ve.location)==null?void 0:Ze.longitude);w({formattedAddress:Ts,placeId:Ae.googlePlaceId||void 0,lat:typeof Ms=="number"?Ms:void 0,lng:typeof De=="number"?De:void 0}),W({source:"cart_venue"})}catch{if(!ee&&K){w({formattedAddress:K}),W({source:"cart_venue"});return}q.current=!1}})(),()=>{ee=!0}},[d,i,h,H==null?void 0:H.dateYmd,k==null?void 0:k.formattedAddress,z==null?void 0:z.source]);const gs=u.useCallback(U=>{_(B=>B.some(ee=>ee.addOnId===U)?B.filter(ee=>ee.addOnId!==U):[...B,{addOnId:U,quantity:1}])},[]),bs=u.useCallback((U,B)=>{_(J=>B<=0?J.filter(K=>K.addOnId!==U):J.some(K=>K.addOnId===U)?J.map(K=>K.addOnId===U?{...K,quantity:B}:K):[...J,{addOnId:U,quantity:B}])},[]),ge=u.useCallback(()=>_([]),[]),_e=u.useCallback(U=>{const B=s.find(ee=>ee.id===U.id&&Os(ee));if(!B||B.pricingMode==="negotiable_range")return;const J=Cs(B);if(J.hasExplicitBounds){const ee=M>0?Ar(M,J):J.min;D(ee)}f(B),S(vl(B)),c(!0)},[M,s]),Ge=u.useCallback(()=>!p||!s.some(B=>B.id===p.id&&Os(B))?!1:(c(!0),!0),[p,s]),He=u.useCallback(()=>{x(null),f(null),T(""),j(""),D(0),ge(),S([]),w(null),A(null),q.current=!1},[T,j,ge]);return{isBookingFlowOpen:d,setIsBookingFlowOpen:c,selectedBookingPackage:p,setSelectedBookingPackage:f,selectedDate:h,setSelectedDate:x,startTime:y,setStartTime:T,endTime:E,setEndTime:j,durationMinutes:O,setDurationMinutes:L,guestCount:M,setGuestCount:D,guestCountTempValue:C,setGuestCountTempValue:v,handleSelectPackageAndBook:_e,handleShowDates:Ge,resetBookingState:He,startTimeOptions:te,endTimeOptions:X,startTimeMinTime:ve,startTimeMaxTime:ye,endTimeMinTime:G,endTimeMaxTime:ne,serviceDatePickerDisabled:$,datePickerMinDate:oe,datePickerMaxDate:ce,selectedAddOns:R,toggleAddOn:gs,setAddOnQuantity:bs,clearAddOns:ge,sliderSelections:g,setSliderSelections:S,serviceEventLocation:k,setServiceEventLocation:w,bookingAutofillHint:H,addressAutofillHint:z,plannerCalendarHighlights:null}}function Lr({guestCount:s,packageGuestMin:t,packageGuestMax:n,packageName:r}){const a=r?`"${r}"`:"The selected package";return typeof t=="number"&&t>0&&s<t?{title:"Guest count too low",description:`${a} requires a minimum of ${t} guests.`}:typeof n=="number"&&n>0&&s>n?{title:"Guest count too high",description:`${a} allows a maximum of ${n} guests.`}:null}function Dl({listing:s,selectedBookingPackage:t,selectedDate:n,startTime:r,endTime:a,guestCount:i,calculatedHours:l,schedule:m,sliderSelections:b=[],serviceEventLocation:d,charter:c,contactOrg:p,requireOrganizationName:f,specialRequests:h,setSpecialRequests:x,user:y,toast:o,onContinue:E}){const V=St(),O=nt(),[N,M]=u.useState(!1),[D,C]=u.useState([]),v=u.useRef(!1),R=u.useCallback(async()=>{var z,W;if(N)return;if(!y){const q=`${O.pathname}${O.search}`;Qs(O.pathname)?Ks(q):V("/auth?returnTo="+encodeURIComponent(q));return}if(!s){o({title:"Error",description:"Listing information is not available",variant:"destructive"});return}if(f&&!(p??"").trim()){o({title:"Organization name required",description:"This provider requires an organization name to book.",variant:"destructive"});return}const S=!t&&!!c;if(!t&&!S){o({title:"Missing information",description:"Please select a package to book",variant:"destructive"});return}if((t==null?void 0:t.pricingMode)==="negotiable_range"){o({title:"Custom quote required",description:"This package cannot be booked directly. Request a quote from the provider.",variant:"destructive"});return}if(t&&!rt([t],b)){o({title:"Package options required",description:"Adjust every package option to a valid, payable selection.",variant:"destructive"});return}if(s.listingKind!=="service"){o({title:"Error",description:"Invalid listing type.",variant:"destructive"});return}if(!S){if(!n){o({title:"Missing information",description:"Please select an event date",variant:"destructive"});return}if(m.length>0&&!at(n,m)){o({title:"Date not available",description:"The selected date is not available. Please choose a different date.",variant:"destructive"});return}}if(!v.current&&n&&r){const{deviations:q}=await Ka({date:he(n,"yyyy-MM-dd"),time:r,durationHours:l,guestCount:i||void 0,eventLocation:d??void 0});if(q.length>0){C(q);return}}const k=async()=>{try{M(!0),await E()}catch(q){const I=q instanceof Error?q.message:"Failed to start your booking request. Please try again.";o({title:"Error",description:I,variant:"destructive"})}finally{M(!1),v.current=!1,C([])}};if(S){await k();return}if(!r||!a){o({title:"Missing information",description:"Please select both start and end times",variant:"destructive"});return}if(r===a){o({title:"Invalid duration",description:"Start and end time cannot be the same.",variant:"destructive"});return}const w=Cs(t);if(w.requiresGuests&&(!i||i<1)){o({title:"Missing information",description:"Please enter the number of guests (minimum 1)",variant:"destructive"});return}if(w.requiresGuests){const q=Lr({guestCount:i,packageGuestMin:(z=t.guestLimit)==null?void 0:z.min,packageGuestMax:(W=t.guestLimit)==null?void 0:W.max,packageName:t.name});if(q){o({...q,variant:"destructive"});return}}const H=it({calculatedHours:l,packageDuration:t.duration,packageName:t.name});if(H){o({...H,variant:"destructive"});return}if(!as(d)){o({title:"Event address required",description:vs?"Choose a full address from the suggestions so we can confirm the service location.":"Enter the full street address where this service will take place.",variant:"destructive"});return}const A=$t(r,a,n,m);if(A){o({title:"Time not available",description:A,variant:"destructive"});return}if(!l||l<=0||!Number.isFinite(l)){o({title:"Invalid duration",description:"Start time must be before end time. Please check your time selection.",variant:"destructive"});return}await k()},[N,y,s,t,n,r,a,i,l,m,b,d,c,p,f,o,E,V,O]),_=u.useCallback(()=>{v.current=!0,C([]),R()},[R]),g=u.useCallback(()=>{C([])},[]);return{handleRequestBooking:R,isRequestingBooking:N,specialRequests:h,setSpecialRequests:x,eventDeviations:D,confirmEventDeviation:_,dismissEventDeviation:g}}const Ol=1,Is=s=>String(s).padStart(2,"0");function pt(s){const t=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?/.exec(s);if(!t)return null;const[,n,r,a,i,l,m]=t;return Date.UTC(Number(n),Number(r)-1,Number(a),Number(i),Number(l),Number(m??0))}function Fn(s){const t=new Date(s);return`${t.getUTCFullYear()}-${Is(t.getUTCMonth()+1)}-${Is(t.getUTCDate())}T${Is(t.getUTCHours())}:${Is(t.getUTCMinutes())}:${Is(t.getUTCSeconds())}`}function Pl(s){const t=pt(s.startDateTime);if(t===null)throw new Error(`Invalid charter pickup: ${s.startDateTime}`);const n=pt(s.endDateTime),r=n!==null&&n>t,a=s.tripType==="round_trip"?pt(s.returnEndDateTime??s.returnStartDateTime??""):null,i=a!==null&&a>t,l=r?n:i?a:t+Ol*36e5;return{startDateTime:Fn(t),endDateTime:Fn(l),hours:Math.round((l-t)/36e5*100)/100}}function Fl({listing:s,selectedBookingPackage:t,selectedDate:n,startTime:r,endTime:a,guestCount:i,calculatedHours:l,serviceName:m,coverImage:b,schedule:d,toast:c,selectedAddOns:p,sliderSelections:f=[],serviceEventLocation:h,authoritativePricing:x,charterSelection:y,user:o,contactOrg:E,specialRequests:V,requireOrganizationName:O,setIsBookingFlowOpen:N,resetBookingState:M}){const[D,C]=u.useState(!1),[v,R]=u.useState(!1),[_,g]=u.useState(null),[S,k]=u.useState(null),[w,H]=u.useState(!1),[A,z]=u.useState(null),{startCheckout:W}=hr(),q=St(),I=nt(),T=u.useCallback(async()=>{var ve,ye;if(!o){const G=`${I.pathname}${I.search}`;Qs(I.pathname)?Ks(G):q("/auth?returnTo="+encodeURIComponent(G));return}if(!s){c({title:"Error",description:"Listing information is not available",variant:"destructive"});return}if(O&&!(E??"").trim()){c({title:"Organization name required",description:"This provider requires an organization name to book.",variant:"destructive"});return}const Y=!t&&!!y;if(!t&&!Y){c({title:"Missing information",description:"Please select a package to book",variant:"destructive"});return}if((t==null?void 0:t.pricingMode)==="negotiable_range"){c({title:"Custom quote required",description:"This package cannot be booked directly. Request a quote from the provider.",variant:"destructive"});return}if(t&&!rt([t],f)){c({title:"Package options required",description:"Adjust every package option to a valid, payable selection.",variant:"destructive"});return}if(s.listingKind!=="service"){c({title:"Error",description:"Invalid listing type. This listing cannot be booked as a service.",variant:"destructive"});return}if(!Y){if(!n){c({title:"Missing information",description:"Please select an event date",variant:"destructive"});return}if(d.length>0&&!at(n,d)){c({title:"Date not available",description:"The selected date is not available. Please choose a different date.",variant:"destructive"});return}}if(Y){C(!0);try{const{startDateTime:G,endDateTime:ne,hours:le}=Pl(y.charter),{subtotal:oe,serviceFee:ce,plecServiceFee:$,processingFee:pe,total:Me}=y.quote.price,Te={listingId:s.listingId,listingTitle:m,listingKind:"service",startTime:G,endTime:ne,hours:le,guestCount:0,imageUrl:b!==Ws?b:void 0,...(()=>{const de=h??y.eventLocation;return de?{location:de.formattedAddress,latitude:de.lat,longitude:de.lng,eventLocation:de}:{}})(),selectedAddOns:p.length>0?p:void 0,selectedPackageName:y.label,total:Me,subtotal:oe,serviceFee:ce,...pe?{plecServiceFee:$,processingFee:pe}:{},taxStatus:"calculated_at_checkout",...Number.isFinite(Me)?{servedGuestTotalCents:Math.round(Me*100)}:{},charter:y.charter,contactOrg:(E==null?void 0:E.trim())||void 0,specialRequests:(V==null?void 0:V.trim())||void 0};N(!1),M(),W(Te)}catch(G){const ne=G instanceof Error?G.message:"Failed to start checkout. Please try again.";c({title:"Unable to start checkout",description:ne,variant:"destructive"})}finally{C(!1)}return}if(!r||!a){c({title:"Missing information",description:"Please select both start and end times",variant:"destructive"});return}if(r===a){c({title:"Invalid duration",description:"Start and end time cannot be the same.",variant:"destructive"});return}const te=Cs(t);if(te.requiresGuests&&(!i||i<1)){c({title:"Missing information",description:"Please enter the number of guests (minimum 1)",variant:"destructive"});return}if(te.requiresGuests){const G=Lr({guestCount:i,packageGuestMin:(ve=t.guestLimit)==null?void 0:ve.min,packageGuestMax:(ye=t.guestLimit)==null?void 0:ye.max,packageName:t.name});if(G){c({...G,variant:"destructive"});return}}const X=it({calculatedHours:l,packageDuration:t.duration,packageName:t.name});if(X){c({...X,variant:"destructive"});return}if(!as(h)){c({title:"Event address required",description:vs?"Choose a full address from the suggestions so we can confirm the service location.":"Enter the full street address where this service will take place.",variant:"destructive"});return}C(!0);try{const G=he(n,"yyyy-MM-dd"),ne=$t(r,a,n,d);if(ne){c({title:"Time not available",description:ne,variant:"destructive"});return}const{startDateTime:le,endDateTime:oe}=ps(G,r,a);if(!l||l<=0||!Number.isFinite(l)){c({title:"Invalid duration",description:"Start time must be before end time. Please check your time selection.",variant:"destructive"});return}const ce=Ir(te,i),$=typeof(x==null?void 0:x.total)=="number"?x.total:void 0,pe=typeof(x==null?void 0:x.serviceFee)=="number"?x.serviceFee:void 0,Me=typeof(x==null?void 0:x.subtotal)=="number"?x.subtotal:typeof $=="number"&&typeof pe=="number"?$-pe:void 0,Te={listingId:s.listingId,listingTitle:m,listingKind:"service",startTime:le,endTime:oe,hours:l,guestCount:ce,imageUrl:t.image||(b!==Ws?b:void 0),location:h.formattedAddress,latitude:h.lat,longitude:h.lng,eventLocation:h,selectedPackageId:t.id,selectedPackageName:t.name,selectedAddOns:p.length>0?p:void 0,sliderSelections:f.length>0?f:void 0,pricingMode:t.pricingMode??"fixed",total:$,subtotal:Me,serviceFee:pe,twoModelBreakdown:(x==null?void 0:x.twoModelBreakdown)??null,feeDisclosure:(x==null?void 0:x.feeDisclosure)??null,pricingNotices:(x==null?void 0:x.pricingNotices)??[],displayBreakdown:(x==null?void 0:x.displayBreakdown)??null,...Et(x),deposit:(x==null?void 0:x.deposit)??null,...typeof(x==null?void 0:x.servedGuestTotalCents)=="number"?{servedGuestTotalCents:x.servedGuestTotalCents}:{},selectionMode:"package",contactOrg:(E==null?void 0:E.trim())||void 0,specialRequests:(V==null?void 0:V.trim())||void 0,...y?{charter:y.charter}:{},selectedPackages:[{packageId:t.id,packageName:t.name,price:typeof Me=="number"?Me:typeof $=="number"?$:t.price??0}]};N(!1),M(),W(Te)}catch(G){const ne=G instanceof Error?G.message:"Failed to start checkout. Please try again.";c({title:"Unable to start checkout",description:ne,variant:"destructive"})}finally{C(!1)}},[s,t,n,r,a,i,l,m,b,d,c,p,f,h,x,y,E,V,O,N,M,W,o,q,I]),j=u.useCallback(async()=>{R(!1),g(null),k(null)},[]),L=u.useCallback(()=>{H(!1),z(null),g(null)},[]),P=u.useCallback(async()=>{H(!1),z(null),g(null)},[]);return{handleAddToCart:T,isAddingToCart:D,handleReplaceConfirm:j,handleAdjustServiceTime:L,handleAdjustVenueTime:P,showReplaceModal:v,setShowReplaceModal:R,compatibilityResult:S,setCompatibilityResult:k,pendingService:_,setPendingService:g,showTimeConflictModal:w,setShowTimeConflictModal:H,timeConflictData:A,setTimeConflictData:z}}function Bl({isMobile:s,isDialogOpen:t}){const n=u.useRef(null),r=u.useRef(null),[a,i]=u.useState(!1);return u.useEffect(()=>{if(!s)return;let l,m;const b=()=>{const d=r.current;if(!d){m=setTimeout(b,100);return}const c=()=>i(d.scrollTop>100);c(),d.addEventListener("scroll",c,{passive:!0}),l=()=>d.removeEventListener("scroll",c)};return b(),()=>{m&&clearTimeout(m),l&&l()}},[s]),{stickyCardRef:n,scrollContainerRef:r,stickyCardPosition:null,isScrolled:a}}const Gl=({isOpen:s,onClose:t,onConfirm:n,existingDate:r,newDate:a})=>{const i=l=>{try{const m=l.includes("T")?Zs(l):new Date(l+"T12:00:00");return he(m,"EEEE, MMMM d, yyyy")}catch{return l}};return s?e.jsx(pr,{children:e.jsxs("div",{className:"fixed inset-0 z-[10003] flex items-center justify-center pointer-events-none",children:[e.jsx(et.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 bg-black/50 backdrop-blur-sm pointer-events-auto",onClick:t}),e.jsxs(et.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},className:"relative bg-white rounded-3xl shadow-2xl max-w-md w-full mx-4 overflow-hidden pointer-events-auto flex flex-col max-h-[90vh] my-4",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-orange-100 rounded-full",children:e.jsx(Sa,{className:"h-5 w-5 text-orange-600"})}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Replace Current Event?"})]}),e.jsx("button",{onClick:t,className:zs.modal.closeButton.buttonClassName,"aria-label":"Close",children:e.jsx(It,{className:zs.modal.closeButton.iconSize})})]}),e.jsxs("div",{className:"p-6 space-y-6 overflow-y-auto flex-1 min-h-0",style:{maxHeight:"calc(90vh - 240px)"},children:[e.jsx("p",{className:"text-gray-600",children:"You already have items for a different date. Adding this item will replace your current celebration."}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-4 p-4 bg-gray-50 rounded-xl",children:[e.jsx(jt,{className:"h-5 w-5 text-gray-400 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm text-gray-500 mb-1",children:"Current Event"}),e.jsx("p",{className:"font-semibold text-gray-900",children:i(r)})]})]}),e.jsx("div",{className:"flex items-center justify-center",children:e.jsx("div",{className:"h-0.5 w-12 bg-gray-300"})}),e.jsxs("div",{className:"flex items-start gap-4 p-4 bg-brand/5 border border-brand/20 rounded-xl",children:[e.jsx(jt,{className:"h-5 w-5 text-brand mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm text-brand mb-1",children:"New Event"}),e.jsx("p",{className:"font-semibold text-gray-900",children:i(a)})]})]})]}),e.jsx("div",{className:"p-4 bg-orange-50 border border-orange-200 rounded-xl",children:e.jsx("p",{className:"text-sm text-orange-800",children:"⚠️ This will clear all items in your current cart and start a new celebration."})})]}),e.jsxs("div",{className:"flex gap-3 p-6 border-t border-gray-200 bg-gray-50 flex-shrink-0",children:[e.jsx("button",{onClick:t,className:"flex-1 px-4 py-3 rounded-xl border border-gray-300 text-gray-700 font-medium hover:bg-gray-100 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:n,className:"flex-1 px-4 py-3 rounded-xl bg-gradient-to-r from-brand via-brand-400 to-brand hover:brightness-110 text-white font-medium transition-colors",children:"Replace & Continue"})]})]})]})}):null},Hl=({isOpen:s,onClose:t,onAdjustTime:n,onAdjustOtherTime:r,onMessageProvider:a,conflictType:i,venueTimeWindow:l,serviceTimeWindow:m,existingServiceTimes:b})=>{const d=f=>{try{const h=Zs(f);return he(h,"h:mm a")}catch{return f}},c=f=>{try{const h=Zs(f);return he(h,"EEEE, MMMM d, yyyy")}catch{return f}};if(!s)return null;const p=i==="service-to-venue";return e.jsx(pr,{children:e.jsxs("div",{className:"fixed inset-0 z-[10003] flex items-center justify-center pointer-events-none",children:[e.jsx(et.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 bg-black/50 backdrop-blur-sm pointer-events-auto",onClick:t,onWheel:f=>f.stopPropagation(),onTouchMove:f=>f.stopPropagation()}),e.jsxs(et.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},className:"relative bg-white rounded-3xl shadow-2xl max-w-lg w-full mx-4 overflow-hidden pointer-events-auto flex flex-col max-h-[90vh] my-4",onWheel:f=>f.stopPropagation(),onTouchMove:f=>f.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-orange-100 rounded-full",children:e.jsx($e,{className:"h-5 w-5 text-orange-600"})}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:p?"Time Conflict":"Venue Time Conflict"})]}),e.jsx("button",{onClick:t,className:zs.modal.closeButton.buttonClassName,"aria-label":"Close",children:e.jsx(It,{className:zs.modal.closeButton.iconSize})})]}),e.jsxs("div",{className:"p-6 space-y-6 overflow-y-auto flex-1 min-h-0 overscroll-contain",style:{maxHeight:"calc(90vh - 240px)"},onWheel:f=>{f.stopPropagation()},onTouchMove:f=>{f.stopPropagation()},children:[p&&l&&m?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-gray-600",children:"The service time doesn't fit within your venue's booking window. Please adjust the service time to match your venue availability."}),e.jsxs("div",{className:"p-4 bg-blue-50 border border-blue-200 rounded-xl",children:[e.jsxs("p",{className:"text-sm text-blue-900 font-semibold mb-2",children:["Your Venue: ",l.venueTitle]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-blue-800",children:[e.jsx($e,{className:"h-4 w-4"}),e.jsxs("span",{children:["Date: ",c(l.startTime)]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-blue-800",children:[e.jsx($e,{className:"h-4 w-4"}),e.jsxs("span",{children:["Available: ",d(l.startTime)," - ",d(l.endTime)]})]})]})]}),e.jsxs("div",{className:"p-4 bg-orange-50 border border-orange-200 rounded-xl",children:[e.jsxs("p",{className:"text-sm text-orange-900 font-semibold mb-2",children:["Service: ",m.serviceTitle]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-orange-800",children:[e.jsx($e,{className:"h-4 w-4"}),e.jsxs("span",{children:["Date: ",c(m.startTime)]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-orange-800",children:[e.jsx($e,{className:"h-4 w-4"}),e.jsxs("span",{children:["Selected: ",d(m.startTime)," - ",d(m.endTime)]})]})]}),c(l.startTime)!==c(m.startTime)?e.jsx("p",{className:"text-xs text-orange-700 mt-2 font-semibold",children:"⚠️ Date mismatch: Service is on a different date than the venue"}):e.jsx("p",{className:"text-xs text-orange-700 mt-2",children:"⚠️ This time extends outside the venue window"})]})]}):!p&&b&&b.length>0?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-gray-600",children:"The venue time doesn't cover all your selected services. Please adjust the venue time to include all service windows, or contact the venue host."}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-semibold text-gray-900 mb-2",children:"Services that need coverage:"}),b.map((f,h)=>{const x=c(f.startTime),y=l?c(l.startTime):null,o=y&&x!==y;return e.jsxs("div",{className:"p-3 bg-gray-50 rounded-lg",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:f.title}),e.jsxs("div",{className:"space-y-1 mt-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-600",children:[e.jsx($e,{className:"h-3 w-3"}),e.jsxs("span",{children:["Date: ",x]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-600",children:[e.jsx($e,{className:"h-3 w-3"}),e.jsxs("span",{children:[d(f.startTime)," - ",d(f.endTime)]})]}),o&&e.jsx("p",{className:"text-xs text-orange-700 font-semibold mt-1",children:"⚠️ Date mismatch: Service is on a different date than the venue"})]})]},h)})]})]}):null,e.jsx("div",{className:"p-4 bg-gray-50 border border-gray-200 rounded-xl",children:e.jsxs("p",{className:"text-sm text-gray-700",children:["You can adjust the time to fit, or message the ",p?"service provider":"venue host"," to discuss alternative arrangements."]})})]}),e.jsxs("div",{className:"flex flex-col gap-3 p-6 border-t border-gray-200 bg-gray-50 flex-shrink-0",children:[p&&e.jsx(Z,{onClick:n,className:"w-full bg-gradient-to-r from-brand via-brand-400 to-brand hover:brightness-110 text-white",children:"Adjust Service Time"}),!p&&r&&e.jsx(Z,{onClick:r,className:"w-full bg-gradient-to-r from-brand via-brand-400 to-brand hover:brightness-110 text-white",children:"Adjust Service Times"}),e.jsxs(Z,{onClick:a,variant:"outline",className:"w-full border-gray-300",children:[e.jsx(Ta,{className:"h-4 w-4 mr-2"}),"Message ",p?"Service Provider":"Venue Host"]}),e.jsx(Z,{onClick:t,variant:"ghost",className:"w-full text-gray-600 hover:text-gray-900",children:"Cancel"})]})]})]})})};async function Rr(s){const{signal:t,...n}=s,r=await fetch(At("/charter/quote"),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n),signal:t}),a=await r.json().catch(()=>({}));if(!r.ok){const l=typeof(a==null?void 0:a.message)=="string"?a.message:"Failed to fetch charter quote";throw new Error(l)}const i=(a==null?void 0:a.price)??{};return{miles:Number((a==null?void 0:a.miles)??0),hours:Number((a==null?void 0:a.hours)??0),price:{subtotal:Number((i==null?void 0:i.subtotal)??0),serviceFee:Number((i==null?void 0:i.serviceFee)??0),...typeof(i==null?void 0:i.processingFee)=="number"?{plecServiceFee:Number((i==null?void 0:i.plecServiceFee)??0),processingFee:Number(i.processingFee)}:{},total:Number((i==null?void 0:i.total)??0)},quoteToken:String((a==null?void 0:a.quoteToken)??""),expiresAt:a==null?void 0:a.expiresAt,formula:a==null?void 0:a.formula,formulaVersion:a==null?void 0:a.formulaVersion}}let Bn=0;const ft=()=>(Bn+=1,`stop-${Bn}`),Vl=400;function vt({listingId:s,vehicles:t,onQuote:n,startDateTime:r,endDateTime:a,tripType:i="one_way",returnStartDateTime:l,returnEndDateTime:m,className:b}){const[d,c]=u.useState(()=>{var C;return((C=t[0])==null?void 0:C.id)??""}),[p,f]=u.useState(()=>[{id:ft(),location:null},{id:ft(),location:null}]),[h,x]=u.useState({status:"idle"}),y=vi(wi(Ii)),o=u.useRef(n);u.useEffect(()=>{o.current=n},[n]);const E=u.useMemo(()=>p.map(C=>{var v,R,_,g,S;return{label:((R=(v=C.location)==null?void 0:v.formattedAddress)==null?void 0:R.trim())??"",...(_=C.location)!=null&&_.placeId?{placeId:C.location.placeId}:{},...typeof((g=C.location)==null?void 0:g.lat)=="number"?{lat:C.location.lat}:{},...typeof((S=C.location)==null?void 0:S.lng)=="number"?{lng:C.location.lng}:{}}}),[p]),V=!!d&&!!r&&!!a&&(i!=="round_trip"||!!l&&!!m)&&E.length>=2&&E.every(C=>C.label.length>0);u.useEffect(()=>{if(!V){x({status:"idle"}),o.current(null);return}const C=new AbortController;x(R=>({...R,status:"loading"})),o.current(null);const v=setTimeout(()=>{Rr({listingId:s,vehicleClassId:d,tripType:i,stops:E,startDateTime:r,endDateTime:a,...l?{returnStartDateTime:l}:{},...m?{returnEndDateTime:m}:{},signal:C.signal}).then(R=>{x({status:"success",quote:R}),o.current({charter:{tripType:i,vehicleClassId:d,stops:E,startDateTime:r,endDateTime:a,...l?{returnStartDateTime:l}:{},...m?{returnEndDateTime:m}:{},quoteToken:R.quoteToken},quote:R})}).catch(R=>{C.signal.aborted||(x({status:"error",error:R instanceof Error?R.message:"Could not price this trip"}),o.current(null))})},Vl);return()=>{C.abort(),clearTimeout(v)}},[V,s,d,i,E,r,a,l,m]);const O=(C,v)=>f(R=>R.map(_=>_.id===C?{..._,...v}:_)),N=C=>f(v=>v.length>2?v.filter(R=>R.id!==C):v),M=()=>f(C=>{const v=[...C];return v.splice(v.length-1,0,{id:ft(),location:null}),v}),D=C=>{const{active:v,over:R}=C;!R||v.id===R.id||f(_=>{const g=_.findIndex(k=>k.id===v.id),S=_.findIndex(k=>k.id===R.id);return g===-1||S===-1?_:ki(_,g,S)})};return e.jsxs("div",{className:ue("flex flex-col gap-4",b),children:[t.length>1&&e.jsxs("div",{className:"flex flex-col gap-2",role:"radiogroup","aria-label":"Vehicle",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Vehicle"}),t.map(C=>{const v=C.id===d;return e.jsxs("button",{type:"button",role:"radio","aria-checked":v,"aria-label":C.displayName,onClick:()=>c(C.id),className:ue("flex items-center justify-between gap-3 rounded-lg border px-3 py-2 text-left text-sm transition-colors",v?"border-primary ring-1 ring-primary":"border-input hover:bg-accent"),children:[e.jsx("span",{className:"font-medium",children:C.displayName}),C.seatedCapacity!=null&&e.jsxs("span",{className:"tabular-nums text-muted-foreground",children:[C.seatedCapacity," seats"]})]},C.id)})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Your route"}),e.jsx(Ci,{sensors:y,collisionDetection:Si,onDragEnd:D,children:e.jsx(Ti,{items:p.map(C=>C.id),strategy:Mi,children:e.jsx("div",{className:"flex flex-col gap-2",children:p.map((C,v)=>e.jsx(zl,{stop:C,index:v,total:p.length,onLocationChange:R=>O(C.id,{location:R}),onRemove:()=>N(C.id)},C.id))})})}),e.jsxs(Z,{type:"button",size:"sm",variant:"outline",onClick:M,className:"self-start rounded-full",children:[e.jsx(Yn,{className:"mr-1 h-4 w-4"})," Add stop"]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-card p-3",children:[h.status==="loading"&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(ze,{className:"h-4 w-4 animate-spin"})," Calculating price…"]}),h.status==="idle"&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter your pickup, destination, and any stops to see the price."}),h.status==="error"&&e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:h.error}),h.status==="success"&&h.quote&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-center",children:[e.jsx(Gn,{label:"distance",value:`${h.quote.miles} mi`}),e.jsx(Gn,{label:"hours",value:`${h.quote.hours} h`})]}),e.jsxs("div",{className:"flex items-baseline justify-between border-t border-border pt-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Total"}),e.jsx("span",{"data-testid":"quote-total",className:"text-lg font-semibold tabular-nums",children:Ei(h.quote.price.total)})]})]})]})]})}function Gn({label:s,value:t}){return e.jsxs("div",{className:"rounded-md bg-background/60 p-2",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:s}),e.jsx("div",{className:"text-sm font-medium tabular-nums",children:t})]})}function zl({stop:s,index:t,total:n,onLocationChange:r,onRemove:a}){const{attributes:i,listeners:l,setNodeRef:m,transform:b,transition:d,isDragging:c}=Ai({id:s.id}),p=t===0,f=t===n-1,h=p?"Pickup (start)":f?"Final destination":`Stop ${t}`;return e.jsxs("div",{ref:m,style:{transform:b?`translate3d(${b.x}px, ${b.y}px, 0)`:void 0,transition:d},className:ue("flex items-center gap-2 rounded-lg border border-border bg-background p-2",c&&"opacity-60"),children:[e.jsx("button",{type:"button","aria-label":"Reorder stop",className:"cursor-grab text-muted-foreground",...i,...l,children:e.jsx(Li,{className:"h-4 w-4"})}),e.jsx("div",{className:"flex-1",children:e.jsx(st,{compact:!0,label:"",eventLocation:s.location,onEventLocationChange:r,placeholder:h,inOverlay:!0})}),!p&&!f&&e.jsx(Z,{type:"button",size:"icon",variant:"ghost","aria-label":`Remove stop ${t}`,onClick:a,children:e.jsx(Ma,{className:"h-4 w-4"})})]})}function wt(s,t){var r,a;if(!s)return null;const n=(r=s.charter.stops)==null?void 0:r[0];return{charter:s.charter,quote:s.quote,label:((a=t.find(i=>i.id===s.charter.vehicleClassId))==null?void 0:a.displayName)??"Charter trip",eventLocation:fr(n?{label:n.label,placeId:n.placeId,lat:n.lat,lng:n.lng}:void 0)}}const Ul=({packageName:s,sliders:t,selections:n,onChange:r,servedAmount:a=null})=>{if(t.length===0)return e.jsx("div",{className:"rounded-xl border border-amber-200 bg-amber-50 p-4 text-sm text-amber-800",children:"This package is missing its required pricing options and cannot be booked yet."});const i=c=>{var p;return mn(((p=n.find(f=>f.sliderId===c.id))==null?void 0:p.value)??c.min,c.min,c.max,c.stepSize)},l=(c,p)=>{const f=mn(p,c.min,c.max,c.stepSize);r(t.map(h=>({sliderId:h.id,value:h.id===c.id?f:i(h)})))},m=t.some(c=>c.dimension==="price"),b=m?mr(t,n):null,d=m?b:a;return e.jsxs("div",{className:"space-y-4 rounded-xl border border-brand/30 bg-brand/5 p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-gray-900",children:["Customize ",s]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose every option to calculate the package price."})]}),e.jsx("span",{className:"font-semibold text-gray-900 tabular-nums","data-testid":"self-service-range-amount",children:d!==null?Se(d):"Priced at checkout"})]}),t.map(c=>{const p=i(c),f=c.label||(c.dimension==="price"?"Amount":c.dimension==="time"?"Hours":"Quantity"),h=x=>c.dimension==="price"?Se(x):`${x}${c.unit?` ${c.unit}`:""}`;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx(xe,{htmlFor:`service-slider-${c.id}`,children:f}),e.jsx(si,{label:f,value:p,min:c.min,max:c.max,stepSize:c.stepSize,format:h,onCommit:x=>l(c,x)})]}),e.jsx("input",{id:`service-slider-${c.id}`,"aria-label":f,type:"range",min:c.min,max:c.max,step:c.stepSize&&c.stepSize>0?c.stepSize:1,value:p,onChange:x=>l(c,Number(x.currentTarget.value)),className:"h-2 w-full cursor-pointer accent-brand"}),e.jsxs("div",{className:"flex justify-between text-[11px] text-muted-foreground tabular-nums",children:[e.jsx("span",{children:c.dimension==="price"?Se(c.min):c.min}),e.jsx("span",{children:c.dimension==="price"?Se(c.max):c.max})]})]},c.id)})]})},Wl=({isMobile:s,addOns:t,selectedPackage:n,isPackageDetailOpen:r,setIsPackageDetailOpen:a,offerings:i,isPackageSelectionOpen:l,setIsPackageSelectionOpen:m,bookingFlow:b,pricing:d,cartActions:c,bookingRequest:p,acceptsInstantBookings:f,cartLoading:h,isShareOpen:x,setIsShareOpen:y,onViewPackageDetails:o,onRequestPackageQuote:E,handleMessageProvider:V,toast:O,listingId:N,charterVehicles:M,onCharterChange:D,contactOrg:C="",setContactOrg:v,requireOrganizationName:R=!1,taxJurisdictionCollected:_=!1})=>{const g=nt(),{isBookingFlowOpen:S,setIsBookingFlowOpen:k,selectedBookingPackage:w,setSelectedBookingPackage:H,selectedDate:A,setSelectedDate:z,startTime:W,setStartTime:q,endTime:I,setEndTime:T,guestCount:j,setGuestCount:L,guestCountTempValue:P,setGuestCountTempValue:Y,handleSelectPackageAndBook:te,startTimeOptions:X,endTimeOptions:ve,startTimeMinTime:ye,startTimeMaxTime:G,endTimeMinTime:ne,endTimeMaxTime:le,serviceDatePickerDisabled:oe,datePickerMinDate:ce,datePickerMaxDate:$,selectedAddOns:pe,toggleAddOn:Me,setAddOnQuantity:Te,sliderSelections:de,setSliderSelections:Oe,serviceEventLocation:qe,setServiceEventLocation:gs,durationMinutes:bs,bookingAutofillHint:ge,addressAutofillHint:_e,plannerCalendarHighlights:Ge}=b,{calculatedHours:He,servicePricingBreakdown:is}=d,ls=u.useMemo(()=>{var F;return d.previewState.status==="success"?Ja(((F=d.previewState.displayBreakdown)==null?void 0:F.lines)??null,w==null?void 0:w.id,{soleSelection:!0}):null},[d.previewState,w==null?void 0:w.id]),os=F=>{if(!F)return null;const[ae,be]=F.split(":").map(Number);if(Number.isNaN(ae)||Number.isNaN(be))return null;const je=new Date;return je.setHours(ae,be,0,0),he(je,"h:mm a")},Ye=u.useMemo(()=>{if(!A)return"Select a date to view available booking hours.";if(X.length===0)return"No booking hours are configured for this date.";const F=X.reduce((ae,be)=>{const je=os(be.value);if(!je)return ae;const Ie=be.isNextDay?" (next day)":"",Ve=`${je}${Ie}`;return ae.includes(Ve)||ae.push(Ve),ae},[]);return F.length===0?"No booking hours are configured for this date.":`${he(A,"EEEE")}: starts from ${F[0]}`},[A,X]),cs=u.useMemo(()=>{if(!A||!W||!I)return!1;try{const F=he(A,"yyyy-MM-dd"),{startDateTime:ae,endDateTime:be}=ps(F,W,I),je=new Date(ae),Ie=new Date(be);return Number.isNaN(je.getTime())||Number.isNaN(Ie.getTime())?!1:Ie.toDateString()!==je.toDateString()}catch{return!1}},[A,W,I]),U=u.useMemo(()=>{var F;return((F=ve.find(ae=>ae.value===I))==null?void 0:F.isNextDay)===!0},[ve,I]),B=u.useMemo(()=>w?it({calculatedHours:He,packageDuration:w.duration,packageName:w.name}):null,[w,He]),J=u.useMemo(()=>{if(!W||!I||!A)return null;if(W===I)return{title:"Invalid time range",description:"End time must be after start time."};try{const F=he(A,"yyyy-MM-dd"),{startDateTime:ae,endDateTime:be}=ps(F,W,I),je=new Date(ae),Ie=new Date(be);if(isNaN(je.getTime())||isNaN(Ie.getTime()))return null;if(Ie<=je)return{title:"Invalid time range",description:"End time must be after start time."}}catch{return null}return null},[W,I,A]),ee=u.useMemo(()=>typeof window<"u"?`${window.location.origin}${g.pathname}${g.search}`:`${g.pathname}${g.search}`,[g.pathname,g.search]),K=u.useMemo(()=>Cs(w),[w]),we=K.requiresGuests,Le=u.useMemo(()=>w?rt([w],de):!0,[w,de]),[Ce,Re]=u.useState(null),[Qe,Pe]=u.useState(null),Fe=Za({eventDate:A?he(A,"yyyy-MM-dd"):"",startTime:W??"",durationMinutes:bs,guestCount:j,guestMin:K.requiresGuests?K.min:0,guestMax:K.requiresGuests?K.max??9999:9999,requiresEventLocation:!0,hasVerifiedEventLocation:as(qe),requiresPackageSelection:!1,packageSelected:!!w});return e.jsxs(e.Fragment,{children:[e.jsx(ul,{package:n,isOpen:r,onOpenChange:a,onSelectPackage:()=>{n&&(a(!1),n.pricingMode==="negotiable_range"?E(n):te(n))}}),e.jsx(ml,{offerings:i,isOpen:l,onOpenChange:m,onSelectPackage:F=>{m(!1),F.pricingMode==="negotiable_range"?E(F):te(F)},onViewDetails:F=>{m(!1),o(F)}}),S&&w&&e.jsx(es,{open:S,onOpenChange:k,children:e.jsxs(ss,{className:s?"":"max-w-3xl max-h-[90vh] overflow-y-auto",mobileBottomSheet:s,hideCloseButton:!1,children:[e.jsxs(ts,{children:[e.jsxs(ns,{className:"text-2xl",children:["Book ",w.name]}),e.jsx(rs,{children:"Select your date, time, and preferences to add this service to your celebration"})]}),e.jsxs("div",{className:s?"space-y-6":"py-6 space-y-6",children:[e.jsxs("div",{className:s?"space-y-6":"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsx(st,{label:"Where will this service take place?",eventLocation:qe,onEventLocationChange:gs,inOverlay:!0,suppressUnresolvedWarning:!!_e,resolvedMessage:(_e==null?void 0:_e.source)==="cart_venue"?"Address verified — pre-filled from your venue booking in cart. Change it if this service is elsewhere.":(_e==null?void 0:_e.source)==="party_package"?"Address verified — pre-filled from your party planner event location. Change it if this service is elsewhere.":void 0}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(xe,{className:"text-base font-semibold",children:"Event Date"}),A&&ge&&he(A,"yyyy-MM-dd")===ge.dateYmd&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-brand-400",children:[e.jsx(Fs,{className:"w-3 h-3"}),ge.source==="cart"?"From checkout cart":"From party package"]})]}),e.jsx(fs,{value:A||null,onChange:F=>z(F),placeholder:"Select date",minDate:ce,maxDate:$,disabledDates:oe,plannerHighlights:Ge})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(xe,{className:"text-base font-semibold",children:"Time Window"}),Ye&&e.jsxs("div",{className:"rounded-lg border border-blue-100 bg-blue-50 px-3 py-2 text-xs text-blue-800",children:[e.jsx("span",{className:"font-medium",children:"Availability:"})," ",Ye]}),e.jsx(gt,{startTime:W,endTime:I,onStartChange:q,onEndChange:T,startLabel:"Start time",endLabel:"End time",startOptions:X,endOptions:ve,startMinTime:ye,startMaxTime:G,endMinTime:ne,endMaxTime:le,endSpansNextDay:U,onInvalidTime:F=>O({title:"Time unavailable",description:F,variant:"destructive"}),labelClassName:"text-sm text-gray-700"}),B&&e.jsx("p",{className:"text-sm text-destructive font-medium",children:B.description}),J&&e.jsx("p",{className:"text-sm text-destructive font-medium",children:J.description})]}),we&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(xe,{className:"text-base font-semibold",children:"Number of Guests"}),e.jsx(ms,{type:"number",min:K.min,max:K.max,value:P,onChange:F=>Y(F.target.value),onBlur:()=>{const F=parseInt(P,10);if(!isNaN(F)&&F>=0){const ae=Ar(F,K);L(ae),Y(ae>0?ae.toString():"");const be=Al({enteredValue:F,adjustedValue:ae,bounds:K,packageName:w.name});Re(be),be&&O({title:"Guest count adjusted",description:be,variant:"destructive"})}else Y(j>0?j.toString():""),Re("Guest count must be a valid number.")},onKeyDown:F=>{F.key==="Enter"&&F.currentTarget.blur()},placeholder:"0",className:"w-full h-12 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none [-moz-appearance:textfield]"}),w.guestLimit&&e.jsxs("p",{className:"text-xs text-gray-500",children:[w.guestLimit.min&&`Minimum: ${w.guestLimit.min} `,w.guestLimit.max&&`Maximum: ${w.guestLimit.max}`]}),Ce&&e.jsx("p",{className:"text-xs text-amber-700",children:Ce}),(()=>{const F=K.min,ae=K.max,be=typeof F=="number"&&F>0&&j<F,je=typeof ae=="number"&&ae>0&&j>ae;return be?e.jsxs("p",{className:"text-sm text-destructive font-medium",children:['"',w.name,'" requires a minimum of ',F," guests."]}):je?e.jsxs("p",{className:"text-sm text-destructive font-medium",children:['"',w.name,'" allows a maximum of ',ae," guests."]}):null})()]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border rounded-xl p-4 space-y-3",children:[w.image&&e.jsx("img",{src:w.image,alt:w.name,className:"w-full h-32 object-cover rounded-lg"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-gray-900",children:w.name}),w.description&&e.jsx("p",{className:"text-sm text-gray-600 mt-1 line-clamp-2",children:w.description})]})]}),t.length>0&&e.jsx(Xa,{addOns:t,selectedAddOns:pe,onToggle:Me,onSetQuantity:Te}),w.pricingMode==="self_service_range"&&e.jsx(Ul,{packageName:w.name,sliders:w.sliders??[],selections:de,onChange:Oe,servedAmount:ls}),M&&M.length>0&&D&&e.jsxs("div",{className:"border rounded-xl p-4 space-y-3",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-gray-900",children:"Per-mile charter"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Pick a vehicle and charter it by distance. The operator confirms the final fare based on the route."})]}),e.jsx(vt,{listingId:N,vehicles:M,onQuote:F=>{Pe(F),D(wt(F,M))}})]}),e.jsx(Ql,{selectedBookingPackage:w,addOns:t,guestCount:j,calculatedHours:He,servicePricingBreakdown:is,acceptsInstantBookings:f,previewState:d.previewState,taxJurisdictionCollected:_}),!f&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(xe,{htmlFor:"service-special-requests",className:"text-sm font-medium text-gray-700",children:"Message to host (optional)"}),e.jsx(Us,{id:"service-special-requests",placeholder:"e.g. reason for your request, questions, or special requirements",value:p.specialRequests,onChange:F=>p.setSpecialRequests(F.target.value),className:"min-h-[80px] rounded-xl resize-none",maxLength:500})]}),v&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs(xe,{htmlFor:"service-org",className:"text-sm font-medium text-gray-700",children:["Organization",R?" *":" (optional)"]}),e.jsx(ms,{id:"service-org",type:"text",value:C,onChange:F=>v(F.target.value),placeholder:"e.g. Vietnamese Student Association",className:"h-11 rounded-lg"}),R&&!C.trim()&&e.jsx("p",{className:"text-xs font-medium text-destructive",children:"This provider requires an organization name to book."})]})]})]}),e.jsxs("div",{className:`flex gap-3 ${s?"pt-4 border-t border-gray-200 mt-6":"pt-4 border-t"}`,children:[!s&&e.jsx(Z,{variant:"outline",onClick:()=>{k(!1),H(null),z(null)},className:"flex-1 rounded-full",children:"Cancel"}),e.jsx(Z,{onClick:f?c.handleAddToCart:p.handleRequestBooking,disabled:(()=>{if(!Fe.isValid||!w||!A||!W||!Le||K.requiresGuests&&(!j||j<1))return!0;const F=K.min,ae=K.max;return!!(K.requiresGuests&&j<F||K.requiresGuests&&typeof ae=="number"&&j>ae||B||J||!as(qe)||f&&(d.previewState.status==="loading"||d.previewState.isRefreshing===!0)||R&&!C.trim()||f&&(c.isAddingToCart||h)||!f&&p.isRequestingBooking)})(),className:"w-full bg-brand hover:bg-brand-600 text-white rounded-full py-6 text-base font-semibold disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:f?c.isAddingToCart?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(ze,{className:"animate-spin h-4 w-4"}),"Adding..."]}):"Book now":p.isRequestingBooking?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(ze,{className:"animate-spin h-4 w-4"}),"Submitting..."]}):"Request to book"}),!Fe.isValid&&Fe.nextMissingRequirement&&e.jsx("p",{className:"mt-2 text-sm text-muted-foreground text-center",children:Fe.nextMissingRequirement}),!Le&&e.jsx("p",{className:"mt-2 text-sm text-amber-700 text-center",children:"Adjust every package option to a valid amount before continuing."})]}),cs&&e.jsx("p",{className:"text-xs text-amber-800",children:"Your selected time window crosses midnight and will be booked into the next day."})]})]})}),S&&!w&&M&&M.length>0&&D&&e.jsx(es,{open:S,onOpenChange:k,children:e.jsxs(ss,{className:s?"":"max-w-lg max-h-[90vh] overflow-y-auto",mobileBottomSheet:s,hideCloseButton:!1,children:[e.jsxs(ts,{children:[e.jsx(ns,{className:"text-2xl",children:"Charter a vehicle"}),e.jsx(rs,{children:"Pick your date, vehicle, and distance. The operator confirms the final fare."})]}),e.jsxs("div",{className:s?"space-y-6":"py-6 space-y-6",children:[e.jsx(st,{label:"Where will this trip take place?",eventLocation:qe,onEventLocationChange:gs,inOverlay:!0}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(xe,{className:"text-base font-semibold",children:"Event Date"}),e.jsx(fs,{value:A||null,onChange:F=>z(F),placeholder:"Select date",minDate:ce,maxDate:$,plannerHighlights:Ge})]}),e.jsx(vt,{listingId:N,vehicles:M,onQuote:F=>{Pe(F),D(wt(F,M))}}),!f&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(xe,{htmlFor:"charter-special-requests",className:"text-sm font-medium text-gray-700",children:"Message to host (optional)"}),e.jsx(Us,{id:"charter-special-requests",placeholder:"e.g. pickup details, route, or special requirements",value:p.specialRequests,onChange:F=>p.setSpecialRequests(F.target.value),className:"min-h-[80px] rounded-xl resize-none",maxLength:500})]}),v&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs(xe,{htmlFor:"charter-dialog-org",className:"text-sm font-medium text-gray-700",children:["Organization",R?" *":" (optional)"]}),e.jsx(ms,{id:"charter-dialog-org",type:"text",value:C,onChange:F=>v(F.target.value),placeholder:"e.g. Vietnamese Student Association",className:"h-11 rounded-lg"}),R&&!C.trim()&&e.jsx("p",{className:"text-xs font-medium text-destructive",children:"This operator requires an organization name to book."})]}),e.jsxs("div",{className:`flex gap-3 ${s?"pt-4 border-t border-gray-200 mt-6":"pt-4 border-t"}`,children:[!s&&e.jsx(Z,{variant:"outline",onClick:()=>{k(!1),z(null)},className:"flex-1 rounded-full",children:"Cancel"}),e.jsx(Z,{onClick:f?c.handleAddToCart:p.handleRequestBooking,disabled:!!(!A||!Qe||R&&!C.trim()||f&&(c.isAddingToCart||h)||!f&&p.isRequestingBooking),className:"w-full bg-brand hover:bg-brand-600 text-white rounded-full py-6 text-base font-semibold disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:f?c.isAddingToCart?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(ze,{className:"animate-spin h-4 w-4"}),"Adding..."]}):"Book now":p.isRequestingBooking?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(ze,{className:"animate-spin h-4 w-4"}),"Submitting..."]}):"Request to book"})]})]})]})}),e.jsx(es,{open:x,onOpenChange:y,children:e.jsxs(ss,{className:s?"":"max-w-lg rounded-3xl p-6",mobileBottomSheet:s,elevated:!0,children:[e.jsxs(ts,{children:[e.jsx(ns,{className:"text-xl font-semibold",children:"Share this service"}),e.jsx(rs,{children:"Invite your planning team or clients to view this service."})]}),e.jsx("div",{className:s?"space-y-3 text-sm":"mt-4 space-y-3 text-sm",children:e.jsx(ei,{shareUrl:ee,context:"service"})})]})}),c.compatibilityResult&&e.jsx(Gl,{isOpen:c.showReplaceModal,onClose:()=>{c.setShowReplaceModal(!1),c.setPendingService(null),c.setCompatibilityResult(null)},onConfirm:c.handleReplaceConfirm,existingDate:c.compatibilityResult.existingDate||"",newDate:c.compatibilityResult.newDate}),c.timeConflictData&&e.jsx(Hl,{isOpen:c.showTimeConflictModal,onClose:()=>{c.setShowTimeConflictModal(!1),c.setTimeConflictData(null),c.setPendingService(null)},onAdjustTime:c.handleAdjustServiceTime,onAdjustOtherTime:c.handleAdjustVenueTime,onMessageProvider:V,conflictType:"service-to-venue",venueTimeWindow:c.timeConflictData.venueTimeWindow,serviceTimeWindow:c.timeConflictData.serviceTimeWindow})]})};function Yl(s,t,n,r,a){const i=Se(t);switch(s){case"fixed_per_guest":case"per_person":case"per_guest":return`${i}/person × ${n} guest${n===1?"":"s"}`;case"fixed_per_hour":case"per_hour":return`${i}/hr × ${Math.round(r)} hr${Math.round(r)===1?"":"s"}`;case"fixed_per_event":case"per_event":return"flat rate";case"fixed_per_quantity":return a?`${i} × ${a}`:null;default:return null}}const Ql=({selectedBookingPackage:s,addOns:t=[],guestCount:n,calculatedHours:r,servicePricingBreakdown:a,acceptsInstantBookings:i,previewState:l,taxJurisdictionCollected:m=!1})=>{var V;const b=l.status==="success"?((V=l.displayBreakdown)==null?void 0:V.lines)??null:null,d=fe.useMemo(()=>ti(b,s.id,{soleSelection:!0}),[b,s.id]),c=fe.useMemo(()=>(b??[]).filter(O=>O.kind==="add_on"),[b]),p=d?d.baseAmount??d.amount:null,f=fe.useMemo(()=>!(d!=null&&d.timelineAdjustment)||d.baseAmount===void 0?null:Ni(d.timelineAdjustment,d.baseAmount,d.amount),[d]),h=Se(jr(s)),x=a.subtotal,y=l.status==="success"&&l.taxStatus?l:null,o=l.status==="loading"||l.isRefreshing===!0,E=O=>{var v,R;const N=t.find(_=>_.id===O.sourceEntityId),M=N?sl(N):null,D=(v=l.selectionSnapshots)==null?void 0:v.find(_=>_.selectionType==="add_on"&&_.sourceEntityId===O.sourceEntityId),C=(D==null?void 0:D.priceModel)??((R=N==null?void 0:N.priceModel)==null?void 0:R.kind);return M===null||!C?null:Yl(C,M,n,r,D==null?void 0:D.quantity)};return e.jsxs("div",{className:"border rounded-xl p-4 bg-gray-50 space-y-3",children:[e.jsx("h4",{className:"font-semibold text-gray-900",children:"Price Breakdown"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:s.name}),e.jsx("span",{className:"font-medium","data-testid":"service-package-row-amount",children:p!==null?Se(p):"—"})]}),(()=>{const O=s.priceType;return s.pricingMode==="self_service_range"?e.jsx("p",{className:"text-xs text-gray-500",children:"customized package"}):O==="per_person"||O==="per_guest"?h?e.jsxs("p",{className:"text-xs text-gray-500",children:[h,"/person × ",n," guest",n===1?"":"s"]}):null:O==="per_hour"?h?e.jsxs("p",{className:"text-xs text-gray-500",children:[h,"/hr × ",Math.round(r)," hr",Math.round(r)===1?"":"s"]}):null:O==="per_event"||O==="fixed"?e.jsx("p",{className:"text-xs text-gray-500",children:"per event"}):null})(),f&&e.jsxs("div",{className:"flex justify-between text-xs text-green-700",children:[e.jsxs("span",{children:[f.label," (",f.pct>0?"+":"",f.pct,"%)"]}),e.jsx("span",{children:Se(f.delta)})]})]}),c.map(O=>{const N=E(O);return e.jsxs("div",{className:"space-y-1","data-testid":"service-add-on-row",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:O.name}),e.jsx("span",{className:"font-medium",children:Se(O.amount)})]}),N&&e.jsx("p",{className:"text-xs text-gray-500",children:N})]},O.selectionId??O.sourceEntityId??O.name)}),e.jsxs("div",{className:"flex justify-between text-sm text-gray-600 pt-1 border-t border-gray-200",children:[e.jsx("span",{children:"Subtotal"}),e.jsx("span",{children:x!==null?Se(x):"—"})]}),e.jsx(ka,{taxStatus:(y==null?void 0:y.taxStatus)??"calculated_at_checkout",taxAmountCents:(y==null?void 0:y.taxStatus)==="final"?y.taxAmountCents??0:0,taxJurisdictionCollected:(y==null?void 0:y.taxJurisdictionCollected)??m,className:"text-sm text-gray-600"}),e.jsx(Ia,{serviceFeeCents:a.serviceFee!==null?Math.round(a.serviceFee*100):null,pendingLabel:"Finalized in cart",className:"text-sm text-gray-600"}),e.jsx(Ee,{className:"my-2"}),e.jsxs("div",{className:"flex justify-between font-semibold text-base",children:[e.jsx("span",{children:o?"Calculating...":a.isAuthoritative?"Total":"Estimated total"}),e.jsx("span",{className:"text-brand",children:o?e.jsx(ze,{className:"h-4 w-4 animate-spin text-muted-foreground"}):a.total!==null?Se(a.total):"Request quote"})]}),l.status==="error"&&e.jsx("p",{className:"text-xs text-amber-700",children:"Live pricing unavailable — showing an estimate. Your exact total is confirmed at checkout."}),!i&&e.jsxs("div",{className:"mt-2 inline-flex items-center gap-1.5 rounded-full bg-amber-50 border border-amber-200 px-3 py-1.5",children:[e.jsx(Aa,{className:"h-3.5 w-3.5 text-amber-600"}),e.jsx("span",{className:"text-xs font-medium text-amber-800",children:"Booking Request Required — You won't be charged yet."})]}),e.jsx("p",{className:"text-xs text-gray-500 pt-1",children:i?(y==null?void 0:y.taxStatus)==="final"?"Sales tax for your event address is included in this total.":"Final total and applicable sales tax are confirmed in cart and checkout.":"The host will review your request and respond within 24 hours."})]})]})},$r=ni,qr=Xi,Kl=({vm:s,listing:t,offerings:n,serviceData:r,serviceType:a,effectiveData:i,metadata:l,cancellationPolicy:m,cancellationNotes:b,isScrolled:d,scrollContainerRef:c,navigate:p,isSaved:f,savingService:h,handleSaveService:x,handleViewPackageDetails:y,handleShowDates:o,bookingActionLabel:E,bookingActionDisabled:V,bookingActionDisabledMessage:O,handleMessageProvider:N,onRequestCustomQuote:M,charterInline:D,createConversationPending:C,setIsShareOpen:v,schedule:R,blockedDates:_,availability:g,acceptsInstantBookings:S,selectedDate:k,onAvailabilityDateSelect:w,plannerCalendarHighlights:H,catererMenu:A,catererMenuItems:z,onMenuItemAddToCart:W,catererMenuOrderProgress:q,isRequestMode:I,requestModeItems:T,requestModeSubtotalCents:j,onSubmitMenuRequest:L,onRemoveRequestModeItem:P,instantMenuItems:Y,canContinueToCheckout:te,isContinuingToCheckout:X,onContinueToCheckout:ve,onGalleryPhotoAdvance:ye})=>{var G,ne,le,oe,ce,$,pe,Me,Te;return e.jsxs("div",{className:"flex flex-col min-h-screen",children:[e.jsx("div",{className:ue("fixed top-0 left-0 right-0 z-50 bg-white border-b transition-all duration-300",d?"translate-y-0 opacity-100 shadow-sm pointer-events-auto":"-translate-y-full opacity-0 pointer-events-none"),children:e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsx(Z,{variant:"ghost",size:"icon",className:"h-9 w-9 hover:bg-gray-100",onClick:()=>typeof window<"u"&&window.history.length>1?p(-1):p("/services"),children:e.jsx(dn,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[(((G=s.hostProfile)==null?void 0:G.publicId)||(t==null?void 0:t.ownerPublicId))&&e.jsx(Z,{variant:"ghost",size:"icon",className:"h-9 w-9 hover:bg-gray-100 p-0",asChild:!0,children:e.jsx("a",{href:`/u/${((ne=s.hostProfile)==null?void 0:ne.publicId)||(t==null?void 0:t.ownerPublicId)}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center","aria-label":"View service provider profile",children:e.jsx(Ns,{src:s.hostAvatar||void 0,alt:"Servicer avatar",className:"h-8 w-8 rounded-full object-cover border border-gray-200",fallback:"/default-profile-icon.png"})})}),e.jsx(Z,{variant:"ghost",size:"icon",className:"h-9 w-9 hover:bg-gray-100",onClick:()=>v(!0),children:e.jsx(Hs,{className:"h-5 w-5"})}),x!=null&&e.jsx(Z,{variant:"ghost",size:"icon",className:ue("h-9 w-9 hover:bg-gray-100",f&&"text-brand"),onClick:x,disabled:h,children:e.jsx(Vs,{className:ue("h-5 w-5",f&&"fill-current")})})]})]})}),e.jsxs("div",{className:"fixed top-0 left-0 right-0 z-30 px-4 pt-4 pb-2 flex items-center justify-between",children:[e.jsx(Z,{variant:"ghost",size:"icon",className:"h-10 w-10 rounded-full bg-white/90 backdrop-blur-sm shadow-sm hover:bg-gray-100 hover:text-gray-900",onClick:()=>typeof window<"u"&&window.history.length>1?p(-1):p("/services"),children:e.jsx(dn,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[(((le=s.hostProfile)==null?void 0:le.publicId)||(t==null?void 0:t.ownerPublicId))&&e.jsx(Z,{variant:"ghost",size:"icon",className:"h-10 w-10 rounded-full bg-white/90 backdrop-blur-sm shadow-sm hover:bg-gray-100 p-0",asChild:!0,children:e.jsx("a",{href:`/u/${((oe=s.hostProfile)==null?void 0:oe.publicId)||(t==null?void 0:t.ownerPublicId)}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center","aria-label":"View service provider profile",children:e.jsx(Ns,{src:s.hostAvatar||void 0,alt:"Servicer avatar",className:"h-9 w-9 rounded-full object-cover border border-gray-200",fallback:"/default-profile-icon.png"})})}),e.jsx(Z,{variant:"ghost",size:"icon",className:"h-10 w-10 rounded-full bg-white/90 backdrop-blur-sm shadow-sm hover:bg-brand/10 hover:text-brand",onClick:()=>v(!0),children:e.jsx(Hs,{className:"h-5 w-5"})}),x!=null&&e.jsx(Z,{variant:"ghost",size:"icon",className:ue("h-10 w-10 rounded-full bg-white/90 backdrop-blur-sm shadow-sm hover:bg-red-50 hover:text-red-500",f&&"text-brand"),onClick:x,disabled:h,children:e.jsx(Vs,{className:ue("h-5 w-5",f&&"fill-current")})})]})]}),e.jsx("div",{className:"fixed top-0 left-0 right-0 h-[360px] z-0",children:e.jsx(Ea,{originalSrc:s.coverImage,variant:"full",alt:s.serviceName,className:"w-full h-full object-cover",loading:"eager"})}),e.jsxs("div",{ref:c,className:"flex-1 overflow-y-auto pb-32 relative z-10",style:{background:"linear-gradient(to bottom, transparent 0, transparent 360px, white 360px)"},children:[e.jsx("div",{className:"h-[360px] relative z-0"}),e.jsxs("div",{className:"bg-white -mt-8 relative z-20 rounded-t-[32px] pt-8",children:[e.jsxs("div",{className:"px-6 pb-6 space-y-3 text-center",children:[e.jsxs("h1",{className:"flex items-center justify-center gap-1.5 text-2xl font-semibold tracking-tight text-gray-900",children:[s.serviceName,Ds(t)&&e.jsx(gr,{className:"h-5 w-5 flex-shrink-0 text-blue-500","aria-label":"Verified"})]}),e.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[e.jsx(us,{className:"h-4 w-4"}),e.jsx("span",{children:s.locationLabel})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[s.serviceTypeInfo&&e.jsx(ke,{variant:"secondary",className:"rounded-full px-2.5 py-0.5 text-[10px] bg-gray-100 text-gray-700 border-0",children:s.serviceTypeInfo.label}),s.aboutMe.yearsOfExperience&&e.jsxs(ke,{variant:"secondary",className:"rounded-full px-2.5 py-0.5 text-[10px] bg-gray-100 text-gray-700 border-0",children:[s.aboutMe.yearsOfExperience,"+ years"]}),t&&e.jsx(br,{badges:tr(t),maxDisplay:2})]})]}),e.jsx(Ee,{}),e.jsxs("div",{className:"px-6 py-6 space-y-8",children:[e.jsx("section",{className:"space-y-3 text-center",children:e.jsx("div",{className:"prose prose-sm prose-gray max-w-none text-gray-700 min-w-0 break-words",children:e.jsx(Bs,{remarkPlugins:[Gs],children:s.description})})}),e.jsx(Ee,{}),e.jsxs("section",{className:"space-y-4 text-center",children:[e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx(Ns,{src:s.hostAvatar||void 0,alt:s.hostDisplayName,className:"h-20 w-20 rounded-full object-cover ring-2 ring-white shadow-md",fallback:"/default-profile-icon.png"}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-semibold text-gray-900",children:["About ",s.hostDisplayName]}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[((ce=s.serviceTypeInfo)==null?void 0:ce.label)||"Service provider"," • ",s.locationLabel]})]})]}),e.jsx(Z,{variant:"outline",className:"w-full rounded-full",onClick:N,disabled:C,children:C?e.jsxs("span",{className:"flex items-center justify-center gap-2",children:[e.jsx(ze,{className:"h-4 w-4 animate-spin"}),"Opening..."]}):`Message ${s.hostDisplayName.split(" ")[0]||"Host"}`})]}),e.jsx(Ee,{}),e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Photos"}),e.jsx(rr,{images:s.galleryImages,videos:s.galleryVideos??[],serviceName:s.serviceName,isMobile:!0,onPhotoAdvance:ye})]}),e.jsx(Ee,{}),A&&((z==null?void 0:z.length)??0)>0&&e.jsxs(e.Fragment,{children:[e.jsx("section",{id:"caterer-menu",tabIndex:-1,className:"scroll-mt-24 outline-none",children:e.jsx(Mr,{menu:A,items:z??[],onAddToCart:W,menuOrderProgress:q,isMobile:!0,isRequestMode:I,requestModeItems:T,requestModeSubtotalCents:j,onSubmitMenuRequest:L,instantModeItems:Y,canContinueToCheckout:te,isContinuingToCheckout:X,onContinueToCheckout:ve,onRemoveRequestModeItem:P,taxJurisdictionCollected:Lt((pe=($=t.publishedData)==null?void 0:$.location)==null?void 0:pe.country,(Te=(Me=t.publishedData)==null?void 0:Me.location)==null?void 0:Te.state)})}),e.jsx(Ee,{})]}),e.jsx(ar,{slots:ir(r.discounts)}),e.jsx(yr,{offerings:n,onViewDetails:y,onSelectPackage:y,isMobile:!0}),e.jsx(lr,{metadata:l,offerings:n}),a!=="chartered_bus"&&e.jsxs(e.Fragment,{children:[e.jsx(Ee,{}),e.jsxs("section",{id:"availability",className:"space-y-6",children:[e.jsx($r,{schedule:R,blockedDates:_,selectedDate:k,onDateSelect:w,bookingWindowDays:(g==null?void 0:g.bookingWindowDays)??365,minimumLeadTimeHours:g==null?void 0:g.minimumLeadTimeHours,plannerHighlights:H}),e.jsx(qr,{schedule:R,availability:{bookingWindowDays:(g==null?void 0:g.bookingWindowDays)??365,minimumLeadTimeHours:g==null?void 0:g.minimumLeadTimeHours,acceptsInstantBookings:S},isMobile:!0})]})]}),e.jsx(Ee,{}),e.jsx(Nr,{listing:t,isMobile:!0}),e.jsx(vr,{serviceData:r,serviceType:a,isMobile:!0}),e.jsx(Ee,{}),e.jsx(_r,{serviceData:r,effectiveData:i,isMobile:!0}),e.jsx(wr,{isMobile:!0,cancellationPolicy:m,cancellationNotes:b}),D&&e.jsxs(e.Fragment,{children:[e.jsx(Ee,{}),e.jsxs("section",{id:"charter-booking",className:"space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Book your trip"}),V?e.jsx("div",{className:"rounded-2xl border border-border/70 bg-muted/50 px-4 py-4 text-center text-sm text-muted-foreground",children:O??"This service is not accepting bookings right now."}):D,M&&e.jsx("button",{type:"button",onClick:M,className:"w-full text-sm text-center text-brand hover:text-brand-600 underline-offset-4 hover:underline",children:"Request a custom quote"})]})]})]})]})]}),!D&&Vr.createPortal(e.jsxs("div",{className:"fixed bottom-0 left-0 right-0 z-[9999] bg-white border-t border-border/70 px-4 py-3 shadow-lg safe-area-inset-bottom",children:[e.jsxs("div",{className:"space-y-2 mb-3",children:[s.pricingRange&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-lg font-semibold text-gray-900",children:["From ",Se(s.pricingRange.min),s.pricingRange.min!==s.pricingRange.max&&` - ${Se(s.pricingRange.max)}`,s.pricingRange.label&&` ${s.pricingRange.label}`]}),Ke(s.minimumBooking)&&e.jsx("div",{className:"text-xs text-muted-foreground",children:Ke(s.minimumBooking)})]}),xr(m)&&e.jsxs(ke,{variant:"secondary",className:"rounded-full px-2.5 py-1 text-[10px] bg-green-50 text-green-700 border-green-200",children:[e.jsx(Je,{className:"h-3 w-3 mr-1"}),"Free cancellation"]})]}),!s.pricingRange&&Ke(s.minimumBooking)&&e.jsx("div",{className:"text-xs text-muted-foreground",children:Ke(s.minimumBooking)})]}),e.jsx("div",{className:"mb-3"}),V?e.jsx("div",{className:"rounded-full border border-border/70 bg-muted/50 px-4 py-4 text-center text-sm text-muted-foreground",children:O??"This service is not accepting bookings right now."}):e.jsx(Z,{className:"w-full bg-brand hover:bg-brand-600 text-white rounded-full py-6 text-base font-semibold",onClick:o,children:E}),M&&e.jsx("button",{type:"button",onClick:M,className:"w-full text-sm text-center text-brand hover:text-brand-600 underline-offset-4 hover:underline mt-2",children:"Request a custom quote"})]}),document.body)]})},_r=({serviceData:s,effectiveData:t,isMobile:n})=>{if(!s.serviceArea&&!(t!=null&&t.location))return null;const r=t==null?void 0:t.location,a=s.serviceArea??{},i=a.cityCoords||(r!=null&&r.latitude&&(r!=null&&r.longitude)?{lat:r.latitude,lng:r.longitude}:null),l=a.radiusMiles||a.radius;return e.jsxs(e.Fragment,{children:[e.jsx(ll,{cityCoords:i,radiusMiles:l,serviceArea:a,isMobile:n}),n&&e.jsx(Ee,{})]})},Jl=({vm:s,listing:t,offerings:n,serviceData:r,serviceType:a,effectiveData:i,metadata:l,cancellationPolicy:m,cancellationNotes:b,stickyCard:d,isPreviewMode:c,user:p,isSaved:f,handleSaveService:h,handleViewPackageDetails:x,handleShowDates:y,bookingActionLabel:o,bookingActionDisabled:E,bookingActionDisabledMessage:V,handleMessageProvider:O,onRequestCustomQuote:N,charterInline:M,createConversationPending:D,setIsShareOpen:C,schedule:v,blockedDates:R,availability:_,acceptsInstantBookings:g,selectedDate:S,onAvailabilityDateSelect:k,plannerCalendarHighlights:w,catererMenu:H,catererMenuItems:A,onMenuItemAddToCart:z,catererMenuOrderProgress:W,isRequestMode:q,requestModeItems:I,requestModeSubtotalCents:T,onSubmitMenuRequest:j,onRemoveRequestModeItem:L,instantMenuItems:P,canContinueToCheckout:Y,isContinuingToCheckout:te,onContinueToCheckout:X,onGalleryPhotoAdvance:ve})=>{var ye,G,ne,le,oe,ce;return e.jsx("div",{className:"mx-auto w-full max-w-7xl px-6 pb-24 pt-10 md:px-8",children:e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground min-w-0",children:[e.jsx(us,{className:"h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"break-words",children:s.locationLabel})]}),e.jsx("h1",{className:"mt-2 text-3xl font-semibold tracking-tight text-gray-900 md:text-4xl break-words",children:s.serviceName}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[s.serviceTypeInfo&&e.jsx(ke,{variant:"secondary",className:"rounded-full px-3 py-1 text-xs bg-gray-100 text-gray-700 border-0",children:s.serviceTypeInfo.label}),s.aboutMe.yearsOfExperience&&e.jsxs(ke,{variant:"secondary",className:"rounded-full px-3 py-1 text-xs bg-gray-100 text-gray-700 border-0",children:[s.aboutMe.yearsOfExperience," years experience"]}),t&&e.jsx(br,{badges:tr(t),maxDisplay:3})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap justify-start md:justify-end",children:[e.jsxs(Z,{variant:"outline",className:"rounded-full px-4",onClick:()=>C(!0),children:[e.jsx(Hs,{className:"mr-2 h-4 w-4"}),"Share"]}),h!=null&&e.jsxs(Z,{variant:"outline",className:ue("rounded-full px-4",f&&"border-brand text-brand"),onClick:h,children:[e.jsx(Vs,{className:ue("mr-2 h-4 w-4",f&&"fill-current")}),f?"Saved":"Save"]})]})]}),e.jsx(rr,{images:s.galleryImages,videos:s.galleryVideos,serviceName:s.serviceName,isMobile:!1,onShareClick:()=>C(!0),onSaveClick:h??void 0,isSaved:f,onPhotoAdvance:ve}),e.jsxs("div",{className:"flex flex-col gap-10 lg:flex-row",children:[e.jsxs("div",{className:"flex-1 min-w-0 space-y-10",children:[e.jsx("section",{className:"space-y-4 min-w-0 prose prose-gray max-w-none text-base leading-7 text-gray-700 break-words",children:e.jsx(Bs,{remarkPlugins:[Gs],children:s.description})}),H&&((A==null?void 0:A.length)??0)>0&&e.jsx("section",{id:"caterer-menu",tabIndex:-1,className:"scroll-mt-[172px] outline-none",children:e.jsx(Mr,{menu:H,items:A??[],onAddToCart:z,menuOrderProgress:W,isMobile:!1,isRequestMode:q,requestModeItems:I,requestModeSubtotalCents:T,onSubmitMenuRequest:j,instantModeItems:P,canContinueToCheckout:Y,isContinuingToCheckout:te,onContinueToCheckout:X,onRemoveRequestModeItem:L,taxJurisdictionCollected:Lt((G=(ye=t.publishedData)==null?void 0:ye.location)==null?void 0:G.country,(le=(ne=t.publishedData)==null?void 0:ne.location)==null?void 0:le.state)})}),e.jsx(ar,{slots:ir(r.discounts)}),e.jsx(yr,{offerings:n,onViewDetails:x,onSelectPackage:x,isMobile:!1}),e.jsx(lr,{metadata:l,offerings:n}),a!=="chartered_bus"&&e.jsxs("section",{id:"availability",className:"space-y-6",children:[e.jsx($r,{schedule:v,blockedDates:R,selectedDate:S,onDateSelect:k,bookingWindowDays:(_==null?void 0:_.bookingWindowDays)??365,minimumLeadTimeHours:_==null?void 0:_.minimumLeadTimeHours,plannerHighlights:w}),e.jsx(qr,{schedule:v,availability:{bookingWindowDays:(_==null?void 0:_.bookingWindowDays)??365,minimumLeadTimeHours:_==null?void 0:_.minimumLeadTimeHours,acceptsInstantBookings:g},isMobile:!1})]}),e.jsx(tl,{hostDisplayName:s.hostDisplayName,serviceName:s.serviceName,serviceTypeInfo:s.serviceTypeInfo,hostAvatar:s.hostAvatar,hostPublicId:((oe=s.hostProfile)==null?void 0:oe.publicId)??(t==null?void 0:t.ownerPublicId),onMessageClick:O,aboutMe:s.aboutMe,serviceType:a,serviceData:r,verified:Ds(t),isMobile:!1}),e.jsx(Nr,{listing:t,isMobile:!1}),e.jsx(vr,{serviceData:r,serviceType:a,isMobile:!1}),e.jsx(_r,{serviceData:r,effectiveData:i,isMobile:!1}),e.jsx(wr,{isMobile:!1,cancellationPolicy:m,cancellationNotes:b})]}),e.jsx("aside",{className:"w-full lg:w-[360px] xl:w-[400px] lg:flex-shrink-0",children:e.jsxs("div",{ref:d.stickyCardRef,className:ue("sticky top-[172px] space-y-6",d.stickyCardPosition&&"!fixed"),style:d.stickyCardPosition?{top:`${d.stickyCardPosition.top}px`,width:`${d.stickyCardPosition.width}px`,zIndex:40}:void 0,children:[e.jsx(dl,{hostDisplayName:s.hostDisplayName,serviceName:s.serviceName,serviceTypeInfo:s.serviceTypeInfo,locationLabel:s.locationLabel,hostAvatar:s.hostAvatar,hostPublicId:((ce=s.hostProfile)==null?void 0:ce.publicId)??(t==null?void 0:t.ownerPublicId),aboutMe:s.aboutMe,tagline:s.tagline&&s.tagline!==s.description?s.tagline:null,verified:Ds(t),isSaved:f,isMessaging:D,onShareClick:()=>C(!0),onSaveClick:h??void 0,onMessageClick:O}),e.jsx(cl,{pricingRange:s.pricingRange,minimumBooking:s.minimumBooking,onShowDates:y,cancellationPolicy:m,disabled:E||c||!fn(t==null?void 0:t.status)||!!(p!=null&&p.publicId&&(t==null?void 0:t.ownerPublicId)===p.publicId),disabledMessage:p!=null&&p.publicId&&(t==null?void 0:t.ownerPublicId)===p.publicId?"You cannot book your own listing.":c||!fn(t==null?void 0:t.status)?"Publish this listing to accept bookings.":V??"This service is not accepting bookings right now.",onRequestCustomQuote:N,primaryActionLabel:o,charterInline:M,verified:Ds(t)})]})})]})]})})},As=s=>`${s.menuItemId}|${(s.selectedChoices??[]).map(t=>`${t.optionId}:${t.choiceId}`).sort().join(",")}`;function Zl(s,t){const n={menuItemId:t.item.itemId,quantity:t.quantity,selectedChoices:t.selectedChoices},r=As(n);return s.some(i=>As(i)===r)?s.map(i=>As(i)===r?{...i,quantity:(i.quantity??0)+t.quantity}:i):[...s,n]}function Xl(s,t){var r;if(!s)return 0;let n=s.price;for(const a of t??[]){const i=(r=s.options)==null?void 0:r.find(m=>m.optionId===a.optionId),l=i==null?void 0:i.choices.find(m=>m.choiceId===a.choiceId);l&&(n+=l.priceDelta)}return n}function Hn(s,t){let n=0;for(const r of s){const a=Xl(t.get(r.menuItemId),r.selectedChoices);n+=a*(r.quantity??0)}return n}function Vn(s,t,n){const r=typeof t=="number"&&t>0?t:0,a=Math.max(0,r-s);return{currentCents:s,minCents:r,remainingCents:a,met:r===0||s>=r,hasMinimum:r>0,guestSubtotalCents:n}}function eo(s,t,n){const r=Ue(t);if(!r||t===null)return"Add more items to reach this caterer's minimum order.";const a=s!==null&&t>s?Ue(t-s):null;return a?`Add ${a} more to reach the ${r} minimum.`:`Reach the ${r} minimum to ${n}.`}function so(s,t){return!s||t<=0?!1:s.menuItemsPriced===t&&typeof s.serviceFee=="number"&&Number.isFinite(s.serviceFee)&&typeof s.total=="number"&&Number.isFinite(s.total)&&typeof s.guestTotalCents=="number"&&Number.isInteger(s.guestTotalCents)&&s.taxStatus!==void 0}function to(s){var b;const{shell:t,items:n,preview:r}=s,a=Qi(new Date(t.endTime),new Date(t.startTime)),i=Number((a/60).toFixed(2)),l=or(r.total,r),m=Math.round((l-r.serviceFee)*100)/100;return{listingId:s.listingId,listingTitle:s.serviceName,listingKind:"service",startTime:t.startTime,endTime:t.endTime,hours:i,guestCount:t.guestCount,imageUrl:s.coverImage,location:t.eventLocation.formattedAddress,latitude:t.eventLocation.lat,longitude:t.eventLocation.lng,eventLocation:t.eventLocation,selectionMode:"menu",selectedMenuItems:n,total:l,subtotal:m,serviceFee:r.serviceFee,...Et(r),displayBreakdown:r.displayBreakdown??null,feeDisclosure:r.feeDisclosure??null,pricingNotices:r.pricingNotices??[],deposit:r.deposit??null,servedGuestTotalCents:r.guestTotalCents,contactOrg:((b=s.contactOrg)==null?void 0:b.trim())||void 0}}const no="We couldn't price your order",ro="Your items are still here. Please try again in a moment.";function ao({listing:s,catererMenu:t,catererMenuItems:n,serviceName:r,coverImage:a,acceptsInstantBookings:i,contactOrg:l,toast:m}){const{startCheckout:b}=hr(),d=!i,[c,p]=u.useState(null),[f,h]=u.useState(!1),[x,y]=u.useState(!1),o=u.useRef(!1),E=u.useRef(null);u.useEffect(()=>()=>{var j;return(j=E.current)==null?void 0:j.abort()},[]);const[V,O]=u.useState(!1),[N,M]=u.useState([]),D=u.useRef([]),C=u.useCallback(j=>{D.current=j,M(j)},[]),[v,R]=u.useState(null),_=u.useMemo(()=>{const j=new Map;for(const L of n)j.set(L.itemId,L);return j},[n]),g=u.useMemo(()=>Hn(N,_),[N,_]),S=u.useMemo(()=>Vn(g,t==null?void 0:t.minOrderAmount,yt(N,_)),[g,N,_,t==null?void 0:t.minOrderAmount]),k=u.useCallback(j=>{if(!s)return;const L=Zl(D.current,j);C(L);const P=yt(L,_),Y=Vn(Hn(L,_),t==null?void 0:t.minOrderAmount,P),te=`Added ${j.quantity} × ${j.item.name}`;if(Y.hasMinimum&&!Y.met){m({title:te,description:eo(P,Tr(t),d?"send your request":"check out")});return}m({title:te,description:d?"Keep adding, or review and send your request when your order is ready.":"Keep adding, or continue to checkout when your order is ready."})},[s,C,t,_,d,m]),w=u.useCallback(async(j,L)=>{var te;if(!s||L.length===0||o.current)return;o.current=!0,(te=E.current)==null||te.abort();const P=new AbortController;E.current=P,h(!0);const Y=()=>m({title:no,description:ro,variant:"destructive"});try{const X=await nr({listingId:s.listingId,startTime:j.startTime,endTime:j.endTime,guestCount:j.guestCount,selectedMenuItems:L,eventLocation:j.eventLocation,signal:P.signal});if(P.signal.aborted)return;if(!so(X,L.length)){Y();return}b(to({listingId:s.listingId,serviceName:r,coverImage:a,contactOrg:l,shell:j,items:L,preview:X}))}catch(X){if(X instanceof DOMException&&X.name==="AbortError"||P.signal.aborted)return;Y()}finally{E.current===P&&(E.current=null),o.current=!1,h(!1)}},[s,r,a,l,b,m]),H=N.length>0&&S.met,A=u.useCallback(async()=>{if(!(!H||!s)&&!o.current){if(!v){p(null),y(!0),O(!0);return}await w(v,N)}},[H,s,v,N,w]),z=u.useCallback(async j=>{if(s){if(d||v){k(j);return}y(!1),p(j),O(!0)}},[d,v,s,k]),W=u.useCallback(()=>{d&&A()},[d,A]),q=u.useCallback((j,L)=>{const P=As({menuItemId:j,selectedChoices:L});C(D.current.filter(Y=>As(Y)!==P))},[C]),I=u.useCallback(async j=>{const L=c,P=!L&&x;if(!L&&!P||P&&N.length===0)return;if(!as(j.eventLocation)){m({title:"Event address required",description:vs?"Choose a full address from the suggestions so we can confirm the service location.":"Enter the full street address where this service will take place.",variant:"destructive"});return}if(!j.startTime||!j.endTime||j.startTime===j.endTime){m({title:"Invalid duration",description:"Please pick a start and end time.",variant:"destructive"});return}const Y=ps(j.dateYmd,j.startTime,j.endTime),te={startTime:Y.startDateTime,endTime:Y.endDateTime,guestCount:j.guestCount,eventLocation:j.eventLocation};if(R(te),P){await w(te,N),y(!1),O(!1);return}O(!1),p(null),L&&k(L)},[c,x,N,k,w,m]),T=u.useCallback(()=>{p(null),y(!1),O(!1)},[]);return{isOrderDetailsOpen:V,setOrderDetailsOpen:O,isSubmitting:f,menuOrderProgress:S,confirmStartsCheckout:x&&!c,isRequestMode:d,requestModeItems:d?N:[],requestModeSubtotalCents:d?g:0,handleSubmitMenuRequest:W,removeOrderItem:q,instantModeItems:d?[]:N,canContinueToCheckout:H,continueToCheckout:A,handleMenuItemAddToCart:z,confirmOrderDetails:I,pendingAdd:c,cancelPendingAdd:T}}const io=({open:s,onOpenChange:t,isMobile:n=!1,isSubmitting:r=!1,confirmStartsCheckout:a=!1,isRequestMode:i=!1,defaultDate:l=null,defaultStartTime:m="",defaultEndTime:b="",defaultGuestCount:d=0,defaultEventLocation:c=null,schedule:p,datePickerMinDate:f,datePickerMaxDate:h,serviceDatePickerDisabled:x,minGuests:y,contactOrg:o="",onContactOrgChange:E,requireOrganizationName:V=!1,onConfirm:O})=>{const[N,M]=u.useState(l),[D,C]=u.useState(m),[v,R]=u.useState(b),[_,g]=u.useState(d),[S,k]=u.useState(c),[w,H]=u.useState(null);u.useEffect(()=>{s&&(M(l),C(m),R(b),g(d),k(c),H(null))},[s,l,m,b,d,c]);const A=u.useMemo(()=>!N||p.length===0?!1:!at(N,p),[N,p]),z=!!N&&!A&&!!D&&!!v&&D!==v&&_>=1&&as(S)&&!(V&&!o.trim()),W=async()=>{if(!N){H("Pick an event date.");return}if(A){H("This caterer is not available on the selected day.");return}if(!D||!v||D===v){H("Pick a start and end time.");return}const T=$t(D,v,N,p);if(T){H(T);return}if(_<1){H("Enter the number of guests.");return}if(y&&_<y){H(`This caterer requires at least ${y} guests.`);return}if(V&&!o.trim()){H("This caterer requires an organization name to book.");return}if(!as(S)){H(vs?"Choose a full address from the suggestions.":"Enter the full street address where the event will take place.");return}H(null),await O({dateYmd:he(N,"yyyy-MM-dd"),startTime:D,endTime:v,guestCount:_,eventLocation:S})},q=e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(xe,{className:"text-sm font-semibold",children:"Event date"}),e.jsx(fs,{value:N,onChange:M,minDate:f,maxDate:h,disabledDates:x})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(xe,{className:"text-sm font-semibold",children:"Start time"}),e.jsx(Xs,{value:D,onChange:C})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(xe,{className:"text-sm font-semibold",children:"End time"}),e.jsx(Xs,{value:v,onChange:R})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(xe,{className:"text-sm font-semibold",children:"Guests"}),e.jsx(ms,{type:"number",inputMode:"numeric",min:1,value:_>0?_:"",onChange:T=>{const j=parseInt(T.target.value,10);g(Number.isFinite(j)&&j>0?j:0)},placeholder:"Number of guests"}),y?e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Caterer minimum: ",y," guests."]}):null]}),e.jsx("div",{className:"space-y-2",children:e.jsx(st,{label:"Event address",eventLocation:S,onEventLocationChange:k})}),E&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs(xe,{className:"text-sm font-semibold",children:["Organization",V?" *":" (optional)"]}),e.jsx(ms,{type:"text",value:o,onChange:T=>E(T.target.value),placeholder:"e.g. Vietnamese Student Association"}),V&&!o.trim()&&e.jsx("p",{className:"text-xs font-medium text-destructive",children:"This caterer requires an organization name to book."})]}),w&&e.jsx("p",{className:"text-sm text-destructive",role:"alert",children:w})]}),I=e.jsxs("div",{className:"flex w-full items-center justify-end gap-2",children:[e.jsx(Z,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:r,children:"Cancel"}),e.jsx(Z,{type:"button",onClick:W,disabled:!z||r,className:"rounded-full px-5",children:r?a?"Pricing…":"Adding…":a?i?"Continue to review":"Continue to payment":"Continue"})]});return n?e.jsx(Qn,{open:s,onOpenChange:t,children:e.jsxs(Kn,{className:"max-h-[92vh]",children:[e.jsxs(Jn,{className:"text-left",children:[e.jsx(Zn,{children:"Order details"}),e.jsx(Xn,{children:"Confirm event date, time, guests, and address before adding menu items to your order."})]}),e.jsx("div",{className:"px-4 overflow-y-auto",children:q}),e.jsx(er,{children:I})]})}):e.jsx(es,{open:s,onOpenChange:t,children:e.jsxs(ss,{className:"max-h-[90vh] overflow-y-auto sm:max-w-md",children:[e.jsxs(ts,{children:[e.jsx(ns,{children:"Order details"}),e.jsx(rs,{children:"Confirm event date, time, guests, and address before adding menu items to your order."})]}),q,e.jsx(sr,{children:I})]})})};function lo({listingId:s,vehicles:t,selectedDate:n,onDateChange:r,datePickerMinDate:a,datePickerMaxDate:i,plannerHighlights:l,acceptsInstantBookings:m,specialRequests:b,onSpecialRequestsChange:d,contactOrg:c,onContactOrgChange:p,requireOrganizationName:f=!1,roundTripOnly:h=!1,onCharterChange:x,onBook:y,isBooking:o}){const[E,V]=u.useState(null),[O,N]=u.useState(""),[M,D]=u.useState(""),[C,v]=u.useState(h?"round_trip":"one_way"),[R,_]=u.useState(null),[g,S]=u.useState(""),[k,w]=u.useState(""),H=n&&O&&M?ps(he(n,"yyyy-MM-dd"),O,M):null,A=R??n,z=C==="round_trip"&&A&&g&&k?ps(he(A,"yyyy-MM-dd"),g,k):null,W=f&&!c.trim(),q=!!n&&!!E&&!o&&!W;return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(xe,{className:"text-sm font-semibold",children:"Event date"}),e.jsx(fs,{value:n||null,onChange:I=>r(I),placeholder:"Select date",minDate:a,maxDate:i,plannerHighlights:l})]}),h?e.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"This operator offers round trips only."}):e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Z,{type:"button",variant:C==="one_way"?"default":"outline",size:"sm","aria-pressed":C==="one_way",className:"flex-1",onClick:()=>v("one_way"),children:"One way"}),e.jsx(Z,{type:"button",variant:C==="round_trip"?"default":"outline",size:"sm","aria-label":"round trip","aria-pressed":C==="round_trip",className:"flex-1",onClick:()=>v("round_trip"),children:"Round trip"})]}),e.jsx(gt,{startTime:O,endTime:M,onStartChange:N,onEndChange:D,startLabel:"Pickup time",endLabel:"Drop-off time"}),C==="round_trip"&&e.jsxs("div",{className:"space-y-3 rounded-xl border border-border p-3",children:[e.jsx(xe,{className:"text-sm font-semibold",children:"Return"}),e.jsx(fs,{value:A,onChange:I=>_(I),placeholder:"Return date",minDate:n??a,maxDate:i,plannerHighlights:l}),e.jsx(gt,{startTime:g,endTime:k,onStartChange:S,onEndChange:w,startLabel:"Pickup time",endLabel:"Drop-off time"})]}),e.jsx(vt,{listingId:s,vehicles:t,startDateTime:H==null?void 0:H.startDateTime,endDateTime:H==null?void 0:H.endDateTime,tripType:C,returnStartDateTime:z==null?void 0:z.startDateTime,returnEndDateTime:z==null?void 0:z.endDateTime,onQuote:I=>{V(I),x(wt(I,t))}}),!m&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(xe,{htmlFor:"charter-special-requests",className:"text-sm font-medium text-gray-700",children:"Message to host (optional)"}),e.jsx(Us,{id:"charter-special-requests",placeholder:"e.g. pickup details, route, or special requirements",value:b,onChange:I=>d(I.target.value),className:"min-h-[80px] rounded-xl resize-none",maxLength:500})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(xe,{htmlFor:"charter-org",className:"text-sm font-medium text-gray-700",children:["Organization",f?" *":" (optional)"]}),e.jsx(ms,{id:"charter-org",type:"text",value:c,onChange:I=>p(I.target.value),placeholder:"e.g. Vietnamese Student Association",className:"h-11 rounded-lg"}),W&&e.jsx("p",{className:"text-xs font-medium text-destructive",children:"This operator requires an organization name to book."})]}),e.jsx(Z,{onClick:y,disabled:!q,className:"w-full bg-brand hover:bg-brand-600 text-white rounded-full py-6 text-base font-semibold disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:o?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(ze,{className:"animate-spin h-4 w-4"}),m?"Adding...":"Submitting..."]}):m?"Book now":"Request to book"}),!n&&e.jsx("p",{className:"text-xs text-center text-muted-foreground",children:"Pick a date to continue."})]})}const ys=s=>{const t=Math.round(s*100),n=t%100===0?0:2;return`$${(t/100).toLocaleString("en-US",{minimumFractionDigits:n,maximumFractionDigits:n})}`};function Ps(s,t){return!s||!t?null:`${s}T${t.length===5?`${t}:00`:t}`}function Dr(s){const t=new Date(s);return Number.isNaN(t.getTime())?null:t}function zn(s){const t=Dr(s);return t?`${he(t,"EEE, MMM d, yyyy")} · ${he(t,"h:mm a")}`:s}function Un(s,t){return!s||!t?null:Ps(he(s,"yyyy-MM-dd"),t)}function oo({listingId:s,packages:t,vehicles:n,selectedDate:r,onDateChange:a,datePickerMinDate:i,datePickerMaxDate:l,plannerHighlights:m,acceptsInstantBookings:b,contactOrg:d,onContactOrgChange:c,requireOrganizationName:p=!1,roundTripOnly:f=!1,onCharterChange:h,onBook:x,isBooking:y,specialRequests:o,onSpecialRequestsChange:E}){const[V,O]=u.useState(null),[N,M]=u.useState(null),[D,C]=u.useState(""),[v,R]=u.useState(null),[_,g]=u.useState(""),[S,k]=u.useState(f?"round_trip":"one_way"),[w,H]=u.useState(null),[A,z]=u.useState(!1),[W,q]=u.useState(null),I=t.find(G=>G.id===V)??null,T=G=>n.find(ne=>ne.id===G),j=(I==null?void 0:I.guestSchedulesDeparture)===!0,L=j?Un(N,D):Ps(I==null?void 0:I.departureDate,I==null?void 0:I.departureTime),P=S!=="round_trip"?null:j?Un(v??N,_):Ps(I==null?void 0:I.returnDate,I==null?void 0:I.returnTime),Y=j&&!!L&&!!P&&P<L,te=!!I&&!!L&&!Y&&(S==="one_way"||!!I.roundTrip&&!!P),X=u.useRef(0);if(u.useEffect(()=>{if(!te||!I||!L){H(null),h(null);return}const G=++X.current,ne=new AbortController,le=setTimeout(async()=>{z(!0),q(null);try{const oe=await Rr({listingId:s,vehicleClassId:I.vehicleClassId,tripType:S,packageId:I.id,startDateTime:L,endDateTime:L,...S==="round_trip"&&P?{returnStartDateTime:P,returnEndDateTime:P}:{},signal:ne.signal});if(G!==X.current)return;H(oe),h({charter:{tripType:S,vehicleClassId:I.vehicleClassId,packageId:I.id,startDateTime:L,endDateTime:L,...S==="round_trip"&&P?{returnStartDateTime:P,returnEndDateTime:P}:{},quoteToken:oe.quoteToken},quote:oe,label:I.name,eventLocation:fr(I.origin)})}catch(oe){if(ne.signal.aborted||G!==X.current)return;H(null),h(null),q(oe instanceof Error?oe.message:"Couldn't price this package.")}finally{G===X.current&&z(!1)}},350);return()=>{ne.abort(),clearTimeout(le)}},[te,I==null?void 0:I.id,S,L,P,s]),t.length===0)return null;const ve=G=>{O(G.id),k(f?"round_trip":"one_way"),H(null),q(null),M(null),C(""),R(null),g("");const ne=Ps(G.departureDate,G.departureTime),le=ne?Dr(ne):null;le&&a(le)},ye=G=>{M(G),G&&v&&v<G&&R(null),a(G)};return e.jsx("div",{className:"space-y-3",children:t.map(G=>{var oe;const ne=T(G.vehicleClassId),le=G.id===V;return e.jsxs("div",{className:`rounded-2xl border p-4 transition-colors ${le?"border-brand ring-1 ring-brand":"border-border"}`,children:[e.jsxs("button",{type:"button",onClick:()=>ve(G),className:"w-full text-left","aria-pressed":le,children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-semibold truncate",children:G.name}),ne&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[ne.displayName,typeof G.passengerCapacity=="number"?` · Up to ${G.passengerCapacity} passengers`:` · seats ${ne.seatedCapacity}`]})]}),e.jsx("div",{className:"text-right shrink-0",children:f||typeof G.oneWayPrice!="number"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"font-semibold",children:ys(((oe=G.roundTrip)==null?void 0:oe.price)??0)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"round trip"})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"font-semibold",children:ys(G.oneWayPrice)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"one way"})]})})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-sm text-muted-foreground",children:[e.jsx(us,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"truncate",children:G.origin.label}),e.jsx(La,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"truncate",children:G.destination.label})]}),!f&&G.roundTrip&&e.jsxs("p",{className:"mt-1 text-sm",children:[e.jsx("span",{className:"font-medium",children:ys(G.roundTrip.price)})," ",e.jsxs("span",{className:"text-muted-foreground",children:["round trip",typeof G.roundTrip.includedWaitHours=="number"&&G.roundTrip.includedWaitHours>0?` · includes up to ${G.roundTrip.includedWaitHours}h wait`:""]})]}),G.description&&e.jsx("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:G.description})]}),le&&e.jsxs("div",{className:"mt-4 space-y-4 border-t border-border pt-4",children:[!f&&(I==null?void 0:I.roundTrip)&&typeof G.oneWayPrice=="number"&&e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(Z,{type:"button",variant:S==="one_way"?"default":"outline",size:"sm","aria-pressed":S==="one_way",className:"flex-1",onClick:()=>k("one_way"),children:["One way · ",ys(G.oneWayPrice)]}),e.jsxs(Z,{type:"button",variant:S==="round_trip"?"default":"outline",size:"sm","aria-pressed":S==="round_trip",className:"flex-1",onClick:()=>k("round_trip"),children:["Round trip · ",ys(G.roundTrip.price)]})]}),f&&e.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"This operator offers round trips only."}),j&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(xe,{className:"text-sm font-semibold",children:"Pickup date"}),e.jsx(fs,{value:N,onChange:ye,placeholder:"Select date",minDate:i,maxDate:l,plannerHighlights:m})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(xe,{className:"text-sm font-semibold",children:"Pickup time"}),e.jsx(Xs,{value:D,onChange:C,placeholder:"Add time"})]}),S==="round_trip"&&e.jsxs("div",{className:"space-y-3 rounded-xl border border-border p-3",children:[e.jsx(xe,{className:"text-sm font-semibold",children:"Return"}),e.jsx(fs,{value:v??N,onChange:R,placeholder:"Return date",minDate:N??i,maxDate:l,plannerHighlights:m}),e.jsx(Xs,{value:_,onChange:g,placeholder:"Return pickup time"}),Y&&e.jsx("p",{className:"text-xs font-medium text-destructive",children:"The return is before the pickup."})]})]}),!j&&e.jsxs("div",{className:"rounded-xl bg-muted/50 px-4 py-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(bn,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:"Departs"}),e.jsx("p",{className:"text-sm font-medium",children:L?zn(L):"Departure to be set"})]})]}),S==="round_trip"&&P&&e.jsxs("div",{className:"mt-3 flex items-start gap-2 border-t border-border pt-3",children:[e.jsx(bn,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:"Returns"}),e.jsx("p",{className:"text-sm font-medium",children:zn(P)})]})]})]}),G.inclusionsNote&&e.jsx("p",{className:"text-sm text-muted-foreground",children:G.inclusionsNote}),w&&e.jsxs("div",{className:"flex items-center justify-between rounded-xl bg-muted/50 px-4 py-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Total"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"All booking fees included"})]}),e.jsx("span",{className:"text-lg font-semibold",children:ys(w.price.total)})]}),W&&e.jsx("p",{className:"text-sm text-destructive",children:W}),!b&&E&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(xe,{htmlFor:`route-pkg-requests-${G.id}`,className:"text-sm font-semibold",children:"Message to host (optional)"}),e.jsx(Us,{id:`route-pkg-requests-${G.id}`,placeholder:"e.g. exact pickup and drop-off addresses, or special requirements",value:o??"",onChange:ce=>E(ce.target.value),className:"min-h-[80px] rounded-xl resize-none",maxLength:500})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(xe,{htmlFor:`route-pkg-org-${G.id}`,className:"text-sm font-semibold",children:["Organization",p?" *":" (optional)"]}),e.jsx(ms,{id:`route-pkg-org-${G.id}`,type:"text",value:d,onChange:ce=>c(ce.target.value),placeholder:"e.g. Vietnamese Student Association",className:"h-11 rounded-lg"}),p&&!d.trim()&&e.jsx("p",{className:"text-xs font-medium text-destructive",children:"This operator requires an organization name to book."})]}),e.jsx(Z,{onClick:x,disabled:!w||A||y||p&&!d.trim(),className:"w-full bg-brand hover:bg-brand-600 text-white rounded-full py-6 text-base font-semibold disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:y||A?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(ze,{className:"animate-spin h-4 w-4"}),A?"Pricing...":b?"Adding...":"Submitting..."]}):b?"Book now":"Request to book"})]})]},G.id)})})}function co(s,t){const n=s==null?void 0:s.trim();if(!n)return{mode:"all",packages:t};const r=t.find(a=>a.id===n);return r?{mode:"single",packages:[r]}:{mode:"unavailable",packages:t}}function uo(s){if(!s||typeof s!="object")return!1;const t=s,n=t.serviceData&&typeof t.serviceData=="object"?t.serviceData:void 0;if((n==null?void 0:n.requireOrganizationName)===!0)return!0;const r=t.metadata&&typeof t.metadata=="object"?t.metadata:void 0,a=r!=null&&r.availability&&typeof r.availability=="object"?r.availability:void 0;return(a==null?void 0:a.requireOrganizationName)===!0}function mo(s){if(!s||typeof s!="object")return!1;const t=s,n=t.serviceData&&typeof t.serviceData=="object"?t.serviceData:void 0,r=n!=null&&n.busOperatorData&&typeof n.busOperatorData=="object"?n.busOperatorData:void 0;return(r==null?void 0:r.roundTripOnly)===!0}const bc=()=>{var Vt,zt,Ut,Wt,Yt,Qt,Kt,Jt,Zt,Xt,en,sn,tn,nn,rn,an;const{id:s}=zr(),t=di(s),[n]=Ct(),r=nt(),a=St(),{toast:i}=qa(),{user:l,loading:m,isAuthReady:b}=Ra(),d=Ga(l),c=fe.useRef(d),p=fe.useRef(0);c.current=d;const{data:f}=ri(!!l),h=kt(),x=$a(),y=Cl(t),{listing:o,isLoading:E,error:V,notFound:O,effectiveData:N,serviceData:M,offerings:D,metadata:C,hostProfileData:v,acceptsInstantBookings:R,schedule:_,blockedDates:g,cancellationPolicy:S,cancellationNotes:k,isPreviewMode:w,serviceType:H}=y,A=w||o==null?void 0:o.listingId;fe.useEffect(()=>{A&&ct("listing_view",{listingId:A,category:"service"})},[A]),ai(A);const{onPhotoViewed:z}=ii(A),W=li(C.pricing),q=Tl({listing:o,effectiveData:N,serviceData:M,offerings:D,hostProfileData:v,metadata:C,serviceType:H}),I=fe.useMemo(()=>{var re;return(((re=M==null?void 0:M.busOperatorData)==null?void 0:re.vehicleClasses)??[]).filter(Ne=>{var Rs,$s;const Be=Ne;return mi(((Rs=Be.pricing)==null?void 0:Rs.formula)??"").ok||((($s=Be.perMile)==null?void 0:$s.ratePerMile)??0)>0}).map(Ne=>({id:Ne.id,displayName:Ne.displayName,seatedCapacity:Ne.seatedCapacity}))},[(Vt=M==null?void 0:M.busOperatorData)==null?void 0:Vt.vehicleClasses]),T=I.length>0,[j,L]=u.useState(null),[P,Y]=u.useState(""),[te,X]=u.useState(""),ve=uo({serviceData:M,metadata:C}),ye=typeof(o==null?void 0:o.organizationNameRequired)=="boolean"?o.organizationNameRequired:ve,G=mo({serviceData:M}),ne=fe.useMemo(()=>{var re;return(((re=M==null?void 0:M.busOperatorData)==null?void 0:re.vehicleClasses)??[]).map(Ne=>({id:Ne.id,displayName:Ne.displayName,seatedCapacity:Ne.seatedCapacity}))},[(zt=M==null?void 0:M.busOperatorData)==null?void 0:zt.vehicleClasses]),le=fe.useMemo(()=>{var Ne;const Q=((Ne=M==null?void 0:M.busOperatorData)==null?void 0:Ne.routePackages)??[],re=new Set(ne.map(Be=>Be.id));return Q.filter(Be=>Be.status!=="archived"&&re.has(Be.vehicleClassId))},[(Ut=M==null?void 0:M.busOperatorData)==null?void 0:Ut.routePackages,ne]),oe=le.length>0,ce=fe.useMemo(()=>co(n.get("packageId"),le),[n,le]),$=_l({offerings:D,schedule:_,blockedDates:g,bookingWindowDays:typeof((Wt=y.availability)==null?void 0:Wt.bookingWindowDays)=="number"?y.availability.bookingWindowDays:void 0,minimumLeadTimeHours:typeof((Yt=y.availability)==null?void 0:Yt.minimumLeadTimeHours)=="number"?y.availability.minimumLeadTimeHours:void 0,cartItems:[],acceptsInstantBookings:R,eventShell:f==null?void 0:f.shell}),pe=El({listing:o,selectedBookingPackage:$.selectedBookingPackage,selectedDate:$.selectedDate,startTime:$.startTime,endTime:$.endTime,guestCount:$.guestCount,selectedAddOns:$.selectedAddOns,sliderSelections:$.sliderSelections,eventLocation:$.serviceEventLocation}),Me=fe.useMemo(()=>{if(!oi(pe.previewState))return null;const{subtotal:Q,serviceFee:re,total:Ne,guestTotalCents:Be,deposit:Rs,twoModelBreakdown:$s,feeDisclosure:Br,pricingNotices:Gr,displayBreakdown:Hr}=pe.previewState,ot=or(Ne,pe.previewState);return{subtotal:typeof ot=="number"&&typeof re=="number"?Math.round((ot-re)*100)/100:Q,serviceFee:re,total:ot,...Et(pe.previewState),twoModelBreakdown:$s??null,feeDisclosure:Br??null,pricingNotices:Gr??[],displayBreakdown:Hr??null,deposit:Rs??null,servedGuestTotalCents:Be}},[pe.previewState]),Te=Fl({listing:o,selectedBookingPackage:$.selectedBookingPackage,selectedDate:$.selectedDate,startTime:$.startTime,endTime:$.endTime,guestCount:$.guestCount,calculatedHours:pe.calculatedHours,serviceName:q.serviceName,coverImage:q.coverImage,schedule:_,toast:i,selectedAddOns:$.selectedAddOns,sliderSelections:$.sliderSelections,serviceEventLocation:$.serviceEventLocation,authoritativePricing:Me,charterSelection:j,user:l,contactOrg:P,specialRequests:te,requireOrganizationName:ye,setIsBookingFlowOpen:$.setIsBookingFlowOpen,resetBookingState:$.resetBookingState}),de=Dl({listing:o,selectedBookingPackage:$.selectedBookingPackage,selectedDate:$.selectedDate,startTime:$.startTime,endTime:$.endTime,guestCount:$.guestCount,calculatedHours:pe.calculatedHours,schedule:_,sliderSelections:$.sliderSelections,serviceEventLocation:$.serviceEventLocation,charter:(j==null?void 0:j.charter)??null,contactOrg:P,requireOrganizationName:ye,specialRequests:te,setSpecialRequests:X,user:l,toast:i,onContinue:Te.handleAddToCart}),[Oe,qe]=u.useState(!1);fe.useEffect(()=>{Oe&&A&&ct("listing_shared",{listingId:A})},[Oe,A]);const[gs,bs]=u.useState(!1),[ge,_e]=u.useState(null),Ge=((Kt=(Qt=N==null?void 0:N.metadata)==null?void 0:Qt.pricing)==null?void 0:Kt.allowCustomQuotes)!==!1&&!(l!=null&&l.publicId&&(o==null?void 0:o.ownerPublicId)===l.publicId),He=u.useCallback(Q=>{if(!Ge){i({title:"Custom quotes unavailable",description:"This provider is not accepting custom quote requests right now.",variant:"destructive"});return}if(_e(Q?Nl(Q):null),!l){const re=`${r.pathname}${r.search}`;Qs(r.pathname)?Ks(re):a("/auth?returnTo="+encodeURIComponent(re));return}bs(!0)},[Ge,l,r,a,i]),[is,ls]=u.useState(null),[os,Ye]=u.useState(!1),[cs,U]=u.useState(!1);fe.useEffect(()=>{is&&!D.some(Q=>Q.id===is.id)&&(ls(null),Ye(!1)),D.length===0&&U(!1)},[D,is]);const B=Bl({isMobile:h,isDialogOpen:os||$.isBookingFlowOpen||Oe||cs}),[J,ee]=u.useState(!1),[K,we]=u.useState(null),[Le,Ce]=u.useState(!1),Re=u.useCallback(async()=>{const Q=++p.current,re=d;if(!(o!=null&&o.listingId)||!re||!b||m){ee(!1),we(null);return}try{const Ne=await Ha(re,o.listingId);if(Q!==p.current||c.current!==re)return;ee(Ne.length>0),we(re)}catch{if(Q!==p.current||c.current!==re)return;ee(!1),we(re)}},[m,b,o==null?void 0:o.listingId,d]);fe.useEffect(()=>{Re()},[Re]),fe.useEffect(()=>{Ce(!1)},[m,b,d]),fe.useEffect(()=>{if(!(!d||!b||m))return Va(d,()=>{Re()})},[m,Re,b,d]);const Qe=u.useCallback(()=>{if(o!=null&&o.listingId&&!(!b||m)){if(!l){const Q=`${r.pathname}${r.search}`;Qs(r.pathname)?Ks(Q):a("/auth?returnTo="+encodeURIComponent(Q));return}d&&Ce(!0)}},[m,b,o==null?void 0:o.listingId,r,a,l,d]),Pe=b&&!m&&K===d&&d?J:!1,Fe=u.useCallback(()=>{var re,Ne;if(!o)return;const Q=new URLSearchParams({listing:o.listingId});$.selectedDate&&Q.set("date",he($.selectedDate,"yyyy-MM-dd")),$.startTime&&Q.set("start",$.startTime),$.endTime&&Q.set("end",$.endTime),$.guestCount>0&&Q.set("guests",String($.guestCount)),(re=$.selectedBookingPackage)!=null&&re.id&&Q.set("offeringId",$.selectedBookingPackage.id),(Ne=$.selectedBookingPackage)!=null&&Ne.name&&Q.set("offeringName",$.selectedBookingPackage.name),a(`/send_message?${Q.toString()}`)},[o,$.selectedDate,$.startTime,$.endTime,$.guestCount,$.selectedBookingPackage,a]),F=M.catererMenu,ae=fe.useMemo(()=>{var Q,re;return!F||!o||!((Q=F.categories)!=null&&Q.length)||!((re=F.items)!=null&&re.length)?null:{menuId:F.menuId??`menu_${o.listingId}`,listingId:o.listingId,name:F.name||"Catering Menu",description:F.description,categories:F.categories,minOrderAmount:F.minOrderAmount,minGuests:F.minGuests,leadTimeHours:F.leadTimeHours,cuisineType:F.cuisineType,status:"active"}},[F,o]),be=fe.useMemo(()=>(F==null?void 0:F.items)??[],[F]),je=ae!=null&&be.length>0,Ie=xi(!w&&H==="caterer"?o==null?void 0:o.listingId:void 0),Ve=hi(w&&H==="caterer"&&!je?o==null?void 0:o.listingId:void 0),Ze=fe.useMemo(()=>!Ve.data||Ve.data.length===0?null:[...Ve.data].filter(Q=>Q.status!=="archived").sort((Q,re)=>{const Ne=Q.status==="draft"?0:Q.status==="active"?1:2,Be=re.status==="draft"?0:re.status==="active"?1:2;return Ne-Be||(Q.sortOrder??0)-(re.sortOrder??0)||(re.updatedAt??"").localeCompare(Q.updatedAt??"")})[0]??null,[Ve.data]),Ss=pi(w&&H==="caterer"&&!je?Ze==null?void 0:Ze.menuId:void 0),Ae=fe.useMemo(()=>{var Q;return w?je?ae:Ze:((Q=Ie.data)==null?void 0:Q.menu)??ae},[je,ae,w,Ze,(Jt=Ie.data)==null?void 0:Jt.menu]),Xe=fe.useMemo(()=>{var Q;return w?je?be:Ss.data??[]:((Q=Ie.data)==null?void 0:Q.items)??be},[je,be,w,Ss.data,(Zt=Ie.data)==null?void 0:Zt.items]),Ts=H==="caterer"&&Ae!=null&&Xe.length>0,Ms=(o==null?void 0:o.bookable)===!1&&(o==null?void 0:o.notBookableReason)==="stripe_not_ready",De=fe.useMemo(()=>wl({offerings:D,hasCharterBooking:T||oe,hasCatererMenu:Ts,canRequestQuote:Ge,hostPaymentsBlocked:Ms}),[D,T,oe,Ts,Ge,Ms]),Ot=De.kind==="quote"?void 0:Ge?He:void 0,lt=u.useCallback(Q=>{ls(Q),Ye(!0)},[]),js=u.useCallback(()=>{var Q;switch(De.kind){case"charter":return;case"packages":U(!0);return;case"menu":(Q=document.getElementById("caterer-menu"))==null||Q.scrollIntoView({behavior:"smooth",block:"start"});return;case"quote":He();return;case"unavailable":return}},[De.kind,He]),Pt=fe.useRef(!1);fe.useEffect(()=>{Pt.current||!o||new URLSearchParams(r.search).get("book")!=="true"||(Pt.current=!0,js())},[js,o,r.search]);const ie=ao({listing:o,catererMenu:Ae,catererMenuItems:Xe,serviceName:q.serviceName,coverImage:q.coverImage,acceptsInstantBookings:R,contactOrg:P,toast:i}),Ft=$.selectedDate?he($.selectedDate,"yyyy-MM-dd"):null,Bt=u.useCallback(Q=>{try{const re=new Date(Q+"T12:00:00");Number.isNaN(re.getTime())||$.setSelectedDate(re)}catch{}js()},[$,js]),ks=ce.packages.length>0?e.jsx(oo,{listingId:(o==null?void 0:o.listingId)??t??"",packages:ce.packages,vehicles:ne,selectedDate:$.selectedDate,onDateChange:$.setSelectedDate,datePickerMinDate:$.datePickerMinDate,datePickerMaxDate:$.datePickerMaxDate,plannerHighlights:$.plannerCalendarHighlights,acceptsInstantBookings:R,contactOrg:P,onContactOrgChange:Y,requireOrganizationName:ye,roundTripOnly:G,onCharterChange:L,onBook:R?Te.handleAddToCart:de.handleRequestBooking,isBooking:R?Te.isAddingToCart:de.isRequestingBooking,...T?{}:{specialRequests:de.specialRequests,onSpecialRequestsChange:de.setSpecialRequests}}):null,Or=!T&&ks?e.jsxs(e.Fragment,{children:[ce.mode==="unavailable"&&e.jsx("div",{className:"mb-4 rounded-xl border border-border bg-muted/50 px-4 py-3 text-sm text-muted-foreground",children:"That package is no longer available. Here is everything else this operator offers."}),ks]}):null,Gt=T?ce.mode==="single"?ks:e.jsxs(e.Fragment,{children:[ce.mode==="unavailable"&&e.jsx("div",{className:"mb-4 rounded-xl border border-border bg-muted/50 px-4 py-3 text-sm text-muted-foreground",children:"That package is no longer available. Here is everything else this operator offers."}),e.jsx(lo,{listingId:(o==null?void 0:o.listingId)??t??"",vehicles:I,selectedDate:$.selectedDate,onDateChange:$.setSelectedDate,datePickerMinDate:$.datePickerMinDate,datePickerMaxDate:$.datePickerMaxDate,plannerHighlights:$.plannerCalendarHighlights,acceptsInstantBookings:R,specialRequests:de.specialRequests,onSpecialRequestsChange:de.setSpecialRequests,contactOrg:P,onContactOrgChange:Y,requireOrganizationName:ye,roundTripOnly:G,onCharterChange:L,onBook:R?Te.handleAddToCart:de.handleRequestBooking,isBooking:R?Te.isAddingToCart:de.isRequestingBooking}),ks&&e.jsxs("div",{className:"mt-6",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-3",children:[e.jsx("span",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"or choose a fixed route"}),e.jsx("span",{className:"h-px flex-1 bg-border"})]}),ks]})]}):Or,Ht=(Xt=N==null?void 0:N.location)==null?void 0:Xt.city,Pr=q.serviceName?Ht?`${q.serviceName} · ${Ht} | PLEC`:`${q.serviceName} | PLEC`:"PLEC",Fr=q.description&&q.description!=="No description available."?q.description.slice(0,155).trimEnd()+(q.description.length>155?"…":""):`Book ${q.serviceName??"this service"} on PLEC.`;if(Bi({title:q.serviceName?Pr:void 0,description:Fr,image:(en=q.galleryImages)==null?void 0:en[0],canonical:`https://plec-it.com${r.pathname}`,type:"website"}),Gi(O),E)return e.jsx(dt,{showSearch:!0,showFooter:!0,children:h?e.jsx(xo,{}):e.jsx(ho,{})});if(V||!o){const Q=V==null?void 0:V.includes("not a service");return e.jsx(dt,{showSearch:!0,showFooter:!0,children:e.jsxs("div",{className:"mx-auto flex max-w-3xl flex-col items-center gap-6 px-6 py-24 text-center",children:[e.jsx(Fs,{className:"h-12 w-12 text-gray-400"}),e.jsx("h1",{className:"text-3xl font-semibold text-gray-900",children:Q?"Invalid Listing Type":"We couldn't load that service"}),e.jsx("p",{className:"text-sm text-gray-600",children:V||"It may have been unpublished, removed, or the link is incorrect."}),e.jsx(Z,{asChild:!0,className:"rounded-full px-6",children:e.jsx("a",{href:Q?"/venues":"/services",children:Q?"Browse Venues":"Back to services"})})]})})}return e.jsxs(dt,{showSearch:!0,showFooter:!0,children:[w&&e.jsx("div",{className:"bg-amber-50 border-b border-amber-200 px-4 py-3 text-center",children:e.jsxs("p",{className:"text-sm text-amber-800",children:[e.jsx("span",{className:"font-semibold",children:"Preview Mode:"})," This is a draft listing preview."]})}),l&&(o==null?void 0:o.hostCancellationWarning)&&e.jsx("div",{className:"bg-yellow-50 border-b border-yellow-200 px-4 py-3 text-center",children:e.jsx("p",{className:"text-sm text-yellow-800",children:"⚠️ This host has a history of last-minute cancellations."})}),h?e.jsx(Kl,{vm:q,listing:o,offerings:D,serviceData:M,serviceType:H,effectiveData:N,metadata:C,cancellationPolicy:S,cancellationNotes:k,isScrolled:B.isScrolled,scrollContainerRef:B.scrollContainerRef,navigate:a,isSaved:Pe,savingService:!1,handleSaveService:o.status==="published"?Qe:void 0,handleViewPackageDetails:lt,handleShowDates:js,handleMessageProvider:Fe,onRequestCustomQuote:Ot,bookingActionLabel:De.label,bookingActionDisabled:De.disabled,bookingActionDisabledMessage:De.disabledMessage,charterInline:Gt,createConversationPending:x.isPending,setIsShareOpen:qe,schedule:_,blockedDates:g,availability:y.availability,acceptsInstantBookings:R,selectedDate:Ft,onAvailabilityDateSelect:Bt,plannerCalendarHighlights:$.plannerCalendarHighlights,catererMenu:Ae,catererMenuItems:Xe,onMenuItemAddToCart:ie.handleMenuItemAddToCart,catererMenuOrderProgress:ie.menuOrderProgress,isRequestMode:ie.isRequestMode,requestModeItems:ie.requestModeItems,requestModeSubtotalCents:ie.requestModeSubtotalCents,onSubmitMenuRequest:ie.handleSubmitMenuRequest,onRemoveRequestModeItem:ie.removeOrderItem,instantMenuItems:ie.instantModeItems,canContinueToCheckout:ie.canContinueToCheckout,isContinuingToCheckout:ie.isSubmitting,onContinueToCheckout:ie.continueToCheckout,onGalleryPhotoAdvance:z}):e.jsx(Jl,{vm:q,listing:o,offerings:D,serviceData:M,serviceType:H,effectiveData:N,metadata:C,cancellationPolicy:S,cancellationNotes:k,stickyCard:B,isPreviewMode:w,user:l,isSaved:Pe,handleSaveService:o.status==="published"?Qe:void 0,handleViewPackageDetails:lt,handleShowDates:js,handleMessageProvider:Fe,onRequestCustomQuote:Ot,bookingActionLabel:De.label,bookingActionDisabled:De.disabled,bookingActionDisabledMessage:De.disabledMessage,charterInline:Gt,createConversationPending:x.isPending,setIsShareOpen:qe,schedule:_,blockedDates:g,availability:y.availability,acceptsInstantBookings:R,selectedDate:Ft,onAvailabilityDateSelect:Bt,plannerCalendarHighlights:$.plannerCalendarHighlights,catererMenu:Ae,catererMenuItems:Xe,onMenuItemAddToCart:ie.handleMenuItemAddToCart,catererMenuOrderProgress:ie.menuOrderProgress,isRequestMode:ie.isRequestMode,requestModeItems:ie.requestModeItems,requestModeSubtotalCents:ie.requestModeSubtotalCents,onSubmitMenuRequest:ie.handleSubmitMenuRequest,onRemoveRequestModeItem:ie.removeOrderItem,instantMenuItems:ie.instantModeItems,canContinueToCheckout:ie.canContinueToCheckout,isContinuingToCheckout:ie.isSubmitting,onContinueToCheckout:ie.continueToCheckout,onGalleryPhotoAdvance:z}),o&&e.jsx(Fi,{open:gs,onClose:()=>{bs(!1),_e(null)},listingId:o.listingId,askEventAddress:!0,defaultEventLocation:$.serviceEventLocation,packageId:ge==null?void 0:ge.packageId,packageName:ge==null?void 0:ge.packageName,pricingMode:ge==null?void 0:ge.pricingMode,negotiatedFrom:ge==null?void 0:ge.negotiatedFrom,defaultEventDate:$.selectedDate?he($.selectedDate,"yyyy-MM-dd"):void 0,defaultGuestCount:$.guestCount>0?$.guestCount:void 0,defaultStartTime:$.startTime||void 0,defaultEndTime:$.endTime||void 0},(ge==null?void 0:ge.packageId)??"general-service-quote"),e.jsx(Da,{open:Le&&b&&!m&&!!d,onOpenChange:Ce,listingId:(o==null?void 0:o.listingId)??"",listingTitle:(q==null?void 0:q.serviceName)??(M==null?void 0:M.cardTitle),listingImageUrl:(M==null?void 0:M.coverImage)??((sn=D==null?void 0:D[0])==null?void 0:sn.image),onSavedChange:()=>{A&&ct("listing_saved",{listingId:A}),Re(),window.dispatchEvent(new CustomEvent("savedVenuesChanged"))}}),e.jsx(Wl,{isMobile:h,addOns:W,selectedPackage:is,isPackageDetailOpen:os,setIsPackageDetailOpen:Ye,offerings:D,isPackageSelectionOpen:cs,setIsPackageSelectionOpen:U,bookingFlow:$,pricing:pe,cartActions:Te,bookingRequest:de,acceptsInstantBookings:R,cartLoading:!1,isShareOpen:Oe,setIsShareOpen:qe,onViewPackageDetails:lt,onRequestPackageQuote:He,handleMessageProvider:Fe,navigate:a,toast:i,listingId:(o==null?void 0:o.listingId)??t??"",charterVehicles:T?I:void 0,onCharterChange:L,contactOrg:P,setContactOrg:Y,requireOrganizationName:ye,taxJurisdictionCollected:Lt((nn=(tn=o==null?void 0:o.publishedData)==null?void 0:tn.location)==null?void 0:nn.country,(an=(rn=o==null?void 0:o.publishedData)==null?void 0:rn.location)==null?void 0:an.state)}),e.jsx(io,{open:ie.isOrderDetailsOpen,onOpenChange:Q=>{Q?ie.setOrderDetailsOpen(!0):ie.cancelPendingAdd()},isMobile:h,isSubmitting:ie.isSubmitting,confirmStartsCheckout:ie.confirmStartsCheckout,isRequestMode:ie.isRequestMode,defaultDate:$.selectedDate,defaultStartTime:$.startTime,defaultEndTime:$.endTime,defaultGuestCount:$.guestCount,defaultEventLocation:$.serviceEventLocation,schedule:_,datePickerMinDate:$.datePickerMinDate,datePickerMaxDate:$.datePickerMaxDate,serviceDatePickerDisabled:$.serviceDatePickerDisabled,minGuests:Ae==null?void 0:Ae.minGuests,contactOrg:P,onContactOrgChange:Y,requireOrganizationName:ye,onConfirm:ie.confirmOrderDetails}),e.jsx(ci,{deviations:de.eventDeviations,onConfirm:de.confirmEventDeviation,onCancel:de.dismissEventDeviation})]})},xo=()=>e.jsxs("div",{className:"flex flex-col min-h-screen",children:[e.jsx(se,{className:"h-[360px] w-full rounded-none shrink-0"}),e.jsxs("div",{className:"bg-card -mt-8 relative z-10 rounded-t-[32px] pt-8 flex-1",children:[e.jsxs("div",{className:"px-6 pb-6 space-y-3 text-center",children:[e.jsx(se,{className:"h-8 w-3/4 mx-auto"}),e.jsx(se,{className:"h-4 w-32 mx-auto"}),e.jsxs("div",{className:"flex justify-center gap-2",children:[e.jsx(se,{className:"h-6 w-16 rounded-full"}),e.jsx(se,{className:"h-6 w-20 rounded-full"}),e.jsx(se,{className:"h-6 w-12 rounded-full"})]})]}),e.jsxs("div",{className:"px-6 pb-8 space-y-6",children:[e.jsx(se,{className:"h-4 w-full"}),e.jsx(se,{className:"h-4 w-full"}),e.jsx(se,{className:"h-7 w-28"}),e.jsx("div",{className:"space-y-3",children:[1,2].map(s=>e.jsx(se,{className:"h-20 w-full rounded-2xl"},s))}),e.jsx(se,{className:"h-7 w-36"}),e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx(se,{className:"h-14 w-14 rounded-full shrink-0"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(se,{className:"h-5 w-28"}),e.jsx(se,{className:"h-4 w-full"})]})]})]})]}),e.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-40 bg-card border-t p-4",children:e.jsx(se,{className:"h-12 w-full rounded-full"})})]}),ho=()=>e.jsxs("div",{className:"mx-auto w-full max-w-7xl px-6 pb-24 pt-10 md:px-8",children:[e.jsx(se,{className:"h-[22rem] w-full rounded-2xl mb-10"}),e.jsxs("div",{className:"flex flex-col gap-10 lg:flex-row",children:[e.jsxs("div",{className:"flex-1 min-w-0 space-y-10",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(se,{className:"h-4 w-28 mb-2"}),e.jsx(se,{className:"h-10 w-2/5 mt-2"}),e.jsxs("div",{className:"flex gap-2 mt-3",children:[e.jsx(se,{className:"h-7 w-24 rounded-full"}),e.jsx(se,{className:"h-7 w-28 rounded-full"}),e.jsx(se,{className:"h-7 w-16 rounded-full"})]})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsx(se,{className:"h-4 w-full"}),e.jsx(se,{className:"h-4 w-full max-w-[85%]"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(se,{className:"h-7 w-48"}),[1,2,3].map(s=>e.jsx(se,{className:"h-28 w-full rounded-2xl"},s))]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(se,{className:"h-7 w-44"}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(se,{className:"h-20 w-20 rounded-full shrink-0"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(se,{className:"h-5 w-32"}),e.jsx(se,{className:"h-4 w-full"})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(se,{className:"h-7 w-36"}),e.jsx(se,{className:"h-[280px] w-full rounded-2xl"})]})]}),e.jsx("aside",{className:"w-full lg:w-[360px] xl:w-[400px] lg:flex-shrink-0",children:e.jsx("div",{className:"sticky top-[172px] space-y-6",children:e.jsxs("div",{className:"rounded-[32px] border border-border/70 p-6 shadow-xl space-y-4",children:[e.jsx(se,{className:"h-16 w-16 rounded-full mx-auto"}),e.jsx(se,{className:"h-5 w-28 mx-auto"}),e.jsx(se,{className:"h-4 w-40 mx-auto"}),e.jsxs("div",{className:"flex justify-center gap-2 pt-2",children:[e.jsx(se,{className:"h-8 w-8 rounded-full"}),e.jsx(se,{className:"h-8 w-8 rounded-full"}),e.jsx(se,{className:"h-8 w-8 rounded-full"})]}),e.jsx(se,{className:"h-px w-full"}),e.jsx(se,{className:"h-12 w-full rounded-full"}),e.jsx(se,{className:"h-10 w-full rounded-full"})]})})})]})]});export{bc as default};