1import{e as a,j as e}from"./react-vendor-COA9LC9C.js";import{B as j}from"./badge-DrtwPH22.js";import{aG as V,aF as P,B as l,y as ce,d as de,g as me,h as ue,k as xe,l as pe,i as he,j as ge}from"./index-DNOAzpau.js";import{C as fe,d as je,e as ye,b as Ne,a as be}from"./card-Bhwb9Q_i.js";import{I as z}from"./input-BOGnGvhO.js";import{S as A,c as I,d as _,a as R,b as m}from"./select-BFdcQUEM.js";import{S as we}from"./separator-4jMhGYrC.js";import{S as r}from"./skeleton-CrU7E5mY.js";import{S as ve}from"./shield-check-RSr1MxSq.js";import{F as W}from"./file-text-Bn2TS0jb.js";import{M as H}from"./megaphone-DqXnO6FH.js";import{S as K}from"./search-B6MVwT69.js";import{E as Se}from"./earth-BaTeBvx5.js";import{C as Ce}from"./chart-column-BZwMvh-E.js";import{C as De}from"./clock-3-Bm1HQDJw.js";import{S as L}from"./shopping-cart-TT1fLmH9.js";import{U as ke}from"./users-CbtO2I6G.js";import{T as Ee}from"./trash-2-E8_iP2eX.js";import{L as Te}from"./loader-circle-SaNojEXd.js";import"./ui-vendor-DZhVfNUY.js";import"./data-vendor-DLQwpBlT.js";import"./chevron-down-D5Z2D8kh.js";import"./chevron-up-CrQ6hfrt.js";const Me=[{id:"demo-gp-techwire",type:"guest_post",name:"TechWire Journal",domain:"techwire.example",country:"United States",language:"English",categories:["Technology","SaaS"],monthlyTraffic:184e3,domainAuthority:72,domainRating:76,turnaroundDays:7,writingIncluded:!0,sponsoredLabel:!1,price:620,currency:"USD",description:"Editorial guest article placement for B2B technology and SaaS stories.",placement:"Permanent in-content article",source:"demo"},{id:"demo-gp-founder",type:"guest_post",name:"Founder Daily",domain:"founderdaily.example",country:"United Kingdom",language:"English",categories:["Business","Startups"],monthlyTraffic:96e3,domainAuthority:64,domainRating:68,turnaroundDays:10,writingIncluded:!0,sponsoredLabel:!0,price:410,currency:"USD",description:"Founder-led stories, product lessons, and practical startup analysis.",placement:"Guest contribution",source:"demo"},{id:"demo-gp-growth",type:"guest_post",name:"Growth Stack",domain:"growthstack.example",country:"Canada",language:"English",categories:["Marketing","E-commerce"],monthlyTraffic:128e3,domainAuthority:58,domainRating:63,turnaroundDays:6,writingIncluded:!1,sponsoredLabel:!1,price:285,currency:"USD",description:"Tactical marketing, commerce, analytics, and customer-acquisition coverage.",placement:"Editorial article",source:"demo"},{id:"demo-gp-finance",type:"guest_post",name:"Modern Finance Review",domain:"modernfinance.example",country:"Australia",language:"English",categories:["Finance","Fintech"],monthlyTraffic:74e3,domainAuthority:61,domainRating:66,turnaroundDays:12,writingIncluded:!0,sponsoredLabel:!0,price:540,currency:"USD",description:"Finance and fintech publication accepting expert-led contributed articles.",placement:"Contributed article",source:"demo"},{id:"demo-pr-business",type:"digital_pr",name:"Business News Network",domain:"businessnews.example",country:"United States",language:"English",categories:["Business","News"],monthlyTraffic:86e4,domainAuthority:83,domainRating:86,turnaroundDays:14,writingIncluded:!0,sponsoredLabel:!0,price:1850,currency:"USD",description:"Digital PR package with editorial review and broad business-news distribution.",placement:"News feature and syndication",source:"demo"},{id:"demo-pr-europe",type:"digital_pr",name:"European Tech Desk",domain:"eutechdesk.example",country:"Germany",language:"English",categories:["Technology","Europe"],monthlyTraffic:32e4,domainAuthority:75,domainRating:79,turnaroundDays:18,writingIncluded:!0,sponsoredLabel:!1,price:2400,currency:"USD",description:"Pitch development and editorial outreach for European technology stories.",placement:"Reporter pitch and feature",source:"demo"},{id:"demo-pr-consumer",type:"digital_pr",name:"Consumer Trends Today",domain:"consumertrends.example",country:"United Kingdom",language:"English",categories:["Lifestyle","Consumer"],monthlyTraffic:54e4,domainAuthority:78,domainRating:81,turnaroundDays:16,writingIncluded:!0,sponsoredLabel:!0,price:1350,currency:"USD",description:"Campaign packaging for data-led consumer and lifestyle stories.",placement:"Digital PR feature",source:"demo"},{id:"demo-pr-global",type:"digital_pr",name:"Global Innovation Wire",domain:"innovationwire.example",country:"Global",language:"English",categories:["Innovation","Technology"],monthlyTraffic:71e4,domainAuthority:81,domainRating:84,turnaroundDays:10,writingIncluded:!0,sponsoredLabel:!0,price:980,currency:"USD",description:"Press release refinement and targeted distribution across innovation publications.",placement:"Press release distribution",source:"demo"}],Pe=new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}),D=(i,v)=>new Intl.NumberFormat("en-US",{style:"currency",currency:v,maximumFractionDigits:0}).format(i),N=12,Ae=350,Y={guest_post:{title:"Guest Post placements",description:"Purchase authoritative guest articles with transparent traffic, authority, and delivery details."},digital_pr:{title:"Digital PR coverage",description:"Build media authority through news features, editorial outreach, and targeted distribution."}};function Ie(){return e.jsx("div",{className:"rounded-2xl border border-border/60 bg-card p-5 shadow-sm",children:e.jsxs("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(r,{className:"h-9 w-9 rounded-xl"}),e.jsxs("div",{className:"min-w-0 space-y-2",children:[e.jsx(r,{className:"h-4 w-40"}),e.jsx(r,{className:"h-3 w-28"})]}),e.jsx(r,{className:"h-6 w-20 rounded-full"}),e.jsx(r,{className:"h-6 w-24 rounded-full"})]}),e.jsxs("div",{className:"mt-4 space-y-2",children:[e.jsx(r,{className:"h-4 w-full"}),e.jsx(r,{className:"h-4 w-5/6"})]}),e.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(r,{className:"h-5 w-24"}),e.jsx(r,{className:"h-5 w-28"}),e.jsx(r,{className:"h-5 w-24"}),e.jsx(r,{className:"h-5 w-20"})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-4 lg:w-40 lg:flex-col lg:items-end",children:[e.jsxs("div",{className:"space-y-2 text-left lg:text-right",children:[e.jsx(r,{className:"ml-auto h-3 w-16"}),e.jsx(r,{className:"ml-auto h-7 w-24"})]}),e.jsx(r,{className:"h-10 w-24 rounded-md"})]})]})})}
1function rs(){const[i,v]=a.useState("guest_post"),[k,F]=a.useState(""),[S,U]=a.useState(""),[u,B]=a.useState("all"),[x,G]=a.useState("all"),[p,q]=a.useState("all"),[h,O]=a.useState(""),[g,b]=a.useState(1),[o,J]=a.useState([]),[X,C]=a.useState(!1),Z=p==="all"?void 0:Number(p),ee=h?Number(h):void 0;a.useEffect(()=>{const s=window.setTimeout(()=>{U(k)},Ae);return()=>window.clearTimeout(s)},[k]);const c=V.geoMarketplace.list.useQuery({type:i,search:S.trim()||void 0,country:u==="all"?void 0:u,category:x==="all"?void 0:x,minDomainRating:Z,maxPrice:ee,page:1,limit:50},{staleTime:6e4,retry:1,refetchOnWindowFocus:!1}),E=V.geoMarketplace.requestQuote.useMutation({onSuccess:s=>{C(!1),P.success("Quote preview ready",{description:`${s.reference} · ${s.message}`})},onError:s=>P.error("Unable to prepare quote preview",{description:s.message})}),y=a.useMemo(()=>c.data?.items??Me.filter(s=>s.type===i),[i,c.data?.items]),se=a.useMemo(()=>Array.from(new Set(y.map(s=>s.country))).sort(),[y]),ae=a.useMemo(()=>Array.from(new Set(y.flatMap(s=>s.categories))).sort(),[y]),d=a.useMemo(()=>{const s=S.trim().toLowerCase(),t=p==="all"?0:Number(p),f=h?Number(h):Number.POSITIVE_INFINITY;return y.filter(n=>(!s||n.name.toLowerCase().includes(s)||n.domain.toLowerCase().includes(s)||n.categories.some(oe=>oe.toLowerCase().includes(s)))&&(u==="all"||n.country===u)&&(x==="all"||n.categories.includes(x))&&Math.max(n.domainRating,n.domainAuthority)>=t&&n.price<=f)},[i,x,u,S,h,p,y]);a.useEffect(()=>{b(1)},[i,S,u,x,p,h]);const w=Math.max(1,Math.ceil(d.length/N));a.useEffect(()=>{b(s=>Math.min(s,w))},[w]);const te=a.useMemo(()=>{const s=(g-1)*N;return d.slice(s,s+N)},[d,g]),re=d.length===0?0:(g-1)*N+1,ne=d.length===0?0:Math.min(g*N,d.length),T=o.reduce((s,t)=>s+t.price,0),M=o[0]?.currency??"USD",ie=s=>o.some(t=>t.id===s),$=s=>{J(t=>{if(t.some(n=>n.id===s.id))return t.filter(n=>n.id!==s.id);const f=t[0]?.currency;return f&&f!==s.currency?(P.error("Shortlist currencies must match",{description:`Create a separate quote for ${s.currency} placements.`}),t):[...t,s]})},Q=()=>{F(""),U(""),B("all"),G("all"),q("all"),O(""),b(1)},le=()=>{E.mutate({itemIds:o.map(s=>s.id),estimatedTotal:T,estimatedCurrency:M})};return e.jsxs("div",{className:"mx-auto w-full max-w-7xl space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Buy"}),e.jsx(j,{className:"rounded-full border border-orange-200 bg-orange-50 text-orange-700 shadow-none",children:"Beta"})]}),e.jsx("p",{className:"max-w-3xl text-muted-foreground",children:"Find and shortlist Guest Post placements or Digital PR coverage for your GEO campaigns."})]}),e.jsxs(j,{variant:"secondary",className:"w-fit rounded-full px-3 py-1.5 text-xs",children:[e.jsx(ve,{className:"mr-1.5 h-3.5 w-3.5"}),"Secure supplier connection"]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(l,{variant:i==="guest_post"?"geo":"outline",className:"gap-2",onClick:()=>v("guest_post"),children:[e.jsx(W,{className:"h-4 w-4"}),"Guest Post"]}),e.jsxs(l,{variant:i==="digital_pr"?"geo":"outline",className:"gap-2",onClick:()=>v("digital_pr"),children:[e.jsx(H,{className:"h-4 w-4"}),"Digital PR"]})]}),e.jsxs(fe,{className:"overflow-hidden border-border/60 shadow-sm",children:[e.jsx(je,{className:"border-b border-border/50 bg-muted/20",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{children:[e.jsx(ye,{children:Y[i].title}),e.jsx(Ne,{children:Y[i].description})]}),e.jsx(j,{variant:"secondary",className:"w-fit rounded-full px-3 py-1 text-xs",children:c.isLoading?"Loading inventory":c.data?.source==="collaborator"?"Live · Collaborator":"Demo inventory"})]})}),e.jsxs(be,{className:"grid gap-6 p-6 xl:grid-cols-[minmax(0,1fr)_340px]",children:[e.jsxs("div",{className:"min-w-0 space-y-5",children:[e.jsx("div",{className:"rounded-2xl border border-border/60 bg-muted/15 p-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx(K,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(z,{value:k,onChange:s=>F(s.target.value),placeholder:"Search publication, domain, or topic",className:"pl-9"})]}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-[repeat(3,minmax(0,1fr))_minmax(0,0.9fr)_auto] xl:items-center",children:[e.jsxs(A,{value:u,onValueChange:B,children:[e.jsx(I,{children:e.jsx(_,{placeholder:"Country"})}),e.jsxs(R,{children:[e.jsx(m,{value:"all",children:"All countries"}),se.map(s=>e.jsx(m,{value:s,children:s},s))]})]}),e.jsxs(A,{value:x,onValueChange:G,children:[e.jsx(I,{children:e.jsx(_,{placeholder:"Category"})}),e.jsxs(R,{children:[e.jsx(m,{value:"all",children:"All categories"}),ae.map(s=>e.jsx(m,{value:s,children:s},s))]})]}),e.jsxs(A,{value:p,onValueChange:q,children:[e.jsx(I,{children:e.jsx(_,{placeholder:"Min. authority"})}),e.jsxs(R,{children:[e.jsx(m,{value:"all",children:"Any authority"}),e.jsx(m,{value:"50",children:"Authority 50+"}),e.jsx(m,{value:"60",children:"Authority 60+"}),e.jsx(m,{value:"70",children:"Authority 70+"}),e.jsx(m,{value:"80",children:"Authority 80+"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 xl:min-w-0",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground xl:sr-only",children:"Maximum price"}),e.jsx(z,{type:"number",min:0,value:h,onChange:s=>O(s.target.value),placeholder:"Max price","aria-label":"Maximum price",className:"h-10 w-full xl:min-w-0"})]}),e.jsx(l,{type:"button",variant:"ghost",size:"sm",onClick:Q,className:"xl:justify-self-end",children:"Clear filters"})]})]})}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-medium",children:[d.length," opportunities"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:d.length>0?`Showing ${re}-${ne}
1 on this page`:"Adjust filters to see more results"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:c.isFetching&&!c.isLoading?"Refreshing inventory...":"Pricing shown as supplier estimates"})]}),e.jsxs("div",{className:"space-y-3",children:[c.isLoading&&Array.from({length:6}).map((s,t)=>e.jsx(Ie,{},`geo-buy-skeleton-${t}`)),!c.isLoading&&te.map(s=>{const t=ie(s.id);return e.jsx("div",{className:"rounded-2xl border border-border/60 bg-card p-5 shadow-sm transition hover:border-primary/25 hover:shadow-md",children:e.jsxs("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-xl bg-primary/10 text-primary",children:s.type==="guest_post"?e.jsx(W,{className:"h-4 w-4"}):e.jsx(H,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate font-semibold",children:s.name}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s.domain})]}),s.categories.map(f=>e.jsx(j,{variant:"outline",className:"rounded-full",children:f},f))]}),e.jsx("p",{className:"mt-4 text-sm leading-6 text-muted-foreground",children:s.description}),e.jsxs("div",{className:"mt-4 grid gap-3 text-sm sm:grid-cols-2 lg:grid-cols-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Se,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:s.country})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ce,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("span",{children:[Pe.format(s.monthlyTraffic)," traffic"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("span",{children:[s.domainRating>0?`DR ${s.domainRating} · `:"","DA ",s.domainAuthority]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(De,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("span",{children:[s.turnaroundDays," days"]})]})]}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-xs text-muted-foreground",children:[e.jsx(j,{variant:"secondary",className:"rounded-full",children:s.placement}),e.jsx(j,{variant:"secondary",className:"rounded-full",children:s.writingIncluded?"Writing included":"Content supplied by you"}),e.jsx(j,{variant:"secondary",className:"rounded-full",children:s.sponsoredLabel?"Sponsored label":"No sponsored label"})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-4 lg:w-40 lg:flex-col lg:items-end",children:[e.jsxs("div",{className:"text-left lg:text-right",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Starting at"}),e.jsx("p",{className:"text-xl font-semibold",children:D(s.price,s.currency)})]}),e.jsxs(l,{variant:t?"secondary":"geo",className:"gap-2",onClick:()=>$(s),children:[t?e.jsx(de,{className:"h-4 w-4"}):e.jsx(L,{className:"h-4 w-4"}),t?"Added":"Add"]})]})]})},s.id)}),!c.isLoading&&d.length===0&&e.jsxs("div",{className:"rounded-2xl border border-dashed border-border p-10 text-center",children:[e.jsx(K,{className:"mx-auto h-6 w-6 text-muted-foreground"}),e.jsx("p",{className:"mt-3 font-medium",children:"No matching opportunities"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Try broadening the filters or removing the price limit."}),e.jsx(l,{variant:"outline",className:"mt-4",onClick:Q,children:"Clear filters"})]}),!c.isLoading&&d.length>N&&e.jsxs("div",{className:"flex flex-col gap-3 rounded-2xl border border-border/60 bg-muted/10 px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Page ",g," of ",w]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(l,{type:"button",variant:"outline",size:"sm",onClick:()=>b(s=>Math.max(1,s-1)),disabled:g===1,children:"Previous"}),e.jsx(l,{type:"button",variant:"outline",size:"sm",onClick:()=>b(s=>Math.min(w,s+1)),disabled:g===w,children:"Next"})]})]})]})]}
1),e.jsxs("aside",{className:"h-fit rounded-2xl border border-border/60 bg-gradient-to-br from-background via-background to-muted/30 p-4 xl:sticky xl:top-6",children:[e.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[e.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-xl bg-primary/10 text-primary",children:e.jsx(L,{className:"h-4 w-4"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold",children:"Placement shortlist"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Review before preparing a quote preview."})]})]}),e.jsx("div",{className:"rounded-2xl border border-border/60 bg-card p-4 shadow-sm",children:o.length===0?e.jsxs("div",{className:"py-8 text-center",children:[e.jsx(ke,{className:"mx-auto h-5 w-5 text-muted-foreground"}),e.jsx("p",{className:"mt-3 text-sm font-medium",children:"Your shortlist is empty"}),e.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:"Add placements from the marketplace to compare the estimated budget."})]}):e.jsxs("div",{className:"space-y-3",children:[o.map(s=>e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:s.name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[D(s.price,s.currency)," · ",s.turnaroundDays," days"]})]}),e.jsx(l,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:()=>$(s),"aria-label":`Remove ${s.name}`,children:e.jsx(Ee,{className:"h-3.5 w-3.5"})})]},s.id)),e.jsx(we,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-medium",children:"Estimated total"}),e.jsx("span",{className:"font-semibold",children:D(T,M)})]}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:"Final pricing and availability are confirmed before purchase."})]})}),e.jsxs(l,{variant:"geo",className:"mt-4 w-full gap-2",disabled:o.length===0,onClick:()=>C(!0),children:[e.jsx(L,{className:"h-4 w-4"}),"Prepare quote"]})]})]})]}),e.jsx(me,{open:X,onOpenChange:C,children:e.jsxs(ue,{children:[e.jsxs(xe,{children:[e.jsx(pe,{children:"Prepare a placement quote?"}),e.jsxs(he,{children:["This creates an estimate for ",o.length," selected placement",o.length===1?"":"s",". It does not contact a supplier or charge your account."]})]}),e.jsxs("div",{className:"rounded-xl border border-border/60 bg-muted/20 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{children:"Selected opportunities"}),e.jsx("strong",{children:o.length})]}),e.jsxs("div",{className:"mt-2 flex items-center justify-between text-sm",children:[e.jsx("span",{children:"Estimated budget"}),e.jsx("strong",{children:D(T,M)})]})]}),e.jsxs(ge,{children:[e.jsx(l,{variant:"outline",onClick:()=>C(!1),children:"Cancel"}),e.jsxs(l,{variant:"geo",onClick:le,disabled:E.isPending,className:"gap-2",children:[E.isPending&&e.jsx(Te,{className:"h-4 w-4 animate-spin"}),"Prepare preview"]})]})]})})]})}export{rs as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.