@cimplify/sdk 0.85.0 → 0.86.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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-DU4IX2I2.mjs → chunk-A2GXDCSI.mjs} +2 -2
- package/dist/{chunk-XA3ZNR75.js → chunk-AETVRBKI.js} +1 -1
- package/dist/{chunk-GIFVSWYJ.mjs → chunk-D6JWYYTG.mjs} +2 -2
- package/dist/{chunk-A6J7W6DH.js → chunk-ESGKWRQS.js} +4 -4
- package/dist/{chunk-GFM5JW45.js → chunk-HJEKXCG2.js} +62 -62
- package/dist/{chunk-AMZXALF6.mjs → chunk-K5EN2W2Q.mjs} +1 -1
- package/dist/{chunk-TD3AY34U.mjs → chunk-KFLGQGMC.mjs} +3 -3
- package/dist/{chunk-NWUEWUX2.mjs → chunk-MRL53WP6.mjs} +2 -2
- package/dist/{chunk-7BM56JET.mjs → chunk-NN3WC7XZ.mjs} +3 -3
- package/dist/{chunk-7Y2O3E4D.js → chunk-PTPOQVXS.js} +5 -5
- package/dist/{chunk-HPN5R3K2.js → chunk-VUG4HTUM.js} +23 -23
- package/dist/{chunk-NWTCBGJ2.js → chunk-X4UNISYG.js} +4 -4
- package/dist/{client-WKKxIiF1.d.ts → client-BQSRj4iK.d.mts} +528 -539
- package/dist/{client-DLtwQ-jI.d.mts → client-BdI24jUT.d.ts} +528 -539
- package/dist/{client-BT5gaiGR.d.ts → client-CMJO_8zo.d.ts} +2 -2
- package/dist/{client-BEhIE0Dm.d.mts → client-DowGNrTh.d.mts} +2 -2
- package/dist/{index-BrC1x2kK.d.ts → index-BRwHpMY-.d.ts} +3 -3
- package/dist/{index-DZz6hdrT.d.mts → index-DLb_Ldl6.d.mts} +3 -3
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +117 -117
- package/dist/index.mjs +5 -5
- package/dist/mock/cli.mjs +2 -2
- package/dist/mock/library.js +2 -2
- package/dist/mock/library.mjs +2 -2
- package/dist/mock/msw.js +2 -2
- package/dist/mock/msw.mjs +2 -2
- package/dist/{payment-D1f3ZQPC.d.ts → payment-BA7KNBxg.d.ts} +3 -3
- package/dist/{payment-Dh-6cRcV.d.mts → payment-CFev-fOE.d.mts} +3 -3
- package/dist/{price-CQdOJoX-.d.ts → price-BNhGVB5q.d.ts} +1 -1
- package/dist/{price-4T7dlhxM.d.mts → price-nRxqVNGq.d.mts} +1 -1
- package/dist/product-BGxIfTqJ.d.mts +5400 -0
- package/dist/product-BGxIfTqJ.d.ts +5400 -0
- package/dist/react.d.mts +6 -6
- package/dist/react.d.ts +6 -6
- package/dist/react.js +139 -139
- package/dist/react.mjs +19 -19
- package/dist/{server-DjK98UW-.d.mts → server-9u0LiG5U.d.mts} +1 -1
- package/dist/{server-DvThXldo.d.ts → server-BH7DTaaz.d.ts} +1 -1
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +10 -10
- package/dist/server.mjs +4 -4
- 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 +5 -2
- package/registry/currency-selector.json +1 -1
- package/registry/digital-product-card.json +1 -1
- package/registry/digital-product-layout.json +1 -1
- package/dist/product-RJMIdCAf.d.mts +0 -1582
- package/dist/product-RJMIdCAf.d.ts +0 -1582
package/dist/react.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkIQLJJW2H_js = require('./chunk-IQLJJW2H.js');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
5
|
+
var chunkHJEKXCG2_js = require('./chunk-HJEKXCG2.js');
|
|
6
|
+
var chunkVUG4HTUM_js = require('./chunk-VUG4HTUM.js');
|
|
7
|
+
var chunkPTPOQVXS_js = require('./chunk-PTPOQVXS.js');
|
|
8
|
+
var chunkAETVRBKI_js = require('./chunk-AETVRBKI.js');
|
|
9
9
|
require('./chunk-OWW5GUSB.js');
|
|
10
10
|
var React14 = require('react');
|
|
11
11
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -598,12 +598,12 @@ function attachInternalItemMetadata(item) {
|
|
|
598
598
|
return { ...item, _lineKey: lineKeyFromItem(item) };
|
|
599
599
|
}
|
|
600
600
|
function calculateLineSubtotal(item) {
|
|
601
|
-
let unitPrice =
|
|
601
|
+
let unitPrice = chunkPTPOQVXS_js.parsePrice(item.product.default_price);
|
|
602
602
|
if (item.variant?.price_adjustment) {
|
|
603
|
-
unitPrice +=
|
|
603
|
+
unitPrice += chunkPTPOQVXS_js.parsePrice(item.variant.price_adjustment);
|
|
604
604
|
}
|
|
605
605
|
for (const option of item.addOnOptions || []) {
|
|
606
|
-
if (option.default_price) unitPrice +=
|
|
606
|
+
if (option.default_price) unitPrice += chunkPTPOQVXS_js.parsePrice(option.default_price);
|
|
607
607
|
}
|
|
608
608
|
return roundMoney(unitPrice * item.quantity);
|
|
609
609
|
}
|
|
@@ -1132,7 +1132,7 @@ var DEFAULT_COUNTRY = "US";
|
|
|
1132
1132
|
function createDefaultClient() {
|
|
1133
1133
|
const processRef = globalThis.process;
|
|
1134
1134
|
const envPublicKey = processRef?.env?.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY || "";
|
|
1135
|
-
return
|
|
1135
|
+
return chunkHJEKXCG2_js.createCimplifyClient({ publicKey: envPublicKey });
|
|
1136
1136
|
}
|
|
1137
1137
|
function getStoredLocationId() {
|
|
1138
1138
|
if (typeof window === "undefined" || !window.localStorage) {
|
|
@@ -1236,7 +1236,7 @@ function CimplifyProvider({
|
|
|
1236
1236
|
const setDisplayCurrency = React14.useCallback(
|
|
1237
1237
|
(currency) => {
|
|
1238
1238
|
const normalized = currency?.trim().toUpperCase() || null;
|
|
1239
|
-
if (normalized && !
|
|
1239
|
+
if (normalized && !chunkAETVRBKI_js.isSupportedCurrency(normalized)) {
|
|
1240
1240
|
return;
|
|
1241
1241
|
}
|
|
1242
1242
|
setDisplayCurrencyOverride(normalized);
|
|
@@ -1260,7 +1260,7 @@ function CimplifyProvider({
|
|
|
1260
1260
|
);
|
|
1261
1261
|
if (cancelled) return;
|
|
1262
1262
|
if (result.ok) {
|
|
1263
|
-
setFxRate(result.value.rate);
|
|
1263
|
+
setFxRate(Number(result.value.rate));
|
|
1264
1264
|
} else {
|
|
1265
1265
|
setFxRate(null);
|
|
1266
1266
|
}
|
|
@@ -1356,7 +1356,7 @@ function CimplifyProvider({
|
|
|
1356
1356
|
client: resolvedClient,
|
|
1357
1357
|
business,
|
|
1358
1358
|
currency: baseCurrency,
|
|
1359
|
-
country: business?.
|
|
1359
|
+
country: business?.default_country || DEFAULT_COUNTRY,
|
|
1360
1360
|
locations,
|
|
1361
1361
|
isReady,
|
|
1362
1362
|
baseCurrency,
|
|
@@ -3180,19 +3180,19 @@ function toAccountLineItem(item, currency) {
|
|
|
3180
3180
|
quantity: s.quantity,
|
|
3181
3181
|
name: s.product_name,
|
|
3182
3182
|
variantName: s.variant_name,
|
|
3183
|
-
priceLabel:
|
|
3183
|
+
priceLabel: chunkPTPOQVXS_js.parsePrice(s.unit_price) > 0 ? chunkPTPOQVXS_js.formatMoney(s.unit_price, currency) : void 0
|
|
3184
3184
|
}));
|
|
3185
3185
|
const customisations = item.composite_selections?.selections.map((s) => ({
|
|
3186
3186
|
quantity: s.quantity,
|
|
3187
3187
|
name: s.component_name,
|
|
3188
|
-
priceLabel:
|
|
3188
|
+
priceLabel: chunkPTPOQVXS_js.parsePrice(s.unit_price) > 0 ? `+${chunkPTPOQVXS_js.formatMoney(s.unit_price, currency)}` : void 0
|
|
3189
3189
|
}));
|
|
3190
3190
|
const data = {
|
|
3191
3191
|
id: item.id,
|
|
3192
3192
|
name: item.product_name ?? "Item",
|
|
3193
3193
|
imageUrl: item.image_url,
|
|
3194
3194
|
subtitle: lineSubtitle(item),
|
|
3195
|
-
priceLabel:
|
|
3195
|
+
priceLabel: chunkPTPOQVXS_js.formatMoney(item.total_price, currency),
|
|
3196
3196
|
lineType: item.line_type,
|
|
3197
3197
|
includes,
|
|
3198
3198
|
customisations,
|
|
@@ -3242,20 +3242,20 @@ var PAYMENT_TONE = {
|
|
|
3242
3242
|
function toAccountOrderView(order, opts = {}) {
|
|
3243
3243
|
const currency = order.payment.currency;
|
|
3244
3244
|
const rows = [
|
|
3245
|
-
{ label: "Subtotal", value:
|
|
3245
|
+
{ label: "Subtotal", value: chunkPTPOQVXS_js.formatMoney(order.pricing.subtotal, currency) }
|
|
3246
3246
|
];
|
|
3247
|
-
if (
|
|
3247
|
+
if (chunkPTPOQVXS_js.parsePrice(order.pricing.total_discount) > 0) {
|
|
3248
3248
|
rows.push({
|
|
3249
3249
|
label: "Discount",
|
|
3250
|
-
value: `\u2212${
|
|
3250
|
+
value: `\u2212${chunkPTPOQVXS_js.formatMoney(order.pricing.total_discount, currency)}`,
|
|
3251
3251
|
tone: "positive"
|
|
3252
3252
|
});
|
|
3253
3253
|
}
|
|
3254
|
-
if (order.pricing.tax &&
|
|
3255
|
-
rows.push({ label: "Tax", value:
|
|
3254
|
+
if (order.pricing.tax && chunkPTPOQVXS_js.parsePrice(order.pricing.tax) > 0) {
|
|
3255
|
+
rows.push({ label: "Tax", value: chunkPTPOQVXS_js.formatMoney(order.pricing.tax, currency) });
|
|
3256
3256
|
}
|
|
3257
|
-
if (order.pricing.service_charge &&
|
|
3258
|
-
rows.push({ label: "Service", value:
|
|
3257
|
+
if (order.pricing.service_charge && chunkPTPOQVXS_js.parsePrice(order.pricing.service_charge) > 0) {
|
|
3258
|
+
rows.push({ label: "Service", value: chunkPTPOQVXS_js.formatMoney(order.pricing.service_charge, currency) });
|
|
3259
3259
|
}
|
|
3260
3260
|
const placed = fmtDateTime(order.timestamps.created_at);
|
|
3261
3261
|
const placedLabel = opts.placedLabel ?? [placed && `Placed ${placed}`, `${order.items.length} item${order.items.length === 1 ? "" : "s"}`].filter(Boolean).join(" \xB7 ");
|
|
@@ -3269,7 +3269,7 @@ function toAccountOrderView(order, opts = {}) {
|
|
|
3269
3269
|
stateLabel: cap(order.payment.computed_status ?? order.payment.state),
|
|
3270
3270
|
stateTone: PAYMENT_TONE[order.payment.state] ?? "muted",
|
|
3271
3271
|
rows,
|
|
3272
|
-
total: { label: "Total", value:
|
|
3272
|
+
total: { label: "Total", value: chunkPTPOQVXS_js.formatMoney(order.pricing.total_price, currency) }
|
|
3273
3273
|
},
|
|
3274
3274
|
shipTo: order.customer.delivery_address ? { lines: order.customer.delivery_address } : void 0,
|
|
3275
3275
|
onBack: opts.onBack
|
|
@@ -3444,7 +3444,7 @@ function CimplifySignInButton({
|
|
|
3444
3444
|
const onClick = async () => {
|
|
3445
3445
|
if (busy || disabled || !signInOpts.clientId) return;
|
|
3446
3446
|
setBusy(true);
|
|
3447
|
-
await
|
|
3447
|
+
await chunkVUG4HTUM_js.startSignIn({
|
|
3448
3448
|
...signInOpts,
|
|
3449
3449
|
onSuccess: () => {
|
|
3450
3450
|
setBusy(false);
|
|
@@ -4299,7 +4299,7 @@ function Price({
|
|
|
4299
4299
|
const resolvedAmount = fxActive ? context.convertPrice(amount) : typeof amount === "string" ? parseFloat(amount) || 0 : amount;
|
|
4300
4300
|
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className, children: [
|
|
4301
4301
|
prefix,
|
|
4302
|
-
|
|
4302
|
+
chunkPTPOQVXS_js.formatPrice(resolvedAmount, resolvedCurrency)
|
|
4303
4303
|
] });
|
|
4304
4304
|
}
|
|
4305
4305
|
function createCachedQuery(config) {
|
|
@@ -5332,16 +5332,16 @@ function useProductPrice(input) {
|
|
|
5332
5332
|
if (bundleTotalPrice != null) {
|
|
5333
5333
|
unitPrice = bundleTotalPrice;
|
|
5334
5334
|
} else if (compositePrice) {
|
|
5335
|
-
unitPrice =
|
|
5335
|
+
unitPrice = chunkPTPOQVXS_js.parsePrice(compositePrice.final_price);
|
|
5336
5336
|
} else {
|
|
5337
|
-
unitPrice =
|
|
5337
|
+
unitPrice = chunkPTPOQVXS_js.parsePrice(product.default_price);
|
|
5338
5338
|
if (variant?.price_adjustment) {
|
|
5339
|
-
unitPrice +=
|
|
5339
|
+
unitPrice += chunkPTPOQVXS_js.parsePrice(variant.price_adjustment);
|
|
5340
5340
|
}
|
|
5341
5341
|
if (addOnOptions) {
|
|
5342
5342
|
for (const option of addOnOptions) {
|
|
5343
5343
|
if (option.default_price) {
|
|
5344
|
-
unitPrice +=
|
|
5344
|
+
unitPrice += chunkPTPOQVXS_js.parsePrice(option.default_price);
|
|
5345
5345
|
}
|
|
5346
5346
|
}
|
|
5347
5347
|
}
|
|
@@ -6121,15 +6121,15 @@ function AuthElement({
|
|
|
6121
6121
|
}, [onReady, onAuthenticated, onError]);
|
|
6122
6122
|
React14.useEffect(() => {
|
|
6123
6123
|
if (!elements || !containerRef.current) return;
|
|
6124
|
-
const element = elements.create(
|
|
6124
|
+
const element = elements.create(chunkVUG4HTUM_js.ELEMENT_TYPES.AUTH, { prefillEmail });
|
|
6125
6125
|
elementRef.current = element;
|
|
6126
|
-
element.on(
|
|
6126
|
+
element.on(chunkVUG4HTUM_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6127
6127
|
element.on(
|
|
6128
|
-
|
|
6128
|
+
chunkVUG4HTUM_js.EVENT_TYPES.AUTHENTICATED,
|
|
6129
6129
|
(data) => onAuthenticatedRef.current?.(data)
|
|
6130
6130
|
);
|
|
6131
6131
|
element.on(
|
|
6132
|
-
|
|
6132
|
+
chunkVUG4HTUM_js.EVENT_TYPES.ERROR,
|
|
6133
6133
|
(data) => onErrorRef.current?.(data)
|
|
6134
6134
|
);
|
|
6135
6135
|
element.mount(containerRef.current);
|
|
@@ -6158,15 +6158,15 @@ function AddressElement({
|
|
|
6158
6158
|
}, [onReady, onChange, onError]);
|
|
6159
6159
|
React14.useEffect(() => {
|
|
6160
6160
|
if (!elements || !containerRef.current) return;
|
|
6161
|
-
const element = elements.create(
|
|
6161
|
+
const element = elements.create(chunkVUG4HTUM_js.ELEMENT_TYPES.ADDRESS, { mode });
|
|
6162
6162
|
elementRef.current = element;
|
|
6163
|
-
element.on(
|
|
6163
|
+
element.on(chunkVUG4HTUM_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6164
6164
|
element.on(
|
|
6165
|
-
|
|
6165
|
+
chunkVUG4HTUM_js.EVENT_TYPES.CHANGE,
|
|
6166
6166
|
(data) => onChangeRef.current?.(data)
|
|
6167
6167
|
);
|
|
6168
6168
|
element.on(
|
|
6169
|
-
|
|
6169
|
+
chunkVUG4HTUM_js.EVENT_TYPES.ERROR,
|
|
6170
6170
|
(data) => onErrorRef.current?.(data)
|
|
6171
6171
|
);
|
|
6172
6172
|
element.mount(containerRef.current);
|
|
@@ -6196,15 +6196,15 @@ function PaymentElement({
|
|
|
6196
6196
|
}, [onReady, onChange, onError]);
|
|
6197
6197
|
React14.useEffect(() => {
|
|
6198
6198
|
if (!elements || !containerRef.current) return;
|
|
6199
|
-
const element = elements.create(
|
|
6199
|
+
const element = elements.create(chunkVUG4HTUM_js.ELEMENT_TYPES.PAYMENT, { amount, currency });
|
|
6200
6200
|
elementRef.current = element;
|
|
6201
|
-
element.on(
|
|
6201
|
+
element.on(chunkVUG4HTUM_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6202
6202
|
element.on(
|
|
6203
|
-
|
|
6203
|
+
chunkVUG4HTUM_js.EVENT_TYPES.CHANGE,
|
|
6204
6204
|
(data) => onChangeRef.current?.(data)
|
|
6205
6205
|
);
|
|
6206
6206
|
element.on(
|
|
6207
|
-
|
|
6207
|
+
chunkVUG4HTUM_js.EVENT_TYPES.ERROR,
|
|
6208
6208
|
(data) => onErrorRef.current?.(data)
|
|
6209
6209
|
);
|
|
6210
6210
|
element.mount(containerRef.current);
|
|
@@ -6361,7 +6361,7 @@ function VariantSelector({
|
|
|
6361
6361
|
if (!variants || variants.length <= 1) {
|
|
6362
6362
|
return null;
|
|
6363
6363
|
}
|
|
6364
|
-
basePrice != null ?
|
|
6364
|
+
basePrice != null ? chunkPTPOQVXS_js.parsePrice(basePrice) : 0;
|
|
6365
6365
|
if (variantAxes && variantAxes.length > 0) {
|
|
6366
6366
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-variant-selector": true, className: cn("space-y-5", className, classNames?.root), children: variantAxes.map((axis) => {
|
|
6367
6367
|
const labelId = `${idPrefix}-axis-${axis.id}`;
|
|
@@ -6467,7 +6467,7 @@ function VariantSelector({
|
|
|
6467
6467
|
className: cn("divide-y divide-border", classNames?.list),
|
|
6468
6468
|
children: variants.map((variant) => {
|
|
6469
6469
|
const isSelected = selectedVariantId === variant.id;
|
|
6470
|
-
const adjustment =
|
|
6470
|
+
const adjustment = chunkPTPOQVXS_js.parsePrice(variant.price_adjustment);
|
|
6471
6471
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6472
6472
|
radio.Radio.Root,
|
|
6473
6473
|
{
|
|
@@ -6735,16 +6735,16 @@ function BundleSelector({
|
|
|
6735
6735
|
}, [components, selections, onReady]);
|
|
6736
6736
|
const totalPrice = React14.useMemo(() => {
|
|
6737
6737
|
if (pricingType === "fixed" && bundlePrice) {
|
|
6738
|
-
return
|
|
6738
|
+
return chunkPTPOQVXS_js.parsePrice(bundlePrice);
|
|
6739
6739
|
}
|
|
6740
6740
|
const componentsTotal = components.reduce((sum, comp) => {
|
|
6741
6741
|
return sum + getComponentPrice(comp, variantChoices[comp.id]) * comp.quantity;
|
|
6742
6742
|
}, 0);
|
|
6743
6743
|
if (pricingType === "percentage_discount" && discountValue) {
|
|
6744
|
-
return componentsTotal * (1 -
|
|
6744
|
+
return componentsTotal * (1 - chunkPTPOQVXS_js.parsePrice(discountValue) / 100);
|
|
6745
6745
|
}
|
|
6746
6746
|
if (pricingType === "fixed_discount" && discountValue) {
|
|
6747
|
-
return componentsTotal -
|
|
6747
|
+
return componentsTotal - chunkPTPOQVXS_js.parsePrice(discountValue);
|
|
6748
6748
|
}
|
|
6749
6749
|
return componentsTotal;
|
|
6750
6750
|
}, [components, variantChoices, pricingType, bundlePrice, discountValue]);
|
|
@@ -6806,15 +6806,15 @@ function BundleSelector({
|
|
|
6806
6806
|
}
|
|
6807
6807
|
function getComponentPrice(component, selectedVariantId) {
|
|
6808
6808
|
if (!selectedVariantId || component.available_variants.length === 0) {
|
|
6809
|
-
return
|
|
6809
|
+
return chunkPTPOQVXS_js.parsePrice(component.effective_price);
|
|
6810
6810
|
}
|
|
6811
6811
|
if (selectedVariantId === component.variant_id) {
|
|
6812
|
-
return
|
|
6812
|
+
return chunkPTPOQVXS_js.parsePrice(component.effective_price);
|
|
6813
6813
|
}
|
|
6814
6814
|
const bakedAdj = component.variant_id ? component.available_variants.find((v) => v.id === component.variant_id) : void 0;
|
|
6815
6815
|
const selectedAdj = component.available_variants.find((v) => v.id === selectedVariantId);
|
|
6816
|
-
if (!selectedAdj) return
|
|
6817
|
-
return
|
|
6816
|
+
if (!selectedAdj) return chunkPTPOQVXS_js.parsePrice(component.effective_price);
|
|
6817
|
+
return chunkPTPOQVXS_js.parsePrice(component.effective_price) - chunkPTPOQVXS_js.parsePrice(bakedAdj?.price_adjustment ?? "0") + chunkPTPOQVXS_js.parsePrice(selectedAdj.price_adjustment);
|
|
6818
6818
|
}
|
|
6819
6819
|
function formatDuration(minutes, unit) {
|
|
6820
6820
|
if (unit === "hours" || !unit && minutes >= 60 && minutes % 60 === 0) {
|
|
@@ -6928,7 +6928,7 @@ function BundleComponentCard({
|
|
|
6928
6928
|
className: cn("mt-3 divide-y divide-border", classNames?.variantPicker),
|
|
6929
6929
|
children: component.available_variants.map((variant) => {
|
|
6930
6930
|
const isSelected = selectedVariantId === variant.id;
|
|
6931
|
-
const adjustment =
|
|
6931
|
+
const adjustment = chunkPTPOQVXS_js.parsePrice(variant.price_adjustment);
|
|
6932
6932
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6933
6933
|
radio.Radio.Root,
|
|
6934
6934
|
{
|
|
@@ -7375,7 +7375,7 @@ function CompositeSelector({
|
|
|
7375
7375
|
"data-cimplify-composite-summary": true,
|
|
7376
7376
|
className: cn("border-t border-border pt-4 space-y-1 text-sm", classNames?.summary),
|
|
7377
7377
|
children: [
|
|
7378
|
-
|
|
7378
|
+
chunkPTPOQVXS_js.parsePrice(priceResult.base_price) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7379
7379
|
"div",
|
|
7380
7380
|
{
|
|
7381
7381
|
"data-cimplify-composite-summary-line": true,
|
|
@@ -7386,7 +7386,7 @@ function CompositeSelector({
|
|
|
7386
7386
|
]
|
|
7387
7387
|
}
|
|
7388
7388
|
),
|
|
7389
|
-
|
|
7389
|
+
chunkPTPOQVXS_js.parsePrice(priceResult.components_total) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7390
7390
|
"div",
|
|
7391
7391
|
{
|
|
7392
7392
|
"data-cimplify-composite-summary-line": true,
|
|
@@ -7530,7 +7530,7 @@ function BookingSummary({
|
|
|
7530
7530
|
className,
|
|
7531
7531
|
classNames
|
|
7532
7532
|
}) {
|
|
7533
|
-
const depositValue = depositAmount != null ?
|
|
7533
|
+
const depositValue = depositAmount != null ? chunkPTPOQVXS_js.parsePrice(depositAmount) : 0;
|
|
7534
7534
|
const depositDue = depositType === "percentage" ? total * depositValue / 100 : depositType === "fixed" ? depositValue : 0;
|
|
7535
7535
|
const hasDeposit = depositDue > 0;
|
|
7536
7536
|
const balance = Math.max(0, total - depositDue);
|
|
@@ -8082,7 +8082,7 @@ function InputField({
|
|
|
8082
8082
|
currency,
|
|
8083
8083
|
classNames
|
|
8084
8084
|
}) {
|
|
8085
|
-
const hasPriceAdjustment = field.price_adjustment != null &&
|
|
8085
|
+
const hasPriceAdjustment = field.price_adjustment != null && chunkPTPOQVXS_js.parsePrice(field.price_adjustment) > 0;
|
|
8086
8086
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-customer-input": true, "data-field-type": field.field_type, className: classNames?.field, children: [
|
|
8087
8087
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-1.5", children: [
|
|
8088
8088
|
/* @__PURE__ */ jsxRuntime.jsx("label", { className: cn("text-sm font-semibold", classNames?.label), children: field.name }),
|
|
@@ -9365,7 +9365,7 @@ function ProductCustomizer({
|
|
|
9365
9365
|
const [selectedSlot, setSelectedSlot] = React14.useState(null);
|
|
9366
9366
|
const [selectedStaffId, setSelectedStaffId] = React14.useState(null);
|
|
9367
9367
|
const cart = useCart();
|
|
9368
|
-
const currency =
|
|
9368
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
9369
9369
|
const productType = product.type || "product";
|
|
9370
9370
|
const isComposite = productType === "composite";
|
|
9371
9371
|
const isBundle = productType === "bundle";
|
|
@@ -9419,18 +9419,18 @@ function ProductCustomizer({
|
|
|
9419
9419
|
}, [selectedAddOnOptionIds]);
|
|
9420
9420
|
const localTotalPrice = React14.useMemo(() => {
|
|
9421
9421
|
if (isComposite && compositePrice) {
|
|
9422
|
-
return
|
|
9422
|
+
return chunkPTPOQVXS_js.parsePrice(compositePrice.final_price) * quantity;
|
|
9423
9423
|
}
|
|
9424
9424
|
if (isBundle && bundleTotalPrice != null) {
|
|
9425
9425
|
return bundleTotalPrice * quantity;
|
|
9426
9426
|
}
|
|
9427
|
-
let price =
|
|
9427
|
+
let price = chunkPTPOQVXS_js.parsePrice(product.default_price);
|
|
9428
9428
|
if (selectedVariant?.price_adjustment) {
|
|
9429
|
-
price +=
|
|
9429
|
+
price += chunkPTPOQVXS_js.parsePrice(selectedVariant.price_adjustment);
|
|
9430
9430
|
}
|
|
9431
9431
|
for (const option of selectedAddOnOptions) {
|
|
9432
9432
|
if (option.default_price) {
|
|
9433
|
-
price +=
|
|
9433
|
+
price += chunkPTPOQVXS_js.parsePrice(option.default_price);
|
|
9434
9434
|
}
|
|
9435
9435
|
}
|
|
9436
9436
|
return price * quantity;
|
|
@@ -9479,7 +9479,7 @@ function ProductCustomizer({
|
|
|
9479
9479
|
const priceInfo = quote.quoted_total_price_info ?? quote.final_price_info;
|
|
9480
9480
|
const perUnit = priceInfo.pre_tax_price;
|
|
9481
9481
|
if (perUnit === void 0 || perUnit === null) return void 0;
|
|
9482
|
-
return
|
|
9482
|
+
return chunkPTPOQVXS_js.parsePrice(perUnit) * quantity;
|
|
9483
9483
|
}, [quote, quantity]);
|
|
9484
9484
|
const displayTotalPrice = quotedTotalPrice ?? localTotalPrice;
|
|
9485
9485
|
const handleVariantChange = React14.useCallback(
|
|
@@ -9644,7 +9644,7 @@ function ProductCustomizer({
|
|
|
9644
9644
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.deposit_amount, currency })
|
|
9645
9645
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
9646
9646
|
"Deposit required: ",
|
|
9647
|
-
|
|
9647
|
+
chunkPTPOQVXS_js.parsePrice(product.deposit_amount),
|
|
9648
9648
|
"%"
|
|
9649
9649
|
] }) }),
|
|
9650
9650
|
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(
|
|
@@ -9717,7 +9717,7 @@ function ProductCustomizer({
|
|
|
9717
9717
|
] })
|
|
9718
9718
|
] }),
|
|
9719
9719
|
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: [
|
|
9720
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
9720
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkPTPOQVXS_js.getUnitPriceAtQuantity(product.quantity_pricing, quantity, chunkPTPOQVXS_js.parsePrice(product.default_price)), currency, className: "font-medium text-foreground" }),
|
|
9721
9721
|
" ea."
|
|
9722
9722
|
] }),
|
|
9723
9723
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -10174,7 +10174,7 @@ function CartLineItemRow({
|
|
|
10174
10174
|
const hasComposite = item.compositeSelections && item.compositeSelections.length > 0;
|
|
10175
10175
|
const hasBundle = item.bundleSelections && item.bundleSelections.length > 0;
|
|
10176
10176
|
const isOptimistic = item.isOptimistic === true;
|
|
10177
|
-
const lineTotal =
|
|
10177
|
+
const lineTotal = chunkPTPOQVXS_js.parsePrice(unitPrice) * item.quantity;
|
|
10178
10178
|
const imageUrl = item.product.image_url;
|
|
10179
10179
|
const variantLabel2 = item.variant ? chunkIQLJJW2H_js.getVariantDisplayName(item.variant, item.product.name) : null;
|
|
10180
10180
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -10407,15 +10407,15 @@ function CartSummary({
|
|
|
10407
10407
|
] }),
|
|
10408
10408
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: subtotal, className: "tabular-nums" })
|
|
10409
10409
|
] }),
|
|
10410
|
-
totalDiscounts != null &&
|
|
10410
|
+
totalDiscounts != null && chunkPTPOQVXS_js.parsePrice(totalDiscounts) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-discount": true, className: cn("flex items-baseline justify-between", classNames?.discount), children: [
|
|
10411
10411
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Discount" }),
|
|
10412
10412
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: totalDiscounts, prefix: "-", className: "tabular-nums text-primary" })
|
|
10413
10413
|
] }),
|
|
10414
10414
|
deliveryFee != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-delivery-fee": true, className: cn("flex items-baseline justify-between", classNames?.deliveryFee), children: [
|
|
10415
10415
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Delivery" }),
|
|
10416
|
-
|
|
10416
|
+
chunkPTPOQVXS_js.parsePrice(deliveryFee) > 0 ? /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: deliveryFee, className: "tabular-nums" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-primary", children: "Free" })
|
|
10417
10417
|
] }),
|
|
10418
|
-
serviceCharge != null &&
|
|
10418
|
+
serviceCharge != null && chunkPTPOQVXS_js.parsePrice(serviceCharge) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-service-charge": true, className: cn("flex items-baseline justify-between", classNames?.serviceCharge), children: [
|
|
10419
10419
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Service charge" }),
|
|
10420
10420
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: serviceCharge, className: "tabular-nums" })
|
|
10421
10421
|
] }),
|
|
@@ -10505,16 +10505,16 @@ function SaleBadge({
|
|
|
10505
10505
|
className,
|
|
10506
10506
|
classNames
|
|
10507
10507
|
}) {
|
|
10508
|
-
const onSale =
|
|
10508
|
+
const onSale = chunkPTPOQVXS_js.isOnSale(product);
|
|
10509
10509
|
const hasDeal = dealInfo !== void 0;
|
|
10510
10510
|
if (!hasDeal && !onSale && !label) {
|
|
10511
10511
|
return null;
|
|
10512
10512
|
}
|
|
10513
10513
|
let percentage = null;
|
|
10514
10514
|
if (hasDeal && dealInfo.benefit_type === "percentage") {
|
|
10515
|
-
percentage =
|
|
10515
|
+
percentage = chunkPTPOQVXS_js.parsePrice(dealInfo.value);
|
|
10516
10516
|
} else if (onSale) {
|
|
10517
|
-
percentage =
|
|
10517
|
+
percentage = chunkPTPOQVXS_js.getDiscountPercentage(product);
|
|
10518
10518
|
}
|
|
10519
10519
|
const badgeText = label ?? dealInfo?.label ?? (percentage != null && percentage > 0 ? `${percentage}% off` : null);
|
|
10520
10520
|
if (!badgeText) {
|
|
@@ -10533,7 +10533,7 @@ function SaleBadge({
|
|
|
10533
10533
|
"%"
|
|
10534
10534
|
] }),
|
|
10535
10535
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-label": true, className: classNames?.label, children: badgeText }),
|
|
10536
|
-
showOriginalPrice && onSale && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-original-price": true, className: classNames?.originalPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
10536
|
+
showOriginalPrice && onSale && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-original-price": true, className: classNames?.originalPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkPTPOQVXS_js.getBasePrice(product), currency: chunkPTPOQVXS_js.getProductCurrency(product) }) })
|
|
10537
10537
|
]
|
|
10538
10538
|
}
|
|
10539
10539
|
);
|
|
@@ -10551,7 +10551,7 @@ function SalePrice({
|
|
|
10551
10551
|
if (!sale) {
|
|
10552
10552
|
return /* @__PURE__ */ jsxRuntime.jsx(Price, { amount, currency, className });
|
|
10553
10553
|
}
|
|
10554
|
-
const off = Math.round(
|
|
10554
|
+
const off = Math.round(chunkPTPOQVXS_js.parsePrice(sale.percent_off));
|
|
10555
10555
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10556
10556
|
"span",
|
|
10557
10557
|
{
|
|
@@ -10927,7 +10927,7 @@ function ProductSheet({
|
|
|
10927
10927
|
Price,
|
|
10928
10928
|
{
|
|
10929
10929
|
amount: fullProduct.default_price,
|
|
10930
|
-
currency:
|
|
10930
|
+
currency: chunkPTPOQVXS_js.getProductCurrency(fullProduct),
|
|
10931
10931
|
className: classNames?.price
|
|
10932
10932
|
}
|
|
10933
10933
|
)
|
|
@@ -11113,10 +11113,10 @@ function SoldOutOverlay() {
|
|
|
11113
11113
|
function SaleBadge2({ product }) {
|
|
11114
11114
|
let label = null;
|
|
11115
11115
|
if (product.sale) {
|
|
11116
|
-
const off = Math.round(
|
|
11116
|
+
const off = Math.round(chunkPTPOQVXS_js.parsePrice(product.sale.percent_off));
|
|
11117
11117
|
label = product.sale.badge_text ?? (off > 0 ? `-${off}%` : null);
|
|
11118
|
-
} else if (
|
|
11119
|
-
const pct =
|
|
11118
|
+
} else if (chunkPTPOQVXS_js.isOnSale(product)) {
|
|
11119
|
+
const pct = chunkPTPOQVXS_js.getDiscountPercentage(product);
|
|
11120
11120
|
label = pct && pct > 0 ? `-${pct}%` : null;
|
|
11121
11121
|
}
|
|
11122
11122
|
if (!label) return null;
|
|
@@ -11157,7 +11157,7 @@ function FoodProductCard({
|
|
|
11157
11157
|
className
|
|
11158
11158
|
}) {
|
|
11159
11159
|
const image = product.image_url || product.images?.[0] || "";
|
|
11160
|
-
const currency =
|
|
11160
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11161
11161
|
const tags = product.tags || [];
|
|
11162
11162
|
const isSignature = product.metadata?.is_signature === true;
|
|
11163
11163
|
const isNew = product.metadata?.is_new === true;
|
|
@@ -11213,9 +11213,9 @@ function RetailProductCard({
|
|
|
11213
11213
|
className
|
|
11214
11214
|
}) {
|
|
11215
11215
|
const image = product.image_url || product.images?.[0] || "";
|
|
11216
|
-
const currency =
|
|
11216
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11217
11217
|
const outOfStock = product.inventory_status?.in_stock === false;
|
|
11218
|
-
const onSale =
|
|
11218
|
+
const onSale = chunkPTPOQVXS_js.isOnSale(product);
|
|
11219
11219
|
const swatches = getColorSwatches(product);
|
|
11220
11220
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, disabled: outOfStock, className, children: [
|
|
11221
11221
|
outOfStock && /* @__PURE__ */ jsxRuntime.jsx(SoldOutOverlay, {}),
|
|
@@ -11236,7 +11236,7 @@ function RetailProductCard({
|
|
|
11236
11236
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.original, currency, className: "text-xs text-muted-foreground line-through" })
|
|
11237
11237
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11238
11238
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
|
|
11239
|
-
onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
11239
|
+
onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkPTPOQVXS_js.getBasePrice(product), currency, className: "text-xs text-muted-foreground line-through" })
|
|
11240
11240
|
] }) }),
|
|
11241
11241
|
swatches.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1.5 mt-2.5", children: swatches.map((name) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11242
11242
|
"span",
|
|
@@ -11251,10 +11251,10 @@ function RetailProductCard({
|
|
|
11251
11251
|
] });
|
|
11252
11252
|
}
|
|
11253
11253
|
function PriceRange({ product, currency, className }) {
|
|
11254
|
-
const resolvedCurrency = currency ??
|
|
11255
|
-
const range =
|
|
11254
|
+
const resolvedCurrency = currency ?? chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11255
|
+
const range = chunkPTPOQVXS_js.getPriceRange(product);
|
|
11256
11256
|
if (!range) return null;
|
|
11257
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-price-range": true, className, children:
|
|
11257
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-price-range": true, className, children: chunkPTPOQVXS_js.formatPriceRange(range.min, range.max, resolvedCurrency) });
|
|
11258
11258
|
}
|
|
11259
11259
|
function WholesaleProductCard({
|
|
11260
11260
|
product,
|
|
@@ -11264,7 +11264,7 @@ function WholesaleProductCard({
|
|
|
11264
11264
|
className
|
|
11265
11265
|
}) {
|
|
11266
11266
|
const image = product.image_url || product.images?.[0] || "";
|
|
11267
|
-
const currency =
|
|
11267
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11268
11268
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
11269
11269
|
const status = product.inventory_status;
|
|
11270
11270
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
@@ -11300,10 +11300,10 @@ function WholesaleProductCard({
|
|
|
11300
11300
|
}
|
|
11301
11301
|
var TYPE_BADGES = {
|
|
11302
11302
|
download: { label: "Download", color: "bg-sky-50 text-sky-700 border-sky-200/60" },
|
|
11303
|
-
|
|
11304
|
-
|
|
11305
|
-
|
|
11306
|
-
|
|
11303
|
+
license_key: { label: "License", color: "bg-blue-50 text-blue-700 border-blue-200/60" },
|
|
11304
|
+
ticket: { label: "Event", color: "bg-violet-50 text-violet-700 border-violet-200/60" },
|
|
11305
|
+
access_grant: { label: "Access", color: "bg-emerald-50 text-emerald-700 border-emerald-200/60" },
|
|
11306
|
+
redemption_code: { label: "Code", color: "bg-amber-50 text-amber-700 border-amber-200/60" }
|
|
11307
11307
|
};
|
|
11308
11308
|
function DigitalProductCard({
|
|
11309
11309
|
product,
|
|
@@ -11312,9 +11312,9 @@ function DigitalProductCard({
|
|
|
11312
11312
|
className
|
|
11313
11313
|
}) {
|
|
11314
11314
|
const image = product.image_url || product.images?.[0] || "";
|
|
11315
|
-
const currency =
|
|
11315
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11316
11316
|
const typeBadge = product.digital_type ? TYPE_BADGES[product.digital_type] : null;
|
|
11317
|
-
const isTicket = product.digital_type === "
|
|
11317
|
+
const isTicket = product.digital_type === "ticket";
|
|
11318
11318
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
11319
11319
|
/* @__PURE__ */ jsxRuntime.jsx(CardImage, { src: image, alt: product.name, aspectRatio: "4/3", renderImage, children: typeBadge && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `absolute top-3 left-3 text-[11px] font-semibold tracking-wide border px-2 py-0.5 rounded-md ${typeBadge.color}`, children: typeBadge.label }) }),
|
|
11320
11320
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3.5", children: [
|
|
@@ -11343,11 +11343,11 @@ function BundleProductCard({
|
|
|
11343
11343
|
className
|
|
11344
11344
|
}) {
|
|
11345
11345
|
const image = product.image_url || product.images?.[0] || "";
|
|
11346
|
-
const currency =
|
|
11346
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11347
11347
|
const components = product.components || [];
|
|
11348
11348
|
const componentCount = components.length;
|
|
11349
|
-
const onSale =
|
|
11350
|
-
const discount =
|
|
11349
|
+
const onSale = chunkPTPOQVXS_js.isOnSale(product);
|
|
11350
|
+
const discount = chunkPTPOQVXS_js.getDiscountPercentage(product);
|
|
11351
11351
|
const hasVariantChoice = components.some((c) => c.allow_variant_choice);
|
|
11352
11352
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
11353
11353
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "square", renderImage, children: [
|
|
@@ -11374,7 +11374,7 @@ function BundleProductCard({
|
|
|
11374
11374
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mt-2.5", children: [
|
|
11375
11375
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
|
|
11376
11376
|
onSale && product.bundle_price && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11377
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
11377
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkPTPOQVXS_js.getBasePrice(product), currency, className: "text-xs text-muted-foreground line-through" }),
|
|
11378
11378
|
discount != null && discount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] font-semibold text-emerald-600", children: [
|
|
11379
11379
|
"Save ",
|
|
11380
11380
|
discount,
|
|
@@ -11394,7 +11394,7 @@ function CompositeProductCard({
|
|
|
11394
11394
|
className
|
|
11395
11395
|
}) {
|
|
11396
11396
|
const image = product.image_url || product.images?.[0] || "";
|
|
11397
|
-
const currency =
|
|
11397
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11398
11398
|
const groups = product.groups || [];
|
|
11399
11399
|
const groupCount = groups.length;
|
|
11400
11400
|
groups.reduce((sum, g) => sum + g.components.length, 0);
|
|
@@ -11446,7 +11446,7 @@ function StandardServiceCard({
|
|
|
11446
11446
|
className
|
|
11447
11447
|
}) {
|
|
11448
11448
|
const image = product.image_url || product.images?.[0] || "";
|
|
11449
|
-
const currency =
|
|
11449
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11450
11450
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
11451
11451
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
11452
11452
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "16/9", renderImage, children: [
|
|
@@ -11501,7 +11501,7 @@ function CompactServiceCard({
|
|
|
11501
11501
|
className
|
|
11502
11502
|
}) {
|
|
11503
11503
|
const image = product.image_url || product.images?.[0] || "";
|
|
11504
|
-
const currency =
|
|
11504
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11505
11505
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
11506
11506
|
const hasBillingPlans = product.billing_plans && product.billing_plans.length > 0;
|
|
11507
11507
|
const href = `/products/${product.slug}`;
|
|
@@ -11550,7 +11550,7 @@ function ScheduleServiceCard({
|
|
|
11550
11550
|
className
|
|
11551
11551
|
}) {
|
|
11552
11552
|
const image = product.image_url || product.images?.[0] || "";
|
|
11553
|
-
const currency =
|
|
11553
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11554
11554
|
const href = `/products/${product.slug}`;
|
|
11555
11555
|
const durationLabel = product.duration_minutes != null ? formatDuration2(product.duration_minutes, product.duration_unit) : null;
|
|
11556
11556
|
const displaySlots = (slots || []).slice(0, 3);
|
|
@@ -11622,7 +11622,7 @@ function RentalServiceCard({
|
|
|
11622
11622
|
className
|
|
11623
11623
|
}) {
|
|
11624
11624
|
const image = product.image_url || product.images?.[0] || "";
|
|
11625
|
-
const currency =
|
|
11625
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11626
11626
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
11627
11627
|
const unit = product.duration_unit ? UNIT_LABELS2[product.duration_unit] || product.duration_unit : "day";
|
|
11628
11628
|
const status = product.inventory_status;
|
|
@@ -11692,7 +11692,7 @@ function AccommodationCard({
|
|
|
11692
11692
|
className
|
|
11693
11693
|
}) {
|
|
11694
11694
|
const image = product.image_url || product.images?.[0] || "";
|
|
11695
|
-
const currency =
|
|
11695
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11696
11696
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
11697
11697
|
const cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
|
|
11698
11698
|
const tags = product.tags || [];
|
|
@@ -11758,7 +11758,7 @@ function LeaseServiceCard({
|
|
|
11758
11758
|
className
|
|
11759
11759
|
}) {
|
|
11760
11760
|
const image = product.image_url || product.images?.[0] || "";
|
|
11761
|
-
const currency =
|
|
11761
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11762
11762
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
11763
11763
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
11764
11764
|
const unit = product.duration_unit ? UNIT_LABELS3[product.duration_unit] || product.duration_unit : "mo";
|
|
@@ -11832,7 +11832,7 @@ function SubscriptionCard({
|
|
|
11832
11832
|
className
|
|
11833
11833
|
}) {
|
|
11834
11834
|
const image = product.image_url || product.images?.[0] || "";
|
|
11835
|
-
const currency =
|
|
11835
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11836
11836
|
const plans = product.billing_plans || [];
|
|
11837
11837
|
const primaryPlan = plans[0];
|
|
11838
11838
|
const frequency = primaryPlan?.frequency ? FREQUENCY_LABELS2[primaryPlan.frequency] || `/${primaryPlan.frequency}` : "/mo";
|
|
@@ -12053,7 +12053,7 @@ function ProductCard({
|
|
|
12053
12053
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-card-body": true, className: cn("p-4 flex flex-col gap-1", classNames?.body), children: [
|
|
12054
12054
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-product-card-name": true, className: cn("font-semibold text-foreground leading-tight", classNames?.name), children: product.name }),
|
|
12055
12055
|
descriptionPreview && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-product-card-description": true, className: cn("text-sm text-muted-foreground line-clamp-2", classNames?.description), children: descriptionPreview }),
|
|
12056
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency:
|
|
12056
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency: chunkPTPOQVXS_js.getProductCurrency(product), className: cn("text-sm font-medium text-foreground mt-1", classNames?.price) })
|
|
12057
12057
|
] })
|
|
12058
12058
|
] });
|
|
12059
12059
|
})();
|
|
@@ -12345,7 +12345,7 @@ function SearchInput({
|
|
|
12345
12345
|
}
|
|
12346
12346
|
),
|
|
12347
12347
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-name": true, className: classNames?.resultName, style: { flex: 1, textAlign: "left" }, children: product.name }),
|
|
12348
|
-
product.default_price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-price": true, className: classNames?.resultPrice, style: { flexShrink: 0 }, children:
|
|
12348
|
+
product.default_price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-price": true, className: classNames?.resultPrice, style: { flexShrink: 0 }, children: chunkPTPOQVXS_js.formatPrice(product.default_price) })
|
|
12349
12349
|
] })
|
|
12350
12350
|
},
|
|
12351
12351
|
product.id
|
|
@@ -12840,19 +12840,19 @@ function OrderSummary({
|
|
|
12840
12840
|
order.customer_notes.map((note, index) => /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-order-note": true, children: note }, index))
|
|
12841
12841
|
] }),
|
|
12842
12842
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-totals": true, className: classNames?.totals, children: [
|
|
12843
|
-
order.total_discount != null &&
|
|
12843
|
+
order.total_discount != null && chunkPTPOQVXS_js.parsePrice(order.total_discount) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-discount": true, children: [
|
|
12844
12844
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Discount" }),
|
|
12845
12845
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.total_discount, prefix: "-" })
|
|
12846
12846
|
] }),
|
|
12847
|
-
order.delivery_fee != null &&
|
|
12847
|
+
order.delivery_fee != null && chunkPTPOQVXS_js.parsePrice(order.delivery_fee) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-delivery-fee": true, children: [
|
|
12848
12848
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Delivery fee" }),
|
|
12849
12849
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.delivery_fee })
|
|
12850
12850
|
] }),
|
|
12851
|
-
order.service_charge != null &&
|
|
12851
|
+
order.service_charge != null && chunkPTPOQVXS_js.parsePrice(order.service_charge) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-service-charge": true, children: [
|
|
12852
12852
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Service charge" }),
|
|
12853
12853
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.service_charge })
|
|
12854
12854
|
] }),
|
|
12855
|
-
order.tax != null &&
|
|
12855
|
+
order.tax != null && chunkPTPOQVXS_js.parsePrice(order.tax) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-tax": true, children: [
|
|
12856
12856
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Tax" }),
|
|
12857
12857
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.tax })
|
|
12858
12858
|
] }),
|
|
@@ -13382,7 +13382,7 @@ function BookingPage({
|
|
|
13382
13382
|
const hasStaffStep = staff && staff.length > 0;
|
|
13383
13383
|
const depositType = product?.deposit_type;
|
|
13384
13384
|
const depositAmount = product?.deposit_amount;
|
|
13385
|
-
const hasDeposit = depositType !== void 0 && depositType !== "none" && depositAmount !== void 0 &&
|
|
13385
|
+
const hasDeposit = depositType !== void 0 && depositType !== "none" && depositAmount !== void 0 && chunkPTPOQVXS_js.parsePrice(depositAmount) !== 0;
|
|
13386
13386
|
const cancellationMinutes = product?.cancellation_window_minutes;
|
|
13387
13387
|
const noShowFee = product?.no_show_fee;
|
|
13388
13388
|
const handleSlotSelect = React14.useCallback(
|
|
@@ -13514,14 +13514,14 @@ function BookingPage({
|
|
|
13514
13514
|
service.price && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-booking-service-price": true, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: service.price, currency }) }),
|
|
13515
13515
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-deposit-info": true, className: classNames?.depositInfo, children: [
|
|
13516
13516
|
"Deposit: ",
|
|
13517
|
-
depositType === "percentage" ? `${
|
|
13517
|
+
depositType === "percentage" ? `${chunkPTPOQVXS_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency })
|
|
13518
13518
|
] }),
|
|
13519
13519
|
cancellationMinutes !== void 0 && cancellationMinutes > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-cancellation-policy": true, className: classNames?.cancellationPolicy, children: [
|
|
13520
13520
|
"Free cancellation up to ",
|
|
13521
13521
|
cancellationMinutes >= 60 ? `${Math.floor(cancellationMinutes / 60)} hour${Math.floor(cancellationMinutes / 60) !== 1 ? "s" : ""}` : `${cancellationMinutes} minute${cancellationMinutes !== 1 ? "s" : ""}`,
|
|
13522
13522
|
" before"
|
|
13523
13523
|
] }),
|
|
13524
|
-
noShowFee !== void 0 &&
|
|
13524
|
+
noShowFee !== void 0 && chunkPTPOQVXS_js.parsePrice(noShowFee) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-no-show-fee": true, className: classNames?.cancellationPolicy, children: [
|
|
13525
13525
|
"No-show fee: ",
|
|
13526
13526
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: noShowFee, currency })
|
|
13527
13527
|
] })
|
|
@@ -13599,7 +13599,7 @@ function BookingPage({
|
|
|
13599
13599
|
] }),
|
|
13600
13600
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-booking-summary-row": true, className: cn(classNames?.summaryRow, classNames?.depositInfo), children: [
|
|
13601
13601
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Deposit" }),
|
|
13602
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: depositType === "percentage" ? `${
|
|
13602
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: depositType === "percentage" ? `${chunkPTPOQVXS_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency }) })
|
|
13603
13603
|
] })
|
|
13604
13604
|
] }),
|
|
13605
13605
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -14273,9 +14273,9 @@ function DefaultProductLayout({
|
|
|
14273
14273
|
}) {
|
|
14274
14274
|
const [selectedVariantId, setSelectedVariantId] = React14__default.default.useState();
|
|
14275
14275
|
const images = chunkIQLJJW2H_js.resolveGallery(product, selectedVariantId);
|
|
14276
|
-
const currency =
|
|
14276
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
14277
14277
|
const hasRange = product.quantity_pricing && product.quantity_pricing.length > 1 || product.variants && product.variants.length > 1;
|
|
14278
|
-
const onSale =
|
|
14278
|
+
const onSale = chunkPTPOQVXS_js.isOnSale(product);
|
|
14279
14279
|
const hasPhysicalDetails = product.sku || product.vendor || product.material;
|
|
14280
14280
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "default", className: cn("space-y-8", className), children: [
|
|
14281
14281
|
renderBreadcrumb?.(product),
|
|
@@ -14298,13 +14298,13 @@ function DefaultProductLayout({
|
|
|
14298
14298
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-baseline gap-3", children: hasRange ? /* @__PURE__ */ jsxRuntime.jsx(PriceRange, { product, currency, className: "text-2xl font-extrabold" }) : product.sale ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
14299
14299
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.price, currency, className: "text-2xl font-extrabold" }),
|
|
14300
14300
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.original, currency, className: "text-lg text-muted-foreground line-through" }),
|
|
14301
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-bold text-destructive bg-destructive/10 px-2 py-0.5", children: product.sale.badge_text ?? `${Math.round(
|
|
14301
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-bold text-destructive bg-destructive/10 px-2 py-0.5", children: product.sale.badge_text ?? `${Math.round(chunkPTPOQVXS_js.parsePrice(product.sale.percent_off))}% OFF` })
|
|
14302
14302
|
] }) : onSale ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
14303
14303
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-extrabold" }),
|
|
14304
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
14304
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkPTPOQVXS_js.getBasePrice(product), currency, className: "text-lg text-muted-foreground line-through" }),
|
|
14305
14305
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-bold text-destructive bg-destructive/10 px-2 py-0.5", children: [
|
|
14306
14306
|
"Save ",
|
|
14307
|
-
|
|
14307
|
+
chunkPTPOQVXS_js.getDiscountPercentage(product),
|
|
14308
14308
|
"%"
|
|
14309
14309
|
] })
|
|
14310
14310
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-semibold" }) }),
|
|
@@ -14366,7 +14366,7 @@ function FoodProductLayout({
|
|
|
14366
14366
|
className
|
|
14367
14367
|
}) {
|
|
14368
14368
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
14369
|
-
const currency =
|
|
14369
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
14370
14370
|
const tags = product.tags || [];
|
|
14371
14371
|
const ingredients = getMetadataStringList(product.metadata, "ingredients");
|
|
14372
14372
|
const pairings = getMetadataStringList(product.metadata, "pairings");
|
|
@@ -14441,7 +14441,7 @@ function WholesaleProductLayout({
|
|
|
14441
14441
|
className
|
|
14442
14442
|
}) {
|
|
14443
14443
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
14444
|
-
const currency =
|
|
14444
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
14445
14445
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
14446
14446
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "wholesale", className: cn("space-y-8", className), children: [
|
|
14447
14447
|
renderBreadcrumb?.(product),
|
|
@@ -14525,9 +14525,9 @@ function ServiceProductLayout({
|
|
|
14525
14525
|
className
|
|
14526
14526
|
}) {
|
|
14527
14527
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
14528
|
-
const currency =
|
|
14528
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
14529
14529
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
14530
|
-
const depositAmount = hasDeposit ?
|
|
14530
|
+
const depositAmount = hasDeposit ? chunkPTPOQVXS_js.parsePrice(product.deposit_amount) : 0;
|
|
14531
14531
|
const cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
|
|
14532
14532
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "service", className: cn("space-y-8", className), children: [
|
|
14533
14533
|
renderBreadcrumb?.(product),
|
|
@@ -14595,7 +14595,7 @@ function ServiceProductLayout({
|
|
|
14595
14595
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency, className: "font-medium text-foreground" }),
|
|
14596
14596
|
" deposit charged at booking"
|
|
14597
14597
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
14598
|
-
|
|
14598
|
+
chunkPTPOQVXS_js.parsePrice(product.deposit_amount),
|
|
14599
14599
|
"% deposit charged at booking"
|
|
14600
14600
|
] }) })
|
|
14601
14601
|
] })
|
|
@@ -14613,10 +14613,10 @@ function ServiceProductLayout({
|
|
|
14613
14613
|
}
|
|
14614
14614
|
var DIGITAL_TYPE_LABELS = {
|
|
14615
14615
|
download: "Digital download",
|
|
14616
|
-
|
|
14617
|
-
|
|
14618
|
-
|
|
14619
|
-
|
|
14616
|
+
license_key: "Software license",
|
|
14617
|
+
ticket: "Event ticket",
|
|
14618
|
+
access_grant: "Access pass",
|
|
14619
|
+
redemption_code: "Redemption code"
|
|
14620
14620
|
};
|
|
14621
14621
|
function DigitalProductLayout({
|
|
14622
14622
|
product,
|
|
@@ -14627,11 +14627,11 @@ function DigitalProductLayout({
|
|
|
14627
14627
|
className
|
|
14628
14628
|
}) {
|
|
14629
14629
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
14630
|
-
const currency =
|
|
14630
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
14631
14631
|
const typeLabel = product.digital_type ? DIGITAL_TYPE_LABELS[product.digital_type] || product.digital_type : "Digital product";
|
|
14632
|
-
const isTicket = product.digital_type === "
|
|
14633
|
-
const isAccessPass = product.digital_type === "
|
|
14634
|
-
const isDownload = product.digital_type === "download" || product.digital_type === "
|
|
14632
|
+
const isTicket = product.digital_type === "ticket";
|
|
14633
|
+
const isAccessPass = product.digital_type === "access_grant";
|
|
14634
|
+
const isDownload = product.digital_type === "download" || product.digital_type === "license_key";
|
|
14635
14635
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "digital", className: cn("space-y-8", className), children: [
|
|
14636
14636
|
renderBreadcrumb?.(product),
|
|
14637
14637
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -14754,15 +14754,15 @@ function BundleProductLayout({
|
|
|
14754
14754
|
className
|
|
14755
14755
|
}) {
|
|
14756
14756
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
14757
|
-
const currency =
|
|
14757
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
14758
14758
|
const components = product.components || [];
|
|
14759
|
-
const onSale =
|
|
14760
|
-
const discount =
|
|
14759
|
+
const onSale = chunkPTPOQVXS_js.isOnSale(product);
|
|
14760
|
+
const discount = chunkPTPOQVXS_js.getDiscountPercentage(product);
|
|
14761
14761
|
const baseTotal = components.reduce(
|
|
14762
|
-
(sum, c) => sum +
|
|
14762
|
+
(sum, c) => sum + chunkPTPOQVXS_js.parsePrice(c.effective_price ?? 0) * (c.quantity ?? 1),
|
|
14763
14763
|
0
|
|
14764
14764
|
);
|
|
14765
|
-
const bundlePrice =
|
|
14765
|
+
const bundlePrice = chunkPTPOQVXS_js.parsePrice(product.default_price);
|
|
14766
14766
|
const savings = baseTotal > bundlePrice ? baseTotal - bundlePrice : 0;
|
|
14767
14767
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "bundle", className: cn("space-y-8", className), children: [
|
|
14768
14768
|
renderBreadcrumb?.(product),
|
|
@@ -14838,7 +14838,7 @@ function CompositeProductLayout({
|
|
|
14838
14838
|
className
|
|
14839
14839
|
}) {
|
|
14840
14840
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
14841
|
-
const currency =
|
|
14841
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
14842
14842
|
const groups = product.groups || [];
|
|
14843
14843
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "composite", className: cn("space-y-8", className), children: [
|
|
14844
14844
|
renderBreadcrumb?.(product),
|
|
@@ -15261,7 +15261,7 @@ function CartDrawer({
|
|
|
15261
15261
|
}) {
|
|
15262
15262
|
const { isOpen, close } = useCartDrawer();
|
|
15263
15263
|
const cart = useCart();
|
|
15264
|
-
const subtotalNum =
|
|
15264
|
+
const subtotalNum = chunkPTPOQVXS_js.parsePrice(cart.subtotal);
|
|
15265
15265
|
const animatedSubtotal = useAnimatedNumber(subtotalNum);
|
|
15266
15266
|
React14.useEffect(() => {
|
|
15267
15267
|
if (!isOpen) return;
|
|
@@ -15655,9 +15655,9 @@ function CatalogueCollectionLayout({
|
|
|
15655
15655
|
result = result.filter((p) => p.tags?.includes(activeCategory));
|
|
15656
15656
|
}
|
|
15657
15657
|
if (sortBy === "price-asc") {
|
|
15658
|
-
result = [...result].sort((a, b) =>
|
|
15658
|
+
result = [...result].sort((a, b) => chunkPTPOQVXS_js.parsePrice(a.default_price) - chunkPTPOQVXS_js.parsePrice(b.default_price));
|
|
15659
15659
|
} else if (sortBy === "price-desc") {
|
|
15660
|
-
result = [...result].sort((a, b) =>
|
|
15660
|
+
result = [...result].sort((a, b) => chunkPTPOQVXS_js.parsePrice(b.default_price) - chunkPTPOQVXS_js.parsePrice(a.default_price));
|
|
15661
15661
|
} else if (sortBy === "name") {
|
|
15662
15662
|
result = [...result].sort((a, b) => a.name.localeCompare(b.name));
|
|
15663
15663
|
}
|
|
@@ -16694,7 +16694,7 @@ function CurrencySelector({
|
|
|
16694
16694
|
),
|
|
16695
16695
|
children: renderCurrency ? renderCurrency(currency, isActive, rate) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
16696
16696
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-currency-label": true, className: classNames?.label, children: currency }),
|
|
16697
|
-
showRate && baseCurrency && currency !== baseCurrency && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-currency-rate": true, className: classNames?.rate, children: isLoadingRates ? "..." : rate ? `1 ${baseCurrency} = ${rate.rate.toFixed(4)} ${currency}` : null })
|
|
16697
|
+
showRate && baseCurrency && currency !== baseCurrency && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-currency-rate": true, className: classNames?.rate, children: isLoadingRates ? "..." : rate ? `1 ${baseCurrency} = ${Number(rate.rate).toFixed(4)} ${currency}` : null })
|
|
16698
16698
|
] })
|
|
16699
16699
|
},
|
|
16700
16700
|
currency
|