@reblu/site-blocks 0.27.0 → 0.29.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 +17 -0
- package/README.md +188 -1
- package/dist/index.cjs +757 -274
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +245 -5
- package/dist/index.d.ts +245 -5
- package/dist/index.js +744 -273
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -14297,6 +14297,33 @@ function FaqAccordion({
|
|
|
14297
14297
|
|
|
14298
14298
|
// src/components/trust-badges.tsx
|
|
14299
14299
|
import { cn as cn10 } from "@reblu/site-ui/utils";
|
|
14300
|
+
|
|
14301
|
+
// src/lib/trust-badge-media.ts
|
|
14302
|
+
var DEFAULT_ADHESION_NUMBER_LABEL = "N.\xBA de adhesi\xF3n";
|
|
14303
|
+
function safeHref(url) {
|
|
14304
|
+
if (typeof url !== "string") return null;
|
|
14305
|
+
try {
|
|
14306
|
+
const parsed = new URL(url);
|
|
14307
|
+
return parsed.protocol === "https:" || parsed.protocol === "http:" ? url : null;
|
|
14308
|
+
} catch {
|
|
14309
|
+
return null;
|
|
14310
|
+
}
|
|
14311
|
+
}
|
|
14312
|
+
function safeLogoSrc(url) {
|
|
14313
|
+
if (typeof url !== "string" || url === "") return null;
|
|
14314
|
+
if (url.startsWith("/")) return url.startsWith("//") || url.startsWith("/\\") ? null : url;
|
|
14315
|
+
return safeHref(url);
|
|
14316
|
+
}
|
|
14317
|
+
function adhesionNumberOf(badge) {
|
|
14318
|
+
const value = badge.adhesionNumber;
|
|
14319
|
+
return typeof value === "string" && value.trim() !== "" ? value.trim() : null;
|
|
14320
|
+
}
|
|
14321
|
+
function trustBadgeAlt(badge, numberLabel = DEFAULT_ADHESION_NUMBER_LABEL) {
|
|
14322
|
+
const number2 = adhesionNumberOf(badge);
|
|
14323
|
+
return number2 ? `${badge.name}. ${numberLabel} ${number2}` : badge.name;
|
|
14324
|
+
}
|
|
14325
|
+
|
|
14326
|
+
// src/components/trust-badges.tsx
|
|
14300
14327
|
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
14301
14328
|
var DEFAULT_TRUST_BADGE_HEADINGS = Object.freeze(
|
|
14302
14329
|
{
|
|
@@ -14304,7 +14331,8 @@ var DEFAULT_TRUST_BADGE_HEADINGS = Object.freeze(
|
|
|
14304
14331
|
INSURANCE: "Aseguradoras",
|
|
14305
14332
|
SUBVENTION: "Financiaci\xF3n",
|
|
14306
14333
|
CERTIFICATION: "Certificaciones",
|
|
14307
|
-
AWARD: "Premios"
|
|
14334
|
+
AWARD: "Premios",
|
|
14335
|
+
CONSUMER_ARBITRATION: "Arbitraje de consumo"
|
|
14308
14336
|
}
|
|
14309
14337
|
);
|
|
14310
14338
|
var DEFAULT_TRUST_BADGE_TYPE_ORDER = Object.freeze([
|
|
@@ -14314,26 +14342,12 @@ var DEFAULT_TRUST_BADGE_TYPE_ORDER = Object.freeze([
|
|
|
14314
14342
|
"PARTNER",
|
|
14315
14343
|
"INSURANCE"
|
|
14316
14344
|
]);
|
|
14317
|
-
var KNOWN_TYPES = new Set(
|
|
14345
|
+
var KNOWN_TYPES = new Set(Object.keys(DEFAULT_TRUST_BADGE_HEADINGS));
|
|
14318
14346
|
function isUsable(value) {
|
|
14319
14347
|
if (typeof value !== "object" || value === null) return false;
|
|
14320
14348
|
const entry = value;
|
|
14321
14349
|
return typeof entry.type === "string" && KNOWN_TYPES.has(entry.type) && typeof entry.name === "string" && entry.name.trim() !== "";
|
|
14322
14350
|
}
|
|
14323
|
-
function safeHref(url) {
|
|
14324
|
-
if (typeof url !== "string") return null;
|
|
14325
|
-
try {
|
|
14326
|
-
const parsed = new URL(url);
|
|
14327
|
-
return parsed.protocol === "https:" || parsed.protocol === "http:" ? url : null;
|
|
14328
|
-
} catch {
|
|
14329
|
-
return null;
|
|
14330
|
-
}
|
|
14331
|
-
}
|
|
14332
|
-
function safeLogoSrc(url) {
|
|
14333
|
-
if (typeof url !== "string" || url === "") return null;
|
|
14334
|
-
if (url.startsWith("/")) return url.startsWith("//") || url.startsWith("/\\") ? null : url;
|
|
14335
|
-
return safeHref(url);
|
|
14336
|
-
}
|
|
14337
14351
|
function BadgeContent({ badge, logoClassName }) {
|
|
14338
14352
|
const src = safeLogoSrc(badge.logoUrl);
|
|
14339
14353
|
if (src) {
|
|
@@ -14343,7 +14357,7 @@ function BadgeContent({ badge, logoClassName }) {
|
|
|
14343
14357
|
"img",
|
|
14344
14358
|
{
|
|
14345
14359
|
src,
|
|
14346
|
-
alt: badge
|
|
14360
|
+
alt: trustBadgeAlt(badge),
|
|
14347
14361
|
loading: "lazy",
|
|
14348
14362
|
className: cn10("h-12 w-auto object-contain", logoClassName)
|
|
14349
14363
|
}
|
|
@@ -14434,41 +14448,96 @@ function TrustBadges({
|
|
|
14434
14448
|
);
|
|
14435
14449
|
}
|
|
14436
14450
|
|
|
14437
|
-
// src/components/
|
|
14451
|
+
// src/components/arbitration-badge.tsx
|
|
14438
14452
|
import { cn as cn11 } from "@reblu/site-ui/utils";
|
|
14439
|
-
import { buttonVariants as buttonVariants2 } from "@reblu/site-ui/button-variants";
|
|
14440
14453
|
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
14454
|
+
function isArbitrationBadge(value) {
|
|
14455
|
+
if (typeof value !== "object" || value === null) return false;
|
|
14456
|
+
const entry = value;
|
|
14457
|
+
return entry.type === "CONSUMER_ARBITRATION" && typeof entry.name === "string" && entry.name.trim() !== "";
|
|
14458
|
+
}
|
|
14459
|
+
function ArbitrationBadge({
|
|
14460
|
+
badges,
|
|
14461
|
+
numberLabel = DEFAULT_ADHESION_NUMBER_LABEL,
|
|
14462
|
+
showNumber = true,
|
|
14463
|
+
newWindowLabel = "(se abre en una ventana nueva)",
|
|
14464
|
+
className,
|
|
14465
|
+
logoClassName,
|
|
14466
|
+
numberClassName
|
|
14467
|
+
}) {
|
|
14468
|
+
if (!Array.isArray(badges)) return null;
|
|
14469
|
+
const items = badges.filter(isArbitrationBadge);
|
|
14470
|
+
if (items.length === 0) return null;
|
|
14471
|
+
return /* @__PURE__ */ jsx17(
|
|
14472
|
+
"ul",
|
|
14473
|
+
{
|
|
14474
|
+
"data-slot": "arbitration-badges",
|
|
14475
|
+
className: cn11("flex flex-wrap items-start gap-6", className),
|
|
14476
|
+
children: items.map((badge) => {
|
|
14477
|
+
const src = safeLogoSrc(badge.logoUrl);
|
|
14478
|
+
const href = safeHref(badge.url);
|
|
14479
|
+
const number2 = adhesionNumberOf(badge);
|
|
14480
|
+
const caption = number2 && (showNumber || !src) ? /* @__PURE__ */ jsx17("span", { className: cn11("text-xs", numberClassName), "aria-hidden": src ? "true" : void 0, children: `${numberLabel} ${number2}` }) : null;
|
|
14481
|
+
const content = /* @__PURE__ */ jsxs16("span", { className: "inline-flex flex-col items-center gap-1 text-center", children: [
|
|
14482
|
+
src ? (
|
|
14483
|
+
// eslint-disable-next-line @next/next/no-img-element -- framework-agnostic SDK; the SITE owns image optimisation
|
|
14484
|
+
/* @__PURE__ */ jsx17(
|
|
14485
|
+
"img",
|
|
14486
|
+
{
|
|
14487
|
+
src,
|
|
14488
|
+
alt: trustBadgeAlt(badge, numberLabel),
|
|
14489
|
+
loading: "lazy",
|
|
14490
|
+
className: cn11("h-16 w-auto object-contain", logoClassName)
|
|
14491
|
+
}
|
|
14492
|
+
)
|
|
14493
|
+
) : /* @__PURE__ */ jsx17("span", { className: "text-sm font-medium", children: badge.name }),
|
|
14494
|
+
caption
|
|
14495
|
+
] });
|
|
14496
|
+
return /* @__PURE__ */ jsx17("li", { "data-slot": "arbitration-badge", children: href ? /* @__PURE__ */ jsxs16("a", { href, target: "_blank", rel: "noopener noreferrer", className: "inline-flex", children: [
|
|
14497
|
+
content,
|
|
14498
|
+
" ",
|
|
14499
|
+
/* @__PURE__ */ jsx17("span", { className: "sr-only", children: newWindowLabel })
|
|
14500
|
+
] }) : content }, badge.id);
|
|
14501
|
+
})
|
|
14502
|
+
}
|
|
14503
|
+
);
|
|
14504
|
+
}
|
|
14505
|
+
|
|
14506
|
+
// src/components/page-blocks.tsx
|
|
14507
|
+
import { cn as cn12 } from "@reblu/site-ui/utils";
|
|
14508
|
+
import { buttonVariants as buttonVariants2 } from "@reblu/site-ui/button-variants";
|
|
14509
|
+
import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
14441
14510
|
var ALIASES = {
|
|
14442
14511
|
doctor_embed: "profile_embed",
|
|
14443
14512
|
specialty_embed: "page_embed"
|
|
14444
14513
|
};
|
|
14445
14514
|
function HeroBlock({ block, headingLevel }) {
|
|
14446
14515
|
const { title, subtitle, imageUrl } = block.data;
|
|
14447
|
-
return /* @__PURE__ */
|
|
14448
|
-
/* @__PURE__ */
|
|
14449
|
-
subtitle && /* @__PURE__ */
|
|
14450
|
-
imageUrl && /* @__PURE__ */
|
|
14516
|
+
return /* @__PURE__ */ jsxs17("div", { className: "space-y-4", children: [
|
|
14517
|
+
/* @__PURE__ */ jsx18(Heading, { level: headingLevel, className: "text-3xl font-bold tracking-tight md:text-4xl", children: title }),
|
|
14518
|
+
subtitle && /* @__PURE__ */ jsx18("p", { className: "text-lg opacity-80", children: subtitle }),
|
|
14519
|
+
imageUrl && /* @__PURE__ */ jsx18("div", { className: "relative aspect-[21/9] w-full overflow-hidden rounded-xl bg-muted", children: /* @__PURE__ */ jsx18("img", { src: imageUrl, alt: "", loading: "lazy", className: "h-full w-full object-cover" }) })
|
|
14451
14520
|
] });
|
|
14452
14521
|
}
|
|
14453
14522
|
function RichtextBlock({ block, headingLevel }) {
|
|
14454
|
-
return /* @__PURE__ */
|
|
14523
|
+
return /* @__PURE__ */ jsx18(SafeHtml, { html: sanitizeHtml(block.data.html), headingOffset: headingLevel - 1 });
|
|
14455
14524
|
}
|
|
14456
14525
|
function FaqBlock({ block }) {
|
|
14457
|
-
return /* @__PURE__ */
|
|
14526
|
+
return /* @__PURE__ */ jsx18(FaqAccordion, { items: block.data.items });
|
|
14458
14527
|
}
|
|
14459
14528
|
function StatsBlock({ block }) {
|
|
14460
|
-
return /* @__PURE__ */
|
|
14461
|
-
/* @__PURE__ */
|
|
14462
|
-
/* @__PURE__ */
|
|
14529
|
+
return /* @__PURE__ */ jsx18("dl", { className: "grid gap-6 sm:grid-cols-2 lg:grid-cols-4", children: block.data.items.map((item, i) => /* @__PURE__ */ jsxs17("div", { className: "flex flex-col-reverse gap-1", children: [
|
|
14530
|
+
/* @__PURE__ */ jsx18("dt", { className: "text-sm opacity-80", children: item.label }),
|
|
14531
|
+
/* @__PURE__ */ jsx18("dd", { className: "text-3xl font-bold", children: item.value })
|
|
14463
14532
|
] }, i)) });
|
|
14464
14533
|
}
|
|
14465
14534
|
function TestimonialBlock({ block }) {
|
|
14466
14535
|
const { quote, author, role, avatarUrl } = block.data;
|
|
14467
|
-
return /* @__PURE__ */
|
|
14468
|
-
/* @__PURE__ */
|
|
14469
|
-
/* @__PURE__ */
|
|
14536
|
+
return /* @__PURE__ */ jsxs17("figure", { className: "space-y-4", children: [
|
|
14537
|
+
/* @__PURE__ */ jsx18("blockquote", { className: "text-xl italic", children: /* @__PURE__ */ jsx18("p", { children: quote }) }),
|
|
14538
|
+
/* @__PURE__ */ jsxs17("figcaption", { className: "flex items-center gap-3", children: [
|
|
14470
14539
|
avatarUrl && // eslint-disable-next-line @next/next/no-img-element
|
|
14471
|
-
/* @__PURE__ */
|
|
14540
|
+
/* @__PURE__ */ jsx18(
|
|
14472
14541
|
"img",
|
|
14473
14542
|
{
|
|
14474
14543
|
src: avatarUrl,
|
|
@@ -14477,9 +14546,9 @@ function TestimonialBlock({ block }) {
|
|
|
14477
14546
|
className: "h-10 w-10 rounded-full object-cover"
|
|
14478
14547
|
}
|
|
14479
14548
|
),
|
|
14480
|
-
/* @__PURE__ */
|
|
14481
|
-
/* @__PURE__ */
|
|
14482
|
-
role && /* @__PURE__ */
|
|
14549
|
+
/* @__PURE__ */ jsxs17("span", { children: [
|
|
14550
|
+
/* @__PURE__ */ jsx18("span", { className: "font-semibold", children: author }),
|
|
14551
|
+
role && /* @__PURE__ */ jsx18("span", { className: "block text-sm opacity-80", children: role })
|
|
14483
14552
|
] })
|
|
14484
14553
|
] })
|
|
14485
14554
|
] });
|
|
@@ -14488,19 +14557,19 @@ function CtaSlotBlock(_props) {
|
|
|
14488
14557
|
return null;
|
|
14489
14558
|
}
|
|
14490
14559
|
function FeatureListBlock({ block }) {
|
|
14491
|
-
return /* @__PURE__ */
|
|
14560
|
+
return /* @__PURE__ */ jsx18("ul", { className: "grid list-disc gap-2 pl-5 sm:grid-cols-2", children: block.data.items.map((item, i) => /* @__PURE__ */ jsx18("li", { children: item.text }, i)) });
|
|
14492
14561
|
}
|
|
14493
14562
|
function GalleryBlock({ block }) {
|
|
14494
14563
|
const { images } = block.data;
|
|
14495
|
-
return /* @__PURE__ */
|
|
14564
|
+
return /* @__PURE__ */ jsx18(
|
|
14496
14565
|
"div",
|
|
14497
14566
|
{
|
|
14498
|
-
className:
|
|
14567
|
+
className: cn12(
|
|
14499
14568
|
"grid gap-4",
|
|
14500
14569
|
images.length > 1 ? "sm:grid-cols-2 lg:grid-cols-3" : "grid-cols-1"
|
|
14501
14570
|
),
|
|
14502
|
-
children: images.map((img, i) => /* @__PURE__ */
|
|
14503
|
-
/* @__PURE__ */
|
|
14571
|
+
children: images.map((img, i) => /* @__PURE__ */ jsxs17("figure", { className: "space-y-1", children: [
|
|
14572
|
+
/* @__PURE__ */ jsx18("div", { className: "relative aspect-video w-full overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ jsx18(
|
|
14504
14573
|
"img",
|
|
14505
14574
|
{
|
|
14506
14575
|
src: img.url,
|
|
@@ -14509,7 +14578,7 @@ function GalleryBlock({ block }) {
|
|
|
14509
14578
|
className: "h-full w-full object-cover"
|
|
14510
14579
|
}
|
|
14511
14580
|
) }),
|
|
14512
|
-
img.caption && /* @__PURE__ */
|
|
14581
|
+
img.caption && /* @__PURE__ */ jsx18("figcaption", { className: "text-sm opacity-80", children: img.caption })
|
|
14513
14582
|
] }, `${img.url}-${i}`))
|
|
14514
14583
|
}
|
|
14515
14584
|
);
|
|
@@ -14519,13 +14588,13 @@ function EmbedCard({
|
|
|
14519
14588
|
headingLevel,
|
|
14520
14589
|
embedHref
|
|
14521
14590
|
}) {
|
|
14522
|
-
return /* @__PURE__ */
|
|
14591
|
+
return /* @__PURE__ */ jsxs17(
|
|
14523
14592
|
"a",
|
|
14524
14593
|
{
|
|
14525
14594
|
href: embedHref(resolved),
|
|
14526
14595
|
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",
|
|
14527
14596
|
children: [
|
|
14528
|
-
resolved.coverImageUrl && /* @__PURE__ */
|
|
14597
|
+
resolved.coverImageUrl && /* @__PURE__ */ jsx18("div", { className: "aspect-video w-full overflow-hidden bg-muted", children: /* @__PURE__ */ jsx18(
|
|
14529
14598
|
"img",
|
|
14530
14599
|
{
|
|
14531
14600
|
src: resolved.coverImageUrl,
|
|
@@ -14534,24 +14603,24 @@ function EmbedCard({
|
|
|
14534
14603
|
className: "h-full w-full object-cover"
|
|
14535
14604
|
}
|
|
14536
14605
|
) }),
|
|
14537
|
-
/* @__PURE__ */
|
|
14538
|
-
/* @__PURE__ */
|
|
14539
|
-
resolved.role && /* @__PURE__ */
|
|
14540
|
-
resolved.excerpt && /* @__PURE__ */
|
|
14606
|
+
/* @__PURE__ */ jsxs17("div", { className: "space-y-1 p-4", children: [
|
|
14607
|
+
/* @__PURE__ */ jsx18(Heading, { level: headingLevel, className: "text-lg font-semibold", children: resolved.title }),
|
|
14608
|
+
resolved.role && /* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground", children: resolved.role }),
|
|
14609
|
+
resolved.excerpt && /* @__PURE__ */ jsx18("p", { className: "text-muted-foreground", children: resolved.excerpt })
|
|
14541
14610
|
] })
|
|
14542
14611
|
]
|
|
14543
14612
|
}
|
|
14544
14613
|
);
|
|
14545
14614
|
}
|
|
14546
14615
|
function PageEmbedBlock({ block, headingLevel, embedHref }) {
|
|
14547
|
-
return /* @__PURE__ */
|
|
14616
|
+
return /* @__PURE__ */ jsx18(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
|
|
14548
14617
|
}
|
|
14549
14618
|
function ProfileEmbedBlock({
|
|
14550
14619
|
block,
|
|
14551
14620
|
headingLevel,
|
|
14552
14621
|
embedHref
|
|
14553
14622
|
}) {
|
|
14554
|
-
return /* @__PURE__ */
|
|
14623
|
+
return /* @__PURE__ */ jsx18(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
|
|
14555
14624
|
}
|
|
14556
14625
|
var DEFAULT_RENDERERS = {
|
|
14557
14626
|
hero: HeroBlock,
|
|
@@ -14608,14 +14677,14 @@ function toIdFragment(value) {
|
|
|
14608
14677
|
function SectionCta2({ cta }) {
|
|
14609
14678
|
if (!hasUsableCta(cta)) return null;
|
|
14610
14679
|
const variant = toButtonVariant(cta.variant);
|
|
14611
|
-
return /* @__PURE__ */
|
|
14680
|
+
return /* @__PURE__ */ jsx18("div", { className: "pt-2", children: /* @__PURE__ */ jsx18(
|
|
14612
14681
|
"a",
|
|
14613
14682
|
{
|
|
14614
14683
|
href: cta.url,
|
|
14615
14684
|
"data-slot": "button",
|
|
14616
14685
|
"data-variant": variant,
|
|
14617
14686
|
"data-size": "default",
|
|
14618
|
-
className:
|
|
14687
|
+
className: cn12(buttonVariants2({ variant, size: "default" })),
|
|
14619
14688
|
...cta.isExternal ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
14620
14689
|
children: cta.label
|
|
14621
14690
|
}
|
|
@@ -14641,17 +14710,17 @@ function PageBlocks({
|
|
|
14641
14710
|
const headingId = block.heading ? `${safePrefix}-${toIdFragment(block.id)}-heading` : void 0;
|
|
14642
14711
|
const background = block.backgroundColor;
|
|
14643
14712
|
return [
|
|
14644
|
-
/* @__PURE__ */
|
|
14713
|
+
/* @__PURE__ */ jsxs17(
|
|
14645
14714
|
"section",
|
|
14646
14715
|
{
|
|
14647
14716
|
"data-slot": "page-block",
|
|
14648
14717
|
"data-block-type": type,
|
|
14649
14718
|
"aria-labelledby": headingId,
|
|
14650
14719
|
style: surfaceStyle(background),
|
|
14651
|
-
className:
|
|
14720
|
+
className: cn12("space-y-6", background && "rounded-xl px-6 py-10", sectionClassName),
|
|
14652
14721
|
children: [
|
|
14653
|
-
block.heading && /* @__PURE__ */
|
|
14654
|
-
/* @__PURE__ */
|
|
14722
|
+
block.heading && /* @__PURE__ */ jsx18(Heading, { level: headingLevel, className: "text-2xl font-bold tracking-tight", children: /* @__PURE__ */ jsx18("span", { id: headingId, children: block.heading }) }),
|
|
14723
|
+
/* @__PURE__ */ jsx18(
|
|
14655
14724
|
Renderer,
|
|
14656
14725
|
{
|
|
14657
14726
|
block,
|
|
@@ -14659,7 +14728,7 @@ function PageBlocks({
|
|
|
14659
14728
|
embedHref
|
|
14660
14729
|
}
|
|
14661
14730
|
),
|
|
14662
|
-
/* @__PURE__ */
|
|
14731
|
+
/* @__PURE__ */ jsx18(SectionCta2, { cta: block.cta })
|
|
14663
14732
|
]
|
|
14664
14733
|
},
|
|
14665
14734
|
block.id
|
|
@@ -14667,12 +14736,12 @@ function PageBlocks({
|
|
|
14667
14736
|
];
|
|
14668
14737
|
});
|
|
14669
14738
|
if (sections.length === 0) return null;
|
|
14670
|
-
return /* @__PURE__ */
|
|
14739
|
+
return /* @__PURE__ */ jsx18("div", { className: cn12("space-y-12", className), "data-slot": "page-blocks", children: sections });
|
|
14671
14740
|
}
|
|
14672
14741
|
|
|
14673
14742
|
// src/components/shop-filters.tsx
|
|
14674
|
-
import { cn as
|
|
14675
|
-
import { jsx as
|
|
14743
|
+
import { cn as cn13 } from "@reblu/site-ui/utils";
|
|
14744
|
+
import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
14676
14745
|
var DEFAULT_SHOP_PRICE_BANDS = [
|
|
14677
14746
|
{ max: 2500 },
|
|
14678
14747
|
{ min: 2500, max: 5e3 },
|
|
@@ -14716,7 +14785,7 @@ function priceBandLabel(band, t, currencyCode, locale) {
|
|
|
14716
14785
|
return "";
|
|
14717
14786
|
}
|
|
14718
14787
|
function OptionLink({ href, active, label, onActivate }) {
|
|
14719
|
-
return /* @__PURE__ */
|
|
14788
|
+
return /* @__PURE__ */ jsx19(
|
|
14720
14789
|
"a",
|
|
14721
14790
|
{
|
|
14722
14791
|
href,
|
|
@@ -14725,7 +14794,7 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
14725
14794
|
event.preventDefault();
|
|
14726
14795
|
onActivate();
|
|
14727
14796
|
} : void 0,
|
|
14728
|
-
className:
|
|
14797
|
+
className: cn13(
|
|
14729
14798
|
"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",
|
|
14730
14799
|
active ? "border-transparent bg-primary text-primary-foreground" : "border-border text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
14731
14800
|
),
|
|
@@ -14734,9 +14803,9 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
14734
14803
|
);
|
|
14735
14804
|
}
|
|
14736
14805
|
function FilterFieldset({ legend, children: children2 }) {
|
|
14737
|
-
return /* @__PURE__ */
|
|
14738
|
-
/* @__PURE__ */
|
|
14739
|
-
/* @__PURE__ */
|
|
14806
|
+
return /* @__PURE__ */ jsxs18("fieldset", { className: "space-y-2", children: [
|
|
14807
|
+
/* @__PURE__ */ jsx19("legend", { className: "text-sm font-medium text-foreground", children: legend }),
|
|
14808
|
+
/* @__PURE__ */ jsx19("div", { className: "flex flex-wrap gap-2", children: children2 })
|
|
14740
14809
|
] });
|
|
14741
14810
|
}
|
|
14742
14811
|
function ShopFilters({
|
|
@@ -14759,11 +14828,11 @@ function ShopFilters({
|
|
|
14759
14828
|
if (!shouldRenderShopFilters(facets, active)) {
|
|
14760
14829
|
return null;
|
|
14761
14830
|
}
|
|
14762
|
-
return /* @__PURE__ */
|
|
14831
|
+
return /* @__PURE__ */ jsxs18("div", { className: cn13("space-y-6", className), "data-slot": "shop-filters", children: [
|
|
14763
14832
|
visibleTaxonomies.map((axis) => {
|
|
14764
14833
|
const activeSlug = active.taxonomy?.[axis.key];
|
|
14765
|
-
return /* @__PURE__ */
|
|
14766
|
-
/* @__PURE__ */
|
|
14834
|
+
return /* @__PURE__ */ jsxs18(FilterFieldset, { legend: axis.label, children: [
|
|
14835
|
+
/* @__PURE__ */ jsx19(
|
|
14767
14836
|
OptionLink,
|
|
14768
14837
|
{
|
|
14769
14838
|
href: hrefs.taxonomy(axis.key, void 0),
|
|
@@ -14778,7 +14847,7 @@ function ShopFilters({
|
|
|
14778
14847
|
),
|
|
14779
14848
|
axis.terms.map((term) => {
|
|
14780
14849
|
const isActive = activeSlug === term.slug;
|
|
14781
|
-
return /* @__PURE__ */
|
|
14850
|
+
return /* @__PURE__ */ jsx19(
|
|
14782
14851
|
OptionLink,
|
|
14783
14852
|
{
|
|
14784
14853
|
href: hrefs.taxonomy(axis.key, isActive ? void 0 : term.slug),
|
|
@@ -14798,9 +14867,9 @@ function ShopFilters({
|
|
|
14798
14867
|
}),
|
|
14799
14868
|
visibleAttributes.map((attr) => {
|
|
14800
14869
|
const activeValues = toValueArray(active.attr?.[attr.key]);
|
|
14801
|
-
return /* @__PURE__ */
|
|
14870
|
+
return /* @__PURE__ */ jsx19(FilterFieldset, { legend: attr.label, children: attr.options.map((opt) => {
|
|
14802
14871
|
const isActive = activeValues.includes(opt.value);
|
|
14803
|
-
return /* @__PURE__ */
|
|
14872
|
+
return /* @__PURE__ */ jsx19(
|
|
14804
14873
|
OptionLink,
|
|
14805
14874
|
{
|
|
14806
14875
|
href: hrefs.attr(attr.key, opt.value),
|
|
@@ -14818,11 +14887,11 @@ function ShopFilters({
|
|
|
14818
14887
|
);
|
|
14819
14888
|
}) }, attr.key);
|
|
14820
14889
|
}),
|
|
14821
|
-
showPriceGroup && /* @__PURE__ */
|
|
14890
|
+
showPriceGroup && /* @__PURE__ */ jsx19(FilterFieldset, { legend: t.price, children: priceBands.map((band, i) => {
|
|
14822
14891
|
const isActive = active.priceMin === band.min && active.priceMax === band.max;
|
|
14823
14892
|
const nextMin = isActive ? void 0 : band.min;
|
|
14824
14893
|
const nextMax = isActive ? void 0 : band.max;
|
|
14825
|
-
return /* @__PURE__ */
|
|
14894
|
+
return /* @__PURE__ */ jsx19(
|
|
14826
14895
|
OptionLink,
|
|
14827
14896
|
{
|
|
14828
14897
|
href: hrefs.price(nextMin, nextMax),
|
|
@@ -14833,7 +14902,7 @@ function ShopFilters({
|
|
|
14833
14902
|
i
|
|
14834
14903
|
);
|
|
14835
14904
|
}) }),
|
|
14836
|
-
hasOnSale && /* @__PURE__ */
|
|
14905
|
+
hasOnSale && /* @__PURE__ */ jsx19(
|
|
14837
14906
|
OptionLink,
|
|
14838
14907
|
{
|
|
14839
14908
|
href: hrefs.onSale(!active.onSale),
|
|
@@ -14842,7 +14911,7 @@ function ShopFilters({
|
|
|
14842
14911
|
onActivate: onChange ? () => onChange({ onSale: !active.onSale }) : void 0
|
|
14843
14912
|
}
|
|
14844
14913
|
),
|
|
14845
|
-
/* @__PURE__ */
|
|
14914
|
+
/* @__PURE__ */ jsx19(
|
|
14846
14915
|
"a",
|
|
14847
14916
|
{
|
|
14848
14917
|
href: hrefs.clearAll(),
|
|
@@ -14858,8 +14927,8 @@ function ShopFilters({
|
|
|
14858
14927
|
}
|
|
14859
14928
|
|
|
14860
14929
|
// src/components/course-catalog-filters.tsx
|
|
14861
|
-
import { cn as
|
|
14862
|
-
import { jsx as
|
|
14930
|
+
import { cn as cn14 } from "@reblu/site-ui/utils";
|
|
14931
|
+
import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
14863
14932
|
var DEFAULT_COURSE_PRICE_BANDS = [
|
|
14864
14933
|
{ max: 5e3 },
|
|
14865
14934
|
{ min: 5e3, max: 15e3 },
|
|
@@ -14912,9 +14981,9 @@ function CourseCatalogFilters({
|
|
|
14912
14981
|
const showPrice = enabled.price !== false;
|
|
14913
14982
|
const isFree = Boolean(active.free);
|
|
14914
14983
|
if (!showCategories && !showInstructors && !showPrice) return null;
|
|
14915
|
-
return /* @__PURE__ */
|
|
14916
|
-
showCategories && /* @__PURE__ */
|
|
14917
|
-
/* @__PURE__ */
|
|
14984
|
+
return /* @__PURE__ */ jsxs19("div", { className: cn14("space-y-6", className), "data-slot": "course-catalog-filters", children: [
|
|
14985
|
+
showCategories && /* @__PURE__ */ jsxs19(FilterFieldset, { legend: t.category, children: [
|
|
14986
|
+
/* @__PURE__ */ jsx20(
|
|
14918
14987
|
OptionLink,
|
|
14919
14988
|
{
|
|
14920
14989
|
href: categoryHref(void 0),
|
|
@@ -14926,7 +14995,7 @@ function CourseCatalogFilters({
|
|
|
14926
14995
|
sortedCategories.map((category) => {
|
|
14927
14996
|
const isActive = active.category === category.slug;
|
|
14928
14997
|
const next2 = isActive ? void 0 : category.slug;
|
|
14929
|
-
return /* @__PURE__ */
|
|
14998
|
+
return /* @__PURE__ */ jsx20(
|
|
14930
14999
|
OptionLink,
|
|
14931
15000
|
{
|
|
14932
15001
|
href: categoryHref(next2),
|
|
@@ -14938,8 +15007,8 @@ function CourseCatalogFilters({
|
|
|
14938
15007
|
);
|
|
14939
15008
|
})
|
|
14940
15009
|
] }),
|
|
14941
|
-
showInstructors && /* @__PURE__ */
|
|
14942
|
-
/* @__PURE__ */
|
|
15010
|
+
showInstructors && /* @__PURE__ */ jsxs19(FilterFieldset, { legend: t.instructor, children: [
|
|
15011
|
+
/* @__PURE__ */ jsx20(
|
|
14943
15012
|
OptionLink,
|
|
14944
15013
|
{
|
|
14945
15014
|
href: hrefs.instructor(void 0),
|
|
@@ -14951,7 +15020,7 @@ function CourseCatalogFilters({
|
|
|
14951
15020
|
named.map((instructor) => {
|
|
14952
15021
|
const isActive = active.instructor === instructor.id;
|
|
14953
15022
|
const next2 = isActive ? void 0 : instructor.id;
|
|
14954
|
-
return /* @__PURE__ */
|
|
15023
|
+
return /* @__PURE__ */ jsx20(
|
|
14955
15024
|
OptionLink,
|
|
14956
15025
|
{
|
|
14957
15026
|
href: hrefs.instructor(next2),
|
|
@@ -14963,8 +15032,8 @@ function CourseCatalogFilters({
|
|
|
14963
15032
|
);
|
|
14964
15033
|
})
|
|
14965
15034
|
] }),
|
|
14966
|
-
showPrice && /* @__PURE__ */
|
|
14967
|
-
/* @__PURE__ */
|
|
15035
|
+
showPrice && /* @__PURE__ */ jsxs19(FilterFieldset, { legend: t.price, children: [
|
|
15036
|
+
/* @__PURE__ */ jsx20(
|
|
14968
15037
|
OptionLink,
|
|
14969
15038
|
{
|
|
14970
15039
|
href: hrefs.free(!isFree),
|
|
@@ -14979,7 +15048,7 @@ function CourseCatalogFilters({
|
|
|
14979
15048
|
const isActive = !isFree && active.priceMin === band.min && active.priceMax === band.max;
|
|
14980
15049
|
const nextMin = isActive ? void 0 : band.min;
|
|
14981
15050
|
const nextMax = isActive ? void 0 : band.max;
|
|
14982
|
-
return /* @__PURE__ */
|
|
15051
|
+
return /* @__PURE__ */ jsx20(
|
|
14983
15052
|
OptionLink,
|
|
14984
15053
|
{
|
|
14985
15054
|
href: hrefs.price(nextMin, nextMax),
|
|
@@ -14991,7 +15060,7 @@ function CourseCatalogFilters({
|
|
|
14991
15060
|
);
|
|
14992
15061
|
})
|
|
14993
15062
|
] }),
|
|
14994
|
-
/* @__PURE__ */
|
|
15063
|
+
/* @__PURE__ */ jsx20(
|
|
14995
15064
|
"a",
|
|
14996
15065
|
{
|
|
14997
15066
|
href: hrefs.clearAll(),
|
|
@@ -15013,8 +15082,8 @@ function CourseCatalogFilters({
|
|
|
15013
15082
|
}
|
|
15014
15083
|
|
|
15015
15084
|
// src/components/cart-line-list.tsx
|
|
15016
|
-
import { cn as
|
|
15017
|
-
import { jsx as
|
|
15085
|
+
import { cn as cn15 } from "@reblu/site-ui/utils";
|
|
15086
|
+
import { jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
15018
15087
|
var DEFAULT_LABELS2 = {
|
|
15019
15088
|
quantityLabel: "Cantidad",
|
|
15020
15089
|
decrease: "Reducir cantidad",
|
|
@@ -15040,9 +15109,9 @@ function CartLineList({
|
|
|
15040
15109
|
}) {
|
|
15041
15110
|
const t = { ...DEFAULT_LABELS2, ...labels };
|
|
15042
15111
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
15043
|
-
return /* @__PURE__ */
|
|
15044
|
-
/* @__PURE__ */
|
|
15045
|
-
noticeContent != null && noticeContent !== false && /* @__PURE__ */
|
|
15112
|
+
return /* @__PURE__ */ jsxs20("div", { className: cn15("space-y-4", className), "data-slot": "cart-line-list", children: [
|
|
15113
|
+
/* @__PURE__ */ jsx21("div", { "aria-live": "polite", className: "sr-only", children: liveMessage }),
|
|
15114
|
+
noticeContent != null && noticeContent !== false && /* @__PURE__ */ jsx21(
|
|
15046
15115
|
"div",
|
|
15047
15116
|
{
|
|
15048
15117
|
role: "status",
|
|
@@ -15051,33 +15120,33 @@ function CartLineList({
|
|
|
15051
15120
|
children: noticeContent
|
|
15052
15121
|
}
|
|
15053
15122
|
),
|
|
15054
|
-
/* @__PURE__ */
|
|
15123
|
+
/* @__PURE__ */ jsx21("ul", { className: "space-y-4", children: items.map((item) => {
|
|
15055
15124
|
const maxQty = item.maxStock ?? Infinity;
|
|
15056
15125
|
const atMax = item.quantity >= maxQty;
|
|
15057
15126
|
const atMin = item.quantity <= 1;
|
|
15058
15127
|
const message = lineMessage?.(item);
|
|
15059
|
-
return /* @__PURE__ */
|
|
15128
|
+
return /* @__PURE__ */ jsxs20(
|
|
15060
15129
|
"li",
|
|
15061
15130
|
{
|
|
15062
15131
|
className: "flex gap-4 rounded-xl border border-border bg-card p-4",
|
|
15063
15132
|
children: [
|
|
15064
|
-
/* @__PURE__ */
|
|
15065
|
-
/* @__PURE__ */
|
|
15066
|
-
/* @__PURE__ */
|
|
15067
|
-
item.variantName && /* @__PURE__ */
|
|
15068
|
-
/* @__PURE__ */
|
|
15133
|
+
/* @__PURE__ */ jsx21("div", { className: "h-20 w-20 flex-shrink-0 overflow-hidden rounded-lg bg-muted", children: item.imageUrl ? /* @__PURE__ */ jsx21("img", { src: item.imageUrl, alt: item.name, className: "h-full w-full object-cover" }) : null }),
|
|
15134
|
+
/* @__PURE__ */ jsxs20("div", { className: "min-w-0 flex-1", children: [
|
|
15135
|
+
/* @__PURE__ */ jsx21("p", { className: "truncate text-sm font-semibold leading-tight", children: item.name }),
|
|
15136
|
+
item.variantName && /* @__PURE__ */ jsx21("p", { className: "mt-0.5 text-xs text-muted-foreground", children: item.variantName }),
|
|
15137
|
+
/* @__PURE__ */ jsxs20("p", { className: "mt-1 text-sm text-muted-foreground", children: [
|
|
15069
15138
|
formatPrice(item.unitPrice, currencyCode, locale),
|
|
15070
15139
|
" ",
|
|
15071
15140
|
t.unitPriceSuffix
|
|
15072
15141
|
] }),
|
|
15073
|
-
/* @__PURE__ */
|
|
15142
|
+
/* @__PURE__ */ jsxs20(
|
|
15074
15143
|
"div",
|
|
15075
15144
|
{
|
|
15076
15145
|
role: "group",
|
|
15077
15146
|
"aria-label": t.quantityLabel,
|
|
15078
15147
|
className: "mt-3 flex items-center gap-3",
|
|
15079
15148
|
children: [
|
|
15080
|
-
/* @__PURE__ */
|
|
15149
|
+
/* @__PURE__ */ jsx21(
|
|
15081
15150
|
"button",
|
|
15082
15151
|
{
|
|
15083
15152
|
type: "button",
|
|
@@ -15088,8 +15157,8 @@ function CartLineList({
|
|
|
15088
15157
|
children: "\u2212"
|
|
15089
15158
|
}
|
|
15090
15159
|
),
|
|
15091
|
-
/* @__PURE__ */
|
|
15092
|
-
/* @__PURE__ */
|
|
15160
|
+
/* @__PURE__ */ jsx21("span", { className: "w-8 text-center text-sm font-semibold tabular-nums", children: item.quantity }),
|
|
15161
|
+
/* @__PURE__ */ jsx21(
|
|
15093
15162
|
"button",
|
|
15094
15163
|
{
|
|
15095
15164
|
type: "button",
|
|
@@ -15100,7 +15169,7 @@ function CartLineList({
|
|
|
15100
15169
|
children: "+"
|
|
15101
15170
|
}
|
|
15102
15171
|
),
|
|
15103
|
-
onRemove && /* @__PURE__ */
|
|
15172
|
+
onRemove && /* @__PURE__ */ jsx21(
|
|
15104
15173
|
"button",
|
|
15105
15174
|
{
|
|
15106
15175
|
type: "button",
|
|
@@ -15113,7 +15182,7 @@ function CartLineList({
|
|
|
15113
15182
|
]
|
|
15114
15183
|
}
|
|
15115
15184
|
),
|
|
15116
|
-
message != null && message !== false && /* @__PURE__ */
|
|
15185
|
+
message != null && message !== false && /* @__PURE__ */ jsx21(
|
|
15117
15186
|
"p",
|
|
15118
15187
|
{
|
|
15119
15188
|
className: "mt-2 text-sm text-destructive",
|
|
@@ -15122,7 +15191,7 @@ function CartLineList({
|
|
|
15122
15191
|
}
|
|
15123
15192
|
)
|
|
15124
15193
|
] }),
|
|
15125
|
-
/* @__PURE__ */
|
|
15194
|
+
/* @__PURE__ */ jsx21("div", { className: "flex-shrink-0 text-right", children: /* @__PURE__ */ jsx21("p", { className: "text-base font-bold", children: formatPrice(item.unitPrice * item.quantity, currencyCode, locale) }) })
|
|
15126
15195
|
]
|
|
15127
15196
|
},
|
|
15128
15197
|
lineKey(item.productId, item.variantId)
|
|
@@ -15132,8 +15201,8 @@ function CartLineList({
|
|
|
15132
15201
|
}
|
|
15133
15202
|
|
|
15134
15203
|
// src/components/cart-summary.tsx
|
|
15135
|
-
import { cn as
|
|
15136
|
-
import { jsx as
|
|
15204
|
+
import { cn as cn16 } from "@reblu/site-ui/utils";
|
|
15205
|
+
import { jsx as jsx22, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
15137
15206
|
var DEFAULT_LABELS3 = {
|
|
15138
15207
|
subtotal: "Subtotal",
|
|
15139
15208
|
discountPrefix: "Descuento",
|
|
@@ -15163,37 +15232,37 @@ function CartSummary({
|
|
|
15163
15232
|
const hasDiscount = Boolean(discountAmount && discountAmount > 0);
|
|
15164
15233
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
15165
15234
|
const hasNotice = noticeContent != null && noticeContent !== false;
|
|
15166
|
-
const breakdown = /* @__PURE__ */
|
|
15235
|
+
const breakdown = /* @__PURE__ */ jsxs21(
|
|
15167
15236
|
"dl",
|
|
15168
15237
|
{
|
|
15169
|
-
className:
|
|
15238
|
+
className: cn16("space-y-2 text-sm", !hasNotice && className),
|
|
15170
15239
|
"data-slot": "cart-summary",
|
|
15171
15240
|
children: [
|
|
15172
|
-
/* @__PURE__ */
|
|
15173
|
-
/* @__PURE__ */
|
|
15174
|
-
/* @__PURE__ */
|
|
15241
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
15242
|
+
/* @__PURE__ */ jsx22("dt", { children: t.subtotal }),
|
|
15243
|
+
/* @__PURE__ */ jsx22("dd", { children: formatPrice(subtotal, currencyCode, locale) })
|
|
15175
15244
|
] }),
|
|
15176
|
-
hasDiscount && /* @__PURE__ */
|
|
15177
|
-
/* @__PURE__ */
|
|
15178
|
-
/* @__PURE__ */
|
|
15245
|
+
hasDiscount && /* @__PURE__ */ jsxs21("div", { className: "flex justify-between text-green-600 dark:text-green-400", children: [
|
|
15246
|
+
/* @__PURE__ */ jsx22("dt", { children: autoDiscount ? t.staffDiscountApplied : `${t.discountPrefix}${discountCode ? ` (${discountCode})` : ""}` }),
|
|
15247
|
+
/* @__PURE__ */ jsxs21("dd", { children: [
|
|
15179
15248
|
"-",
|
|
15180
15249
|
formatPrice(discountAmount, currencyCode, locale)
|
|
15181
15250
|
] })
|
|
15182
15251
|
] }),
|
|
15183
|
-
shippingEnabled && /* @__PURE__ */
|
|
15184
|
-
/* @__PURE__ */
|
|
15185
|
-
/* @__PURE__ */
|
|
15252
|
+
shippingEnabled && /* @__PURE__ */ jsxs21("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
15253
|
+
/* @__PURE__ */ jsx22("dt", { children: t.shipping }),
|
|
15254
|
+
/* @__PURE__ */ jsx22("dd", { children: shipping == null || !Number.isFinite(shipping) ? t.shippingCalculated : shipping === 0 ? t.freeShipping : formatPrice(shipping, currencyCode, locale) })
|
|
15186
15255
|
] }),
|
|
15187
|
-
/* @__PURE__ */
|
|
15188
|
-
/* @__PURE__ */
|
|
15189
|
-
/* @__PURE__ */
|
|
15256
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex justify-between border-t border-border pt-2 text-base font-bold", children: [
|
|
15257
|
+
/* @__PURE__ */ jsx22("dt", { children: t.total }),
|
|
15258
|
+
/* @__PURE__ */ jsx22("dd", { children: formatPrice(total, currencyCode, locale) })
|
|
15190
15259
|
] })
|
|
15191
15260
|
]
|
|
15192
15261
|
}
|
|
15193
15262
|
);
|
|
15194
15263
|
if (!hasNotice) return breakdown;
|
|
15195
|
-
return /* @__PURE__ */
|
|
15196
|
-
/* @__PURE__ */
|
|
15264
|
+
return /* @__PURE__ */ jsxs21("div", { className: cn16("space-y-3", className), "data-slot": "cart-summary-wrapper", children: [
|
|
15265
|
+
/* @__PURE__ */ jsx22(
|
|
15197
15266
|
"div",
|
|
15198
15267
|
{
|
|
15199
15268
|
role: "status",
|
|
@@ -15207,8 +15276,8 @@ function CartSummary({
|
|
|
15207
15276
|
}
|
|
15208
15277
|
|
|
15209
15278
|
// src/components/cart-adjustments-notice.tsx
|
|
15210
|
-
import { cn as
|
|
15211
|
-
import { jsx as
|
|
15279
|
+
import { cn as cn17 } from "@reblu/site-ui/utils";
|
|
15280
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
15212
15281
|
var DEFAULT_LABELS4 = {
|
|
15213
15282
|
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.`,
|
|
15214
15283
|
quantityChanged: (name, quantity) => `Hemos ajustado la cantidad de ${name} a ${quantity} por el stock disponible.`,
|
|
@@ -15242,20 +15311,20 @@ function CartAdjustmentsNotice({
|
|
|
15242
15311
|
);
|
|
15243
15312
|
}
|
|
15244
15313
|
if (messages.length === 0) return null;
|
|
15245
|
-
return /* @__PURE__ */
|
|
15314
|
+
return /* @__PURE__ */ jsx23(
|
|
15246
15315
|
"div",
|
|
15247
15316
|
{
|
|
15248
15317
|
role: "status",
|
|
15249
|
-
className:
|
|
15318
|
+
className: cn17("rounded-lg border border-border bg-muted px-3 py-2 text-sm", className),
|
|
15250
15319
|
"data-slot": "cart-adjustments-notice",
|
|
15251
|
-
children: messages.length === 1 ? /* @__PURE__ */
|
|
15320
|
+
children: messages.length === 1 ? /* @__PURE__ */ jsx23("p", { children: messages[0] }) : /* @__PURE__ */ jsx23("ul", { className: "list-disc space-y-1 pl-4", children: messages.map((message, index) => /* @__PURE__ */ jsx23("li", { children: message }, index)) })
|
|
15252
15321
|
}
|
|
15253
15322
|
);
|
|
15254
15323
|
}
|
|
15255
15324
|
|
|
15256
15325
|
// src/components/added-to-cart-toast.tsx
|
|
15257
|
-
import { cn as
|
|
15258
|
-
import { jsx as
|
|
15326
|
+
import { cn as cn18 } from "@reblu/site-ui/utils";
|
|
15327
|
+
import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
15259
15328
|
var DEFAULT_LABELS5 = {
|
|
15260
15329
|
success: "A\xF1adido al carrito",
|
|
15261
15330
|
error: "No se pudo a\xF1adir al carrito",
|
|
@@ -15275,12 +15344,12 @@ function AddedToCartToast({
|
|
|
15275
15344
|
const message = status === "error" ? t.error : status === "outOfStock" ? t.outOfStock : t.success;
|
|
15276
15345
|
const hasThumbnail = Boolean(imageUrl && imageUrl.trim().length > 0);
|
|
15277
15346
|
const variant = status === "success" ? "success" : "error";
|
|
15278
|
-
return /* @__PURE__ */
|
|
15347
|
+
return /* @__PURE__ */ jsxs22(
|
|
15279
15348
|
"div",
|
|
15280
15349
|
{
|
|
15281
15350
|
"data-slot": "added-to-cart-toast",
|
|
15282
15351
|
"data-variant": variant,
|
|
15283
|
-
className:
|
|
15352
|
+
className: cn18(
|
|
15284
15353
|
"flex items-center gap-3 rounded-xl border border-border bg-card p-3 text-sm shadow-lg",
|
|
15285
15354
|
variant === "success" && "border-green-600/30 dark:border-green-400/30",
|
|
15286
15355
|
variant === "error" && "border-destructive/30",
|
|
@@ -15288,20 +15357,20 @@ function AddedToCartToast({
|
|
|
15288
15357
|
),
|
|
15289
15358
|
children: [
|
|
15290
15359
|
hasThumbnail && // eslint-disable-next-line @next/next/no-img-element -- toast content, not a Next <Image> layout context
|
|
15291
|
-
/* @__PURE__ */
|
|
15292
|
-
/* @__PURE__ */
|
|
15293
|
-
/* @__PURE__ */
|
|
15294
|
-
/* @__PURE__ */
|
|
15360
|
+
/* @__PURE__ */ jsx24("img", { src: imageUrl, alt: productName, className: "h-10 w-10 flex-shrink-0 rounded-lg object-cover" }),
|
|
15361
|
+
/* @__PURE__ */ jsxs22("div", { className: "min-w-0 flex-1", children: [
|
|
15362
|
+
/* @__PURE__ */ jsx24("p", { className: "truncate font-semibold text-foreground", children: productName }),
|
|
15363
|
+
/* @__PURE__ */ jsx24("p", { className: "truncate text-muted-foreground", children: quantity && quantity > 1 ? `${message} \xB7 x${quantity}` : message })
|
|
15295
15364
|
] }),
|
|
15296
|
-
/* @__PURE__ */
|
|
15365
|
+
/* @__PURE__ */ jsx24("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx24("a", { href: cartHref, className: "text-sm font-semibold text-primary underline-offset-2 hover:underline", children: t.viewCart }) })
|
|
15297
15366
|
]
|
|
15298
15367
|
}
|
|
15299
15368
|
);
|
|
15300
15369
|
}
|
|
15301
15370
|
|
|
15302
15371
|
// src/components/checkout-login-prompt.tsx
|
|
15303
|
-
import { cn as
|
|
15304
|
-
import { Fragment as Fragment4, jsx as
|
|
15372
|
+
import { cn as cn19 } from "@reblu/site-ui/utils";
|
|
15373
|
+
import { Fragment as Fragment4, jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
15305
15374
|
var DEFAULT_LABELS6 = {
|
|
15306
15375
|
title: "Identificaci\xF3n",
|
|
15307
15376
|
description: "Introduce tu email para agilizar el proceso o contin\xFAa como invitado.",
|
|
@@ -15328,26 +15397,26 @@ function CheckoutLoginPrompt({
|
|
|
15328
15397
|
if (!open) return null;
|
|
15329
15398
|
const t = { ...DEFAULT_LABELS6, ...labels };
|
|
15330
15399
|
const isValidEmail = EMAIL_PATTERN.test(email.trim());
|
|
15331
|
-
return /* @__PURE__ */
|
|
15332
|
-
/* @__PURE__ */
|
|
15333
|
-
/* @__PURE__ */
|
|
15400
|
+
return /* @__PURE__ */ jsxs23(Fragment4, { children: [
|
|
15401
|
+
/* @__PURE__ */ jsx25("div", { className: "fixed inset-0 z-50 bg-black/50", onClick: onClose, "aria-hidden": "true" }),
|
|
15402
|
+
/* @__PURE__ */ jsxs23(
|
|
15334
15403
|
"div",
|
|
15335
15404
|
{
|
|
15336
15405
|
role: "dialog",
|
|
15337
15406
|
"aria-modal": "true",
|
|
15338
15407
|
"aria-labelledby": "checkout-login-prompt-title",
|
|
15339
15408
|
"data-slot": "checkout-login-prompt",
|
|
15340
|
-
className:
|
|
15409
|
+
className: cn19(
|
|
15341
15410
|
"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",
|
|
15342
15411
|
className
|
|
15343
15412
|
),
|
|
15344
15413
|
children: [
|
|
15345
|
-
/* @__PURE__ */
|
|
15346
|
-
/* @__PURE__ */
|
|
15347
|
-
/* @__PURE__ */
|
|
15348
|
-
/* @__PURE__ */
|
|
15414
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-start justify-between gap-3", children: [
|
|
15415
|
+
/* @__PURE__ */ jsxs23("div", { children: [
|
|
15416
|
+
/* @__PURE__ */ jsx25("h2", { id: "checkout-login-prompt-title", className: "text-xl font-bold", children: t.title }),
|
|
15417
|
+
/* @__PURE__ */ jsx25("p", { className: "mt-1 text-sm text-muted-foreground", children: t.description })
|
|
15349
15418
|
] }),
|
|
15350
|
-
/* @__PURE__ */
|
|
15419
|
+
/* @__PURE__ */ jsx25(
|
|
15351
15420
|
"button",
|
|
15352
15421
|
{
|
|
15353
15422
|
type: "button",
|
|
@@ -15358,9 +15427,9 @@ function CheckoutLoginPrompt({
|
|
|
15358
15427
|
}
|
|
15359
15428
|
)
|
|
15360
15429
|
] }),
|
|
15361
|
-
/* @__PURE__ */
|
|
15362
|
-
/* @__PURE__ */
|
|
15363
|
-
/* @__PURE__ */
|
|
15430
|
+
/* @__PURE__ */ jsxs23("div", { className: "space-y-2", children: [
|
|
15431
|
+
/* @__PURE__ */ jsx25("label", { htmlFor: "checkout-login-prompt-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
15432
|
+
/* @__PURE__ */ jsx25(
|
|
15364
15433
|
"input",
|
|
15365
15434
|
{
|
|
15366
15435
|
id: "checkout-login-prompt-email",
|
|
@@ -15369,29 +15438,29 @@ function CheckoutLoginPrompt({
|
|
|
15369
15438
|
value: email,
|
|
15370
15439
|
onChange: (e) => onEmailChange(e.target.value),
|
|
15371
15440
|
placeholder: t.emailPlaceholder,
|
|
15372
|
-
className:
|
|
15441
|
+
className: cn19(
|
|
15373
15442
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15374
15443
|
error ? "border-destructive" : "border-border focus:border-primary"
|
|
15375
15444
|
)
|
|
15376
15445
|
}
|
|
15377
15446
|
),
|
|
15378
|
-
error && /* @__PURE__ */
|
|
15447
|
+
error && /* @__PURE__ */ jsx25("p", { className: "text-xs text-destructive", children: error })
|
|
15379
15448
|
] }),
|
|
15380
|
-
/* @__PURE__ */
|
|
15381
|
-
/* @__PURE__ */
|
|
15449
|
+
/* @__PURE__ */ jsxs23("div", { className: "space-y-2", children: [
|
|
15450
|
+
/* @__PURE__ */ jsx25(
|
|
15382
15451
|
"button",
|
|
15383
15452
|
{
|
|
15384
15453
|
type: "button",
|
|
15385
15454
|
onClick: onSubmitEmail,
|
|
15386
15455
|
disabled: checking || !isValidEmail,
|
|
15387
|
-
className:
|
|
15456
|
+
className: cn19(
|
|
15388
15457
|
"flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl px-4 py-2.5 text-sm font-semibold transition-all",
|
|
15389
15458
|
checking || !isValidEmail ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
15390
15459
|
),
|
|
15391
15460
|
children: checking ? t.checking : t.continueWithEmail
|
|
15392
15461
|
}
|
|
15393
15462
|
),
|
|
15394
|
-
/* @__PURE__ */
|
|
15463
|
+
/* @__PURE__ */ jsx25(
|
|
15395
15464
|
"button",
|
|
15396
15465
|
{
|
|
15397
15466
|
type: "button",
|
|
@@ -15408,9 +15477,9 @@ function CheckoutLoginPrompt({
|
|
|
15408
15477
|
}
|
|
15409
15478
|
|
|
15410
15479
|
// src/components/checkout-form.tsx
|
|
15411
|
-
import { cn as
|
|
15480
|
+
import { cn as cn20 } from "@reblu/site-ui/utils";
|
|
15412
15481
|
import { PhoneInput } from "@reblu/site-ui/phone-input";
|
|
15413
|
-
import { Fragment as Fragment5, jsx as
|
|
15482
|
+
import { Fragment as Fragment5, jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
15414
15483
|
var DEFAULT_LABELS7 = {
|
|
15415
15484
|
contactTitle: "Datos de contacto",
|
|
15416
15485
|
nameLabel: "Nombre completo",
|
|
@@ -15466,22 +15535,22 @@ function CheckoutForm({
|
|
|
15466
15535
|
event.preventDefault();
|
|
15467
15536
|
if (discountCode.trim() && !discountApplying) onApplyDiscount();
|
|
15468
15537
|
}
|
|
15469
|
-
return /* @__PURE__ */
|
|
15538
|
+
return /* @__PURE__ */ jsxs24(Fragment5, { children: [
|
|
15470
15539
|
loginPrompt,
|
|
15471
|
-
/* @__PURE__ */
|
|
15540
|
+
/* @__PURE__ */ jsxs24(
|
|
15472
15541
|
"form",
|
|
15473
15542
|
{
|
|
15474
15543
|
"data-testid": "checkout-form",
|
|
15475
15544
|
onSubmit,
|
|
15476
|
-
className:
|
|
15545
|
+
className: cn20("space-y-8", className),
|
|
15477
15546
|
"data-slot": "checkout-form",
|
|
15478
15547
|
children: [
|
|
15479
|
-
/* @__PURE__ */
|
|
15480
|
-
/* @__PURE__ */
|
|
15481
|
-
/* @__PURE__ */
|
|
15482
|
-
/* @__PURE__ */
|
|
15483
|
-
/* @__PURE__ */
|
|
15484
|
-
/* @__PURE__ */
|
|
15548
|
+
/* @__PURE__ */ jsxs24("section", { className: "space-y-4", children: [
|
|
15549
|
+
/* @__PURE__ */ jsx26("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.contactTitle }),
|
|
15550
|
+
/* @__PURE__ */ jsxs24("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
15551
|
+
/* @__PURE__ */ jsxs24("div", { className: "space-y-1", children: [
|
|
15552
|
+
/* @__PURE__ */ jsx26("label", { htmlFor: "checkout-form-name", className: "text-sm font-medium", children: t.nameLabel }),
|
|
15553
|
+
/* @__PURE__ */ jsx26(
|
|
15485
15554
|
"input",
|
|
15486
15555
|
{
|
|
15487
15556
|
id: "checkout-form-name",
|
|
@@ -15490,17 +15559,17 @@ function CheckoutForm({
|
|
|
15490
15559
|
value: contact.name,
|
|
15491
15560
|
onChange: (e) => patchContact({ name: e.target.value }),
|
|
15492
15561
|
placeholder: t.namePlaceholder,
|
|
15493
|
-
className:
|
|
15562
|
+
className: cn20(
|
|
15494
15563
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15495
15564
|
contactErrors?.name ? "border-destructive" : "border-border focus:border-primary"
|
|
15496
15565
|
)
|
|
15497
15566
|
}
|
|
15498
15567
|
),
|
|
15499
|
-
contactErrors?.name && /* @__PURE__ */
|
|
15568
|
+
contactErrors?.name && /* @__PURE__ */ jsx26("p", { className: "text-xs text-destructive", children: contactErrors.name })
|
|
15500
15569
|
] }),
|
|
15501
|
-
/* @__PURE__ */
|
|
15502
|
-
/* @__PURE__ */
|
|
15503
|
-
/* @__PURE__ */
|
|
15570
|
+
/* @__PURE__ */ jsxs24("div", { className: "space-y-1", children: [
|
|
15571
|
+
/* @__PURE__ */ jsx26("label", { htmlFor: "checkout-form-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
15572
|
+
/* @__PURE__ */ jsx26(
|
|
15504
15573
|
"input",
|
|
15505
15574
|
{
|
|
15506
15575
|
id: "checkout-form-email",
|
|
@@ -15509,15 +15578,15 @@ function CheckoutForm({
|
|
|
15509
15578
|
value: contact.email,
|
|
15510
15579
|
onChange: (e) => patchContact({ email: e.target.value }),
|
|
15511
15580
|
placeholder: t.emailPlaceholder,
|
|
15512
|
-
className:
|
|
15581
|
+
className: cn20(
|
|
15513
15582
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15514
15583
|
contactErrors?.email ? "border-destructive" : "border-border focus:border-primary"
|
|
15515
15584
|
)
|
|
15516
15585
|
}
|
|
15517
15586
|
),
|
|
15518
|
-
contactErrors?.email && /* @__PURE__ */
|
|
15587
|
+
contactErrors?.email && /* @__PURE__ */ jsx26("p", { className: "text-xs text-destructive", children: contactErrors.email })
|
|
15519
15588
|
] }),
|
|
15520
|
-
/* @__PURE__ */
|
|
15589
|
+
/* @__PURE__ */ jsx26("div", { className: "space-y-1", children: /* @__PURE__ */ jsx26(
|
|
15521
15590
|
PhoneInput,
|
|
15522
15591
|
{
|
|
15523
15592
|
id: "checkout-form-phone",
|
|
@@ -15531,26 +15600,26 @@ function CheckoutForm({
|
|
|
15531
15600
|
] })
|
|
15532
15601
|
] }),
|
|
15533
15602
|
children2,
|
|
15534
|
-
generalError ? /* @__PURE__ */
|
|
15535
|
-
/* @__PURE__ */
|
|
15536
|
-
/* @__PURE__ */
|
|
15537
|
-
autoDiscount ? /* @__PURE__ */
|
|
15603
|
+
generalError ? /* @__PURE__ */ jsx26("p", { role: "alert", className: "text-sm text-destructive", children: generalError }) : null,
|
|
15604
|
+
/* @__PURE__ */ jsxs24("section", { className: "space-y-3", children: [
|
|
15605
|
+
/* @__PURE__ */ jsx26("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.discountTitle }),
|
|
15606
|
+
autoDiscount ? /* @__PURE__ */ jsxs24(
|
|
15538
15607
|
"div",
|
|
15539
15608
|
{
|
|
15540
15609
|
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",
|
|
15541
15610
|
"data-slot": "checkout-staff-discount",
|
|
15542
15611
|
children: [
|
|
15543
|
-
/* @__PURE__ */
|
|
15544
|
-
/* @__PURE__ */
|
|
15612
|
+
/* @__PURE__ */ jsx26("span", { className: "font-semibold", children: t.staffDiscountApplied }),
|
|
15613
|
+
/* @__PURE__ */ jsx26("span", { children: t.discountAppliedSuffix(formatPrice(autoDiscount.amount, currencyCode, locale)) })
|
|
15545
15614
|
]
|
|
15546
15615
|
}
|
|
15547
15616
|
) : null,
|
|
15548
|
-
appliedDiscount && !autoDiscount ? /* @__PURE__ */
|
|
15549
|
-
/* @__PURE__ */
|
|
15550
|
-
/* @__PURE__ */
|
|
15551
|
-
/* @__PURE__ */
|
|
15617
|
+
appliedDiscount && !autoDiscount ? /* @__PURE__ */ jsxs24("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: [
|
|
15618
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-2 text-sm text-green-700 dark:text-green-400", children: [
|
|
15619
|
+
/* @__PURE__ */ jsx26("span", { className: "font-semibold", children: appliedDiscount.code }),
|
|
15620
|
+
/* @__PURE__ */ jsx26("span", { children: t.discountAppliedSuffix(formatPrice(appliedDiscount.amount, currencyCode, locale)) })
|
|
15552
15621
|
] }),
|
|
15553
|
-
/* @__PURE__ */
|
|
15622
|
+
/* @__PURE__ */ jsx26(
|
|
15554
15623
|
"button",
|
|
15555
15624
|
{
|
|
15556
15625
|
type: "button",
|
|
@@ -15560,9 +15629,9 @@ function CheckoutForm({
|
|
|
15560
15629
|
children: t.removeDiscount
|
|
15561
15630
|
}
|
|
15562
15631
|
)
|
|
15563
|
-
] }) : /* @__PURE__ */
|
|
15564
|
-
/* @__PURE__ */
|
|
15565
|
-
/* @__PURE__ */
|
|
15632
|
+
] }) : /* @__PURE__ */ jsxs24("div", { className: "flex gap-2", children: [
|
|
15633
|
+
/* @__PURE__ */ jsx26("label", { htmlFor: "checkout-form-discount-code", className: "sr-only", children: t.discountTitle }),
|
|
15634
|
+
/* @__PURE__ */ jsx26(
|
|
15566
15635
|
"input",
|
|
15567
15636
|
{
|
|
15568
15637
|
id: "checkout-form-discount-code",
|
|
@@ -15574,7 +15643,7 @@ function CheckoutForm({
|
|
|
15574
15643
|
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"
|
|
15575
15644
|
}
|
|
15576
15645
|
),
|
|
15577
|
-
/* @__PURE__ */
|
|
15646
|
+
/* @__PURE__ */ jsx26(
|
|
15578
15647
|
"button",
|
|
15579
15648
|
{
|
|
15580
15649
|
type: "button",
|
|
@@ -15585,14 +15654,14 @@ function CheckoutForm({
|
|
|
15585
15654
|
}
|
|
15586
15655
|
)
|
|
15587
15656
|
] }),
|
|
15588
|
-
discountError && /* @__PURE__ */
|
|
15657
|
+
discountError && /* @__PURE__ */ jsx26("p", { className: "text-xs text-destructive", children: discountError })
|
|
15589
15658
|
] }),
|
|
15590
|
-
/* @__PURE__ */
|
|
15659
|
+
/* @__PURE__ */ jsx26(
|
|
15591
15660
|
"button",
|
|
15592
15661
|
{
|
|
15593
15662
|
type: "submit",
|
|
15594
15663
|
disabled: submitting || submitDisabled,
|
|
15595
|
-
className:
|
|
15664
|
+
className: cn20(
|
|
15596
15665
|
"flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl px-4 py-3 font-semibold transition-all",
|
|
15597
15666
|
submitting || submitDisabled ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
15598
15667
|
),
|
|
@@ -15606,11 +15675,11 @@ function CheckoutForm({
|
|
|
15606
15675
|
}
|
|
15607
15676
|
|
|
15608
15677
|
// src/components/order-confirmation.tsx
|
|
15609
|
-
import { cn as
|
|
15678
|
+
import { cn as cn22 } from "@reblu/site-ui/utils";
|
|
15610
15679
|
|
|
15611
15680
|
// src/components/order-invoice-link.tsx
|
|
15612
|
-
import { cn as
|
|
15613
|
-
import { jsx as
|
|
15681
|
+
import { cn as cn21 } from "@reblu/site-ui/utils";
|
|
15682
|
+
import { jsx as jsx27, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
15614
15683
|
var DEFAULT_LABELS8 = {
|
|
15615
15684
|
linkLabel: "Descargar la factura {number}",
|
|
15616
15685
|
signInHint: "Te pediremos que inicies sesi\xF3n para abrirla."
|
|
@@ -15618,8 +15687,8 @@ var DEFAULT_LABELS8 = {
|
|
|
15618
15687
|
function OrderInvoiceLink({ invoice, labels, className }) {
|
|
15619
15688
|
if (!invoice) return null;
|
|
15620
15689
|
const t = { ...DEFAULT_LABELS8, ...labels };
|
|
15621
|
-
return /* @__PURE__ */
|
|
15622
|
-
/* @__PURE__ */
|
|
15690
|
+
return /* @__PURE__ */ jsxs25("div", { className: cn21("space-y-1 text-sm", className), "data-slot": "order-invoice-link", children: [
|
|
15691
|
+
/* @__PURE__ */ jsx27(
|
|
15623
15692
|
"a",
|
|
15624
15693
|
{
|
|
15625
15694
|
href: invoice.url,
|
|
@@ -15627,12 +15696,12 @@ function OrderInvoiceLink({ invoice, labels, className }) {
|
|
|
15627
15696
|
children: t.linkLabel.replace("{number}", invoice.number)
|
|
15628
15697
|
}
|
|
15629
15698
|
),
|
|
15630
|
-
/* @__PURE__ */
|
|
15699
|
+
/* @__PURE__ */ jsx27("p", { className: "text-muted-foreground", children: t.signInHint })
|
|
15631
15700
|
] });
|
|
15632
15701
|
}
|
|
15633
15702
|
|
|
15634
15703
|
// src/components/order-confirmation.tsx
|
|
15635
|
-
import { jsx as
|
|
15704
|
+
import { jsx as jsx28, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
15636
15705
|
var DEFAULT_LABELS9 = {
|
|
15637
15706
|
pollingTitle: "Confirmando tu pedido\u2026",
|
|
15638
15707
|
pollingDescription: "Estamos procesando el pago, un momento\u2026",
|
|
@@ -15698,43 +15767,43 @@ function OrderConfirmation({
|
|
|
15698
15767
|
const showOrderReference = Boolean(order) && !showFullOrderSummary && (status === "refunded" || status === "partially_refunded" || status === "pending_timeout");
|
|
15699
15768
|
const showSessionReference = !order && sessionId && (status === "timeout" || status === "not_found" || status === "pending_timeout");
|
|
15700
15769
|
const showRecheck = (status === "pending_timeout" || status === "error") && onRecheck;
|
|
15701
|
-
return /* @__PURE__ */
|
|
15702
|
-
/* @__PURE__ */
|
|
15703
|
-
/* @__PURE__ */
|
|
15704
|
-
showFullOrderSummary && order && /* @__PURE__ */
|
|
15705
|
-
/* @__PURE__ */
|
|
15706
|
-
/* @__PURE__ */
|
|
15707
|
-
/* @__PURE__ */
|
|
15770
|
+
return /* @__PURE__ */ jsxs26("div", { className: cn22("space-y-6 text-center", className), "data-slot": "order-confirmation", children: [
|
|
15771
|
+
/* @__PURE__ */ jsx28("h1", { className: "text-3xl font-bold", children: title }),
|
|
15772
|
+
/* @__PURE__ */ jsx28("p", { className: "text-lg text-muted-foreground", children: description }),
|
|
15773
|
+
showFullOrderSummary && order && /* @__PURE__ */ jsxs26("div", { className: "space-y-6", children: [
|
|
15774
|
+
/* @__PURE__ */ jsxs26("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15775
|
+
/* @__PURE__ */ jsx28("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderNumberLabel }),
|
|
15776
|
+
/* @__PURE__ */ jsx28("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
15708
15777
|
] }),
|
|
15709
|
-
/* @__PURE__ */
|
|
15710
|
-
order.items.map((item, idx) => /* @__PURE__ */
|
|
15778
|
+
/* @__PURE__ */ jsxs26("div", { className: "mx-auto max-w-sm space-y-3 rounded-xl border border-border bg-card p-5 text-left", children: [
|
|
15779
|
+
order.items.map((item, idx) => /* @__PURE__ */ jsxs26(
|
|
15711
15780
|
"div",
|
|
15712
15781
|
{
|
|
15713
15782
|
className: "flex justify-between gap-4 text-sm",
|
|
15714
15783
|
children: [
|
|
15715
|
-
/* @__PURE__ */
|
|
15784
|
+
/* @__PURE__ */ jsxs26("span", { className: "max-w-[60%] truncate text-muted-foreground", children: [
|
|
15716
15785
|
item.product.name,
|
|
15717
15786
|
item.variant ? ` (${item.variant.name})` : "",
|
|
15718
15787
|
" x",
|
|
15719
15788
|
item.quantity
|
|
15720
15789
|
] }),
|
|
15721
|
-
/* @__PURE__ */
|
|
15790
|
+
/* @__PURE__ */ jsx28("span", { children: formatPrice(item.total, currencyCode, locale) })
|
|
15722
15791
|
]
|
|
15723
15792
|
},
|
|
15724
15793
|
idx
|
|
15725
15794
|
)),
|
|
15726
|
-
/* @__PURE__ */
|
|
15727
|
-
/* @__PURE__ */
|
|
15728
|
-
/* @__PURE__ */
|
|
15795
|
+
/* @__PURE__ */ jsx28("div", { className: "space-y-1 border-t border-border pt-3 text-sm", children: /* @__PURE__ */ jsxs26("div", { className: "flex justify-between pt-1 text-base font-bold", children: [
|
|
15796
|
+
/* @__PURE__ */ jsx28("span", { children: t.totalLabel }),
|
|
15797
|
+
/* @__PURE__ */ jsx28("span", { children: formatPrice(order.total, currencyCode, locale) })
|
|
15729
15798
|
] }) })
|
|
15730
15799
|
] }),
|
|
15731
|
-
/* @__PURE__ */
|
|
15800
|
+
/* @__PURE__ */ jsxs26("p", { className: "mx-auto max-w-sm text-sm text-muted-foreground", children: [
|
|
15732
15801
|
t.confirmationEmailPrefix,
|
|
15733
15802
|
" ",
|
|
15734
|
-
/* @__PURE__ */
|
|
15803
|
+
/* @__PURE__ */ jsx28("span", { className: "font-medium text-foreground", children: order.customerEmail }),
|
|
15735
15804
|
"."
|
|
15736
15805
|
] }),
|
|
15737
|
-
/* @__PURE__ */
|
|
15806
|
+
/* @__PURE__ */ jsx28(
|
|
15738
15807
|
OrderInvoiceLink,
|
|
15739
15808
|
{
|
|
15740
15809
|
invoice: order.invoice,
|
|
@@ -15742,11 +15811,11 @@ function OrderConfirmation({
|
|
|
15742
15811
|
}
|
|
15743
15812
|
)
|
|
15744
15813
|
] }),
|
|
15745
|
-
showOrderReference && order && /* @__PURE__ */
|
|
15746
|
-
/* @__PURE__ */
|
|
15747
|
-
/* @__PURE__ */
|
|
15814
|
+
showOrderReference && order && /* @__PURE__ */ jsxs26("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15815
|
+
/* @__PURE__ */ jsx28("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderReferenceLabel }),
|
|
15816
|
+
/* @__PURE__ */ jsx28("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
15748
15817
|
] }),
|
|
15749
|
-
status === "failed" && cartHref && /* @__PURE__ */
|
|
15818
|
+
status === "failed" && cartHref && /* @__PURE__ */ jsx28(
|
|
15750
15819
|
"a",
|
|
15751
15820
|
{
|
|
15752
15821
|
href: cartHref,
|
|
@@ -15754,7 +15823,7 @@ function OrderConfirmation({
|
|
|
15754
15823
|
children: t.backToCartLabel
|
|
15755
15824
|
}
|
|
15756
15825
|
),
|
|
15757
|
-
showRecheck && /* @__PURE__ */
|
|
15826
|
+
showRecheck && /* @__PURE__ */ jsx28(
|
|
15758
15827
|
"button",
|
|
15759
15828
|
{
|
|
15760
15829
|
type: "button",
|
|
@@ -15763,16 +15832,16 @@ function OrderConfirmation({
|
|
|
15763
15832
|
children: t.recheckLabel
|
|
15764
15833
|
}
|
|
15765
15834
|
),
|
|
15766
|
-
showSessionReference && /* @__PURE__ */
|
|
15767
|
-
/* @__PURE__ */
|
|
15768
|
-
/* @__PURE__ */
|
|
15835
|
+
showSessionReference && /* @__PURE__ */ jsxs26("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15836
|
+
/* @__PURE__ */ jsx28("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.sessionReferenceLabel }),
|
|
15837
|
+
/* @__PURE__ */ jsx28("p", { className: "break-all font-mono text-sm font-semibold", children: sessionId })
|
|
15769
15838
|
] })
|
|
15770
15839
|
] });
|
|
15771
15840
|
}
|
|
15772
15841
|
|
|
15773
15842
|
// src/components/full-invoice-fields.tsx
|
|
15774
|
-
import { cn as
|
|
15775
|
-
import { jsx as
|
|
15843
|
+
import { cn as cn23 } from "@reblu/site-ui/utils";
|
|
15844
|
+
import { jsx as jsx29, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
15776
15845
|
var EMPTY_FULL_INVOICE_VALUE = {
|
|
15777
15846
|
wantsFullInvoice: false,
|
|
15778
15847
|
billingIdType: "NIF",
|
|
@@ -15889,12 +15958,12 @@ function FullInvoiceFields({
|
|
|
15889
15958
|
const showFields = value.wantsFullInvoice || overCap;
|
|
15890
15959
|
const isSpanishNif = value.billingIdType === "NIF";
|
|
15891
15960
|
const set = (key2, next2) => onChange({ ...value, [key2]: next2 });
|
|
15892
|
-
const error = (key2) => errors[key2] ? /* @__PURE__ */
|
|
15961
|
+
const error = (key2) => errors[key2] ? /* @__PURE__ */ jsx29("p", { id: `full-invoice-${key2}-error`, className: "text-sm text-destructive", children: errors[key2] }) : null;
|
|
15893
15962
|
const invalid2 = (key2) => errors[key2] ? { "aria-invalid": true, "aria-describedby": `full-invoice-${key2}-error` } : {};
|
|
15894
|
-
return /* @__PURE__ */
|
|
15895
|
-
overCap ? /* @__PURE__ */
|
|
15896
|
-
/* @__PURE__ */
|
|
15897
|
-
/* @__PURE__ */
|
|
15963
|
+
return /* @__PURE__ */ jsxs27("section", { className: cn23("space-y-4", className), "data-slot": "full-invoice-fields", children: [
|
|
15964
|
+
overCap ? /* @__PURE__ */ jsx29("p", { role: "note", className: "rounded-lg border border-border p-4 text-sm", children: t.overCapNotice }) : /* @__PURE__ */ jsxs27("div", { className: "space-y-1", children: [
|
|
15965
|
+
/* @__PURE__ */ jsxs27("label", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
15966
|
+
/* @__PURE__ */ jsx29(
|
|
15898
15967
|
"input",
|
|
15899
15968
|
{
|
|
15900
15969
|
type: "checkbox",
|
|
@@ -15904,12 +15973,12 @@ function FullInvoiceFields({
|
|
|
15904
15973
|
),
|
|
15905
15974
|
t.toggle
|
|
15906
15975
|
] }),
|
|
15907
|
-
/* @__PURE__ */
|
|
15976
|
+
/* @__PURE__ */ jsx29("p", { className: "text-sm text-muted-foreground", children: t.underCapNotice })
|
|
15908
15977
|
] }),
|
|
15909
|
-
showFields && /* @__PURE__ */
|
|
15910
|
-
/* @__PURE__ */
|
|
15911
|
-
/* @__PURE__ */
|
|
15912
|
-
/* @__PURE__ */
|
|
15978
|
+
showFields && /* @__PURE__ */ jsxs27("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
15979
|
+
/* @__PURE__ */ jsxs27("div", { className: "space-y-1", children: [
|
|
15980
|
+
/* @__PURE__ */ jsx29("label", { htmlFor: "full-invoice-id-type", className: "text-sm font-medium", children: t.idType }),
|
|
15981
|
+
/* @__PURE__ */ jsx29(
|
|
15913
15982
|
"select",
|
|
15914
15983
|
{
|
|
15915
15984
|
id: "full-invoice-id-type",
|
|
@@ -15918,14 +15987,14 @@ function FullInvoiceFields({
|
|
|
15918
15987
|
value: value.billingIdType,
|
|
15919
15988
|
onChange: (e) => set("billingIdType", e.target.value),
|
|
15920
15989
|
...invalid2("billingIdType"),
|
|
15921
|
-
children: ID_TYPES.map((type) => /* @__PURE__ */
|
|
15990
|
+
children: ID_TYPES.map((type) => /* @__PURE__ */ jsx29("option", { value: type, children: t.idTypeOptions[type] }, type))
|
|
15922
15991
|
}
|
|
15923
15992
|
),
|
|
15924
15993
|
error("billingIdType")
|
|
15925
15994
|
] }),
|
|
15926
|
-
!isSpanishNif && /* @__PURE__ */
|
|
15927
|
-
/* @__PURE__ */
|
|
15928
|
-
/* @__PURE__ */
|
|
15995
|
+
!isSpanishNif && /* @__PURE__ */ jsxs27("div", { className: "space-y-1", children: [
|
|
15996
|
+
/* @__PURE__ */ jsx29("label", { htmlFor: "full-invoice-id-country", className: "text-sm font-medium", children: t.idCountry }),
|
|
15997
|
+
/* @__PURE__ */ jsxs27(
|
|
15929
15998
|
"select",
|
|
15930
15999
|
{
|
|
15931
16000
|
id: "full-invoice-id-country",
|
|
@@ -15935,16 +16004,16 @@ function FullInvoiceFields({
|
|
|
15935
16004
|
onChange: (e) => set("billingIdCountry", e.target.value),
|
|
15936
16005
|
...invalid2("billingIdCountry"),
|
|
15937
16006
|
children: [
|
|
15938
|
-
/* @__PURE__ */
|
|
15939
|
-
countries.map((c) => /* @__PURE__ */
|
|
16007
|
+
/* @__PURE__ */ jsx29("option", { value: "", disabled: true, children: t.chooseCountry }),
|
|
16008
|
+
countries.map((c) => /* @__PURE__ */ jsx29("option", { value: c.code, children: c.name }, c.code))
|
|
15940
16009
|
]
|
|
15941
16010
|
}
|
|
15942
16011
|
),
|
|
15943
16012
|
error("billingIdCountry")
|
|
15944
16013
|
] }),
|
|
15945
|
-
/* @__PURE__ */
|
|
15946
|
-
/* @__PURE__ */
|
|
15947
|
-
/* @__PURE__ */
|
|
16014
|
+
/* @__PURE__ */ jsxs27("div", { className: "space-y-1", children: [
|
|
16015
|
+
/* @__PURE__ */ jsx29("label", { htmlFor: "full-invoice-nif", className: "text-sm font-medium", children: isSpanishNif ? t.spanishNif : t.documentNumber }),
|
|
16016
|
+
/* @__PURE__ */ jsx29(
|
|
15948
16017
|
"input",
|
|
15949
16018
|
{
|
|
15950
16019
|
id: "full-invoice-nif",
|
|
@@ -15957,9 +16026,9 @@ function FullInvoiceFields({
|
|
|
15957
16026
|
),
|
|
15958
16027
|
error("billingNif")
|
|
15959
16028
|
] }),
|
|
15960
|
-
/* @__PURE__ */
|
|
15961
|
-
/* @__PURE__ */
|
|
15962
|
-
/* @__PURE__ */
|
|
16029
|
+
/* @__PURE__ */ jsxs27("div", { className: "space-y-1", children: [
|
|
16030
|
+
/* @__PURE__ */ jsx29("label", { htmlFor: "full-invoice-name", className: "text-sm font-medium", children: t.name }),
|
|
16031
|
+
/* @__PURE__ */ jsx29(
|
|
15963
16032
|
"input",
|
|
15964
16033
|
{
|
|
15965
16034
|
id: "full-invoice-name",
|
|
@@ -15972,9 +16041,9 @@ function FullInvoiceFields({
|
|
|
15972
16041
|
),
|
|
15973
16042
|
error("billingName")
|
|
15974
16043
|
] }),
|
|
15975
|
-
/* @__PURE__ */
|
|
15976
|
-
/* @__PURE__ */
|
|
15977
|
-
/* @__PURE__ */
|
|
16044
|
+
/* @__PURE__ */ jsxs27("div", { className: "space-y-1 sm:col-span-2", children: [
|
|
16045
|
+
/* @__PURE__ */ jsx29("label", { htmlFor: "full-invoice-street", className: "text-sm font-medium", children: t.street }),
|
|
16046
|
+
/* @__PURE__ */ jsx29(
|
|
15978
16047
|
"input",
|
|
15979
16048
|
{
|
|
15980
16049
|
id: "full-invoice-street",
|
|
@@ -15986,9 +16055,9 @@ function FullInvoiceFields({
|
|
|
15986
16055
|
}
|
|
15987
16056
|
)
|
|
15988
16057
|
] }),
|
|
15989
|
-
/* @__PURE__ */
|
|
15990
|
-
/* @__PURE__ */
|
|
15991
|
-
/* @__PURE__ */
|
|
16058
|
+
/* @__PURE__ */ jsxs27("div", { className: "space-y-1", children: [
|
|
16059
|
+
/* @__PURE__ */ jsx29("label", { htmlFor: "full-invoice-postal-code", className: "text-sm font-medium", children: t.postalCode }),
|
|
16060
|
+
/* @__PURE__ */ jsx29(
|
|
15992
16061
|
"input",
|
|
15993
16062
|
{
|
|
15994
16063
|
id: "full-invoice-postal-code",
|
|
@@ -15999,9 +16068,9 @@ function FullInvoiceFields({
|
|
|
15999
16068
|
}
|
|
16000
16069
|
)
|
|
16001
16070
|
] }),
|
|
16002
|
-
/* @__PURE__ */
|
|
16003
|
-
/* @__PURE__ */
|
|
16004
|
-
/* @__PURE__ */
|
|
16071
|
+
/* @__PURE__ */ jsxs27("div", { className: "space-y-1", children: [
|
|
16072
|
+
/* @__PURE__ */ jsx29("label", { htmlFor: "full-invoice-city", className: "text-sm font-medium", children: t.city }),
|
|
16073
|
+
/* @__PURE__ */ jsx29(
|
|
16005
16074
|
"input",
|
|
16006
16075
|
{
|
|
16007
16076
|
id: "full-invoice-city",
|
|
@@ -16012,9 +16081,9 @@ function FullInvoiceFields({
|
|
|
16012
16081
|
}
|
|
16013
16082
|
)
|
|
16014
16083
|
] }),
|
|
16015
|
-
/* @__PURE__ */
|
|
16016
|
-
/* @__PURE__ */
|
|
16017
|
-
/* @__PURE__ */
|
|
16084
|
+
/* @__PURE__ */ jsxs27("div", { className: "space-y-1", children: [
|
|
16085
|
+
/* @__PURE__ */ jsx29("label", { htmlFor: "full-invoice-country", className: "text-sm font-medium", children: t.country }),
|
|
16086
|
+
/* @__PURE__ */ jsx29(
|
|
16018
16087
|
"select",
|
|
16019
16088
|
{
|
|
16020
16089
|
id: "full-invoice-country",
|
|
@@ -16022,18 +16091,408 @@ function FullInvoiceFields({
|
|
|
16022
16091
|
required: true,
|
|
16023
16092
|
value: value.country,
|
|
16024
16093
|
onChange: (e) => set("country", e.target.value),
|
|
16025
|
-
children: countries.map((c) => /* @__PURE__ */
|
|
16094
|
+
children: countries.map((c) => /* @__PURE__ */ jsx29("option", { value: c.code, children: c.name }, c.code))
|
|
16026
16095
|
}
|
|
16027
16096
|
)
|
|
16028
16097
|
] }),
|
|
16029
|
-
/* @__PURE__ */
|
|
16098
|
+
/* @__PURE__ */ jsx29("div", { className: "sm:col-span-2", children: error("address") })
|
|
16030
16099
|
] })
|
|
16031
16100
|
] });
|
|
16032
16101
|
}
|
|
16033
16102
|
|
|
16103
|
+
// src/components/checkout-delivery-choice.tsx
|
|
16104
|
+
import { cn as cn24 } from "@reblu/site-ui/utils";
|
|
16105
|
+
import { jsx as jsx30, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
16106
|
+
var EMPTY_CHECKOUT_ADDRESS = {
|
|
16107
|
+
firstName: "",
|
|
16108
|
+
lastName: "",
|
|
16109
|
+
street: "",
|
|
16110
|
+
postalCode: "",
|
|
16111
|
+
city: "",
|
|
16112
|
+
region: ""
|
|
16113
|
+
};
|
|
16114
|
+
var DEFAULT_CHECKOUT_DELIVERY_CHOICE_LABELS = {
|
|
16115
|
+
legend: "Entrega",
|
|
16116
|
+
free: "Gratis",
|
|
16117
|
+
pickupPointsLegend: "Punto de recogida",
|
|
16118
|
+
addressLegend: "Direcci\xF3n de entrega",
|
|
16119
|
+
firstName: "Nombre",
|
|
16120
|
+
lastName: "Apellidos",
|
|
16121
|
+
street: "Direcci\xF3n",
|
|
16122
|
+
postalCode: "C\xF3digo postal",
|
|
16123
|
+
city: "Ciudad",
|
|
16124
|
+
region: "Provincia"
|
|
16125
|
+
};
|
|
16126
|
+
var INPUT_CLASS = "w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20";
|
|
16127
|
+
var ADDRESS_FIELDS = [
|
|
16128
|
+
{ key: "firstName", autoComplete: "shipping given-name", required: true },
|
|
16129
|
+
{ key: "lastName", autoComplete: "shipping family-name", required: true },
|
|
16130
|
+
{ key: "street", autoComplete: "shipping street-address", required: true, wide: true },
|
|
16131
|
+
{ key: "postalCode", autoComplete: "shipping postal-code", required: true },
|
|
16132
|
+
{ key: "city", autoComplete: "shipping address-level2", required: true },
|
|
16133
|
+
{ key: "region", autoComplete: "shipping address-level1", required: false }
|
|
16134
|
+
];
|
|
16135
|
+
function pickupDescription(location2) {
|
|
16136
|
+
return [
|
|
16137
|
+
`${location2.address}, ${location2.postalCode} ${location2.city}`,
|
|
16138
|
+
location2.openingHoursText,
|
|
16139
|
+
location2.pickupReadyText
|
|
16140
|
+
].filter(Boolean).join(". ");
|
|
16141
|
+
}
|
|
16142
|
+
function CheckoutDeliveryChoice({
|
|
16143
|
+
delivery,
|
|
16144
|
+
copy,
|
|
16145
|
+
value,
|
|
16146
|
+
onChange,
|
|
16147
|
+
address,
|
|
16148
|
+
onAddressChange,
|
|
16149
|
+
addressErrors,
|
|
16150
|
+
error,
|
|
16151
|
+
quote,
|
|
16152
|
+
requiresDelivery = true,
|
|
16153
|
+
labels,
|
|
16154
|
+
currencyCode,
|
|
16155
|
+
locale,
|
|
16156
|
+
id: uid = "checkout-delivery",
|
|
16157
|
+
className
|
|
16158
|
+
}) {
|
|
16159
|
+
const t = { ...DEFAULT_CHECKOUT_DELIVERY_CHOICE_LABELS, ...labels };
|
|
16160
|
+
const { homeDelivery, pickup } = delivery.methods;
|
|
16161
|
+
if (!requiresDelivery || !homeDelivery && !pickup) return null;
|
|
16162
|
+
const price = (cents) => formatPrice(cents, currencyCode, locale);
|
|
16163
|
+
const quotedShipping = quote?.fulfillment.type === "SHIPPING" ? quote.shipping : null;
|
|
16164
|
+
const homeCost = quotedShipping ? quotedShipping.isFree ? t.free : price(quotedShipping.cost) : delivery.shippingEnabled && delivery.defaultShippingCost ? price(delivery.defaultShippingCost) : t.free;
|
|
16165
|
+
const isPickup = value?.type === "PICKUP";
|
|
16166
|
+
const isShipping = value?.type === "SHIPPING";
|
|
16167
|
+
const errorId = `${uid}-delivery-error`;
|
|
16168
|
+
return /* @__PURE__ */ jsxs28(
|
|
16169
|
+
"fieldset",
|
|
16170
|
+
{
|
|
16171
|
+
"data-slot": "checkout-delivery",
|
|
16172
|
+
"aria-describedby": error ? errorId : void 0,
|
|
16173
|
+
className: cn24("space-y-4", className),
|
|
16174
|
+
children: [
|
|
16175
|
+
/* @__PURE__ */ jsx30("legend", { className: "mb-2 text-lg font-semibold", children: t.legend }),
|
|
16176
|
+
/* @__PURE__ */ jsxs28("div", { className: "grid gap-3 sm:grid-cols-2", children: [
|
|
16177
|
+
homeDelivery ? /* @__PURE__ */ jsxs28("label", { className: "flex cursor-pointer items-start gap-3 rounded-xl border border-border p-4 has-[:checked]:border-primary", children: [
|
|
16178
|
+
/* @__PURE__ */ jsx30(
|
|
16179
|
+
"input",
|
|
16180
|
+
{
|
|
16181
|
+
type: "radio",
|
|
16182
|
+
name: `${uid}-method`,
|
|
16183
|
+
checked: isShipping,
|
|
16184
|
+
onChange: () => onChange({ type: "SHIPPING" }),
|
|
16185
|
+
className: "mt-0.5 size-4 accent-primary"
|
|
16186
|
+
}
|
|
16187
|
+
),
|
|
16188
|
+
/* @__PURE__ */ jsxs28("span", { className: "flex-1 space-y-1", children: [
|
|
16189
|
+
/* @__PURE__ */ jsxs28("span", { className: "flex justify-between gap-2 font-medium", children: [
|
|
16190
|
+
/* @__PURE__ */ jsx30("span", { children: copy.shippingOptionLabel }),
|
|
16191
|
+
/* @__PURE__ */ jsx30("span", { className: "tabular-nums", children: homeCost })
|
|
16192
|
+
] }),
|
|
16193
|
+
delivery.estimatedDeliveryText ? /* @__PURE__ */ jsx30("span", { className: "block text-sm text-muted-foreground", children: delivery.estimatedDeliveryText }) : null
|
|
16194
|
+
] })
|
|
16195
|
+
] }) : null,
|
|
16196
|
+
pickup ? /* @__PURE__ */ jsxs28("label", { className: "flex cursor-pointer items-start gap-3 rounded-xl border border-border p-4 has-[:checked]:border-primary", children: [
|
|
16197
|
+
/* @__PURE__ */ jsx30(
|
|
16198
|
+
"input",
|
|
16199
|
+
{
|
|
16200
|
+
type: "radio",
|
|
16201
|
+
name: `${uid}-method`,
|
|
16202
|
+
checked: isPickup,
|
|
16203
|
+
onChange: () => onChange({ type: "PICKUP" }),
|
|
16204
|
+
className: "mt-0.5 size-4 accent-primary"
|
|
16205
|
+
}
|
|
16206
|
+
),
|
|
16207
|
+
/* @__PURE__ */ jsxs28("span", { className: "flex flex-1 justify-between gap-2 font-medium", children: [
|
|
16208
|
+
/* @__PURE__ */ jsx30("span", { children: copy.pickupOptionLabel }),
|
|
16209
|
+
/* @__PURE__ */ jsx30("span", { children: t.free })
|
|
16210
|
+
] })
|
|
16211
|
+
] }) : null
|
|
16212
|
+
] }),
|
|
16213
|
+
error ? /* @__PURE__ */ jsx30("p", { id: errorId, role: "alert", className: "text-sm text-destructive", children: error }) : null,
|
|
16214
|
+
isPickup ? /* @__PURE__ */ jsxs28("div", { role: "radiogroup", "aria-labelledby": `${uid}-points`, className: "space-y-2", children: [
|
|
16215
|
+
/* @__PURE__ */ jsx30("p", { id: `${uid}-points`, className: "text-sm font-medium", children: t.pickupPointsLegend }),
|
|
16216
|
+
delivery.pickupLocations.map((location2) => {
|
|
16217
|
+
const descId = `${uid}-point-${location2.id}`;
|
|
16218
|
+
return /* @__PURE__ */ jsxs28(
|
|
16219
|
+
"label",
|
|
16220
|
+
{
|
|
16221
|
+
className: "flex cursor-pointer items-start gap-3 rounded-lg border border-border p-3 has-[:checked]:border-primary",
|
|
16222
|
+
children: [
|
|
16223
|
+
/* @__PURE__ */ jsx30(
|
|
16224
|
+
"input",
|
|
16225
|
+
{
|
|
16226
|
+
type: "radio",
|
|
16227
|
+
name: `${uid}-point`,
|
|
16228
|
+
checked: value?.pickupLocationId === location2.id,
|
|
16229
|
+
onChange: () => onChange({ type: "PICKUP", pickupLocationId: location2.id }),
|
|
16230
|
+
"aria-describedby": descId,
|
|
16231
|
+
className: "mt-0.5 size-4 accent-primary"
|
|
16232
|
+
}
|
|
16233
|
+
),
|
|
16234
|
+
/* @__PURE__ */ jsxs28("span", { className: "space-y-0.5 text-sm", children: [
|
|
16235
|
+
/* @__PURE__ */ jsx30("span", { className: "block font-medium", children: location2.name }),
|
|
16236
|
+
/* @__PURE__ */ jsx30("span", { id: descId, className: "block text-muted-foreground", children: pickupDescription(location2) })
|
|
16237
|
+
] })
|
|
16238
|
+
]
|
|
16239
|
+
},
|
|
16240
|
+
location2.id
|
|
16241
|
+
);
|
|
16242
|
+
})
|
|
16243
|
+
] }) : null,
|
|
16244
|
+
isShipping ? /* @__PURE__ */ jsxs28("fieldset", { className: "space-y-3", children: [
|
|
16245
|
+
/* @__PURE__ */ jsx30("legend", { className: "mb-2 text-sm font-medium", children: t.addressLegend }),
|
|
16246
|
+
/* @__PURE__ */ jsx30("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: ADDRESS_FIELDS.map(({ key: key2, autoComplete, required, wide }) => {
|
|
16247
|
+
const fieldId = `${uid}-${key2}`;
|
|
16248
|
+
const fieldError = addressErrors?.[key2];
|
|
16249
|
+
return /* @__PURE__ */ jsxs28("div", { className: cn24("space-y-1", wide && "sm:col-span-2"), children: [
|
|
16250
|
+
/* @__PURE__ */ jsx30("label", { htmlFor: fieldId, className: "text-sm font-medium", children: t[key2] }),
|
|
16251
|
+
/* @__PURE__ */ jsx30(
|
|
16252
|
+
"input",
|
|
16253
|
+
{
|
|
16254
|
+
id: fieldId,
|
|
16255
|
+
type: "text",
|
|
16256
|
+
required,
|
|
16257
|
+
autoComplete,
|
|
16258
|
+
value: address[key2],
|
|
16259
|
+
onChange: (e) => onAddressChange({ ...address, [key2]: e.target.value }),
|
|
16260
|
+
"aria-invalid": fieldError ? true : void 0,
|
|
16261
|
+
"aria-describedby": fieldError ? `${fieldId}-error` : void 0,
|
|
16262
|
+
className: cn24(
|
|
16263
|
+
INPUT_CLASS,
|
|
16264
|
+
fieldError ? "border-destructive" : "border-border focus:border-primary"
|
|
16265
|
+
)
|
|
16266
|
+
}
|
|
16267
|
+
),
|
|
16268
|
+
fieldError ? /* @__PURE__ */ jsx30("p", { id: `${fieldId}-error`, className: "text-sm text-destructive", children: fieldError }) : null
|
|
16269
|
+
] }, key2);
|
|
16270
|
+
}) })
|
|
16271
|
+
] }) : null
|
|
16272
|
+
]
|
|
16273
|
+
}
|
|
16274
|
+
);
|
|
16275
|
+
}
|
|
16276
|
+
function defaultCheckoutFulfillment(delivery) {
|
|
16277
|
+
if (!delivery) return null;
|
|
16278
|
+
if (delivery.methods.homeDelivery) return { type: "SHIPPING" };
|
|
16279
|
+
if (!delivery.methods.pickup) return null;
|
|
16280
|
+
const [only, ...rest] = delivery.pickupLocations;
|
|
16281
|
+
return only && rest.length === 0 ? { type: "PICKUP", pickupLocationId: only.id } : { type: "PICKUP" };
|
|
16282
|
+
}
|
|
16283
|
+
function quoteRequiresDelivery(quote) {
|
|
16284
|
+
return quote ? quote.lines.some((line) => line.isShippable) : true;
|
|
16285
|
+
}
|
|
16286
|
+
function toCheckoutFulfillmentFields(value, address, requiresDelivery = true) {
|
|
16287
|
+
if (!value || !requiresDelivery) return { fulfillment: { type: "SHIPPING" } };
|
|
16288
|
+
if (value.type === "PICKUP") {
|
|
16289
|
+
return { fulfillment: value.pickupLocationId ? { type: "PICKUP", pickupLocationId: value.pickupLocationId } : { type: "PICKUP" } };
|
|
16290
|
+
}
|
|
16291
|
+
const shippingAddress = {
|
|
16292
|
+
firstName: address.firstName.trim(),
|
|
16293
|
+
lastName: address.lastName.trim(),
|
|
16294
|
+
street: address.street.trim(),
|
|
16295
|
+
postalCode: address.postalCode.trim(),
|
|
16296
|
+
city: address.city.trim(),
|
|
16297
|
+
...address.region.trim() ? { region: address.region.trim() } : {}
|
|
16298
|
+
};
|
|
16299
|
+
return { fulfillment: { type: "SHIPPING" }, shippingAddress };
|
|
16300
|
+
}
|
|
16301
|
+
|
|
16302
|
+
// src/components/checkout-quote-summary.tsx
|
|
16303
|
+
import { cn as cn25 } from "@reblu/site-ui/utils";
|
|
16304
|
+
import { Fragment as Fragment6, jsx as jsx31, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
16305
|
+
var DEFAULT_CHECKOUT_QUOTE_SUMMARY_LABELS = {
|
|
16306
|
+
subtotal: "Subtotal",
|
|
16307
|
+
discount: (codeOrLabel, isAutomatic) => isAutomatic ? codeOrLabel : `Descuento (${codeOrLabel})`,
|
|
16308
|
+
free: "Gratis",
|
|
16309
|
+
delivery: "Entrega",
|
|
16310
|
+
remainingForFree: (amount) => `Te faltan ${amount} para el env\xEDo gratis`,
|
|
16311
|
+
taxIncluded: (label) => `De los cuales ${label}`,
|
|
16312
|
+
total: "Total",
|
|
16313
|
+
taxesIncludedNote: "Impuestos incluidos",
|
|
16314
|
+
quantityTimesUnit: (quantity, unit) => `${quantity} \xD7 ${unit}`
|
|
16315
|
+
};
|
|
16316
|
+
function Row({
|
|
16317
|
+
name,
|
|
16318
|
+
value,
|
|
16319
|
+
className
|
|
16320
|
+
}) {
|
|
16321
|
+
return /* @__PURE__ */ jsxs29("div", { "data-slot": "checkout-quote-row", className: cn25("flex justify-between gap-4", className), children: [
|
|
16322
|
+
/* @__PURE__ */ jsx31("dt", { children: name }),
|
|
16323
|
+
/* @__PURE__ */ jsx31("dd", { className: "shrink-0 tabular-nums", children: value })
|
|
16324
|
+
] });
|
|
16325
|
+
}
|
|
16326
|
+
function CheckoutQuoteSummary({
|
|
16327
|
+
quote,
|
|
16328
|
+
heading,
|
|
16329
|
+
headingLevel = 2,
|
|
16330
|
+
labels,
|
|
16331
|
+
currencyCode,
|
|
16332
|
+
locale,
|
|
16333
|
+
className
|
|
16334
|
+
}) {
|
|
16335
|
+
const t = { ...DEFAULT_CHECKOUT_QUOTE_SUMMARY_LABELS, ...labels };
|
|
16336
|
+
const price = (cents) => formatPrice(cents, currencyCode, locale);
|
|
16337
|
+
const { fulfillment, shipping, tax, discount } = quote;
|
|
16338
|
+
const Tag = `h${headingLevel}`;
|
|
16339
|
+
return /* @__PURE__ */ jsxs29("section", { "data-slot": "checkout-quote-summary", className: slotClassName("space-y-4", "", className), children: [
|
|
16340
|
+
heading ? /* @__PURE__ */ jsx31(Tag, { className: "text-lg font-semibold", children: heading }) : null,
|
|
16341
|
+
/* @__PURE__ */ jsx31("ul", { className: "space-y-3 text-sm", children: quote.lines.map((line) => /* @__PURE__ */ jsxs29("li", { className: "flex justify-between gap-4", children: [
|
|
16342
|
+
/* @__PURE__ */ jsxs29("div", { className: "min-w-0 space-y-0.5", children: [
|
|
16343
|
+
/* @__PURE__ */ jsx31("p", { className: "font-medium", children: line.name }),
|
|
16344
|
+
line.variantName ? /* @__PURE__ */ jsx31("p", { className: "text-muted-foreground", children: line.variantName }) : null,
|
|
16345
|
+
/* @__PURE__ */ jsxs29("p", { className: "flex flex-wrap items-center gap-2 text-muted-foreground", children: [
|
|
16346
|
+
line.kindLabel ? /* @__PURE__ */ jsx31("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,
|
|
16347
|
+
/* @__PURE__ */ jsx31("span", { children: t.quantityTimesUnit(line.quantity, price(line.unitPrice)) })
|
|
16348
|
+
] })
|
|
16349
|
+
] }),
|
|
16350
|
+
/* @__PURE__ */ jsx31("span", { className: "shrink-0 tabular-nums", children: price(line.total) })
|
|
16351
|
+
] }, `${line.productId}-${line.variantId ?? ""}`)) }),
|
|
16352
|
+
/* @__PURE__ */ jsxs29("dl", { className: "space-y-2 border-t border-border pt-3 text-sm", children: [
|
|
16353
|
+
/* @__PURE__ */ jsx31(Row, { name: t.subtotal, value: price(quote.subtotal) }),
|
|
16354
|
+
discount && discount.amount > 0 ? /* @__PURE__ */ jsx31(
|
|
16355
|
+
Row,
|
|
16356
|
+
{
|
|
16357
|
+
className: "text-green-700 dark:text-green-400",
|
|
16358
|
+
name: t.discount(discount.isAutomatic ? discount.label ?? discount.code : discount.code, discount.isAutomatic),
|
|
16359
|
+
value: `\u2212${price(discount.amount)}`
|
|
16360
|
+
}
|
|
16361
|
+
) : null,
|
|
16362
|
+
fulfillment.type ? /* @__PURE__ */ jsx31(
|
|
16363
|
+
Row,
|
|
16364
|
+
{
|
|
16365
|
+
name: /* @__PURE__ */ jsxs29(Fragment6, { children: [
|
|
16366
|
+
fulfillment.label ?? t.delivery,
|
|
16367
|
+
fulfillment.type === "PICKUP" && fulfillment.pickupLocation ? /* @__PURE__ */ jsx31("span", { className: "block text-muted-foreground", children: fulfillment.pickupLocation.name }) : null
|
|
16368
|
+
] }),
|
|
16369
|
+
value: fulfillment.type === "PICKUP" || shipping.isFree ? t.free : price(shipping.cost)
|
|
16370
|
+
}
|
|
16371
|
+
) : null,
|
|
16372
|
+
tax.isLineVisible ? tax.breakdown.map((entry) => /* @__PURE__ */ jsx31(
|
|
16373
|
+
Row,
|
|
16374
|
+
{
|
|
16375
|
+
className: tax.isIncluded ? "text-muted-foreground" : void 0,
|
|
16376
|
+
name: tax.isIncluded ? t.taxIncluded(entry.label) : entry.label,
|
|
16377
|
+
value: price(entry.amount)
|
|
16378
|
+
},
|
|
16379
|
+
entry.label
|
|
16380
|
+
)) : null,
|
|
16381
|
+
/* @__PURE__ */ jsx31(Row, { className: "border-t border-border pt-2 text-base font-bold", name: t.total, value: price(quote.total) })
|
|
16382
|
+
] }),
|
|
16383
|
+
tax.isIncluded ? /* @__PURE__ */ jsx31("p", { className: "text-sm text-muted-foreground", children: t.taxesIncludedNote }) : null,
|
|
16384
|
+
fulfillment.type === "SHIPPING" && !shipping.isFree && shipping.remainingForFree ? /* @__PURE__ */ jsx31("p", { className: "text-sm text-muted-foreground", children: t.remainingForFree(price(shipping.remainingForFree)) }) : null,
|
|
16385
|
+
fulfillment.type && quote.deliveryEstimateText ? /* @__PURE__ */ jsx31("p", { "data-slot": "checkout-quote-estimate", className: "text-sm text-muted-foreground", children: quote.deliveryEstimateText }) : null,
|
|
16386
|
+
quote.discountError ? /* @__PURE__ */ jsx31("p", { role: "status", className: "text-sm text-destructive", children: quote.discountError.message }) : null,
|
|
16387
|
+
quote.blockingReason ? /* @__PURE__ */ jsx31("p", { role: "alert", className: "rounded-lg border border-destructive/50 bg-destructive/10 p-3 text-sm text-destructive", children: quote.blockingReason.message }) : null
|
|
16388
|
+
] });
|
|
16389
|
+
}
|
|
16390
|
+
|
|
16391
|
+
// src/components/checkout-terms-acceptance.tsx
|
|
16392
|
+
import { cn as cn26 } from "@reblu/site-ui/utils";
|
|
16393
|
+
import { Fragment as Fragment7, jsx as jsx32, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
16394
|
+
function splitTermsLabel(label) {
|
|
16395
|
+
const at = label.indexOf("{terms}");
|
|
16396
|
+
return at === -1 ? [`${label} `, ""] : [label.slice(0, at), label.slice(at + "{terms}".length)];
|
|
16397
|
+
}
|
|
16398
|
+
function CheckoutTermsAcceptance({
|
|
16399
|
+
copy,
|
|
16400
|
+
termsHref,
|
|
16401
|
+
checked,
|
|
16402
|
+
onCheckedChange,
|
|
16403
|
+
error,
|
|
16404
|
+
newTabHint = "(se abre en una pesta\xF1a nueva)",
|
|
16405
|
+
id,
|
|
16406
|
+
className
|
|
16407
|
+
}) {
|
|
16408
|
+
if (!copy.termsVersion) return null;
|
|
16409
|
+
const boxId = id ?? "checkout-terms";
|
|
16410
|
+
const errorId = `${boxId}-error`;
|
|
16411
|
+
const [before, after] = splitTermsLabel(copy.termsCheckboxLabel).map(
|
|
16412
|
+
(part) => part.replaceAll("{tenant}", copy.tenantName)
|
|
16413
|
+
);
|
|
16414
|
+
const newTab = copy.isTermsLinkNewTab;
|
|
16415
|
+
return /* @__PURE__ */ jsxs30("div", { "data-slot": "checkout-terms", className: cn26("space-y-1", className), children: [
|
|
16416
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-start gap-3", children: [
|
|
16417
|
+
/* @__PURE__ */ jsx32(
|
|
16418
|
+
"input",
|
|
16419
|
+
{
|
|
16420
|
+
id: boxId,
|
|
16421
|
+
type: "checkbox",
|
|
16422
|
+
required: true,
|
|
16423
|
+
checked,
|
|
16424
|
+
onChange: (e) => onCheckedChange(e.target.checked),
|
|
16425
|
+
"aria-invalid": error ? true : void 0,
|
|
16426
|
+
"aria-describedby": error ? errorId : void 0,
|
|
16427
|
+
className: "mt-0.5 size-5 shrink-0 cursor-pointer accent-primary"
|
|
16428
|
+
}
|
|
16429
|
+
),
|
|
16430
|
+
/* @__PURE__ */ jsxs30("label", { htmlFor: boxId, className: "text-sm leading-relaxed", children: [
|
|
16431
|
+
before,
|
|
16432
|
+
/* @__PURE__ */ jsxs30(
|
|
16433
|
+
"a",
|
|
16434
|
+
{
|
|
16435
|
+
href: copy.termsLinkUrl ?? termsHref,
|
|
16436
|
+
...newTab ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
16437
|
+
className: "font-medium underline underline-offset-2 hover:text-primary",
|
|
16438
|
+
children: [
|
|
16439
|
+
copy.termsLinkText,
|
|
16440
|
+
newTab ? /* @__PURE__ */ jsxs30(Fragment7, { children: [
|
|
16441
|
+
" ",
|
|
16442
|
+
/* @__PURE__ */ jsx32("span", { className: "sr-only", children: newTabHint })
|
|
16443
|
+
] }) : null
|
|
16444
|
+
]
|
|
16445
|
+
}
|
|
16446
|
+
),
|
|
16447
|
+
after
|
|
16448
|
+
] })
|
|
16449
|
+
] }),
|
|
16450
|
+
error ? /* @__PURE__ */ jsx32("p", { id: errorId, className: "pl-8 text-sm text-destructive", children: error }) : null
|
|
16451
|
+
] });
|
|
16452
|
+
}
|
|
16453
|
+
function toCheckoutTermsFields(copy, accepted) {
|
|
16454
|
+
const version = copy?.termsVersion;
|
|
16455
|
+
return version ? { acceptsTerms: accepted, termsVersionId: version.id } : {};
|
|
16456
|
+
}
|
|
16457
|
+
|
|
16458
|
+
// src/components/checkout-pay-action.tsx
|
|
16459
|
+
import { cn as cn27 } from "@reblu/site-ui/utils";
|
|
16460
|
+
import { jsx as jsx33, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
16461
|
+
function CheckoutPayAction({
|
|
16462
|
+
label,
|
|
16463
|
+
notice,
|
|
16464
|
+
submitting = false,
|
|
16465
|
+
submittingLabel = "Procesando\u2026",
|
|
16466
|
+
disabled = false,
|
|
16467
|
+
id = "checkout-pay",
|
|
16468
|
+
className,
|
|
16469
|
+
buttonClassName,
|
|
16470
|
+
noticeClassName
|
|
16471
|
+
}) {
|
|
16472
|
+
const noticeId = `${id}-notice`;
|
|
16473
|
+
const isDisabled = submitting || disabled;
|
|
16474
|
+
return /* @__PURE__ */ jsxs31("div", { "data-slot": "checkout-pay-action", className: cn27("space-y-3", className), children: [
|
|
16475
|
+
/* @__PURE__ */ jsx33(
|
|
16476
|
+
"button",
|
|
16477
|
+
{
|
|
16478
|
+
type: "submit",
|
|
16479
|
+
disabled: isDisabled,
|
|
16480
|
+
"aria-busy": submitting || void 0,
|
|
16481
|
+
"aria-describedby": notice ? noticeId : void 0,
|
|
16482
|
+
className: buttonClassName ?? cn27(
|
|
16483
|
+
"flex w-full items-center justify-center gap-2 rounded-xl px-4 py-3 text-base font-semibold transition-all",
|
|
16484
|
+
isDisabled ? "cursor-not-allowed bg-muted text-muted-foreground" : "cursor-pointer bg-primary text-primary-foreground hover:bg-primary/90"
|
|
16485
|
+
),
|
|
16486
|
+
children: submitting ? submittingLabel : label
|
|
16487
|
+
}
|
|
16488
|
+
),
|
|
16489
|
+
notice ? /* @__PURE__ */ jsx33("p", { id: noticeId, "data-slot": "checkout-pay-notice", className: noticeClassName ?? "text-sm text-muted-foreground", children: notice }) : null
|
|
16490
|
+
] });
|
|
16491
|
+
}
|
|
16492
|
+
|
|
16034
16493
|
// src/components/contact-interest-field.tsx
|
|
16035
|
-
import { cn as
|
|
16036
|
-
import { jsx as
|
|
16494
|
+
import { cn as cn28 } from "@reblu/site-ui/utils";
|
|
16495
|
+
import { jsx as jsx34, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
16037
16496
|
function ContactInterestField({
|
|
16038
16497
|
interest,
|
|
16039
16498
|
value,
|
|
@@ -16050,18 +16509,18 @@ function ContactInterestField({
|
|
|
16050
16509
|
else next2.delete(option2);
|
|
16051
16510
|
onChange(interest.options.filter((candidate) => next2.has(candidate)));
|
|
16052
16511
|
};
|
|
16053
|
-
return /* @__PURE__ */
|
|
16054
|
-
/* @__PURE__ */
|
|
16055
|
-
/* @__PURE__ */
|
|
16512
|
+
return /* @__PURE__ */ jsxs32("fieldset", { "data-slot": "contact-interest", className: cn28("space-y-2", className), children: [
|
|
16513
|
+
/* @__PURE__ */ jsx34("legend", { className: "text-sm font-medium", children: interest.label }),
|
|
16514
|
+
/* @__PURE__ */ jsx34("div", { className: "flex flex-col gap-2", children: interest.options.map((option2, index) => {
|
|
16056
16515
|
const id = `${idPrefix}-${index}`;
|
|
16057
|
-
return /* @__PURE__ */
|
|
16516
|
+
return /* @__PURE__ */ jsxs32(
|
|
16058
16517
|
"label",
|
|
16059
16518
|
{
|
|
16060
16519
|
htmlFor: id,
|
|
16061
16520
|
"data-slot": "contact-interest-option",
|
|
16062
16521
|
className: "flex items-center gap-2 text-sm",
|
|
16063
16522
|
children: [
|
|
16064
|
-
/* @__PURE__ */
|
|
16523
|
+
/* @__PURE__ */ jsx34(
|
|
16065
16524
|
"input",
|
|
16066
16525
|
{
|
|
16067
16526
|
id,
|
|
@@ -16085,16 +16544,23 @@ import { DATA_REQUEST_TYPES } from "@reblu/site-contracts";
|
|
|
16085
16544
|
export {
|
|
16086
16545
|
ALLOWED_YOUTUBE_HOSTS,
|
|
16087
16546
|
AddedToCartToast,
|
|
16547
|
+
ArbitrationBadge,
|
|
16088
16548
|
CartAdjustmentsNotice,
|
|
16089
16549
|
CartLineList,
|
|
16090
16550
|
CartSummary,
|
|
16551
|
+
CheckoutDeliveryChoice,
|
|
16091
16552
|
CheckoutForm,
|
|
16092
16553
|
CheckoutLoginPrompt,
|
|
16554
|
+
CheckoutPayAction,
|
|
16555
|
+
CheckoutQuoteSummary,
|
|
16556
|
+
CheckoutTermsAcceptance,
|
|
16093
16557
|
ContactInterestField,
|
|
16094
16558
|
CourseCatalogFilters,
|
|
16095
16559
|
CourseDescription,
|
|
16096
16560
|
CoursePurchaseTerms,
|
|
16097
16561
|
DATA_REQUEST_TYPES,
|
|
16562
|
+
DEFAULT_CHECKOUT_DELIVERY_CHOICE_LABELS,
|
|
16563
|
+
DEFAULT_CHECKOUT_QUOTE_SUMMARY_LABELS,
|
|
16098
16564
|
DEFAULT_COURSE_CATALOG_FILTERS_LABELS,
|
|
16099
16565
|
DEFAULT_COURSE_PRICE_BANDS,
|
|
16100
16566
|
DEFAULT_COURSE_PURCHASE_TERMS_LABELS,
|
|
@@ -16106,6 +16572,7 @@ export {
|
|
|
16106
16572
|
DEFAULT_TRUST_BADGE_HEADINGS,
|
|
16107
16573
|
DEFAULT_TRUST_BADGE_TYPE_ORDER,
|
|
16108
16574
|
DEFAULT_TRUST_ICONS,
|
|
16575
|
+
EMPTY_CHECKOUT_ADDRESS,
|
|
16109
16576
|
EMPTY_FULL_INVOICE_VALUE,
|
|
16110
16577
|
FaqAccordion,
|
|
16111
16578
|
FullInvoiceFields,
|
|
@@ -16129,17 +16596,21 @@ export {
|
|
|
16129
16596
|
buildFaqPageJsonLd,
|
|
16130
16597
|
buildShareUrls,
|
|
16131
16598
|
collectFaqItems,
|
|
16599
|
+
defaultCheckoutFulfillment,
|
|
16132
16600
|
formatPrice,
|
|
16133
16601
|
getShopErrorMessage,
|
|
16134
16602
|
isAllowedYouTubeHost,
|
|
16135
16603
|
isOverSimplifiedInvoiceCap,
|
|
16136
16604
|
markdownToPlainText,
|
|
16137
16605
|
markdownToSafeHtml,
|
|
16606
|
+
quoteRequiresDelivery,
|
|
16138
16607
|
readingTime,
|
|
16139
16608
|
sanitizeHtml,
|
|
16140
16609
|
shopIssuesInvoices,
|
|
16141
16610
|
shouldRenderShopFilters,
|
|
16142
|
-
|
|
16611
|
+
toCheckoutFulfillmentFields,
|
|
16612
|
+
toCheckoutInvoiceFields,
|
|
16613
|
+
toCheckoutTermsFields
|
|
16143
16614
|
};
|
|
16144
16615
|
/*! Bundled license information:
|
|
16145
16616
|
|