@wix/bookings 1.0.1781 → 1.0.1783
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.
- package/build/cjs/context-booking-checkout.d.ts +32 -0
- package/build/cjs/context-booking-checkout.js +2002 -1762
- package/build/cjs/context-booking-checkout.js.map +1 -1
- package/build/cjs/context-my-booking.d.ts +2832 -0
- package/build/cjs/context-my-booking.js +592 -0
- package/build/cjs/context-my-booking.js.map +1 -0
- package/build/cjs/context-my-bookings.d.ts +2862 -0
- package/build/cjs/context-my-bookings.js +12885 -0
- package/build/cjs/context-my-bookings.js.map +1 -0
- package/build/cjs/context-service-addons.d.ts +54 -3
- package/build/cjs/context-service-addons.js +1065 -578
- package/build/cjs/context-service-addons.js.map +1 -1
- package/build/cjs/context-service.d.ts +35 -24
- package/build/cjs/context-service.js +985 -966
- package/build/cjs/context-service.js.map +1 -1
- package/build/cjs/context-time-slots.d.ts +44 -98
- package/build/cjs/context-time-slots.js +456 -474
- package/build/cjs/context-time-slots.js.map +1 -1
- package/build/es/context-booking-checkout.d.mts +32 -0
- package/build/es/context-booking-checkout.mjs +2002 -1762
- package/build/es/context-booking-checkout.mjs.map +1 -1
- package/build/es/context-my-booking.d.mts +2832 -0
- package/build/es/context-my-booking.mjs +562 -0
- package/build/es/context-my-booking.mjs.map +1 -0
- package/build/es/context-my-bookings.d.mts +2862 -0
- package/build/es/context-my-bookings.mjs +12844 -0
- package/build/es/context-my-bookings.mjs.map +1 -0
- package/build/es/context-service-addons.d.mts +54 -3
- package/build/es/context-service-addons.mjs +1061 -574
- package/build/es/context-service-addons.mjs.map +1 -1
- package/build/es/context-service.d.mts +35 -24
- package/build/es/context-service.mjs +985 -966
- package/build/es/context-service.mjs.map +1 -1
- package/build/es/context-time-slots.d.mts +44 -98
- package/build/es/context-time-slots.mjs +456 -474
- package/build/es/context-time-slots.mjs.map +1 -1
- package/build/internal/cjs/context-booking-checkout.d.ts +32 -0
- package/build/internal/cjs/context-my-booking.d.ts +2832 -0
- package/build/internal/cjs/context-my-bookings.d.ts +2862 -0
- package/build/internal/cjs/context-service-addons.d.ts +54 -3
- package/build/internal/cjs/context-service.d.ts +35 -24
- package/build/internal/cjs/context-time-slots.d.ts +44 -98
- package/build/internal/es/context-booking-checkout.d.mts +32 -0
- package/build/internal/es/context-my-booking.d.mts +2832 -0
- package/build/internal/es/context-my-bookings.d.mts +2862 -0
- package/build/internal/es/context-service-addons.d.mts +54 -3
- package/build/internal/es/context-service.d.mts +35 -24
- package/build/internal/es/context-time-slots.d.mts +44 -98
- package/context/my-booking/package.json +3 -0
- package/context/my-bookings/package.json +3 -0
- package/context-runtime/context-booking-checkout/runtime.d.ts +32 -0
- package/context-runtime/context-booking-checkout/runtime.js +3 -3
- package/context-runtime/context-my-booking/runtime.d.ts +2832 -0
- package/context-runtime/context-my-booking/runtime.js +2 -0
- package/context-runtime/context-my-bookings/runtime.d.ts +2862 -0
- package/context-runtime/context-my-bookings/runtime.js +11 -0
- package/context-runtime/context-service/runtime.d.ts +35 -24
- package/context-runtime/context-service/runtime.js +3 -3
- package/context-runtime/context-service-addons/runtime.d.ts +54 -3
- package/context-runtime/context-service-addons/runtime.js +2 -2
- package/context-runtime/context-time-slots/runtime.d.ts +44 -98
- package/context-runtime/context-time-slots/runtime.js +3 -3
- package/package.json +20 -4
|
@@ -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]:
|
|
77
|
+
return { [E]: te({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e2.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e2.methodFqn, entity: e2.entityFqdn }) };
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function te(e2) {
|
|
80
80
|
return Object.entries(e2).filter(([e3, t2]) => !!t2).map(([e3, t2]) => `${e3}=${t2}`).join(`,`);
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function ne(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,32 +88,32 @@ function te(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
|
|
92
|
-
function
|
|
93
|
-
return
|
|
91
|
+
var O = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
92
|
+
function k(e2) {
|
|
93
|
+
return j(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
|
|
94
94
|
}
|
|
95
|
-
var
|
|
96
|
-
var
|
|
97
|
-
var
|
|
98
|
-
var
|
|
99
|
-
function
|
|
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) {
|
|
100
100
|
let t2 = e2.trim();
|
|
101
|
-
t2 = t2.replace(
|
|
101
|
+
t2 = t2.replace(re, A).replace(ie, A), t2 = t2.replace(ae, `\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
|
|
109
|
-
var
|
|
108
|
+
var oe = (e2) => `validationError` in (e2.response?.data?.details ?? {});
|
|
109
|
+
var M = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
|
|
110
110
|
var se = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
|
|
111
111
|
function N(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
112
112
|
if (typeof e2 != `object` || !e2) throw e2;
|
|
113
|
-
if (
|
|
114
|
-
if (
|
|
113
|
+
if (oe(e2)) return ce(e2, t2, n2);
|
|
114
|
+
if (M(e2)) return ue(e2);
|
|
115
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:
|
|
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
117
|
return le(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
118
118
|
}
|
|
119
119
|
return de(e2);
|
|
@@ -124,10 +124,10 @@ var ce = (e2, t2, n2) => {
|
|
|
124
124
|
};
|
|
125
125
|
var le = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
|
|
126
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 ??
|
|
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
128
|
return le(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:
|
|
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
131
|
var fe = ({ 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) => {
|
|
@@ -150,7 +150,7 @@ var P = (e2) => {
|
|
|
150
150
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
151
151
|
};
|
|
152
152
|
function me(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
153
|
-
return
|
|
153
|
+
return ne(() => 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}`;
|
|
@@ -253,7 +253,7 @@ 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
|
|
256
|
+
let i3 = e3 in O ? O[e3] : void 0;
|
|
257
257
|
if (i3 && i3 in t3) {
|
|
258
258
|
r2.push(i3), n2 = t3[i3];
|
|
259
259
|
return;
|
|
@@ -455,7 +455,7 @@ function Pe(e2) {
|
|
|
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(
|
|
458
|
+
return me(ne(() => 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);
|
|
@@ -824,24 +824,24 @@ function rn() {
|
|
|
824
824
|
let t2 = new URL(e2);
|
|
825
825
|
return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
|
|
826
826
|
}
|
|
827
|
-
var
|
|
827
|
+
var U = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
|
|
828
828
|
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`);
|
|
829
829
|
return e2.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
|
|
830
830
|
}, getAccessToken: () => {
|
|
831
831
|
throw Error(`Not implemented`);
|
|
832
832
|
}, observeState: () => ({ disconnect: () => {
|
|
833
833
|
} }) });
|
|
834
|
-
var
|
|
834
|
+
var an = tn({ createHost: function(e2) {
|
|
835
835
|
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e2?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e2 || {};
|
|
836
836
|
if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
|
|
837
|
-
return { channel:
|
|
837
|
+
return { channel: U({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
838
838
|
} };
|
|
839
839
|
} });
|
|
840
|
-
var
|
|
841
|
-
let n2 =
|
|
840
|
+
var on = (e2, t2) => {
|
|
841
|
+
let n2 = an.host({ applicationId: e2, componentId: t2 }), r2 = an.auth();
|
|
842
842
|
return Pe({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
843
843
|
};
|
|
844
|
-
var sn = (e2) =>
|
|
844
|
+
var sn = (e2) => on(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`, e2);
|
|
845
845
|
var cn = [`ANY_FEMALE`, `ANY_MALE`];
|
|
846
846
|
var ln = `3.7.8`;
|
|
847
847
|
var un = ln;
|
|
@@ -887,7 +887,7 @@ var Dn = dn ? (e2) => Buffer.from(e2, `utf8`).toString(`base64`) : pn ? (e2) =>
|
|
|
887
887
|
var On = (e2, t2 = false) => t2 ? vn(Dn(e2)) : Dn(e2);
|
|
888
888
|
var kn = (e2) => On(e2, true);
|
|
889
889
|
var An = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
|
|
890
|
-
var
|
|
890
|
+
var G = (e2) => {
|
|
891
891
|
switch (e2.length) {
|
|
892
892
|
case 4:
|
|
893
893
|
var t2 = ((7 & e2.charCodeAt(0)) << 18 | (63 & e2.charCodeAt(1)) << 12 | (63 & e2.charCodeAt(2)) << 6 | 63 & e2.charCodeAt(3)) - 65536;
|
|
@@ -898,18 +898,18 @@ var jn = (e2) => {
|
|
|
898
898
|
return W((31 & e2.charCodeAt(0)) << 6 | 63 & e2.charCodeAt(1));
|
|
899
899
|
}
|
|
900
900
|
};
|
|
901
|
-
var
|
|
902
|
-
var
|
|
901
|
+
var jn = (e2) => e2.replace(An, G);
|
|
902
|
+
var Mn = (e2) => {
|
|
903
903
|
if (e2 = e2.replace(/\s+/g, ``), !gn.test(e2)) throw TypeError(`malformed base64.`);
|
|
904
904
|
e2 += `==`.slice(2 - (e2.length & 3));
|
|
905
905
|
let t2, n2, r2, i2 = [];
|
|
906
906
|
for (let a2 = 0; a2 < e2.length; ) t2 = hn[e2.charAt(a2++)] << 18 | hn[e2.charAt(a2++)] << 12 | (n2 = hn[e2.charAt(a2++)]) << 6 | (r2 = hn[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));
|
|
907
907
|
return i2.join(``);
|
|
908
908
|
};
|
|
909
|
-
var Nn = typeof atob == `function` ? (e2) => atob(yn(e2)) : dn ? (e2) => Buffer.from(e2, `base64`).toString(`binary`) :
|
|
909
|
+
var Nn = typeof atob == `function` ? (e2) => atob(yn(e2)) : dn ? (e2) => Buffer.from(e2, `base64`).toString(`binary`) : Mn;
|
|
910
910
|
var Pn = dn ? (e2) => _n(Buffer.from(e2, `base64`)) : (e2) => _n(Nn(e2).split(``).map((e3) => e3.charCodeAt(0)));
|
|
911
911
|
var Fn = (e2) => Pn(Ln(e2));
|
|
912
|
-
var In = dn ? (e2) => Buffer.from(e2, `base64`).toString(`utf8`) : fn ? (e2) => fn.decode(Pn(e2)) : (e2) =>
|
|
912
|
+
var In = dn ? (e2) => Buffer.from(e2, `base64`).toString(`utf8`) : fn ? (e2) => fn.decode(Pn(e2)) : (e2) => jn(Nn(e2));
|
|
913
913
|
var Ln = (e2) => yn(e2.replace(/[-_]/g, (e3) => e3 == `-` ? `+` : `/`));
|
|
914
914
|
var Rn = (e2) => In(Ln(e2));
|
|
915
915
|
var zn = (e2) => {
|
|
@@ -942,7 +942,7 @@ var Hn = function() {
|
|
|
942
942
|
return Cn(this, true);
|
|
943
943
|
});
|
|
944
944
|
};
|
|
945
|
-
var Un = { version: ln, VERSION: un, atob: Nn, atobPolyfill:
|
|
945
|
+
var Un = { version: ln, VERSION: un, atob: Nn, atobPolyfill: Mn, btoa: xn, btoaPolyfill: bn, fromBase64: Rn, toBase64: On, encode: On, encodeURI: kn, encodeURL: kn, utob: En, btou: jn, decode: Rn, isValid: zn, fromUint8Array: Cn, toUint8Array: Fn, extendString: Vn, extendUint8Array: Hn, extendBuiltins: () => {
|
|
946
946
|
Vn(), Hn();
|
|
947
947
|
} };
|
|
948
948
|
var K = Uint8Array;
|
|
@@ -1051,18 +1051,18 @@ var hr = function(e2, t2, n2, r2) {
|
|
|
1051
1051
|
d2 += 14;
|
|
1052
1052
|
for (var T2 = new K(w2), ee2 = new K(19), E2 = 0; E2 < C2; ++E2) ee2[Jn[E2]] = lr(e2, d2 + E2 * 3, 7);
|
|
1053
1053
|
d2 += C2 * 3;
|
|
1054
|
-
for (var D2 = cr(ee2),
|
|
1055
|
-
var
|
|
1056
|
-
d2 +=
|
|
1057
|
-
var y2 =
|
|
1054
|
+
for (var D2 = cr(ee2), te2 = (1 << D2) - 1, ne2 = rr(ee2, D2, 1), E2 = 0; E2 < w2; ) {
|
|
1055
|
+
var O2 = ne2[lr(e2, d2, te2)];
|
|
1056
|
+
d2 += O2 & 15;
|
|
1057
|
+
var y2 = O2 >> 4;
|
|
1058
1058
|
if (y2 < 16) T2[E2++] = y2;
|
|
1059
1059
|
else {
|
|
1060
|
-
var
|
|
1061
|
-
for (y2 == 16 ? (
|
|
1060
|
+
var k2 = 0, re2 = 0;
|
|
1061
|
+
for (y2 == 16 ? (re2 = 3 + lr(e2, d2, 3), d2 += 2, k2 = T2[E2 - 1]) : y2 == 17 ? (re2 = 3 + lr(e2, d2, 7), d2 += 3) : y2 == 18 && (re2 = 11 + lr(e2, d2, 127), d2 += 7); re2--; ) T2[E2++] = k2;
|
|
1062
1062
|
}
|
|
1063
1063
|
}
|
|
1064
|
-
var
|
|
1065
|
-
h2 = cr(
|
|
1064
|
+
var ie2 = T2.subarray(0, S2), A2 = T2.subarray(S2);
|
|
1065
|
+
h2 = cr(ie2), g2 = cr(A2), p2 = rr(ie2, h2, 1), m2 = rr(A2, g2, 1);
|
|
1066
1066
|
} else mr(1);
|
|
1067
1067
|
if (d2 > _2) {
|
|
1068
1068
|
c2 && mr(0);
|
|
@@ -1070,28 +1070,28 @@ var hr = function(e2, t2, n2, r2) {
|
|
|
1070
1070
|
}
|
|
1071
1071
|
}
|
|
1072
1072
|
s2 && l2(f2 + 131072);
|
|
1073
|
-
for (var
|
|
1074
|
-
var
|
|
1075
|
-
if (d2 +=
|
|
1073
|
+
for (var ae2 = (1 << h2) - 1, j2 = (1 << g2) - 1, oe2 = d2; ; oe2 = d2) {
|
|
1074
|
+
var k2 = p2[ur(e2, d2) & ae2], M2 = k2 >> 4;
|
|
1075
|
+
if (d2 += k2 & 15, d2 > _2) {
|
|
1076
1076
|
c2 && mr(0);
|
|
1077
1077
|
break;
|
|
1078
1078
|
}
|
|
1079
|
-
if (
|
|
1080
|
-
else if (
|
|
1081
|
-
|
|
1079
|
+
if (k2 || mr(2), M2 < 256) n2[f2++] = M2;
|
|
1080
|
+
else if (M2 == 256) {
|
|
1081
|
+
oe2 = d2, p2 = null;
|
|
1082
1082
|
break;
|
|
1083
1083
|
} else {
|
|
1084
|
-
var se2 =
|
|
1085
|
-
if (
|
|
1086
|
-
var E2 =
|
|
1084
|
+
var se2 = M2 - 254;
|
|
1085
|
+
if (M2 > 264) {
|
|
1086
|
+
var E2 = M2 - 257, N2 = Kn[E2];
|
|
1087
1087
|
se2 = lr(e2, d2, (1 << N2) - 1) + Zn[E2], d2 += N2;
|
|
1088
1088
|
}
|
|
1089
|
-
var ce2 = m2[ur(e2, d2) &
|
|
1089
|
+
var ce2 = m2[ur(e2, d2) & j2], le2 = ce2 >> 4;
|
|
1090
1090
|
ce2 || mr(3), d2 += ce2 & 15;
|
|
1091
|
-
var
|
|
1091
|
+
var A2 = er[le2];
|
|
1092
1092
|
if (le2 > 3) {
|
|
1093
1093
|
var N2 = qn[le2];
|
|
1094
|
-
|
|
1094
|
+
A2 += ur(e2, d2) & (1 << N2) - 1, d2 += N2;
|
|
1095
1095
|
}
|
|
1096
1096
|
if (d2 > _2) {
|
|
1097
1097
|
c2 && mr(0);
|
|
@@ -1099,14 +1099,14 @@ var hr = function(e2, t2, n2, r2) {
|
|
|
1099
1099
|
}
|
|
1100
1100
|
s2 && l2(f2 + 131072);
|
|
1101
1101
|
var ue2 = f2 + se2;
|
|
1102
|
-
if (f2 <
|
|
1103
|
-
var de2 = a2 -
|
|
1102
|
+
if (f2 < A2) {
|
|
1103
|
+
var de2 = a2 - A2, fe2 = Math.min(A2, ue2);
|
|
1104
1104
|
for (de2 + f2 < 0 && mr(3); f2 < fe2; ++f2) n2[f2] = r2[de2 + f2];
|
|
1105
1105
|
}
|
|
1106
|
-
for (; f2 < ue2; ++f2) n2[f2] = n2[f2 -
|
|
1106
|
+
for (; f2 < ue2; ++f2) n2[f2] = n2[f2 - A2];
|
|
1107
1107
|
}
|
|
1108
1108
|
}
|
|
1109
|
-
t2.l = p2, t2.p =
|
|
1109
|
+
t2.l = p2, t2.p = oe2, t2.b = f2, t2.f = u2, p2 && (u2 = 1, t2.m = h2, t2.d = m2, t2.n = g2);
|
|
1110
1110
|
} while (!u2);
|
|
1111
1111
|
return f2 != n2.length && o2 ? fr(n2, 0, f2) : n2.subarray(0, f2);
|
|
1112
1112
|
};
|
|
@@ -1885,54 +1885,42 @@ function Vo(e2) {
|
|
|
1885
1885
|
let t2 = ko(e2), n2 = new Date(t2.getFullYear(), t2.getMonth(), 1), r2 = new Date(t2.getFullYear(), t2.getMonth() + 1, 0);
|
|
1886
1886
|
return { startDate: Oo(n2), endDate: Oo(r2) };
|
|
1887
1887
|
}
|
|
1888
|
-
function Ho(e2) {
|
|
1889
|
-
let t2 = Vo(e2.startDate);
|
|
1890
|
-
return t2.startDate === e2.startDate && t2.endDate === e2.endDate;
|
|
1891
|
-
}
|
|
1892
|
-
function Uo(e2, t2) {
|
|
1893
|
-
if (Ho(e2)) {
|
|
1894
|
-
let n3 = ko(e2.startDate);
|
|
1895
|
-
return Vo(Oo(new Date(n3.getFullYear(), n3.getMonth() + t2, 1)));
|
|
1896
|
-
}
|
|
1897
|
-
let n2 = t2 * Bo(e2);
|
|
1898
|
-
return { startDate: zo(e2.startDate, n2), endDate: zo(e2.endDate, n2) };
|
|
1899
|
-
}
|
|
1900
|
-
function Wo(e2, t2) {
|
|
1888
|
+
function Ho(e2, t2) {
|
|
1901
1889
|
return e2 >= t2.startDate && e2 <= t2.endDate;
|
|
1902
1890
|
}
|
|
1903
|
-
function
|
|
1891
|
+
function Uo(e2) {
|
|
1904
1892
|
let t2 = ko(e2), n2 = new Date(t2.getFullYear(), t2.getMonth() + 2, 0).getDate(), r2 = Math.min(t2.getDate(), n2);
|
|
1905
1893
|
return Oo(new Date(t2.getFullYear(), t2.getMonth() + 1, r2));
|
|
1906
1894
|
}
|
|
1907
|
-
function
|
|
1895
|
+
function Wo(e2) {
|
|
1908
1896
|
let t2 = [], n2 = e2.startDate;
|
|
1909
1897
|
for (; n2 <= e2.endDate; ) {
|
|
1910
|
-
let r2 = zo(
|
|
1898
|
+
let r2 = zo(Uo(n2), -1), i2 = r2 < e2.endDate ? r2 : e2.endDate;
|
|
1911
1899
|
t2.push({ startDate: n2, endDate: i2 }), n2 = zo(i2, 1);
|
|
1912
1900
|
}
|
|
1913
1901
|
return t2;
|
|
1914
1902
|
}
|
|
1915
|
-
function
|
|
1903
|
+
function Go({ allowGenderSelection: e2, staffSelectionStrategy: t2 }) {
|
|
1916
1904
|
return e2 && t2 !== `CUSTOMER_CANNOT_CHOOSE`;
|
|
1917
1905
|
}
|
|
1918
|
-
async function
|
|
1906
|
+
async function Ko() {
|
|
1919
1907
|
let e2 = await Ia(Vr);
|
|
1920
1908
|
return { businessTimeZone: e2.timeSlotsConfiguration?.displayTimeZone?.timeZone || null, staffSelectionStrategy: e2.timeSlotsConfiguration?.staffSelection?.strategy ?? null, allowGenderSelection: e2.timeSlotsConfiguration?.staffSelection?.allowGenderSelection ?? false };
|
|
1921
1909
|
}
|
|
1922
|
-
function
|
|
1910
|
+
function qo(e2) {
|
|
1923
1911
|
let t2 = e2.location?._id || (e2.location?.locationType ? `${e2.location.locationType}:${e2.location.formattedAddress ?? ``}` : ``);
|
|
1924
1912
|
return `${e2.localStartDate ?? ``}|${e2.localEndDate ?? ``}|${t2}`;
|
|
1925
1913
|
}
|
|
1926
|
-
function
|
|
1914
|
+
function Jo(e2) {
|
|
1927
1915
|
return e2.availableResources?.[0]?.resources?.[0]?._id ?? null;
|
|
1928
1916
|
}
|
|
1929
|
-
function
|
|
1930
|
-
return `${
|
|
1917
|
+
function Yo(e2) {
|
|
1918
|
+
return `${qo(e2)}|${Jo(e2) ?? ``}`;
|
|
1931
1919
|
}
|
|
1932
|
-
function
|
|
1920
|
+
function Xo(e2) {
|
|
1933
1921
|
let t2 = /* @__PURE__ */ new Map();
|
|
1934
1922
|
for (let n2 of e2) {
|
|
1935
|
-
let e3 =
|
|
1923
|
+
let e3 = qo(n2), r2 = t2.get(e3);
|
|
1936
1924
|
r2 ? r2.push(n2) : t2.set(e3, [n2]);
|
|
1937
1925
|
}
|
|
1938
1926
|
return [...t2.values()].map((e3) => {
|
|
@@ -1941,132 +1929,132 @@ function Qo(e2) {
|
|
|
1941
1929
|
return { ...n2[0], availableResources: n2.flatMap((e4) => e4.availableResources ?? []) };
|
|
1942
1930
|
});
|
|
1943
1931
|
}
|
|
1944
|
-
function
|
|
1932
|
+
function Zo(e2) {
|
|
1945
1933
|
return e2 ? { locations: [{ _id: e2, locationType: `BUSINESS` }] } : {};
|
|
1946
1934
|
}
|
|
1947
|
-
function
|
|
1935
|
+
function Qo(e2) {
|
|
1948
1936
|
return e2 ? { resourceTypes: [{ resourceTypeId: Wr, resourceIds: [e2] }] } : {};
|
|
1949
1937
|
}
|
|
1950
|
-
function
|
|
1938
|
+
function $o(e2) {
|
|
1951
1939
|
let { requestedGender: t2, ...n2 } = e2;
|
|
1952
1940
|
return Object.keys(n2).length ? n2 : void 0;
|
|
1953
1941
|
}
|
|
1954
|
-
function
|
|
1942
|
+
function es(e2, t2) {
|
|
1955
1943
|
if (!e2) return {};
|
|
1956
|
-
let n2 = t2 ?
|
|
1944
|
+
let n2 = t2 ? $o(e2) : e2;
|
|
1957
1945
|
return n2 ? { customerChoices: n2 } : {};
|
|
1958
1946
|
}
|
|
1959
|
-
var
|
|
1960
|
-
function
|
|
1961
|
-
return _o(e2) ===
|
|
1947
|
+
var ts = `REQUESTED_GENDER_NOT_ALLOWED`;
|
|
1948
|
+
function ns(e2) {
|
|
1949
|
+
return _o(e2) === ts;
|
|
1962
1950
|
}
|
|
1963
|
-
var
|
|
1964
|
-
var
|
|
1965
|
-
function
|
|
1966
|
-
return
|
|
1951
|
+
var rs = false;
|
|
1952
|
+
var is = /* @__PURE__ */ new Set();
|
|
1953
|
+
function as() {
|
|
1954
|
+
return rs;
|
|
1967
1955
|
}
|
|
1968
|
-
function
|
|
1969
|
-
return
|
|
1956
|
+
function os(e2) {
|
|
1957
|
+
return is.add(e2), () => is.delete(e2);
|
|
1970
1958
|
}
|
|
1971
|
-
function
|
|
1972
|
-
|
|
1959
|
+
function ss() {
|
|
1960
|
+
rs || (rs = true, is.forEach((e2) => e2()));
|
|
1973
1961
|
}
|
|
1974
|
-
async function
|
|
1962
|
+
async function cs(e2) {
|
|
1975
1963
|
let { customerChoices: t2, ...n2 } = e2, r2 = (e3) => {
|
|
1976
|
-
let t3 =
|
|
1964
|
+
let t3 = $o(e3);
|
|
1977
1965
|
return la({ ...n2, ...t3 ? { customerChoices: t3 } : {} });
|
|
1978
1966
|
};
|
|
1979
|
-
if (
|
|
1967
|
+
if (rs && t2?.requestedGender) return r2(t2);
|
|
1980
1968
|
try {
|
|
1981
1969
|
return await la(e2);
|
|
1982
1970
|
} catch (e3) {
|
|
1983
|
-
if (!t2?.requestedGender || !
|
|
1984
|
-
return $(e3, { feature: Q.timeSlots, action: `requested-gender-rejected`, level: `warning` }),
|
|
1971
|
+
if (!t2?.requestedGender || !ns(e3)) throw e3;
|
|
1972
|
+
return $(e3, { feature: Q.timeSlots, action: `requested-gender-rejected`, level: `warning` }), ss(), r2(t2);
|
|
1985
1973
|
}
|
|
1986
1974
|
}
|
|
1987
|
-
function
|
|
1975
|
+
function ls(e2, t2, n2) {
|
|
1988
1976
|
return { ...e2 ? { "location.id": e2 } : {}, ...t2 ? { "resources.id": { $hasSome: [t2] } } : {}, ...n2 ? { remainingCapacity: { $gte: n2 } } : {} };
|
|
1989
1977
|
}
|
|
1990
|
-
async function
|
|
1978
|
+
async function us(e2) {
|
|
1991
1979
|
let t2 = await _a(e2);
|
|
1992
1980
|
return { timeSlots: t2.timeSlots ?? [], timeZone: t2.timeZone ?? null, nextCursor: t2.pagingMetadata?.cursors?.next || null };
|
|
1993
1981
|
}
|
|
1994
|
-
function
|
|
1995
|
-
return Ya(t2) ?
|
|
1982
|
+
function ds({ 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 }) {
|
|
1983
|
+
return Ya(t2) ? fs({ serviceId: e2, fromLocalDate: n2, toLocalDate: r2, timeZone: i2, locationId: a2, staffId: o2, onlyAvailableSlots: s2, customerChoices: c2, timeSlotsPerDay: u2, limit: d2, cursor: f2 }) : us({ serviceIds: [e2], fromLocalDate: n2, ...r2 ? { toLocalDate: r2 } : {}, ...i2 ? { timeZone: i2 } : {}, includeNonBookable: !s2, eventFilter: { type: t2, ...ls(a2, o2, l2) }, cursorPaging: { limit: d2, ...f2 ? { cursor: f2 } : {} } });
|
|
1996
1984
|
}
|
|
1997
|
-
async function
|
|
1998
|
-
let d2 = await
|
|
1985
|
+
async function fs({ serviceId: e2, fromLocalDate: t2, toLocalDate: n2, timeZone: r2, locationId: i2, staffId: a2, onlyAvailableSlots: o2, customerChoices: s2, timeSlotsPerDay: c2, limit: l2, cursor: u2 }) {
|
|
1986
|
+
let d2 = await cs({ serviceId: e2, fromLocalDate: t2, ...n2 ? { toLocalDate: n2 } : {}, ...r2 ? { timeZone: r2 } : {}, ...o2 ? { bookable: true } : {}, ...Zo(i2), ...Qo(a2), ...es(s2, a2), includeResourceTypeIds: [Wr], ...c2 == null ? {} : { timeSlotsPerDay: c2 }, cursorPaging: { limit: l2, ...u2 ? { cursor: u2 } : {} } });
|
|
1999
1987
|
return { timeSlots: d2.timeSlots ?? [], timeZone: d2.timeZone ?? null, nextCursor: d2.cursorPagingMetadata?.cursors?.next || null };
|
|
2000
1988
|
}
|
|
2001
|
-
var
|
|
2002
|
-
var
|
|
2003
|
-
function
|
|
2004
|
-
let t2 = e2 ? ko(e2) : new Date(Date.now()), n2 = new Date(t2.getFullYear(), t2.getMonth() +
|
|
1989
|
+
var ps = 6;
|
|
1990
|
+
var ms = 864e5;
|
|
1991
|
+
function hs(e2) {
|
|
1992
|
+
let t2 = e2 ? ko(e2) : new Date(Date.now()), n2 = new Date(t2.getFullYear(), t2.getMonth() + ps + 1, 1), r2 = new Date(n2.getTime() - ms);
|
|
2005
1993
|
return { fromLocalDate: jo(t2), toLocalDate: Mo(r2) };
|
|
2006
1994
|
}
|
|
2007
|
-
async function
|
|
2008
|
-
let { fromLocalDate: u2, toLocalDate: d2 } =
|
|
1995
|
+
async function gs({ serviceId: e2, serviceType: t2, timeZone: n2, limit: r2, onlyAvailableSlots: i2 = true, fromDate: a2, locationId: o2, staffId: s2, customerChoices: c2, minRemainingCapacity: l2 }) {
|
|
1996
|
+
let { fromLocalDate: u2, toLocalDate: d2 } = hs(a2);
|
|
2009
1997
|
if (Xa(t2) || Za(t2)) {
|
|
2010
|
-
let a3 = { ...Za(t2) ? { type: `COURSE` } : {}, ...
|
|
1998
|
+
let a3 = { ...Za(t2) ? { type: `COURSE` } : {}, ...ls(o2, s2, l2) }, c3 = await us({ serviceIds: [e2], fromLocalDate: u2, toLocalDate: d2, ...n2 ? { timeZone: n2 } : {}, includeNonBookable: !i2, ...Object.keys(a3).length ? { eventFilter: a3 } : {}, ...r2 == null ? {} : { cursorPaging: { limit: r2 } } });
|
|
2011
1999
|
return { timeSlots: c3.timeSlots, timeZone: c3.timeZone };
|
|
2012
2000
|
}
|
|
2013
|
-
let f2 = await
|
|
2001
|
+
let f2 = await cs({ serviceId: e2, fromLocalDate: u2, toLocalDate: d2, ...n2 ? { timeZone: n2 } : {}, ...i2 ? { bookable: true } : {}, ...Zo(o2), ...Qo(s2), ...es(c2, s2), includeResourceTypeIds: [Wr], ...r2 == null ? {} : { cursorPaging: { limit: r2 } } });
|
|
2014
2002
|
return { timeSlots: f2.timeSlots ?? [], timeZone: f2.timeZone ?? null };
|
|
2015
2003
|
}
|
|
2016
|
-
var
|
|
2017
|
-
async function
|
|
2004
|
+
var _s = 1e3;
|
|
2005
|
+
async function vs({ serviceId: e2, serviceType: t2, date: n2, timeZone: r2, onlyAvailableSlots: i2, locationId: a2, staffId: o2, customerChoices: s2, minRemainingCapacity: c2, fromLocalDate: l2, toLocalDate: u2 }) {
|
|
2018
2006
|
let d2 = `${n2}T00:00:00`, f2 = `${n2}T23:59:59`, p2 = Za(t2) ? `COURSE` : Xa(t2) ? `CLASS` : `APPOINTMENT`, m2 = [], h2 = null, g2;
|
|
2019
2007
|
do {
|
|
2020
|
-
let t3 = await
|
|
2008
|
+
let t3 = await ds({ 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: _s, cursor: g2 });
|
|
2021
2009
|
m2.push(...t3.timeSlots), h2 = t3.timeZone ?? h2, g2 = t3.nextCursor ?? void 0;
|
|
2022
2010
|
} while (g2);
|
|
2023
2011
|
return { timeSlots: m2, timeZone: h2 };
|
|
2024
2012
|
}
|
|
2025
|
-
function
|
|
2013
|
+
function ys(e2) {
|
|
2026
2014
|
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 };
|
|
2027
2015
|
}
|
|
2028
|
-
function
|
|
2016
|
+
function bs(e2) {
|
|
2029
2017
|
return e2?.options?.values?.[0]?.type === Ea.STAFF_MEMBER;
|
|
2030
2018
|
}
|
|
2031
|
-
function
|
|
2019
|
+
function xs(e2) {
|
|
2032
2020
|
return e2.staffMemberDetails?.staffMembers ?? [];
|
|
2033
2021
|
}
|
|
2034
|
-
function
|
|
2022
|
+
function Ss(e2, t2) {
|
|
2035
2023
|
let n2 = e2.workingHoursLocationCoverage;
|
|
2036
2024
|
return { staffMemberId: e2.staffMemberId ?? ``, name: e2.name ?? null, image: null, isSelected: t2 === e2.staffMemberId, ...n2 ? { locationCoverage: { availableAtAllLocations: n2.availableAtAllLocations ?? false, locationIds: n2.locationIds ?? [] } } : {} };
|
|
2037
2025
|
}
|
|
2038
|
-
function
|
|
2026
|
+
function Cs(e2, t2) {
|
|
2039
2027
|
let n2 = e2.locationCoverage;
|
|
2040
2028
|
return !n2 || n2.availableAtAllLocations || n2.locationIds.includes(t2);
|
|
2041
2029
|
}
|
|
2042
|
-
function
|
|
2043
|
-
return t2 ? e2.filter((e3) =>
|
|
2030
|
+
function ws(e2, t2) {
|
|
2031
|
+
return t2 ? e2.filter((e3) => Cs(e3, t2)) : e2;
|
|
2044
2032
|
}
|
|
2045
|
-
function
|
|
2033
|
+
function Ts(e2, t2) {
|
|
2046
2034
|
let n2 = new Map(t2.map((e3) => [e3.staffMemberId, e3.locationCoverage]));
|
|
2047
2035
|
return e2.choices.map((e3) => e3.choiceId).filter((e3) => e3 != null).map((e3) => ({ staffMemberId: e3, locationCoverage: n2.get(e3) }));
|
|
2048
2036
|
}
|
|
2049
|
-
function
|
|
2037
|
+
function Es(e2, t2, n2) {
|
|
2050
2038
|
if (e2?.type !== `STAFF_MEMBER` || !n2) return;
|
|
2051
|
-
let r2 =
|
|
2039
|
+
let r2 = ws(Ts(e2, t2), n2);
|
|
2052
2040
|
return r2.length === 1 ? r2[0].staffMemberId : void 0;
|
|
2053
2041
|
}
|
|
2054
|
-
function
|
|
2042
|
+
function Ds(e2, t2) {
|
|
2055
2043
|
if (t2.length === 0) return e2;
|
|
2056
|
-
let n2 = e2.filter((e3) =>
|
|
2044
|
+
let n2 = e2.filter((e3) => ws(t2, e3.id).length > 0);
|
|
2057
2045
|
return n2.length > 0 ? n2 : e2;
|
|
2058
2046
|
}
|
|
2059
|
-
function
|
|
2060
|
-
return
|
|
2047
|
+
function Os(e2) {
|
|
2048
|
+
return xs(e2).map((e3) => Ss(e3, null));
|
|
2061
2049
|
}
|
|
2062
|
-
function
|
|
2063
|
-
let r2 =
|
|
2050
|
+
function ks(e2, t2, n2 = false) {
|
|
2051
|
+
let r2 = As(e2), i2 = r2.length === 1 ? r2[0].id : void 0, a2 = n2 || !i2 || r2.some((e3) => e3.id === t2);
|
|
2064
2052
|
return t2 && a2 ? t2 : i2;
|
|
2065
2053
|
}
|
|
2066
|
-
function
|
|
2067
|
-
return
|
|
2054
|
+
function As(e2) {
|
|
2055
|
+
return Ds(Ja(e2), Os(e2));
|
|
2068
2056
|
}
|
|
2069
|
-
function
|
|
2057
|
+
function js(e2) {
|
|
2070
2058
|
let t2 = e2;
|
|
2071
2059
|
if (t2.__state || (t2.__state = { status: `pending` }, t2.then((e3) => {
|
|
2072
2060
|
t2.__state = { status: `fulfilled`, value: e3 };
|
|
@@ -2075,27 +2063,27 @@ function Ns(e2) {
|
|
|
2075
2063
|
})), t2.__state.status === `fulfilled`) return t2.__state.value;
|
|
2076
2064
|
throw t2.__state.status === `rejected` ? t2.__state.reason : t2;
|
|
2077
2065
|
}
|
|
2078
|
-
function
|
|
2066
|
+
function Ms(e2) {
|
|
2079
2067
|
let t2 = Promise.resolve(e2);
|
|
2080
2068
|
return t2.__state = { status: `fulfilled`, value: e2 }, t2;
|
|
2081
2069
|
}
|
|
2082
|
-
var
|
|
2083
|
-
function
|
|
2070
|
+
var Ns = Fr(`@wix/site-service-warmup-data`);
|
|
2071
|
+
function Ps() {
|
|
2084
2072
|
try {
|
|
2085
2073
|
return d();
|
|
2086
2074
|
} catch {
|
|
2087
2075
|
return null;
|
|
2088
2076
|
}
|
|
2089
2077
|
}
|
|
2090
|
-
function
|
|
2078
|
+
function Fs(e2) {
|
|
2091
2079
|
try {
|
|
2092
|
-
return e2 ? e2(
|
|
2080
|
+
return e2 ? e2(Ns) : null;
|
|
2093
2081
|
} catch {
|
|
2094
2082
|
return null;
|
|
2095
2083
|
}
|
|
2096
2084
|
}
|
|
2097
|
-
function
|
|
2098
|
-
let e2 =
|
|
2085
|
+
function Is() {
|
|
2086
|
+
let e2 = Fs(Ps()), t2 = typeof window > `u`;
|
|
2099
2087
|
return { scope: e2 ?? void 0, get: async (n2) => {
|
|
2100
2088
|
if (t2 || !e2) return null;
|
|
2101
2089
|
try {
|
|
@@ -2110,57 +2098,57 @@ function Rs() {
|
|
|
2110
2098
|
}
|
|
2111
2099
|
} };
|
|
2112
2100
|
}
|
|
2113
|
-
var
|
|
2114
|
-
function
|
|
2115
|
-
return `${
|
|
2101
|
+
var Ls = `bookings-uou`;
|
|
2102
|
+
function Rs() {
|
|
2103
|
+
return `${Ls}:bookings-settings`;
|
|
2116
2104
|
}
|
|
2117
|
-
function
|
|
2118
|
-
return `${
|
|
2105
|
+
function zs() {
|
|
2106
|
+
return `${Ls}:time-slots-configuration`;
|
|
2119
2107
|
}
|
|
2120
|
-
var
|
|
2121
|
-
var
|
|
2122
|
-
var
|
|
2123
|
-
var
|
|
2124
|
-
function
|
|
2108
|
+
var Bs = 5e3;
|
|
2109
|
+
var Vs = 100;
|
|
2110
|
+
var Hs = `wix-warmup-data`;
|
|
2111
|
+
var Us = null;
|
|
2112
|
+
function Ws(e2) {
|
|
2125
2113
|
if (typeof document < `u`) try {
|
|
2126
|
-
let t2 = document.getElementById(
|
|
2127
|
-
return t2 ? (
|
|
2114
|
+
let t2 = document.getElementById(Hs)?.textContent;
|
|
2115
|
+
return t2 ? (Us?.text !== t2 && (Us = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), Us.data[e2] ?? void 0) : void 0;
|
|
2128
2116
|
} catch {
|
|
2129
2117
|
return;
|
|
2130
2118
|
}
|
|
2131
2119
|
}
|
|
2132
|
-
var
|
|
2133
|
-
var
|
|
2134
|
-
var
|
|
2135
|
-
var
|
|
2136
|
-
function
|
|
2137
|
-
if (!e2) return
|
|
2138
|
-
let t2 =
|
|
2139
|
-
return t2 || (t2 =
|
|
2120
|
+
var Gs = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
|
|
2121
|
+
var Ks = Gs();
|
|
2122
|
+
var qs = /* @__PURE__ */ new WeakMap();
|
|
2123
|
+
var Js = /* @__PURE__ */ new WeakMap();
|
|
2124
|
+
function Ys(e2) {
|
|
2125
|
+
if (!e2) return Ks;
|
|
2126
|
+
let t2 = qs.get(e2);
|
|
2127
|
+
return t2 || (t2 = Gs(), qs.set(e2, t2)), t2;
|
|
2140
2128
|
}
|
|
2141
|
-
function
|
|
2129
|
+
function Xs({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
2142
2130
|
if (e2 === null) return n2();
|
|
2143
2131
|
if (typeof window > `u`) {
|
|
2144
2132
|
let r3 = () => n2().then((n3) => (t2.set(e2, n3), n3)), { scope: i3 } = t2;
|
|
2145
2133
|
if (!i3) return r3();
|
|
2146
|
-
let a3 =
|
|
2147
|
-
a3 || (a3 = /* @__PURE__ */ new Map(),
|
|
2134
|
+
let a3 = Js.get(i3);
|
|
2135
|
+
a3 || (a3 = /* @__PURE__ */ new Map(), Js.set(i3, a3));
|
|
2148
2136
|
let o3 = a3.get(e2);
|
|
2149
2137
|
if (o3) return o3;
|
|
2150
2138
|
let s3 = r3();
|
|
2151
2139
|
return a3.set(e2, s3), s3.catch(() => a3.delete(e2)), s3;
|
|
2152
2140
|
}
|
|
2153
|
-
let i2 =
|
|
2141
|
+
let i2 = Ys(t2.scope), a2 = Date.now();
|
|
2154
2142
|
for (let [e3, t3] of i2.promises) t3.expiresAt <= a2 && i2.promises.delete(e3);
|
|
2155
2143
|
let o2 = i2.promises.get(e2);
|
|
2156
2144
|
if (o2 && !r2) return o2.promise;
|
|
2157
2145
|
r2 && i2.invalidatedWarmup.add(e2);
|
|
2158
2146
|
let s2 = !i2.invalidatedWarmup.has(e2);
|
|
2159
2147
|
if (s2) {
|
|
2160
|
-
let t3 =
|
|
2148
|
+
let t3 = Ws(e2);
|
|
2161
2149
|
if (t3 !== void 0) {
|
|
2162
|
-
let n3 =
|
|
2163
|
-
return i2.promises.set(e2, { promise: n3, expiresAt: a2 +
|
|
2150
|
+
let n3 = Ms(t3);
|
|
2151
|
+
return i2.promises.set(e2, { promise: n3, expiresAt: a2 + Bs }), n3;
|
|
2164
2152
|
}
|
|
2165
2153
|
}
|
|
2166
2154
|
let c2 = (async () => {
|
|
@@ -2170,48 +2158,48 @@ function Qs({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
|
2170
2158
|
}
|
|
2171
2159
|
return n2();
|
|
2172
2160
|
})();
|
|
2173
|
-
i2.promises.size >=
|
|
2161
|
+
i2.promises.size >= Vs && i2.promises.delete(i2.promises.keys().next().value);
|
|
2174
2162
|
let l2 = { promise: c2, expiresAt: 1 / 0 };
|
|
2175
2163
|
return i2.promises.set(e2, l2), c2.then(() => {
|
|
2176
|
-
l2.expiresAt = Date.now() +
|
|
2164
|
+
l2.expiresAt = Date.now() + Bs;
|
|
2177
2165
|
}, () => {
|
|
2178
2166
|
i2.promises.get(e2) === l2 && i2.promises.delete(e2);
|
|
2179
2167
|
}), c2;
|
|
2180
2168
|
}
|
|
2181
|
-
var
|
|
2182
|
-
async function
|
|
2169
|
+
var Zs = { displayTimeZonePolicy: { basedOn: Ha.BUSINESS_TIME_ZONE, customerCanChange: false }, multiServiceAppointmentsEnabled: false };
|
|
2170
|
+
async function Qs() {
|
|
2183
2171
|
try {
|
|
2184
2172
|
let e2 = await Ga();
|
|
2185
2173
|
return { displayTimeZonePolicy: { basedOn: e2.displayTimeZone?.basedOn ?? Ha.BUSINESS_TIME_ZONE, customerCanChange: e2.displayTimeZone?.customerCanChange ?? false }, multiServiceAppointmentsEnabled: e2.multiServiceAppointments?.enabled ?? false };
|
|
2186
2174
|
} catch (e2) {
|
|
2187
|
-
return $(e2, { feature: Q.bookingsSettings, action: `fetch-bookings-settings`, level: `warning` }),
|
|
2175
|
+
return $(e2, { feature: Q.bookingsSettings, action: `fetch-bookings-settings`, level: `warning` }), Zs;
|
|
2188
2176
|
}
|
|
2189
2177
|
}
|
|
2190
|
-
var
|
|
2191
|
-
var
|
|
2192
|
-
var
|
|
2193
|
-
function
|
|
2194
|
-
let e2 = i(
|
|
2195
|
-
if (!e2) throw Error(
|
|
2178
|
+
var $s = { isLoading: true };
|
|
2179
|
+
var ec = n(null);
|
|
2180
|
+
var tc = `useBookingsSettingsContext must be used within BookingsSettingsProvider`;
|
|
2181
|
+
function nc() {
|
|
2182
|
+
let e2 = i(ec);
|
|
2183
|
+
if (!e2) throw Error(tc);
|
|
2196
2184
|
return e2;
|
|
2197
2185
|
}
|
|
2198
|
-
function
|
|
2186
|
+
function rc(e2) {
|
|
2199
2187
|
return e2.basedOn === Ha.CUSTOMER_TIME_ZONE ? Intl.DateTimeFormat().resolvedOptions().timeZone : void 0;
|
|
2200
2188
|
}
|
|
2201
|
-
function
|
|
2202
|
-
let e2 =
|
|
2203
|
-
return e2.isLoading ? void 0 :
|
|
2189
|
+
function ic() {
|
|
2190
|
+
let e2 = nc();
|
|
2191
|
+
return e2.isLoading ? void 0 : rc(e2.displayTimeZonePolicy);
|
|
2204
2192
|
}
|
|
2205
|
-
function
|
|
2206
|
-
let n2 =
|
|
2207
|
-
return p(
|
|
2193
|
+
function ac({ settingsPromise: e2, children: t2 }) {
|
|
2194
|
+
let n2 = js(e2), r2 = o(() => ({ isLoading: false, ...n2 }), [n2]);
|
|
2195
|
+
return p(ec.Provider, { value: r2, children: t2 });
|
|
2208
2196
|
}
|
|
2209
|
-
function
|
|
2210
|
-
let r2 =
|
|
2211
|
-
return e2 ? p(
|
|
2197
|
+
function oc({ bookingsSettings: e2, children: n2 }) {
|
|
2198
|
+
let r2 = Is(), [i2] = c(() => e2 ? null : Xs({ key: Rs(), warmupData: r2, fetchData: Qs }));
|
|
2199
|
+
return e2 ? p(ec.Provider, { value: { isLoading: false, ...e2 }, children: n2 }) : p(t, { fallback: p(ec.Provider, { value: $s, children: n2 }), children: p(ac, { settingsPromise: i2, children: n2 }) });
|
|
2212
2200
|
}
|
|
2213
|
-
var
|
|
2214
|
-
var
|
|
2201
|
+
var sc = 1e3;
|
|
2202
|
+
var cc = class extends e {
|
|
2215
2203
|
state = { hasError: false };
|
|
2216
2204
|
static getDerivedStateFromError() {
|
|
2217
2205
|
return { hasError: true };
|
|
@@ -2223,16 +2211,16 @@ var uc = class extends e {
|
|
|
2223
2211
|
return this.state.hasError ? this.props.fallback : this.props.children;
|
|
2224
2212
|
}
|
|
2225
2213
|
};
|
|
2226
|
-
var
|
|
2227
|
-
function
|
|
2228
|
-
let t2 = e2.searchParams.get(
|
|
2214
|
+
var lc = `appSectionParams`;
|
|
2215
|
+
function uc(e2) {
|
|
2216
|
+
let t2 = e2.searchParams.get(lc);
|
|
2229
2217
|
if (t2 === null) return e2;
|
|
2230
2218
|
let n2 = new URL(e2);
|
|
2231
|
-
n2.searchParams.delete(
|
|
2232
|
-
for (let [e3, r2] of Object.entries(
|
|
2219
|
+
n2.searchParams.delete(lc);
|
|
2220
|
+
for (let [e3, r2] of Object.entries(dc(t2))) typeof r2 == `string` && !n2.searchParams.has(e3) && n2.searchParams.set(e3, r2);
|
|
2233
2221
|
return n2;
|
|
2234
2222
|
}
|
|
2235
|
-
function
|
|
2223
|
+
function dc(e2) {
|
|
2236
2224
|
try {
|
|
2237
2225
|
let t2 = JSON.parse(e2);
|
|
2238
2226
|
return t2 && typeof t2 == `object` && !Array.isArray(t2) ? t2 : {};
|
|
@@ -2240,16 +2228,16 @@ function pc(e2) {
|
|
|
2240
2228
|
return {};
|
|
2241
2229
|
}
|
|
2242
2230
|
}
|
|
2243
|
-
var
|
|
2244
|
-
var
|
|
2231
|
+
var fc = `bookings-uou:url-change`;
|
|
2232
|
+
var pc = (e2) => {
|
|
2245
2233
|
let t2 = new URL(e2);
|
|
2246
2234
|
return t2.searchParams.sort(), t2.href;
|
|
2247
2235
|
};
|
|
2248
|
-
function
|
|
2236
|
+
function mc(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
|
|
2249
2237
|
let r2 = globalThis.window;
|
|
2250
2238
|
if (!r2?.history) return;
|
|
2251
2239
|
let i2 = new URL(r2.location.href);
|
|
2252
|
-
if (
|
|
2240
|
+
if (pc(i2) === pc(e2)) return;
|
|
2253
2241
|
let a2 = { scrollY: r2.scrollY };
|
|
2254
2242
|
if (n2) r2.history.replaceState(a2, ``, e2.href);
|
|
2255
2243
|
else {
|
|
@@ -2260,111 +2248,109 @@ function gc(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
|
|
|
2260
2248
|
return;
|
|
2261
2249
|
}
|
|
2262
2250
|
}
|
|
2263
|
-
r2.dispatchEvent(new Event(
|
|
2251
|
+
r2.dispatchEvent(new Event(fc));
|
|
2264
2252
|
}
|
|
2265
|
-
function
|
|
2253
|
+
function hc(e2) {
|
|
2266
2254
|
let t2 = globalThis.window;
|
|
2267
|
-
return t2 ? (t2.addEventListener(
|
|
2268
|
-
t2.removeEventListener(
|
|
2255
|
+
return t2 ? (t2.addEventListener(fc, e2), t2.addEventListener(`popstate`, e2), () => {
|
|
2256
|
+
t2.removeEventListener(fc, e2), t2.removeEventListener(`popstate`, e2);
|
|
2269
2257
|
}) : () => {
|
|
2270
2258
|
};
|
|
2271
2259
|
}
|
|
2272
|
-
var
|
|
2260
|
+
var gc = (e2) => {
|
|
2273
2261
|
try {
|
|
2274
2262
|
return decodeURIComponent(e2);
|
|
2275
2263
|
} catch {
|
|
2276
2264
|
return e2;
|
|
2277
2265
|
}
|
|
2278
2266
|
};
|
|
2279
|
-
function
|
|
2267
|
+
function _c(e2, t2) {
|
|
2280
2268
|
let n2 = t2 ? new URL(t2).pathname : `/`;
|
|
2281
|
-
return `./${
|
|
2269
|
+
return `./${gc(new URL(e2).pathname.replace(n2, ``).replace(/^\/|\/$/g, ``))}`;
|
|
2282
2270
|
}
|
|
2283
|
-
function
|
|
2284
|
-
let e2 = f(zr), t2 = r(() => e2.currentUrl, [e2]), n2 = l(
|
|
2285
|
-
return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () =>
|
|
2271
|
+
function vc() {
|
|
2272
|
+
let e2 = f(zr), t2 = r(() => e2.currentUrl, [e2]), n2 = l(hc, t2, t2), i2 = o(() => uc(new URL(n2)), [n2]), a2 = e2.siteUrl.replace(/\/$/, ``);
|
|
2273
|
+
return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () => uc(new URL(e2.currentUrl)), getRelativeUrl: () => _c(e2.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: mc };
|
|
2286
2274
|
}
|
|
2287
|
-
var
|
|
2288
|
-
function
|
|
2275
|
+
var yc = Fr(`@wix/site-service-business-logger`);
|
|
2276
|
+
function bc(e2) {
|
|
2289
2277
|
return { evid: 32, src: 16, endpoint: ``, params: e2 };
|
|
2290
2278
|
}
|
|
2291
|
-
function
|
|
2279
|
+
function xc(e2) {
|
|
2292
2280
|
return { evid: 33, src: 16, endpoint: ``, params: e2 };
|
|
2293
2281
|
}
|
|
2294
|
-
function
|
|
2282
|
+
function Sc(e2) {
|
|
2295
2283
|
return { evid: 34, src: 16, endpoint: ``, params: e2 };
|
|
2296
2284
|
}
|
|
2297
|
-
var
|
|
2285
|
+
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` };
|
|
2298
2286
|
Gr.BOOK_ONLINE;
|
|
2299
|
-
var
|
|
2300
|
-
var
|
|
2301
|
-
var
|
|
2302
|
-
var
|
|
2303
|
-
var
|
|
2304
|
-
let { reportBi: t2 } = f(
|
|
2287
|
+
var wc = `new_bookings_server`;
|
|
2288
|
+
var Tc = { LOAD: `load`, LOCATION_CHOSEN: `location chosen`, STAFF_CHOSEN: `staff chosen`, VARIANT_SELECTED: `variant selected`, ADD_ON_SELECTED: `add on selected`, ADD_ON_UNSELECTED: `add on unselected`, BACK: `back`, CLOSE: `close`, STAY: `stay`, ADD_SERVICE: `add service`, EDIT_BASKET_ITEM: `edit basket item`, EDIT_BASKET_ITEM_FROM_CALENDAR: `edit basket item from calendar`, CHANGE_STAFF_MEMBER: `change staff member`, REMOVE_BASKET_ITEM: `remove basket item`, SELECT_SERVICE: `select service`, SEARCH: `search`, CLEAR_SEARCH: `clear search` };
|
|
2289
|
+
var Ec = { TIMEZONE_PICKER: `timezone_picker`, TIME_PICKER: `time_picker`, BOOKING_DETAILS: `booking_details`, RESCHEDULE_DIALOG: `reschedule_dialog`, JOIN_WAITLIST_DIALOG: `join_waitlist_dialog` };
|
|
2290
|
+
var Dc = { DROPDOWN: `dropdown`, TIME_SLOT: `time_slot`, EXPAND: `expand`, COLLAPSE: `collapse` };
|
|
2291
|
+
var Oc = (e2) => {
|
|
2292
|
+
let { reportBi: t2 } = f(yc);
|
|
2305
2293
|
return r((n2) => {
|
|
2306
|
-
t2({ widget_name: e2, bookingsPlatform:
|
|
2294
|
+
t2({ widget_name: e2, bookingsPlatform: wc, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
|
|
2307
2295
|
}, [t2, e2]);
|
|
2308
2296
|
};
|
|
2309
|
-
var
|
|
2310
|
-
let n2 =
|
|
2297
|
+
var kc = (e2, t2 = true) => {
|
|
2298
|
+
let n2 = Oc(e2), { getParsedUrl: r2 } = vc(), i2 = s(false);
|
|
2311
2299
|
a(() => {
|
|
2312
|
-
t2 && !i2.current && (i2.current = true, n2(
|
|
2300
|
+
t2 && !i2.current && (i2.current = true, n2(bc({ referralInfo: r2().searchParams.get(eo.referral) ?? void 0 })));
|
|
2313
2301
|
}, [t2, n2, r2]);
|
|
2314
2302
|
};
|
|
2315
|
-
function
|
|
2303
|
+
function Ac(e2) {
|
|
2316
2304
|
return { evid: 1177, src: 16, endpoint: `wixboost-ugc`, params: e2 };
|
|
2317
2305
|
}
|
|
2318
|
-
function
|
|
2306
|
+
function jc(e2) {
|
|
2319
2307
|
return { evid: 596, src: 16, endpoint: `wixboost-ugc`, params: e2 };
|
|
2320
2308
|
}
|
|
2321
|
-
function
|
|
2309
|
+
function Mc(e2, t2) {
|
|
2322
2310
|
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 = {};
|
|
2323
2311
|
for (let e3 of n2) e3.type !== `literal` && (r2[e3.type] = Number(e3.value));
|
|
2324
2312
|
return Date.UTC(r2.year, r2.month - 1, r2.day, r2.hour, r2.minute, r2.second) - e2;
|
|
2325
2313
|
}
|
|
2326
|
-
function
|
|
2314
|
+
function Nc(e2, t2) {
|
|
2327
2315
|
let n2 = e2.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?/);
|
|
2328
2316
|
if (!n2) return null;
|
|
2329
2317
|
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);
|
|
2330
2318
|
if (Number.isNaN(l2)) return null;
|
|
2331
2319
|
try {
|
|
2332
|
-
let e3 = l2 -
|
|
2333
|
-
return new Date(l2 -
|
|
2320
|
+
let e3 = l2 - Mc(l2, t2);
|
|
2321
|
+
return new Date(l2 - Mc(e3, t2));
|
|
2334
2322
|
} catch {
|
|
2335
2323
|
return null;
|
|
2336
2324
|
}
|
|
2337
2325
|
}
|
|
2338
|
-
function
|
|
2339
|
-
let i2 = (e3) => e3 && n2 ?
|
|
2340
|
-
return
|
|
2326
|
+
function Pc({ start: e2, end: t2, timeZone: n2, ...r2 }) {
|
|
2327
|
+
let i2 = (e3) => e3 && n2 ? Nc(e3, n2)?.getTime() : void 0;
|
|
2328
|
+
return Sc({ bookingsServiceId: r2.serviceId, serviceType: r2.serviceType, startTime: i2(e2), endTime: i2(t2), isEligibleForFlowCompletion: r2.isEligibleForFlowCompletion });
|
|
2341
2329
|
}
|
|
2342
|
-
function
|
|
2343
|
-
let i2 = n2 ? `loadFailed` : null, a2 = { selectedDate: null, daysAvailabilityRange: null, daysAvailability: [], daysAvailabilityLoading: false, daysAvailabilityHasError: false,
|
|
2330
|
+
function Fc({ nextAvailableSlotsCount: e2, isLoading: t2, hasError: n2, children: r2 }) {
|
|
2331
|
+
let i2 = n2 ? `loadFailed` : null, a2 = { selectedDate: null, daysAvailabilityRange: null, daysAvailability: [], daysAvailabilityLoading: false, daysAvailabilityHasError: false, selectDate: async () => {
|
|
2344
2332
|
}, setDaysAvailabilityRange: async () => {
|
|
2345
|
-
},
|
|
2346
|
-
}, previousDaysAvailabilityRange: async () => {
|
|
2347
|
-
}, goToNextAvailableDate: async () => `cancelled`, canChangeTimeZone: false, isMultiService: false, hasValidSchedulingInput: false, availabilityRequestKey: null, needsServiceChoice: false, isRescheduling: u(true)?.reschedule != null, rescheduleValidUntil: null, staffFilterOptions: [], locationFilterOptions: [], selectedStaffFilter: null, requestedGender: null, genderSelectionAllowed: false, selectedLocationFilter: null, setStaffFilter: () => {
|
|
2333
|
+
}, goToNextAvailableDate: async () => `cancelled`, canChangeTimeZone: false, isMultiService: false, availabilityRequestKey: null, needsServiceChoice: false, isRescheduling: u(true)?.reschedule != null, rescheduleValidUntil: null, staffFilterOptions: [], locationFilterOptions: [], selectedStaffFilter: null, requestedGender: null, genderSelectionAllowed: false, selectedLocationFilter: null, setStaffFilter: () => {
|
|
2348
2334
|
}, setLocationFilter: () => {
|
|
2349
|
-
}, isComplete: false,
|
|
2335
|
+
}, isComplete: false, timeSlots: [], isLoading: t2, hasError: n2, errorCode: i2, businessTimeZone: null, setTimeZone: () => {
|
|
2350
2336
|
}, currentTimeSlotsPage: 1, hasNextTimeSlotsPage: false, hasPreviousTimeSlotsPage: false, nextTimeSlotsPage: async () => {
|
|
2351
2337
|
}, loadUpcomingTimeSlots: async () => {
|
|
2352
2338
|
}, upcomingTimeSlotsRequested: false, previousTimeSlotsPage: () => {
|
|
2353
2339
|
}, nextAvailableSlotsCount: e2, timeZone: null, staffFromSlots: [], selectedResourceId: null, setSelectedResource: () => {
|
|
2354
2340
|
}, canAutoAssignStaff: false, selectedTimeSlot: null, selectTimeSlot: () => {
|
|
2355
2341
|
}, navigateToBookingForm: () => {
|
|
2356
|
-
}, timeSlotLimitPerDay: null,
|
|
2342
|
+
}, timeSlotLimitPerDay: null, daysWithMore: /* @__PURE__ */ new Set(), loadingDate: null, loadAllTimeSlotsForDay: async () => {
|
|
2357
2343
|
} };
|
|
2358
|
-
return p(
|
|
2344
|
+
return p(Ul.Provider, { value: a2, children: r2 });
|
|
2359
2345
|
}
|
|
2360
|
-
function
|
|
2361
|
-
return p(
|
|
2346
|
+
function Ic({ nextAvailableSlotsCount: e2, children: t2 }) {
|
|
2347
|
+
return p(Fc, { nextAvailableSlotsCount: e2, isLoading: true, hasError: false, children: t2 });
|
|
2362
2348
|
}
|
|
2363
|
-
function
|
|
2364
|
-
return p(
|
|
2349
|
+
function Lc({ nextAvailableSlotsCount: e2, children: t2 }) {
|
|
2350
|
+
return p(Fc, { nextAvailableSlotsCount: e2, isLoading: false, hasError: true, children: t2 });
|
|
2365
2351
|
}
|
|
2366
|
-
var
|
|
2367
|
-
function
|
|
2352
|
+
var Rc = 1e3;
|
|
2353
|
+
function zc(e2, t2) {
|
|
2368
2354
|
let n2 = /* @__PURE__ */ new Map();
|
|
2369
2355
|
for (let e3 of t2) {
|
|
2370
2356
|
let t3 = e3.localStartDate?.slice(0, 10);
|
|
@@ -2377,68 +2363,68 @@ function Vc(e2, t2) {
|
|
|
2377
2363
|
}
|
|
2378
2364
|
return r2;
|
|
2379
2365
|
}
|
|
2380
|
-
function
|
|
2366
|
+
function Bc(e2, t2) {
|
|
2381
2367
|
return { fromLocalDate: Po(e2.startDate, t2), toLocalDate: Mo(ko(e2.endDate)) };
|
|
2382
2368
|
}
|
|
2383
|
-
async function
|
|
2384
|
-
return (await
|
|
2369
|
+
async function Vc(e2, t2, n2, r2, i2, a2) {
|
|
2370
|
+
return (await cs({ serviceId: e2, ...Bc(n2, t2), timeZone: t2, ...Zo(r2), ...Qo(i2), ...es(a2, i2), timeSlotsPerDay: 1, cursorPaging: { limit: Math.min(Bo(n2), Rc) } })).timeSlots ?? [];
|
|
2385
2371
|
}
|
|
2386
|
-
async function
|
|
2387
|
-
return (await
|
|
2372
|
+
async function Hc(e2, t2, n2, r2, i2, a2) {
|
|
2373
|
+
return (await us({ serviceIds: [e2], ...Bc(n2, t2), timeZone: t2, includeNonBookable: true, eventFilter: { type: `CLASS`, ...ls(r2, i2, a2) }, maxSlotsPerDay: 1, cursorPaging: { limit: Math.min(Bo(n2), Rc) } })).timeSlots;
|
|
2388
2374
|
}
|
|
2389
|
-
async function
|
|
2390
|
-
if (Za(t2) || n2.endDate < r2) return
|
|
2391
|
-
let l2 = { startDate: n2.startDate < r2 ? r2 : n2.startDate, endDate: n2.endDate }, u2 = Xa(t2) ?
|
|
2392
|
-
return
|
|
2375
|
+
async function Uc({ serviceId: e2, serviceType: t2, range: n2, fromDate: r2, timeZone: i2, locationId: a2, staffId: o2, customerChoices: s2, minRemainingCapacity: c2 }) {
|
|
2376
|
+
if (Za(t2) || n2.endDate < r2) return zc(n2, []);
|
|
2377
|
+
let l2 = { startDate: n2.startDate < r2 ? r2 : n2.startDate, endDate: n2.endDate }, u2 = Xa(t2) ? Wo(l2) : [l2];
|
|
2378
|
+
return zc(n2, (await Promise.all(u2.map((n3) => Xa(t2) ? Hc(e2, i2, n3, a2, o2, c2) : Vc(e2, i2, n3, a2, o2, s2)))).flat());
|
|
2393
2379
|
}
|
|
2394
|
-
function
|
|
2380
|
+
function Wc({ serviceId: e2, staff: t2, customerChoices: n2 }) {
|
|
2395
2381
|
let r2 = t2 && !t2.anyResource ? t2.staffMemberId : void 0;
|
|
2396
|
-
return { serviceId: e2, ...
|
|
2382
|
+
return { serviceId: e2, ...es(n2, r2), ...t2?.anyResource ? {} : { includeResourceTypeIds: [Wr] }, ...r2 ? { resourceTypes: [{ resourceTypeId: Wr, resourceIds: [r2] }] } : {} };
|
|
2397
2383
|
}
|
|
2398
|
-
function
|
|
2399
|
-
return { services: e2.map(
|
|
2384
|
+
function Gc({ services: e2, locationId: t2, locationType: n2, timeZone: r2 }) {
|
|
2385
|
+
return { services: e2.map(Wc), timeZone: r2, location: { ...t2 ? { _id: t2 } : {}, locationType: n2 } };
|
|
2400
2386
|
}
|
|
2401
|
-
function
|
|
2402
|
-
let { customerChoices: t2, ...n2 } = e2, r2 = t2 ?
|
|
2387
|
+
function Kc(e2) {
|
|
2388
|
+
let { customerChoices: t2, ...n2 } = e2, r2 = t2 ? $o(t2) : void 0;
|
|
2403
2389
|
return r2 ? { ...n2, customerChoices: r2 } : n2;
|
|
2404
2390
|
}
|
|
2405
|
-
async function
|
|
2406
|
-
let t2 = e2.services ?? [], n2 = () => Ta({ ...e2, services: t2.map(
|
|
2407
|
-
if (r2 &&
|
|
2391
|
+
async function qc(e2) {
|
|
2392
|
+
let t2 = e2.services ?? [], n2 = () => Ta({ ...e2, services: t2.map(Kc) }), r2 = t2.some((e3) => e3.customerChoices?.requestedGender);
|
|
2393
|
+
if (r2 && as()) return n2();
|
|
2408
2394
|
try {
|
|
2409
2395
|
return await Ta(e2);
|
|
2410
2396
|
} catch (e3) {
|
|
2411
|
-
if (!r2 || !
|
|
2412
|
-
return $(e3, { feature: Q.timeSlots, action: `requested-gender-rejected`, level: `warning` }),
|
|
2397
|
+
if (!r2 || !ns(e3)) throw e3;
|
|
2398
|
+
return $(e3, { feature: Q.timeSlots, action: `requested-gender-rejected`, level: `warning` }), ss(), n2();
|
|
2413
2399
|
}
|
|
2414
2400
|
}
|
|
2415
|
-
var
|
|
2416
|
-
async function
|
|
2417
|
-
if (e2.endDate < t2) return
|
|
2401
|
+
var Jc = 1e3;
|
|
2402
|
+
async function Yc({ range: e2, fromDate: t2, ...n2 }) {
|
|
2403
|
+
if (e2.endDate < t2) return zc(e2, []);
|
|
2418
2404
|
let r2 = { startDate: e2.startDate < t2 ? t2 : e2.startDate, endDate: e2.endDate };
|
|
2419
|
-
return
|
|
2405
|
+
return zc(e2, (await qc({ ...Gc(n2), fromLocalDate: Po(r2.startDate, n2.timeZone), toLocalDate: Mo(ko(r2.endDate)), timeSlotsPerDay: 1, cursorPaging: { limit: Math.min(Bo(r2), Jc) } })).timeSlots ?? []);
|
|
2420
2406
|
}
|
|
2421
|
-
async function
|
|
2407
|
+
async function Xc({ date: e2, onlyAvailableSlots: t2, fromLocalDate: n2, ...r2 }) {
|
|
2422
2408
|
let i2 = `${e2}T00:00:00`, a2 = [], o2 = null, s2;
|
|
2423
2409
|
do {
|
|
2424
|
-
let c2 = await
|
|
2410
|
+
let c2 = await qc({ ...Gc(r2), fromLocalDate: n2 && n2 > i2 ? n2 : i2, toLocalDate: `${e2}T23:59:59`, ...t2 ? { bookable: true } : {}, cursorPaging: { limit: Jc, ...s2 ? { cursor: s2 } : {} } });
|
|
2425
2411
|
a2.push(...c2.timeSlots ?? []), o2 = c2.timeZone ?? o2, s2 = c2.cursorPagingMetadata?.cursors?.next || void 0;
|
|
2426
2412
|
} while (s2);
|
|
2427
2413
|
return { timeSlots: a2, timeZone: o2 };
|
|
2428
2414
|
}
|
|
2429
|
-
async function
|
|
2430
|
-
let n2 = await
|
|
2415
|
+
async function Zc({ fromDate: e2, ...t2 }) {
|
|
2416
|
+
let n2 = await qc({ ...Gc(t2), ...hs(e2), bookable: true, cursorPaging: { limit: 1 } });
|
|
2431
2417
|
return { timeSlots: n2.timeSlots ?? [], timeZone: n2.timeZone ?? null };
|
|
2432
2418
|
}
|
|
2433
|
-
var
|
|
2434
|
-
function
|
|
2435
|
-
let [_2, v2] = c(null), [y2, b2] = c(p2), [x2, S2] = c(
|
|
2419
|
+
var Qc = [];
|
|
2420
|
+
function $c({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest: i2, timeZone: l2, today: u2, locationId: d2, staffId: f2, loadInitially: p2, customerChoices: m2, minRemainingCapacity: h2, onlyAvailableSlots: g2 }) {
|
|
2421
|
+
let [_2, v2] = c(null), [y2, b2] = c(p2), [x2, S2] = c(Qc), [C2, w2] = c(false), [T2, ee2] = c(false), E2 = s(0);
|
|
2436
2422
|
a(() => {
|
|
2437
2423
|
_2 === null && u2 && v2(Vo(u2));
|
|
2438
2424
|
}, [_2, u2]), a(() => {
|
|
2439
2425
|
if (!y2 || !e2 || !(t2 || i2) || !l2 || !u2 || !_2 || !i2 && Za(n2)) return;
|
|
2440
2426
|
let r2 = ++E2.current;
|
|
2441
|
-
return w2(true), (i2 ?
|
|
2427
|
+
return w2(true), (i2 ? Yc({ ...i2, range: _2, fromDate: u2, timeZone: l2 }) : Uc({ serviceId: t2, serviceType: n2, range: _2, fromDate: u2, timeZone: l2, locationId: d2 ?? void 0, staffId: f2 ?? void 0, customerChoices: m2, minRemainingCapacity: h2 })).then((e3) => {
|
|
2442
2428
|
r2 === E2.current && (S2(e3), ee2(false), w2(false));
|
|
2443
2429
|
}).catch((e3) => {
|
|
2444
2430
|
r2 === E2.current && ($(e3, { feature: Q.timeSlots, action: `fetch-days-availability`, level: `warning` }), ee2(true), w2(false));
|
|
@@ -2448,26 +2434,22 @@ function tl({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest:
|
|
|
2448
2434
|
}, [y2, e2, t2, n2, i2, l2, u2, _2, d2, f2, m2, h2]);
|
|
2449
2435
|
let D2 = r(async (e3) => {
|
|
2450
2436
|
Ro(e3) && (v2(e3), b2(true));
|
|
2451
|
-
}, []), O2 = r(async () => {
|
|
2452
|
-
v2((e3) => e3 && Uo(e3, 1)), b2(true);
|
|
2453
|
-
}, []), te2 = r(async () => {
|
|
2454
|
-
v2((e3) => e3 && Uo(e3, -1)), b2(true);
|
|
2455
2437
|
}, []);
|
|
2456
|
-
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
|
|
2438
|
+
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 };
|
|
2457
2439
|
}
|
|
2458
|
-
function
|
|
2459
|
-
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),
|
|
2460
|
-
|
|
2440
|
+
function el({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest: i2, timeZone: o2, today: l2, locationId: u2, staffId: d2, customerChoices: f2, minRemainingCapacity: p2, onlyAvailableSlots: m2, serviceLoading: h2 }) {
|
|
2441
|
+
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(() => {
|
|
2442
|
+
te2.current += 1, E2(false);
|
|
2461
2443
|
}, []);
|
|
2462
2444
|
a(() => {
|
|
2463
|
-
|
|
2464
|
-
}, [e2, t2, n2, i2, o2, u2, d2, f2, p2,
|
|
2465
|
-
let
|
|
2445
|
+
O2();
|
|
2446
|
+
}, [e2, t2, n2, i2, o2, u2, d2, f2, p2, O2]);
|
|
2447
|
+
let k2 = e2 && !h2 && !t2 && !i2;
|
|
2466
2448
|
a(() => {
|
|
2467
|
-
|
|
2468
|
-
}, [
|
|
2449
|
+
k2 && (C2(null), T2(null));
|
|
2450
|
+
}, [k2]), a(() => {
|
|
2469
2451
|
if (!g2) return;
|
|
2470
|
-
if (
|
|
2452
|
+
if (k2) {
|
|
2471
2453
|
_2(null);
|
|
2472
2454
|
return;
|
|
2473
2455
|
}
|
|
@@ -2483,7 +2465,7 @@ function nl({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest:
|
|
|
2483
2465
|
let r2 = No(new Date(Date.now()), o2), a2 = ++D2.current;
|
|
2484
2466
|
x2(null), C2(null), T2(null);
|
|
2485
2467
|
let s2 = r2.slice(0, 10) === g2.date ? r2 : void 0;
|
|
2486
|
-
return (i2 ?
|
|
2468
|
+
return (i2 ? Xc({ ...i2, date: g2.date, timeZone: o2, onlyAvailableSlots: m2, fromLocalDate: s2 }) : vs({ 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) => {
|
|
2487
2469
|
a2 === D2.current && x2({ timeSlots: e3.timeSlots, timeZone: e3.timeZone ?? o2 });
|
|
2488
2470
|
}).catch((e3) => {
|
|
2489
2471
|
a2 === D2.current && ($(e3, { feature: Q.timeSlots, action: `fetch-day-time-slots`, level: `warning` }), C2(`timeSlotsLoadFailed`));
|
|
@@ -2491,58 +2473,58 @@ function nl({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest:
|
|
|
2491
2473
|
a2 === D2.current && (D2.current += 1);
|
|
2492
2474
|
};
|
|
2493
2475
|
}, [g2, v2, e2, t2, h2, n2, i2, o2, l2, u2, d2, f2, p2, m2]);
|
|
2494
|
-
let
|
|
2495
|
-
!i2 && Za(n2) || !Lo(e3) || l2 && e3 < l2 || (
|
|
2496
|
-
}, [n2, i2, l2,
|
|
2476
|
+
let re2 = r(async (e3) => {
|
|
2477
|
+
!i2 && Za(n2) || !Lo(e3) || l2 && e3 < l2 || (O2(), y2((e4) => e4 + 1), _2({ kind: `day`, date: e3 }));
|
|
2478
|
+
}, [n2, i2, l2, O2]), ie2 = g2?.date ?? null, A2 = r(async () => {
|
|
2497
2479
|
let r2 = !!(t2 || i2);
|
|
2498
2480
|
if (!i2 && Za(n2) || !e2 || !r2 || !o2) return { outcome: `none` };
|
|
2499
|
-
let a2 = D2.current, s2 = ++
|
|
2481
|
+
let a2 = D2.current, s2 = ++te2.current, c2 = ++ne2.current, m3 = () => a2 === D2.current && s2 === te2.current;
|
|
2500
2482
|
E2(true), T2(null);
|
|
2501
2483
|
try {
|
|
2502
|
-
let e3 =
|
|
2484
|
+
let e3 = ie2 ?? l2 ?? void 0, r3 = i2 ? await Zc({ ...i2, timeZone: o2, fromDate: e3 }) : await gs({ serviceId: t2, serviceType: n2, timeZone: o2, limit: 1, onlyAvailableSlots: true, fromDate: e3, locationId: u2 ?? void 0, staffId: d2 ?? void 0, customerChoices: f2, minRemainingCapacity: p2 });
|
|
2503
2485
|
if (!m3()) return { outcome: `cancelled` };
|
|
2504
2486
|
let a3 = r3.timeSlots[0]?.localStartDate?.slice(0, 10) ?? null;
|
|
2505
2487
|
return a3 ? { outcome: `found`, date: a3 } : { outcome: `none` };
|
|
2506
2488
|
} catch (e3) {
|
|
2507
2489
|
return m3() ? ($(e3, { feature: Q.timeSlots, action: `find-next-available-date`, level: `warning` }), T2(`timeSlotsLoadFailed`), { outcome: `error` }) : { outcome: `cancelled` };
|
|
2508
2490
|
} finally {
|
|
2509
|
-
c2 ===
|
|
2491
|
+
c2 === ne2.current && E2(false);
|
|
2510
2492
|
}
|
|
2511
|
-
}, [e2, t2, n2, i2, o2, l2, u2, d2, f2, p2,
|
|
2512
|
-
return { query: g2, selectedDate:
|
|
2493
|
+
}, [e2, t2, n2, i2, o2, l2, u2, d2, f2, p2, ie2]), ae2 = w2 ?? S2;
|
|
2494
|
+
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 };
|
|
2513
2495
|
}
|
|
2514
|
-
var
|
|
2515
|
-
function
|
|
2496
|
+
var tl = (e2) => e2?.type === `DATE_TIME`;
|
|
2497
|
+
function nl(e2) {
|
|
2516
2498
|
let t2 = e2.schedule?.availabilityConstraints?.durations;
|
|
2517
2499
|
if (!Ya(e2.type) || !Array.isArray(t2)) return false;
|
|
2518
2500
|
let n2 = t2.map((e3) => typeof e3 == `number` ? e3 : e3?.minutes);
|
|
2519
2501
|
return new Set(n2).size > 1;
|
|
2520
2502
|
}
|
|
2521
|
-
function
|
|
2503
|
+
function rl({ service: e2, multiServiceAppointmentsEnabled: t2, variants: n2, locationId: r2 }) {
|
|
2522
2504
|
if (!Ya(e2.type)) return false;
|
|
2523
|
-
if (t2 ||
|
|
2524
|
-
if (!Qa(e2) ||
|
|
2525
|
-
let i2 =
|
|
2526
|
-
return r2 && i2 !== r2 ? true : !
|
|
2505
|
+
if (t2 || nl(e2) || $a(e2)) return true;
|
|
2506
|
+
if (!Qa(e2) || tl(n2)) return false;
|
|
2507
|
+
let i2 = ks(e2, r2);
|
|
2508
|
+
return r2 && i2 !== r2 ? true : !Es(n2, Os(e2), i2);
|
|
2527
2509
|
}
|
|
2528
|
-
function
|
|
2510
|
+
function il(e2, t2) {
|
|
2529
2511
|
return !!Pr(e2)?.services.some((e3) => e3.serviceId === t2);
|
|
2530
2512
|
}
|
|
2531
|
-
function
|
|
2532
|
-
return !t2.service._id ||
|
|
2513
|
+
function al({ blobParam: e2, ...t2 }) {
|
|
2514
|
+
return !t2.service._id || il(e2, t2.service._id) ? false : rl({ ...t2, multiServiceAppointmentsEnabled: false });
|
|
2533
2515
|
}
|
|
2534
|
-
function
|
|
2516
|
+
function ol(e2) {
|
|
2535
2517
|
return !!e2?._id;
|
|
2536
2518
|
}
|
|
2537
|
-
function
|
|
2519
|
+
function sl() {
|
|
2538
2520
|
try {
|
|
2539
2521
|
return d();
|
|
2540
2522
|
} catch {
|
|
2541
2523
|
return null;
|
|
2542
2524
|
}
|
|
2543
2525
|
}
|
|
2544
|
-
function
|
|
2545
|
-
let e2 =
|
|
2526
|
+
function cl() {
|
|
2527
|
+
let e2 = sl();
|
|
2546
2528
|
return r((t2) => {
|
|
2547
2529
|
if (!e2) return false;
|
|
2548
2530
|
try {
|
|
@@ -2553,70 +2535,71 @@ function ul() {
|
|
|
2553
2535
|
}
|
|
2554
2536
|
}, [e2]);
|
|
2555
2537
|
}
|
|
2556
|
-
function
|
|
2557
|
-
let { service: t2, isLoading: n2, hasError: r2, bookingsSettingsLoading: i2, isLoadingServiceOptionsAndVariants: o2, pricingOption: c2, multiServiceAppointmentsEnabled: l2, isMultiServiceAppointment: d2, reschedule: f2, selection: p2, openPreferences: m2, editingSurface: h2 } = u(), { searchParams: g2 } =
|
|
2538
|
+
function ll(e2) {
|
|
2539
|
+
let { service: t2, isLoading: n2, hasError: r2, bookingsSettingsLoading: i2, isLoadingServiceOptionsAndVariants: o2, pricingOption: c2, multiServiceAppointmentsEnabled: l2, isMultiServiceAppointment: d2, reschedule: f2, selection: p2, openPreferences: m2, editingSurface: h2 } = u(), { searchParams: g2 } = vc(), _2 = cl(), v2 = Oc(Cc.PREFERENCES), y2 = s(false), b2 = e2 && !h2 && !n2 && !r2 && !i2 && !o2 && f2 == null && !d2 && ol(t2), x2 = p2.locationId ?? void 0, S2 = g2.get(eo.blob);
|
|
2558
2540
|
a(() => {
|
|
2559
|
-
!y2.current && b2 && (y2.current = true, _2(Gr.CALENDAR_PAGE) &&
|
|
2541
|
+
!y2.current && b2 && (y2.current = true, _2(Gr.CALENDAR_PAGE) && al({ service: t2, multiServiceAppointmentsEnabled: l2, variants: c2, locationId: x2, blobParam: S2 }) && (Do({ message: `Calendar opens the preferences modal`, category: `navigation`, feature: Q.timeSlots, data: { serviceId: t2._id ?? null, serviceType: t2.type ?? null } }), v2(Ac({ action: Tc.EDIT_BASKET_ITEM_FROM_CALENDAR, numberOfServices: 1, isMultiFlow: l2 })), m2().then(() => Eo(`Preferences modal opened`, { feature: Q.timeSlots, action: `auto-open-preferences`, tags: { serviceType: t2.type ?? `unknown` } }), (e3) => $(e3, { feature: Q.timeSlots, action: `open-preferences-lightbox` }))));
|
|
2560
2542
|
}, [b2, t2, l2, c2, x2, S2, _2, v2, m2]);
|
|
2561
2543
|
}
|
|
2562
|
-
function
|
|
2544
|
+
function ul(e2, t2) {
|
|
2563
2545
|
return t2 === void 0 ? false : !e2 || new Date(e2).getTime() <= t2;
|
|
2564
2546
|
}
|
|
2565
|
-
|
|
2547
|
+
var dl = 864e5;
|
|
2548
|
+
function fl({ serviceId: e2, serviceType: t2, lastSessionEnd: n2, timeZone: r2, now: i2, onlyAvailableSlots: a2, locationId: o2, staffId: s2, timeSlotLimitPerDay: c2, customerChoices: l2, minRemainingCapacity: u2 }) {
|
|
2566
2549
|
let d2 = { serviceId: e2, onlyAvailableSlots: a2, locationId: o2 ?? void 0, staffId: s2 ?? void 0, timeZone: r2, fromLocalDate: No(new Date(i2), r2) };
|
|
2567
|
-
return Xa(t2) ? { ...d2, serviceType: `CLASS`, minRemainingCapacity: u2 } : Za(t2) ? !n2 ||
|
|
2550
|
+
return Xa(t2) ? { ...d2, serviceType: `CLASS`, minRemainingCapacity: u2 } : Za(t2) ? !n2 || ul(n2, i2) ? void 0 : { ...d2, serviceType: `COURSE`, toLocalDate: No(new Date(new Date(n2).getTime() + dl), r2) } : { ...d2, serviceType: `APPOINTMENT`, toLocalDate: hs().toLocalDate, timeSlotsPerDay: c2 + 1, customerChoices: l2 };
|
|
2568
2551
|
}
|
|
2569
|
-
function
|
|
2552
|
+
function pl({ isAppointment: e2, staffOnSlotCount: t2, hasStaffFilter: n2, hasRequestedGender: r2, hasStaffPricedVariants: i2, staffSelectionStrategy: a2 }) {
|
|
2570
2553
|
return e2 && t2 > 1 && !n2 && !i2 && (a2 !== `CUSTOMER_MUST_CHOOSE` || r2);
|
|
2571
2554
|
}
|
|
2572
|
-
function
|
|
2555
|
+
function ml(e2, t2) {
|
|
2573
2556
|
return e2.length ? e2.length === 1 ? { anyResource: false, staffMemberId: e2[0] } : t2 ? { anyResource: true } : null : null;
|
|
2574
2557
|
}
|
|
2575
|
-
function
|
|
2558
|
+
function hl(e2, t2, n2) {
|
|
2576
2559
|
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 };
|
|
2577
2560
|
}
|
|
2578
|
-
var
|
|
2579
|
-
function
|
|
2580
|
-
if (!e2) return
|
|
2561
|
+
var gl = { staff: null, requestedGender: null, locationId: null };
|
|
2562
|
+
function _l({ entry: e2, appointmentLike: t2, staffChoiceHidden: n2, staffPriced: r2, staffSelectionStrategy: i2, genderAllowed: a2, staffMemberIds: o2, locationIds: s2 }) {
|
|
2563
|
+
if (!e2) return gl;
|
|
2581
2564
|
let c2 = e2.locationId && s2.includes(e2.locationId) ? e2.locationId : null, l2 = t2 && !n2 ? oo(e2) : null;
|
|
2582
|
-
if (!l2) return { ...
|
|
2583
|
-
if (!l2.anyResource) return o2.includes(l2.staffMemberId) ? { staff: l2, requestedGender: null, locationId: c2 } : { ...
|
|
2565
|
+
if (!l2) return { ...gl, locationId: c2 };
|
|
2566
|
+
if (!l2.anyResource) return o2.includes(l2.staffMemberId) ? { staff: l2, requestedGender: null, locationId: c2 } : { ...gl, locationId: c2 };
|
|
2584
2567
|
let u2 = a2 ? e2.requestedGender ?? null : null;
|
|
2585
|
-
return o2.length > 1 && !r2 && (i2 !== `CUSTOMER_MUST_CHOOSE` || u2 !== null) ? { staff: l2, requestedGender: u2, locationId: c2 } : { ...
|
|
2568
|
+
return o2.length > 1 && !r2 && (i2 !== `CUSTOMER_MUST_CHOOSE` || u2 !== null) ? { staff: l2, requestedGender: u2, locationId: c2 } : { ...gl, locationId: c2 };
|
|
2586
2569
|
}
|
|
2587
|
-
var
|
|
2588
|
-
function
|
|
2589
|
-
let s2 = kl(
|
|
2590
|
-
return { rows: t2 ? c2 :
|
|
2570
|
+
var vl = [];
|
|
2571
|
+
function yl({ sessions: e2, dayQuery: t2, daySlots: n2, staffFilter: r2, appointmentLike: i2, limitPerDay: a2, expandedDates: o2 }) {
|
|
2572
|
+
let s2 = Ol(kl(e2, r2)), c2 = n2 ? kl(i2 ? Xo(n2) : n2, r2) : vl;
|
|
2573
|
+
return { rows: t2 ? c2 : Al(s2, a2, o2), slotIdOf: t2 ? qo : Yo, daysWithMore: Dl(s2, a2, o2) };
|
|
2591
2574
|
}
|
|
2592
|
-
function
|
|
2593
|
-
return [...e2.filter((e3) => t2(e3) === n2)].sort((e3, t3) =>
|
|
2575
|
+
function bl({ rows: e2, slotIdOf: t2 }, n2) {
|
|
2576
|
+
return [...e2.filter((e3) => t2(e3) === n2)].sort((e3, t3) => El(t3) - El(e3))[0] ?? null;
|
|
2594
2577
|
}
|
|
2595
|
-
function
|
|
2596
|
-
return { slotId: n2(e2), slotStartTime: e2.localStartDate ?? null, slotEndTime: e2.localEndDate ?? null, bookable: e2.bookable ?? false, tooEarlyToBook: e2.bookingPolicyViolations?.tooEarlyToBook ?? false, tooLateToBook: e2.bookingPolicyViolations?.tooLateToBook ?? false, totalCapacity: e2.totalCapacity ?? null, remainingCapacity: e2.remainingCapacity ?? null, bookableCapacity: e2.bookableCapacity ?? null, eventId: e2.eventInfo?.eventId ?? null, eventTitle: e2.eventInfo?.eventTitle ?? null, waitlistCapacity: e2.eventInfo?.waitingList?.remainingCapacity ?? null, locationId: e2.location?._id ?? null, locationName: e2.location?.name || e2.location?.formattedAddress || null, durationMinutes:
|
|
2578
|
+
function xl(e2, t2, n2, r2) {
|
|
2579
|
+
return { slotId: n2(e2), slotStartTime: e2.localStartDate ?? null, slotEndTime: e2.localEndDate ?? null, bookable: e2.bookable ?? false, tooEarlyToBook: e2.bookingPolicyViolations?.tooEarlyToBook ?? false, tooLateToBook: e2.bookingPolicyViolations?.tooLateToBook ?? false, totalCapacity: e2.totalCapacity ?? null, remainingCapacity: e2.remainingCapacity ?? null, bookableCapacity: e2.bookableCapacity ?? null, eventId: e2.eventInfo?.eventId ?? null, eventTitle: e2.eventInfo?.eventTitle ?? null, waitlistCapacity: e2.eventInfo?.waitingList?.remainingCapacity ?? null, locationId: e2.location?._id ?? null, locationName: e2.location?.name || e2.location?.formattedAddress || null, durationMinutes: Tl(e2, t2), isAllDay: e2.allDay ?? false, staff: r2 ? [] : Sl(e2) };
|
|
2597
2580
|
}
|
|
2598
|
-
function
|
|
2581
|
+
function Sl(e2) {
|
|
2599
2582
|
let t2 = /* @__PURE__ */ new Map();
|
|
2600
2583
|
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 ?? ``);
|
|
2601
2584
|
return [...t2].map(([e3, t3]) => ({ staffMemberId: e3, name: t3 }));
|
|
2602
2585
|
}
|
|
2603
|
-
function
|
|
2604
|
-
let t2 =
|
|
2586
|
+
function Cl(e2) {
|
|
2587
|
+
let t2 = Sl(e2);
|
|
2605
2588
|
if (t2.length) return t2.length === 1 ? t2[0].staffMemberId : null;
|
|
2606
2589
|
}
|
|
2607
|
-
function
|
|
2608
|
-
return
|
|
2590
|
+
function wl(e2) {
|
|
2591
|
+
return Sl(e2).map((e3) => e3.staffMemberId);
|
|
2609
2592
|
}
|
|
2610
|
-
function
|
|
2593
|
+
function Tl(e2, t2) {
|
|
2611
2594
|
if (!e2.localStartDate || !e2.localEndDate) return null;
|
|
2612
|
-
let n2 = e2.allDay ? `UTC` : t2 ?? `UTC`, r2 =
|
|
2595
|
+
let n2 = e2.allDay ? `UTC` : t2 ?? `UTC`, r2 = Nc(e2.localStartDate, n2), i2 = Nc(e2.localEndDate, n2);
|
|
2613
2596
|
return !r2 || !i2 || i2 < r2 ? null : Math.round((i2.getTime() - r2.getTime()) / 6e4);
|
|
2614
2597
|
}
|
|
2615
|
-
function
|
|
2598
|
+
function El(e2) {
|
|
2616
2599
|
let t2 = e2.bookableCapacity ?? e2.remainingCapacity;
|
|
2617
2600
|
return (e2.eventInfo?.waitingList?.remainingCapacity ?? 0) > 0 && (t2 ?? 0) <= 0 ? 1 : e2.bookable ? 2 : 0;
|
|
2618
2601
|
}
|
|
2619
|
-
function
|
|
2602
|
+
function Dl(e2, t2, n2) {
|
|
2620
2603
|
let r2 = /* @__PURE__ */ new Map();
|
|
2621
2604
|
for (let t3 of e2) {
|
|
2622
2605
|
let e3 = (t3.localStartDate ?? ``).slice(0, 10);
|
|
@@ -2624,16 +2607,16 @@ function Ol(e2, t2, n2) {
|
|
|
2624
2607
|
}
|
|
2625
2608
|
return new Set([...r2].filter(([e3, r3]) => r3 > t2 && !n2.has(e3)).map(([e3]) => e3));
|
|
2626
2609
|
}
|
|
2627
|
-
function
|
|
2610
|
+
function Ol(e2) {
|
|
2628
2611
|
return e2.flatMap((e3) => {
|
|
2629
2612
|
let t2 = e3.availableResources?.find((e4) => e4.resourceTypeId === Wr), n2 = t2?.resources ?? [];
|
|
2630
2613
|
return n2.length <= 1 ? [e3] : n2.map((n3) => ({ ...e3, availableResources: [{ ...t2, resources: [n3] }] }));
|
|
2631
2614
|
});
|
|
2632
2615
|
}
|
|
2633
|
-
function
|
|
2616
|
+
function kl(e2, t2) {
|
|
2634
2617
|
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;
|
|
2635
2618
|
}
|
|
2636
|
-
function
|
|
2619
|
+
function Al(e2, t2, n2) {
|
|
2637
2620
|
let r2 = /* @__PURE__ */ new Map();
|
|
2638
2621
|
return e2.filter((e3) => {
|
|
2639
2622
|
let i2 = (e3.localStartDate ?? ``).slice(0, 10);
|
|
@@ -2642,24 +2625,24 @@ function jl(e2, t2, n2) {
|
|
|
2642
2625
|
return r2.set(i2, a2 + 1), a2 < t2;
|
|
2643
2626
|
});
|
|
2644
2627
|
}
|
|
2645
|
-
async function
|
|
2628
|
+
async function jl() {
|
|
2646
2629
|
try {
|
|
2647
|
-
return await
|
|
2630
|
+
return await Ko();
|
|
2648
2631
|
} catch (e2) {
|
|
2649
2632
|
return $(e2, { feature: Q.timeSlots, action: `fetch-business-time-zone`, level: `warning` }), { businessTimeZone: null, staffSelectionStrategy: void 0, allowGenderSelection: false };
|
|
2650
2633
|
}
|
|
2651
2634
|
}
|
|
2652
|
-
function
|
|
2653
|
-
return
|
|
2635
|
+
function Ml(e2) {
|
|
2636
|
+
return Xs({ key: zs(), warmupData: e2, fetchData: jl });
|
|
2654
2637
|
}
|
|
2655
|
-
function
|
|
2638
|
+
function Nl(e2) {
|
|
2656
2639
|
return (e2.localStartDate ?? ``).slice(0, 10);
|
|
2657
2640
|
}
|
|
2658
|
-
var
|
|
2659
|
-
function
|
|
2660
|
-
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,
|
|
2641
|
+
var Pl = [];
|
|
2642
|
+
function Fl(e2, t2) {
|
|
2643
|
+
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);
|
|
2661
2644
|
a(() => {
|
|
2662
|
-
if (_2([]), y2([]), x2(1), E2(null), T2(null),
|
|
2645
|
+
if (_2([]), y2([]), x2(1), E2(null), T2(null), te2(/* @__PURE__ */ new Set()), O2(null), C2(!!n2), !n2) return;
|
|
2663
2646
|
let t3 = false, a2 = false, s2 = [], c2 = [];
|
|
2664
2647
|
async function g3(g4) {
|
|
2665
2648
|
if (t3 || a2) return;
|
|
@@ -2674,7 +2657,7 @@ function Il(e2, t2) {
|
|
|
2674
2657
|
let a3 = [], b3 = null, S3 = v4 ?? void 0, C3 = /* @__PURE__ */ new Set();
|
|
2675
2658
|
do {
|
|
2676
2659
|
S3 && C3.add(S3);
|
|
2677
|
-
let s3 = await
|
|
2660
|
+
let s3 = await ds({ 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 });
|
|
2678
2661
|
if (t3) return;
|
|
2679
2662
|
if (a3.push(...s3.timeSlots), b3 = s3.nextCursor, b3 && C3.has(b3)) throw Error(`The session API repeated a page cursor`);
|
|
2680
2663
|
S3 = b3 ?? void 0, E2(s3.timeZone ?? l2 ?? null);
|
|
@@ -2691,205 +2674,204 @@ function Il(e2, t2) {
|
|
|
2691
2674
|
async function v3(e3) {
|
|
2692
2675
|
if (!(t3 || a2)) {
|
|
2693
2676
|
if (h2 == null) {
|
|
2694
|
-
|
|
2677
|
+
te2((t4) => /* @__PURE__ */ new Set([...t4, e3]));
|
|
2695
2678
|
return;
|
|
2696
2679
|
}
|
|
2697
|
-
a2 = true,
|
|
2680
|
+
a2 = true, O2(e3), T2(null);
|
|
2698
2681
|
try {
|
|
2699
|
-
let a3 = await
|
|
2682
|
+
let a3 = await vs({ serviceId: n2, serviceType: r2, date: e3, timeZone: l2, onlyAvailableSlots: f2, locationId: u2, staffId: d2, customerChoices: p2, minRemainingCapacity: m2, fromLocalDate: i2, toLocalDate: o2 });
|
|
2700
2683
|
if (t3) return;
|
|
2701
|
-
let c3 = a3.timeSlots.filter((t4) =>
|
|
2684
|
+
let c3 = a3.timeSlots.filter((t4) => Nl(t4) === e3), h3 = Math.max(0, s2.findIndex((t4) => t4.some((t5) => Nl(t5) === e3)));
|
|
2702
2685
|
s2 = s2.map((t4, n3) => {
|
|
2703
|
-
let r3 = t4.filter((t5) =>
|
|
2686
|
+
let r3 = t4.filter((t5) => Nl(t5) !== e3);
|
|
2704
2687
|
return n3 === h3 ? [...r3, ...c3] : r3;
|
|
2705
|
-
}), _2(s2),
|
|
2688
|
+
}), _2(s2), te2((t4) => /* @__PURE__ */ new Set([...t4, e3]));
|
|
2706
2689
|
} catch (e4) {
|
|
2707
2690
|
if (t3) return;
|
|
2708
2691
|
$(e4, { feature: Q.sessions, action: `fetch-day` }), T2(e4 instanceof Error ? e4.message : `Failed to load sessions`);
|
|
2709
2692
|
} finally {
|
|
2710
|
-
a2 = false, t3 ||
|
|
2693
|
+
a2 = false, t3 || O2(null);
|
|
2711
2694
|
}
|
|
2712
2695
|
}
|
|
2713
2696
|
}
|
|
2714
|
-
return
|
|
2715
|
-
t3 = true,
|
|
2697
|
+
return k2.current = g3, re2.current = v3, g3(1), () => {
|
|
2698
|
+
t3 = true, k2.current = null, re2.current = null;
|
|
2716
2699
|
};
|
|
2717
2700
|
}, [n2, r2, i2, o2, l2, u2, d2, f2, p2, m2, h2, e2]);
|
|
2718
|
-
let
|
|
2719
|
-
async function
|
|
2720
|
-
|
|
2701
|
+
let ie2 = [...g2[b2 - 1] ?? Pl].sort((e3, t3) => (e3.localStartDate ?? ``).localeCompare(t3.localStartDate ?? ``)), A2 = g2[b2], ae2 = A2 ? A2.length > 0 : v2[b2 - 1] != null, j2 = b2 > 1;
|
|
2702
|
+
async function oe2() {
|
|
2703
|
+
ae2 && !S2 && await k2.current?.(b2 + 1);
|
|
2721
2704
|
}
|
|
2722
|
-
function
|
|
2723
|
-
|
|
2705
|
+
function M2() {
|
|
2706
|
+
j2 && !S2 && k2.current?.(b2 - 1);
|
|
2724
2707
|
}
|
|
2725
2708
|
async function se2(e3) {
|
|
2726
|
-
S2 ||
|
|
2709
|
+
S2 || ne2 !== null || D2.has(e3) || await re2.current?.(e3);
|
|
2727
2710
|
}
|
|
2728
|
-
return { isLoadingPage: S2, firstPageSettled: g2.length > 0 || w2 !== null, error: w2, timeZone: ee2, sessions:
|
|
2711
|
+
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 };
|
|
2729
2712
|
}
|
|
2730
|
-
var
|
|
2731
|
-
function
|
|
2713
|
+
var Il = (e2) => e2?.onlineBooking?.enabled === true;
|
|
2714
|
+
function Ll(e2, t2) {
|
|
2732
2715
|
return e2 ? e2.anyResource ? t2 ?? `` : e2.staffMemberId : null;
|
|
2733
2716
|
}
|
|
2717
|
+
var Rl = [];
|
|
2734
2718
|
var zl = [];
|
|
2735
|
-
var Bl =
|
|
2736
|
-
var Vl =
|
|
2737
|
-
var Hl = { isSelectionValidated: false };
|
|
2738
|
-
var Ul = () => {
|
|
2719
|
+
var Bl = cn.map((e2) => ({ id: e2, gender: e2 }));
|
|
2720
|
+
var Vl = () => {
|
|
2739
2721
|
};
|
|
2740
|
-
var
|
|
2722
|
+
var Hl = async () => {
|
|
2741
2723
|
};
|
|
2742
|
-
var
|
|
2743
|
-
function
|
|
2744
|
-
let e2 = i(
|
|
2724
|
+
var Ul = n(null);
|
|
2725
|
+
function Wl() {
|
|
2726
|
+
let e2 = i(Ul);
|
|
2745
2727
|
if (!e2) throw Error(`useTimeSlotsContext must be used within TimeSlotsContextProvider`);
|
|
2746
2728
|
return e2;
|
|
2747
2729
|
}
|
|
2748
|
-
function
|
|
2730
|
+
function Gl(e2, t2, n2) {
|
|
2749
2731
|
e2 ? t2() : n2();
|
|
2750
2732
|
}
|
|
2751
|
-
var
|
|
2752
|
-
function
|
|
2753
|
-
return Math.min(Math.max(e2, 1),
|
|
2733
|
+
var Kl = { loginRequired: `rescheduleLoginRequired`, notFound: `rescheduleNotFound`, accessDenied: `rescheduleAccessDenied`, failed: `rescheduleNotFound`, wrongService: `rescheduleNotFound`, notReschedulable: `rescheduleNotReschedulable` };
|
|
2734
|
+
function ql(e2 = 3) {
|
|
2735
|
+
return Math.min(Math.max(e2, 1), sc);
|
|
2754
2736
|
}
|
|
2755
|
-
function
|
|
2737
|
+
function Jl(e2) {
|
|
2756
2738
|
let { isLoading: n2, bookingsSettingsLoading: r2 } = u();
|
|
2757
|
-
|
|
2758
|
-
let i2 =
|
|
2759
|
-
return p(
|
|
2739
|
+
kc(Cc.TIME_SLOTS, !n2 && !r2);
|
|
2740
|
+
let i2 = Is(), [a2] = c(() => Ml(i2));
|
|
2741
|
+
return p(oc, { children: p(t, { fallback: p(Ic, { nextAvailableSlotsCount: ql(e2.nextAvailableSlotsCount), children: e2.children }), children: p(Xl, { ...e2, configurationPromise: a2 }) }) });
|
|
2760
2742
|
}
|
|
2761
|
-
function
|
|
2743
|
+
function Yl(e2) {
|
|
2762
2744
|
let [t2, n2] = c({ serviceId: e2, key: 0 });
|
|
2763
2745
|
return e2 !== t2.serviceId && n2({ serviceId: e2, key: t2.serviceId ? t2.key + 1 : t2.key }), t2.key;
|
|
2764
2746
|
}
|
|
2765
|
-
function
|
|
2766
|
-
let s2 =
|
|
2747
|
+
function Xl({ onlyAvailableSlots: e2 = true, nextAvailableSlotsCount: t2 = 3, loadDaysAvailabilityInitially: n2 = false, timeSlotLimitPerDay: r2 = 100, configurationPromise: i2, children: o2 }) {
|
|
2748
|
+
let s2 = nc().isLoading, { searchParams: d2 } = vc(), { reschedule: f2 } = u(), [m2] = c(() => ({ locationId: d2.get(eo.location), staffId: d2.get(eo.resource), timeZone: (f2 ? void 0 : Pr(d2.get(eo.blob))?.timezone) ?? d2.get(eo.timezone) })), [h2, g2] = c(m2.timeZone), _2 = ql(t2), [v2, y2] = c(false);
|
|
2767
2749
|
a(() => y2(true), []);
|
|
2768
2750
|
let b2 = v2 && !s2;
|
|
2769
|
-
|
|
2770
|
-
let x2 =
|
|
2771
|
-
return p(
|
|
2751
|
+
ll(b2);
|
|
2752
|
+
let x2 = js(i2), S2 = l(os, as, () => false), { serviceId: C2 } = u(), w2 = Yl(C2), T2 = Number.isFinite(r2) ? Math.max(1, Math.floor(r2)) : 100;
|
|
2753
|
+
return p(cc, { fallback: p(Lc, { nextAvailableSlotsCount: _2, children: o2 }), feature: Q.timeSlots, children: p(Zl, { 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);
|
|
2772
2754
|
}
|
|
2773
|
-
function
|
|
2774
|
-
let { service: x2, serviceId: S2, serviceType: C2, setSlot: w2, clearSlot: T2, setMultiServiceSlot: ee2, clearMultiServiceSlot: E2, draftRevision: D2, navigateToMultiServiceForm:
|
|
2755
|
+
function Zl({ 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 }) {
|
|
2756
|
+
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 = zl, reschedule: se2 } = u(), N2 = se2 != null, ce2 = N2 && se2.status !== `ready`, le2 = N2 && se2.status === `loading`, ue2 = N2 ? Kl[se2.status] : void 0, de2 = ce2 ? null : se2?.booking ?? null, fe2 = de2 ? se2.validUntil : null, pe2 = ol(x2) && !Il(x2), P2 = pe2 || ce2 ? null : S2, me2 = vc(), he2 = N2 ? null : me2.searchParams.get(eo.blob), ge2 = o(() => io(Pr(he2)), [he2]), F2 = !S2 && !j2 && !oe2 && (ge2.valid || ge2.reason !== `too-few-services`), _e2 = F2 && ge2.valid && M2.some((e3) => !Il(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 = ic(), Te2 = nc(), { navigate: Ee2, resolvePath: De2 } = go(), [Oe2, ke2] = c(null), [Ae2, je2] = c(false), Me2 = s([]), Ne2 = s(false), Pe2 = r(() => (je2(true), Ne2.current ? Promise.resolve() : new Promise((e3) => {
|
|
2775
2757
|
Me2.current.push(e3);
|
|
2776
|
-
})), []), Fe2 = i2 ? Intl.DateTimeFormat().resolvedOptions().timeZone : null, Ie2 = Ja(x2), Le2 = s(null), Re2 = oo(
|
|
2758
|
+
})), []), Fe2 = i2 ? Intl.DateTimeFormat().resolvedOptions().timeZone : null, Ie2 = Ja(x2), Le2 = s(null), Re2 = oo(ne2), ze2 = s(Re2);
|
|
2777
2759
|
ze2.current = Re2;
|
|
2778
|
-
let Be2 = Re2 && !Re2.anyResource ? Re2.staffMemberId : null, Ve2 =
|
|
2760
|
+
let Be2 = Re2 && !Re2.anyResource ? Re2.staffMemberId : null, Ve2 = ne2.requestedGender ?? null, I2 = !Xa(C2) && !Za(C2), He2 = I2 && !F2 && bs(ae2), L2 = F2 || I2 && _2 === `CUSTOMER_CANNOT_CHOOSE`, Ue2 = _2 !== void 0, We2 = Go({ allowGenderSelection: v2, staffSelectionStrategy: _2 ?? null }) && I2 && !F2 && !He2, Ge2 = We2 && !y2, Ke2 = o(() => P2 ? Pr(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(() => _l({ 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), z2 = o(() => x2 ? Os(x2) : [], [x2]), nt2 = R2 && !R2.anyResource ? R2.staffMemberId : null, rt2 = o(() => {
|
|
2779
2761
|
if (!nt2) return z2;
|
|
2780
2762
|
let e3 = z2.find((e4) => e4.staffMemberId === nt2);
|
|
2781
2763
|
return e3 ? [e3] : z2;
|
|
2782
2764
|
}, [z2, nt2]), it2 = de2?.locationId ?? null, at2 = o(() => {
|
|
2783
|
-
let e3 =
|
|
2765
|
+
let e3 = Ds(Ie2, rt2);
|
|
2784
2766
|
return !it2 || e3.some((e4) => e4.id === it2) ? e3 : Ie2.filter((t3) => t3.id === it2 || e3.some((e4) => e4.id === t3.id));
|
|
2785
|
-
}, [x2, rt2, it2]), ot2 = (e3) => !!e3 && at2.some((t3) => t3.id === e3), st2 = Qe2 ?? (et2 ? ot2(it2) ? it2 : m2 : null), ct2 = Ie2.length > 1 && at2.length === 1 ? at2[0].id : null, B2 = Xe2 ?? (ot2(st2) ? st2 : ct2), lt2 = o(() => Xe2 ? [] : at2.map((e3) => ({ id: e3.id, name: e3.label })), [at2, Xe2]), ut2 = o(() => new Map(z2.map((e3) => [e3.staffMemberId, e3.locationCoverage])), [z2]), dt2 = r((e3, t3) =>
|
|
2767
|
+
}, [x2, rt2, it2]), ot2 = (e3) => !!e3 && at2.some((t3) => t3.id === e3), st2 = Qe2 ?? (et2 ? ot2(it2) ? it2 : m2 : null), ct2 = Ie2.length > 1 && at2.length === 1 ? at2[0].id : null, B2 = Xe2 ?? (ot2(st2) ? st2 : ct2), lt2 = o(() => Xe2 ? [] : at2.map((e3) => ({ id: e3.id, name: e3.label })), [at2, Xe2]), ut2 = o(() => new Map(z2.map((e3) => [e3.staffMemberId, e3.locationCoverage])), [z2]), dt2 = r((e3, t3) => ws([{ staffMemberId: e3, locationCoverage: ut2.get(e3) }], t3).length === 1, [ut2]), ft2 = o(() => Ze2 ? [] : (A2 ?? []).filter((e3) => e3.name).map((e3) => ({ id: e3.staffMemberId, name: e3.name ?? ``, gender: null })), [A2, Ze2]), pt2 = o(() => B2 ? ft2.filter((e3) => dt2(e3.id, B2)) : ft2, [ft2, B2, dt2]), mt2 = I2 && !Ue2 ? Rl : pt2, ht2 = I2 && !Ue2 ? 0 : ft2.length, gt2 = Ge2 && ht2 > 1, _t2 = o(() => gt2 ? [...Bl, ...mt2] : mt2, [gt2, mt2]), [vt2, yt2] = c(null), [bt2, xt2] = c(h2 !== null);
|
|
2786
2768
|
bt2 && h2 !== null && B2 !== null && !dt2(h2, B2) && xt2(false);
|
|
2787
2769
|
let St2 = vt2 ?? (bt2 ? h2 : null), V2 = R2 ? R2.anyResource ? null : R2.staffMemberId : St2 !== null && pt2.some((e3) => e3.id === St2) ? St2 : null, Ct2 = Re2?.anyResource ? Ve2 : null, [wt2, Tt2] = c(Ct2), [Et2, Dt2] = c(Ct2);
|
|
2788
2770
|
!y2 && Re2?.anyResource && Ve2 !== Et2 && (Dt2(Ve2), Tt2(Ve2));
|
|
2789
2771
|
let Ot2 = R2 ? Ye2.requestedGender : We2 && ht2 > 1 && V2 === null ? wt2 : null, kt2 = y2 ? null : Ot2, At2 = r((e3) => {
|
|
2790
|
-
ze2.current = e3, e3 ? e3.anyResource ?
|
|
2791
|
-
}, [
|
|
2772
|
+
ze2.current = e3, e3 ? e3.anyResource ? k2(kt2 ?? void 0) : O2(e3.staffMemberId) : re2();
|
|
2773
|
+
}, [re2, k2, O2, kt2]), jt2 = r((e3) => At2(e3 ? { anyResource: false, staffMemberId: e3 } : { anyResource: true }), [At2]), Mt2 = (de2?.addOnIds ?? []).filter((e3) => x2?.addOnGroups?.some((t3) => t3.addOnIds?.includes(e3))), Nt2 = de2 && Xa(C2) ? de2.participants : null, Pt2 = I2 ? to(ne2) : null, { addOnIds: Ft2, ...It2 } = Pt2 ?? {}, Lt2 = I2 && de2 ? Mt2.length ? { ...It2, addOnIds: Mt2 } : It2 : Pt2, Rt2 = Lt2 ? $o(Lt2) : void 0, zt2 = JSON.stringify(Ot2 ? { ...Rt2, requestedGender: { gender: Ot2 } } : Rt2 ?? null), Bt2 = o(() => JSON.parse(zt2), [zt2]), Vt2 = R2?.anyResource === true, Ht2 = r((e3) => Vt2 || _2 !== void 0 && pl({ isAppointment: I2, staffOnSlotCount: e3, hasStaffFilter: V2 !== null, hasRequestedGender: kt2 !== null, hasStaffPricedVariants: He2, staffSelectionStrategy: _2 }), [Vt2, I2, _2, V2, kt2, He2]), Ut2 = r((e3) => R2 ?? (L2 ? null : e3), [R2, L2]), Wt2 = r((e3) => {
|
|
2792
2774
|
let t3 = e3 === null ? null : _t2.find((t4) => t4.id === e3);
|
|
2793
2775
|
t3 !== void 0 && (xt2(false), yt2(t3 && !t3.gender ? t3.id : null), Tt2(t3?.gender ?? null));
|
|
2794
2776
|
}, [_t2]), Gt2 = r((e3) => {
|
|
2795
2777
|
(e3 === null || at2.some((t3) => t3.id === e3)) && (tt2(false), $e2(e3), St2 !== null && e3 !== null && !dt2(St2, e3) && (yt2(null), xt2(false)));
|
|
2796
2778
|
}, [at2, St2, dt2]), Kt2 = !!(i2 && !Te2.isLoading && Te2.displayTimeZonePolicy.customerCanChange && g2 && Fe2 && g2 !== Fe2), H2 = i2 ? Kt2 && t2 && (t2 === g2 || t2 === Fe2) ? t2 : we2 ?? g2 ?? Fe2 : null, qt2 = r((e3) => {
|
|
2797
2779
|
Kt2 && (e3 === g2 || e3 === Fe2) && n2(e3);
|
|
2798
|
-
}, [Kt2, g2, Fe2, n2]), Jt2 = o(() => i2 && !
|
|
2780
|
+
}, [Kt2, g2, Fe2, n2]), Jt2 = o(() => i2 && !j2 && xe2 ? Date.now() : void 0, [i2, j2, P2, be2, H2]), Yt2 = Jt2 !== void 0 && H2 ? Ao(new Date(Jt2), H2) : null, { range: Xt2, daysAvailability: Zt2, isLoading: Qt2, hasError: $t2, setRange: en2 } = $c({ enabled: i2, serviceId: P2, serviceType: C2, multiServiceRequest: be2, timeZone: H2, today: Yt2, locationId: B2, staffId: V2, customerChoices: Bt2, minRemainingCapacity: Nt2, loadInitially: d2, onlyAvailableSlots: e2 }), tn2 = fe2?.slice(0, 10) ?? null, nn2 = o(() => tn2 ? Zt2.map((e3) => e3.date > tn2 ? { ...e3, availability: `none` } : e3) : Zt2, [Zt2, tn2]), rn2 = fe2 && H2 ? No(new Date(fe2), H2) : null, { query: U2, selectedDate: an2, timeSlots: on2, isLoading: sn2, error: cn2, selectDate: ln2, findNextAvailableDate: un2 } = el({ enabled: i2, serviceId: P2, serviceType: C2, multiServiceRequest: be2, timeZone: H2, today: Yt2, locationId: B2, staffId: V2, customerChoices: Bt2, minRemainingCapacity: Nt2, onlyAvailableSlots: e2, serviceLoading: j2 || le2 }), dn2 = s(true), fn2 = s(null);
|
|
2799
2781
|
a(() => {
|
|
2800
|
-
if (
|
|
2801
|
-
|
|
2782
|
+
if (dn2.current) {
|
|
2783
|
+
dn2.current = false;
|
|
2802
2784
|
return;
|
|
2803
2785
|
}
|
|
2804
|
-
ke2(null), Le2.current &&
|
|
2786
|
+
ke2(null), Le2.current && Gl(P2, T2, E2), Le2.current = null, fn2.current = null;
|
|
2805
2787
|
}, [U2, be2, H2, B2, V2, Bt2, Nt2, e2, l2, f2, D2]);
|
|
2806
|
-
let
|
|
2807
|
-
let e3 = await
|
|
2808
|
-
return e3.outcome === `found` ?
|
|
2809
|
-
}, [
|
|
2810
|
-
|
|
2811
|
-
let e3 =
|
|
2812
|
-
return
|
|
2813
|
-
}, []),
|
|
2814
|
-
|
|
2815
|
-
}, [
|
|
2816
|
-
let t3 =
|
|
2817
|
-
|
|
2818
|
-
|
|
2788
|
+
let pn2 = r(async () => {
|
|
2789
|
+
let e3 = await un2();
|
|
2790
|
+
return e3.outcome === `found` ? tn2 && e3.date > tn2 ? `none` : (await Promise.all([ln2(e3.date), Xt2 && Ho(e3.date, Xt2) ? Promise.resolve() : en2(Vo(e3.date))]), `found`) : e3.outcome;
|
|
2791
|
+
}, [un2, tn2, ln2, Xt2, en2]), mn2 = !!(i2 && !j2 && xe2 && H2 && Yt2), hn2 = i2 && !j2 && !le2 && !xe2, [gn2, W2] = c(false), [_n2, vn2] = c(0), yn2 = s(false), bn2 = s([]), xn2 = s(0), Sn2 = r(() => {
|
|
2792
|
+
W2(false);
|
|
2793
|
+
let e3 = bn2.current;
|
|
2794
|
+
return bn2.current = [], e3;
|
|
2795
|
+
}, []), Cn2 = r(() => {
|
|
2796
|
+
xn2.current += 1, Sn2().forEach((e3) => e3(`cancelled`));
|
|
2797
|
+
}, [Sn2]), wn2 = r((e3) => (Cn2(), ln2(e3)), [Cn2, ln2]), Tn2 = r((e3) => {
|
|
2798
|
+
let t3 = xn2.current;
|
|
2799
|
+
yn2.current = true, pn2().then((n3) => {
|
|
2800
|
+
yn2.current = false, n3 === `cancelled` && t3 === xn2.current ? (bn2.current.unshift(...e3), W2(true)) : e3.forEach((e4) => e4(n3)), vn2((e4) => e4 + 1);
|
|
2819
2801
|
});
|
|
2820
|
-
}, [
|
|
2821
|
-
if (
|
|
2822
|
-
|
|
2802
|
+
}, [pn2]), En2 = r(() => hn2 ? Promise.resolve(`none`) : new Promise((e3) => {
|
|
2803
|
+
if (mn2 && !yn2.current) {
|
|
2804
|
+
Tn2([...Sn2(), e3]);
|
|
2823
2805
|
return;
|
|
2824
2806
|
}
|
|
2825
|
-
|
|
2826
|
-
}), [
|
|
2807
|
+
bn2.current.push(e3), W2(true);
|
|
2808
|
+
}), [hn2, mn2, Tn2, Sn2]);
|
|
2827
2809
|
a(() => {
|
|
2828
|
-
if (
|
|
2829
|
-
if (
|
|
2830
|
-
|
|
2810
|
+
if (gn2 && !yn2.current) {
|
|
2811
|
+
if (hn2) {
|
|
2812
|
+
Sn2().forEach((e3) => e3(`none`));
|
|
2831
2813
|
return;
|
|
2832
2814
|
}
|
|
2833
|
-
|
|
2815
|
+
mn2 && Tn2(Sn2());
|
|
2834
2816
|
}
|
|
2835
|
-
}, [
|
|
2836
|
-
let
|
|
2837
|
-
Ne2.current =
|
|
2838
|
-
if (!
|
|
2817
|
+
}, [gn2, _n2, mn2, hn2, Tn2, Sn2]);
|
|
2818
|
+
let Dn2 = x2?.schedule?.lastSessionEnd, On2 = I2 || Xa(C2) || Za(C2) && !ul(Dn2, Jt2), kn2 = !!(Ae2 && i2 && !j2 && P2 && H2 && Jt2 !== void 0), An2 = kn2 && P2 && H2 && Jt2 !== void 0 ? fl({ serviceId: P2, serviceType: C2, lastSessionEnd: Dn2, timeZone: H2, now: Jt2, onlyAvailableSlots: e2, locationId: B2, staffId: V2, timeSlotLimitPerDay: f2, customerChoices: Bt2, minRemainingCapacity: Nt2 }) : void 0, G2 = Fl(l2, An2), jn2 = Ae2 && P2 && On2 && !(Ae2 && P2 && On2 && (!i2 || j2)) && !H2, Mn2 = ve2 ? `onlineBookingOff` : ue2 ?? (G2.error === null ? jn2 ? `timeZoneMissing` : null : `upcomingSlotsLoadFailed`), Nn2 = U2 !== null, Pn2 = o(() => yl({ sessions: G2.sessions, dayQuery: Nn2, daySlots: on2, staffFilter: V2, appointmentLike: I2, limitPerDay: f2, expandedDates: G2.expandedDates }), [G2.sessions, Nn2, on2, V2, I2, f2, G2.expandedDates]), { slotIdOf: Fn2 } = Pn2, In2 = Ae2 && (An2 ? G2.firstPageSettled : kn2 || i2 && !j2 && !P2 || jn2);
|
|
2819
|
+
Ne2.current = In2, a(() => {
|
|
2820
|
+
if (!In2) return;
|
|
2839
2821
|
let e3 = Me2.current;
|
|
2840
2822
|
Me2.current = [], e3.forEach((e4) => e4());
|
|
2841
|
-
}, [
|
|
2842
|
-
let
|
|
2823
|
+
}, [In2]);
|
|
2824
|
+
let Ln2 = Ae2 && !In2 || G2.isLoadingPage, Rn2 = Mn2 !== null, zn2 = U2 ? sn2 : Ln2 || sn2 || !i2 || xe2 && !H2 || gn2 || le2, Bn2 = U2 ? cn2 : cn2 ?? Mn2, Vn2 = U2 ? cn2 !== null : Rn2 || cn2 !== null, Hn2 = Oc(Cc.TIME_SLOTS), Un2 = s(false), K2 = r((e3, t3) => {
|
|
2843
2825
|
if (!t3.bookable) {
|
|
2844
|
-
|
|
2826
|
+
fn2.current = null;
|
|
2845
2827
|
return;
|
|
2846
2828
|
}
|
|
2847
|
-
if (e3 ===
|
|
2848
|
-
|
|
2849
|
-
let n3 = P2 ?? t3.serviceId ?? t3.nestedTimeSlots?.[0]?.serviceId ?? void 0, r2 = C2 ??
|
|
2850
|
-
!
|
|
2851
|
-
}, [
|
|
2829
|
+
if (e3 === fn2.current) return;
|
|
2830
|
+
fn2.current = e3;
|
|
2831
|
+
let n3 = P2 ?? t3.serviceId ?? t3.nestedTimeSlots?.[0]?.serviceId ?? void 0, r2 = C2 ?? M2.find((e4) => e4._id === n3)?.type ?? void 0;
|
|
2832
|
+
!Un2.current && !N2 && Hn2(xc({ bookingsServiceId: n3, serviceType: r2, isEligibleForFlowCompletion: true })), Un2.current = true, Hn2(jc({ component: Ec.TIME_PICKER, element: Dc.TIME_SLOT, properties: JSON.stringify({ selectedTime: t3.localStartDate }) }));
|
|
2833
|
+
}, [Hn2, P2, C2, M2, N2]), Wn2 = r((e3) => {
|
|
2852
2834
|
if (e3 === null) {
|
|
2853
2835
|
let e4 = Le2.current !== null;
|
|
2854
|
-
Le2.current = null,
|
|
2836
|
+
Le2.current = null, fn2.current = null, ke2(null), e4 && Gl(P2, T2, E2);
|
|
2855
2837
|
return;
|
|
2856
2838
|
}
|
|
2857
|
-
let t3 =
|
|
2839
|
+
let t3 = bl(Pn2, e3);
|
|
2858
2840
|
if (!t3) return;
|
|
2859
2841
|
if (F2) {
|
|
2860
2842
|
if (!ee2(t3.nestedTimeSlots ?? [], H2 ?? void 0)) return;
|
|
2861
|
-
Le2.current = t3, ke2(t3),
|
|
2843
|
+
Le2.current = t3, ke2(t3), K2(e3, t3);
|
|
2862
2844
|
return;
|
|
2863
2845
|
}
|
|
2864
|
-
Le2.current = t3, ke2(t3),
|
|
2865
|
-
let n3 =
|
|
2866
|
-
if (w2(
|
|
2846
|
+
Le2.current = t3, ke2(t3), K2(e3, t3);
|
|
2847
|
+
let n3 = wl(t3);
|
|
2848
|
+
if (w2(ys(t3), { staffId: I2 ? void 0 : Cl(t3), timezone: H2 ?? void 0, bookable: t3.bookable, staffChoiceRequired: I2 && Ue2 && !L2 && n3.length > 1 && !Ht2(n3.length), rescheduleStaffId: I2 && (_2 !== `CUSTOMER_MAY_CHOOSE` || !Ht2(n3.length)) ? n3[0] : void 0 }), !I2) return;
|
|
2867
2849
|
let r2 = ze2.current, i3;
|
|
2868
|
-
i3 = R2 || (V2 && n3.includes(V2) ? { anyResource: false, staffMemberId: V2 } : kt2 !== null && Ht2(n3.length) ? { anyResource: true } :
|
|
2869
|
-
}, [F2, P2, T2, E2, ee2, w2,
|
|
2850
|
+
i3 = R2 || (V2 && n3.includes(V2) ? { anyResource: false, staffMemberId: V2 } : kt2 !== null && Ht2(n3.length) ? { anyResource: true } : ml(n3, Ue2 && Ht2(n3.length))), Ll(i3, kt2) !== Ll(r2, Ve2) && At2(i3);
|
|
2851
|
+
}, [F2, P2, T2, E2, ee2, w2, Pn2, K2, H2, I2, Ue2, _2, Ht2, R2, V2, kt2, Ve2, At2]), Gn2 = r(() => {
|
|
2870
2852
|
let e3 = Le2.current;
|
|
2871
|
-
if (!e3 || N2) return;
|
|
2853
|
+
if (!e3 || N2 || !e3.bookable) return;
|
|
2872
2854
|
if (F2) {
|
|
2873
|
-
|
|
2855
|
+
te2(Hn2);
|
|
2874
2856
|
return;
|
|
2875
2857
|
}
|
|
2876
2858
|
if (!P2) return;
|
|
2877
2859
|
let t3;
|
|
2878
2860
|
if (I2) {
|
|
2879
|
-
let n4 =
|
|
2861
|
+
let n4 = wl(e3), r2 = hl(n4, Ut2(ze2.current), Ht2(n4.length));
|
|
2880
2862
|
t3 = (r2.isComplete ? r2.resourceId : n4[0]) ?? (n4.length ? null : void 0);
|
|
2881
2863
|
}
|
|
2882
2864
|
let n3 = De2(`bookingForm`, { slug: x2?.mainSlug?.name ?? null, serviceId: P2 });
|
|
2883
|
-
|
|
2884
|
-
}, [
|
|
2885
|
-
return p(
|
|
2865
|
+
Hn2(Pc({ serviceId: P2, serviceType: C2 ?? void 0, start: e3.localStartDate, end: e3.localEndDate, timeZone: H2 ?? void 0, isEligibleForFlowCompletion: !!n3 })), n3 && Ee2(ie2(n3, { handoff: true, staffId: t3 }));
|
|
2866
|
+
}, [Hn2, F2, te2, H2, P2, C2, x2, I2, Ut2, Ht2, Ee2, De2, ie2, N2]), Kn2 = Oe2 ? wl(Oe2) : null, qn2 = Kn2 ? F2 || !I2 || hl(Kn2, Ut2(Re2), Ht2(Kn2.length)).isComplete : false, Jn2 = Kn2 ? Ht2(Kn2.length) : false, Yn2 = o(() => !Oe2 || Ze2 ? [] : Sl(Oe2).map((e3) => ({ staffMemberId: e3.staffMemberId, name: e3.name || null, image: null, isSelected: e3.staffMemberId === Be2 })), [Oe2, Ze2, Be2]), Xn2 = o(() => ({ isMultiService: F2, availabilityRequestKey: Se2, needsServiceChoice: Ce2, isRescheduling: N2, rescheduleValidUntil: rn2, businessTimeZone: g2, canChangeTimeZone: Kt2, setTimeZone: qt2, locationFilterOptions: lt2, selectedLocationFilter: B2, setLocationFilter: Gt2, staffFilterOptions: _t2, selectedStaffFilter: V2, setStaffFilter: Wt2, requestedGender: kt2, genderSelectionAllowed: Ge2, currentTimeSlotsPage: U2 ? 1 : G2.currentPage, hasNextTimeSlotsPage: !U2 && G2.hasNextPage, hasPreviousTimeSlotsPage: !U2 && G2.hasPreviousPage, nextTimeSlotsPage: U2 ? Hl : G2.nextPage, loadUpcomingTimeSlots: Pe2, upcomingTimeSlotsRequested: Ae2, previousTimeSlotsPage: U2 ? Vl : G2.previousPage, timeSlots: Pn2.rows.map((e3) => xl(e3, H2, Fn2, L2)), isLoading: zn2, hasError: Vn2, errorCode: Bn2, selectedDate: an2, daysAvailabilityRange: Xt2, daysAvailability: nn2, daysAvailabilityLoading: Qt2, daysAvailabilityHasError: $t2, selectDate: wn2, setDaysAvailabilityRange: en2, goToNextAvailableDate: En2, nextAvailableSlotsCount: l2, timeZone: H2, staffFromSlots: Yn2, selectedResourceId: Be2, setSelectedResource: jt2, canAutoAssignStaff: Jn2, isComplete: qn2, selectedTimeSlot: Oe2 ? xl(Oe2, H2, Fn2, L2) : null, selectTimeSlot: Wn2, navigateToBookingForm: Gn2, timeSlotLimitPerDay: f2, daysWithMore: Pn2.daysWithMore, loadingDate: G2.loadingDate, loadAllTimeSlotsForDay: G2.loadAllSessionsForDay }), [F2, Se2, Ce2, N2, rn2, g2, H2, Kt2, qt2, G2, Pe2, Ae2, lt2, B2, Gt2, _t2, V2, Wt2, kt2, Ge2, U2, zn2, Bn2, Vn2, Pn2, an2, Xt2, nn2, Qt2, $t2, wn2, en2, En2, l2, Yn2, Be2, jt2, Jn2, qn2, Oe2, Wn2, Gn2, f2, Fn2, L2]);
|
|
2867
|
+
return p(Ul.Provider, { value: Xn2, children: b2 });
|
|
2886
2868
|
}
|
|
2887
|
-
var
|
|
2869
|
+
var Ql = sn(`4936242d-905c-48bf-80ce-5f56d075de4f`);
|
|
2888
2870
|
export {
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2871
|
+
Jl as TimeSlotsContextProvider,
|
|
2872
|
+
Jl as default,
|
|
2873
|
+
Ql as injectAccessTokenGetter,
|
|
2874
|
+
Ul as timeSlotsContext,
|
|
2875
|
+
Wl as useTimeSlotsContext
|
|
2894
2876
|
};
|
|
2895
2877
|
//# sourceMappingURL=context-time-slots.mjs.map
|