@cimplify/sdk 0.64.1 → 0.66.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 (40) hide show
  1. package/dist/advanced.d.mts +1 -1
  2. package/dist/advanced.d.ts +1 -1
  3. package/dist/advanced.js +20 -20
  4. package/dist/advanced.mjs +1 -1
  5. package/dist/{chunk-SQ7U3BWY.mjs → chunk-227XTAEB.mjs} +52 -25
  6. package/dist/{chunk-2AU263DK.mjs → chunk-3Z3FQH7X.mjs} +1 -1
  7. package/dist/{chunk-XSOYJLMZ.mjs → chunk-7BKKBJQM.mjs} +10 -3
  8. package/dist/{chunk-JGBDWEPJ.js → chunk-AVQL3TSJ.js} +3 -0
  9. package/dist/{chunk-6DMHVQ42.js → chunk-GDAGM26J.js} +4 -4
  10. package/dist/{chunk-6W3AH4QW.js → chunk-H6DBPHMZ.js} +2 -2
  11. package/dist/{chunk-MW7ICTVK.js → chunk-J3MGY6AU.js} +86 -59
  12. package/dist/{chunk-DKT62WQW.js → chunk-KWYI2TTA.js} +10 -3
  13. package/dist/{chunk-F4WS3OIF.mjs → chunk-MWI5GAUF.mjs} +1 -1
  14. package/dist/{chunk-I4IXPQIX.mjs → chunk-R6363CC7.mjs} +3 -0
  15. package/dist/{client-Dfg_hmkP.d.ts → client-Bo5rujc2.d.ts} +8 -2
  16. package/dist/{client-Bhvlelij.d.mts → client-CUrA1uQ0.d.mts} +1 -1
  17. package/dist/{client-DlGJqSDd.d.ts → client-DasPHOJh.d.ts} +1 -1
  18. package/dist/{client-DKg-5OWu.d.mts → client-Dka2cGhu.d.mts} +8 -2
  19. package/dist/index.d.mts +1 -1
  20. package/dist/index.d.ts +1 -1
  21. package/dist/index.js +78 -78
  22. package/dist/index.mjs +5 -5
  23. package/dist/react.d.mts +1 -1
  24. package/dist/react.d.ts +1 -1
  25. package/dist/react.js +64 -64
  26. package/dist/react.mjs +5 -5
  27. package/dist/server.d.mts +18 -3
  28. package/dist/server.d.ts +18 -3
  29. package/dist/server.js +167 -28
  30. package/dist/server.mjs +159 -24
  31. package/dist/styles.css +1 -1
  32. package/dist/testing/suite.d.mts +2 -2
  33. package/dist/testing/suite.d.ts +2 -2
  34. package/dist/testing/suite.js +22 -22
  35. package/dist/testing/suite.mjs +3 -3
  36. package/dist/testing.d.mts +2 -2
  37. package/dist/testing.d.ts +2 -2
  38. package/dist/testing.js +78 -78
  39. package/dist/testing.mjs +4 -4
  40. package/package.json +1 -1
package/dist/react.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunk6DMHVQ42_js = require('./chunk-6DMHVQ42.js');
5
- require('./chunk-DKT62WQW.js');
6
- var chunkMW7ICTVK_js = require('./chunk-MW7ICTVK.js');
7
- var chunkJGBDWEPJ_js = require('./chunk-JGBDWEPJ.js');
4
+ var chunkGDAGM26J_js = require('./chunk-GDAGM26J.js');
5
+ require('./chunk-KWYI2TTA.js');
6
+ var chunkJ3MGY6AU_js = require('./chunk-J3MGY6AU.js');
7
+ var chunkAVQL3TSJ_js = require('./chunk-AVQL3TSJ.js');
8
8
  var chunk7Y2O3E4D_js = require('./chunk-7Y2O3E4D.js');
9
9
  var chunkXA3ZNR75_js = require('./chunk-XA3ZNR75.js');
10
10
  require('./chunk-OWW5GUSB.js');
@@ -1087,7 +1087,7 @@ var DEFAULT_COUNTRY = "US";
1087
1087
  function createDefaultClient() {
1088
1088
  const processRef = globalThis.process;
1089
1089
  const envPublicKey = processRef?.env?.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY || "";
1090
- return chunkMW7ICTVK_js.createCimplifyClient({ publicKey: envPublicKey });
1090
+ return chunkJ3MGY6AU_js.createCimplifyClient({ publicKey: envPublicKey });
1091
1091
  }
1092
1092
  function getStoredLocationId() {
1093
1093
  if (typeof window === "undefined" || !window.localStorage) {
@@ -2716,7 +2716,7 @@ function CimplifySignInButton({
2716
2716
  const onClick = async () => {
2717
2717
  if (busy || disabled) return;
2718
2718
  setBusy(true);
2719
- await chunk6DMHVQ42_js.startSignIn({
2719
+ await chunkGDAGM26J_js.startSignIn({
2720
2720
  ...signInOpts,
2721
2721
  onSuccess: () => {
2722
2722
  setBusy(false);
@@ -5118,19 +5118,19 @@ function AuthElement({
5118
5118
  }, [onReady, onAuthenticated, onRequiresOtp, onError]);
5119
5119
  React12.useEffect(() => {
5120
5120
  if (!elements || !containerRef.current) return;
5121
- const element = elements.create(chunkJGBDWEPJ_js.ELEMENT_TYPES.AUTH, { prefillEmail });
5121
+ const element = elements.create(chunkAVQL3TSJ_js.ELEMENT_TYPES.AUTH, { prefillEmail });
5122
5122
  elementRef.current = element;
5123
- element.on(chunkJGBDWEPJ_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
5123
+ element.on(chunkAVQL3TSJ_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
5124
5124
  element.on(
5125
- chunkJGBDWEPJ_js.EVENT_TYPES.AUTHENTICATED,
5125
+ chunkAVQL3TSJ_js.EVENT_TYPES.AUTHENTICATED,
5126
5126
  (data) => onAuthenticatedRef.current?.(data)
5127
5127
  );
5128
5128
  element.on(
5129
- chunkJGBDWEPJ_js.EVENT_TYPES.REQUIRES_OTP,
5129
+ chunkAVQL3TSJ_js.EVENT_TYPES.REQUIRES_OTP,
5130
5130
  (data) => onRequiresOtpRef.current?.(data)
5131
5131
  );
5132
5132
  element.on(
5133
- chunkJGBDWEPJ_js.EVENT_TYPES.ERROR,
5133
+ chunkAVQL3TSJ_js.EVENT_TYPES.ERROR,
5134
5134
  (data) => onErrorRef.current?.(data)
5135
5135
  );
5136
5136
  element.mount(containerRef.current);
@@ -5159,15 +5159,15 @@ function AddressElement({
5159
5159
  }, [onReady, onChange, onError]);
5160
5160
  React12.useEffect(() => {
5161
5161
  if (!elements || !containerRef.current) return;
5162
- const element = elements.create(chunkJGBDWEPJ_js.ELEMENT_TYPES.ADDRESS, { mode });
5162
+ const element = elements.create(chunkAVQL3TSJ_js.ELEMENT_TYPES.ADDRESS, { mode });
5163
5163
  elementRef.current = element;
5164
- element.on(chunkJGBDWEPJ_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
5164
+ element.on(chunkAVQL3TSJ_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
5165
5165
  element.on(
5166
- chunkJGBDWEPJ_js.EVENT_TYPES.CHANGE,
5166
+ chunkAVQL3TSJ_js.EVENT_TYPES.CHANGE,
5167
5167
  (data) => onChangeRef.current?.(data)
5168
5168
  );
5169
5169
  element.on(
5170
- chunkJGBDWEPJ_js.EVENT_TYPES.ERROR,
5170
+ chunkAVQL3TSJ_js.EVENT_TYPES.ERROR,
5171
5171
  (data) => onErrorRef.current?.(data)
5172
5172
  );
5173
5173
  element.mount(containerRef.current);
@@ -5197,15 +5197,15 @@ function PaymentElement({
5197
5197
  }, [onReady, onChange, onError]);
5198
5198
  React12.useEffect(() => {
5199
5199
  if (!elements || !containerRef.current) return;
5200
- const element = elements.create(chunkJGBDWEPJ_js.ELEMENT_TYPES.PAYMENT, { amount, currency });
5200
+ const element = elements.create(chunkAVQL3TSJ_js.ELEMENT_TYPES.PAYMENT, { amount, currency });
5201
5201
  elementRef.current = element;
5202
- element.on(chunkJGBDWEPJ_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
5202
+ element.on(chunkAVQL3TSJ_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
5203
5203
  element.on(
5204
- chunkJGBDWEPJ_js.EVENT_TYPES.CHANGE,
5204
+ chunkAVQL3TSJ_js.EVENT_TYPES.CHANGE,
5205
5205
  (data) => onChangeRef.current?.(data)
5206
5206
  );
5207
5207
  element.on(
5208
- chunkJGBDWEPJ_js.EVENT_TYPES.ERROR,
5208
+ chunkAVQL3TSJ_js.EVENT_TYPES.ERROR,
5209
5209
  (data) => onErrorRef.current?.(data)
5210
5210
  );
5211
5211
  element.mount(containerRef.current);
@@ -5465,7 +5465,7 @@ function VariantSelector({
5465
5465
  {
5466
5466
  "data-cimplify-variant-name": true,
5467
5467
  className: cn("flex-1 min-w-0 text-sm", classNames?.name),
5468
- children: chunk6DMHVQ42_js.getVariantDisplayName(variant, productName)
5468
+ children: chunkGDAGM26J_js.getVariantDisplayName(variant, productName)
5469
5469
  }
5470
5470
  ),
5471
5471
  /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-variant-pricing": true, className: cn("text-sm text-muted-foreground", classNames?.pricing), children: [
@@ -6938,12 +6938,12 @@ function FieldInput({
6938
6938
  classNames?.input
6939
6939
  );
6940
6940
  switch (field.field_type) {
6941
- case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Text:
6942
- case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Url:
6941
+ case chunkGDAGM26J_js.INPUT_FIELD_TYPE.Text:
6942
+ case chunkGDAGM26J_js.INPUT_FIELD_TYPE.Url:
6943
6943
  return /* @__PURE__ */ jsxRuntime.jsx(
6944
6944
  "input",
6945
6945
  {
6946
- type: field.field_type === chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Url ? "url" : "text",
6946
+ type: field.field_type === chunkGDAGM26J_js.INPUT_FIELD_TYPE.Url ? "url" : "text",
6947
6947
  value: typeof value === "string" ? value : "",
6948
6948
  onChange: (e) => onValueChange(e.target.value),
6949
6949
  placeholder: field.placeholder,
@@ -6952,7 +6952,7 @@ function FieldInput({
6952
6952
  className: inputClass
6953
6953
  }
6954
6954
  );
6955
- case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Textarea:
6955
+ case chunkGDAGM26J_js.INPUT_FIELD_TYPE.Textarea:
6956
6956
  return /* @__PURE__ */ jsxRuntime.jsx(
6957
6957
  "textarea",
6958
6958
  {
@@ -6965,7 +6965,7 @@ function FieldInput({
6965
6965
  className: cn(inputClass, "resize-none", classNames?.textarea)
6966
6966
  }
6967
6967
  );
6968
- case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Number:
6968
+ case chunkGDAGM26J_js.INPUT_FIELD_TYPE.Number:
6969
6969
  return /* @__PURE__ */ jsxRuntime.jsx(
6970
6970
  "input",
6971
6971
  {
@@ -6979,7 +6979,7 @@ function FieldInput({
6979
6979
  className: inputClass
6980
6980
  }
6981
6981
  );
6982
- case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Select:
6982
+ case chunkGDAGM26J_js.INPUT_FIELD_TYPE.Select:
6983
6983
  return /* @__PURE__ */ jsxRuntime.jsxs(
6984
6984
  "select",
6985
6985
  {
@@ -6993,7 +6993,7 @@ function FieldInput({
6993
6993
  ]
6994
6994
  }
6995
6995
  );
6996
- case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Radio:
6996
+ case chunkGDAGM26J_js.INPUT_FIELD_TYPE.Radio:
6997
6997
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("space-y-2", classNames?.radioGroup), children: (field.options || []).map((opt) => /* @__PURE__ */ jsxRuntime.jsxs(
6998
6998
  "label",
6999
6999
  {
@@ -7018,7 +7018,7 @@ function FieldInput({
7018
7018
  },
7019
7019
  opt
7020
7020
  )) });
7021
- case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Checkbox:
7021
+ case chunkGDAGM26J_js.INPUT_FIELD_TYPE.Checkbox:
7022
7022
  return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: cn("flex items-center gap-2 text-sm cursor-pointer", classNames?.checkboxLabel), children: [
7023
7023
  /* @__PURE__ */ jsxRuntime.jsx(
7024
7024
  "input",
@@ -7031,7 +7031,7 @@ function FieldInput({
7031
7031
  ),
7032
7032
  field.placeholder || field.name
7033
7033
  ] });
7034
- case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Color:
7034
+ case chunkGDAGM26J_js.INPUT_FIELD_TYPE.Color:
7035
7035
  return /* @__PURE__ */ jsxRuntime.jsx(
7036
7036
  "input",
7037
7037
  {
@@ -7041,7 +7041,7 @@ function FieldInput({
7041
7041
  className: cn("w-12 h-10 rounded-md border border-input cursor-pointer", classNames?.colorInput)
7042
7042
  }
7043
7043
  );
7044
- case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Date:
7044
+ case chunkGDAGM26J_js.INPUT_FIELD_TYPE.Date:
7045
7045
  return /* @__PURE__ */ jsxRuntime.jsx(
7046
7046
  DatePicker,
7047
7047
  {
@@ -7052,8 +7052,8 @@ function FieldInput({
7052
7052
  "aria-label": field.name
7053
7053
  }
7054
7054
  );
7055
- case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.File:
7056
- case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Image:
7055
+ case chunkGDAGM26J_js.INPUT_FIELD_TYPE.File:
7056
+ case chunkGDAGM26J_js.INPUT_FIELD_TYPE.Image:
7057
7057
  return /* @__PURE__ */ jsxRuntime.jsx(
7058
7058
  FileUploadInput,
7059
7059
  {
@@ -7064,7 +7064,7 @@ function FieldInput({
7064
7064
  classNames
7065
7065
  }
7066
7066
  );
7067
- case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Email:
7067
+ case chunkGDAGM26J_js.INPUT_FIELD_TYPE.Email:
7068
7068
  return /* @__PURE__ */ jsxRuntime.jsx(
7069
7069
  "input",
7070
7070
  {
@@ -7076,7 +7076,7 @@ function FieldInput({
7076
7076
  className: inputClass
7077
7077
  }
7078
7078
  );
7079
- case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.DateTime: {
7079
+ case chunkGDAGM26J_js.INPUT_FIELD_TYPE.DateTime: {
7080
7080
  const stringValue = typeof value === "string" ? value : "";
7081
7081
  const [datePart, timePartRaw] = stringValue.includes("T") ? stringValue.split("T", 2) : [stringValue, ""];
7082
7082
  const timePart = (timePartRaw ?? "").slice(0, 5);
@@ -7115,7 +7115,7 @@ function FieldInput({
7115
7115
  )
7116
7116
  ] });
7117
7117
  }
7118
- case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Time:
7118
+ case chunkGDAGM26J_js.INPUT_FIELD_TYPE.Time:
7119
7119
  return /* @__PURE__ */ jsxRuntime.jsx(
7120
7120
  TimePicker,
7121
7121
  {
@@ -7126,7 +7126,7 @@ function FieldInput({
7126
7126
  "aria-label": field.name
7127
7127
  }
7128
7128
  );
7129
- case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.MultiSelect:
7129
+ case chunkGDAGM26J_js.INPUT_FIELD_TYPE.MultiSelect:
7130
7130
  return /* @__PURE__ */ jsxRuntime.jsx(
7131
7131
  MultiSelectInput,
7132
7132
  {
@@ -7136,7 +7136,7 @@ function FieldInput({
7136
7136
  classNames
7137
7137
  }
7138
7138
  );
7139
- case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.DateRange:
7139
+ case chunkGDAGM26J_js.INPUT_FIELD_TYPE.DateRange:
7140
7140
  return /* @__PURE__ */ jsxRuntime.jsx(
7141
7141
  DateRangeInput,
7142
7142
  {
@@ -7146,7 +7146,7 @@ function FieldInput({
7146
7146
  classNames
7147
7147
  }
7148
7148
  );
7149
- case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Address:
7149
+ case chunkGDAGM26J_js.INPUT_FIELD_TYPE.Address:
7150
7150
  return /* @__PURE__ */ jsxRuntime.jsx(
7151
7151
  AddressInput,
7152
7152
  {
@@ -7157,7 +7157,7 @@ function FieldInput({
7157
7157
  inputClass
7158
7158
  }
7159
7159
  );
7160
- case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Location:
7160
+ case chunkGDAGM26J_js.INPUT_FIELD_TYPE.Location:
7161
7161
  return /* @__PURE__ */ jsxRuntime.jsx(
7162
7162
  LocationInput,
7163
7163
  {
@@ -7168,7 +7168,7 @@ function FieldInput({
7168
7168
  inputClass
7169
7169
  }
7170
7170
  );
7171
- case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Phone:
7171
+ case chunkGDAGM26J_js.INPUT_FIELD_TYPE.Phone:
7172
7172
  return /* @__PURE__ */ jsxRuntime.jsx(
7173
7173
  PhoneInput,
7174
7174
  {
@@ -7179,7 +7179,7 @@ function FieldInput({
7179
7179
  inputClass
7180
7180
  }
7181
7181
  );
7182
- case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Signature:
7182
+ case chunkGDAGM26J_js.INPUT_FIELD_TYPE.Signature:
7183
7183
  return /* @__PURE__ */ jsxRuntime.jsx(
7184
7184
  SignatureInput,
7185
7185
  {
@@ -7212,7 +7212,7 @@ function FileUploadInput({
7212
7212
  const [isUploading, setIsUploading] = React12__default.default.useState(false);
7213
7213
  const fileUrl = typeof value === "string" ? value : void 0;
7214
7214
  const acceptedFormats = field.validation?.accepted_formats;
7215
- const accept = acceptedFormats ? acceptedFormats.map((f) => `.${f}`).join(",") : field.field_type === chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Image ? "image/*" : void 0;
7215
+ const accept = acceptedFormats ? acceptedFormats.map((f) => `.${f}`).join(",") : field.field_type === chunkGDAGM26J_js.INPUT_FIELD_TYPE.Image ? "image/*" : void 0;
7216
7216
  const handleFile = async (file) => {
7217
7217
  if (!onFileUpload) return;
7218
7218
  if (field.validation?.max_size_mb) {
@@ -7230,7 +7230,7 @@ function FileUploadInput({
7230
7230
  }
7231
7231
  };
7232
7232
  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: [
7233
- field.field_type === chunk6DMHVQ42_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" }),
7233
+ field.field_type === chunkGDAGM26J_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" }),
7234
7234
  /* @__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() }) }),
7235
7235
  /* @__PURE__ */ jsxRuntime.jsx(
7236
7236
  "button",
@@ -7256,7 +7256,7 @@ function FileUploadInput({
7256
7256
  }
7257
7257
  ),
7258
7258
  isUploading ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: "Uploading..." }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7259
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: field.placeholder || `Upload ${field.field_type === chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Image ? "image" : "file"}` }),
7259
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: field.placeholder || `Upload ${field.field_type === chunkGDAGM26J_js.INPUT_FIELD_TYPE.Image ? "image" : "file"}` }),
7260
7260
  acceptedFormats && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground/60 mt-1", children: [
7261
7261
  acceptedFormats.map((f) => f.toUpperCase()).join(", "),
7262
7262
  field.validation?.max_size_mb && ` \xB7 Max ${field.validation.max_size_mb}MB`
@@ -8878,7 +8878,7 @@ function CartLineItemRow({
8878
8878
  const isOptimistic = item.isOptimistic === true;
8879
8879
  const lineTotal = chunk7Y2O3E4D_js.parsePrice(unitPrice) * item.quantity;
8880
8880
  const imageUrl = item.product.image_url;
8881
- const variantLabel = item.variant ? chunk6DMHVQ42_js.getVariantDisplayName(item.variant, item.product.name) : null;
8881
+ const variantLabel = item.variant ? chunkGDAGM26J_js.getVariantDisplayName(item.variant, item.product.name) : null;
8882
8882
  return /* @__PURE__ */ jsxRuntime.jsxs(
8883
8883
  "div",
8884
8884
  {
@@ -8978,7 +8978,7 @@ function CartLineItemRow({
8978
8978
  input.field_name,
8979
8979
  ":"
8980
8980
  ] }),
8981
- /* @__PURE__ */ jsxRuntime.jsx("dd", { "data-cimplify-cart-input-value": true, className: "text-foreground m-0 truncate", children: input.field_type === chunk6DMHVQ42_js.INPUT_FIELD_TYPE.File || input.field_type === chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Image ? String(input.value).split("/").pop() || "Uploaded file" : String(input.value) })
8981
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { "data-cimplify-cart-input-value": true, className: "text-foreground m-0 truncate", children: input.field_type === chunkGDAGM26J_js.INPUT_FIELD_TYPE.File || input.field_type === chunkGDAGM26J_js.INPUT_FIELD_TYPE.Image ? String(input.value).split("/").pop() || "Uploaded file" : String(input.value) })
8982
8982
  ] }, input.field_id)) }),
8983
8983
  (item.lineType === "service" || item.product.type === "service") && item.scheduledStart && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-service-info": true, className: cn("mt-1.5 flex items-center gap-1.5 text-xs text-muted-foreground", classNames?.serviceInfo), children: [
8984
8984
  /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-3.5 h-3.5 shrink-0", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }),
@@ -9699,7 +9699,7 @@ function FoodProductCard({
9699
9699
  const tags = product.tags || [];
9700
9700
  const isSignature = product.metadata?.is_signature === true;
9701
9701
  const isNew = product.metadata?.is_new === true;
9702
- const isComposite = product.type === chunk6DMHVQ42_js.PRODUCT_TYPE.Composite;
9702
+ const isComposite = product.type === chunkGDAGM26J_js.PRODUCT_TYPE.Composite;
9703
9703
  return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
9704
9704
  /* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "square", renderImage, children: [
9705
9705
  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: [
@@ -10452,26 +10452,26 @@ var BUILT_IN_CARDS = {
10452
10452
  ["composite" /* Composite */]: CompositeProductCard,
10453
10453
  ["subscription" /* Subscription */]: SubscriptionCard
10454
10454
  };
10455
- var RENTAL_UNITS = /* @__PURE__ */ new Set([chunk6DMHVQ42_js.DURATION_UNIT.Days, chunk6DMHVQ42_js.DURATION_UNIT.Hours]);
10456
- var LEASE_UNITS = /* @__PURE__ */ new Set([chunk6DMHVQ42_js.DURATION_UNIT.Weeks, chunk6DMHVQ42_js.DURATION_UNIT.Months, chunk6DMHVQ42_js.DURATION_UNIT.Years]);
10455
+ var RENTAL_UNITS = /* @__PURE__ */ new Set([chunkGDAGM26J_js.DURATION_UNIT.Days, chunkGDAGM26J_js.DURATION_UNIT.Hours]);
10456
+ var LEASE_UNITS = /* @__PURE__ */ new Set([chunkGDAGM26J_js.DURATION_UNIT.Weeks, chunkGDAGM26J_js.DURATION_UNIT.Months, chunkGDAGM26J_js.DURATION_UNIT.Years]);
10457
10457
  function resolveCardVariant(product) {
10458
- if (product.type === chunk6DMHVQ42_js.PRODUCT_TYPE.Bundle) {
10458
+ if (product.type === chunkGDAGM26J_js.PRODUCT_TYPE.Bundle) {
10459
10459
  return "bundle" /* Bundle */;
10460
10460
  }
10461
- if (product.type === chunk6DMHVQ42_js.PRODUCT_TYPE.Composite) {
10461
+ if (product.type === chunkGDAGM26J_js.PRODUCT_TYPE.Composite) {
10462
10462
  return "composite" /* Composite */;
10463
10463
  }
10464
10464
  if (product.quantity_pricing && product.quantity_pricing.length > 1) {
10465
10465
  return "wholesale" /* Wholesale */;
10466
10466
  }
10467
- if (product.type === chunk6DMHVQ42_js.PRODUCT_TYPE.Digital) {
10467
+ if (product.type === chunkGDAGM26J_js.PRODUCT_TYPE.Digital) {
10468
10468
  return "digital" /* Digital */;
10469
10469
  }
10470
- if (product.type === chunk6DMHVQ42_js.PRODUCT_TYPE.Service) {
10470
+ if (product.type === chunkGDAGM26J_js.PRODUCT_TYPE.Service) {
10471
10471
  if (product.duration_unit && RENTAL_UNITS.has(product.duration_unit)) {
10472
10472
  return "rental" /* Rental */;
10473
10473
  }
10474
- if (product.duration_unit === chunk6DMHVQ42_js.DURATION_UNIT.Nights) {
10474
+ if (product.duration_unit === chunkGDAGM26J_js.DURATION_UNIT.Nights) {
10475
10475
  return "accommodation" /* Accommodation */;
10476
10476
  }
10477
10477
  if (product.duration_unit && LEASE_UNITS.has(product.duration_unit)) {
@@ -10482,10 +10482,10 @@ function resolveCardVariant(product) {
10482
10482
  }
10483
10483
  return "standard" /* Standard */;
10484
10484
  }
10485
- if (product.render_hint === chunk6DMHVQ42_js.RENDER_HINT.Food) {
10485
+ if (product.render_hint === chunkGDAGM26J_js.RENDER_HINT.Food) {
10486
10486
  return "food" /* Food */;
10487
10487
  }
10488
- if (product.render_hint === chunk6DMHVQ42_js.RENDER_HINT.Physical) {
10488
+ if (product.render_hint === chunkGDAGM26J_js.RENDER_HINT.Physical) {
10489
10489
  return "retail" /* Retail */;
10490
10490
  }
10491
10491
  return "retail" /* Retail */;
@@ -12792,7 +12792,7 @@ function DefaultProductLayout({
12792
12792
  className
12793
12793
  }) {
12794
12794
  const [selectedVariantId, setSelectedVariantId] = React12__default.default.useState();
12795
- const images = chunk6DMHVQ42_js.resolveGallery(product, selectedVariantId);
12795
+ const images = chunkGDAGM26J_js.resolveGallery(product, selectedVariantId);
12796
12796
  const hasRange = product.quantity_pricing && product.quantity_pricing.length > 1 || product.variants && product.variants.length > 1;
12797
12797
  const onSale = chunk7Y2O3E4D_js.isOnSale(product);
12798
12798
  const hasPhysicalDetails = product.sku || product.vendor || product.material;
@@ -13428,25 +13428,25 @@ function resolveTemplateKey(product) {
13428
13428
  if (typeof metaTemplate === "string" && metaTemplate.trim()) {
13429
13429
  return metaTemplate.trim();
13430
13430
  }
13431
- if (product.type === chunk6DMHVQ42_js.PRODUCT_TYPE.Bundle) {
13431
+ if (product.type === chunkGDAGM26J_js.PRODUCT_TYPE.Bundle) {
13432
13432
  return "bundle" /* Bundle */;
13433
13433
  }
13434
- if (product.type === chunk6DMHVQ42_js.PRODUCT_TYPE.Composite) {
13434
+ if (product.type === chunkGDAGM26J_js.PRODUCT_TYPE.Composite) {
13435
13435
  return "composite" /* Composite */;
13436
13436
  }
13437
13437
  if (product.quantity_pricing && product.quantity_pricing.length > 1) {
13438
13438
  return "wholesale" /* Wholesale */;
13439
13439
  }
13440
- if (product.type === chunk6DMHVQ42_js.PRODUCT_TYPE.Service) {
13440
+ if (product.type === chunkGDAGM26J_js.PRODUCT_TYPE.Service) {
13441
13441
  return "service" /* Service */;
13442
13442
  }
13443
- if (product.type === chunk6DMHVQ42_js.PRODUCT_TYPE.Digital) {
13443
+ if (product.type === chunkGDAGM26J_js.PRODUCT_TYPE.Digital) {
13444
13444
  return "digital" /* Digital */;
13445
13445
  }
13446
- if (product.render_hint === chunk6DMHVQ42_js.RENDER_HINT.Food) {
13446
+ if (product.render_hint === chunkGDAGM26J_js.RENDER_HINT.Food) {
13447
13447
  return "food" /* Food */;
13448
13448
  }
13449
- if (product.render_hint === chunk6DMHVQ42_js.RENDER_HINT.Physical) {
13449
+ if (product.render_hint === chunkGDAGM26J_js.RENDER_HINT.Physical) {
13450
13450
  return "physical" /* Physical */;
13451
13451
  }
13452
13452
  return "default" /* Default */;
@@ -15672,7 +15672,7 @@ function SparkleIcon({ className }) {
15672
15672
 
15673
15673
  Object.defineProperty(exports, "getVariantDisplayName", {
15674
15674
  enumerable: true,
15675
- get: function () { return chunk6DMHVQ42_js.getVariantDisplayName; }
15675
+ get: function () { return chunkGDAGM26J_js.getVariantDisplayName; }
15676
15676
  });
15677
15677
  exports.AccommodationCard = AccommodationCard;
15678
15678
  exports.AccountContent = AccountContent;
package/dist/react.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { DURATION_UNIT, getVariantDisplayName, INPUT_FIELD_TYPE, PRODUCT_TYPE, resolveGallery, startSignIn, RENDER_HINT } from './chunk-2AU263DK.mjs';
3
- export { getVariantDisplayName } from './chunk-2AU263DK.mjs';
4
- import './chunk-XSOYJLMZ.mjs';
5
- import { createCimplifyClient } from './chunk-SQ7U3BWY.mjs';
6
- import { ELEMENT_TYPES, EVENT_TYPES } from './chunk-I4IXPQIX.mjs';
2
+ import { DURATION_UNIT, getVariantDisplayName, INPUT_FIELD_TYPE, PRODUCT_TYPE, resolveGallery, startSignIn, RENDER_HINT } from './chunk-3Z3FQH7X.mjs';
3
+ export { getVariantDisplayName } from './chunk-3Z3FQH7X.mjs';
4
+ import './chunk-7BKKBJQM.mjs';
5
+ import { createCimplifyClient } from './chunk-227XTAEB.mjs';
6
+ import { ELEMENT_TYPES, EVENT_TYPES } from './chunk-R6363CC7.mjs';
7
7
  import { formatPrice, parsePrice, getUnitPriceAtQuantity, isOnSale, getDiscountPercentage, getBasePrice, getPriceRange, formatPriceRange } from './chunk-TD3AY34U.mjs';
8
8
  import { isSupportedCurrency } from './chunk-AMZXALF6.mjs';
9
9
  import './chunk-3G6RQLXK.mjs';
package/dist/server.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { ac as CimplifyClient } from './client-DKg-5OWu.mjs';
2
- export { J as CacheOptions, c7 as ReadRequestOptions, ct as Result } from './client-DKg-5OWu.mjs';
1
+ import { ac as CimplifyClient } from './client-Dka2cGhu.mjs';
2
+ export { J as CacheOptions, c7 as ReadRequestOptions, ct as Result } from './client-Dka2cGhu.mjs';
3
3
  export { Q as Category, T as CimplifyError, U as Collection, aX as Product, b9 as ProductWithDetails } from './product-B_kS4Oxa.mjs';
4
4
  import { JWTVerifyResult } from 'jose';
5
5
  import './payment-DVS7ZUEp.mjs';
@@ -203,6 +203,7 @@ interface OidcConfig {
203
203
  cookieName?: string;
204
204
  cookieDomain?: string;
205
205
  accessTokenCookieName?: string;
206
+ refreshTokenCookieName?: string;
206
207
  }
207
208
  interface CimplifySession {
208
209
  sub: string;
@@ -231,7 +232,9 @@ declare function verifyIdToken(cfg: OidcConfig, idToken: string): Promise<JWTVer
231
232
  declare function buildSessionCookie(cfg: OidcConfig, idToken: string, maxAgeSeconds: number): string;
232
233
  declare function buildSignoutCookie(cfg: OidcConfig): string;
233
234
  declare function buildAccessTokenCookie(cfg: OidcConfig, accessToken: string, maxAgeSeconds: number): string;
235
+ declare function buildRefreshTokenCookie(cfg: OidcConfig, refreshToken: string, maxAgeSeconds: number): string;
234
236
  declare function buildSignoutCookies(cfg: OidcConfig): string[];
237
+ declare function getRefreshTokenFromCookieHeader(cfg: OidcConfig, cookieHeader: string | null | undefined): string | null;
235
238
  declare function getAccessTokenFromCookieHeader(cfg: OidcConfig, cookieHeader: string | null | undefined): string | null;
236
239
  interface CallbackHandlerOptions extends OidcConfig {
237
240
  redirectUri: string;
@@ -250,5 +253,17 @@ interface RedirectCallbackOptions extends OidcConfig {
250
253
  declare function handleRedirectCallback(req: Request, opts: RedirectCallbackOptions): Promise<Response>;
251
254
  declare function handleSessionRequest(req: Request, cfg: OidcConfig): Promise<Response>;
252
255
  declare function getSessionFromCookieHeader(cfg: OidcConfig, cookieHeader: string | null | undefined): Promise<CimplifySession | null>;
256
+ declare function refreshTokens(cfg: OidcConfig, refreshToken: string): Promise<CodeExchangeResult>;
257
+ interface TokenRefreshResult {
258
+ outcome: "noop" | "refreshed" | "cleared";
259
+ /** Set-Cookie header values for the browser. */
260
+ setCookies: string[];
261
+ /** Forwarded onto the current request so this render sees the rotated tokens. */
262
+ cookies: {
263
+ name: string;
264
+ value: string;
265
+ }[];
266
+ }
267
+ declare function handleTokenRefresh(req: Request, cfg: OidcConfig): Promise<TokenRefreshResult>;
253
268
 
254
- export { CACHE_LIFE_DEFAULT, CACHE_LIFE_PROBE, type CacheLifeDefault, type CacheLifeProbe, type CallbackHandlerOptions, CimplifyClient, type CimplifySession, type CodeExchangeOptions, type CodeExchangeResult, type OidcConfig, type RedirectCallbackOptions, type RevalidateProfile, type ServerClientOptions, buildAccessTokenCookie, buildSessionCookie, buildSignoutCookie, buildSignoutCookies, exchangeCode, getAccessTokenFromCookieHeader, getServerClient, getSessionFromCookieHeader, handleOidcCallback, handleRedirectCallback, handleSessionRequest, refreshPage, revalidateAddOn, revalidateAddOns, revalidateBrand, revalidateBusiness, revalidateByTag, revalidateCategories, revalidateCategory, revalidateCollection, revalidateCollections, revalidateLocation, revalidateLocations, revalidatePricing, revalidateProduct, revalidateProducts, revalidateStock, revalidateSubscription, revalidateSubscriptions, tags, updateAddOn, updateAddOns, updateBrand, updateBusiness, updateByTag, updateCategories, updateCategory, updateCollection, updateCollections, updateLocation, updateLocations, updatePricing, updateProduct, updateProducts, updateStock, updateSubscription, updateSubscriptions, verifyIdToken };
269
+ export { CACHE_LIFE_DEFAULT, CACHE_LIFE_PROBE, type CacheLifeDefault, type CacheLifeProbe, type CallbackHandlerOptions, CimplifyClient, type CimplifySession, type CodeExchangeOptions, type CodeExchangeResult, type OidcConfig, type RedirectCallbackOptions, type RevalidateProfile, type ServerClientOptions, type TokenRefreshResult, buildAccessTokenCookie, buildRefreshTokenCookie, buildSessionCookie, buildSignoutCookie, buildSignoutCookies, exchangeCode, getAccessTokenFromCookieHeader, getRefreshTokenFromCookieHeader, getServerClient, getSessionFromCookieHeader, handleOidcCallback, handleRedirectCallback, handleSessionRequest, handleTokenRefresh, refreshPage, refreshTokens, revalidateAddOn, revalidateAddOns, revalidateBrand, revalidateBusiness, revalidateByTag, revalidateCategories, revalidateCategory, revalidateCollection, revalidateCollections, revalidateLocation, revalidateLocations, revalidatePricing, revalidateProduct, revalidateProducts, revalidateStock, revalidateSubscription, revalidateSubscriptions, tags, updateAddOn, updateAddOns, updateBrand, updateBusiness, updateByTag, updateCategories, updateCategory, updateCollection, updateCollections, updateLocation, updateLocations, updatePricing, updateProduct, updateProducts, updateStock, updateSubscription, updateSubscriptions, verifyIdToken };
package/dist/server.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { ac as CimplifyClient } from './client-Dfg_hmkP.js';
2
- export { J as CacheOptions, c7 as ReadRequestOptions, ct as Result } from './client-Dfg_hmkP.js';
1
+ import { ac as CimplifyClient } from './client-Bo5rujc2.js';
2
+ export { J as CacheOptions, c7 as ReadRequestOptions, ct as Result } from './client-Bo5rujc2.js';
3
3
  export { Q as Category, T as CimplifyError, U as Collection, aX as Product, b9 as ProductWithDetails } from './product-B_kS4Oxa.js';
4
4
  import { JWTVerifyResult } from 'jose';
5
5
  import './payment-sn-yGL7v.js';
@@ -203,6 +203,7 @@ interface OidcConfig {
203
203
  cookieName?: string;
204
204
  cookieDomain?: string;
205
205
  accessTokenCookieName?: string;
206
+ refreshTokenCookieName?: string;
206
207
  }
207
208
  interface CimplifySession {
208
209
  sub: string;
@@ -231,7 +232,9 @@ declare function verifyIdToken(cfg: OidcConfig, idToken: string): Promise<JWTVer
231
232
  declare function buildSessionCookie(cfg: OidcConfig, idToken: string, maxAgeSeconds: number): string;
232
233
  declare function buildSignoutCookie(cfg: OidcConfig): string;
233
234
  declare function buildAccessTokenCookie(cfg: OidcConfig, accessToken: string, maxAgeSeconds: number): string;
235
+ declare function buildRefreshTokenCookie(cfg: OidcConfig, refreshToken: string, maxAgeSeconds: number): string;
234
236
  declare function buildSignoutCookies(cfg: OidcConfig): string[];
237
+ declare function getRefreshTokenFromCookieHeader(cfg: OidcConfig, cookieHeader: string | null | undefined): string | null;
235
238
  declare function getAccessTokenFromCookieHeader(cfg: OidcConfig, cookieHeader: string | null | undefined): string | null;
236
239
  interface CallbackHandlerOptions extends OidcConfig {
237
240
  redirectUri: string;
@@ -250,5 +253,17 @@ interface RedirectCallbackOptions extends OidcConfig {
250
253
  declare function handleRedirectCallback(req: Request, opts: RedirectCallbackOptions): Promise<Response>;
251
254
  declare function handleSessionRequest(req: Request, cfg: OidcConfig): Promise<Response>;
252
255
  declare function getSessionFromCookieHeader(cfg: OidcConfig, cookieHeader: string | null | undefined): Promise<CimplifySession | null>;
256
+ declare function refreshTokens(cfg: OidcConfig, refreshToken: string): Promise<CodeExchangeResult>;
257
+ interface TokenRefreshResult {
258
+ outcome: "noop" | "refreshed" | "cleared";
259
+ /** Set-Cookie header values for the browser. */
260
+ setCookies: string[];
261
+ /** Forwarded onto the current request so this render sees the rotated tokens. */
262
+ cookies: {
263
+ name: string;
264
+ value: string;
265
+ }[];
266
+ }
267
+ declare function handleTokenRefresh(req: Request, cfg: OidcConfig): Promise<TokenRefreshResult>;
253
268
 
254
- export { CACHE_LIFE_DEFAULT, CACHE_LIFE_PROBE, type CacheLifeDefault, type CacheLifeProbe, type CallbackHandlerOptions, CimplifyClient, type CimplifySession, type CodeExchangeOptions, type CodeExchangeResult, type OidcConfig, type RedirectCallbackOptions, type RevalidateProfile, type ServerClientOptions, buildAccessTokenCookie, buildSessionCookie, buildSignoutCookie, buildSignoutCookies, exchangeCode, getAccessTokenFromCookieHeader, getServerClient, getSessionFromCookieHeader, handleOidcCallback, handleRedirectCallback, handleSessionRequest, refreshPage, revalidateAddOn, revalidateAddOns, revalidateBrand, revalidateBusiness, revalidateByTag, revalidateCategories, revalidateCategory, revalidateCollection, revalidateCollections, revalidateLocation, revalidateLocations, revalidatePricing, revalidateProduct, revalidateProducts, revalidateStock, revalidateSubscription, revalidateSubscriptions, tags, updateAddOn, updateAddOns, updateBrand, updateBusiness, updateByTag, updateCategories, updateCategory, updateCollection, updateCollections, updateLocation, updateLocations, updatePricing, updateProduct, updateProducts, updateStock, updateSubscription, updateSubscriptions, verifyIdToken };
269
+ export { CACHE_LIFE_DEFAULT, CACHE_LIFE_PROBE, type CacheLifeDefault, type CacheLifeProbe, type CallbackHandlerOptions, CimplifyClient, type CimplifySession, type CodeExchangeOptions, type CodeExchangeResult, type OidcConfig, type RedirectCallbackOptions, type RevalidateProfile, type ServerClientOptions, type TokenRefreshResult, buildAccessTokenCookie, buildRefreshTokenCookie, buildSessionCookie, buildSignoutCookie, buildSignoutCookies, exchangeCode, getAccessTokenFromCookieHeader, getRefreshTokenFromCookieHeader, getServerClient, getSessionFromCookieHeader, handleOidcCallback, handleRedirectCallback, handleSessionRequest, handleTokenRefresh, refreshPage, refreshTokens, revalidateAddOn, revalidateAddOns, revalidateBrand, revalidateBusiness, revalidateByTag, revalidateCategories, revalidateCategory, revalidateCollection, revalidateCollections, revalidateLocation, revalidateLocations, revalidatePricing, revalidateProduct, revalidateProducts, revalidateStock, revalidateSubscription, revalidateSubscriptions, tags, updateAddOn, updateAddOns, updateBrand, updateBusiness, updateByTag, updateCategories, updateCategory, updateCollection, updateCollections, updateLocation, updateLocations, updatePricing, updateProduct, updateProducts, updateStock, updateSubscription, updateSubscriptions, verifyIdToken };