@wix/bookings 1.0.1799 → 1.0.1801
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.js +282 -251
- package/build/cjs/context-booking-checkout.js.map +1 -1
- package/build/cjs/context-service.js +24 -24
- package/build/cjs/context-service.js.map +1 -1
- package/build/es/context-booking-checkout.mjs +282 -251
- package/build/es/context-booking-checkout.mjs.map +1 -1
- package/build/es/context-service.mjs +24 -24
- package/build/es/context-service.mjs.map +1 -1
- package/context-runtime/context-booking-checkout/runtime.js +3 -3
- package/context-runtime/context-service/runtime.js +2 -2
- package/package.json +8 -8
|
@@ -6503,35 +6503,35 @@ function cC({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
|
|
|
6503
6503
|
return n3 ? (xe2.current = n3, be2(n3), true) : false;
|
|
6504
6504
|
}, []), bt2 = i((e6, t3) => yt2((n3) => B_(n3, e6, t3, Py())), [yt2]), xt2 = i(() => {
|
|
6505
6505
|
yt2(H_);
|
|
6506
|
-
}, [yt2]), St2 = Xe2.serviceCtaState, Ct2 = l(() => _2 ?
|
|
6507
|
-
if (_2) return
|
|
6506
|
+
}, [yt2]), St2 = Xe2.serviceCtaState, Ct2 = l(() => _2 ? ye2 ?? r_(We2) : null, [_2, ye2, We2]), wt2 = Ct2?.services ?? nC, Tt2 = Ct2 ? GS(Ct2, w2()) : null, Et2 = Es(`serviceCtaFormHrefCarriesSelection`), Dt2 = i((e6) => {
|
|
6507
|
+
if (_2) return Tt2 ? C2(Tt2) : null;
|
|
6508
6508
|
let t3 = W_({ actionState: St2, serviceType: p2?.type ?? null, config: e6 ?? U_ });
|
|
6509
6509
|
if (G_(t3, p2?.type ?? null, me2)) return null;
|
|
6510
6510
|
let n3 = S2(t3, { slug: p2?.mainSlug?.name ?? null, serviceId: p2?._id ?? null });
|
|
6511
|
-
return n3 ? C2(
|
|
6512
|
-
}, [_2,
|
|
6513
|
-
|
|
6511
|
+
return n3 ? C2(Et2 && t3 === `bookingForm` ? rt2(n3, { handoff: true }) : n3) : null;
|
|
6512
|
+
}, [_2, Tt2, St2, p2, me2, S2, C2, Et2, rt2]), Ot2 = Bb(), [kt2, At2] = d(false), jt2 = u(false), Mt2 = i(() => {
|
|
6513
|
+
jt2.current = false, At2(false);
|
|
6514
6514
|
}, []);
|
|
6515
|
-
Ex(
|
|
6516
|
-
let
|
|
6517
|
-
|
|
6515
|
+
Ex(Mt2);
|
|
6516
|
+
let Nt2 = i((e6) => {
|
|
6517
|
+
jt2.current = true, At2(true);
|
|
6518
6518
|
let t3 = D2.current(), n3 = new URL(C2(e6), t3).pathname === t3.pathname;
|
|
6519
6519
|
ee2(e6).then(() => {
|
|
6520
|
-
(n3 || D2.current().href !== t3.href) &&
|
|
6520
|
+
(n3 || D2.current().href !== t3.href) && Mt2();
|
|
6521
6521
|
}, (e7) => {
|
|
6522
|
-
$o(e7, { feature: Zo.serviceCta, action: `navigateToNextPage` }),
|
|
6522
|
+
$o(e7, { feature: Zo.serviceCta, action: `navigateToNextPage` }), Mt2();
|
|
6523
6523
|
});
|
|
6524
|
-
}, [ee2,
|
|
6525
|
-
if (
|
|
6524
|
+
}, [ee2, Mt2, C2]), Pt2 = i(() => Ot2.open(Ib(Ub({ service: p2, pricingOption: ft2 ?? void 0, selection: WS(M2 ?? ``, D2.current().searchParams), multiServiceAppointmentsEnabled: Pe2 }))), [Ot2, p2, ft2, M2, Pe2]), Ft2 = i((e6) => {
|
|
6525
|
+
if (jt2.current) return;
|
|
6526
6526
|
let t3 = xe2.current ?? r_(a_(D2.current().searchParams)), n3 = GS(t3, w2());
|
|
6527
6527
|
if (n3) {
|
|
6528
6528
|
for (let n4 of t3?.services ?? []) e6(rb({ serviceId: n4.serviceId, serviceType: n4.serviceType ?? v2.find(({ _id: e7 }) => e7 === n4.serviceId)?.type ?? void 0, start: n4.slotStart, end: n4.slotEnd, timeZone: t3?.timezone ?? void 0, isEligibleForFlowCompletion: true }));
|
|
6529
|
-
|
|
6529
|
+
Nt2(n3);
|
|
6530
6530
|
}
|
|
6531
|
-
}, [w2, v2,
|
|
6532
|
-
if (
|
|
6531
|
+
}, [w2, v2, Nt2]), It2 = i((e6, t3 = Uy.WIDGET_BUTTON) => {
|
|
6532
|
+
if (jt2.current || a2) return;
|
|
6533
6533
|
if (_2) {
|
|
6534
|
-
|
|
6534
|
+
Ft2(E2);
|
|
6535
6535
|
return;
|
|
6536
6536
|
}
|
|
6537
6537
|
let n3 = W_({ actionState: St2, serviceType: p2?.type ?? null, config: e6 ?? U_ });
|
|
@@ -6542,12 +6542,12 @@ function cC({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
|
|
|
6542
6542
|
if (n3 !== `servicePage` && !r2 && E2(Ry({ bookingsServiceId: p2?._id ?? void 0, serviceType: p2?.type ?? void 0, isEligibleForFlowCompletion: !!i2 })), r2 && E2(rb({ serviceId: p2?._id ?? void 0, serviceType: p2?.type ?? void 0, start: j2.current.selection.slotStart, end: j2.current.selection.slotEnd, timeZone: j2.current.pick.timezone ?? r_(We2)?.timezone ?? je2, isEligibleForFlowCompletion: !!i2 })), E2(Iy({ service_id: p2?._id ?? void 0, destination: Wy[n3] })), !i2) return;
|
|
6543
6543
|
E2(Qy({ service_id: p2?._id ?? void 0, type: p2?.type ?? void 0, isPendingApproval: p2 ? Gm(p2) : void 0, referralInfo: t3, actionName: Gy[n3] }));
|
|
6544
6544
|
let o3 = n3 === `bookingForm`;
|
|
6545
|
-
!o3 && !g_(j2.current.selection) ?
|
|
6546
|
-
}, [a2, _2,
|
|
6547
|
-
|
|
6548
|
-
let
|
|
6545
|
+
!o3 && !g_(j2.current.selection) ? Nt2(y_(i2, D2.current())) : Nt2(rt2(i2, { handoff: o3 }));
|
|
6546
|
+
}, [a2, _2, Ft2, We2, St2, p2, je2, S2, Nt2, rt2, E2]), Lt2 = ({ bookable: e6, staffChoiceRequired: t3, timezone: n3 }) => ({ bookable: e6, staffChoiceRequired: t3, timezone: n3 ?? je2 ?? `UTC`, validUntil: we2?.validUntil ?? null }), Rt2 = u(Lt2);
|
|
6547
|
+
Rt2.current = Lt2;
|
|
6548
|
+
let zt2 = i(async () => {
|
|
6549
6549
|
let e6 = we2?.status === `ready` ? we2.booking : null;
|
|
6550
|
-
if (!we2 || !a2 || !e6 || !kS(j2.current.selection,
|
|
6550
|
+
if (!we2 || !a2 || !e6 || !kS(j2.current.selection, Rt2.current(j2.current.pick))) return { outcome: `failed` };
|
|
6551
6551
|
E2(eb({ component: qy.RESCHEDULE_DIALOG, element: Jy.CONFIRM_BUTTON })), E2(By({ action: Ky, pageName: Jy.CONFIRM_BUTTON, referralInfo: D2.current().searchParams.get(i_.referral) ?? void 0 }));
|
|
6552
6552
|
let t3 = b_(j2.current.selection, tt2.current), n3;
|
|
6553
6553
|
try {
|
|
@@ -6565,10 +6565,10 @@ function cC({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
|
|
|
6565
6565
|
} catch (e7) {
|
|
6566
6566
|
return $o(e7, { feature: Zo.reschedule, action: `return-after-reschedule` }), r2;
|
|
6567
6567
|
}
|
|
6568
|
-
}, [we2, a2, T2, ee2, te2, E2]),
|
|
6568
|
+
}, [we2, a2, T2, ee2, te2, E2]), Bt2 = kS(me2, Lt2(fe2.pick)), Vt2 = fe2.pick.timezone ?? je2, Ht2 = !fe2.pick.bookable, Ut2 = i(() => {
|
|
6569
6569
|
E2(By({ component: Jy.GO_TO_HOMEPAGE_BUTTON, action: Ky, pageName: Yy })), ee2(`/`).catch((e6) => $o(e6, { feature: Zo.reschedule, action: `go-home` }));
|
|
6570
|
-
}, [ee2, E2]), { serviceBookability:
|
|
6571
|
-
return h(IS.Provider, { value:
|
|
6570
|
+
}, [ee2, E2]), { serviceBookability: Wt2, policyDescription: Gt2, coverImage: Kt2 } = Xe2, qt2 = i(() => Wt2.isAvailableForBooking, [Wt2]), Jt2 = i(() => !!Gt2, [Gt2]), Yt2 = i(() => !!Kt2, [Kt2]), Xt2 = i(() => iv(p2), [p2]), Zt2 = i(() => !!p2 && Pb(p2), [p2]), Qt2 = l(() => ({ ...Xe2, service: p2, servicePageLink: De2, serviceOptionsAndVariants: Ue2, pricingOption: ft2, isLoadingServiceOptionsAndVariants: He2, isAvailableForBooking: qt2, hasPolicyDescription: Jt2, hasCoverImage: Yt2, hasGalleryImages: Xt2, isVariantDuration: Zt2, isLoading: g2, hasError: m2, locale: y2, selectStaffMember: st2, clearSelection: lt2, clearStaffMember: ct2, selection: me2, isSelectionPending: ge2 || me2.serviceId !== (M2 ?? ``), selectionTimezone: Vt2, setVariant: ut2, setVariantCounts: mt2, maxParticipantsPerBooking: dt2.max, toggleAddOn: ht2, setAddOnQuantity: gt2, setSlot: _t2, clearSlot: vt2, setMultiServiceSlot: bt2, clearMultiServiceSlot: xt2, draftRevision: Se2, wantsPromoCode: it2, setWantsPromoCode: R2, withSelectionParam: rt2, navigateToNextPage: It2, navigateToMultiServiceForm: Ft2, resolveNextPageHref: Dt2, isNavigating: kt2, isWaitlistSlotSelected: Ht2, siteId: ve2, editingSurface: o2, openPreferences: Pt2, multiServiceAppointmentsEnabled: Pe2, isMultiServiceAppointment: _2, multiServiceAppointmentServices: v2, multiServiceAppointmentSelections: wt2, multiServiceAppointmentOptionsAndVariants: Je2, multiServiceAppointmentVariantsStatus: Ye2, bookingsSettingsLoading: Ne2, reschedule: we2, rescheduleBooking: zt2, goHomeAfterReschedule: Ut2, canRescheduleToPick: Bt2 }), [Xe2, p2, De2, Ue2, ft2, He2, qt2, Jt2, Yt2, Xt2, Zt2, g2, m2, y2, st2, lt2, ct2, me2, ge2, M2, Vt2, ut2, mt2, dt2.max, ht2, gt2, _t2, vt2, bt2, xt2, Se2, it2, R2, rt2, It2, Ft2, Dt2, kt2, Ht2, ve2, o2, Pt2, Pe2, _2, v2, wt2, Je2, Ye2, Ne2, we2, zt2, Ut2, Bt2]);
|
|
6571
|
+
return h(IS.Provider, { value: Qt2, children: c2 });
|
|
6572
6572
|
}
|
|
6573
6573
|
function lC(e5, t2, n2) {
|
|
6574
6574
|
let r2 = zS(e5, Px(t2), n2);
|