@loczer/storefront-sdk 0.229.0 → 0.231.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.
Files changed (53) hide show
  1. package/dist/StorefrontContext.d.ts +0 -2
  2. package/dist/StorefrontContext.d.ts.map +1 -1
  3. package/dist/StorefrontProvider.d.ts +0 -1
  4. package/dist/StorefrontProvider.d.ts.map +1 -1
  5. package/dist/chunks/pkg/booking-engine/dist/schemas/{base-booking-C9kJFMIu.js → base-booking-BJXFzDM5.js} +0 -2
  6. package/dist/chunks/pkg/booking-engine/dist/schemas/{cart-inputs-epi7FXIk.js → cart-inputs-3lBblkB0.js} +0 -10
  7. package/dist/chunks/pkg/booking-engine/dist/{schemas-DW5gdDYz.js → schemas-JjiUWFIv.js} +2 -2
  8. package/dist/components/BookingBikeQuickAddCard/index.d.ts +3 -1
  9. package/dist/components/BookingBikeQuickAddCard/index.d.ts.map +1 -1
  10. package/dist/components/BookingBikeQuickAddCard/index.js +97 -85
  11. package/dist/components/BookingBikeVariantDialog/index.d.ts.map +1 -1
  12. package/dist/components/BookingBikeVariantDialog/index.js +9 -7
  13. package/dist/components/ContractSaleDocument/InvoiceDetails.d.ts.map +1 -1
  14. package/dist/components/ContractSaleDocument/InvoiceDetails.js +126 -138
  15. package/dist/components/Footer/businessHoursStatus.js +1 -1
  16. package/dist/components/LanguageSelector/index.js +1 -1
  17. package/dist/components/StorefrontCartPanel/index.js +1 -1
  18. package/dist/i18n/en.d.ts +1 -4
  19. package/dist/i18n/en.d.ts.map +1 -1
  20. package/dist/i18n/en.js +2 -5
  21. package/dist/i18n/fr.d.ts +1 -4
  22. package/dist/i18n/fr.d.ts.map +1 -1
  23. package/dist/i18n/fr.js +3 -6
  24. package/dist/index.d.ts +14 -35
  25. package/dist/index.js +3 -3
  26. package/dist/lib/booking-period.js +1 -1
  27. package/dist/lib/booking.d.ts +6 -6
  28. package/dist/lib/booking.d.ts.map +1 -1
  29. package/dist/lib/booking.js +21 -21
  30. package/dist/lib/checkoutSubmit.d.ts +2 -6
  31. package/dist/lib/checkoutSubmit.d.ts.map +1 -1
  32. package/dist/lib/checkoutSubmit.js +3 -11
  33. package/dist/lib/pricing.js +1 -1
  34. package/dist/lib/storefrontAvailability.d.ts +12 -8
  35. package/dist/lib/storefrontAvailability.d.ts.map +1 -1
  36. package/dist/lib/storefrontAvailability.js +17 -7
  37. package/dist/pages/BookingPage.d.ts.map +1 -1
  38. package/dist/pages/BookingPage.js +202 -204
  39. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  40. package/dist/pages/CheckoutPage.js +23 -25
  41. package/dist/pages/HomePage.js +8 -8
  42. package/dist/pages/ProductPage.d.ts.map +1 -1
  43. package/dist/pages/ProductPage.js +187 -181
  44. package/dist/pages/checkout/components/CheckoutDetailsCard.d.ts.map +1 -1
  45. package/dist/pages/checkout/components/CheckoutDetailsCard.js +4 -17
  46. package/dist/pages/checkout/types.d.ts +1 -2
  47. package/dist/pages/checkout/types.d.ts.map +1 -1
  48. package/dist/pages/checkout/types.js +1 -2
  49. package/dist/storefront.css +1 -1
  50. package/dist/storefrontSchemas.d.ts +0 -2
  51. package/dist/storefrontSchemas.d.ts.map +1 -1
  52. package/dist/storefrontSchemas.js +1 -2
  53. package/package.json +1 -1
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) => "AVAILABLE" | "LOW_STOCK" | "OUT_OF_STOCK";
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" | "quantity_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
- start_date: string;
3546
- start_time: string;
3547
- end_date: string;
3548
- end_time: string;
3549
- start_address: string;
3550
- end_address: string;
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;
@@ -3668,9 +3661,7 @@ export declare const storefrontCheckoutSubmitRequestBaseSchema: z.ZodObject<{
3668
3661
  couponAutoApplied: z.ZodOptional<z.ZodBoolean>;
3669
3662
  insuranceAccepted: z.ZodOptional<z.ZodBoolean>;
3670
3663
  customer: z.ZodObject<{
3671
- firstName: z.ZodOptional<z.ZodString>;
3672
- lastName: z.ZodOptional<z.ZodString>;
3673
- fullName: z.ZodOptional<z.ZodString>;
3664
+ name: z.ZodString;
3674
3665
  email: z.ZodString;
3675
3666
  phone: z.ZodString;
3676
3667
  notes: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
@@ -3706,9 +3697,7 @@ export declare const storefrontCheckoutSubmitRequestSchema: z.ZodObject<{
3706
3697
  couponAutoApplied: z.ZodOptional<z.ZodBoolean>;
3707
3698
  insuranceAccepted: z.ZodOptional<z.ZodBoolean>;
3708
3699
  customer: z.ZodObject<{
3709
- firstName: z.ZodOptional<z.ZodString>;
3710
- lastName: z.ZodOptional<z.ZodString>;
3711
- fullName: z.ZodOptional<z.ZodString>;
3700
+ name: z.ZodString;
3712
3701
  email: z.ZodString;
3713
3702
  phone: z.ZodString;
3714
3703
  notes: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
@@ -3785,7 +3774,6 @@ export declare const storefrontConfigurationSchema: z.ZodObject<{
3785
3774
  }>;
3786
3775
  defaultFewRemainingThreshold: z.ZodOptional<z.ZodNumber>;
3787
3776
  }, z.core.$strip>;
3788
- enabled: z.ZodBoolean;
3789
3777
  fulfillmentModes: z.ZodArray<z.ZodEnum<{
3790
3778
  pickup: "pickup";
3791
3779
  delivery: "delivery";
@@ -4401,10 +4389,6 @@ export declare const storefrontEn: {
4401
4389
  checkout_estimated_total: string;
4402
4390
  checkout_form_title: string;
4403
4391
  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
4392
  checkout_full_name_label: string;
4409
4393
  checkout_full_name_placeholder: string;
4410
4394
  checkout_email_label: string;
@@ -4487,6 +4471,7 @@ export declare const storefrontEn: {
4487
4471
  docs_contract_sale_credit_note_title: string;
4488
4472
  docs_contract_sale_page_counter: string;
4489
4473
  docs_contract_sale_invoice_date_label: string;
4474
+ docs_contract_sale_invoice_and_due_date_label: string;
4490
4475
  docs_contract_sale_quote_date_label: string;
4491
4476
  docs_contract_sale_credit_note_date_label: string;
4492
4477
  docs_contract_sale_due_date_label: string;
@@ -4961,10 +4946,6 @@ export declare const storefrontFr: {
4961
4946
  checkout_estimated_total: string;
4962
4947
  checkout_form_title: string;
4963
4948
  checkout_form_description: string;
4964
- checkout_first_name_label: string;
4965
- checkout_first_name_placeholder: string;
4966
- checkout_last_name_label: string;
4967
- checkout_last_name_placeholder: string;
4968
4949
  checkout_full_name_label: string;
4969
4950
  checkout_full_name_placeholder: string;
4970
4951
  checkout_email_label: string;
@@ -5047,6 +5028,7 @@ export declare const storefrontFr: {
5047
5028
  docs_contract_sale_credit_note_title: string;
5048
5029
  docs_contract_sale_page_counter: string;
5049
5030
  docs_contract_sale_invoice_date_label: string;
5031
+ docs_contract_sale_invoice_and_due_date_label: string;
5050
5032
  docs_contract_sale_quote_date_label: string;
5051
5033
  docs_contract_sale_credit_note_date_label: string;
5052
5034
  docs_contract_sale_due_date_label: string;
@@ -6226,7 +6208,6 @@ export declare const storefrontSettingsSchema: z.ZodObject<{
6226
6208
  }>;
6227
6209
  defaultFewRemainingThreshold: z.ZodOptional<z.ZodNumber>;
6228
6210
  }, z.core.$strip>;
6229
- enabled: z.ZodBoolean;
6230
6211
  fulfillmentModes: z.ZodArray<z.ZodEnum<{
6231
6212
  pickup: "pickup";
6232
6213
  delivery: "delivery";
@@ -6435,7 +6416,6 @@ export declare function useStorefrontConfig(): {
6435
6416
  defaultMode: "fewRemaining" | "fewRemainingCounts" | "remainingCounts" | "soldOutAndFewRemaining" | "soldOutOnly";
6436
6417
  defaultFewRemainingThreshold?: number | undefined;
6437
6418
  };
6438
- enabled: boolean;
6439
6419
  fulfillmentModes: ("pickup" | "delivery")[];
6440
6420
  deliveryDisabledReason: string;
6441
6421
  sameDayCutoff: string;
@@ -6678,7 +6658,6 @@ export declare function useStorefrontConfig(): {
6678
6658
  defaultMode: "fewRemaining" | "fewRemainingCounts" | "remainingCounts" | "soldOutAndFewRemaining" | "soldOutOnly";
6679
6659
  defaultFewRemainingThreshold?: number | undefined;
6680
6660
  };
6681
- enabled: boolean;
6682
6661
  fulfillmentModes: ("pickup" | "delivery")[];
6683
6662
  deliveryDisabledReason: string;
6684
6663
  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-epi7FXIk.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-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-C9kJFMIu.js";
16
- import "./chunks/pkg/booking-engine/dist/schemas-DW5gdDYz.js";
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-DW5gdDYz.js";
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,
@@ -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
- start_date: string;
8
- start_time: string;
9
- end_date: string;
10
- end_time: string;
11
- start_address: string;
12
- end_address: string;
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,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,8CAA8C,GACzD,MAAM,uBAAuB,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,EACtD,UAAS;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAO,KACvC,mBAmBF,CAAA;AAED,eAAO,MAAM,uDAAuD,GAClE,eAAe,uBAAuB,CAAC,eAAe,CAAC,EACvD,UAAS;IAAE,aAAa,CAAC,EAAE,MA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B,WAAW,OAAO,CAAC,uBAAuB,CAAC,KAC1C,uBA0BF,CAAA;AAED,eAAO,MAAM,0BAA0B,GACrC,cAAc,eAAe,EAC7B,SAAS,OAAO,CAAC,uBAAuB,CAAC,KACxC,eAoBF,CAAA;AAED,eAAO,MAAM,uBAAuB,GAAI,cAAc,eAAe,KAAG,eAcvE,CAAA;AAuBD,eAAO,MAAM,2BAA2B,GAAI,YAAY,MAAM,KAAG,MAOhE,CAAA;AAED,eAAO,MAAM,kCAAkC,GAC7C,SAAS,oBAAoB,EAC7B,YAAY,MAAM,KACjB,eAiBF,CAAA;AAED,eAAO,MAAM,iCAAiC,GAC5C,SAAS,oBAAoB,EAC7B,WAAW,MAAM,GAAG,SAAS,EAC7B,SAAS,OAAO,CAAC,uBAAuB,CAAC,GAAG,eAAe,KAC1D,IAkBF,CAAA;AAED,eAAO,MAAM,yCAAyC,GAAI,YAAY,MAAM,KAAG,eAE9E,CAAA;AAED,eAAO,MAAM,wCAAwC,GACnD,WAAW,MAAM,GAAG,SAAS,EAC7B,SAAS,OAAO,CAAC,uBAAuB,CAAC,GAAG,eAAe,KAC1D,IAEF,CAAA;AAED,eAAO,MAAM,0BAA0B,GACrC,cAAc,eAAe,EAC7B,UAAU;IACR,OAAO,CAAC,EAAE,oBAAoB,CAAA;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,KACA,eAOF,CAAA;AAED,eAAO,MAAM,4CAA4C,GACvD,cAAc,eAAe,EAC7B,YAAY,MAAM,KACjB,eAKF,CAAA"}
@@ -1,5 +1,5 @@
1
- import { DEFAULT_BOOKING_DELIVERY_OPTION as e } from "../chunks/pkg/booking-engine/dist/schemas/cart-inputs-epi7FXIk.js";
2
- import "../chunks/pkg/booking-engine/dist/schemas-DW5gdDYz.js";
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
- start_date: n,
23
- start_time: s[3] ?? "09:30",
24
- end_date: n,
25
- end_time: s.at(-1) ?? "18:00",
26
- start_address: "",
27
- end_address: ""
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
- start_date: o(i.startDate),
62
- start_time: i.startTime,
63
- end_date: o(i.endDate),
64
- end_time: i.endTime,
65
- start_address: "",
66
- end_address: ""
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
- start_date: b(e, "start_date", n.start_date),
79
- start_time: b(e, "start_time", n.start_time),
80
- end_date: b(e, "end_date", n.end_date),
81
- end_time: b(e, "end_time", n.end_time),
82
- start_address: b(e, "start_address", n.start_address),
83
- end_address: b(e, "end_address", n.end_address)
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.start_date), r("start_time", t.start_time), r("end_date", t.end_date), r("end_time", t.end_time), r("start_address", t.start_address), r("end_address", t.end_address), n;
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) {
@@ -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
- firstName: z.ZodOptional<z.ZodString>;
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
- firstName: z.ZodOptional<z.ZodString>;
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+B5B,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
+ {"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-epi7FXIk.js";
3
- import "../chunks/pkg/booking-engine/dist/schemas-DW5gdDYz.js";
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
- firstName: i.string().trim().min(1).optional(),
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()
@@ -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.start_date, e.start_time, i), o = n(e.end_date, e.end_time, i);
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" | "quantity_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) => "AVAILABLE" | "LOW_STOCK" | "OUT_OF_STOCK";
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;AAGvB,eAAO,MAAM,KAAK,8CAA8C,CAAA;AAEhE,eAAO,MAAM,oCAAoC;;;;;i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,EAAE,kCAAkC,CAAC,CAAA;IAC1E,cAAc,CAAC,EAAE,4BAA4B,CAAA;IAC7C,SAAS,EAAE,MAAM,CAAA;IACjB,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAA;IACpC,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACrC,KAAG,4BAyCH,CAAA"}
@@ -7,10 +7,10 @@ var t = "/api/public/storefront/availability/check", n = e.object({
7
7
  endTime: e.string().regex(/^\d{2}:\d{2}$/)
8
8
  }), r = (e) => {
9
9
  let t = n.safeParse({
10
- startDate: e.start_date,
11
- endDate: e.end_date,
12
- startTime: e.start_time,
13
- endTime: e.end_time
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 "quantity_unavailable";
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":"AA6MA,MAAM,CAAC,OAAO,UAAU,WAAW,4CAmrBlC"}
1
+ {"version":3,"file":"BookingPage.d.ts","sourceRoot":"","sources":["../../src/pages/BookingPage.tsx"],"names":[],"mappings":"AA+MA,MAAM,CAAC,OAAO,UAAU,WAAW,4CAirBlC"}