import { e as createComponent, k as renderComponent, r as renderTemplate, h as createAstro, ak as defineScriptVars, g as addAttribute, m as maybeRenderHead } from '../../chunks/astro/server_DePCulMI.mjs';
import 'piccolore';
import { $ as $$Layout } from '../../chunks/Layout_DxAv3UTa.mjs';
import { $ as $$ProductCard } from '../../chunks/ProductCard_7e_PI4fu.mjs';
import { b as getBrandBySlugFromDB, g as getProductsFromDB, c as getModelsByBrand } from '../../chunks/products_DQrRaeeW.mjs';
import { g as getBrandContent } from '../../chunks/brand-content_DSldSZSb.mjs';
/* empty css                                    */
export { renderers } from '../../renderers.mjs';

var __freeze = Object.freeze;
var __defProp = Object.defineProperty;
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(cooked.slice()) }));
var _a;
const $$Astro = createAstro();
const $$Index = createComponent(async ($$result, $$props, $$slots) => {
  const Astro2 = $$result.createAstro($$Astro, $$props, $$slots);
  Astro2.self = $$Index;
  const { slug } = Astro2.params;
  const dbBrand = await getBrandBySlugFromDB(slug);
  const brandName = dbBrand?.name || slug.charAt(0).toUpperCase() + slug.slice(1);
  const logoSrc = dbBrand?.logo_url || null;
  const brandSneakers = await getProductsFromDB({ limit: 24, brand: slug });
  const models = await getModelsByBrand(slug);
  const content = getBrandContent(slug);
  const title = content?.metaTitle || `${brandName} Sneakers \u2014 SneakerPicks`;
  const description = content?.metaDescription || `Vergelijk ${brandName} sneaker prijzen. Bekijk alle modellen en vind de laagste prijs.`;
  const analyticsItems = brandSneakers.map((s, i) => ({
    item_id: s.id,
    item_name: `${s.brand} ${s.name}`,
    item_brand: s.brand,
    price: s.lowestPrice,
    index: i
  }));
  const listId = `brand_${slug}`;
  const listName = `${brandName} Sneakers`;
  return renderTemplate`${renderComponent($$result, "Layout", $$Layout, { "title": title, "description": description, "data-astro-cid-dwkrumme": true }, { "default": async ($$result2) => renderTemplate(_a || (_a = __template(["  ", '<section class="relative overflow-hidden" data-astro-cid-dwkrumme> <div class="absolute inset-0 bg-gradient-to-b from-accent/5 via-transparent to-transparent" data-astro-cid-dwkrumme></div> <div class="relative mx-auto max-w-7xl px-4 py-16 sm:px-6" data-astro-cid-dwkrumme> <div class="flex items-center gap-6" data-astro-cid-dwkrumme> ', ' <div data-astro-cid-dwkrumme> <h1 class="text-4xl font-black tracking-tight sm:text-5xl" data-astro-cid-dwkrumme>', ' Sneakers</h1> <p class="mt-1 text-text-secondary" data-astro-cid-dwkrumme>', " sneakers beschikbaar \xB7 Prijzen vergelijken</p> </div> </div> ", " </div> </section>  ", ' <section class="mx-auto max-w-7xl px-4 py-8 sm:px-6" data-astro-cid-dwkrumme> <h2 class="mb-6 text-sm font-bold uppercase tracking-widest text-text-muted" data-astro-cid-dwkrumme>Alle ', ' sneakers</h2> <div class="grid grid-cols-2 gap-4 sm:gap-6 md:grid-cols-3 lg:grid-cols-4" data-astro-cid-dwkrumme> ', " </div> ", " </section>  ", "<script>(function(){", "\n    window.dataLayer = window.dataLayer || [];\n    window.dataLayer.push({ ecommerce: null });\n    window.dataLayer.push({\n      event: 'view_item_list',\n      ecommerce: {\n        item_list_id: listId,\n        item_list_name: listName,\n        items: analyticsItems.map(function(item) {\n          return Object.assign({}, item, { item_list_id: listId, item_list_name: listName });\n        })\n      }\n    });\n  })();<\/script> "])), maybeRenderHead(), logoSrc ? renderTemplate`<img${addAttribute(logoSrc, "src")}${addAttribute(brandName, "alt")} class="brand-logo h-12 w-auto max-w-[120px] object-contain" data-astro-cid-dwkrumme>` : renderTemplate`<span class="text-5xl font-black text-accent" data-astro-cid-dwkrumme>${brandName.charAt(0)}</span>`, brandName, brandSneakers.length, content && renderTemplate`<p class="mt-4 text-lg italic text-accent" data-astro-cid-dwkrumme>${content.tagline}</p>`, models.length > 0 && renderTemplate`<section class="mx-auto max-w-7xl px-4 py-8 sm:px-6" data-astro-cid-dwkrumme> <h2 class="mb-4 text-sm font-bold uppercase tracking-widest text-text-muted" data-astro-cid-dwkrumme>Populaire ${brandName} modellen</h2> <div class="flex flex-wrap gap-3" data-astro-cid-dwkrumme> ${models.slice(0, 20).map((m) => renderTemplate`<a${addAttribute(`/merken/${slug}/${m.slug}`, "href")} class="rounded-full border border-border/50 bg-bg-card px-4 py-2 text-sm font-semibold text-text-secondary hover:border-accent/40 hover:text-accent transition-colors" data-astro-cid-dwkrumme> ${m.name} <span class="text-text-muted ml-1" data-astro-cid-dwkrumme>(${m.count})</span> </a>`)} </div> </section>`, brandName, brandSneakers.map((sneaker, i) => renderTemplate`${renderComponent($$result2, "ProductCard", $$ProductCard, { "sneaker": sneaker, "index": i, "data-astro-cid-dwkrumme": true })}`), brandSneakers.length === 0 && renderTemplate`<div class="py-20 text-center" data-astro-cid-dwkrumme> <p class="text-lg text-text-muted" data-astro-cid-dwkrumme>Nog geen sneakers gevonden voor ${brandName}.</p> </div>`, content && renderTemplate`<section class="mx-auto max-w-7xl px-4 py-16 sm:px-6" data-astro-cid-dwkrumme> <div class="mx-auto max-w-3xl" data-astro-cid-dwkrumme> <h2 class="mb-6 text-2xl font-black tracking-tight" data-astro-cid-dwkrumme>Over ${brandName}</h2> <div class="space-y-4 text-text-secondary leading-relaxed" data-astro-cid-dwkrumme> ${content.description.split("\n\n").map((paragraph) => renderTemplate`<p data-astro-cid-dwkrumme>${paragraph}</p>`)} </div> <div class="mt-8 grid grid-cols-2 gap-4 sm:grid-cols-3" data-astro-cid-dwkrumme> <div class="rounded-2xl border border-border/50 bg-bg-card p-4" data-astro-cid-dwkrumme> <p class="text-xs font-bold uppercase tracking-widest text-text-muted" data-astro-cid-dwkrumme>Opgericht</p> <p class="mt-1 text-lg font-black text-text" data-astro-cid-dwkrumme>${content.founded}</p> </div> <div class="rounded-2xl border border-border/50 bg-bg-card p-4" data-astro-cid-dwkrumme> <p class="text-xs font-bold uppercase tracking-widest text-text-muted" data-astro-cid-dwkrumme>Oorsprong</p> <p class="mt-1 text-lg font-black text-text" data-astro-cid-dwkrumme>${content.origin}</p> </div> <div class="col-span-2 rounded-2xl border border-border/50 bg-bg-card p-4 sm:col-span-1" data-astro-cid-dwkrumme> <p class="text-xs font-bold uppercase tracking-widest text-text-muted" data-astro-cid-dwkrumme>Sneakers</p> <p class="mt-1 text-lg font-black text-text" data-astro-cid-dwkrumme>${brandSneakers.length} modellen</p> </div> </div> <div class="mt-8" data-astro-cid-dwkrumme> <h3 class="mb-4 text-sm font-bold uppercase tracking-widest text-text-muted" data-astro-cid-dwkrumme>Populaire ${brandName} modellen</h3> <div class="flex flex-wrap gap-2" data-astro-cid-dwkrumme> ${content.popularModels.map((model) => renderTemplate`<span class="rounded-full border border-border/50 bg-bg-card px-4 py-2 text-sm font-semibold text-text-secondary" data-astro-cid-dwkrumme> ${model} </span>`)} </div> </div> </div> </section>`, defineScriptVars({ analyticsItems, listId, listName })) })} `;
}, "C:/Users/Roel/clawd/sneakerpicks/src/pages/merken/[slug]/index.astro", void 0);

const $$file = "C:/Users/Roel/clawd/sneakerpicks/src/pages/merken/[slug]/index.astro";
const $$url = "/merken/[slug]";

const _page = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
  __proto__: null,
  default: $$Index,
  file: $$file,
  url: $$url
}, Symbol.toStringTag, { value: 'Module' }));

const page = () => _page;

export { page };
