@bowlos/reservations 0.22.1 → 0.24.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 +121 -0
- package/README.md +16 -1
- package/dist/{account-Bm2XnaYS.d.ts → account-B9tDfXke.d.ts} +76 -1
- package/dist/{account-CSaBohMT.d.cts → account-C9SvfE3q.d.cts} +76 -1
- package/dist/{catalog-BxyPJdBL.d.ts → catalog-BPh01sfG.d.ts} +9 -0
- package/dist/{catalog-D1VoVaNe.d.cts → catalog-I7Lpar3V.d.cts} +9 -0
- package/dist/{chunk-FV6SROO2.js → chunk-CRETIPLS.js} +83 -6
- package/dist/chunk-CRETIPLS.js.map +1 -0
- package/dist/components.cjs +166 -52
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +30 -24
- package/dist/components.d.ts +30 -24
- package/dist/components.js +135 -19
- package/dist/components.js.map +1 -1
- package/dist/index.cjs +36 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +28 -1
- package/dist/index.js.map +1 -1
- package/dist/{react-Bc_6yi9q.d.cts → react--584Q9zx.d.cts} +15 -2
- package/dist/{react-B1uSOozS.d.ts → react-C0c5k3Tt.d.ts} +15 -2
- package/dist/react.cjs +185 -98
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +37 -10
- package/dist/react.d.ts +37 -10
- package/dist/react.js +2 -2
- package/package.json +1 -1
- package/templates/center-site/package.json +1 -1
- package/dist/chunk-FV6SROO2.js.map +0 -1
package/dist/components.d.cts
CHANGED
|
@@ -1,9 +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 {
|
|
5
|
-
import { g as CatalogItem } from './catalog-
|
|
6
|
-
export { h as CatalogResult, i as CatalogSection } from './catalog-
|
|
4
|
+
import { d as UseAccountResult } from './react--584Q9zx.cjs';
|
|
5
|
+
import { g as CatalogItem } from './catalog-I7Lpar3V.cjs';
|
|
6
|
+
export { h as CatalogResult, i as CatalogSection } from './catalog-I7Lpar3V.cjs';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Themeable design tokens for the `@bowlos/reservations/components` layer.
|
|
@@ -425,42 +425,48 @@ interface FlashSaleIndexProps {
|
|
|
425
425
|
declare function FlashSaleIndex({ brandId, onOpen, labels, className }: FlashSaleIndexProps): react_jsx_runtime.JSX.Element;
|
|
426
426
|
|
|
427
427
|
/**
|
|
428
|
-
* v0.22.0 (BREAKING): `<BookingCatalog>` is
|
|
428
|
+
* v0.22.0 (BREAKING): `<BookingCatalog>` is built on the canonical
|
|
429
429
|
* visibility-aware catalog read (`useCatalog` / `listPublicCatalog`) — the
|
|
430
|
-
* same read the white-label web and mobile surfaces consume
|
|
431
|
-
* admin's per-surface visibility toggles finally apply to the drop-in.
|
|
430
|
+
* same read the white-label web and mobile surfaces consume.
|
|
432
431
|
*
|
|
433
|
-
*
|
|
434
|
-
*
|
|
435
|
-
*
|
|
436
|
-
*
|
|
432
|
+
* v0.24.0: date-first booking. The catalog read returns the Center's
|
|
433
|
+
* `bookingEntryDefault`; this component opens on it and shows a "by activity /
|
|
434
|
+
* by date" toggle the customer can flip. Date-first lists what's bookable on a
|
|
435
|
+
* chosen day (per-product availability via the existing `availableStartTimes`
|
|
436
|
+
* read) + the events section + an "any day" strip (memberships / game passes /
|
|
437
|
+
* packages). Headless sites build the same from `useCatalog` + `useStartTimes`
|
|
438
|
+
* — see HEADLESS.md → "Date-first booking".
|
|
439
|
+
*
|
|
440
|
+
* `onSelect` receives a `CatalogItem` (route by `item.action.type` with the IDs
|
|
441
|
+
* in `item.action.payload`); the drop-in and a headless site route identically.
|
|
437
442
|
*/
|
|
438
443
|
interface BookingCatalogLabels {
|
|
439
444
|
heading: string;
|
|
440
445
|
loading: string;
|
|
441
446
|
empty: string;
|
|
442
447
|
select: string;
|
|
448
|
+
byActivity: string;
|
|
449
|
+
byDate: string;
|
|
450
|
+
pickDay: string;
|
|
451
|
+
bookableOnPrefix: string;
|
|
452
|
+
events: string;
|
|
453
|
+
anyDay: string;
|
|
454
|
+
noTimesThatDay: string;
|
|
455
|
+
nothingThatDay: string;
|
|
456
|
+
checking: string;
|
|
443
457
|
}
|
|
458
|
+
type EntryMode = "product_first" | "date_first";
|
|
444
459
|
interface BookingCatalogProps {
|
|
445
460
|
brandId: string;
|
|
446
461
|
centerId: string;
|
|
447
|
-
/**
|
|
448
|
-
* The surface whose admin visibility rules apply. Defaults to
|
|
449
|
-
* "sdk_custom_site" (a center's own SDK-built site).
|
|
450
|
-
*/
|
|
451
462
|
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).
|
|
458
|
-
*/
|
|
459
463
|
onSelect: (item: CatalogItem) => void;
|
|
460
464
|
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
465
|
sectionLabels?: Partial<Record<string, string>>;
|
|
466
|
+
/** Force the entry point, ignoring the Center default. */
|
|
467
|
+
defaultEntry?: EntryMode;
|
|
468
|
+
/** Show the by-activity / by-date toggle (default true). */
|
|
469
|
+
showEntryToggle?: boolean;
|
|
464
470
|
className?: string;
|
|
465
471
|
}
|
|
466
472
|
/**
|
|
@@ -470,7 +476,7 @@ interface BookingCatalogProps {
|
|
|
470
476
|
* binding prices come from the per-category previews after login. Must render
|
|
471
477
|
* inside a `<BowlosProvider>`; theme with `<BowlosTheme>`.
|
|
472
478
|
*/
|
|
473
|
-
declare function BookingCatalog({ brandId, centerId, surface, onSelect, labels, sectionLabels, className, }: BookingCatalogProps): react_jsx_runtime.JSX.Element;
|
|
479
|
+
declare function BookingCatalog({ brandId, centerId, surface, onSelect, labels, sectionLabels, defaultEntry, showEntryToggle, className, }: BookingCatalogProps): react_jsx_runtime.JSX.Element;
|
|
474
480
|
|
|
475
481
|
/**
|
|
476
482
|
* Shared primitives for the `@bowlos/reservations/components` layer.
|
package/dist/components.d.ts
CHANGED
|
@@ -1,9 +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 {
|
|
5
|
-
import { g as CatalogItem } from './catalog-
|
|
6
|
-
export { h as CatalogResult, i as CatalogSection } from './catalog-
|
|
4
|
+
import { d as UseAccountResult } from './react-C0c5k3Tt.js';
|
|
5
|
+
import { g as CatalogItem } from './catalog-BPh01sfG.js';
|
|
6
|
+
export { h as CatalogResult, i as CatalogSection } from './catalog-BPh01sfG.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Themeable design tokens for the `@bowlos/reservations/components` layer.
|
|
@@ -425,42 +425,48 @@ interface FlashSaleIndexProps {
|
|
|
425
425
|
declare function FlashSaleIndex({ brandId, onOpen, labels, className }: FlashSaleIndexProps): react_jsx_runtime.JSX.Element;
|
|
426
426
|
|
|
427
427
|
/**
|
|
428
|
-
* v0.22.0 (BREAKING): `<BookingCatalog>` is
|
|
428
|
+
* v0.22.0 (BREAKING): `<BookingCatalog>` is built on the canonical
|
|
429
429
|
* visibility-aware catalog read (`useCatalog` / `listPublicCatalog`) — the
|
|
430
|
-
* same read the white-label web and mobile surfaces consume
|
|
431
|
-
* admin's per-surface visibility toggles finally apply to the drop-in.
|
|
430
|
+
* same read the white-label web and mobile surfaces consume.
|
|
432
431
|
*
|
|
433
|
-
*
|
|
434
|
-
*
|
|
435
|
-
*
|
|
436
|
-
*
|
|
432
|
+
* v0.24.0: date-first booking. The catalog read returns the Center's
|
|
433
|
+
* `bookingEntryDefault`; this component opens on it and shows a "by activity /
|
|
434
|
+
* by date" toggle the customer can flip. Date-first lists what's bookable on a
|
|
435
|
+
* chosen day (per-product availability via the existing `availableStartTimes`
|
|
436
|
+
* read) + the events section + an "any day" strip (memberships / game passes /
|
|
437
|
+
* packages). Headless sites build the same from `useCatalog` + `useStartTimes`
|
|
438
|
+
* — see HEADLESS.md → "Date-first booking".
|
|
439
|
+
*
|
|
440
|
+
* `onSelect` receives a `CatalogItem` (route by `item.action.type` with the IDs
|
|
441
|
+
* in `item.action.payload`); the drop-in and a headless site route identically.
|
|
437
442
|
*/
|
|
438
443
|
interface BookingCatalogLabels {
|
|
439
444
|
heading: string;
|
|
440
445
|
loading: string;
|
|
441
446
|
empty: string;
|
|
442
447
|
select: string;
|
|
448
|
+
byActivity: string;
|
|
449
|
+
byDate: string;
|
|
450
|
+
pickDay: string;
|
|
451
|
+
bookableOnPrefix: string;
|
|
452
|
+
events: string;
|
|
453
|
+
anyDay: string;
|
|
454
|
+
noTimesThatDay: string;
|
|
455
|
+
nothingThatDay: string;
|
|
456
|
+
checking: string;
|
|
443
457
|
}
|
|
458
|
+
type EntryMode = "product_first" | "date_first";
|
|
444
459
|
interface BookingCatalogProps {
|
|
445
460
|
brandId: string;
|
|
446
461
|
centerId: string;
|
|
447
|
-
/**
|
|
448
|
-
* The surface whose admin visibility rules apply. Defaults to
|
|
449
|
-
* "sdk_custom_site" (a center's own SDK-built site).
|
|
450
|
-
*/
|
|
451
462
|
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).
|
|
458
|
-
*/
|
|
459
463
|
onSelect: (item: CatalogItem) => void;
|
|
460
464
|
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
465
|
sectionLabels?: Partial<Record<string, string>>;
|
|
466
|
+
/** Force the entry point, ignoring the Center default. */
|
|
467
|
+
defaultEntry?: EntryMode;
|
|
468
|
+
/** Show the by-activity / by-date toggle (default true). */
|
|
469
|
+
showEntryToggle?: boolean;
|
|
464
470
|
className?: string;
|
|
465
471
|
}
|
|
466
472
|
/**
|
|
@@ -470,7 +476,7 @@ interface BookingCatalogProps {
|
|
|
470
476
|
* binding prices come from the per-category previews after login. Must render
|
|
471
477
|
* inside a `<BowlosProvider>`; theme with `<BowlosTheme>`.
|
|
472
478
|
*/
|
|
473
|
-
declare function BookingCatalog({ brandId, centerId, surface, onSelect, labels, sectionLabels, className, }: BookingCatalogProps): react_jsx_runtime.JSX.Element;
|
|
479
|
+
declare function BookingCatalog({ brandId, centerId, surface, onSelect, labels, sectionLabels, defaultEntry, showEntryToggle, className, }: BookingCatalogProps): react_jsx_runtime.JSX.Element;
|
|
474
480
|
|
|
475
481
|
/**
|
|
476
482
|
* Shared primitives for the `@bowlos/reservations/components` layer.
|
package/dist/components.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useBookingFlow, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useCatalog } from './chunk-
|
|
1
|
+
import { useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useBookingFlow, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useCatalog } from './chunk-CRETIPLS.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,8 +827,18 @@ 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
|
-
select: "Select"
|
|
830
|
+
select: "Select",
|
|
831
|
+
byActivity: "Browse by activity",
|
|
832
|
+
byDate: "Browse by date",
|
|
833
|
+
pickDay: "Pick a day",
|
|
834
|
+
bookableOnPrefix: "Bookable on ",
|
|
835
|
+
events: "Events",
|
|
836
|
+
anyDay: "Available any day",
|
|
837
|
+
noTimesThatDay: "No times this day",
|
|
838
|
+
nothingThatDay: "Nothing date-specific that day \u2014 try another date or see what's available any day.",
|
|
839
|
+
checking: "Checking\u2026"
|
|
831
840
|
};
|
|
841
|
+
var DATE_BOUND_KEYS = ["bowling", "other_attractions"];
|
|
832
842
|
function BookingCatalog({
|
|
833
843
|
brandId,
|
|
834
844
|
centerId,
|
|
@@ -836,44 +846,150 @@ function BookingCatalog({
|
|
|
836
846
|
onSelect,
|
|
837
847
|
labels,
|
|
838
848
|
sectionLabels,
|
|
849
|
+
defaultEntry,
|
|
850
|
+
showEntryToggle = true,
|
|
839
851
|
className
|
|
840
852
|
}) {
|
|
841
853
|
const t = { ...DEFAULT_LABELS7, ...labels };
|
|
842
854
|
const s = styles();
|
|
843
855
|
const catalog = useCatalog({ brandId, centerId, surface });
|
|
844
|
-
const
|
|
845
|
-
|
|
846
|
-
);
|
|
856
|
+
const [modeOverride, setModeOverride] = useState(null);
|
|
857
|
+
const [date, setDate] = useState(null);
|
|
858
|
+
const sections = (catalog.data?.sections ?? []).filter((sec) => sec.items.length > 0);
|
|
859
|
+
const mode = modeOverride ?? defaultEntry ?? catalog.data?.bookingEntryDefault ?? "product_first";
|
|
860
|
+
const today = catalog.data?.todayISO ?? browserTodayISO();
|
|
861
|
+
const effDate = date ?? today;
|
|
862
|
+
const renderItemRow = (item, meta, disabled) => /* @__PURE__ */ jsxs("div", { style: { ...s.listItem, opacity: 1 }, children: [
|
|
863
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
864
|
+
/* @__PURE__ */ jsx("p", { style: s.listTitle, children: item.title }),
|
|
865
|
+
/* @__PURE__ */ jsx("p", { style: s.listMeta, children: item.priceLabel ?? item.subtitle ?? "" })
|
|
866
|
+
] }),
|
|
867
|
+
/* @__PURE__ */ jsx("button", { type: "button", style: s.primaryBtn, onClick: () => onSelect(item), children: t.select })
|
|
868
|
+
] }, item.id);
|
|
847
869
|
let body;
|
|
848
870
|
if (catalog.loading && !catalog.data) {
|
|
849
871
|
body = /* @__PURE__ */ jsx("p", { style: s.muted, children: t.loading });
|
|
850
872
|
} else if (sections.length === 0) {
|
|
851
873
|
body = /* @__PURE__ */ jsx("p", { style: s.muted, children: t.empty });
|
|
852
|
-
} else {
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
] }),
|
|
874
|
+
} else if (mode === "date_first") {
|
|
875
|
+
const productItems = sections.filter((sec) => DATE_BOUND_KEYS.includes(sec.key)).flatMap((sec) => sec.items).filter((i) => i.action.type === "book_reservation");
|
|
876
|
+
const eventItems = sections.find((sec) => sec.key === "events")?.items ?? [];
|
|
877
|
+
const anytimeItems = sections.filter((sec) => !DATE_BOUND_KEYS.includes(sec.key) && sec.key !== "events").flatMap((sec) => sec.items);
|
|
878
|
+
body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
879
|
+
/* @__PURE__ */ jsxs("label", { style: { display: "flex", flexDirection: "column", gap: "0.25rem", maxWidth: "16rem" }, children: [
|
|
880
|
+
/* @__PURE__ */ jsx("span", { style: s.listMeta, children: t.pickDay }),
|
|
860
881
|
/* @__PURE__ */ jsx(
|
|
861
|
-
"
|
|
882
|
+
"input",
|
|
862
883
|
{
|
|
863
|
-
type: "
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
884
|
+
type: "date",
|
|
885
|
+
value: effDate,
|
|
886
|
+
min: today,
|
|
887
|
+
onChange: (e) => setDate(e.target.value || today),
|
|
888
|
+
style: s.input
|
|
867
889
|
}
|
|
868
890
|
)
|
|
869
|
-
] },
|
|
891
|
+
] }),
|
|
892
|
+
/* @__PURE__ */ jsxs("section", { style: { marginTop: "0.75rem" }, children: [
|
|
893
|
+
/* @__PURE__ */ jsxs("h4", { style: s.sectionTitle, children: [
|
|
894
|
+
t.bookableOnPrefix,
|
|
895
|
+
formatDay(effDate)
|
|
896
|
+
] }),
|
|
897
|
+
productItems.length === 0 ? /* @__PURE__ */ jsx("p", { style: s.muted, children: t.nothingThatDay }) : productItems.map((item) => /* @__PURE__ */ jsx(
|
|
898
|
+
ProductDateRow,
|
|
899
|
+
{
|
|
900
|
+
item,
|
|
901
|
+
dateISO: effDate,
|
|
902
|
+
onSelect,
|
|
903
|
+
labels: t,
|
|
904
|
+
s
|
|
905
|
+
},
|
|
906
|
+
item.id
|
|
907
|
+
))
|
|
908
|
+
] }),
|
|
909
|
+
eventItems.length > 0 && /* @__PURE__ */ jsxs("section", { style: { marginTop: "0.5rem" }, children: [
|
|
910
|
+
/* @__PURE__ */ jsx("h4", { style: s.sectionTitle, children: t.events }),
|
|
911
|
+
eventItems.map((item) => renderItemRow(item))
|
|
912
|
+
] }),
|
|
913
|
+
anytimeItems.length > 0 && /* @__PURE__ */ jsxs("section", { style: { marginTop: "0.5rem" }, children: [
|
|
914
|
+
/* @__PURE__ */ jsx("h4", { style: s.sectionTitle, children: t.anyDay }),
|
|
915
|
+
anytimeItems.map((item) => renderItemRow(item))
|
|
916
|
+
] })
|
|
917
|
+
] });
|
|
918
|
+
} else {
|
|
919
|
+
body = sections.map((sec) => /* @__PURE__ */ jsxs("section", { style: { marginTop: "0.5rem" }, children: [
|
|
920
|
+
/* @__PURE__ */ jsx("h4", { style: s.sectionTitle, children: sectionLabels?.[sec.key] ?? sec.label }),
|
|
921
|
+
sec.items.map((item) => renderItemRow(item))
|
|
870
922
|
] }, sec.key));
|
|
871
923
|
}
|
|
872
924
|
return /* @__PURE__ */ jsxs("div", { className, style: s.card, children: [
|
|
873
925
|
/* @__PURE__ */ jsx("h3", { style: s.heading, children: t.heading }),
|
|
926
|
+
showEntryToggle && catalog.data && /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "0.5rem", marginBottom: "0.5rem" }, children: [
|
|
927
|
+
/* @__PURE__ */ jsx(EntryButton, { active: mode === "product_first", onClick: () => setModeOverride("product_first"), s, children: t.byActivity }),
|
|
928
|
+
/* @__PURE__ */ jsx(EntryButton, { active: mode === "date_first", onClick: () => setModeOverride("date_first"), s, children: t.byDate })
|
|
929
|
+
] }),
|
|
874
930
|
body
|
|
875
931
|
] });
|
|
876
932
|
}
|
|
933
|
+
function EntryButton({
|
|
934
|
+
active,
|
|
935
|
+
onClick,
|
|
936
|
+
s,
|
|
937
|
+
children
|
|
938
|
+
}) {
|
|
939
|
+
return /* @__PURE__ */ jsx(
|
|
940
|
+
"button",
|
|
941
|
+
{
|
|
942
|
+
type: "button",
|
|
943
|
+
onClick,
|
|
944
|
+
"aria-pressed": active,
|
|
945
|
+
style: {
|
|
946
|
+
...s.primaryBtn,
|
|
947
|
+
opacity: active ? 1 : 0.5,
|
|
948
|
+
cursor: "pointer"
|
|
949
|
+
},
|
|
950
|
+
children
|
|
951
|
+
}
|
|
952
|
+
);
|
|
953
|
+
}
|
|
954
|
+
function ProductDateRow({
|
|
955
|
+
item,
|
|
956
|
+
dateISO,
|
|
957
|
+
onSelect,
|
|
958
|
+
labels,
|
|
959
|
+
s
|
|
960
|
+
}) {
|
|
961
|
+
const productId = item.action.type === "book_reservation" ? item.action.payload.productId : "";
|
|
962
|
+
const times = useStartTimes(
|
|
963
|
+
{ productId, dateISO },
|
|
964
|
+
{ enabled: productId !== "" }
|
|
965
|
+
);
|
|
966
|
+
const loading = times.loading && times.data === null;
|
|
967
|
+
const available = (times.data?.length ?? 0) > 0;
|
|
968
|
+
const meta = loading ? labels.checking : available ? item.priceLabel ?? "See times & pricing" : labels.noTimesThatDay;
|
|
969
|
+
return /* @__PURE__ */ jsxs("div", { style: { ...s.listItem, opacity: !loading && !available ? 0.55 : 1 }, children: [
|
|
970
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
971
|
+
/* @__PURE__ */ jsx("p", { style: s.listTitle, children: item.title }),
|
|
972
|
+
/* @__PURE__ */ jsx("p", { style: s.listMeta, children: meta })
|
|
973
|
+
] }),
|
|
974
|
+
available && /* @__PURE__ */ jsx("button", { type: "button", style: s.primaryBtn, onClick: () => onSelect(item), children: labels.select })
|
|
975
|
+
] });
|
|
976
|
+
}
|
|
977
|
+
function browserTodayISO() {
|
|
978
|
+
const d = /* @__PURE__ */ new Date();
|
|
979
|
+
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(
|
|
980
|
+
d.getDate()
|
|
981
|
+
).padStart(2, "0")}`;
|
|
982
|
+
}
|
|
983
|
+
function formatDay(iso) {
|
|
984
|
+
const [y, m, d] = iso.split("-").map(Number);
|
|
985
|
+
if (!y || !m || !d) return iso;
|
|
986
|
+
return new Date(Date.UTC(y, m - 1, d)).toLocaleDateString(void 0, {
|
|
987
|
+
weekday: "long",
|
|
988
|
+
month: "long",
|
|
989
|
+
day: "numeric",
|
|
990
|
+
timeZone: "UTC"
|
|
991
|
+
});
|
|
992
|
+
}
|
|
877
993
|
|
|
878
994
|
export { AccountDashboard, AccountMenu, AuthForm, AuthGate, BookingCatalog, BookingFlow, FlashSale, FlashSaleIndex };
|
|
879
995
|
//# sourceMappingURL=components.js.map
|