var Bt=t=>{throw TypeError(t)};var gt=(t,n,s)=>n.has(t)||Bt("Cannot "+s);var E=(t,n,s)=>(gt(t,n,"read from private field"),s?s.call(t):n.get(t)),K=(t,n,s)=>n.has(t)?Bt("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,s),U=(t,n,s,a)=>(gt(t,n,"write to private field"),a?a.call(t,s):n.set(t,s),s),Z=(t,n,s)=>(gt(t,n,"access private method"),s);import{r as d,e as ot,j as e,L as ae,u as os,f as ct,b as Us}from"./vendor-react-CVHocMAO.js";import{u as Xs}from"./useSeo-BXYcILQx.js";import{S as $s,n as ft,s as Vs,r as Gs,Q as cs,u as Ws,a as Ys,b as qs,e as Qs,c as Ks,d as Zs,f as Js,g as Ot,h as en,i as tn,j as sn,k as ds,l as xe,B as G,H as zt,m as nn,L as ne,o as us,p as hs,q as an,t as ms,v as Ne,w as rn,X as De,I as rt,P as ln,A as on,D as ge,x as gs,y as cn,z as dn,C as un,M as hn,E as mn,F as pe,G as B,J as xs,K as Ut,N as fs,O as pt,R as gn,T as xn,U as fn,V as pn,W as bn,Y as it,Z as yn,_ as vn,$ as wn,a0 as jn,a1 as Nn,a2 as Sn,a3 as Xt,a4 as Je,a5 as Mn}from"./index-DXdAv5n3.js";import{C as kn}from"./circle-plus-DUCFwSOV.js";import{u as Cn,a as He,b as ps,A as bs,M as Ln}from"./vendor-maps-BX5dXCaZ.js";import{g as An,s as ys,a as bt}from"./listings-C5R8R0UD.js";import{u as En,a as Pn,s as Tn,U as Rn}from"./UnifiedMobileNavbar-DB3kgBNQ.js";import{C as Fn}from"./CityAutocomplete-Dc7MIh9U.js";import{D as In}from"./date-picker-BM-CR-Ne.js";import{Q as _n}from"./QuantityStepper-Dhv2rSZr.js";import{c as $t}from"./quantity-i687YTEV.js";import{p as Dn}from"./parseISO-BeqhIhSi.js";import{L as Ct}from"./ListingCard-DIwNuqAS.js";import{A as Hn}from"./arrow-right-B6oF8gn-.js";import{f as Bn}from"./vendor-amplify-BttVyssp.js";import{S as Te}from"./star-WZhRtBdg.js";import{D as et}from"./dollar-sign-BLKPzwbA.js";import{L as On}from"./loader-circle-CBzAjQAw.js";import{t as vs,b as ws,F as Vt}from"./venues-B2299m8F.js";import{g as zn,M as Un,A as Xn,m as js}from"./vendor-motion-CP2nHqR4.js";import"./confetti.module-B5JVzsfH.js";import{C as $n}from"./calendar-days-BZ6ScuUG.js";import{B as Vn}from"./briefcase-BIW9oRxC.js";import{g as Gn}from"./listing-utils-DWgPJQzT.js";import{I as Wn}from"./ImageWithFallback-BEJkpOin.js";import{M as Yn}from"./map-INM7SReK.js";import{c as Ns}from"./utils-m29NAvmr.js";import{i as Gt}from"./claimRequests-LbP6AkmD.js";import"./vendor-radix-Boyzn9qx.js";import"./minus-C_OHdqnb.js";import"./plus-gZD8KbAO.js";import"./feeRates-DFYxRksI.js";import"./OptimizedImage-CFzueLcd.js";import"./listingFeeInput-BVaxVJEf.js";import"./listing-Dh6xmhdV.js";import"./wishlists-mdsVtVG_.js";import"./savedVenues-CqTNNALH.js";import"./badge-check-CabiHZCA.js";import"./guestPricing-DaiRwFJy.js";import"./award-TfkAFFEh.js";import"./circle-check-CJi34ijI.js";import"./differenceInDays-st7ugZrd.js";function Wt(t,n){const s=new Set(n);return t.filter(a=>!s.has(a))}function qn(t,n,s){const a=t.slice(0);return a[n]=s,a}var Se,W,Me,fe,Y,le,Re,Fe,Ie,_e,D,yt,vt,Ss,wt,jt,Nt,ls,Qn=(ls=class extends $s{constructor(n,s,a){super();K(this,D);K(this,Se);K(this,W);K(this,Me);K(this,fe);K(this,Y);K(this,le);K(this,Re);K(this,Fe);K(this,Ie);K(this,_e,[]);U(this,Se,n),U(this,fe,a),U(this,Me,[]),U(this,Y,[]),U(this,W,[]),this.setQueries(s)}onSubscribe(){this.listeners.size===1&&E(this,Y).forEach(n=>{n.subscribe(s=>{Z(this,D,jt).call(this,n,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,E(this,Y).forEach(n=>{n.destroy()})}setQueries(n,s){U(this,Me,n),U(this,fe,s),ft.batch(()=>{const a=E(this,Y),r=Z(this,D,wt).call(this,E(this,Me));r.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const i=r.map(m=>m.observer),l=i.map(m=>m.getCurrentResult()),c=a.length!==i.length,g=i.some((m,u)=>m!==a[u]),x=c||g,o=x?!0:l.some((m,u)=>{const h=E(this,W)[u];return!h||!Vs(m,h)});!x&&!o||(x&&(U(this,_e,r),U(this,Y,i)),U(this,W,l),this.hasListeners()&&(x&&(Wt(a,i).forEach(m=>{m.destroy()}),Wt(i,a).forEach(m=>{m.subscribe(u=>{Z(this,D,jt).call(this,m,u)})})),Z(this,D,Nt).call(this)))})}getCurrentResult(){return E(this,W)}getQueries(){return E(this,Y).map(n=>n.getCurrentQuery())}getObservers(){return E(this,Y)}getOptimisticResult(n,s){const a=Z(this,D,wt).call(this,n),r=a.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),i=a.map(l=>l.defaultedQueryOptions.queryHash);return[r,l=>Z(this,D,vt).call(this,l??r,s,i),()=>Z(this,D,yt).call(this,r,a)]}},Se=new WeakMap,W=new WeakMap,Me=new WeakMap,fe=new WeakMap,Y=new WeakMap,le=new WeakMap,Re=new WeakMap,Fe=new WeakMap,Ie=new WeakMap,_e=new WeakMap,D=new WeakSet,yt=function(n,s){return s.map((a,r)=>{const i=n[r];return a.defaultedQueryOptions.notifyOnChangeProps?i:a.observer.trackResult(i,l=>{s.forEach(c=>{c.observer.trackProp(l)})})})},vt=function(n,s,a){if(s){const r=E(this,Ie),i=a!==void 0&&r!==void 0&&(r.length!==a.length||a.some((l,c)=>l!==r[c]));return(!E(this,le)||E(this,W)!==E(this,Fe)||i||s!==E(this,Re))&&(U(this,Re,s),U(this,Fe,E(this,W)),a!==void 0&&U(this,Ie,a),U(this,le,Gs(E(this,le),s(n)))),E(this,le)}return n},Ss=function(){var n;return((n=E(this,fe))==null?void 0:n.combine)!==void 0&&E(this,Y).some((s,a)=>{var r;return s.options.suspense&&((r=E(this,W)[a])==null?void 0:r.data)===void 0})},wt=function(n){const s=new Map;E(this,Y).forEach(r=>{const i=r.options.queryHash;if(!i)return;const l=s.get(i);l?l.push(r):s.set(i,[r])});const a=[];return n.forEach(r=>{var g;const i=E(this,Se).defaultQueryOptions(r),c=((g=s.get(i.queryHash))==null?void 0:g.shift())??new cs(E(this,Se),i);a.push({defaultedQueryOptions:i,observer:c})}),a},jt=function(n,s){const a=E(this,Y).indexOf(n);a!==-1&&(U(this,W,qn(E(this,W),a,s)),Z(this,D,Nt).call(this))},Nt=function(){var n;if(this.hasListeners()){const s=Z(this,D,yt).call(this,E(this,W),E(this,_e)),a=Z(this,D,Ss).call(this),r=E(this,le),i=a?r:Z(this,D,vt).call(this,s,(n=E(this,fe))==null?void 0:n.combine);(a||r!==i)&&ft.batch(()=>{this.listeners.forEach(l=>{l(E(this,W))})})}},ls);function St({queries:t,...n},s){const a=Ws(),r=Ys(),i=qs(),l=d.useMemo(()=>t.map(f=>{const b=a.defaultQueryOptions(f);return b._optimisticResults=r?"isRestoring":"optimistic",b}),[t,a,r]);l.forEach(f=>{Qs(f);const b=a.getQueryCache().get(f.queryHash);Ks(f,i,b)}),Zs(i);const[c]=d.useState(()=>new Qn(a,l,n)),[g,x,o]=c.getOptimisticResult(l,n.combine),m=!r&&n.subscribed!==!1;d.useSyncExternalStore(d.useCallback(f=>m?c.subscribe(ft.batchCalls(f)):Js,[c,m]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),d.useEffect(()=>{c.setQueries(l,n)},[l,n,c]);const h=g.some((f,b)=>Ot(l[b],f))?g.flatMap((f,b)=>{const S=l[b];if(S&&Ot(S,f)){const M=new cs(a,S);return en(S,M,i)}return[]}):[];if(h.length>0)throw Promise.all(h);const p=g.find((f,b)=>{const S=l[b];return S&&tn({result:f,errorResetBoundary:i,throwOnError:S.throwOnError,query:a.getQueryCache().get(S.queryHash),suspense:S.suspense})});if(p!=null&&p.error)throw p.error;return x(o())}/**
 * @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 Kn=sn("Cake",[["path",{d:"M20 21v-8a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8",key:"1w3rig"}],["path",{d:"M4 16s.5-1 2-1 2.5 2 4 2 2.5-2 4-2 2.5 2 4 2 2-1 2-1",key:"n2jgmb"}],["path",{d:"M2 21h20",key:"1nyx9w"}],["path",{d:"M7 8v3",key:"1qtyvj"}],["path",{d:"M12 8v3",key:"hwp4zt"}],["path",{d:"M17 8v3",key:"1i6e5u"}],["path",{d:"M7 4h.01",key:"1bh4kh"}],["path",{d:"M12 4h.01",key:"1ujb9j"}],["path",{d:"M17 4h.01",key:"1upcoc"}]]),Ms=({hasSearchParams:t,query:n})=>{const s=ot(),{user:a}=ds(),[r,i]=d.useState(!1),[l,c]=d.useState(null);return d.useLayoutEffect(()=>{const g=()=>{const x=document.querySelector("header"),o=x?x.getBoundingClientRect().height:0,m=window.innerHeight-o;c(m>0?m:window.innerHeight)};return g(),window.addEventListener("resize",g),window.addEventListener("orientationchange",g),()=>{window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g)}},[]),e.jsxs("div",{className:"flex flex-col items-center justify-center px-4 py-8",style:{minHeight:l?`${l}px`:void 0},children:[e.jsxs("div",{className:"max-w-md w-full text-center space-y-4",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"w-24 h-24 rounded-full bg-muted flex items-center justify-center",children:e.jsx(xe,{className:"w-12 h-12 text-muted-foreground"})})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:t?n?`No venues found with keyword "${n}"`:"No venues match your search":"No venues available yet"}),e.jsx("p",{className:"text-muted-foreground",children:t?"Try adjusting your filters or search criteria":"Be the first to list a venue in your area"})]}),e.jsx("div",{className:"flex flex-col sm:flex-row gap-3 justify-center pt-4",children:t?e.jsxs(e.Fragment,{children:[e.jsxs(G,{variant:"outline",onClick:()=>s("/venues"),className:"gap-2",children:[e.jsx(zt,{className:"w-4 h-4"}),"Clear Filters"]}),e.jsx(G,{onClick:()=>s("/venues"),className:"gap-2",children:"Browse All Venues"})]}):e.jsxs(e.Fragment,{children:[e.jsxs(G,{variant:"outline",onClick:()=>s("/"),className:"gap-2",children:[e.jsx(zt,{className:"w-4 h-4"}),"Back to Home"]}),e.jsxs(G,{onClick:()=>{i(!0)},className:"bg-brand hover:bg-brand/90 text-brand-foreground gap-2",children:[e.jsx(kn,{className:"w-4 h-4"}),"List Your Venue"]})]})}),e.jsx("div",{className:"pt-8 border-t border-border",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Looking for something specific?"," ",e.jsx("button",{onClick:()=>s("/help"),className:"text-brand hover:underline font-medium",children:"Visit Help Center"})]})})]}),e.jsx(nn,{open:r,onOpenChange:i})]})},Zn=({value:t,onChange:n})=>{const s=rn();return e.jsxs("div",{children:[e.jsx(ne,{className:"text-base font-medium mb-3 block",children:"Type of venue"}),e.jsxs(us,{value:t,onValueChange:n,children:[e.jsx(hs,{children:e.jsx(an,{placeholder:"All"})}),e.jsx(ms,{children:s.map(a=>e.jsx(Ne,{value:a.value,children:a.label},a.value))})]})]})},tt="0",st="0",Jn=({minPrice:t,maxPrice:n,onMinPriceChange:s,onMaxPriceChange:a,isDefault:r=!1})=>{const i=t||tt,l=n||st,[c,g]=d.useState(!r),x=c&&(i!==tt||l!==st);d.useEffect(()=>{r&&i===tt&&l===st&&g(!1)},[i,l,r]);const o=h=>{g(!0),s(h)},m=h=>{g(!0),a(h)},u=()=>{g(!1),s(tt),a(st)};return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx(ne,{className:"text-base font-medium",children:"Price Range"}),x&&e.jsxs(G,{variant:"ghost",size:"sm",onClick:u,className:"h-7 px-2 text-xs text-muted-foreground hover:text-foreground",children:[e.jsx(De,{className:"w-3 h-3 mr-1"}),"Clear"]})]}),!c&&e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Set a price range to filter results"}),e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx(ne,{className:"text-sm text-muted-foreground",children:"Min:"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{className:"mr-2 text-muted-foreground",children:"$"}),e.jsx(rt,{type:"number",min:"0",value:i==="0"?"":i,onChange:h=>o(h.target.value||"0"),placeholder:"Min",className:x?"border-brand":""})]})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx(ne,{className:"text-sm text-muted-foreground",children:"Max:"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{className:"mr-2 text-muted-foreground",children:"$"}),e.jsx(rt,{type:"number",min:"0",value:l==="0"?"":l,onChange:h=>m(h.target.value||"0"),placeholder:"Max",className:x?"border-brand":""})]})]})]}),x&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Filtering: $",i," - $",l]})]})},ea=({selectedPackages:t,onToggle:n})=>e.jsxs("div",{children:[e.jsx(ne,{className:"text-base font-medium mb-3 block",children:"Package Options"}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:ln.map(s=>e.jsx(G,{variant:"outline",className:`h-auto py-3 text-left justify-start ${t.includes(s)?"bg-accent border-accent hover:bg-accent/90 text-accent-foreground":""}`,onClick:()=>n(s),children:s},s))})]}),ta=({selectedAge:t,onToggle:n})=>e.jsxs("div",{children:[e.jsx(ne,{className:"text-base font-medium mb-3 block",children:"Age restriction"}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(G,{variant:"outline",className:`flex-1 ${t==="18+"?"bg-accent border-accent hover:bg-accent/90 text-accent-foreground":""}`,onClick:()=>n("18+"),children:"18+"}),e.jsx(G,{variant:"outline",className:`flex-1 ${t==="21+"?"bg-accent border-accent hover:bg-accent/90 text-accent-foreground":""}`,onClick:()=>n("21+"),children:"21+"})]})]}),sa=({selectedAmenities:t,onToggle:n})=>e.jsxs("div",{children:[e.jsx(ne,{className:"text-base font-medium mb-3 block",children:"Amenities"}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:on.map(s=>e.jsx(G,{variant:"outline",className:`h-auto py-3 text-left justify-start ${t.includes(s)?"bg-accent border-accent hover:bg-accent/90 text-accent-foreground":""}`,onClick:()=>n(s),children:s},s))})]}),na=({capacityMin:t,capacityMax:n,onMinChange:s,onMaxChange:a})=>e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center justify-between mb-3",children:e.jsx(ne,{className:"text-base font-medium",children:"Capacity"})}),e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx(ne,{className:"text-sm text-muted-foreground",children:"Min guests:"}),e.jsx("div",{className:"flex items-center",children:e.jsx(rt,{type:"number",min:"0",value:t||"",onChange:r=>s(r.target.value),placeholder:"Any"})})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx(ne,{className:"text-sm text-muted-foreground",children:"Max guests:"}),e.jsx("div",{className:"flex items-center",children:e.jsx(rt,{type:"number",min:"0",value:n||"",onChange:r=>a(r.target.value),placeholder:"Any"})})]})]})]}),aa=({onClose:t,onApply:n,initialFilters:s={}})=>{const a=!s.minPrice&&!s.maxPrice,[r,i]=d.useState({packages:s.packages||ge.packages,ageRestriction:s.ageRestriction||ge.ageRestriction,minPrice:s.minPrice??ge.minPrice,maxPrice:s.maxPrice??ge.maxPrice,venueType:s.venueType||ge.venueType,amenities:s.amenities||ge.amenities,capacityMin:s.capacityMin,capacityMax:s.capacityMax}),l=d.useCallback(u=>{i(h=>({...h,packages:h.packages.includes(u)?h.packages.filter(p=>p!==u):[...h.packages,u]}))},[]),c=d.useCallback(u=>{i(h=>({...h,ageRestriction:h.ageRestriction===u?"":u}))},[]),g=d.useCallback(u=>{i(h=>({...h,amenities:h.amenities.includes(u)?h.amenities.filter(p=>p!==u):[...h.amenities,u]}))},[]),x=d.useCallback(()=>{i(ge)},[]),o=d.useCallback(()=>{n(r),t()},[r,n,t]),m=gs();return e.jsx(cn,{open:!0,onOpenChange:u=>{u||t()},children:e.jsxs(dn,{mobileBottomSheet:m,className:"max-w-md w-full mx-auto p-0",hideCloseButton:!0,children:[e.jsxs("div",{className:"flex items-center justify-between px-4 pt-4 pb-2",children:[e.jsx(un,{className:"text-2xl font-bold m-0",children:"Filters"}),e.jsx(hn,{"aria-label":"Close filters"})]}),e.jsxs("div",{className:"space-y-6 px-4",children:[e.jsx(Zn,{value:r.venueType,onChange:u=>i(h=>({...h,venueType:u}))}),e.jsx(Jn,{minPrice:r.minPrice,maxPrice:r.maxPrice,onMinPriceChange:u=>i(h=>({...h,minPrice:u})),onMaxPriceChange:u=>i(h=>({...h,maxPrice:u})),isDefault:a}),e.jsx(ea,{selectedPackages:r.packages,onToggle:l}),e.jsx(sa,{selectedAmenities:r.amenities,onToggle:g}),e.jsx(na,{capacityMin:r.capacityMin,capacityMax:r.capacityMax,onMinChange:u=>i(h=>({...h,capacityMin:u||void 0})),onMaxChange:u=>i(h=>({...h,capacityMax:u||void 0}))}),e.jsx(ta,{selectedAge:r.ageRestriction,onToggle:c})]}),e.jsxs(mn,{className:"flex-row gap-4 sm:gap-4 flex-1",children:[e.jsx(G,{variant:"outline",className:"flex-1",onClick:x,children:"Clear all"}),e.jsx(G,{className:"flex-1 bg-brand hover:bg-brand/90 text-brand-foreground",onClick:o,children:"Apply"})]})]})})};function ks(t,n,s,a){const i=(s-t)*Math.PI/180,l=(a-n)*Math.PI/180,c=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t*Math.PI/180)*Math.cos(s*Math.PI/180)*Math.sin(l/2)*Math.sin(l/2);return 3959*(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)))}function ra(t,n,s){return t.map(a=>({pos:a,distance:ks(n.lat,n.lng,a.lat,a.lng)})).filter(a=>a.distance<=s).map(a=>a.pos)}function nt(t){return(t==null?void 0:t.trim().toLowerCase())||""}const Yt=250;function ia(t,n){const[s,a]=d.useState({}),r=d.useRef(new Set);return d.useEffect(()=>{a(i=>{const l={...i};let c=!1;const g=new Set;return t.forEach(x=>{g.add(x.id);const o=typeof x.latitude=="number"?x.latitude:parseFloat(String(x.latitude??"")),m=typeof x.longitude=="number"?x.longitude:parseFloat(String(x.longitude??""));if(Number.isFinite(o)&&Number.isFinite(m)){const u=l[x.id];(!u||u.lat!==o||u.lng!==m||u.source!=="listing")&&(l[x.id]={lat:o,lng:m,source:"listing",locationLabel:nt(x.location)},c=!0)}else{const u=l[x.id];u&&u.source==="geocoded"&&u.locationLabel&&nt(x.location)!==u.locationLabel&&nt(x.location)&&(delete l[x.id],c=!0)}}),Object.keys(l).forEach(x=>{g.has(x)||(delete l[x],c=!0)}),c?l:i})},[t,n]),d.useEffect(()=>{var m;if(typeof google>"u"||!((m=google.maps)!=null&&m.Geocoder))return;r.current.clear();const i=t.filter(u=>!(!u.location||!u.location.trim()||s[u.id]||r.current.has(u.id)));if(!i.length)return;const l=new google.maps.Geocoder,c=[...i];let g=!1;const x=(u,h,p,f)=>{a(b=>{const S=b[u];return S&&S.lat===h&&S.lng===p?b:{...b,[u]:{lat:h,lng:p,source:"geocoded",locationLabel:nt(f)}}})},o=()=>{if(g)return;const u=c.shift();u&&(r.current.add(u.id),l.geocode({address:u.location},(h,p)=>{if(r.current.delete(u.id),!g){if(p==="OK"&&h&&h[0]){const f=h[0].geometry.location;x(u.id,f.lat(),f.lng(),u.location)}else if(p==="OVER_QUERY_LIMIT"){c.unshift(u),setTimeout(o,Yt*4);return}else p==="ZERO_RESULTS"?console.warn("No geocode results for venue",{venueId:u.id,location:u.location}):console.warn("Failed to geocode venue location",{venueId:u.id,status:p});c.length>0&&setTimeout(o,Yt)}}))};return o(),()=>{g=!0}},[t,s,n]),s}function la({location:t,query:n,focusBounds:s,searchKey:a}){const[r,i]=d.useState({lat:30.2672,lng:-97.7431}),[l,c]=d.useState(11),[g,x]=d.useState(null),[o,m]=d.useState(null),u=d.useRef(null),h=Cn("places");return d.useEffect(()=>{g&&n?u.current=g.position:n||(u.current=null)},[g,n]),d.useEffect(()=>{if(!s){if(n&&n.trim()&&h&&new google.maps.Geocoder().geocode({address:n.trim()},(f,b)=>{if(b==="OK"&&f&&f[0]){const{lat:S,lng:M}=f[0].geometry.location,L={lat:S(),lng:M()},y=f[0].types||[];if(y.some(N=>N==="locality"||N==="administrative_area_level_1"||N==="administrative_area_level_2"||N==="postal_code")){i(L),c(11),x({position:L,name:f[0].formatted_address||n,address:f[0].formatted_address||n,photos:[],types:y}),m(null);return}}}),(t==null?void 0:t.toLowerCase())==="nearby"||!t){x(null),!n&&navigator.geolocation&&navigator.geolocation.getCurrentPosition(p=>{i({lat:p.coords.latitude,lng:p.coords.longitude}),m({lat:p.coords.latitude,lng:p.coords.longitude}),c(12)},p=>{p.code!==1&&console.warn("Geolocation error:",p),m(null)});return}t&&h&&(m(null),new google.maps.Geocoder().geocode({address:t},(f,b)=>{if(b==="OK"&&f&&f[0]){const{lat:S,lng:M}=f[0].geometry.location,L={lat:S(),lng:M()};i(L);const y=new h.PlacesService(document.createElement("div")),j={query:t,fields:["name","formatted_address","photos","place_id"]};if(y.findPlaceFromQuery(j,(N,T)=>{if(T===h.PlacesServiceStatus.OK&&N&&N[0]){const P=N[0];if(!P.place_id)return;y.getDetails({placeId:P.place_id,fields:["name","formatted_address","photos","place_id","types"]},(A,X)=>{if(X===h.PlacesServiceStatus.OK&&A){const ee=[];A.photos&&A.photos.length>0&&A.photos.slice(0,5).forEach(q=>{ee.push(q.getUrl({maxWidth:400,maxHeight:300}))}),x({position:L,name:A.name||t,address:A.formatted_address||N[0].formatted_address||t,photos:ee,placeId:A.place_id,types:A.types||[]})}else x({position:L,name:t,address:N[0].formatted_address||t,photos:[],types:[]})})}else x({position:L,name:t,address:N[0].formatted_address||t,photos:[],types:[]})}),t.includes("miles from current location")){const N=parseInt(t);N<=5?c(12):N<=10?c(11):c(10)}else c(12)}}))}},[t,h,a,s,n]),{center:r,zoom:l,locationMarker:g,userLocation:o,queryLocationRef:u}}const oa=100,ca=50;function da({venues:t,resolvedVenuePositions:n,locationMarker:s,userLocation:a,queryLocation:r,focusBounds:i,searchKey:l,onBoundsChange:c,userHasMovedMap:g}){const x=He();d.useEffect(()=>{var u;if(!x||typeof google>"u"||!((u=google.maps)!=null&&u.LatLngBounds)||i||g&&c)return;const o=t.map(h=>n[h.id]).filter(h=>h!==void 0);if(t.length===0||o.length===0)return;if(o.length===1){const h=o[0];x.setCenter({lat:h.lat,lng:h.lng}),x.setZoom(12);return}const m=new google.maps.LatLngBounds;if(r&&o.length>0){const h=ra(o,r,oa);if(h.length>0)h.forEach(p=>{m.extend({lat:p.lat,lng:p.lng})}),m.extend(r);else{m.extend(r);const p=.1;m.extend({lat:r.lat+p,lng:r.lng+p}),m.extend({lat:r.lat-p,lng:r.lng-p})}}else o.forEach(h=>{m.extend({lat:h.lat,lng:h.lng})}),s&&m.extend(s.position);a&&o.length>0?Math.min(...o.map(p=>ks(a.lat,a.lng,p.lat,p.lng)))<=ca&&m.extend(a):a&&o.length===0&&m.extend(a),x.fitBounds(m,{top:100,right:100,bottom:100,left:100})},[x,t,n,s,a,r,l,c,i,g]),d.useEffect(()=>{var m;if(!x||!i||typeof google>"u"||!((m=google.maps)!=null&&m.LatLngBounds))return;const o=new google.maps.LatLngBounds;o.extend({lat:i.ne.lat,lng:i.ne.lng}),o.extend({lat:i.sw.lat,lng:i.sw.lng}),x.fitBounds(o,{top:80,right:80,bottom:80,left:80})},[x,i])}function ua({onBoundsChange:t,searchKey:n,onUserMovedMap:s}){const a=He(),r=d.useRef(!1);d.useEffect(()=>{if(!a||!t||typeof google>"u")return;let i=null;const l=()=>{r.current&&s(!0),i&&clearTimeout(i),i=setTimeout(()=>{const o=a.getBounds();if(o){const m=o.getNorthEast(),u=o.getSouthWest();t({ne:{lat:m.lat(),lng:m.lng()},sw:{lat:u.lat(),lng:u.lng()}}),r.current||(r.current=!0)}else t(null)},300)},g=setTimeout(()=>{const o=a.getBounds();if(o&&!r.current){const m=o.getNorthEast(),u=o.getSouthWest();t({ne:{lat:m.lat(),lng:m.lng()},sw:{lat:u.lat(),lng:u.lng()}}),r.current=!0}},500),x=google.maps.event.addListener(a,"bounds_changed",l);return()=>{x&&google.maps.event.removeListener(x),i&&clearTimeout(i),g&&clearTimeout(g)}},[a,t,s]),d.useEffect(()=>{r.current=!1,s(!1)},[n,s])}function ha(t){const n=He();d.useEffect(()=>{if(!n||!t.current)return;const s=()=>{if(!t.current)return;let o=document.getElementById("map-container-wrapper");if(!o){let p=t.current.parentElement;for(;p&&p!==document.body;){const f=window.getComputedStyle(p);if(f.height&&(f.height.includes("calc")||f.height.includes("vh"))){o=p;break}p=p.parentElement}}if(!o)return;const m=t.current;m.style.height="100%",m.style.minHeight="100%",m.style.maxHeight="100%",m.style.display="flex",m.style.flexDirection="column";const u=m.querySelectorAll("div");let h=!1;u.forEach(p=>{const f=p,b=f.getAttribute("style")||"";if(b.includes("z-index: 3")&&b.includes("position: absolute")){h=!0,f.style.height="100%",f.style.minHeight="100%",f.style.maxHeight="100%",f.style.width="100%",f.style.top="0px",f.style.left="0px",f.style.bottom="0px",f.style.right="0px",f.style.position="absolute",f.style.inset="0px",f.style.boxSizing="border-box";const S=f.querySelector("canvas");S&&(S.style.height="100%",S.style.width="100%")}}),h&&n&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(n){google.maps.event.trigger(n,"resize");const p=n.getDiv();if(p){const f=p.getBoundingClientRect(),b=m.getBoundingClientRect().height;b>0&&f.height<b*.9&&(p.style.height=`${b}px`,p.style.minHeight=`${b}px`,setTimeout(()=>{n&&google.maps.event.trigger(n,"resize")},50))}}})})},a=new ResizeObserver(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{n&&t.current&&(s(),setTimeout(()=>{n&&(google.maps.event.trigger(n,"resize"),setTimeout(()=>{s(),n&&google.maps.event.trigger(n,"resize")},100))},50))})})});a.observe(t.current);const r=document.getElementById("map-container-wrapper");r&&a.observe(r),t.current.parentElement&&a.observe(t.current.parentElement);const i=o=>{setTimeout(()=>{n&&t.current&&(s(),setTimeout(()=>{n&&(google.maps.event.trigger(n,"resize"),setTimeout(()=>{n&&google.maps.event.trigger(n,"resize")},100))},50))},o)};i(50),i(150),i(300),i(600),i(1e3),i(1500);const l=()=>{n&&t.current&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{s(),setTimeout(()=>{n&&(google.maps.event.trigger(n,"resize"),setTimeout(()=>{s()},100))},50)})})};window.addEventListener("resize",l);let c=window.devicePixelRatio;const x=setInterval(()=>{const o=window.devicePixelRatio;Math.abs(o-c)>.1&&(c=o,l())},500);if(n){const o=google.maps.event.addListener(n,"zoom_changed",()=>{setTimeout(()=>{s()},100)});n._zoomListener=o}return()=>{a.disconnect(),window.removeEventListener("resize",l),x&&clearInterval(x);const o=n;o!=null&&o._zoomListener&&google.maps.event.removeListener(o._zoomListener)}},[n,t])}const ma=({venue:t,position:n,isHighlighted:s,onHoverChange:a,onClick:r,formatPrice:i})=>{const l=d.useRef(null),c=d.useRef([]),g=t.listingKind==="service",x=o=>{if(l.current===o||(c.current.forEach(p=>{google.maps.event.removeListener(p)}),c.current=[],l.current=o,!o||typeof google>"u"))return;const m=()=>{r==null||r(t.id)},u=()=>{a==null||a(t.id)},h=()=>{a==null||a(null)};c.current.push(google.maps.event.addListener(o,"click",m),google.maps.event.addListener(o,"pointerenter",u),google.maps.event.addListener(o,"pointerleave",h))};return d.useEffect(()=>()=>{c.current.forEach(o=>{google.maps.event.removeListener(o)}),c.current=[]},[]),e.jsx(ps,{ref:x,position:n,zIndex:s?2e3:void 0,clickable:!0,className:"cursor-pointer",style:{cursor:"pointer"},children:e.jsx("div",{className:pe("rounded-full px-3 py-1 shadow-lg font-semibold text-sm border-2 transition-transform duration-150 transform cursor-pointer select-none pointer-events-none",s?pe("scale-110 text-white shadow-xl",g?"bg-[#6254f3] border-[#6254f3]":"bg-brand border-brand"):pe("scale-100 bg-white text-gray-900 hover:scale-110",g?"border-[#6254f3]":"border-primary")),"aria-label":`${t.name} marker`,children:i(t)})})},ga=({venue:t,position:n,map:s,onClose:a,searchKey:r})=>{const[i,l]=d.useState({bottom:16,left:16});return d.useEffect(()=>{if(!s||typeof google>"u")return;const c=new google.maps.OverlayView;c.onAdd=()=>{},c.onRemove=()=>{},c.draw=()=>{const m=c.getProjection();if(!m)return;const u=new google.maps.LatLng(n.lat,n.lng),h=m.fromLatLngToContainerPixel(u);if(!h)return;const p=s.getDiv();if(!p)return;const f=p.getBoundingClientRect(),b=280,S=240,M=12,L=30,y={};h.y+L+S+M>f.height?y.bottom=f.height-h.y+L+M:y.top=h.y+L+M,h.x+b+M>f.width?y.right=f.width-h.x+M:y.left=h.x+M,l(y)},c.setMap(s);const g=google.maps.event.addListener(s,"bounds_changed",()=>c.draw()),x=google.maps.event.addListener(s,"zoom_changed",()=>c.draw()),o=google.maps.event.addListener(s,"resize",()=>c.draw());return()=>{c.setMap(null),google.maps.event.removeListener(g),google.maps.event.removeListener(x),google.maps.event.removeListener(o)}},[n.lat,n.lng]),e.jsx("div",{className:"absolute z-50 w-[280px] max-w-[calc(100vw-2rem)]",style:{...i},children:e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:a,className:"absolute -top-2 -right-2 z-20 bg-white hover:bg-gray-50 rounded-full p-1.5 shadow-lg border border-gray-200 transition-colors","aria-label":"Close listing",children:e.jsx(De,{className:"w-3.5 h-3.5 text-gray-700"})}),e.jsx(Ct,{kind:"map",venue:t,searchQuery:r})]})})},xa=({onToggleFullscreen:t,isFullscreen:n})=>{const s=He(),a=()=>{if(s){const i=s.getZoom();i!==void 0&&s.setZoom(i+1)}},r=()=>{if(s){const i=s.getZoom();i!==void 0&&s.setZoom(i-1)}};return e.jsxs(e.Fragment,{children:[t&&e.jsx("button",{onClick:t,className:"absolute top-4 right-4 bg-white hover:bg-gray-50 rounded-lg p-2.5 shadow-lg border border-gray-200 transition-colors z-10",title:n?"Exit fullscreen":"Enter fullscreen",children:n?e.jsx("svg",{className:"w-5 h-5 text-gray-700",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}):e.jsx("svg",{className:"w-5 h-5 text-gray-700",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"})})}),e.jsxs("div",{className:"absolute right-4 flex flex-col gap-2 z-10",style:{bottom:`calc(env(safe-area-inset-bottom, 0px) + ${n?104:96}px)`},children:[e.jsx("button",{onClick:a,className:"bg-white hover:bg-gray-50 rounded-lg p-2.5 shadow-lg border border-gray-200 transition-colors",title:"Zoom in",children:e.jsx("svg",{className:"w-5 h-5 text-gray-700",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})}),e.jsx("button",{onClick:r,className:"bg-white hover:bg-gray-50 rounded-lg p-2.5 shadow-lg border border-gray-200 transition-colors",title:"Zoom out",children:e.jsx("svg",{className:"w-5 h-5 text-gray-700",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 12H4"})})})]})]})},fa=({loading:t,boundsLoading:n})=>e.jsxs(e.Fragment,{children:[t&&!n&&e.jsx("div",{className:"absolute inset-0 z-[5]",children:e.jsx("div",{className:"w-full h-full rounded-2xl bg-muted animate-pulse"})}),n&&e.jsxs("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 z-[6] bg-white rounded-full px-4 py-2 shadow-lg border border-gray-200 flex items-center gap-2",children:[e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"w-2 h-2 bg-gray-600 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),e.jsx("div",{className:"w-2 h-2 bg-gray-600 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),e.jsx("div",{className:"w-2 h-2 bg-gray-600 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]}),e.jsx(B,{className:"h-4 w-24"})]})]}),pa=({userLocation:t})=>e.jsx(ps,{position:t,children:e.jsxs("div",{className:"relative flex items-center justify-center",children:[e.jsx("span",{className:"absolute inline-flex h-6 w-6 rounded-full bg-blue-500/30 animate-ping"}),e.jsx("span",{className:"relative inline-flex h-3 w-3 rounded-full bg-blue-600 border-2 border-white shadow"})]})}),ba="AIzaSyATWdF6OVbFX1X_OuYCMZdxWZi7ggnhRWI",ya=t=>{switch((t||"per_hour").toLowerCase()){case"per_person":case"per-person":case"person":case"guest":return"/person";case"per_person_per_hour":case"person-hour":case"person_hour":return"/person/hr";case"per_event":case"per-event":case"event":case"flat":return"";case"per_day":case"per-day":case"day":return"/day";case"per_hour":case"per-hour":case"hour":case"hourly":default:return"/hr"}},va=({location:t,venues:n=[],markerVenues:s,focusBounds:a,mapOptions:r,isFullscreen:i=!1,onToggleFullscreen:l,searchKey:c,loading:g=!1,highlightedVenueId:x=null,selectedVenueId:o=null,onMarkerHoverChange:m,onMarkerClick:u,onBoundsChange:h,boundsLoading:p=!1,userLocationOverride:f=null,query:b})=>{const[S,M]=d.useState(!1),L=d.useRef(null),y=He(),j=s&&s.length>0?s:n,N=d.useMemo(()=>{if(!s||s.length===0)return n;const k=new Map;for(const F of n)k.set(F.id,F);for(const F of s)k.set(F.id,F);return Array.from(k.values())},[n,s]),T=ia(N,c),{center:P,zoom:A,locationMarker:X,userLocation:ee,queryLocationRef:q}=la({location:t,query:b,focusBounds:a,searchKey:c}),Q=f??ee;da({venues:n,resolvedVenuePositions:T,locationMarker:X,userLocation:Q,queryLocation:q.current,focusBounds:a,searchKey:c,onBoundsChange:h,userHasMovedMap:S}),ua({onBoundsChange:h,searchKey:c,onUserMovedMap:M}),ha(L),d.useEffect(()=>{a||y&&P&&n.length===0&&y.panTo(P)},[y,P,n.length,a]);const te=k=>k.baseRate!==void 0&&k.baseRate>0?`$${Math.round(k.baseRate).toLocaleString()}${ya(k.priceUnit)}`:k.name;return e.jsxs("div",{ref:L,className:"relative w-full h-full",style:{height:"100%",minHeight:"100%",maxHeight:"100%",position:"relative",overflow:"hidden"},children:[e.jsxs(Ln,{mapId:"DEMO_MAP_ID",defaultCenter:P,defaultZoom:A,gestureHandling:(r==null?void 0:r.gestureHandling)||"greedy",disableDefaultUI:(r==null?void 0:r.disableDefaultUI)??!0,zoomControl:(r==null?void 0:r.zoomControl)??!1,streetViewControl:(r==null?void 0:r.streetViewControl)??!1,mapTypeControl:(r==null?void 0:r.mapTypeControl)??!1,fullscreenControl:(r==null?void 0:r.fullscreenControl)??!1,clickableIcons:(r==null?void 0:r.clickableIcons)??!0,draggableCursor:r==null?void 0:r.draggableCursor,draggingCursor:r==null?void 0:r.draggingCursor,mapTypeId:"roadmap",onClick:()=>{o&&(u==null||u(null))},children:[e.jsx(fa,{loading:g,boundsLoading:p}),j.map(k=>{const F=T[k.id];if(!F)return null;const v=o===k.id||x===k.id;return e.jsx(ma,{venue:k,position:{lat:F.lat,lng:F.lng},isHighlighted:v,onHoverChange:m,onClick:u,formatPrice:te},k.id)}),Q&&e.jsx(pa,{userLocation:Q})]}),o&&typeof window<"u"&&window.innerWidth>=768&&(()=>{const k=N.find(v=>v.id===o);if(!k)return null;const F=T[k.id];return F?e.jsx(ga,{venue:k,position:{lat:F.lat,lng:F.lng},map:y,onClose:()=>u==null?void 0:u(null),searchKey:c}):null})(),e.jsx(xa,{onToggleFullscreen:l,isFullscreen:i})]})},lt=t=>e.jsx("div",{style:{position:"relative",isolation:"isolate",height:"100%",minHeight:"100%"},className:"w-full h-full",children:e.jsx(bs,{apiKey:ba,children:e.jsx(va,{...t})})}),wa=({href:t,images:n})=>{const s=n.filter(Boolean).slice(0,3);return e.jsx(ae,{to:t,className:"block h-full",children:e.jsxs("div",{className:"rounded-2xl bg-gray-50 h-full flex flex-col items-center justify-center gap-5 p-6 min-h-[220px] hover:bg-gray-100 transition-colors",children:[e.jsxs("div",{className:"relative h-28 w-28 flex-shrink-0",children:[s[2]&&e.jsx("img",{src:s[2],alt:"",className:"absolute top-4 right-0 h-20 w-20 rounded-xl object-cover shadow-sm rotate-[7deg]"}),s[1]&&e.jsx("img",{src:s[1],alt:"",className:"absolute top-2 left-2 h-20 w-20 rounded-xl object-cover shadow-sm -rotate-[3deg]"}),s[0]&&e.jsx("img",{src:s[0],alt:"",className:"absolute inset-0 h-20 w-20 rounded-xl object-cover shadow-md"})]}),e.jsx("span",{className:"text-sm font-semibold text-gray-900",children:"See all"})]})})},qt=({venues:t,heading:n,subtitle:s,searchQuery:a,viewAllHref:r})=>{const i=d.useRef(null),[l,c]=d.useState(!1),[g,x]=d.useState(!1),[o,m]=d.useState(2),u=12,h=o*2,p=d.useMemo(()=>t.slice(0,h),[t,h]),f=d.useCallback(()=>{const y=i.current;if(!y)return;const j=y.clientWidth;let N=2;j>=1400?N=6:j>=1200?N=5:j>=700?N=4:j>=480&&(N=3),m(N)},[]),b=d.useCallback(()=>{const y=i.current;if(!y)return;const{scrollLeft:j,scrollWidth:N,clientWidth:T}=y;c(j>4),x(j+T<N-4)},[]);d.useEffect(()=>{const y=i.current;if(!y)return;const j=()=>{f(),b()};return f(),b(),y.addEventListener("scroll",b,{passive:!0}),window.addEventListener("resize",j),()=>{y.removeEventListener("scroll",b),window.removeEventListener("resize",j)}},[f,b]),d.useEffect(()=>{const y=i.current;if(!y)return;const j=y.querySelector("a");if(!j)return;const N=parseFloat(getComputedStyle(y).columnGap||`${u}`),T=j.getBoundingClientRect().width+N,P=y.scrollWidth-y.clientWidth,A=Math.min(Math.round(y.scrollLeft/T)*T,P);y.scrollTo({left:A,behavior:"auto"}),b()},[o,b]);const S=d.useCallback(y=>{const j=i.current;if(!j)return;const N=j.querySelector("a");if(!N)return;const T=parseFloat(getComputedStyle(j).columnGap||`${u}`),P=N.getBoundingClientRect().width+T,A=j.scrollWidth-j.clientWidth,X=y==="left"?Math.max(0,j.scrollLeft-P):Math.min(A,j.scrollLeft+P);j.scrollTo({left:X,behavior:"smooth"})},[]),M=d.useMemo(()=>o<=1?"100%":`calc((100% - ${(o-1)*u}px) / ${o})`,[o]),L=d.useMemo(()=>t.map(y=>y.main_image??"").filter(Boolean),[t]);return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[r?e.jsxs(ae,{to:r,className:"group inline-flex items-center gap-1.5 hover:underline underline-offset-2",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:n}),e.jsx(Hn,{className:"h-4 w-4 text-gray-900 transition-transform group-hover:translate-x-0.5"})]}):e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:n}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:s})]}),e.jsxs("div",{className:"hidden lg:flex items-center gap-2 flex-shrink-0 mt-0.5",children:[e.jsx("button",{type:"button",onClick:()=>S("left"),disabled:!l,"aria-label":"Scroll left",className:"h-9 w-9 rounded-full border border-gray-200 bg-white flex items-center justify-center text-gray-700 shadow-sm transition hover:shadow-md disabled:opacity-30 disabled:cursor-not-allowed",children:e.jsx(xs,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>S("right"),disabled:!g,"aria-label":"Scroll right",className:"h-9 w-9 rounded-full border border-gray-200 bg-white flex items-center justify-center text-gray-700 shadow-sm transition hover:shadow-md disabled:opacity-30 disabled:cursor-not-allowed",children:e.jsx(Ut,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"relative",children:[e.jsxs("div",{ref:i,className:"grid grid-flow-col gap-3 overflow-x-auto pb-3 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:{gridAutoColumns:M},children:[p.map(y=>e.jsx(Ct,{kind:"venue",venue:y,className:"h-full",searchQuery:a,hideOverlays:!0},y.id)),r&&L.length>=2&&e.jsx(wa,{href:r,images:L})]}),!l&&g&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 w-12 bg-gradient-to-l from-white/50 via-white/40 to-transparent transition-opacity duration-200 flex items-center justify-end pr-2",children:e.jsxs("div",{className:"pointer-events-none absolute right-0 top-1/2 -translate-y-[55%] flex h-8 items-center gap-0.5 rounded-full bg-white px-3 text-[12px] font-semibold text-gray-900 shadow-lg leading-none lg:hidden",children:[e.jsx("span",{className:"leading-[1]",children:"Swipe"}),e.jsx(Ut,{className:"h-4 w-4 text-gray-900"})]})}),l&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 w-10 bg-gradient-to-r from-white/50 via-white/40 to-transparent"}),e.jsx("div",{className:"sr-only","aria-live":"polite",children:g?"More venues available. Swipe horizontally to view.":"End of venues in this section."})]})]})},ja=[{kind:"city",label:"Austin, TX",city:"Austin",state:"TX",lat:30.2672,lng:-97.7431,radiusMiles:15,aliases:["atx"]},{kind:"city",label:"Dallas, TX",city:"Dallas",state:"TX",lat:32.7767,lng:-96.797,radiusMiles:18,aliases:["dfw"]},{kind:"city",label:"Houston, TX",city:"Houston",state:"TX",lat:29.7604,lng:-95.3698,radiusMiles:20,aliases:["h-town"]},{kind:"city",label:"Philadelphia, PA",city:"Philadelphia",state:"PA",lat:39.9526,lng:-75.1652,radiusMiles:15,aliases:["philly"]},{kind:"city",label:"New York, NY",city:"New York",state:"NY",lat:40.7128,lng:-74.006,radiusMiles:18,aliases:["nyc","new york city"]},{kind:"city",label:"Los Angeles, CA",city:"Los Angeles",state:"CA",lat:34.0522,lng:-118.2437,radiusMiles:22,aliases:["la","l.a."]},{kind:"city",label:"Chicago, IL",city:"Chicago",state:"IL",lat:41.8781,lng:-87.6298,radiusMiles:16},{kind:"city",label:"Miami, FL",city:"Miami",state:"FL",lat:25.7617,lng:-80.1918,radiusMiles:14},{kind:"city",label:"Atlanta, GA",city:"Atlanta",state:"GA",lat:33.749,lng:-84.388,radiusMiles:16},{kind:"city",label:"San Francisco, CA",city:"San Francisco",state:"CA",lat:37.7749,lng:-122.4194,radiusMiles:12,aliases:["sf"]},{kind:"city",label:"Seattle, WA",city:"Seattle",state:"WA",lat:47.6062,lng:-122.3321,radiusMiles:14},{kind:"city",label:"Denver, CO",city:"Denver",state:"CO",lat:39.7392,lng:-104.9903,radiusMiles:15},{kind:"city",label:"Boston, MA",city:"Boston",state:"MA",lat:42.3601,lng:-71.0589,radiusMiles:13},{kind:"city",label:"Washington, DC",city:"Washington",state:"DC",lat:38.9072,lng:-77.0369,radiusMiles:13,aliases:["dc","washington dc"]},{kind:"city",label:"Nashville, TN",city:"Nashville",state:"TN",lat:36.1627,lng:-86.7816,radiusMiles:15},{kind:"city",label:"Phoenix, AZ",city:"Phoenix",state:"AZ",lat:33.4484,lng:-112.074,radiusMiles:20},{kind:"city",label:"San Diego, CA",city:"San Diego",state:"CA",lat:32.7157,lng:-117.1611,radiusMiles:15},{kind:"city",label:"Las Vegas, NV",city:"Las Vegas",state:"NV",lat:36.1699,lng:-115.1398,radiusMiles:14,aliases:["vegas"]},{kind:"city",label:"New Orleans, LA",city:"New Orleans",state:"LA",lat:29.9511,lng:-90.0715,radiusMiles:12,aliases:["nola"]},{kind:"city",label:"Portland, OR",city:"Portland",state:"OR",lat:45.5152,lng:-122.6784,radiusMiles:14},{kind:"city",label:"Minneapolis, MN",city:"Minneapolis",state:"MN",lat:44.9778,lng:-93.265,radiusMiles:14},{kind:"city",label:"Charlotte, NC",city:"Charlotte",state:"NC",lat:35.2271,lng:-80.8431,radiusMiles:15},{kind:"city",label:"Orlando, FL",city:"Orlando",state:"FL",lat:28.5383,lng:-81.3792,radiusMiles:16},{kind:"city",label:"Tampa, FL",city:"Tampa",state:"FL",lat:27.9506,lng:-82.4572,radiusMiles:15},{kind:"city",label:"San Antonio, TX",city:"San Antonio",state:"TX",lat:29.4241,lng:-98.4936,radiusMiles:16},{kind:"city",label:"Fort Worth, TX",city:"Fort Worth",state:"TX",lat:32.7555,lng:-97.3308,radiusMiles:15},{kind:"city",label:"Pittsburgh, PA",city:"Pittsburgh",state:"PA",lat:40.4406,lng:-79.9959,radiusMiles:13},{kind:"city",label:"Baltimore, MD",city:"Baltimore",state:"MD",lat:39.2904,lng:-76.6122,radiusMiles:13},{kind:"city",label:"Detroit, MI",city:"Detroit",state:"MI",lat:42.3314,lng:-83.0458,radiusMiles:15},{kind:"city",label:"Scottsdale, AZ",city:"Scottsdale",state:"AZ",lat:33.4942,lng:-111.9261,radiusMiles:10},{kind:"neighborhood",label:"Downtown Austin, TX",city:"Austin",state:"TX",lat:30.2711,lng:-97.7437,radiusMiles:4,aliases:["downtown austin"]},{kind:"neighborhood",label:"East Austin, TX",city:"Austin",state:"TX",lat:30.2638,lng:-97.7139,radiusMiles:4},{kind:"neighborhood",label:"South Congress, Austin, TX",city:"Austin",state:"TX",lat:30.2503,lng:-97.7497,radiusMiles:3,aliases:["soco"]},{kind:"neighborhood",label:"Rainey Street, Austin, TX",city:"Austin",state:"TX",lat:30.2586,lng:-97.7386,radiusMiles:2},{kind:"neighborhood",label:"The Domain, Austin, TX",city:"Austin",state:"TX",lat:30.401,lng:-97.726,radiusMiles:4,aliases:["domain austin"]},{kind:"neighborhood",label:"Deep Ellum, Dallas, TX",city:"Dallas",state:"TX",lat:32.784,lng:-96.7836,radiusMiles:3},{kind:"neighborhood",label:"Uptown Dallas, TX",city:"Dallas",state:"TX",lat:32.8038,lng:-96.8018,radiusMiles:3},{kind:"neighborhood",label:"Bishop Arts District, Dallas, TX",city:"Dallas",state:"TX",lat:32.7474,lng:-96.8272,radiusMiles:3,aliases:["bishop arts"]},{kind:"neighborhood",label:"Design District, Dallas, TX",city:"Dallas",state:"TX",lat:32.7975,lng:-96.8263,radiusMiles:3},{kind:"neighborhood",label:"Montrose, Houston, TX",city:"Houston",state:"TX",lat:29.7422,lng:-95.3911,radiusMiles:4},{kind:"neighborhood",label:"The Heights, Houston, TX",city:"Houston",state:"TX",lat:29.797,lng:-95.3985,radiusMiles:4,aliases:["houston heights"]},{kind:"neighborhood",label:"Midtown Houston, TX",city:"Houston",state:"TX",lat:29.7426,lng:-95.3762,radiusMiles:3},{kind:"neighborhood",label:"EaDo, Houston, TX",city:"Houston",state:"TX",lat:29.7473,lng:-95.3486,radiusMiles:3,aliases:["east downtown houston"]},{kind:"neighborhood",label:"Center City, Philadelphia, PA",city:"Philadelphia",state:"PA",lat:39.9527,lng:-75.1652,radiusMiles:4},{kind:"neighborhood",label:"Fishtown, Philadelphia, PA",city:"Philadelphia",state:"PA",lat:39.9696,lng:-75.1349,radiusMiles:3},{kind:"neighborhood",label:"Northern Liberties, Philadelphia, PA",city:"Philadelphia",state:"PA",lat:39.966,lng:-75.1419,radiusMiles:3,aliases:["nolibs"]},{kind:"neighborhood",label:"Old City, Philadelphia, PA",city:"Philadelphia",state:"PA",lat:39.9507,lng:-75.1449,radiusMiles:3},{kind:"neighborhood",label:"University City, Philadelphia, PA",city:"Philadelphia",state:"PA",lat:39.9539,lng:-75.193,radiusMiles:3},{kind:"neighborhood",label:"Williamsburg, Brooklyn, NY",city:"New York",state:"NY",lat:40.7081,lng:-73.9571,radiusMiles:3},{kind:"neighborhood",label:"SoHo, New York, NY",city:"New York",state:"NY",lat:40.7233,lng:-74.003,radiusMiles:2},{kind:"neighborhood",label:"Lower East Side, New York, NY",city:"New York",state:"NY",lat:40.715,lng:-73.9843,radiusMiles:3,aliases:["les"]},{kind:"neighborhood",label:"Bushwick, Brooklyn, NY",city:"New York",state:"NY",lat:40.6958,lng:-73.9171,radiusMiles:3},{kind:"neighborhood",label:"Hollywood, Los Angeles, CA",city:"Los Angeles",state:"CA",lat:34.0928,lng:-118.3287,radiusMiles:4},{kind:"neighborhood",label:"Downtown Los Angeles, CA",city:"Los Angeles",state:"CA",lat:34.0407,lng:-118.2468,radiusMiles:4,aliases:["dtla"]},{kind:"neighborhood",label:"Santa Monica, CA",city:"Los Angeles",state:"CA",lat:34.0195,lng:-118.4912,radiusMiles:4},{kind:"neighborhood",label:"Venice, Los Angeles, CA",city:"Los Angeles",state:"CA",lat:33.985,lng:-118.4695,radiusMiles:4},{kind:"neighborhood",label:"West Loop, Chicago, IL",city:"Chicago",state:"IL",lat:41.8848,lng:-87.647,radiusMiles:3},{kind:"neighborhood",label:"River North, Chicago, IL",city:"Chicago",state:"IL",lat:41.8924,lng:-87.6341,radiusMiles:3},{kind:"neighborhood",label:"Wicker Park, Chicago, IL",city:"Chicago",state:"IL",lat:41.9088,lng:-87.6796,radiusMiles:3},{kind:"neighborhood",label:"Wynwood, Miami, FL",city:"Miami",state:"FL",lat:25.801,lng:-80.1995,radiusMiles:3},{kind:"neighborhood",label:"Brickell, Miami, FL",city:"Miami",state:"FL",lat:25.7602,lng:-80.1959,radiusMiles:3},{kind:"neighborhood",label:"South Beach, Miami Beach, FL",city:"Miami",state:"FL",lat:25.7826,lng:-80.1341,radiusMiles:4},{kind:"neighborhood",label:"Midtown Atlanta, GA",city:"Atlanta",state:"GA",lat:33.7833,lng:-84.3831,radiusMiles:4},{kind:"neighborhood",label:"Buckhead, Atlanta, GA",city:"Atlanta",state:"GA",lat:33.8395,lng:-84.379,radiusMiles:4},{kind:"neighborhood",label:"The Mission, San Francisco, CA",city:"San Francisco",state:"CA",lat:37.7599,lng:-122.4148,radiusMiles:3,aliases:["mission district"]},{kind:"neighborhood",label:"SoMa, San Francisco, CA",city:"San Francisco",state:"CA",lat:37.7785,lng:-122.4056,radiusMiles:3},{kind:"neighborhood",label:"Capitol Hill, Seattle, WA",city:"Seattle",state:"WA",lat:47.6253,lng:-122.3222,radiusMiles:3},{kind:"neighborhood",label:"RiNo, Denver, CO",city:"Denver",state:"CO",lat:39.7692,lng:-104.9787,radiusMiles:3,aliases:["river north denver"]},{kind:"neighborhood",label:"Back Bay, Boston, MA",city:"Boston",state:"MA",lat:42.3503,lng:-71.081,radiusMiles:3},{kind:"neighborhood",label:"The Gulch, Nashville, TN",city:"Nashville",state:"TN",lat:36.1515,lng:-86.7835,radiusMiles:3}],Qt=t=>t.toLowerCase().replace(/[^a-z0-9]+/g," ").trim(),Na=(t,n)=>{const s=Qt(n);if(s.length<2)return 0;const a=[t.label,t.city,t.state,...t.aliases??[]].map(Qt);let r=0;for(const c of a)c&&(c===s&&(r=Math.max(r,120)),c.startsWith(s)&&(r=Math.max(r,90)),c.includes(s)&&(r=Math.max(r,60)));const i=s.split(/\s+/).filter(Boolean),l=i.filter(c=>a.some(g=>g.split(/\s+/).some(x=>x.startsWith(c)))).length;return l===i.length&&(r=Math.max(r,50+l*8)),r>0&&t.kind==="city"&&(r+=6),r};function Sa(t,n=6){return ja.map(s=>({score:Na(s,t),seed:s})).filter(({score:s})=>s>0).sort((s,a)=>a.score-s.score||s.seed.label.localeCompare(a.seed.label)).slice(0,n).map(({seed:s})=>({text:s.label,city:`${s.city}, ${s.state}`,coordinates:{lat:s.lat,lng:s.lng,lon:s.lng},locationRadiusMiles:s.radiusMiles,locationSuggestionType:s.kind}))}const Ma=10;function ka(t,n){const s=new Set;return[...t,...n].filter(a=>{const r=[a.locationSuggestionType??a.listingKind??"listing",a.listingId??a.text].join(":").toLowerCase();return s.has(r)?!1:(s.add(r),!0)}).slice(0,Ma)}function Ca({query:t,enabled:n=!0,debounceMs:s=300,minQueryLength:a=2,location:r=null,showLocationPrompt:i=!1}){const[l,c]=d.useState([]),[g,x]=d.useState(!1),[o,m]=d.useState(null),u=d.useRef(null),h=d.useRef(null),p=d.useCallback(async b=>{var L,y,j;if(h.current&&h.current.abort(),h.current=new AbortController,!n||!b||b.trim().length<a){c([]),x(!1);return}const S=r&&typeof r.lat=="number"&&typeof r.lng=="number"?r:null;x(!0),m(null);const M=Sa(b,5);try{const N=await An(b,S,{signal:h.current.signal});if((L=h.current)!=null&&L.signal.aborted)return;let T=ka(M,(N==null?void 0:N.suggestions)||[]);i&&!S&&(T.length>0||b.trim().length<=2)&&(T=[{text:"Turn on your location for better results",isLocationPrompt:!0},...T]),c(T)}catch(N){if(N instanceof Error&&N.name==="AbortError"||(y=h.current)!=null&&y.signal.aborted)return;const T=N instanceof Error?N:new Error("Failed to fetch suggestions");console.error("[useAutocomplete] Error fetching suggestions:",T),m(T),c(M)}finally{(j=h.current)!=null&&j.signal.aborted||x(!1)}},[n,a,r,i]);d.useEffect(()=>(u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{p(t)},s),()=>{u.current&&clearTimeout(u.current),h.current&&h.current.abort()}),[t,s,p]);const f=d.useCallback(()=>{c([]),m(null),u.current&&clearTimeout(u.current),h.current&&h.current.abort()},[]);return{suggestions:l,isLoading:g,error:o,clearSuggestions:f}}const La=({isOpen:t,onClose:n,mobileQuery:s,onQueryChange:a,locationInput:r,onLocationInputChange:i,whenValue:l,onWhenChange:c,guestsValue:g,onGuestsDelta:x,onSearch:o,onClearAll:m,onSuggestionSelect:u,categories:h,suggestedLocations:p,buildCategoryUrl:f,isHomePage:b=!1,onAutocompleteSuggestionSelect:S})=>{const[y,j]=d.useState(null),[N,T]=d.useState(!1);os(),ct();const{location:P,shouldShowPrompt:A,isRequesting:X,requestLocation:ee}=En();Ca({query:s,enabled:b&&N&&y==="query",debounceMs:300,minQueryLength:2,location:P,showLocationPrompt:A});const q=d.useMemo(()=>{if(!l)return null;try{const[v,R,H]=l.split("-").map(Number);if(!isNaN(v)&&!isNaN(R)&&!isNaN(H))return new Date(v,R-1,H)}catch{}return null},[l]),Q=d.useMemo(()=>{if(!l)return"";try{const[v,R,H]=l.split("-").map(Number);if(!isNaN(v)&&!isNaN(R)&&!isNaN(H)){const O=new Date(v,R-1,H);return fs(O,"MMM d, yyyy")}}catch{}return l},[l]),te=Number.parseInt(g||"0",10),k=Number.isNaN(te)?0:$t(te,0,1e3),F=d.useCallback(v=>{if(!v){c("");return}const R=v.getFullYear(),H=String(v.getMonth()+1).padStart(2,"0"),O=String(v.getDate()).padStart(2,"0");c(`${R}-${H}-${O}`)},[c]);return t?e.jsxs("div",{className:"fixed inset-0 z-[120] flex flex-col bg-white",children:[e.jsxs("div",{className:"flex-shrink-0 bg-white border-b border-gray-200",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-100",children:e.jsx("div",{className:"flex items-center justify-between gap-1.5 text-[13px] font-semibold text-gray-900",children:h.map(v=>e.jsx(ae,{to:f(v.id),className:"flex-1 rounded-lg px-1.5 py-2 text-center transition-colors hover:bg-gray-50 active:bg-gray-100",children:e.jsxs("span",{className:"inline-flex flex-col items-center justify-center gap-1 truncate leading-tight",children:[e.jsx("img",{src:v.icon,alt:"","aria-hidden":"true",className:"h-7 w-7 flex-shrink-0 object-contain"}),e.jsx("span",{className:"text-[11px]",children:v.shortLabel})]})},v.id))})}),e.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[e.jsx("button",{type:"button",className:"rounded-full border border-gray-200 p-2 text-gray-600 hover:bg-gray-100",onClick:n,"aria-label":"Close search",children:e.jsx(De,{className:"h-4 w-4"})}),e.jsx("h2",{className:"text-base font-semibold text-gray-900",children:"Where?"}),e.jsx("div",{className:"w-[90px]"})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto overflow-x-hidden pb-28",children:e.jsxs("div",{className:"px-4 pt-4 space-y-3",children:[b&&e.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white shadow-sm",children:[e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between px-4 py-3",onClick:()=>j(v=>v==="query"?null:"query"),children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(xe,{className:"h-5 w-5 text-gray-500"}),e.jsx("span",{className:"text-sm font-semibold text-gray-900",children:"What"})]}),e.jsx("span",{className:"text-sm text-gray-500 truncate",children:s||"Add a search term"})]}),y==="query"&&e.jsxs("div",{className:"px-4 pb-4",children:[e.jsxs("div",{className:"flex items-center gap-3 rounded-xl border border-gray-200 px-3 py-3",children:[e.jsx(xe,{className:"h-4 w-4 text-gray-500"}),e.jsx("input",{value:s,onChange:v=>a(v.target.value),placeholder:"Search by venue name or type",className:"flex-1 bg-transparent text-base text-gray-900 outline-none"})]}),e.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Search for specific venues by name or browse by venue type"})]})]}),e.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white shadow-sm",children:[e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between px-4 py-3",onClick:()=>j(v=>v==="where"?null:"where"),children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(xe,{className:"h-5 w-5 text-gray-500"}),e.jsx("span",{className:"text-sm font-semibold text-gray-900",children:"Where?"})]}),e.jsx("span",{className:"text-sm text-gray-500 truncate",children:r||"Add a location"})]}),y==="where"&&e.jsxs("div",{className:"px-4 pb-4 space-y-3",children:[e.jsx(bs,{apiKey:"AIzaSyATWdF6OVbFX1X_OuYCMZdxWZi7ggnhRWI",children:e.jsx(Fn,{value:r,onChange:v=>i(v),onSelect:(v,R)=>{const H=R?`${v}, ${R}`:v;i(H)},placeholder:"Search by city or landmark",className:"w-full",persistOnScroll:!0,inOverlay:!0})}),e.jsxs("button",{type:"button",onClick:async()=>{ee(),setTimeout(()=>{var v;if(P){const R=window.google;(v=R==null?void 0:R.maps)!=null&&v.Geocoder&&new R.maps.Geocoder().geocode({location:{lat:P.lat,lng:P.lng}},(O,oe)=>{if(oe==="OK"&&(O!=null&&O[0])){const se=O[0].address_components,I=se.find(_=>_.types.includes("locality")),$=se.find(_=>_.types.includes("administrative_area_level_1"));if(I&&$){const _=`${I.long_name}, ${$.short_name}`;i(_)}}})}},1e3)},disabled:X,className:"flex w-full items-center justify-center gap-2 rounded-xl border border-gray-300 bg-white px-4 py-3 text-sm font-semibold text-gray-700 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[e.jsx(pt,{className:"h-4 w-4"}),e.jsx("span",{children:X?"Getting location...":"Use my location"})]}),!r&&p&&p.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs font-semibold text-gray-700",children:"Suggested destinations"}),e.jsx("div",{className:"rounded-2xl border border-gray-100 bg-gray-50/60",children:e.jsx("ul",{className:"divide-y divide-gray-100",children:p.map(v=>e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:()=>u(v.label),className:"flex w-full items-center gap-3 px-4 py-3 text-left hover:bg-white",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-white shadow-sm border border-gray-100",children:e.jsx(xe,{className:"h-5 w-5 text-[hsl(var(--brand))]"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold text-gray-900 truncate",children:v.label}),e.jsx("p",{className:"text-xs text-gray-600 truncate",children:v.subtitle})]})]})},v.id))})})]}),!b&&e.jsxs("div",{className:"pt-2 border-t border-gray-100",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Optional: refine by keyword"}),e.jsx("input",{type:"text",value:s,onChange:v=>a(v.target.value),placeholder:"e.g. rooftop, pool, outdoor",className:"w-full rounded-lg border border-gray-200 bg-muted/30 px-3 py-2 text-sm text-gray-900 placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-brand/20 focus:border-brand"}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-1",children:"Results match this keyword in the location you chose above."})]})]})]}),e.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white shadow-sm",children:[e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between px-4 py-3",onClick:()=>j(v=>v==="when"?null:"when"),children:[e.jsx("span",{className:"text-sm font-semibold text-gray-900",children:"When"}),e.jsx("span",{className:"text-sm text-gray-500",children:Q||"Add dates"})]}),y==="when"&&e.jsx("div",{className:"px-4 pb-4",children:e.jsx(In,{value:q,onChange:F,placeholder:"Select dates",className:"w-full"})})]}),e.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white shadow-sm",children:[e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between px-4 py-3",onClick:()=>j(v=>v==="who"?null:"who"),children:[e.jsx("span",{className:"text-sm font-semibold text-gray-900",children:"Who"}),e.jsx("span",{className:"text-sm text-gray-500",children:g?`${g} guest${g==="1"?"":"s"}`:"Add guests"})]}),y==="who"&&e.jsx("div",{className:"px-4 pb-4",children:e.jsx(_n,{onDecrement:()=>x(-1),onIncrement:()=>x(1),decrementAriaLabel:"Decrease guests",incrementAriaLabel:"Increase guests",decrementDisabled:k<=0,incrementDisabled:k>=1e3,className:"rounded-xl border border-gray-200 bg-white px-4 py-3 shadow-sm",buttonClassName:"rounded-full border border-gray-200 p-2 text-gray-600 hover:bg-gray-100",iconClassName:"h-4 w-4",valueControl:e.jsx("input",{type:"number",min:0,max:1e3,value:g||String(0),onChange:v=>{const R=parseInt(v.target.value,10);if(!Number.isNaN(R)){const H=$t(R,0,1e3);x(H-k)}},className:"flex-1 text-center text-base sm:text-sm font-semibold text-gray-900 bg-transparent border-0 focus:outline-none focus:ring-0 p-0 invalid:text-red-600",placeholder:"0","aria-label":"Guests count"})})})]})]})}),e.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-50 border-t border-gray-200 bg-white px-4 py-3",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("button",{type:"button",onClick:m,className:"text-sm font-semibold text-gray-900 hover:underline",children:"Clear all"}),e.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-2 rounded-full bg-[hsl(var(--brand))] px-5 py-3 text-sm font-semibold text-white shadow-md hover:bg-[hsl(var(--brand))]/90",children:[e.jsx(xe,{className:"h-4 w-4"}),e.jsx("span",{children:"Search"})]})]})})]}):null},Aa=({mobileQuery:t,location:n,date:s,guests:a,onOpenSearch:r,onOpenFilters:i,onBack:l})=>{const c=d.useRef(null),[g,x]=d.useState(!1);d.useEffect(()=>{let u=window.scrollY,h=null,p=!1;const f=()=>{p||(h=requestAnimationFrame(()=>{const b=window.scrollY;b>10&&b>u?x(!0):b<10&&x(!1),u=b,p=!1}),p=!0)};return window.addEventListener("scroll",f,{passive:!0}),()=>{window.removeEventListener("scroll",f),h!==null&&cancelAnimationFrame(h)}},[]);const{displayQuery:o,subtitle:m}=d.useMemo(()=>{const u=s,h=a,p=t||n||"",f=[];if(u)try{let b;if(u.includes("T"))b=Dn(u);else{const[S,M,L]=u.split("-").map(Number);b=new Date(S,M-1,L)}f.push(fs(b,"MMM d, yyyy"))}catch{}if(h){const b=parseInt(h,10);!isNaN(b)&&b>0&&f.push(`${b} ${b===1?"guest":"guests"}`)}return{displayQuery:n?`Venues in ${n}`:p,subtitle:f.length>0?f.join(" • "):void 0}},[t,n,s,a]);return e.jsx("div",{ref:c,className:"md:hidden sticky top-0 z-40 bg-white border-b border-gray-200 shadow-sm",children:e.jsxs("div",{className:pe("flex items-center justify-between gap-3 px-4 transition-[padding] duration-200",g?"py-2":"py-3"),children:[e.jsx("button",{type:"button",onClick:l,className:"rounded-full border border-gray-200 bg-white p-2 text-gray-700 shadow-sm hover:bg-gray-50 flex-shrink-0","aria-label":"Go back",children:e.jsx(gn,{className:"h-5 w-5"})}),e.jsxs("button",{type:"button",onClick:r,className:"flex-1 relative flex items-center rounded-full border border-gray-200 bg-gray-100 px-4 py-3 shadow-inner transition-colors hover:bg-gray-200 min-w-0","aria-label":"Open search",children:[e.jsx(xe,{className:"h-4 w-4 text-gray-500 flex-shrink-0"}),e.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center",children:o?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:pe("text-sm font-semibold truncate w-full px-8",o?"text-gray-900":"text-gray-500"),children:o}),m&&e.jsx("div",{className:"text-xs text-gray-500 truncate mt-0.5 w-full px-8",children:m})]}):e.jsx("span",{className:"text-sm text-gray-500 w-full px-8",children:"Start your search"})})]}),e.jsx("button",{type:"button",onClick:i,className:"rounded-full border border-gray-200 bg-white p-2 text-gray-700 shadow-sm hover:bg-gray-50 flex-shrink-0","aria-label":"Open filters",children:e.jsx(xn,{className:"h-5 w-5"})})]})})},Ea=({sections:t,additionalVenues:n,serializedSearchParams:s})=>e.jsx("div",{className:"container mx-auto px-4 py-8 space-y-8",children:e.jsxs("div",{className:"space-y-6",children:[t.filter(a=>a.venues.length>0).map(a=>e.jsx(qt,{venues:a.venues,heading:a.heading,subtitle:a.subtitle,viewAllHref:a.viewAllHref,searchQuery:s},a.id)),n.length>0&&e.jsx(qt,{venues:n,heading:"More destinations",subtitle:"Additional venues outside of our spotlight cities.",searchQuery:s})]})}),Pa=({count:t=8})=>{const n=Array.from({length:t});return e.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3 [grid-auto-rows:1fr]",children:n.map((s,a)=>e.jsx("div",{className:"transition-shadow duration-150",children:e.jsxs("div",{className:"group flex flex-col rounded-2xl border-2 border-gray-200 bg-white transition-all duration-200 overflow-hidden h-full",children:[e.jsx(B,{className:"aspect-[5/4] w-full rounded-t-2xl"}),e.jsxs("div",{className:"flex flex-col gap-0.5 pt-2 px-3 pb-3 bg-white rounded-b-2xl",children:[e.jsx(B,{className:"h-4 w-3/4"}),e.jsx(B,{className:"h-3 w-2/3 mt-0.5"}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[e.jsx(B,{className:"h-3 w-20"}),e.jsx(B,{className:"h-3 w-1"}),e.jsx(B,{className:"h-3 w-16"}),e.jsx(B,{className:"h-3 w-1"}),e.jsx(B,{className:"h-3 w-12"})]})]})]})},a))})},Cs=({showResultsHeader:t=!1})=>e.jsxs("div",{className:"flex-1 pr-2",children:[t&&e.jsx("div",{className:"mb-4 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx(B,{className:"h-6 w-64"})," ",e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(B,{className:"h-4 w-16 hidden sm:block"})," ",e.jsx(B,{className:"h-9 w-[160px] sm:w-[180px] rounded-md"})," "]})]})}),e.jsx(Pa,{count:6})]});function Ta({onLoadMore:t,hasMore:n,isLoading:s,root:a,rootMargin:r="600px"}){const i=d.useRef(null),l=d.useRef(t);return l.current=t,d.useEffect(()=>{const c=i.current;if(!c||!n||s)return;const g=new IntersectionObserver(x=>{var o;(o=x[0])!=null&&o.isIntersecting&&l.current()},{root:(a==null?void 0:a.current)??null,rootMargin:r});return g.observe(c),()=>g.disconnect()},[n,s,a,r]),i}const Ra=({searchResults:t,displayLocation:n,query:s,sortBy:a,effectiveSort:r,canSortByDistance:i,onSortChange:l,isMobile:c})=>{const g=(s==null?void 0:s.trim())||null;return e.jsx("div",{className:"mb-4 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("h2",{className:"text-base md:text-lg font-medium text-gray-900",style:{fontSize:c?"0.875rem":"1rem",lineHeight:c?"1.25rem":"1.5rem"},children:[t.meta.total," venue",t.meta.total!==1?"s":""," found",g&&` with keyword "${g}"`,n&&` in ${n}`]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-gray-500 hidden sm:inline",children:t.meta.searchTime}),e.jsxs(us,{value:r,onValueChange:x=>l(x),children:[e.jsx(hs,{className:"w-[160px] sm:w-[180px] h-9 text-sm border-gray-200 hover:bg-gray-50 focus:ring-0 focus:ring-ring focus:ring-offset-0",children:e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[a==="relevance"&&e.jsx(Te,{className:"w-4 h-4 flex-shrink-0 text-gray-600"}),a==="price_asc"&&e.jsx(et,{className:"w-4 h-4 flex-shrink-0 text-gray-600"}),a==="price_desc"&&e.jsx(et,{className:"w-4 h-4 flex-shrink-0 text-gray-600"}),a==="distance"&&e.jsx(pt,{className:"w-4 h-4 flex-shrink-0 text-gray-600"}),a==="rating"&&e.jsx(Te,{className:"w-4 h-4 flex-shrink-0 text-gray-600"}),e.jsxs("span",{className:"truncate text-sm",children:[a==="relevance"&&"Relevance",a==="price_asc"&&"Low to High",a==="price_desc"&&"High to Low",a==="distance"&&"Distance",a==="rating"&&"Rating"]})]})}),e.jsxs(ms,{children:[e.jsx(Ne,{value:"relevance",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Te,{className:"w-4 h-4"}),e.jsx("span",{children:"Relevance"})]})}),e.jsx(Ne,{value:"price_asc",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(et,{className:"w-4 h-4"}),e.jsx("span",{children:"Low to High"})]})}),e.jsx(Ne,{value:"price_desc",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(et,{className:"w-4 h-4"}),e.jsx("span",{children:"High to Low"})]})}),e.jsx(Ne,{value:"distance",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(pt,{className:"w-4 h-4"}),e.jsx("span",{children:"Distance"})]})}),e.jsx(Ne,{value:"rating",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Te,{className:"w-4 h-4"}),e.jsx("span",{children:"Rating"})]})})]})]}),!i&&e.jsx("p",{className:"text-[11px] text-gray-500 hidden md:block",children:"Pan the map and click “Search this area” to enable distance sorting."})]})]})})},Ls=({searchResults:t,venues:n,searchLoading:s,searchError:a,onRetry:r,displayLocation:i,query:l,sortBy:c,effectiveSort:g,canSortByDistance:x,onSortChange:o,isMobile:m,hasSearchParams:u,activeVenueId:h,onVenueHighlight:p,serializedSearchParams:f,onLoadMore:b,hasNextPage:S,isFetchingNextPage:M,scrollRootRef:L})=>{const y=Ta({onLoadMore:b,hasMore:S,isLoading:M,root:L}),j=()=>a?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-6 max-w-md",children:[e.jsx("h3",{className:"text-red-800 font-semibold mb-2",children:"Search Error"}),e.jsx("p",{className:"text-red-700 text-sm mb-4",children:a}),e.jsx("button",{onClick:r,className:"bg-red-600 text-white px-4 py-2 rounded-lg hover:bg-red-700",children:"Try Again"})]})}):s?e.jsx(Cs,{showResultsHeader:!!t}):n.length===0?e.jsx(Ms,{hasSearchParams:!0,query:l||void 0}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:pe("grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3 [grid-auto-rows:1fr]"),children:n.map(N=>{const T=h===N.id;return e.jsx("div",{className:"transition-shadow duration-150",onMouseEnter:()=>p(N.id),onMouseLeave:()=>p(null),onFocusCapture:()=>p(N.id),onBlurCapture:P=>{const A=P.relatedTarget;(!A||!P.currentTarget.contains(A))&&p(null)},children:e.jsx(Ct,{kind:"venue",venue:N,className:pe("h-full",T?"border-[hsl(var(--brand))] shadow-lg":""),searchQuery:f})},N.id)})}),e.jsx("div",{ref:y,"aria-hidden":"true",className:"h-px w-full"}),M&&e.jsx("div",{className:"flex items-center justify-center py-6",children:e.jsx(On,{className:"h-5 w-5 animate-spin text-gray-400"})}),!S&&n.length>0&&e.jsx("p",{className:"py-6 text-center text-sm text-gray-400",children:"You've reached the end of the results"})]});return e.jsxs("div",{className:"flex-1 pr-2",children:[t&&e.jsx(Ra,{searchResults:t,displayLocation:i,query:l,sortBy:c,effectiveSort:g,canSortByDistance:x,onSortChange:o,isMobile:m}),j()]})},Mt=({pendingBounds:t,boundsLoading:n,boundsError:s,onSearchHere:a})=>!t||n?null:e.jsxs("div",{className:"pointer-events-none absolute left-1/2 top-4 z-30 -translate-x-1/2 flex flex-col items-center gap-2",children:[e.jsx("button",{onClick:a,className:"pointer-events-auto bg-white text-gray-900 px-4 py-2 rounded-full shadow-lg border border-gray-200 hover:bg-gray-50 font-medium transition-colors",children:"Search this area"}),s&&e.jsx("div",{className:"pointer-events-auto bg-red-50 border border-red-200 text-red-800 px-4 py-2 rounded-lg shadow-lg max-w-xs text-sm text-center",children:s})]}),Kt=({height:t,mapLocation:n,venues:s,markerVenues:a,appliedBounds:r,pendingBounds:i,boundsError:l,boundsLoading:c,onSearchHere:g,onBoundsChange:x,highlightedVenueId:o,selectedVenueId:m,onMarkerHoverChange:u,onMarkerClick:h,query:p,searchLoading:f,onToggleFullscreen:b,searchParamsKey:S,mapOptions:M})=>e.jsx("div",{className:"hidden md:flex transition-all duration-500 ease-in-out flex-shrink-0 w-full md:w-[35%]",style:{height:t,minHeight:t,maxHeight:t,flexShrink:0},children:e.jsx("div",{className:"flex flex-col w-full h-full",style:{height:t},children:e.jsxs("div",{className:"flex-1 rounded-2xl overflow-hidden border border-gray-200 shadow-sm transition-[width] duration-500 ease-in-out",style:{position:"relative",boxSizing:"border-box",height:"100%",minHeight:"100%",maxHeight:"100%"},id:"map-container-wrapper",children:[e.jsx(lt,{location:n,venues:s,markerVenues:a,focusBounds:r,isFullscreen:!1,onToggleFullscreen:b,searchKey:S,loading:f,highlightedVenueId:o,selectedVenueId:m,onMarkerHoverChange:u,onMarkerClick:h,onBoundsChange:x,boundsLoading:c,query:p,mapOptions:M}),e.jsx(Mt,{pendingBounds:i,boundsLoading:c,boundsError:l,onSearchHere:g})]})})}),Fa=({isMobile:t,fullscreenTop:n,fullscreenHeight:s,fullscreenContainerRef:a,mapLocation:r,venues:i,markerVenues:l,appliedBounds:c,pendingBounds:g,boundsError:x,boundsLoading:o,onSearchHere:m,onBoundsChange:u,highlightedVenueId:h,selectedVenueId:p,onMarkerHoverChange:f,onMarkerClick:b,query:S,searchLoading:M,onToggleFullscreen:L,searchParamsKey:y,mapOptions:j})=>t?e.jsxs("div",{ref:a,className:"absolute inset-0 overflow-hidden","data-mode":"fullscreen-mobile",children:[e.jsxs("div",{className:"absolute inset-0",style:{top:n,bottom:0},children:[e.jsx(lt,{location:r,venues:i,markerVenues:l,focusBounds:c,isFullscreen:!0,onToggleFullscreen:L,loading:M,highlightedVenueId:h,selectedVenueId:p,onMarkerHoverChange:f,onMarkerClick:b,onBoundsChange:u,boundsLoading:o,query:S,mapOptions:{disableDefaultUI:!0,gestureHandling:"greedy",streetViewControl:!1,fullscreenControl:!1,...j}},y),e.jsx(Mt,{pendingBounds:g,boundsLoading:o,boundsError:x,onSearchHere:m})]}),e.jsx("div",{className:"pointer-events-none absolute left-0 right-0 flex justify-center",style:{bottom:"calc(env(safe-area-inset-bottom, 0px) + 104px)"},children:e.jsxs("button",{onClick:L,className:"pointer-events-auto inline-flex items-center gap-2 rounded-full bg-white px-5 py-3 text-sm font-semibold text-gray-900 shadow-lg",children:[e.jsx(xs,{className:"h-4 w-4"}),e.jsx("span",{children:"Show listings"})]})})]}):e.jsx("div",{ref:a,id:"map-container-wrapper",className:"relative w-full flex-1 overflow-hidden",style:{minHeight:s?`${s}px`:"calc(100vh - 68px)",height:s?`${s}px`:"calc(100vh - 68px)",maxHeight:s?`${s}px`:"calc(100vh - 68px)"},"data-mode":"fullscreen",children:e.jsx("div",{className:"absolute inset-0 flex",children:e.jsx("div",{className:"flex-1 px-6 py-6 transition-[width] duration-500 ease-in-out",children:e.jsxs("div",{className:"relative h-full rounded-2xl overflow-hidden border border-gray-200 shadow-sm",children:[e.jsx(lt,{location:r,venues:i,markerVenues:l,focusBounds:c,isFullscreen:!0,onToggleFullscreen:L,searchKey:y,loading:M,highlightedVenueId:h,selectedVenueId:p,onMarkerHoverChange:f,onMarkerClick:b,onBoundsChange:u,boundsLoading:o,query:S,mapOptions:j},y),e.jsx(Mt,{pendingBounds:g,boundsLoading:o,boundsError:x,onSearchHere:m})]})})})});function Ia(t,n){const[s,a]=d.useState(null),[r,i]=d.useState("calc(100vh - 192px)");return d.useEffect(()=>{const l=()=>{i(`${window.innerHeight-68-48}px`)};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[]),d.useEffect(()=>{if(!t){a(null);return}const l=()=>{if(!n.current){a(null);return}const c=n.current.getBoundingClientRect(),g=window.innerHeight-c.top;a(g>0?g:null)};return l(),window.addEventListener("resize",l),window.addEventListener("orientationchange",l),()=>{window.removeEventListener("resize",l),window.removeEventListener("orientationchange",l)}},[t,n]),{fullscreenHeight:s,mapContainerHeight:r}}function kt(t){const n=(t.ne.lat+t.sw.lat)/2,s=Math.abs(t.ne.lat-t.sw.lat),a=Math.abs(t.ne.lng-t.sw.lng),r=69,i=Math.max(Math.cos(n*Math.PI/180)*69,.1),l=s*r,c=a*i;return Math.max(Math.sqrt(l**2+c**2)/2,5)}const Zt=75;function _a(t,n){const[s]=ct(),[a,r]=d.useState(null),[i,l]=d.useState(null),[c,g]=d.useState(null),x=s.get("category"),o=s.get("location");d.useEffect(()=>{r(null),l(null),g(null)},[x,o,t]);const m=d.useCallback(()=>{if(!a)return;const p=kt(a);if(p>Zt){g(`Search area is too large (${Math.round(p)} miles). Please zoom in to search within ${Zt} miles.`),setTimeout(()=>g(null),5e3);return}g(null),l({ne:{...a.ne},sw:{...a.sw}}),r(null)},[a,n]),u=d.useCallback(p=>{g(null),r(p)},[]),h=d.useMemo(()=>{if(!i)return null;const p=(i.ne.lat+i.sw.lat)/2,f=(i.ne.lng+i.sw.lng)/2,b=kt(i);return{center:{lat:p,lng:f},radiusMiles:b}},[i]);return{pendingBounds:a,appliedBounds:i,boundsError:c,boundsSearchParams:h,handleSearchHere:m,handleBoundsChange:u}}function Da(){const[t]=ct(),n=d.useMemo(()=>{var m;return((m=t.get("packages"))==null?void 0:m.split(",").filter(Boolean))||[]},[t]),s=t.get("age")||"",a=t.get("minPrice"),r=t.get("maxPrice"),i=a&&!Number.isNaN(Number(a))?Number(a):void 0,l=r&&!Number.isNaN(Number(r))?Number(r):void 0,c=t.get("venueType")||"",g=d.useMemo(()=>{var m;return((m=t.get("amenities"))==null?void 0:m.split(",").filter(Boolean))||[]},[t]),x=t.get("capacityMin")||void 0,o=t.get("capacityMax")||void 0;return{filterPackages:n,filterAge:s,rawMinPrice:a,rawMaxPrice:r,filterMinPriceValue:i,filterMaxPriceValue:l,filterVenueType:c,filterAmenities:g,capacityMin:x,capacityMax:o}}const Jt=t=>t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"");function As(t){const n=t.amenities&&t.amenities.length>0?t.amenities.map(Jt).filter(Boolean):void 0,s=t.packages&&t.packages.length>0?t.packages.map(Jt).filter(Boolean):void 0;return{priceMin:t.priceMin,priceMax:t.priceMax,venueType:t.venueType||void 0,amenities:n,packages:s,ageRestriction:t.ageRestriction||void 0,capacity:t.capacity}}const Ha=18;function Ba({location:t,geoSearchParams:n,effectiveQuery:s,sortBy:a,boundsSearchParams:r,filters:i}){const l=d.useMemo(()=>As(i),[i]),c=a==="distance"&&!r&&!n?"relevance":a,g=d.useMemo(()=>{if(r)return{lat:r.center.lat,lng:r.center.lng,radiusMiles:r.radiusMiles};if(n)return{lat:n.lat,lng:n.lng,radiusMiles:n.radiusMiles};if(t&&t!=="Nearby"&&t.trim()!==""){const y=t.trim(),j=y.indexOf(",");return{city:j>0?y.substring(0,j).trim():y,radiusMiles:10}}},[r,n,t]),{data:x,isLoading:o,isFetching:m,error:u,refetch:h,fetchNextPage:p,hasNextPage:f,isFetchingNextPage:b}=Pn({queryKey:["venues-search",{query:s,location:t,geoSearchParams:n,boundsSearchParams:r,sort:c,filters:l}],initialPageParam:1,queryFn:({pageParam:y})=>ys({query:s||void 0,filters:{location:g,...l},sort:c,page:y,limit:Ha}),getNextPageParam:y=>{const{page:j,totalPages:N}=y.meta;return j<N?j+1:void 0},staleTime:5*60*1e3}),S=x==null?void 0:x.pages[0],M=d.useMemo(()=>x?x.pages.flatMap(y=>y.venues).map(vs):[],[x]);return{searchResults:S,venues:M,searchLoading:o,isFetching:m,searchError:u?"Failed to search venues. Please try again.":null,refetch:h,fetchNextPage:p,hasNextPage:f,isFetchingNextPage:b}}const Oa=150,za=400,Ua=100;function Xa({bounds:t,query:n,sort:s,filters:a,enabled:r=!0}){const[i,l]=d.useState(t);d.useEffect(()=>{const o=setTimeout(()=>l(t),za);return()=>clearTimeout(o)},[t]);const c=d.useMemo(()=>{if(!i)return null;const o=(i.ne.lat+i.sw.lat)/2,m=(i.ne.lng+i.sw.lng)/2,u=Math.min(kt(i),Ua);return{lat:Number(o.toFixed(2)),lng:Number(m.toFixed(2)),radiusMiles:Math.round(u)}},[i]),g=d.useMemo(()=>As(a),[a]),{data:x}=fn({queryKey:["map-venues",{viewport:c,query:n,sort:s,filters:g}],queryFn:()=>ys({query:n||void 0,filters:{location:c?{lat:c.lat,lng:c.lng,radiusMiles:c.radiusMiles}:void 0,...g},sort:s,page:1,limit:Oa}),enabled:r&&!!c,staleTime:5*60*1e3,placeholderData:pn});return d.useMemo(()=>x?x.venues.map(vs):[],[x])}zn.registerPlugin(Un);const $a=({user:t,authLoading:n,profile:s})=>{const{profilePhoto:a}=bn({user:t});return n?e.jsx("section",{className:"bg-white pt-12 pb-4",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsx("div",{className:"bg-white border border-gray-200 rounded-2xl p-4 md:p-5 shadow-sm",children:e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[e.jsx(B,{className:"w-10 h-10 rounded-full flex-shrink-0"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(B,{className:"h-5 w-64"}),e.jsx(B,{className:"h-4 w-80"})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(B,{className:"h-10 w-24 rounded-full"}),e.jsx(B,{className:"h-10 w-32 rounded-full"})]})]})})})}):e.jsx("section",{className:"bg-white pt-12 pb-4",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsx("div",{className:"bg-white border border-gray-200 rounded-2xl p-4 md:p-5 shadow-sm hover:shadow-md transition-shadow",children:e.jsx("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:t?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[e.jsx("div",{className:"flex-shrink-0 w-10 h-10 rounded-full overflow-hidden bg-brand-50 flex items-center justify-center border-2 border-[#ff7b6d] shadow-sm",children:a?e.jsx(yn,{originalSrc:a,variant:"thumbnail",alt:"",className:"w-full h-full object-cover",onError:r=>{r.currentTarget.src="/default-profile-icon.png"}}):e.jsx("img",{src:"/default-profile-icon.png",alt:"",className:"w-full h-full object-cover"})}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-[#0F0F0F] font-medium text-base",children:["Welcome back",s!=null&&s.firstName&&(s!=null&&s.lastName)?`, ${s.firstName} ${s.lastName}`:s!=null&&s.firstName?`, ${s.firstName}`:"","!"]}),e.jsx("p",{className:"text-[#4B4B4B] text-sm mt-0.5",children:"Ready To Celebrate?"})]})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[e.jsx("div",{className:"flex-shrink-0 w-10 h-10 rounded-full bg-brand-50 flex items-center justify-center","aria-hidden":!0,children:e.jsx(it,{className:"w-5 h-5 text-brand"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[#0F0F0F] font-medium text-base",children:"Get more when you sign in"}),e.jsx("p",{className:"text-[#4B4B4B] text-sm mt-0.5",children:"Unlock better pricing, save your favorites, and book with ease"})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(G,{asChild:!0,variant:"outline",className:"rounded-full border-brand text-brand hover:bg-brand hover:text-white",children:e.jsx(ae,{to:"/auth",children:"Sign in"})}),e.jsx(G,{asChild:!0,variant:"ghost",className:"rounded-full bg-brand text-white hover:bg-brand hover:brightness-110",children:e.jsx(ae,{to:"/how-it-works",children:"Learn more"})})]})]})})})})})},Va=()=>{const t=ot(),n=[{id:"birthday-party",label:"Birthday Party",icon:Kn,serviceTypes:["dj","caterer","photographer","entertainer"]},{id:"social-event",label:"Social Event",icon:$n,serviceTypes:["dj","bartender","photographer","musician"]},{id:"corporate-party",label:"Corporate Party",icon:Vn,serviceTypes:["caterer","event_planner","photographer","equipment_rental"]}],s=(a,r)=>{const i=new URLSearchParams({services:r.join(","),source:"event_service_button",event:a});t(`/services?${i.toString()}`,{replace:!1})};return e.jsx("section",{className:"bg-white pt-3 pb-6 md:pt-4 md:pb-8",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-[#0F0F0F] tracking-tight mb-3",style:{lineHeight:"1.2",fontWeight:600,fontSize:"clamp(1.75rem, 3vw, 2.5rem)"},children:"Find services for your event"}),e.jsx("p",{className:"text-[#4B4B4B] max-w-3xl",style:{fontSize:"1rem",lineHeight:"1.6",letterSpacing:"-0.01em"},children:"Planning a birthday, social, or corporate event? Browse curated service categories to find the right pros faster."})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4",children:n.map(a=>e.jsxs("button",{onClick:()=>s(a.id,a.serviceTypes),className:"group relative aspect-[4/3] overflow-hidden rounded-2xl border border-gray-200 hover:border-brand transition-all hover:shadow-lg cursor-pointer",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-brand/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-white/90 backdrop-blur-sm flex items-center justify-center shadow-md group-hover:bg-brand group-hover:text-white transition-colors",children:e.jsx(a.icon,{className:"w-6 h-6 text-brand group-hover:text-white transition-colors"})}),e.jsx("p",{className:"text-[#0F0F0F] font-medium px-2",style:{fontSize:"0.875rem"},children:a.label})]})})]},a.id))})]})})},Ga=({serviceTypes:t,availableCounts:n,buildHref:s})=>e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"md:hidden -mx-4 px-4",children:e.jsx("div",{className:"flex items-center gap-2 overflow-x-auto pb-2 scrollbar-hide",children:t.map(a=>{const r=n==null?void 0:n[a.id];return e.jsxs(ae,{to:s(a.id),className:"shrink-0 inline-flex items-center gap-2 rounded-full border border-gray-200 bg-white px-3 py-2 text-sm font-semibold text-gray-700 transition-all hover:border-[hsl(var(--brand))] hover:bg-[hsl(var(--brand))]/5",children:[e.jsx("span",{className:"text-lg",children:a.icon}),e.jsx("span",{className:"text-xs font-semibold",children:a.label}),typeof r=="number"?e.jsx("span",{className:"rounded-full bg-gray-100 px-1.5 py-0.5 text-[10px] text-gray-600",children:r}):null]},a.id)})})}),e.jsx("div",{className:"hidden md:grid md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-2",children:t.map(a=>{const r=n==null?void 0:n[a.id];return e.jsxs(ae,{to:s(a.id),className:"group flex items-center justify-between gap-3 rounded-xl border border-gray-200 bg-white px-3 py-2.5 transition-all hover:border-[hsl(var(--brand))] hover:bg-[hsl(var(--brand))]/5 hover:shadow-sm",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[e.jsx("span",{className:"text-xl leading-none",children:a.icon}),e.jsx("span",{className:"truncate text-sm font-semibold text-gray-900",children:a.label})]}),typeof r=="number"?e.jsx("span",{className:"rounded-full bg-gray-100 px-2 py-0.5 text-xs font-medium text-gray-600 group-hover:bg-white",children:r}):null]},a.id)})})]}),Wa=({featuredServices:t,loadingVenues:n,venuesError:s})=>{const a=Us.useMemo(()=>t.reduce((i,l)=>{const c=Gn(l)??l.draftData,g=c==null?void 0:c.serviceType;return g&&(i[g]=(i[g]??0)+1),i},{}),[t]),r=Object.keys(a).length>0;return e.jsx("section",{className:"bg-white pt-3 pb-6 md:pt-4 md:pb-8",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("h2",{className:"text-[#0F0F0F] tracking-tight",style:{lineHeight:"1.2",fontWeight:600,fontSize:"clamp(1.5rem, 2.5vw, 2rem)"},children:"Discover services for your event"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Browse top service categories and book trusted pros in a few clicks."})]}),e.jsx(Ga,{serviceTypes:vn,buildHref:i=>`/services?services=${encodeURIComponent(i)}`}),s&&!r&&!n?e.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:"Service counts are temporarily unavailable. You can still browse all service categories."}):null]})})},Ya="/assets/hero-venues-updated6-Dc7nSU-E.webp",qa=()=>e.jsx("section",{className:"bg-white py-6 md:py-8",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"relative rounded-3xl overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:`url(${Ya})`}}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-black/70 via-black/60 to-black/50"}),e.jsx("div",{className:"relative z-10 max-w-2xl p-8 md:p-12",children:e.jsxs("div",{className:"bg-white/95 backdrop-blur-sm rounded-3xl p-8 md:p-12 shadow-2xl",children:[e.jsxs("h2",{className:"text-[#0F0F0F] mb-4",style:{lineHeight:"1.2",fontWeight:600,fontSize:"clamp(1.75rem, 3vw, 2.5rem)"},children:["List your venue confidently with"," ",e.jsx("img",{src:"/logo-primary.svg",alt:"PLEC",className:"h-8 md:h-12 w-auto"})]}),e.jsx("p",{className:"text-[#4B4B4B] mb-6 flex flex-wrap items-center gap-1.5",style:{fontSize:"1rem",lineHeight:"1.7",letterSpacing:"-0.01em"},children:"With live support, quick listing signup, and verified guests, hosting on PLEC helps you grow your premier revenue stream: private events!"}),e.jsx(G,{asChild:!0,className:"rounded-full px-8 py-6 text-base font-medium bg-gradient-to-r from-brand-400 to-brand-500 hover:brightness-90 text-white shadow-lg hover:shadow-xl transition-all",style:{boxShadow:"0 8px 30px -8px rgba(249, 115, 22, 0.4)"},children:e.jsx(ae,{to:"/host",children:"List your venue"})})]})})]})})}),Qa=()=>{const[t,n]=d.useState(!1),[s,a]=d.useState(!1),[r,i]=d.useState(!1);return d.useEffect(()=>{const l=window.setTimeout(()=>n(!0),3e3);return()=>window.clearTimeout(l)},[]),d.useEffect(()=>{if(!r)return;const l=window.setTimeout(()=>{a(!0),i(!1)},500);return()=>window.clearTimeout(l)},[r]),t?e.jsx("div",{className:"fixed bottom-4 right-4 z-50 sm:bottom-6 sm:right-6",children:s?e.jsxs("button",{type:"button",onClick:()=>a(!1),"aria-label":"Open PLEC Concierge",className:"flex items-center gap-2 rounded-full bg-gradient-to-br from-brand-500 to-brand-700 px-4 py-3 text-sm font-medium text-white shadow-2xl ring-1 ring-black/5 transition-transform hover:scale-105 animate-in fade-in duration-200",children:[e.jsx(it,{className:"h-4 w-4"}),"PLEC Concierge"]}):e.jsxs("div",{className:"relative w-[calc(100vw-2rem)] max-w-sm origin-bottom-right overflow-hidden rounded-2xl bg-gradient-to-br from-brand-500 to-brand-700 p-5 shadow-2xl ring-1 ring-black/5 duration-500 "+(r?"animate-out fade-out zoom-out-50 slide-out-to-bottom-4 ease-[cubic-bezier(0.36,0,0.66,-0.56)]":"animate-in fade-in zoom-in-50 slide-in-from-bottom-4 ease-[cubic-bezier(0.34,1.56,0.64,1)]"),children:[e.jsx("button",{type:"button",onClick:()=>i(!0),"aria-label":"Collapse concierge card",className:"absolute right-3 top-3 z-10 rounded-full p-1 text-white/70 transition-colors hover:bg-white/15 hover:text-white",children:e.jsx(De,{className:"h-4 w-4"})}),e.jsxs("div",{className:"relative z-0",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-white/15 px-2.5 py-1 text-xs font-medium text-white backdrop-blur-sm",children:[e.jsx(it,{className:"h-3.5 w-3.5"}),"PLEC Concierge"]}),e.jsx("h2",{className:"mt-3 text-lg font-semibold leading-snug text-white",children:"Need help planning your event?"}),e.jsx("p",{className:"mt-2 text-sm leading-relaxed text-white/90",children:"Keep your event under control and under budget. Let a member of our team source the prices for you."}),e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsx(G,{asChild:!0,className:"rounded-full bg-white px-8 py-5 text-sm font-medium text-brand-700 shadow-lg transition-all hover:bg-white/90 hover:shadow-xl",children:e.jsx(ae,{to:"/concierge",children:"Plan my event"})})})]})]})}):null};function at({image:t,label:n,title:s,buttonText:a,href:r,buttonColor:i="hsl(var(--brand-400))",textColor:l="#0F0F0F"}){return e.jsxs(ae,{to:r,className:"flex flex-col bg-white rounded-3xl overflow-hidden shadow-sm hover:shadow-xl transition-all duration-300 border border-gray-100 hover:border-brand-400/30 group",children:[e.jsx("div",{className:"aspect-[4/3] overflow-hidden",children:e.jsx(Wn,{src:t,alt:s,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"})}),e.jsxs("div",{className:"p-6 flex flex-col gap-3",children:[e.jsx("span",{className:"text-sm font-medium",style:{color:l,opacity:.6},children:n}),e.jsx("h3",{className:"text-lg font-semibold leading-tight",style:{color:l},children:s}),e.jsx("div",{className:"mt-2 px-6 py-2.5 rounded-full border-2 transition-all self-start font-medium text-sm group-hover:scale-105",style:{borderColor:i,color:i},children:a})]})]})}const Ka="/assets/hero-venues-updated2-BB5bY2Nu.webp",Za=()=>e.jsx("section",{className:"bg-white py-6 md:py-8",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"relative rounded-3xl overflow-hidden shadow-lg hover:shadow-2xl transition-all duration-300 group",children:[e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"w-full h-full bg-cover bg-center",style:{backgroundImage:`url(${Ka})`,backgroundSize:"cover",backgroundPosition:"center bottom",backgroundRepeat:"no-repeat"}})}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-black/80 via-black/70 to-black/60"}),e.jsxs("div",{className:"relative z-10 px-8 py-12 md:px-12 md:py-16 max-w-3xl",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",style:{letterSpacing:"0.05em"},children:[e.jsx("span",{className:"text-white/80 text-sm font-medium",children:"WHY CHOOSE"}),e.jsx("img",{src:"/logo-primary.svg",alt:"PLEC",className:"h-6 w-auto"})]}),e.jsx("h2",{className:"text-white mb-6",style:{lineHeight:"1.2",fontWeight:700,fontSize:"clamp(1.75rem, 3.5vw, 2.75rem)"},children:"Book with confidence, celebrate with ease"}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-6 mb-8",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-brand-400 flex items-center justify-center flex-shrink-0",children:e.jsx(wn,{className:"w-5 h-5 text-white"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-semibold mb-1 text-base",children:"Transparent Pricing"}),e.jsx("p",{className:"text-white/80 text-sm",children:"No hidden fees, ever"})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-brand-400 flex items-center justify-center flex-shrink-0",children:e.jsx(it,{className:"w-5 h-5 text-white"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-semibold mb-1 text-base",children:"Instant Booking"}),e.jsx("p",{className:"text-white/80 text-sm",children:"Reserve in minutes"})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-brand-400 flex items-center justify-center flex-shrink-0",children:e.jsx(jn,{className:"w-5 h-5 text-white"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-semibold mb-1 text-base",children:"24/7 Support"}),e.jsx("p",{className:"text-white/80 text-sm",children:"We're here to help"})]})]})]})]})]})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-[#0F0F0F] tracking-tight mb-6",style:{lineHeight:"1.2",fontWeight:600,fontSize:"clamp(1.5rem, 2.5vw, 2rem)"},children:"Explore venues and services"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[e.jsx(at,{image:"https://images.unsplash.com/photo-1530103862676-de8c9debad1d?q=80&w=2070&auto=format&fit=crop",label:"FOR FAMILIES",title:"Kids party venues and entertainment spaces",buttonText:"Explore venues",href:"/venues",buttonColor:"hsl(var(--brand-400))"}),e.jsx(at,{image:"https://images.unsplash.com/photo-1514933651103-005eec06c04b?q=80&w=2074&auto=format&fit=crop",label:"FOR CELEBRATIONS",title:"Bars, clubs & lounges for unforgettable nights",buttonText:"Browse venues",href:"/venues",buttonColor:"hsl(var(--brand-400))"}),e.jsx(at,{image:"https://images.unsplash.com/photo-1505373877841-8d25f7d46678?q=80&w=2012&auto=format&fit=crop",label:"FOR PROFESSIONALS",title:"Corporate event spaces and banquet halls",buttonText:"Find venues",href:"/venues",buttonColor:"hsl(var(--brand-400))"}),e.jsx(at,{image:"https://images.unsplash.com/photo-1492684223066-81342ee5ff30?q=80&w=2070&auto=format&fit=crop",label:"SERVICES & MORE",title:"DJs, photographers, caterers and more",buttonText:"Browse services",href:"/services",buttonColor:"hsl(var(--brand-400))"})]})]})]})}),Ja=t=>{const[n,s]=d.useState(null),a=d.useCallback(async()=>{var r,i;if((t==null?void 0:t.authType)==="cognito")try{const c=(i=(r=(await Bn()).tokens)==null?void 0:r.idToken)==null?void 0:i.toString();if(c)return{Authorization:`Bearer ${c}`}}catch(l){console.warn("Failed to get Cognito token:",l)}return{}},[t==null?void 0:t.authType]);return d.useEffect(()=>{(async()=>{if(!t){s(null);return}try{const i=await a(),l=await Nn.get("/users/me",{headers:i});s({firstName:l.data.firstName,lastName:l.data.lastName,preferredName:l.data.preferredName})}catch(i){console.warn("Failed to load profile for welcome message:",i),s(null)}})()},[t,a]),n},es=[{id:"austin-venues",title:"Popular venues in Austin",cityLabel:"Austin",city:"Austin",state:"TX",viewAllHref:"/venues?location=Austin%2C%20TX",tokens:["austin"],listingKind:"venue"},{id:"philly-venues",title:"Handpicked venues in Philadelphia",cityLabel:"Philadelphia",city:"Philadelphia",state:"PA",viewAllHref:"/venues?location=Philadelphia%2C%20PA",tokens:["philadelphia","philly"],listingKind:"venue"},{id:"austin-services",title:"Featured services in Austin",cityLabel:"Austin",city:"Austin",state:"TX",viewAllHref:"/services?location=Austin%2C%20TX",tokens:["austin"],listingKind:"service"},{id:"philly-services",title:"Top spaces in Philadelphia",cityLabel:"Philadelphia",city:"Philadelphia",state:"PA",viewAllHref:"/services?location=Philadelphia%2C%20PA",tokens:["philadelphia","philly"],listingKind:"service"}],ts=20,ss=2*60*1e3,er=()=>{const t=es.filter(o=>o.listingKind==="venue"),n=es.filter(o=>o.listingKind==="service"),s=St({queries:t.map(o=>({queryKey:["home","published-listings","venue",o.city,o.state],queryFn:()=>bt({listingKind:"venue",city:o.city,state:o.state,limit:ts}),staleTime:ss,refetchOnWindowFocus:!1}))}),a=St({queries:n.map(o=>({queryKey:["home","published-listings","service",o.city,o.state],queryFn:()=>bt({listingKind:"service",city:o.city,state:o.state,limit:ts}),staleTime:ss,refetchOnWindowFocus:!1}))}),r=new Set,i=s.flatMap(o=>{var m;return((m=o.data)==null?void 0:m.items)??[]}).filter(o=>o.listingKind==="venue").filter(o=>r.has(o.listingId)?!1:(r.add(o.listingId),!0)).map(o=>ws(o)),l=new Set,c=a.flatMap(o=>{var m;return((m=o.data)==null?void 0:m.items)??[]}).filter(o=>o.listingKind==="service").filter(o=>l.has(o.listingId)?!1:(l.add(o.listingId),!0)),g=s.some(o=>o.isLoading)||a.some(o=>o.isLoading),x=s.some(o=>o.error)||a.some(o=>o.error)?"We are having trouble loading featured listings right now. Please try again shortly.":null;return{featuredVenues:i,featuredServices:c,loadingVenues:g,venuesError:x}},xt=()=>{const{user:t,loading:n}=ds(),s=Ja(t),{featuredServices:a,loadingVenues:r,venuesError:i}=er();return e.jsxs(e.Fragment,{children:[e.jsx($a,{user:t,authLoading:n,profile:s}),e.jsx(Va,{}),e.jsx(Wa,{featuredServices:a,loadingVenues:r,venuesError:i}),e.jsx(Qa,{}),e.jsx(qa,{}),e.jsx(Za,{})]})},tr=t=>t==null||Number.isNaN(t)?"$0":`$${t.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0})}`,sr=({venue:t,isOpen:n,onClose:s,sheetHeight:a})=>{var m,u,h,p;const r=ot();if(!t||!n)return null;const i=t.main_image||((m=t.galleryImages)==null?void 0:m[0])||"",l=((u=t.stats)==null?void 0:u.rating)||((h=t.stats)==null?void 0:h.averageRating)||0,c=((p=t.stats)==null?void 0:p.reviewCount)||0,g=typeof t.baseRate=="number"&&t.baseRate>0?t.baseRate:0,x=a>.7?0:20,o=f=>{f.target.closest("button")||(r(`/venue/${t.id}`),s())};return e.jsx(Xn,{children:n&&a<.7&&e.jsx(js.div,{initial:{y:100,opacity:0},animate:{y:0,opacity:1},exit:{y:100,opacity:0},transition:{type:"spring",damping:25,stiffness:300},className:"fixed bottom-0 left-0 right-0 z-[15] px-4 pb-4",style:{bottom:`${x+a*100}%`},children:e.jsx("div",{className:"bg-white rounded-2xl shadow-2xl overflow-hidden border border-gray-200 cursor-pointer",onClick:o,children:e.jsxs("div",{className:"flex gap-3 p-3 relative",children:[e.jsx("button",{onClick:f=>{f.stopPropagation(),s()},className:"absolute top-2 left-2 z-10 bg-white/90 hover:bg-white rounded-full p-1.5 shadow-lg transition-colors","aria-label":"Close",children:e.jsx(De,{className:"w-3.5 h-3.5 text-gray-700"})}),i?e.jsx("div",{className:"relative w-24 h-24 flex-shrink-0 bg-gray-100 rounded-lg overflow-hidden",children:e.jsx("img",{src:i,alt:t.name,className:"w-full h-full object-cover"})}):e.jsx("div",{className:"w-24 h-24 flex-shrink-0 bg-gray-200 rounded-lg"}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900 line-clamp-2 leading-tight pr-8",children:t.name}),e.jsxs("div",{className:"flex items-center justify-between mt-2 gap-2",children:[l>0&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Te,{className:"w-3.5 h-3.5 fill-yellow-400 text-yellow-400 flex-shrink-0"}),e.jsx("span",{className:"text-sm font-semibold text-gray-900",children:l.toFixed(1)}),c>0&&e.jsxs("span",{className:"text-xs text-gray-500",children:["(",c,")"]})]}),g>0&&e.jsxs("div",{className:"text-right flex-shrink-0",children:[e.jsx("span",{className:"text-base font-semibold text-gray-900",children:tr(g)}),e.jsx("span",{className:"text-xs text-gray-500 ml-1",children:t.priceUnit==="per_hour"?"/hour":"/event"})]})]})]}),e.jsx("div",{className:"flex items-center justify-end mt-2 pt-2 border-t border-gray-100",children:e.jsx("button",{onClick:f=>{f.stopPropagation()},className:"p-1.5 hover:bg-gray-100 rounded-full transition-colors","aria-label":"Save to wishlist",children:e.jsx(Sn,{className:"w-4 h-4 text-gray-600"})})})]})]})})})})},J={COLLAPSED:.2,MIDDLE:.5,EXPANDED:.9},nr=({mapLocation:t,venues:n,markerVenues:s,appliedBounds:a,pendingBounds:r,boundsError:i,boundsLoading:l,onSearchHere:c,onBoundsChange:g,highlightedVenueId:x,selectedVenueId:o,onMarkerHoverChange:m,onMarkerClick:u,query:h,searchLoading:p,searchParamsKey:f,searchResults:b,searchError:S,onRetry:M,sortBy:L,onSortChange:y,effectiveSort:j,canSortByDistance:N,displayLocation:T,hasSearchParams:P,activeVenueId:A,onVenueHighlight:X,serializedSearchParams:ee,onLoadMore:q,hasNextPage:Q,isFetchingNextPage:te})=>{const[k,F]=d.useState(J.MIDDLE),[v,R]=d.useState(!1),H=d.useRef(null),O=d.useRef(null),oe=d.useRef(null),se=d.useRef(0),I=d.useRef(J.MIDDLE),$=d.useRef(0),_=typeof window<"u"?window.innerHeight:800,ke=d.useCallback(V=>{R(!0),se.current=V.touches[0].clientY,I.current=k,$.current=0},[k]),be=d.useCallback(V=>{if(!v)return;const ye=V.touches[0].clientY,re=se.current-ye;$.current=re;const z=_*I.current+re;O.current&&(O.current.style.height=`${z}px`)},[v,_]),ce=d.useCallback(()=>{if(!v)return;R(!1);const V=$.current,ue=(_*I.current+V)/_;let z;if(V>0){const he=(I.current+J.EXPANDED)/2;ue>=he?z=J.EXPANDED:z=I.current}else if(V<0){const he=(I.current+J.COLLAPSED)/2;ue<=he?(I.current>=J.MIDDLE,z=J.COLLAPSED):z=I.current}else z=I.current;F(z),$.current=0},[v,_]),Ce=d.useCallback(V=>{R(!0),se.current=V.clientY,I.current=k,$.current=0},[k]),ie=d.useCallback(V=>{if(!v)return;const ye=V.clientY,re=se.current-ye;$.current=re;const z=_*I.current+re;O.current&&(O.current.style.height=`${z}px`)},[v,_]),de=d.useCallback(()=>{ce()},[ce]);d.useEffect(()=>{if(v)return document.addEventListener("mousemove",ie),document.addEventListener("mouseup",de),()=>{document.removeEventListener("mousemove",ie),document.removeEventListener("mouseup",de)}},[v,ie,de]);const dt=d.useCallback(()=>{F(J.COLLAPSED)},[]),Be=_*k,Le=o?n.find(V=>V.id===o):null;return e.jsxs("div",{ref:H,className:"relative w-full h-full overflow-hidden",style:{height:"100vh"},children:[e.jsx("div",{className:"absolute inset-0 z-0",children:e.jsx(lt,{location:t,venues:n,markerVenues:s,appliedBounds:a,pendingBounds:r,boundsError:i,boundsLoading:l,onSearchHere:c,onBoundsChange:g,highlightedVenueId:x,selectedVenueId:o,onMarkerHoverChange:m,onMarkerClick:u,query:h,searchLoading:p,searchParamsKey:f})}),e.jsx(sr,{venue:Le,isOpen:!!o,onClose:()=>u(null),sheetHeight:k}),e.jsxs(js.div,{ref:O,className:"absolute bottom-0 left-0 right-0 z-10 bg-white rounded-t-3xl shadow-2xl",style:{height:v?void 0:Be},onTouchMove:v?be:void 0,onTouchEnd:v?ce:void 0,initial:{height:_*J.MIDDLE},animate:{height:v?void 0:Be},transition:{type:"spring",damping:30,stiffness:300},children:[e.jsx("div",{className:"flex justify-center pt-3 pb-2 sticky top-0 bg-white z-20 rounded-t-3xl cursor-grab active:cursor-grabbing",onTouchStart:ke,onMouseDown:Ce,style:{touchAction:"none"},children:e.jsx("div",{className:"w-12 h-1 bg-gray-300 rounded-full pointer-events-none"})}),k>=J.EXPANDED*.9&&e.jsx("div",{className:"sticky top-0 z-30 bg-white pb-2 px-4 pt-2",children:e.jsxs("button",{onClick:dt,className:"w-full bg-gray-900 hover:bg-gray-800 text-white px-4 py-2.5 rounded-full shadow-lg flex items-center justify-center gap-2 font-medium transition-colors",children:[e.jsx(Yn,{className:"w-4 h-4"}),e.jsx("span",{children:"Show Map"})]})}),e.jsx("div",{ref:oe,className:"overflow-y-auto h-full pb-20",style:{height:k>=J.EXPANDED*.9?"calc(100% - 60px)":"calc(100% - 40px)"},children:e.jsx("div",{className:"px-4",children:e.jsx(Ls,{searchResults:b,venues:n,searchLoading:p,searchError:S,onRetry:M,sortBy:L,onSortChange:y,effectiveSort:j,canSortByDistance:N,displayLocation:T,isMobile:!0,hasSearchParams:P,activeVenueId:A,onVenueHighlight:X,serializedSearchParams:ee,onLoadMore:q,hasNextPage:Q,isFetchingNextPage:te,scrollRootRef:oe})})})]})]})},ar=()=>{const[t]=ct(),n=ot(),s=d.useMemo(()=>t.toString(),[t]),a=d.useMemo(()=>t.toString(),[t]),r=t.get("category"),i=t.get("location"),l=t.get("date"),c=t.get("guests"),g=t.get("q"),x=t.get("venueType"),o=i||"",m=!!(i||l||c||g||x);return d.useEffect(()=>{const u=i==null?void 0:i.trim();if(!u)return;const h=u.toLowerCase();h==="nearby"||h==="current location"||Tn(u)},[i]),d.useEffect(()=>{if(!r)return;const u=new URLSearchParams(t);u.delete("category");const h=r.trim().toLowerCase()==="services"?"/services":"/venues";n(`${h}?${u.toString()}`,{replace:!0})},[r,n,t]),{searchParams:t,navigate:n,location:i,date:l,guests:c,query:g,boundsResetKey:o,hasSearchParams:m,searchParamsKey:s,serializedSearchParams:a}},rr=({isMobile:t})=>{const[n,s]=d.useState(!1),[a,r]=d.useState(!1),[i,l]=d.useState(!1);return d.useEffect(()=>{if(typeof document>"u")return;const c=document.body;return t&&a?c.dataset.hideCart="true":delete c.dataset.hideCart,()=>{delete c.dataset.hideCart}},[t,a]),d.useEffect(()=>{if(!i)return;const c=document.documentElement,g=c.style.overflow;return c.style.overflow="hidden",()=>{c.style.overflow=g}},[i]),{showFilters:n,setShowFilters:s,isMapFullscreen:a,setIsMapFullscreen:r,mobileSearchExpanded:i,setMobileSearchExpanded:l}},ir=100,lr=2*60*1e3,or=10,ns=["plec_featured","popular","plec_partner","plec_onboarded","verified"];function as(t){if(!t.rawListing)return Number.MAX_SAFE_INTEGER;const n=Ns(t.rawListing);for(let s=0;s<ns.length;s+=1)if(n.some(a=>a.type===ns[s]))return s;return Number.MAX_SAFE_INTEGER}function rs(t){var a,r,i;const n=((a=t.rawListing)==null?void 0:a.publishedAt)||((r=t.rawListing)==null?void 0:r.updatedAt)||((i=t.rawListing)==null?void 0:i.createdAt)||"",s=Date.parse(n);return Number.isNaN(s)?0:s}function is(t){var n;return(n=t.plecMetadata)!=null&&n.isFeatured?!0:t.rawListing?Ns(t.rawListing).some(s=>s.type==="plec_featured"):!1}function cr(t,n){const s=Gt(t.rawListing),a=Gt(n.rawListing);if(s!==a)return s?-1:1;const r=is(t),i=is(n);if(r!==i)return r?-1:1;const l=as(t)-as(n);return l!==0?l:rs(n)-rs(t)}function dr(){const t=St({queries:Vt.map(i=>({queryKey:["home","featured-sections",i.id],queryFn:()=>bt({listingKind:"venue",city:i.city,state:i.state,limit:ir}),staleTime:lr,refetchOnWindowFocus:!1}))}),n=Vt.map((i,l)=>{var g;const c=(((g=t[l].data)==null?void 0:g.items)??[]).filter(x=>x.listingKind==="venue").map(ws).sort(cr).slice(0,or);return{id:i.id,heading:i.heading,subtitle:i.subtitle,viewAllHref:i.viewAllHref,venues:c}}),s=n.flatMap(i=>i.venues),a=t.some(i=>i.isLoading),r=t.some(i=>i.error)?"We are having trouble loading featured venues right now. Please try again shortly.":null;return{sections:n,allVenues:s,loading:a,error:r}}const ur=8,hr=1,mr=100,gr={ne:{lat:30.45,lng:-97.6},sw:{lat:30.1,lng:-97.9}};function xr(t,n,s){if(!t||!n)return null;const a=Number(t),r=Number(n);if(!Number.isFinite(a)||!Number.isFinite(r)||a<-90||a>90||r<-180||r>180)return null;const i=s?Number(s):NaN,l=Number.isFinite(i)&&i>=hr&&i<=mr;return{lat:a,lng:r,radiusMiles:l?i:ur}}const ri=()=>{const{pathname:t}=os(),n=t==="/";Xs(n?{title:"PLEC · Book unique celebration venues",description:"Discover and book unique venues for parties, celebrations, and private events. PLEC makes it easy to find the perfect space."}:{title:"Browse event & party venues | PLEC",description:"Search hundreds of event and party venues near you. Filter by location, capacity, and more on PLEC."});const s=d.useRef(null),a=d.useRef(null),{searchParams:r,navigate:i,location:l,date:c,guests:g,query:x,boundsResetKey:o,hasSearchParams:m,searchParamsKey:u,serializedSearchParams:h}=ar(),p=d.useRef(null),f=gs(),{showFilters:b,setShowFilters:S,isMapFullscreen:M,setIsMapFullscreen:L,mobileSearchExpanded:y,setMobileSearchExpanded:j}=rr({isMobile:f}),{fullscreenHeight:N,mapContainerHeight:T}=Ia(M,a),{pendingBounds:P,appliedBounds:A,boundsError:X,boundsSearchParams:ee,handleSearchHere:q,handleBoundsChange:Q}=_a(o),te=d.useMemo(()=>A?"":l||"",[A,l]),k=A?"":te,F=x||"",v=r.get("searchLat"),R=r.get("searchLng"),H=r.get("searchRadiusMiles"),O=d.useMemo(()=>xr(v,R,H),[v,R,H]),oe=r.get("venueType"),se=oe&&!F&&!l&&!c&&!g,I=F||(se?oe:""),[$,_]=d.useState(()=>F),[ke,be]=d.useState(()=>l||""),[ce,Ce]=d.useState(()=>c||""),[ie,de]=d.useState(()=>g||"");d.useEffect(()=>{_(F),be(l||""),Ce(c||""),de(g||"")},[F,l,c,g]);const dt=Mn,Be=d.useMemo(()=>[{id:"nearby",label:"Nearby",subtitle:"Find venues near you"},{id:"austin",label:"Austin, TX",subtitle:"Live music capital & vibrant nightlife"},{id:"dallas",label:"Dallas, TX",subtitle:"Upscale venues & entertainment district"},{id:"houston",label:"Houston, TX",subtitle:"Diverse venues & cultural scene"},{id:"philadelphia",label:"Philadelphia, PA",subtitle:"Historic venues & nightlife"}],[]),{filterAge:Le,rawMinPrice:V,rawMaxPrice:ye,filterMinPriceValue:re,filterMaxPriceValue:ue,filterVenueType:z,filterAmenities:he,capacityMin:Oe,capacityMax:ze}=Da(),ut=r.get("sort"),Ue=ut&&["relevance","price_asc","price_desc","distance","rating"].includes(ut)?ut:"relevance",Ae=!!ee,Xe=Ue==="distance"&&!Ae?"relevance":Ue,Lt=!se&&z,At=d.useMemo(()=>({priceMin:re,priceMax:ue,venueType:Lt?z:void 0,amenities:he,ageRestriction:Le||void 0,capacity:Oe||ze?{min:Oe?parseInt(Oe,10):void 0,max:ze?parseInt(ze,10):void 0}:void 0}),[re,ue,Lt,z,he,Le,Oe,ze]),{searchResults:Et,venues:Ee,searchLoading:Pe,isFetching:Es,searchError:Pt,refetch:Tt,fetchNextPage:Rt,hasNextPage:$e,isFetchingNextPage:Ve}=Ba({location:l,geoSearchParams:O,effectiveQuery:I,sortBy:Xe,boundsSearchParams:ee,filters:At}),Ft=d.useCallback(()=>{$e&&!Ve&&Rt()},[$e,Ve,Rt]),ht=Xa({bounds:P??A,query:I,sort:Xe,filters:At}),mt=dr(),[ve,Ps]=d.useState(null),[Ge,Ts]=d.useState(null),we=d.useCallback(w=>{Ps(w)},[]),We=d.useCallback(w=>{Ts(w)},[]),Rs=d.useCallback(w=>w==="services"||w==="venues"?Xt(w,r):Xt("venues",r),[r]),Fs=d.useCallback(w=>{const C=new URLSearchParams(r),me=((w==null?void 0:w.query)??$).trim(),Ze=((w==null?void 0:w.location)??ke).trim(),Dt=((w==null?void 0:w.date)??ce).trim(),Ht=((w==null?void 0:w.guests)??ie).trim();me?C.set("q",me):C.delete("q"),Ze?C.set("location",Ze):C.delete("location"),Dt?C.set("date",Dt):C.delete("date"),Ht?C.set("guests",Ht):C.delete("guests"),i(`/venues?${C.toString()}`),j(!1)},[ie,ke,$,i,r,j,ce]),Is=d.useCallback(()=>{_(""),be(""),Ce(""),de("");const w=new URLSearchParams(r);w.delete("q"),w.delete("location"),w.delete("date"),w.delete("guests"),i(`/venues?${w.toString()}`)},[i,r]),_s=d.useCallback(w=>{be(w)},[]),Ds=w=>{const C=parseInt(ie||"0",10)||0,me=Math.max(0,C+w);de(me?String(me):"")},Ye=Es&&!!A,It=f&&m,qe=!f||!M,Hs=It?"60px":"68px",_t=d.useCallback(w=>{if(w==="distance"&&!Ae)return;const C=new URLSearchParams(r);w==="relevance"?C.delete("sort"):C.set("sort",w),i(`/venues?${C.toString()}`)},[r,i,Ae]),Bs=d.useCallback(w=>{const C=new URLSearchParams(r);w.packages.length>0?C.set("packages",w.packages.join(",")):C.delete("packages"),w.ageRestriction?C.set("age",w.ageRestriction):C.delete("age"),w.venueType&&w.venueType!=="all"?C.set("venueType",w.venueType):C.delete("venueType"),w.amenities.length>0?C.set("amenities",w.amenities.join(",")):C.delete("amenities"),w.capacityMin?C.set("capacityMin",w.capacityMin):C.delete("capacityMin"),w.capacityMax?C.set("capacityMax",w.capacityMax):C.delete("capacityMax");const me=w.minPrice==="0"||w.minPrice==="",Ze=w.maxPrice==="0"||w.maxPrice==="";!me||!Ze?(w.minPrice&&w.minPrice!=="0"?C.set("minPrice",w.minPrice):C.delete("minPrice"),w.maxPrice&&w.maxPrice!=="0"?C.set("maxPrice",w.maxPrice):C.delete("maxPrice")):(C.delete("minPrice"),C.delete("maxPrice")),i(`/venues?${C.toString()}`)},[i,r]),Qe=f&&y?e.jsx(La,{isOpen:y,onClose:()=>j(!1),mobileQuery:$,onQueryChange:_,locationInput:ke,onLocationInputChange:w=>{be(w),_(w)},whenValue:ce,onWhenChange:Ce,guestsValue:ie,onGuestsDelta:Ds,onSearch:()=>Fs(),onClearAll:Is,onSuggestionSelect:_s,categories:dt,suggestedLocations:Be,buildCategoryUrl:Rs}):null,Ke=It?e.jsx(Aa,{mobileQuery:$,location:l,date:c,guests:g,onOpenSearch:()=>{j(!0),window.scrollTo({top:0,behavior:"smooth"})},onOpenFilters:()=>S(!0),onBack:()=>i(-1)}):f&&!M?e.jsx(Rn,{onOpenSearch:()=>{j(!0),window.scrollTo({top:0,behavior:"smooth"})},searchQuery:$}):null,je=T;if(!m){if(Pe)return e.jsx(Je,{showSearch:!0,showFooter:qe,children:e.jsxs("div",{className:"min-h-screen bg-white",children:[Qe,Ke,e.jsx(Cs,{}),n&&e.jsx(xt,{})]})});if(Ee.length===0)return e.jsx(Je,{showSearch:!0,showFooter:qe,children:e.jsxs("div",{className:"min-h-screen bg-white",children:[Qe,Ke,e.jsx(Ms,{hasSearchParams:!1}),n&&e.jsx(xt,{})]})});const w=mt.sections.filter(C=>C.venues.length>0);return e.jsx(Je,{showSearch:!0,showFooter:qe,children:e.jsxs("div",{className:"flex flex-col min-h-[calc(100vh-82px)]",children:[Qe,Ke,e.jsx("div",{ref:s,className:"flex-1 px-6 py-6 min-h-0 relative",children:e.jsxs("div",{className:"relative w-full flex flex-col md:flex-row-reverse md:gap-8",style:{height:je},children:[e.jsx(Kt,{height:je,mapLocation:k,venues:mt.allVenues,markerVenues:ht,appliedBounds:A??gr,pendingBounds:P,boundsError:X,boundsLoading:Ye,onSearchHere:q,onBoundsChange:Q,highlightedVenueId:ve,selectedVenueId:Ge,onMarkerHoverChange:we,onMarkerClick:We,query:I,searchLoading:mt.loading,onToggleFullscreen:()=>L(!0),searchParamsKey:u}),e.jsx("div",{className:"scrollbar-hide w-full md:w-[65%] flex flex-col transition-[width] duration-500 ease-in-out",style:{maxHeight:je,overflowY:"auto",overflowX:"hidden"},children:e.jsx(Ea,{sections:w,additionalVenues:[],serializedSearchParams:h})})]})}),n&&e.jsx(xt,{})]})})}const Os=f&&m?!1:qe,zs=!(f&&m);return e.jsxs(Je,{showSearch:zs,onFilterClick:()=>S(!0),showFilters:!0,showFooter:Os,children:[e.jsxs("div",{className:"flex flex-col min-h-[calc(100vh-68px)]",children:[Qe,Ke,M?e.jsx(Fa,{isMobile:f,fullscreenTop:Hs,fullscreenHeight:N,fullscreenContainerRef:a,mapLocation:k,venues:Ee,markerVenues:ht,appliedBounds:A,pendingBounds:P,boundsError:X,boundsLoading:Ye,onSearchHere:q,onBoundsChange:Q,highlightedVenueId:ve,selectedVenueId:Ge,onMarkerHoverChange:we,onMarkerClick:We,query:I,searchLoading:Pe,onToggleFullscreen:()=>L(!1),searchParamsKey:u}):f&&m?e.jsx(nr,{mapLocation:k,venues:Ee,markerVenues:ht,appliedBounds:A,pendingBounds:P,boundsError:X,boundsLoading:Ye,onSearchHere:q,onBoundsChange:Q,highlightedVenueId:ve,selectedVenueId:Ge,onMarkerHoverChange:we,onMarkerClick:We,query:I,searchLoading:Pe,searchParamsKey:u,searchResults:Et||null,searchError:Pt,onRetry:Tt,sortBy:Ue,onSortChange:_t,effectiveSort:Xe,canSortByDistance:Ae,displayLocation:te,hasSearchParams:m,activeVenueId:ve,onVenueHighlight:we,serializedSearchParams:h,onLoadMore:Ft,hasNextPage:!!$e,isFetchingNextPage:Ve}):e.jsx("div",{ref:s,className:"flex-1 px-6 py-6 min-h-0 relative",children:e.jsxs("div",{className:"relative w-full flex flex-col md:flex-row-reverse md:gap-8",style:{height:je},children:[e.jsx(Kt,{height:je,mapLocation:k,venues:Ee,appliedBounds:A,pendingBounds:P,boundsError:X,boundsLoading:Ye,onSearchHere:q,onBoundsChange:Q,highlightedVenueId:ve,selectedVenueId:Ge,onMarkerHoverChange:we,onMarkerClick:We,query:I,searchLoading:Pe,onToggleFullscreen:()=>L(!0),searchParamsKey:u}),e.jsx("div",{ref:p,className:"scrollbar-hide w-full md:w-[65%] flex flex-col transition-[width] duration-500 ease-in-out md:opacity-100",style:{maxHeight:je,overflowY:"auto",overflowX:"hidden"},children:e.jsx(Ls,{searchResults:Et||null,venues:Ee,searchLoading:Pe,searchError:Pt,onRetry:Tt,displayLocation:te,query:I,sortBy:Ue,effectiveSort:Xe,canSortByDistance:Ae,onSortChange:_t,isMobile:f,hasSearchParams:m,activeVenueId:ve,onVenueHighlight:we,serializedSearchParams:h,onLoadMore:Ft,hasNextPage:!!$e,isFetchingNextPage:Ve,scrollRootRef:p})})]})})]}),b&&e.jsx(aa,{onClose:()=>S(!1),onApply:Bs,initialFilters:{packages:[],ageRestriction:Le,minPrice:V||void 0,maxPrice:ye||void 0,venueType:z,amenities:he,capacityMin:r.get("capacityMin")||void 0,capacityMax:r.get("capacityMax")||void 0}})]})};export{ri as default};