@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
@@ -112,12 +112,12 @@ function de(e5) {
112
112
  }
113
113
  var fe = (e5) => `validationError` in (e5.response?.data?.details ?? {});
114
114
  var pe = (e5) => `applicationError` in (e5.response?.data?.details ?? {});
115
- var j = (e5) => (e5.response?.status ?? -1) >= 400 && (e5.response?.status ?? -1) < 500;
116
- function me(e5, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
115
+ var me = (e5) => (e5.response?.status ?? -1) >= 400 && (e5.response?.status ?? -1) < 500;
116
+ function j(e5, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
117
117
  if (typeof e5 != `object` || !e5) throw e5;
118
118
  if (fe(e5)) return he(e5, t2, n2);
119
119
  if (pe(e5)) return _e(e5);
120
- if (j(e5)) {
120
+ if (me(e5)) {
121
121
  let t3 = e5.response?.status, n3 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: se(n3), data: {} }, requestId: e5.requestId };
122
122
  return ge(e5, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
123
123
  }
@@ -168,7 +168,7 @@ function Se(e5, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
168
168
  e8 = await s3.json();
169
169
  } catch {
170
170
  }
171
- let t3 = we(s3.status, e8?.message ?? s3.statusText, e8?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e8 }), n3 = me(t3);
171
+ let t3 = M(s3.status, e8?.message ?? s3.statusText, e8?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e8 }), n3 = j(t3);
172
172
  throw r2?.handleError(n3, { requestOptions: { url: a3.url, method: a3.method, entityFqdn: i3.entityFqdn, methodFqn: i3.methodFqn } }), t3;
173
173
  }
174
174
  let l3 = await s3.json();
@@ -185,11 +185,11 @@ var Ce = class extends Error {
185
185
  super(), this.response = e5.response, this.requestId = e5.requestId;
186
186
  }
187
187
  };
188
- var we = (e5, t2, n2, r2) => new Ce({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e5, data: r2 } }, ...n2 }, message: t2 }, status: e5 }, requestId: r2?.requestId });
189
- var Te = `.`;
190
- function Ee(e5, t2, n2) {
188
+ var M = (e5, t2, n2, r2) => new Ce({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e5, data: r2 } }, ...n2 }, message: t2 }, status: e5 }, requestId: r2?.requestId });
189
+ var we = `.`;
190
+ function Te(e5, t2, n2) {
191
191
  if (e5 == null) throw Error(`Cannot set value on null or undefined`);
192
- let r2 = De(t2), i2 = e5;
192
+ let r2 = Ee(t2), i2 = e5;
193
193
  for (let e6 = 0; e6 < r2.length; e6++) {
194
194
  let t3 = r2[e6];
195
195
  if (e6 === r2.length - 1) {
@@ -197,19 +197,19 @@ function Ee(e5, t2, n2) {
197
197
  break;
198
198
  }
199
199
  let a2 = r2[e6 + 1];
200
- (!(t3 in i2) || i2[t3] == null || typeof i2[t3] != `object` || i2[t3] === null) && (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
200
+ t3 in i2 && i2[t3] != null && typeof i2[t3] == `object` && i2[t3] !== null || (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
201
201
  }
202
202
  return e5;
203
203
  }
204
- function De(e5) {
205
- return Array.isArray(e5) ? e5 : e5.split(Te).map((e6) => M(e6) ? Number(e6) : e6);
204
+ function Ee(e5) {
205
+ return Array.isArray(e5) ? e5 : e5.split(we).map((e6) => De(e6) ? Number(e6) : e6);
206
206
  }
207
- function M(e5) {
207
+ function De(e5) {
208
208
  return /^\d+$/.test(e5);
209
209
  }
210
210
  function Oe(e5) {
211
211
  let t2 = {};
212
- for (let [n2, r2] of Object.entries(e5)) ke(n2) || Ee(t2, De(n2), r2);
212
+ for (let [n2, r2] of Object.entries(e5)) ke(n2) || Te(t2, Ee(n2), r2);
213
213
  return t2;
214
214
  }
215
215
  function ke(e5) {
@@ -264,11 +264,8 @@ var Ae = class {
264
264
  return;
265
265
  }
266
266
  let a3 = Pe(e6);
267
- if (a3 && a3 in t3) {
268
- r2.push(a3), n2 = t3[a3];
269
- return;
270
- }
271
- throw Error(`Cannot find key '${e6}' or its transformations at path ${this.buildPathString(r2)}`);
267
+ if (a3 && a3 in t3) r2.push(a3), n2 = t3[a3];
268
+ else throw Error(`Cannot find key '${e6}' or its transformations at path ${this.buildPathString(r2)}`);
272
269
  }, o2 = (e6, t3) => {
273
270
  r2.push(e6), n2 = t3[e6];
274
271
  };
@@ -279,11 +276,7 @@ var Ae = class {
279
276
  }
280
277
  if (typeof n2 != `object` || !n2) throw Error(`Cannot access property '${e6}' on ${typeof n2} at path ${this.buildPathString(r2)}`);
281
278
  let t3 = n2;
282
- if (e6 in n2) {
283
- o2(e6, t3);
284
- continue;
285
- }
286
- a2(e6, t3);
279
+ e6 in n2 ? o2(e6, t3) : a2(e6, t3);
287
280
  }
288
281
  return { [this.buildPathString(r2)]: n2 };
289
282
  }
@@ -1658,13 +1651,7 @@ var qa = class {
1658
1651
  }), this;
1659
1652
  }
1660
1653
  off(e5, t2) {
1661
- if (this.observers[e5]) {
1662
- if (!t2) {
1663
- delete this.observers[e5];
1664
- return;
1665
- }
1666
- this.observers[e5].delete(t2);
1667
- }
1654
+ this.observers[e5] && (t2 ? this.observers[e5].delete(t2) : delete this.observers[e5]);
1668
1655
  }
1669
1656
  emit(e5, ...t2) {
1670
1657
  this.observers[e5] && Array.from(this.observers[e5].entries()).forEach(([e6, n2]) => {
@@ -2191,24 +2178,17 @@ var ho = class extends qa {
2191
2178
  let e6 = this.waitingReads.shift();
2192
2179
  this.read(e6.lng, e6.ns, e6.fcName, e6.tried, e6.wait, e6.callback);
2193
2180
  }
2194
- if (o3 && s3 && r2 < this.maxRetries) {
2195
- setTimeout(() => {
2196
- this.read.call(this, e5, t2, n2, r2 + 1, i2 * 2, a2);
2197
- }, i2);
2198
- return;
2199
- }
2200
- a2(o3, s3);
2181
+ o3 && s3 && r2 < this.maxRetries ? setTimeout(() => {
2182
+ this.read.call(this, e5, t2, n2, r2 + 1, i2 * 2, a2);
2183
+ }, i2) : a2(o3, s3);
2201
2184
  }, s2 = this.backend[n2].bind(this.backend);
2202
- if (s2.length === 2) {
2203
- try {
2204
- let n3 = s2(e5, t2);
2205
- n3 && typeof n3.then == `function` ? n3.then((e6) => o2(null, e6)).catch(o2) : o2(null, n3);
2206
- } catch (e6) {
2207
- o2(e6);
2208
- }
2209
- return;
2185
+ if (s2.length === 2) try {
2186
+ let n3 = s2(e5, t2);
2187
+ n3 && typeof n3.then == `function` ? n3.then((e6) => o2(null, e6)).catch(o2) : o2(null, n3);
2188
+ } catch (e6) {
2189
+ o2(e6);
2210
2190
  }
2211
- return s2(e5, t2, o2);
2191
+ else return s2(e5, t2, o2);
2212
2192
  }
2213
2193
  prepareLoading(e5, t2, n2 = {}, r2) {
2214
2194
  if (!this.backend) return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`), r2 && r2();
@@ -2233,11 +2213,8 @@ var ho = class extends qa {
2233
2213
  }
2234
2214
  saveMissing(e5, t2, n2, r2, i2, a2 = {}, o2 = () => {
2235
2215
  }) {
2236
- if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t2)) {
2237
- 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!!!`);
2238
- return;
2239
- }
2240
- if (n2 != null && n2 !== ``) {
2216
+ 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!!!`);
2217
+ else if (n2 != null && n2 !== ``) {
2241
2218
  if (this.backend?.create) {
2242
2219
  let s2 = { ...a2, isUpdate: i2 }, c2 = this.backend.create.bind(this.backend);
2243
2220
  if (c2.length < 6) try {
@@ -2584,7 +2561,7 @@ var Jo = class {
2584
2561
  };
2585
2562
  var Yo = (e5) => new Jo(e5);
2586
2563
  var Xo = Ca({ getMonitoringClient: (e5) => () => e5.getMonitoringClient ? e5.getMonitoringClient() : Yo(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
2587
- var Zo = { 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` };
2564
+ var Zo = { 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` };
2588
2565
  function Qo(e5) {
2589
2566
  try {
2590
2567
  let t2 = Xo.getMonitoringClient?.();
@@ -4649,8 +4626,8 @@ var fg = function(e5, t2, n2, r2) {
4649
4626
  s2 && l2(f2 + 131072);
4650
4627
  var pe2 = f2 + ue2;
4651
4628
  if (f2 < k2) {
4652
- var j2 = a2 - k2, me2 = Math.min(k2, pe2);
4653
- for (j2 + f2 < 0 && dg(3); f2 < me2; ++f2) n2[f2] = r2[j2 + f2];
4629
+ var me2 = a2 - k2, j2 = Math.min(k2, pe2);
4630
+ for (me2 + f2 < 0 && dg(3); f2 < j2; ++f2) n2[f2] = r2[me2 + f2];
4654
4631
  }
4655
4632
  for (; f2 < pe2; ++f2) n2[f2] = n2[f2 - k2];
4656
4633
  }
@@ -4790,8 +4767,8 @@ var Cg = function(e5, t2, n2, r2, i2, a2) {
4790
4767
  if (A2 > ae2) {
4791
4768
  if (ae2 = A2, k2 = se2, A2 > ce2) break;
4792
4769
  for (var de2 = Math.min(se2, A2 - 2), fe2 = 0, O2 = 0; O2 < de2; ++O2) {
4793
- var pe2 = C2 - se2 + O2 & 32767, j2 = pe2 - h2[pe2] & 32767;
4794
- j2 > fe2 && (fe2 = j2, D2 = pe2);
4770
+ var pe2 = C2 - se2 + O2 & 32767, me2 = pe2 - h2[pe2] & 32767;
4771
+ me2 > fe2 && (fe2 = me2, D2 = pe2);
4795
4772
  }
4796
4773
  }
4797
4774
  }
@@ -4799,8 +4776,8 @@ var Cg = function(e5, t2, n2, r2, i2, a2) {
4799
4776
  }
4800
4777
  if (k2) {
4801
4778
  b2[w2++] = 268435456 | Kh[ae2] << 18 | Yh[k2];
4802
- var me2 = Kh[ae2] & 31, he2 = Yh[k2] & 31;
4803
- S2 += Bh[me2] + Vh[he2], ++x2[257 + me2], ++ee2[he2], T2 = C2 + ae2, ++te2;
4779
+ var j2 = Kh[ae2] & 31, he2 = Yh[k2] & 31;
4780
+ S2 += Bh[j2] + Vh[he2], ++x2[257 + j2], ++ee2[he2], T2 = C2 + ae2, ++te2;
4804
4781
  } else b2[w2++] = e5[C2], ++x2[e5[C2]];
4805
4782
  }
4806
4783
  }
@@ -5492,21 +5469,21 @@ var Hv = (e5) => {
5492
5469
  };
5493
5470
  Bv([Hv, Vv]);
5494
5471
  var Uv = `11062b_7b9f1e3756b64285ad5cf5e244b4ae77~mv2.png`;
5495
- var Wv = `wix:image://v1/${Uv}/${Uv}#originWidth=460&originHeight=460`;
5496
- function Gv(e5) {
5472
+ `${Uv}${Uv}`;
5473
+ function Wv(e5) {
5497
5474
  if (!e5) return null;
5498
5475
  let t2;
5499
5476
  return Hv({ props: {}, setProps: ({ image: e6 }) => {
5500
5477
  t2 = e6;
5501
5478
  } }).src = e5, t2 ?? null;
5502
5479
  }
5480
+ function Gv(e5) {
5481
+ return Wv(e5.media?.mainMedia?.image || `wix:image://v1/11062b_7b9f1e3756b64285ad5cf5e244b4ae77~mv2.png/11062b_7b9f1e3756b64285ad5cf5e244b4ae77~mv2.png#originWidth=460&originHeight=460`);
5482
+ }
5503
5483
  function Kv(e5) {
5504
- return Gv(e5.media?.mainMedia?.image || Wv);
5484
+ return Wv(e5.media?.coverMedia?.image) ?? void 0;
5505
5485
  }
5506
5486
  function qv(e5) {
5507
- return Gv(e5.media?.coverMedia?.image) ?? void 0;
5508
- }
5509
- function Jv(e5) {
5510
5487
  switch (e5.type) {
5511
5488
  case kd.BUSINESS:
5512
5489
  return `business`;
@@ -5518,7 +5495,7 @@ function Jv(e5) {
5518
5495
  return null;
5519
5496
  }
5520
5497
  }
5521
- function Yv(e5, t2) {
5498
+ function Jv(e5, t2) {
5522
5499
  switch (e5.type) {
5523
5500
  case kd.BUSINESS:
5524
5501
  return e5.business?.name ?? null;
@@ -5530,69 +5507,69 @@ function Yv(e5, t2) {
5530
5507
  return null;
5531
5508
  }
5532
5509
  }
5533
- function Xv(e5) {
5510
+ function Yv(e5) {
5534
5511
  return (e5?.locations ?? []).flatMap((e6) => {
5535
- let t2 = Jv(e6);
5512
+ let t2 = qv(e6);
5536
5513
  if (!t2) return [];
5537
5514
  if (t2 === `customer`) return [{ type: t2, text: null }];
5538
- let n2 = Yv(e6, ``);
5515
+ let n2 = Jv(e6, ``);
5539
5516
  return n2 ? [{ type: t2, text: n2 }] : [];
5540
5517
  });
5541
5518
  }
5542
- var Zv = { AVAILABLE: `available`, FULLY_BOOKED: `fullyBooked`, BOOKING_NOT_OPEN_YET: `bookingNotOpenYet`, BOOKING_CLOSED: `bookingClosed`, COURSE_IN_PROGRESS: `courseInProgress`, NO_UPCOMING_SESSIONS: `noUpcomingSessions` };
5543
- var Qv = 6e4;
5544
- var $v = (e5) => e5?.onlineBooking?.enabled === true;
5545
- var ey = (e5) => e5 ? new Date(e5).getTime() : null;
5546
- var ty = (e5, t2) => t2 !== void 0 && e5 !== null && e5 <= t2;
5547
- function ny({ service: e5, courseRemainingCapacity: t2, now: n2 }) {
5548
- let r2 = $v(e5), i2 = ey(e5?.schedule?.firstSessionStart), a2 = ey(e5?.schedule?.lastSessionEnd), o2 = i2 !== null;
5519
+ var Xv = { AVAILABLE: `available`, FULLY_BOOKED: `fullyBooked`, BOOKING_NOT_OPEN_YET: `bookingNotOpenYet`, BOOKING_CLOSED: `bookingClosed`, COURSE_IN_PROGRESS: `courseInProgress`, NO_UPCOMING_SESSIONS: `noUpcomingSessions` };
5520
+ var Zv = 6e4;
5521
+ var Qv = (e5) => e5?.onlineBooking?.enabled === true;
5522
+ var $v = (e5) => e5 ? new Date(e5).getTime() : null;
5523
+ var ey = (e5, t2) => t2 !== void 0 && e5 !== null && e5 <= t2;
5524
+ function ty({ service: e5, courseRemainingCapacity: t2, now: n2 }) {
5525
+ let r2 = Qv(e5), i2 = $v(e5?.schedule?.firstSessionStart), a2 = $v(e5?.schedule?.lastSessionEnd), o2 = i2 !== null;
5549
5526
  if (!Um(e5?.type)) {
5550
- let t3 = !Hm(e5?.type) || o2 && !ty(a2, n2);
5551
- return { state: r2 && !t3 ? Zv.NO_UPCOMING_SESSIONS : Zv.AVAILABLE, isAvailableForBooking: r2 && t3, bookingOpensAt: null };
5527
+ let t3 = !Hm(e5?.type) || o2 && !ey(a2, n2);
5528
+ return { state: r2 && !t3 ? Xv.NO_UPCOMING_SESSIONS : Xv.AVAILABLE, isAvailableForBooking: r2 && t3, bookingOpensAt: null };
5552
5529
  }
5553
- let s2 = e5?.bookingPolicy, c2 = s2?.limitEarlyBookingPolicy?.enabled ? s2.limitEarlyBookingPolicy.earliestBookingInMinutes ?? 0 : 0, l2 = s2?.limitLateBookingPolicy?.enabled ? s2.limitLateBookingPolicy.latestBookingInMinutes ?? 0 : 0, u2 = s2?.bookAfterStartPolicy?.enabled === true, d2 = i2 === null || n2 === void 0 ? null : (i2 - n2) / Qv, f2 = t2 !== null && t2 <= 0, p2 = d2 !== null && c2 > 0 && d2 >= c2, m2 = d2 !== null && !u2 && d2 <= l2, h2 = o2 && !ty(a2, n2), g2 = ty(i2, n2) && !ty(a2, n2) && u2, _2 = i2 === null ? null : new Date(i2 - c2 * Qv), v2 = Zv.AVAILABLE;
5554
- return r2 && (f2 ? v2 = Zv.FULLY_BOOKED : p2 ? v2 = Zv.BOOKING_NOT_OPEN_YET : m2 ? v2 = Zv.BOOKING_CLOSED : h2 ? g2 && (v2 = Zv.COURSE_IN_PROGRESS) : v2 = Zv.NO_UPCOMING_SESSIONS), { state: v2, isAvailableForBooking: r2 && !f2 && h2 && !p2 && !m2, bookingOpensAt: _2 };
5530
+ let s2 = e5?.bookingPolicy, c2 = s2?.limitEarlyBookingPolicy?.enabled ? s2.limitEarlyBookingPolicy.earliestBookingInMinutes ?? 0 : 0, l2 = s2?.limitLateBookingPolicy?.enabled ? s2.limitLateBookingPolicy.latestBookingInMinutes ?? 0 : 0, u2 = s2?.bookAfterStartPolicy?.enabled === true, d2 = i2 === null || n2 === void 0 ? null : (i2 - n2) / Zv, f2 = t2 !== null && t2 <= 0, p2 = d2 !== null && c2 > 0 && d2 >= c2, m2 = d2 !== null && !u2 && d2 <= l2, h2 = o2 && !ey(a2, n2), g2 = ey(i2, n2) && !ey(a2, n2) && u2, _2 = i2 === null ? null : new Date(i2 - c2 * Zv), v2 = Xv.AVAILABLE;
5531
+ return r2 && (f2 ? v2 = Xv.FULLY_BOOKED : p2 ? v2 = Xv.BOOKING_NOT_OPEN_YET : m2 ? v2 = Xv.BOOKING_CLOSED : h2 ? g2 && (v2 = Xv.COURSE_IN_PROGRESS) : v2 = Xv.NO_UPCOMING_SESSIONS), { state: v2, isAvailableForBooking: r2 && !f2 && h2 && !p2 && !m2, bookingOpensAt: _2 };
5555
5532
  }
5556
- function ry(e5) {
5533
+ function ny(e5) {
5557
5534
  return e5.staffMemberDetails?.staffMembers ?? [];
5558
5535
  }
5559
- function iy(e5, t2) {
5536
+ function ry(e5, t2) {
5560
5537
  let n2 = e5.workingHoursLocationCoverage;
5561
5538
  return { staffMemberId: e5.staffMemberId ?? ``, name: e5.name ?? null, image: null, isSelected: t2 === e5.staffMemberId, ...n2 ? { locationCoverage: { availableAtAllLocations: n2.availableAtAllLocations ?? false, locationIds: n2.locationIds ?? [] } } : {} };
5562
5539
  }
5563
- var ay = [];
5564
- var oy = (e5) => (e5.recurrenceRule?.days ?? []).map((e6) => ({ day: e6 }));
5565
- function sy(e5) {
5566
- let t2 = e5.flatMap(oy);
5567
- return t2.length === 0 ? ay : t2;
5540
+ var iy = [];
5541
+ var ay = (e5) => (e5.recurrenceRule?.days ?? []).map((e6) => ({ day: e6 }));
5542
+ function oy(e5) {
5543
+ let t2 = e5.flatMap(ay);
5544
+ return t2.length === 0 ? iy : t2;
5568
5545
  }
5569
- function cy(e5, t2) {
5546
+ function sy(e5, t2) {
5570
5547
  return t2 === void 0 ? false : !e5 || new Date(e5).getTime() <= t2;
5571
5548
  }
5572
- function ly(e5) {
5549
+ function cy(e5) {
5573
5550
  return e5 !== null && e5 <= 0;
5574
5551
  }
5575
- function uy({ lastSessionEnd: e5, masterEvents: t2, now: n2 }) {
5576
- if (cy(e5, n2)) return null;
5552
+ function ly({ lastSessionEnd: e5, masterEvents: t2, now: n2 }) {
5553
+ if (sy(e5, n2)) return null;
5577
5554
  let r2 = t2[0];
5578
5555
  return r2 ? { totalCapacity: r2.totalCapacity ?? null, remainingCapacity: r2.remainingCapacity ?? null } : null;
5579
5556
  }
5580
- var dy = (e5, t2) => !e5 || new Date(e5).getTime() <= t2;
5581
- var fy = 6e4;
5582
- function py(e5, t2) {
5557
+ var uy = (e5, t2) => !e5 || new Date(e5).getTime() <= t2;
5558
+ var dy = 6e4;
5559
+ function fy(e5, t2) {
5583
5560
  if (t2 === void 0) return false;
5584
5561
  let n2 = e5.bookingPolicy?.bookAfterStartPolicy?.enabled, r2 = e5.schedule?.firstSessionStart ?? null, i2 = e5.schedule?.lastSessionEnd ?? null, a2 = false;
5585
5562
  if (!n2 && r2 && e5.bookingPolicy?.limitLateBookingPolicy?.enabled) {
5586
5563
  let n3 = e5.bookingPolicy.limitLateBookingPolicy.latestBookingInMinutes ?? 0;
5587
- a2 = t2 >= new Date(r2).getTime() - n3 * fy;
5564
+ a2 = t2 >= new Date(r2).getTime() - n3 * dy;
5588
5565
  }
5589
- let o2 = Um(e5.type) && dy(i2, t2), s2 = dy(r2, t2);
5566
+ let o2 = Um(e5.type) && uy(i2, t2), s2 = uy(r2, t2);
5590
5567
  return o2 || s2 && !n2 || a2;
5591
5568
  }
5592
- function my(e5) {
5569
+ function py(e5) {
5593
5570
  return Um(e5.serviceType) && (e5.courseFull || e5.tooLateToBook) ? Yc.VIEW_COURSE : e5.requireManualApproval ? Yc.REQUEST_TO_BOOK : Yc.BOOK;
5594
5571
  }
5595
- function hy(e5, t2) {
5572
+ function my(e5, t2) {
5596
5573
  let n2 = e5?.value, r2 = e5?.currency;
5597
5574
  if (n2 == null || !r2) return null;
5598
5575
  let i2 = Number(n2);
@@ -5600,48 +5577,46 @@ function hy(e5, t2) {
5600
5577
  let a2 = i2 % 1 == 0 ? 0 : 2;
5601
5578
  return new Intl.NumberFormat(t2, { style: `currency`, currency: r2, currencyDisplay: `symbol`, maximumFractionDigits: a2, minimumFractionDigits: a2 }).format(i2).replace(/\p{Zs}/gu, `\xA0`);
5602
5579
  }
5603
- function gy(e5, t2) {
5580
+ function hy(e5, t2) {
5604
5581
  return (t2.getUTCFullYear() - e5.getUTCFullYear()) * 12 + (t2.getUTCMonth() - e5.getUTCMonth());
5605
5582
  }
5606
- function _y(e5, t2) {
5583
+ function gy(e5, t2) {
5607
5584
  let n2 = e5?.totalPayments;
5608
5585
  if (n2 == null) return null;
5609
5586
  let r2 = e5?.recurringStartDate;
5610
5587
  if (!r2 || t2 === void 0) return n2;
5611
5588
  let i2 = new Date(r2), a2 = new Date(t2);
5612
- return Number.isNaN(i2.getTime()) || a2 < i2 ? n2 : Math.max(1, n2 - gy(i2, a2));
5589
+ return Number.isNaN(i2.getTime()) || a2 < i2 ? n2 : Math.max(1, n2 - hy(i2, a2));
5613
5590
  }
5614
- var { RateType: vy, FrequencyType: yy } = fu;
5615
- var by = { rateType: null, price: null, priceAfterDiscount: null, discountName: null, calculatedAtCheckout: false, subscriptionFrequency: null, remainingPayments: null, isFree: false };
5616
- function xy(e5) {
5591
+ var { RateType: _y, FrequencyType: vy } = fu;
5592
+ var yy = { rateType: null, price: null, priceAfterDiscount: null, discountName: null, calculatedAtCheckout: false, subscriptionFrequency: null, remainingPayments: null, isFree: false };
5593
+ function by(e5) {
5617
5594
  if (e5 == null || e5 === ``) return false;
5618
5595
  let t2 = Number(e5);
5619
5596
  return Number.isFinite(t2) && t2 === 0;
5620
5597
  }
5621
- function Sy(e5, t2, n2 = {}) {
5598
+ function xy(e5, t2, n2 = {}) {
5622
5599
  let r2 = e5?.payment;
5623
- if (!r2) return by;
5600
+ if (!r2) return yy;
5624
5601
  let i2 = r2.rateType ?? null, a2 = null;
5625
5602
  switch (i2) {
5626
- case vy.FIXED:
5627
- a2 = hy(r2.fixed?.price, t2);
5603
+ case _y.FIXED:
5604
+ a2 = my(r2.fixed?.price, t2);
5628
5605
  break;
5629
- case vy.VARIED:
5630
- a2 = hy(r2.varied?.minPrice, t2);
5606
+ case _y.VARIED:
5607
+ a2 = my(r2.varied?.minPrice, t2);
5631
5608
  break;
5632
- case vy.CUSTOM:
5609
+ case _y.CUSTOM:
5633
5610
  a2 = r2.custom?.description ?? null;
5634
5611
  break;
5635
- case vy.SUBSCRIPTION:
5636
- a2 = hy(r2.subscription?.amountPerBillingCycle, t2);
5612
+ case _y.SUBSCRIPTION:
5613
+ a2 = my(r2.subscription?.amountPerBillingCycle, t2);
5637
5614
  }
5638
- let o2 = !(r2.pricingPlanIds?.length || r2.options?.pricingPlan) && (i2 === vy.NO_FEE || i2 === vy.FIXED && xy(r2.fixed?.price?.value)), s2 = !!n2.subscriptionPayment && i2 === vy.SUBSCRIPTION, c2 = s2 && !n2.monthlyDiscounts ? void 0 : r2.discountInfo ?? void 0, l2 = c2?.discountName ?? null, u2 = l2 && (i2 === vy.FIXED || s2) ? hy(c2?.priceAfterDiscount, t2) : null, d2 = s2 && r2.subscription?.frequency === yy.MONTHLY ? _y(r2.subscription, n2.now) : null;
5615
+ let o2 = !(r2.pricingPlanIds?.length || r2.options?.pricingPlan) && (i2 === _y.NO_FEE || i2 === _y.FIXED && by(r2.fixed?.price?.value)), s2 = !!n2.subscriptionPayment && i2 === _y.SUBSCRIPTION, c2 = s2 && !n2.monthlyDiscounts ? void 0 : r2.discountInfo ?? void 0, l2 = c2?.discountName ?? null, u2 = l2 && (i2 === _y.FIXED || s2) ? my(c2?.priceAfterDiscount, t2) : null, d2 = s2 && r2.subscription?.frequency === vy.MONTHLY ? gy(r2.subscription, n2.now) : null;
5639
5616
  return { rateType: i2, price: a2, priceAfterDiscount: u2, discountName: l2, calculatedAtCheckout: !!l2 && !u2, subscriptionFrequency: r2.subscription?.frequency ?? null, remainingPayments: d2, isFree: o2 };
5640
5617
  }
5641
- var Cy = (e5) => {
5642
- let t2 = (e6) => e6 < 10 ? `0${e6}` : `${e6}`;
5643
- return `${e5.getFullYear()}-${t2(e5.getMonth() + 1)}-${t2(e5.getDate())}`;
5644
- };
5618
+ var Sy = (e5) => e5 < 10 ? `0${e5}` : `${e5}`;
5619
+ var Cy = (e5) => `${e5.getFullYear()}-${Sy(e5.getMonth() + 1)}-${Sy(e5.getDate())}`;
5645
5620
  var wy = (e5, t2) => new Intl.DateTimeFormat(`en-CA`, { year: `numeric`, month: `2-digit`, day: `2-digit`, ...t2 ? { timeZone: t2 } : {} }).format(e5);
5646
5621
  var Ty = (e5) => `${Cy(e5)}T00:00:00`;
5647
5622
  function Ey(e5, t2) {
@@ -5652,17 +5627,17 @@ function Ey(e5, t2) {
5652
5627
  return a2 === 0 ? n2.format(i2) : `${n2.format(i2)} ${r2.format(a2)}`;
5653
5628
  }
5654
5629
  function Dy(e5) {
5655
- return e5 ? ry(e5).filter((e6) => e6.staffMemberId).map((e6) => {
5656
- let { staffMemberId: t2, name: n2, image: r2 } = iy(e6, null);
5630
+ return e5 ? ny(e5).filter((e6) => e6.staffMemberId).map((e6) => {
5631
+ let { staffMemberId: t2, name: n2, image: r2 } = ry(e6, null);
5657
5632
  return { staffMemberId: t2, name: n2, image: r2 };
5658
5633
  }) : [];
5659
5634
  }
5660
5635
  function Oy(e5, t2, n2) {
5661
- return Um(e5?.type) ? uy({ lastSessionEnd: e5?.schedule?.lastSessionEnd, masterEvents: t2, now: n2 }) : null;
5636
+ return Um(e5?.type) ? ly({ lastSessionEnd: e5?.schedule?.lastSessionEnd, masterEvents: t2, now: n2 }) : null;
5662
5637
  }
5663
5638
  function ky({ service: e5, masterEvents: t2, locale: n2, timeZone: r2, now: i2, servicePriceOptions: a2 }) {
5664
- let o2 = Oy(e5, t2, i2), s2 = t2[0]?.timeZone ?? r2 ?? `UTC`, c2 = ny({ service: e5, courseRemainingCapacity: o2?.remainingCapacity ?? null, now: i2 }), l2 = e5?.bookingPolicy?.customPolicyDescription;
5665
- return { serviceId: e5?._id ?? null, serviceSlug: e5?.mainSlug?.name ?? null, serviceName: e5?.name ?? null, serviceDescription: e5?.description ?? null, serviceTagLine: e5?.tagLine ?? null, serviceType: e5?.type ?? null, serviceDefaultDuration: e5 ? Ey(Qm(e5), n2) : null, serviceImage: e5 ? Kv(e5) : null, serviceCtaState: my({ serviceType: e5?.type ?? null, requireManualApproval: !!e5?.onlineBooking?.requireManualApproval, courseFull: ly(o2?.remainingCapacity ?? null), tooLateToBook: e5 ? py(e5, i2) : false }), servicePrice: Sy(e5, n2, { ...a2, now: i2 }), isVariedService: e5 ? Wm(e5) : false, hasAddOns: e5 ? Km(e5) : false, isConferenceEnabled: !!e5?.conferencing?.enabled, offeredDays: sy(t2), courseAvailability: o2, courseStartDate: e5?.schedule?.firstSessionStart ? wy(new Date(e5.schedule.firstSessionStart), s2) : null, courseEndDate: e5?.schedule?.lastSessionEnd ? wy(new Date(e5.schedule.lastSessionEnd), s2) : null, staffMembers: Dy(e5), coverImage: e5 ? qv(e5) : void 0, gallery: rv(e5), serviceLocations: Xv(e5), policyDescription: l2?.enabled ? l2.description ?? null : null, serviceBookability: c2, displayTimeZone: s2 };
5639
+ let o2 = Oy(e5, t2, i2), s2 = t2[0]?.timeZone ?? r2 ?? `UTC`, c2 = ty({ service: e5, courseRemainingCapacity: o2?.remainingCapacity ?? null, now: i2 }), l2 = e5?.bookingPolicy?.customPolicyDescription;
5640
+ return { serviceId: e5?._id ?? null, serviceSlug: e5?.mainSlug?.name ?? null, serviceName: e5?.name ?? null, serviceDescription: e5?.description ?? null, serviceTagLine: e5?.tagLine ?? null, serviceType: e5?.type ?? null, serviceDefaultDuration: e5 ? Ey(Qm(e5), n2) : null, serviceImage: e5 ? Gv(e5) : null, serviceCtaState: py({ serviceType: e5?.type ?? null, requireManualApproval: !!e5?.onlineBooking?.requireManualApproval, courseFull: cy(o2?.remainingCapacity ?? null), tooLateToBook: e5 ? fy(e5, i2) : false }), servicePrice: xy(e5, n2, { ...a2, now: i2 }), isVariedService: e5 ? Wm(e5) : false, hasAddOns: e5 ? Km(e5) : false, isConferenceEnabled: !!e5?.conferencing?.enabled, offeredDays: oy(t2), courseAvailability: o2, courseStartDate: e5?.schedule?.firstSessionStart ? wy(new Date(e5.schedule.firstSessionStart), s2) : null, courseEndDate: e5?.schedule?.lastSessionEnd ? wy(new Date(e5.schedule.lastSessionEnd), s2) : null, staffMembers: Dy(e5), coverImage: e5 ? Kv(e5) : void 0, gallery: rv(e5), serviceLocations: Yv(e5), policyDescription: l2?.enabled ? l2.description ?? null : null, serviceBookability: c2, displayTimeZone: s2 };
5666
5641
  }
5667
5642
  function Ay({ serviceCtaState: e5, courseAvailability: t2, serviceBookability: n2, servicePrice: r2 }) {
5668
5643
  return `${r2.remainingPayments}|${e5}|${t2?.totalCapacity ?? `-`}|${t2?.remainingCapacity ?? `-`}|${t2 === null}|${n2.state}|${n2.isAvailableForBooking}`;
@@ -5873,7 +5848,7 @@ function jb(e5, { locale: t2, staffMembers: n2 = [], businessLocations: r2 = []
5873
5848
  if (!i2) return null;
5874
5849
  let a2 = Ob(n2), o2 = kb(r2), s2 = (e5?.variants?.values ?? []).map((e6) => {
5875
5850
  let n3 = e6.choices?.[0];
5876
- return { choiceId: n3 ? Eb(n3) : null, label: n3 ? Db(n3, t2, a2, o2) : null, price: hy(e6.price, t2), priceAmount: e6.price?.value ?? null, durationMinutes: n3?.duration?.minutes ?? null, durationName: n3?.duration?.name ?? null, businessLocationId: n3?.businessLocationId ?? null };
5851
+ return { choiceId: n3 ? Eb(n3) : null, label: n3 ? Db(n3, t2, a2, o2) : null, price: my(e6.price, t2), priceAmount: e6.price?.value ?? null, durationMinutes: n3?.duration?.minutes ?? null, durationName: n3?.duration?.name ?? null, businessLocationId: n3?.businessLocationId ?? null };
5877
5852
  });
5878
5853
  return { optionId: i2._id ?? null, type: i2.type ?? null, name: i2.customData?.name || i2.durationData?.name || null, choices: s2 };
5879
5854
  }
@@ -5995,7 +5970,7 @@ function ox(e5) {
5995
5970
  }
5996
5971
  function sx() {
5997
5972
  let e5 = ox(ax()), t2 = typeof window > `u`;
5998
- return { scope: e5 ?? void 0, get: async (n2) => {
5973
+ return l(() => ({ scope: e5 ?? void 0, get: async (n2) => {
5999
5974
  if (t2 || !e5) return null;
6000
5975
  try {
6001
5976
  return await e5.get(n2);
@@ -6007,7 +5982,7 @@ function sx() {
6007
5982
  e5.set(n2, r2);
6008
5983
  } catch {
6009
5984
  }
6010
- } };
5985
+ } }), [e5, t2]);
6011
5986
  }
6012
5987
  var cx = `bookings-uou`;
6013
5988
  function lx(e5) {
@@ -6124,46 +6099,68 @@ function Nx() {
6124
6099
  function Px(e5) {
6125
6100
  return e5 === Ax || e5 === `none` ? null : e5;
6126
6101
  }
6127
- var Fx = { displayTimeZonePolicy: { basedOn: Nm.BUSINESS_TIME_ZONE, customerCanChange: false }, multiServiceAppointmentsEnabled: false };
6128
- async function Ix() {
6102
+ var Fx = { bookable: true, staffChoiceRequired: false, rescheduleStaffId: null };
6103
+ var Ix = ({ timezone: e5 }) => e5 === void 0 ? Fx : { ...Fx, timezone: e5 };
6104
+ function Lx(e5) {
6105
+ return { selection: e5, pick: Fx };
6106
+ }
6107
+ function Rx(e5, t2) {
6108
+ return { selection: t2, pick: Ix(e5.pick) };
6109
+ }
6110
+ function zx(e5, t2) {
6111
+ let n2 = t2(e5.selection);
6112
+ return n2 === e5.selection ? e5 : { ...e5, selection: n2 };
6113
+ }
6114
+ function Bx(e5, t2, n2) {
6115
+ let r2 = L_(e5.selection, t2);
6116
+ return { selection: n2?.staffId === void 0 ? r2 : S_(r2, n2.staffId), pick: { timezone: n2?.timezone || e5.pick.timezone, bookable: n2?.bookable ?? true, staffChoiceRequired: n2?.staffChoiceRequired ?? false, rescheduleStaffId: n2?.rescheduleStaffId ?? null } };
6117
+ }
6118
+ function Vx(e5, t2, { staffPriced: n2 }) {
6119
+ let r2 = z_(e5.selection, t2);
6120
+ if (!n2) return { selection: r2, pick: Ix(e5.pick) };
6121
+ let { selectedVariants: i2, durationChoiceId: a2, ...o2 } = r2;
6122
+ return { selection: { ...o2, ...t2.selectedVariants ? { selectedVariants: t2.selectedVariants } : {}, ...t2.durationChoiceId ? { durationChoiceId: t2.durationChoiceId } : {} }, pick: Ix(e5.pick) };
6123
+ }
6124
+ var Hx = { displayTimeZonePolicy: { basedOn: Nm.BUSINESS_TIME_ZONE, customerCanChange: false }, multiServiceAppointmentsEnabled: false };
6125
+ async function Ux() {
6129
6126
  try {
6130
6127
  let e5 = await Im();
6131
6128
  return { displayTimeZonePolicy: { basedOn: e5.displayTimeZone?.basedOn ?? Nm.BUSINESS_TIME_ZONE, customerCanChange: e5.displayTimeZone?.customerCanChange ?? false }, multiServiceAppointmentsEnabled: e5.multiServiceAppointments?.enabled ?? false };
6132
6129
  } catch (e5) {
6133
- return $o(e5, { feature: Zo.bookingsSettings, action: `fetch-bookings-settings`, level: `warning` }), Fx;
6130
+ return $o(e5, { feature: Zo.bookingsSettings, action: `fetch-bookings-settings`, level: `warning` }), Hx;
6134
6131
  }
6135
6132
  }
6136
- var Lx = { isLoading: true };
6137
- var Rx = n(null);
6138
- var zx = `useBookingsSettingsContext must be used within BookingsSettingsProvider`;
6139
- function Bx() {
6140
- let e5 = a(Rx);
6141
- if (!e5) throw Error(zx);
6133
+ var Wx = { isLoading: true };
6134
+ var Gx = n(null);
6135
+ var Kx = `useBookingsSettingsContext must be used within BookingsSettingsProvider`;
6136
+ function qx() {
6137
+ let e5 = a(Gx);
6138
+ if (!e5) throw Error(Kx);
6142
6139
  return e5;
6143
6140
  }
6144
- function Vx() {
6145
- return Bx().isLoading;
6141
+ function Jx() {
6142
+ return qx().isLoading;
6146
6143
  }
6147
- function Hx({ children: e5 }) {
6148
- return h(Rx.Provider, { value: Lx, children: e5 });
6144
+ function Yx({ children: e5 }) {
6145
+ return h(Gx.Provider, { value: Wx, children: e5 });
6149
6146
  }
6150
- function Ux(e5) {
6147
+ function Xx(e5) {
6151
6148
  return e5.basedOn === Nm.CUSTOMER_TIME_ZONE ? Intl.DateTimeFormat().resolvedOptions().timeZone : void 0;
6152
6149
  }
6153
- function Wx() {
6154
- let e5 = Bx();
6155
- return e5.isLoading ? void 0 : Ux(e5.displayTimeZonePolicy);
6150
+ function Zx() {
6151
+ let e5 = qx();
6152
+ return e5.isLoading ? void 0 : Xx(e5.displayTimeZonePolicy);
6156
6153
  }
6157
- function Gx({ settingsPromise: e5, children: t2 }) {
6154
+ function Qx({ settingsPromise: e5, children: t2 }) {
6158
6155
  let n2 = Os(e5), r2 = l(() => ({ isLoading: false, ...n2 }), [n2]);
6159
- return h(Rx.Provider, { value: r2, children: t2 });
6156
+ return h(Gx.Provider, { value: r2, children: t2 });
6160
6157
  }
6161
- function Kx({ bookingsSettings: e5, children: n2 }) {
6162
- let r2 = sx(), [i2] = d(() => e5 ? null : Tx({ key: mx(), warmupData: r2, fetchData: Ix }));
6163
- return e5 ? h(Rx.Provider, { value: { isLoading: false, ...e5 }, children: n2 }) : h(t, { fallback: h(Rx.Provider, { value: Lx, children: n2 }), children: h(Gx, { settingsPromise: i2, children: n2 }) });
6158
+ function $x({ bookingsSettings: e5, children: n2 }) {
6159
+ let r2 = sx(), [i2] = d(() => e5 ? null : Tx({ key: mx(), warmupData: r2, fetchData: Ux }));
6160
+ return e5 ? h(Gx.Provider, { value: { isLoading: false, ...e5 }, children: n2 }) : h(t, { fallback: h(Gx.Provider, { value: Wx, children: n2 }), children: h(Qx, { settingsPromise: i2, children: n2 }) });
6164
6161
  }
6165
- function qx({ isLoading: e5, hasError: t2, bookingsSettingsLoading: n2, rescheduleRequest: r2 = null, editingSurface: i2 = false, children: a2 }) {
6166
- let o2 = r2 ? { status: `loading`, booking: null, validUntil: null, planName: null } : null, s2 = { service: null, serviceName: null, serviceDescription: null, serviceTagLine: null, serviceDefaultDuration: null, serviceImage: null, serviceSlug: null, servicePageLink: null, serviceId: null, serviceType: null, servicePrice: by, isVariedService: false, serviceOptionsAndVariants: null, pricingOption: null, isLoadingServiceOptionsAndVariants: e5, hasAddOns: false, isConferenceEnabled: false, offeredDays: [], courseAvailability: null, courseStartDate: null, courseEndDate: null, staffMembers: [], coverImage: void 0, gallery: [], serviceLocations: [], policyDescription: null, serviceBookability: { state: Zv.AVAILABLE, isAvailableForBooking: false, bookingOpensAt: null }, displayTimeZone: `UTC`, isAvailableForBooking: () => false, hasPolicyDescription: () => false, hasCoverImage: () => false, hasGalleryImages: () => false, isVariantDuration: () => false, isLoading: e5, hasError: t2, locale: `en-US`, selectStaffMember: () => {
6162
+ function eS({ isLoading: e5, hasError: t2, bookingsSettingsLoading: n2, rescheduleRequest: r2 = null, editingSurface: i2 = false, children: a2 }) {
6163
+ let o2 = r2 ? { status: `loading`, booking: null, validUntil: null, planName: null } : null, s2 = { service: null, serviceName: null, serviceDescription: null, serviceTagLine: null, serviceDefaultDuration: null, serviceImage: null, serviceSlug: null, servicePageLink: null, serviceId: null, serviceType: null, servicePrice: yy, isVariedService: false, serviceOptionsAndVariants: null, pricingOption: null, isLoadingServiceOptionsAndVariants: e5, hasAddOns: false, isConferenceEnabled: false, offeredDays: [], courseAvailability: null, courseStartDate: null, courseEndDate: null, staffMembers: [], coverImage: void 0, gallery: [], serviceLocations: [], policyDescription: null, serviceBookability: { state: Xv.AVAILABLE, isAvailableForBooking: false, bookingOpensAt: null }, displayTimeZone: `UTC`, isAvailableForBooking: () => false, hasPolicyDescription: () => false, hasCoverImage: () => false, hasGalleryImages: () => false, isVariantDuration: () => false, isLoading: e5, hasError: t2, locale: `en-US`, selectStaffMember: () => {
6167
6164
  }, clearSelection: () => {
6168
6165
  }, clearStaffMember: () => {
6169
6166
  }, selection: u_(``), isSelectionPending: e5, selectionTimezone: void 0, setVariant: () => {
@@ -6178,90 +6175,90 @@ function qx({ isLoading: e5, hasError: t2, bookingsSettingsLoading: n2, reschedu
6178
6175
  }, navigateToMultiServiceForm: () => {
6179
6176
  }, resolveNextPageHref: () => null, isNavigating: false, isWaitlistSlotSelected: false, siteId: ``, editingSurface: i2, openPreferences: () => Promise.resolve(), multiServiceAppointmentsEnabled: false, isMultiServiceAppointment: false, multiServiceAppointmentServices: [], multiServiceAppointmentSelections: [], multiServiceAppointmentOptionsAndVariants: {}, multiServiceAppointmentVariantsStatus: `ready`, bookingsSettingsLoading: n2, reschedule: o2, rescheduleBooking: async () => ({ outcome: `failed` }), goHomeAfterReschedule: () => {
6180
6177
  }, canRescheduleToPick: false };
6181
- return h(kS.Provider, { value: s2, children: a2 });
6178
+ return h(IS.Provider, { value: s2, children: a2 });
6182
6179
  }
6183
- function Jx({ rescheduleRequest: e5, editingSurface: t2, children: n2 }) {
6184
- return h(Hx, { children: h(qx, { isLoading: true, hasError: false, bookingsSettingsLoading: true, rescheduleRequest: e5, editingSurface: t2, children: n2 }) });
6180
+ function tS({ rescheduleRequest: e5, editingSurface: t2, children: n2 }) {
6181
+ return h(Yx, { children: h(eS, { isLoading: true, hasError: false, bookingsSettingsLoading: true, rescheduleRequest: e5, editingSurface: t2, children: n2 }) });
6185
6182
  }
6186
- function Yx({ rescheduleRequest: e5, editingSurface: t2, children: n2 }) {
6187
- let r2 = Vx();
6188
- return h(qx, { isLoading: false, hasError: true, bookingsSettingsLoading: r2, rescheduleRequest: e5, editingSurface: t2, children: n2 });
6183
+ function nS({ rescheduleRequest: e5, editingSurface: t2, children: n2 }) {
6184
+ let r2 = Jx();
6185
+ return h(eS, { isLoading: false, hasError: true, bookingsSettingsLoading: r2, rescheduleRequest: e5, editingSurface: t2, children: n2 });
6189
6186
  }
6190
- var { RateType: Xx } = fu;
6191
- function Zx(e5, t2) {
6187
+ var { RateType: rS } = fu;
6188
+ function iS(e5, t2) {
6192
6189
  if (e5) return t2 ? nb(e5, t2)?.toISOString() ?? e5 : e5;
6193
6190
  }
6194
- var Qx = { BUSINESS: `OWNER_BUSINESS`, CUSTOM: `OWNER_CUSTOM`, CUSTOMER: `CUSTOM` };
6195
- function $x(e5) {
6196
- return e5 ? Qx[e5] : Qx.BUSINESS;
6191
+ var aS = { BUSINESS: `OWNER_BUSINESS`, CUSTOM: `OWNER_CUSTOM`, CUSTOMER: `CUSTOM` };
6192
+ function oS(e5) {
6193
+ return e5 ? aS[e5] : aS.BUSINESS;
6197
6194
  }
6198
- function eS(e5, t2) {
6195
+ function sS(e5, t2) {
6199
6196
  let n2 = x_(e5), r2 = n2 && !n2.anyResource ? n2.staffMemberId : null;
6200
- return { serviceId: e5.serviceId, scheduleId: e5.scheduleId, startDate: Zx(e5.slotStart, t2), endDate: Zx(e5.slotEnd, t2), timezone: t2, eventId: e5.eventId, sessionId: e5.sessionId, location: e5.locationId || e5.locationType ? { ...e5.locationId ? { _id: e5.locationId } : {}, locationType: $x(e5.locationType) } : void 0, resource: r2 ? { _id: r2 } : void 0, resourceSelections: !r2 && Vm(e5.serviceType) ? [{ resourceTypeId: zs, selectionMethod: `ANY_RESOURCE`, ...n2?.anyResource && e5.requestedGender ? { requestedGender: { gender: e5.requestedGender } } : {} }] : void 0 };
6197
+ return { serviceId: e5.serviceId, scheduleId: e5.scheduleId, startDate: iS(e5.slotStart, t2), endDate: iS(e5.slotEnd, t2), timezone: t2, eventId: e5.eventId, sessionId: e5.sessionId, location: e5.locationId || e5.locationType ? { ...e5.locationId ? { _id: e5.locationId } : {}, locationType: oS(e5.locationType) } : void 0, resource: r2 ? { _id: r2 } : void 0, resourceSelections: !r2 && Vm(e5.serviceType) ? [{ resourceTypeId: zs, selectionMethod: `ANY_RESOURCE`, ...n2?.anyResource && e5.requestedGender ? { requestedGender: { gender: e5.requestedGender } } : {} }] : void 0 };
6201
6198
  }
6202
- var tS = `manage_booking_standalone_page`;
6203
- function nS(e5) {
6199
+ var cS = `manage_booking_standalone_page`;
6200
+ function lS(e5) {
6204
6201
  let t2 = e5.get(i_.bookingId) || null, n2 = e5.get(i_.token) || null;
6205
- return !t2 && !n2 ? null : { bookingId: t2, token: n2, fromManageBookingPage: e5.get(i_.referral) === tS, redirectUrl: e5.get(i_.rescheduleRedirectUrl) || null };
6202
+ return !t2 && !n2 ? null : { bookingId: t2, token: n2, fromManageBookingPage: e5.get(i_.referral) === cS, redirectUrl: e5.get(i_.rescheduleRedirectUrl) || null };
6206
6203
  }
6207
- function rS(e5, t2, n2, r2 = null) {
6204
+ function uS(e5, t2, n2, r2 = null) {
6208
6205
  if (n2.kind === `class`) return { eventId: e5.eventId };
6209
- let { serviceId: i2, scheduleId: a2, startDate: o2, endDate: s2, location: c2, resource: l2, resourceSelections: u2 } = eS(e5, t2);
6206
+ let { serviceId: i2, scheduleId: a2, startDate: o2, endDate: s2, location: c2, resource: l2, resourceSelections: u2 } = sS(e5, t2);
6210
6207
  return { serviceId: i2, scheduleId: a2, startDate: o2, endDate: s2, timezone: t2, ...c2 ? { location: { ...c2._id ? { _id: c2._id } : {}, locationType: c2.locationType, ...n2.customAddress !== null && c2.locationType === `CUSTOM` ? { formattedAddress: n2.customAddress } : {} } } : {}, ...l2?._id ? { resource: { _id: l2._id } } : r2 ? { resource: { _id: r2 } } : u2 ? { resourceSelections: u2 } : {} };
6211
6208
  }
6212
- var iS = class extends Error {
6209
+ var dS = class extends Error {
6213
6210
  reason;
6214
6211
  cause;
6215
6212
  constructor(e5, t2) {
6216
6213
  super(`Booking to reschedule not loaded: ${e5}`), this.reason = e5, this.cause = t2;
6217
6214
  }
6218
6215
  };
6219
- var aS = (e5) => e5?.status;
6220
- function oS(e5) {
6216
+ var fS = (e5) => e5?.status;
6217
+ function pS(e5) {
6221
6218
  return e5?.includes(`INDIVIDUAL`) ? `appointment` : e5?.includes(`GROUP`) ? `class` : `other`;
6222
6219
  }
6223
- function sS({ totalParticipants: e5, participantsChoices: t2 }) {
6220
+ function mS({ totalParticipants: e5, participantsChoices: t2 }) {
6224
6221
  return e5 || (t2?.serviceChoices ?? []).reduce((e6, t3) => e6 + (t3.numberOfParticipants ?? 1), 0) || 1;
6225
6222
  }
6226
- function cS(e5) {
6223
+ function hS(e5) {
6227
6224
  if (!e5) return null;
6228
6225
  let t2 = new Date(e5);
6229
6226
  return Number.isNaN(t2.getTime()) ? null : t2.toISOString();
6230
6227
  }
6231
- function lS(e5, t2) {
6228
+ function gS(e5, t2) {
6232
6229
  let { slot: n2, schedule: r2, tags: i2 } = e5.bookedEntity ?? {}, a2 = n2?.location;
6233
- return { bookingId: t2, revision: e5.revision ?? null, serviceId: n2?.serviceId ?? r2?.serviceId ?? null, kind: oS(i2), startDate: cS(e5.startDate), participants: sS(e5), addOnIds: (e5.bookedAddOns ?? []).flatMap((e6) => e6._id ?? []), locationId: a2?._id ?? null, customAddress: a2?.locationType === `CUSTOM` ? a2.formattedAddress ?? `` : null };
6230
+ return { bookingId: t2, revision: e5.revision ?? null, serviceId: n2?.serviceId ?? r2?.serviceId ?? null, kind: pS(i2), startDate: hS(e5.startDate), participants: mS(e5), addOnIds: (e5.bookedAddOns ?? []).flatMap((e6) => e6._id ?? []), locationId: a2?._id ?? null, customAddress: a2?.locationType === `CUSTOM` ? a2.formattedAddress ?? `` : null };
6234
6231
  }
6235
- async function uS({ bookingId: e5, token: t2 }) {
6232
+ async function _S({ bookingId: e5, token: t2 }) {
6236
6233
  let n2;
6237
6234
  try {
6238
6235
  t2 ? n2 = (await Em(t2)).booking : e5 && (n2 = (await eu({ filter: { _id: e5 }, cursorPaging: { limit: 1 } }, {})).extendedBookings?.[0]?.booking);
6239
6236
  } catch (e6) {
6240
- let t3 = aS(e6);
6241
- throw t3 === 404 ? new iS(`notFound`, e6) : new iS(t3 === 403 ? `accessDenied` : `failed`, e6);
6237
+ let t3 = fS(e6);
6238
+ throw t3 === 404 ? new dS(`notFound`, e6) : new dS(t3 === 403 ? `accessDenied` : `failed`, e6);
6242
6239
  }
6243
6240
  let r2 = n2?._id;
6244
- if (!n2 || !r2) throw new iS(`notFound`);
6245
- let i2 = lS(n2, r2);
6241
+ if (!n2 || !r2) throw new dS(`notFound`);
6242
+ let i2 = gS(n2, r2);
6246
6243
  return t2 ? { ...i2, customAddress: null } : i2;
6247
6244
  }
6248
- function dS(e5) {
6245
+ function vS(e5) {
6249
6246
  let t2 = e5?.bookedEntity?.slot;
6250
6247
  return { staffName: t2?.resource?.name || null, locationName: t2?.location?.name || t2?.location?.formattedAddress || null };
6251
6248
  }
6252
- async function fS({ booking: e5, slot: t2, token: n2 }) {
6253
- return dS(n2 ? (await Tm(n2, t2, { revision: e5.revision || `1` })).booking : (await Dm(e5.bookingId, t2, { revision: e5.revision ?? `` })).booking);
6249
+ async function yS({ booking: e5, slot: t2, token: n2 }) {
6250
+ return vS(n2 ? (await Tm(n2, t2, { revision: e5.revision || `1` })).booking : (await Dm(e5.bookingId, t2, { revision: e5.revision ?? `` })).booking);
6254
6251
  }
6255
- var pS = { validUntil: null, planName: null };
6256
- async function mS(e5) {
6252
+ var bS = { validUntil: null, planName: null };
6253
+ async function xS(e5) {
6257
6254
  try {
6258
6255
  let t2 = (await eu({ filter: { _id: e5 }, cursorPaging: { limit: 1 } }, { withEcomTransactions: true })).extendedBookings?.[0]?.transactions?.chargedMembershipPaymentDetails;
6259
- return t2 ? { validUntil: t2.expirationDate ? new Date(t2.expirationDate).toISOString() : null, planName: t2.name?.translated || t2.name?.original || null } : pS;
6256
+ return t2 ? { validUntil: t2.expirationDate ? new Date(t2.expirationDate).toISOString() : null, planName: t2.name?.translated || t2.name?.original || null } : bS;
6260
6257
  } catch (e6) {
6261
- return $o(e6, { feature: Zo.reschedule, action: `fetch-plan-valid-until`, level: `warning` }), pS;
6258
+ return $o(e6, { feature: Zo.reschedule, action: `fetch-plan-valid-until`, level: `warning` }), bS;
6262
6259
  }
6263
6260
  }
6264
- function hS() {
6261
+ function SS() {
6265
6262
  let e5 = gs();
6266
6263
  return i(() => {
6267
6264
  if (!e5) return null;
@@ -6272,26 +6269,26 @@ function hS() {
6272
6269
  }
6273
6270
  }, [e5]);
6274
6271
  }
6275
- var gS = ns(`@wix/viewer-service-site-members`);
6276
- function _S() {
6272
+ var CS = ns(`@wix/viewer-service-site-members`);
6273
+ function wS() {
6277
6274
  try {
6278
6275
  return p();
6279
6276
  } catch {
6280
6277
  return null;
6281
6278
  }
6282
6279
  }
6283
- function vS(e5) {
6280
+ function TS(e5) {
6284
6281
  try {
6285
- return e5 ? e5(gS) : null;
6282
+ return e5 ? e5(CS) : null;
6286
6283
  } catch {
6287
6284
  return null;
6288
6285
  }
6289
6286
  }
6290
- function yS() {
6291
- return vS(_S());
6287
+ function ES() {
6288
+ return TS(wS());
6292
6289
  }
6293
- var bS = typeof window > `u` ? s : c;
6294
- function xS(e5) {
6290
+ var DS = typeof window > `u` ? s : c;
6291
+ function OS(e5) {
6295
6292
  if (!e5) return null;
6296
6293
  try {
6297
6294
  let t2 = new URL(e5);
@@ -6300,335 +6297,315 @@ function xS(e5) {
6300
6297
  return null;
6301
6298
  }
6302
6299
  }
6303
- function SS(e5, { bookable: t2, staffChoiceRequired: n2, timezone: r2, validUntil: i2 }) {
6300
+ function kS(e5, { bookable: t2, staffChoiceRequired: n2, timezone: r2, validUntil: i2 }) {
6304
6301
  if (!I_(e5) || !t2) return false;
6305
6302
  let a2 = x_(e5);
6306
6303
  if (n2 && (!a2 || a2.anyResource)) return false;
6307
6304
  let o2 = e5.slotStart ? nb(e5.slotStart, r2) : null;
6308
6305
  return !i2 || !o2 || o2.getTime() <= Date.parse(i2);
6309
6306
  }
6310
- var CS = { validUntil: null, planName: null };
6311
- var wS = { status: `loading`, booking: null, ...CS };
6312
- async function TS(e5) {
6307
+ var AS = { validUntil: null, planName: null };
6308
+ var jS = { status: `loading`, booking: null, ...AS };
6309
+ async function MS(e5) {
6313
6310
  return e5.getMemberDetails ? !!await e5.getMemberDetails().catch(() => null) : !!e5.isInitiallyLoggedIn;
6314
6311
  }
6315
- async function ES(e5, t2) {
6312
+ async function NS(e5, t2) {
6316
6313
  let { bookingId: n2, token: r2 } = e5;
6317
- if (!r2 && !(t2 && await TS(t2)) && !(t2 && await t2.promptLogin({ mode: `login` }).then(() => true, () => false))) return { status: `loginRequired`, booking: null, ...CS };
6314
+ if (!r2 && !(t2 && await MS(t2)) && !(t2 && await t2.promptLogin({ mode: `login` }).then(() => true, () => false))) return { status: `loginRequired`, booking: null, ...AS };
6318
6315
  try {
6319
- let [t3, i2] = await Promise.all([uS(e5), n2 && !r2 ? mS(n2) : CS]);
6316
+ let [t3, i2] = await Promise.all([_S(e5), n2 && !r2 ? xS(n2) : AS]);
6320
6317
  return { status: `ready`, booking: t3, validUntil: i2.validUntil, planName: i2.planName };
6321
6318
  } catch (e6) {
6322
- return $o(e6, { feature: Zo.reschedule, action: `fetch-booking` }), { status: e6 instanceof iS ? e6.reason : `failed`, booking: null, ...CS };
6319
+ return $o(e6, { feature: Zo.reschedule, action: `fetch-booking` }), { status: e6 instanceof dS ? e6.reason : `failed`, booking: null, ...AS };
6323
6320
  }
6324
6321
  }
6325
- var DS = /* @__PURE__ */ new Map();
6326
- function OS(e5, t2, n2) {
6327
- let r2 = `${e5.bookingId ?? ``}|${e5.token ?? ``}`, i2 = DS.get(r2) ?? { load: ES(e5, t2), users: 0 };
6328
- return i2.users += 1, DS.set(r2, i2), i2.load.then(n2), () => {
6329
- --i2.users, i2.users === 0 && DS.get(r2) === i2 && DS.delete(r2);
6322
+ var PS = /* @__PURE__ */ new Map();
6323
+ function FS(e5, t2, n2) {
6324
+ let r2 = `${e5.bookingId ?? ``}|${e5.token ?? ``}`, i2 = PS.get(r2) ?? { load: NS(e5, t2), users: 0 };
6325
+ return i2.users += 1, PS.set(r2, i2), i2.load.then(n2), () => {
6326
+ --i2.users, i2.users === 0 && PS.get(r2) === i2 && PS.delete(r2);
6330
6327
  };
6331
6328
  }
6332
- var kS = n(null);
6333
- var AS = `useServiceContext must be used within ServiceContextProvider`;
6334
- function jS(e5 = false) {
6335
- let t2 = a(kS);
6336
- if (!t2 && !e5) throw Error(AS);
6329
+ var IS = n(null);
6330
+ var LS = `useServiceContext must be used within ServiceContextProvider`;
6331
+ function RS(e5 = false) {
6332
+ let t2 = a(IS);
6333
+ if (!t2 && !e5) throw Error(LS);
6337
6334
  return t2;
6338
6335
  }
6339
- function MS(e5, t2, n2) {
6336
+ function zS(e5, t2, n2) {
6340
6337
  if (e5) return { by: `slug`, value: e5 };
6341
6338
  let r2 = t2?.services ?? [];
6342
6339
  return o_(t2) ? { by: `multi`, serviceIds: r2.map(({ serviceId: e6 }) => e6) } : r2.length === 1 ? { by: `id`, value: r2[0].serviceId } : n2 ? { by: `id`, value: n2 } : { by: `none` };
6343
6340
  }
6344
- var NS = (e5) => void 0;
6345
- var PS = Symbol(`unseeded`);
6346
- var FS = (e5, t2) => r_(a_(t2))?.services.find((t3) => t3.serviceId === e5);
6347
- var IS = (e5, t2) => {
6348
- let n2 = FS(e5, t2) ?? u_(e5), r2 = NS(e5);
6341
+ var BS = (e5) => void 0;
6342
+ var VS = Symbol(`unseeded`);
6343
+ var HS = (e5, t2) => r_(a_(t2))?.services.find((t3) => t3.serviceId === e5);
6344
+ var US = (e5, t2) => {
6345
+ let n2 = HS(e5, t2) ?? u_(e5), r2 = BS(e5);
6349
6346
  return r2 === void 0 ? n2 : S_(n2, r2);
6350
6347
  };
6351
- var LS = (e5, t2) => {
6352
- let n2 = IS(e5, t2), r2 = t2.get(i_.resource), i2 = NS(e5) !== void 0 || !!FS(e5, t2);
6348
+ var WS = (e5, t2) => {
6349
+ let n2 = US(e5, t2), r2 = t2.get(i_.resource), i2 = BS(e5) !== void 0 || !!HS(e5, t2);
6353
6350
  return r2 && !i2 ? S_(n2, r2) : n2;
6354
6351
  };
6355
- function RS(e5, t2) {
6352
+ function GS(e5, t2) {
6356
6353
  return !e5 || !t2 || !e5.services.every(I_) ? null : m_(t2, e5);
6357
6354
  }
6358
- var zS = [];
6359
- function BS(e5) {
6355
+ var KS = [];
6356
+ function qS(e5) {
6360
6357
  return { min: 1, max: e5?.bookingPolicy?.participantsPolicy?.maxParticipantsPerBooking || 1 };
6361
6358
  }
6362
- function VS(e5, { previous: t2, others: n2 }, { min: r2, max: i2 }) {
6359
+ function JS(e5, { previous: t2, others: n2 }, { min: r2, max: i2 }) {
6363
6360
  let a2 = Math.max(0, Math.floor(e5)), o2 = Math.max(t2, i2 - n2), s2 = Math.min(a2, o2);
6364
6361
  return s2 > 0 && n2 + s2 < r2 ? Math.min(r2 - n2, o2) : s2;
6365
6362
  }
6366
- var HS = (e5) => ({ service: e5, hasError: false });
6367
- var US = () => ({ service: null, hasError: true });
6368
- var WS = { service: null, hasError: false };
6369
- var GS = { ...WS, awaitsPreferences: true };
6370
- var KS = (e5) => ({ ...WS, isMultiServiceAppointment: true, multiServiceAppointmentServices: e5 });
6371
- var qS = () => ({ ...US(), isMultiServiceAppointment: true });
6372
- var JS = [];
6373
- var YS = [];
6374
- var XS = {};
6375
- function ZS({ servicePromise: e5, refreshSignal: n2, injected: r2, rescheduleRequest: i2 = null, editingSurface: a2 = false, bookingsSettings: o2, seoPage: s2 = null, children: c2 }) {
6376
- return h(t, { fallback: h(Jx, { rescheduleRequest: i2, editingSurface: a2, children: c2 }), children: h(Kx, { bookingsSettings: o2, children: g(ts, { fallback: h(Yx, { rescheduleRequest: i2, editingSurface: a2, children: c2 }), feature: Zo.service, children: [s2 && e5 && h(pv, { servicePromise: e5, page: s2 }), h(tC, { servicePromise: e5, refreshSignal: n2, injected: r2, rescheduleRequest: i2, editingSurface: a2, children: c2 })] }) }) });
6377
- }
6378
- var QS = (e5) => e5 ?? void 0;
6379
- var $S = () => void 0;
6380
- function eC(e5, t2) {
6363
+ var YS = (e5) => ({ service: e5, hasError: false });
6364
+ var XS = () => ({ service: null, hasError: true });
6365
+ var ZS = { service: null, hasError: false };
6366
+ var QS = { ...ZS, awaitsPreferences: true };
6367
+ var $S = (e5) => ({ ...ZS, isMultiServiceAppointment: true, multiServiceAppointmentServices: e5 });
6368
+ var eC = () => ({ ...XS(), isMultiServiceAppointment: true });
6369
+ var tC = [];
6370
+ var nC = [];
6371
+ var rC = {};
6372
+ function iC({ servicePromise: e5, refreshSignal: n2, injected: r2, rescheduleRequest: i2 = null, editingSurface: a2 = false, bookingsSettings: o2, seoPage: s2 = null, children: c2 }) {
6373
+ return h(t, { fallback: h(tS, { rescheduleRequest: i2, editingSurface: a2, children: c2 }), children: h($x, { bookingsSettings: o2, children: g(ts, { fallback: h(nS, { rescheduleRequest: i2, editingSurface: a2, children: c2 }), feature: Zo.service, children: [s2 && e5 && h(pv, { servicePromise: e5, page: s2 }), h(cC, { servicePromise: e5, refreshSignal: n2, injected: r2, rescheduleRequest: i2, editingSurface: a2, children: c2 })] }) }) });
6374
+ }
6375
+ var aC = (e5) => e5 ?? void 0;
6376
+ var oC = () => void 0;
6377
+ function sC(e5, t2) {
6381
6378
  $o(e5, { feature: Zo.service, action: `fetch-service-variants`, level: `warning`, contexts: { service: { serviceId: t2 } } });
6382
6379
  }
6383
- function tC({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, rescheduleRequest: a2 = null, editingSurface: o2 = false, children: c2 }) {
6384
- let f2 = n2 ? null : e5 ? Os(e5) : null, p2 = n2?.service ?? f2?.service ?? null, m2 = f2?.hasError ?? false, g2 = f2?.awaitsPreferences ?? false, _2 = f2?.isMultiServiceAppointment ?? false, v2 = f2?.multiServiceAppointmentServices ?? JS, y2 = Jb(), b2 = Xb(), x2 = rx(), { navigate: ee2, navigateToHref: te2, resolvePath: S2, toHref: C2, getBookingFormPath: w2 } = $_(), T2 = hS(), E2 = Xy(Vy.SERVICE), { getParsedUrl: ne2, pushUrl: re2 } = ps(), D2 = u(ne2);
6380
+ function cC({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, rescheduleRequest: a2 = null, editingSurface: o2 = false, children: c2 }) {
6381
+ let f2 = n2 ? null : e5 ? Os(e5) : null, p2 = n2?.service ?? f2?.service ?? null, m2 = f2?.hasError ?? false, g2 = f2?.awaitsPreferences ?? false, _2 = f2?.isMultiServiceAppointment ?? false, v2 = f2?.multiServiceAppointmentServices ?? tC, y2 = Jb(), b2 = Xb(), x2 = rx(), { navigate: ee2, navigateToHref: te2, resolvePath: S2, toHref: C2, getBookingFormPath: w2 } = $_(), T2 = SS(), E2 = Xy(Vy.SERVICE), { getParsedUrl: ne2, pushUrl: re2 } = ps(), D2 = u(ne2);
6385
6382
  D2.current = ne2;
6386
6383
  let ie2 = u(re2);
6387
6384
  ie2.current = re2;
6388
6385
  let O2 = sx(), ae2 = u(O2);
6389
6386
  ae2.current = O2;
6390
- let [k2, oe2] = d(wS), se2 = yS(), ce2 = (e6, t3) => a2 ? u_(e6) : IS(e6, t3), le2 = u(ce2);
6387
+ let [k2, oe2] = d(jS), se2 = ES(), ce2 = (e6, t3) => a2 ? u_(e6) : US(e6, t3), le2 = u(ce2);
6391
6388
  le2.current = ce2;
6392
- let ue2 = Mx(), A2 = ue2 === Ax, de2 = a2 || A2 ? null : ue2, [fe2, pe2] = d(() => A2 ? u_(p2?._id ?? ``) : ce2(p2?._id ?? ``, ne2().searchParams)), j2 = u(fe2), [me2, he2] = d(A2 && !a2), ge2 = u(void 0), _e2 = u(true), [ve2, ye2] = d(false), be2 = ab(), xe2 = u(false), Se2 = u(null), [Ce2, we2] = d(null), Te2 = u(Ce2), [Ee2, De2] = d(0), M2 = p2?._id ?? null, Oe2 = l(() => {
6389
+ let ue2 = Mx(), A2 = ue2 === Ax, de2 = a2 || A2 ? null : ue2, [fe2, pe2] = d(() => Lx(A2 ? u_(p2?._id ?? ``) : ce2(p2?._id ?? ``, ne2().searchParams))), { selection: me2 } = fe2, j2 = u(fe2), he2 = i((e6) => {
6390
+ j2.current = e6, pe2(e6);
6391
+ }, []), [ge2, _e2] = d(A2 && !a2), ve2 = ab(), [ye2, be2] = d(null), xe2 = u(ye2), [Se2, Ce2] = d(0), M2 = p2?._id ?? null, we2 = l(() => {
6393
6392
  if (!a2) return null;
6394
6393
  let { booking: e6 } = k2;
6395
6394
  if (k2.status !== `ready` || !e6) return { ...k2 };
6396
6395
  let t3 = e6.kind === `other` ? `notReschedulable` : e6.serviceId === M2 ? `ready` : `wrongService`;
6397
6396
  return { ...k2, status: t3 };
6398
- }, [a2, k2, M2]), ke2 = p2?.schedule?._id ?? null, Ae2 = p2?.type ?? null, je2 = l(() => {
6397
+ }, [a2, k2, M2]), Te2 = p2?.schedule?._id ?? null, Ee2 = p2?.type ?? null, De2 = l(() => {
6399
6398
  if (!p2) return null;
6400
6399
  let e6 = S2(`servicePage`, { slug: p2.mainSlug?.name ?? null, serviceId: p2._id ?? null });
6401
6400
  return e6 ? { href: C2(e6), target: `_self` } : null;
6402
- }, [p2, S2, C2]), [Me2, Ne2] = d(zS), Pe2 = n2 ? n2.masterEvents : Me2, Fe2 = Wx(), Ie2 = Bx(), Le2 = Ie2.isLoading, Re2 = !Ie2.isLoading && Ie2.multiServiceAppointmentsEnabled;
6401
+ }, [p2, S2, C2]), [Oe2, ke2] = d(KS), Ae2 = n2 ? n2.masterEvents : Oe2, je2 = Zx(), Me2 = qx(), Ne2 = Me2.isLoading, Pe2 = !Me2.isLoading && Me2.multiServiceAppointmentsEnabled;
6403
6402
  s(() => {
6404
- if (!a2 || Le2) return;
6405
- let e6 = false, t3 = OS(a2, se2, (t4) => {
6403
+ if (!a2 || Ne2) return;
6404
+ let e6 = false, t3 = FS(a2, se2, (t4) => {
6406
6405
  e6 || oe2(t4);
6407
6406
  });
6408
6407
  return () => {
6409
6408
  e6 = true, t3();
6410
6409
  };
6411
- }, [a2, Le2, se2]);
6412
- let ze2 = !n2 && !!p2 && Wm(p2), Be2 = ze2 && M2 ? fx(b2, x2, M2, t2) : null, Ve2 = (typeof window > `u` && Be2 && M2 && O2.scope && !Le2 ? Os(js(Tx({ key: Be2, warmupData: O2, fetchData: () => Cb(M2).catch((e6) => (eC(e6, M2), null)) }), QS, $S)) : void 0) ?? (Be2 ? yx(Be2) : void 0), [He2, Ue2] = d(() => Ve2 ?? null), [We2, Ge2] = d(() => Ve2 ? Be2 : null), Ke2 = Be2 !== null && We2 !== Be2, qe2 = n2 ? n2.serviceOptionsAndVariants : ze2 ? He2 : null;
6410
+ }, [a2, Ne2, se2]);
6411
+ let Fe2 = !n2 && !!p2 && Wm(p2), Ie2 = Fe2 && M2 ? fx(b2, x2, M2, t2) : null, Le2 = (typeof window > `u` && Ie2 && M2 && O2.scope && !Ne2 ? Os(js(Tx({ key: Ie2, warmupData: O2, fetchData: () => Cb(M2).catch((e6) => (sC(e6, M2), null)) }), aC, oC)) : void 0) ?? (Ie2 ? yx(Ie2) : void 0), [Re2, ze2] = d(() => Le2 ?? null), [Be2, Ve2] = d(() => Le2 ? Ie2 : null), He2 = Ie2 !== null && Be2 !== Ie2, Ue2 = n2 ? n2.serviceOptionsAndVariants : Fe2 ? Re2 : null;
6413
6412
  s(() => {
6414
6413
  if (n2) return;
6415
- let e6 = ke2 && !Vm(Ae2) ? ke2 : null;
6416
- if ((!e6 || Le2) && Ne2((e7) => e7.length === 0 ? e7 : zS), Le2) return;
6417
- let i2 = ze2 ? M2 : null;
6414
+ let e6 = Te2 && !Vm(Ee2) ? Te2 : null;
6415
+ if ((!e6 || Ne2) && ke2((e7) => e7.length === 0 ? e7 : KS), Ne2) return;
6416
+ let i2 = Fe2 ? M2 : null;
6418
6417
  if (!e6 && !i2) return;
6419
- let a3 = false, o3 = e6 ? xb([e6], Fe2).catch(() => zS) : Promise.resolve(zS), s2 = i2 ? Tx({ key: fx(b2, x2, i2, t2), warmupData: ae2.current, fetchData: () => Cb(i2) }).catch((e7) => {
6420
- eC(e7, i2);
6418
+ let a3 = false, o3 = e6 ? xb([e6], je2).catch(() => KS) : Promise.resolve(KS), s2 = i2 ? Tx({ key: fx(b2, x2, i2, t2), warmupData: ae2.current, fetchData: () => Cb(i2) }).catch((e7) => {
6419
+ sC(e7, i2);
6421
6420
  }) : Promise.resolve(void 0);
6422
6421
  return Promise.all([o3, s2]).then(([e7, t3]) => {
6423
6422
  a3 || r(() => {
6424
- Ne2(e7), t3 !== void 0 && Ue2(t3), Ge2(Be2);
6423
+ ke2(e7), t3 !== void 0 && ze2(t3), Ve2(Ie2);
6425
6424
  });
6426
6425
  }), () => {
6427
6426
  a3 = true;
6428
6427
  };
6429
- }, [n2, ke2, Ae2, Fe2, Le2, ze2, M2, Be2, b2, x2]);
6430
- let N2 = me2 ? null : de2, P2 = l(() => JSON.stringify([...new Set((r_(N2)?.services ?? []).filter((e6) => T_(e6).length > 0).map(({ serviceId: e6 }) => e6))].sort()), [N2]), F2 = l(() => {
6431
- let e6 = new Set(JSON.parse(P2));
6428
+ }, [n2, Te2, Ee2, je2, Ne2, Fe2, M2, Ie2, b2, x2]);
6429
+ let We2 = ge2 ? null : de2, Ge2 = l(() => JSON.stringify([...new Set((r_(We2)?.services ?? []).filter((e6) => T_(e6).length > 0).map((e6) => e6.serviceId))].sort()), [We2]), Ke2 = l(() => {
6430
+ let e6 = new Set(JSON.parse(Ge2));
6432
6431
  return [...new Set(v2.filter(Wm).flatMap(({ _id: t3 }) => t3 && e6.has(t3) ? [t3] : []))];
6433
- }, [v2, P2]), Je2 = l(() => ({ serviceIds: F2, refreshSignal: t2, language: b2, currency: x2 }), [F2, t2, b2, x2]), [Ye2, Xe2] = d(null), Ze2 = Ye2?.request === Je2 ? Ye2 : null, Qe2 = Ze2?.data ?? XS, $e2 = F2.length === 0 ? `ready` : Le2 || !Ze2 ? `loading` : Ze2.data && F2.every((e6) => Ze2.data?.[e6]) ? `ready` : `error`;
6432
+ }, [v2, Ge2]), qe2 = l(() => ({ serviceIds: Ke2, refreshSignal: t2, language: b2, currency: x2 }), [Ke2, t2, b2, x2]), [N2, P2] = d(null), F2 = N2?.request === qe2 ? N2 : null, Je2 = F2?.data ?? rC, Ye2 = Ke2.length === 0 ? `ready` : Ne2 || !F2 ? `loading` : F2.data && Ke2.every((e6) => F2.data?.[e6]) ? `ready` : `error`;
6434
6433
  s(() => {
6435
- let { serviceIds: e6, refreshSignal: t3, language: n3, currency: i2 } = Je2;
6436
- if (Le2 || e6.length === 0) return;
6434
+ let { serviceIds: e6, refreshSignal: t3, language: n3, currency: i2 } = qe2;
6435
+ if (Ne2 || e6.length === 0) return;
6437
6436
  let a3 = false;
6438
6437
  return Tx({ key: px(n3, i2, e6, t3), warmupData: ae2.current, fetchData: () => Tb(e6) }).catch((e7) => ($o(e7, { feature: Zo.service, action: `fetch-multi-service-variants`, level: `warning` }), null)).then((e7) => {
6439
- a3 || r(() => Xe2({ request: Je2, data: e7 }));
6438
+ a3 || r(() => P2({ request: qe2, data: e7 }));
6440
6439
  }), () => {
6441
6440
  a3 = true;
6442
6441
  };
6443
- }, [Le2, Je2]);
6444
- let et2 = jy({ service: p2, masterEvents: Pe2, locale: y2, timeZone: Fe2 }), tt2 = u(PS);
6442
+ }, [Ne2, qe2]);
6443
+ let Xe2 = jy({ service: p2, masterEvents: Ae2, locale: y2, timeZone: je2 }), Ze2 = u(VS);
6445
6444
  s(() => {
6446
- if (tt2.current !== PS) {
6445
+ if (Ze2.current !== VS) {
6447
6446
  let e6 = le2.current(p2?._id ?? ``, D2.current().searchParams);
6448
- j2.current = e6, _e2.current = true, ye2(false), xe2.current = false, Se2.current = null, pe2(e6);
6447
+ he2(Rx(j2.current, e6));
6449
6448
  }
6450
- tt2.current = M2;
6449
+ Ze2.current = M2;
6451
6450
  }, [M2]);
6452
- let nt2 = u(A2 ? PS : de2), rt2 = u(null), I2 = u(false);
6453
- bS(() => {
6454
- if (I2.current = true, nt2.current !== PS) return;
6451
+ let Qe2 = u(A2 ? VS : de2), $e2 = u(null), et2 = u(false);
6452
+ DS(() => {
6453
+ if (et2.current = true, Qe2.current !== VS) return;
6455
6454
  let e6 = le2.current(M2 ?? ``, D2.current().searchParams);
6456
- j2.current = e6, rt2.current = e6;
6455
+ j2.current = { ...j2.current, selection: e6 }, $e2.current = e6;
6457
6456
  }, []), s(() => {
6458
- let e6 = nt2.current === PS, t3 = e6 ? a2 ? null : a_(D2.current().searchParams) : de2;
6459
- if (!e6 && (A2 || t3 === nt2.current)) return;
6460
- let n3 = nt2.current;
6461
- if (nt2.current = t3, n3 !== PS && v_(n3, t3)) return;
6462
- let i2 = rt2.current;
6463
- if (rt2.current = null, e6 && i2 && j2.current !== i2) {
6457
+ let e6 = Qe2.current === VS, t3 = e6 ? a2 ? null : a_(D2.current().searchParams) : de2;
6458
+ if (!e6 && (A2 || t3 === Qe2.current)) return;
6459
+ let n3 = Qe2.current;
6460
+ if (Qe2.current = t3, n3 !== VS && v_(n3, t3)) return;
6461
+ let i2 = $e2.current;
6462
+ if ($e2.current = null, e6 && i2 && j2.current.selection !== i2) {
6464
6463
  r(() => {
6465
- pe2(j2.current), he2(false);
6464
+ pe2(j2.current), _e2(false);
6466
6465
  });
6467
6466
  return;
6468
6467
  }
6469
- let o3 = le2.current(M2 ?? ``, D2.current().searchParams);
6470
- if (j2.current = o3, _e2.current = true, ye2(false), xe2.current = false, Se2.current = null, e6) {
6471
- r(() => {
6472
- pe2(o3), he2(false);
6473
- });
6474
- return;
6475
- }
6476
- pe2(o3), Te2.current = null, we2(null), De2((e7) => e7 + 1);
6468
+ let o3 = le2.current(M2 ?? ``, D2.current().searchParams), s2 = Rx(j2.current, o3);
6469
+ j2.current = s2, e6 ? r(() => {
6470
+ pe2(s2), _e2(false);
6471
+ }) : (pe2(s2), xe2.current = null, be2(null), Ce2((e7) => e7 + 1));
6477
6472
  }, [A2, de2, M2, a2]);
6478
- let L2 = u({});
6479
- L2.current = { serviceType: p2?.type ?? void 0, scheduleId: Um(p2?.type) || Hm(p2?.type) ? p2?.schedule?._id ?? void 0 : void 0 };
6480
- let it2 = u(A2 || me2);
6481
- it2.current = A2 || me2;
6482
- let R2 = i((e6, t3) => c_(e6, { currentUrl: it2.current && !I2.current ? oC(D2.current()) : D2.current(), entries: [b_(t3?.staffId === void 0 ? j2.current : S_(j2.current, t3.staffId), L2.current)], policy: t3?.handoff ? `handoff` : `inPlace`, timezone: ge2.current }), []), at2 = i((e6) => {
6483
- let t3 = e6(j2.current);
6484
- j2.current = t3, pe2(t3);
6485
- }, []), ot2 = i((e6) => {
6486
- at2(e6);
6487
- let t3 = D2.current(), n3 = e6(IS(M2 ?? ``, t3.searchParams)), r2 = c_(`${t3.pathname}${t3.search}${t3.hash}`, { currentUrl: t3, entries: [b_(n3, L2.current)], policy: `inPlace` }), i2 = new URL(r2, t3);
6488
- nt2.current !== PS && (nt2.current = a_(i2.searchParams)), ie2.current(i2, { disableScrollToTop: true, skipHistory: true });
6489
- }, [at2, M2]), st2 = r_(N2)?.wantsPromoCode === true, ct2 = i((e6) => {
6473
+ let tt2 = u({});
6474
+ tt2.current = { serviceType: p2?.type ?? void 0, scheduleId: Um(p2?.type) || Hm(p2?.type) ? p2?.schedule?._id ?? void 0 : void 0 };
6475
+ let nt2 = u(A2 || ge2);
6476
+ nt2.current = A2 || ge2;
6477
+ let rt2 = i((e6, t3) => c_(e6, { currentUrl: nt2.current && !et2.current ? pC(D2.current()) : D2.current(), entries: [b_(t3?.staffId === void 0 ? j2.current.selection : S_(j2.current.selection, t3.staffId), tt2.current)], policy: t3?.handoff ? `handoff` : `inPlace`, timezone: j2.current.pick.timezone }), []), I2 = i((e6) => he2(zx(j2.current, e6)), [he2]), L2 = i((e6) => {
6478
+ I2(e6);
6479
+ let t3 = D2.current(), n3 = e6(US(M2 ?? ``, t3.searchParams)), r2 = c_(`${t3.pathname}${t3.search}${t3.hash}`, { currentUrl: t3, entries: [b_(n3, tt2.current)], policy: `inPlace` }), i2 = new URL(r2, t3);
6480
+ Qe2.current !== VS && (Qe2.current = a_(i2.searchParams)), ie2.current(i2, { disableScrollToTop: true, skipHistory: true });
6481
+ }, [I2, M2]), it2 = r_(We2)?.wantsPromoCode === true, R2 = i((e6) => {
6490
6482
  let t3 = D2.current(), n3 = r_(a_(t3.searchParams));
6491
6483
  if (!n3) return;
6492
6484
  let r2 = new URL(m_(`${t3.pathname}${t3.search}${t3.hash}`, __(n3, e6)), t3);
6493
- nt2.current !== PS && (nt2.current = a_(r2.searchParams)), ie2.current(r2, { disableScrollToTop: true, skipHistory: true });
6494
- }, []), lt2 = Ab(qe2), ut2 = i((e6, t3) => lt2 ? E_(e6, t3 ? [t3] : []) : e6, [lt2]), dt2 = i((e6) => at2((t3) => ut2(S_(t3, e6), e6)), [at2, ut2]), ft2 = i(() => at2((e6) => ut2(w_(e6), null)), [at2, ut2]), pt2 = i((e6) => at2((t3) => ut2(C_(t3, e6), null)), [at2, ut2]), mt2 = i((e6) => ot2((t3) => E_(t3, e6)), [ot2]), ht2 = l(() => BS(p2), [p2]), gt2 = l(() => jb(qe2, { locale: y2, staffMembers: p2 ? ry(p2) : [], businessLocations: zm(p2) }), [qe2, y2, p2]), _t2 = l(() => new Set(jb(qe2, { locale: y2 })?.choices.flatMap((e6) => e6.choiceId ? [e6.choiceId] : []) ?? []), [qe2, y2]), vt2 = i((e6) => {
6495
- let t3 = Object.entries(e6).filter(([e7, t4]) => _t2.has(e7) && Number.isFinite(t4));
6485
+ Qe2.current !== VS && (Qe2.current = a_(r2.searchParams)), ie2.current(r2, { disableScrollToTop: true, skipHistory: true });
6486
+ }, []), at2 = Ab(Ue2), ot2 = i((e6, t3) => at2 ? E_(e6, t3 ? [t3] : []) : e6, [at2]), st2 = i((e6) => I2((t3) => ot2(S_(t3, e6), e6)), [I2, ot2]), ct2 = i(() => I2((e6) => ot2(w_(e6), null)), [I2, ot2]), lt2 = i((e6) => I2((t3) => ot2(C_(t3, e6), null)), [I2, ot2]), ut2 = i((e6) => L2((t3) => E_(t3, e6)), [L2]), dt2 = l(() => qS(p2), [p2]), ft2 = l(() => jb(Ue2, { locale: y2, staffMembers: p2 ? ny(p2) : [], businessLocations: zm(p2) }), [Ue2, y2, p2]), pt2 = l(() => new Set(jb(Ue2, { locale: y2 })?.choices.flatMap((e6) => e6.choiceId ? [e6.choiceId] : []) ?? []), [Ue2, y2]), mt2 = i((e6) => {
6487
+ let t3 = Object.entries(e6).filter(([e7, t4]) => pt2.has(e7) && Number.isFinite(t4));
6496
6488
  if (!t3.length) return;
6497
6489
  let n3 = (e7) => {
6498
- let n4 = A_(e7, _t2), r2 = ([e8, t4]) => t4 <= D_(n4, e8), i2 = [...t3.filter(r2), ...t3.filter((e8) => !r2(e8))];
6490
+ let n4 = A_(e7, pt2), r2 = ([e8, t4]) => t4 <= D_(n4, e8), i2 = [...t3.filter(r2), ...t3.filter((e8) => !r2(e8))];
6499
6491
  for (let [e8, t4] of i2) {
6500
- let r3 = D_(n4, e8), i3 = VS(t4, { previous: r3, others: O_(n4) - r3 }, ht2);
6492
+ let r3 = D_(n4, e8), i3 = JS(t4, { previous: r3, others: O_(n4) - r3 }, dt2);
6501
6493
  i3 !== r3 && (n4 = k_(n4, e8, i3));
6502
6494
  }
6503
6495
  return n4;
6504
6496
  };
6505
- n3(j2.current) !== j2.current && ot2(n3);
6506
- }, [_t2, ht2, ot2]), yt2 = i((e6) => ot2((t3) => N_(t3, e6)), [ot2]), bt2 = i((e6, t3) => ot2((n3) => P_(n3, e6, t3)), [ot2]), xt2 = i((e6, t3) => {
6507
- t3?.timezone && (ge2.current = t3.timezone), _e2.current = t3?.bookable ?? true, ye2(!_e2.current), xe2.current = t3?.staffChoiceRequired ?? false, Se2.current = t3?.rescheduleStaffId ?? null, at2((n3) => {
6508
- let r2 = L_(n3, e6);
6509
- return t3?.staffId === void 0 ? r2 : S_(r2, t3.staffId);
6510
- });
6511
- }, [at2]), St2 = i(() => {
6512
- _e2.current = true, ye2(false), xe2.current = false, Se2.current = null;
6497
+ n3(j2.current.selection) !== j2.current.selection && L2(n3);
6498
+ }, [pt2, dt2, L2]), ht2 = i((e6) => L2((t3) => N_(t3, e6)), [L2]), gt2 = i((e6, t3) => L2((n3) => P_(n3, e6, t3)), [L2]), _t2 = i((e6, t3) => he2(Bx(j2.current, e6, t3)), [he2]), vt2 = i(() => {
6513
6499
  let e6 = le2.current(M2 ?? ``, D2.current().searchParams);
6514
- at2((t3) => {
6515
- let n3 = z_(t3, e6);
6516
- if (!lt2) return n3;
6517
- let { selectedVariants: r2, durationChoiceId: i2, ...a3 } = n3;
6518
- return { ...a3, ...e6.selectedVariants ? { selectedVariants: e6.selectedVariants } : {}, ...e6.durationChoiceId ? { durationChoiceId: e6.durationChoiceId } : {} };
6519
- });
6520
- }, [at2, M2, lt2]), Ct2 = i((e6) => {
6521
- let t3 = Te2.current ?? r_(a_(D2.current().searchParams)), n3 = t3 && e6(t3);
6522
- return n3 ? (Te2.current = n3, we2(n3), true) : false;
6523
- }, []), wt2 = i((e6, t3) => Ct2((n3) => B_(n3, e6, t3, Py())), [Ct2]), Tt2 = i(() => {
6524
- Ct2(H_);
6525
- }, [Ct2]), Et2 = et2.serviceCtaState, Dt2 = l(() => _2 ? (Ce2 ?? r_(N2))?.services ?? YS : YS, [_2, Ce2, N2]), Ot2 = l(() => _2 ? RS(Ce2 ?? r_(N2), w2()) : null, [_2, Ce2, N2, w2]), kt2 = Es(`serviceCtaFormHrefCarriesSelection`), At2 = i((e6) => {
6526
- if (_2) return Ot2 ? C2(Ot2) : null;
6527
- let t3 = W_({ actionState: Et2, serviceType: p2?.type ?? null, config: e6 ?? U_ });
6528
- if (G_(t3, p2?.type ?? null, fe2)) return null;
6500
+ he2(Vx(j2.current, e6, { staffPriced: at2 }));
6501
+ }, [he2, M2, at2]), yt2 = i((e6) => {
6502
+ let t3 = xe2.current ?? r_(a_(D2.current().searchParams)), n3 = t3 && e6(t3);
6503
+ return n3 ? (xe2.current = n3, be2(n3), true) : false;
6504
+ }, []), bt2 = i((e6, t3) => yt2((n3) => B_(n3, e6, t3, Py())), [yt2]), xt2 = i(() => {
6505
+ yt2(H_);
6506
+ }, [yt2]), St2 = Xe2.serviceCtaState, Ct2 = l(() => _2 ? (ye2 ?? r_(We2))?.services ?? nC : nC, [_2, ye2, We2]), wt2 = l(() => _2 ? GS(ye2 ?? r_(We2), w2()) : null, [_2, ye2, We2, w2]), Tt2 = Es(`serviceCtaFormHrefCarriesSelection`), Et2 = i((e6) => {
6507
+ if (_2) return wt2 ? C2(wt2) : null;
6508
+ let t3 = W_({ actionState: St2, serviceType: p2?.type ?? null, config: e6 ?? U_ });
6509
+ if (G_(t3, p2?.type ?? null, me2)) return null;
6529
6510
  let n3 = S2(t3, { slug: p2?.mainSlug?.name ?? null, serviceId: p2?._id ?? null });
6530
- return n3 ? C2(kt2 && t3 === `bookingForm` ? R2(n3, { handoff: true }) : n3) : null;
6531
- }, [_2, Ot2, Et2, p2, fe2, S2, C2, kt2, R2]), jt2 = Bb(), [Mt2, Nt2] = d(false), Pt2 = u(false), Ft2 = i(() => {
6532
- Pt2.current = false, Nt2(false);
6511
+ return n3 ? C2(Tt2 && t3 === `bookingForm` ? rt2(n3, { handoff: true }) : n3) : null;
6512
+ }, [_2, wt2, St2, p2, me2, S2, C2, Tt2, rt2]), Dt2 = Bb(), [Ot2, kt2] = d(false), At2 = u(false), jt2 = i(() => {
6513
+ At2.current = false, kt2(false);
6533
6514
  }, []);
6534
- Ex(Ft2);
6535
- let It2 = i((e6) => {
6536
- Pt2.current = true, Nt2(true);
6515
+ Ex(jt2);
6516
+ let Mt2 = i((e6) => {
6517
+ At2.current = true, kt2(true);
6537
6518
  let t3 = D2.current(), n3 = new URL(C2(e6), t3).pathname === t3.pathname;
6538
6519
  ee2(e6).then(() => {
6539
- (n3 || D2.current().href !== t3.href) && Ft2();
6520
+ (n3 || D2.current().href !== t3.href) && jt2();
6540
6521
  }, (e7) => {
6541
- $o(e7, { feature: Zo.serviceCta, action: `navigateToNextPage` }), Ft2();
6522
+ $o(e7, { feature: Zo.serviceCta, action: `navigateToNextPage` }), jt2();
6542
6523
  });
6543
- }, [ee2, Ft2, C2]), Lt2 = i(() => jt2.open(Ib(Ub({ service: p2, pricingOption: gt2 ?? void 0, selection: LS(M2 ?? ``, D2.current().searchParams), multiServiceAppointmentsEnabled: Re2 }))), [jt2, p2, gt2, M2, Re2]), Rt2 = i((e6) => {
6544
- if (Pt2.current) return;
6545
- let t3 = Te2.current ?? r_(a_(D2.current().searchParams)), n3 = RS(t3, w2());
6524
+ }, [ee2, jt2, C2]), Nt2 = i(() => Dt2.open(Ib(Ub({ service: p2, pricingOption: ft2 ?? void 0, selection: WS(M2 ?? ``, D2.current().searchParams), multiServiceAppointmentsEnabled: Pe2 }))), [Dt2, p2, ft2, M2, Pe2]), Pt2 = i((e6) => {
6525
+ if (At2.current) return;
6526
+ let t3 = xe2.current ?? r_(a_(D2.current().searchParams)), n3 = GS(t3, w2());
6546
6527
  if (n3) {
6547
6528
  for (let n4 of t3?.services ?? []) e6(rb({ serviceId: n4.serviceId, serviceType: n4.serviceType ?? v2.find(({ _id: e7 }) => e7 === n4.serviceId)?.type ?? void 0, start: n4.slotStart, end: n4.slotEnd, timeZone: t3?.timezone ?? void 0, isEligibleForFlowCompletion: true }));
6548
- It2(n3);
6529
+ Mt2(n3);
6549
6530
  }
6550
- }, [w2, v2, It2]), zt2 = i((e6, t3 = Uy.WIDGET_BUTTON) => {
6551
- if (Pt2.current || a2) return;
6531
+ }, [w2, v2, Mt2]), Ft2 = i((e6, t3 = Uy.WIDGET_BUTTON) => {
6532
+ if (At2.current || a2) return;
6552
6533
  if (_2) {
6553
- Rt2(E2);
6534
+ Pt2(E2);
6554
6535
  return;
6555
6536
  }
6556
- let n3 = W_({ actionState: Et2, serviceType: p2?.type ?? null, config: e6 ?? U_ });
6557
- if (G_(n3, p2?.type ?? null, j2.current)) return;
6537
+ let n3 = W_({ actionState: St2, serviceType: p2?.type ?? null, config: e6 ?? U_ });
6538
+ if (G_(n3, p2?.type ?? null, j2.current.selection)) return;
6558
6539
  let r2 = n3 === `bookingForm` && !Um(p2?.type ?? null);
6559
- if (r2 && !_e2.current) return;
6540
+ if (r2 && !j2.current.pick.bookable) return;
6560
6541
  let i2 = S2(n3, { slug: p2?.mainSlug?.name ?? null, serviceId: p2?._id ?? null });
6561
- if (n3 !== `servicePage` && !r2 && E2(Ry({ bookingsServiceId: p2?._id ?? void 0, serviceType: p2?.type ?? void 0, isEligibleForFlowCompletion: !!i2 })), r2 && E2(rb({ serviceId: p2?._id ?? void 0, serviceType: p2?.type ?? void 0, start: j2.current.slotStart, end: j2.current.slotEnd, timeZone: ge2.current ?? r_(N2)?.timezone ?? Fe2, isEligibleForFlowCompletion: !!i2 })), E2(Iy({ service_id: p2?._id ?? void 0, destination: Wy[n3] })), !i2) return;
6542
+ if (n3 !== `servicePage` && !r2 && E2(Ry({ bookingsServiceId: p2?._id ?? void 0, serviceType: p2?.type ?? void 0, isEligibleForFlowCompletion: !!i2 })), r2 && E2(rb({ serviceId: p2?._id ?? void 0, serviceType: p2?.type ?? void 0, start: j2.current.selection.slotStart, end: j2.current.selection.slotEnd, timeZone: j2.current.pick.timezone ?? r_(We2)?.timezone ?? je2, isEligibleForFlowCompletion: !!i2 })), E2(Iy({ service_id: p2?._id ?? void 0, destination: Wy[n3] })), !i2) return;
6562
6543
  E2(Qy({ service_id: p2?._id ?? void 0, type: p2?.type ?? void 0, isPendingApproval: p2 ? Gm(p2) : void 0, referralInfo: t3, actionName: Gy[n3] }));
6563
6544
  let o3 = n3 === `bookingForm`;
6564
- if (!o3 && !g_(j2.current)) {
6565
- It2(y_(i2, D2.current()));
6566
- return;
6567
- }
6568
- It2(R2(i2, { handoff: o3 }));
6569
- }, [a2, _2, Rt2, N2, Et2, p2, Fe2, S2, It2, R2, E2]), Bt2 = () => ({ bookable: _e2.current, staffChoiceRequired: xe2.current, timezone: ge2.current ?? Fe2 ?? `UTC`, validUntil: Oe2?.validUntil ?? null }), Vt2 = u(Bt2);
6570
- Vt2.current = Bt2;
6571
- let Ht2 = i(async () => {
6572
- let e6 = Oe2?.status === `ready` ? Oe2.booking : null;
6573
- if (!Oe2 || !a2 || !e6 || !SS(j2.current, Vt2.current())) return { outcome: `failed` };
6545
+ !o3 && !g_(j2.current.selection) ? Mt2(y_(i2, D2.current())) : Mt2(rt2(i2, { handoff: o3 }));
6546
+ }, [a2, _2, Pt2, We2, St2, p2, je2, S2, Mt2, rt2, E2]), It2 = ({ bookable: e6, staffChoiceRequired: t3, timezone: n3 }) => ({ bookable: e6, staffChoiceRequired: t3, timezone: n3 ?? je2 ?? `UTC`, validUntil: we2?.validUntil ?? null }), Lt2 = u(It2);
6547
+ Lt2.current = It2;
6548
+ let Rt2 = i(async () => {
6549
+ let e6 = we2?.status === `ready` ? we2.booking : null;
6550
+ if (!we2 || !a2 || !e6 || !kS(j2.current.selection, Lt2.current(j2.current.pick))) return { outcome: `failed` };
6574
6551
  E2(eb({ component: qy.RESCHEDULE_DIALOG, element: Jy.CONFIRM_BUTTON })), E2(By({ action: Ky, pageName: Jy.CONFIRM_BUTTON, referralInfo: D2.current().searchParams.get(i_.referral) ?? void 0 }));
6575
- let t3 = b_(j2.current, L2.current), n3;
6552
+ let t3 = b_(j2.current.selection, tt2.current), n3;
6576
6553
  try {
6577
- n3 = await fS({ booking: e6, slot: rS(t3, ge2.current ?? null, e6, Se2.current), token: a2.token });
6554
+ n3 = await yS({ booking: e6, slot: uS(t3, j2.current.pick.timezone ?? null, e6, j2.current.pick.rescheduleStaffId), token: a2.token });
6578
6555
  } catch (e7) {
6579
6556
  return $o(e7, { feature: Zo.reschedule, action: `reschedule-booking` }), { outcome: `failed` };
6580
6557
  }
6581
6558
  E2($y({ bookingId: e6.bookingId }));
6582
6559
  let r2 = { outcome: `succeeded`, ...n3 };
6583
6560
  if (a2.fromManageBookingPage) return r2;
6584
- let i2 = xS(a2.redirectUrl), o3 = i2 ? null : T2();
6561
+ let i2 = OS(a2.redirectUrl), o3 = i2 ? null : T2();
6585
6562
  if (!i2 && !o3) return r2;
6586
6563
  try {
6587
6564
  return i2 ? await te2({ href: i2 }) : o3 && await ee2(o3), { outcome: `navigated` };
6588
6565
  } catch (e7) {
6589
6566
  return $o(e7, { feature: Zo.reschedule, action: `return-after-reschedule` }), r2;
6590
6567
  }
6591
- }, [Oe2, a2, T2, ee2, te2, E2]), Ut2 = SS(fe2, Bt2()), Wt2 = i(() => {
6568
+ }, [we2, a2, T2, ee2, te2, E2]), zt2 = kS(me2, It2(fe2.pick)), Bt2 = fe2.pick.timezone ?? je2, Vt2 = !fe2.pick.bookable, Ht2 = i(() => {
6592
6569
  E2(By({ component: Jy.GO_TO_HOMEPAGE_BUTTON, action: Ky, pageName: Yy })), ee2(`/`).catch((e6) => $o(e6, { feature: Zo.reschedule, action: `go-home` }));
6593
- }, [ee2, E2]), { serviceBookability: Gt2, policyDescription: Kt2, coverImage: qt2 } = et2, Jt2 = i(() => Gt2.isAvailableForBooking, [Gt2]), Yt2 = i(() => !!Kt2, [Kt2]), Xt2 = i(() => !!qt2, [qt2]), Zt2 = i(() => iv(p2), [p2]), Qt2 = i(() => !!p2 && Pb(p2), [p2]), $t2 = l(() => ({ ...et2, service: p2, servicePageLink: je2, serviceOptionsAndVariants: qe2, pricingOption: gt2, isLoadingServiceOptionsAndVariants: Ke2, isAvailableForBooking: Jt2, hasPolicyDescription: Yt2, hasCoverImage: Xt2, hasGalleryImages: Zt2, isVariantDuration: Qt2, isLoading: g2, hasError: m2, locale: y2, selectStaffMember: dt2, clearSelection: pt2, clearStaffMember: ft2, selection: fe2, isSelectionPending: me2 || fe2.serviceId !== (M2 ?? ``), selectionTimezone: ge2.current ?? Fe2, setVariant: mt2, setVariantCounts: vt2, maxParticipantsPerBooking: ht2.max, toggleAddOn: yt2, setAddOnQuantity: bt2, setSlot: xt2, clearSlot: St2, setMultiServiceSlot: wt2, clearMultiServiceSlot: Tt2, draftRevision: Ee2, wantsPromoCode: st2, setWantsPromoCode: ct2, withSelectionParam: R2, navigateToNextPage: zt2, navigateToMultiServiceForm: Rt2, resolveNextPageHref: At2, isNavigating: Mt2, isWaitlistSlotSelected: ve2, siteId: be2, editingSurface: o2, openPreferences: Lt2, multiServiceAppointmentsEnabled: Re2, isMultiServiceAppointment: _2, multiServiceAppointmentServices: v2, multiServiceAppointmentSelections: Dt2, multiServiceAppointmentOptionsAndVariants: Qe2, multiServiceAppointmentVariantsStatus: $e2, bookingsSettingsLoading: Le2, reschedule: Oe2, rescheduleBooking: Ht2, goHomeAfterReschedule: Wt2, canRescheduleToPick: Ut2 }), [et2, p2, je2, qe2, gt2, Ke2, Jt2, Yt2, Xt2, Zt2, Qt2, g2, m2, y2, dt2, pt2, ft2, fe2, me2, M2, Fe2, mt2, vt2, ht2.max, yt2, bt2, xt2, St2, wt2, Tt2, Ee2, st2, ct2, R2, zt2, Rt2, At2, Mt2, ve2, be2, o2, Lt2, Re2, _2, v2, Dt2, Qe2, $e2, Le2, Oe2, Ht2, Wt2, Ut2]);
6594
- return h(kS.Provider, { value: $t2, children: c2 });
6570
+ }, [ee2, E2]), { serviceBookability: Ut2, policyDescription: Wt2, coverImage: Gt2 } = Xe2, Kt2 = i(() => Ut2.isAvailableForBooking, [Ut2]), qt2 = i(() => !!Wt2, [Wt2]), Jt2 = i(() => !!Gt2, [Gt2]), Yt2 = i(() => iv(p2), [p2]), Xt2 = i(() => !!p2 && Pb(p2), [p2]), Zt2 = l(() => ({ ...Xe2, service: p2, servicePageLink: De2, serviceOptionsAndVariants: Ue2, pricingOption: ft2, isLoadingServiceOptionsAndVariants: He2, isAvailableForBooking: Kt2, hasPolicyDescription: qt2, hasCoverImage: Jt2, hasGalleryImages: Yt2, isVariantDuration: Xt2, isLoading: g2, hasError: m2, locale: y2, selectStaffMember: st2, clearSelection: lt2, clearStaffMember: ct2, selection: me2, isSelectionPending: ge2 || me2.serviceId !== (M2 ?? ``), selectionTimezone: Bt2, setVariant: ut2, setVariantCounts: mt2, maxParticipantsPerBooking: dt2.max, toggleAddOn: ht2, setAddOnQuantity: gt2, setSlot: _t2, clearSlot: vt2, setMultiServiceSlot: bt2, clearMultiServiceSlot: xt2, draftRevision: Se2, wantsPromoCode: it2, setWantsPromoCode: R2, withSelectionParam: rt2, navigateToNextPage: Ft2, navigateToMultiServiceForm: Pt2, resolveNextPageHref: Et2, isNavigating: Ot2, isWaitlistSlotSelected: Vt2, siteId: ve2, editingSurface: o2, openPreferences: Nt2, multiServiceAppointmentsEnabled: Pe2, isMultiServiceAppointment: _2, multiServiceAppointmentServices: v2, multiServiceAppointmentSelections: Ct2, multiServiceAppointmentOptionsAndVariants: Je2, multiServiceAppointmentVariantsStatus: Ye2, bookingsSettingsLoading: Ne2, reschedule: we2, rescheduleBooking: Rt2, goHomeAfterReschedule: Ht2, canRescheduleToPick: zt2 }), [Xe2, p2, De2, Ue2, ft2, He2, Kt2, qt2, Jt2, Yt2, Xt2, g2, m2, y2, st2, lt2, ct2, me2, ge2, M2, Bt2, ut2, mt2, dt2.max, ht2, gt2, _t2, vt2, bt2, xt2, Se2, it2, R2, rt2, Ft2, Pt2, Et2, Ot2, Vt2, ve2, o2, Nt2, Pe2, _2, v2, Ct2, Je2, Ye2, Ne2, we2, Rt2, Ht2, zt2]);
6571
+ return h(IS.Provider, { value: Zt2, children: c2 });
6595
6572
  }
6596
- function nC(e5, t2, n2) {
6597
- let r2 = MS(e5, Px(t2), n2);
6573
+ function lC(e5, t2, n2) {
6574
+ let r2 = zS(e5, Px(t2), n2);
6598
6575
  return { target: r2, key: JSON.stringify(r2), awaitsPreferences: t2 === Ax && !e5 };
6599
6576
  }
6600
- function rC({ target: e5, awaitsPreferences: t2 }, { refreshSignal: n2, warmupData: r2, language: i2, currency: a2 }) {
6601
- return e5.by === `none` ? ks(t2 ? GS : WS) : e5.by === `multi` ? js(Tx({ key: dx(i2, a2, e5.serviceIds), refresh: n2 !== 0, warmupData: r2, fetchData: () => es(`service-context-load-multi-service`, { feature: Zo.service }, Zm(e5.serviceIds)) }), KS, qS) : js(Tx({ key: ux(i2, a2, e5.by, e5.value), refresh: n2 !== 0, warmupData: r2, fetchData: () => es(`service-context-load`, { feature: Zo.service }, e5.by === `slug` ? Ym(e5.value) : Xm(e5.value)) }), HS, US);
6577
+ function uC({ target: e5, awaitsPreferences: t2 }, { refreshSignal: n2, warmupData: r2, language: i2, currency: a2 }) {
6578
+ return e5.by === `none` ? ks(t2 ? QS : ZS) : e5.by === `multi` ? js(Tx({ key: dx(i2, a2, e5.serviceIds), refresh: n2 !== 0, warmupData: r2, fetchData: () => es(`service-context-load-multi-service`, { feature: Zo.service }, Zm(e5.serviceIds)) }), $S, eC) : js(Tx({ key: ux(i2, a2, e5.by, e5.value), refresh: n2 !== 0, warmupData: r2, fetchData: () => es(`service-context-load`, { feature: Zo.service }, e5.by === `slug` ? Ym(e5.value) : Xm(e5.value)) }), YS, XS);
6602
6579
  }
6603
- function iC({ routerSlug: e5, initialServiceId: t2, refreshSignal: n2, editingSurface: r2, children: i2 }) {
6580
+ function dC({ routerSlug: e5, initialServiceId: t2, refreshSignal: n2, editingSurface: r2, children: i2 }) {
6604
6581
  Zy(Vy.SERVICE);
6605
- let a2 = sx(), o2 = Xb(), { getParsedUrl: s2 } = ps(), c2 = Ss(), u2 = Es(`servicePageSeoTags`) && !r2 && (c2 === `servicePage` || c2 === `calendarPage`) ? c2 : null, [f2] = d(() => r2 ? null : nS(s2().searchParams)), p2 = Nx(), m2 = f2 ? `none` : p2, g2 = rx(), _2 = { refreshSignal: n2, warmupData: a2, language: o2, currency: g2 }, [v2, y2] = d(() => {
6606
- let n3 = nC(e5, m2, t2);
6607
- return { ...n3, currency: g2, promise: rC(n3, _2) };
6582
+ let a2 = sx(), o2 = Xb(), { getParsedUrl: s2 } = ps(), c2 = Ss(), u2 = Es(`servicePageSeoTags`) && !r2 && (c2 === `servicePage` || c2 === `calendarPage`) ? c2 : null, [f2] = d(() => r2 ? null : lS(s2().searchParams)), p2 = Nx(), m2 = f2 ? `none` : p2, g2 = rx(), _2 = { refreshSignal: n2, warmupData: a2, language: o2, currency: g2 }, [v2, y2] = d(() => {
6583
+ let n3 = lC(e5, m2, t2);
6584
+ return { ...n3, currency: g2, promise: uC(n3, _2) };
6608
6585
  });
6609
6586
  if (v2.awaitsPreferences && m2 !== Ax) {
6610
- let n3 = nC(e5, m2, t2), r3 = n3.key === v2.key && n3.target.by !== `none` && v2.currency === g2;
6611
- y2({ ...n3, currency: g2, promise: r3 ? v2.promise : rC(n3, _2) });
6612
- } else v2.currency !== g2 && y2({ ...v2, currency: g2, promise: rC(v2, _2) });
6587
+ let n3 = lC(e5, m2, t2), r3 = n3.key === v2.key && n3.target.by !== `none` && v2.currency === g2;
6588
+ y2({ ...n3, currency: g2, promise: r3 ? v2.promise : uC(n3, _2) });
6589
+ } else v2.currency !== g2 && y2({ ...v2, currency: g2, promise: uC(v2, _2) });
6613
6590
  let b2 = v2.promise;
6614
- return l(() => h(ZS, { servicePromise: b2, refreshSignal: n2, rescheduleRequest: f2, editingSurface: r2, seoPage: u2, children: i2 }), [b2, n2, f2, r2, u2, i2]);
6591
+ return l(() => h(iC, { servicePromise: b2, refreshSignal: n2, rescheduleRequest: f2, editingSurface: r2, seoPage: u2, children: i2 }), [b2, n2, f2, r2, u2, i2]);
6615
6592
  }
6616
- function aC({ serviceData: e5, servicePicker: t2, refreshSignal: n2 = 0, editingSurface: r2 = false, children: i2 }) {
6617
- let { pathname: a2 } = ps(), o2 = xs(), s2 = Xb(), c2 = t2?.serviceId?.$eq, u2 = e5?.service ?? null, d2 = l(() => u2 ? { service: u2, masterEvents: e5?.masterEvents ?? zS, serviceOptionsAndVariants: e5?.serviceOptionsAndVariants ?? null, bookingsSettings: e5?.bookingsSettings } : null, [u2, e5?.masterEvents, e5?.serviceOptionsAndVariants, e5?.bookingsSettings]);
6618
- return d2 ? h(ZS, { injected: d2, bookingsSettings: d2.bookingsSettings, editingSurface: r2, children: i2 }, `injected:${n2}`) : e5 ? h(ZS, { bookingsSettings: e5.bookingsSettings, editingSurface: r2, children: i2 }) : h(iC, { routerSlug: o2, initialServiceId: c2, refreshSignal: n2, editingSurface: r2, children: i2 }, `fetch:${a2}:${o2 ?? ``}:${c2 ?? ``}:${n2}:${r2}:${s2}`);
6593
+ function fC({ serviceData: e5, servicePicker: t2, refreshSignal: n2 = 0, editingSurface: r2 = false, children: i2 }) {
6594
+ let { pathname: a2 } = ps(), o2 = xs(), s2 = Xb(), c2 = t2?.serviceId?.$eq, u2 = e5?.service ?? null, d2 = l(() => u2 ? { service: u2, masterEvents: e5?.masterEvents ?? KS, serviceOptionsAndVariants: e5?.serviceOptionsAndVariants ?? null, bookingsSettings: e5?.bookingsSettings } : null, [u2, e5?.masterEvents, e5?.serviceOptionsAndVariants, e5?.bookingsSettings]);
6595
+ return d2 ? h(iC, { injected: d2, bookingsSettings: d2.bookingsSettings, editingSurface: r2, children: i2 }, `injected:${n2}`) : e5 ? h(iC, { bookingsSettings: e5.bookingsSettings, editingSurface: r2, children: i2 }) : h(dC, { routerSlug: o2, initialServiceId: c2, refreshSignal: n2, editingSurface: r2, children: i2 }, `fetch:${a2}:${o2 ?? ``}:${c2 ?? ``}:${n2}:${r2}:${s2}`);
6619
6596
  }
6620
- function oC(e5) {
6597
+ function pC(e5) {
6621
6598
  let t2 = new URL(e5);
6622
6599
  return t2.searchParams.delete(i_.blob), t2.searchParams.delete(i_.legacyBlob), t2;
6623
6600
  }
6624
- var sC = ya(`426941a1-1d08-4cf4-ae61-e433e800cde5`);
6601
+ var mC = ya(`426941a1-1d08-4cf4-ae61-e433e800cde5`);
6625
6602
  export {
6626
- AS as SERVICE_CONTEXT_MISSING_PROVIDER_ERROR,
6627
- aC as ServiceContextProvider,
6628
- aC as default,
6629
- sC as injectAccessTokenGetter,
6630
- MS as resolveServiceTarget,
6631
- kS as serviceContext,
6632
- jS as useServiceContext
6603
+ LS as SERVICE_CONTEXT_MISSING_PROVIDER_ERROR,
6604
+ fC as ServiceContextProvider,
6605
+ fC as default,
6606
+ mC as injectAccessTokenGetter,
6607
+ zS as resolveServiceTarget,
6608
+ IS as serviceContext,
6609
+ RS as useServiceContext
6633
6610
  };
6634
6611
  //# sourceMappingURL=context-service.mjs.map