@schematichq/schematic-components 1.8.0 → 1.9.1

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.
@@ -2213,6 +2213,25 @@ function getCreditBasedEntitlementLimit(entitlement, credits) {
2213
2213
  };
2214
2214
  }
2215
2215
  }
2216
+ function extractCurrentUsageBasedEntitlements(features = [], planPeriod) {
2217
+ return features.reduce((acc, entitlement) => {
2218
+ if (entitlement.priceBehavior && (planPeriod === "month" && entitlement.monthlyUsageBasedPrice || planPeriod === "year" && entitlement.yearlyUsageBasedPrice)) {
2219
+ const allocation = entitlement.allocation || 0;
2220
+ const usage = entitlement.usage || 0;
2221
+ const quantity = allocation ?? usage;
2222
+ acc.push({
2223
+ ...entitlement,
2224
+ allocation,
2225
+ usage,
2226
+ quantity
2227
+ });
2228
+ }
2229
+ return acc;
2230
+ }, []);
2231
+ }
2232
+ function getEntitlementFeatureName(entitlement, defaultValue) {
2233
+ return entitlement.feature?.pluralName || entitlement.feature?.name || entitlement.featureName || defaultValue || "";
2234
+ }
2216
2235
 
2217
2236
  // src/utils/pluralize.ts
2218
2237
  var pluralRules = [];
@@ -4792,7 +4811,12 @@ var Translator = class _Translator extends EventEmitter {
4792
4811
  };
4793
4812
  if (key == null) return false;
4794
4813
  const resolved = this.resolve(key, opt);
4795
- return resolved?.res !== void 0;
4814
+ if (resolved?.res === void 0) return false;
4815
+ const isObject2 = shouldHandleAsObject(resolved.res);
4816
+ if (opt.returnObjects === false && isObject2) {
4817
+ return false;
4818
+ }
4819
+ return true;
4796
4820
  }
4797
4821
  extractFromKey(key, opt) {
4798
4822
  let nsSeparator = opt.nsSeparator !== void 0 ? opt.nsSeparator : this.options.nsSeparator;
@@ -8112,6 +8136,85 @@ function EntityTraitDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
8112
8136
  };
8113
8137
  }
8114
8138
 
8139
+ // src/api/checkoutexternal/models/TraitDefinition.ts
8140
+ function TraitDefinitionFromJSON(json) {
8141
+ return TraitDefinitionFromJSONTyped(json, false);
8142
+ }
8143
+ function TraitDefinitionFromJSONTyped(json, ignoreDiscriminator) {
8144
+ if (json == null) {
8145
+ return json;
8146
+ }
8147
+ return {
8148
+ comparableType: json["comparable_type"],
8149
+ entityType: json["entity_type"],
8150
+ id: json["id"]
8151
+ };
8152
+ }
8153
+
8154
+ // src/api/checkoutexternal/models/Condition.ts
8155
+ function ConditionFromJSON(json) {
8156
+ return ConditionFromJSONTyped(json, false);
8157
+ }
8158
+ function ConditionFromJSONTyped(json, ignoreDiscriminator) {
8159
+ if (json == null) {
8160
+ return json;
8161
+ }
8162
+ return {
8163
+ accountId: json["account_id"],
8164
+ comparisonTraitDefinition: json["comparison_trait_definition"] == null ? void 0 : TraitDefinitionFromJSON(json["comparison_trait_definition"]),
8165
+ conditionType: json["condition_type"],
8166
+ consumptionRate: json["consumption_rate"] == null ? void 0 : json["consumption_rate"],
8167
+ creditId: json["credit_id"] == null ? void 0 : json["credit_id"],
8168
+ environmentId: json["environment_id"],
8169
+ eventSubtype: json["event_subtype"] == null ? void 0 : json["event_subtype"],
8170
+ id: json["id"],
8171
+ metricPeriod: json["metric_period"] == null ? void 0 : json["metric_period"],
8172
+ metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : json["metric_period_month_reset"],
8173
+ metricValue: json["metric_value"] == null ? void 0 : json["metric_value"],
8174
+ operator: json["operator"],
8175
+ resourceIds: json["resource_ids"],
8176
+ traitDefinition: json["trait_definition"] == null ? void 0 : TraitDefinitionFromJSON(json["trait_definition"]),
8177
+ traitValue: json["trait_value"]
8178
+ };
8179
+ }
8180
+
8181
+ // src/api/checkoutexternal/models/ConditionGroup.ts
8182
+ function ConditionGroupFromJSON(json) {
8183
+ return ConditionGroupFromJSONTyped(json, false);
8184
+ }
8185
+ function ConditionGroupFromJSONTyped(json, ignoreDiscriminator) {
8186
+ if (json == null) {
8187
+ return json;
8188
+ }
8189
+ return {
8190
+ conditions: json["conditions"].map(ConditionFromJSON)
8191
+ };
8192
+ }
8193
+
8194
+ // src/api/checkoutexternal/models/Rule.ts
8195
+ function RuleFromJSON(json) {
8196
+ return RuleFromJSONTyped(json, false);
8197
+ }
8198
+ function RuleFromJSONTyped(json, ignoreDiscriminator) {
8199
+ if (json == null) {
8200
+ return json;
8201
+ }
8202
+ return {
8203
+ accountId: json["account_id"],
8204
+ conditionGroups: json["condition_groups"].map(
8205
+ ConditionGroupFromJSON
8206
+ ),
8207
+ conditions: json["conditions"].map(ConditionFromJSON),
8208
+ environmentId: json["environment_id"],
8209
+ flagId: json["flag_id"] == null ? void 0 : json["flag_id"],
8210
+ id: json["id"],
8211
+ name: json["name"],
8212
+ priority: json["priority"],
8213
+ ruleType: json["rule_type"],
8214
+ value: json["value"]
8215
+ };
8216
+ }
8217
+
8115
8218
  // src/api/checkoutexternal/models/GenericPreviewObject.ts
8116
8219
  function GenericPreviewObjectFromJSON(json) {
8117
8220
  return GenericPreviewObjectFromJSONTyped(json, false);
@@ -8164,6 +8267,7 @@ function CompanyDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
8164
8267
  ),
8165
8268
  plan: json["plan"] == null ? void 0 : CompanyPlanWithBillingSubViewFromJSON(json["plan"]),
8166
8269
  plans: json["plans"].map(GenericPreviewObjectFromJSON),
8270
+ rules: json["rules"].map(RuleFromJSON),
8167
8271
  traits: json["traits"] == null ? void 0 : json["traits"],
8168
8272
  updatedAt: new Date(json["updated_at"]),
8169
8273
  userCount: json["user_count"]
@@ -8578,14 +8682,20 @@ function FeatureUsageResponseDataFromJSONTyped(json, ignoreDiscriminator) {
8578
8682
  creditTotal: json["credit_total"] == null ? void 0 : json["credit_total"],
8579
8683
  creditTypeIcon: json["credit_type_icon"] == null ? void 0 : json["credit_type_icon"],
8580
8684
  creditUsed: json["credit_used"] == null ? void 0 : json["credit_used"],
8685
+ effectiveLimit: json["effective_limit"] == null ? void 0 : json["effective_limit"],
8686
+ effectivePrice: json["effective_price"] == null ? void 0 : json["effective_price"],
8581
8687
  entitlementExpirationDate: json["entitlement_expiration_date"] == null ? void 0 : new Date(json["entitlement_expiration_date"]),
8582
8688
  entitlementId: json["entitlement_id"],
8583
8689
  entitlementSource: json["entitlement_source"] == null ? void 0 : json["entitlement_source"],
8584
8690
  entitlementType: json["entitlement_type"],
8585
8691
  feature: json["feature"] == null ? void 0 : FeatureDetailResponseDataFromJSON(json["feature"]),
8692
+ hasValidAllocation: json["has_valid_allocation"] == null ? void 0 : json["has_valid_allocation"],
8693
+ isUnlimited: json["is_unlimited"] == null ? void 0 : json["is_unlimited"],
8586
8694
  metricResetAt: json["metric_reset_at"] == null ? void 0 : new Date(json["metric_reset_at"]),
8587
8695
  monthReset: json["month_reset"] == null ? void 0 : json["month_reset"],
8588
8696
  monthlyUsageBasedPrice: json["monthly_usage_based_price"] == null ? void 0 : BillingPriceViewFromJSON(json["monthly_usage_based_price"]),
8697
+ overuse: json["overuse"] == null ? void 0 : json["overuse"],
8698
+ percentUsed: json["percent_used"] == null ? void 0 : json["percent_used"],
8589
8699
  period: json["period"] == null ? void 0 : json["period"],
8590
8700
  plan: json["plan"] == null ? void 0 : PlanResponseDataFromJSON(json["plan"]),
8591
8701
  planEntitlement: json["plan_entitlement"] == null ? void 0 : PlanEntitlementResponseDataFromJSON(json["plan_entitlement"]),
@@ -10666,7 +10776,7 @@ var EmbedProvider = ({
10666
10776
  });
10667
10777
  const customHeaders = (0, import_react12.useMemo)(
10668
10778
  () => ({
10669
- "X-Schematic-Components-Version": "1.8.0",
10779
+ "X-Schematic-Components-Version": "1.9.1",
10670
10780
  "X-Schematic-Session-ID": sessionIdRef.current
10671
10781
  }),
10672
10782
  []
@@ -12900,21 +13010,9 @@ var Sidebar = ({
12900
13010
  currentPlan: data.company?.plan,
12901
13011
  currentAddOns: data.company?.addOns || [],
12902
13012
  currentEntitlements: currentEntitlements2,
12903
- currentUsageBasedEntitlements: currentEntitlements2.reduce(
12904
- (acc, entitlement) => {
12905
- if (entitlement.priceBehavior && (planPeriod === "month" && entitlement.monthlyUsageBasedPrice || planPeriod === "year" && entitlement.yearlyUsageBasedPrice)) {
12906
- const allocation = entitlement.allocation || 0;
12907
- const usage = entitlement.usage || 0;
12908
- acc.push({
12909
- ...entitlement,
12910
- allocation,
12911
- usage,
12912
- quantity: allocation ?? usage
12913
- });
12914
- }
12915
- return acc;
12916
- },
12917
- []
13013
+ currentUsageBasedEntitlements: extractCurrentUsageBasedEntitlements(
13014
+ data.featureUsage?.features,
13015
+ planPeriod
12918
13016
  ),
12919
13017
  billingSubscription: data.company?.billingSubscription,
12920
13018
  paymentMethod: data.subscription?.paymentMethod,
@@ -13729,9 +13827,53 @@ var Sidebar = ({
13729
13827
 
13730
13828
  // src/components/shared/checkout-dialog/AddOns.tsx
13731
13829
  var import_jsx_runtime16 = require("react/jsx-runtime");
13830
+ function renderMeteredEntitlementPricing({
13831
+ priceBehavior,
13832
+ softLimit,
13833
+ price,
13834
+ currency,
13835
+ packageSize,
13836
+ feature,
13837
+ featureName,
13838
+ isTiered
13839
+ }) {
13840
+ if (priceBehavior === "overage" /* Overage */ && softLimit) {
13841
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
13842
+ "Additional: ",
13843
+ formatCurrency(price, currency),
13844
+ "/",
13845
+ feature ? getFeatureName(
13846
+ feature,
13847
+ packageSize
13848
+ ) : featureName || "unit"
13849
+ ] });
13850
+ }
13851
+ if (priceBehavior === "pay_as_you_go" /* PayAsYouGo */ || priceBehavior === "pay_in_advance" /* PayInAdvance */) {
13852
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
13853
+ formatCurrency(price, currency),
13854
+ "/",
13855
+ packageSize > 1 && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
13856
+ packageSize,
13857
+ " "
13858
+ ] }),
13859
+ feature ? getFeatureName(
13860
+ feature,
13861
+ packageSize
13862
+ ) : featureName || "unit"
13863
+ ] });
13864
+ }
13865
+ if (isTiered) {
13866
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, { children: "Tier-based pricing" });
13867
+ }
13868
+ return null;
13869
+ }
13870
+ function shouldShowUsageBased(price, displayableEntitlements) {
13871
+ return price < 0.01 && displayableEntitlements.some((ent) => !ent.isUnlimited);
13872
+ }
13732
13873
  var AddOns = ({ addOns, toggle, isLoading, period }) => {
13733
13874
  const { t: t2 } = useTranslation();
13734
13875
  const { settings } = useEmbed();
13876
+ const isLightBackground = useIsLightBackground();
13735
13877
  const periodKey = period === "year" ? "yearlyPrice" : "monthlyPrice";
13736
13878
  const cardPadding = settings.theme.card.padding / TEXT_BASE_SIZE;
13737
13879
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
@@ -13744,29 +13886,40 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
13744
13886
  const { price, currency } = getAddOnPrice(addOn, period) || {};
13745
13887
  const isAddOnValid = isHydratedPlan(addOn) && addOn.valid;
13746
13888
  const isAddOnCurrent = isHydratedPlan(addOn) && addOn.current;
13747
- const overageEntitlement = addOn.entitlements?.find(
13748
- (entitlement) => entitlement.priceBehavior === "overage" /* Overage */
13749
- );
13750
- let overageInfo = null;
13751
- if (overageEntitlement) {
13752
- const priceData = period === "year" ? overageEntitlement.meteredYearlyPrice : overageEntitlement.meteredMonthlyPrice;
13753
- if (priceData?.priceTier && priceData.priceTier.length >= 2) {
13754
- const overageTier = priceData.priceTier[priceData.priceTier.length - 1];
13755
- overageInfo = {
13756
- softLimit: overageEntitlement.softLimit,
13757
- perUnitPrice: overageTier.perUnitPriceDecimal ? Number(overageTier.perUnitPriceDecimal) : overageTier.perUnitPrice || 0,
13758
- currency: priceData.currency || currency,
13759
- featureName: overageEntitlement.feature?.name
13889
+ const displayableEntitlements = addOn.entitlements?.filter(
13890
+ (entitlement) => entitlement.valueType === "unlimited" || entitlement.priceBehavior && [
13891
+ "pay_as_you_go" /* PayAsYouGo */,
13892
+ "pay_in_advance" /* PayInAdvance */,
13893
+ "overage" /* Overage */,
13894
+ "tier" /* Tiered */
13895
+ ].includes(entitlement.priceBehavior)
13896
+ ).map((entitlement) => {
13897
+ if (entitlement.valueType === "unlimited" && !entitlement.priceBehavior) {
13898
+ return {
13899
+ isUnlimited: true,
13900
+ featureName: entitlement.feature?.name,
13901
+ feature: entitlement.feature
13760
13902
  };
13761
13903
  }
13762
- }
13904
+ const priceData = getEntitlementPrice(entitlement, period);
13905
+ return {
13906
+ isUnlimited: false,
13907
+ priceBehavior: entitlement.priceBehavior,
13908
+ softLimit: entitlement.softLimit,
13909
+ price: priceData?.price ?? 0,
13910
+ currency: priceData?.currency || currency,
13911
+ featureName: entitlement.feature?.name,
13912
+ feature: entitlement.feature,
13913
+ packageSize: priceData?.packageSize ?? 1,
13914
+ isTiered: entitlement.priceBehavior === "tier" /* Tiered */
13915
+ };
13916
+ }) || [];
13763
13917
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
13764
13918
  Flex,
13765
13919
  {
13766
13920
  $position: "relative",
13767
13921
  $flexDirection: "column",
13768
- $gap: "2rem",
13769
- $padding: `${cardPadding}rem`,
13922
+ $padding: `${0.75 * cardPadding}rem 0`,
13770
13923
  $backgroundColor: settings.theme.card.background,
13771
13924
  $borderRadius: `${settings.theme.card.borderRadius / TEXT_BASE_SIZE}rem`,
13772
13925
  $outlineWidth: "2px",
@@ -13776,86 +13929,180 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
13776
13929
  $boxShadow: cardBoxShadow
13777
13930
  },
13778
13931
  children: [
13779
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Flex, { $flexDirection: "column", $gap: "0.75rem", children: [
13780
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { display: "heading3", children: addOn.name }) }),
13781
- addOn.description && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { children: addOn.description }) }),
13782
- (addOn[periodKey] || addOn.chargeType === ChargeType.oneTime) && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Flex, { $flexDirection: "column", $gap: "0.25rem", children: [
13783
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Box, { children: [
13784
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { display: "heading2", children: formatCurrency(price ?? 0, currency) }),
13785
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
13786
- Text,
13932
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
13933
+ Flex,
13934
+ {
13935
+ $flexDirection: "column",
13936
+ $gap: "0.75rem",
13937
+ $padding: `0 ${cardPadding}rem ${displayableEntitlements.length > 0 ? 0.75 * cardPadding : 0}rem`,
13938
+ $borderWidth: "0",
13939
+ $borderBottomWidth: displayableEntitlements.length > 0 ? "1px" : "0",
13940
+ $borderStyle: "solid",
13941
+ $borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.175)" : "hsla(0, 0%, 100%, 0.175)",
13942
+ children: [
13943
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { display: "heading3", children: addOn.name }) }),
13944
+ addOn.description && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { children: addOn.description }) }),
13945
+ (addOn[periodKey] || addOn.chargeType === ChargeType.oneTime) && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Box, { children: shouldShowUsageBased(price ?? 0, displayableEntitlements) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { display: "heading2", children: t2("Usage-based") }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
13946
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { display: "heading2", children: formatCurrency(price ?? 0, currency) }),
13947
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
13948
+ Text,
13949
+ {
13950
+ display: "heading2",
13951
+ $size: 16 / 30 * settings.theme.typography.heading2.fontSize,
13952
+ children: addOn.chargeType === ChargeType.oneTime ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
13953
+ " ",
13954
+ t2("one time")
13955
+ ] }) : `/${period}`
13956
+ }
13957
+ )
13958
+ ] }) }),
13959
+ isAddOnCurrent && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
13960
+ Flex,
13787
13961
  {
13788
- display: "heading2",
13789
- $size: 16 / 30 * settings.theme.typography.heading2.fontSize,
13790
- children: addOn.chargeType === ChargeType.oneTime ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
13791
- " ",
13792
- t2("one time")
13793
- ] }) : `/${period}`
13962
+ $position: "absolute",
13963
+ $right: "1rem",
13964
+ $top: "1rem",
13965
+ $backgroundColor: settings.theme.primary,
13966
+ $borderRadius: "9999px",
13967
+ $padding: "0.125rem 0.85rem",
13968
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
13969
+ Text,
13970
+ {
13971
+ $size: 0.75 * settings.theme.typography.text.fontSize,
13972
+ $color: hexToHSL(settings.theme.primary).l > 50 ? "#000000" : "#FFFFFF",
13973
+ children: t2("Active")
13974
+ }
13975
+ )
13794
13976
  }
13795
13977
  )
13796
- ] }),
13797
- overageInfo && overageInfo.softLimit && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { $size: 0.875, style: { opacity: 0.8 }, children: [
13798
- overageInfo.softLimit,
13799
- " ",
13800
- overageInfo.featureName || "units",
13801
- " included, then",
13802
- " ",
13803
- formatCurrency(
13804
- overageInfo.perUnitPrice,
13805
- overageInfo.currency
13806
- ),
13807
- "/",
13808
- overageInfo.featureName?.toLowerCase() || "unit"
13809
- ] }) })
13810
- ] }),
13811
- isAddOnCurrent && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
13812
- Flex,
13813
- {
13814
- $position: "absolute",
13815
- $right: "1rem",
13816
- $top: "1rem",
13817
- $backgroundColor: settings.theme.primary,
13818
- $borderRadius: "9999px",
13819
- $padding: "0.125rem 0.85rem",
13820
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
13821
- Text,
13978
+ ]
13979
+ }
13980
+ ),
13981
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
13982
+ Flex,
13983
+ {
13984
+ $flexDirection: "column",
13985
+ $justifyContent: "end",
13986
+ $flexGrow: 1,
13987
+ $gap: `${cardPadding}rem`,
13988
+ $padding: `${0.75 * cardPadding}rem ${cardPadding}rem 0`,
13989
+ children: [
13990
+ displayableEntitlements.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Flex, { $flexDirection: "column", $gap: "1rem", $flexGrow: 1, children: displayableEntitlements.map((entitlement, idx) => {
13991
+ if (entitlement.isUnlimited) {
13992
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
13993
+ Flex,
13994
+ {
13995
+ $flexWrap: "wrap",
13996
+ $justifyContent: "space-between",
13997
+ $alignItems: "center",
13998
+ $gap: "1rem",
13999
+ children: [
14000
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Flex, { $gap: "1rem", children: [
14001
+ entitlement.feature?.icon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
14002
+ Icon3,
14003
+ {
14004
+ name: entitlement.feature.icon,
14005
+ color: settings.theme.primary,
14006
+ background: isLightBackground ? "hsla(0, 0%, 0%, 0.0625)" : "hsla(0, 0%, 100%, 0.25)",
14007
+ rounded: true
14008
+ }
14009
+ ),
14010
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
14011
+ Flex,
14012
+ {
14013
+ $flexDirection: "column",
14014
+ $justifyContent: "center",
14015
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { children: entitlement.feature?.pluralName || entitlement.feature?.name || entitlement.featureName })
14016
+ }
14017
+ )
14018
+ ] }),
14019
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
14020
+ Text,
14021
+ {
14022
+ style: { opacity: 0.54 },
14023
+ $size: 0.875 * settings.theme.typography.text.fontSize,
14024
+ $color: settings.theme.typography.text.color,
14025
+ children: "Unlimited"
14026
+ }
14027
+ )
14028
+ ]
14029
+ },
14030
+ idx
14031
+ );
14032
+ }
14033
+ const meteredEntitlement = entitlement;
14034
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
14035
+ Flex,
14036
+ {
14037
+ $flexWrap: "wrap",
14038
+ $justifyContent: "space-between",
14039
+ $alignItems: "center",
14040
+ $gap: "1rem",
14041
+ children: [
14042
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Flex, { $gap: "1rem", children: [
14043
+ meteredEntitlement.feature?.icon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
14044
+ Icon3,
14045
+ {
14046
+ name: meteredEntitlement.feature.icon,
14047
+ color: settings.theme.primary,
14048
+ background: isLightBackground ? "hsla(0, 0%, 0%, 0.0625)" : "hsla(0, 0%, 100%, 0.25)",
14049
+ rounded: true
14050
+ }
14051
+ ),
14052
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
14053
+ Flex,
14054
+ {
14055
+ $flexDirection: "column",
14056
+ $justifyContent: "center",
14057
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { children: meteredEntitlement.priceBehavior === "overage" /* Overage */ && meteredEntitlement.softLimit ? `${meteredEntitlement.softLimit} ${getEntitlementFeatureName(meteredEntitlement, "units")}` : getEntitlementFeatureName(meteredEntitlement) })
14058
+ }
14059
+ )
14060
+ ] }),
14061
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
14062
+ Text,
14063
+ {
14064
+ style: { opacity: 0.54 },
14065
+ $size: 0.875 * settings.theme.typography.text.fontSize,
14066
+ $color: settings.theme.typography.text.color,
14067
+ children: renderMeteredEntitlementPricing(meteredEntitlement)
14068
+ }
14069
+ )
14070
+ ]
14071
+ },
14072
+ idx
14073
+ );
14074
+ }) }),
14075
+ !addOn.isSelected ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
14076
+ Button,
13822
14077
  {
13823
- $size: 0.75 * settings.theme.typography.text.fontSize,
13824
- $color: hexToHSL(settings.theme.primary).l > 50 ? "#000000" : "#FFFFFF",
13825
- children: t2("Active")
14078
+ type: "button",
14079
+ disabled: isLoading || !isAddOnValid,
14080
+ onClick: () => toggle(addOn.id),
14081
+ $size: "sm",
14082
+ $color: "primary",
14083
+ $variant: "outline",
14084
+ $fullWidth: true,
14085
+ children: t2("Choose add-on")
14086
+ }
14087
+ ) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
14088
+ Button,
14089
+ {
14090
+ type: "button",
14091
+ disabled: isLoading || !isAddOnValid,
14092
+ onClick: () => toggle(addOn.id),
14093
+ $size: "sm",
14094
+ $color: isAddOnCurrent ? "danger" : "primary",
14095
+ $variant: isAddOnCurrent ? "ghost" : "text",
14096
+ $fullWidth: true,
14097
+ children: isAddOnCurrent ? t2("Remove add-on") : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
14098
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon3, { name: "check-rounded", size: "sm" }),
14099
+ t2("Selected")
14100
+ ] })
13826
14101
  }
13827
14102
  )
13828
- }
13829
- )
13830
- ] }),
13831
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Flex, { $flexDirection: "column", $justifyContent: "end", $flexGrow: "1", children: !addOn.isSelected ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
13832
- Button,
13833
- {
13834
- type: "button",
13835
- disabled: isLoading || !isAddOnValid,
13836
- onClick: () => toggle(addOn.id),
13837
- $size: "sm",
13838
- $color: "primary",
13839
- $variant: "outline",
13840
- $fullWidth: true,
13841
- children: t2("Choose add-on")
13842
- }
13843
- ) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
13844
- Button,
13845
- {
13846
- type: "button",
13847
- disabled: isLoading || !isAddOnValid,
13848
- onClick: () => toggle(addOn.id),
13849
- $size: "sm",
13850
- $color: isAddOnCurrent ? "danger" : "primary",
13851
- $variant: isAddOnCurrent ? "ghost" : "text",
13852
- $fullWidth: true,
13853
- children: isAddOnCurrent ? t2("Remove add-on") : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
13854
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon3, { name: "check-rounded", size: "sm" }),
13855
- t2("Selected")
13856
- ] })
14103
+ ]
13857
14104
  }
13858
- ) })
14105
+ )
13859
14106
  ]
13860
14107
  },
13861
14108
  index
@@ -17749,7 +17996,7 @@ PaymentMethod.displayName = "PaymentMethod";
17749
17996
  var import_react_stripe_js2 = require("@stripe/react-stripe-js");
17750
17997
 
17751
17998
  // node_modules/@stripe/stripe-js/dist/index.mjs
17752
- var RELEASE_TRAIN = "basil";
17999
+ var RELEASE_TRAIN = "clover";
17753
18000
  var runtimeVersionToUrlVersion = function runtimeVersionToUrlVersion2(version) {
17754
18001
  return version === 3 ? "v3" : version;
17755
18002
  };
@@ -17789,7 +18036,7 @@ var registerWrapper = function registerWrapper2(stripe, startTime) {
17789
18036
  }
17790
18037
  stripe._registerWrapper({
17791
18038
  name: "stripe-js",
17792
- version: "7.9.0",
18039
+ version: "8.1.0",
17793
18040
  startTime
17794
18041
  });
17795
18042
  };
@@ -17864,7 +18111,7 @@ var initStripe = function initStripe2(maybeStripe, args, startTime) {
17864
18111
  var version = runtimeVersionToUrlVersion(maybeStripe.version);
17865
18112
  var expectedVersion = RELEASE_TRAIN;
17866
18113
  if (isTestKey && version !== expectedVersion) {
17867
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.9.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
18114
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("8.1.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
17868
18115
  }
17869
18116
  var stripe = maybeStripe.apply(void 0, args);
17870
18117
  registerWrapper(stripe, startTime);
@@ -18800,6 +19047,49 @@ var import_react52 = require("react");
18800
19047
  // src/components/elements/pricing-table/AddOn.tsx
18801
19048
  var import_react50 = require("react");
18802
19049
  var import_jsx_runtime46 = require("react/jsx-runtime");
19050
+ function renderMeteredEntitlementPricing2({
19051
+ priceBehavior,
19052
+ softLimit,
19053
+ price,
19054
+ currency,
19055
+ packageSize,
19056
+ feature,
19057
+ featureName,
19058
+ isTiered
19059
+ }) {
19060
+ if (priceBehavior === "overage" /* Overage */ && softLimit) {
19061
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
19062
+ "Additional: ",
19063
+ formatCurrency(price, currency),
19064
+ "/",
19065
+ feature ? getFeatureName(
19066
+ feature,
19067
+ packageSize
19068
+ ) : featureName || "unit"
19069
+ ] });
19070
+ }
19071
+ if (priceBehavior === "pay_as_you_go" /* PayAsYouGo */ || priceBehavior === "pay_in_advance" /* PayInAdvance */) {
19072
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
19073
+ formatCurrency(price, currency),
19074
+ "/",
19075
+ packageSize > 1 && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
19076
+ packageSize,
19077
+ " "
19078
+ ] }),
19079
+ feature ? getFeatureName(
19080
+ feature,
19081
+ packageSize
19082
+ ) : featureName || "unit"
19083
+ ] });
19084
+ }
19085
+ if (isTiered) {
19086
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_jsx_runtime46.Fragment, { children: "Tier-based pricing" });
19087
+ }
19088
+ return null;
19089
+ }
19090
+ function shouldShowUsageBased2(price, displayableEntitlements) {
19091
+ return price < 0.01 && displayableEntitlements.some((ent) => !ent.isUnlimited);
19092
+ }
18803
19093
  var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
18804
19094
  const { layout } = sharedProps;
18805
19095
  const { t: t2 } = useTranslation();
@@ -18825,13 +19115,40 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
18825
19115
  const isCurrentAddOn = isHydratedPlan(addOn) && addOn.current;
18826
19116
  const isActiveAddOn = isCurrentAddOn && selectedPeriod === currentAddOns.find((currentAddOn) => currentAddOn.id === addOn.id)?.planPeriod;
18827
19117
  const { price: addOnPrice, currency: addOnCurrency } = getAddOnPrice(addOn, selectedPeriod) || {};
19118
+ const displayableEntitlements = addOn.entitlements?.filter(
19119
+ (entitlement) => entitlement.valueType === "unlimited" || entitlement.priceBehavior && [
19120
+ "pay_as_you_go" /* PayAsYouGo */,
19121
+ "pay_in_advance" /* PayInAdvance */,
19122
+ "overage" /* Overage */,
19123
+ "tier" /* Tiered */
19124
+ ].includes(entitlement.priceBehavior)
19125
+ ).map((entitlement) => {
19126
+ if (entitlement.valueType === "unlimited" && !entitlement.priceBehavior) {
19127
+ return {
19128
+ isUnlimited: true,
19129
+ featureName: entitlement.feature?.name,
19130
+ feature: entitlement.feature
19131
+ };
19132
+ }
19133
+ const priceData = getEntitlementPrice(entitlement, selectedPeriod);
19134
+ return {
19135
+ isUnlimited: false,
19136
+ priceBehavior: entitlement.priceBehavior,
19137
+ softLimit: entitlement.softLimit,
19138
+ price: priceData?.price ?? 0,
19139
+ currency: priceData?.currency || addOnCurrency,
19140
+ featureName: entitlement.feature?.name,
19141
+ feature: entitlement.feature,
19142
+ packageSize: priceData?.packageSize ?? 1,
19143
+ isTiered: entitlement.priceBehavior === "tier" /* Tiered */
19144
+ };
19145
+ }) || [];
18828
19146
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
18829
19147
  Flex,
18830
19148
  {
18831
19149
  $position: "relative",
18832
19150
  $flexDirection: "column",
18833
- $gap: "2rem",
18834
- $padding: `${cardPadding}rem`,
19151
+ $padding: `${0.75 * cardPadding}rem 0`,
18835
19152
  $backgroundColor: settings.theme.card.background,
18836
19153
  $borderRadius: `${settings.theme.card.borderRadius / TEXT_BASE_SIZE}rem`,
18837
19154
  $outlineWidth: "2px",
@@ -18841,36 +19158,48 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
18841
19158
  $boxShadow: cardBoxShadow
18842
19159
  },
18843
19160
  children: [
18844
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Flex, { $flexDirection: "column", $gap: "0.75rem", children: [
18845
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { display: layout.plans.name.fontStyle, children: addOn.name }) }),
18846
- layout.addOns.showDescription && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { display: layout.plans.description.fontStyle, children: addOn.description }) }),
18847
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Text, { display: layout.plans.name.fontStyle, children: [
18848
- formatCurrency(addOnPrice ?? 0, addOnCurrency),
18849
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("sub", { children: [
18850
- "/",
18851
- selectedPeriod
18852
- ] })
18853
- ] }) }),
18854
- isActiveAddOn && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
18855
- Flex,
18856
- {
18857
- $position: "absolute",
18858
- $right: "1rem",
18859
- $top: "1rem",
18860
- $backgroundColor: settings.theme.primary,
18861
- $borderRadius: "9999px",
18862
- $padding: "0.125rem 0.85rem",
18863
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
18864
- Text,
19161
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
19162
+ Flex,
19163
+ {
19164
+ $flexDirection: "column",
19165
+ $gap: "0.75rem",
19166
+ $padding: `0 ${cardPadding}rem ${displayableEntitlements.length > 0 ? 0.75 * cardPadding : 0}rem`,
19167
+ $borderWidth: "0",
19168
+ $borderBottomWidth: displayableEntitlements.length > 0 ? "1px" : "0",
19169
+ $borderStyle: "solid",
19170
+ $borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.175)" : "hsla(0, 0%, 100%, 0.175)",
19171
+ children: [
19172
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { display: layout.plans.name.fontStyle, children: addOn.name }) }),
19173
+ layout.addOns.showDescription && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { display: layout.plans.description.fontStyle, children: addOn.description }) }),
19174
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Box, { children: shouldShowUsageBased2(addOnPrice ?? 0, displayableEntitlements) ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { display: layout.plans.name.fontStyle, children: t2("Usage-based") }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Text, { display: layout.plans.name.fontStyle, children: [
19175
+ formatCurrency(addOnPrice ?? 0, addOnCurrency),
19176
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("sub", { children: [
19177
+ "/",
19178
+ selectedPeriod
19179
+ ] })
19180
+ ] }) }),
19181
+ isActiveAddOn && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
19182
+ Flex,
18865
19183
  {
18866
- $size: 0.75 * settings.theme.typography.text.fontSize,
18867
- $color: hexToHSL(settings.theme.primary).l > 50 ? "#000000" : "#FFFFFF",
18868
- children: t2("Active")
19184
+ $position: "absolute",
19185
+ $right: "1rem",
19186
+ $top: "1rem",
19187
+ $backgroundColor: settings.theme.primary,
19188
+ $borderRadius: "9999px",
19189
+ $padding: "0.125rem 0.85rem",
19190
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
19191
+ Text,
19192
+ {
19193
+ $size: 0.75 * settings.theme.typography.text.fontSize,
19194
+ $color: hexToHSL(settings.theme.primary).l > 50 ? "#000000" : "#FFFFFF",
19195
+ children: t2("Active")
19196
+ }
19197
+ )
18869
19198
  }
18870
19199
  )
18871
- }
18872
- )
18873
- ] }),
19200
+ ]
19201
+ }
19202
+ ),
18874
19203
  /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
18875
19204
  Flex,
18876
19205
  {
@@ -18878,25 +19207,20 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
18878
19207
  $justifyContent: "end",
18879
19208
  $gap: `${cardPadding}rem`,
18880
19209
  $flexGrow: 1,
19210
+ $padding: `${0.75 * cardPadding}rem ${cardPadding}rem 0`,
18881
19211
  children: [
18882
- layout.addOns.showEntitlements && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
18883
- Flex,
18884
- {
18885
- $flexDirection: "column",
18886
- $position: "relative",
18887
- $gap: "1rem",
18888
- $flexGrow: 1,
18889
- children: addOn.entitlements.map((entitlement, entitlementIndex) => {
18890
- const metricPeriodName = getMetricPeriodName(entitlement);
18891
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
18892
- Flex,
18893
- {
18894
- $flexWrap: "wrap",
18895
- $justifyContent: "space-between",
18896
- $alignItems: "center",
18897
- $gap: "1rem",
18898
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Flex, { $gap: "1rem", children: [
18899
- layout.addOns.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
19212
+ displayableEntitlements.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Flex, { $flexDirection: "column", $gap: "1rem", $flexGrow: 1, children: displayableEntitlements.map((entitlement, idx) => {
19213
+ if (entitlement.isUnlimited) {
19214
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
19215
+ Flex,
19216
+ {
19217
+ $flexWrap: "wrap",
19218
+ $justifyContent: "space-between",
19219
+ $alignItems: "center",
19220
+ $gap: "1rem",
19221
+ children: [
19222
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Flex, { $gap: "1rem", children: [
19223
+ entitlement.feature?.icon && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
18900
19224
  Icon3,
18901
19225
  {
18902
19226
  name: entitlement.feature.icon,
@@ -18905,41 +19229,57 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
18905
19229
  rounded: true
18906
19230
  }
18907
19231
  ),
18908
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
18909
- entitlement.feature?.name && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Flex, { $alignItems: "center", $flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { children: entitlement.valueType === "numeric" /* Numeric */ || entitlement.valueType === "unlimited" /* Unlimited */ || entitlement.valueType === "trait" /* Trait */ ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
18910
- entitlement.valueType === "unlimited" /* Unlimited */ ? t2("Unlimited", {
18911
- item: getFeatureName(entitlement.feature)
18912
- }) : typeof entitlement.valueNumeric === "number" && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
18913
- formatNumber(entitlement.valueNumeric),
18914
- " ",
18915
- getFeatureName(
18916
- entitlement.feature,
18917
- entitlement.valueNumeric
18918
- )
18919
- ] }),
18920
- metricPeriodName && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
18921
- " ",
18922
- t2("per"),
18923
- " ",
18924
- t2(metricPeriodName)
18925
- ] })
18926
- ] }) : entitlement.feature.name }) }),
18927
- layout.plans.showFeatureDescriptions && entitlement.feature?.description && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
18928
- Text,
18929
- {
18930
- $size: 0.875 * settings.theme.typography.text.fontSize,
18931
- $color: `color-mix(in oklch, ${settings.theme.typography.text.color}, ${settings.theme.card.background})`,
18932
- children: entitlement.feature.description
18933
- }
18934
- )
18935
- ] })
18936
- ] })
18937
- },
18938
- entitlementIndex
18939
- );
18940
- })
19232
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Flex, { $flexDirection: "column", $justifyContent: "center", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { children: entitlement.feature?.pluralName || entitlement.feature?.name || entitlement.featureName }) })
19233
+ ] }),
19234
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
19235
+ Text,
19236
+ {
19237
+ style: { opacity: 0.54 },
19238
+ $size: 0.875 * settings.theme.typography.text.fontSize,
19239
+ $color: settings.theme.typography.text.color,
19240
+ children: "Unlimited"
19241
+ }
19242
+ )
19243
+ ]
19244
+ },
19245
+ idx
19246
+ );
18941
19247
  }
18942
- ),
19248
+ const meteredEntitlement = entitlement;
19249
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
19250
+ Flex,
19251
+ {
19252
+ $flexWrap: "wrap",
19253
+ $justifyContent: "space-between",
19254
+ $alignItems: "center",
19255
+ $gap: "1rem",
19256
+ children: [
19257
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Flex, { $gap: "1rem", children: [
19258
+ meteredEntitlement.feature?.icon && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
19259
+ Icon3,
19260
+ {
19261
+ name: meteredEntitlement.feature.icon,
19262
+ color: settings.theme.primary,
19263
+ background: isLightBackground ? "hsla(0, 0%, 0%, 0.0625)" : "hsla(0, 0%, 100%, 0.25)",
19264
+ rounded: true
19265
+ }
19266
+ ),
19267
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Flex, { $flexDirection: "column", $justifyContent: "center", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text, { children: meteredEntitlement.priceBehavior === "overage" /* Overage */ && meteredEntitlement.softLimit ? `${meteredEntitlement.softLimit} ${getEntitlementFeatureName(meteredEntitlement, "units")}` : getEntitlementFeatureName(meteredEntitlement) }) })
19268
+ ] }),
19269
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
19270
+ Text,
19271
+ {
19272
+ style: { opacity: 0.54 },
19273
+ $size: 0.875 * settings.theme.typography.text.fontSize,
19274
+ $color: settings.theme.typography.text.color,
19275
+ children: renderMeteredEntitlementPricing2(meteredEntitlement)
19276
+ }
19277
+ )
19278
+ ]
19279
+ },
19280
+ idx
19281
+ );
19282
+ }) }),
18943
19283
  showCallToAction && layout.upgrade.isVisible && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
18944
19284
  Button,
18945
19285
  {