@fayz-ai/storefront 0.11.0 → 0.12.1
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/app/router.d.ts.map +1 -1
- package/dist/blocks/page-data.d.ts +6 -0
- package/dist/blocks/page-data.d.ts.map +1 -1
- package/dist/{chunk-SX3J3QIT.js → chunk-OYKFJ6FG.js} +28 -29
- package/dist/chunk-OYKFJ6FG.js.map +1 -0
- package/dist/components/cart/CartDrawer.d.ts.map +1 -1
- package/dist/components/checkout/CheckoutPayment.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/lib/motion.d.ts.map +1 -1
- package/dist/render.js +1 -1
- package/dist/views/CheckoutPage.d.ts.map +1 -1
- package/package.json +14 -13
- package/dist/chunk-SX3J3QIT.js.map +0 -1
package/dist/app/router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/app/router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAqE,MAAM,OAAO,CAAA;AACzF,OAAO,EAA6C,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAwB7F,eAAO,MAAM,wBAAwB,sCAAgC,CAAA;AAuBrE,wBAAgB,gBAAgB,IAAI,aAAa,
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/app/router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAqE,MAAM,OAAO,CAAA;AACzF,OAAO,EAA6C,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAwB7F,eAAO,MAAM,wBAAwB,sCAAgC,CAAA;AAuBrE,wBAAgB,gBAAgB,IAAI,aAAa,CAehD;AAED,iEAAiE;AACjE,wBAAgB,YAAY,IAAI,MAAM,CAOrC;AAED;iEACiE;AACjE,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAI3D;AAED,wBAAgB,WAAW,IAAI,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAGlD;AAED,iFAAiF;AACjF,eAAO,MAAM,WAAW,qBAAe,CAAA;AAEvC,+EAA+E;AAC/E,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAE3C;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,aAAa,GAAG,aAAa,CAOvG;AAED,gGAAgG;AAChG,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAatF;AAED,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC5F,EAAE,EAAE,MAAM,CAAA;CACX;AAED;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAG5C,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC;;gBAgBhE"}
|
|
@@ -43,6 +43,12 @@ export interface PageDataScopeProps {
|
|
|
43
43
|
* seam (L4): `resolvePageData(collectDataNeeds(nodes))` ahead of render,
|
|
44
44
|
* then hand the results in. Keys already 'ready' here are never re-fetched;
|
|
45
45
|
* anything missing resolves client-side as usual.
|
|
46
|
+
*
|
|
47
|
+
* Live, not mount-only: a host whose shell outlives the page (every real
|
|
48
|
+
* one — the shell must not remount on navigation) hands in a NEW object
|
|
49
|
+
* for each page it loads, and a child scope mounting in that same commit
|
|
50
|
+
* sees it. Pass a stable reference per page (the loader's result), not a
|
|
51
|
+
* literal built in render.
|
|
46
52
|
*/
|
|
47
53
|
initial?: Record<string, PageDataEntry>;
|
|
48
54
|
children: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-data.d.ts","sourceRoot":"","sources":["../../src/blocks/page-data.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAA;AAUtF,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAqB7D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;AAEnE,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;IACrC,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,qDAAqD;AACrD,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAChC;AAID;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAC1E,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASzB;AASD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,SAAS,EAAE,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C,EACzB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GACrC,eAAe,CAAC,CAAC,CAAC,CA2CpB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,IAAI,EAAE,SAAS,GAAG,SAAS,EAC3B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAC5D,eAAe,CAAC,CAAC,CAAC,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAiBzC;AAID;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,4BAiB9F"}
|
|
@@ -8,7 +8,7 @@ import React4, { createContext, useContext, useEffect, useRef, useState, useSync
|
|
|
8
8
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
9
9
|
import { ChevronLeft, ChevronRight, ShoppingBag, X, Minus, Plus, Send, MessageCircle, Mail, Truck, RefreshCcw, ShieldCheck, ChevronDown, Check, Search, Trash2, Lock, CreditCard, Star, MapPin, Phone, User, UserCircle, Package, LogOut, Menu, QrCode, Copy, XCircle, RotateCcw, Clock, PackageCheck, Info, AlertCircle } from 'lucide-react';
|
|
10
10
|
import { getLucideIcon } from '@fayz-ai/ui/icons';
|
|
11
|
-
import { validateDiscount, documentDigits, formatDocument, isValidDocument } from '@fayz-ai/shop';
|
|
11
|
+
import { validateDiscount, documentDigits, isChargeableProvider, formatDocument, isValidDocument } from '@fayz-ai/shop';
|
|
12
12
|
import { storefrontDiscountToPromotion, previewCouponPercent, discountToPromotion, PROMOTION_TYPES, PROMOTION_STATUSES, APPLICATION_METHOD_TYPES, APPLICATION_METHOD_TARGET_TYPES, APPLICATION_METHOD_ALLOCATIONS, hasRuleAttribute, listRuleAttributeKeys, RULE_OPERATORS, resolveRuleAttribute } from '@fayz-ai/shop/rules';
|
|
13
13
|
import { createMockShopProvider } from '@fayz-ai/shop/mock';
|
|
14
14
|
|
|
@@ -872,8 +872,8 @@ function useRouterAdapter() {
|
|
|
872
872
|
const injected = useContext(RouterAdapterContext);
|
|
873
873
|
const adapter = injected ?? fallbackAdapter();
|
|
874
874
|
useEffect(() => {
|
|
875
|
-
_activeAdapter =
|
|
876
|
-
}, [
|
|
875
|
+
if (injected) _activeAdapter = injected;
|
|
876
|
+
}, [injected]);
|
|
877
877
|
return adapter;
|
|
878
878
|
}
|
|
879
879
|
function useRoutePath() {
|
|
@@ -1539,8 +1539,8 @@ function PageDataScope({ nodes, params, initial: initial2, children }) {
|
|
|
1539
1539
|
};
|
|
1540
1540
|
}, [signature]);
|
|
1541
1541
|
const value = useMemo(
|
|
1542
|
-
() => ({ entries: { ...parent?.entries, ...entries }, params: routeParams }),
|
|
1543
|
-
[parent, entries, routeParams]
|
|
1542
|
+
() => ({ entries: { ...parent?.entries, ...entries, ...initial2 }, params: routeParams }),
|
|
1543
|
+
[parent, entries, initial2, routeParams]
|
|
1544
1544
|
);
|
|
1545
1545
|
return /* @__PURE__ */ jsx(PageDataContext.Provider, { value, children });
|
|
1546
1546
|
}
|
|
@@ -6973,7 +6973,6 @@ function CartDrawer() {
|
|
|
6973
6973
|
const freeAbove = config.shipping.freeAbove;
|
|
6974
6974
|
const missingForFree = freeAbove != null && subtotal < freeAbove ? freeAbove - subtotal : 0;
|
|
6975
6975
|
const progress = freeAbove != null ? Math.min(100, subtotal / freeAbove * 100) : 0;
|
|
6976
|
-
const wide = cart.lines.length >= 3;
|
|
6977
6976
|
return /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-50", children: [
|
|
6978
6977
|
/* @__PURE__ */ jsx(
|
|
6979
6978
|
"div",
|
|
@@ -6989,14 +6988,9 @@ function CartDrawer() {
|
|
|
6989
6988
|
"data-testid": TID.cartDrawer,
|
|
6990
6989
|
role: "dialog",
|
|
6991
6990
|
"aria-label": "Carrinho",
|
|
6992
|
-
className:
|
|
6993
|
-
// At one or two lines the left column was a 700px void with a card
|
|
6994
|
-
// floating at the top — the panel read as broken, not as spacious.
|
|
6995
|
-
// Below the threshold the drawer stays the narrow single column every
|
|
6996
|
-
// store uses, which is also the shape a cart of one item deserves.
|
|
6997
|
-
wide ? "lg:max-w-3xl lg:grid lg:grid-cols-[55%_45%] lg:grid-rows-[auto_auto_1fr]" : ""}`,
|
|
6991
|
+
className: "absolute right-0 top-0 flex h-full w-full max-w-md animate-slide-in-from-right flex-col bg-background shadow-2xl",
|
|
6998
6992
|
children: [
|
|
6999
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
6993
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border-b px-5 py-4", children: [
|
|
7000
6994
|
/* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold", children: "Carrinho" }),
|
|
7001
6995
|
/* @__PURE__ */ jsx(
|
|
7002
6996
|
"button",
|
|
@@ -7010,7 +7004,7 @@ function CartDrawer() {
|
|
|
7010
7004
|
)
|
|
7011
7005
|
] }),
|
|
7012
7006
|
cart.lines.length === 0 ? /* @__PURE__ */ jsx("div", { "data-testid": TID.cartEmpty, className: "flex flex-1 items-center justify-center p-8 text-center text-muted-foreground", children: "Seu carrinho est\xE1 vazio." }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7013
|
-
freeAbove != null && /* @__PURE__ */ jsxs("div", { "data-testid": TID.shippingProgress, className:
|
|
7007
|
+
freeAbove != null && /* @__PURE__ */ jsxs("div", { "data-testid": TID.shippingProgress, className: "border-b bg-muted/40 px-5 py-3", children: [
|
|
7014
7008
|
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium", children: missingForFree > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7015
7009
|
"Faltam ",
|
|
7016
7010
|
/* @__PURE__ */ jsx("strong", { children: money(missingForFree) }),
|
|
@@ -7032,7 +7026,7 @@ function CartDrawer() {
|
|
|
7032
7026
|
"div",
|
|
7033
7027
|
{
|
|
7034
7028
|
"data-testid": TID.cartLinesList,
|
|
7035
|
-
className:
|
|
7029
|
+
className: "flex-1 space-y-4 overflow-y-auto py-4 pl-5 pr-6",
|
|
7036
7030
|
style: { scrollbarGutter: "stable" },
|
|
7037
7031
|
children: [
|
|
7038
7032
|
/* @__PURE__ */ jsx(Slot, { area: "cart", name: "beforeLines", context: cartSlotContext }),
|
|
@@ -7096,7 +7090,7 @@ function CartDrawer() {
|
|
|
7096
7090
|
"div",
|
|
7097
7091
|
{
|
|
7098
7092
|
"data-testid": TID.cartFooter,
|
|
7099
|
-
className:
|
|
7093
|
+
className: "space-y-3 border-t px-5 py-4",
|
|
7100
7094
|
children: [
|
|
7101
7095
|
config.features.discounts && /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
7102
7096
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
@@ -7583,14 +7577,15 @@ function CheckoutPayment({ input, onPaid, onBack, money, onUnavailable }) {
|
|
|
7583
7577
|
const [charge, setCharge] = useState(null);
|
|
7584
7578
|
const [total, setTotal] = useState(null);
|
|
7585
7579
|
const [sessionId, setSessionId] = useState(null);
|
|
7580
|
+
const [provider, setProvider] = useState(null);
|
|
7586
7581
|
const [error, setError] = useState(null);
|
|
7587
7582
|
const [copied, setCopied] = useState(false);
|
|
7588
7583
|
const [checking, setChecking] = useState(false);
|
|
7589
7584
|
const settled = useRef(false);
|
|
7590
7585
|
const opened = useRef(false);
|
|
7591
7586
|
const open = useCallback(async () => {
|
|
7592
|
-
const
|
|
7593
|
-
if (!
|
|
7587
|
+
const shop = getShopProvider();
|
|
7588
|
+
if (!shop.openCheckoutSession) {
|
|
7594
7589
|
setError("Esta loja ainda n\xE3o recebe pagamento online.");
|
|
7595
7590
|
setPhase("error");
|
|
7596
7591
|
return;
|
|
@@ -7598,8 +7593,9 @@ function CheckoutPayment({ input, onPaid, onBack, money, onUnavailable }) {
|
|
|
7598
7593
|
setPhase("opening");
|
|
7599
7594
|
setError(null);
|
|
7600
7595
|
try {
|
|
7601
|
-
const session = await
|
|
7596
|
+
const session = await shop.openCheckoutSession(input);
|
|
7602
7597
|
setSessionId(session.sessionId);
|
|
7598
|
+
setProvider(session.provider ?? input.provider ?? null);
|
|
7603
7599
|
setTotal(session.total);
|
|
7604
7600
|
setCharge(session.charge);
|
|
7605
7601
|
setPhase(session.charge ? "waiting" : "error");
|
|
@@ -7620,10 +7616,10 @@ function CheckoutPayment({ input, onPaid, onBack, money, onUnavailable }) {
|
|
|
7620
7616
|
}, [open]);
|
|
7621
7617
|
const check = useCallback(async () => {
|
|
7622
7618
|
if (!sessionId || settled.current) return false;
|
|
7623
|
-
const
|
|
7624
|
-
if (!
|
|
7619
|
+
const shop = getShopProvider();
|
|
7620
|
+
if (!shop.settleCheckoutSession) return false;
|
|
7625
7621
|
try {
|
|
7626
|
-
const result = await
|
|
7622
|
+
const result = await shop.settleCheckoutSession(sessionId, provider);
|
|
7627
7623
|
if (settled.current) return false;
|
|
7628
7624
|
if (result.state === "paid" && result.orderId) {
|
|
7629
7625
|
settled.current = true;
|
|
@@ -7641,7 +7637,7 @@ function CheckoutPayment({ input, onPaid, onBack, money, onUnavailable }) {
|
|
|
7641
7637
|
} catch {
|
|
7642
7638
|
return false;
|
|
7643
7639
|
}
|
|
7644
|
-
}, [sessionId, onPaid]);
|
|
7640
|
+
}, [sessionId, provider, onPaid]);
|
|
7645
7641
|
useEffect(() => {
|
|
7646
7642
|
if (phase !== "waiting" || !sessionId) return;
|
|
7647
7643
|
let stopped = false;
|
|
@@ -7837,7 +7833,6 @@ function SuccessMark() {
|
|
|
7837
7833
|
) })
|
|
7838
7834
|
] });
|
|
7839
7835
|
}
|
|
7840
|
-
var CHARGEABLE_PROVIDERS = ["abacatepay"];
|
|
7841
7836
|
var PAYMENT_LABELS = {
|
|
7842
7837
|
pix: { label: "Pix", hint: "Voc\xEA recebe a chave para pagar ap\xF3s confirmar o pedido" },
|
|
7843
7838
|
credit_card: { label: "Cart\xE3o de cr\xE9dito", hint: "Maquininha na entrega" },
|
|
@@ -7943,11 +7938,15 @@ function CheckoutPage() {
|
|
|
7943
7938
|
document: documentDigits(form.document) || void 0
|
|
7944
7939
|
},
|
|
7945
7940
|
discountCode: cart.discountCode ?? null,
|
|
7946
|
-
paymentMethod
|
|
7941
|
+
paymentMethod,
|
|
7942
|
+
// Qual adquirente cobra. Sai dos ajustes da loja e não de uma escolha do
|
|
7943
|
+
// comprador — a função reconfere de qualquer forma, mas mandar daqui é o
|
|
7944
|
+
// que faz o clique bater na função do gateway que a loja realmente conectou.
|
|
7945
|
+
provider: policy?.paymentProvider ?? null
|
|
7947
7946
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7948
|
-
}), [cart.lines, cart.discountCode, form, paymentMethod]);
|
|
7947
|
+
}), [cart.lines, cart.discountCode, form, paymentMethod, policy?.paymentProvider]);
|
|
7949
7948
|
const [acquirerMissing, setAcquirerMissing] = useState(false);
|
|
7950
|
-
const chargesOnline = paymentMethod === "pix" && !acquirerMissing && (!policy?.paymentProvider ||
|
|
7949
|
+
const chargesOnline = paymentMethod === "pix" && !acquirerMissing && (!policy?.paymentProvider || isChargeableProvider(policy.paymentProvider));
|
|
7951
7950
|
const money = (value) => formatMoney(value, config.currency, config.locale);
|
|
7952
7951
|
useEffect(() => {
|
|
7953
7952
|
if (cart.lines.length === 0 && !paidOrderId && !leaving.current) navigateTo(config.catalogPath);
|
|
@@ -11042,5 +11041,5 @@ ${formatErrors(report.errors)}`;
|
|
|
11042
11041
|
}
|
|
11043
11042
|
|
|
11044
11043
|
export { BEFORE_PLACE_ORDER_VALVE, BLOCK_STRUCTURAL_KEYS, BenefitsRow, BlockDataError, CART_LINE_ANNOTATION_POINT, CATALOG_BODY_BLOCK, CHECKOUT_FIELD_POINT, CartDrawer, CatalogPage, CategoryShowcase, CheckoutPage, CollectionCta, CollectionHero, ContentPage, CountdownBand, EmailConfirmationRequiredError, EntityListBlock, FaqSection, FiltersPanel, FormBlock, HeroSection, ImageTiles, Link, ManifestoBlock, MediaCarousel, MotifStrip, MyPurchasesPage, NewsletterBand, ORDER_METADATA_POINT, OrderConfirmationPage, OrderTrackingTimeline, PAGE_DATA_SCRIPT_ID, PLACEHOLDER_ASPECTS, PRODUCT_BODY_BLOCK, PRODUCT_CARD_BADGE_POINT, PageDataScope, PaymentTerms, Price, ProductCard, ProductDetailPage, ProductEnquiryForm, ProductGallery, ProductGrid, ProductOptionSelector, ProductRail, ProductReviews, ProductSlider, ProductSpecs, ProductSpotlight, PromoBanner, QuantityInput, Reveal, STOREFRONT_COMPONENT_KEYS, STOREFRONT_PAGE_KINDS, STOREFRONT_SLOTS, STORE_BACKEND_PROVIDERS, STORE_COMMERCE_MODES, STORE_DOCUMENT_KIND, STORE_PAYMENT_METHOD_KINDS, STORE_PAYMENT_MODES, STORE_ROUTE_CHROMES, STORE_ROUTE_KINDS, STORE_SECTIONS, STORE_SECTION_NAMES, SealsBand, SearchOverlay, Slot, SmoothImage, StepsSection, StorefrontConfigHost, StorefrontConfigProvider, StorefrontFooter, StorefrontHeader, StorefrontPage, StorefrontRouterProvider, StorefrontShell, StorefrontThemeStyle, StoryQuote, THEME_SCALE_FIELDS, THEME_SCALE_VAR_PREFIX, TID, Testimonials, TierCards, applyStoreSettings, bannerPlaceholder, blockInstanceId, buildEnquiryFromForm, checkPageBlocks, collectDataNeeds, collectOrderMetadata, contentPagePath, createStorefront, createStorefrontApp, currentStaticRenderPass, defaultPageBlocks, entityListBlockMeta, establishCustomerSession, exportStore, formatMoney, formatProductOptionSelection, getCartLineAnnotations, getCheckoutFieldContributions, getCustomerAuthAdapter, getProductCardBadges, getProductOptionGroups, hydrateStoreDocument, hydratedEntriesFor, initStorefrontRuntime, isJsonValue, isKnownPath, isNestedBlockRef, isPublicPath, isRecord, listSlots, matchContentPage, matchPath, matchesFacets, mergeCollectionFacet, mergePageTheme, navigateTo, nextMilestone, normalizeProductOptionSelection, orderGalleryImages, overrideComponent, overrideProps, pageSeo, pageThemeSelector, pickProductCardImage, placeStorefrontOrder, prefersReducedMotion, primaryImageUrl, productCardComponentContract, productJsonLd, productOptionSelectionKey, productPlaceholder, productSeo, readHydratedPageData, registerStorefrontBlocks, registerStorefrontEntities, registerStorefrontExtensionPoints, registerStorefrontLoaders, resetPageDiagnostics, resetProductOptionsDeprecationWarnings, resetStorefrontExtensionPoints, resolveAuthAdapter, resolveConfig, resolveDataParams, resolveOverride, resolvePageData, resolvePageDataNeed, resolvePaymentTerms, resolveStorefrontProvider, resolveStorefrontRoute, resolveVariantForSelection, roundCents, routePathParams, runBeforePlaceOrderValve, sectionToJsonSchema, sectionsToBlocks, selectCount, selectDiscountTotal, selectRequiresShipping, selectShipping, selectSubtotal, selectTotal, selectionPrice, serializePageData, shellRouterAdapter, signInByEmail, signOutCustomer, signUpCustomer, slugifyStoreName, storefrontComponentContracts, storefrontPaths, themeToCss, toBlockNodes, toFacetMap, useBlockData, useCartStore, useCatalogStore, useCategories, useDeliveryStore, useDiscountValidator, useEnquiry, useHashPath, useInView, useLoader, useMyOrders, useNavigate, usePopOnChange, useProduct, useProducts, useRoutePath, useRouterAdapter, useScrollToTopOnNavigate, useScrolled, useSessionStore, useSlotContext, useStorefrontActions, useStorefrontConfig, useStorefrontConfigOptional, useStorefrontHead, useStorefrontPage, useStorefrontPageOptional, usedSlots, validateStore, withFacet, withStaticRenderPass };
|
|
11045
|
-
//# sourceMappingURL=chunk-
|
|
11046
|
-
//# sourceMappingURL=chunk-
|
|
11044
|
+
//# sourceMappingURL=chunk-OYKFJ6FG.js.map
|
|
11045
|
+
//# sourceMappingURL=chunk-OYKFJ6FG.js.map
|