@scopetickets/checkout 0.6.2 → 0.6.3

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/dist/index.js CHANGED
@@ -145,13 +145,14 @@ function CardAction({ action, tapped = false }) {
145
145
  type: "button",
146
146
  className: `scopetickets-island-button scopetickets-island-button--${action.role} scopetickets-island-button--block${action.mark === void 0 ? "" : ` scopetickets-island-button--marked-${action.mark.spacing ?? "separate"}`}${action.disabled ? " scopetickets-island-button--disabled" : ""}`,
147
147
  "aria-disabled": action.disabled === true ? true : void 0,
148
- "aria-label": alone && typeof action.label === "string" ? action.label : void 0,
149
- onClick: action.disabled === true ? void 0 : action.onPress,
148
+ "aria-busy": action.busy === true ? "true" : void 0,
149
+ "aria-label": (alone || action.busy === true) && typeof action.label === "string" ? action.label : void 0,
150
+ onClick: action.disabled === true || action.busy === true ? void 0 : action.onPress,
150
151
  ...press,
151
152
  "data-pressed": held ? "" : void 0,
152
153
  children: [
153
154
  action.mark?.side === "leading" ? mark : null,
154
- alone ? /* @__PURE__ */ jsx2("span", { className: "scopetickets-island-button__mark--alone", "aria-hidden": "true", children: action.mark?.node }) : action.label,
155
+ action.busy === true ? /* @__PURE__ */ jsx2("span", { className: "scopetickets-island-spinner", "aria-hidden": "true" }) : alone ? /* @__PURE__ */ jsx2("span", { className: "scopetickets-island-button__mark--alone", "aria-hidden": "true", children: action.mark?.node }) : action.label,
155
156
  action.mark?.side === "trailing" ? mark : null
156
157
  ]
157
158
  }
@@ -1700,6 +1701,9 @@ var FUNNEL_COPY = {
1700
1701
  refused: "That email and password did not match. Please try again.",
1701
1702
  working: "Checking your details\u2026"
1702
1703
  };
1704
+ var FREE_ORDER_COPY = {
1705
+ processing: { title: "Booking", subtitle: "This may take a moment." }
1706
+ };
1703
1707
  var PROMO_COPY = {
1704
1708
  /** The trailing half of the commit pill. */
1705
1709
  open: "Promo Code",
@@ -1708,6 +1712,10 @@ var PROMO_COPY = {
1708
1712
  field: "Promo Code",
1709
1713
  apply: "Apply",
1710
1714
  remove: "Remove",
1715
+ /** Once a code is on the order: back to Review, where the price it took off is paid. */
1716
+ continue: "Continue",
1717
+ /** The card's own way out — the header draws none on this card. */
1718
+ back: "Back",
1711
1719
  /** What the card says once a code is on the order. `saved` is already written money. */
1712
1720
  saved: (saved) => `${saved} Saved`,
1713
1721
  /** The mark on an accepted field, for anyone who cannot see it. */
@@ -1776,6 +1784,7 @@ var JOURNEY_COPY = {
1776
1784
  };
1777
1785
  var PASSKEY_BUTTON_LABEL = "Add Passkey";
1778
1786
  var COMPOSE_FUNNEL_LABEL = "Your ticket selection";
1787
+ var HOLDING_TICKETS = "Holding your tickets\u2026";
1779
1788
  var POWERED_BY = [
1780
1789
  { kind: "TEXT", text: "Powered by" },
1781
1790
  { kind: "MARK", mark: "SCOPE_TICKETS_WORDMARK" }
@@ -3403,7 +3412,7 @@ function FunnelStep({
3403
3412
 
3404
3413
  // src/island/IslandCommitPill.tsx
3405
3414
  import { ShoppingCartIcon } from "@scopetickets/icons";
3406
- import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
3415
+ import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
3407
3416
  function IslandCommitPill({
3408
3417
  onOpenCart,
3409
3418
  cartLabel,
@@ -3424,17 +3433,19 @@ function IslandCommitPill({
3424
3433
  children: /* @__PURE__ */ jsx11("span", { className: "scopetickets-island-glyph-slot", "aria-hidden": "true", children: /* @__PURE__ */ jsx11(ShoppingCartIcon, { fill: true, color: "currentColor" }) })
3425
3434
  }
3426
3435
  ),
3427
- /* @__PURE__ */ jsx11("span", { className: "scopetickets-island-commit__rule", "aria-hidden": "true" }),
3428
- /* @__PURE__ */ jsx11(
3429
- "button",
3430
- {
3431
- type: "button",
3432
- className: "scopetickets-island-commit__target scopetickets-island-commit__promo",
3433
- onClick: onOpenPromo,
3434
- ...promoPress,
3435
- children: promoLabel
3436
- }
3437
- )
3436
+ promoLabel === void 0 ? null : /* @__PURE__ */ jsxs7(Fragment2, { children: [
3437
+ /* @__PURE__ */ jsx11("span", { className: "scopetickets-island-commit__rule", "aria-hidden": "true" }),
3438
+ /* @__PURE__ */ jsx11(
3439
+ "button",
3440
+ {
3441
+ type: "button",
3442
+ className: "scopetickets-island-commit__target scopetickets-island-commit__promo",
3443
+ onClick: onOpenPromo,
3444
+ ...promoPress,
3445
+ children: promoLabel
3446
+ }
3447
+ )
3448
+ ] })
3438
3449
  ] });
3439
3450
  }
3440
3451
 
@@ -3453,6 +3464,9 @@ function toQuote(cart, currency) {
3453
3464
  if (currency === void 0) return void 0;
3454
3465
  return { kind: "TOTAL", minorUnits: cart.TotalAmount, currency };
3455
3466
  }
3467
+ function nothingToPay(cart, itemCount) {
3468
+ return cart !== null && itemCount > 0 && cart.TotalAmount <= 0;
3469
+ }
3456
3470
  var ESCROW_WINDOW_SECONDS = 5 * 60;
3457
3471
  function withExpiry(cart, heldFrom) {
3458
3472
  return {
@@ -3596,7 +3610,8 @@ var IDLE_ORDER = {
3596
3610
  answers: { status: "IDLE" },
3597
3611
  answersLanded: null,
3598
3612
  eventQuestions: { status: "IDLE" },
3599
- promo: { status: "IDLE" }
3613
+ promo: { status: "IDLE" },
3614
+ acceptedPromo: null
3600
3615
  };
3601
3616
  var NOTHING = [];
3602
3617
  var UNEXPLAINED_FAILURE = "Your payment could not be completed.";
@@ -3664,6 +3679,7 @@ var EMPTIED = {
3664
3679
  eventQuestions: { status: "IDLE" },
3665
3680
  answers: { status: "IDLE" },
3666
3681
  promo: { status: "IDLE" },
3682
+ acceptedPromo: null,
3667
3683
  sheet: { status: "IDLE" },
3668
3684
  completedPreviously: false
3669
3685
  };
@@ -3731,7 +3747,9 @@ function reduceOrder(state, event) {
3731
3747
  reservation,
3732
3748
  /* The old cart is gone from here the moment we ask for another. */
3733
3749
  ...giveBack ? EMPTIED : {},
3734
- opening: { kind: "ASKING", mark: event.mark, ask: event.ask }
3750
+ opening: { kind: "ASKING", mark: event.mark, ask: event.ask },
3751
+ /* Unknown from this press, so nothing reads the wait as a run that asks nothing. */
3752
+ ...event.adopt ? {} : { eventQuestions: { status: "LOADING" } }
3735
3753
  },
3736
3754
  effects: [
3737
3755
  ...giveBack && state.cart !== null ? [
@@ -3795,6 +3813,8 @@ function reduceOrder(state, event) {
3795
3813
  state: {
3796
3814
  ...state,
3797
3815
  opening: state.opening === null ? null : { ...state.opening, kind: "REFUSED" },
3816
+ /* No cart, so no questions to wait on: the refusal is the whole of the card. */
3817
+ eventQuestions: { status: "IDLE" },
3798
3818
  fill: event.fill
3799
3819
  },
3800
3820
  effects: NOTHING
@@ -3815,6 +3835,18 @@ function reduceOrder(state, event) {
3815
3835
  effects: [{ kind: "READ_QUESTIONS", reservation: state.reservation, cart: state.cart }]
3816
3836
  };
3817
3837
  }
3838
+ /*
3839
+ * ONLY WHILE THE CART IS STILL COMING — once it lands, it carried this same read. A failure
3840
+ * waits for it too: Try Again reads against the cart, so a notice raised before there was
3841
+ * one would offer a button that could do nothing.
3842
+ */
3843
+ case "QUESTIONS_AHEAD_OF_CART": {
3844
+ if (!isCurrent(state.reservation, event.reservation)) return { state, effects: NOTHING };
3845
+ if (state.opening?.kind !== "ASKING" || event.load.status === "FAILED") {
3846
+ return { state, effects: NOTHING };
3847
+ }
3848
+ return { state: { ...state, eventQuestions: event.load }, effects: NOTHING };
3849
+ }
3818
3850
  case "QUESTIONS_READ": {
3819
3851
  if (!isCurrent(state.reservation, event.reservation)) return { state, effects: NOTHING };
3820
3852
  if (state.cart?.Key !== event.cartKey) return { state, effects: NOTHING };
@@ -3866,6 +3898,22 @@ function reduceOrder(state, event) {
3866
3898
  }
3867
3899
  case "CHARGE_ATTEMPTED":
3868
3900
  return arm(state, "CHARGED", event.finalizes === true, void 0, event.method);
3901
+ /*
3902
+ * A FREE ORDER IS CONVERTED, NOT WATCHED. There is no payment for a status poll to
3903
+ * follow — the platform answers `409 InvalidPayment` for the status of a zero cart — so
3904
+ * this goes straight to `landed`, whose `FINALIZE` is the same `FromCart` a paid order
3905
+ * ends on, with the same retry and the same `PROVIDER_SETTLED` at the end.
3906
+ *
3907
+ * THE GUARD IS THE REDUCER'S, NOT THE CALLER'S: a cart with money on it must never be
3908
+ * converted by this road, whatever pressed it. Nor twice — a second press while one is
3909
+ * finalizing, or after the order is placed, is nothing.
3910
+ */
3911
+ case "NOTHING_TO_PAY":
3912
+ if (!nothingToPay(state.cart, state.items.length)) return { state, effects: NOTHING };
3913
+ if (state.watch.kind === "FINALIZING" || moneyMoved(state.payment)) {
3914
+ return { state, effects: NOTHING };
3915
+ }
3916
+ return landed(state, true);
3869
3917
  case "SHEET_OPENING":
3870
3918
  return {
3871
3919
  state: {
@@ -3977,7 +4025,8 @@ function reduceOrder(state, event) {
3977
4025
  ...event.cart,
3978
4026
  ExpirationTime: state.cart?.ExpirationTime ?? event.cart.ExpirationTime
3979
4027
  },
3980
- promo: { status: "IDLE" }
4028
+ promo: { status: "IDLE" },
4029
+ acceptedPromo: event.code === void 0 ? state.acceptedPromo : event.code
3981
4030
  },
3982
4031
  effects: NOTHING
3983
4032
  };
@@ -4158,9 +4207,9 @@ function mergeQuestions(eventQuestions, ticketQuestions) {
4158
4207
  return merged;
4159
4208
  }
4160
4209
  function questionsInHand(ticketQuestions, load, hasCart) {
4161
- if (!hasCart) return { status: "READY", questions: guardQuestions(ticketQuestions) };
4162
4210
  switch (load.status) {
4163
4211
  case "IDLE":
4212
+ return hasCart ? { status: "PENDING" } : { status: "READY", questions: guardQuestions(ticketQuestions) };
4164
4213
  case "LOADING":
4165
4214
  return { status: "PENDING" };
4166
4215
  case "LOADED":
@@ -4193,8 +4242,24 @@ function questionPages(questions, host) {
4193
4242
  (question) => !questionAnswered(questionKind(question), host[String(question.QuestionId)])
4194
4243
  );
4195
4244
  }
4196
- function questionOnPage(pages, at) {
4197
- return pages.find((question) => question.QuestionId === at) ?? pages[0] ?? null;
4245
+ function questionCards(questions, host, grouping = "question") {
4246
+ const pages = questionPages(questions, host);
4247
+ switch (grouping) {
4248
+ case "question":
4249
+ return pages.map((question) => [question]);
4250
+ case "all":
4251
+ return pages.length === 0 ? [] : [pages];
4252
+ default: {
4253
+ const exhaustive = grouping;
4254
+ return exhaustive;
4255
+ }
4256
+ }
4257
+ }
4258
+ function questionCardIds(cards) {
4259
+ return cards.flatMap((card2) => card2.slice(0, 1).map((question) => question.QuestionId));
4260
+ }
4261
+ function questionCardOnPage(cards, at) {
4262
+ return cards.find((card2) => card2[0]?.QuestionId === at) ?? cards[0] ?? [];
4198
4263
  }
4199
4264
 
4200
4265
  // ../checkout-core/src/machine/save-for-charge.ts
@@ -6320,7 +6385,7 @@ function param(value) {
6320
6385
  }
6321
6386
 
6322
6387
  // src/version.ts
6323
- var CHECKOUT_VERSION = "0.6.2";
6388
+ var CHECKOUT_VERSION = "0.6.3";
6324
6389
 
6325
6390
  // src/data/useCheckoutEvents.ts
6326
6391
  function useCheckoutEvents(observed, { applicationKey, inventories, onEvent, logger = browserLogger }) {
@@ -7492,7 +7557,15 @@ function createOrderStore(parts, seed = IDLE_ORDER) {
7492
7557
  case "OPEN_CART": {
7493
7558
  const { reservation, mark, ask } = effect;
7494
7559
  const asked = intentHeadcount(ask.composition);
7495
- loading(parts.gateway.open(mark, ask), reservation, asked);
7560
+ loading(
7561
+ parts.gateway.open(
7562
+ mark,
7563
+ ask,
7564
+ (load) => dispatch({ kind: "QUESTIONS_AHEAD_OF_CART", reservation, load })
7565
+ ),
7566
+ reservation,
7567
+ asked
7568
+ );
7496
7569
  return;
7497
7570
  }
7498
7571
  case "READ_CART": {
@@ -7633,7 +7706,7 @@ function createOrderStore(parts, seed = IDLE_ORDER) {
7633
7706
  });
7634
7707
  return refusal === null;
7635
7708
  };
7636
- const writePromo = async (write) => {
7709
+ const writePromo = async (write, code) => {
7637
7710
  const taken = state.reservation;
7638
7711
  const cartKey = state.cart?.Key;
7639
7712
  if (cartKey === void 0) return false;
@@ -7644,12 +7717,34 @@ function createOrderStore(parts, seed = IDLE_ORDER) {
7644
7717
  return false;
7645
7718
  }
7646
7719
  if (!written.ok) {
7720
+ const reread = await rereadAfterRefusal(cartKey);
7721
+ if (!stillOurs(taken)) {
7722
+ dispatch({ kind: "PROMO_SETTLED" });
7723
+ return false;
7724
+ }
7725
+ if (reread !== null) {
7726
+ dispatch({ kind: "PROMO_WRITTEN", cart: reread, code });
7727
+ return true;
7728
+ }
7647
7729
  dispatch({ kind: "PROMO_REFUSED", reason: written.reason });
7648
7730
  return false;
7649
7731
  }
7650
- dispatch({ kind: "PROMO_WRITTEN", cart: written.cart });
7732
+ dispatch({ kind: "PROMO_WRITTEN", cart: written.cart, code });
7651
7733
  return true;
7652
7734
  };
7735
+ const rereadAfterRefusal = async (cartKey) => {
7736
+ const before = state.cart;
7737
+ if (before === null) return null;
7738
+ try {
7739
+ const load = await parts.gateway.adopt(cartKey);
7740
+ if (!load.ok) return null;
7741
+ const after2 = load.opening.cart;
7742
+ const moved = after2.TotalAmount !== before.TotalAmount || (after2.PromoCode ?? null) !== (before.PromoCode ?? null);
7743
+ return moved ? after2 : null;
7744
+ } catch {
7745
+ return null;
7746
+ }
7747
+ };
7653
7748
  const charge = async (method, email) => {
7654
7749
  const taken = state.reservation;
7655
7750
  const cartKey = state.cart?.Key;
@@ -7784,13 +7879,13 @@ function createOrderStore(parts, seed = IDLE_ORDER) {
7784
7879
  if (state.cart === null) return false;
7785
7880
  const typed = code.trim();
7786
7881
  try {
7787
- return await writePromo((cartKey) => parts.gateway.writePromo(cartKey, typed));
7882
+ return await writePromo((cartKey) => parts.gateway.writePromo(cartKey, typed), typed);
7788
7883
  } catch (cause) {
7789
7884
  dispatch({ kind: "PROMO_SETTLED" });
7790
7885
  throw cause;
7791
7886
  }
7792
7887
  },
7793
- removePromo: () => writePromo((cartKey) => parts.gateway.clearPromo(cartKey)),
7888
+ removePromo: () => writePromo((cartKey) => parts.gateway.clearPromo(cartKey), null),
7794
7889
  /*
7795
7890
  * Not a kill switch: a host in StrictMode mounts, unmounts and mounts again over the
7796
7891
  * same store, and a permanently dead one would never open a cart. Answers still in
@@ -8336,8 +8431,13 @@ function promoSaved(cart, currency) {
8336
8431
  if (typeof saved !== "number" || !Number.isFinite(saved) || saved <= 0) return null;
8337
8432
  return formatMoney(saved, currency);
8338
8433
  }
8339
- function promoApplied(cart) {
8340
- return cart === null ? null : bounded(cart.PromoCode, WIRE_LIMITS.promoCode);
8434
+ function promoApplied(cart, accepted = null) {
8435
+ if (cart === null) return null;
8436
+ const named = bounded(cart.PromoCode, WIRE_LIMITS.promoCode);
8437
+ if (named !== null) return named;
8438
+ const saved = cart.PromoSavingAmount;
8439
+ if (typeof saved !== "number" || !Number.isFinite(saved) || saved <= 0) return null;
8440
+ return bounded(accepted, WIRE_LIMITS.promoCode);
8341
8441
  }
8342
8442
  var PROMO_REFUSED = "That code cannot be used on this order.";
8343
8443
  function promoRefusal(reason, fallback) {
@@ -8375,11 +8475,13 @@ async function writtenAnyway(client, cartKey) {
8375
8475
  }
8376
8476
  function orderGateway(client, clock) {
8377
8477
  return {
8378
- async open(mark, ask) {
8478
+ async open(mark, ask, questionsAhead) {
8379
8479
  let asking = `opening a cart on '${mark}'`;
8380
8480
  try {
8381
8481
  const at = clock.now();
8382
8482
  const cart = withExpiry(await client.createCart(mark), at);
8483
+ const questions = readQuestions(client, cart);
8484
+ if (questionsAhead !== void 0) void questions.then(questionsAhead);
8383
8485
  asking = `reading the tickets on '${mark}'`;
8384
8486
  const tickets = await readDayTickets(client, mark, ask.inventories, {
8385
8487
  timeslots: true,
@@ -8392,11 +8494,11 @@ function orderGateway(client, clock) {
8392
8494
  throw new Error(
8393
8495
  `no product on '${mark}' sells the ${session.LocalStartTime}\u2013${session.LocalEndTime} session the buyer was offered`
8394
8496
  );
8395
- return empty(client, cart, at, void 0, void 0);
8497
+ return empty(cart, at, void 0, void 0, questions);
8396
8498
  }
8397
8499
  const money = product.Currency ?? void 0;
8398
8500
  const requested = itemsFor({ composition: ask.composition, timeslot: session }, product);
8399
- if (requested.length === 0) return empty(client, cart, at, money, product.Name);
8501
+ if (requested.length === 0) return empty(cart, at, money, product.Name, questions);
8400
8502
  const sold = sessionOn(product, session);
8401
8503
  asking = `filling cart '${cart.Key}' on '${mark}' with ${requested.length} \xD7 '${product.Key}' (Available: ${product.Available})` + (session === void 0 ? "" : ` at ${session.LocalStartTime}\u2013${session.LocalEndTime}`) + (sold === void 0 ? "" : ` (session Total: ${sold.Total}, Remaining: ${sold.Remaining})`);
8402
8504
  const filled = await client.addItemsBulk(cart.Key, requested, { allowPartial: true });
@@ -8417,7 +8519,7 @@ function orderGateway(client, clock) {
8417
8519
  /* The product it was filled WITH — the cart's items do not reliably name it. */
8418
8520
  productName: product.Name,
8419
8521
  heldFrom: at,
8420
- eventQuestions: await readQuestions(client, filled.Cart)
8522
+ eventQuestions: await questions
8421
8523
  }
8422
8524
  };
8423
8525
  } catch (cause) {
@@ -8544,7 +8646,7 @@ async function promoWrite(write) {
8544
8646
  function said4(cause) {
8545
8647
  return cause instanceof Error ? cause.message : String(cause);
8546
8648
  }
8547
- async function empty(client, cart, heldFrom, currency, productName) {
8649
+ async function empty(cart, heldFrom, currency, productName, questions) {
8548
8650
  return {
8549
8651
  ok: true,
8550
8652
  opening: {
@@ -8554,7 +8656,7 @@ async function empty(client, cart, heldFrom, currency, productName) {
8554
8656
  currency,
8555
8657
  productName,
8556
8658
  heldFrom,
8557
- eventQuestions: await readQuestions(client, cart)
8659
+ eventQuestions: await questions
8558
8660
  }
8559
8661
  };
8560
8662
  }
@@ -9133,13 +9235,11 @@ function commitBlocks(id, facts) {
9133
9235
  }
9134
9236
  /*
9135
9237
  * THE EVENT'S OWN QUESTIONS, which come from the tickets and the event's questionnaire
9136
- * and arrive with the cart — so they are in hand by the time this card is asked. One
9137
- * per card: the card is the question the flow stands on.
9238
+ * and arrive with the cart — so they are in hand by the time this card is asked. As
9239
+ * many per card as `questionGrouping` deals it, and the card is the one the flow stands on.
9138
9240
  */
9139
- case "DETAILS": {
9140
- const page = pageOf(facts);
9141
- return page === null ? [] : chainFields([questionBlock(page, facts)]);
9142
- }
9241
+ case "DETAILS":
9242
+ return chainFields(cardOf(facts).map((question) => questionBlock(question, facts)));
9143
9243
  case "PROMO":
9144
9244
  return [promoBlock(facts.collected.promoCode, facts.promo)];
9145
9245
  default:
@@ -9196,15 +9296,14 @@ function commitAnswered(id, facts) {
9196
9296
  case "PHONE":
9197
9297
  return e164(collected.phone.dialCode, collected.phone.national) !== null;
9198
9298
  /*
9199
- * THE QUESTION ON THIS CARD, and not the rest: each has a card of its own, and a gate
9299
+ * THE QUESTIONS ON THIS CARD, and not the rest: where each has a card of its own, a gate
9200
9300
  * over all of them would hold the first card shut until the last was answered. Not
9201
9301
  * answered while the questions are still on their way — see `questions`.
9202
9302
  */
9203
- case "DETAILS": {
9204
- if (facts.questions.status !== "READY") return false;
9205
- const page = pageOf(facts);
9206
- return page === null || questionAnswered(questionKind(page), collected.answers[String(page.QuestionId)]);
9207
- }
9303
+ case "DETAILS":
9304
+ return facts.questions.status === "READY" && cardOf(facts).every(
9305
+ (question) => questionAnswered(questionKind(question), collected.answers[String(question.QuestionId)])
9306
+ );
9208
9307
  /*
9209
9308
  * THE CARD FORM OPENS ON NO METHOD, so its Confirm waits for the tap that picks one: a
9210
9309
  * row mounts the form beneath it, and a step confirmed without one would be a buyer
@@ -9228,8 +9327,11 @@ function commitAnswered(id, facts) {
9228
9327
  return true;
9229
9328
  }
9230
9329
  }
9231
- function pageOf(facts) {
9232
- return questionOnPage(questionPages(facts.questions, facts.hostAnswers), facts.question);
9330
+ function cardOf(facts) {
9331
+ return questionCardOnPage(
9332
+ questionCards(facts.questions, facts.hostAnswers, facts.questionGrouping),
9333
+ facts.question
9334
+ );
9233
9335
  }
9234
9336
  function questionBlock(question, facts) {
9235
9337
  const id = String(question.QuestionId);
@@ -9563,6 +9665,7 @@ function useCheckoutOrder(store, request, currency, open, adopt, userTypeNames2
9563
9665
  (method) => store?.dispatch({ kind: "CHARGE_ATTEMPTED", method }),
9564
9666
  [store]
9565
9667
  );
9668
+ const bookFree = useCallback11(() => store?.dispatch({ kind: "NOTHING_TO_PAY" }), [store]);
9566
9669
  const restart = useCallback11(() => store?.dispatch({ kind: "RESTARTED" }), [store]);
9567
9670
  const retryEventQuestions = useCallback11(
9568
9671
  () => store?.dispatch({ kind: "QUESTIONS_WANTED_AGAIN" }),
@@ -9582,6 +9685,7 @@ function useCheckoutOrder(store, request, currency, open, adopt, userTypeNames2
9582
9685
  answers: state.answers,
9583
9686
  saveAnswers,
9584
9687
  promo: state.promo,
9688
+ acceptedPromo: state.acceptedPromo,
9585
9689
  applyPromo,
9586
9690
  removePromo,
9587
9691
  settledFromFrame,
@@ -9589,6 +9693,7 @@ function useCheckoutOrder(store, request, currency, open, adopt, userTypeNames2
9589
9693
  paidWithoutFinalizing,
9590
9694
  retryPayment,
9591
9695
  chargeAttempted,
9696
+ bookFree,
9592
9697
  restart,
9593
9698
  eventQuestions: state.eventQuestions,
9594
9699
  retryEventQuestions
@@ -9663,11 +9768,11 @@ function Amount({ parts }) {
9663
9768
  }
9664
9769
 
9665
9770
  // src/island/IslandBlocks.tsx
9666
- import { Fragment as Fragment7, useCallback as useCallback13 } from "react";
9771
+ import { Fragment as Fragment8, useCallback as useCallback13 } from "react";
9667
9772
 
9668
9773
  // src/island/TextField.tsx
9669
9774
  import { useEffect as useEffect14, useId, useLayoutEffect as useLayoutEffect3, useRef as useRef9, useState as useState4 } from "react";
9670
- import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
9775
+ import { Fragment as Fragment3, jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
9671
9776
  function TextField({
9672
9777
  label,
9673
9778
  value,
@@ -9723,7 +9828,7 @@ function TextField({
9723
9828
  }
9724
9829
  node.setSelectionRange(at, at);
9725
9830
  });
9726
- const body = /* @__PURE__ */ jsxs9(Fragment2, { children: [
9831
+ const body = /* @__PURE__ */ jsxs9(Fragment3, { children: [
9727
9832
  /* @__PURE__ */ jsx13("span", { className: "scopetickets-island-field__label", children: label }),
9728
9833
  /* @__PURE__ */ jsx13("span", { className: "scopetickets-island-field__clip", children: /* @__PURE__ */ jsxs9("span", { className: "scopetickets-island-field__row", children: [
9729
9834
  icon === void 0 ? null : /* @__PURE__ */ jsx13("span", { className: "scopetickets-island-field__icon", children: icon }),
@@ -10444,7 +10549,7 @@ function passkeyButtonTheme(read2) {
10444
10549
 
10445
10550
  // src/island/PasskeyFrame.tsx
10446
10551
  import { useCallback as useCallback12, useEffect as useEffect17, useMemo as useMemo11, useRef as useRef11, useState as useState7 } from "react";
10447
- import { Fragment as Fragment3, jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
10552
+ import { Fragment as Fragment4, jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
10448
10553
  var POPUP_FEATURES = "popup,width=480,height=340";
10449
10554
  var CLOSED_POLL_MS = 400;
10450
10555
  var BLOCKED_NOTE = "Allow pop-ups for this site to finish setting up your passkey.";
@@ -10558,7 +10663,7 @@ function PasskeyFrame({
10558
10663
  [stopPolling]
10559
10664
  );
10560
10665
  if (windowMode) {
10561
- return /* @__PURE__ */ jsxs16(Fragment3, { children: [
10666
+ return /* @__PURE__ */ jsxs16(Fragment4, { children: [
10562
10667
  ceremony === null ? null : /* @__PURE__ */ jsx22(
10563
10668
  "button",
10564
10669
  {
@@ -10927,7 +11032,7 @@ function CountdownTimer({
10927
11032
  }
10928
11033
 
10929
11034
  // src/island/hold-clock.tsx
10930
- import { Fragment as Fragment4, jsx as jsx27 } from "react/jsx-runtime";
11035
+ import { Fragment as Fragment5, jsx as jsx27 } from "react/jsx-runtime";
10931
11036
  function useNow() {
10932
11037
  const [now, setNow] = useState9(browserClock.now);
10933
11038
  useEffect18(() => browserClock.every(HOLD_TICK_MS, () => setNow(browserClock.now())), []);
@@ -10946,7 +11051,7 @@ function HoldRing({ hold: hold2, label }) {
10946
11051
  );
10947
11052
  }
10948
11053
  function HoldClockText({ hold: hold2 }) {
10949
- return /* @__PURE__ */ jsx27(Fragment4, { children: holdClockText(hold2, useNow()) });
11054
+ return /* @__PURE__ */ jsx27(Fragment5, { children: holdClockText(hold2, useNow()) });
10950
11055
  }
10951
11056
  function useAssertedHold(hold2) {
10952
11057
  const [stamp, setStamp] = useState9(null);
@@ -10972,7 +11077,7 @@ function useAssertedHold(hold2) {
10972
11077
  }
10973
11078
 
10974
11079
  // src/island/marks.tsx
10975
- import { Fragment as Fragment5, jsx as jsx28 } from "react/jsx-runtime";
11080
+ import { Fragment as Fragment6, jsx as jsx28 } from "react/jsx-runtime";
10976
11081
  var GLYPHS = {
10977
11082
  ASTERISK: AsteriskIcon,
10978
11083
  BELL: BellIcon,
@@ -11049,11 +11154,11 @@ function creditNode(text) {
11049
11154
  }
11050
11155
  }
11051
11156
  });
11052
- return text.some((part) => part.kind === "MARK") ? /* @__PURE__ */ jsx28("span", { className: "scopetickets-island-credit", children: parts }) : /* @__PURE__ */ jsx28(Fragment5, { children: parts });
11157
+ return text.some((part) => part.kind === "MARK") ? /* @__PURE__ */ jsx28("span", { className: "scopetickets-island-credit", children: parts }) : /* @__PURE__ */ jsx28(Fragment6, { children: parts });
11053
11158
  }
11054
11159
 
11055
11160
  // src/island/Prose.tsx
11056
- import { Fragment as Fragment6, jsx as jsx29 } from "react/jsx-runtime";
11161
+ import { Fragment as Fragment7, jsx as jsx29 } from "react/jsx-runtime";
11057
11162
  function Prose({ blocks, className }) {
11058
11163
  return /* @__PURE__ */ jsx29("span", { className: ["scopetickets-island-prose", className].filter(Boolean).join(" "), children: blocks.map((block, index) => {
11059
11164
  switch (block.kind) {
@@ -11071,7 +11176,7 @@ function Prose({ blocks, className }) {
11071
11176
  }) });
11072
11177
  }
11073
11178
  function Inlines({ inlines }) {
11074
- return /* @__PURE__ */ jsx29(Fragment6, { children: inlines.map((inline, index) => {
11179
+ return /* @__PURE__ */ jsx29(Fragment7, { children: inlines.map((inline, index) => {
11075
11180
  switch (inline.kind) {
11076
11181
  case "LINK":
11077
11182
  return /* @__PURE__ */ jsx29("a", { href: inline.href, target: "_blank", rel: "noopener noreferrer", children: inline.text }, index);
@@ -11088,7 +11193,7 @@ function Inlines({ inlines }) {
11088
11193
  }
11089
11194
 
11090
11195
  // src/island/IslandBlocks.tsx
11091
- import { Fragment as Fragment8, jsx as jsx30, jsxs as jsxs19 } from "react/jsx-runtime";
11196
+ import { Fragment as Fragment9, jsx as jsx30, jsxs as jsxs19 } from "react/jsx-runtime";
11092
11197
  function IslandBlocks({ blocks, onIntent, passkey, upload }) {
11093
11198
  const drawn = [];
11094
11199
  let fields = [];
@@ -11096,7 +11201,7 @@ function IslandBlocks({ blocks, onIntent, passkey, upload }) {
11096
11201
  const close = () => {
11097
11202
  if (fields.length === 0) return;
11098
11203
  drawn.push(
11099
- /* @__PURE__ */ jsxs19(Fragment7, { children: [
11204
+ /* @__PURE__ */ jsxs19(Fragment8, { children: [
11100
11205
  /* @__PURE__ */ jsx30(StepForm, { children: fields }),
11101
11206
  after2
11102
11207
  ] }, `fields-${drawn.length}`)
@@ -11114,11 +11219,11 @@ function IslandBlocks({ blocks, onIntent, passkey, upload }) {
11114
11219
  }
11115
11220
  close();
11116
11221
  drawn.push(
11117
- /* @__PURE__ */ jsx30(Fragment7, { children: drawBlock(block, { onIntent, passkey, upload }) }, blockKey(block, index))
11222
+ /* @__PURE__ */ jsx30(Fragment8, { children: drawBlock(block, { onIntent, passkey, upload }) }, blockKey(block, index))
11118
11223
  );
11119
11224
  });
11120
11225
  close();
11121
- return /* @__PURE__ */ jsx30(Fragment8, { children: drawn });
11226
+ return /* @__PURE__ */ jsx30(Fragment9, { children: drawn });
11122
11227
  }
11123
11228
  function drawBlock(block, { onIntent, passkey, upload }) {
11124
11229
  switch (block.kind) {
@@ -11347,7 +11452,7 @@ function FieldBlock({ block, onIntent }) {
11347
11452
  ...enterProps(block.enter)
11348
11453
  }
11349
11454
  );
11350
- return block.prose === void 0 ? field : /* @__PURE__ */ jsxs19(Fragment8, { children: [
11455
+ return block.prose === void 0 ? field : /* @__PURE__ */ jsxs19(Fragment9, { children: [
11351
11456
  /* @__PURE__ */ jsx30(Prose, { blocks: block.prose, className: "scopetickets-island-card__question" }),
11352
11457
  field
11353
11458
  ] });
@@ -11543,6 +11648,12 @@ var STEP_ACCESSORY = Object.fromEntries(
11543
11648
  Object.entries(STEP_BADGES).map(([step2, badge]) => [step2, { ...badge, id: `step:${step2}` }])
11544
11649
  );
11545
11650
  var UNCLOSABLE_STEPS = /* @__PURE__ */ new Set([
11651
+ /*
11652
+ * NOT FOR THE MONEY, unlike the rest: the promo card's way out is its own Back button
11653
+ * (or Continue, once a code is on), so the header's would be a second one. Conall,
11654
+ * 2026-11-12.
11655
+ */
11656
+ "PROMO",
11546
11657
  "PROCESSING",
11547
11658
  "PAYMENT_SUCCESS",
11548
11659
  "FEEDBACK",
@@ -11605,7 +11716,7 @@ function stepBadge(stepId, facts) {
11605
11716
  }
11606
11717
 
11607
11718
  // src/island/step-cards.tsx
11608
- import { Fragment as Fragment9, jsx as jsx31 } from "react/jsx-runtime";
11719
+ import { Fragment as Fragment10, jsx as jsx31 } from "react/jsx-runtime";
11609
11720
  var STEP_STATUS_GLYPH = {};
11610
11721
  function toneColours(tone) {
11611
11722
  const vars = statusToneVars(tone);
@@ -11690,7 +11801,7 @@ function funnelViewProps(view, onIntent) {
11690
11801
  title: typeof view.title === "string" ? view.title : creditNode(view.title),
11691
11802
  subtitle: typeof view.subtitle === "string" ? view.subtitle : creditNode(view.subtitle),
11692
11803
  actionLabel: AUTH_COPY.SIGN_IN,
11693
- input: /* @__PURE__ */ jsx31(Fragment9, { children: view.blocks.map(
11804
+ input: /* @__PURE__ */ jsx31(Fragment10, { children: view.blocks.map(
11694
11805
  (block) => block.kind === "CREDENTIALS" ? /* @__PURE__ */ jsx31(CredentialsBlock, { block, onIntent }, "credentials") : null
11695
11806
  ) }),
11696
11807
  actions: view.actions.map((action) => ({
@@ -12154,10 +12265,13 @@ var SHEET_PRESS = {
12154
12265
  },
12155
12266
  card: { role: payButtonRole("CARD"), pays: true, picks: "card", label: "Pay with Card" }
12156
12267
  };
12268
+ var FREE_PRESS = { role: "primary", pays: true, label: "Book Now" };
12157
12269
  function reviewActions(reach) {
12158
12270
  switch (reach.entry) {
12159
12271
  case "BAY":
12160
12272
  return STEP_CARD_ACTIONS.REVIEW;
12273
+ case "FREE":
12274
+ return [FREE_PRESS];
12161
12275
  case "SHEET":
12162
12276
  return reach.methods.map((method) => SHEET_PRESS[method]);
12163
12277
  default: {
@@ -12582,7 +12696,12 @@ function trailingSlot(id, facts) {
12582
12696
  return {
12583
12697
  kind: "ORDER",
12584
12698
  cartLabel: CART_VIEW.label(facts.summary.total),
12585
- ...facts.can.redeemPromo ? { promoLabel: PROMO_COPY.open } : {}
12699
+ /*
12700
+ * THE PROMO HALF ON THE PAY SCREEN ONLY — Conall, 2026-11-12. A code is a question
12701
+ * about the price, and Review is where the price is paid; offered earlier, it opened
12702
+ * over steps that had nothing to do with it.
12703
+ */
12704
+ ...facts.can.redeemPromo && id === "REVIEW" ? { promoLabel: PROMO_COPY.open } : {}
12586
12705
  };
12587
12706
  }
12588
12707
  const stops = composeFunnel(facts.stops ?? [], facts.answers, id);
@@ -12736,6 +12855,7 @@ function stepSubtitle(facts) {
12736
12855
  if (facts.stepId === "PAYMENT_FAILED" && facts.failureReason !== null) return facts.failureReason;
12737
12856
  if (facts.stepId === "PAYMENT_SUCCESS") return paymentSuccessSubtitle(facts.buyerFirstName);
12738
12857
  if (facts.stepId === "REVIEW" || facts.stepId === "PAYMENT") {
12858
+ if (facts.orderComing === true) return HOLDING_TICKETS;
12739
12859
  return facts.holdRemaining === null ? POWERED_BY : holdSentence(facts.holdRemaining);
12740
12860
  }
12741
12861
  if (facts.stepId === "DETAILS" && facts.answersSaved) return DETAILS_SAVED_SUBTITLE;
@@ -12750,12 +12870,13 @@ function stepCardOf(facts) {
12750
12870
  const names = greeted(facts);
12751
12871
  const heading = {
12752
12872
  stepId,
12753
- copy: card2?.copy ?? STEP_CARD_COPY[stepId],
12873
+ copy: card2?.copy ?? (stepId === "PROCESSING" && facts.payment.entry === "FREE" ? FREE_ORDER_COPY.processing : STEP_CARD_COPY[stepId]),
12754
12874
  outcome: facts.outcome,
12755
12875
  failureReason: facts.failureReason,
12756
12876
  buyerFirstName: names.thanks,
12757
12877
  accountFirstName: names.welcome,
12758
12878
  holdRemaining: facts.summary.kind === "HELD" ? facts.summary.hold : null,
12879
+ orderComing: facts.orderComing === true,
12759
12880
  quoteHeadline: facts.quoteHeadline,
12760
12881
  promoSaving: facts.promoSaving,
12761
12882
  answersSaved: facts.answersSaved
@@ -12812,7 +12933,10 @@ function cardActions(facts, checkpoint) {
12812
12933
  if (stepId === "PROCESSING" && journey?.kind === "PROCESSING") {
12813
12934
  return [{ role: "secondary", label: ACTION_COPY.cancel, cancels: true }];
12814
12935
  }
12815
- const base = checkpoint ?? (stepId === "REVIEW" ? shutUnlessChargeable(reviewActions(facts.payment), facts.chargeReady !== false) : STEP_CARD_ACTIONS[stepId]);
12936
+ const base = checkpoint ?? (stepId === "REVIEW" ? shutUnlessChargeable(
12937
+ reviewActions(facts.payment),
12938
+ facts.chargeReady !== false && facts.orderComing !== true
12939
+ ) : STEP_CARD_ACTIONS[stepId]);
12816
12940
  if (pressCreatesOrder(stepId, facts.next)) {
12817
12941
  return base.map(
12818
12942
  (action) => action.role === "primary" ? { ...action, label: CREATE_ORDER_LABEL } : action
@@ -12820,7 +12944,7 @@ function cardActions(facts, checkpoint) {
12820
12944
  }
12821
12945
  switch (stepId) {
12822
12946
  case "PROMO":
12823
- return facts.promo === void 0 ? base : [promoAction(facts.promo)];
12947
+ return facts.promo === void 0 ? base : promoActions(facts.promo);
12824
12948
  /*
12825
12949
  * THE PASSKEY CARD KEEPS ONLY ITS SKIP. Its primary is the ceremony document drawn as
12826
12950
  * the card's own content — a credential can only be made by a page under the RP id —
@@ -12887,13 +13011,23 @@ function shutUnlessChargeable(actions, chargeable) {
12887
13011
  (action) => action.pays === true || action.picks !== void 0 ? { ...action, disabled: true } : action
12888
13012
  );
12889
13013
  }
12890
- function promoAction(promo) {
12891
- return promoSendable(promo.typed, promo.applied) ? { role: "primary", label: PROMO_COPY.apply, disabled: promo.saving, promo: "APPLY" } : {
12892
- role: "primary",
12893
- label: PROMO_COPY.remove,
12894
- disabled: promo.saving || promo.applied === null,
12895
- promo: "REMOVE"
12896
- };
13014
+ function promoActions(promo) {
13015
+ const applied = promo.applied;
13016
+ if (applied !== null && !promoSendable(promo.typed, applied)) {
13017
+ return [
13018
+ { role: "primary", label: PROMO_COPY.continue, disabled: promo.saving, promo: "CONTINUE" },
13019
+ { role: "secondary", label: PROMO_COPY.remove, disabled: promo.saving, promo: "REMOVE" }
13020
+ ];
13021
+ }
13022
+ return [
13023
+ {
13024
+ role: "primary",
13025
+ label: PROMO_COPY.apply,
13026
+ disabled: promo.saving || !promoSendable(promo.typed, applied),
13027
+ promo: "APPLY"
13028
+ },
13029
+ { role: "secondary", label: PROMO_COPY.back }
13030
+ ];
12897
13031
  }
12898
13032
  function pillView(facts) {
12899
13033
  const lines = facts.quote === void 0 ? null : quoteLines(facts.quote);
@@ -13068,6 +13202,12 @@ function islandStep(state, facts, stepId) {
13068
13202
  answersSaved: answersLocked(state.order.answers),
13069
13203
  payment: facts.payment,
13070
13204
  ...facts.chargeReady === void 0 ? {} : { chargeReady: facts.chargeReady },
13205
+ /*
13206
+ * READ OFF THE ORDER, SO NO RENDERER HAS TO REMEMBER IT. Review can be reached before the
13207
+ * fill lands, and a press there went on to Pay with no cart behind it and stayed there
13208
+ * when the event's questions arrived (measured 2026-11-05).
13209
+ */
13210
+ orderComing: state.order.cart === null && state.order.opening?.kind === "ASKING",
13071
13211
  detour: facts.detour,
13072
13212
  first: facts.first,
13073
13213
  next: facts.next,
@@ -13137,6 +13277,11 @@ function restingEffect(card2, id) {
13137
13277
  }
13138
13278
 
13139
13279
  // ../checkout-core/src/view/island-flow.ts
13280
+ var PROMO_EFFECT = {
13281
+ APPLY: "PROMO_APPLIED",
13282
+ REMOVE: "PROMO_REMOVED",
13283
+ CONTINUE: "PROMO_CONTINUED"
13284
+ };
13140
13285
  function openingFlow(expanded) {
13141
13286
  return {
13142
13287
  at: null,
@@ -13223,7 +13368,7 @@ function pressed(state, action, facts) {
13223
13368
  return forward(state, facts, [{ kind: "GUEST_CHOSEN" }]);
13224
13369
  }
13225
13370
  if (action.promo !== void 0) {
13226
- return still6(state, [{ kind: action.promo === "APPLY" ? "PROMO_APPLIED" : "PROMO_REMOVED" }]);
13371
+ return still6(state, [{ kind: PROMO_EFFECT[action.promo] }]);
13227
13372
  }
13228
13373
  if (action.reveals === true) {
13229
13374
  return still6({ ...state, passwordRevealed: !state.passwordRevealed });
@@ -15502,7 +15647,7 @@ function useIslandFaces(fonts = pageFonts(), families = familiesOnPage) {
15502
15647
  }
15503
15648
 
15504
15649
  // src/island/ScopeTicketsCheckout.tsx
15505
- import { Fragment as Fragment10, jsx as jsx41, jsxs as jsxs26 } from "react/jsx-runtime";
15650
+ import { Fragment as Fragment11, jsx as jsx41, jsxs as jsxs26 } from "react/jsx-runtime";
15506
15651
  var PROVIDER_BUTTON_HEIGHT = 52;
15507
15652
  var WEB_CAN = {
15508
15653
  takePayment: true,
@@ -15511,6 +15656,8 @@ var WEB_CAN = {
15511
15656
  redeemPromo: true
15512
15657
  };
15513
15658
  var WEB_PAYMENT = { entry: "BAY" };
15659
+ var CONTINUE_WAIT_MS = 3e3;
15660
+ var FREE_ORDER = { entry: "FREE" };
15514
15661
  var sendEnvelope = (url, body) => {
15515
15662
  if (typeof fetch !== "function") return;
15516
15663
  void fetch(url, { method: "POST", body, keepalive: true }).catch(() => void 0);
@@ -15596,6 +15743,7 @@ function PurchaseIsland({
15596
15743
  inventories,
15597
15744
  inventoryFilter = "checkbox",
15598
15745
  timeslotGrouping,
15746
+ questionGrouping,
15599
15747
  mode = "system",
15600
15748
  align = "bottom",
15601
15749
  placement = "page",
@@ -15856,8 +16004,8 @@ function PurchaseIsland({
15856
16004
  );
15857
16005
  const answeredByHost = useMemo16(() => hostAnswers(intent.answers), [intent.answers]);
15858
16006
  const questionIds = useMemo16(
15859
- () => questionPages(questionnaire, answeredByHost).map((question) => question.QuestionId),
15860
- [questionnaire, answeredByHost]
16007
+ () => questionCardIds(questionCards(questionnaire, answeredByHost, questionGrouping)),
16008
+ [questionnaire, answeredByHost, questionGrouping]
15861
16009
  );
15862
16010
  const answersReady = questionnaire.status === "READY" && questionsAnswered(questionnaire.questions, answersInHand);
15863
16011
  const answersSaved = answersLocked(order.answers);
@@ -16075,7 +16223,7 @@ function PurchaseIsland({
16075
16223
  () => dispatch({ kind: "DETOUR_OPENED", step: "PROMO" }),
16076
16224
  [dispatch]
16077
16225
  );
16078
- const appliedPromo = promoApplied(order.cart);
16226
+ const appliedPromo = promoApplied(order.cart, order.acceptedPromo);
16079
16227
  useEffect22(() => {
16080
16228
  setCollected((was) => ({ ...was, promoCode: appliedPromo ?? "" }));
16081
16229
  }, [appliedPromo]);
@@ -16150,6 +16298,8 @@ function PurchaseIsland({
16150
16298
  });
16151
16299
  const [reviewCartKey, setReviewCartKey] = useState15(null);
16152
16300
  const [frameHeight, setFrameHeight] = useState15(null);
16301
+ const [revolutReadyAt, setRevolutReadyAt] = useState15(null);
16302
+ const [continuing, setContinuing] = useState15(false);
16153
16303
  useEffect22(() => {
16154
16304
  if (expanded && order.cart !== null) {
16155
16305
  setReviewCartKey(order.cart.Key);
@@ -16220,7 +16370,28 @@ function PurchaseIsland({
16220
16370
  }
16221
16371
  };
16222
16372
  const cardChosen = collected.paymentMethodKey === "card";
16223
- const frameMounted = order.cart !== null && reviewCartKey === order.cart.Key;
16373
+ const free = nothingToPay(order.cart, order.items.length);
16374
+ const frameMounted = !free && order.cart !== null && reviewCartKey === order.cart.Key;
16375
+ const price2 = order.cart?.TotalAmount ?? null;
16376
+ useEffect22(() => {
16377
+ setFrameHeight(null);
16378
+ }, [price2]);
16379
+ const revolutStanding = revolutCart !== order.cart?.Key || revolutReadyAt === price2;
16380
+ const cardStanding = !cardChosen || frameHeight !== null;
16381
+ const entriesStanding = !frameMounted || cardStanding && revolutStanding;
16382
+ useEffect22(() => {
16383
+ if (!continuing) return;
16384
+ const finish = () => {
16385
+ setContinuing(false);
16386
+ dispatch({ kind: "DETOUR_CLOSED" });
16387
+ };
16388
+ if (entriesStanding) {
16389
+ finish();
16390
+ return;
16391
+ }
16392
+ const timer = window.setTimeout(finish, CONTINUE_WAIT_MS);
16393
+ return () => window.clearTimeout(timer);
16394
+ }, [continuing, entriesStanding, dispatch]);
16224
16395
  const terminalPayment = moneyMoved(reported);
16225
16396
  const {
16226
16397
  revolutActive,
@@ -16287,6 +16458,7 @@ function PurchaseIsland({
16287
16458
  useEffect22(() => {
16288
16459
  const key = order.cart?.Key;
16289
16460
  if (stepId !== "REVIEW" || key === void 0 || revolutCart === key || !answersReady) return;
16461
+ if (free) return;
16290
16462
  setRevolutCart(key);
16291
16463
  setWalletCart(key);
16292
16464
  const request = ++selectionRequest.current;
@@ -16295,10 +16467,10 @@ function PurchaseIsland({
16295
16467
  setSavedRevolutCart(key);
16296
16468
  setSavedWalletCart(key);
16297
16469
  });
16298
- }, [stepId, order.cart?.Key, revolutCart, answersReady]);
16470
+ }, [stepId, order.cart?.Key, revolutCart, answersReady, free]);
16299
16471
  const [cardStatus, setCardStatus] = useState15(null);
16300
16472
  const checkoutSessionId = useMemo16(() => crypto.randomUUID(), [order.cart?.Key]);
16301
- const payEntries = frameMounted ? /* @__PURE__ */ jsxs26(Fragment10, { children: [
16473
+ const payEntries = frameMounted ? /* @__PURE__ */ jsxs26(Fragment11, { children: [
16302
16474
  /* @__PURE__ */ jsx41("div", { className: "scopetickets-island-bay__field", hidden: !cardChosen || frameHeight === null, children: /* @__PURE__ */ jsx41(
16303
16475
  IslandPaymentFrame,
16304
16476
  {
@@ -16326,7 +16498,7 @@ function PurchaseIsland({
16326
16498
  },
16327
16499
  theme: frameTheme
16328
16500
  },
16329
- order.cart.Key
16501
+ `${order.cart.Key}:${order.cart.TotalAmount}`
16330
16502
  ) }),
16331
16503
  walletCart === order.cart.Key && /*
16332
16504
  * THE WALLET STANDS ABOVE REVOLUT PAY, which is the order the design draws and the
@@ -16369,7 +16541,7 @@ function PurchaseIsland({
16369
16541
  onSuccess: order.settledFromFrame,
16370
16542
  onError: providerFailed
16371
16543
  },
16372
- `wallet:${order.cart.Key}`
16544
+ `wallet:${order.cart.Key}:${order.cart.TotalAmount}`
16373
16545
  ) }),
16374
16546
  revolutCart === order.cart.Key && /* @__PURE__ */ jsx41(
16375
16547
  "div",
@@ -16389,7 +16561,10 @@ function PurchaseIsland({
16389
16561
  retry: revolutFrameEpoch > 0,
16390
16562
  heightOverride: journeyInline && journeyFullscreen ? "100%" : journeyRoom?.height ?? PROVIDER_BUTTON_HEIGHT,
16391
16563
  onSubmitRequested: chargingWith("revolut_pay"),
16392
- onReady: recoveryReady,
16564
+ onReady: () => {
16565
+ recoveryReady();
16566
+ setRevolutReadyAt(order.cart?.TotalAmount ?? null);
16567
+ },
16393
16568
  onHeight: recoveryReady,
16394
16569
  theme: frameTheme,
16395
16570
  onStatusChange: (status) => {
@@ -16400,7 +16575,7 @@ function PurchaseIsland({
16400
16575
  onSuccess: order.settledFromFrame,
16401
16576
  onError: providerFailed
16402
16577
  },
16403
- `revolut:${revolutFrameEpoch}:${order.cart.Key}`
16578
+ `revolut:${revolutFrameEpoch}:${order.cart.Key}:${order.cart.TotalAmount}`
16404
16579
  )
16405
16580
  }
16406
16581
  )
@@ -16439,7 +16614,7 @@ function PurchaseIsland({
16439
16614
  collected,
16440
16615
  lines: cartLines2
16441
16616
  }) : null,
16442
- payment: WEB_PAYMENT,
16617
+ payment: free ? FREE_ORDER : WEB_PAYMENT,
16443
16618
  orderFirstName: orderedBuyer.firstName ?? null,
16444
16619
  next: walk.stops[index + 1]?.step,
16445
16620
  quote: drawnQuote,
@@ -16532,6 +16707,15 @@ function PurchaseIsland({
16532
16707
  * accepting it is what moves the flow on, not this press.
16533
16708
  */
16534
16709
  case "PAY_PRESSED":
16710
+ if (free) {
16711
+ void saveForCharge().then((saved) => {
16712
+ if (!saved) return;
16713
+ order.bookFree();
16714
+ dispatch({ kind: "DETOUR_CLOSED" });
16715
+ forward2();
16716
+ });
16717
+ return;
16718
+ }
16535
16719
  void saveForCharge().then((saved) => {
16536
16720
  if (!saved) return;
16537
16721
  setSubmitSignal((was) => was + 1);
@@ -16571,6 +16755,9 @@ function PurchaseIsland({
16571
16755
  case "PROMO_REMOVED":
16572
16756
  void order.removePromo();
16573
16757
  return;
16758
+ case "PROMO_CONTINUED":
16759
+ setContinuing(true);
16760
+ return;
16574
16761
  case "PAYMENT_CANCELLED":
16575
16762
  setCancelSignal((value) => value + 1);
16576
16763
  return;
@@ -16745,6 +16932,7 @@ function PurchaseIsland({
16745
16932
  answersLocked: answersSaved,
16746
16933
  hostAnswers: answeredByHost,
16747
16934
  question: flow.question,
16935
+ ...questionGrouping === void 0 ? {} : { questionGrouping },
16748
16936
  promo: {
16749
16937
  applied: appliedPromo,
16750
16938
  refusal: order.promo.status === "REFUSED" ? order.promo.reason : null
@@ -16807,6 +16995,7 @@ function PurchaseIsland({
16807
16995
  mark: action.mark === void 0 ? void 0 : buttonMark(action.mark),
16808
16996
  label: action.label,
16809
16997
  disabled: action.state !== "ENABLED",
16998
+ busy: continuing && pressed2?.promo === "CONTINUE",
16810
16999
  onPress: pressed2 === null ? () => void 0 : pressFor(pressed2)
16811
17000
  };
16812
17001
  });
@@ -16871,7 +17060,7 @@ function PurchaseIsland({
16871
17060
  onOpenCart: openCart,
16872
17061
  cartLabel: view.trailing.cartLabel,
16873
17062
  onOpenPromo: openPromo,
16874
- promoLabel: view.trailing.promoLabel ?? PROMO_COPY.open
17063
+ promoLabel: view.trailing.promoLabel
16875
17064
  }
16876
17065
  )
16877
17066
  ),