@wix/bookings 1.0.1777 → 1.0.1778
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 +243 -108
- package/build/cjs/context-booking-checkout.js +176 -182
- package/build/cjs/context-booking-checkout.js.map +1 -1
- package/build/cjs/context-categories.d.ts +16 -143
- package/build/cjs/context-categories.js +411 -411
- package/build/cjs/context-categories.js.map +1 -1
- package/build/cjs/context-locations.d.ts +16 -287
- package/build/cjs/context-locations.js +335 -335
- package/build/cjs/context-locations.js.map +1 -1
- package/build/cjs/context-service-addons.d.ts +2 -2
- package/build/cjs/context-service.d.ts +71 -33
- package/build/cjs/context-service.js +97 -95
- package/build/cjs/context-service.js.map +1 -1
- package/build/cjs/context-time-slots.d.ts +10 -0
- package/build/cjs/context-time-slots.js +1 -1
- package/build/cjs/context-time-slots.js.map +1 -1
- package/build/es/context-booking-checkout.d.mts +243 -108
- package/build/es/context-booking-checkout.mjs +176 -179
- package/build/es/context-booking-checkout.mjs.map +1 -1
- package/build/es/context-categories.d.mts +16 -143
- package/build/es/context-categories.mjs +411 -411
- package/build/es/context-categories.mjs.map +1 -1
- package/build/es/context-locations.d.mts +16 -287
- package/build/es/context-locations.mjs +335 -335
- package/build/es/context-locations.mjs.map +1 -1
- package/build/es/context-service-addons.d.mts +2 -2
- package/build/es/context-service.d.mts +71 -33
- package/build/es/context-service.mjs +97 -95
- package/build/es/context-service.mjs.map +1 -1
- package/build/es/context-time-slots.d.mts +10 -0
- package/build/es/context-time-slots.mjs +1 -1
- package/build/es/context-time-slots.mjs.map +1 -1
- package/build/internal/cjs/context-booking-checkout.d.ts +243 -108
- package/build/internal/cjs/context-categories.d.ts +16 -143
- package/build/internal/cjs/context-locations.d.ts +16 -287
- package/build/internal/cjs/context-service-addons.d.ts +2 -2
- package/build/internal/cjs/context-service.d.ts +71 -33
- package/build/internal/cjs/context-time-slots.d.ts +10 -0
- package/build/internal/es/context-booking-checkout.d.mts +243 -108
- package/build/internal/es/context-categories.d.mts +16 -143
- package/build/internal/es/context-locations.d.mts +16 -287
- package/build/internal/es/context-service-addons.d.mts +2 -2
- package/build/internal/es/context-service.d.mts +71 -33
- package/build/internal/es/context-time-slots.d.mts +10 -0
- package/context-runtime/context-booking-checkout/runtime.d.ts +243 -108
- package/context-runtime/context-booking-checkout/runtime.js +3 -3
- package/context-runtime/context-categories/runtime.d.ts +16 -143
- package/context-runtime/context-categories/runtime.js +2 -2
- package/context-runtime/context-locations/runtime.d.ts +16 -287
- package/context-runtime/context-locations/runtime.js +2 -2
- package/context-runtime/context-service/runtime.d.ts +71 -33
- package/context-runtime/context-service/runtime.js +3 -3
- package/context-runtime/context-service-addons/runtime.d.ts +2 -2
- package/context-runtime/context-time-slots/runtime.d.ts +10 -0
- package/context-runtime/context-time-slots/runtime.js +2 -2
- package/package.json +6 -6
|
@@ -201,9 +201,9 @@ interface AddOnGroupDetail {
|
|
|
201
201
|
}
|
|
202
202
|
//#endregion
|
|
203
203
|
//#region ../bookings-flow-data/dist/types.d.ts
|
|
204
|
-
/**
|
|
204
|
+
/** An add-on the visitor chose, with its quantity. */
|
|
205
205
|
type AddOn$1 = {
|
|
206
|
-
id: NonNullable<BookedAddOn['_id']>;
|
|
206
|
+
/** ID of the add-on. */id: NonNullable<BookedAddOn['_id']>; /** Number of the add-on to book. */
|
|
207
207
|
quantity: NonNullable<BookedAddOn['quantity']>;
|
|
208
208
|
};
|
|
209
209
|
//#endregion
|
|
@@ -2696,62 +2696,94 @@ declare const SERVICE_CTA_STATES: {
|
|
|
2696
2696
|
type ServiceCtaState = (typeof SERVICE_CTA_STATES)[keyof typeof SERVICE_CTA_STATES];
|
|
2697
2697
|
//#endregion
|
|
2698
2698
|
//#region ../bookings-flow-data/dist/types.d.ts
|
|
2699
|
-
/**
|
|
2700
|
-
*
|
|
2701
|
-
*
|
|
2702
|
-
|
|
2703
|
-
/** A committed resource selection for one resource *type* (staff, room, equipment…).
|
|
2704
|
-
* Carried as ids — the server accepts ids via `resourceSelections`, so the full resource
|
|
2705
|
-
* object (name, schedule) is never needed in the contract.
|
|
2699
|
+
/**
|
|
2700
|
+
* Whether the selection holds 1 service or several services booked together. Supported values:
|
|
2701
|
+
* - `'single'`: 1 service.
|
|
2702
|
+
* - `'multi'`: 2 or more services, booked together as a multi-service appointment.
|
|
2706
2703
|
*
|
|
2707
|
-
*
|
|
2704
|
+
* It follows the number of entries in `services`, so count those instead of reading it.
|
|
2705
|
+
*/
|
|
2706
|
+
type BookingMode = 'single' | 'multi';
|
|
2707
|
+
/** Resources the visitor chose for 1 resource type, such as a staff member or a room. */
|
|
2708
2708
|
interface ResourceSelection {
|
|
2709
|
+
/** ID of the resource type, such as the staff member resource type. */
|
|
2709
2710
|
type: string;
|
|
2711
|
+
/** IDs of the chosen resources of this type. */
|
|
2710
2712
|
ids: string[];
|
|
2711
|
-
/**
|
|
2713
|
+
/** Whether the visitor chose any available resource of this type, instead of a specific one. */
|
|
2712
2714
|
anyResource?: boolean;
|
|
2713
2715
|
}
|
|
2714
|
-
/** A
|
|
2716
|
+
/** A variant the visitor chose for a service with variants: a number of participants, option choices, or both. */
|
|
2715
2717
|
type SelectedVariant = Pick<ServiceChoices, 'numberOfParticipants'> & {
|
|
2716
|
-
/**
|
|
2718
|
+
/** The chosen option values: a choice ID, or the text of a custom choice. */choices?: string[];
|
|
2717
2719
|
};
|
|
2718
2720
|
/** Genders a visitor can narrow "any staff member" to, in display order. Same literals as the
|
|
2719
2721
|
* availability API's `requestedGender.gender`, single- and multi-service alike. */
|
|
2720
2722
|
declare const REQUESTED_GENDERS: readonly ["ANY_FEMALE", "ANY_MALE"];
|
|
2721
2723
|
type RequestedGender = (typeof REQUESTED_GENDERS)[number];
|
|
2722
|
-
/**
|
|
2724
|
+
/** An add-on the visitor chose, with its quantity. */
|
|
2723
2725
|
type AddOn = {
|
|
2724
|
-
id: NonNullable<BookedAddOn['_id']>;
|
|
2726
|
+
/** ID of the add-on. */id: NonNullable<BookedAddOn['_id']>; /** Number of the add-on to book. */
|
|
2725
2727
|
quantity: NonNullable<BookedAddOn['quantity']>;
|
|
2726
2728
|
};
|
|
2727
|
-
/**
|
|
2729
|
+
/** What the visitor chose for 1 service: the service, its time slot, and their choices. */
|
|
2728
2730
|
type ServicePreference = {
|
|
2729
|
-
serviceId: NonNullable<V2Slot['serviceId']>;
|
|
2731
|
+
/** ID of the service. */serviceId: NonNullable<V2Slot['serviceId']>; /** Slug of the service, as in its page URL. */
|
|
2730
2732
|
slug?: NonNullable<Slug['name']>;
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
/**
|
|
2744
|
-
|
|
2745
|
-
|
|
2733
|
+
/**
|
|
2734
|
+
* Type of the service. Supported values:
|
|
2735
|
+
* - `'APPOINTMENT'`: An appointment, booked by time slot.
|
|
2736
|
+
* - `'CLASS'`: A class session.
|
|
2737
|
+
* - `'COURSE'`: A course, booked as a whole by its schedule.
|
|
2738
|
+
*/
|
|
2739
|
+
serviceType?: Service['type'];
|
|
2740
|
+
/**
|
|
2741
|
+
* Start of the time slot, as a local date and time without an offset, such as
|
|
2742
|
+
* `'2026-10-08T10:00:00'`. It's in the selection's `timezone`. Each service has its own, because
|
|
2743
|
+
* services booked together can start at different times. Absent for a course.
|
|
2744
|
+
*/
|
|
2745
|
+
slotStart?: V2Slot['startDate']; /** End of the time slot, in the same format as `slotStart`. Absent for a course. */
|
|
2746
|
+
slotEnd?: V2Slot['endDate']; /** ID of the calendar event of a class session. */
|
|
2747
|
+
eventId?: V2Slot['eventId']; /** ID of the schedule the slot belongs to. For a course, the course's schedule. */
|
|
2748
|
+
scheduleId?: V2Slot['scheduleId']; /** ID of the class session. */
|
|
2749
|
+
sessionId?: V2Slot['sessionId']; /** ID of the business location of the slot. */
|
|
2750
|
+
locationId?: NonNullable<SlotLocation['_id']>;
|
|
2751
|
+
/**
|
|
2752
|
+
* Where the service takes place. Supported values:
|
|
2753
|
+
* - `'BUSINESS'`: At one of the business's locations, in `locationId`.
|
|
2754
|
+
* - `'CUSTOM'`: At an address the business set for the service.
|
|
2755
|
+
* - `'CUSTOMER'`: At the customer's address.
|
|
2756
|
+
*/
|
|
2757
|
+
locationType?: 'BUSINESS' | 'CUSTOM' | 'CUSTOMER'; /** Resources the visitor chose, such as a staff member, by resource type. */
|
|
2758
|
+
resources?: ResourceSelection[]; /** Variants the visitor chose, for a service with variants. */
|
|
2759
|
+
selectedVariants?: SelectedVariant[]; /** Add-ons the visitor chose. */
|
|
2760
|
+
addOns?: AddOn[]; /** ID of the duration choice the visitor chose, for a service with a choice of durations. */
|
|
2761
|
+
durationChoiceId?: string; /** Duration the visitor chose, in minutes. */
|
|
2762
|
+
durationInMinutes?: number;
|
|
2763
|
+
/**
|
|
2764
|
+
* Gender the visitor asked for when they chose any available staff member. Supported values:
|
|
2765
|
+
* `'ANY_FEMALE'`, `'ANY_MALE'`.
|
|
2766
|
+
*/
|
|
2746
2767
|
requestedGender?: RequestedGender;
|
|
2747
2768
|
};
|
|
2748
|
-
/**
|
|
2769
|
+
/** What the visitor selected to book: the services, their time slots, and their choices. */
|
|
2749
2770
|
interface BookingPreferences {
|
|
2771
|
+
/** Whether the selection holds 1 service or several. Count `services` instead of reading it. */
|
|
2750
2772
|
mode: BookingMode;
|
|
2773
|
+
/**
|
|
2774
|
+
* Time zone of the slots' local dates and times, as an IANA name such as `'Europe/London'`.
|
|
2775
|
+
* Can be absent when the selection has no time slot, such as a course.
|
|
2776
|
+
*/
|
|
2751
2777
|
timezone?: V2Slot['timezone'];
|
|
2778
|
+
/** The selected services, in booking order. */
|
|
2752
2779
|
services: ServicePreference[];
|
|
2753
|
-
/**
|
|
2754
|
-
*
|
|
2780
|
+
/**
|
|
2781
|
+
* Whether the visitor asked to enter a promo code, in the booking summary. When it's `true`, a
|
|
2782
|
+
* priced booking paid in person goes through the checkout page, where the visitor enters the
|
|
2783
|
+
* code.
|
|
2784
|
+
*
|
|
2785
|
+
* Default: `false`
|
|
2786
|
+
*/
|
|
2755
2787
|
wantsPromoCode?: boolean;
|
|
2756
2788
|
}
|
|
2757
2789
|
//#endregion
|
|
@@ -3943,6 +3975,12 @@ interface Reschedule {
|
|
|
3943
3975
|
* couldn't be read.
|
|
3944
3976
|
*/
|
|
3945
3977
|
validUntil: string | null;
|
|
3978
|
+
/**
|
|
3979
|
+
* Name of the plan that the booking was paid with, in the site's language when it's translated.
|
|
3980
|
+
*
|
|
3981
|
+
* `null` when the booking wasn't paid with a plan, or the plan couldn't be read.
|
|
3982
|
+
*/
|
|
3983
|
+
planName: string | null;
|
|
3946
3984
|
}
|
|
3947
3985
|
//#endregion
|
|
3948
3986
|
//#region src/api/adapters/booking/reschedule-booking.d.ts
|
|
@@ -4720,7 +4720,7 @@ function Xh(e5) {
|
|
|
4720
4720
|
}
|
|
4721
4721
|
function Zh(e5) {
|
|
4722
4722
|
let t2 = e5(Kh);
|
|
4723
|
-
return { open: ({ slug: e6 }, n2) => t2.open({ slug: e6,
|
|
4723
|
+
return { open: ({ slug: e6 }, n2) => t2.open({ slug: e6, payload: n2 }), close: () => t2.close(), getContext: () => t2.getPayload() };
|
|
4724
4724
|
}
|
|
4725
4725
|
function Qh() {
|
|
4726
4726
|
let e5 = ds();
|
|
@@ -6002,7 +6002,7 @@ function ex({ bookingsSettings: e5, children: n2 }) {
|
|
|
6002
6002
|
return e5 ? p(Kb.Provider, { value: { isLoading: false, ...e5 }, children: n2 }) : p(t, { fallback: p(Kb.Provider, { value: Gb, children: n2 }), children: p($b, { settingsPromise: i2, children: n2 }) });
|
|
6003
6003
|
}
|
|
6004
6004
|
function tx({ isLoading: e5, hasError: t2, bookingsSettingsLoading: n2, rescheduleRequest: r2 = null, editingSurface: i2 = false, children: a2 }) {
|
|
6005
|
-
let o2 = r2 ? { status: `loading`, booking: null, validUntil: null } : null, s2 = { service: null, serviceName: null, serviceDescription: null, serviceTagLine: null, serviceDefaultDuration: null, serviceImage: null, serviceSlug: null, servicePageLink: null, serviceId: null, serviceType: null, servicePrice: Lh, isVariedService: false, serviceOptionsAndVariants: null, pricingOption: null, isLoadingServiceOptionsAndVariants: e5, hasAddOns: false, isConferenceEnabled: false, offeredDays: [], courseAvailability: null, courseStartDate: null, courseEndDate: null, staffMembers: [], coverImage: void 0, gallery: [], serviceLocations: [], policyDescription: null, serviceBookability: { state: vh.AVAILABLE, isAvailableForBooking: false, bookingOpensAt: null }, displayTimeZone: `UTC`, isAvailableForBooking: () => false, hasPolicyDescription: () => false, hasCoverImage: () => false, hasGalleryImages: () => false, isVariantDuration: () => false, isLoading: e5, hasError: t2, locale: `en-US`, selectStaffMember: () => {
|
|
6005
|
+
let o2 = r2 ? { status: `loading`, booking: null, validUntil: null, planName: null } : null, s2 = { service: null, serviceName: null, serviceDescription: null, serviceTagLine: null, serviceDefaultDuration: null, serviceImage: null, serviceSlug: null, servicePageLink: null, serviceId: null, serviceType: null, servicePrice: Lh, isVariedService: false, serviceOptionsAndVariants: null, pricingOption: null, isLoadingServiceOptionsAndVariants: e5, hasAddOns: false, isConferenceEnabled: false, offeredDays: [], courseAvailability: null, courseStartDate: null, courseEndDate: null, staffMembers: [], coverImage: void 0, gallery: [], serviceLocations: [], policyDescription: null, serviceBookability: { state: vh.AVAILABLE, isAvailableForBooking: false, bookingOpensAt: null }, displayTimeZone: `UTC`, isAvailableForBooking: () => false, hasPolicyDescription: () => false, hasCoverImage: () => false, hasGalleryImages: () => false, isVariantDuration: () => false, isLoading: e5, hasError: t2, locale: `en-US`, selectStaffMember: () => {
|
|
6006
6006
|
}, clearSelection: () => {
|
|
6007
6007
|
}, clearStaffMember: () => {
|
|
6008
6008
|
}, selection: cv(``), selectionTimezone: void 0, setVariant: () => {
|
|
@@ -6017,7 +6017,7 @@ function tx({ isLoading: e5, hasError: t2, bookingsSettingsLoading: n2, reschedu
|
|
|
6017
6017
|
}, navigateToMultiServiceForm: () => {
|
|
6018
6018
|
}, resolveNextPageHref: () => null, isNavigating: false, editingSurface: i2, openPreferences: () => Promise.resolve(), multiServiceAppointmentsEnabled: false, isMultiServiceAppointment: false, multiServiceAppointmentServices: [], multiServiceAppointmentSelections: [], multiServiceAppointmentOptionsAndVariants: {}, multiServiceAppointmentVariantsStatus: `ready`, bookingsSettingsLoading: n2, reschedule: o2, rescheduleBooking: async () => ({ outcome: `failed` }), goHomeAfterReschedule: () => {
|
|
6019
6019
|
}, canRescheduleToPick: false };
|
|
6020
|
-
return p(
|
|
6020
|
+
return p(Ix.Provider, { value: s2, children: a2 });
|
|
6021
6021
|
}
|
|
6022
6022
|
function nx({ rescheduleRequest: e5, editingSurface: t2, children: n2 }) {
|
|
6023
6023
|
return p(Xb, { children: p(tx, { isLoading: true, hasError: false, bookingsSettingsLoading: true, rescheduleRequest: e5, editingSurface: t2, children: n2 }) });
|
|
@@ -6091,15 +6091,16 @@ function yx(e5) {
|
|
|
6091
6091
|
async function bx({ booking: e5, slot: t2, token: n2 }) {
|
|
6092
6092
|
return yx(n2 ? (await qf(n2, t2, { revision: e5.revision || `1` })).booking : (await Yf(e5.bookingId, t2, { revision: e5.revision ?? `` })).booking);
|
|
6093
6093
|
}
|
|
6094
|
-
|
|
6094
|
+
var xx = { validUntil: null, planName: null };
|
|
6095
|
+
async function Sx(e5) {
|
|
6095
6096
|
try {
|
|
6096
|
-
let t2 = (await Sc({ filter: { _id: e5 }, cursorPaging: { limit: 1 } }, { withEcomTransactions: true })).extendedBookings?.[0]?.transactions?.chargedMembershipPaymentDetails
|
|
6097
|
-
return t2 ? new Date(t2).toISOString() : null;
|
|
6097
|
+
let t2 = (await Sc({ filter: { _id: e5 }, cursorPaging: { limit: 1 } }, { withEcomTransactions: true })).extendedBookings?.[0]?.transactions?.chargedMembershipPaymentDetails;
|
|
6098
|
+
return t2 ? { validUntil: t2.expirationDate ? new Date(t2.expirationDate).toISOString() : null, planName: t2.name?.translated || t2.name?.original || null } : xx;
|
|
6098
6099
|
} catch (e6) {
|
|
6099
|
-
return Jo(e6, { feature: Ko.reschedule, action: `fetch-plan-valid-until`, level: `warning` }),
|
|
6100
|
+
return Jo(e6, { feature: Ko.reschedule, action: `fetch-plan-valid-until`, level: `warning` }), xx;
|
|
6100
6101
|
}
|
|
6101
6102
|
}
|
|
6102
|
-
function
|
|
6103
|
+
function Cx() {
|
|
6103
6104
|
let e5 = ds();
|
|
6104
6105
|
return i(() => {
|
|
6105
6106
|
if (!e5) return null;
|
|
@@ -6110,25 +6111,25 @@ function Sx() {
|
|
|
6110
6111
|
}
|
|
6111
6112
|
}, [e5]);
|
|
6112
6113
|
}
|
|
6113
|
-
var
|
|
6114
|
-
function
|
|
6114
|
+
var wx = Zo(`@wix/viewer-service-site-members`);
|
|
6115
|
+
function Tx() {
|
|
6115
6116
|
try {
|
|
6116
6117
|
return d();
|
|
6117
6118
|
} catch {
|
|
6118
6119
|
return null;
|
|
6119
6120
|
}
|
|
6120
6121
|
}
|
|
6121
|
-
function
|
|
6122
|
+
function Ex(e5) {
|
|
6122
6123
|
try {
|
|
6123
|
-
return e5 ? e5(
|
|
6124
|
+
return e5 ? e5(wx) : null;
|
|
6124
6125
|
} catch {
|
|
6125
6126
|
return null;
|
|
6126
6127
|
}
|
|
6127
6128
|
}
|
|
6128
|
-
function
|
|
6129
|
-
return Tx(
|
|
6129
|
+
function Dx() {
|
|
6130
|
+
return Ex(Tx());
|
|
6130
6131
|
}
|
|
6131
|
-
function
|
|
6132
|
+
function Ox(e5) {
|
|
6132
6133
|
if (!e5) return null;
|
|
6133
6134
|
try {
|
|
6134
6135
|
let t2 = new URL(e5);
|
|
@@ -6137,94 +6138,95 @@ function Dx(e5) {
|
|
|
6137
6138
|
return null;
|
|
6138
6139
|
}
|
|
6139
6140
|
}
|
|
6140
|
-
function
|
|
6141
|
+
function kx(e5, { bookable: t2, staffChoiceRequired: n2, timezone: r2, validUntil: i2 }) {
|
|
6141
6142
|
if (!Nv(e5) || !t2) return false;
|
|
6142
6143
|
let a2 = vv(e5);
|
|
6143
6144
|
if (n2 && (!a2 || a2.anyResource)) return false;
|
|
6144
6145
|
let o2 = e5.slotStart ? em(e5.slotStart, r2) : null;
|
|
6145
6146
|
return !i2 || !o2 || o2.getTime() <= Date.parse(i2);
|
|
6146
6147
|
}
|
|
6147
|
-
var
|
|
6148
|
-
|
|
6148
|
+
var Ax = { validUntil: null, planName: null };
|
|
6149
|
+
var jx = { status: `loading`, booking: null, ...Ax };
|
|
6150
|
+
async function Mx(e5) {
|
|
6149
6151
|
return e5.getMemberDetails ? !!await e5.getMemberDetails().catch(() => null) : !!e5.isInitiallyLoggedIn;
|
|
6150
6152
|
}
|
|
6151
|
-
async function
|
|
6153
|
+
async function Nx(e5, t2) {
|
|
6152
6154
|
let { bookingId: n2, token: r2 } = e5;
|
|
6153
|
-
if (!r2 && !(t2 && await
|
|
6155
|
+
if (!r2 && !(t2 && await Mx(t2)) && !(t2 && await t2.promptLogin({ mode: `login` }).then(() => true, () => false))) return { status: `loginRequired`, booking: null, ...Ax };
|
|
6154
6156
|
try {
|
|
6155
|
-
let [t3, i2] = await Promise.all([vx(e5), n2 && !r2 ?
|
|
6156
|
-
return { status: `ready`, booking: t3, validUntil: i2 };
|
|
6157
|
+
let [t3, i2] = await Promise.all([vx(e5), n2 && !r2 ? Sx(n2) : Ax]);
|
|
6158
|
+
return { status: `ready`, booking: t3, validUntil: i2.validUntil, planName: i2.planName };
|
|
6157
6159
|
} catch (e6) {
|
|
6158
|
-
return Jo(e6, { feature: Ko.reschedule, action: `fetch-booking` }), { status: e6 instanceof fx ? e6.reason : `failed`, booking: null,
|
|
6160
|
+
return Jo(e6, { feature: Ko.reschedule, action: `fetch-booking` }), { status: e6 instanceof fx ? e6.reason : `failed`, booking: null, ...Ax };
|
|
6159
6161
|
}
|
|
6160
6162
|
}
|
|
6161
|
-
var
|
|
6162
|
-
function
|
|
6163
|
-
let r2 = `${e5.bookingId ?? ``}|${e5.token ?? ``}`, i2 =
|
|
6164
|
-
return i2.users += 1,
|
|
6165
|
-
--i2.users, i2.users === 0 &&
|
|
6163
|
+
var Px = /* @__PURE__ */ new Map();
|
|
6164
|
+
function Fx(e5, t2, n2) {
|
|
6165
|
+
let r2 = `${e5.bookingId ?? ``}|${e5.token ?? ``}`, i2 = Px.get(r2) ?? { load: Nx(e5, t2), users: 0 };
|
|
6166
|
+
return i2.users += 1, Px.set(r2, i2), i2.load.then(n2), () => {
|
|
6167
|
+
--i2.users, i2.users === 0 && Px.get(r2) === i2 && Px.delete(r2);
|
|
6166
6168
|
};
|
|
6167
6169
|
}
|
|
6168
|
-
var
|
|
6169
|
-
var
|
|
6170
|
-
function
|
|
6171
|
-
let t2 = a(
|
|
6172
|
-
if (!t2 && !e5) throw Error(
|
|
6170
|
+
var Ix = n(null);
|
|
6171
|
+
var Lx = `useServiceContext must be used within ServiceContextProvider`;
|
|
6172
|
+
function Rx(e5 = false) {
|
|
6173
|
+
let t2 = a(Ix);
|
|
6174
|
+
if (!t2 && !e5) throw Error(Lx);
|
|
6173
6175
|
return t2;
|
|
6174
6176
|
}
|
|
6175
|
-
function
|
|
6177
|
+
function zx(e5, t2, n2) {
|
|
6176
6178
|
if (e5) return { by: `slug`, value: e5 };
|
|
6177
6179
|
let r2 = t2?.services ?? [];
|
|
6178
6180
|
return iv(t2) ? { by: `multi`, serviceIds: r2.map(({ serviceId: e6 }) => e6) } : r2.length === 1 ? { by: `id`, value: r2[0].serviceId } : n2 ? { by: `id`, value: n2 } : { by: `none` };
|
|
6179
6181
|
}
|
|
6180
|
-
var
|
|
6181
|
-
var
|
|
6182
|
-
var
|
|
6183
|
-
let n2 =
|
|
6182
|
+
var Bx = (e5) => void 0;
|
|
6183
|
+
var Vx = (e5, t2) => rv(t2.get(Rp.blob))?.services.find((t3) => t3.serviceId === e5);
|
|
6184
|
+
var Hx = (e5, t2) => {
|
|
6185
|
+
let n2 = Vx(e5, t2) ?? cv(e5), r2 = Bx(e5);
|
|
6184
6186
|
return r2 === void 0 ? n2 : yv(n2, r2);
|
|
6185
6187
|
};
|
|
6186
|
-
var
|
|
6187
|
-
let n2 =
|
|
6188
|
+
var Ux = (e5, t2) => {
|
|
6189
|
+
let n2 = Hx(e5, t2), r2 = t2.get(Rp.resource), i2 = Bx(e5) !== void 0 || !!Vx(e5, t2);
|
|
6188
6190
|
return r2 && !i2 ? yv(n2, r2) : n2;
|
|
6189
6191
|
};
|
|
6190
|
-
function
|
|
6192
|
+
function Wx(e5, t2) {
|
|
6191
6193
|
return !e5 || !t2 || !e5.services.every(Nv) ? null : fv(t2, e5);
|
|
6192
6194
|
}
|
|
6193
|
-
var
|
|
6194
|
-
function
|
|
6195
|
+
var Gx = [];
|
|
6196
|
+
function Kx(e5) {
|
|
6195
6197
|
return { min: 1, max: e5?.bookingPolicy?.participantsPolicy?.maxParticipantsPerBooking || 1 };
|
|
6196
6198
|
}
|
|
6197
|
-
function
|
|
6199
|
+
function qx(e5, { previous: t2, others: n2 }, { min: r2, max: i2 }) {
|
|
6198
6200
|
let a2 = Math.max(0, Math.floor(e5)), o2 = Math.max(t2, i2 - n2), s2 = Math.min(a2, o2);
|
|
6199
6201
|
return s2 > 0 && n2 + s2 < r2 ? Math.min(r2 - n2, o2) : s2;
|
|
6200
6202
|
}
|
|
6201
|
-
function
|
|
6203
|
+
function Jx({ serviceCtaState: e5, courseAvailability: t2, serviceBookability: n2 }) {
|
|
6202
6204
|
return `${e5}|${t2?.totalCapacity ?? `-`}|${t2?.remainingCapacity ?? `-`}|${t2 === null}|${n2.state}|${n2.isAvailableForBooking}`;
|
|
6203
6205
|
}
|
|
6204
|
-
var
|
|
6205
|
-
var
|
|
6206
|
-
var
|
|
6207
|
-
var
|
|
6208
|
-
var
|
|
6209
|
-
var
|
|
6210
|
-
var
|
|
6211
|
-
var
|
|
6212
|
-
function
|
|
6213
|
-
return p(t, { fallback: p(nx, { rescheduleRequest: i2, editingSurface: a2, children: s2 }), children: p(ex, { bookingsSettings: o2, children: p(Xo, { fallback: p(rx, { rescheduleRequest: i2, editingSurface: a2, children: s2 }), feature: Ko.service, children: p(
|
|
6214
|
-
}
|
|
6215
|
-
var
|
|
6216
|
-
var
|
|
6217
|
-
function
|
|
6206
|
+
var Yx = (e5) => ({ service: e5, hasError: false });
|
|
6207
|
+
var Xx = () => ({ service: null, hasError: true });
|
|
6208
|
+
var Zx = { service: null, hasError: false };
|
|
6209
|
+
var Qx = (e5) => ({ ...Zx, isMultiServiceAppointment: true, multiServiceAppointmentServices: e5 });
|
|
6210
|
+
var $x = () => ({ ...Xx(), isMultiServiceAppointment: true });
|
|
6211
|
+
var eS = [];
|
|
6212
|
+
var tS = [];
|
|
6213
|
+
var nS = {};
|
|
6214
|
+
function rS({ servicePromise: e5, refreshSignal: n2, injected: r2, rescheduleRequest: i2 = null, editingSurface: a2 = false, bookingsSettings: o2, children: s2 }) {
|
|
6215
|
+
return p(t, { fallback: p(nx, { rescheduleRequest: i2, editingSurface: a2, children: s2 }), children: p(ex, { bookingsSettings: o2, children: p(Xo, { fallback: p(rx, { rescheduleRequest: i2, editingSurface: a2, children: s2 }), feature: Ko.service, children: p(sS, { servicePromise: e5, refreshSignal: n2, injected: r2, rescheduleRequest: i2, editingSurface: a2, children: s2 }) }) }) });
|
|
6216
|
+
}
|
|
6217
|
+
var iS = (e5) => e5 ?? void 0;
|
|
6218
|
+
var aS = () => void 0;
|
|
6219
|
+
function oS(e5, t2) {
|
|
6218
6220
|
Jo(e5, { feature: Ko.service, action: `fetch-service-variants`, level: `warning`, contexts: { service: { serviceId: t2 } } });
|
|
6219
6221
|
}
|
|
6220
|
-
function
|
|
6221
|
-
let f2 = n2 ? null : e5 ? ms(e5) : null, m2 = n2?.service ?? f2?.service ?? null, h2 = f2?.hasError ?? false, g2 = f2?.isMultiServiceAppointment ?? false, _2 = f2?.multiServiceAppointmentServices ??
|
|
6222
|
+
function sS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, rescheduleRequest: a2 = null, editingSurface: u2 = false, children: d2 }) {
|
|
6223
|
+
let f2 = n2 ? null : e5 ? ms(e5) : null, m2 = n2?.service ?? f2?.service ?? null, h2 = f2?.hasError ?? false, g2 = f2?.isMultiServiceAppointment ?? false, _2 = f2?.multiServiceAppointmentServices ?? eS, v2 = Jv(), y2 = Xv(), { navigate: b2, navigateToHref: x2, resolvePath: ee2, toHref: S2, getBookingFormPath: C2 } = Bb(), w2 = Cx(), T2 = Jp(zp.SERVICE), { getParsedUrl: E2, pushUrl: te2, searchParams: ne2 } = cs(), D2 = c(E2);
|
|
6222
6224
|
D2.current = E2;
|
|
6223
6225
|
let re2 = c(te2);
|
|
6224
6226
|
re2.current = te2;
|
|
6225
6227
|
let O2 = ey(), k2 = c(O2);
|
|
6226
6228
|
k2.current = O2;
|
|
6227
|
-
let [A2, ie2] = l(
|
|
6229
|
+
let [A2, ie2] = l(jx), ae2 = Dx(), oe2 = (e6, t3) => a2 ? cv(e6) : Hx(e6, t3), se2 = c(oe2);
|
|
6228
6230
|
se2.current = oe2;
|
|
6229
6231
|
let [ce2, le2] = l(() => oe2(m2?._id ?? ``, E2().searchParams)), j2 = c(ce2), ue2 = c(void 0), de2 = c(true), fe2 = c(false), pe2 = c(null), [me2, he2] = l(null), ge2 = c(me2), [_e2, ve2] = l(0), M2 = m2?._id ?? null, ye2 = s(() => {
|
|
6230
6232
|
if (!a2) return null;
|
|
@@ -6236,25 +6238,25 @@ function aS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
|
|
|
6236
6238
|
if (!m2) return null;
|
|
6237
6239
|
let e6 = ee2(`servicePage`, { slug: m2.mainSlug?.name ?? null, serviceId: m2._id ?? null });
|
|
6238
6240
|
return e6 ? { href: S2(e6), target: `_self` } : null;
|
|
6239
|
-
}, [m2, ee2, S2]), [Ce2, we2] = l(
|
|
6241
|
+
}, [m2, ee2, S2]), [Ce2, we2] = l(Gx), Te2 = n2 ? n2.masterEvents : Ce2, Ee2 = Qb(), De2 = Jb(), Oe2 = De2.isLoading, ke2 = !De2.isLoading && De2.multiServiceAppointmentsEnabled;
|
|
6240
6242
|
o(() => {
|
|
6241
6243
|
if (!a2 || Oe2) return;
|
|
6242
|
-
let e6 = false, t3 =
|
|
6244
|
+
let e6 = false, t3 = Fx(a2, ae2, (t4) => {
|
|
6243
6245
|
e6 || ie2(t4);
|
|
6244
6246
|
});
|
|
6245
6247
|
return () => {
|
|
6246
6248
|
e6 = true, t3();
|
|
6247
6249
|
};
|
|
6248
6250
|
}, [a2, Oe2, ae2]);
|
|
6249
|
-
let Ae2 = !n2 && !!m2 && _p(m2), je2 = Ae2 && M2 ? ay(y2, M2, t2) : null, Me2 = (typeof window > `u` && je2 && M2 && O2.scope && !Oe2 ? ms(_s(vy({ key: je2, warmupData: O2, fetchData: () => ym(M2).catch((e6) => (
|
|
6251
|
+
let Ae2 = !n2 && !!m2 && _p(m2), je2 = Ae2 && M2 ? ay(y2, M2, t2) : null, Me2 = (typeof window > `u` && je2 && M2 && O2.scope && !Oe2 ? ms(_s(vy({ key: je2, warmupData: O2, fetchData: () => ym(M2).catch((e6) => (oS(e6, M2), null)) }), iS, aS)) : void 0) ?? (je2 ? fy(je2) : void 0), [Ne2, Pe2] = l(() => Me2 ?? null), [Fe2, Ie2] = l(() => Me2 ? je2 : null), Le2 = je2 !== null && Fe2 !== je2, Re2 = n2 ? n2.serviceOptionsAndVariants : Ae2 ? Ne2 : null;
|
|
6250
6252
|
o(() => {
|
|
6251
6253
|
if (n2) return;
|
|
6252
6254
|
let e6 = be2 && !mp(xe2) ? be2 : null;
|
|
6253
|
-
if ((!e6 || Oe2) && we2((e7) => e7.length === 0 ? e7 :
|
|
6255
|
+
if ((!e6 || Oe2) && we2((e7) => e7.length === 0 ? e7 : Gx), Oe2) return;
|
|
6254
6256
|
let i2 = Ae2 ? M2 : null;
|
|
6255
6257
|
if (!e6 && !i2) return;
|
|
6256
|
-
let a3 = false, o2 = e6 ? _m([e6], Ee2).catch(() =>
|
|
6257
|
-
|
|
6258
|
+
let a3 = false, o2 = e6 ? _m([e6], Ee2).catch(() => Gx) : Promise.resolve(Gx), s2 = i2 ? vy({ key: ay(y2, i2, t2), warmupData: k2.current, fetchData: () => ym(i2) }).catch((e7) => {
|
|
6259
|
+
oS(e7, i2);
|
|
6258
6260
|
}) : Promise.resolve(void 0);
|
|
6259
6261
|
return Promise.all([o2, s2]).then(([e7, t3]) => {
|
|
6260
6262
|
a3 || r(() => {
|
|
@@ -6267,7 +6269,7 @@ function aS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
|
|
|
6267
6269
|
let ze2 = a2 ? null : ne2.get(Rp.blob), Be2 = s(() => JSON.stringify([...new Set((rv(ze2)?.services ?? []).filter((e6) => Sv(e6).length > 0).map(({ serviceId: e6 }) => e6))].sort()), [ze2]), Ve2 = s(() => {
|
|
6268
6270
|
let e6 = new Set(JSON.parse(Be2));
|
|
6269
6271
|
return [...new Set(_2.filter(_p).flatMap(({ _id: t3 }) => t3 && e6.has(t3) ? [t3] : []))];
|
|
6270
|
-
}, [_2, Be2]), He2 = s(() => ({ serviceIds: Ve2, refreshSignal: t2, language: y2 }), [Ve2, t2, y2]), [Ue2, We2] = l(null), N2 = Ue2?.request === He2 ? Ue2 : null, P2 = N2?.data ??
|
|
6272
|
+
}, [_2, Be2]), He2 = s(() => ({ serviceIds: Ve2, refreshSignal: t2, language: y2 }), [Ve2, t2, y2]), [Ue2, We2] = l(null), N2 = Ue2?.request === He2 ? Ue2 : null, P2 = N2?.data ?? nS, F2 = Ve2.length === 0 ? `ready` : Oe2 || !N2 ? `loading` : N2.data && Ve2.every((e6) => N2.data?.[e6]) ? `ready` : `error`;
|
|
6271
6273
|
o(() => {
|
|
6272
6274
|
let { serviceIds: e6, refreshSignal: t3, language: n3 } = He2;
|
|
6273
6275
|
if (Oe2 || e6.length === 0) return;
|
|
@@ -6278,7 +6280,7 @@ function aS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
|
|
|
6278
6280
|
i2 = true;
|
|
6279
6281
|
};
|
|
6280
6282
|
}, [Oe2, He2]);
|
|
6281
|
-
let Ge2 = Hh({ service: m2, masterEvents: Te2, locale: v2, timeZone: Ee2, now: ty() }), Ke2 =
|
|
6283
|
+
let Ge2 = Hh({ service: m2, masterEvents: Te2, locale: v2, timeZone: Ee2, now: ty() }), Ke2 = Jx(Ge2), qe2 = s(() => Ge2, [m2, Te2, v2, Ee2, Ke2]), Je2 = c(null);
|
|
6282
6284
|
o(() => {
|
|
6283
6285
|
if (Je2.current !== null) {
|
|
6284
6286
|
let e6 = se2.current(m2?._id ?? ``, D2.current().searchParams);
|
|
@@ -6300,20 +6302,20 @@ function aS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
|
|
|
6300
6302
|
j2.current = t3, le2(t3);
|
|
6301
6303
|
}, []), $e2 = i((e6) => {
|
|
6302
6304
|
Qe2(e6);
|
|
6303
|
-
let t3 = D2.current(), n3 = e6(
|
|
6305
|
+
let t3 = D2.current(), n3 = e6(Hx(M2 ?? ``, t3.searchParams)), r2 = ov(`${t3.pathname}${t3.search}${t3.hash}`, { currentUrl: t3, entries: [_v(n3, Xe2.current)], policy: `inPlace` }), i2 = new URL(r2, t3);
|
|
6304
6306
|
Ye2.current = i2.searchParams.get(Rp.blob), re2.current(i2, { disableScrollToTop: true, skipHistory: true });
|
|
6305
6307
|
}, [Qe2, M2]), et2 = rv(ze2)?.wantsPromoCode === true, I2 = i((e6) => {
|
|
6306
6308
|
let t3 = D2.current(), n3 = rv(t3.searchParams.get(Rp.blob));
|
|
6307
6309
|
if (!n3) return;
|
|
6308
6310
|
let r2 = new URL(fv(`${t3.pathname}${t3.search}${t3.hash}`, hv(n3, e6)), t3);
|
|
6309
6311
|
Ye2.current = r2.searchParams.get(Rp.blob), re2.current(r2, { disableScrollToTop: true, skipHistory: true });
|
|
6310
|
-
}, []), L2 = Om(Re2), tt2 = i((e6, t3) => L2 ? Cv(e6, t3 ? [t3] : []) : e6, [L2]), R2 = i((e6) => Qe2((t3) => tt2(yv(t3, e6), e6)), [Qe2, tt2]), nt2 = i(() => Qe2((e6) => tt2(xv(e6), null)), [Qe2, tt2]), rt2 = i((e6) => Qe2((t3) => tt2(bv(t3, e6), null)), [Qe2, tt2]), it2 = i((e6) => $e2((t3) => Cv(t3, e6)), [$e2]), at2 = s(() =>
|
|
6312
|
+
}, []), L2 = Om(Re2), tt2 = i((e6, t3) => L2 ? Cv(e6, t3 ? [t3] : []) : e6, [L2]), R2 = i((e6) => Qe2((t3) => tt2(yv(t3, e6), e6)), [Qe2, tt2]), nt2 = i(() => Qe2((e6) => tt2(xv(e6), null)), [Qe2, tt2]), rt2 = i((e6) => Qe2((t3) => tt2(bv(t3, e6), null)), [Qe2, tt2]), it2 = i((e6) => $e2((t3) => Cv(t3, e6)), [$e2]), at2 = s(() => Kx(m2), [m2]), ot2 = s(() => km(Re2, { locale: v2, staffMembers: m2 ? Am(m2) : [], businessLocations: fp(m2) }), [Re2, v2, m2]), st2 = s(() => new Set(km(Re2, { locale: v2 })?.choices.flatMap((e6) => e6.choiceId ? [e6.choiceId] : []) ?? []), [Re2, v2]), ct2 = i((e6) => {
|
|
6311
6313
|
let t3 = Object.entries(e6).filter(([e7, t4]) => st2.has(e7) && Number.isFinite(t4));
|
|
6312
6314
|
if (!t3.length) return;
|
|
6313
6315
|
let n3 = (e7) => {
|
|
6314
6316
|
let n4 = Dv(e7, st2), r2 = ([e8, t4]) => t4 <= wv(n4, e8), i2 = [...t3.filter(r2), ...t3.filter((e8) => !r2(e8))];
|
|
6315
6317
|
for (let [e8, t4] of i2) {
|
|
6316
|
-
let r3 = wv(n4, e8), i3 =
|
|
6318
|
+
let r3 = wv(n4, e8), i3 = qx(t4, { previous: r3, others: Tv(n4) - r3 }, at2);
|
|
6317
6319
|
i3 !== r3 && (n4 = Ev(n4, e8, i3));
|
|
6318
6320
|
}
|
|
6319
6321
|
return n4;
|
|
@@ -6338,7 +6340,7 @@ function aS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
|
|
|
6338
6340
|
return n3 ? (ge2.current = n3, he2(n3), true) : false;
|
|
6339
6341
|
}, []), mt2 = i((e6, t3) => pt2((n3) => Lv(n3, e6, t3, jp())), [pt2]), ht2 = i(() => {
|
|
6340
6342
|
pt2(zv);
|
|
6341
|
-
}, [pt2]), gt2 = qe2.serviceCtaState, _t2 = s(() => g2 ? (me2 ?? rv(ze2))?.services ??
|
|
6343
|
+
}, [pt2]), gt2 = qe2.serviceCtaState, _t2 = s(() => g2 ? (me2 ?? rv(ze2))?.services ?? tS : tS, [g2, me2, ze2]), vt2 = s(() => g2 ? Wx(me2 ?? rv(ze2), C2()) : null, [g2, me2, ze2, C2]), yt2 = i((e6) => {
|
|
6342
6344
|
if (g2) return vt2 ? S2(vt2) : null;
|
|
6343
6345
|
let t3 = jb({ actionState: gt2, serviceType: m2?.type ?? null, config: e6 ?? Ab });
|
|
6344
6346
|
if (Mb(t3, m2?.type ?? null, ce2)) return null;
|
|
@@ -6356,9 +6358,9 @@ function aS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
|
|
|
6356
6358
|
}, (e7) => {
|
|
6357
6359
|
Jo(e7, { feature: Ko.serviceCta, action: `navigateToNextPage` }), wt2();
|
|
6358
6360
|
});
|
|
6359
|
-
}, [b2, wt2, S2]), Et2 = i(() => bt2.open(Jh(Hv({ service: m2, pricingOption: ot2 ?? void 0, selection:
|
|
6361
|
+
}, [b2, wt2, S2]), Et2 = i(() => bt2.open(Jh(Hv({ service: m2, pricingOption: ot2 ?? void 0, selection: Ux(M2 ?? ``, D2.current().searchParams), multiServiceAppointmentsEnabled: ke2 }))), [bt2, m2, ot2, M2, ke2]), Dt2 = i((e6) => {
|
|
6360
6362
|
if (Ct2.current) return;
|
|
6361
|
-
let t3 = ge2.current ?? rv(D2.current().searchParams.get(Rp.blob)), n3 =
|
|
6363
|
+
let t3 = ge2.current ?? rv(D2.current().searchParams.get(Rp.blob)), n3 = Wx(t3, C2());
|
|
6362
6364
|
if (n3) {
|
|
6363
6365
|
for (let n4 of t3?.services ?? []) e6(tm({ serviceId: n4.serviceId, serviceType: n4.serviceType ?? _2.find(({ _id: e7 }) => e7 === n4.serviceId)?.type ?? void 0, start: n4.slotStart, end: n4.slotEnd, timeZone: t3?.timezone ?? void 0, isEligibleForFlowCompletion: true }));
|
|
6364
6366
|
Tt2(n3);
|
|
@@ -6384,7 +6386,7 @@ function aS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
|
|
|
6384
6386
|
At2.current = kt2;
|
|
6385
6387
|
let jt2 = i(async () => {
|
|
6386
6388
|
let e6 = ye2?.status === `ready` ? ye2.booking : null;
|
|
6387
|
-
if (!ye2 || !a2 || !e6 || !
|
|
6389
|
+
if (!ye2 || !a2 || !e6 || !kx(j2.current, At2.current())) return { outcome: `failed` };
|
|
6388
6390
|
T2(Qp({ component: Gp.RESCHEDULE_DIALOG, element: Kp.CONFIRM_BUTTON })), T2(Lp({ action: Wp, pageName: Kp.CONFIRM_BUTTON, referralInfo: D2.current().searchParams.get(Rp.referral) ?? void 0 }));
|
|
6389
6391
|
let t3 = _v(j2.current, Xe2.current), n3;
|
|
6390
6392
|
try {
|
|
@@ -6395,38 +6397,38 @@ function aS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
|
|
|
6395
6397
|
T2(Zp({ bookingId: e6.bookingId }));
|
|
6396
6398
|
let r2 = { outcome: `succeeded`, ...n3 };
|
|
6397
6399
|
if (a2.fromManageBookingPage) return r2;
|
|
6398
|
-
let i2 =
|
|
6400
|
+
let i2 = Ox(a2.redirectUrl), o2 = i2 ? null : w2();
|
|
6399
6401
|
if (!i2 && !o2) return r2;
|
|
6400
6402
|
try {
|
|
6401
6403
|
return i2 ? await x2({ href: i2 }) : o2 && await b2(o2), { outcome: `navigated` };
|
|
6402
6404
|
} catch (e7) {
|
|
6403
6405
|
return Jo(e7, { feature: Ko.reschedule, action: `return-after-reschedule` }), r2;
|
|
6404
6406
|
}
|
|
6405
|
-
}, [ye2, a2, w2, b2, x2, T2]), Mt2 =
|
|
6407
|
+
}, [ye2, a2, w2, b2, x2, T2]), Mt2 = kx(ce2, kt2()), Nt2 = i(() => {
|
|
6406
6408
|
T2(Lp({ component: Kp.GO_TO_HOMEPAGE_BUTTON, action: Wp, pageName: qp })), b2(`/`).catch((e6) => Jo(e6, { feature: Ko.reschedule, action: `go-home` }));
|
|
6407
6409
|
}, [b2, T2]), { serviceBookability: Pt2, policyDescription: Ft2, coverImage: It2 } = qe2, Lt2 = i(() => Pt2.isAvailableForBooking, [Pt2]), Rt2 = i(() => !!Ft2, [Ft2]), zt2 = i(() => !!It2, [It2]), Bt2 = i(() => fh(m2), [m2]), Vt2 = i(() => !!m2 && Gh(m2), [m2]), Ht2 = s(() => ({ ...qe2, service: m2, servicePageLink: Se2, serviceOptionsAndVariants: Re2, pricingOption: ot2, isLoadingServiceOptionsAndVariants: Le2, isAvailableForBooking: Lt2, hasPolicyDescription: Rt2, hasCoverImage: zt2, hasGalleryImages: Bt2, isVariantDuration: Vt2, isLoading: false, hasError: h2, locale: v2, selectStaffMember: R2, clearSelection: rt2, clearStaffMember: nt2, selection: ce2, selectionTimezone: ue2.current ?? Ee2, setVariant: it2, setVariantCounts: ct2, maxParticipantsPerBooking: at2.max, toggleAddOn: lt2, setAddOnQuantity: ut2, setSlot: dt2, clearSlot: ft2, setMultiServiceSlot: mt2, clearMultiServiceSlot: ht2, draftRevision: _e2, wantsPromoCode: et2, setWantsPromoCode: I2, withSelectionParam: Ze2, navigateToNextPage: Ot2, navigateToMultiServiceForm: Dt2, resolveNextPageHref: yt2, isNavigating: xt2, editingSurface: u2, openPreferences: Et2, multiServiceAppointmentsEnabled: ke2, isMultiServiceAppointment: g2, multiServiceAppointmentServices: _2, multiServiceAppointmentSelections: _t2, multiServiceAppointmentOptionsAndVariants: P2, multiServiceAppointmentVariantsStatus: F2, bookingsSettingsLoading: Oe2, reschedule: ye2, rescheduleBooking: jt2, goHomeAfterReschedule: Nt2, canRescheduleToPick: Mt2 }), [qe2, m2, Se2, Re2, ot2, Le2, Lt2, Rt2, zt2, Bt2, Vt2, h2, v2, R2, rt2, nt2, ce2, Ee2, it2, ct2, at2.max, lt2, ut2, dt2, ft2, mt2, ht2, _e2, et2, I2, Ze2, Ot2, Dt2, yt2, xt2, u2, Et2, ke2, g2, _2, _t2, P2, F2, Oe2, ye2, jt2, Nt2, Mt2]);
|
|
6408
|
-
return p(
|
|
6410
|
+
return p(Ix.Provider, { value: Ht2, children: d2 });
|
|
6409
6411
|
}
|
|
6410
|
-
function
|
|
6412
|
+
function cS({ routerSlug: e5, initialServiceId: t2, refreshSignal: n2, editingSurface: r2, children: i2 }) {
|
|
6411
6413
|
Yp(zp.SERVICE);
|
|
6412
6414
|
let a2 = ey(), o2 = Xv(), { getParsedUrl: s2 } = cs(), [c2] = l(() => r2 ? null : ux(s2().searchParams)), [u2] = l(() => {
|
|
6413
|
-
let r3 =
|
|
6414
|
-
return r3.by === `none` ? hs(
|
|
6415
|
+
let r3 = zx(e5, c2 ? null : Hb(s2().searchParams), t2);
|
|
6416
|
+
return r3.by === `none` ? hs(Zx) : r3.by === `multi` ? _s(vy({ key: iy(o2, r3.serviceIds), refresh: n2 !== 0, warmupData: a2, fetchData: () => Yo(`service-context-load-multi-service`, { feature: Ko.service }, wp(r3.serviceIds)) }), Qx, $x) : _s(vy({ key: ry(o2, r3.by, r3.value), refresh: n2 !== 0, warmupData: a2, fetchData: () => Yo(`service-context-load`, { feature: Ko.service }, r3.by === `slug` ? Sp(r3.value) : Cp(r3.value)) }), Yx, Xx);
|
|
6415
6417
|
});
|
|
6416
|
-
return p(
|
|
6418
|
+
return p(rS, { servicePromise: u2, refreshSignal: n2, rescheduleRequest: c2, editingSurface: r2, children: i2 });
|
|
6417
6419
|
}
|
|
6418
|
-
function
|
|
6419
|
-
let { pathname: a2 } = cs(), o2 = ps(), c2 = Xv(), l2 = t2?.serviceId?.$eq, u2 = e5?.service ?? null, d2 = s(() => u2 ? { service: u2, masterEvents: e5?.masterEvents ??
|
|
6420
|
-
return d2 ? p(
|
|
6420
|
+
function lS({ serviceData: e5, servicePicker: t2, refreshSignal: n2 = 0, editingSurface: r2 = false, children: i2 }) {
|
|
6421
|
+
let { pathname: a2 } = cs(), o2 = ps(), c2 = Xv(), l2 = t2?.serviceId?.$eq, u2 = e5?.service ?? null, d2 = s(() => u2 ? { service: u2, masterEvents: e5?.masterEvents ?? Gx, serviceOptionsAndVariants: e5?.serviceOptionsAndVariants ?? null, bookingsSettings: e5?.bookingsSettings } : null, [u2, e5?.masterEvents, e5?.serviceOptionsAndVariants, e5?.bookingsSettings]);
|
|
6422
|
+
return d2 ? p(rS, { injected: d2, bookingsSettings: d2.bookingsSettings, editingSurface: r2, children: i2 }, `injected:${n2}`) : e5 ? p(rS, { bookingsSettings: e5.bookingsSettings, editingSurface: r2, children: i2 }) : p(cS, { routerSlug: o2, initialServiceId: l2, refreshSignal: n2, editingSurface: r2, children: i2 }, `fetch:${a2}:${o2 ?? ``}:${l2 ?? ``}:${n2}:${r2}:${c2}`);
|
|
6421
6423
|
}
|
|
6422
|
-
var
|
|
6424
|
+
var uS = ma(`426941a1-1d08-4cf4-ae61-e433e800cde5`);
|
|
6423
6425
|
export {
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6426
|
+
Lx as SERVICE_CONTEXT_MISSING_PROVIDER_ERROR,
|
|
6427
|
+
lS as ServiceContextProvider,
|
|
6428
|
+
lS as default,
|
|
6429
|
+
uS as injectAccessTokenGetter,
|
|
6430
|
+
zx as resolveServiceTarget,
|
|
6431
|
+
Ix as serviceContext,
|
|
6432
|
+
Rx as useServiceContext
|
|
6431
6433
|
};
|
|
6432
6434
|
//# sourceMappingURL=context-service.mjs.map
|