@bowlos/reservations 0.34.0 → 0.35.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 +14 -1
- package/README.md +9 -0
- package/dist/{account-CsCusw5Z.d.ts → account-BJ5UjC0r.d.ts} +1 -1
- package/dist/{account-Di8nktqp.d.cts → account-QoFg8-i1.d.cts} +1 -1
- package/dist/{catalog-DT-ePirK.d.ts → catalog-CGitz1PG.d.ts} +1 -1
- package/dist/{catalog-DdvLcOrs.d.cts → catalog-p9cwB6Qv.d.cts} +1 -1
- package/dist/{chunk-CAXGTKJQ.js → chunk-MMSVM3QS.js} +3 -3
- package/dist/{chunk-CAXGTKJQ.js.map → chunk-MMSVM3QS.js.map} +1 -1
- package/dist/{chunk-EQH5HDYQ.js → chunk-SMPDCDMB.js} +3 -3
- package/dist/chunk-SMPDCDMB.js.map +1 -0
- package/dist/{chunk-GIAJQPMM.js → chunk-UN5E6UEZ.js} +2 -2
- package/dist/{chunk-GIAJQPMM.js.map → chunk-UN5E6UEZ.js.map} +1 -1
- package/dist/components.cjs +14 -5
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +4 -4
- package/dist/components.d.ts +4 -4
- package/dist/components.js +16 -7
- package/dist/components.js.map +1 -1
- package/dist/{data-BaHVz6fa.d.cts → data-qw8P3JW3.d.cts} +22 -2
- package/dist/{data-BaHVz6fa.d.ts → data-qw8P3JW3.d.ts} +22 -2
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/payments.d.cts +1 -1
- package/dist/payments.d.ts +1 -1
- package/dist/{react-DImwA9C9.d.ts → react-C2V1kXnO.d.ts} +2 -2
- package/dist/{react-DK1elmLQ.d.cts → react-DtncBQ3b.d.cts} +2 -2
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +6 -6
- package/dist/react.d.ts +6 -6
- package/dist/react.js +3 -3
- package/package.json +1 -1
- package/templates/center-site/app/catalog/page.tsx +8 -10
- package/templates/center-site/package.json +1 -1
- package/dist/chunk-EQH5HDYQ.js.map +0 -1
package/HEADLESS.md
CHANGED
|
@@ -189,10 +189,22 @@ const preview = useBookingPreview(
|
|
|
189
189
|
{ centerId, productId, dateISO, startMinuteOfDay, endMinuteOfDay, mode: pricingMode, ...countField(count), addons: selectedAddons },
|
|
190
190
|
{ enabled: dateISO !== "", auth: signedIn }, // v0.27.0: anonymous → standard; auth → member rate + credit
|
|
191
191
|
);
|
|
192
|
-
const
|
|
192
|
+
const availableUnits = availability.data ? availableUnitCount(availability.data) : null;
|
|
193
193
|
const quoteCents = preview.data?.totalCentsPerPlan?.[0]?.totalCents ?? null; // includes add-ons + tax + credit
|
|
194
|
+
|
|
195
|
+
// v0.35.0: the operator-configured noun for this attraction (a lane / room /
|
|
196
|
+
// bay / bowler / game) — NEVER hardcode "lane". Both `useAvailability` and
|
|
197
|
+
// `useBookingPreview` now return `unitNoun: { singular, plural }`. Pick by count.
|
|
198
|
+
const noun = (n: { singular: string; plural: string } | undefined, count: number, fb = { singular: "lane", plural: "lanes" }) =>
|
|
199
|
+
count === 1 ? (n ?? fb).singular : (n ?? fb).plural;
|
|
200
|
+
// availability line: `${availableUnits} ${noun(availability.data?.unitNoun, availableUnits)} available`
|
|
201
|
+
// review/order line: `${count} ${noun(preview.data?.unitNoun, count)}` // e.g. "1 room", "2 rooms"
|
|
194
202
|
```
|
|
195
203
|
|
|
204
|
+
> ⚠️ **`availableUnitCount` / `useAvailability` count UNOCCUPIED units — this is an availability signal, NOT "free of charge."** Label it **"available"** or **"open"** (e.g. `"2 lanes available"`). **Never render it as "free"** — `"2 lanes free"` sitting next to a price reads as *no cost* and misleads the customer. The drop-in `<BookingFlow>` renders `"N lanes available"` for exactly this reason; match that word in your own UI.
|
|
205
|
+
|
|
206
|
+
> 🏷️ **Never hardcode the unit noun.** A party room, VIP bay, or axe-throwing target is NOT a "lane". As of **v0.35.0** the gateway sends `unitNoun: { singular, plural }` on both `useAvailability` and `useBookingPreview`, resolved from the operator's admin config and the pricing mode (unit → lane/room, per-person → bowler/guest, per-game → game). Render `{count} {singular|plural}` — count-aware — so a single room reads **"1 room"**, not **"1 lanes"**. Older gateways omit `unitNoun`; fall back to `"lane"/"lanes"`.
|
|
207
|
+
|
|
196
208
|
### 5. Start time — a dropdown of bookable slots (not a free-form clock)
|
|
197
209
|
|
|
198
210
|
`useStartTimes` returns the minute-of-day slots that are within open hours, clear
|
|
@@ -1351,6 +1363,7 @@ Headless sites do **not** get these from a version bump — apply them by hand.
|
|
|
1351
1363
|
| **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. |
|
|
1352
1364
|
|
|
1353
1365
|
| **0.32.0** | **Flash sale for any sellable type** — packages, memberships (one-time), game passes, and event tickets can now be put on a flash sale and bought at the sale price (reservations already had the dedicated flow). `useFlashSale` items carry `sourceType`/`sourceId`/`buyPath`; every flat buy + preview hook/fn (`useGameCardPurchase`/`useGameCardPreview`, `usePackage*`, `useMembership*`, `useEventTicket*` + the `previewX`/`createXOrder` core fns) gained an optional `flashSaleItemId`. | "Flat items on a flash sale" sub-section under "Booking a flash-sale item". Read `useFlashSale`, route flat items by `sourceType`, and pass `flashSaleItemId: item.id` into BOTH the preview and the create so Review + charge both show the sale price. The server validates Live + match, so a stale id is rejected. Additive — omit it and the buy is full price; reservation flash is unchanged. |
|
|
1366
|
+
| **0.35.0** | **Per-product unit noun** — `useAvailability` (`AvailabilityResult`) and `useBookingPreview` (`BookingQuote`) now return `unitNoun: { singular, plural }`, the operator-configured word for the booked thing (a lane / party room / VIP bay / bowler / game), resolved by pricing mode. Fixes the funnel hardcoding "lanes" for non-bowling attractions (a party room rendered "1 lanes"). | §4 "Live availability + price" — read `unitNoun` off both hooks and render `{count} {singular\|plural}` **count-aware** for the availability line AND the review/order line; never hardcode "lane"/"lanes". Additive: older gateways omit `unitNoun` → fall back to `"lane"/"lanes"`. The drop-in `<BookingFlow>` now does this automatically (and fixes the "1 lanes" → "1 lane"/"1 room" grammar). |
|
|
1354
1367
|
| **0.34.0** | **Package add-ons: `included` vs `optional` (revenue-blocking bug fix).** New exported `PackageAddon`/`PackageAddonMode` types + helpers `splitPackageAddons(addons)` (→ `{ included, optional }` for rendering) and `toOptionalAddonsInput(addons, qtyMap)` (builds the `optionalAddons` request from a quantity map, keeping ONLY `mode:"optional"` add-ons, flooring to positive ints, capping at `maxOptionalQuantity`, dropping included/unknown ids). Fixes the field bug where a site sent an `included` add-on in `optionalAddons` → `VALIDATION_FAILED — Add-on "X" is not optional` ("Couldn't load the total"). | "Buying a package" §1 — render add-ons via `splitPackageAddons` (included read-only, optional as steppers) and build the request via `toOptionalAddonsInput` instead of hand-mapping. Also surface the envelope `error.message` on failure. Purely additive: the add-on `mode` field was already returned; these are typed helpers so the mistake is impossible. |
|
|
1355
1368
|
|
|
1356
1369
|
When you add the next release here, add its row **and** any new capability-map
|
package/README.md
CHANGED
|
@@ -216,6 +216,15 @@ unknown ids, so sending an included add-on (→ `VALIDATION_FAILED — Add-on "X
|
|
|
216
216
|
not optional`) can't happen. Surface the envelope `error.message` on failure. See
|
|
217
217
|
"Buying a package" in `HEADLESS.md`.
|
|
218
218
|
|
|
219
|
+
**Per-product unit noun (v0.35.0):** `useAvailability` and `useBookingPreview`
|
|
220
|
+
now return `unitNoun: { singular, plural }` — the operator-configured word for
|
|
221
|
+
the booked thing (a lane / party room / VIP bay / bowler / game), resolved by
|
|
222
|
+
pricing mode. Render `{count} {singular|plural}` **count-aware** on both the
|
|
223
|
+
availability line and the review/order line; never hardcode "lane"/"lanes" (a
|
|
224
|
+
party room is not a "lane"). Older gateways omit it → fall back to `"lane"/
|
|
225
|
+
"lanes"`. The drop-in `<BookingFlow>` uses it automatically. See §4 in
|
|
226
|
+
`HEADLESS.md`.
|
|
227
|
+
|
|
219
228
|
## Drop-in components (`@bowlos/reservations/components`)
|
|
220
229
|
|
|
221
230
|
> These are a **reference / fast-start**, not the delivered product. Center sites
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createBowlosClient, BowlosApiError, generateIdempotencyKey, BOWLOS_ERROR_CODES, createBooking, createCheckoutPaymentIntent, getCheckoutStatus, abandonCheckout } from './chunk-
|
|
1
|
+
import { createBowlosClient, BowlosApiError, generateIdempotencyKey, BOWLOS_ERROR_CODES, createBooking, createCheckoutPaymentIntent, getCheckoutStatus, abandonCheckout } from './chunk-UN5E6UEZ.js';
|
|
2
2
|
import { createContext, useRef, useContext, useState, useCallback, useEffect } from 'react';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
@@ -485,5 +485,5 @@ function useBookingFlow() {
|
|
|
485
485
|
}
|
|
486
486
|
|
|
487
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-
|
|
489
|
-
//# sourceMappingURL=chunk-
|
|
488
|
+
//# sourceMappingURL=chunk-MMSVM3QS.js.map
|
|
489
|
+
//# sourceMappingURL=chunk-MMSVM3QS.js.map
|
|
@@ -1 +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,MAAM,IAAI,MAAM,0DAA0D,CAAA;AAAA,IAC5E;AACA,IAAA,GAAA,CAAI,OAAA,GAAU,mBAAmB,MAAM,CAAA;AAAA,EACzC;AACA,EAAA,MAAM,eAAe,GAAA,CAAI,OAAA;AAGzB,EAAA,MAAM,OAAA,GAAU,gBAAgB,YAAY,CAAA;AAC5C,EAAA,uBACE,GAAA,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,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-CAXGTKJQ.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"]}
|
|
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,MAAM,IAAI,MAAM,0DAA0D,CAAA;AAAA,IAC5E;AACA,IAAA,GAAA,CAAI,OAAA,GAAU,mBAAmB,MAAM,CAAA;AAAA,EACzC;AACA,EAAA,MAAM,eAAe,GAAA,CAAI,OAAA;AAGzB,EAAA,MAAM,OAAA,GAAU,gBAAgB,YAAY,CAAA;AAC5C,EAAA,uBACE,GAAA,CAAC,aAAA,CAAc,QAAA,EAAd,EAAuB,KAAA,EAAO,YAAA,EAC7B,QAAA,kBAAA,GAAA,CAAC,cAAA,CAAe,QAAA,EAAf,EAAwB,KAAA,EAAO,OAAA,EAAU,UAAS,CAAA,EACrD,CAAA;AAEJ;AAEO,SAAS,eAAA,GAAgC;AAC9C,EAAA,MAAM,MAAA,GAAS,WAAW,aAAa,CAAA;AACvC,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,MAAM,IAAI,MAAM,yDAAyD,CAAA;AAAA,EAC3E;AACA,EAAA,OAAO,MAAA;AACT;AAoCA,SAAS,gBAAgB,MAAA,EAAwC;AAC/D,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAI,SA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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-MMSVM3QS.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 available-unit (unoccupied) count 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"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// ../../../../../Users/bosummers/conductor/workspaces/bowlos/budapest/packages/shared/src/inquiry.ts
|
|
2
2
|
var INQUIRY_FORMS = {
|
|
3
3
|
contact: {
|
|
4
4
|
label: "Contact",
|
|
@@ -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-SMPDCDMB.js.map
|
|
45
|
+
//# sourceMappingURL=chunk-SMPDCDMB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../Users/bosummers/conductor/workspaces/bowlos/budapest/packages/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,IAAA,EAAK;AAAA,MAC/C,EAAE,GAAA,EAAK,QAAA,EAAU,KAAA,EAAO,QAAA,EAAS;AAAA,MACjC,EAAE,GAAA,EAAK,aAAA,EAAe,KAAA,EAAO,cAAA,EAAe;AAAA,MAC5C,EAAE,GAAA,EAAK,MAAA,EAAQ,KAAA,EAAO,MAAA,EAAO;AAAA,MAC7B,EAAE,GAAA,EAAK,MAAA,EAAQ,KAAA,EAAO,MAAA,EAAO;AAAA,MAC7B,EAAE,GAAA,EAAK,OAAA,EAAS,KAAA,EAAO,OAAA;AAAQ;AACjC;AAEJ;AA+EA,eAAe,OAAA,CAAQ,QAAgB,OAAA,EAAkC;AACvE,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-SMPDCDMB.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"]}
|
|
@@ -470,5 +470,5 @@ function abandonCheckout(client, refToken) {
|
|
|
470
470
|
}
|
|
471
471
|
|
|
472
472
|
export { BOWLOS_ERROR_CODES, BowlosApiError, BowlosClient, abandonCheckout, availableUnitCount, bookingPreview, checkAvailability, createBooking, createBowlosClient, createCheckoutPaymentIntent, createEventTicketOrder, createGameCardOrder, createMembershipOrder, createMembershipSubscriptionOrder, createPackageOrder, generateIdempotencyKey, getCheckoutStatus, getEventTicketStatus, getGameCardStatus, getMembershipStatus, getPackageStatus, listAddons, listStartTimes, localStorageTokenStore, previewEventTicket, previewGameCard, previewMembership, previewMembershipSubscription, previewPackage };
|
|
473
|
-
//# sourceMappingURL=chunk-
|
|
474
|
-
//# sourceMappingURL=chunk-
|
|
473
|
+
//# sourceMappingURL=chunk-UN5E6UEZ.js.map
|
|
474
|
+
//# sourceMappingURL=chunk-UN5E6UEZ.js.map
|