@bowlos/reservations 0.21.0 → 0.22.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/HEADLESS.md +5 -3
- package/README.md +23 -16
- package/dist/account-CO8xzUs_.d.ts +54 -0
- package/dist/account-SqT7et4C.d.cts +54 -0
- package/dist/{catalog-bpCn9klL.d.ts → catalog-BxyPJdBL.d.ts} +49 -47
- package/dist/{catalog-BuafmB8y.d.cts → catalog-D1VoVaNe.d.cts} +49 -47
- package/dist/components.cjs +32 -96
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +35 -62
- package/dist/components.d.ts +35 -62
- package/dist/components.js +31 -83
- package/dist/components.js.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/{react-BI2RKM5p.d.ts → react-B1uSOozS.d.ts} +1 -1
- package/dist/{react-D2mBw_-l.d.cts → react-Bc_6yi9q.d.cts} +1 -1
- package/dist/react.d.cts +4 -4
- package/dist/react.d.ts +4 -4
- package/package.json +2 -2
- package/templates/center-site/package.json +1 -1
- package/dist/errors-IIK7xibp.d.cts +0 -54
- package/dist/errors-IIK7xibp.d.ts +0 -54
package/dist/components.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { CSSProperties, ReactNode } from 'react';
|
|
3
3
|
import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-BKlgn8Ln.cjs';
|
|
4
|
-
import { c as UseAccountResult } from './react-
|
|
5
|
-
import './
|
|
4
|
+
import { c as UseAccountResult } from './react-Bc_6yi9q.cjs';
|
|
5
|
+
import { g as CatalogItem } from './catalog-D1VoVaNe.cjs';
|
|
6
|
+
export { h as CatalogResult, i as CatalogSection } from './catalog-D1VoVaNe.cjs';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Themeable design tokens for the `@bowlos/reservations/components` layer.
|
|
@@ -423,81 +424,53 @@ interface FlashSaleIndexProps {
|
|
|
423
424
|
*/
|
|
424
425
|
declare function FlashSaleIndex({ brandId, onOpen, labels, className }: FlashSaleIndexProps): react_jsx_runtime.JSX.Element;
|
|
425
426
|
|
|
426
|
-
/**
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
id: string;
|
|
438
|
-
slug: string;
|
|
439
|
-
name: string;
|
|
440
|
-
date: string;
|
|
441
|
-
description: string | null;
|
|
442
|
-
purchaseMode: "reservation" | "ticket";
|
|
443
|
-
productId: string | null;
|
|
444
|
-
pricePlanId: string | null;
|
|
445
|
-
priceCents: number | null;
|
|
446
|
-
} | {
|
|
447
|
-
kind: "package";
|
|
448
|
-
id: string;
|
|
449
|
-
name: string;
|
|
450
|
-
priceCents: number;
|
|
451
|
-
description: string | null;
|
|
452
|
-
} | {
|
|
453
|
-
kind: "membership";
|
|
454
|
-
id: string;
|
|
455
|
-
name: string;
|
|
456
|
-
priceCents: number;
|
|
457
|
-
description: string | null;
|
|
458
|
-
} | {
|
|
459
|
-
kind: "gamecard";
|
|
460
|
-
id: string;
|
|
461
|
-
name: string;
|
|
462
|
-
priceCents: number;
|
|
463
|
-
description: string | null;
|
|
464
|
-
};
|
|
427
|
+
/**
|
|
428
|
+
* v0.22.0 (BREAKING): `<BookingCatalog>` is now built on the canonical
|
|
429
|
+
* visibility-aware catalog read (`useCatalog` / `listPublicCatalog`) — the
|
|
430
|
+
* same read the white-label web and mobile surfaces consume — so the Center
|
|
431
|
+
* admin's per-surface visibility toggles finally apply to the drop-in.
|
|
432
|
+
*
|
|
433
|
+
* `onSelect` now receives a `CatalogItem` (route by `item.action.type` with
|
|
434
|
+
* the IDs in `item.action.payload`) instead of the old per-kind
|
|
435
|
+
* `CatalogOffer` union. See HEADLESS.md → "The canonical catalog" for the
|
|
436
|
+
* routing table; the drop-in and a headless site now route identically.
|
|
437
|
+
*/
|
|
465
438
|
interface BookingCatalogLabels {
|
|
466
439
|
heading: string;
|
|
467
440
|
loading: string;
|
|
468
441
|
empty: string;
|
|
469
|
-
bowling: string;
|
|
470
|
-
otherAttractions: string;
|
|
471
|
-
events: string;
|
|
472
|
-
packages: string;
|
|
473
|
-
memberships: string;
|
|
474
|
-
gamePasses: string;
|
|
475
442
|
select: string;
|
|
476
|
-
minutesAbbrev: string;
|
|
477
|
-
perMonth: string;
|
|
478
443
|
}
|
|
479
444
|
interface BookingCatalogProps {
|
|
480
|
-
/** Brand (packages + game passes) and Center (products + events + memberships). */
|
|
481
445
|
brandId: string;
|
|
482
446
|
centerId: string;
|
|
483
447
|
/**
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
|
|
487
|
-
|
|
448
|
+
* The surface whose admin visibility rules apply. Defaults to
|
|
449
|
+
* "sdk_custom_site" (a center's own SDK-built site).
|
|
450
|
+
*/
|
|
451
|
+
surface?: "sdk_custom_site" | "white_label_web" | "mobile_app";
|
|
452
|
+
/**
|
|
453
|
+
* Called when a customer picks an item. Route by `item.action.type`:
|
|
454
|
+
* `book_reservation` → your `<BookingFlow>` (payload.productId);
|
|
455
|
+
* `view_event` / `buy_ticket` → the event landing by payload.slug;
|
|
456
|
+
* `buy_package` / `buy_membership` / `buy_game_pass` → that buy flow
|
|
457
|
+
* (payload.packageId / templateId).
|
|
488
458
|
*/
|
|
489
|
-
onSelect: (
|
|
459
|
+
onSelect: (item: CatalogItem) => void;
|
|
490
460
|
labels?: Partial<BookingCatalogLabels>;
|
|
461
|
+
/** Override a section heading by its category key (backend labels are
|
|
462
|
+
* the default), e.g. `{ game_passes: "Punch cards" }`. */
|
|
463
|
+
sectionLabels?: Partial<Record<string, string>>;
|
|
491
464
|
className?: string;
|
|
492
465
|
}
|
|
493
466
|
/**
|
|
494
|
-
* The categorized catalog of everything a Center sells online
|
|
495
|
-
*
|
|
496
|
-
*
|
|
497
|
-
*
|
|
498
|
-
* `<BowlosProvider>`; theme with `<BowlosTheme>`.
|
|
467
|
+
* The categorized catalog of everything a Center sells online, exactly as the
|
|
468
|
+
* Center admin's Public Catalog page configured it for this surface. Picking
|
|
469
|
+
* an item hands off via `onSelect`. Indicative prices only (`priceLabel`);
|
|
470
|
+
* binding prices come from the per-category previews after login. Must render
|
|
471
|
+
* inside a `<BowlosProvider>`; theme with `<BowlosTheme>`.
|
|
499
472
|
*/
|
|
500
|
-
declare function BookingCatalog({ brandId, centerId, onSelect, labels, className }: BookingCatalogProps): react_jsx_runtime.JSX.Element;
|
|
473
|
+
declare function BookingCatalog({ brandId, centerId, surface, onSelect, labels, sectionLabels, className, }: BookingCatalogProps): react_jsx_runtime.JSX.Element;
|
|
501
474
|
|
|
502
475
|
/**
|
|
503
476
|
* Shared primitives for the `@bowlos/reservations/components` layer.
|
|
@@ -514,4 +487,4 @@ declare function formatCents(cents: number): string;
|
|
|
514
487
|
/** A min–max money range, collapsing to one value when they're equal. */
|
|
515
488
|
declare function formatCentsRange(minCents: number, maxCents: number): string;
|
|
516
489
|
|
|
517
|
-
export { AccountDashboard, type AccountDashboardLabels, type AccountDashboardProps, AccountMenu, type AccountMenuLabels, type AccountMenuProps, type AccountSection, AuthForm, AuthGate, type AuthGateLabels, type AuthGateProps, type AuthGateRenderContext, BOWLOS_DEFAULT_THEME, BookingCatalog, type BookingCatalogLabels, type BookingCatalogProps, BookingFlow, type BookingFlowLabels, type BookingFlowProps, BowlosTheme, type BowlosThemeTokens,
|
|
490
|
+
export { AccountDashboard, type AccountDashboardLabels, type AccountDashboardProps, AccountMenu, type AccountMenuLabels, type AccountMenuProps, type AccountSection, AuthForm, AuthGate, type AuthGateLabels, type AuthGateProps, type AuthGateRenderContext, BOWLOS_DEFAULT_THEME, BookingCatalog, type BookingCatalogLabels, type BookingCatalogProps, BookingFlow, type BookingFlowLabels, type BookingFlowProps, BowlosTheme, type BowlosThemeTokens, CatalogItem, type FlashBrand, FlashSale, FlashSaleIndex, type FlashSaleIndexItem, type FlashSaleIndexLabels, type FlashSaleIndexProps, type FlashSaleIndexView, type FlashSaleItem, type FlashSaleLabels, type FlashSaleProps, type FlashSaleView, type MyCreditEntry, type MyCredits, type MyLoyalty, type MyMembershipSummary, type MyPass, type MyReservationSummary, formatCents, formatCentsRange };
|
package/dist/components.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { CSSProperties, ReactNode } from 'react';
|
|
3
3
|
import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-BKlgn8Ln.js';
|
|
4
|
-
import { c as UseAccountResult } from './react-
|
|
5
|
-
import './
|
|
4
|
+
import { c as UseAccountResult } from './react-B1uSOozS.js';
|
|
5
|
+
import { g as CatalogItem } from './catalog-BxyPJdBL.js';
|
|
6
|
+
export { h as CatalogResult, i as CatalogSection } from './catalog-BxyPJdBL.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Themeable design tokens for the `@bowlos/reservations/components` layer.
|
|
@@ -423,81 +424,53 @@ interface FlashSaleIndexProps {
|
|
|
423
424
|
*/
|
|
424
425
|
declare function FlashSaleIndex({ brandId, onOpen, labels, className }: FlashSaleIndexProps): react_jsx_runtime.JSX.Element;
|
|
425
426
|
|
|
426
|
-
/**
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
id: string;
|
|
438
|
-
slug: string;
|
|
439
|
-
name: string;
|
|
440
|
-
date: string;
|
|
441
|
-
description: string | null;
|
|
442
|
-
purchaseMode: "reservation" | "ticket";
|
|
443
|
-
productId: string | null;
|
|
444
|
-
pricePlanId: string | null;
|
|
445
|
-
priceCents: number | null;
|
|
446
|
-
} | {
|
|
447
|
-
kind: "package";
|
|
448
|
-
id: string;
|
|
449
|
-
name: string;
|
|
450
|
-
priceCents: number;
|
|
451
|
-
description: string | null;
|
|
452
|
-
} | {
|
|
453
|
-
kind: "membership";
|
|
454
|
-
id: string;
|
|
455
|
-
name: string;
|
|
456
|
-
priceCents: number;
|
|
457
|
-
description: string | null;
|
|
458
|
-
} | {
|
|
459
|
-
kind: "gamecard";
|
|
460
|
-
id: string;
|
|
461
|
-
name: string;
|
|
462
|
-
priceCents: number;
|
|
463
|
-
description: string | null;
|
|
464
|
-
};
|
|
427
|
+
/**
|
|
428
|
+
* v0.22.0 (BREAKING): `<BookingCatalog>` is now built on the canonical
|
|
429
|
+
* visibility-aware catalog read (`useCatalog` / `listPublicCatalog`) — the
|
|
430
|
+
* same read the white-label web and mobile surfaces consume — so the Center
|
|
431
|
+
* admin's per-surface visibility toggles finally apply to the drop-in.
|
|
432
|
+
*
|
|
433
|
+
* `onSelect` now receives a `CatalogItem` (route by `item.action.type` with
|
|
434
|
+
* the IDs in `item.action.payload`) instead of the old per-kind
|
|
435
|
+
* `CatalogOffer` union. See HEADLESS.md → "The canonical catalog" for the
|
|
436
|
+
* routing table; the drop-in and a headless site now route identically.
|
|
437
|
+
*/
|
|
465
438
|
interface BookingCatalogLabels {
|
|
466
439
|
heading: string;
|
|
467
440
|
loading: string;
|
|
468
441
|
empty: string;
|
|
469
|
-
bowling: string;
|
|
470
|
-
otherAttractions: string;
|
|
471
|
-
events: string;
|
|
472
|
-
packages: string;
|
|
473
|
-
memberships: string;
|
|
474
|
-
gamePasses: string;
|
|
475
442
|
select: string;
|
|
476
|
-
minutesAbbrev: string;
|
|
477
|
-
perMonth: string;
|
|
478
443
|
}
|
|
479
444
|
interface BookingCatalogProps {
|
|
480
|
-
/** Brand (packages + game passes) and Center (products + events + memberships). */
|
|
481
445
|
brandId: string;
|
|
482
446
|
centerId: string;
|
|
483
447
|
/**
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
|
|
487
|
-
|
|
448
|
+
* The surface whose admin visibility rules apply. Defaults to
|
|
449
|
+
* "sdk_custom_site" (a center's own SDK-built site).
|
|
450
|
+
*/
|
|
451
|
+
surface?: "sdk_custom_site" | "white_label_web" | "mobile_app";
|
|
452
|
+
/**
|
|
453
|
+
* Called when a customer picks an item. Route by `item.action.type`:
|
|
454
|
+
* `book_reservation` → your `<BookingFlow>` (payload.productId);
|
|
455
|
+
* `view_event` / `buy_ticket` → the event landing by payload.slug;
|
|
456
|
+
* `buy_package` / `buy_membership` / `buy_game_pass` → that buy flow
|
|
457
|
+
* (payload.packageId / templateId).
|
|
488
458
|
*/
|
|
489
|
-
onSelect: (
|
|
459
|
+
onSelect: (item: CatalogItem) => void;
|
|
490
460
|
labels?: Partial<BookingCatalogLabels>;
|
|
461
|
+
/** Override a section heading by its category key (backend labels are
|
|
462
|
+
* the default), e.g. `{ game_passes: "Punch cards" }`. */
|
|
463
|
+
sectionLabels?: Partial<Record<string, string>>;
|
|
491
464
|
className?: string;
|
|
492
465
|
}
|
|
493
466
|
/**
|
|
494
|
-
* The categorized catalog of everything a Center sells online
|
|
495
|
-
*
|
|
496
|
-
*
|
|
497
|
-
*
|
|
498
|
-
* `<BowlosProvider>`; theme with `<BowlosTheme>`.
|
|
467
|
+
* The categorized catalog of everything a Center sells online, exactly as the
|
|
468
|
+
* Center admin's Public Catalog page configured it for this surface. Picking
|
|
469
|
+
* an item hands off via `onSelect`. Indicative prices only (`priceLabel`);
|
|
470
|
+
* binding prices come from the per-category previews after login. Must render
|
|
471
|
+
* inside a `<BowlosProvider>`; theme with `<BowlosTheme>`.
|
|
499
472
|
*/
|
|
500
|
-
declare function BookingCatalog({ brandId, centerId, onSelect, labels, className }: BookingCatalogProps): react_jsx_runtime.JSX.Element;
|
|
473
|
+
declare function BookingCatalog({ brandId, centerId, surface, onSelect, labels, sectionLabels, className, }: BookingCatalogProps): react_jsx_runtime.JSX.Element;
|
|
501
474
|
|
|
502
475
|
/**
|
|
503
476
|
* Shared primitives for the `@bowlos/reservations/components` layer.
|
|
@@ -514,4 +487,4 @@ declare function formatCents(cents: number): string;
|
|
|
514
487
|
/** A min–max money range, collapsing to one value when they're equal. */
|
|
515
488
|
declare function formatCentsRange(minCents: number, maxCents: number): string;
|
|
516
489
|
|
|
517
|
-
export { AccountDashboard, type AccountDashboardLabels, type AccountDashboardProps, AccountMenu, type AccountMenuLabels, type AccountMenuProps, type AccountSection, AuthForm, AuthGate, type AuthGateLabels, type AuthGateProps, type AuthGateRenderContext, BOWLOS_DEFAULT_THEME, BookingCatalog, type BookingCatalogLabels, type BookingCatalogProps, BookingFlow, type BookingFlowLabels, type BookingFlowProps, BowlosTheme, type BowlosThemeTokens,
|
|
490
|
+
export { AccountDashboard, type AccountDashboardLabels, type AccountDashboardProps, AccountMenu, type AccountMenuLabels, type AccountMenuProps, type AccountSection, AuthForm, AuthGate, type AuthGateLabels, type AuthGateProps, type AuthGateRenderContext, BOWLOS_DEFAULT_THEME, BookingCatalog, type BookingCatalogLabels, type BookingCatalogProps, BookingFlow, type BookingFlowLabels, type BookingFlowProps, BowlosTheme, type BowlosThemeTokens, CatalogItem, type FlashBrand, FlashSale, FlashSaleIndex, type FlashSaleIndexItem, type FlashSaleIndexLabels, type FlashSaleIndexProps, type FlashSaleIndexView, type FlashSaleItem, type FlashSaleLabels, type FlashSaleProps, type FlashSaleView, type MyCreditEntry, type MyCredits, type MyLoyalty, type MyMembershipSummary, type MyPass, type MyReservationSummary, formatCents, formatCentsRange };
|
package/dist/components.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useBookingFlow, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales,
|
|
1
|
+
import { useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useBookingFlow, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useCatalog } from './chunk-FV6SROO2.js';
|
|
2
2
|
import { availableUnitCount } from './chunk-S5T4OCBY.js';
|
|
3
3
|
import { styles, formatCents, formatMinuteLabel, token, minutesToTime, useCountdown, formatCentsRange } from './chunk-Y3YSDO3H.js';
|
|
4
4
|
export { BOWLOS_DEFAULT_THEME, BowlosTheme, formatCents, formatCentsRange } from './chunk-Y3YSDO3H.js';
|
|
@@ -827,105 +827,53 @@ var DEFAULT_LABELS7 = {
|
|
|
827
827
|
heading: "What would you like to book?",
|
|
828
828
|
loading: "Loading\u2026",
|
|
829
829
|
empty: "Nothing is available to book online right now.",
|
|
830
|
-
|
|
831
|
-
otherAttractions: "Other attractions",
|
|
832
|
-
events: "Events",
|
|
833
|
-
packages: "Packages",
|
|
834
|
-
memberships: "Memberships",
|
|
835
|
-
gamePasses: "Game passes",
|
|
836
|
-
select: "Select",
|
|
837
|
-
minutesAbbrev: "min",
|
|
838
|
-
perMonth: "/mo"
|
|
830
|
+
select: "Select"
|
|
839
831
|
};
|
|
840
|
-
function BookingCatalog({
|
|
832
|
+
function BookingCatalog({
|
|
833
|
+
brandId,
|
|
834
|
+
centerId,
|
|
835
|
+
surface = "sdk_custom_site",
|
|
836
|
+
onSelect,
|
|
837
|
+
labels,
|
|
838
|
+
sectionLabels,
|
|
839
|
+
className
|
|
840
|
+
}) {
|
|
841
841
|
const t = { ...DEFAULT_LABELS7, ...labels };
|
|
842
842
|
const s = styles();
|
|
843
|
-
const
|
|
844
|
-
const
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
const gameCards = useGameCards({ brandId, centerId });
|
|
848
|
-
const reads = [products, events, packages, memberships, gameCards];
|
|
849
|
-
const anyLoading = reads.some((r) => r.loading && !r.data);
|
|
850
|
-
const productRows = products.data ?? [];
|
|
851
|
-
const bowling = productRows.filter((p) => p.attractionTypeKey === "bowling").map((p) => ({ kind: "product", ...p }));
|
|
852
|
-
const other = productRows.filter((p) => p.attractionTypeKey !== "bowling").map((p) => ({ kind: "product", ...p }));
|
|
853
|
-
const eventOffers = (events.data ?? []).map((e) => ({
|
|
854
|
-
kind: "event",
|
|
855
|
-
id: e.id,
|
|
856
|
-
slug: e.slug,
|
|
857
|
-
name: e.title,
|
|
858
|
-
date: e.date,
|
|
859
|
-
description: e.subtitle ?? e.description,
|
|
860
|
-
purchaseMode: e.purchaseMode,
|
|
861
|
-
productId: e.productId,
|
|
862
|
-
pricePlanId: e.pricePlanId,
|
|
863
|
-
priceCents: e.priceCents
|
|
864
|
-
}));
|
|
865
|
-
const packageOffers = (packages.data ?? []).map((p) => ({
|
|
866
|
-
kind: "package",
|
|
867
|
-
id: p.id,
|
|
868
|
-
name: p.name,
|
|
869
|
-
priceCents: p.basePriceCents,
|
|
870
|
-
description: p.description
|
|
871
|
-
}));
|
|
872
|
-
const membershipOffers = (memberships.data ?? []).map((m) => ({
|
|
873
|
-
kind: "membership",
|
|
874
|
-
id: m.id,
|
|
875
|
-
name: m.name,
|
|
876
|
-
priceCents: m.recurringPriceCents,
|
|
877
|
-
description: m.description
|
|
878
|
-
}));
|
|
879
|
-
const gameCardOffers = (gameCards.data ?? []).map((g) => ({
|
|
880
|
-
kind: "gamecard",
|
|
881
|
-
id: g.id,
|
|
882
|
-
name: g.name,
|
|
883
|
-
priceCents: g.priceCents,
|
|
884
|
-
description: g.description
|
|
885
|
-
}));
|
|
886
|
-
const sections = [
|
|
887
|
-
{ title: t.bowling, offers: bowling },
|
|
888
|
-
{ title: t.otherAttractions, offers: other },
|
|
889
|
-
{ title: t.events, offers: eventOffers },
|
|
890
|
-
{ title: t.packages, offers: packageOffers },
|
|
891
|
-
{ title: t.memberships, offers: membershipOffers },
|
|
892
|
-
{ title: t.gamePasses, offers: gameCardOffers }
|
|
893
|
-
].filter((sec) => sec.offers.length > 0);
|
|
843
|
+
const catalog = useCatalog({ brandId, centerId, surface });
|
|
844
|
+
const sections = (catalog.data?.sections ?? []).filter(
|
|
845
|
+
(sec) => sec.items.length > 0
|
|
846
|
+
);
|
|
894
847
|
let body;
|
|
895
|
-
if (
|
|
848
|
+
if (catalog.loading && !catalog.data) {
|
|
896
849
|
body = /* @__PURE__ */ jsx("p", { style: s.muted, children: t.loading });
|
|
897
850
|
} else if (sections.length === 0) {
|
|
898
851
|
body = /* @__PURE__ */ jsx("p", { style: s.muted, children: t.empty });
|
|
899
852
|
} else {
|
|
900
853
|
body = sections.map((sec) => /* @__PURE__ */ jsxs("section", { style: { marginTop: "0.5rem" }, children: [
|
|
901
|
-
/* @__PURE__ */ jsx("h4", { style: s.sectionTitle, children: sec.
|
|
902
|
-
sec.
|
|
854
|
+
/* @__PURE__ */ jsx("h4", { style: s.sectionTitle, children: sectionLabels?.[sec.key] ?? sec.label }),
|
|
855
|
+
sec.items.map((item) => /* @__PURE__ */ jsxs("div", { style: s.listItem, children: [
|
|
903
856
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
904
|
-
/* @__PURE__ */ jsx("p", { style: s.listTitle, children:
|
|
905
|
-
/* @__PURE__ */ jsx("p", { style: s.listMeta, children: subtitle
|
|
857
|
+
/* @__PURE__ */ jsx("p", { style: s.listTitle, children: item.title }),
|
|
858
|
+
/* @__PURE__ */ jsx("p", { style: s.listMeta, children: item.priceLabel ?? item.subtitle ?? "" })
|
|
906
859
|
] }),
|
|
907
|
-
/* @__PURE__ */ jsx(
|
|
908
|
-
|
|
909
|
-
|
|
860
|
+
/* @__PURE__ */ jsx(
|
|
861
|
+
"button",
|
|
862
|
+
{
|
|
863
|
+
type: "button",
|
|
864
|
+
style: s.primaryBtn,
|
|
865
|
+
onClick: () => onSelect(item),
|
|
866
|
+
children: t.select
|
|
867
|
+
}
|
|
868
|
+
)
|
|
869
|
+
] }, item.id))
|
|
870
|
+
] }, sec.key));
|
|
910
871
|
}
|
|
911
872
|
return /* @__PURE__ */ jsxs("div", { className, style: s.card, children: [
|
|
912
873
|
/* @__PURE__ */ jsx("h3", { style: s.heading, children: t.heading }),
|
|
913
874
|
body
|
|
914
875
|
] });
|
|
915
876
|
}
|
|
916
|
-
function subtitle(offer, t) {
|
|
917
|
-
switch (offer.kind) {
|
|
918
|
-
case "product":
|
|
919
|
-
return `${offer.attractionName} \xB7 ${offer.durationMinutes} ${t.minutesAbbrev}`;
|
|
920
|
-
case "event":
|
|
921
|
-
return offer.priceCents !== null ? `${offer.date} \xB7 ${formatCents(offer.priceCents)}` : offer.date;
|
|
922
|
-
case "membership":
|
|
923
|
-
return `${formatCents(offer.priceCents)}${t.perMonth}`;
|
|
924
|
-
case "package":
|
|
925
|
-
case "gamecard":
|
|
926
|
-
return formatCents(offer.priceCents);
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
877
|
|
|
930
878
|
export { AccountDashboard, AccountMenu, AuthForm, AuthGate, BookingCatalog, BookingFlow, FlashSale, FlashSaleIndex };
|
|
931
879
|
//# sourceMappingURL=components.js.map
|