@loczer/storefront-sdk 0.151.0 → 0.153.0
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/dist/StorefrontProvider.d.ts +677 -1119
- package/dist/StorefrontProvider.d.ts.map +1 -0
- package/dist/chunks/pkg/booking-engine/dist/schemas/{booking-engine-configuration-CnBdp3jk.js → booking-engine-configuration-BKlzwJJX.js} +20 -19
- package/dist/chunks/pkg/booking-engine/dist/schemas/{cart-inputs-DYgEGJ5M.js → cart-inputs-ByBK0IVJ.js} +2 -2
- package/dist/chunks/pkg/booking-engine/dist/schemas/{public-booking-engine-configuration-C9VB-WhU.js → public-booking-engine-configuration-DKoak4s5.js} +2 -2
- package/dist/chunks/pkg/booking-engine/dist/schemas/shop-opening-hours-DqNWstqT.js +51 -0
- package/dist/components/AboutSection/index.d.ts.map +1 -0
- package/dist/components/AboutSection/index.js +6 -6
- package/dist/components/AddressAutocompleteInput/index.d.ts.map +1 -0
- package/dist/components/BikeProductCard/index.d.ts.map +1 -0
- package/dist/components/BookingBikeVariantDialog/index.d.ts +12 -2
- package/dist/components/BookingBikeVariantDialog/index.d.ts.map +1 -0
- package/dist/components/BookingFlowSteps/index.d.ts.map +1 -0
- package/dist/components/BookingPeriodSelector/BookingPeriodContext.d.ts +9 -0
- package/dist/components/BookingPeriodSelector/BookingPeriodContext.d.ts.map +1 -0
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.d.ts +2 -0
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.d.ts.map +1 -0
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.d.ts +2 -0
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.d.ts.map +1 -0
- package/dist/components/BookingPeriodSelector/components/BookingPeriodFieldErrorMessage.d.ts +7 -0
- package/dist/components/BookingPeriodSelector/components/BookingPeriodFieldErrorMessage.d.ts.map +1 -0
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.d.ts +2 -0
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.d.ts.map +1 -0
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.d.ts +2 -0
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.d.ts.map +1 -0
- package/dist/components/BookingPeriodSelector/components/internal/ModalDayPickerField.d.ts +24 -0
- package/dist/components/BookingPeriodSelector/components/internal/ModalDayPickerField.d.ts.map +1 -0
- package/dist/components/BookingPeriodSelector/components/internal/ModalHourPickerField.d.ts +22 -0
- package/dist/components/BookingPeriodSelector/components/internal/ModalHourPickerField.d.ts.map +1 -0
- package/dist/components/BookingPeriodSelector/index.d.ts.map +1 -0
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts +102 -0
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -0
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +76 -80
- package/dist/components/ContactSection/index.d.ts.map +1 -0
- package/dist/components/ContactSection/index.js +5 -5
- package/dist/components/ContractSaleDocument/AcceptanceModal.d.ts +8 -0
- package/dist/components/ContractSaleDocument/AcceptanceModal.d.ts.map +1 -0
- package/dist/components/ContractSaleDocument/Invoice.d.ts +13 -0
- package/dist/components/ContractSaleDocument/Invoice.d.ts.map +1 -0
- package/dist/components/ContractSaleDocument/InvoiceDetails.d.ts +18 -0
- package/dist/components/ContractSaleDocument/InvoiceDetails.d.ts.map +1 -0
- package/dist/components/ContractSaleDocument/Page.d.ts +8 -0
- package/dist/components/ContractSaleDocument/Page.d.ts.map +1 -0
- package/dist/components/ContractSaleDocument/PageFooter.d.ts +11 -0
- package/dist/components/ContractSaleDocument/PageFooter.d.ts.map +1 -0
- package/dist/components/ContractSaleDocument/PageHeader.d.ts +11 -0
- package/dist/components/ContractSaleDocument/PageHeader.d.ts.map +1 -0
- package/dist/components/ContractSaleDocument/SignatureModal.d.ts +9 -0
- package/dist/components/ContractSaleDocument/SignatureModal.d.ts.map +1 -0
- package/dist/components/ContractSaleDocument/TermsAndConditionsContent.d.ts +12 -0
- package/dist/components/ContractSaleDocument/TermsAndConditionsContent.d.ts.map +1 -0
- package/dist/components/ContractSaleDocument/ThumbnailSidebar.d.ts +12 -0
- package/dist/components/ContractSaleDocument/ThumbnailSidebar.d.ts.map +1 -0
- package/dist/components/ContractSaleDocument/index.d.ts.map +1 -0
- package/dist/components/ContractSaleDocument/language.d.ts +7 -0
- package/dist/components/ContractSaleDocument/language.d.ts.map +1 -0
- package/dist/components/DelayedReveal/index.d.ts.map +1 -0
- package/dist/components/DeliveryAddressSelector/index.d.ts.map +1 -0
- package/dist/components/Footer/BusinessHours.d.ts +17 -0
- package/dist/components/Footer/BusinessHours.d.ts.map +1 -0
- package/dist/components/Footer/businessHoursUtils.d.ts +14 -0
- package/dist/components/Footer/businessHoursUtils.d.ts.map +1 -0
- package/dist/components/Footer/index.d.ts.map +1 -0
- package/dist/components/FulfillmentSection/index.d.ts.map +1 -0
- package/dist/components/Header/index.d.ts.map +1 -0
- package/dist/components/Layout/index.d.ts.map +1 -0
- package/dist/components/Map/createMarkerElement.d.ts +2 -0
- package/dist/components/Map/createMarkerElement.d.ts.map +1 -0
- package/dist/components/Map/index.d.ts +101 -1
- package/dist/components/Map/index.d.ts.map +1 -0
- package/dist/components/Map/index.js +4 -3
- package/dist/components/PlatformFooter/index.d.ts.map +1 -0
- package/dist/components/PlaygroundDevFloatingButton/index.d.ts.map +1 -0
- package/dist/components/PoweredByLoczerBadge/index.d.ts.map +1 -0
- package/dist/components/ProductPriceBadge/index.d.ts.map +1 -0
- package/dist/components/ProductWarningNotice/index.d.ts.map +1 -0
- package/dist/components/StepSectionTitle/index.d.ts.map +1 -0
- package/dist/components/StorefrontCartPanel/index.d.ts.map +1 -0
- package/dist/components/StorefrontPopupMessages/index.d.ts.map +1 -0
- package/dist/components/TestimonialsSection/index.d.ts.map +1 -0
- package/dist/components/WhatsAppFloatingButton/WhatsAppFloatingButton.d.ts +5 -0
- package/dist/components/WhatsAppFloatingButton/WhatsAppFloatingButton.d.ts.map +1 -0
- package/dist/components/WhatsAppFloatingButton/index.d.ts.map +1 -0
- package/dist/components/WhatsAppFloatingButton/useWhatsAppFloatingButton.d.ts +11 -0
- package/dist/components/WhatsAppFloatingButton/useWhatsAppFloatingButton.d.ts.map +1 -0
- package/dist/components/payment/MollieCardFieldsForm.d.ts +11 -0
- package/dist/components/payment/MollieCardFieldsForm.d.ts.map +1 -0
- package/dist/components/payment/StripeCardFieldsForm.d.ts +16 -0
- package/dist/components/payment/StripeCardFieldsForm.d.ts.map +1 -0
- package/dist/components/payment/index.d.ts.map +1 -0
- package/dist/data/accessories.d.ts.map +1 -0
- package/dist/data/bikes.d.ts.map +1 -0
- package/dist/data/config.d.ts.map +1 -0
- package/dist/i18n/I18nProvider.d.ts.map +1 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/fr.d.ts.map +1 -0
- package/dist/index.d.ts +5212 -0
- package/dist/index.js +308 -300
- package/dist/lib/apiCall.d.ts.map +1 -0
- package/dist/lib/booking-period-time-slots.d.ts +0 -31
- package/dist/lib/booking-period-time-slots.d.ts.map +1 -0
- package/dist/lib/booking-period-time-slots.js +122 -221
- package/dist/lib/booking-period.d.ts +5 -0
- package/dist/lib/booking-period.d.ts.map +1 -0
- package/dist/lib/booking.d.ts +3 -0
- package/dist/lib/booking.d.ts.map +1 -0
- package/dist/lib/booking.js +102 -89
- package/dist/lib/cart.d.ts.map +1 -0
- package/dist/lib/cartSummary.d.ts.map +1 -0
- package/dist/lib/checkoutPaymentDecision.d.ts.map +1 -0
- package/dist/lib/checkoutPaymentSession.d.ts.map +1 -0
- package/dist/lib/checkoutSubmit.d.ts.map +1 -0
- package/dist/lib/checkoutSubmit.js +4 -4
- package/dist/lib/checkoutVerifyCoupon.d.ts.map +1 -0
- package/dist/lib/contactForm.d.ts.map +1 -0
- package/dist/lib/contractSaleDocument.d.ts.map +1 -0
- package/dist/lib/contractSaleDocumentApi.d.ts.map +1 -0
- package/dist/lib/isAutomationRuntime.d.ts.map +1 -0
- package/dist/lib/mollieComponentStyles.d.ts.map +1 -0
- package/dist/lib/playgroundDevSettings.d.ts.map +1 -0
- package/dist/lib/pricing.d.ts.map +1 -0
- package/dist/lib/productImageStyles.d.ts.map +1 -0
- package/dist/lib/productVariants.d.ts.map +1 -0
- package/dist/lib/products.d.ts.map +1 -0
- package/dist/lib/richAddress.d.ts.map +1 -0
- package/dist/lib/securePaymentLink.d.ts.map +1 -0
- package/dist/lib/storefrontAvailability.d.ts.map +1 -0
- package/dist/lib/storefrontImage.d.ts.map +1 -0
- package/dist/lib/storefrontProducts.d.ts.map +1 -0
- package/dist/lib/storefrontReviews.d.ts.map +1 -0
- package/dist/lib/storefrontTimeSlots.d.ts +43 -0
- package/dist/lib/storefrontTimeSlots.d.ts.map +1 -0
- package/dist/lib/storefrontTimeSlots.js +26 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/whatsapp.d.ts.map +1 -0
- package/dist/localization.d.ts +9 -13
- package/dist/localization.d.ts.map +1 -0
- package/dist/pages/BookingPage.d.ts.map +1 -0
- package/dist/pages/CheckoutPage.d.ts.map +1 -0
- package/dist/pages/CheckoutPaymentPage.d.ts.map +1 -0
- package/dist/pages/CheckoutSuccessPage.d.ts.map +1 -0
- package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -0
- package/dist/pages/ErrorPage.d.ts.map +1 -0
- package/dist/pages/HomePage.d.ts.map +1 -0
- package/dist/pages/NotFoundPage.d.ts.map +1 -0
- package/dist/pages/PaymentLinkPage.d.ts.map +1 -0
- package/dist/pages/PaymentLinkSuccessPage.d.ts.map +1 -0
- package/dist/pages/ProductPage.d.ts.map +1 -0
- package/dist/pages/checkout/components/CheckoutCouponCard.d.ts +15 -0
- package/dist/pages/checkout/components/CheckoutCouponCard.d.ts.map +1 -0
- package/dist/pages/checkout/components/CheckoutDetailsCard.d.ts +9 -0
- package/dist/pages/checkout/components/CheckoutDetailsCard.d.ts.map +1 -0
- package/dist/pages/checkout/components/CheckoutPaymentCard.d.ts +22 -0
- package/dist/pages/checkout/components/CheckoutPaymentCard.d.ts.map +1 -0
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.d.ts +23 -0
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.d.ts.map +1 -0
- package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts +7 -0
- package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts.map +1 -0
- package/dist/pages/checkout/components/MollieCheckoutForm.d.ts +9 -0
- package/dist/pages/checkout/components/MollieCheckoutForm.d.ts.map +1 -0
- package/dist/pages/checkout/components/StripeCheckoutForm.d.ts +8 -0
- package/dist/pages/checkout/components/StripeCheckoutForm.d.ts.map +1 -0
- package/dist/pages/checkout/types.d.ts +14 -0
- package/dist/pages/checkout/types.d.ts.map +1 -0
- package/dist/routes.d.ts +3 -6
- package/dist/routes.d.ts.map +1 -0
- package/dist/static/strings.d.ts +2 -0
- package/dist/static/strings.d.ts.map +1 -0
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.d.ts +565 -588
- package/dist/storefrontSchemas.d.ts.map +1 -0
- package/dist/storefrontSchemas.js +4 -4
- package/dist/ui/badge.d.ts.map +1 -0
- package/dist/ui/button.d.ts.map +1 -0
- package/dist/ui/card.d.ts.map +1 -0
- package/dist/ui/form.d.ts.map +1 -0
- package/dist/ui/input.d.ts.map +1 -0
- package/dist/ui/label.d.ts.map +1 -0
- package/dist/ui/radio-group.d.ts.map +1 -0
- package/dist/ui/select.d.ts.map +1 -0
- package/dist/ui/slot.d.ts.map +1 -0
- package/dist/ui/textarea.d.ts.map +1 -0
- package/dist/ui/tooltip.d.ts.map +1 -0
- package/package.json +4 -2
- package/dist/BookingPage.d.ts +0 -6
- package/dist/CheckoutPage.d.ts +0 -6
- package/dist/CheckoutPaymentPage.d.ts +0 -6
- package/dist/CheckoutSuccessPage.d.ts +0 -6
- package/dist/ContractSaleDocumentPage.d.ts +0 -116
- package/dist/ErrorPage.d.ts +0 -6
- package/dist/HomePage.d.ts +0 -6
- package/dist/I18nProvider.d.ts +0 -23
- package/dist/NotFoundPage.d.ts +0 -6
- package/dist/PaymentLinkPage.d.ts +0 -40
- package/dist/PaymentLinkSuccessPage.d.ts +0 -40
- package/dist/ProductPage.d.ts +0 -6
- package/dist/accessories.d.ts +0 -42
- package/dist/apiCall.d.ts +0 -7
- package/dist/badge.d.ts +0 -14
- package/dist/bikes.d.ts +0 -107
- package/dist/booking-period-time-slots.d.ts +0 -298
- package/dist/booking-period.d.ts +0 -187
- package/dist/booking.d.ts +0 -384
- package/dist/button.d.ts +0 -16
- package/dist/card.d.ts +0 -18
- package/dist/cart.d.ts +0 -30
- package/dist/cartSummary.d.ts +0 -205
- package/dist/checkoutPaymentDecision.d.ts +0 -48
- package/dist/checkoutPaymentSession.d.ts +0 -65
- package/dist/checkoutSubmit.d.ts +0 -97
- package/dist/checkoutVerifyCoupon.d.ts +0 -45
- package/dist/chunks/pkg/booking-engine/dist/schemas/shop-opening-hours-B47MMaoD.js +0 -45
- package/dist/config.d.ts +0 -19
- package/dist/contactForm.d.ts +0 -22
- package/dist/contractSaleDocument.d.ts +0 -242
- package/dist/contractSaleDocumentApi.d.ts +0 -481
- package/dist/en.d.ts +0 -369
- package/dist/form.d.ts +0 -44
- package/dist/fr.d.ts +0 -369
- package/dist/input.d.ts +0 -5
- package/dist/isAutomationRuntime.d.ts +0 -3
- package/dist/label.d.ts +0 -7
- package/dist/mollieComponentStyles.d.ts +0 -3
- package/dist/playgroundDevSettings.d.ts +0 -19
- package/dist/pricing.d.ts +0 -35
- package/dist/productImageStyles.d.ts +0 -25
- package/dist/productVariants.d.ts +0 -16
- package/dist/products.d.ts +0 -224
- package/dist/radio-group.d.ts +0 -14
- package/dist/richAddress.d.ts +0 -24
- package/dist/securePaymentLink.d.ts +0 -125
- package/dist/select.d.ts +0 -41
- package/dist/slot.d.ts +0 -15
- package/dist/storefrontAvailability.d.ts +0 -107
- package/dist/storefrontImage.d.ts +0 -16
- package/dist/storefrontProducts.d.ts +0 -400
- package/dist/storefrontReviews.d.ts +0 -84
- package/dist/textarea.d.ts +0 -5
- package/dist/tooltip.d.ts +0 -43
- package/dist/utils.d.ts +0 -23
- package/dist/whatsapp.d.ts +0 -318
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiCall.d.ts","sourceRoot":"","sources":["../../src/lib/apiCall.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAYvC,eAAO,MAAM,OAAO,GAAI,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACzD,MAAM,MAAM,EACZ,SAAS,OAAO,EAChB,MAAM,GAAG,KACR,OAAO,CAAC,SAAS,CAGqD,CAAA;AAEzE,eAAO,MAAM,MAAM,GAAI,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACxD,MAAM,MAAM,EACZ,UAAS,OAAY,EACrB,MAAM,GAAG,KACR,OAAO,CAAC,SAAS,CAGoD,CAAA"}
|
|
@@ -13,37 +13,6 @@ export type TimeSlot = TimeSlotBase & {
|
|
|
13
13
|
isDisabled: boolean;
|
|
14
14
|
disabledReason?: string;
|
|
15
15
|
};
|
|
16
|
-
export interface DisabledTimeSlotRule {
|
|
17
|
-
startMinutes?: number;
|
|
18
|
-
endMinutes?: number;
|
|
19
|
-
values?: string[];
|
|
20
|
-
reason?: string;
|
|
21
|
-
dates?: string[];
|
|
22
|
-
weekdays?: number[];
|
|
23
|
-
}
|
|
24
|
-
export interface DisabledTimeSlotRuleContext {
|
|
25
|
-
date?: string;
|
|
26
|
-
slotInterval: number;
|
|
27
|
-
}
|
|
28
|
-
export declare const staticDisabledTimeSlotRules: DisabledTimeSlotRule[];
|
|
29
|
-
export declare const getDisabledTimeSlotRulesSync: (_context: DisabledTimeSlotRuleContext) => DisabledTimeSlotRule[];
|
|
30
|
-
export declare const getDisabledTimeSlotRules: (context: DisabledTimeSlotRuleContext) => Promise<DisabledTimeSlotRule[]>;
|
|
31
|
-
export interface ExtraTimeSlotRule {
|
|
32
|
-
startMinutes: number;
|
|
33
|
-
endMinutes?: number;
|
|
34
|
-
extraAmount: number;
|
|
35
|
-
dates?: string[];
|
|
36
|
-
weekdays?: number[];
|
|
37
|
-
journeyTypes?: JourneyType[];
|
|
38
|
-
}
|
|
39
|
-
export interface ExtraTimeSlotRuleContext {
|
|
40
|
-
date?: string;
|
|
41
|
-
slotInterval: number;
|
|
42
|
-
journeyType?: JourneyType;
|
|
43
|
-
}
|
|
44
|
-
export declare const staticExtraTimeSlotRules: ExtraTimeSlotRule[];
|
|
45
|
-
export declare const getExtraTimeSlotRulesSync: (_context: ExtraTimeSlotRuleContext) => ExtraTimeSlotRule[];
|
|
46
|
-
export declare const getExtraTimeSlotRules: (context: ExtraTimeSlotRuleContext) => Promise<ExtraTimeSlotRule[]>;
|
|
47
16
|
export declare const toBusinessDateString: (date: string) => string;
|
|
48
17
|
export declare const getBookingPeriodTimeSlotsSync: (bookingPeriodConfig: BookingPeriodConfig, { date, }?: {
|
|
49
18
|
date?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"booking-period-time-slots.d.ts","sourceRoot":"","sources":["../../src/lib/booking-period-time-slots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAA;AAKjD,KAAK,mBAAmB,GAAG,aAAa,CAAC,mBAAmB,CAAA;AAM5D,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,KAAK,CAAA;AAEzC,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG;IACpC,UAAU,EAAE,OAAO,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAYD,eAAO,MAAM,oBAAoB,GAAI,MAAM,MAAM,WAMhD,CAAA;AAiSD,eAAO,MAAM,6BAA6B,GACxC,qBAAqB,mBAAmB,EACxC,YAEG;IACD,IAAI,CAAC,EAAE,MAAM,CAAA;CACT,KACL;IAAE,cAAc,EAAE,QAAQ,EAAE,CAAC;IAAC,YAAY,EAAE,QAAQ,EAAE,CAAA;CAsBxD,CAAA;AAED,eAAO,MAAM,yBAAyB,GACpC,qBAAqB,mBAAmB,EACxC,YAEG;IACD,IAAI,CAAC,EAAE,MAAM,CAAA;CACT,KACL,OAAO,CAAC;IAAE,cAAc,EAAE,QAAQ,EAAE,CAAC;IAAC,YAAY,EAAE,QAAQ,EAAE,CAAA;CAAE,CAElE,CAAA"}
|
|
@@ -1,273 +1,174 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
const { businessDateStringToDate: A, createBookingPeriodConstants:
|
|
3
|
-
|
|
4
|
-
startMinutes: 1140,
|
|
5
|
-
extraAmount: 1e3,
|
|
6
|
-
journeyTypes: ["end"]
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
startMinutes: 1170,
|
|
10
|
-
extraAmount: 2e3,
|
|
11
|
-
journeyTypes: ["end"]
|
|
12
|
-
}
|
|
13
|
-
], w = (e) => [], P = async (e) => w(), M = /^\d{4}-\d{2}-\d{2}$/, N = "closed", W = (e) => {
|
|
14
|
-
if (!M.test(e))
|
|
1
|
+
import * as $ from "./booking-period.js";
|
|
2
|
+
const { businessDateStringToDate: A, createBookingPeriodConstants: W, minutesToTimeString: g } = $, p = /^\d{4}-\d{2}-\d{2}$/, w = "closed", D = (t) => {
|
|
3
|
+
if (!p.test(t))
|
|
15
4
|
throw new Error("Invalid time slot date parameter format");
|
|
16
|
-
return
|
|
17
|
-
},
|
|
18
|
-
if (!
|
|
5
|
+
return t;
|
|
6
|
+
}, v = (t) => p.test(t) ? t : /^\d{8}$/.test(t) ? `${t.slice(0, 4)}-${t.slice(4, 6)}-${t.slice(6, 8)}` : t, z = (t) => {
|
|
7
|
+
if (!t)
|
|
19
8
|
return { dateString: void 0, weekday: void 0 };
|
|
20
|
-
const
|
|
9
|
+
const e = v(t);
|
|
21
10
|
let s;
|
|
22
11
|
try {
|
|
23
|
-
s =
|
|
12
|
+
s = D(e);
|
|
24
13
|
} catch {
|
|
25
14
|
return { dateString: void 0, weekday: void 0 };
|
|
26
15
|
}
|
|
27
|
-
const
|
|
28
|
-
return Number.isNaN(
|
|
29
|
-
},
|
|
30
|
-
const { dateString: r, weekday:
|
|
16
|
+
const n = A(s);
|
|
17
|
+
return Number.isNaN(n.getTime()) ? { dateString: void 0, weekday: void 0 } : { dateString: s, weekday: (n.getDay() + 6) % 7 };
|
|
18
|
+
}, E = (t, e, s, n) => {
|
|
19
|
+
const { dateString: r, weekday: o } = z(t), a = e.getNormalizedOpeningHours({
|
|
31
20
|
dateString: r
|
|
32
|
-
}),
|
|
21
|
+
}), l = typeof o == "number" ? o : a.days.find((c) => !c.isClosed && c.openingSlots.length)?.day ?? e.defaultWeekday, d = e.getIntervalsForWeekday(l, {
|
|
33
22
|
dateString: r
|
|
34
23
|
});
|
|
35
|
-
if (
|
|
36
|
-
if (!
|
|
24
|
+
if (n?.fillGaps) {
|
|
25
|
+
if (!d.length)
|
|
37
26
|
return [];
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
return
|
|
41
|
-
for (let
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
value:
|
|
45
|
-
label: `${
|
|
46
|
-
startMinutes:
|
|
47
|
-
endMinutes:
|
|
27
|
+
const c = d.reduce((i, u) => u.startMinutes < i.startMinutes ? u : i), x = d.reduce((i, u) => u.endMinutes > i.endMinutes ? u : i), S = [], m = Math.ceil(c.startMinutes / s) * s, M = Math.max(m, x.endMinutes - s);
|
|
28
|
+
if (M < m)
|
|
29
|
+
return S;
|
|
30
|
+
for (let i = m; i <= M; i += s) {
|
|
31
|
+
const u = g(i), b = i + s, T = g(b);
|
|
32
|
+
S.push({
|
|
33
|
+
value: u,
|
|
34
|
+
label: `${u} - ${T}`,
|
|
35
|
+
startMinutes: i,
|
|
36
|
+
endMinutes: b,
|
|
48
37
|
isExtra: !1
|
|
49
38
|
});
|
|
50
39
|
}
|
|
51
|
-
return
|
|
40
|
+
return S;
|
|
52
41
|
}
|
|
53
|
-
const
|
|
54
|
-
for (const
|
|
55
|
-
const
|
|
56
|
-
if (!(
|
|
57
|
-
for (let
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
value:
|
|
61
|
-
label: `${
|
|
62
|
-
startMinutes:
|
|
63
|
-
endMinutes:
|
|
42
|
+
const f = [];
|
|
43
|
+
for (const c of d) {
|
|
44
|
+
const x = Math.ceil(c.startMinutes / s) * s, S = c.endMinutes - s;
|
|
45
|
+
if (!(S < x))
|
|
46
|
+
for (let m = x; m <= S; m += s) {
|
|
47
|
+
const M = g(m), i = m + s, u = g(i);
|
|
48
|
+
f.push({
|
|
49
|
+
value: M,
|
|
50
|
+
label: `${M} - ${u}`,
|
|
51
|
+
startMinutes: m,
|
|
52
|
+
endMinutes: i,
|
|
64
53
|
isExtra: !1
|
|
65
54
|
});
|
|
66
55
|
}
|
|
67
56
|
}
|
|
68
|
-
return
|
|
69
|
-
},
|
|
70
|
-
if (t.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
return !!(t.values?.length && i || typeof t.startMinutes == "number" && r);
|
|
82
|
-
}, F = (e, t) => !(e.dates?.length && (!t.dateString || !e.dates.some((i) => {
|
|
83
|
-
const r = k(i);
|
|
84
|
-
return M.test(r) ? r === t.dateString : !1;
|
|
85
|
-
})) || e.weekdays?.length && (t.weekday == null || !e.weekdays.includes(t.weekday)) || e.journeyTypes?.length && (!t.journeyType || !e.journeyTypes.includes(t.journeyType))), x = ({
|
|
86
|
-
slots: e,
|
|
87
|
-
rules: t,
|
|
88
|
-
date: s,
|
|
89
|
-
slotInterval: i
|
|
90
|
-
}) => {
|
|
91
|
-
if (!t.length)
|
|
92
|
-
return e.map((n) => ({
|
|
93
|
-
...n,
|
|
94
|
-
isDisabled: !1
|
|
95
|
-
}));
|
|
96
|
-
const { dateString: r, weekday: l } = D(s);
|
|
97
|
-
return e.map((n) => {
|
|
98
|
-
const o = t.find(
|
|
99
|
-
(a) => O(n, a, {
|
|
100
|
-
dateString: r,
|
|
101
|
-
weekday: l,
|
|
102
|
-
slotInterval: i
|
|
103
|
-
})
|
|
104
|
-
);
|
|
105
|
-
return o ? {
|
|
106
|
-
...n,
|
|
107
|
-
isDisabled: !0,
|
|
108
|
-
disabledReason: o.reason
|
|
109
|
-
} : {
|
|
110
|
-
...n,
|
|
111
|
-
isDisabled: !1
|
|
112
|
-
};
|
|
113
|
-
});
|
|
114
|
-
}, I = ({
|
|
115
|
-
slots: e,
|
|
116
|
-
rules: t,
|
|
117
|
-
date: s,
|
|
118
|
-
slotInterval: i,
|
|
119
|
-
journeyType: r
|
|
120
|
-
}) => {
|
|
121
|
-
if (!t.length)
|
|
122
|
-
return e.map((a) => ({
|
|
123
|
-
...a
|
|
124
|
-
}));
|
|
125
|
-
const { dateString: l, weekday: n } = D(s), o = e.map((a) => ({
|
|
126
|
-
...a
|
|
57
|
+
return f;
|
|
58
|
+
}, N = (t, e, s, n) => {
|
|
59
|
+
if (n !== "end" || t.length === 0 || e.length === 0)
|
|
60
|
+
return [];
|
|
61
|
+
const r = e.reduce(
|
|
62
|
+
(o, a) => Math.max(o, a.endMinutes),
|
|
63
|
+
0
|
|
64
|
+
);
|
|
65
|
+
return [...t].sort((o, a) => o.minutesAfterClose - a.minutesAfterClose).map((o) => ({
|
|
66
|
+
startMinutes: Math.max(r, r + o.minutesAfterClose - s),
|
|
67
|
+
endMinutes: r + o.minutesAfterClose,
|
|
68
|
+
extraAmount: o.extraAmount
|
|
127
69
|
}));
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
endMinutes: c,
|
|
140
|
-
label: `${g} - ${m}`,
|
|
70
|
+
}, B = (t, e) => {
|
|
71
|
+
const s = t.map((n) => ({
|
|
72
|
+
...n
|
|
73
|
+
}));
|
|
74
|
+
for (const n of e) {
|
|
75
|
+
const r = g(n.startMinutes), o = g(n.endMinutes), a = s.findIndex((l) => l.startMinutes === n.startMinutes);
|
|
76
|
+
if (a >= 0) {
|
|
77
|
+
s[a] = {
|
|
78
|
+
...s[a],
|
|
79
|
+
endMinutes: n.endMinutes,
|
|
80
|
+
label: `${r} - ${o}`,
|
|
141
81
|
isExtra: !0,
|
|
142
|
-
extraAmount:
|
|
82
|
+
extraAmount: n.extraAmount
|
|
143
83
|
};
|
|
144
84
|
continue;
|
|
145
85
|
}
|
|
146
|
-
|
|
147
|
-
value:
|
|
148
|
-
label: `${
|
|
149
|
-
startMinutes:
|
|
150
|
-
endMinutes:
|
|
86
|
+
s.push({
|
|
87
|
+
value: r,
|
|
88
|
+
label: `${r} - ${o}`,
|
|
89
|
+
startMinutes: n.startMinutes,
|
|
90
|
+
endMinutes: n.endMinutes,
|
|
151
91
|
isExtra: !0,
|
|
152
|
-
extraAmount:
|
|
92
|
+
extraAmount: n.extraAmount
|
|
153
93
|
});
|
|
154
94
|
}
|
|
155
|
-
return
|
|
156
|
-
},
|
|
157
|
-
if (
|
|
158
|
-
return
|
|
95
|
+
return s.sort((n, r) => n.startMinutes - r.startMinutes);
|
|
96
|
+
}, C = (t, e) => {
|
|
97
|
+
if (t.length <= 1)
|
|
98
|
+
return t;
|
|
159
99
|
const s = [];
|
|
160
|
-
let
|
|
161
|
-
for (;
|
|
162
|
-
const r =
|
|
100
|
+
let n = 0;
|
|
101
|
+
for (; n < t.length; ) {
|
|
102
|
+
const r = t[n];
|
|
163
103
|
if (r.isDisabled && !r.isExtra && r.disabledReason == null) {
|
|
164
|
-
let
|
|
165
|
-
for (;
|
|
166
|
-
|
|
167
|
-
const
|
|
104
|
+
let o = r, a = n + 1;
|
|
105
|
+
for (; a < t.length && t[a].isDisabled && !t[a].isExtra && t[a].disabledReason == null && t[a].startMinutes === o.startMinutes + e; )
|
|
106
|
+
o = t[a], a += 1;
|
|
107
|
+
const l = r.startMinutes, d = o.endMinutes, f = g(l), c = g(d);
|
|
168
108
|
s.push({
|
|
169
109
|
...r,
|
|
170
|
-
value:
|
|
171
|
-
label: `${
|
|
172
|
-
startMinutes:
|
|
173
|
-
endMinutes:
|
|
110
|
+
value: f,
|
|
111
|
+
label: `${f} - ${c}`,
|
|
112
|
+
startMinutes: l,
|
|
113
|
+
endMinutes: d,
|
|
174
114
|
isDisabled: !0,
|
|
175
|
-
disabledReason:
|
|
176
|
-
}),
|
|
115
|
+
disabledReason: w
|
|
116
|
+
}), n = a;
|
|
177
117
|
continue;
|
|
178
118
|
}
|
|
179
|
-
s.push(r),
|
|
119
|
+
s.push(r), n += 1;
|
|
180
120
|
}
|
|
181
121
|
return s;
|
|
182
122
|
}, h = ({
|
|
183
|
-
slots:
|
|
184
|
-
baselineSlots:
|
|
123
|
+
slots: t,
|
|
124
|
+
baselineSlots: e,
|
|
185
125
|
slotInterval: s
|
|
186
126
|
}) => {
|
|
187
|
-
const
|
|
188
|
-
...
|
|
127
|
+
const n = new Set(t.map((a) => a.startMinutes)), r = e.filter((a) => !n.has(a.startMinutes)).map((a) => ({
|
|
128
|
+
...a,
|
|
189
129
|
isDisabled: !0
|
|
190
|
-
})),
|
|
191
|
-
return
|
|
192
|
-
},
|
|
193
|
-
getNormalizedOpeningHours:
|
|
194
|
-
getIntervalsForWeekday:
|
|
195
|
-
defaultWeekday:
|
|
196
|
-
},
|
|
197
|
-
|
|
130
|
+
})), o = [...t, ...r].sort((a, l) => a.startMinutes - l.startMinutes);
|
|
131
|
+
return C(o, s);
|
|
132
|
+
}, O = (t, e) => E(t, {
|
|
133
|
+
getNormalizedOpeningHours: e.getNormalizedOpeningHours,
|
|
134
|
+
getIntervalsForWeekday: e.getIntervalsForWeekday,
|
|
135
|
+
defaultWeekday: e.defaultWeekday
|
|
136
|
+
}, e.slotIntervalMinutes), F = (t, e) => E(
|
|
137
|
+
t,
|
|
198
138
|
{
|
|
199
|
-
getNormalizedOpeningHours:
|
|
200
|
-
getIntervalsForWeekday:
|
|
201
|
-
defaultWeekday:
|
|
139
|
+
getNormalizedOpeningHours: e.getSeasonNormalizedOpeningHours,
|
|
140
|
+
getIntervalsForWeekday: e.getSeasonIntervalsForWeekday,
|
|
141
|
+
defaultWeekday: e.defaultSeasonWeekday
|
|
202
142
|
},
|
|
203
|
-
|
|
143
|
+
e.slotIntervalMinutes,
|
|
204
144
|
{ fillGaps: !0 }
|
|
205
|
-
),
|
|
206
|
-
const
|
|
207
|
-
return
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
});
|
|
214
|
-
}, j = (e, {
|
|
215
|
-
date: t
|
|
145
|
+
), y = (t, e, s, n) => {
|
|
146
|
+
const r = e.slotIntervalMinutes, o = O(t, e), a = N(n, o, r, s);
|
|
147
|
+
return B(o, a);
|
|
148
|
+
}, k = (t) => t.map((e) => ({
|
|
149
|
+
...e,
|
|
150
|
+
isDisabled: !1
|
|
151
|
+
})), I = (t, {
|
|
152
|
+
date: e
|
|
216
153
|
} = {}) => {
|
|
217
|
-
const s =
|
|
218
|
-
startTimeSlots: h({
|
|
219
|
-
slots: r.map((u) => ({
|
|
220
|
-
...u,
|
|
221
|
-
isDisabled: !1
|
|
222
|
-
})),
|
|
223
|
-
baselineSlots: n,
|
|
224
|
-
slotInterval: i
|
|
225
|
-
}),
|
|
226
|
-
endTimeSlots: h({
|
|
227
|
-
slots: l.map((u) => ({
|
|
228
|
-
...u,
|
|
229
|
-
isDisabled: !1
|
|
230
|
-
})),
|
|
231
|
-
baselineSlots: n,
|
|
232
|
-
slotInterval: i
|
|
233
|
-
})
|
|
234
|
-
};
|
|
235
|
-
if (!t || !M.test(t))
|
|
236
|
-
return o;
|
|
237
|
-
const a = W(t), c = p(a, s, "start"), d = p(a, s, "end"), g = R(a, s), m = E(), f = x({
|
|
238
|
-
slots: c,
|
|
239
|
-
rules: m,
|
|
240
|
-
date: a,
|
|
241
|
-
slotInterval: i
|
|
242
|
-
}), b = x({
|
|
243
|
-
slots: d,
|
|
244
|
-
rules: m,
|
|
245
|
-
date: a,
|
|
246
|
-
slotInterval: i
|
|
247
|
-
});
|
|
154
|
+
const s = W(t), n = s.slotIntervalMinutes, r = t.extraTimeSlots ?? [], o = e && p.test(e) ? D(e) : void 0, a = y(o, s, "start", r), l = y(o, s, "end", r), d = F(o, s);
|
|
248
155
|
return {
|
|
249
156
|
startTimeSlots: h({
|
|
250
|
-
slots:
|
|
251
|
-
baselineSlots:
|
|
252
|
-
slotInterval:
|
|
157
|
+
slots: k(a),
|
|
158
|
+
baselineSlots: d,
|
|
159
|
+
slotInterval: n
|
|
253
160
|
}),
|
|
254
161
|
endTimeSlots: h({
|
|
255
|
-
slots:
|
|
256
|
-
baselineSlots:
|
|
257
|
-
slotInterval:
|
|
162
|
+
slots: k(l),
|
|
163
|
+
baselineSlots: d,
|
|
164
|
+
slotInterval: n
|
|
258
165
|
})
|
|
259
166
|
};
|
|
260
|
-
},
|
|
261
|
-
date:
|
|
262
|
-
} = {}) =>
|
|
167
|
+
}, R = async (t, {
|
|
168
|
+
date: e
|
|
169
|
+
} = {}) => I(t, { date: e });
|
|
263
170
|
export {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
E as getDisabledTimeSlotRulesSync,
|
|
268
|
-
P as getExtraTimeSlotRules,
|
|
269
|
-
w as getExtraTimeSlotRulesSync,
|
|
270
|
-
C as staticDisabledTimeSlotRules,
|
|
271
|
-
L as staticExtraTimeSlotRules,
|
|
272
|
-
W as toBusinessDateString
|
|
171
|
+
R as getBookingPeriodTimeSlots,
|
|
172
|
+
I as getBookingPeriodTimeSlotsSync,
|
|
173
|
+
D as toBusinessDateString
|
|
273
174
|
};
|
|
@@ -58,11 +58,16 @@ export type NormalizeOpeningHoursOptions = {
|
|
|
58
58
|
referenceDate?: Date | string | null;
|
|
59
59
|
};
|
|
60
60
|
export declare const normalizeOpeningHours: (openingHours: StoreOpeningHours, openingHoursOverrides: StoreOpeningOverride[], options?: NormalizeOpeningHoursOptions) => NormalizedOpeningHours;
|
|
61
|
+
export type BookingPeriodExtraTimeSlotRule = {
|
|
62
|
+
minutesAfterClose: number;
|
|
63
|
+
extraAmount: number;
|
|
64
|
+
};
|
|
61
65
|
export type BookingPeriodConfig = {
|
|
62
66
|
timing: BookingTimingConfig;
|
|
63
67
|
openingHours: StoreOpeningHours;
|
|
64
68
|
openingHoursOverrides: StoreOpeningOverride[];
|
|
65
69
|
timeZone: string;
|
|
70
|
+
extraTimeSlots?: BookingPeriodExtraTimeSlotRule[];
|
|
66
71
|
};
|
|
67
72
|
export type BookingPeriodConstants = ReturnType<typeof createBookingPeriodConstants>;
|
|
68
73
|
export declare const createBookingPeriodConstants: (config: BookingPeriodConfig) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"booking-period.d.ts","sourceRoot":"","sources":["../../src/lib/booking-period.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAE/C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,EAAE,OAAO,CAAA;IACZ,YAAY,EAAE,gBAAg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hG,CAAA;AAED,eAAO,MAAM,wBAAwB,GAAI,YAAY,MAAM,SAG1D,CAAA;AAED,eAAO,MAAM,wBAAwB,GAAI,YAAY,MAAM,KAAG,OAQ7D,CAAA;AAgDD,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAChC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,OAAO,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAC9B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB;AAED,MAAM,WAAW,6BAA6B;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,WAAW,EAAE,OAAO,CAAA;IACpB,gBAAgB,CAAC,EAAE,oBAAoB,GAAG,oBAAoB,CAAA;IAC9D,cAAc,EAAE,OAAO,CAAA;CACxB;AAED,MAAM,WAAW,8BAA8B;IAC7C,aAAa,CAAC,EAAE,IAAI,CAAA;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,MAAM,EAAE,mBAAmB,CAAA;CAC5B;AAED,eAAO,MAAM,mBAAmB,GAAI,QAAQ,kBAAkB,EAAE,SAAS,8BAA8B,KAAG,6BA8FzG,CAAA"}
|
package/dist/lib/booking.d.ts
CHANGED
|
@@ -14,6 +14,9 @@ export type StorefrontBookingParams = {
|
|
|
14
14
|
type BookingSearchStorage = Pick<Storage, "getItem" | "removeItem" | "setItem"> | null | undefined;
|
|
15
15
|
export declare const TIME_OPTIONS: string[];
|
|
16
16
|
export declare const getDefaultBookingParams: (now?: Date) => StorefrontBookingParams;
|
|
17
|
+
export declare const createBookingPeriodConfigFromBookingEngineConfiguration: (bookingEngine: StorefrontConfiguration["bookingEngine"], options?: {
|
|
18
|
+
sameDayCutoff?: string;
|
|
19
|
+
}) => BookingPeriodConfig;
|
|
17
20
|
export declare const createBookingPeriodConfigFromStorefrontConfiguration: (storefrontConfiguration: StorefrontConfiguration) => BookingPeriodConfig;
|
|
18
21
|
export declare const getDefaultBookingParamsForStorefrontConfiguration: (storefrontConfiguration: StorefrontConfiguration, now?: Date) => StorefrontBookingParams;
|
|
19
22
|
export declare const getBookingParamsFromSearch: (searchParams: URLSearchParams, fallback?: Partial<StorefrontBookingParams>) => StorefrontBookingParams;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"booking.d.ts","sourceRoot":"","sources":["../../src/lib/booking.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AACnE,OAAO,EAGL,KAAK,mBAAmB,EAGzB,MAAM,kBAAkB,CAAA;AAGzB,eAAO,MAAM,mBAAmB,8GAQtB,CAAA;AAEV,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,UAAU,CAAA;AAEtD,MAAM,MAAM,uBAAuB,GAAG;IACpC,WAAW,EAAE,kBAAkB,CAAA;IAC/B,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAID,KAAK,oBAAoB,GAAG,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC,GAAG,IAAI,GAAG,SAAS,CAAA;AAelG,eAAO,MAAM,YAAY,UAAqB,CAAA;AAE9C,eAAO,MAAM,uBAAuB,GAAI,MAAK,IAAiB,KAAG,uBAWhE,CAAA;AA6BD,eAAO,MAAM,uDAAuD,GAClE,eAAe,uBAAuB,CAAC,eAAe,CAAC,EACvD,UAAS;IAAE,a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