@schematichq/schematic-components 1.2.0 → 1.3.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.
@@ -579,10 +579,10 @@ var require_coreJsData = __commonJS({
579
579
  var require_isMasked = __commonJS({
580
580
  "node_modules/lodash/_isMasked.js"(exports, module2) {
581
581
  var coreJsData = require_coreJsData();
582
- var maskSrcKey = function() {
582
+ var maskSrcKey = (function() {
583
583
  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
584
584
  return uid ? "Symbol(src)_1." + uid : "";
585
- }();
585
+ })();
586
586
  function isMasked(func) {
587
587
  return !!maskSrcKey && maskSrcKey in func;
588
588
  }
@@ -945,14 +945,14 @@ var require_Stack = __commonJS({
945
945
  var require_defineProperty = __commonJS({
946
946
  "node_modules/lodash/_defineProperty.js"(exports, module2) {
947
947
  var getNative = require_getNative();
948
- var defineProperty = function() {
948
+ var defineProperty = (function() {
949
949
  try {
950
950
  var func = getNative(Object, "defineProperty");
951
951
  func({}, "", {});
952
952
  return func;
953
953
  } catch (e2) {
954
954
  }
955
- }();
955
+ })();
956
956
  module2.exports = defineProperty;
957
957
  }
958
958
  });
@@ -1094,7 +1094,7 @@ var require_baseCreate = __commonJS({
1094
1094
  "node_modules/lodash/_baseCreate.js"(exports, module2) {
1095
1095
  var isObject2 = require_isObject();
1096
1096
  var objectCreate = Object.create;
1097
- var baseCreate = /* @__PURE__ */ function() {
1097
+ var baseCreate = /* @__PURE__ */ (function() {
1098
1098
  function object() {
1099
1099
  }
1100
1100
  return function(proto) {
@@ -1109,7 +1109,7 @@ var require_baseCreate = __commonJS({
1109
1109
  object.prototype = void 0;
1110
1110
  return result;
1111
1111
  };
1112
- }();
1112
+ })();
1113
1113
  module2.exports = baseCreate;
1114
1114
  }
1115
1115
  });
@@ -1181,9 +1181,9 @@ var require_isArguments = __commonJS({
1181
1181
  var objectProto = Object.prototype;
1182
1182
  var hasOwnProperty = objectProto.hasOwnProperty;
1183
1183
  var propertyIsEnumerable = objectProto.propertyIsEnumerable;
1184
- var isArguments = baseIsArguments(/* @__PURE__ */ function() {
1184
+ var isArguments = baseIsArguments(/* @__PURE__ */ (function() {
1185
1185
  return arguments;
1186
- }()) ? baseIsArguments : function(value) {
1186
+ })()) ? baseIsArguments : function(value) {
1187
1187
  return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
1188
1188
  };
1189
1189
  module2.exports = isArguments;
@@ -1345,7 +1345,7 @@ var require_nodeUtil = __commonJS({
1345
1345
  var freeModule = freeExports && typeof module2 == "object" && module2 && !module2.nodeType && module2;
1346
1346
  var moduleExports = freeModule && freeModule.exports === freeExports;
1347
1347
  var freeProcess = moduleExports && freeGlobal.process;
1348
- var nodeUtil = function() {
1348
+ var nodeUtil = (function() {
1349
1349
  try {
1350
1350
  var types = freeModule && freeModule.require && freeModule.require("util").types;
1351
1351
  if (types) {
@@ -1354,7 +1354,7 @@ var require_nodeUtil = __commonJS({
1354
1354
  return freeProcess && freeProcess.binding && freeProcess.binding("util");
1355
1355
  } catch (e2) {
1356
1356
  }
1357
- }();
1357
+ })();
1358
1358
  module2.exports = nodeUtil;
1359
1359
  }
1360
1360
  });
@@ -3611,7 +3611,7 @@ function he(t2) {
3611
3611
  for (var n = [], o2 = 1; o2 < arguments.length; o2++) n[o2 - 1] = arguments[o2];
3612
3612
  return false ? new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t2, " for more information.").concat(n.length > 0 ? " Args: ".concat(n.join(", ")) : "")) : new Error(de.apply(void 0, __spreadArray([pe[t2]], n, false)).trim());
3613
3613
  }
3614
- var fe = function() {
3614
+ var fe = (function() {
3615
3615
  function e2(e3) {
3616
3616
  this.groupSizes = new Uint32Array(512), this.length = 512, this.tag = e3;
3617
3617
  }
@@ -3637,7 +3637,7 @@ var fe = function() {
3637
3637
  for (var n = this.groupSizes[e3], o2 = this.indexOfGroup(e3), r2 = o2 + n, s2 = o2; s2 < r2; s2++) t2 += "".concat(this.tag.getRule(s2)).concat(g);
3638
3638
  return t2;
3639
3639
  }, e2;
3640
- }();
3640
+ })();
3641
3641
  var me = 1 << 30;
3642
3642
  var ye = /* @__PURE__ */ new Map();
3643
3643
  var ve = /* @__PURE__ */ new Map();
@@ -3679,24 +3679,24 @@ function Ce() {
3679
3679
  return "undefined" != typeof __webpack_nonce__ ? __webpack_nonce__ : null;
3680
3680
  }
3681
3681
  var Ie = function(e2) {
3682
- var t2 = document.head, n = e2 || t2, o2 = document.createElement("style"), r2 = function(e3) {
3682
+ var t2 = document.head, n = e2 || t2, o2 = document.createElement("style"), r2 = (function(e3) {
3683
3683
  var t3 = Array.from(e3.querySelectorAll("style[".concat(f, "]")));
3684
3684
  return t3[t3.length - 1];
3685
- }(n), s2 = void 0 !== r2 ? r2.nextSibling : null;
3685
+ })(n), s2 = void 0 !== r2 ? r2.nextSibling : null;
3686
3686
  o2.setAttribute(f, m), o2.setAttribute(y, v);
3687
3687
  var i2 = Ce();
3688
3688
  return i2 && o2.setAttribute("nonce", i2), n.insertBefore(o2, s2), o2;
3689
3689
  };
3690
- var Ae = function() {
3690
+ var Ae = (function() {
3691
3691
  function e2(e3) {
3692
- this.element = Ie(e3), this.element.appendChild(document.createTextNode("")), this.sheet = function(e4) {
3692
+ this.element = Ie(e3), this.element.appendChild(document.createTextNode("")), this.sheet = (function(e4) {
3693
3693
  if (e4.sheet) return e4.sheet;
3694
3694
  for (var t2 = document.styleSheets, n = 0, o2 = t2.length; n < o2; n++) {
3695
3695
  var r2 = t2[n];
3696
3696
  if (r2.ownerNode === e4) return r2;
3697
3697
  }
3698
3698
  throw he(17);
3699
- }(this.element), this.length = 0;
3699
+ })(this.element), this.length = 0;
3700
3700
  }
3701
3701
  return e2.prototype.insertRule = function(e3, t2) {
3702
3702
  try {
@@ -3710,8 +3710,8 @@ var Ae = function() {
3710
3710
  var t2 = this.sheet.cssRules[e3];
3711
3711
  return t2 && t2.cssText ? t2.cssText : "";
3712
3712
  }, e2;
3713
- }();
3714
- var Oe = function() {
3713
+ })();
3714
+ var Oe = (function() {
3715
3715
  function e2(e3) {
3716
3716
  this.element = Ie(e3), this.nodes = this.element.childNodes, this.length = 0;
3717
3717
  }
@@ -3726,8 +3726,8 @@ var Oe = function() {
3726
3726
  }, e2.prototype.getRule = function(e3) {
3727
3727
  return e3 < this.length ? this.nodes[e3].textContent : "";
3728
3728
  }, e2;
3729
- }();
3730
- var De = function() {
3729
+ })();
3730
+ var De = (function() {
3731
3731
  function e2(e3) {
3732
3732
  this.rules = [], this.length = 0;
3733
3733
  }
@@ -3738,19 +3738,19 @@ var De = function() {
3738
3738
  }, e2.prototype.getRule = function(e3) {
3739
3739
  return e3 < this.length ? this.rules[e3] : "";
3740
3740
  }, e2;
3741
- }();
3741
+ })();
3742
3742
  var Re = S;
3743
3743
  var Te = { isServer: !S, useCSSOMInjection: !w };
3744
- var ke = function() {
3744
+ var ke = (function() {
3745
3745
  function e2(e3, n, o2) {
3746
3746
  void 0 === e3 && (e3 = C), void 0 === n && (n = {});
3747
3747
  var r2 = this;
3748
3748
  this.options = __assign(__assign({}, Te), e3), this.gs = n, this.names = new Map(o2), this.server = !!e3.isServer, !this.server && S && Re && (Re = false, _e(this)), ue(this, function() {
3749
- return function(e4) {
3749
+ return (function(e4) {
3750
3750
  for (var t2 = e4.getTag(), n2 = t2.length, o3 = "", r3 = function(n3) {
3751
- var r4 = function(e5) {
3751
+ var r4 = (function(e5) {
3752
3752
  return ve.get(e5);
3753
- }(n3);
3753
+ })(n3);
3754
3754
  if (void 0 === r4) return "continue";
3755
3755
  var s3 = e4.names.get(r4), i2 = t2.getGroup(n3);
3756
3756
  if (void 0 === s3 || !s3.size || 0 === i2.length) return "continue";
@@ -3760,7 +3760,7 @@ var ke = function() {
3760
3760
  }), o3 += "".concat(i2).concat(a2, '{content:"').concat(c2, '"}').concat(g);
3761
3761
  }, s2 = 0; s2 < n2; s2++) r3(s2);
3762
3762
  return o3;
3763
- }(r2);
3763
+ })(r2);
3764
3764
  });
3765
3765
  }
3766
3766
  return e2.registerId = function(e3) {
@@ -3772,10 +3772,10 @@ var ke = function() {
3772
3772
  }, e2.prototype.allocateGSInstance = function(e3) {
3773
3773
  return this.gs[e3] = (this.gs[e3] || 0) + 1;
3774
3774
  }, e2.prototype.getTag = function() {
3775
- return this.tag || (this.tag = (e3 = function(e4) {
3775
+ return this.tag || (this.tag = (e3 = (function(e4) {
3776
3776
  var t2 = e4.useCSSOMInjection, n = e4.target;
3777
3777
  return e4.isServer ? new De(n) : t2 ? new Ae(n) : new Oe(n);
3778
- }(this.options), new fe(e3)));
3778
+ })(this.options), new fe(e3)));
3779
3779
  var e3;
3780
3780
  }, e2.prototype.hasNameForId = function(e3, t2) {
3781
3781
  return this.names.has(e3) && this.names.get(e3).has(t2);
@@ -3794,7 +3794,7 @@ var ke = function() {
3794
3794
  }, e2.prototype.clearTag = function() {
3795
3795
  this.tag = void 0;
3796
3796
  }, e2;
3797
- }();
3797
+ })();
3798
3798
  var je = /&/g;
3799
3799
  var xe = /^\s*\/\/.*$/gm;
3800
3800
  function Ve(e2, t2) {
@@ -3847,7 +3847,7 @@ function Ye(e2) {
3847
3847
  }, [e2.shouldForwardProp, l2, u2]);
3848
3848
  return import_react.default.createElement($e.Provider, { value: d }, import_react.default.createElement(Le.Provider, { value: u2 }, e2.children));
3849
3849
  }
3850
- var We = function() {
3850
+ var We = (function() {
3851
3851
  function e2(e3, t2) {
3852
3852
  var n = this;
3853
3853
  this.inject = function(e4, t3) {
@@ -3861,7 +3861,7 @@ var We = function() {
3861
3861
  return e2.prototype.getName = function(e3) {
3862
3862
  return void 0 === e3 && (e3 = ze), this.name + e3.hash;
3863
3863
  }, e2;
3864
- }();
3864
+ })();
3865
3865
  var qe = function(e2) {
3866
3866
  return e2 >= "A" && e2 <= "Z";
3867
3867
  };
@@ -3905,7 +3905,7 @@ function Ze(e2) {
3905
3905
  return true;
3906
3906
  }
3907
3907
  var Ke = z(v);
3908
- var Qe = function() {
3908
+ var Qe = (function() {
3909
3909
  function e2(e3, t2, n) {
3910
3910
  this.rules = e3, this.staticRulesId = "", this.isStatic = false, this.componentId = t2, this.baseHash = M(Ke, t2), this.baseStyle = n, ke.registerId(t2);
3911
3911
  }
@@ -3936,12 +3936,12 @@ var Qe = function() {
3936
3936
  }
3937
3937
  return o2;
3938
3938
  }, e2;
3939
- }();
3939
+ })();
3940
3940
  var et = import_react.default.createContext(void 0);
3941
3941
  var tt = et.Consumer;
3942
3942
  function ot(e2) {
3943
3943
  var n = import_react.default.useContext(et), r2 = (0, import_react.useMemo)(function() {
3944
- return function(e3, n2) {
3944
+ return (function(e3, n2) {
3945
3945
  if (!e3) throw he(14);
3946
3946
  if (re(e3)) {
3947
3947
  var o2 = e3(n2);
@@ -3950,21 +3950,21 @@ function ot(e2) {
3950
3950
  }
3951
3951
  if (Array.isArray(e3) || "object" != typeof e3) throw he(8);
3952
3952
  return n2 ? __assign(__assign({}, n2), e3) : e3;
3953
- }(e2.theme, n);
3953
+ })(e2.theme, n);
3954
3954
  }, [e2.theme, n]);
3955
3955
  return e2.children ? import_react.default.createElement(et.Provider, { value: r2 }, e2.children) : null;
3956
3956
  }
3957
3957
  var rt = {};
3958
3958
  var st = /* @__PURE__ */ new Set();
3959
3959
  function it(e2, r2, s2) {
3960
- var i2 = se(e2), a2 = e2, c2 = !L(e2), p2 = r2.attrs, d = void 0 === p2 ? _ : p2, h = r2.componentId, f2 = void 0 === h ? function(e3, t2) {
3960
+ var i2 = se(e2), a2 = e2, c2 = !L(e2), p2 = r2.attrs, d = void 0 === p2 ? _ : p2, h = r2.componentId, f2 = void 0 === h ? (function(e3, t2) {
3961
3961
  var n = "string" != typeof e3 ? "sc" : R(e3);
3962
3962
  rt[n] = (rt[n] || 0) + 1;
3963
3963
  var o2 = "".concat(n, "-").concat($(v + n + rt[n]));
3964
3964
  return t2 ? "".concat(t2, "-").concat(o2) : o2;
3965
- }(r2.displayName, r2.parentComponentId) : h, m2 = r2.displayName, y2 = void 0 === m2 ? function(e3) {
3965
+ })(r2.displayName, r2.parentComponentId) : h, m2 = r2.displayName, y2 = void 0 === m2 ? (function(e3) {
3966
3966
  return L(e3) ? "styled.".concat(e3) : "Styled(".concat(B(e3), ")");
3967
- }(e2) : m2, g2 = r2.displayName && r2.componentId ? "".concat(R(r2.displayName), "-").concat(r2.componentId) : r2.componentId || f2, S2 = i2 && a2.attrs ? a2.attrs.concat(d).filter(Boolean) : d, w2 = r2.shouldForwardProp;
3967
+ })(e2) : m2, g2 = r2.displayName && r2.componentId ? "".concat(R(r2.displayName), "-").concat(r2.componentId) : r2.componentId || f2, S2 = i2 && a2.attrs ? a2.attrs.concat(d).filter(Boolean) : d, w2 = r2.shouldForwardProp;
3968
3968
  if (i2 && a2.shouldForwardProp) {
3969
3969
  var b2 = a2.shouldForwardProp;
3970
3970
  if (r2.shouldForwardProp) {
@@ -3976,37 +3976,37 @@ function it(e2, r2, s2) {
3976
3976
  }
3977
3977
  var N2 = new Qe(s2, g2, i2 ? a2.componentStyle : void 0);
3978
3978
  function O2(e3, r3) {
3979
- return function(e4, r4, s3) {
3979
+ return (function(e4, r4, s3) {
3980
3980
  var i3 = e4.attrs, a3 = e4.componentStyle, c3 = e4.defaultProps, p3 = e4.foldedComponentIds, d2 = e4.styledComponentId, h2 = e4.target, f3 = import_react.default.useContext(et), m3 = Ge(), y3 = e4.shouldForwardProp || m3.shouldForwardProp;
3981
3981
  (0, import_react.useDebugValue)(d2);
3982
- var v2 = I(r4, f3, c3) || C, g3 = function(e5, n, o2) {
3982
+ var v2 = I(r4, f3, c3) || C, g3 = (function(e5, n, o2) {
3983
3983
  for (var r5, s4 = __assign(__assign({}, n), { className: void 0, theme: o2 }), i4 = 0; i4 < e5.length; i4 += 1) {
3984
3984
  var a4 = re(r5 = e5[i4]) ? r5(s4) : r5;
3985
3985
  for (var c4 in a4) s4[c4] = "className" === c4 ? ie(s4[c4], a4[c4]) : "style" === c4 ? __assign(__assign({}, s4[c4]), a4[c4]) : a4[c4];
3986
3986
  }
3987
3987
  return n.className && (s4.className = ie(s4.className, n.className)), s4;
3988
- }(i3, r4, v2), S3 = g3.as || h2, w3 = {};
3988
+ })(i3, r4, v2), S3 = g3.as || h2, w3 = {};
3989
3989
  for (var b3 in g3) void 0 === g3[b3] || "$" === b3[0] || "as" === b3 || "theme" === b3 && g3.theme === v2 || ("forwardedAs" === b3 ? w3.as = g3.forwardedAs : y3 && !y3(b3, S3) || (w3[b3] = g3[b3], y3 || false || isPropValid(b3) || st.has(b3) || !A.has(S3) || (st.add(b3), console.warn('styled-components: it looks like an unknown prop "'.concat(b3, '" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));
3990
- var E3 = function(e5, t2) {
3990
+ var E3 = (function(e5, t2) {
3991
3991
  var n = Ge(), o2 = e5.generateAndInjectStyles(t2, n.styleSheet, n.stylis);
3992
3992
  return (0, import_react.useDebugValue)(o2), o2;
3993
- }(a3, g3);
3993
+ })(a3, g3);
3994
3994
  e4.warnTooManyClasses && e4.warnTooManyClasses(E3);
3995
3995
  var N3 = ie(p3, d2);
3996
3996
  return E3 && (N3 += " " + E3), g3.className && (N3 += " " + g3.className), w3[L(S3) && !A.has(S3) ? "class" : "className"] = N3, s3 && (w3.ref = s3), (0, import_react.createElement)(S3, w3);
3997
- }(D2, e3, r3);
3997
+ })(D2, e3, r3);
3998
3998
  }
3999
3999
  O2.displayName = y2;
4000
4000
  var D2 = import_react.default.forwardRef(O2);
4001
4001
  return D2.attrs = S2, D2.componentStyle = N2, D2.displayName = y2, D2.shouldForwardProp = w2, D2.foldedComponentIds = i2 ? ie(a2.foldedComponentIds, a2.styledComponentId) : "", D2.styledComponentId = g2, D2.target = i2 ? a2.target : e2, Object.defineProperty(D2, "defaultProps", { get: function() {
4002
4002
  return this._foldedDefaultProps;
4003
4003
  }, set: function(e3) {
4004
- this._foldedDefaultProps = i2 ? function(e4) {
4004
+ this._foldedDefaultProps = i2 ? (function(e4) {
4005
4005
  for (var t2 = [], n = 1; n < arguments.length; n++) t2[n - 1] = arguments[n];
4006
4006
  for (var o2 = 0, r3 = t2; o2 < r3.length; o2++) le(e4, r3[o2], true);
4007
4007
  return e4;
4008
- }({}, a2.defaultProps, e3) : e3;
4009
- } }), P(y2, g2), D2.warnTooManyClasses = /* @__PURE__ */ function(e3, t2) {
4008
+ })({}, a2.defaultProps, e3) : e3;
4009
+ } }), P(y2, g2), D2.warnTooManyClasses = /* @__PURE__ */ (function(e3, t2) {
4010
4010
  var n = {}, o2 = false;
4011
4011
  return function(r3) {
4012
4012
  if (!o2 && (n[r3] = true, Object.keys(n).length >= 200)) {
@@ -4014,7 +4014,7 @@ function it(e2, r2, s2) {
4014
4014
  console.warn("Over ".concat(200, " classes were generated for component ").concat(e3).concat(s3, ".\n") + "Consider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"), o2 = true, n = {};
4015
4015
  }
4016
4016
  };
4017
- }(y2, g2), ue(D2, function() {
4017
+ })(y2, g2), ue(D2, function() {
4018
4018
  return ".".concat(D2.styledComponentId);
4019
4019
  }), c2 && oe(D2, e2, { attrs: true, componentStyle: true, displayName: true, foldedComponentIds: true, shouldForwardProp: true, styledComponentId: true, target: true }), D2;
4020
4020
  }
@@ -4050,7 +4050,7 @@ var dt = pt;
4050
4050
  A.forEach(function(e2) {
4051
4051
  dt[e2] = pt(e2);
4052
4052
  });
4053
- var ht = function() {
4053
+ var ht = (function() {
4054
4054
  function e2(e3, t2) {
4055
4055
  this.rules = e3, this.componentId = t2, this.isStatic = Ze(e3), ke.registerId(this.componentId + 1);
4056
4056
  }
@@ -4062,7 +4062,7 @@ var ht = function() {
4062
4062
  }, e2.prototype.renderStyles = function(e3, t2, n, o2) {
4063
4063
  e3 > 2 && ke.registerId(this.componentId + e3), this.removeStyles(e3, n), this.createStyles(e3, t2, n, o2);
4064
4064
  }, e2;
4065
- }();
4065
+ })();
4066
4066
  function ft(n) {
4067
4067
  for (var r2 = [], s2 = 1; s2 < arguments.length; s2++) r2[s2 - 1] = arguments[s2];
4068
4068
  var i2 = lt.apply(void 0, __spreadArray([n], r2, false)), a2 = "sc-global-".concat($(JSON.stringify(i2))), c2 = new ht(i2, a2);
@@ -4092,7 +4092,7 @@ function mt(t2) {
4092
4092
  var r2 = ae(lt.apply(void 0, __spreadArray([t2], n, false))), s2 = $(r2);
4093
4093
  return new We(s2, r2);
4094
4094
  }
4095
- var vt = function() {
4095
+ var vt = (function() {
4096
4096
  function e2() {
4097
4097
  var e3 = this;
4098
4098
  this._emitSheetCSS = function() {
@@ -4120,7 +4120,7 @@ var vt = function() {
4120
4120
  }, e2.prototype.interleaveWithNodeStream = function(e3) {
4121
4121
  throw he(3);
4122
4122
  }, e2;
4123
- }();
4123
+ })();
4124
4124
  "undefined" != typeof navigator && "ReactNative" === navigator.product && console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native");
4125
4125
  var St = "__sc-".concat(f, "__");
4126
4126
  "undefined" != typeof window && (window[St] || (window[St] = 0), 1 === window[St] && console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."), window[St] += 1);
@@ -5050,22 +5050,22 @@ var Translator = class _Translator extends EventEmitter {
5050
5050
  const zeroSuffix = `${this.options.pluralSeparator}zero`;
5051
5051
  const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
5052
5052
  if (needsPluralHandling) {
5053
- finalKeys.push(key + pluralSuffix);
5054
5053
  if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
5055
5054
  finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
5056
5055
  }
5056
+ finalKeys.push(key + pluralSuffix);
5057
5057
  if (needsZeroSuffixLookup) {
5058
5058
  finalKeys.push(key + zeroSuffix);
5059
5059
  }
5060
5060
  }
5061
5061
  if (needsContextHandling) {
5062
- const contextKey = `${key}${this.options.contextSeparator}${opt.context}`;
5062
+ const contextKey = `${key}${this.options.contextSeparator || "_"}${opt.context}`;
5063
5063
  finalKeys.push(contextKey);
5064
5064
  if (needsPluralHandling) {
5065
- finalKeys.push(contextKey + pluralSuffix);
5066
5065
  if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
5067
5066
  finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
5068
5067
  }
5068
+ finalKeys.push(contextKey + pluralSuffix);
5069
5069
  if (needsZeroSuffixLookup) {
5070
5070
  finalKeys.push(contextKey + zeroSuffix);
5071
5071
  }
@@ -6721,6 +6721,7 @@ var en_default = {
6721
6721
  "Add new payment method": "Add new payment method",
6722
6722
  "Add Seats": "Add More",
6723
6723
  "Add-ons": "Add-ons",
6724
+ "Add-ons Quantity": "Add-ons Quantity",
6724
6725
  Additional: "Additional",
6725
6726
  "After the trial, cancel no default": "After the trial, you will be lose access to {{planName}} plan and your subscription will be cancelled.",
6726
6727
  "After the trial, cancel": "After the trial, you will be downgraded to the {{defaultPlanName}} plan and your subscription will be cancelled.",
@@ -6791,6 +6792,7 @@ var en_default = {
6791
6792
  "Powered by": "Powered by",
6792
6793
  "Price by unit based on final tier reached.": "Price by unit based on final tier reached.",
6793
6794
  Proration: "Proration",
6795
+ "Quantity to pay for in advance": "Quantity to pay for in advance",
6794
6796
  "Remove add-on": "Remove add-on",
6795
6797
  Resets: "Resets {{date}}",
6796
6798
  "Save payment method": "Save payment method",
@@ -6805,6 +6807,7 @@ var en_default = {
6805
6807
  "Select payment method": "Select payment method",
6806
6808
  "Select plan": "Select plan",
6807
6809
  "Select quantity": "Select quantity",
6810
+ "Select quantities for add-ons": "Select quantities for add-ons",
6808
6811
  Selected: "Selected",
6809
6812
  "Selected plan or associated price is missing.": "Selected plan or associated price is missing.",
6810
6813
  "Session expired. Please refresh and try again.": "Session expired. Please refresh and try again.",
@@ -7844,6 +7847,33 @@ function CheckoutUnsubscribeResponseFromJSONTyped(json, ignoreDiscriminator) {
7844
7847
  };
7845
7848
  }
7846
7849
 
7850
+ // src/api/checkoutexternal/models/CurrencyBalance.ts
7851
+ function CurrencyBalanceFromJSON(json) {
7852
+ return CurrencyBalanceFromJSONTyped(json, false);
7853
+ }
7854
+ function CurrencyBalanceFromJSONTyped(json, ignoreDiscriminator) {
7855
+ if (json == null) {
7856
+ return json;
7857
+ }
7858
+ return {
7859
+ balance: json["balance"],
7860
+ currency: json["currency"]
7861
+ };
7862
+ }
7863
+
7864
+ // src/api/checkoutexternal/models/CompanyCustomerBalance.ts
7865
+ function CompanyCustomerBalanceFromJSON(json) {
7866
+ return CompanyCustomerBalanceFromJSONTyped(json, false);
7867
+ }
7868
+ function CompanyCustomerBalanceFromJSONTyped(json, ignoreDiscriminator) {
7869
+ if (json == null) {
7870
+ return json;
7871
+ }
7872
+ return {
7873
+ balances: json["balances"].map(CurrencyBalanceFromJSON)
7874
+ };
7875
+ }
7876
+
7847
7877
  // src/api/checkoutexternal/models/CompanyEventPeriodMetricsResponseData.ts
7848
7878
  function CompanyEventPeriodMetricsResponseDataFromJSON(json) {
7849
7879
  return CompanyEventPeriodMetricsResponseDataFromJSONTyped(json, false);
@@ -8104,12 +8134,12 @@ function EventSummaryResponseDataFromJSONTyped(json, ignoreDiscriminator) {
8104
8134
  return json;
8105
8135
  }
8106
8136
  return {
8107
- companyCount: json["company_count"] == null ? void 0 : json["company_count"],
8137
+ companyCount: json["company_count"],
8108
8138
  environmentId: json["environment_id"],
8109
8139
  eventCount: json["event_count"],
8110
8140
  eventSubtype: json["event_subtype"],
8111
8141
  lastSeenAt: json["last_seen_at"] == null ? void 0 : new Date(json["last_seen_at"]),
8112
- userCount: json["user_count"] == null ? void 0 : json["user_count"]
8142
+ userCount: json["user_count"]
8113
8143
  };
8114
8144
  }
8115
8145
 
@@ -8725,6 +8755,20 @@ function DeletePaymentMethodResponseFromJSONTyped(json, ignoreDiscriminator) {
8725
8755
  };
8726
8756
  }
8727
8757
 
8758
+ // src/api/checkoutexternal/models/FetchCustomerBalanceResponse.ts
8759
+ function FetchCustomerBalanceResponseFromJSON(json) {
8760
+ return FetchCustomerBalanceResponseFromJSONTyped(json, false);
8761
+ }
8762
+ function FetchCustomerBalanceResponseFromJSONTyped(json, ignoreDiscriminator) {
8763
+ if (json == null) {
8764
+ return json;
8765
+ }
8766
+ return {
8767
+ data: CompanyCustomerBalanceFromJSON(json["data"]),
8768
+ params: json["params"]
8769
+ };
8770
+ }
8771
+
8728
8772
  // src/api/checkoutexternal/models/GetSetupIntentResponse.ts
8729
8773
  function GetSetupIntentResponseFromJSON(json) {
8730
8774
  return GetSetupIntentResponseFromJSONTyped(json, false);
@@ -9048,6 +9092,38 @@ var CheckoutexternalApi = class extends BaseAPI {
9048
9092
  );
9049
9093
  return await response.value();
9050
9094
  }
9095
+ /**
9096
+ * Fetch customer balance
9097
+ */
9098
+ async fetchCustomerBalanceRaw(initOverrides) {
9099
+ const queryParameters = {};
9100
+ const headerParameters = {};
9101
+ if (this.configuration && this.configuration.apiKey) {
9102
+ headerParameters["X-Schematic-Api-Key"] = await this.configuration.apiKey(
9103
+ "X-Schematic-Api-Key"
9104
+ );
9105
+ }
9106
+ const response = await this.request(
9107
+ {
9108
+ path: `/checkout/balance`,
9109
+ method: "GET",
9110
+ headers: headerParameters,
9111
+ query: queryParameters
9112
+ },
9113
+ initOverrides
9114
+ );
9115
+ return new JSONApiResponse(
9116
+ response,
9117
+ (jsonValue) => FetchCustomerBalanceResponseFromJSON(jsonValue)
9118
+ );
9119
+ }
9120
+ /**
9121
+ * Fetch customer balance
9122
+ */
9123
+ async fetchCustomerBalance(initOverrides) {
9124
+ const response = await this.fetchCustomerBalanceRaw(initOverrides);
9125
+ return await response.value();
9126
+ }
9051
9127
  /**
9052
9128
  * Get setup intent
9053
9129
  */
@@ -9782,12 +9858,12 @@ function EventSummaryResponseDataFromJSONTyped3(json, ignoreDiscriminator) {
9782
9858
  return json;
9783
9859
  }
9784
9860
  return {
9785
- companyCount: json["company_count"] == null ? void 0 : json["company_count"],
9861
+ companyCount: json["company_count"],
9786
9862
  environmentId: json["environment_id"],
9787
9863
  eventCount: json["event_count"],
9788
9864
  eventSubtype: json["event_subtype"],
9789
9865
  lastSeenAt: json["last_seen_at"] == null ? void 0 : new Date(json["last_seen_at"]),
9790
- userCount: json["user_count"] == null ? void 0 : json["user_count"]
9866
+ userCount: json["user_count"]
9791
9867
  };
9792
9868
  }
9793
9869
 
@@ -10300,7 +10376,7 @@ var EmbedProvider = ({
10300
10376
  });
10301
10377
  const customHeaders = (0, import_react12.useMemo)(
10302
10378
  () => ({
10303
- "X-Schematic-Components-Version": "1.2.0",
10379
+ "X-Schematic-Components-Version": "1.3.0",
10304
10380
  "X-Schematic-Session-ID": sessionIdRef.current
10305
10381
  }),
10306
10382
  []
@@ -12144,6 +12220,47 @@ var StageButton = ({
12144
12220
  );
12145
12221
  }
12146
12222
  if (checkoutStage === "addons") {
12223
+ const hasAddonsUsageStage = checkoutStages?.some(
12224
+ (stage) => stage.id === "addonsUsage"
12225
+ );
12226
+ const hasCreditsStage = checkoutStages?.some(
12227
+ (stage) => stage.id === "credits"
12228
+ );
12229
+ if (!isPaymentMethodRequired && !hasAddonsUsageStage && !hasCreditsStage) {
12230
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(NoPaymentRequired, {});
12231
+ }
12232
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
12233
+ Button,
12234
+ {
12235
+ type: "button",
12236
+ disabled: isDisabled,
12237
+ onClick: async () => {
12238
+ setCheckoutStage?.(
12239
+ hasAddonsUsageStage ? "addonsUsage" : hasCreditsStage ? "credits" : "checkout"
12240
+ );
12241
+ },
12242
+ $isLoading: isLoading,
12243
+ $fullWidth: true,
12244
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
12245
+ Flex,
12246
+ {
12247
+ $gap: "0.5rem",
12248
+ $justifyContent: "center",
12249
+ $alignItems: "center",
12250
+ $padding: "0 1rem",
12251
+ children: [
12252
+ t2("Next"),
12253
+ ":",
12254
+ " ",
12255
+ hasAddonsUsageStage ? t2("Add-ons Quantity") : hasCreditsStage ? t2("Credits") : t2("Checkout"),
12256
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon3, { name: "arrow-right" })
12257
+ ]
12258
+ }
12259
+ )
12260
+ }
12261
+ );
12262
+ }
12263
+ if (checkoutStage === "addonsUsage") {
12147
12264
  if (!isPaymentMethodRequired && !checkoutStages?.some((stage) => stage.id === "credits")) {
12148
12265
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(NoPaymentRequired, {});
12149
12266
  }
@@ -13039,6 +13156,22 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
13039
13156
  const { price, currency } = getAddOnPrice(addOn, period) || {};
13040
13157
  const isAddOnValid = isHydratedPlan(addOn) && addOn.valid;
13041
13158
  const isAddOnCurrent = isHydratedPlan(addOn) && addOn.current;
13159
+ const overageEntitlement = addOn.entitlements?.find(
13160
+ (entitlement) => entitlement.priceBehavior === "overage" /* Overage */
13161
+ );
13162
+ let overageInfo = null;
13163
+ if (overageEntitlement) {
13164
+ const priceData = period === "year" ? overageEntitlement.meteredYearlyPrice : overageEntitlement.meteredMonthlyPrice;
13165
+ if (priceData?.priceTier && priceData.priceTier.length >= 2) {
13166
+ const overageTier = priceData.priceTier[priceData.priceTier.length - 1];
13167
+ overageInfo = {
13168
+ softLimit: overageEntitlement.softLimit,
13169
+ perUnitPrice: overageTier.perUnitPriceDecimal ? Number(overageTier.perUnitPriceDecimal) : overageTier.perUnitPrice || 0,
13170
+ currency: priceData.currency || currency,
13171
+ featureName: overageEntitlement.feature?.name
13172
+ };
13173
+ }
13174
+ }
13042
13175
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
13043
13176
  Flex,
13044
13177
  {
@@ -13058,19 +13191,34 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
13058
13191
  /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Flex, { $flexDirection: "column", $gap: "0.75rem", children: [
13059
13192
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { display: "heading3", children: addOn.name }) }),
13060
13193
  addOn.description && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { children: addOn.description }) }),
13061
- (addOn[periodKey] || addOn.chargeType === ChargeType.oneTime) && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box, { children: [
13062
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { display: "heading2", children: formatCurrency(price ?? 0, currency) }),
13063
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
13064
- Text,
13065
- {
13066
- display: "heading2",
13067
- $size: 16 / 30 * settings.theme.typography.heading2.fontSize,
13068
- children: addOn.chargeType === ChargeType.oneTime ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
13069
- " ",
13070
- t2("one time")
13071
- ] }) : `/${period}`
13072
- }
13073
- )
13194
+ (addOn[periodKey] || addOn.chargeType === ChargeType.oneTime) && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Flex, { $flexDirection: "column", $gap: "0.25rem", children: [
13195
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box, { children: [
13196
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { display: "heading2", children: formatCurrency(price ?? 0, currency) }),
13197
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
13198
+ Text,
13199
+ {
13200
+ display: "heading2",
13201
+ $size: 16 / 30 * settings.theme.typography.heading2.fontSize,
13202
+ children: addOn.chargeType === ChargeType.oneTime ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
13203
+ " ",
13204
+ t2("one time")
13205
+ ] }) : `/${period}`
13206
+ }
13207
+ )
13208
+ ] }),
13209
+ overageInfo && overageInfo.softLimit && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Text, { $size: 0.875, style: { opacity: 0.8 }, children: [
13210
+ overageInfo.softLimit,
13211
+ " ",
13212
+ overageInfo.featureName || "units",
13213
+ " included, then",
13214
+ " ",
13215
+ formatCurrency(
13216
+ overageInfo.perUnitPrice,
13217
+ overageInfo.currency
13218
+ ),
13219
+ "/",
13220
+ overageInfo.featureName?.toLowerCase() || "unit"
13221
+ ] }) })
13074
13222
  ] }),
13075
13223
  isAddOnCurrent && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
13076
13224
  Flex,
@@ -14077,10 +14225,9 @@ var CheckoutDialog = ({ top = 0 }) => {
14077
14225
  }, [data]);
14078
14226
  const [selectedPlan, setSelectedPlan] = (0, import_react30.useState)(
14079
14227
  () => {
14080
- const currentSelectedPlan = availablePlans.find(
14228
+ return availablePlans.find(
14081
14229
  (plan) => checkoutState?.planId ? plan.id === checkoutState.planId : isHydratedPlan(plan) && plan.current
14082
14230
  );
14083
- return currentSelectedPlan;
14084
14231
  }
14085
14232
  );
14086
14233
  const [shouldTrial, setShouldTrial] = (0, import_react30.useState)(false);
@@ -14113,6 +14260,23 @@ var CheckoutDialog = ({ top = 0 }) => {
14113
14260
  []
14114
14261
  )
14115
14262
  );
14263
+ const [addOnUsageBasedEntitlements, setAddOnUsageBasedEntitlements] = (0, import_react30.useState)(() => {
14264
+ if (!isCheckoutData(data)) return [];
14265
+ const currentAddOns = data.company?.addOns || [];
14266
+ return currentAddOns.flatMap((currentAddOn) => {
14267
+ const availableAddOn = availableAddOns.find(
14268
+ (available) => available.id === currentAddOn.id
14269
+ );
14270
+ if (!availableAddOn) return [];
14271
+ return availableAddOn.entitlements.reduce(
14272
+ createActiveUsageBasedEntitlementsReducer(
14273
+ currentEntitlements,
14274
+ planPeriod
14275
+ ),
14276
+ []
14277
+ );
14278
+ });
14279
+ });
14116
14280
  const payInAdvanceEntitlements = (0, import_react30.useMemo)(
14117
14281
  () => usageBasedEntitlements.filter(
14118
14282
  (entitlement) => entitlement.priceBehavior === "pay_in_advance" /* PayInAdvance */
@@ -14153,6 +14317,19 @@ var CheckoutDialog = ({ top = 0 }) => {
14153
14317
  description: t2("Optionally add features to your subscription")
14154
14318
  });
14155
14319
  }
14320
+ const hasUsageBasedAddOnSelected = addOns.some((addOn) => {
14321
+ return addOn.isSelected && addOn.entitlements.some((entitlement) => {
14322
+ return entitlement.priceBehavior === "pay_in_advance" /* PayInAdvance */;
14323
+ });
14324
+ });
14325
+ if (hasUsageBasedAddOnSelected) {
14326
+ stages.push({
14327
+ id: "addonsUsage",
14328
+ name: t2("Add-ons Quantity"),
14329
+ label: t2("Select quantities for add-ons"),
14330
+ description: t2("Quantity to pay for in advance")
14331
+ });
14332
+ }
14156
14333
  if (creditBundles.length > 0) {
14157
14334
  stages.push({
14158
14335
  id: "credits",
@@ -14184,6 +14361,9 @@ var CheckoutDialog = ({ top = 0 }) => {
14184
14361
  if (checkoutState?.addOnId) {
14185
14362
  return "addons";
14186
14363
  }
14364
+ if (checkoutState?.addOnUsage) {
14365
+ return "addonsUsage";
14366
+ }
14187
14367
  if (checkoutState?.usage) {
14188
14368
  return "usage";
14189
14369
  }
@@ -14191,7 +14371,19 @@ var CheckoutDialog = ({ top = 0 }) => {
14191
14371
  return "credits";
14192
14372
  }
14193
14373
  if (checkoutState?.planId !== currentPlanId) {
14194
- return checkoutStages.some((stage) => stage.id === "usage") ? "usage" : checkoutStages.some((stage) => stage.id === "addons") ? "addons" : checkoutStages.some((stage) => stage.id === "credits") ? "credits" : "plan";
14374
+ const hasUsageStage = checkoutStages.some(
14375
+ (stage) => stage.id === "usage"
14376
+ );
14377
+ const hasAddonsStage = checkoutStages.some(
14378
+ (stage) => stage.id === "addons"
14379
+ );
14380
+ const hasAddonsUsageStage = checkoutStages.some(
14381
+ (stage) => stage.id === "addonsUsage"
14382
+ );
14383
+ if (hasUsageStage) return "usage";
14384
+ if (hasAddonsStage) return "addons";
14385
+ if (hasAddonsUsageStage) return "addonsUsage";
14386
+ return "plan";
14195
14387
  }
14196
14388
  return "plan";
14197
14389
  });
@@ -14228,19 +14420,34 @@ var CheckoutDialog = ({ top = 0 }) => {
14228
14420
  },
14229
14421
  []
14230
14422
  ),
14231
- payInAdvance: (updates.payInAdvanceEntitlements || payInAdvanceEntitlements).reduce(
14232
- (acc, { meteredMonthlyPrice, meteredYearlyPrice, quantity }) => {
14233
- const priceId = (period === "year" ? meteredYearlyPrice : meteredMonthlyPrice)?.priceId;
14234
- if (priceId) {
14235
- acc.push({
14236
- priceId,
14237
- quantity
14238
- });
14239
- }
14240
- return acc;
14241
- },
14242
- []
14243
- ),
14423
+ payInAdvance: [
14424
+ ...(updates.payInAdvanceEntitlements || payInAdvanceEntitlements).reduce(
14425
+ (acc, { meteredMonthlyPrice, meteredYearlyPrice, quantity }) => {
14426
+ const priceId = (period === "year" ? meteredYearlyPrice : meteredMonthlyPrice)?.priceId;
14427
+ if (priceId) {
14428
+ acc.push({
14429
+ priceId,
14430
+ quantity
14431
+ });
14432
+ }
14433
+ return acc;
14434
+ },
14435
+ []
14436
+ ),
14437
+ ...(updates.addOnPayInAdvanceEntitlements || addOnUsageBasedEntitlements).reduce(
14438
+ (acc, { meteredMonthlyPrice, meteredYearlyPrice, quantity }) => {
14439
+ const priceId = (period === "year" ? meteredYearlyPrice : meteredMonthlyPrice)?.priceId;
14440
+ if (priceId) {
14441
+ acc.push({
14442
+ priceId,
14443
+ quantity
14444
+ });
14445
+ }
14446
+ return acc;
14447
+ },
14448
+ []
14449
+ )
14450
+ ],
14244
14451
  creditBundles: (updates.creditBundles || creditBundles).reduce(
14245
14452
  (acc, { id, count }) => {
14246
14453
  if (count > 0) {
@@ -14297,6 +14504,7 @@ var CheckoutDialog = ({ top = 0 }) => {
14297
14504
  planPeriod,
14298
14505
  selectedPlan,
14299
14506
  payInAdvanceEntitlements,
14507
+ addOnUsageBasedEntitlements,
14300
14508
  addOns,
14301
14509
  creditBundles,
14302
14510
  shouldTrial,
@@ -14370,6 +14578,17 @@ var CheckoutDialog = ({ top = 0 }) => {
14370
14578
  ...addOn,
14371
14579
  ...addOn.id === id && { isSelected: !addOn.isSelected }
14372
14580
  }));
14581
+ const updatedAddOnEntitlements = updated.filter((addOn) => addOn.isSelected).flatMap(
14582
+ (addOn) => addOn.entitlements.filter(
14583
+ (entitlement) => entitlement.priceBehavior === "pay_in_advance" /* PayInAdvance */
14584
+ ).map((entitlement) => ({
14585
+ ...entitlement,
14586
+ allocation: entitlement.valueNumeric || 0,
14587
+ usage: 0,
14588
+ quantity: 1
14589
+ }))
14590
+ );
14591
+ setAddOnUsageBasedEntitlements(updatedAddOnEntitlements);
14373
14592
  handlePreviewCheckout({ addOns: updated });
14374
14593
  return updated;
14375
14594
  });
@@ -14410,6 +14629,23 @@ var CheckoutDialog = ({ top = 0 }) => {
14410
14629
  },
14411
14630
  [handlePreviewCheckout]
14412
14631
  );
14632
+ const updateAddOnEntitlementQuantity = (0, import_react30.useCallback)(
14633
+ (id, updatedQuantity) => {
14634
+ setAddOnUsageBasedEntitlements((prev2) => {
14635
+ const updated = prev2.map(
14636
+ (entitlement) => entitlement.id === id ? {
14637
+ ...entitlement,
14638
+ quantity: updatedQuantity
14639
+ } : entitlement
14640
+ );
14641
+ handlePreviewCheckout({
14642
+ addOnPayInAdvanceEntitlements: updated
14643
+ });
14644
+ return updated;
14645
+ });
14646
+ },
14647
+ [handlePreviewCheckout]
14648
+ );
14413
14649
  const updatePromoCode = (0, import_react30.useCallback)(
14414
14650
  async (code) => {
14415
14651
  handlePreviewCheckout({ promoCode: code });
@@ -14585,6 +14821,16 @@ var CheckoutDialog = ({ top = 0 }) => {
14585
14821
  toggle: (id) => toggleAddOn(id)
14586
14822
  }
14587
14823
  ),
14824
+ checkoutStage === "addonsUsage" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
14825
+ Usage,
14826
+ {
14827
+ isLoading,
14828
+ period: planPeriod,
14829
+ selectedPlan,
14830
+ entitlements: addOnUsageBasedEntitlements,
14831
+ updateQuantity: updateAddOnEntitlementQuantity
14832
+ }
14833
+ ),
14588
14834
  checkoutStage === "credits" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
14589
14835
  Credits,
14590
14836
  {
@@ -18293,7 +18539,7 @@ var PricingTable = (0, import_react51.forwardRef)(
18293
18539
  ({ className, callToActionUrl, callToActionTarget, onCallToAction, ...rest }, ref) => {
18294
18540
  const props = resolveDesignProps8(rest);
18295
18541
  const { t: t2 } = useTranslation();
18296
- const { data, settings, hydratePublic } = useEmbed();
18542
+ const { data, settings, isPending, hydratePublic } = useEmbed();
18297
18543
  const { currentPeriod, isStandalone } = (0, import_react51.useMemo)(() => {
18298
18544
  if (isCheckoutData(data)) {
18299
18545
  const billingSubscription = data.company?.billingSubscription;
@@ -18345,6 +18591,19 @@ var PricingTable = (0, import_react51.forwardRef)(
18345
18591
  (0, import_react51.useEffect)(() => {
18346
18592
  setEntitlementCounts(plans.reduce(entitlementCountsReducer, {}));
18347
18593
  }, [plans]);
18594
+ if (isStandalone && isPending) {
18595
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
18596
+ Flex,
18597
+ {
18598
+ $width: "100%",
18599
+ $height: "100%",
18600
+ $alignItems: "center",
18601
+ $justifyContent: "center",
18602
+ $padding: `${settings.theme.card.padding / TEXT_BASE_SIZE}rem`,
18603
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Loader, { $size: "2xl" })
18604
+ }
18605
+ );
18606
+ }
18348
18607
  const Wrapper = isStandalone ? Container : import_react51.Fragment;
18349
18608
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Wrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
18350
18609
  FussyChild,