@cimplify/sdk 0.103.0 → 0.104.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.
Files changed (65) hide show
  1. package/dist/advanced.d.mts +3 -3
  2. package/dist/advanced.d.ts +3 -3
  3. package/dist/advanced.js +22 -22
  4. package/dist/advanced.mjs +3 -3
  5. package/dist/{chunk-C2JSNJUC.mjs → chunk-2WPVUIHX.mjs} +52 -11
  6. package/dist/{chunk-JG5CQNCB.js → chunk-4BKOKHE3.js} +4 -0
  7. package/dist/{chunk-R6OLQ33I.js → chunk-5BDYDZ4U.js} +239 -87
  8. package/dist/{chunk-H7ACMHM3.mjs → chunk-5RT4HYMP.mjs} +32 -4
  9. package/dist/{chunk-NNG6IFFX.js → chunk-7PDEX54K.js} +3 -3
  10. package/dist/{chunk-M4URVKHE.mjs → chunk-DYIAX3WI.mjs} +1 -1
  11. package/dist/{chunk-QOWPGS7Z.js → chunk-E4K2VQDD.js} +35 -5
  12. package/dist/{chunk-VNPEYLB2.mjs → chunk-H3RATH4B.mjs} +4 -0
  13. package/dist/{chunk-JSWJ4XDE.js → chunk-IQFFSKE2.js} +315 -108
  14. package/dist/{chunk-J6PNHDHL.mjs → chunk-OCCNG6MO.mjs} +284 -77
  15. package/dist/{chunk-GERXZQSX.mjs → chunk-OKADBZAI.mjs} +171 -20
  16. package/dist/{chunk-VIL6IQCG.js → chunk-YVAEY3VC.js} +54 -13
  17. package/dist/{client-Dqg2mc-7.d.ts → client-BVNWjk6W.d.ts} +2 -2
  18. package/dist/{client-BfpNjJ_a.d.mts → client-BuLcOWLv.d.ts} +115 -23
  19. package/dist/{client-DHBwvh7U.d.ts → client-D5AoobFc.d.mts} +115 -23
  20. package/dist/{client-DpqRobY9.d.mts → client-fM716k7G.d.mts} +2 -2
  21. package/dist/{index-C8uDqLwJ.d.ts → index-BtcoqrY1.d.ts} +3 -3
  22. package/dist/{index-e2y6AK70.d.mts → index-D7Tf3v7c.d.mts} +3 -3
  23. package/dist/index.d.mts +10 -8
  24. package/dist/index.d.ts +10 -8
  25. package/dist/index.js +107 -106
  26. package/dist/index.mjs +6 -5
  27. package/dist/{link-cuNVYc2s.d.mts → link-D9iSVxt5.d.mts} +12 -1
  28. package/dist/{link-cuNVYc2s.d.ts → link-D9iSVxt5.d.ts} +12 -1
  29. package/dist/mock/cli.mjs +53 -10
  30. package/dist/mock/library.js +53 -10
  31. package/dist/mock/library.mjs +53 -10
  32. package/dist/mock/msw.js +53 -10
  33. package/dist/mock/msw.mjs +53 -10
  34. package/dist/{payment-H5LoIvXU.d.mts → payment-g0HFkEDU.d.mts} +519 -54
  35. package/dist/{payment-H5LoIvXU.d.ts → payment-g0HFkEDU.d.ts} +519 -54
  36. package/dist/{price-C2RqscMY.d.ts → price-BLIeAb8K.d.ts} +1 -1
  37. package/dist/{price-BvePgDXe.d.mts → price-Czq_cTC_.d.mts} +1 -1
  38. package/dist/react.d.mts +4 -4
  39. package/dist/react.d.ts +4 -4
  40. package/dist/react.js +193 -169
  41. package/dist/react.mjs +54 -30
  42. package/dist/{server-C7FyLdrz.d.mts → server-BkVhOIwn.d.mts} +4 -2
  43. package/dist/{server-DoXIpSd7.d.ts → server-DKK_D-PP.d.ts} +4 -2
  44. package/dist/server.d.mts +4 -4
  45. package/dist/server.d.ts +4 -4
  46. package/dist/server.js +11 -10
  47. package/dist/server.mjs +5 -4
  48. package/dist/testing/msw.d.mts +2 -2
  49. package/dist/testing/msw.d.ts +2 -2
  50. package/dist/testing/msw.js +3 -3
  51. package/dist/testing/msw.mjs +2 -2
  52. package/dist/testing/suite.d.mts +6 -6
  53. package/dist/testing/suite.d.ts +6 -6
  54. package/dist/testing/suite.js +25 -25
  55. package/dist/testing/suite.mjs +6 -6
  56. package/dist/testing.d.mts +46 -6
  57. package/dist/testing.d.ts +46 -6
  58. package/dist/testing.js +94 -82
  59. package/dist/testing.mjs +13 -9
  60. package/dist/utils.d.mts +4 -4
  61. package/dist/utils.d.ts +4 -4
  62. package/dist/utils.js +31 -31
  63. package/dist/utils.mjs +2 -2
  64. package/package.json +1 -1
  65. package/registry/chat-widget.json +1 -1
package/dist/react.js CHANGED
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkXREIZ56K_js = require('./chunk-XREIZ56K.js');
5
4
  var chunk2P4KXFB6_js = require('./chunk-2P4KXFB6.js');
6
- var chunkR6OLQ33I_js = require('./chunk-R6OLQ33I.js');
7
- var chunkJSWJ4XDE_js = require('./chunk-JSWJ4XDE.js');
5
+ var chunk5BDYDZ4U_js = require('./chunk-5BDYDZ4U.js');
6
+ var chunkXREIZ56K_js = require('./chunk-XREIZ56K.js');
7
+ var chunkIQFFSKE2_js = require('./chunk-IQFFSKE2.js');
8
8
  require('./chunk-CNN7Z2IP.js');
9
- var chunkNNG6IFFX_js = require('./chunk-NNG6IFFX.js');
10
- var chunkJG5CQNCB_js = require('./chunk-JG5CQNCB.js');
9
+ var chunk7PDEX54K_js = require('./chunk-7PDEX54K.js');
10
+ var chunk4BKOKHE3_js = require('./chunk-4BKOKHE3.js');
11
11
  require('./chunk-OWW5GUSB.js');
12
12
  var React14 = require('react');
13
13
  var jsxRuntime = require('react/jsx-runtime');
@@ -635,14 +635,14 @@ function attachInternalItemMetadata(item, metadata = {}) {
635
635
  }
636
636
  function calculateLineSubtotal(item) {
637
637
  if (item._quotedUnitPrice !== void 0) {
638
- return roundMoney(chunkNNG6IFFX_js.parsePrice(item._quotedUnitPrice) * item.quantity);
638
+ return roundMoney(chunk7PDEX54K_js.parsePrice(item._quotedUnitPrice) * item.quantity);
639
639
  }
640
- let unitPrice = chunkNNG6IFFX_js.parsePrice(item.product.default_price);
640
+ let unitPrice = chunk7PDEX54K_js.parsePrice(item.product.default_price);
641
641
  if (item.variant?.price_adjustment) {
642
- unitPrice += chunkNNG6IFFX_js.parsePrice(item.variant.price_adjustment);
642
+ unitPrice += chunk7PDEX54K_js.parsePrice(item.variant.price_adjustment);
643
643
  }
644
644
  for (const option of item.addOnOptions || []) {
645
- if (option.default_price) unitPrice += chunkNNG6IFFX_js.parsePrice(option.default_price);
645
+ if (option.default_price) unitPrice += chunk7PDEX54K_js.parsePrice(option.default_price);
646
646
  }
647
647
  return roundMoney(unitPrice * item.quantity);
648
648
  }
@@ -863,7 +863,7 @@ async function syncFromServer(entry) {
863
863
  return next;
864
864
  }
865
865
  function emitMutationError(entry, operation, opId, idempotencyKey, error) {
866
- entry.client.events.emit(chunkR6OLQ33I_js.MUTATION_ERROR, {
866
+ entry.client.events.emit(chunk5BDYDZ4U_js.MUTATION_ERROR, {
867
867
  service: "cart",
868
868
  operation,
869
869
  opId,
@@ -903,10 +903,10 @@ function getOrCreateStore(params) {
903
903
  syncTail: Promise.resolve(),
904
904
  failedOpRemovers: /* @__PURE__ */ new Set()
905
905
  };
906
- client.events.on(chunkR6OLQ33I_js.SESSION_CLAIMED, () => {
906
+ client.events.on(chunk5BDYDZ4U_js.SESSION_CLAIMED, () => {
907
907
  if (entry.initialized) void syncFromServer(entry);
908
908
  });
909
- client.events.on(chunkR6OLQ33I_js.SESSION_CLEARED, () => {
909
+ client.events.on(chunk5BDYDZ4U_js.SESSION_CLEARED, () => {
910
910
  if (entry.initialized) void syncFromServer(entry);
911
911
  });
912
912
  cartStores.set(storeKey, entry);
@@ -1214,7 +1214,7 @@ var DEFAULT_COUNTRY = "US";
1214
1214
  function createDefaultClient() {
1215
1215
  const processRef = globalThis.process;
1216
1216
  const envPublicKey = processRef?.env?.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY || "";
1217
- return chunkR6OLQ33I_js.createCimplifyClient({ publicKey: envPublicKey });
1217
+ return chunk5BDYDZ4U_js.createCimplifyClient({ publicKey: envPublicKey });
1218
1218
  }
1219
1219
  function getStoredLocationId() {
1220
1220
  if (typeof window === "undefined" || !window.localStorage) {
@@ -1318,7 +1318,7 @@ function CimplifyProvider({
1318
1318
  const setDisplayCurrency = React14.useCallback(
1319
1319
  (currency) => {
1320
1320
  const normalized = currency?.trim().toUpperCase() || null;
1321
- if (normalized && !chunkJG5CQNCB_js.isSupportedCurrency(normalized)) {
1321
+ if (normalized && !chunk4BKOKHE3_js.isSupportedCurrency(normalized)) {
1322
1322
  return;
1323
1323
  }
1324
1324
  setDisplayCurrencyOverride(normalized);
@@ -3262,19 +3262,19 @@ function toAccountLineItem(item, currency) {
3262
3262
  quantity: s.quantity,
3263
3263
  name: s.product_name,
3264
3264
  variantName: s.variant_name,
3265
- priceLabel: chunkNNG6IFFX_js.parsePrice(s.unit_price) > 0 ? chunkNNG6IFFX_js.formatMoney(s.unit_price, currency) : void 0
3265
+ priceLabel: chunk7PDEX54K_js.parsePrice(s.unit_price) > 0 ? chunk7PDEX54K_js.formatMoney(s.unit_price, currency) : void 0
3266
3266
  }));
3267
3267
  const customisations = item.composite_selections?.selections.map((s) => ({
3268
3268
  quantity: s.quantity,
3269
3269
  name: s.component_name,
3270
- priceLabel: chunkNNG6IFFX_js.parsePrice(s.unit_price) > 0 ? `+${chunkNNG6IFFX_js.formatMoney(s.unit_price, currency)}` : void 0
3270
+ priceLabel: chunk7PDEX54K_js.parsePrice(s.unit_price) > 0 ? `+${chunk7PDEX54K_js.formatMoney(s.unit_price, currency)}` : void 0
3271
3271
  }));
3272
3272
  const data = {
3273
3273
  id: item.id,
3274
3274
  name: item.product_name ?? "Item",
3275
3275
  imageUrl: item.image_url,
3276
3276
  subtitle: lineSubtitle(item),
3277
- priceLabel: chunkNNG6IFFX_js.formatMoney(item.total_price, currency),
3277
+ priceLabel: chunk7PDEX54K_js.formatMoney(item.total_price, currency),
3278
3278
  lineType: item.line_type,
3279
3279
  includes,
3280
3280
  customisations,
@@ -3324,20 +3324,20 @@ var PAYMENT_TONE = {
3324
3324
  function toAccountOrderView(order, opts = {}) {
3325
3325
  const currency = order.payment.currency;
3326
3326
  const rows = [
3327
- { label: "Subtotal", value: chunkNNG6IFFX_js.formatMoney(order.pricing.subtotal, currency) }
3327
+ { label: "Subtotal", value: chunk7PDEX54K_js.formatMoney(order.pricing.subtotal, currency) }
3328
3328
  ];
3329
- if (chunkNNG6IFFX_js.parsePrice(order.pricing.total_discount) > 0) {
3329
+ if (chunk7PDEX54K_js.parsePrice(order.pricing.total_discount) > 0) {
3330
3330
  rows.push({
3331
3331
  label: "Discount",
3332
- value: `\u2212${chunkNNG6IFFX_js.formatMoney(order.pricing.total_discount, currency)}`,
3332
+ value: `\u2212${chunk7PDEX54K_js.formatMoney(order.pricing.total_discount, currency)}`,
3333
3333
  tone: "positive"
3334
3334
  });
3335
3335
  }
3336
- if (order.pricing.tax && chunkNNG6IFFX_js.parsePrice(order.pricing.tax) > 0) {
3337
- rows.push({ label: "Tax", value: chunkNNG6IFFX_js.formatMoney(order.pricing.tax, currency) });
3336
+ if (order.pricing.tax && chunk7PDEX54K_js.parsePrice(order.pricing.tax) > 0) {
3337
+ rows.push({ label: "Tax", value: chunk7PDEX54K_js.formatMoney(order.pricing.tax, currency) });
3338
3338
  }
3339
- if (order.pricing.service_charge && chunkNNG6IFFX_js.parsePrice(order.pricing.service_charge) > 0) {
3340
- rows.push({ label: "Service", value: chunkNNG6IFFX_js.formatMoney(order.pricing.service_charge, currency) });
3339
+ if (order.pricing.service_charge && chunk7PDEX54K_js.parsePrice(order.pricing.service_charge) > 0) {
3340
+ rows.push({ label: "Service", value: chunk7PDEX54K_js.formatMoney(order.pricing.service_charge, currency) });
3341
3341
  }
3342
3342
  const placed = fmtDateTime(order.timestamps.created_at);
3343
3343
  const placedLabel = opts.placedLabel ?? [placed && `Placed ${placed}`, `${order.items.length} item${order.items.length === 1 ? "" : "s"}`].filter(Boolean).join(" \xB7 ");
@@ -3351,7 +3351,7 @@ function toAccountOrderView(order, opts = {}) {
3351
3351
  stateLabel: cap(order.payment.computed_status ?? order.payment.state),
3352
3352
  stateTone: PAYMENT_TONE[order.payment.state] ?? "muted",
3353
3353
  rows,
3354
- total: { label: "Total", value: chunkNNG6IFFX_js.formatMoney(order.pricing.total_price, currency) }
3354
+ total: { label: "Total", value: chunk7PDEX54K_js.formatMoney(order.pricing.total_price, currency) }
3355
3355
  },
3356
3356
  shipTo: order.customer.delivery_address ? { lines: order.customer.delivery_address } : void 0,
3357
3357
  onBack: opts.onBack
@@ -3526,7 +3526,7 @@ function CimplifySignInButton({
3526
3526
  const onClick = async () => {
3527
3527
  if (busy || disabled || !signInOpts.clientId) return;
3528
3528
  setBusy(true);
3529
- await chunkJSWJ4XDE_js.startSignIn({
3529
+ await chunkIQFFSKE2_js.startSignIn({
3530
3530
  ...signInOpts,
3531
3531
  onSuccess: () => {
3532
3532
  setBusy(false);
@@ -4381,7 +4381,7 @@ function Price({
4381
4381
  const resolvedAmount = fxActive ? context.convertPrice(amount) : typeof amount === "string" ? parseFloat(amount) || 0 : amount;
4382
4382
  return /* @__PURE__ */ jsxRuntime.jsxs("span", { className, children: [
4383
4383
  prefix,
4384
- chunkNNG6IFFX_js.formatPrice(resolvedAmount, resolvedCurrency)
4384
+ chunk7PDEX54K_js.formatPrice(resolvedAmount, resolvedCurrency)
4385
4385
  ] });
4386
4386
  }
4387
4387
  function createCachedQuery(config) {
@@ -4994,9 +4994,9 @@ function useClientSessionEpoch(client) {
4994
4994
  const subscribe = React14.useCallback(
4995
4995
  (notify) => {
4996
4996
  const unsubscribe = [
4997
- client.events.on(chunkR6OLQ33I_js.AUTH_TOKEN_CHANGED, notify),
4998
- client.events.on(chunkR6OLQ33I_js.SESSION_CLAIMED, notify),
4999
- client.events.on(chunkR6OLQ33I_js.SESSION_CLEARED, notify)
4997
+ client.events.on(chunk5BDYDZ4U_js.AUTH_TOKEN_CHANGED, notify),
4998
+ client.events.on(chunk5BDYDZ4U_js.SESSION_CLAIMED, notify),
4999
+ client.events.on(chunk5BDYDZ4U_js.SESSION_CLEARED, notify)
5000
5000
  ];
5001
5001
  return () => {
5002
5002
  for (const stopListening of unsubscribe) {
@@ -5483,13 +5483,13 @@ function useProductPrice(input) {
5483
5483
  if (bundleTotalPrice != null) {
5484
5484
  unitPrice = bundleTotalPrice;
5485
5485
  } else if (compositePrice) {
5486
- unitPrice = chunkNNG6IFFX_js.parsePrice(compositePrice.final_price);
5486
+ unitPrice = chunk7PDEX54K_js.parsePrice(compositePrice.final_price);
5487
5487
  } else {
5488
- unitPrice = chunkNNG6IFFX_js.getVariantUnitPrice(product, variant);
5488
+ unitPrice = chunk7PDEX54K_js.getVariantUnitPrice(product, variant);
5489
5489
  if (addOnOptions) {
5490
5490
  for (const option of addOnOptions) {
5491
5491
  if (option.default_price) {
5492
- unitPrice += chunkNNG6IFFX_js.parsePrice(option.default_price);
5492
+ unitPrice += chunk7PDEX54K_js.parsePrice(option.default_price);
5493
5493
  }
5494
5494
  }
5495
5495
  }
@@ -6163,7 +6163,7 @@ function useChat(options = {}) {
6163
6163
  if (!c) return;
6164
6164
  const last = lastConfirmedMessage();
6165
6165
  const result = await c.support.getMessages({
6166
- after: last?.created_at,
6166
+ afterSequence: last?.sequence,
6167
6167
  limit: 50
6168
6168
  });
6169
6169
  if (result.ok && result.value.length > 0) {
@@ -6206,9 +6206,9 @@ function useChat(options = {}) {
6206
6206
  );
6207
6207
  return mergeMessages(snapshot, extras);
6208
6208
  });
6209
- aiEnabledRef.current = result.value.conversation.ai_enabled;
6210
- setHumanRequested(result.value.conversation.needs_human_review ?? false);
6211
- setSeenAt(result.value.conversation.team_read_at ?? null);
6209
+ aiEnabledRef.current = result.value.conversation.ai_mode === "auto";
6210
+ setHumanRequested(result.value.conversation.ai_mode === "off");
6211
+ setSeenAt(null);
6212
6212
  setMayHaveOlder(result.value.messages.length >= 50);
6213
6213
  }, []);
6214
6214
  const connectWebSocket = React14.useCallback(() => {
@@ -6236,23 +6236,36 @@ function useChat(options = {}) {
6236
6236
  ws.onmessage = (event) => {
6237
6237
  try {
6238
6238
  const envelope = JSON.parse(event.data);
6239
- if (envelope.type === "message.created" && envelope.data) {
6240
- appendMessages([envelope.data]);
6241
- } else if (envelope.type === "thread.read") {
6242
- const at = envelope.data?.last_read_at;
6243
- if (at) setSeenAt((prev) => !prev || prev < at ? at : prev);
6244
- } else if (envelope.type === "thread.responding") {
6245
- const active = envelope.data?.active;
6246
- if (active) startAwaitingReply();
6247
- else stopAwaitingReply();
6248
- } else if (envelope.type === "resync") {
6249
- const latest = envelope.latest_message_at;
6239
+ const update = chunk5BDYDZ4U_js.chatRealtimeUpdateFromWire(envelope);
6240
+ if (update.kind === "message") {
6241
+ appendMessages([update.message]);
6242
+ } else if (update.kind === "message_updated") {
6243
+ lastActivityRef.current = Date.now();
6244
+ setMessages(
6245
+ (previous) => update.message.deleted_at ? previous.filter((message) => message.id !== update.message.id) : previous.map(
6246
+ (message) => message.id === update.message.id ? update.message : message
6247
+ )
6248
+ );
6249
+ } else if (update.kind === "business_read") {
6250
+ setSeenAt(
6251
+ (prev) => !prev || prev < update.occurredAt ? update.occurredAt : prev
6252
+ );
6253
+ } else if (update.kind === "ai_mode") {
6254
+ aiEnabledRef.current = update.mode === "auto";
6255
+ setHumanRequested(update.mode === "off");
6256
+ if (update.mode !== "auto") stopAwaitingReply();
6257
+ } else if (update.kind === "handoff") {
6258
+ aiEnabledRef.current = false;
6259
+ setHumanRequested(true);
6260
+ stopAwaitingReply();
6261
+ } else if (update.kind === "reload") {
6262
+ void resyncConversation();
6263
+ } else if (update.kind === "resync") {
6264
+ const latest = update.latestSequence;
6250
6265
  const last = lastConfirmedMessage();
6251
- if (latest && (!last || new Date(last.created_at).getTime() < new Date(latest).getTime())) {
6266
+ if (latest === void 0 || !last?.sequence || last.sequence < latest) {
6252
6267
  fetchNewMessages();
6253
6268
  }
6254
- } else if (envelope.type === "rekey") {
6255
- void resyncConversation();
6256
6269
  }
6257
6270
  } catch {
6258
6271
  }
@@ -6273,7 +6286,15 @@ function useChat(options = {}) {
6273
6286
  ws.onerror = () => {
6274
6287
  };
6275
6288
  wsRef.current = ws;
6276
- }, [appendMessages, startPolling, stopPolling, fetchNewMessages, resyncConversation, lastConfirmedMessage]);
6289
+ }, [
6290
+ appendMessages,
6291
+ startPolling,
6292
+ stopPolling,
6293
+ fetchNewMessages,
6294
+ resyncConversation,
6295
+ lastConfirmedMessage,
6296
+ stopAwaitingReply
6297
+ ]);
6277
6298
  const resetConversation = React14.useCallback(() => {
6278
6299
  stopPolling();
6279
6300
  if (wsReconnectTimerRef.current) {
@@ -6301,9 +6322,9 @@ function useChat(options = {}) {
6301
6322
  const c = clientRef.current;
6302
6323
  setMessages(value.messages);
6303
6324
  setConversationOpened(true);
6304
- aiEnabledRef.current = value.conversation.ai_enabled;
6305
- setHumanRequested(value.conversation.needs_human_review ?? false);
6306
- setSeenAt(value.conversation.team_read_at ?? null);
6325
+ aiEnabledRef.current = value.conversation.ai_mode === "auto";
6326
+ setHumanRequested(value.conversation.ai_mode === "off");
6327
+ setSeenAt(null);
6307
6328
  setMayHaveOlder(value.messages.length >= 50);
6308
6329
  setClaimedAs(c?.support.claimedCustomerName ?? null);
6309
6330
  connectWebSocket();
@@ -6326,7 +6347,7 @@ function useChat(options = {}) {
6326
6347
  const watchSessionClaims = React14.useCallback(() => {
6327
6348
  const c = clientRef.current;
6328
6349
  if (!c || claimUnsubRef.current) return;
6329
- const unsubClaimed = c.events.on(chunkR6OLQ33I_js.SESSION_CLAIMED, (event) => {
6350
+ const unsubClaimed = c.events.on(chunk5BDYDZ4U_js.SESSION_CLAIMED, (event) => {
6330
6351
  setClaimedAs(event.customerName || c.support.claimedCustomerName || null);
6331
6352
  if (!openedRef.current) {
6332
6353
  void openIfExisting();
@@ -6335,7 +6356,7 @@ function useChat(options = {}) {
6335
6356
  connectWebSocket();
6336
6357
  void resyncConversation();
6337
6358
  });
6338
- const unsubCleared = c.events.on(chunkR6OLQ33I_js.SESSION_CLEARED, resetConversation);
6359
+ const unsubCleared = c.events.on(chunk5BDYDZ4U_js.SESSION_CLEARED, resetConversation);
6339
6360
  claimUnsubRef.current = () => {
6340
6361
  unsubClaimed();
6341
6362
  unsubCleared();
@@ -6387,7 +6408,7 @@ function useChat(options = {}) {
6387
6408
  if (!openedRef.current) return false;
6388
6409
  }
6389
6410
  const replyTo = opts?.replyTo;
6390
- const clientId = chunkJSWJ4XDE_js.generateIdempotencyKey();
6411
+ const clientId = chunkIQFFSKE2_js.generateIdempotencyKey();
6391
6412
  const localId = optimisticId(clientId);
6392
6413
  const optimistic = {
6393
6414
  id: localId,
@@ -6472,7 +6493,7 @@ function useChat(options = {}) {
6472
6493
  const c = clientRef.current;
6473
6494
  const earliest = messagesRef.current[0];
6474
6495
  if (!c || !earliest) return false;
6475
- const result = await c.support.getMessages({ before: earliest.created_at, limit: 50 });
6496
+ const result = await c.support.getMessages({ beforeSequence: earliest.sequence, limit: 50 });
6476
6497
  if (!result.ok) {
6477
6498
  setError(result.error);
6478
6499
  return false;
@@ -6576,15 +6597,15 @@ function AuthElement({
6576
6597
  }, [onReady, onAuthenticated, onError]);
6577
6598
  React14.useEffect(() => {
6578
6599
  if (!elements || !containerRef.current) return;
6579
- const element = elements.create(chunkJSWJ4XDE_js.ELEMENT_TYPES.AUTH, { prefillEmail });
6600
+ const element = elements.create(chunkIQFFSKE2_js.ELEMENT_TYPES.AUTH, { prefillEmail });
6580
6601
  elementRef.current = element;
6581
- element.on(chunkJSWJ4XDE_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
6602
+ element.on(chunkIQFFSKE2_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
6582
6603
  element.on(
6583
- chunkJSWJ4XDE_js.EVENT_TYPES.AUTHENTICATED,
6604
+ chunkIQFFSKE2_js.EVENT_TYPES.AUTHENTICATED,
6584
6605
  (data) => onAuthenticatedRef.current?.(data)
6585
6606
  );
6586
6607
  element.on(
6587
- chunkJSWJ4XDE_js.EVENT_TYPES.ERROR,
6608
+ chunkIQFFSKE2_js.EVENT_TYPES.ERROR,
6588
6609
  (data) => onErrorRef.current?.(data)
6589
6610
  );
6590
6611
  element.mount(containerRef.current);
@@ -6613,15 +6634,15 @@ function AddressElement({
6613
6634
  }, [onReady, onChange, onError]);
6614
6635
  React14.useEffect(() => {
6615
6636
  if (!elements || !containerRef.current) return;
6616
- const element = elements.create(chunkJSWJ4XDE_js.ELEMENT_TYPES.ADDRESS, { mode });
6637
+ const element = elements.create(chunkIQFFSKE2_js.ELEMENT_TYPES.ADDRESS, { mode });
6617
6638
  elementRef.current = element;
6618
- element.on(chunkJSWJ4XDE_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
6639
+ element.on(chunkIQFFSKE2_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
6619
6640
  element.on(
6620
- chunkJSWJ4XDE_js.EVENT_TYPES.CHANGE,
6641
+ chunkIQFFSKE2_js.EVENT_TYPES.CHANGE,
6621
6642
  (data) => onChangeRef.current?.(data)
6622
6643
  );
6623
6644
  element.on(
6624
- chunkJSWJ4XDE_js.EVENT_TYPES.ERROR,
6645
+ chunkIQFFSKE2_js.EVENT_TYPES.ERROR,
6625
6646
  (data) => onErrorRef.current?.(data)
6626
6647
  );
6627
6648
  element.mount(containerRef.current);
@@ -6651,15 +6672,15 @@ function PaymentElement({
6651
6672
  }, [onReady, onChange, onError]);
6652
6673
  React14.useEffect(() => {
6653
6674
  if (!elements || !containerRef.current) return;
6654
- const element = elements.create(chunkJSWJ4XDE_js.ELEMENT_TYPES.PAYMENT, { amount, currency });
6675
+ const element = elements.create(chunkIQFFSKE2_js.ELEMENT_TYPES.PAYMENT, { amount, currency });
6655
6676
  elementRef.current = element;
6656
- element.on(chunkJSWJ4XDE_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
6677
+ element.on(chunkIQFFSKE2_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
6657
6678
  element.on(
6658
- chunkJSWJ4XDE_js.EVENT_TYPES.CHANGE,
6679
+ chunkIQFFSKE2_js.EVENT_TYPES.CHANGE,
6659
6680
  (data) => onChangeRef.current?.(data)
6660
6681
  );
6661
6682
  element.on(
6662
- chunkJSWJ4XDE_js.EVENT_TYPES.ERROR,
6683
+ chunkIQFFSKE2_js.EVENT_TYPES.ERROR,
6663
6684
  (data) => onErrorRef.current?.(data)
6664
6685
  );
6665
6686
  element.mount(containerRef.current);
@@ -6816,7 +6837,7 @@ function VariantSelector({
6816
6837
  if (!variants || variants.length <= 1) {
6817
6838
  return null;
6818
6839
  }
6819
- basePrice != null ? chunkNNG6IFFX_js.parsePrice(basePrice) : 0;
6840
+ basePrice != null ? chunk7PDEX54K_js.parsePrice(basePrice) : 0;
6820
6841
  if (variantAxes && variantAxes.length > 0) {
6821
6842
  return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-variant-selector": true, className: cn("space-y-5", className, classNames?.root), children: variantAxes.map((axis) => {
6822
6843
  const labelId = `${idPrefix}-axis-${axis.id}`;
@@ -6922,7 +6943,7 @@ function VariantSelector({
6922
6943
  className: cn("divide-y divide-border", classNames?.list),
6923
6944
  children: variants.map((variant) => {
6924
6945
  const isSelected = selectedVariantId === variant.id;
6925
- const adjustment = chunkNNG6IFFX_js.parsePrice(variant.price_adjustment);
6946
+ const adjustment = chunk7PDEX54K_js.parsePrice(variant.price_adjustment);
6926
6947
  return /* @__PURE__ */ jsxRuntime.jsxs(
6927
6948
  radio.Radio.Root,
6928
6949
  {
@@ -7190,16 +7211,16 @@ function BundleSelector({
7190
7211
  }, [components, selections, onReady]);
7191
7212
  const totalPrice = React14.useMemo(() => {
7192
7213
  if (pricingType === "fixed" && bundlePrice) {
7193
- return chunkNNG6IFFX_js.parsePrice(bundlePrice);
7214
+ return chunk7PDEX54K_js.parsePrice(bundlePrice);
7194
7215
  }
7195
7216
  const componentsTotal = components.reduce((sum, comp) => {
7196
7217
  return sum + getComponentPrice(comp, variantChoices[comp.id]) * comp.quantity;
7197
7218
  }, 0);
7198
7219
  if (pricingType === "percentage_discount" && discountValue) {
7199
- return componentsTotal * (1 - chunkNNG6IFFX_js.parsePrice(discountValue) / 100);
7220
+ return componentsTotal * (1 - chunk7PDEX54K_js.parsePrice(discountValue) / 100);
7200
7221
  }
7201
7222
  if (pricingType === "fixed_discount" && discountValue) {
7202
- return componentsTotal - chunkNNG6IFFX_js.parsePrice(discountValue);
7223
+ return componentsTotal - chunk7PDEX54K_js.parsePrice(discountValue);
7203
7224
  }
7204
7225
  return componentsTotal;
7205
7226
  }, [components, variantChoices, pricingType, bundlePrice, discountValue]);
@@ -7261,15 +7282,15 @@ function BundleSelector({
7261
7282
  }
7262
7283
  function getComponentPrice(component, selectedVariantId) {
7263
7284
  if (!selectedVariantId || component.available_variants.length === 0) {
7264
- return chunkNNG6IFFX_js.parsePrice(component.effective_price);
7285
+ return chunk7PDEX54K_js.parsePrice(component.effective_price);
7265
7286
  }
7266
7287
  if (selectedVariantId === component.variant_id) {
7267
- return chunkNNG6IFFX_js.parsePrice(component.effective_price);
7288
+ return chunk7PDEX54K_js.parsePrice(component.effective_price);
7268
7289
  }
7269
7290
  const bakedAdj = component.variant_id ? component.available_variants.find((v) => v.id === component.variant_id) : void 0;
7270
7291
  const selectedAdj = component.available_variants.find((v) => v.id === selectedVariantId);
7271
- if (!selectedAdj) return chunkNNG6IFFX_js.parsePrice(component.effective_price);
7272
- return chunkNNG6IFFX_js.parsePrice(component.effective_price) - chunkNNG6IFFX_js.parsePrice(bakedAdj?.price_adjustment ?? "0") + chunkNNG6IFFX_js.parsePrice(selectedAdj.price_adjustment);
7292
+ if (!selectedAdj) return chunk7PDEX54K_js.parsePrice(component.effective_price);
7293
+ return chunk7PDEX54K_js.parsePrice(component.effective_price) - chunk7PDEX54K_js.parsePrice(bakedAdj?.price_adjustment ?? "0") + chunk7PDEX54K_js.parsePrice(selectedAdj.price_adjustment);
7273
7294
  }
7274
7295
  function formatDuration(minutes, unit) {
7275
7296
  if (unit === "hours" || !unit && minutes >= 60 && minutes % 60 === 0) {
@@ -7383,7 +7404,7 @@ function BundleComponentCard({
7383
7404
  className: cn("mt-3 divide-y divide-border", classNames?.variantPicker),
7384
7405
  children: component.available_variants.map((variant) => {
7385
7406
  const isSelected = selectedVariantId === variant.id;
7386
- const adjustment = chunkNNG6IFFX_js.parsePrice(variant.price_adjustment);
7407
+ const adjustment = chunk7PDEX54K_js.parsePrice(variant.price_adjustment);
7387
7408
  return /* @__PURE__ */ jsxRuntime.jsxs(
7388
7409
  radio.Radio.Root,
7389
7410
  {
@@ -7830,7 +7851,7 @@ function CompositeSelector({
7830
7851
  "data-cimplify-composite-summary": true,
7831
7852
  className: cn("border-t border-border pt-4 space-y-1 text-sm", classNames?.summary),
7832
7853
  children: [
7833
- chunkNNG6IFFX_js.parsePrice(priceResult.base_price) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
7854
+ chunk7PDEX54K_js.parsePrice(priceResult.base_price) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
7834
7855
  "div",
7835
7856
  {
7836
7857
  "data-cimplify-composite-summary-line": true,
@@ -7841,7 +7862,7 @@ function CompositeSelector({
7841
7862
  ]
7842
7863
  }
7843
7864
  ),
7844
- chunkNNG6IFFX_js.parsePrice(priceResult.components_total) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
7865
+ chunk7PDEX54K_js.parsePrice(priceResult.components_total) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
7845
7866
  "div",
7846
7867
  {
7847
7868
  "data-cimplify-composite-summary-line": true,
@@ -7985,7 +8006,7 @@ function BookingSummary({
7985
8006
  className,
7986
8007
  classNames
7987
8008
  }) {
7988
- const depositValue = depositAmount != null ? chunkNNG6IFFX_js.parsePrice(depositAmount) : 0;
8009
+ const depositValue = depositAmount != null ? chunk7PDEX54K_js.parsePrice(depositAmount) : 0;
7989
8010
  const depositDue = depositType === "percentage" ? total * depositValue / 100 : depositType === "fixed" ? depositValue : 0;
7990
8011
  const hasDeposit = depositDue > 0;
7991
8012
  const balance = Math.max(0, total - depositDue);
@@ -8713,7 +8734,7 @@ function InputField({
8713
8734
  currency,
8714
8735
  classNames
8715
8736
  }) {
8716
- const hasPriceAdjustment = field.price_adjustment != null && chunkNNG6IFFX_js.parsePrice(field.price_adjustment) > 0;
8737
+ const hasPriceAdjustment = field.price_adjustment != null && chunk7PDEX54K_js.parsePrice(field.price_adjustment) > 0;
8717
8738
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-customer-input": true, "data-field-type": field.field_type, className: classNames?.field, children: [
8718
8739
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-1.5", children: [
8719
8740
  /* @__PURE__ */ jsxRuntime.jsx("label", { className: cn("text-sm font-semibold", classNames?.label), children: field.name }),
@@ -9845,15 +9866,15 @@ function ProductCustomizerContent({
9845
9866
  }, [selectedAddOnOptionIds]);
9846
9867
  const localTotalPrice = React14.useMemo(() => {
9847
9868
  if (isComposite && compositePrice) {
9848
- return chunkNNG6IFFX_js.parsePrice(compositePrice.final_price) * quantity;
9869
+ return chunk7PDEX54K_js.parsePrice(compositePrice.final_price) * quantity;
9849
9870
  }
9850
9871
  if (isBundle && bundleTotalPrice != null) {
9851
9872
  return bundleTotalPrice * quantity;
9852
9873
  }
9853
- let price = chunkNNG6IFFX_js.getVariantUnitPrice(product, selectedVariant);
9874
+ let price = chunk7PDEX54K_js.getVariantUnitPrice(product, selectedVariant);
9854
9875
  for (const option of selectedAddOnOptions) {
9855
9876
  if (option.default_price) {
9856
- price += chunkNNG6IFFX_js.parsePrice(option.default_price);
9877
+ price += chunk7PDEX54K_js.parsePrice(option.default_price);
9857
9878
  }
9858
9879
  }
9859
9880
  return price * quantity;
@@ -9919,12 +9940,12 @@ function ProductCustomizerContent({
9919
9940
  } = useQuote(quoteInput, {
9920
9941
  enabled: quoteEnabled
9921
9942
  });
9922
- const currency = quote?.currency ?? chunkNNG6IFFX_js.getProductCurrency(product);
9943
+ const currency = quote?.currency ?? chunk7PDEX54K_js.getProductCurrency(product);
9923
9944
  const quoteId = quote?.quote_id;
9924
9945
  const quotedUnitPrice = (quote?.quoted_total_price_info ?? quote?.final_price_info)?.final_price;
9925
9946
  const quotedTotalPrice = React14.useMemo(() => {
9926
9947
  if (quotedUnitPrice === void 0 || quotedUnitPrice === null) return void 0;
9927
- return chunkNNG6IFFX_js.parsePrice(quotedUnitPrice) * quantity;
9948
+ return chunk7PDEX54K_js.parsePrice(quotedUnitPrice) * quantity;
9928
9949
  }, [quotedUnitPrice, quantity]);
9929
9950
  const quoteIsReady = quoteEnabled && quote !== null && !isQuoteLoading && !quoteError && !isQuoteExpired2;
9930
9951
  const validationMessage = !quoteEnabled ? REQUIRED_OPTIONS_MESSAGE : quoteError ? QUOTE_UNAVAILABLE_MESSAGE : !quoteIsReady ? QUOTE_LOADING_MESSAGE : null;
@@ -10148,7 +10169,7 @@ function ProductCustomizerContent({
10148
10169
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.deposit_amount, currency })
10149
10170
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
10150
10171
  "Deposit required: ",
10151
- chunkNNG6IFFX_js.parsePrice(product.deposit_amount),
10172
+ chunk7PDEX54K_js.parsePrice(product.deposit_amount),
10152
10173
  "%"
10153
10174
  ] })
10154
10175
  }
@@ -10256,10 +10277,10 @@ function ProductCustomizerContent({
10256
10277
  /* @__PURE__ */ jsxRuntime.jsx(
10257
10278
  Price,
10258
10279
  {
10259
- amount: chunkNNG6IFFX_js.getUnitPriceAtQuantity(
10280
+ amount: chunk7PDEX54K_js.getUnitPriceAtQuantity(
10260
10281
  product.quantity_pricing,
10261
10282
  quantity,
10262
- chunkNNG6IFFX_js.parsePrice(product.default_price)
10283
+ chunk7PDEX54K_js.parsePrice(product.default_price)
10263
10284
  ),
10264
10285
  currency,
10265
10286
  className: "font-medium text-foreground"
@@ -10725,11 +10746,11 @@ function CartLineItemRow({
10725
10746
  addOnOptions: item.addOnOptions
10726
10747
  });
10727
10748
  const pinnedUnitPrice = item._quotedUnitPrice;
10728
- const unitPrice = pinnedUnitPrice === void 0 ? locallyResolvedUnitPrice : chunkNNG6IFFX_js.parsePrice(pinnedUnitPrice);
10749
+ const unitPrice = pinnedUnitPrice === void 0 ? locallyResolvedUnitPrice : chunk7PDEX54K_js.parsePrice(pinnedUnitPrice);
10729
10750
  const hasComposite = item.compositeSelections && item.compositeSelections.length > 0;
10730
10751
  const hasBundle = item.bundleSelections && item.bundleSelections.length > 0;
10731
10752
  const isOptimistic2 = item.isOptimistic === true;
10732
- const lineTotal = chunkNNG6IFFX_js.parsePrice(unitPrice) * item.quantity;
10753
+ const lineTotal = chunk7PDEX54K_js.parsePrice(unitPrice) * item.quantity;
10733
10754
  const imageUrl = item.product.image_url;
10734
10755
  const variantLabel2 = item.variant ? chunk2P4KXFB6_js.getVariantDisplayName(item.variant, item.product.name) : null;
10735
10756
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -11018,7 +11039,7 @@ function CartSummary({
11018
11039
  removeItem,
11019
11040
  updateQuantity
11020
11041
  } = useCart();
11021
- const displayCurrency = serverCart?.currency ?? chunkJG5CQNCB_js.currencyCode(currency);
11042
+ const displayCurrency = serverCart?.currency ?? chunk4BKOKHE3_js.currencyCode(currency);
11022
11043
  const deliveryFee = serverCart?.delivery_fee;
11023
11044
  const serviceCharge = serverCart?.service_charge;
11024
11045
  const totalDiscounts = serverCart?.total_discounts;
@@ -11081,7 +11102,7 @@ function CartSummary({
11081
11102
  ]
11082
11103
  }
11083
11104
  ),
11084
- totalDiscounts != null && chunkNNG6IFFX_js.parsePrice(totalDiscounts) > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
11105
+ totalDiscounts != null && chunk7PDEX54K_js.parsePrice(totalDiscounts) > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
11085
11106
  "div",
11086
11107
  {
11087
11108
  "data-cimplify-cart-discount": true,
@@ -11107,7 +11128,7 @@ function CartSummary({
11107
11128
  className: cn("flex items-baseline justify-between", classNames?.deliveryFee),
11108
11129
  children: [
11109
11130
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Delivery" }),
11110
- chunkNNG6IFFX_js.parsePrice(deliveryFee) > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
11131
+ chunk7PDEX54K_js.parsePrice(deliveryFee) > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
11111
11132
  Price,
11112
11133
  {
11113
11134
  amount: deliveryFee,
@@ -11118,7 +11139,7 @@ function CartSummary({
11118
11139
  ]
11119
11140
  }
11120
11141
  ),
11121
- serviceCharge != null && chunkNNG6IFFX_js.parsePrice(serviceCharge) > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
11142
+ serviceCharge != null && chunk7PDEX54K_js.parsePrice(serviceCharge) > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
11122
11143
  "div",
11123
11144
  {
11124
11145
  "data-cimplify-cart-service-charge": true,
@@ -11252,18 +11273,18 @@ function SaleBadge({
11252
11273
  className,
11253
11274
  classNames
11254
11275
  }) {
11255
- const onSale = chunkNNG6IFFX_js.isOnSale(product);
11276
+ const onSale = chunk7PDEX54K_js.isOnSale(product);
11256
11277
  const hasDeal = dealInfo !== void 0;
11257
11278
  if (!hasDeal && !onSale && !label) {
11258
11279
  return null;
11259
11280
  }
11260
11281
  let percentage = null;
11261
11282
  if (product.sale) {
11262
- percentage = chunkNNG6IFFX_js.parsePrice(product.sale.percent_off);
11283
+ percentage = chunk7PDEX54K_js.parsePrice(product.sale.percent_off);
11263
11284
  } else if (hasDeal && dealInfo.benefit_type === "percentage") {
11264
- percentage = chunkNNG6IFFX_js.parsePrice(dealInfo.value);
11285
+ percentage = chunk7PDEX54K_js.parsePrice(dealInfo.value);
11265
11286
  } else if (onSale) {
11266
- percentage = chunkNNG6IFFX_js.getDiscountPercentage(product);
11287
+ percentage = chunk7PDEX54K_js.getDiscountPercentage(product);
11267
11288
  }
11268
11289
  const badgeText = label ?? product.sale?.badge_text ?? dealInfo?.label ?? (percentage != null && percentage > 0 ? `${percentage}% off` : null);
11269
11290
  if (!badgeText) {
@@ -11282,7 +11303,7 @@ function SaleBadge({
11282
11303
  "%"
11283
11304
  ] }),
11284
11305
  /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-label": true, className: classNames?.label, children: badgeText }),
11285
- showOriginalPrice && onSale && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-original-price": true, className: classNames?.originalPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkNNG6IFFX_js.getBasePrice(product), currency: chunkNNG6IFFX_js.getProductCurrency(product) }) })
11306
+ showOriginalPrice && onSale && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-original-price": true, className: classNames?.originalPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk7PDEX54K_js.getBasePrice(product), currency: chunk7PDEX54K_js.getProductCurrency(product) }) })
11286
11307
  ]
11287
11308
  }
11288
11309
  );
@@ -11300,7 +11321,7 @@ function SalePrice({
11300
11321
  if (!sale) {
11301
11322
  return /* @__PURE__ */ jsxRuntime.jsx(Price, { amount, currency, className });
11302
11323
  }
11303
- const off = Math.round(chunkNNG6IFFX_js.parsePrice(sale.percent_off));
11324
+ const off = Math.round(chunk7PDEX54K_js.parsePrice(sale.percent_off));
11304
11325
  return /* @__PURE__ */ jsxRuntime.jsxs(
11305
11326
  "span",
11306
11327
  {
@@ -11676,7 +11697,7 @@ function ProductSheet({
11676
11697
  Price,
11677
11698
  {
11678
11699
  amount: fullProduct.default_price,
11679
- currency: chunkNNG6IFFX_js.getProductCurrency(fullProduct),
11700
+ currency: chunk7PDEX54K_js.getProductCurrency(fullProduct),
11680
11701
  className: classNames?.price
11681
11702
  }
11682
11703
  )
@@ -11862,10 +11883,10 @@ function SoldOutOverlay() {
11862
11883
  function SaleBadge2({ product }) {
11863
11884
  let label = null;
11864
11885
  if (product.sale) {
11865
- const off = Math.round(chunkNNG6IFFX_js.parsePrice(product.sale.percent_off));
11886
+ const off = Math.round(chunk7PDEX54K_js.parsePrice(product.sale.percent_off));
11866
11887
  label = product.sale.badge_text ?? (off > 0 ? `-${off}%` : null);
11867
- } else if (chunkNNG6IFFX_js.isOnSale(product)) {
11868
- const pct = chunkNNG6IFFX_js.getDiscountPercentage(product);
11888
+ } else if (chunk7PDEX54K_js.isOnSale(product)) {
11889
+ const pct = chunk7PDEX54K_js.getDiscountPercentage(product);
11869
11890
  label = pct && pct > 0 ? `-${pct}%` : null;
11870
11891
  }
11871
11892
  if (!label) return null;
@@ -11906,7 +11927,7 @@ function FoodProductCard({
11906
11927
  className
11907
11928
  }) {
11908
11929
  const image = product.image_url || product.images?.[0] || "";
11909
- const currency = chunkNNG6IFFX_js.getProductCurrency(product);
11930
+ const currency = chunk7PDEX54K_js.getProductCurrency(product);
11910
11931
  const tags = product.tags || [];
11911
11932
  const isSignature = product.metadata?.is_signature === true;
11912
11933
  const isNew = product.metadata?.is_new === true;
@@ -11962,9 +11983,9 @@ function RetailProductCard({
11962
11983
  className
11963
11984
  }) {
11964
11985
  const image = product.image_url || product.images?.[0] || "";
11965
- const currency = chunkNNG6IFFX_js.getProductCurrency(product);
11986
+ const currency = chunk7PDEX54K_js.getProductCurrency(product);
11966
11987
  const outOfStock = product.inventory_status?.in_stock === false;
11967
- const onSale = chunkNNG6IFFX_js.isOnSale(product);
11988
+ const onSale = chunk7PDEX54K_js.isOnSale(product);
11968
11989
  const swatches = getColorSwatches(product);
11969
11990
  return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, disabled: outOfStock, className, children: [
11970
11991
  outOfStock && /* @__PURE__ */ jsxRuntime.jsx(SoldOutOverlay, {}),
@@ -11985,7 +12006,7 @@ function RetailProductCard({
11985
12006
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.original, currency, className: "text-xs text-muted-foreground line-through" })
11986
12007
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11987
12008
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
11988
- onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkNNG6IFFX_js.getBasePrice(product), currency, className: "text-xs text-muted-foreground line-through" })
12009
+ onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk7PDEX54K_js.getBasePrice(product), currency, className: "text-xs text-muted-foreground line-through" })
11989
12010
  ] }) }),
11990
12011
  swatches.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1.5 mt-2.5", children: swatches.map((name) => /* @__PURE__ */ jsxRuntime.jsx(
11991
12012
  "span",
@@ -12000,10 +12021,10 @@ function RetailProductCard({
12000
12021
  ] });
12001
12022
  }
12002
12023
  function PriceRange({ product, currency, className }) {
12003
- const resolvedCurrency = currency ?? chunkNNG6IFFX_js.getProductCurrency(product);
12004
- const range = chunkNNG6IFFX_js.getPriceRange(product);
12024
+ const resolvedCurrency = currency ?? chunk7PDEX54K_js.getProductCurrency(product);
12025
+ const range = chunk7PDEX54K_js.getPriceRange(product);
12005
12026
  if (!range) return null;
12006
- return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-price-range": true, className, children: chunkNNG6IFFX_js.formatPriceRange(range.min, range.max, resolvedCurrency) });
12027
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-price-range": true, className, children: chunk7PDEX54K_js.formatPriceRange(range.min, range.max, resolvedCurrency) });
12007
12028
  }
12008
12029
  function WholesaleProductCard({
12009
12030
  product,
@@ -12013,7 +12034,7 @@ function WholesaleProductCard({
12013
12034
  className
12014
12035
  }) {
12015
12036
  const image = product.image_url || product.images?.[0] || "";
12016
- const currency = chunkNNG6IFFX_js.getProductCurrency(product);
12037
+ const currency = chunk7PDEX54K_js.getProductCurrency(product);
12017
12038
  const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
12018
12039
  const status = product.inventory_status;
12019
12040
  return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
@@ -12061,7 +12082,7 @@ function DigitalProductCard({
12061
12082
  className
12062
12083
  }) {
12063
12084
  const image = product.image_url || product.images?.[0] || "";
12064
- const currency = chunkNNG6IFFX_js.getProductCurrency(product);
12085
+ const currency = chunk7PDEX54K_js.getProductCurrency(product);
12065
12086
  const typeBadge = product.digital_type ? TYPE_BADGES[product.digital_type] : null;
12066
12087
  const isTicket = product.digital_type === "ticket";
12067
12088
  return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
@@ -12092,11 +12113,11 @@ function BundleProductCard({
12092
12113
  className
12093
12114
  }) {
12094
12115
  const image = product.image_url || product.images?.[0] || "";
12095
- const currency = chunkNNG6IFFX_js.getProductCurrency(product);
12116
+ const currency = chunk7PDEX54K_js.getProductCurrency(product);
12096
12117
  const components = product.components || [];
12097
12118
  const componentCount = components.length;
12098
- const onSale = chunkNNG6IFFX_js.isOnSale(product);
12099
- const discount = chunkNNG6IFFX_js.getDiscountPercentage(product);
12119
+ const onSale = chunk7PDEX54K_js.isOnSale(product);
12120
+ const discount = chunk7PDEX54K_js.getDiscountPercentage(product);
12100
12121
  const hasVariantChoice = components.some((c) => c.allow_variant_choice);
12101
12122
  return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
12102
12123
  /* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "square", renderImage, children: [
@@ -12123,7 +12144,7 @@ function BundleProductCard({
12123
12144
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mt-2.5", children: [
12124
12145
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
12125
12146
  onSale && product.bundle_price && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
12126
- /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkNNG6IFFX_js.getBasePrice(product), currency, className: "text-xs text-muted-foreground line-through" }),
12147
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk7PDEX54K_js.getBasePrice(product), currency, className: "text-xs text-muted-foreground line-through" }),
12127
12148
  discount != null && discount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] font-semibold text-emerald-600", children: [
12128
12149
  "Save ",
12129
12150
  discount,
@@ -12143,7 +12164,7 @@ function CompositeProductCard({
12143
12164
  className
12144
12165
  }) {
12145
12166
  const image = product.image_url || product.images?.[0] || "";
12146
- const currency = chunkNNG6IFFX_js.getProductCurrency(product);
12167
+ const currency = chunk7PDEX54K_js.getProductCurrency(product);
12147
12168
  const groups = product.groups || [];
12148
12169
  const groupCount = groups.length;
12149
12170
  groups.reduce((sum, g) => sum + g.components.length, 0);
@@ -12195,7 +12216,7 @@ function StandardServiceCard({
12195
12216
  className
12196
12217
  }) {
12197
12218
  const image = product.image_url || product.images?.[0] || "";
12198
- const currency = chunkNNG6IFFX_js.getProductCurrency(product);
12219
+ const currency = chunk7PDEX54K_js.getProductCurrency(product);
12199
12220
  const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
12200
12221
  return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
12201
12222
  /* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "16/9", renderImage, children: [
@@ -12250,7 +12271,7 @@ function CompactServiceCard({
12250
12271
  className
12251
12272
  }) {
12252
12273
  const image = product.image_url || product.images?.[0] || "";
12253
- const currency = chunkNNG6IFFX_js.getProductCurrency(product);
12274
+ const currency = chunk7PDEX54K_js.getProductCurrency(product);
12254
12275
  const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
12255
12276
  const hasBillingPlans = product.billing_plans && product.billing_plans.length > 0;
12256
12277
  const href = `/products/${product.slug}`;
@@ -12299,7 +12320,7 @@ function ScheduleServiceCard({
12299
12320
  className
12300
12321
  }) {
12301
12322
  const image = product.image_url || product.images?.[0] || "";
12302
- const currency = chunkNNG6IFFX_js.getProductCurrency(product);
12323
+ const currency = chunk7PDEX54K_js.getProductCurrency(product);
12303
12324
  const href = `/products/${product.slug}`;
12304
12325
  const durationLabel = product.duration_minutes != null ? formatDuration2(product.duration_minutes, product.duration_unit) : null;
12305
12326
  const displaySlots = (slots || []).slice(0, 3);
@@ -12371,7 +12392,7 @@ function RentalServiceCard({
12371
12392
  className
12372
12393
  }) {
12373
12394
  const image = product.image_url || product.images?.[0] || "";
12374
- const currency = chunkNNG6IFFX_js.getProductCurrency(product);
12395
+ const currency = chunk7PDEX54K_js.getProductCurrency(product);
12375
12396
  const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
12376
12397
  const unit = product.duration_unit ? UNIT_LABELS2[product.duration_unit] || product.duration_unit : "day";
12377
12398
  const priceUnit = product.price_basis === "per_person" ? "guest" : product.price_basis === "flat" ? "" : unit;
@@ -12441,7 +12462,7 @@ function AccommodationCard({
12441
12462
  className
12442
12463
  }) {
12443
12464
  const image = product.image_url || product.images?.[0] || "";
12444
- const currency = chunkNNG6IFFX_js.getProductCurrency(product);
12465
+ const currency = chunk7PDEX54K_js.getProductCurrency(product);
12445
12466
  const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
12446
12467
  const cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
12447
12468
  const tags = product.tags || [];
@@ -12507,7 +12528,7 @@ function LeaseServiceCard({
12507
12528
  className
12508
12529
  }) {
12509
12530
  const image = product.image_url || product.images?.[0] || "";
12510
- const currency = chunkNNG6IFFX_js.getProductCurrency(product);
12531
+ const currency = chunk7PDEX54K_js.getProductCurrency(product);
12511
12532
  const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
12512
12533
  const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
12513
12534
  const unit = product.duration_unit ? UNIT_LABELS3[product.duration_unit] || product.duration_unit : "mo";
@@ -12581,7 +12602,7 @@ function SubscriptionCard({
12581
12602
  className
12582
12603
  }) {
12583
12604
  const image = product.image_url || product.images?.[0] || "";
12584
- const currency = chunkNNG6IFFX_js.getProductCurrency(product);
12605
+ const currency = chunk7PDEX54K_js.getProductCurrency(product);
12585
12606
  const plans = product.billing_plans || [];
12586
12607
  const primaryPlan = plans[0];
12587
12608
  const frequency = primaryPlan?.frequency ? FREQUENCY_LABELS2[primaryPlan.frequency] || `/${primaryPlan.frequency}` : "/mo";
@@ -12812,7 +12833,7 @@ function ProductCard({
12812
12833
  /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-card-body": true, className: cn("p-4 flex flex-col gap-1", classNames?.body), children: [
12813
12834
  /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-product-card-name": true, className: cn("font-semibold text-foreground leading-tight", classNames?.name), children: product.name }),
12814
12835
  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 }),
12815
- /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency: chunkNNG6IFFX_js.getProductCurrency(product), className: cn("text-sm font-medium text-foreground mt-1", classNames?.price) })
12836
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency: chunk7PDEX54K_js.getProductCurrency(product), className: cn("text-sm font-medium text-foreground mt-1", classNames?.price) })
12816
12837
  ] })
12817
12838
  ] });
12818
12839
  })();
@@ -13141,7 +13162,7 @@ function SearchInput({
13141
13162
  }
13142
13163
  ),
13143
13164
  /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-name": true, className: classNames?.resultName, style: { flex: 1, textAlign: "left" }, children: product.name }),
13144
- product.default_price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-price": true, className: classNames?.resultPrice, style: { flexShrink: 0 }, children: chunkNNG6IFFX_js.formatPrice(product.default_price) })
13165
+ product.default_price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-price": true, className: classNames?.resultPrice, style: { flexShrink: 0 }, children: chunk7PDEX54K_js.formatPrice(product.default_price) })
13145
13166
  ] })
13146
13167
  },
13147
13168
  product.id
@@ -13636,19 +13657,19 @@ function OrderSummary({
13636
13657
  order.customer_notes.map((note, index) => /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-order-note": true, children: note }, index))
13637
13658
  ] }),
13638
13659
  /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-totals": true, className: classNames?.totals, children: [
13639
- order.total_discount != null && chunkNNG6IFFX_js.parsePrice(order.total_discount) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-discount": true, children: [
13660
+ order.total_discount != null && chunk7PDEX54K_js.parsePrice(order.total_discount) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-discount": true, children: [
13640
13661
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Discount" }),
13641
13662
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.total_discount, prefix: "-" })
13642
13663
  ] }),
13643
- order.delivery_fee != null && chunkNNG6IFFX_js.parsePrice(order.delivery_fee) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-delivery-fee": true, children: [
13664
+ order.delivery_fee != null && chunk7PDEX54K_js.parsePrice(order.delivery_fee) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-delivery-fee": true, children: [
13644
13665
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Delivery fee" }),
13645
13666
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.delivery_fee })
13646
13667
  ] }),
13647
- order.service_charge != null && chunkNNG6IFFX_js.parsePrice(order.service_charge) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-service-charge": true, children: [
13668
+ order.service_charge != null && chunk7PDEX54K_js.parsePrice(order.service_charge) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-service-charge": true, children: [
13648
13669
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Service charge" }),
13649
13670
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.service_charge })
13650
13671
  ] }),
13651
- order.tax != null && chunkNNG6IFFX_js.parsePrice(order.tax) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-tax": true, children: [
13672
+ order.tax != null && chunk7PDEX54K_js.parsePrice(order.tax) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-tax": true, children: [
13652
13673
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Tax" }),
13653
13674
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.tax })
13654
13675
  ] }),
@@ -14179,7 +14200,7 @@ function BookingPage({
14179
14200
  const hasStaffStep = staff && staff.length > 0;
14180
14201
  const depositType = product?.deposit_type;
14181
14202
  const depositAmount = product?.deposit_amount;
14182
- const hasDeposit = depositType !== void 0 && depositType !== "none" && depositAmount !== void 0 && chunkNNG6IFFX_js.parsePrice(depositAmount) !== 0;
14203
+ const hasDeposit = depositType !== void 0 && depositType !== "none" && depositAmount !== void 0 && chunk7PDEX54K_js.parsePrice(depositAmount) !== 0;
14183
14204
  const cancellationMinutes = product?.cancellation_window_minutes;
14184
14205
  const noShowFee = product?.no_show_fee;
14185
14206
  const handleSlotSelect = React14.useCallback(
@@ -14312,14 +14333,14 @@ function BookingPage({
14312
14333
  service.price && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-booking-service-price": true, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: service.price, currency }) }),
14313
14334
  hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-deposit-info": true, className: classNames?.depositInfo, children: [
14314
14335
  "Deposit: ",
14315
- depositType === "percentage" ? `${chunkNNG6IFFX_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency })
14336
+ depositType === "percentage" ? `${chunk7PDEX54K_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency })
14316
14337
  ] }),
14317
14338
  cancellationMinutes !== void 0 && cancellationMinutes > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-cancellation-policy": true, className: classNames?.cancellationPolicy, children: [
14318
14339
  "Free cancellation up to ",
14319
14340
  cancellationMinutes >= 60 ? `${Math.floor(cancellationMinutes / 60)} hour${Math.floor(cancellationMinutes / 60) !== 1 ? "s" : ""}` : `${cancellationMinutes} minute${cancellationMinutes !== 1 ? "s" : ""}`,
14320
14341
  " before"
14321
14342
  ] }),
14322
- noShowFee !== void 0 && chunkNNG6IFFX_js.parsePrice(noShowFee) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-no-show-fee": true, className: classNames?.cancellationPolicy, children: [
14343
+ noShowFee !== void 0 && chunk7PDEX54K_js.parsePrice(noShowFee) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-no-show-fee": true, className: classNames?.cancellationPolicy, children: [
14323
14344
  "No-show fee: ",
14324
14345
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: noShowFee, currency })
14325
14346
  ] })
@@ -14422,7 +14443,7 @@ function BookingPage({
14422
14443
  ] }),
14423
14444
  hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-booking-summary-row": true, className: cn(classNames?.summaryRow, classNames?.depositInfo), children: [
14424
14445
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Deposit" }),
14425
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: depositType === "percentage" ? `${chunkNNG6IFFX_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency }) })
14446
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: depositType === "percentage" ? `${chunk7PDEX54K_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency }) })
14426
14447
  ] })
14427
14448
  ] }),
14428
14449
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -15096,9 +15117,9 @@ function DefaultProductLayout({
15096
15117
  }) {
15097
15118
  const [selectedVariantId, setSelectedVariantId] = React14__default.default.useState();
15098
15119
  const images = chunk2P4KXFB6_js.resolveGallery(product, selectedVariantId);
15099
- const currency = chunkNNG6IFFX_js.getProductCurrency(product);
15120
+ const currency = chunk7PDEX54K_js.getProductCurrency(product);
15100
15121
  const hasRange = product.quantity_pricing && product.quantity_pricing.length > 1 || product.variants && product.variants.length > 1;
15101
- const onSale = chunkNNG6IFFX_js.isOnSale(product);
15122
+ const onSale = chunk7PDEX54K_js.isOnSale(product);
15102
15123
  const hasPhysicalDetails = product.sku || product.vendor || product.material;
15103
15124
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "default", className: cn("space-y-8", className), children: [
15104
15125
  renderBreadcrumb?.(product),
@@ -15121,13 +15142,13 @@ function DefaultProductLayout({
15121
15142
  /* @__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: [
15122
15143
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.price, currency, className: "text-2xl font-extrabold" }),
15123
15144
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.original, currency, className: "text-lg text-muted-foreground line-through" }),
15124
- /* @__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(chunkNNG6IFFX_js.parsePrice(product.sale.percent_off))}% OFF` })
15145
+ /* @__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(chunk7PDEX54K_js.parsePrice(product.sale.percent_off))}% OFF` })
15125
15146
  ] }) : onSale ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
15126
15147
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-extrabold" }),
15127
- /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkNNG6IFFX_js.getBasePrice(product), currency, className: "text-lg text-muted-foreground line-through" }),
15148
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk7PDEX54K_js.getBasePrice(product), currency, className: "text-lg text-muted-foreground line-through" }),
15128
15149
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-bold text-destructive bg-destructive/10 px-2 py-0.5", children: [
15129
15150
  "Save ",
15130
- chunkNNG6IFFX_js.getDiscountPercentage(product),
15151
+ chunk7PDEX54K_js.getDiscountPercentage(product),
15131
15152
  "%"
15132
15153
  ] })
15133
15154
  ] }) : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-semibold" }) }),
@@ -15189,7 +15210,7 @@ function FoodProductLayout({
15189
15210
  className
15190
15211
  }) {
15191
15212
  const images = product.images || (product.image_url ? [product.image_url] : []);
15192
- const currency = chunkNNG6IFFX_js.getProductCurrency(product);
15213
+ const currency = chunk7PDEX54K_js.getProductCurrency(product);
15193
15214
  const tags = product.tags || [];
15194
15215
  const ingredients = getMetadataStringList(product.metadata, "ingredients");
15195
15216
  const pairings = getMetadataStringList(product.metadata, "pairings");
@@ -15264,7 +15285,7 @@ function WholesaleProductLayout({
15264
15285
  className
15265
15286
  }) {
15266
15287
  const images = product.images || (product.image_url ? [product.image_url] : []);
15267
- const currency = chunkNNG6IFFX_js.getProductCurrency(product);
15288
+ const currency = chunk7PDEX54K_js.getProductCurrency(product);
15268
15289
  const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
15269
15290
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "wholesale", className: cn("space-y-8", className), children: [
15270
15291
  renderBreadcrumb?.(product),
@@ -15348,9 +15369,9 @@ function ServiceProductLayout({
15348
15369
  className
15349
15370
  }) {
15350
15371
  const images = product.images || (product.image_url ? [product.image_url] : []);
15351
- const currency = chunkNNG6IFFX_js.getProductCurrency(product);
15372
+ const currency = chunk7PDEX54K_js.getProductCurrency(product);
15352
15373
  const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
15353
- const depositAmount = hasDeposit ? chunkNNG6IFFX_js.parsePrice(product.deposit_amount) : 0;
15374
+ const depositAmount = hasDeposit ? chunk7PDEX54K_js.parsePrice(product.deposit_amount) : 0;
15354
15375
  const cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
15355
15376
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "service", className: cn("space-y-8", className), children: [
15356
15377
  renderBreadcrumb?.(product),
@@ -15418,7 +15439,7 @@ function ServiceProductLayout({
15418
15439
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency, className: "font-medium text-foreground" }),
15419
15440
  " deposit charged at booking"
15420
15441
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
15421
- chunkNNG6IFFX_js.parsePrice(product.deposit_amount),
15442
+ chunk7PDEX54K_js.parsePrice(product.deposit_amount),
15422
15443
  "% deposit charged at booking"
15423
15444
  ] }) })
15424
15445
  ] })
@@ -15450,7 +15471,7 @@ function DigitalProductLayout({
15450
15471
  className
15451
15472
  }) {
15452
15473
  const images = product.images || (product.image_url ? [product.image_url] : []);
15453
- const currency = chunkNNG6IFFX_js.getProductCurrency(product);
15474
+ const currency = chunk7PDEX54K_js.getProductCurrency(product);
15454
15475
  const typeLabel = product.digital_type ? DIGITAL_TYPE_LABELS[product.digital_type] || product.digital_type : "Digital product";
15455
15476
  const isTicket = product.digital_type === "ticket";
15456
15477
  const isAccessPass = product.digital_type === "access_grant";
@@ -15577,15 +15598,15 @@ function BundleProductLayout({
15577
15598
  className
15578
15599
  }) {
15579
15600
  const images = product.images || (product.image_url ? [product.image_url] : []);
15580
- const currency = chunkNNG6IFFX_js.getProductCurrency(product);
15601
+ const currency = chunk7PDEX54K_js.getProductCurrency(product);
15581
15602
  const components = product.components || [];
15582
- const onSale = chunkNNG6IFFX_js.isOnSale(product);
15583
- const discount = chunkNNG6IFFX_js.getDiscountPercentage(product);
15603
+ const onSale = chunk7PDEX54K_js.isOnSale(product);
15604
+ const discount = chunk7PDEX54K_js.getDiscountPercentage(product);
15584
15605
  const baseTotal = components.reduce(
15585
- (sum, c) => sum + chunkNNG6IFFX_js.parsePrice(c.effective_price ?? 0) * (c.quantity ?? 1),
15606
+ (sum, c) => sum + chunk7PDEX54K_js.parsePrice(c.effective_price ?? 0) * (c.quantity ?? 1),
15586
15607
  0
15587
15608
  );
15588
- const bundlePrice = chunkNNG6IFFX_js.parsePrice(product.default_price);
15609
+ const bundlePrice = chunk7PDEX54K_js.parsePrice(product.default_price);
15589
15610
  const savings = baseTotal > bundlePrice ? baseTotal - bundlePrice : 0;
15590
15611
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "bundle", className: cn("space-y-8", className), children: [
15591
15612
  renderBreadcrumb?.(product),
@@ -15661,7 +15682,7 @@ function CompositeProductLayout({
15661
15682
  className
15662
15683
  }) {
15663
15684
  const images = product.images || (product.image_url ? [product.image_url] : []);
15664
- const currency = chunkNNG6IFFX_js.getProductCurrency(product);
15685
+ const currency = chunk7PDEX54K_js.getProductCurrency(product);
15665
15686
  const groups = product.groups || [];
15666
15687
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "composite", className: cn("space-y-8", className), children: [
15667
15688
  renderBreadcrumb?.(product),
@@ -16084,7 +16105,7 @@ function CartDrawer({
16084
16105
  }) {
16085
16106
  const { isOpen, close } = useCartDrawer();
16086
16107
  const cart = useCart();
16087
- const subtotalNum = chunkNNG6IFFX_js.parsePrice(cart.subtotal);
16108
+ const subtotalNum = chunk7PDEX54K_js.parsePrice(cart.subtotal);
16088
16109
  const animatedSubtotal = useAnimatedNumber(subtotalNum);
16089
16110
  React14.useEffect(() => {
16090
16111
  if (!isOpen) return;
@@ -16478,9 +16499,9 @@ function CatalogueCollectionLayout({
16478
16499
  result = result.filter((p) => p.tags?.includes(activeCategory));
16479
16500
  }
16480
16501
  if (sortBy === "price-asc") {
16481
- result = [...result].sort((a, b) => chunkNNG6IFFX_js.parsePrice(a.default_price) - chunkNNG6IFFX_js.parsePrice(b.default_price));
16502
+ result = [...result].sort((a, b) => chunk7PDEX54K_js.parsePrice(a.default_price) - chunk7PDEX54K_js.parsePrice(b.default_price));
16482
16503
  } else if (sortBy === "price-desc") {
16483
- result = [...result].sort((a, b) => chunkNNG6IFFX_js.parsePrice(b.default_price) - chunkNNG6IFFX_js.parsePrice(a.default_price));
16504
+ result = [...result].sort((a, b) => chunk7PDEX54K_js.parsePrice(b.default_price) - chunk7PDEX54K_js.parsePrice(a.default_price));
16484
16505
  } else if (sortBy === "name") {
16485
16506
  result = [...result].sort((a, b) => a.name.localeCompare(b.name));
16486
16507
  }
@@ -20009,7 +20030,7 @@ function toneChip(value) {
20009
20030
  }
20010
20031
  }
20011
20032
  function money(amount, currency) {
20012
- return chunkNNG6IFFX_js.formatPrice(chunkNNG6IFFX_js.parsePrice(num(amount) ?? 0), text(currency));
20033
+ return chunk7PDEX54K_js.formatPrice(chunk7PDEX54K_js.parsePrice(num(amount) ?? 0), text(currency));
20013
20034
  }
20014
20035
  var CHAT_GENUI_COMPONENTS = {
20015
20036
  Stack: ({ node, ctx }) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -20257,7 +20278,7 @@ function ReplyCardView({
20257
20278
  card.image_url && /* @__PURE__ */ jsxRuntime.jsx("img", { src: card.image_url, alt: "", className: "size-12 shrink-0 rounded-xl object-cover" }),
20258
20279
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-col gap-0.5", children: [
20259
20280
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm font-semibold text-foreground", children: card.name }),
20260
- card.price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] font-semibold text-foreground tabular-nums", children: chunkNNG6IFFX_js.formatPrice(chunkNNG6IFFX_js.parsePrice(card.price), currency ?? void 0) }),
20281
+ card.price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] font-semibold text-foreground tabular-nums", children: chunk7PDEX54K_js.formatPrice(chunk7PDEX54K_js.parsePrice(card.price), currency ?? void 0) }),
20261
20282
  fire2 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold text-primary", children: "View" })
20262
20283
  ] })
20263
20284
  ]
@@ -20354,12 +20375,12 @@ function ChatWidget({
20354
20375
  setAttachError(null);
20355
20376
  if (!isAllowedAttachment(file)) {
20356
20377
  setAttachError(
20357
- new chunkJG5CQNCB_js.CimplifyError("invalid_attachment", "Only photos and documents can be attached.")
20378
+ new chunk4BKOKHE3_js.CimplifyError("invalid_attachment", "Only photos and documents can be attached.")
20358
20379
  );
20359
20380
  return;
20360
20381
  }
20361
20382
  if (file.size > MAX_ATTACHMENT_BYTES) {
20362
- setAttachError(new chunkJG5CQNCB_js.CimplifyError("attachment_too_large", "Files must be under 25MB."));
20383
+ setAttachError(new chunk4BKOKHE3_js.CimplifyError("attachment_too_large", "Files must be under 25MB."));
20363
20384
  return;
20364
20385
  }
20365
20386
  const uploaded = await client.uploads.upload(file);
@@ -20895,6 +20916,7 @@ function KeepConversation({ client }) {
20895
20916
  const [dismissed, setDismissed] = React14.useState(readKeepDismissed);
20896
20917
  const [contact, setContact] = React14.useState("");
20897
20918
  const [code, setCode] = React14.useState("");
20919
+ const [challengeId, setChallengeId] = React14.useState(null);
20898
20920
  const [busy, setBusy] = React14.useState(false);
20899
20921
  const [verifyError, setVerifyError] = React14.useState(null);
20900
20922
  if (dismissed) return null;
@@ -20907,6 +20929,7 @@ function KeepConversation({ client }) {
20907
20929
  const result = await client.link.requestOtp({ contact: trimmed, contact_type: contactType });
20908
20930
  setBusy(false);
20909
20931
  if (result.ok) {
20932
+ setChallengeId(result.value.challenge_id);
20910
20933
  setCode("");
20911
20934
  setStep("code");
20912
20935
  } else {
@@ -20914,10 +20937,11 @@ function KeepConversation({ client }) {
20914
20937
  }
20915
20938
  };
20916
20939
  const verify = async (value) => {
20917
- if (value.length !== 6 || busy) return;
20940
+ if (value.length !== 6 || busy || challengeId === null) return;
20918
20941
  setBusy(true);
20919
20942
  setVerifyError(null);
20920
20943
  const result = await client.link.verifyOtp({
20944
+ ...challengeId === void 0 ? {} : { challenge_id: challengeId },
20921
20945
  contact: contact.trim(),
20922
20946
  contact_type: contactType,
20923
20947
  otp_code: value
@@ -21292,6 +21316,10 @@ async function genUIFingerprint(manifest) {
21292
21316
  return Array.from(new Uint8Array(digest)).map((byte) => byte.toString(16).padStart(2, "0")).join("").slice(0, 16);
21293
21317
  }
21294
21318
 
21319
+ Object.defineProperty(exports, "getVariantDisplayName", {
21320
+ enumerable: true,
21321
+ get: function () { return chunk2P4KXFB6_js.getVariantDisplayName; }
21322
+ });
21295
21323
  Object.defineProperty(exports, "messagePreview", {
21296
21324
  enumerable: true,
21297
21325
  get: function () { return chunkXREIZ56K_js.messagePreview; }
@@ -21300,10 +21328,6 @@ Object.defineProperty(exports, "splitGenUIContent", {
21300
21328
  enumerable: true,
21301
21329
  get: function () { return chunkXREIZ56K_js.splitGenUIContent; }
21302
21330
  });
21303
- Object.defineProperty(exports, "getVariantDisplayName", {
21304
- enumerable: true,
21305
- get: function () { return chunk2P4KXFB6_js.getVariantDisplayName; }
21306
- });
21307
21331
  exports.AccommodationCard = AccommodationCard;
21308
21332
  exports.AccountContent = AccountContent;
21309
21333
  exports.AccountDashboardPage = AccountDashboardPage;