@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 src/lib/picker-filter.d.ts
3
+ // src/lib/picker-filter.d.ts
4
4
  /** One field of a panel filter backed by an Items Selection provider (`$in`, or `$eq` after an operator switch). */
5
5
  interface PickerRule {
6
6
  $in?: string[];
@@ -9,8 +9,6 @@ interface PickerRule {
9
9
  interface CategoriesPickerFilter {
10
10
  categoryId?: PickerRule;
11
11
  }
12
- //#endregion
13
- //#region src/extensions/contexts/categories-context/categories-context.d.ts
14
12
  /** A service category as shown in a category list, with its selected state. */
15
13
  interface CategoryItem {
16
14
  /**
@@ -191,7 +191,7 @@ function Ee(e5, t2, n2) {
191
191
  break;
192
192
  }
193
193
  let a2 = r2[e6 + 1];
194
- (!(t3 in i2) || i2[t3] == null || typeof i2[t3] != `object` || i2[t3] === null) && (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
194
+ t3 in i2 && i2[t3] != null && typeof i2[t3] == `object` && i2[t3] !== null || (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
195
195
  }
196
196
  return e5;
197
197
  }
@@ -258,11 +258,8 @@ var je = class {
258
258
  return;
259
259
  }
260
260
  let a3 = Fe(e6);
261
- if (a3 && a3 in t3) {
262
- r2.push(a3), n2 = t3[a3];
263
- return;
264
- }
265
- throw Error(`Cannot find key '${e6}' or its transformations at path ${this.buildPathString(r2)}`);
261
+ if (a3 && a3 in t3) r2.push(a3), n2 = t3[a3];
262
+ else throw Error(`Cannot find key '${e6}' or its transformations at path ${this.buildPathString(r2)}`);
266
263
  }, o2 = (e6, t3) => {
267
264
  r2.push(e6), n2 = t3[e6];
268
265
  };
@@ -273,11 +270,7 @@ var je = class {
273
270
  }
274
271
  if (typeof n2 != `object` || !n2) throw Error(`Cannot access property '${e6}' on ${typeof n2} at path ${this.buildPathString(r2)}`);
275
272
  let t3 = n2;
276
- if (e6 in n2) {
277
- o2(e6, t3);
278
- continue;
279
- }
280
- a2(e6, t3);
273
+ e6 in n2 ? o2(e6, t3) : a2(e6, t3);
281
274
  }
282
275
  return { [this.buildPathString(r2)]: n2 };
283
276
  }
@@ -1055,13 +1048,7 @@ var H = class {
1055
1048
  }), this;
1056
1049
  }
1057
1050
  off(e5, t2) {
1058
- if (this.observers[e5]) {
1059
- if (!t2) {
1060
- delete this.observers[e5];
1061
- return;
1062
- }
1063
- this.observers[e5].delete(t2);
1064
- }
1051
+ this.observers[e5] && (t2 ? this.observers[e5].delete(t2) : delete this.observers[e5]);
1065
1052
  }
1066
1053
  emit(e5, ...t2) {
1067
1054
  this.observers[e5] && Array.from(this.observers[e5].entries()).forEach(([e6, n2]) => {
@@ -1588,24 +1575,17 @@ var Xn = class extends H {
1588
1575
  let e6 = this.waitingReads.shift();
1589
1576
  this.read(e6.lng, e6.ns, e6.fcName, e6.tried, e6.wait, e6.callback);
1590
1577
  }
1591
- if (o3 && s3 && r2 < this.maxRetries) {
1592
- setTimeout(() => {
1593
- this.read.call(this, e5, t2, n2, r2 + 1, i2 * 2, a2);
1594
- }, i2);
1595
- return;
1596
- }
1597
- a2(o3, s3);
1578
+ o3 && s3 && r2 < this.maxRetries ? setTimeout(() => {
1579
+ this.read.call(this, e5, t2, n2, r2 + 1, i2 * 2, a2);
1580
+ }, i2) : a2(o3, s3);
1598
1581
  }, s2 = this.backend[n2].bind(this.backend);
1599
- if (s2.length === 2) {
1600
- try {
1601
- let n3 = s2(e5, t2);
1602
- n3 && typeof n3.then == `function` ? n3.then((e6) => o2(null, e6)).catch(o2) : o2(null, n3);
1603
- } catch (e6) {
1604
- o2(e6);
1605
- }
1606
- return;
1582
+ if (s2.length === 2) try {
1583
+ let n3 = s2(e5, t2);
1584
+ n3 && typeof n3.then == `function` ? n3.then((e6) => o2(null, e6)).catch(o2) : o2(null, n3);
1585
+ } catch (e6) {
1586
+ o2(e6);
1607
1587
  }
1608
- return s2(e5, t2, o2);
1588
+ else return s2(e5, t2, o2);
1609
1589
  }
1610
1590
  prepareLoading(e5, t2, n2 = {}, r2) {
1611
1591
  if (!this.backend) return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`), r2 && r2();
@@ -1630,11 +1610,8 @@ var Xn = class extends H {
1630
1610
  }
1631
1611
  saveMissing(e5, t2, n2, r2, i2, a2 = {}, o2 = () => {
1632
1612
  }) {
1633
- if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t2)) {
1634
- 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!!!`);
1635
- return;
1636
- }
1637
- if (n2 != null && n2 !== ``) {
1613
+ 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!!!`);
1614
+ else if (n2 != null && n2 !== ``) {
1638
1615
  if (this.backend?.create) {
1639
1616
  let s2 = { ...a2, isUpdate: i2 }, c2 = this.backend.create.bind(this.backend);
1640
1617
  if (c2.length < 6) try {
@@ -1946,7 +1923,7 @@ var br = class {
1946
1923
  };
1947
1924
  var xr = (e5) => new br(e5);
1948
1925
  var Sr = gn({ getMonitoringClient: (e5) => () => e5.getMonitoringClient ? e5.getMonitoringClient() : xr(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
1949
- var Cr = { 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` };
1926
+ var Cr = { 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` };
1950
1927
  function wr(e5) {
1951
1928
  try {
1952
1929
  let t2 = Sr.getMonitoringClient?.();
@@ -2092,7 +2069,7 @@ function Kr(e5) {
2092
2069
  }
2093
2070
  function qr() {
2094
2071
  let e5 = Kr(Gr()), t2 = typeof window > `u`;
2095
- return { scope: e5 ?? void 0, get: async (n2) => {
2072
+ return o(() => ({ scope: e5 ?? void 0, get: async (n2) => {
2096
2073
  if (t2 || !e5) return null;
2097
2074
  try {
2098
2075
  return await e5.get(n2);
@@ -2104,7 +2081,7 @@ function qr() {
2104
2081
  e5.set(n2, r2);
2105
2082
  } catch {
2106
2083
  }
2107
- } };
2084
+ } }), [e5, t2]);
2108
2085
  }
2109
2086
  var Jr = Z(`@wix/site-service-locale`);
2110
2087
  var Yr = Z;
@@ -2290,7 +2267,7 @@ function Li({ categoriesPromise: e5, categoryIdsKey: t2, refetch: n2, children:
2290
2267
  }
2291
2268
  function Ri({ categoriesPicker: e5, refreshSignal: n2 = 0, children: i2 }) {
2292
2269
  ji(Oi.CATEGORIES);
2293
- let a2 = qr(), s2 = $r(), l2 = Ci(e5?.categoryId), [u2, d2] = c(0), p2 = o(() => Mr(fi({ key: ti(s2), refresh: u2 !== 0 || n2 !== 0, warmupData: a2, fetchData: () => Er(`categories-context-load`, { feature: Cr.categories }, yi()) }), Fi, Ii), [u2, n2, s2]), m2 = r(() => d2((e6) => e6 + 1), []);
2270
+ let a2 = qr(), s2 = $r(), l2 = Ci(e5?.categoryId), [u2, d2] = c(0), p2 = o(() => Mr(fi({ key: ti(s2), refresh: u2 !== 0 || n2 !== 0, warmupData: a2, fetchData: () => Er(`categories-context-load`, { feature: Cr.categories }, yi()) }), Fi, Ii), [u2, n2, s2, a2]), m2 = r(() => d2((e6) => e6 + 1), []);
2294
2271
  return f(Dr, { fallback: f(Si, { refetch: m2, children: i2 }), feature: Cr.categories, children: f(t, { fallback: f(xi, { refetch: m2, children: i2 }), children: f(Li, { categoriesPromise: p2, categoryIdsKey: l2, refetch: m2, children: i2 }) }) });
2295
2272
  }
2296
2273
  var zi = pn(`73a358c8-c2c8-4342-bf64-9079e92178fc`);