@wix/bookings 1.0.1750 → 1.0.1751

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/runtime.js +2 -0
  2. package/_sdk-exports/context-categories/runtime.js +1 -0
  3. package/_sdk-exports/context-locations/runtime.js +1 -0
  4. package/_sdk-exports/{context-service-context → context-service}/runtime.d.ts +1 -1
  5. package/_sdk-exports/{context-service-context → context-service}/runtime.js +2 -2
  6. package/_sdk-exports/context-service-addons/runtime.js +1 -0
  7. package/_sdk-exports/context-services/runtime.js +2 -0
  8. package/_sdk-exports/context-time-slots/runtime.js +2 -0
  9. package/build/cjs/{context-booking-checkout-context.js → context-booking-checkout.js} +909 -925
  10. package/build/cjs/context-booking-checkout.js.map +1 -0
  11. package/build/cjs/{context-categories-context.js → context-categories.js} +287 -293
  12. package/build/cjs/context-categories.js.map +1 -0
  13. package/build/cjs/{context-locations-context.js → context-locations.js} +362 -368
  14. package/build/cjs/context-locations.js.map +1 -0
  15. package/build/cjs/{context-service-addons-context.js → context-service-addons.js} +424 -430
  16. package/build/cjs/context-service-addons.js.map +1 -0
  17. package/build/cjs/{context-service-context.d.ts → context-service.d.ts} +1 -1
  18. package/build/cjs/{context-service-context.js → context-service.js} +964 -977
  19. package/build/cjs/context-service.js.map +1 -0
  20. package/build/cjs/{context-services-context.js → context-services.js} +600 -611
  21. package/build/cjs/context-services.js.map +1 -0
  22. package/build/cjs/{context-time-slots-context.js → context-time-slots.js} +1187 -1195
  23. package/build/cjs/context-time-slots.js.map +1 -0
  24. package/build/es/{context-booking-checkout-context.mjs → context-booking-checkout.mjs} +906 -922
  25. package/build/es/context-booking-checkout.mjs.map +1 -0
  26. package/build/es/{context-categories-context.mjs → context-categories.mjs} +283 -289
  27. package/build/es/context-categories.mjs.map +1 -0
  28. package/build/es/{context-locations-context.mjs → context-locations.mjs} +358 -364
  29. package/build/es/context-locations.mjs.map +1 -0
  30. package/build/es/{context-service-addons-context.mjs → context-service-addons.mjs} +417 -423
  31. package/build/es/context-service-addons.mjs.map +1 -0
  32. package/build/{internal/cjs/context-service-context.d.ts → es/context-service.d.mts} +1 -1
  33. package/build/es/{context-service-context.mjs → context-service.mjs} +960 -973
  34. package/build/es/context-service.mjs.map +1 -0
  35. package/build/es/{context-services-context.mjs → context-services.mjs} +596 -607
  36. package/build/es/context-services.mjs.map +1 -0
  37. package/build/es/{context-time-slots-context.mjs → context-time-slots.mjs} +1181 -1189
  38. package/build/es/context-time-slots.mjs.map +1 -0
  39. package/build/internal/{es/context-service-context.d.mts → cjs/context-service.d.ts} +1 -1
  40. package/build/{es/context-service-context.d.mts → internal/es/context-service.d.mts} +1 -1
  41. package/context/booking-checkout/package.json +3 -0
  42. package/context/categories/package.json +3 -0
  43. package/context/locations/package.json +3 -0
  44. package/context/service/package.json +3 -0
  45. package/context/service-addons/package.json +3 -0
  46. package/context/services/package.json +3 -0
  47. package/context/time-slots/package.json +3 -0
  48. package/package.json +37 -37
  49. package/_sdk-exports/context-booking-checkout-context/runtime.js +0 -2
  50. package/_sdk-exports/context-categories-context/runtime.js +0 -1
  51. package/_sdk-exports/context-locations-context/runtime.js +0 -1
  52. package/_sdk-exports/context-service-addons-context/runtime.js +0 -1
  53. package/_sdk-exports/context-services-context/runtime.js +0 -2
  54. package/_sdk-exports/context-time-slots-context/runtime.js +0 -2
  55. package/build/cjs/context-booking-checkout-context.js.map +0 -1
  56. package/build/cjs/context-categories-context.js.map +0 -1
  57. package/build/cjs/context-locations-context.js.map +0 -1
  58. package/build/cjs/context-service-addons-context.js.map +0 -1
  59. package/build/cjs/context-service-context.js.map +0 -1
  60. package/build/cjs/context-services-context.js.map +0 -1
  61. package/build/cjs/context-time-slots-context.js.map +0 -1
  62. package/build/es/context-booking-checkout-context.mjs.map +0 -1
  63. package/build/es/context-categories-context.mjs.map +0 -1
  64. package/build/es/context-locations-context.mjs.map +0 -1
  65. package/build/es/context-service-addons-context.mjs.map +0 -1
  66. package/build/es/context-service-context.mjs.map +0 -1
  67. package/build/es/context-services-context.mjs.map +0 -1
  68. package/build/es/context-time-slots-context.mjs.map +0 -1
  69. package/context/booking-checkout-context/package.json +0 -3
  70. package/context/categories-context/package.json +0 -3
  71. package/context/locations-context/package.json +0 -3
  72. package/context/service-addons-context/package.json +0 -3
  73. package/context/service-context/package.json +0 -3
  74. package/context/services-context/package.json +0 -3
  75. package/context/time-slots-context/package.json +0 -3
  76. /package/_sdk-exports/{context-booking-checkout-context → context-booking-checkout}/runtime.d.ts +0 -0
  77. /package/_sdk-exports/{context-categories-context → context-categories}/runtime.d.ts +0 -0
  78. /package/_sdk-exports/{context-locations-context → context-locations}/runtime.d.ts +0 -0
  79. /package/_sdk-exports/{context-service-addons-context → context-service-addons}/runtime.d.ts +0 -0
  80. /package/_sdk-exports/{context-services-context → context-services}/runtime.d.ts +0 -0
  81. /package/_sdk-exports/{context-time-slots-context → context-time-slots}/runtime.d.ts +0 -0
  82. /package/build/cjs/{context-booking-checkout-context.d.ts → context-booking-checkout.d.ts} +0 -0
  83. /package/build/cjs/{context-categories-context.d.ts → context-categories.d.ts} +0 -0
  84. /package/build/cjs/{context-locations-context.d.ts → context-locations.d.ts} +0 -0
  85. /package/build/cjs/{context-service-addons-context.d.ts → context-service-addons.d.ts} +0 -0
  86. /package/build/cjs/{context-services-context.d.ts → context-services.d.ts} +0 -0
  87. /package/build/cjs/{context-time-slots-context.d.ts → context-time-slots.d.ts} +0 -0
  88. /package/build/es/{context-booking-checkout-context.d.mts → context-booking-checkout.d.mts} +0 -0
  89. /package/build/es/{context-categories-context.d.mts → context-categories.d.mts} +0 -0
  90. /package/build/es/{context-locations-context.d.mts → context-locations.d.mts} +0 -0
  91. /package/build/es/{context-service-addons-context.d.mts → context-service-addons.d.mts} +0 -0
  92. /package/build/es/{context-services-context.d.mts → context-services.d.mts} +0 -0
  93. /package/build/es/{context-time-slots-context.d.mts → context-time-slots.d.mts} +0 -0
  94. /package/build/internal/cjs/{context-booking-checkout-context.d.ts → context-booking-checkout.d.ts} +0 -0
  95. /package/build/internal/cjs/{context-categories-context.d.ts → context-categories.d.ts} +0 -0
  96. /package/build/internal/cjs/{context-locations-context.d.ts → context-locations.d.ts} +0 -0
  97. /package/build/internal/cjs/{context-service-addons-context.d.ts → context-service-addons.d.ts} +0 -0
  98. /package/build/internal/cjs/{context-services-context.d.ts → context-services.d.ts} +0 -0
  99. /package/build/internal/cjs/{context-time-slots-context.d.ts → context-time-slots.d.ts} +0 -0
  100. /package/build/internal/es/{context-booking-checkout-context.d.mts → context-booking-checkout.d.mts} +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,4 +1,4 @@
1
- // _sdk-exports/context-locations-context/runtime.js
1
+ // _sdk-exports/context-locations/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
3
  import { useGetService as u, useService as d } from "@wix/services-manager-react";
4
4
  import { jsx as f } from "react/jsx-runtime";
@@ -65,20 +65,20 @@ var b = class extends Error {
65
65
  }
66
66
  };
67
67
  var x = (e2, t2, n2, r2) => ({ details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2, requestId: r2?.requestId });
68
- var S = (e2) => e2?.method && [`post`, `put`, `patch`].includes(e2.method.toLocaleLowerCase()) && e2.body ? { "Content-Type": `application/json` } : {};
69
- var ee = (e2) => e2 && typeof e2 == `object` && !Array.isArray(e2);
70
- var te = (e2) => e2.__type === `host`;
71
- function ne(e2, t2) {
68
+ var ee = (e2) => e2?.method && [`post`, `put`, `patch`].includes(e2.method.toLocaleLowerCase()) && e2.body ? { "Content-Type": `application/json` } : {};
69
+ var te = (e2) => e2 && typeof e2 == `object` && !Array.isArray(e2);
70
+ var ne = (e2) => e2.__type === `host`;
71
+ function re(e2, t2) {
72
72
  return e2.create(t2);
73
73
  }
74
- var re = `x-wix-bi-gateway`;
75
- function ie(e2, t2, n2) {
76
- return { [re]: ae({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e2.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e2.methodFqn, entity: e2.entityFqdn }) };
74
+ var ie = `x-wix-bi-gateway`;
75
+ function ae(e2, t2, n2) {
76
+ return { [ie]: oe({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e2.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e2.methodFqn, entity: e2.entityFqdn }) };
77
77
  }
78
- function ae(e2) {
78
+ function oe(e2) {
79
79
  return Object.entries(e2).filter(([e3, t2]) => !!t2).map(([e3, t2]) => `${e3}=${t2}`).join(`,`);
80
80
  }
81
- function C(e2) {
81
+ function S(e2) {
82
82
  let t2 = globalThis.__wix_context__, n2 = { client: p.client, elevatedClient: p.elevatedClient }, r2;
83
83
  globalThis.__wix_context__ = void 0, p.client = void 0, p.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
84
84
  try {
@@ -87,82 +87,82 @@ function C(e2) {
87
87
  globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
88
88
  }
89
89
  }
90
- var w = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
91
- function T(e2) {
92
- return ue(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
90
+ var C = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
91
+ function w(e2) {
92
+ return de(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
93
93
  }
94
- var oe = /([\p{Ll}\d])(\p{Lu})/gu;
95
- var se = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
96
- var ce = `$1\0$2`;
97
- var le = /[^\p{L}\d]+/giu;
98
- function ue(e2) {
94
+ var se = /([\p{Ll}\d])(\p{Lu})/gu;
95
+ var ce = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
96
+ var le = `$1\0$2`;
97
+ var ue = /[^\p{L}\d]+/giu;
98
+ function de(e2) {
99
99
  let t2 = e2.trim();
100
- t2 = t2.replace(oe, ce).replace(se, ce), t2 = t2.replace(le, `\0`);
100
+ t2 = t2.replace(se, le).replace(ce, le), t2 = t2.replace(ue, `\0`);
101
101
  let n2 = 0, r2 = t2.length;
102
102
  for (; t2.charAt(n2) === `\0`; ) n2++;
103
103
  if (n2 === r2) return [];
104
104
  for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
105
105
  return t2.slice(n2, r2).split(/\0/g);
106
106
  }
107
- var de = (e2) => `validationError` in (e2.response?.data?.details ?? {});
108
- var fe = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
109
- var pe = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
110
- function me(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
107
+ var fe = (e2) => `validationError` in (e2.response?.data?.details ?? {});
108
+ var pe = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
109
+ var me = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
110
+ function he(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
111
111
  if (typeof e2 != `object` || !e2) throw e2;
112
- if (de(e2)) return he(e2, t2, n2);
113
- if (fe(e2)) return ge(e2);
114
- if (pe(e2)) {
115
- let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: T(n3), data: {} }, requestId: e2.requestId };
116
- return E(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
112
+ if (fe(e2)) return ge(e2, t2, n2);
113
+ if (pe(e2)) return _e(e2);
114
+ if (me(e2)) {
115
+ let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: w(n3), data: {} }, requestId: e2.requestId };
116
+ return T(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
117
117
  }
118
- return _e(e2);
118
+ return ve(e2);
119
119
  }
120
- var he = (e2, t2, n2) => {
121
- let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = ve(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 };
122
- return E(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
120
+ var ge = (e2, t2, n2) => {
121
+ let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = ye(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 };
122
+ return T(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
123
123
  };
124
- var E = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
125
- var ge = (e2) => {
126
- 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 ?? T(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 };
127
- return E(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
124
+ var T = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
125
+ var _e = (e2) => {
126
+ 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 ?? w(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 };
127
+ return T(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
128
128
  };
129
- var _e = (e2) => E(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: T(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
130
- var ve = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
129
+ var ve = (e2) => T(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: w(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
130
+ var ye = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
131
131
  let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
132
132
  return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
133
133
  let r3 = t2[e3.field];
134
- if (r3) return { ...e3, field: D(r3, i2) };
134
+ if (r3) return { ...e3, field: E(r3, i2) };
135
135
  let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
136
136
  if (s2) {
137
137
  let t3 = a2[s2];
138
- if (t3) return { ...e3, field: e3.field.replace(s2, D(t3, i2)) };
138
+ if (t3) return { ...e3, field: e3.field.replace(s2, E(t3, i2)) };
139
139
  }
140
140
  return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
141
141
  });
142
142
  };
143
- var D = (e2, t2) => {
144
- let n2 = ye(e2);
143
+ var E = (e2, t2) => {
144
+ let n2 = be(e2);
145
145
  return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
146
146
  };
147
- var ye = (e2) => {
147
+ var be = (e2) => {
148
148
  let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
149
149
  return t2 && t2.groups && Number(t2.groups.argIndex);
150
150
  };
151
- function be(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
152
- return C(() => e2({ request: async (e3) => {
151
+ function xe(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
152
+ return S(() => e2({ request: async (e3) => {
153
153
  let i3 = e3({ host: s2?.HTTPHost || `www.wixapis.com` }), a3 = i3;
154
154
  a3.method === `GET` && a3.fallback?.length && (a3.params?.toString().length ?? 0) > 4e3 && (a3 = i3.fallback[0]);
155
155
  let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ? y : o3}${a3.url}`;
156
156
  a3.params && a3.params.toString() && (u3 += `?${a3.params.toString()}`);
157
157
  try {
158
- let e4 = ie(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e4 } }, s3 = await n2(u3, o4);
158
+ let e4 = ae(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e4 } }, s3 = await n2(u3, o4);
159
159
  if (s3.status !== 200) {
160
160
  let e5 = null;
161
161
  try {
162
162
  e5 = await s3.json();
163
163
  } catch {
164
164
  }
165
- let t3 = Se(s3.status, e5?.message ?? s3.statusText, e5?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e5 }), n3 = me(t3);
165
+ let t3 = Ce(s3.status, e5?.message ?? s3.statusText, e5?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e5 }), n3 = he(t3);
166
166
  throw r2?.handleError(n3, { requestOptions: { url: a3.url, method: a3.method, entityFqdn: i3.entityFqdn, methodFqn: i3.methodFqn } }), t3;
167
167
  }
168
168
  let l3 = await s3.json();
@@ -172,18 +172,18 @@ function be(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
172
172
  }
173
173
  }, fetchWithAuth: n2, wixAPIFetch: i2, getActiveToken: a2, getAuthHeaders: o2 }, { validateRequestSchema: u2 }));
174
174
  }
175
- var xe = class extends Error {
175
+ var Se = class extends Error {
176
176
  response;
177
177
  requestId;
178
178
  constructor(e2) {
179
179
  super(), this.response = e2.response, this.requestId = e2.requestId;
180
180
  }
181
181
  };
182
- var Se = (e2, t2, n2, r2) => new xe({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2 }, status: e2 }, requestId: r2?.requestId });
183
- var Ce = `.`;
184
- function we(e2, t2, n2) {
182
+ var Ce = (e2, t2, n2, r2) => new Se({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2 }, status: e2 }, requestId: r2?.requestId });
183
+ var we = `.`;
184
+ function Te(e2, t2, n2) {
185
185
  if (e2 == null) throw Error(`Cannot set value on null or undefined`);
186
- let r2 = Te(t2), i2 = e2;
186
+ let r2 = Ee(t2), i2 = e2;
187
187
  for (let e3 = 0; e3 < r2.length; e3++) {
188
188
  let t3 = r2[e3];
189
189
  if (e3 === r2.length - 1) {
@@ -195,21 +195,21 @@ function we(e2, t2, n2) {
195
195
  }
196
196
  return e2;
197
197
  }
198
- function Te(e2) {
199
- return Array.isArray(e2) ? e2 : e2.split(Ce).map((e3) => Ee(e3) ? Number(e3) : e3);
200
- }
201
198
  function Ee(e2) {
202
- return /^\d+$/.test(e2);
199
+ return Array.isArray(e2) ? e2 : e2.split(we).map((e3) => De(e3) ? Number(e3) : e3);
203
200
  }
204
201
  function De(e2) {
202
+ return /^\d+$/.test(e2);
203
+ }
204
+ function Oe(e2) {
205
205
  let t2 = {};
206
- for (let [n2, r2] of Object.entries(e2)) Oe(n2) || we(t2, Te(n2), r2);
206
+ for (let [n2, r2] of Object.entries(e2)) ke(n2) || Te(t2, Ee(n2), r2);
207
207
  return t2;
208
208
  }
209
- function Oe(e2) {
209
+ function ke(e2) {
210
210
  return e2 === `__proto__` || e2 === `constructor` || e2 === `prototype`;
211
211
  }
212
- var ke = class {
212
+ var Ae = class {
213
213
  BRACKET_PATTERN = /\[(\d+)\]/g;
214
214
  NUMERIC_PATTERN = /^\d+$/;
215
215
  ESCAPED_DOT_PATTERN = /\\\./g;
@@ -232,7 +232,7 @@ var ke = class {
232
232
  return e2.replace(this.ESCAPED_DOT_PLACEHOLDER, `\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER, `\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER, `\\[`);
233
233
  }
234
234
  unflatten() {
235
- return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e2, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e2)), t2])), De(this.cleanedModifiedFields);
235
+ return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e2, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e2)), t2])), Oe(this.cleanedModifiedFields);
236
236
  }
237
237
  flatten(e2) {
238
238
  let t2 = {};
@@ -252,12 +252,12 @@ var ke = class {
252
252
  if (!Array.isArray(n2)) throw Error(`Expected array at path ${this.buildPathString(r2)}, but got ${typeof n2}`);
253
253
  r2.push(`[${e3}]`), n2 = n2[parseInt(e3, 10)];
254
254
  }, a2 = (e3, t3) => {
255
- let i3 = e3 in w ? w[e3] : void 0;
255
+ let i3 = e3 in C ? C[e3] : void 0;
256
256
  if (i3 && i3 in t3) {
257
257
  r2.push(i3), n2 = t3[i3];
258
258
  return;
259
259
  }
260
- let a3 = Ne(e3);
260
+ let a3 = Pe(e3);
261
261
  if (a3 && a3 in t3) {
262
262
  r2.push(a3), n2 = t3[a3];
263
263
  return;
@@ -288,28 +288,28 @@ var ke = class {
288
288
  return e2.replace(this.BRACKET_PATTERN, (t2, n2, r2) => r2 > 0 && e2[r2 - 1] === `\\` ? t2 : `.` + n2);
289
289
  }
290
290
  };
291
- function Ae(e2, t2) {
291
+ function je(e2, t2) {
292
292
  let n2 = e2?.modifiedFields;
293
293
  if (!n2) return null;
294
- let r2 = je(n2);
294
+ let r2 = Me(n2);
295
295
  if (!r2) return null;
296
296
  let { unflattenedModifiedFields: i2, modifiedFieldsManipulator: a2 } = r2;
297
297
  e2 = { ...e2, modifiedFields: i2 };
298
298
  let o2 = t2(e2), s2 = o2?.modifiedFields;
299
299
  if (!s2) return null;
300
- let c2 = Me(s2, a2);
300
+ let c2 = Ne(s2, a2);
301
301
  return c2 === null ? null : (o2.modifiedFields = c2, o2);
302
302
  }
303
- function je(e2) {
303
+ function Me(e2) {
304
304
  if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
305
- let t2 = new ke(e2);
305
+ let t2 = new Ae(e2);
306
306
  return { unflattenedModifiedFields: t2.unflatten(), modifiedFieldsManipulator: t2 };
307
307
  } catch {
308
308
  return null;
309
309
  }
310
310
  return null;
311
311
  }
312
- function Me(e2, t2) {
312
+ function Ne(e2, t2) {
313
313
  if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
314
314
  return t2.flatten(e2);
315
315
  } catch {
@@ -317,10 +317,10 @@ function Me(e2, t2) {
317
317
  }
318
318
  return null;
319
319
  }
320
- function Ne(e2) {
320
+ function Pe(e2) {
321
321
  return e2.replace(/[-_\s]+(.)?/g, (e3, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e3) => e3.toLowerCase());
322
322
  }
323
- function Pe() {
323
+ function Fe() {
324
324
  return { emit(e2, ...t2) {
325
325
  for (let n2 = 0, r2 = this.events[e2] || [], i2 = r2.length; n2 < i2; n2++) r2[n2](...t2);
326
326
  }, events: {}, on(e2, t2) {
@@ -329,8 +329,8 @@ function Pe() {
329
329
  };
330
330
  } };
331
331
  }
332
- var Fe = (e2) => e2.__type === `event-definition`;
333
- function Ie(e2, t2, n2, r2) {
332
+ var Ie = (e2) => e2.__type === `event-definition`;
333
+ function Le(e2, t2, n2, r2) {
334
334
  let i2;
335
335
  if (e2.isDomainEvent) {
336
336
  let { deletedEvent: e3, actionEvent: t3, createdEvent: a3, updatedEvent: o3, ...s3 } = n2, c2 = { ...r2, ...s3 };
@@ -341,14 +341,14 @@ function Ie(e2, t2, n2, r2) {
341
341
  let e3 = s2.modifiedFields;
342
342
  if (typeof e3 == `object` && e3 && !Array.isArray(e3)) {
343
343
  o2 = structuredClone(i2);
344
- let e4 = Ae(s2, a2);
344
+ let e4 = je(s2, a2);
345
345
  if (e4) return t2(e4);
346
346
  }
347
347
  }
348
348
  return t2(a2(o2));
349
349
  }
350
- function Le(e2) {
351
- let t2 = /* @__PURE__ */ new Map(), n2 = Pe();
350
+ function Re(e2) {
351
+ let t2 = /* @__PURE__ */ new Map(), n2 = Fe();
352
352
  return { initModule(e3) {
353
353
  return (r2) => {
354
354
  let i2 = t2.get(e3.type) ?? [];
@@ -358,7 +358,7 @@ function Le(e2) {
358
358
  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 }))];
359
359
  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(`, `)}`);
360
360
  let l2 = t2.get(r2) ?? [];
361
- return await Promise.all(l2.map(({ eventDefinition: e4, handler: t3 }) => Ie(e4, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
361
+ return await Promise.all(l2.map(({ eventDefinition: e4, handler: t3 }) => Le(e4, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
362
362
  }, async processRequest(e3, t3) {
363
363
  let n3 = await e3.text();
364
364
  return this.process(n3, t3);
@@ -377,12 +377,12 @@ function Le(e2) {
377
377
  let n3 = Array.from(t2.keys()).map((e4) => ({ type: e4 }));
378
378
  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(`, `)}`);
379
379
  let r2 = t2.get(e3.eventType) ?? [];
380
- await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => Ie(t3, n4, e3.payload, { instanceId: e3.instanceId, identity: e3.identity })));
380
+ await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => Le(t3, n4, e3.payload, { instanceId: e3.instanceId, identity: e3.identity })));
381
381
  }, apps: { AppInstalled: m(`AppInstalled`)(), AppRemoved: m(`AppRemoved`)() } } };
382
382
  }
383
- var Re = (e2) => e2.__type === `service-plugin-definition`;
384
- function ze(e2) {
385
- let t2 = /* @__PURE__ */ new Map(), n2 = Pe();
383
+ var ze = (e2) => e2.__type === `service-plugin-definition`;
384
+ function Be(e2) {
385
+ let t2 = /* @__PURE__ */ new Map(), n2 = Fe();
386
386
  return { initModule(e3) {
387
387
  return (r2) => {
388
388
  let i2 = t2.get(e3.componentType.toLowerCase()) ?? [];
@@ -423,43 +423,43 @@ function ze(e2) {
423
423
  return s2.transformations.toREST(await c2(s2.transformations.fromREST(e3)));
424
424
  } } };
425
425
  }
426
- var O = `X-Wix-Consistent`;
427
- function Be(e2) {
426
+ var D = `X-Wix-Consistent`;
427
+ function Ve(e2) {
428
428
  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) => {
429
- let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [O]: t2[O] } : {} }, l3 = e2.host?.getErrorHandler?.();
429
+ let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [D]: t2[D] } : {} }, l3 = e2.host?.getErrorHandler?.();
430
430
  try {
431
431
  if (typeof n3 == `string` || n3 instanceof URL) {
432
432
  let e3 = await i3(n3, { ...r3, headers: c3 });
433
433
  l3?.handleError(e3, { requestOptions: { url: n3.toString(), method: r3?.method } });
434
- let a3 = k(e3);
435
- return a3 && (t2[O] = a3), e3;
434
+ let a3 = O(e3);
435
+ return a3 && (t2[D] = a3), e3;
436
436
  }
437
437
  {
438
438
  for (let [e4, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e4, t3);
439
439
  let e3 = await i3(n3, r3);
440
440
  l3?.handleError(e3, { requestOptions: { url: n3.url, method: r3?.method } });
441
- let a3 = k(e3);
442
- return a3 && (t2[O] = a3), e3;
441
+ let a3 = O(e3);
442
+ return a3 && (t2[D] = a3), e3;
443
443
  }
444
444
  } catch (e3) {
445
445
  throw l3?.handleError(e3, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e3;
446
446
  }
447
- }, { client: c2, initModule: l2 } = ze(i2), { client: u2, initModule: d2 } = Le(i2), f2 = async (n3, r3) => {
448
- let i3 = o2(), s3 = await a2(), c3 = S(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [O]: t2[O] } : {} } }), u3 = k(l3);
449
- return u3 && (t2[O] = u3), l3;
447
+ }, { client: c2, initModule: l2 } = Be(i2), { client: u2, initModule: d2 } = Re(i2), f2 = async (n3, r3) => {
448
+ let i3 = o2(), s3 = await a2(), c3 = ee(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [D]: t2[D] } : {} } }), u3 = O(l3);
449
+ return u3 && (t2[D] = u3), l3;
450
450
  }, m2 = (t3, n3) => {
451
- if (Fe(t3)) return d2(t3);
452
- if (Re(t3)) return l2(t3);
453
- if (te(t3) && e2.host) return ne(t3, e2.host);
451
+ if (Ie(t3)) return d2(t3);
452
+ if (ze(t3)) return l2(t3);
453
+ if (ne(t3) && e2.host) return re(t3, e2.host);
454
454
  if (typeof t3 == `function`) {
455
455
  if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
456
456
  let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e2.useCDN === void 0 ? i2().shouldUseCDN : e2.useCDN;
457
- return be(C(() => _(t3)) ? g(t3) : t3, n3 ?? {}, f2, e2.host?.getErrorHandler?.(), (e3, t4) => {
457
+ return xe(S(() => _(t3)) ? g(t3) : t3, n3 ?? {}, f2, e2.host?.getErrorHandler?.(), (e3, t4) => {
458
458
  let n4 = new URL(e3, `https://${r3}`);
459
459
  return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
460
460
  }, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e2.host?.name, o3, e2.validateRequestSchema);
461
461
  }
462
- return ee(t3) ? Object.fromEntries(Object.entries(t3).map(([e3, n4]) => [e3, m2(n4, t3[v])])) : t3;
462
+ return te(t3) ? Object.fromEntries(Object.entries(t3).map(([e3, n4]) => [e3, m2(n4, t3[v])])) : t3;
463
463
  }, h2 = (e3) => {
464
464
  for (let n3 in e3) t2[n3] = e3[n3];
465
465
  };
@@ -478,19 +478,19 @@ function Be(e2) {
478
478
  return { data: o3 ?? {}, errors: s3 };
479
479
  }, webhooks: u2, servicePlugins: c2 };
480
480
  }
481
- function k(e2) {
481
+ function O(e2) {
482
482
  return e2.headers?.get(`X-Wix-Consistent`) ?? e2.headers?.get(`x-wix-consistent`);
483
483
  }
484
- var Ve = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
485
- var He = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
486
- function Ue(e2, t2) {
484
+ var He = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
485
+ var Ue = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
486
+ function We(e2, t2) {
487
487
  return e2?.split(`.`).map((e3) => t2?.[e3] ?? e3).join(`.`);
488
488
  }
489
- var A = `sort.fieldName`;
490
- function We(e2, t2, n2) {
491
- return (e2 === A || e2.endsWith(`.${A}`)) && typeof t2 == `string` ? Ue(t2, n2) : t2;
489
+ var k = `sort.fieldName`;
490
+ function Ge(e2, t2, n2) {
491
+ return (e2 === k || e2.endsWith(`.${k}`)) && typeof t2 == `string` ? We(t2, n2) : t2;
492
492
  }
493
- function j(e2, t2, n2) {
493
+ function A(e2, t2, n2) {
494
494
  let r2 = (e3) => n2.includes(e3), i2 = (e3, n3) => {
495
495
  if (Array.isArray(e3)) e3.forEach((e4) => {
496
496
  i2(e4, n3);
@@ -500,144 +500,144 @@ function j(e2, t2, n2) {
500
500
  Object.keys(a2).forEach((e4) => {
501
501
  let o2 = n3 === `` ? e4 : `${n3}.${e4}`;
502
502
  if (r2(o2)) return;
503
- let s2 = Ge(e4, t2);
504
- s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] = We(o2, a2[s2], t2), i2(a2[s2], o2);
503
+ let s2 = Ke(e4, t2);
504
+ s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] = Ge(o2, a2[s2], t2), i2(a2[s2], o2);
505
505
  });
506
506
  }
507
507
  };
508
508
  return i2(e2, ``), e2;
509
509
  }
510
- function Ge(e2, t2) {
510
+ function Ke(e2, t2) {
511
511
  let n2;
512
512
  return n2 = e2.includes(`.`) ? e2.split(`.`).map((e3) => t2[e3] ?? e3).join(`.`) : t2[e2] ?? e2, n2;
513
513
  }
514
- function Ke(e2, t2 = []) {
515
- return j(e2, Ve, t2);
516
- }
517
514
  function qe(e2, t2 = []) {
518
- return j(e2, He, t2);
515
+ return A(e2, He, t2);
516
+ }
517
+ function Je(e2, t2 = []) {
518
+ return A(e2, Ue, t2);
519
519
  }
520
- var M = /* @__PURE__ */ new WeakMap();
521
- function N() {
520
+ var j = /* @__PURE__ */ new WeakMap();
521
+ function M() {
522
522
  return { leaves: void 0, fields: void 0, mapFields: void 0, anyField: void 0 };
523
523
  }
524
- function Je(e2, t2) {
524
+ function Ye(e2, t2) {
525
525
  let n2 = e2.get(t2);
526
- return n2 || (n2 = N(), e2.set(t2, n2)), n2;
526
+ return n2 || (n2 = M(), e2.set(t2, n2)), n2;
527
527
  }
528
- function Ye(e2, t2) {
529
- return t2 === `*` ? (e2.anyField ??= N(), e2.anyField) : t2.endsWith(`{}`) ? (e2.mapFields ??= /* @__PURE__ */ new Map(), Je(e2.mapFields, t2.slice(0, -2))) : (e2.fields ??= /* @__PURE__ */ new Map(), Je(e2.fields, t2));
528
+ function Xe(e2, t2) {
529
+ return t2 === `*` ? (e2.anyField ??= M(), e2.anyField) : t2.endsWith(`{}`) ? (e2.mapFields ??= /* @__PURE__ */ new Map(), Ye(e2.mapFields, t2.slice(0, -2))) : (e2.fields ??= /* @__PURE__ */ new Map(), Ye(e2.fields, t2));
530
530
  }
531
- function Xe(e2) {
532
- let t2 = N();
531
+ function Ze(e2) {
532
+ let t2 = M();
533
533
  for (let n2 of e2) {
534
- let e3 = n2.path.split(`.`).reduce(Ye, t2);
534
+ let e3 = n2.path.split(`.`).reduce(Xe, t2);
535
535
  e3.leaves ??= [], e3.leaves.push(n2);
536
536
  }
537
537
  return t2;
538
538
  }
539
- function Ze(e2) {
540
- let t2 = M.get(e2);
541
- return t2 || (t2 = Xe(e2), M.set(e2, t2)), t2;
539
+ function Qe(e2) {
540
+ let t2 = j.get(e2);
541
+ return t2 || (t2 = Ze(e2), j.set(e2, t2)), t2;
542
542
  }
543
- function P(e2) {
543
+ function N(e2) {
544
544
  return typeof e2 == `object` && !!e2;
545
545
  }
546
- function Qe(e2, { isRepeated: t2, isMap: n2 }, r2) {
547
- return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ? P(e2) ? Object.fromEntries(Object.entries(e2).map(([e3, t3]) => [e3, r2(t3)])) : e2 : r2(e2);
546
+ function $e(e2, { isRepeated: t2, isMap: n2 }, r2) {
547
+ return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ? N(e2) ? Object.fromEntries(Object.entries(e2).map(([e3, t3]) => [e3, r2(t3)])) : e2 : r2(e2);
548
548
  }
549
- function F(e2, t2, n2) {
550
- P(e2) && tt(e2, t2, n2);
549
+ function P(e2, t2, n2) {
550
+ N(e2) && nt(e2, t2, n2);
551
551
  }
552
- function $e(e2, t2, n2) {
552
+ function et(e2, t2, n2) {
553
553
  for (let [r2, i2] of t2) {
554
554
  if (!(r2 in e2)) continue;
555
- if (i2.leaves) for (let t4 of i2.leaves) e2[r2] = Qe(e2[r2], t4, n2);
555
+ if (i2.leaves) for (let t4 of i2.leaves) e2[r2] = $e(e2[r2], t4, n2);
556
556
  let t3 = e2[r2];
557
- Array.isArray(t3) ? t3.forEach((e3) => F(e3, i2, n2)) : F(t3, i2, n2);
557
+ Array.isArray(t3) ? t3.forEach((e3) => P(e3, i2, n2)) : P(t3, i2, n2);
558
558
  }
559
559
  }
560
- function et(e2, t2, n2) {
560
+ function tt(e2, t2, n2) {
561
561
  for (let [r2, i2] of t2) {
562
562
  let t3 = e2[r2];
563
- P(t3) && Object.values(t3).forEach((e3) => F(e3, i2, n2));
563
+ N(t3) && Object.values(t3).forEach((e3) => P(e3, i2, n2));
564
564
  }
565
565
  }
566
- function tt(e2, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
567
- t2 && $e(e2, t2, i2), n2 && et(e2, n2, i2), r2 && Object.values(e2).forEach((e3) => F(e3, r2, i2));
566
+ function nt(e2, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
567
+ t2 && et(e2, t2, i2), n2 && tt(e2, n2, i2), r2 && Object.values(e2).forEach((e3) => P(e3, r2, i2));
568
568
  }
569
- function nt(e2, t2) {
570
- if (!P(e2)) return e2;
571
- for (let { paths: n2, transformFn: r2 } of t2) tt(e2, Ze(n2), r2);
569
+ function rt(e2, t2) {
570
+ if (!N(e2)) return e2;
571
+ for (let { paths: n2, transformFn: r2 } of t2) nt(e2, Qe(n2), r2);
572
572
  return e2;
573
573
  }
574
- function rt(e2) {
574
+ function it(e2) {
575
575
  return Object.fromEntries(Object.entries(e2).filter(([, e3]) => e3 !== void 0));
576
576
  }
577
- function I(e2) {
578
- return ct(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
577
+ function F(e2) {
578
+ return lt(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
579
579
  }
580
- var it = /([\p{Ll}\d])(\p{Lu})/gu;
581
- var at = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
582
- var ot = `$1\0$2`;
583
- var st = /[^\p{L}\d]+/giu;
584
- function ct(e2) {
580
+ var at = /([\p{Ll}\d])(\p{Lu})/gu;
581
+ var ot = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
582
+ var st = `$1\0$2`;
583
+ var ct = /[^\p{L}\d]+/giu;
584
+ function lt(e2) {
585
585
  let t2 = e2.trim();
586
- t2 = t2.replace(it, ot).replace(at, ot), t2 = t2.replace(st, `\0`);
586
+ t2 = t2.replace(at, st).replace(ot, st), t2 = t2.replace(ct, `\0`);
587
587
  let n2 = 0, r2 = t2.length;
588
588
  for (; t2.charAt(n2) === `\0`; ) n2++;
589
589
  if (n2 === r2) return [];
590
590
  for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
591
591
  return t2.slice(n2, r2).split(/\0/g);
592
592
  }
593
- var lt = (e2) => `validationError` in (e2.response?.data?.details ?? {});
594
- var ut = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
595
- var dt = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
596
- function ft(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
593
+ var ut = (e2) => `validationError` in (e2.response?.data?.details ?? {});
594
+ var dt = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
595
+ var ft = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
596
+ function pt(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
597
597
  if (typeof e2 != `object` || !e2) throw e2;
598
- if (lt(e2)) return pt(e2, t2, n2);
599
- if (ut(e2)) return mt(e2);
600
- if (dt(e2)) {
601
- let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: I(n3), data: {} }, requestId: e2.requestId };
602
- return L(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
598
+ if (ut(e2)) return mt(e2, t2, n2);
599
+ if (dt(e2)) return ht(e2);
600
+ if (ft(e2)) {
601
+ let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: F(n3), data: {} }, requestId: e2.requestId };
602
+ return I(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
603
603
  }
604
- return ht(e2);
604
+ return gt(e2);
605
605
  }
606
- var pt = (e2, t2, n2) => {
607
- 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 };
608
- return L(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
606
+ var mt = (e2, t2, n2) => {
607
+ let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = _t(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 };
608
+ return I(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
609
609
  };
610
- var L = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
611
- var mt = (e2) => {
612
- 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 ?? I(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 };
613
- return L(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
610
+ var I = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
611
+ var ht = (e2) => {
612
+ 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 ?? F(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 };
613
+ return I(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
614
614
  };
615
- var ht = (e2) => L(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: I(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
616
- var gt = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
615
+ var gt = (e2) => I(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: F(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
616
+ var _t = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
617
617
  let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
618
618
  return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
619
619
  let r3 = t2[e3.field];
620
- if (r3) return { ...e3, field: R(r3, i2) };
620
+ if (r3) return { ...e3, field: L(r3, i2) };
621
621
  let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
622
622
  if (s2) {
623
623
  let t3 = a2[s2];
624
- if (t3) return { ...e3, field: e3.field.replace(s2, R(t3, i2)) };
624
+ if (t3) return { ...e3, field: e3.field.replace(s2, L(t3, i2)) };
625
625
  }
626
626
  return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
627
627
  });
628
628
  };
629
- var R = (e2, t2) => {
630
- let n2 = _t(e2);
629
+ var L = (e2, t2) => {
630
+ let n2 = vt(e2);
631
631
  return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
632
632
  };
633
- var _t = (e2) => {
633
+ var vt = (e2) => {
634
634
  let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
635
635
  return t2 && t2.groups && Number(t2.groups.argIndex);
636
636
  };
637
- function vt() {
637
+ function yt() {
638
638
  let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
639
639
  if (e2) return { initWixModules(t3, n3) {
640
- return z(() => e2(t3, n3));
640
+ return R(() => e2(t3, n3));
641
641
  }, fetchWithAuth() {
642
642
  throw Error(`fetchWithAuth is not available in this context`);
643
643
  }, graphql() {
@@ -647,10 +647,10 @@ function vt() {
647
647
  if (t2 || n2) return { initWixModules(e3, r2) {
648
648
  if (r2) {
649
649
  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`);
650
- return z(() => n2.use(e3));
650
+ return R(() => n2.use(e3));
651
651
  }
652
652
  if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
653
- return z(() => t2.use(e3));
653
+ return R(() => t2.use(e3));
654
654
  }, fetchWithAuth: (e3, n3) => {
655
655
  if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
656
656
  return t2.fetchWithAuth(e3, n3);
@@ -662,7 +662,7 @@ function vt() {
662
662
  return t2.graphql(e3, n3, r2);
663
663
  } };
664
664
  }
665
- function z(e2) {
665
+ function R(e2) {
666
666
  let t2 = globalThis.__wix_context__, n2 = { client: p.client, elevatedClient: p.elevatedClient }, r2;
667
667
  globalThis.__wix_context__ = void 0, p.client = void 0, p.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
668
668
  try {
@@ -671,78 +671,78 @@ function z(e2) {
671
671
  globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
672
672
  }
673
673
  }
674
- function yt(e2, t2) {
674
+ function bt(e2, t2) {
675
675
  return (...n2) => {
676
- let r2 = vt();
676
+ let r2 = yt();
677
677
  return r2 ? r2.initWixModules(e2, t2).apply(void 0, n2) : e2.apply(void 0, n2);
678
678
  };
679
679
  }
680
- function bt(e2, t2 = false) {
681
- return yt(e2, t2);
682
- }
683
- function xt(e2) {
684
- let t2 = Pt(Mt(e2.host), e2.domainToMappings);
685
- return Ut(Bt(e2.protoPath, e2.data || {}), t2);
686
- }
687
- var St = [`wix.com`, `editorx.com`];
688
- var Ct = `_`;
689
- var wt = `*.`;
690
- var Tt = RegExp(`\\.(${St.join(`|`)})$`);
691
- var Et = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
692
- var Dt = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
693
- var Ot = `dev.wix-code.com`;
694
- var kt = /{(.*)}/;
695
- var At = RegExp(`\\.(${Et.join(`|`)})$`);
696
- var jt = RegExp(`.*\\.${Ot}$`);
697
- function Mt(e2) {
698
- return Nt(e2).replace(Tt, `._base_domain_`).replace(At, `._api_base_domain_`).replace(jt, `*.dev.wix-code.com`);
699
- }
680
+ function xt(e2, t2 = false) {
681
+ return bt(e2, t2);
682
+ }
683
+ function St(e2) {
684
+ let t2 = Ft(Nt(e2.host), e2.domainToMappings);
685
+ return Wt(Vt(e2.protoPath, e2.data || {}), t2);
686
+ }
687
+ var Ct = [`wix.com`, `editorx.com`];
688
+ var wt = `_`;
689
+ var Tt = `*.`;
690
+ var Et = RegExp(`\\.(${Ct.join(`|`)})$`);
691
+ var Dt = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
692
+ var Ot = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
693
+ var kt = `dev.wix-code.com`;
694
+ var At = /{(.*)}/;
695
+ var jt = RegExp(`\\.(${Dt.join(`|`)})$`);
696
+ var Mt = RegExp(`.*\\.${kt}$`);
700
697
  function Nt(e2) {
701
- return Dt[e2] ?? e2;
698
+ return Pt(e2).replace(Et, `._base_domain_`).replace(jt, `._api_base_domain_`).replace(Mt, `*.dev.wix-code.com`);
699
+ }
700
+ function Pt(e2) {
701
+ return Ot[e2] ?? e2;
702
702
  }
703
- function Pt(e2, t2) {
703
+ function Ft(e2, t2) {
704
704
  let n2 = t2[e2];
705
705
  if (n2) return n2;
706
- let r2 = Ft(e2, t2) ?? It(e2, t2);
706
+ let r2 = It(e2, t2) ?? Lt(e2, t2);
707
707
  if (!r2) {
708
- if (Rt(e2)) {
709
- let e3 = t2[zt];
708
+ if (zt(e2)) {
709
+ let e3 = t2[Bt];
710
710
  if (e3) return e3;
711
711
  }
712
- let n3 = t2[Ct];
712
+ let n3 = t2[wt];
713
713
  if (n3) return n3;
714
714
  }
715
715
  return r2 ?? [];
716
716
  }
717
- function Ft(e2, t2) {
717
+ function It(e2, t2) {
718
718
  return Object.entries(t2).find(([t3]) => {
719
719
  let [, ...n2] = e2.split(`.`);
720
720
  return n2.join(`.`) === t3;
721
721
  })?.[1];
722
722
  }
723
- function It(e2, t2) {
724
- let [n2] = Object.entries(t2).filter(([t3]) => Lt(e2, t3)).sort(([e3], [t3]) => t3.length - e3.length);
723
+ function Lt(e2, t2) {
724
+ let [n2] = Object.entries(t2).filter(([t3]) => Rt(e2, t3)).sort(([e3], [t3]) => t3.length - e3.length);
725
725
  if (!n2) return;
726
726
  let [, r2] = n2;
727
727
  return r2;
728
728
  }
729
- function Lt(e2, t2) {
730
- if (!t2.startsWith(wt)) return false;
729
+ function Rt(e2, t2) {
730
+ if (!t2.startsWith(Tt)) return false;
731
731
  let n2 = t2.slice(1);
732
732
  return e2.length > n2.length && e2.endsWith(n2);
733
733
  }
734
- function Rt(e2) {
734
+ function zt(e2) {
735
735
  return !!e2.match(/\._base_domain_$/);
736
736
  }
737
- var zt = `www._base_domain_`;
738
- function Bt(e2, t2) {
739
- return e2.split(`/`).map((e3) => Vt(e3, t2)).join(`/`);
740
- }
737
+ var Bt = `www._base_domain_`;
741
738
  function Vt(e2, t2) {
742
- let n2 = e2.match(kt) || [], r2 = n2[1];
743
- return r2 ? Ht(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
739
+ return e2.split(`/`).map((e3) => Ht(e3, t2)).join(`/`);
744
740
  }
745
- function Ht(e2, t2, n2, r2) {
741
+ function Ht(e2, t2) {
742
+ let n2 = e2.match(At) || [], r2 = n2[1];
743
+ return r2 ? Ut(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
744
+ }
745
+ function Ut(e2, t2, n2, r2) {
746
746
  let i2 = e2;
747
747
  for (let e3 of t2.split(`.`)) {
748
748
  if (!i2) return n2;
@@ -750,39 +750,39 @@ function Ht(e2, t2, n2, r2) {
750
750
  }
751
751
  return `${i2}${r2}`;
752
752
  }
753
- function Ut(e2, t2) {
753
+ function Wt(e2, t2) {
754
754
  let n2 = t2?.find((t3) => e2.startsWith(t3.destPath));
755
755
  return n2 ? n2.srcPath + e2.slice(n2.destPath.length) : e2;
756
756
  }
757
- function Wt(e2) {
757
+ function Gt(e2) {
758
758
  return e2 === `NaN` ? NaN : e2 === `Infinity` ? 1 / 0 : e2 === `-Infinity` ? -1 / 0 : e2;
759
759
  }
760
- function Gt(e2) {
761
- return e2 && rt({ formatted: e2.formattedAddress, location: e2.geocode, addressLine1: e2.addressLine, addressLine2: e2.addressLine2, streetAddress: e2.streetAddress && { name: e2.streetAddress.name, number: e2.streetAddress.number, apt: e2.streetAddress.apt, formattedAddressLine: e2.streetAddress.formattedAddressLine }, hint: e2.hint, city: e2.city, subdivision: e2.subdivision, country: e2.country, postalCode: e2.postalCode, countryFullname: e2.countryFullname, subdivisionFullname: e2.subdivisionFullname });
762
- }
763
- var Kt = `x-wix-linguist`;
764
- var qt = `00000000-0000-0000-0000-000000000000`;
765
- var Jt = `false`;
766
- var Yt = () => {
767
- let e2 = B(`language`), t2 = B(`locale`);
768
- if (e2) return { [Kt]: [e2, t2 || e2, Jt, qt].join(`|`) };
760
+ function Kt(e2) {
761
+ return e2 && it({ formatted: e2.formattedAddress, location: e2.geocode, addressLine1: e2.addressLine, addressLine2: e2.addressLine2, streetAddress: e2.streetAddress && { name: e2.streetAddress.name, number: e2.streetAddress.number, apt: e2.streetAddress.apt, formattedAddressLine: e2.streetAddress.formattedAddressLine }, hint: e2.hint, city: e2.city, subdivision: e2.subdivision, country: e2.country, postalCode: e2.postalCode, countryFullname: e2.countryFullname, subdivisionFullname: e2.subdivisionFullname });
762
+ }
763
+ var qt = `x-wix-linguist`;
764
+ var Jt = `00000000-0000-0000-0000-000000000000`;
765
+ var Yt = `false`;
766
+ var Xt = () => {
767
+ let e2 = z(`language`), t2 = z(`locale`);
768
+ if (e2) return { [qt]: [e2, t2 || e2, Yt, Jt].join(`|`) };
769
769
  };
770
- function Xt() {
770
+ function Zt() {
771
771
  let e2 = null, t2 = null;
772
772
  return { promise: new Promise((n2, r2) => {
773
773
  e2 = n2, t2 = r2;
774
774
  }), resolve: e2, reject: t2 };
775
775
  }
776
- var B = (e2) => typeof window < `u` ? window.commonConfig?.[e2] : void 0;
777
- var Zt = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
778
- let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = $t();
779
- return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: B(`language`), locale: B(`locale`), get passThroughHeaders() {
780
- return Yt();
776
+ var z = (e2) => typeof window < `u` ? window.commonConfig?.[e2] : void 0;
777
+ var Qt = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
778
+ let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = en();
779
+ return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: z(`language`), locale: z(`locale`), get passThroughHeaders() {
780
+ return Xt();
781
781
  } } };
782
782
  }, auth: (e3) => {
783
783
  let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
784
- !e3 && Qt() && (e3 = t2?.getAccessTokenFunction?.());
785
- let n2 = false, { resolve: r2, promise: i2 } = Xt();
784
+ !e3 && $t() && (e3 = t2?.getAccessTokenFunction?.());
785
+ let n2 = false, { resolve: r2, promise: i2 } = Zt();
786
786
  return { getAuthHeaders: async () => {
787
787
  if (!e3 && n2 && (e3 = await i2), !e3) throw Error(`Failed to resolve auth token`);
788
788
  return { headers: { Authorization: await e3() } };
@@ -790,36 +790,36 @@ var Zt = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host:
790
790
  r2(e4);
791
791
  }) };
792
792
  } });
793
- function Qt() {
793
+ function $t() {
794
794
  return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
795
795
  }
796
- function $t() {
796
+ function en() {
797
797
  let e2 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
798
798
  if (!e2) return;
799
799
  let t2 = new URL(e2);
800
800
  return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
801
801
  }
802
- var en = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
802
+ var tn = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
803
803
  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`);
804
804
  return e2.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
805
805
  }, getAccessToken: () => {
806
806
  throw Error(`Not implemented`);
807
807
  }, observeState: () => ({ disconnect: () => {
808
808
  } }) });
809
- var V = Zt({ createHost: function(e2) {
809
+ var B = Qt({ createHost: function(e2) {
810
810
  let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e2?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e2 || {};
811
811
  if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
812
- return { channel: en({ clientSdk: t2, applicationId: n2 }), close: () => {
812
+ return { channel: tn({ clientSdk: t2, applicationId: n2 }), close: () => {
813
813
  } };
814
814
  } });
815
- var tn = ((e2, t2) => {
816
- let n2 = V.host({ applicationId: e2, componentId: t2 }), r2 = V.auth();
817
- return Be({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
815
+ var nn = ((e2, t2) => {
816
+ let n2 = B.host({ applicationId: e2, componentId: t2 }), r2 = B.auth();
817
+ return Ve({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
818
818
  })(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`);
819
- function nn() {
819
+ function rn() {
820
820
  let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
821
821
  if (e2) return { initWixModules(t3, n3) {
822
- return H(() => e2(t3, n3));
822
+ return V(() => e2(t3, n3));
823
823
  }, fetchWithAuth() {
824
824
  throw Error(`fetchWithAuth is not available in this context`);
825
825
  }, graphql() {
@@ -829,10 +829,10 @@ function nn() {
829
829
  if (t2 || n2) return { initWixModules(e3, r2) {
830
830
  if (r2) {
831
831
  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`);
832
- return H(() => n2.use(e3));
832
+ return V(() => n2.use(e3));
833
833
  }
834
834
  if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
835
- return H(() => t2.use(e3));
835
+ return V(() => t2.use(e3));
836
836
  }, fetchWithAuth: (e3, n3) => {
837
837
  if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
838
838
  return t2.fetchWithAuth(e3, n3);
@@ -844,7 +844,7 @@ function nn() {
844
844
  return t2.graphql(e3, n3, r2);
845
845
  } };
846
846
  }
847
- function H(e2) {
847
+ function V(e2) {
848
848
  let t2 = globalThis.__wix_context__, n2 = { client: p.client, elevatedClient: p.elevatedClient }, r2;
849
849
  globalThis.__wix_context__ = void 0, p.client = void 0, p.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
850
850
  try {
@@ -853,17 +853,17 @@ function H(e2) {
853
853
  globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
854
854
  }
855
855
  }
856
- function rn(e2, t2) {
856
+ function an(e2, t2) {
857
857
  return { ...e2, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
858
- let r2 = nn();
858
+ let r2 = rn();
859
859
  if (!r2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
860
860
  return r2.initWixModules(e2)[t3].apply(void 0, n2);
861
861
  }])) };
862
862
  }
863
- function an(e2) {
864
- return rn({ __type: `host`, create: (t2) => Object.entries(e2).reduce((e3, [n2, r2]) => ({ ...e3, [n2]: r2(t2) }), {}) }, Object.keys(e2));
863
+ function on(e2) {
864
+ return an({ __type: `host`, create: (t2) => Object.entries(e2).reduce((e3, [n2, r2]) => ({ ...e3, [n2]: r2(t2) }), {}) }, Object.keys(e2));
865
865
  }
866
- var on = class {
866
+ var sn = class {
867
867
  constructor(e2) {
868
868
  this.message = e2, this.captureException = () => {
869
869
  console.error(this.message);
@@ -878,42 +878,42 @@ var on = class {
878
878
  };
879
879
  }
880
880
  };
881
- var sn = (e2) => new on(e2);
882
- var cn = an({ getMonitoringClient: (e2) => () => e2.getMonitoringClient ? e2.getMonitoringClient() : sn(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
883
- var U = { 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` };
884
- function W(e2) {
881
+ var cn = (e2) => new sn(e2);
882
+ var ln = on({ getMonitoringClient: (e2) => () => e2.getMonitoringClient ? e2.getMonitoringClient() : cn(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
883
+ var H = { 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` };
884
+ function U(e2) {
885
885
  try {
886
- let t2 = cn.getMonitoringClient?.();
886
+ let t2 = ln.getMonitoringClient?.();
887
887
  return t2 && typeof t2[e2] == `function` ? t2 : null;
888
888
  } catch {
889
889
  return null;
890
890
  }
891
891
  }
892
- function G(e2, { feature: t2, action: n2, level: r2 = `error`, contexts: i2 }) {
893
- let a2 = W(`captureException`);
892
+ function W(e2, { feature: t2, action: n2, level: r2 = `error`, contexts: i2 }) {
893
+ let a2 = U(`captureException`);
894
894
  if (!a2) return;
895
895
  let o2 = e2 instanceof Error ? e2 : Error(String(e2));
896
896
  a2.captureException(o2, { level: r2, tags: { feature: t2, action: n2 }, ...i2 ? { contexts: i2 } : {} });
897
897
  }
898
- function ln(e2, { feature: t2, tags: n2 }, r2) {
899
- let i2 = W(`startSpanManual`);
898
+ function un(e2, { feature: t2, tags: n2 }, r2) {
899
+ let i2 = U(`startSpanManual`);
900
900
  if (!i2) return r2;
901
901
  let a2 = i2.startSpanManual({ name: e2, tags: { feature: t2, ...n2 } });
902
902
  return r2.then(() => a2.end(), (e3) => a2.fail(e3)), r2;
903
903
  }
904
- var un = class extends e {
904
+ var dn = class extends e {
905
905
  state = { hasError: false };
906
906
  static getDerivedStateFromError() {
907
907
  return { hasError: true };
908
908
  }
909
909
  componentDidCatch(e2, t2) {
910
- G(e2, { feature: this.props.feature ?? `service`, action: `render`, contexts: { react: { componentStack: t2.componentStack } } });
910
+ W(e2, { feature: this.props.feature ?? `service`, action: `render`, contexts: { react: { componentStack: t2.componentStack } } });
911
911
  }
912
912
  render() {
913
913
  return this.state.hasError ? this.props.fallback : this.props.children;
914
914
  }
915
915
  };
916
- function dn(e2) {
916
+ function fn(e2) {
917
917
  let t2 = e2;
918
918
  if (t2.__state || (t2.__state = { status: `pending` }, t2.then((e3) => {
919
919
  t2.__state = { status: `fulfilled`, value: e3 };
@@ -922,27 +922,27 @@ function dn(e2) {
922
922
  })), t2.__state.status === `fulfilled`) return t2.__state.value;
923
923
  throw t2.__state.status === `rejected` ? t2.__state.reason : t2;
924
924
  }
925
- function K(e2) {
925
+ function G(e2) {
926
926
  let t2 = Promise.resolve(e2);
927
927
  return t2.__state = { status: `fulfilled`, value: e2 }, t2;
928
928
  }
929
- var fn = /* @__PURE__ */ new WeakMap();
930
- function pn(e2, t2, n2) {
931
- let r2 = fn.get(e2);
932
- r2 || (r2 = /* @__PURE__ */ new WeakMap(), fn.set(e2, r2));
929
+ var pn = /* @__PURE__ */ new WeakMap();
930
+ function mn(e2, t2, n2) {
931
+ let r2 = pn.get(e2);
932
+ r2 || (r2 = /* @__PURE__ */ new WeakMap(), pn.set(e2, r2));
933
933
  let i2 = r2.get(t2);
934
934
  i2 || (i2 = /* @__PURE__ */ new WeakMap(), r2.set(t2, i2));
935
935
  let a2 = i2.get(n2);
936
936
  if (!a2) {
937
937
  let r3 = e2;
938
- a2 = r3.__state?.status === `fulfilled` ? K(t2(r3.__state.value)) : r3.__state?.status === `rejected` ? K(n2(r3.__state.reason)) : e2.then(t2, n2), i2.set(n2, a2);
938
+ a2 = r3.__state?.status === `fulfilled` ? G(t2(r3.__state.value)) : r3.__state?.status === `rejected` ? G(n2(r3.__state.reason)) : e2.then(t2, n2), i2.set(n2, a2);
939
939
  }
940
940
  return a2;
941
941
  }
942
- function mn(e2) {
942
+ function K(e2) {
943
943
  return e2;
944
944
  }
945
- var hn = mn(`@wix/site-service-url`);
945
+ var hn = K(`@wix/site-service-url`);
946
946
  var gn = `appSectionParams`;
947
947
  function _n(e2) {
948
948
  let t2 = e2.searchParams.get(gn);
@@ -1005,32 +1005,29 @@ function J() {
1005
1005
  return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () => _n(new URL(e2.currentUrl)), getRelativeUrl: () => Cn(e2.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: bn };
1006
1006
  }
1007
1007
  var Y = { category: `category`, location: `location`, page: `page`, blob: `b`, resource: `resource`, referral: `referral`, timezone: `timezone`, bookingId: `bookingId`, token: `token`, rescheduleRedirectUrl: `rescheduleRedirectUrl` };
1008
- function wn(e2) {
1009
- return e2;
1010
- }
1011
- var Tn = wn(`@wix/site-service-warmup-data`);
1012
- function En() {
1008
+ var wn = K(`@wix/site-service-warmup-data`);
1009
+ function Tn() {
1013
1010
  try {
1014
1011
  return u();
1015
1012
  } catch {
1016
1013
  return null;
1017
1014
  }
1018
1015
  }
1019
- function Dn(e2) {
1016
+ function En(e2) {
1020
1017
  try {
1021
- return e2 ? e2(Tn) : null;
1018
+ return e2 ? e2(wn) : null;
1022
1019
  } catch {
1023
1020
  return null;
1024
1021
  }
1025
1022
  }
1026
- function On() {
1027
- let e2 = Dn(En()), t2 = typeof window > `u`;
1023
+ function Dn() {
1024
+ let e2 = En(Tn()), t2 = typeof window > `u`;
1028
1025
  return { scope: e2 ?? void 0, get: async (n2) => {
1029
1026
  if (t2 || !e2) return null;
1030
1027
  try {
1031
1028
  return await e2.get(n2);
1032
1029
  } catch (e3) {
1033
- return G(e3, { feature: U.warmup, action: `read`, level: `warning`, contexts: { warmup: { key: n2 } } }), null;
1030
+ return W(e3, { feature: H.warmup, action: `read`, level: `warning`, contexts: { warmup: { key: n2 } } }), null;
1034
1031
  }
1035
1032
  }, set: (n2, r2) => {
1036
1033
  if (t2 && e2) try {
@@ -1039,54 +1036,54 @@ function On() {
1039
1036
  }
1040
1037
  } };
1041
1038
  }
1042
- var kn = `bookings-uou`;
1043
- function An() {
1044
- return `${kn}:locations:all`;
1039
+ var On = `bookings-uou`;
1040
+ function kn() {
1041
+ return `${On}:locations:all`;
1045
1042
  }
1046
- var jn = 5e3;
1047
- var Mn = 100;
1048
- var Nn = `wix-warmup-data`;
1043
+ var An = 5e3;
1044
+ var jn = 100;
1045
+ var Mn = `wix-warmup-data`;
1049
1046
  var X = null;
1050
- function Pn(e2) {
1047
+ function Nn(e2) {
1051
1048
  if (typeof document < `u`) try {
1052
- let t2 = document.getElementById(Nn)?.textContent;
1049
+ let t2 = document.getElementById(Mn)?.textContent;
1053
1050
  return t2 ? (X?.text !== t2 && (X = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), X.data[e2] ?? void 0) : void 0;
1054
1051
  } catch {
1055
1052
  return;
1056
1053
  }
1057
1054
  }
1058
- var Fn = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
1059
- var In = Fn();
1055
+ var Pn = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
1056
+ var Fn = Pn();
1057
+ var In = /* @__PURE__ */ new WeakMap();
1060
1058
  var Ln = /* @__PURE__ */ new WeakMap();
1061
- var Rn = /* @__PURE__ */ new WeakMap();
1062
- function zn(e2) {
1063
- if (!e2) return In;
1064
- let t2 = Ln.get(e2);
1065
- return t2 || (t2 = Fn(), Ln.set(e2, t2)), t2;
1059
+ function Rn(e2) {
1060
+ if (!e2) return Fn;
1061
+ let t2 = In.get(e2);
1062
+ return t2 || (t2 = Pn(), In.set(e2, t2)), t2;
1066
1063
  }
1067
- function Bn({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
1064
+ function zn({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
1068
1065
  if (e2 === null) return n2();
1069
1066
  if (typeof window > `u`) {
1070
1067
  let r3 = () => n2().then((n3) => (t2.set(e2, n3), n3)), { scope: i3 } = t2;
1071
1068
  if (!i3) return r3();
1072
- let a3 = Rn.get(i3);
1073
- a3 || (a3 = /* @__PURE__ */ new Map(), Rn.set(i3, a3));
1069
+ let a3 = Ln.get(i3);
1070
+ a3 || (a3 = /* @__PURE__ */ new Map(), Ln.set(i3, a3));
1074
1071
  let o3 = a3.get(e2);
1075
1072
  if (o3) return o3;
1076
1073
  let s3 = r3();
1077
1074
  return a3.set(e2, s3), s3.catch(() => a3.delete(e2)), s3;
1078
1075
  }
1079
- let i2 = zn(t2.scope), a2 = Date.now();
1076
+ let i2 = Rn(t2.scope), a2 = Date.now();
1080
1077
  for (let [e3, t3] of i2.promises) t3.expiresAt <= a2 && i2.promises.delete(e3);
1081
1078
  let o2 = i2.promises.get(e2);
1082
1079
  if (o2 && !r2) return o2.promise;
1083
1080
  r2 && i2.invalidatedWarmup.add(e2);
1084
1081
  let s2 = !i2.invalidatedWarmup.has(e2);
1085
1082
  if (s2) {
1086
- let t3 = Pn(e2);
1083
+ let t3 = Nn(e2);
1087
1084
  if (t3 !== void 0) {
1088
- let n3 = K(t3);
1089
- return i2.promises.set(e2, { promise: n3, expiresAt: a2 + jn }), n3;
1085
+ let n3 = G(t3);
1086
+ return i2.promises.set(e2, { promise: n3, expiresAt: a2 + An }), n3;
1090
1087
  }
1091
1088
  }
1092
1089
  let c2 = (async () => {
@@ -1096,43 +1093,43 @@ function Bn({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
1096
1093
  }
1097
1094
  return n2();
1098
1095
  })();
1099
- i2.promises.size >= Mn && i2.promises.delete(i2.promises.keys().next().value);
1096
+ i2.promises.size >= jn && i2.promises.delete(i2.promises.keys().next().value);
1100
1097
  let l2 = { promise: c2, expiresAt: 1 / 0 };
1101
1098
  return i2.promises.set(e2, l2), c2.then(() => {
1102
- l2.expiresAt = Date.now() + jn;
1099
+ l2.expiresAt = Date.now() + An;
1103
1100
  }, () => {
1104
1101
  i2.promises.get(e2) === l2 && i2.promises.delete(e2);
1105
1102
  }), c2;
1106
1103
  }
1107
- var Vn = [{ path: `businessLocations.locations.business.address.geocode.latitude` }, { path: `businessLocations.locations.business.address.geocode.longitude` }, { path: `businessLocations.locations.custom.address.geocode.latitude` }, { path: `businessLocations.locations.custom.address.geocode.longitude` }, { path: `businessLocations.locations.calculatedAddress.geocode.latitude` }, { path: `businessLocations.locations.calculatedAddress.geocode.longitude` }];
1108
- function Hn(e2) {
1109
- return xt(Object.assign(e2, { domainToMappings: { "*.dev.wix-code.com": [{ srcPath: `/_api/services-2`, destPath: `` }, { srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "www.wixapis.com": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }, { srcPath: `/bookings/services/v2/bulk/services`, destPath: `/v2/bulk/services` }], "manage._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "editor._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "blocks._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "create.editorx": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], _: [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "www._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "bo._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "wixbo.ai": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "wix-bo.com": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "editor.wixapps.net": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "api._api_base_domain_": [{ srcPath: `/services-2`, destPath: `` }] } }));
1104
+ var Bn = [{ path: `businessLocations.locations.business.address.geocode.latitude` }, { path: `businessLocations.locations.business.address.geocode.longitude` }, { path: `businessLocations.locations.custom.address.geocode.latitude` }, { path: `businessLocations.locations.custom.address.geocode.longitude` }, { path: `businessLocations.locations.calculatedAddress.geocode.latitude` }, { path: `businessLocations.locations.calculatedAddress.geocode.longitude` }];
1105
+ function Vn(e2) {
1106
+ return St(Object.assign(e2, { domainToMappings: { "*.dev.wix-code.com": [{ srcPath: `/_api/services-2`, destPath: `` }, { srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "www.wixapis.com": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }, { srcPath: `/bookings/services/v2/bulk/services`, destPath: `/v2/bulk/services` }], "manage._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "editor._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "blocks._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "create.editorx": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], _: [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "www._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "bo._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "wixbo.ai": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "wix-bo.com": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "editor.wixapps.net": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "api._api_base_domain_": [{ srcPath: `/services-2`, destPath: `` }] } }));
1110
1107
  }
1111
- var Un = `@wix/auto_sdk_bookings_services`;
1112
- function Wn(e2) {
1108
+ var Hn = `@wix/auto_sdk_bookings_services`;
1109
+ function Un(e2) {
1113
1110
  function t2({ host: t3 }) {
1114
- return { entityFqdn: `wix.bookings.services.v2.service`, method: `POST`, methodFqn: `wix.bookings.services.v2.ServicesService.QueryLocations`, packageName: Un, migrationOptions: { optInTransformResponse: true }, url: Hn({ protoPath: `/v2/services/locations/query`, data: e2, host: t3 }), data: e2, transformResponse: (e3) => nt(e3, [{ transformFn: Wt, paths: Vn }]) };
1111
+ return { entityFqdn: `wix.bookings.services.v2.service`, method: `POST`, methodFqn: `wix.bookings.services.v2.ServicesService.QueryLocations`, packageName: Hn, migrationOptions: { optInTransformResponse: true }, url: Vn({ protoPath: `/v2/services/locations/query`, data: e2, host: t3 }), data: e2, transformResponse: (e3) => rt(e3, [{ transformFn: Gt, paths: Bn }]) };
1115
1112
  }
1116
1113
  return t2;
1117
1114
  }
1118
- var Gn = [{ path: `businessLocations.locations.calculatedAddress` }, { path: `businessLocations.locations.business.address` }, { path: `businessLocations.locations.custom.address` }];
1119
- async function Kn(e2) {
1120
- let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Wn(Ke({ filter: e2?.filter }));
1115
+ var Wn = [{ path: `businessLocations.locations.calculatedAddress` }, { path: `businessLocations.locations.business.address` }, { path: `businessLocations.locations.custom.address` }];
1116
+ async function Gn(e2) {
1117
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Un(qe({ filter: e2?.filter }));
1121
1118
  n2?.onSiteCall?.();
1122
1119
  try {
1123
1120
  let e3 = await t2.request(r2);
1124
- return n2?.onSuccess?.(e3), qe(nt(e3.data, [{ transformFn: Gt, paths: Gn }]));
1121
+ return n2?.onSuccess?.(e3), Je(rt(e3.data, [{ transformFn: Kt, paths: Wn }]));
1125
1122
  } catch (e3) {
1126
- let t3 = ft(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { filter: `$[0].filter` }, singleArgumentUnchanged: false }, [`options`]);
1123
+ let t3 = pt(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { filter: `$[0].filter` }, singleArgumentUnchanged: false }, [`options`]);
1127
1124
  throw n2?.onError?.(e3), t3;
1128
1125
  }
1129
1126
  }
1130
- function qn(e2) {
1131
- return (t2) => Kn(t2, { httpClient: e2 });
1127
+ function Kn(e2) {
1128
+ return (t2) => Gn(t2, { httpClient: e2 });
1132
1129
  }
1133
- var Jn = bt(qn);
1134
- var Yn = `13d21c63-b5ec-5912-8397-c3a5ddb27a97`;
1135
- var Xn = function(e2) {
1130
+ var qn = xt(Kn);
1131
+ var Jn = `13d21c63-b5ec-5912-8397-c3a5ddb27a97`;
1132
+ var Yn = function(e2) {
1136
1133
  return e2.BOOK_ONLINE = `bookingsBookOnline`, e2.SERVICE_PAGE = `bookingsServicePage`, e2.CALENDAR_PAGE = `bookingsCalendar`, e2.FORM_PAGE = `bookingsForm`, e2;
1137
1134
  }({});
1138
1135
  function Z(e2) {
@@ -1141,58 +1138,55 @@ function Z(e2) {
1141
1138
  function Q(e2) {
1142
1139
  return e2.business?.name ?? null;
1143
1140
  }
1144
- async function Zn() {
1145
- let e2 = await Jn({ filter: { services: { appId: Yn, hidden: false } } });
1141
+ async function Xn() {
1142
+ let e2 = await qn({ filter: { services: { appId: Jn, hidden: false } } });
1146
1143
  return { locations: [...e2.businessLocations?.locations ?? []].sort((e3, t2) => (Q(e3) ?? ``).localeCompare(Q(t2) ?? ``)), hasOtherLocations: !!(e2.customLocations?.exists || e2.customerLocations?.exists) };
1147
1144
  }
1148
- function Qn({ isLoading: e2, hasError: t2, refetch: n2, children: r2 }) {
1145
+ function Zn({ isLoading: e2, hasError: t2, refetch: n2, children: r2 }) {
1149
1146
  let { searchParams: i2 } = J(), a2 = { locations: [], locationItems: [], selectedLocationId: i2.get(Y.location), selectedLocationIndex: -1, selectedLocation: null, selectedLocationName: null, hasOtherLocations: false, hasMultipleLocations: false, isLoading: e2, hasError: t2, refetch: n2, selectLocation: () => {
1150
1147
  } };
1151
1148
  return f($.Provider, { value: a2, children: r2 });
1152
1149
  }
1153
- function $n({ refetch: e2, children: t2 }) {
1154
- return f(Qn, { isLoading: true, hasError: false, refetch: e2, children: t2 });
1150
+ function Qn({ refetch: e2, children: t2 }) {
1151
+ return f(Zn, { isLoading: true, hasError: false, refetch: e2, children: t2 });
1155
1152
  }
1156
- function er({ refetch: e2, children: t2 }) {
1157
- return f(Qn, { isLoading: false, hasError: true, refetch: e2, children: t2 });
1153
+ function $n({ refetch: e2, children: t2 }) {
1154
+ return f(Zn, { isLoading: false, hasError: true, refetch: e2, children: t2 });
1158
1155
  }
1156
+ var er = K(`@wix/site-service-business-logger`);
1159
1157
  function tr(e2) {
1160
- return e2;
1161
- }
1162
- var nr = tr(`@wix/viewer-service-business-logger`);
1163
- function rr(e2) {
1164
1158
  return { evid: 32, src: 16, endpoint: ``, params: e2 };
1165
1159
  }
1166
- var ir = { 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` };
1167
- Xn.BOOK_ONLINE;
1168
- var ar = `new_bookings_server`;
1169
- var or = (e2) => {
1170
- let t2 = d(nr);
1160
+ var nr = { 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` };
1161
+ Yn.BOOK_ONLINE;
1162
+ var rr = `new_bookings_server`;
1163
+ var ir = (e2) => {
1164
+ let { reportBi: t2 } = d(er);
1171
1165
  return r((n2) => {
1172
- t2.reportBi({ widget_name: e2, bookingsPlatform: ar, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
1166
+ t2({ widget_name: e2, bookingsPlatform: rr, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
1173
1167
  }, [t2, e2]);
1174
1168
  };
1175
- var sr = (e2, t2 = true) => {
1176
- let n2 = or(e2), { getParsedUrl: r2 } = J(), i2 = s(false);
1169
+ var ar = (e2, t2 = true) => {
1170
+ let n2 = ir(e2), { getParsedUrl: r2 } = J(), i2 = s(false);
1177
1171
  a(() => {
1178
- t2 && !i2.current && (i2.current = true, n2(rr({ referralInfo: r2().searchParams.get(Y.referral) ?? void 0 })));
1172
+ t2 && !i2.current && (i2.current = true, n2(tr({ referralInfo: r2().searchParams.get(Y.referral) ?? void 0 })));
1179
1173
  }, [t2, n2, r2]);
1180
1174
  };
1181
1175
  var $ = n(null);
1182
- var cr = `useLocationsContext must be used within LocationsContextProvider`;
1183
- function lr() {
1176
+ var or = `useLocationsContext must be used within LocationsContextProvider`;
1177
+ function sr() {
1184
1178
  let e2 = i($);
1185
- if (!e2) throw Error(cr);
1179
+ if (!e2) throw Error(or);
1186
1180
  return e2;
1187
1181
  }
1188
- function ur(e2, t2) {
1182
+ function cr(e2, t2) {
1189
1183
  let n2 = Z(e2);
1190
1184
  return { locationId: n2, locationName: Q(e2), isSelected: n2 != null && n2 === t2 };
1191
1185
  }
1192
- var dr = (e2) => ({ ...e2, hasError: false });
1193
- var fr = () => ({ locations: [], hasOtherLocations: false, hasError: true });
1194
- function pr({ locationsPromise: e2, initialLocationId: t2, refetch: n2, children: i2 }) {
1195
- let { locations: c2, hasOtherLocations: l2, hasError: u2 } = dn(e2), { pathname: d2, searchParams: p2, pushUrl: m2, getExternalBaseUrl: h2 } = J(), g2 = p2.get(Y.location), _2 = r((e3) => {
1186
+ var lr = (e2) => ({ ...e2, hasError: false });
1187
+ var ur = () => ({ locations: [], hasOtherLocations: false, hasError: true });
1188
+ function dr({ locationsPromise: e2, initialLocationId: t2, refetch: n2, children: i2 }) {
1189
+ let { locations: c2, hasOtherLocations: l2, hasError: u2 } = fn(e2), { pathname: d2, searchParams: p2, pushUrl: m2, getExternalBaseUrl: h2 } = J(), g2 = p2.get(Y.location), _2 = r((e3) => {
1196
1190
  let t3 = new URLSearchParams(p2);
1197
1191
  e3 ? t3.set(Y.location, e3) : t3.delete(Y.location), t3.delete(Y.page);
1198
1192
  let n3 = t3.toString(), r2 = n3 ? `${d2}?${n3}` : d2;
@@ -1201,21 +1195,21 @@ function pr({ locationsPromise: e2, initialLocationId: t2, refetch: n2, children
1201
1195
  a(() => {
1202
1196
  v2.current || (v2.current = true, t2 && !p2.get(Y.location) && _2(t2));
1203
1197
  }, [t2, p2, _2]);
1204
- let y2 = c2.findIndex((e3) => Z(e3) === g2), b2 = c2.find((e3) => Z(e3) === g2) ?? null, x2 = c2.filter((e3) => Z(e3)).length + +!!l2, S2 = o(() => ({ locations: c2, locationItems: c2.map((e3) => ur(e3, g2)), selectedLocationId: g2, selectedLocationIndex: y2, selectedLocation: b2, selectedLocationName: b2 ? Q(b2) : null, hasOtherLocations: l2, hasMultipleLocations: x2 > 1, isLoading: false, hasError: u2, refetch: n2, selectLocation: _2 }), [c2, g2, y2, b2, l2, u2, x2, n2, _2]);
1205
- return f($.Provider, { value: S2, children: i2 });
1198
+ let y2 = c2.findIndex((e3) => Z(e3) === g2), b2 = c2.find((e3) => Z(e3) === g2) ?? null, x2 = c2.filter((e3) => Z(e3)).length + +!!l2, ee2 = o(() => ({ locations: c2, locationItems: c2.map((e3) => cr(e3, g2)), selectedLocationId: g2, selectedLocationIndex: y2, selectedLocation: b2, selectedLocationName: b2 ? Q(b2) : null, hasOtherLocations: l2, hasMultipleLocations: x2 > 1, isLoading: false, hasError: u2, refetch: n2, selectLocation: _2 }), [c2, g2, y2, b2, l2, u2, x2, n2, _2]);
1199
+ return f($.Provider, { value: ee2, children: i2 });
1206
1200
  }
1207
- function mr({ initialLocationId: e2, children: n2 }) {
1208
- sr(ir.LOCATIONS);
1209
- let i2 = On(), [a2, s2] = c(0), l2 = o(() => pn(Bn({ key: An(), refresh: a2 !== 0, warmupData: i2, fetchData: () => ln(`locations-context-load`, { feature: U.locations }, Zn()) }), dr, fr), [a2]), u2 = r(() => s2((e3) => e3 + 1), []);
1210
- return f(un, { fallback: f(er, { refetch: u2, children: n2 }), feature: U.locations, children: f(t, { fallback: f($n, { refetch: u2, children: n2 }), children: f(pr, { locationsPromise: l2, initialLocationId: e2, refetch: u2, children: n2 }) }) });
1201
+ function fr({ initialLocationId: e2, children: n2 }) {
1202
+ ar(nr.LOCATIONS);
1203
+ let i2 = Dn(), [a2, s2] = c(0), l2 = o(() => mn(zn({ key: kn(), refresh: a2 !== 0, warmupData: i2, fetchData: () => un(`locations-context-load`, { feature: H.locations }, Xn()) }), lr, ur), [a2]), u2 = r(() => s2((e3) => e3 + 1), []);
1204
+ return f(dn, { fallback: f($n, { refetch: u2, children: n2 }), feature: H.locations, children: f(t, { fallback: f(Qn, { refetch: u2, children: n2 }), children: f(dr, { locationsPromise: l2, initialLocationId: e2, refetch: u2, children: n2 }) }) });
1211
1205
  }
1212
- var hr = tn;
1206
+ var pr = nn;
1213
1207
  export {
1214
- cr as LOCATIONS_CONTEXT_MISSING_PROVIDER_ERROR,
1215
- mr as LocationsContextProvider,
1216
- mr as default,
1217
- hr as injectAccessTokenGetter,
1208
+ or as LOCATIONS_CONTEXT_MISSING_PROVIDER_ERROR,
1209
+ fr as LocationsContextProvider,
1210
+ fr as default,
1211
+ pr as injectAccessTokenGetter,
1218
1212
  $ as locationsContext,
1219
- lr as useLocationsContext
1213
+ sr as useLocationsContext
1220
1214
  };
1221
- //# sourceMappingURL=context-locations-context.mjs.map
1215
+ //# sourceMappingURL=context-locations.mjs.map