@cimplify/sdk 0.44.14 → 0.44.18
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/advanced.d.mts +1 -1
- package/dist/advanced.d.ts +1 -1
- package/dist/advanced.js +22 -21
- package/dist/advanced.mjs +3 -2
- package/dist/{chunk-OMAP327U.js → chunk-3FS3ZDKX.js} +62 -61
- package/dist/chunk-53J2WE4S.js +657 -0
- package/dist/{chunk-3WD6U5RD.mjs → chunk-5OK3YDZC.mjs} +4 -3
- package/dist/{chunk-V2O5AO7I.js → chunk-BN2CXGMO.js} +5 -246
- package/dist/chunk-CCSONJCO.js +8824 -0
- package/dist/{chunk-BAWKQRIB.js → chunk-HBRCVJL4.js} +22 -21
- package/dist/chunk-MJBSVUHO.mjs +8822 -0
- package/dist/{chunk-6TVQQYQ5.mjs → chunk-NRT6PVW5.mjs} +4 -231
- package/dist/chunk-QBQCMQ4F.js +271 -0
- package/dist/chunk-VDH3O7UB.mjs +604 -0
- package/dist/chunk-XPXAZXF2.mjs +250 -0
- package/dist/{chunk-EZK2FXTM.mjs → chunk-XZPO5GEM.mjs} +2 -1
- package/dist/cli/commands/deploy.mjs +9 -1
- package/dist/client-B_Ei3ENB.d.mts +86 -0
- package/dist/client-Bep2FooI.d.ts +86 -0
- package/dist/{client-lvLvB1_K.d.ts → client-D6ZisKco.d.ts} +7 -0
- package/dist/{client-CkGlXZRd.d.mts → client-Dh-bHyhU.d.mts} +7 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +145 -144
- package/dist/index.mjs +4 -3
- package/dist/mock/cli.mjs +2 -1
- package/dist/mock/library.js +2 -1
- package/dist/mock/library.mjs +2 -1
- package/dist/mock/msw.js +2 -1
- package/dist/mock/msw.mjs +2 -1
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +81 -80
- package/dist/react.mjs +4 -3
- package/dist/server-CWpUlLOQ.d.mts +1003 -0
- package/dist/server-CWpUlLOQ.d.ts +1003 -0
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +6 -5
- package/dist/server.mjs +4 -3
- package/dist/testing/msw.d.mts +17 -0
- package/dist/testing/msw.d.ts +17 -0
- package/dist/testing/msw.js +42 -0
- package/dist/testing/msw.mjs +40 -0
- package/dist/testing/suite.d.mts +85 -0
- package/dist/testing/suite.d.ts +85 -0
- package/dist/testing/suite.js +174 -0
- package/dist/testing/suite.mjs +170 -0
- package/dist/testing.d.mts +1885 -0
- package/dist/testing.d.ts +1885 -0
- package/dist/testing.js +261 -0
- package/dist/testing.mjs +51 -0
- package/dist/utils.js +29 -28
- package/dist/utils.mjs +2 -1
- package/package.json +28 -4
- package/templates/storefront-bakery/__tests__/brand.test.ts +4 -0
- package/templates/storefront-bakery/__tests__/cart-flow.test.ts +4 -0
- package/templates/storefront-bakery/__tests__/contract.test.ts +4 -0
- package/templates/storefront-bakery/package.json +11 -3
- package/templates/storefront-bakery/vitest.config.ts +9 -0
- package/templates/storefront-fashion/__tests__/brand.test.ts +4 -0
- package/templates/storefront-fashion/__tests__/cart-flow.test.ts +4 -0
- package/templates/storefront-fashion/__tests__/contract.test.ts +4 -0
- package/templates/storefront-fashion/package.json +11 -3
- package/templates/storefront-fashion/vitest.config.ts +9 -0
- package/templates/storefront-grocery/__tests__/brand.test.ts +4 -0
- package/templates/storefront-grocery/__tests__/cart-flow.test.ts +4 -0
- package/templates/storefront-grocery/__tests__/contract.test.ts +4 -0
- package/templates/storefront-grocery/package.json +11 -3
- package/templates/storefront-grocery/vitest.config.ts +9 -0
- package/templates/storefront-restaurant/__tests__/brand.test.ts +4 -0
- package/templates/storefront-restaurant/__tests__/cart-flow.test.ts +4 -0
- package/templates/storefront-restaurant/__tests__/contract.test.ts +4 -0
- package/templates/storefront-restaurant/package.json +11 -3
- package/templates/storefront-restaurant/vitest.config.ts +9 -0
- package/templates/storefront-retail/__tests__/brand.test.ts +4 -0
- package/templates/storefront-retail/__tests__/cart-flow.test.ts +4 -0
- package/templates/storefront-retail/__tests__/contract.test.ts +4 -0
- package/templates/storefront-retail/package.json +11 -3
- package/templates/storefront-retail/vitest.config.ts +9 -0
- package/templates/storefront-services/__tests__/brand.test.ts +4 -0
- package/templates/storefront-services/__tests__/cart-flow.test.ts +4 -0
- package/templates/storefront-services/__tests__/contract.test.ts +4 -0
- package/templates/storefront-services/package.json +11 -3
- package/templates/storefront-services/vitest.config.ts +9 -0
package/dist/react.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React$1, { ReactNode } from 'react';
|
|
2
2
|
import { A as AdSlot, a as AdPosition, e as AdContextValue } from './ads-BxbWrwqp.js';
|
|
3
3
|
export { c as AdConfig, g as getVariantDisplayName } from './ads-BxbWrwqp.js';
|
|
4
|
-
import { C as CimplifyClient, an as ProcessCheckoutResult, ap as CheckoutStatus, aq as CheckoutStatusContext, bZ as Location, bW as Business, k as ReorderResult, b4 as OrderStatus, bh as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, ca as Service, cf as AvailableSlot, cg as DayAvailability, cl as CustomerBooking, cr as CancelBookingResult, J as ActivityStateResponse, E as SessionMessage, K as ActivityRecommendation, W as DeliveryFeeResponse, d0 as FxRateResponse, c4 as StorefrontBootstrap, a0 as ChatWidgetStarter, Y as ChatMessage, ab as ElementsOptions, de as AuthenticatedData, da as AddressInfo, db as PaymentMethodInfo, a5 as CimplifyElements, dg as ElementsCheckoutResult, am as ProcessCheckoutOptions, bg as LineItem, cb as Staff, c2 as Room } from './client-
|
|
4
|
+
import { C as CimplifyClient, an as ProcessCheckoutResult, ap as CheckoutStatus, aq as CheckoutStatusContext, bZ as Location, bW as Business, k as ReorderResult, b4 as OrderStatus, bh as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, ca as Service, cf as AvailableSlot, cg as DayAvailability, cl as CustomerBooking, cr as CancelBookingResult, J as ActivityStateResponse, E as SessionMessage, K as ActivityRecommendation, W as DeliveryFeeResponse, d0 as FxRateResponse, c4 as StorefrontBootstrap, a0 as ChatWidgetStarter, Y as ChatMessage, ab as ElementsOptions, de as AuthenticatedData, da as AddressInfo, db as PaymentMethodInfo, a5 as CimplifyElements, dg as ElementsCheckoutResult, am as ProcessCheckoutOptions, bg as LineItem, cb as Staff, c2 as Room } from './client-D6ZisKco.js';
|
|
5
5
|
import { a as CurrencyCode, U as Product, d as Pagination, h as CimplifyError, a7 as ProductWithDetails, am as Category, M as Money, bh as BundleSelectionInput, aM as ComponentSelectionInput, bk as BundleSelectionData, bn as CompositeSelectionData, ao as Collection, aU as ProductTaxonomy, aV as TaxonomyWithChildren, aT as ProductTimeProfile, aY as Deal, aZ as ProductDealInfo, a_ as DiscountValidation, at as BundleSummary, aN as CompositePriceResult, c1 as SubscriptionStatus, c2 as Subscription, c5 as SubscriptionWithDetails, H as CustomAttributeDefinition, N as PropertyFacet, b_ as ProductBillingPlan, a8 as VariantView, ac as VariantAxisWithValues, ai as AddOnWithOptions, ay as BundleComponentView, ar as BundlePriceType, aJ as CompositeGroupView, bs as DisplayCart, a3 as ProductInputField, J as CustomAttributeValue, L as ProductProperty, a5 as QuantityPricingTier } from './payment-DA1i5hhk.js';
|
|
6
6
|
import { P as ProductWithPrice } from './price-Bv4G8aOO.js';
|
|
7
7
|
import { ClassValue } from 'clsx';
|
package/dist/react.js
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkBGCEKFLA_js = require('./chunk-BGCEKFLA.js');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var chunk3FS3ZDKX_js = require('./chunk-3FS3ZDKX.js');
|
|
6
|
+
var chunkHBRCVJL4_js = require('./chunk-HBRCVJL4.js');
|
|
7
|
+
var chunkBN2CXGMO_js = require('./chunk-BN2CXGMO.js');
|
|
8
|
+
var chunkQBQCMQ4F_js = require('./chunk-QBQCMQ4F.js');
|
|
8
9
|
var React10 = require('react');
|
|
9
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
11
|
var clsx = require('clsx');
|
|
@@ -568,12 +569,12 @@ function attachInternalItemMetadata(item) {
|
|
|
568
569
|
return { ...item, _lineKey: lineKeyFromItem(item) };
|
|
569
570
|
}
|
|
570
571
|
function calculateLineSubtotal(item) {
|
|
571
|
-
let unitPrice =
|
|
572
|
+
let unitPrice = chunkBN2CXGMO_js.parsePrice(item.product.default_price);
|
|
572
573
|
if (item.variant?.price_adjustment) {
|
|
573
|
-
unitPrice +=
|
|
574
|
+
unitPrice += chunkBN2CXGMO_js.parsePrice(item.variant.price_adjustment);
|
|
574
575
|
}
|
|
575
576
|
for (const option of item.addOnOptions || []) {
|
|
576
|
-
if (option.default_price) unitPrice +=
|
|
577
|
+
if (option.default_price) unitPrice += chunkBN2CXGMO_js.parsePrice(option.default_price);
|
|
577
578
|
}
|
|
578
579
|
return roundMoney(unitPrice * item.quantity);
|
|
579
580
|
}
|
|
@@ -1152,7 +1153,7 @@ var DEFAULT_COUNTRY = "US";
|
|
|
1152
1153
|
function createDefaultClient() {
|
|
1153
1154
|
const processRef = globalThis.process;
|
|
1154
1155
|
const envPublicKey = processRef?.env?.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY || "";
|
|
1155
|
-
return
|
|
1156
|
+
return chunk3FS3ZDKX_js.createCimplifyClient({ publicKey: envPublicKey });
|
|
1156
1157
|
}
|
|
1157
1158
|
function getStoredLocationId() {
|
|
1158
1159
|
if (typeof window === "undefined" || !window.localStorage) {
|
|
@@ -1236,7 +1237,7 @@ function CimplifyProvider({
|
|
|
1236
1237
|
const setDisplayCurrency = React10.useCallback(
|
|
1237
1238
|
(currency) => {
|
|
1238
1239
|
const normalized = currency?.trim().toUpperCase() || null;
|
|
1239
|
-
if (normalized && !
|
|
1240
|
+
if (normalized && !chunkQBQCMQ4F_js.isSupportedCurrency(normalized)) {
|
|
1240
1241
|
return;
|
|
1241
1242
|
}
|
|
1242
1243
|
setDisplayCurrencyOverride(normalized);
|
|
@@ -1898,7 +1899,7 @@ function Price({ amount, currency, className, prefix }) {
|
|
|
1898
1899
|
const resolvedAmount = typeof convertedAmount === "string" ? parseFloat(convertedAmount) || 0 : convertedAmount;
|
|
1899
1900
|
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className, children: [
|
|
1900
1901
|
prefix,
|
|
1901
|
-
|
|
1902
|
+
chunkBN2CXGMO_js.formatPrice(resolvedAmount, resolvedCurrency)
|
|
1902
1903
|
] });
|
|
1903
1904
|
}
|
|
1904
1905
|
function createCachedQuery(config) {
|
|
@@ -2905,16 +2906,16 @@ function useProductPrice(input) {
|
|
|
2905
2906
|
if (bundleTotalPrice != null) {
|
|
2906
2907
|
unitPrice = bundleTotalPrice;
|
|
2907
2908
|
} else if (compositePrice) {
|
|
2908
|
-
unitPrice =
|
|
2909
|
+
unitPrice = chunkBN2CXGMO_js.parsePrice(compositePrice.final_price);
|
|
2909
2910
|
} else {
|
|
2910
|
-
unitPrice =
|
|
2911
|
+
unitPrice = chunkBN2CXGMO_js.parsePrice(product.default_price);
|
|
2911
2912
|
if (variant?.price_adjustment) {
|
|
2912
|
-
unitPrice +=
|
|
2913
|
+
unitPrice += chunkBN2CXGMO_js.parsePrice(variant.price_adjustment);
|
|
2913
2914
|
}
|
|
2914
2915
|
if (addOnOptions) {
|
|
2915
2916
|
for (const option of addOnOptions) {
|
|
2916
2917
|
if (option.default_price) {
|
|
2917
|
-
unitPrice +=
|
|
2918
|
+
unitPrice += chunkBN2CXGMO_js.parsePrice(option.default_price);
|
|
2918
2919
|
}
|
|
2919
2920
|
}
|
|
2920
2921
|
}
|
|
@@ -3658,19 +3659,19 @@ function AuthElement({
|
|
|
3658
3659
|
}, [onReady, onAuthenticated, onRequiresOtp, onError]);
|
|
3659
3660
|
React10.useEffect(() => {
|
|
3660
3661
|
if (!elements || !containerRef.current) return;
|
|
3661
|
-
const element = elements.create(
|
|
3662
|
+
const element = elements.create(chunkHBRCVJL4_js.ELEMENT_TYPES.AUTH, { prefillEmail });
|
|
3662
3663
|
elementRef.current = element;
|
|
3663
|
-
element.on(
|
|
3664
|
+
element.on(chunkHBRCVJL4_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
3664
3665
|
element.on(
|
|
3665
|
-
|
|
3666
|
+
chunkHBRCVJL4_js.EVENT_TYPES.AUTHENTICATED,
|
|
3666
3667
|
(data) => onAuthenticatedRef.current?.(data)
|
|
3667
3668
|
);
|
|
3668
3669
|
element.on(
|
|
3669
|
-
|
|
3670
|
+
chunkHBRCVJL4_js.EVENT_TYPES.REQUIRES_OTP,
|
|
3670
3671
|
(data) => onRequiresOtpRef.current?.(data)
|
|
3671
3672
|
);
|
|
3672
3673
|
element.on(
|
|
3673
|
-
|
|
3674
|
+
chunkHBRCVJL4_js.EVENT_TYPES.ERROR,
|
|
3674
3675
|
(data) => onErrorRef.current?.(data)
|
|
3675
3676
|
);
|
|
3676
3677
|
element.mount(containerRef.current);
|
|
@@ -3699,15 +3700,15 @@ function AddressElement({
|
|
|
3699
3700
|
}, [onReady, onChange, onError]);
|
|
3700
3701
|
React10.useEffect(() => {
|
|
3701
3702
|
if (!elements || !containerRef.current) return;
|
|
3702
|
-
const element = elements.create(
|
|
3703
|
+
const element = elements.create(chunkHBRCVJL4_js.ELEMENT_TYPES.ADDRESS, { mode });
|
|
3703
3704
|
elementRef.current = element;
|
|
3704
|
-
element.on(
|
|
3705
|
+
element.on(chunkHBRCVJL4_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
3705
3706
|
element.on(
|
|
3706
|
-
|
|
3707
|
+
chunkHBRCVJL4_js.EVENT_TYPES.CHANGE,
|
|
3707
3708
|
(data) => onChangeRef.current?.(data)
|
|
3708
3709
|
);
|
|
3709
3710
|
element.on(
|
|
3710
|
-
|
|
3711
|
+
chunkHBRCVJL4_js.EVENT_TYPES.ERROR,
|
|
3711
3712
|
(data) => onErrorRef.current?.(data)
|
|
3712
3713
|
);
|
|
3713
3714
|
element.mount(containerRef.current);
|
|
@@ -3737,15 +3738,15 @@ function PaymentElement({
|
|
|
3737
3738
|
}, [onReady, onChange, onError]);
|
|
3738
3739
|
React10.useEffect(() => {
|
|
3739
3740
|
if (!elements || !containerRef.current) return;
|
|
3740
|
-
const element = elements.create(
|
|
3741
|
+
const element = elements.create(chunkHBRCVJL4_js.ELEMENT_TYPES.PAYMENT, { amount, currency });
|
|
3741
3742
|
elementRef.current = element;
|
|
3742
|
-
element.on(
|
|
3743
|
+
element.on(chunkHBRCVJL4_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
3743
3744
|
element.on(
|
|
3744
|
-
|
|
3745
|
+
chunkHBRCVJL4_js.EVENT_TYPES.CHANGE,
|
|
3745
3746
|
(data) => onChangeRef.current?.(data)
|
|
3746
3747
|
);
|
|
3747
3748
|
element.on(
|
|
3748
|
-
|
|
3749
|
+
chunkHBRCVJL4_js.EVENT_TYPES.ERROR,
|
|
3749
3750
|
(data) => onErrorRef.current?.(data)
|
|
3750
3751
|
);
|
|
3751
3752
|
element.mount(containerRef.current);
|
|
@@ -3901,7 +3902,7 @@ function VariantSelector({
|
|
|
3901
3902
|
if (!variants || variants.length <= 1) {
|
|
3902
3903
|
return null;
|
|
3903
3904
|
}
|
|
3904
|
-
basePrice != null ?
|
|
3905
|
+
basePrice != null ? chunkBN2CXGMO_js.parsePrice(basePrice) : 0;
|
|
3905
3906
|
if (variantAxes && variantAxes.length > 0) {
|
|
3906
3907
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-variant-selector": true, className: cn("space-y-5", className, classNames?.root), children: variantAxes.map((axis) => {
|
|
3907
3908
|
const labelId = `${idPrefix}-axis-${axis.id}`;
|
|
@@ -3977,7 +3978,7 @@ function VariantSelector({
|
|
|
3977
3978
|
className: cn("divide-y divide-border", classNames?.list),
|
|
3978
3979
|
children: variants.map((variant) => {
|
|
3979
3980
|
const isSelected = selectedVariantId === variant.id;
|
|
3980
|
-
const adjustment =
|
|
3981
|
+
const adjustment = chunkBN2CXGMO_js.parsePrice(variant.price_adjustment);
|
|
3981
3982
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3982
3983
|
radio.Radio.Root,
|
|
3983
3984
|
{
|
|
@@ -4243,16 +4244,16 @@ function BundleSelector({
|
|
|
4243
4244
|
}, [components, selections, onReady]);
|
|
4244
4245
|
const totalPrice = React10.useMemo(() => {
|
|
4245
4246
|
if (pricingType === "fixed" && bundlePrice) {
|
|
4246
|
-
return
|
|
4247
|
+
return chunkBN2CXGMO_js.parsePrice(bundlePrice);
|
|
4247
4248
|
}
|
|
4248
4249
|
const componentsTotal = components.reduce((sum, comp) => {
|
|
4249
4250
|
return sum + getComponentPrice(comp, variantChoices[comp.id]) * comp.quantity;
|
|
4250
4251
|
}, 0);
|
|
4251
4252
|
if (pricingType === "percentage_discount" && discountValue) {
|
|
4252
|
-
return componentsTotal * (1 -
|
|
4253
|
+
return componentsTotal * (1 - chunkBN2CXGMO_js.parsePrice(discountValue) / 100);
|
|
4253
4254
|
}
|
|
4254
4255
|
if (pricingType === "fixed_discount" && discountValue) {
|
|
4255
|
-
return componentsTotal -
|
|
4256
|
+
return componentsTotal - chunkBN2CXGMO_js.parsePrice(discountValue);
|
|
4256
4257
|
}
|
|
4257
4258
|
return componentsTotal;
|
|
4258
4259
|
}, [components, variantChoices, pricingType, bundlePrice, discountValue]);
|
|
@@ -4313,15 +4314,15 @@ function BundleSelector({
|
|
|
4313
4314
|
}
|
|
4314
4315
|
function getComponentPrice(component, selectedVariantId) {
|
|
4315
4316
|
if (!selectedVariantId || component.available_variants.length === 0) {
|
|
4316
|
-
return
|
|
4317
|
+
return chunkBN2CXGMO_js.parsePrice(component.effective_price);
|
|
4317
4318
|
}
|
|
4318
4319
|
if (selectedVariantId === component.variant_id) {
|
|
4319
|
-
return
|
|
4320
|
+
return chunkBN2CXGMO_js.parsePrice(component.effective_price);
|
|
4320
4321
|
}
|
|
4321
4322
|
const bakedAdj = component.variant_id ? component.available_variants.find((v) => v.id === component.variant_id) : void 0;
|
|
4322
4323
|
const selectedAdj = component.available_variants.find((v) => v.id === selectedVariantId);
|
|
4323
|
-
if (!selectedAdj) return
|
|
4324
|
-
return
|
|
4324
|
+
if (!selectedAdj) return chunkBN2CXGMO_js.parsePrice(component.effective_price);
|
|
4325
|
+
return chunkBN2CXGMO_js.parsePrice(component.effective_price) - chunkBN2CXGMO_js.parsePrice(bakedAdj?.price_adjustment ?? "0") + chunkBN2CXGMO_js.parsePrice(selectedAdj.price_adjustment);
|
|
4325
4326
|
}
|
|
4326
4327
|
function formatDuration(minutes, unit) {
|
|
4327
4328
|
if (unit === "hours" || !unit && minutes >= 60 && minutes % 60 === 0) {
|
|
@@ -4434,7 +4435,7 @@ function BundleComponentCard({
|
|
|
4434
4435
|
className: cn("mt-3 divide-y divide-border", classNames?.variantPicker),
|
|
4435
4436
|
children: component.available_variants.map((variant) => {
|
|
4436
4437
|
const isSelected = selectedVariantId === variant.id;
|
|
4437
|
-
const adjustment =
|
|
4438
|
+
const adjustment = chunkBN2CXGMO_js.parsePrice(variant.price_adjustment);
|
|
4438
4439
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4439
4440
|
radio.Radio.Root,
|
|
4440
4441
|
{
|
|
@@ -4880,7 +4881,7 @@ function CompositeSelector({
|
|
|
4880
4881
|
"data-cimplify-composite-summary": true,
|
|
4881
4882
|
className: cn("border-t border-border pt-4 space-y-1 text-sm", classNames?.summary),
|
|
4882
4883
|
children: [
|
|
4883
|
-
|
|
4884
|
+
chunkBN2CXGMO_js.parsePrice(priceResult.base_price) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4884
4885
|
"div",
|
|
4885
4886
|
{
|
|
4886
4887
|
"data-cimplify-composite-summary-line": true,
|
|
@@ -4891,7 +4892,7 @@ function CompositeSelector({
|
|
|
4891
4892
|
]
|
|
4892
4893
|
}
|
|
4893
4894
|
),
|
|
4894
|
-
|
|
4895
|
+
chunkBN2CXGMO_js.parsePrice(priceResult.components_total) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4895
4896
|
"div",
|
|
4896
4897
|
{
|
|
4897
4898
|
"data-cimplify-composite-summary-line": true,
|
|
@@ -5187,7 +5188,7 @@ function InputField({
|
|
|
5187
5188
|
onFileUpload,
|
|
5188
5189
|
classNames
|
|
5189
5190
|
}) {
|
|
5190
|
-
const hasPriceAdjustment = field.price_adjustment != null &&
|
|
5191
|
+
const hasPriceAdjustment = field.price_adjustment != null && chunkBN2CXGMO_js.parsePrice(field.price_adjustment) > 0;
|
|
5191
5192
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-customer-input": true, "data-field-type": field.field_type, className: classNames?.field, children: [
|
|
5192
5193
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-1.5", children: [
|
|
5193
5194
|
/* @__PURE__ */ jsxRuntime.jsx("label", { className: cn("text-sm font-semibold", classNames?.label), children: field.name }),
|
|
@@ -6081,18 +6082,18 @@ function ProductCustomizer({
|
|
|
6081
6082
|
}, [selectedAddOnOptionIds]);
|
|
6082
6083
|
const localTotalPrice = React10.useMemo(() => {
|
|
6083
6084
|
if (isComposite && compositePrice) {
|
|
6084
|
-
return
|
|
6085
|
+
return chunkBN2CXGMO_js.parsePrice(compositePrice.final_price) * quantity;
|
|
6085
6086
|
}
|
|
6086
6087
|
if (isBundle && bundleTotalPrice != null) {
|
|
6087
6088
|
return bundleTotalPrice * quantity;
|
|
6088
6089
|
}
|
|
6089
|
-
let price =
|
|
6090
|
+
let price = chunkBN2CXGMO_js.parsePrice(product.default_price);
|
|
6090
6091
|
if (selectedVariant?.price_adjustment) {
|
|
6091
|
-
price +=
|
|
6092
|
+
price += chunkBN2CXGMO_js.parsePrice(selectedVariant.price_adjustment);
|
|
6092
6093
|
}
|
|
6093
6094
|
for (const option of selectedAddOnOptions) {
|
|
6094
6095
|
if (option.default_price) {
|
|
6095
|
-
price +=
|
|
6096
|
+
price += chunkBN2CXGMO_js.parsePrice(option.default_price);
|
|
6096
6097
|
}
|
|
6097
6098
|
}
|
|
6098
6099
|
return price * quantity;
|
|
@@ -6141,7 +6142,7 @@ function ProductCustomizer({
|
|
|
6141
6142
|
const priceInfo = quote.quoted_total_price_info ?? quote.final_price_info;
|
|
6142
6143
|
const perUnit = priceInfo.pre_tax_price;
|
|
6143
6144
|
if (perUnit === void 0 || perUnit === null) return void 0;
|
|
6144
|
-
return
|
|
6145
|
+
return chunkBN2CXGMO_js.parsePrice(perUnit) * quantity;
|
|
6145
6146
|
}, [quote, quantity]);
|
|
6146
6147
|
const displayTotalPrice = quotedTotalPrice ?? localTotalPrice;
|
|
6147
6148
|
const handleVariantChange = React10.useCallback(
|
|
@@ -6263,7 +6264,7 @@ function ProductCustomizer({
|
|
|
6263
6264
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.deposit_amount })
|
|
6264
6265
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
6265
6266
|
"Deposit required: ",
|
|
6266
|
-
|
|
6267
|
+
chunkBN2CXGMO_js.parsePrice(product.deposit_amount),
|
|
6267
6268
|
"%"
|
|
6268
6269
|
] }) }),
|
|
6269
6270
|
product.allergies && product.allergies.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-customizer-allergens": true, className: cn("flex flex-wrap gap-1.5", classNames?.allergens), children: product.allergies.map((allergen) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6324,7 +6325,7 @@ function ProductCustomizer({
|
|
|
6324
6325
|
] })
|
|
6325
6326
|
] }),
|
|
6326
6327
|
product.quantity_pricing && product.quantity_pricing.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-customizer-unit-price": true, className: "text-sm text-muted-foreground text-right shrink-0", children: [
|
|
6327
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
6328
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkBN2CXGMO_js.getUnitPriceAtQuantity(product.quantity_pricing, quantity, chunkBN2CXGMO_js.parsePrice(product.default_price)), className: "font-medium text-foreground" }),
|
|
6328
6329
|
" ea."
|
|
6329
6330
|
] }),
|
|
6330
6331
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6448,7 +6449,7 @@ function CartLineItemRow({
|
|
|
6448
6449
|
const hasComposite = item.compositeSelections && item.compositeSelections.length > 0;
|
|
6449
6450
|
const hasBundle = item.bundleSelections && item.bundleSelections.length > 0;
|
|
6450
6451
|
const isOptimistic = item.isOptimistic === true;
|
|
6451
|
-
const lineTotal =
|
|
6452
|
+
const lineTotal = chunkBN2CXGMO_js.parsePrice(unitPrice) * item.quantity;
|
|
6452
6453
|
const imageUrl = item.product.image_url;
|
|
6453
6454
|
const variantLabel = item.variant ? chunkBGCEKFLA_js.getVariantDisplayName(item.variant, item.product.name) : null;
|
|
6454
6455
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -6681,15 +6682,15 @@ function CartSummary({
|
|
|
6681
6682
|
] }),
|
|
6682
6683
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: subtotal, className: "tabular-nums" })
|
|
6683
6684
|
] }),
|
|
6684
|
-
totalDiscounts != null &&
|
|
6685
|
+
totalDiscounts != null && chunkBN2CXGMO_js.parsePrice(totalDiscounts) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-discount": true, className: cn("flex items-baseline justify-between", classNames?.discount), children: [
|
|
6685
6686
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Discount" }),
|
|
6686
6687
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: totalDiscounts, prefix: "-", className: "tabular-nums text-primary" })
|
|
6687
6688
|
] }),
|
|
6688
6689
|
deliveryFee != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-delivery-fee": true, className: cn("flex items-baseline justify-between", classNames?.deliveryFee), children: [
|
|
6689
6690
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Delivery" }),
|
|
6690
|
-
|
|
6691
|
+
chunkBN2CXGMO_js.parsePrice(deliveryFee) > 0 ? /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: deliveryFee, className: "tabular-nums" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-primary", children: "Free" })
|
|
6691
6692
|
] }),
|
|
6692
|
-
serviceCharge != null &&
|
|
6693
|
+
serviceCharge != null && chunkBN2CXGMO_js.parsePrice(serviceCharge) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-service-charge": true, className: cn("flex items-baseline justify-between", classNames?.serviceCharge), children: [
|
|
6693
6694
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Service charge" }),
|
|
6694
6695
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: serviceCharge, className: "tabular-nums" })
|
|
6695
6696
|
] }),
|
|
@@ -6779,16 +6780,16 @@ function SaleBadge({
|
|
|
6779
6780
|
className,
|
|
6780
6781
|
classNames
|
|
6781
6782
|
}) {
|
|
6782
|
-
const onSale =
|
|
6783
|
+
const onSale = chunkBN2CXGMO_js.isOnSale(product);
|
|
6783
6784
|
const hasDeal = dealInfo !== void 0;
|
|
6784
6785
|
if (!hasDeal && !onSale && !label) {
|
|
6785
6786
|
return null;
|
|
6786
6787
|
}
|
|
6787
6788
|
let percentage = null;
|
|
6788
6789
|
if (hasDeal && dealInfo.benefit_type === "percentage") {
|
|
6789
|
-
percentage =
|
|
6790
|
+
percentage = chunkBN2CXGMO_js.parsePrice(dealInfo.value);
|
|
6790
6791
|
} else if (onSale) {
|
|
6791
|
-
percentage =
|
|
6792
|
+
percentage = chunkBN2CXGMO_js.getDiscountPercentage(product);
|
|
6792
6793
|
}
|
|
6793
6794
|
const badgeText = label ?? dealInfo?.label ?? (percentage != null && percentage > 0 ? `${percentage}% off` : null);
|
|
6794
6795
|
if (!badgeText) {
|
|
@@ -6807,7 +6808,7 @@ function SaleBadge({
|
|
|
6807
6808
|
"%"
|
|
6808
6809
|
] }),
|
|
6809
6810
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-label": true, className: classNames?.label, children: badgeText }),
|
|
6810
|
-
showOriginalPrice && onSale && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-original-price": true, className: classNames?.originalPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
6811
|
+
showOriginalPrice && onSale && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-original-price": true, className: classNames?.originalPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkBN2CXGMO_js.getBasePrice(product) }) })
|
|
6811
6812
|
]
|
|
6812
6813
|
}
|
|
6813
6814
|
);
|
|
@@ -7060,8 +7061,8 @@ function SoldOutOverlay() {
|
|
|
7060
7061
|
);
|
|
7061
7062
|
}
|
|
7062
7063
|
function SaleBadge2({ product }) {
|
|
7063
|
-
if (!
|
|
7064
|
-
const pct =
|
|
7064
|
+
if (!chunkBN2CXGMO_js.isOnSale(product)) return null;
|
|
7065
|
+
const pct = chunkBN2CXGMO_js.getDiscountPercentage(product);
|
|
7065
7066
|
if (!pct || pct <= 0) return null;
|
|
7066
7067
|
return /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-card-sale-badge": true, className: "inline-flex items-center text-[11px] font-semibold tracking-wide bg-destructive text-destructive-foreground px-2 py-0.5 rounded-md", children: [
|
|
7067
7068
|
"-",
|
|
@@ -7154,7 +7155,7 @@ function RetailProductCard({
|
|
|
7154
7155
|
}) {
|
|
7155
7156
|
const image = product.image_url || product.images?.[0] || "";
|
|
7156
7157
|
const outOfStock = product.inventory_status?.in_stock === false;
|
|
7157
|
-
const onSale =
|
|
7158
|
+
const onSale = chunkBN2CXGMO_js.isOnSale(product);
|
|
7158
7159
|
const swatches = getColorSwatches(product);
|
|
7159
7160
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, disabled: outOfStock, className, children: [
|
|
7160
7161
|
outOfStock && /* @__PURE__ */ jsxRuntime.jsx(SoldOutOverlay, {}),
|
|
@@ -7172,7 +7173,7 @@ function RetailProductCard({
|
|
|
7172
7173
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[14.5px] font-semibold text-foreground leading-snug tracking-tight mt-1 truncate", children: product.name }),
|
|
7173
7174
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mt-2", children: [
|
|
7174
7175
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-sm font-bold" }),
|
|
7175
|
-
onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
7176
|
+
onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkBN2CXGMO_js.getBasePrice(product), className: "text-xs text-muted-foreground line-through" })
|
|
7176
7177
|
] }),
|
|
7177
7178
|
swatches.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1.5 mt-2.5", children: swatches.map((name) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7178
7179
|
"span",
|
|
@@ -7189,9 +7190,9 @@ function RetailProductCard({
|
|
|
7189
7190
|
function PriceRange({ product, currency, className }) {
|
|
7190
7191
|
const context = useOptionalCimplify();
|
|
7191
7192
|
const resolvedCurrency = currency ?? context?.displayCurrency ?? "USD";
|
|
7192
|
-
const range =
|
|
7193
|
+
const range = chunkBN2CXGMO_js.getPriceRange(product);
|
|
7193
7194
|
if (!range) return null;
|
|
7194
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-price-range": true, className, children:
|
|
7195
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-price-range": true, className, children: chunkBN2CXGMO_js.formatPriceRange(range.min, range.max, resolvedCurrency) });
|
|
7195
7196
|
}
|
|
7196
7197
|
function WholesaleProductCard({
|
|
7197
7198
|
product,
|
|
@@ -7280,8 +7281,8 @@ function BundleProductCard({
|
|
|
7280
7281
|
const image = product.image_url || product.images?.[0] || "";
|
|
7281
7282
|
const components = product.components || [];
|
|
7282
7283
|
const componentCount = components.length;
|
|
7283
|
-
const onSale =
|
|
7284
|
-
const discount =
|
|
7284
|
+
const onSale = chunkBN2CXGMO_js.isOnSale(product);
|
|
7285
|
+
const discount = chunkBN2CXGMO_js.getDiscountPercentage(product);
|
|
7285
7286
|
const hasVariantChoice = components.some((c) => c.allow_variant_choice);
|
|
7286
7287
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
7287
7288
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "square", renderImage, children: [
|
|
@@ -7308,7 +7309,7 @@ function BundleProductCard({
|
|
|
7308
7309
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mt-2.5", children: [
|
|
7309
7310
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-sm font-bold" }),
|
|
7310
7311
|
onSale && product.bundle_price && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7311
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
7312
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkBN2CXGMO_js.getBasePrice(product), className: "text-xs text-muted-foreground line-through" }),
|
|
7312
7313
|
discount != null && discount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] font-semibold text-emerald-600", children: [
|
|
7313
7314
|
"Save ",
|
|
7314
7315
|
discount,
|
|
@@ -8220,7 +8221,7 @@ function SearchInput({
|
|
|
8220
8221
|
}
|
|
8221
8222
|
),
|
|
8222
8223
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-name": true, className: classNames?.resultName, style: { flex: 1, textAlign: "left" }, children: product.name }),
|
|
8223
|
-
product.default_price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-price": true, className: classNames?.resultPrice, style: { flexShrink: 0 }, children:
|
|
8224
|
+
product.default_price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-price": true, className: classNames?.resultPrice, style: { flexShrink: 0 }, children: chunkBN2CXGMO_js.formatPrice(product.default_price) })
|
|
8224
8225
|
] })
|
|
8225
8226
|
},
|
|
8226
8227
|
product.id
|
|
@@ -8714,19 +8715,19 @@ function OrderSummary({
|
|
|
8714
8715
|
order.customer_notes.map((note, index) => /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-order-note": true, children: note }, index))
|
|
8715
8716
|
] }),
|
|
8716
8717
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-totals": true, className: classNames?.totals, children: [
|
|
8717
|
-
order.total_discount != null &&
|
|
8718
|
+
order.total_discount != null && chunkBN2CXGMO_js.parsePrice(order.total_discount) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-discount": true, children: [
|
|
8718
8719
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Discount" }),
|
|
8719
8720
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.total_discount, prefix: "-" })
|
|
8720
8721
|
] }),
|
|
8721
|
-
order.delivery_fee != null &&
|
|
8722
|
+
order.delivery_fee != null && chunkBN2CXGMO_js.parsePrice(order.delivery_fee) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-delivery-fee": true, children: [
|
|
8722
8723
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Delivery fee" }),
|
|
8723
8724
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.delivery_fee })
|
|
8724
8725
|
] }),
|
|
8725
|
-
order.service_charge != null &&
|
|
8726
|
+
order.service_charge != null && chunkBN2CXGMO_js.parsePrice(order.service_charge) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-service-charge": true, children: [
|
|
8726
8727
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Service charge" }),
|
|
8727
8728
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.service_charge })
|
|
8728
8729
|
] }),
|
|
8729
|
-
order.tax != null &&
|
|
8730
|
+
order.tax != null && chunkBN2CXGMO_js.parsePrice(order.tax) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-tax": true, children: [
|
|
8730
8731
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Tax" }),
|
|
8731
8732
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.tax })
|
|
8732
8733
|
] }),
|
|
@@ -10015,7 +10016,7 @@ function DefaultProductLayout({
|
|
|
10015
10016
|
}) {
|
|
10016
10017
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
10017
10018
|
const hasRange = product.quantity_pricing && product.quantity_pricing.length > 1 || product.variants && product.variants.length > 1;
|
|
10018
|
-
const onSale =
|
|
10019
|
+
const onSale = chunkBN2CXGMO_js.isOnSale(product);
|
|
10019
10020
|
const hasPhysicalDetails = product.sku || product.vendor || product.material;
|
|
10020
10021
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "default", className: cn("space-y-8", className), children: [
|
|
10021
10022
|
renderBreadcrumb?.(product),
|
|
@@ -10037,10 +10038,10 @@ function DefaultProductLayout({
|
|
|
10037
10038
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { "data-cimplify-product-layout-name": true, className: "text-3xl lg:text-4xl font-extrabold tracking-tight", children: product.name }),
|
|
10038
10039
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-baseline gap-3", children: hasRange ? /* @__PURE__ */ jsxRuntime.jsx(PriceRange, { product, className: "text-2xl font-extrabold" }) : onSale ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10039
10040
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-2xl font-extrabold" }),
|
|
10040
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
10041
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkBN2CXGMO_js.getBasePrice(product), className: "text-lg text-muted-foreground line-through" }),
|
|
10041
10042
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-bold text-destructive bg-destructive/10 px-2 py-0.5", children: [
|
|
10042
10043
|
"Save ",
|
|
10043
|
-
|
|
10044
|
+
chunkBN2CXGMO_js.getDiscountPercentage(product),
|
|
10044
10045
|
"%"
|
|
10045
10046
|
] })
|
|
10046
10047
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-2xl font-semibold" }) }),
|
|
@@ -10259,7 +10260,7 @@ function ServiceProductLayout({
|
|
|
10259
10260
|
}) {
|
|
10260
10261
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
10261
10262
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
10262
|
-
const depositAmount = hasDeposit ?
|
|
10263
|
+
const depositAmount = hasDeposit ? chunkBN2CXGMO_js.parsePrice(product.deposit_amount) : 0;
|
|
10263
10264
|
const cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
|
|
10264
10265
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "service", className: cn("space-y-8", className), children: [
|
|
10265
10266
|
renderBreadcrumb?.(product),
|
|
@@ -10327,7 +10328,7 @@ function ServiceProductLayout({
|
|
|
10327
10328
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, className: "font-medium text-foreground" }),
|
|
10328
10329
|
" deposit charged at booking"
|
|
10329
10330
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10330
|
-
|
|
10331
|
+
chunkBN2CXGMO_js.parsePrice(product.deposit_amount),
|
|
10331
10332
|
"% deposit charged at booking"
|
|
10332
10333
|
] }) })
|
|
10333
10334
|
] })
|
|
@@ -10486,13 +10487,13 @@ function BundleProductLayout({
|
|
|
10486
10487
|
}) {
|
|
10487
10488
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
10488
10489
|
const components = product.components || [];
|
|
10489
|
-
const onSale =
|
|
10490
|
-
const discount =
|
|
10490
|
+
const onSale = chunkBN2CXGMO_js.isOnSale(product);
|
|
10491
|
+
const discount = chunkBN2CXGMO_js.getDiscountPercentage(product);
|
|
10491
10492
|
const baseTotal = components.reduce(
|
|
10492
|
-
(sum, c) => sum +
|
|
10493
|
+
(sum, c) => sum + chunkBN2CXGMO_js.parsePrice(c.effective_price ?? 0) * (c.quantity ?? 1),
|
|
10493
10494
|
0
|
|
10494
10495
|
);
|
|
10495
|
-
const bundlePrice =
|
|
10496
|
+
const bundlePrice = chunkBN2CXGMO_js.parsePrice(product.default_price);
|
|
10496
10497
|
const savings = baseTotal > bundlePrice ? baseTotal - bundlePrice : 0;
|
|
10497
10498
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "bundle", className: cn("space-y-8", className), children: [
|
|
10498
10499
|
renderBreadcrumb?.(product),
|
|
@@ -10984,7 +10985,7 @@ function CartDrawer({
|
|
|
10984
10985
|
}) {
|
|
10985
10986
|
const { isOpen, close } = useCartDrawer();
|
|
10986
10987
|
const cart = useCart();
|
|
10987
|
-
const subtotalNum =
|
|
10988
|
+
const subtotalNum = chunkBN2CXGMO_js.parsePrice(cart.subtotal);
|
|
10988
10989
|
const animatedSubtotal = useAnimatedNumber(subtotalNum);
|
|
10989
10990
|
React10.useEffect(() => {
|
|
10990
10991
|
if (!isOpen) return;
|
|
@@ -11378,9 +11379,9 @@ function CatalogueCollectionLayout({
|
|
|
11378
11379
|
result = result.filter((p) => p.tags?.includes(activeCategory));
|
|
11379
11380
|
}
|
|
11380
11381
|
if (sortBy === "price-asc") {
|
|
11381
|
-
result = [...result].sort((a, b) =>
|
|
11382
|
+
result = [...result].sort((a, b) => chunkBN2CXGMO_js.parsePrice(a.default_price) - chunkBN2CXGMO_js.parsePrice(b.default_price));
|
|
11382
11383
|
} else if (sortBy === "price-desc") {
|
|
11383
|
-
result = [...result].sort((a, b) =>
|
|
11384
|
+
result = [...result].sort((a, b) => chunkBN2CXGMO_js.parsePrice(b.default_price) - chunkBN2CXGMO_js.parsePrice(a.default_price));
|
|
11384
11385
|
} else if (sortBy === "name") {
|
|
11385
11386
|
result = [...result].sort((a, b) => a.name.localeCompare(b.name));
|
|
11386
11387
|
}
|
package/dist/react.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { DURATION_UNIT, getVariantDisplayName, INPUT_FIELD_TYPE, PRODUCT_TYPE, RENDER_HINT } from './chunk-IRJFDKFV.mjs';
|
|
3
3
|
export { getVariantDisplayName } from './chunk-IRJFDKFV.mjs';
|
|
4
|
-
import { createCimplifyClient } from './chunk-
|
|
5
|
-
import { ELEMENT_TYPES, EVENT_TYPES } from './chunk-
|
|
6
|
-
import {
|
|
4
|
+
import { createCimplifyClient } from './chunk-5OK3YDZC.mjs';
|
|
5
|
+
import { ELEMENT_TYPES, EVENT_TYPES } from './chunk-XZPO5GEM.mjs';
|
|
6
|
+
import { formatPrice, parsePrice, getUnitPriceAtQuantity, isOnSale, getDiscountPercentage, getBasePrice, getPriceRange, formatPriceRange } from './chunk-NRT6PVW5.mjs';
|
|
7
|
+
import { isSupportedCurrency } from './chunk-XPXAZXF2.mjs';
|
|
7
8
|
import React10, { createContext, useRef, useState, useCallback, useEffect, useContext, useMemo, useId, useSyncExternalStore } from 'react';
|
|
8
9
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
9
10
|
import { clsx } from 'clsx';
|