@wix/bookings 1.0.1750 → 1.0.1752

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 (105) hide show
  1. package/_sdk-exports/{context-booking-checkout-context → context-booking-checkout}/runtime.d.ts +10 -0
  2. package/_sdk-exports/context-booking-checkout/runtime.js +2 -0
  3. package/_sdk-exports/context-categories/runtime.js +1 -0
  4. package/_sdk-exports/context-locations/runtime.js +1 -0
  5. package/_sdk-exports/{context-service-context → context-service}/runtime.d.ts +1 -1
  6. package/_sdk-exports/{context-service-context → context-service}/runtime.js +2 -2
  7. package/_sdk-exports/context-service-addons/runtime.js +1 -0
  8. package/_sdk-exports/context-services/runtime.js +2 -0
  9. package/_sdk-exports/context-time-slots/runtime.js +2 -0
  10. package/build/{internal/es/context-booking-checkout-context.d.mts → cjs/context-booking-checkout.d.ts} +10 -0
  11. package/build/cjs/{context-booking-checkout-context.js → context-booking-checkout.js} +909 -925
  12. package/build/cjs/context-booking-checkout.js.map +1 -0
  13. package/build/cjs/{context-categories-context.js → context-categories.js} +287 -293
  14. package/build/cjs/context-categories.js.map +1 -0
  15. package/build/cjs/{context-locations-context.js → context-locations.js} +362 -368
  16. package/build/cjs/context-locations.js.map +1 -0
  17. package/build/cjs/{context-service-addons-context.js → context-service-addons.js} +424 -430
  18. package/build/cjs/context-service-addons.js.map +1 -0
  19. package/build/cjs/{context-service-context.d.ts → context-service.d.ts} +1 -1
  20. package/build/cjs/{context-service-context.js → context-service.js} +964 -977
  21. package/build/cjs/context-service.js.map +1 -0
  22. package/build/cjs/{context-services-context.js → context-services.js} +600 -611
  23. package/build/cjs/context-services.js.map +1 -0
  24. package/build/cjs/{context-time-slots-context.js → context-time-slots.js} +1187 -1195
  25. package/build/cjs/context-time-slots.js.map +1 -0
  26. package/build/{cjs/context-booking-checkout-context.d.ts → es/context-booking-checkout.d.mts} +10 -0
  27. package/build/es/{context-booking-checkout-context.mjs → context-booking-checkout.mjs} +906 -922
  28. package/build/es/context-booking-checkout.mjs.map +1 -0
  29. package/build/es/{context-categories-context.mjs → context-categories.mjs} +283 -289
  30. package/build/es/context-categories.mjs.map +1 -0
  31. package/build/es/{context-locations-context.mjs → context-locations.mjs} +358 -364
  32. package/build/es/context-locations.mjs.map +1 -0
  33. package/build/es/{context-service-addons-context.mjs → context-service-addons.mjs} +417 -423
  34. package/build/es/context-service-addons.mjs.map +1 -0
  35. package/build/{internal/cjs/context-service-context.d.ts → es/context-service.d.mts} +1 -1
  36. package/build/es/{context-service-context.mjs → context-service.mjs} +960 -973
  37. package/build/es/context-service.mjs.map +1 -0
  38. package/build/es/{context-services-context.mjs → context-services.mjs} +596 -607
  39. package/build/es/context-services.mjs.map +1 -0
  40. package/build/es/{context-time-slots-context.mjs → context-time-slots.mjs} +1181 -1189
  41. package/build/es/context-time-slots.mjs.map +1 -0
  42. package/build/internal/cjs/{context-booking-checkout-context.d.ts → context-booking-checkout.d.ts} +10 -0
  43. package/build/internal/{es/context-service-context.d.mts → cjs/context-service.d.ts} +1 -1
  44. package/build/{es/context-booking-checkout-context.d.mts → internal/es/context-booking-checkout.d.mts} +10 -0
  45. package/build/{es/context-service-context.d.mts → internal/es/context-service.d.mts} +1 -1
  46. package/context/booking-checkout/package.json +3 -0
  47. package/context/categories/package.json +3 -0
  48. package/context/locations/package.json +3 -0
  49. package/context/service/package.json +3 -0
  50. package/context/service-addons/package.json +3 -0
  51. package/context/services/package.json +3 -0
  52. package/context/time-slots/package.json +3 -0
  53. package/package.json +37 -37
  54. package/_sdk-exports/context-booking-checkout-context/runtime.js +0 -2
  55. package/_sdk-exports/context-categories-context/runtime.js +0 -1
  56. package/_sdk-exports/context-locations-context/runtime.js +0 -1
  57. package/_sdk-exports/context-service-addons-context/runtime.js +0 -1
  58. package/_sdk-exports/context-services-context/runtime.js +0 -2
  59. package/_sdk-exports/context-time-slots-context/runtime.js +0 -2
  60. package/build/cjs/context-booking-checkout-context.js.map +0 -1
  61. package/build/cjs/context-categories-context.js.map +0 -1
  62. package/build/cjs/context-locations-context.js.map +0 -1
  63. package/build/cjs/context-service-addons-context.js.map +0 -1
  64. package/build/cjs/context-service-context.js.map +0 -1
  65. package/build/cjs/context-services-context.js.map +0 -1
  66. package/build/cjs/context-time-slots-context.js.map +0 -1
  67. package/build/es/context-booking-checkout-context.mjs.map +0 -1
  68. package/build/es/context-categories-context.mjs.map +0 -1
  69. package/build/es/context-locations-context.mjs.map +0 -1
  70. package/build/es/context-service-addons-context.mjs.map +0 -1
  71. package/build/es/context-service-context.mjs.map +0 -1
  72. package/build/es/context-services-context.mjs.map +0 -1
  73. package/build/es/context-time-slots-context.mjs.map +0 -1
  74. package/context/booking-checkout-context/package.json +0 -3
  75. package/context/categories-context/package.json +0 -3
  76. package/context/locations-context/package.json +0 -3
  77. package/context/service-addons-context/package.json +0 -3
  78. package/context/service-context/package.json +0 -3
  79. package/context/services-context/package.json +0 -3
  80. package/context/time-slots-context/package.json +0 -3
  81. /package/_sdk-exports/{context-categories-context → context-categories}/runtime.d.ts +0 -0
  82. /package/_sdk-exports/{context-locations-context → context-locations}/runtime.d.ts +0 -0
  83. /package/_sdk-exports/{context-service-addons-context → context-service-addons}/runtime.d.ts +0 -0
  84. /package/_sdk-exports/{context-services-context → context-services}/runtime.d.ts +0 -0
  85. /package/_sdk-exports/{context-time-slots-context → context-time-slots}/runtime.d.ts +0 -0
  86. /package/build/cjs/{context-categories-context.d.ts → context-categories.d.ts} +0 -0
  87. /package/build/cjs/{context-locations-context.d.ts → context-locations.d.ts} +0 -0
  88. /package/build/cjs/{context-service-addons-context.d.ts → context-service-addons.d.ts} +0 -0
  89. /package/build/cjs/{context-services-context.d.ts → context-services.d.ts} +0 -0
  90. /package/build/cjs/{context-time-slots-context.d.ts → context-time-slots.d.ts} +0 -0
  91. /package/build/es/{context-categories-context.d.mts → context-categories.d.mts} +0 -0
  92. /package/build/es/{context-locations-context.d.mts → context-locations.d.mts} +0 -0
  93. /package/build/es/{context-service-addons-context.d.mts → context-service-addons.d.mts} +0 -0
  94. /package/build/es/{context-services-context.d.mts → context-services.d.mts} +0 -0
  95. /package/build/es/{context-time-slots-context.d.mts → context-time-slots.d.mts} +0 -0
  96. /package/build/internal/cjs/{context-categories-context.d.ts → context-categories.d.ts} +0 -0
  97. /package/build/internal/cjs/{context-locations-context.d.ts → context-locations.d.ts} +0 -0
  98. /package/build/internal/cjs/{context-service-addons-context.d.ts → context-service-addons.d.ts} +0 -0
  99. /package/build/internal/cjs/{context-services-context.d.ts → context-services.d.ts} +0 -0
  100. /package/build/internal/cjs/{context-time-slots-context.d.ts → context-time-slots.d.ts} +0 -0
  101. /package/build/internal/es/{context-categories-context.d.mts → context-categories.d.mts} +0 -0
  102. /package/build/internal/es/{context-locations-context.d.mts → context-locations.d.mts} +0 -0
  103. /package/build/internal/es/{context-service-addons-context.d.mts → context-service-addons.d.mts} +0 -0
  104. /package/build/internal/es/{context-services-context.d.mts → context-services.d.mts} +0 -0
  105. /package/build/internal/es/{context-time-slots-context.d.mts → context-time-slots.d.mts} +0 -0
@@ -1,6 +1,6 @@
1
- // _sdk-exports/context-time-slots-context/runtime.js
1
+ // _sdk-exports/context-time-slots/runtime.js
2
2
  import { Component as e, Suspense as t, createContext as n, useCallback as r, useContext as i, useEffect as a, useMemo as o, useRef as s, useState as c, useSyncExternalStore as l } from "react";
3
- import { useServiceContext as u } from "@wix/bookings/context/service-context";
3
+ import { useServiceContext as u } from "@wix/bookings/context/service";
4
4
  import { useGetService as d, useService as f } from "@wix/services-manager-react";
5
5
  import { jsx as p } from "react/jsx-runtime";
6
6
  var m = {};
@@ -74,12 +74,12 @@ function ee(e2, t2) {
74
74
  }
75
75
  var E = `x-wix-bi-gateway`;
76
76
  function D(e2, t2, n2) {
77
- return { [E]: te({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e2.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e2.methodFqn, entity: e2.entityFqdn }) };
77
+ return { [E]: O({ 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 O(e2) {
80
80
  return Object.entries(e2).filter(([e3, t2]) => !!t2).map(([e3, t2]) => `${e3}=${t2}`).join(`,`);
81
81
  }
82
- function ne(e2) {
82
+ function te(e2) {
83
83
  let t2 = globalThis.__wix_context__, n2 = { client: m.client, elevatedClient: m.elevatedClient }, r2;
84
84
  globalThis.__wix_context__ = void 0, m.client = void 0, m.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
85
85
  try {
@@ -88,69 +88,69 @@ function ne(e2) {
88
88
  globalThis.__wix_context__ = t2, m.client = n2.client, m.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
89
89
  }
90
90
  }
91
- var O = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
92
- function k(e2) {
93
- return j(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
91
+ var k = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
92
+ function A(e2) {
93
+ return M(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
94
94
  }
95
- var re = /([\p{Ll}\d])(\p{Lu})/gu;
96
- var ie = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
97
- var A = `$1\0$2`;
98
- var ae = /[^\p{L}\d]+/giu;
99
- function j(e2) {
95
+ var ne = /([\p{Ll}\d])(\p{Lu})/gu;
96
+ var re = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
97
+ var j = `$1\0$2`;
98
+ var ie = /[^\p{L}\d]+/giu;
99
+ function M(e2) {
100
100
  let t2 = e2.trim();
101
- t2 = t2.replace(re, A).replace(ie, A), t2 = t2.replace(ae, `\0`);
101
+ t2 = t2.replace(ne, j).replace(re, j), t2 = t2.replace(ie, `\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 oe = (e2) => `validationError` in (e2.response?.data?.details ?? {});
109
- var M = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
110
- var se = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
111
- function N(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
108
+ var ae = (e2) => `validationError` in (e2.response?.data?.details ?? {});
109
+ var N = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
110
+ var oe = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
111
+ function P(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
112
112
  if (typeof e2 != `object` || !e2) throw e2;
113
- if (oe(e2)) return ce(e2, t2, n2);
114
- if (M(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: k(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 (ae(e2)) return se(e2, t2, n2);
114
+ if (N(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: A(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 ?? k(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 ?? A(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: k(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: A(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 = P(e2);
144
+ var fe = (e2, t2) => {
145
+ let n2 = F(e2);
146
146
  return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
147
147
  };
148
- var P = (e2) => {
148
+ var F = (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 ne(() => e2({ request: async (e3) => {
152
+ function pe(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
153
+ return te(() => 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 ? b : o3}${a3.url}`;
@@ -163,7 +163,7 @@ function me(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
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 = N(t3);
166
+ let t3 = he(s3.status, e5?.message ?? s3.statusText, e5?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e5 }), n3 = P(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 F = `.`;
185
- function _e(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 I = `.`;
185
+ function ge(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 _e(e2, t2, n2) {
196
196
  }
197
197
  return e2;
198
198
  }
199
- function ve(e2) {
200
- return Array.isArray(e2) ? e2 : e2.split(F).map((e3) => ye(e3) ? Number(e3) : e3);
199
+ function _e(e2) {
200
+ return Array.isArray(e2) ? e2 : e2.split(I).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) || _e(t2, ve(n2), r2);
207
+ for (let [n2, r2] of Object.entries(e2)) be(n2) || ge(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 O ? O[e3] : void 0;
256
+ let i3 = e3 in k ? k[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: h(`AppInstalled`)(), AppRemoved: h(`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 = C(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 = C(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 (T(t3) && e2.host) return ee(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(ne(() => v(t3)) ? _(t3) : t3, n3 ?? {}, f2, e2.host?.getErrorHandler?.(), (e3, t4) => {
458
+ return pe(te(() => v(t3)) ? _(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 = I(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 = L(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 I(e2, t2) {
511
+ function L(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 He(e2, t2 = []) {
516
- return Ve(e2, Ie, t2);
515
+ function Ve(e2, t2 = []) {
516
+ return Be(e2, Fe, t2);
517
517
  }
518
- function L(e2, t2 = []) {
519
- return Ve(e2, Le, t2);
518
+ function R(e2, t2 = []) {
519
+ return Be(e2, Ie, t2);
520
520
  }
521
- function Ue(e2) {
521
+ function He(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 R(e2) {
547
- let t2 = Ge.get(e2);
548
- return t2 || (t2 = Ye(e2), Ge.set(e2, t2)), t2;
546
+ function z(e2) {
547
+ let t2 = We.get(e2);
548
+ return t2 || (t2 = Je(e2), We.set(e2, t2)), t2;
549
549
  }
550
- function Xe(e2) {
550
+ function Ye(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 ? Xe(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 ? Ye(e2) ? Object.fromEntries(Object.entries(e2).map(([e3, t3]) => [e3, r2(t3)])) : e2 : r2(e2);
555
555
  }
556
- function Qe(e2, t2, n2) {
557
- Xe(e2) && tt(e2, t2, n2);
556
+ function Ze(e2, t2, n2) {
557
+ Ye(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
- Xe(t3) && Object.values(t3).forEach((e3) => Qe(e3, i2, n2));
570
+ Ye(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 (!Xe(e2)) return e2;
578
- for (let { paths: n2, transformFn: r2 } of t2) tt(e2, R(n2), r2);
576
+ function tt(e2, t2) {
577
+ if (!Ye(e2)) return e2;
578
+ for (let { paths: n2, transformFn: r2 } of t2) et(e2, z(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 dt = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
600
- function ft(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 ut = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
600
+ function dt(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
601
601
  if (typeof e2 != `object` || !e2) throw e2;
602
- if (lt(e2)) return pt(e2, t2, n2);
603
- if (ut(e2)) return ht(e2);
604
- if (dt(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 mt(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
602
+ if (ct(e2)) return ft(e2, t2, n2);
603
+ if (lt(e2)) return mt(e2);
604
+ if (ut(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 pt(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
607
607
  }
608
- return z(e2);
608
+ return B(e2);
609
609
  }
610
- var pt = (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 mt(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
610
+ var ft = (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 pt(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
613
613
  };
614
- var mt = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
615
- var ht = (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 mt(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
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 ?? 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 pt(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
618
618
  };
619
- var z = (e2) => mt(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 B = (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: 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: m.client, elevatedClient: m.elevatedClient }, r2;
671
671
  globalThis.__wix_context__ = void 0, m.client = void 0, m.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, m.client = n2.client, m.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 B(e2, t2 = false) {
685
- return xt(e2, t2);
684
+ function V(e2, t2 = false) {
685
+ return bt(e2, t2);
686
686
  }
687
- function St(e2, t2) {
688
- let n2 = wt(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 xt(e2, t2) {
688
+ let n2 = Ct(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 Ct(e2) {
694
- let t2 = V(Lt(e2.host), e2.domainToMappings);
695
- return qt(Wt(e2.protoPath, e2.data || {}), t2);
693
+ function St(e2) {
694
+ let t2 = H(It(e2.host), e2.domainToMappings);
695
+ return Kt(Ut(e2.protoPath, e2.data || {}), t2);
696
696
  }
697
- function wt(e2, t2 = ``) {
697
+ function Ct(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 = wt(r2, a2);
702
+ let e4 = Ct(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 V(e2, t2) {
730
+ function H(e2, t2) {
731
731
  let n2 = t2[e2];
732
732
  if (n2) return n2;
733
- let r2 = zt(e2, t2) ?? Bt(e2, t2);
733
+ let r2 = Rt(e2, t2) ?? zt(e2, t2);
734
734
  if (!r2) {
735
- if (Ht(e2)) {
736
- let e3 = t2[Ut];
735
+ if (Vt(e2)) {
736
+ let e3 = t2[Ht];
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 zt(e2, t2) {
744
+ function Rt(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 Bt(e2, t2) {
751
- let [n2] = Object.entries(t2).filter(([t3]) => Vt(e2, t3)).sort(([e3], [t3]) => t3.length - e3.length);
750
+ function zt(e2, t2) {
751
+ let [n2] = Object.entries(t2).filter(([t3]) => Bt(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 Vt(e2, t2) {
757
- if (!t2.startsWith(kt)) return false;
756
+ function Bt(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 Ht(e2) {
761
+ function Vt(e2) {
762
762
  return !!e2.match(/\._base_domain_$/);
763
763
  }
764
- var Ut = `www._base_domain_`;
765
- function Wt(e2, t2) {
766
- return e2.split(`/`).map((e3) => Gt(e3, t2)).join(`/`);
764
+ var Ht = `www._base_domain_`;
765
+ function Ut(e2, t2) {
766
+ return e2.split(`/`).map((e3) => Wt(e3, t2)).join(`/`);
767
767
  }
768
- function Gt(e2, t2) {
769
- let n2 = e2.match(Pt) || [], r2 = n2[1];
770
- return r2 ? Kt(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
768
+ function Wt(e2, t2) {
769
+ let n2 = e2.match(Nt) || [], r2 = n2[1];
770
+ return r2 ? Gt(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
771
771
  }
772
- function Kt(e2, t2, n2, r2) {
772
+ function Gt(e2, t2, n2, r2) {
773
773
  let i2 = e2;
774
774
  for (let e3 of t2.split(`.`)) {
775
775
  if (!i2) return n2;
@@ -777,36 +777,36 @@ function Kt(e2, t2, n2, r2) {
777
777
  }
778
778
  return `${i2}${r2}`;
779
779
  }
780
- function qt(e2, t2) {
780
+ function Kt(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 Jt(e2) {
784
+ function qt(e2) {
785
785
  return e2 === `NaN` ? NaN : e2 === `Infinity` ? 1 / 0 : e2 === `-Infinity` ? -1 / 0 : e2;
786
786
  }
787
- var Yt = `x-wix-linguist`;
788
- var Xt = `00000000-0000-0000-0000-000000000000`;
789
- var Zt = `false`;
790
- var H = () => {
791
- let e2 = $t(`language`), t2 = $t(`locale`);
792
- if (e2) return { [Yt]: [e2, t2 || e2, Zt, Xt].join(`|`) };
787
+ var Jt = `x-wix-linguist`;
788
+ var Yt = `00000000-0000-0000-0000-000000000000`;
789
+ var Xt = `false`;
790
+ var U = () => {
791
+ let e2 = Qt(`language`), t2 = Qt(`locale`);
792
+ if (e2) return { [Jt]: [e2, t2 || e2, Xt, Yt].join(`|`) };
793
793
  };
794
- function Qt() {
794
+ function Zt() {
795
795
  let e2 = null, t2 = null;
796
796
  return { promise: new Promise((n2, r2) => {
797
797
  e2 = n2, t2 = r2;
798
798
  }), resolve: e2, reject: t2 };
799
799
  }
800
- var $t = (e2) => typeof window < `u` ? window.commonConfig?.[e2] : void 0;
801
- var en = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
802
- let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = nn();
803
- return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: $t(`language`), locale: $t(`locale`), get passThroughHeaders() {
804
- return H();
800
+ var Qt = (e2) => typeof window < `u` ? window.commonConfig?.[e2] : void 0;
801
+ var $t = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
802
+ let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = tn();
803
+ return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: Qt(`language`), locale: Qt(`locale`), get passThroughHeaders() {
804
+ return U();
805
805
  } } };
806
806
  }, auth: (e3) => {
807
807
  let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
808
- !e3 && tn() && (e3 = t2?.getAccessTokenFunction?.());
809
- let n2 = false, { resolve: r2, promise: i2 } = Qt();
808
+ !e3 && en() && (e3 = t2?.getAccessTokenFunction?.());
809
+ let n2 = false, { resolve: r2, promise: i2 } = Zt();
810
810
  return { getAuthHeaders: async () => {
811
811
  if (!e3 && n2 && (e3 = await i2), !e3) throw Error(`Failed to resolve auth token`);
812
812
  return { headers: { Authorization: await e3() } };
@@ -814,486 +814,476 @@ var en = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host:
814
814
  r2(e4);
815
815
  }) };
816
816
  } });
817
- function tn() {
817
+ function en() {
818
818
  return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
819
819
  }
820
- function nn() {
820
+ function tn() {
821
821
  let e2 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
822
822
  if (!e2) return;
823
823
  let t2 = new URL(e2);
824
824
  return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
825
825
  }
826
- var rn = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
826
+ var nn = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
827
827
  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`);
828
828
  return e2.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
829
829
  }, getAccessToken: () => {
830
830
  throw Error(`Not implemented`);
831
831
  }, observeState: () => ({ disconnect: () => {
832
832
  } }) });
833
- var an = en({ createHost: function(e2) {
833
+ var rn = $t({ createHost: function(e2) {
834
834
  let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e2?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e2 || {};
835
835
  if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
836
- return { channel: rn({ clientSdk: t2, applicationId: n2 }), close: () => {
836
+ return { channel: nn({ clientSdk: t2, applicationId: n2 }), close: () => {
837
837
  } };
838
838
  } });
839
- var on = ((e2, t2) => {
840
- let n2 = an.host({ applicationId: e2, componentId: t2 }), r2 = an.auth();
841
- return Pe({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
839
+ var an = ((e2, t2) => {
840
+ let n2 = rn.host({ applicationId: e2, componentId: t2 }), r2 = rn.auth();
841
+ return Ne({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
842
842
  })(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`);
843
- var sn = [`ANY_FEMALE`, `ANY_MALE`];
844
- var cn = `3.7.8`;
845
- var ln = cn;
846
- var un = typeof Buffer == `function`;
847
- var dn = typeof TextDecoder == `function` ? new TextDecoder() : void 0;
848
- var fn = typeof TextEncoder == `function` ? new TextEncoder() : void 0;
849
- var pn = Array.prototype.slice.call(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`);
850
- var mn = ((e2) => {
843
+ var on = [`ANY_FEMALE`, `ANY_MALE`];
844
+ var sn = `3.7.8`;
845
+ var cn = sn;
846
+ var ln = typeof Buffer == `function`;
847
+ var un = typeof TextDecoder == `function` ? new TextDecoder() : void 0;
848
+ var dn = typeof TextEncoder == `function` ? new TextEncoder() : void 0;
849
+ var fn = Array.prototype.slice.call(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`);
850
+ var pn = ((e2) => {
851
851
  let t2 = {};
852
852
  return e2.forEach((e3, n2) => t2[e3] = n2), t2;
853
- })(pn);
854
- var hn = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
855
- var U = String.fromCharCode.bind(String);
856
- var gn = typeof Uint8Array.from == `function` ? Uint8Array.from.bind(Uint8Array) : (e2) => new Uint8Array(Array.prototype.slice.call(e2, 0));
857
- var _n = (e2) => e2.replace(/=/g, ``).replace(/[+\/]/g, (e3) => e3 == `+` ? `-` : `_`);
858
- var vn = (e2) => e2.replace(/[^A-Za-z0-9\+\/]/g, ``);
859
- var yn = (e2) => {
853
+ })(fn);
854
+ var mn = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
855
+ var W = String.fromCharCode.bind(String);
856
+ var hn = typeof Uint8Array.from == `function` ? Uint8Array.from.bind(Uint8Array) : (e2) => new Uint8Array(Array.prototype.slice.call(e2, 0));
857
+ var gn = (e2) => e2.replace(/=/g, ``).replace(/[+\/]/g, (e3) => e3 == `+` ? `-` : `_`);
858
+ var _n = (e2) => e2.replace(/[^A-Za-z0-9\+\/]/g, ``);
859
+ var vn = (e2) => {
860
860
  let t2, n2, r2, i2, a2 = ``, o2 = e2.length % 3;
861
861
  for (let o3 = 0; o3 < e2.length; ) {
862
862
  if ((n2 = e2.charCodeAt(o3++)) > 255 || (r2 = e2.charCodeAt(o3++)) > 255 || (i2 = e2.charCodeAt(o3++)) > 255) throw TypeError(`invalid character found`);
863
- t2 = n2 << 16 | r2 << 8 | i2, a2 += pn[t2 >> 18 & 63] + pn[t2 >> 12 & 63] + pn[t2 >> 6 & 63] + pn[t2 & 63];
863
+ t2 = n2 << 16 | r2 << 8 | i2, a2 += fn[t2 >> 18 & 63] + fn[t2 >> 12 & 63] + fn[t2 >> 6 & 63] + fn[t2 & 63];
864
864
  }
865
865
  return o2 ? a2.slice(0, o2 - 3) + `===`.substring(o2) : a2;
866
866
  };
867
- var bn = typeof btoa == `function` ? (e2) => btoa(e2) : un ? (e2) => Buffer.from(e2, `binary`).toString(`base64`) : yn;
868
- var xn = un ? (e2) => Buffer.from(e2).toString(`base64`) : (e2) => {
867
+ var yn = typeof btoa == `function` ? (e2) => btoa(e2) : ln ? (e2) => Buffer.from(e2, `binary`).toString(`base64`) : vn;
868
+ var bn = ln ? (e2) => Buffer.from(e2).toString(`base64`) : (e2) => {
869
869
  let t2 = 4096, n2 = [];
870
- for (let r2 = 0, i2 = e2.length; r2 < i2; r2 += t2) n2.push(U.apply(null, e2.subarray(r2, r2 + t2)));
871
- return bn(n2.join(``));
870
+ for (let r2 = 0, i2 = e2.length; r2 < i2; r2 += t2) n2.push(W.apply(null, e2.subarray(r2, r2 + t2)));
871
+ return yn(n2.join(``));
872
872
  };
873
- var Sn = (e2, t2 = false) => t2 ? _n(xn(e2)) : xn(e2);
874
- var Cn = (e2) => {
873
+ var xn = (e2, t2 = false) => t2 ? gn(bn(e2)) : bn(e2);
874
+ var Sn = (e2) => {
875
875
  if (e2.length < 2) {
876
876
  var t2 = e2.charCodeAt(0);
877
- return t2 < 128 ? e2 : t2 < 2048 ? U(192 | t2 >>> 6) + U(128 | t2 & 63) : U(224 | t2 >>> 12 & 15) + U(128 | t2 >>> 6 & 63) + U(128 | t2 & 63);
877
+ 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);
878
878
  }
879
879
  var t2 = 65536 + (e2.charCodeAt(0) - 55296) * 1024 + (e2.charCodeAt(1) - 56320);
880
- return U(240 | t2 >>> 18 & 7) + U(128 | t2 >>> 12 & 63) + U(128 | t2 >>> 6 & 63) + U(128 | t2 & 63);
881
- };
882
- var wn = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
883
- var W = (e2) => e2.replace(wn, Cn);
884
- var Tn = un ? (e2) => Buffer.from(e2, `utf8`).toString(`base64`) : fn ? (e2) => xn(fn.encode(e2)) : (e2) => bn(W(e2));
885
- var En = (e2, t2 = false) => t2 ? _n(Tn(e2)) : Tn(e2);
886
- var Dn = (e2) => En(e2, true);
887
- var On = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
888
- var kn = (e2) => {
880
+ return W(240 | t2 >>> 18 & 7) + W(128 | t2 >>> 12 & 63) + W(128 | t2 >>> 6 & 63) + W(128 | t2 & 63);
881
+ };
882
+ var Cn = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
883
+ var G = (e2) => e2.replace(Cn, Sn);
884
+ var wn = ln ? (e2) => Buffer.from(e2, `utf8`).toString(`base64`) : dn ? (e2) => bn(dn.encode(e2)) : (e2) => yn(G(e2));
885
+ var Tn = (e2, t2 = false) => t2 ? gn(wn(e2)) : wn(e2);
886
+ var En = (e2) => Tn(e2, true);
887
+ var Dn = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
888
+ var On = (e2) => {
889
889
  switch (e2.length) {
890
890
  case 4:
891
891
  var t2 = ((7 & e2.charCodeAt(0)) << 18 | (63 & e2.charCodeAt(1)) << 12 | (63 & e2.charCodeAt(2)) << 6 | 63 & e2.charCodeAt(3)) - 65536;
892
- return U((t2 >>> 10) + 55296) + U((t2 & 1023) + 56320);
892
+ return W((t2 >>> 10) + 55296) + W((t2 & 1023) + 56320);
893
893
  case 3:
894
- return U((15 & e2.charCodeAt(0)) << 12 | (63 & e2.charCodeAt(1)) << 6 | 63 & e2.charCodeAt(2));
894
+ return W((15 & e2.charCodeAt(0)) << 12 | (63 & e2.charCodeAt(1)) << 6 | 63 & e2.charCodeAt(2));
895
895
  default:
896
- return U((31 & e2.charCodeAt(0)) << 6 | 63 & e2.charCodeAt(1));
896
+ return W((31 & e2.charCodeAt(0)) << 6 | 63 & e2.charCodeAt(1));
897
897
  }
898
898
  };
899
- var An = (e2) => e2.replace(On, kn);
900
- var jn = (e2) => {
901
- if (e2 = e2.replace(/\s+/g, ``), !hn.test(e2)) throw TypeError(`malformed base64.`);
899
+ var kn = (e2) => e2.replace(Dn, On);
900
+ var An = (e2) => {
901
+ if (e2 = e2.replace(/\s+/g, ``), !mn.test(e2)) throw TypeError(`malformed base64.`);
902
902
  e2 += `==`.slice(2 - (e2.length & 3));
903
903
  let t2, n2, r2, i2 = [];
904
- for (let a2 = 0; a2 < e2.length; ) t2 = mn[e2.charAt(a2++)] << 18 | mn[e2.charAt(a2++)] << 12 | (n2 = mn[e2.charAt(a2++)]) << 6 | (r2 = mn[e2.charAt(a2++)]), n2 === 64 ? i2.push(U(t2 >> 16 & 255)) : r2 === 64 ? i2.push(U(t2 >> 16 & 255, t2 >> 8 & 255)) : i2.push(U(t2 >> 16 & 255, t2 >> 8 & 255, t2 & 255));
904
+ for (let a2 = 0; a2 < e2.length; ) t2 = pn[e2.charAt(a2++)] << 18 | pn[e2.charAt(a2++)] << 12 | (n2 = pn[e2.charAt(a2++)]) << 6 | (r2 = pn[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));
905
905
  return i2.join(``);
906
906
  };
907
- var Mn = typeof atob == `function` ? (e2) => atob(vn(e2)) : un ? (e2) => Buffer.from(e2, `base64`).toString(`binary`) : jn;
908
- var Nn = un ? (e2) => gn(Buffer.from(e2, `base64`)) : (e2) => gn(Mn(e2).split(``).map((e3) => e3.charCodeAt(0)));
909
- var Pn = (e2) => Nn(In(e2));
910
- var Fn = un ? (e2) => Buffer.from(e2, `base64`).toString(`utf8`) : dn ? (e2) => dn.decode(Nn(e2)) : (e2) => An(Mn(e2));
911
- var In = (e2) => vn(e2.replace(/[-_]/g, (e3) => e3 == `-` ? `+` : `/`));
912
- var Ln = (e2) => Fn(In(e2));
913
- var Rn = (e2) => {
907
+ var jn = typeof atob == `function` ? (e2) => atob(_n(e2)) : ln ? (e2) => Buffer.from(e2, `base64`).toString(`binary`) : An;
908
+ var Mn = ln ? (e2) => hn(Buffer.from(e2, `base64`)) : (e2) => hn(jn(e2).split(``).map((e3) => e3.charCodeAt(0)));
909
+ var Nn = (e2) => Mn(Fn(e2));
910
+ var Pn = ln ? (e2) => Buffer.from(e2, `base64`).toString(`utf8`) : un ? (e2) => un.decode(Mn(e2)) : (e2) => kn(jn(e2));
911
+ var Fn = (e2) => _n(e2.replace(/[-_]/g, (e3) => e3 == `-` ? `+` : `/`));
912
+ var In = (e2) => Pn(Fn(e2));
913
+ var Ln = (e2) => {
914
914
  if (typeof e2 != `string`) return false;
915
915
  let t2 = e2.replace(/\s+/g, ``).replace(/={0,2}$/, ``);
916
916
  return !/[^\s0-9a-zA-Z\+/]/.test(t2) || !/[^\s0-9a-zA-Z\-_]/.test(t2);
917
917
  };
918
- var zn = (e2) => ({ value: e2, enumerable: false, writable: true, configurable: true });
919
- var Bn = function() {
920
- let e2 = (e3, t2) => Object.defineProperty(String.prototype, e3, zn(t2));
918
+ var Rn = (e2) => ({ value: e2, enumerable: false, writable: true, configurable: true });
919
+ var zn = function() {
920
+ let e2 = (e3, t2) => Object.defineProperty(String.prototype, e3, Rn(t2));
921
921
  e2(`fromBase64`, function() {
922
- return Ln(this);
922
+ return In(this);
923
923
  }), e2(`toBase64`, function(e3) {
924
- return En(this, e3);
924
+ return Tn(this, e3);
925
925
  }), e2(`toBase64URI`, function() {
926
- return En(this, true);
926
+ return Tn(this, true);
927
927
  }), e2(`toBase64URL`, function() {
928
- return En(this, true);
928
+ return Tn(this, true);
929
929
  }), e2(`toUint8Array`, function() {
930
- return Pn(this);
930
+ return Nn(this);
931
931
  });
932
932
  };
933
- var Vn = function() {
934
- let e2 = (e3, t2) => Object.defineProperty(Uint8Array.prototype, e3, zn(t2));
933
+ var Bn = function() {
934
+ let e2 = (e3, t2) => Object.defineProperty(Uint8Array.prototype, e3, Rn(t2));
935
935
  e2(`toBase64`, function(e3) {
936
- return Sn(this, e3);
936
+ return xn(this, e3);
937
937
  }), e2(`toBase64URI`, function() {
938
- return Sn(this, true);
938
+ return xn(this, true);
939
939
  }), e2(`toBase64URL`, function() {
940
- return Sn(this, true);
940
+ return xn(this, true);
941
941
  });
942
942
  };
943
- var Hn = { version: cn, VERSION: ln, atob: Mn, atobPolyfill: jn, btoa: bn, btoaPolyfill: yn, fromBase64: Ln, toBase64: En, encode: En, encodeURI: Dn, encodeURL: Dn, utob: W, btou: An, decode: Ln, isValid: Rn, fromUint8Array: Sn, toUint8Array: Pn, extendString: Bn, extendUint8Array: Vn, extendBuiltins: () => {
944
- Bn(), Vn();
943
+ var Vn = { version: sn, VERSION: cn, atob: jn, atobPolyfill: An, btoa: yn, btoaPolyfill: vn, fromBase64: In, toBase64: Tn, encode: Tn, encodeURI: En, encodeURL: En, utob: G, btou: kn, decode: In, isValid: Ln, fromUint8Array: xn, toUint8Array: Nn, extendString: zn, extendUint8Array: Bn, extendBuiltins: () => {
944
+ zn(), Bn();
945
945
  } };
946
- var G = Uint8Array;
947
- var Un = Uint16Array;
948
- var Wn = Int32Array;
949
- var Gn = new G([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]);
950
- var Kn = new G([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]);
951
- var qn = new G([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
952
- var Jn = function(e2, t2) {
953
- for (var n2 = new Un(31), r2 = 0; r2 < 31; ++r2) n2[r2] = t2 += 1 << e2[r2 - 1];
954
- for (var i2 = new Wn(n2[30]), r2 = 1; r2 < 30; ++r2) for (var a2 = n2[r2]; a2 < n2[r2 + 1]; ++a2) i2[a2] = a2 - n2[r2] << 5 | r2;
946
+ var K = Uint8Array;
947
+ var Hn = Uint16Array;
948
+ var Un = Int32Array;
949
+ var Wn = 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]);
950
+ var Gn = 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]);
951
+ var Kn = new K([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
952
+ var qn = function(e2, t2) {
953
+ for (var n2 = new Hn(31), r2 = 0; r2 < 31; ++r2) n2[r2] = t2 += 1 << e2[r2 - 1];
954
+ for (var i2 = new Un(n2[30]), r2 = 1; r2 < 30; ++r2) for (var a2 = n2[r2]; a2 < n2[r2 + 1]; ++a2) i2[a2] = a2 - n2[r2] << 5 | r2;
955
955
  return { b: n2, r: i2 };
956
956
  };
957
- var Yn = Jn(Gn, 2);
958
- var Xn = Yn.b;
959
- var Zn = Yn.r;
960
- Xn[28] = 258, Zn[258] = 28;
961
- var Qn = Jn(Kn, 0);
962
- var $n = Qn.b;
963
- Qn.r;
964
- for (er = new Un(32768), K = 0; K < 32768; ++K) {
965
- tr = (K & 43690) >> 1 | (K & 21845) << 1;
966
- tr = (tr & 52428) >> 2 | (tr & 13107) << 2, tr = (tr & 61680) >> 4 | (tr & 3855) << 4, er[K] = ((tr & 65280) >> 8 | (tr & 255) << 8) >> 1;
957
+ var Jn = qn(Wn, 2);
958
+ var Yn = Jn.b;
959
+ var Xn = Jn.r;
960
+ Yn[28] = 258, Xn[258] = 28;
961
+ var Zn = qn(Gn, 0);
962
+ var Qn = Zn.b;
963
+ Zn.r;
964
+ for ($n = new Hn(32768), q = 0; q < 32768; ++q) {
965
+ er = (q & 43690) >> 1 | (q & 21845) << 1;
966
+ er = (er & 52428) >> 2 | (er & 13107) << 2, er = (er & 61680) >> 4 | (er & 3855) << 4, $n[q] = ((er & 65280) >> 8 | (er & 255) << 8) >> 1;
967
967
  }
968
- var tr;
969
968
  var er;
970
- var K;
971
- for (nr = function(e2, t2, n2) {
972
- for (var r2 = e2.length, i2 = 0, a2 = new Un(t2); i2 < r2; ++i2) e2[i2] && ++a2[e2[i2] - 1];
973
- var o2 = new Un(t2);
969
+ var $n;
970
+ var q;
971
+ for (tr = function(e2, t2, n2) {
972
+ for (var r2 = e2.length, i2 = 0, a2 = new Hn(t2); i2 < r2; ++i2) e2[i2] && ++a2[e2[i2] - 1];
973
+ var o2 = new Hn(t2);
974
974
  for (i2 = 1; i2 < t2; ++i2) o2[i2] = o2[i2 - 1] + a2[i2 - 1] << 1;
975
975
  var s2;
976
976
  if (n2) {
977
- s2 = new Un(1 << t2);
977
+ s2 = new Hn(1 << t2);
978
978
  var c2 = 15 - t2;
979
- 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[er[d2] >> c2] = l2;
980
- } else for (s2 = new Un(r2), i2 = 0; i2 < r2; ++i2) e2[i2] && (s2[i2] = er[o2[e2[i2] - 1]++] >> 15 - e2[i2]);
979
+ 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[$n[d2] >> c2] = l2;
980
+ } else for (s2 = new Hn(r2), i2 = 0; i2 < r2; ++i2) e2[i2] && (s2[i2] = $n[o2[e2[i2] - 1]++] >> 15 - e2[i2]);
981
981
  return s2;
982
- }, rr = new G(288), K = 0; K < 144; ++K) rr[K] = 8;
982
+ }, nr = new K(288), q = 0; q < 144; ++q) nr[q] = 8;
983
+ var tr;
983
984
  var nr;
985
+ var q;
986
+ for (q = 144; q < 256; ++q) nr[q] = 9;
987
+ var q;
988
+ for (q = 256; q < 280; ++q) nr[q] = 7;
989
+ var q;
990
+ for (q = 280; q < 288; ++q) nr[q] = 8;
991
+ var q;
992
+ for (rr = new K(32), q = 0; q < 32; ++q) rr[q] = 5;
984
993
  var rr;
985
- var K;
986
- for (K = 144; K < 256; ++K) rr[K] = 9;
987
- var K;
988
- for (K = 256; K < 280; ++K) rr[K] = 7;
989
- var K;
990
- for (K = 280; K < 288; ++K) rr[K] = 8;
991
- var K;
992
- for (ir = new G(32), K = 0; K < 32; ++K) ir[K] = 5;
993
- var ir;
994
- var K;
995
- var ar = nr(rr, 9, 1);
996
- var or = nr(ir, 5, 1);
997
- var sr = function(e2) {
994
+ var q;
995
+ var ir = tr(nr, 9, 1);
996
+ var ar = tr(rr, 5, 1);
997
+ var or = function(e2) {
998
998
  for (var t2 = e2[0], n2 = 1; n2 < e2.length; ++n2) e2[n2] > t2 && (t2 = e2[n2]);
999
999
  return t2;
1000
1000
  };
1001
- var q = function(e2, t2, n2) {
1001
+ var J = function(e2, t2, n2) {
1002
1002
  var r2 = t2 / 8 | 0;
1003
1003
  return (e2[r2] | e2[r2 + 1] << 8) >> (t2 & 7) & n2;
1004
1004
  };
1005
- var cr = function(e2, t2) {
1005
+ var sr = function(e2, t2) {
1006
1006
  var n2 = t2 / 8 | 0;
1007
1007
  return (e2[n2] | e2[n2 + 1] << 8 | e2[n2 + 2] << 16) >> (t2 & 7);
1008
1008
  };
1009
- var lr = function(e2) {
1009
+ var cr = function(e2) {
1010
1010
  return (e2 + 7) / 8 | 0;
1011
1011
  };
1012
- var ur = function(e2, t2, n2) {
1013
- return (t2 == null || t2 < 0) && (t2 = 0), (n2 == null || n2 > e2.length) && (n2 = e2.length), new G(e2.subarray(t2, n2));
1012
+ var lr = function(e2, t2, n2) {
1013
+ return (t2 == null || t2 < 0) && (t2 = 0), (n2 == null || n2 > e2.length) && (n2 = e2.length), new K(e2.subarray(t2, n2));
1014
1014
  };
1015
- var dr = [`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`];
1016
- var J = function(e2, t2, n2) {
1017
- var r2 = Error(t2 || dr[e2]);
1018
- if (r2.code = e2, Error.captureStackTrace && Error.captureStackTrace(r2, J), !n2) throw r2;
1015
+ var ur = [`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`];
1016
+ var Y = function(e2, t2, n2) {
1017
+ var r2 = Error(t2 || ur[e2]);
1018
+ if (r2.code = e2, Error.captureStackTrace && Error.captureStackTrace(r2, Y), !n2) throw r2;
1019
1019
  return r2;
1020
1020
  };
1021
- var fr = function(e2, t2, n2, r2) {
1021
+ var dr = function(e2, t2, n2, r2) {
1022
1022
  var i2 = e2.length, a2 = r2 ? r2.length : 0;
1023
- if (!i2 || t2.f && !t2.l) return n2 || new G(0);
1023
+ if (!i2 || t2.f && !t2.l) return n2 || new K(0);
1024
1024
  var o2 = !n2, s2 = o2 || t2.i != 2, c2 = t2.i;
1025
- o2 && (n2 = new G(i2 * 3));
1025
+ o2 && (n2 = new K(i2 * 3));
1026
1026
  var l2 = function(e3) {
1027
1027
  var t3 = n2.length;
1028
1028
  if (e3 > t3) {
1029
- var r3 = new G(Math.max(t3 * 2, e3));
1029
+ var r3 = new K(Math.max(t3 * 2, e3));
1030
1030
  r3.set(n2), n2 = r3;
1031
1031
  }
1032
1032
  }, 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;
1033
1033
  do {
1034
1034
  if (!p2) {
1035
- u2 = q(e2, d2, 1);
1036
- var v2 = q(e2, d2 + 1, 3);
1035
+ u2 = J(e2, d2, 1);
1036
+ var v2 = J(e2, d2 + 1, 3);
1037
1037
  if (d2 += 3, !v2) {
1038
- var y2 = lr(d2) + 4, b2 = e2[y2 - 4] | e2[y2 - 3] << 8, x2 = y2 + b2;
1038
+ var y2 = cr(d2) + 4, b2 = e2[y2 - 4] | e2[y2 - 3] << 8, x2 = y2 + b2;
1039
1039
  if (x2 > i2) {
1040
- c2 && J(0);
1040
+ c2 && Y(0);
1041
1041
  break;
1042
1042
  }
1043
1043
  s2 && l2(f2 + b2), n2.set(e2.subarray(y2, x2), f2), t2.b = f2 += b2, t2.p = d2 = x2 * 8, t2.f = u2;
1044
1044
  continue;
1045
1045
  }
1046
- if (v2 == 1) p2 = ar, m2 = or, h2 = 9, g2 = 5;
1046
+ if (v2 == 1) p2 = ir, m2 = ar, h2 = 9, g2 = 5;
1047
1047
  else if (v2 == 2) {
1048
- var S2 = q(e2, d2, 31) + 257, C2 = q(e2, d2 + 10, 15) + 4, w2 = S2 + q(e2, d2 + 5, 31) + 1;
1048
+ var S2 = J(e2, d2, 31) + 257, C2 = J(e2, d2 + 10, 15) + 4, w2 = S2 + J(e2, d2 + 5, 31) + 1;
1049
1049
  d2 += 14;
1050
- for (var T2 = new G(w2), ee2 = new G(19), E2 = 0; E2 < C2; ++E2) ee2[qn[E2]] = q(e2, d2 + E2 * 3, 7);
1050
+ for (var T2 = new K(w2), ee2 = new K(19), E2 = 0; E2 < C2; ++E2) ee2[Kn[E2]] = J(e2, d2 + E2 * 3, 7);
1051
1051
  d2 += C2 * 3;
1052
- for (var D2 = sr(ee2), te2 = (1 << D2) - 1, ne2 = nr(ee2, D2, 1), E2 = 0; E2 < w2; ) {
1053
- var O2 = ne2[q(e2, d2, te2)];
1054
- d2 += O2 & 15;
1055
- var y2 = O2 >> 4;
1052
+ for (var D2 = or(ee2), O2 = (1 << D2) - 1, te2 = tr(ee2, D2, 1), E2 = 0; E2 < w2; ) {
1053
+ var k2 = te2[J(e2, d2, O2)];
1054
+ d2 += k2 & 15;
1055
+ var y2 = k2 >> 4;
1056
1056
  if (y2 < 16) T2[E2++] = y2;
1057
1057
  else {
1058
- var k2 = 0, re2 = 0;
1059
- for (y2 == 16 ? (re2 = 3 + q(e2, d2, 3), d2 += 2, k2 = T2[E2 - 1]) : y2 == 17 ? (re2 = 3 + q(e2, d2, 7), d2 += 3) : y2 == 18 && (re2 = 11 + q(e2, d2, 127), d2 += 7); re2--; ) T2[E2++] = k2;
1058
+ var A2 = 0, ne2 = 0;
1059
+ for (y2 == 16 ? (ne2 = 3 + J(e2, d2, 3), d2 += 2, A2 = T2[E2 - 1]) : y2 == 17 ? (ne2 = 3 + J(e2, d2, 7), d2 += 3) : y2 == 18 && (ne2 = 11 + J(e2, d2, 127), d2 += 7); ne2--; ) T2[E2++] = A2;
1060
1060
  }
1061
1061
  }
1062
- var ie2 = T2.subarray(0, S2), A2 = T2.subarray(S2);
1063
- h2 = sr(ie2), g2 = sr(A2), p2 = nr(ie2, h2, 1), m2 = nr(A2, g2, 1);
1064
- } else J(1);
1062
+ var re2 = T2.subarray(0, S2), j2 = T2.subarray(S2);
1063
+ h2 = or(re2), g2 = or(j2), p2 = tr(re2, h2, 1), m2 = tr(j2, g2, 1);
1064
+ } else Y(1);
1065
1065
  if (d2 > _2) {
1066
- c2 && J(0);
1066
+ c2 && Y(0);
1067
1067
  break;
1068
1068
  }
1069
1069
  }
1070
1070
  s2 && l2(f2 + 131072);
1071
- for (var ae2 = (1 << h2) - 1, j2 = (1 << g2) - 1, oe2 = d2; ; oe2 = d2) {
1072
- var k2 = p2[cr(e2, d2) & ae2], M2 = k2 >> 4;
1073
- if (d2 += k2 & 15, d2 > _2) {
1074
- c2 && J(0);
1071
+ for (var ie2 = (1 << h2) - 1, M2 = (1 << g2) - 1, ae2 = d2; ; ae2 = d2) {
1072
+ var A2 = p2[sr(e2, d2) & ie2], N2 = A2 >> 4;
1073
+ if (d2 += A2 & 15, d2 > _2) {
1074
+ c2 && Y(0);
1075
1075
  break;
1076
1076
  }
1077
- if (k2 || J(2), M2 < 256) n2[f2++] = M2;
1078
- else if (M2 == 256) {
1079
- oe2 = d2, p2 = null;
1077
+ if (A2 || Y(2), N2 < 256) n2[f2++] = N2;
1078
+ else if (N2 == 256) {
1079
+ ae2 = d2, p2 = null;
1080
1080
  break;
1081
1081
  } else {
1082
- var se2 = M2 - 254;
1083
- if (M2 > 264) {
1084
- var E2 = M2 - 257, N2 = Gn[E2];
1085
- se2 = q(e2, d2, (1 << N2) - 1) + Xn[E2], d2 += N2;
1082
+ var oe2 = N2 - 254;
1083
+ if (N2 > 264) {
1084
+ var E2 = N2 - 257, P2 = Wn[E2];
1085
+ oe2 = J(e2, d2, (1 << P2) - 1) + Yn[E2], d2 += P2;
1086
1086
  }
1087
- var ce2 = m2[cr(e2, d2) & j2], le2 = ce2 >> 4;
1088
- ce2 || J(3), d2 += ce2 & 15;
1089
- var A2 = $n[le2];
1090
- if (le2 > 3) {
1091
- var N2 = Kn[le2];
1092
- A2 += cr(e2, d2) & (1 << N2) - 1, d2 += N2;
1087
+ var se2 = m2[sr(e2, d2) & M2], ce2 = se2 >> 4;
1088
+ se2 || Y(3), d2 += se2 & 15;
1089
+ var j2 = Qn[ce2];
1090
+ if (ce2 > 3) {
1091
+ var P2 = Gn[ce2];
1092
+ j2 += sr(e2, d2) & (1 << P2) - 1, d2 += P2;
1093
1093
  }
1094
1094
  if (d2 > _2) {
1095
- c2 && J(0);
1095
+ c2 && Y(0);
1096
1096
  break;
1097
1097
  }
1098
1098
  s2 && l2(f2 + 131072);
1099
- var ue2 = f2 + se2;
1100
- if (f2 < A2) {
1101
- var de2 = a2 - A2, fe2 = Math.min(A2, ue2);
1102
- for (de2 + f2 < 0 && J(3); f2 < fe2; ++f2) n2[f2] = r2[de2 + f2];
1099
+ var le2 = f2 + oe2;
1100
+ if (f2 < j2) {
1101
+ var ue2 = a2 - j2, de2 = Math.min(j2, le2);
1102
+ for (ue2 + f2 < 0 && Y(3); f2 < de2; ++f2) n2[f2] = r2[ue2 + f2];
1103
1103
  }
1104
- for (; f2 < ue2; ++f2) n2[f2] = n2[f2 - A2];
1104
+ for (; f2 < le2; ++f2) n2[f2] = n2[f2 - j2];
1105
1105
  }
1106
1106
  }
1107
- t2.l = p2, t2.p = oe2, t2.b = f2, t2.f = u2, p2 && (u2 = 1, t2.m = h2, t2.d = m2, t2.n = g2);
1107
+ t2.l = p2, t2.p = ae2, t2.b = f2, t2.f = u2, p2 && (u2 = 1, t2.m = h2, t2.d = m2, t2.n = g2);
1108
1108
  } while (!u2);
1109
- return f2 != n2.length && o2 ? ur(n2, 0, f2) : n2.subarray(0, f2);
1109
+ return f2 != n2.length && o2 ? lr(n2, 0, f2) : n2.subarray(0, f2);
1110
1110
  };
1111
- var pr = new G(0);
1112
- var mr = function(e2) {
1113
- (e2[0] != 31 || e2[1] != 139 || e2[2] != 8) && J(6, `invalid gzip data`);
1111
+ var fr = new K(0);
1112
+ var pr = function(e2) {
1113
+ (e2[0] != 31 || e2[1] != 139 || e2[2] != 8) && Y(6, `invalid gzip data`);
1114
1114
  var t2 = e2[3], n2 = 10;
1115
1115
  t2 & 4 && (n2 += (e2[10] | e2[11] << 8) + 2);
1116
1116
  for (var r2 = (t2 >> 3 & 1) + (t2 >> 4 & 1); r2 > 0; r2 -= !e2[n2++]) ;
1117
1117
  return n2 + (t2 & 2);
1118
1118
  };
1119
- var hr = function(e2) {
1119
+ var mr = function(e2) {
1120
1120
  var t2 = e2.length;
1121
1121
  return (e2[t2 - 4] | e2[t2 - 3] << 8 | e2[t2 - 2] << 16 | e2[t2 - 1] << 24) >>> 0;
1122
1122
  };
1123
- function gr(e2, t2) {
1124
- var n2 = mr(e2);
1125
- return n2 + 8 > e2.length && J(6, `invalid gzip data`), fr(e2.subarray(n2, -8), { i: 2 }, t2 && t2.out || new G(hr(e2)), t2 && t2.dictionary);
1123
+ function hr(e2, t2) {
1124
+ var n2 = pr(e2);
1125
+ return n2 + 8 > e2.length && Y(6, `invalid gzip data`), dr(e2.subarray(n2, -8), { i: 2 }, t2 && t2.out || new K(mr(e2)), t2 && t2.dictionary);
1126
1126
  }
1127
- var _r = typeof TextDecoder < `u` && new TextDecoder();
1127
+ var gr = typeof TextDecoder < `u` && new TextDecoder();
1128
1128
  try {
1129
- _r.decode(pr, { stream: true });
1129
+ gr.decode(fr, { stream: true });
1130
1130
  } catch {
1131
1131
  }
1132
- var vr = /* @__PURE__ */ new Set([`APPOINTMENT`, `CLASS`, `COURSE`]);
1133
- var yr = new Set(sn);
1134
- function Y(e2) {
1132
+ var _r = /* @__PURE__ */ new Set([`APPOINTMENT`, `CLASS`, `COURSE`]);
1133
+ var vr = new Set(on);
1134
+ function X(e2) {
1135
1135
  return typeof e2 == `string` ? e2 : void 0;
1136
1136
  }
1137
- function br(e2) {
1137
+ function yr(e2) {
1138
1138
  return typeof e2 == `number` && Number.isFinite(e2) ? e2 : void 0;
1139
1139
  }
1140
- function xr(e2) {
1140
+ function br(e2) {
1141
1141
  return typeof e2 == `boolean` ? e2 : void 0;
1142
1142
  }
1143
- function Sr(e2) {
1143
+ function xr(e2) {
1144
1144
  if (Array.isArray(e2)) return e2.filter((e3) => typeof e3 == `string`);
1145
1145
  }
1146
- function Cr(e2) {
1146
+ function Sr(e2) {
1147
1147
  return typeof e2 == `object` && !!e2;
1148
1148
  }
1149
- function wr(e2) {
1150
- if (!Cr(e2)) return null;
1151
- let t2 = Y(e2.t);
1149
+ function Cr(e2) {
1150
+ if (!Sr(e2)) return null;
1151
+ let t2 = X(e2.t);
1152
1152
  if (t2 === void 0) return null;
1153
- let n2 = { type: t2, ids: Sr(e2.d) ?? [] }, r2 = xr(e2.n);
1153
+ let n2 = { type: t2, ids: xr(e2.d) ?? [] }, r2 = br(e2.n);
1154
1154
  return r2 !== void 0 && (n2.anyResource = r2), n2;
1155
1155
  }
1156
- function Tr(e2) {
1157
- if (!Cr(e2)) return null;
1158
- let t2 = br(e2.p), n2 = Sr(e2.h);
1156
+ function wr(e2) {
1157
+ if (!Sr(e2)) return null;
1158
+ let t2 = yr(e2.p), n2 = xr(e2.h);
1159
1159
  if (t2 === void 0 && n2 === void 0) return null;
1160
1160
  let r2 = {};
1161
1161
  return t2 !== void 0 && (r2.numberOfParticipants = t2), n2 !== void 0 && (r2.choices = n2), r2;
1162
1162
  }
1163
- function Er(e2) {
1164
- if (!Cr(e2)) return null;
1165
- let t2 = Y(e2.i), n2 = br(e2.q);
1163
+ function Tr(e2) {
1164
+ if (!Sr(e2)) return null;
1165
+ let t2 = X(e2.i), n2 = yr(e2.q);
1166
1166
  return t2 === void 0 || n2 === void 0 ? null : { id: t2, quantity: n2 };
1167
1167
  }
1168
- function Dr(e2, t2) {
1168
+ function Er(e2, t2) {
1169
1169
  if (!Array.isArray(e2)) return;
1170
1170
  let n2 = e2.map(t2).filter((e3) => e3 !== null);
1171
1171
  return n2.length ? n2 : void 0;
1172
1172
  }
1173
- function Or(e2) {
1174
- if (!Cr(e2)) return null;
1175
- let t2 = Y(e2.i);
1173
+ function Dr(e2) {
1174
+ if (!Sr(e2)) return null;
1175
+ let t2 = X(e2.i);
1176
1176
  if (t2 === void 0) return null;
1177
- let n2 = { serviceId: t2 }, r2 = Y(e2.g);
1177
+ let n2 = { serviceId: t2 }, r2 = X(e2.g);
1178
1178
  r2 !== void 0 && (n2.slug = r2);
1179
1179
  let i2 = function(e3) {
1180
- let t3 = Y(e3);
1181
- if (t3 !== void 0 && vr.has(t3)) return t3;
1180
+ let t3 = X(e3);
1181
+ if (t3 !== void 0 && _r.has(t3)) return t3;
1182
1182
  }(e2.y);
1183
1183
  i2 !== void 0 && (n2.serviceType = i2);
1184
- let a2 = Y(e2.t0);
1184
+ let a2 = X(e2.t0);
1185
1185
  a2 !== void 0 && (n2.slotStart = a2);
1186
- let o2 = Y(e2.t1);
1186
+ let o2 = X(e2.t1);
1187
1187
  o2 !== void 0 && (n2.slotEnd = o2);
1188
- let s2 = Y(e2.e);
1188
+ let s2 = X(e2.e);
1189
1189
  s2 !== void 0 && (n2.eventId = s2);
1190
- let c2 = Y(e2.c);
1190
+ let c2 = X(e2.c);
1191
1191
  c2 !== void 0 && (n2.scheduleId = c2);
1192
- let l2 = Y(e2.k);
1192
+ let l2 = X(e2.k);
1193
1193
  l2 !== void 0 && (n2.sessionId = l2);
1194
- let u2 = Y(e2.l);
1194
+ let u2 = X(e2.l);
1195
1195
  u2 !== void 0 && (n2.locationId = u2);
1196
- let d2 = Y(e2.lt);
1196
+ let d2 = X(e2.lt);
1197
1197
  d2 !== `BUSINESS` && d2 !== `CUSTOM` && d2 !== `CUSTOMER` || (n2.locationType = d2);
1198
- let f2 = Dr(e2.r, wr);
1198
+ let f2 = Er(e2.r, Cr);
1199
1199
  f2 && (n2.resources = f2);
1200
- let p2 = Dr(e2.x, Tr);
1200
+ let p2 = Er(e2.x, wr);
1201
1201
  p2 && (n2.selectedVariants = p2);
1202
- let m2 = Dr(e2.a, Er);
1202
+ let m2 = Er(e2.a, Tr);
1203
1203
  m2 && (n2.addOns = m2);
1204
- let h2 = Y(e2.dc);
1204
+ let h2 = X(e2.dc);
1205
1205
  h2 && (n2.durationChoiceId = h2);
1206
- let g2 = br(e2.dm);
1206
+ let g2 = yr(e2.dm);
1207
1207
  g2 !== void 0 && Number.isInteger(g2) && g2 > 0 && (n2.durationInMinutes = g2);
1208
- let _2 = Y(e2.rg);
1209
- return _2 !== void 0 && yr.has(_2) && (n2.requestedGender = _2), n2;
1208
+ let _2 = X(e2.rg);
1209
+ return _2 !== void 0 && vr.has(_2) && (n2.requestedGender = _2), n2;
1210
1210
  }
1211
- function kr(e2) {
1212
- if (!Cr(e2)) return null;
1213
- let t2 = Y(e2.m);
1211
+ function Or(e2) {
1212
+ if (!Sr(e2)) return null;
1213
+ let t2 = X(e2.m);
1214
1214
  if (t2 !== `single` && t2 !== `multi` || !Array.isArray(e2.s)) return null;
1215
- let n2 = { mode: t2, services: e2.s.map(Or).filter((e3) => e3 !== null) }, r2 = Y(e2.z);
1216
- return r2 !== void 0 && (n2.timezone = r2), true === xr(e2.cp) && (n2.wantsPromoCode = true), n2;
1215
+ let n2 = { mode: t2, services: e2.s.map(Dr).filter((e3) => e3 !== null) }, r2 = X(e2.z);
1216
+ return r2 !== void 0 && (n2.timezone = r2), true === br(e2.cp) && (n2.wantsPromoCode = true), n2;
1217
1217
  }
1218
1218
  new TextEncoder();
1219
- var Ar = new TextDecoder();
1220
- function jr(e2) {
1219
+ var kr = new TextDecoder();
1220
+ function Ar(e2) {
1221
1221
  if (!e2 || e2.length < 2) return null;
1222
1222
  try {
1223
- let t2 = e2[0], n2 = Hn.toUint8Array(e2.slice(1)), r2;
1223
+ let t2 = e2[0], n2 = Vn.toUint8Array(e2.slice(1)), r2;
1224
1224
  if (t2 === `1`) r2 = n2;
1225
1225
  else {
1226
1226
  if (t2 !== `2`) return null;
1227
- r2 = gr(n2);
1227
+ r2 = hr(n2);
1228
1228
  }
1229
- return kr(JSON.parse(Ar.decode(r2)));
1229
+ return Or(JSON.parse(kr.decode(r2)));
1230
1230
  } catch {
1231
1231
  return null;
1232
1232
  }
1233
1233
  }
1234
- function Mr(e2) {
1235
- return e2;
1236
- }
1237
- var Nr = Mr(`@wix/site-service-pages`);
1238
- function Pr(e2) {
1239
- return e2;
1240
- }
1241
- var Fr = Pr;
1242
- var Ir = Fr(`@wix/viewer-service-environment`);
1243
- var Lr = Fr(`@wix/viewer-service-router`);
1244
- function Rr(e2) {
1245
- return e2;
1246
- }
1247
- var zr = Rr(`@wix/site-service-url`);
1248
- function Br(e2) {
1234
+ function jr(e2) {
1249
1235
  return e2;
1250
1236
  }
1251
- var Vr = Br(`@wix/site-service-renderer-configuration`);
1252
- var Hr = `13d21c63-b5ec-5912-8397-c3a5ddb27a97`;
1253
- var Ur = `shopping_cart`;
1254
- var Wr = `thank_you_page`;
1255
- var Gr = `1cd44cf8-756f-41c3-bd90-3e2ffcaf1155`;
1256
- var Kr = function(e2) {
1237
+ var Mr = jr(`@wix/site-service-editor-context`);
1238
+ var Nr = jr(`@wix/site-service-pages`);
1239
+ var Pr = jr(`@wix/site-service-router`);
1240
+ var Fr = jr(`@wix/site-service-url`);
1241
+ var Ir = jr(`@wix/site-service-renderer-configuration`);
1242
+ var Lr = `13d21c63-b5ec-5912-8397-c3a5ddb27a97`;
1243
+ var Rr = `shopping_cart`;
1244
+ var zr = `thank_you_page`;
1245
+ var Br = `1cd44cf8-756f-41c3-bd90-3e2ffcaf1155`;
1246
+ var Vr = function(e2) {
1257
1247
  return e2.BOOK_ONLINE = `bookingsBookOnline`, e2.SERVICE_PAGE = `bookingsServicePage`, e2.CALENDAR_PAGE = `bookingsCalendar`, e2.FORM_PAGE = `bookingsForm`, e2;
1258
1248
  }({});
1259
- var qr = `{{(.*?)}}`;
1260
- var Jr = `[{{}}]`;
1261
- var Yr = `([^/]+)`;
1262
- var Xr;
1249
+ var Hr = `{{(.*?)}}`;
1250
+ var Ur = `[{{}}]`;
1251
+ var Wr = `([^/]+)`;
1252
+ var Gr;
1263
1253
  (function(e2) {
1264
1254
  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`;
1265
- })(Xr ||= {});
1266
- var X;
1255
+ })(Gr ||= {});
1256
+ var Z;
1267
1257
  (function(e2) {
1268
1258
  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`;
1269
- })(X ||= {});
1270
- var Zr = {};
1271
- var Qr = (Zr[X.PRODUCT_PAGE] = { variables: [`slug`], required: [`slug`] }, Zr);
1272
- var $r = `{{main-mapping}}`;
1259
+ })(Z ||= {});
1260
+ var Kr = {};
1261
+ var qr = (Kr[Z.PRODUCT_PAGE] = { variables: [`slug`], required: [`slug`] }, Kr);
1262
+ var Jr = `{{main-mapping}}`;
1263
+ var Yr = {};
1264
+ var Xr;
1265
+ var Zr = (Yr[Z.BLOG_POST] = { variables: [`slug`], required: [`slug`], subMappings: (Xr = {}, Xr[Z.BLOG_POST_EDIT] = { defaultMapping: `${Jr}/edit` }, Xr[Z.BLOG_POST_PREVIEW] = { required: [`instance`], defaultMapping: `${Jr}/preview/{{instance}}` }, Xr) }, Yr);
1266
+ var Qr = {};
1267
+ var $r = (Qr[Z.BLOG_CATEGORY] = { variables: [`slug`], required: [`slug`], defaultPrefix: `categories` }, Qr);
1273
1268
  var ei = {};
1274
1269
  var ti;
1275
- var ni = (ei[X.BLOG_POST] = { variables: [`slug`], required: [`slug`], subMappings: (ti = {}, ti[X.BLOG_POST_EDIT] = { defaultMapping: `${$r}/edit` }, ti[X.BLOG_POST_PREVIEW] = { required: [`instance`], defaultMapping: `${$r}/preview/{{instance}}` }, ti) }, ei);
1276
- var ri = {};
1277
- var ii = (ri[X.BLOG_CATEGORY] = { variables: [`slug`], required: [`slug`], defaultPrefix: `categories` }, ri);
1278
- var ai = {};
1279
- var oi;
1280
- var si;
1281
- var ci = (ai[X.FORUM_POST] = { variables: [`categorySlug`, `postSlug`], required: [`categorySlug`, `postSlug`], subMappings: (oi = {}, oi[X.FORUM_POST_EDIT] = { defaultMapping: `${$r}/edit` }, oi[X.FORUM_POST_PAGINATION] = { required: [`page`], defaultMapping: `${$r}/p-{{page}}` }, oi[X.FORUM_POST_DEEP_LINK_DATA] = { required: [`deepLinkData`], defaultMapping: `${$r}/dl-{{deepLinkData}}` }, oi[X.FORUM_POST_PAGINATION_AND_DEEP_LINK_DATA] = { required: [`page`, `deepLinkData`], defaultMapping: `${$r}/p-{{page}}/dl-{{deepLinkData}}` }, oi) }, ai[X.FORUM_CATEGORY] = { variables: [`slug`], required: [`slug`], subMappings: (si = {}, si[X.FORUM_CATEGORY_CREATE_POST] = { defaultMapping: `${$r}/create-post` }, si[X.FORUM_CATEGORY_CREATE_QUESTION] = { defaultMapping: `${$r}/create-question` }, si[X.FORUM_CATEGORY_PAGINATION] = { required: [`page`], defaultMapping: `${$r}/p-{{page}}` }, si) }, ai);
1282
- var li = {};
1283
- var ui = (li[X.GROUP] = { variables: [`groupId`, `tabName`], required: [`groupId`, `tabName`] }, li[X.GROUP_POST] = { variables: [`groupId`, `tabName`, `postId`], required: [`groupId`, `tabName`, `postId`] }, li);
1284
- var di = {};
1285
- var fi = (di[X.BOOKINGS_SERVICE] = { variables: [`slug`], required: [`slug`], defaultPrefix: `service-page` }, di);
1286
- var pi = {};
1287
- var mi = (pi[X.CHALLENGES_PAGE] = { variables: [`slug`], required: [`slug`], defaultPrefix: `challenge-page` }, pi);
1288
- var hi = {};
1289
- var gi = (hi[Xr.product_page] = Qr, hi[Xr.post] = ni, hi[Xr.blog] = ii, hi[Xr.forum] = ci, hi[Xr.group] = ui, hi[Xr.bookings] = fi, hi[Xr.challenges] = mi, hi);
1290
- var _i = function() {
1291
- return _i = Object.assign || function(e2) {
1270
+ var ni;
1271
+ var ri = (ei[Z.FORUM_POST] = { variables: [`categorySlug`, `postSlug`], required: [`categorySlug`, `postSlug`], subMappings: (ti = {}, ti[Z.FORUM_POST_EDIT] = { defaultMapping: `${Jr}/edit` }, ti[Z.FORUM_POST_PAGINATION] = { required: [`page`], defaultMapping: `${Jr}/p-{{page}}` }, ti[Z.FORUM_POST_DEEP_LINK_DATA] = { required: [`deepLinkData`], defaultMapping: `${Jr}/dl-{{deepLinkData}}` }, ti[Z.FORUM_POST_PAGINATION_AND_DEEP_LINK_DATA] = { required: [`page`, `deepLinkData`], defaultMapping: `${Jr}/p-{{page}}/dl-{{deepLinkData}}` }, ti) }, ei[Z.FORUM_CATEGORY] = { variables: [`slug`], required: [`slug`], subMappings: (ni = {}, ni[Z.FORUM_CATEGORY_CREATE_POST] = { defaultMapping: `${Jr}/create-post` }, ni[Z.FORUM_CATEGORY_CREATE_QUESTION] = { defaultMapping: `${Jr}/create-question` }, ni[Z.FORUM_CATEGORY_PAGINATION] = { required: [`page`], defaultMapping: `${Jr}/p-{{page}}` }, ni) }, ei);
1272
+ var ii = {};
1273
+ var ai = (ii[Z.GROUP] = { variables: [`groupId`, `tabName`], required: [`groupId`, `tabName`] }, ii[Z.GROUP_POST] = { variables: [`groupId`, `tabName`, `postId`], required: [`groupId`, `tabName`, `postId`] }, ii);
1274
+ var oi = {};
1275
+ var si = (oi[Z.BOOKINGS_SERVICE] = { variables: [`slug`], required: [`slug`], defaultPrefix: `service-page` }, oi);
1276
+ var ci = {};
1277
+ var li = (ci[Z.CHALLENGES_PAGE] = { variables: [`slug`], required: [`slug`], defaultPrefix: `challenge-page` }, ci);
1278
+ var ui = {};
1279
+ var di = (ui[Gr.product_page] = qr, ui[Gr.post] = Zr, ui[Gr.blog] = $r, ui[Gr.forum] = ri, ui[Gr.group] = ai, ui[Gr.bookings] = si, ui[Gr.challenges] = li, ui);
1280
+ var fi = function() {
1281
+ return fi = Object.assign || function(e2) {
1292
1282
  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]);
1293
1283
  return e2;
1294
- }, _i.apply(this, arguments);
1284
+ }, fi.apply(this, arguments);
1295
1285
  };
1296
- function vi(e2) {
1286
+ function pi(e2) {
1297
1287
  var t2 = typeof Symbol == `function` && Symbol.iterator, n2 = t2 && e2[t2], r2 = 0;
1298
1288
  if (n2) return n2.call(e2);
1299
1289
  if (e2 && typeof e2.length == `number`) return { next: function() {
@@ -1301,7 +1291,7 @@ function vi(e2) {
1301
1291
  } };
1302
1292
  throw TypeError(t2 ? `Object is not iterable.` : `Symbol.iterator is not defined.`);
1303
1293
  }
1304
- function Z(e2, t2) {
1294
+ function Q(e2, t2) {
1305
1295
  var n2 = typeof Symbol == `function` && e2[Symbol.iterator];
1306
1296
  if (!n2) return e2;
1307
1297
  var r2 = n2.call(e2), i2, a2 = [], o2;
@@ -1318,190 +1308,190 @@ function Z(e2, t2) {
1318
1308
  }
1319
1309
  return a2;
1320
1310
  }
1321
- function yi(e2, t2, n2) {
1311
+ function mi(e2, t2, n2) {
1322
1312
  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]);
1323
1313
  return e2.concat(a2 || Array.prototype.slice.call(t2));
1324
1314
  }
1325
- var bi = function(e2) {
1326
- return Object.values(xi()).some(function(t2) {
1315
+ var hi = function(e2) {
1316
+ return Object.values(gi()).some(function(t2) {
1327
1317
  return !!t2?.subMappings?.[e2];
1328
1318
  });
1329
1319
  };
1330
- var xi = function() {
1331
- return Object.values(gi).reduce(function(e2, t2) {
1332
- return _i(_i({}, e2), t2);
1320
+ var gi = function() {
1321
+ return Object.values(di).reduce(function(e2, t2) {
1322
+ return fi(fi({}, e2), t2);
1333
1323
  }, {}) || {};
1334
1324
  };
1335
- var Si = function(e2) {
1336
- var t2 = xi()[e2];
1337
- return !t2 && bi(e2) && console.warn(`You cannot get variables schema for subMappings key (${e2}).`), t2;
1325
+ var _i = function(e2) {
1326
+ var t2 = gi()[e2];
1327
+ return !t2 && hi(e2) && console.warn(`You cannot get variables schema for subMappings key (${e2}).`), t2;
1338
1328
  };
1339
- var Ci = function(e2) {
1340
- return Object.entries(gi).filter(function(t2) {
1341
- var n2 = Z(t2, 2)[1];
1329
+ var vi = function(e2) {
1330
+ return Object.entries(di).filter(function(t2) {
1331
+ var n2 = Q(t2, 2)[1];
1342
1332
  return Object.keys(n2).includes(e2);
1343
1333
  }).map(function(e3) {
1344
- return Z(e3, 1)[0];
1334
+ return Q(e3, 1)[0];
1345
1335
  })[0];
1346
1336
  };
1347
- var wi = function(e2) {
1348
- return Object.entries(xi()).find(function(t2) {
1349
- var n2 = Z(t2, 2);
1337
+ var yi = function(e2) {
1338
+ return Object.entries(gi()).find(function(t2) {
1339
+ var n2 = Q(t2, 2);
1350
1340
  return n2[0], !!n2[1]?.subMappings?.[e2];
1351
1341
  });
1352
1342
  };
1353
- var Ti = function(e2) {
1343
+ var bi = function(e2) {
1354
1344
  var t2 = [];
1355
- if (bi(e2)) {
1356
- var n2 = Z(wi(e2), 2);
1345
+ if (hi(e2)) {
1346
+ var n2 = Q(yi(e2), 2);
1357
1347
  n2[0];
1358
1348
  var r2 = n2[1];
1359
- t2.push.apply(t2, yi(yi([], Z(r2?.required || []), false), Z(r2?.subMappings?.[e2]?.required || []), false));
1360
- } else t2.push.apply(t2, yi([], Z(Si(e2)?.required || []), false));
1349
+ t2.push.apply(t2, mi(mi([], Q(r2?.required || []), false), Q(r2?.subMappings?.[e2]?.required || []), false));
1350
+ } else t2.push.apply(t2, mi([], Q(_i(e2)?.required || []), false));
1361
1351
  return t2;
1362
1352
  };
1363
- var Ei = function(e2, t2) {
1353
+ var xi = function(e2, t2) {
1364
1354
  var n2;
1365
1355
  return t2 === void 0 && (t2 = ``), (n2 = e2?.main)?.find?.call(n2, function(e3) {
1366
1356
  return e3.key === t2;
1367
1357
  });
1368
1358
  };
1369
- var Di = function(e2, t2) {
1359
+ var Si = function(e2, t2) {
1370
1360
  return Error(`Url Mappings Error - [${e2}]: ${t2}`);
1371
1361
  };
1372
- var Oi = Object.values(X);
1373
- var ki = Di(`key`, `must be one of: ${Oi.toString()}`);
1374
- var Ai = function(e2) {
1375
- if (typeof e2 != `string` || !Oi.includes(e2)) return ki;
1362
+ var Ci = Object.values(Z);
1363
+ var wi = Si(`key`, `must be one of: ${Ci.toString()}`);
1364
+ var Ti = function(e2) {
1365
+ if (typeof e2 != `string` || !Ci.includes(e2)) return wi;
1376
1366
  };
1377
- var ji = Di(`itemData`, `must be on object with string as value, for example: { "slug": "shoes" }`);
1378
- var Mi = function(e2) {
1367
+ var Ei = Si(`itemData`, `must be on object with string as value, for example: { "slug": "shoes" }`);
1368
+ var Di = function(e2) {
1379
1369
  if (typeof e2 != `object` || !e2 || !Object.values(e2).every(function(e3) {
1380
1370
  return typeof e3 == `string`;
1381
- }) || Array.isArray(e2)) return ji;
1371
+ }) || Array.isArray(e2)) return Ei;
1382
1372
  };
1383
- var Ni = Di(`itemData`, `must have required variables, for example: { "slug": "shoes" }`);
1384
- var Pi = function(e2, t2) {
1373
+ var Oi = Si(`itemData`, `must have required variables, for example: { "slug": "shoes" }`);
1374
+ var ki = function(e2, t2) {
1385
1375
  try {
1386
- var n2 = Ti(e2);
1376
+ var n2 = bi(e2);
1387
1377
  if (!n2.every(function(e3) {
1388
1378
  return !!t2[e3];
1389
1379
  }) || !n2.length) throw Error();
1390
1380
  } catch {
1391
- return Ni;
1381
+ return Oi;
1392
1382
  }
1393
1383
  };
1394
- var Fi = function(e2) {
1384
+ var Ai = function(e2) {
1395
1385
  var t2 = e2.key, n2 = e2.itemData;
1396
- return [Ai(t2), Mi(n2), Pi(t2, n2)].find(Boolean);
1386
+ return [Ti(t2), Di(n2), ki(t2, n2)].find(Boolean);
1397
1387
  };
1398
- var Ii = function(e2) {
1388
+ var ji = function(e2) {
1399
1389
  return function(t2) {
1400
- var n2 = new RegExp(Jr, `g`), r2 = t2.replace(n2, ``);
1390
+ var n2 = new RegExp(Ur, `g`), r2 = t2.replace(n2, ``);
1401
1391
  return e2?.[r2];
1402
1392
  };
1403
1393
  };
1404
- var Li = function(e2, t2, n2, r2) {
1394
+ var Mi = function(e2, t2, n2, r2) {
1405
1395
  e2 === void 0 && (e2 = { main: [] }), r2 === void 0 && (r2 = {});
1406
- var i2 = Fi({ key: t2, itemData: n2 });
1396
+ var i2 = Ai({ key: t2, itemData: n2 });
1407
1397
  if (i2) throw i2;
1408
- var a2 = (Ei(e2, t2) || {}).mapping, o2 = (r2 || {}).baseUrl;
1398
+ var a2 = (xi(e2, t2) || {}).mapping, o2 = (r2 || {}).baseUrl;
1409
1399
  if (o2 ??= ``, o2 = o2.endsWith(`/`) ? o2?.slice(0, -1) : o2, a2 && typeof a2 == `string`) {
1410
- var s2 = new RegExp(qr, `g`), c2 = a2.replace(s2, Ii(n2));
1400
+ var s2 = new RegExp(Hr, `g`), c2 = a2.replace(s2, ji(n2));
1411
1401
  return o2.concat(`/${c2}`);
1412
1402
  }
1413
1403
  };
1414
- var Ri = /[.*+?^$()|]/g;
1415
- var zi = function(e2) {
1416
- var t2 = e2.replace(Ri, `\\$&`).replace(new RegExp(qr, `g`), Yr);
1404
+ var Ni = /[.*+?^$()|]/g;
1405
+ var Pi = function(e2) {
1406
+ var t2 = e2.replace(Ni, `\\$&`).replace(new RegExp(Hr, `g`), Wr);
1417
1407
  return RegExp(`^${t2}$`);
1418
1408
  };
1419
- var Bi = function(e2, t2) {
1409
+ var Fi = function(e2, t2) {
1420
1410
  return e2 === void 0 && (e2 = []), e2.find(function(e3) {
1421
- return zi(e3).test(t2);
1411
+ return Pi(e3).test(t2);
1422
1412
  });
1423
1413
  };
1424
- Di(`url`, `Url must be a string`);
1425
- var Vi = function(e2) {
1414
+ Si(`url`, `Url must be a string`);
1415
+ var Ii = function(e2) {
1426
1416
  return [` `, ` `, `
1427
1417
  `].every(function(t2) {
1428
1418
  return !e2?.includes?.call(e2, t2);
1429
1419
  });
1430
1420
  };
1431
- var Hi = function(e2) {
1432
- return e2?.length <= ea.MAX_URL_MAPPING_LENGTH;
1421
+ var Li = function(e2) {
1422
+ return e2?.length <= Yi.MAX_URL_MAPPING_LENGTH;
1433
1423
  };
1434
- var Ui = function(e2) {
1424
+ var Ri = function(e2) {
1435
1425
  return e2?.split(`/`).every(Boolean);
1436
1426
  };
1437
- var Wi = function(e2, t2) {
1427
+ var zi = function(e2, t2) {
1438
1428
  var n2 = t2.urlMappingKey;
1439
- return Ti(n2)?.every(function(t3) {
1429
+ return bi(n2)?.every(function(t3) {
1440
1430
  return e2?.includes(`{{${t3}}}`);
1441
1431
  });
1442
1432
  };
1443
- var Gi = function(e2) {
1444
- return (e2.match(new RegExp(qr, `g`))?.length || 0) <= 1;
1433
+ var Bi = function(e2) {
1434
+ return (e2.match(new RegExp(Hr, `g`))?.length || 0) <= 1;
1445
1435
  };
1446
- var Ki = function(e2) {
1447
- return e2?.split(`/`).every(Gi);
1436
+ var Vi = function(e2) {
1437
+ return e2?.split(`/`).every(Bi);
1448
1438
  };
1449
- var qi = function(e2) {
1439
+ var Hi = function(e2) {
1450
1440
  return [e2.publishedPrefix, e2.savedPrefix].filter(Boolean);
1451
1441
  };
1452
- var Ji = function(e2, t2) {
1442
+ var Ui = function(e2, t2) {
1453
1443
  return t2 === void 0 && (t2 = []), function(n2, r2) {
1454
1444
  var i2 = n2.split(`/`), a2 = n2 === r2;
1455
1445
  if (i2.length < 1 || a2) return true;
1456
- var o2 = Z(r2.split(`/`), 1)[0], s2 = Z(i2, 1)[0];
1446
+ var o2 = Q(r2.split(`/`), 1)[0], s2 = Q(i2, 1)[0];
1457
1447
  return t2.includes(s2) ? true : e2.every(function(e3) {
1458
1448
  return e3 === o2 || e3 !== s2;
1459
1449
  });
1460
1450
  };
1461
1451
  };
1462
- var Yi = function(e2, t2) {
1452
+ var Wi = function(e2, t2) {
1463
1453
  var n2 = t2.pathPrefixes;
1464
- return Ji(Object.values(n2).map(function(e3) {
1454
+ return Ui(Object.values(n2).map(function(e3) {
1465
1455
  return e3.publishedPrefix;
1466
- }).filter(Boolean), qi(t2.pathPrefix))(e2, t2.defaultMapping.defaultPublished);
1456
+ }).filter(Boolean), Hi(t2.pathPrefix))(e2, t2.defaultMapping.defaultPublished);
1467
1457
  };
1468
- var Xi = function(e2, t2) {
1458
+ var Gi = function(e2, t2) {
1469
1459
  var n2 = t2.urlMappingKey, r2 = t2.urlMappings;
1470
- return !Bi(r2.main?.filter(function(e3) {
1460
+ return !Fi(r2.main?.filter(function(e3) {
1471
1461
  return n2 !== e3.key;
1472
1462
  }).map(function(e3) {
1473
1463
  return e3.mapping;
1474
1464
  }), e2);
1475
1465
  };
1476
- var Zi = function(e2) {
1477
- e2 = e2.replace(new RegExp(qr, `ig`), ``);
1466
+ var Ki = function(e2) {
1467
+ e2 = e2.replace(new RegExp(Hr, `ig`), ``);
1478
1468
  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, ``);
1479
1469
  return n2 && r2;
1480
1470
  };
1481
- var Qi = function(e2) {
1482
- var t2 = Z(e2, 1)[0], n2 = e2.slice(-1);
1471
+ var qi = function(e2) {
1472
+ var t2 = Q(e2, 1)[0], n2 = e2.slice(-1);
1483
1473
  return t2 !== `/` && n2 !== `/`;
1484
1474
  };
1485
- var $i = function(e2, t2) {
1475
+ var Ji = function(e2, t2) {
1486
1476
  var n2 = t2.pathPrefixes;
1487
- return Ji(Object.values(n2).map(function(e3) {
1477
+ return Ui(Object.values(n2).map(function(e3) {
1488
1478
  return e3.savedPrefix;
1489
- }).filter(Boolean), qi(t2.pathPrefix))(e2, t2.defaultMapping.defaultSaved);
1479
+ }).filter(Boolean), Hi(t2.pathPrefix))(e2, t2.defaultMapping.defaultSaved);
1490
1480
  };
1491
- var Q;
1481
+ var $;
1492
1482
  (function(e2) {
1493
1483
  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`;
1494
- })(Q ||= {});
1495
- var ea = function() {
1484
+ })($ ||= {});
1485
+ var Yi = function() {
1496
1486
  function e2(e3) {
1497
1487
  var t2 = e3.urlMappingKey, n2 = e3.pathPrefixes, r2 = e3.urlMappings, i2 = this;
1498
1488
  this.initValidators = function() {
1499
- i2.validators = [[Hi, Q.MAX_LENGTH_ERROR], [Vi, Q.NO_SPACES_ERROR], [Qi, Q.NO_STARTING_OR_ENDING_SLASH_ERROR], [Ui, Q.NO_EMPTY_SEGMENT_ERROR], [Zi, Q.NO_INVALID_CHARACTERS_ERROR], [Wi, Q.CONTAIN_MAIN_VARIABLE_ERROR], [Ki, Q.ONLY_ONE_VARIABLE_PER_SEGMENT_ERROR], [Yi, Q.ONLY_UNIQUE_PUBLISHED_URL_ERROR], [$i, Q.ONLY_UNIQUE_SAVED_URL_ERROR], [Xi, Q.ONLY_UNIQUE_MAPPING_ERROR]];
1500
- }, this.urlMappings = r2, this.pathPrefixes = n2, this.urlMappingKey = t2, this.pathPrefix = this.getPathPrefix(), this.defaultMapping = ta(t2, this.pathPrefix), this.initValidators();
1489
+ i2.validators = [[Li, $.MAX_LENGTH_ERROR], [Ii, $.NO_SPACES_ERROR], [qi, $.NO_STARTING_OR_ENDING_SLASH_ERROR], [Ri, $.NO_EMPTY_SEGMENT_ERROR], [Ki, $.NO_INVALID_CHARACTERS_ERROR], [zi, $.CONTAIN_MAIN_VARIABLE_ERROR], [Vi, $.ONLY_ONE_VARIABLE_PER_SEGMENT_ERROR], [Wi, $.ONLY_UNIQUE_PUBLISHED_URL_ERROR], [Ji, $.ONLY_UNIQUE_SAVED_URL_ERROR], [Gi, $.ONLY_UNIQUE_MAPPING_ERROR]];
1490
+ }, this.urlMappings = r2, this.pathPrefixes = n2, this.urlMappingKey = t2, this.pathPrefix = this.getPathPrefix(), this.defaultMapping = Xi(t2, this.pathPrefix), this.initValidators();
1501
1491
  }
1502
1492
  return e2.prototype.getPathPrefix = function() {
1503
- var t2 = Ci(this.urlMappingKey);
1504
- if (!t2) throw bi(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})`);
1493
+ var t2 = vi(this.urlMappingKey);
1494
+ if (!t2) throw hi(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})`);
1505
1495
  return this.pathPrefixes[t2] || e2.FALLBACK_PATH_PREFIX;
1506
1496
  }, Object.defineProperty(e2.prototype, "validatorProps", { get: function() {
1507
1497
  var e3 = this;
@@ -1509,8 +1499,8 @@ var ea = function() {
1509
1499
  }, enumerable: false, configurable: true }), e2.prototype.validate = function(e3) {
1510
1500
  var t2, n2;
1511
1501
  try {
1512
- for (var r2 = vi(this.validators), i2 = r2.next(); !i2.done; i2 = r2.next()) {
1513
- var a2 = Z(i2.value, 2), o2 = a2[0], s2 = a2[1], c2 = !!o2(e3, this.validatorProps);
1502
+ for (var r2 = pi(this.validators), i2 = r2.next(); !i2.done; i2 = r2.next()) {
1503
+ var a2 = Q(i2.value, 2), o2 = a2[0], s2 = a2[1], c2 = !!o2(e3, this.validatorProps);
1514
1504
  if (!c2) return { isValid: c2, error: s2 };
1515
1505
  }
1516
1506
  } catch (e4) {
@@ -1523,250 +1513,251 @@ var ea = function() {
1523
1513
  }
1524
1514
  }
1525
1515
  return { isValid: true };
1526
- }, e2.errorArray = Object.values(Q), e2.MAX_URL_MAPPING_LENGTH = 1e3, e2.FALLBACK_PATH_PREFIX = `unknown`, e2;
1516
+ }, e2.errorArray = Object.values($), e2.MAX_URL_MAPPING_LENGTH = 1e3, e2.FALLBACK_PATH_PREFIX = `unknown`, e2;
1527
1517
  }();
1528
- var ta = function(e2, t2) {
1529
- var n2 = xi()[e2] || { required: [`slug`] }, r2 = n2.required, i2 = n2.defaultPrefix, a2 = {};
1530
- return t2 && typeof t2 == `object` ? (a2.savedPrefix = t2.savedPrefix ?? ``, a2.publishedPrefix = t2.publishedPrefix ?? ``) : (a2.savedPrefix = ea.FALLBACK_PATH_PREFIX, a2.publishedPrefix = ea.FALLBACK_PATH_PREFIX), { defaultSaved: yi([a2.savedPrefix, i2], Z(r2?.map(function(e3) {
1518
+ var Xi = function(e2, t2) {
1519
+ var n2 = gi()[e2] || { required: [`slug`] }, r2 = n2.required, i2 = n2.defaultPrefix, a2 = {};
1520
+ return t2 && typeof t2 == `object` ? (a2.savedPrefix = t2.savedPrefix ?? ``, a2.publishedPrefix = t2.publishedPrefix ?? ``) : (a2.savedPrefix = Yi.FALLBACK_PATH_PREFIX, a2.publishedPrefix = Yi.FALLBACK_PATH_PREFIX), { defaultSaved: mi([a2.savedPrefix, i2], Q(r2?.map(function(e3) {
1531
1521
  return `{{${e3}}}`;
1532
- })), false).filter(Boolean).join(`/`), defaultPublished: yi([a2.publishedPrefix, i2], Z(r2?.map(function(e3) {
1522
+ })), false).filter(Boolean).join(`/`), defaultPublished: mi([a2.publishedPrefix, i2], Q(r2?.map(function(e3) {
1533
1523
  return `{{${e3}}}`;
1534
1524
  })), false).filter(Boolean).join(`/`) };
1535
1525
  };
1536
- function na(e2, t2) {
1537
- return t2 ? Li(e2, X.BOOKINGS_SERVICE, { slug: t2 }, { baseUrl: `` }) : void 0;
1526
+ function Zi(e2, t2) {
1527
+ return t2 ? Mi(e2, Z.BOOKINGS_SERVICE, { slug: t2 }, { baseUrl: `` }) : void 0;
1538
1528
  }
1539
- var ra = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
1540
- var ia = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }];
1541
- function aa(e2) {
1542
- 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` }] } }));
1529
+ var Qi = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
1530
+ var $i = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }];
1531
+ function ea(e2) {
1532
+ return St(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` }] } }));
1543
1533
  }
1544
- var oa = `@wix/auto_sdk_bookings_availability-time-slots`;
1545
- function sa(e2) {
1534
+ var ta = `@wix/auto_sdk_bookings_availability-time-slots`;
1535
+ function na(e2) {
1546
1536
  function t2({ host: t3 }) {
1547
- let n2 = nt(e2, [{ transformFn: Ue, paths: ra }]);
1548
- return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.AvailabilityTimeSlots.ListAvailabilityTimeSlots`, packageName: oa, migrationOptions: { optInTransformResponse: true }, url: aa({ protoPath: `/v2/time-slots`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => nt(e3, [{ transformFn: We, paths: ia }]) };
1537
+ let n2 = tt(e2, [{ transformFn: He, paths: Qi }]);
1538
+ return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.AvailabilityTimeSlots.ListAvailabilityTimeSlots`, packageName: ta, migrationOptions: { optInTransformResponse: true }, url: ea({ protoPath: `/v2/time-slots`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => tt(e3, [{ transformFn: Ue, paths: $i }]) };
1549
1539
  }
1550
1540
  return t2;
1551
1541
  }
1552
- async function ca(e2) {
1553
- let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = sa(He({ 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 }));
1542
+ async function ra(e2) {
1543
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = na(Ve({ 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 }));
1554
1544
  n2?.onSiteCall?.();
1555
1545
  try {
1556
1546
  let e3 = await t2.request(r2);
1557
- return n2?.onSuccess?.(e3), L(e3.data);
1547
+ return n2?.onSuccess?.(e3), R(e3.data);
1558
1548
  } catch (e3) {
1559
- let t3 = ft(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`]);
1549
+ 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`]);
1560
1550
  throw n2?.onError?.(e3), t3;
1561
1551
  }
1562
1552
  }
1563
- function la(e2) {
1564
- return (t2) => ca(t2, { httpClient: e2 });
1553
+ function ia(e2) {
1554
+ return (t2) => ra(t2, { httpClient: e2 });
1565
1555
  }
1566
- var ua = B(la);
1567
- var da = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
1568
- var fa = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }, { path: `schedulesInfo.firstSessionStart` }, { path: `schedulesInfo.lastSessionEnd` }, { path: `schedulesInfo.enrollmentViolations.earliestBookingDate` }];
1569
- function pa(e2) {
1570
- 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` }] } }));
1556
+ var aa = V(ia);
1557
+ var oa = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
1558
+ var sa = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }, { path: `schedulesInfo.firstSessionStart` }, { path: `schedulesInfo.lastSessionEnd` }, { path: `schedulesInfo.enrollmentViolations.earliestBookingDate` }];
1559
+ function ca(e2) {
1560
+ return St(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` }] } }));
1571
1561
  }
1572
- var ma = `@wix/auto_sdk_bookings_event-time-slots`;
1573
- function ha(e2) {
1562
+ var la = `@wix/auto_sdk_bookings_event-time-slots`;
1563
+ function ua(e2) {
1574
1564
  function t2({ host: t3 }) {
1575
- let n2 = nt(e2, [{ transformFn: Ue, paths: da }]);
1576
- return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.EventTimeSlots.ListEventTimeSlots`, packageName: ma, migrationOptions: { optInTransformResponse: true }, url: pa({ protoPath: `/v2/time-slots/event`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => nt(e3, [{ transformFn: We, paths: fa }]) };
1565
+ let n2 = tt(e2, [{ transformFn: He, paths: oa }]);
1566
+ return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.EventTimeSlots.ListEventTimeSlots`, packageName: la, migrationOptions: { optInTransformResponse: true }, url: ca({ protoPath: `/v2/time-slots/event`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => tt(e3, [{ transformFn: Ue, paths: sa }]) };
1577
1567
  }
1578
1568
  return t2;
1579
1569
  }
1580
- async function ga(e2) {
1581
- let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = ha(He({ 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 }));
1570
+ async function da(e2) {
1571
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = ua(Ve({ 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 }));
1582
1572
  n2?.onSiteCall?.();
1583
1573
  try {
1584
1574
  let e3 = await t2.request(r2);
1585
- return n2?.onSuccess?.(e3), L(e3.data);
1575
+ return n2?.onSuccess?.(e3), R(e3.data);
1586
1576
  } catch (e3) {
1587
- let t3 = ft(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`]);
1577
+ 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`]);
1588
1578
  throw n2?.onError?.(e3), t3;
1589
1579
  }
1590
1580
  }
1591
- function _a(e2) {
1592
- return (t2) => ga(t2, { httpClient: e2 });
1581
+ function fa(e2) {
1582
+ return (t2) => da(t2, { httpClient: e2 });
1593
1583
  }
1594
- var va = B(_a);
1595
- var ya = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
1596
- var ba = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }];
1597
- function xa(e2) {
1598
- 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` }] } }));
1584
+ var pa = V(fa);
1585
+ var ma = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
1586
+ var ha = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }];
1587
+ function ga(e2) {
1588
+ return St(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` }] } }));
1599
1589
  }
1600
- var Sa = `@wix/auto_sdk_bookings_multi-service-availability-time-slots`;
1601
- function Ca(e2) {
1590
+ var _a = `@wix/auto_sdk_bookings_multi-service-availability-time-slots`;
1591
+ function va(e2) {
1602
1592
  function t2({ host: t3 }) {
1603
- let n2 = nt(e2, [{ transformFn: Ue, paths: ya }]);
1604
- return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.MultiServiceAvailabilityTimeSlots.ListMultiServiceAvailabilityTimeSlots`, packageName: Sa, migrationOptions: { optInTransformResponse: true }, url: xa({ protoPath: `/v2/multi-service-time-slots`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => nt(e3, [{ transformFn: We, paths: ba }]) };
1593
+ let n2 = tt(e2, [{ transformFn: He, paths: ma }]);
1594
+ return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.MultiServiceAvailabilityTimeSlots.ListMultiServiceAvailabilityTimeSlots`, packageName: _a, migrationOptions: { optInTransformResponse: true }, url: ga({ protoPath: `/v2/multi-service-time-slots`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => tt(e3, [{ transformFn: Ue, paths: ha }]) };
1605
1595
  }
1606
1596
  return t2;
1607
1597
  }
1608
- async function wa(e2) {
1609
- let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Ca(He({ 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 }));
1598
+ async function ya(e2) {
1599
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = va(Ve({ 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 }));
1610
1600
  n2?.onSiteCall?.();
1611
1601
  try {
1612
1602
  let e3 = await t2.request(r2);
1613
- return n2?.onSuccess?.(e3), L(e3.data);
1603
+ return n2?.onSuccess?.(e3), R(e3.data);
1614
1604
  } catch (e3) {
1615
- let t3 = ft(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`]);
1605
+ 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`]);
1616
1606
  throw n2?.onError?.(e3), t3;
1617
1607
  }
1618
1608
  }
1619
- function Ta(e2) {
1620
- return (t2) => wa(t2, { httpClient: e2 });
1609
+ function ba(e2) {
1610
+ return (t2) => ya(t2, { httpClient: e2 });
1621
1611
  }
1622
- var Ea = B(Ta);
1623
- var Da = ((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))(Da || {});
1624
- var Oa = ((e2) => (e2.APPOINTMENT = `APPOINTMENT`, e2.CLASS = `CLASS`, e2.COURSE = `COURSE`, e2))(Oa || {});
1625
- var ka = ((e2) => (e2.CUSTOM = `CUSTOM`, e2.BUSINESS = `BUSINESS`, e2.CUSTOMER = `CUSTOMER`, e2))(ka || {});
1626
- var Aa = [{ path: `timeSlotsConfiguration.createdDate` }, { path: `timeSlotsConfiguration.updatedDate` }];
1627
- function ja(e2) {
1628
- 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: `` }] } }));
1612
+ var xa = V(ba);
1613
+ var Sa = ((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))(Sa || {});
1614
+ var Ca = ((e2) => (e2.APPOINTMENT = `APPOINTMENT`, e2.CLASS = `CLASS`, e2.COURSE = `COURSE`, e2))(Ca || {});
1615
+ var wa = ((e2) => (e2.CUSTOM = `CUSTOM`, e2.BUSINESS = `BUSINESS`, e2.CUSTOMER = `CUSTOMER`, e2))(wa || {});
1616
+ var Ta = [{ path: `timeSlotsConfiguration.createdDate` }, { path: `timeSlotsConfiguration.updatedDate` }];
1617
+ function Ea(e2) {
1618
+ return St(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: `` }] } }));
1629
1619
  }
1630
- var Ma = `@wix/auto_sdk_bookings_time-slots-configuration`;
1631
- function Na(e2) {
1620
+ var Da = `@wix/auto_sdk_bookings_time-slots-configuration`;
1621
+ function Oa(e2) {
1632
1622
  function t2({ host: t3 }) {
1633
- return { entityFqdn: `wix.bookings.timeslots_configuration.v1.time_slots_configuration`, method: `GET`, methodFqn: `wix.bookings.timeslots.configuration.v1.TimeSlotsConfigurationService.GetTimeSlotsConfigurationByAppId`, packageName: Ma, migrationOptions: { optInTransformResponse: true }, url: ja({ protoPath: `/v1/time-slots-configurations/app/{appId}`, data: e2, host: t3 }), params: St(e2), transformResponse: (e3) => nt(e3, [{ transformFn: We, paths: Aa }]) };
1623
+ return { entityFqdn: `wix.bookings.timeslots_configuration.v1.time_slots_configuration`, method: `GET`, methodFqn: `wix.bookings.timeslots.configuration.v1.TimeSlotsConfigurationService.GetTimeSlotsConfigurationByAppId`, packageName: Da, migrationOptions: { optInTransformResponse: true }, url: Ea({ protoPath: `/v1/time-slots-configurations/app/{appId}`, data: e2, host: t3 }), params: xt(e2), transformResponse: (e3) => tt(e3, [{ transformFn: Ue, paths: Ta }]) };
1634
1624
  }
1635
1625
  return t2;
1636
1626
  }
1637
- async function Pa(e2) {
1638
- let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Na(He({ appId: e2 }));
1627
+ async function ka(e2) {
1628
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Oa(Ve({ appId: e2 }));
1639
1629
  n2?.onSiteCall?.();
1640
1630
  try {
1641
1631
  let e3 = await t2.request(r2);
1642
- return n2?.onSuccess?.(e3), L(e3.data);
1632
+ return n2?.onSuccess?.(e3), R(e3.data);
1643
1633
  } catch (e3) {
1644
- let t3 = ft(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { appId: `$[0]` }, singleArgumentUnchanged: false }, [`appId`]);
1634
+ let t3 = dt(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { appId: `$[0]` }, singleArgumentUnchanged: false }, [`appId`]);
1645
1635
  throw n2?.onError?.(e3), t3;
1646
1636
  }
1647
1637
  }
1648
- function Fa(e2) {
1649
- return (t2) => Pa(t2, { httpClient: e2 });
1638
+ function Aa(e2) {
1639
+ return (t2) => ka(t2, { httpClient: e2 });
1650
1640
  }
1651
- var Ia = B(Fa);
1652
- var La = [{ path: `bookingsSettings.createdDate` }, { path: `bookingsSettings.updatedDate` }];
1653
- var Ra = [{ path: `bookingsSettings.siteProperties.address.coordinates.latitude` }, { path: `bookingsSettings.siteProperties.address.coordinates.longitude` }];
1654
- function za(e2) {
1655
- 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: `` }] } }));
1641
+ var ja = V(Aa);
1642
+ var Ma = [{ path: `bookingsSettings.createdDate` }, { path: `bookingsSettings.updatedDate` }];
1643
+ var Na = [{ path: `bookingsSettings.siteProperties.address.coordinates.latitude` }, { path: `bookingsSettings.siteProperties.address.coordinates.longitude` }];
1644
+ function Pa(e2) {
1645
+ return St(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: `` }] } }));
1656
1646
  }
1657
- var Ba = `@wix/auto_sdk_bookings_bookings-settings`;
1658
- function Va(e2) {
1647
+ var Fa = `@wix/auto_sdk_bookings_bookings-settings`;
1648
+ function Ia(e2) {
1659
1649
  function t2({ host: t3 }) {
1660
- return { entityFqdn: `wix.bookings.v2.bookings_settings`, method: `GET`, methodFqn: `wix.bookings.settings.v2.BookingsSettingsService.GetBookingsSettings`, packageName: Ba, migrationOptions: { optInTransformResponse: true }, url: za({ protoPath: `/v2/settings`, data: e2, host: t3 }), params: St(e2), transformResponse: (e3) => nt(e3, [{ transformFn: We, paths: La }, { transformFn: Jt, paths: Ra }]), fallback: [{ method: `GET`, url: za({ protoPath: `/v2/settings`, data: e2, host: t3 }), params: St(e2) }] };
1650
+ return { entityFqdn: `wix.bookings.v2.bookings_settings`, method: `GET`, methodFqn: `wix.bookings.settings.v2.BookingsSettingsService.GetBookingsSettings`, packageName: Fa, migrationOptions: { optInTransformResponse: true }, url: Pa({ protoPath: `/v2/settings`, data: e2, host: t3 }), params: xt(e2), transformResponse: (e3) => tt(e3, [{ transformFn: Ue, paths: Ma }, { transformFn: qt, paths: Na }]), fallback: [{ method: `GET`, url: Pa({ protoPath: `/v2/settings`, data: e2, host: t3 }), params: xt(e2) }] };
1661
1651
  }
1662
1652
  return t2;
1663
1653
  }
1664
- var Ha = ((e2) => (e2.BUSINESS_TIME_ZONE = `BUSINESS_TIME_ZONE`, e2.CUSTOMER_TIME_ZONE = `CUSTOMER_TIME_ZONE`, e2))(Ha || {});
1665
- async function Ua() {
1666
- let { httpClient: e2, sideEffects: t2 } = arguments[0], n2 = Va(He({}));
1654
+ var La = ((e2) => (e2.BUSINESS_TIME_ZONE = `BUSINESS_TIME_ZONE`, e2.CUSTOMER_TIME_ZONE = `CUSTOMER_TIME_ZONE`, e2))(La || {});
1655
+ async function Ra() {
1656
+ let { httpClient: e2, sideEffects: t2 } = arguments[0], n2 = Ia(Ve({}));
1667
1657
  t2?.onSiteCall?.();
1668
1658
  try {
1669
1659
  let r2 = await e2.request(n2);
1670
- return t2?.onSuccess?.(r2), L(r2.data)?.bookingsSettings;
1660
+ return t2?.onSuccess?.(r2), R(r2.data)?.bookingsSettings;
1671
1661
  } catch (e3) {
1672
- let n3 = ft(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: {}, singleArgumentUnchanged: false }, []);
1662
+ let n3 = dt(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: {}, singleArgumentUnchanged: false }, []);
1673
1663
  throw t2?.onError?.(e3), n3;
1674
1664
  }
1675
1665
  }
1676
- function Wa(e2) {
1677
- return () => Ua({ httpClient: e2 });
1666
+ function za(e2) {
1667
+ return () => Ra({ httpClient: e2 });
1678
1668
  }
1679
- var Ga = B(Wa);
1680
- function Ka(e2) {
1669
+ var Ba = V(za);
1670
+ function Va(e2) {
1681
1671
  return e2.business?._id ?? null;
1682
1672
  }
1683
- function qa(e2) {
1673
+ function Ha(e2) {
1684
1674
  return e2.business?.name ?? null;
1685
1675
  }
1686
- function Ja(e2) {
1687
- return (e2?.locations ?? []).filter((e3) => e3.type === ka.BUSINESS).map((e3) => ({ id: Ka(e3) ?? ``, label: qa(e3) ?? `` })).filter((e3) => e3.id !== ``).sort((e3, t2) => e3.label.localeCompare(t2.label));
1676
+ function Ua(e2) {
1677
+ return (e2?.locations ?? []).filter((e3) => e3.type === wa.BUSINESS).map((e3) => ({ id: Va(e3) ?? ``, label: Ha(e3) ?? `` })).filter((e3) => e3.id !== ``).sort((e3, t2) => e3.label.localeCompare(t2.label));
1688
1678
  }
1689
- var Ya = (e2) => e2 === Oa.APPOINTMENT;
1690
- var Xa = (e2) => e2 === Oa.CLASS;
1691
- var Za = (e2) => e2 === Oa.COURSE;
1692
- var Qa = { category: `category`, location: `location`, page: `page`, blob: `b`, resource: `resource`, referral: `referral`, timezone: `timezone`, bookingId: `bookingId`, token: `token`, rescheduleRedirectUrl: `rescheduleRedirectUrl` };
1693
- function $a(e2) {
1679
+ var Wa = (e2) => e2 === Ca.APPOINTMENT;
1680
+ var Ga = (e2) => e2 === Ca.CLASS;
1681
+ var Ka = (e2) => e2 === Ca.COURSE;
1682
+ var qa = { category: `category`, location: `location`, page: `page`, blob: `b`, resource: `resource`, referral: `referral`, timezone: `timezone`, bookingId: `bookingId`, token: `token`, rescheduleRedirectUrl: `rescheduleRedirectUrl` };
1683
+ function Ja(e2) {
1694
1684
  if (!e2) return null;
1695
- let t2 = ao(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 } } : {} };
1685
+ let t2 = eo(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 } } : {} };
1696
1686
  return Object.keys(n2).length ? n2 : null;
1697
1687
  }
1698
- function eo(e2) {
1688
+ function Ya(e2) {
1699
1689
  return (e2?.services.length ?? 0) > 1;
1700
1690
  }
1701
- var to = (e2) => ({ valid: false, reason: e2 });
1702
- function no(e2) {
1691
+ var Xa = (e2) => ({ valid: false, reason: e2 });
1692
+ function Za(e2) {
1703
1693
  let t2 = e2?.services ?? [];
1704
- if (!eo(e2) || t2.some((e3) => !e3.serviceId)) return to(`too-few-services`);
1705
- if (t2.some((e3) => e3.serviceType && e3.serviceType !== `APPOINTMENT`)) return to(`not-appointment`);
1694
+ if (!Ya(e2) || t2.some((e3) => !e3.serviceId)) return Xa(`too-few-services`);
1695
+ if (t2.some((e3) => e3.serviceType && e3.serviceType !== `APPOINTMENT`)) return Xa(`not-appointment`);
1706
1696
  let n2 = t2[0].locationType ?? `BUSINESS`, r2 = t2[0].locationId ?? null;
1707
- if (t2.some((e3) => (e3.locationType ?? `BUSINESS`) !== n2 || (e3.locationId ?? null) !== r2)) return to(`location-mixed`);
1708
- if (r2 && n2 !== `BUSINESS`) return to(`location-id-not-business`);
1709
- let i2 = t2.map((e3) => ({ serviceId: e3.serviceId, staff: io(e3), customerChoices: $a(e3) }));
1697
+ if (t2.some((e3) => (e3.locationType ?? `BUSINESS`) !== n2 || (e3.locationId ?? null) !== r2)) return Xa(`location-mixed`);
1698
+ if (r2 && n2 !== `BUSINESS`) return Xa(`location-id-not-business`);
1699
+ let i2 = t2.map((e3) => ({ serviceId: e3.serviceId, staff: $a(e3), customerChoices: Ja(e3) }));
1710
1700
  return { valid: true, locationId: r2, locationType: n2, services: i2, requestKey: JSON.stringify([n2, r2, i2]) };
1711
1701
  }
1712
- var ro = `staff`;
1713
- function io(e2) {
1714
- let t2 = e2.resources?.find((e3) => e3.type === ro);
1702
+ var Qa = `staff`;
1703
+ function $a(e2) {
1704
+ let t2 = e2.resources?.find((e3) => e3.type === Qa);
1715
1705
  if (!t2) return null;
1716
1706
  let n2 = t2.ids[0];
1717
1707
  return n2 ? { anyResource: false, staffMemberId: n2 } : t2.anyResource ? { anyResource: true } : null;
1718
1708
  }
1719
- function ao(e2) {
1709
+ function eo(e2) {
1720
1710
  return e2.addOns ?? [];
1721
1711
  }
1722
- function oo(e2, t2) {
1712
+ function to(e2, t2) {
1723
1713
  let n2 = e2(t2);
1724
1714
  return n2 ? n2.replace(/\/$/, ``) || `/` : null;
1725
1715
  }
1726
- function so(e2, t2, n2) {
1716
+ function no(e2, t2, n2) {
1727
1717
  let r2 = e2(t2);
1728
1718
  return !r2 || !n2 ? null : `${r2.replace(/\/$/, ``)}/${n2}`;
1729
1719
  }
1730
- function co(e2, t2) {
1720
+ function ro(e2, t2) {
1731
1721
  switch (e2) {
1732
1722
  case `servicePage`:
1733
- return (t2.slug ? t2.buildCustomServiceUrl(t2.slug) : void 0) ?? so(t2.appSectionUrl, Kr.SERVICE_PAGE, t2.slug);
1723
+ return (t2.slug ? t2.buildCustomServiceUrl(t2.slug) : void 0) ?? no(t2.appSectionUrl, Vr.SERVICE_PAGE, t2.slug);
1734
1724
  case `bookingCalendar`:
1735
- return t2.isMultiService ? oo(t2.appSectionUrl, Kr.CALENDAR_PAGE) : so(t2.appSectionUrl, Kr.CALENDAR_PAGE, t2.slug);
1725
+ return t2.isMultiService ? to(t2.appSectionUrl, Vr.CALENDAR_PAGE) : no(t2.appSectionUrl, Vr.CALENDAR_PAGE, t2.slug);
1736
1726
  case `bookingForm`:
1737
- return t2.serviceId ? so(t2.appSectionUrl, Kr.FORM_PAGE, t2.slug) : null;
1727
+ return t2.serviceId ? no(t2.appSectionUrl, Vr.FORM_PAGE, t2.slug) : null;
1738
1728
  default:
1739
1729
  return null;
1740
1730
  }
1741
1731
  }
1742
- var lo = (e2, t2) => t2 === `/` ? e2 : new URL(`.${t2}`, `${e2}/`).href;
1743
- var uo = (e2, t2, n2) => n2 ? `.${t2}` : fo(e2, t2);
1744
- var fo = (e2, t2) => e2 ? lo(e2, t2) : t2;
1745
- var po = () => {
1746
- let e2 = f(Ir), t2 = f(zr), n2 = t2.siteUrl.replace(/\/$/, ``), i2 = f(Lr), a2 = f(Vr), o2 = d(), s2 = r(async (t3) => {
1747
- let r2 = uo(n2, t3, e2.getPreviewMode());
1748
- await i2.navigateTo({ href: r2 });
1749
- }, [e2, n2, i2]), c2 = r(async ({ href: e3, target: t3 }) => {
1750
- await i2.navigateTo({ href: e3, target: t3 });
1751
- }, [i2]), l2 = r((e3) => fo(n2, e3), [n2]), u2 = r((e3) => t2.appSectionRelativeUrl(Hr, e3), [t2]), p2 = r((e3) => na(a2.urlMappings, e3), [a2]), m2 = r((e3, t3) => co(e3, { ...t3, appSectionUrl: u2, buildCustomServiceUrl: p2 }), [u2, p2]), h2 = r((e3, t3) => {
1732
+ var io = (e2) => e2.target === `_blank`;
1733
+ var ao = (e2, t2) => t2 === `/` ? e2 : new URL(`.${t2}`, `${e2}/`).href;
1734
+ var oo = (e2, t2, n2) => n2 ? `.${t2}` : so(e2, t2);
1735
+ var so = (e2, t2) => e2 ? ao(e2, t2) : t2;
1736
+ var co = () => {
1737
+ let { previewMode: e2 } = f(Mr), t2 = f(Fr), n2 = t2.siteUrl.replace(/\/$/, ``), { navigateTo: i2 } = f(Pr), a2 = f(Ir), o2 = d(), s2 = r(async (t3) => {
1738
+ let r2 = oo(n2, t3, e2);
1739
+ await i2({ href: r2 });
1740
+ }, [e2, n2, i2]), c2 = r(async (e3) => {
1741
+ await i2(io(e3) ? { href: e3.href, type: `ExternalLink`, target: `_blank` } : { href: e3.href });
1742
+ }, [i2]), l2 = r((e3) => so(n2, e3), [n2]), u2 = r((e3) => t2.appSectionRelativeUrl(Lr, e3), [t2]), p2 = r((e3) => Zi(a2.urlMappings, e3), [a2]), m2 = r((e3, t3) => ro(e3, { ...t3, appSectionUrl: u2, buildCustomServiceUrl: p2 }), [u2, p2]), h2 = r((e3, t3) => {
1752
1743
  let r2 = m2(e3, t3);
1753
- return r2 && n2 ? lo(n2, r2) : null;
1744
+ return r2 && n2 ? ao(n2, r2) : null;
1754
1745
  }, [m2, n2]), g2 = r((e3, t3) => {
1755
1746
  let n3 = m2(e3, t3);
1756
1747
  n3 && s2(n3);
1757
- }, [m2, s2]), _2 = r(() => u2(Kr.FORM_PAGE) || void 0, [u2]), v2 = r((e3) => Object.values(o2(Nr).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]);
1758
- return { navigate: s2, navigateToHref: c2, resolvePath: m2, toHref: l2, resolveAbsoluteUrl: h2, navigateTo: g2, getBookingFormPath: _2, getCartPagePath: r(() => v2(Ur), [v2]), getThankYouPagePath: r((e3) => {
1759
- let t3 = v2(Wr);
1748
+ }, [m2, s2]), _2 = r(() => u2(Vr.FORM_PAGE) || void 0, [u2]), v2 = r((e3) => Object.values(o2(Nr).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]);
1749
+ return { navigate: s2, navigateToHref: c2, resolvePath: m2, toHref: l2, resolveAbsoluteUrl: h2, navigateTo: g2, getBookingFormPath: _2, getCartPagePath: r(() => v2(Rr), [v2]), getThankYouPagePath: r((e3) => {
1750
+ let t3 = v2(zr);
1760
1751
  return t3 ? `${t3}/${e3}?origin=bookings` : void 0;
1761
1752
  }, [v2]) };
1762
1753
  };
1763
- function mo(e2) {
1754
+ function lo(e2) {
1764
1755
  return e2?.details?.applicationError?.code;
1765
1756
  }
1766
- function ho() {
1757
+ function uo() {
1767
1758
  let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
1768
1759
  if (e2) return { initWixModules(t3, n3) {
1769
- return go(() => e2(t3, n3));
1760
+ return fo(() => e2(t3, n3));
1770
1761
  }, fetchWithAuth() {
1771
1762
  throw Error(`fetchWithAuth is not available in this context`);
1772
1763
  }, graphql() {
@@ -1776,10 +1767,10 @@ function ho() {
1776
1767
  if (t2 || n2) return { initWixModules(e3, r2) {
1777
1768
  if (r2) {
1778
1769
  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`);
1779
- return go(() => n2.use(e3));
1770
+ return fo(() => n2.use(e3));
1780
1771
  }
1781
1772
  if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
1782
- return go(() => t2.use(e3));
1773
+ return fo(() => t2.use(e3));
1783
1774
  }, fetchWithAuth: (e3, n3) => {
1784
1775
  if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
1785
1776
  return t2.fetchWithAuth(e3, n3);
@@ -1791,7 +1782,7 @@ function ho() {
1791
1782
  return t2.graphql(e3, n3, r2);
1792
1783
  } };
1793
1784
  }
1794
- function go(e2) {
1785
+ function fo(e2) {
1795
1786
  let t2 = globalThis.__wix_context__, n2 = { client: m.client, elevatedClient: m.elevatedClient }, r2;
1796
1787
  globalThis.__wix_context__ = void 0, m.client = void 0, m.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
1797
1788
  try {
@@ -1800,17 +1791,17 @@ function go(e2) {
1800
1791
  globalThis.__wix_context__ = t2, m.client = n2.client, m.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
1801
1792
  }
1802
1793
  }
1803
- function _o(e2, t2) {
1794
+ function po(e2, t2) {
1804
1795
  return { ...e2, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
1805
- let r2 = ho();
1796
+ let r2 = uo();
1806
1797
  if (!r2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
1807
1798
  return r2.initWixModules(e2)[t3].apply(void 0, n2);
1808
1799
  }])) };
1809
1800
  }
1810
- function vo(e2) {
1811
- return _o({ __type: `host`, create: (t2) => Object.entries(e2).reduce((e3, [n2, r2]) => ({ ...e3, [n2]: r2(t2) }), {}) }, Object.keys(e2));
1801
+ function mo(e2) {
1802
+ return po({ __type: `host`, create: (t2) => Object.entries(e2).reduce((e3, [n2, r2]) => ({ ...e3, [n2]: r2(t2) }), {}) }, Object.keys(e2));
1812
1803
  }
1813
- var yo = class {
1804
+ var ho = class {
1814
1805
  constructor(e2) {
1815
1806
  this.message = e2, this.captureException = () => {
1816
1807
  console.error(this.message);
@@ -1825,106 +1816,110 @@ var yo = class {
1825
1816
  };
1826
1817
  }
1827
1818
  };
1828
- var bo = (e2) => new yo(e2);
1829
- var xo = vo({ getMonitoringClient: (e2) => () => e2.getMonitoringClient ? e2.getMonitoringClient() : bo(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
1830
- var So = { 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` };
1831
- function Co(e2) {
1819
+ var go = (e2) => new ho(e2);
1820
+ var _o = mo({ getMonitoringClient: (e2) => () => e2.getMonitoringClient ? e2.getMonitoringClient() : go(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
1821
+ var vo = { 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` };
1822
+ function yo(e2) {
1832
1823
  try {
1833
- let t2 = xo.getMonitoringClient?.();
1824
+ let t2 = _o.getMonitoringClient?.();
1834
1825
  return t2 && typeof t2[e2] == `function` ? t2 : null;
1835
1826
  } catch {
1836
1827
  return null;
1837
1828
  }
1838
1829
  }
1839
- function wo(e2, { feature: t2, action: n2, level: r2 = `error`, contexts: i2 }) {
1840
- let a2 = Co(`captureException`);
1830
+ function bo(e2, { feature: t2, action: n2, level: r2 = `error`, contexts: i2 }) {
1831
+ let a2 = yo(`captureException`);
1841
1832
  if (!a2) return;
1842
1833
  let o2 = e2 instanceof Error ? e2 : Error(String(e2));
1843
1834
  a2.captureException(o2, { level: r2, tags: { feature: t2, action: n2 }, ...i2 ? { contexts: i2 } : {} });
1844
1835
  }
1845
- var To = (e2) => {
1836
+ var xo = (e2) => {
1846
1837
  let t2 = (e3) => e3 < 10 ? `0${e3}` : `${e3}`;
1847
1838
  return `${e2.getFullYear()}-${t2(e2.getMonth() + 1)}-${t2(e2.getDate())}`;
1848
1839
  };
1849
- var $ = (e2) => /* @__PURE__ */ new Date(`${e2}T00:00:00`);
1850
- var Eo = (e2, t2) => new Intl.DateTimeFormat(`en-CA`, { year: `numeric`, month: `2-digit`, day: `2-digit`, ...t2 ? { timeZone: t2 } : {} }).format(e2);
1851
- var Do = (e2) => `${To(e2)}T00:00:00`;
1852
- var Oo = (e2) => `${To(e2)}T23:59:59`;
1853
- function ko(e2, t2) {
1854
- return `${Eo(e2, t2)}T${new Intl.DateTimeFormat(`en-GB`, { timeZone: t2, hourCycle: `h23`, hour: `2-digit`, minute: `2-digit`, second: `2-digit` }).format(e2)}`;
1855
- }
1856
- var Ao = /^\d{4}-\d{2}-\d{2}$/;
1857
- var jo = 864e5;
1858
- function Mo(e2) {
1859
- if (typeof e2 != `string` || !Ao.test(e2)) return false;
1860
- let t2 = $(e2);
1861
- return !Number.isNaN(t2.getTime()) && To(t2) === e2;
1862
- }
1863
- function No(e2) {
1840
+ var So = (e2) => /* @__PURE__ */ new Date(`${e2}T00:00:00`);
1841
+ var Co = (e2, t2) => new Intl.DateTimeFormat(`en-CA`, { year: `numeric`, month: `2-digit`, day: `2-digit`, ...t2 ? { timeZone: t2 } : {} }).format(e2);
1842
+ var wo = (e2) => `${xo(e2)}T00:00:00`;
1843
+ var To = (e2) => `${xo(e2)}T23:59:59`;
1844
+ function Eo(e2, t2) {
1845
+ return `${Co(e2, t2)}T${new Intl.DateTimeFormat(`en-GB`, { timeZone: t2, hourCycle: `h23`, hour: `2-digit`, minute: `2-digit`, second: `2-digit` }).format(e2)}`;
1846
+ }
1847
+ function Do(e2, t2) {
1848
+ let n2 = Eo(new Date(Date.now()), t2);
1849
+ return n2.slice(0, 10) === e2 ? n2 : `${e2}T00:00:00`;
1850
+ }
1851
+ var Oo = /^\d{4}-\d{2}-\d{2}$/;
1852
+ var ko = 864e5;
1853
+ function Ao(e2) {
1854
+ if (typeof e2 != `string` || !Oo.test(e2)) return false;
1855
+ let t2 = So(e2);
1856
+ return !Number.isNaN(t2.getTime()) && xo(t2) === e2;
1857
+ }
1858
+ function jo(e2) {
1864
1859
  if (!e2 || typeof e2 != `object`) return false;
1865
1860
  let { startDate: t2, endDate: n2 } = e2;
1866
- return Mo(t2) && Mo(n2) && t2 <= n2;
1861
+ return Ao(t2) && Ao(n2) && t2 <= n2;
1867
1862
  }
1868
- function Po(e2, t2) {
1869
- let n2 = $(e2);
1870
- return n2.setDate(n2.getDate() + t2), To(n2);
1863
+ function Mo(e2, t2) {
1864
+ let n2 = So(e2);
1865
+ return n2.setDate(n2.getDate() + t2), xo(n2);
1871
1866
  }
1872
- function Fo({ startDate: e2, endDate: t2 }) {
1873
- let n2 = $(t2).getTime() - $(e2).getTime();
1874
- return Math.round(n2 / jo) + 1;
1867
+ function No({ startDate: e2, endDate: t2 }) {
1868
+ let n2 = So(t2).getTime() - So(e2).getTime();
1869
+ return Math.round(n2 / ko) + 1;
1875
1870
  }
1876
- function Io(e2) {
1877
- let t2 = $(e2), n2 = new Date(t2.getFullYear(), t2.getMonth(), 1), r2 = new Date(t2.getFullYear(), t2.getMonth() + 1, 0);
1878
- return { startDate: To(n2), endDate: To(r2) };
1871
+ function Po(e2) {
1872
+ let t2 = So(e2), n2 = new Date(t2.getFullYear(), t2.getMonth(), 1), r2 = new Date(t2.getFullYear(), t2.getMonth() + 1, 0);
1873
+ return { startDate: xo(n2), endDate: xo(r2) };
1879
1874
  }
1880
- function Lo(e2) {
1881
- let t2 = Io(e2.startDate);
1875
+ function Fo(e2) {
1876
+ let t2 = Po(e2.startDate);
1882
1877
  return t2.startDate === e2.startDate && t2.endDate === e2.endDate;
1883
1878
  }
1884
- function Ro(e2, t2) {
1885
- if (Lo(e2)) {
1886
- let n3 = $(e2.startDate);
1887
- return Io(To(new Date(n3.getFullYear(), n3.getMonth() + t2, 1)));
1879
+ function Io(e2, t2) {
1880
+ if (Fo(e2)) {
1881
+ let n3 = So(e2.startDate);
1882
+ return Po(xo(new Date(n3.getFullYear(), n3.getMonth() + t2, 1)));
1888
1883
  }
1889
- let n2 = t2 * Fo(e2);
1890
- return { startDate: Po(e2.startDate, n2), endDate: Po(e2.endDate, n2) };
1884
+ let n2 = t2 * No(e2);
1885
+ return { startDate: Mo(e2.startDate, n2), endDate: Mo(e2.endDate, n2) };
1891
1886
  }
1892
- function zo(e2, t2) {
1887
+ function Lo(e2, t2) {
1893
1888
  return e2 >= t2.startDate && e2 <= t2.endDate;
1894
1889
  }
1895
- function Bo(e2) {
1896
- let t2 = $(e2), n2 = new Date(t2.getFullYear(), t2.getMonth() + 2, 0).getDate(), r2 = Math.min(t2.getDate(), n2);
1897
- return To(new Date(t2.getFullYear(), t2.getMonth() + 1, r2));
1890
+ function Ro(e2) {
1891
+ let t2 = So(e2), n2 = new Date(t2.getFullYear(), t2.getMonth() + 2, 0).getDate(), r2 = Math.min(t2.getDate(), n2);
1892
+ return xo(new Date(t2.getFullYear(), t2.getMonth() + 1, r2));
1898
1893
  }
1899
- function Vo(e2) {
1894
+ function zo(e2) {
1900
1895
  let t2 = [], n2 = e2.startDate;
1901
1896
  for (; n2 <= e2.endDate; ) {
1902
- let r2 = Po(Bo(n2), -1), i2 = r2 < e2.endDate ? r2 : e2.endDate;
1903
- t2.push({ startDate: n2, endDate: i2 }), n2 = Po(i2, 1);
1897
+ let r2 = Mo(Ro(n2), -1), i2 = r2 < e2.endDate ? r2 : e2.endDate;
1898
+ t2.push({ startDate: n2, endDate: i2 }), n2 = Mo(i2, 1);
1904
1899
  }
1905
1900
  return t2;
1906
1901
  }
1907
- function Ho({ allowGenderSelection: e2, staffSelectionStrategy: t2 }) {
1902
+ function Bo({ allowGenderSelection: e2, staffSelectionStrategy: t2 }) {
1908
1903
  return e2 && t2 !== `CUSTOMER_CANNOT_CHOOSE`;
1909
1904
  }
1910
- async function Uo() {
1911
- let e2 = await Ia(Hr);
1905
+ async function Vo() {
1906
+ let e2 = await ja(Lr);
1912
1907
  return { businessTimeZone: e2.timeSlotsConfiguration?.displayTimeZone?.timeZone || null, staffSelectionStrategy: e2.timeSlotsConfiguration?.staffSelection?.strategy ?? null, allowGenderSelection: e2.timeSlotsConfiguration?.staffSelection?.allowGenderSelection ?? false };
1913
1908
  }
1914
- function Wo(e2) {
1909
+ function Ho(e2) {
1915
1910
  let t2 = e2.location?._id || (e2.location?.locationType ? `${e2.location.locationType}:${e2.location.formattedAddress ?? ``}` : ``);
1916
1911
  return `${e2.localStartDate ?? ``}|${e2.localEndDate ?? ``}|${t2}`;
1917
1912
  }
1918
- function Go(e2) {
1913
+ function Uo(e2) {
1919
1914
  return e2.availableResources?.[0]?.resources?.[0]?._id ?? null;
1920
1915
  }
1921
- function Ko(e2) {
1922
- return `${Wo(e2)}|${Go(e2) ?? ``}`;
1916
+ function Wo(e2) {
1917
+ return `${Ho(e2)}|${Uo(e2) ?? ``}`;
1923
1918
  }
1924
- function qo(e2) {
1919
+ function Go(e2) {
1925
1920
  let t2 = /* @__PURE__ */ new Map();
1926
1921
  for (let n2 of e2) {
1927
- let e3 = Wo(n2), r2 = t2.get(e3);
1922
+ let e3 = Ho(n2), r2 = t2.get(e3);
1928
1923
  r2 ? r2.push(n2) : t2.set(e3, [n2]);
1929
1924
  }
1930
1925
  return [...t2.values()].map((e3) => {
@@ -1933,94 +1928,94 @@ function qo(e2) {
1933
1928
  return { ...n2[0], availableResources: n2.flatMap((e4) => e4.availableResources ?? []) };
1934
1929
  });
1935
1930
  }
1936
- function Jo(e2) {
1931
+ function Ko(e2) {
1937
1932
  return e2 ? { locations: [{ _id: e2, locationType: `BUSINESS` }] } : {};
1938
1933
  }
1939
- function Yo(e2) {
1940
- return e2 ? { resourceTypes: [{ resourceTypeId: Gr, resourceIds: [e2] }] } : {};
1934
+ function qo(e2) {
1935
+ return e2 ? { resourceTypes: [{ resourceTypeId: Br, resourceIds: [e2] }] } : {};
1941
1936
  }
1942
- function Xo(e2) {
1937
+ function Jo(e2) {
1943
1938
  let { requestedGender: t2, ...n2 } = e2;
1944
1939
  return Object.keys(n2).length ? n2 : void 0;
1945
1940
  }
1946
- function Zo(e2, t2) {
1941
+ function Yo(e2, t2) {
1947
1942
  if (!e2) return {};
1948
- let n2 = t2 ? Xo(e2) : e2;
1943
+ let n2 = t2 ? Jo(e2) : e2;
1949
1944
  return n2 ? { customerChoices: n2 } : {};
1950
1945
  }
1951
- var Qo = `REQUESTED_GENDER_NOT_ALLOWED`;
1952
- function $o(e2) {
1953
- return mo(e2) === Qo;
1946
+ var Xo = `REQUESTED_GENDER_NOT_ALLOWED`;
1947
+ function Zo(e2) {
1948
+ return lo(e2) === Xo;
1954
1949
  }
1955
- var es = false;
1956
- var ts = /* @__PURE__ */ new Set();
1957
- function ns() {
1958
- return es;
1950
+ var Qo = false;
1951
+ var $o = /* @__PURE__ */ new Set();
1952
+ function es() {
1953
+ return Qo;
1959
1954
  }
1960
- function rs(e2) {
1961
- return ts.add(e2), () => ts.delete(e2);
1955
+ function ts(e2) {
1956
+ return $o.add(e2), () => $o.delete(e2);
1962
1957
  }
1963
- function is() {
1964
- es || (es = true, ts.forEach((e2) => e2()));
1958
+ function ns() {
1959
+ Qo || (Qo = true, $o.forEach((e2) => e2()));
1965
1960
  }
1966
- async function as(e2) {
1961
+ async function rs(e2) {
1967
1962
  let { customerChoices: t2, ...n2 } = e2, r2 = (e3) => {
1968
- let t3 = Xo(e3);
1969
- return ua({ ...n2, ...t3 ? { customerChoices: t3 } : {} });
1963
+ let t3 = Jo(e3);
1964
+ return aa({ ...n2, ...t3 ? { customerChoices: t3 } : {} });
1970
1965
  };
1971
- if (es && t2?.requestedGender) return r2(t2);
1966
+ if (Qo && t2?.requestedGender) return r2(t2);
1972
1967
  try {
1973
- return await ua(e2);
1968
+ return await aa(e2);
1974
1969
  } catch (e3) {
1975
- if (!t2?.requestedGender || !$o(e3)) throw e3;
1976
- return wo(e3, { feature: So.timeSlots, action: `requested-gender-rejected`, level: `warning` }), is(), r2(t2);
1970
+ if (!t2?.requestedGender || !Zo(e3)) throw e3;
1971
+ return bo(e3, { feature: vo.timeSlots, action: `requested-gender-rejected`, level: `warning` }), ns(), r2(t2);
1977
1972
  }
1978
1973
  }
1979
- function os(e2, t2, n2) {
1974
+ function is(e2, t2, n2) {
1980
1975
  return { ...e2 ? { "location.id": e2 } : {}, ...t2 ? { "resources.id": { $hasSome: [t2] } } : {}, ...n2 ? { remainingCapacity: { $gte: n2 } } : {} };
1981
1976
  }
1982
- async function ss(e2) {
1983
- let t2 = await va(e2);
1977
+ async function as(e2) {
1978
+ let t2 = await pa(e2);
1984
1979
  return { timeSlots: t2.timeSlots ?? [], timeZone: t2.timeZone ?? null, nextCursor: t2.pagingMetadata?.cursors?.next || null };
1985
1980
  }
1986
- function cs({ 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 }) {
1987
- return Ya(t2) ? ls({ serviceId: e2, fromLocalDate: n2, toLocalDate: r2, timeZone: i2, locationId: a2, staffId: o2, onlyAvailableSlots: s2, customerChoices: c2, timeSlotsPerDay: u2, limit: d2, cursor: f2 }) : ss({ serviceIds: [e2], fromLocalDate: n2, ...r2 ? { toLocalDate: r2 } : {}, ...i2 ? { timeZone: i2 } : {}, includeNonBookable: !s2, eventFilter: { type: t2, ...os(a2, o2, l2) }, cursorPaging: { limit: d2, ...f2 ? { cursor: f2 } : {} } });
1981
+ function os({ 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 }) {
1982
+ return Wa(t2) ? ss({ serviceId: e2, fromLocalDate: n2, toLocalDate: r2, timeZone: i2, locationId: a2, staffId: o2, onlyAvailableSlots: s2, customerChoices: c2, timeSlotsPerDay: u2, limit: d2, cursor: f2 }) : as({ serviceIds: [e2], fromLocalDate: n2, ...r2 ? { toLocalDate: r2 } : {}, ...i2 ? { timeZone: i2 } : {}, includeNonBookable: !s2, eventFilter: { type: t2, ...is(a2, o2, l2) }, cursorPaging: { limit: d2, ...f2 ? { cursor: f2 } : {} } });
1988
1983
  }
1989
- async function ls({ serviceId: e2, fromLocalDate: t2, toLocalDate: n2, timeZone: r2, locationId: i2, staffId: a2, onlyAvailableSlots: o2, customerChoices: s2, timeSlotsPerDay: c2, limit: l2, cursor: u2 }) {
1990
- let d2 = await as({ serviceId: e2, fromLocalDate: t2, ...n2 ? { toLocalDate: n2 } : {}, ...r2 ? { timeZone: r2 } : {}, ...o2 ? { bookable: true } : {}, ...Jo(i2), ...Yo(a2), ...Zo(s2, a2), includeResourceTypeIds: [Gr], ...c2 == null ? {} : { timeSlotsPerDay: c2 }, cursorPaging: { limit: l2, ...u2 ? { cursor: u2 } : {} } });
1984
+ async function ss({ serviceId: e2, fromLocalDate: t2, toLocalDate: n2, timeZone: r2, locationId: i2, staffId: a2, onlyAvailableSlots: o2, customerChoices: s2, timeSlotsPerDay: c2, limit: l2, cursor: u2 }) {
1985
+ let d2 = await rs({ serviceId: e2, fromLocalDate: t2, ...n2 ? { toLocalDate: n2 } : {}, ...r2 ? { timeZone: r2 } : {}, ...o2 ? { bookable: true } : {}, ...Ko(i2), ...qo(a2), ...Yo(s2, a2), includeResourceTypeIds: [Br], ...c2 == null ? {} : { timeSlotsPerDay: c2 }, cursorPaging: { limit: l2, ...u2 ? { cursor: u2 } : {} } });
1991
1986
  return { timeSlots: d2.timeSlots ?? [], timeZone: d2.timeZone ?? null, nextCursor: d2.cursorPagingMetadata?.cursors?.next || null };
1992
1987
  }
1993
- var us = 6;
1994
- var ds = 864e5;
1995
- function fs(e2) {
1996
- let t2 = e2 ? $(e2) : new Date(Date.now()), n2 = new Date(t2.getFullYear(), t2.getMonth() + us + 1, 1), r2 = new Date(n2.getTime() - ds);
1997
- return { fromLocalDate: Do(t2), toLocalDate: Oo(r2) };
1988
+ var cs = 6;
1989
+ var ls = 864e5;
1990
+ function us(e2) {
1991
+ let t2 = e2 ? So(e2) : new Date(Date.now()), n2 = new Date(t2.getFullYear(), t2.getMonth() + cs + 1, 1), r2 = new Date(n2.getTime() - ls);
1992
+ return { fromLocalDate: wo(t2), toLocalDate: To(r2) };
1998
1993
  }
1999
- async function ps({ serviceId: e2, serviceType: t2, timeZone: n2, limit: r2, onlyAvailableSlots: i2 = true, fromDate: a2, locationId: o2, staffId: s2, customerChoices: c2, minRemainingCapacity: l2 }) {
2000
- let { fromLocalDate: u2, toLocalDate: d2 } = fs(a2);
2001
- if (Xa(t2) || Za(t2)) {
2002
- let a3 = { ...Za(t2) ? { type: `COURSE` } : {}, ...os(o2, s2, l2) }, c3 = await ss({ serviceIds: [e2], fromLocalDate: u2, toLocalDate: d2, ...n2 ? { timeZone: n2 } : {}, includeNonBookable: !i2, ...Object.keys(a3).length ? { eventFilter: a3 } : {}, ...r2 == null ? {} : { cursorPaging: { limit: r2 } } });
1994
+ async function ds({ serviceId: e2, serviceType: t2, timeZone: n2, limit: r2, onlyAvailableSlots: i2 = true, fromDate: a2, locationId: o2, staffId: s2, customerChoices: c2, minRemainingCapacity: l2 }) {
1995
+ let { fromLocalDate: u2, toLocalDate: d2 } = us(a2);
1996
+ if (Ga(t2) || Ka(t2)) {
1997
+ let a3 = { ...Ka(t2) ? { type: `COURSE` } : {}, ...is(o2, s2, l2) }, c3 = await as({ serviceIds: [e2], fromLocalDate: u2, toLocalDate: d2, ...n2 ? { timeZone: n2 } : {}, includeNonBookable: !i2, ...Object.keys(a3).length ? { eventFilter: a3 } : {}, ...r2 == null ? {} : { cursorPaging: { limit: r2 } } });
2003
1998
  return { timeSlots: c3.timeSlots, timeZone: c3.timeZone };
2004
1999
  }
2005
- let f2 = await as({ serviceId: e2, fromLocalDate: u2, toLocalDate: d2, ...n2 ? { timeZone: n2 } : {}, ...i2 ? { bookable: true } : {}, ...Jo(o2), ...Yo(s2), ...Zo(c2, s2), includeResourceTypeIds: [Gr], ...r2 == null ? {} : { cursorPaging: { limit: r2 } } });
2000
+ let f2 = await rs({ serviceId: e2, fromLocalDate: u2, toLocalDate: d2, ...n2 ? { timeZone: n2 } : {}, ...i2 ? { bookable: true } : {}, ...Ko(o2), ...qo(s2), ...Yo(c2, s2), includeResourceTypeIds: [Br], ...r2 == null ? {} : { cursorPaging: { limit: r2 } } });
2006
2001
  return { timeSlots: f2.timeSlots ?? [], timeZone: f2.timeZone ?? null };
2007
2002
  }
2008
- var ms = 1e3;
2009
- async function hs({ serviceId: e2, serviceType: t2, date: n2, timeZone: r2, onlyAvailableSlots: i2, locationId: a2, staffId: o2, customerChoices: s2, minRemainingCapacity: c2, fromLocalDate: l2, toLocalDate: u2 }) {
2010
- let d2 = `${n2}T00:00:00`, f2 = `${n2}T23:59:59`, p2 = Za(t2) ? `COURSE` : Xa(t2) ? `CLASS` : `APPOINTMENT`, m2 = [], h2 = null, g2;
2003
+ var fs = 1e3;
2004
+ async function ps({ serviceId: e2, serviceType: t2, date: n2, timeZone: r2, onlyAvailableSlots: i2, locationId: a2, staffId: o2, customerChoices: s2, minRemainingCapacity: c2, fromLocalDate: l2, toLocalDate: u2 }) {
2005
+ let d2 = `${n2}T00:00:00`, f2 = `${n2}T23:59:59`, p2 = Ka(t2) ? `COURSE` : Ga(t2) ? `CLASS` : `APPOINTMENT`, m2 = [], h2 = null, g2;
2011
2006
  do {
2012
- let t3 = await cs({ 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: ms, cursor: g2 });
2007
+ let t3 = await os({ 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: fs, cursor: g2 });
2013
2008
  m2.push(...t3.timeSlots), h2 = t3.timeZone ?? h2, g2 = t3.nextCursor ?? void 0;
2014
2009
  } while (g2);
2015
2010
  return { timeSlots: m2, timeZone: h2 };
2016
2011
  }
2017
- function gs(e2) {
2012
+ function ms(e2) {
2018
2013
  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 };
2019
2014
  }
2020
- function _s(e2) {
2021
- return e2?.options?.values?.[0]?.type === Da.STAFF_MEMBER;
2015
+ function hs(e2) {
2016
+ return e2?.options?.values?.[0]?.type === Sa.STAFF_MEMBER;
2022
2017
  }
2023
- function vs(e2) {
2018
+ function gs(e2) {
2024
2019
  let t2 = e2;
2025
2020
  if (t2.__state || (t2.__state = { status: `pending` }, t2.then((e3) => {
2026
2021
  t2.__state = { status: `fulfilled`, value: e3 };
@@ -2029,36 +2024,33 @@ function vs(e2) {
2029
2024
  })), t2.__state.status === `fulfilled`) return t2.__state.value;
2030
2025
  throw t2.__state.status === `rejected` ? t2.__state.reason : t2;
2031
2026
  }
2032
- function ys(e2) {
2027
+ function _s(e2) {
2033
2028
  let t2 = Promise.resolve(e2);
2034
2029
  return t2.__state = { status: `fulfilled`, value: e2 }, t2;
2035
2030
  }
2036
- function bs(e2) {
2037
- return e2;
2038
- }
2039
- var xs = bs(`@wix/site-service-warmup-data`);
2040
- function Ss() {
2031
+ var vs = jr(`@wix/site-service-warmup-data`);
2032
+ function ys() {
2041
2033
  try {
2042
2034
  return d();
2043
2035
  } catch {
2044
2036
  return null;
2045
2037
  }
2046
2038
  }
2047
- function Cs(e2) {
2039
+ function bs(e2) {
2048
2040
  try {
2049
- return e2 ? e2(xs) : null;
2041
+ return e2 ? e2(vs) : null;
2050
2042
  } catch {
2051
2043
  return null;
2052
2044
  }
2053
2045
  }
2054
- function ws() {
2055
- let e2 = Cs(Ss()), t2 = typeof window > `u`;
2046
+ function xs() {
2047
+ let e2 = bs(ys()), t2 = typeof window > `u`;
2056
2048
  return { scope: e2 ?? void 0, get: async (n2) => {
2057
2049
  if (t2 || !e2) return null;
2058
2050
  try {
2059
2051
  return await e2.get(n2);
2060
2052
  } catch (e3) {
2061
- return wo(e3, { feature: So.warmup, action: `read`, level: `warning`, contexts: { warmup: { key: n2 } } }), null;
2053
+ return bo(e3, { feature: vo.warmup, action: `read`, level: `warning`, contexts: { warmup: { key: n2 } } }), null;
2062
2054
  }
2063
2055
  }, set: (n2, r2) => {
2064
2056
  if (t2 && e2) try {
@@ -2067,57 +2059,57 @@ function ws() {
2067
2059
  }
2068
2060
  } };
2069
2061
  }
2070
- var Ts = `bookings-uou`;
2071
- function Es() {
2072
- return `${Ts}:bookings-settings`;
2062
+ var Ss = `bookings-uou`;
2063
+ function Cs() {
2064
+ return `${Ss}:bookings-settings`;
2073
2065
  }
2074
- function Ds() {
2075
- return `${Ts}:time-slots-configuration`;
2066
+ function ws() {
2067
+ return `${Ss}:time-slots-configuration`;
2076
2068
  }
2077
- var Os = 5e3;
2078
- var ks = 100;
2079
- var As = `wix-warmup-data`;
2080
- var js = null;
2081
- function Ms(e2) {
2069
+ var Ts = 5e3;
2070
+ var Es = 100;
2071
+ var Ds = `wix-warmup-data`;
2072
+ var Os = null;
2073
+ function ks(e2) {
2082
2074
  if (typeof document < `u`) try {
2083
- let t2 = document.getElementById(As)?.textContent;
2084
- return t2 ? (js?.text !== t2 && (js = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), js.data[e2] ?? void 0) : void 0;
2075
+ let t2 = document.getElementById(Ds)?.textContent;
2076
+ return t2 ? (Os?.text !== t2 && (Os = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), Os.data[e2] ?? void 0) : void 0;
2085
2077
  } catch {
2086
2078
  return;
2087
2079
  }
2088
2080
  }
2089
- var Ns = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
2090
- var Ps = Ns();
2091
- var Fs = /* @__PURE__ */ new WeakMap();
2092
- var Is = /* @__PURE__ */ new WeakMap();
2093
- function Ls(e2) {
2094
- if (!e2) return Ps;
2095
- let t2 = Fs.get(e2);
2096
- return t2 || (t2 = Ns(), Fs.set(e2, t2)), t2;
2081
+ var As = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
2082
+ var js = As();
2083
+ var Ms = /* @__PURE__ */ new WeakMap();
2084
+ var Ns = /* @__PURE__ */ new WeakMap();
2085
+ function Ps(e2) {
2086
+ if (!e2) return js;
2087
+ let t2 = Ms.get(e2);
2088
+ return t2 || (t2 = As(), Ms.set(e2, t2)), t2;
2097
2089
  }
2098
- function Rs({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
2090
+ function Fs({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
2099
2091
  if (e2 === null) return n2();
2100
2092
  if (typeof window > `u`) {
2101
2093
  let r3 = () => n2().then((n3) => (t2.set(e2, n3), n3)), { scope: i3 } = t2;
2102
2094
  if (!i3) return r3();
2103
- let a3 = Is.get(i3);
2104
- a3 || (a3 = /* @__PURE__ */ new Map(), Is.set(i3, a3));
2095
+ let a3 = Ns.get(i3);
2096
+ a3 || (a3 = /* @__PURE__ */ new Map(), Ns.set(i3, a3));
2105
2097
  let o3 = a3.get(e2);
2106
2098
  if (o3) return o3;
2107
2099
  let s3 = r3();
2108
2100
  return a3.set(e2, s3), s3.catch(() => a3.delete(e2)), s3;
2109
2101
  }
2110
- let i2 = Ls(t2.scope), a2 = Date.now();
2102
+ let i2 = Ps(t2.scope), a2 = Date.now();
2111
2103
  for (let [e3, t3] of i2.promises) t3.expiresAt <= a2 && i2.promises.delete(e3);
2112
2104
  let o2 = i2.promises.get(e2);
2113
2105
  if (o2 && !r2) return o2.promise;
2114
2106
  r2 && i2.invalidatedWarmup.add(e2);
2115
2107
  let s2 = !i2.invalidatedWarmup.has(e2);
2116
2108
  if (s2) {
2117
- let t3 = Ms(e2);
2109
+ let t3 = ks(e2);
2118
2110
  if (t3 !== void 0) {
2119
- let n3 = ys(t3);
2120
- return i2.promises.set(e2, { promise: n3, expiresAt: a2 + Os }), n3;
2111
+ let n3 = _s(t3);
2112
+ return i2.promises.set(e2, { promise: n3, expiresAt: a2 + Ts }), n3;
2121
2113
  }
2122
2114
  }
2123
2115
  let c2 = (async () => {
@@ -2127,69 +2119,69 @@ function Rs({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
2127
2119
  }
2128
2120
  return n2();
2129
2121
  })();
2130
- i2.promises.size >= ks && i2.promises.delete(i2.promises.keys().next().value);
2122
+ i2.promises.size >= Es && i2.promises.delete(i2.promises.keys().next().value);
2131
2123
  let l2 = { promise: c2, expiresAt: 1 / 0 };
2132
2124
  return i2.promises.set(e2, l2), c2.then(() => {
2133
- l2.expiresAt = Date.now() + Os;
2125
+ l2.expiresAt = Date.now() + Ts;
2134
2126
  }, () => {
2135
2127
  i2.promises.get(e2) === l2 && i2.promises.delete(e2);
2136
2128
  }), c2;
2137
2129
  }
2138
- var zs = { displayTimeZonePolicy: { basedOn: Ha.BUSINESS_TIME_ZONE, customerCanChange: false }, multiServiceAppointmentsEnabled: false };
2139
- async function Bs() {
2130
+ var Is = { displayTimeZonePolicy: { basedOn: La.BUSINESS_TIME_ZONE, customerCanChange: false }, multiServiceAppointmentsEnabled: false };
2131
+ async function Ls() {
2140
2132
  try {
2141
- let e2 = await Ga();
2142
- return { displayTimeZonePolicy: { basedOn: e2.displayTimeZone?.basedOn ?? Ha.BUSINESS_TIME_ZONE, customerCanChange: e2.displayTimeZone?.customerCanChange ?? false }, multiServiceAppointmentsEnabled: e2.multiServiceAppointments?.enabled ?? false };
2133
+ let e2 = await Ba();
2134
+ return { displayTimeZonePolicy: { basedOn: e2.displayTimeZone?.basedOn ?? La.BUSINESS_TIME_ZONE, customerCanChange: e2.displayTimeZone?.customerCanChange ?? false }, multiServiceAppointmentsEnabled: e2.multiServiceAppointments?.enabled ?? false };
2143
2135
  } catch (e2) {
2144
- return wo(e2, { feature: So.bookingsSettings, action: `fetch-bookings-settings`, level: `warning` }), zs;
2136
+ return bo(e2, { feature: vo.bookingsSettings, action: `fetch-bookings-settings`, level: `warning` }), Is;
2145
2137
  }
2146
2138
  }
2147
- var Vs = { isLoading: true };
2148
- var Hs = n(null);
2149
- var Us = `useBookingsSettingsContext must be used within BookingsSettingsProvider`;
2150
- function Ws() {
2151
- let e2 = i(Hs);
2152
- if (!e2) throw Error(Us);
2139
+ var Rs = { isLoading: true };
2140
+ var zs = n(null);
2141
+ var Bs = `useBookingsSettingsContext must be used within BookingsSettingsProvider`;
2142
+ function Vs() {
2143
+ let e2 = i(zs);
2144
+ if (!e2) throw Error(Bs);
2153
2145
  return e2;
2154
2146
  }
2155
- function Gs(e2) {
2156
- return e2.basedOn === Ha.CUSTOMER_TIME_ZONE ? Intl.DateTimeFormat().resolvedOptions().timeZone : void 0;
2147
+ function Hs(e2) {
2148
+ return e2.basedOn === La.CUSTOMER_TIME_ZONE ? Intl.DateTimeFormat().resolvedOptions().timeZone : void 0;
2157
2149
  }
2158
- function Ks() {
2159
- let e2 = Ws();
2160
- return e2.isLoading ? void 0 : Gs(e2.displayTimeZonePolicy);
2150
+ function Us() {
2151
+ let e2 = Vs();
2152
+ return e2.isLoading ? void 0 : Hs(e2.displayTimeZonePolicy);
2161
2153
  }
2162
- function qs({ settingsPromise: e2, children: t2 }) {
2163
- let n2 = vs(e2), r2 = o(() => ({ isLoading: false, ...n2 }), [n2]);
2164
- return p(Hs.Provider, { value: r2, children: t2 });
2154
+ function Ws({ settingsPromise: e2, children: t2 }) {
2155
+ let n2 = gs(e2), r2 = o(() => ({ isLoading: false, ...n2 }), [n2]);
2156
+ return p(zs.Provider, { value: r2, children: t2 });
2165
2157
  }
2166
- function Js({ bookingsSettings: e2, children: n2 }) {
2167
- let r2 = ws(), [i2] = c(() => e2 ? null : Rs({ key: Es(), warmupData: r2, fetchData: Bs }));
2168
- return e2 ? p(Hs.Provider, { value: { isLoading: false, ...e2 }, children: n2 }) : p(t, { fallback: p(Hs.Provider, { value: Vs, children: n2 }), children: p(qs, { settingsPromise: i2, children: n2 }) });
2158
+ function Gs({ bookingsSettings: e2, children: n2 }) {
2159
+ let r2 = xs(), [i2] = c(() => e2 ? null : Fs({ key: Cs(), warmupData: r2, fetchData: Ls }));
2160
+ return e2 ? p(zs.Provider, { value: { isLoading: false, ...e2 }, children: n2 }) : p(t, { fallback: p(zs.Provider, { value: Rs, children: n2 }), children: p(Ws, { settingsPromise: i2, children: n2 }) });
2169
2161
  }
2170
- var Ys = 1e3;
2171
- var Xs = class extends e {
2162
+ var Ks = 1e3;
2163
+ var qs = class extends e {
2172
2164
  state = { hasError: false };
2173
2165
  static getDerivedStateFromError() {
2174
2166
  return { hasError: true };
2175
2167
  }
2176
2168
  componentDidCatch(e2, t2) {
2177
- wo(e2, { feature: this.props.feature ?? `service`, action: `render`, contexts: { react: { componentStack: t2.componentStack } } });
2169
+ bo(e2, { feature: this.props.feature ?? `service`, action: `render`, contexts: { react: { componentStack: t2.componentStack } } });
2178
2170
  }
2179
2171
  render() {
2180
2172
  return this.state.hasError ? this.props.fallback : this.props.children;
2181
2173
  }
2182
2174
  };
2183
- var Zs = `appSectionParams`;
2184
- function Qs(e2) {
2185
- let t2 = e2.searchParams.get(Zs);
2175
+ var Js = `appSectionParams`;
2176
+ function Ys(e2) {
2177
+ let t2 = e2.searchParams.get(Js);
2186
2178
  if (t2 === null) return e2;
2187
2179
  let n2 = new URL(e2);
2188
- n2.searchParams.delete(Zs);
2189
- for (let [e3, r2] of Object.entries($s(t2))) typeof r2 == `string` && !n2.searchParams.has(e3) && n2.searchParams.set(e3, r2);
2180
+ n2.searchParams.delete(Js);
2181
+ for (let [e3, r2] of Object.entries(Xs(t2))) typeof r2 == `string` && !n2.searchParams.has(e3) && n2.searchParams.set(e3, r2);
2190
2182
  return n2;
2191
2183
  }
2192
- function $s(e2) {
2184
+ function Xs(e2) {
2193
2185
  try {
2194
2186
  let t2 = JSON.parse(e2);
2195
2187
  return t2 && typeof t2 == `object` && !Array.isArray(t2) ? t2 : {};
@@ -2197,16 +2189,16 @@ function $s(e2) {
2197
2189
  return {};
2198
2190
  }
2199
2191
  }
2200
- var ec = `bookings-uou:url-change`;
2201
- var tc = (e2) => {
2192
+ var Zs = `bookings-uou:url-change`;
2193
+ var Qs = (e2) => {
2202
2194
  let t2 = new URL(e2);
2203
2195
  return t2.searchParams.sort(), t2.href;
2204
2196
  };
2205
- function nc(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
2197
+ function $s(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
2206
2198
  let r2 = globalThis.window;
2207
2199
  if (!r2?.history) return;
2208
2200
  let i2 = new URL(r2.location.href);
2209
- if (tc(i2) === tc(e2)) return;
2201
+ if (Qs(i2) === Qs(e2)) return;
2210
2202
  let a2 = { scrollY: r2.scrollY };
2211
2203
  if (n2) r2.history.replaceState(a2, ``, e2.href);
2212
2204
  else {
@@ -2217,82 +2209,82 @@ function nc(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
2217
2209
  return;
2218
2210
  }
2219
2211
  }
2220
- r2.dispatchEvent(new Event(ec));
2212
+ r2.dispatchEvent(new Event(Zs));
2221
2213
  }
2222
- function rc(e2) {
2214
+ function ec(e2) {
2223
2215
  let t2 = globalThis.window;
2224
- return t2 ? (t2.addEventListener(ec, e2), t2.addEventListener(`popstate`, e2), () => {
2225
- t2.removeEventListener(ec, e2), t2.removeEventListener(`popstate`, e2);
2216
+ return t2 ? (t2.addEventListener(Zs, e2), t2.addEventListener(`popstate`, e2), () => {
2217
+ t2.removeEventListener(Zs, e2), t2.removeEventListener(`popstate`, e2);
2226
2218
  }) : () => {
2227
2219
  };
2228
2220
  }
2229
- var ic = (e2) => {
2221
+ var tc = (e2) => {
2230
2222
  try {
2231
2223
  return decodeURIComponent(e2);
2232
2224
  } catch {
2233
2225
  return e2;
2234
2226
  }
2235
2227
  };
2236
- function ac(e2, t2) {
2228
+ function nc(e2, t2) {
2237
2229
  let n2 = t2 ? new URL(t2).pathname : `/`;
2238
- return `./${ic(new URL(e2).pathname.replace(n2, ``).replace(/^\/|\/$/g, ``))}`;
2230
+ return `./${tc(new URL(e2).pathname.replace(n2, ``).replace(/^\/|\/$/g, ``))}`;
2239
2231
  }
2240
- function oc() {
2241
- let e2 = f(zr), t2 = r(() => e2.currentUrl, [e2]), n2 = l(rc, t2, t2), i2 = o(() => Qs(new URL(n2)), [n2]), a2 = e2.siteUrl.replace(/\/$/, ``);
2242
- return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () => Qs(new URL(e2.currentUrl)), getRelativeUrl: () => ac(e2.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: nc };
2232
+ function rc() {
2233
+ let e2 = f(Fr), t2 = r(() => e2.currentUrl, [e2]), n2 = l(ec, t2, t2), i2 = o(() => Ys(new URL(n2)), [n2]), a2 = e2.siteUrl.replace(/\/$/, ``);
2234
+ return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () => Ys(new URL(e2.currentUrl)), getRelativeUrl: () => nc(e2.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: $s };
2243
2235
  }
2244
- var sc = Fr(`@wix/viewer-service-business-logger`);
2245
- function cc(e2) {
2236
+ var ic = jr(`@wix/site-service-business-logger`);
2237
+ function ac(e2) {
2246
2238
  return { evid: 32, src: 16, endpoint: ``, params: e2 };
2247
2239
  }
2248
- function lc(e2) {
2240
+ function oc(e2) {
2249
2241
  return { evid: 33, src: 16, endpoint: ``, params: e2 };
2250
2242
  }
2251
- function uc(e2) {
2243
+ function sc(e2) {
2252
2244
  return { evid: 34, src: 16, endpoint: ``, params: e2 };
2253
2245
  }
2254
- var dc = { 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` };
2255
- Kr.BOOK_ONLINE;
2256
- var fc = `new_bookings_server`;
2257
- var pc = { TIMEZONE_PICKER: `timezone_picker`, TIME_PICKER: `time_picker`, BOOKING_DETAILS: `booking_details`, RESCHEDULE_DIALOG: `reschedule_dialog` };
2258
- var mc = { DROPDOWN: `dropdown`, TIME_SLOT: `time_slot`, EXPAND: `expand`, COLLAPSE: `collapse` };
2259
- var hc = (e2) => {
2260
- let t2 = f(sc);
2246
+ var cc = { 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` };
2247
+ Vr.BOOK_ONLINE;
2248
+ var lc = `new_bookings_server`;
2249
+ var uc = { TIMEZONE_PICKER: `timezone_picker`, TIME_PICKER: `time_picker`, BOOKING_DETAILS: `booking_details`, RESCHEDULE_DIALOG: `reschedule_dialog` };
2250
+ var dc = { DROPDOWN: `dropdown`, TIME_SLOT: `time_slot`, EXPAND: `expand`, COLLAPSE: `collapse` };
2251
+ var fc = (e2) => {
2252
+ let { reportBi: t2 } = f(ic);
2261
2253
  return r((n2) => {
2262
- t2.reportBi({ widget_name: e2, bookingsPlatform: fc, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
2254
+ t2({ widget_name: e2, bookingsPlatform: lc, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
2263
2255
  }, [t2, e2]);
2264
2256
  };
2265
- var gc = (e2, t2 = true) => {
2266
- let n2 = hc(e2), { getParsedUrl: r2 } = oc(), i2 = s(false);
2257
+ var pc = (e2, t2 = true) => {
2258
+ let n2 = fc(e2), { getParsedUrl: r2 } = rc(), i2 = s(false);
2267
2259
  a(() => {
2268
- t2 && !i2.current && (i2.current = true, n2(cc({ referralInfo: r2().searchParams.get(Qa.referral) ?? void 0 })));
2260
+ t2 && !i2.current && (i2.current = true, n2(ac({ referralInfo: r2().searchParams.get(qa.referral) ?? void 0 })));
2269
2261
  }, [t2, n2, r2]);
2270
2262
  };
2271
- function _c(e2) {
2263
+ function mc(e2) {
2272
2264
  return { evid: 596, src: 16, endpoint: `wixboost-ugc`, params: e2 };
2273
2265
  }
2274
- function vc(e2, t2) {
2266
+ function hc(e2, t2) {
2275
2267
  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 = {};
2276
2268
  for (let e3 of n2) e3.type !== `literal` && (r2[e3.type] = Number(e3.value));
2277
2269
  return Date.UTC(r2.year, r2.month - 1, r2.day, r2.hour, r2.minute, r2.second) - e2;
2278
2270
  }
2279
- function yc(e2, t2) {
2271
+ function gc(e2, t2) {
2280
2272
  let n2 = e2.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?/);
2281
2273
  if (!n2) return null;
2282
2274
  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);
2283
2275
  if (Number.isNaN(l2)) return null;
2284
2276
  try {
2285
- let e3 = l2 - vc(l2, t2);
2286
- return new Date(l2 - vc(e3, t2));
2277
+ let e3 = l2 - hc(l2, t2);
2278
+ return new Date(l2 - hc(e3, t2));
2287
2279
  } catch {
2288
2280
  return null;
2289
2281
  }
2290
2282
  }
2291
- function bc({ start: e2, end: t2, timeZone: n2, ...r2 }) {
2292
- let i2 = (e3) => e3 && n2 ? yc(e3, n2)?.getTime() : void 0;
2293
- return uc({ bookingsServiceId: r2.serviceId, serviceType: r2.serviceType, startTime: i2(e2), endTime: i2(t2), isEligibleForFlowCompletion: r2.isEligibleForFlowCompletion });
2283
+ function _c({ start: e2, end: t2, timeZone: n2, ...r2 }) {
2284
+ let i2 = (e3) => e3 && n2 ? gc(e3, n2)?.getTime() : void 0;
2285
+ return sc({ bookingsServiceId: r2.serviceId, serviceType: r2.serviceType, startTime: i2(e2), endTime: i2(t2), isEligibleForFlowCompletion: r2.isEligibleForFlowCompletion });
2294
2286
  }
2295
- function xc({ nextAvailableSlotsCount: e2, isLoading: t2, hasError: n2, children: r2 }) {
2287
+ function vc({ nextAvailableSlotsCount: e2, isLoading: t2, hasError: n2, children: r2 }) {
2296
2288
  let i2 = n2 ? `loadFailed` : null, a2 = { selectedDate: null, daysAvailabilityRange: null, daysAvailability: [], daysAvailabilityLoading: false, daysAvailabilityHasError: false, timeSlotsLoading: t2, timeSlotsErrorCode: i2, selectDate: async () => {
2297
2289
  }, setDaysAvailabilityRange: async () => {
2298
2290
  }, nextDaysAvailabilityRange: async () => {
@@ -2308,119 +2300,119 @@ function xc({ nextAvailableSlotsCount: e2, isLoading: t2, hasError: n2, children
2308
2300
  }, navigateToBookingForm: () => {
2309
2301
  }, timeSlotLimitPerDay: null, expandedDates: /* @__PURE__ */ new Set(), daysWithMore: /* @__PURE__ */ new Set(), loadingDate: null, loadAllTimeSlotsForDay: async () => {
2310
2302
  } };
2311
- return p(xl.Provider, { value: a2, children: r2 });
2303
+ return p(vl.Provider, { value: a2, children: r2 });
2312
2304
  }
2313
- function Sc({ nextAvailableSlotsCount: e2, children: t2 }) {
2314
- return p(xc, { nextAvailableSlotsCount: e2, isLoading: true, hasError: false, children: t2 });
2305
+ function yc({ nextAvailableSlotsCount: e2, children: t2 }) {
2306
+ return p(vc, { nextAvailableSlotsCount: e2, isLoading: true, hasError: false, children: t2 });
2315
2307
  }
2316
- function Cc({ nextAvailableSlotsCount: e2, children: t2 }) {
2317
- return p(xc, { nextAvailableSlotsCount: e2, isLoading: false, hasError: true, children: t2 });
2308
+ function bc({ nextAvailableSlotsCount: e2, children: t2 }) {
2309
+ return p(vc, { nextAvailableSlotsCount: e2, isLoading: false, hasError: true, children: t2 });
2318
2310
  }
2319
- var wc = 1e3;
2320
- function Tc(e2, t2) {
2311
+ var xc = 1e3;
2312
+ function Sc(e2, t2) {
2321
2313
  let n2 = /* @__PURE__ */ new Map();
2322
2314
  for (let e3 of t2) {
2323
2315
  let t3 = e3.localStartDate?.slice(0, 10);
2324
2316
  t3 && (e3.bookable ? n2.set(t3, `available`) : n2.has(t3) || n2.set(t3, `unavailable`));
2325
2317
  }
2326
- let r2 = [], i2 = Fo(e2);
2318
+ let r2 = [], i2 = No(e2);
2327
2319
  for (let t3 = 0; t3 < i2; t3 += 1) {
2328
- let i3 = Po(e2.startDate, t3);
2320
+ let i3 = Mo(e2.startDate, t3);
2329
2321
  r2.push({ date: i3, availability: n2.get(i3) ?? `none` });
2330
2322
  }
2331
2323
  return r2;
2332
2324
  }
2333
- function Ec(e2) {
2334
- return { fromLocalDate: Do($(e2.startDate)), toLocalDate: Oo($(e2.endDate)) };
2325
+ function Cc(e2, t2) {
2326
+ return { fromLocalDate: Do(e2.startDate, t2), toLocalDate: To(So(e2.endDate)) };
2335
2327
  }
2336
- async function Dc(e2, t2, n2, r2, i2, a2) {
2337
- return (await as({ serviceId: e2, ...Ec(n2), timeZone: t2, ...Jo(r2), ...Yo(i2), ...Zo(a2, i2), timeSlotsPerDay: 1, cursorPaging: { limit: Math.min(Fo(n2), wc) } })).timeSlots ?? [];
2328
+ async function wc(e2, t2, n2, r2, i2, a2) {
2329
+ return (await rs({ serviceId: e2, ...Cc(n2, t2), timeZone: t2, ...Ko(r2), ...qo(i2), ...Yo(a2, i2), timeSlotsPerDay: 1, cursorPaging: { limit: Math.min(No(n2), xc) } })).timeSlots ?? [];
2338
2330
  }
2339
- async function Oc(e2, t2, n2, r2, i2, a2) {
2340
- return (await ss({ serviceIds: [e2], ...Ec(n2), timeZone: t2, includeNonBookable: true, eventFilter: { type: `CLASS`, ...os(r2, i2, a2) }, maxSlotsPerDay: 1, cursorPaging: { limit: Math.min(Fo(n2), wc) } })).timeSlots;
2331
+ async function Tc(e2, t2, n2, r2, i2, a2) {
2332
+ return (await as({ serviceIds: [e2], ...Cc(n2, t2), timeZone: t2, includeNonBookable: true, eventFilter: { type: `CLASS`, ...is(r2, i2, a2) }, maxSlotsPerDay: 1, cursorPaging: { limit: Math.min(No(n2), xc) } })).timeSlots;
2341
2333
  }
2342
- async function kc({ serviceId: e2, serviceType: t2, range: n2, fromDate: r2, timeZone: i2, locationId: a2, staffId: o2, customerChoices: s2, minRemainingCapacity: c2 }) {
2343
- if (Za(t2) || n2.endDate < r2) return Tc(n2, []);
2344
- let l2 = { startDate: n2.startDate < r2 ? r2 : n2.startDate, endDate: n2.endDate }, u2 = Xa(t2) ? Vo(l2) : [l2];
2345
- return Tc(n2, (await Promise.all(u2.map((n3) => Xa(t2) ? Oc(e2, i2, n3, a2, o2, c2) : Dc(e2, i2, n3, a2, o2, s2)))).flat());
2334
+ async function Ec({ serviceId: e2, serviceType: t2, range: n2, fromDate: r2, timeZone: i2, locationId: a2, staffId: o2, customerChoices: s2, minRemainingCapacity: c2 }) {
2335
+ if (Ka(t2) || n2.endDate < r2) return Sc(n2, []);
2336
+ let l2 = { startDate: n2.startDate < r2 ? r2 : n2.startDate, endDate: n2.endDate }, u2 = Ga(t2) ? zo(l2) : [l2];
2337
+ return Sc(n2, (await Promise.all(u2.map((n3) => Ga(t2) ? Tc(e2, i2, n3, a2, o2, c2) : wc(e2, i2, n3, a2, o2, s2)))).flat());
2346
2338
  }
2347
- function Ac({ serviceId: e2, staff: t2, customerChoices: n2 }) {
2339
+ function Dc({ serviceId: e2, staff: t2, customerChoices: n2 }) {
2348
2340
  let r2 = t2 && !t2.anyResource ? t2.staffMemberId : void 0;
2349
- return { serviceId: e2, ...Zo(n2, r2), ...t2?.anyResource ? {} : { includeResourceTypeIds: [Gr] }, ...r2 ? { resourceTypes: [{ resourceTypeId: Gr, resourceIds: [r2] }] } : {} };
2341
+ return { serviceId: e2, ...Yo(n2, r2), ...t2?.anyResource ? {} : { includeResourceTypeIds: [Br] }, ...r2 ? { resourceTypes: [{ resourceTypeId: Br, resourceIds: [r2] }] } : {} };
2350
2342
  }
2351
- function jc({ services: e2, locationId: t2, locationType: n2, timeZone: r2 }) {
2352
- return { services: e2.map(Ac), timeZone: r2, location: { ...t2 ? { _id: t2 } : {}, locationType: n2 } };
2343
+ function Oc({ services: e2, locationId: t2, locationType: n2, timeZone: r2 }) {
2344
+ return { services: e2.map(Dc), timeZone: r2, location: { ...t2 ? { _id: t2 } : {}, locationType: n2 } };
2353
2345
  }
2354
- function Mc(e2) {
2355
- let { customerChoices: t2, ...n2 } = e2, r2 = t2 ? Xo(t2) : void 0;
2346
+ function kc(e2) {
2347
+ let { customerChoices: t2, ...n2 } = e2, r2 = t2 ? Jo(t2) : void 0;
2356
2348
  return r2 ? { ...n2, customerChoices: r2 } : n2;
2357
2349
  }
2358
- async function Nc(e2) {
2359
- let t2 = e2.services ?? [], n2 = () => Ea({ ...e2, services: t2.map(Mc) }), r2 = t2.some((e3) => e3.customerChoices?.requestedGender);
2360
- if (r2 && ns()) return n2();
2350
+ async function Ac(e2) {
2351
+ let t2 = e2.services ?? [], n2 = () => xa({ ...e2, services: t2.map(kc) }), r2 = t2.some((e3) => e3.customerChoices?.requestedGender);
2352
+ if (r2 && es()) return n2();
2361
2353
  try {
2362
- return await Ea(e2);
2354
+ return await xa(e2);
2363
2355
  } catch (e3) {
2364
- if (!r2 || !$o(e3)) throw e3;
2365
- return wo(e3, { feature: So.timeSlots, action: `requested-gender-rejected`, level: `warning` }), is(), n2();
2356
+ if (!r2 || !Zo(e3)) throw e3;
2357
+ return bo(e3, { feature: vo.timeSlots, action: `requested-gender-rejected`, level: `warning` }), ns(), n2();
2366
2358
  }
2367
2359
  }
2368
- var Pc = 1e3;
2369
- async function Fc({ range: e2, fromDate: t2, ...n2 }) {
2370
- if (e2.endDate < t2) return Tc(e2, []);
2360
+ var jc = 1e3;
2361
+ async function Mc({ range: e2, fromDate: t2, ...n2 }) {
2362
+ if (e2.endDate < t2) return Sc(e2, []);
2371
2363
  let r2 = { startDate: e2.startDate < t2 ? t2 : e2.startDate, endDate: e2.endDate };
2372
- return Tc(e2, (await Nc({ ...jc(n2), fromLocalDate: Do($(r2.startDate)), toLocalDate: Oo($(r2.endDate)), timeSlotsPerDay: 1, cursorPaging: { limit: Math.min(Fo(r2), Pc) } })).timeSlots ?? []);
2364
+ return Sc(e2, (await Ac({ ...Oc(n2), fromLocalDate: Do(r2.startDate, n2.timeZone), toLocalDate: To(So(r2.endDate)), timeSlotsPerDay: 1, cursorPaging: { limit: Math.min(No(r2), jc) } })).timeSlots ?? []);
2373
2365
  }
2374
- async function Ic({ date: e2, onlyAvailableSlots: t2, fromLocalDate: n2, ...r2 }) {
2366
+ async function Nc({ date: e2, onlyAvailableSlots: t2, fromLocalDate: n2, ...r2 }) {
2375
2367
  let i2 = `${e2}T00:00:00`, a2 = [], o2 = null, s2;
2376
2368
  do {
2377
- let c2 = await Nc({ ...jc(r2), fromLocalDate: n2 && n2 > i2 ? n2 : i2, toLocalDate: `${e2}T23:59:59`, ...t2 ? { bookable: true } : {}, cursorPaging: { limit: Pc, ...s2 ? { cursor: s2 } : {} } });
2369
+ let c2 = await Ac({ ...Oc(r2), fromLocalDate: n2 && n2 > i2 ? n2 : i2, toLocalDate: `${e2}T23:59:59`, ...t2 ? { bookable: true } : {}, cursorPaging: { limit: jc, ...s2 ? { cursor: s2 } : {} } });
2378
2370
  a2.push(...c2.timeSlots ?? []), o2 = c2.timeZone ?? o2, s2 = c2.cursorPagingMetadata?.cursors?.next || void 0;
2379
2371
  } while (s2);
2380
2372
  return { timeSlots: a2, timeZone: o2 };
2381
2373
  }
2382
- async function Lc({ fromDate: e2, ...t2 }) {
2383
- let n2 = await Nc({ ...jc(t2), ...fs(e2), bookable: true, cursorPaging: { limit: 1 } });
2374
+ async function Pc({ fromDate: e2, ...t2 }) {
2375
+ let n2 = await Ac({ ...Oc(t2), ...us(e2), bookable: true, cursorPaging: { limit: 1 } });
2384
2376
  return { timeSlots: n2.timeSlots ?? [], timeZone: n2.timeZone ?? null };
2385
2377
  }
2386
- var Rc = [];
2387
- function zc({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest: i2, timeZone: l2, today: u2, locationId: d2, staffId: f2, loadInitially: p2, customerChoices: m2, minRemainingCapacity: h2, onlyAvailableSlots: g2 }) {
2388
- let [_2, v2] = c(null), [y2, b2] = c(p2), [x2, S2] = c(Rc), [C2, w2] = c(false), [T2, ee2] = c(false), E2 = s(0);
2378
+ var Fc = [];
2379
+ function Ic({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest: i2, timeZone: l2, today: u2, locationId: d2, staffId: f2, loadInitially: p2, customerChoices: m2, minRemainingCapacity: h2, onlyAvailableSlots: g2 }) {
2380
+ let [_2, v2] = c(null), [y2, b2] = c(p2), [x2, S2] = c(Fc), [C2, w2] = c(false), [T2, ee2] = c(false), E2 = s(0);
2389
2381
  a(() => {
2390
- _2 === null && u2 && v2(Io(u2));
2382
+ _2 === null && u2 && v2(Po(u2));
2391
2383
  }, [_2, u2]), a(() => {
2392
- if (!y2 || !e2 || !(t2 || i2) || !l2 || !u2 || !_2 || !i2 && Za(n2)) return;
2384
+ if (!y2 || !e2 || !(t2 || i2) || !l2 || !u2 || !_2 || !i2 && Ka(n2)) return;
2393
2385
  let r2 = ++E2.current;
2394
- return w2(true), (i2 ? Fc({ ...i2, range: _2, fromDate: u2, timeZone: l2 }) : kc({ serviceId: t2, serviceType: n2, range: _2, fromDate: u2, timeZone: l2, locationId: d2 ?? void 0, staffId: f2 ?? void 0, customerChoices: m2, minRemainingCapacity: h2 })).then((e3) => {
2386
+ return w2(true), (i2 ? Mc({ ...i2, range: _2, fromDate: u2, timeZone: l2 }) : Ec({ serviceId: t2, serviceType: n2, range: _2, fromDate: u2, timeZone: l2, locationId: d2 ?? void 0, staffId: f2 ?? void 0, customerChoices: m2, minRemainingCapacity: h2 })).then((e3) => {
2395
2387
  r2 === E2.current && (S2(e3), ee2(false), w2(false));
2396
2388
  }).catch((e3) => {
2397
- r2 === E2.current && (wo(e3, { feature: So.timeSlots, action: `fetch-days-availability`, level: `warning` }), ee2(true), w2(false));
2389
+ r2 === E2.current && (bo(e3, { feature: vo.timeSlots, action: `fetch-days-availability`, level: `warning` }), ee2(true), w2(false));
2398
2390
  }), () => {
2399
2391
  r2 === E2.current && (E2.current += 1);
2400
2392
  };
2401
2393
  }, [y2, e2, t2, n2, i2, l2, u2, _2, d2, f2, m2, h2]);
2402
2394
  let D2 = r(async (e3) => {
2403
- No(e3) && (v2(e3), b2(true));
2395
+ jo(e3) && (v2(e3), b2(true));
2396
+ }, []), O2 = r(async () => {
2397
+ v2((e3) => e3 && Io(e3, 1)), b2(true);
2404
2398
  }, []), te2 = r(async () => {
2405
- v2((e3) => e3 && Ro(e3, 1)), b2(true);
2406
- }, []), ne2 = r(async () => {
2407
- v2((e3) => e3 && Ro(e3, -1)), b2(true);
2399
+ v2((e3) => e3 && Io(e3, -1)), b2(true);
2408
2400
  }, []);
2409
- return { range: _2, daysAvailability: o(() => g2 ? x2.map((e3) => e3.availability === `unavailable` ? { ...e3, availability: `none` } : e3) : x2, [x2, g2]), isLoading: C2, hasError: T2, setRange: D2, nextRange: te2, previousRange: ne2 };
2401
+ return { range: _2, daysAvailability: o(() => g2 ? x2.map((e3) => e3.availability === `unavailable` ? { ...e3, availability: `none` } : e3) : x2, [x2, g2]), isLoading: C2, hasError: T2, setRange: D2, nextRange: O2, previousRange: te2 };
2410
2402
  }
2411
- function Bc({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest: i2, timeZone: o2, today: l2, locationId: u2, staffId: d2, customerChoices: f2, minRemainingCapacity: p2, onlyAvailableSlots: m2, serviceLoading: h2 }) {
2412
- let [g2, _2] = c(null), [v2, y2] = c(0), [b2, x2] = c(null), [S2, C2] = c(null), [w2, T2] = c(null), [ee2, E2] = c(false), D2 = s(0), te2 = s(0), ne2 = s(0), O2 = r(() => {
2413
- te2.current += 1, E2(false);
2403
+ function Lc({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest: i2, timeZone: o2, today: l2, locationId: u2, staffId: d2, customerChoices: f2, minRemainingCapacity: p2, onlyAvailableSlots: m2, serviceLoading: h2 }) {
2404
+ let [g2, _2] = c(null), [v2, y2] = c(0), [b2, x2] = c(null), [S2, C2] = c(null), [w2, T2] = c(null), [ee2, E2] = c(false), D2 = s(0), O2 = s(0), te2 = s(0), k2 = r(() => {
2405
+ O2.current += 1, E2(false);
2414
2406
  }, []);
2415
2407
  a(() => {
2416
- O2();
2417
- }, [e2, t2, n2, i2, o2, u2, d2, f2, p2, O2]);
2418
- let k2 = e2 && !h2 && !t2 && !i2;
2408
+ k2();
2409
+ }, [e2, t2, n2, i2, o2, u2, d2, f2, p2, k2]);
2410
+ let A2 = e2 && !h2 && !t2 && !i2;
2419
2411
  a(() => {
2420
- k2 && (C2(null), T2(null));
2421
- }, [k2]), a(() => {
2412
+ A2 && (C2(null), T2(null));
2413
+ }, [A2]), a(() => {
2422
2414
  if (!g2) return;
2423
- if (k2) {
2415
+ if (A2) {
2424
2416
  _2(null);
2425
2417
  return;
2426
2418
  }
@@ -2429,99 +2421,99 @@ function Bc({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest:
2429
2421
  _2(null);
2430
2422
  return;
2431
2423
  }
2432
- if (!i2 && Za(n2)) {
2424
+ if (!i2 && Ka(n2)) {
2433
2425
  _2(null);
2434
2426
  return;
2435
2427
  }
2436
- let r2 = ko(new Date(Date.now()), o2), a2 = ++D2.current;
2428
+ let r2 = Eo(new Date(Date.now()), o2), a2 = ++D2.current;
2437
2429
  x2(null), C2(null), T2(null);
2438
2430
  let s2 = r2.slice(0, 10) === g2.date ? r2 : void 0;
2439
- return (i2 ? Ic({ ...i2, date: g2.date, timeZone: o2, onlyAvailableSlots: m2, fromLocalDate: s2 }) : hs({ serviceId: t2, serviceType: n2, date: g2.date, timeZone: o2, onlyAvailableSlots: m2, locationId: u2 ?? void 0, staffId: d2 ?? void 0, customerChoices: f2, minRemainingCapacity: p2, fromLocalDate: s2 })).then((e3) => {
2431
+ return (i2 ? Nc({ ...i2, date: g2.date, timeZone: o2, onlyAvailableSlots: m2, fromLocalDate: s2 }) : ps({ serviceId: t2, serviceType: n2, date: g2.date, timeZone: o2, onlyAvailableSlots: m2, locationId: u2 ?? void 0, staffId: d2 ?? void 0, customerChoices: f2, minRemainingCapacity: p2, fromLocalDate: s2 })).then((e3) => {
2440
2432
  a2 === D2.current && x2({ timeSlots: e3.timeSlots, timeZone: e3.timeZone ?? o2 });
2441
2433
  }).catch((e3) => {
2442
- a2 === D2.current && (wo(e3, { feature: So.timeSlots, action: `fetch-day-time-slots`, level: `warning` }), C2(`timeSlotsLoadFailed`));
2434
+ a2 === D2.current && (bo(e3, { feature: vo.timeSlots, action: `fetch-day-time-slots`, level: `warning` }), C2(`timeSlotsLoadFailed`));
2443
2435
  }), () => {
2444
2436
  a2 === D2.current && (D2.current += 1);
2445
2437
  };
2446
2438
  }, [g2, v2, e2, t2, h2, n2, i2, o2, l2, u2, d2, f2, p2, m2]);
2447
- let re2 = r(async (e3) => {
2448
- !i2 && Za(n2) || !Mo(e3) || l2 && e3 < l2 || (O2(), y2((e4) => e4 + 1), _2({ kind: `day`, date: e3 }));
2449
- }, [n2, i2, l2, O2]), ie2 = g2?.date ?? null, A2 = r(async () => {
2439
+ let ne2 = r(async (e3) => {
2440
+ !i2 && Ka(n2) || !Ao(e3) || l2 && e3 < l2 || (k2(), y2((e4) => e4 + 1), _2({ kind: `day`, date: e3 }));
2441
+ }, [n2, i2, l2, k2]), re2 = g2?.date ?? null, j2 = r(async () => {
2450
2442
  let r2 = !!(t2 || i2);
2451
- if (!i2 && Za(n2) || !e2 || !r2 || !o2) return { outcome: `none` };
2452
- let a2 = D2.current, s2 = ++te2.current, c2 = ++ne2.current, m3 = () => a2 === D2.current && s2 === te2.current;
2443
+ if (!i2 && Ka(n2) || !e2 || !r2 || !o2) return { outcome: `none` };
2444
+ let a2 = D2.current, s2 = ++O2.current, c2 = ++te2.current, m3 = () => a2 === D2.current && s2 === O2.current;
2453
2445
  E2(true), T2(null);
2454
2446
  try {
2455
- let e3 = ie2 ?? l2 ?? void 0, r3 = i2 ? await Lc({ ...i2, timeZone: o2, fromDate: e3 }) : await ps({ serviceId: t2, serviceType: n2, timeZone: o2, limit: 1, onlyAvailableSlots: true, fromDate: e3, locationId: u2 ?? void 0, staffId: d2 ?? void 0, customerChoices: f2, minRemainingCapacity: p2 });
2447
+ let e3 = re2 ?? l2 ?? void 0, r3 = i2 ? await Pc({ ...i2, timeZone: o2, fromDate: e3 }) : await ds({ serviceId: t2, serviceType: n2, timeZone: o2, limit: 1, onlyAvailableSlots: true, fromDate: e3, locationId: u2 ?? void 0, staffId: d2 ?? void 0, customerChoices: f2, minRemainingCapacity: p2 });
2456
2448
  if (!m3()) return { outcome: `cancelled` };
2457
2449
  let a3 = r3.timeSlots[0]?.localStartDate?.slice(0, 10) ?? null;
2458
2450
  return a3 ? { outcome: `found`, date: a3 } : { outcome: `none` };
2459
2451
  } catch (e3) {
2460
- return m3() ? (wo(e3, { feature: So.timeSlots, action: `find-next-available-date`, level: `warning` }), T2(`timeSlotsLoadFailed`), { outcome: `error` }) : { outcome: `cancelled` };
2452
+ return m3() ? (bo(e3, { feature: vo.timeSlots, action: `find-next-available-date`, level: `warning` }), T2(`timeSlotsLoadFailed`), { outcome: `error` }) : { outcome: `cancelled` };
2461
2453
  } finally {
2462
- c2 === ne2.current && E2(false);
2454
+ c2 === te2.current && E2(false);
2463
2455
  }
2464
- }, [e2, t2, n2, i2, o2, l2, u2, d2, f2, p2, ie2]), ae2 = w2 ?? S2;
2465
- return { query: g2, selectedDate: ie2, timeSlots: b2?.timeSlots ?? null, timeZone: b2?.timeZone ?? null, isLoading: ee2 || g2 !== null && b2 === null && S2 === null, error: ae2, selectDate: re2, findNextAvailableDate: A2 };
2456
+ }, [e2, t2, n2, i2, o2, l2, u2, d2, f2, p2, re2]), ie2 = w2 ?? S2;
2457
+ return { query: g2, selectedDate: re2, timeSlots: b2?.timeSlots ?? null, timeZone: b2?.timeZone ?? null, isLoading: ee2 || g2 !== null && b2 === null && S2 === null, error: ie2, selectDate: ne2, findNextAvailableDate: j2 };
2466
2458
  }
2467
- function Vc(e2, t2) {
2459
+ function Rc(e2, t2) {
2468
2460
  return t2 === void 0 ? false : !e2 || new Date(e2).getTime() <= t2;
2469
2461
  }
2470
- function Hc({ serviceId: e2, serviceType: t2, lastSessionEnd: n2, timeZone: r2, now: i2, onlyAvailableSlots: a2, locationId: o2, staffId: s2, timeSlotLimitPerDay: c2, customerChoices: l2, minRemainingCapacity: u2 }) {
2471
- let d2 = { serviceId: e2, onlyAvailableSlots: a2, locationId: o2 ?? void 0, staffId: s2 ?? void 0, timeZone: r2, fromLocalDate: ko(new Date(i2), r2) };
2472
- return Xa(t2) ? { ...d2, serviceType: `CLASS`, minRemainingCapacity: u2 } : Za(t2) ? !n2 || Vc(n2, i2) ? void 0 : { ...d2, serviceType: `COURSE`, toLocalDate: ko(new Date(n2), r2) } : { ...d2, serviceType: `APPOINTMENT`, toLocalDate: fs().toLocalDate, timeSlotsPerDay: c2 + 1, customerChoices: l2 };
2462
+ function zc({ serviceId: e2, serviceType: t2, lastSessionEnd: n2, timeZone: r2, now: i2, onlyAvailableSlots: a2, locationId: o2, staffId: s2, timeSlotLimitPerDay: c2, customerChoices: l2, minRemainingCapacity: u2 }) {
2463
+ let d2 = { serviceId: e2, onlyAvailableSlots: a2, locationId: o2 ?? void 0, staffId: s2 ?? void 0, timeZone: r2, fromLocalDate: Eo(new Date(i2), r2) };
2464
+ return Ga(t2) ? { ...d2, serviceType: `CLASS`, minRemainingCapacity: u2 } : Ka(t2) ? !n2 || Rc(n2, i2) ? void 0 : { ...d2, serviceType: `COURSE`, toLocalDate: Eo(new Date(n2), r2) } : { ...d2, serviceType: `APPOINTMENT`, toLocalDate: us().toLocalDate, timeSlotsPerDay: c2 + 1, customerChoices: l2 };
2473
2465
  }
2474
- function Uc({ isAppointment: e2, staffOnSlotCount: t2, hasStaffFilter: n2, hasRequestedGender: r2, hasStaffPricedVariants: i2, staffSelectionStrategy: a2 }) {
2466
+ function Bc({ isAppointment: e2, staffOnSlotCount: t2, hasStaffFilter: n2, hasRequestedGender: r2, hasStaffPricedVariants: i2, staffSelectionStrategy: a2 }) {
2475
2467
  return e2 && t2 > 1 && !n2 && !i2 && (a2 !== `CUSTOMER_MUST_CHOOSE` || r2);
2476
2468
  }
2477
- function Wc(e2, t2) {
2469
+ function Vc(e2, t2) {
2478
2470
  return e2.length ? e2.length === 1 ? { anyResource: false, staffMemberId: e2[0] } : t2 ? { anyResource: true } : null : null;
2479
2471
  }
2480
- function Gc(e2, t2, n2) {
2472
+ function Hc(e2, t2, n2) {
2481
2473
  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 };
2482
2474
  }
2483
- var Kc = { staff: null, requestedGender: null, locationId: null };
2484
- function qc({ entry: e2, appointmentLike: t2, staffChoiceHidden: n2, staffPriced: r2, staffSelectionStrategy: i2, genderAllowed: a2, staffMemberIds: o2, locationIds: s2 }) {
2485
- if (!e2) return Kc;
2486
- let c2 = e2.locationId && s2.includes(e2.locationId) ? e2.locationId : null, l2 = t2 && !n2 ? io(e2) : null;
2487
- if (!l2) return { ...Kc, locationId: c2 };
2488
- if (!l2.anyResource) return o2.includes(l2.staffMemberId) ? { staff: l2, requestedGender: null, locationId: c2 } : { ...Kc, locationId: c2 };
2475
+ var Uc = { staff: null, requestedGender: null, locationId: null };
2476
+ function Wc({ entry: e2, appointmentLike: t2, staffChoiceHidden: n2, staffPriced: r2, staffSelectionStrategy: i2, genderAllowed: a2, staffMemberIds: o2, locationIds: s2 }) {
2477
+ if (!e2) return Uc;
2478
+ let c2 = e2.locationId && s2.includes(e2.locationId) ? e2.locationId : null, l2 = t2 && !n2 ? $a(e2) : null;
2479
+ if (!l2) return { ...Uc, locationId: c2 };
2480
+ if (!l2.anyResource) return o2.includes(l2.staffMemberId) ? { staff: l2, requestedGender: null, locationId: c2 } : { ...Uc, locationId: c2 };
2489
2481
  let u2 = a2 ? e2.requestedGender ?? null : null;
2490
- return o2.length > 1 && !r2 && (i2 !== `CUSTOMER_MUST_CHOOSE` || u2 !== null) ? { staff: l2, requestedGender: u2, locationId: c2 } : { ...Kc, locationId: c2 };
2482
+ return o2.length > 1 && !r2 && (i2 !== `CUSTOMER_MUST_CHOOSE` || u2 !== null) ? { staff: l2, requestedGender: u2, locationId: c2 } : { ...Uc, locationId: c2 };
2491
2483
  }
2492
- var Jc = [];
2493
- function Yc({ sessions: e2, dayQuery: t2, daySlots: n2, staffFilter: r2, appointmentLike: i2, limitPerDay: a2, expandedDates: o2 }) {
2494
- let s2 = il(al(e2, r2)), c2 = n2 ? al(i2 ? qo(n2) : n2, r2) : Jc;
2495
- return { rows: t2 ? c2 : ol(s2, a2, o2), slotIdOf: t2 ? Wo : Ko, daysWithMore: rl(s2, a2, o2) };
2484
+ var Gc = [];
2485
+ function Kc({ sessions: e2, dayQuery: t2, daySlots: n2, staffFilter: r2, appointmentLike: i2, limitPerDay: a2, expandedDates: o2 }) {
2486
+ let s2 = tl(nl(e2, r2)), c2 = n2 ? nl(i2 ? Go(n2) : n2, r2) : Gc;
2487
+ return { rows: t2 ? c2 : rl(s2, a2, o2), slotIdOf: t2 ? Ho : Wo, daysWithMore: el(s2, a2, o2) };
2496
2488
  }
2497
- function Xc({ rows: e2, slotIdOf: t2 }, n2) {
2498
- return [...e2.filter((e3) => t2(e3) === n2)].sort((e3, t3) => nl(t3) - nl(e3))[0] ?? null;
2489
+ function qc({ rows: e2, slotIdOf: t2 }, n2) {
2490
+ return [...e2.filter((e3) => t2(e3) === n2)].sort((e3, t3) => $c(t3) - $c(e3))[0] ?? null;
2499
2491
  }
2500
- function Zc(e2, t2, n2, r2) {
2501
- return { slotId: n2(e2), slotStartTime: e2.localStartDate ?? null, slotEndTime: e2.localEndDate ?? null, bookable: e2.bookable ?? 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: tl(e2, t2), isAllDay: e2.allDay ?? false, staff: r2 ? [] : Qc(e2) };
2492
+ function Jc(e2, t2, n2, r2) {
2493
+ return { slotId: n2(e2), slotStartTime: e2.localStartDate ?? null, slotEndTime: e2.localEndDate ?? null, bookable: e2.bookable ?? 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: Qc(e2, t2), isAllDay: e2.allDay ?? false, staff: r2 ? [] : Yc(e2) };
2502
2494
  }
2503
- function Qc(e2) {
2495
+ function Yc(e2) {
2504
2496
  let t2 = /* @__PURE__ */ new Map();
2505
2497
  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 ?? ``);
2506
2498
  return [...t2].map(([e3, t3]) => ({ staffMemberId: e3, name: t3 }));
2507
2499
  }
2508
- function $c(e2) {
2509
- let t2 = Qc(e2);
2500
+ function Xc(e2) {
2501
+ let t2 = Yc(e2);
2510
2502
  if (t2.length) return t2.length === 1 ? t2[0].staffMemberId : null;
2511
2503
  }
2512
- function el(e2) {
2513
- return Qc(e2).map((e3) => e3.staffMemberId);
2504
+ function Zc(e2) {
2505
+ return Yc(e2).map((e3) => e3.staffMemberId);
2514
2506
  }
2515
- function tl(e2, t2) {
2507
+ function Qc(e2, t2) {
2516
2508
  if (!e2.localStartDate || !e2.localEndDate) return null;
2517
- let n2 = e2.allDay ? `UTC` : t2 ?? `UTC`, r2 = yc(e2.localStartDate, n2), i2 = yc(e2.localEndDate, n2);
2509
+ let n2 = e2.allDay ? `UTC` : t2 ?? `UTC`, r2 = gc(e2.localStartDate, n2), i2 = gc(e2.localEndDate, n2);
2518
2510
  return !r2 || !i2 || i2 < r2 ? null : Math.round((i2.getTime() - r2.getTime()) / 6e4);
2519
2511
  }
2520
- function nl(e2) {
2512
+ function $c(e2) {
2521
2513
  let t2 = e2.bookableCapacity ?? e2.remainingCapacity;
2522
2514
  return (e2.eventInfo?.waitingList?.remainingCapacity ?? 0) > 0 && (t2 ?? 0) <= 0 ? 1 : e2.bookable ? 2 : 0;
2523
2515
  }
2524
- function rl(e2, t2, n2) {
2516
+ function el(e2, t2, n2) {
2525
2517
  let r2 = /* @__PURE__ */ new Map();
2526
2518
  for (let t3 of e2) {
2527
2519
  let e3 = (t3.localStartDate ?? ``).slice(0, 10);
@@ -2529,16 +2521,16 @@ function rl(e2, t2, n2) {
2529
2521
  }
2530
2522
  return new Set([...r2].filter(([e3, r3]) => r3 > t2 && !n2.has(e3)).map(([e3]) => e3));
2531
2523
  }
2532
- function il(e2) {
2524
+ function tl(e2) {
2533
2525
  return e2.flatMap((e3) => {
2534
- let t2 = e3.availableResources?.find((e4) => e4.resourceTypeId === Gr), n2 = t2?.resources ?? [];
2526
+ let t2 = e3.availableResources?.find((e4) => e4.resourceTypeId === Br), n2 = t2?.resources ?? [];
2535
2527
  return n2.length <= 1 ? [e3] : n2.map((n3) => ({ ...e3, availableResources: [{ ...t2, resources: [n3] }] }));
2536
2528
  });
2537
2529
  }
2538
- function al(e2, t2) {
2530
+ function nl(e2, t2) {
2539
2531
  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;
2540
2532
  }
2541
- function ol(e2, t2, n2) {
2533
+ function rl(e2, t2, n2) {
2542
2534
  let r2 = /* @__PURE__ */ new Map();
2543
2535
  return e2.filter((e3) => {
2544
2536
  let i2 = (e3.localStartDate ?? ``).slice(0, 10);
@@ -2547,24 +2539,24 @@ function ol(e2, t2, n2) {
2547
2539
  return r2.set(i2, a2 + 1), a2 < t2;
2548
2540
  });
2549
2541
  }
2550
- async function sl() {
2542
+ async function il() {
2551
2543
  try {
2552
- return await Uo();
2544
+ return await Vo();
2553
2545
  } catch (e2) {
2554
- return wo(e2, { feature: So.timeSlots, action: `fetch-business-time-zone`, level: `warning` }), { businessTimeZone: null, staffSelectionStrategy: void 0, allowGenderSelection: false };
2546
+ return bo(e2, { feature: vo.timeSlots, action: `fetch-business-time-zone`, level: `warning` }), { businessTimeZone: null, staffSelectionStrategy: void 0, allowGenderSelection: false };
2555
2547
  }
2556
2548
  }
2557
- function cl(e2) {
2558
- return Rs({ key: Ds(), warmupData: e2, fetchData: sl });
2549
+ function al(e2) {
2550
+ return Fs({ key: ws(), warmupData: e2, fetchData: il });
2559
2551
  }
2560
- function ll(e2) {
2552
+ function ol(e2) {
2561
2553
  return (e2.localStartDate ?? ``).slice(0, 10);
2562
2554
  }
2563
- var ul = [];
2564
- function dl(e2, t2) {
2565
- let { serviceId: n2 = ``, serviceType: r2 = `CLASS`, fromLocalDate: i2 = ``, toLocalDate: o2, timeZone: l2, locationId: u2, staffId: d2, onlyAvailableSlots: f2 = false, customerChoices: p2, minRemainingCapacity: m2, timeSlotsPerDay: h2 } = t2 ?? {}, [g2, _2] = c([]), [v2, y2] = c([]), [b2, x2] = c(1), [S2, C2] = c(!!n2), [w2, T2] = c(null), [ee2, E2] = c(null), [D2, te2] = c(/* @__PURE__ */ new Set()), [ne2, O2] = c(null), k2 = s(null), re2 = s(null);
2555
+ var sl = [];
2556
+ function cl(e2, t2) {
2557
+ let { serviceId: n2 = ``, serviceType: r2 = `CLASS`, fromLocalDate: i2 = ``, toLocalDate: o2, timeZone: l2, locationId: u2, staffId: d2, onlyAvailableSlots: f2 = false, customerChoices: p2, minRemainingCapacity: m2, timeSlotsPerDay: h2 } = t2 ?? {}, [g2, _2] = c([]), [v2, y2] = c([]), [b2, x2] = c(1), [S2, C2] = c(!!n2), [w2, T2] = c(null), [ee2, E2] = c(null), [D2, O2] = c(/* @__PURE__ */ new Set()), [te2, k2] = c(null), A2 = s(null), ne2 = s(null);
2566
2558
  a(() => {
2567
- if (_2([]), y2([]), x2(1), E2(null), T2(null), te2(/* @__PURE__ */ new Set()), O2(null), C2(!!n2), !n2) return;
2559
+ if (_2([]), y2([]), x2(1), E2(null), T2(null), O2(/* @__PURE__ */ new Set()), k2(null), C2(!!n2), !n2) return;
2568
2560
  let t3 = false, a2 = false, s2 = [], c2 = [];
2569
2561
  async function g3(g4) {
2570
2562
  if (t3 || a2) return;
@@ -2579,7 +2571,7 @@ function dl(e2, t2) {
2579
2571
  let a3 = [], b3 = null, S3 = v4 ?? void 0, C3 = /* @__PURE__ */ new Set();
2580
2572
  do {
2581
2573
  S3 && C3.add(S3);
2582
- let s3 = await cs({ serviceId: n2, serviceType: r2, fromLocalDate: i2, toLocalDate: o2, timeZone: l2, locationId: u2, staffId: d2, onlyAvailableSlots: f2, customerChoices: p2, minRemainingCapacity: m2, timeSlotsPerDay: h2, limit: e2, cursor: S3 });
2574
+ let s3 = await os({ serviceId: n2, serviceType: r2, fromLocalDate: i2, toLocalDate: o2, timeZone: l2, locationId: u2, staffId: d2, onlyAvailableSlots: f2, customerChoices: p2, minRemainingCapacity: m2, timeSlotsPerDay: h2, limit: e2, cursor: S3 });
2583
2575
  if (t3) return;
2584
2576
  if (a3.push(...s3.timeSlots), b3 = s3.nextCursor, b3 && C3.has(b3)) throw Error(`The session API repeated a page cursor`);
2585
2577
  S3 = b3 ?? void 0, E2(s3.timeZone ?? l2 ?? null);
@@ -2587,7 +2579,7 @@ function dl(e2, t2) {
2587
2579
  s2 = [...s2, a3], c2 = [...c2, b3], _2(s2), y2(c2), (g4 === 1 || a3.length > 0) && x2(g4);
2588
2580
  } catch (e3) {
2589
2581
  if (t3) return;
2590
- wo(e3, { feature: So.sessions, action: `fetch-page` }), T2(e3 instanceof Error ? e3.message : `Failed to load sessions`);
2582
+ bo(e3, { feature: vo.sessions, action: `fetch-page` }), T2(e3 instanceof Error ? e3.message : `Failed to load sessions`);
2591
2583
  } finally {
2592
2584
  a2 = false, t3 || C2(false);
2593
2585
  }
@@ -2596,197 +2588,197 @@ function dl(e2, t2) {
2596
2588
  async function v3(e3) {
2597
2589
  if (!(t3 || a2)) {
2598
2590
  if (h2 == null) {
2599
- te2((t4) => /* @__PURE__ */ new Set([...t4, e3]));
2591
+ O2((t4) => /* @__PURE__ */ new Set([...t4, e3]));
2600
2592
  return;
2601
2593
  }
2602
- a2 = true, O2(e3), T2(null);
2594
+ a2 = true, k2(e3), T2(null);
2603
2595
  try {
2604
- let a3 = await hs({ serviceId: n2, serviceType: r2, date: e3, timeZone: l2, onlyAvailableSlots: f2, locationId: u2, staffId: d2, customerChoices: p2, minRemainingCapacity: m2, fromLocalDate: i2, toLocalDate: o2 });
2596
+ let a3 = await ps({ serviceId: n2, serviceType: r2, date: e3, timeZone: l2, onlyAvailableSlots: f2, locationId: u2, staffId: d2, customerChoices: p2, minRemainingCapacity: m2, fromLocalDate: i2, toLocalDate: o2 });
2605
2597
  if (t3) return;
2606
- let c3 = a3.timeSlots.filter((t4) => ll(t4) === e3), h3 = Math.max(0, s2.findIndex((t4) => t4.some((t5) => ll(t5) === e3)));
2598
+ let c3 = a3.timeSlots.filter((t4) => ol(t4) === e3), h3 = Math.max(0, s2.findIndex((t4) => t4.some((t5) => ol(t5) === e3)));
2607
2599
  s2 = s2.map((t4, n3) => {
2608
- let r3 = t4.filter((t5) => ll(t5) !== e3);
2600
+ let r3 = t4.filter((t5) => ol(t5) !== e3);
2609
2601
  return n3 === h3 ? [...r3, ...c3] : r3;
2610
- }), _2(s2), te2((t4) => /* @__PURE__ */ new Set([...t4, e3]));
2602
+ }), _2(s2), O2((t4) => /* @__PURE__ */ new Set([...t4, e3]));
2611
2603
  } catch (e4) {
2612
2604
  if (t3) return;
2613
- wo(e4, { feature: So.sessions, action: `fetch-day` }), T2(e4 instanceof Error ? e4.message : `Failed to load sessions`);
2605
+ bo(e4, { feature: vo.sessions, action: `fetch-day` }), T2(e4 instanceof Error ? e4.message : `Failed to load sessions`);
2614
2606
  } finally {
2615
- a2 = false, t3 || O2(null);
2607
+ a2 = false, t3 || k2(null);
2616
2608
  }
2617
2609
  }
2618
2610
  }
2619
- return k2.current = g3, re2.current = v3, g3(1), () => {
2620
- t3 = true, k2.current = null, re2.current = null;
2611
+ return A2.current = g3, ne2.current = v3, g3(1), () => {
2612
+ t3 = true, A2.current = null, ne2.current = null;
2621
2613
  };
2622
2614
  }, [n2, r2, i2, o2, l2, u2, d2, f2, p2, m2, h2, e2]);
2623
- let ie2 = [...g2[b2 - 1] ?? ul].sort((e3, t3) => (e3.localStartDate ?? ``).localeCompare(t3.localStartDate ?? ``)), A2 = g2[b2], ae2 = A2 ? A2.length > 0 : v2[b2 - 1] != null, j2 = b2 > 1;
2624
- async function oe2() {
2625
- ae2 && !S2 && await k2.current?.(b2 + 1);
2615
+ let re2 = [...g2[b2 - 1] ?? sl].sort((e3, t3) => (e3.localStartDate ?? ``).localeCompare(t3.localStartDate ?? ``)), j2 = g2[b2], ie2 = j2 ? j2.length > 0 : v2[b2 - 1] != null, M2 = b2 > 1;
2616
+ async function ae2() {
2617
+ ie2 && !S2 && await A2.current?.(b2 + 1);
2626
2618
  }
2627
- function M2() {
2628
- j2 && !S2 && k2.current?.(b2 - 1);
2619
+ function N2() {
2620
+ M2 && !S2 && A2.current?.(b2 - 1);
2629
2621
  }
2630
- async function se2(e3) {
2631
- S2 || ne2 !== null || D2.has(e3) || await re2.current?.(e3);
2622
+ async function oe2(e3) {
2623
+ S2 || te2 !== null || D2.has(e3) || await ne2.current?.(e3);
2632
2624
  }
2633
- return { isLoadingPage: S2, firstPageSettled: g2.length > 0 || w2 !== null, error: w2, timeZone: ee2, sessions: ie2, pageSize: e2, currentPage: b2, hasNextPage: ae2, hasPreviousPage: j2, nextPage: oe2, previousPage: M2, expandedDates: D2, loadingDate: ne2, loadAllSessionsForDay: se2 };
2625
+ return { isLoadingPage: S2, firstPageSettled: g2.length > 0 || w2 !== null, error: w2, timeZone: ee2, sessions: re2, pageSize: e2, currentPage: b2, hasNextPage: ie2, hasPreviousPage: M2, nextPage: ae2, previousPage: N2, expandedDates: D2, loadingDate: te2, loadAllSessionsForDay: oe2 };
2634
2626
  }
2635
- var fl = (e2) => e2?.onlineBooking?.enabled === true;
2636
- function pl(e2) {
2627
+ var ll = (e2) => e2?.onlineBooking?.enabled === true;
2628
+ function ul(e2) {
2637
2629
  return !!e2?._id;
2638
2630
  }
2639
- function ml(e2, t2) {
2631
+ function dl(e2, t2) {
2640
2632
  return e2 ? e2.anyResource ? t2 ?? `` : e2.staffMemberId : null;
2641
2633
  }
2642
- var hl = [];
2643
- var gl = [];
2644
- var _l = sn.map((e2) => ({ id: e2, gender: e2 }));
2645
- var vl = { isSelectionValidated: false };
2646
- var yl = () => {
2634
+ var fl = [];
2635
+ var pl = [];
2636
+ var ml = on.map((e2) => ({ id: e2, gender: e2 }));
2637
+ var hl = { isSelectionValidated: false };
2638
+ var gl = () => {
2647
2639
  };
2648
- var bl = async () => {
2640
+ var _l = async () => {
2649
2641
  };
2650
- var xl = n(null);
2651
- function Sl() {
2652
- let e2 = i(xl);
2642
+ var vl = n(null);
2643
+ function yl() {
2644
+ let e2 = i(vl);
2653
2645
  if (!e2) throw Error(`useTimeSlotsContext must be used within TimeSlotsContextProvider`);
2654
2646
  return e2;
2655
2647
  }
2656
- function Cl(e2, t2, n2) {
2648
+ function bl(e2, t2, n2) {
2657
2649
  e2 ? t2() : n2();
2658
2650
  }
2659
- var wl = { loginRequired: `rescheduleLoginRequired`, notFound: `rescheduleNotFound`, accessDenied: `rescheduleAccessDenied`, failed: `rescheduleNotFound`, wrongService: `rescheduleNotFound`, notReschedulable: `rescheduleNotReschedulable` };
2660
- function Tl(e2 = 3) {
2661
- return Math.min(Math.max(e2, 1), Ys);
2651
+ var xl = { loginRequired: `rescheduleLoginRequired`, notFound: `rescheduleNotFound`, accessDenied: `rescheduleAccessDenied`, failed: `rescheduleNotFound`, wrongService: `rescheduleNotFound`, notReschedulable: `rescheduleNotReschedulable` };
2652
+ function Sl(e2 = 3) {
2653
+ return Math.min(Math.max(e2, 1), Ks);
2662
2654
  }
2663
- function El(e2) {
2655
+ function Cl(e2) {
2664
2656
  let { isLoading: n2, bookingsSettingsLoading: r2 } = u();
2665
- gc(dc.TIME_SLOTS, !n2 && !r2);
2666
- let i2 = ws(), [a2] = c(() => cl(i2));
2667
- return p(Js, { children: p(t, { fallback: p(Sc, { nextAvailableSlotsCount: Tl(e2.nextAvailableSlotsCount), children: e2.children }), children: p(Ol, { ...e2, configurationPromise: a2 }) }) });
2657
+ pc(cc.TIME_SLOTS, !n2 && !r2);
2658
+ let i2 = xs(), [a2] = c(() => al(i2));
2659
+ return p(Gs, { children: p(t, { fallback: p(yc, { nextAvailableSlotsCount: Sl(e2.nextAvailableSlotsCount), children: e2.children }), children: p(Tl, { ...e2, configurationPromise: a2 }) }) });
2668
2660
  }
2669
- function Dl(e2) {
2661
+ function wl(e2) {
2670
2662
  let [t2, n2] = c({ serviceId: e2, key: 0 });
2671
2663
  return e2 !== t2.serviceId && n2({ serviceId: e2, key: t2.serviceId ? t2.key + 1 : t2.key }), t2.key;
2672
2664
  }
2673
- function Ol({ onlyAvailableSlots: e2 = true, nextAvailableSlotsCount: t2 = 3, loadDaysAvailabilityInitially: n2 = false, timeSlotLimitPerDay: r2 = 100, configurationPromise: i2, children: o2 }) {
2674
- let s2 = Ws().isLoading, { searchParams: d2 } = oc(), { reschedule: f2 } = u(), [m2] = c(() => ({ locationId: d2.get(Qa.location), staffId: d2.get(Qa.resource), timeZone: (f2 ? void 0 : jr(d2.get(Qa.blob))?.timezone) ?? d2.get(Qa.timezone) })), [h2, g2] = c(m2.timeZone), _2 = Tl(t2), [v2, y2] = c(false);
2665
+ function Tl({ onlyAvailableSlots: e2 = true, nextAvailableSlotsCount: t2 = 3, loadDaysAvailabilityInitially: n2 = false, timeSlotLimitPerDay: r2 = 100, configurationPromise: i2, children: o2 }) {
2666
+ let s2 = Vs().isLoading, { searchParams: d2 } = rc(), { reschedule: f2 } = u(), [m2] = c(() => ({ locationId: d2.get(qa.location), staffId: d2.get(qa.resource), timeZone: (f2 ? void 0 : Ar(d2.get(qa.blob))?.timezone) ?? d2.get(qa.timezone) })), [h2, g2] = c(m2.timeZone), _2 = Sl(t2), [v2, y2] = c(false);
2675
2667
  a(() => y2(true), []);
2676
- let b2 = v2 && !s2, x2 = vs(i2), S2 = l(rs, ns, () => false), { serviceId: C2 } = u(), w2 = Dl(C2), T2 = Number.isFinite(r2) ? Math.max(1, Math.floor(r2)) : 100;
2677
- return p(Xs, { fallback: p(Cc, { nextAvailableSlotsCount: _2, children: o2 }), feature: So.timeSlots, children: p(kl, { onlyAvailableSlots: e2, selectedTimeZone: h2, setSelectedTimeZone: g2, enabled: b2, nextAvailableSlotsCount: _2, loadDaysAvailabilityInitially: n2, timeSlotLimitPerDay: T2, landingLocationId: m2.locationId, landingStaffId: m2.staffId, businessTimeZone: x2.businessTimeZone, staffSelectionStrategy: x2.staffSelectionStrategy, allowGenderSelection: x2.allowGenderSelection, requestedGenderRejected: S2, children: o2 }) }, w2);
2678
- }
2679
- function kl({ onlyAvailableSlots: e2, selectedTimeZone: t2, setSelectedTimeZone: n2, enabled: i2, nextAvailableSlotsCount: l2, loadDaysAvailabilityInitially: d2, timeSlotLimitPerDay: f2, landingLocationId: m2, landingStaffId: h2, businessTimeZone: g2, staffSelectionStrategy: _2, allowGenderSelection: v2, requestedGenderRejected: y2, children: b2 }) {
2680
- let { service: x2, serviceId: S2, serviceType: C2, setSlot: w2, clearSlot: T2, setMultiServiceSlot: ee2, clearMultiServiceSlot: E2, draftRevision: D2, navigateToMultiServiceForm: te2, selection: ne2, selectStaffMember: O2, clearSelection: k2, clearStaffMember: re2, withSelectionParam: ie2, staffMembers: A2, serviceOptionsAndVariants: ae2, isLoading: j2, hasError: oe2, multiServiceAppointmentServices: M2 = gl, reschedule: se2 } = u(), N2 = se2 != null, ce2 = N2 && se2.status !== `ready`, le2 = N2 && se2.status === `loading`, ue2 = N2 ? wl[se2.status] : void 0, de2 = ce2 ? null : se2?.booking ?? null, fe2 = de2 ? se2.validUntil : null, pe2 = pl(x2) && !fl(x2), P2 = pe2 || ce2 ? null : S2, me2 = oc(), he2 = N2 ? null : me2.searchParams.get(Qa.blob), ge2 = o(() => no(jr(he2)), [he2]), F2 = !S2 && !j2 && !oe2 && (ge2.valid || ge2.reason !== `too-few-services`), _e2 = F2 && ge2.valid && M2.some((e3) => !fl(e3) && ge2.services.some((t3) => t3.serviceId === e3._id)), ve2 = pe2 || _e2, ye2 = F2 && ge2.valid && !_e2 ? ge2.requestKey : null, be2 = o(() => ye2 && ge2.valid ? { services: ge2.services, locationId: ge2.locationId, locationType: ge2.locationType } : null, [ye2]), xe2 = !!P2 || be2 !== null, Se2 = P2 || ye2, Ce2 = i2 && !j2 && !oe2 && !xe2 && !le2, we2 = Ks(), Te2 = Ws(), { navigate: Ee2, resolvePath: De2 } = po(), [Oe2, ke2] = c(null), [Ae2, je2] = c(false), Me2 = s([]), Ne2 = s(false), Pe2 = r(() => (je2(true), Ne2.current ? Promise.resolve() : new Promise((e3) => {
2681
- Me2.current.push(e3);
2682
- })), []), Fe2 = i2 ? Intl.DateTimeFormat().resolvedOptions().timeZone : null, Ie2 = Ja(x2), Le2 = s(null), Re2 = io(ne2), ze2 = s(Re2);
2683
- ze2.current = Re2;
2684
- let Be2 = Re2 && !Re2.anyResource ? Re2.staffMemberId : null, Ve2 = ne2.requestedGender ?? null, I2 = !Xa(C2) && !Za(C2), He2 = I2 && !F2 && _s(ae2), L2 = F2 || I2 && _2 === `CUSTOMER_CANNOT_CHOOSE`, Ue2 = _2 !== void 0, We2 = Ho({ allowGenderSelection: v2, staffSelectionStrategy: _2 ?? null }) && I2 && !F2 && !He2, Ge2 = We2 && !y2, Ke2 = o(() => P2 ? jr(he2)?.services.find((e3) => e3.serviceId === P2) ?? null : null, [he2, P2]), qe2 = (A2 ?? []).map((e3) => e3.staffMemberId).join(`,`), Je2 = Ie2.map((e3) => e3.id).join(`,`), Ye2 = o(() => qc({ entry: Ke2, appointmentLike: I2, staffChoiceHidden: L2, staffPriced: He2, staffSelectionStrategy: _2, genderAllowed: Ge2, staffMemberIds: qe2.split(`,`), locationIds: Je2.split(`,`) }), [Ke2, I2, L2, He2, _2, Ge2, qe2, Je2]), R2 = Ye2.staff, Xe2 = Ye2.locationId, Ze2 = L2 || R2 !== null, [Qe2, $e2] = c(null), [et2, tt2] = c(m2 !== null || N2), nt2 = (e3) => !!e3 && Ie2.some((t3) => t3.id === e3), rt2 = de2?.locationId ?? null, it2 = Qe2 ?? (et2 ? nt2(rt2) ? rt2 : m2 : null), at2 = Xe2 ?? (nt2(it2) ? it2 : null), ot2 = o(() => Xe2 ? [] : Ie2.map((e3) => ({ id: e3.id, name: e3.label })), [x2, Xe2]), st2 = o(() => Ze2 ? [] : (A2 ?? []).filter((e3) => e3.name).map((e3) => ({ id: e3.staffMemberId, name: e3.name ?? ``, gender: null })), [A2, Ze2]), ct2 = I2 && !Ue2 ? hl : st2, lt2 = Ge2 && ct2.length > 1, ut2 = o(() => lt2 ? [..._l, ...ct2] : ct2, [lt2, ct2]), [dt2, ft2] = c(null), [pt2, mt2] = c(h2 !== null), ht2 = dt2 ?? (pt2 ? h2 : null), z2 = R2 ? R2.anyResource ? null : R2.staffMemberId : ht2 !== null && st2.some((e3) => e3.id === ht2) ? ht2 : null, gt2 = Re2?.anyResource ? Ve2 : null, [_t2, vt2] = c(gt2), [yt2, bt2] = c(gt2);
2685
- !y2 && Re2?.anyResource && Ve2 !== yt2 && (bt2(Ve2), vt2(Ve2));
2686
- let xt2 = R2 ? Ye2.requestedGender : We2 && ct2.length > 1 && z2 === null ? _t2 : null, B2 = y2 ? null : xt2, St2 = r((e3) => {
2687
- ze2.current = e3, e3 ? e3.anyResource ? k2(B2 ?? void 0) : O2(e3.staffMemberId) : re2();
2688
- }, [re2, k2, O2, B2]), Ct2 = r((e3) => St2(e3 ? { anyResource: false, staffMemberId: e3 } : { anyResource: true }), [St2]), wt2 = (de2?.addOnIds ?? []).filter((e3) => x2?.addOnGroups?.some((t3) => t3.addOnIds?.includes(e3))), Tt2 = de2 && Xa(C2) ? de2.participants : null, Et2 = I2 ? $a(ne2) : null, { addOnIds: Dt2, ...Ot2 } = Et2 ?? {}, kt2 = I2 && de2 ? wt2.length ? { ...Ot2, addOnIds: wt2 } : Ot2 : Et2, At2 = kt2 ? Xo(kt2) : void 0, jt2 = JSON.stringify(xt2 ? { ...At2, requestedGender: { gender: xt2 } } : At2 ?? null), Mt2 = o(() => JSON.parse(jt2), [jt2]), Nt2 = R2?.anyResource === true, Pt2 = r((e3) => Nt2 || _2 !== void 0 && Uc({ isAppointment: I2, staffOnSlotCount: e3, hasStaffFilter: z2 !== null, hasRequestedGender: B2 !== null, hasStaffPricedVariants: He2, staffSelectionStrategy: _2 }), [Nt2, I2, _2, z2, B2, He2]), Ft2 = r((e3) => R2 ?? (L2 ? null : e3), [R2, L2]), It2 = r((e3) => {
2689
- let t3 = e3 === null ? null : ut2.find((t4) => t4.id === e3);
2690
- t3 !== void 0 && (mt2(false), ft2(t3 && !t3.gender ? t3.id : null), vt2(t3?.gender ?? null));
2691
- }, [ut2]), Lt2 = r((e3) => {
2692
- (e3 === null || Ie2.some((t3) => t3.id === e3)) && (tt2(false), $e2(e3));
2693
- }, [x2]), Rt2 = !!(i2 && !Te2.isLoading && Te2.displayTimeZonePolicy.customerCanChange && g2 && Fe2 && g2 !== Fe2), V2 = i2 ? Rt2 && t2 && (t2 === g2 || t2 === Fe2) ? t2 : we2 ?? g2 ?? Fe2 : null, zt2 = r((e3) => {
2694
- Rt2 && (e3 === g2 || e3 === Fe2) && n2(e3);
2695
- }, [Rt2, g2, Fe2, n2]), Bt2 = o(() => i2 && !j2 && xe2 ? Date.now() : void 0, [i2, j2, P2, be2, V2]), Vt2 = Bt2 !== void 0 && V2 ? Eo(new Date(Bt2), V2) : null, { range: Ht2, daysAvailability: Ut2, isLoading: Wt2, hasError: Gt2, setRange: Kt2, nextRange: qt2, previousRange: Jt2 } = zc({ enabled: i2, serviceId: P2, serviceType: C2, multiServiceRequest: be2, timeZone: V2, today: Vt2, locationId: at2, staffId: z2, customerChoices: Mt2, minRemainingCapacity: Tt2, loadInitially: d2, onlyAvailableSlots: e2 }), Yt2 = fe2?.slice(0, 10) ?? null, Xt2 = o(() => Yt2 ? Ut2.map((e3) => e3.date > Yt2 ? { ...e3, availability: `none` } : e3) : Ut2, [Ut2, Yt2]), Zt2 = fe2 && V2 ? ko(new Date(fe2), V2) : null, { query: H2, selectedDate: Qt2, timeSlots: $t2, isLoading: en2, error: tn2, selectDate: nn2, findNextAvailableDate: rn2 } = Bc({ enabled: i2, serviceId: P2, serviceType: C2, multiServiceRequest: be2, timeZone: V2, today: Vt2, locationId: at2, staffId: z2, customerChoices: Mt2, minRemainingCapacity: Tt2, onlyAvailableSlots: e2, serviceLoading: j2 }), an2 = s(true), on2 = s(null);
2668
+ let b2 = v2 && !s2, x2 = gs(i2), S2 = l(ts, es, () => false), { serviceId: C2 } = u(), w2 = wl(C2), T2 = Number.isFinite(r2) ? Math.max(1, Math.floor(r2)) : 100;
2669
+ return p(qs, { fallback: p(bc, { nextAvailableSlotsCount: _2, children: o2 }), feature: vo.timeSlots, children: p(El, { onlyAvailableSlots: e2, selectedTimeZone: h2, setSelectedTimeZone: g2, enabled: b2, nextAvailableSlotsCount: _2, loadDaysAvailabilityInitially: n2, timeSlotLimitPerDay: T2, landingLocationId: m2.locationId, landingStaffId: m2.staffId, businessTimeZone: x2.businessTimeZone, staffSelectionStrategy: x2.staffSelectionStrategy, allowGenderSelection: x2.allowGenderSelection, requestedGenderRejected: S2, children: o2 }) }, w2);
2670
+ }
2671
+ function El({ onlyAvailableSlots: e2, selectedTimeZone: t2, setSelectedTimeZone: n2, enabled: i2, nextAvailableSlotsCount: l2, loadDaysAvailabilityInitially: d2, timeSlotLimitPerDay: f2, landingLocationId: m2, landingStaffId: h2, businessTimeZone: g2, staffSelectionStrategy: _2, allowGenderSelection: v2, requestedGenderRejected: y2, children: b2 }) {
2672
+ let { service: x2, serviceId: S2, serviceType: C2, setSlot: w2, clearSlot: T2, setMultiServiceSlot: ee2, clearMultiServiceSlot: E2, draftRevision: D2, navigateToMultiServiceForm: O2, selection: te2, selectStaffMember: k2, clearSelection: A2, clearStaffMember: ne2, withSelectionParam: re2, staffMembers: j2, serviceOptionsAndVariants: ie2, isLoading: M2, hasError: ae2, multiServiceAppointmentServices: N2 = pl, reschedule: oe2 } = u(), P2 = oe2 != null, se2 = P2 && oe2.status !== `ready`, ce2 = P2 && oe2.status === `loading`, le2 = P2 ? xl[oe2.status] : void 0, ue2 = se2 ? null : oe2?.booking ?? null, de2 = ue2 ? oe2.validUntil : null, fe2 = ul(x2) && !ll(x2), F2 = fe2 || se2 ? null : S2, pe2 = rc(), me2 = P2 ? null : pe2.searchParams.get(qa.blob), he2 = o(() => Za(Ar(me2)), [me2]), I2 = !S2 && !M2 && !ae2 && (he2.valid || he2.reason !== `too-few-services`), ge2 = I2 && he2.valid && N2.some((e3) => !ll(e3) && he2.services.some((t3) => t3.serviceId === e3._id)), _e2 = fe2 || ge2, ve2 = I2 && he2.valid && !ge2 ? he2.requestKey : null, ye2 = o(() => ve2 && he2.valid ? { services: he2.services, locationId: he2.locationId, locationType: he2.locationType } : null, [ve2]), be2 = !!F2 || ye2 !== null, xe2 = F2 || ve2, Se2 = i2 && !M2 && !ae2 && !be2 && !ce2, Ce2 = Us(), we2 = Vs(), { navigate: Te2, resolvePath: Ee2 } = co(), [De2, Oe2] = c(null), [ke2, Ae2] = c(false), je2 = s([]), Me2 = s(false), Ne2 = r(() => (Ae2(true), Me2.current ? Promise.resolve() : new Promise((e3) => {
2673
+ je2.current.push(e3);
2674
+ })), []), Pe2 = i2 ? Intl.DateTimeFormat().resolvedOptions().timeZone : null, Fe2 = Ua(x2), Ie2 = s(null), Le2 = $a(te2), Re2 = s(Le2);
2675
+ Re2.current = Le2;
2676
+ let ze2 = Le2 && !Le2.anyResource ? Le2.staffMemberId : null, Be2 = te2.requestedGender ?? null, L2 = !Ga(C2) && !Ka(C2), Ve2 = L2 && !I2 && hs(ie2), R2 = I2 || L2 && _2 === `CUSTOMER_CANNOT_CHOOSE`, He2 = _2 !== void 0, Ue2 = Bo({ allowGenderSelection: v2, staffSelectionStrategy: _2 ?? null }) && L2 && !I2 && !Ve2, We2 = Ue2 && !y2, Ge2 = o(() => F2 ? Ar(me2)?.services.find((e3) => e3.serviceId === F2) ?? null : null, [me2, F2]), Ke2 = (j2 ?? []).map((e3) => e3.staffMemberId).join(`,`), qe2 = Fe2.map((e3) => e3.id).join(`,`), Je2 = o(() => Wc({ entry: Ge2, appointmentLike: L2, staffChoiceHidden: R2, staffPriced: Ve2, staffSelectionStrategy: _2, genderAllowed: We2, staffMemberIds: Ke2.split(`,`), locationIds: qe2.split(`,`) }), [Ge2, L2, R2, Ve2, _2, We2, Ke2, qe2]), z2 = Je2.staff, Ye2 = Je2.locationId, Xe2 = R2 || z2 !== null, [Ze2, Qe2] = c(null), [$e2, et2] = c(m2 !== null || P2), tt2 = (e3) => !!e3 && Fe2.some((t3) => t3.id === e3), nt2 = ue2?.locationId ?? null, rt2 = Ze2 ?? ($e2 ? tt2(nt2) ? nt2 : m2 : null), it2 = Ye2 ?? (tt2(rt2) ? rt2 : null), at2 = o(() => Ye2 ? [] : Fe2.map((e3) => ({ id: e3.id, name: e3.label })), [x2, Ye2]), ot2 = o(() => Xe2 ? [] : (j2 ?? []).filter((e3) => e3.name).map((e3) => ({ id: e3.staffMemberId, name: e3.name ?? ``, gender: null })), [j2, Xe2]), st2 = L2 && !He2 ? fl : ot2, ct2 = We2 && st2.length > 1, lt2 = o(() => ct2 ? [...ml, ...st2] : st2, [ct2, st2]), [ut2, dt2] = c(null), [ft2, pt2] = c(h2 !== null), mt2 = ut2 ?? (ft2 ? h2 : null), B2 = z2 ? z2.anyResource ? null : z2.staffMemberId : mt2 !== null && ot2.some((e3) => e3.id === mt2) ? mt2 : null, ht2 = Le2?.anyResource ? Be2 : null, [gt2, _t2] = c(ht2), [vt2, yt2] = c(ht2);
2677
+ !y2 && Le2?.anyResource && Be2 !== vt2 && (yt2(Be2), _t2(Be2));
2678
+ let bt2 = z2 ? Je2.requestedGender : Ue2 && st2.length > 1 && B2 === null ? gt2 : null, V2 = y2 ? null : bt2, xt2 = r((e3) => {
2679
+ Re2.current = e3, e3 ? e3.anyResource ? A2(V2 ?? void 0) : k2(e3.staffMemberId) : ne2();
2680
+ }, [ne2, A2, k2, V2]), St2 = r((e3) => xt2(e3 ? { anyResource: false, staffMemberId: e3 } : { anyResource: true }), [xt2]), Ct2 = (ue2?.addOnIds ?? []).filter((e3) => x2?.addOnGroups?.some((t3) => t3.addOnIds?.includes(e3))), wt2 = ue2 && Ga(C2) ? ue2.participants : null, Tt2 = L2 ? Ja(te2) : null, { addOnIds: Et2, ...Dt2 } = Tt2 ?? {}, Ot2 = L2 && ue2 ? Ct2.length ? { ...Dt2, addOnIds: Ct2 } : Dt2 : Tt2, kt2 = Ot2 ? Jo(Ot2) : void 0, At2 = JSON.stringify(bt2 ? { ...kt2, requestedGender: { gender: bt2 } } : kt2 ?? null), jt2 = o(() => JSON.parse(At2), [At2]), Mt2 = z2?.anyResource === true, Nt2 = r((e3) => Mt2 || _2 !== void 0 && Bc({ isAppointment: L2, staffOnSlotCount: e3, hasStaffFilter: B2 !== null, hasRequestedGender: V2 !== null, hasStaffPricedVariants: Ve2, staffSelectionStrategy: _2 }), [Mt2, L2, _2, B2, V2, Ve2]), Pt2 = r((e3) => z2 ?? (R2 ? null : e3), [z2, R2]), Ft2 = r((e3) => {
2681
+ let t3 = e3 === null ? null : lt2.find((t4) => t4.id === e3);
2682
+ t3 !== void 0 && (pt2(false), dt2(t3 && !t3.gender ? t3.id : null), _t2(t3?.gender ?? null));
2683
+ }, [lt2]), It2 = r((e3) => {
2684
+ (e3 === null || Fe2.some((t3) => t3.id === e3)) && (et2(false), Qe2(e3));
2685
+ }, [x2]), Lt2 = !!(i2 && !we2.isLoading && we2.displayTimeZonePolicy.customerCanChange && g2 && Pe2 && g2 !== Pe2), H2 = i2 ? Lt2 && t2 && (t2 === g2 || t2 === Pe2) ? t2 : Ce2 ?? g2 ?? Pe2 : null, Rt2 = r((e3) => {
2686
+ Lt2 && (e3 === g2 || e3 === Pe2) && n2(e3);
2687
+ }, [Lt2, g2, Pe2, n2]), zt2 = o(() => i2 && !M2 && be2 ? Date.now() : void 0, [i2, M2, F2, ye2, H2]), Bt2 = zt2 !== void 0 && H2 ? Co(new Date(zt2), H2) : null, { range: Vt2, daysAvailability: Ht2, isLoading: Ut2, hasError: Wt2, setRange: Gt2, nextRange: Kt2, previousRange: qt2 } = Ic({ enabled: i2, serviceId: F2, serviceType: C2, multiServiceRequest: ye2, timeZone: H2, today: Bt2, locationId: it2, staffId: B2, customerChoices: jt2, minRemainingCapacity: wt2, loadInitially: d2, onlyAvailableSlots: e2 }), Jt2 = de2?.slice(0, 10) ?? null, Yt2 = o(() => Jt2 ? Ht2.map((e3) => e3.date > Jt2 ? { ...e3, availability: `none` } : e3) : Ht2, [Ht2, Jt2]), Xt2 = de2 && H2 ? Eo(new Date(de2), H2) : null, { query: U2, selectedDate: Zt2, timeSlots: Qt2, isLoading: $t2, error: en2, selectDate: tn2, findNextAvailableDate: nn2 } = Lc({ enabled: i2, serviceId: F2, serviceType: C2, multiServiceRequest: ye2, timeZone: H2, today: Bt2, locationId: it2, staffId: B2, customerChoices: jt2, minRemainingCapacity: wt2, onlyAvailableSlots: e2, serviceLoading: M2 }), rn2 = s(true), an2 = s(null);
2696
2688
  a(() => {
2697
- if (an2.current) {
2698
- an2.current = false;
2689
+ if (rn2.current) {
2690
+ rn2.current = false;
2699
2691
  return;
2700
2692
  }
2701
- ke2(null), Le2.current && Cl(P2, T2, E2), Le2.current = null, on2.current = null;
2702
- }, [H2, be2, V2, at2, z2, Mt2, Tt2, e2, l2, f2, D2]);
2703
- let sn2 = r(async () => {
2704
- let e3 = await rn2();
2705
- return e3.outcome === `found` ? Yt2 && e3.date > Yt2 ? `none` : (await Promise.all([nn2(e3.date), Ht2 && zo(e3.date, Ht2) ? Promise.resolve() : Kt2(Io(e3.date))]), `found`) : e3.outcome;
2706
- }, [rn2, Yt2, nn2, Ht2, Kt2]), cn2 = !!(i2 && !j2 && xe2 && V2 && Vt2), ln2 = i2 && !j2 && !xe2, [un2, dn2] = c(false), [fn2, pn2] = c(0), mn2 = s(false), hn2 = s([]), U2 = s(0), gn2 = r(() => {
2707
- dn2(false);
2708
- let e3 = hn2.current;
2709
- return hn2.current = [], e3;
2710
- }, []), _n2 = r(() => {
2711
- U2.current += 1, gn2().forEach((e3) => e3(`cancelled`));
2712
- }, [gn2]), vn2 = r((e3) => (_n2(), nn2(e3)), [_n2, nn2]), yn2 = r((e3) => {
2713
- let t3 = U2.current;
2714
- mn2.current = true, sn2().then((n3) => {
2715
- mn2.current = false, n3 === `cancelled` && t3 === U2.current ? (hn2.current.unshift(...e3), dn2(true)) : e3.forEach((e4) => e4(n3)), pn2((e4) => e4 + 1);
2693
+ Oe2(null), Ie2.current && bl(F2, T2, E2), Ie2.current = null, an2.current = null;
2694
+ }, [U2, ye2, H2, it2, B2, jt2, wt2, e2, l2, f2, D2]);
2695
+ let on2 = r(async () => {
2696
+ let e3 = await nn2();
2697
+ return e3.outcome === `found` ? Jt2 && e3.date > Jt2 ? `none` : (await Promise.all([tn2(e3.date), Vt2 && Lo(e3.date, Vt2) ? Promise.resolve() : Gt2(Po(e3.date))]), `found`) : e3.outcome;
2698
+ }, [nn2, Jt2, tn2, Vt2, Gt2]), sn2 = !!(i2 && !M2 && be2 && H2 && Bt2), cn2 = i2 && !M2 && !be2, [ln2, un2] = c(false), [dn2, fn2] = c(0), pn2 = s(false), mn2 = s([]), W2 = s(0), hn2 = r(() => {
2699
+ un2(false);
2700
+ let e3 = mn2.current;
2701
+ return mn2.current = [], e3;
2702
+ }, []), gn2 = r(() => {
2703
+ W2.current += 1, hn2().forEach((e3) => e3(`cancelled`));
2704
+ }, [hn2]), _n2 = r((e3) => (gn2(), tn2(e3)), [gn2, tn2]), vn2 = r((e3) => {
2705
+ let t3 = W2.current;
2706
+ pn2.current = true, on2().then((n3) => {
2707
+ pn2.current = false, n3 === `cancelled` && t3 === W2.current ? (mn2.current.unshift(...e3), un2(true)) : e3.forEach((e4) => e4(n3)), fn2((e4) => e4 + 1);
2716
2708
  });
2717
- }, [sn2]), bn2 = r(() => ln2 ? Promise.resolve(`none`) : new Promise((e3) => {
2718
- if (cn2 && !mn2.current) {
2719
- yn2([...gn2(), e3]);
2709
+ }, [on2]), yn2 = r(() => cn2 ? Promise.resolve(`none`) : new Promise((e3) => {
2710
+ if (sn2 && !pn2.current) {
2711
+ vn2([...hn2(), e3]);
2720
2712
  return;
2721
2713
  }
2722
- hn2.current.push(e3), dn2(true);
2723
- }), [ln2, cn2, yn2, gn2]);
2714
+ mn2.current.push(e3), un2(true);
2715
+ }), [cn2, sn2, vn2, hn2]);
2724
2716
  a(() => {
2725
- if (un2 && !mn2.current) {
2726
- if (ln2) {
2727
- gn2().forEach((e3) => e3(`none`));
2717
+ if (ln2 && !pn2.current) {
2718
+ if (cn2) {
2719
+ hn2().forEach((e3) => e3(`none`));
2728
2720
  return;
2729
2721
  }
2730
- cn2 && yn2(gn2());
2722
+ sn2 && vn2(hn2());
2731
2723
  }
2732
- }, [un2, fn2, cn2, ln2, yn2, gn2]);
2733
- let xn2 = x2?.schedule?.lastSessionEnd, Sn2 = I2 || Xa(C2) || Za(C2) && !Vc(xn2, Bt2), Cn2 = !!(Ae2 && i2 && !j2 && P2 && V2 && Bt2 !== void 0), wn2 = Cn2 && P2 && V2 && Bt2 !== void 0 ? Hc({ serviceId: P2, serviceType: C2, lastSessionEnd: xn2, timeZone: V2, now: Bt2, onlyAvailableSlots: e2, locationId: at2, staffId: z2, timeSlotLimitPerDay: f2, customerChoices: Mt2, minRemainingCapacity: Tt2 }) : void 0, W2 = dl(l2, wn2), Tn2 = Ae2 && P2 && Sn2 && !(Ae2 && P2 && Sn2 && (!i2 || j2)) && !V2, En2 = ve2 ? `onlineBookingOff` : ue2 ?? (W2.error === null ? Tn2 ? `timeZoneMissing` : null : `upcomingSlotsLoadFailed`), Dn2 = H2 !== null, On2 = o(() => Yc({ sessions: W2.sessions, dayQuery: Dn2, daySlots: $t2, staffFilter: z2, appointmentLike: I2, limitPerDay: f2, expandedDates: W2.expandedDates }), [W2.sessions, Dn2, $t2, z2, I2, f2, W2.expandedDates]), { slotIdOf: kn2 } = On2, An2 = Ae2 && (wn2 ? W2.firstPageSettled : Cn2 || i2 && !j2 && !P2 || Tn2);
2734
- Ne2.current = An2, a(() => {
2735
- if (!An2) return;
2736
- let e3 = Me2.current;
2737
- Me2.current = [], e3.forEach((e4) => e4());
2738
- }, [An2]);
2739
- let jn2 = Ae2 && !An2 || W2.isLoadingPage, Mn2 = En2 !== null, Nn2 = H2 ? en2 : jn2 || en2 || !i2 || xe2 && !V2 || un2 || le2, Pn2 = H2 ? tn2 : tn2 ?? En2, Fn2 = H2 ? tn2 !== null : Mn2 || tn2 !== null, In2 = hc(dc.TIME_SLOTS), Ln2 = s(false), Rn2 = r((e3, t3) => {
2724
+ }, [ln2, dn2, sn2, cn2, vn2, hn2]);
2725
+ let bn2 = x2?.schedule?.lastSessionEnd, xn2 = L2 || Ga(C2) || Ka(C2) && !Rc(bn2, zt2), Sn2 = !!(ke2 && i2 && !M2 && F2 && H2 && zt2 !== void 0), Cn2 = Sn2 && F2 && H2 && zt2 !== void 0 ? zc({ serviceId: F2, serviceType: C2, lastSessionEnd: bn2, timeZone: H2, now: zt2, onlyAvailableSlots: e2, locationId: it2, staffId: B2, timeSlotLimitPerDay: f2, customerChoices: jt2, minRemainingCapacity: wt2 }) : void 0, G2 = cl(l2, Cn2), wn2 = ke2 && F2 && xn2 && !(ke2 && F2 && xn2 && (!i2 || M2)) && !H2, Tn2 = _e2 ? `onlineBookingOff` : le2 ?? (G2.error === null ? wn2 ? `timeZoneMissing` : null : `upcomingSlotsLoadFailed`), En2 = U2 !== null, Dn2 = o(() => Kc({ sessions: G2.sessions, dayQuery: En2, daySlots: Qt2, staffFilter: B2, appointmentLike: L2, limitPerDay: f2, expandedDates: G2.expandedDates }), [G2.sessions, En2, Qt2, B2, L2, f2, G2.expandedDates]), { slotIdOf: On2 } = Dn2, kn2 = ke2 && (Cn2 ? G2.firstPageSettled : Sn2 || i2 && !M2 && !F2 || wn2);
2726
+ Me2.current = kn2, a(() => {
2727
+ if (!kn2) return;
2728
+ let e3 = je2.current;
2729
+ je2.current = [], e3.forEach((e4) => e4());
2730
+ }, [kn2]);
2731
+ let An2 = ke2 && !kn2 || G2.isLoadingPage, jn2 = Tn2 !== null, Mn2 = U2 ? $t2 : An2 || $t2 || !i2 || be2 && !H2 || ln2 || ce2, Nn2 = U2 ? en2 : en2 ?? Tn2, Pn2 = U2 ? en2 !== null : jn2 || en2 !== null, Fn2 = fc(cc.TIME_SLOTS), In2 = s(false), Ln2 = r((e3, t3) => {
2740
2732
  if (!t3.bookable) {
2741
- on2.current = null;
2733
+ an2.current = null;
2742
2734
  return;
2743
2735
  }
2744
- if (e3 === on2.current) return;
2745
- on2.current = e3;
2746
- let n3 = P2 ?? t3.serviceId ?? t3.nestedTimeSlots?.[0]?.serviceId ?? void 0, r2 = C2 ?? M2.find((e4) => e4._id === n3)?.type ?? void 0;
2747
- !Ln2.current && !N2 && In2(lc({ bookingsServiceId: n3, serviceType: r2, isEligibleForFlowCompletion: true })), Ln2.current = true, In2(_c({ component: pc.TIME_PICKER, element: mc.TIME_SLOT, properties: JSON.stringify({ selectedTime: t3.localStartDate }) }));
2748
- }, [In2, P2, C2, M2, N2]), zn2 = r((e3) => {
2736
+ if (e3 === an2.current) return;
2737
+ an2.current = e3;
2738
+ let n3 = F2 ?? t3.serviceId ?? t3.nestedTimeSlots?.[0]?.serviceId ?? void 0, r2 = C2 ?? N2.find((e4) => e4._id === n3)?.type ?? void 0;
2739
+ !In2.current && !P2 && Fn2(oc({ bookingsServiceId: n3, serviceType: r2, isEligibleForFlowCompletion: true })), In2.current = true, Fn2(mc({ component: uc.TIME_PICKER, element: dc.TIME_SLOT, properties: JSON.stringify({ selectedTime: t3.localStartDate }) }));
2740
+ }, [Fn2, F2, C2, N2, P2]), Rn2 = r((e3) => {
2749
2741
  if (e3 === null) {
2750
- let e4 = Le2.current !== null;
2751
- Le2.current = null, on2.current = null, ke2(null), e4 && Cl(P2, T2, E2);
2742
+ let e4 = Ie2.current !== null;
2743
+ Ie2.current = null, an2.current = null, Oe2(null), e4 && bl(F2, T2, E2);
2752
2744
  return;
2753
2745
  }
2754
- let t3 = Xc(On2, e3);
2746
+ let t3 = qc(Dn2, e3);
2755
2747
  if (!t3) return;
2756
- if (F2) {
2757
- if (!ee2(t3.nestedTimeSlots ?? [], V2 ?? void 0)) return;
2758
- Le2.current = t3, ke2(t3), Rn2(e3, t3);
2748
+ if (I2) {
2749
+ if (!ee2(t3.nestedTimeSlots ?? [], H2 ?? void 0)) return;
2750
+ Ie2.current = t3, Oe2(t3), Ln2(e3, t3);
2759
2751
  return;
2760
2752
  }
2761
- Le2.current = t3, ke2(t3), Rn2(e3, t3);
2762
- let n3 = el(t3);
2763
- if (w2(gs(t3), { staffId: I2 ? void 0 : $c(t3), timezone: V2 ?? void 0, bookable: t3.bookable, staffChoiceRequired: I2 && Ue2 && !L2 && n3.length > 1 && !Pt2(n3.length), rescheduleStaffId: I2 && (_2 !== `CUSTOMER_MAY_CHOOSE` || !Pt2(n3.length)) ? n3[0] : void 0 }), !I2) return;
2764
- let r2 = ze2.current, i3;
2765
- i3 = R2 || (z2 && n3.includes(z2) ? { anyResource: false, staffMemberId: z2 } : B2 !== null && Pt2(n3.length) ? { anyResource: true } : Wc(n3, Ue2 && Pt2(n3.length))), ml(i3, B2) !== ml(r2, Ve2) && St2(i3);
2766
- }, [F2, P2, T2, E2, ee2, w2, On2, Rn2, V2, I2, Ue2, _2, Pt2, R2, z2, B2, Ve2, St2]), Bn2 = r(() => {
2767
- let e3 = Le2.current;
2768
- if (!e3 || N2) return;
2769
- if (F2) {
2770
- te2(In2);
2753
+ Ie2.current = t3, Oe2(t3), Ln2(e3, t3);
2754
+ let n3 = Zc(t3);
2755
+ if (w2(ms(t3), { staffId: L2 ? void 0 : Xc(t3), timezone: H2 ?? void 0, bookable: t3.bookable, staffChoiceRequired: L2 && He2 && !R2 && n3.length > 1 && !Nt2(n3.length), rescheduleStaffId: L2 && (_2 !== `CUSTOMER_MAY_CHOOSE` || !Nt2(n3.length)) ? n3[0] : void 0 }), !L2) return;
2756
+ let r2 = Re2.current, i3;
2757
+ i3 = z2 || (B2 && n3.includes(B2) ? { anyResource: false, staffMemberId: B2 } : V2 !== null && Nt2(n3.length) ? { anyResource: true } : Vc(n3, He2 && Nt2(n3.length))), dl(i3, V2) !== dl(r2, Be2) && xt2(i3);
2758
+ }, [I2, F2, T2, E2, ee2, w2, Dn2, Ln2, H2, L2, He2, _2, Nt2, z2, B2, V2, Be2, xt2]), zn2 = r(() => {
2759
+ let e3 = Ie2.current;
2760
+ if (!e3 || P2) return;
2761
+ if (I2) {
2762
+ O2(Fn2);
2771
2763
  return;
2772
2764
  }
2773
- if (!P2) return;
2765
+ if (!F2) return;
2774
2766
  let t3;
2775
- if (I2) {
2776
- let n4 = el(e3), r2 = Gc(n4, Ft2(ze2.current), Pt2(n4.length));
2767
+ if (L2) {
2768
+ let n4 = Zc(e3), r2 = Hc(n4, Pt2(Re2.current), Nt2(n4.length));
2777
2769
  t3 = (r2.isComplete ? r2.resourceId : n4[0]) ?? (n4.length ? null : void 0);
2778
2770
  }
2779
- let n3 = De2(`bookingForm`, { slug: x2?.mainSlug?.name ?? null, serviceId: P2 });
2780
- e3.bookable && In2(bc({ serviceId: P2, serviceType: C2 ?? void 0, start: e3.localStartDate, end: e3.localEndDate, timeZone: V2 ?? void 0, isEligibleForFlowCompletion: !!n3 })), n3 && Ee2(ie2(n3, { handoff: true, staffId: t3 }));
2781
- }, [In2, F2, te2, V2, P2, C2, x2, I2, Ft2, Pt2, Ee2, De2, ie2, N2]), Vn2 = Oe2 ? el(Oe2) : null, Hn2 = Vn2 ? F2 || !I2 || Gc(Vn2, Ft2(Re2), Pt2(Vn2.length)).isComplete : false, G2 = Vn2 ? Pt2(Vn2.length) : false, Un2 = o(() => !Oe2 || Ze2 ? [] : Qc(Oe2).map((e3) => ({ staffMemberId: e3.staffMemberId, name: e3.name || null, image: null, isSelected: e3.staffMemberId === Be2 })), [Oe2, Ze2, Be2]), Wn2 = o(() => ({ ...vl, isMultiService: F2, hasValidSchedulingInput: xe2, availabilityRequestKey: Se2, needsServiceChoice: Ce2, isRescheduling: N2, rescheduleValidUntil: Zt2, businessTimeZone: g2, canChangeTimeZone: Rt2, setTimeZone: zt2, locationFilterOptions: ot2, selectedLocationFilter: at2, setLocationFilter: Lt2, staffFilterOptions: ut2, selectedStaffFilter: z2, setStaffFilter: It2, requestedGender: B2, genderSelectionAllowed: Ge2, currentTimeSlotsPage: H2 ? 1 : W2.currentPage, hasNextTimeSlotsPage: !H2 && W2.hasNextPage, hasPreviousTimeSlotsPage: !H2 && W2.hasPreviousPage, nextTimeSlotsPage: H2 ? bl : W2.nextPage, loadUpcomingTimeSlots: Pe2, upcomingTimeSlotsRequested: Ae2, previousTimeSlotsPage: H2 ? yl : W2.previousPage, timeSlots: On2.rows.map((e3) => Zc(e3, V2, kn2, L2)), isLoading: Nn2, hasError: Fn2, errorCode: Pn2, selectedDate: Qt2, daysAvailabilityRange: Ht2, daysAvailability: Xt2, daysAvailabilityLoading: Wt2, daysAvailabilityHasError: Gt2, timeSlotsLoading: Nn2, timeSlotsErrorCode: Pn2, selectDate: vn2, setDaysAvailabilityRange: Kt2, nextDaysAvailabilityRange: qt2, previousDaysAvailabilityRange: Jt2, goToNextAvailableDate: bn2, nextAvailableSlotsCount: l2, timeZone: V2, staffFromSlots: Un2, selectedResourceId: Be2, setSelectedResource: Ct2, canAutoAssignStaff: G2, isComplete: Hn2, selectedTimeSlot: Oe2 ? Zc(Oe2, V2, kn2, L2) : null, selectTimeSlot: zn2, navigateToBookingForm: Bn2, timeSlotLimitPerDay: f2, expandedDates: W2.expandedDates, daysWithMore: On2.daysWithMore, loadingDate: W2.loadingDate, loadAllTimeSlotsForDay: W2.loadAllSessionsForDay }), [F2, xe2, Se2, Ce2, N2, Zt2, g2, V2, Rt2, zt2, W2, Pe2, Ae2, ot2, at2, Lt2, ut2, z2, It2, B2, Ge2, H2, Nn2, Pn2, Fn2, On2, Qt2, Ht2, Xt2, Wt2, Gt2, vn2, Kt2, qt2, Jt2, bn2, l2, Un2, Be2, Ct2, G2, Hn2, Oe2, zn2, Bn2, f2, kn2, L2]);
2782
- return p(xl.Provider, { value: Wn2, children: b2 });
2771
+ let n3 = Ee2(`bookingForm`, { slug: x2?.mainSlug?.name ?? null, serviceId: F2 });
2772
+ e3.bookable && Fn2(_c({ serviceId: F2, serviceType: C2 ?? void 0, start: e3.localStartDate, end: e3.localEndDate, timeZone: H2 ?? void 0, isEligibleForFlowCompletion: !!n3 })), n3 && Te2(re2(n3, { handoff: true, staffId: t3 }));
2773
+ }, [Fn2, I2, O2, H2, F2, C2, x2, L2, Pt2, Nt2, Te2, Ee2, re2, P2]), Bn2 = De2 ? Zc(De2) : null, Vn2 = Bn2 ? I2 || !L2 || Hc(Bn2, Pt2(Le2), Nt2(Bn2.length)).isComplete : false, K2 = Bn2 ? Nt2(Bn2.length) : false, Hn2 = o(() => !De2 || Xe2 ? [] : Yc(De2).map((e3) => ({ staffMemberId: e3.staffMemberId, name: e3.name || null, image: null, isSelected: e3.staffMemberId === ze2 })), [De2, Xe2, ze2]), Un2 = o(() => ({ ...hl, isMultiService: I2, hasValidSchedulingInput: be2, availabilityRequestKey: xe2, needsServiceChoice: Se2, isRescheduling: P2, rescheduleValidUntil: Xt2, businessTimeZone: g2, canChangeTimeZone: Lt2, setTimeZone: Rt2, locationFilterOptions: at2, selectedLocationFilter: it2, setLocationFilter: It2, staffFilterOptions: lt2, selectedStaffFilter: B2, setStaffFilter: Ft2, requestedGender: V2, genderSelectionAllowed: We2, currentTimeSlotsPage: U2 ? 1 : G2.currentPage, hasNextTimeSlotsPage: !U2 && G2.hasNextPage, hasPreviousTimeSlotsPage: !U2 && G2.hasPreviousPage, nextTimeSlotsPage: U2 ? _l : G2.nextPage, loadUpcomingTimeSlots: Ne2, upcomingTimeSlotsRequested: ke2, previousTimeSlotsPage: U2 ? gl : G2.previousPage, timeSlots: Dn2.rows.map((e3) => Jc(e3, H2, On2, R2)), isLoading: Mn2, hasError: Pn2, errorCode: Nn2, selectedDate: Zt2, daysAvailabilityRange: Vt2, daysAvailability: Yt2, daysAvailabilityLoading: Ut2, daysAvailabilityHasError: Wt2, timeSlotsLoading: Mn2, timeSlotsErrorCode: Nn2, selectDate: _n2, setDaysAvailabilityRange: Gt2, nextDaysAvailabilityRange: Kt2, previousDaysAvailabilityRange: qt2, goToNextAvailableDate: yn2, nextAvailableSlotsCount: l2, timeZone: H2, staffFromSlots: Hn2, selectedResourceId: ze2, setSelectedResource: St2, canAutoAssignStaff: K2, isComplete: Vn2, selectedTimeSlot: De2 ? Jc(De2, H2, On2, R2) : null, selectTimeSlot: Rn2, navigateToBookingForm: zn2, timeSlotLimitPerDay: f2, expandedDates: G2.expandedDates, daysWithMore: Dn2.daysWithMore, loadingDate: G2.loadingDate, loadAllTimeSlotsForDay: G2.loadAllSessionsForDay }), [I2, be2, xe2, Se2, P2, Xt2, g2, H2, Lt2, Rt2, G2, Ne2, ke2, at2, it2, It2, lt2, B2, Ft2, V2, We2, U2, Mn2, Nn2, Pn2, Dn2, Zt2, Vt2, Yt2, Ut2, Wt2, _n2, Gt2, Kt2, qt2, yn2, l2, Hn2, ze2, St2, K2, Vn2, De2, Rn2, zn2, f2, On2, R2]);
2774
+ return p(vl.Provider, { value: Un2, children: b2 });
2783
2775
  }
2784
- var Al = on;
2776
+ var Dl = an;
2785
2777
  export {
2786
- El as TimeSlotsContextProvider,
2787
- El as default,
2788
- Al as injectAccessTokenGetter,
2789
- xl as timeSlotsContext,
2790
- Sl as useTimeSlotsContext
2778
+ Cl as TimeSlotsContextProvider,
2779
+ Cl as default,
2780
+ Dl as injectAccessTokenGetter,
2781
+ vl as timeSlotsContext,
2782
+ yl as useTimeSlotsContext
2791
2783
  };
2792
- //# sourceMappingURL=context-time-slots-context.mjs.map
2784
+ //# sourceMappingURL=context-time-slots.mjs.map