@reblu/site-blocks 0.33.0 → 0.34.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/CHANGELOG.md +23 -0
- package/README.md +163 -2
- package/dist/client.cjs +459 -0
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +142 -3
- package/dist/client.d.ts +142 -3
- package/dist/client.js +453 -0
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +611 -483
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +57 -78
- package/dist/index.d.ts +57 -78
- package/dist/index.js +607 -484
- package/dist/index.js.map +1 -1
- package/dist/{full-invoice-fields-DMX0sjPG.d.cts → page-links-C0nXQzAW.d.cts} +105 -2
- package/dist/{full-invoice-fields-DMX0sjPG.d.ts → page-links-C0nXQzAW.d.ts} +105 -2
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -66,6 +66,7 @@ __export(src_exports, {
|
|
|
66
66
|
ImageTextSplit: () => ImageTextSplit,
|
|
67
67
|
LegalDocument: () => LegalDocument,
|
|
68
68
|
LessonPreview: () => LessonPreview,
|
|
69
|
+
LinkedPagesGrid: () => LinkedPagesGrid,
|
|
69
70
|
MarkdownRenderer: () => MarkdownRenderer,
|
|
70
71
|
OrderConfirmation: () => OrderConfirmation,
|
|
71
72
|
OrderInvoiceLink: () => OrderInvoiceLink,
|
|
@@ -80,6 +81,7 @@ __export(src_exports, {
|
|
|
80
81
|
SafeHtml: () => SafeHtml,
|
|
81
82
|
ShopFilters: () => ShopFilters,
|
|
82
83
|
Specialty: () => Specialty,
|
|
84
|
+
TeamGrid: () => TeamGrid,
|
|
83
85
|
Treatment: () => Treatment,
|
|
84
86
|
TrustBadges: () => TrustBadges,
|
|
85
87
|
buildFaqPageJsonLd: () => buildFaqPageJsonLd,
|
|
@@ -89,11 +91,14 @@ __export(src_exports, {
|
|
|
89
91
|
collectFaqItems: () => collectFaqItems,
|
|
90
92
|
courseSellsAsGuest: () => courseSellsAsGuest,
|
|
91
93
|
defaultCheckoutFulfillment: () => defaultCheckoutFulfillment,
|
|
94
|
+
filterByLink: () => filterByLink,
|
|
92
95
|
formatPrice: () => formatPrice,
|
|
93
96
|
getShopErrorMessage: () => getShopErrorMessage,
|
|
94
97
|
isAllowedYouTubeHost: () => isAllowedYouTubeHost,
|
|
95
98
|
isCheckoutDeliveryComplete: () => isCheckoutDeliveryComplete,
|
|
96
99
|
isOverSimplifiedInvoiceCap: () => isOverSimplifiedInvoiceCap,
|
|
100
|
+
linkFilterOptions: () => linkFilterOptions,
|
|
101
|
+
linkKey: () => linkKey,
|
|
97
102
|
markdownToPlainText: () => markdownToPlainText,
|
|
98
103
|
markdownToSafeHtml: () => markdownToSafeHtml,
|
|
99
104
|
quoteRequiresDelivery: () => quoteRequiresDelivery,
|
|
@@ -14066,22 +14071,101 @@ function ProfileCard({
|
|
|
14066
14071
|
);
|
|
14067
14072
|
}
|
|
14068
14073
|
|
|
14069
|
-
// src/components/
|
|
14074
|
+
// src/components/linked-pages.tsx
|
|
14070
14075
|
var import_utils8 = require("@reblu/site-ui/utils");
|
|
14076
|
+
|
|
14077
|
+
// src/lib/page-links.ts
|
|
14078
|
+
function linkKey(link) {
|
|
14079
|
+
return `${link.category?.slug ?? ""}/${link.slug}`;
|
|
14080
|
+
}
|
|
14081
|
+
function linkFilterOptions(items) {
|
|
14082
|
+
const seen = /* @__PURE__ */ new Map();
|
|
14083
|
+
for (const item of items) {
|
|
14084
|
+
for (const link of item.links ?? []) {
|
|
14085
|
+
const key2 = linkKey(link);
|
|
14086
|
+
if (!seen.has(key2)) seen.set(key2, { key: key2, label: link.title });
|
|
14087
|
+
}
|
|
14088
|
+
}
|
|
14089
|
+
return [...seen.values()];
|
|
14090
|
+
}
|
|
14091
|
+
function filterByLink(items, key2) {
|
|
14092
|
+
if (key2 === null) return items;
|
|
14093
|
+
return items.filter((item) => (item.links ?? []).some((link) => linkKey(link) === key2));
|
|
14094
|
+
}
|
|
14095
|
+
|
|
14096
|
+
// src/components/linked-pages.tsx
|
|
14071
14097
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
14098
|
+
function LinkedPagesGrid({
|
|
14099
|
+
pages,
|
|
14100
|
+
pageHref = (page) => `/${page.slug}`,
|
|
14101
|
+
heading,
|
|
14102
|
+
className
|
|
14103
|
+
}) {
|
|
14104
|
+
if (!pages || pages.length === 0) return null;
|
|
14105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { className: (0, import_utils8.cn)("space-y-6", className), "data-slot": "linked-pages", children: [
|
|
14106
|
+
heading && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h2", { className: "text-2xl font-bold", children: heading }),
|
|
14107
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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__ */ (0, import_jsx_runtime12.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
14108
|
+
"a",
|
|
14109
|
+
{
|
|
14110
|
+
href: pageHref(page),
|
|
14111
|
+
className: "group flex h-full flex-col overflow-hidden rounded-lg border bg-card transition-shadow hover:shadow-lg",
|
|
14112
|
+
children: [
|
|
14113
|
+
page.coverImageUrl && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "relative aspect-video overflow-hidden bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
14114
|
+
"img",
|
|
14115
|
+
{
|
|
14116
|
+
src: page.coverImageUrl,
|
|
14117
|
+
alt: "",
|
|
14118
|
+
loading: "lazy",
|
|
14119
|
+
className: "h-full w-full object-cover transition-transform group-hover:scale-105"
|
|
14120
|
+
}
|
|
14121
|
+
) }),
|
|
14122
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-1 flex-col gap-2 p-4", children: [
|
|
14123
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: "font-semibold leading-tight transition-colors group-hover:text-primary", children: page.title }),
|
|
14124
|
+
page.excerpt && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "line-clamp-2 text-sm text-muted-foreground", children: page.excerpt })
|
|
14125
|
+
] })
|
|
14126
|
+
]
|
|
14127
|
+
}
|
|
14128
|
+
) }, linkKey(page))) })
|
|
14129
|
+
] });
|
|
14130
|
+
}
|
|
14131
|
+
function TeamGrid({
|
|
14132
|
+
members,
|
|
14133
|
+
memberHref,
|
|
14134
|
+
heading,
|
|
14135
|
+
className
|
|
14136
|
+
}) {
|
|
14137
|
+
if (!members || members.length === 0) return null;
|
|
14138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { className: (0, import_utils8.cn)("space-y-6", className), "data-slot": "team-grid", children: [
|
|
14139
|
+
heading && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h2", { className: "text-2xl font-bold", children: heading }),
|
|
14140
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ul", { className: "grid list-none grid-cols-1 gap-6 p-0 sm:grid-cols-2 lg:grid-cols-3", children: members.map((member) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
14141
|
+
ProfileCard,
|
|
14142
|
+
{
|
|
14143
|
+
name: member.title,
|
|
14144
|
+
role: member.role ?? void 0,
|
|
14145
|
+
imageUrl: member.coverImageUrl ?? void 0,
|
|
14146
|
+
href: memberHref?.(member),
|
|
14147
|
+
className: "h-full"
|
|
14148
|
+
}
|
|
14149
|
+
) }, linkKey(member))) })
|
|
14150
|
+
] });
|
|
14151
|
+
}
|
|
14152
|
+
|
|
14153
|
+
// src/components/product-card.tsx
|
|
14154
|
+
var import_utils9 = require("@reblu/site-ui/utils");
|
|
14155
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
14072
14156
|
function ProductCard({ product, href, currencyCode = "EUR", locale, className }) {
|
|
14073
14157
|
const image = product.images.find((i) => i.isPrimary) ?? product.images[0];
|
|
14074
14158
|
const hasDiscount = product.comparePrice != null && product.comparePrice > product.price;
|
|
14075
|
-
return /* @__PURE__ */ (0,
|
|
14159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
14076
14160
|
"article",
|
|
14077
14161
|
{
|
|
14078
|
-
className: (0,
|
|
14162
|
+
className: (0, import_utils9.cn)(
|
|
14079
14163
|
"group flex flex-col overflow-hidden rounded-lg border bg-card transition-shadow hover:shadow-lg",
|
|
14080
14164
|
className
|
|
14081
14165
|
),
|
|
14082
14166
|
"data-slot": "product-card",
|
|
14083
14167
|
children: [
|
|
14084
|
-
/* @__PURE__ */ (0,
|
|
14168
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "relative aspect-square overflow-hidden bg-muted", children: image ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
14085
14169
|
"img",
|
|
14086
14170
|
{
|
|
14087
14171
|
src: image.url,
|
|
@@ -14089,14 +14173,14 @@ function ProductCard({ product, href, currencyCode = "EUR", locale, className })
|
|
|
14089
14173
|
loading: "lazy",
|
|
14090
14174
|
className: "h-full w-full object-cover transition-transform group-hover:scale-105"
|
|
14091
14175
|
}
|
|
14092
|
-
) : /* @__PURE__ */ (0,
|
|
14093
|
-
/* @__PURE__ */ (0,
|
|
14094
|
-
product.category && /* @__PURE__ */ (0,
|
|
14095
|
-
/* @__PURE__ */ (0,
|
|
14096
|
-
product.shortDescription && /* @__PURE__ */ (0,
|
|
14097
|
-
/* @__PURE__ */ (0,
|
|
14098
|
-
/* @__PURE__ */ (0,
|
|
14099
|
-
hasDiscount && /* @__PURE__ */ (0,
|
|
14176
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex h-full items-center justify-center text-4xl text-muted-foreground/30", "aria-hidden": "true", children: "\u{1F6CD}\uFE0F" }) }),
|
|
14177
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-1 flex-col gap-2 p-4", children: [
|
|
14178
|
+
product.category && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("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 }),
|
|
14179
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h3", { className: "text-base font-semibold leading-tight", children: href ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("a", { href, className: "transition-colors hover:text-primary", children: product.name }) : product.name }),
|
|
14180
|
+
product.shortDescription && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "line-clamp-2 text-sm text-muted-foreground", children: product.shortDescription }),
|
|
14181
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "mt-auto flex items-baseline gap-2 pt-2", children: [
|
|
14182
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-lg font-bold text-foreground", children: formatPrice(product.price, currencyCode, locale) }),
|
|
14183
|
+
hasDiscount && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-sm text-muted-foreground line-through", children: formatPrice(product.comparePrice, currencyCode, locale) })
|
|
14100
14184
|
] })
|
|
14101
14185
|
] })
|
|
14102
14186
|
]
|
|
@@ -14298,7 +14382,7 @@ var __iconNode8 = [
|
|
|
14298
14382
|
var Truck = createLucideIcon("truck", __iconNode8);
|
|
14299
14383
|
|
|
14300
14384
|
// src/components/product-trust-items.tsx
|
|
14301
|
-
var
|
|
14385
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
14302
14386
|
var DEFAULT_TRUST_ICONS = Object.freeze({
|
|
14303
14387
|
shipping: Truck,
|
|
14304
14388
|
returns: RotateCcw,
|
|
@@ -14332,17 +14416,17 @@ function ProductTrustItems({
|
|
|
14332
14416
|
return [{ key: `${index}-${icon}`, Icon: Icon2, text: text3 }];
|
|
14333
14417
|
});
|
|
14334
14418
|
if (rows.length === 0) return null;
|
|
14335
|
-
return /* @__PURE__ */ (0,
|
|
14336
|
-
/* @__PURE__ */ (0,
|
|
14337
|
-
/* @__PURE__ */ (0,
|
|
14419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(List, { "data-slot": "product-trust-items", className: slotClassName("space-y-2.5", "", className), children: rows.map(({ key: key2, Icon: Icon2, text: text3 }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("li", { className: slotClassName("flex items-center gap-3", "text-sm text-muted-foreground", itemClassName), children: [
|
|
14420
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon2, { "aria-hidden": "true", className: "h-4 w-4 shrink-0 text-foreground/60" }),
|
|
14421
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: text3 })
|
|
14338
14422
|
] }, key2)) });
|
|
14339
14423
|
}
|
|
14340
14424
|
|
|
14341
14425
|
// src/components/faq-accordion.tsx
|
|
14342
|
-
var
|
|
14426
|
+
var import_utils12 = require("@reblu/site-ui/utils");
|
|
14343
14427
|
|
|
14344
14428
|
// src/components/_heading.tsx
|
|
14345
|
-
var
|
|
14429
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
14346
14430
|
function nextHeadingLevel(level) {
|
|
14347
14431
|
return Math.min(level + 1, 6);
|
|
14348
14432
|
}
|
|
@@ -14352,11 +14436,11 @@ function Heading({
|
|
|
14352
14436
|
children: children2
|
|
14353
14437
|
}) {
|
|
14354
14438
|
const Tag = `h${level}`;
|
|
14355
|
-
return /* @__PURE__ */ (0,
|
|
14439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Tag, { className, children: children2 });
|
|
14356
14440
|
}
|
|
14357
14441
|
|
|
14358
14442
|
// src/components/faq-accordion.tsx
|
|
14359
|
-
var
|
|
14443
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
14360
14444
|
function FaqAccordion({
|
|
14361
14445
|
items,
|
|
14362
14446
|
heading,
|
|
@@ -14367,18 +14451,18 @@ function FaqAccordion({
|
|
|
14367
14451
|
}) {
|
|
14368
14452
|
const visible = items.map((item, index) => ({ item, index })).filter(({ item }) => item.q.trim() !== "");
|
|
14369
14453
|
if (visible.length === 0) return null;
|
|
14370
|
-
return /* @__PURE__ */ (0,
|
|
14371
|
-
heading && /* @__PURE__ */ (0,
|
|
14372
|
-
/* @__PURE__ */ (0,
|
|
14454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: (0, import_utils12.cn)("space-y-4", className), "data-slot": "faq-accordion", children: [
|
|
14455
|
+
heading && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Heading, { level: headingLevel, className: "text-2xl font-semibold tracking-tight", children: heading }),
|
|
14456
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "divide-y divide-border rounded-xl border border-border", children: visible.map(({ item, index }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
14373
14457
|
"details",
|
|
14374
14458
|
{
|
|
14375
14459
|
className: "group px-4",
|
|
14376
14460
|
"data-slot": "faq-item",
|
|
14377
14461
|
...defaultOpen.includes(index) ? { open: true } : {},
|
|
14378
14462
|
children: [
|
|
14379
|
-
/* @__PURE__ */ (0,
|
|
14380
|
-
questionHeadingLevel ? /* @__PURE__ */ (0,
|
|
14381
|
-
/* @__PURE__ */ (0,
|
|
14463
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("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: [
|
|
14464
|
+
questionHeadingLevel ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Heading, { level: questionHeadingLevel, className: "text-base font-medium", children: item.q }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: item.q }),
|
|
14465
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
14382
14466
|
"span",
|
|
14383
14467
|
{
|
|
14384
14468
|
"aria-hidden": "true",
|
|
@@ -14387,7 +14471,7 @@ function FaqAccordion({
|
|
|
14387
14471
|
}
|
|
14388
14472
|
)
|
|
14389
14473
|
] }),
|
|
14390
|
-
/* @__PURE__ */ (0,
|
|
14474
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "whitespace-pre-line pb-4 text-muted-foreground", children: item.a })
|
|
14391
14475
|
]
|
|
14392
14476
|
},
|
|
14393
14477
|
index
|
|
@@ -14396,7 +14480,7 @@ function FaqAccordion({
|
|
|
14396
14480
|
}
|
|
14397
14481
|
|
|
14398
14482
|
// src/components/trust-badges.tsx
|
|
14399
|
-
var
|
|
14483
|
+
var import_utils13 = require("@reblu/site-ui/utils");
|
|
14400
14484
|
|
|
14401
14485
|
// src/lib/trust-badge-media.ts
|
|
14402
14486
|
var DEFAULT_ADHESION_NUMBER_LABEL = "N.\xBA de adhesi\xF3n";
|
|
@@ -14424,7 +14508,7 @@ function trustBadgeAlt(badge, numberLabel = DEFAULT_ADHESION_NUMBER_LABEL) {
|
|
|
14424
14508
|
}
|
|
14425
14509
|
|
|
14426
14510
|
// src/components/trust-badges.tsx
|
|
14427
|
-
var
|
|
14511
|
+
var import_jsx_runtime17 = (
|
|
14428
14512
|
// eslint-disable-next-line @next/next/no-img-element -- framework-agnostic SDK; the SITE owns image optimisation
|
|
14429
14513
|
require("react/jsx-runtime")
|
|
14430
14514
|
);
|
|
@@ -14454,17 +14538,17 @@ function isUsable(value) {
|
|
|
14454
14538
|
function BadgeContent({ badge, logoClassName }) {
|
|
14455
14539
|
const src = safeLogoSrc(badge.logoUrl);
|
|
14456
14540
|
if (src) {
|
|
14457
|
-
return /* @__PURE__ */ (0,
|
|
14541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
14458
14542
|
"img",
|
|
14459
14543
|
{
|
|
14460
14544
|
src,
|
|
14461
14545
|
alt: trustBadgeAlt(badge),
|
|
14462
14546
|
loading: "lazy",
|
|
14463
|
-
className: (0,
|
|
14547
|
+
className: (0, import_utils13.cn)("h-12 w-auto object-contain", logoClassName)
|
|
14464
14548
|
}
|
|
14465
14549
|
);
|
|
14466
14550
|
}
|
|
14467
|
-
return /* @__PURE__ */ (0,
|
|
14551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm font-medium", children: badge.name });
|
|
14468
14552
|
}
|
|
14469
14553
|
function TrustBadges({
|
|
14470
14554
|
badges,
|
|
@@ -14492,14 +14576,14 @@ function TrustBadges({
|
|
|
14492
14576
|
if (groups.length === 0) return null;
|
|
14493
14577
|
const hasHeading = heading !== void 0 && heading !== null && heading !== "";
|
|
14494
14578
|
const groupHeadingLevel = hasHeading ? nextHeadingLevel(headingLevel) : headingLevel;
|
|
14495
|
-
const content = groups.map(({ type, groupHeading, items }) => /* @__PURE__ */ (0,
|
|
14579
|
+
const content = groups.map(({ type, groupHeading, items }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
14496
14580
|
"div",
|
|
14497
14581
|
{
|
|
14498
14582
|
"data-slot": "trust-badge-group",
|
|
14499
14583
|
"data-type": type,
|
|
14500
|
-
className: (0,
|
|
14584
|
+
className: (0, import_utils13.cn)("space-y-3", groupClassName),
|
|
14501
14585
|
children: [
|
|
14502
|
-
groupHeading ? /* @__PURE__ */ (0,
|
|
14586
|
+
groupHeading ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
14503
14587
|
Heading,
|
|
14504
14588
|
{
|
|
14505
14589
|
level: groupHeadingLevel,
|
|
@@ -14511,30 +14595,30 @@ function TrustBadges({
|
|
|
14511
14595
|
children: groupHeading
|
|
14512
14596
|
}
|
|
14513
14597
|
) : null,
|
|
14514
|
-
/* @__PURE__ */ (0,
|
|
14598
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ul", { className: (0, import_utils13.cn)("flex flex-wrap items-center gap-6", listClassName), children: items.map((badge) => {
|
|
14515
14599
|
const href = safeHref(badge.url);
|
|
14516
|
-
return /* @__PURE__ */ (0,
|
|
14517
|
-
/* @__PURE__ */ (0,
|
|
14600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { children: href ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("a", { href, target: "_blank", rel: "noopener noreferrer", className: "inline-flex", children: [
|
|
14601
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BadgeContent, { badge, logoClassName }),
|
|
14518
14602
|
" ",
|
|
14519
|
-
/* @__PURE__ */ (0,
|
|
14520
|
-
] }) : /* @__PURE__ */ (0,
|
|
14603
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sr-only", children: newWindowLabel })
|
|
14604
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BadgeContent, { badge, logoClassName }) }, badge.id);
|
|
14521
14605
|
}) })
|
|
14522
14606
|
]
|
|
14523
14607
|
},
|
|
14524
14608
|
type
|
|
14525
14609
|
));
|
|
14526
14610
|
if (!hasHeading) {
|
|
14527
|
-
return /* @__PURE__ */ (0,
|
|
14611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { "data-slot": "trust-badges", className: (0, import_utils13.cn)("space-y-6", className), children: content });
|
|
14528
14612
|
}
|
|
14529
14613
|
const Tag = `h${headingLevel}`;
|
|
14530
|
-
return /* @__PURE__ */ (0,
|
|
14614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
14531
14615
|
"section",
|
|
14532
14616
|
{
|
|
14533
14617
|
"data-slot": "trust-badges",
|
|
14534
14618
|
"aria-labelledby": headingId,
|
|
14535
|
-
className: (0,
|
|
14619
|
+
className: (0, import_utils13.cn)("space-y-6", className),
|
|
14536
14620
|
children: [
|
|
14537
|
-
/* @__PURE__ */ (0,
|
|
14621
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
14538
14622
|
Tag,
|
|
14539
14623
|
{
|
|
14540
14624
|
id: headingId,
|
|
@@ -14549,8 +14633,8 @@ function TrustBadges({
|
|
|
14549
14633
|
}
|
|
14550
14634
|
|
|
14551
14635
|
// src/components/arbitration-badge.tsx
|
|
14552
|
-
var
|
|
14553
|
-
var
|
|
14636
|
+
var import_utils14 = require("@reblu/site-ui/utils");
|
|
14637
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
14554
14638
|
function isArbitrationBadge(value) {
|
|
14555
14639
|
if (typeof value !== "object" || value === null) return false;
|
|
14556
14640
|
const entry = value;
|
|
@@ -14568,35 +14652,35 @@ function ArbitrationBadge({
|
|
|
14568
14652
|
if (!Array.isArray(badges)) return null;
|
|
14569
14653
|
const items = badges.filter(isArbitrationBadge);
|
|
14570
14654
|
if (items.length === 0) return null;
|
|
14571
|
-
return /* @__PURE__ */ (0,
|
|
14655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14572
14656
|
"ul",
|
|
14573
14657
|
{
|
|
14574
14658
|
"data-slot": "arbitration-badges",
|
|
14575
|
-
className: (0,
|
|
14659
|
+
className: (0, import_utils14.cn)("flex flex-wrap items-start gap-6", className),
|
|
14576
14660
|
children: items.map((badge) => {
|
|
14577
14661
|
const src = safeLogoSrc(badge.logoUrl);
|
|
14578
14662
|
const href = safeHref(badge.url);
|
|
14579
14663
|
const number2 = adhesionNumberOf(badge);
|
|
14580
|
-
const caption = number2 && (showNumber || !src) ? /* @__PURE__ */ (0,
|
|
14581
|
-
const content = /* @__PURE__ */ (0,
|
|
14664
|
+
const caption = number2 && (showNumber || !src) ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: (0, import_utils14.cn)("text-xs", numberClassName), "aria-hidden": src ? "true" : void 0, children: `${numberLabel} ${number2}` }) : null;
|
|
14665
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "inline-flex flex-col items-center gap-1 text-center", children: [
|
|
14582
14666
|
src ? (
|
|
14583
14667
|
// eslint-disable-next-line @next/next/no-img-element -- framework-agnostic SDK; the SITE owns image optimisation
|
|
14584
|
-
/* @__PURE__ */ (0,
|
|
14668
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14585
14669
|
"img",
|
|
14586
14670
|
{
|
|
14587
14671
|
src,
|
|
14588
14672
|
alt: trustBadgeAlt(badge, numberLabel),
|
|
14589
14673
|
loading: "lazy",
|
|
14590
|
-
className: (0,
|
|
14674
|
+
className: (0, import_utils14.cn)("h-16 w-auto object-contain", logoClassName)
|
|
14591
14675
|
}
|
|
14592
14676
|
)
|
|
14593
|
-
) : /* @__PURE__ */ (0,
|
|
14677
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm font-medium", children: badge.name }),
|
|
14594
14678
|
caption
|
|
14595
14679
|
] });
|
|
14596
|
-
return /* @__PURE__ */ (0,
|
|
14680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("li", { "data-slot": "arbitration-badge", children: href ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("a", { href, target: "_blank", rel: "noopener noreferrer", className: "inline-flex", children: [
|
|
14597
14681
|
content,
|
|
14598
14682
|
" ",
|
|
14599
|
-
/* @__PURE__ */ (0,
|
|
14683
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "sr-only", children: newWindowLabel })
|
|
14600
14684
|
] }) : content }, badge.id);
|
|
14601
14685
|
})
|
|
14602
14686
|
}
|
|
@@ -14604,8 +14688,11 @@ function ArbitrationBadge({
|
|
|
14604
14688
|
}
|
|
14605
14689
|
|
|
14606
14690
|
// src/components/reviews.tsx
|
|
14607
|
-
var
|
|
14608
|
-
|
|
14691
|
+
var import_utils16 = require("@reblu/site-ui/utils");
|
|
14692
|
+
|
|
14693
|
+
// src/components/_review-card.tsx
|
|
14694
|
+
var import_utils15 = require("@reblu/site-ui/utils");
|
|
14695
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
14609
14696
|
function isHttps(value) {
|
|
14610
14697
|
if (typeof value !== "string") return false;
|
|
14611
14698
|
try {
|
|
@@ -14615,7 +14702,7 @@ function isHttps(value) {
|
|
|
14615
14702
|
return false;
|
|
14616
14703
|
}
|
|
14617
14704
|
}
|
|
14618
|
-
function
|
|
14705
|
+
function isUsableReview(value) {
|
|
14619
14706
|
if (typeof value !== "object" || value === null) return false;
|
|
14620
14707
|
const review = value;
|
|
14621
14708
|
return typeof review.id === "string" && typeof review.authorName === "string" && review.authorName.trim() !== "" && typeof review.rating === "number" && Number.isInteger(review.rating) && review.rating >= 1 && review.rating <= 5 && typeof review.sourceName === "string" && isHttps(review.sourceUrl);
|
|
@@ -14628,7 +14715,7 @@ function formatDay(day, locale) {
|
|
|
14628
14715
|
}
|
|
14629
14716
|
var STAR_PATH = "M12 2.5l2.9 5.9 6.5.9-4.7 4.6 1.1 6.5L12 17.3l-5.8 3.1 1.1-6.5L2.6 9.3l6.5-.9z";
|
|
14630
14717
|
function Stars({ rating }) {
|
|
14631
|
-
return /* @__PURE__ */ (0,
|
|
14718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { role: "img", "aria-label": `${rating} de 5 estrellas`, className: "flex gap-0.5", children: [1, 2, 3, 4, 5].map((n) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14632
14719
|
"svg",
|
|
14633
14720
|
{
|
|
14634
14721
|
"aria-hidden": "true",
|
|
@@ -14640,11 +14727,56 @@ function Stars({ rating }) {
|
|
|
14640
14727
|
stroke: "currentColor",
|
|
14641
14728
|
strokeWidth: "1.5",
|
|
14642
14729
|
strokeLinejoin: "round",
|
|
14643
|
-
children: /* @__PURE__ */ (0,
|
|
14730
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("path", { d: STAR_PATH })
|
|
14644
14731
|
},
|
|
14645
14732
|
n
|
|
14646
14733
|
)) });
|
|
14647
14734
|
}
|
|
14735
|
+
function usableReviews(reviews) {
|
|
14736
|
+
return Array.isArray(reviews) ? reviews.filter(isUsableReview) : [];
|
|
14737
|
+
}
|
|
14738
|
+
function ReviewCard({
|
|
14739
|
+
review,
|
|
14740
|
+
linkLabel,
|
|
14741
|
+
newWindowLabel,
|
|
14742
|
+
locale,
|
|
14743
|
+
className
|
|
14744
|
+
}) {
|
|
14745
|
+
const date = formatDay(review.reviewDate, locale);
|
|
14746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
14747
|
+
"article",
|
|
14748
|
+
{
|
|
14749
|
+
"data-slot": "review",
|
|
14750
|
+
"data-source": review.source,
|
|
14751
|
+
className: (0, import_utils15.cn)("flex h-full flex-col gap-3 rounded-lg border p-5", className),
|
|
14752
|
+
children: [
|
|
14753
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Stars, { rating: review.rating }),
|
|
14754
|
+
review.text && review.text.trim() !== "" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("blockquote", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: review.text }) }) : null,
|
|
14755
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("footer", { className: "mt-auto space-y-1 text-sm", children: [
|
|
14756
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "font-semibold", children: review.authorName }),
|
|
14757
|
+
date ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("time", { dateTime: review.reviewDate, className: "block text-muted-foreground", children: date }) : null,
|
|
14758
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
14759
|
+
"a",
|
|
14760
|
+
{
|
|
14761
|
+
href: review.sourceUrl,
|
|
14762
|
+
target: "_blank",
|
|
14763
|
+
rel: "noopener nofollow",
|
|
14764
|
+
className: "inline-flex underline underline-offset-4",
|
|
14765
|
+
children: [
|
|
14766
|
+
linkLabel(review.sourceName),
|
|
14767
|
+
" ",
|
|
14768
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "sr-only", children: newWindowLabel })
|
|
14769
|
+
]
|
|
14770
|
+
}
|
|
14771
|
+
)
|
|
14772
|
+
] })
|
|
14773
|
+
]
|
|
14774
|
+
}
|
|
14775
|
+
);
|
|
14776
|
+
}
|
|
14777
|
+
|
|
14778
|
+
// src/components/reviews.tsx
|
|
14779
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
14648
14780
|
function Reviews({
|
|
14649
14781
|
reviews,
|
|
14650
14782
|
heading,
|
|
@@ -14661,11 +14793,10 @@ function Reviews({
|
|
|
14661
14793
|
cardClassName,
|
|
14662
14794
|
noticeClassName
|
|
14663
14795
|
}) {
|
|
14664
|
-
|
|
14665
|
-
const usable = reviews.filter(isUsable2);
|
|
14796
|
+
const usable = usableReviews(reviews);
|
|
14666
14797
|
if (usable.length === 0) return null;
|
|
14667
14798
|
const hasNotice = notice !== void 0 && notice !== null && notice !== "";
|
|
14668
|
-
const noticeNode = hasNotice ? /* @__PURE__ */ (0,
|
|
14799
|
+
const noticeNode = hasNotice ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14669
14800
|
"p",
|
|
14670
14801
|
{
|
|
14671
14802
|
"data-slot": "reviews-notice",
|
|
@@ -14673,68 +14804,47 @@ function Reviews({
|
|
|
14673
14804
|
children: notice
|
|
14674
14805
|
}
|
|
14675
14806
|
) : null;
|
|
14676
|
-
const grid = /* @__PURE__ */ (0,
|
|
14807
|
+
const grid = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14677
14808
|
"ul",
|
|
14678
14809
|
{
|
|
14679
14810
|
"data-slot": "reviews-grid",
|
|
14680
14811
|
className: slotClassName("grid gap-6", "sm:grid-cols-2 lg:grid-cols-3", gridClassName),
|
|
14681
14812
|
children: usable.map((review) => {
|
|
14682
|
-
|
|
14683
|
-
|
|
14684
|
-
"article",
|
|
14813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14814
|
+
ReviewCard,
|
|
14685
14815
|
{
|
|
14686
|
-
|
|
14687
|
-
|
|
14688
|
-
|
|
14689
|
-
|
|
14690
|
-
|
|
14691
|
-
review.text && review.text.trim() !== "" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("blockquote", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { children: review.text }) }) : null,
|
|
14692
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("footer", { className: "mt-auto space-y-1 text-sm", children: [
|
|
14693
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "font-semibold", children: review.authorName }),
|
|
14694
|
-
date ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("time", { dateTime: review.reviewDate, className: "block text-muted-foreground", children: date }) : null,
|
|
14695
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
14696
|
-
"a",
|
|
14697
|
-
{
|
|
14698
|
-
href: review.sourceUrl,
|
|
14699
|
-
target: "_blank",
|
|
14700
|
-
rel: "noopener nofollow",
|
|
14701
|
-
className: "inline-flex underline underline-offset-4",
|
|
14702
|
-
children: [
|
|
14703
|
-
linkLabel(review.sourceName),
|
|
14704
|
-
" ",
|
|
14705
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "sr-only", children: newWindowLabel })
|
|
14706
|
-
]
|
|
14707
|
-
}
|
|
14708
|
-
)
|
|
14709
|
-
] })
|
|
14710
|
-
]
|
|
14816
|
+
review,
|
|
14817
|
+
linkLabel,
|
|
14818
|
+
newWindowLabel,
|
|
14819
|
+
locale,
|
|
14820
|
+
className: cardClassName
|
|
14711
14821
|
}
|
|
14712
14822
|
) }, review.id);
|
|
14713
14823
|
})
|
|
14714
14824
|
}
|
|
14715
14825
|
);
|
|
14716
|
-
const body3 = /* @__PURE__ */ (0,
|
|
14826
|
+
const body3 = /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
14717
14827
|
noticePosition === "above" ? noticeNode : null,
|
|
14718
14828
|
grid,
|
|
14719
14829
|
noticePosition === "below" ? noticeNode : null
|
|
14720
14830
|
] });
|
|
14721
14831
|
const hasHeading = heading !== void 0 && heading !== null && heading !== "";
|
|
14722
14832
|
if (!hasHeading) {
|
|
14723
|
-
return /* @__PURE__ */ (0,
|
|
14833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { "data-slot": "reviews", className: (0, import_utils16.cn)("space-y-4", className), children: body3 });
|
|
14724
14834
|
}
|
|
14725
14835
|
const Tag = `h${headingLevel}`;
|
|
14726
|
-
return /* @__PURE__ */ (0,
|
|
14727
|
-
/* @__PURE__ */ (0,
|
|
14836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("section", { "data-slot": "reviews", "aria-labelledby": headingId, className: (0, import_utils16.cn)("space-y-4", className), children: [
|
|
14837
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Tag, { id: headingId, className: slotClassName("", "text-xl font-semibold", headingClassName), children: heading }),
|
|
14728
14838
|
body3
|
|
14729
14839
|
] });
|
|
14730
14840
|
}
|
|
14731
14841
|
|
|
14732
14842
|
// src/components/page-blocks.tsx
|
|
14733
|
-
var
|
|
14843
|
+
var import_utils18 = require("@reblu/site-ui/utils");
|
|
14734
14844
|
var import_button_variants2 = require("@reblu/site-ui/button-variants");
|
|
14735
14845
|
|
|
14736
14846
|
// src/components/content-blocks.tsx
|
|
14737
|
-
var
|
|
14847
|
+
var import_utils17 = require("@reblu/site-ui/utils");
|
|
14738
14848
|
|
|
14739
14849
|
// src/components/_card-icons.ts
|
|
14740
14850
|
var CARD_ICON_NODES = {
|
|
@@ -14897,11 +15007,11 @@ var CARD_ICON_NODES = {
|
|
|
14897
15007
|
};
|
|
14898
15008
|
|
|
14899
15009
|
// src/components/content-blocks.tsx
|
|
14900
|
-
var
|
|
15010
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
14901
15011
|
var DEFAULT_BEFORE_AFTER_LABELS = Object.freeze({ before: "Antes", after: "Despu\xE9s" });
|
|
14902
15012
|
function PairImage({ url, alt, label }) {
|
|
14903
|
-
return /* @__PURE__ */ (0,
|
|
14904
|
-
/* @__PURE__ */ (0,
|
|
15013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("figure", { className: "space-y-2", children: [
|
|
15014
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "relative aspect-[4/3] w-full overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
14905
15015
|
"img",
|
|
14906
15016
|
{
|
|
14907
15017
|
src: url,
|
|
@@ -14911,7 +15021,7 @@ function PairImage({ url, alt, label }) {
|
|
|
14911
15021
|
className: "h-full w-full object-cover"
|
|
14912
15022
|
}
|
|
14913
15023
|
) }),
|
|
14914
|
-
/* @__PURE__ */ (0,
|
|
15024
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("figcaption", { className: "text-sm font-semibold", children: label })
|
|
14915
15025
|
] });
|
|
14916
15026
|
}
|
|
14917
15027
|
function BeforeAfterPairs({
|
|
@@ -14923,26 +15033,26 @@ function BeforeAfterPairs({
|
|
|
14923
15033
|
}) {
|
|
14924
15034
|
const visibleCaption = showCaption && caption && caption.trim() !== "" ? caption : null;
|
|
14925
15035
|
if (pairs.length === 0 && !visibleCaption) return null;
|
|
14926
|
-
return /* @__PURE__ */ (0,
|
|
14927
|
-
pairs.length > 0 && /* @__PURE__ */ (0,
|
|
15036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { "data-slot": "before-after", className: (0, import_utils17.cn)("space-y-4", className), children: [
|
|
15037
|
+
pairs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("ul", { className: "grid gap-6 lg:grid-cols-2", children: pairs.map((pair, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
14928
15038
|
"li",
|
|
14929
15039
|
{
|
|
14930
15040
|
"data-slot": "before-after-pair",
|
|
14931
15041
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
14932
15042
|
children: [
|
|
14933
|
-
/* @__PURE__ */ (0,
|
|
14934
|
-
/* @__PURE__ */ (0,
|
|
15043
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PairImage, { url: pair.beforeUrl, alt: pair.alt ?? "", label: labels.before }),
|
|
15044
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PairImage, { url: pair.afterUrl, alt: pair.alt ?? "", label: labels.after })
|
|
14935
15045
|
]
|
|
14936
15046
|
},
|
|
14937
15047
|
`${pair.beforeUrl}-${pair.afterUrl}-${i}`
|
|
14938
15048
|
)) }),
|
|
14939
|
-
visibleCaption && /* @__PURE__ */ (0,
|
|
15049
|
+
visibleCaption && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { "data-slot": "before-after-caption", className: "whitespace-pre-line text-sm opacity-80", children: visibleCaption })
|
|
14940
15050
|
] });
|
|
14941
15051
|
}
|
|
14942
15052
|
function ChipList({ items, className }) {
|
|
14943
15053
|
const visible = items.filter((item) => item.trim() !== "");
|
|
14944
15054
|
if (visible.length === 0) return null;
|
|
14945
|
-
return /* @__PURE__ */ (0,
|
|
15055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("ul", { "data-slot": "chip-list", className: (0, import_utils17.cn)("flex flex-wrap gap-3", className), children: visible.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
14946
15056
|
"li",
|
|
14947
15057
|
{
|
|
14948
15058
|
"data-slot": "chip",
|
|
@@ -14958,7 +15068,7 @@ function hasCardIcon(icon) {
|
|
|
14958
15068
|
}
|
|
14959
15069
|
function CardIconSvg({ icon, className }) {
|
|
14960
15070
|
if (!hasCardIcon(icon)) return null;
|
|
14961
|
-
return /* @__PURE__ */ (0,
|
|
15071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
14962
15072
|
"svg",
|
|
14963
15073
|
{
|
|
14964
15074
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -14971,30 +15081,30 @@ function CardIconSvg({ icon, className }) {
|
|
|
14971
15081
|
"aria-hidden": "true",
|
|
14972
15082
|
focusable: "false",
|
|
14973
15083
|
"data-icon": icon,
|
|
14974
|
-
className: (0,
|
|
14975
|
-
children: CARD_ICON_NODES[icon].map(([Tag, attrs], i) => /* @__PURE__ */ (0,
|
|
15084
|
+
className: (0, import_utils17.cn)("h-5 w-5", className),
|
|
15085
|
+
children: CARD_ICON_NODES[icon].map(([Tag, attrs], i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Tag, { ...attrs }, i))
|
|
14976
15086
|
}
|
|
14977
15087
|
);
|
|
14978
15088
|
}
|
|
14979
15089
|
function IconCardGrid({ items, intro, headingLevel = 3, className }) {
|
|
14980
15090
|
const hasIntro = !!intro && intro.trim() !== "";
|
|
14981
15091
|
if (items.length === 0 && !hasIntro) return null;
|
|
14982
|
-
return /* @__PURE__ */ (0,
|
|
14983
|
-
hasIntro && /* @__PURE__ */ (0,
|
|
14984
|
-
items.length > 0 && /* @__PURE__ */ (0,
|
|
15092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { "data-slot": "icon-cards", className: (0, import_utils17.cn)("space-y-6", className), children: [
|
|
15093
|
+
hasIntro && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "max-w-prose text-lg opacity-80", children: intro }),
|
|
15094
|
+
items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
14985
15095
|
"ul",
|
|
14986
15096
|
{
|
|
14987
15097
|
"data-slot": "icon-card-grid",
|
|
14988
15098
|
className: "grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3",
|
|
14989
|
-
children: items.map((item, i) => /* @__PURE__ */ (0,
|
|
15099
|
+
children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
14990
15100
|
"li",
|
|
14991
15101
|
{
|
|
14992
15102
|
"data-slot": "icon-card",
|
|
14993
15103
|
className: "space-y-3 rounded-xl border border-border bg-card p-6 text-card-foreground",
|
|
14994
15104
|
children: [
|
|
14995
|
-
hasCardIcon(item.icon) && /* @__PURE__ */ (0,
|
|
14996
|
-
/* @__PURE__ */ (0,
|
|
14997
|
-
item.text && /* @__PURE__ */ (0,
|
|
15105
|
+
hasCardIcon(item.icon) && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "inline-flex h-12 w-12 items-center justify-center rounded-xl bg-primary/10 text-primary", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardIconSvg, { icon: item.icon }) }),
|
|
15106
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Heading, { level: headingLevel, className: "text-lg font-semibold", children: item.title }),
|
|
15107
|
+
item.text && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-muted-foreground", children: item.text })
|
|
14998
15108
|
]
|
|
14999
15109
|
},
|
|
15000
15110
|
`${item.title}-${i}`
|
|
@@ -15020,19 +15130,19 @@ function ImageTextSplit({
|
|
|
15020
15130
|
const imageRight = imageSide === "right";
|
|
15021
15131
|
const hasKicker = !!kicker && kicker.trim() !== "";
|
|
15022
15132
|
const bodyOffset = heading ? headingLevel : headingLevel - 1;
|
|
15023
|
-
return /* @__PURE__ */ (0,
|
|
15133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
15024
15134
|
"div",
|
|
15025
15135
|
{
|
|
15026
15136
|
"data-slot": "image-text",
|
|
15027
15137
|
"data-image-side": imageRight ? "right" : "left",
|
|
15028
|
-
className: (0,
|
|
15138
|
+
className: (0, import_utils17.cn)("grid grid-cols-1 items-center gap-8 md:grid-cols-2", className),
|
|
15029
15139
|
children: [
|
|
15030
|
-
/* @__PURE__ */ (0,
|
|
15140
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15031
15141
|
"div",
|
|
15032
15142
|
{
|
|
15033
15143
|
"data-slot": "image-text-media",
|
|
15034
|
-
className: (0,
|
|
15035
|
-
children: /* @__PURE__ */ (0,
|
|
15144
|
+
className: (0, import_utils17.cn)(textFirst ? "order-2" : "order-1", imageRight ? "md:order-2" : "md:order-1"),
|
|
15145
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "relative aspect-[4/3] w-full overflow-hidden rounded-xl bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15036
15146
|
"img",
|
|
15037
15147
|
{
|
|
15038
15148
|
src: imageUrl,
|
|
@@ -15044,21 +15154,21 @@ function ImageTextSplit({
|
|
|
15044
15154
|
) })
|
|
15045
15155
|
}
|
|
15046
15156
|
),
|
|
15047
|
-
/* @__PURE__ */ (0,
|
|
15157
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
15048
15158
|
"div",
|
|
15049
15159
|
{
|
|
15050
15160
|
"data-slot": "image-text-body",
|
|
15051
|
-
className: (0,
|
|
15161
|
+
className: (0, import_utils17.cn)(
|
|
15052
15162
|
"space-y-4",
|
|
15053
15163
|
textFirst ? "order-1" : "order-2",
|
|
15054
15164
|
imageRight ? "md:order-1" : "md:order-2"
|
|
15055
15165
|
),
|
|
15056
15166
|
children: [
|
|
15057
|
-
(hasKicker || heading) && /* @__PURE__ */ (0,
|
|
15058
|
-
hasKicker && /* @__PURE__ */ (0,
|
|
15059
|
-
heading && /* @__PURE__ */ (0,
|
|
15167
|
+
(hasKicker || heading) && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "space-y-2", children: [
|
|
15168
|
+
hasKicker && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { "data-slot": "page-block-kicker", className: KICKER_CLASS_NAME, children: kicker }),
|
|
15169
|
+
heading && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Heading, { level: headingLevel, className: "text-2xl font-bold tracking-tight", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { id: headingId, children: heading }) })
|
|
15060
15170
|
] }),
|
|
15061
|
-
html5 && /* @__PURE__ */ (0,
|
|
15171
|
+
html5 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SafeHtml, { html: sanitizeHtml(html5), headingOffset: bodyOffset })
|
|
15062
15172
|
]
|
|
15063
15173
|
}
|
|
15064
15174
|
)
|
|
@@ -15068,38 +15178,38 @@ function ImageTextSplit({
|
|
|
15068
15178
|
}
|
|
15069
15179
|
|
|
15070
15180
|
// src/components/page-blocks.tsx
|
|
15071
|
-
var
|
|
15181
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
15072
15182
|
var ALIASES = {
|
|
15073
15183
|
doctor_embed: "profile_embed",
|
|
15074
15184
|
specialty_embed: "page_embed"
|
|
15075
15185
|
};
|
|
15076
15186
|
function HeroBlock({ block, headingLevel }) {
|
|
15077
15187
|
const { title, subtitle, imageUrl } = block.data;
|
|
15078
|
-
return /* @__PURE__ */ (0,
|
|
15079
|
-
/* @__PURE__ */ (0,
|
|
15080
|
-
subtitle && /* @__PURE__ */ (0,
|
|
15081
|
-
imageUrl && /* @__PURE__ */ (0,
|
|
15188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "space-y-4", children: [
|
|
15189
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Heading, { level: headingLevel, className: "text-3xl font-bold tracking-tight md:text-4xl", children: title }),
|
|
15190
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-lg opacity-80", children: subtitle }),
|
|
15191
|
+
imageUrl && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "relative aspect-[21/9] w-full overflow-hidden rounded-xl bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("img", { src: imageUrl, alt: "", loading: "lazy", className: "h-full w-full object-cover" }) })
|
|
15082
15192
|
] });
|
|
15083
15193
|
}
|
|
15084
15194
|
function RichtextBlock({ block, headingLevel }) {
|
|
15085
|
-
return /* @__PURE__ */ (0,
|
|
15195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SafeHtml, { html: sanitizeHtml(block.data.html), headingOffset: headingLevel - 1 });
|
|
15086
15196
|
}
|
|
15087
15197
|
function FaqBlock({ block }) {
|
|
15088
|
-
return /* @__PURE__ */ (0,
|
|
15198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FaqAccordion, { items: block.data.items });
|
|
15089
15199
|
}
|
|
15090
15200
|
function StatsBlock({ block }) {
|
|
15091
|
-
return /* @__PURE__ */ (0,
|
|
15092
|
-
/* @__PURE__ */ (0,
|
|
15093
|
-
/* @__PURE__ */ (0,
|
|
15201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("dl", { className: "grid gap-6 sm:grid-cols-2 lg:grid-cols-4", children: block.data.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-col-reverse gap-1", children: [
|
|
15202
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("dt", { className: "text-sm opacity-80", children: item.label }),
|
|
15203
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("dd", { className: "text-3xl font-bold", children: item.value })
|
|
15094
15204
|
] }, i)) });
|
|
15095
15205
|
}
|
|
15096
15206
|
function TestimonialBlock({ block }) {
|
|
15097
15207
|
const { quote, author, role, avatarUrl } = block.data;
|
|
15098
|
-
return /* @__PURE__ */ (0,
|
|
15099
|
-
/* @__PURE__ */ (0,
|
|
15100
|
-
/* @__PURE__ */ (0,
|
|
15208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("figure", { className: "space-y-4", children: [
|
|
15209
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("blockquote", { className: "text-xl italic", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { children: quote }) }),
|
|
15210
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("figcaption", { className: "flex items-center gap-3", children: [
|
|
15101
15211
|
avatarUrl && // eslint-disable-next-line @next/next/no-img-element
|
|
15102
|
-
/* @__PURE__ */ (0,
|
|
15212
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15103
15213
|
"img",
|
|
15104
15214
|
{
|
|
15105
15215
|
src: avatarUrl,
|
|
@@ -15108,9 +15218,9 @@ function TestimonialBlock({ block }) {
|
|
|
15108
15218
|
className: "h-10 w-10 rounded-full object-cover"
|
|
15109
15219
|
}
|
|
15110
15220
|
),
|
|
15111
|
-
/* @__PURE__ */ (0,
|
|
15112
|
-
/* @__PURE__ */ (0,
|
|
15113
|
-
role && /* @__PURE__ */ (0,
|
|
15221
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { children: [
|
|
15222
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "font-semibold", children: author }),
|
|
15223
|
+
role && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "block text-sm opacity-80", children: role })
|
|
15114
15224
|
] })
|
|
15115
15225
|
] })
|
|
15116
15226
|
] });
|
|
@@ -15119,19 +15229,19 @@ function CtaSlotBlock(_props) {
|
|
|
15119
15229
|
return null;
|
|
15120
15230
|
}
|
|
15121
15231
|
function FeatureListBlock({ block }) {
|
|
15122
|
-
return /* @__PURE__ */ (0,
|
|
15232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("ul", { className: "grid list-disc gap-2 pl-5 sm:grid-cols-2", children: block.data.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("li", { children: item.text }, i)) });
|
|
15123
15233
|
}
|
|
15124
15234
|
function GalleryBlock({ block }) {
|
|
15125
15235
|
const { images } = block.data;
|
|
15126
|
-
return /* @__PURE__ */ (0,
|
|
15236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15127
15237
|
"div",
|
|
15128
15238
|
{
|
|
15129
|
-
className: (0,
|
|
15239
|
+
className: (0, import_utils18.cn)(
|
|
15130
15240
|
"grid gap-4",
|
|
15131
15241
|
images.length > 1 ? "sm:grid-cols-2 lg:grid-cols-3" : "grid-cols-1"
|
|
15132
15242
|
),
|
|
15133
|
-
children: images.map((img, i) => /* @__PURE__ */ (0,
|
|
15134
|
-
/* @__PURE__ */ (0,
|
|
15243
|
+
children: images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("figure", { className: "space-y-1", children: [
|
|
15244
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "relative aspect-video w-full overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15135
15245
|
"img",
|
|
15136
15246
|
{
|
|
15137
15247
|
src: img.url,
|
|
@@ -15140,7 +15250,7 @@ function GalleryBlock({ block }) {
|
|
|
15140
15250
|
className: "h-full w-full object-cover"
|
|
15141
15251
|
}
|
|
15142
15252
|
) }),
|
|
15143
|
-
img.caption && /* @__PURE__ */ (0,
|
|
15253
|
+
img.caption && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("figcaption", { className: "text-sm opacity-80", children: img.caption })
|
|
15144
15254
|
] }, `${img.url}-${i}`))
|
|
15145
15255
|
}
|
|
15146
15256
|
);
|
|
@@ -15150,13 +15260,13 @@ function EmbedCard({
|
|
|
15150
15260
|
headingLevel,
|
|
15151
15261
|
embedHref
|
|
15152
15262
|
}) {
|
|
15153
|
-
return /* @__PURE__ */ (0,
|
|
15263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
15154
15264
|
"a",
|
|
15155
15265
|
{
|
|
15156
15266
|
href: embedHref(resolved),
|
|
15157
15267
|
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",
|
|
15158
15268
|
children: [
|
|
15159
|
-
resolved.coverImageUrl && /* @__PURE__ */ (0,
|
|
15269
|
+
resolved.coverImageUrl && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "aspect-video w-full overflow-hidden bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15160
15270
|
"img",
|
|
15161
15271
|
{
|
|
15162
15272
|
src: resolved.coverImageUrl,
|
|
@@ -15165,35 +15275,35 @@ function EmbedCard({
|
|
|
15165
15275
|
className: "h-full w-full object-cover"
|
|
15166
15276
|
}
|
|
15167
15277
|
) }),
|
|
15168
|
-
/* @__PURE__ */ (0,
|
|
15169
|
-
/* @__PURE__ */ (0,
|
|
15170
|
-
resolved.role && /* @__PURE__ */ (0,
|
|
15171
|
-
resolved.excerpt && /* @__PURE__ */ (0,
|
|
15278
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "space-y-1 p-4", children: [
|
|
15279
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Heading, { level: headingLevel, className: "text-lg font-semibold", children: resolved.title }),
|
|
15280
|
+
resolved.role && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-sm text-muted-foreground", children: resolved.role }),
|
|
15281
|
+
resolved.excerpt && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-muted-foreground", children: resolved.excerpt })
|
|
15172
15282
|
] })
|
|
15173
15283
|
]
|
|
15174
15284
|
}
|
|
15175
15285
|
);
|
|
15176
15286
|
}
|
|
15177
15287
|
function PageEmbedBlock({ block, headingLevel, embedHref }) {
|
|
15178
|
-
return /* @__PURE__ */ (0,
|
|
15288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
|
|
15179
15289
|
}
|
|
15180
15290
|
function ProfileEmbedBlock({
|
|
15181
15291
|
block,
|
|
15182
15292
|
headingLevel,
|
|
15183
15293
|
embedHref
|
|
15184
15294
|
}) {
|
|
15185
|
-
return /* @__PURE__ */ (0,
|
|
15295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
|
|
15186
15296
|
}
|
|
15187
15297
|
function BeforeAfterBlock({ block }) {
|
|
15188
15298
|
const { pairs, showCaption, caption } = block.data;
|
|
15189
|
-
return /* @__PURE__ */ (0,
|
|
15299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(BeforeAfterPairs, { pairs, showCaption, caption });
|
|
15190
15300
|
}
|
|
15191
15301
|
function ChipsBlock({ block }) {
|
|
15192
|
-
return /* @__PURE__ */ (0,
|
|
15302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ChipList, { items: block.data.items });
|
|
15193
15303
|
}
|
|
15194
15304
|
function ImageTextBlock({ block, headingLevel, headingId }) {
|
|
15195
15305
|
const { kicker, imageUrl, alt, imageSide, mobileOrder, html: html5 } = block.data;
|
|
15196
|
-
return /* @__PURE__ */ (0,
|
|
15306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15197
15307
|
ImageTextSplit,
|
|
15198
15308
|
{
|
|
15199
15309
|
imageUrl,
|
|
@@ -15209,7 +15319,17 @@ function ImageTextBlock({ block, headingLevel, headingId }) {
|
|
|
15209
15319
|
);
|
|
15210
15320
|
}
|
|
15211
15321
|
function IconCardsBlock({ block, headingLevel }) {
|
|
15212
|
-
return /* @__PURE__ */ (0,
|
|
15322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(IconCardGrid, { items: block.data.items, intro: block.data.intro, headingLevel });
|
|
15323
|
+
}
|
|
15324
|
+
function ReviewsBlock({ block }) {
|
|
15325
|
+
const { layout, notice } = block.data;
|
|
15326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { "data-slot": "reviews-block", "data-reviews-layout": layout ?? "grid", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15327
|
+
Reviews,
|
|
15328
|
+
{
|
|
15329
|
+
reviews: block.reviews,
|
|
15330
|
+
notice: notice && notice.trim() !== "" ? notice : void 0
|
|
15331
|
+
}
|
|
15332
|
+
) });
|
|
15213
15333
|
}
|
|
15214
15334
|
var DEFAULT_RENDERERS = {
|
|
15215
15335
|
hero: HeroBlock,
|
|
@@ -15225,7 +15345,8 @@ var DEFAULT_RENDERERS = {
|
|
|
15225
15345
|
before_after: BeforeAfterBlock,
|
|
15226
15346
|
chips: ChipsBlock,
|
|
15227
15347
|
icon_cards: IconCardsBlock,
|
|
15228
|
-
image_text: ImageTextBlock
|
|
15348
|
+
image_text: ImageTextBlock,
|
|
15349
|
+
reviews: ReviewsBlock
|
|
15229
15350
|
};
|
|
15230
15351
|
var KICKER_TYPES = /* @__PURE__ */ new Set([
|
|
15231
15352
|
"before_after",
|
|
@@ -15283,14 +15404,14 @@ function toIdFragment(value) {
|
|
|
15283
15404
|
function SectionCta2({ cta }) {
|
|
15284
15405
|
if (!hasUsableCta(cta)) return null;
|
|
15285
15406
|
const variant = toButtonVariant(cta.variant);
|
|
15286
|
-
return /* @__PURE__ */ (0,
|
|
15407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15287
15408
|
"a",
|
|
15288
15409
|
{
|
|
15289
15410
|
href: cta.url,
|
|
15290
15411
|
"data-slot": "button",
|
|
15291
15412
|
"data-variant": variant,
|
|
15292
15413
|
"data-size": "default",
|
|
15293
|
-
className: (0,
|
|
15414
|
+
className: (0, import_utils18.cn)((0, import_button_variants2.buttonVariants)({ variant, size: "default" })),
|
|
15294
15415
|
...cta.isExternal ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
15295
15416
|
children: cta.label
|
|
15296
15417
|
}
|
|
@@ -15311,6 +15432,8 @@ function PageBlocks({
|
|
|
15311
15432
|
const type = canonicalTypeOf(block.blockType);
|
|
15312
15433
|
if (type === null) return [];
|
|
15313
15434
|
if (EMBED_TYPES.has(type) && !block.resolved) return [];
|
|
15435
|
+
if (type === "reviews" && (!Array.isArray(block.reviews) || block.reviews.length === 0))
|
|
15436
|
+
return [];
|
|
15314
15437
|
if (type === "cta" && !components?.cta && !block.heading && !hasUsableCta(block.cta)) return [];
|
|
15315
15438
|
const Renderer = components?.[type] ?? DEFAULT_RENDERERS[type];
|
|
15316
15439
|
const headingId = block.heading ? `${safePrefix}-${toIdFragment(block.id)}-heading` : void 0;
|
|
@@ -15318,18 +15441,18 @@ function PageBlocks({
|
|
|
15318
15441
|
const kicker = kickerOf(type, block);
|
|
15319
15442
|
const ownsHeading = OWN_HEADING_TYPES.has(type);
|
|
15320
15443
|
return [
|
|
15321
|
-
/* @__PURE__ */ (0,
|
|
15444
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
15322
15445
|
"section",
|
|
15323
15446
|
{
|
|
15324
15447
|
"data-slot": "page-block",
|
|
15325
15448
|
"data-block-type": type,
|
|
15326
15449
|
"aria-labelledby": headingId,
|
|
15327
15450
|
style: surfaceStyle(background),
|
|
15328
|
-
className: (0,
|
|
15451
|
+
className: (0, import_utils18.cn)("space-y-6", background && "rounded-xl px-6 py-10", sectionClassName),
|
|
15329
15452
|
children: [
|
|
15330
|
-
kicker && /* @__PURE__ */ (0,
|
|
15331
|
-
block.heading && !ownsHeading && /* @__PURE__ */ (0,
|
|
15332
|
-
ownsHeading ? /* @__PURE__ */ (0,
|
|
15453
|
+
kicker && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { "data-slot": "page-block-kicker", className: (0, import_utils18.cn)("-mb-4", KICKER_CLASS_NAME), children: kicker }),
|
|
15454
|
+
block.heading && !ownsHeading && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Heading, { level: headingLevel, className: "text-2xl font-bold tracking-tight", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { id: headingId, children: block.heading }) }),
|
|
15455
|
+
ownsHeading ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15333
15456
|
Renderer,
|
|
15334
15457
|
{
|
|
15335
15458
|
block,
|
|
@@ -15337,7 +15460,7 @@ function PageBlocks({
|
|
|
15337
15460
|
embedHref,
|
|
15338
15461
|
headingId
|
|
15339
15462
|
}
|
|
15340
|
-
) : /* @__PURE__ */ (0,
|
|
15463
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15341
15464
|
Renderer,
|
|
15342
15465
|
{
|
|
15343
15466
|
block,
|
|
@@ -15345,7 +15468,7 @@ function PageBlocks({
|
|
|
15345
15468
|
embedHref
|
|
15346
15469
|
}
|
|
15347
15470
|
),
|
|
15348
|
-
/* @__PURE__ */ (0,
|
|
15471
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SectionCta2, { cta: block.cta })
|
|
15349
15472
|
]
|
|
15350
15473
|
},
|
|
15351
15474
|
block.id
|
|
@@ -15353,12 +15476,12 @@ function PageBlocks({
|
|
|
15353
15476
|
];
|
|
15354
15477
|
});
|
|
15355
15478
|
if (sections.length === 0) return null;
|
|
15356
|
-
return /* @__PURE__ */ (0,
|
|
15479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: (0, import_utils18.cn)("space-y-12", className), "data-slot": "page-blocks", children: sections });
|
|
15357
15480
|
}
|
|
15358
15481
|
|
|
15359
15482
|
// src/components/shop-filters.tsx
|
|
15360
|
-
var
|
|
15361
|
-
var
|
|
15483
|
+
var import_utils19 = require("@reblu/site-ui/utils");
|
|
15484
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
15362
15485
|
var DEFAULT_SHOP_PRICE_BANDS = [
|
|
15363
15486
|
{ max: 2500 },
|
|
15364
15487
|
{ min: 2500, max: 5e3 },
|
|
@@ -15402,7 +15525,7 @@ function priceBandLabel(band, t, currencyCode, locale) {
|
|
|
15402
15525
|
return "";
|
|
15403
15526
|
}
|
|
15404
15527
|
function OptionLink({ href, active, label, onActivate }) {
|
|
15405
|
-
return /* @__PURE__ */ (0,
|
|
15528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15406
15529
|
"a",
|
|
15407
15530
|
{
|
|
15408
15531
|
href,
|
|
@@ -15411,7 +15534,7 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
15411
15534
|
event.preventDefault();
|
|
15412
15535
|
onActivate();
|
|
15413
15536
|
} : void 0,
|
|
15414
|
-
className: (0,
|
|
15537
|
+
className: (0, import_utils19.cn)(
|
|
15415
15538
|
"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",
|
|
15416
15539
|
active ? "border-transparent bg-primary text-primary-foreground" : "border-border text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
15417
15540
|
),
|
|
@@ -15420,9 +15543,9 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
15420
15543
|
);
|
|
15421
15544
|
}
|
|
15422
15545
|
function FilterFieldset({ legend, children: children2 }) {
|
|
15423
|
-
return /* @__PURE__ */ (0,
|
|
15424
|
-
/* @__PURE__ */ (0,
|
|
15425
|
-
/* @__PURE__ */ (0,
|
|
15546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("fieldset", { className: "space-y-2", children: [
|
|
15547
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("legend", { className: "text-sm font-medium text-foreground", children: legend }),
|
|
15548
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex flex-wrap gap-2", children: children2 })
|
|
15426
15549
|
] });
|
|
15427
15550
|
}
|
|
15428
15551
|
function ShopFilters({
|
|
@@ -15445,11 +15568,11 @@ function ShopFilters({
|
|
|
15445
15568
|
if (!shouldRenderShopFilters(facets, active)) {
|
|
15446
15569
|
return null;
|
|
15447
15570
|
}
|
|
15448
|
-
return /* @__PURE__ */ (0,
|
|
15571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: (0, import_utils19.cn)("space-y-6", className), "data-slot": "shop-filters", children: [
|
|
15449
15572
|
visibleTaxonomies.map((axis) => {
|
|
15450
15573
|
const activeSlug = active.taxonomy?.[axis.key];
|
|
15451
|
-
return /* @__PURE__ */ (0,
|
|
15452
|
-
/* @__PURE__ */ (0,
|
|
15574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(FilterFieldset, { legend: axis.label, children: [
|
|
15575
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15453
15576
|
OptionLink,
|
|
15454
15577
|
{
|
|
15455
15578
|
href: hrefs.taxonomy(axis.key, void 0),
|
|
@@ -15464,7 +15587,7 @@ function ShopFilters({
|
|
|
15464
15587
|
),
|
|
15465
15588
|
axis.terms.map((term) => {
|
|
15466
15589
|
const isActive = activeSlug === term.slug;
|
|
15467
|
-
return /* @__PURE__ */ (0,
|
|
15590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15468
15591
|
OptionLink,
|
|
15469
15592
|
{
|
|
15470
15593
|
href: hrefs.taxonomy(axis.key, isActive ? void 0 : term.slug),
|
|
@@ -15484,9 +15607,9 @@ function ShopFilters({
|
|
|
15484
15607
|
}),
|
|
15485
15608
|
visibleAttributes.map((attr) => {
|
|
15486
15609
|
const activeValues = toValueArray(active.attr?.[attr.key]);
|
|
15487
|
-
return /* @__PURE__ */ (0,
|
|
15610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FilterFieldset, { legend: attr.label, children: attr.options.map((opt) => {
|
|
15488
15611
|
const isActive = activeValues.includes(opt.value);
|
|
15489
|
-
return /* @__PURE__ */ (0,
|
|
15612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15490
15613
|
OptionLink,
|
|
15491
15614
|
{
|
|
15492
15615
|
href: hrefs.attr(attr.key, opt.value),
|
|
@@ -15504,11 +15627,11 @@ function ShopFilters({
|
|
|
15504
15627
|
);
|
|
15505
15628
|
}) }, attr.key);
|
|
15506
15629
|
}),
|
|
15507
|
-
showPriceGroup && /* @__PURE__ */ (0,
|
|
15630
|
+
showPriceGroup && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FilterFieldset, { legend: t.price, children: priceBands.map((band, i) => {
|
|
15508
15631
|
const isActive = active.priceMin === band.min && active.priceMax === band.max;
|
|
15509
15632
|
const nextMin = isActive ? void 0 : band.min;
|
|
15510
15633
|
const nextMax = isActive ? void 0 : band.max;
|
|
15511
|
-
return /* @__PURE__ */ (0,
|
|
15634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15512
15635
|
OptionLink,
|
|
15513
15636
|
{
|
|
15514
15637
|
href: hrefs.price(nextMin, nextMax),
|
|
@@ -15519,7 +15642,7 @@ function ShopFilters({
|
|
|
15519
15642
|
i
|
|
15520
15643
|
);
|
|
15521
15644
|
}) }),
|
|
15522
|
-
hasOnSale && /* @__PURE__ */ (0,
|
|
15645
|
+
hasOnSale && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15523
15646
|
OptionLink,
|
|
15524
15647
|
{
|
|
15525
15648
|
href: hrefs.onSale(!active.onSale),
|
|
@@ -15528,7 +15651,7 @@ function ShopFilters({
|
|
|
15528
15651
|
onActivate: onChange ? () => onChange({ onSale: !active.onSale }) : void 0
|
|
15529
15652
|
}
|
|
15530
15653
|
),
|
|
15531
|
-
/* @__PURE__ */ (0,
|
|
15654
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15532
15655
|
"a",
|
|
15533
15656
|
{
|
|
15534
15657
|
href: hrefs.clearAll(),
|
|
@@ -15544,8 +15667,8 @@ function ShopFilters({
|
|
|
15544
15667
|
}
|
|
15545
15668
|
|
|
15546
15669
|
// src/components/course-catalog-filters.tsx
|
|
15547
|
-
var
|
|
15548
|
-
var
|
|
15670
|
+
var import_utils20 = require("@reblu/site-ui/utils");
|
|
15671
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
15549
15672
|
var DEFAULT_COURSE_PRICE_BANDS = [
|
|
15550
15673
|
{ max: 5e3 },
|
|
15551
15674
|
{ min: 5e3, max: 15e3 },
|
|
@@ -15598,9 +15721,9 @@ function CourseCatalogFilters({
|
|
|
15598
15721
|
const showPrice = enabled.price !== false;
|
|
15599
15722
|
const isFree = Boolean(active.free);
|
|
15600
15723
|
if (!showCategories && !showInstructors && !showPrice) return null;
|
|
15601
|
-
return /* @__PURE__ */ (0,
|
|
15602
|
-
showCategories && /* @__PURE__ */ (0,
|
|
15603
|
-
/* @__PURE__ */ (0,
|
|
15724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: (0, import_utils20.cn)("space-y-6", className), "data-slot": "course-catalog-filters", children: [
|
|
15725
|
+
showCategories && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(FilterFieldset, { legend: t.category, children: [
|
|
15726
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15604
15727
|
OptionLink,
|
|
15605
15728
|
{
|
|
15606
15729
|
href: categoryHref(void 0),
|
|
@@ -15612,7 +15735,7 @@ function CourseCatalogFilters({
|
|
|
15612
15735
|
sortedCategories.map((category) => {
|
|
15613
15736
|
const isActive = active.category === category.slug;
|
|
15614
15737
|
const next2 = isActive ? void 0 : category.slug;
|
|
15615
|
-
return /* @__PURE__ */ (0,
|
|
15738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15616
15739
|
OptionLink,
|
|
15617
15740
|
{
|
|
15618
15741
|
href: categoryHref(next2),
|
|
@@ -15624,8 +15747,8 @@ function CourseCatalogFilters({
|
|
|
15624
15747
|
);
|
|
15625
15748
|
})
|
|
15626
15749
|
] }),
|
|
15627
|
-
showInstructors && /* @__PURE__ */ (0,
|
|
15628
|
-
/* @__PURE__ */ (0,
|
|
15750
|
+
showInstructors && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(FilterFieldset, { legend: t.instructor, children: [
|
|
15751
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15629
15752
|
OptionLink,
|
|
15630
15753
|
{
|
|
15631
15754
|
href: hrefs.instructor(void 0),
|
|
@@ -15637,7 +15760,7 @@ function CourseCatalogFilters({
|
|
|
15637
15760
|
named.map((instructor) => {
|
|
15638
15761
|
const isActive = active.instructor === instructor.id;
|
|
15639
15762
|
const next2 = isActive ? void 0 : instructor.id;
|
|
15640
|
-
return /* @__PURE__ */ (0,
|
|
15763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15641
15764
|
OptionLink,
|
|
15642
15765
|
{
|
|
15643
15766
|
href: hrefs.instructor(next2),
|
|
@@ -15649,8 +15772,8 @@ function CourseCatalogFilters({
|
|
|
15649
15772
|
);
|
|
15650
15773
|
})
|
|
15651
15774
|
] }),
|
|
15652
|
-
showPrice && /* @__PURE__ */ (0,
|
|
15653
|
-
/* @__PURE__ */ (0,
|
|
15775
|
+
showPrice && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(FilterFieldset, { legend: t.price, children: [
|
|
15776
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15654
15777
|
OptionLink,
|
|
15655
15778
|
{
|
|
15656
15779
|
href: hrefs.free(!isFree),
|
|
@@ -15665,7 +15788,7 @@ function CourseCatalogFilters({
|
|
|
15665
15788
|
const isActive = !isFree && active.priceMin === band.min && active.priceMax === band.max;
|
|
15666
15789
|
const nextMin = isActive ? void 0 : band.min;
|
|
15667
15790
|
const nextMax = isActive ? void 0 : band.max;
|
|
15668
|
-
return /* @__PURE__ */ (0,
|
|
15791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15669
15792
|
OptionLink,
|
|
15670
15793
|
{
|
|
15671
15794
|
href: hrefs.price(nextMin, nextMax),
|
|
@@ -15677,7 +15800,7 @@ function CourseCatalogFilters({
|
|
|
15677
15800
|
);
|
|
15678
15801
|
})
|
|
15679
15802
|
] }),
|
|
15680
|
-
/* @__PURE__ */ (0,
|
|
15803
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15681
15804
|
"a",
|
|
15682
15805
|
{
|
|
15683
15806
|
href: hrefs.clearAll(),
|
|
@@ -15699,8 +15822,8 @@ function CourseCatalogFilters({
|
|
|
15699
15822
|
}
|
|
15700
15823
|
|
|
15701
15824
|
// src/components/cart-line-list.tsx
|
|
15702
|
-
var
|
|
15703
|
-
var
|
|
15825
|
+
var import_utils21 = require("@reblu/site-ui/utils");
|
|
15826
|
+
var import_jsx_runtime25 = (
|
|
15704
15827
|
// eslint-disable-next-line react/no-array-index-key -- entries are positional, SITE-built rows
|
|
15705
15828
|
require("react/jsx-runtime")
|
|
15706
15829
|
);
|
|
@@ -15716,17 +15839,17 @@ var DEFAULT_LABELS2 = {
|
|
|
15716
15839
|
function CartLineIncludes({ entries, note, className }) {
|
|
15717
15840
|
const hasNote = note != null && note !== false && note !== "";
|
|
15718
15841
|
if (entries.length === 0 && !hasNote) return null;
|
|
15719
|
-
return /* @__PURE__ */ (0,
|
|
15842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
15720
15843
|
"div",
|
|
15721
15844
|
{
|
|
15722
|
-
className: (0,
|
|
15845
|
+
className: (0, import_utils21.cn)("mt-2 space-y-2 rounded-lg bg-muted px-4 py-3 text-sm", className),
|
|
15723
15846
|
"data-slot": "cart-line-includes",
|
|
15724
15847
|
children: [
|
|
15725
|
-
entries.length > 0 && /* @__PURE__ */ (0,
|
|
15726
|
-
/* @__PURE__ */ (0,
|
|
15727
|
-
/* @__PURE__ */ (0,
|
|
15848
|
+
entries.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("dl", { className: "grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1.5", children: entries.map((entry, idx) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "contents", children: [
|
|
15849
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("dt", { className: "font-semibold text-muted-foreground", children: entry.label }),
|
|
15850
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("dd", { className: "m-0", children: entry.value })
|
|
15728
15851
|
] }, idx)) }),
|
|
15729
|
-
hasNote && /* @__PURE__ */ (0,
|
|
15852
|
+
hasNote && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-muted-foreground", children: note })
|
|
15730
15853
|
]
|
|
15731
15854
|
}
|
|
15732
15855
|
);
|
|
@@ -15755,9 +15878,9 @@ function CartLineList({
|
|
|
15755
15878
|
}) {
|
|
15756
15879
|
const t = { ...DEFAULT_LABELS2, ...labels };
|
|
15757
15880
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
15758
|
-
return /* @__PURE__ */ (0,
|
|
15759
|
-
/* @__PURE__ */ (0,
|
|
15760
|
-
noticeContent != null && noticeContent !== false && /* @__PURE__ */ (0,
|
|
15881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: (0, import_utils21.cn)("space-y-4", className), "data-slot": "cart-line-list", children: [
|
|
15882
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { "aria-live": "polite", className: "sr-only", children: liveMessage }),
|
|
15883
|
+
noticeContent != null && noticeContent !== false && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
15761
15884
|
"div",
|
|
15762
15885
|
{
|
|
15763
15886
|
role: "status",
|
|
@@ -15766,34 +15889,34 @@ function CartLineList({
|
|
|
15766
15889
|
children: noticeContent
|
|
15767
15890
|
}
|
|
15768
15891
|
),
|
|
15769
|
-
/* @__PURE__ */ (0,
|
|
15892
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("ul", { className: "space-y-4", children: items.map((item) => {
|
|
15770
15893
|
const maxQty = item.maxStock ?? Infinity;
|
|
15771
15894
|
const atMax = item.quantity >= maxQty;
|
|
15772
15895
|
const atMin = item.quantity <= 1;
|
|
15773
15896
|
const message = lineMessage?.(item);
|
|
15774
15897
|
const includes = lineIncludes?.(item);
|
|
15775
|
-
return /* @__PURE__ */ (0,
|
|
15898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
15776
15899
|
"li",
|
|
15777
15900
|
{
|
|
15778
15901
|
className: "flex gap-4 rounded-xl border border-border bg-card p-4",
|
|
15779
15902
|
children: [
|
|
15780
|
-
/* @__PURE__ */ (0,
|
|
15781
|
-
/* @__PURE__ */ (0,
|
|
15782
|
-
/* @__PURE__ */ (0,
|
|
15783
|
-
item.variantName && /* @__PURE__ */ (0,
|
|
15784
|
-
/* @__PURE__ */ (0,
|
|
15903
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "h-20 w-20 flex-shrink-0 overflow-hidden rounded-lg bg-muted", children: item.imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("img", { src: item.imageUrl, alt: item.name, className: "h-full w-full object-cover" }) : null }),
|
|
15904
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
15905
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "truncate text-sm font-semibold leading-tight", children: item.name }),
|
|
15906
|
+
item.variantName && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "mt-0.5 text-xs text-muted-foreground", children: item.variantName }),
|
|
15907
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("p", { className: "mt-1 text-sm text-muted-foreground", children: [
|
|
15785
15908
|
formatPrice(item.unitPrice, currencyCode, locale),
|
|
15786
15909
|
" ",
|
|
15787
15910
|
t.unitPriceSuffix
|
|
15788
15911
|
] }),
|
|
15789
|
-
/* @__PURE__ */ (0,
|
|
15912
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
15790
15913
|
"div",
|
|
15791
15914
|
{
|
|
15792
15915
|
role: "group",
|
|
15793
15916
|
"aria-label": t.quantityLabel,
|
|
15794
15917
|
className: "mt-3 flex items-center gap-3",
|
|
15795
15918
|
children: [
|
|
15796
|
-
/* @__PURE__ */ (0,
|
|
15919
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
15797
15920
|
"button",
|
|
15798
15921
|
{
|
|
15799
15922
|
type: "button",
|
|
@@ -15804,8 +15927,8 @@ function CartLineList({
|
|
|
15804
15927
|
children: "\u2212"
|
|
15805
15928
|
}
|
|
15806
15929
|
),
|
|
15807
|
-
/* @__PURE__ */ (0,
|
|
15808
|
-
/* @__PURE__ */ (0,
|
|
15930
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "w-8 text-center text-sm font-semibold tabular-nums", children: item.quantity }),
|
|
15931
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
15809
15932
|
"button",
|
|
15810
15933
|
{
|
|
15811
15934
|
type: "button",
|
|
@@ -15816,7 +15939,7 @@ function CartLineList({
|
|
|
15816
15939
|
children: "+"
|
|
15817
15940
|
}
|
|
15818
15941
|
),
|
|
15819
|
-
onRemove && /* @__PURE__ */ (0,
|
|
15942
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
15820
15943
|
"button",
|
|
15821
15944
|
{
|
|
15822
15945
|
type: "button",
|
|
@@ -15829,7 +15952,7 @@ function CartLineList({
|
|
|
15829
15952
|
]
|
|
15830
15953
|
}
|
|
15831
15954
|
),
|
|
15832
|
-
message != null && message !== false && /* @__PURE__ */ (0,
|
|
15955
|
+
message != null && message !== false && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
15833
15956
|
"p",
|
|
15834
15957
|
{
|
|
15835
15958
|
className: "mt-2 text-sm text-destructive",
|
|
@@ -15837,12 +15960,12 @@ function CartLineList({
|
|
|
15837
15960
|
children: message
|
|
15838
15961
|
}
|
|
15839
15962
|
),
|
|
15840
|
-
includes != null && includes !== false && /* @__PURE__ */ (0,
|
|
15841
|
-
/* @__PURE__ */ (0,
|
|
15963
|
+
includes != null && includes !== false && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("details", { className: "mt-2", "data-slot": "cart-line-list-includes", children: [
|
|
15964
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("summary", { className: "cursor-pointer text-sm font-semibold text-primary", children: t.includesSummary }),
|
|
15842
15965
|
includes
|
|
15843
15966
|
] })
|
|
15844
15967
|
] }),
|
|
15845
|
-
/* @__PURE__ */ (0,
|
|
15968
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex-shrink-0 text-right", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-base font-bold", children: formatPrice(item.unitPrice * item.quantity, currencyCode, locale) }) })
|
|
15846
15969
|
]
|
|
15847
15970
|
},
|
|
15848
15971
|
lineKey(item.productId, item.variantId)
|
|
@@ -15852,8 +15975,8 @@ function CartLineList({
|
|
|
15852
15975
|
}
|
|
15853
15976
|
|
|
15854
15977
|
// src/components/cart-summary.tsx
|
|
15855
|
-
var
|
|
15856
|
-
var
|
|
15978
|
+
var import_utils22 = require("@reblu/site-ui/utils");
|
|
15979
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
15857
15980
|
var DEFAULT_LABELS3 = {
|
|
15858
15981
|
subtotal: "Subtotal",
|
|
15859
15982
|
discountPrefix: "Descuento",
|
|
@@ -15883,37 +16006,37 @@ function CartSummary({
|
|
|
15883
16006
|
const hasDiscount = Boolean(discountAmount && discountAmount > 0);
|
|
15884
16007
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
15885
16008
|
const hasNotice = noticeContent != null && noticeContent !== false;
|
|
15886
|
-
const breakdown = /* @__PURE__ */ (0,
|
|
16009
|
+
const breakdown = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
15887
16010
|
"dl",
|
|
15888
16011
|
{
|
|
15889
|
-
className: (0,
|
|
16012
|
+
className: (0, import_utils22.cn)("space-y-2 text-sm", !hasNotice && className),
|
|
15890
16013
|
"data-slot": "cart-summary",
|
|
15891
16014
|
children: [
|
|
15892
|
-
/* @__PURE__ */ (0,
|
|
15893
|
-
/* @__PURE__ */ (0,
|
|
15894
|
-
/* @__PURE__ */ (0,
|
|
16015
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
16016
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("dt", { children: t.subtotal }),
|
|
16017
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("dd", { children: formatPrice(subtotal, currencyCode, locale) })
|
|
15895
16018
|
] }),
|
|
15896
|
-
hasDiscount && /* @__PURE__ */ (0,
|
|
15897
|
-
/* @__PURE__ */ (0,
|
|
15898
|
-
/* @__PURE__ */ (0,
|
|
16019
|
+
hasDiscount && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex justify-between text-green-600 dark:text-green-400", children: [
|
|
16020
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("dt", { children: autoDiscount ? t.staffDiscountApplied : `${t.discountPrefix}${discountCode ? ` (${discountCode})` : ""}` }),
|
|
16021
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("dd", { children: [
|
|
15899
16022
|
"-",
|
|
15900
16023
|
formatPrice(discountAmount, currencyCode, locale)
|
|
15901
16024
|
] })
|
|
15902
16025
|
] }),
|
|
15903
|
-
shippingEnabled && /* @__PURE__ */ (0,
|
|
15904
|
-
/* @__PURE__ */ (0,
|
|
15905
|
-
/* @__PURE__ */ (0,
|
|
16026
|
+
shippingEnabled && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
16027
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("dt", { children: t.shipping }),
|
|
16028
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("dd", { children: shipping == null || !Number.isFinite(shipping) ? t.shippingCalculated : shipping === 0 ? t.freeShipping : formatPrice(shipping, currencyCode, locale) })
|
|
15906
16029
|
] }),
|
|
15907
|
-
/* @__PURE__ */ (0,
|
|
15908
|
-
/* @__PURE__ */ (0,
|
|
15909
|
-
/* @__PURE__ */ (0,
|
|
16030
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex justify-between border-t border-border pt-2 text-base font-bold", children: [
|
|
16031
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("dt", { children: t.total }),
|
|
16032
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("dd", { children: formatPrice(total, currencyCode, locale) })
|
|
15910
16033
|
] })
|
|
15911
16034
|
]
|
|
15912
16035
|
}
|
|
15913
16036
|
);
|
|
15914
16037
|
if (!hasNotice) return breakdown;
|
|
15915
|
-
return /* @__PURE__ */ (0,
|
|
15916
|
-
/* @__PURE__ */ (0,
|
|
16038
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: (0, import_utils22.cn)("space-y-3", className), "data-slot": "cart-summary-wrapper", children: [
|
|
16039
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15917
16040
|
"div",
|
|
15918
16041
|
{
|
|
15919
16042
|
role: "status",
|
|
@@ -15927,8 +16050,8 @@ function CartSummary({
|
|
|
15927
16050
|
}
|
|
15928
16051
|
|
|
15929
16052
|
// src/components/cart-adjustments-notice.tsx
|
|
15930
|
-
var
|
|
15931
|
-
var
|
|
16053
|
+
var import_utils23 = require("@reblu/site-ui/utils");
|
|
16054
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
15932
16055
|
var DEFAULT_LABELS4 = {
|
|
15933
16056
|
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.`,
|
|
15934
16057
|
quantityChanged: (name, quantity) => `Hemos ajustado la cantidad de ${name} a ${quantity} por el stock disponible.`,
|
|
@@ -15962,20 +16085,20 @@ function CartAdjustmentsNotice({
|
|
|
15962
16085
|
);
|
|
15963
16086
|
}
|
|
15964
16087
|
if (messages.length === 0) return null;
|
|
15965
|
-
return /* @__PURE__ */ (0,
|
|
16088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
15966
16089
|
"div",
|
|
15967
16090
|
{
|
|
15968
16091
|
role: "status",
|
|
15969
|
-
className: (0,
|
|
16092
|
+
className: (0, import_utils23.cn)("rounded-lg border border-border bg-muted px-3 py-2 text-sm", className),
|
|
15970
16093
|
"data-slot": "cart-adjustments-notice",
|
|
15971
|
-
children: messages.length === 1 ? /* @__PURE__ */ (0,
|
|
16094
|
+
children: messages.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { children: messages[0] }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("ul", { className: "list-disc space-y-1 pl-4", children: messages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("li", { children: message }, index)) })
|
|
15972
16095
|
}
|
|
15973
16096
|
);
|
|
15974
16097
|
}
|
|
15975
16098
|
|
|
15976
16099
|
// src/components/added-to-cart-toast.tsx
|
|
15977
|
-
var
|
|
15978
|
-
var
|
|
16100
|
+
var import_utils24 = require("@reblu/site-ui/utils");
|
|
16101
|
+
var import_jsx_runtime28 = (
|
|
15979
16102
|
// eslint-disable-next-line @next/next/no-img-element -- toast content, not a Next <Image> layout context
|
|
15980
16103
|
require("react/jsx-runtime")
|
|
15981
16104
|
);
|
|
@@ -15998,32 +16121,32 @@ function AddedToCartToast({
|
|
|
15998
16121
|
const message = status === "error" ? t.error : status === "outOfStock" ? t.outOfStock : t.success;
|
|
15999
16122
|
const hasThumbnail = Boolean(imageUrl && imageUrl.trim().length > 0);
|
|
16000
16123
|
const variant = status === "success" ? "success" : "error";
|
|
16001
|
-
return /* @__PURE__ */ (0,
|
|
16124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
16002
16125
|
"div",
|
|
16003
16126
|
{
|
|
16004
16127
|
"data-slot": "added-to-cart-toast",
|
|
16005
16128
|
"data-variant": variant,
|
|
16006
|
-
className: (0,
|
|
16129
|
+
className: (0, import_utils24.cn)(
|
|
16007
16130
|
"flex items-center gap-3 rounded-xl border border-border bg-card p-3 text-sm shadow-lg",
|
|
16008
16131
|
variant === "success" && "border-green-600/30 dark:border-green-400/30",
|
|
16009
16132
|
variant === "error" && "border-destructive/30",
|
|
16010
16133
|
className
|
|
16011
16134
|
),
|
|
16012
16135
|
children: [
|
|
16013
|
-
hasThumbnail && /* @__PURE__ */ (0,
|
|
16014
|
-
/* @__PURE__ */ (0,
|
|
16015
|
-
/* @__PURE__ */ (0,
|
|
16016
|
-
/* @__PURE__ */ (0,
|
|
16136
|
+
hasThumbnail && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("img", { src: imageUrl, alt: productName, className: "h-10 w-10 flex-shrink-0 rounded-lg object-cover" }),
|
|
16137
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
16138
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "truncate font-semibold text-foreground", children: productName }),
|
|
16139
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "truncate text-muted-foreground", children: quantity && quantity > 1 ? `${message} \xB7 x${quantity}` : message })
|
|
16017
16140
|
] }),
|
|
16018
|
-
/* @__PURE__ */ (0,
|
|
16141
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("a", { href: cartHref, className: "text-sm font-semibold text-primary underline-offset-2 hover:underline", children: t.viewCart }) })
|
|
16019
16142
|
]
|
|
16020
16143
|
}
|
|
16021
16144
|
);
|
|
16022
16145
|
}
|
|
16023
16146
|
|
|
16024
16147
|
// src/components/checkout-login-prompt.tsx
|
|
16025
|
-
var
|
|
16026
|
-
var
|
|
16148
|
+
var import_utils25 = require("@reblu/site-ui/utils");
|
|
16149
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
16027
16150
|
var DEFAULT_LABELS6 = {
|
|
16028
16151
|
title: "Identificaci\xF3n",
|
|
16029
16152
|
description: "Introduce tu email para agilizar el proceso o contin\xFAa como invitado.",
|
|
@@ -16050,26 +16173,26 @@ function CheckoutLoginPrompt({
|
|
|
16050
16173
|
if (!open) return null;
|
|
16051
16174
|
const t = { ...DEFAULT_LABELS6, ...labels };
|
|
16052
16175
|
const isValidEmail = EMAIL_PATTERN.test(email.trim());
|
|
16053
|
-
return /* @__PURE__ */ (0,
|
|
16054
|
-
/* @__PURE__ */ (0,
|
|
16055
|
-
/* @__PURE__ */ (0,
|
|
16176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
16177
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "fixed inset-0 z-50 bg-black/50", onClick: onClose, "aria-hidden": "true" }),
|
|
16178
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
16056
16179
|
"div",
|
|
16057
16180
|
{
|
|
16058
16181
|
role: "dialog",
|
|
16059
16182
|
"aria-modal": "true",
|
|
16060
16183
|
"aria-labelledby": "checkout-login-prompt-title",
|
|
16061
16184
|
"data-slot": "checkout-login-prompt",
|
|
16062
|
-
className: (0,
|
|
16185
|
+
className: (0, import_utils25.cn)(
|
|
16063
16186
|
"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",
|
|
16064
16187
|
className
|
|
16065
16188
|
),
|
|
16066
16189
|
children: [
|
|
16067
|
-
/* @__PURE__ */ (0,
|
|
16068
|
-
/* @__PURE__ */ (0,
|
|
16069
|
-
/* @__PURE__ */ (0,
|
|
16070
|
-
/* @__PURE__ */ (0,
|
|
16190
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
16191
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { children: [
|
|
16192
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("h2", { id: "checkout-login-prompt-title", className: "text-xl font-bold", children: t.title }),
|
|
16193
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "mt-1 text-sm text-muted-foreground", children: t.description })
|
|
16071
16194
|
] }),
|
|
16072
|
-
/* @__PURE__ */ (0,
|
|
16195
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
16073
16196
|
"button",
|
|
16074
16197
|
{
|
|
16075
16198
|
type: "button",
|
|
@@ -16080,9 +16203,9 @@ function CheckoutLoginPrompt({
|
|
|
16080
16203
|
}
|
|
16081
16204
|
)
|
|
16082
16205
|
] }),
|
|
16083
|
-
/* @__PURE__ */ (0,
|
|
16084
|
-
/* @__PURE__ */ (0,
|
|
16085
|
-
/* @__PURE__ */ (0,
|
|
16206
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-2", children: [
|
|
16207
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("label", { htmlFor: "checkout-login-prompt-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
16208
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
16086
16209
|
"input",
|
|
16087
16210
|
{
|
|
16088
16211
|
id: "checkout-login-prompt-email",
|
|
@@ -16091,29 +16214,29 @@ function CheckoutLoginPrompt({
|
|
|
16091
16214
|
value: email,
|
|
16092
16215
|
onChange: (e) => onEmailChange(e.target.value),
|
|
16093
16216
|
placeholder: t.emailPlaceholder,
|
|
16094
|
-
className: (0,
|
|
16217
|
+
className: (0, import_utils25.cn)(
|
|
16095
16218
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
16096
16219
|
error ? "border-destructive" : "border-border focus:border-primary"
|
|
16097
16220
|
)
|
|
16098
16221
|
}
|
|
16099
16222
|
),
|
|
16100
|
-
error && /* @__PURE__ */ (0,
|
|
16223
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "text-xs text-destructive", children: error })
|
|
16101
16224
|
] }),
|
|
16102
|
-
/* @__PURE__ */ (0,
|
|
16103
|
-
/* @__PURE__ */ (0,
|
|
16225
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-2", children: [
|
|
16226
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
16104
16227
|
"button",
|
|
16105
16228
|
{
|
|
16106
16229
|
type: "button",
|
|
16107
16230
|
onClick: onSubmitEmail,
|
|
16108
16231
|
disabled: checking || !isValidEmail,
|
|
16109
|
-
className: (0,
|
|
16232
|
+
className: (0, import_utils25.cn)(
|
|
16110
16233
|
"flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl px-4 py-2.5 text-sm font-semibold transition-all",
|
|
16111
16234
|
checking || !isValidEmail ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
16112
16235
|
),
|
|
16113
16236
|
children: checking ? t.checking : t.continueWithEmail
|
|
16114
16237
|
}
|
|
16115
16238
|
),
|
|
16116
|
-
/* @__PURE__ */ (0,
|
|
16239
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
16117
16240
|
"button",
|
|
16118
16241
|
{
|
|
16119
16242
|
type: "button",
|
|
@@ -16130,9 +16253,9 @@ function CheckoutLoginPrompt({
|
|
|
16130
16253
|
}
|
|
16131
16254
|
|
|
16132
16255
|
// src/components/checkout-form.tsx
|
|
16133
|
-
var
|
|
16256
|
+
var import_utils26 = require("@reblu/site-ui/utils");
|
|
16134
16257
|
var import_phone_input = require("@reblu/site-ui/phone-input");
|
|
16135
|
-
var
|
|
16258
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
16136
16259
|
var DEFAULT_LABELS7 = {
|
|
16137
16260
|
contactTitle: "Datos de contacto",
|
|
16138
16261
|
nameLabel: "Nombre completo",
|
|
@@ -16188,22 +16311,22 @@ function CheckoutForm({
|
|
|
16188
16311
|
event.preventDefault();
|
|
16189
16312
|
if (discountCode.trim() && !discountApplying) onApplyDiscount();
|
|
16190
16313
|
}
|
|
16191
|
-
return /* @__PURE__ */ (0,
|
|
16314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
16192
16315
|
loginPrompt,
|
|
16193
|
-
/* @__PURE__ */ (0,
|
|
16316
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
16194
16317
|
"form",
|
|
16195
16318
|
{
|
|
16196
16319
|
"data-testid": "checkout-form",
|
|
16197
16320
|
onSubmit,
|
|
16198
|
-
className: (0,
|
|
16321
|
+
className: (0, import_utils26.cn)("space-y-8", className),
|
|
16199
16322
|
"data-slot": "checkout-form",
|
|
16200
16323
|
children: [
|
|
16201
|
-
/* @__PURE__ */ (0,
|
|
16202
|
-
/* @__PURE__ */ (0,
|
|
16203
|
-
/* @__PURE__ */ (0,
|
|
16204
|
-
/* @__PURE__ */ (0,
|
|
16205
|
-
/* @__PURE__ */ (0,
|
|
16206
|
-
/* @__PURE__ */ (0,
|
|
16324
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("section", { className: "space-y-4", children: [
|
|
16325
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.contactTitle }),
|
|
16326
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
16327
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "space-y-1", children: [
|
|
16328
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("label", { htmlFor: "checkout-form-name", className: "text-sm font-medium", children: t.nameLabel }),
|
|
16329
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16207
16330
|
"input",
|
|
16208
16331
|
{
|
|
16209
16332
|
id: "checkout-form-name",
|
|
@@ -16212,17 +16335,17 @@ function CheckoutForm({
|
|
|
16212
16335
|
value: contact.name,
|
|
16213
16336
|
onChange: (e) => patchContact({ name: e.target.value }),
|
|
16214
16337
|
placeholder: t.namePlaceholder,
|
|
16215
|
-
className: (0,
|
|
16338
|
+
className: (0, import_utils26.cn)(
|
|
16216
16339
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
16217
16340
|
contactErrors?.name ? "border-destructive" : "border-border focus:border-primary"
|
|
16218
16341
|
)
|
|
16219
16342
|
}
|
|
16220
16343
|
),
|
|
16221
|
-
contactErrors?.name && /* @__PURE__ */ (0,
|
|
16344
|
+
contactErrors?.name && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-xs text-destructive", children: contactErrors.name })
|
|
16222
16345
|
] }),
|
|
16223
|
-
/* @__PURE__ */ (0,
|
|
16224
|
-
/* @__PURE__ */ (0,
|
|
16225
|
-
/* @__PURE__ */ (0,
|
|
16346
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "space-y-1", children: [
|
|
16347
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("label", { htmlFor: "checkout-form-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
16348
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16226
16349
|
"input",
|
|
16227
16350
|
{
|
|
16228
16351
|
id: "checkout-form-email",
|
|
@@ -16231,15 +16354,15 @@ function CheckoutForm({
|
|
|
16231
16354
|
value: contact.email,
|
|
16232
16355
|
onChange: (e) => patchContact({ email: e.target.value }),
|
|
16233
16356
|
placeholder: t.emailPlaceholder,
|
|
16234
|
-
className: (0,
|
|
16357
|
+
className: (0, import_utils26.cn)(
|
|
16235
16358
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
16236
16359
|
contactErrors?.email ? "border-destructive" : "border-border focus:border-primary"
|
|
16237
16360
|
)
|
|
16238
16361
|
}
|
|
16239
16362
|
),
|
|
16240
|
-
contactErrors?.email && /* @__PURE__ */ (0,
|
|
16363
|
+
contactErrors?.email && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-xs text-destructive", children: contactErrors.email })
|
|
16241
16364
|
] }),
|
|
16242
|
-
/* @__PURE__ */ (0,
|
|
16365
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16243
16366
|
import_phone_input.PhoneInput,
|
|
16244
16367
|
{
|
|
16245
16368
|
id: "checkout-form-phone",
|
|
@@ -16253,26 +16376,26 @@ function CheckoutForm({
|
|
|
16253
16376
|
] })
|
|
16254
16377
|
] }),
|
|
16255
16378
|
children2,
|
|
16256
|
-
generalError ? /* @__PURE__ */ (0,
|
|
16257
|
-
/* @__PURE__ */ (0,
|
|
16258
|
-
/* @__PURE__ */ (0,
|
|
16259
|
-
autoDiscount ? /* @__PURE__ */ (0,
|
|
16379
|
+
generalError ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { role: "alert", className: "text-sm text-destructive", children: generalError }) : null,
|
|
16380
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("section", { className: "space-y-3", children: [
|
|
16381
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.discountTitle }),
|
|
16382
|
+
autoDiscount ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
16260
16383
|
"div",
|
|
16261
16384
|
{
|
|
16262
16385
|
className: "flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-700 dark:border-green-800 dark:bg-green-900/20 dark:text-green-400",
|
|
16263
16386
|
"data-slot": "checkout-staff-discount",
|
|
16264
16387
|
children: [
|
|
16265
|
-
/* @__PURE__ */ (0,
|
|
16266
|
-
/* @__PURE__ */ (0,
|
|
16388
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "font-semibold", children: t.staffDiscountApplied }),
|
|
16389
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: t.discountAppliedSuffix(formatPrice(autoDiscount.amount, currencyCode, locale)) })
|
|
16267
16390
|
]
|
|
16268
16391
|
}
|
|
16269
16392
|
) : null,
|
|
16270
|
-
appliedDiscount && !autoDiscount ? /* @__PURE__ */ (0,
|
|
16271
|
-
/* @__PURE__ */ (0,
|
|
16272
|
-
/* @__PURE__ */ (0,
|
|
16273
|
-
/* @__PURE__ */ (0,
|
|
16393
|
+
appliedDiscount && !autoDiscount ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("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: [
|
|
16394
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-2 text-sm text-green-700 dark:text-green-400", children: [
|
|
16395
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "font-semibold", children: appliedDiscount.code }),
|
|
16396
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: t.discountAppliedSuffix(formatPrice(appliedDiscount.amount, currencyCode, locale)) })
|
|
16274
16397
|
] }),
|
|
16275
|
-
/* @__PURE__ */ (0,
|
|
16398
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16276
16399
|
"button",
|
|
16277
16400
|
{
|
|
16278
16401
|
type: "button",
|
|
@@ -16282,9 +16405,9 @@ function CheckoutForm({
|
|
|
16282
16405
|
children: t.removeDiscount
|
|
16283
16406
|
}
|
|
16284
16407
|
)
|
|
16285
|
-
] }) : /* @__PURE__ */ (0,
|
|
16286
|
-
/* @__PURE__ */ (0,
|
|
16287
|
-
/* @__PURE__ */ (0,
|
|
16408
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex gap-2", children: [
|
|
16409
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("label", { htmlFor: "checkout-form-discount-code", className: "sr-only", children: t.discountTitle }),
|
|
16410
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16288
16411
|
"input",
|
|
16289
16412
|
{
|
|
16290
16413
|
id: "checkout-form-discount-code",
|
|
@@ -16296,7 +16419,7 @@ function CheckoutForm({
|
|
|
16296
16419
|
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"
|
|
16297
16420
|
}
|
|
16298
16421
|
),
|
|
16299
|
-
/* @__PURE__ */ (0,
|
|
16422
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16300
16423
|
"button",
|
|
16301
16424
|
{
|
|
16302
16425
|
type: "button",
|
|
@@ -16307,14 +16430,14 @@ function CheckoutForm({
|
|
|
16307
16430
|
}
|
|
16308
16431
|
)
|
|
16309
16432
|
] }),
|
|
16310
|
-
discountError && /* @__PURE__ */ (0,
|
|
16433
|
+
discountError && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-xs text-destructive", children: discountError })
|
|
16311
16434
|
] }),
|
|
16312
|
-
/* @__PURE__ */ (0,
|
|
16435
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16313
16436
|
"button",
|
|
16314
16437
|
{
|
|
16315
16438
|
type: "submit",
|
|
16316
16439
|
disabled: submitting || submitDisabled,
|
|
16317
|
-
className: (0,
|
|
16440
|
+
className: (0, import_utils26.cn)(
|
|
16318
16441
|
"flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl px-4 py-3 font-semibold transition-all",
|
|
16319
16442
|
submitting || submitDisabled ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
16320
16443
|
),
|
|
@@ -16328,11 +16451,11 @@ function CheckoutForm({
|
|
|
16328
16451
|
}
|
|
16329
16452
|
|
|
16330
16453
|
// src/components/order-confirmation.tsx
|
|
16331
|
-
var
|
|
16454
|
+
var import_utils28 = require("@reblu/site-ui/utils");
|
|
16332
16455
|
|
|
16333
16456
|
// src/components/order-invoice-link.tsx
|
|
16334
|
-
var
|
|
16335
|
-
var
|
|
16457
|
+
var import_utils27 = require("@reblu/site-ui/utils");
|
|
16458
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
16336
16459
|
var DEFAULT_LABELS8 = {
|
|
16337
16460
|
linkLabel: "Descargar la factura {number}",
|
|
16338
16461
|
signInHint: "Te pediremos que inicies sesi\xF3n para abrirla."
|
|
@@ -16340,8 +16463,8 @@ var DEFAULT_LABELS8 = {
|
|
|
16340
16463
|
function OrderInvoiceLink({ invoice, labels, className }) {
|
|
16341
16464
|
if (!invoice) return null;
|
|
16342
16465
|
const t = { ...DEFAULT_LABELS8, ...labels };
|
|
16343
|
-
return /* @__PURE__ */ (0,
|
|
16344
|
-
/* @__PURE__ */ (0,
|
|
16466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: (0, import_utils27.cn)("space-y-1 text-sm", className), "data-slot": "order-invoice-link", children: [
|
|
16467
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
16345
16468
|
"a",
|
|
16346
16469
|
{
|
|
16347
16470
|
href: invoice.url,
|
|
@@ -16349,12 +16472,12 @@ function OrderInvoiceLink({ invoice, labels, className }) {
|
|
|
16349
16472
|
children: t.linkLabel.replace("{number}", invoice.number)
|
|
16350
16473
|
}
|
|
16351
16474
|
),
|
|
16352
|
-
/* @__PURE__ */ (0,
|
|
16475
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-muted-foreground", children: t.signInHint })
|
|
16353
16476
|
] });
|
|
16354
16477
|
}
|
|
16355
16478
|
|
|
16356
16479
|
// src/components/order-confirmation.tsx
|
|
16357
|
-
var
|
|
16480
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
16358
16481
|
var DEFAULT_LABELS9 = {
|
|
16359
16482
|
pollingTitle: "Confirmando tu pedido\u2026",
|
|
16360
16483
|
pollingDescription: "Estamos procesando el pago, un momento\u2026",
|
|
@@ -16429,60 +16552,60 @@ function OrderConfirmation({
|
|
|
16429
16552
|
const showOrderReference = Boolean(order) && !showFullOrderSummary && (status === "refunded" || status === "partially_refunded" || status === "pending_timeout");
|
|
16430
16553
|
const showSessionReference = !order && sessionId && (status === "timeout" || status === "not_found" || status === "pending_timeout");
|
|
16431
16554
|
const showRecheck = (status === "pending_timeout" || status === "error") && onRecheck;
|
|
16432
|
-
return /* @__PURE__ */ (0,
|
|
16433
|
-
/* @__PURE__ */ (0,
|
|
16434
|
-
/* @__PURE__ */ (0,
|
|
16435
|
-
showFullOrderSummary && order && /* @__PURE__ */ (0,
|
|
16436
|
-
/* @__PURE__ */ (0,
|
|
16437
|
-
/* @__PURE__ */ (0,
|
|
16438
|
-
/* @__PURE__ */ (0,
|
|
16555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: (0, import_utils28.cn)("space-y-6 text-center", className), "data-slot": "order-confirmation", children: [
|
|
16556
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("h1", { className: "text-3xl font-bold", children: title }),
|
|
16557
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-lg text-muted-foreground", children: description }),
|
|
16558
|
+
showFullOrderSummary && order && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "space-y-6", children: [
|
|
16559
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
16560
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderNumberLabel }),
|
|
16561
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
16439
16562
|
] }),
|
|
16440
|
-
/* @__PURE__ */ (0,
|
|
16441
|
-
order.items.map((item, idx) => /* @__PURE__ */ (0,
|
|
16563
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "mx-auto max-w-sm space-y-3 rounded-xl border border-border bg-card p-5 text-left", children: [
|
|
16564
|
+
order.items.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
16442
16565
|
"div",
|
|
16443
16566
|
{
|
|
16444
16567
|
className: "flex justify-between gap-4 text-sm",
|
|
16445
16568
|
children: [
|
|
16446
|
-
/* @__PURE__ */ (0,
|
|
16569
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "max-w-[60%] truncate text-muted-foreground", children: [
|
|
16447
16570
|
item.product.name,
|
|
16448
16571
|
item.variant ? ` (${item.variant.name})` : "",
|
|
16449
16572
|
" x",
|
|
16450
16573
|
item.quantity
|
|
16451
16574
|
] }),
|
|
16452
|
-
/* @__PURE__ */ (0,
|
|
16575
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: formatPrice(item.total, currencyCode, locale) })
|
|
16453
16576
|
]
|
|
16454
16577
|
},
|
|
16455
16578
|
idx
|
|
16456
16579
|
)),
|
|
16457
|
-
/* @__PURE__ */ (0,
|
|
16458
|
-
/* @__PURE__ */ (0,
|
|
16459
|
-
/* @__PURE__ */ (0,
|
|
16580
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "space-y-1 border-t border-border pt-3 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex justify-between pt-1 text-base font-bold", children: [
|
|
16581
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: t.totalLabel }),
|
|
16582
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: formatPrice(order.total, currencyCode, locale) })
|
|
16460
16583
|
] }) })
|
|
16461
16584
|
] }),
|
|
16462
|
-
showPurchaseTexts && order.purchaseTexts?.length ? /* @__PURE__ */ (0,
|
|
16585
|
+
showPurchaseTexts && order.purchaseTexts?.length ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "mx-auto max-w-sm space-y-3 text-left", "data-slot": "order-confirmation-purchase-texts", children: order.purchaseTexts.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
16463
16586
|
"div",
|
|
16464
16587
|
{
|
|
16465
16588
|
className: "rounded-xl border border-border bg-card p-4",
|
|
16466
16589
|
"data-slot": "order-confirmation-purchase-text",
|
|
16467
16590
|
"data-kind": entry.kind,
|
|
16468
16591
|
children: [
|
|
16469
|
-
/* @__PURE__ */ (0,
|
|
16470
|
-
entry.place ? /* @__PURE__ */ (0,
|
|
16471
|
-
entry.place.name ? /* @__PURE__ */ (0,
|
|
16472
|
-
entry.place.address.map((line) => /* @__PURE__ */ (0,
|
|
16592
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: entry.label }),
|
|
16593
|
+
entry.place ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("address", { className: "mb-2 text-sm not-italic", "data-slot": "order-confirmation-pickup-place", children: [
|
|
16594
|
+
entry.place.name ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "block font-medium", children: entry.place.name }) : null,
|
|
16595
|
+
entry.place.address.map((line) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "block", children: line }, line))
|
|
16473
16596
|
] }) : null,
|
|
16474
|
-
/* @__PURE__ */ (0,
|
|
16597
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "whitespace-pre-line text-sm", children: entry.text })
|
|
16475
16598
|
]
|
|
16476
16599
|
},
|
|
16477
16600
|
entry.kind
|
|
16478
16601
|
)) }) : null,
|
|
16479
|
-
t.foundDescription.includes("{email}") ? null : /* @__PURE__ */ (0,
|
|
16602
|
+
t.foundDescription.includes("{email}") ? null : /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("p", { className: "mx-auto max-w-sm text-sm text-muted-foreground", children: [
|
|
16480
16603
|
t.confirmationEmailPrefix,
|
|
16481
16604
|
" ",
|
|
16482
|
-
/* @__PURE__ */ (0,
|
|
16605
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "font-medium text-foreground", children: order.customerEmail }),
|
|
16483
16606
|
"."
|
|
16484
16607
|
] }),
|
|
16485
|
-
/* @__PURE__ */ (0,
|
|
16608
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
16486
16609
|
OrderInvoiceLink,
|
|
16487
16610
|
{
|
|
16488
16611
|
invoice: order.invoice,
|
|
@@ -16490,11 +16613,11 @@ function OrderConfirmation({
|
|
|
16490
16613
|
}
|
|
16491
16614
|
)
|
|
16492
16615
|
] }),
|
|
16493
|
-
showOrderReference && order && /* @__PURE__ */ (0,
|
|
16494
|
-
/* @__PURE__ */ (0,
|
|
16495
|
-
/* @__PURE__ */ (0,
|
|
16616
|
+
showOrderReference && order && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
16617
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderReferenceLabel }),
|
|
16618
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
16496
16619
|
] }),
|
|
16497
|
-
status === "failed" && cartHref && /* @__PURE__ */ (0,
|
|
16620
|
+
status === "failed" && cartHref && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
16498
16621
|
"a",
|
|
16499
16622
|
{
|
|
16500
16623
|
href: cartHref,
|
|
@@ -16502,7 +16625,7 @@ function OrderConfirmation({
|
|
|
16502
16625
|
children: t.backToCartLabel
|
|
16503
16626
|
}
|
|
16504
16627
|
),
|
|
16505
|
-
showRecheck && /* @__PURE__ */ (0,
|
|
16628
|
+
showRecheck && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
16506
16629
|
"button",
|
|
16507
16630
|
{
|
|
16508
16631
|
type: "button",
|
|
@@ -16511,16 +16634,16 @@ function OrderConfirmation({
|
|
|
16511
16634
|
children: t.recheckLabel
|
|
16512
16635
|
}
|
|
16513
16636
|
),
|
|
16514
|
-
showSessionReference && /* @__PURE__ */ (0,
|
|
16515
|
-
/* @__PURE__ */ (0,
|
|
16516
|
-
/* @__PURE__ */ (0,
|
|
16637
|
+
showSessionReference && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
16638
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.sessionReferenceLabel }),
|
|
16639
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "break-all font-mono text-sm font-semibold", children: sessionId })
|
|
16517
16640
|
] })
|
|
16518
16641
|
] });
|
|
16519
16642
|
}
|
|
16520
16643
|
|
|
16521
16644
|
// src/components/full-invoice-fields.tsx
|
|
16522
|
-
var
|
|
16523
|
-
var
|
|
16645
|
+
var import_utils29 = require("@reblu/site-ui/utils");
|
|
16646
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
16524
16647
|
var EMPTY_FULL_INVOICE_VALUE = {
|
|
16525
16648
|
wantsFullInvoice: false,
|
|
16526
16649
|
billingIdType: "NIF",
|
|
@@ -16637,12 +16760,12 @@ function FullInvoiceFields({
|
|
|
16637
16760
|
const showFields = value.wantsFullInvoice || overCap;
|
|
16638
16761
|
const isSpanishNif = value.billingIdType === "NIF";
|
|
16639
16762
|
const set = (key2, next2) => onChange({ ...value, [key2]: next2 });
|
|
16640
|
-
const error = (key2) => errors[key2] ? /* @__PURE__ */ (0,
|
|
16763
|
+
const error = (key2) => errors[key2] ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { id: `full-invoice-${key2}-error`, className: "text-sm text-destructive", children: errors[key2] }) : null;
|
|
16641
16764
|
const invalid2 = (key2) => errors[key2] ? { "aria-invalid": true, "aria-describedby": `full-invoice-${key2}-error` } : {};
|
|
16642
|
-
return /* @__PURE__ */ (0,
|
|
16643
|
-
overCap ? /* @__PURE__ */ (0,
|
|
16644
|
-
/* @__PURE__ */ (0,
|
|
16645
|
-
/* @__PURE__ */ (0,
|
|
16765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("section", { className: (0, import_utils29.cn)("space-y-4", className), "data-slot": "full-invoice-fields", children: [
|
|
16766
|
+
overCap ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { role: "note", className: "rounded-lg border border-border p-4 text-sm", children: t.overCapNotice }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-1", children: [
|
|
16767
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
16768
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
16646
16769
|
"input",
|
|
16647
16770
|
{
|
|
16648
16771
|
type: "checkbox",
|
|
@@ -16652,12 +16775,12 @@ function FullInvoiceFields({
|
|
|
16652
16775
|
),
|
|
16653
16776
|
t.toggle
|
|
16654
16777
|
] }),
|
|
16655
|
-
/* @__PURE__ */ (0,
|
|
16778
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-sm text-muted-foreground", children: t.underCapNotice })
|
|
16656
16779
|
] }),
|
|
16657
|
-
showFields && /* @__PURE__ */ (0,
|
|
16658
|
-
/* @__PURE__ */ (0,
|
|
16659
|
-
/* @__PURE__ */ (0,
|
|
16660
|
-
/* @__PURE__ */ (0,
|
|
16780
|
+
showFields && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
16781
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-1", children: [
|
|
16782
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("label", { htmlFor: "full-invoice-id-type", className: "text-sm font-medium", children: t.idType }),
|
|
16783
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
16661
16784
|
"select",
|
|
16662
16785
|
{
|
|
16663
16786
|
id: "full-invoice-id-type",
|
|
@@ -16666,14 +16789,14 @@ function FullInvoiceFields({
|
|
|
16666
16789
|
value: value.billingIdType,
|
|
16667
16790
|
onChange: (e) => set("billingIdType", e.target.value),
|
|
16668
16791
|
...invalid2("billingIdType"),
|
|
16669
|
-
children: ID_TYPES.map((type) => /* @__PURE__ */ (0,
|
|
16792
|
+
children: ID_TYPES.map((type) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: type, children: t.idTypeOptions[type] }, type))
|
|
16670
16793
|
}
|
|
16671
16794
|
),
|
|
16672
16795
|
error("billingIdType")
|
|
16673
16796
|
] }),
|
|
16674
|
-
!isSpanishNif && /* @__PURE__ */ (0,
|
|
16675
|
-
/* @__PURE__ */ (0,
|
|
16676
|
-
/* @__PURE__ */ (0,
|
|
16797
|
+
!isSpanishNif && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-1", children: [
|
|
16798
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("label", { htmlFor: "full-invoice-id-country", className: "text-sm font-medium", children: t.idCountry }),
|
|
16799
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
16677
16800
|
"select",
|
|
16678
16801
|
{
|
|
16679
16802
|
id: "full-invoice-id-country",
|
|
@@ -16683,16 +16806,16 @@ function FullInvoiceFields({
|
|
|
16683
16806
|
onChange: (e) => set("billingIdCountry", e.target.value),
|
|
16684
16807
|
...invalid2("billingIdCountry"),
|
|
16685
16808
|
children: [
|
|
16686
|
-
/* @__PURE__ */ (0,
|
|
16687
|
-
countries.map((c) => /* @__PURE__ */ (0,
|
|
16809
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "", disabled: true, children: t.chooseCountry }),
|
|
16810
|
+
countries.map((c) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: c.code, children: c.name }, c.code))
|
|
16688
16811
|
]
|
|
16689
16812
|
}
|
|
16690
16813
|
),
|
|
16691
16814
|
error("billingIdCountry")
|
|
16692
16815
|
] }),
|
|
16693
|
-
/* @__PURE__ */ (0,
|
|
16694
|
-
/* @__PURE__ */ (0,
|
|
16695
|
-
/* @__PURE__ */ (0,
|
|
16816
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-1", children: [
|
|
16817
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("label", { htmlFor: "full-invoice-nif", className: "text-sm font-medium", children: isSpanishNif ? t.spanishNif : t.documentNumber }),
|
|
16818
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
16696
16819
|
"input",
|
|
16697
16820
|
{
|
|
16698
16821
|
id: "full-invoice-nif",
|
|
@@ -16705,9 +16828,9 @@ function FullInvoiceFields({
|
|
|
16705
16828
|
),
|
|
16706
16829
|
error("billingNif")
|
|
16707
16830
|
] }),
|
|
16708
|
-
/* @__PURE__ */ (0,
|
|
16709
|
-
/* @__PURE__ */ (0,
|
|
16710
|
-
/* @__PURE__ */ (0,
|
|
16831
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-1", children: [
|
|
16832
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("label", { htmlFor: "full-invoice-name", className: "text-sm font-medium", children: t.name }),
|
|
16833
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
16711
16834
|
"input",
|
|
16712
16835
|
{
|
|
16713
16836
|
id: "full-invoice-name",
|
|
@@ -16720,9 +16843,9 @@ function FullInvoiceFields({
|
|
|
16720
16843
|
),
|
|
16721
16844
|
error("billingName")
|
|
16722
16845
|
] }),
|
|
16723
|
-
/* @__PURE__ */ (0,
|
|
16724
|
-
/* @__PURE__ */ (0,
|
|
16725
|
-
/* @__PURE__ */ (0,
|
|
16846
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-1 sm:col-span-2", children: [
|
|
16847
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("label", { htmlFor: "full-invoice-street", className: "text-sm font-medium", children: t.street }),
|
|
16848
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
16726
16849
|
"input",
|
|
16727
16850
|
{
|
|
16728
16851
|
id: "full-invoice-street",
|
|
@@ -16734,9 +16857,9 @@ function FullInvoiceFields({
|
|
|
16734
16857
|
}
|
|
16735
16858
|
)
|
|
16736
16859
|
] }),
|
|
16737
|
-
/* @__PURE__ */ (0,
|
|
16738
|
-
/* @__PURE__ */ (0,
|
|
16739
|
-
/* @__PURE__ */ (0,
|
|
16860
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-1", children: [
|
|
16861
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("label", { htmlFor: "full-invoice-postal-code", className: "text-sm font-medium", children: t.postalCode }),
|
|
16862
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
16740
16863
|
"input",
|
|
16741
16864
|
{
|
|
16742
16865
|
id: "full-invoice-postal-code",
|
|
@@ -16747,9 +16870,9 @@ function FullInvoiceFields({
|
|
|
16747
16870
|
}
|
|
16748
16871
|
)
|
|
16749
16872
|
] }),
|
|
16750
|
-
/* @__PURE__ */ (0,
|
|
16751
|
-
/* @__PURE__ */ (0,
|
|
16752
|
-
/* @__PURE__ */ (0,
|
|
16873
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-1", children: [
|
|
16874
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("label", { htmlFor: "full-invoice-city", className: "text-sm font-medium", children: t.city }),
|
|
16875
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
16753
16876
|
"input",
|
|
16754
16877
|
{
|
|
16755
16878
|
id: "full-invoice-city",
|
|
@@ -16760,9 +16883,9 @@ function FullInvoiceFields({
|
|
|
16760
16883
|
}
|
|
16761
16884
|
)
|
|
16762
16885
|
] }),
|
|
16763
|
-
/* @__PURE__ */ (0,
|
|
16764
|
-
/* @__PURE__ */ (0,
|
|
16765
|
-
/* @__PURE__ */ (0,
|
|
16886
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-1", children: [
|
|
16887
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("label", { htmlFor: "full-invoice-country", className: "text-sm font-medium", children: t.country }),
|
|
16888
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
16766
16889
|
"select",
|
|
16767
16890
|
{
|
|
16768
16891
|
id: "full-invoice-country",
|
|
@@ -16770,18 +16893,18 @@ function FullInvoiceFields({
|
|
|
16770
16893
|
required: true,
|
|
16771
16894
|
value: value.country,
|
|
16772
16895
|
onChange: (e) => set("country", e.target.value),
|
|
16773
|
-
children: countries.map((c) => /* @__PURE__ */ (0,
|
|
16896
|
+
children: countries.map((c) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: c.code, children: c.name }, c.code))
|
|
16774
16897
|
}
|
|
16775
16898
|
)
|
|
16776
16899
|
] }),
|
|
16777
|
-
/* @__PURE__ */ (0,
|
|
16900
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "sm:col-span-2", children: error("address") })
|
|
16778
16901
|
] })
|
|
16779
16902
|
] });
|
|
16780
16903
|
}
|
|
16781
16904
|
|
|
16782
16905
|
// src/components/checkout-delivery-choice.tsx
|
|
16783
|
-
var
|
|
16784
|
-
var
|
|
16906
|
+
var import_utils30 = require("@reblu/site-ui/utils");
|
|
16907
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
16785
16908
|
var EMPTY_CHECKOUT_ADDRESS = {
|
|
16786
16909
|
firstName: "",
|
|
16787
16910
|
lastName: "",
|
|
@@ -16844,17 +16967,17 @@ function CheckoutDeliveryChoice({
|
|
|
16844
16967
|
const isPickup = value?.type === "PICKUP";
|
|
16845
16968
|
const isShipping = value?.type === "SHIPPING";
|
|
16846
16969
|
const errorId = `${uid}-delivery-error`;
|
|
16847
|
-
return /* @__PURE__ */ (0,
|
|
16970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
16848
16971
|
"fieldset",
|
|
16849
16972
|
{
|
|
16850
16973
|
"data-slot": "checkout-delivery",
|
|
16851
16974
|
"aria-describedby": error ? errorId : void 0,
|
|
16852
|
-
className: (0,
|
|
16975
|
+
className: (0, import_utils30.cn)("space-y-4", className),
|
|
16853
16976
|
children: [
|
|
16854
|
-
/* @__PURE__ */ (0,
|
|
16855
|
-
/* @__PURE__ */ (0,
|
|
16856
|
-
homeDelivery ? /* @__PURE__ */ (0,
|
|
16857
|
-
/* @__PURE__ */ (0,
|
|
16977
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("legend", { className: "mb-2 text-lg font-semibold", children: t.legend }),
|
|
16978
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "grid gap-3 sm:grid-cols-2", children: [
|
|
16979
|
+
homeDelivery ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: "flex cursor-pointer items-start gap-3 rounded-xl border border-border p-4 has-[:checked]:border-primary", children: [
|
|
16980
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
16858
16981
|
"input",
|
|
16859
16982
|
{
|
|
16860
16983
|
type: "radio",
|
|
@@ -16864,16 +16987,16 @@ function CheckoutDeliveryChoice({
|
|
|
16864
16987
|
className: "mt-0.5 size-4 accent-primary"
|
|
16865
16988
|
}
|
|
16866
16989
|
),
|
|
16867
|
-
/* @__PURE__ */ (0,
|
|
16868
|
-
/* @__PURE__ */ (0,
|
|
16869
|
-
/* @__PURE__ */ (0,
|
|
16870
|
-
/* @__PURE__ */ (0,
|
|
16990
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "flex-1 space-y-1", children: [
|
|
16991
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "flex justify-between gap-2 font-medium", children: [
|
|
16992
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: copy.shippingOptionLabel }),
|
|
16993
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "tabular-nums", children: homeCost })
|
|
16871
16994
|
] }),
|
|
16872
|
-
delivery.estimatedDeliveryText ? /* @__PURE__ */ (0,
|
|
16995
|
+
delivery.estimatedDeliveryText ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "block text-sm text-muted-foreground", children: delivery.estimatedDeliveryText }) : null
|
|
16873
16996
|
] })
|
|
16874
16997
|
] }) : null,
|
|
16875
|
-
pickup ? /* @__PURE__ */ (0,
|
|
16876
|
-
/* @__PURE__ */ (0,
|
|
16998
|
+
pickup ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: "flex cursor-pointer items-start gap-3 rounded-xl border border-border p-4 has-[:checked]:border-primary", children: [
|
|
16999
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
16877
17000
|
"input",
|
|
16878
17001
|
{
|
|
16879
17002
|
type: "radio",
|
|
@@ -16883,23 +17006,23 @@ function CheckoutDeliveryChoice({
|
|
|
16883
17006
|
className: "mt-0.5 size-4 accent-primary"
|
|
16884
17007
|
}
|
|
16885
17008
|
),
|
|
16886
|
-
/* @__PURE__ */ (0,
|
|
16887
|
-
/* @__PURE__ */ (0,
|
|
16888
|
-
/* @__PURE__ */ (0,
|
|
17009
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "flex flex-1 justify-between gap-2 font-medium", children: [
|
|
17010
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: copy.pickupOptionLabel }),
|
|
17011
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: t.free })
|
|
16889
17012
|
] })
|
|
16890
17013
|
] }) : null
|
|
16891
17014
|
] }),
|
|
16892
|
-
error ? /* @__PURE__ */ (0,
|
|
16893
|
-
isPickup ? /* @__PURE__ */ (0,
|
|
16894
|
-
/* @__PURE__ */ (0,
|
|
17015
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { id: errorId, role: "alert", className: "text-sm text-destructive", children: error }) : null,
|
|
17016
|
+
isPickup ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { role: "radiogroup", "aria-labelledby": `${uid}-points`, className: "space-y-2", children: [
|
|
17017
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { id: `${uid}-points`, className: "text-sm font-medium", children: t.pickupPointsLegend }),
|
|
16895
17018
|
delivery.pickupLocations.map((location2) => {
|
|
16896
17019
|
const descId = `${uid}-point-${location2.id}`;
|
|
16897
|
-
return /* @__PURE__ */ (0,
|
|
17020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
16898
17021
|
"label",
|
|
16899
17022
|
{
|
|
16900
17023
|
className: "flex cursor-pointer items-start gap-3 rounded-lg border border-border p-3 has-[:checked]:border-primary",
|
|
16901
17024
|
children: [
|
|
16902
|
-
/* @__PURE__ */ (0,
|
|
17025
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
16903
17026
|
"input",
|
|
16904
17027
|
{
|
|
16905
17028
|
type: "radio",
|
|
@@ -16910,9 +17033,9 @@ function CheckoutDeliveryChoice({
|
|
|
16910
17033
|
className: "mt-0.5 size-4 accent-primary"
|
|
16911
17034
|
}
|
|
16912
17035
|
),
|
|
16913
|
-
/* @__PURE__ */ (0,
|
|
16914
|
-
/* @__PURE__ */ (0,
|
|
16915
|
-
/* @__PURE__ */ (0,
|
|
17036
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "space-y-0.5 text-sm", children: [
|
|
17037
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "block font-medium", children: location2.name }),
|
|
17038
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { id: descId, className: "block text-muted-foreground", children: pickupDescription(location2) })
|
|
16916
17039
|
] })
|
|
16917
17040
|
]
|
|
16918
17041
|
},
|
|
@@ -16920,14 +17043,14 @@ function CheckoutDeliveryChoice({
|
|
|
16920
17043
|
);
|
|
16921
17044
|
})
|
|
16922
17045
|
] }) : null,
|
|
16923
|
-
isShipping ? /* @__PURE__ */ (0,
|
|
16924
|
-
/* @__PURE__ */ (0,
|
|
16925
|
-
/* @__PURE__ */ (0,
|
|
17046
|
+
isShipping ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("fieldset", { className: "space-y-3", children: [
|
|
17047
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("legend", { className: "mb-2 text-sm font-medium", children: t.addressLegend }),
|
|
17048
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: ADDRESS_FIELDS.map(({ key: key2, autoComplete, required, wide }) => {
|
|
16926
17049
|
const fieldId = `${uid}-${key2}`;
|
|
16927
17050
|
const fieldError = addressErrors?.[key2];
|
|
16928
|
-
return /* @__PURE__ */ (0,
|
|
16929
|
-
/* @__PURE__ */ (0,
|
|
16930
|
-
/* @__PURE__ */ (0,
|
|
17051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: (0, import_utils30.cn)("space-y-1", wide && "sm:col-span-2"), children: [
|
|
17052
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("label", { htmlFor: fieldId, className: "text-sm font-medium", children: t[key2] }),
|
|
17053
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
16931
17054
|
"input",
|
|
16932
17055
|
{
|
|
16933
17056
|
id: fieldId,
|
|
@@ -16938,13 +17061,13 @@ function CheckoutDeliveryChoice({
|
|
|
16938
17061
|
onChange: (e) => onAddressChange({ ...address, [key2]: e.target.value }),
|
|
16939
17062
|
"aria-invalid": fieldError ? true : void 0,
|
|
16940
17063
|
"aria-describedby": fieldError ? `${fieldId}-error` : void 0,
|
|
16941
|
-
className: (0,
|
|
17064
|
+
className: (0, import_utils30.cn)(
|
|
16942
17065
|
INPUT_CLASS,
|
|
16943
17066
|
fieldError ? "border-destructive" : "border-border focus:border-primary"
|
|
16944
17067
|
)
|
|
16945
17068
|
}
|
|
16946
17069
|
),
|
|
16947
|
-
fieldError ? /* @__PURE__ */ (0,
|
|
17070
|
+
fieldError ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { id: `${fieldId}-error`, className: "text-sm text-destructive", children: fieldError }) : null
|
|
16948
17071
|
] }, key2);
|
|
16949
17072
|
}) })
|
|
16950
17073
|
] }) : null
|
|
@@ -16986,8 +17109,8 @@ function toCheckoutFulfillmentFields(value, address, requiresDelivery = true) {
|
|
|
16986
17109
|
}
|
|
16987
17110
|
|
|
16988
17111
|
// src/components/checkout-quote-summary.tsx
|
|
16989
|
-
var
|
|
16990
|
-
var
|
|
17112
|
+
var import_utils31 = require("@reblu/site-ui/utils");
|
|
17113
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
16991
17114
|
var DEFAULT_CHECKOUT_QUOTE_SUMMARY_LABELS = {
|
|
16992
17115
|
subtotal: "Subtotal",
|
|
16993
17116
|
discount: (codeOrLabel, isAutomatic) => isAutomatic ? codeOrLabel : `Descuento (${codeOrLabel})`,
|
|
@@ -17004,9 +17127,9 @@ function Row({
|
|
|
17004
17127
|
value,
|
|
17005
17128
|
className
|
|
17006
17129
|
}) {
|
|
17007
|
-
return /* @__PURE__ */ (0,
|
|
17008
|
-
/* @__PURE__ */ (0,
|
|
17009
|
-
/* @__PURE__ */ (0,
|
|
17130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { "data-slot": "checkout-quote-row", className: (0, import_utils31.cn)("flex justify-between gap-4", className), children: [
|
|
17131
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("dt", { children: name }),
|
|
17132
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("dd", { className: "shrink-0 tabular-nums", children: value })
|
|
17010
17133
|
] });
|
|
17011
17134
|
}
|
|
17012
17135
|
function CheckoutQuoteSummary({
|
|
@@ -17022,22 +17145,22 @@ function CheckoutQuoteSummary({
|
|
|
17022
17145
|
const price = (cents) => formatPrice(cents, currencyCode, locale);
|
|
17023
17146
|
const { fulfillment, shipping, tax, discount } = quote;
|
|
17024
17147
|
const Tag = `h${headingLevel}`;
|
|
17025
|
-
return /* @__PURE__ */ (0,
|
|
17026
|
-
heading ? /* @__PURE__ */ (0,
|
|
17027
|
-
/* @__PURE__ */ (0,
|
|
17028
|
-
/* @__PURE__ */ (0,
|
|
17029
|
-
/* @__PURE__ */ (0,
|
|
17030
|
-
line.variantName ? /* @__PURE__ */ (0,
|
|
17031
|
-
/* @__PURE__ */ (0,
|
|
17032
|
-
line.kindLabel ? /* @__PURE__ */ (0,
|
|
17033
|
-
/* @__PURE__ */ (0,
|
|
17148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("section", { "data-slot": "checkout-quote-summary", className: slotClassName("space-y-4", "", className), children: [
|
|
17149
|
+
heading ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Tag, { className: "text-lg font-semibold", children: heading }) : null,
|
|
17150
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("ul", { className: "space-y-3 text-sm", children: quote.lines.map((line) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("li", { className: "flex justify-between gap-4", children: [
|
|
17151
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "min-w-0 space-y-0.5", children: [
|
|
17152
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "font-medium", children: line.name }),
|
|
17153
|
+
line.variantName ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-muted-foreground", children: line.variantName }) : null,
|
|
17154
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("p", { className: "flex flex-wrap items-center gap-2 text-muted-foreground", children: [
|
|
17155
|
+
line.kindLabel ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { "data-slot": "checkout-quote-kind", className: "rounded-full border border-border px-2 py-0.5 text-xs font-medium text-foreground", children: line.kindLabel }) : null,
|
|
17156
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: t.quantityTimesUnit(line.quantity, price(line.unitPrice)) })
|
|
17034
17157
|
] })
|
|
17035
17158
|
] }),
|
|
17036
|
-
/* @__PURE__ */ (0,
|
|
17159
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "shrink-0 tabular-nums", children: price(line.total) })
|
|
17037
17160
|
] }, `${line.productId}-${line.variantId ?? ""}`)) }),
|
|
17038
|
-
/* @__PURE__ */ (0,
|
|
17039
|
-
/* @__PURE__ */ (0,
|
|
17040
|
-
discount && discount.amount > 0 ? /* @__PURE__ */ (0,
|
|
17161
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("dl", { className: "space-y-2 border-t border-border pt-3 text-sm", children: [
|
|
17162
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Row, { name: t.subtotal, value: price(quote.subtotal) }),
|
|
17163
|
+
discount && discount.amount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
17041
17164
|
Row,
|
|
17042
17165
|
{
|
|
17043
17166
|
className: "text-green-700 dark:text-green-400",
|
|
@@ -17045,17 +17168,17 @@ function CheckoutQuoteSummary({
|
|
|
17045
17168
|
value: `\u2212${price(discount.amount)}`
|
|
17046
17169
|
}
|
|
17047
17170
|
) : null,
|
|
17048
|
-
fulfillment.type ? /* @__PURE__ */ (0,
|
|
17171
|
+
fulfillment.type ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
17049
17172
|
Row,
|
|
17050
17173
|
{
|
|
17051
|
-
name: /* @__PURE__ */ (0,
|
|
17174
|
+
name: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
17052
17175
|
fulfillment.label ?? t.delivery,
|
|
17053
|
-
fulfillment.type === "PICKUP" && fulfillment.pickupLocation ? /* @__PURE__ */ (0,
|
|
17176
|
+
fulfillment.type === "PICKUP" && fulfillment.pickupLocation ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "block text-muted-foreground", children: fulfillment.pickupLocation.name }) : null
|
|
17054
17177
|
] }),
|
|
17055
17178
|
value: fulfillment.type === "PICKUP" || shipping.isFree ? t.free : price(shipping.cost)
|
|
17056
17179
|
}
|
|
17057
17180
|
) : null,
|
|
17058
|
-
tax.isLineVisible ? tax.breakdown.map((entry) => /* @__PURE__ */ (0,
|
|
17181
|
+
tax.isLineVisible ? tax.breakdown.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
17059
17182
|
Row,
|
|
17060
17183
|
{
|
|
17061
17184
|
className: tax.isIncluded ? "text-muted-foreground" : void 0,
|
|
@@ -17064,13 +17187,13 @@ function CheckoutQuoteSummary({
|
|
|
17064
17187
|
},
|
|
17065
17188
|
entry.label
|
|
17066
17189
|
)) : null,
|
|
17067
|
-
/* @__PURE__ */ (0,
|
|
17190
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Row, { className: "border-t border-border pt-2 text-base font-bold", name: t.total, value: price(quote.total) })
|
|
17068
17191
|
] }),
|
|
17069
|
-
tax.isIncluded ? /* @__PURE__ */ (0,
|
|
17070
|
-
fulfillment.type === "SHIPPING" && !shipping.isFree && shipping.remainingForFree ? /* @__PURE__ */ (0,
|
|
17071
|
-
fulfillment.type && quote.deliveryEstimateText ? /* @__PURE__ */ (0,
|
|
17072
|
-
quote.discountError ? /* @__PURE__ */ (0,
|
|
17073
|
-
quote.blockingReason ? /* @__PURE__ */ (0,
|
|
17192
|
+
tax.isIncluded ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm text-muted-foreground", children: t.taxesIncludedNote }) : null,
|
|
17193
|
+
fulfillment.type === "SHIPPING" && !shipping.isFree && shipping.remainingForFree ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm text-muted-foreground", children: t.remainingForFree(price(shipping.remainingForFree)) }) : null,
|
|
17194
|
+
fulfillment.type && quote.deliveryEstimateText ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { "data-slot": "checkout-quote-estimate", className: "text-sm text-muted-foreground", children: quote.deliveryEstimateText }) : null,
|
|
17195
|
+
quote.discountError ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { role: "status", className: "text-sm text-destructive", children: quote.discountError.message }) : null,
|
|
17196
|
+
quote.blockingReason ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { role: "alert", className: "rounded-lg border border-destructive/50 bg-destructive/10 p-3 text-sm text-destructive", children: quote.blockingReason.message }) : null
|
|
17074
17197
|
] });
|
|
17075
17198
|
}
|
|
17076
17199
|
var DEFAULT_CHECKOUT_QUOTE_NOTICE_LABELS = {
|
|
@@ -17088,7 +17211,7 @@ function checkoutQuoteNotice({
|
|
|
17088
17211
|
function CheckoutQuoteNotice({ reason, labels, className }) {
|
|
17089
17212
|
if (!reason) return null;
|
|
17090
17213
|
const t = { ...DEFAULT_CHECKOUT_QUOTE_NOTICE_LABELS, ...labels };
|
|
17091
|
-
return /* @__PURE__ */ (0,
|
|
17214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
17092
17215
|
"p",
|
|
17093
17216
|
{
|
|
17094
17217
|
role: "status",
|
|
@@ -17100,8 +17223,8 @@ function CheckoutQuoteNotice({ reason, labels, className }) {
|
|
|
17100
17223
|
}
|
|
17101
17224
|
|
|
17102
17225
|
// src/components/checkout-terms-acceptance.tsx
|
|
17103
|
-
var
|
|
17104
|
-
var
|
|
17226
|
+
var import_utils32 = require("@reblu/site-ui/utils");
|
|
17227
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
17105
17228
|
function splitTermsLabel(label) {
|
|
17106
17229
|
const at = label.indexOf("{terms}");
|
|
17107
17230
|
return at === -1 ? [`${label} `, ""] : [label.slice(0, at), label.slice(at + "{terms}".length)];
|
|
@@ -17123,9 +17246,9 @@ function CheckoutTermsAcceptance({
|
|
|
17123
17246
|
(part) => part.replaceAll("{tenant}", copy.tenantName)
|
|
17124
17247
|
);
|
|
17125
17248
|
const newTab = copy.isTermsLinkNewTab;
|
|
17126
|
-
return /* @__PURE__ */ (0,
|
|
17127
|
-
/* @__PURE__ */ (0,
|
|
17128
|
-
/* @__PURE__ */ (0,
|
|
17249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { "data-slot": "checkout-terms", className: (0, import_utils32.cn)("space-y-1", className), children: [
|
|
17250
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
17251
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17129
17252
|
"input",
|
|
17130
17253
|
{
|
|
17131
17254
|
id: boxId,
|
|
@@ -17138,9 +17261,9 @@ function CheckoutTermsAcceptance({
|
|
|
17138
17261
|
className: "mt-0.5 size-5 shrink-0 cursor-pointer accent-primary"
|
|
17139
17262
|
}
|
|
17140
17263
|
),
|
|
17141
|
-
/* @__PURE__ */ (0,
|
|
17264
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("label", { htmlFor: boxId, className: "text-sm leading-relaxed", children: [
|
|
17142
17265
|
before,
|
|
17143
|
-
/* @__PURE__ */ (0,
|
|
17266
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
17144
17267
|
"a",
|
|
17145
17268
|
{
|
|
17146
17269
|
href: copy.termsLinkUrl ?? termsHref,
|
|
@@ -17148,9 +17271,9 @@ function CheckoutTermsAcceptance({
|
|
|
17148
17271
|
className: "font-medium underline underline-offset-2 hover:text-primary",
|
|
17149
17272
|
children: [
|
|
17150
17273
|
copy.termsLinkText,
|
|
17151
|
-
newTab ? /* @__PURE__ */ (0,
|
|
17274
|
+
newTab ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
17152
17275
|
" ",
|
|
17153
|
-
/* @__PURE__ */ (0,
|
|
17276
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "sr-only", children: newTabHint })
|
|
17154
17277
|
] }) : null
|
|
17155
17278
|
]
|
|
17156
17279
|
}
|
|
@@ -17158,7 +17281,7 @@ function CheckoutTermsAcceptance({
|
|
|
17158
17281
|
after
|
|
17159
17282
|
] })
|
|
17160
17283
|
] }),
|
|
17161
|
-
error ? /* @__PURE__ */ (0,
|
|
17284
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { id: errorId, className: "pl-8 text-sm text-destructive", children: error }) : null
|
|
17162
17285
|
] });
|
|
17163
17286
|
}
|
|
17164
17287
|
function toCheckoutTermsFields(copy, accepted) {
|
|
@@ -17167,8 +17290,8 @@ function toCheckoutTermsFields(copy, accepted) {
|
|
|
17167
17290
|
}
|
|
17168
17291
|
|
|
17169
17292
|
// src/components/checkout-pay-action.tsx
|
|
17170
|
-
var
|
|
17171
|
-
var
|
|
17293
|
+
var import_utils33 = require("@reblu/site-ui/utils");
|
|
17294
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
17172
17295
|
function CheckoutPayAction({
|
|
17173
17296
|
label,
|
|
17174
17297
|
notice,
|
|
@@ -17182,22 +17305,22 @@ function CheckoutPayAction({
|
|
|
17182
17305
|
}) {
|
|
17183
17306
|
const noticeId = `${id}-notice`;
|
|
17184
17307
|
const isDisabled = submitting || disabled;
|
|
17185
|
-
return /* @__PURE__ */ (0,
|
|
17186
|
-
/* @__PURE__ */ (0,
|
|
17308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { "data-slot": "checkout-pay-action", className: (0, import_utils33.cn)("space-y-3", className), children: [
|
|
17309
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
17187
17310
|
"button",
|
|
17188
17311
|
{
|
|
17189
17312
|
type: "submit",
|
|
17190
17313
|
disabled: isDisabled,
|
|
17191
17314
|
"aria-busy": submitting || void 0,
|
|
17192
17315
|
"aria-describedby": notice ? noticeId : void 0,
|
|
17193
|
-
className: buttonClassName ?? (0,
|
|
17316
|
+
className: buttonClassName ?? (0, import_utils33.cn)(
|
|
17194
17317
|
"flex w-full items-center justify-center gap-2 rounded-xl px-4 py-3 text-base font-semibold transition-all",
|
|
17195
17318
|
isDisabled ? "cursor-not-allowed bg-muted text-muted-foreground" : "cursor-pointer bg-primary text-primary-foreground hover:bg-primary/90"
|
|
17196
17319
|
),
|
|
17197
17320
|
children: submitting ? submittingLabel : label
|
|
17198
17321
|
}
|
|
17199
17322
|
),
|
|
17200
|
-
notice ? /* @__PURE__ */ (0,
|
|
17323
|
+
notice ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { id: noticeId, "data-slot": "checkout-pay-notice", className: noticeClassName ?? "text-sm text-muted-foreground", children: notice }) : null
|
|
17201
17324
|
] });
|
|
17202
17325
|
}
|
|
17203
17326
|
|
|
@@ -17224,8 +17347,8 @@ function toAcademyCheckoutInvoiceFields(value, overCap, issuesInvoices = true) {
|
|
|
17224
17347
|
}
|
|
17225
17348
|
|
|
17226
17349
|
// src/components/contact-interest-field.tsx
|
|
17227
|
-
var
|
|
17228
|
-
var
|
|
17350
|
+
var import_utils34 = require("@reblu/site-ui/utils");
|
|
17351
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
17229
17352
|
function ContactInterestField({
|
|
17230
17353
|
interest,
|
|
17231
17354
|
value,
|
|
@@ -17242,18 +17365,18 @@ function ContactInterestField({
|
|
|
17242
17365
|
else next2.delete(option2);
|
|
17243
17366
|
onChange(interest.options.filter((candidate) => next2.has(candidate)));
|
|
17244
17367
|
};
|
|
17245
|
-
return /* @__PURE__ */ (0,
|
|
17246
|
-
/* @__PURE__ */ (0,
|
|
17247
|
-
/* @__PURE__ */ (0,
|
|
17368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("fieldset", { "data-slot": "contact-interest", className: (0, import_utils34.cn)("space-y-2", className), children: [
|
|
17369
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("legend", { className: "text-sm font-medium", children: interest.label }),
|
|
17370
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex flex-col gap-2", children: interest.options.map((option2, index) => {
|
|
17248
17371
|
const id = `${idPrefix}-${index}`;
|
|
17249
|
-
return /* @__PURE__ */ (0,
|
|
17372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
17250
17373
|
"label",
|
|
17251
17374
|
{
|
|
17252
17375
|
htmlFor: id,
|
|
17253
17376
|
"data-slot": "contact-interest-option",
|
|
17254
17377
|
className: "flex items-center gap-2 text-sm",
|
|
17255
17378
|
children: [
|
|
17256
|
-
/* @__PURE__ */ (0,
|
|
17379
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
17257
17380
|
"input",
|
|
17258
17381
|
{
|
|
17259
17382
|
id,
|
|
@@ -17322,6 +17445,7 @@ var import_site_contracts = require("@reblu/site-contracts");
|
|
|
17322
17445
|
ImageTextSplit,
|
|
17323
17446
|
LegalDocument,
|
|
17324
17447
|
LessonPreview,
|
|
17448
|
+
LinkedPagesGrid,
|
|
17325
17449
|
MarkdownRenderer,
|
|
17326
17450
|
OrderConfirmation,
|
|
17327
17451
|
OrderInvoiceLink,
|
|
@@ -17336,6 +17460,7 @@ var import_site_contracts = require("@reblu/site-contracts");
|
|
|
17336
17460
|
SafeHtml,
|
|
17337
17461
|
ShopFilters,
|
|
17338
17462
|
Specialty,
|
|
17463
|
+
TeamGrid,
|
|
17339
17464
|
Treatment,
|
|
17340
17465
|
TrustBadges,
|
|
17341
17466
|
buildFaqPageJsonLd,
|
|
@@ -17345,11 +17470,14 @@ var import_site_contracts = require("@reblu/site-contracts");
|
|
|
17345
17470
|
collectFaqItems,
|
|
17346
17471
|
courseSellsAsGuest,
|
|
17347
17472
|
defaultCheckoutFulfillment,
|
|
17473
|
+
filterByLink,
|
|
17348
17474
|
formatPrice,
|
|
17349
17475
|
getShopErrorMessage,
|
|
17350
17476
|
isAllowedYouTubeHost,
|
|
17351
17477
|
isCheckoutDeliveryComplete,
|
|
17352
17478
|
isOverSimplifiedInvoiceCap,
|
|
17479
|
+
linkFilterOptions,
|
|
17480
|
+
linkKey,
|
|
17353
17481
|
markdownToPlainText,
|
|
17354
17482
|
markdownToSafeHtml,
|
|
17355
17483
|
quoteRequiresDelivery,
|