1import{j as e}from"./vendor-ui-CEGjIuqP.js";import{a as m,L as j,f as N,N as b,P as _,F as y,j as v,s as x}from"./index-DgkqAiwu.js";import{r as u,L as p}from"./vendor-react-BT-Op1j_.js";import"./vendor-dnd-D3FEUJ2d.js";import{u as w}from"./vendor-data-CqtBkUbK.js";import"./vendor-editor-CAsPUtf2.js";import{u as E}from"./usePageName-B5MVQXdC.js";import"./vendor-charts-F376sfYw.js";const P=({partner:r})=>{const o=r.short_description||"",n=`/partners/${r.slug}`;return e.jsxs("div",{className:"group relative w-full rounded-lg overflow-hidden bg-card border border-border shadow-card hover:shadow-lg transition-all flex flex-col",children:[r.logo_url?e.jsx("img",{src:r.logo_url,alt:r.name,className:"w-full h-48 object-contain p-6",loading:"lazy"}):e.jsx("div",{className:"w-full h-48 bg-muted flex items-center justify-center text-sm text-muted-foreground",children:r.name}),e.jsxs("div",{className:"px-6 pb-6 pt-2 flex flex-col flex-1",children:[e.jsx(p,{to:n,className:"hover:text-primary transition-colors",children:e.jsx("h3",{className:"font-bold text-foreground text-lg uppercase mb-3 line-clamp-2",children:r.name})}),o&&e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3 mb-4 flex-1",children:o}),e.jsxs(p,{to:n,className:"inline-flex items-center gap-1 text-primary text-sm font-medium hover:underline mt-auto",children:["View details ",e.jsx(v,{className:"h-4 w-4"})]})]})]})},D=()=>{const r=E(),{data:o,isLoading:n}=w({queryKey:["public-partners"],queryFn:async()=>{const[t,a]=await Promise.all([x.from("partners").select("id, name, slug, logo_url, website, description, short_description, tier_id, display_order").eq("is_active",!0).order("display_order",{ascending:!0}),x.from("partner_tiers").select("id, name, display_order").eq("is_active",!0).order("display_order",{ascending:!0})]);if(t.error)throw t.error;if(a.error)throw a.error;return{partners:t.data??[],tiers:a.data??[]}}}),l=u.useMemo(()=>{if(!o)return[];const t=new Map(o.tiers.map(s=>[s.id,s])),a=new Map;for(const s of o.partners){const i=s.tier_id??"__untiered__";a.has(i)||a.set(i,{tier:s.tier_id?t.get(s.tier_id)??null:null,partners:[]}),a.get(i).partners.push(s)}return Array.from(a.values()).sort((s,i)=>{var d,c;const f=((d=s.tier)==null?void 0:d.display_order)??Number.MAX_SAFE_INTEGER,g=((c=i.tier)==null?void 0:c.display_order)??Number.MAX_SAFE_INTEGER;return f-g})},[o]),h=u.useMemo(()=>[{id:"hero",component:e.jsx("section",{className:"pt-page pb-5 bg-background",children:e.jsxs("div",{className:"container mx-auto px-4 text-center",children:[e.jsx(m,{pageName:r,sectionName:"hero",contentKey:"title",defaultValue:"Sponsors and Partners",className:"text-4xl md:text-5xl font-bold mb-4 text-gradient-title",as:"h1"}),e.jsx(m,{pageName:r,sectionName:"hero",contentKey:"subtitle",defaultValue:"Our event wouldn't be possible without the support of our amazing partners. Discover the brands that have helped make this event a success.",className:"text-lg text-muted-foreground w-full mx-auto",as:"p"})]})})},{id:"partners-grid",component:e.jsx("section",{className:"py-16",children:e.jsx("div",{className:"container mx-auto px-4",children:n?e.jsx("div",{className:"flex justify-center",children:e.jsx(j,{className:"h-8 w-8 animate-spin text-primary"})}):l.length===0?e.jsx("p",{className:"text-center text-muted-foreground",children:"No partners yet."}):e.jsx("div",{className:"space-y-12",children:l.map((t,a)=>{var s;return e.jsxs("div",{children:[t.tier&&e.jsx("h2",{className:"text-2xl md:text-3xl font-bold mb-6 text-center",children:t.tier.name}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-2 lg:grid-cols-4 gap-4 md:gap-8",children:t.partners.map(i=>e.jsx(P,{partner:i},i.id))})]},((s=t.tier)==null?void 0:s.id)??`untiered-${a}`)})})})})}],[r,l,n]);return e.jsxs(e.Fragment,{children:[e.jsx(N,{titlePrefix:"Sponsors and Partners"}),e.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[e.jsx(b,{}),e.jsx("main",{className:"flex-1 pt-page",children:e.jsx(_,{pageName:r,sections:h})}),e.jsx(y,{})]})]})};export{D 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.