1import{A as L,h as v,a8 as M,u as E,dw as B,r as F,ab as I,cd as z,cc as w,ac as V,j as e,ad as A,d as O,bJ as T,B as $,O as x,al as y,z as S}from"./index-B6VyhArb.js";import{P as D}from"./Pagination-t7dyVY6t.js";import{C as q}from"./circle-alert-BVGHXw4Y.js";const J="https://flightsim.to";async function G(a=1,l=12){var o,m,t,h;const i=Math.min(50,Math.max(1,l)),s=Math.max(1,a),r=await fetch(`${J}/backend/store/presentation?page=${s}&limit=${i}`,{credentials:"include"});if(!r.ok)throw new Error("Failed to fetch store vendors");const n=await r.json();return{vendors:n.data??[],total:((o=n.meta)==null?void 0:o.total)??0,page:((m=n.meta)==null?void 0:m.page)??s,perPage:((t=n.meta)==null?void 0:t.perPage)??i,totalPages:((h=n.meta)==null?void 0:h.totalPages)??1}}function H(a,l=12){return L({queryKey:["store-presentation",a,l],queryFn:()=>G(a,l),staleTime:5*60*1e3,placeholderData:i=>i})}const P=12,N=a=>a>1?`/partners/store/${a}`:"/partners/store";function K({rating:a,reviews:l}){const{t:i}=v("storeVendors");return e.jsxs("div",{className:"flex items-center gap-1","aria-label":`${a} / 5`,children:[e.jsx("div",{className:"flex",children:[0,1,2,3,4].map(s=>e.jsx(S,{className:`h-3.5 w-3.5 ${s<Math.round(a)?"fill-amber-400 text-amber-400":"text-muted-foreground/30"}`},s))}),e.jsxs("span",{className:"text-xs text-muted-foreground ml-1",children:[a.toFixed(1)," · ",i("reviews",{count:l})]})]})}function k(a){const l=new Date(a).getTime(),i=Date.now(),s=Math.max(0,Math.floor((i-l)/(1e3*60*60*24)));return s>=365?{value:Math.max(1,Math.round(s/365)),unit:"years"}:s>=30?{value:Math.max(1,Math.round(s/30)),unit:"months"}:{value:Math.max(1,s),unit:"days"}}function Q({vendor:a,index:l}){var m;const{t:i}=v("storeVendors"),s=l%2===1,r=l%2===0?"background":"muted",n=a.background??null,o=((m=a.latestReleases.find(t=>t.thumbnail))==null?void 0:m.thumbnail)??null;return e.jsxs("section",{className:`relative overflow-hidden border-b ${l%2===0?"bg-background":"bg-muted/40"}`,children:[n&&e.jsxs("div",{"aria-hidden":!0,className:"absolute inset-0 pointer-events-none",children:[e.jsx("img",{src:n,alt:"",loading:"lazy",className:"w-full h-full object-cover blur-lg scale-125 opacity-45 dark:opacity-60"}),e.jsx("div",{className:"absolute inset-0 dark:hidden",style:{background:`linear-gradient(to bottom, hsl(var(--${r}) / 0.9), hsl(var(--${r}) / 0.72), hsl(var(--${r}) / 0.9))`}}),e.jsx("div",{className:"absolute inset-0 hidden dark:block",style:{background:`linear-gradient(to bottom, hsl(var(--${r}) / 0.75), hsl(var(--${r}) / 0.35), hsl(var(--${r}) / 0.75))`}})]}),e.jsxs("div",{className:"relative max-w-7xl mx-auto px-4 sm:px-6 py-16 sm:py-20",children:[e.jsxs("div",{className:`grid gap-10 lg:gap-16 ${o?"lg:grid-cols-2 items-center":""}`,children:[o&&e.jsx("div",{className:s?"lg:order-2":"",children:e.jsxs("div",{className:"relative rounded-2xl overflow-hidden border shadow-lg",children:[e.jsx("img",{src:o,alt:a.vendorName,width:1280,height:720,loading:"lazy",className:"w-full h-auto object-cover"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/40 via-transparent to-transparent pointer-events-none"})]})}),e.jsxs("div",{className:o&&s?"lg:order-1":"",children:[e.jsx("h2",{className:"text-3xl sm:text-4xl font-bold tracking-tight mb-3",children:a.vendorName}),a.about&&e.jsx("p",{className:"text-muted-foreground text-lg leading-relaxed mb-6",children:a.about}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx($,{size:"lg",asChild:!0,children:e.jsxs("a",{href:a.link,target:"_blank",rel:"noopener noreferrer",children:[i("visit_store"),e.jsx(y,{className:"h-4 w-4 ml-2"})]})}),a.averageRating!==null&&e.jsx(K,{rating:a.averageRating,reviews:a.reviewCount})]}),a.partnerSince&&e.jsx("p",{className:"text-sm text-muted-foreground mt-4",children:i("partner_since",{count:k(a.partnerSince).value,context:k(a.partnerSince).unit})})]})]}),a.latestReleases.length>0&&e.jsxs("div",{className:"mt-12",children:[e.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground mb-4",children:i("latest_releases")}),e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:a.latestReleases.map(t=>e.jsxs("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",className:"group rounded-xl border bg-card overflow-hidden flex flex-col transition hover:border-primary/40 hover:shadow-md",children:[t.thumbnail&&e.jsx("div",{className:"aspect-[16/10] overflow-hidden",children:e.jsx("img",{src:t.thumbnail,alt:t.title,loading:"lazy",className:"w-full h-full object-cover transition-transform group-hover:scale-105"})}),e.jsxs("div",{className:"p-4 flex flex-col gap-1",children:[e.jsx("span",{className:"font-semibold leading-tight",children:t.title}),t.description&&e.jsx("span",{className:"text-sm text-muted-foreground line-clamp-2",children:t.description}),t.rating!==null&&t.ratingCount>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(S,{className:"h-3 w-3 fill-amber-400 text-amber-400"}),t.rating.toFixed(1)," · ",i("reviews",{count:t.ratingCount})]}),e.jsxs("span",{className:"mt-auto pt-2 text-sm font-medium text-primary inline-flex items-center gap-1",children:[i("view_product"),e.jsx(y,{className:"h-3 w-3"})]})]})]},t.slug))})]})]})]})}function _(){return e.jsx("section",{className:"border-b bg-background",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-16 sm:py-20",children:[e.jsxs("div",{className:"grid lg:grid-cols-2 gap-10 lg:gap-16 items-center",children:[e.jsx(x,{className:"aspect-video rounded-2xl"}),e.jsxs("div",{children:[e.jsx(x,{className:"h-9 w-1/2 mb-3"}),e.jsx(x,{className:"h-4 w-full mb-2"}),e.jsx(x,{className:"h-4 w-3/4 mb-6"}),e.jsx(x,{className:"h-11 w-40"})]})]}),e.jsx("div",{className:"mt-12 grid grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:4}).map((a,l)=>e.jsx(x,{className:"h-44 rounded-xl"},l))})]})})}function Y(){const{t:a}=v("storeVendors"),l=M(),{page:i}=E(),s=Number.parseInt(i??"1",10),r=Number.isFinite(s)&&s>0?s:1,{data:n,isLoading:o,isError:m,refetch:t}=H(r,P),h=g=>{l(N(g)),window.scrollTo({top:0})},u=(n==null?void 0:n.vendors)??[],d=B(),p=`${d}${N(r)}`,b=r>1?a("page_title_paged",{page:r}):a("page_title"),j=r>1?a("page_description_paged",{page:r}):a("page_description"),R=F.useMemo(()=>{const g=I([{name:z(),url:`${d}/`},{name:"Partners",url:`${d}/partners`},{name:w(a("page_title")),url:`${d}/partners/store`}]),f={"@context":"https://schema.org","@type":"CollectionPage",name:w(b),description:j,url:p,isPartOf:{"@type":"WebSite",name:"Flightsim.to",url:d},mainEntity:{"@type":"ItemList",numberOfItems:u.length,itemListElement:u.map((c,C)=>({"@type":"ListItem",position:(r-1)*P+C+1,item:{"@type":"Organization",name:c.vendorName,url:c.link,...c.about?{description:c.about}:{},...c.averageRating!==null&&c.reviewCount>0?{aggregateRating:{"@type":"AggregateRating",ratingValue:c.averageRating,reviewCount:c.reviewCount,bestRating:5,worstRating:1}}:{}}}))}};return[g,f]},[p,j,d,r,a,b,u]);return V({title:b,description:j,canonical:p,ogType:"website",twitterCard:"summary_large_image",jsonLd:R}),e.jsxs(A,{children:[e.jsxs("section",{className:"relative overflow-hidden border-b bg-muted/30",children:[e.jsx("div",{"aria-hidden":!0,
1className:"absolute inset-0 opacity-[0.04] pointer-events-none",style:{backgroundImage:"radial-gradient(circle at 20% 30%, hsl(var(--primary)) 0%, transparent 45%), radial-gradient(circle at 80% 70%, hsl(var(--primary)) 0%, transparent 45%)"}}),e.jsxs("div",{className:"relative max-w-5xl mx-auto px-4 sm:px-6 py-16 sm:py-24 text-center",children:[e.jsxs(O,{variant:"secondary",className:"mb-4",children:[e.jsx(T,{className:"h-3.5 w-3.5 mr-1.5"}),a("badge")]}),e.jsx("h1",{className:"text-4xl sm:text-5xl font-bold tracking-tight mb-4",children:a("title")}),e.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:a("subtitle")})]})]}),o?e.jsxs(e.Fragment,{children:[e.jsx(_,{}),e.jsx(_,{})]}):m?e.jsxs("section",{className:"max-w-2xl mx-auto px-4 py-24 text-center",children:[e.jsx(q,{className:"h-10 w-10 mx-auto text-muted-foreground mb-4"}),e.jsx("p",{className:"text-lg font-medium mb-2",children:a("error_title")}),e.jsx("p",{className:"text-muted-foreground mb-6",children:a("error_description")}),e.jsx($,{onClick:()=>t(),children:a("retry")})]}):u.length===0?e.jsx("section",{className:"max-w-2xl mx-auto px-4 py-24 text-center",children:e.jsx("p",{className:"text-lg text-muted-foreground",children:a("empty")})}):e.jsxs(e.Fragment,{children:[u.map((g,f)=>e.jsx(Q,{vendor:g,index:f},g.vendorSlug)),n&&n.totalPages>1&&e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 pb-12",children:e.jsx(D,{currentPage:n.page,totalPages:n.totalPages,totalItems:n.total,itemsPerPage:n.perPage,onPageChange:h,getPageHref:N,showPerPage:!1})})]})]})}export{Y 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.