import{j as e,L as m,k as h}from"./vendor-react-DgEFbQIi.js";import{o as p,z as u,A as c,f7 as d,eT as g,Z as b,bi as f}from"./index-DFVuS8SP.js";import"./vendor-maps-bOuA10hf.js";import"./vendor-amplify-BBi2B1tW.js";import{P as j}from"./PageBreadcrumb-nCACiN0q.js";import{A as N,a as y,b as w,c as B}from"./accordion-gRKAAV-y.js";import{u as F}from"./useSeo-eyKuqwK1.js";import{a as v,u as L,b as I}from"./index-CqogJ-_r.js";import{a as A}from"./prerenderSignal-6UTp3gVc.js";import{L as x}from"./ListingCard-Cw2aMm7U.js";import{b as S}from"./venues-BaWtNBkC.js";import{E}from"./external-link-CoEWaNyP.js";import"./vendor-radix-kdo0k_bv.js";import"./vendor-motion-CzLrDd6y.js";import"./claimRequests-54T7aAUE.js";import"./listing-B0peEtEB.js";import"./OptimizedImage-BZrGLn_7.js";import"./badges-B7hHNwsz.js";import"./wishlists-NNbira8h.js";import"./authHeaders-C650O0HP.js";import"./ImageWithFallback-C1HTj5IA.js";import"./listing-utils-CICni2H8.js";import"./parseISO-C4sM-PC7.js";import"./listingFeeInput-DmvcA6E5.js";import"./badge-check-D5e4IH5i.js";import"./star-C0MTo9W6.js";function q(t){const s=t.searchQuery?encodeURIComponent(t.searchQuery):null;if(!t.subreddit)return`https://www.reddit.com/search/?q=${s??""}&sort=relevance&t=year`;const i=`https://www.reddit.com/r/${t.subreddit}`;return s?`${i}/search/?q=${s}&restrict_sr=1&sort=relevance&t=year`:`${i}/`}function P(t){return t.subreddit?t.searchQuery?`r/${t.subreddit} — "${t.searchQuery}"`:`r/${t.subreddit}`:`Reddit search: "${t.searchQuery??""}"`}const T=24,$=8,R=5*60*1e3;function k(t){const{data:s,isLoading:i}=p({queryKey:["guides","inventory",t==null?void 0:t.listingKind,(t==null?void 0:t.serviceType)??null,(t==null?void 0:t.city)??null,(t==null?void 0:t.state)??null],queryFn:()=>u({listingKind:t.listingKind,serviceType:t.serviceType,city:t.city,state:t.state,limit:T,prioritizeVerified:!0}),enabled:!!t,staleTime:R,refetchOnWindowFocus:!1});return t?{listings:((s==null?void 0:s.items)??[]).filter(l=>l.listingKind===t.listingKind).slice(0,$),loading:i}:{listings:[],loading:!1}}const _=({inventory:t,listings:s,loading:i})=>i?e.jsx("section",{className:"my-12",children:e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-5",children:Array.from({length:4}).map((r,l)=>e.jsxs("div",{className:"animate-pulse",children:[e.jsx("div",{className:"aspect-[4/3] rounded-2xl bg-gray-100"}),e.jsx("div",{className:"mt-3 h-4 w-3/4 rounded bg-gray-100"}),e.jsx("div",{className:"mt-2 h-3 w-1/2 rounded bg-gray-100"})]},l))})}):s.length===0?null:e.jsxs("section",{className:"my-12",children:[e.jsxs("div",{className:"flex items-end justify-between gap-4 mb-5",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-[#0F0F0F] font-semibold text-xl md:text-2xl tracking-tight",children:t.heading}),e.jsx("p",{className:"text-[#4B4B4B] text-sm md:text-base mt-1",children:t.subtitle})]}),e.jsxs(m,{to:t.viewAllHref,className:"hidden sm:inline-flex items-center gap-1 text-brand-400 hover:underline text-sm font-medium whitespace-nowrap",children:["See all",e.jsx(c,{className:"w-4 h-4"})]})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-5",children:s.map(r=>t.listingKind==="service"?e.jsx(x,{kind:"service",service:r},r.listingId):e.jsx(x,{kind:"venue",venue:S(r)},r.listingId))}),e.jsxs(m,{to:t.viewAllHref,className:"sm:hidden mt-5 inline-flex items-center gap-1 text-brand-400 hover:underline text-sm font-medium",children:["See all",e.jsx(c,{className:"w-4 h-4"})]})]}),G=({block:t})=>{switch(t.type){case"heading":return e.jsx("h2",{className:"text-[#0F0F0F] font-semibold text-xl md:text-2xl tracking-tight mt-10 mb-4",children:t.text});case"paragraph":return e.jsx("p",{className:"text-[#4B4B4B] text-base md:text-lg leading-relaxed mb-4",children:t.text});case"list":return e.jsx("ul",{className:"mb-5 space-y-2",children:t.items.map(s=>e.jsxs("li",{className:"text-[#4B4B4B] text-base md:text-lg leading-relaxed pl-5 relative",children:[e.jsx("span",{className:"absolute left-0 top-[0.7em] w-1.5 h-1.5 rounded-full bg-brand-400"}),s]},s))});case"table":return e.jsx("div",{className:"mb-6 -mx-4 md:mx-0 overflow-x-auto",children:e.jsxs("table",{className:"w-full min-w-[520px] md:min-w-0 border-collapse text-left",children:[e.jsx("thead",{children:e.jsx("tr",{className:"border-b border-gray-200",children:t.headers.map(s=>e.jsx("th",{className:"py-3 px-4 text-[#0F0F0F] font-semibold text-sm whitespace-nowrap",children:s},s))})}),e.jsx("tbody",{children:t.rows.map(s=>e.jsx("tr",{className:"border-b border-gray-100 align-top",children:s.map((i,r)=>e.jsx("td",{className:"py-3 px-4 text-[#4B4B4B] text-sm leading-relaxed",children:i},r))},s.join("|")))})]})});case"callout":return e.jsxs("div",{className:"my-6 rounded-2xl bg-brand-50 border border-brand-100 p-5 md:p-6",children:[e.jsx("p",{className:"text-[#0F0F0F] font-semibold text-base mb-2",children:t.title}),e.jsx("p",{className:"text-[#4B4B4B] text-base leading-relaxed",children:t.text})]})}},Q=({guide:t})=>e.jsxs("section",{className:"my-12 rounded-2xl border border-gray-200 p-5 md:p-7",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(f,{className:"w-5 h-5 text-brand-400"}),e.jsx("h2",{className:"text-[#0F0F0F] font-semibold text-lg md:text-xl tracking-tight",children:"Where to read the discussion yourself"})]}),e.jsx("p",{className:"text-[#4B4B4B] text-sm md:text-base leading-relaxed mb-5",children:"The summaries above are ours, written from the recurring themes in community discussion rather than quoted from any individual post. These links go to the live conversations so you can read them directly and see what people are saying now."}),e.jsx("ul",{className:"space-y-4",children:t.redditSources.map(s=>e.jsxs("li",{children:[e.jsxs("a",{href:q(s),target:"_blank",rel:"noopener noreferrer nofollow",className:"inline-flex items-center gap-1.5 text-brand-400 hover:underline font-medium",children:[P(s),e.jsx(E,{className:"w-3.5 h-3.5"})]}),e.jsx("p",{className:"text-[#4B4B4B] text-sm leading-relaxed mt-1",children:s.note})]},`${s.subreddit??"all"}-${s.searchQuery??""}`))})]});function xe(){const{slug:t}=h(),s=v(t),i=d(`/guides/${t??""}`),{listings:r,loading:l}=k(s==null?void 0:s.inventory);if(A(!(s!=null&&s.inventory)||!l),F(s?{title:s.title,description:s.description,canonical:i,type:"article"}:{}),L("guide",s?{"@context":"https://schema.org","@graph":[{"@type":"Article",headline:s.h1,description:s.description,datePublished:s.datePublished,dateModified:s.dateModified??s.datePublished,mainEntityOfPage:{"@type":"WebPage","@id":i},author:{"@type":"Organization",name:"PLEC",url:d("/")},publisher:{"@type":"Organization",name:"PLEC",url:d("/")}},{"@type":"FAQPage",mainEntity:s.faq.map(a=>({"@type":"Question",name:a.question,acceptedAnswer:{"@type":"Answer",text:a.answer}}))},{"@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:d("/")},{"@type":"ListItem",position:2,name:"Guides",item:d("/guides")},{"@type":"ListItem",position:3,name:s.h1,item:i}]}]}:null),!s)return e.jsx(g,{});const o=I(s);return e.jsx(b,{hideCategories:!0,showFooter:!0,children:e.jsxs("div",{className:"min-h-screen bg-white",children:[e.jsx("div",{className:"bg-gradient-to-br from-brand-50 to-white pt-12 md:pt-16 pb-10 md:pb-14",children:e.jsxs("div",{className:"max-w-3xl mx-auto px-4 md:px-8",children:[e.jsx(j,{}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-4 text-sm",children:[e.jsx("span",{className:"inline-flex items-center rounded-full bg-white border border-gray-200 px-3 py-1 text-[#4B4B4B] font-medium",children:s.market}),e.jsx("span",{className:"inline-flex items-center rounded-full bg-white border border-gray-200 px-3 py-1 text-[#4B4B4B] font-medium",children:s.category}),e.jsx("span",{className:"text-[#767676]",children:s.readingTime})]}),e.jsx("h1",{className:"text-[#0F0F0F] tracking-tight mb-5",style:{lineHeight:"1.15",fontWeight:700,fontSize:"clamp(1.875rem, 4.5vw, 3rem)"},children:s.h1}),e.jsx("p",{className:"text-[#4B4B4B] text-lg md:text-xl",style:{lineHeight:"1.7",letterSpacing:"-0.01em"},children:s.intro})]})}),e.jsx("article",{className:"max-w-3xl mx-auto px-4 md:px-8 pt-10 md:pt-14",children:s.body.map((a,n)=>e.jsx(G,{block:a},n))}),s.inventory&&e.jsx("div",{className:"max-w-7xl mx-auto px-4 md:px-8 lg:px-12",children:e.jsx(_,{inventory:s.inventory,listings:r,loading:l})}),e.jsxs("div",{className:"max-w-3xl mx-auto px-4 md:px-8 pb-10 md:pb-14",children:[e.jsx(Q,{guide:s}),e.jsxs("section",{className:"my-12",children:[e.jsx("h2",{className:"text-[#0F0F0F] font-semibold text-xl md:text-2xl tracking-tight mb-5",children:"Common questions"}),e.jsx(N,{type:"single",collapsible:!0,className:"w-full",children:s.faq.map((a,n)=>e.jsxs(y,{value:`faq-${n}`,children:[e.jsx(w,{className:"text-left text-[#0F0F0F] font-medium",children:a.question}),e.jsx(B,{className:"text-[#4B4B4B] text-base leading-relaxed",children:a.answer})]},a.question))})]}),o.length>0&&e.jsxs("section",{className:"my-12 pt-10 border-t border-gray-200",children:[e.jsx("h2",{className:"text-[#0F0F0F] font-semibold text-xl tracking-tight mb-5",children:"Related guides"}),e.jsx("ul",{className:"space-y-3",children:o.map(a=>e.jsxs("li",{children:[e.jsxs(m,{to:`/guides/${a.slug}`,className:"group inline-flex items-start gap-2 text-brand-400 hover:underline font-medium",children:[e.jsx("span",{children:a.h1}),e.jsx(c,{className:"w-4 h-4 mt-1 flex-shrink-0 transition-transform group-hover:translate-x-0.5"})]}),e.jsx("p",{className:"text-[#767676] text-sm mt-0.5",children:a.market})]},a.slug))})]})]})]})})}export{xe as default};