@wix/bookings 1.0.1796 → 1.0.1798

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 (71) hide show
  1. package/build/cjs/context-booking-checkout.d.ts +3 -37
  2. package/build/cjs/context-booking-checkout.js +1350 -1340
  3. package/build/cjs/context-booking-checkout.js.map +1 -1
  4. package/build/cjs/context-categories.d.ts +1 -3
  5. package/build/cjs/context-categories.js +20 -43
  6. package/build/cjs/context-categories.js.map +1 -1
  7. package/build/cjs/context-locations.d.ts +1 -1
  8. package/build/cjs/context-locations.js +20 -43
  9. package/build/cjs/context-locations.js.map +1 -1
  10. package/build/cjs/context-service-addons.d.ts +1 -15
  11. package/build/cjs/context-service-addons.js +20 -43
  12. package/build/cjs/context-service-addons.js.map +1 -1
  13. package/build/cjs/context-service.d.ts +1 -65
  14. package/build/cjs/context-service.js +363 -386
  15. package/build/cjs/context-service.js.map +1 -1
  16. package/build/cjs/context-services.d.ts +1 -23
  17. package/build/cjs/context-services.js +542 -566
  18. package/build/cjs/context-services.js.map +1 -1
  19. package/build/cjs/context-time-slots.d.ts +1 -21
  20. package/build/cjs/context-time-slots.js +588 -615
  21. package/build/cjs/context-time-slots.js.map +1 -1
  22. package/build/es/context-booking-checkout.d.mts +3 -37
  23. package/build/es/context-booking-checkout.mjs +1350 -1340
  24. package/build/es/context-booking-checkout.mjs.map +1 -1
  25. package/build/es/context-categories.d.mts +1 -3
  26. package/build/es/context-categories.mjs +20 -43
  27. package/build/es/context-categories.mjs.map +1 -1
  28. package/build/es/context-locations.d.mts +1 -1
  29. package/build/es/context-locations.mjs +20 -43
  30. package/build/es/context-locations.mjs.map +1 -1
  31. package/build/es/context-service-addons.d.mts +1 -15
  32. package/build/es/context-service-addons.mjs +20 -43
  33. package/build/es/context-service-addons.mjs.map +1 -1
  34. package/build/es/context-service.d.mts +1 -65
  35. package/build/es/context-service.mjs +363 -386
  36. package/build/es/context-service.mjs.map +1 -1
  37. package/build/es/context-services.d.mts +1 -23
  38. package/build/es/context-services.mjs +542 -566
  39. package/build/es/context-services.mjs.map +1 -1
  40. package/build/es/context-time-slots.d.mts +1 -21
  41. package/build/es/context-time-slots.mjs +588 -615
  42. package/build/es/context-time-slots.mjs.map +1 -1
  43. package/build/internal/cjs/context-booking-checkout.d.ts +3 -37
  44. package/build/internal/cjs/context-categories.d.ts +1 -3
  45. package/build/internal/cjs/context-locations.d.ts +1 -1
  46. package/build/internal/cjs/context-service-addons.d.ts +1 -15
  47. package/build/internal/cjs/context-service.d.ts +1 -65
  48. package/build/internal/cjs/context-services.d.ts +1 -23
  49. package/build/internal/cjs/context-time-slots.d.ts +1 -21
  50. package/build/internal/es/context-booking-checkout.d.mts +3 -37
  51. package/build/internal/es/context-categories.d.mts +1 -3
  52. package/build/internal/es/context-locations.d.mts +1 -1
  53. package/build/internal/es/context-service-addons.d.mts +1 -15
  54. package/build/internal/es/context-service.d.mts +1 -65
  55. package/build/internal/es/context-services.d.mts +1 -23
  56. package/build/internal/es/context-time-slots.d.mts +1 -21
  57. package/context-runtime/context-booking-checkout/runtime.d.ts +3 -38
  58. package/context-runtime/context-booking-checkout/runtime.js +3 -3
  59. package/context-runtime/context-categories/runtime.d.ts +1 -4
  60. package/context-runtime/context-categories/runtime.js +2 -2
  61. package/context-runtime/context-locations/runtime.d.ts +1 -2
  62. package/context-runtime/context-locations/runtime.js +2 -2
  63. package/context-runtime/context-service/runtime.d.ts +1 -66
  64. package/context-runtime/context-service/runtime.js +3 -3
  65. package/context-runtime/context-service-addons/runtime.d.ts +1 -16
  66. package/context-runtime/context-service-addons/runtime.js +2 -2
  67. package/context-runtime/context-services/runtime.d.ts +1 -24
  68. package/context-runtime/context-services/runtime.js +3 -3
  69. package/context-runtime/context-time-slots/runtime.d.ts +1 -22
  70. package/context-runtime/context-time-slots/runtime.js +3 -3
  71. package/package.json +4 -4
@@ -1,6 +1,6 @@
1
1
  import React, { ReactNode } from 'react';
2
2
 
3
- //#region ../../node_modules/type-fest/source/observable-like.d.ts
3
+ // ../../node_modules/type-fest/source/observable-like.d.ts
4
4
  declare global {
5
5
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
6
6
  interface SymbolConstructor {
@@ -17,8 +17,6 @@ As well, some guidance on making an `Observable` to not include `closed` propert
17
17
 
18
18
  @category Observable
19
19
  */
20
- //#endregion
21
- //#region ../../node_modules/@wix/sdk-types/internal/build/index.d.ts
22
20
  declare global {
23
21
  interface ContextualClient {}
24
22
  }
@@ -64,8 +62,6 @@ declare global {
64
62
  */
65
63
  interface SDKTypeMode {}
66
64
  }
67
- //#endregion
68
- //#region ../../node_modules/@wix/auto_sdk_bookings_services/build/es/bookings-services-v2-service-services.universal-p5eQUd5f.d.mts
69
65
  /**
70
66
  * Money.
71
67
  * Default format to use. Sufficiently compliant with majority of standards: w3c, ISO 4217, ISO 20022, ISO 8583:2003.
@@ -199,15 +195,11 @@ interface AddOnGroupDetail$1 {
199
195
  */
200
196
  promptTranslated?: string | null;
201
197
  }
202
- //#endregion
203
- //#region ../bookings-flow-data/dist/types.d.ts
204
198
  /** An add-on the visitor chose, with its quantity. */
205
199
  type AddOn$1 = {
206
200
  /** ID of the add-on. */id: NonNullable<BookedAddOn['_id']>; /** Number of the add-on to book. */
207
201
  quantity: NonNullable<BookedAddOn['quantity']>;
208
202
  };
209
- //#endregion
210
- //#region ../../node_modules/@wix/editor-react-types/dist/image.d.ts
211
203
  type Point = {
212
204
  x: number;
213
205
  y: number;
@@ -243,8 +235,6 @@ type Image = {
243
235
  quality?: number; /** The image alt text for accessibility. */
244
236
  alt?: string;
245
237
  };
246
- //#endregion
247
- //#region src/api/adapters/service-addons/service-addons.d.ts
248
238
  type AddOn = AddOn$2 & {
249
239
  mainMedia?: {
250
240
  image?: string | null;
@@ -353,8 +343,6 @@ interface AddOnGroupItem {
353
343
  */
354
344
  canSelectMore: boolean;
355
345
  }
356
- //#endregion
357
- //#region src/extensions/contexts/service-addons-context/service-addons-context.types.d.ts
358
346
  /** The add-ons offered for the current service, the visitor's picks, and the actions to change them. */
359
347
  interface ServiceAddOnsContextValue {
360
348
  /**
@@ -498,8 +486,6 @@ interface ServiceAddOnsContextValue {
498
486
  interface ServiceAddOnsContextProviderProps {
499
487
  children: ReactNode;
500
488
  }
501
- //#endregion
502
- //#region src/extensions/contexts/service-addons-context/service-addons-context.d.ts
503
489
  declare const serviceAddOnsContext: React.Context<ServiceAddOnsContextValue | null>;
504
490
  /**
505
491
  * The `useServiceAddOnsContext()` hook provides access to the add-ons a Wix Bookings service offers
@@ -192,7 +192,7 @@ function Oe(e5, t2, n2) {
192
192
  break;
193
193
  }
194
194
  let a2 = r2[e6 + 1];
195
- (!(t3 in i2) || i2[t3] == null || typeof i2[t3] != `object` || i2[t3] === null) && (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
195
+ t3 in i2 && i2[t3] != null && typeof i2[t3] == `object` && i2[t3] !== null || (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
196
196
  }
197
197
  return e5;
198
198
  }
@@ -259,11 +259,8 @@ var Ne = class {
259
259
  return;
260
260
  }
261
261
  let a3 = Le(e6);
262
- if (a3 && a3 in t3) {
263
- r2.push(a3), n2 = t3[a3];
264
- return;
265
- }
266
- throw Error(`Cannot find key '${e6}' or its transformations at path ${this.buildPathString(r2)}`);
262
+ if (a3 && a3 in t3) r2.push(a3), n2 = t3[a3];
263
+ else throw Error(`Cannot find key '${e6}' or its transformations at path ${this.buildPathString(r2)}`);
267
264
  }, o2 = (e6, t3) => {
268
265
  r2.push(e6), n2 = t3[e6];
269
266
  };
@@ -274,11 +271,7 @@ var Ne = class {
274
271
  }
275
272
  if (typeof n2 != `object` || !n2) throw Error(`Cannot access property '${e6}' on ${typeof n2} at path ${this.buildPathString(r2)}`);
276
273
  let t3 = n2;
277
- if (e6 in n2) {
278
- o2(e6, t3);
279
- continue;
280
- }
281
- a2(e6, t3);
274
+ e6 in n2 ? o2(e6, t3) : a2(e6, t3);
282
275
  }
283
276
  return { [this.buildPathString(r2)]: n2 };
284
277
  }
@@ -1643,13 +1636,7 @@ var Pa = class {
1643
1636
  }), this;
1644
1637
  }
1645
1638
  off(e5, t2) {
1646
- if (this.observers[e5]) {
1647
- if (!t2) {
1648
- delete this.observers[e5];
1649
- return;
1650
- }
1651
- this.observers[e5].delete(t2);
1652
- }
1639
+ this.observers[e5] && (t2 ? this.observers[e5].delete(t2) : delete this.observers[e5]);
1653
1640
  }
1654
1641
  emit(e5, ...t2) {
1655
1642
  this.observers[e5] && Array.from(this.observers[e5].entries()).forEach(([e6, n2]) => {
@@ -2176,24 +2163,17 @@ var eo = class extends Pa {
2176
2163
  let e6 = this.waitingReads.shift();
2177
2164
  this.read(e6.lng, e6.ns, e6.fcName, e6.tried, e6.wait, e6.callback);
2178
2165
  }
2179
- if (o3 && s3 && r2 < this.maxRetries) {
2180
- setTimeout(() => {
2181
- this.read.call(this, e5, t2, n2, r2 + 1, i2 * 2, a2);
2182
- }, i2);
2183
- return;
2184
- }
2185
- a2(o3, s3);
2166
+ o3 && s3 && r2 < this.maxRetries ? setTimeout(() => {
2167
+ this.read.call(this, e5, t2, n2, r2 + 1, i2 * 2, a2);
2168
+ }, i2) : a2(o3, s3);
2186
2169
  }, s2 = this.backend[n2].bind(this.backend);
2187
- if (s2.length === 2) {
2188
- try {
2189
- let n3 = s2(e5, t2);
2190
- n3 && typeof n3.then == `function` ? n3.then((e6) => o2(null, e6)).catch(o2) : o2(null, n3);
2191
- } catch (e6) {
2192
- o2(e6);
2193
- }
2194
- return;
2170
+ if (s2.length === 2) try {
2171
+ let n3 = s2(e5, t2);
2172
+ n3 && typeof n3.then == `function` ? n3.then((e6) => o2(null, e6)).catch(o2) : o2(null, n3);
2173
+ } catch (e6) {
2174
+ o2(e6);
2195
2175
  }
2196
- return s2(e5, t2, o2);
2176
+ else return s2(e5, t2, o2);
2197
2177
  }
2198
2178
  prepareLoading(e5, t2, n2 = {}, r2) {
2199
2179
  if (!this.backend) return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`), r2 && r2();
@@ -2218,11 +2198,8 @@ var eo = class extends Pa {
2218
2198
  }
2219
2199
  saveMissing(e5, t2, n2, r2, i2, a2 = {}, o2 = () => {
2220
2200
  }) {
2221
- if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t2)) {
2222
- this.logger.warn(`did not save key "${n2}" as the namespace "${t2}" was not yet loaded`, `This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);
2223
- return;
2224
- }
2225
- if (n2 != null && n2 !== ``) {
2201
+ if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t2)) this.logger.warn(`did not save key "${n2}" as the namespace "${t2}" was not yet loaded`, `This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);
2202
+ else if (n2 != null && n2 !== ``) {
2226
2203
  if (this.backend?.create) {
2227
2204
  let s2 = { ...a2, isUpdate: i2 }, c2 = this.backend.create.bind(this.backend);
2228
2205
  if (c2.length < 6) try {
@@ -2534,7 +2511,7 @@ var ko = class {
2534
2511
  };
2535
2512
  var Ao = (e5) => new ko(e5);
2536
2513
  var jo = ga({ getMonitoringClient: (e5) => () => e5.getMonitoringClient ? e5.getMonitoringClient() : Ao(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
2537
- var Mo = { service: `service`, services: `services`, categories: `categories`, locations: `locations`, sessions: `sessions`, timeSlots: `time-slots`, serviceAddOns: `service-addons`, bookingsSettings: `bookings-settings`, serviceCta: `service-cta`, preferences: `preferences`, bookingSummary: `booking-summary`, bookingCheckout: `booking-checkout`, formValues: `form-values`, paymentOptions: `payment-options`, seo: `seo`, warmup: `warmup`, reschedule: `reschedule` };
2514
+ var Mo = { service: `service`, services: `services`, categories: `categories`, locations: `locations`, sessions: `sessions`, timeSlots: `time-slots`, serviceAddOns: `service-addons`, bookingsSettings: `bookings-settings`, serviceCta: `service-cta`, preferences: `preferences`, bookingSummary: `booking-summary`, bookingCheckout: `booking-checkout`, formValues: `form-values`, paymentOptions: `payment-options`, seo: `seo`, warmup: `warmup`, reschedule: `reschedule`, intakeForms: `intake-forms` };
2538
2515
  function No(e5) {
2539
2516
  try {
2540
2517
  let t2 = jo.getMonitoringClient?.();
@@ -2617,7 +2594,7 @@ function Wo(e5) {
2617
2594
  }
2618
2595
  function Go() {
2619
2596
  let e5 = Wo(Uo()), t2 = typeof window > `u`;
2620
- return { scope: e5 ?? void 0, get: async (n2) => {
2597
+ return s(() => ({ scope: e5 ?? void 0, get: async (n2) => {
2621
2598
  if (t2 || !e5) return null;
2622
2599
  try {
2623
2600
  return await e5.get(n2);
@@ -2629,7 +2606,7 @@ function Go() {
2629
2606
  e5.set(n2, r2);
2630
2607
  } catch {
2631
2608
  }
2632
- } };
2609
+ } }), [e5, t2]);
2633
2610
  }
2634
2611
  var Ko = $(`@wix/site-service-locale`);
2635
2612
  var qo = $;
@@ -2941,7 +2918,7 @@ function dc({ addOnsPromise: e5, isLoading: t2, pickedAddOns: n2, forwardToggleA
2941
2918
  function fc({ children: e5 }) {
2942
2919
  let { service: n2, serviceId: r2, hasAddOns: i2, locale: a2, isLoading: o2, bookingsSettingsLoading: c2, selection: l2, toggleAddOn: d2, setAddOnQuantity: f2 } = u();
2943
2920
  ac(nc.SERVICE_ADD_ONS, !o2 && !c2);
2944
- let m2 = s(() => U(l2), [l2]), h2 = Go(), g2 = Zo(), _2 = as(), v2 = n2 && i2 && r2 ? r2 : null, y2 = s(() => v2 ? Vo(Vs({ serviceId: v2, locale: a2, language: g2, currency: _2, warmupData: h2 }), sc, cc) : oc, [v2, a2, g2, _2]), b2 = !v2 && !!o2;
2921
+ let m2 = s(() => U(l2), [l2]), h2 = Go(), g2 = Zo(), _2 = as(), v2 = n2 && i2 && r2 ? r2 : null, y2 = s(() => v2 ? Vo(Vs({ serviceId: v2, locale: a2, language: g2, currency: _2, warmupData: h2 }), sc, cc) : oc, [v2, a2, g2, _2, h2]), b2 = !v2 && !!o2;
2945
2922
  return p(Io, { fallback: p(ds, { children: e5 }), feature: Mo.serviceAddOns, children: p(t, { fallback: p(us, { children: e5 }), children: p(dc, { addOnsPromise: y2, isLoading: b2, pickedAddOns: m2, forwardToggleAddOn: d2, forwardSetAddOnQuantity: f2, children: e5 }) }) });
2946
2923
  }
2947
2924
  var pc = na(`bcc1b809-bde5-4d7d-a7bb-89831fe5ccb8`);