@wix/bookings 1.0.1796 → 1.0.1797

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 +2 -2
@@ -1,6 +1,6 @@
1
1
  import React, { ReactNode } from 'react';
2
2
 
3
- //#region src/extensions/contexts/locations-context/locations-context.d.ts
3
+ // src/extensions/contexts/locations-context/locations-context.d.ts
4
4
  /** A business location as shown in a location list, with its selected state. */
5
5
  interface LocationItem {
6
6
  /**
@@ -222,7 +222,7 @@ function Te(e5, t2, n2) {
222
222
  break;
223
223
  }
224
224
  let a2 = r2[e6 + 1];
225
- (!(t3 in i2) || i2[t3] == null || typeof i2[t3] != `object` || i2[t3] === null) && (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
225
+ t3 in i2 && i2[t3] != null && typeof i2[t3] == `object` && i2[t3] !== null || (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
226
226
  }
227
227
  return e5;
228
228
  }
@@ -289,11 +289,8 @@ var Ae = class {
289
289
  return;
290
290
  }
291
291
  let a3 = Pe(e6);
292
- if (a3 && a3 in t3) {
293
- r2.push(a3), n2 = t3[a3];
294
- return;
295
- }
296
- throw Error(`Cannot find key '${e6}' or its transformations at path ${this.buildPathString(r2)}`);
292
+ if (a3 && a3 in t3) r2.push(a3), n2 = t3[a3];
293
+ else throw Error(`Cannot find key '${e6}' or its transformations at path ${this.buildPathString(r2)}`);
297
294
  }, o2 = (e6, t3) => {
298
295
  r2.push(e6), n2 = t3[e6];
299
296
  };
@@ -304,11 +301,7 @@ var Ae = class {
304
301
  }
305
302
  if (typeof n2 != `object` || !n2) throw Error(`Cannot access property '${e6}' on ${typeof n2} at path ${this.buildPathString(r2)}`);
306
303
  let t3 = n2;
307
- if (e6 in n2) {
308
- o2(e6, t3);
309
- continue;
310
- }
311
- a2(e6, t3);
304
+ e6 in n2 ? o2(e6, t3) : a2(e6, t3);
312
305
  }
313
306
  return { [this.buildPathString(r2)]: n2 };
314
307
  }
@@ -1149,13 +1142,7 @@ var G = class {
1149
1142
  }), this;
1150
1143
  }
1151
1144
  off(e5, t2) {
1152
- if (this.observers[e5]) {
1153
- if (!t2) {
1154
- delete this.observers[e5];
1155
- return;
1156
- }
1157
- this.observers[e5].delete(t2);
1158
- }
1145
+ this.observers[e5] && (t2 ? this.observers[e5].delete(t2) : delete this.observers[e5]);
1159
1146
  }
1160
1147
  emit(e5, ...t2) {
1161
1148
  this.observers[e5] && Array.from(this.observers[e5].entries()).forEach(([e6, n2]) => {
@@ -1682,24 +1669,17 @@ var dr = class extends G {
1682
1669
  let e6 = this.waitingReads.shift();
1683
1670
  this.read(e6.lng, e6.ns, e6.fcName, e6.tried, e6.wait, e6.callback);
1684
1671
  }
1685
- if (o3 && s3 && r2 < this.maxRetries) {
1686
- setTimeout(() => {
1687
- this.read.call(this, e5, t2, n2, r2 + 1, i2 * 2, a2);
1688
- }, i2);
1689
- return;
1690
- }
1691
- a2(o3, s3);
1672
+ o3 && s3 && r2 < this.maxRetries ? setTimeout(() => {
1673
+ this.read.call(this, e5, t2, n2, r2 + 1, i2 * 2, a2);
1674
+ }, i2) : a2(o3, s3);
1692
1675
  }, s2 = this.backend[n2].bind(this.backend);
1693
- if (s2.length === 2) {
1694
- try {
1695
- let n3 = s2(e5, t2);
1696
- n3 && typeof n3.then == `function` ? n3.then((e6) => o2(null, e6)).catch(o2) : o2(null, n3);
1697
- } catch (e6) {
1698
- o2(e6);
1699
- }
1700
- return;
1676
+ if (s2.length === 2) try {
1677
+ let n3 = s2(e5, t2);
1678
+ n3 && typeof n3.then == `function` ? n3.then((e6) => o2(null, e6)).catch(o2) : o2(null, n3);
1679
+ } catch (e6) {
1680
+ o2(e6);
1701
1681
  }
1702
- return s2(e5, t2, o2);
1682
+ else return s2(e5, t2, o2);
1703
1683
  }
1704
1684
  prepareLoading(e5, t2, n2 = {}, r2) {
1705
1685
  if (!this.backend) return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`), r2 && r2();
@@ -1724,11 +1704,8 @@ var dr = class extends G {
1724
1704
  }
1725
1705
  saveMissing(e5, t2, n2, r2, i2, a2 = {}, o2 = () => {
1726
1706
  }) {
1727
- if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t2)) {
1728
- 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!!!`);
1729
- return;
1730
- }
1731
- if (n2 != null && n2 !== ``) {
1707
+ 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!!!`);
1708
+ else if (n2 != null && n2 !== ``) {
1732
1709
  if (this.backend?.create) {
1733
1710
  let s2 = { ...a2, isUpdate: i2 }, c2 = this.backend.create.bind(this.backend);
1734
1711
  if (c2.length < 6) try {
@@ -2040,7 +2017,7 @@ var Ir = class {
2040
2017
  };
2041
2018
  var Lr = (e5) => new Ir(e5);
2042
2019
  var Rr = kn({ getMonitoringClient: (e5) => () => e5.getMonitoringClient ? e5.getMonitoringClient() : Lr(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
2043
- var zr = { 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` };
2020
+ var zr = { 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` };
2044
2021
  function Br(e5) {
2045
2022
  try {
2046
2023
  let t2 = Rr.getMonitoringClient?.();
@@ -2186,7 +2163,7 @@ function ci(e5) {
2186
2163
  }
2187
2164
  function li() {
2188
2165
  let e5 = ci(si()), t2 = typeof window > `u`;
2189
- return { scope: e5 ?? void 0, get: async (n2) => {
2166
+ return (0, import_react.useMemo)(() => ({ scope: e5 ?? void 0, get: async (n2) => {
2190
2167
  if (t2 || !e5) return null;
2191
2168
  try {
2192
2169
  return await e5.get(n2);
@@ -2198,7 +2175,7 @@ function li() {
2198
2175
  e5.set(n2, r2);
2199
2176
  } catch {
2200
2177
  }
2201
- } };
2178
+ } }), [e5, t2]);
2202
2179
  }
2203
2180
  var ui = Z(`@wix/site-service-locale`);
2204
2181
  var di = Z;
@@ -2385,7 +2362,7 @@ function na({ locationsPromise: e5, refetch: t2, children: n2 }) {
2385
2362
  }
2386
2363
  function ra({ children: e5 }) {
2387
2364
  Xi(qi.LOCATIONS);
2388
- let n2 = li(), i2 = hi(), [a2, s2] = (0, import_react.useState)(0), l2 = (0, import_react.useMemo)(() => Jr(Oi({ key: _i(i2), refresh: a2 !== 0, warmupData: n2, fetchData: () => Hr(`locations-context-load`, { feature: zr.locations }, Vi()) }), ea, ta), [a2, i2]), u2 = (0, import_react.useCallback)(() => s2((e6) => e6 + 1), []);
2365
+ let n2 = li(), i2 = hi(), [a2, s2] = (0, import_react.useState)(0), l2 = (0, import_react.useMemo)(() => Jr(Oi({ key: _i(i2), refresh: a2 !== 0, warmupData: n2, fetchData: () => Hr(`locations-context-load`, { feature: zr.locations }, Vi()) }), ea, ta), [a2, i2, n2]), u2 = (0, import_react.useCallback)(() => s2((e6) => e6 + 1), []);
2389
2366
  return (0, import_jsx_runtime.jsx)(Ur, { fallback: (0, import_jsx_runtime.jsx)(Wi, { refetch: u2, children: e5 }), feature: zr.locations, children: (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(Ui, { refetch: u2, children: e5 }), children: (0, import_jsx_runtime.jsx)(na, { locationsPromise: l2, refetch: u2, children: e5 }) }) });
2390
2367
  }
2391
2368
  var ia = En(`c151d9f7-1582-407c-bb59-59030f244b47`);