@wix/himalaya-cli 0.1830.0 → 0.1831.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.
Files changed (73) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap-checkout.mjs +6 -2
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +6 -2
  3. package/dist/browser-plane/assets.json +5 -5
  4. package/dist/browser-plane/preview-deferred/{990204a4cb9e61e96206131bbaeb9401543753fd5301735b5029eb6906921329.bin → 70836790496f742deee3b0e0c83394af3b9fc275d091c6497786d90201392cf4.bin} +1 -1
  5. package/dist/browser-plane/sw.js +8 -8
  6. package/dist/cli.mjs +1219 -1072
  7. package/dist/preview-assets.generated.bin +0 -0
  8. package/guides/designing-himi-screens.md +46 -18
  9. package/guides/getting-started.md +1 -1
  10. package/guides/himi-skill.md +1 -1
  11. package/guides/index.json +6 -0
  12. package/guides/skill.md +1 -0
  13. package/guides/web-ux.md +134 -0
  14. package/package.json +2 -2
  15. package/templates/beauty-salon/dev/index.ts +4 -0
  16. package/templates/beauty-salon/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
  17. package/templates/beauty-salon/tier5-src/himi-booking-time/index.ts +1 -1
  18. package/templates/beauty-salon/tier5-src/himi-branded-lite-plans/index.ts +4 -1
  19. package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +5 -2
  20. package/templates/branded-lite/dev/index.ts +7 -0
  21. package/templates/branded-lite/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
  22. package/templates/branded-lite/tier5-src/himi-booking-time/index.ts +1 -1
  23. package/templates/branded-lite/tier5-src/himi-branded-lite-plans/index.ts +4 -1
  24. package/templates/branded-lite/tier5-src/himi-branded-lite-program/index.ts +5 -2
  25. package/templates/branded-lite/tier5-src/himi-branded-lite-video/index.ts +4 -4
  26. package/templates/branded-lite/tier5-src/himi-store-product/index.ts +5 -2
  27. package/templates/community-club/dev/index.ts +1 -0
  28. package/templates/community-club/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
  29. package/templates/conference/dev/index.ts +2 -0
  30. package/templates/conference/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
  31. package/templates/events-meetups/dev/index.ts +1 -0
  32. package/templates/events-meetups/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
  33. package/templates/fitness-gym/dev/index.ts +2 -0
  34. package/templates/fitness-gym/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
  35. package/templates/fitness-gym/tier5-src/himi-booking-time/index.ts +1 -1
  36. package/templates/fitness-gym/tier5-src/himi-branded-lite-plans/index.ts +4 -1
  37. package/templates/fitness-gym/tier5-src/himi-branded-lite-program/index.ts +5 -2
  38. package/templates/gym-fitness/dev/index.ts +5 -0
  39. package/templates/gym-fitness/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
  40. package/templates/gym-fitness/tier5-src/himi-booking-time/index.ts +1 -1
  41. package/templates/gym-fitness/tier5-src/himi-branded-lite-plans/index.ts +4 -1
  42. package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +5 -2
  43. package/templates/medical-services/dev/index.ts +2 -0
  44. package/templates/medical-services/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
  45. package/templates/medical-services/tier5-src/himi-booking-time/index.ts +1 -1
  46. package/templates/nonprofit-cause/dev/index.ts +2 -0
  47. package/templates/nonprofit-cause/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
  48. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-plans/index.ts +4 -1
  49. package/templates/personal-fitness-trainer/dev/index.ts +4 -0
  50. package/templates/personal-fitness-trainer/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
  51. package/templates/personal-fitness-trainer/tier5-src/himi-booking-time/index.ts +1 -1
  52. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-plans/index.ts +4 -1
  53. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-video/index.ts +4 -4
  54. package/templates/podcast-creator/dev/index.ts +2 -0
  55. package/templates/podcast-creator/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
  56. package/templates/podcast-creator/tier5-src/himi-branded-lite-plans/index.ts +4 -1
  57. package/templates/portfolio-creative/dev/index.ts +2 -0
  58. package/templates/portfolio-creative/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
  59. package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +5 -2
  60. package/templates/restaurant/dev/index.ts +1 -0
  61. package/templates/restaurant/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
  62. package/templates/retail-store/dev/index.ts +1 -0
  63. package/templates/retail-store/tier5-src/himi-store-product/index.ts +5 -2
  64. package/templates/salon-spa/dev/index.ts +2 -0
  65. package/templates/salon-spa/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
  66. package/templates/salon-spa/tier5-src/himi-booking-time/index.ts +1 -1
  67. package/templates/wholesale-store/dev/index.ts +1 -0
  68. package/templates/wholesale-store/tier5-src/himi-store-product/index.ts +5 -2
  69. package/templates/yoga-studio/dev/index.ts +5 -0
  70. package/templates/yoga-studio/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
  71. package/templates/yoga-studio/tier5-src/himi-booking-time/index.ts +1 -1
  72. package/templates/yoga-studio/tier5-src/himi-branded-lite-plans/index.ts +4 -1
  73. package/templates/yoga-studio/tier5-src/himi-branded-lite-program/index.ts +5 -2
@@ -18739,6 +18739,7 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
18739
18739
  "props": {
18740
18740
  "title": "$service:himiBookingTime.iapBuyLabel",
18741
18741
  "disabledPath": "$service:himiBookingTime.iapBuyDisabled",
18742
+ "loadingPath": "$service:himiBookingTime.iapBusy",
18742
18743
  "style": "primary",
18743
18744
  "fullWidth": true,
18744
18745
  "action": {
@@ -19775,6 +19776,7 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
19775
19776
  "props": {
19776
19777
  "title": "$service:himiBookingTime.iapBuyLabel",
19777
19778
  "disabledPath": "$service:himiBookingTime.iapBuyDisabled",
19779
+ "loadingPath": "$service:himiBookingTime.iapBusy",
19778
19780
  "style": "primary",
19779
19781
  "fullWidth": true,
19780
19782
  "action": {
@@ -40,6 +40,8 @@ export function createAttendancePurchase(options: { kind: "bookingsService" | "e
40
40
  let platform = "unknown";
41
41
  let started = false;
42
42
  let inFlight = false;
43
+ /** The ticket or time `buy` is selling, so a different selection never shows its spinner. */
44
+ let inFlightTarget = "";
43
45
  let formError = "";
44
46
  let sequence = 0;
45
47
  let formRevision = 0;
@@ -106,7 +108,23 @@ export function createAttendancePurchase(options: { kind: "bookingsService" | "e
106
108
  if (!retained) initialize(form);
107
109
  }
108
110
 
109
- function fields(selected = true, publishPoll = true): AttendancePurchaseFields {
111
+ /** Whether the Buy for `target` (the selected ticket or time) shows the spinner: while this worker's
112
+ * `buy` runs, only for its target; otherwise whenever the shared checkout is busy, unless the sale is
113
+ * known to be another target's. A restarted worker knows none, so it follows the checkout. */
114
+ function busyFor(target: string | undefined, purchaseBusy: boolean, state: ReturnType<typeof commerce.state>): boolean {
115
+ if (target === undefined) return purchaseBusy || inFlight;
116
+ if (inFlight) return inFlightTarget === target;
117
+ if (!purchaseBusy || !reference) return purchaseBusy;
118
+ const anotherTarget = (item: string) => [...attempts].some(([known, attempt]) => known !== target && item.endsWith(`#${encodeURIComponent(attempt)}`));
119
+ const prefix = `${reference.kind}:${reference.id}#`;
120
+ const processing = state.payments.filter((p) => p.access === "processing");
121
+ if (processing.some((p) => p.item.startsWith(prefix) && !anotherTarget(p.item))) return true;
122
+ if (state.item !== null) return !anotherTarget(state.item);
123
+ // No item: a recovered sale. It may be this one unless its payments all name other tickets or times.
124
+ return processing.length === 0 || processing.some((p) => p.item === "payment");
125
+ }
126
+
127
+ function fields(selected = true, publishPoll = true, selectionKey?: string): AttendancePurchaseFields {
110
128
  syncSession();
111
129
  if (!reference || !metadata) return ATTENDANCE_INITIAL;
112
130
  const currency = metadata.currency ?? "";
@@ -137,7 +155,7 @@ export function createAttendancePurchase(options: { kind: "bookingsService" | "e
137
155
  else if (apple && own && state.phase === "cancelled") note = copyParam(`${prefix}.purchaseCancelledText`, "Purchase cancelled. Your place is not confirmed.");
138
156
  return {
139
157
  iapBuyHidden: !apple, iapBuyDisabled: !enabled || !selected || !member || !form.supported() || purchase.buyDisabled || inFlight,
140
- iapBuyLabel: purchase.buyLabel || copy.buy, iapBusy: purchase.buyBusy || inFlight,
158
+ iapBuyLabel: purchase.buyLabel || copy.buy, iapBusy: busyFor(selectionKey !== undefined ? `${reference.kind}:${reference.id}:${selectionKey}` : options.kind === "eventsTicket" ? `${reference.kind}:${reference.id}:${reference.id}` : undefined, purchase.buyBusy, state),
141
159
  iapPrice: apple ? price.priceText : "", iapRetryHidden: !apple || (price.hidePriceRetry && commerce.scopeComplete()),
142
160
  iapNote: note,
143
161
  iapFormHidden: !apple || !selected || !form.supported(), iapFormError: formError,
@@ -173,6 +191,7 @@ export function createAttendancePurchase(options: { kind: "bookingsService" | "e
173
191
  ...(options.kind === "bookingsService" ? { booking: { slot: selection.slot ?? {}, contactDetails: form.buyer() } } : { ticket: { eventId: selection.eventId ?? "", ...form.ticket(ref.id) } }),
174
192
  } };
175
193
  inFlight = true;
194
+ inFlightTarget = target;
176
195
  formError = "";
177
196
  options.onChange();
178
197
  try {
@@ -733,7 +733,7 @@ function derive(input: S): S {
733
733
  message: regular && !regularCheckoutAllowed && s.message === copyParam("time.purchaseUnavailable", "Purchasing is temporarily unavailable.") ? "" : s.message,
734
734
  hasSlots,
735
735
  // A waitlist pick or a course is not an in-app purchase: neither enables the Apple button.
736
- ...applePurchase.fields(hasSelected && !selectedWaitlist && !s.isCourse),
736
+ ...applePurchase.fields(hasSelected && !selectedWaitlist && !s.isCourse, true, s.selectedSlotId),
737
737
  hasSelected,
738
738
  noSelected: !hasSelected,
739
739
  // The shared sign-in card: no sign-in for a course this screen cannot sell (as below).
@@ -12047,6 +12047,7 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
12047
12047
  "style": "primary",
12048
12048
  "fullWidth": true,
12049
12049
  "disabledPath": "$service:himiStoreProduct.buyDisabled",
12050
+ "loadingPath": "$service:himiStoreProduct.buyBusy",
12050
12051
  "action": {
12051
12052
  "actionId": "tier5.himiStoreProduct.buy"
12052
12053
  }
@@ -315,6 +315,8 @@ interface S {
315
315
  buyHidden: boolean;
316
316
  buyLabel: string;
317
317
  buyDisabled: boolean;
318
+ /** A sale is under way: the Buy button shows its spinner. */
319
+ buyBusy: boolean;
318
320
  buyNote: string;
319
321
  /** Shown once the eCom order reads paid, never on the payment's approval alone. */
320
322
  purchasedNote: string;
@@ -462,7 +464,7 @@ const registerProduct = withIapPresentation<S>({
462
464
  register: withOnlineWrites(registerState, ["beginAdd", "addToCart", "buy"], { derive, messageFields: action => action === "buy" ? ["buyNote"] : ["cartHint"] }),
463
465
  adapters: [storesProductOrders],
464
466
  onCreate: commerce => { productPricing = commerce; }, prefix: "product",
465
- transientKeys: ["optionValidationTarget", "optionValidationRequest", "opt1ScrollRequest", "opt2ScrollRequest", "opt3ScrollRequest", "galleryIndex", "price", "optionsIncomplete", "cartHint", "cartHidden", "buyHidden", "buyLabel", "buyDisabled", "buyNote", "purchasedNote", "addedSheetPresented", "shareHint"], contentActions: ["load", "readChanged"], concurrentPublishActions: ["buy"],
467
+ transientKeys: ["optionValidationTarget", "optionValidationRequest", "opt1ScrollRequest", "opt2ScrollRequest", "opt3ScrollRequest", "galleryIndex", "price", "optionsIncomplete", "cartHint", "cartHidden", "buyHidden", "buyLabel", "buyDisabled", "buyBusy", "buyNote", "purchasedNote", "addedSheetPresented", "shareHint"], contentActions: ["load", "readChanged"], concurrentPublishActions: ["buy"],
466
468
  items: state => inputId() ? [{ reference: { kind: "storesProduct", id: inputId() }, commerceDisplayPrice: state.price }] : [],
467
469
  present: (state, price, allowed, _appleIapOrResolving, resolving) => {
468
470
  const purchase = applePurchase(state);
@@ -479,7 +481,7 @@ const registerProduct = withIapPresentation<S>({
479
481
  ...state, price: price(inputId()), ...(purchase.appleRoute ? { wasPrice: "", wasPriceEmpty: false, notOnSale: true } : {}), optionsIncomplete: productState.optionsIncomplete || !allowed(inputId()) || lastProduct?.productType?.toLowerCase() === "digital",
480
482
  cartHint, noCartHint: !cartHint || state.added, addDisabled: productState.addDisabled || blocked || pending,
481
483
  cartHidden: state.status !== "ready" || !state.name || purchase.appleRoute,
482
- buyHidden: state.status !== "ready" || !state.name || !purchase.appleRoute || purchase.accessReady, buyLabel: purchase.buyLabel, buyDisabled: purchase.buyDisabled,
484
+ buyHidden: state.status !== "ready" || !state.name || !purchase.appleRoute || purchase.accessReady, buyLabel: purchase.buyLabel, buyDisabled: purchase.buyDisabled, buyBusy: purchase.buyBusy,
483
485
  buyNote: state.buyNote === offlineWriteMessage ? state.buyNote : purchase.buyNote,
484
486
  purchasedNote: purchase.accessReady ? copyParam("product.purchasedText", "Purchased") : "",
485
487
  };
@@ -625,6 +627,7 @@ const svc = onlineService<S, {
625
627
  buyHidden: true,
626
628
  buyLabel: "",
627
629
  buyDisabled: true,
630
+ buyBusy: false,
628
631
  buyNote: "",
629
632
  purchasedNote: "",
630
633
  }),
@@ -25251,6 +25251,7 @@ const SCREENS = runtimeSetting({
25251
25251
  "title": "$service:himiBrandedPlans.detail.joinLabel",
25252
25252
  "style": "primary",
25253
25253
  "disabledPath": "$service:himiBrandedPlans.detail.joinDisabled",
25254
+ "loadingPath": "$service:himiBrandedPlans.detail.joinBusy",
25254
25255
  "action": {
25255
25256
  "actionId": "tier5.himiBrandedPlans.join"
25256
25257
  }
@@ -37406,6 +37407,7 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
37406
37407
  "props": {
37407
37408
  "title": "$service:himiBookingTime.iapBuyLabel",
37408
37409
  "disabledPath": "$service:himiBookingTime.iapBuyDisabled",
37410
+ "loadingPath": "$service:himiBookingTime.iapBusy",
37409
37411
  "style": "primary",
37410
37412
  "fullWidth": true,
37411
37413
  "action": {
@@ -38437,6 +38439,7 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
38437
38439
  "props": {
38438
38440
  "title": "$service:himiBookingTime.iapBuyLabel",
38439
38441
  "disabledPath": "$service:himiBookingTime.iapBuyDisabled",
38442
+ "loadingPath": "$service:himiBookingTime.iapBusy",
38440
38443
  "style": "primary",
38441
38444
  "fullWidth": true,
38442
38445
  "action": {
@@ -39190,6 +39193,7 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
39190
39193
  "style": "primary",
39191
39194
  "fullWidth": true,
39192
39195
  "disabledPath": "$service:himiBrandedProgram.buyDisabled",
39196
+ "loadingPath": "$service:himiBrandedProgram.buyBusy",
39193
39197
  "action": {
39194
39198
  "actionId": "tier5.himiBrandedProgram.buy"
39195
39199
  }
@@ -41643,6 +41647,7 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
41643
41647
  "props": {
41644
41648
  "title": "$service:himiEventDetail.iapBuyLabel",
41645
41649
  "disabledPath": "$service:himiEventDetail.iapBuyDisabled",
41650
+ "loadingPath": "$service:himiEventDetail.iapBusy",
41646
41651
  "style": "primary",
41647
41652
  "fullWidth": true,
41648
41653
  "action": {
@@ -40,6 +40,8 @@ export function createAttendancePurchase(options: { kind: "bookingsService" | "e
40
40
  let platform = "unknown";
41
41
  let started = false;
42
42
  let inFlight = false;
43
+ /** The ticket or time `buy` is selling, so a different selection never shows its spinner. */
44
+ let inFlightTarget = "";
43
45
  let formError = "";
44
46
  let sequence = 0;
45
47
  let formRevision = 0;
@@ -106,7 +108,23 @@ export function createAttendancePurchase(options: { kind: "bookingsService" | "e
106
108
  if (!retained) initialize(form);
107
109
  }
108
110
 
109
- function fields(selected = true, publishPoll = true): AttendancePurchaseFields {
111
+ /** Whether the Buy for `target` (the selected ticket or time) shows the spinner: while this worker's
112
+ * `buy` runs, only for its target; otherwise whenever the shared checkout is busy, unless the sale is
113
+ * known to be another target's. A restarted worker knows none, so it follows the checkout. */
114
+ function busyFor(target: string | undefined, purchaseBusy: boolean, state: ReturnType<typeof commerce.state>): boolean {
115
+ if (target === undefined) return purchaseBusy || inFlight;
116
+ if (inFlight) return inFlightTarget === target;
117
+ if (!purchaseBusy || !reference) return purchaseBusy;
118
+ const anotherTarget = (item: string) => [...attempts].some(([known, attempt]) => known !== target && item.endsWith(`#${encodeURIComponent(attempt)}`));
119
+ const prefix = `${reference.kind}:${reference.id}#`;
120
+ const processing = state.payments.filter((p) => p.access === "processing");
121
+ if (processing.some((p) => p.item.startsWith(prefix) && !anotherTarget(p.item))) return true;
122
+ if (state.item !== null) return !anotherTarget(state.item);
123
+ // No item: a recovered sale. It may be this one unless its payments all name other tickets or times.
124
+ return processing.length === 0 || processing.some((p) => p.item === "payment");
125
+ }
126
+
127
+ function fields(selected = true, publishPoll = true, selectionKey?: string): AttendancePurchaseFields {
110
128
  syncSession();
111
129
  if (!reference || !metadata) return ATTENDANCE_INITIAL;
112
130
  const currency = metadata.currency ?? "";
@@ -137,7 +155,7 @@ export function createAttendancePurchase(options: { kind: "bookingsService" | "e
137
155
  else if (apple && own && state.phase === "cancelled") note = copyParam(`${prefix}.purchaseCancelledText`, "Purchase cancelled. Your place is not confirmed.");
138
156
  return {
139
157
  iapBuyHidden: !apple, iapBuyDisabled: !enabled || !selected || !member || !form.supported() || purchase.buyDisabled || inFlight,
140
- iapBuyLabel: purchase.buyLabel || copy.buy, iapBusy: purchase.buyBusy || inFlight,
158
+ iapBuyLabel: purchase.buyLabel || copy.buy, iapBusy: busyFor(selectionKey !== undefined ? `${reference.kind}:${reference.id}:${selectionKey}` : options.kind === "eventsTicket" ? `${reference.kind}:${reference.id}:${reference.id}` : undefined, purchase.buyBusy, state),
141
159
  iapPrice: apple ? price.priceText : "", iapRetryHidden: !apple || (price.hidePriceRetry && commerce.scopeComplete()),
142
160
  iapNote: note,
143
161
  iapFormHidden: !apple || !selected || !form.supported(), iapFormError: formError,
@@ -173,6 +191,7 @@ export function createAttendancePurchase(options: { kind: "bookingsService" | "e
173
191
  ...(options.kind === "bookingsService" ? { booking: { slot: selection.slot ?? {}, contactDetails: form.buyer() } } : { ticket: { eventId: selection.eventId ?? "", ...form.ticket(ref.id) } }),
174
192
  } };
175
193
  inFlight = true;
194
+ inFlightTarget = target;
176
195
  formError = "";
177
196
  options.onChange();
178
197
  try {
@@ -733,7 +733,7 @@ function derive(input: S): S {
733
733
  message: regular && !regularCheckoutAllowed && s.message === copyParam("time.purchaseUnavailable", "Purchasing is temporarily unavailable.") ? "" : s.message,
734
734
  hasSlots,
735
735
  // A waitlist pick or a course is not an in-app purchase: neither enables the Apple button.
736
- ...applePurchase.fields(hasSelected && !selectedWaitlist && !s.isCourse),
736
+ ...applePurchase.fields(hasSelected && !selectedWaitlist && !s.isCourse, true, s.selectedSlotId),
737
737
  hasSelected,
738
738
  noSelected: !hasSelected,
739
739
  // The shared sign-in card: no sign-in for a course this screen cannot sell (as below).
@@ -71,6 +71,8 @@ interface PlanRow {
71
71
  applePeriod: string;
72
72
  joinLabel: string;
73
73
  joinDisabled: boolean;
74
+ /** An App Store sale of this plan is under way: Join shows its spinner. */
75
+ joinBusy: boolean;
74
76
  joinNote: string;
75
77
  }
76
78
 
@@ -183,7 +185,7 @@ function planRow(plan: WixPlan): PlanRow {
183
185
  free: isFreePlan(plan),
184
186
  appleSupported: isAppleSellablePlan(plan.pricing),
185
187
  applePeriod: applePlanPeriod(plan.pricing),
186
- joined: false, joinLabel: copyParam("plans.joinCta", "Continue"), joinDisabled: true, joinNote: "",
188
+ joined: false, joinLabel: copyParam("plans.joinCta", "Continue"), joinDisabled: true, joinBusy: false, joinNote: "",
187
189
  };
188
190
  }
189
191
 
@@ -258,6 +260,7 @@ function pricedState(state: State): State {
258
260
  joined,
259
261
  joinLabel: joined ? copyParam("plans.joinedLabel", "Current plan") : apple ? purchase.buyLabel : row.joinLabel,
260
262
  joinDisabled: joined || (apple ? purchase.buyDisabled || !appleOffered(row, view) : price.actionDisabled || !regularReady) || joining.has(row.id),
263
+ joinBusy: apple && purchase.buyBusy,
261
264
  joinNote: apple ? appleOffered(row, view) ? purchase.buyNote : iapPriceCopy("plans").purchaseUnavailable : price.actionNote };
262
265
  });
263
266
  const detail = priced.find(row => row.id === detailInputId()) ?? null;
@@ -117,6 +117,8 @@ interface State {
117
117
  buyHidden: boolean;
118
118
  buyLabel: string;
119
119
  buyDisabled: boolean;
120
+ /** A sale is under way: the Buy button shows its spinner. */
121
+ buyBusy: boolean;
120
122
  buyNote: string;
121
123
  _poll?: IapPollDirective;
122
124
  }
@@ -303,7 +305,7 @@ async function enrollmentMessage(id: string, name: string, guards: CommerceGuard
303
305
  const commerce = createIapCommerce({ adapters: [onlineProgramOrders], onChange: () => { void svc.pricingPublish(); } });
304
306
  const pricing = commerce.pricing;
305
307
  const PRICING_NOT_HYDRATED = [
306
- "priceLine", "priceNote", "hidePriceRetry", "enrollDisabled", "enrollNote", "enrollHidden", "enrollLabel", "standingLine", "participantHidden", "cancelHidden", "cancelDisabled", "cancelLabel", "buyHidden", "buyLabel", "buyDisabled", "buyNote",
308
+ "priceLine", "priceNote", "hidePriceRetry", "enrollDisabled", "enrollNote", "enrollHidden", "enrollLabel", "standingLine", "participantHidden", "cancelHidden", "cancelDisabled", "cancelLabel", "buyHidden", "buyLabel", "buyDisabled", "buyBusy", "buyNote",
307
309
  ] as const;
308
310
  const CONTENT_KEYS = ["status", "name", "description", "descriptionJson", "meta", "facts", "image", "initial", "emptyText"] as const;
309
311
  type Content = Pick<State, (typeof CONTENT_KEYS)[number]>;
@@ -773,7 +775,7 @@ function pricedState(state: State): State {
773
775
  cancelDisabled: cancelInFlight || enrollmentInFlight,
774
776
  confirmedCancellation: cancelledApplication ?? null,
775
777
  cancellationFeedback,
776
- buyHidden: !purchase.appleRoute || purchase.accessReady || !canEnrol(standing), buyLabel: purchase.buyLabel, buyDisabled: !standingForInput() || purchase.buyDisabled, buyNote: purchase.buyNote,
778
+ buyHidden: !purchase.appleRoute || purchase.accessReady || !canEnrol(standing), buyLabel: purchase.buyLabel, buyDisabled: !standingForInput() || purchase.buyDisabled, buyBusy: purchase.buyBusy, buyNote: purchase.buyNote,
777
779
  ...(poll ? { _poll: poll } : {}),
778
780
  });
779
781
  }
@@ -817,6 +819,7 @@ const INITIAL_STATE: State = derive({
817
819
  buyHidden: true,
818
820
  buyLabel: "",
819
821
  buyDisabled: true,
822
+ buyBusy: false,
820
823
  buyNote: "",
821
824
  });
822
825