@wix/bookings 1.0.1754 → 1.0.1756
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/_sdk-exports/context-booking-checkout/runtime.d.ts +791 -143
- package/_sdk-exports/context-booking-checkout/runtime.js +3 -2
- package/_sdk-exports/context-categories/runtime.d.ts +164 -2
- package/_sdk-exports/context-categories/runtime.js +2 -1
- package/_sdk-exports/context-locations/runtime.d.ts +186 -2
- package/_sdk-exports/context-locations/runtime.js +2 -1
- package/_sdk-exports/context-service/runtime.d.ts +1540 -144
- package/_sdk-exports/context-service/runtime.js +3 -2
- package/_sdk-exports/context-service-addons/runtime.d.ts +215 -13
- package/_sdk-exports/context-service-addons/runtime.js +2 -1
- package/_sdk-exports/context-services/runtime.d.ts +371 -77
- package/_sdk-exports/context-services/runtime.js +3 -2
- package/_sdk-exports/context-time-slots/runtime.d.ts +854 -72
- package/_sdk-exports/context-time-slots/runtime.js +3 -2
- package/build/cjs/context-booking-checkout.d.ts +791 -143
- package/build/cjs/context-booking-checkout.js +1759 -1640
- package/build/cjs/context-booking-checkout.js.map +1 -1
- package/build/cjs/context-categories.d.ts +164 -2
- package/build/cjs/context-categories.js +116 -114
- package/build/cjs/context-categories.js.map +1 -1
- package/build/cjs/context-locations.d.ts +186 -2
- package/build/cjs/context-locations.js +126 -124
- package/build/cjs/context-locations.js.map +1 -1
- package/build/cjs/context-service-addons.d.ts +215 -13
- package/build/cjs/context-service-addons.js +323 -321
- package/build/cjs/context-service-addons.js.map +1 -1
- package/build/cjs/context-service.d.ts +1540 -144
- package/build/cjs/context-service.js +1622 -1616
- package/build/cjs/context-service.js.map +1 -1
- package/build/cjs/context-services.d.ts +371 -77
- package/build/cjs/context-services.js +460 -458
- package/build/cjs/context-services.js.map +1 -1
- package/build/cjs/context-time-slots.d.ts +854 -72
- package/build/cjs/context-time-slots.js +1033 -1000
- package/build/cjs/context-time-slots.js.map +1 -1
- package/build/es/context-booking-checkout.d.mts +791 -143
- package/build/es/context-booking-checkout.mjs +1778 -1650
- package/build/es/context-booking-checkout.mjs.map +1 -1
- package/build/es/context-categories.d.mts +164 -2
- package/build/es/context-categories.mjs +116 -114
- package/build/es/context-categories.mjs.map +1 -1
- package/build/es/context-locations.d.mts +186 -2
- package/build/es/context-locations.mjs +126 -124
- package/build/es/context-locations.mjs.map +1 -1
- package/build/es/context-service-addons.d.mts +215 -13
- package/build/es/context-service-addons.mjs +323 -321
- package/build/es/context-service-addons.mjs.map +1 -1
- package/build/es/context-service.d.mts +1540 -144
- package/build/es/context-service.mjs +1622 -1616
- package/build/es/context-service.mjs.map +1 -1
- package/build/es/context-services.d.mts +371 -77
- package/build/es/context-services.mjs +460 -458
- package/build/es/context-services.mjs.map +1 -1
- package/build/es/context-time-slots.d.mts +854 -72
- package/build/es/context-time-slots.mjs +1033 -1000
- package/build/es/context-time-slots.mjs.map +1 -1
- package/build/internal/cjs/context-booking-checkout.d.ts +791 -143
- package/build/internal/cjs/context-categories.d.ts +164 -2
- package/build/internal/cjs/context-locations.d.ts +186 -2
- package/build/internal/cjs/context-service-addons.d.ts +215 -13
- package/build/internal/cjs/context-service.d.ts +1540 -144
- package/build/internal/cjs/context-services.d.ts +371 -77
- package/build/internal/cjs/context-time-slots.d.ts +854 -72
- package/build/internal/es/context-booking-checkout.d.mts +791 -143
- package/build/internal/es/context-categories.d.mts +164 -2
- package/build/internal/es/context-locations.d.mts +186 -2
- package/build/internal/es/context-service-addons.d.mts +215 -13
- package/build/internal/es/context-service.d.mts +1540 -144
- package/build/internal/es/context-services.d.mts +371 -77
- package/build/internal/es/context-time-slots.d.mts +854 -72
- package/package.json +5 -5
|
@@ -20,12 +20,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// context-locations.ts
|
|
21
21
|
var context_locations_exports = {};
|
|
22
22
|
__export(context_locations_exports, {
|
|
23
|
-
LOCATIONS_CONTEXT_MISSING_PROVIDER_ERROR: () =>
|
|
24
|
-
LocationsContextProvider: () =>
|
|
25
|
-
default: () =>
|
|
26
|
-
injectAccessTokenGetter: () =>
|
|
23
|
+
LOCATIONS_CONTEXT_MISSING_PROVIDER_ERROR: () => cr,
|
|
24
|
+
LocationsContextProvider: () => mr,
|
|
25
|
+
default: () => mr,
|
|
26
|
+
injectAccessTokenGetter: () => hr,
|
|
27
27
|
locationsContext: () => $,
|
|
28
|
-
useLocationsContext: () =>
|
|
28
|
+
useLocationsContext: () => lr
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(context_locations_exports);
|
|
31
31
|
|
|
@@ -804,15 +804,16 @@ function Zt() {
|
|
|
804
804
|
e2 = n2, t2 = r2;
|
|
805
805
|
}), resolve: e2, reject: t2 };
|
|
806
806
|
}
|
|
807
|
-
var
|
|
808
|
-
var
|
|
809
|
-
|
|
807
|
+
var Qt = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
|
|
808
|
+
var z = (e2) => Qt()?.[e2];
|
|
809
|
+
var $t = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
|
|
810
|
+
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = tn();
|
|
810
811
|
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: z(`language`), locale: z(`locale`), get passThroughHeaders() {
|
|
811
812
|
return Xt();
|
|
812
813
|
} } };
|
|
813
814
|
}, auth: (e3) => {
|
|
814
815
|
let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
|
|
815
|
-
!e3 &&
|
|
816
|
+
!e3 && en() && (e3 = t2?.getAccessTokenFunction?.());
|
|
816
817
|
let n2 = false, { resolve: r2, promise: i2 } = Zt();
|
|
817
818
|
return { getAuthHeaders: async () => {
|
|
818
819
|
if (!e3 && n2 && (e3 = await i2), !e3) throw Error(`Failed to resolve auth token`);
|
|
@@ -821,33 +822,34 @@ var Qt = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host:
|
|
|
821
822
|
r2(e4);
|
|
822
823
|
}) };
|
|
823
824
|
} });
|
|
824
|
-
function
|
|
825
|
+
function en() {
|
|
825
826
|
return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
|
|
826
827
|
}
|
|
827
|
-
function
|
|
828
|
+
function tn() {
|
|
828
829
|
let e2 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
|
|
829
830
|
if (!e2) return;
|
|
830
831
|
let t2 = new URL(e2);
|
|
831
832
|
return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
|
|
832
833
|
}
|
|
833
|
-
var
|
|
834
|
+
var nn = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
|
|
834
835
|
if (!e2) throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);
|
|
835
836
|
return e2.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
|
|
836
837
|
}, getAccessToken: () => {
|
|
837
838
|
throw Error(`Not implemented`);
|
|
838
839
|
}, observeState: () => ({ disconnect: () => {
|
|
839
840
|
} }) });
|
|
840
|
-
var B =
|
|
841
|
+
var B = $t({ createHost: function(e2) {
|
|
841
842
|
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e2?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e2 || {};
|
|
842
843
|
if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
|
|
843
|
-
return { channel:
|
|
844
|
+
return { channel: nn({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
844
845
|
} };
|
|
845
846
|
} });
|
|
846
|
-
var
|
|
847
|
+
var rn = (e2, t2) => {
|
|
847
848
|
let n2 = B.host({ applicationId: e2, componentId: t2 }), r2 = B.auth();
|
|
848
849
|
return Ve({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
849
|
-
}
|
|
850
|
-
|
|
850
|
+
};
|
|
851
|
+
var an = (e2) => rn(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`, e2);
|
|
852
|
+
function on() {
|
|
851
853
|
let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
852
854
|
if (e2) return { initWixModules(t3, n3) {
|
|
853
855
|
return V(() => e2(t3, n3));
|
|
@@ -884,17 +886,17 @@ function V(e2) {
|
|
|
884
886
|
globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
885
887
|
}
|
|
886
888
|
}
|
|
887
|
-
function
|
|
889
|
+
function sn(e2, t2) {
|
|
888
890
|
return { ...e2, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
|
|
889
|
-
let r2 =
|
|
891
|
+
let r2 = on();
|
|
890
892
|
if (!r2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
891
893
|
return r2.initWixModules(e2)[t3].apply(void 0, n2);
|
|
892
894
|
}])) };
|
|
893
895
|
}
|
|
894
|
-
function
|
|
895
|
-
return
|
|
896
|
+
function cn(e2) {
|
|
897
|
+
return sn({ __type: `host`, create: (t2) => Object.entries(e2).reduce((e3, [n2, r2]) => ({ ...e3, [n2]: r2(t2) }), {}) }, Object.keys(e2));
|
|
896
898
|
}
|
|
897
|
-
var
|
|
899
|
+
var ln = class {
|
|
898
900
|
constructor(e2) {
|
|
899
901
|
this.message = e2, this.captureException = () => {
|
|
900
902
|
console.error(this.message);
|
|
@@ -909,12 +911,12 @@ var sn = class {
|
|
|
909
911
|
};
|
|
910
912
|
}
|
|
911
913
|
};
|
|
912
|
-
var
|
|
913
|
-
var
|
|
914
|
+
var un = (e2) => new ln(e2);
|
|
915
|
+
var dn = cn({ getMonitoringClient: (e2) => () => e2.getMonitoringClient ? e2.getMonitoringClient() : un(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
|
|
914
916
|
var H = { service: `service`, services: `services`, categories: `categories`, locations: `locations`, sessions: `sessions`, timeSlots: `time-slots`, serviceAddOns: `service-addons`, bookingsSettings: `bookings-settings`, serviceCta: `service-cta`, preferences: `preferences`, bookingSummary: `booking-summary`, bookingCheckout: `booking-checkout`, formValues: `form-values`, paymentOptions: `payment-options`, seo: `seo`, warmup: `warmup`, reschedule: `reschedule` };
|
|
915
917
|
function U(e2) {
|
|
916
918
|
try {
|
|
917
|
-
let t2 =
|
|
919
|
+
let t2 = dn.getMonitoringClient?.();
|
|
918
920
|
return t2 && typeof t2[e2] == `function` ? t2 : null;
|
|
919
921
|
} catch {
|
|
920
922
|
return null;
|
|
@@ -926,13 +928,13 @@ function W(e2, { feature: t2, action: n2, level: r2 = `error`, contexts: i2 }) {
|
|
|
926
928
|
let o2 = e2 instanceof Error ? e2 : Error(String(e2));
|
|
927
929
|
a2.captureException(o2, { level: r2, tags: { feature: t2, action: n2 }, ...i2 ? { contexts: i2 } : {} });
|
|
928
930
|
}
|
|
929
|
-
function
|
|
931
|
+
function fn(e2, { feature: t2, tags: n2 }, r2) {
|
|
930
932
|
let i2 = U(`startSpanManual`);
|
|
931
933
|
if (!i2) return r2;
|
|
932
934
|
let a2 = i2.startSpanManual({ name: e2, tags: { feature: t2, ...n2 } });
|
|
933
935
|
return r2.then(() => a2.end(), (e3) => a2.fail(e3)), r2;
|
|
934
936
|
}
|
|
935
|
-
var
|
|
937
|
+
var pn = class extends import_react.Component {
|
|
936
938
|
state = { hasError: false };
|
|
937
939
|
static getDerivedStateFromError() {
|
|
938
940
|
return { hasError: true };
|
|
@@ -944,7 +946,7 @@ var dn = class extends import_react.Component {
|
|
|
944
946
|
return this.state.hasError ? this.props.fallback : this.props.children;
|
|
945
947
|
}
|
|
946
948
|
};
|
|
947
|
-
function
|
|
949
|
+
function mn(e2) {
|
|
948
950
|
let t2 = e2;
|
|
949
951
|
if (t2.__state || (t2.__state = { status: `pending` }, t2.then((e3) => {
|
|
950
952
|
t2.__state = { status: `fulfilled`, value: e3 };
|
|
@@ -957,10 +959,10 @@ function G(e2) {
|
|
|
957
959
|
let t2 = Promise.resolve(e2);
|
|
958
960
|
return t2.__state = { status: `fulfilled`, value: e2 }, t2;
|
|
959
961
|
}
|
|
960
|
-
var
|
|
961
|
-
function
|
|
962
|
-
let r2 =
|
|
963
|
-
r2 || (r2 = /* @__PURE__ */ new WeakMap(),
|
|
962
|
+
var hn = /* @__PURE__ */ new WeakMap();
|
|
963
|
+
function gn(e2, t2, n2) {
|
|
964
|
+
let r2 = hn.get(e2);
|
|
965
|
+
r2 || (r2 = /* @__PURE__ */ new WeakMap(), hn.set(e2, r2));
|
|
964
966
|
let i2 = r2.get(t2);
|
|
965
967
|
i2 || (i2 = /* @__PURE__ */ new WeakMap(), r2.set(t2, i2));
|
|
966
968
|
let a2 = i2.get(n2);
|
|
@@ -973,17 +975,17 @@ function mn(e2, t2, n2) {
|
|
|
973
975
|
function K(e2) {
|
|
974
976
|
return e2;
|
|
975
977
|
}
|
|
976
|
-
var
|
|
977
|
-
var
|
|
978
|
-
function
|
|
979
|
-
let t2 = e2.searchParams.get(
|
|
978
|
+
var _n = K(`@wix/site-service-url`);
|
|
979
|
+
var vn = `appSectionParams`;
|
|
980
|
+
function yn(e2) {
|
|
981
|
+
let t2 = e2.searchParams.get(vn);
|
|
980
982
|
if (t2 === null) return e2;
|
|
981
983
|
let n2 = new URL(e2);
|
|
982
|
-
n2.searchParams.delete(
|
|
983
|
-
for (let [e3, r2] of Object.entries(
|
|
984
|
+
n2.searchParams.delete(vn);
|
|
985
|
+
for (let [e3, r2] of Object.entries(bn(t2))) typeof r2 == `string` && !n2.searchParams.has(e3) && n2.searchParams.set(e3, r2);
|
|
984
986
|
return n2;
|
|
985
987
|
}
|
|
986
|
-
function
|
|
988
|
+
function bn(e2) {
|
|
987
989
|
try {
|
|
988
990
|
let t2 = JSON.parse(e2);
|
|
989
991
|
return t2 && typeof t2 == `object` && !Array.isArray(t2) ? t2 : {};
|
|
@@ -992,15 +994,15 @@ function vn(e2) {
|
|
|
992
994
|
}
|
|
993
995
|
}
|
|
994
996
|
var q = `bookings-uou:url-change`;
|
|
995
|
-
var
|
|
997
|
+
var xn = (e2) => {
|
|
996
998
|
let t2 = new URL(e2);
|
|
997
999
|
return t2.searchParams.sort(), t2.href;
|
|
998
1000
|
};
|
|
999
|
-
function
|
|
1001
|
+
function Sn(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
|
|
1000
1002
|
let r2 = globalThis.window;
|
|
1001
1003
|
if (!r2?.history) return;
|
|
1002
1004
|
let i2 = new URL(r2.location.href);
|
|
1003
|
-
if (
|
|
1005
|
+
if (xn(i2) === xn(e2)) return;
|
|
1004
1006
|
let a2 = { scrollY: r2.scrollY };
|
|
1005
1007
|
if (n2) r2.history.replaceState(a2, ``, e2.href);
|
|
1006
1008
|
else {
|
|
@@ -1013,46 +1015,46 @@ function bn(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
|
|
|
1013
1015
|
}
|
|
1014
1016
|
r2.dispatchEvent(new Event(q));
|
|
1015
1017
|
}
|
|
1016
|
-
function
|
|
1018
|
+
function Cn(e2) {
|
|
1017
1019
|
let t2 = globalThis.window;
|
|
1018
1020
|
return t2 ? (t2.addEventListener(q, e2), t2.addEventListener(`popstate`, e2), () => {
|
|
1019
1021
|
t2.removeEventListener(q, e2), t2.removeEventListener(`popstate`, e2);
|
|
1020
1022
|
}) : () => {
|
|
1021
1023
|
};
|
|
1022
1024
|
}
|
|
1023
|
-
var
|
|
1025
|
+
var wn = (e2) => {
|
|
1024
1026
|
try {
|
|
1025
1027
|
return decodeURIComponent(e2);
|
|
1026
1028
|
} catch {
|
|
1027
1029
|
return e2;
|
|
1028
1030
|
}
|
|
1029
1031
|
};
|
|
1030
|
-
function
|
|
1032
|
+
function Tn(e2, t2) {
|
|
1031
1033
|
let n2 = t2 ? new URL(t2).pathname : `/`;
|
|
1032
|
-
return `./${
|
|
1034
|
+
return `./${wn(new URL(e2).pathname.replace(n2, ``).replace(/^\/|\/$/g, ``))}`;
|
|
1033
1035
|
}
|
|
1034
1036
|
function J() {
|
|
1035
|
-
let e2 = (0, import_services_manager_react.useService)(
|
|
1036
|
-
return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () =>
|
|
1037
|
+
let e2 = (0, import_services_manager_react.useService)(_n), t2 = (0, import_react.useCallback)(() => e2.currentUrl, [e2]), n2 = (0, import_react.useSyncExternalStore)(Cn, t2, t2), i2 = (0, import_react.useMemo)(() => yn(new URL(n2)), [n2]), a2 = e2.siteUrl.replace(/\/$/, ``);
|
|
1038
|
+
return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () => yn(new URL(e2.currentUrl)), getRelativeUrl: () => Tn(e2.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: Sn };
|
|
1037
1039
|
}
|
|
1038
1040
|
var Y = { category: `category`, location: `location`, page: `page`, blob: `b`, resource: `resource`, referral: `referral`, timezone: `timezone`, bookingId: `bookingId`, token: `token`, rescheduleRedirectUrl: `rescheduleRedirectUrl` };
|
|
1039
|
-
var
|
|
1040
|
-
function
|
|
1041
|
+
var En = K(`@wix/site-service-warmup-data`);
|
|
1042
|
+
function Dn() {
|
|
1041
1043
|
try {
|
|
1042
1044
|
return (0, import_services_manager_react.useGetService)();
|
|
1043
1045
|
} catch {
|
|
1044
1046
|
return null;
|
|
1045
1047
|
}
|
|
1046
1048
|
}
|
|
1047
|
-
function
|
|
1049
|
+
function On(e2) {
|
|
1048
1050
|
try {
|
|
1049
|
-
return e2 ? e2(
|
|
1051
|
+
return e2 ? e2(En) : null;
|
|
1050
1052
|
} catch {
|
|
1051
1053
|
return null;
|
|
1052
1054
|
}
|
|
1053
1055
|
}
|
|
1054
|
-
function
|
|
1055
|
-
let e2 =
|
|
1056
|
+
function kn() {
|
|
1057
|
+
let e2 = On(Dn()), t2 = typeof window > `u`;
|
|
1056
1058
|
return { scope: e2 ?? void 0, get: async (n2) => {
|
|
1057
1059
|
if (t2 || !e2) return null;
|
|
1058
1060
|
try {
|
|
@@ -1067,54 +1069,54 @@ function Dn() {
|
|
|
1067
1069
|
}
|
|
1068
1070
|
} };
|
|
1069
1071
|
}
|
|
1070
|
-
var
|
|
1071
|
-
function
|
|
1072
|
-
return `${
|
|
1072
|
+
var An = `bookings-uou`;
|
|
1073
|
+
function jn() {
|
|
1074
|
+
return `${An}:locations:all`;
|
|
1073
1075
|
}
|
|
1074
|
-
var
|
|
1075
|
-
var
|
|
1076
|
-
var
|
|
1076
|
+
var Mn = 5e3;
|
|
1077
|
+
var Nn = 100;
|
|
1078
|
+
var Pn = `wix-warmup-data`;
|
|
1077
1079
|
var X = null;
|
|
1078
|
-
function
|
|
1080
|
+
function Fn(e2) {
|
|
1079
1081
|
if (typeof document < `u`) try {
|
|
1080
|
-
let t2 = document.getElementById(
|
|
1082
|
+
let t2 = document.getElementById(Pn)?.textContent;
|
|
1081
1083
|
return t2 ? (X?.text !== t2 && (X = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), X.data[e2] ?? void 0) : void 0;
|
|
1082
1084
|
} catch {
|
|
1083
1085
|
return;
|
|
1084
1086
|
}
|
|
1085
1087
|
}
|
|
1086
|
-
var
|
|
1087
|
-
var
|
|
1088
|
-
var
|
|
1089
|
-
var
|
|
1090
|
-
function
|
|
1091
|
-
if (!e2) return
|
|
1092
|
-
let t2 =
|
|
1093
|
-
return t2 || (t2 =
|
|
1088
|
+
var In = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
|
|
1089
|
+
var Ln = In();
|
|
1090
|
+
var Rn = /* @__PURE__ */ new WeakMap();
|
|
1091
|
+
var zn = /* @__PURE__ */ new WeakMap();
|
|
1092
|
+
function Bn(e2) {
|
|
1093
|
+
if (!e2) return Ln;
|
|
1094
|
+
let t2 = Rn.get(e2);
|
|
1095
|
+
return t2 || (t2 = In(), Rn.set(e2, t2)), t2;
|
|
1094
1096
|
}
|
|
1095
|
-
function
|
|
1097
|
+
function Vn({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
1096
1098
|
if (e2 === null) return n2();
|
|
1097
1099
|
if (typeof window > `u`) {
|
|
1098
1100
|
let r3 = () => n2().then((n3) => (t2.set(e2, n3), n3)), { scope: i3 } = t2;
|
|
1099
1101
|
if (!i3) return r3();
|
|
1100
|
-
let a3 =
|
|
1101
|
-
a3 || (a3 = /* @__PURE__ */ new Map(),
|
|
1102
|
+
let a3 = zn.get(i3);
|
|
1103
|
+
a3 || (a3 = /* @__PURE__ */ new Map(), zn.set(i3, a3));
|
|
1102
1104
|
let o3 = a3.get(e2);
|
|
1103
1105
|
if (o3) return o3;
|
|
1104
1106
|
let s3 = r3();
|
|
1105
1107
|
return a3.set(e2, s3), s3.catch(() => a3.delete(e2)), s3;
|
|
1106
1108
|
}
|
|
1107
|
-
let i2 =
|
|
1109
|
+
let i2 = Bn(t2.scope), a2 = Date.now();
|
|
1108
1110
|
for (let [e3, t3] of i2.promises) t3.expiresAt <= a2 && i2.promises.delete(e3);
|
|
1109
1111
|
let o2 = i2.promises.get(e2);
|
|
1110
1112
|
if (o2 && !r2) return o2.promise;
|
|
1111
1113
|
r2 && i2.invalidatedWarmup.add(e2);
|
|
1112
1114
|
let s2 = !i2.invalidatedWarmup.has(e2);
|
|
1113
1115
|
if (s2) {
|
|
1114
|
-
let t3 =
|
|
1116
|
+
let t3 = Fn(e2);
|
|
1115
1117
|
if (t3 !== void 0) {
|
|
1116
1118
|
let n3 = G(t3);
|
|
1117
|
-
return i2.promises.set(e2, { promise: n3, expiresAt: a2 +
|
|
1119
|
+
return i2.promises.set(e2, { promise: n3, expiresAt: a2 + Mn }), n3;
|
|
1118
1120
|
}
|
|
1119
1121
|
}
|
|
1120
1122
|
let c2 = (async () => {
|
|
@@ -1124,43 +1126,43 @@ function zn({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
|
1124
1126
|
}
|
|
1125
1127
|
return n2();
|
|
1126
1128
|
})();
|
|
1127
|
-
i2.promises.size >=
|
|
1129
|
+
i2.promises.size >= Nn && i2.promises.delete(i2.promises.keys().next().value);
|
|
1128
1130
|
let l2 = { promise: c2, expiresAt: 1 / 0 };
|
|
1129
1131
|
return i2.promises.set(e2, l2), c2.then(() => {
|
|
1130
|
-
l2.expiresAt = Date.now() +
|
|
1132
|
+
l2.expiresAt = Date.now() + Mn;
|
|
1131
1133
|
}, () => {
|
|
1132
1134
|
i2.promises.get(e2) === l2 && i2.promises.delete(e2);
|
|
1133
1135
|
}), c2;
|
|
1134
1136
|
}
|
|
1135
|
-
var
|
|
1136
|
-
function
|
|
1137
|
+
var Hn = [{ path: `businessLocations.locations.business.address.geocode.latitude` }, { path: `businessLocations.locations.business.address.geocode.longitude` }, { path: `businessLocations.locations.custom.address.geocode.latitude` }, { path: `businessLocations.locations.custom.address.geocode.longitude` }, { path: `businessLocations.locations.calculatedAddress.geocode.latitude` }, { path: `businessLocations.locations.calculatedAddress.geocode.longitude` }];
|
|
1138
|
+
function Un(e2) {
|
|
1137
1139
|
return St(Object.assign(e2, { domainToMappings: { "*.dev.wix-code.com": [{ srcPath: `/_api/services-2`, destPath: `` }, { srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "www.wixapis.com": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }, { srcPath: `/bookings/services/v2/bulk/services`, destPath: `/v2/bulk/services` }], "manage._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "editor._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "blocks._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "create.editorx": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], _: [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "www._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "bo._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "wixbo.ai": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "wix-bo.com": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "editor.wixapps.net": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "api._api_base_domain_": [{ srcPath: `/services-2`, destPath: `` }] } }));
|
|
1138
1140
|
}
|
|
1139
|
-
var
|
|
1140
|
-
function
|
|
1141
|
+
var Wn = `@wix/auto_sdk_bookings_services`;
|
|
1142
|
+
function Gn(e2) {
|
|
1141
1143
|
function t2({ host: t3 }) {
|
|
1142
|
-
return { entityFqdn: `wix.bookings.services.v2.service`, method: `POST`, methodFqn: `wix.bookings.services.v2.ServicesService.QueryLocations`, packageName:
|
|
1144
|
+
return { entityFqdn: `wix.bookings.services.v2.service`, method: `POST`, methodFqn: `wix.bookings.services.v2.ServicesService.QueryLocations`, packageName: Wn, migrationOptions: { optInTransformResponse: true }, url: Un({ protoPath: `/v2/services/locations/query`, data: e2, host: t3 }), data: e2, transformResponse: (e3) => rt(e3, [{ transformFn: Gt, paths: Hn }]) };
|
|
1143
1145
|
}
|
|
1144
1146
|
return t2;
|
|
1145
1147
|
}
|
|
1146
|
-
var
|
|
1147
|
-
async function
|
|
1148
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1148
|
+
var Kn = [{ path: `businessLocations.locations.calculatedAddress` }, { path: `businessLocations.locations.business.address` }, { path: `businessLocations.locations.custom.address` }];
|
|
1149
|
+
async function qn(e2) {
|
|
1150
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Gn(qe({ filter: e2?.filter }));
|
|
1149
1151
|
n2?.onSiteCall?.();
|
|
1150
1152
|
try {
|
|
1151
1153
|
let e3 = await t2.request(r2);
|
|
1152
|
-
return n2?.onSuccess?.(e3), Je(rt(e3.data, [{ transformFn: Kt, paths:
|
|
1154
|
+
return n2?.onSuccess?.(e3), Je(rt(e3.data, [{ transformFn: Kt, paths: Kn }]));
|
|
1153
1155
|
} catch (e3) {
|
|
1154
1156
|
let t3 = pt(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { filter: `$[0].filter` }, singleArgumentUnchanged: false }, [`options`]);
|
|
1155
1157
|
throw n2?.onError?.(e3), t3;
|
|
1156
1158
|
}
|
|
1157
1159
|
}
|
|
1158
|
-
function
|
|
1159
|
-
return (t2) =>
|
|
1160
|
+
function Jn(e2) {
|
|
1161
|
+
return (t2) => qn(t2, { httpClient: e2 });
|
|
1160
1162
|
}
|
|
1161
|
-
var
|
|
1162
|
-
var
|
|
1163
|
-
var
|
|
1163
|
+
var Yn = xt(Jn);
|
|
1164
|
+
var Xn = `13d21c63-b5ec-5912-8397-c3a5ddb27a97`;
|
|
1165
|
+
var Zn = function(e2) {
|
|
1164
1166
|
return e2.BOOK_ONLINE = `bookingsBookOnline`, e2.SERVICE_PAGE = `bookingsServicePage`, e2.CALENDAR_PAGE = `bookingsCalendar`, e2.FORM_PAGE = `bookingsForm`, e2;
|
|
1165
1167
|
}({});
|
|
1166
1168
|
function Z(e2) {
|
|
@@ -1169,55 +1171,55 @@ function Z(e2) {
|
|
|
1169
1171
|
function Q(e2) {
|
|
1170
1172
|
return e2.business?.name ?? null;
|
|
1171
1173
|
}
|
|
1172
|
-
async function
|
|
1173
|
-
let e2 = await
|
|
1174
|
+
async function Qn() {
|
|
1175
|
+
let e2 = await Yn({ filter: { services: { appId: Xn, hidden: false } } });
|
|
1174
1176
|
return { locations: [...e2.businessLocations?.locations ?? []].sort((e3, t2) => (Q(e3) ?? ``).localeCompare(Q(t2) ?? ``)), hasOtherLocations: !!(e2.customLocations?.exists || e2.customerLocations?.exists) };
|
|
1175
1177
|
}
|
|
1176
|
-
function
|
|
1178
|
+
function $n({ isLoading: e2, hasError: t2, refetch: n2, children: r2 }) {
|
|
1177
1179
|
let { searchParams: i2 } = J(), a2 = { locations: [], locationItems: [], selectedLocationId: i2.get(Y.location), selectedLocationIndex: -1, selectedLocation: null, selectedLocationName: null, hasOtherLocations: false, hasMultipleLocations: false, isLoading: e2, hasError: t2, refetch: n2, selectLocation: () => {
|
|
1178
1180
|
} };
|
|
1179
1181
|
return (0, import_jsx_runtime.jsx)($.Provider, { value: a2, children: r2 });
|
|
1180
1182
|
}
|
|
1181
|
-
function
|
|
1182
|
-
return (0, import_jsx_runtime.jsx)(
|
|
1183
|
+
function er({ refetch: e2, children: t2 }) {
|
|
1184
|
+
return (0, import_jsx_runtime.jsx)($n, { isLoading: true, hasError: false, refetch: e2, children: t2 });
|
|
1183
1185
|
}
|
|
1184
|
-
function
|
|
1185
|
-
return (0, import_jsx_runtime.jsx)(
|
|
1186
|
+
function tr({ refetch: e2, children: t2 }) {
|
|
1187
|
+
return (0, import_jsx_runtime.jsx)($n, { isLoading: false, hasError: true, refetch: e2, children: t2 });
|
|
1186
1188
|
}
|
|
1187
|
-
var
|
|
1188
|
-
function
|
|
1189
|
+
var nr = K(`@wix/site-service-business-logger`);
|
|
1190
|
+
function rr(e2) {
|
|
1189
1191
|
return { evid: 32, src: 16, endpoint: ``, params: e2 };
|
|
1190
1192
|
}
|
|
1191
|
-
var
|
|
1192
|
-
|
|
1193
|
-
var
|
|
1194
|
-
var
|
|
1195
|
-
let { reportBi: t2 } = (0, import_services_manager_react.useService)(
|
|
1193
|
+
var ir = { SERVICES: `services_context`, SERVICE: `service_context`, TIME_SLOTS: `time_slots_context`, BOOKING_CHECKOUT: `booking_checkout_context`, CATEGORIES: `categories_context`, LOCATIONS: `locations_context`, SERVICE_ADD_ONS: `service_addons_context`, PREFERENCES: `preferences_context` };
|
|
1194
|
+
Zn.BOOK_ONLINE;
|
|
1195
|
+
var ar = `new_bookings_server`;
|
|
1196
|
+
var or = (e2) => {
|
|
1197
|
+
let { reportBi: t2 } = (0, import_services_manager_react.useService)(nr);
|
|
1196
1198
|
return (0, import_react.useCallback)((n2) => {
|
|
1197
|
-
t2({ widget_name: e2, bookingsPlatform:
|
|
1199
|
+
t2({ widget_name: e2, bookingsPlatform: ar, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
|
|
1198
1200
|
}, [t2, e2]);
|
|
1199
1201
|
};
|
|
1200
|
-
var
|
|
1201
|
-
let n2 =
|
|
1202
|
+
var sr = (e2, t2 = true) => {
|
|
1203
|
+
let n2 = or(e2), { getParsedUrl: r2 } = J(), i2 = (0, import_react.useRef)(false);
|
|
1202
1204
|
(0, import_react.useEffect)(() => {
|
|
1203
|
-
t2 && !i2.current && (i2.current = true, n2(
|
|
1205
|
+
t2 && !i2.current && (i2.current = true, n2(rr({ referralInfo: r2().searchParams.get(Y.referral) ?? void 0 })));
|
|
1204
1206
|
}, [t2, n2, r2]);
|
|
1205
1207
|
};
|
|
1206
1208
|
var $ = (0, import_react.createContext)(null);
|
|
1207
|
-
var
|
|
1208
|
-
function
|
|
1209
|
+
var cr = `useLocationsContext must be used within LocationsContextProvider`;
|
|
1210
|
+
function lr() {
|
|
1209
1211
|
let e2 = (0, import_react.useContext)($);
|
|
1210
|
-
if (!e2) throw Error(
|
|
1212
|
+
if (!e2) throw Error(cr);
|
|
1211
1213
|
return e2;
|
|
1212
1214
|
}
|
|
1213
|
-
function
|
|
1215
|
+
function ur(e2, t2) {
|
|
1214
1216
|
let n2 = Z(e2);
|
|
1215
1217
|
return { locationId: n2, locationName: Q(e2), isSelected: n2 != null && n2 === t2 };
|
|
1216
1218
|
}
|
|
1217
|
-
var
|
|
1218
|
-
var
|
|
1219
|
-
function
|
|
1220
|
-
let { locations: c2, hasOtherLocations: l2, hasError: u2 } =
|
|
1219
|
+
var dr = (e2) => ({ ...e2, hasError: false });
|
|
1220
|
+
var fr = () => ({ locations: [], hasOtherLocations: false, hasError: true });
|
|
1221
|
+
function pr({ locationsPromise: e2, initialLocationId: t2, refetch: n2, children: i2 }) {
|
|
1222
|
+
let { locations: c2, hasOtherLocations: l2, hasError: u2 } = mn(e2), { pathname: d2, searchParams: p2, pushUrl: m2, getExternalBaseUrl: h2 } = J(), g2 = p2.get(Y.location), _2 = (0, import_react.useCallback)((e3) => {
|
|
1221
1223
|
let t3 = new URLSearchParams(p2);
|
|
1222
1224
|
e3 ? t3.set(Y.location, e3) : t3.delete(Y.location), t3.delete(Y.page);
|
|
1223
1225
|
let n3 = t3.toString(), r2 = n3 ? `${d2}?${n3}` : d2;
|
|
@@ -1226,15 +1228,15 @@ function dr({ locationsPromise: e2, initialLocationId: t2, refetch: n2, children
|
|
|
1226
1228
|
(0, import_react.useEffect)(() => {
|
|
1227
1229
|
v2.current || (v2.current = true, t2 && !p2.get(Y.location) && _2(t2));
|
|
1228
1230
|
}, [t2, p2, _2]);
|
|
1229
|
-
let y2 = c2.findIndex((e3) => Z(e3) === g2), b2 = c2.find((e3) => Z(e3) === g2) ?? null, x2 = c2.filter((e3) => Z(e3)).length + +!!l2, ee2 = (0, import_react.useMemo)(() => ({ locations: c2, locationItems: c2.map((e3) =>
|
|
1231
|
+
let y2 = c2.findIndex((e3) => Z(e3) === g2), b2 = c2.find((e3) => Z(e3) === g2) ?? null, x2 = c2.filter((e3) => Z(e3)).length + +!!l2, ee2 = (0, import_react.useMemo)(() => ({ locations: c2, locationItems: c2.map((e3) => ur(e3, g2)), selectedLocationId: g2, selectedLocationIndex: y2, selectedLocation: b2, selectedLocationName: b2 ? Q(b2) : null, hasOtherLocations: l2, hasMultipleLocations: x2 > 1, isLoading: false, hasError: u2, refetch: n2, selectLocation: _2 }), [c2, g2, y2, b2, l2, u2, x2, n2, _2]);
|
|
1230
1232
|
return (0, import_jsx_runtime.jsx)($.Provider, { value: ee2, children: i2 });
|
|
1231
1233
|
}
|
|
1232
|
-
function
|
|
1233
|
-
|
|
1234
|
-
let i2 =
|
|
1235
|
-
return (0, import_jsx_runtime.jsx)(
|
|
1234
|
+
function mr({ initialLocationId: e2, children: n2 }) {
|
|
1235
|
+
sr(ir.LOCATIONS);
|
|
1236
|
+
let i2 = kn(), [a2, s2] = (0, import_react.useState)(0), l2 = (0, import_react.useMemo)(() => gn(Vn({ key: jn(), refresh: a2 !== 0, warmupData: i2, fetchData: () => fn(`locations-context-load`, { feature: H.locations }, Qn()) }), dr, fr), [a2]), u2 = (0, import_react.useCallback)(() => s2((e3) => e3 + 1), []);
|
|
1237
|
+
return (0, import_jsx_runtime.jsx)(pn, { fallback: (0, import_jsx_runtime.jsx)(tr, { refetch: u2, children: n2 }), feature: H.locations, children: (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(er, { refetch: u2, children: n2 }), children: (0, import_jsx_runtime.jsx)(pr, { locationsPromise: l2, initialLocationId: e2, refetch: u2, children: n2 }) }) });
|
|
1236
1238
|
}
|
|
1237
|
-
var
|
|
1239
|
+
var hr = an(`c151d9f7-1582-407c-bb59-59030f244b47`);
|
|
1238
1240
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1239
1241
|
0 && (module.exports = {
|
|
1240
1242
|
LOCATIONS_CONTEXT_MISSING_PROVIDER_ERROR,
|