@loczer/storefront-sdk 0.230.0 → 0.232.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/StorefrontContext.d.ts +0 -2
- package/dist/StorefrontContext.d.ts.map +1 -1
- package/dist/StorefrontProvider.d.ts +0 -1
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas/{base-booking-C9kJFMIu.js → base-booking-BJXFzDM5.js} +0 -2
- package/dist/chunks/pkg/booking-engine/dist/schemas/{cart-inputs-epi7FXIk.js → cart-inputs-3lBblkB0.js} +0 -10
- package/dist/chunks/pkg/booking-engine/dist/{schemas-DW5gdDYz.js → schemas-JjiUWFIv.js} +2 -2
- package/dist/chunks/pkg/ui/dist/LanguagePicker/index-D7_3voTe.js +83 -0
- package/dist/components/BookingBikeQuickAddCard/index.d.ts +3 -1
- package/dist/components/BookingBikeQuickAddCard/index.d.ts.map +1 -1
- package/dist/components/BookingBikeQuickAddCard/index.js +94 -85
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +1 -1
- package/dist/components/ContractSaleDocument/InvoiceDetails.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/InvoiceDetails.js +62 -56
- package/dist/components/Footer/businessHoursStatus.js +1 -1
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +56 -56
- package/dist/components/LanguageSelector/index.d.ts.map +1 -1
- package/dist/components/LanguageSelector/index.js +19 -64
- package/dist/components/StorefrontCartPanel/index.js +1 -1
- package/dist/i18n/en.d.ts +2 -4
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +3 -5
- package/dist/i18n/fr.d.ts +2 -4
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +4 -6
- package/dist/index.d.ts +17 -35
- package/dist/index.js +3 -3
- package/dist/lib/booking-period.js +1 -1
- package/dist/lib/booking.d.ts +6 -6
- package/dist/lib/booking.d.ts.map +1 -1
- package/dist/lib/booking.js +21 -21
- package/dist/lib/cart.d.ts +1 -0
- package/dist/lib/cart.d.ts.map +1 -1
- package/dist/lib/cart.js +2 -0
- package/dist/lib/checkoutSubmit.d.ts +2 -6
- package/dist/lib/checkoutSubmit.d.ts.map +1 -1
- package/dist/lib/checkoutSubmit.js +3 -11
- package/dist/lib/pricing.js +1 -1
- package/dist/lib/storefrontAvailability.d.ts +12 -8
- package/dist/lib/storefrontAvailability.d.ts.map +1 -1
- package/dist/lib/storefrontAvailability.js +17 -7
- package/dist/pages/BookingPage.d.ts.map +1 -1
- package/dist/pages/BookingPage.js +236 -238
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +127 -125
- package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
- package/dist/pages/ContractSaleDocumentPage.js +117 -171
- package/dist/pages/HomePage.js +8 -8
- package/dist/pages/ProductPage.d.ts.map +1 -1
- package/dist/pages/ProductPage.js +187 -181
- package/dist/pages/checkout/components/CheckoutDetailsCard.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutDetailsCard.js +4 -17
- package/dist/pages/checkout/components/CheckoutLoadingSkeleton.d.ts +7 -0
- package/dist/pages/checkout/components/CheckoutLoadingSkeleton.d.ts.map +1 -0
- package/dist/pages/checkout/components/CheckoutLoadingSkeleton.js +105 -0
- package/dist/pages/checkout/types.d.ts +1 -2
- package/dist/pages/checkout/types.d.ts.map +1 -1
- package/dist/pages/checkout/types.js +1 -2
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.d.ts +0 -2
- package/dist/storefrontSchemas.d.ts.map +1 -1
- package/dist/storefrontSchemas.js +1 -2
- package/package.json +1 -1
- package/dist/chunks/pkg/ui/dist/{MorphingModalWizard-j1CgFGLe.js → MorphingModalWizard-Q8O5Rjfq.js} +1 -1
package/dist/i18n/fr.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8gBtB,CAAA"}
|
package/dist/i18n/fr.js
CHANGED
|
@@ -185,6 +185,7 @@ var e = {
|
|
|
185
185
|
cart_empty: "Votre panier est vide.",
|
|
186
186
|
cart_empty_title: "Votre panier est vide",
|
|
187
187
|
cart_empty_description: "Ajoutez un vélo (et des accessoires) pour continuer.",
|
|
188
|
+
cart_loading: "Chargement du panier…",
|
|
188
189
|
cart_line_meta: "Qté {{quantity}} · {{price}} / {{unit}}",
|
|
189
190
|
remove_from_cart: "Retirer du panier",
|
|
190
191
|
cart_total: "Total",
|
|
@@ -214,12 +215,8 @@ var e = {
|
|
|
214
215
|
checkout_estimated_total: "Total",
|
|
215
216
|
checkout_form_title: "Vos informations",
|
|
216
217
|
checkout_form_description: "Renseignez vos coordonnées pour votre réservation. N'hésitez pas à ajouter toute information utile dans les notes.",
|
|
217
|
-
checkout_first_name_label: "Prénom",
|
|
218
|
-
checkout_first_name_placeholder: "Jean",
|
|
219
|
-
checkout_last_name_label: "Nom",
|
|
220
|
-
checkout_last_name_placeholder: "Dupont",
|
|
221
218
|
checkout_full_name_label: "Nom complet",
|
|
222
|
-
checkout_full_name_placeholder: "
|
|
219
|
+
checkout_full_name_placeholder: "Prénom Nom",
|
|
223
220
|
checkout_email_label: "Email",
|
|
224
221
|
checkout_email_placeholder: "jean@example.com",
|
|
225
222
|
checkout_phone_label: "Téléphone",
|
|
@@ -304,7 +301,8 @@ var e = {
|
|
|
304
301
|
docs_contract_sale_quote_date_label: "Date du devis :",
|
|
305
302
|
docs_contract_sale_credit_note_date_label: "Date de l'avoir :",
|
|
306
303
|
docs_contract_sale_due_date_label: "Date d'échéance :",
|
|
307
|
-
|
|
304
|
+
docs_contract_sale_issuer_label: "Émetteur :",
|
|
305
|
+
docs_contract_sale_invoice_recipient_label: "Client :",
|
|
308
306
|
docs_contract_sale_credit_note_recipient_label: "Émis à :",
|
|
309
307
|
docs_contract_sale_legal_description_label: "Description",
|
|
310
308
|
docs_contract_sale_legal_company_registration_label: "N° d’immatriculation",
|
package/dist/index.d.ts
CHANGED
|
@@ -358,8 +358,6 @@ export declare const baseBookingSchema: z.ZodObject<{
|
|
|
358
358
|
}>;
|
|
359
359
|
shopId: z.ZodString;
|
|
360
360
|
customer: z.ZodObject<{
|
|
361
|
-
firstName: z.ZodOptional<z.ZodString>;
|
|
362
|
-
lastName: z.ZodOptional<z.ZodString>;
|
|
363
361
|
name: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
364
362
|
email: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
365
363
|
phone: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
@@ -630,8 +628,6 @@ export declare const BOOKING_SEARCH_KEYS: readonly ["fulfillment", "start_date",
|
|
|
630
628
|
export declare type BookingCustomerInput = z.infer<typeof bookingCustomerInputSchema>;
|
|
631
629
|
|
|
632
630
|
export declare const bookingCustomerInputSchema: z.ZodObject<{
|
|
633
|
-
firstName: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
634
|
-
lastName: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
635
631
|
name: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
636
632
|
email: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
637
633
|
phone: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
@@ -1596,8 +1592,6 @@ export declare type CreateBookingInput = z.input<typeof createBookingInputSchema
|
|
|
1596
1592
|
|
|
1597
1593
|
export declare const createBookingInputBaseSchema: z.ZodObject<{
|
|
1598
1594
|
customer: z.ZodObject<{
|
|
1599
|
-
firstName: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
1600
|
-
lastName: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
1601
1595
|
name: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
1602
1596
|
email: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
1603
1597
|
phone: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
@@ -1637,8 +1631,6 @@ export declare const createBookingInputBaseSchema: z.ZodObject<{
|
|
|
1637
1631
|
|
|
1638
1632
|
export declare const createBookingInputSchema: z.ZodObject<{
|
|
1639
1633
|
customer: z.ZodObject<{
|
|
1640
|
-
firstName: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
1641
|
-
lastName: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
1642
1634
|
name: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
1643
1635
|
email: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
1644
1636
|
phone: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
@@ -2085,7 +2077,7 @@ export declare function getPricingUnitLabel(priceUnit: PriceUnit_2, t: TFunction
|
|
|
2085
2077
|
|
|
2086
2078
|
export declare const getStorefrontAvailabilityIssue: (record: StorefrontPublicAvailabilityRecord | undefined) => StorefrontAvailabilityIssue | undefined;
|
|
2087
2079
|
|
|
2088
|
-
export declare const getStorefrontAvailabilityStatus: (record: StorefrontPublicAvailabilityRecord | undefined) =>
|
|
2080
|
+
export declare const getStorefrontAvailabilityStatus: (record: StorefrontPublicAvailabilityRecord | undefined) => StorefrontAvailabilityStatus;
|
|
2089
2081
|
|
|
2090
2082
|
export declare function getStorefrontBaseDailyRateMinor(prices: StorefrontPublicProductPrice[] | undefined): number;
|
|
2091
2083
|
|
|
@@ -2282,7 +2274,6 @@ export declare const loader: ({ ctx, params }: LoaderArgs) => Promise<{
|
|
|
2282
2274
|
defaultMode: "fewRemaining" | "fewRemainingCounts" | "remainingCounts" | "soldOutAndFewRemaining" | "soldOutOnly";
|
|
2283
2275
|
defaultFewRemainingThreshold?: number | undefined;
|
|
2284
2276
|
};
|
|
2285
|
-
enabled: boolean;
|
|
2286
2277
|
fulfillmentModes: ("pickup" | "delivery")[];
|
|
2287
2278
|
deliveryDisabledReason: string;
|
|
2288
2279
|
sameDayCutoff: string;
|
|
@@ -3481,7 +3472,7 @@ export declare const STOREFRONT_PRODUCTS_ROUTE = "/api/public/storefront/product
|
|
|
3481
3472
|
|
|
3482
3473
|
export declare const STOREFRONT_TIME_SLOTS_ROUTE = "/api/public/storefront/availability/time-slots";
|
|
3483
3474
|
|
|
3484
|
-
export declare type StorefrontAvailabilityIssue = "unavailable" | "
|
|
3475
|
+
export declare type StorefrontAvailabilityIssue = "unavailable" | "quantityUnavailable";
|
|
3485
3476
|
|
|
3486
3477
|
export declare type StorefrontAvailabilityProduct = z.infer<typeof storefrontAvailabilityProductSchema>;
|
|
3487
3478
|
|
|
@@ -3540,14 +3531,16 @@ export declare const storefrontAvailabilityScheduleSchema: z.ZodObject<{
|
|
|
3540
3531
|
endTime: z.ZodString;
|
|
3541
3532
|
}, z.core.$strip>;
|
|
3542
3533
|
|
|
3534
|
+
declare type StorefrontAvailabilityStatus = "AVAILABLE" | "LOW_STOCK" | "OUT_OF_STOCK";
|
|
3535
|
+
|
|
3543
3536
|
export declare type StorefrontBookingParams = {
|
|
3544
3537
|
fulfillment: BookingFulfillment;
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3538
|
+
startDate: string;
|
|
3539
|
+
startTime: string;
|
|
3540
|
+
endDate: string;
|
|
3541
|
+
endTime: string;
|
|
3542
|
+
startAddress: string;
|
|
3543
|
+
endAddress: string;
|
|
3551
3544
|
};
|
|
3552
3545
|
|
|
3553
3546
|
export declare type StorefrontBookingProductsCollections = StorefrontProductsCollections;
|
|
@@ -3557,6 +3550,7 @@ export declare const storefrontButtonRadiusClassName = "rounded-[var(--storefron
|
|
|
3557
3550
|
declare type StorefrontCartContextValue = {
|
|
3558
3551
|
items: StorefrontCartItem[];
|
|
3559
3552
|
itemCount: number;
|
|
3553
|
+
isReady: boolean;
|
|
3560
3554
|
addItem: (item: Omit<StorefrontCartItem, "key"> & {
|
|
3561
3555
|
key?: string;
|
|
3562
3556
|
}) => void;
|
|
@@ -3668,9 +3662,7 @@ export declare const storefrontCheckoutSubmitRequestBaseSchema: z.ZodObject<{
|
|
|
3668
3662
|
couponAutoApplied: z.ZodOptional<z.ZodBoolean>;
|
|
3669
3663
|
insuranceAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
3670
3664
|
customer: z.ZodObject<{
|
|
3671
|
-
|
|
3672
|
-
lastName: z.ZodOptional<z.ZodString>;
|
|
3673
|
-
fullName: z.ZodOptional<z.ZodString>;
|
|
3665
|
+
name: z.ZodString;
|
|
3674
3666
|
email: z.ZodString;
|
|
3675
3667
|
phone: z.ZodString;
|
|
3676
3668
|
notes: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
@@ -3706,9 +3698,7 @@ export declare const storefrontCheckoutSubmitRequestSchema: z.ZodObject<{
|
|
|
3706
3698
|
couponAutoApplied: z.ZodOptional<z.ZodBoolean>;
|
|
3707
3699
|
insuranceAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
3708
3700
|
customer: z.ZodObject<{
|
|
3709
|
-
|
|
3710
|
-
lastName: z.ZodOptional<z.ZodString>;
|
|
3711
|
-
fullName: z.ZodOptional<z.ZodString>;
|
|
3701
|
+
name: z.ZodString;
|
|
3712
3702
|
email: z.ZodString;
|
|
3713
3703
|
phone: z.ZodString;
|
|
3714
3704
|
notes: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
@@ -3785,7 +3775,6 @@ export declare const storefrontConfigurationSchema: z.ZodObject<{
|
|
|
3785
3775
|
}>;
|
|
3786
3776
|
defaultFewRemainingThreshold: z.ZodOptional<z.ZodNumber>;
|
|
3787
3777
|
}, z.core.$strip>;
|
|
3788
|
-
enabled: z.ZodBoolean;
|
|
3789
3778
|
fulfillmentModes: z.ZodArray<z.ZodEnum<{
|
|
3790
3779
|
pickup: "pickup";
|
|
3791
3780
|
delivery: "delivery";
|
|
@@ -4372,6 +4361,7 @@ export declare const storefrontEn: {
|
|
|
4372
4361
|
cart_empty: string;
|
|
4373
4362
|
cart_empty_title: string;
|
|
4374
4363
|
cart_empty_description: string;
|
|
4364
|
+
cart_loading: string;
|
|
4375
4365
|
cart_line_meta: string;
|
|
4376
4366
|
remove_from_cart: string;
|
|
4377
4367
|
cart_total: string;
|
|
@@ -4401,10 +4391,6 @@ export declare const storefrontEn: {
|
|
|
4401
4391
|
checkout_estimated_total: string;
|
|
4402
4392
|
checkout_form_title: string;
|
|
4403
4393
|
checkout_form_description: string;
|
|
4404
|
-
checkout_first_name_label: string;
|
|
4405
|
-
checkout_first_name_placeholder: string;
|
|
4406
|
-
checkout_last_name_label: string;
|
|
4407
|
-
checkout_last_name_placeholder: string;
|
|
4408
4394
|
checkout_full_name_label: string;
|
|
4409
4395
|
checkout_full_name_placeholder: string;
|
|
4410
4396
|
checkout_email_label: string;
|
|
@@ -4491,6 +4477,7 @@ export declare const storefrontEn: {
|
|
|
4491
4477
|
docs_contract_sale_quote_date_label: string;
|
|
4492
4478
|
docs_contract_sale_credit_note_date_label: string;
|
|
4493
4479
|
docs_contract_sale_due_date_label: string;
|
|
4480
|
+
docs_contract_sale_issuer_label: string;
|
|
4494
4481
|
docs_contract_sale_invoice_recipient_label: string;
|
|
4495
4482
|
docs_contract_sale_credit_note_recipient_label: string;
|
|
4496
4483
|
docs_contract_sale_legal_description_label: string;
|
|
@@ -4933,6 +4920,7 @@ export declare const storefrontFr: {
|
|
|
4933
4920
|
cart_empty: string;
|
|
4934
4921
|
cart_empty_title: string;
|
|
4935
4922
|
cart_empty_description: string;
|
|
4923
|
+
cart_loading: string;
|
|
4936
4924
|
cart_line_meta: string;
|
|
4937
4925
|
remove_from_cart: string;
|
|
4938
4926
|
cart_total: string;
|
|
@@ -4962,10 +4950,6 @@ export declare const storefrontFr: {
|
|
|
4962
4950
|
checkout_estimated_total: string;
|
|
4963
4951
|
checkout_form_title: string;
|
|
4964
4952
|
checkout_form_description: string;
|
|
4965
|
-
checkout_first_name_label: string;
|
|
4966
|
-
checkout_first_name_placeholder: string;
|
|
4967
|
-
checkout_last_name_label: string;
|
|
4968
|
-
checkout_last_name_placeholder: string;
|
|
4969
4953
|
checkout_full_name_label: string;
|
|
4970
4954
|
checkout_full_name_placeholder: string;
|
|
4971
4955
|
checkout_email_label: string;
|
|
@@ -5052,6 +5036,7 @@ export declare const storefrontFr: {
|
|
|
5052
5036
|
docs_contract_sale_quote_date_label: string;
|
|
5053
5037
|
docs_contract_sale_credit_note_date_label: string;
|
|
5054
5038
|
docs_contract_sale_due_date_label: string;
|
|
5039
|
+
docs_contract_sale_issuer_label: string;
|
|
5055
5040
|
docs_contract_sale_invoice_recipient_label: string;
|
|
5056
5041
|
docs_contract_sale_credit_note_recipient_label: string;
|
|
5057
5042
|
docs_contract_sale_legal_description_label: string;
|
|
@@ -6228,7 +6213,6 @@ export declare const storefrontSettingsSchema: z.ZodObject<{
|
|
|
6228
6213
|
}>;
|
|
6229
6214
|
defaultFewRemainingThreshold: z.ZodOptional<z.ZodNumber>;
|
|
6230
6215
|
}, z.core.$strip>;
|
|
6231
|
-
enabled: z.ZodBoolean;
|
|
6232
6216
|
fulfillmentModes: z.ZodArray<z.ZodEnum<{
|
|
6233
6217
|
pickup: "pickup";
|
|
6234
6218
|
delivery: "delivery";
|
|
@@ -6437,7 +6421,6 @@ export declare function useStorefrontConfig(): {
|
|
|
6437
6421
|
defaultMode: "fewRemaining" | "fewRemainingCounts" | "remainingCounts" | "soldOutAndFewRemaining" | "soldOutOnly";
|
|
6438
6422
|
defaultFewRemainingThreshold?: number | undefined;
|
|
6439
6423
|
};
|
|
6440
|
-
enabled: boolean;
|
|
6441
6424
|
fulfillmentModes: ("pickup" | "delivery")[];
|
|
6442
6425
|
deliveryDisabledReason: string;
|
|
6443
6426
|
sameDayCutoff: string;
|
|
@@ -6680,7 +6663,6 @@ export declare function useStorefrontConfig(): {
|
|
|
6680
6663
|
defaultMode: "fewRemaining" | "fewRemainingCounts" | "remainingCounts" | "soldOutAndFewRemaining" | "soldOutOnly";
|
|
6681
6664
|
defaultFewRemainingThreshold?: number | undefined;
|
|
6682
6665
|
};
|
|
6683
|
-
enabled: boolean;
|
|
6684
6666
|
fulfillmentModes: ("pickup" | "delivery")[];
|
|
6685
6667
|
deliveryDisabledReason: string;
|
|
6686
6668
|
sameDayCutoff: string;
|
package/dist/index.js
CHANGED
|
@@ -8,12 +8,12 @@ import { richTextJsonDocSchema as k, richTextSchema as A, richTextVersionSchema
|
|
|
8
8
|
import { isoDateSchema as M, shopConfigurationSchema as N, shopExtraTimeSlotRuleSchema as P, shopOpeningDayIndexSchema as F, shopOpeningDaySchema as I, shopOpeningHoursOverrideSchema as L, shopOpeningHoursPeriodSchema as R, shopOpeningSlotSchema as z, timeOfDaySchema as B } from "./chunks/pkg/booking-engine/dist/schemas/shop-opening-hours-BlLD1gfz.js";
|
|
9
9
|
import { DEFAULT_CANCELLATION_POLICY as V, DEFAULT_PAYMENT_POLICIES as H, cancellationPolicySchema as U, cancellationPolicyTierSchema as W, paymentPoliciesSchema as G } from "./chunks/pkg/booking-engine/dist/schemas/booking-engine-configuration-LnrhShqm.js";
|
|
10
10
|
import { fulfillmentModeSchema as K, publicBookingEngineConfigurationSchema as q, publicCheckoutConfigurationSchema as J, publicCheckoutDynamicOptionsSchema as Y } from "./chunks/pkg/booking-engine/dist/schemas/public-booking-engine-configuration-CEM9mexX.js";
|
|
11
|
-
import { DEFAULT_BOOKING_DELIVERY_OPTION as X, bookingCustomerInputSchema as Z, bookingDeliveryOptionSchema as Q, bookingScheduleInputSchema as $, cartItemInputSchema as ee, createBookingInputBaseSchema as te, createBookingInputSchema as ne, resolveBookingDeliveryOption as re, validateBookingDeliveryAddress as ie } from "./chunks/pkg/booking-engine/dist/schemas/cart-inputs-
|
|
11
|
+
import { DEFAULT_BOOKING_DELIVERY_OPTION as X, bookingCustomerInputSchema as Z, bookingDeliveryOptionSchema as Q, bookingScheduleInputSchema as $, cartItemInputSchema as ee, createBookingInputBaseSchema as te, createBookingInputSchema as ne, resolveBookingDeliveryOption as re, validateBookingDeliveryAddress as ie } from "./chunks/pkg/booking-engine/dist/schemas/cart-inputs-3lBblkB0.js";
|
|
12
12
|
import { bookingInsuranceConsentSourceSchema as ae, bookingInsuranceItemSnapshotSchema as oe, bookingInsuranceSnapshotSchema as se, buildBookingInsuranceSnapshot as ce, calculateInsuranceCalendarDays as le, insuranceProviderSchema as ue } from "./chunks/pkg/booking-engine/dist/schemas/insurance-DXc34Bzy.js";
|
|
13
13
|
import { resolveOpeningHoursForDate as de, resolveOpeningHoursPeriodForDate as fe } from "./chunks/pkg/booking-engine/dist/utils/opening-hours-period-TCyLhzZw.js";
|
|
14
14
|
import { assetIdSchema as pe, baseAssetSchema as me, baseAssetStatusSchema as he } from "./chunks/pkg/booking-engine/dist/schemas/base-asset-BhIOL2rP.js";
|
|
15
|
-
import { baseBookingItemSchema as ge, baseBookingSchema as _e, baseBookingStateSchema as ve } from "./chunks/pkg/booking-engine/dist/schemas/base-booking-
|
|
16
|
-
import "./chunks/pkg/booking-engine/dist/schemas-
|
|
15
|
+
import { baseBookingItemSchema as ge, baseBookingSchema as _e, baseBookingStateSchema as ve } from "./chunks/pkg/booking-engine/dist/schemas/base-booking-BJXFzDM5.js";
|
|
16
|
+
import "./chunks/pkg/booking-engine/dist/schemas-JjiUWFIv.js";
|
|
17
17
|
import { STOREFRONT_HERO_MODES as ye, storefrontCheckoutModeSchema as be, storefrontConfigurationSchema as xe, storefrontContentSchema as Se, storefrontFaqItemSchema as Ce, storefrontFaqSchema as we, storefrontFulfillmentModeSchema as Te, storefrontHeroModeSchema as Ee, storefrontInformationSchema as De, storefrontLocalizedRichTextSchema as Oe, storefrontModalMessageSchema as ke, storefrontModulesSchema as Ae, storefrontReviewsModuleSchema as je, storefrontRichTextSchema as Me, storefrontSettingsSchema as Ne, storefrontShopSchema as Pe, storefrontStatusSchema as Fe, storefrontWorkspaceSchema as Ie } from "./storefrontSchemas.js";
|
|
18
18
|
import { BOOKING_SEARCH_KEYS as Le, TIME_OPTIONS as Re, applyBookingParamsToSearch as ze, createBookingPeriodConfigFromBookingEngineConfiguration as Be, createBookingPeriodConfigFromShopConfiguration as Ve, createBookingPeriodConfigFromStorefrontConfiguration as He, getBookingParamsFromSearch as Ue, getBookingSessionStorageKey as We, getDefaultBookingParams as Ge, getDefaultBookingParamsForStorefrontConfiguration as Ke, pickBookingSearchParams as qe, readBookingSearchParamsFromSessionStorage as Je, readBookingSearchParamsFromStorage as Ye, resolveBookingSearchParams as Xe, resolveBookingSearchParamsFromSessionStorage as Ze, writeBookingSearchParamsToSessionStorage as Qe, writeBookingSearchParamsToStorage as $e } from "./lib/booking.js";
|
|
19
19
|
import { getLocalizedEntry as et, getLocalizedValue as tt } from "./localization.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __exportAll as e } from "../chunks/_virtual/_rolldown/runtime-B5ovbsoX.js";
|
|
2
2
|
import { resolveOpeningHoursForDate as t } from "../chunks/pkg/booking-engine/dist/utils/opening-hours-period-TCyLhzZw.js";
|
|
3
|
-
import "../chunks/pkg/booking-engine/dist/schemas-
|
|
3
|
+
import "../chunks/pkg/booking-engine/dist/schemas-JjiUWFIv.js";
|
|
4
4
|
//#region src/lib/booking-period.ts
|
|
5
5
|
var n = /* @__PURE__ */ e({
|
|
6
6
|
adjustBookingPeriod: () => M,
|
package/dist/lib/booking.d.ts
CHANGED
|
@@ -4,12 +4,12 @@ export declare const BOOKING_SEARCH_KEYS: readonly ["fulfillment", "start_date",
|
|
|
4
4
|
export type BookingFulfillment = "pickup" | "delivery";
|
|
5
5
|
export type StorefrontBookingParams = {
|
|
6
6
|
fulfillment: BookingFulfillment;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
startDate: string;
|
|
8
|
+
startTime: string;
|
|
9
|
+
endDate: string;
|
|
10
|
+
endTime: string;
|
|
11
|
+
startAddress: string;
|
|
12
|
+
endAddress: string;
|
|
13
13
|
};
|
|
14
14
|
type BookingSearchStorage = Pick<Storage, "getItem" | "removeItem" | "setItem"> | null | undefined;
|
|
15
15
|
export declare const TIME_OPTIONS: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"booking.d.ts","sourceRoot":"","sources":["../../src/lib/booking.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AACnE,OAAO,EAGL,KAA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ED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DEFAULT_BOOKING_DELIVERY_OPTION as e } from "../chunks/pkg/booking-engine/dist/schemas/cart-inputs-
|
|
2
|
-
import "../chunks/pkg/booking-engine/dist/schemas-
|
|
1
|
+
import { DEFAULT_BOOKING_DELIVERY_OPTION as e } from "../chunks/pkg/booking-engine/dist/schemas/cart-inputs-3lBblkB0.js";
|
|
2
|
+
import "../chunks/pkg/booking-engine/dist/schemas-JjiUWFIv.js";
|
|
3
3
|
import { getDefaultBookingPeriod as t, parseTimeToMinutes as n } from "./booking-period.js";
|
|
4
4
|
import { format as r } from "date-fns";
|
|
5
5
|
//#region src/lib/booking.ts
|
|
@@ -19,12 +19,12 @@ var i = [
|
|
|
19
19
|
let n = o(t);
|
|
20
20
|
return {
|
|
21
21
|
fulfillment: e,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
startDate: n,
|
|
23
|
+
startTime: s[3] ?? "09:30",
|
|
24
|
+
endDate: n,
|
|
25
|
+
endTime: s.at(-1) ?? "18:00",
|
|
26
|
+
startAddress: "",
|
|
27
|
+
endAddress: ""
|
|
28
28
|
};
|
|
29
29
|
}, l = 30, u = 15, d = 10, f = 960, p = (e) => n(e) ?? f, m = (e) => (Math.trunc(e) % 7 + 7) % 7, h = (e) => {
|
|
30
30
|
if (e?.length) return e.map((e) => ({
|
|
@@ -58,12 +58,12 @@ var i = [
|
|
|
58
58
|
});
|
|
59
59
|
return {
|
|
60
60
|
fulfillment: e,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
startDate: o(i.startDate),
|
|
62
|
+
startTime: i.startTime,
|
|
63
|
+
endDate: o(i.endDate),
|
|
64
|
+
endTime: i.endTime,
|
|
65
|
+
startAddress: "",
|
|
66
|
+
endAddress: ""
|
|
67
67
|
};
|
|
68
68
|
}, b = (e, t, n) => {
|
|
69
69
|
let r = e.get(t);
|
|
@@ -75,12 +75,12 @@ var i = [
|
|
|
75
75
|
};
|
|
76
76
|
return {
|
|
77
77
|
fulfillment: e.get("fulfillment") === "delivery" ? "delivery" : e.get("fulfillment") === "pickup" ? "pickup" : n.fulfillment,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
startDate: b(e, "start_date", n.startDate),
|
|
79
|
+
startTime: b(e, "start_time", n.startTime),
|
|
80
|
+
endDate: b(e, "end_date", n.endDate),
|
|
81
|
+
endTime: b(e, "end_time", n.endTime),
|
|
82
|
+
startAddress: b(e, "start_address", n.startAddress),
|
|
83
|
+
endAddress: b(e, "end_address", n.endAddress)
|
|
84
84
|
};
|
|
85
85
|
}, S = (e, t) => {
|
|
86
86
|
let n = new URLSearchParams(e), r = (e, t) => {
|
|
@@ -92,7 +92,7 @@ var i = [
|
|
|
92
92
|
n.set(e, t);
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
|
-
return r("fulfillment", t.fulfillment), r("start_date", t.
|
|
95
|
+
return r("fulfillment", t.fulfillment), r("start_date", t.startDate), r("start_time", t.startTime), r("end_date", t.endDate), r("end_time", t.endTime), r("start_address", t.startAddress), r("end_address", t.endAddress), n;
|
|
96
96
|
}, C = (e) => {
|
|
97
97
|
let t = new URLSearchParams();
|
|
98
98
|
for (let n of i) {
|
package/dist/lib/cart.d.ts
CHANGED
package/dist/lib/cart.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cart.d.ts","sourceRoot":"","sources":["../../src/lib/cart.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAE5G,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,6BAA6B,EACnC,MAAM,YAAY,CAAA;AAGnB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,GAAG,EAAE,M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AAQ,GACT,EAAE;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,6BAA6B,CAAA;IACvC,QAAQ,EAAE,SAAS,CAAA;CACpB,2CAgLA;AAED,eAAO,MAAM,iBAAiB,kCAM7B,CAAA"}
|
package/dist/lib/cart.js
CHANGED
|
@@ -146,6 +146,7 @@ function h({ storeSlug: e, products: t, children: r }) {
|
|
|
146
146
|
}), k = O.reduce((e, t) => e + t.quantity, 0), A = a(() => ({
|
|
147
147
|
items: O,
|
|
148
148
|
itemCount: k,
|
|
149
|
+
isReady: h,
|
|
149
150
|
addItem: x,
|
|
150
151
|
setQuantity: S,
|
|
151
152
|
removeItem: C,
|
|
@@ -161,6 +162,7 @@ function h({ storeSlug: e, products: t, children: r }) {
|
|
|
161
162
|
T,
|
|
162
163
|
k,
|
|
163
164
|
O,
|
|
165
|
+
h,
|
|
164
166
|
C,
|
|
165
167
|
S
|
|
166
168
|
]);
|
|
@@ -27,9 +27,7 @@ export declare const requestBaseSchema: z.ZodObject<{
|
|
|
27
27
|
couponAutoApplied: z.ZodOptional<z.ZodBoolean>;
|
|
28
28
|
insuranceAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
29
29
|
customer: z.ZodObject<{
|
|
30
|
-
|
|
31
|
-
lastName: z.ZodOptional<z.ZodString>;
|
|
32
|
-
fullName: z.ZodOptional<z.ZodString>;
|
|
30
|
+
name: z.ZodString;
|
|
33
31
|
email: z.ZodString;
|
|
34
32
|
phone: z.ZodString;
|
|
35
33
|
notes: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
@@ -66,9 +64,7 @@ export declare const requestSchema: z.ZodObject<{
|
|
|
66
64
|
couponAutoApplied: z.ZodOptional<z.ZodBoolean>;
|
|
67
65
|
insuranceAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
68
66
|
customer: z.ZodObject<{
|
|
69
|
-
|
|
70
|
-
lastName: z.ZodOptional<z.ZodString>;
|
|
71
|
-
fullName: z.ZodOptional<z.ZodString>;
|
|
67
|
+
name: z.ZodString;
|
|
72
68
|
email: z.ZodString;
|
|
73
69
|
phone: z.ZodString;
|
|
74
70
|
notes: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkoutSubmit.d.ts","sourceRoot":"","sources":["../../src/lib/checkoutSubmit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAUvB,eAAO,MAAM,KAAK,2CAA2C,CAAA;AAE7D,eAAO,MAAM,yBAAyB;;;;;iBAKpC,CAAA;AACF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAI3E,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"checkoutSubmit.d.ts","sourceRoot":"","sources":["../../src/lib/checkoutSubmit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAUvB,eAAO,MAAM,KAAK,2CAA2C,CAAA;AAE7D,eAAO,MAAM,yBAAyB;;;;;iBAKpC,CAAA;AACF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAI3E,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqB5B,CAAA;AAEF,eAAO,MAAM,yBAAyB,GACpC,SAAS;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,EACxD,KAAK,CAAC,CAAC,aAAa,SAWrB,CAAA;AAED,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoBxB,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAE1D,eAAO,MAAM,cAAc;;;;;;;;;;;iBAazB,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { productKindSchema as e } from "../chunks/pkg/booking-engine/dist/models/Product.shared-CWP_qule.js";
|
|
2
|
-
import { DEFAULT_BOOKING_DELIVERY_OPTION as t, bookingScheduleInputSchema as n } from "../chunks/pkg/booking-engine/dist/schemas/cart-inputs-
|
|
3
|
-
import "../chunks/pkg/booking-engine/dist/schemas-
|
|
2
|
+
import { DEFAULT_BOOKING_DELIVERY_OPTION as t, bookingScheduleInputSchema as n } from "../chunks/pkg/booking-engine/dist/schemas/cart-inputs-3lBblkB0.js";
|
|
3
|
+
import "../chunks/pkg/booking-engine/dist/schemas-JjiUWFIv.js";
|
|
4
4
|
import { storefrontFulfillmentModeSchema as r } from "../storefrontSchemas.js";
|
|
5
5
|
import { z as i } from "zod";
|
|
6
6
|
//#region src/lib/checkoutSubmit.ts
|
|
@@ -21,18 +21,10 @@ var a = "/api/public/storefront/checkout/submit", o = i.object({
|
|
|
21
21
|
couponAutoApplied: i.boolean().optional(),
|
|
22
22
|
insuranceAccepted: i.boolean().optional(),
|
|
23
23
|
customer: i.object({
|
|
24
|
-
|
|
25
|
-
lastName: i.string().trim().min(1).optional(),
|
|
26
|
-
fullName: i.string().trim().min(2).optional(),
|
|
24
|
+
name: i.string().trim().min(2),
|
|
27
25
|
email: i.string().trim().email(),
|
|
28
26
|
phone: i.string().trim().min(6),
|
|
29
27
|
notes: i.string().trim().max(2e3).optional().or(i.literal(""))
|
|
30
|
-
}).superRefine((e, t) => {
|
|
31
|
-
e.firstName && e.lastName || e.fullName || t.addIssue({
|
|
32
|
-
code: i.ZodIssueCode.custom,
|
|
33
|
-
path: ["firstName"],
|
|
34
|
-
message: "Customer first and last names are required."
|
|
35
|
-
});
|
|
36
28
|
}),
|
|
37
29
|
items: i.array(o).min(1),
|
|
38
30
|
nowIso: i.string().datetime({ offset: !0 }).optional()
|
package/dist/lib/pricing.js
CHANGED
|
@@ -18,7 +18,7 @@ function m(e, t, n, r) {
|
|
|
18
18
|
}
|
|
19
19
|
function h(e, r, i = "UTC") {
|
|
20
20
|
try {
|
|
21
|
-
let a = n(e.
|
|
21
|
+
let a = n(e.startDate, e.startTime, i), o = n(e.endDate, e.endTime, i);
|
|
22
22
|
return o.getTime() <= a.getTime() ? null : {
|
|
23
23
|
priceUnit: r.baseUnit,
|
|
24
24
|
billableUnitCount: t(a, o, r, i)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { StorefrontBookingParams } from './booking';
|
|
2
3
|
export declare const ROUTE = "/api/public/storefront/availability/check";
|
|
3
4
|
export declare const storefrontAvailabilityScheduleSchema: z.ZodObject<{
|
|
4
5
|
startDate: z.ZodString;
|
|
@@ -7,12 +8,7 @@ export declare const storefrontAvailabilityScheduleSchema: z.ZodObject<{
|
|
|
7
8
|
endTime: z.ZodString;
|
|
8
9
|
}, z.core.$strip>;
|
|
9
10
|
export type StorefrontAvailabilitySchedule = z.infer<typeof storefrontAvailabilityScheduleSchema>;
|
|
10
|
-
export type StorefrontAvailabilityBookingParams =
|
|
11
|
-
start_date: string;
|
|
12
|
-
end_date: string;
|
|
13
|
-
start_time: string;
|
|
14
|
-
end_time: string;
|
|
15
|
-
};
|
|
11
|
+
export type StorefrontAvailabilityBookingParams = Pick<StorefrontBookingParams, "startDate" | "endDate" | "startTime" | "endTime">;
|
|
16
12
|
export declare const getValidStorefrontAvailabilitySchedule: (booking: StorefrontAvailabilityBookingParams) => StorefrontAvailabilitySchedule | null;
|
|
17
13
|
export declare const storefrontAvailabilityProductSchema: z.ZodObject<{
|
|
18
14
|
productId: z.ZodString;
|
|
@@ -61,7 +57,8 @@ export declare const storefrontPublicAvailabilityRecordSchema: z.ZodObject<{
|
|
|
61
57
|
remaining: z.ZodOptional<z.ZodNumber>;
|
|
62
58
|
}, z.core.$strip>;
|
|
63
59
|
export type StorefrontPublicAvailabilityRecord = z.infer<typeof storefrontPublicAvailabilityRecordSchema>;
|
|
64
|
-
export type StorefrontAvailabilityIssue = "unavailable" | "
|
|
60
|
+
export type StorefrontAvailabilityIssue = "unavailable" | "quantityUnavailable";
|
|
61
|
+
export type StorefrontAvailabilityStatus = "AVAILABLE" | "LOW_STOCK" | "OUT_OF_STOCK";
|
|
65
62
|
export declare const responseSchema: z.ZodObject<{
|
|
66
63
|
success: z.ZodBoolean;
|
|
67
64
|
message: z.ZodOptional<z.ZodString>;
|
|
@@ -89,5 +86,12 @@ export declare const doesStorefrontAvailabilityDisplaySoldOut: (displayMode: Pub
|
|
|
89
86
|
export declare const shouldBlockStorefrontUnavailableItem: (record: StorefrontPublicAvailabilityRecord | undefined) => boolean;
|
|
90
87
|
export declare const isStorefrontAvailabilityInsufficient: (record: StorefrontPublicAvailabilityRecord | undefined) => boolean;
|
|
91
88
|
export declare const getStorefrontAvailabilityIssue: (record: StorefrontPublicAvailabilityRecord | undefined) => StorefrontAvailabilityIssue | undefined;
|
|
92
|
-
export declare const getStorefrontAvailabilityStatus: (record: StorefrontPublicAvailabilityRecord | undefined) =>
|
|
89
|
+
export declare const getStorefrontAvailabilityStatus: (record: StorefrontPublicAvailabilityRecord | undefined) => StorefrontAvailabilityStatus;
|
|
90
|
+
export declare const getStorefrontProductAvailabilityStatus: ({ availabilityByKey, fallbackStatus, productId, productVariantIds, representedVariantId, }: {
|
|
91
|
+
availabilityByKey: ReadonlyMap<string, StorefrontPublicAvailabilityRecord>;
|
|
92
|
+
fallbackStatus?: StorefrontAvailabilityStatus;
|
|
93
|
+
productId: string;
|
|
94
|
+
productVariantIds: readonly string[];
|
|
95
|
+
representedVariantId?: string | null;
|
|
96
|
+
}) => StorefrontAvailabilityStatus;
|
|
93
97
|
//# sourceMappingURL=storefrontAvailability.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storefrontAvailability.d.ts","sourceRoot":"","sources":["../../src/lib/storefrontAvailability.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"storefrontAvailability.d.ts","sourceRoot":"","sources":["../../src/lib/storefrontAvailability.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAA;AAGxD,eAAO,MAAM,KAAK,8CAA8C,CAAA;AAEhE,eAAO,MAAM,oCAAoC;;;;;iBAK/C,CAAA;AACF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAA;AACjG,MAAM,MAAM,mCAAmC,GAAG,IAAI,CACpD,uBAAuB,EACvB,WAAW,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAClD,CAAA;AAED,eAAO,MAAM,sCAAsC,GACjD,SAAS,mCAAmC,KAC3C,8BAA8B,GAAG,IASnC,CAAA;AAED,eAAO,MAAM,mCAAmC;;;;iBAI9C,CAAA;AACF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAA;AAE/F,eAAO,MAAM,aAAa;;;;;;;;;;;;;iBAIxB,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAC1D,MAAM,MAAM,oCAAoC,GAAG,cAAc,CAAA;AAEjE,eAAO,MAAM,mCAAmC;;;;;;EAM9C,CAAA;AACF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAA;AAE/F,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;iBASnD,CAAA;AACF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC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d{2}$/)
|
|
8
8
|
}), r = (e) => {
|
|
9
9
|
let t = n.safeParse({
|
|
10
|
-
startDate: e.
|
|
11
|
-
endDate: e.
|
|
12
|
-
startTime: e.
|
|
13
|
-
endTime: e.
|
|
10
|
+
startDate: e.startDate,
|
|
11
|
+
endDate: e.endDate,
|
|
12
|
+
startTime: e.startTime,
|
|
13
|
+
endTime: e.endTime
|
|
14
14
|
});
|
|
15
15
|
return t.success ? t.data : null;
|
|
16
16
|
}, i = e.object({
|
|
@@ -45,7 +45,17 @@ var t = "/api/public/storefront/availability/check", n = e.object({
|
|
|
45
45
|
return r ? `${n}::${r}` : n;
|
|
46
46
|
}, u = (e) => e === "soldOutOnly" || e === "soldOutAndFewRemaining", d = (e) => e?.soldOut === !0 && u(e.displayMode), f = (e) => e?.insufficientCapacity === !0 || e?.soldOut === !0, p = (e) => {
|
|
47
47
|
if (e?.soldOut === !0) return "unavailable";
|
|
48
|
-
if (e?.insufficientCapacity === !0) return "
|
|
49
|
-
}, m = (e) => f(e) ? "OUT_OF_STOCK" : e?.fewRemaining ? "LOW_STOCK" : "AVAILABLE"
|
|
48
|
+
if (e?.insufficientCapacity === !0) return "quantityUnavailable";
|
|
49
|
+
}, m = (e) => f(e) ? "OUT_OF_STOCK" : e?.fewRemaining ? "LOW_STOCK" : "AVAILABLE", h = ({ availabilityByKey: e, fallbackStatus: t = "AVAILABLE", productId: n, productVariantIds: r, representedVariantId: i }) => {
|
|
50
|
+
let a = i?.trim();
|
|
51
|
+
if (a) {
|
|
52
|
+
let r = e.get(l(n, a));
|
|
53
|
+
return r ? m(r) : t;
|
|
54
|
+
}
|
|
55
|
+
let o = e.get(l(n)), s = o ? m(o) : t, c = Array.from(new Set(r.map((e) => e.trim()).filter(Boolean)));
|
|
56
|
+
if (c.length === 0) return s;
|
|
57
|
+
let u = c.map((t) => e.get(l(n, t)));
|
|
58
|
+
return u.every((e) => e !== void 0) ? u.every((e) => f(e)) ? "OUT_OF_STOCK" : s === "OUT_OF_STOCK" ? u.some((e) => e.fewRemaining) ? "LOW_STOCK" : "AVAILABLE" : s : s;
|
|
59
|
+
};
|
|
50
60
|
//#endregion
|
|
51
|
-
export { t as ROUTE, l as buildStorefrontAvailabilityKey, u as doesStorefrontAvailabilityDisplaySoldOut, p as getStorefrontAvailabilityIssue, m as getStorefrontAvailabilityStatus, r as getValidStorefrontAvailabilitySchedule, f as isStorefrontAvailabilityInsufficient, o as publicAvailabilityDisplayModeSchema, a as requestSchema, c as responseSchema, d as shouldBlockStorefrontUnavailableItem, i as storefrontAvailabilityProductSchema, n as storefrontAvailabilityScheduleSchema, s as storefrontPublicAvailabilityRecordSchema };
|
|
61
|
+
export { t as ROUTE, l as buildStorefrontAvailabilityKey, u as doesStorefrontAvailabilityDisplaySoldOut, p as getStorefrontAvailabilityIssue, m as getStorefrontAvailabilityStatus, h as getStorefrontProductAvailabilityStatus, r as getValidStorefrontAvailabilitySchedule, f as isStorefrontAvailabilityInsufficient, o as publicAvailabilityDisplayModeSchema, a as requestSchema, c as responseSchema, d as shouldBlockStorefrontUnavailableItem, i as storefrontAvailabilityProductSchema, n as storefrontAvailabilityScheduleSchema, s as storefrontPublicAvailabilityRecordSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookingPage.d.ts","sourceRoot":"","sources":["../../src/pages/BookingPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BookingPage.d.ts","sourceRoot":"","sources":["../../src/pages/BookingPage.tsx"],"names":[],"mappings":"AA+MA,MAAM,CAAC,OAAO,UAAU,WAAW,4CA+qBlC"}
|