import{r as x,j as t,L as z,e as Te}from"./vendor-react-DgEFbQIi.js";import{a as k,S as Fe,C as Ee,j as Q,aX as fe,bj as be,aW as T,V as qe,bN as Oe,a_ as ge,u as ye,b4 as je,cP as we,cQ as ve,cR as Ne,c3 as $e,y as We,aY as Ve}from"./index-DFVuS8SP.js";import{i as ke}from"./claimRequests-54T7aAUE.js";import{O as ze}from"./OptimizedImage-BZrGLn_7.js";import{S as Ge,c as Ue,P as Pe}from"./badges-B7hHNwsz.js";import{a as He,g as Ke}from"./listingFeeInput-DmvcA6E5.js";import{r as Qe,g as Xe,s as Ye}from"./wishlists-NNbira8h.js";import{B as Me}from"./badge-check-D5e4IH5i.js";import{S as X}from"./star-C0MTo9W6.js";import{g as Ze}from"./listing-utils-CICni2H8.js";function Je({topLeftCornerRadius:e,topRightCornerRadius:s,bottomRightCornerRadius:a,bottomLeftCornerRadius:r,width:n,height:l}){const i={topLeft:-1,topRight:-1,bottomLeft:-1,bottomRight:-1},c={topLeft:e,topRight:s,bottomLeft:r,bottomRight:a};return Object.entries(c).sort(([,o],[,p])=>p-o).forEach(([o,p])=>{const m=o,f=et[m],g=Math.min(...f.map(u=>{const d=c[u.corner];if(p===0&&d===0)return 0;const h=i[u.corner],j=u.side==="top"||u.side==="bottom"?n:l;return h>=0?j-i[u.corner]:p/(p+d)*j}));i[m]=g,c[m]=Math.min(p,g)}),{topLeft:{radius:c.topLeft,roundingAndSmoothingBudget:i.topLeft},topRight:{radius:c.topRight,roundingAndSmoothingBudget:i.topRight},bottomLeft:{radius:c.bottomLeft,roundingAndSmoothingBudget:i.bottomLeft},bottomRight:{radius:c.bottomRight,roundingAndSmoothingBudget:i.bottomRight}}}var et={topLeft:[{corner:"topRight",side:"top"},{corner:"bottomLeft",side:"left"}],topRight:[{corner:"topLeft",side:"top"},{corner:"bottomRight",side:"right"}],bottomLeft:[{corner:"bottomRight",side:"bottom"},{corner:"topLeft",side:"left"}],bottomRight:[{corner:"bottomLeft",side:"bottom"},{corner:"topRight",side:"right"}]};function V({cornerRadius:e,cornerSmoothing:s,preserveSmoothing:a,roundingAndSmoothingBudget:r}){let n=(1+s)*e;if(!a){const d=r/e-1;s=Math.min(s,d),n=Math.min(n,r)}const l=90*(1-s),i=Math.sin(K(l/2))*e*Math.sqrt(2),c=(90-l)/2,o=e*Math.tan(K(c/2)),p=45*s,m=o*Math.cos(K(p)),f=m*Math.tan(K(p));let g=(n-i-m-f)/3,u=2*g;if(a&&n>r){const d=r-f-i-m,h=d/6,j=d-h;g=Math.min(g,j),u=d-g,n=Math.min(n,r)}return{a:u,b:g,c:m,d:f,p:n,arcSectionLength:i,cornerRadius:e}}function he({width:e,height:s,topLeftPathParams:a,topRightPathParams:r,bottomLeftPathParams:n,bottomRightPathParams:l}){return`
    M ${e-r.p} 0
    ${tt(r)}
    L ${e} ${s-l.p}
    ${st(l)}
    L ${n.p} ${s}
    ${at(n)}
    L 0 ${a.p}
    ${nt(a)}
    Z
  `.replace(/[\t\s\n]+/g," ").trim()}function tt({cornerRadius:e,a:s,b:a,c:r,d:n,p:l,arcSectionLength:i}){return e?B`
    c ${s} 0 ${s+a} 0 ${s+a+r} ${n}
    a ${e} ${e} 0 0 1 ${i} ${i}
    c ${n} ${r}
        ${n} ${a+r}
        ${n} ${s+a+r}`:B`l ${l} 0`}function st({cornerRadius:e,a:s,b:a,c:r,d:n,p:l,arcSectionLength:i}){return e?B`
    c 0 ${s}
      0 ${s+a}
      ${-n} ${s+a+r}
    a ${e} ${e} 0 0 1 -${i} ${i}
    c ${-r} ${n}
      ${-(a+r)} ${n}
      ${-(s+a+r)} ${n}`:B`l 0 ${l}`}function at({cornerRadius:e,a:s,b:a,c:r,d:n,p:l,arcSectionLength:i}){return e?B`
    c ${-s} 0
      ${-(s+a)} 0
      ${-(s+a+r)} ${-n}
    a ${e} ${e} 0 0 1 -${i} -${i}
    c ${-n} ${-r}
      ${-n} ${-(a+r)}
      ${-n} ${-(s+a+r)}`:B`l ${-l} 0`}function nt({cornerRadius:e,a:s,b:a,c:r,d:n,p:l,arcSectionLength:i}){return e?B`
    c 0 ${-s}
      0 ${-(s+a)}
      ${n} ${-(s+a+r)}
    a ${e} ${e} 0 0 1 ${i} -${i}
    c ${r} ${-n}
      ${a+r} ${-n}
      ${s+a+r} ${-n}`:B`l 0 ${-l}`}function K(e){return e*Math.PI/180}function B(e,...s){return e.reduce((a,r,n)=>{const l=s[n];return typeof l=="number"?a+r+l.toFixed(4):a+r+(l??"")},"")}function rt({cornerRadius:e=0,topLeftCornerRadius:s,topRightCornerRadius:a,bottomRightCornerRadius:r,bottomLeftCornerRadius:n,cornerSmoothing:l,width:i,height:c,preserveSmoothing:o=!1}){if(s=s??e,a=a??e,n=n??e,r=r??e,s===a&&a===r&&r===n&&n===s){const u=Math.min(i,c)/2,d=Math.min(s,u),h=V({cornerRadius:d,cornerSmoothing:l,preserveSmoothing:o,roundingAndSmoothingBudget:u});return he({width:i,height:c,topLeftPathParams:h,topRightPathParams:h,bottomLeftPathParams:h,bottomRightPathParams:h})}const{topLeft:p,topRight:m,bottomLeft:f,bottomRight:g}=Je({topLeftCornerRadius:s,topRightCornerRadius:a,bottomRightCornerRadius:r,bottomLeftCornerRadius:n,width:i,height:c});return he({width:i,height:c,topLeftPathParams:V({cornerSmoothing:l,preserveSmoothing:o,cornerRadius:p.radius,roundingAndSmoothingBudget:p.roundingAndSmoothingBudget}),topRightPathParams:V({cornerSmoothing:l,preserveSmoothing:o,cornerRadius:m.radius,roundingAndSmoothingBudget:m.roundingAndSmoothingBudget}),bottomRightPathParams:V({cornerSmoothing:l,preserveSmoothing:o,cornerRadius:g.radius,roundingAndSmoothingBudget:g.roundingAndSmoothingBudget}),bottomLeftPathParams:V({cornerSmoothing:l,preserveSmoothing:o,cornerRadius:f.radius,roundingAndSmoothingBudget:f.roundingAndSmoothingBudget})})}function _e({cornerRadius:e=16,cornerSmoothing:s=1}={}){const a=x.useRef(null),[r,n]=x.useState();return x.useLayoutEffect(()=>{const l=a.current;if(!l)return;const i=()=>{const{width:o,height:p}=l.getBoundingClientRect();if(o===0||p===0)return;const m=rt({width:o,height:p,cornerRadius:e,cornerSmoothing:s});n({clipPath:`path('${m}')`})};i();const c=new ResizeObserver(i);return c.observe(l),()=>c.disconnect()},[e,s]),{ref:a,style:r}}function it(e){const[s,a]=x.useState(0),[r,n]=x.useState({}),l=x.useCallback(c=>{const o=e.length;if(o===0)return;const p=(c%o+o)%o;a(p)},[e.length]),i=x.useCallback(c=>{n(o=>o[c]?o:{...o,[c]:!0})},[]);return{activeIndex:s,setActiveIndex:a,goToIndex:l,loadedImages:r,markLoaded:i,hasMultipleImages:e.length>1}}const ot=({count:e,activeIndex:s,onSelect:a,className:r})=>{const n=e>5?(()=>{let o=0;return s<=2?o=0:s>=e-2?o=e-5:o=s-2,`translateX(${-o*14}px)`})():"translateX(0)";return t.jsx("div",{className:k("absolute inset-x-0 bottom-2.5 z-20 flex items-center justify-center overflow-hidden",r),children:t.jsx("div",{className:"relative w-[68px] h-2 flex items-center justify-start overflow-hidden",children:t.jsx("div",{className:"flex items-center gap-1.5 transition-transform duration-300 ease-out",style:{transform:n},children:Array.from({length:e}).map((l,i)=>t.jsx("button",{type:"button","aria-label":`Go to photo ${i+1} of ${e}`,onClick:c=>{c.preventDefault(),c.stopPropagation(),a(i)},className:k("h-2 w-2 rounded-full border border-white/60 transition flex-shrink-0",i===s?"bg-white shadow":"bg-white/40 hover:bg-white/70")},i))})})})},Le=({images:e,alt:s,emptyState:a,showGradientOverlay:r=!1,alwaysShowControls:n=!1,topLeft:l,topRight:i})=>{const{activeIndex:c,setActiveIndex:o,goToIndex:p,loadedImages:m,markLoaded:f,hasMultipleImages:g}=it(e),u=k("absolute top-1/2 z-20 grid h-7 w-7 -translate-y-1/2 place-items-center rounded-full glass glass-overlay text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-black",n?"opacity-100":"opacity-0 group-hover:opacity-100");return t.jsxs(t.Fragment,{children:[e.length>0?t.jsxs(t.Fragment,{children:[e.map((d,h)=>t.jsx(ze,{src:d,alt:s,variant:"medium",className:k("absolute inset-0 h-full w-full object-cover rounded-t-2xl transition-opacity duration-500",h===c&&m[h]?"opacity-100":"opacity-0"),loading:h===0?"eager":"lazy",decoding:"async",onLoad:()=>f(h),onError:()=>f(h)},d+h.toString())),!m[c]&&t.jsx("div",{className:"absolute inset-0",children:t.jsx(Fe,{className:"h-full w-full rounded-none"})})]}):a??null,r&&t.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 via-black/0 to-black/0 opacity-0 group-hover:opacity-100 transition-opacity duration-300"}),l,i,g&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button","aria-label":"View previous photo",onClick:d=>{d.preventDefault(),d.stopPropagation(),p(c-1)},className:k(u,"left-2.5"),children:t.jsx(Ee,{className:"h-4 w-4"})}),t.jsx("button",{type:"button","aria-label":"View next photo",onClick:d=>{d.preventDefault(),d.stopPropagation(),p(c+1)},className:k(u,"right-2.5"),children:t.jsx(Q,{className:"h-4 w-4"})}),t.jsx(ot,{count:e.length,activeIndex:c,onSelect:o,className:k("transition-opacity duration-200",n?"opacity-100":"opacity-0 group-hover:opacity-100")})]})]})},Ce=({open:e,onOpenChange:s,listingId:a,listingTitle:r,listingImageUrl:n,onAfterChange:l})=>t.jsx(Ge,{open:e,onOpenChange:s,listingId:a,listingTitle:r,listingImageUrl:n,onSavedChange:()=>{l(),window.dispatchEvent(new CustomEvent("savedVenuesChanged"))}});function lt(e){switch(e.toLowerCase()){case"per_person":case"per-person":case"person":case"guest":return{long:"per person",short:"/person"};case"per_person_per_hour":case"person-hour":case"person_hour":return{long:"per person per hour",short:"/person/hr"};case"per_event":case"per-event":case"event":case"flat":return{long:"per event",short:"event"};case"per_day":case"per-day":case"day":return{long:"per day",short:"/day"};case"per_hour":case"per-hour":case"hour":case"hourly":default:return{long:"per hour",short:"/hr"}}}const ct=new Set(["per_person","per_person_per_hour"]);function Se(e){var u;const s=x.useMemo(()=>He(e.rawListing??null),[e.rawListing]),a=x.useMemo(()=>e.feeInput??Ke(e.rawListing??null,s),[s,e.feeInput,e.rawListing]),r=(u=e.packages)==null?void 0:u[0],n=typeof e.baseRate=="number"&&Number.isFinite(e.baseRate)&&e.baseRate>0,l=x.useMemo(()=>{let d;for(const h of e.packages??[]){if(ct.has((h==null?void 0:h.priceType)??""))continue;const j=fe(h);j!==null&&(!d||j<d.amount)&&(d={pkg:h,amount:j})}return d},[e.packages]),i=!n&&l===void 0?be(e):null,c=n||i!==null?r:l==null?void 0:l.pkg,o=(c==null?void 0:c.pricingMode)??"fixed",p=o==="negotiable_range",m=n?e.baseRate:(l==null?void 0:l.amount)??i??void 0,f=x.useMemo(()=>{const d=n?e.priceUnit||"per_hour":(c==null?void 0:c.priceType)||e.priceUnit||"per_hour";return lt(d)},[n,c==null?void 0:c.priceType,e.priceUnit]),g=T(m)??void 0;return{priceAmount:m,priceDisplay:g,unitLabels:f,feeInput:a,primaryPackage:r,hasDisplayBaseRate:n,pricingMode:o,requiresCustomQuote:p}}function Ie(e){const{listingId:s,redirectTarget:a,isFavoritedOverride:r,onFavoriteClick:n}=e,{user:l,loading:i,isAuthReady:c}=qe(),o=Qe(l),[p,m]=x.useState(!1),[f,g]=x.useState(null),[u,d]=x.useState(!1),h=x.useRef(o),j=x.useRef(0);h.current=o;const v=r!==void 0,w=x.useCallback(async()=>{const L=++j.current;if(v||!s||!l||!o||!c||i){m(!1),g(null);return}try{const A=await Xe(o,s);if(L!==j.current||h.current!==o)return;m(A.length>0),g(o)}catch(A){if(L!==j.current||h.current!==o)return;console.warn("Failed to check saved status:",A),m(!1),g(o)}},[i,c,v,s,o,l]);x.useEffect(()=>{w()},[w]),x.useEffect(()=>{d(!1)},[i,c,o]),x.useEffect(()=>{if(!(!o||!c||i||v))return Ye(o,()=>{w()})},[i,w,c,v,o]);const S=x.useCallback(L=>{if(L.preventDefault(),L.stopPropagation(),L.nativeEvent.stopImmediatePropagation(),n){n(L);return}if(s&&!(!c||i)){if(!l){typeof window<"u"&&(sessionStorage.setItem("postAuthRedirect",a),window.dispatchEvent(new CustomEvent("openAuthModal")));return}o&&d(!0)}},[i,c,s,n,o,a,l]),P=!!o&&c&&!i;return{isSaved:P?v?r:f===o?p:!1:!1,showWishlistModal:P&&u,setShowWishlistModal:d,handleSaveClick:S,checkSavedStatus:w}}const dt=6;function Ae(e,s={}){const{dedupeByContentKey:a=!1,fallback:r}=s,n=new Set,l=new Set,i=[];for(const c of e){const o=c==null?void 0:c.trim();if(o&&!n.has(o)){if(a){const p=Oe(o);if(l.has(p))continue;l.add(p)}n.add(o),i.push(o)}}return i.length===0?r?[r]:[]:i.slice(0,dt)}function te(e){var i,c;const{stats:s,rawListing:a,preferGoogle:r=!1}=e,n=(s==null?void 0:s.userRatingCount)??(s==null?void 0:s.reviewCount)??null;if(r){const o=(a==null?void 0:a.enableGoogleReviews)&&(((i=a==null?void 0:a.googleReviews)==null?void 0:i.totalReviews)??0)>0,p=(c=a==null?void 0:a.googleReviews)==null?void 0:c.avgRating;if(o&&p!=null&&p>0)return{rating:p.toFixed(1),reviewCount:n};const m=(s==null?void 0:s.averageRating)??(s==null?void 0:s.rating);return{rating:m!=null&&m>0?m.toFixed(1):null,reviewCount:n}}const l=(s==null?void 0:s.rating)??(s==null?void 0:s.averageRating);return{rating:l!=null&&l>0?l.toFixed(1):null,reviewCount:n}}function pt(e,s){return[e,s].filter(Boolean).join(", ")||void 0}function ut(e){var n,l;if(e.capacityLabel)return e.capacityLabel;const s=i=>typeof i=="number"&&Number.isFinite(i)&&i>0?Math.round(i):void 0,a=s((n=e.capacity)==null?void 0:n.min)??1,r=s((l=e.capacity)==null?void 0:l.max);return r&&r>=a?`${a}–${r} guests`:`${a}+ guests`}function Re(e,s={}){const{typeAllowList:a,plecMetadataFallback:r}=s;let n=[];return e?n=Ue(e).filter(l=>!(!l.showOnCard||a&&!a.includes(l.type))):r&&r.isFeatured&&n.push({type:"plec_featured",label:"Featured",priority:1,category:"plec",showOnCard:!0}),n.sort((l,i)=>l.priority-i.priority),n.slice(0,1)}function se(e){const s=`/${e.kind}/${e.id}`;return e.searchQuery&&e.searchQuery.length>0?`${s}?${e.searchQuery}`:s}const mt=({venue:e,className:s,searchQuery:a,hideOverlays:r=!1})=>{var F,E,q,J;const n=x.useMemo(()=>Ae([e.main_image,...e.galleryImages??[]],{fallback:$e}),[e.main_image,e.galleryImages]),[l,i]=x.useState(!1),c=e.id||((F=e.rawListing)==null?void 0:F.listingId),{isSaved:o,showWishlistModal:p,setShowWishlistModal:m,handleSaveClick:f,checkSavedStatus:g}=Ie({listingId:c,redirectTarget:`/venue/${c}`}),{priceAmount:u,priceDisplay:d,unitLabels:h,requiresCustomQuote:j,hasDisplayBaseRate:v}=Se(e),w=x.useMemo(()=>!e.packages||e.packages.length===0?!1:e.packages.filter(b=>{const $=b.name&&typeof b.name=="string"&&b.name.trim().length>0,ee=b.minPrice!==void 0&&b.minPrice>0||b.price_per_person!==void 0&&b.price_per_person>0;return $||ee}).length>0,[e.packages]),S=se({kind:"venue",id:e.id,searchQuery:a}),{rating:P}=te({stats:e.stats,rawListing:e.rawListing,preferGoogle:!0}),L=x.useMemo(()=>{const N=[];u!=null&&d&&N.push({label:v?"Base rate":"Starting at",value:`${d} ${h.long}`});const b=e.pricingDetails;if(b!=null&&b.minimumHours&&b.minimumHours>0){const $=b.minimumHours;N.push({label:"Minimum booking",value:`${$} hour${$===1?"":"s"}`})}if((b==null?void 0:b.cleaningFee)!=null){const $=ge(b).cleaningFee;$!==null&&N.push({label:"Cleaning fee",value:T($)??"—"})}if((b==null?void 0:b.overtimeRate)!=null&&b.overtimeRate>0){const $=ge(b).overtimeRate;$!==null&&N.push({label:"Overtime rate (if applicable)",value:T($)??"—"})}return N},[u,d,h.long,e.pricingDetails,v]),A=(E=e.pricingDetails)==null?void 0:E.pricingNotes,G=x.useMemo(()=>Re(e.rawListing??null,{typeAllowList:["plec_featured"],plecMetadataFallback:e.plecMetadata}),[e.rawListing,e.plecMetadata]),Y=typeof e.verified=="boolean"?e.verified:e.rawListing?ke(e.rawListing):!1,C=ye(),{ref:Z,style:U}=_e();return t.jsxs(z,{to:S,target:C?void 0:"_blank",rel:C?void 0:"noopener noreferrer",className:k("group flex flex-col rounded-2xl bg-white transition-all duration-200",s),children:[t.jsxs("div",{ref:Z,style:U,className:"relative aspect-square w-full overflow-hidden rounded-2xl bg-gradient-to-br from-gray-100 to-gray-200 isolate",children:[t.jsx(Le,{images:C?n.slice(0,1):n,alt:e.name,topLeft:t.jsx("div",{className:"absolute left-3 top-3 z-10 flex items-start gap-1.5",children:!r&&e.venue_type&&t.jsx("span",{className:"glass rounded-full px-3 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-gray-800",style:{"--glass-tint-opacity":"0.85"},children:e.venue_type.replace(/_/g," ")})}),topRight:!r&&(!e.rawListing||((q=e.rawListing)==null?void 0:q.status)==="published")?t.jsx("button",{type:"button",onClick:f,className:k("glass glass-overlay absolute right-3 top-3 z-20 flex h-9 w-9 items-center justify-center rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand",o?"text-brand hover:bg-brand/10":"text-gray-700 hover:bg-brand hover:text-white"),"aria-label":o?"Remove from favorites":"Save to favorites",children:t.jsx(je,{className:k("h-4 w-4",o&&"fill-current")})}):void 0}),C&&r&&G.length>0&&t.jsx("span",{className:"glass absolute left-3 top-3 z-10 inline-flex items-center rounded-full px-2.5 py-1 text-[11px] font-semibold text-amber-700",style:{"--glass-tint-opacity":"0.7"},children:"Featured"})]}),t.jsxs("div",{className:"flex flex-1 flex-col gap-0.5 pt-2 px-0.5 pb-3 md:px-1.5 bg-white rounded-b-2xl",children:[t.jsxs("h3",{className:"flex items-center gap-1 text-sm font-medium leading-tight text-gray-900 min-w-0",children:[t.jsx("span",{className:"line-clamp-2 min-w-0",children:(J=e.highlights)!=null&&J.title?t.jsx("span",{dangerouslySetInnerHTML:{__html:e.highlights.title}}):e.name}),Y&&t.jsx(Me,{className:"h-3.5 w-3.5 flex-shrink-0 text-blue-500","aria-label":"Verified"}),G.length>0&&!(C&&r)&&t.jsx("span",{className:"inline-flex flex-shrink-0 items-center rounded-md bg-amber-50 px-1.5 py-0.5 text-[10px] font-medium leading-none text-amber-700",children:"Featured"})]}),e.neighborhood&&t.jsx("p",{className:"truncate text-[11px] leading-tight text-muted-foreground",children:e.neighborhood}),t.jsxs("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-[10px] font-medium leading-tight text-muted-foreground",children:[d?t.jsxs(we,{open:l,onOpenChange:i,children:[t.jsx(ve,{asChild:!0,children:t.jsxs("button",{type:"button",onClick:N=>{N.preventDefault(),i(b=>!b)},className:"group/price flex flex-wrap items-center gap-x-0.5 text-left transition-all duration-200 rounded-md px-1 py-0.5 -ml-1.5 group-hover:bg-brand/5 hover:bg-brand/10 hover:scale-[1.04] active:scale-100 text-[10px]",children:[t.jsxs("span",{className:"flex items-center gap-0.5",children:[w&&t.jsx(Pe,{className:"h-3 w-3 text-gray-500 group-hover:text-brand transition-colors shrink-0"}),t.jsx("span",{className:"font-normal text-gray-500 group-hover:text-brand transition-colors",children:v?"from":"Starting at"})]}),t.jsxs("span",{className:"flex flex-wrap items-center gap-x-0.5",children:[t.jsx("span",{className:"font-semibold text-gray-900 underline decoration-1 underline-offset-2 group-hover:text-brand transition-colors",children:d}),t.jsxs("span",{className:"flex items-center gap-0.5",children:[t.jsx("span",{className:"text-gray-600 whitespace-nowrap group-hover:text-brand transition-colors",children:h.short||h.long}),t.jsx(Q,{className:"h-3 w-3 text-gray-400 opacity-0 group-hover:opacity-100 group-hover:text-brand transition-all duration-200 shrink-0 translate-x-[-2px] group-hover:translate-x-0"})]})]})]})}),t.jsx(Ne,{align:"start",side:"top",sideOffset:10,className:"w-56 rounded-xl border border-border/60 shadow-lg p-3 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:slide-in-from-bottom-2 data-[state=closed]:slide-out-to-bottom-2",children:t.jsxs("div",{className:"space-y-2.5 text-[13px]",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:"Price breakdown"}),A?t.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground line-clamp-3 min-w-0 break-words overflow-hidden",children:A}):null]}),t.jsxs("div",{className:"space-y-1.5",children:[L.map(N=>t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{className:"text-muted-foreground text-[11px]",children:N.label}),t.jsx("span",{className:"font-medium text-gray-900 text-sm",children:N.value})]},N.label)),L.length===0?t.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Host has not listed additional fees for this venue."}):null]}),w&&t.jsx(t.Fragment,{children:t.jsx("div",{className:"border-t border-gray-200 pt-2.5 mt-2.5",children:t.jsxs(z,{to:a&&a.length>0?`/venue/${e.id}?${a}`:`/venue/${e.id}`,target:C?void 0:"_blank",rel:C?void 0:"noopener noreferrer",className:"flex items-center justify-between gap-2 text-[11px] font-medium text-brand hover:text-brand-600 transition-colors group/link",onClick:N=>{N.stopPropagation(),i(!1)},children:[t.jsx("span",{children:"View packages available"}),t.jsx(Q,{className:"h-3 w-3 transform group-hover/link:translate-x-0.5 transition-transform"})]})})})]})})]}):t.jsx("span",{className:"font-semibold text-gray-900",children:"Price on request"}),j&&t.jsx("span",{className:"inline-flex items-center rounded-full bg-brand/10 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-brand",children:"Request a Quote"}),t.jsxs("span",{className:"flex items-center gap-0.5 text-gray-600 shrink-0",children:[t.jsx(X,{className:"h-2.5 w-2.5 text-gray-400"}),t.jsx("span",{className:"text-[10px]",children:P??"New"})]})]})]}),t.jsx(Ce,{open:p,onOpenChange:m,listingId:c??"",listingTitle:e.name,listingImageUrl:n[0],onAfterChange:g})]})},xe=e=>{if(!e)return null;const s=e.pricingMode??"fixed";return s==="negotiable_range"||s==="self_service_range"?fe(e):Ve(e)},gt=({service:e,className:s,searchQuery:a,hideOverlays:r=!1,isPreview:n=!1,disableNavigation:l=!1,alwaysShowCarouselControls:i=!1})=>{var oe,le,ce,de;const o=Ze(e)??{},p=o.serviceType,m=We.find(y=>y.id===p),f=o.serviceData??{},g=x.useMemo(()=>f.offerings??[],[f.offerings]),u=g[0],[d,h]=x.useState(!1),j=x.useMemo(()=>!g||g.length===0?!1:g.filter(_=>{const M=_.name&&typeof _.name=="string"&&_.name.trim().length>0,R=_.price!==void 0&&_.price>0;return M||R}).length>0,[g]),v=x.useMemo(()=>{var _,M,R;const y=[f.coverImage,(_=o.media)==null?void 0:_.coverImage,...((R=(M=o.media)==null?void 0:M.gallery)==null?void 0:R.filter(I=>I.type==="photo"&&I.url).map(I=>I.url))??[],...(g==null?void 0:g.map(I=>I.image))??[]];return Ae(y,{dedupeByContentKey:!0})},[f.coverImage,(oe=o.media)==null?void 0:oe.coverImage,(le=o.media)==null?void 0:le.gallery,g]),w=ye(),S=e.listingId,{isSaved:P,showWishlistModal:L,setShowWishlistModal:A,handleSaveClick:G,checkSavedStatus:Y}=Ie({listingId:S,redirectTarget:`/service/${S}`}),C=f.cardTitle,Z=(ce=f==null?void 0:f.businessInfo)==null?void 0:ce.businessName,U=C!=null&&C.trim()!=="",F=U?C:n?"Enter listing title":Z||(u==null?void 0:u.name)||`${(m==null?void 0:m.label)||"Service"}${(de=o.location)!=null&&de.city?` in ${o.location.city}`:""}`,E=p==="chartered_bus"?e.fromPricePerMile:void 0,q=typeof E=="number"&&E>0,N=((u==null?void 0:u.pricingMode)??"fixed")==="negotiable_range",b=xe(u)??be(e),$=u==null?void 0:u.priceType,ee=$==="per_person"||$==="per_guest"?" / person":$==="per_group_with_hours"?" / group":$==="per_hour"?" / hour":$==="fixed"?" / event":"",H=q?`${T(E)}/mile`:b!==null?`${T(b)}${ee}`:null,ae=x.useMemo(()=>Re(e,{typeAllowList:["plec_featured"]}),[e]),{rating:ne}=te({rawListing:e,preferGoogle:!0}),re=k("group flex flex-col rounded-2xl bg-white transition-all duration-200",s),{ref:Be,style:De}=_e(),ie=t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:Be,style:De,className:"relative aspect-square w-full overflow-hidden rounded-2xl bg-gradient-to-br from-gray-100 to-gray-200 isolate",children:t.jsx(Le,{images:w?v.slice(0,1):v,alt:F,showGradientOverlay:!0,alwaysShowControls:i,emptyState:t.jsx("div",{className:"flex h-full w-full items-center justify-center text-6xl",children:(m==null?void 0:m.icon)||"✨"}),topLeft:w&&r&&ae.length>0?t.jsx("span",{className:"glass absolute left-3 top-3 z-10 inline-flex items-center rounded-full px-2.5 py-1 text-[11px] font-semibold text-amber-700",style:{"--glass-tint-opacity":"0.7"},children:"Featured"}):null,topRight:!r&&(e==null?void 0:e.status)==="published"?t.jsx("button",{type:"button",onClick:G,className:k("glass glass-overlay absolute right-3 top-3 z-20 flex h-9 w-9 items-center justify-center rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand",P?"text-brand hover:bg-brand/10":"text-gray-700 hover:bg-brand hover:text-white"),"aria-label":P?"Remove from favorites":"Save to favorites",children:t.jsx(je,{className:k("h-4 w-4",P&&"fill-current")})}):null})}),t.jsxs("div",{className:"flex flex-1 flex-col gap-0.5 pt-2 px-0.5 pb-3 md:px-1.5 bg-white rounded-b-2xl",children:[t.jsxs("h3",{className:"flex items-center gap-1 text-sm font-medium leading-tight min-w-0",children:[t.jsx("span",{className:k("line-clamp-2 min-w-0 pr-1 transition-colors",n&&!U?"text-muted-foreground italic":"text-gray-900"),children:F}),ke(e)&&t.jsx(Me,{className:"h-3.5 w-3.5 flex-shrink-0 text-blue-500","aria-label":"Verified"}),ae.length>0&&!(w&&r)&&t.jsx("span",{className:"inline-flex flex-shrink-0 items-center rounded-md bg-amber-50 px-1.5 py-0.5 text-[10px] font-medium leading-none text-amber-700",children:"Featured"})]}),t.jsxs("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-[10px] text-gray-600 leading-tight",children:[j&&!q?t.jsxs(we,{open:d,onOpenChange:h,children:[t.jsx(ve,{asChild:!0,children:t.jsxs("button",{type:"button",onClick:y=>{y.preventDefault(),y.stopPropagation(),h(!0)},className:"group/price flex flex-wrap items-center gap-x-1 text-left transition-all duration-200 rounded-md px-1.5 py-0.5 -ml-1.5 group-hover:bg-brand/5 hover:bg-brand/10 hover:scale-[1.04] active:scale-100",children:[t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(Pe,{className:"h-3 w-3 text-gray-500 group-hover:text-brand transition-colors shrink-0"}),H&&t.jsx("span",{className:"font-normal text-gray-500 group-hover:text-brand transition-colors",children:"from"})]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"font-semibold text-gray-900 underline decoration-1 underline-offset-2 group-hover:text-brand transition-colors",children:H??"Price on request"}),t.jsx(Q,{className:"h-3 w-3 text-gray-400 opacity-0 group-hover:opacity-100 group-hover:text-brand transition-all duration-200 transform group-hover:translate-x-0 translate-x-[-4px] shrink-0"})]})]})}),t.jsx(Ne,{align:"start",side:"top",sideOffset:10,className:"w-64 rounded-xl border border-border/60 shadow-lg p-4 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0",children:t.jsxs("div",{className:"space-y-3",children:[t.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:"Available Offerings"}),t.jsx("div",{className:"space-y-2.5",children:g.filter(y=>{const _=y.name&&typeof y.name=="string"&&y.name.trim().length>0,M=y.price!==void 0&&y.price>0;return _||M}).map(y=>{var ue,me;const _=xe(y);let M;y.priceType==="per_event"||y.priceType==="fixed"?M="per event":y.priceType==="per_guest"||y.priceType==="per_person"?M="per person":y.priceType==="per_group_with_hours"?M="per group":y.priceType==="per_hour"?M="per hour":M="";let R;_!==null?R=`${T(_)}${M?` ${M}`:""}`:R="Price on request";const I=y.name,pe=y.description,O=(ue=y.guestLimit)==null?void 0:ue.min,W=(me=y.guestLimit)==null?void 0:me.max,D=y.duration;return t.jsxs("div",{className:"rounded-lg border border-gray-200 bg-gray-50 p-3",children:[I&&t.jsx("h4",{className:"text-[13px] font-semibold text-gray-900 mb-1",children:I}),t.jsx("div",{className:"flex items-center justify-between gap-2",children:t.jsx("span",{className:"text-[13px] font-medium text-gray-900",children:R})}),pe&&t.jsx("p",{className:"mt-1.5 text-[11px] text-muted-foreground line-clamp-2",children:pe}),(O||W)&&t.jsx("p",{className:"mt-1 text-[10px] text-muted-foreground",children:O&&W?`${O}-${W} guests`:O?`${O}+ guests`:W?`Up to ${W} guests`:""}),D&&(D.hours>0||D.minutes>0)&&t.jsxs("p",{className:"mt-1 text-[10px] text-muted-foreground",children:[D.hours>0&&`${D.hours}h `,D.minutes>0&&`${D.minutes}m`]})]},y.id)})})]})})]}):H?t.jsxs("span",{className:"flex flex-wrap items-center gap-x-1",children:[t.jsx("span",{className:"font-normal text-gray-500",children:"from"}),t.jsx("span",{className:"font-semibold text-gray-900 underline decoration-1 underline-offset-2",children:H})]}):t.jsx("span",{className:"font-semibold text-gray-900",children:"Price on request"}),N&&t.jsx("span",{className:"inline-flex items-center rounded-full bg-brand/10 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-brand",children:"Request a Quote"}),ne&&t.jsxs("span",{className:"flex items-center gap-0.5 text-gray-600 shrink-0",children:[t.jsx(X,{className:"h-2.5 w-2.5 text-gray-400"}),t.jsx("span",{className:"text-[10px]",children:ne})]})]})]}),t.jsx(Ce,{open:L,onOpenChange:A,listingId:S??"",listingTitle:F,listingImageUrl:v[0],onAfterChange:Y})]});return l?t.jsx("div",{className:re,children:ie}):t.jsx(z,{to:se({kind:"service",id:e.listingId,searchQuery:a}),target:w?void 0:"_blank",rel:w?void 0:"noopener noreferrer",className:re,children:ie})},ht=$e,xt=({venue:e,searchQuery:s,className:a,variant:r="default"})=>{var v,w,S;const n=Te(),l=e.main_image||((v=e.galleryImages)==null?void 0:v[0])||ht,{rating:i,reviewCount:c}=te({stats:e.stats}),{priceAmount:o,unitLabels:p,hasDisplayBaseRate:m}=Se(e),f=m?"from ":"Starting at ",g=o!=null?`${T(o)}${p.short}`:void 0,u=e.capacityLabel||(w=e.capacity)!=null&&w.min?ut({capacityLabel:e.capacityLabel,capacity:e.capacity}):void 0,d=pt(e.city,e.state)??"",h=(e.listingKind||((S=e.rawListing)==null?void 0:S.listingKind))==="service"?"service":"venue",j=se({kind:h,id:e.id,searchQuery:s});return r==="compact"?t.jsxs(z,{to:j,className:k("flex h-[104px] overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm transition-shadow hover:shadow-md",a),onClick:P=>P.stopPropagation(),children:[t.jsxs("div",{className:"relative h-full w-[88px] shrink-0 overflow-hidden bg-gray-100",children:[t.jsx("img",{src:l,alt:e.name,className:"h-full w-full object-cover",loading:"lazy",decoding:"async"}),e.venue_type&&t.jsx("span",{className:"absolute left-1.5 top-1.5 max-w-[calc(100%-0.75rem)] truncate rounded-full bg-white/90 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-gray-800 shadow-sm",children:e.venue_type.replace(/_/g," ")})]}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col justify-between p-2.5",children:[t.jsxs("div",{className:"min-w-0 space-y-1.5",children:[t.jsx("h3",{className:"truncate text-sm font-semibold leading-tight text-gray-900",children:e.name}),g&&t.jsxs("p",{className:"truncate text-xs text-gray-700",children:[t.jsx("span",{className:"font-normal text-gray-500",children:f}),t.jsx("span",{className:"font-bold text-gray-900",children:g})]}),t.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 overflow-hidden text-[11px] text-gray-500",children:[u&&t.jsx("span",{className:"shrink-0",children:u}),u&&d&&t.jsx("span",{"aria-hidden":"true",children:"·"}),d&&t.jsx("span",{className:"truncate",children:d})]})]}),i&&t.jsxs("div",{className:"flex items-center gap-1 text-xs font-medium text-gray-700",children:[t.jsx(X,{className:"h-3 w-3 fill-yellow-400 text-yellow-400"}),t.jsx("span",{children:i}),c!=null&&c>0&&t.jsxs("span",{className:"text-[10px] text-gray-500",children:["(",c,")"]})]})]})]}):t.jsxs(z,{to:j,className:k("block bg-white rounded-lg overflow-hidden shadow-lg border border-gray-200 hover:shadow-xl transition-shadow",a),onClick:P=>P.stopPropagation(),children:[t.jsxs("div",{className:"relative aspect-[16/10] w-full overflow-hidden",children:[t.jsx("img",{src:l,alt:e.name,className:"w-full h-full object-cover"}),e.venue_type&&t.jsx("span",{className:"absolute left-2 top-2 rounded-full bg-white/90 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-gray-800 shadow-sm",children:e.venue_type.replace(/_/g," ")})]}),t.jsxs("div",{className:"p-3 space-y-1.5",children:[t.jsxs("div",{className:"flex items-start justify-between gap-2",children:[t.jsx("h3",{className:"font-semibold text-sm text-gray-900 line-clamp-1 flex-1",children:e.name}),g&&t.jsxs("span",{className:"text-sm whitespace-nowrap",children:[t.jsx("span",{className:"font-normal text-gray-500",children:f}),t.jsx("span",{className:"font-bold text-gray-900",children:g})]})]}),t.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-600",children:[u&&t.jsx("span",{className:"line-clamp-1",children:u}),d&&t.jsx("span",{className:"line-clamp-1",children:d})]}),e.location&&t.jsx("p",{className:"text-xs text-gray-500 line-clamp-1",children:e.location}),i&&t.jsxs("button",{type:"button",className:"flex items-center gap-1 pt-1 cursor-pointer hover:opacity-80",onClick:P=>{P.preventDefault(),P.stopPropagation(),n(`${j}#reviews`,{state:{scrollToReviews:Date.now()}})},"aria-label":`View reviews for ${e.name}`,children:[t.jsx(X,{className:"w-3 h-3 fill-yellow-400 text-yellow-400"}),t.jsx("span",{className:"text-xs font-medium text-gray-700",children:i}),c!=null&&c>0&&t.jsxs("span",{className:"text-[10px]",children:["(",c,")"]})]})]})]})},Mt=e=>{switch(e.kind){case"service":{const{kind:s,...a}=e;return t.jsx(gt,{...a})}case"map":{const{kind:s,...a}=e;return t.jsx(xt,{...a})}case"venue":default:{const{kind:s,...a}=e;return t.jsx(mt,{...a})}}};export{Mt as L};