@wix/bookings 1.0.1800 → 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.
@@ -6535,35 +6535,35 @@ function cC({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
6535
6535
  return n3 ? (xe2.current = n3, be2(n3), true) : false;
6536
6536
  }, []), bt2 = (0, import_react.useCallback)((e6, t3) => yt2((n3) => B_(n3, e6, t3, Py())), [yt2]), xt2 = (0, import_react.useCallback)(() => {
6537
6537
  yt2(H_);
6538
- }, [yt2]), St2 = Xe2.serviceCtaState, Ct2 = (0, import_react.useMemo)(() => _2 ? (ye2 ?? r_(We2))?.services ?? nC : nC, [_2, ye2, We2]), wt2 = (0, import_react.useMemo)(() => _2 ? GS(ye2 ?? r_(We2), w2()) : null, [_2, ye2, We2, w2]), Tt2 = Es(`serviceCtaFormHrefCarriesSelection`), Et2 = (0, import_react.useCallback)((e6) => {
6539
- if (_2) return wt2 ? C2(wt2) : null;
6538
+ }, [yt2]), St2 = Xe2.serviceCtaState, Ct2 = (0, import_react.useMemo)(() => _2 ? ye2 ?? r_(We2) : null, [_2, ye2, We2]), wt2 = Ct2?.services ?? nC, Tt2 = Ct2 ? GS(Ct2, w2()) : null, Et2 = Es(`serviceCtaFormHrefCarriesSelection`), Dt2 = (0, import_react.useCallback)((e6) => {
6539
+ if (_2) return Tt2 ? C2(Tt2) : null;
6540
6540
  let t3 = W_({ actionState: St2, serviceType: p2?.type ?? null, config: e6 ?? U_ });
6541
6541
  if (G_(t3, p2?.type ?? null, me2)) return null;
6542
6542
  let n3 = S2(t3, { slug: p2?.mainSlug?.name ?? null, serviceId: p2?._id ?? null });
6543
- return n3 ? C2(Tt2 && t3 === `bookingForm` ? rt2(n3, { handoff: true }) : n3) : null;
6544
- }, [_2, wt2, St2, p2, me2, S2, C2, Tt2, rt2]), Dt2 = Bb(), [Ot2, kt2] = (0, import_react.useState)(false), At2 = (0, import_react.useRef)(false), jt2 = (0, import_react.useCallback)(() => {
6545
- At2.current = false, kt2(false);
6543
+ return n3 ? C2(Et2 && t3 === `bookingForm` ? rt2(n3, { handoff: true }) : n3) : null;
6544
+ }, [_2, Tt2, St2, p2, me2, S2, C2, Et2, rt2]), Ot2 = Bb(), [kt2, At2] = (0, import_react.useState)(false), jt2 = (0, import_react.useRef)(false), Mt2 = (0, import_react.useCallback)(() => {
6545
+ jt2.current = false, At2(false);
6546
6546
  }, []);
6547
- Ex(jt2);
6548
- let Mt2 = (0, import_react.useCallback)((e6) => {
6549
- At2.current = true, kt2(true);
6547
+ Ex(Mt2);
6548
+ let Nt2 = (0, import_react.useCallback)((e6) => {
6549
+ jt2.current = true, At2(true);
6550
6550
  let t3 = D2.current(), n3 = new URL(C2(e6), t3).pathname === t3.pathname;
6551
6551
  ee2(e6).then(() => {
6552
- (n3 || D2.current().href !== t3.href) && jt2();
6552
+ (n3 || D2.current().href !== t3.href) && Mt2();
6553
6553
  }, (e7) => {
6554
- $o(e7, { feature: Zo.serviceCta, action: `navigateToNextPage` }), jt2();
6554
+ $o(e7, { feature: Zo.serviceCta, action: `navigateToNextPage` }), Mt2();
6555
6555
  });
6556
- }, [ee2, jt2, C2]), Nt2 = (0, import_react.useCallback)(() => Dt2.open(Ib(Ub({ service: p2, pricingOption: ft2 ?? void 0, selection: WS(M2 ?? ``, D2.current().searchParams), multiServiceAppointmentsEnabled: Pe2 }))), [Dt2, p2, ft2, M2, Pe2]), Pt2 = (0, import_react.useCallback)((e6) => {
6557
- if (At2.current) return;
6556
+ }, [ee2, Mt2, C2]), Pt2 = (0, import_react.useCallback)(() => Ot2.open(Ib(Ub({ service: p2, pricingOption: ft2 ?? void 0, selection: WS(M2 ?? ``, D2.current().searchParams), multiServiceAppointmentsEnabled: Pe2 }))), [Ot2, p2, ft2, M2, Pe2]), Ft2 = (0, import_react.useCallback)((e6) => {
6557
+ if (jt2.current) return;
6558
6558
  let t3 = xe2.current ?? r_(a_(D2.current().searchParams)), n3 = GS(t3, w2());
6559
6559
  if (n3) {
6560
6560
  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 }));
6561
- Mt2(n3);
6561
+ Nt2(n3);
6562
6562
  }
6563
- }, [w2, v2, Mt2]), Ft2 = (0, import_react.useCallback)((e6, t3 = Uy.WIDGET_BUTTON) => {
6564
- if (At2.current || a2) return;
6563
+ }, [w2, v2, Nt2]), It2 = (0, import_react.useCallback)((e6, t3 = Uy.WIDGET_BUTTON) => {
6564
+ if (jt2.current || a2) return;
6565
6565
  if (_2) {
6566
- Pt2(E2);
6566
+ Ft2(E2);
6567
6567
  return;
6568
6568
  }
6569
6569
  let n3 = W_({ actionState: St2, serviceType: p2?.type ?? null, config: e6 ?? U_ });
@@ -6574,12 +6574,12 @@ function cC({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
6574
6574
  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;
6575
6575
  E2(Qy({ service_id: p2?._id ?? void 0, type: p2?.type ?? void 0, isPendingApproval: p2 ? Gm(p2) : void 0, referralInfo: t3, actionName: Gy[n3] }));
6576
6576
  let o3 = n3 === `bookingForm`;
6577
- !o3 && !g_(j2.current.selection) ? Mt2(y_(i2, D2.current())) : Mt2(rt2(i2, { handoff: o3 }));
6578
- }, [a2, _2, Pt2, We2, St2, p2, je2, S2, Mt2, rt2, E2]), It2 = ({ bookable: e6, staffChoiceRequired: t3, timezone: n3 }) => ({ bookable: e6, staffChoiceRequired: t3, timezone: n3 ?? je2 ?? `UTC`, validUntil: we2?.validUntil ?? null }), Lt2 = (0, import_react.useRef)(It2);
6579
- Lt2.current = It2;
6580
- let Rt2 = (0, import_react.useCallback)(async () => {
6577
+ !o3 && !g_(j2.current.selection) ? Nt2(y_(i2, D2.current())) : Nt2(rt2(i2, { handoff: o3 }));
6578
+ }, [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 = (0, import_react.useRef)(Lt2);
6579
+ Rt2.current = Lt2;
6580
+ let zt2 = (0, import_react.useCallback)(async () => {
6581
6581
  let e6 = we2?.status === `ready` ? we2.booking : null;
6582
- if (!we2 || !a2 || !e6 || !kS(j2.current.selection, Lt2.current(j2.current.pick))) return { outcome: `failed` };
6582
+ if (!we2 || !a2 || !e6 || !kS(j2.current.selection, Rt2.current(j2.current.pick))) return { outcome: `failed` };
6583
6583
  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 }));
6584
6584
  let t3 = b_(j2.current.selection, tt2.current), n3;
6585
6585
  try {
@@ -6597,10 +6597,10 @@ function cC({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
6597
6597
  } catch (e7) {
6598
6598
  return $o(e7, { feature: Zo.reschedule, action: `return-after-reschedule` }), r2;
6599
6599
  }
6600
- }, [we2, a2, T2, ee2, te2, E2]), zt2 = kS(me2, It2(fe2.pick)), Bt2 = fe2.pick.timezone ?? je2, Vt2 = !fe2.pick.bookable, Ht2 = (0, import_react.useCallback)(() => {
6600
+ }, [we2, a2, T2, ee2, te2, E2]), Bt2 = kS(me2, Lt2(fe2.pick)), Vt2 = fe2.pick.timezone ?? je2, Ht2 = !fe2.pick.bookable, Ut2 = (0, import_react.useCallback)(() => {
6601
6601
  E2(By({ component: Jy.GO_TO_HOMEPAGE_BUTTON, action: Ky, pageName: Yy })), ee2(`/`).catch((e6) => $o(e6, { feature: Zo.reschedule, action: `go-home` }));
6602
- }, [ee2, E2]), { serviceBookability: Ut2, policyDescription: Wt2, coverImage: Gt2 } = Xe2, Kt2 = (0, import_react.useCallback)(() => Ut2.isAvailableForBooking, [Ut2]), qt2 = (0, import_react.useCallback)(() => !!Wt2, [Wt2]), Jt2 = (0, import_react.useCallback)(() => !!Gt2, [Gt2]), Yt2 = (0, import_react.useCallback)(() => iv(p2), [p2]), Xt2 = (0, import_react.useCallback)(() => !!p2 && Pb(p2), [p2]), Zt2 = (0, import_react.useMemo)(() => ({ ...Xe2, service: p2, servicePageLink: De2, serviceOptionsAndVariants: Ue2, pricingOption: ft2, isLoadingServiceOptionsAndVariants: He2, isAvailableForBooking: Kt2, hasPolicyDescription: qt2, hasCoverImage: Jt2, hasGalleryImages: Yt2, isVariantDuration: Xt2, isLoading: g2, hasError: m2, locale: y2, selectStaffMember: st2, clearSelection: lt2, clearStaffMember: ct2, selection: me2, isSelectionPending: ge2 || me2.serviceId !== (M2 ?? ``), selectionTimezone: Bt2, 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: Ft2, navigateToMultiServiceForm: Pt2, resolveNextPageHref: Et2, isNavigating: Ot2, isWaitlistSlotSelected: Vt2, siteId: ve2, editingSurface: o2, openPreferences: Nt2, multiServiceAppointmentsEnabled: Pe2, isMultiServiceAppointment: _2, multiServiceAppointmentServices: v2, multiServiceAppointmentSelections: Ct2, multiServiceAppointmentOptionsAndVariants: Je2, multiServiceAppointmentVariantsStatus: Ye2, bookingsSettingsLoading: Ne2, reschedule: we2, rescheduleBooking: Rt2, goHomeAfterReschedule: Ht2, canRescheduleToPick: zt2 }), [Xe2, p2, De2, Ue2, ft2, He2, Kt2, qt2, Jt2, Yt2, Xt2, g2, m2, y2, st2, lt2, ct2, me2, ge2, M2, Bt2, ut2, mt2, dt2.max, ht2, gt2, _t2, vt2, bt2, xt2, Se2, it2, R2, rt2, Ft2, Pt2, Et2, Ot2, Vt2, ve2, o2, Nt2, Pe2, _2, v2, Ct2, Je2, Ye2, Ne2, we2, Rt2, Ht2, zt2]);
6603
- return (0, import_jsx_runtime.jsx)(IS.Provider, { value: Zt2, children: c2 });
6602
+ }, [ee2, E2]), { serviceBookability: Wt2, policyDescription: Gt2, coverImage: Kt2 } = Xe2, qt2 = (0, import_react.useCallback)(() => Wt2.isAvailableForBooking, [Wt2]), Jt2 = (0, import_react.useCallback)(() => !!Gt2, [Gt2]), Yt2 = (0, import_react.useCallback)(() => !!Kt2, [Kt2]), Xt2 = (0, import_react.useCallback)(() => iv(p2), [p2]), Zt2 = (0, import_react.useCallback)(() => !!p2 && Pb(p2), [p2]), Qt2 = (0, import_react.useMemo)(() => ({ ...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]);
6603
+ return (0, import_jsx_runtime.jsx)(IS.Provider, { value: Qt2, children: c2 });
6604
6604
  }
6605
6605
  function lC(e5, t2, n2) {
6606
6606
  let r2 = zS(e5, Px(t2), n2);