@cimplify/sdk 0.84.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-I6RE4BKH.mjs → chunk-A2GXDCSI.mjs} +2 -2
- package/dist/{chunk-XA3ZNR75.js → chunk-AETVRBKI.js} +1 -1
- package/dist/{chunk-PLTP6HWW.mjs → chunk-D6JWYYTG.mjs} +20 -20
- package/dist/{chunk-ODEPW244.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-FKBXZ2A6.js → chunk-X4UNISYG.js} +22 -22
- package/dist/{client-CINi3Dw3.d.ts → client-BQSRj4iK.d.mts} +528 -539
- package/dist/{client-Ba4Hng9i.d.mts → client-BdI24jUT.d.ts} +528 -539
- package/dist/{client-D8AjO8jb.d.ts → client-CMJO_8zo.d.ts} +2 -2
- package/dist/{client-BjUJapti.d.mts → client-DowGNrTh.d.mts} +2 -2
- package/dist/{index-DCPxHjbj.d.ts → index-BRwHpMY-.d.ts} +3 -3
- package/dist/{index-9Bl-zBAI.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 +659 -355
- package/dist/mock/library.js +20 -20
- package/dist/mock/library.mjs +20 -20
- package/dist/mock/msw.js +20 -20
- package/dist/mock/msw.mjs +20 -20
- package/dist/{payment-BVv9leS_.d.ts → payment-BA7KNBxg.d.ts} +3 -3
- package/dist/{payment-D61iGd0o.d.mts → payment-CFev-fOE.d.mts} +3 -3
- package/dist/{price-BYWCHYO5.d.ts → price-BNhGVB5q.d.ts} +3 -1
- package/dist/{price-Cthq6nPb.d.mts → price-nRxqVNGq.d.mts} +3 -1
- package/dist/product-BGxIfTqJ.d.mts +5400 -0
- package/dist/product-BGxIfTqJ.d.ts +5400 -0
- package/dist/react.d.mts +22 -7
- package/dist/react.d.ts +22 -7
- package/dist/react.js +177 -155
- package/dist/react.mjs +57 -36
- package/dist/{server-BjQ0xWmc.d.mts → server-9u0LiG5U.d.mts} +1 -1
- package/dist/{server-DDaQIYLa.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/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 +25 -22
- 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-2MAoE0kZ.d.mts +0 -1570
- package/dist/product-2MAoE0kZ.d.ts +0 -1570
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
|
|
@@ -3442,9 +3442,9 @@ function CimplifySignInButton({
|
|
|
3442
3442
|
}) {
|
|
3443
3443
|
const [busy, setBusy] = React14.useState(false);
|
|
3444
3444
|
const onClick = async () => {
|
|
3445
|
-
if (busy || disabled) return;
|
|
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);
|
|
@@ -4155,14 +4155,13 @@ function CimplifyUserButton({
|
|
|
4155
4155
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("inline-flex items-center", className), "data-cimplify-user-button": "loading", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "size-8 rounded-full bg-muted/60 animate-pulse" }) });
|
|
4156
4156
|
}
|
|
4157
4157
|
if (!session) {
|
|
4158
|
-
if (!clientId || !redirectUri) return null;
|
|
4159
4158
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4160
4159
|
CimplifySignInButton,
|
|
4161
4160
|
{
|
|
4162
4161
|
variant: "outline",
|
|
4163
4162
|
label: signInLabel ?? "Sign in",
|
|
4164
|
-
clientId,
|
|
4165
|
-
redirectUri,
|
|
4163
|
+
clientId: clientId ?? "",
|
|
4164
|
+
redirectUri: redirectUri ?? "",
|
|
4166
4165
|
onSuccess: onSignIn,
|
|
4167
4166
|
className
|
|
4168
4167
|
}
|
|
@@ -4300,7 +4299,7 @@ function Price({
|
|
|
4300
4299
|
const resolvedAmount = fxActive ? context.convertPrice(amount) : typeof amount === "string" ? parseFloat(amount) || 0 : amount;
|
|
4301
4300
|
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className, children: [
|
|
4302
4301
|
prefix,
|
|
4303
|
-
|
|
4302
|
+
chunkPTPOQVXS_js.formatPrice(resolvedAmount, resolvedCurrency)
|
|
4304
4303
|
] });
|
|
4305
4304
|
}
|
|
4306
4305
|
function createCachedQuery(config) {
|
|
@@ -5333,16 +5332,16 @@ function useProductPrice(input) {
|
|
|
5333
5332
|
if (bundleTotalPrice != null) {
|
|
5334
5333
|
unitPrice = bundleTotalPrice;
|
|
5335
5334
|
} else if (compositePrice) {
|
|
5336
|
-
unitPrice =
|
|
5335
|
+
unitPrice = chunkPTPOQVXS_js.parsePrice(compositePrice.final_price);
|
|
5337
5336
|
} else {
|
|
5338
|
-
unitPrice =
|
|
5337
|
+
unitPrice = chunkPTPOQVXS_js.parsePrice(product.default_price);
|
|
5339
5338
|
if (variant?.price_adjustment) {
|
|
5340
|
-
unitPrice +=
|
|
5339
|
+
unitPrice += chunkPTPOQVXS_js.parsePrice(variant.price_adjustment);
|
|
5341
5340
|
}
|
|
5342
5341
|
if (addOnOptions) {
|
|
5343
5342
|
for (const option of addOnOptions) {
|
|
5344
5343
|
if (option.default_price) {
|
|
5345
|
-
unitPrice +=
|
|
5344
|
+
unitPrice += chunkPTPOQVXS_js.parsePrice(option.default_price);
|
|
5346
5345
|
}
|
|
5347
5346
|
}
|
|
5348
5347
|
}
|
|
@@ -6122,15 +6121,15 @@ function AuthElement({
|
|
|
6122
6121
|
}, [onReady, onAuthenticated, onError]);
|
|
6123
6122
|
React14.useEffect(() => {
|
|
6124
6123
|
if (!elements || !containerRef.current) return;
|
|
6125
|
-
const element = elements.create(
|
|
6124
|
+
const element = elements.create(chunkVUG4HTUM_js.ELEMENT_TYPES.AUTH, { prefillEmail });
|
|
6126
6125
|
elementRef.current = element;
|
|
6127
|
-
element.on(
|
|
6126
|
+
element.on(chunkVUG4HTUM_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6128
6127
|
element.on(
|
|
6129
|
-
|
|
6128
|
+
chunkVUG4HTUM_js.EVENT_TYPES.AUTHENTICATED,
|
|
6130
6129
|
(data) => onAuthenticatedRef.current?.(data)
|
|
6131
6130
|
);
|
|
6132
6131
|
element.on(
|
|
6133
|
-
|
|
6132
|
+
chunkVUG4HTUM_js.EVENT_TYPES.ERROR,
|
|
6134
6133
|
(data) => onErrorRef.current?.(data)
|
|
6135
6134
|
);
|
|
6136
6135
|
element.mount(containerRef.current);
|
|
@@ -6159,15 +6158,15 @@ function AddressElement({
|
|
|
6159
6158
|
}, [onReady, onChange, onError]);
|
|
6160
6159
|
React14.useEffect(() => {
|
|
6161
6160
|
if (!elements || !containerRef.current) return;
|
|
6162
|
-
const element = elements.create(
|
|
6161
|
+
const element = elements.create(chunkVUG4HTUM_js.ELEMENT_TYPES.ADDRESS, { mode });
|
|
6163
6162
|
elementRef.current = element;
|
|
6164
|
-
element.on(
|
|
6163
|
+
element.on(chunkVUG4HTUM_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6165
6164
|
element.on(
|
|
6166
|
-
|
|
6165
|
+
chunkVUG4HTUM_js.EVENT_TYPES.CHANGE,
|
|
6167
6166
|
(data) => onChangeRef.current?.(data)
|
|
6168
6167
|
);
|
|
6169
6168
|
element.on(
|
|
6170
|
-
|
|
6169
|
+
chunkVUG4HTUM_js.EVENT_TYPES.ERROR,
|
|
6171
6170
|
(data) => onErrorRef.current?.(data)
|
|
6172
6171
|
);
|
|
6173
6172
|
element.mount(containerRef.current);
|
|
@@ -6197,15 +6196,15 @@ function PaymentElement({
|
|
|
6197
6196
|
}, [onReady, onChange, onError]);
|
|
6198
6197
|
React14.useEffect(() => {
|
|
6199
6198
|
if (!elements || !containerRef.current) return;
|
|
6200
|
-
const element = elements.create(
|
|
6199
|
+
const element = elements.create(chunkVUG4HTUM_js.ELEMENT_TYPES.PAYMENT, { amount, currency });
|
|
6201
6200
|
elementRef.current = element;
|
|
6202
|
-
element.on(
|
|
6201
|
+
element.on(chunkVUG4HTUM_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6203
6202
|
element.on(
|
|
6204
|
-
|
|
6203
|
+
chunkVUG4HTUM_js.EVENT_TYPES.CHANGE,
|
|
6205
6204
|
(data) => onChangeRef.current?.(data)
|
|
6206
6205
|
);
|
|
6207
6206
|
element.on(
|
|
6208
|
-
|
|
6207
|
+
chunkVUG4HTUM_js.EVENT_TYPES.ERROR,
|
|
6209
6208
|
(data) => onErrorRef.current?.(data)
|
|
6210
6209
|
);
|
|
6211
6210
|
element.mount(containerRef.current);
|
|
@@ -6362,7 +6361,7 @@ function VariantSelector({
|
|
|
6362
6361
|
if (!variants || variants.length <= 1) {
|
|
6363
6362
|
return null;
|
|
6364
6363
|
}
|
|
6365
|
-
basePrice != null ?
|
|
6364
|
+
basePrice != null ? chunkPTPOQVXS_js.parsePrice(basePrice) : 0;
|
|
6366
6365
|
if (variantAxes && variantAxes.length > 0) {
|
|
6367
6366
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-variant-selector": true, className: cn("space-y-5", className, classNames?.root), children: variantAxes.map((axis) => {
|
|
6368
6367
|
const labelId = `${idPrefix}-axis-${axis.id}`;
|
|
@@ -6468,7 +6467,7 @@ function VariantSelector({
|
|
|
6468
6467
|
className: cn("divide-y divide-border", classNames?.list),
|
|
6469
6468
|
children: variants.map((variant) => {
|
|
6470
6469
|
const isSelected = selectedVariantId === variant.id;
|
|
6471
|
-
const adjustment =
|
|
6470
|
+
const adjustment = chunkPTPOQVXS_js.parsePrice(variant.price_adjustment);
|
|
6472
6471
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6473
6472
|
radio.Radio.Root,
|
|
6474
6473
|
{
|
|
@@ -6736,16 +6735,16 @@ function BundleSelector({
|
|
|
6736
6735
|
}, [components, selections, onReady]);
|
|
6737
6736
|
const totalPrice = React14.useMemo(() => {
|
|
6738
6737
|
if (pricingType === "fixed" && bundlePrice) {
|
|
6739
|
-
return
|
|
6738
|
+
return chunkPTPOQVXS_js.parsePrice(bundlePrice);
|
|
6740
6739
|
}
|
|
6741
6740
|
const componentsTotal = components.reduce((sum, comp) => {
|
|
6742
6741
|
return sum + getComponentPrice(comp, variantChoices[comp.id]) * comp.quantity;
|
|
6743
6742
|
}, 0);
|
|
6744
6743
|
if (pricingType === "percentage_discount" && discountValue) {
|
|
6745
|
-
return componentsTotal * (1 -
|
|
6744
|
+
return componentsTotal * (1 - chunkPTPOQVXS_js.parsePrice(discountValue) / 100);
|
|
6746
6745
|
}
|
|
6747
6746
|
if (pricingType === "fixed_discount" && discountValue) {
|
|
6748
|
-
return componentsTotal -
|
|
6747
|
+
return componentsTotal - chunkPTPOQVXS_js.parsePrice(discountValue);
|
|
6749
6748
|
}
|
|
6750
6749
|
return componentsTotal;
|
|
6751
6750
|
}, [components, variantChoices, pricingType, bundlePrice, discountValue]);
|
|
@@ -6807,15 +6806,15 @@ function BundleSelector({
|
|
|
6807
6806
|
}
|
|
6808
6807
|
function getComponentPrice(component, selectedVariantId) {
|
|
6809
6808
|
if (!selectedVariantId || component.available_variants.length === 0) {
|
|
6810
|
-
return
|
|
6809
|
+
return chunkPTPOQVXS_js.parsePrice(component.effective_price);
|
|
6811
6810
|
}
|
|
6812
6811
|
if (selectedVariantId === component.variant_id) {
|
|
6813
|
-
return
|
|
6812
|
+
return chunkPTPOQVXS_js.parsePrice(component.effective_price);
|
|
6814
6813
|
}
|
|
6815
6814
|
const bakedAdj = component.variant_id ? component.available_variants.find((v) => v.id === component.variant_id) : void 0;
|
|
6816
6815
|
const selectedAdj = component.available_variants.find((v) => v.id === selectedVariantId);
|
|
6817
|
-
if (!selectedAdj) return
|
|
6818
|
-
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);
|
|
6819
6818
|
}
|
|
6820
6819
|
function formatDuration(minutes, unit) {
|
|
6821
6820
|
if (unit === "hours" || !unit && minutes >= 60 && minutes % 60 === 0) {
|
|
@@ -6929,7 +6928,7 @@ function BundleComponentCard({
|
|
|
6929
6928
|
className: cn("mt-3 divide-y divide-border", classNames?.variantPicker),
|
|
6930
6929
|
children: component.available_variants.map((variant) => {
|
|
6931
6930
|
const isSelected = selectedVariantId === variant.id;
|
|
6932
|
-
const adjustment =
|
|
6931
|
+
const adjustment = chunkPTPOQVXS_js.parsePrice(variant.price_adjustment);
|
|
6933
6932
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6934
6933
|
radio.Radio.Root,
|
|
6935
6934
|
{
|
|
@@ -7376,7 +7375,7 @@ function CompositeSelector({
|
|
|
7376
7375
|
"data-cimplify-composite-summary": true,
|
|
7377
7376
|
className: cn("border-t border-border pt-4 space-y-1 text-sm", classNames?.summary),
|
|
7378
7377
|
children: [
|
|
7379
|
-
|
|
7378
|
+
chunkPTPOQVXS_js.parsePrice(priceResult.base_price) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7380
7379
|
"div",
|
|
7381
7380
|
{
|
|
7382
7381
|
"data-cimplify-composite-summary-line": true,
|
|
@@ -7387,7 +7386,7 @@ function CompositeSelector({
|
|
|
7387
7386
|
]
|
|
7388
7387
|
}
|
|
7389
7388
|
),
|
|
7390
|
-
|
|
7389
|
+
chunkPTPOQVXS_js.parsePrice(priceResult.components_total) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7391
7390
|
"div",
|
|
7392
7391
|
{
|
|
7393
7392
|
"data-cimplify-composite-summary-line": true,
|
|
@@ -7531,7 +7530,7 @@ function BookingSummary({
|
|
|
7531
7530
|
className,
|
|
7532
7531
|
classNames
|
|
7533
7532
|
}) {
|
|
7534
|
-
const depositValue = depositAmount != null ?
|
|
7533
|
+
const depositValue = depositAmount != null ? chunkPTPOQVXS_js.parsePrice(depositAmount) : 0;
|
|
7535
7534
|
const depositDue = depositType === "percentage" ? total * depositValue / 100 : depositType === "fixed" ? depositValue : 0;
|
|
7536
7535
|
const hasDeposit = depositDue > 0;
|
|
7537
7536
|
const balance = Math.max(0, total - depositDue);
|
|
@@ -7870,29 +7869,30 @@ function DatePicker({
|
|
|
7870
7869
|
classNames: {
|
|
7871
7870
|
months: "flex flex-col gap-3",
|
|
7872
7871
|
month: "flex flex-col gap-3",
|
|
7873
|
-
|
|
7872
|
+
month_caption: "flex items-center justify-between px-1",
|
|
7874
7873
|
caption_label: "text-sm font-semibold",
|
|
7875
7874
|
nav: "flex items-center gap-1",
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
day:
|
|
7875
|
+
button_previous: "inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted transition-colors",
|
|
7876
|
+
button_next: "inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted transition-colors",
|
|
7877
|
+
month_grid: "w-full border-collapse",
|
|
7878
|
+
weekdays: "flex",
|
|
7879
|
+
weekday: "w-9 text-center text-[10px] font-medium uppercase tracking-wider text-muted-foreground",
|
|
7880
|
+
week: "flex w-full mt-1",
|
|
7881
|
+
day: "w-9 h-9 text-center text-sm p-0 relative",
|
|
7882
|
+
day_button: cn(
|
|
7883
7883
|
"inline-flex h-9 w-9 items-center justify-center rounded-md text-sm font-normal text-foreground hover:bg-muted transition-colors",
|
|
7884
7884
|
"aria-selected:bg-foreground aria-selected:text-background aria-selected:hover:bg-foreground/90"
|
|
7885
7885
|
),
|
|
7886
|
-
|
|
7886
|
+
selected: cn(
|
|
7887
7887
|
"bg-foreground text-background hover:bg-foreground/90 focus:bg-foreground",
|
|
7888
7888
|
classNames?.daySelected
|
|
7889
7889
|
),
|
|
7890
|
-
|
|
7890
|
+
today: cn(
|
|
7891
7891
|
"ring-1 ring-inset ring-primary/40",
|
|
7892
7892
|
classNames?.dayToday
|
|
7893
7893
|
),
|
|
7894
|
-
|
|
7895
|
-
|
|
7894
|
+
outside: "text-muted-foreground/50",
|
|
7895
|
+
disabled: cn(
|
|
7896
7896
|
"text-muted-foreground/40 cursor-not-allowed line-through",
|
|
7897
7897
|
classNames?.dayDisabled
|
|
7898
7898
|
)
|
|
@@ -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
|
{
|
|
@@ -10616,6 +10616,27 @@ function SaleCountdown({
|
|
|
10616
10616
|
label
|
|
10617
10617
|
] });
|
|
10618
10618
|
}
|
|
10619
|
+
function SaleTeaser({
|
|
10620
|
+
upcoming,
|
|
10621
|
+
children,
|
|
10622
|
+
className
|
|
10623
|
+
}) {
|
|
10624
|
+
const [mounted, setMounted] = React14.useState(false);
|
|
10625
|
+
React14.useEffect(() => setMounted(true), []);
|
|
10626
|
+
if (!upcoming || !mounted) {
|
|
10627
|
+
return null;
|
|
10628
|
+
}
|
|
10629
|
+
const at = Date.parse(upcoming.starts_at);
|
|
10630
|
+
if (!Number.isFinite(at)) {
|
|
10631
|
+
return null;
|
|
10632
|
+
}
|
|
10633
|
+
const when = new Date(at).toLocaleDateString(void 0, {
|
|
10634
|
+
weekday: "short",
|
|
10635
|
+
month: "short",
|
|
10636
|
+
day: "numeric"
|
|
10637
|
+
});
|
|
10638
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-teaser": true, className, children: children ? children({ when }) : upcoming.badge_text ?? `Back ${when}` });
|
|
10639
|
+
}
|
|
10619
10640
|
var ALLOWED_EMBED_HOSTS = /* @__PURE__ */ new Set([
|
|
10620
10641
|
"www.youtube.com",
|
|
10621
10642
|
"youtube.com",
|
|
@@ -10906,7 +10927,7 @@ function ProductSheet({
|
|
|
10906
10927
|
Price,
|
|
10907
10928
|
{
|
|
10908
10929
|
amount: fullProduct.default_price,
|
|
10909
|
-
currency:
|
|
10930
|
+
currency: chunkPTPOQVXS_js.getProductCurrency(fullProduct),
|
|
10910
10931
|
className: classNames?.price
|
|
10911
10932
|
}
|
|
10912
10933
|
)
|
|
@@ -11092,10 +11113,10 @@ function SoldOutOverlay() {
|
|
|
11092
11113
|
function SaleBadge2({ product }) {
|
|
11093
11114
|
let label = null;
|
|
11094
11115
|
if (product.sale) {
|
|
11095
|
-
const off = Math.round(
|
|
11116
|
+
const off = Math.round(chunkPTPOQVXS_js.parsePrice(product.sale.percent_off));
|
|
11096
11117
|
label = product.sale.badge_text ?? (off > 0 ? `-${off}%` : null);
|
|
11097
|
-
} else if (
|
|
11098
|
-
const pct =
|
|
11118
|
+
} else if (chunkPTPOQVXS_js.isOnSale(product)) {
|
|
11119
|
+
const pct = chunkPTPOQVXS_js.getDiscountPercentage(product);
|
|
11099
11120
|
label = pct && pct > 0 ? `-${pct}%` : null;
|
|
11100
11121
|
}
|
|
11101
11122
|
if (!label) return null;
|
|
@@ -11136,7 +11157,7 @@ function FoodProductCard({
|
|
|
11136
11157
|
className
|
|
11137
11158
|
}) {
|
|
11138
11159
|
const image = product.image_url || product.images?.[0] || "";
|
|
11139
|
-
const currency =
|
|
11160
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11140
11161
|
const tags = product.tags || [];
|
|
11141
11162
|
const isSignature = product.metadata?.is_signature === true;
|
|
11142
11163
|
const isNew = product.metadata?.is_new === true;
|
|
@@ -11192,9 +11213,9 @@ function RetailProductCard({
|
|
|
11192
11213
|
className
|
|
11193
11214
|
}) {
|
|
11194
11215
|
const image = product.image_url || product.images?.[0] || "";
|
|
11195
|
-
const currency =
|
|
11216
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11196
11217
|
const outOfStock = product.inventory_status?.in_stock === false;
|
|
11197
|
-
const onSale =
|
|
11218
|
+
const onSale = chunkPTPOQVXS_js.isOnSale(product);
|
|
11198
11219
|
const swatches = getColorSwatches(product);
|
|
11199
11220
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, disabled: outOfStock, className, children: [
|
|
11200
11221
|
outOfStock && /* @__PURE__ */ jsxRuntime.jsx(SoldOutOverlay, {}),
|
|
@@ -11215,7 +11236,7 @@ function RetailProductCard({
|
|
|
11215
11236
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.original, currency, className: "text-xs text-muted-foreground line-through" })
|
|
11216
11237
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11217
11238
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
|
|
11218
|
-
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" })
|
|
11219
11240
|
] }) }),
|
|
11220
11241
|
swatches.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1.5 mt-2.5", children: swatches.map((name) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11221
11242
|
"span",
|
|
@@ -11230,10 +11251,10 @@ function RetailProductCard({
|
|
|
11230
11251
|
] });
|
|
11231
11252
|
}
|
|
11232
11253
|
function PriceRange({ product, currency, className }) {
|
|
11233
|
-
const resolvedCurrency = currency ??
|
|
11234
|
-
const range =
|
|
11254
|
+
const resolvedCurrency = currency ?? chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11255
|
+
const range = chunkPTPOQVXS_js.getPriceRange(product);
|
|
11235
11256
|
if (!range) return null;
|
|
11236
|
-
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) });
|
|
11237
11258
|
}
|
|
11238
11259
|
function WholesaleProductCard({
|
|
11239
11260
|
product,
|
|
@@ -11243,7 +11264,7 @@ function WholesaleProductCard({
|
|
|
11243
11264
|
className
|
|
11244
11265
|
}) {
|
|
11245
11266
|
const image = product.image_url || product.images?.[0] || "";
|
|
11246
|
-
const currency =
|
|
11267
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11247
11268
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
11248
11269
|
const status = product.inventory_status;
|
|
11249
11270
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
@@ -11279,10 +11300,10 @@ function WholesaleProductCard({
|
|
|
11279
11300
|
}
|
|
11280
11301
|
var TYPE_BADGES = {
|
|
11281
11302
|
download: { label: "Download", color: "bg-sky-50 text-sky-700 border-sky-200/60" },
|
|
11282
|
-
|
|
11283
|
-
|
|
11284
|
-
|
|
11285
|
-
|
|
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" }
|
|
11286
11307
|
};
|
|
11287
11308
|
function DigitalProductCard({
|
|
11288
11309
|
product,
|
|
@@ -11291,9 +11312,9 @@ function DigitalProductCard({
|
|
|
11291
11312
|
className
|
|
11292
11313
|
}) {
|
|
11293
11314
|
const image = product.image_url || product.images?.[0] || "";
|
|
11294
|
-
const currency =
|
|
11315
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11295
11316
|
const typeBadge = product.digital_type ? TYPE_BADGES[product.digital_type] : null;
|
|
11296
|
-
const isTicket = product.digital_type === "
|
|
11317
|
+
const isTicket = product.digital_type === "ticket";
|
|
11297
11318
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
11298
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 }) }),
|
|
11299
11320
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3.5", children: [
|
|
@@ -11322,11 +11343,11 @@ function BundleProductCard({
|
|
|
11322
11343
|
className
|
|
11323
11344
|
}) {
|
|
11324
11345
|
const image = product.image_url || product.images?.[0] || "";
|
|
11325
|
-
const currency =
|
|
11346
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11326
11347
|
const components = product.components || [];
|
|
11327
11348
|
const componentCount = components.length;
|
|
11328
|
-
const onSale =
|
|
11329
|
-
const discount =
|
|
11349
|
+
const onSale = chunkPTPOQVXS_js.isOnSale(product);
|
|
11350
|
+
const discount = chunkPTPOQVXS_js.getDiscountPercentage(product);
|
|
11330
11351
|
const hasVariantChoice = components.some((c) => c.allow_variant_choice);
|
|
11331
11352
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
11332
11353
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "square", renderImage, children: [
|
|
@@ -11353,7 +11374,7 @@ function BundleProductCard({
|
|
|
11353
11374
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mt-2.5", children: [
|
|
11354
11375
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
|
|
11355
11376
|
onSale && product.bundle_price && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11356
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
11377
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkPTPOQVXS_js.getBasePrice(product), currency, className: "text-xs text-muted-foreground line-through" }),
|
|
11357
11378
|
discount != null && discount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] font-semibold text-emerald-600", children: [
|
|
11358
11379
|
"Save ",
|
|
11359
11380
|
discount,
|
|
@@ -11373,7 +11394,7 @@ function CompositeProductCard({
|
|
|
11373
11394
|
className
|
|
11374
11395
|
}) {
|
|
11375
11396
|
const image = product.image_url || product.images?.[0] || "";
|
|
11376
|
-
const currency =
|
|
11397
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11377
11398
|
const groups = product.groups || [];
|
|
11378
11399
|
const groupCount = groups.length;
|
|
11379
11400
|
groups.reduce((sum, g) => sum + g.components.length, 0);
|
|
@@ -11425,7 +11446,7 @@ function StandardServiceCard({
|
|
|
11425
11446
|
className
|
|
11426
11447
|
}) {
|
|
11427
11448
|
const image = product.image_url || product.images?.[0] || "";
|
|
11428
|
-
const currency =
|
|
11449
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11429
11450
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
11430
11451
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
11431
11452
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "16/9", renderImage, children: [
|
|
@@ -11480,7 +11501,7 @@ function CompactServiceCard({
|
|
|
11480
11501
|
className
|
|
11481
11502
|
}) {
|
|
11482
11503
|
const image = product.image_url || product.images?.[0] || "";
|
|
11483
|
-
const currency =
|
|
11504
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11484
11505
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
11485
11506
|
const hasBillingPlans = product.billing_plans && product.billing_plans.length > 0;
|
|
11486
11507
|
const href = `/products/${product.slug}`;
|
|
@@ -11529,7 +11550,7 @@ function ScheduleServiceCard({
|
|
|
11529
11550
|
className
|
|
11530
11551
|
}) {
|
|
11531
11552
|
const image = product.image_url || product.images?.[0] || "";
|
|
11532
|
-
const currency =
|
|
11553
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11533
11554
|
const href = `/products/${product.slug}`;
|
|
11534
11555
|
const durationLabel = product.duration_minutes != null ? formatDuration2(product.duration_minutes, product.duration_unit) : null;
|
|
11535
11556
|
const displaySlots = (slots || []).slice(0, 3);
|
|
@@ -11601,7 +11622,7 @@ function RentalServiceCard({
|
|
|
11601
11622
|
className
|
|
11602
11623
|
}) {
|
|
11603
11624
|
const image = product.image_url || product.images?.[0] || "";
|
|
11604
|
-
const currency =
|
|
11625
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11605
11626
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
11606
11627
|
const unit = product.duration_unit ? UNIT_LABELS2[product.duration_unit] || product.duration_unit : "day";
|
|
11607
11628
|
const status = product.inventory_status;
|
|
@@ -11671,7 +11692,7 @@ function AccommodationCard({
|
|
|
11671
11692
|
className
|
|
11672
11693
|
}) {
|
|
11673
11694
|
const image = product.image_url || product.images?.[0] || "";
|
|
11674
|
-
const currency =
|
|
11695
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11675
11696
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
11676
11697
|
const cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
|
|
11677
11698
|
const tags = product.tags || [];
|
|
@@ -11737,7 +11758,7 @@ function LeaseServiceCard({
|
|
|
11737
11758
|
className
|
|
11738
11759
|
}) {
|
|
11739
11760
|
const image = product.image_url || product.images?.[0] || "";
|
|
11740
|
-
const currency =
|
|
11761
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11741
11762
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
11742
11763
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
11743
11764
|
const unit = product.duration_unit ? UNIT_LABELS3[product.duration_unit] || product.duration_unit : "mo";
|
|
@@ -11811,7 +11832,7 @@ function SubscriptionCard({
|
|
|
11811
11832
|
className
|
|
11812
11833
|
}) {
|
|
11813
11834
|
const image = product.image_url || product.images?.[0] || "";
|
|
11814
|
-
const currency =
|
|
11835
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
11815
11836
|
const plans = product.billing_plans || [];
|
|
11816
11837
|
const primaryPlan = plans[0];
|
|
11817
11838
|
const frequency = primaryPlan?.frequency ? FREQUENCY_LABELS2[primaryPlan.frequency] || `/${primaryPlan.frequency}` : "/mo";
|
|
@@ -12032,7 +12053,7 @@ function ProductCard({
|
|
|
12032
12053
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-card-body": true, className: cn("p-4 flex flex-col gap-1", classNames?.body), children: [
|
|
12033
12054
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-product-card-name": true, className: cn("font-semibold text-foreground leading-tight", classNames?.name), children: product.name }),
|
|
12034
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 }),
|
|
12035
|
-
/* @__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) })
|
|
12036
12057
|
] })
|
|
12037
12058
|
] });
|
|
12038
12059
|
})();
|
|
@@ -12324,7 +12345,7 @@ function SearchInput({
|
|
|
12324
12345
|
}
|
|
12325
12346
|
),
|
|
12326
12347
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-name": true, className: classNames?.resultName, style: { flex: 1, textAlign: "left" }, children: product.name }),
|
|
12327
|
-
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) })
|
|
12328
12349
|
] })
|
|
12329
12350
|
},
|
|
12330
12351
|
product.id
|
|
@@ -12819,19 +12840,19 @@ function OrderSummary({
|
|
|
12819
12840
|
order.customer_notes.map((note, index) => /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-order-note": true, children: note }, index))
|
|
12820
12841
|
] }),
|
|
12821
12842
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-totals": true, className: classNames?.totals, children: [
|
|
12822
|
-
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: [
|
|
12823
12844
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Discount" }),
|
|
12824
12845
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.total_discount, prefix: "-" })
|
|
12825
12846
|
] }),
|
|
12826
|
-
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: [
|
|
12827
12848
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Delivery fee" }),
|
|
12828
12849
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.delivery_fee })
|
|
12829
12850
|
] }),
|
|
12830
|
-
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: [
|
|
12831
12852
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Service charge" }),
|
|
12832
12853
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.service_charge })
|
|
12833
12854
|
] }),
|
|
12834
|
-
order.tax != null &&
|
|
12855
|
+
order.tax != null && chunkPTPOQVXS_js.parsePrice(order.tax) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-tax": true, children: [
|
|
12835
12856
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Tax" }),
|
|
12836
12857
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.tax })
|
|
12837
12858
|
] }),
|
|
@@ -13361,7 +13382,7 @@ function BookingPage({
|
|
|
13361
13382
|
const hasStaffStep = staff && staff.length > 0;
|
|
13362
13383
|
const depositType = product?.deposit_type;
|
|
13363
13384
|
const depositAmount = product?.deposit_amount;
|
|
13364
|
-
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;
|
|
13365
13386
|
const cancellationMinutes = product?.cancellation_window_minutes;
|
|
13366
13387
|
const noShowFee = product?.no_show_fee;
|
|
13367
13388
|
const handleSlotSelect = React14.useCallback(
|
|
@@ -13493,14 +13514,14 @@ function BookingPage({
|
|
|
13493
13514
|
service.price && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-booking-service-price": true, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: service.price, currency }) }),
|
|
13494
13515
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-deposit-info": true, className: classNames?.depositInfo, children: [
|
|
13495
13516
|
"Deposit: ",
|
|
13496
|
-
depositType === "percentage" ? `${
|
|
13517
|
+
depositType === "percentage" ? `${chunkPTPOQVXS_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency })
|
|
13497
13518
|
] }),
|
|
13498
13519
|
cancellationMinutes !== void 0 && cancellationMinutes > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-cancellation-policy": true, className: classNames?.cancellationPolicy, children: [
|
|
13499
13520
|
"Free cancellation up to ",
|
|
13500
13521
|
cancellationMinutes >= 60 ? `${Math.floor(cancellationMinutes / 60)} hour${Math.floor(cancellationMinutes / 60) !== 1 ? "s" : ""}` : `${cancellationMinutes} minute${cancellationMinutes !== 1 ? "s" : ""}`,
|
|
13501
13522
|
" before"
|
|
13502
13523
|
] }),
|
|
13503
|
-
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: [
|
|
13504
13525
|
"No-show fee: ",
|
|
13505
13526
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: noShowFee, currency })
|
|
13506
13527
|
] })
|
|
@@ -13578,7 +13599,7 @@ function BookingPage({
|
|
|
13578
13599
|
] }),
|
|
13579
13600
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-booking-summary-row": true, className: cn(classNames?.summaryRow, classNames?.depositInfo), children: [
|
|
13580
13601
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Deposit" }),
|
|
13581
|
-
/* @__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 }) })
|
|
13582
13603
|
] })
|
|
13583
13604
|
] }),
|
|
13584
13605
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -14252,9 +14273,9 @@ function DefaultProductLayout({
|
|
|
14252
14273
|
}) {
|
|
14253
14274
|
const [selectedVariantId, setSelectedVariantId] = React14__default.default.useState();
|
|
14254
14275
|
const images = chunkIQLJJW2H_js.resolveGallery(product, selectedVariantId);
|
|
14255
|
-
const currency =
|
|
14276
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
14256
14277
|
const hasRange = product.quantity_pricing && product.quantity_pricing.length > 1 || product.variants && product.variants.length > 1;
|
|
14257
|
-
const onSale =
|
|
14278
|
+
const onSale = chunkPTPOQVXS_js.isOnSale(product);
|
|
14258
14279
|
const hasPhysicalDetails = product.sku || product.vendor || product.material;
|
|
14259
14280
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "default", className: cn("space-y-8", className), children: [
|
|
14260
14281
|
renderBreadcrumb?.(product),
|
|
@@ -14277,13 +14298,13 @@ function DefaultProductLayout({
|
|
|
14277
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: [
|
|
14278
14299
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.price, currency, className: "text-2xl font-extrabold" }),
|
|
14279
14300
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.original, currency, className: "text-lg text-muted-foreground line-through" }),
|
|
14280
|
-
/* @__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` })
|
|
14281
14302
|
] }) : onSale ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
14282
14303
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-extrabold" }),
|
|
14283
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
14304
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkPTPOQVXS_js.getBasePrice(product), currency, className: "text-lg text-muted-foreground line-through" }),
|
|
14284
14305
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-bold text-destructive bg-destructive/10 px-2 py-0.5", children: [
|
|
14285
14306
|
"Save ",
|
|
14286
|
-
|
|
14307
|
+
chunkPTPOQVXS_js.getDiscountPercentage(product),
|
|
14287
14308
|
"%"
|
|
14288
14309
|
] })
|
|
14289
14310
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-semibold" }) }),
|
|
@@ -14345,7 +14366,7 @@ function FoodProductLayout({
|
|
|
14345
14366
|
className
|
|
14346
14367
|
}) {
|
|
14347
14368
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
14348
|
-
const currency =
|
|
14369
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
14349
14370
|
const tags = product.tags || [];
|
|
14350
14371
|
const ingredients = getMetadataStringList(product.metadata, "ingredients");
|
|
14351
14372
|
const pairings = getMetadataStringList(product.metadata, "pairings");
|
|
@@ -14420,7 +14441,7 @@ function WholesaleProductLayout({
|
|
|
14420
14441
|
className
|
|
14421
14442
|
}) {
|
|
14422
14443
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
14423
|
-
const currency =
|
|
14444
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
14424
14445
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
14425
14446
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "wholesale", className: cn("space-y-8", className), children: [
|
|
14426
14447
|
renderBreadcrumb?.(product),
|
|
@@ -14504,9 +14525,9 @@ function ServiceProductLayout({
|
|
|
14504
14525
|
className
|
|
14505
14526
|
}) {
|
|
14506
14527
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
14507
|
-
const currency =
|
|
14528
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
14508
14529
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
14509
|
-
const depositAmount = hasDeposit ?
|
|
14530
|
+
const depositAmount = hasDeposit ? chunkPTPOQVXS_js.parsePrice(product.deposit_amount) : 0;
|
|
14510
14531
|
const cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
|
|
14511
14532
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "service", className: cn("space-y-8", className), children: [
|
|
14512
14533
|
renderBreadcrumb?.(product),
|
|
@@ -14574,7 +14595,7 @@ function ServiceProductLayout({
|
|
|
14574
14595
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency, className: "font-medium text-foreground" }),
|
|
14575
14596
|
" deposit charged at booking"
|
|
14576
14597
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
14577
|
-
|
|
14598
|
+
chunkPTPOQVXS_js.parsePrice(product.deposit_amount),
|
|
14578
14599
|
"% deposit charged at booking"
|
|
14579
14600
|
] }) })
|
|
14580
14601
|
] })
|
|
@@ -14592,10 +14613,10 @@ function ServiceProductLayout({
|
|
|
14592
14613
|
}
|
|
14593
14614
|
var DIGITAL_TYPE_LABELS = {
|
|
14594
14615
|
download: "Digital download",
|
|
14595
|
-
|
|
14596
|
-
|
|
14597
|
-
|
|
14598
|
-
|
|
14616
|
+
license_key: "Software license",
|
|
14617
|
+
ticket: "Event ticket",
|
|
14618
|
+
access_grant: "Access pass",
|
|
14619
|
+
redemption_code: "Redemption code"
|
|
14599
14620
|
};
|
|
14600
14621
|
function DigitalProductLayout({
|
|
14601
14622
|
product,
|
|
@@ -14606,11 +14627,11 @@ function DigitalProductLayout({
|
|
|
14606
14627
|
className
|
|
14607
14628
|
}) {
|
|
14608
14629
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
14609
|
-
const currency =
|
|
14630
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
14610
14631
|
const typeLabel = product.digital_type ? DIGITAL_TYPE_LABELS[product.digital_type] || product.digital_type : "Digital product";
|
|
14611
|
-
const isTicket = product.digital_type === "
|
|
14612
|
-
const isAccessPass = product.digital_type === "
|
|
14613
|
-
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";
|
|
14614
14635
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "digital", className: cn("space-y-8", className), children: [
|
|
14615
14636
|
renderBreadcrumb?.(product),
|
|
14616
14637
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -14733,15 +14754,15 @@ function BundleProductLayout({
|
|
|
14733
14754
|
className
|
|
14734
14755
|
}) {
|
|
14735
14756
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
14736
|
-
const currency =
|
|
14757
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
14737
14758
|
const components = product.components || [];
|
|
14738
|
-
const onSale =
|
|
14739
|
-
const discount =
|
|
14759
|
+
const onSale = chunkPTPOQVXS_js.isOnSale(product);
|
|
14760
|
+
const discount = chunkPTPOQVXS_js.getDiscountPercentage(product);
|
|
14740
14761
|
const baseTotal = components.reduce(
|
|
14741
|
-
(sum, c) => sum +
|
|
14762
|
+
(sum, c) => sum + chunkPTPOQVXS_js.parsePrice(c.effective_price ?? 0) * (c.quantity ?? 1),
|
|
14742
14763
|
0
|
|
14743
14764
|
);
|
|
14744
|
-
const bundlePrice =
|
|
14765
|
+
const bundlePrice = chunkPTPOQVXS_js.parsePrice(product.default_price);
|
|
14745
14766
|
const savings = baseTotal > bundlePrice ? baseTotal - bundlePrice : 0;
|
|
14746
14767
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "bundle", className: cn("space-y-8", className), children: [
|
|
14747
14768
|
renderBreadcrumb?.(product),
|
|
@@ -14817,7 +14838,7 @@ function CompositeProductLayout({
|
|
|
14817
14838
|
className
|
|
14818
14839
|
}) {
|
|
14819
14840
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
14820
|
-
const currency =
|
|
14841
|
+
const currency = chunkPTPOQVXS_js.getProductCurrency(product);
|
|
14821
14842
|
const groups = product.groups || [];
|
|
14822
14843
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "composite", className: cn("space-y-8", className), children: [
|
|
14823
14844
|
renderBreadcrumb?.(product),
|
|
@@ -15240,7 +15261,7 @@ function CartDrawer({
|
|
|
15240
15261
|
}) {
|
|
15241
15262
|
const { isOpen, close } = useCartDrawer();
|
|
15242
15263
|
const cart = useCart();
|
|
15243
|
-
const subtotalNum =
|
|
15264
|
+
const subtotalNum = chunkPTPOQVXS_js.parsePrice(cart.subtotal);
|
|
15244
15265
|
const animatedSubtotal = useAnimatedNumber(subtotalNum);
|
|
15245
15266
|
React14.useEffect(() => {
|
|
15246
15267
|
if (!isOpen) return;
|
|
@@ -15634,9 +15655,9 @@ function CatalogueCollectionLayout({
|
|
|
15634
15655
|
result = result.filter((p) => p.tags?.includes(activeCategory));
|
|
15635
15656
|
}
|
|
15636
15657
|
if (sortBy === "price-asc") {
|
|
15637
|
-
result = [...result].sort((a, b) =>
|
|
15658
|
+
result = [...result].sort((a, b) => chunkPTPOQVXS_js.parsePrice(a.default_price) - chunkPTPOQVXS_js.parsePrice(b.default_price));
|
|
15638
15659
|
} else if (sortBy === "price-desc") {
|
|
15639
|
-
result = [...result].sort((a, b) =>
|
|
15660
|
+
result = [...result].sort((a, b) => chunkPTPOQVXS_js.parsePrice(b.default_price) - chunkPTPOQVXS_js.parsePrice(a.default_price));
|
|
15640
15661
|
} else if (sortBy === "name") {
|
|
15641
15662
|
result = [...result].sort((a, b) => a.name.localeCompare(b.name));
|
|
15642
15663
|
}
|
|
@@ -16673,7 +16694,7 @@ function CurrencySelector({
|
|
|
16673
16694
|
),
|
|
16674
16695
|
children: renderCurrency ? renderCurrency(currency, isActive, rate) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
16675
16696
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-currency-label": true, className: classNames?.label, children: currency }),
|
|
16676
|
-
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 })
|
|
16677
16698
|
] })
|
|
16678
16699
|
},
|
|
16679
16700
|
currency
|
|
@@ -17315,6 +17336,7 @@ exports.RetailProductCard = RetailProductCard;
|
|
|
17315
17336
|
exports.RichText = RichText;
|
|
17316
17337
|
exports.SaleBadge = SaleBadge;
|
|
17317
17338
|
exports.SalePrice = SalePrice;
|
|
17339
|
+
exports.SaleTeaser = SaleTeaser;
|
|
17318
17340
|
exports.ScheduleServiceCard = ScheduleServiceCard;
|
|
17319
17341
|
exports.SearchInput = SearchInput;
|
|
17320
17342
|
exports.SearchPage = SearchPage;
|