@bowlos/reservations 0.30.0 → 0.31.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 +59 -4
- package/README.md +11 -0
- package/dist/{catalog-C-YyKVk5.d.ts → catalog-Ck_HLOff.d.ts} +45 -1
- package/dist/{catalog-BdOZC2nx.d.cts → catalog-LU1sl0gc.d.cts} +45 -1
- package/dist/{chunk-WWKULPFX.js → chunk-EQH5HDYQ.js} +2 -2
- package/dist/{chunk-WWKULPFX.js.map → chunk-EQH5HDYQ.js.map} +1 -1
- package/dist/{chunk-44AWSRIG.js → chunk-S5GEG7SW.js} +6 -3
- package/dist/chunk-S5GEG7SW.js.map +1 -0
- package/dist/components.cjs +127 -0
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +23 -4
- package/dist/components.d.ts +23 -4
- package/dist/components.js +126 -3
- package/dist/components.js.map +1 -1
- package/dist/index.cjs +30 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +46 -2
- package/dist/index.d.ts +46 -2
- package/dist/index.js +29 -3
- package/dist/index.js.map +1 -1
- package/dist/{react-CYgFZdHO.d.cts → react-CX-zIAb5.d.cts} +1 -1
- package/dist/{react-BQaKMnCR.d.ts → react-RNgTkCVk.d.ts} +1 -1
- package/dist/react.cjs +4 -0
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +9 -4
- package/dist/react.d.ts +9 -4
- package/dist/react.js +2 -2
- package/package.json +1 -1
- package/templates/center-site/package.json +1 -1
- package/dist/chunk-44AWSRIG.js.map +0 -1
package/HEADLESS.md
CHANGED
|
@@ -628,15 +628,21 @@ lands on the **operator's** connected account, same as everything else.
|
|
|
628
628
|
const { data: pkg } = usePackage({ packageId }); // components, addons,
|
|
629
629
|
// → { name, basePriceCents, pricingMode, totalDurationMinutes,
|
|
630
630
|
// minQuantity, maxQuantity, allowedStartTimes:number[], applicabilityDays?:number[],
|
|
631
|
+
// startTimesByWeekday:[{ dayOfWeek:0-6, startTimes:number[] }], // v0.31.0 (may be [])
|
|
631
632
|
// components:[{ attractionTypeKey, durationMinutes, … }], addons:[{ _id, name, priceCents, … }] }
|
|
632
633
|
```
|
|
633
634
|
|
|
634
635
|
**2 — Compute the bookable start times.** This is the one place packages are
|
|
635
636
|
trickier than a booking, and the one place a naïve build ships a bug. A package's
|
|
636
637
|
slots are bounded by the Center's hours for the date **and** the package's own
|
|
637
|
-
|
|
638
|
+
schedule. As of **v0.31.0** a package can carry **different start times per weekday**
|
|
639
|
+
(`startTimesByWeekday`) — call `resolvePackageStartTimesForWeekday(pkg, weekday)`
|
|
640
|
+
and let it pick the right model; it returns `null` for a continuous package, `[]`
|
|
641
|
+
for a day that isn't bookable, or the exact allowed minutes:
|
|
638
642
|
|
|
639
643
|
```tsx
|
|
644
|
+
import { resolvePackageStartTimesForWeekday, weekdayForDateISO } from "@bowlos/reservations";
|
|
645
|
+
|
|
640
646
|
const typeKeys = [...new Set(pkg.components.map((c) => c.attractionTypeKey))];
|
|
641
647
|
const { data: hours } = useCenterHours({ centerId, attractionTypeKeys: typeKeys, dateISO });
|
|
642
648
|
// hours = { openMinute, closeMinute } | null (null = closed that day)
|
|
@@ -644,12 +650,17 @@ const { data: hours } = useCenterHours({ centerId, attractionTypeKeys: typeKeys,
|
|
|
644
650
|
// A slot is valid only if the whole package fits inside the open window:
|
|
645
651
|
const fits = (m: number) => hours && m >= hours.openMinute && m + pkg.totalDurationMinutes <= hours.closeMinute;
|
|
646
652
|
|
|
653
|
+
const allowed = resolvePackageStartTimesForWeekday(pkg, weekdayForDateISO(dateISO));
|
|
647
654
|
const slots =
|
|
648
|
-
|
|
649
|
-
?
|
|
650
|
-
:
|
|
655
|
+
allowed === null
|
|
656
|
+
? halfHourGrid(hours).filter(fits) // continuous package (your own grid)
|
|
657
|
+
: allowed.filter(fits); // discrete times (per-weekday OR legacy flat list); [] = not bookable that day
|
|
651
658
|
```
|
|
652
659
|
|
|
660
|
+
The helper folds the old `allowedStartTimes` + `applicabilityDays` and the new
|
|
661
|
+
per-weekday map into one call — you don't branch on which model the operator
|
|
662
|
+
chose. A day that resolves to `[]` has no slots; auto-advance to the next date.
|
|
663
|
+
|
|
653
664
|
> ⚠️ **Snap the selection to a valid slot — never submit a stale minute.** If your
|
|
654
665
|
> `<select>`'s value isn't in `slots` (e.g. the customer changed the date and the
|
|
655
666
|
> old time no longer fits), the browser shows the first option but your state still
|
|
@@ -1145,6 +1156,48 @@ block, and a staff **reply emails the customer back** from the center's domain.
|
|
|
1145
1156
|
The center's signing secret comes from BowlOS admin (Super-Admin); it's per
|
|
1146
1157
|
center and server-side only.
|
|
1147
1158
|
|
|
1159
|
+
## Retail pricing page — walk-in rates + website specials (v0.31.0)
|
|
1160
|
+
|
|
1161
|
+
A printed-menu-style **price list** for a center: the "walk-in" rates (the
|
|
1162
|
+
pricing matrix, grouped by attraction) plus any **website specials** the
|
|
1163
|
+
operator opts a price plan into. Read-only and **anonymous** — it's a pricing
|
|
1164
|
+
*display*, not a booking surface (route customers to the booking funnel
|
|
1165
|
+
separately). Because the walk-in rows come straight from the live matrix, the
|
|
1166
|
+
page can never drift from what the engine actually charges.
|
|
1167
|
+
|
|
1168
|
+
```tsx
|
|
1169
|
+
import { useRetailPricing } from "@bowlos/reservations/react";
|
|
1170
|
+
|
|
1171
|
+
const { data, loading } = useRetailPricing({ centerId });
|
|
1172
|
+
// data → {
|
|
1173
|
+
// centerName,
|
|
1174
|
+
// attractions: [{ attractionId, name, typeKey, enabledModes:("per_unit_per_hour"|
|
|
1175
|
+
// "per_person_per_hour"|"per_game")[], unitLabelSingular, unitLabelPlural,
|
|
1176
|
+
// walkInRates: [{ dayOfWeek:0-6, startMinuteOfDay, endMinuteOfDay, label,
|
|
1177
|
+
// rateUnitHourCents, ratePersonHourCents, rateGameCents }] }],
|
|
1178
|
+
// specials: [{ planId, name, description, priceCents, attractionId, attractionName,
|
|
1179
|
+
// effectiveStartDate, effectiveEndDate }] // a plan opted in via "Website special"
|
|
1180
|
+
// }
|
|
1181
|
+
```
|
|
1182
|
+
|
|
1183
|
+
Render walk-in rows per attraction, showing only the rate columns in
|
|
1184
|
+
`enabledModes` (a cell's rate for a mode is `null` when not set — show "—").
|
|
1185
|
+
Specials are the discounted features: show `description` + `priceCents`
|
|
1186
|
+
(already the operator's display price, falling back to the plan's own rate).
|
|
1187
|
+
A special with `effectiveStartDate`/`effectiveEndDate` is **seasonal** — the
|
|
1188
|
+
dates are the center's; decide in your UI whether to label "Summer only" or
|
|
1189
|
+
hide it out of season (don't trust the server's clock — see the reactive-time
|
|
1190
|
+
note in the booking flow).
|
|
1191
|
+
|
|
1192
|
+
The fast-start drop-in is `<PricingTable centerId>` (from
|
|
1193
|
+
`@bowlos/reservations/components`) — themeable with `--bowlos-*` vars, with a
|
|
1194
|
+
`specialsOnly` prop and overridable `labels`. Build your own from the hook for
|
|
1195
|
+
full control.
|
|
1196
|
+
|
|
1197
|
+
> An operator turns a plan into a special in BowlOS admin → **Pricing → Plans →
|
|
1198
|
+
> Website special** (a blurb + a display price). Nothing to configure in the SDK
|
|
1199
|
+
> beyond reading the hook.
|
|
1200
|
+
|
|
1148
1201
|
## Adopting changes by version
|
|
1149
1202
|
|
|
1150
1203
|
What each SDK release changed in `<BookingFlow>` and the headless steps to match.
|
|
@@ -1183,5 +1236,7 @@ Headless sites do **not** get these from a version bump — apply them by hand.
|
|
|
1183
1236
|
| **0.29.0** | **Wallet eligibility on `useMyPasses`** — each pass row from `useMyPasses` / `getMyPasses` now carries `walletEligible: boolean`. It's `false` once a pass is stale (reservation/package day is over in the Center's timezone; game card inactive/expired; membership lapsed). The server also returns no pass URL for an ineligible pass, so a stale "Add to Wallet" button is a dead action either way. | New "Wallet passes" section. If your site shows "Add to Apple/Google Wallet", gate the buttons on `pass.walletEligible`. No change if you don't surface wallet passes. The `MyPass` type gained the field. |
|
|
1184
1237
|
| **0.28.0** | **Per-brand logins + forgot-password** — customer auth is now scoped to the brand (same email = independent account/password per center business; server-side, the gateway encodes the brand into the credential). New `account.requestPasswordReset(email)` + `account.resetPassword(email, code, newPassword)` (and `client.*`); the reset emails a 6-digit code from the center's white-label sending domain, and a successful reset signs the customer in. `<AuthForm>`/`<AuthGate>` gained the "Forgot password?" flow. | §1 sub-sections "Per-brand logins" + "Forgot password". No change for sites on the drop-in `<AuthForm>`. Headless sign-in screens: add a "Forgot password?" affordance calling the two methods; reword `EMAIL_IN_USE` to "account at this center." A center needs a verified sending domain for reset codes to send. |
|
|
1185
1238
|
|
|
1239
|
+
| **0.31.0** | **Per-weekday package start times** — `getPublicPackage` / `usePackage` now return `startTimesByWeekday: [{ dayOfWeek, startTimes }]` (a package can run at different times each weekday — Sun 2:30/5:00, M–Th 5:30, Fri 5:30/8:00, Sat 12/3/6). New exported helpers `resolvePackageStartTimesForWeekday(pkg, weekday)` + `weekdayForDateISO(dateISO)` + `usesPerWeekdayStartTimes(pkg)` fold the new map and the legacy `allowedStartTimes`/`applicabilityDays` into one call. **Also: retail pricing page** — new `useRetailPricing({ centerId })` + `listRetailPricing` core fn return a center's walk-in (matrix) rates grouped by attraction + opted-in "website specials"; reference `<PricingTable>` component. | "Buying a package" §2 — replace the hand-rolled `allowedStartTimes`/`applicabilityDays` slot filter with `resolvePackageStartTimesForWeekday(pkg, weekdayForDateISO(dateISO))` (→ `null` continuous, `[]` not bookable that day, else the exact minutes; still intersect with open hours). The buy mutation enforces the same rule, so a stale time still rejects `VALIDATION_FAILED`. **Plus** the new "Retail pricing page" section — read `useRetailPricing` for a price-list page (or drop in `<PricingTable centerId>`); render-only, not a booking surface. Both additive — continuous/legacy packages + sites without a pricing page are unchanged. |
|
|
1240
|
+
|
|
1186
1241
|
When you add the next release here, add its row **and** any new capability-map
|
|
1187
1242
|
section in the same PR.
|
package/README.md
CHANGED
|
@@ -178,6 +178,17 @@ secret stays in server env), then drop in `<InquiryForm formType action />` (or
|
|
|
178
178
|
build your own fields from `INQUIRY_FORMS`). A staff reply emails the customer
|
|
179
179
|
back. See the "Inquiry forms" section of `HEADLESS.md`.
|
|
180
180
|
|
|
181
|
+
**Per-weekday package start times (v0.31.0):** a package can run at different
|
|
182
|
+
start times each weekday. `usePackage` returns `startTimesByWeekday`; resolve a
|
|
183
|
+
date's bookable times with `resolvePackageStartTimesForWeekday(pkg, weekday)` —
|
|
184
|
+
see "Buying a package" in `HEADLESS.md`.
|
|
185
|
+
|
|
186
|
+
**Retail pricing page (v0.31.0):** `useRetailPricing({ centerId })` returns a
|
|
187
|
+
center's walk-in (matrix) rates grouped by attraction plus opted-in "website
|
|
188
|
+
specials" — a printed-menu-style price list that always matches the operator's
|
|
189
|
+
live config. Drop in `<PricingTable centerId>` or build your own. Render-only,
|
|
190
|
+
not a booking surface. See the "Retail pricing page" section of `HEADLESS.md`.
|
|
191
|
+
|
|
181
192
|
## Drop-in components (`@bowlos/reservations/components`)
|
|
182
193
|
|
|
183
194
|
> These are a **reference / fast-start**, not the delivered product. Center sites
|
|
@@ -173,5 +173,49 @@ declare function getCenterHours<T = unknown>(client: BowlosClient, args: CenterH
|
|
|
173
173
|
declare function listPublicMemberships<T = unknown>(client: BowlosClient, args: CenterScoped): Promise<T>;
|
|
174
174
|
/** Purchasable game cards / passes at a Brand. */
|
|
175
175
|
declare function listGameCards<T = unknown>(client: BowlosClient, args: BrandCatalogArgs): Promise<T>;
|
|
176
|
+
/** A pricing mode an attraction charges in. */
|
|
177
|
+
type RetailPricingMode = "per_unit_per_hour" | "per_person_per_hour" | "per_game";
|
|
178
|
+
/** One matrix row — a day-of-week + time band with per-mode rates. */
|
|
179
|
+
interface RetailWalkInRate {
|
|
180
|
+
dayOfWeek: number;
|
|
181
|
+
startMinuteOfDay: number;
|
|
182
|
+
endMinuteOfDay: number;
|
|
183
|
+
label: string | null;
|
|
184
|
+
rateUnitHourCents: number | null;
|
|
185
|
+
ratePersonHourCents: number | null;
|
|
186
|
+
rateGameCents: number | null;
|
|
187
|
+
}
|
|
188
|
+
/** Walk-in rates grouped by attraction. */
|
|
189
|
+
interface RetailAttraction {
|
|
190
|
+
attractionId: string;
|
|
191
|
+
name: string;
|
|
192
|
+
typeKey: string;
|
|
193
|
+
enabledModes: RetailPricingMode[];
|
|
194
|
+
unitLabelSingular: string;
|
|
195
|
+
unitLabelPlural: string;
|
|
196
|
+
walkInRates: RetailWalkInRate[];
|
|
197
|
+
}
|
|
198
|
+
/** A featured "website special" (an opted-in price plan). */
|
|
199
|
+
interface RetailSpecial {
|
|
200
|
+
planId: string;
|
|
201
|
+
name: string;
|
|
202
|
+
description: string;
|
|
203
|
+
priceCents: number | null;
|
|
204
|
+
attractionId: string;
|
|
205
|
+
attractionName: string;
|
|
206
|
+
/** Seasonal window (YYYY-MM-DD) when set — label/hide out of season. */
|
|
207
|
+
effectiveStartDate: string | null;
|
|
208
|
+
effectiveEndDate: string | null;
|
|
209
|
+
}
|
|
210
|
+
/** The full retail-pricing payload for a Center. */
|
|
211
|
+
interface RetailPricing {
|
|
212
|
+
centerName: string;
|
|
213
|
+
attractions: RetailAttraction[];
|
|
214
|
+
specials: RetailSpecial[];
|
|
215
|
+
}
|
|
216
|
+
/** A Center's public price list: walk-in (matrix) rates + website specials.
|
|
217
|
+
* Read-only, anonymous — drives a printed-menu-style pricing page that always
|
|
218
|
+
* matches the operator's live config. Not a booking surface. */
|
|
219
|
+
declare function listRetailPricing<T = RetailPricing>(client: BowlosClient, args: CenterScoped): Promise<T>;
|
|
176
220
|
|
|
177
|
-
export { BOWLOS_ERROR_CODES as B, type CatalogActionType as C, type PackageDetailArgs as P, BowlosApiError as a, type BowlosApiErrorOptions as b, type BowlosErrorCode as c, type BrandCatalogArgs as d, type CatalogArgs as e, type CatalogCategory as f, type CatalogItem as g, type CatalogResult as h, type CatalogSection as i, type CatalogSourceTable as j, type CenterHoursArgs as k, type CenterScoped as l, type PublicSurface as m,
|
|
221
|
+
export { listPublicMemberships as A, BOWLOS_ERROR_CODES as B, type CatalogActionType as C, listRetailPricing as D, type PackageDetailArgs as P, type RetailAttraction as R, BowlosApiError as a, type BowlosApiErrorOptions as b, type BowlosErrorCode as c, type BrandCatalogArgs as d, type CatalogArgs as e, type CatalogCategory as f, type CatalogItem as g, type CatalogResult as h, type CatalogSection as i, type CatalogSourceTable as j, type CenterHoursArgs as k, type CenterScoped as l, type PublicSurface as m, type RetailPricing as n, type RetailPricingMode as o, type RetailSpecial as p, type RetailWalkInRate as q, getCenterHours as r, getEventOffer as s, getPackage as t, listCatalog as u, listEventOffers as v, listEvents as w, listGameCards as x, listPackages as y, listProducts as z };
|
|
@@ -173,5 +173,49 @@ declare function getCenterHours<T = unknown>(client: BowlosClient, args: CenterH
|
|
|
173
173
|
declare function listPublicMemberships<T = unknown>(client: BowlosClient, args: CenterScoped): Promise<T>;
|
|
174
174
|
/** Purchasable game cards / passes at a Brand. */
|
|
175
175
|
declare function listGameCards<T = unknown>(client: BowlosClient, args: BrandCatalogArgs): Promise<T>;
|
|
176
|
+
/** A pricing mode an attraction charges in. */
|
|
177
|
+
type RetailPricingMode = "per_unit_per_hour" | "per_person_per_hour" | "per_game";
|
|
178
|
+
/** One matrix row — a day-of-week + time band with per-mode rates. */
|
|
179
|
+
interface RetailWalkInRate {
|
|
180
|
+
dayOfWeek: number;
|
|
181
|
+
startMinuteOfDay: number;
|
|
182
|
+
endMinuteOfDay: number;
|
|
183
|
+
label: string | null;
|
|
184
|
+
rateUnitHourCents: number | null;
|
|
185
|
+
ratePersonHourCents: number | null;
|
|
186
|
+
rateGameCents: number | null;
|
|
187
|
+
}
|
|
188
|
+
/** Walk-in rates grouped by attraction. */
|
|
189
|
+
interface RetailAttraction {
|
|
190
|
+
attractionId: string;
|
|
191
|
+
name: string;
|
|
192
|
+
typeKey: string;
|
|
193
|
+
enabledModes: RetailPricingMode[];
|
|
194
|
+
unitLabelSingular: string;
|
|
195
|
+
unitLabelPlural: string;
|
|
196
|
+
walkInRates: RetailWalkInRate[];
|
|
197
|
+
}
|
|
198
|
+
/** A featured "website special" (an opted-in price plan). */
|
|
199
|
+
interface RetailSpecial {
|
|
200
|
+
planId: string;
|
|
201
|
+
name: string;
|
|
202
|
+
description: string;
|
|
203
|
+
priceCents: number | null;
|
|
204
|
+
attractionId: string;
|
|
205
|
+
attractionName: string;
|
|
206
|
+
/** Seasonal window (YYYY-MM-DD) when set — label/hide out of season. */
|
|
207
|
+
effectiveStartDate: string | null;
|
|
208
|
+
effectiveEndDate: string | null;
|
|
209
|
+
}
|
|
210
|
+
/** The full retail-pricing payload for a Center. */
|
|
211
|
+
interface RetailPricing {
|
|
212
|
+
centerName: string;
|
|
213
|
+
attractions: RetailAttraction[];
|
|
214
|
+
specials: RetailSpecial[];
|
|
215
|
+
}
|
|
216
|
+
/** A Center's public price list: walk-in (matrix) rates + website specials.
|
|
217
|
+
* Read-only, anonymous — drives a printed-menu-style pricing page that always
|
|
218
|
+
* matches the operator's live config. Not a booking surface. */
|
|
219
|
+
declare function listRetailPricing<T = RetailPricing>(client: BowlosClient, args: CenterScoped): Promise<T>;
|
|
176
220
|
|
|
177
|
-
export { BOWLOS_ERROR_CODES as B, type CatalogActionType as C, type PackageDetailArgs as P, BowlosApiError as a, type BowlosApiErrorOptions as b, type BowlosErrorCode as c, type BrandCatalogArgs as d, type CatalogArgs as e, type CatalogCategory as f, type CatalogItem as g, type CatalogResult as h, type CatalogSection as i, type CatalogSourceTable as j, type CenterHoursArgs as k, type CenterScoped as l, type PublicSurface as m,
|
|
221
|
+
export { listPublicMemberships as A, BOWLOS_ERROR_CODES as B, type CatalogActionType as C, listRetailPricing as D, type PackageDetailArgs as P, type RetailAttraction as R, BowlosApiError as a, type BowlosApiErrorOptions as b, type BowlosErrorCode as c, type BrandCatalogArgs as d, type CatalogArgs as e, type CatalogCategory as f, type CatalogItem as g, type CatalogResult as h, type CatalogSection as i, type CatalogSourceTable as j, type CenterHoursArgs as k, type CenterScoped as l, type PublicSurface as m, type RetailPricing as n, type RetailPricingMode as o, type RetailSpecial as p, type RetailWalkInRate as q, getCenterHours as r, getEventOffer as s, getPackage as t, listCatalog as u, listEventOffers as v, listEvents as w, listGameCards as x, listPackages as y, listProducts as z };
|
|
@@ -41,5 +41,5 @@ async function signInquiryBody(secret, rawBody) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export { INQUIRY_FORMS, signInquiryBody };
|
|
44
|
-
//# sourceMappingURL=chunk-
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
44
|
+
//# sourceMappingURL=chunk-EQH5HDYQ.js.map
|
|
45
|
+
//# sourceMappingURL=chunk-EQH5HDYQ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../shared/src/inquiry.ts"],"names":[],"mappings":";AAmCO,IAAM,aAAA,GAAyD;AAAA,EACpE,OAAA,EAAS;AAAA,IACP,KAAA,EAAO,SAAA;AAAA,IACP,MAAA,EAAQ;AAAA,MACN,EAAE,GAAA,EAAK,aAAA,EAAe,KAAA,EAAO,cAAA,EAAgB,UAAU,IAAA,EAAK;AAAA,MAC5D,EAAE,GAAA,EAAK,aAAA,EAAe,KAAA,EAAO,cAAA,EAAe;AAAA,MAC5C,EAAE,GAAA,EAAK,OAAA,EAAS,KAAA,EAAO,OAAA,EAAS,UAAU,IAAA,EAAK;AAAA,MAC/C,EAAE,GAAA,EAAK,QAAA,EAAU,KAAA,EAAO,QAAA,EAAS;AAAA,MACjC,EAAE,GAAA,EAAK,SAAA,EAAW,KAAA,EAAO,SAAA,EAAW,UAAU,IAAA;AAAK;AACrD,GACF;AAAA,EACA,WAAA,EAAa;AAAA,IACX,KAAA,EAAO,uBAAA;AAAA,IACP,MAAA,EAAQ;AAAA,MACN,EAAE,GAAA,EAAK,aAAA,EAAe,KAAA,EAAO,cAAA,EAAgB,UAAU,IAAA,EAAK;AAAA,MAC5D,EAAE,GAAA,EAAK,aAAA,EAAe,KAAA,EAAO,cAAA,EAAe;AAAA,MAC5C,EAAE,GAAA,EAAK,OAAA,EAAS,KAAA,EAAO,OAAA,EAAS,UAAU,IAA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,EAAA,MAAM,OAAA,GAAU,IAAI,WAAA,EAAY;AAChC,EAAA,MAAM,GAAA,GAAM,MAAM,UAAA,CAAW,MAAA,CAAO,MAAA,CAAO,SAAA;AAAA,IACzC,KAAA;AAAA,IACA,OAAA,CAAQ,OAAO,MAAM,CAAA;AAAA,IACrB,EAAE,IAAA,EAAM,MAAA,EAAQ,IAAA,EAAM,SAAA,EAAU;AAAA,IAChC,KAAA;AAAA,IACA,CAAC,MAAM;AAAA,GACT;AACA,EAAA,MAAM,GAAA,GAAM,MAAM,UAAA,CAAW,MAAA,CAAO,MAAA,CAAO,IAAA,CAAK,MAAA,EAAQ,GAAA,EAAK,OAAA,CAAQ,MAAA,CAAO,OAAO,CAAC,CAAA;AACpF,EAAA,OAAO,KAAA,CAAM,KAAK,IAAI,UAAA,CAAW,GAAG,CAAC,CAAA,CAClC,IAAI,CAAC,CAAA,KAAM,EAAE,QAAA,CAAS,EAAE,EAAE,QAAA,CAAS,CAAA,EAAG,GAAG,CAAC,CAAA,CAC1C,KAAK,EAAE,CAAA;AACZ;AAgBA,eAAsB,eAAA,CAAgB,QAAgB,OAAA,EAAkC;AACtF,EAAA,OAAO,OAAA,CAAQ,QAAQ,OAAO,CAAA;AAChC","file":"chunk-EQH5HDYQ.js","sourcesContent":["/**\n * Inquiry forms (\"No Dead Ends\" #3) — pure logic for the customer contact /\n * party-inquiry forms a center site posts into BowlOS. No DB, no Convex ctx.\n *\n * - the form-type registry (which fields each preset collects), so the SDK\n * and the gateway agree on the shape;\n * - formatInquiryBody: render submitted fields into the labeled block the\n * operator reads in the Inbox;\n * - validateInquiry: required fields + email + length caps;\n * - HMAC helpers: derive a per-center signing secret from the platform master\n * secret, and verify a signed webhook body (the spam gate — only a holder\n * of the center's secret can post). Mirrors mailgun_inbound's verify.\n *\n * Canonical home (shared by the convex backend + the @bowlos/reservations SDK).\n */\n\nexport type InquiryFormType = \"contact\" | \"event_party\";\n\nexport interface InquiryFieldDef {\n key: string;\n label: string;\n required?: boolean;\n}\n\ninterface InquiryFormDef {\n label: string;\n /** Ordered fields rendered in the inbox block. */\n fields: InquiryFieldDef[];\n}\n\n/**\n * The catalog of forms. Two presets at launch (more are additive). The field\n * ORDER here is the order shown in the inbox. `event_party` matches the party\n * inquiry shape (people count / date / time / notes).\n */\nexport const INQUIRY_FORMS: Record<InquiryFormType, InquiryFormDef> = {\n contact: {\n label: \"Contact\",\n fields: [\n { key: \"contactName\", label: \"Contact Name\", required: true },\n { key: \"companyName\", label: \"Company Name\" },\n { key: \"email\", label: \"Email\", required: true },\n { key: \"mobile\", label: \"Mobile\" },\n { key: \"message\", label: \"Message\", required: true },\n ],\n },\n event_party: {\n label: \"Party / event inquiry\",\n fields: [\n { key: \"contactName\", label: \"Contact Name\", required: true },\n { key: \"companyName\", label: \"Company Name\" },\n { key: \"email\", label: \"Email\", required: true },\n { key: \"mobile\", label: \"Mobile\" },\n { key: \"peopleCount\", label: \"People count\" },\n { key: \"date\", label: \"Date\" },\n { key: \"time\", label: \"Time\" },\n { key: \"notes\", label: \"Notes\" },\n ],\n },\n};\n\nexport function isInquiryFormType(v: unknown): v is InquiryFormType {\n return v === \"contact\" || v === \"event_party\";\n}\n\nconst MAX_FIELD_LEN = 5000;\n\n/**\n * Validate a submitted inquiry. Returns an error message, or null when valid.\n * Required fields must be non-empty; email must look like an email; every\n * value is length-capped (defense against a giant body).\n */\nexport function validateInquiry(\n formType: InquiryFormType,\n values: Record<string, unknown>,\n): string | null {\n const def = INQUIRY_FORMS[formType];\n for (const f of def.fields) {\n const raw = values[f.key];\n const val = typeof raw === \"string\" ? raw.trim() : \"\";\n if (f.required && !val) return `${f.label} is required.`;\n if (typeof raw === \"string\" && raw.length > MAX_FIELD_LEN) {\n return `${f.label} is too long.`;\n }\n }\n const email = typeof values.email === \"string\" ? values.email.trim() : \"\";\n if (!/^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$/.test(email)) {\n return \"A valid email is required.\";\n }\n return null;\n}\n\n/**\n * Render submitted fields as a labeled block for the Inbox message body, e.g.\n * Contact Name: John Smith\n * Company Name:\n * Email: johnsmith@email.com\n * People count: 60\n * Registry fields render first (in order, blanks included so the shape is\n * always recognizable); any extra submitted keys are appended verbatim.\n */\nexport function formatInquiryBody(\n formType: InquiryFormType,\n values: Record<string, unknown>,\n): string {\n const def = INQUIRY_FORMS[formType];\n const known = new Set(def.fields.map((f) => f.key));\n const extras = Object.keys(values).filter(\n (k) => !known.has(k) && k !== \"formType\",\n );\n const rows: Array<{ label: string; value: string }> = [\n ...def.fields.map((f) => ({\n label: f.label,\n value: typeof values[f.key] === \"string\" ? (values[f.key] as string).trim() : \"\",\n })),\n ...extras.map((k) => ({\n label: k,\n value: typeof values[k] === \"string\" ? (values[k] as string).trim() : String(values[k] ?? \"\"),\n })),\n ];\n const width = Math.max(...rows.map((r) => r.label.length)) + 1; // +1 for \":\"\n return rows\n .map((r) => `${(r.label + \":\").padEnd(width + 1)} ${r.value}`.trimEnd())\n .join(\"\\n\");\n}\n\n/** A short subject line for the conversation, e.g. \"Party / event inquiry — Jane\". */\nexport function inquirySubject(\n formType: InquiryFormType,\n values: Record<string, unknown>,\n): string {\n const name = typeof values.contactName === \"string\" ? values.contactName.trim() : \"\";\n const base = INQUIRY_FORMS[formType].label;\n return name ? `${base} — ${name}` : base;\n}\n\n// ─── HMAC signing (the spam gate) ──────────────────────────────────\n\nasync function hmacHex(secret: string, message: string): Promise<string> {\n const encoder = new TextEncoder();\n const key = await globalThis.crypto.subtle.importKey(\n \"raw\",\n encoder.encode(secret),\n { name: \"HMAC\", hash: \"SHA-256\" },\n false,\n [\"sign\"],\n );\n const sig = await globalThis.crypto.subtle.sign(\"HMAC\", key, encoder.encode(message));\n return Array.from(new Uint8Array(sig))\n .map((b) => b.toString(16).padStart(2, \"0\"))\n .join(\"\");\n}\n\n/**\n * Derive the per-center inquiry signing secret from the platform master secret.\n * BowlOS never stores per-center secrets — it recomputes this on demand, and\n * hands the same value to the center's server once (so its form route can sign).\n * Compromise of one is scoped to inbox spam for that one center.\n */\nexport async function deriveCenterInquirySecret(\n masterSecret: string,\n centerId: string,\n): Promise<string> {\n return hmacHex(masterSecret, `inquiry-secret:v1:${centerId}`);\n}\n\n/** HMAC-SHA256 of the raw request body with the center's secret, hex. */\nexport async function signInquiryBody(secret: string, rawBody: string): Promise<string> {\n return hmacHex(secret, rawBody);\n}\n\n/** Constant-time verify of a hex signature against the body. */\nexport async function verifyInquirySignature(\n secret: string,\n rawBody: string,\n signature: string,\n): Promise<boolean> {\n const expected = await hmacHex(secret, rawBody);\n if (!signature || signature.length !== expected.length) return false;\n let diff = 0;\n for (let i = 0; i < expected.length; i++) {\n diff |= expected.charCodeAt(i) ^ signature.charCodeAt(i);\n }\n return diff === 0;\n}\n"]}
|
|
@@ -289,6 +289,9 @@ function usePackages(args, options) {
|
|
|
289
289
|
function usePackage(args, options) {
|
|
290
290
|
return useBowlosQuery("getPublicPackage", args, options);
|
|
291
291
|
}
|
|
292
|
+
function useRetailPricing(args, options) {
|
|
293
|
+
return useBowlosQuery("listRetailPricing", args, options);
|
|
294
|
+
}
|
|
292
295
|
function useCenterHours(args, options) {
|
|
293
296
|
return useBowlosQuery("getCenterOperatingHoursForTypes", args, options);
|
|
294
297
|
}
|
|
@@ -481,6 +484,6 @@ function useBookingFlow() {
|
|
|
481
484
|
};
|
|
482
485
|
}
|
|
483
486
|
|
|
484
|
-
export { BowlosProvider, useAccount, useAddons, useAvailability, useBookingFlow, useBookingPreview, useBowlosClient, useBowlosMutation, useBowlosQuery, useCancelMyEventOrder, useCancelMyGameCard, useCancelMyPackageOrder, useCancelMyReservation, useCatalog, useCenterHours, useEventOffer, useEventOffers, useEventOrderCancelPreview, useEventTicketPreview, useEvents, useFlashSale, useFlashSaleBookingOptions, useFlashSales, useGameCardCancelPreview, useGameCardPreview, useGameCards, useMembershipPreview, useMembershipSubscriptionPreview, useMyCredits, useMyEventOrder, useMyEventOrders, useMyGameCards, useMyLoyalty, useMyMembershipDetail, useMyMemberships, useMyPasses, useMyReservationDetail, useMyReservations, usePackage, usePackageOrderCancelPreview, usePackagePreview, usePackages, useProducts, usePublicMemberships, useReservationCancelPreview, useStartTimes, useTestMode };
|
|
485
|
-
//# sourceMappingURL=chunk-
|
|
486
|
-
//# sourceMappingURL=chunk-
|
|
487
|
+
export { BowlosProvider, useAccount, useAddons, useAvailability, useBookingFlow, useBookingPreview, useBowlosClient, useBowlosMutation, useBowlosQuery, useCancelMyEventOrder, useCancelMyGameCard, useCancelMyPackageOrder, useCancelMyReservation, useCatalog, useCenterHours, useEventOffer, useEventOffers, useEventOrderCancelPreview, useEventTicketPreview, useEvents, useFlashSale, useFlashSaleBookingOptions, useFlashSales, useGameCardCancelPreview, useGameCardPreview, useGameCards, useMembershipPreview, useMembershipSubscriptionPreview, useMyCredits, useMyEventOrder, useMyEventOrders, useMyGameCards, useMyLoyalty, useMyMembershipDetail, useMyMemberships, useMyPasses, useMyReservationDetail, useMyReservations, usePackage, usePackageOrderCancelPreview, usePackagePreview, usePackages, useProducts, usePublicMemberships, useReservationCancelPreview, useRetailPricing, useStartTimes, useTestMode };
|
|
488
|
+
//# sourceMappingURL=chunk-S5GEG7SW.js.map
|
|
489
|
+
//# sourceMappingURL=chunk-S5GEG7SW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react.tsx","../src/hooks.tsx","../src/use-booking-flow.tsx"],"names":["useCallback","useState","useRef","useEffect"],"mappings":";;;;AAwBA,IAAM,aAAA,GAAgB,cAAmC,IAAI,CAAA;AAC7D,IAAM,cAAA,GAAiB,cAAuC,IAAI,CAAA;AAS3D,SAAS,cAAA,CAAe,EAAE,MAAA,EAAQ,MAAA,EAAQ,UAAS,EAAwB;AAChF,EAAA,MAAM,GAAA,GAAM,MAAA,CAA4B,MAAA,IAAU,IAAI,CAAA;AACtD,EAAA,IAAI,CAAC,IAAI,OAAA,EAAS;AAChB,IAAA,IAAI,CAAC,MAAA,EAAQ;AACX,MAAA,MA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gB,QAAA,CAAS,CAAC,CAAA;AAC3C,MAAA,OAAO,IAAA;AAAA,IACT;AAAA,EACF,CAAA,EAAG,CAAC,MAAA,EAAQ,WAAW,CAAC,CAAA;AAExB,EAAA,MAAM,YAAA,GAAeA,WAAAA;AAAA,IACnB,CAAC,aAAqB,eAAA,KAAoB;AACxC,MAAA,WAAA,EAAY;AACZ,MAAA,KAAK,UAAA,EAAW;AAChB,MAAA,OAAA,CAAQ,OAAA,GAAU,YAAY,MAAM;AAClC,QAAA,KAAK,UAAA,EAAW;AAAA,MAClB,GAAG,UAAU,CAAA;AAAA,IACf,CAAA;AAAA,IACA,CAAC,YAAY,WAAW;AAAA,GAC1B;AAEA,EAAA,MAAM,OAAA,GAAUA,YAAY,YAAY;AACtC,IAAA,WAAA,EAAY;AACZ,IAAA,MAAM,KAAK,WAAA,CAAY,OAAA;AACvB,IAAA,IAAI,EAAA,EAAI;AACN,MAAA,IAAI;AACF,QAAA,MAAM,eAAA,CAAoB,QAAQ,EAAE,CAAA;AAAA,MACtC,CAAA,CAAA,MAAQ;AAAA,MAER;AAAA,IACF;AACA,IAAA,SAAA,CAAU,WAAW,CAAA;AAAA,EACvB,CAAA,EAAG,CAAC,MAAA,EAAQ,WAAW,CAAC,CAAA;AAExB,EAAA,OAAO;AAAA,IACL,MAAA;AAAA,IACA,IAAA;AAAA,IACA,QAAA;AAAA,IACA,aAAA;AAAA,IACA,WAAA;AAAA,IACA,eAAA,EAAiB,IAAA,GAAO,IAAA,CAAK,eAAA,GAAkB,IAAA;AAAA,IAC/C,KAAA;AAAA,IACA,SAAA;AAAA,IACA,cAAA;AAAA,IACA,UAAA;AAAA,IACA,YAAA;AAAA,IACA,WAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA,GACF;AACF","file":"chunk-S5GEG7SW.js","sourcesContent":["/**\n * React layer for @bowlos/reservations.\n *\n * `<BowlosProvider>` holds one `BowlosClient`; `useAccount()` manages the\n * customer session (probe on mount, sign-in/up/link/out, current customer);\n * `useBowlosQuery()` is the generic read hook the typed data hooks\n * (`useAvailability`, `useBookingFlow`, …) will build on next.\n *\n * Lives in its own module so non-React consumers of the core never pull React.\n * (The `@bowlos/reservations/react` export subpath is wired with the publish build.)\n */\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n type ReactNode,\n} from \"react\";\nimport { BowlosClient, createBowlosClient } from \"./client\";\nimport { BowlosApiError } from \"./errors\";\nimport type { AuthState, BowlosClientConfig, Customer, LinkProfile } from \"./types\";\n\nconst BowlosContext = createContext<BowlosClient | null>(null);\nconst AccountContext = createContext<UseAccountResult | null>(null);\n\nexport interface BowlosProviderProps {\n /** A prebuilt client, or pass `config` to have one created and memoized. */\n client?: BowlosClient;\n config?: BowlosClientConfig;\n children: ReactNode;\n}\n\nexport function BowlosProvider({ client, config, children }: BowlosProviderProps) {\n const ref = useRef<BowlosClient | null>(client ?? null);\n if (!ref.current) {\n if (!config) {\n throw new Error(\"BowlosProvider requires either a `client` or a `config`.\");\n }\n ref.current = createBowlosClient(config);\n }\n const bowlosClient = ref.current as BowlosClient; // non-null after the guard above\n // Run the session machine ONCE here and share it via context, so every\n // useAccount() across the app sees the same session.\n const account = useAccountState(bowlosClient);\n return (\n <BowlosContext.Provider value={bowlosClient}>\n <AccountContext.Provider value={account}>{children}</AccountContext.Provider>\n </BowlosContext.Provider>\n );\n}\n\nexport function useBowlosClient(): BowlosClient {\n const client = useContext(BowlosContext);\n if (!client) {\n throw new Error(\"useBowlosClient must be used within a <BowlosProvider>.\");\n }\n return client;\n}\n\n// ── useAccount ──────────────────────────────────────────────────────────────\n\nexport type AccountStatus = \"loading\" | AuthState;\n\nexport interface UseAccountResult {\n status: AccountStatus;\n customer: Customer | null;\n error: BowlosApiError | null;\n signIn: (email: string, password: string) => Promise<void>;\n /** Atomic sign-up (preferred): login + customer profile in one call. */\n register: (\n email: string,\n password: string,\n profile: Omit<LinkProfile, \"email\">,\n ) => Promise<void>;\n signUp: (email: string, password: string) => Promise<void>;\n link: (profile: LinkProfile) => Promise<void>;\n /** Forgot-password step 1: email a reset code (no session change). Always\n * resolves — the server never reveals whether the email has an account. */\n requestPasswordReset: (email: string) => Promise<void>;\n /** Forgot-password step 2: verify the code + set a new password. On success\n * the customer is signed in (status flips to linked). */\n resetPassword: (\n email: string,\n code: string,\n newPassword: string,\n ) => Promise<void>;\n signOut: () => Promise<void>;\n refresh: () => Promise<void>;\n}\n\n/** The session state machine — runs ONCE inside `<BowlosProvider>` and is shared\n * via context. Probes once on mount; each action re-probes so `status`/`customer`\n * stay current. Consumers use `useAccount()`, never this directly. */\nfunction useAccountState(client: BowlosClient): UseAccountResult {\n const [status, setStatus] = useState<AccountStatus>(\"loading\");\n const [customer, setCustomer] = useState<Customer | null>(null);\n const [error, setError] = useState<BowlosApiError | null>(null);\n\n const refresh = useCallback(async () => {\n try {\n const state = await client.probe();\n setStatus(state);\n setCustomer(state === \"linked\" ? await client.me() : null);\n setError(null);\n } catch (e) {\n setStatus(\"unauthenticated\");\n setCustomer(null);\n if (e instanceof BowlosApiError) setError(e);\n }\n }, [client]);\n\n useEffect(() => {\n void refresh();\n }, [refresh]);\n\n const run = useCallback(\n async (action: () => Promise<unknown>) => {\n setError(null);\n try {\n await action();\n await refresh();\n } catch (e) {\n if (e instanceof BowlosApiError) setError(e);\n throw e;\n }\n },\n [refresh],\n );\n\n const signIn = useCallback(\n (email: string, password: string) => run(() => client.signIn(email, password)),\n [client, run],\n );\n const register = useCallback(\n (email: string, password: string, profile: Omit<LinkProfile, \"email\">) =>\n run(() => client.register(email, password, profile)),\n [client, run],\n );\n const signUp = useCallback(\n (email: string, password: string) => run(() => client.signUp(email, password)),\n [client, run],\n );\n const link = useCallback((profile: LinkProfile) => run(() => client.link(profile)), [client, run]);\n // Step 1 doesn't change the session, so it doesn't re-probe — just surfaces\n // errors. Step 2 signs the customer in, so it runs through `run` (re-probe).\n const requestPasswordReset = useCallback(\n async (email: string) => {\n setError(null);\n try {\n await client.requestPasswordReset(email);\n } catch (e) {\n if (e instanceof BowlosApiError) setError(e);\n throw e;\n }\n },\n [client],\n );\n const resetPassword = useCallback(\n (email: string, code: string, newPassword: string) =>\n run(() => client.resetPassword(email, code, newPassword)),\n [client, run],\n );\n const signOut = useCallback(() => run(() => client.signOut()), [client, run]);\n\n return {\n status,\n customer,\n error,\n signIn,\n register,\n signUp,\n link,\n requestPasswordReset,\n resetPassword,\n signOut,\n refresh,\n };\n}\n\n/**\n * The customer session (state + actions), shared across the whole app. Every\n * call returns the SAME session — signing in or out anywhere updates the header,\n * the booking form, everywhere at once. Must be used within a `<BowlosProvider>`.\n */\nexport function useAccount(): UseAccountResult {\n const account = useContext(AccountContext);\n if (!account) {\n throw new Error(\"useAccount must be used within a <BowlosProvider>.\");\n }\n return account;\n}\n\n// ── useBowlosQuery ────────────────────────────────────────────────────────────\n\nexport interface UseQueryOptions {\n /** Send the customer bearer token (for session-scoped reads). */\n auth?: boolean;\n /** Skip fetching until true. Defaults to true. */\n enabled?: boolean;\n}\n\nexport interface UseQueryResult<T> {\n data: T | null;\n error: BowlosApiError | null;\n loading: boolean;\n refetch: () => Promise<void>;\n}\n\n/** Generic read hook over a gateway route. The typed data hooks\n * (`useAvailability`, etc.) will wrap this with route names + arg types. */\nexport function useBowlosQuery<T = unknown>(\n name: string,\n args: Record<string, unknown> = {},\n options: UseQueryOptions = {},\n): UseQueryResult<T> {\n const client = useBowlosClient();\n const auth = options.auth ?? false;\n const enabled = options.enabled ?? true;\n const [data, setData] = useState<T | null>(null);\n const [error, setError] = useState<BowlosApiError | null>(null);\n const [loading, setLoading] = useState<boolean>(enabled);\n // Stabilize the args object across renders so the effect doesn't loop.\n const argsKey = JSON.stringify(args);\n\n const refetch = useCallback(async () => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.call<T>(name, JSON.parse(argsKey) as Record<string, unknown>, {\n auth,\n });\n setData(result);\n } catch (e) {\n if (e instanceof BowlosApiError) setError(e);\n setData(null);\n } finally {\n setLoading(false);\n }\n }, [client, name, argsKey, auth]);\n\n useEffect(() => {\n if (enabled) void refetch();\n }, [enabled, refetch]);\n\n return { data, error, loading, refetch };\n}\n\n// ── useBowlosMutation ─────────────────────────────────────────────────────────\n\nexport interface UseMutationResult<TArgs, TData> {\n /** Fire the mutation. Resolves with the data, or throws BowlosApiError. */\n run: (args: TArgs) => Promise<TData>;\n data: TData | null;\n error: BowlosApiError | null;\n loading: boolean;\n reset: () => void;\n}\n\n/** Generic write hook over a gateway route. The typed mutation hooks\n * (`useCancelMyReservation`, etc.) wrap this with a route name + arg type. */\nexport function useBowlosMutation<TArgs extends Record<string, unknown>, TData = unknown>(\n name: string,\n options: { auth?: boolean } = {},\n): UseMutationResult<TArgs, TData> {\n const client = useBowlosClient();\n const auth = options.auth ?? false;\n const [data, setData] = useState<TData | null>(null);\n const [error, setError] = useState<BowlosApiError | null>(null);\n const [loading, setLoading] = useState<boolean>(false);\n\n const run = useCallback(\n async (args: TArgs) => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.call<TData>(name, args, { auth });\n setData(result);\n return result;\n } catch (e) {\n if (e instanceof BowlosApiError) setError(e);\n throw e;\n } finally {\n setLoading(false);\n }\n },\n [client, name, auth],\n );\n\n const reset = useCallback(() => {\n setData(null);\n setError(null);\n setLoading(false);\n }, []);\n\n return { run, data, error, loading, reset };\n}\n","/**\n * Typed React data hooks for the booking funnel, built on `useBowlosQuery`.\n * Same arg/result types as the framework-agnostic functions in `data.ts`.\n */\nimport { useCallback } from \"react\";\nimport {\n useBowlosQuery,\n useBowlosMutation,\n type UseQueryOptions,\n type UseQueryResult,\n type UseMutationResult,\n} from \"./react\";\nimport { generateIdempotencyKey } from \"./data\";\nimport type {\n CancelPreview,\n CancelResult,\n MyGameCard,\n ReservationCancelArgs,\n OrderCancelArgs,\n GameCardCancelArgs,\n} from \"./account\";\nimport type {\n AvailabilityArgs,\n AvailabilityResult,\n BookingPreviewArgs,\n BookingQuote,\n PublicAddon,\n StartTimesArgs,\n PackagePreviewArgs,\n PackagePreviewResult,\n GameCardPreviewArgs,\n GameCardPreviewResult,\n EventTicketPreviewArgs,\n EventTicketPreviewResult,\n MembershipPreviewArgs,\n MembershipPreviewResult,\n MembershipSubscriptionPreviewResult,\n} from \"./data\";\nimport type {\n BrandScoped,\n EventOrderDetailArgs,\n FlashBookingOptionsArgs,\n FlashSaleArgs,\n FlashSalesArgs,\n MembershipDetailArgs,\n ReservationDetailArgs,\n} from \"./account\";\nimport type {\n BrandCatalogArgs,\n CatalogArgs,\n CatalogResult,\n CenterScoped,\n PackageDetailArgs,\n CenterHoursArgs,\n RetailPricing,\n} from \"./catalog\";\n\n/** Live free-unit availability for a product / date / time window. */\nexport function useAvailability(\n args: AvailabilityArgs,\n options?: UseQueryOptions,\n): UseQueryResult<AvailabilityResult> {\n return useBowlosQuery<AvailabilityResult>(\"checkAvailability\", args, options);\n}\n\n/** Authoritative price quote for the chosen booking inputs. */\nexport function useBookingPreview(\n args: BookingPreviewArgs,\n options?: UseQueryOptions,\n): UseQueryResult<BookingQuote> {\n return useBowlosQuery<BookingQuote>(\"bookingPreview\", args, options);\n}\n\n/** Bookable add-ons (shoe rental, upgrades…) for a product. */\nexport function useAddons(\n args: { productId: string },\n options?: UseQueryOptions,\n): UseQueryResult<PublicAddon[]> {\n return useBowlosQuery<PublicAddon[]>(\"listPublicAddons\", args, options);\n}\n\n/** Bookable start times (minute-of-day) for a product on a date. */\nexport function useStartTimes(\n args: StartTimesArgs,\n options?: UseQueryOptions,\n): UseQueryResult<number[]> {\n return useBowlosQuery<number[]>(\"availableStartTimes\", args, options);\n}\n\n// ── account (require a signed-in customer) ───────────────────────────────────\n// Results are generic (`<T = unknown>`) — parameterize with your own shape.\n\n/** The signed-in customer's reservations. */\nexport function useMyReservations<T = unknown>(\n args: BrandScoped,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"listMyReservations\", args, { ...options, auth: true });\n}\n\n/** One of the customer's reservations, by displayId. */\nexport function useMyReservationDetail<T = unknown>(\n args: ReservationDetailArgs,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"getMyReservationDetail\", args, { ...options, auth: true });\n}\n\n/** The signed-in customer's event ticket orders. */\nexport function useMyEventOrders<T = unknown>(\n args: BrandScoped,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"listMyEventOrders\", args, { ...options, auth: true });\n}\n\n/** One of the customer's event ticket orders. */\nexport function useMyEventOrder<T = unknown>(\n args: EventOrderDetailArgs,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"getMyEventOrder\", args, { ...options, auth: true });\n}\n\n/** The customer's memberships. */\nexport function useMyMemberships<T = unknown>(\n args: BrandScoped,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"listMyMemberships\", args, { ...options, auth: true });\n}\n\n/** One membership's detail. */\nexport function useMyMembershipDetail<T = unknown>(\n args: MembershipDetailArgs,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"getMyMembershipDetail\", args, { ...options, auth: true });\n}\n\n/** Loyalty tier + points. */\nexport function useMyLoyalty<T = unknown>(\n args: BrandScoped,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"getMyLoyalty\", args, { ...options, auth: true });\n}\n\n/** Account credit balance + ledger. */\nexport function useMyCredits<T = unknown>(\n args: BrandScoped,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"listMyCredits\", args, { ...options, auth: true });\n}\n\n/** Issued wallet passes. */\nexport function useMyPasses<T = unknown>(\n args: BrandScoped,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"listMyPasses\", args, { ...options, auth: true });\n}\n\n/** The customer's game cards for this Brand (with the unused-only `cancellable`\n * flag), so a headless site can list them + drive cancel. */\nexport function useMyGameCards<T = MyGameCard[]>(\n args: BrandScoped,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"listMyGameCards\", args, { ...options, auth: true });\n}\n\n// ── self-serve cancel (v0.23.0): preview reads + cancel mutations ─────────────\n//\n// Per type: preview \"what you'll get back\" → confirm → cancel. The cancel hooks\n// generate a fresh idempotencyKey per attempt, so the caller never manages it.\n// Game cards cancel only while fully unused (locked rule) → full credit.\n\n/** Preview the credit for cancelling a reservation (advisory; cancel re-computes). */\nexport function useReservationCancelPreview<T = CancelPreview>(\n args: { brandId: string; reservationId: string },\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"previewMyCancellation\", args, { ...options, auth: true });\n}\n/** Preview the credit for cancelling an event order. */\nexport function useEventOrderCancelPreview<T = CancelPreview>(\n args: { brandId: string; orderId: string },\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"previewMyEventOrderCancellation\", args, { ...options, auth: true });\n}\n/** Preview the credit for cancelling a package order. */\nexport function usePackageOrderCancelPreview<T = CancelPreview>(\n args: { brandId: string; orderId: string },\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"previewMyPackageOrderCancellation\", args, { ...options, auth: true });\n}\n/** Preview the credit for cancelling a game card (full credit only if unused). */\nexport function useGameCardCancelPreview<T = CancelPreview>(\n args: { brandId: string; cardId: string },\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"previewMyGameCardCancellation\", args, { ...options, auth: true });\n}\n\n/** Cancel a reservation → store credit per policy. Pass the `version` from the\n * list/detail as `expectedVersion`; the hook supplies the idempotency key. */\nexport function useCancelMyReservation(): UseMutationResult<\n Omit<ReservationCancelArgs, \"idempotencyKey\">,\n CancelResult\n> {\n const m = useBowlosMutation<ReservationCancelArgs, CancelResult>(\"cancelMyReservation\", {\n auth: true,\n });\n const run = useCallback(\n (args: Omit<ReservationCancelArgs, \"idempotencyKey\">) =>\n m.run({ ...args, idempotencyKey: generateIdempotencyKey() }),\n [m],\n );\n return { ...m, run };\n}\n/** Cancel an event order → store credit per policy. */\nexport function useCancelMyEventOrder(): UseMutationResult<\n Omit<OrderCancelArgs, \"idempotencyKey\">,\n CancelResult\n> {\n const m = useBowlosMutation<OrderCancelArgs, CancelResult>(\"cancelMyEventOrder\", { auth: true });\n const run = useCallback(\n (args: Omit<OrderCancelArgs, \"idempotencyKey\">) =>\n m.run({ ...args, idempotencyKey: generateIdempotencyKey() }),\n [m],\n );\n return { ...m, run };\n}\n/** Cancel a package order → store credit per policy; releases the slot. */\nexport function useCancelMyPackageOrder(): UseMutationResult<\n Omit<OrderCancelArgs, \"idempotencyKey\">,\n CancelResult\n> {\n const m = useBowlosMutation<OrderCancelArgs, CancelResult>(\"cancelMyPackageOrder\", { auth: true });\n const run = useCallback(\n (args: Omit<OrderCancelArgs, \"idempotencyKey\">) =>\n m.run({ ...args, idempotencyKey: generateIdempotencyKey() }),\n [m],\n );\n return { ...m, run };\n}\n/** Cancel a game card → full credit (unused cards only). */\nexport function useCancelMyGameCard(): UseMutationResult<\n Omit<GameCardCancelArgs, \"idempotencyKey\">,\n CancelResult\n> {\n const m = useBowlosMutation<GameCardCancelArgs, CancelResult>(\"cancelMyGameCard\", { auth: true });\n const run = useCallback(\n (args: Omit<GameCardCancelArgs, \"idempotencyKey\">) =>\n m.run({ ...args, idempotencyKey: generateIdempotencyKey() }),\n [m],\n );\n return { ...m, run };\n}\n\n// ── flash sales (session-aware: members see prices) ──────────────────────────\n\n/** The public flash-sale page (members see prices; anonymous gets the locked view). */\nexport function useFlashSale<T = unknown>(\n args: FlashSaleArgs,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"getPublicFlashSaleBySlug\", args, { ...options, auth: true });\n}\n\n/** The public flash-sale index for a Brand (live + upcoming; no prices). Public. */\nexport function useFlashSales<T = unknown>(\n args: FlashSalesArgs,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"listPublicFlashSales\", args, options);\n}\n\n/** Per-start-hour options for a flash-sale reservation item (members only). */\nexport function useFlashSaleBookingOptions<T = unknown>(\n args: FlashBookingOptionsArgs,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"getFlashSaleBookingOptions\", args, { ...options, auth: true });\n}\n\n// ── public catalog (anonymous; power `<BookingCatalog>`) ──────────────────────\n\n/**\n * The canonical public catalog for a surface — every category grouped, with the\n * Center admin's per-surface visibility already applied. Prefer this over the\n * per-category hooks below when you want the full, visibility-aware catalog\n * (it stays consistent with the white-label web + mobile surfaces). Anonymous.\n */\nexport function useCatalog<T = CatalogResult>(\n args: CatalogArgs,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"listPublicCatalog\", args, options);\n}\n\n/**\n * Full Test Mode (2026-06-23): is this Center in operator-enabled test mode?\n * Reads the same `listPublicCatalog` payload as `useCatalog`, so it's free when\n * you already render the catalog. Show `<MaintenanceBanner>` (or your own themed\n * notice) when `maintenanceMode` is true — normal-customer bookings are\n * server-refused in this state (`CENTER_IN_MAINTENANCE`); only admin\n * Test-Account customers transact.\n */\nexport function useTestMode(\n args: CatalogArgs,\n options?: UseQueryOptions,\n): { maintenanceMode: boolean; loading: boolean } {\n const res = useCatalog(args, options);\n return {\n maintenanceMode: res.data?.maintenanceMode === true,\n loading: res.loading,\n };\n}\n\n/** Bookable products at a Center (each carries `attractionTypeKey`). */\nexport function useProducts<T = unknown>(\n args: CenterScoped,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"listPublicProducts\", args, options);\n}\n\n/** Upcoming pricing events at a Center. */\nexport function useEvents<T = unknown>(\n args: CenterScoped,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"listPublicEvents\", args, options);\n}\n\n/** Sellable event offers at a Center. Use these for the product lineup and\n * event landing pages; each row carries a slug and purchase mode. */\nexport function useEventOffers<T = unknown>(\n args: CenterScoped,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"listPublicEventOffers\", args, options);\n}\n\n/** One sellable event offer by landing-page slug. */\nexport function useEventOffer<T = unknown>(\n args: { slug: string },\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"getPublicEventOffer\", args, options);\n}\n\n/** Purchasable packages at a Brand. */\nexport function usePackages<T = unknown>(\n args: BrandCatalogArgs,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"listPublicPackages\", args, options);\n}\n\n/** Full detail for one package (components, add-ons, allowed start times, …) —\n * drives the headless package config UI before `usePackagePurchase`. */\nexport function usePackage<T = unknown>(\n args: PackageDetailArgs,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"getPublicPackage\", args, options);\n}\n\n/** A Center's public price list — walk-in (matrix) rates grouped by attraction\n * plus opted-in \"website specials\". Anonymous, read-only; drives a printed-\n * menu-style pricing page (or the reference `<PricingTable>`). Not a booking\n * surface — render-only. */\nexport function useRetailPricing<T = RetailPricing>(\n args: CenterScoped,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"listRetailPricing\", args, options);\n}\n\n/** A Center's open/close window for the given attraction types on a date — use\n * the package's component attraction-type keys to bound its bookable slots. */\nexport function useCenterHours<T = unknown>(\n args: CenterHoursArgs,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"getCenterOperatingHoursForTypes\", args, options);\n}\n\n/** Itemized quote for a package order — base, add-ons, tax lines, the selling\n * Center's booking fee, and the authoritative grand total. Drives the headless\n * **Review** step. Requires a signed-in customer (tax exemptions are applied),\n * and is computed by the same engine as the PaymentIntent, so it never diverges\n * from what the customer is charged. */\nexport function usePackagePreview<T = PackagePreviewResult>(\n args: PackagePreviewArgs,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"previewPackageOrder\", args, { ...options, auth: true });\n}\n\n/** Purchasable memberships at a Center. */\nexport function usePublicMemberships<T = unknown>(\n args: CenterScoped,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"listPublicMemberships\", args, options);\n}\n\n/** Purchasable game cards / passes at a Brand. */\nexport function useGameCards<T = unknown>(\n args: BrandCatalogArgs,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"listPublicGameCards\", args, options);\n}\n\n/** Itemized quote for a game-pass purchase — the base price, tax lines, the\n * selling Center's booking fee, and the authoritative grand total. Drives the\n * headless **Review** step. Requires a signed-in customer (tax exemptions are\n * applied + the home Center is resolved server-side), and is computed by the\n * same engine as the PaymentIntent, so it never diverges from what the\n * customer is charged. */\nexport function useGameCardPreview<T = GameCardPreviewResult>(\n args: GameCardPreviewArgs,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"previewGameCardOrder\", args, { ...options, auth: true });\n}\n\n/** Itemized quote for a ticket-mode event offer — base tickets, tax lines,\n * Center event fee, and authoritative grand total. Requires a signed-in\n * customer so tax exemptions match the eventual charge. */\nexport function useEventTicketPreview<T = EventTicketPreviewResult>(\n args: EventTicketPreviewArgs,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"previewEventTicketOrder\", args, { ...options, auth: true });\n}\n\n/** Itemized quote for a one-time membership purchase — dues, the one-time setup\n * fee, tax lines, the selling Center's booking fee, and the authoritative grand\n * total. Drives the headless **Review** step. Requires a signed-in customer (tax\n * exemptions are applied + the home Center is resolved server-side), and is\n * computed by the same engine as the PaymentIntent, so it never diverges from\n * what the customer is charged. */\nexport function useMembershipPreview<T = MembershipPreviewResult>(\n args: MembershipPreviewArgs,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"previewMembershipOrder\", args, { ...options, auth: true });\n}\n\n/** Itemized quote for a RECURRING membership subscription — the one-time Review\n * fields (\"Due today\") PLUS `recurringTotalCents` + `cadence` (\"Auto-renews\n * at\"). Drives the recurring **Review** step. Requires a signed-in customer, and\n * is computed by the same engine as the subscription's first invoice, so it\n * never diverges from what the customer is charged. */\nexport function useMembershipSubscriptionPreview<T = MembershipSubscriptionPreviewResult>(\n args: MembershipPreviewArgs,\n options?: UseQueryOptions,\n): UseQueryResult<T> {\n return useBowlosQuery<T>(\"previewMembershipSubscriptionOrder\", args, {\n ...options,\n auth: true,\n });\n}\n","/**\n * useBookingFlow — the hold → pay → confirm state machine.\n *\n * Orchestrates the booking funnel and HANDS the Stripe (Connect) payment data\n * to the UI layer; it does NOT load Stripe.js. After `preparePayment()`, render\n * Stripe Elements from `paymentIntent` (initialize Stripe with\n * `connectedAccountId` + `clientSecret`), let the customer pay, then\n * `startPolling()` until the webhook materializes the booking\n * (`status: \"confirmed\"`).\n *\n * Flow:\n * startHold(args) → \"held\" (requiresPayment) | \"confirmed\" (credit covered)\n * preparePayment() → \"awaitingPayment\" (+ paymentIntent)\n * [consumer renders Stripe Elements + the customer pays]\n * startPolling() → \"confirmed\" | \"expired\" | \"failed\" | \"abandoned\"\n */\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useBowlosClient } from \"./react\";\nimport { BowlosApiError, BOWLOS_ERROR_CODES } from \"./errors\";\nimport {\n abandonCheckout as abandonCheckoutCall,\n createBooking as createBookingCall,\n createCheckoutPaymentIntent as createPaymentIntentCall,\n getCheckoutStatus as getCheckoutStatusCall,\n type BookingHold,\n type CheckoutStatusResult,\n type CreateBookingArgs,\n type PaymentIntentInfo,\n} from \"./data\";\n\nexport type BookingFlowStatus =\n | \"idle\"\n | \"holding\"\n | \"held\"\n | \"preparingPayment\"\n | \"awaitingPayment\"\n | \"confirmed\"\n | \"expired\"\n | \"failed\"\n | \"abandoned\"\n | \"error\";\n\nexport interface BookingReservationRef {\n reservationId: string | null;\n reservationDisplayId: string | null;\n}\n\nexport interface UseBookingFlowResult {\n status: BookingFlowStatus;\n hold: BookingHold | null;\n refToken: string | null;\n paymentIntent: PaymentIntentInfo | null;\n reservation: BookingReservationRef | null;\n requiresPayment: boolean | null;\n error: BowlosApiError | null;\n startHold: (args: CreateBookingArgs) => Promise<void>;\n preparePayment: () => Promise<PaymentIntentInfo | null>;\n pollStatus: () => Promise<CheckoutStatusResult | null>;\n startPolling: (intervalMs?: number) => void;\n stopPolling: () => void;\n abandon: () => Promise<void>;\n reset: () => void;\n}\n\nconst DEFAULT_POLL_MS = 2500;\n\nexport function useBookingFlow(): UseBookingFlowResult {\n const client = useBowlosClient();\n const [status, setStatus] = useState<BookingFlowStatus>(\"idle\");\n const [hold, setHold] = useState<BookingHold | null>(null);\n const [refToken, setRefToken] = useState<string | null>(null);\n const [paymentIntent, setPaymentIntent] = useState<PaymentIntentInfo | null>(null);\n const [reservation, setReservation] = useState<BookingReservationRef | null>(null);\n const [error, setError] = useState<BowlosApiError | null>(null);\n\n // Mirror of refToken for the polling interval (avoids a stale closure).\n const refTokenRef = useRef<string | null>(null);\n const pollRef = useRef<ReturnType<typeof setInterval> | null>(null);\n\n const stopPolling = useCallback(() => {\n if (pollRef.current !== null) {\n clearInterval(pollRef.current);\n pollRef.current = null;\n }\n }, []);\n\n useEffect(() => stopPolling, [stopPolling]); // clear the interval on unmount\n\n const reset = useCallback(() => {\n stopPolling();\n refTokenRef.current = null;\n setRefToken(null);\n setHold(null);\n setPaymentIntent(null);\n setReservation(null);\n setError(null);\n setStatus(\"idle\");\n }, [stopPolling]);\n\n const applyStatus = useCallback(\n (s: CheckoutStatusResult) => {\n switch (s.status) {\n case \"paid_materialized\":\n setReservation({\n reservationId: s.reservationId,\n reservationDisplayId: s.reservationDisplayId,\n });\n setStatus(\"confirmed\");\n stopPolling();\n break;\n case \"expired\":\n setStatus(\"expired\");\n stopPolling();\n break;\n case \"abandoned\":\n setStatus(\"abandoned\");\n stopPolling();\n break;\n case \"payment_failed_retryable\":\n setStatus(\"failed\");\n stopPolling();\n break;\n case \"not_found\":\n setError(new BowlosApiError(BOWLOS_ERROR_CODES.NOT_FOUND, \"Checkout not found.\", 404));\n setStatus(\"error\");\n stopPolling();\n break;\n case \"pending_payment\":\n default:\n break; // keep waiting\n }\n },\n [stopPolling],\n );\n\n const startHold = useCallback(\n async (args: CreateBookingArgs) => {\n stopPolling();\n setError(null);\n setPaymentIntent(null);\n setReservation(null);\n setStatus(\"holding\");\n try {\n const h = await createBookingCall(client, args);\n setHold(h);\n const rt = typeof h.checkoutRefToken === \"string\" ? h.checkoutRefToken : null;\n refTokenRef.current = rt;\n setRefToken(rt);\n if (!h.requiresPayment) {\n setReservation({\n reservationId: h.reservationId ?? null,\n reservationDisplayId: h.reservationDisplayId ?? null,\n });\n setStatus(\"confirmed\");\n } else if (rt) {\n setStatus(\"held\");\n } else {\n setError(\n new BowlosApiError(\n \"UNSUPPORTED_BOOKING_PATH\",\n \"This booking requires payment but no checkout hold was returned.\",\n 0,\n ),\n );\n setStatus(\"error\");\n }\n } catch (e) {\n if (e instanceof BowlosApiError) setError(e);\n setStatus(\"error\");\n }\n },\n [client, stopPolling],\n );\n\n const preparePayment = useCallback(async (): Promise<PaymentIntentInfo | null> => {\n const rt = refTokenRef.current;\n if (!rt) return null;\n setError(null);\n setStatus(\"preparingPayment\");\n try {\n const pi = await createPaymentIntentCall(client, rt);\n setPaymentIntent(pi);\n setStatus(\"awaitingPayment\");\n return pi;\n } catch (e) {\n if (e instanceof BowlosApiError) setError(e);\n setStatus(\"error\");\n return null;\n }\n }, [client]);\n\n const pollStatus = useCallback(async (): Promise<CheckoutStatusResult | null> => {\n const rt = refTokenRef.current;\n if (!rt) return null;\n try {\n const s = await getCheckoutStatusCall(client, rt);\n applyStatus(s);\n return s;\n } catch (e) {\n if (e instanceof BowlosApiError) setError(e);\n return null;\n }\n }, [client, applyStatus]);\n\n const startPolling = useCallback(\n (intervalMs: number = DEFAULT_POLL_MS) => {\n stopPolling();\n void pollStatus();\n pollRef.current = setInterval(() => {\n void pollStatus();\n }, intervalMs);\n },\n [pollStatus, stopPolling],\n );\n\n const abandon = useCallback(async () => {\n stopPolling();\n const rt = refTokenRef.current;\n if (rt) {\n try {\n await abandonCheckoutCall(client, rt);\n } catch {\n // best-effort: the hold also frees itself on its TTL\n }\n }\n setStatus(\"abandoned\");\n }, [client, stopPolling]);\n\n return {\n status,\n hold,\n refToken,\n paymentIntent,\n reservation,\n requiresPayment: hold ? hold.requiresPayment : null,\n error,\n startHold,\n preparePayment,\n pollStatus,\n startPolling,\n stopPolling,\n abandon,\n reset,\n };\n}\n"]}
|
package/dist/components.cjs
CHANGED
|
@@ -212,6 +212,9 @@ function useTestMode(args, options) {
|
|
|
212
212
|
loading: res.loading
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
|
+
function useRetailPricing(args, options) {
|
|
216
|
+
return useBowlosQuery("listRetailPricing", args, options);
|
|
217
|
+
}
|
|
215
218
|
var DEFAULT_MESSAGE = "We're performing maintenance \u2014 online booking is temporarily unavailable. Please check back soon.";
|
|
216
219
|
function MaintenanceBanner({
|
|
217
220
|
brandId,
|
|
@@ -1813,6 +1816,129 @@ function InquiryForm({
|
|
|
1813
1816
|
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "submit", disabled: status === "submitting", children: status === "submitting" ? "Sending\u2026" : submitLabel })
|
|
1814
1817
|
] });
|
|
1815
1818
|
}
|
|
1819
|
+
var DAY_NAMES = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
1820
|
+
function fmtMinute(m) {
|
|
1821
|
+
const hh = Math.floor(m / 60) % 24;
|
|
1822
|
+
const mm = m % 60;
|
|
1823
|
+
const ampm = hh < 12 ? "AM" : "PM";
|
|
1824
|
+
const h12 = hh % 12 === 0 ? 12 : hh % 12;
|
|
1825
|
+
return mm === 0 ? `${h12} ${ampm}` : `${h12}:${String(mm).padStart(2, "0")} ${ampm}`;
|
|
1826
|
+
}
|
|
1827
|
+
function rateForMode(r, mode) {
|
|
1828
|
+
switch (mode) {
|
|
1829
|
+
case "per_unit_per_hour":
|
|
1830
|
+
return r.rateUnitHourCents;
|
|
1831
|
+
case "per_person_per_hour":
|
|
1832
|
+
return r.ratePersonHourCents;
|
|
1833
|
+
case "per_game":
|
|
1834
|
+
return r.rateGameCents;
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
function modeLabel(mode, unitPlural) {
|
|
1838
|
+
switch (mode) {
|
|
1839
|
+
case "per_unit_per_hour":
|
|
1840
|
+
return `Per ${unitPlural.replace(/s$/, "")}/hr`;
|
|
1841
|
+
case "per_person_per_hour":
|
|
1842
|
+
return "Per person/hr";
|
|
1843
|
+
case "per_game":
|
|
1844
|
+
return "Per game";
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
function AttractionRates({ a }) {
|
|
1848
|
+
if (a.walkInRates.length === 0) return null;
|
|
1849
|
+
const modes = a.enabledModes;
|
|
1850
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1851
|
+
/* @__PURE__ */ jsxRuntime.jsx("h4", { style: { margin: "0 0 0.5rem", fontSize: "1.05rem" }, children: a.name }),
|
|
1852
|
+
/* @__PURE__ */ jsxRuntime.jsxs("table", { style: { width: "100%", borderCollapse: "collapse", fontSize: "0.95rem" }, children: [
|
|
1853
|
+
/* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { style: { textAlign: "left", color: token("colorMuted") }, children: [
|
|
1854
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { style: { padding: "0.35rem 0.5rem" }, children: "Day" }),
|
|
1855
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { style: { padding: "0.35rem 0.5rem" }, children: "Time" }),
|
|
1856
|
+
modes.map((m) => /* @__PURE__ */ jsxRuntime.jsx("th", { style: { padding: "0.35rem 0.5rem", textAlign: "right" }, children: modeLabel(m, a.unitLabelPlural) }, m))
|
|
1857
|
+
] }) }),
|
|
1858
|
+
/* @__PURE__ */ jsxRuntime.jsx("tbody", { children: a.walkInRates.map((r, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1859
|
+
"tr",
|
|
1860
|
+
{
|
|
1861
|
+
style: { borderTop: `1px solid ${token("colorBorder")}` },
|
|
1862
|
+
children: [
|
|
1863
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { style: { padding: "0.35rem 0.5rem" }, children: DAY_NAMES[r.dayOfWeek] }),
|
|
1864
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { style: { padding: "0.35rem 0.5rem" }, children: r.label ?? `${fmtMinute(r.startMinuteOfDay)} \u2013 ${fmtMinute(r.endMinuteOfDay)}` }),
|
|
1865
|
+
modes.map((m) => {
|
|
1866
|
+
const cents = rateForMode(r, m);
|
|
1867
|
+
return /* @__PURE__ */ jsxRuntime.jsx("td", { style: { padding: "0.35rem 0.5rem", textAlign: "right" }, children: cents === null ? "\u2014" : formatCents(cents) }, m);
|
|
1868
|
+
})
|
|
1869
|
+
]
|
|
1870
|
+
},
|
|
1871
|
+
i
|
|
1872
|
+
)) })
|
|
1873
|
+
] })
|
|
1874
|
+
] });
|
|
1875
|
+
}
|
|
1876
|
+
function SpecialCard({ s }) {
|
|
1877
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1878
|
+
"div",
|
|
1879
|
+
{
|
|
1880
|
+
style: {
|
|
1881
|
+
border: `1px solid ${token("colorBorder")}`,
|
|
1882
|
+
borderRadius: token("radius"),
|
|
1883
|
+
background: token("colorSurface"),
|
|
1884
|
+
padding: "0.85rem 1rem",
|
|
1885
|
+
display: "flex",
|
|
1886
|
+
justifyContent: "space-between",
|
|
1887
|
+
gap: "1rem",
|
|
1888
|
+
alignItems: "baseline"
|
|
1889
|
+
},
|
|
1890
|
+
children: [
|
|
1891
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1892
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontWeight: 600 }, children: s.name }),
|
|
1893
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { color: token("colorMuted"), fontSize: "0.9rem" }, children: s.description }),
|
|
1894
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { color: token("colorMuted"), fontSize: "0.8rem" }, children: s.attractionName })
|
|
1895
|
+
] }),
|
|
1896
|
+
s.priceCents !== null && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontWeight: 700, color: token("colorPrimary"), whiteSpace: "nowrap" }, children: formatCents(s.priceCents) })
|
|
1897
|
+
]
|
|
1898
|
+
}
|
|
1899
|
+
);
|
|
1900
|
+
}
|
|
1901
|
+
function PricingTable({
|
|
1902
|
+
centerId,
|
|
1903
|
+
specialsOnly = false,
|
|
1904
|
+
labels,
|
|
1905
|
+
className,
|
|
1906
|
+
style
|
|
1907
|
+
}) {
|
|
1908
|
+
const { data, loading } = useRetailPricing({ centerId });
|
|
1909
|
+
if (loading && !data) {
|
|
1910
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontFamily: token("fontFamily"), color: token("colorMuted") }, children: labels?.loading ?? "Loading pricing\u2026" });
|
|
1911
|
+
}
|
|
1912
|
+
if (!data) return null;
|
|
1913
|
+
const hasWalkIn = data.attractions.some((a) => a.walkInRates.length > 0);
|
|
1914
|
+
const hasSpecials = data.specials.length > 0;
|
|
1915
|
+
if (!hasWalkIn && !hasSpecials) {
|
|
1916
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontFamily: token("fontFamily"), color: token("colorMuted") }, children: labels?.empty ?? "Pricing isn't published yet." });
|
|
1917
|
+
}
|
|
1918
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1919
|
+
"div",
|
|
1920
|
+
{
|
|
1921
|
+
className,
|
|
1922
|
+
style: {
|
|
1923
|
+
fontFamily: token("fontFamily"),
|
|
1924
|
+
color: token("colorText"),
|
|
1925
|
+
background: token("colorBg"),
|
|
1926
|
+
...style
|
|
1927
|
+
},
|
|
1928
|
+
children: [
|
|
1929
|
+
labels?.heading && /* @__PURE__ */ jsxRuntime.jsx("h3", { style: { margin: "0 0 1rem" }, children: labels.heading }),
|
|
1930
|
+
hasSpecials && /* @__PURE__ */ jsxRuntime.jsxs("section", { style: { marginBottom: "1.75rem" }, children: [
|
|
1931
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { style: { margin: "0 0 0.75rem", fontSize: "1.15rem" }, children: labels?.specialsHeading ?? "Specials" }),
|
|
1932
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "0.6rem" }, children: data.specials.map((s) => /* @__PURE__ */ jsxRuntime.jsx(SpecialCard, { s }, s.planId)) })
|
|
1933
|
+
] }),
|
|
1934
|
+
!specialsOnly && hasWalkIn && /* @__PURE__ */ jsxRuntime.jsxs("section", { children: [
|
|
1935
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { style: { margin: "0 0 0.75rem", fontSize: "1.15rem" }, children: labels?.walkInHeading ?? "Walk-in rates" }),
|
|
1936
|
+
data.attractions.map((a) => /* @__PURE__ */ jsxRuntime.jsx(AttractionRates, { a }, a.attractionId))
|
|
1937
|
+
] })
|
|
1938
|
+
]
|
|
1939
|
+
}
|
|
1940
|
+
);
|
|
1941
|
+
}
|
|
1816
1942
|
|
|
1817
1943
|
exports.AccountDashboard = AccountDashboard;
|
|
1818
1944
|
exports.AccountMenu = AccountMenu;
|
|
@@ -1826,6 +1952,7 @@ exports.FlashSale = FlashSale;
|
|
|
1826
1952
|
exports.FlashSaleIndex = FlashSaleIndex;
|
|
1827
1953
|
exports.InquiryForm = InquiryForm;
|
|
1828
1954
|
exports.MaintenanceBanner = MaintenanceBanner;
|
|
1955
|
+
exports.PricingTable = PricingTable;
|
|
1829
1956
|
exports.formatCents = formatCents;
|
|
1830
1957
|
exports.formatCentsRange = formatCentsRange;
|
|
1831
1958
|
//# sourceMappingURL=components.cjs.map
|