import{g as st}from"./listing-utils-CICni2H8.js";import{e as at}from"./listingFeeInput-DmvcA6E5.js";import{a_ as Ce,bj as Me}from"./index-DFVuS8SP.js";const Le=t=>t==="fixed"||t==="per_event"||t==="flat"?"per_event":t==="per_hour"||t==="per_person_per_hour"?t:"per_person",D=t=>{const o=typeof t=="number"?t:typeof t=="string"?Number(t):NaN;return Number.isFinite(o)&&o>0?o:void 0},Q=t=>{const o=t&&typeof t=="object"?t:{},n=o.sliderPricingMode,c=n==="bar_tab"?"bar_tab":n==="all_in"?"all_in":void 0;return{displayPrice:D(o.displayPrice),displayStartingPrice:D(o.displayStartingPrice),displayMinPrice:D(o.displayMinPrice),displayMaxPrice:D(o.displayMaxPrice),hostFeeIncluded:o.hostFeeIncluded===!0?!0:void 0,sliderPricingMode:c}},ct=[{id:"austin",heading:"Popular venues in Austin",subtitle:"Live music capital & vibrant nightlife",tokens:["austin"],city:"Austin",state:"TX",cta:"Explore Austin venues",viewAllHref:"/venues?location=Austin%2C%20TX"},{id:"dallas",heading:"For your next event in Dallas",subtitle:"Upscale venues in the Design District & beyond",tokens:["dallas"],city:"Dallas",state:"TX",cta:"Discover Dallas venues",viewAllHref:"/venues?location=Dallas%2C%20TX"},{id:"houston",heading:"Top spaces in Houston",subtitle:"Diverse event spaces from downtown to the Heights",tokens:["houston"],city:"Houston",state:"TX",cta:"See Houston venues",viewAllHref:"/venues?location=Houston%2C%20TX"},{id:"philadelphia",heading:"Handpicked venues in Philadelphia",subtitle:"Historic spaces & modern lofts in the city of brotherly love",tokens:["philadelphia","philly"],city:"Philadelphia",state:"PA",cta:"Browse Philadelphia venues",viewAllHref:"/venues?location=Philadelphia%2C%20PA"}],K="JSAI9QD5_7dT".trim()??"",lt=K?[{id:"sixth-st-host",heading:"Explore venues in 6th St",subtitle:"Handpicked spaces from one of our top hosts",viewAllHref:`/venues?ownerPublicId=${encodeURIComponent(K)}`,fetch:{ownerPublicId:K}}]:[],yt=[...lt,...ct.map(t=>({id:t.id,heading:t.heading,subtitle:t.subtitle,viewAllHref:t.viewAllHref,fetch:{city:t.city,state:t.state}}))],vt=t=>{var oe,re,se,ae,ce,le,ue,de,pe,me,ge,ye,ve,fe,he,be,Te,Pe,Ae,_e,Ie,Se,we,Fe,Re;const o=st(t)??null,n=o??{},c=t.listingKind==="service",p=(n==null?void 0:n.serviceData)??{},S=Array.isArray(p.offerings)?p.offerings.filter(e=>!!(e&&typeof e=="object")):[],d=c?S[0]:void 0,u=e=>typeof e=="string"&&e.trim().length>0?e.trim():void 0,w=e=>{const i=e==null?void 0:e.trim().toLowerCase();return i?i==="dj"?"DJ":i.split("_").filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" "):"Service"},b=e=>{if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()!==""){const i=Number(e);if(!Number.isNaN(i))return i}},T=n.metadata??{},s=T.pricing??{},H=T.venueDetails??{},m=T.locationDetails??{},P=m.manualFields??{},A=T.location??{},g=A.locationDetails??{},v=g.manualFields??{},F=m.coordinates??{},R=m.position??{},N=m.selection??{},x=g.coordinates??{},L=g.position??{},C=g.selection??{},J=n,De=[P.streetAddress,P.city,P.state,v.streetAddress,v.city,v.state].filter(e=>typeof e=="string"&&e.trim().length>0).join(", "),He=t.locationLabel||((oe=n.location)==null?void 0:oe.formatted)||(typeof m.formattedAddress=="string"?m.formattedAddress:void 0)||(typeof g.formattedAddress=="string"?g.formattedAddress:void 0)||De||"Location coming soon",U=Array.isArray((re=n.media)==null?void 0:re.gallery)?(((se=n.media)==null?void 0:se.gallery)??[]).filter(e=>e&&e.type!=="video"&&typeof e.url=="string"&&e.url.trim().length>0).sort((e,i)=>{const r=typeof e.order=="number"?e.order:Number.POSITIVE_INFINITY,a=typeof i.order=="number"?i.order:Number.POSITIVE_INFINITY;return r-a}).map(e=>e.url.trim()):[],_=(ce=(ae=n==null?void 0:n.media)==null?void 0:ae.coverImage)==null?void 0:ce.trim(),M=c?u(p.coverImage):void 0,Ue=(()=>{if(c&&M){const e=new Set,i=[];return M&&!e.has(M)&&(e.add(M),i.push(M)),_&&!e.has(_)&&(e.add(_),i.push(_)),U.forEach(r=>{e.has(r)||(e.add(r),i.push(r))}),i}return _&&!U.includes(_)?[_,...U]:U})(),q=Array.isArray((le=n.media)==null?void 0:le.gallery)?(((ue=n.media)==null?void 0:ue.gallery)??[]).filter(e=>e&&e.type==="video"&&typeof e.url=="string"&&e.url.trim().length>0).sort((e,i)=>{const r=typeof e.order=="number"?e.order:Number.POSITIVE_INFINITY,a=typeof i.order=="number"?i.order:Number.POSITIVE_INFINITY;return r-a}).map(e=>e.url.trim()):[],E=(pe=(de=n.location)==null?void 0:de.city)==null?void 0:pe.trim(),$e=(ge=(me=n.location)==null?void 0:me.state)==null?void 0:ge.trim(),Ee=(ve=(ye=n.location)==null?void 0:ye.neighborhood)==null?void 0:ve.trim(),W=(he=(fe=n.basics)==null?void 0:fe.title)==null?void 0:he.trim(),Z=(Te=(be=n.basics)==null?void 0:be.tagline)==null?void 0:Te.trim(),j=(Ae=(Pe=n.basics)==null?void 0:Pe.description)==null?void 0:Ae.trim(),V=p.businessInfo&&typeof p.businessInfo=="object"?p.businessInfo:null,O=c?u(p.cardTitle)||u(p.title)||u(V==null?void 0:V.businessName)||u(d==null?void 0:d.name)||`${w((o==null?void 0:o.serviceType)??t.serviceType)}${E?` in ${E}`:""}`:void 0,Ve=c?u(p.tagline)||Z:void 0,Be=c?u(p.description)||u(p.cardDescription)||j||u(d==null?void 0:d.description):void 0,k=Ve||Z,B=(_e=n.capacity)==null?void 0:_e.min,X=(Ie=n.capacity)==null?void 0:Ie.max,ee={min:typeof B=="number"&&Number.isFinite(B)?B:void 0,max:typeof X=="number"&&Number.isFinite(X)?X:void 0},Xe=(()=>{const{min:e,max:i}=ee,r=typeof e=="number"&&e>1?e:void 0;if(typeof r=="number"&&typeof i=="number"&&i>=r)return`${r}–${i} guests`;if(typeof r=="number")return`${r}+ guests`;if(typeof i=="number")return`Up to ${i} guests`})(),G=H.eventStyles,Ge=Array.isArray(G)&&G.length>0?G.map(e=>{if(typeof e=="string")return e;if(e&&typeof e=="object"&&"label"in e)return String(e.label??"").trim()}).filter(e=>!!(e&&e.length>0)):void 0,Ye=n.venueType||(Array.isArray(H.subTypes)&&H.subTypes.length>0?H.subTypes[0]:void 0),te=typeof(s==null?void 0:s.unit)=="string"?s.unit:typeof(s==null?void 0:s.priceUnit)=="string"?s.priceUnit:typeof(s==null?void 0:s.billingUnit)=="string"?s.billingUnit:typeof(d==null?void 0:d.priceType)=="string"?d.priceType:void 0,ze=(()=>{if(!te)return;switch(String(te).trim().toLowerCase()){case"per_person":case"per-person":case"person":case"guest":return"per_person";case"per_event":case"per-event":case"event":case"flat":case"fixed":return"per_event";case"per_day":case"per-day":case"day":return"per_day";case"per_hour":case"per-hour":case"hour":case"hourly":default:return"per_hour"}})(),y=e=>{if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){const i=Number(e);return Number.isFinite(i)?i:void 0}},Ke=e=>{const i=y(e.minAttendees);if(typeof i=="number"&&i>0)return i;const r=e.guestLimit&&typeof e.guestLimit=="object"?e.guestLimit:null,a=r?y(r.min):void 0;if(typeof a=="number"&&a>0)return a;const l=y(e.minGuests??e.minGuest);return typeof l=="number"&&l>0?l:null},Qe=e=>{const i=y(e.maxAttendees);if(typeof i=="number"&&i>0)return i;const r=e.guestLimit&&typeof e.guestLimit=="object"?e.guestLimit:null,a=r?y(r.max):void 0;if(typeof a=="number"&&a>0)return a;const l=y(e.maxGuests??e.maxGuest);return typeof l=="number"&&l>0?l:null},Je=e=>{if(e.includesVenueRental===!0||e.skipBaseRate===!0||e.includesRental===!0)return!0;const i=String(e.packageType??e.type??"").trim().toLowerCase();if(i==="venue_rental"||i==="rental_buyout"||i==="full_buyout"||i==="buyout")return!0;const r=`${String(e.name??"")} ${String(e.description??"")} ${String(e.restrictions??"")}`.trim().toLowerCase();return/(buyout|full[\s-]?buyout|includes?\s+venue\s+rental|venue\s+rental\s+included)/.test(r)},qe=t.category||(typeof T.category=="string"?T.category:void 0)||n.category||void 0,Y=Ce(s),We={minimumHours:y(s.minimumHours),cleaningFee:y(s.cleaningFee),securityDeposit:y(s.securityDeposit),overtimeRate:y(s.overtimeRate),pricingNotes:typeof s.pricingNotes=="string"&&s.pricingNotes.trim().length>0?s.pricingNotes.trim():void 0,allowCustomQuotes:typeof s.allowCustomQuotes=="boolean"?s.allowCustomQuotes:void 0,displayCleaningFee:Y.cleaningFee??void 0,displayOvertimeRate:Y.overtimeRate??void 0},Ze=Array.isArray(s.packages)?s.packages.filter(e=>e&&typeof e=="object"&&e!==null&&"name"in e).map(e=>{const i=e,r=y(i.minPrice)??0,a=y(i.maxPrice),l=i.pricingMode==="self_service_range"||i.pricingMode==="negotiable_range"?i.pricingMode:"fixed";return{id:(typeof i.id=="string"?i.id:void 0)??crypto.randomUUID(),name:typeof i.name=="string"?i.name:"",priceType:Le(i.priceType),minPrice:r,maxPrice:typeof a=="number"&&a!==r?a:null,minAttendees:Ke(i),maxAttendees:Qe(i),includesVenueRental:Je(i),description:typeof i.description=="string"?i.description:null,restrictions:typeof i.restrictions=="string"?i.restrictions:null,pricingMode:l,sliders:l==="self_service_range"&&Array.isArray(i.sliders)?i.sliders:void 0,...Q(i)}}):void 0,je=c?S.map((e,i)=>{const r=y(e.displayPrice??e.price)??0,a=e.pricingMode==="self_service_range"||e.pricingMode==="negotiable_range"?e.pricingMode:"fixed";return{id:u(e.id)??`service-offering-${i}`,name:u(e.name)??`Package ${i+1}`,priceType:Le(e.priceType),minPrice:r,maxPrice:null,minAttendees:null,maxAttendees:null,includesVenueRental:!1,description:u(e.description)??null,restrictions:null,pricingMode:a,sliders:a==="self_service_range"&&Array.isArray(e.sliders)?e.sliders:void 0,...Q(e)}}):void 0,z=Ze??je,f=(e,i)=>{if(!e)return;const r=new Set,a=[e];for(;a.length>0;){const l=a.shift();if(!l||typeof l!="object"||r.has(l))continue;r.add(l);const rt=Array.isArray(l)?Array.from(l.entries()):Object.entries(l);for(const[Ne,$]of rt){if(typeof Ne=="string"&&i.includes(Ne.toLowerCase())){const xe=b($);if(xe!==void 0)return xe}typeof $=="object"&&$!==null&&a.push($)}}},Oe=[()=>{var e;return[m.latitude,m.lat,g.latitude,g.lat,F.latitude,F.lat,R.latitude,R.lat,N.latitude,N.lat,P.latitude,P.lat,v.latitude,v.lat,x.latitude,x.lat,L.latitude,L.lat,C.latitude,C.lat,(e=n==null?void 0:n.location)==null?void 0:e.latitude,A.latitude,A.lat].map(b).find(i=>i!==void 0)},()=>f(m,["latitude","lat"]),()=>f(g,["latitude","lat"]),()=>f(A,["latitude","lat"]),()=>f(v,["latitude","lat"]),()=>f(J,["latitude","lat"])],ke=[()=>{var e;return[m.longitude,m.lng,m.lon,g.longitude,g.lng,g.lon,F.longitude,F.lng,F.lon,R.longitude,R.lng,R.lon,N.longitude,N.lng,N.lon,P.longitude,P.lng,P.lon,v.longitude,v.lng,v.lon,x.longitude,x.lng,x.lon,L.longitude,L.lng,L.lon,C.longitude,C.lng,C.lon,(e=n==null?void 0:n.location)==null?void 0:e.longitude,A.longitude,A.lng,A.lon].map(b).find(i=>i!==void 0)},()=>f(m,["longitude","lng","lon"]),()=>f(g,["longitude","lng","lon"]),()=>f(A,["longitude","lng","lon"]),()=>f(v,["longitude","lng","lon"]),()=>f(J,["longitude","lng","lon"])],et=Oe.map(e=>e()).find(e=>e!==void 0)??void 0,tt=ke.map(e=>e()).find(e=>e!==void 0)??void 0,it=c?u(p.coverImage)||u(d==null?void 0:d.image)||((Se=n==null?void 0:n.media)==null?void 0:Se.coverImage):(we=n==null?void 0:n.media)==null?void 0:we.coverImage,I=t.stats,h=t.googleReviews,ie=I&&(I.averageRating!=null||I.rating!=null||I.reviewCount!=null&&I.reviewCount>0)?I:h&&(h.avgRating!=null&&h.avgRating>0||h.totalReviews!=null&&h.totalReviews>0)?{averageRating:h.avgRating??void 0,rating:h.avgRating??void 0,reviewCount:h.totalReviews??void 0,userRatingCount:h.totalReviews??void 0}:void 0,ne=Me(t)??void 0,nt=c?ne:Y.baseRate??D(t.displayBaseRate),ot={listingKind:t.listingKind??"venue",category:t.category??(typeof T.category=="string"?T.category:void 0)??(o==null?void 0:o.category),serviceType:(o==null?void 0:o.serviceType)??t.serviceType,feeOverrides:((Fe=t.pricingFeeSummary)==null?void 0:Fe.feeOverrides)??at(o),effectiveFeeRates:((Re=t.pricingFeeSummary)==null?void 0:Re.effectiveFeeRates)??null};return{id:t.listingId,name:O||W||`Untitled ${t.category} listing`,location:He,city:E,state:$e,neighborhood:Ee,tagline:k,category:qe,capacityLabel:Xe,eventStyles:Ge,venue_type:c?w((o==null?void 0:o.serviceType)??t.serviceType):Ye,main_image:it,galleryImages:Ue,galleryVideos:q.length>0?q:void 0,packages:z&&z.length>0?z:void 0,baseRate:nt,displayPriceFrom:ne,priceUnit:ze,pricingDetails:We,feeInput:ot,capacity:ee,latitude:et,longitude:tt,rawListing:t,rankScore:t.rankScore,highlights:{title:O||W,tagline:k,description:Be||j},...ie&&{stats:ie}}};function ut(t){const{min:o,max:n}=t,c=typeof o=="number"&&o>1?o:void 0;if(typeof c=="number"&&typeof n=="number"&&n>=c)return`${c}–${n} guests`;if(typeof c=="number")return`${c}+ guests`;if(typeof n=="number")return`Up to ${n} guests`}function dt(t){const o=t.pricingMode??"fixed";return{id:t.id,name:t.name,priceType:t.priceType,minPrice:t.minPrice,maxPrice:t.maxPrice??null,minAttendees:null,maxAttendees:null,includesVenueRental:!1,description:t.description??null,restrictions:null,pricingMode:o,sliders:o==="self_service_range"?t.sliders:void 0,...Q(t)}}function ft(t){var S,d,u,w;const o=(d=(S=t.packages)==null?void 0:S.filter(b=>b&&b.id&&(b.name||b.minPrice>0)))==null?void 0:d.map(dt),n=Ce(t.pricing).baseRate??void 0,c=Me(t)??void 0,p={listingKind:"venue",category:t.category,feeOverrides:t.pricing.feeOverrides??null,effectiveFeeRates:t.pricing.effectiveFeeRates??null};return{id:t.listingId,name:t.title,location:t.location.formatted,city:t.location.city,state:t.location.state,neighborhood:t.location.neighborhood,tagline:t.tagline,category:t.category,capacityLabel:ut(t.capacity),eventStyles:t.eventStyles,venue_type:t.venueType,main_image:t.coverImage,galleryImages:t.galleryImages||[],galleryVideos:t.galleryVideos,packages:o&&o.length>0?o:void 0,baseRate:n,displayPriceFrom:c,priceUnit:t.pricing.priceUnit,pricingDetails:t.pricingDetails,feeInput:p,capacity:t.capacity,latitude:(u=t.location.coordinates)==null?void 0:u.lat,longitude:(w=t.location.coordinates)==null?void 0:w.lng,plecMetadata:t.plecMetadata?{isFeatured:t.plecMetadata.isFeatured,isNew:t.plecMetadata.isNew,isPopular:t.plecMetadata.isPopular,partnerSince:t.plecMetadata.partnerSince}:void 0,verified:t.verified,highlights:t.highlights,stats:t.stats}}export{yt as H,vt as b,ft as t};