@reblu/site-blocks 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -13060,6 +13060,52 @@ function markdownToSafeHtml(markdown) {
13060
13060
  return sanitizeHtml(rawHtml);
13061
13061
  }
13062
13062
 
13063
+ // src/lib/markdown-plain-text.ts
13064
+ var INLINE_TAGS = /* @__PURE__ */ new Set([
13065
+ "a",
13066
+ "abbr",
13067
+ "b",
13068
+ "code",
13069
+ "del",
13070
+ "em",
13071
+ "i",
13072
+ "ins",
13073
+ "kbd",
13074
+ "mark",
13075
+ "s",
13076
+ "small",
13077
+ "span",
13078
+ "strong",
13079
+ "sub",
13080
+ "sup",
13081
+ "u"
13082
+ ]);
13083
+ function collectText(nodes, out) {
13084
+ for (const node of nodes) {
13085
+ if (node.type === "text") {
13086
+ out.push(node.value);
13087
+ } else if (node.type === "element") {
13088
+ const block = !INLINE_TAGS.has(node.tagName);
13089
+ if (block) out.push(" ");
13090
+ collectText(node.children, out);
13091
+ if (block) out.push(" ");
13092
+ }
13093
+ }
13094
+ }
13095
+ function markdownToPlainText(markdown, { maxLength } = {}) {
13096
+ const html5 = markdownToSafeHtml(markdown);
13097
+ if (!html5) return "";
13098
+ const tree = fromParse5(parseFragment(html5));
13099
+ const parts = [];
13100
+ collectText(tree.children, parts);
13101
+ const text3 = parts.join("").replace(/\s+/g, " ").trim();
13102
+ if (maxLength === void 0 || text3.length <= maxLength) return text3;
13103
+ let cut = text3.slice(0, Math.max(0, maxLength - 1));
13104
+ const lastSpace = cut.lastIndexOf(" ");
13105
+ if (lastSpace > 0) cut = cut.slice(0, lastSpace);
13106
+ return `${cut.trimEnd()}\u2026`;
13107
+ }
13108
+
13063
13109
  // src/components/markdown-renderer.tsx
13064
13110
  import { cn } from "@reblu/site-ui/utils";
13065
13111
  import {
@@ -13236,13 +13282,60 @@ function SafeHtml({ html: html5, className, headingOffset = 0 }) {
13236
13282
  return /* @__PURE__ */ jsx("div", { className: cn("max-w-none", className), "data-slot": "safe-html", children: parse3(html5, buildOptions(headingOffset)) });
13237
13283
  }
13238
13284
 
13285
+ // src/components/course-description.tsx
13286
+ import { cn as cn2 } from "@reblu/site-ui/utils";
13287
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
13288
+ function isVisiblyEmpty(html5) {
13289
+ if (/<(img|iframe|hr)\b/i.test(html5)) return false;
13290
+ return html5.replace(/<[^>]*>/g, "").trim() === "";
13291
+ }
13292
+ function CourseDescription({
13293
+ description,
13294
+ heading,
13295
+ headingLevel = 2,
13296
+ headingId = "course-description-heading",
13297
+ headingOffset,
13298
+ className,
13299
+ headingClassName,
13300
+ contentClassName
13301
+ }) {
13302
+ const html5 = markdownToSafeHtml(typeof description === "string" ? description : null);
13303
+ if (!html5 || isVisiblyEmpty(html5)) return null;
13304
+ const hasHeading = heading !== void 0 && heading !== null && heading !== "";
13305
+ const offset = headingOffset ?? (hasHeading ? headingLevel - 1 : 0);
13306
+ const body3 = /* @__PURE__ */ jsx2(
13307
+ SafeHtml,
13308
+ {
13309
+ html: html5,
13310
+ headingOffset: offset,
13311
+ className: cn2("text-muted-foreground", contentClassName)
13312
+ }
13313
+ );
13314
+ if (!hasHeading) {
13315
+ return /* @__PURE__ */ jsx2("div", { "data-slot": "course-description", className, children: body3 });
13316
+ }
13317
+ const Tag = `h${headingLevel}`;
13318
+ return /* @__PURE__ */ jsxs(
13319
+ "section",
13320
+ {
13321
+ "data-slot": "course-description",
13322
+ "aria-labelledby": headingId,
13323
+ className: cn2("space-y-3", className),
13324
+ children: [
13325
+ /* @__PURE__ */ jsx2(Tag, { id: headingId, className: cn2("text-xl font-semibold", headingClassName), children: heading }),
13326
+ body3
13327
+ ]
13328
+ }
13329
+ );
13330
+ }
13331
+
13239
13332
  // src/components/treatment.tsx
13240
- import { cn as cn3 } from "@reblu/site-ui/utils";
13333
+ import { cn as cn4 } from "@reblu/site-ui/utils";
13241
13334
 
13242
13335
  // src/components/_page-parts.tsx
13243
- import { cn as cn2 } from "@reblu/site-ui/utils";
13336
+ import { cn as cn3 } from "@reblu/site-ui/utils";
13244
13337
  import { buttonVariants } from "@reblu/site-ui/button-variants";
13245
- import { Fragment as Fragment2, jsx as jsx2, jsxs } from "react/jsx-runtime";
13338
+ import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
13246
13339
  var KNOWN_BUTTON_VARIANTS = /* @__PURE__ */ new Set([
13247
13340
  "default",
13248
13341
  "destructive",
@@ -13255,11 +13348,11 @@ function toButtonVariant(variant) {
13255
13348
  return variant && KNOWN_BUTTON_VARIANTS.has(variant) ? variant : "default";
13256
13349
  }
13257
13350
  function PageHero({ page }) {
13258
- return /* @__PURE__ */ jsxs("header", { className: "space-y-4", children: [
13259
- page.category && /* @__PURE__ */ jsx2("span", { className: "inline-flex items-center rounded-full bg-secondary px-3 py-1 text-sm font-medium text-secondary-foreground", children: page.category.name }),
13260
- /* @__PURE__ */ jsx2("h1", { className: "text-4xl font-bold tracking-tight", children: page.title }),
13261
- page.subtitle && /* @__PURE__ */ jsx2("p", { className: "text-lg text-muted-foreground", children: page.subtitle }),
13262
- page.coverImageUrl && /* @__PURE__ */ jsx2("div", { className: "relative aspect-[21/9] w-full overflow-hidden rounded-xl bg-muted", children: /* @__PURE__ */ jsx2(
13351
+ return /* @__PURE__ */ jsxs2("header", { className: "space-y-4", children: [
13352
+ page.category && /* @__PURE__ */ jsx3("span", { className: "inline-flex items-center rounded-full bg-secondary px-3 py-1 text-sm font-medium text-secondary-foreground", children: page.category.name }),
13353
+ /* @__PURE__ */ jsx3("h1", { className: "text-4xl font-bold tracking-tight", children: page.title }),
13354
+ page.subtitle && /* @__PURE__ */ jsx3("p", { className: "text-lg text-muted-foreground", children: page.subtitle }),
13355
+ page.coverImageUrl && /* @__PURE__ */ jsx3("div", { className: "relative aspect-[21/9] w-full overflow-hidden rounded-xl bg-muted", children: /* @__PURE__ */ jsx3(
13263
13356
  "img",
13264
13357
  {
13265
13358
  src: page.coverImageUrl,
@@ -13273,14 +13366,14 @@ function PageHero({ page }) {
13273
13366
  function SectionCta({ section }) {
13274
13367
  if (!section.ctaLabel || !section.ctaUrl) return null;
13275
13368
  const variant = toButtonVariant(section.ctaVariant);
13276
- return /* @__PURE__ */ jsx2("div", { className: "pt-2", children: /* @__PURE__ */ jsx2(
13369
+ return /* @__PURE__ */ jsx3("div", { className: "pt-2", children: /* @__PURE__ */ jsx3(
13277
13370
  "a",
13278
13371
  {
13279
13372
  href: section.ctaUrl,
13280
13373
  "data-slot": "button",
13281
13374
  "data-variant": variant,
13282
13375
  "data-size": "default",
13283
- className: cn2(buttonVariants({ variant, size: "default" })),
13376
+ className: cn3(buttonVariants({ variant, size: "default" })),
13284
13377
  ...section.ctaIsExternal ? { target: "_blank", rel: "noopener noreferrer" } : {},
13285
13378
  children: section.ctaLabel
13286
13379
  }
@@ -13288,59 +13381,59 @@ function SectionCta({ section }) {
13288
13381
  }
13289
13382
  function SectionImages({ section }) {
13290
13383
  if (section.images.length === 0) return null;
13291
- return /* @__PURE__ */ jsx2("div", { className: cn2("grid gap-4", section.images.length > 1 ? "sm:grid-cols-2" : "grid-cols-1"), children: section.images.map((img) => /* @__PURE__ */ jsxs("figure", { className: "space-y-1", children: [
13292
- /* @__PURE__ */ jsx2("div", { className: "relative aspect-video w-full overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ jsx2("img", { src: img.url, alt: img.alt, loading: "lazy", className: "h-full w-full object-cover" }) }),
13293
- img.caption && /* @__PURE__ */ jsx2("figcaption", { className: "text-sm text-muted-foreground", children: img.caption })
13384
+ return /* @__PURE__ */ jsx3("div", { className: cn3("grid gap-4", section.images.length > 1 ? "sm:grid-cols-2" : "grid-cols-1"), children: section.images.map((img) => /* @__PURE__ */ jsxs2("figure", { className: "space-y-1", children: [
13385
+ /* @__PURE__ */ jsx3("div", { className: "relative aspect-video w-full overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ jsx3("img", { src: img.url, alt: img.alt, loading: "lazy", className: "h-full w-full object-cover" }) }),
13386
+ img.caption && /* @__PURE__ */ jsx3("figcaption", { className: "text-sm text-muted-foreground", children: img.caption })
13294
13387
  ] }, `${img.url}-${img.order}`)) });
13295
13388
  }
13296
13389
  function PageSectionBlock({ section }) {
13297
13390
  const imageFirst = section.layout === "IMAGE_TEXT";
13298
13391
  const sideBySide = section.layout === "TEXT_IMAGE" || section.layout === "IMAGE_TEXT";
13299
13392
  const hasImages = section.images.length > 0;
13300
- const body3 = /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
13301
- section.heading && /* @__PURE__ */ jsx2("h2", { className: "text-2xl font-bold", children: section.heading }),
13302
- /* @__PURE__ */ jsx2(SafeHtml, { html: sanitizeHtml(section.contentHtml), headingOffset: 2 }),
13303
- /* @__PURE__ */ jsx2(SectionCta, { section })
13393
+ const body3 = /* @__PURE__ */ jsxs2("div", { className: "space-y-4", children: [
13394
+ section.heading && /* @__PURE__ */ jsx3("h2", { className: "text-2xl font-bold", children: section.heading }),
13395
+ /* @__PURE__ */ jsx3(SafeHtml, { html: sanitizeHtml(section.contentHtml), headingOffset: 2 }),
13396
+ /* @__PURE__ */ jsx3(SectionCta, { section })
13304
13397
  ] });
13305
13398
  if (sideBySide && hasImages) {
13306
- return /* @__PURE__ */ jsx2("section", { className: "grid items-center gap-8 md:grid-cols-2", children: imageFirst ? /* @__PURE__ */ jsxs(Fragment2, { children: [
13307
- /* @__PURE__ */ jsx2(SectionImages, { section }),
13399
+ return /* @__PURE__ */ jsx3("section", { className: "grid items-center gap-8 md:grid-cols-2", children: imageFirst ? /* @__PURE__ */ jsxs2(Fragment2, { children: [
13400
+ /* @__PURE__ */ jsx3(SectionImages, { section }),
13308
13401
  body3
13309
- ] }) : /* @__PURE__ */ jsxs(Fragment2, { children: [
13402
+ ] }) : /* @__PURE__ */ jsxs2(Fragment2, { children: [
13310
13403
  body3,
13311
- /* @__PURE__ */ jsx2(SectionImages, { section })
13404
+ /* @__PURE__ */ jsx3(SectionImages, { section })
13312
13405
  ] }) });
13313
13406
  }
13314
- return /* @__PURE__ */ jsxs("section", { className: "space-y-4", children: [
13407
+ return /* @__PURE__ */ jsxs2("section", { className: "space-y-4", children: [
13315
13408
  body3,
13316
- /* @__PURE__ */ jsx2(SectionImages, { section })
13409
+ /* @__PURE__ */ jsx3(SectionImages, { section })
13317
13410
  ] });
13318
13411
  }
13319
13412
  function PageSectionList({ sections }) {
13320
13413
  if (sections.length === 0) return null;
13321
13414
  const ordered = sections.slice().sort((a, b2) => a.order - b2.order);
13322
- return /* @__PURE__ */ jsx2("div", { className: "space-y-12", children: ordered.map((section) => /* @__PURE__ */ jsx2(PageSectionBlock, { section }, section.id)) });
13415
+ return /* @__PURE__ */ jsx3("div", { className: "space-y-12", children: ordered.map((section) => /* @__PURE__ */ jsx3(PageSectionBlock, { section }, section.id)) });
13323
13416
  }
13324
13417
 
13325
13418
  // src/components/treatment.tsx
13326
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
13419
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
13327
13420
  function Treatment({ page, className }) {
13328
- return /* @__PURE__ */ jsxs2("article", { className: cn3("space-y-12", className), "data-slot": "treatment", children: [
13329
- /* @__PURE__ */ jsx3(PageHero, { page }),
13330
- /* @__PURE__ */ jsx3(PageSectionList, { sections: page.sections })
13421
+ return /* @__PURE__ */ jsxs3("article", { className: cn4("space-y-12", className), "data-slot": "treatment", children: [
13422
+ /* @__PURE__ */ jsx4(PageHero, { page }),
13423
+ /* @__PURE__ */ jsx4(PageSectionList, { sections: page.sections })
13331
13424
  ] });
13332
13425
  }
13333
13426
 
13334
13427
  // src/components/parent-page.tsx
13335
- import { cn as cn5 } from "@reblu/site-ui/utils";
13428
+ import { cn as cn6 } from "@reblu/site-ui/utils";
13336
13429
 
13337
13430
  // src/components/page-card-grid.tsx
13338
- import { cn as cn4 } from "@reblu/site-ui/utils";
13339
- import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
13431
+ import { cn as cn5 } from "@reblu/site-ui/utils";
13432
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
13340
13433
  var defaultPageHref = (page) => `/${page.slug}`;
13341
13434
  var pageKey = (page) => `${page.category?.slug ?? ""}/${page.slug}`;
13342
13435
  function PageCardGrid(props) {
13343
- return /* @__PURE__ */ jsx4(PageCardGridSection, { ...props });
13436
+ return /* @__PURE__ */ jsx5(PageCardGridSection, { ...props });
13344
13437
  }
13345
13438
  function PageCardGridSection({
13346
13439
  pages,
@@ -13351,15 +13444,15 @@ function PageCardGridSection({
13351
13444
  }) {
13352
13445
  if (pages.length === 0) return null;
13353
13446
  const showHeading = keepEmptyHeading ? heading !== void 0 : !!heading;
13354
- return /* @__PURE__ */ jsxs3("section", { className: cn4("space-y-6", className), children: [
13355
- showHeading && /* @__PURE__ */ jsx4("h2", { className: "text-2xl font-bold", children: heading }),
13356
- /* @__PURE__ */ jsx4("ul", { className: "grid list-none grid-cols-1 gap-6 p-0 sm:grid-cols-2 lg:grid-cols-3", children: pages.map((page) => /* @__PURE__ */ jsx4("li", { children: /* @__PURE__ */ jsxs3(
13447
+ return /* @__PURE__ */ jsxs4("section", { className: cn5("space-y-6", className), children: [
13448
+ showHeading && /* @__PURE__ */ jsx5("h2", { className: "text-2xl font-bold", children: heading }),
13449
+ /* @__PURE__ */ jsx5("ul", { className: "grid list-none grid-cols-1 gap-6 p-0 sm:grid-cols-2 lg:grid-cols-3", children: pages.map((page) => /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsxs4(
13357
13450
  "a",
13358
13451
  {
13359
13452
  href: pageHref(page),
13360
13453
  className: "group flex h-full flex-col overflow-hidden rounded-lg border bg-card transition-shadow hover:shadow-lg",
13361
13454
  children: [
13362
- page.coverImageUrl && /* @__PURE__ */ jsx4("div", { className: "relative aspect-video overflow-hidden bg-muted", children: /* @__PURE__ */ jsx4(
13455
+ page.coverImageUrl && /* @__PURE__ */ jsx5("div", { className: "relative aspect-video overflow-hidden bg-muted", children: /* @__PURE__ */ jsx5(
13363
13456
  "img",
13364
13457
  {
13365
13458
  src: page.coverImageUrl,
@@ -13368,9 +13461,9 @@ function PageCardGridSection({
13368
13461
  className: "h-full w-full object-cover transition-transform group-hover:scale-105"
13369
13462
  }
13370
13463
  ) }),
13371
- /* @__PURE__ */ jsxs3("div", { className: "flex flex-1 flex-col gap-2 p-4", children: [
13372
- /* @__PURE__ */ jsx4("h3", { className: "font-semibold leading-tight transition-colors group-hover:text-primary", children: page.title }),
13373
- page.excerpt && /* @__PURE__ */ jsx4("p", { className: "line-clamp-2 text-sm text-muted-foreground", children: page.excerpt })
13464
+ /* @__PURE__ */ jsxs4("div", { className: "flex flex-1 flex-col gap-2 p-4", children: [
13465
+ /* @__PURE__ */ jsx5("h3", { className: "font-semibold leading-tight transition-colors group-hover:text-primary", children: page.title }),
13466
+ page.excerpt && /* @__PURE__ */ jsx5("p", { className: "line-clamp-2 text-sm text-muted-foreground", children: page.excerpt })
13374
13467
  ] })
13375
13468
  ]
13376
13469
  }
@@ -13379,7 +13472,7 @@ function PageCardGridSection({
13379
13472
  }
13380
13473
 
13381
13474
  // src/components/parent-page.tsx
13382
- import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
13475
+ import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
13383
13476
  var defaultChildPageHref = (slug) => `/${slug}`;
13384
13477
  function ParentPage({
13385
13478
  page,
@@ -13394,10 +13487,10 @@ function ParentPage({
13394
13487
  const pages = childPages ?? treatments ?? [];
13395
13488
  const hrefFor = childPageHref ?? treatmentHref ?? defaultChildPageHref;
13396
13489
  const label = childPagesLabel ?? treatmentsLabel ?? "Treatments";
13397
- return /* @__PURE__ */ jsxs4("article", { className: cn5("space-y-12", className), "data-slot": "specialty", children: [
13398
- /* @__PURE__ */ jsx5(PageHero, { page }),
13399
- /* @__PURE__ */ jsx5(PageSectionList, { sections: page.sections }),
13400
- /* @__PURE__ */ jsx5(
13490
+ return /* @__PURE__ */ jsxs5("article", { className: cn6("space-y-12", className), "data-slot": "specialty", children: [
13491
+ /* @__PURE__ */ jsx6(PageHero, { page }),
13492
+ /* @__PURE__ */ jsx6(PageSectionList, { sections: page.sections }),
13493
+ /* @__PURE__ */ jsx6(
13401
13494
  PageCardGridSection,
13402
13495
  {
13403
13496
  pages,
@@ -13413,34 +13506,34 @@ function ParentPage({
13413
13506
  var Specialty = ParentPage;
13414
13507
 
13415
13508
  // src/components/profile-card.tsx
13416
- import { cn as cn6 } from "@reblu/site-ui/utils";
13417
- import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
13509
+ import { cn as cn7 } from "@reblu/site-ui/utils";
13510
+ import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
13418
13511
  function initials(name) {
13419
13512
  return name.split(/\s+/).filter(Boolean).slice(0, 2).map((part) => part[0]?.toUpperCase() ?? "").join("");
13420
13513
  }
13421
13514
  function ProfileCard({ name, role, imageUrl, specialties = [], bio, href, className }) {
13422
13515
  const NameTag = href ? "a" : "span";
13423
- return /* @__PURE__ */ jsxs5(
13516
+ return /* @__PURE__ */ jsxs6(
13424
13517
  "article",
13425
13518
  {
13426
- className: cn6(
13519
+ className: cn7(
13427
13520
  "flex flex-col items-center gap-3 rounded-lg border bg-card p-6 text-center",
13428
13521
  className
13429
13522
  ),
13430
13523
  "data-slot": "profile-card",
13431
13524
  children: [
13432
- /* @__PURE__ */ jsx6("div", { className: "relative h-24 w-24 overflow-hidden rounded-full bg-muted", children: imageUrl ? /* @__PURE__ */ jsx6("img", { src: imageUrl, alt: name, loading: "lazy", className: "h-full w-full object-cover" }) : /* @__PURE__ */ jsx6("span", { className: "flex h-full w-full items-center justify-center text-2xl font-semibold text-muted-foreground", "aria-hidden": "true", children: initials(name) }) }),
13433
- /* @__PURE__ */ jsxs5("div", { className: "space-y-1", children: [
13434
- /* @__PURE__ */ jsx6("h3", { className: "text-lg font-semibold leading-tight", children: /* @__PURE__ */ jsx6(
13525
+ /* @__PURE__ */ jsx7("div", { className: "relative h-24 w-24 overflow-hidden rounded-full bg-muted", children: imageUrl ? /* @__PURE__ */ jsx7("img", { src: imageUrl, alt: name, loading: "lazy", className: "h-full w-full object-cover" }) : /* @__PURE__ */ jsx7("span", { className: "flex h-full w-full items-center justify-center text-2xl font-semibold text-muted-foreground", "aria-hidden": "true", children: initials(name) }) }),
13526
+ /* @__PURE__ */ jsxs6("div", { className: "space-y-1", children: [
13527
+ /* @__PURE__ */ jsx7("h3", { className: "text-lg font-semibold leading-tight", children: /* @__PURE__ */ jsx7(
13435
13528
  NameTag,
13436
13529
  {
13437
13530
  ...href ? { href, className: "transition-colors hover:text-primary" } : {},
13438
13531
  children: name
13439
13532
  }
13440
13533
  ) }),
13441
- role && /* @__PURE__ */ jsx6("p", { className: "text-sm text-muted-foreground", children: role })
13534
+ role && /* @__PURE__ */ jsx7("p", { className: "text-sm text-muted-foreground", children: role })
13442
13535
  ] }),
13443
- specialties.length > 0 && /* @__PURE__ */ jsx6("ul", { className: "flex flex-wrap justify-center gap-1.5 p-0", children: specialties.map((s2) => /* @__PURE__ */ jsx6(
13536
+ specialties.length > 0 && /* @__PURE__ */ jsx7("ul", { className: "flex flex-wrap justify-center gap-1.5 p-0", children: specialties.map((s2) => /* @__PURE__ */ jsx7(
13444
13537
  "li",
13445
13538
  {
13446
13539
  className: "inline-flex items-center rounded-full bg-secondary px-2.5 py-0.5 text-xs font-medium text-secondary-foreground",
@@ -13448,28 +13541,28 @@ function ProfileCard({ name, role, imageUrl, specialties = [], bio, href, classN
13448
13541
  },
13449
13542
  s2
13450
13543
  )) }),
13451
- bio && /* @__PURE__ */ jsx6("p", { className: "text-sm text-muted-foreground", children: bio })
13544
+ bio && /* @__PURE__ */ jsx7("p", { className: "text-sm text-muted-foreground", children: bio })
13452
13545
  ]
13453
13546
  }
13454
13547
  );
13455
13548
  }
13456
13549
 
13457
13550
  // src/components/product-card.tsx
13458
- import { cn as cn7 } from "@reblu/site-ui/utils";
13459
- import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
13551
+ import { cn as cn8 } from "@reblu/site-ui/utils";
13552
+ import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
13460
13553
  function ProductCard({ product, href, currencyCode = "EUR", locale, className }) {
13461
13554
  const image = product.images.find((i) => i.isPrimary) ?? product.images[0];
13462
13555
  const hasDiscount = product.comparePrice != null && product.comparePrice > product.price;
13463
- return /* @__PURE__ */ jsxs6(
13556
+ return /* @__PURE__ */ jsxs7(
13464
13557
  "article",
13465
13558
  {
13466
- className: cn7(
13559
+ className: cn8(
13467
13560
  "group flex flex-col overflow-hidden rounded-lg border bg-card transition-shadow hover:shadow-lg",
13468
13561
  className
13469
13562
  ),
13470
13563
  "data-slot": "product-card",
13471
13564
  children: [
13472
- /* @__PURE__ */ jsx7("div", { className: "relative aspect-square overflow-hidden bg-muted", children: image ? /* @__PURE__ */ jsx7(
13565
+ /* @__PURE__ */ jsx8("div", { className: "relative aspect-square overflow-hidden bg-muted", children: image ? /* @__PURE__ */ jsx8(
13473
13566
  "img",
13474
13567
  {
13475
13568
  src: image.url,
@@ -13477,14 +13570,14 @@ function ProductCard({ product, href, currencyCode = "EUR", locale, className })
13477
13570
  loading: "lazy",
13478
13571
  className: "h-full w-full object-cover transition-transform group-hover:scale-105"
13479
13572
  }
13480
- ) : /* @__PURE__ */ jsx7("div", { className: "flex h-full items-center justify-center text-4xl text-muted-foreground/30", "aria-hidden": "true", children: "\u{1F6CD}\uFE0F" }) }),
13481
- /* @__PURE__ */ jsxs6("div", { className: "flex flex-1 flex-col gap-2 p-4", children: [
13482
- product.category && /* @__PURE__ */ jsx7("span", { className: "inline-flex w-fit items-center rounded-full bg-secondary px-2.5 py-0.5 text-xs font-medium text-secondary-foreground", children: product.category.name }),
13483
- /* @__PURE__ */ jsx7("h3", { className: "text-base font-semibold leading-tight", children: href ? /* @__PURE__ */ jsx7("a", { href, className: "transition-colors hover:text-primary", children: product.name }) : product.name }),
13484
- product.shortDescription && /* @__PURE__ */ jsx7("p", { className: "line-clamp-2 text-sm text-muted-foreground", children: product.shortDescription }),
13485
- /* @__PURE__ */ jsxs6("div", { className: "mt-auto flex items-baseline gap-2 pt-2", children: [
13486
- /* @__PURE__ */ jsx7("span", { className: "text-lg font-bold text-foreground", children: formatPrice(product.price, currencyCode, locale) }),
13487
- hasDiscount && /* @__PURE__ */ jsx7("span", { className: "text-sm text-muted-foreground line-through", children: formatPrice(product.comparePrice, currencyCode, locale) })
13573
+ ) : /* @__PURE__ */ jsx8("div", { className: "flex h-full items-center justify-center text-4xl text-muted-foreground/30", "aria-hidden": "true", children: "\u{1F6CD}\uFE0F" }) }),
13574
+ /* @__PURE__ */ jsxs7("div", { className: "flex flex-1 flex-col gap-2 p-4", children: [
13575
+ product.category && /* @__PURE__ */ jsx8("span", { className: "inline-flex w-fit items-center rounded-full bg-secondary px-2.5 py-0.5 text-xs font-medium text-secondary-foreground", children: product.category.name }),
13576
+ /* @__PURE__ */ jsx8("h3", { className: "text-base font-semibold leading-tight", children: href ? /* @__PURE__ */ jsx8("a", { href, className: "transition-colors hover:text-primary", children: product.name }) : product.name }),
13577
+ product.shortDescription && /* @__PURE__ */ jsx8("p", { className: "line-clamp-2 text-sm text-muted-foreground", children: product.shortDescription }),
13578
+ /* @__PURE__ */ jsxs7("div", { className: "mt-auto flex items-baseline gap-2 pt-2", children: [
13579
+ /* @__PURE__ */ jsx8("span", { className: "text-lg font-bold text-foreground", children: formatPrice(product.price, currencyCode, locale) }),
13580
+ hasDiscount && /* @__PURE__ */ jsx8("span", { className: "text-sm text-muted-foreground line-through", children: formatPrice(product.comparePrice, currencyCode, locale) })
13488
13581
  ] })
13489
13582
  ] })
13490
13583
  ]
@@ -13686,8 +13779,8 @@ var __iconNode8 = [
13686
13779
  var Truck = createLucideIcon("truck", __iconNode8);
13687
13780
 
13688
13781
  // src/components/product-trust-items.tsx
13689
- import { cn as cn8 } from "@reblu/site-ui/utils";
13690
- import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
13782
+ import { cn as cn9 } from "@reblu/site-ui/utils";
13783
+ import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
13691
13784
  var DEFAULT_TRUST_ICONS = Object.freeze({
13692
13785
  shipping: Truck,
13693
13786
  returns: RotateCcw,
@@ -13721,17 +13814,17 @@ function ProductTrustItems({
13721
13814
  return [{ key: `${index}-${icon}`, Icon: Icon2, text: text3 }];
13722
13815
  });
13723
13816
  if (rows.length === 0) return null;
13724
- return /* @__PURE__ */ jsx8(List, { "data-slot": "product-trust-items", className: cn8("space-y-2.5", className), children: rows.map(({ key: key2, Icon: Icon2, text: text3 }) => /* @__PURE__ */ jsxs7("li", { className: cn8("flex items-center gap-3 text-sm text-muted-foreground", itemClassName), children: [
13725
- /* @__PURE__ */ jsx8(Icon2, { "aria-hidden": "true", className: "h-4 w-4 shrink-0 text-foreground/60" }),
13726
- /* @__PURE__ */ jsx8("span", { children: text3 })
13817
+ return /* @__PURE__ */ jsx9(List, { "data-slot": "product-trust-items", className: cn9("space-y-2.5", className), children: rows.map(({ key: key2, Icon: Icon2, text: text3 }) => /* @__PURE__ */ jsxs8("li", { className: cn9("flex items-center gap-3 text-sm text-muted-foreground", itemClassName), children: [
13818
+ /* @__PURE__ */ jsx9(Icon2, { "aria-hidden": "true", className: "h-4 w-4 shrink-0 text-foreground/60" }),
13819
+ /* @__PURE__ */ jsx9("span", { children: text3 })
13727
13820
  ] }, key2)) });
13728
13821
  }
13729
13822
 
13730
13823
  // src/components/faq-accordion.tsx
13731
- import { cn as cn9 } from "@reblu/site-ui/utils";
13824
+ import { cn as cn10 } from "@reblu/site-ui/utils";
13732
13825
 
13733
13826
  // src/components/_heading.tsx
13734
- import { jsx as jsx9 } from "react/jsx-runtime";
13827
+ import { jsx as jsx10 } from "react/jsx-runtime";
13735
13828
  function nextHeadingLevel(level) {
13736
13829
  return Math.min(level + 1, 6);
13737
13830
  }
@@ -13741,11 +13834,11 @@ function Heading({
13741
13834
  children: children2
13742
13835
  }) {
13743
13836
  const Tag = `h${level}`;
13744
- return /* @__PURE__ */ jsx9(Tag, { className, children: children2 });
13837
+ return /* @__PURE__ */ jsx10(Tag, { className, children: children2 });
13745
13838
  }
13746
13839
 
13747
13840
  // src/components/faq-accordion.tsx
13748
- import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
13841
+ import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
13749
13842
  function FaqAccordion({
13750
13843
  items,
13751
13844
  heading,
@@ -13756,18 +13849,18 @@ function FaqAccordion({
13756
13849
  }) {
13757
13850
  const visible = items.map((item, index) => ({ item, index })).filter(({ item }) => item.q.trim() !== "");
13758
13851
  if (visible.length === 0) return null;
13759
- return /* @__PURE__ */ jsxs8("div", { className: cn9("space-y-4", className), "data-slot": "faq-accordion", children: [
13760
- heading && /* @__PURE__ */ jsx10(Heading, { level: headingLevel, className: "text-2xl font-semibold tracking-tight", children: heading }),
13761
- /* @__PURE__ */ jsx10("div", { className: "divide-y divide-border rounded-xl border border-border", children: visible.map(({ item, index }) => /* @__PURE__ */ jsxs8(
13852
+ return /* @__PURE__ */ jsxs9("div", { className: cn10("space-y-4", className), "data-slot": "faq-accordion", children: [
13853
+ heading && /* @__PURE__ */ jsx11(Heading, { level: headingLevel, className: "text-2xl font-semibold tracking-tight", children: heading }),
13854
+ /* @__PURE__ */ jsx11("div", { className: "divide-y divide-border rounded-xl border border-border", children: visible.map(({ item, index }) => /* @__PURE__ */ jsxs9(
13762
13855
  "details",
13763
13856
  {
13764
13857
  className: "group px-4",
13765
13858
  "data-slot": "faq-item",
13766
13859
  ...defaultOpen.includes(index) ? { open: true } : {},
13767
13860
  children: [
13768
- /* @__PURE__ */ jsxs8("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4 py-4 font-medium focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring [&::-webkit-details-marker]:hidden", children: [
13769
- questionHeadingLevel ? /* @__PURE__ */ jsx10(Heading, { level: questionHeadingLevel, className: "text-base font-medium", children: item.q }) : /* @__PURE__ */ jsx10("span", { children: item.q }),
13770
- /* @__PURE__ */ jsx10(
13861
+ /* @__PURE__ */ jsxs9("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4 py-4 font-medium focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring [&::-webkit-details-marker]:hidden", children: [
13862
+ questionHeadingLevel ? /* @__PURE__ */ jsx11(Heading, { level: questionHeadingLevel, className: "text-base font-medium", children: item.q }) : /* @__PURE__ */ jsx11("span", { children: item.q }),
13863
+ /* @__PURE__ */ jsx11(
13771
13864
  "span",
13772
13865
  {
13773
13866
  "aria-hidden": "true",
@@ -13776,7 +13869,7 @@ function FaqAccordion({
13776
13869
  }
13777
13870
  )
13778
13871
  ] }),
13779
- /* @__PURE__ */ jsx10("p", { className: "whitespace-pre-line pb-4 text-muted-foreground", children: item.a })
13872
+ /* @__PURE__ */ jsx11("p", { className: "whitespace-pre-line pb-4 text-muted-foreground", children: item.a })
13780
13873
  ]
13781
13874
  },
13782
13875
  index
@@ -13785,40 +13878,40 @@ function FaqAccordion({
13785
13878
  }
13786
13879
 
13787
13880
  // src/components/page-blocks.tsx
13788
- import { cn as cn10 } from "@reblu/site-ui/utils";
13881
+ import { cn as cn11 } from "@reblu/site-ui/utils";
13789
13882
  import { buttonVariants as buttonVariants2 } from "@reblu/site-ui/button-variants";
13790
- import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
13883
+ import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
13791
13884
  var ALIASES = {
13792
13885
  doctor_embed: "profile_embed",
13793
13886
  specialty_embed: "page_embed"
13794
13887
  };
13795
13888
  function HeroBlock({ block, headingLevel }) {
13796
13889
  const { title, subtitle, imageUrl } = block.data;
13797
- return /* @__PURE__ */ jsxs9("div", { className: "space-y-4", children: [
13798
- /* @__PURE__ */ jsx11(Heading, { level: headingLevel, className: "text-3xl font-bold tracking-tight md:text-4xl", children: title }),
13799
- subtitle && /* @__PURE__ */ jsx11("p", { className: "text-lg opacity-80", children: subtitle }),
13800
- imageUrl && /* @__PURE__ */ jsx11("div", { className: "relative aspect-[21/9] w-full overflow-hidden rounded-xl bg-muted", children: /* @__PURE__ */ jsx11("img", { src: imageUrl, alt: "", loading: "lazy", className: "h-full w-full object-cover" }) })
13890
+ return /* @__PURE__ */ jsxs10("div", { className: "space-y-4", children: [
13891
+ /* @__PURE__ */ jsx12(Heading, { level: headingLevel, className: "text-3xl font-bold tracking-tight md:text-4xl", children: title }),
13892
+ subtitle && /* @__PURE__ */ jsx12("p", { className: "text-lg opacity-80", children: subtitle }),
13893
+ imageUrl && /* @__PURE__ */ jsx12("div", { className: "relative aspect-[21/9] w-full overflow-hidden rounded-xl bg-muted", children: /* @__PURE__ */ jsx12("img", { src: imageUrl, alt: "", loading: "lazy", className: "h-full w-full object-cover" }) })
13801
13894
  ] });
13802
13895
  }
13803
13896
  function RichtextBlock({ block, headingLevel }) {
13804
- return /* @__PURE__ */ jsx11(SafeHtml, { html: sanitizeHtml(block.data.html), headingOffset: headingLevel - 1 });
13897
+ return /* @__PURE__ */ jsx12(SafeHtml, { html: sanitizeHtml(block.data.html), headingOffset: headingLevel - 1 });
13805
13898
  }
13806
13899
  function FaqBlock({ block }) {
13807
- return /* @__PURE__ */ jsx11(FaqAccordion, { items: block.data.items });
13900
+ return /* @__PURE__ */ jsx12(FaqAccordion, { items: block.data.items });
13808
13901
  }
13809
13902
  function StatsBlock({ block }) {
13810
- return /* @__PURE__ */ jsx11("dl", { className: "grid gap-6 sm:grid-cols-2 lg:grid-cols-4", children: block.data.items.map((item, i) => /* @__PURE__ */ jsxs9("div", { className: "flex flex-col-reverse gap-1", children: [
13811
- /* @__PURE__ */ jsx11("dt", { className: "text-sm opacity-80", children: item.label }),
13812
- /* @__PURE__ */ jsx11("dd", { className: "text-3xl font-bold", children: item.value })
13903
+ return /* @__PURE__ */ jsx12("dl", { className: "grid gap-6 sm:grid-cols-2 lg:grid-cols-4", children: block.data.items.map((item, i) => /* @__PURE__ */ jsxs10("div", { className: "flex flex-col-reverse gap-1", children: [
13904
+ /* @__PURE__ */ jsx12("dt", { className: "text-sm opacity-80", children: item.label }),
13905
+ /* @__PURE__ */ jsx12("dd", { className: "text-3xl font-bold", children: item.value })
13813
13906
  ] }, i)) });
13814
13907
  }
13815
13908
  function TestimonialBlock({ block }) {
13816
13909
  const { quote, author, role, avatarUrl } = block.data;
13817
- return /* @__PURE__ */ jsxs9("figure", { className: "space-y-4", children: [
13818
- /* @__PURE__ */ jsx11("blockquote", { className: "text-xl italic", children: /* @__PURE__ */ jsx11("p", { children: quote }) }),
13819
- /* @__PURE__ */ jsxs9("figcaption", { className: "flex items-center gap-3", children: [
13910
+ return /* @__PURE__ */ jsxs10("figure", { className: "space-y-4", children: [
13911
+ /* @__PURE__ */ jsx12("blockquote", { className: "text-xl italic", children: /* @__PURE__ */ jsx12("p", { children: quote }) }),
13912
+ /* @__PURE__ */ jsxs10("figcaption", { className: "flex items-center gap-3", children: [
13820
13913
  avatarUrl && // eslint-disable-next-line @next/next/no-img-element
13821
- /* @__PURE__ */ jsx11(
13914
+ /* @__PURE__ */ jsx12(
13822
13915
  "img",
13823
13916
  {
13824
13917
  src: avatarUrl,
@@ -13827,9 +13920,9 @@ function TestimonialBlock({ block }) {
13827
13920
  className: "h-10 w-10 rounded-full object-cover"
13828
13921
  }
13829
13922
  ),
13830
- /* @__PURE__ */ jsxs9("span", { children: [
13831
- /* @__PURE__ */ jsx11("span", { className: "font-semibold", children: author }),
13832
- role && /* @__PURE__ */ jsx11("span", { className: "block text-sm opacity-80", children: role })
13923
+ /* @__PURE__ */ jsxs10("span", { children: [
13924
+ /* @__PURE__ */ jsx12("span", { className: "font-semibold", children: author }),
13925
+ role && /* @__PURE__ */ jsx12("span", { className: "block text-sm opacity-80", children: role })
13833
13926
  ] })
13834
13927
  ] })
13835
13928
  ] });
@@ -13838,19 +13931,19 @@ function CtaSlotBlock(_props) {
13838
13931
  return null;
13839
13932
  }
13840
13933
  function FeatureListBlock({ block }) {
13841
- return /* @__PURE__ */ jsx11("ul", { className: "grid list-disc gap-2 pl-5 sm:grid-cols-2", children: block.data.items.map((item, i) => /* @__PURE__ */ jsx11("li", { children: item.text }, i)) });
13934
+ return /* @__PURE__ */ jsx12("ul", { className: "grid list-disc gap-2 pl-5 sm:grid-cols-2", children: block.data.items.map((item, i) => /* @__PURE__ */ jsx12("li", { children: item.text }, i)) });
13842
13935
  }
13843
13936
  function GalleryBlock({ block }) {
13844
13937
  const { images } = block.data;
13845
- return /* @__PURE__ */ jsx11(
13938
+ return /* @__PURE__ */ jsx12(
13846
13939
  "div",
13847
13940
  {
13848
- className: cn10(
13941
+ className: cn11(
13849
13942
  "grid gap-4",
13850
13943
  images.length > 1 ? "sm:grid-cols-2 lg:grid-cols-3" : "grid-cols-1"
13851
13944
  ),
13852
- children: images.map((img, i) => /* @__PURE__ */ jsxs9("figure", { className: "space-y-1", children: [
13853
- /* @__PURE__ */ jsx11("div", { className: "relative aspect-video w-full overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ jsx11(
13945
+ children: images.map((img, i) => /* @__PURE__ */ jsxs10("figure", { className: "space-y-1", children: [
13946
+ /* @__PURE__ */ jsx12("div", { className: "relative aspect-video w-full overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ jsx12(
13854
13947
  "img",
13855
13948
  {
13856
13949
  src: img.url,
@@ -13859,7 +13952,7 @@ function GalleryBlock({ block }) {
13859
13952
  className: "h-full w-full object-cover"
13860
13953
  }
13861
13954
  ) }),
13862
- img.caption && /* @__PURE__ */ jsx11("figcaption", { className: "text-sm opacity-80", children: img.caption })
13955
+ img.caption && /* @__PURE__ */ jsx12("figcaption", { className: "text-sm opacity-80", children: img.caption })
13863
13956
  ] }, `${img.url}-${i}`))
13864
13957
  }
13865
13958
  );
@@ -13869,13 +13962,13 @@ function EmbedCard({
13869
13962
  headingLevel,
13870
13963
  embedHref
13871
13964
  }) {
13872
- return /* @__PURE__ */ jsxs9(
13965
+ return /* @__PURE__ */ jsxs10(
13873
13966
  "a",
13874
13967
  {
13875
13968
  href: embedHref(resolved),
13876
13969
  className: "group block overflow-hidden rounded-xl border border-border bg-card text-card-foreground transition-shadow hover:shadow-md focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",
13877
13970
  children: [
13878
- resolved.coverImageUrl && /* @__PURE__ */ jsx11("div", { className: "aspect-video w-full overflow-hidden bg-muted", children: /* @__PURE__ */ jsx11(
13971
+ resolved.coverImageUrl && /* @__PURE__ */ jsx12("div", { className: "aspect-video w-full overflow-hidden bg-muted", children: /* @__PURE__ */ jsx12(
13879
13972
  "img",
13880
13973
  {
13881
13974
  src: resolved.coverImageUrl,
@@ -13884,24 +13977,24 @@ function EmbedCard({
13884
13977
  className: "h-full w-full object-cover"
13885
13978
  }
13886
13979
  ) }),
13887
- /* @__PURE__ */ jsxs9("div", { className: "space-y-1 p-4", children: [
13888
- /* @__PURE__ */ jsx11(Heading, { level: headingLevel, className: "text-lg font-semibold", children: resolved.title }),
13889
- resolved.role && /* @__PURE__ */ jsx11("p", { className: "text-sm text-muted-foreground", children: resolved.role }),
13890
- resolved.excerpt && /* @__PURE__ */ jsx11("p", { className: "text-muted-foreground", children: resolved.excerpt })
13980
+ /* @__PURE__ */ jsxs10("div", { className: "space-y-1 p-4", children: [
13981
+ /* @__PURE__ */ jsx12(Heading, { level: headingLevel, className: "text-lg font-semibold", children: resolved.title }),
13982
+ resolved.role && /* @__PURE__ */ jsx12("p", { className: "text-sm text-muted-foreground", children: resolved.role }),
13983
+ resolved.excerpt && /* @__PURE__ */ jsx12("p", { className: "text-muted-foreground", children: resolved.excerpt })
13891
13984
  ] })
13892
13985
  ]
13893
13986
  }
13894
13987
  );
13895
13988
  }
13896
13989
  function PageEmbedBlock({ block, headingLevel, embedHref }) {
13897
- return /* @__PURE__ */ jsx11(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
13990
+ return /* @__PURE__ */ jsx12(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
13898
13991
  }
13899
13992
  function ProfileEmbedBlock({
13900
13993
  block,
13901
13994
  headingLevel,
13902
13995
  embedHref
13903
13996
  }) {
13904
- return /* @__PURE__ */ jsx11(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
13997
+ return /* @__PURE__ */ jsx12(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
13905
13998
  }
13906
13999
  var DEFAULT_RENDERERS = {
13907
14000
  hero: HeroBlock,
@@ -13958,14 +14051,14 @@ function toIdFragment(value) {
13958
14051
  function SectionCta2({ cta }) {
13959
14052
  if (!hasUsableCta(cta)) return null;
13960
14053
  const variant = toButtonVariant(cta.variant);
13961
- return /* @__PURE__ */ jsx11("div", { className: "pt-2", children: /* @__PURE__ */ jsx11(
14054
+ return /* @__PURE__ */ jsx12("div", { className: "pt-2", children: /* @__PURE__ */ jsx12(
13962
14055
  "a",
13963
14056
  {
13964
14057
  href: cta.url,
13965
14058
  "data-slot": "button",
13966
14059
  "data-variant": variant,
13967
14060
  "data-size": "default",
13968
- className: cn10(buttonVariants2({ variant, size: "default" })),
14061
+ className: cn11(buttonVariants2({ variant, size: "default" })),
13969
14062
  ...cta.isExternal ? { target: "_blank", rel: "noopener noreferrer" } : {},
13970
14063
  children: cta.label
13971
14064
  }
@@ -13991,17 +14084,17 @@ function PageBlocks({
13991
14084
  const headingId = block.heading ? `${safePrefix}-${toIdFragment(block.id)}-heading` : void 0;
13992
14085
  const background = block.backgroundColor;
13993
14086
  return [
13994
- /* @__PURE__ */ jsxs9(
14087
+ /* @__PURE__ */ jsxs10(
13995
14088
  "section",
13996
14089
  {
13997
14090
  "data-slot": "page-block",
13998
14091
  "data-block-type": type,
13999
14092
  "aria-labelledby": headingId,
14000
14093
  style: surfaceStyle(background),
14001
- className: cn10("space-y-6", background && "rounded-xl px-6 py-10", sectionClassName),
14094
+ className: cn11("space-y-6", background && "rounded-xl px-6 py-10", sectionClassName),
14002
14095
  children: [
14003
- block.heading && /* @__PURE__ */ jsx11(Heading, { level: headingLevel, className: "text-2xl font-bold tracking-tight", children: /* @__PURE__ */ jsx11("span", { id: headingId, children: block.heading }) }),
14004
- /* @__PURE__ */ jsx11(
14096
+ block.heading && /* @__PURE__ */ jsx12(Heading, { level: headingLevel, className: "text-2xl font-bold tracking-tight", children: /* @__PURE__ */ jsx12("span", { id: headingId, children: block.heading }) }),
14097
+ /* @__PURE__ */ jsx12(
14005
14098
  Renderer,
14006
14099
  {
14007
14100
  block,
@@ -14009,7 +14102,7 @@ function PageBlocks({
14009
14102
  embedHref
14010
14103
  }
14011
14104
  ),
14012
- /* @__PURE__ */ jsx11(SectionCta2, { cta: block.cta })
14105
+ /* @__PURE__ */ jsx12(SectionCta2, { cta: block.cta })
14013
14106
  ]
14014
14107
  },
14015
14108
  block.id
@@ -14017,12 +14110,12 @@ function PageBlocks({
14017
14110
  ];
14018
14111
  });
14019
14112
  if (sections.length === 0) return null;
14020
- return /* @__PURE__ */ jsx11("div", { className: cn10("space-y-12", className), "data-slot": "page-blocks", children: sections });
14113
+ return /* @__PURE__ */ jsx12("div", { className: cn11("space-y-12", className), "data-slot": "page-blocks", children: sections });
14021
14114
  }
14022
14115
 
14023
14116
  // src/components/shop-filters.tsx
14024
- import { cn as cn11 } from "@reblu/site-ui/utils";
14025
- import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
14117
+ import { cn as cn12 } from "@reblu/site-ui/utils";
14118
+ import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
14026
14119
  var DEFAULT_SHOP_PRICE_BANDS = [
14027
14120
  { max: 2500 },
14028
14121
  { min: 2500, max: 5e3 },
@@ -14066,7 +14159,7 @@ function priceBandLabel(band, t, currencyCode, locale) {
14066
14159
  return "";
14067
14160
  }
14068
14161
  function OptionLink({ href, active, label, onActivate }) {
14069
- return /* @__PURE__ */ jsx12(
14162
+ return /* @__PURE__ */ jsx13(
14070
14163
  "a",
14071
14164
  {
14072
14165
  href,
@@ -14075,7 +14168,7 @@ function OptionLink({ href, active, label, onActivate }) {
14075
14168
  event.preventDefault();
14076
14169
  onActivate();
14077
14170
  } : void 0,
14078
- className: cn11(
14171
+ className: cn12(
14079
14172
  "inline-flex items-center rounded-full border px-3 py-1 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
14080
14173
  active ? "border-transparent bg-primary text-primary-foreground" : "border-border text-muted-foreground hover:bg-muted hover:text-foreground"
14081
14174
  ),
@@ -14084,9 +14177,9 @@ function OptionLink({ href, active, label, onActivate }) {
14084
14177
  );
14085
14178
  }
14086
14179
  function FilterFieldset({ legend, children: children2 }) {
14087
- return /* @__PURE__ */ jsxs10("fieldset", { className: "space-y-2", children: [
14088
- /* @__PURE__ */ jsx12("legend", { className: "text-sm font-medium text-foreground", children: legend }),
14089
- /* @__PURE__ */ jsx12("div", { className: "flex flex-wrap gap-2", children: children2 })
14180
+ return /* @__PURE__ */ jsxs11("fieldset", { className: "space-y-2", children: [
14181
+ /* @__PURE__ */ jsx13("legend", { className: "text-sm font-medium text-foreground", children: legend }),
14182
+ /* @__PURE__ */ jsx13("div", { className: "flex flex-wrap gap-2", children: children2 })
14090
14183
  ] });
14091
14184
  }
14092
14185
  function ShopFilters({
@@ -14109,11 +14202,11 @@ function ShopFilters({
14109
14202
  if (!shouldRenderShopFilters(facets, active)) {
14110
14203
  return null;
14111
14204
  }
14112
- return /* @__PURE__ */ jsxs10("div", { className: cn11("space-y-6", className), "data-slot": "shop-filters", children: [
14205
+ return /* @__PURE__ */ jsxs11("div", { className: cn12("space-y-6", className), "data-slot": "shop-filters", children: [
14113
14206
  visibleTaxonomies.map((axis) => {
14114
14207
  const activeSlug = active.taxonomy?.[axis.key];
14115
- return /* @__PURE__ */ jsxs10(FilterFieldset, { legend: axis.label, children: [
14116
- /* @__PURE__ */ jsx12(
14208
+ return /* @__PURE__ */ jsxs11(FilterFieldset, { legend: axis.label, children: [
14209
+ /* @__PURE__ */ jsx13(
14117
14210
  OptionLink,
14118
14211
  {
14119
14212
  href: hrefs.taxonomy(axis.key, void 0),
@@ -14128,7 +14221,7 @@ function ShopFilters({
14128
14221
  ),
14129
14222
  axis.terms.map((term) => {
14130
14223
  const isActive = activeSlug === term.slug;
14131
- return /* @__PURE__ */ jsx12(
14224
+ return /* @__PURE__ */ jsx13(
14132
14225
  OptionLink,
14133
14226
  {
14134
14227
  href: hrefs.taxonomy(axis.key, isActive ? void 0 : term.slug),
@@ -14148,9 +14241,9 @@ function ShopFilters({
14148
14241
  }),
14149
14242
  visibleAttributes.map((attr) => {
14150
14243
  const activeValues = toValueArray(active.attr?.[attr.key]);
14151
- return /* @__PURE__ */ jsx12(FilterFieldset, { legend: attr.label, children: attr.options.map((opt) => {
14244
+ return /* @__PURE__ */ jsx13(FilterFieldset, { legend: attr.label, children: attr.options.map((opt) => {
14152
14245
  const isActive = activeValues.includes(opt.value);
14153
- return /* @__PURE__ */ jsx12(
14246
+ return /* @__PURE__ */ jsx13(
14154
14247
  OptionLink,
14155
14248
  {
14156
14249
  href: hrefs.attr(attr.key, opt.value),
@@ -14168,11 +14261,11 @@ function ShopFilters({
14168
14261
  );
14169
14262
  }) }, attr.key);
14170
14263
  }),
14171
- showPriceGroup && /* @__PURE__ */ jsx12(FilterFieldset, { legend: t.price, children: priceBands.map((band, i) => {
14264
+ showPriceGroup && /* @__PURE__ */ jsx13(FilterFieldset, { legend: t.price, children: priceBands.map((band, i) => {
14172
14265
  const isActive = active.priceMin === band.min && active.priceMax === band.max;
14173
14266
  const nextMin = isActive ? void 0 : band.min;
14174
14267
  const nextMax = isActive ? void 0 : band.max;
14175
- return /* @__PURE__ */ jsx12(
14268
+ return /* @__PURE__ */ jsx13(
14176
14269
  OptionLink,
14177
14270
  {
14178
14271
  href: hrefs.price(nextMin, nextMax),
@@ -14183,7 +14276,7 @@ function ShopFilters({
14183
14276
  i
14184
14277
  );
14185
14278
  }) }),
14186
- hasOnSale && /* @__PURE__ */ jsx12(
14279
+ hasOnSale && /* @__PURE__ */ jsx13(
14187
14280
  OptionLink,
14188
14281
  {
14189
14282
  href: hrefs.onSale(!active.onSale),
@@ -14192,7 +14285,7 @@ function ShopFilters({
14192
14285
  onActivate: onChange ? () => onChange({ onSale: !active.onSale }) : void 0
14193
14286
  }
14194
14287
  ),
14195
- /* @__PURE__ */ jsx12(
14288
+ /* @__PURE__ */ jsx13(
14196
14289
  "a",
14197
14290
  {
14198
14291
  href: hrefs.clearAll(),
@@ -14208,8 +14301,8 @@ function ShopFilters({
14208
14301
  }
14209
14302
 
14210
14303
  // src/components/cart-line-list.tsx
14211
- import { cn as cn12 } from "@reblu/site-ui/utils";
14212
- import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
14304
+ import { cn as cn13 } from "@reblu/site-ui/utils";
14305
+ import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
14213
14306
  var DEFAULT_LABELS2 = {
14214
14307
  quantityLabel: "Cantidad",
14215
14308
  decrease: "Reducir cantidad",
@@ -14227,6 +14320,7 @@ function CartLineList({
14227
14320
  onRemove,
14228
14321
  liveMessage,
14229
14322
  notice,
14323
+ lineMessage,
14230
14324
  labels,
14231
14325
  currencyCode,
14232
14326
  locale,
@@ -14234,9 +14328,9 @@ function CartLineList({
14234
14328
  }) {
14235
14329
  const t = { ...DEFAULT_LABELS2, ...labels };
14236
14330
  const noticeContent = notice === true ? t.cancelledNotice : notice;
14237
- return /* @__PURE__ */ jsxs11("div", { className: cn12("space-y-4", className), "data-slot": "cart-line-list", children: [
14238
- /* @__PURE__ */ jsx13("div", { "aria-live": "polite", className: "sr-only", children: liveMessage }),
14239
- noticeContent != null && noticeContent !== false && /* @__PURE__ */ jsx13(
14331
+ return /* @__PURE__ */ jsxs12("div", { className: cn13("space-y-4", className), "data-slot": "cart-line-list", children: [
14332
+ /* @__PURE__ */ jsx14("div", { "aria-live": "polite", className: "sr-only", children: liveMessage }),
14333
+ noticeContent != null && noticeContent !== false && /* @__PURE__ */ jsx14(
14240
14334
  "div",
14241
14335
  {
14242
14336
  role: "status",
@@ -14245,32 +14339,33 @@ function CartLineList({
14245
14339
  children: noticeContent
14246
14340
  }
14247
14341
  ),
14248
- /* @__PURE__ */ jsx13("ul", { className: "space-y-4", children: items.map((item) => {
14342
+ /* @__PURE__ */ jsx14("ul", { className: "space-y-4", children: items.map((item) => {
14249
14343
  const maxQty = item.maxStock ?? Infinity;
14250
14344
  const atMax = item.quantity >= maxQty;
14251
14345
  const atMin = item.quantity <= 1;
14252
- return /* @__PURE__ */ jsxs11(
14346
+ const message = lineMessage?.(item);
14347
+ return /* @__PURE__ */ jsxs12(
14253
14348
  "li",
14254
14349
  {
14255
14350
  className: "flex gap-4 rounded-xl border border-border bg-card p-4",
14256
14351
  children: [
14257
- /* @__PURE__ */ jsx13("div", { className: "h-20 w-20 flex-shrink-0 overflow-hidden rounded-lg bg-muted", children: item.imageUrl ? /* @__PURE__ */ jsx13("img", { src: item.imageUrl, alt: item.name, className: "h-full w-full object-cover" }) : null }),
14258
- /* @__PURE__ */ jsxs11("div", { className: "min-w-0 flex-1", children: [
14259
- /* @__PURE__ */ jsx13("p", { className: "truncate text-sm font-semibold leading-tight", children: item.name }),
14260
- item.variantName && /* @__PURE__ */ jsx13("p", { className: "mt-0.5 text-xs text-muted-foreground", children: item.variantName }),
14261
- /* @__PURE__ */ jsxs11("p", { className: "mt-1 text-sm text-muted-foreground", children: [
14352
+ /* @__PURE__ */ jsx14("div", { className: "h-20 w-20 flex-shrink-0 overflow-hidden rounded-lg bg-muted", children: item.imageUrl ? /* @__PURE__ */ jsx14("img", { src: item.imageUrl, alt: item.name, className: "h-full w-full object-cover" }) : null }),
14353
+ /* @__PURE__ */ jsxs12("div", { className: "min-w-0 flex-1", children: [
14354
+ /* @__PURE__ */ jsx14("p", { className: "truncate text-sm font-semibold leading-tight", children: item.name }),
14355
+ item.variantName && /* @__PURE__ */ jsx14("p", { className: "mt-0.5 text-xs text-muted-foreground", children: item.variantName }),
14356
+ /* @__PURE__ */ jsxs12("p", { className: "mt-1 text-sm text-muted-foreground", children: [
14262
14357
  formatPrice(item.unitPrice, currencyCode, locale),
14263
14358
  " ",
14264
14359
  t.unitPriceSuffix
14265
14360
  ] }),
14266
- /* @__PURE__ */ jsxs11(
14361
+ /* @__PURE__ */ jsxs12(
14267
14362
  "div",
14268
14363
  {
14269
14364
  role: "group",
14270
14365
  "aria-label": t.quantityLabel,
14271
14366
  className: "mt-3 flex items-center gap-3",
14272
14367
  children: [
14273
- /* @__PURE__ */ jsx13(
14368
+ /* @__PURE__ */ jsx14(
14274
14369
  "button",
14275
14370
  {
14276
14371
  type: "button",
@@ -14281,8 +14376,8 @@ function CartLineList({
14281
14376
  children: "\u2212"
14282
14377
  }
14283
14378
  ),
14284
- /* @__PURE__ */ jsx13("span", { className: "w-8 text-center text-sm font-semibold tabular-nums", children: item.quantity }),
14285
- /* @__PURE__ */ jsx13(
14379
+ /* @__PURE__ */ jsx14("span", { className: "w-8 text-center text-sm font-semibold tabular-nums", children: item.quantity }),
14380
+ /* @__PURE__ */ jsx14(
14286
14381
  "button",
14287
14382
  {
14288
14383
  type: "button",
@@ -14293,7 +14388,7 @@ function CartLineList({
14293
14388
  children: "+"
14294
14389
  }
14295
14390
  ),
14296
- onRemove && /* @__PURE__ */ jsx13(
14391
+ onRemove && /* @__PURE__ */ jsx14(
14297
14392
  "button",
14298
14393
  {
14299
14394
  type: "button",
@@ -14305,9 +14400,17 @@ function CartLineList({
14305
14400
  )
14306
14401
  ]
14307
14402
  }
14403
+ ),
14404
+ message != null && message !== false && /* @__PURE__ */ jsx14(
14405
+ "p",
14406
+ {
14407
+ className: "mt-2 text-sm text-destructive",
14408
+ "data-slot": "cart-line-list-line-message",
14409
+ children: message
14410
+ }
14308
14411
  )
14309
14412
  ] }),
14310
- /* @__PURE__ */ jsx13("div", { className: "flex-shrink-0 text-right", children: /* @__PURE__ */ jsx13("p", { className: "text-base font-bold", children: formatPrice(item.unitPrice * item.quantity, currencyCode, locale) }) })
14413
+ /* @__PURE__ */ jsx14("div", { className: "flex-shrink-0 text-right", children: /* @__PURE__ */ jsx14("p", { className: "text-base font-bold", children: formatPrice(item.unitPrice * item.quantity, currencyCode, locale) }) })
14311
14414
  ]
14312
14415
  },
14313
14416
  lineKey(item.productId, item.variantId)
@@ -14317,8 +14420,8 @@ function CartLineList({
14317
14420
  }
14318
14421
 
14319
14422
  // src/components/cart-summary.tsx
14320
- import { cn as cn13 } from "@reblu/site-ui/utils";
14321
- import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
14423
+ import { cn as cn14 } from "@reblu/site-ui/utils";
14424
+ import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
14322
14425
  var DEFAULT_LABELS3 = {
14323
14426
  subtotal: "Subtotal",
14324
14427
  discountPrefix: "Descuento",
@@ -14345,40 +14448,40 @@ function CartSummary({
14345
14448
  const hasDiscount = Boolean(discount && discount > 0);
14346
14449
  const noticeContent = notice === true ? t.cancelledNotice : notice;
14347
14450
  const hasNotice = noticeContent != null && noticeContent !== false;
14348
- const breakdown = /* @__PURE__ */ jsxs12(
14451
+ const breakdown = /* @__PURE__ */ jsxs13(
14349
14452
  "dl",
14350
14453
  {
14351
- className: cn13("space-y-2 text-sm", !hasNotice && className),
14454
+ className: cn14("space-y-2 text-sm", !hasNotice && className),
14352
14455
  "data-slot": "cart-summary",
14353
14456
  children: [
14354
- /* @__PURE__ */ jsxs12("div", { className: "flex justify-between text-muted-foreground", children: [
14355
- /* @__PURE__ */ jsx14("dt", { children: t.subtotal }),
14356
- /* @__PURE__ */ jsx14("dd", { children: formatPrice(subtotal, currencyCode, locale) })
14457
+ /* @__PURE__ */ jsxs13("div", { className: "flex justify-between text-muted-foreground", children: [
14458
+ /* @__PURE__ */ jsx15("dt", { children: t.subtotal }),
14459
+ /* @__PURE__ */ jsx15("dd", { children: formatPrice(subtotal, currencyCode, locale) })
14357
14460
  ] }),
14358
- hasDiscount && /* @__PURE__ */ jsxs12("div", { className: "flex justify-between text-green-600 dark:text-green-400", children: [
14359
- /* @__PURE__ */ jsxs12("dt", { children: [
14461
+ hasDiscount && /* @__PURE__ */ jsxs13("div", { className: "flex justify-between text-green-600 dark:text-green-400", children: [
14462
+ /* @__PURE__ */ jsxs13("dt", { children: [
14360
14463
  t.discountPrefix,
14361
14464
  discountCode ? ` (${discountCode})` : ""
14362
14465
  ] }),
14363
- /* @__PURE__ */ jsxs12("dd", { children: [
14466
+ /* @__PURE__ */ jsxs13("dd", { children: [
14364
14467
  "-",
14365
14468
  formatPrice(discount, currencyCode, locale)
14366
14469
  ] })
14367
14470
  ] }),
14368
- shippingEnabled && /* @__PURE__ */ jsxs12("div", { className: "flex justify-between text-muted-foreground", children: [
14369
- /* @__PURE__ */ jsx14("dt", { children: t.shipping }),
14370
- /* @__PURE__ */ jsx14("dd", { children: shipping == null || !Number.isFinite(shipping) ? t.shippingCalculated : shipping === 0 ? t.freeShipping : formatPrice(shipping, currencyCode, locale) })
14471
+ shippingEnabled && /* @__PURE__ */ jsxs13("div", { className: "flex justify-between text-muted-foreground", children: [
14472
+ /* @__PURE__ */ jsx15("dt", { children: t.shipping }),
14473
+ /* @__PURE__ */ jsx15("dd", { children: shipping == null || !Number.isFinite(shipping) ? t.shippingCalculated : shipping === 0 ? t.freeShipping : formatPrice(shipping, currencyCode, locale) })
14371
14474
  ] }),
14372
- /* @__PURE__ */ jsxs12("div", { className: "flex justify-between border-t border-border pt-2 text-base font-bold", children: [
14373
- /* @__PURE__ */ jsx14("dt", { children: t.total }),
14374
- /* @__PURE__ */ jsx14("dd", { children: formatPrice(total, currencyCode, locale) })
14475
+ /* @__PURE__ */ jsxs13("div", { className: "flex justify-between border-t border-border pt-2 text-base font-bold", children: [
14476
+ /* @__PURE__ */ jsx15("dt", { children: t.total }),
14477
+ /* @__PURE__ */ jsx15("dd", { children: formatPrice(total, currencyCode, locale) })
14375
14478
  ] })
14376
14479
  ]
14377
14480
  }
14378
14481
  );
14379
14482
  if (!hasNotice) return breakdown;
14380
- return /* @__PURE__ */ jsxs12("div", { className: cn13("space-y-3", className), "data-slot": "cart-summary-wrapper", children: [
14381
- /* @__PURE__ */ jsx14(
14483
+ return /* @__PURE__ */ jsxs13("div", { className: cn14("space-y-3", className), "data-slot": "cart-summary-wrapper", children: [
14484
+ /* @__PURE__ */ jsx15(
14382
14485
  "div",
14383
14486
  {
14384
14487
  role: "status",
@@ -14391,10 +14494,57 @@ function CartSummary({
14391
14494
  ] });
14392
14495
  }
14393
14496
 
14394
- // src/components/added-to-cart-toast.tsx
14395
- import { cn as cn14 } from "@reblu/site-ui/utils";
14396
- import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
14497
+ // src/components/cart-adjustments-notice.tsx
14498
+ import { cn as cn15 } from "@reblu/site-ui/utils";
14499
+ import { jsx as jsx16 } from "react/jsx-runtime";
14397
14500
  var DEFAULT_LABELS4 = {
14501
+ removed: (names) => names.length === 1 ? `Hemos quitado del carrito: ${names[0]}, ya no est\xE1 disponible.` : `Hemos quitado del carrito: ${names.join(", ")}, ya no est\xE1n disponibles.`,
14502
+ quantityChanged: (name, quantity) => `Hemos ajustado la cantidad de ${name} a ${quantity} por el stock disponible.`,
14503
+ priceChanged: (name, from, to) => `El precio de ${name} ha cambiado: antes ${from}, ahora ${to}.`
14504
+ };
14505
+ function displayName(line) {
14506
+ return line.variantName ? `${line.name} (${line.variantName})` : line.name;
14507
+ }
14508
+ function CartAdjustmentsNotice({
14509
+ removed = [],
14510
+ quantityChanges = [],
14511
+ priceChanges = [],
14512
+ labels,
14513
+ currencyCode,
14514
+ locale,
14515
+ className
14516
+ }) {
14517
+ const t = { ...DEFAULT_LABELS4, ...labels };
14518
+ const messages = [];
14519
+ if (removed.length > 0) messages.push(t.removed(removed.map(displayName)));
14520
+ for (const change of quantityChanges) {
14521
+ messages.push(t.quantityChanged(displayName(change), change.to));
14522
+ }
14523
+ for (const change of priceChanges) {
14524
+ messages.push(
14525
+ t.priceChanged(
14526
+ displayName(change),
14527
+ formatPrice(change.from, currencyCode, locale),
14528
+ formatPrice(change.to, currencyCode, locale)
14529
+ )
14530
+ );
14531
+ }
14532
+ if (messages.length === 0) return null;
14533
+ return /* @__PURE__ */ jsx16(
14534
+ "div",
14535
+ {
14536
+ role: "status",
14537
+ className: cn15("rounded-lg border border-border bg-muted px-3 py-2 text-sm", className),
14538
+ "data-slot": "cart-adjustments-notice",
14539
+ children: messages.length === 1 ? /* @__PURE__ */ jsx16("p", { children: messages[0] }) : /* @__PURE__ */ jsx16("ul", { className: "list-disc space-y-1 pl-4", children: messages.map((message, index) => /* @__PURE__ */ jsx16("li", { children: message }, index)) })
14540
+ }
14541
+ );
14542
+ }
14543
+
14544
+ // src/components/added-to-cart-toast.tsx
14545
+ import { cn as cn16 } from "@reblu/site-ui/utils";
14546
+ import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
14547
+ var DEFAULT_LABELS5 = {
14398
14548
  success: "A\xF1adido al carrito",
14399
14549
  error: "No se pudo a\xF1adir al carrito",
14400
14550
  outOfStock: "Producto agotado",
@@ -14409,16 +14559,16 @@ function AddedToCartToast({
14409
14559
  labels,
14410
14560
  className
14411
14561
  }) {
14412
- const t = { ...DEFAULT_LABELS4, ...labels };
14562
+ const t = { ...DEFAULT_LABELS5, ...labels };
14413
14563
  const message = status === "error" ? t.error : status === "outOfStock" ? t.outOfStock : t.success;
14414
14564
  const hasThumbnail = Boolean(imageUrl && imageUrl.trim().length > 0);
14415
14565
  const variant = status === "success" ? "success" : "error";
14416
- return /* @__PURE__ */ jsxs13(
14566
+ return /* @__PURE__ */ jsxs14(
14417
14567
  "div",
14418
14568
  {
14419
14569
  "data-slot": "added-to-cart-toast",
14420
14570
  "data-variant": variant,
14421
- className: cn14(
14571
+ className: cn16(
14422
14572
  "flex items-center gap-3 rounded-xl border border-border bg-card p-3 text-sm shadow-lg",
14423
14573
  variant === "success" && "border-green-600/30 dark:border-green-400/30",
14424
14574
  variant === "error" && "border-destructive/30",
@@ -14426,21 +14576,21 @@ function AddedToCartToast({
14426
14576
  ),
14427
14577
  children: [
14428
14578
  hasThumbnail && // eslint-disable-next-line @next/next/no-img-element -- toast content, not a Next <Image> layout context
14429
- /* @__PURE__ */ jsx15("img", { src: imageUrl, alt: productName, className: "h-10 w-10 flex-shrink-0 rounded-lg object-cover" }),
14430
- /* @__PURE__ */ jsxs13("div", { className: "min-w-0 flex-1", children: [
14431
- /* @__PURE__ */ jsx15("p", { className: "truncate font-semibold text-foreground", children: productName }),
14432
- /* @__PURE__ */ jsx15("p", { className: "truncate text-muted-foreground", children: quantity && quantity > 1 ? `${message} \xB7 x${quantity}` : message })
14579
+ /* @__PURE__ */ jsx17("img", { src: imageUrl, alt: productName, className: "h-10 w-10 flex-shrink-0 rounded-lg object-cover" }),
14580
+ /* @__PURE__ */ jsxs14("div", { className: "min-w-0 flex-1", children: [
14581
+ /* @__PURE__ */ jsx17("p", { className: "truncate font-semibold text-foreground", children: productName }),
14582
+ /* @__PURE__ */ jsx17("p", { className: "truncate text-muted-foreground", children: quantity && quantity > 1 ? `${message} \xB7 x${quantity}` : message })
14433
14583
  ] }),
14434
- /* @__PURE__ */ jsx15("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx15("a", { href: cartHref, className: "text-sm font-semibold text-primary underline-offset-2 hover:underline", children: t.viewCart }) })
14584
+ /* @__PURE__ */ jsx17("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx17("a", { href: cartHref, className: "text-sm font-semibold text-primary underline-offset-2 hover:underline", children: t.viewCart }) })
14435
14585
  ]
14436
14586
  }
14437
14587
  );
14438
14588
  }
14439
14589
 
14440
14590
  // src/components/checkout-login-prompt.tsx
14441
- import { cn as cn15 } from "@reblu/site-ui/utils";
14442
- import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
14443
- var DEFAULT_LABELS5 = {
14591
+ import { cn as cn17 } from "@reblu/site-ui/utils";
14592
+ import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
14593
+ var DEFAULT_LABELS6 = {
14444
14594
  title: "Identificaci\xF3n",
14445
14595
  description: "Introduce tu email para agilizar el proceso o contin\xFAa como invitado.",
14446
14596
  emailLabel: "Email",
@@ -14464,28 +14614,28 @@ function CheckoutLoginPrompt({
14464
14614
  className
14465
14615
  }) {
14466
14616
  if (!open) return null;
14467
- const t = { ...DEFAULT_LABELS5, ...labels };
14617
+ const t = { ...DEFAULT_LABELS6, ...labels };
14468
14618
  const isValidEmail = EMAIL_PATTERN.test(email.trim());
14469
- return /* @__PURE__ */ jsxs14(Fragment3, { children: [
14470
- /* @__PURE__ */ jsx16("div", { className: "fixed inset-0 z-50 bg-black/50", onClick: onClose, "aria-hidden": "true" }),
14471
- /* @__PURE__ */ jsxs14(
14619
+ return /* @__PURE__ */ jsxs15(Fragment3, { children: [
14620
+ /* @__PURE__ */ jsx18("div", { className: "fixed inset-0 z-50 bg-black/50", onClick: onClose, "aria-hidden": "true" }),
14621
+ /* @__PURE__ */ jsxs15(
14472
14622
  "div",
14473
14623
  {
14474
14624
  role: "dialog",
14475
14625
  "aria-modal": "true",
14476
14626
  "aria-labelledby": "checkout-login-prompt-title",
14477
14627
  "data-slot": "checkout-login-prompt",
14478
- className: cn15(
14628
+ className: cn17(
14479
14629
  "fixed left-1/2 top-1/2 z-50 w-full max-w-md -translate-x-1/2 -translate-y-1/2 space-y-5 rounded-2xl border border-border bg-background p-6 shadow-2xl",
14480
14630
  className
14481
14631
  ),
14482
14632
  children: [
14483
- /* @__PURE__ */ jsxs14("div", { className: "flex items-start justify-between gap-3", children: [
14484
- /* @__PURE__ */ jsxs14("div", { children: [
14485
- /* @__PURE__ */ jsx16("h2", { id: "checkout-login-prompt-title", className: "text-xl font-bold", children: t.title }),
14486
- /* @__PURE__ */ jsx16("p", { className: "mt-1 text-sm text-muted-foreground", children: t.description })
14633
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-start justify-between gap-3", children: [
14634
+ /* @__PURE__ */ jsxs15("div", { children: [
14635
+ /* @__PURE__ */ jsx18("h2", { id: "checkout-login-prompt-title", className: "text-xl font-bold", children: t.title }),
14636
+ /* @__PURE__ */ jsx18("p", { className: "mt-1 text-sm text-muted-foreground", children: t.description })
14487
14637
  ] }),
14488
- /* @__PURE__ */ jsx16(
14638
+ /* @__PURE__ */ jsx18(
14489
14639
  "button",
14490
14640
  {
14491
14641
  type: "button",
@@ -14496,9 +14646,9 @@ function CheckoutLoginPrompt({
14496
14646
  }
14497
14647
  )
14498
14648
  ] }),
14499
- /* @__PURE__ */ jsxs14("div", { className: "space-y-2", children: [
14500
- /* @__PURE__ */ jsx16("label", { htmlFor: "checkout-login-prompt-email", className: "text-sm font-medium", children: t.emailLabel }),
14501
- /* @__PURE__ */ jsx16(
14649
+ /* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
14650
+ /* @__PURE__ */ jsx18("label", { htmlFor: "checkout-login-prompt-email", className: "text-sm font-medium", children: t.emailLabel }),
14651
+ /* @__PURE__ */ jsx18(
14502
14652
  "input",
14503
14653
  {
14504
14654
  id: "checkout-login-prompt-email",
@@ -14507,29 +14657,29 @@ function CheckoutLoginPrompt({
14507
14657
  value: email,
14508
14658
  onChange: (e) => onEmailChange(e.target.value),
14509
14659
  placeholder: t.emailPlaceholder,
14510
- className: cn15(
14660
+ className: cn17(
14511
14661
  "w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
14512
14662
  error ? "border-destructive" : "border-border focus:border-primary"
14513
14663
  )
14514
14664
  }
14515
14665
  ),
14516
- error && /* @__PURE__ */ jsx16("p", { className: "text-xs text-destructive", children: error })
14666
+ error && /* @__PURE__ */ jsx18("p", { className: "text-xs text-destructive", children: error })
14517
14667
  ] }),
14518
- /* @__PURE__ */ jsxs14("div", { className: "space-y-2", children: [
14519
- /* @__PURE__ */ jsx16(
14668
+ /* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
14669
+ /* @__PURE__ */ jsx18(
14520
14670
  "button",
14521
14671
  {
14522
14672
  type: "button",
14523
14673
  onClick: onSubmitEmail,
14524
14674
  disabled: checking || !isValidEmail,
14525
- className: cn15(
14675
+ className: cn17(
14526
14676
  "flex w-full items-center justify-center gap-2 rounded-xl px-4 py-2.5 text-sm font-semibold transition-all",
14527
14677
  checking || !isValidEmail ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
14528
14678
  ),
14529
14679
  children: checking ? t.checking : t.continueWithEmail
14530
14680
  }
14531
14681
  ),
14532
- /* @__PURE__ */ jsx16(
14682
+ /* @__PURE__ */ jsx18(
14533
14683
  "button",
14534
14684
  {
14535
14685
  type: "button",
@@ -14546,10 +14696,10 @@ function CheckoutLoginPrompt({
14546
14696
  }
14547
14697
 
14548
14698
  // src/components/checkout-form.tsx
14549
- import { cn as cn16 } from "@reblu/site-ui/utils";
14699
+ import { cn as cn18 } from "@reblu/site-ui/utils";
14550
14700
  import { PhoneInput } from "@reblu/site-ui/phone-input";
14551
- import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
14552
- var DEFAULT_LABELS6 = {
14701
+ import { Fragment as Fragment4, jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
14702
+ var DEFAULT_LABELS7 = {
14553
14703
  contactTitle: "Datos de contacto",
14554
14704
  nameLabel: "Nombre completo",
14555
14705
  namePlaceholder: "Tu nombre",
@@ -14588,7 +14738,7 @@ function CheckoutForm({
14588
14738
  locale,
14589
14739
  className
14590
14740
  }) {
14591
- const t = { ...DEFAULT_LABELS6, ...labels };
14741
+ const t = { ...DEFAULT_LABELS7, ...labels };
14592
14742
  const details = checkoutError?.details;
14593
14743
  const rejectedPhone = checkoutError?.code === "INVALID_INPUT" && typeof details === "object" && details !== null && !Array.isArray(details) && "field" in details && details.field === "customerPhone" && typeof checkoutError.error === "string" && checkoutError.error.trim().length > 0;
14594
14744
  const phoneError = contactErrors?.phone ?? (rejectedPhone ? checkoutError.error : void 0);
@@ -14602,22 +14752,22 @@ function CheckoutForm({
14602
14752
  event.preventDefault();
14603
14753
  if (discountCode.trim() && !discountApplying) onApplyDiscount();
14604
14754
  }
14605
- return /* @__PURE__ */ jsxs15(Fragment4, { children: [
14755
+ return /* @__PURE__ */ jsxs16(Fragment4, { children: [
14606
14756
  loginPrompt,
14607
- /* @__PURE__ */ jsxs15(
14757
+ /* @__PURE__ */ jsxs16(
14608
14758
  "form",
14609
14759
  {
14610
14760
  "data-testid": "checkout-form",
14611
14761
  onSubmit,
14612
- className: cn16("space-y-8", className),
14762
+ className: cn18("space-y-8", className),
14613
14763
  "data-slot": "checkout-form",
14614
14764
  children: [
14615
- /* @__PURE__ */ jsxs15("section", { className: "space-y-4", children: [
14616
- /* @__PURE__ */ jsx17("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.contactTitle }),
14617
- /* @__PURE__ */ jsxs15("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
14618
- /* @__PURE__ */ jsxs15("div", { className: "space-y-1", children: [
14619
- /* @__PURE__ */ jsx17("label", { htmlFor: "checkout-form-name", className: "text-sm font-medium", children: t.nameLabel }),
14620
- /* @__PURE__ */ jsx17(
14765
+ /* @__PURE__ */ jsxs16("section", { className: "space-y-4", children: [
14766
+ /* @__PURE__ */ jsx19("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.contactTitle }),
14767
+ /* @__PURE__ */ jsxs16("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
14768
+ /* @__PURE__ */ jsxs16("div", { className: "space-y-1", children: [
14769
+ /* @__PURE__ */ jsx19("label", { htmlFor: "checkout-form-name", className: "text-sm font-medium", children: t.nameLabel }),
14770
+ /* @__PURE__ */ jsx19(
14621
14771
  "input",
14622
14772
  {
14623
14773
  id: "checkout-form-name",
@@ -14626,17 +14776,17 @@ function CheckoutForm({
14626
14776
  value: contact.name,
14627
14777
  onChange: (e) => patchContact({ name: e.target.value }),
14628
14778
  placeholder: t.namePlaceholder,
14629
- className: cn16(
14779
+ className: cn18(
14630
14780
  "w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
14631
14781
  contactErrors?.name ? "border-destructive" : "border-border focus:border-primary"
14632
14782
  )
14633
14783
  }
14634
14784
  ),
14635
- contactErrors?.name && /* @__PURE__ */ jsx17("p", { className: "text-xs text-destructive", children: contactErrors.name })
14785
+ contactErrors?.name && /* @__PURE__ */ jsx19("p", { className: "text-xs text-destructive", children: contactErrors.name })
14636
14786
  ] }),
14637
- /* @__PURE__ */ jsxs15("div", { className: "space-y-1", children: [
14638
- /* @__PURE__ */ jsx17("label", { htmlFor: "checkout-form-email", className: "text-sm font-medium", children: t.emailLabel }),
14639
- /* @__PURE__ */ jsx17(
14787
+ /* @__PURE__ */ jsxs16("div", { className: "space-y-1", children: [
14788
+ /* @__PURE__ */ jsx19("label", { htmlFor: "checkout-form-email", className: "text-sm font-medium", children: t.emailLabel }),
14789
+ /* @__PURE__ */ jsx19(
14640
14790
  "input",
14641
14791
  {
14642
14792
  id: "checkout-form-email",
@@ -14645,15 +14795,15 @@ function CheckoutForm({
14645
14795
  value: contact.email,
14646
14796
  onChange: (e) => patchContact({ email: e.target.value }),
14647
14797
  placeholder: t.emailPlaceholder,
14648
- className: cn16(
14798
+ className: cn18(
14649
14799
  "w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
14650
14800
  contactErrors?.email ? "border-destructive" : "border-border focus:border-primary"
14651
14801
  )
14652
14802
  }
14653
14803
  ),
14654
- contactErrors?.email && /* @__PURE__ */ jsx17("p", { className: "text-xs text-destructive", children: contactErrors.email })
14804
+ contactErrors?.email && /* @__PURE__ */ jsx19("p", { className: "text-xs text-destructive", children: contactErrors.email })
14655
14805
  ] }),
14656
- /* @__PURE__ */ jsx17("div", { className: "space-y-1", children: /* @__PURE__ */ jsx17(
14806
+ /* @__PURE__ */ jsx19("div", { className: "space-y-1", children: /* @__PURE__ */ jsx19(
14657
14807
  PhoneInput,
14658
14808
  {
14659
14809
  id: "checkout-form-phone",
@@ -14667,15 +14817,15 @@ function CheckoutForm({
14667
14817
  ] })
14668
14818
  ] }),
14669
14819
  children2,
14670
- generalError ? /* @__PURE__ */ jsx17("p", { role: "alert", className: "text-sm text-destructive", children: generalError }) : null,
14671
- /* @__PURE__ */ jsxs15("section", { className: "space-y-3", children: [
14672
- /* @__PURE__ */ jsx17("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.discountTitle }),
14673
- appliedDiscount ? /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between rounded-lg border border-green-200 bg-green-50 px-4 py-3 dark:border-green-800 dark:bg-green-900/20", children: [
14674
- /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2 text-sm text-green-700 dark:text-green-400", children: [
14675
- /* @__PURE__ */ jsx17("span", { className: "font-semibold", children: appliedDiscount.code }),
14676
- /* @__PURE__ */ jsx17("span", { children: t.discountAppliedSuffix(formatPrice(appliedDiscount.amount, currencyCode, locale)) })
14820
+ generalError ? /* @__PURE__ */ jsx19("p", { role: "alert", className: "text-sm text-destructive", children: generalError }) : null,
14821
+ /* @__PURE__ */ jsxs16("section", { className: "space-y-3", children: [
14822
+ /* @__PURE__ */ jsx19("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.discountTitle }),
14823
+ appliedDiscount ? /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between rounded-lg border border-green-200 bg-green-50 px-4 py-3 dark:border-green-800 dark:bg-green-900/20", children: [
14824
+ /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2 text-sm text-green-700 dark:text-green-400", children: [
14825
+ /* @__PURE__ */ jsx19("span", { className: "font-semibold", children: appliedDiscount.code }),
14826
+ /* @__PURE__ */ jsx19("span", { children: t.discountAppliedSuffix(formatPrice(appliedDiscount.amount, currencyCode, locale)) })
14677
14827
  ] }),
14678
- /* @__PURE__ */ jsx17(
14828
+ /* @__PURE__ */ jsx19(
14679
14829
  "button",
14680
14830
  {
14681
14831
  type: "button",
@@ -14685,9 +14835,9 @@ function CheckoutForm({
14685
14835
  children: t.removeDiscount
14686
14836
  }
14687
14837
  )
14688
- ] }) : /* @__PURE__ */ jsxs15("div", { className: "flex gap-2", children: [
14689
- /* @__PURE__ */ jsx17("label", { htmlFor: "checkout-form-discount-code", className: "sr-only", children: t.discountTitle }),
14690
- /* @__PURE__ */ jsx17(
14838
+ ] }) : /* @__PURE__ */ jsxs16("div", { className: "flex gap-2", children: [
14839
+ /* @__PURE__ */ jsx19("label", { htmlFor: "checkout-form-discount-code", className: "sr-only", children: t.discountTitle }),
14840
+ /* @__PURE__ */ jsx19(
14691
14841
  "input",
14692
14842
  {
14693
14843
  id: "checkout-form-discount-code",
@@ -14699,7 +14849,7 @@ function CheckoutForm({
14699
14849
  className: "flex-1 rounded-lg border border-border bg-background px-3 py-2 text-sm uppercase transition focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20"
14700
14850
  }
14701
14851
  ),
14702
- /* @__PURE__ */ jsx17(
14852
+ /* @__PURE__ */ jsx19(
14703
14853
  "button",
14704
14854
  {
14705
14855
  type: "button",
@@ -14710,14 +14860,14 @@ function CheckoutForm({
14710
14860
  }
14711
14861
  )
14712
14862
  ] }),
14713
- discountError && /* @__PURE__ */ jsx17("p", { className: "text-xs text-destructive", children: discountError })
14863
+ discountError && /* @__PURE__ */ jsx19("p", { className: "text-xs text-destructive", children: discountError })
14714
14864
  ] }),
14715
- /* @__PURE__ */ jsx17(
14865
+ /* @__PURE__ */ jsx19(
14716
14866
  "button",
14717
14867
  {
14718
14868
  type: "submit",
14719
14869
  disabled: submitting || submitDisabled,
14720
- className: cn16(
14870
+ className: cn18(
14721
14871
  "flex w-full items-center justify-center gap-2 rounded-xl px-4 py-3 font-semibold transition-all",
14722
14872
  submitting || submitDisabled ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
14723
14873
  ),
@@ -14731,20 +14881,20 @@ function CheckoutForm({
14731
14881
  }
14732
14882
 
14733
14883
  // src/components/order-confirmation.tsx
14734
- import { cn as cn18 } from "@reblu/site-ui/utils";
14884
+ import { cn as cn20 } from "@reblu/site-ui/utils";
14735
14885
 
14736
14886
  // src/components/order-invoice-link.tsx
14737
- import { cn as cn17 } from "@reblu/site-ui/utils";
14738
- import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
14739
- var DEFAULT_LABELS7 = {
14887
+ import { cn as cn19 } from "@reblu/site-ui/utils";
14888
+ import { jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
14889
+ var DEFAULT_LABELS8 = {
14740
14890
  linkLabel: "Descargar la factura {number}",
14741
14891
  signInHint: "Te pediremos que inicies sesi\xF3n para abrirla."
14742
14892
  };
14743
14893
  function OrderInvoiceLink({ invoice, labels, className }) {
14744
14894
  if (!invoice) return null;
14745
- const t = { ...DEFAULT_LABELS7, ...labels };
14746
- return /* @__PURE__ */ jsxs16("div", { className: cn17("space-y-1 text-sm", className), "data-slot": "order-invoice-link", children: [
14747
- /* @__PURE__ */ jsx18(
14895
+ const t = { ...DEFAULT_LABELS8, ...labels };
14896
+ return /* @__PURE__ */ jsxs17("div", { className: cn19("space-y-1 text-sm", className), "data-slot": "order-invoice-link", children: [
14897
+ /* @__PURE__ */ jsx20(
14748
14898
  "a",
14749
14899
  {
14750
14900
  href: invoice.url,
@@ -14752,13 +14902,13 @@ function OrderInvoiceLink({ invoice, labels, className }) {
14752
14902
  children: t.linkLabel.replace("{number}", invoice.number)
14753
14903
  }
14754
14904
  ),
14755
- /* @__PURE__ */ jsx18("p", { className: "text-muted-foreground", children: t.signInHint })
14905
+ /* @__PURE__ */ jsx20("p", { className: "text-muted-foreground", children: t.signInHint })
14756
14906
  ] });
14757
14907
  }
14758
14908
 
14759
14909
  // src/components/order-confirmation.tsx
14760
- import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
14761
- var DEFAULT_LABELS8 = {
14910
+ import { jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
14911
+ var DEFAULT_LABELS9 = {
14762
14912
  pollingTitle: "Confirmando tu pedido\u2026",
14763
14913
  pollingDescription: "Estamos procesando el pago, un momento\u2026",
14764
14914
  foundTitle: "\xA1Pedido confirmado!",
@@ -14799,7 +14949,7 @@ function OrderConfirmation({
14799
14949
  locale,
14800
14950
  className
14801
14951
  }) {
14802
- const t = { ...DEFAULT_LABELS8, ...labels };
14952
+ const t = { ...DEFAULT_LABELS9, ...labels };
14803
14953
  const isPolling = status === "polling" || status === "loading";
14804
14954
  const isFound = status === "found" || status === "paid";
14805
14955
  const { title, description } = (() => {
@@ -14821,43 +14971,43 @@ function OrderConfirmation({
14821
14971
  const showOrderReference = Boolean(order) && !showFullOrderSummary && (status === "refunded" || status === "partially_refunded" || status === "pending_timeout");
14822
14972
  const showSessionReference = !order && sessionId && (status === "timeout" || status === "not_found" || status === "pending_timeout");
14823
14973
  const showRecheck = (status === "pending_timeout" || status === "error") && onRecheck;
14824
- return /* @__PURE__ */ jsxs17("div", { className: cn18("space-y-6 text-center", className), "data-slot": "order-confirmation", children: [
14825
- /* @__PURE__ */ jsx19("h1", { className: "text-3xl font-bold", children: title }),
14826
- /* @__PURE__ */ jsx19("p", { className: "text-lg text-muted-foreground", children: description }),
14827
- showFullOrderSummary && order && /* @__PURE__ */ jsxs17("div", { className: "space-y-6", children: [
14828
- /* @__PURE__ */ jsxs17("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
14829
- /* @__PURE__ */ jsx19("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderNumberLabel }),
14830
- /* @__PURE__ */ jsx19("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
14974
+ return /* @__PURE__ */ jsxs18("div", { className: cn20("space-y-6 text-center", className), "data-slot": "order-confirmation", children: [
14975
+ /* @__PURE__ */ jsx21("h1", { className: "text-3xl font-bold", children: title }),
14976
+ /* @__PURE__ */ jsx21("p", { className: "text-lg text-muted-foreground", children: description }),
14977
+ showFullOrderSummary && order && /* @__PURE__ */ jsxs18("div", { className: "space-y-6", children: [
14978
+ /* @__PURE__ */ jsxs18("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
14979
+ /* @__PURE__ */ jsx21("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderNumberLabel }),
14980
+ /* @__PURE__ */ jsx21("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
14831
14981
  ] }),
14832
- /* @__PURE__ */ jsxs17("div", { className: "mx-auto max-w-sm space-y-3 rounded-xl border border-border bg-card p-5 text-left", children: [
14833
- order.items.map((item, idx) => /* @__PURE__ */ jsxs17(
14982
+ /* @__PURE__ */ jsxs18("div", { className: "mx-auto max-w-sm space-y-3 rounded-xl border border-border bg-card p-5 text-left", children: [
14983
+ order.items.map((item, idx) => /* @__PURE__ */ jsxs18(
14834
14984
  "div",
14835
14985
  {
14836
14986
  className: "flex justify-between gap-4 text-sm",
14837
14987
  children: [
14838
- /* @__PURE__ */ jsxs17("span", { className: "max-w-[60%] truncate text-muted-foreground", children: [
14988
+ /* @__PURE__ */ jsxs18("span", { className: "max-w-[60%] truncate text-muted-foreground", children: [
14839
14989
  item.product.name,
14840
14990
  item.variant ? ` (${item.variant.name})` : "",
14841
14991
  " x",
14842
14992
  item.quantity
14843
14993
  ] }),
14844
- /* @__PURE__ */ jsx19("span", { children: formatPrice(item.total, currencyCode, locale) })
14994
+ /* @__PURE__ */ jsx21("span", { children: formatPrice(item.total, currencyCode, locale) })
14845
14995
  ]
14846
14996
  },
14847
14997
  idx
14848
14998
  )),
14849
- /* @__PURE__ */ jsx19("div", { className: "space-y-1 border-t border-border pt-3 text-sm", children: /* @__PURE__ */ jsxs17("div", { className: "flex justify-between pt-1 text-base font-bold", children: [
14850
- /* @__PURE__ */ jsx19("span", { children: t.totalLabel }),
14851
- /* @__PURE__ */ jsx19("span", { children: formatPrice(order.total, currencyCode, locale) })
14999
+ /* @__PURE__ */ jsx21("div", { className: "space-y-1 border-t border-border pt-3 text-sm", children: /* @__PURE__ */ jsxs18("div", { className: "flex justify-between pt-1 text-base font-bold", children: [
15000
+ /* @__PURE__ */ jsx21("span", { children: t.totalLabel }),
15001
+ /* @__PURE__ */ jsx21("span", { children: formatPrice(order.total, currencyCode, locale) })
14852
15002
  ] }) })
14853
15003
  ] }),
14854
- /* @__PURE__ */ jsxs17("p", { className: "mx-auto max-w-sm text-sm text-muted-foreground", children: [
15004
+ /* @__PURE__ */ jsxs18("p", { className: "mx-auto max-w-sm text-sm text-muted-foreground", children: [
14855
15005
  t.confirmationEmailPrefix,
14856
15006
  " ",
14857
- /* @__PURE__ */ jsx19("span", { className: "font-medium text-foreground", children: order.customerEmail }),
15007
+ /* @__PURE__ */ jsx21("span", { className: "font-medium text-foreground", children: order.customerEmail }),
14858
15008
  "."
14859
15009
  ] }),
14860
- /* @__PURE__ */ jsx19(
15010
+ /* @__PURE__ */ jsx21(
14861
15011
  OrderInvoiceLink,
14862
15012
  {
14863
15013
  invoice: order.invoice,
@@ -14865,11 +15015,11 @@ function OrderConfirmation({
14865
15015
  }
14866
15016
  )
14867
15017
  ] }),
14868
- showOrderReference && order && /* @__PURE__ */ jsxs17("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
14869
- /* @__PURE__ */ jsx19("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderReferenceLabel }),
14870
- /* @__PURE__ */ jsx19("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
15018
+ showOrderReference && order && /* @__PURE__ */ jsxs18("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
15019
+ /* @__PURE__ */ jsx21("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderReferenceLabel }),
15020
+ /* @__PURE__ */ jsx21("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
14871
15021
  ] }),
14872
- status === "failed" && cartHref && /* @__PURE__ */ jsx19(
15022
+ status === "failed" && cartHref && /* @__PURE__ */ jsx21(
14873
15023
  "a",
14874
15024
  {
14875
15025
  href: cartHref,
@@ -14877,7 +15027,7 @@ function OrderConfirmation({
14877
15027
  children: t.backToCartLabel
14878
15028
  }
14879
15029
  ),
14880
- showRecheck && /* @__PURE__ */ jsx19(
15030
+ showRecheck && /* @__PURE__ */ jsx21(
14881
15031
  "button",
14882
15032
  {
14883
15033
  type: "button",
@@ -14886,16 +15036,16 @@ function OrderConfirmation({
14886
15036
  children: t.recheckLabel
14887
15037
  }
14888
15038
  ),
14889
- showSessionReference && /* @__PURE__ */ jsxs17("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
14890
- /* @__PURE__ */ jsx19("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.sessionReferenceLabel }),
14891
- /* @__PURE__ */ jsx19("p", { className: "break-all font-mono text-sm font-semibold", children: sessionId })
15039
+ showSessionReference && /* @__PURE__ */ jsxs18("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
15040
+ /* @__PURE__ */ jsx21("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.sessionReferenceLabel }),
15041
+ /* @__PURE__ */ jsx21("p", { className: "break-all font-mono text-sm font-semibold", children: sessionId })
14892
15042
  ] })
14893
15043
  ] });
14894
15044
  }
14895
15045
 
14896
15046
  // src/components/full-invoice-fields.tsx
14897
- import { cn as cn19 } from "@reblu/site-ui/utils";
14898
- import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
15047
+ import { cn as cn21 } from "@reblu/site-ui/utils";
15048
+ import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
14899
15049
  var EMPTY_FULL_INVOICE_VALUE = {
14900
15050
  wantsFullInvoice: false,
14901
15051
  billingIdType: "NIF",
@@ -14907,7 +15057,7 @@ var EMPTY_FULL_INVOICE_VALUE = {
14907
15057
  city: "",
14908
15058
  country: "ES"
14909
15059
  };
14910
- var DEFAULT_LABELS9 = {
15060
+ var DEFAULT_LABELS10 = {
14911
15061
  toggle: "\xBFQuieres factura completa?",
14912
15062
  underCapNotice: "Para una factura completa necesitas tu NIF/NIE o un documento de identificaci\xF3n. Si no, recibir\xE1s una factura simplificada.",
14913
15063
  overCapNotice: "El importe del pedido supera el m\xE1ximo de la factura simplificada: para completar la compra, indica tu NIF/NIE o un documento de identificaci\xF3n, tu nombre y tu direcci\xF3n de facturaci\xF3n.",
@@ -15008,16 +15158,16 @@ function FullInvoiceFields({
15008
15158
  className
15009
15159
  }) {
15010
15160
  if (!issuesInvoices) return null;
15011
- const t = { ...DEFAULT_LABELS9, ...labels };
15161
+ const t = { ...DEFAULT_LABELS10, ...labels };
15012
15162
  const showFields = value.wantsFullInvoice || overCap;
15013
15163
  const isSpanishNif = value.billingIdType === "NIF";
15014
15164
  const set = (key2, next2) => onChange({ ...value, [key2]: next2 });
15015
- const error = (key2) => errors[key2] ? /* @__PURE__ */ jsx20("p", { id: `full-invoice-${key2}-error`, className: "text-sm text-destructive", children: errors[key2] }) : null;
15165
+ const error = (key2) => errors[key2] ? /* @__PURE__ */ jsx22("p", { id: `full-invoice-${key2}-error`, className: "text-sm text-destructive", children: errors[key2] }) : null;
15016
15166
  const invalid2 = (key2) => errors[key2] ? { "aria-invalid": true, "aria-describedby": `full-invoice-${key2}-error` } : {};
15017
- return /* @__PURE__ */ jsxs18("section", { className: cn19("space-y-4", className), "data-slot": "full-invoice-fields", children: [
15018
- overCap ? /* @__PURE__ */ jsx20("p", { role: "note", className: "rounded-lg border border-border p-4 text-sm", children: t.overCapNotice }) : /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
15019
- /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-2 text-sm font-medium", children: [
15020
- /* @__PURE__ */ jsx20(
15167
+ return /* @__PURE__ */ jsxs19("section", { className: cn21("space-y-4", className), "data-slot": "full-invoice-fields", children: [
15168
+ overCap ? /* @__PURE__ */ jsx22("p", { role: "note", className: "rounded-lg border border-border p-4 text-sm", children: t.overCapNotice }) : /* @__PURE__ */ jsxs19("div", { className: "space-y-1", children: [
15169
+ /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-2 text-sm font-medium", children: [
15170
+ /* @__PURE__ */ jsx22(
15021
15171
  "input",
15022
15172
  {
15023
15173
  type: "checkbox",
@@ -15027,12 +15177,12 @@ function FullInvoiceFields({
15027
15177
  ),
15028
15178
  t.toggle
15029
15179
  ] }),
15030
- /* @__PURE__ */ jsx20("p", { className: "text-sm text-muted-foreground", children: t.underCapNotice })
15180
+ /* @__PURE__ */ jsx22("p", { className: "text-sm text-muted-foreground", children: t.underCapNotice })
15031
15181
  ] }),
15032
- showFields && /* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
15033
- /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
15034
- /* @__PURE__ */ jsx20("label", { htmlFor: "full-invoice-id-type", className: "text-sm font-medium", children: t.idType }),
15035
- /* @__PURE__ */ jsx20(
15182
+ showFields && /* @__PURE__ */ jsxs19("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
15183
+ /* @__PURE__ */ jsxs19("div", { className: "space-y-1", children: [
15184
+ /* @__PURE__ */ jsx22("label", { htmlFor: "full-invoice-id-type", className: "text-sm font-medium", children: t.idType }),
15185
+ /* @__PURE__ */ jsx22(
15036
15186
  "select",
15037
15187
  {
15038
15188
  id: "full-invoice-id-type",
@@ -15041,14 +15191,14 @@ function FullInvoiceFields({
15041
15191
  value: value.billingIdType,
15042
15192
  onChange: (e) => set("billingIdType", e.target.value),
15043
15193
  ...invalid2("billingIdType"),
15044
- children: ID_TYPES.map((type) => /* @__PURE__ */ jsx20("option", { value: type, children: t.idTypeOptions[type] }, type))
15194
+ children: ID_TYPES.map((type) => /* @__PURE__ */ jsx22("option", { value: type, children: t.idTypeOptions[type] }, type))
15045
15195
  }
15046
15196
  ),
15047
15197
  error("billingIdType")
15048
15198
  ] }),
15049
- !isSpanishNif && /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
15050
- /* @__PURE__ */ jsx20("label", { htmlFor: "full-invoice-id-country", className: "text-sm font-medium", children: t.idCountry }),
15051
- /* @__PURE__ */ jsxs18(
15199
+ !isSpanishNif && /* @__PURE__ */ jsxs19("div", { className: "space-y-1", children: [
15200
+ /* @__PURE__ */ jsx22("label", { htmlFor: "full-invoice-id-country", className: "text-sm font-medium", children: t.idCountry }),
15201
+ /* @__PURE__ */ jsxs19(
15052
15202
  "select",
15053
15203
  {
15054
15204
  id: "full-invoice-id-country",
@@ -15058,16 +15208,16 @@ function FullInvoiceFields({
15058
15208
  onChange: (e) => set("billingIdCountry", e.target.value),
15059
15209
  ...invalid2("billingIdCountry"),
15060
15210
  children: [
15061
- /* @__PURE__ */ jsx20("option", { value: "", disabled: true, children: t.chooseCountry }),
15062
- countries.map((c) => /* @__PURE__ */ jsx20("option", { value: c.code, children: c.name }, c.code))
15211
+ /* @__PURE__ */ jsx22("option", { value: "", disabled: true, children: t.chooseCountry }),
15212
+ countries.map((c) => /* @__PURE__ */ jsx22("option", { value: c.code, children: c.name }, c.code))
15063
15213
  ]
15064
15214
  }
15065
15215
  ),
15066
15216
  error("billingIdCountry")
15067
15217
  ] }),
15068
- /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
15069
- /* @__PURE__ */ jsx20("label", { htmlFor: "full-invoice-nif", className: "text-sm font-medium", children: isSpanishNif ? t.spanishNif : t.documentNumber }),
15070
- /* @__PURE__ */ jsx20(
15218
+ /* @__PURE__ */ jsxs19("div", { className: "space-y-1", children: [
15219
+ /* @__PURE__ */ jsx22("label", { htmlFor: "full-invoice-nif", className: "text-sm font-medium", children: isSpanishNif ? t.spanishNif : t.documentNumber }),
15220
+ /* @__PURE__ */ jsx22(
15071
15221
  "input",
15072
15222
  {
15073
15223
  id: "full-invoice-nif",
@@ -15080,9 +15230,9 @@ function FullInvoiceFields({
15080
15230
  ),
15081
15231
  error("billingNif")
15082
15232
  ] }),
15083
- /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
15084
- /* @__PURE__ */ jsx20("label", { htmlFor: "full-invoice-name", className: "text-sm font-medium", children: t.name }),
15085
- /* @__PURE__ */ jsx20(
15233
+ /* @__PURE__ */ jsxs19("div", { className: "space-y-1", children: [
15234
+ /* @__PURE__ */ jsx22("label", { htmlFor: "full-invoice-name", className: "text-sm font-medium", children: t.name }),
15235
+ /* @__PURE__ */ jsx22(
15086
15236
  "input",
15087
15237
  {
15088
15238
  id: "full-invoice-name",
@@ -15095,9 +15245,9 @@ function FullInvoiceFields({
15095
15245
  ),
15096
15246
  error("billingName")
15097
15247
  ] }),
15098
- /* @__PURE__ */ jsxs18("div", { className: "space-y-1 sm:col-span-2", children: [
15099
- /* @__PURE__ */ jsx20("label", { htmlFor: "full-invoice-street", className: "text-sm font-medium", children: t.street }),
15100
- /* @__PURE__ */ jsx20(
15248
+ /* @__PURE__ */ jsxs19("div", { className: "space-y-1 sm:col-span-2", children: [
15249
+ /* @__PURE__ */ jsx22("label", { htmlFor: "full-invoice-street", className: "text-sm font-medium", children: t.street }),
15250
+ /* @__PURE__ */ jsx22(
15101
15251
  "input",
15102
15252
  {
15103
15253
  id: "full-invoice-street",
@@ -15109,9 +15259,9 @@ function FullInvoiceFields({
15109
15259
  }
15110
15260
  )
15111
15261
  ] }),
15112
- /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
15113
- /* @__PURE__ */ jsx20("label", { htmlFor: "full-invoice-postal-code", className: "text-sm font-medium", children: t.postalCode }),
15114
- /* @__PURE__ */ jsx20(
15262
+ /* @__PURE__ */ jsxs19("div", { className: "space-y-1", children: [
15263
+ /* @__PURE__ */ jsx22("label", { htmlFor: "full-invoice-postal-code", className: "text-sm font-medium", children: t.postalCode }),
15264
+ /* @__PURE__ */ jsx22(
15115
15265
  "input",
15116
15266
  {
15117
15267
  id: "full-invoice-postal-code",
@@ -15122,9 +15272,9 @@ function FullInvoiceFields({
15122
15272
  }
15123
15273
  )
15124
15274
  ] }),
15125
- /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
15126
- /* @__PURE__ */ jsx20("label", { htmlFor: "full-invoice-city", className: "text-sm font-medium", children: t.city }),
15127
- /* @__PURE__ */ jsx20(
15275
+ /* @__PURE__ */ jsxs19("div", { className: "space-y-1", children: [
15276
+ /* @__PURE__ */ jsx22("label", { htmlFor: "full-invoice-city", className: "text-sm font-medium", children: t.city }),
15277
+ /* @__PURE__ */ jsx22(
15128
15278
  "input",
15129
15279
  {
15130
15280
  id: "full-invoice-city",
@@ -15135,9 +15285,9 @@ function FullInvoiceFields({
15135
15285
  }
15136
15286
  )
15137
15287
  ] }),
15138
- /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
15139
- /* @__PURE__ */ jsx20("label", { htmlFor: "full-invoice-country", className: "text-sm font-medium", children: t.country }),
15140
- /* @__PURE__ */ jsx20(
15288
+ /* @__PURE__ */ jsxs19("div", { className: "space-y-1", children: [
15289
+ /* @__PURE__ */ jsx22("label", { htmlFor: "full-invoice-country", className: "text-sm font-medium", children: t.country }),
15290
+ /* @__PURE__ */ jsx22(
15141
15291
  "select",
15142
15292
  {
15143
15293
  id: "full-invoice-country",
@@ -15145,21 +15295,23 @@ function FullInvoiceFields({
15145
15295
  required: true,
15146
15296
  value: value.country,
15147
15297
  onChange: (e) => set("country", e.target.value),
15148
- children: countries.map((c) => /* @__PURE__ */ jsx20("option", { value: c.code, children: c.name }, c.code))
15298
+ children: countries.map((c) => /* @__PURE__ */ jsx22("option", { value: c.code, children: c.name }, c.code))
15149
15299
  }
15150
15300
  )
15151
15301
  ] }),
15152
- /* @__PURE__ */ jsx20("div", { className: "sm:col-span-2", children: error("address") })
15302
+ /* @__PURE__ */ jsx22("div", { className: "sm:col-span-2", children: error("address") })
15153
15303
  ] })
15154
15304
  ] });
15155
15305
  }
15156
15306
  export {
15157
15307
  ALLOWED_YOUTUBE_HOSTS,
15158
15308
  AddedToCartToast,
15309
+ CartAdjustmentsNotice,
15159
15310
  CartLineList,
15160
15311
  CartSummary,
15161
15312
  CheckoutForm,
15162
15313
  CheckoutLoginPrompt,
15314
+ CourseDescription,
15163
15315
  DEFAULT_INVOICE_COUNTRIES,
15164
15316
  DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE,
15165
15317
  DEFAULT_SHOP_ERROR_MESSAGES,
@@ -15188,6 +15340,7 @@ export {
15188
15340
  getShopErrorMessage,
15189
15341
  isAllowedYouTubeHost,
15190
15342
  isOverSimplifiedInvoiceCap,
15343
+ markdownToPlainText,
15191
15344
  markdownToSafeHtml,
15192
15345
  readingTime,
15193
15346
  sanitizeHtml,