@cimplify/sdk 0.46.1 → 0.46.2
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 +3 -3
- package/dist/advanced.d.ts +3 -3
- package/dist/advanced.js +22 -22
- package/dist/advanced.mjs +3 -3
- package/dist/{chunk-5LZNTG4V.mjs → chunk-632JEJUS.mjs} +1 -1
- package/dist/{chunk-AUS4B7PA.mjs → chunk-6HYKWYUF.mjs} +2 -2
- package/dist/{chunk-Z3CHDA24.js → chunk-6RP6OPYO.js} +3 -3
- package/dist/{chunk-6V67MAWO.js → chunk-7ZACMER7.js} +22 -22
- package/dist/{chunk-UJ5BBLKL.mjs → chunk-CKRMA5F7.mjs} +2 -2
- package/dist/{chunk-4KNCSWE4.js → chunk-GEWFWQYK.js} +234 -234
- package/dist/{chunk-DETRNWHF.js → chunk-TKOTACKZ.js} +22 -0
- package/dist/{chunk-NKZ5YN5D.js → chunk-TW4OFRWV.js} +4 -4
- package/dist/{chunk-7H2DYO4T.mjs → chunk-WUIERJ6J.mjs} +2 -2
- package/dist/{chunk-7RRVM2X2.mjs → chunk-XY2DFX5K.mjs} +1 -1
- package/dist/{chunk-3HXYEK5K.mjs → chunk-Z2AYLZDF.mjs} +21 -1
- package/dist/{chunk-HNPVZGTO.js → chunk-Z2MLAIID.js} +60 -60
- package/dist/{client-D7nI2XmP.d.ts → client-B76ZNW5r.d.ts} +2 -2
- package/dist/{client-BScRT1Rz.d.mts → client-CT9NwIDX.d.mts} +2 -2
- package/dist/{client-DyrpQRza.d.mts → client-G2WCoxv2.d.mts} +2 -2
- package/dist/{client-B9r5rH3O.d.ts → client-QVINYu1X.d.ts} +2 -2
- package/dist/{index-DC_ZcSgO.d.ts → index-BAohYhdg.d.ts} +3 -3
- package/dist/{index-3C9J8Wb-.d.mts → index-Bo0NjgR6.d.mts} +3 -3
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +115 -107
- package/dist/index.mjs +4 -4
- package/dist/mock/cli.mjs +2 -0
- package/dist/mock/library.js +2 -0
- package/dist/mock/library.mjs +2 -0
- package/dist/mock/msw.js +2 -0
- package/dist/mock/msw.mjs +2 -0
- package/dist/{payment-Bse2XJ-c.d.mts → payment-9L_-GWqQ.d.mts} +1 -1
- package/dist/{payment-JcNqOf_T.d.ts → payment-_e99nSRj.d.ts} +1 -1
- package/dist/{price-YBGk5seG.d.mts → price-BjehlIhG.d.mts} +1 -1
- package/dist/{price-mHkRncgW.d.ts → price-CWQ5TQmk.d.ts} +1 -1
- package/dist/{product-DiX-HGkT.d.ts → product-C-xLzh7Q.d.mts} +16 -1
- package/dist/{product-DiX-HGkT.d.mts → product-C-xLzh7Q.d.ts} +16 -1
- package/dist/react.d.mts +4 -4
- package/dist/react.d.ts +4 -4
- package/dist/react.js +85 -85
- package/dist/react.mjs +4 -4
- package/dist/{server-Bg3VtA1D.d.ts → server-72rzvJ4Y.d.ts} +1 -1
- package/dist/{server-kakjHRgj.d.mts → server-BgccqOLT.d.mts} +1 -1
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +6 -6
- package/dist/server.mjs +4 -4
- package/dist/styles.css +1 -1
- package/dist/testing/msw.d.mts +2 -2
- package/dist/testing/msw.d.ts +2 -2
- package/dist/testing/msw.js +3 -3
- package/dist/testing/msw.mjs +2 -2
- package/dist/testing/suite.d.mts +6 -6
- package/dist/testing/suite.d.ts +6 -6
- package/dist/testing/suite.js +25 -25
- package/dist/testing/suite.mjs +6 -6
- package/dist/testing.d.mts +5 -5
- package/dist/testing.d.ts +5 -5
- package/dist/testing.js +81 -81
- package/dist/testing.mjs +7 -7
- package/dist/utils.d.mts +4 -4
- package/dist/utils.d.ts +4 -4
- package/dist/utils.js +29 -29
- package/dist/utils.mjs +2 -2
- package/package.json +1 -1
package/dist/react.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkMN4PNKJA_js = require('./chunk-MN4PNKJA.js');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
5
|
+
var chunkZ2MLAIID_js = require('./chunk-Z2MLAIID.js');
|
|
6
|
+
var chunk7ZACMER7_js = require('./chunk-7ZACMER7.js');
|
|
7
|
+
var chunk6RP6OPYO_js = require('./chunk-6RP6OPYO.js');
|
|
8
|
+
var chunkTKOTACKZ_js = require('./chunk-TKOTACKZ.js');
|
|
9
9
|
var React10 = require('react');
|
|
10
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
11
|
var clsx = require('clsx');
|
|
@@ -569,12 +569,12 @@ function attachInternalItemMetadata(item) {
|
|
|
569
569
|
return { ...item, _lineKey: lineKeyFromItem(item) };
|
|
570
570
|
}
|
|
571
571
|
function calculateLineSubtotal(item) {
|
|
572
|
-
let unitPrice =
|
|
572
|
+
let unitPrice = chunk6RP6OPYO_js.parsePrice(item.product.default_price);
|
|
573
573
|
if (item.variant?.price_adjustment) {
|
|
574
|
-
unitPrice +=
|
|
574
|
+
unitPrice += chunk6RP6OPYO_js.parsePrice(item.variant.price_adjustment);
|
|
575
575
|
}
|
|
576
576
|
for (const option of item.addOnOptions || []) {
|
|
577
|
-
if (option.default_price) unitPrice +=
|
|
577
|
+
if (option.default_price) unitPrice += chunk6RP6OPYO_js.parsePrice(option.default_price);
|
|
578
578
|
}
|
|
579
579
|
return roundMoney(unitPrice * item.quantity);
|
|
580
580
|
}
|
|
@@ -1153,7 +1153,7 @@ var DEFAULT_COUNTRY = "US";
|
|
|
1153
1153
|
function createDefaultClient() {
|
|
1154
1154
|
const processRef = globalThis.process;
|
|
1155
1155
|
const envPublicKey = processRef?.env?.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY || "";
|
|
1156
|
-
return
|
|
1156
|
+
return chunkZ2MLAIID_js.createCimplifyClient({ publicKey: envPublicKey });
|
|
1157
1157
|
}
|
|
1158
1158
|
function getStoredLocationId() {
|
|
1159
1159
|
if (typeof window === "undefined" || !window.localStorage) {
|
|
@@ -1237,7 +1237,7 @@ function CimplifyProvider({
|
|
|
1237
1237
|
const setDisplayCurrency = React10.useCallback(
|
|
1238
1238
|
(currency) => {
|
|
1239
1239
|
const normalized = currency?.trim().toUpperCase() || null;
|
|
1240
|
-
if (normalized && !
|
|
1240
|
+
if (normalized && !chunkTKOTACKZ_js.isSupportedCurrency(normalized)) {
|
|
1241
1241
|
return;
|
|
1242
1242
|
}
|
|
1243
1243
|
setDisplayCurrencyOverride(normalized);
|
|
@@ -1899,7 +1899,7 @@ function Price({ amount, currency, className, prefix }) {
|
|
|
1899
1899
|
const resolvedAmount = typeof convertedAmount === "string" ? parseFloat(convertedAmount) || 0 : convertedAmount;
|
|
1900
1900
|
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className, children: [
|
|
1901
1901
|
prefix,
|
|
1902
|
-
|
|
1902
|
+
chunk6RP6OPYO_js.formatPrice(resolvedAmount, resolvedCurrency)
|
|
1903
1903
|
] });
|
|
1904
1904
|
}
|
|
1905
1905
|
function createCachedQuery(config) {
|
|
@@ -2906,16 +2906,16 @@ function useProductPrice(input) {
|
|
|
2906
2906
|
if (bundleTotalPrice != null) {
|
|
2907
2907
|
unitPrice = bundleTotalPrice;
|
|
2908
2908
|
} else if (compositePrice) {
|
|
2909
|
-
unitPrice =
|
|
2909
|
+
unitPrice = chunk6RP6OPYO_js.parsePrice(compositePrice.final_price);
|
|
2910
2910
|
} else {
|
|
2911
|
-
unitPrice =
|
|
2911
|
+
unitPrice = chunk6RP6OPYO_js.parsePrice(product.default_price);
|
|
2912
2912
|
if (variant?.price_adjustment) {
|
|
2913
|
-
unitPrice +=
|
|
2913
|
+
unitPrice += chunk6RP6OPYO_js.parsePrice(variant.price_adjustment);
|
|
2914
2914
|
}
|
|
2915
2915
|
if (addOnOptions) {
|
|
2916
2916
|
for (const option of addOnOptions) {
|
|
2917
2917
|
if (option.default_price) {
|
|
2918
|
-
unitPrice +=
|
|
2918
|
+
unitPrice += chunk6RP6OPYO_js.parsePrice(option.default_price);
|
|
2919
2919
|
}
|
|
2920
2920
|
}
|
|
2921
2921
|
}
|
|
@@ -3659,19 +3659,19 @@ function AuthElement({
|
|
|
3659
3659
|
}, [onReady, onAuthenticated, onRequiresOtp, onError]);
|
|
3660
3660
|
React10.useEffect(() => {
|
|
3661
3661
|
if (!elements || !containerRef.current) return;
|
|
3662
|
-
const element = elements.create(
|
|
3662
|
+
const element = elements.create(chunk7ZACMER7_js.ELEMENT_TYPES.AUTH, { prefillEmail });
|
|
3663
3663
|
elementRef.current = element;
|
|
3664
|
-
element.on(
|
|
3664
|
+
element.on(chunk7ZACMER7_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
3665
3665
|
element.on(
|
|
3666
|
-
|
|
3666
|
+
chunk7ZACMER7_js.EVENT_TYPES.AUTHENTICATED,
|
|
3667
3667
|
(data) => onAuthenticatedRef.current?.(data)
|
|
3668
3668
|
);
|
|
3669
3669
|
element.on(
|
|
3670
|
-
|
|
3670
|
+
chunk7ZACMER7_js.EVENT_TYPES.REQUIRES_OTP,
|
|
3671
3671
|
(data) => onRequiresOtpRef.current?.(data)
|
|
3672
3672
|
);
|
|
3673
3673
|
element.on(
|
|
3674
|
-
|
|
3674
|
+
chunk7ZACMER7_js.EVENT_TYPES.ERROR,
|
|
3675
3675
|
(data) => onErrorRef.current?.(data)
|
|
3676
3676
|
);
|
|
3677
3677
|
element.mount(containerRef.current);
|
|
@@ -3700,15 +3700,15 @@ function AddressElement({
|
|
|
3700
3700
|
}, [onReady, onChange, onError]);
|
|
3701
3701
|
React10.useEffect(() => {
|
|
3702
3702
|
if (!elements || !containerRef.current) return;
|
|
3703
|
-
const element = elements.create(
|
|
3703
|
+
const element = elements.create(chunk7ZACMER7_js.ELEMENT_TYPES.ADDRESS, { mode });
|
|
3704
3704
|
elementRef.current = element;
|
|
3705
|
-
element.on(
|
|
3705
|
+
element.on(chunk7ZACMER7_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
3706
3706
|
element.on(
|
|
3707
|
-
|
|
3707
|
+
chunk7ZACMER7_js.EVENT_TYPES.CHANGE,
|
|
3708
3708
|
(data) => onChangeRef.current?.(data)
|
|
3709
3709
|
);
|
|
3710
3710
|
element.on(
|
|
3711
|
-
|
|
3711
|
+
chunk7ZACMER7_js.EVENT_TYPES.ERROR,
|
|
3712
3712
|
(data) => onErrorRef.current?.(data)
|
|
3713
3713
|
);
|
|
3714
3714
|
element.mount(containerRef.current);
|
|
@@ -3738,15 +3738,15 @@ function PaymentElement({
|
|
|
3738
3738
|
}, [onReady, onChange, onError]);
|
|
3739
3739
|
React10.useEffect(() => {
|
|
3740
3740
|
if (!elements || !containerRef.current) return;
|
|
3741
|
-
const element = elements.create(
|
|
3741
|
+
const element = elements.create(chunk7ZACMER7_js.ELEMENT_TYPES.PAYMENT, { amount, currency });
|
|
3742
3742
|
elementRef.current = element;
|
|
3743
|
-
element.on(
|
|
3743
|
+
element.on(chunk7ZACMER7_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
3744
3744
|
element.on(
|
|
3745
|
-
|
|
3745
|
+
chunk7ZACMER7_js.EVENT_TYPES.CHANGE,
|
|
3746
3746
|
(data) => onChangeRef.current?.(data)
|
|
3747
3747
|
);
|
|
3748
3748
|
element.on(
|
|
3749
|
-
|
|
3749
|
+
chunk7ZACMER7_js.EVENT_TYPES.ERROR,
|
|
3750
3750
|
(data) => onErrorRef.current?.(data)
|
|
3751
3751
|
);
|
|
3752
3752
|
element.mount(containerRef.current);
|
|
@@ -3902,7 +3902,7 @@ function VariantSelector({
|
|
|
3902
3902
|
if (!variants || variants.length <= 1) {
|
|
3903
3903
|
return null;
|
|
3904
3904
|
}
|
|
3905
|
-
basePrice != null ?
|
|
3905
|
+
basePrice != null ? chunk6RP6OPYO_js.parsePrice(basePrice) : 0;
|
|
3906
3906
|
if (variantAxes && variantAxes.length > 0) {
|
|
3907
3907
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-variant-selector": true, className: cn("space-y-5", className, classNames?.root), children: variantAxes.map((axis) => {
|
|
3908
3908
|
const labelId = `${idPrefix}-axis-${axis.id}`;
|
|
@@ -3978,7 +3978,7 @@ function VariantSelector({
|
|
|
3978
3978
|
className: cn("divide-y divide-border", classNames?.list),
|
|
3979
3979
|
children: variants.map((variant) => {
|
|
3980
3980
|
const isSelected = selectedVariantId === variant.id;
|
|
3981
|
-
const adjustment =
|
|
3981
|
+
const adjustment = chunk6RP6OPYO_js.parsePrice(variant.price_adjustment);
|
|
3982
3982
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3983
3983
|
radio.Radio.Root,
|
|
3984
3984
|
{
|
|
@@ -4244,16 +4244,16 @@ function BundleSelector({
|
|
|
4244
4244
|
}, [components, selections, onReady]);
|
|
4245
4245
|
const totalPrice = React10.useMemo(() => {
|
|
4246
4246
|
if (pricingType === "fixed" && bundlePrice) {
|
|
4247
|
-
return
|
|
4247
|
+
return chunk6RP6OPYO_js.parsePrice(bundlePrice);
|
|
4248
4248
|
}
|
|
4249
4249
|
const componentsTotal = components.reduce((sum, comp) => {
|
|
4250
4250
|
return sum + getComponentPrice(comp, variantChoices[comp.id]) * comp.quantity;
|
|
4251
4251
|
}, 0);
|
|
4252
4252
|
if (pricingType === "percentage_discount" && discountValue) {
|
|
4253
|
-
return componentsTotal * (1 -
|
|
4253
|
+
return componentsTotal * (1 - chunk6RP6OPYO_js.parsePrice(discountValue) / 100);
|
|
4254
4254
|
}
|
|
4255
4255
|
if (pricingType === "fixed_discount" && discountValue) {
|
|
4256
|
-
return componentsTotal -
|
|
4256
|
+
return componentsTotal - chunk6RP6OPYO_js.parsePrice(discountValue);
|
|
4257
4257
|
}
|
|
4258
4258
|
return componentsTotal;
|
|
4259
4259
|
}, [components, variantChoices, pricingType, bundlePrice, discountValue]);
|
|
@@ -4314,15 +4314,15 @@ function BundleSelector({
|
|
|
4314
4314
|
}
|
|
4315
4315
|
function getComponentPrice(component, selectedVariantId) {
|
|
4316
4316
|
if (!selectedVariantId || component.available_variants.length === 0) {
|
|
4317
|
-
return
|
|
4317
|
+
return chunk6RP6OPYO_js.parsePrice(component.effective_price);
|
|
4318
4318
|
}
|
|
4319
4319
|
if (selectedVariantId === component.variant_id) {
|
|
4320
|
-
return
|
|
4320
|
+
return chunk6RP6OPYO_js.parsePrice(component.effective_price);
|
|
4321
4321
|
}
|
|
4322
4322
|
const bakedAdj = component.variant_id ? component.available_variants.find((v) => v.id === component.variant_id) : void 0;
|
|
4323
4323
|
const selectedAdj = component.available_variants.find((v) => v.id === selectedVariantId);
|
|
4324
|
-
if (!selectedAdj) return
|
|
4325
|
-
return
|
|
4324
|
+
if (!selectedAdj) return chunk6RP6OPYO_js.parsePrice(component.effective_price);
|
|
4325
|
+
return chunk6RP6OPYO_js.parsePrice(component.effective_price) - chunk6RP6OPYO_js.parsePrice(bakedAdj?.price_adjustment ?? "0") + chunk6RP6OPYO_js.parsePrice(selectedAdj.price_adjustment);
|
|
4326
4326
|
}
|
|
4327
4327
|
function formatDuration(minutes, unit) {
|
|
4328
4328
|
if (unit === "hours" || !unit && minutes >= 60 && minutes % 60 === 0) {
|
|
@@ -4435,7 +4435,7 @@ function BundleComponentCard({
|
|
|
4435
4435
|
className: cn("mt-3 divide-y divide-border", classNames?.variantPicker),
|
|
4436
4436
|
children: component.available_variants.map((variant) => {
|
|
4437
4437
|
const isSelected = selectedVariantId === variant.id;
|
|
4438
|
-
const adjustment =
|
|
4438
|
+
const adjustment = chunk6RP6OPYO_js.parsePrice(variant.price_adjustment);
|
|
4439
4439
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4440
4440
|
radio.Radio.Root,
|
|
4441
4441
|
{
|
|
@@ -4881,7 +4881,7 @@ function CompositeSelector({
|
|
|
4881
4881
|
"data-cimplify-composite-summary": true,
|
|
4882
4882
|
className: cn("border-t border-border pt-4 space-y-1 text-sm", classNames?.summary),
|
|
4883
4883
|
children: [
|
|
4884
|
-
|
|
4884
|
+
chunk6RP6OPYO_js.parsePrice(priceResult.base_price) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4885
4885
|
"div",
|
|
4886
4886
|
{
|
|
4887
4887
|
"data-cimplify-composite-summary-line": true,
|
|
@@ -4892,7 +4892,7 @@ function CompositeSelector({
|
|
|
4892
4892
|
]
|
|
4893
4893
|
}
|
|
4894
4894
|
),
|
|
4895
|
-
|
|
4895
|
+
chunk6RP6OPYO_js.parsePrice(priceResult.components_total) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4896
4896
|
"div",
|
|
4897
4897
|
{
|
|
4898
4898
|
"data-cimplify-composite-summary-line": true,
|
|
@@ -5188,7 +5188,7 @@ function InputField({
|
|
|
5188
5188
|
onFileUpload,
|
|
5189
5189
|
classNames
|
|
5190
5190
|
}) {
|
|
5191
|
-
const hasPriceAdjustment = field.price_adjustment != null &&
|
|
5191
|
+
const hasPriceAdjustment = field.price_adjustment != null && chunk6RP6OPYO_js.parsePrice(field.price_adjustment) > 0;
|
|
5192
5192
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-customer-input": true, "data-field-type": field.field_type, className: classNames?.field, children: [
|
|
5193
5193
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-1.5", children: [
|
|
5194
5194
|
/* @__PURE__ */ jsxRuntime.jsx("label", { className: cn("text-sm font-semibold", classNames?.label), children: field.name }),
|
|
@@ -6357,18 +6357,18 @@ function ProductCustomizer({
|
|
|
6357
6357
|
}, [selectedAddOnOptionIds]);
|
|
6358
6358
|
const localTotalPrice = React10.useMemo(() => {
|
|
6359
6359
|
if (isComposite && compositePrice) {
|
|
6360
|
-
return
|
|
6360
|
+
return chunk6RP6OPYO_js.parsePrice(compositePrice.final_price) * quantity;
|
|
6361
6361
|
}
|
|
6362
6362
|
if (isBundle && bundleTotalPrice != null) {
|
|
6363
6363
|
return bundleTotalPrice * quantity;
|
|
6364
6364
|
}
|
|
6365
|
-
let price =
|
|
6365
|
+
let price = chunk6RP6OPYO_js.parsePrice(product.default_price);
|
|
6366
6366
|
if (selectedVariant?.price_adjustment) {
|
|
6367
|
-
price +=
|
|
6367
|
+
price += chunk6RP6OPYO_js.parsePrice(selectedVariant.price_adjustment);
|
|
6368
6368
|
}
|
|
6369
6369
|
for (const option of selectedAddOnOptions) {
|
|
6370
6370
|
if (option.default_price) {
|
|
6371
|
-
price +=
|
|
6371
|
+
price += chunk6RP6OPYO_js.parsePrice(option.default_price);
|
|
6372
6372
|
}
|
|
6373
6373
|
}
|
|
6374
6374
|
return price * quantity;
|
|
@@ -6417,7 +6417,7 @@ function ProductCustomizer({
|
|
|
6417
6417
|
const priceInfo = quote.quoted_total_price_info ?? quote.final_price_info;
|
|
6418
6418
|
const perUnit = priceInfo.pre_tax_price;
|
|
6419
6419
|
if (perUnit === void 0 || perUnit === null) return void 0;
|
|
6420
|
-
return
|
|
6420
|
+
return chunk6RP6OPYO_js.parsePrice(perUnit) * quantity;
|
|
6421
6421
|
}, [quote, quantity]);
|
|
6422
6422
|
const displayTotalPrice = quotedTotalPrice ?? localTotalPrice;
|
|
6423
6423
|
const handleVariantChange = React10.useCallback(
|
|
@@ -6555,7 +6555,7 @@ function ProductCustomizer({
|
|
|
6555
6555
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.deposit_amount })
|
|
6556
6556
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
6557
6557
|
"Deposit required: ",
|
|
6558
|
-
|
|
6558
|
+
chunk6RP6OPYO_js.parsePrice(product.deposit_amount),
|
|
6559
6559
|
"%"
|
|
6560
6560
|
] }) }),
|
|
6561
6561
|
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(
|
|
@@ -6616,7 +6616,7 @@ function ProductCustomizer({
|
|
|
6616
6616
|
] })
|
|
6617
6617
|
] }),
|
|
6618
6618
|
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: [
|
|
6619
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
6619
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk6RP6OPYO_js.getUnitPriceAtQuantity(product.quantity_pricing, quantity, chunk6RP6OPYO_js.parsePrice(product.default_price)), className: "font-medium text-foreground" }),
|
|
6620
6620
|
" ea."
|
|
6621
6621
|
] }),
|
|
6622
6622
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6740,7 +6740,7 @@ function CartLineItemRow({
|
|
|
6740
6740
|
const hasComposite = item.compositeSelections && item.compositeSelections.length > 0;
|
|
6741
6741
|
const hasBundle = item.bundleSelections && item.bundleSelections.length > 0;
|
|
6742
6742
|
const isOptimistic = item.isOptimistic === true;
|
|
6743
|
-
const lineTotal =
|
|
6743
|
+
const lineTotal = chunk6RP6OPYO_js.parsePrice(unitPrice) * item.quantity;
|
|
6744
6744
|
const imageUrl = item.product.image_url;
|
|
6745
6745
|
const variantLabel = item.variant ? chunkMN4PNKJA_js.getVariantDisplayName(item.variant, item.product.name) : null;
|
|
6746
6746
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -6973,15 +6973,15 @@ function CartSummary({
|
|
|
6973
6973
|
] }),
|
|
6974
6974
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: subtotal, className: "tabular-nums" })
|
|
6975
6975
|
] }),
|
|
6976
|
-
totalDiscounts != null &&
|
|
6976
|
+
totalDiscounts != null && chunk6RP6OPYO_js.parsePrice(totalDiscounts) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-discount": true, className: cn("flex items-baseline justify-between", classNames?.discount), children: [
|
|
6977
6977
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Discount" }),
|
|
6978
6978
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: totalDiscounts, prefix: "-", className: "tabular-nums text-primary" })
|
|
6979
6979
|
] }),
|
|
6980
6980
|
deliveryFee != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-delivery-fee": true, className: cn("flex items-baseline justify-between", classNames?.deliveryFee), children: [
|
|
6981
6981
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Delivery" }),
|
|
6982
|
-
|
|
6982
|
+
chunk6RP6OPYO_js.parsePrice(deliveryFee) > 0 ? /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: deliveryFee, className: "tabular-nums" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-primary", children: "Free" })
|
|
6983
6983
|
] }),
|
|
6984
|
-
serviceCharge != null &&
|
|
6984
|
+
serviceCharge != null && chunk6RP6OPYO_js.parsePrice(serviceCharge) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-service-charge": true, className: cn("flex items-baseline justify-between", classNames?.serviceCharge), children: [
|
|
6985
6985
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Service charge" }),
|
|
6986
6986
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: serviceCharge, className: "tabular-nums" })
|
|
6987
6987
|
] }),
|
|
@@ -7071,16 +7071,16 @@ function SaleBadge({
|
|
|
7071
7071
|
className,
|
|
7072
7072
|
classNames
|
|
7073
7073
|
}) {
|
|
7074
|
-
const onSale =
|
|
7074
|
+
const onSale = chunk6RP6OPYO_js.isOnSale(product);
|
|
7075
7075
|
const hasDeal = dealInfo !== void 0;
|
|
7076
7076
|
if (!hasDeal && !onSale && !label) {
|
|
7077
7077
|
return null;
|
|
7078
7078
|
}
|
|
7079
7079
|
let percentage = null;
|
|
7080
7080
|
if (hasDeal && dealInfo.benefit_type === "percentage") {
|
|
7081
|
-
percentage =
|
|
7081
|
+
percentage = chunk6RP6OPYO_js.parsePrice(dealInfo.value);
|
|
7082
7082
|
} else if (onSale) {
|
|
7083
|
-
percentage =
|
|
7083
|
+
percentage = chunk6RP6OPYO_js.getDiscountPercentage(product);
|
|
7084
7084
|
}
|
|
7085
7085
|
const badgeText = label ?? dealInfo?.label ?? (percentage != null && percentage > 0 ? `${percentage}% off` : null);
|
|
7086
7086
|
if (!badgeText) {
|
|
@@ -7099,7 +7099,7 @@ function SaleBadge({
|
|
|
7099
7099
|
"%"
|
|
7100
7100
|
] }),
|
|
7101
7101
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-label": true, className: classNames?.label, children: badgeText }),
|
|
7102
|
-
showOriginalPrice && onSale && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-original-price": true, className: classNames?.originalPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
7102
|
+
showOriginalPrice && onSale && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-original-price": true, className: classNames?.originalPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk6RP6OPYO_js.getBasePrice(product) }) })
|
|
7103
7103
|
]
|
|
7104
7104
|
}
|
|
7105
7105
|
);
|
|
@@ -7358,8 +7358,8 @@ function SoldOutOverlay() {
|
|
|
7358
7358
|
);
|
|
7359
7359
|
}
|
|
7360
7360
|
function SaleBadge2({ product }) {
|
|
7361
|
-
if (!
|
|
7362
|
-
const pct =
|
|
7361
|
+
if (!chunk6RP6OPYO_js.isOnSale(product)) return null;
|
|
7362
|
+
const pct = chunk6RP6OPYO_js.getDiscountPercentage(product);
|
|
7363
7363
|
if (!pct || pct <= 0) return null;
|
|
7364
7364
|
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: [
|
|
7365
7365
|
"-",
|
|
@@ -7452,7 +7452,7 @@ function RetailProductCard({
|
|
|
7452
7452
|
}) {
|
|
7453
7453
|
const image = product.image_url || product.images?.[0] || "";
|
|
7454
7454
|
const outOfStock = product.inventory_status?.in_stock === false;
|
|
7455
|
-
const onSale =
|
|
7455
|
+
const onSale = chunk6RP6OPYO_js.isOnSale(product);
|
|
7456
7456
|
const swatches = getColorSwatches(product);
|
|
7457
7457
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, disabled: outOfStock, className, children: [
|
|
7458
7458
|
outOfStock && /* @__PURE__ */ jsxRuntime.jsx(SoldOutOverlay, {}),
|
|
@@ -7470,7 +7470,7 @@ function RetailProductCard({
|
|
|
7470
7470
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[14.5px] font-semibold text-foreground leading-snug tracking-tight mt-1 truncate", children: product.name }),
|
|
7471
7471
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mt-2", children: [
|
|
7472
7472
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-sm font-bold" }),
|
|
7473
|
-
onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
7473
|
+
onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk6RP6OPYO_js.getBasePrice(product), className: "text-xs text-muted-foreground line-through" })
|
|
7474
7474
|
] }),
|
|
7475
7475
|
swatches.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1.5 mt-2.5", children: swatches.map((name) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7476
7476
|
"span",
|
|
@@ -7487,9 +7487,9 @@ function RetailProductCard({
|
|
|
7487
7487
|
function PriceRange({ product, currency, className }) {
|
|
7488
7488
|
const context = useOptionalCimplify();
|
|
7489
7489
|
const resolvedCurrency = currency ?? context?.displayCurrency ?? "USD";
|
|
7490
|
-
const range =
|
|
7490
|
+
const range = chunk6RP6OPYO_js.getPriceRange(product);
|
|
7491
7491
|
if (!range) return null;
|
|
7492
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-price-range": true, className, children:
|
|
7492
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-price-range": true, className, children: chunk6RP6OPYO_js.formatPriceRange(range.min, range.max, resolvedCurrency) });
|
|
7493
7493
|
}
|
|
7494
7494
|
function WholesaleProductCard({
|
|
7495
7495
|
product,
|
|
@@ -7578,8 +7578,8 @@ function BundleProductCard({
|
|
|
7578
7578
|
const image = product.image_url || product.images?.[0] || "";
|
|
7579
7579
|
const components = product.components || [];
|
|
7580
7580
|
const componentCount = components.length;
|
|
7581
|
-
const onSale =
|
|
7582
|
-
const discount =
|
|
7581
|
+
const onSale = chunk6RP6OPYO_js.isOnSale(product);
|
|
7582
|
+
const discount = chunk6RP6OPYO_js.getDiscountPercentage(product);
|
|
7583
7583
|
const hasVariantChoice = components.some((c) => c.allow_variant_choice);
|
|
7584
7584
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
7585
7585
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "square", renderImage, children: [
|
|
@@ -7606,7 +7606,7 @@ function BundleProductCard({
|
|
|
7606
7606
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mt-2.5", children: [
|
|
7607
7607
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-sm font-bold" }),
|
|
7608
7608
|
onSale && product.bundle_price && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7609
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
7609
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk6RP6OPYO_js.getBasePrice(product), className: "text-xs text-muted-foreground line-through" }),
|
|
7610
7610
|
discount != null && discount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] font-semibold text-emerald-600", children: [
|
|
7611
7611
|
"Save ",
|
|
7612
7612
|
discount,
|
|
@@ -8518,7 +8518,7 @@ function SearchInput({
|
|
|
8518
8518
|
}
|
|
8519
8519
|
),
|
|
8520
8520
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-name": true, className: classNames?.resultName, style: { flex: 1, textAlign: "left" }, children: product.name }),
|
|
8521
|
-
product.default_price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-price": true, className: classNames?.resultPrice, style: { flexShrink: 0 }, children:
|
|
8521
|
+
product.default_price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-price": true, className: classNames?.resultPrice, style: { flexShrink: 0 }, children: chunk6RP6OPYO_js.formatPrice(product.default_price) })
|
|
8522
8522
|
] })
|
|
8523
8523
|
},
|
|
8524
8524
|
product.id
|
|
@@ -9012,19 +9012,19 @@ function OrderSummary({
|
|
|
9012
9012
|
order.customer_notes.map((note, index) => /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-order-note": true, children: note }, index))
|
|
9013
9013
|
] }),
|
|
9014
9014
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-totals": true, className: classNames?.totals, children: [
|
|
9015
|
-
order.total_discount != null &&
|
|
9015
|
+
order.total_discount != null && chunk6RP6OPYO_js.parsePrice(order.total_discount) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-discount": true, children: [
|
|
9016
9016
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Discount" }),
|
|
9017
9017
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.total_discount, prefix: "-" })
|
|
9018
9018
|
] }),
|
|
9019
|
-
order.delivery_fee != null &&
|
|
9019
|
+
order.delivery_fee != null && chunk6RP6OPYO_js.parsePrice(order.delivery_fee) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-delivery-fee": true, children: [
|
|
9020
9020
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Delivery fee" }),
|
|
9021
9021
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.delivery_fee })
|
|
9022
9022
|
] }),
|
|
9023
|
-
order.service_charge != null &&
|
|
9023
|
+
order.service_charge != null && chunk6RP6OPYO_js.parsePrice(order.service_charge) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-service-charge": true, children: [
|
|
9024
9024
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Service charge" }),
|
|
9025
9025
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.service_charge })
|
|
9026
9026
|
] }),
|
|
9027
|
-
order.tax != null &&
|
|
9027
|
+
order.tax != null && chunk6RP6OPYO_js.parsePrice(order.tax) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-tax": true, children: [
|
|
9028
9028
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Tax" }),
|
|
9029
9029
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.tax })
|
|
9030
9030
|
] }),
|
|
@@ -9612,7 +9612,7 @@ function BookingPage({
|
|
|
9612
9612
|
const hasStaffStep = staff && staff.length > 0;
|
|
9613
9613
|
const depositType = product?.deposit_type;
|
|
9614
9614
|
const depositAmount = product?.deposit_amount;
|
|
9615
|
-
const hasDeposit = depositType !== void 0 && depositType !== "none" && depositAmount !== void 0 &&
|
|
9615
|
+
const hasDeposit = depositType !== void 0 && depositType !== "none" && depositAmount !== void 0 && chunk6RP6OPYO_js.parsePrice(depositAmount) !== 0;
|
|
9616
9616
|
const cancellationMinutes = product?.cancellation_window_minutes;
|
|
9617
9617
|
const noShowFee = product?.no_show_fee;
|
|
9618
9618
|
const handleSlotSelect = React10.useCallback(
|
|
@@ -9744,14 +9744,14 @@ function BookingPage({
|
|
|
9744
9744
|
service.price && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-booking-service-price": true, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: service.price }) }),
|
|
9745
9745
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-deposit-info": true, className: classNames?.depositInfo, children: [
|
|
9746
9746
|
"Deposit: ",
|
|
9747
|
-
depositType === "percentage" ? `${
|
|
9747
|
+
depositType === "percentage" ? `${chunk6RP6OPYO_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount })
|
|
9748
9748
|
] }),
|
|
9749
9749
|
cancellationMinutes !== void 0 && cancellationMinutes > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-cancellation-policy": true, className: classNames?.cancellationPolicy, children: [
|
|
9750
9750
|
"Free cancellation up to ",
|
|
9751
9751
|
cancellationMinutes >= 60 ? `${Math.floor(cancellationMinutes / 60)} hour${Math.floor(cancellationMinutes / 60) !== 1 ? "s" : ""}` : `${cancellationMinutes} minute${cancellationMinutes !== 1 ? "s" : ""}`,
|
|
9752
9752
|
" before"
|
|
9753
9753
|
] }),
|
|
9754
|
-
noShowFee !== void 0 &&
|
|
9754
|
+
noShowFee !== void 0 && chunk6RP6OPYO_js.parsePrice(noShowFee) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-no-show-fee": true, className: classNames?.cancellationPolicy, children: [
|
|
9755
9755
|
"No-show fee: ",
|
|
9756
9756
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: noShowFee })
|
|
9757
9757
|
] })
|
|
@@ -9828,7 +9828,7 @@ function BookingPage({
|
|
|
9828
9828
|
] }),
|
|
9829
9829
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-booking-summary-row": true, className: cn(classNames?.summaryRow, classNames?.depositInfo), children: [
|
|
9830
9830
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Deposit" }),
|
|
9831
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: depositType === "percentage" ? `${
|
|
9831
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: depositType === "percentage" ? `${chunk6RP6OPYO_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount }) })
|
|
9832
9832
|
] })
|
|
9833
9833
|
] }),
|
|
9834
9834
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -10492,7 +10492,7 @@ function DefaultProductLayout({
|
|
|
10492
10492
|
}) {
|
|
10493
10493
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
10494
10494
|
const hasRange = product.quantity_pricing && product.quantity_pricing.length > 1 || product.variants && product.variants.length > 1;
|
|
10495
|
-
const onSale =
|
|
10495
|
+
const onSale = chunk6RP6OPYO_js.isOnSale(product);
|
|
10496
10496
|
const hasPhysicalDetails = product.sku || product.vendor || product.material;
|
|
10497
10497
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "default", className: cn("space-y-8", className), children: [
|
|
10498
10498
|
renderBreadcrumb?.(product),
|
|
@@ -10514,10 +10514,10 @@ function DefaultProductLayout({
|
|
|
10514
10514
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { "data-cimplify-product-layout-name": true, className: "text-3xl lg:text-4xl font-extrabold tracking-tight", children: product.name }),
|
|
10515
10515
|
/* @__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: [
|
|
10516
10516
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-2xl font-extrabold" }),
|
|
10517
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
10517
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk6RP6OPYO_js.getBasePrice(product), className: "text-lg text-muted-foreground line-through" }),
|
|
10518
10518
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-bold text-destructive bg-destructive/10 px-2 py-0.5", children: [
|
|
10519
10519
|
"Save ",
|
|
10520
|
-
|
|
10520
|
+
chunk6RP6OPYO_js.getDiscountPercentage(product),
|
|
10521
10521
|
"%"
|
|
10522
10522
|
] })
|
|
10523
10523
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-2xl font-semibold" }) }),
|
|
@@ -10736,7 +10736,7 @@ function ServiceProductLayout({
|
|
|
10736
10736
|
}) {
|
|
10737
10737
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
10738
10738
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
10739
|
-
const depositAmount = hasDeposit ?
|
|
10739
|
+
const depositAmount = hasDeposit ? chunk6RP6OPYO_js.parsePrice(product.deposit_amount) : 0;
|
|
10740
10740
|
const cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
|
|
10741
10741
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "service", className: cn("space-y-8", className), children: [
|
|
10742
10742
|
renderBreadcrumb?.(product),
|
|
@@ -10804,7 +10804,7 @@ function ServiceProductLayout({
|
|
|
10804
10804
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, className: "font-medium text-foreground" }),
|
|
10805
10805
|
" deposit charged at booking"
|
|
10806
10806
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10807
|
-
|
|
10807
|
+
chunk6RP6OPYO_js.parsePrice(product.deposit_amount),
|
|
10808
10808
|
"% deposit charged at booking"
|
|
10809
10809
|
] }) })
|
|
10810
10810
|
] })
|
|
@@ -10963,13 +10963,13 @@ function BundleProductLayout({
|
|
|
10963
10963
|
}) {
|
|
10964
10964
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
10965
10965
|
const components = product.components || [];
|
|
10966
|
-
const onSale =
|
|
10967
|
-
const discount =
|
|
10966
|
+
const onSale = chunk6RP6OPYO_js.isOnSale(product);
|
|
10967
|
+
const discount = chunk6RP6OPYO_js.getDiscountPercentage(product);
|
|
10968
10968
|
const baseTotal = components.reduce(
|
|
10969
|
-
(sum, c) => sum +
|
|
10969
|
+
(sum, c) => sum + chunk6RP6OPYO_js.parsePrice(c.effective_price ?? 0) * (c.quantity ?? 1),
|
|
10970
10970
|
0
|
|
10971
10971
|
);
|
|
10972
|
-
const bundlePrice =
|
|
10972
|
+
const bundlePrice = chunk6RP6OPYO_js.parsePrice(product.default_price);
|
|
10973
10973
|
const savings = baseTotal > bundlePrice ? baseTotal - bundlePrice : 0;
|
|
10974
10974
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "bundle", className: cn("space-y-8", className), children: [
|
|
10975
10975
|
renderBreadcrumb?.(product),
|
|
@@ -11461,7 +11461,7 @@ function CartDrawer({
|
|
|
11461
11461
|
}) {
|
|
11462
11462
|
const { isOpen, close } = useCartDrawer();
|
|
11463
11463
|
const cart = useCart();
|
|
11464
|
-
const subtotalNum =
|
|
11464
|
+
const subtotalNum = chunk6RP6OPYO_js.parsePrice(cart.subtotal);
|
|
11465
11465
|
const animatedSubtotal = useAnimatedNumber(subtotalNum);
|
|
11466
11466
|
React10.useEffect(() => {
|
|
11467
11467
|
if (!isOpen) return;
|
|
@@ -11855,9 +11855,9 @@ function CatalogueCollectionLayout({
|
|
|
11855
11855
|
result = result.filter((p) => p.tags?.includes(activeCategory));
|
|
11856
11856
|
}
|
|
11857
11857
|
if (sortBy === "price-asc") {
|
|
11858
|
-
result = [...result].sort((a, b) =>
|
|
11858
|
+
result = [...result].sort((a, b) => chunk6RP6OPYO_js.parsePrice(a.default_price) - chunk6RP6OPYO_js.parsePrice(b.default_price));
|
|
11859
11859
|
} else if (sortBy === "price-desc") {
|
|
11860
|
-
result = [...result].sort((a, b) =>
|
|
11860
|
+
result = [...result].sort((a, b) => chunk6RP6OPYO_js.parsePrice(b.default_price) - chunk6RP6OPYO_js.parsePrice(a.default_price));
|
|
11861
11861
|
} else if (sortBy === "name") {
|
|
11862
11862
|
result = [...result].sort((a, b) => a.name.localeCompare(b.name));
|
|
11863
11863
|
}
|
package/dist/react.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { DURATION_UNIT, getVariantDisplayName, INPUT_FIELD_TYPE, PRODUCT_TYPE, RENDER_HINT } from './chunk-NRDRVZ62.mjs';
|
|
3
3
|
export { getVariantDisplayName } from './chunk-NRDRVZ62.mjs';
|
|
4
|
-
import { createCimplifyClient } from './chunk-
|
|
5
|
-
import { ELEMENT_TYPES, EVENT_TYPES } from './chunk-
|
|
6
|
-
import { formatPrice, parsePrice, getUnitPriceAtQuantity, isOnSale, getDiscountPercentage, getBasePrice, getPriceRange, formatPriceRange } from './chunk-
|
|
7
|
-
import { isSupportedCurrency } from './chunk-
|
|
4
|
+
import { createCimplifyClient } from './chunk-WUIERJ6J.mjs';
|
|
5
|
+
import { ELEMENT_TYPES, EVENT_TYPES } from './chunk-CKRMA5F7.mjs';
|
|
6
|
+
import { formatPrice, parsePrice, getUnitPriceAtQuantity, isOnSale, getDiscountPercentage, getBasePrice, getPriceRange, formatPriceRange } from './chunk-XY2DFX5K.mjs';
|
|
7
|
+
import { isSupportedCurrency } from './chunk-Z2AYLZDF.mjs';
|
|
8
8
|
import React10, { createContext, useRef, useState, useCallback, useEffect, useContext, useMemo, useId, useSyncExternalStore } from 'react';
|
|
9
9
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
10
10
|
import { clsx } from 'clsx';
|
package/dist/server.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as CimplifyClient } from './client-
|
|
2
|
-
export { aN as Result } from './client-
|
|
3
|
-
export {
|
|
4
|
-
import './payment-
|
|
1
|
+
import { C as CimplifyClient } from './client-G2WCoxv2.mjs';
|
|
2
|
+
export { aN as Result } from './client-G2WCoxv2.mjs';
|
|
3
|
+
export { ap as Category, h as CimplifyError, ar as Collection, X as Product, aa as ProductWithDetails } from './product-C-xLzh7Q.mjs';
|
|
4
|
+
import './payment-9L_-GWqQ.mjs';
|
|
5
5
|
|
|
6
6
|
interface ServerClientOptions {
|
|
7
7
|
/**
|
package/dist/server.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as CimplifyClient } from './client-
|
|
2
|
-
export { aN as Result } from './client-
|
|
3
|
-
export {
|
|
4
|
-
import './payment-
|
|
1
|
+
import { C as CimplifyClient } from './client-QVINYu1X.js';
|
|
2
|
+
export { aN as Result } from './client-QVINYu1X.js';
|
|
3
|
+
export { ap as Category, h as CimplifyError, ar as Collection, X as Product, aa as ProductWithDetails } from './product-C-xLzh7Q.js';
|
|
4
|
+
import './payment-_e99nSRj.js';
|
|
5
5
|
|
|
6
6
|
interface ServerClientOptions {
|
|
7
7
|
/**
|