@wix/bookings 1.0.1791 → 1.0.1793

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 (31) hide show
  1. package/build/cjs/context-booking-checkout.js +1 -1
  2. package/build/cjs/context-booking-checkout.js.map +1 -1
  3. package/build/cjs/context-service-addons.js +123 -134
  4. package/build/cjs/context-service-addons.js.map +1 -1
  5. package/build/cjs/context-service.d.ts +16 -6
  6. package/build/cjs/context-service.js +728 -724
  7. package/build/cjs/context-service.js.map +1 -1
  8. package/build/cjs/context-services.js +801 -812
  9. package/build/cjs/context-services.js.map +1 -1
  10. package/build/cjs/context-time-slots.js +1300 -1267
  11. package/build/cjs/context-time-slots.js.map +1 -1
  12. package/build/es/context-booking-checkout.mjs +1 -1
  13. package/build/es/context-booking-checkout.mjs.map +1 -1
  14. package/build/es/context-service-addons.mjs +123 -134
  15. package/build/es/context-service-addons.mjs.map +1 -1
  16. package/build/es/context-service.d.mts +16 -6
  17. package/build/es/context-service.mjs +728 -724
  18. package/build/es/context-service.mjs.map +1 -1
  19. package/build/es/context-services.mjs +801 -812
  20. package/build/es/context-services.mjs.map +1 -1
  21. package/build/es/context-time-slots.mjs +1300 -1267
  22. package/build/es/context-time-slots.mjs.map +1 -1
  23. package/build/internal/cjs/context-service.d.ts +16 -6
  24. package/build/internal/es/context-service.d.mts +16 -6
  25. package/context-runtime/context-booking-checkout/runtime.js +2 -2
  26. package/context-runtime/context-service/runtime.d.ts +16 -6
  27. package/context-runtime/context-service/runtime.js +2 -2
  28. package/context-runtime/context-service-addons/runtime.js +2 -2
  29. package/context-runtime/context-services/runtime.js +3 -3
  30. package/context-runtime/context-time-slots/runtime.js +3 -3
  31. package/package.json +3 -3
@@ -72,14 +72,14 @@ var E = (e2) => e2.__type === `host`;
72
72
  function D(e2, t2) {
73
73
  return e2.create(t2);
74
74
  }
75
- var O = `x-wix-bi-gateway`;
76
- function ee(e2, t2, n2) {
77
- return { [O]: te({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e2.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e2.methodFqn, entity: e2.entityFqdn }) };
75
+ var ee = `x-wix-bi-gateway`;
76
+ function O(e2, t2, n2) {
77
+ return { [ee]: k({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e2.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e2.methodFqn, entity: e2.entityFqdn }) };
78
78
  }
79
- function te(e2) {
79
+ function k(e2) {
80
80
  return Object.entries(e2).filter(([e3, t2]) => !!t2).map(([e3, t2]) => `${e3}=${t2}`).join(`,`);
81
81
  }
82
- function k(e2) {
82
+ function A(e2) {
83
83
  let t2 = globalThis.__wix_context__, n2 = { client: h.client, elevatedClient: h.elevatedClient }, r2;
84
84
  globalThis.__wix_context__ = void 0, h.client = void 0, h.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
85
85
  try {
@@ -88,82 +88,82 @@ function k(e2) {
88
88
  globalThis.__wix_context__ = t2, h.client = n2.client, h.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
89
89
  }
90
90
  }
91
- var A = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
92
- function j(e2) {
93
- return ie(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
91
+ var j = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
92
+ function M(e2) {
93
+ return re(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
94
94
  }
95
- var ne = /([\p{Ll}\d])(\p{Lu})/gu;
96
- var M = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
97
- var re = `$1\0$2`;
98
- var N = /[^\p{L}\d]+/giu;
99
- function ie(e2) {
95
+ var te = /([\p{Ll}\d])(\p{Lu})/gu;
96
+ var N = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
97
+ var ne = `$1\0$2`;
98
+ var P = /[^\p{L}\d]+/giu;
99
+ function re(e2) {
100
100
  let t2 = e2.trim();
101
- t2 = t2.replace(ne, re).replace(M, re), t2 = t2.replace(N, `\0`);
101
+ t2 = t2.replace(te, ne).replace(N, ne), t2 = t2.replace(P, `\0`);
102
102
  let n2 = 0, r2 = t2.length;
103
103
  for (; t2.charAt(n2) === `\0`; ) n2++;
104
104
  if (n2 === r2) return [];
105
105
  for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
106
106
  return t2.slice(n2, r2).split(/\0/g);
107
107
  }
108
- var ae = (e2) => `validationError` in (e2.response?.data?.details ?? {});
109
- var oe = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
110
- var se = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
111
- function P(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
108
+ var ie = (e2) => `validationError` in (e2.response?.data?.details ?? {});
109
+ var ae = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
110
+ var oe = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
111
+ function F(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
112
112
  if (typeof e2 != `object` || !e2) throw e2;
113
- if (ae(e2)) return ce(e2, t2, n2);
114
- if (oe(e2)) return ue(e2);
115
- if (se(e2)) {
116
- let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: j(n3), data: {} }, requestId: e2.requestId };
117
- return le(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
113
+ if (ie(e2)) return se(e2, t2, n2);
114
+ if (ae(e2)) return le(e2);
115
+ if (oe(e2)) {
116
+ let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: M(n3), data: {} }, requestId: e2.requestId };
117
+ return ce(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
118
118
  }
119
- return de(e2);
119
+ return ue(e2);
120
120
  }
121
- var ce = (e2, t2, n2) => {
122
- let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = fe(t2, a2, n2)?.sort((e3, t3) => e3.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e3, description: t3 }) => `"${e3}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
123
- return le(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
121
+ var se = (e2, t2, n2) => {
122
+ let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = de(t2, a2, n2)?.sort((e3, t3) => e3.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e3, description: t3 }) => `"${e3}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
123
+ return ce(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
124
124
  };
125
- var le = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
126
- var ue = (e2) => {
127
- let t2 = e2.response?.status, n2 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n2, i2 = e2.response?.data?.details?.applicationError?.description ?? n2, a2 = e2.response?.data?.details?.applicationError?.code ?? j(n2), o2 = e2.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e2.requestId };
128
- return le(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
125
+ var ce = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
126
+ var le = (e2) => {
127
+ let t2 = e2.response?.status, n2 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n2, i2 = e2.response?.data?.details?.applicationError?.description ?? n2, a2 = e2.response?.data?.details?.applicationError?.code ?? M(n2), o2 = e2.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e2.requestId };
128
+ return ce(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
129
129
  };
130
- var de = (e2) => le(e2, { message: e2.requestId ? `System error occurred, request-id: ${e2.requestId}` : `System error occurred: ${JSON.stringify(e2)}`, extraProperties: { requestId: e2.requestId, status: e2.response?.status, code: j(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
131
- var fe = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
130
+ var ue = (e2) => ce(e2, { message: e2.requestId ? `System error occurred, request-id: ${e2.requestId}` : `System error occurred: ${JSON.stringify(e2)}`, extraProperties: { requestId: e2.requestId, status: e2.response?.status, code: M(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
131
+ var de = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
132
132
  let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
133
133
  return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
134
134
  let r3 = t2[e3.field];
135
- if (r3) return { ...e3, field: pe(r3, i2) };
135
+ if (r3) return { ...e3, field: fe(r3, i2) };
136
136
  let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
137
137
  if (s2) {
138
138
  let t3 = a2[s2];
139
- if (t3) return { ...e3, field: e3.field.replace(s2, pe(t3, i2)) };
139
+ if (t3) return { ...e3, field: e3.field.replace(s2, fe(t3, i2)) };
140
140
  }
141
141
  return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
142
142
  });
143
143
  };
144
- var pe = (e2, t2) => {
145
- let n2 = F(e2);
144
+ var fe = (e2, t2) => {
145
+ let n2 = I(e2);
146
146
  return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
147
147
  };
148
- var F = (e2) => {
148
+ var I = (e2) => {
149
149
  let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
150
150
  return t2 && t2.groups && Number(t2.groups.argIndex);
151
151
  };
152
- function me(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
153
- return k(() => e2({ request: async (e3) => {
152
+ function pe(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
153
+ return A(() => e2({ request: async (e3) => {
154
154
  let i3 = e3({ host: s2?.HTTPHost || `www.wixapis.com` }), a3 = i3;
155
155
  a3.method === `GET` && a3.fallback?.length && (a3.params?.toString().length ?? 0) > 4e3 && (a3 = i3.fallback[0]);
156
156
  let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ? x : o3}${a3.url}`;
157
157
  a3.params && a3.params.toString() && (u3 += `?${a3.params.toString()}`);
158
158
  try {
159
- let e4 = ee(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e4 } }, s3 = await n2(u3, o4);
159
+ let e4 = O(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e4 } }, s3 = await n2(u3, o4);
160
160
  if (s3.status !== 200) {
161
161
  let e5 = null;
162
162
  try {
163
163
  e5 = await s3.json();
164
164
  } catch {
165
165
  }
166
- let t3 = ge(s3.status, e5?.message ?? s3.statusText, e5?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e5 }), n3 = P(t3);
166
+ let t3 = he(s3.status, e5?.message ?? s3.statusText, e5?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e5 }), n3 = F(t3);
167
167
  throw r2?.handleError(n3, { requestOptions: { url: a3.url, method: a3.method, entityFqdn: i3.entityFqdn, methodFqn: i3.methodFqn } }), t3;
168
168
  }
169
169
  let l3 = await s3.json();
@@ -173,18 +173,18 @@ function me(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
173
173
  }
174
174
  }, fetchWithAuth: n2, wixAPIFetch: i2, getActiveToken: a2, getAuthHeaders: o2 }, { validateRequestSchema: u2 }));
175
175
  }
176
- var he = class extends Error {
176
+ var me = class extends Error {
177
177
  response;
178
178
  requestId;
179
179
  constructor(e2) {
180
180
  super(), this.response = e2.response, this.requestId = e2.requestId;
181
181
  }
182
182
  };
183
- var ge = (e2, t2, n2, r2) => new he({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2 }, status: e2 }, requestId: r2?.requestId });
184
- var _e = `.`;
185
- function I(e2, t2, n2) {
183
+ var he = (e2, t2, n2, r2) => new me({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2 }, status: e2 }, requestId: r2?.requestId });
184
+ var ge = `.`;
185
+ function L(e2, t2, n2) {
186
186
  if (e2 == null) throw Error(`Cannot set value on null or undefined`);
187
- let r2 = ve(t2), i2 = e2;
187
+ let r2 = _e(t2), i2 = e2;
188
188
  for (let e3 = 0; e3 < r2.length; e3++) {
189
189
  let t3 = r2[e3];
190
190
  if (e3 === r2.length - 1) {
@@ -196,21 +196,21 @@ function I(e2, t2, n2) {
196
196
  }
197
197
  return e2;
198
198
  }
199
- function ve(e2) {
200
- return Array.isArray(e2) ? e2 : e2.split(_e).map((e3) => ye(e3) ? Number(e3) : e3);
199
+ function _e(e2) {
200
+ return Array.isArray(e2) ? e2 : e2.split(ge).map((e3) => ve(e3) ? Number(e3) : e3);
201
201
  }
202
- function ye(e2) {
202
+ function ve(e2) {
203
203
  return /^\d+$/.test(e2);
204
204
  }
205
- function be(e2) {
205
+ function ye(e2) {
206
206
  let t2 = {};
207
- for (let [n2, r2] of Object.entries(e2)) xe(n2) || I(t2, ve(n2), r2);
207
+ for (let [n2, r2] of Object.entries(e2)) be(n2) || L(t2, _e(n2), r2);
208
208
  return t2;
209
209
  }
210
- function xe(e2) {
210
+ function be(e2) {
211
211
  return e2 === `__proto__` || e2 === `constructor` || e2 === `prototype`;
212
212
  }
213
- var Se = class {
213
+ var xe = class {
214
214
  BRACKET_PATTERN = /\[(\d+)\]/g;
215
215
  NUMERIC_PATTERN = /^\d+$/;
216
216
  ESCAPED_DOT_PATTERN = /\\\./g;
@@ -233,7 +233,7 @@ var Se = class {
233
233
  return e2.replace(this.ESCAPED_DOT_PLACEHOLDER, `\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER, `\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER, `\\[`);
234
234
  }
235
235
  unflatten() {
236
- return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e2, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e2)), t2])), be(this.cleanedModifiedFields);
236
+ return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e2, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e2)), t2])), ye(this.cleanedModifiedFields);
237
237
  }
238
238
  flatten(e2) {
239
239
  let t2 = {};
@@ -253,12 +253,12 @@ var Se = class {
253
253
  if (!Array.isArray(n2)) throw Error(`Expected array at path ${this.buildPathString(r2)}, but got ${typeof n2}`);
254
254
  r2.push(`[${e3}]`), n2 = n2[parseInt(e3, 10)];
255
255
  }, a2 = (e3, t3) => {
256
- let i3 = e3 in A ? A[e3] : void 0;
256
+ let i3 = e3 in j ? j[e3] : void 0;
257
257
  if (i3 && i3 in t3) {
258
258
  r2.push(i3), n2 = t3[i3];
259
259
  return;
260
260
  }
261
- let a3 = Ee(e3);
261
+ let a3 = Te(e3);
262
262
  if (a3 && a3 in t3) {
263
263
  r2.push(a3), n2 = t3[a3];
264
264
  return;
@@ -289,28 +289,28 @@ var Se = class {
289
289
  return e2.replace(this.BRACKET_PATTERN, (t2, n2, r2) => r2 > 0 && e2[r2 - 1] === `\\` ? t2 : `.` + n2);
290
290
  }
291
291
  };
292
- function Ce(e2, t2) {
292
+ function Se(e2, t2) {
293
293
  let n2 = e2?.modifiedFields;
294
294
  if (!n2) return null;
295
- let r2 = we(n2);
295
+ let r2 = Ce(n2);
296
296
  if (!r2) return null;
297
297
  let { unflattenedModifiedFields: i2, modifiedFieldsManipulator: a2 } = r2;
298
298
  e2 = { ...e2, modifiedFields: i2 };
299
299
  let o2 = t2(e2), s2 = o2?.modifiedFields;
300
300
  if (!s2) return null;
301
- let c2 = Te(s2, a2);
301
+ let c2 = we(s2, a2);
302
302
  return c2 === null ? null : (o2.modifiedFields = c2, o2);
303
303
  }
304
- function we(e2) {
304
+ function Ce(e2) {
305
305
  if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
306
- let t2 = new Se(e2);
306
+ let t2 = new xe(e2);
307
307
  return { unflattenedModifiedFields: t2.unflatten(), modifiedFieldsManipulator: t2 };
308
308
  } catch {
309
309
  return null;
310
310
  }
311
311
  return null;
312
312
  }
313
- function Te(e2, t2) {
313
+ function we(e2, t2) {
314
314
  if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
315
315
  return t2.flatten(e2);
316
316
  } catch {
@@ -318,10 +318,10 @@ function Te(e2, t2) {
318
318
  }
319
319
  return null;
320
320
  }
321
- function Ee(e2) {
321
+ function Te(e2) {
322
322
  return e2.replace(/[-_\s]+(.)?/g, (e3, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e3) => e3.toLowerCase());
323
323
  }
324
- function De() {
324
+ function Ee() {
325
325
  return { emit(e2, ...t2) {
326
326
  for (let n2 = 0, r2 = this.events[e2] || [], i2 = r2.length; n2 < i2; n2++) r2[n2](...t2);
327
327
  }, events: {}, on(e2, t2) {
@@ -330,8 +330,8 @@ function De() {
330
330
  };
331
331
  } };
332
332
  }
333
- var Oe = (e2) => e2.__type === `event-definition`;
334
- function ke(e2, t2, n2, r2) {
333
+ var De = (e2) => e2.__type === `event-definition`;
334
+ function Oe(e2, t2, n2, r2) {
335
335
  let i2;
336
336
  if (e2.isDomainEvent) {
337
337
  let { deletedEvent: e3, actionEvent: t3, createdEvent: a3, updatedEvent: o3, ...s3 } = n2, c2 = { ...r2, ...s3 };
@@ -342,14 +342,14 @@ function ke(e2, t2, n2, r2) {
342
342
  let e3 = s2.modifiedFields;
343
343
  if (typeof e3 == `object` && e3 && !Array.isArray(e3)) {
344
344
  o2 = structuredClone(i2);
345
- let e4 = Ce(s2, a2);
345
+ let e4 = Se(s2, a2);
346
346
  if (e4) return t2(e4);
347
347
  }
348
348
  }
349
349
  return t2(a2(o2));
350
350
  }
351
- function Ae(e2) {
352
- let t2 = /* @__PURE__ */ new Map(), n2 = De();
351
+ function ke(e2) {
352
+ let t2 = /* @__PURE__ */ new Map(), n2 = Ee();
353
353
  return { initModule(e3) {
354
354
  return (r2) => {
355
355
  let i2 = t2.get(e3.type) ?? [];
@@ -359,7 +359,7 @@ function Ae(e2) {
359
359
  let { eventType: r2, identity: i2, instanceId: a2, payload: o2, accountInfo: s2 } = await this.parseJWT(e3), c2 = [...n3.expectedEvents, ...Array.from(t2.keys()).map((e4) => ({ type: e4 }))];
360
360
  if (c2.length > 0 && !c2.some(({ type: e4 }) => e4 === r2)) throw Error(`Unexpected event type: ${r2}. Expected one of: ${c2.map((e4) => e4.type).join(`, `)}`);
361
361
  let l2 = t2.get(r2) ?? [];
362
- return await Promise.all(l2.map(({ eventDefinition: e4, handler: t3 }) => ke(e4, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
362
+ return await Promise.all(l2.map(({ eventDefinition: e4, handler: t3 }) => Oe(e4, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
363
363
  }, async processRequest(e3, t3) {
364
364
  let n3 = await e3.text();
365
365
  return this.process(n3, t3);
@@ -378,12 +378,12 @@ function Ae(e2) {
378
378
  let n3 = Array.from(t2.keys()).map((e4) => ({ type: e4 }));
379
379
  if (n3.length > 0 && !n3.some(({ type: t3 }) => t3 === e3.eventType)) throw Error(`Unexpected event type: ${e3.eventType}. Expected one of: ${n3.map((e4) => e4.type).join(`, `)}`);
380
380
  let r2 = t2.get(e3.eventType) ?? [];
381
- await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => ke(t3, n4, e3.payload, { instanceId: e3.instanceId, identity: e3.identity })));
381
+ await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => Oe(t3, n4, e3.payload, { instanceId: e3.instanceId, identity: e3.identity })));
382
382
  }, apps: { AppInstalled: g(`AppInstalled`)(), AppRemoved: g(`AppRemoved`)() } } };
383
383
  }
384
- var je = (e2) => e2.__type === `service-plugin-definition`;
385
- function Me(e2) {
386
- let t2 = /* @__PURE__ */ new Map(), n2 = De();
384
+ var Ae = (e2) => e2.__type === `service-plugin-definition`;
385
+ function je(e2) {
386
+ let t2 = /* @__PURE__ */ new Map(), n2 = Ee();
387
387
  return { initModule(e3) {
388
388
  return (r2) => {
389
389
  let i2 = t2.get(e3.componentType.toLowerCase()) ?? [];
@@ -424,38 +424,38 @@ function Me(e2) {
424
424
  return s2.transformations.toREST(await c2(s2.transformations.fromREST(e3)));
425
425
  } } };
426
426
  }
427
- var Ne = `X-Wix-Consistent`;
428
- function Pe(e2) {
427
+ var Me = `X-Wix-Consistent`;
428
+ function Ne(e2) {
429
429
  let t2 = e2.headers || { Authorization: `` }, n2 = { getAuthHeaders: (e3) => Promise.resolve({ headers: {} }) }, r2 = e2.auth, i2 = typeof r2 == `function` ? r2 : () => r2 ?? n2, a2 = () => i2().getAuthHeaders(e2.host), o2 = () => e2.fetch ?? fetch, s2 = async (n3, r3) => {
430
- let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [Ne]: t2[Ne] } : {} }, l3 = e2.host?.getErrorHandler?.();
430
+ let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [Me]: t2[Me] } : {} }, l3 = e2.host?.getErrorHandler?.();
431
431
  try {
432
432
  if (typeof n3 == `string` || n3 instanceof URL) {
433
433
  let e3 = await i3(n3, { ...r3, headers: c3 });
434
434
  l3?.handleError(e3, { requestOptions: { url: n3.toString(), method: r3?.method } });
435
- let a3 = Fe(e3);
436
- return a3 && (t2[Ne] = a3), e3;
435
+ let a3 = Pe(e3);
436
+ return a3 && (t2[Me] = a3), e3;
437
437
  }
438
438
  {
439
439
  for (let [e4, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e4, t3);
440
440
  let e3 = await i3(n3, r3);
441
441
  l3?.handleError(e3, { requestOptions: { url: n3.url, method: r3?.method } });
442
- let a3 = Fe(e3);
443
- return a3 && (t2[Ne] = a3), e3;
442
+ let a3 = Pe(e3);
443
+ return a3 && (t2[Me] = a3), e3;
444
444
  }
445
445
  } catch (e3) {
446
446
  throw l3?.handleError(e3, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e3;
447
447
  }
448
- }, { client: c2, initModule: l2 } = Me(i2), { client: u2, initModule: d2 } = Ae(i2), f2 = async (n3, r3) => {
449
- let i3 = o2(), s3 = await a2(), c3 = w(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [Ne]: t2[Ne] } : {} } }), u3 = Fe(l3);
450
- return u3 && (t2[Ne] = u3), l3;
448
+ }, { client: c2, initModule: l2 } = je(i2), { client: u2, initModule: d2 } = ke(i2), f2 = async (n3, r3) => {
449
+ let i3 = o2(), s3 = await a2(), c3 = w(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [Me]: t2[Me] } : {} } }), u3 = Pe(l3);
450
+ return u3 && (t2[Me] = u3), l3;
451
451
  }, p2 = (t3, n3) => {
452
- if (Oe(t3)) return d2(t3);
453
- if (je(t3)) return l2(t3);
452
+ if (De(t3)) return d2(t3);
453
+ if (Ae(t3)) return l2(t3);
454
454
  if (E(t3) && e2.host) return D(t3, e2.host);
455
455
  if (typeof t3 == `function`) {
456
456
  if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
457
457
  let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e2.useCDN === void 0 ? i2().shouldUseCDN : e2.useCDN;
458
- return me(k(() => y(t3)) ? v(t3) : t3, n3 ?? {}, f2, e2.host?.getErrorHandler?.(), (e3, t4) => {
458
+ return pe(A(() => y(t3)) ? v(t3) : t3, n3 ?? {}, f2, e2.host?.getErrorHandler?.(), (e3, t4) => {
459
459
  let n4 = new URL(e3, `https://${r3}`);
460
460
  return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
461
461
  }, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e2.host?.name, o3, e2.validateRequestSchema);
@@ -479,19 +479,19 @@ function Pe(e2) {
479
479
  return { data: o3 ?? {}, errors: s3 };
480
480
  }, webhooks: u2, servicePlugins: c2 };
481
481
  }
482
- function Fe(e2) {
482
+ function Pe(e2) {
483
483
  return e2.headers?.get(`X-Wix-Consistent`) ?? e2.headers?.get(`x-wix-consistent`);
484
484
  }
485
- var Ie = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
486
- var Le = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
487
- function Re(e2, t2) {
485
+ var Fe = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
486
+ var Ie = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
487
+ function Le(e2, t2) {
488
488
  return e2?.split(`.`).map((e3) => t2?.[e3] ?? e3).join(`.`);
489
489
  }
490
- var ze = `sort.fieldName`;
491
- function Be(e2, t2, n2) {
492
- return (e2 === ze || e2.endsWith(`.${ze}`)) && typeof t2 == `string` ? Re(t2, n2) : t2;
490
+ var Re = `sort.fieldName`;
491
+ function ze(e2, t2, n2) {
492
+ return (e2 === Re || e2.endsWith(`.${Re}`)) && typeof t2 == `string` ? Le(t2, n2) : t2;
493
493
  }
494
- function Ve(e2, t2, n2) {
494
+ function Be(e2, t2, n2) {
495
495
  let r2 = (e3) => n2.includes(e3), i2 = (e3, n3) => {
496
496
  if (Array.isArray(e3)) e3.forEach((e4) => {
497
497
  i2(e4, n3);
@@ -501,147 +501,147 @@ function Ve(e2, t2, n2) {
501
501
  Object.keys(a2).forEach((e4) => {
502
502
  let o2 = n3 === `` ? e4 : `${n3}.${e4}`;
503
503
  if (r2(o2)) return;
504
- let s2 = He(e4, t2);
505
- s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] = Be(o2, a2[s2], t2), i2(a2[s2], o2);
504
+ let s2 = Ve(e4, t2);
505
+ s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] = ze(o2, a2[s2], t2), i2(a2[s2], o2);
506
506
  });
507
507
  }
508
508
  };
509
509
  return i2(e2, ``), e2;
510
510
  }
511
- function He(e2, t2) {
511
+ function Ve(e2, t2) {
512
512
  let n2;
513
513
  return n2 = e2.includes(`.`) ? e2.split(`.`).map((e3) => t2[e3] ?? e3).join(`.`) : t2[e2] ?? e2, n2;
514
514
  }
515
- function L(e2, t2 = []) {
516
- return Ve(e2, Ie, t2);
515
+ function R(e2, t2 = []) {
516
+ return Be(e2, Fe, t2);
517
517
  }
518
- function Ue(e2, t2 = []) {
519
- return Ve(e2, Le, t2);
518
+ function He(e2, t2 = []) {
519
+ return Be(e2, Ie, t2);
520
520
  }
521
- function R(e2) {
521
+ function z(e2) {
522
522
  return e2?.toISOString();
523
523
  }
524
- function We(e2) {
524
+ function Ue(e2) {
525
525
  return e2 ? new Date(e2) : void 0;
526
526
  }
527
- var Ge = /* @__PURE__ */ new WeakMap();
528
- function Ke() {
527
+ var We = /* @__PURE__ */ new WeakMap();
528
+ function Ge() {
529
529
  return { leaves: void 0, fields: void 0, mapFields: void 0, anyField: void 0 };
530
530
  }
531
- function qe(e2, t2) {
531
+ function Ke(e2, t2) {
532
532
  let n2 = e2.get(t2);
533
- return n2 || (n2 = Ke(), e2.set(t2, n2)), n2;
533
+ return n2 || (n2 = Ge(), e2.set(t2, n2)), n2;
534
534
  }
535
- function Je(e2, t2) {
536
- return t2 === `*` ? (e2.anyField ??= Ke(), e2.anyField) : t2.endsWith(`{}`) ? (e2.mapFields ??= /* @__PURE__ */ new Map(), qe(e2.mapFields, t2.slice(0, -2))) : (e2.fields ??= /* @__PURE__ */ new Map(), qe(e2.fields, t2));
535
+ function qe(e2, t2) {
536
+ return t2 === `*` ? (e2.anyField ??= Ge(), e2.anyField) : t2.endsWith(`{}`) ? (e2.mapFields ??= /* @__PURE__ */ new Map(), Ke(e2.mapFields, t2.slice(0, -2))) : (e2.fields ??= /* @__PURE__ */ new Map(), Ke(e2.fields, t2));
537
537
  }
538
- function Ye(e2) {
539
- let t2 = Ke();
538
+ function Je(e2) {
539
+ let t2 = Ge();
540
540
  for (let n2 of e2) {
541
- let e3 = n2.path.split(`.`).reduce(Je, t2);
541
+ let e3 = n2.path.split(`.`).reduce(qe, t2);
542
542
  e3.leaves ??= [], e3.leaves.push(n2);
543
543
  }
544
544
  return t2;
545
545
  }
546
- function Xe(e2) {
547
- let t2 = Ge.get(e2);
548
- return t2 || (t2 = Ye(e2), Ge.set(e2, t2)), t2;
546
+ function Ye(e2) {
547
+ let t2 = We.get(e2);
548
+ return t2 || (t2 = Je(e2), We.set(e2, t2)), t2;
549
549
  }
550
- function z(e2) {
550
+ function B(e2) {
551
551
  return typeof e2 == `object` && !!e2;
552
552
  }
553
- function Ze(e2, { isRepeated: t2, isMap: n2 }, r2) {
554
- return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ? z(e2) ? Object.fromEntries(Object.entries(e2).map(([e3, t3]) => [e3, r2(t3)])) : e2 : r2(e2);
553
+ function Xe(e2, { isRepeated: t2, isMap: n2 }, r2) {
554
+ return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ? B(e2) ? Object.fromEntries(Object.entries(e2).map(([e3, t3]) => [e3, r2(t3)])) : e2 : r2(e2);
555
555
  }
556
- function Qe(e2, t2, n2) {
557
- z(e2) && tt(e2, t2, n2);
556
+ function Ze(e2, t2, n2) {
557
+ B(e2) && et(e2, t2, n2);
558
558
  }
559
- function $e(e2, t2, n2) {
559
+ function Qe(e2, t2, n2) {
560
560
  for (let [r2, i2] of t2) {
561
561
  if (!(r2 in e2)) continue;
562
- if (i2.leaves) for (let t4 of i2.leaves) e2[r2] = Ze(e2[r2], t4, n2);
562
+ if (i2.leaves) for (let t4 of i2.leaves) e2[r2] = Xe(e2[r2], t4, n2);
563
563
  let t3 = e2[r2];
564
- Array.isArray(t3) ? t3.forEach((e3) => Qe(e3, i2, n2)) : Qe(t3, i2, n2);
564
+ Array.isArray(t3) ? t3.forEach((e3) => Ze(e3, i2, n2)) : Ze(t3, i2, n2);
565
565
  }
566
566
  }
567
- function et(e2, t2, n2) {
567
+ function $e(e2, t2, n2) {
568
568
  for (let [r2, i2] of t2) {
569
569
  let t3 = e2[r2];
570
- z(t3) && Object.values(t3).forEach((e3) => Qe(e3, i2, n2));
570
+ B(t3) && Object.values(t3).forEach((e3) => Ze(e3, i2, n2));
571
571
  }
572
572
  }
573
- function tt(e2, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
574
- t2 && $e(e2, t2, i2), n2 && et(e2, n2, i2), r2 && Object.values(e2).forEach((e3) => Qe(e3, r2, i2));
573
+ function et(e2, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
574
+ t2 && Qe(e2, t2, i2), n2 && $e(e2, n2, i2), r2 && Object.values(e2).forEach((e3) => Ze(e3, r2, i2));
575
575
  }
576
- function nt(e2, t2) {
577
- if (!z(e2)) return e2;
578
- for (let { paths: n2, transformFn: r2 } of t2) tt(e2, Xe(n2), r2);
576
+ function tt(e2, t2) {
577
+ if (!B(e2)) return e2;
578
+ for (let { paths: n2, transformFn: r2 } of t2) et(e2, Ye(n2), r2);
579
579
  return e2;
580
580
  }
581
- function rt(e2) {
582
- return ct(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
581
+ function nt(e2) {
582
+ return st(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
583
583
  }
584
- var it = /([\p{Ll}\d])(\p{Lu})/gu;
585
- var at = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
586
- var ot = `$1\0$2`;
587
- var st = /[^\p{L}\d]+/giu;
588
- function ct(e2) {
584
+ var rt = /([\p{Ll}\d])(\p{Lu})/gu;
585
+ var it = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
586
+ var at = `$1\0$2`;
587
+ var ot = /[^\p{L}\d]+/giu;
588
+ function st(e2) {
589
589
  let t2 = e2.trim();
590
- t2 = t2.replace(it, ot).replace(at, ot), t2 = t2.replace(st, `\0`);
590
+ t2 = t2.replace(rt, at).replace(it, at), t2 = t2.replace(ot, `\0`);
591
591
  let n2 = 0, r2 = t2.length;
592
592
  for (; t2.charAt(n2) === `\0`; ) n2++;
593
593
  if (n2 === r2) return [];
594
594
  for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
595
595
  return t2.slice(n2, r2).split(/\0/g);
596
596
  }
597
- var lt = (e2) => `validationError` in (e2.response?.data?.details ?? {});
598
- var ut = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
599
- var B = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
600
- function dt(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
597
+ var ct = (e2) => `validationError` in (e2.response?.data?.details ?? {});
598
+ var lt = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
599
+ var V = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
600
+ function ut(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
601
601
  if (typeof e2 != `object` || !e2) throw e2;
602
- if (lt(e2)) return ft(e2, t2, n2);
603
- if (ut(e2)) return mt(e2);
604
- if (B(e2)) {
605
- let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: rt(n3), data: {} }, requestId: e2.requestId };
606
- return pt(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
602
+ if (ct(e2)) return dt(e2, t2, n2);
603
+ if (lt(e2)) return pt(e2);
604
+ if (V(e2)) {
605
+ let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: nt(n3), data: {} }, requestId: e2.requestId };
606
+ return ft(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
607
607
  }
608
- return ht(e2);
608
+ return mt(e2);
609
609
  }
610
- var ft = (e2, t2, n2) => {
611
- let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = gt(t2, a2, n2)?.sort((e3, t3) => e3.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e3, description: t3 }) => `"${e3}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
612
- return pt(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
610
+ var dt = (e2, t2, n2) => {
611
+ let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = ht(t2, a2, n2)?.sort((e3, t3) => e3.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e3, description: t3 }) => `"${e3}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
612
+ return ft(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
613
613
  };
614
- var pt = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
615
- var mt = (e2) => {
616
- let t2 = e2.response?.status, n2 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n2, i2 = e2.response?.data?.details?.applicationError?.description ?? n2, a2 = e2.response?.data?.details?.applicationError?.code ?? rt(n2), o2 = e2.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e2.requestId };
617
- return pt(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
614
+ var ft = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
615
+ var pt = (e2) => {
616
+ let t2 = e2.response?.status, n2 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n2, i2 = e2.response?.data?.details?.applicationError?.description ?? n2, a2 = e2.response?.data?.details?.applicationError?.code ?? nt(n2), o2 = e2.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e2.requestId };
617
+ return ft(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
618
618
  };
619
- var ht = (e2) => pt(e2, { message: e2.requestId ? `System error occurred, request-id: ${e2.requestId}` : `System error occurred: ${JSON.stringify(e2)}`, extraProperties: { requestId: e2.requestId, status: e2.response?.status, code: rt(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
620
- var gt = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
619
+ var mt = (e2) => ft(e2, { message: e2.requestId ? `System error occurred, request-id: ${e2.requestId}` : `System error occurred: ${JSON.stringify(e2)}`, extraProperties: { requestId: e2.requestId, status: e2.response?.status, code: nt(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
620
+ var ht = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
621
621
  let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
622
622
  return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
623
623
  let r3 = t2[e3.field];
624
- if (r3) return { ...e3, field: _t(r3, i2) };
624
+ if (r3) return { ...e3, field: gt(r3, i2) };
625
625
  let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
626
626
  if (s2) {
627
627
  let t3 = a2[s2];
628
- if (t3) return { ...e3, field: e3.field.replace(s2, _t(t3, i2)) };
628
+ if (t3) return { ...e3, field: e3.field.replace(s2, gt(t3, i2)) };
629
629
  }
630
630
  return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
631
631
  });
632
632
  };
633
- var _t = (e2, t2) => {
634
- let n2 = vt(e2);
633
+ var gt = (e2, t2) => {
634
+ let n2 = _t(e2);
635
635
  return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
636
636
  };
637
- var vt = (e2) => {
637
+ var _t = (e2) => {
638
638
  let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
639
639
  return t2 && t2.groups && Number(t2.groups.argIndex);
640
640
  };
641
- function yt() {
641
+ function vt() {
642
642
  let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
643
643
  if (e2) return { initWixModules(t3, n3) {
644
- return bt(() => e2(t3, n3));
644
+ return yt(() => e2(t3, n3));
645
645
  }, fetchWithAuth() {
646
646
  throw Error(`fetchWithAuth is not available in this context`);
647
647
  }, graphql() {
@@ -651,10 +651,10 @@ function yt() {
651
651
  if (t2 || n2) return { initWixModules(e3, r2) {
652
652
  if (r2) {
653
653
  if (!n2) throw Error(`An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules`);
654
- return bt(() => n2.use(e3));
654
+ return yt(() => n2.use(e3));
655
655
  }
656
656
  if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
657
- return bt(() => t2.use(e3));
657
+ return yt(() => t2.use(e3));
658
658
  }, fetchWithAuth: (e3, n3) => {
659
659
  if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
660
660
  return t2.fetchWithAuth(e3, n3);
@@ -666,7 +666,7 @@ function yt() {
666
666
  return t2.graphql(e3, n3, r2);
667
667
  } };
668
668
  }
669
- function bt(e2) {
669
+ function yt(e2) {
670
670
  let t2 = globalThis.__wix_context__, n2 = { client: h.client, elevatedClient: h.elevatedClient }, r2;
671
671
  globalThis.__wix_context__ = void 0, h.client = void 0, h.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
672
672
  try {
@@ -675,101 +675,101 @@ function bt(e2) {
675
675
  globalThis.__wix_context__ = t2, h.client = n2.client, h.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
676
676
  }
677
677
  }
678
- function xt(e2, t2) {
678
+ function bt(e2, t2) {
679
679
  return (...n2) => {
680
- let r2 = yt();
680
+ let r2 = vt();
681
681
  return r2 ? r2.initWixModules(e2, t2).apply(void 0, n2) : e2.apply(void 0, n2);
682
682
  };
683
683
  }
684
- function St(e2, t2 = false) {
685
- return xt(e2, t2);
684
+ function xt(e2, t2 = false) {
685
+ return bt(e2, t2);
686
686
  }
687
- function Ct(e2, t2) {
688
- let n2 = V(e2), r2 = Object.entries(n2).some(([e3, t3]) => e3.includes(`.`) || Array.isArray(t3) && t3.some((e4) => typeof e4 == `object`));
689
- return t2 && r2 ? new URLSearchParams({ ".r": Et(JSON.stringify(e2)) }) : Object.entries(n2).reduce((e3, [t3, n3]) => ((Array.isArray(n3) ? n3 : [n3]).forEach((r3) => {
687
+ function St(e2, t2) {
688
+ let n2 = H(e2), r2 = Object.entries(n2).some(([e3, t3]) => e3.includes(`.`) || Array.isArray(t3) && t3.some((e4) => typeof e4 == `object`));
689
+ return t2 && r2 ? new URLSearchParams({ ".r": Tt(JSON.stringify(e2)) }) : Object.entries(n2).reduce((e3, [t3, n3]) => ((Array.isArray(n3) ? n3 : [n3]).forEach((r3) => {
690
690
  r3 == null || Array.isArray(n3) && typeof r3 == `object` || e3.append(t3, r3);
691
691
  }), e3), new URLSearchParams());
692
692
  }
693
- function wt(e2) {
694
- let t2 = zt(Lt(e2.host), e2.domainToMappings);
695
- return Jt(Gt(e2.protoPath, e2.data || {}), t2);
693
+ function Ct(e2) {
694
+ let t2 = Rt(It(e2.host), e2.domainToMappings);
695
+ return qt(Wt(e2.protoPath, e2.data || {}), t2);
696
696
  }
697
- function V(e2, t2 = ``) {
697
+ function H(e2, t2 = ``) {
698
698
  let n2 = {};
699
699
  return Object.entries(e2).forEach(([e3, r2]) => {
700
- let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 = Tt(t2, e3);
700
+ let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 = wt(t2, e3);
701
701
  if (i2) {
702
- let e4 = V(r2, a2);
702
+ let e4 = H(r2, a2);
703
703
  Object.assign(n2, e4);
704
704
  } else n2[a2] = r2;
705
705
  }), n2;
706
706
  }
707
- function Tt(e2, t2) {
707
+ function wt(e2, t2) {
708
708
  return `${e2}${e2 ? `.` : ``}${t2}`;
709
709
  }
710
- var Et = (e2) => {
710
+ var Tt = (e2) => {
711
711
  let t2 = new TextEncoder().encode(e2);
712
712
  return (typeof btoa < `u` ? btoa(String.fromCodePoint(...t2)) : Buffer.from(e2, `utf-8`).toString(`base64`)).replace(/=/g, ``).replace(/\+/g, `-`).replace(/\//g, `_`);
713
713
  };
714
- var Dt = [`wix.com`, `editorx.com`];
715
- var Ot = `_`;
716
- var kt = `*.`;
717
- var At = RegExp(`\\.(${Dt.join(`|`)})$`);
718
- var jt = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
719
- var Mt = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
720
- var Nt = `dev.wix-code.com`;
721
- var Pt = /{(.*)}/;
722
- var Ft = RegExp(`\\.(${jt.join(`|`)})$`);
723
- var It = RegExp(`.*\\.${Nt}$`);
724
- function Lt(e2) {
725
- return Rt(e2).replace(At, `._base_domain_`).replace(Ft, `._api_base_domain_`).replace(It, `*.dev.wix-code.com`);
714
+ var Et = [`wix.com`, `editorx.com`];
715
+ var Dt = `_`;
716
+ var Ot = `*.`;
717
+ var kt = RegExp(`\\.(${Et.join(`|`)})$`);
718
+ var At = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
719
+ var jt = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
720
+ var Mt = `dev.wix-code.com`;
721
+ var Nt = /{(.*)}/;
722
+ var Pt = RegExp(`\\.(${At.join(`|`)})$`);
723
+ var Ft = RegExp(`.*\\.${Mt}$`);
724
+ function It(e2) {
725
+ return Lt(e2).replace(kt, `._base_domain_`).replace(Pt, `._api_base_domain_`).replace(Ft, `*.dev.wix-code.com`);
726
726
  }
727
- function Rt(e2) {
728
- return Mt[e2] ?? e2;
727
+ function Lt(e2) {
728
+ return jt[e2] ?? e2;
729
729
  }
730
- function zt(e2, t2) {
730
+ function Rt(e2, t2) {
731
731
  let n2 = t2[e2];
732
732
  if (n2) return n2;
733
- let r2 = Bt(e2, t2) ?? Vt(e2, t2);
733
+ let r2 = zt(e2, t2) ?? Bt(e2, t2);
734
734
  if (!r2) {
735
- if (Ut(e2)) {
736
- let e3 = t2[Wt];
735
+ if (Ht(e2)) {
736
+ let e3 = t2[Ut];
737
737
  if (e3) return e3;
738
738
  }
739
- let n3 = t2[Ot];
739
+ let n3 = t2[Dt];
740
740
  if (n3) return n3;
741
741
  }
742
742
  return r2 ?? [];
743
743
  }
744
- function Bt(e2, t2) {
744
+ function zt(e2, t2) {
745
745
  return Object.entries(t2).find(([t3]) => {
746
746
  let [, ...n2] = e2.split(`.`);
747
747
  return n2.join(`.`) === t3;
748
748
  })?.[1];
749
749
  }
750
- function Vt(e2, t2) {
751
- let [n2] = Object.entries(t2).filter(([t3]) => Ht(e2, t3)).sort(([e3], [t3]) => t3.length - e3.length);
750
+ function Bt(e2, t2) {
751
+ let [n2] = Object.entries(t2).filter(([t3]) => Vt(e2, t3)).sort(([e3], [t3]) => t3.length - e3.length);
752
752
  if (!n2) return;
753
753
  let [, r2] = n2;
754
754
  return r2;
755
755
  }
756
- function Ht(e2, t2) {
757
- if (!t2.startsWith(kt)) return false;
756
+ function Vt(e2, t2) {
757
+ if (!t2.startsWith(Ot)) return false;
758
758
  let n2 = t2.slice(1);
759
759
  return e2.length > n2.length && e2.endsWith(n2);
760
760
  }
761
- function Ut(e2) {
761
+ function Ht(e2) {
762
762
  return !!e2.match(/\._base_domain_$/);
763
763
  }
764
- var Wt = `www._base_domain_`;
765
- function Gt(e2, t2) {
766
- return e2.split(`/`).map((e3) => Kt(e3, t2)).join(`/`);
764
+ var Ut = `www._base_domain_`;
765
+ function Wt(e2, t2) {
766
+ return e2.split(`/`).map((e3) => Gt(e3, t2)).join(`/`);
767
767
  }
768
- function Kt(e2, t2) {
769
- let n2 = e2.match(Pt) || [], r2 = n2[1];
770
- return r2 ? qt(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
768
+ function Gt(e2, t2) {
769
+ let n2 = e2.match(Nt) || [], r2 = n2[1];
770
+ return r2 ? Kt(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
771
771
  }
772
- function qt(e2, t2, n2, r2) {
772
+ function Kt(e2, t2, n2, r2) {
773
773
  let i2 = e2;
774
774
  for (let e3 of t2.split(`.`)) {
775
775
  if (!i2) return n2;
@@ -777,43 +777,43 @@ function qt(e2, t2, n2, r2) {
777
777
  }
778
778
  return `${i2}${r2}`;
779
779
  }
780
- function Jt(e2, t2) {
780
+ function qt(e2, t2) {
781
781
  let n2 = t2?.find((t3) => e2.startsWith(t3.destPath));
782
782
  return n2 ? n2.srcPath + e2.slice(n2.destPath.length) : e2;
783
783
  }
784
- function H(e2) {
784
+ function U(e2) {
785
785
  return e2 === `NaN` ? NaN : e2 === `Infinity` ? 1 / 0 : e2 === `-Infinity` ? -1 / 0 : e2;
786
786
  }
787
- var Yt = `x-wix-currency`;
788
- var Xt = () => {
789
- let e2 = rn(`currency`);
790
- if (e2) return { [Yt]: e2 };
787
+ var Jt = `x-wix-currency`;
788
+ var Yt = () => {
789
+ let e2 = nn(`currency`);
790
+ if (e2) return { [Jt]: e2 };
791
791
  };
792
- var Zt = `x-wix-linguist`;
793
- var Qt = `00000000-0000-0000-0000-000000000000`;
794
- var $t = `false`;
795
- var en = () => {
796
- let e2 = rn(`language`), t2 = rn(`locale`);
797
- if (e2) return { [Zt]: [e2, t2 || e2, $t, Qt].join(`|`) };
792
+ var Xt = `x-wix-linguist`;
793
+ var Zt = `00000000-0000-0000-0000-000000000000`;
794
+ var Qt = `false`;
795
+ var $t = () => {
796
+ let e2 = nn(`language`), t2 = nn(`locale`);
797
+ if (e2) return { [Xt]: [e2, t2 || e2, Qt, Zt].join(`|`) };
798
798
  };
799
- function tn() {
799
+ function en() {
800
800
  let e2 = null, t2 = null;
801
801
  return { promise: new Promise((n2, r2) => {
802
802
  e2 = n2, t2 = r2;
803
803
  }), resolve: e2, reject: t2 };
804
804
  }
805
- var nn = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
806
- var rn = (e2) => nn()?.[e2];
807
- var an = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
808
- let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = U();
809
- return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: rn(`language`), locale: rn(`locale`), get passThroughHeaders() {
810
- let e3 = { ...en(), ...Xt() };
805
+ var tn = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
806
+ var nn = (e2) => tn()?.[e2];
807
+ var rn = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
808
+ let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = W();
809
+ return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: nn(`language`), locale: nn(`locale`), get passThroughHeaders() {
810
+ let e3 = { ...$t(), ...Yt() };
811
811
  return Object.keys(e3).length > 0 ? e3 : void 0;
812
812
  } } };
813
813
  }, auth: (e3) => {
814
814
  let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
815
- !e3 && on() && (e3 = t2?.getAccessTokenFunction?.());
816
- let n2 = false, { resolve: r2, promise: i2 } = tn();
815
+ !e3 && an() && (e3 = t2?.getAccessTokenFunction?.());
816
+ let n2 = false, { resolve: r2, promise: i2 } = en();
817
817
  return { getAuthHeaders: async () => {
818
818
  if (!e3 && n2 && (e3 = await i2), !e3) throw Error(`Failed to resolve auth token`);
819
819
  return { headers: { Authorization: await e3() } };
@@ -821,477 +821,477 @@ var an = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host:
821
821
  r2(e4);
822
822
  }) };
823
823
  } });
824
- function on() {
824
+ function an() {
825
825
  return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
826
826
  }
827
- function U() {
827
+ function W() {
828
828
  let e2 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
829
829
  if (!e2) return;
830
830
  let t2 = new URL(e2);
831
831
  return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
832
832
  }
833
- var sn = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
833
+ var on = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
834
834
  if (!e2) throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);
835
835
  return e2.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
836
836
  }, getAccessToken: () => {
837
837
  throw Error(`Not implemented`);
838
838
  }, observeState: () => ({ disconnect: () => {
839
839
  } }) });
840
- var cn = an({ createHost: function(e2) {
840
+ var sn = rn({ createHost: function(e2) {
841
841
  let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e2?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e2 || {};
842
842
  if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
843
- return { channel: sn({ clientSdk: t2, applicationId: n2 }), close: () => {
843
+ return { channel: on({ clientSdk: t2, applicationId: n2 }), close: () => {
844
844
  } };
845
845
  } });
846
- var ln = (e2, t2) => {
847
- let n2 = cn.host({ applicationId: e2, componentId: t2 }), r2 = cn.auth();
848
- return Pe({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
849
- };
850
- var un = (e2) => ln(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`, e2);
851
- var dn = [`ANY_FEMALE`, `ANY_MALE`];
852
- var fn = `3.7.8`;
853
- var pn = fn;
854
- var mn = typeof Buffer == `function`;
855
- var hn = typeof TextDecoder == `function` ? new TextDecoder() : void 0;
856
- var gn = typeof TextEncoder == `function` ? new TextEncoder() : void 0;
857
- var _n = Array.prototype.slice.call(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`);
858
- var vn = ((e2) => {
846
+ var cn = (e2, t2) => {
847
+ let n2 = sn.host({ applicationId: e2, componentId: t2 }), r2 = sn.auth();
848
+ return Ne({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
849
+ };
850
+ var ln = (e2) => cn(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`, e2);
851
+ var un = [`ANY_FEMALE`, `ANY_MALE`];
852
+ var dn = `3.7.8`;
853
+ var fn = dn;
854
+ var pn = typeof Buffer == `function`;
855
+ var mn = typeof TextDecoder == `function` ? new TextDecoder() : void 0;
856
+ var hn = typeof TextEncoder == `function` ? new TextEncoder() : void 0;
857
+ var gn = Array.prototype.slice.call(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`);
858
+ var _n = ((e2) => {
859
859
  let t2 = {};
860
860
  return e2.forEach((e3, n2) => t2[e3] = n2), t2;
861
- })(_n);
862
- var yn = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
863
- var W = String.fromCharCode.bind(String);
864
- var bn = typeof Uint8Array.from == `function` ? Uint8Array.from.bind(Uint8Array) : (e2) => new Uint8Array(Array.prototype.slice.call(e2, 0));
865
- var xn = (e2) => e2.replace(/=/g, ``).replace(/[+\/]/g, (e3) => e3 == `+` ? `-` : `_`);
866
- var Sn = (e2) => e2.replace(/[^A-Za-z0-9\+\/]/g, ``);
867
- var Cn = (e2) => {
861
+ })(gn);
862
+ var vn = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
863
+ var G = String.fromCharCode.bind(String);
864
+ var yn = typeof Uint8Array.from == `function` ? Uint8Array.from.bind(Uint8Array) : (e2) => new Uint8Array(Array.prototype.slice.call(e2, 0));
865
+ var bn = (e2) => e2.replace(/=/g, ``).replace(/[+\/]/g, (e3) => e3 == `+` ? `-` : `_`);
866
+ var xn = (e2) => e2.replace(/[^A-Za-z0-9\+\/]/g, ``);
867
+ var Sn = (e2) => {
868
868
  let t2, n2, r2, i2, a2 = ``, o2 = e2.length % 3;
869
869
  for (let o3 = 0; o3 < e2.length; ) {
870
870
  if ((n2 = e2.charCodeAt(o3++)) > 255 || (r2 = e2.charCodeAt(o3++)) > 255 || (i2 = e2.charCodeAt(o3++)) > 255) throw TypeError(`invalid character found`);
871
- t2 = n2 << 16 | r2 << 8 | i2, a2 += _n[t2 >> 18 & 63] + _n[t2 >> 12 & 63] + _n[t2 >> 6 & 63] + _n[t2 & 63];
871
+ t2 = n2 << 16 | r2 << 8 | i2, a2 += gn[t2 >> 18 & 63] + gn[t2 >> 12 & 63] + gn[t2 >> 6 & 63] + gn[t2 & 63];
872
872
  }
873
873
  return o2 ? a2.slice(0, o2 - 3) + `===`.substring(o2) : a2;
874
874
  };
875
- var wn = typeof btoa == `function` ? (e2) => btoa(e2) : mn ? (e2) => Buffer.from(e2, `binary`).toString(`base64`) : Cn;
876
- var Tn = mn ? (e2) => Buffer.from(e2).toString(`base64`) : (e2) => {
875
+ var Cn = typeof btoa == `function` ? (e2) => btoa(e2) : pn ? (e2) => Buffer.from(e2, `binary`).toString(`base64`) : Sn;
876
+ var wn = pn ? (e2) => Buffer.from(e2).toString(`base64`) : (e2) => {
877
877
  let t2 = 4096, n2 = [];
878
- for (let r2 = 0, i2 = e2.length; r2 < i2; r2 += t2) n2.push(W.apply(null, e2.subarray(r2, r2 + t2)));
879
- return wn(n2.join(``));
878
+ for (let r2 = 0, i2 = e2.length; r2 < i2; r2 += t2) n2.push(G.apply(null, e2.subarray(r2, r2 + t2)));
879
+ return Cn(n2.join(``));
880
880
  };
881
- var En = (e2, t2 = false) => t2 ? xn(Tn(e2)) : Tn(e2);
882
- var Dn = (e2) => {
881
+ var Tn = (e2, t2 = false) => t2 ? bn(wn(e2)) : wn(e2);
882
+ var En = (e2) => {
883
883
  if (e2.length < 2) {
884
884
  var t2 = e2.charCodeAt(0);
885
- return t2 < 128 ? e2 : t2 < 2048 ? W(192 | t2 >>> 6) + W(128 | t2 & 63) : W(224 | t2 >>> 12 & 15) + W(128 | t2 >>> 6 & 63) + W(128 | t2 & 63);
885
+ return t2 < 128 ? e2 : t2 < 2048 ? G(192 | t2 >>> 6) + G(128 | t2 & 63) : G(224 | t2 >>> 12 & 15) + G(128 | t2 >>> 6 & 63) + G(128 | t2 & 63);
886
886
  }
887
887
  var t2 = 65536 + (e2.charCodeAt(0) - 55296) * 1024 + (e2.charCodeAt(1) - 56320);
888
- return W(240 | t2 >>> 18 & 7) + W(128 | t2 >>> 12 & 63) + W(128 | t2 >>> 6 & 63) + W(128 | t2 & 63);
889
- };
890
- var On = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
891
- var kn = (e2) => e2.replace(On, Dn);
892
- var An = mn ? (e2) => Buffer.from(e2, `utf8`).toString(`base64`) : gn ? (e2) => Tn(gn.encode(e2)) : (e2) => wn(kn(e2));
893
- var jn = (e2, t2 = false) => t2 ? xn(An(e2)) : An(e2);
894
- var Mn = (e2) => jn(e2, true);
895
- var G = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
896
- var Nn = (e2) => {
888
+ return G(240 | t2 >>> 18 & 7) + G(128 | t2 >>> 12 & 63) + G(128 | t2 >>> 6 & 63) + G(128 | t2 & 63);
889
+ };
890
+ var Dn = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
891
+ var On = (e2) => e2.replace(Dn, En);
892
+ var kn = pn ? (e2) => Buffer.from(e2, `utf8`).toString(`base64`) : hn ? (e2) => wn(hn.encode(e2)) : (e2) => Cn(On(e2));
893
+ var An = (e2, t2 = false) => t2 ? bn(kn(e2)) : kn(e2);
894
+ var jn = (e2) => An(e2, true);
895
+ var K = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
896
+ var Mn = (e2) => {
897
897
  switch (e2.length) {
898
898
  case 4:
899
899
  var t2 = ((7 & e2.charCodeAt(0)) << 18 | (63 & e2.charCodeAt(1)) << 12 | (63 & e2.charCodeAt(2)) << 6 | 63 & e2.charCodeAt(3)) - 65536;
900
- return W((t2 >>> 10) + 55296) + W((t2 & 1023) + 56320);
900
+ return G((t2 >>> 10) + 55296) + G((t2 & 1023) + 56320);
901
901
  case 3:
902
- return W((15 & e2.charCodeAt(0)) << 12 | (63 & e2.charCodeAt(1)) << 6 | 63 & e2.charCodeAt(2));
902
+ return G((15 & e2.charCodeAt(0)) << 12 | (63 & e2.charCodeAt(1)) << 6 | 63 & e2.charCodeAt(2));
903
903
  default:
904
- return W((31 & e2.charCodeAt(0)) << 6 | 63 & e2.charCodeAt(1));
904
+ return G((31 & e2.charCodeAt(0)) << 6 | 63 & e2.charCodeAt(1));
905
905
  }
906
906
  };
907
- var Pn = (e2) => e2.replace(G, Nn);
908
- var Fn = (e2) => {
909
- if (e2 = e2.replace(/\s+/g, ``), !yn.test(e2)) throw TypeError(`malformed base64.`);
907
+ var Nn = (e2) => e2.replace(K, Mn);
908
+ var Pn = (e2) => {
909
+ if (e2 = e2.replace(/\s+/g, ``), !vn.test(e2)) throw TypeError(`malformed base64.`);
910
910
  e2 += `==`.slice(2 - (e2.length & 3));
911
911
  let t2, n2, r2, i2 = [];
912
- for (let a2 = 0; a2 < e2.length; ) t2 = vn[e2.charAt(a2++)] << 18 | vn[e2.charAt(a2++)] << 12 | (n2 = vn[e2.charAt(a2++)]) << 6 | (r2 = vn[e2.charAt(a2++)]), n2 === 64 ? i2.push(W(t2 >> 16 & 255)) : r2 === 64 ? i2.push(W(t2 >> 16 & 255, t2 >> 8 & 255)) : i2.push(W(t2 >> 16 & 255, t2 >> 8 & 255, t2 & 255));
912
+ for (let a2 = 0; a2 < e2.length; ) t2 = _n[e2.charAt(a2++)] << 18 | _n[e2.charAt(a2++)] << 12 | (n2 = _n[e2.charAt(a2++)]) << 6 | (r2 = _n[e2.charAt(a2++)]), n2 === 64 ? i2.push(G(t2 >> 16 & 255)) : r2 === 64 ? i2.push(G(t2 >> 16 & 255, t2 >> 8 & 255)) : i2.push(G(t2 >> 16 & 255, t2 >> 8 & 255, t2 & 255));
913
913
  return i2.join(``);
914
914
  };
915
- var In = typeof atob == `function` ? (e2) => atob(Sn(e2)) : mn ? (e2) => Buffer.from(e2, `base64`).toString(`binary`) : Fn;
916
- var Ln = mn ? (e2) => bn(Buffer.from(e2, `base64`)) : (e2) => bn(In(e2).split(``).map((e3) => e3.charCodeAt(0)));
917
- var Rn = (e2) => Ln(Bn(e2));
918
- var zn = mn ? (e2) => Buffer.from(e2, `base64`).toString(`utf8`) : hn ? (e2) => hn.decode(Ln(e2)) : (e2) => Pn(In(e2));
919
- var Bn = (e2) => Sn(e2.replace(/[-_]/g, (e3) => e3 == `-` ? `+` : `/`));
920
- var Vn = (e2) => zn(Bn(e2));
921
- var Hn = (e2) => {
915
+ var Fn = typeof atob == `function` ? (e2) => atob(xn(e2)) : pn ? (e2) => Buffer.from(e2, `base64`).toString(`binary`) : Pn;
916
+ var In = pn ? (e2) => yn(Buffer.from(e2, `base64`)) : (e2) => yn(Fn(e2).split(``).map((e3) => e3.charCodeAt(0)));
917
+ var Ln = (e2) => In(zn(e2));
918
+ var Rn = pn ? (e2) => Buffer.from(e2, `base64`).toString(`utf8`) : mn ? (e2) => mn.decode(In(e2)) : (e2) => Nn(Fn(e2));
919
+ var zn = (e2) => xn(e2.replace(/[-_]/g, (e3) => e3 == `-` ? `+` : `/`));
920
+ var Bn = (e2) => Rn(zn(e2));
921
+ var Vn = (e2) => {
922
922
  if (typeof e2 != `string`) return false;
923
923
  let t2 = e2.replace(/\s+/g, ``).replace(/={0,2}$/, ``);
924
924
  return !/[^\s0-9a-zA-Z\+/]/.test(t2) || !/[^\s0-9a-zA-Z\-_]/.test(t2);
925
925
  };
926
- var Un = (e2) => ({ value: e2, enumerable: false, writable: true, configurable: true });
927
- var Wn = function() {
928
- let e2 = (e3, t2) => Object.defineProperty(String.prototype, e3, Un(t2));
926
+ var Hn = (e2) => ({ value: e2, enumerable: false, writable: true, configurable: true });
927
+ var Un = function() {
928
+ let e2 = (e3, t2) => Object.defineProperty(String.prototype, e3, Hn(t2));
929
929
  e2(`fromBase64`, function() {
930
- return Vn(this);
930
+ return Bn(this);
931
931
  }), e2(`toBase64`, function(e3) {
932
- return jn(this, e3);
932
+ return An(this, e3);
933
933
  }), e2(`toBase64URI`, function() {
934
- return jn(this, true);
934
+ return An(this, true);
935
935
  }), e2(`toBase64URL`, function() {
936
- return jn(this, true);
936
+ return An(this, true);
937
937
  }), e2(`toUint8Array`, function() {
938
- return Rn(this);
938
+ return Ln(this);
939
939
  });
940
940
  };
941
- var Gn = function() {
942
- let e2 = (e3, t2) => Object.defineProperty(Uint8Array.prototype, e3, Un(t2));
941
+ var Wn = function() {
942
+ let e2 = (e3, t2) => Object.defineProperty(Uint8Array.prototype, e3, Hn(t2));
943
943
  e2(`toBase64`, function(e3) {
944
- return En(this, e3);
944
+ return Tn(this, e3);
945
945
  }), e2(`toBase64URI`, function() {
946
- return En(this, true);
946
+ return Tn(this, true);
947
947
  }), e2(`toBase64URL`, function() {
948
- return En(this, true);
948
+ return Tn(this, true);
949
949
  });
950
950
  };
951
- var Kn = { version: fn, VERSION: pn, atob: In, atobPolyfill: Fn, btoa: wn, btoaPolyfill: Cn, fromBase64: Vn, toBase64: jn, encode: jn, encodeURI: Mn, encodeURL: Mn, utob: kn, btou: Pn, decode: Vn, isValid: Hn, fromUint8Array: En, toUint8Array: Rn, extendString: Wn, extendUint8Array: Gn, extendBuiltins: () => {
952
- Wn(), Gn();
951
+ var Gn = { version: dn, VERSION: fn, atob: Fn, atobPolyfill: Pn, btoa: Cn, btoaPolyfill: Sn, fromBase64: Bn, toBase64: An, encode: An, encodeURI: jn, encodeURL: jn, utob: On, btou: Nn, decode: Bn, isValid: Vn, fromUint8Array: Tn, toUint8Array: Ln, extendString: Un, extendUint8Array: Wn, extendBuiltins: () => {
952
+ Un(), Wn();
953
953
  } };
954
- var K = Uint8Array;
955
- var qn = Uint16Array;
956
- var Jn = Int32Array;
957
- var Yn = new K([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0]);
958
- var Xn = new K([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0]);
959
- var Zn = new K([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
960
- var Qn = function(e2, t2) {
961
- for (var n2 = new qn(31), r2 = 0; r2 < 31; ++r2) n2[r2] = t2 += 1 << e2[r2 - 1];
962
- for (var i2 = new Jn(n2[30]), r2 = 1; r2 < 30; ++r2) for (var a2 = n2[r2]; a2 < n2[r2 + 1]; ++a2) i2[a2] = a2 - n2[r2] << 5 | r2;
954
+ var q = Uint8Array;
955
+ var Kn = Uint16Array;
956
+ var qn = Int32Array;
957
+ var Jn = new q([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0]);
958
+ var Yn = new q([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0]);
959
+ var Xn = new q([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
960
+ var Zn = function(e2, t2) {
961
+ for (var n2 = new Kn(31), r2 = 0; r2 < 31; ++r2) n2[r2] = t2 += 1 << e2[r2 - 1];
962
+ for (var i2 = new qn(n2[30]), r2 = 1; r2 < 30; ++r2) for (var a2 = n2[r2]; a2 < n2[r2 + 1]; ++a2) i2[a2] = a2 - n2[r2] << 5 | r2;
963
963
  return { b: n2, r: i2 };
964
964
  };
965
- var $n = Qn(Yn, 2);
966
- var er = $n.b;
967
- var tr = $n.r;
968
- er[28] = 258, tr[258] = 28;
969
- var nr = Qn(Xn, 0);
970
- var rr = nr.b;
971
- nr.r;
972
- for (ir = new qn(32768), q = 0; q < 32768; ++q) {
973
- ar = (q & 43690) >> 1 | (q & 21845) << 1;
974
- ar = (ar & 52428) >> 2 | (ar & 13107) << 2, ar = (ar & 61680) >> 4 | (ar & 3855) << 4, ir[q] = ((ar & 65280) >> 8 | (ar & 255) << 8) >> 1;
965
+ var Qn = Zn(Jn, 2);
966
+ var $n = Qn.b;
967
+ var er = Qn.r;
968
+ $n[28] = 258, er[258] = 28;
969
+ var tr = Zn(Yn, 0);
970
+ var nr = tr.b;
971
+ tr.r;
972
+ for (rr = new Kn(32768), J = 0; J < 32768; ++J) {
973
+ ir = (J & 43690) >> 1 | (J & 21845) << 1;
974
+ ir = (ir & 52428) >> 2 | (ir & 13107) << 2, ir = (ir & 61680) >> 4 | (ir & 3855) << 4, rr[J] = ((ir & 65280) >> 8 | (ir & 255) << 8) >> 1;
975
975
  }
976
- var ar;
977
976
  var ir;
978
- var q;
979
- for (or = function(e2, t2, n2) {
980
- for (var r2 = e2.length, i2 = 0, a2 = new qn(t2); i2 < r2; ++i2) e2[i2] && ++a2[e2[i2] - 1];
981
- var o2 = new qn(t2);
977
+ var rr;
978
+ var J;
979
+ for (ar = function(e2, t2, n2) {
980
+ for (var r2 = e2.length, i2 = 0, a2 = new Kn(t2); i2 < r2; ++i2) e2[i2] && ++a2[e2[i2] - 1];
981
+ var o2 = new Kn(t2);
982
982
  for (i2 = 1; i2 < t2; ++i2) o2[i2] = o2[i2 - 1] + a2[i2 - 1] << 1;
983
983
  var s2;
984
984
  if (n2) {
985
- s2 = new qn(1 << t2);
985
+ s2 = new Kn(1 << t2);
986
986
  var c2 = 15 - t2;
987
- for (i2 = 0; i2 < r2; ++i2) if (e2[i2]) for (var l2 = i2 << 4 | e2[i2], u2 = t2 - e2[i2], d2 = o2[e2[i2] - 1]++ << u2, f2 = d2 | (1 << u2) - 1; d2 <= f2; ++d2) s2[ir[d2] >> c2] = l2;
988
- } else for (s2 = new qn(r2), i2 = 0; i2 < r2; ++i2) e2[i2] && (s2[i2] = ir[o2[e2[i2] - 1]++] >> 15 - e2[i2]);
987
+ for (i2 = 0; i2 < r2; ++i2) if (e2[i2]) for (var l2 = i2 << 4 | e2[i2], u2 = t2 - e2[i2], d2 = o2[e2[i2] - 1]++ << u2, f2 = d2 | (1 << u2) - 1; d2 <= f2; ++d2) s2[rr[d2] >> c2] = l2;
988
+ } else for (s2 = new Kn(r2), i2 = 0; i2 < r2; ++i2) e2[i2] && (s2[i2] = rr[o2[e2[i2] - 1]++] >> 15 - e2[i2]);
989
989
  return s2;
990
- }, sr = new K(288), q = 0; q < 144; ++q) sr[q] = 8;
990
+ }, or = new q(288), J = 0; J < 144; ++J) or[J] = 8;
991
+ var ar;
991
992
  var or;
993
+ var J;
994
+ for (J = 144; J < 256; ++J) or[J] = 9;
995
+ var J;
996
+ for (J = 256; J < 280; ++J) or[J] = 7;
997
+ var J;
998
+ for (J = 280; J < 288; ++J) or[J] = 8;
999
+ var J;
1000
+ for (sr = new q(32), J = 0; J < 32; ++J) sr[J] = 5;
992
1001
  var sr;
993
- var q;
994
- for (q = 144; q < 256; ++q) sr[q] = 9;
995
- var q;
996
- for (q = 256; q < 280; ++q) sr[q] = 7;
997
- var q;
998
- for (q = 280; q < 288; ++q) sr[q] = 8;
999
- var q;
1000
- for (cr = new K(32), q = 0; q < 32; ++q) cr[q] = 5;
1001
- var cr;
1002
- var q;
1003
- var lr = or(sr, 9, 1);
1004
- var ur = or(cr, 5, 1);
1005
- var dr = function(e2) {
1002
+ var J;
1003
+ var cr = ar(or, 9, 1);
1004
+ var lr = ar(sr, 5, 1);
1005
+ var ur = function(e2) {
1006
1006
  for (var t2 = e2[0], n2 = 1; n2 < e2.length; ++n2) e2[n2] > t2 && (t2 = e2[n2]);
1007
1007
  return t2;
1008
1008
  };
1009
- var fr = function(e2, t2, n2) {
1009
+ var dr = function(e2, t2, n2) {
1010
1010
  var r2 = t2 / 8 | 0;
1011
1011
  return (e2[r2] | e2[r2 + 1] << 8) >> (t2 & 7) & n2;
1012
1012
  };
1013
- var pr = function(e2, t2) {
1013
+ var fr = function(e2, t2) {
1014
1014
  var n2 = t2 / 8 | 0;
1015
1015
  return (e2[n2] | e2[n2 + 1] << 8 | e2[n2 + 2] << 16) >> (t2 & 7);
1016
1016
  };
1017
- var mr = function(e2) {
1017
+ var pr = function(e2) {
1018
1018
  return (e2 + 7) / 8 | 0;
1019
1019
  };
1020
- var hr = function(e2, t2, n2) {
1021
- return (t2 == null || t2 < 0) && (t2 = 0), (n2 == null || n2 > e2.length) && (n2 = e2.length), new K(e2.subarray(t2, n2));
1020
+ var mr = function(e2, t2, n2) {
1021
+ return (t2 == null || t2 < 0) && (t2 = 0), (n2 == null || n2 > e2.length) && (n2 = e2.length), new q(e2.subarray(t2, n2));
1022
1022
  };
1023
- var gr = [`unexpected EOF`, `invalid block type`, `invalid length/literal`, `invalid distance`, `stream finished`, `no stream handler`, , `no callback`, `invalid UTF-8 data`, `extra field too long`, `date not in range 1980-2099`, `filename too long`, `stream finishing`, `invalid zip data`];
1024
- var _r = function(e2, t2, n2) {
1025
- var r2 = Error(t2 || gr[e2]);
1026
- if (r2.code = e2, Error.captureStackTrace && Error.captureStackTrace(r2, _r), !n2) throw r2;
1023
+ var hr = [`unexpected EOF`, `invalid block type`, `invalid length/literal`, `invalid distance`, `stream finished`, `no stream handler`, , `no callback`, `invalid UTF-8 data`, `extra field too long`, `date not in range 1980-2099`, `filename too long`, `stream finishing`, `invalid zip data`];
1024
+ var gr = function(e2, t2, n2) {
1025
+ var r2 = Error(t2 || hr[e2]);
1026
+ if (r2.code = e2, Error.captureStackTrace && Error.captureStackTrace(r2, gr), !n2) throw r2;
1027
1027
  return r2;
1028
1028
  };
1029
- var vr = function(e2, t2, n2, r2) {
1029
+ var _r = function(e2, t2, n2, r2) {
1030
1030
  var i2 = e2.length, a2 = r2 ? r2.length : 0;
1031
- if (!i2 || t2.f && !t2.l) return n2 || new K(0);
1031
+ if (!i2 || t2.f && !t2.l) return n2 || new q(0);
1032
1032
  var o2 = !n2, s2 = o2 || t2.i != 2, c2 = t2.i;
1033
- o2 && (n2 = new K(i2 * 3));
1033
+ o2 && (n2 = new q(i2 * 3));
1034
1034
  var l2 = function(e3) {
1035
1035
  var t3 = n2.length;
1036
1036
  if (e3 > t3) {
1037
- var r3 = new K(Math.max(t3 * 2, e3));
1037
+ var r3 = new q(Math.max(t3 * 2, e3));
1038
1038
  r3.set(n2), n2 = r3;
1039
1039
  }
1040
1040
  }, u2 = t2.f || 0, d2 = t2.p || 0, f2 = t2.b || 0, p2 = t2.l, m2 = t2.d, h2 = t2.m, g2 = t2.n, _2 = i2 * 8;
1041
1041
  do {
1042
1042
  if (!p2) {
1043
- u2 = fr(e2, d2, 1);
1044
- var v2 = fr(e2, d2 + 1, 3);
1043
+ u2 = dr(e2, d2, 1);
1044
+ var v2 = dr(e2, d2 + 1, 3);
1045
1045
  if (d2 += 3, !v2) {
1046
- var y2 = mr(d2) + 4, b2 = e2[y2 - 4] | e2[y2 - 3] << 8, x2 = y2 + b2;
1046
+ var y2 = pr(d2) + 4, b2 = e2[y2 - 4] | e2[y2 - 3] << 8, x2 = y2 + b2;
1047
1047
  if (x2 > i2) {
1048
- c2 && _r(0);
1048
+ c2 && gr(0);
1049
1049
  break;
1050
1050
  }
1051
1051
  s2 && l2(f2 + b2), n2.set(e2.subarray(y2, x2), f2), t2.b = f2 += b2, t2.p = d2 = x2 * 8, t2.f = u2;
1052
1052
  continue;
1053
1053
  }
1054
- if (v2 == 1) p2 = lr, m2 = ur, h2 = 9, g2 = 5;
1054
+ if (v2 == 1) p2 = cr, m2 = lr, h2 = 9, g2 = 5;
1055
1055
  else if (v2 == 2) {
1056
- var S2 = fr(e2, d2, 31) + 257, C2 = fr(e2, d2 + 10, 15) + 4, w2 = S2 + fr(e2, d2 + 5, 31) + 1;
1056
+ var S2 = dr(e2, d2, 31) + 257, C2 = dr(e2, d2 + 10, 15) + 4, w2 = S2 + dr(e2, d2 + 5, 31) + 1;
1057
1057
  d2 += 14;
1058
- for (var T2 = new K(w2), E2 = new K(19), D2 = 0; D2 < C2; ++D2) E2[Zn[D2]] = fr(e2, d2 + D2 * 3, 7);
1058
+ for (var T2 = new q(w2), E2 = new q(19), D2 = 0; D2 < C2; ++D2) E2[Xn[D2]] = dr(e2, d2 + D2 * 3, 7);
1059
1059
  d2 += C2 * 3;
1060
- for (var O2 = dr(E2), ee2 = (1 << O2) - 1, te2 = or(E2, O2, 1), D2 = 0; D2 < w2; ) {
1061
- var k2 = te2[fr(e2, d2, ee2)];
1062
- d2 += k2 & 15;
1063
- var y2 = k2 >> 4;
1060
+ for (var ee2 = ur(E2), O2 = (1 << ee2) - 1, k2 = ar(E2, ee2, 1), D2 = 0; D2 < w2; ) {
1061
+ var A2 = k2[dr(e2, d2, O2)];
1062
+ d2 += A2 & 15;
1063
+ var y2 = A2 >> 4;
1064
1064
  if (y2 < 16) T2[D2++] = y2;
1065
1065
  else {
1066
- var A2 = 0, j2 = 0;
1067
- for (y2 == 16 ? (j2 = 3 + fr(e2, d2, 3), d2 += 2, A2 = T2[D2 - 1]) : y2 == 17 ? (j2 = 3 + fr(e2, d2, 7), d2 += 3) : y2 == 18 && (j2 = 11 + fr(e2, d2, 127), d2 += 7); j2--; ) T2[D2++] = A2;
1066
+ var j2 = 0, M2 = 0;
1067
+ for (y2 == 16 ? (M2 = 3 + dr(e2, d2, 3), d2 += 2, j2 = T2[D2 - 1]) : y2 == 17 ? (M2 = 3 + dr(e2, d2, 7), d2 += 3) : y2 == 18 && (M2 = 11 + dr(e2, d2, 127), d2 += 7); M2--; ) T2[D2++] = j2;
1068
1068
  }
1069
1069
  }
1070
- var ne2 = T2.subarray(0, S2), M2 = T2.subarray(S2);
1071
- h2 = dr(ne2), g2 = dr(M2), p2 = or(ne2, h2, 1), m2 = or(M2, g2, 1);
1072
- } else _r(1);
1070
+ var te2 = T2.subarray(0, S2), N2 = T2.subarray(S2);
1071
+ h2 = ur(te2), g2 = ur(N2), p2 = ar(te2, h2, 1), m2 = ar(N2, g2, 1);
1072
+ } else gr(1);
1073
1073
  if (d2 > _2) {
1074
- c2 && _r(0);
1074
+ c2 && gr(0);
1075
1075
  break;
1076
1076
  }
1077
1077
  }
1078
1078
  s2 && l2(f2 + 131072);
1079
- for (var re2 = (1 << h2) - 1, N2 = (1 << g2) - 1, ie2 = d2; ; ie2 = d2) {
1080
- var A2 = p2[pr(e2, d2) & re2], ae2 = A2 >> 4;
1081
- if (d2 += A2 & 15, d2 > _2) {
1082
- c2 && _r(0);
1079
+ for (var ne2 = (1 << h2) - 1, P2 = (1 << g2) - 1, re2 = d2; ; re2 = d2) {
1080
+ var j2 = p2[fr(e2, d2) & ne2], ie2 = j2 >> 4;
1081
+ if (d2 += j2 & 15, d2 > _2) {
1082
+ c2 && gr(0);
1083
1083
  break;
1084
1084
  }
1085
- if (A2 || _r(2), ae2 < 256) n2[f2++] = ae2;
1086
- else if (ae2 == 256) {
1087
- ie2 = d2, p2 = null;
1085
+ if (j2 || gr(2), ie2 < 256) n2[f2++] = ie2;
1086
+ else if (ie2 == 256) {
1087
+ re2 = d2, p2 = null;
1088
1088
  break;
1089
1089
  } else {
1090
- var oe2 = ae2 - 254;
1091
- if (ae2 > 264) {
1092
- var D2 = ae2 - 257, se2 = Yn[D2];
1093
- oe2 = fr(e2, d2, (1 << se2) - 1) + er[D2], d2 += se2;
1090
+ var ae2 = ie2 - 254;
1091
+ if (ie2 > 264) {
1092
+ var D2 = ie2 - 257, oe2 = Jn[D2];
1093
+ ae2 = dr(e2, d2, (1 << oe2) - 1) + $n[D2], d2 += oe2;
1094
1094
  }
1095
- var P2 = m2[pr(e2, d2) & N2], ce2 = P2 >> 4;
1096
- P2 || _r(3), d2 += P2 & 15;
1097
- var M2 = rr[ce2];
1098
- if (ce2 > 3) {
1099
- var se2 = Xn[ce2];
1100
- M2 += pr(e2, d2) & (1 << se2) - 1, d2 += se2;
1095
+ var F2 = m2[fr(e2, d2) & P2], se2 = F2 >> 4;
1096
+ F2 || gr(3), d2 += F2 & 15;
1097
+ var N2 = nr[se2];
1098
+ if (se2 > 3) {
1099
+ var oe2 = Yn[se2];
1100
+ N2 += fr(e2, d2) & (1 << oe2) - 1, d2 += oe2;
1101
1101
  }
1102
1102
  if (d2 > _2) {
1103
- c2 && _r(0);
1103
+ c2 && gr(0);
1104
1104
  break;
1105
1105
  }
1106
1106
  s2 && l2(f2 + 131072);
1107
- var le2 = f2 + oe2;
1108
- if (f2 < M2) {
1109
- var ue2 = a2 - M2, de2 = Math.min(M2, le2);
1110
- for (ue2 + f2 < 0 && _r(3); f2 < de2; ++f2) n2[f2] = r2[ue2 + f2];
1107
+ var ce2 = f2 + ae2;
1108
+ if (f2 < N2) {
1109
+ var le2 = a2 - N2, ue2 = Math.min(N2, ce2);
1110
+ for (le2 + f2 < 0 && gr(3); f2 < ue2; ++f2) n2[f2] = r2[le2 + f2];
1111
1111
  }
1112
- for (; f2 < le2; ++f2) n2[f2] = n2[f2 - M2];
1112
+ for (; f2 < ce2; ++f2) n2[f2] = n2[f2 - N2];
1113
1113
  }
1114
1114
  }
1115
- t2.l = p2, t2.p = ie2, t2.b = f2, t2.f = u2, p2 && (u2 = 1, t2.m = h2, t2.d = m2, t2.n = g2);
1115
+ t2.l = p2, t2.p = re2, t2.b = f2, t2.f = u2, p2 && (u2 = 1, t2.m = h2, t2.d = m2, t2.n = g2);
1116
1116
  } while (!u2);
1117
- return f2 != n2.length && o2 ? hr(n2, 0, f2) : n2.subarray(0, f2);
1117
+ return f2 != n2.length && o2 ? mr(n2, 0, f2) : n2.subarray(0, f2);
1118
1118
  };
1119
- var yr = new K(0);
1120
- var br = function(e2) {
1121
- (e2[0] != 31 || e2[1] != 139 || e2[2] != 8) && _r(6, `invalid gzip data`);
1119
+ var vr = new q(0);
1120
+ var yr = function(e2) {
1121
+ (e2[0] != 31 || e2[1] != 139 || e2[2] != 8) && gr(6, `invalid gzip data`);
1122
1122
  var t2 = e2[3], n2 = 10;
1123
1123
  t2 & 4 && (n2 += (e2[10] | e2[11] << 8) + 2);
1124
1124
  for (var r2 = (t2 >> 3 & 1) + (t2 >> 4 & 1); r2 > 0; r2 -= !e2[n2++]) ;
1125
1125
  return n2 + (t2 & 2);
1126
1126
  };
1127
- var xr = function(e2) {
1127
+ var br = function(e2) {
1128
1128
  var t2 = e2.length;
1129
1129
  return (e2[t2 - 4] | e2[t2 - 3] << 8 | e2[t2 - 2] << 16 | e2[t2 - 1] << 24) >>> 0;
1130
1130
  };
1131
- function Sr(e2, t2) {
1132
- var n2 = br(e2);
1133
- return n2 + 8 > e2.length && _r(6, `invalid gzip data`), vr(e2.subarray(n2, -8), { i: 2 }, t2 && t2.out || new K(xr(e2)), t2 && t2.dictionary);
1131
+ function xr(e2, t2) {
1132
+ var n2 = yr(e2);
1133
+ return n2 + 8 > e2.length && gr(6, `invalid gzip data`), _r(e2.subarray(n2, -8), { i: 2 }, t2 && t2.out || new q(br(e2)), t2 && t2.dictionary);
1134
1134
  }
1135
- var Cr = typeof TextDecoder < `u` && new TextDecoder();
1135
+ var Sr = typeof TextDecoder < `u` && new TextDecoder();
1136
1136
  try {
1137
- Cr.decode(yr, { stream: true });
1137
+ Sr.decode(vr, { stream: true });
1138
1138
  } catch {
1139
1139
  }
1140
- var wr = /* @__PURE__ */ new Set([`APPOINTMENT`, `CLASS`, `COURSE`]);
1141
- var Tr = new Set(dn);
1142
- function J(e2) {
1140
+ var Cr = /* @__PURE__ */ new Set([`APPOINTMENT`, `CLASS`, `COURSE`]);
1141
+ var wr = new Set(un);
1142
+ function Y(e2) {
1143
1143
  return typeof e2 == `string` ? e2 : void 0;
1144
1144
  }
1145
- function Er(e2) {
1145
+ function Tr(e2) {
1146
1146
  return typeof e2 == `number` && Number.isFinite(e2) ? e2 : void 0;
1147
1147
  }
1148
- function Dr(e2) {
1148
+ function Er(e2) {
1149
1149
  return typeof e2 == `boolean` ? e2 : void 0;
1150
1150
  }
1151
- function Or(e2) {
1151
+ function Dr(e2) {
1152
1152
  if (Array.isArray(e2)) return e2.filter((e3) => typeof e3 == `string`);
1153
1153
  }
1154
- function kr(e2) {
1154
+ function Or(e2) {
1155
1155
  return typeof e2 == `object` && !!e2;
1156
1156
  }
1157
- function Ar(e2) {
1158
- if (!kr(e2)) return null;
1159
- let t2 = J(e2.t);
1157
+ function kr(e2) {
1158
+ if (!Or(e2)) return null;
1159
+ let t2 = Y(e2.t);
1160
1160
  if (t2 === void 0) return null;
1161
- let n2 = { type: t2, ids: Or(e2.d) ?? [] }, r2 = Dr(e2.n);
1161
+ let n2 = { type: t2, ids: Dr(e2.d) ?? [] }, r2 = Er(e2.n);
1162
1162
  return r2 !== void 0 && (n2.anyResource = r2), n2;
1163
1163
  }
1164
- function jr(e2) {
1165
- if (!kr(e2)) return null;
1166
- let t2 = Er(e2.p), n2 = Or(e2.h);
1164
+ function Ar(e2) {
1165
+ if (!Or(e2)) return null;
1166
+ let t2 = Tr(e2.p), n2 = Dr(e2.h);
1167
1167
  if (t2 === void 0 && n2 === void 0) return null;
1168
1168
  let r2 = {};
1169
1169
  return t2 !== void 0 && (r2.numberOfParticipants = t2), n2 !== void 0 && (r2.choices = n2), r2;
1170
1170
  }
1171
- function Mr(e2) {
1172
- if (!kr(e2)) return null;
1173
- let t2 = J(e2.i), n2 = Er(e2.q);
1171
+ function jr(e2) {
1172
+ if (!Or(e2)) return null;
1173
+ let t2 = Y(e2.i), n2 = Tr(e2.q);
1174
1174
  return t2 === void 0 || n2 === void 0 ? null : { id: t2, quantity: n2 };
1175
1175
  }
1176
- function Nr(e2, t2) {
1176
+ function Mr(e2, t2) {
1177
1177
  if (!Array.isArray(e2)) return;
1178
1178
  let n2 = e2.map(t2).filter((e3) => e3 !== null);
1179
1179
  return n2.length ? n2 : void 0;
1180
1180
  }
1181
- function Pr(e2) {
1182
- if (!kr(e2)) return null;
1183
- let t2 = J(e2.i);
1181
+ function Nr(e2) {
1182
+ if (!Or(e2)) return null;
1183
+ let t2 = Y(e2.i);
1184
1184
  if (t2 === void 0) return null;
1185
- let n2 = { serviceId: t2 }, r2 = J(e2.g);
1185
+ let n2 = { serviceId: t2 }, r2 = Y(e2.g);
1186
1186
  r2 !== void 0 && (n2.slug = r2);
1187
1187
  let i2 = function(e3) {
1188
- let t3 = J(e3);
1189
- if (t3 !== void 0 && wr.has(t3)) return t3;
1188
+ let t3 = Y(e3);
1189
+ if (t3 !== void 0 && Cr.has(t3)) return t3;
1190
1190
  }(e2.y);
1191
1191
  i2 !== void 0 && (n2.serviceType = i2);
1192
- let a2 = J(e2.t0);
1192
+ let a2 = Y(e2.t0);
1193
1193
  a2 !== void 0 && (n2.slotStart = a2);
1194
- let o2 = J(e2.t1);
1194
+ let o2 = Y(e2.t1);
1195
1195
  o2 !== void 0 && (n2.slotEnd = o2);
1196
- let s2 = J(e2.e);
1196
+ let s2 = Y(e2.e);
1197
1197
  s2 !== void 0 && (n2.eventId = s2);
1198
- let c2 = J(e2.c);
1198
+ let c2 = Y(e2.c);
1199
1199
  c2 !== void 0 && (n2.scheduleId = c2);
1200
- let l2 = J(e2.k);
1200
+ let l2 = Y(e2.k);
1201
1201
  l2 !== void 0 && (n2.sessionId = l2);
1202
- let u2 = J(e2.l);
1202
+ let u2 = Y(e2.l);
1203
1203
  u2 !== void 0 && (n2.locationId = u2);
1204
- let d2 = J(e2.lt);
1204
+ let d2 = Y(e2.lt);
1205
1205
  d2 !== `BUSINESS` && d2 !== `CUSTOM` && d2 !== `CUSTOMER` || (n2.locationType = d2);
1206
- let f2 = Nr(e2.r, Ar);
1206
+ let f2 = Mr(e2.r, kr);
1207
1207
  f2 && (n2.resources = f2);
1208
- let p2 = Nr(e2.x, jr);
1208
+ let p2 = Mr(e2.x, Ar);
1209
1209
  p2 && (n2.selectedVariants = p2);
1210
- let m2 = Nr(e2.a, Mr);
1210
+ let m2 = Mr(e2.a, jr);
1211
1211
  m2 && (n2.addOns = m2);
1212
- let h2 = J(e2.dc);
1212
+ let h2 = Y(e2.dc);
1213
1213
  h2 && (n2.durationChoiceId = h2);
1214
- let g2 = Er(e2.dm);
1214
+ let g2 = Tr(e2.dm);
1215
1215
  g2 !== void 0 && Number.isInteger(g2) && g2 > 0 && (n2.durationInMinutes = g2);
1216
- let _2 = J(e2.rg);
1217
- return _2 !== void 0 && Tr.has(_2) && (n2.requestedGender = _2), n2;
1216
+ let _2 = Y(e2.rg);
1217
+ return _2 !== void 0 && wr.has(_2) && (n2.requestedGender = _2), n2;
1218
1218
  }
1219
- function Fr(e2) {
1220
- if (!kr(e2)) return null;
1221
- let t2 = J(e2.m);
1219
+ function Pr(e2) {
1220
+ if (!Or(e2)) return null;
1221
+ let t2 = Y(e2.m);
1222
1222
  if (t2 !== `single` && t2 !== `multi` || !Array.isArray(e2.s)) return null;
1223
- let n2 = { mode: t2, services: e2.s.map(Pr).filter((e3) => e3 !== null) }, r2 = J(e2.z);
1224
- return r2 !== void 0 && (n2.timezone = r2), true === Dr(e2.cp) && (n2.wantsPromoCode = true), n2;
1223
+ let n2 = { mode: t2, services: e2.s.map(Nr).filter((e3) => e3 !== null) }, r2 = Y(e2.z);
1224
+ return r2 !== void 0 && (n2.timezone = r2), true === Er(e2.cp) && (n2.wantsPromoCode = true), n2;
1225
1225
  }
1226
1226
  new TextEncoder();
1227
- var Ir = new TextDecoder();
1228
- function Lr(e2) {
1227
+ var Fr = new TextDecoder();
1228
+ function Ir(e2) {
1229
1229
  if (!e2 || e2.length < 2) return null;
1230
1230
  try {
1231
- let t2 = e2[0], n2 = Kn.toUint8Array(e2.slice(1)), r2;
1231
+ let t2 = e2[0], n2 = Gn.toUint8Array(e2.slice(1)), r2;
1232
1232
  if (t2 === `1`) r2 = n2;
1233
1233
  else {
1234
1234
  if (t2 !== `2`) return null;
1235
- r2 = Sr(n2);
1235
+ r2 = xr(n2);
1236
1236
  }
1237
- return Fr(JSON.parse(Ir.decode(r2)));
1237
+ return Pr(JSON.parse(Fr.decode(r2)));
1238
1238
  } catch {
1239
1239
  return null;
1240
1240
  }
1241
1241
  }
1242
- function Rr(e2) {
1242
+ function Lr(e2) {
1243
1243
  return e2;
1244
1244
  }
1245
- var zr = Rr(`@wix/site-service-editor-context`);
1246
- var Br = Rr(`@wix/site-service-pages`);
1247
- var Vr = Rr(`@wix/site-service-router`);
1248
- var Hr = Rr(`@wix/site-service-url`);
1249
- var Ur = Rr(`@wix/site-service-renderer-configuration`);
1250
- var Wr = `13d21c63-b5ec-5912-8397-c3a5ddb27a97`;
1251
- var Gr = `shopping_cart`;
1252
- var Kr = `thank_you_page`;
1253
- var qr = `1cd44cf8-756f-41c3-bd90-3e2ffcaf1155`;
1254
- var Jr = function(e2) {
1245
+ var Rr = Lr(`@wix/site-service-editor-context`);
1246
+ var zr = Lr(`@wix/site-service-pages`);
1247
+ var Br = Lr(`@wix/site-service-router`);
1248
+ var Vr = Lr(`@wix/site-service-url`);
1249
+ var Hr = Lr(`@wix/site-service-renderer-configuration`);
1250
+ var Ur = `13d21c63-b5ec-5912-8397-c3a5ddb27a97`;
1251
+ var Wr = `shopping_cart`;
1252
+ var Gr = `thank_you_page`;
1253
+ var Kr = `1cd44cf8-756f-41c3-bd90-3e2ffcaf1155`;
1254
+ var qr = function(e2) {
1255
1255
  return e2.BOOK_ONLINE = `bookingsBookOnline`, e2.SERVICE_PAGE = `bookingsServicePage`, e2.CALENDAR_PAGE = `bookingsCalendar`, e2.FORM_PAGE = `bookingsForm`, e2;
1256
1256
  }({});
1257
- var Yr = `{{(.*?)}}`;
1258
- var Xr = `[{{}}]`;
1259
- var Zr = `([^/]+)`;
1260
- var Qr;
1257
+ var Jr = `{{(.*?)}}`;
1258
+ var Yr = `[{{}}]`;
1259
+ var Xr = `([^/]+)`;
1260
+ var Zr;
1261
1261
  (function(e2) {
1262
1262
  e2.product_page = `product_page`, e2.blog = `blog`, e2.post = `post`, e2.forum = `forum`, e2.group = `group`, e2.bookings = `Booking Service Page`, e2.challenges = `challenge_page`;
1263
- })(Qr ||= {});
1264
- var Y;
1263
+ })(Zr ||= {});
1264
+ var X;
1265
1265
  (function(e2) {
1266
1266
  e2.PRODUCT_PAGE = `wix.stores.sub_pages.product`, e2.BLOG_POST = `wix.blog.sub_pages.post`, e2.BLOG_POST_EDIT = `wix.blog.sub_pages.post.edit`, e2.BLOG_POST_PREVIEW = `wix.blog.sub_pages.post.preview`, e2.BLOG_CATEGORY = `wix.blog.sub_pages.category`, e2.FORUM_CATEGORY = `wix.forum.sub_pages.category`, e2.FORUM_CATEGORY_PAGINATION = `wix.forum.sub_pages.category.pagination`, e2.FORUM_CATEGORY_CREATE_POST = `wix.forum.sub_pages.category.create-post`, e2.FORUM_CATEGORY_CREATE_QUESTION = `wix.forum.sub_pages.category.create-question`, e2.FORUM_POST = `wix.forum.sub_pages.post`, e2.FORUM_POST_EDIT = `wix.forum.sub_pages.post.edit`, e2.FORUM_POST_PAGINATION = `wix.forum.sub_pages.post.pagination`, e2.FORUM_POST_DEEP_LINK_DATA = `wix.forum.sub_pages.post.deep-link-data`, e2.FORUM_POST_PAGINATION_AND_DEEP_LINK_DATA = `wix.forum.sub_pages.post.pagination-and-deep-link-data`, e2.GROUP = `wix.groups.sub_pages.group`, e2.GROUP_POST = `wix.groups.sub_pages.post`, e2.BOOKINGS_SERVICE = `wix.bookings.sub_pages.service_page`, e2.CHALLENGES_PAGE = `wix.online_programs.sub_pages.online_program`;
1267
- })(Y ||= {});
1268
- var $r = {};
1269
- var ei = ($r[Y.PRODUCT_PAGE] = { variables: [`slug`], required: [`slug`] }, $r);
1270
- var ti = `{{main-mapping}}`;
1271
- var ni = {};
1272
- var ri;
1273
- var ii = (ni[Y.BLOG_POST] = { variables: [`slug`], required: [`slug`], subMappings: (ri = {}, ri[Y.BLOG_POST_EDIT] = { defaultMapping: `${ti}/edit` }, ri[Y.BLOG_POST_PREVIEW] = { required: [`instance`], defaultMapping: `${ti}/preview/{{instance}}` }, ri) }, ni);
1274
- var ai = {};
1275
- var oi = (ai[Y.BLOG_CATEGORY] = { variables: [`slug`], required: [`slug`], defaultPrefix: `categories` }, ai);
1276
- var si = {};
1267
+ })(X ||= {});
1268
+ var Qr = {};
1269
+ var $r = (Qr[X.PRODUCT_PAGE] = { variables: [`slug`], required: [`slug`] }, Qr);
1270
+ var ei = `{{main-mapping}}`;
1271
+ var ti = {};
1272
+ var ni;
1273
+ var ri = (ti[X.BLOG_POST] = { variables: [`slug`], required: [`slug`], subMappings: (ni = {}, ni[X.BLOG_POST_EDIT] = { defaultMapping: `${ei}/edit` }, ni[X.BLOG_POST_PREVIEW] = { required: [`instance`], defaultMapping: `${ei}/preview/{{instance}}` }, ni) }, ti);
1274
+ var ii = {};
1275
+ var ai = (ii[X.BLOG_CATEGORY] = { variables: [`slug`], required: [`slug`], defaultPrefix: `categories` }, ii);
1276
+ var oi = {};
1277
+ var si;
1277
1278
  var ci;
1278
- var li;
1279
- var ui = (si[Y.FORUM_POST] = { variables: [`categorySlug`, `postSlug`], required: [`categorySlug`, `postSlug`], subMappings: (ci = {}, ci[Y.FORUM_POST_EDIT] = { defaultMapping: `${ti}/edit` }, ci[Y.FORUM_POST_PAGINATION] = { required: [`page`], defaultMapping: `${ti}/p-{{page}}` }, ci[Y.FORUM_POST_DEEP_LINK_DATA] = { required: [`deepLinkData`], defaultMapping: `${ti}/dl-{{deepLinkData}}` }, ci[Y.FORUM_POST_PAGINATION_AND_DEEP_LINK_DATA] = { required: [`page`, `deepLinkData`], defaultMapping: `${ti}/p-{{page}}/dl-{{deepLinkData}}` }, ci) }, si[Y.FORUM_CATEGORY] = { variables: [`slug`], required: [`slug`], subMappings: (li = {}, li[Y.FORUM_CATEGORY_CREATE_POST] = { defaultMapping: `${ti}/create-post` }, li[Y.FORUM_CATEGORY_CREATE_QUESTION] = { defaultMapping: `${ti}/create-question` }, li[Y.FORUM_CATEGORY_PAGINATION] = { required: [`page`], defaultMapping: `${ti}/p-{{page}}` }, li) }, si);
1280
- var di = {};
1281
- var fi = (di[Y.GROUP] = { variables: [`groupId`, `tabName`], required: [`groupId`, `tabName`] }, di[Y.GROUP_POST] = { variables: [`groupId`, `tabName`, `postId`], required: [`groupId`, `tabName`, `postId`] }, di);
1282
- var pi = {};
1283
- var mi = (pi[Y.BOOKINGS_SERVICE] = { variables: [`slug`], required: [`slug`], defaultPrefix: `service-page` }, pi);
1284
- var hi = {};
1285
- var gi = (hi[Y.CHALLENGES_PAGE] = { variables: [`slug`], required: [`slug`], defaultPrefix: `challenge-page` }, hi);
1286
- var _i = {};
1287
- var vi = (_i[Qr.product_page] = ei, _i[Qr.post] = ii, _i[Qr.blog] = oi, _i[Qr.forum] = ui, _i[Qr.group] = fi, _i[Qr.bookings] = mi, _i[Qr.challenges] = gi, _i);
1288
- var yi = function() {
1289
- return yi = Object.assign || function(e2) {
1279
+ var li = (oi[X.FORUM_POST] = { variables: [`categorySlug`, `postSlug`], required: [`categorySlug`, `postSlug`], subMappings: (si = {}, si[X.FORUM_POST_EDIT] = { defaultMapping: `${ei}/edit` }, si[X.FORUM_POST_PAGINATION] = { required: [`page`], defaultMapping: `${ei}/p-{{page}}` }, si[X.FORUM_POST_DEEP_LINK_DATA] = { required: [`deepLinkData`], defaultMapping: `${ei}/dl-{{deepLinkData}}` }, si[X.FORUM_POST_PAGINATION_AND_DEEP_LINK_DATA] = { required: [`page`, `deepLinkData`], defaultMapping: `${ei}/p-{{page}}/dl-{{deepLinkData}}` }, si) }, oi[X.FORUM_CATEGORY] = { variables: [`slug`], required: [`slug`], subMappings: (ci = {}, ci[X.FORUM_CATEGORY_CREATE_POST] = { defaultMapping: `${ei}/create-post` }, ci[X.FORUM_CATEGORY_CREATE_QUESTION] = { defaultMapping: `${ei}/create-question` }, ci[X.FORUM_CATEGORY_PAGINATION] = { required: [`page`], defaultMapping: `${ei}/p-{{page}}` }, ci) }, oi);
1280
+ var ui = {};
1281
+ var di = (ui[X.GROUP] = { variables: [`groupId`, `tabName`], required: [`groupId`, `tabName`] }, ui[X.GROUP_POST] = { variables: [`groupId`, `tabName`, `postId`], required: [`groupId`, `tabName`, `postId`] }, ui);
1282
+ var fi = {};
1283
+ var pi = (fi[X.BOOKINGS_SERVICE] = { variables: [`slug`], required: [`slug`], defaultPrefix: `service-page` }, fi);
1284
+ var mi = {};
1285
+ var hi = (mi[X.CHALLENGES_PAGE] = { variables: [`slug`], required: [`slug`], defaultPrefix: `challenge-page` }, mi);
1286
+ var gi = {};
1287
+ var _i = (gi[Zr.product_page] = $r, gi[Zr.post] = ri, gi[Zr.blog] = ai, gi[Zr.forum] = li, gi[Zr.group] = di, gi[Zr.bookings] = pi, gi[Zr.challenges] = hi, gi);
1288
+ var vi = function() {
1289
+ return vi = Object.assign || function(e2) {
1290
1290
  for (var t2, n2 = 1, r2 = arguments.length; n2 < r2; n2++) for (var i2 in t2 = arguments[n2], t2) Object.prototype.hasOwnProperty.call(t2, i2) && (e2[i2] = t2[i2]);
1291
1291
  return e2;
1292
- }, yi.apply(this, arguments);
1292
+ }, vi.apply(this, arguments);
1293
1293
  };
1294
- function bi(e2) {
1294
+ function yi(e2) {
1295
1295
  var t2 = typeof Symbol == `function` && Symbol.iterator, n2 = t2 && e2[t2], r2 = 0;
1296
1296
  if (n2) return n2.call(e2);
1297
1297
  if (e2 && typeof e2.length == `number`) return { next: function() {
@@ -1299,7 +1299,7 @@ function bi(e2) {
1299
1299
  } };
1300
1300
  throw TypeError(t2 ? `Object is not iterable.` : `Symbol.iterator is not defined.`);
1301
1301
  }
1302
- function X(e2, t2) {
1302
+ function Z(e2, t2) {
1303
1303
  var n2 = typeof Symbol == `function` && e2[Symbol.iterator];
1304
1304
  if (!n2) return e2;
1305
1305
  var r2 = n2.call(e2), i2, a2 = [], o2;
@@ -1316,190 +1316,190 @@ function X(e2, t2) {
1316
1316
  }
1317
1317
  return a2;
1318
1318
  }
1319
- function xi(e2, t2, n2) {
1319
+ function bi(e2, t2, n2) {
1320
1320
  if (n2 || arguments.length === 2) for (var r2 = 0, i2 = t2.length, a2; r2 < i2; r2++) (a2 || !(r2 in t2)) && (a2 ||= Array.prototype.slice.call(t2, 0, r2), a2[r2] = t2[r2]);
1321
1321
  return e2.concat(a2 || Array.prototype.slice.call(t2));
1322
1322
  }
1323
- var Si = function(e2) {
1324
- return Object.values(Ci()).some(function(t2) {
1323
+ var xi = function(e2) {
1324
+ return Object.values(Si()).some(function(t2) {
1325
1325
  return !!t2?.subMappings?.[e2];
1326
1326
  });
1327
1327
  };
1328
- var Ci = function() {
1329
- return Object.values(vi).reduce(function(e2, t2) {
1330
- return yi(yi({}, e2), t2);
1328
+ var Si = function() {
1329
+ return Object.values(_i).reduce(function(e2, t2) {
1330
+ return vi(vi({}, e2), t2);
1331
1331
  }, {}) || {};
1332
1332
  };
1333
- var wi = function(e2) {
1334
- var t2 = Ci()[e2];
1335
- return !t2 && Si(e2) && console.warn(`You cannot get variables schema for subMappings key (${e2}).`), t2;
1333
+ var Ci = function(e2) {
1334
+ var t2 = Si()[e2];
1335
+ return !t2 && xi(e2) && console.warn(`You cannot get variables schema for subMappings key (${e2}).`), t2;
1336
1336
  };
1337
- var Ti = function(e2) {
1338
- return Object.entries(vi).filter(function(t2) {
1339
- var n2 = X(t2, 2)[1];
1337
+ var wi = function(e2) {
1338
+ return Object.entries(_i).filter(function(t2) {
1339
+ var n2 = Z(t2, 2)[1];
1340
1340
  return Object.keys(n2).includes(e2);
1341
1341
  }).map(function(e3) {
1342
- return X(e3, 1)[0];
1342
+ return Z(e3, 1)[0];
1343
1343
  })[0];
1344
1344
  };
1345
- var Ei = function(e2) {
1346
- return Object.entries(Ci()).find(function(t2) {
1347
- var n2 = X(t2, 2);
1345
+ var Ti = function(e2) {
1346
+ return Object.entries(Si()).find(function(t2) {
1347
+ var n2 = Z(t2, 2);
1348
1348
  return n2[0], !!n2[1]?.subMappings?.[e2];
1349
1349
  });
1350
1350
  };
1351
- var Di = function(e2) {
1351
+ var Ei = function(e2) {
1352
1352
  var t2 = [];
1353
- if (Si(e2)) {
1354
- var n2 = X(Ei(e2), 2);
1353
+ if (xi(e2)) {
1354
+ var n2 = Z(Ti(e2), 2);
1355
1355
  n2[0];
1356
1356
  var r2 = n2[1];
1357
- t2.push.apply(t2, xi(xi([], X(r2?.required || []), false), X(r2?.subMappings?.[e2]?.required || []), false));
1358
- } else t2.push.apply(t2, xi([], X(wi(e2)?.required || []), false));
1357
+ t2.push.apply(t2, bi(bi([], Z(r2?.required || []), false), Z(r2?.subMappings?.[e2]?.required || []), false));
1358
+ } else t2.push.apply(t2, bi([], Z(Ci(e2)?.required || []), false));
1359
1359
  return t2;
1360
1360
  };
1361
- var Oi = function(e2, t2) {
1361
+ var Di = function(e2, t2) {
1362
1362
  var n2;
1363
1363
  return t2 === void 0 && (t2 = ``), (n2 = e2?.main)?.find?.call(n2, function(e3) {
1364
1364
  return e3.key === t2;
1365
1365
  });
1366
1366
  };
1367
- var ki = function(e2, t2) {
1367
+ var Oi = function(e2, t2) {
1368
1368
  return Error(`Url Mappings Error - [${e2}]: ${t2}`);
1369
1369
  };
1370
- var Ai = Object.values(Y);
1371
- var ji = ki(`key`, `must be one of: ${Ai.toString()}`);
1372
- var Mi = function(e2) {
1373
- if (typeof e2 != `string` || !Ai.includes(e2)) return ji;
1370
+ var ki = Object.values(X);
1371
+ var Ai = Oi(`key`, `must be one of: ${ki.toString()}`);
1372
+ var ji = function(e2) {
1373
+ if (typeof e2 != `string` || !ki.includes(e2)) return Ai;
1374
1374
  };
1375
- var Ni = ki(`itemData`, `must be on object with string as value, for example: { "slug": "shoes" }`);
1376
- var Pi = function(e2) {
1375
+ var Mi = Oi(`itemData`, `must be on object with string as value, for example: { "slug": "shoes" }`);
1376
+ var Ni = function(e2) {
1377
1377
  if (typeof e2 != `object` || !e2 || !Object.values(e2).every(function(e3) {
1378
1378
  return typeof e3 == `string`;
1379
- }) || Array.isArray(e2)) return Ni;
1379
+ }) || Array.isArray(e2)) return Mi;
1380
1380
  };
1381
- var Fi = ki(`itemData`, `must have required variables, for example: { "slug": "shoes" }`);
1382
- var Ii = function(e2, t2) {
1381
+ var Pi = Oi(`itemData`, `must have required variables, for example: { "slug": "shoes" }`);
1382
+ var Fi = function(e2, t2) {
1383
1383
  try {
1384
- var n2 = Di(e2);
1384
+ var n2 = Ei(e2);
1385
1385
  if (!n2.every(function(e3) {
1386
1386
  return !!t2[e3];
1387
1387
  }) || !n2.length) throw Error();
1388
1388
  } catch {
1389
- return Fi;
1389
+ return Pi;
1390
1390
  }
1391
1391
  };
1392
- var Li = function(e2) {
1392
+ var Ii = function(e2) {
1393
1393
  var t2 = e2.key, n2 = e2.itemData;
1394
- return [Mi(t2), Pi(n2), Ii(t2, n2)].find(Boolean);
1394
+ return [ji(t2), Ni(n2), Fi(t2, n2)].find(Boolean);
1395
1395
  };
1396
- var Ri = function(e2) {
1396
+ var Li = function(e2) {
1397
1397
  return function(t2) {
1398
- var n2 = new RegExp(Xr, `g`), r2 = t2.replace(n2, ``);
1398
+ var n2 = new RegExp(Yr, `g`), r2 = t2.replace(n2, ``);
1399
1399
  return e2?.[r2];
1400
1400
  };
1401
1401
  };
1402
- var zi = function(e2, t2, n2, r2) {
1402
+ var Ri = function(e2, t2, n2, r2) {
1403
1403
  e2 === void 0 && (e2 = { main: [] }), r2 === void 0 && (r2 = {});
1404
- var i2 = Li({ key: t2, itemData: n2 });
1404
+ var i2 = Ii({ key: t2, itemData: n2 });
1405
1405
  if (i2) throw i2;
1406
- var a2 = (Oi(e2, t2) || {}).mapping, o2 = (r2 || {}).baseUrl;
1406
+ var a2 = (Di(e2, t2) || {}).mapping, o2 = (r2 || {}).baseUrl;
1407
1407
  if (o2 ??= ``, o2 = o2.endsWith(`/`) ? o2?.slice(0, -1) : o2, a2 && typeof a2 == `string`) {
1408
- var s2 = new RegExp(Yr, `g`), c2 = a2.replace(s2, Ri(n2));
1408
+ var s2 = new RegExp(Jr, `g`), c2 = a2.replace(s2, Li(n2));
1409
1409
  return o2.concat(`/${c2}`);
1410
1410
  }
1411
1411
  };
1412
- var Bi = /[.*+?^$()|]/g;
1413
- var Vi = function(e2) {
1414
- var t2 = e2.replace(Bi, `\\$&`).replace(new RegExp(Yr, `g`), Zr);
1412
+ var zi = /[.*+?^$()|]/g;
1413
+ var Bi = function(e2) {
1414
+ var t2 = e2.replace(zi, `\\$&`).replace(new RegExp(Jr, `g`), Xr);
1415
1415
  return RegExp(`^${t2}$`);
1416
1416
  };
1417
- var Hi = function(e2, t2) {
1417
+ var Vi = function(e2, t2) {
1418
1418
  return e2 === void 0 && (e2 = []), e2.find(function(e3) {
1419
- return Vi(e3).test(t2);
1419
+ return Bi(e3).test(t2);
1420
1420
  });
1421
1421
  };
1422
- ki(`url`, `Url must be a string`);
1423
- var Ui = function(e2) {
1422
+ Oi(`url`, `Url must be a string`);
1423
+ var Hi = function(e2) {
1424
1424
  return [` `, ` `, `
1425
1425
  `].every(function(t2) {
1426
1426
  return !e2?.includes?.call(e2, t2);
1427
1427
  });
1428
1428
  };
1429
- var Wi = function(e2) {
1430
- return e2?.length <= na.MAX_URL_MAPPING_LENGTH;
1429
+ var Ui = function(e2) {
1430
+ return e2?.length <= ta.MAX_URL_MAPPING_LENGTH;
1431
1431
  };
1432
- var Gi = function(e2) {
1432
+ var Wi = function(e2) {
1433
1433
  return e2?.split(`/`).every(Boolean);
1434
1434
  };
1435
- var Ki = function(e2, t2) {
1435
+ var Gi = function(e2, t2) {
1436
1436
  var n2 = t2.urlMappingKey;
1437
- return Di(n2)?.every(function(t3) {
1437
+ return Ei(n2)?.every(function(t3) {
1438
1438
  return e2?.includes(`{{${t3}}}`);
1439
1439
  });
1440
1440
  };
1441
+ var Ki = function(e2) {
1442
+ return (e2.match(new RegExp(Jr, `g`))?.length || 0) <= 1;
1443
+ };
1441
1444
  var qi = function(e2) {
1442
- return (e2.match(new RegExp(Yr, `g`))?.length || 0) <= 1;
1445
+ return e2?.split(`/`).every(Ki);
1443
1446
  };
1444
1447
  var Ji = function(e2) {
1445
- return e2?.split(`/`).every(qi);
1446
- };
1447
- var Yi = function(e2) {
1448
1448
  return [e2.publishedPrefix, e2.savedPrefix].filter(Boolean);
1449
1449
  };
1450
- var Xi = function(e2, t2) {
1450
+ var Yi = function(e2, t2) {
1451
1451
  return t2 === void 0 && (t2 = []), function(n2, r2) {
1452
1452
  var i2 = n2.split(`/`), a2 = n2 === r2;
1453
1453
  if (i2.length < 1 || a2) return true;
1454
- var o2 = X(r2.split(`/`), 1)[0], s2 = X(i2, 1)[0];
1454
+ var o2 = Z(r2.split(`/`), 1)[0], s2 = Z(i2, 1)[0];
1455
1455
  return t2.includes(s2) ? true : e2.every(function(e3) {
1456
1456
  return e3 === o2 || e3 !== s2;
1457
1457
  });
1458
1458
  };
1459
1459
  };
1460
- var Zi = function(e2, t2) {
1460
+ var Xi = function(e2, t2) {
1461
1461
  var n2 = t2.pathPrefixes;
1462
- return Xi(Object.values(n2).map(function(e3) {
1462
+ return Yi(Object.values(n2).map(function(e3) {
1463
1463
  return e3.publishedPrefix;
1464
- }).filter(Boolean), Yi(t2.pathPrefix))(e2, t2.defaultMapping.defaultPublished);
1464
+ }).filter(Boolean), Ji(t2.pathPrefix))(e2, t2.defaultMapping.defaultPublished);
1465
1465
  };
1466
- var Qi = function(e2, t2) {
1466
+ var Zi = function(e2, t2) {
1467
1467
  var n2 = t2.urlMappingKey, r2 = t2.urlMappings;
1468
- return !Hi(r2.main?.filter(function(e3) {
1468
+ return !Vi(r2.main?.filter(function(e3) {
1469
1469
  return n2 !== e3.key;
1470
1470
  }).map(function(e3) {
1471
1471
  return e3.mapping;
1472
1472
  }), e2);
1473
1473
  };
1474
- var $i = function(e2) {
1475
- e2 = e2.replace(new RegExp(Yr, `ig`), ``);
1474
+ var Qi = function(e2) {
1475
+ e2 = e2.replace(new RegExp(Jr, `ig`), ``);
1476
1476
  var t2 = new RegExp(/[^\]_.~!*'();:@&=+$,<>\\#^%?`"]/, `g`), n2 = !/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|[\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|[\ud83c[\ude32-\ude3a]|[\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/g.test(e2), r2 = !e2.replace(t2, ``);
1477
1477
  return n2 && r2;
1478
1478
  };
1479
- var ea = function(e2) {
1480
- var t2 = X(e2, 1)[0], n2 = e2.slice(-1);
1479
+ var $i = function(e2) {
1480
+ var t2 = Z(e2, 1)[0], n2 = e2.slice(-1);
1481
1481
  return t2 !== `/` && n2 !== `/`;
1482
1482
  };
1483
- var ta = function(e2, t2) {
1483
+ var ea = function(e2, t2) {
1484
1484
  var n2 = t2.pathPrefixes;
1485
- return Xi(Object.values(n2).map(function(e3) {
1485
+ return Yi(Object.values(n2).map(function(e3) {
1486
1486
  return e3.savedPrefix;
1487
- }).filter(Boolean), Yi(t2.pathPrefix))(e2, t2.defaultMapping.defaultSaved);
1487
+ }).filter(Boolean), Ji(t2.pathPrefix))(e2, t2.defaultMapping.defaultSaved);
1488
1488
  };
1489
- var Z;
1489
+ var Q;
1490
1490
  (function(e2) {
1491
1491
  e2.MAX_LENGTH_ERROR = `MAX_LENGTH_ERROR`, e2.NO_SPACES_ERROR = `NO_SPACES_ERROR`, e2.NO_EMPTY_SEGMENT_ERROR = `NO_EMPTY_SEGMENT_ERROR`, e2.CONTAIN_MAIN_VARIABLE_ERROR = `CONTAIN_MAIN_VARIABLE_ERROR`, e2.ONLY_ONE_VARIABLE_PER_SEGMENT_ERROR = `ONLY_ONE_VARIABLE_PER_SEGMENT_ERROR`, e2.ONLY_UNIQUE_PUBLISHED_URL_ERROR = `ONLY_UNIQUE_PUBLISHED_URL_ERROR`, e2.ONLY_UNIQUE_SAVED_URL_ERROR = `ONLY_UNIQUE_SAVED_URL_ERROR`, e2.ONLY_UNIQUE_MAPPING_ERROR = `ONLY_UNIQUE_MAPPING_ERROR`, e2.NO_INVALID_CHARACTERS_ERROR = `NO_INVALID_CHARACTERS_ERROR`, e2.NO_STARTING_OR_ENDING_SLASH_ERROR = `NO_STARTING_OR_ENDING_SLASH_ERROR`;
1492
- })(Z ||= {});
1493
- var na = function() {
1492
+ })(Q ||= {});
1493
+ var ta = function() {
1494
1494
  function e2(e3) {
1495
1495
  var t2 = e3.urlMappingKey, n2 = e3.pathPrefixes, r2 = e3.urlMappings, i2 = this;
1496
1496
  this.initValidators = function() {
1497
- i2.validators = [[Wi, Z.MAX_LENGTH_ERROR], [Ui, Z.NO_SPACES_ERROR], [ea, Z.NO_STARTING_OR_ENDING_SLASH_ERROR], [Gi, Z.NO_EMPTY_SEGMENT_ERROR], [$i, Z.NO_INVALID_CHARACTERS_ERROR], [Ki, Z.CONTAIN_MAIN_VARIABLE_ERROR], [Ji, Z.ONLY_ONE_VARIABLE_PER_SEGMENT_ERROR], [Zi, Z.ONLY_UNIQUE_PUBLISHED_URL_ERROR], [ta, Z.ONLY_UNIQUE_SAVED_URL_ERROR], [Qi, Z.ONLY_UNIQUE_MAPPING_ERROR]];
1498
- }, this.urlMappings = r2, this.pathPrefixes = n2, this.urlMappingKey = t2, this.pathPrefix = this.getPathPrefix(), this.defaultMapping = ra(t2, this.pathPrefix), this.initValidators();
1497
+ i2.validators = [[Ui, Q.MAX_LENGTH_ERROR], [Hi, Q.NO_SPACES_ERROR], [$i, Q.NO_STARTING_OR_ENDING_SLASH_ERROR], [Wi, Q.NO_EMPTY_SEGMENT_ERROR], [Qi, Q.NO_INVALID_CHARACTERS_ERROR], [Gi, Q.CONTAIN_MAIN_VARIABLE_ERROR], [qi, Q.ONLY_ONE_VARIABLE_PER_SEGMENT_ERROR], [Xi, Q.ONLY_UNIQUE_PUBLISHED_URL_ERROR], [ea, Q.ONLY_UNIQUE_SAVED_URL_ERROR], [Zi, Q.ONLY_UNIQUE_MAPPING_ERROR]];
1498
+ }, this.urlMappings = r2, this.pathPrefixes = n2, this.urlMappingKey = t2, this.pathPrefix = this.getPathPrefix(), this.defaultMapping = na(t2, this.pathPrefix), this.initValidators();
1499
1499
  }
1500
1500
  return e2.prototype.getPathPrefix = function() {
1501
- var t2 = Ti(this.urlMappingKey);
1502
- if (!t2) throw Si(this.urlMappingKey) ? Error(`Url Mapper Validator Error: Validator does not support sub mapping, please use the main url mapping key`) : Error(`Url Mapper Validator Error: Url mapping key is not supported (${this.urlMappingKey})`);
1501
+ var t2 = wi(this.urlMappingKey);
1502
+ if (!t2) throw xi(this.urlMappingKey) ? Error(`Url Mapper Validator Error: Validator does not support sub mapping, please use the main url mapping key`) : Error(`Url Mapper Validator Error: Url mapping key is not supported (${this.urlMappingKey})`);
1503
1503
  return this.pathPrefixes[t2] || e2.FALLBACK_PATH_PREFIX;
1504
1504
  }, Object.defineProperty(e2.prototype, "validatorProps", { get: function() {
1505
1505
  var e3 = this;
@@ -1507,8 +1507,8 @@ var na = function() {
1507
1507
  }, enumerable: false, configurable: true }), e2.prototype.validate = function(e3) {
1508
1508
  var t2, n2;
1509
1509
  try {
1510
- for (var r2 = bi(this.validators), i2 = r2.next(); !i2.done; i2 = r2.next()) {
1511
- var a2 = X(i2.value, 2), o2 = a2[0], s2 = a2[1], c2 = !!o2(e3, this.validatorProps);
1510
+ for (var r2 = yi(this.validators), i2 = r2.next(); !i2.done; i2 = r2.next()) {
1511
+ var a2 = Z(i2.value, 2), o2 = a2[0], s2 = a2[1], c2 = !!o2(e3, this.validatorProps);
1512
1512
  if (!c2) return { isValid: c2, error: s2 };
1513
1513
  }
1514
1514
  } catch (e4) {
@@ -1521,257 +1521,257 @@ var na = function() {
1521
1521
  }
1522
1522
  }
1523
1523
  return { isValid: true };
1524
- }, e2.errorArray = Object.values(Z), e2.MAX_URL_MAPPING_LENGTH = 1e3, e2.FALLBACK_PATH_PREFIX = `unknown`, e2;
1524
+ }, e2.errorArray = Object.values(Q), e2.MAX_URL_MAPPING_LENGTH = 1e3, e2.FALLBACK_PATH_PREFIX = `unknown`, e2;
1525
1525
  }();
1526
- var ra = function(e2, t2) {
1527
- var n2 = Ci()[e2] || { required: [`slug`] }, r2 = n2.required, i2 = n2.defaultPrefix, a2 = {};
1528
- return t2 && typeof t2 == `object` ? (a2.savedPrefix = t2.savedPrefix ?? ``, a2.publishedPrefix = t2.publishedPrefix ?? ``) : (a2.savedPrefix = na.FALLBACK_PATH_PREFIX, a2.publishedPrefix = na.FALLBACK_PATH_PREFIX), { defaultSaved: xi([a2.savedPrefix, i2], X(r2?.map(function(e3) {
1526
+ var na = function(e2, t2) {
1527
+ var n2 = Si()[e2] || { required: [`slug`] }, r2 = n2.required, i2 = n2.defaultPrefix, a2 = {};
1528
+ return t2 && typeof t2 == `object` ? (a2.savedPrefix = t2.savedPrefix ?? ``, a2.publishedPrefix = t2.publishedPrefix ?? ``) : (a2.savedPrefix = ta.FALLBACK_PATH_PREFIX, a2.publishedPrefix = ta.FALLBACK_PATH_PREFIX), { defaultSaved: bi([a2.savedPrefix, i2], Z(r2?.map(function(e3) {
1529
1529
  return `{{${e3}}}`;
1530
- })), false).filter(Boolean).join(`/`), defaultPublished: xi([a2.publishedPrefix, i2], X(r2?.map(function(e3) {
1530
+ })), false).filter(Boolean).join(`/`), defaultPublished: bi([a2.publishedPrefix, i2], Z(r2?.map(function(e3) {
1531
1531
  return `{{${e3}}}`;
1532
1532
  })), false).filter(Boolean).join(`/`) };
1533
1533
  };
1534
- function ia(e2, t2) {
1535
- return t2 ? zi(e2, Y.BOOKINGS_SERVICE, { slug: t2 }, { baseUrl: `` }) : void 0;
1534
+ function ra(e2, t2) {
1535
+ return t2 ? Ri(e2, X.BOOKINGS_SERVICE, { slug: t2 }, { baseUrl: `` }) : void 0;
1536
1536
  }
1537
- var aa = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
1538
- var oa = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }];
1539
- function sa(e2) {
1540
- return wt(Object.assign(e2, { domainToMappings: { "www.wixapis.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "*.dev.wix-code.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "manage._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }], "www._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], _: [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "blocks._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "create.editorx": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor.wixapps.net": [{ srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }] } }));
1537
+ var ia = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
1538
+ var aa = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }];
1539
+ function oa(e2) {
1540
+ return Ct(Object.assign(e2, { domainToMappings: { "www.wixapis.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "*.dev.wix-code.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "manage._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }], "www._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], _: [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "blocks._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "create.editorx": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor.wixapps.net": [{ srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }] } }));
1541
1541
  }
1542
- var ca = `@wix/auto_sdk_bookings_availability-time-slots`;
1543
- function la(e2) {
1542
+ var sa = `@wix/auto_sdk_bookings_availability-time-slots`;
1543
+ function ca(e2) {
1544
1544
  function t2({ host: t3 }) {
1545
- let n2 = nt(e2, [{ transformFn: R, paths: aa }]);
1546
- return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.AvailabilityTimeSlots.ListAvailabilityTimeSlots`, packageName: ca, migrationOptions: { optInTransformResponse: true }, url: sa({ protoPath: `/v2/time-slots`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => nt(e3, [{ transformFn: We, paths: oa }]) };
1545
+ let n2 = tt(e2, [{ transformFn: z, paths: ia }]);
1546
+ return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.AvailabilityTimeSlots.ListAvailabilityTimeSlots`, packageName: sa, migrationOptions: { optInTransformResponse: true }, url: oa({ protoPath: `/v2/time-slots`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => tt(e3, [{ transformFn: Ue, paths: aa }]) };
1547
1547
  }
1548
1548
  return t2;
1549
1549
  }
1550
- async function ua(e2) {
1551
- let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = la(L({ serviceId: e2?.serviceId, fromLocalDate: e2?.fromLocalDate, toLocalDate: e2?.toLocalDate, timeZone: e2?.timeZone, locations: e2?.locations, includeResourceTypeIds: e2?.includeResourceTypeIds, bookable: e2?.bookable, bookingPolicyViolations: e2?.bookingPolicyViolations, timeSlotsPerDay: e2?.timeSlotsPerDay, cursorPaging: e2?.cursorPaging, customerChoices: e2?.customerChoices, resourceTypes: e2?.resourceTypes }));
1550
+ async function la(e2) {
1551
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = ca(R({ serviceId: e2?.serviceId, fromLocalDate: e2?.fromLocalDate, toLocalDate: e2?.toLocalDate, timeZone: e2?.timeZone, locations: e2?.locations, includeResourceTypeIds: e2?.includeResourceTypeIds, bookable: e2?.bookable, bookingPolicyViolations: e2?.bookingPolicyViolations, timeSlotsPerDay: e2?.timeSlotsPerDay, cursorPaging: e2?.cursorPaging, customerChoices: e2?.customerChoices, resourceTypes: e2?.resourceTypes }));
1552
1552
  n2?.onSiteCall?.();
1553
1553
  try {
1554
1554
  let e3 = await t2.request(r2);
1555
- return n2?.onSuccess?.(e3), Ue(e3.data);
1555
+ return n2?.onSuccess?.(e3), He(e3.data);
1556
1556
  } catch (e3) {
1557
- let t3 = dt(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { serviceId: `$[0].serviceId`, fromLocalDate: `$[0].fromLocalDate`, toLocalDate: `$[0].toLocalDate`, timeZone: `$[0].timeZone`, locations: `$[0].locations`, includeResourceTypeIds: `$[0].includeResourceTypeIds`, bookable: `$[0].bookable`, bookingPolicyViolations: `$[0].bookingPolicyViolations`, timeSlotsPerDay: `$[0].timeSlotsPerDay`, cursorPaging: `$[0].cursorPaging`, customerChoices: `$[0].customerChoices`, resourceTypes: `$[0].resourceTypes` }, singleArgumentUnchanged: false }, [`options`]);
1557
+ let t3 = ut(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { serviceId: `$[0].serviceId`, fromLocalDate: `$[0].fromLocalDate`, toLocalDate: `$[0].toLocalDate`, timeZone: `$[0].timeZone`, locations: `$[0].locations`, includeResourceTypeIds: `$[0].includeResourceTypeIds`, bookable: `$[0].bookable`, bookingPolicyViolations: `$[0].bookingPolicyViolations`, timeSlotsPerDay: `$[0].timeSlotsPerDay`, cursorPaging: `$[0].cursorPaging`, customerChoices: `$[0].customerChoices`, resourceTypes: `$[0].resourceTypes` }, singleArgumentUnchanged: false }, [`options`]);
1558
1558
  throw n2?.onError?.(e3), t3;
1559
1559
  }
1560
1560
  }
1561
- function da(e2) {
1562
- return (t2) => ua(t2, { httpClient: e2 });
1561
+ function ua(e2) {
1562
+ return (t2) => la(t2, { httpClient: e2 });
1563
1563
  }
1564
- var fa = St(da);
1565
- var pa = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
1566
- var ma = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }, { path: `schedulesInfo.firstSessionStart` }, { path: `schedulesInfo.lastSessionEnd` }, { path: `schedulesInfo.enrollmentViolations.earliestBookingDate` }];
1567
- function ha(e2) {
1568
- return wt(Object.assign(e2, { domainToMappings: { "www.wixapis.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "*.dev.wix-code.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "manage._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }], "www._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], _: [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "blocks._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "create.editorx": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor.wixapps.net": [{ srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }] } }));
1564
+ var da = xt(ua);
1565
+ var fa = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
1566
+ var pa = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }, { path: `schedulesInfo.firstSessionStart` }, { path: `schedulesInfo.lastSessionEnd` }, { path: `schedulesInfo.enrollmentViolations.earliestBookingDate` }];
1567
+ function ma(e2) {
1568
+ return Ct(Object.assign(e2, { domainToMappings: { "www.wixapis.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "*.dev.wix-code.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "manage._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }], "www._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], _: [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "blocks._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "create.editorx": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor.wixapps.net": [{ srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }] } }));
1569
1569
  }
1570
- var ga = `@wix/auto_sdk_bookings_event-time-slots`;
1571
- function _a(e2) {
1570
+ var ha = `@wix/auto_sdk_bookings_event-time-slots`;
1571
+ function ga(e2) {
1572
1572
  function t2({ host: t3 }) {
1573
- let n2 = nt(e2, [{ transformFn: R, paths: pa }]);
1574
- return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.EventTimeSlots.ListEventTimeSlots`, packageName: ga, migrationOptions: { optInTransformResponse: true }, url: ha({ protoPath: `/v2/time-slots/event`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => nt(e3, [{ transformFn: We, paths: ma }]) };
1573
+ let n2 = tt(e2, [{ transformFn: z, paths: fa }]);
1574
+ return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.EventTimeSlots.ListEventTimeSlots`, packageName: ha, migrationOptions: { optInTransformResponse: true }, url: ma({ protoPath: `/v2/time-slots/event`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => tt(e3, [{ transformFn: Ue, paths: pa }]) };
1575
1575
  }
1576
1576
  return t2;
1577
1577
  }
1578
- async function va(e2) {
1579
- let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = _a(L({ fromLocalDate: e2?.fromLocalDate, toLocalDate: e2?.toLocalDate, timeZone: e2?.timeZone, serviceIds: e2?.serviceIds, includeNonBookable: e2?.includeNonBookable, minBookableCapacity: e2?.minBookableCapacity, eventFilter: e2?.eventFilter, maxSlotsPerDay: e2?.maxSlotsPerDay, cursorPaging: e2?.cursorPaging, bookingPolicyViolations: e2?.bookingPolicyViolations }));
1578
+ async function _a(e2) {
1579
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = ga(R({ fromLocalDate: e2?.fromLocalDate, toLocalDate: e2?.toLocalDate, timeZone: e2?.timeZone, serviceIds: e2?.serviceIds, includeNonBookable: e2?.includeNonBookable, minBookableCapacity: e2?.minBookableCapacity, eventFilter: e2?.eventFilter, maxSlotsPerDay: e2?.maxSlotsPerDay, cursorPaging: e2?.cursorPaging, bookingPolicyViolations: e2?.bookingPolicyViolations }));
1580
1580
  n2?.onSiteCall?.();
1581
1581
  try {
1582
1582
  let e3 = await t2.request(r2);
1583
- return n2?.onSuccess?.(e3), Ue(e3.data);
1583
+ return n2?.onSuccess?.(e3), He(e3.data);
1584
1584
  } catch (e3) {
1585
- let t3 = dt(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { fromLocalDate: `$[0].fromLocalDate`, toLocalDate: `$[0].toLocalDate`, timeZone: `$[0].timeZone`, serviceIds: `$[0].serviceIds`, includeNonBookable: `$[0].includeNonBookable`, minBookableCapacity: `$[0].minBookableCapacity`, eventFilter: `$[0].eventFilter`, maxSlotsPerDay: `$[0].maxSlotsPerDay`, cursorPaging: `$[0].cursorPaging`, bookingPolicyViolations: `$[0].bookingPolicyViolations` }, singleArgumentUnchanged: false }, [`options`]);
1585
+ let t3 = ut(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { fromLocalDate: `$[0].fromLocalDate`, toLocalDate: `$[0].toLocalDate`, timeZone: `$[0].timeZone`, serviceIds: `$[0].serviceIds`, includeNonBookable: `$[0].includeNonBookable`, minBookableCapacity: `$[0].minBookableCapacity`, eventFilter: `$[0].eventFilter`, maxSlotsPerDay: `$[0].maxSlotsPerDay`, cursorPaging: `$[0].cursorPaging`, bookingPolicyViolations: `$[0].bookingPolicyViolations` }, singleArgumentUnchanged: false }, [`options`]);
1586
1586
  throw n2?.onError?.(e3), t3;
1587
1587
  }
1588
1588
  }
1589
- function ya(e2) {
1590
- return (t2) => va(t2, { httpClient: e2 });
1589
+ function va(e2) {
1590
+ return (t2) => _a(t2, { httpClient: e2 });
1591
1591
  }
1592
- var ba = St(ya);
1593
- var xa = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
1594
- var Sa = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }];
1595
- function Ca(e2) {
1596
- return wt(Object.assign(e2, { domainToMappings: { "www.wixapis.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "*.dev.wix-code.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "manage._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }], "www._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], _: [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "blocks._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "create.editorx": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor.wixapps.net": [{ srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }] } }));
1592
+ var ya = xt(va);
1593
+ var ba = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
1594
+ var xa = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }];
1595
+ function Sa(e2) {
1596
+ return Ct(Object.assign(e2, { domainToMappings: { "www.wixapis.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "*.dev.wix-code.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "manage._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }], "www._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], _: [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "blocks._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "create.editorx": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor.wixapps.net": [{ srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }] } }));
1597
1597
  }
1598
- var wa = `@wix/auto_sdk_bookings_multi-service-availability-time-slots`;
1599
- function Ta(e2) {
1598
+ var Ca = `@wix/auto_sdk_bookings_multi-service-availability-time-slots`;
1599
+ function wa(e2) {
1600
1600
  function t2({ host: t3 }) {
1601
- let n2 = nt(e2, [{ transformFn: R, paths: xa }]);
1602
- return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.MultiServiceAvailabilityTimeSlots.ListMultiServiceAvailabilityTimeSlots`, packageName: wa, migrationOptions: { optInTransformResponse: true }, url: Ca({ protoPath: `/v2/multi-service-time-slots`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => nt(e3, [{ transformFn: We, paths: Sa }]) };
1601
+ let n2 = tt(e2, [{ transformFn: z, paths: ba }]);
1602
+ return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.MultiServiceAvailabilityTimeSlots.ListMultiServiceAvailabilityTimeSlots`, packageName: Ca, migrationOptions: { optInTransformResponse: true }, url: Sa({ protoPath: `/v2/multi-service-time-slots`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => tt(e3, [{ transformFn: Ue, paths: xa }]) };
1603
1603
  }
1604
1604
  return t2;
1605
1605
  }
1606
- async function Ea(e2) {
1607
- let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Ta(L({ services: e2?.services, fromLocalDate: e2?.fromLocalDate, toLocalDate: e2?.toLocalDate, timeZone: e2?.timeZone, location: e2?.location, bookable: e2?.bookable, bookingPolicyViolations: e2?.bookingPolicyViolations, timeSlotsPerDay: e2?.timeSlotsPerDay, cursorPaging: e2?.cursorPaging }));
1606
+ async function Ta(e2) {
1607
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = wa(R({ services: e2?.services, fromLocalDate: e2?.fromLocalDate, toLocalDate: e2?.toLocalDate, timeZone: e2?.timeZone, location: e2?.location, bookable: e2?.bookable, bookingPolicyViolations: e2?.bookingPolicyViolations, timeSlotsPerDay: e2?.timeSlotsPerDay, cursorPaging: e2?.cursorPaging }));
1608
1608
  n2?.onSiteCall?.();
1609
1609
  try {
1610
1610
  let e3 = await t2.request(r2);
1611
- return n2?.onSuccess?.(e3), Ue(e3.data);
1611
+ return n2?.onSuccess?.(e3), He(e3.data);
1612
1612
  } catch (e3) {
1613
- let t3 = dt(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { services: `$[0].services`, fromLocalDate: `$[0].fromLocalDate`, toLocalDate: `$[0].toLocalDate`, timeZone: `$[0].timeZone`, location: `$[0].location`, bookable: `$[0].bookable`, bookingPolicyViolations: `$[0].bookingPolicyViolations`, timeSlotsPerDay: `$[0].timeSlotsPerDay`, cursorPaging: `$[0].cursorPaging` }, singleArgumentUnchanged: false }, [`options`]);
1613
+ let t3 = ut(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { services: `$[0].services`, fromLocalDate: `$[0].fromLocalDate`, toLocalDate: `$[0].toLocalDate`, timeZone: `$[0].timeZone`, location: `$[0].location`, bookable: `$[0].bookable`, bookingPolicyViolations: `$[0].bookingPolicyViolations`, timeSlotsPerDay: `$[0].timeSlotsPerDay`, cursorPaging: `$[0].cursorPaging` }, singleArgumentUnchanged: false }, [`options`]);
1614
1614
  throw n2?.onError?.(e3), t3;
1615
1615
  }
1616
1616
  }
1617
- function Da(e2) {
1618
- return (t2) => Ea(t2, { httpClient: e2 });
1617
+ function Ea(e2) {
1618
+ return (t2) => Ta(t2, { httpClient: e2 });
1619
1619
  }
1620
- var Oa = St(Da);
1621
- var ka = ((e2) => (e2.UNKNOWN = `UNKNOWN`, e2.CUSTOM = `CUSTOM`, e2.STAFF_MEMBER = `STAFF_MEMBER`, e2.DURATION = `DURATION`, e2.DATE_TIME = `DATE_TIME`, e2.NUMBER_OF_PARTICIPANTS = `NUMBER_OF_PARTICIPANTS`, e2.LOCATION = `LOCATION`, e2.DURATION_RANGE = `DURATION_RANGE`, e2))(ka || {});
1622
- var Aa = ((e2) => (e2.APPOINTMENT = `APPOINTMENT`, e2.CLASS = `CLASS`, e2.COURSE = `COURSE`, e2))(Aa || {});
1623
- var ja = ((e2) => (e2.FIXED = `FIXED`, e2.CUSTOM = `CUSTOM`, e2.VARIED = `VARIED`, e2.NO_FEE = `NO_FEE`, e2.SUBSCRIPTION = `SUBSCRIPTION`, e2))(ja || {});
1624
- var Ma = ((e2) => (e2.CUSTOM = `CUSTOM`, e2.BUSINESS = `BUSINESS`, e2.CUSTOMER = `CUSTOMER`, e2))(Ma || {});
1625
- var Na = [{ path: `timeSlotsConfiguration.createdDate` }, { path: `timeSlotsConfiguration.updatedDate` }];
1626
- function Pa(e2) {
1627
- return wt(Object.assign(e2, { domainToMappings: { _: [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "manage._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "apps._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/_api/time-slots-config`, destPath: `` }] } }));
1620
+ var Da = xt(Ea);
1621
+ var Oa = ((e2) => (e2.UNKNOWN = `UNKNOWN`, e2.CUSTOM = `CUSTOM`, e2.STAFF_MEMBER = `STAFF_MEMBER`, e2.DURATION = `DURATION`, e2.DATE_TIME = `DATE_TIME`, e2.NUMBER_OF_PARTICIPANTS = `NUMBER_OF_PARTICIPANTS`, e2.LOCATION = `LOCATION`, e2.DURATION_RANGE = `DURATION_RANGE`, e2))(Oa || {});
1622
+ var ka = ((e2) => (e2.APPOINTMENT = `APPOINTMENT`, e2.CLASS = `CLASS`, e2.COURSE = `COURSE`, e2))(ka || {});
1623
+ var Aa = ((e2) => (e2.FIXED = `FIXED`, e2.CUSTOM = `CUSTOM`, e2.VARIED = `VARIED`, e2.NO_FEE = `NO_FEE`, e2.SUBSCRIPTION = `SUBSCRIPTION`, e2))(Aa || {});
1624
+ var ja = ((e2) => (e2.CUSTOM = `CUSTOM`, e2.BUSINESS = `BUSINESS`, e2.CUSTOMER = `CUSTOMER`, e2))(ja || {});
1625
+ var Ma = [{ path: `timeSlotsConfiguration.createdDate` }, { path: `timeSlotsConfiguration.updatedDate` }];
1626
+ function Na(e2) {
1627
+ return Ct(Object.assign(e2, { domainToMappings: { _: [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "manage._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "apps._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/_api/time-slots-config`, destPath: `` }] } }));
1628
1628
  }
1629
- var Fa = `@wix/auto_sdk_bookings_time-slots-configuration`;
1630
- function Ia(e2) {
1629
+ var Pa = `@wix/auto_sdk_bookings_time-slots-configuration`;
1630
+ function Fa(e2) {
1631
1631
  function t2({ host: t3 }) {
1632
- return { entityFqdn: `wix.bookings.timeslots_configuration.v1.time_slots_configuration`, method: `GET`, methodFqn: `wix.bookings.timeslots.configuration.v1.TimeSlotsConfigurationService.GetTimeSlotsConfigurationByAppId`, packageName: Fa, migrationOptions: { optInTransformResponse: true }, url: Pa({ protoPath: `/v1/time-slots-configurations/app/{appId}`, data: e2, host: t3 }), params: Ct(e2), transformResponse: (e3) => nt(e3, [{ transformFn: We, paths: Na }]) };
1632
+ return { entityFqdn: `wix.bookings.timeslots_configuration.v1.time_slots_configuration`, method: `GET`, methodFqn: `wix.bookings.timeslots.configuration.v1.TimeSlotsConfigurationService.GetTimeSlotsConfigurationByAppId`, packageName: Pa, migrationOptions: { optInTransformResponse: true }, url: Na({ protoPath: `/v1/time-slots-configurations/app/{appId}`, data: e2, host: t3 }), params: St(e2), transformResponse: (e3) => tt(e3, [{ transformFn: Ue, paths: Ma }]) };
1633
1633
  }
1634
1634
  return t2;
1635
1635
  }
1636
- async function La(e2) {
1637
- let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Ia(L({ appId: e2 }));
1636
+ async function Ia(e2) {
1637
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Fa(R({ appId: e2 }));
1638
1638
  n2?.onSiteCall?.();
1639
1639
  try {
1640
1640
  let e3 = await t2.request(r2);
1641
- return n2?.onSuccess?.(e3), Ue(e3.data);
1641
+ return n2?.onSuccess?.(e3), He(e3.data);
1642
1642
  } catch (e3) {
1643
- let t3 = dt(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { appId: `$[0]` }, singleArgumentUnchanged: false }, [`appId`]);
1643
+ let t3 = ut(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { appId: `$[0]` }, singleArgumentUnchanged: false }, [`appId`]);
1644
1644
  throw n2?.onError?.(e3), t3;
1645
1645
  }
1646
1646
  }
1647
- function Ra(e2) {
1648
- return (t2) => La(t2, { httpClient: e2 });
1647
+ function La(e2) {
1648
+ return (t2) => Ia(t2, { httpClient: e2 });
1649
1649
  }
1650
- var za = St(Ra);
1651
- var Ba = [{ path: `bookingsSettings.createdDate` }, { path: `bookingsSettings.updatedDate` }];
1652
- var Va = [{ path: `bookingsSettings.siteProperties.address.coordinates.latitude` }, { path: `bookingsSettings.siteProperties.address.coordinates.longitude` }];
1653
- function Ha(e2) {
1654
- return wt(Object.assign(e2, { domainToMappings: { "manage._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "dev._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], _: [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "api._api_base_domain_": [{ srcPath: `/bookings-settings`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "editor.wixapps.net": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "www._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }] } }));
1650
+ var Ra = xt(La);
1651
+ var za = [{ path: `bookingsSettings.createdDate` }, { path: `bookingsSettings.updatedDate` }];
1652
+ var Ba = [{ path: `bookingsSettings.siteProperties.address.coordinates.latitude` }, { path: `bookingsSettings.siteProperties.address.coordinates.longitude` }];
1653
+ function Va(e2) {
1654
+ return Ct(Object.assign(e2, { domainToMappings: { "manage._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "dev._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], _: [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "api._api_base_domain_": [{ srcPath: `/bookings-settings`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "editor.wixapps.net": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "www._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }] } }));
1655
1655
  }
1656
- var Ua = `@wix/auto_sdk_bookings_bookings-settings`;
1657
- function Wa(e2) {
1656
+ var Ha = `@wix/auto_sdk_bookings_bookings-settings`;
1657
+ function Ua(e2) {
1658
1658
  function t2({ host: t3 }) {
1659
- return { entityFqdn: `wix.bookings.v2.bookings_settings`, method: `GET`, methodFqn: `wix.bookings.settings.v2.BookingsSettingsService.GetBookingsSettings`, packageName: Ua, migrationOptions: { optInTransformResponse: true }, url: Ha({ protoPath: `/v2/settings`, data: e2, host: t3 }), params: Ct(e2), transformResponse: (e3) => nt(e3, [{ transformFn: We, paths: Ba }, { transformFn: H, paths: Va }]), fallback: [{ method: `GET`, url: Ha({ protoPath: `/v2/settings`, data: e2, host: t3 }), params: Ct(e2) }] };
1659
+ return { entityFqdn: `wix.bookings.v2.bookings_settings`, method: `GET`, methodFqn: `wix.bookings.settings.v2.BookingsSettingsService.GetBookingsSettings`, packageName: Ha, migrationOptions: { optInTransformResponse: true }, url: Va({ protoPath: `/v2/settings`, data: e2, host: t3 }), params: St(e2), transformResponse: (e3) => tt(e3, [{ transformFn: Ue, paths: za }, { transformFn: U, paths: Ba }]), fallback: [{ method: `GET`, url: Va({ protoPath: `/v2/settings`, data: e2, host: t3 }), params: St(e2) }] };
1660
1660
  }
1661
1661
  return t2;
1662
1662
  }
1663
- var Ga = ((e2) => (e2.BUSINESS_TIME_ZONE = `BUSINESS_TIME_ZONE`, e2.CUSTOMER_TIME_ZONE = `CUSTOMER_TIME_ZONE`, e2))(Ga || {});
1664
- async function Ka() {
1665
- let { httpClient: e2, sideEffects: t2 } = arguments[0], n2 = Wa(L({}));
1663
+ var Wa = ((e2) => (e2.BUSINESS_TIME_ZONE = `BUSINESS_TIME_ZONE`, e2.CUSTOMER_TIME_ZONE = `CUSTOMER_TIME_ZONE`, e2))(Wa || {});
1664
+ async function Ga() {
1665
+ let { httpClient: e2, sideEffects: t2 } = arguments[0], n2 = Ua(R({}));
1666
1666
  t2?.onSiteCall?.();
1667
1667
  try {
1668
1668
  let r2 = await e2.request(n2);
1669
- return t2?.onSuccess?.(r2), Ue(r2.data)?.bookingsSettings;
1669
+ return t2?.onSuccess?.(r2), He(r2.data)?.bookingsSettings;
1670
1670
  } catch (e3) {
1671
- let n3 = dt(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: {}, singleArgumentUnchanged: false }, []);
1671
+ let n3 = ut(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: {}, singleArgumentUnchanged: false }, []);
1672
1672
  throw t2?.onError?.(e3), n3;
1673
1673
  }
1674
1674
  }
1675
- function qa(e2) {
1676
- return () => Ka({ httpClient: e2 });
1675
+ function Ka(e2) {
1676
+ return () => Ga({ httpClient: e2 });
1677
1677
  }
1678
- var Ja = St(qa);
1679
- function Ya(e2) {
1678
+ var qa = xt(Ka);
1679
+ function Ja(e2) {
1680
1680
  return e2.business?._id ?? null;
1681
1681
  }
1682
- function Xa(e2) {
1682
+ function Ya(e2) {
1683
1683
  return e2.business?.name ?? null;
1684
1684
  }
1685
- function Za(e2) {
1686
- return (e2?.locations ?? []).filter((e3) => e3.type === Ma.BUSINESS).map((e3) => ({ id: Ya(e3) ?? ``, label: Xa(e3) ?? `` })).filter((e3) => e3.id !== ``).sort((e3, t2) => e3.label.localeCompare(t2.label));
1685
+ function Xa(e2) {
1686
+ return (e2?.locations ?? []).filter((e3) => e3.type === ja.BUSINESS).map((e3) => ({ id: Ja(e3) ?? ``, label: Ya(e3) ?? `` })).filter((e3) => e3.id !== ``).sort((e3, t2) => e3.label.localeCompare(t2.label));
1687
1687
  }
1688
- var Qa = (e2) => e2 === Aa.APPOINTMENT;
1689
- var $a = (e2) => e2 === Aa.CLASS;
1690
- var eo = (e2) => e2 === Aa.COURSE;
1691
- var to = (e2) => e2.payment?.rateType === ja.VARIED;
1692
- var no = (e2) => !!e2.addOnGroups?.some((e3) => e3.addOnIds?.length);
1693
- var ro = { category: `category`, location: `location`, page: `page`, blob: `bookingSelection`, legacyBlob: `b`, resource: `resource`, referral: `referral`, timezone: `timezone`, bookingId: `bookingId`, token: `token`, rescheduleRedirectUrl: `rescheduleRedirectUrl` };
1694
- function io(e2) {
1695
- return e2.get(ro.blob) ?? e2.get(ro.legacyBlob);
1688
+ var Za = (e2) => e2 === ka.APPOINTMENT;
1689
+ var Qa = (e2) => e2 === ka.CLASS;
1690
+ var $a = (e2) => e2 === ka.COURSE;
1691
+ var eo = (e2) => e2.payment?.rateType === Aa.VARIED;
1692
+ var to = (e2) => !!e2.addOnGroups?.some((e3) => e3.addOnIds?.length);
1693
+ var no = { category: `category`, location: `location`, page: `page`, blob: `bookingSelection`, legacyBlob: `b`, resource: `resource`, referral: `referral`, timezone: `timezone`, bookingId: `bookingId`, token: `token`, rescheduleRedirectUrl: `rescheduleRedirectUrl` };
1694
+ function ro(e2) {
1695
+ return e2.get(no.blob) ?? e2.get(no.legacyBlob);
1696
1696
  }
1697
- function ao(e2) {
1697
+ function io(e2) {
1698
1698
  if (!e2) return null;
1699
- let t2 = fo(e2).map((e3) => e3.id), n2 = { ...e2.durationChoiceId ? { durationChoiceId: e2.durationChoiceId } : {}, ...e2.durationInMinutes ? { durationInMinutes: e2.durationInMinutes } : {}, ...t2.length ? { addOnIds: t2 } : {}, ...e2.requestedGender ? { requestedGender: { gender: e2.requestedGender } } : {} };
1699
+ let t2 = uo(e2).map((e3) => e3.id), n2 = { ...e2.durationChoiceId ? { durationChoiceId: e2.durationChoiceId } : {}, ...e2.durationInMinutes ? { durationInMinutes: e2.durationInMinutes } : {}, ...t2.length ? { addOnIds: t2 } : {}, ...e2.requestedGender ? { requestedGender: { gender: e2.requestedGender } } : {} };
1700
1700
  return Object.keys(n2).length ? n2 : null;
1701
1701
  }
1702
- function oo(e2) {
1702
+ function ao(e2) {
1703
1703
  return (e2?.services.length ?? 0) > 1;
1704
1704
  }
1705
- var so = (e2) => ({ valid: false, reason: e2 });
1706
- function co(e2) {
1705
+ var oo = (e2) => ({ valid: false, reason: e2 });
1706
+ function so(e2) {
1707
1707
  let t2 = e2?.services ?? [];
1708
- if (!oo(e2) || t2.some((e3) => !e3.serviceId)) return so(`too-few-services`);
1709
- if (t2.some((e3) => e3.serviceType && e3.serviceType !== `APPOINTMENT`)) return so(`not-appointment`);
1708
+ if (!ao(e2) || t2.some((e3) => !e3.serviceId)) return oo(`too-few-services`);
1709
+ if (t2.some((e3) => e3.serviceType && e3.serviceType !== `APPOINTMENT`)) return oo(`not-appointment`);
1710
1710
  let n2 = t2[0].locationType ?? `BUSINESS`, r2 = t2[0].locationId ?? null;
1711
- if (t2.some((e3) => (e3.locationType ?? `BUSINESS`) !== n2 || (e3.locationId ?? null) !== r2)) return so(`location-mixed`);
1712
- if (r2 && n2 !== `BUSINESS`) return so(`location-id-not-business`);
1713
- let i2 = t2.map((e3) => ({ serviceId: e3.serviceId, staff: uo(e3), customerChoices: ao(e3) }));
1711
+ if (t2.some((e3) => (e3.locationType ?? `BUSINESS`) !== n2 || (e3.locationId ?? null) !== r2)) return oo(`location-mixed`);
1712
+ if (r2 && n2 !== `BUSINESS`) return oo(`location-id-not-business`);
1713
+ let i2 = t2.map((e3) => ({ serviceId: e3.serviceId, staff: lo(e3), customerChoices: io(e3) }));
1714
1714
  return { valid: true, locationId: r2, locationType: n2, services: i2, requestKey: JSON.stringify([n2, r2, i2]) };
1715
1715
  }
1716
- var lo = `staff`;
1717
- function uo(e2) {
1718
- let t2 = e2.resources?.find((e3) => e3.type === lo);
1716
+ var co = `staff`;
1717
+ function lo(e2) {
1718
+ let t2 = e2.resources?.find((e3) => e3.type === co);
1719
1719
  if (!t2) return null;
1720
1720
  let n2 = t2.ids[0];
1721
1721
  return n2 ? { anyResource: false, staffMemberId: n2 } : t2.anyResource ? { anyResource: true } : null;
1722
1722
  }
1723
- function fo(e2) {
1723
+ function uo(e2) {
1724
1724
  return e2.addOns ?? [];
1725
1725
  }
1726
- function po(e2, t2) {
1726
+ function fo(e2, t2) {
1727
1727
  let n2 = e2(t2);
1728
1728
  return n2 ? n2.replace(/\/$/, ``) || `/` : null;
1729
1729
  }
1730
- function mo(e2, t2, n2) {
1730
+ function po(e2, t2, n2) {
1731
1731
  let r2 = e2(t2);
1732
1732
  return !r2 || !n2 ? null : `${r2.replace(/\/$/, ``)}/${n2}`;
1733
1733
  }
1734
- function ho(e2, t2) {
1734
+ function mo(e2, t2) {
1735
1735
  switch (e2) {
1736
1736
  case `servicePage`:
1737
- return (t2.slug ? t2.buildCustomServiceUrl(t2.slug) : void 0) ?? mo(t2.appSectionUrl, Jr.SERVICE_PAGE, t2.slug);
1737
+ return (t2.slug ? t2.buildCustomServiceUrl(t2.slug) : void 0) ?? po(t2.appSectionUrl, qr.SERVICE_PAGE, t2.slug);
1738
1738
  case `bookingCalendar`:
1739
- return t2.isMultiService ? po(t2.appSectionUrl, Jr.CALENDAR_PAGE) : mo(t2.appSectionUrl, Jr.CALENDAR_PAGE, t2.slug);
1739
+ return t2.isMultiService ? fo(t2.appSectionUrl, qr.CALENDAR_PAGE) : po(t2.appSectionUrl, qr.CALENDAR_PAGE, t2.slug);
1740
1740
  case `bookingForm`:
1741
- return t2.serviceId ? mo(t2.appSectionUrl, Jr.FORM_PAGE, t2.slug) : null;
1741
+ return t2.serviceId ? po(t2.appSectionUrl, qr.FORM_PAGE, t2.slug) : null;
1742
1742
  default:
1743
1743
  return null;
1744
1744
  }
1745
1745
  }
1746
- var go = (e2) => e2.target === `_blank`;
1747
- var _o = (e2, t2) => t2 === `/` ? e2 : new URL(`.${t2}`, `${e2}/`).href;
1748
- var vo = (e2, t2, n2) => n2 ? `.${t2}` : yo(e2, t2);
1749
- var yo = (e2, t2) => e2 ? _o(e2, t2) : t2;
1750
- var bo = () => {
1751
- let { previewMode: e2 } = p(zr), t2 = p(Hr), n2 = t2.siteUrl.replace(/\/$/, ``), { navigateTo: r2 } = p(Vr), a2 = p(Ur), o2 = f(), s2 = i(async (t3) => {
1752
- let i2 = vo(n2, t3, e2);
1746
+ var ho = (e2) => e2.target === `_blank`;
1747
+ var go = (e2, t2) => t2 === `/` ? e2 : new URL(`.${t2}`, `${e2}/`).href;
1748
+ var _o = (e2, t2, n2) => n2 ? `.${t2}` : vo(e2, t2);
1749
+ var vo = (e2, t2) => e2 ? go(e2, t2) : t2;
1750
+ var yo = () => {
1751
+ let { previewMode: e2 } = p(Rr), t2 = p(Vr), n2 = t2.siteUrl.replace(/\/$/, ``), { navigateTo: r2 } = p(Br), a2 = p(Hr), o2 = f(), s2 = i(async (t3) => {
1752
+ let i2 = _o(n2, t3, e2);
1753
1753
  await r2({ href: i2 });
1754
1754
  }, [e2, n2, r2]), c2 = i(async (e3) => {
1755
- await r2(go(e3) ? { href: e3.href, type: `ExternalLink`, target: `_blank` } : { href: e3.href });
1756
- }, [r2]), l2 = i((e3) => yo(n2, e3), [n2]), u2 = i((e3) => t2.appSectionRelativeUrl(Wr, e3), [t2]), d2 = i((e3) => ia(a2.urlMappings, e3), [a2]), m2 = i((e3, t3) => ho(e3, { ...t3, appSectionUrl: u2, buildCustomServiceUrl: d2 }), [u2, d2]), h2 = i((e3, t3) => {
1755
+ await r2(ho(e3) ? { href: e3.href, type: `ExternalLink`, target: `_blank` } : { href: e3.href });
1756
+ }, [r2]), l2 = i((e3) => vo(n2, e3), [n2]), u2 = i((e3) => t2.appSectionRelativeUrl(Ur, e3), [t2]), d2 = i((e3) => ra(a2.urlMappings, e3), [a2]), m2 = i((e3, t3) => mo(e3, { ...t3, appSectionUrl: u2, buildCustomServiceUrl: d2 }), [u2, d2]), h2 = i((e3, t3) => {
1757
1757
  let r3 = m2(e3, t3);
1758
- return r3 && n2 ? _o(n2, r3) : null;
1758
+ return r3 && n2 ? go(n2, r3) : null;
1759
1759
  }, [m2, n2]), g2 = i((e3, t3) => {
1760
1760
  let n3 = m2(e3, t3);
1761
1761
  n3 && s2(n3);
1762
- }, [m2, s2]), _2 = i(() => u2(Jr.FORM_PAGE) || void 0, [u2]), v2 = i((e3) => Object.values(o2(Br).pages).some((t3) => t3.appPageId === e3 && (!t3.appDefinitionId || t3.appDefinitionId === `1380b703-ce81-ff05-f115-39571d94dfcd`)) && t2.appSectionRelativeUrl(`1380b703-ce81-ff05-f115-39571d94dfcd`, e3) || void 0, [t2, o2]);
1763
- return { navigate: s2, navigateToHref: c2, resolvePath: m2, toHref: l2, resolveAbsoluteUrl: h2, navigateTo: g2, getBookingFormPath: _2, getCartPagePath: i(() => v2(Gr), [v2]), getThankYouPagePath: i((e3) => {
1764
- let t3 = v2(Kr);
1762
+ }, [m2, s2]), _2 = i(() => u2(qr.FORM_PAGE) || void 0, [u2]), v2 = i((e3) => Object.values(o2(zr).pages).some((t3) => t3.appPageId === e3 && (!t3.appDefinitionId || t3.appDefinitionId === `1380b703-ce81-ff05-f115-39571d94dfcd`)) && t2.appSectionRelativeUrl(`1380b703-ce81-ff05-f115-39571d94dfcd`, e3) || void 0, [t2, o2]);
1763
+ return { navigate: s2, navigateToHref: c2, resolvePath: m2, toHref: l2, resolveAbsoluteUrl: h2, navigateTo: g2, getBookingFormPath: _2, getCartPagePath: i(() => v2(Wr), [v2]), getThankYouPagePath: i((e3) => {
1764
+ let t3 = v2(Gr);
1765
1765
  return t3 ? `${t3}/${e3}?origin=bookings` : void 0;
1766
1766
  }, [v2]) };
1767
1767
  };
1768
- function xo(e2) {
1768
+ function bo(e2) {
1769
1769
  return e2?.details?.applicationError?.code;
1770
1770
  }
1771
- function So() {
1771
+ function xo() {
1772
1772
  let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
1773
1773
  if (e2) return { initWixModules(t3, n3) {
1774
- return Co(() => e2(t3, n3));
1774
+ return So(() => e2(t3, n3));
1775
1775
  }, fetchWithAuth() {
1776
1776
  throw Error(`fetchWithAuth is not available in this context`);
1777
1777
  }, graphql() {
@@ -1781,10 +1781,10 @@ function So() {
1781
1781
  if (t2 || n2) return { initWixModules(e3, r2) {
1782
1782
  if (r2) {
1783
1783
  if (!n2) throw Error(`An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules`);
1784
- return Co(() => n2.use(e3));
1784
+ return So(() => n2.use(e3));
1785
1785
  }
1786
1786
  if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
1787
- return Co(() => t2.use(e3));
1787
+ return So(() => t2.use(e3));
1788
1788
  }, fetchWithAuth: (e3, n3) => {
1789
1789
  if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
1790
1790
  return t2.fetchWithAuth(e3, n3);
@@ -1796,7 +1796,7 @@ function So() {
1796
1796
  return t2.graphql(e3, n3, r2);
1797
1797
  } };
1798
1798
  }
1799
- function Co(e2) {
1799
+ function So(e2) {
1800
1800
  let t2 = globalThis.__wix_context__, n2 = { client: h.client, elevatedClient: h.elevatedClient }, r2;
1801
1801
  globalThis.__wix_context__ = void 0, h.client = void 0, h.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
1802
1802
  try {
@@ -1805,17 +1805,17 @@ function Co(e2) {
1805
1805
  globalThis.__wix_context__ = t2, h.client = n2.client, h.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
1806
1806
  }
1807
1807
  }
1808
- function wo(e2, t2) {
1808
+ function Co(e2, t2) {
1809
1809
  return { ...e2, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
1810
- let r2 = So();
1810
+ let r2 = xo();
1811
1811
  if (!r2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
1812
1812
  return r2.initWixModules(e2)[t3].apply(void 0, n2);
1813
1813
  }])) };
1814
1814
  }
1815
- function To(e2) {
1816
- return wo({ __type: `host`, create: (t2) => Object.entries(e2).reduce((e3, [n2, r2]) => ({ ...e3, [n2]: r2(t2) }), {}) }, Object.keys(e2));
1815
+ function wo(e2) {
1816
+ return Co({ __type: `host`, create: (t2) => Object.entries(e2).reduce((e3, [n2, r2]) => ({ ...e3, [n2]: r2(t2) }), {}) }, Object.keys(e2));
1817
1817
  }
1818
- var Eo = class {
1818
+ var To = class {
1819
1819
  constructor(e2) {
1820
1820
  this.message = e2, this.captureException = () => {
1821
1821
  console.error(this.message);
@@ -1830,106 +1830,114 @@ var Eo = class {
1830
1830
  };
1831
1831
  }
1832
1832
  };
1833
- var Do = (e2) => new Eo(e2);
1834
- var Oo = To({ getMonitoringClient: (e2) => () => e2.getMonitoringClient ? e2.getMonitoringClient() : Do(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
1835
- var Q = { 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` };
1836
- function ko(e2) {
1833
+ var Eo = (e2) => new To(e2);
1834
+ var Do = wo({ getMonitoringClient: (e2) => () => e2.getMonitoringClient ? e2.getMonitoringClient() : Eo(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
1835
+ var $ = { 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` };
1836
+ function Oo(e2) {
1837
1837
  try {
1838
- let t2 = Oo.getMonitoringClient?.();
1838
+ let t2 = Do.getMonitoringClient?.();
1839
1839
  return t2 && typeof t2[e2] == `function` ? t2 : null;
1840
1840
  } catch {
1841
1841
  return null;
1842
1842
  }
1843
1843
  }
1844
- function $(e2, { feature: t2, action: n2, level: r2 = `error`, contexts: i2 }) {
1845
- let a2 = ko(`captureException`);
1844
+ function ko(e2, { feature: t2, action: n2, level: r2 = `error`, contexts: i2 }) {
1845
+ let a2 = Oo(`captureException`);
1846
1846
  if (!a2) return;
1847
1847
  let o2 = e2 instanceof Error ? e2 : Error(String(e2));
1848
1848
  a2.captureException(o2, { level: r2, tags: { feature: t2, action: n2 }, ...i2 ? { contexts: i2 } : {} });
1849
1849
  }
1850
1850
  function Ao(e2, { feature: t2, action: n2, level: r2 = `info`, tags: i2 }) {
1851
- let a2 = ko(`captureMessage`);
1851
+ let a2 = Oo(`captureMessage`);
1852
1852
  a2 && a2.captureMessage(e2, { level: r2, tags: { feature: t2, action: n2, ...i2 } });
1853
1853
  }
1854
1854
  function jo({ message: e2, category: t2, feature: n2, data: r2 }) {
1855
- let i2 = ko(`addBreadcrumb`);
1855
+ let i2 = Oo(`addBreadcrumb`);
1856
1856
  i2 && i2.addBreadcrumb({ message: e2, category: t2, level: `info`, data: { feature: n2, ...r2 } });
1857
1857
  }
1858
- var Mo = (e2) => {
1858
+ function Mo(e2) {
1859
+ if (e2.tooEarlyToBook || e2.tooLateToBook) return false;
1860
+ let t2 = e2.bookableCapacity ?? e2.remainingCapacity;
1861
+ return (e2.waitlistCapacity ?? 0) > 0 && (t2 ?? 0) <= 0;
1862
+ }
1863
+ function No(e2) {
1864
+ return Mo({ bookableCapacity: e2.bookableCapacity ?? null, remainingCapacity: e2.remainingCapacity ?? null, waitlistCapacity: e2.eventInfo?.waitingList?.remainingCapacity ?? null, tooEarlyToBook: e2.bookingPolicyViolations?.tooEarlyToBook ?? false, tooLateToBook: e2.bookingPolicyViolations?.tooLateToBook ?? false });
1865
+ }
1866
+ var Po = (e2) => {
1859
1867
  let t2 = (e3) => e3 < 10 ? `0${e3}` : `${e3}`;
1860
1868
  return `${e2.getFullYear()}-${t2(e2.getMonth() + 1)}-${t2(e2.getDate())}`;
1861
1869
  };
1862
- var No = (e2) => /* @__PURE__ */ new Date(`${e2}T00:00:00`);
1863
- var Po = (e2, t2) => new Intl.DateTimeFormat(`en-CA`, { year: `numeric`, month: `2-digit`, day: `2-digit`, ...t2 ? { timeZone: t2 } : {} }).format(e2);
1864
- var Fo = (e2) => `${Mo(e2)}T00:00:00`;
1865
- var Io = (e2) => `${Mo(e2)}T23:59:59`;
1866
- function Lo(e2, t2) {
1867
- return `${Po(e2, t2)}T${new Intl.DateTimeFormat(`en-GB`, { timeZone: t2, hourCycle: `h23`, hour: `2-digit`, minute: `2-digit`, second: `2-digit` }).format(e2)}`;
1870
+ var Fo = (e2) => /* @__PURE__ */ new Date(`${e2}T00:00:00`);
1871
+ var Io = (e2, t2) => new Intl.DateTimeFormat(`en-CA`, { year: `numeric`, month: `2-digit`, day: `2-digit`, ...t2 ? { timeZone: t2 } : {} }).format(e2);
1872
+ var Lo = (e2) => `${Po(e2)}T00:00:00`;
1873
+ var Ro = (e2) => `${Po(e2)}T23:59:59`;
1874
+ function zo(e2, t2) {
1875
+ return `${Io(e2, t2)}T${new Intl.DateTimeFormat(`en-GB`, { timeZone: t2, hourCycle: `h23`, hour: `2-digit`, minute: `2-digit`, second: `2-digit` }).format(e2)}`;
1868
1876
  }
1869
- function Ro(e2, t2) {
1870
- let n2 = Lo(new Date(Date.now()), t2);
1877
+ function Bo(e2, t2) {
1878
+ let n2 = zo(new Date(Date.now()), t2);
1871
1879
  return n2.slice(0, 10) === e2 ? n2 : `${e2}T00:00:00`;
1872
1880
  }
1873
- var zo = /^\d{4}-\d{2}-\d{2}$/;
1874
- var Bo = 864e5;
1875
- function Vo(e2) {
1876
- if (typeof e2 != `string` || !zo.test(e2)) return false;
1877
- let t2 = No(e2);
1878
- return !Number.isNaN(t2.getTime()) && Mo(t2) === e2;
1881
+ var Vo = /^\d{4}-\d{2}-\d{2}$/;
1882
+ var Ho = 864e5;
1883
+ function Uo(e2) {
1884
+ if (typeof e2 != `string` || !Vo.test(e2)) return false;
1885
+ let t2 = Fo(e2);
1886
+ return !Number.isNaN(t2.getTime()) && Po(t2) === e2;
1879
1887
  }
1880
- function Ho(e2) {
1888
+ function Wo(e2) {
1881
1889
  if (!e2 || typeof e2 != `object`) return false;
1882
1890
  let { startDate: t2, endDate: n2 } = e2;
1883
- return Vo(t2) && Vo(n2) && t2 <= n2;
1891
+ return Uo(t2) && Uo(n2) && t2 <= n2;
1884
1892
  }
1885
- function Uo(e2, t2) {
1886
- let n2 = No(e2);
1887
- return n2.setDate(n2.getDate() + t2), Mo(n2);
1893
+ function Go(e2, t2) {
1894
+ let n2 = Fo(e2);
1895
+ return n2.setDate(n2.getDate() + t2), Po(n2);
1888
1896
  }
1889
- function Wo({ startDate: e2, endDate: t2 }) {
1890
- let n2 = No(t2).getTime() - No(e2).getTime();
1891
- return Math.round(n2 / Bo) + 1;
1897
+ function Ko({ startDate: e2, endDate: t2 }) {
1898
+ let n2 = Fo(t2).getTime() - Fo(e2).getTime();
1899
+ return Math.round(n2 / Ho) + 1;
1892
1900
  }
1893
- function Go(e2) {
1894
- let t2 = No(e2), n2 = new Date(t2.getFullYear(), t2.getMonth(), 1), r2 = new Date(t2.getFullYear(), t2.getMonth() + 1, 0);
1895
- return { startDate: Mo(n2), endDate: Mo(r2) };
1901
+ function qo(e2) {
1902
+ let t2 = Fo(e2), n2 = new Date(t2.getFullYear(), t2.getMonth(), 1), r2 = new Date(t2.getFullYear(), t2.getMonth() + 1, 0);
1903
+ return { startDate: Po(n2), endDate: Po(r2) };
1896
1904
  }
1897
- function Ko(e2, t2) {
1905
+ function Jo(e2, t2) {
1898
1906
  return e2 >= t2.startDate && e2 <= t2.endDate;
1899
1907
  }
1900
- function qo(e2) {
1901
- let t2 = No(e2), n2 = new Date(t2.getFullYear(), t2.getMonth() + 2, 0).getDate(), r2 = Math.min(t2.getDate(), n2);
1902
- return Mo(new Date(t2.getFullYear(), t2.getMonth() + 1, r2));
1908
+ function Yo(e2) {
1909
+ let t2 = Fo(e2), n2 = new Date(t2.getFullYear(), t2.getMonth() + 2, 0).getDate(), r2 = Math.min(t2.getDate(), n2);
1910
+ return Po(new Date(t2.getFullYear(), t2.getMonth() + 1, r2));
1903
1911
  }
1904
- function Jo(e2) {
1912
+ function Xo(e2) {
1905
1913
  let t2 = [], n2 = e2.startDate;
1906
1914
  for (; n2 <= e2.endDate; ) {
1907
- let r2 = Uo(qo(n2), -1), i2 = r2 < e2.endDate ? r2 : e2.endDate;
1908
- t2.push({ startDate: n2, endDate: i2 }), n2 = Uo(i2, 1);
1915
+ let r2 = Go(Yo(n2), -1), i2 = r2 < e2.endDate ? r2 : e2.endDate;
1916
+ t2.push({ startDate: n2, endDate: i2 }), n2 = Go(i2, 1);
1909
1917
  }
1910
1918
  return t2;
1911
1919
  }
1912
- function Yo({ allowGenderSelection: e2, staffSelectionStrategy: t2 }) {
1920
+ function Zo({ allowGenderSelection: e2, staffSelectionStrategy: t2 }) {
1913
1921
  return e2 && t2 !== `CUSTOMER_CANNOT_CHOOSE`;
1914
1922
  }
1915
- async function Xo() {
1916
- let e2 = await za(Wr);
1923
+ async function Qo() {
1924
+ let e2 = await Ra(Ur);
1917
1925
  return { businessTimeZone: e2.timeSlotsConfiguration?.displayTimeZone?.timeZone || null, staffSelectionStrategy: e2.timeSlotsConfiguration?.staffSelection?.strategy ?? null, allowGenderSelection: e2.timeSlotsConfiguration?.staffSelection?.allowGenderSelection ?? false };
1918
1926
  }
1919
- function Zo(e2) {
1927
+ function $o(e2) {
1920
1928
  let t2 = e2.location?._id || (e2.location?.locationType ? `${e2.location.locationType}:${e2.location.formattedAddress ?? ``}` : ``);
1921
1929
  return `${e2.localStartDate ?? ``}|${e2.localEndDate ?? ``}|${t2}`;
1922
1930
  }
1923
- function Qo(e2) {
1931
+ function es(e2) {
1924
1932
  return e2.availableResources?.[0]?.resources?.[0]?._id ?? null;
1925
1933
  }
1926
- function $o(e2) {
1927
- return `${Zo(e2)}|${Qo(e2) ?? ``}`;
1934
+ function ts(e2) {
1935
+ return `${$o(e2)}|${es(e2) ?? ``}`;
1928
1936
  }
1929
- function es(e2) {
1937
+ function ns(e2) {
1930
1938
  let t2 = /* @__PURE__ */ new Map();
1931
1939
  for (let n2 of e2) {
1932
- let e3 = Zo(n2), r2 = t2.get(e3);
1940
+ let e3 = $o(n2), r2 = t2.get(e3);
1933
1941
  r2 ? r2.push(n2) : t2.set(e3, [n2]);
1934
1942
  }
1935
1943
  return [...t2.values()].map((e3) => {
@@ -1938,132 +1946,132 @@ function es(e2) {
1938
1946
  return { ...n2[0], availableResources: n2.flatMap((e4) => e4.availableResources ?? []) };
1939
1947
  });
1940
1948
  }
1941
- function ts(e2) {
1949
+ function rs(e2) {
1942
1950
  return e2 ? { locations: [{ _id: e2, locationType: `BUSINESS` }] } : {};
1943
1951
  }
1944
- function ns(e2) {
1945
- return e2 ? { resourceTypes: [{ resourceTypeId: qr, resourceIds: [e2] }] } : {};
1952
+ function is(e2) {
1953
+ return e2 ? { resourceTypes: [{ resourceTypeId: Kr, resourceIds: [e2] }] } : {};
1946
1954
  }
1947
- function rs(e2) {
1955
+ function as(e2) {
1948
1956
  let { requestedGender: t2, ...n2 } = e2;
1949
1957
  return Object.keys(n2).length ? n2 : void 0;
1950
1958
  }
1951
- function is(e2, t2) {
1959
+ function os(e2, t2) {
1952
1960
  if (!e2) return {};
1953
- let n2 = t2 ? rs(e2) : e2;
1961
+ let n2 = t2 ? as(e2) : e2;
1954
1962
  return n2 ? { customerChoices: n2 } : {};
1955
1963
  }
1956
- var as = `REQUESTED_GENDER_NOT_ALLOWED`;
1957
- function os(e2) {
1958
- return xo(e2) === as;
1964
+ var ss = `REQUESTED_GENDER_NOT_ALLOWED`;
1965
+ function cs(e2) {
1966
+ return bo(e2) === ss;
1959
1967
  }
1960
- var ss = false;
1961
- var cs = /* @__PURE__ */ new Set();
1962
- function ls() {
1963
- return ss;
1968
+ var ls = false;
1969
+ var us = /* @__PURE__ */ new Set();
1970
+ function ds() {
1971
+ return ls;
1964
1972
  }
1965
- function us(e2) {
1966
- return cs.add(e2), () => cs.delete(e2);
1973
+ function fs(e2) {
1974
+ return us.add(e2), () => us.delete(e2);
1967
1975
  }
1968
- function ds() {
1969
- ss || (ss = true, cs.forEach((e2) => e2()));
1976
+ function ps() {
1977
+ ls || (ls = true, us.forEach((e2) => e2()));
1970
1978
  }
1971
- async function fs(e2) {
1979
+ async function ms(e2) {
1972
1980
  let { customerChoices: t2, ...n2 } = e2, r2 = (e3) => {
1973
- let t3 = rs(e3);
1974
- return fa({ ...n2, ...t3 ? { customerChoices: t3 } : {} });
1981
+ let t3 = as(e3);
1982
+ return da({ ...n2, ...t3 ? { customerChoices: t3 } : {} });
1975
1983
  };
1976
- if (ss && t2?.requestedGender) return r2(t2);
1984
+ if (ls && t2?.requestedGender) return r2(t2);
1977
1985
  try {
1978
- return await fa(e2);
1986
+ return await da(e2);
1979
1987
  } catch (e3) {
1980
- if (!t2?.requestedGender || !os(e3)) throw e3;
1981
- return $(e3, { feature: Q.timeSlots, action: `requested-gender-rejected`, level: `warning` }), ds(), r2(t2);
1988
+ if (!t2?.requestedGender || !cs(e3)) throw e3;
1989
+ return ko(e3, { feature: $.timeSlots, action: `requested-gender-rejected`, level: `warning` }), ps(), r2(t2);
1982
1990
  }
1983
1991
  }
1984
- function ps(e2, t2, n2) {
1992
+ function hs(e2, t2, n2) {
1985
1993
  return { ...e2 ? { "location.id": e2 } : {}, ...t2 ? { "resources.id": { $hasSome: [t2] } } : {}, ...n2 ? { remainingCapacity: { $gte: n2 } } : {} };
1986
1994
  }
1987
- async function ms(e2) {
1988
- let t2 = await ba(e2);
1995
+ async function gs(e2) {
1996
+ let t2 = await ya(e2);
1989
1997
  return { timeSlots: t2.timeSlots ?? [], timeZone: t2.timeZone ?? null, nextCursor: t2.pagingMetadata?.cursors?.next || null };
1990
1998
  }
1991
- function hs({ serviceId: e2, serviceType: t2, fromLocalDate: n2, toLocalDate: r2, timeZone: i2, locationId: a2, staffId: o2, onlyAvailableSlots: s2 = false, customerChoices: c2, minRemainingCapacity: l2, timeSlotsPerDay: u2, limit: d2, cursor: f2 }) {
1992
- return Qa(t2) ? gs({ serviceId: e2, fromLocalDate: n2, toLocalDate: r2, timeZone: i2, locationId: a2, staffId: o2, onlyAvailableSlots: s2, customerChoices: c2, timeSlotsPerDay: u2, limit: d2, cursor: f2 }) : ms({ serviceIds: [e2], fromLocalDate: n2, ...r2 ? { toLocalDate: r2 } : {}, ...i2 ? { timeZone: i2 } : {}, includeNonBookable: !s2, eventFilter: { type: t2, ...ps(a2, o2, l2) }, cursorPaging: { limit: d2, ...f2 ? { cursor: f2 } : {} } });
1999
+ function _s({ serviceId: e2, serviceType: t2, fromLocalDate: n2, toLocalDate: r2, timeZone: i2, locationId: a2, staffId: o2, onlyAvailableSlots: s2 = false, customerChoices: c2, minRemainingCapacity: l2, timeSlotsPerDay: u2, limit: d2, cursor: f2 }) {
2000
+ return Za(t2) ? vs({ serviceId: e2, fromLocalDate: n2, toLocalDate: r2, timeZone: i2, locationId: a2, staffId: o2, onlyAvailableSlots: s2, customerChoices: c2, timeSlotsPerDay: u2, limit: d2, cursor: f2 }) : gs({ serviceIds: [e2], fromLocalDate: n2, ...r2 ? { toLocalDate: r2 } : {}, ...i2 ? { timeZone: i2 } : {}, includeNonBookable: !s2, eventFilter: { type: t2, ...hs(a2, o2, l2) }, cursorPaging: { limit: d2, ...f2 ? { cursor: f2 } : {} } });
1993
2001
  }
1994
- async function gs({ serviceId: e2, fromLocalDate: t2, toLocalDate: n2, timeZone: r2, locationId: i2, staffId: a2, onlyAvailableSlots: o2, customerChoices: s2, timeSlotsPerDay: c2, limit: l2, cursor: u2 }) {
1995
- let d2 = await fs({ serviceId: e2, fromLocalDate: t2, ...n2 ? { toLocalDate: n2 } : {}, ...r2 ? { timeZone: r2 } : {}, ...o2 ? { bookable: true } : {}, ...ts(i2), ...ns(a2), ...is(s2, a2), includeResourceTypeIds: [qr], ...c2 == null ? {} : { timeSlotsPerDay: c2 }, cursorPaging: { limit: l2, ...u2 ? { cursor: u2 } : {} } });
2002
+ async function vs({ serviceId: e2, fromLocalDate: t2, toLocalDate: n2, timeZone: r2, locationId: i2, staffId: a2, onlyAvailableSlots: o2, customerChoices: s2, timeSlotsPerDay: c2, limit: l2, cursor: u2 }) {
2003
+ let d2 = await ms({ serviceId: e2, fromLocalDate: t2, ...n2 ? { toLocalDate: n2 } : {}, ...r2 ? { timeZone: r2 } : {}, ...o2 ? { bookable: true } : {}, ...rs(i2), ...is(a2), ...os(s2, a2), includeResourceTypeIds: [Kr], ...c2 == null ? {} : { timeSlotsPerDay: c2 }, cursorPaging: { limit: l2, ...u2 ? { cursor: u2 } : {} } });
1996
2004
  return { timeSlots: d2.timeSlots ?? [], timeZone: d2.timeZone ?? null, nextCursor: d2.cursorPagingMetadata?.cursors?.next || null };
1997
2005
  }
1998
- var _s = 6;
1999
- var vs = 864e5;
2000
- function ys(e2) {
2001
- let t2 = e2 ? No(e2) : new Date(Date.now()), n2 = new Date(t2.getFullYear(), t2.getMonth() + _s + 1, 1), r2 = new Date(n2.getTime() - vs);
2002
- return { fromLocalDate: Fo(t2), toLocalDate: Io(r2) };
2006
+ var ys = 6;
2007
+ var bs = 864e5;
2008
+ function xs(e2) {
2009
+ let t2 = e2 ? Fo(e2) : new Date(Date.now()), n2 = new Date(t2.getFullYear(), t2.getMonth() + ys + 1, 1), r2 = new Date(n2.getTime() - bs);
2010
+ return { fromLocalDate: Lo(t2), toLocalDate: Ro(r2) };
2003
2011
  }
2004
- async function bs({ serviceId: e2, serviceType: t2, timeZone: n2, limit: r2, onlyAvailableSlots: i2 = true, fromDate: a2, locationId: o2, staffId: s2, customerChoices: c2, minRemainingCapacity: l2 }) {
2005
- let { fromLocalDate: u2, toLocalDate: d2 } = ys(a2);
2006
- if ($a(t2) || eo(t2)) {
2007
- let a3 = { ...eo(t2) ? { type: `COURSE` } : {}, ...ps(o2, s2, l2) }, c3 = await ms({ serviceIds: [e2], fromLocalDate: u2, toLocalDate: d2, ...n2 ? { timeZone: n2 } : {}, includeNonBookable: !i2, ...Object.keys(a3).length ? { eventFilter: a3 } : {}, ...r2 == null ? {} : { cursorPaging: { limit: r2 } } });
2012
+ async function Ss({ serviceId: e2, serviceType: t2, timeZone: n2, limit: r2, onlyAvailableSlots: i2 = true, fromDate: a2, locationId: o2, staffId: s2, customerChoices: c2, minRemainingCapacity: l2 }) {
2013
+ let { fromLocalDate: u2, toLocalDate: d2 } = xs(a2);
2014
+ if (Qa(t2) || $a(t2)) {
2015
+ let a3 = { ...$a(t2) ? { type: `COURSE` } : {}, ...hs(o2, s2, l2) }, c3 = await gs({ serviceIds: [e2], fromLocalDate: u2, toLocalDate: d2, ...n2 ? { timeZone: n2 } : {}, includeNonBookable: !i2, ...Object.keys(a3).length ? { eventFilter: a3 } : {}, ...r2 == null ? {} : { cursorPaging: { limit: r2 } } });
2008
2016
  return { timeSlots: c3.timeSlots, timeZone: c3.timeZone };
2009
2017
  }
2010
- let f2 = await fs({ serviceId: e2, fromLocalDate: u2, toLocalDate: d2, ...n2 ? { timeZone: n2 } : {}, ...i2 ? { bookable: true } : {}, ...ts(o2), ...ns(s2), ...is(c2, s2), includeResourceTypeIds: [qr], ...r2 == null ? {} : { cursorPaging: { limit: r2 } } });
2018
+ let f2 = await ms({ serviceId: e2, fromLocalDate: u2, toLocalDate: d2, ...n2 ? { timeZone: n2 } : {}, ...i2 ? { bookable: true } : {}, ...rs(o2), ...is(s2), ...os(c2, s2), includeResourceTypeIds: [Kr], ...r2 == null ? {} : { cursorPaging: { limit: r2 } } });
2011
2019
  return { timeSlots: f2.timeSlots ?? [], timeZone: f2.timeZone ?? null };
2012
2020
  }
2013
- var xs = 1e3;
2014
- async function Ss({ serviceId: e2, serviceType: t2, date: n2, timeZone: r2, onlyAvailableSlots: i2, locationId: a2, staffId: o2, customerChoices: s2, minRemainingCapacity: c2, fromLocalDate: l2, toLocalDate: u2 }) {
2015
- let d2 = `${n2}T00:00:00`, f2 = `${n2}T23:59:59`, p2 = eo(t2) ? `COURSE` : $a(t2) ? `CLASS` : `APPOINTMENT`, m2 = [], h2 = null, g2;
2021
+ var Cs = 1e3;
2022
+ async function ws({ serviceId: e2, serviceType: t2, date: n2, timeZone: r2, onlyAvailableSlots: i2, locationId: a2, staffId: o2, customerChoices: s2, minRemainingCapacity: c2, keepWaitlistSlots: l2 = false, fromLocalDate: u2, toLocalDate: d2 }) {
2023
+ let f2 = `${n2}T00:00:00`, p2 = `${n2}T23:59:59`, m2 = $a(t2) ? `COURSE` : Qa(t2) ? `CLASS` : `APPOINTMENT`, h2 = l2 && i2 && m2 === `CLASS`, g2 = [], _2 = null, v2;
2016
2024
  do {
2017
- let t3 = await hs({ serviceId: e2, serviceType: p2, fromLocalDate: l2 && l2 > d2 ? l2 : d2, toLocalDate: u2 && u2 < f2 ? u2 : f2, timeZone: r2, locationId: a2, staffId: o2, onlyAvailableSlots: i2, customerChoices: s2, minRemainingCapacity: c2, limit: xs, cursor: g2 });
2018
- m2.push(...t3.timeSlots), h2 = t3.timeZone ?? h2, g2 = t3.nextCursor ?? void 0;
2019
- } while (g2);
2020
- return { timeSlots: m2, timeZone: h2 };
2025
+ let t3 = await _s({ serviceId: e2, serviceType: m2, fromLocalDate: u2 && u2 > f2 ? u2 : f2, toLocalDate: d2 && d2 < p2 ? d2 : p2, timeZone: r2, locationId: a2, staffId: o2, onlyAvailableSlots: i2 && !h2, customerChoices: s2, minRemainingCapacity: c2, limit: Cs, cursor: v2 });
2026
+ g2.push(...h2 ? t3.timeSlots.filter((e3) => e3.bookable || No(e3)) : t3.timeSlots), _2 = t3.timeZone ?? _2, v2 = t3.nextCursor ?? void 0;
2027
+ } while (v2);
2028
+ return { timeSlots: g2, timeZone: _2 };
2021
2029
  }
2022
- function Cs(e2) {
2030
+ function Ts(e2) {
2023
2031
  return { slotStart: e2.localStartDate, slotEnd: e2.localEndDate, eventId: e2.eventInfo?.eventId, scheduleId: e2.scheduleId ?? void 0, locationId: e2.location?._id ?? void 0, locationType: e2.location?.locationType ?? void 0 };
2024
2032
  }
2025
- function ws(e2) {
2026
- return e2?.options?.values?.[0]?.type === ka.STAFF_MEMBER;
2033
+ function Es(e2) {
2034
+ return e2?.options?.values?.[0]?.type === Oa.STAFF_MEMBER;
2027
2035
  }
2028
- function Ts(e2) {
2036
+ function Ds(e2) {
2029
2037
  return e2.staffMemberDetails?.staffMembers ?? [];
2030
2038
  }
2031
- function Es(e2, t2) {
2039
+ function Os(e2, t2) {
2032
2040
  let n2 = e2.workingHoursLocationCoverage;
2033
2041
  return { staffMemberId: e2.staffMemberId ?? ``, name: e2.name ?? null, image: null, isSelected: t2 === e2.staffMemberId, ...n2 ? { locationCoverage: { availableAtAllLocations: n2.availableAtAllLocations ?? false, locationIds: n2.locationIds ?? [] } } : {} };
2034
2042
  }
2035
- function Ds(e2, t2) {
2043
+ function ks(e2, t2) {
2036
2044
  let n2 = e2.locationCoverage;
2037
2045
  return !n2 || n2.availableAtAllLocations || n2.locationIds.includes(t2);
2038
2046
  }
2039
- function Os(e2, t2) {
2040
- return t2 ? e2.filter((e3) => Ds(e3, t2)) : e2;
2047
+ function As(e2, t2) {
2048
+ return t2 ? e2.filter((e3) => ks(e3, t2)) : e2;
2041
2049
  }
2042
- function ks(e2, t2) {
2050
+ function js(e2, t2) {
2043
2051
  let n2 = new Map(t2.map((e3) => [e3.staffMemberId, e3.locationCoverage]));
2044
2052
  return e2.choices.map((e3) => e3.choiceId).filter((e3) => e3 != null).map((e3) => ({ staffMemberId: e3, locationCoverage: n2.get(e3) }));
2045
2053
  }
2046
- function As(e2, t2, n2) {
2054
+ function Ms(e2, t2, n2) {
2047
2055
  if (e2?.type !== `STAFF_MEMBER` || !n2) return;
2048
- let r2 = Os(ks(e2, t2), n2);
2056
+ let r2 = As(js(e2, t2), n2);
2049
2057
  return r2.length === 1 ? r2[0].staffMemberId : void 0;
2050
2058
  }
2051
- function js(e2, t2) {
2059
+ function Ns(e2, t2) {
2052
2060
  if (t2.length === 0) return e2;
2053
- let n2 = e2.filter((e3) => Os(t2, e3.id).length > 0);
2061
+ let n2 = e2.filter((e3) => As(t2, e3.id).length > 0);
2054
2062
  return n2.length > 0 ? n2 : e2;
2055
2063
  }
2056
- function Ms(e2) {
2057
- return Ts(e2).map((e3) => Es(e3, null));
2064
+ function Ps(e2) {
2065
+ return Ds(e2).map((e3) => Os(e3, null));
2058
2066
  }
2059
- function Ns(e2, t2, n2 = false) {
2060
- let r2 = Ps(e2), i2 = r2.length === 1 ? r2[0].id : void 0, a2 = n2 || !i2 || r2.some((e3) => e3.id === t2);
2067
+ function Fs(e2, t2, n2 = false) {
2068
+ let r2 = Is(e2), i2 = r2.length === 1 ? r2[0].id : void 0, a2 = n2 || !i2 || r2.some((e3) => e3.id === t2);
2061
2069
  return t2 && a2 ? t2 : i2;
2062
2070
  }
2063
- function Ps(e2) {
2064
- return js(Za(e2), Ms(e2));
2071
+ function Is(e2) {
2072
+ return Ns(Xa(e2), Ps(e2));
2065
2073
  }
2066
- function Fs(e2) {
2074
+ function Ls(e2) {
2067
2075
  let t2 = e2;
2068
2076
  return t2.__state || (t2.__state = { status: `pending` }, t2.then((e3) => {
2069
2077
  t2.__state = { status: `fulfilled`, value: e3 };
@@ -2071,38 +2079,38 @@ function Fs(e2) {
2071
2079
  t2.__state = { status: `rejected`, reason: e3 };
2072
2080
  })), t2.__state;
2073
2081
  }
2074
- function Is(e2) {
2075
- let t2 = Fs(e2);
2082
+ function Rs(e2) {
2083
+ let t2 = Ls(e2);
2076
2084
  if (t2.status === `fulfilled`) return t2.value;
2077
2085
  throw t2.status === `rejected` ? t2.reason : e2;
2078
2086
  }
2079
- function Ls(e2) {
2087
+ function zs(e2) {
2080
2088
  let t2 = Promise.resolve(e2);
2081
2089
  return t2.__state = { status: `fulfilled`, value: e2 }, t2;
2082
2090
  }
2083
- var Rs = Rr(`@wix/site-service-warmup-data`);
2084
- function zs() {
2091
+ var Bs = Lr(`@wix/site-service-warmup-data`);
2092
+ function Vs() {
2085
2093
  try {
2086
2094
  return f();
2087
2095
  } catch {
2088
2096
  return null;
2089
2097
  }
2090
2098
  }
2091
- function Bs(e2) {
2099
+ function Hs(e2) {
2092
2100
  try {
2093
- return e2 ? e2(Rs) : null;
2101
+ return e2 ? e2(Bs) : null;
2094
2102
  } catch {
2095
2103
  return null;
2096
2104
  }
2097
2105
  }
2098
- function Vs() {
2099
- let e2 = Bs(zs()), t2 = typeof window > `u`;
2106
+ function Us() {
2107
+ let e2 = Hs(Vs()), t2 = typeof window > `u`;
2100
2108
  return { scope: e2 ?? void 0, get: async (n2) => {
2101
2109
  if (t2 || !e2) return null;
2102
2110
  try {
2103
2111
  return await e2.get(n2);
2104
2112
  } catch (e3) {
2105
- return $(e3, { feature: Q.warmup, action: `read`, level: `warning`, contexts: { warmup: { key: n2 } } }), null;
2113
+ return ko(e3, { feature: $.warmup, action: `read`, level: `warning`, contexts: { warmup: { key: n2 } } }), null;
2106
2114
  }
2107
2115
  }, set: (n2, r2) => {
2108
2116
  if (t2 && e2) try {
@@ -2111,57 +2119,57 @@ function Vs() {
2111
2119
  }
2112
2120
  } };
2113
2121
  }
2114
- var Hs = `bookings-uou`;
2115
- function Us() {
2116
- return `${Hs}:bookings-settings`;
2122
+ var Ws = `bookings-uou`;
2123
+ function Gs() {
2124
+ return `${Ws}:bookings-settings`;
2117
2125
  }
2118
- function Ws() {
2119
- return `${Hs}:time-slots-configuration`;
2126
+ function Ks() {
2127
+ return `${Ws}:time-slots-configuration`;
2120
2128
  }
2121
- var Gs = 5e3;
2122
- var Ks = 100;
2123
- var qs = `wix-warmup-data`;
2124
- var Js = null;
2125
- function Ys(e2) {
2129
+ var qs = 5e3;
2130
+ var Js = 100;
2131
+ var Ys = `wix-warmup-data`;
2132
+ var Xs = null;
2133
+ function Zs(e2) {
2126
2134
  if (typeof document < `u`) try {
2127
- let t2 = document.getElementById(qs)?.textContent;
2128
- return t2 ? (Js?.text !== t2 && (Js = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), Js.data[e2] ?? void 0) : void 0;
2135
+ let t2 = document.getElementById(Ys)?.textContent;
2136
+ return t2 ? (Xs?.text !== t2 && (Xs = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), Xs.data[e2] ?? void 0) : void 0;
2129
2137
  } catch {
2130
2138
  return;
2131
2139
  }
2132
2140
  }
2133
- var Xs = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
2134
- var Zs = Xs();
2135
- var Qs = /* @__PURE__ */ new WeakMap();
2136
- var $s = /* @__PURE__ */ new WeakMap();
2137
- function ec(e2) {
2138
- if (!e2) return Zs;
2139
- let t2 = Qs.get(e2);
2140
- return t2 || (t2 = Xs(), Qs.set(e2, t2)), t2;
2141
+ var Qs = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
2142
+ var $s = Qs();
2143
+ var ec = /* @__PURE__ */ new WeakMap();
2144
+ var tc = /* @__PURE__ */ new WeakMap();
2145
+ function nc(e2) {
2146
+ if (!e2) return $s;
2147
+ let t2 = ec.get(e2);
2148
+ return t2 || (t2 = Qs(), ec.set(e2, t2)), t2;
2141
2149
  }
2142
- function tc({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
2150
+ function rc({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
2143
2151
  if (e2 === null) return n2();
2144
2152
  if (typeof window > `u`) {
2145
2153
  let r3 = () => n2().then((n3) => (t2.set(e2, n3), n3)), { scope: i3 } = t2;
2146
2154
  if (!i3) return r3();
2147
- let a3 = $s.get(i3);
2148
- a3 || (a3 = /* @__PURE__ */ new Map(), $s.set(i3, a3));
2155
+ let a3 = tc.get(i3);
2156
+ a3 || (a3 = /* @__PURE__ */ new Map(), tc.set(i3, a3));
2149
2157
  let o3 = a3.get(e2);
2150
2158
  if (o3) return o3;
2151
2159
  let s3 = r3();
2152
2160
  return a3.set(e2, s3), s3.catch(() => a3.delete(e2)), s3;
2153
2161
  }
2154
- let i2 = ec(t2.scope), a2 = Date.now();
2162
+ let i2 = nc(t2.scope), a2 = Date.now();
2155
2163
  for (let [e3, t3] of i2.promises) t3.expiresAt <= a2 && i2.promises.delete(e3);
2156
2164
  let o2 = i2.promises.get(e2);
2157
2165
  if (o2 && !r2) return o2.promise;
2158
2166
  r2 && i2.invalidatedWarmup.add(e2);
2159
2167
  let s2 = !i2.invalidatedWarmup.has(e2);
2160
2168
  if (s2) {
2161
- let t3 = Ys(e2);
2169
+ let t3 = Zs(e2);
2162
2170
  if (t3 !== void 0) {
2163
- let n3 = Ls(t3);
2164
- return i2.promises.set(e2, { promise: n3, expiresAt: a2 + Gs }), n3;
2171
+ let n3 = zs(t3);
2172
+ return i2.promises.set(e2, { promise: n3, expiresAt: a2 + qs }), n3;
2165
2173
  }
2166
2174
  }
2167
2175
  let c2 = (async () => {
@@ -2171,69 +2179,69 @@ function tc({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
2171
2179
  }
2172
2180
  return n2();
2173
2181
  })();
2174
- i2.promises.size >= Ks && i2.promises.delete(i2.promises.keys().next().value);
2182
+ i2.promises.size >= Js && i2.promises.delete(i2.promises.keys().next().value);
2175
2183
  let l2 = { promise: c2, expiresAt: 1 / 0 };
2176
2184
  return i2.promises.set(e2, l2), c2.then(() => {
2177
- l2.expiresAt = Date.now() + Gs;
2185
+ l2.expiresAt = Date.now() + qs;
2178
2186
  }, () => {
2179
2187
  i2.promises.get(e2) === l2 && i2.promises.delete(e2);
2180
2188
  }), c2;
2181
2189
  }
2182
- var nc = { displayTimeZonePolicy: { basedOn: Ga.BUSINESS_TIME_ZONE, customerCanChange: false }, multiServiceAppointmentsEnabled: false };
2183
- async function rc() {
2190
+ var ic = { displayTimeZonePolicy: { basedOn: Wa.BUSINESS_TIME_ZONE, customerCanChange: false }, multiServiceAppointmentsEnabled: false };
2191
+ async function ac() {
2184
2192
  try {
2185
- let e2 = await Ja();
2186
- return { displayTimeZonePolicy: { basedOn: e2.displayTimeZone?.basedOn ?? Ga.BUSINESS_TIME_ZONE, customerCanChange: e2.displayTimeZone?.customerCanChange ?? false }, multiServiceAppointmentsEnabled: e2.multiServiceAppointments?.enabled ?? false };
2193
+ let e2 = await qa();
2194
+ return { displayTimeZonePolicy: { basedOn: e2.displayTimeZone?.basedOn ?? Wa.BUSINESS_TIME_ZONE, customerCanChange: e2.displayTimeZone?.customerCanChange ?? false }, multiServiceAppointmentsEnabled: e2.multiServiceAppointments?.enabled ?? false };
2187
2195
  } catch (e2) {
2188
- return $(e2, { feature: Q.bookingsSettings, action: `fetch-bookings-settings`, level: `warning` }), nc;
2196
+ return ko(e2, { feature: $.bookingsSettings, action: `fetch-bookings-settings`, level: `warning` }), ic;
2189
2197
  }
2190
2198
  }
2191
- var ic = { isLoading: true };
2192
- var ac = n(null);
2193
- var oc = `useBookingsSettingsContext must be used within BookingsSettingsProvider`;
2194
- function sc() {
2195
- let e2 = a(ac);
2196
- if (!e2) throw Error(oc);
2199
+ var oc = { isLoading: true };
2200
+ var sc = n(null);
2201
+ var cc = `useBookingsSettingsContext must be used within BookingsSettingsProvider`;
2202
+ function lc() {
2203
+ let e2 = a(sc);
2204
+ if (!e2) throw Error(cc);
2197
2205
  return e2;
2198
2206
  }
2199
- function cc(e2) {
2200
- return e2.basedOn === Ga.CUSTOMER_TIME_ZONE ? Intl.DateTimeFormat().resolvedOptions().timeZone : void 0;
2207
+ function uc(e2) {
2208
+ return e2.basedOn === Wa.CUSTOMER_TIME_ZONE ? Intl.DateTimeFormat().resolvedOptions().timeZone : void 0;
2201
2209
  }
2202
- function lc() {
2203
- let e2 = sc();
2204
- return e2.isLoading ? void 0 : cc(e2.displayTimeZonePolicy);
2210
+ function dc() {
2211
+ let e2 = lc();
2212
+ return e2.isLoading ? void 0 : uc(e2.displayTimeZonePolicy);
2205
2213
  }
2206
- function uc({ settingsPromise: e2, children: t2 }) {
2207
- let n2 = Is(e2), r2 = s(() => ({ isLoading: false, ...n2 }), [n2]);
2208
- return m(ac.Provider, { value: r2, children: t2 });
2214
+ function fc({ settingsPromise: e2, children: t2 }) {
2215
+ let n2 = Rs(e2), r2 = s(() => ({ isLoading: false, ...n2 }), [n2]);
2216
+ return m(sc.Provider, { value: r2, children: t2 });
2209
2217
  }
2210
- function dc({ bookingsSettings: e2, children: n2 }) {
2211
- let r2 = Vs(), [i2] = l(() => e2 ? null : tc({ key: Us(), warmupData: r2, fetchData: rc }));
2212
- return e2 ? m(ac.Provider, { value: { isLoading: false, ...e2 }, children: n2 }) : m(t, { fallback: m(ac.Provider, { value: ic, children: n2 }), children: m(uc, { settingsPromise: i2, children: n2 }) });
2218
+ function pc({ bookingsSettings: e2, children: n2 }) {
2219
+ let r2 = Us(), [i2] = l(() => e2 ? null : rc({ key: Gs(), warmupData: r2, fetchData: ac }));
2220
+ return e2 ? m(sc.Provider, { value: { isLoading: false, ...e2 }, children: n2 }) : m(t, { fallback: m(sc.Provider, { value: oc, children: n2 }), children: m(fc, { settingsPromise: i2, children: n2 }) });
2213
2221
  }
2214
- var fc = 1e3;
2215
- var pc = class extends e {
2222
+ var mc = 1e3;
2223
+ var hc = class extends e {
2216
2224
  state = { hasError: false };
2217
2225
  static getDerivedStateFromError() {
2218
2226
  return { hasError: true };
2219
2227
  }
2220
2228
  componentDidCatch(e2, t2) {
2221
- $(e2, { feature: this.props.feature ?? `service`, action: `render`, contexts: { react: { componentStack: t2.componentStack } } });
2229
+ ko(e2, { feature: this.props.feature ?? `service`, action: `render`, contexts: { react: { componentStack: t2.componentStack } } });
2222
2230
  }
2223
2231
  render() {
2224
2232
  return this.state.hasError ? this.props.fallback : this.props.children;
2225
2233
  }
2226
2234
  };
2227
- var mc = `appSectionParams`;
2228
- function hc(e2) {
2229
- let t2 = e2.searchParams.get(mc);
2235
+ var gc = `appSectionParams`;
2236
+ function _c(e2) {
2237
+ let t2 = e2.searchParams.get(gc);
2230
2238
  if (t2 === null) return e2;
2231
2239
  let n2 = new URL(e2);
2232
- n2.searchParams.delete(mc);
2233
- for (let [e3, r2] of Object.entries(gc(t2))) typeof r2 == `string` && !n2.searchParams.has(e3) && n2.searchParams.set(e3, r2);
2240
+ n2.searchParams.delete(gc);
2241
+ for (let [e3, r2] of Object.entries(vc(t2))) typeof r2 == `string` && !n2.searchParams.has(e3) && n2.searchParams.set(e3, r2);
2234
2242
  return n2;
2235
2243
  }
2236
- function gc(e2) {
2244
+ function vc(e2) {
2237
2245
  try {
2238
2246
  let t2 = JSON.parse(e2);
2239
2247
  return t2 && typeof t2 == `object` && !Array.isArray(t2) ? t2 : {};
@@ -2241,16 +2249,16 @@ function gc(e2) {
2241
2249
  return {};
2242
2250
  }
2243
2251
  }
2244
- var _c = `bookings-uou:url-change`;
2245
- var vc = (e2) => {
2252
+ var yc = `bookings-uou:url-change`;
2253
+ var bc = (e2) => {
2246
2254
  let t2 = new URL(e2);
2247
2255
  return t2.searchParams.sort(), t2.href;
2248
2256
  };
2249
- function yc(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
2257
+ function xc(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
2250
2258
  let r2 = globalThis.window;
2251
2259
  if (!r2?.history) return;
2252
2260
  let i2 = new URL(r2.location.href);
2253
- if (vc(i2) === vc(e2)) return;
2261
+ if (bc(i2) === bc(e2)) return;
2254
2262
  let a2 = { scrollY: r2.scrollY };
2255
2263
  if (n2) r2.history.replaceState(a2, ``, e2.href);
2256
2264
  else {
@@ -2261,110 +2269,110 @@ function yc(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
2261
2269
  return;
2262
2270
  }
2263
2271
  }
2264
- r2.dispatchEvent(new Event(_c));
2272
+ r2.dispatchEvent(new Event(yc));
2265
2273
  }
2266
- function bc(e2) {
2274
+ function Sc(e2) {
2267
2275
  let t2 = globalThis.window;
2268
- return t2 ? (t2.addEventListener(_c, e2), t2.addEventListener(`popstate`, e2), () => {
2269
- t2.removeEventListener(_c, e2), t2.removeEventListener(`popstate`, e2);
2276
+ return t2 ? (t2.addEventListener(yc, e2), t2.addEventListener(`popstate`, e2), () => {
2277
+ t2.removeEventListener(yc, e2), t2.removeEventListener(`popstate`, e2);
2270
2278
  }) : () => {
2271
2279
  };
2272
2280
  }
2273
- var xc = (e2) => {
2281
+ var Cc = (e2) => {
2274
2282
  try {
2275
2283
  return decodeURIComponent(e2);
2276
2284
  } catch {
2277
2285
  return e2;
2278
2286
  }
2279
2287
  };
2280
- function Sc(e2, t2) {
2288
+ function wc(e2, t2) {
2281
2289
  let n2 = t2 ? new URL(t2).pathname : `/`;
2282
- return `./${xc(new URL(e2).pathname.replace(n2, ``).replace(/^\/|\/$/g, ``))}`;
2290
+ return `./${Cc(new URL(e2).pathname.replace(n2, ``).replace(/^\/|\/$/g, ``))}`;
2283
2291
  }
2284
- function Cc() {
2285
- let e2 = p(Hr), t2 = i(() => e2.currentUrl, [e2]), n2 = u(bc, t2, t2), r2 = s(() => hc(new URL(n2)), [n2]), a2 = e2.siteUrl.replace(/\/$/, ``);
2286
- return { pathname: r2.pathname, search: r2.search, searchParams: r2.searchParams, href: r2.href, getParsedUrl: () => hc(new URL(e2.currentUrl)), getRelativeUrl: () => Sc(e2.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: yc };
2292
+ function Tc() {
2293
+ let e2 = p(Vr), t2 = i(() => e2.currentUrl, [e2]), n2 = u(Sc, t2, t2), r2 = s(() => _c(new URL(n2)), [n2]), a2 = e2.siteUrl.replace(/\/$/, ``);
2294
+ return { pathname: r2.pathname, search: r2.search, searchParams: r2.searchParams, href: r2.href, getParsedUrl: () => _c(new URL(e2.currentUrl)), getRelativeUrl: () => wc(e2.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: xc };
2287
2295
  }
2288
- var wc = () => () => {
2296
+ var Ec = () => () => {
2289
2297
  };
2290
- function Tc() {
2298
+ function Dc() {
2291
2299
  let e2;
2292
2300
  return { inBrowser: () => e2 ??= false, onServer: () => e2 ??= true };
2293
2301
  }
2294
- function Ec() {
2295
- let [e2] = l(Tc);
2296
- return u(wc, e2.inBrowser, e2.onServer);
2297
- }
2298
- var Dc = Symbol(`landing pending`);
2299
2302
  function Oc() {
2300
- return !Ec();
2303
+ let [e2] = l(Dc);
2304
+ return u(Ec, e2.inBrowser, e2.onServer);
2301
2305
  }
2302
- function kc() {
2303
- let { searchParams: e2 } = Cc(), t2 = Oc(), [n2, i2] = l(t2);
2306
+ var kc = Symbol(`landing pending`);
2307
+ function Ac() {
2308
+ return !Oc();
2309
+ }
2310
+ function jc() {
2311
+ let { searchParams: e2 } = Tc(), t2 = Ac(), [n2, i2] = l(t2);
2304
2312
  return o(() => {
2305
2313
  r(() => i2(true));
2306
- }, []), n2 ? io(e2) : Dc;
2307
- }
2308
- function Ac(e2) {
2309
- let t2 = kc();
2310
- return e2 || t2 === Dc ? null : t2;
2314
+ }, []), n2 ? ro(e2) : kc;
2311
2315
  }
2312
- var jc = Rr(`@wix/site-service-business-logger`);
2313
2316
  function Mc(e2) {
2317
+ let t2 = jc();
2318
+ return e2 || t2 === kc ? null : t2;
2319
+ }
2320
+ var Nc = Lr(`@wix/site-service-business-logger`);
2321
+ function Pc(e2) {
2314
2322
  return { evid: 32, src: 16, endpoint: ``, params: e2 };
2315
2323
  }
2316
- function Nc(e2) {
2324
+ function Fc(e2) {
2317
2325
  return { evid: 33, src: 16, endpoint: ``, params: e2 };
2318
2326
  }
2319
- function Pc(e2) {
2327
+ function Ic(e2) {
2320
2328
  return { evid: 34, src: 16, endpoint: ``, params: e2 };
2321
2329
  }
2322
- var Fc = { SERVICES: `services_context`, SERVICE: `service_context`, TIME_SLOTS: `time_slots_context`, BOOKING_CHECKOUT: `booking_checkout_context`, CATEGORIES: `categories_context`, LOCATIONS: `locations_context`, SERVICE_ADD_ONS: `service_addons_context`, PREFERENCES: `preferences_context` };
2323
- Jr.BOOK_ONLINE;
2324
- var Ic = `new_bookings_server`;
2325
- var Lc = { LOAD: `load`, LOCATION_CHOSEN: `location chosen`, STAFF_CHOSEN: `staff chosen`, VARIANT_SELECTED: `variant selected`, ADD_ON_SELECTED: `add on selected`, ADD_ON_UNSELECTED: `add on unselected`, BACK: `back`, CLOSE: `close`, STAY: `stay`, ADD_SERVICE: `add service`, EDIT_BASKET_ITEM: `edit basket item`, EDIT_BASKET_ITEM_FROM_CALENDAR: `edit basket item from calendar`, CHANGE_STAFF_MEMBER: `change staff member`, REMOVE_BASKET_ITEM: `remove basket item`, SELECT_SERVICE: `select service`, SEARCH: `search`, CLEAR_SEARCH: `clear search` };
2326
- var Rc = { TIMEZONE_PICKER: `timezone_picker`, TIME_PICKER: `time_picker`, BOOKING_DETAILS: `booking_details`, RESCHEDULE_DIALOG: `reschedule_dialog`, JOIN_WAITLIST_DIALOG: `join_waitlist_dialog` };
2327
- var zc = { DROPDOWN: `dropdown`, TIME_SLOT: `time_slot`, EXPAND: `expand`, COLLAPSE: `collapse` };
2328
- var Bc = (e2) => {
2329
- let { reportBi: t2 } = p(jc);
2330
+ var Lc = { SERVICES: `services_context`, SERVICE: `service_context`, TIME_SLOTS: `time_slots_context`, BOOKING_CHECKOUT: `booking_checkout_context`, CATEGORIES: `categories_context`, LOCATIONS: `locations_context`, SERVICE_ADD_ONS: `service_addons_context`, PREFERENCES: `preferences_context` };
2331
+ qr.BOOK_ONLINE;
2332
+ var Rc = `new_bookings_server`;
2333
+ var zc = { LOAD: `load`, LOCATION_CHOSEN: `location chosen`, STAFF_CHOSEN: `staff chosen`, VARIANT_SELECTED: `variant selected`, ADD_ON_SELECTED: `add on selected`, ADD_ON_UNSELECTED: `add on unselected`, BACK: `back`, CLOSE: `close`, STAY: `stay`, ADD_SERVICE: `add service`, EDIT_BASKET_ITEM: `edit basket item`, EDIT_BASKET_ITEM_FROM_CALENDAR: `edit basket item from calendar`, CHANGE_STAFF_MEMBER: `change staff member`, REMOVE_BASKET_ITEM: `remove basket item`, SELECT_SERVICE: `select service`, SEARCH: `search`, CLEAR_SEARCH: `clear search` };
2334
+ var Bc = { TIMEZONE_PICKER: `timezone_picker`, TIME_PICKER: `time_picker`, BOOKING_DETAILS: `booking_details`, RESCHEDULE_DIALOG: `reschedule_dialog`, JOIN_WAITLIST_DIALOG: `join_waitlist_dialog` };
2335
+ var Vc = { DROPDOWN: `dropdown`, TIME_SLOT: `time_slot`, EXPAND: `expand`, COLLAPSE: `collapse` };
2336
+ var Hc = (e2) => {
2337
+ let { reportBi: t2 } = p(Nc);
2330
2338
  return i((n2) => {
2331
- t2({ widget_name: e2, bookingsPlatform: Ic, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
2339
+ t2({ widget_name: e2, bookingsPlatform: Rc, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
2332
2340
  }, [t2, e2]);
2333
2341
  };
2334
- var Vc = (e2, t2 = true) => {
2335
- let n2 = Bc(e2), { getParsedUrl: r2 } = Cc(), i2 = c(false);
2342
+ var Uc = (e2, t2 = true) => {
2343
+ let n2 = Hc(e2), { getParsedUrl: r2 } = Tc(), i2 = c(false);
2336
2344
  o(() => {
2337
- t2 && !i2.current && (i2.current = true, n2(Mc({ referralInfo: r2().searchParams.get(ro.referral) ?? void 0 })));
2345
+ t2 && !i2.current && (i2.current = true, n2(Pc({ referralInfo: r2().searchParams.get(no.referral) ?? void 0 })));
2338
2346
  }, [t2, n2, r2]);
2339
2347
  };
2340
- function Hc(e2) {
2348
+ function Wc(e2) {
2341
2349
  return { evid: 1177, src: 16, endpoint: `wixboost-ugc`, params: e2 };
2342
2350
  }
2343
- function Uc(e2) {
2351
+ function Gc(e2) {
2344
2352
  return { evid: 596, src: 16, endpoint: `wixboost-ugc`, params: e2 };
2345
2353
  }
2346
- function Wc(e2, t2) {
2354
+ function Kc(e2, t2) {
2347
2355
  let n2 = new Intl.DateTimeFormat(`en-US`, { timeZone: t2, hourCycle: `h23`, year: `numeric`, month: `2-digit`, day: `2-digit`, hour: `2-digit`, minute: `2-digit`, second: `2-digit` }).formatToParts(new Date(e2)), r2 = {};
2348
2356
  for (let e3 of n2) e3.type !== `literal` && (r2[e3.type] = Number(e3.value));
2349
2357
  return Date.UTC(r2.year, r2.month - 1, r2.day, r2.hour, r2.minute, r2.second) - e2;
2350
2358
  }
2351
- function Gc(e2, t2) {
2359
+ function qc(e2, t2) {
2352
2360
  let n2 = e2.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?/);
2353
2361
  if (!n2) return null;
2354
2362
  let [, r2, i2, a2, o2, s2, c2] = n2, l2 = Date.UTC(Number(r2), Number(i2) - 1, Number(a2), Number(o2), Number(s2), c2 ? Number(c2) : 0);
2355
2363
  if (Number.isNaN(l2)) return null;
2356
2364
  try {
2357
- let e3 = l2 - Wc(l2, t2);
2358
- return new Date(l2 - Wc(e3, t2));
2365
+ let e3 = l2 - Kc(l2, t2);
2366
+ return new Date(l2 - Kc(e3, t2));
2359
2367
  } catch {
2360
2368
  return null;
2361
2369
  }
2362
2370
  }
2363
- function Kc({ start: e2, end: t2, timeZone: n2, ...r2 }) {
2364
- let i2 = (e3) => e3 && n2 ? Gc(e3, n2)?.getTime() : void 0;
2365
- return Pc({ bookingsServiceId: r2.serviceId, serviceType: r2.serviceType, startTime: i2(e2), endTime: i2(t2), isEligibleForFlowCompletion: r2.isEligibleForFlowCompletion });
2371
+ function Jc({ start: e2, end: t2, timeZone: n2, ...r2 }) {
2372
+ let i2 = (e3) => e3 && n2 ? qc(e3, n2)?.getTime() : void 0;
2373
+ return Ic({ bookingsServiceId: r2.serviceId, serviceType: r2.serviceType, startTime: i2(e2), endTime: i2(t2), isEligibleForFlowCompletion: r2.isEligibleForFlowCompletion });
2366
2374
  }
2367
- function qc({ nextAvailableSlotsCount: e2, isLoading: t2, hasError: n2, children: r2 }) {
2375
+ function Yc({ nextAvailableSlotsCount: e2, isLoading: t2, hasError: n2, children: r2 }) {
2368
2376
  let i2 = n2 ? `loadFailed` : null, a2 = d(true), o2 = a2?.reschedule != null, s2 = { selectedDate: null, daysAvailabilityRange: null, daysAvailability: [], daysAvailabilityLoading: false, daysAvailabilityHasError: false, selectDate: async () => {
2369
2377
  }, setDaysAvailabilityRange: async () => {
2370
2378
  }, goToNextAvailableDate: async () => `cancelled`, canChangeTimeZone: false, isMultiService: false, isSelectionPending: a2?.isSelectionPending ?? false, availabilityRequestKey: null, needsServiceChoice: false, isRescheduling: o2, rescheduleValidUntil: null, staffFilterOptions: [], locationFilterOptions: [], selectedStaffFilter: null, requestedGender: null, genderSelectionAllowed: false, selectedLocationFilter: null, setStaffFilter: () => {
@@ -2378,265 +2386,290 @@ function qc({ nextAvailableSlotsCount: e2, isLoading: t2, hasError: n2, children
2378
2386
  }, navigateToBookingForm: () => {
2379
2387
  }, timeSlotLimitPerDay: null, daysWithMore: /* @__PURE__ */ new Set(), loadingDate: null, loadAllTimeSlotsForDay: async () => {
2380
2388
  } };
2381
- return m(tu.Provider, { value: s2, children: r2 });
2389
+ return m(su.Provider, { value: s2, children: r2 });
2382
2390
  }
2383
- function Jc({ nextAvailableSlotsCount: e2, children: t2 }) {
2384
- return m(qc, { nextAvailableSlotsCount: e2, isLoading: true, hasError: false, children: t2 });
2391
+ function Xc({ nextAvailableSlotsCount: e2, children: t2 }) {
2392
+ return m(Yc, { nextAvailableSlotsCount: e2, isLoading: true, hasError: false, children: t2 });
2385
2393
  }
2386
- function Yc({ nextAvailableSlotsCount: e2, children: t2 }) {
2387
- return m(qc, { nextAvailableSlotsCount: e2, isLoading: false, hasError: true, children: t2 });
2394
+ function Zc({ nextAvailableSlotsCount: e2, children: t2 }) {
2395
+ return m(Yc, { nextAvailableSlotsCount: e2, isLoading: false, hasError: true, children: t2 });
2388
2396
  }
2389
- var Xc = 1e3;
2390
- function Zc(e2, t2) {
2391
- let n2 = /* @__PURE__ */ new Map();
2397
+ var Qc = 1e3;
2398
+ function $c(e2, t2, { waitlistAvailable: n2 = false } = {}) {
2399
+ let r2 = /* @__PURE__ */ new Map();
2392
2400
  for (let e3 of t2) {
2393
2401
  let t3 = e3.localStartDate?.slice(0, 10);
2394
- t3 && (e3.bookable ? n2.set(t3, `available`) : n2.has(t3) || n2.set(t3, `unavailable`));
2402
+ t3 && (e3.bookable || n2 && No(e3) ? r2.set(t3, `available`) : r2.has(t3) || r2.set(t3, `unavailable`));
2395
2403
  }
2396
- let r2 = [], i2 = Wo(e2);
2397
- for (let t3 = 0; t3 < i2; t3 += 1) {
2398
- let i3 = Uo(e2.startDate, t3);
2399
- r2.push({ date: i3, availability: n2.get(i3) ?? `none` });
2404
+ let i2 = [], a2 = Ko(e2);
2405
+ for (let t3 = 0; t3 < a2; t3 += 1) {
2406
+ let n3 = Go(e2.startDate, t3);
2407
+ i2.push({ date: n3, availability: r2.get(n3) ?? `none` });
2400
2408
  }
2401
- return r2;
2409
+ return i2;
2402
2410
  }
2403
- function Qc(e2, t2) {
2404
- return { fromLocalDate: Ro(e2.startDate, t2), toLocalDate: Io(No(e2.endDate)) };
2411
+ function el(e2, t2) {
2412
+ return { fromLocalDate: Bo(e2.startDate, t2), toLocalDate: Ro(Fo(e2.endDate)) };
2405
2413
  }
2406
- async function $c(e2, t2, n2, r2, i2, a2) {
2407
- return (await fs({ serviceId: e2, ...Qc(n2, t2), timeZone: t2, ...ts(r2), ...ns(i2), ...is(a2, i2), timeSlotsPerDay: 1, cursorPaging: { limit: Math.min(Wo(n2), Xc) } })).timeSlots ?? [];
2414
+ async function tl(e2, t2, n2, r2, i2, a2) {
2415
+ return (await ms({ serviceId: e2, ...el(n2, t2), timeZone: t2, ...rs(r2), ...is(i2), ...os(a2, i2), timeSlotsPerDay: 1, cursorPaging: { limit: Math.min(Ko(n2), Qc) } })).timeSlots ?? [];
2408
2416
  }
2409
- async function el(e2, t2, n2, r2, i2, a2) {
2410
- return (await ms({ serviceIds: [e2], ...Qc(n2, t2), timeZone: t2, includeNonBookable: true, eventFilter: { type: `CLASS`, ...ps(r2, i2, a2) }, maxSlotsPerDay: 1, cursorPaging: { limit: Math.min(Wo(n2), Xc) } })).timeSlots;
2417
+ async function nl(e2, t2, n2, r2, i2, a2, o2 = false) {
2418
+ let s2 = { serviceIds: [e2], ...el(n2, t2), timeZone: t2, includeNonBookable: true, eventFilter: { type: `CLASS`, ...hs(r2, i2, a2) } };
2419
+ if (!o2) return (await gs({ ...s2, maxSlotsPerDay: 1, cursorPaging: { limit: Math.min(Ko(n2), Qc) } })).timeSlots;
2420
+ let c2 = [], l2;
2421
+ do {
2422
+ let e3 = await gs({ ...s2, cursorPaging: { limit: Qc, ...l2 ? { cursor: l2 } : {} } });
2423
+ c2.push(...e3.timeSlots), l2 = e3.nextCursor ?? void 0;
2424
+ } while (l2);
2425
+ return c2;
2411
2426
  }
2412
- async function tl({ serviceId: e2, serviceType: t2, range: n2, fromDate: r2, timeZone: i2, locationId: a2, staffId: o2, customerChoices: s2, minRemainingCapacity: c2 }) {
2413
- if (eo(t2) || n2.endDate < r2) return Zc(n2, []);
2414
- let l2 = { startDate: n2.startDate < r2 ? r2 : n2.startDate, endDate: n2.endDate }, u2 = $a(t2) ? Jo(l2) : [l2];
2415
- return Zc(n2, (await Promise.all(u2.map((n3) => $a(t2) ? el(e2, i2, n3, a2, o2, c2) : $c(e2, i2, n3, a2, o2, s2)))).flat());
2427
+ async function rl({ serviceId: e2, serviceType: t2, range: n2, fromDate: r2, timeZone: i2, locationId: a2, staffId: o2, customerChoices: s2, minRemainingCapacity: c2, keepWaitlistSlots: l2 = false }) {
2428
+ if ($a(t2) || n2.endDate < r2) return $c(n2, []);
2429
+ let u2 = { startDate: n2.startDate < r2 ? r2 : n2.startDate, endDate: n2.endDate }, d2 = Qa(t2) ? Xo(u2) : [u2];
2430
+ return $c(n2, (await Promise.all(d2.map((n3) => Qa(t2) ? nl(e2, i2, n3, a2, o2, c2, l2) : tl(e2, i2, n3, a2, o2, s2)))).flat(), { waitlistAvailable: l2 && Qa(t2) });
2416
2431
  }
2417
- function nl({ serviceId: e2, staff: t2, customerChoices: n2 }) {
2432
+ function il({ serviceId: e2, staff: t2, customerChoices: n2 }) {
2418
2433
  let r2 = t2 && !t2.anyResource ? t2.staffMemberId : void 0;
2419
- return { serviceId: e2, ...is(n2, r2), ...t2?.anyResource ? {} : { includeResourceTypeIds: [qr] }, ...r2 ? { resourceTypes: [{ resourceTypeId: qr, resourceIds: [r2] }] } : {} };
2434
+ return { serviceId: e2, ...os(n2, r2), ...t2?.anyResource ? {} : { includeResourceTypeIds: [Kr] }, ...r2 ? { resourceTypes: [{ resourceTypeId: Kr, resourceIds: [r2] }] } : {} };
2420
2435
  }
2421
- function rl({ services: e2, locationId: t2, locationType: n2, timeZone: r2 }) {
2422
- return { services: e2.map(nl), timeZone: r2, location: { ...t2 ? { _id: t2 } : {}, locationType: n2 } };
2436
+ function al({ services: e2, locationId: t2, locationType: n2, timeZone: r2 }) {
2437
+ return { services: e2.map(il), timeZone: r2, location: { ...t2 ? { _id: t2 } : {}, locationType: n2 } };
2423
2438
  }
2424
- function il(e2) {
2425
- let { customerChoices: t2, ...n2 } = e2, r2 = t2 ? rs(t2) : void 0;
2439
+ function ol(e2) {
2440
+ let { customerChoices: t2, ...n2 } = e2, r2 = t2 ? as(t2) : void 0;
2426
2441
  return r2 ? { ...n2, customerChoices: r2 } : n2;
2427
2442
  }
2428
- async function al(e2) {
2429
- let t2 = e2.services ?? [], n2 = () => Oa({ ...e2, services: t2.map(il) }), r2 = t2.some((e3) => e3.customerChoices?.requestedGender);
2430
- if (r2 && ls()) return n2();
2443
+ async function sl(e2) {
2444
+ let t2 = e2.services ?? [], n2 = () => Da({ ...e2, services: t2.map(ol) }), r2 = t2.some((e3) => e3.customerChoices?.requestedGender);
2445
+ if (r2 && ds()) return n2();
2431
2446
  try {
2432
- return await Oa(e2);
2447
+ return await Da(e2);
2433
2448
  } catch (e3) {
2434
- if (!r2 || !os(e3)) throw e3;
2435
- return $(e3, { feature: Q.timeSlots, action: `requested-gender-rejected`, level: `warning` }), ds(), n2();
2449
+ if (!r2 || !cs(e3)) throw e3;
2450
+ return ko(e3, { feature: $.timeSlots, action: `requested-gender-rejected`, level: `warning` }), ps(), n2();
2436
2451
  }
2437
2452
  }
2438
- var ol = 1e3;
2439
- async function sl({ range: e2, fromDate: t2, ...n2 }) {
2440
- if (e2.endDate < t2) return Zc(e2, []);
2453
+ var cl = 1e3;
2454
+ async function ll({ range: e2, fromDate: t2, ...n2 }) {
2455
+ if (e2.endDate < t2) return $c(e2, []);
2441
2456
  let r2 = { startDate: e2.startDate < t2 ? t2 : e2.startDate, endDate: e2.endDate };
2442
- return Zc(e2, (await al({ ...rl(n2), fromLocalDate: Ro(r2.startDate, n2.timeZone), toLocalDate: Io(No(r2.endDate)), timeSlotsPerDay: 1, cursorPaging: { limit: Math.min(Wo(r2), ol) } })).timeSlots ?? []);
2457
+ return $c(e2, (await sl({ ...al(n2), fromLocalDate: Bo(r2.startDate, n2.timeZone), toLocalDate: Ro(Fo(r2.endDate)), timeSlotsPerDay: 1, cursorPaging: { limit: Math.min(Ko(r2), cl) } })).timeSlots ?? []);
2443
2458
  }
2444
- async function cl({ date: e2, onlyAvailableSlots: t2, fromLocalDate: n2, ...r2 }) {
2459
+ async function ul({ date: e2, onlyAvailableSlots: t2, fromLocalDate: n2, ...r2 }) {
2445
2460
  let i2 = `${e2}T00:00:00`, a2 = [], o2 = null, s2;
2446
2461
  do {
2447
- let c2 = await al({ ...rl(r2), fromLocalDate: n2 && n2 > i2 ? n2 : i2, toLocalDate: `${e2}T23:59:59`, ...t2 ? { bookable: true } : {}, cursorPaging: { limit: ol, ...s2 ? { cursor: s2 } : {} } });
2462
+ let c2 = await sl({ ...al(r2), fromLocalDate: n2 && n2 > i2 ? n2 : i2, toLocalDate: `${e2}T23:59:59`, ...t2 ? { bookable: true } : {}, cursorPaging: { limit: cl, ...s2 ? { cursor: s2 } : {} } });
2448
2463
  a2.push(...c2.timeSlots ?? []), o2 = c2.timeZone ?? o2, s2 = c2.cursorPagingMetadata?.cursors?.next || void 0;
2449
2464
  } while (s2);
2450
2465
  return { timeSlots: a2, timeZone: o2 };
2451
2466
  }
2452
- async function ll({ fromDate: e2, ...t2 }) {
2453
- let n2 = await al({ ...rl(t2), ...ys(e2), bookable: true, cursorPaging: { limit: 1 } });
2467
+ async function dl({ fromDate: e2, ...t2 }) {
2468
+ let n2 = await sl({ ...al(t2), ...xs(e2), bookable: true, cursorPaging: { limit: 1 } });
2454
2469
  return { timeSlots: n2.timeSlots ?? [], timeZone: n2.timeZone ?? null };
2455
2470
  }
2456
- var ul = [];
2457
- function dl({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest: r2, timeZone: a2, today: u2, locationId: d2, staffId: f2, loadInitially: p2, customerChoices: m2, minRemainingCapacity: h2, onlyAvailableSlots: g2 }) {
2458
- let [_2, v2] = l(null), [y2, b2] = l(p2), [x2, S2] = l(ul), [C2, w2] = l(false), [T2, E2] = l(false), D2 = c(0);
2471
+ var fl = Lr(`@wix/site-service-experiments`);
2472
+ function pl(e2) {
2473
+ try {
2474
+ return p(e2);
2475
+ } catch {
2476
+ return null;
2477
+ }
2478
+ }
2479
+ function ml(e2, t2) {
2480
+ try {
2481
+ return e2?.isOpen(t2) ?? false;
2482
+ } catch {
2483
+ return false;
2484
+ }
2485
+ }
2486
+ function hl(e2) {
2487
+ return ml(pl(fl), e2);
2488
+ }
2489
+ var gl = [];
2490
+ function _l({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest: r2, timeZone: a2, today: u2, locationId: f2, staffId: p2, loadInitially: m2, customerChoices: h2, minRemainingCapacity: g2, onlyAvailableSlots: _2 }) {
2491
+ let { service: v2 } = d(), y2 = hl(`bookingsUouWaitlistInAvailableSlots`) && _2 && v2?.bookingPolicy?.waitlistPolicy?.enabled === true, [b2, x2] = l(null), [S2, C2] = l(m2), [w2, T2] = l(gl), [E2, D2] = l(false), [ee2, O2] = l(false), k2 = c(0);
2459
2492
  o(() => {
2460
- _2 === null && u2 && v2(Go(u2));
2461
- }, [_2, u2]), o(() => {
2462
- if (!y2 || !e2 || !(t2 || r2) || !a2 || !u2 || !_2 || !r2 && eo(n2)) return;
2463
- let i2 = ++D2.current;
2464
- return w2(true), (r2 ? sl({ ...r2, range: _2, fromDate: u2, timeZone: a2 }) : tl({ serviceId: t2, serviceType: n2, range: _2, fromDate: u2, timeZone: a2, locationId: d2 ?? void 0, staffId: f2 ?? void 0, customerChoices: m2, minRemainingCapacity: h2 })).then((e3) => {
2465
- i2 === D2.current && (S2(e3), E2(false), w2(false));
2493
+ b2 === null && u2 && x2(qo(u2));
2494
+ }, [b2, u2]), o(() => {
2495
+ if (!S2 || !e2 || !(t2 || r2) || !a2 || !u2 || !b2 || !r2 && $a(n2)) return;
2496
+ let i2 = ++k2.current;
2497
+ return D2(true), (r2 ? ll({ ...r2, range: b2, fromDate: u2, timeZone: a2 }) : rl({ serviceId: t2, serviceType: n2, range: b2, fromDate: u2, timeZone: a2, locationId: f2 ?? void 0, staffId: p2 ?? void 0, customerChoices: h2, minRemainingCapacity: g2, keepWaitlistSlots: y2 })).then((e3) => {
2498
+ i2 === k2.current && (T2(e3), O2(false), D2(false));
2466
2499
  }).catch((e3) => {
2467
- i2 === D2.current && ($(e3, { feature: Q.timeSlots, action: `fetch-days-availability`, level: `warning` }), E2(true), w2(false));
2500
+ i2 === k2.current && (ko(e3, { feature: $.timeSlots, action: `fetch-days-availability`, level: `warning` }), O2(true), D2(false));
2468
2501
  }), () => {
2469
- i2 === D2.current && (D2.current += 1);
2502
+ i2 === k2.current && (k2.current += 1);
2470
2503
  };
2471
- }, [y2, e2, t2, n2, r2, a2, u2, _2, d2, f2, m2, h2]);
2472
- let O2 = i(async (e3) => {
2473
- Ho(e3) && (v2(e3), b2(true));
2504
+ }, [S2, e2, t2, n2, r2, a2, u2, b2, f2, p2, h2, g2, y2]);
2505
+ let A2 = i(async (e3) => {
2506
+ Wo(e3) && (x2(e3), C2(true));
2474
2507
  }, []);
2475
- return { range: _2, daysAvailability: s(() => g2 ? x2.map((e3) => e3.availability === `unavailable` ? { ...e3, availability: `none` } : e3) : x2, [x2, g2]), isLoading: C2, hasError: T2, setRange: O2 };
2508
+ return { range: b2, daysAvailability: s(() => _2 ? w2.map((e3) => e3.availability === `unavailable` ? { ...e3, availability: `none` } : e3) : w2, [w2, _2]), isLoading: E2, hasError: ee2, setRange: A2 };
2476
2509
  }
2477
- function fl({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest: r2, timeZone: a2, today: s2, locationId: u2, staffId: d2, customerChoices: f2, minRemainingCapacity: p2, onlyAvailableSlots: m2, serviceLoading: h2 }) {
2478
- let [g2, _2] = l(null), [v2, y2] = l(0), [b2, x2] = l(null), [S2, C2] = l(null), [w2, T2] = l(null), [E2, D2] = l(false), O2 = c(0), ee2 = c(0), te2 = c(0), k2 = i(() => {
2479
- ee2.current += 1, D2(false);
2510
+ function vl({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest: r2, timeZone: a2, today: s2, locationId: u2, staffId: d2, customerChoices: f2, minRemainingCapacity: p2, onlyAvailableSlots: m2, serviceLoading: h2 }) {
2511
+ let g2 = hl(`bookingsUouWaitlistInAvailableSlots`), [_2, v2] = l(null), [y2, b2] = l(0), [x2, S2] = l(null), [C2, w2] = l(null), [T2, E2] = l(null), [D2, ee2] = l(false), O2 = c(0), k2 = c(0), A2 = c(0), j2 = i(() => {
2512
+ k2.current += 1, ee2(false);
2480
2513
  }, []);
2481
2514
  o(() => {
2482
- k2();
2483
- }, [e2, t2, n2, r2, a2, u2, d2, f2, p2, k2]);
2484
- let A2 = e2 && !h2 && !t2 && !r2;
2515
+ j2();
2516
+ }, [e2, t2, n2, r2, a2, u2, d2, f2, p2, j2]);
2517
+ let M2 = e2 && !h2 && !t2 && !r2;
2485
2518
  o(() => {
2486
- A2 && (C2(null), T2(null));
2487
- }, [A2]), o(() => {
2488
- if (!g2) return;
2489
- if (A2) {
2490
- _2(null);
2519
+ M2 && (w2(null), E2(null));
2520
+ }, [M2]), o(() => {
2521
+ if (!_2) return;
2522
+ if (M2) {
2523
+ v2(null);
2491
2524
  return;
2492
2525
  }
2493
2526
  if (!e2 || !(t2 || r2) || !a2) return;
2494
- if (s2 && g2.date < s2) {
2495
- _2(null);
2527
+ if (s2 && _2.date < s2) {
2528
+ v2(null);
2496
2529
  return;
2497
2530
  }
2498
- if (!r2 && eo(n2)) {
2499
- _2(null);
2531
+ if (!r2 && $a(n2)) {
2532
+ v2(null);
2500
2533
  return;
2501
2534
  }
2502
- let i2 = Lo(new Date(Date.now()), a2), o2 = ++O2.current;
2503
- x2(null), C2(null), T2(null);
2504
- let c2 = i2.slice(0, 10) === g2.date ? i2 : void 0;
2505
- return (r2 ? cl({ ...r2, date: g2.date, timeZone: a2, onlyAvailableSlots: m2, fromLocalDate: c2 }) : Ss({ serviceId: t2, serviceType: n2, date: g2.date, timeZone: a2, onlyAvailableSlots: m2, locationId: u2 ?? void 0, staffId: d2 ?? void 0, customerChoices: f2, minRemainingCapacity: p2, fromLocalDate: c2 })).then((e3) => {
2506
- o2 === O2.current && x2({ timeSlots: e3.timeSlots, timeZone: e3.timeZone ?? a2 });
2535
+ let i2 = zo(new Date(Date.now()), a2), o2 = ++O2.current;
2536
+ S2(null), w2(null), E2(null);
2537
+ let c2 = i2.slice(0, 10) === _2.date ? i2 : void 0;
2538
+ return (r2 ? ul({ ...r2, date: _2.date, timeZone: a2, onlyAvailableSlots: m2, fromLocalDate: c2 }) : ws({ serviceId: t2, serviceType: n2, date: _2.date, timeZone: a2, onlyAvailableSlots: m2, locationId: u2 ?? void 0, staffId: d2 ?? void 0, customerChoices: f2, minRemainingCapacity: p2, keepWaitlistSlots: g2, fromLocalDate: c2 })).then((e3) => {
2539
+ o2 === O2.current && S2({ timeSlots: e3.timeSlots, timeZone: e3.timeZone ?? a2 });
2507
2540
  }).catch((e3) => {
2508
- o2 === O2.current && ($(e3, { feature: Q.timeSlots, action: `fetch-day-time-slots`, level: `warning` }), C2(`timeSlotsLoadFailed`));
2541
+ o2 === O2.current && (ko(e3, { feature: $.timeSlots, action: `fetch-day-time-slots`, level: `warning` }), w2(`timeSlotsLoadFailed`));
2509
2542
  }), () => {
2510
2543
  o2 === O2.current && (O2.current += 1);
2511
2544
  };
2512
- }, [g2, v2, e2, t2, h2, n2, r2, a2, s2, u2, d2, f2, p2, m2]);
2513
- let j2 = i(async (e3) => {
2514
- !r2 && eo(n2) || !Vo(e3) || s2 && e3 < s2 || (k2(), y2((e4) => e4 + 1), _2({ kind: `day`, date: e3 }));
2515
- }, [n2, r2, s2, k2]), ne2 = g2?.date ?? null, M2 = i(async () => {
2545
+ }, [_2, y2, e2, t2, h2, n2, r2, a2, s2, u2, d2, f2, p2, m2, g2, M2]);
2546
+ let te2 = i(async (e3) => {
2547
+ !r2 && $a(n2) || !Uo(e3) || s2 && e3 < s2 || (j2(), b2((e4) => e4 + 1), v2({ kind: `day`, date: e3 }));
2548
+ }, [n2, r2, s2, j2]), N2 = _2?.date ?? null, ne2 = i(async () => {
2516
2549
  let i2 = !!(t2 || r2);
2517
- if (!r2 && eo(n2) || !e2 || !i2 || !a2) return { outcome: `none` };
2518
- let o2 = O2.current, c2 = ++ee2.current, l2 = ++te2.current, m3 = () => o2 === O2.current && c2 === ee2.current;
2519
- D2(true), T2(null);
2550
+ if (!r2 && $a(n2) || !e2 || !i2 || !a2) return { outcome: `none` };
2551
+ let o2 = O2.current, c2 = ++k2.current, l2 = ++A2.current, m3 = () => o2 === O2.current && c2 === k2.current;
2552
+ ee2(true), E2(null);
2520
2553
  try {
2521
- let e3 = ne2 ?? s2 ?? void 0, i3 = r2 ? await ll({ ...r2, timeZone: a2, fromDate: e3 }) : await bs({ serviceId: t2, serviceType: n2, timeZone: a2, limit: 1, onlyAvailableSlots: true, fromDate: e3, locationId: u2 ?? void 0, staffId: d2 ?? void 0, customerChoices: f2, minRemainingCapacity: p2 });
2554
+ let e3 = N2 ?? s2 ?? void 0, i3 = r2 ? await dl({ ...r2, timeZone: a2, fromDate: e3 }) : await Ss({ serviceId: t2, serviceType: n2, timeZone: a2, limit: 1, onlyAvailableSlots: true, fromDate: e3, locationId: u2 ?? void 0, staffId: d2 ?? void 0, customerChoices: f2, minRemainingCapacity: p2 });
2522
2555
  if (!m3()) return { outcome: `cancelled` };
2523
2556
  let o3 = i3.timeSlots[0]?.localStartDate?.slice(0, 10) ?? null;
2524
2557
  return o3 ? { outcome: `found`, date: o3 } : { outcome: `none` };
2525
2558
  } catch (e3) {
2526
- return m3() ? ($(e3, { feature: Q.timeSlots, action: `find-next-available-date`, level: `warning` }), T2(`timeSlotsLoadFailed`), { outcome: `error` }) : { outcome: `cancelled` };
2559
+ return m3() ? (ko(e3, { feature: $.timeSlots, action: `find-next-available-date`, level: `warning` }), E2(`timeSlotsLoadFailed`), { outcome: `error` }) : { outcome: `cancelled` };
2527
2560
  } finally {
2528
- l2 === te2.current && D2(false);
2561
+ l2 === A2.current && ee2(false);
2529
2562
  }
2530
- }, [e2, t2, n2, r2, a2, s2, u2, d2, f2, p2, ne2]), re2 = w2 ?? S2;
2531
- return { query: g2, selectedDate: ne2, timeSlots: b2?.timeSlots ?? null, timeZone: b2?.timeZone ?? null, isLoading: E2 || g2 !== null && b2 === null && S2 === null, error: re2, selectDate: j2, findNextAvailableDate: M2 };
2563
+ }, [e2, t2, n2, r2, a2, s2, u2, d2, f2, p2, N2]), P2 = T2 ?? C2;
2564
+ return { query: _2, selectedDate: N2, timeSlots: x2?.timeSlots ?? null, timeZone: x2?.timeZone ?? null, isLoading: D2 || _2 !== null && x2 === null && C2 === null, error: P2, selectDate: te2, findNextAvailableDate: ne2 };
2532
2565
  }
2533
- var pl = (e2) => e2?.type === `DATE_TIME`;
2534
- function ml(e2) {
2566
+ var yl = (e2) => e2?.type === `DATE_TIME`;
2567
+ function bl(e2) {
2535
2568
  let t2 = e2.schedule?.availabilityConstraints?.durations;
2536
- if (!Qa(e2.type) || !Array.isArray(t2)) return false;
2569
+ if (!Za(e2.type) || !Array.isArray(t2)) return false;
2537
2570
  let n2 = t2.map((e3) => typeof e3 == `number` ? e3 : e3?.minutes);
2538
2571
  return new Set(n2).size > 1;
2539
2572
  }
2540
- function hl({ service: e2, multiServiceAppointmentsEnabled: t2, variants: n2, locationId: r2 }) {
2541
- if (!Qa(e2.type)) return false;
2542
- if (t2 || ml(e2) || no(e2)) return true;
2543
- if (!to(e2) || pl(n2)) return false;
2544
- let i2 = Ns(e2, r2);
2545
- return r2 && i2 !== r2 ? true : !As(n2, Ms(e2), i2);
2573
+ function xl({ service: e2, multiServiceAppointmentsEnabled: t2, variants: n2, locationId: r2 }) {
2574
+ if (!Za(e2.type)) return false;
2575
+ if (t2 || bl(e2) || to(e2)) return true;
2576
+ if (!eo(e2) || yl(n2)) return false;
2577
+ let i2 = Fs(e2, r2);
2578
+ return r2 && i2 !== r2 ? true : !Ms(n2, Ps(e2), i2);
2546
2579
  }
2547
- function gl(e2, t2) {
2548
- return !!Lr(e2)?.services.some((e3) => e3.serviceId === t2);
2580
+ function Sl(e2, t2) {
2581
+ return !!Ir(e2)?.services.some((e3) => e3.serviceId === t2);
2549
2582
  }
2550
- function _l({ blobParam: e2, ...t2 }) {
2551
- return !t2.service._id || gl(e2, t2.service._id) ? false : hl({ ...t2, multiServiceAppointmentsEnabled: false });
2583
+ function Cl({ blobParam: e2, ...t2 }) {
2584
+ return !t2.service._id || Sl(e2, t2.service._id) ? false : xl({ ...t2, multiServiceAppointmentsEnabled: false });
2552
2585
  }
2553
- function vl(e2) {
2586
+ function wl(e2) {
2554
2587
  return !!e2?._id;
2555
2588
  }
2556
- function yl() {
2589
+ function Tl() {
2557
2590
  try {
2558
2591
  return f();
2559
2592
  } catch {
2560
2593
  return null;
2561
2594
  }
2562
2595
  }
2563
- function bl() {
2564
- let e2 = yl();
2596
+ function El() {
2597
+ let e2 = Tl();
2565
2598
  return i((t2) => {
2566
2599
  if (!e2) return false;
2567
2600
  try {
2568
- let n2 = e2(Br).currentPage;
2601
+ let n2 = e2(zr).currentPage;
2569
2602
  return !n2.popup && (!n2.appDefinitionId || n2.appDefinitionId === `13d21c63-b5ec-5912-8397-c3a5ddb27a97`) && n2.appPageId === t2;
2570
2603
  } catch {
2571
2604
  return false;
2572
2605
  }
2573
2606
  }, [e2]);
2574
2607
  }
2575
- function xl(e2) {
2576
- let { service: t2, isLoading: n2, hasError: r2, bookingsSettingsLoading: i2, isLoadingServiceOptionsAndVariants: a2, pricingOption: s2, multiServiceAppointmentsEnabled: l2, isMultiServiceAppointment: u2, reschedule: f2, selection: p2, isSelectionPending: m2, openPreferences: h2, editingSurface: g2 } = d(), _2 = bl(), v2 = Bc(Fc.PREFERENCES), y2 = c(false), b2 = e2 && !m2 && !g2 && !n2 && !r2 && !i2 && !a2 && f2 == null && !u2 && vl(t2), x2 = p2.locationId ?? void 0, S2 = Ac(m2);
2608
+ function Dl(e2) {
2609
+ let { service: t2, isLoading: n2, hasError: r2, bookingsSettingsLoading: i2, isLoadingServiceOptionsAndVariants: a2, pricingOption: s2, multiServiceAppointmentsEnabled: l2, isMultiServiceAppointment: u2, reschedule: f2, selection: p2, isSelectionPending: m2, openPreferences: h2, editingSurface: g2 } = d(), _2 = El(), v2 = Hc(Lc.PREFERENCES), y2 = c(false), b2 = e2 && !m2 && !g2 && !n2 && !r2 && !i2 && !a2 && f2 == null && !u2 && wl(t2), x2 = p2.locationId ?? void 0, S2 = Mc(m2);
2577
2610
  o(() => {
2578
- !y2.current && b2 && (y2.current = true, _2(Jr.CALENDAR_PAGE) && _l({ service: t2, multiServiceAppointmentsEnabled: l2, variants: s2, locationId: x2, blobParam: S2 }) && (jo({ message: `Calendar opens the preferences modal`, category: `navigation`, feature: Q.timeSlots, data: { serviceId: t2._id ?? null, serviceType: t2.type ?? null } }), v2(Hc({ action: Lc.EDIT_BASKET_ITEM_FROM_CALENDAR, numberOfServices: 1, isMultiFlow: l2 })), h2().then(() => Ao(`Preferences modal opened`, { feature: Q.timeSlots, action: `auto-open-preferences`, tags: { serviceType: t2.type ?? `unknown` } }), (e3) => $(e3, { feature: Q.timeSlots, action: `open-preferences-lightbox` }))));
2611
+ !y2.current && b2 && (y2.current = true, _2(qr.CALENDAR_PAGE) && Cl({ service: t2, multiServiceAppointmentsEnabled: l2, variants: s2, locationId: x2, blobParam: S2 }) && (jo({ message: `Calendar opens the preferences modal`, category: `navigation`, feature: $.timeSlots, data: { serviceId: t2._id ?? null, serviceType: t2.type ?? null } }), v2(Wc({ action: zc.EDIT_BASKET_ITEM_FROM_CALENDAR, numberOfServices: 1, isMultiFlow: l2 })), h2().then(() => Ao(`Preferences modal opened`, { feature: $.timeSlots, action: `auto-open-preferences`, tags: { serviceType: t2.type ?? `unknown` } }), (e3) => ko(e3, { feature: $.timeSlots, action: `open-preferences-lightbox` }))));
2579
2612
  }, [b2, t2, l2, s2, x2, S2, _2, v2, h2]);
2580
2613
  }
2581
- function Sl(e2, t2) {
2614
+ function Ol(e2, t2) {
2582
2615
  return t2 === void 0 ? false : !e2 || new Date(e2).getTime() <= t2;
2583
2616
  }
2584
- var Cl = 864e5;
2585
- function wl({ serviceId: e2, serviceType: t2, lastSessionEnd: n2, timeZone: r2, now: i2, onlyAvailableSlots: a2, locationId: o2, staffId: s2, timeSlotLimitPerDay: c2, customerChoices: l2, minRemainingCapacity: u2 }) {
2586
- let d2 = { serviceId: e2, onlyAvailableSlots: a2, locationId: o2 ?? void 0, staffId: s2 ?? void 0, timeZone: r2, fromLocalDate: Lo(new Date(i2), r2) };
2587
- return $a(t2) ? { ...d2, serviceType: `CLASS`, minRemainingCapacity: u2 } : eo(t2) ? !n2 || Sl(n2, i2) ? void 0 : { ...d2, serviceType: `COURSE`, toLocalDate: Lo(new Date(new Date(n2).getTime() + Cl), r2) } : { ...d2, serviceType: `APPOINTMENT`, toLocalDate: ys().toLocalDate, timeSlotsPerDay: c2 + 1, customerChoices: l2 };
2617
+ var kl = 864e5;
2618
+ function Al({ serviceId: e2, serviceType: t2, lastSessionEnd: n2, timeZone: r2, now: i2, onlyAvailableSlots: a2, locationId: o2, staffId: s2, timeSlotLimitPerDay: c2, customerChoices: l2, minRemainingCapacity: u2 }) {
2619
+ let d2 = { serviceId: e2, onlyAvailableSlots: a2, locationId: o2 ?? void 0, staffId: s2 ?? void 0, timeZone: r2, fromLocalDate: zo(new Date(i2), r2) };
2620
+ return Qa(t2) ? { ...d2, serviceType: `CLASS`, minRemainingCapacity: u2 } : $a(t2) ? !n2 || Ol(n2, i2) ? void 0 : { ...d2, serviceType: `COURSE`, toLocalDate: zo(new Date(new Date(n2).getTime() + kl), r2) } : { ...d2, serviceType: `APPOINTMENT`, toLocalDate: xs().toLocalDate, timeSlotsPerDay: c2 + 1, customerChoices: l2 };
2588
2621
  }
2589
- function Tl({ isAppointment: e2, staffOnSlotCount: t2, hasStaffFilter: n2, hasRequestedGender: r2, hasStaffPricedVariants: i2, staffSelectionStrategy: a2 }) {
2622
+ function jl({ isAppointment: e2, staffOnSlotCount: t2, hasStaffFilter: n2, hasRequestedGender: r2, hasStaffPricedVariants: i2, staffSelectionStrategy: a2 }) {
2590
2623
  return e2 && t2 > 1 && !n2 && !i2 && (a2 !== `CUSTOMER_MUST_CHOOSE` || r2);
2591
2624
  }
2592
- function El(e2, t2) {
2625
+ function Ml(e2, t2) {
2593
2626
  return e2.length ? e2.length === 1 ? { anyResource: false, staffMemberId: e2[0] } : t2 ? { anyResource: true } : null : null;
2594
2627
  }
2595
- function Dl(e2, t2, n2) {
2628
+ function Nl(e2, t2, n2) {
2596
2629
  return t2 && !t2.anyResource && e2.includes(t2.staffMemberId) ? { isComplete: true, resourceId: t2.staffMemberId } : t2?.anyResource && n2 ? { isComplete: true, resourceId: void 0 } : e2.length <= 1 ? { isComplete: true, resourceId: e2[0] } : { isComplete: n2, resourceId: void 0 };
2597
2630
  }
2598
- var Ol = { staff: null, requestedGender: null, locationId: null };
2599
- function kl({ entry: e2, appointmentLike: t2, staffChoiceHidden: n2, staffPriced: r2, staffSelectionStrategy: i2, genderAllowed: a2, staffMemberIds: o2, locationIds: s2 }) {
2600
- if (!e2) return Ol;
2601
- let c2 = e2.locationId && s2.includes(e2.locationId) ? e2.locationId : null, l2 = t2 && !n2 ? uo(e2) : null;
2602
- if (!l2) return { ...Ol, locationId: c2 };
2603
- if (!l2.anyResource) return o2.includes(l2.staffMemberId) ? { staff: l2, requestedGender: null, locationId: c2 } : { ...Ol, locationId: c2 };
2631
+ var Pl = { staff: null, requestedGender: null, locationId: null };
2632
+ function Fl({ entry: e2, appointmentLike: t2, staffChoiceHidden: n2, staffPriced: r2, staffSelectionStrategy: i2, genderAllowed: a2, staffMemberIds: o2, locationIds: s2 }) {
2633
+ if (!e2) return Pl;
2634
+ let c2 = e2.locationId && s2.includes(e2.locationId) ? e2.locationId : null, l2 = t2 && !n2 ? lo(e2) : null;
2635
+ if (!l2) return { ...Pl, locationId: c2 };
2636
+ if (!l2.anyResource) return o2.includes(l2.staffMemberId) ? { staff: l2, requestedGender: null, locationId: c2 } : { ...Pl, locationId: c2 };
2604
2637
  let u2 = a2 ? e2.requestedGender ?? null : null;
2605
- return o2.length > 1 && !r2 && (i2 !== `CUSTOMER_MUST_CHOOSE` || u2 !== null) ? { staff: l2, requestedGender: u2, locationId: c2 } : { ...Ol, locationId: c2 };
2638
+ return o2.length > 1 && !r2 && (i2 !== `CUSTOMER_MUST_CHOOSE` || u2 !== null) ? { staff: l2, requestedGender: u2, locationId: c2 } : { ...Pl, locationId: c2 };
2606
2639
  }
2607
- var Al = [];
2608
- function jl({ sessions: e2, dayQuery: t2, daySlots: n2, staffFilter: r2, appointmentLike: i2, limitPerDay: a2, expandedDates: o2 }) {
2609
- let s2 = Bl(Vl(e2, r2)), c2 = n2 ? Vl(i2 ? es(n2) : n2, r2) : Al;
2610
- return { rows: t2 ? c2 : Hl(s2, a2, o2), slotIdOf: t2 ? Zo : $o, daysWithMore: zl(s2, a2, o2) };
2640
+ var Il = [];
2641
+ function Ll({ sessions: e2, dayQuery: t2, daySlots: n2, staffFilter: r2, appointmentLike: i2, limitPerDay: a2, expandedDates: o2 }) {
2642
+ let s2 = Kl(ql(e2, r2)), c2 = n2 ? ql(i2 ? ns(n2) : n2, r2) : Il;
2643
+ return { rows: t2 ? c2 : Jl(s2, a2, o2), slotIdOf: t2 ? $o : ts, daysWithMore: Gl(s2, a2, o2) };
2611
2644
  }
2612
- function Ml({ rows: e2, slotIdOf: t2 }, n2) {
2613
- return [...e2.filter((e3) => t2(e3) === n2)].sort((e3, t3) => Rl(t3) - Rl(e3))[0] ?? null;
2645
+ function Rl({ rows: e2, slotIdOf: t2 }, n2) {
2646
+ return [...e2.filter((e3) => t2(e3) === n2)].sort((e3, t3) => Wl(t3) - Wl(e3))[0] ?? null;
2614
2647
  }
2615
- function Nl(e2, t2, n2, r2) {
2616
- return { slotId: n2(e2), slotStartTime: e2.localStartDate ?? null, slotEndTime: e2.localEndDate ?? null, bookable: e2.bookable ?? false, tooEarlyToBook: e2.bookingPolicyViolations?.tooEarlyToBook ?? false, tooLateToBook: e2.bookingPolicyViolations?.tooLateToBook ?? false, totalCapacity: e2.totalCapacity ?? null, remainingCapacity: e2.remainingCapacity ?? null, bookableCapacity: e2.bookableCapacity ?? null, eventId: e2.eventInfo?.eventId ?? null, eventTitle: e2.eventInfo?.eventTitle ?? null, waitlistCapacity: e2.eventInfo?.waitingList?.remainingCapacity ?? null, locationId: e2.location?._id ?? null, locationName: e2.location?.name || e2.location?.formattedAddress || null, durationMinutes: Ll(e2, t2), isAllDay: e2.allDay ?? false, staff: r2 ? [] : Pl(e2) };
2648
+ function zl(e2, t2, n2, r2) {
2649
+ return { slotId: n2(e2), slotStartTime: e2.localStartDate ?? null, slotEndTime: e2.localEndDate ?? null, bookable: e2.bookable ?? false, tooEarlyToBook: e2.bookingPolicyViolations?.tooEarlyToBook ?? false, tooLateToBook: e2.bookingPolicyViolations?.tooLateToBook ?? false, totalCapacity: e2.totalCapacity ?? null, remainingCapacity: e2.remainingCapacity ?? null, bookableCapacity: e2.bookableCapacity ?? null, eventId: e2.eventInfo?.eventId ?? null, eventTitle: e2.eventInfo?.eventTitle ?? null, waitlistCapacity: e2.eventInfo?.waitingList?.remainingCapacity ?? null, locationId: e2.location?._id ?? null, locationName: e2.location?.name || e2.location?.formattedAddress || null, durationMinutes: Ul(e2, t2), isAllDay: e2.allDay ?? false, staff: r2 ? [] : Bl(e2) };
2617
2650
  }
2618
- function Pl(e2) {
2651
+ function Bl(e2) {
2619
2652
  let t2 = /* @__PURE__ */ new Map();
2620
2653
  for (let n2 of e2.availableResources ?? []) if (n2.resourceTypeId === `1cd44cf8-756f-41c3-bd90-3e2ffcaf1155`) for (let e3 of n2.resources ?? []) e3._id && !t2.has(e3._id) && t2.set(e3._id, e3.name ?? ``);
2621
2654
  return [...t2].map(([e3, t3]) => ({ staffMemberId: e3, name: t3 }));
2622
2655
  }
2623
- function Fl(e2) {
2624
- let t2 = Pl(e2);
2656
+ function Vl(e2) {
2657
+ let t2 = Bl(e2);
2625
2658
  if (t2.length) return t2.length === 1 ? t2[0].staffMemberId : null;
2626
2659
  }
2627
- function Il(e2) {
2628
- return Pl(e2).map((e3) => e3.staffMemberId);
2660
+ function Hl(e2) {
2661
+ return Bl(e2).map((e3) => e3.staffMemberId);
2629
2662
  }
2630
- function Ll(e2, t2) {
2663
+ function Ul(e2, t2) {
2631
2664
  if (!e2.localStartDate || !e2.localEndDate) return null;
2632
- let n2 = e2.allDay ? `UTC` : t2 ?? `UTC`, r2 = Gc(e2.localStartDate, n2), i2 = Gc(e2.localEndDate, n2);
2665
+ let n2 = e2.allDay ? `UTC` : t2 ?? `UTC`, r2 = qc(e2.localStartDate, n2), i2 = qc(e2.localEndDate, n2);
2633
2666
  return !r2 || !i2 || i2 < r2 ? null : Math.round((i2.getTime() - r2.getTime()) / 6e4);
2634
2667
  }
2635
- function Rl(e2) {
2668
+ function Wl(e2) {
2636
2669
  let t2 = e2.bookableCapacity ?? e2.remainingCapacity;
2637
2670
  return (e2.eventInfo?.waitingList?.remainingCapacity ?? 0) > 0 && (t2 ?? 0) <= 0 ? 1 : e2.bookable ? 2 : 0;
2638
2671
  }
2639
- function zl(e2, t2, n2) {
2672
+ function Gl(e2, t2, n2) {
2640
2673
  let r2 = /* @__PURE__ */ new Map();
2641
2674
  for (let t3 of e2) {
2642
2675
  let e3 = (t3.localStartDate ?? ``).slice(0, 10);
@@ -2644,16 +2677,16 @@ function zl(e2, t2, n2) {
2644
2677
  }
2645
2678
  return new Set([...r2].filter(([e3, r3]) => r3 > t2 && !n2.has(e3)).map(([e3]) => e3));
2646
2679
  }
2647
- function Bl(e2) {
2680
+ function Kl(e2) {
2648
2681
  return e2.flatMap((e3) => {
2649
- let t2 = e3.availableResources?.find((e4) => e4.resourceTypeId === qr), n2 = t2?.resources ?? [];
2682
+ let t2 = e3.availableResources?.find((e4) => e4.resourceTypeId === Kr), n2 = t2?.resources ?? [];
2650
2683
  return n2.length <= 1 ? [e3] : n2.map((n3) => ({ ...e3, availableResources: [{ ...t2, resources: [n3] }] }));
2651
2684
  });
2652
2685
  }
2653
- function Vl(e2, t2) {
2686
+ function ql(e2, t2) {
2654
2687
  return t2 ? e2.map((e3) => ({ ...e3, availableResources: e3.availableResources?.map((e4) => e4.resourceTypeId === `1cd44cf8-756f-41c3-bd90-3e2ffcaf1155` ? { ...e4, resources: e4.resources?.filter((e5) => e5._id === t2) } : e4) })) : e2;
2655
2688
  }
2656
- function Hl(e2, t2, n2) {
2689
+ function Jl(e2, t2, n2) {
2657
2690
  let r2 = /* @__PURE__ */ new Map();
2658
2691
  return e2.filter((e3) => {
2659
2692
  let i2 = (e3.localStartDate ?? ``).slice(0, 10);
@@ -2662,24 +2695,24 @@ function Hl(e2, t2, n2) {
2662
2695
  return r2.set(i2, a2 + 1), a2 < t2;
2663
2696
  });
2664
2697
  }
2665
- async function Ul() {
2698
+ async function Yl() {
2666
2699
  try {
2667
- return await Xo();
2700
+ return await Qo();
2668
2701
  } catch (e2) {
2669
- return $(e2, { feature: Q.timeSlots, action: `fetch-business-time-zone`, level: `warning` }), { businessTimeZone: null, staffSelectionStrategy: void 0, allowGenderSelection: false };
2702
+ return ko(e2, { feature: $.timeSlots, action: `fetch-business-time-zone`, level: `warning` }), { businessTimeZone: null, staffSelectionStrategy: void 0, allowGenderSelection: false };
2670
2703
  }
2671
2704
  }
2672
- function Wl(e2) {
2673
- return tc({ key: Ws(), warmupData: e2, fetchData: Ul });
2705
+ function Xl(e2) {
2706
+ return rc({ key: Ks(), warmupData: e2, fetchData: Yl });
2674
2707
  }
2675
- function Gl(e2) {
2708
+ function Zl(e2) {
2676
2709
  return (e2.localStartDate ?? ``).slice(0, 10);
2677
2710
  }
2678
- var Kl = [];
2679
- function ql(e2, t2) {
2680
- let { serviceId: n2 = ``, serviceType: r2 = `CLASS`, fromLocalDate: i2 = ``, toLocalDate: a2, timeZone: s2, locationId: u2, staffId: d2, onlyAvailableSlots: f2 = false, customerChoices: p2, minRemainingCapacity: m2, timeSlotsPerDay: h2 } = t2 ?? {}, [g2, _2] = l([]), [v2, y2] = l([]), [b2, x2] = l(1), [S2, C2] = l(!!n2), [w2, T2] = l(null), [E2, D2] = l(null), [O2, ee2] = l(/* @__PURE__ */ new Set()), [te2, k2] = l(null), A2 = c(null), j2 = c(null);
2711
+ var Ql = [];
2712
+ function $l(e2, t2) {
2713
+ let { serviceId: n2 = ``, serviceType: r2 = `CLASS`, fromLocalDate: i2 = ``, toLocalDate: a2, timeZone: s2, locationId: u2, staffId: d2, onlyAvailableSlots: f2 = false, customerChoices: p2, minRemainingCapacity: m2, timeSlotsPerDay: h2 } = t2 ?? {}, [g2, _2] = l([]), [v2, y2] = l([]), [b2, x2] = l(1), [S2, C2] = l(!!n2), [w2, T2] = l(null), [E2, D2] = l(null), [ee2, O2] = l(/* @__PURE__ */ new Set()), [k2, A2] = l(null), j2 = c(null), M2 = c(null);
2681
2714
  o(() => {
2682
- if (_2([]), y2([]), x2(1), D2(null), T2(null), ee2(/* @__PURE__ */ new Set()), k2(null), C2(!!n2), !n2) return;
2715
+ if (_2([]), y2([]), x2(1), D2(null), T2(null), O2(/* @__PURE__ */ new Set()), A2(null), C2(!!n2), !n2) return;
2683
2716
  let t3 = false, o2 = false, c2 = [], l2 = [];
2684
2717
  async function g3(g4) {
2685
2718
  if (t3 || o2) return;
@@ -2694,7 +2727,7 @@ function ql(e2, t2) {
2694
2727
  let o3 = [], b3 = null, S3 = v4 ?? void 0, C3 = /* @__PURE__ */ new Set();
2695
2728
  do {
2696
2729
  S3 && C3.add(S3);
2697
- let c3 = await hs({ serviceId: n2, serviceType: r2, fromLocalDate: i2, toLocalDate: a2, timeZone: s2, locationId: u2, staffId: d2, onlyAvailableSlots: f2, customerChoices: p2, minRemainingCapacity: m2, timeSlotsPerDay: h2, limit: e2, cursor: S3 });
2730
+ let c3 = await _s({ serviceId: n2, serviceType: r2, fromLocalDate: i2, toLocalDate: a2, timeZone: s2, locationId: u2, staffId: d2, onlyAvailableSlots: f2, customerChoices: p2, minRemainingCapacity: m2, timeSlotsPerDay: h2, limit: e2, cursor: S3 });
2698
2731
  if (t3) return;
2699
2732
  if (o3.push(...c3.timeSlots), b3 = c3.nextCursor, b3 && C3.has(b3)) throw Error(`The session API repeated a page cursor`);
2700
2733
  S3 = b3 ?? void 0, D2(c3.timeZone ?? s2 ?? null);
@@ -2702,7 +2735,7 @@ function ql(e2, t2) {
2702
2735
  c2 = [...c2, o3], l2 = [...l2, b3], _2(c2), y2(l2), (g4 === 1 || o3.length > 0) && x2(g4);
2703
2736
  } catch (e3) {
2704
2737
  if (t3) return;
2705
- $(e3, { feature: Q.sessions, action: `fetch-page` }), T2(e3 instanceof Error ? e3.message : `Failed to load sessions`);
2738
+ ko(e3, { feature: $.sessions, action: `fetch-page` }), T2(e3 instanceof Error ? e3.message : `Failed to load sessions`);
2706
2739
  } finally {
2707
2740
  o2 = false, t3 || C2(false);
2708
2741
  }
@@ -2711,210 +2744,210 @@ function ql(e2, t2) {
2711
2744
  async function v3(e3) {
2712
2745
  if (!(t3 || o2)) {
2713
2746
  if (h2 == null) {
2714
- ee2((t4) => /* @__PURE__ */ new Set([...t4, e3]));
2747
+ O2((t4) => /* @__PURE__ */ new Set([...t4, e3]));
2715
2748
  return;
2716
2749
  }
2717
- o2 = true, k2(e3), T2(null);
2750
+ o2 = true, A2(e3), T2(null);
2718
2751
  try {
2719
- let o3 = await Ss({ serviceId: n2, serviceType: r2, date: e3, timeZone: s2, onlyAvailableSlots: f2, locationId: u2, staffId: d2, customerChoices: p2, minRemainingCapacity: m2, fromLocalDate: i2, toLocalDate: a2 });
2752
+ let o3 = await ws({ serviceId: n2, serviceType: r2, date: e3, timeZone: s2, onlyAvailableSlots: f2, locationId: u2, staffId: d2, customerChoices: p2, minRemainingCapacity: m2, fromLocalDate: i2, toLocalDate: a2 });
2720
2753
  if (t3) return;
2721
- let l3 = o3.timeSlots.filter((t4) => Gl(t4) === e3), h3 = Math.max(0, c2.findIndex((t4) => t4.some((t5) => Gl(t5) === e3)));
2754
+ let l3 = o3.timeSlots.filter((t4) => Zl(t4) === e3), h3 = Math.max(0, c2.findIndex((t4) => t4.some((t5) => Zl(t5) === e3)));
2722
2755
  c2 = c2.map((t4, n3) => {
2723
- let r3 = t4.filter((t5) => Gl(t5) !== e3);
2756
+ let r3 = t4.filter((t5) => Zl(t5) !== e3);
2724
2757
  return n3 === h3 ? [...r3, ...l3] : r3;
2725
- }), _2(c2), ee2((t4) => /* @__PURE__ */ new Set([...t4, e3]));
2758
+ }), _2(c2), O2((t4) => /* @__PURE__ */ new Set([...t4, e3]));
2726
2759
  } catch (e4) {
2727
2760
  if (t3) return;
2728
- $(e4, { feature: Q.sessions, action: `fetch-day` }), T2(e4 instanceof Error ? e4.message : `Failed to load sessions`);
2761
+ ko(e4, { feature: $.sessions, action: `fetch-day` }), T2(e4 instanceof Error ? e4.message : `Failed to load sessions`);
2729
2762
  } finally {
2730
- o2 = false, t3 || k2(null);
2763
+ o2 = false, t3 || A2(null);
2731
2764
  }
2732
2765
  }
2733
2766
  }
2734
- return A2.current = g3, j2.current = v3, g3(1), () => {
2735
- t3 = true, A2.current = null, j2.current = null;
2767
+ return j2.current = g3, M2.current = v3, g3(1), () => {
2768
+ t3 = true, j2.current = null, M2.current = null;
2736
2769
  };
2737
2770
  }, [n2, r2, i2, a2, s2, u2, d2, f2, p2, m2, h2, e2]);
2738
- let ne2 = [...g2[b2 - 1] ?? Kl].sort((e3, t3) => (e3.localStartDate ?? ``).localeCompare(t3.localStartDate ?? ``)), M2 = g2[b2], re2 = M2 ? M2.length > 0 : v2[b2 - 1] != null, N2 = b2 > 1;
2739
- async function ie2() {
2740
- re2 && !S2 && await A2.current?.(b2 + 1);
2771
+ let te2 = [...g2[b2 - 1] ?? Ql].sort((e3, t3) => (e3.localStartDate ?? ``).localeCompare(t3.localStartDate ?? ``)), N2 = g2[b2], ne2 = N2 ? N2.length > 0 : v2[b2 - 1] != null, P2 = b2 > 1;
2772
+ async function re2() {
2773
+ ne2 && !S2 && await j2.current?.(b2 + 1);
2741
2774
  }
2742
- function ae2() {
2743
- N2 && !S2 && A2.current?.(b2 - 1);
2775
+ function ie2() {
2776
+ P2 && !S2 && j2.current?.(b2 - 1);
2744
2777
  }
2745
- async function oe2(e3) {
2746
- S2 || te2 !== null || O2.has(e3) || await j2.current?.(e3);
2778
+ async function ae2(e3) {
2779
+ S2 || k2 !== null || ee2.has(e3) || await M2.current?.(e3);
2747
2780
  }
2748
- return { isLoadingPage: S2, firstPageSettled: g2.length > 0 || w2 !== null, error: w2, timeZone: E2, sessions: ne2, pageSize: e2, currentPage: b2, hasNextPage: re2, hasPreviousPage: N2, nextPage: ie2, previousPage: ae2, expandedDates: O2, loadingDate: te2, loadAllSessionsForDay: oe2 };
2781
+ return { isLoadingPage: S2, firstPageSettled: g2.length > 0 || w2 !== null, error: w2, timeZone: E2, sessions: te2, pageSize: e2, currentPage: b2, hasNextPage: ne2, hasPreviousPage: P2, nextPage: re2, previousPage: ie2, expandedDates: ee2, loadingDate: k2, loadAllSessionsForDay: ae2 };
2749
2782
  }
2750
- var Jl = (e2) => e2?.onlineBooking?.enabled === true;
2751
- function Yl(e2, t2) {
2783
+ var eu = (e2) => e2?.onlineBooking?.enabled === true;
2784
+ function tu(e2, t2) {
2752
2785
  return e2 ? e2.anyResource ? t2 ?? `` : e2.staffMemberId : null;
2753
2786
  }
2754
- var Xl = [];
2755
- var Zl = [];
2756
- var Ql = dn.map((e2) => ({ id: e2, gender: e2 }));
2757
- var $l = () => {
2787
+ var nu = [];
2788
+ var ru = [];
2789
+ var iu = un.map((e2) => ({ id: e2, gender: e2 }));
2790
+ var au = () => {
2758
2791
  };
2759
- var eu = async () => {
2792
+ var ou = async () => {
2760
2793
  };
2761
- var tu = n(null);
2762
- function nu() {
2763
- let e2 = a(tu);
2794
+ var su = n(null);
2795
+ function cu() {
2796
+ let e2 = a(su);
2764
2797
  if (!e2) throw Error(`useTimeSlotsContext must be used within TimeSlotsContextProvider`);
2765
2798
  return e2;
2766
2799
  }
2767
- function ru(e2, t2, n2) {
2800
+ function lu(e2, t2, n2) {
2768
2801
  e2 ? t2() : n2();
2769
2802
  }
2770
- var iu = { loginRequired: `rescheduleLoginRequired`, notFound: `rescheduleNotFound`, accessDenied: `rescheduleAccessDenied`, failed: `rescheduleNotFound`, wrongService: `rescheduleNotFound`, notReschedulable: `rescheduleNotReschedulable` };
2771
- function au(e2 = 3) {
2772
- return Math.min(Math.max(e2, 1), fc);
2803
+ var uu = { loginRequired: `rescheduleLoginRequired`, notFound: `rescheduleNotFound`, accessDenied: `rescheduleAccessDenied`, failed: `rescheduleNotFound`, wrongService: `rescheduleNotFound`, notReschedulable: `rescheduleNotReschedulable` };
2804
+ function du(e2 = 3) {
2805
+ return Math.min(Math.max(e2, 1), mc);
2773
2806
  }
2774
- function ou(e2) {
2807
+ function fu(e2) {
2775
2808
  let { isLoading: n2, bookingsSettingsLoading: r2 } = d();
2776
- Vc(Fc.TIME_SLOTS, !n2 && !r2);
2777
- let i2 = Vs(), [a2] = l(() => Wl(i2));
2778
- return m(dc, { children: m(t, { fallback: m(Jc, { nextAvailableSlotsCount: au(e2.nextAvailableSlotsCount), children: e2.children }), children: m(cu, { ...e2, configurationPromise: a2 }) }) });
2809
+ Uc(Lc.TIME_SLOTS, !n2 && !r2);
2810
+ let i2 = Us(), [a2] = l(() => Xl(i2));
2811
+ return m(pc, { children: m(t, { fallback: m(Xc, { nextAvailableSlotsCount: du(e2.nextAvailableSlotsCount), children: e2.children }), children: m(mu, { ...e2, configurationPromise: a2 }) }) });
2779
2812
  }
2780
- function su(e2) {
2813
+ function pu(e2) {
2781
2814
  let [t2, n2] = l({ serviceId: e2, key: 0 });
2782
2815
  return e2 !== t2.serviceId && n2({ serviceId: e2, key: t2.serviceId ? t2.key + 1 : t2.key }), t2.key;
2783
2816
  }
2784
- function cu({ onlyAvailableSlots: e2 = true, nextAvailableSlotsCount: t2 = 3, loadDaysAvailabilityInitially: n2 = false, timeSlotLimitPerDay: r2 = 100, configurationPromise: i2, children: a2 }) {
2785
- let s2 = sc().isLoading, { searchParams: c2 } = Cc(), { reschedule: f2, isSelectionPending: p2 } = d(), [h2] = l(() => ({ locationId: c2.get(ro.location), staffId: c2.get(ro.resource), timeZone: c2.get(ro.timezone) })), g2 = Ac(p2), _2 = () => (f2 ? null : Lr(g2)?.timezone) ?? null, [v2, y2] = l(() => _2() ?? h2.timeZone), [b2, x2] = l(p2);
2817
+ function mu({ onlyAvailableSlots: e2 = true, nextAvailableSlotsCount: t2 = 3, loadDaysAvailabilityInitially: n2 = false, timeSlotLimitPerDay: r2 = 100, configurationPromise: i2, children: a2 }) {
2818
+ let s2 = lc().isLoading, { searchParams: c2 } = Tc(), { reschedule: f2, isSelectionPending: p2 } = d(), [h2] = l(() => ({ locationId: c2.get(no.location), staffId: c2.get(no.resource), timeZone: c2.get(no.timezone) })), g2 = Mc(p2), _2 = () => (f2 ? null : Ir(g2)?.timezone) ?? null, [v2, y2] = l(() => _2() ?? h2.timeZone), [b2, x2] = l(p2);
2786
2819
  if (b2 && !p2) {
2787
2820
  x2(false);
2788
2821
  let e3 = _2();
2789
2822
  e3 && y2(e3);
2790
2823
  }
2791
- let S2 = au(t2), [C2, w2] = l(false);
2824
+ let S2 = du(t2), [C2, w2] = l(false);
2792
2825
  o(() => w2(true), []);
2793
2826
  let T2 = C2 && !s2 && !p2;
2794
- xl(T2);
2795
- let E2 = Is(i2), D2 = u(us, ls, () => false), { serviceId: O2 } = d(), ee2 = su(O2), te2 = Number.isFinite(r2) ? Math.max(1, Math.floor(r2)) : 100;
2796
- return m(pc, { fallback: m(Yc, { nextAvailableSlotsCount: S2, children: a2 }), feature: Q.timeSlots, children: m(lu, { onlyAvailableSlots: e2, selectedTimeZone: v2, setSelectedTimeZone: y2, enabled: T2, nextAvailableSlotsCount: S2, loadDaysAvailabilityInitially: n2, timeSlotLimitPerDay: te2, landingLocationId: h2.locationId, landingStaffId: h2.staffId, businessTimeZone: E2.businessTimeZone, staffSelectionStrategy: E2.staffSelectionStrategy, allowGenderSelection: E2.allowGenderSelection, requestedGenderRejected: D2, children: a2 }) }, ee2);
2797
- }
2798
- function lu({ onlyAvailableSlots: e2, selectedTimeZone: t2, setSelectedTimeZone: n2, enabled: r2, nextAvailableSlotsCount: a2, loadDaysAvailabilityInitially: u2, timeSlotLimitPerDay: f2, landingLocationId: p2, landingStaffId: h2, businessTimeZone: g2, staffSelectionStrategy: _2, allowGenderSelection: v2, requestedGenderRejected: y2, children: b2 }) {
2799
- let { service: x2, serviceId: S2, serviceType: C2, setSlot: w2, clearSlot: T2, setMultiServiceSlot: E2, clearMultiServiceSlot: D2, draftRevision: O2, navigateToMultiServiceForm: ee2, selection: te2, selectStaffMember: k2, clearSelection: A2, clearStaffMember: j2, withSelectionParam: ne2, staffMembers: M2, serviceOptionsAndVariants: re2, isLoading: N2, hasError: ie2, multiServiceAppointmentServices: ae2 = Zl, reschedule: oe2, isSelectionPending: se2 } = d(), P2 = oe2 != null, ce2 = P2 && oe2.status !== `ready`, le2 = P2 && oe2.status === `loading`, ue2 = P2 ? iu[oe2.status] : void 0, de2 = ce2 ? null : oe2?.booking ?? null, fe2 = de2 ? oe2.validUntil : null, pe2 = vl(x2) && !Jl(x2), F2 = pe2 || ce2 ? null : S2, me2 = Ac(se2), he2 = P2 ? null : me2, ge2 = !P2 && se2, _e2 = s(() => co(Lr(he2)), [he2]), I2 = !S2 && !N2 && !ie2 && (_e2.valid || _e2.reason !== `too-few-services`), ve2 = I2 && _e2.valid && ae2.some((e3) => !Jl(e3) && _e2.services.some((t3) => t3.serviceId === e3._id)), ye2 = pe2 || ve2, be2 = I2 && _e2.valid && !ve2 ? _e2.requestKey : null, xe2 = s(() => be2 && _e2.valid ? { services: _e2.services, locationId: _e2.locationId, locationType: _e2.locationType } : null, [be2]), Se2 = !!F2 || xe2 !== null, Ce2 = F2 || be2, we2 = r2 && !N2 && !ie2 && !Se2 && !le2, Te2 = lc(), Ee2 = sc(), { navigate: De2, resolvePath: Oe2 } = bo(), [ke2, Ae2] = l(null), [je2, Me2] = l(false), Ne2 = c([]), Pe2 = c(false), Fe2 = i(() => (Me2(true), Pe2.current ? Promise.resolve() : new Promise((e3) => {
2800
- Ne2.current.push(e3);
2801
- })), []), Ie2 = r2 ? Intl.DateTimeFormat().resolvedOptions().timeZone : null, Le2 = Za(x2), Re2 = c(null), ze2 = uo(te2), Be2 = c(ze2);
2802
- Be2.current = ze2;
2803
- let Ve2 = ze2 && !ze2.anyResource ? ze2.staffMemberId : null, He2 = te2.requestedGender ?? null, L2 = !$a(C2) && !eo(C2), Ue2 = L2 && !I2 && ws(re2), R2 = I2 || L2 && _2 === `CUSTOMER_CANNOT_CHOOSE`, We2 = _2 !== void 0, Ge2 = Yo({ allowGenderSelection: v2, staffSelectionStrategy: _2 ?? null }) && L2 && !I2 && !Ue2, Ke2 = Ge2 && !y2, qe2 = s(() => F2 ? Lr(he2)?.services.find((e3) => e3.serviceId === F2) ?? null : null, [he2, F2]), Je2 = (M2 ?? []).map((e3) => e3.staffMemberId).join(`,`), Ye2 = Le2.map((e3) => e3.id).join(`,`), Xe2 = s(() => kl({ entry: qe2, appointmentLike: L2, staffChoiceHidden: R2, staffPriced: Ue2, staffSelectionStrategy: _2, genderAllowed: Ke2, staffMemberIds: Je2.split(`,`), locationIds: Ye2.split(`,`) }), [qe2, L2, R2, Ue2, _2, Ke2, Je2, Ye2]), z2 = Xe2.staff, Ze2 = Xe2.locationId, Qe2 = R2 || z2 !== null, [$e2, et2] = l(null), [tt2, nt2] = l(p2 !== null || P2), rt2 = s(() => x2 ? Ms(x2) : [], [x2]), it2 = z2 && !z2.anyResource ? z2.staffMemberId : null, at2 = s(() => {
2804
- if (!it2) return rt2;
2805
- let e3 = rt2.find((e4) => e4.staffMemberId === it2);
2806
- return e3 ? [e3] : rt2;
2807
- }, [rt2, it2]), ot2 = de2?.locationId ?? null, st2 = s(() => {
2808
- let e3 = js(Le2, at2);
2809
- return !ot2 || e3.some((e4) => e4.id === ot2) ? e3 : Le2.filter((t3) => t3.id === ot2 || e3.some((e4) => e4.id === t3.id));
2810
- }, [x2, at2, ot2]), ct2 = (e3) => !!e3 && st2.some((t3) => t3.id === e3), lt2 = $e2 ?? (tt2 ? ct2(ot2) ? ot2 : p2 : null), ut2 = Le2.length > 1 && st2.length === 1 ? st2[0].id : null, B2 = Ze2 ?? (ct2(lt2) ? lt2 : ut2), dt2 = s(() => Ze2 ? [] : st2.map((e3) => ({ id: e3.id, name: e3.label })), [st2, Ze2]), ft2 = s(() => new Map(rt2.map((e3) => [e3.staffMemberId, e3.locationCoverage])), [rt2]), pt2 = i((e3, t3) => Os([{ staffMemberId: e3, locationCoverage: ft2.get(e3) }], t3).length === 1, [ft2]), mt2 = s(() => Qe2 ? [] : (M2 ?? []).filter((e3) => e3.name).map((e3) => ({ id: e3.staffMemberId, name: e3.name ?? ``, gender: null })), [M2, Qe2]), ht2 = s(() => B2 ? mt2.filter((e3) => pt2(e3.id, B2)) : mt2, [mt2, B2, pt2]), gt2 = L2 && !We2 ? Xl : ht2, _t2 = L2 && !We2 ? 0 : mt2.length, vt2 = Ke2 && _t2 > 1, yt2 = s(() => vt2 ? [...Ql, ...gt2] : gt2, [vt2, gt2]), [bt2, xt2] = l(null), [St2, Ct2] = l(h2 !== null);
2811
- St2 && h2 !== null && B2 !== null && !pt2(h2, B2) && Ct2(false);
2812
- let wt2 = bt2 ?? (St2 ? h2 : null), V2 = z2 ? z2.anyResource ? null : z2.staffMemberId : wt2 !== null && ht2.some((e3) => e3.id === wt2) ? wt2 : null, Tt2 = ze2?.anyResource ? He2 : null, [Et2, Dt2] = l(Tt2), [Ot2, kt2] = l(Tt2);
2813
- !y2 && ze2?.anyResource && He2 !== Ot2 && (kt2(He2), Dt2(He2));
2814
- let At2 = z2 ? Xe2.requestedGender : Ge2 && _t2 > 1 && V2 === null ? Et2 : null, jt2 = y2 ? null : At2, Mt2 = i((e3) => {
2815
- Be2.current = e3, e3 ? e3.anyResource ? A2(jt2 ?? void 0) : k2(e3.staffMemberId) : j2();
2816
- }, [j2, A2, k2, jt2]), Nt2 = i((e3) => Mt2(e3 ? { anyResource: false, staffMemberId: e3 } : { anyResource: true }), [Mt2]), Pt2 = (de2?.addOnIds ?? []).filter((e3) => x2?.addOnGroups?.some((t3) => t3.addOnIds?.includes(e3))), Ft2 = de2 && $a(C2) ? de2.participants : null, It2 = L2 ? ao(te2) : null, { addOnIds: Lt2, ...Rt2 } = It2 ?? {}, zt2 = L2 && de2 ? Pt2.length ? { ...Rt2, addOnIds: Pt2 } : Rt2 : It2, Bt2 = zt2 ? rs(zt2) : void 0, Vt2 = JSON.stringify(At2 ? { ...Bt2, requestedGender: { gender: At2 } } : Bt2 ?? null), Ht2 = s(() => JSON.parse(Vt2), [Vt2]), Ut2 = z2?.anyResource === true, Wt2 = i((e3) => Ut2 || _2 !== void 0 && Tl({ isAppointment: L2, staffOnSlotCount: e3, hasStaffFilter: V2 !== null, hasRequestedGender: jt2 !== null, hasStaffPricedVariants: Ue2, staffSelectionStrategy: _2 }), [Ut2, L2, _2, V2, jt2, Ue2]), Gt2 = i((e3) => z2 ?? (R2 ? null : e3), [z2, R2]), Kt2 = i((e3) => {
2817
- let t3 = e3 === null ? null : yt2.find((t4) => t4.id === e3);
2818
- t3 !== void 0 && (Ct2(false), xt2(t3 && !t3.gender ? t3.id : null), Dt2(t3?.gender ?? null));
2819
- }, [yt2]), qt2 = i((e3) => {
2820
- (e3 === null || st2.some((t3) => t3.id === e3)) && (nt2(false), et2(e3), wt2 !== null && e3 !== null && !pt2(wt2, e3) && (xt2(null), Ct2(false)));
2821
- }, [st2, wt2, pt2]), Jt2 = !!(r2 && !Ee2.isLoading && Ee2.displayTimeZonePolicy.customerCanChange && g2 && Ie2 && g2 !== Ie2), H2 = r2 ? Jt2 && t2 && (t2 === g2 || t2 === Ie2) ? t2 : Te2 ?? g2 ?? Ie2 : null, Yt2 = i((e3) => {
2822
- Jt2 && (e3 === g2 || e3 === Ie2) && n2(e3);
2823
- }, [Jt2, g2, Ie2, n2]), Xt2 = s(() => r2 && !N2 && Se2 ? Date.now() : void 0, [r2, N2, F2, xe2, H2]), Zt2 = Xt2 !== void 0 && H2 ? Po(new Date(Xt2), H2) : null, { range: Qt2, daysAvailability: $t2, isLoading: en2, hasError: tn2, setRange: nn2 } = dl({ enabled: r2, serviceId: F2, serviceType: C2, multiServiceRequest: xe2, timeZone: H2, today: Zt2, locationId: B2, staffId: V2, customerChoices: Ht2, minRemainingCapacity: Ft2, loadInitially: u2, onlyAvailableSlots: e2 }), rn2 = fe2?.slice(0, 10) ?? null, an2 = s(() => rn2 ? $t2.map((e3) => e3.date > rn2 ? { ...e3, availability: `none` } : e3) : $t2, [$t2, rn2]), on2 = fe2 && H2 ? Lo(new Date(fe2), H2) : null, { query: U2, selectedDate: sn2, timeSlots: cn2, isLoading: ln2, error: un2, selectDate: dn2, findNextAvailableDate: fn2 } = fl({ enabled: r2, serviceId: F2, serviceType: C2, multiServiceRequest: xe2, timeZone: H2, today: Zt2, locationId: B2, staffId: V2, customerChoices: Ht2, minRemainingCapacity: Ft2, onlyAvailableSlots: e2, serviceLoading: N2 || le2 }), pn2 = c(true), mn2 = c(null);
2827
+ Dl(T2);
2828
+ let E2 = Rs(i2), D2 = u(fs, ds, () => false), { serviceId: ee2 } = d(), O2 = pu(ee2), k2 = Number.isFinite(r2) ? Math.max(1, Math.floor(r2)) : 100;
2829
+ return m(hc, { fallback: m(Zc, { nextAvailableSlotsCount: S2, children: a2 }), feature: $.timeSlots, children: m(hu, { onlyAvailableSlots: e2, selectedTimeZone: v2, setSelectedTimeZone: y2, enabled: T2, nextAvailableSlotsCount: S2, loadDaysAvailabilityInitially: n2, timeSlotLimitPerDay: k2, landingLocationId: h2.locationId, landingStaffId: h2.staffId, businessTimeZone: E2.businessTimeZone, staffSelectionStrategy: E2.staffSelectionStrategy, allowGenderSelection: E2.allowGenderSelection, requestedGenderRejected: D2, children: a2 }) }, O2);
2830
+ }
2831
+ function hu({ onlyAvailableSlots: e2, selectedTimeZone: t2, setSelectedTimeZone: n2, enabled: r2, nextAvailableSlotsCount: a2, loadDaysAvailabilityInitially: u2, timeSlotLimitPerDay: f2, landingLocationId: p2, landingStaffId: h2, businessTimeZone: g2, staffSelectionStrategy: _2, allowGenderSelection: v2, requestedGenderRejected: y2, children: b2 }) {
2832
+ let { service: x2, serviceId: S2, serviceType: C2, setSlot: w2, clearSlot: T2, setMultiServiceSlot: E2, clearMultiServiceSlot: D2, draftRevision: ee2, navigateToMultiServiceForm: O2, selection: k2, selectStaffMember: A2, clearSelection: j2, clearStaffMember: M2, withSelectionParam: te2, staffMembers: N2, serviceOptionsAndVariants: ne2, isLoading: P2, hasError: re2, multiServiceAppointmentServices: ie2 = ru, reschedule: ae2, isSelectionPending: oe2 } = d(), F2 = ae2 != null, se2 = F2 && ae2.status !== `ready`, ce2 = F2 && ae2.status === `loading`, le2 = F2 ? uu[ae2.status] : void 0, ue2 = se2 ? null : ae2?.booking ?? null, de2 = ue2 ? ae2.validUntil : null, fe2 = wl(x2) && !eu(x2), I2 = fe2 || se2 ? null : S2, pe2 = Mc(oe2), me2 = F2 ? null : pe2, he2 = !F2 && oe2, ge2 = s(() => so(Ir(me2)), [me2]), L2 = !S2 && !P2 && !re2 && (ge2.valid || ge2.reason !== `too-few-services`), _e2 = L2 && ge2.valid && ie2.some((e3) => !eu(e3) && ge2.services.some((t3) => t3.serviceId === e3._id)), ve2 = fe2 || _e2, ye2 = L2 && ge2.valid && !_e2 ? ge2.requestKey : null, be2 = s(() => ye2 && ge2.valid ? { services: ge2.services, locationId: ge2.locationId, locationType: ge2.locationType } : null, [ye2]), xe2 = !!I2 || be2 !== null, Se2 = I2 || ye2, Ce2 = r2 && !P2 && !re2 && !xe2 && !ce2, we2 = dc(), Te2 = lc(), { navigate: Ee2, resolvePath: De2 } = yo(), [Oe2, ke2] = l(null), [Ae2, je2] = l(false), Me2 = c([]), Ne2 = c(false), Pe2 = i(() => (je2(true), Ne2.current ? Promise.resolve() : new Promise((e3) => {
2833
+ Me2.current.push(e3);
2834
+ })), []), Fe2 = r2 ? Intl.DateTimeFormat().resolvedOptions().timeZone : null, Ie2 = Xa(x2), Le2 = c(null), Re2 = lo(k2), ze2 = c(Re2);
2835
+ ze2.current = Re2;
2836
+ let Be2 = Re2 && !Re2.anyResource ? Re2.staffMemberId : null, Ve2 = k2.requestedGender ?? null, R2 = !Qa(C2) && !$a(C2), He2 = R2 && !L2 && Es(ne2), z2 = L2 || R2 && _2 === `CUSTOMER_CANNOT_CHOOSE`, Ue2 = _2 !== void 0, We2 = Zo({ allowGenderSelection: v2, staffSelectionStrategy: _2 ?? null }) && R2 && !L2 && !He2, Ge2 = We2 && !y2, Ke2 = s(() => I2 ? Ir(me2)?.services.find((e3) => e3.serviceId === I2) ?? null : null, [me2, I2]), qe2 = (N2 ?? []).map((e3) => e3.staffMemberId).join(`,`), Je2 = Ie2.map((e3) => e3.id).join(`,`), Ye2 = s(() => Fl({ entry: Ke2, appointmentLike: R2, staffChoiceHidden: z2, staffPriced: He2, staffSelectionStrategy: _2, genderAllowed: Ge2, staffMemberIds: qe2.split(`,`), locationIds: Je2.split(`,`) }), [Ke2, R2, z2, He2, _2, Ge2, qe2, Je2]), B2 = Ye2.staff, Xe2 = Ye2.locationId, Ze2 = z2 || B2 !== null, [Qe2, $e2] = l(null), [et2, tt2] = l(p2 !== null || F2), nt2 = s(() => x2 ? Ps(x2) : [], [x2]), rt2 = B2 && !B2.anyResource ? B2.staffMemberId : null, it2 = s(() => {
2837
+ if (!rt2) return nt2;
2838
+ let e3 = nt2.find((e4) => e4.staffMemberId === rt2);
2839
+ return e3 ? [e3] : nt2;
2840
+ }, [nt2, rt2]), at2 = ue2?.locationId ?? null, ot2 = s(() => {
2841
+ let e3 = Ns(Ie2, it2);
2842
+ return !at2 || e3.some((e4) => e4.id === at2) ? e3 : Ie2.filter((t3) => t3.id === at2 || e3.some((e4) => e4.id === t3.id));
2843
+ }, [x2, it2, at2]), st2 = (e3) => !!e3 && ot2.some((t3) => t3.id === e3), ct2 = Qe2 ?? (et2 ? st2(at2) ? at2 : p2 : null), lt2 = Ie2.length > 1 && ot2.length === 1 ? ot2[0].id : null, V2 = Xe2 ?? (st2(ct2) ? ct2 : lt2), ut2 = s(() => Xe2 ? [] : ot2.map((e3) => ({ id: e3.id, name: e3.label })), [ot2, Xe2]), dt2 = s(() => new Map(nt2.map((e3) => [e3.staffMemberId, e3.locationCoverage])), [nt2]), ft2 = i((e3, t3) => As([{ staffMemberId: e3, locationCoverage: dt2.get(e3) }], t3).length === 1, [dt2]), pt2 = s(() => Ze2 ? [] : (N2 ?? []).filter((e3) => e3.name).map((e3) => ({ id: e3.staffMemberId, name: e3.name ?? ``, gender: null })), [N2, Ze2]), mt2 = s(() => V2 ? pt2.filter((e3) => ft2(e3.id, V2)) : pt2, [pt2, V2, ft2]), ht2 = R2 && !Ue2 ? nu : mt2, gt2 = R2 && !Ue2 ? 0 : pt2.length, _t2 = Ge2 && gt2 > 1, vt2 = s(() => _t2 ? [...iu, ...ht2] : ht2, [_t2, ht2]), [yt2, bt2] = l(null), [xt2, St2] = l(h2 !== null);
2844
+ xt2 && h2 !== null && V2 !== null && !ft2(h2, V2) && St2(false);
2845
+ let Ct2 = yt2 ?? (xt2 ? h2 : null), H2 = B2 ? B2.anyResource ? null : B2.staffMemberId : Ct2 !== null && mt2.some((e3) => e3.id === Ct2) ? Ct2 : null, wt2 = Re2?.anyResource ? Ve2 : null, [Tt2, Et2] = l(wt2), [Dt2, Ot2] = l(wt2);
2846
+ !y2 && Re2?.anyResource && Ve2 !== Dt2 && (Ot2(Ve2), Et2(Ve2));
2847
+ let kt2 = B2 ? Ye2.requestedGender : We2 && gt2 > 1 && H2 === null ? Tt2 : null, At2 = y2 ? null : kt2, jt2 = i((e3) => {
2848
+ ze2.current = e3, e3 ? e3.anyResource ? j2(At2 ?? void 0) : A2(e3.staffMemberId) : M2();
2849
+ }, [M2, j2, A2, At2]), Mt2 = i((e3) => jt2(e3 ? { anyResource: false, staffMemberId: e3 } : { anyResource: true }), [jt2]), Nt2 = (ue2?.addOnIds ?? []).filter((e3) => x2?.addOnGroups?.some((t3) => t3.addOnIds?.includes(e3))), Pt2 = ue2 && Qa(C2) ? ue2.participants : null, Ft2 = R2 ? io(k2) : null, { addOnIds: It2, ...Lt2 } = Ft2 ?? {}, Rt2 = R2 && ue2 ? Nt2.length ? { ...Lt2, addOnIds: Nt2 } : Lt2 : Ft2, zt2 = Rt2 ? as(Rt2) : void 0, Bt2 = JSON.stringify(kt2 ? { ...zt2, requestedGender: { gender: kt2 } } : zt2 ?? null), Vt2 = s(() => JSON.parse(Bt2), [Bt2]), Ht2 = B2?.anyResource === true, Ut2 = i((e3) => Ht2 || _2 !== void 0 && jl({ isAppointment: R2, staffOnSlotCount: e3, hasStaffFilter: H2 !== null, hasRequestedGender: At2 !== null, hasStaffPricedVariants: He2, staffSelectionStrategy: _2 }), [Ht2, R2, _2, H2, At2, He2]), Wt2 = i((e3) => B2 ?? (z2 ? null : e3), [B2, z2]), Gt2 = i((e3) => {
2850
+ let t3 = e3 === null ? null : vt2.find((t4) => t4.id === e3);
2851
+ t3 !== void 0 && (St2(false), bt2(t3 && !t3.gender ? t3.id : null), Et2(t3?.gender ?? null));
2852
+ }, [vt2]), Kt2 = i((e3) => {
2853
+ (e3 === null || ot2.some((t3) => t3.id === e3)) && (tt2(false), $e2(e3), Ct2 !== null && e3 !== null && !ft2(Ct2, e3) && (bt2(null), St2(false)));
2854
+ }, [ot2, Ct2, ft2]), qt2 = !!(r2 && !Te2.isLoading && Te2.displayTimeZonePolicy.customerCanChange && g2 && Fe2 && g2 !== Fe2), U2 = r2 ? qt2 && t2 && (t2 === g2 || t2 === Fe2) ? t2 : we2 ?? g2 ?? Fe2 : null, Jt2 = i((e3) => {
2855
+ qt2 && (e3 === g2 || e3 === Fe2) && n2(e3);
2856
+ }, [qt2, g2, Fe2, n2]), Yt2 = s(() => r2 && !P2 && xe2 ? Date.now() : void 0, [r2, P2, I2, be2, U2]), Xt2 = Yt2 !== void 0 && U2 ? Io(new Date(Yt2), U2) : null, { range: Zt2, daysAvailability: Qt2, isLoading: $t2, hasError: en2, setRange: tn2 } = _l({ enabled: r2, serviceId: I2, serviceType: C2, multiServiceRequest: be2, timeZone: U2, today: Xt2, locationId: V2, staffId: H2, customerChoices: Vt2, minRemainingCapacity: Pt2, loadInitially: u2, onlyAvailableSlots: e2 }), nn2 = de2?.slice(0, 10) ?? null, rn2 = s(() => nn2 ? Qt2.map((e3) => e3.date > nn2 ? { ...e3, availability: `none` } : e3) : Qt2, [Qt2, nn2]), an2 = de2 && U2 ? zo(new Date(de2), U2) : null, { query: W2, selectedDate: on2, timeSlots: sn2, isLoading: cn2, error: ln2, selectDate: un2, findNextAvailableDate: dn2 } = vl({ enabled: r2, serviceId: I2, serviceType: C2, multiServiceRequest: be2, timeZone: U2, today: Xt2, locationId: V2, staffId: H2, customerChoices: Vt2, minRemainingCapacity: Pt2, onlyAvailableSlots: e2, serviceLoading: P2 || ce2 }), fn2 = c(true), pn2 = c(null);
2824
2857
  o(() => {
2825
- if (pn2.current) {
2826
- pn2.current = false;
2858
+ if (fn2.current) {
2859
+ fn2.current = false;
2827
2860
  return;
2828
2861
  }
2829
- Ae2(null), Re2.current && ru(F2, T2, D2), Re2.current = null, mn2.current = null;
2830
- }, [U2, xe2, H2, B2, V2, Ht2, Ft2, e2, a2, f2, O2]);
2831
- let hn2 = i(async () => {
2832
- let e3 = await fn2();
2833
- return e3.outcome === `found` ? rn2 && e3.date > rn2 ? `none` : (await Promise.all([dn2(e3.date), Qt2 && Ko(e3.date, Qt2) ? Promise.resolve() : nn2(Go(e3.date))]), `found`) : e3.outcome;
2834
- }, [fn2, rn2, dn2, Qt2, nn2]), gn2 = !!(r2 && !N2 && Se2 && H2 && Zt2), _n2 = r2 && !N2 && !le2 && !Se2, [vn2, yn2] = l(false), [W2, bn2] = l(0), xn2 = c(false), Sn2 = c([]), Cn2 = c(0), wn2 = i(() => {
2835
- yn2(false);
2836
- let e3 = Sn2.current;
2837
- return Sn2.current = [], e3;
2838
- }, []), Tn2 = i(() => {
2839
- Cn2.current += 1, wn2().forEach((e3) => e3(`cancelled`));
2840
- }, [wn2]), En2 = i((e3) => (Tn2(), dn2(e3)), [Tn2, dn2]), Dn2 = i((e3) => {
2841
- let t3 = Cn2.current;
2842
- xn2.current = true, hn2().then((n3) => {
2843
- xn2.current = false, n3 === `cancelled` && t3 === Cn2.current ? (Sn2.current.unshift(...e3), yn2(true)) : e3.forEach((e4) => e4(n3)), bn2((e4) => e4 + 1);
2862
+ ke2(null), Le2.current && lu(I2, T2, D2), Le2.current = null, pn2.current = null;
2863
+ }, [W2, be2, U2, V2, H2, Vt2, Pt2, e2, a2, f2, ee2]);
2864
+ let mn2 = i(async () => {
2865
+ let e3 = await dn2();
2866
+ return e3.outcome === `found` ? nn2 && e3.date > nn2 ? `none` : (await Promise.all([un2(e3.date), Zt2 && Jo(e3.date, Zt2) ? Promise.resolve() : tn2(qo(e3.date))]), `found`) : e3.outcome;
2867
+ }, [dn2, nn2, un2, Zt2, tn2]), hn2 = !!(r2 && !P2 && xe2 && U2 && Xt2), gn2 = r2 && !P2 && !ce2 && !xe2, [_n2, vn2] = l(false), [G2, yn2] = l(0), bn2 = c(false), xn2 = c([]), Sn2 = c(0), Cn2 = i(() => {
2868
+ vn2(false);
2869
+ let e3 = xn2.current;
2870
+ return xn2.current = [], e3;
2871
+ }, []), wn2 = i(() => {
2872
+ Sn2.current += 1, Cn2().forEach((e3) => e3(`cancelled`));
2873
+ }, [Cn2]), Tn2 = i((e3) => (wn2(), un2(e3)), [wn2, un2]), En2 = i((e3) => {
2874
+ let t3 = Sn2.current;
2875
+ bn2.current = true, mn2().then((n3) => {
2876
+ bn2.current = false, n3 === `cancelled` && t3 === Sn2.current ? (xn2.current.unshift(...e3), vn2(true)) : e3.forEach((e4) => e4(n3)), yn2((e4) => e4 + 1);
2844
2877
  });
2845
- }, [hn2]), On2 = i(() => _n2 ? Promise.resolve(`none`) : new Promise((e3) => {
2846
- if (gn2 && !xn2.current) {
2847
- Dn2([...wn2(), e3]);
2878
+ }, [mn2]), Dn2 = i(() => gn2 ? Promise.resolve(`none`) : new Promise((e3) => {
2879
+ if (hn2 && !bn2.current) {
2880
+ En2([...Cn2(), e3]);
2848
2881
  return;
2849
2882
  }
2850
- Sn2.current.push(e3), yn2(true);
2851
- }), [_n2, gn2, Dn2, wn2]);
2883
+ xn2.current.push(e3), vn2(true);
2884
+ }), [gn2, hn2, En2, Cn2]);
2852
2885
  o(() => {
2853
- if (vn2 && !xn2.current) {
2854
- if (_n2) {
2855
- wn2().forEach((e3) => e3(`none`));
2886
+ if (_n2 && !bn2.current) {
2887
+ if (gn2) {
2888
+ Cn2().forEach((e3) => e3(`none`));
2856
2889
  return;
2857
2890
  }
2858
- gn2 && Dn2(wn2());
2891
+ hn2 && En2(Cn2());
2859
2892
  }
2860
- }, [vn2, W2, gn2, _n2, Dn2, wn2]);
2861
- let kn2 = x2?.schedule?.lastSessionEnd, An2 = L2 || $a(C2) || eo(C2) && !Sl(kn2, Xt2), jn2 = !!(je2 && r2 && !N2 && F2 && H2 && Xt2 !== void 0), Mn2 = jn2 && F2 && H2 && Xt2 !== void 0 ? wl({ serviceId: F2, serviceType: C2, lastSessionEnd: kn2, timeZone: H2, now: Xt2, onlyAvailableSlots: e2, locationId: B2, staffId: V2, timeSlotLimitPerDay: f2, customerChoices: Ht2, minRemainingCapacity: Ft2 }) : void 0, G2 = ql(a2, Mn2), Nn2 = je2 && F2 && An2 && !(je2 && F2 && An2 && (!r2 || N2)) && !H2, Pn2 = ye2 ? `onlineBookingOff` : ue2 ?? (G2.error === null ? Nn2 ? `timeZoneMissing` : null : `upcomingSlotsLoadFailed`), Fn2 = U2 !== null, In2 = s(() => jl({ sessions: G2.sessions, dayQuery: Fn2, daySlots: cn2, staffFilter: V2, appointmentLike: L2, limitPerDay: f2, expandedDates: G2.expandedDates }), [G2.sessions, Fn2, cn2, V2, L2, f2, G2.expandedDates]), { slotIdOf: Ln2 } = In2, Rn2 = je2 && (Mn2 ? G2.firstPageSettled : jn2 || r2 && !N2 && !F2 || Nn2);
2862
- Pe2.current = Rn2, o(() => {
2863
- if (!Rn2) return;
2864
- let e3 = Ne2.current;
2865
- Ne2.current = [], e3.forEach((e4) => e4());
2866
- }, [Rn2]);
2867
- let zn2 = je2 && !Rn2 || G2.isLoadingPage, Bn2 = Pn2 !== null, Vn2 = U2 ? ln2 : zn2 || ln2 || !r2 || Se2 && !H2 || vn2 || le2, Hn2 = U2 ? un2 : un2 ?? Pn2, Un2 = U2 ? un2 !== null : Bn2 || un2 !== null, Wn2 = Bc(Fc.TIME_SLOTS), Gn2 = c(false), Kn2 = i((e3, t3) => {
2893
+ }, [_n2, G2, hn2, gn2, En2, Cn2]);
2894
+ let On2 = x2?.schedule?.lastSessionEnd, kn2 = R2 || Qa(C2) || $a(C2) && !Ol(On2, Yt2), An2 = !!(Ae2 && r2 && !P2 && I2 && U2 && Yt2 !== void 0), jn2 = An2 && I2 && U2 && Yt2 !== void 0 ? Al({ serviceId: I2, serviceType: C2, lastSessionEnd: On2, timeZone: U2, now: Yt2, onlyAvailableSlots: e2, locationId: V2, staffId: H2, timeSlotLimitPerDay: f2, customerChoices: Vt2, minRemainingCapacity: Pt2 }) : void 0, K2 = $l(a2, jn2), Mn2 = Ae2 && I2 && kn2 && !(Ae2 && I2 && kn2 && (!r2 || P2)) && !U2, Nn2 = ve2 ? `onlineBookingOff` : le2 ?? (K2.error === null ? Mn2 ? `timeZoneMissing` : null : `upcomingSlotsLoadFailed`), Pn2 = W2 !== null, Fn2 = s(() => Ll({ sessions: K2.sessions, dayQuery: Pn2, daySlots: sn2, staffFilter: H2, appointmentLike: R2, limitPerDay: f2, expandedDates: K2.expandedDates }), [K2.sessions, Pn2, sn2, H2, R2, f2, K2.expandedDates]), { slotIdOf: In2 } = Fn2, Ln2 = Ae2 && (jn2 ? K2.firstPageSettled : An2 || r2 && !P2 && !I2 || Mn2);
2895
+ Ne2.current = Ln2, o(() => {
2896
+ if (!Ln2) return;
2897
+ let e3 = Me2.current;
2898
+ Me2.current = [], e3.forEach((e4) => e4());
2899
+ }, [Ln2]);
2900
+ let Rn2 = Ae2 && !Ln2 || K2.isLoadingPage, zn2 = Nn2 !== null, Bn2 = W2 ? cn2 : Rn2 || cn2 || !r2 || xe2 && !U2 || _n2 || ce2, Vn2 = W2 ? ln2 : ln2 ?? Nn2, Hn2 = W2 ? ln2 !== null : zn2 || ln2 !== null, Un2 = Hc(Lc.TIME_SLOTS), Wn2 = c(false), Gn2 = i((e3, t3) => {
2868
2901
  if (!t3.bookable) {
2869
- mn2.current = null;
2902
+ pn2.current = null;
2870
2903
  return;
2871
2904
  }
2872
- if (e3 === mn2.current) return;
2873
- mn2.current = e3;
2874
- let n3 = F2 ?? t3.serviceId ?? t3.nestedTimeSlots?.[0]?.serviceId ?? void 0, r3 = C2 ?? ae2.find((e4) => e4._id === n3)?.type ?? void 0;
2875
- !Gn2.current && !P2 && Wn2(Nc({ bookingsServiceId: n3, serviceType: r3, isEligibleForFlowCompletion: true })), Gn2.current = true, Wn2(Uc({ component: Rc.TIME_PICKER, element: zc.TIME_SLOT, properties: JSON.stringify({ selectedTime: t3.localStartDate }) }));
2876
- }, [Wn2, F2, C2, ae2, P2]), K2 = i((e3) => {
2905
+ if (e3 === pn2.current) return;
2906
+ pn2.current = e3;
2907
+ let n3 = I2 ?? t3.serviceId ?? t3.nestedTimeSlots?.[0]?.serviceId ?? void 0, r3 = C2 ?? ie2.find((e4) => e4._id === n3)?.type ?? void 0;
2908
+ !Wn2.current && !F2 && Un2(Fc({ bookingsServiceId: n3, serviceType: r3, isEligibleForFlowCompletion: true })), Wn2.current = true, Un2(Gc({ component: Bc.TIME_PICKER, element: Vc.TIME_SLOT, properties: JSON.stringify({ selectedTime: t3.localStartDate }) }));
2909
+ }, [Un2, I2, C2, ie2, F2]), q2 = i((e3) => {
2877
2910
  if (e3 === null) {
2878
- let e4 = Re2.current !== null;
2879
- Re2.current = null, mn2.current = null, Ae2(null), e4 && ru(F2, T2, D2);
2911
+ let e4 = Le2.current !== null;
2912
+ Le2.current = null, pn2.current = null, ke2(null), e4 && lu(I2, T2, D2);
2880
2913
  return;
2881
2914
  }
2882
- let t3 = Ml(In2, e3);
2915
+ let t3 = Rl(Fn2, e3);
2883
2916
  if (!t3) return;
2884
- if (I2) {
2885
- if (!E2(t3.nestedTimeSlots ?? [], H2 ?? void 0)) return;
2886
- Re2.current = t3, Ae2(t3), Kn2(e3, t3);
2917
+ if (L2) {
2918
+ if (!E2(t3.nestedTimeSlots ?? [], U2 ?? void 0)) return;
2919
+ Le2.current = t3, ke2(t3), Gn2(e3, t3);
2887
2920
  return;
2888
2921
  }
2889
- Re2.current = t3, Ae2(t3), Kn2(e3, t3);
2890
- let n3 = Il(t3);
2891
- if (w2(Cs(t3), { staffId: L2 ? void 0 : Fl(t3), timezone: H2 ?? void 0, bookable: t3.bookable, staffChoiceRequired: L2 && We2 && !R2 && n3.length > 1 && !Wt2(n3.length), rescheduleStaffId: L2 && (_2 !== `CUSTOMER_MAY_CHOOSE` || !Wt2(n3.length)) ? n3[0] : void 0 }), !L2) return;
2892
- let r3 = Be2.current, i2;
2893
- i2 = z2 || (V2 && n3.includes(V2) ? { anyResource: false, staffMemberId: V2 } : jt2 !== null && Wt2(n3.length) ? { anyResource: true } : El(n3, We2 && Wt2(n3.length))), Yl(i2, jt2) !== Yl(r3, He2) && Mt2(i2);
2894
- }, [I2, F2, T2, D2, E2, w2, In2, Kn2, H2, L2, We2, _2, Wt2, z2, V2, jt2, He2, Mt2]), qn2 = i(() => {
2895
- let e3 = Re2.current;
2896
- if (!e3 || P2 || !e3.bookable) return;
2897
- if (I2) {
2898
- ee2(Wn2);
2922
+ Le2.current = t3, ke2(t3), Gn2(e3, t3);
2923
+ let n3 = Hl(t3);
2924
+ if (w2(Ts(t3), { staffId: R2 ? void 0 : Vl(t3), timezone: U2 ?? void 0, bookable: t3.bookable, staffChoiceRequired: R2 && Ue2 && !z2 && n3.length > 1 && !Ut2(n3.length), rescheduleStaffId: R2 && (_2 !== `CUSTOMER_MAY_CHOOSE` || !Ut2(n3.length)) ? n3[0] : void 0 }), !R2) return;
2925
+ let r3 = ze2.current, i2;
2926
+ i2 = B2 || (H2 && n3.includes(H2) ? { anyResource: false, staffMemberId: H2 } : At2 !== null && Ut2(n3.length) ? { anyResource: true } : Ml(n3, Ue2 && Ut2(n3.length))), tu(i2, At2) !== tu(r3, Ve2) && jt2(i2);
2927
+ }, [L2, I2, T2, D2, E2, w2, Fn2, Gn2, U2, R2, Ue2, _2, z2, Ut2, B2, H2, At2, Ve2, jt2]), Kn2 = i(() => {
2928
+ let e3 = Le2.current;
2929
+ if (!e3 || F2 || !e3.bookable) return;
2930
+ if (L2) {
2931
+ O2(Un2);
2899
2932
  return;
2900
2933
  }
2901
- if (!F2) return;
2934
+ if (!I2) return;
2902
2935
  let t3;
2903
- if (L2) {
2904
- let n4 = Il(e3), r3 = Dl(n4, Gt2(Be2.current), Wt2(n4.length));
2936
+ if (R2) {
2937
+ let n4 = Hl(e3), r3 = Nl(n4, Wt2(ze2.current), Ut2(n4.length));
2905
2938
  t3 = (r3.isComplete ? r3.resourceId : n4[0]) ?? (n4.length ? null : void 0);
2906
2939
  }
2907
- let n3 = Oe2(`bookingForm`, { slug: x2?.mainSlug?.name ?? null, serviceId: F2 });
2908
- Wn2(Kc({ serviceId: F2, serviceType: C2 ?? void 0, start: e3.localStartDate, end: e3.localEndDate, timeZone: H2 ?? void 0, isEligibleForFlowCompletion: !!n3 })), n3 && De2(ne2(n3, { handoff: true, staffId: t3 }));
2909
- }, [Wn2, I2, ee2, H2, F2, C2, x2, L2, Gt2, Wt2, De2, Oe2, ne2, P2]), Jn2 = ke2 ? Il(ke2) : null, Yn2 = Jn2 ? I2 || !L2 || Dl(Jn2, Gt2(ze2), Wt2(Jn2.length)).isComplete : false, Xn2 = Jn2 ? Wt2(Jn2.length) : false, Zn2 = s(() => !ke2 || Qe2 ? [] : Pl(ke2).map((e3) => ({ staffMemberId: e3.staffMemberId, name: e3.name || null, image: null, isSelected: e3.staffMemberId === Ve2 })), [ke2, Qe2, Ve2]), Qn2 = s(() => ({ isMultiService: I2, isSelectionPending: ge2, availabilityRequestKey: Ce2, needsServiceChoice: we2, isRescheduling: P2, rescheduleValidUntil: on2, businessTimeZone: g2, canChangeTimeZone: Jt2, setTimeZone: Yt2, locationFilterOptions: dt2, selectedLocationFilter: B2, setLocationFilter: qt2, staffFilterOptions: yt2, selectedStaffFilter: V2, setStaffFilter: Kt2, requestedGender: jt2, genderSelectionAllowed: Ke2, currentTimeSlotsPage: U2 ? 1 : G2.currentPage, hasNextTimeSlotsPage: !U2 && G2.hasNextPage, hasPreviousTimeSlotsPage: !U2 && G2.hasPreviousPage, nextTimeSlotsPage: U2 ? eu : G2.nextPage, loadUpcomingTimeSlots: Fe2, upcomingTimeSlotsRequested: je2, previousTimeSlotsPage: U2 ? $l : G2.previousPage, timeSlots: In2.rows.map((e3) => Nl(e3, H2, Ln2, R2)), isLoading: Vn2, hasError: Un2, errorCode: Hn2, selectedDate: sn2, daysAvailabilityRange: Qt2, daysAvailability: an2, daysAvailabilityLoading: en2, daysAvailabilityHasError: tn2, selectDate: En2, setDaysAvailabilityRange: nn2, goToNextAvailableDate: On2, nextAvailableSlotsCount: a2, timeZone: H2, staffFromSlots: Zn2, selectedResourceId: Ve2, setSelectedResource: Nt2, canAutoAssignStaff: Xn2, isComplete: Yn2, selectedTimeSlot: ke2 ? Nl(ke2, H2, Ln2, R2) : null, selectTimeSlot: K2, navigateToBookingForm: qn2, timeSlotLimitPerDay: f2, daysWithMore: In2.daysWithMore, loadingDate: G2.loadingDate, loadAllTimeSlotsForDay: G2.loadAllSessionsForDay }), [I2, ge2, Ce2, we2, P2, on2, g2, H2, Jt2, Yt2, G2, Fe2, je2, dt2, B2, qt2, yt2, V2, Kt2, jt2, Ke2, U2, Vn2, Hn2, Un2, In2, sn2, Qt2, an2, en2, tn2, En2, nn2, On2, a2, Zn2, Ve2, Nt2, Xn2, Yn2, ke2, K2, qn2, f2, Ln2, R2]);
2910
- return m(tu.Provider, { value: Qn2, children: b2 });
2940
+ let n3 = De2(`bookingForm`, { slug: x2?.mainSlug?.name ?? null, serviceId: I2 });
2941
+ Un2(Jc({ serviceId: I2, serviceType: C2 ?? void 0, start: e3.localStartDate, end: e3.localEndDate, timeZone: U2 ?? void 0, isEligibleForFlowCompletion: !!n3 })), n3 && Ee2(te2(n3, { handoff: true, staffId: t3 }));
2942
+ }, [Un2, L2, O2, U2, I2, C2, x2, R2, Wt2, Ut2, Ee2, De2, te2, F2]), qn2 = Oe2 ? Hl(Oe2) : null, Jn2 = qn2 ? L2 || !R2 || Nl(qn2, Wt2(Re2), Ut2(qn2.length)).isComplete : false, Yn2 = qn2 ? Ut2(qn2.length) : false, Xn2 = s(() => !Oe2 || Ze2 ? [] : Bl(Oe2).map((e3) => ({ staffMemberId: e3.staffMemberId, name: e3.name || null, image: null, isSelected: e3.staffMemberId === Be2 })), [Oe2, Ze2, Be2]), Zn2 = s(() => ({ isMultiService: L2, isSelectionPending: he2, availabilityRequestKey: Se2, needsServiceChoice: Ce2, isRescheduling: F2, rescheduleValidUntil: an2, businessTimeZone: g2, canChangeTimeZone: qt2, setTimeZone: Jt2, locationFilterOptions: ut2, selectedLocationFilter: V2, setLocationFilter: Kt2, staffFilterOptions: vt2, selectedStaffFilter: H2, setStaffFilter: Gt2, requestedGender: At2, genderSelectionAllowed: Ge2, currentTimeSlotsPage: W2 ? 1 : K2.currentPage, hasNextTimeSlotsPage: !W2 && K2.hasNextPage, hasPreviousTimeSlotsPage: !W2 && K2.hasPreviousPage, nextTimeSlotsPage: W2 ? ou : K2.nextPage, loadUpcomingTimeSlots: Pe2, upcomingTimeSlotsRequested: Ae2, previousTimeSlotsPage: W2 ? au : K2.previousPage, timeSlots: Fn2.rows.map((e3) => zl(e3, U2, In2, z2)), isLoading: Bn2, hasError: Hn2, errorCode: Vn2, selectedDate: on2, daysAvailabilityRange: Zt2, daysAvailability: rn2, daysAvailabilityLoading: $t2, daysAvailabilityHasError: en2, selectDate: Tn2, setDaysAvailabilityRange: tn2, goToNextAvailableDate: Dn2, nextAvailableSlotsCount: a2, timeZone: U2, staffFromSlots: Xn2, selectedResourceId: Be2, setSelectedResource: Mt2, canAutoAssignStaff: Yn2, isComplete: Jn2, selectedTimeSlot: Oe2 ? zl(Oe2, U2, In2, z2) : null, selectTimeSlot: q2, navigateToBookingForm: Kn2, timeSlotLimitPerDay: f2, daysWithMore: Fn2.daysWithMore, loadingDate: K2.loadingDate, loadAllTimeSlotsForDay: K2.loadAllSessionsForDay }), [L2, he2, Se2, Ce2, F2, an2, g2, U2, qt2, Jt2, K2, Pe2, Ae2, ut2, V2, Kt2, vt2, H2, Gt2, At2, Ge2, W2, Bn2, Vn2, Hn2, Fn2, on2, Zt2, rn2, $t2, en2, Tn2, tn2, Dn2, a2, Xn2, Be2, Mt2, Yn2, Jn2, Oe2, q2, Kn2, f2, In2, z2]);
2943
+ return m(su.Provider, { value: Zn2, children: b2 });
2911
2944
  }
2912
- var uu = un(`4936242d-905c-48bf-80ce-5f56d075de4f`);
2945
+ var gu = ln(`4936242d-905c-48bf-80ce-5f56d075de4f`);
2913
2946
  export {
2914
- ou as TimeSlotsContextProvider,
2915
- ou as default,
2916
- uu as injectAccessTokenGetter,
2917
- tu as timeSlotsContext,
2918
- nu as useTimeSlotsContext
2947
+ fu as TimeSlotsContextProvider,
2948
+ fu as default,
2949
+ gu as injectAccessTokenGetter,
2950
+ su as timeSlotsContext,
2951
+ cu as useTimeSlotsContext
2919
2952
  };
2920
2953
  //# sourceMappingURL=context-time-slots.mjs.map