@cimplify/sdk 0.101.1 → 0.102.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 (52) hide show
  1. package/dist/advanced.d.mts +3 -3
  2. package/dist/advanced.d.ts +3 -3
  3. package/dist/{chunk-QPRI2NII.js → chunk-2P4KXFB6.js} +6 -0
  4. package/dist/{chunk-4G5UWFC3.mjs → chunk-3V4DVXV3.mjs} +6 -1
  5. package/dist/{chunk-7H6IL7CX.mjs → chunk-4KNFBPV2.mjs} +9 -2
  6. package/dist/{chunk-YHPMFTMN.mjs → chunk-DCMXUKDQ.mjs} +2 -0
  7. package/dist/{chunk-H5SSGN7W.js → chunk-EAZGA7LD.js} +2 -0
  8. package/dist/{chunk-ICCCSVN3.js → chunk-LOWSMGRT.js} +10 -2
  9. package/dist/{client-CdTx7X_X.d.mts → client-B40KFazg.d.ts} +5 -2
  10. package/dist/{client-WkUcvRvO.d.mts → client-BdErclfU.d.mts} +2 -2
  11. package/dist/{client-Db554902.d.ts → client-BizGfqB7.d.mts} +5 -2
  12. package/dist/{client-D40kI8z2.d.ts → client-nsiMwuC1.d.ts} +2 -2
  13. package/dist/{index-BjWUkYgY.d.mts → index-DpmnI__D.d.mts} +3 -3
  14. package/dist/{index-D3UXgAYl.d.ts → index-nEyXWIyR.d.ts} +3 -3
  15. package/dist/index.d.mts +19 -8
  16. package/dist/index.d.ts +19 -8
  17. package/dist/index.js +23 -19
  18. package/dist/index.mjs +1 -1
  19. package/dist/mock/cli.mjs +2 -0
  20. package/dist/mock/library.js +2 -0
  21. package/dist/mock/library.mjs +2 -0
  22. package/dist/mock/msw.js +2 -0
  23. package/dist/mock/msw.mjs +2 -0
  24. package/dist/{payment-CRqjGrx6.d.mts → payment-l0rkieEQ.d.mts} +1 -1
  25. package/dist/{payment-DO1Z1Ip6.d.ts → payment-vzNnIi1n.d.ts} +1 -1
  26. package/dist/{price-D9EOj8y8.d.ts → price-BstChV9a.d.ts} +1 -1
  27. package/dist/{price-CiQUd_XX.d.mts → price-CS4E5zLS.d.mts} +1 -1
  28. package/dist/{product-DwKdC_to.d.ts → product-Byf0unSy.d.mts} +19 -1
  29. package/dist/{product-DwKdC_to.d.mts → product-Byf0unSy.d.ts} +19 -1
  30. package/dist/react.d.mts +6 -4
  31. package/dist/react.d.ts +6 -4
  32. package/dist/react.js +62 -58
  33. package/dist/react.mjs +6 -2
  34. package/dist/{server-CeDb93WA.d.ts → server-Cj40R2ZD.d.ts} +1 -1
  35. package/dist/{server-D-nSkrUr.d.mts → server-DqbZh8Bk.d.mts} +1 -1
  36. package/dist/server.d.mts +4 -4
  37. package/dist/server.d.ts +4 -4
  38. package/dist/testing/msw.d.mts +2 -2
  39. package/dist/testing/msw.d.ts +2 -2
  40. package/dist/testing/msw.js +2 -2
  41. package/dist/testing/msw.mjs +1 -1
  42. package/dist/testing/suite.d.mts +6 -6
  43. package/dist/testing/suite.d.ts +6 -6
  44. package/dist/testing/suite.js +21 -21
  45. package/dist/testing/suite.mjs +2 -2
  46. package/dist/testing.d.mts +52 -21
  47. package/dist/testing.d.ts +52 -21
  48. package/dist/testing.js +81 -77
  49. package/dist/testing.mjs +3 -3
  50. package/dist/utils.d.mts +4 -4
  51. package/dist/utils.d.ts +4 -4
  52. package/package.json +1 -1
package/dist/react.js CHANGED
@@ -2,7 +2,7 @@
2
2
  'use strict';
3
3
 
4
4
  var chunkXREIZ56K_js = require('./chunk-XREIZ56K.js');
5
- var chunkQPRI2NII_js = require('./chunk-QPRI2NII.js');
5
+ var chunk2P4KXFB6_js = require('./chunk-2P4KXFB6.js');
6
6
  var chunkYDA46OZ6_js = require('./chunk-YDA46OZ6.js');
7
7
  var chunkYER7DIOM_js = require('./chunk-YER7DIOM.js');
8
8
  var chunkWMEC5JWN_js = require('./chunk-WMEC5JWN.js');
@@ -455,6 +455,7 @@ function transformToCheckoutCart(cart, fx, checkout) {
455
455
  currency: fx?.displayCurrency ?? cart.pricing.currency,
456
456
  tax_inclusive: cart.pricing.tax_inclusive ?? false,
457
457
  tax_rate: cart.pricing.tax_rate,
458
+ price_display_mode: cart.pricing.price_display_mode,
458
459
  deposit_required: cart.pricing.deposit_required ?? false,
459
460
  deposit_amount: cart.pricing.deposit_amount != null ? amt(cart.pricing.deposit_amount) : void 0,
460
461
  requires_delivery: cart.requires_delivery
@@ -713,6 +714,7 @@ function emptyBase(currency, isLoading = true) {
713
714
  tax: 0,
714
715
  taxRate: null,
715
716
  taxInclusive: false,
717
+ displayGross: false,
716
718
  taxJurisdictionLabel: null,
717
719
  total: 0,
718
720
  currency,
@@ -812,6 +814,7 @@ function mapServerCart(serverCart, fallbackCurrency) {
812
814
  tax: roundMoney(toNumber(serverCart.pricing.tax_amount)),
813
815
  taxRate: serverCart.pricing.tax_rate != null ? toNumber(serverCart.pricing.tax_rate) : null,
814
816
  taxInclusive: serverCart.pricing.tax_inclusive,
817
+ displayGross: chunk2P4KXFB6_js.displaysGrossPrices(serverCart.pricing),
815
818
  taxJurisdictionLabel: serverCart.pricing.tax_jurisdiction_label ?? null,
816
819
  total: roundMoney(toNumber(serverCart.pricing.total_price)),
817
820
  currency: serverCart.pricing.currency || fallbackCurrency,
@@ -1146,6 +1149,7 @@ function useCart(options = {}) {
1146
1149
  tax: view.tax,
1147
1150
  taxRate: view.taxRate,
1148
1151
  taxInclusive: view.taxInclusive,
1152
+ displayGross: view.displayGross,
1149
1153
  taxJurisdictionLabel: view.taxJurisdictionLabel,
1150
1154
  total: view.total,
1151
1155
  currency: view.currency,
@@ -1362,7 +1366,7 @@ function CimplifyProvider({
1362
1366
  const apiCredentials = resolvedClient.getCredentialsMode() === "include" ? "use-credentials" : "anonymous";
1363
1367
  preconnectOrigin(resolvedClient.getBaseUrl(), apiCredentials);
1364
1368
  preconnectOrigin(resolvedClient.getLinkApiUrl(), apiCredentials);
1365
- preconnectOrigin(chunkQPRI2NII_js.DEFAULT_CDN_BASE_URL);
1369
+ preconnectOrigin(chunk2P4KXFB6_js.DEFAULT_CDN_BASE_URL);
1366
1370
  }
1367
1371
  const setCurrentLocation = React14.useCallback(
1368
1372
  (location) => {
@@ -6945,7 +6949,7 @@ function VariantSelector({
6945
6949
  {
6946
6950
  "data-cimplify-variant-name": true,
6947
6951
  className: cn("flex-1 min-w-0 text-sm", classNames?.name),
6948
- children: chunkQPRI2NII_js.getVariantDisplayName(variant, productName)
6952
+ children: chunk2P4KXFB6_js.getVariantDisplayName(variant, productName)
6949
6953
  }
6950
6954
  ),
6951
6955
  /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-variant-pricing": true, className: cn("text-sm text-muted-foreground", classNames?.pricing), children: [
@@ -8743,12 +8747,12 @@ function FieldInput({
8743
8747
  classNames?.input
8744
8748
  );
8745
8749
  switch (field.field_type) {
8746
- case chunkQPRI2NII_js.INPUT_FIELD_TYPE.Text:
8747
- case chunkQPRI2NII_js.INPUT_FIELD_TYPE.Url:
8750
+ case chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Text:
8751
+ case chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Url:
8748
8752
  return /* @__PURE__ */ jsxRuntime.jsx(
8749
8753
  "input",
8750
8754
  {
8751
- type: field.field_type === chunkQPRI2NII_js.INPUT_FIELD_TYPE.Url ? "url" : "text",
8755
+ type: field.field_type === chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Url ? "url" : "text",
8752
8756
  value: typeof value === "string" ? value : "",
8753
8757
  onChange: (e) => onValueChange(e.target.value),
8754
8758
  placeholder: field.placeholder,
@@ -8757,7 +8761,7 @@ function FieldInput({
8757
8761
  className: inputClass
8758
8762
  }
8759
8763
  );
8760
- case chunkQPRI2NII_js.INPUT_FIELD_TYPE.Textarea:
8764
+ case chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Textarea:
8761
8765
  return /* @__PURE__ */ jsxRuntime.jsx(
8762
8766
  "textarea",
8763
8767
  {
@@ -8770,7 +8774,7 @@ function FieldInput({
8770
8774
  className: cn(inputClass, "resize-none", classNames?.textarea)
8771
8775
  }
8772
8776
  );
8773
- case chunkQPRI2NII_js.INPUT_FIELD_TYPE.Number:
8777
+ case chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Number:
8774
8778
  return /* @__PURE__ */ jsxRuntime.jsx(
8775
8779
  "input",
8776
8780
  {
@@ -8784,7 +8788,7 @@ function FieldInput({
8784
8788
  className: inputClass
8785
8789
  }
8786
8790
  );
8787
- case chunkQPRI2NII_js.INPUT_FIELD_TYPE.Select:
8791
+ case chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Select:
8788
8792
  return /* @__PURE__ */ jsxRuntime.jsxs(
8789
8793
  "select",
8790
8794
  {
@@ -8798,7 +8802,7 @@ function FieldInput({
8798
8802
  ]
8799
8803
  }
8800
8804
  );
8801
- case chunkQPRI2NII_js.INPUT_FIELD_TYPE.Radio:
8805
+ case chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Radio:
8802
8806
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("space-y-2", classNames?.radioGroup), children: (field.options || []).map((opt) => /* @__PURE__ */ jsxRuntime.jsxs(
8803
8807
  "label",
8804
8808
  {
@@ -8823,7 +8827,7 @@ function FieldInput({
8823
8827
  },
8824
8828
  opt
8825
8829
  )) });
8826
- case chunkQPRI2NII_js.INPUT_FIELD_TYPE.Checkbox:
8830
+ case chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Checkbox:
8827
8831
  return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: cn("flex items-center gap-2 text-sm cursor-pointer", classNames?.checkboxLabel), children: [
8828
8832
  /* @__PURE__ */ jsxRuntime.jsx(
8829
8833
  "input",
@@ -8836,7 +8840,7 @@ function FieldInput({
8836
8840
  ),
8837
8841
  field.placeholder || field.name
8838
8842
  ] });
8839
- case chunkQPRI2NII_js.INPUT_FIELD_TYPE.Color:
8843
+ case chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Color:
8840
8844
  return /* @__PURE__ */ jsxRuntime.jsx(
8841
8845
  "input",
8842
8846
  {
@@ -8846,7 +8850,7 @@ function FieldInput({
8846
8850
  className: cn("w-12 h-10 rounded-md border border-input cursor-pointer", classNames?.colorInput)
8847
8851
  }
8848
8852
  );
8849
- case chunkQPRI2NII_js.INPUT_FIELD_TYPE.Date:
8853
+ case chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Date:
8850
8854
  return /* @__PURE__ */ jsxRuntime.jsx(
8851
8855
  DatePicker,
8852
8856
  {
@@ -8857,8 +8861,8 @@ function FieldInput({
8857
8861
  "aria-label": field.name
8858
8862
  }
8859
8863
  );
8860
- case chunkQPRI2NII_js.INPUT_FIELD_TYPE.File:
8861
- case chunkQPRI2NII_js.INPUT_FIELD_TYPE.Image:
8864
+ case chunk2P4KXFB6_js.INPUT_FIELD_TYPE.File:
8865
+ case chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Image:
8862
8866
  return /* @__PURE__ */ jsxRuntime.jsx(
8863
8867
  FileUploadInput,
8864
8868
  {
@@ -8869,7 +8873,7 @@ function FieldInput({
8869
8873
  classNames
8870
8874
  }
8871
8875
  );
8872
- case chunkQPRI2NII_js.INPUT_FIELD_TYPE.Email:
8876
+ case chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Email:
8873
8877
  return /* @__PURE__ */ jsxRuntime.jsx(
8874
8878
  "input",
8875
8879
  {
@@ -8881,7 +8885,7 @@ function FieldInput({
8881
8885
  className: inputClass
8882
8886
  }
8883
8887
  );
8884
- case chunkQPRI2NII_js.INPUT_FIELD_TYPE.DateTime: {
8888
+ case chunk2P4KXFB6_js.INPUT_FIELD_TYPE.DateTime: {
8885
8889
  const stringValue = typeof value === "string" ? value : "";
8886
8890
  const [datePart, timePartRaw] = stringValue.includes("T") ? stringValue.split("T", 2) : [stringValue, ""];
8887
8891
  const timePart = (timePartRaw ?? "").slice(0, 5);
@@ -8920,7 +8924,7 @@ function FieldInput({
8920
8924
  )
8921
8925
  ] });
8922
8926
  }
8923
- case chunkQPRI2NII_js.INPUT_FIELD_TYPE.Time:
8927
+ case chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Time:
8924
8928
  return /* @__PURE__ */ jsxRuntime.jsx(
8925
8929
  TimePicker,
8926
8930
  {
@@ -8931,7 +8935,7 @@ function FieldInput({
8931
8935
  "aria-label": field.name
8932
8936
  }
8933
8937
  );
8934
- case chunkQPRI2NII_js.INPUT_FIELD_TYPE.MultiSelect:
8938
+ case chunk2P4KXFB6_js.INPUT_FIELD_TYPE.MultiSelect:
8935
8939
  return /* @__PURE__ */ jsxRuntime.jsx(
8936
8940
  MultiSelectInput,
8937
8941
  {
@@ -8941,7 +8945,7 @@ function FieldInput({
8941
8945
  classNames
8942
8946
  }
8943
8947
  );
8944
- case chunkQPRI2NII_js.INPUT_FIELD_TYPE.DateRange:
8948
+ case chunk2P4KXFB6_js.INPUT_FIELD_TYPE.DateRange:
8945
8949
  return /* @__PURE__ */ jsxRuntime.jsx(
8946
8950
  DateRangeInput,
8947
8951
  {
@@ -8951,7 +8955,7 @@ function FieldInput({
8951
8955
  classNames
8952
8956
  }
8953
8957
  );
8954
- case chunkQPRI2NII_js.INPUT_FIELD_TYPE.Address:
8958
+ case chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Address:
8955
8959
  return /* @__PURE__ */ jsxRuntime.jsx(
8956
8960
  AddressInput,
8957
8961
  {
@@ -8962,7 +8966,7 @@ function FieldInput({
8962
8966
  inputClass
8963
8967
  }
8964
8968
  );
8965
- case chunkQPRI2NII_js.INPUT_FIELD_TYPE.Location:
8969
+ case chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Location:
8966
8970
  return /* @__PURE__ */ jsxRuntime.jsx(
8967
8971
  LocationInput,
8968
8972
  {
@@ -8973,7 +8977,7 @@ function FieldInput({
8973
8977
  inputClass
8974
8978
  }
8975
8979
  );
8976
- case chunkQPRI2NII_js.INPUT_FIELD_TYPE.Phone:
8980
+ case chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Phone:
8977
8981
  return /* @__PURE__ */ jsxRuntime.jsx(
8978
8982
  PhoneInput,
8979
8983
  {
@@ -8984,7 +8988,7 @@ function FieldInput({
8984
8988
  inputClass
8985
8989
  }
8986
8990
  );
8987
- case chunkQPRI2NII_js.INPUT_FIELD_TYPE.Signature:
8991
+ case chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Signature:
8988
8992
  return /* @__PURE__ */ jsxRuntime.jsx(
8989
8993
  SignatureInput,
8990
8994
  {
@@ -9017,7 +9021,7 @@ function FileUploadInput({
9017
9021
  const [isUploading, setIsUploading] = React14__default.default.useState(false);
9018
9022
  const fileUrl = typeof value === "string" ? value : void 0;
9019
9023
  const acceptedFormats = field.validation?.accepted_formats;
9020
- const accept = acceptedFormats ? acceptedFormats.map((f) => `.${f}`).join(",") : field.field_type === chunkQPRI2NII_js.INPUT_FIELD_TYPE.Image ? "image/*" : void 0;
9024
+ const accept = acceptedFormats ? acceptedFormats.map((f) => `.${f}`).join(",") : field.field_type === chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Image ? "image/*" : void 0;
9021
9025
  const handleFile = async (file) => {
9022
9026
  if (!onFileUpload) return;
9023
9027
  if (field.validation?.max_size_mb) {
@@ -9035,7 +9039,7 @@ function FileUploadInput({
9035
9039
  }
9036
9040
  };
9037
9041
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("space-y-2", classNames?.fileInput), children: fileUrl ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
9038
- field.field_type === chunkQPRI2NII_js.INPUT_FIELD_TYPE.Image && /* @__PURE__ */ jsxRuntime.jsx("img", { src: fileUrl, alt: "Uploaded", className: "w-16 h-16 object-cover rounded-md border border-border" }),
9042
+ field.field_type === chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Image && /* @__PURE__ */ jsxRuntime.jsx("img", { src: fileUrl, alt: "Uploaded", className: "w-16 h-16 object-cover rounded-md border border-border" }),
9039
9043
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground truncate", children: fileUrl.split("/").pop() }) }),
9040
9044
  /* @__PURE__ */ jsxRuntime.jsx(
9041
9045
  "button",
@@ -9061,7 +9065,7 @@ function FileUploadInput({
9061
9065
  }
9062
9066
  ),
9063
9067
  isUploading ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: "Uploading..." }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9064
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: field.placeholder || `Upload ${field.field_type === chunkQPRI2NII_js.INPUT_FIELD_TYPE.Image ? "image" : "file"}` }),
9068
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: field.placeholder || `Upload ${field.field_type === chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Image ? "image" : "file"}` }),
9065
9069
  acceptedFormats && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground/60 mt-1", children: [
9066
9070
  acceptedFormats.map((f) => f.toUpperCase()).join(", "),
9067
9071
  field.validation?.max_size_mb && ` \xB7 Max ${field.validation.max_size_mb}MB`
@@ -9808,7 +9812,7 @@ function ProductCustomizerContent({
9808
9812
  const isBundle = productType === "bundle";
9809
9813
  const isDigital = productType === "digital";
9810
9814
  const isService = productType === "service";
9811
- const offersUnits = isService && chunkQPRI2NII_js.isMultiDayService(product);
9815
+ const offersUnits = isService && chunk2P4KXFB6_js.isMultiDayService(product);
9812
9816
  const isStandard = !isComposite && !isBundle;
9813
9817
  const hasVariants = isStandard && product.variants && product.variants.length > 0;
9814
9818
  const hasAddOns = isStandard && product.add_ons && product.add_ons.length > 0;
@@ -9925,7 +9929,7 @@ function ProductCustomizerContent({
9925
9929
  const validationMessage = !quoteEnabled ? REQUIRED_OPTIONS_MESSAGE : quoteError ? QUOTE_UNAVAILABLE_MESSAGE : !quoteIsReady ? QUOTE_LOADING_MESSAGE : null;
9926
9930
  const displayTotalPrice = React14.useMemo(() => {
9927
9931
  const total = quotedTotalPrice ?? localTotalPrice;
9928
- const multiplier = chunkQPRI2NII_js.serviceBillingMultiplier(product, {
9932
+ const multiplier = chunk2P4KXFB6_js.serviceBillingMultiplier(product, {
9929
9933
  quantity,
9930
9934
  units: unitsCount,
9931
9935
  scheduledStart: selectedSlot?.start_time,
@@ -10726,7 +10730,7 @@ function CartLineItemRow({
10726
10730
  const isOptimistic2 = item.isOptimistic === true;
10727
10731
  const lineTotal = chunkWMEC5JWN_js.parsePrice(unitPrice) * item.quantity;
10728
10732
  const imageUrl = item.product.image_url;
10729
- const variantLabel2 = item.variant ? chunkQPRI2NII_js.getVariantDisplayName(item.variant, item.product.name) : null;
10733
+ const variantLabel2 = item.variant ? chunk2P4KXFB6_js.getVariantDisplayName(item.variant, item.product.name) : null;
10730
10734
  return /* @__PURE__ */ jsxRuntime.jsxs(
10731
10735
  "div",
10732
10736
  {
@@ -10852,7 +10856,7 @@ function CartLineItemRow({
10852
10856
  input.field_name,
10853
10857
  ":"
10854
10858
  ] }),
10855
- /* @__PURE__ */ jsxRuntime.jsx("dd", { "data-cimplify-cart-input-value": true, className: "text-foreground m-0 truncate", children: input.field_type === chunkQPRI2NII_js.INPUT_FIELD_TYPE.File || input.field_type === chunkQPRI2NII_js.INPUT_FIELD_TYPE.Image ? String(input.value).split("/").pop() || "Uploaded file" : String(input.value) })
10859
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { "data-cimplify-cart-input-value": true, className: "text-foreground m-0 truncate", children: input.field_type === chunk2P4KXFB6_js.INPUT_FIELD_TYPE.File || input.field_type === chunk2P4KXFB6_js.INPUT_FIELD_TYPE.Image ? String(input.value).split("/").pop() || "Uploaded file" : String(input.value) })
10856
10860
  ] }, input.field_id))
10857
10861
  }
10858
10862
  ),
@@ -11905,7 +11909,7 @@ function FoodProductCard({
11905
11909
  const tags = product.tags || [];
11906
11910
  const isSignature = product.metadata?.is_signature === true;
11907
11911
  const isNew = product.metadata?.is_new === true;
11908
- const isComposite = product.type === chunkQPRI2NII_js.PRODUCT_TYPE.Composite;
11912
+ const isComposite = product.type === chunk2P4KXFB6_js.PRODUCT_TYPE.Composite;
11909
11913
  return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
11910
11914
  /* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "square", renderImage, children: [
11911
11915
  isSignature && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "absolute top-3 left-3 inline-flex items-center gap-1 text-[11px] font-semibold tracking-wide bg-amber-50 text-amber-700 border border-amber-200/60 px-2 py-0.5 rounded-md", children: [
@@ -12672,36 +12676,36 @@ var BUILT_IN_CARDS = {
12672
12676
  ["composite" /* Composite */]: CompositeProductCard,
12673
12677
  ["subscription" /* Subscription */]: SubscriptionCard
12674
12678
  };
12675
- var RENTAL_UNITS = /* @__PURE__ */ new Set([chunkQPRI2NII_js.DURATION_UNIT.Days, chunkQPRI2NII_js.DURATION_UNIT.Hours]);
12676
- var LEASE_UNITS = /* @__PURE__ */ new Set([chunkQPRI2NII_js.DURATION_UNIT.Weeks, chunkQPRI2NII_js.DURATION_UNIT.Months, chunkQPRI2NII_js.DURATION_UNIT.Years]);
12679
+ var RENTAL_UNITS = /* @__PURE__ */ new Set([chunk2P4KXFB6_js.DURATION_UNIT.Days, chunk2P4KXFB6_js.DURATION_UNIT.Hours]);
12680
+ var LEASE_UNITS = /* @__PURE__ */ new Set([chunk2P4KXFB6_js.DURATION_UNIT.Weeks, chunk2P4KXFB6_js.DURATION_UNIT.Months, chunk2P4KXFB6_js.DURATION_UNIT.Years]);
12677
12681
  function resolveCardVariant(product) {
12678
- if (product.type === chunkQPRI2NII_js.PRODUCT_TYPE.Bundle) {
12682
+ if (product.type === chunk2P4KXFB6_js.PRODUCT_TYPE.Bundle) {
12679
12683
  return "bundle" /* Bundle */;
12680
12684
  }
12681
- if (product.type === chunkQPRI2NII_js.PRODUCT_TYPE.Composite) {
12685
+ if (product.type === chunk2P4KXFB6_js.PRODUCT_TYPE.Composite) {
12682
12686
  return "composite" /* Composite */;
12683
12687
  }
12684
12688
  if (product.quantity_pricing && product.quantity_pricing.length > 1) {
12685
12689
  return "wholesale" /* Wholesale */;
12686
12690
  }
12687
- if (product.type === chunkQPRI2NII_js.PRODUCT_TYPE.Digital) {
12691
+ if (product.type === chunk2P4KXFB6_js.PRODUCT_TYPE.Digital) {
12688
12692
  return "digital" /* Digital */;
12689
12693
  }
12690
- if (product.type === chunkQPRI2NII_js.PRODUCT_TYPE.Service) {
12694
+ if (product.type === chunk2P4KXFB6_js.PRODUCT_TYPE.Service) {
12691
12695
  switch (product.boundary_kind) {
12692
- case chunkQPRI2NII_js.BOUNDARY_KIND.CheckInOut:
12696
+ case chunk2P4KXFB6_js.BOUNDARY_KIND.CheckInOut:
12693
12697
  return "accommodation" /* Accommodation */;
12694
- case chunkQPRI2NII_js.BOUNDARY_KIND.MoveInOut:
12698
+ case chunk2P4KXFB6_js.BOUNDARY_KIND.MoveInOut:
12695
12699
  return "lease" /* Lease */;
12696
- case chunkQPRI2NII_js.BOUNDARY_KIND.PickupReturn:
12697
- case chunkQPRI2NII_js.BOUNDARY_KIND.DeliveryCollection:
12698
- case chunkQPRI2NII_js.BOUNDARY_KIND.AccessVacate:
12700
+ case chunk2P4KXFB6_js.BOUNDARY_KIND.PickupReturn:
12701
+ case chunk2P4KXFB6_js.BOUNDARY_KIND.DeliveryCollection:
12702
+ case chunk2P4KXFB6_js.BOUNDARY_KIND.AccessVacate:
12699
12703
  return "rental" /* Rental */;
12700
12704
  }
12701
12705
  if (product.duration_unit && RENTAL_UNITS.has(product.duration_unit)) {
12702
12706
  return "rental" /* Rental */;
12703
12707
  }
12704
- if (product.duration_unit === chunkQPRI2NII_js.DURATION_UNIT.Nights) {
12708
+ if (product.duration_unit === chunk2P4KXFB6_js.DURATION_UNIT.Nights) {
12705
12709
  return "accommodation" /* Accommodation */;
12706
12710
  }
12707
12711
  if (product.duration_unit && LEASE_UNITS.has(product.duration_unit)) {
@@ -12712,10 +12716,10 @@ function resolveCardVariant(product) {
12712
12716
  }
12713
12717
  return "standard" /* Standard */;
12714
12718
  }
12715
- if (product.render_hint === chunkQPRI2NII_js.RENDER_HINT.Food) {
12719
+ if (product.render_hint === chunk2P4KXFB6_js.RENDER_HINT.Food) {
12716
12720
  return "food" /* Food */;
12717
12721
  }
12718
- if (product.render_hint === chunkQPRI2NII_js.RENDER_HINT.Physical) {
12722
+ if (product.render_hint === chunk2P4KXFB6_js.RENDER_HINT.Physical) {
12719
12723
  return "retail" /* Retail */;
12720
12724
  }
12721
12725
  return "retail" /* Retail */;
@@ -12995,14 +12999,14 @@ var PRESET_LABELS = {
12995
12999
  move_in_out: { start: "Move-in", end: "Move-out" }
12996
13000
  };
12997
13001
  function defaultBoundaryKind(unit) {
12998
- return unit === chunkQPRI2NII_js.DURATION_UNIT.Nights ? chunkQPRI2NII_js.BOUNDARY_KIND.CheckInOut : chunkQPRI2NII_js.BOUNDARY_KIND.PickupReturn;
13002
+ return unit === chunk2P4KXFB6_js.DURATION_UNIT.Nights ? chunk2P4KXFB6_js.BOUNDARY_KIND.CheckInOut : chunk2P4KXFB6_js.BOUNDARY_KIND.PickupReturn;
12999
13003
  }
13000
13004
  function resolveBoundaryKind(product) {
13001
13005
  return product.boundary_kind ?? defaultBoundaryKind(product.duration_unit);
13002
13006
  }
13003
13007
  function getBoundaryLabels(product) {
13004
13008
  const kind = resolveBoundaryKind(product);
13005
- if (kind === chunkQPRI2NII_js.BOUNDARY_KIND.Custom) {
13009
+ if (kind === chunk2P4KXFB6_js.BOUNDARY_KIND.Custom) {
13006
13010
  return {
13007
13011
  start: product.boundary_start_label?.trim() || "Start",
13008
13012
  end: product.boundary_end_label?.trim() || "End"
@@ -15090,7 +15094,7 @@ function DefaultProductLayout({
15090
15094
  className
15091
15095
  }) {
15092
15096
  const [selectedVariantId, setSelectedVariantId] = React14__default.default.useState();
15093
- const images = chunkQPRI2NII_js.resolveGallery(product, selectedVariantId);
15097
+ const images = chunk2P4KXFB6_js.resolveGallery(product, selectedVariantId);
15094
15098
  const currency = chunkWMEC5JWN_js.getProductCurrency(product);
15095
15099
  const hasRange = product.quantity_pricing && product.quantity_pricing.length > 1 || product.variants && product.variants.length > 1;
15096
15100
  const onSale = chunkWMEC5JWN_js.isOnSale(product);
@@ -15737,25 +15741,25 @@ function resolveTemplateKey(product) {
15737
15741
  if (typeof metaTemplate === "string" && metaTemplate.trim()) {
15738
15742
  return metaTemplate.trim();
15739
15743
  }
15740
- if (product.type === chunkQPRI2NII_js.PRODUCT_TYPE.Bundle) {
15744
+ if (product.type === chunk2P4KXFB6_js.PRODUCT_TYPE.Bundle) {
15741
15745
  return "bundle" /* Bundle */;
15742
15746
  }
15743
- if (product.type === chunkQPRI2NII_js.PRODUCT_TYPE.Composite) {
15747
+ if (product.type === chunk2P4KXFB6_js.PRODUCT_TYPE.Composite) {
15744
15748
  return "composite" /* Composite */;
15745
15749
  }
15746
15750
  if (product.quantity_pricing && product.quantity_pricing.length > 1) {
15747
15751
  return "wholesale" /* Wholesale */;
15748
15752
  }
15749
- if (product.type === chunkQPRI2NII_js.PRODUCT_TYPE.Service) {
15753
+ if (product.type === chunk2P4KXFB6_js.PRODUCT_TYPE.Service) {
15750
15754
  return "service" /* Service */;
15751
15755
  }
15752
- if (product.type === chunkQPRI2NII_js.PRODUCT_TYPE.Digital) {
15756
+ if (product.type === chunk2P4KXFB6_js.PRODUCT_TYPE.Digital) {
15753
15757
  return "digital" /* Digital */;
15754
15758
  }
15755
- if (product.render_hint === chunkQPRI2NII_js.RENDER_HINT.Food) {
15759
+ if (product.render_hint === chunk2P4KXFB6_js.RENDER_HINT.Food) {
15756
15760
  return "food" /* Food */;
15757
15761
  }
15758
- if (product.render_hint === chunkQPRI2NII_js.RENDER_HINT.Physical) {
15762
+ if (product.render_hint === chunk2P4KXFB6_js.RENDER_HINT.Physical) {
15759
15763
  return "physical" /* Physical */;
15760
15764
  }
15761
15765
  return "default" /* Default */;
@@ -18141,7 +18145,7 @@ function chatTimeline(messages, options = {}) {
18141
18145
  const { readAt = null, rendersPrograms = false } = options;
18142
18146
  const partitioned = partitionMessages(messages);
18143
18147
  const bubbles = partitioned.bubbles.filter(
18144
- (message) => message.sender_type === "system" || message.attachments.length > 0 || chunkQPRI2NII_js.chatMessageCards(message).length > 0 || rendersPrograms && hasProgram(message.content) || (message.sender_type === "customer" ? message.content.trim() !== "" : proseOf(message.content) !== "")
18148
+ (message) => message.sender_type === "system" || message.attachments.length > 0 || chunk2P4KXFB6_js.chatMessageCards(message).length > 0 || rendersPrograms && hasProgram(message.content) || (message.sender_type === "customer" ? message.content.trim() !== "" : proseOf(message.content) !== "")
18145
18149
  );
18146
18150
  let firstUnreadId;
18147
18151
  let unreadOnOpen = 0;
@@ -20227,7 +20231,7 @@ function ChatKitProgram({ source, onAction }) {
20227
20231
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full max-w-[290px]", children: /* @__PURE__ */ jsxRuntime.jsx(GenUIView, { root: parsed.root, components: CHAT_GENUI_COMPONENTS, onAction }) });
20228
20232
  }
20229
20233
  function ChatReplyCards({ message, currency, onAction }) {
20230
- const cards = chunkQPRI2NII_js.chatMessageCards(message);
20234
+ const cards = chunk2P4KXFB6_js.chatMessageCards(message);
20231
20235
  if (cards.length === 0) return null;
20232
20236
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "scrollbar-hide flex max-w-full gap-2 overflow-x-auto pl-[30px]", children: cards.map((card, index) => /* @__PURE__ */ jsxRuntime.jsx(ReplyCardView, { card, currency, onAction }, index)) });
20233
20237
  }
@@ -21297,7 +21301,7 @@ Object.defineProperty(exports, "splitGenUIContent", {
21297
21301
  });
21298
21302
  Object.defineProperty(exports, "getVariantDisplayName", {
21299
21303
  enumerable: true,
21300
- get: function () { return chunkQPRI2NII_js.getVariantDisplayName; }
21304
+ get: function () { return chunk2P4KXFB6_js.getVariantDisplayName; }
21301
21305
  });
21302
21306
  exports.AccommodationCard = AccommodationCard;
21303
21307
  exports.AccountContent = AccountContent;
package/dist/react.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { splitGenUIContent, messagePreview } from './chunk-U4MW6PYU.mjs';
3
3
  export { messagePreview, splitGenUIContent } from './chunk-U4MW6PYU.mjs';
4
- import { DURATION_UNIT, getVariantDisplayName, INPUT_FIELD_TYPE, isMultiDayService, serviceBillingMultiplier, PRODUCT_TYPE, BOUNDARY_KIND, resolveGallery, chatMessageCards, RENDER_HINT, DEFAULT_CDN_BASE_URL } from './chunk-4G5UWFC3.mjs';
5
- export { getVariantDisplayName } from './chunk-4G5UWFC3.mjs';
4
+ import { DURATION_UNIT, getVariantDisplayName, INPUT_FIELD_TYPE, isMultiDayService, serviceBillingMultiplier, PRODUCT_TYPE, BOUNDARY_KIND, resolveGallery, chatMessageCards, RENDER_HINT, displaysGrossPrices, DEFAULT_CDN_BASE_URL } from './chunk-3V4DVXV3.mjs';
5
+ export { getVariantDisplayName } from './chunk-3V4DVXV3.mjs';
6
6
  import { SESSION_CLAIMED, SESSION_CLEARED, createCimplifyClient, AUTH_TOKEN_CHANGED, MUTATION_ERROR } from './chunk-DKLHCZ5M.mjs';
7
7
  import { generateIdempotencyKey, ELEMENT_TYPES, EVENT_TYPES, startSignIn } from './chunk-Z3K2D3TE.mjs';
8
8
  import { parsePrice, formatMoney, formatPrice, getVariantUnitPrice, getProductCurrency, getUnitPriceAtQuantity, isOnSale, getDiscountPercentage, getBasePrice, getPriceRange, formatPriceRange } from './chunk-DLW3RWRK.mjs';
@@ -431,6 +431,7 @@ function transformToCheckoutCart(cart, fx, checkout) {
431
431
  currency: fx?.displayCurrency ?? cart.pricing.currency,
432
432
  tax_inclusive: cart.pricing.tax_inclusive ?? false,
433
433
  tax_rate: cart.pricing.tax_rate,
434
+ price_display_mode: cart.pricing.price_display_mode,
434
435
  deposit_required: cart.pricing.deposit_required ?? false,
435
436
  deposit_amount: cart.pricing.deposit_amount != null ? amt(cart.pricing.deposit_amount) : void 0,
436
437
  requires_delivery: cart.requires_delivery
@@ -689,6 +690,7 @@ function emptyBase(currency, isLoading = true) {
689
690
  tax: 0,
690
691
  taxRate: null,
691
692
  taxInclusive: false,
693
+ displayGross: false,
692
694
  taxJurisdictionLabel: null,
693
695
  total: 0,
694
696
  currency,
@@ -788,6 +790,7 @@ function mapServerCart(serverCart, fallbackCurrency) {
788
790
  tax: roundMoney(toNumber(serverCart.pricing.tax_amount)),
789
791
  taxRate: serverCart.pricing.tax_rate != null ? toNumber(serverCart.pricing.tax_rate) : null,
790
792
  taxInclusive: serverCart.pricing.tax_inclusive,
793
+ displayGross: displaysGrossPrices(serverCart.pricing),
791
794
  taxJurisdictionLabel: serverCart.pricing.tax_jurisdiction_label ?? null,
792
795
  total: roundMoney(toNumber(serverCart.pricing.total_price)),
793
796
  currency: serverCart.pricing.currency || fallbackCurrency,
@@ -1122,6 +1125,7 @@ function useCart(options = {}) {
1122
1125
  tax: view.tax,
1123
1126
  taxRate: view.taxRate,
1124
1127
  taxInclusive: view.taxInclusive,
1128
+ displayGross: view.displayGross,
1125
1129
  taxJurisdictionLabel: view.taxJurisdictionLabel,
1126
1130
  total: view.total,
1127
1131
  currency: view.currency,
@@ -1,5 +1,5 @@
1
1
  import { Hono } from 'hono';
2
- import { b6 as ProductInputField } from './product-DwKdC_to.js';
2
+ import { b6 as ProductInputField } from './product-Byf0unSy.js';
3
3
 
4
4
  interface Clock {
5
5
  now(): Date;
@@ -1,5 +1,5 @@
1
1
  import { Hono } from 'hono';
2
- import { b6 as ProductInputField } from './product-DwKdC_to.mjs';
2
+ import { b6 as ProductInputField } from './product-Byf0unSy.mjs';
3
3
 
4
4
  interface Clock {
5
5
  now(): Date;
package/dist/server.d.mts CHANGED
@@ -1,8 +1,8 @@
1
- import { af as CimplifyClient } from './client-CdTx7X_X.mjs';
2
- export { J as CacheOptions, cD as ReadRequestOptions, c_ as Result } from './client-CdTx7X_X.mjs';
3
- export { S as Category, V as CimplifyError, W as Collection, b0 as Product, be as ProductWithDetails } from './product-DwKdC_to.mjs';
1
+ import { af as CimplifyClient } from './client-BizGfqB7.mjs';
2
+ export { J as CacheOptions, cD as ReadRequestOptions, c_ as Result } from './client-BizGfqB7.mjs';
3
+ export { S as Category, V as CimplifyError, W as Collection, b0 as Product, be as ProductWithDetails } from './product-Byf0unSy.mjs';
4
4
  import { JWTVerifyResult } from 'jose';
5
- import './payment-CRqjGrx6.mjs';
5
+ import './payment-l0rkieEQ.mjs';
6
6
 
7
7
  interface ServerClientOptions {
8
8
  /**
package/dist/server.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { af as CimplifyClient } from './client-Db554902.js';
2
- export { J as CacheOptions, cD as ReadRequestOptions, c_ as Result } from './client-Db554902.js';
3
- export { S as Category, V as CimplifyError, W as Collection, b0 as Product, be as ProductWithDetails } from './product-DwKdC_to.js';
1
+ import { af as CimplifyClient } from './client-B40KFazg.js';
2
+ export { J as CacheOptions, cD as ReadRequestOptions, c_ as Result } from './client-B40KFazg.js';
3
+ export { S as Category, V as CimplifyError, W as Collection, b0 as Product, be as ProductWithDetails } from './product-Byf0unSy.js';
4
4
  import { JWTVerifyResult } from 'jose';
5
- import './payment-DO1Z1Ip6.js';
5
+ import './payment-vzNnIi1n.js';
6
6
 
7
7
  interface ServerClientOptions {
8
8
  /**
@@ -1,6 +1,6 @@
1
- import { A as AppHandle, C as CreateAppOptions } from '../server-D-nSkrUr.mjs';
1
+ import { A as AppHandle, C as CreateAppOptions } from '../server-DqbZh8Bk.mjs';
2
2
  import 'hono';
3
- import '../product-DwKdC_to.mjs';
3
+ import '../product-Byf0unSy.mjs';
4
4
 
5
5
  interface MswHandlerSetup {
6
6
  handlers: unknown[];
@@ -1,6 +1,6 @@
1
- import { A as AppHandle, C as CreateAppOptions } from '../server-CeDb93WA.js';
1
+ import { A as AppHandle, C as CreateAppOptions } from '../server-Cj40R2ZD.js';
2
2
  import 'hono';
3
- import '../product-DwKdC_to.js';
3
+ import '../product-Byf0unSy.js';
4
4
 
5
5
  interface MswHandlerSetup {
6
6
  handlers: unknown[];
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkH5SSGN7W_js = require('../chunk-H5SSGN7W.js');
3
+ var chunkEAZGA7LD_js = require('../chunk-EAZGA7LD.js');
4
4
  require('../chunk-XREIZ56K.js');
5
5
  require('../chunk-NIOUSKQQ.js');
6
6
  require('../chunk-OWW5GUSB.js');
@@ -8,7 +8,7 @@ require('../chunk-OWW5GUSB.js');
8
8
  // src/mock/msw.ts
9
9
  async function createMswHandlers(options = {}) {
10
10
  const baseUrl = options.baseUrl ?? "http://localhost:8787";
11
- const handle = chunkH5SSGN7W_js.createMockApp(options);
11
+ const handle = chunkEAZGA7LD_js.createMockApp(options);
12
12
  const msw = await import('msw').catch(() => {
13
13
  throw new Error("msw is required to use @cimplify/sdk/mock/msw \u2014 install it as a peer dependency");
14
14
  });
@@ -1,4 +1,4 @@
1
- import { createMockApp } from '../chunk-YHPMFTMN.mjs';
1
+ import { createMockApp } from '../chunk-DCMXUKDQ.mjs';
2
2
  import '../chunk-U4MW6PYU.mjs';
3
3
  import '../chunk-O3YUHLZL.mjs';
4
4
  import '../chunk-3G6RQLXK.mjs';
@@ -1,10 +1,10 @@
1
1
  import { TestAPI } from 'vitest';
2
- import { T as TestClientHandle } from '../client-WkUcvRvO.mjs';
3
- import { C as CreateAppOptions } from '../server-D-nSkrUr.mjs';
4
- export { S as SeedName } from '../server-D-nSkrUr.mjs';
5
- import '../client-CdTx7X_X.mjs';
6
- import '../product-DwKdC_to.mjs';
7
- import '../payment-CRqjGrx6.mjs';
2
+ import { T as TestClientHandle } from '../client-BdErclfU.mjs';
3
+ import { C as CreateAppOptions } from '../server-DqbZh8Bk.mjs';
4
+ export { S as SeedName } from '../server-DqbZh8Bk.mjs';
5
+ import '../client-BizGfqB7.mjs';
6
+ import '../product-Byf0unSy.mjs';
7
+ import '../payment-l0rkieEQ.mjs';
8
8
  import 'hono';
9
9
 
10
10
  /**
@@ -1,10 +1,10 @@
1
1
  import { TestAPI } from 'vitest';
2
- import { T as TestClientHandle } from '../client-D40kI8z2.js';
3
- import { C as CreateAppOptions } from '../server-CeDb93WA.js';
4
- export { S as SeedName } from '../server-CeDb93WA.js';
5
- import '../client-Db554902.js';
6
- import '../product-DwKdC_to.js';
7
- import '../payment-DO1Z1Ip6.js';
2
+ import { T as TestClientHandle } from '../client-nsiMwuC1.js';
3
+ import { C as CreateAppOptions } from '../server-Cj40R2ZD.js';
4
+ export { S as SeedName } from '../server-Cj40R2ZD.js';
5
+ import '../client-B40KFazg.js';
6
+ import '../product-Byf0unSy.js';
7
+ import '../payment-vzNnIi1n.js';
8
8
  import 'hono';
9
9
 
10
10
  /**