@loczer/storefront-sdk 0.182.0 → 0.183.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 +18 -15
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/StorefrontProvider.js +24 -34
- package/dist/chunks/booking-engine/dist/models/{Product.shared-CJ6vPb6n.js → Product.shared-CTuk4fiR.js} +2 -2
- package/dist/chunks/booking-engine/dist/schemas/{base-asset-PqhtKnZA.js → base-asset-B_Dm8_Vk.js} +1 -1
- package/dist/chunks/booking-engine/dist/schemas/{base-booking-BM3jZzqu.js → base-booking-DW8AEPKo.js} +1 -1
- package/dist/chunks/booking-engine/dist/schemas/{base-product-BJd4ttMP.js → base-product-1H8l2aUv.js} +1 -1
- package/dist/chunks/booking-engine/dist/{schemas-BNlwu75Z.js → schemas-34QQv0EH.js} +4 -4
- package/dist/chunks/ui/dist/Map/{MapContent--PwVTg2W.js → MapContent-QPkuTBvK.js} +2 -2
- package/dist/chunks/ui/dist/Map/{constants-DqrK8UkE.js → constants-BNmiJXfg.js} +1 -1
- package/dist/chunks/ui/dist/{Map-B45AxZ-D.js → Map-BXmRf5Ep.js} +3 -3
- package/dist/chunks/ui/dist/static/strings-1T2w7LqX.js +4 -0
- package/dist/components/AboutSection/index.d.ts +1 -6
- package/dist/components/AboutSection/index.d.ts.map +1 -1
- package/dist/components/AboutSection/index.js +43 -39
- package/dist/components/ContactSection/index.d.ts +1 -3
- package/dist/components/ContactSection/index.d.ts.map +1 -1
- package/dist/components/ContactSection/index.js +222 -164
- package/dist/components/Footer/index.d.ts +3 -4
- package/dist/components/Footer/index.d.ts.map +1 -1
- package/dist/components/Footer/index.js +98 -69
- package/dist/components/FulfillmentSection/index.d.ts.map +1 -1
- package/dist/components/FulfillmentSection/index.js +17 -16
- package/dist/components/Header/index.d.ts +1 -3
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +77 -72
- package/dist/components/Layout/index.d.ts +3 -1
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/Layout/index.js +45 -47
- package/dist/components/Map/index.js +1 -1
- package/dist/components/ProductPriceBadge/index.d.ts.map +1 -1
- package/dist/components/ProductPriceBadge/index.js +68 -60
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/fr.js +1 -1
- package/dist/index.d.ts +151 -150
- package/dist/index.js +62 -62
- package/dist/lib/cart.d.ts +4 -1
- package/dist/lib/cart.d.ts.map +1 -1
- package/dist/lib/cart.js +64 -40
- package/dist/lib/cartSummary.d.ts.map +1 -1
- package/dist/lib/cartSummary.js +4 -3
- package/dist/lib/checkoutSubmit.js +2 -2
- package/dist/lib/productVariants.d.ts.map +1 -1
- package/dist/lib/productVariants.js +20 -9
- package/dist/lib/storefrontAddress.d.ts +5 -0
- package/dist/lib/storefrontAddress.d.ts.map +1 -0
- package/dist/lib/storefrontAddress.js +24 -0
- package/dist/lib/storefrontAvailability.d.ts +6 -6
- package/dist/lib/storefrontContact.d.ts +10 -0
- package/dist/lib/storefrontContact.d.ts.map +1 -0
- package/dist/lib/storefrontContact.js +24 -0
- package/dist/lib/storefrontMissingValues.d.ts +5 -0
- package/dist/lib/storefrontMissingValues.d.ts.map +1 -0
- package/dist/lib/storefrontMissingValues.js +4 -0
- package/dist/lib/storefrontProducts.d.ts +23 -21
- package/dist/lib/storefrontProducts.d.ts.map +1 -1
- package/dist/lib/storefrontProducts.js +7 -5
- package/dist/lib/whatsapp.d.ts +8 -6
- package/dist/lib/whatsapp.d.ts.map +1 -1
- package/dist/lib/whatsapp.js +16 -43
- package/dist/pages/BookingPage.js +36 -36
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +126 -128
- package/dist/pages/ProductPage.js +160 -160
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.d.ts +14 -12
- package/dist/storefrontSchemas.d.ts.map +1 -1
- package/dist/storefrontSchemas.js +3 -2
- package/dist/ui/radio-group.d.ts +1 -1
- package/package.json +7 -6
- package/dist/chunks/ui/dist/static/strings-CPnO-KbA.js +0 -4
- package/dist/data/config.d.ts +0 -15
- package/dist/data/config.d.ts.map +0 -1
- package/dist/data/config.js +0 -24
- package/dist/static/strings.d.ts +0 -2
- package/dist/static/strings.d.ts.map +0 -1
- package/dist/static/strings.js +0 -4
package/dist/index.js
CHANGED
|
@@ -2,79 +2,79 @@
|
|
|
2
2
|
import { createLocalizedStringEntry as e, getLocalizedStringValue as t, localizedStringArraySchema as n, localizedStringEntrySchema as r, localizedStringSchema as i } from "./chunks/booking-engine/dist/models/LocalizedString-D_TRgAdr.js";
|
|
3
3
|
import { currencyCodeSchema as a, currencyMinorUnitDigits as o, majorToMinor as s, minorToMajor as c, moneyMinorSchema as l, signedMoneyMinorSchema as u } from "./chunks/booking-engine/dist/schemas/money-CVoCY4of.js";
|
|
4
4
|
import { priceSchema as d, priceUnitSchema as f } from "./chunks/booking-engine/dist/models/Price-DCAgqkKh.js";
|
|
5
|
-
import { PRODUCT_VARIANT_CODE_IDENTIFIER_KIND as p, PRODUCT_VARIANT_CODE_MAX_LENGTH as m, accessoryProductSchema as h, bikeProductSchema as g, eBikeProductSchema as _, isProductVariantCodeIdentifierKind as v, productKindSchema as y, productSchema as b, productStorefrontDisplayModeSchema as x, productVariantAttributeSchema as S, productVariantCodeSchema as C, productVariantIdentifierSchema as w, productVariantSchema as T } from "./chunks/booking-engine/dist/models/Product.shared-
|
|
5
|
+
import { PRODUCT_VARIANT_CODE_IDENTIFIER_KIND as p, PRODUCT_VARIANT_CODE_MAX_LENGTH as m, accessoryProductSchema as h, bikeProductSchema as g, eBikeProductSchema as _, isProductVariantCodeIdentifierKind as v, productKindSchema as y, productSchema as b, productStorefrontDisplayModeSchema as x, productVariantAttributeSchema as S, productVariantCodeSchema as C, productVariantIdentifierSchema as w, productVariantSchema as T } from "./chunks/booking-engine/dist/models/Product.shared-CTuk4fiR.js";
|
|
6
6
|
import { richTextJsonDocSchema as E, richTextSchema as D, richTextVersionSchema as O } from "./chunks/booking-engine/dist/schemas/rich-text-DTRh7U3z.js";
|
|
7
7
|
import { isoDateSchema as k, shopConfigurationSchema as A, shopExtraTimeSlotRuleSchema as j, shopOpeningDayIndexSchema as M, shopOpeningDaySchema as N, shopOpeningHoursOverrideSchema as P, shopOpeningHoursPeriodSchema as F, shopOpeningSlotSchema as I, timeOfDaySchema as L } from "./chunks/booking-engine/dist/schemas/shop-opening-hours-BlLD1gfz.js";
|
|
8
8
|
import { DEFAULT_CANCELLATION_POLICY as R, DEFAULT_PAYMENT_POLICIES as z, cancellationPolicySchema as B, cancellationPolicyTierSchema as V, paymentPoliciesSchema as H } from "./chunks/booking-engine/dist/schemas/booking-engine-configuration-D02MRF9U.js";
|
|
9
9
|
import { fulfillmentModeSchema as U, publicBookingEngineConfigurationSchema as W, publicCheckoutConfigurationSchema as G, publicCheckoutDynamicOptionsSchema as K } from "./chunks/booking-engine/dist/schemas/public-booking-engine-configuration-BnJ_H-p1.js";
|
|
10
10
|
import { bookingCustomerInputSchema as q, bookingDeliveryOptionSchema as J, bookingScheduleInputSchema as Y, cartItemInputSchema as X, createBookingInputBaseSchema as Z, createBookingInputSchema as Q, validateBookingDeliveryAddress as $ } from "./chunks/booking-engine/dist/schemas/cart-inputs-9vM8GCrc.js";
|
|
11
|
-
import { baseAssetSchema as ee, baseAssetStatusSchema as te } from "./chunks/booking-engine/dist/schemas/base-asset-
|
|
12
|
-
import { baseBookingItemSchema as ne, baseBookingSchema as re, baseBookingStateSchema as ie } from "./chunks/booking-engine/dist/schemas/base-booking-
|
|
13
|
-
import "./chunks/booking-engine/dist/schemas-
|
|
11
|
+
import { baseAssetSchema as ee, baseAssetStatusSchema as te } from "./chunks/booking-engine/dist/schemas/base-asset-B_Dm8_Vk.js";
|
|
12
|
+
import { baseBookingItemSchema as ne, baseBookingSchema as re, baseBookingStateSchema as ie } from "./chunks/booking-engine/dist/schemas/base-booking-DW8AEPKo.js";
|
|
13
|
+
import "./chunks/booking-engine/dist/schemas-34QQv0EH.js";
|
|
14
14
|
import { storefrontCheckoutModeSchema as ae, storefrontConfigurationSchema as oe, storefrontContentSchema as se, storefrontFaqItemSchema as ce, storefrontFaqSchema as le, storefrontFulfillmentModeSchema as ue, storefrontLocalizedRichTextSchema as de, storefrontModalMessageSchema as fe, storefrontModulesSchema as pe, storefrontReviewsModuleSchema as me, storefrontRichTextSchema as he, storefrontSettingsSchema as ge, storefrontShopSchema as _e, storefrontStatusSchema as ve, storefrontWorkspaceSchema as ye } from "./storefrontSchemas.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { StorefrontCartProvider as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { buildWhatsAppHref as
|
|
25
|
-
import { ROUTE as
|
|
26
|
-
import { ROUTE as
|
|
27
|
-
import { ROUTE as
|
|
28
|
-
import { ROUTE as
|
|
29
|
-
import { ROUTE as
|
|
30
|
-
import { Footer as
|
|
31
|
-
import { Badge as
|
|
32
|
-
import { Button as
|
|
33
|
-
import { Header as
|
|
34
|
-
import { storefront as
|
|
35
|
-
import { storefront as
|
|
36
|
-
import { PoweredByLoczerBadge as
|
|
37
|
-
import { PlatformFooter as
|
|
38
|
-
import { useWhatsAppFloatingButton as
|
|
39
|
-
import { WhatsAppFloatingButton as
|
|
15
|
+
import { BOOKING_SEARCH_KEYS as be, TIME_OPTIONS as xe, applyBookingParamsToSearch as Se, createBookingPeriodConfigFromBookingEngineConfiguration as Ce, createBookingPeriodConfigFromStorefrontConfiguration as we, getBookingDurationLabel as Te, getBookingDurationMinutes as Ee, getBookingParamsFromSearch as De, getBookingSessionStorageKey as Oe, getDefaultBookingParams as ke, getDefaultBookingParamsForStorefrontConfiguration as Ae, pickBookingSearchParams as je, readBookingSearchParamsFromSessionStorage as Me, readBookingSearchParamsFromStorage as Ne, resolveBookingSearchParams as Pe, resolveBookingSearchParamsFromSessionStorage as Fe, writeBookingSearchParamsToSessionStorage as Ie, writeBookingSearchParamsToStorage as Le } from "./lib/booking.js";
|
|
16
|
+
import { CATALOG_PRODUCT_BASE_RATE_UNSET as Re, buildStorefrontProductSlug as ze, buildVariantStorefrontProductId as Be, compareCatalogProducts as Ve, compareStorefrontAccessoryProducts as He, compareStorefrontBikeProducts as Ue, findStorefrontProduct as We, findStorefrontProductBySlug as Ge, getCatalogProductBaseRateMinor as Ke, getCatalogProductPaginationSort as qe, getCatalogProductSortFieldForPriceUnit as Je, getStorefrontBaseDailyRateMinor as Ye, getStorefrontCheckoutProductId as Xe, getStorefrontRepresentedVariantId as Ze, toStorefrontAccessoryProducts as Qe, toStorefrontBikeProducts as $e, toStorefrontBookingProducts as et, toStorefrontBookingProductsCollections as tt } from "./lib/products.js";
|
|
17
|
+
import { StorefrontCartProvider as nt, resolveStorefrontCartItemProduct as rt, useStorefrontCart as it } from "./lib/cart.js";
|
|
18
|
+
import { cn as at, formatPriceMinor as ot, getAvailabilityVariant as st, getMinDayPriceMinor as ct } from "./lib/utils.js";
|
|
19
|
+
import { buildDailyPriceRows as lt, buildPriceTierLabels as ut, calculateDailyPriceForQuantity as dt, formatStorefrontPriceMinor as ft } from "./lib/pricing.js";
|
|
20
|
+
import { getLocalizedEntry as pt, getLocalizedValue as mt } from "./localization.js";
|
|
21
|
+
import { buildStorefrontCartSummary as ht } from "./lib/cartSummary.js";
|
|
22
|
+
import { ROUTE as gt, requestSchema as _t, responseSchema as vt } from "./lib/contactForm.js";
|
|
23
|
+
import { formatStorefrontPhoneDisplay as yt, resolveStorefrontMapsHref as bt, resolveStorefrontPhoneContact as xt } from "./lib/storefrontContact.js";
|
|
24
|
+
import { buildWhatsAppHref as St, resolveStorefrontWhatsAppContact as Ct, resolveStorefrontWhatsAppHref as wt } from "./lib/whatsapp.js";
|
|
25
|
+
import { ROUTE as Tt, requestBaseSchema as Et, requestCheckoutItemSchema as Dt, requestDeliveryRefinement as Ot, requestSchema as kt, responseSchema as At } from "./lib/checkoutSubmit.js";
|
|
26
|
+
import { ROUTE as jt, requestSchema as Mt, responseSchema as Nt, storefrontPublicAccessoryProductSchema as Pt, storefrontPublicBikeAvailabilityStatusSchema as Ft, storefrontPublicBikeProductSchema as It, storefrontPublicProductDisplayModeSchema as Lt, storefrontPublicProductPriceSchema as Rt, storefrontPublicProductVariantAttributeSchema as zt, storefrontPublicProductVariantIdentifierSchema as Bt, storefrontPublicProductVariantSchema as Vt } from "./lib/storefrontProducts.js";
|
|
27
|
+
import { ROUTE as Ht, buildStorefrontAvailabilityKey as Ut, doesStorefrontAvailabilityDisplaySoldOut as Wt, getStorefrontAvailabilityIssue as Gt, getStorefrontAvailabilityStatus as Kt, isStorefrontAvailabilityInsufficient as qt, publicAvailabilityDisplayModeSchema as Jt, requestSchema as Yt, responseSchema as Xt, shouldBlockStorefrontUnavailableItem as Zt, storefrontAvailabilityProductSchema as Qt, storefrontAvailabilityScheduleSchema as $t, storefrontPublicAvailabilityRecordSchema as en } from "./lib/storefrontAvailability.js";
|
|
28
|
+
import { ROUTE as tn, buildStorefrontImageUrl as nn, requestSchema as rn } from "./lib/storefrontImage.js";
|
|
29
|
+
import { ROUTE as an, requestSchema as on, responseSchema as sn, storefrontTimeSlotSchema as cn, timeSlotJourneySchema as ln } from "./lib/storefrontTimeSlots.js";
|
|
30
|
+
import { Footer as un } from "./components/Footer/index.js";
|
|
31
|
+
import { Badge as dn, badgeVariants as fn } from "./ui/badge.js";
|
|
32
|
+
import { Button as pn, buttonVariants as mn } from "./ui/button.js";
|
|
33
|
+
import { Header as hn } from "./components/Header/index.js";
|
|
34
|
+
import { storefront as gn } from "./i18n/en.js";
|
|
35
|
+
import { storefront as _n } from "./i18n/fr.js";
|
|
36
|
+
import { PoweredByLoczerBadge as vn } from "./components/PoweredByLoczerBadge/index.js";
|
|
37
|
+
import { PlatformFooter as yn } from "./components/PlatformFooter/index.js";
|
|
38
|
+
import { useWhatsAppFloatingButton as bn } from "./components/WhatsAppFloatingButton/useWhatsAppFloatingButton.js";
|
|
39
|
+
import { WhatsAppFloatingButton as xn } from "./components/WhatsAppFloatingButton/WhatsAppFloatingButton.js";
|
|
40
40
|
import "./components/WhatsAppFloatingButton/index.js";
|
|
41
|
-
import { Layout as
|
|
42
|
-
import { DelayedPlaceholder as
|
|
43
|
-
import { BookingPeriodProvider as
|
|
44
|
-
import { Label as
|
|
45
|
-
import { BookingStartDateField as
|
|
46
|
-
import { BookingStartTimeField as
|
|
47
|
-
import { BookingEndDateField as
|
|
48
|
-
import { BookingEndTimeField as
|
|
49
|
-
import { BookingMobileDateDrawer as
|
|
50
|
-
import { BookingPeriodSelector as
|
|
51
|
-
import { BookingFlowSteps as
|
|
52
|
-
import { Input as
|
|
53
|
-
import { DeliveryAddressSelector as
|
|
54
|
-
import { loader as
|
|
55
|
-
import { Form as
|
|
56
|
-
import { Textarea as
|
|
57
|
-
import { ContactSection as
|
|
58
|
-
import { TestimonialsSection as
|
|
59
|
-
import { AboutSection as
|
|
60
|
-
import { StepSectionTitle as
|
|
61
|
-
import { Card as
|
|
62
|
-
import { ProductWarningNotice as
|
|
63
|
-
import { StorefrontCartPanel as
|
|
64
|
-
import { ProductPriceBadge as
|
|
65
|
-
import { ContractSaleDocument as
|
|
41
|
+
import { Layout as Sn } from "./components/Layout/index.js";
|
|
42
|
+
import { DelayedPlaceholder as Cn, DelayedReveal as wn } from "./components/DelayedReveal/index.js";
|
|
43
|
+
import { BookingPeriodProvider as Tn, useBookingPeriod as En } from "./components/BookingPeriodSelector/BookingPeriodContext.js";
|
|
44
|
+
import { Label as Dn } from "./ui/label.js";
|
|
45
|
+
import { BookingStartDateField as On } from "./components/BookingPeriodSelector/components/BookingStartDateField.js";
|
|
46
|
+
import { BookingStartTimeField as kn } from "./components/BookingPeriodSelector/components/BookingStartTimeField.js";
|
|
47
|
+
import { BookingEndDateField as An } from "./components/BookingPeriodSelector/components/BookingEndDateField.js";
|
|
48
|
+
import { BookingEndTimeField as jn } from "./components/BookingPeriodSelector/components/BookingEndTimeField.js";
|
|
49
|
+
import { BookingMobileDateDrawer as Mn } from "./components/BookingPeriodSelector/components/BookingMobileDateDrawer.js";
|
|
50
|
+
import { BookingPeriodSelector as Nn } from "./components/BookingPeriodSelector/index.js";
|
|
51
|
+
import { BookingFlowSteps as Pn } from "./components/BookingFlowSteps/index.js";
|
|
52
|
+
import { Input as Fn } from "./ui/input.js";
|
|
53
|
+
import { DeliveryAddressSelector as In } from "./components/DeliveryAddressSelector/index.js";
|
|
54
|
+
import { loader as Ln, useOptionalStorefront as Rn, useStorefront as zn, useStorefrontBookingProducts as Bn, useStorefrontConfig as Vn, useStorefrontProducts as Hn, useStorefrontWorkspaceLanguage as Un } from "./StorefrontProvider.js";
|
|
55
|
+
import { Form as Wn, FormControl as Gn, FormDescription as Kn, FormField as qn, FormItem as Jn, FormLabel as Yn, FormMessage as Xn, useFormField as Zn } from "./ui/form.js";
|
|
56
|
+
import { Textarea as Qn } from "./ui/textarea.js";
|
|
57
|
+
import { ContactSection as $n } from "./components/ContactSection/index.js";
|
|
58
|
+
import { TestimonialsSection as er } from "./components/TestimonialsSection/index.js";
|
|
59
|
+
import { AboutSection as tr } from "./components/AboutSection/index.js";
|
|
60
|
+
import { StepSectionTitle as nr } from "./components/StepSectionTitle/index.js";
|
|
61
|
+
import { Card as rr, CardAction as ir, CardContent as ar, CardDescription as or, CardFooter as sr, CardHeader as cr, CardTitle as lr } from "./ui/card.js";
|
|
62
|
+
import { ProductWarningNotice as ur } from "./components/ProductWarningNotice/index.js";
|
|
63
|
+
import { StorefrontCartPanel as dr } from "./components/StorefrontCartPanel/index.js";
|
|
64
|
+
import { ProductPriceBadge as fr } from "./components/ProductPriceBadge/index.js";
|
|
65
|
+
import { ContractSaleDocument as pr } from "./components/ContractSaleDocument/Invoice.js";
|
|
66
66
|
import "./components/ContractSaleDocument/index.js";
|
|
67
|
-
import { RadioGroup as
|
|
67
|
+
import { RadioGroup as mr, RadioGroupItem as hr } from "./ui/radio-group.js";
|
|
68
68
|
import "./pages/HomePage.js";
|
|
69
69
|
import "./pages/BookingPage.js";
|
|
70
70
|
import "./pages/ProductPage.js";
|
|
71
71
|
import "./pages/CheckoutPage.js";
|
|
72
72
|
import "./pages/CheckoutSuccessPage.js";
|
|
73
73
|
import "./pages/NotFoundPage.js";
|
|
74
|
-
import { accessories as
|
|
75
|
-
import
|
|
76
|
-
import { contractSaleDocumentAcceptanceLevelSchema as
|
|
77
|
-
import { ACCEPT_CONTRACT_SALE_DOCUMENT_ROUTE as
|
|
78
|
-
import
|
|
79
|
-
import { Select as
|
|
80
|
-
export {
|
|
74
|
+
import { accessories as gr } from "./data/accessories.js";
|
|
75
|
+
import _r from "./data/bikes.js";
|
|
76
|
+
import { contractSaleDocumentAcceptanceLevelSchema as vr, contractSaleDocumentAcceptanceRecordSchema as yr, contractSaleDocumentAcceptanceSchema as br, contractSaleDocumentAddressSchema as xr, contractSaleDocumentContactSchema as Sr, contractSaleDocumentKindSchema as Cr, contractSaleDocumentLanguageCodeSchema as wr, contractSaleDocumentLanguageSchema as Tr, contractSaleDocumentLineItemSchema as Er, contractSaleDocumentSchema as Dr, contractSaleDocumentSignatureSchema as Or } from "./lib/contractSaleDocument.js";
|
|
77
|
+
import { ACCEPT_CONTRACT_SALE_DOCUMENT_ROUTE as kr, DOWNLOAD_CONTRACT_SALE_DOCUMENT_PDF_ROUTE as Ar, GET_CONTRACT_SALE_DOCUMENT_ROUTE as jr, acceptContractSaleDocumentRequestSchema as Mr, acceptContractSaleDocumentResponseSchema as Nr, contractSaleDocumentAcceptanceInputSchema as Pr, contractSaleDocumentAcceptanceRecordInputSchema as Fr, contractSaleDocumentApiAcceptanceRecordSchema as Ir, contractSaleDocumentApiAcceptanceSchema as Lr, contractSaleDocumentApiSchema as Rr, contractSaleDocumentApiSignatureSchema as zr, contractSaleDocumentReferenceSchema as Br, contractSaleDocumentReferenceTypeSchema as Vr, contractSaleDocumentSignatureInputSchema as Hr, downloadContractSaleDocumentPdfRequestSchema as Ur, getContractSaleDocumentRequestSchema as Wr, getContractSaleDocumentResponseSchema as Gr } from "./lib/contractSaleDocumentApi.js";
|
|
78
|
+
import Kr from "./routes.js";
|
|
79
|
+
import { Select as qr, SelectContent as Jr, SelectGroup as Yr, SelectIcon as Xr, SelectItem as Zr, SelectItemIndicator as Qr, SelectItemText as $r, SelectLabel as ei, SelectScrollDownButton as ti, SelectScrollUpButton as ni, SelectSeparator as ri, SelectTrigger as ii, SelectValue as ai } from "./ui/select.js";
|
|
80
|
+
export { kr as ACCEPT_CONTRACT_SALE_DOCUMENT_ROUTE, tr as AboutSection, be as BOOKING_SEARCH_KEYS, dn as Badge, An as BookingEndDateField, jn as BookingEndTimeField, Pn as BookingFlowSteps, Mn as BookingMobileDateDrawer, Tn as BookingPeriodProvider, Nn as BookingPeriodSelector, On as BookingStartDateField, kn as BookingStartTimeField, pn as Button, Re as CATALOG_PRODUCT_BASE_RATE_UNSET, rr as Card, ir as CardAction, ar as CardContent, or as CardDescription, sr as CardFooter, cr as CardHeader, lr as CardTitle, $n as ContactSection, pr as ContractSaleDocument, R as DEFAULT_CANCELLATION_POLICY, z as DEFAULT_PAYMENT_POLICIES, Ar as DOWNLOAD_CONTRACT_SALE_DOCUMENT_PDF_ROUTE, Cn as DelayedPlaceholder, wn as DelayedReveal, In as DeliveryAddressSelector, un as Footer, Wn as Form, Gn as FormControl, Kn as FormDescription, qn as FormField, Jn as FormItem, Yn as FormLabel, Xn as FormMessage, jr as GET_CONTRACT_SALE_DOCUMENT_ROUTE, hn as Header, Fn as Input, Dn as Label, Sn as Layout, p as PRODUCT_VARIANT_CODE_IDENTIFIER_KIND, m as PRODUCT_VARIANT_CODE_MAX_LENGTH, yn as PlatformFooter, vn as PoweredByLoczerBadge, fr as ProductPriceBadge, ur as ProductWarningNotice, gt as ROUTE, mr as RadioGroup, hr as RadioGroupItem, Ht as STOREFRONT_AVAILABILITY_ROUTE, Tt as STOREFRONT_CHECKOUT_SUBMIT_ROUTE, tn as STOREFRONT_IMAGE_ROUTE, jt as STOREFRONT_PRODUCTS_ROUTE, an as STOREFRONT_TIME_SLOTS_ROUTE, qr as Select, Jr as SelectContent, Yr as SelectGroup, Xr as SelectIcon, Zr as SelectItem, Qr as SelectItemIndicator, $r as SelectItemText, ei as SelectLabel, ti as SelectScrollDownButton, ni as SelectScrollUpButton, ri as SelectSeparator, ii as SelectTrigger, ai as SelectValue, nr as StepSectionTitle, dr as StorefrontCartPanel, nt as StorefrontCartProvider, xe as TIME_OPTIONS, er as TestimonialsSection, Qn as Textarea, xn as WhatsAppFloatingButton, Mr as acceptContractSaleDocumentRequestSchema, Nr as acceptContractSaleDocumentResponseSchema, gr as accessories, h as accessoryProductSchema, Se as applyBookingParamsToSearch, fn as badgeVariants, ee as baseAssetSchema, te as baseAssetStatusSchema, ne as baseBookingItemSchema, re as baseBookingSchema, ie as baseBookingStateSchema, g as bikeProductSchema, _r as bikes, q as bookingCustomerInputSchema, J as bookingDeliveryOptionSchema, Y as bookingScheduleInputSchema, lt as buildDailyPriceRows, ut as buildPriceTierLabels, Ut as buildStorefrontAvailabilityKey, ht as buildStorefrontCartSummary, nn as buildStorefrontImageUrl, ze as buildStorefrontProductSlug, Be as buildVariantStorefrontProductId, St as buildWhatsAppHref, mn as buttonVariants, dt as calculateDailyPriceForQuantity, B as cancellationPolicySchema, V as cancellationPolicyTierSchema, X as cartItemInputSchema, at as cn, Ve as compareCatalogProducts, He as compareStorefrontAccessoryProducts, Ue as compareStorefrontBikeProducts, Pr as contractSaleDocumentAcceptanceInputSchema, vr as contractSaleDocumentAcceptanceLevelSchema, Fr as contractSaleDocumentAcceptanceRecordInputSchema, yr as contractSaleDocumentAcceptanceRecordSchema, br as contractSaleDocumentAcceptanceSchema, xr as contractSaleDocumentAddressSchema, Ir as contractSaleDocumentApiAcceptanceRecordSchema, Lr as contractSaleDocumentApiAcceptanceSchema, Rr as contractSaleDocumentApiSchema, zr as contractSaleDocumentApiSignatureSchema, Sr as contractSaleDocumentContactSchema, Cr as contractSaleDocumentKindSchema, wr as contractSaleDocumentLanguageCodeSchema, Tr as contractSaleDocumentLanguageSchema, Er as contractSaleDocumentLineItemSchema, Br as contractSaleDocumentReferenceSchema, Vr as contractSaleDocumentReferenceTypeSchema, Dr as contractSaleDocumentSchema, Hr as contractSaleDocumentSignatureInputSchema, Or as contractSaleDocumentSignatureSchema, Z as createBookingInputBaseSchema, Q as createBookingInputSchema, Ce as createBookingPeriodConfigFromBookingEngineConfiguration, we as createBookingPeriodConfigFromStorefrontConfiguration, e as createLocalizedStringEntry, a as currencyCodeSchema, o as currencyMinorUnitDigits, Wt as doesStorefrontAvailabilityDisplaySoldOut, Ur as downloadContractSaleDocumentPdfRequestSchema, _ as eBikeProductSchema, We as findStorefrontProduct, Ge as findStorefrontProductBySlug, ot as formatPriceMinor, yt as formatStorefrontPhoneDisplay, ft as formatStorefrontPriceMinor, U as fulfillmentModeSchema, st as getAvailabilityVariant, Te as getBookingDurationLabel, Ee as getBookingDurationMinutes, De as getBookingParamsFromSearch, Oe as getBookingSessionStorageKey, Ke as getCatalogProductBaseRateMinor, qe as getCatalogProductPaginationSort, Je as getCatalogProductSortFieldForPriceUnit, Wr as getContractSaleDocumentRequestSchema, Gr as getContractSaleDocumentResponseSchema, ke as getDefaultBookingParams, Ae as getDefaultBookingParamsForStorefrontConfiguration, pt as getLocalizedEntry, t as getLocalizedStringValue, mt as getLocalizedValue, ct as getMinDayPriceMinor, Gt as getStorefrontAvailabilityIssue, Kt as getStorefrontAvailabilityStatus, Ye as getStorefrontBaseDailyRateMinor, Xe as getStorefrontCheckoutProductId, Ze as getStorefrontRepresentedVariantId, v as isProductVariantCodeIdentifierKind, qt as isStorefrontAvailabilityInsufficient, k as isoDateSchema, Ln as loader, n as localizedStringArraySchema, r as localizedStringEntrySchema, i as localizedStringSchema, s as majorToMinor, c as minorToMajor, l as moneyMinorSchema, H as paymentPoliciesSchema, je as pickBookingSearchParams, d as priceSchema, f as priceUnitSchema, y as productKindSchema, b as productSchema, x as productStorefrontDisplayModeSchema, S as productVariantAttributeSchema, C as productVariantCodeSchema, w as productVariantIdentifierSchema, T as productVariantSchema, Jt as publicAvailabilityDisplayModeSchema, W as publicBookingEngineConfigurationSchema, G as publicCheckoutConfigurationSchema, K as publicCheckoutDynamicOptionsSchema, Me as readBookingSearchParamsFromSessionStorage, Ne as readBookingSearchParamsFromStorage, _t as requestSchema, Pe as resolveBookingSearchParams, Fe as resolveBookingSearchParamsFromSessionStorage, rt as resolveStorefrontCartItemProduct, bt as resolveStorefrontMapsHref, xt as resolveStorefrontPhoneContact, Ct as resolveStorefrontWhatsAppContact, wt as resolveStorefrontWhatsAppHref, vt as responseSchema, E as richTextJsonDocSchema, D as richTextSchema, O as richTextVersionSchema, A as shopConfigurationSchema, j as shopExtraTimeSlotRuleSchema, M as shopOpeningDayIndexSchema, N as shopOpeningDaySchema, P as shopOpeningHoursOverrideSchema, F as shopOpeningHoursPeriodSchema, I as shopOpeningSlotSchema, Zt as shouldBlockStorefrontUnavailableItem, u as signedMoneyMinorSchema, Qt as storefrontAvailabilityProductSchema, Yt as storefrontAvailabilityRequestSchema, Xt as storefrontAvailabilityResponseSchema, $t as storefrontAvailabilityScheduleSchema, ae as storefrontCheckoutModeSchema, Ot as storefrontCheckoutSubmitDeliveryRefinement, Dt as storefrontCheckoutSubmitItemSchema, Et as storefrontCheckoutSubmitRequestBaseSchema, kt as storefrontCheckoutSubmitRequestSchema, At as storefrontCheckoutSubmitResponseSchema, oe as storefrontConfigurationSchema, se as storefrontContentSchema, gn as storefrontEn, ce as storefrontFaqItemSchema, le as storefrontFaqSchema, _n as storefrontFr, ue as storefrontFulfillmentModeSchema, rn as storefrontImageRequestSchema, de as storefrontLocalizedRichTextSchema, fe as storefrontModalMessageSchema, pe as storefrontModulesSchema, Mt as storefrontProductsRequestSchema, Nt as storefrontProductsResponseSchema, Pt as storefrontPublicAccessoryProductSchema, en as storefrontPublicAvailabilityRecordSchema, Ft as storefrontPublicBikeAvailabilityStatusSchema, It as storefrontPublicBikeProductSchema, Lt as storefrontPublicProductDisplayModeSchema, Rt as storefrontPublicProductPriceSchema, zt as storefrontPublicProductVariantAttributeSchema, Bt as storefrontPublicProductVariantIdentifierSchema, Vt as storefrontPublicProductVariantSchema, me as storefrontReviewsModuleSchema, he as storefrontRichTextSchema, Kr as storefrontRoutes, ge as storefrontSettingsSchema, _e as storefrontShopSchema, ve as storefrontStatusSchema, ln as storefrontTimeSlotJourneySchema, cn as storefrontTimeSlotSchema, on as storefrontTimeSlotsRequestSchema, sn as storefrontTimeSlotsResponseSchema, ye as storefrontWorkspaceSchema, L as timeOfDaySchema, Qe as toStorefrontAccessoryProducts, $e as toStorefrontBikeProducts, et as toStorefrontBookingProducts, tt as toStorefrontBookingProductsCollections, En as useBookingPeriod, Zn as useFormField, Rn as useOptionalStorefront, zn as useStorefront, Bn as useStorefrontBookingProducts, it as useStorefrontCart, Vn as useStorefrontConfig, Hn as useStorefrontProducts, Un as useStorefrontWorkspaceLanguage, bn as useWhatsAppFloatingButton, $ as validateBookingDeliveryAddress, Ie as writeBookingSearchParamsToSessionStorage, Le as writeBookingSearchParamsToStorage };
|
package/dist/lib/cart.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { StorefrontProduct, StorefrontProductsCollections } from './products';
|
|
2
3
|
export type StorefrontCartItem = {
|
|
3
4
|
key: string;
|
|
4
5
|
kind: "bike" | "e-bike" | "accessory";
|
|
@@ -16,8 +17,10 @@ type StorefrontCartContextValue = {
|
|
|
16
17
|
removeItem: (key: string) => void;
|
|
17
18
|
clear: () => void;
|
|
18
19
|
};
|
|
19
|
-
export declare
|
|
20
|
+
export declare const resolveStorefrontCartItemProduct: (item: StorefrontCartItem, products: StorefrontProductsCollections) => StorefrontProduct | null;
|
|
21
|
+
export declare function StorefrontCartProvider({ storeSlug, products, children, }: {
|
|
20
22
|
storeSlug: string;
|
|
23
|
+
products: StorefrontProductsCollections;
|
|
21
24
|
children: ReactNode;
|
|
22
25
|
}): import("react/jsx-runtime").JSX.Element;
|
|
23
26
|
export declare const useStorefrontCart: () => StorefrontCartContextValue;
|
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;
|
|
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,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAA;IACrC,SAAS,EAAE,MAAM,CAAA;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAMD,KAAK,0BAA0B,GAAG;IAChC,KAAK,EAAE,kBAAkB,EAAE,CAAA;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,kBAAkB,EAAE,KAAK,CAAC,GAAG;QAAE,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;IAC3E,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACpD,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB,CAAA;AAWD,eAAO,MAAM,gCAAgC,GAC3C,MAAM,kBAAkB,EACxB,UAAU,6BAA6B,KACtC,iBAAiB,GAAG,IAQtB,CAAA;AA+CD,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,6BAA6B,CAAA;IACvC,QAAQ,EAAE,SAAS,CAAA;CACpB,2CAuGA;AAED,eAAO,MAAM,iBAAiB,kCAM7B,CAAA"}
|
package/dist/lib/cart.js
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { getStorefrontCheckoutProductId as e } from "./products.js";
|
|
2
|
+
import { createContext as t, useCallback as n, useContext as r, useEffect as i, useMemo as a, useState as o } from "react";
|
|
3
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
3
4
|
//#region src/lib/cart.tsx
|
|
4
|
-
var
|
|
5
|
+
var c = t(void 0), l = "loczer.storefront.cart.v5", u = (e) => {
|
|
5
6
|
let t = e.productVariantId ? `variant:${e.productVariantId}` : "product";
|
|
6
7
|
return `${e.kind}:${e.productId}:${t}`.toLowerCase();
|
|
7
|
-
},
|
|
8
|
+
}, d = (t, n) => [...n.bikes, ...n.accessories].find((n) => {
|
|
9
|
+
let r = n.id === t.productId || e(n) === t.productId, i = !t.productVariantId || n.productVariants?.some((e) => e.id === t.productVariantId);
|
|
10
|
+
return r && n.kind === t.kind && i;
|
|
11
|
+
}) ?? null, f = (e, t) => {
|
|
12
|
+
let n = e.filter((e) => d(e, t) !== null);
|
|
13
|
+
return n.length === e.length ? e : n;
|
|
14
|
+
}, p = (e) => {
|
|
8
15
|
if (!e) return { items: [] };
|
|
9
16
|
try {
|
|
10
17
|
let t = JSON.parse(e);
|
|
@@ -18,7 +25,7 @@ var s = e(void 0), c = "loczer.storefront.cart.v5", l = (e) => {
|
|
|
18
25
|
quantity: a
|
|
19
26
|
};
|
|
20
27
|
return {
|
|
21
|
-
key:
|
|
28
|
+
key: u(o),
|
|
22
29
|
...o
|
|
23
30
|
};
|
|
24
31
|
}).filter((e) => e !== null) };
|
|
@@ -26,22 +33,36 @@ var s = e(void 0), c = "loczer.storefront.cart.v5", l = (e) => {
|
|
|
26
33
|
return { items: [] };
|
|
27
34
|
}
|
|
28
35
|
};
|
|
29
|
-
function
|
|
30
|
-
let d = `${
|
|
31
|
-
|
|
36
|
+
function m({ storeSlug: e, products: t, children: r }) {
|
|
37
|
+
let d = `${l}.${e || "unknown"}`, [m, h] = o(!1), [g, _] = o({ items: [] }), v = t.bikes, y = t.accessories;
|
|
38
|
+
i(() => {
|
|
32
39
|
if (typeof window > "u") return;
|
|
33
|
-
let e =
|
|
34
|
-
|
|
35
|
-
}, [d]),
|
|
36
|
-
typeof window > "u" ||
|
|
40
|
+
let e = p(window.localStorage.getItem(d));
|
|
41
|
+
_((t) => !m && t.items.length > 0 ? t : e), h(!0);
|
|
42
|
+
}, [d]), i(() => {
|
|
43
|
+
typeof window > "u" || m && window.localStorage.setItem(d, JSON.stringify(g));
|
|
37
44
|
}, [
|
|
38
|
-
f,
|
|
39
45
|
m,
|
|
46
|
+
g,
|
|
40
47
|
d
|
|
48
|
+
]), i(() => {
|
|
49
|
+
if (!m) return;
|
|
50
|
+
let e = {
|
|
51
|
+
bikes: v,
|
|
52
|
+
accessories: y
|
|
53
|
+
};
|
|
54
|
+
_((t) => {
|
|
55
|
+
let n = f(t.items, e);
|
|
56
|
+
return n === t.items ? t : { items: n };
|
|
57
|
+
});
|
|
58
|
+
}, [
|
|
59
|
+
y,
|
|
60
|
+
v,
|
|
61
|
+
m
|
|
41
62
|
]);
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
let n = e.key?.trim() ? e.key.trim().toLowerCase() :
|
|
63
|
+
let b = n((e) => {
|
|
64
|
+
_((t) => {
|
|
65
|
+
let n = e.key?.trim() ? e.key.trim().toLowerCase() : u(e), r = Math.max(1, Math.floor(e.quantity));
|
|
45
66
|
return t.items.find((e) => e.key === n) ? { items: t.items.map((e) => e.key === n ? {
|
|
46
67
|
...e,
|
|
47
68
|
quantity: e.quantity + r
|
|
@@ -53,42 +74,45 @@ function d({ storeSlug: e, children: n }) {
|
|
|
53
74
|
quantity: r
|
|
54
75
|
}] };
|
|
55
76
|
});
|
|
56
|
-
}, []),
|
|
57
|
-
|
|
77
|
+
}, []), x = n((e, t) => {
|
|
78
|
+
_((n) => {
|
|
58
79
|
let r = Math.max(0, Math.floor(t));
|
|
59
80
|
return r <= 0 ? { items: n.items.filter((t) => t.key !== e) } : { items: n.items.map((t) => t.key === e ? {
|
|
60
81
|
...t,
|
|
61
82
|
quantity: r
|
|
62
83
|
} : t) };
|
|
63
84
|
});
|
|
64
|
-
}, []),
|
|
65
|
-
|
|
66
|
-
}, []),
|
|
67
|
-
|
|
68
|
-
}, []),
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
85
|
+
}, []), S = n((e) => {
|
|
86
|
+
_((t) => ({ items: t.items.filter((t) => t.key !== e) }));
|
|
87
|
+
}, []), C = n(() => {
|
|
88
|
+
_({ items: [] });
|
|
89
|
+
}, []), w = f(g.items, {
|
|
90
|
+
bikes: v,
|
|
91
|
+
accessories: y
|
|
92
|
+
}), T = w.reduce((e, t) => e + t.quantity, 0), E = a(() => ({
|
|
93
|
+
items: w,
|
|
94
|
+
itemCount: T,
|
|
95
|
+
addItem: b,
|
|
96
|
+
setQuantity: x,
|
|
97
|
+
removeItem: S,
|
|
98
|
+
clear: C
|
|
75
99
|
}), [
|
|
76
|
-
g,
|
|
77
|
-
y,
|
|
78
100
|
b,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
101
|
+
C,
|
|
102
|
+
T,
|
|
103
|
+
w,
|
|
104
|
+
S,
|
|
105
|
+
x
|
|
82
106
|
]);
|
|
83
|
-
return /* @__PURE__ */
|
|
84
|
-
value:
|
|
85
|
-
children:
|
|
107
|
+
return /* @__PURE__ */ s(c.Provider, {
|
|
108
|
+
value: E,
|
|
109
|
+
children: r
|
|
86
110
|
});
|
|
87
111
|
}
|
|
88
|
-
var
|
|
89
|
-
let e =
|
|
112
|
+
var h = () => {
|
|
113
|
+
let e = r(c);
|
|
90
114
|
if (!e) throw Error("useStorefrontCart must be used within StorefrontCartProvider");
|
|
91
115
|
return e;
|
|
92
116
|
};
|
|
93
117
|
//#endregion
|
|
94
|
-
export {
|
|
118
|
+
export { m as StorefrontCartProvider, d as resolveStorefrontCartItemProduct, h as useStorefrontCart };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cartSummary.d.ts","sourceRoot":"","sources":["../../src/lib/cartSummary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"cartSummary.d.ts","sourceRoot":"","sources":["../../src/lib/cartSummary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,kBAAkB,EAAE,MAAM,QAAQ,CAAA;AAClF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAA;AAE3E,OAAO,EAAkC,KAAK,6BAA6B,EAAE,MAAM,YAAY,CAAA;AAK/F,MAAM,MAAM,yBAAyB,GAAG,kBAAkB,GAAG;IAC3D,iBAAiB,EAAE,MAAM,CAAA;IACzB,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,oBAAoB,EAAE,OAAO,CAAA;IAC7B,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,kBAAkB,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,cAAc,CAAA;IAC/D,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,iBAAiB,CAAC,EAAE,2BAA2B,CAAA;CAChD,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,yBAAyB,EAAE,CAAA;IAClC,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,0BAA0B,GAAI,QAAQ;IACjD,KAAK,EAAE,kBAAkB,EAAE,CAAA;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,EAAE,6BAA6B,CAAA;IACvC,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,KAAG,qBAoEH,CAAA"}
|
package/dist/lib/cartSummary.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { getProductVariantAttributeValue as e, getProductVariantDisplay as t } from "./productVariants.js";
|
|
2
|
-
import {
|
|
2
|
+
import { getStorefrontCheckoutProductId as n } from "./products.js";
|
|
3
|
+
import { resolveStorefrontCartItemProduct as r } from "./cart.js";
|
|
3
4
|
import { calculateDailyPriceForQuantity as i } from "./pricing.js";
|
|
4
5
|
import { getLocalizedValue as a } from "../localization.js";
|
|
5
6
|
//#region src/lib/cartSummary.ts
|
|
6
7
|
var o = (o) => {
|
|
7
8
|
let s = typeof o.estimatedDays == "number" && Number.isFinite(o.estimatedDays) && o.estimatedDays > 0 ? Math.max(1, Math.floor(o.estimatedDays)) : void 0, c = o.items.map((c) => {
|
|
8
|
-
let l =
|
|
9
|
+
let l = r(c, o.products);
|
|
9
10
|
if (!l) return null;
|
|
10
11
|
let u = c.productVariantId ? l.productVariants?.find((e) => e.id === c.productVariantId) : void 0;
|
|
11
12
|
if (c.productVariantId && !u) return null;
|
|
12
13
|
let d = u ? t(u) : void 0, f = l.prices ?? [], p = i(f, 1) ?? 0, m = a(l.name, o.language, o.fallbackLanguage), h = l.storefrontDisplayMode === "variants_as_products" && d?.label ? `${m} ${d.label}`.trim() : m, g = a(l.warning, o.language, o.fallbackLanguage).trim(), _ = u ? !!e(u, "size") : !1, v = typeof s == "number" ? i(f, s) ?? p * s : void 0, y = typeof v == "number" ? v * c.quantity : void 0;
|
|
13
14
|
return {
|
|
14
15
|
...c,
|
|
15
|
-
checkoutProductId:
|
|
16
|
+
checkoutProductId: n(l),
|
|
16
17
|
productName: h,
|
|
17
18
|
...g ? { productWarning: g } : {},
|
|
18
19
|
productVariantLabel: d?.label,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { productKindSchema as e } from "../chunks/booking-engine/dist/models/Product.shared-
|
|
1
|
+
import { productKindSchema as e } from "../chunks/booking-engine/dist/models/Product.shared-CTuk4fiR.js";
|
|
2
2
|
import { bookingScheduleInputSchema as t } from "../chunks/booking-engine/dist/schemas/cart-inputs-9vM8GCrc.js";
|
|
3
|
-
import "../chunks/booking-engine/dist/schemas-
|
|
3
|
+
import "../chunks/booking-engine/dist/schemas-34QQv0EH.js";
|
|
4
4
|
import { storefrontFulfillmentModeSchema as n } from "../storefrontSchemas.js";
|
|
5
5
|
import { z as r } from "zod";
|
|
6
6
|
//#region src/lib/checkoutSubmit.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"productVariants.d.ts","sourceRoot":"","sources":["../../src/lib/productVariants.ts"],"names":[],"mappings":"AAKA,KAAK,kBAAkB,GAAG;IACxB,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAcD,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAW5G;
|
|
1
|
+
{"version":3,"file":"productVariants.d.ts","sourceRoot":"","sources":["../../src/lib/productVariants.ts"],"names":[],"mappings":"AAKA,KAAK,kBAAkB,GAAG;IACxB,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAcD,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAW5G;AAiDD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,kBAAkB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAiB7G;AAED,eAAO,MAAM,kCAAkC,iCAA2B,CAAA"}
|
|
@@ -28,19 +28,30 @@ function o(a) {
|
|
|
28
28
|
s.push(i);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
return [...o, ...s]
|
|
31
|
+
return [...o, ...s];
|
|
32
32
|
}
|
|
33
|
-
function s(
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
function s(e) {
|
|
34
|
+
return e.trim().replace(/\s+/g, " ").toLowerCase();
|
|
35
|
+
}
|
|
36
|
+
function c(e, t) {
|
|
37
|
+
if (!e || t.length === 0) return !1;
|
|
38
|
+
let n = e.split(/\s+\/\s+/).map((e) => {
|
|
39
|
+
let t = e.indexOf(":");
|
|
40
|
+
return s(t >= 0 ? e.slice(t + 1) : e);
|
|
41
|
+
}).filter((e) => e.length > 0).sort(), r = t.map(s).sort();
|
|
42
|
+
return n.length === r.length && n.every((e, t) => e === r[t]);
|
|
43
|
+
}
|
|
44
|
+
function l(t) {
|
|
45
|
+
let n = e(t.id), r = e(t.computedName), i = o(t), a = [
|
|
46
|
+
i.join(" · "),
|
|
36
47
|
r,
|
|
37
48
|
n
|
|
38
|
-
].find((e) => e.length > 0) ?? n,
|
|
49
|
+
].find((e) => e.length > 0) ?? n, s = r.length > 0 && r !== a && !c(r, i) ? r : "";
|
|
39
50
|
return {
|
|
40
|
-
label:
|
|
41
|
-
description:
|
|
51
|
+
label: a || n,
|
|
52
|
+
description: s || void 0
|
|
42
53
|
};
|
|
43
54
|
}
|
|
44
|
-
var
|
|
55
|
+
var u = l;
|
|
45
56
|
//#endregion
|
|
46
|
-
export { a as getProductVariantAttributeValue,
|
|
57
|
+
export { a as getProductVariantAttributeValue, l as getProductVariantDisplay, u as getStorefrontProductVariantDisplay };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { StorefrontShop } from '../storefrontSchemas';
|
|
2
|
+
type StorefrontAddressSource = Pick<StorefrontShop, "address" | "city" | "country">;
|
|
3
|
+
export declare const formatStorefrontAddressTagline: (shop: StorefrontAddressSource | undefined) => string;
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=storefrontAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storefrontAddress.d.ts","sourceRoot":"","sources":["../../src/lib/storefrontAddress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAG1D,KAAK,uBAAuB,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC,CAAA;AAkCnF,eAAO,MAAM,8BAA8B,GAAI,MAAM,uBAAuB,GAAG,SAAS,KAAG,MAkC1F,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/lib/storefrontAddress.ts
|
|
2
|
+
var e = /^(?:[A-Z]{1,3}[-\s]*)?\d{4,10}(?:[-\s]+\d{3,4})?\s+/i, t = /^(\d+[A-Za-z]?(?:[-/]\d+[A-Za-z]?)?(?:\s+(?:bis|ter|quater))?)\s+(.+)$/i, n = (e) => e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, " ").trim(), r = (e) => {
|
|
3
|
+
let t = /* @__PURE__ */ new Set(), r = n(e);
|
|
4
|
+
r && t.add(r);
|
|
5
|
+
let i = e.trim().toUpperCase();
|
|
6
|
+
if (!/^[A-Z]{2}$/.test(i)) return t;
|
|
7
|
+
for (let e of ["en", "fr"]) {
|
|
8
|
+
let r = new Intl.DisplayNames([e], { type: "region" }).of(i);
|
|
9
|
+
r && t.add(n(r));
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
}, i = (e, t) => {
|
|
13
|
+
let r = n(t);
|
|
14
|
+
!r || e.some((e) => n(e) === r) || e.push(t);
|
|
15
|
+
}, a = (a) => {
|
|
16
|
+
let o = a?.address?.trim() ?? "";
|
|
17
|
+
if (!o) return "";
|
|
18
|
+
let s = r(a?.country?.trim() ?? ""), c = o.split(/[,\n]/).map((e) => e.trim()).filter(Boolean), l = c.findIndex((t) => e.test(t)), u = (l >= 0 ? c.slice(0, l + 1) : c).map((t) => t.replace(e, "").trim()).filter((e) => e.length > 0 && !s.has(n(e))), d = [], f = u.shift() ?? "", p = f.match(t);
|
|
19
|
+
p ? (i(d, p[1] ?? ""), i(d, p[2] ?? "")) : i(d, f);
|
|
20
|
+
for (let e of u) i(d, e);
|
|
21
|
+
return i(d, a?.city?.trim() ?? ""), d.join(", ");
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { a as formatStorefrontAddressTagline };
|
|
@@ -37,22 +37,22 @@ export declare const requestSchema: z.ZodObject<{
|
|
|
37
37
|
export type RequestPayload = z.infer<typeof requestSchema>;
|
|
38
38
|
export type StorefrontAvailabilityRequestPayload = RequestPayload;
|
|
39
39
|
export declare const publicAvailabilityDisplayModeSchema: z.ZodEnum<{
|
|
40
|
-
soldOutOnly: "soldOutOnly";
|
|
41
|
-
soldOutAndFewRemaining: "soldOutAndFewRemaining";
|
|
42
40
|
fewRemaining: "fewRemaining";
|
|
43
41
|
fewRemainingCounts: "fewRemainingCounts";
|
|
44
42
|
remainingCounts: "remainingCounts";
|
|
43
|
+
soldOutAndFewRemaining: "soldOutAndFewRemaining";
|
|
44
|
+
soldOutOnly: "soldOutOnly";
|
|
45
45
|
}>;
|
|
46
46
|
export type PublicAvailabilityDisplayMode = z.infer<typeof publicAvailabilityDisplayModeSchema>;
|
|
47
47
|
export declare const storefrontPublicAvailabilityRecordSchema: z.ZodObject<{
|
|
48
48
|
productId: z.ZodString;
|
|
49
49
|
productVariantId: z.ZodOptional<z.ZodString>;
|
|
50
50
|
displayMode: z.ZodEnum<{
|
|
51
|
-
soldOutOnly: "soldOutOnly";
|
|
52
|
-
soldOutAndFewRemaining: "soldOutAndFewRemaining";
|
|
53
51
|
fewRemaining: "fewRemaining";
|
|
54
52
|
fewRemainingCounts: "fewRemainingCounts";
|
|
55
53
|
remainingCounts: "remainingCounts";
|
|
54
|
+
soldOutAndFewRemaining: "soldOutAndFewRemaining";
|
|
55
|
+
soldOutOnly: "soldOutOnly";
|
|
56
56
|
}>;
|
|
57
57
|
soldOut: z.ZodBoolean;
|
|
58
58
|
unlimited: z.ZodBoolean;
|
|
@@ -69,11 +69,11 @@ export declare const responseSchema: z.ZodObject<{
|
|
|
69
69
|
productId: z.ZodString;
|
|
70
70
|
productVariantId: z.ZodOptional<z.ZodString>;
|
|
71
71
|
displayMode: z.ZodEnum<{
|
|
72
|
-
soldOutOnly: "soldOutOnly";
|
|
73
|
-
soldOutAndFewRemaining: "soldOutAndFewRemaining";
|
|
74
72
|
fewRemaining: "fewRemaining";
|
|
75
73
|
fewRemainingCounts: "fewRemainingCounts";
|
|
76
74
|
remainingCounts: "remainingCounts";
|
|
75
|
+
soldOutAndFewRemaining: "soldOutAndFewRemaining";
|
|
76
|
+
soldOutOnly: "soldOutOnly";
|
|
77
77
|
}>;
|
|
78
78
|
soldOut: z.ZodBoolean;
|
|
79
79
|
unlimited: z.ZodBoolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StorefrontShop } from '../storefrontSchemas';
|
|
2
|
+
type StorefrontContactShop = Pick<StorefrontShop, "address" | "contactPhone1" | "contactPhone2" | "country" | "googleMapsLink">;
|
|
3
|
+
export declare const formatStorefrontPhoneDisplay: (phone: string, country?: string) => string;
|
|
4
|
+
export declare const resolveStorefrontPhoneContact: (shop: StorefrontContactShop | undefined) => {
|
|
5
|
+
href: string;
|
|
6
|
+
phoneDisplay: string;
|
|
7
|
+
} | undefined;
|
|
8
|
+
export declare const resolveStorefrontMapsHref: (shop: StorefrontContactShop | undefined) => string | undefined;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=storefrontContact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storefrontContact.d.ts","sourceRoot":"","sources":["../../src/lib/storefrontContact.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAG1D,KAAK,qBAAqB,GAAG,IAAI,CAC/B,cAAc,EACd,SAAS,GAAG,eAAe,GAAG,eAAe,GAAG,SAAS,GAAG,gBAAgB,CAC7E,CAAA;AASD,eAAO,MAAM,4BAA4B,GAAI,OAAO,MAAM,EAAE,UAAU,MAAM,KAAG,MAgB9E,CAAA;AAED,eAAO,MAAM,6BAA6B,GACxC,MAAM,qBAAqB,GAAG,SAAS,KACtC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAAG,SAQ3C,CAAA;AAED,eAAO,MAAM,yBAAyB,GAAI,MAAM,qBAAqB,GAAG,SAAS,KAAG,MAAM,GAAG,SAQ5F,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/lib/storefrontContact.ts
|
|
2
|
+
var e = (e) => e.replace(/\D/g, ""), t = (e) => e.match(/.{1,2}/g)?.join(" ") ?? e, n = (n, r) => {
|
|
3
|
+
let i = n.trim(), a = e(i);
|
|
4
|
+
if (!a) return i;
|
|
5
|
+
let o = r?.trim().toUpperCase() ?? "";
|
|
6
|
+
if ((o === "FR" || a.startsWith("33")) && a.startsWith("33") && a.length === 11) {
|
|
7
|
+
let e = a.slice(2);
|
|
8
|
+
return `+33 (0)${e.slice(0, 1)} ${t(e.slice(1))}`;
|
|
9
|
+
}
|
|
10
|
+
return (o === "US" || o === "CA" || a.startsWith("1")) && a.startsWith("1") && a.length === 11 ? `+1 (${a.slice(1, 4)}) ${a.slice(4, 7)}-${a.slice(7)}` : i;
|
|
11
|
+
}, r = (e) => {
|
|
12
|
+
let t = e?.contactPhone1?.trim() || e?.contactPhone2?.trim() || "";
|
|
13
|
+
if (t) return {
|
|
14
|
+
href: `tel:${t}`,
|
|
15
|
+
phoneDisplay: n(t, e?.country)
|
|
16
|
+
};
|
|
17
|
+
}, i = (e) => {
|
|
18
|
+
let t = e?.googleMapsLink?.trim() ?? "";
|
|
19
|
+
if (t) return t;
|
|
20
|
+
let n = e?.address?.trim() ?? "";
|
|
21
|
+
return n ? `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(n)}` : void 0;
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { n as formatStorefrontPhoneDisplay, i as resolveStorefrontMapsHref, r as resolveStorefrontPhoneContact };
|