@schematichq/schematic-components 2.14.0 → 2.15.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.
@@ -246,7 +246,7 @@ var require_debounce = __commonJS({
246
246
  var FUNC_ERROR_TEXT = "Expected a function";
247
247
  var nativeMax = Math.max;
248
248
  var nativeMin = Math.min;
249
- function debounce4(func, wait, options) {
249
+ function debounce5(func, wait, options) {
250
250
  var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
251
251
  if (typeof func != "function") {
252
252
  throw new TypeError(FUNC_ERROR_TEXT);
@@ -327,7 +327,7 @@ var require_debounce = __commonJS({
327
327
  debounced.flush = flush;
328
328
  return debounced;
329
329
  }
330
- module.exports = debounce4;
330
+ module.exports = debounce5;
331
331
  }
332
332
  });
333
333
 
@@ -1819,6 +1819,10 @@ var LEADING_DEBOUNCE_SETTINGS = {
1819
1819
  leading: true,
1820
1820
  trailing: false
1821
1821
  };
1822
+ var TRAILING_DEBOUNCE_SETTINGS = {
1823
+ leading: false,
1824
+ trailing: true
1825
+ };
1822
1826
  var EVENT_DEBOUNCE_TIMEOUT = 200;
1823
1827
  var FETCH_DEBOUNCE_TIMEOUT = 300;
1824
1828
 
@@ -7997,7 +8001,8 @@ var BillingCreditGrantReason = {
7997
8001
  BillingCreditAutoTopup: "billing_credit_auto_topup",
7998
8002
  Free: "free",
7999
8003
  Plan: "plan",
8000
- Purchased: "purchased"
8004
+ Purchased: "purchased",
8005
+ Rollover: "rollover"
8001
8006
  };
8002
8007
  function BillingCreditGrantReasonFromJSON(json) {
8003
8008
  return BillingCreditGrantReasonFromJSONTyped(json, false);
@@ -8014,6 +8019,14 @@ function BillingCreditGrantZeroedOutReasonFromJSONTyped(json, ignoreDiscriminato
8014
8019
  return json;
8015
8020
  }
8016
8021
 
8022
+ // src/api/checkoutexternal/models/BillingCreditLedgerAuthority.ts
8023
+ function BillingCreditLedgerAuthorityFromJSON(json) {
8024
+ return BillingCreditLedgerAuthorityFromJSONTyped(json, false);
8025
+ }
8026
+ function BillingCreditLedgerAuthorityFromJSONTyped(json, ignoreDiscriminator) {
8027
+ return json;
8028
+ }
8029
+
8017
8030
  // src/api/checkoutexternal/models/BillingPriceResponseData.ts
8018
8031
  function BillingPriceResponseDataFromJSON(json) {
8019
8032
  return BillingPriceResponseDataFromJSONTyped(json, false);
@@ -8158,6 +8171,9 @@ function BillingCreditViewFromJSONTyped(json, ignoreDiscriminator) {
8158
8171
  environmentId: json["environment_id"],
8159
8172
  icon: json["icon"] == null ? void 0 : json["icon"],
8160
8173
  id: json["id"],
8174
+ ledgerAuthority: BillingCreditLedgerAuthorityFromJSON(
8175
+ json["ledger_authority"]
8176
+ ),
8161
8177
  name: json["name"],
8162
8178
  pluralName: json["plural_name"] == null ? void 0 : json["plural_name"],
8163
8179
  price: json["price"] == null ? void 0 : BillingPriceViewFromJSON(json["price"]),
@@ -8266,6 +8282,7 @@ function BillingPlanCreditGrantResponseDataFromJSONTyped(json, ignoreDiscriminat
8266
8282
  resetCadence: json["reset_cadence"] == null ? void 0 : BillingPlanCreditGrantResetCadenceFromJSON(json["reset_cadence"]),
8267
8283
  resetStart: json["reset_start"] == null ? void 0 : BillingPlanCreditGrantResetStartFromJSON(json["reset_start"]),
8268
8284
  resetType: json["reset_type"] == null ? void 0 : BillingPlanCreditGrantResetTypeFromJSON(json["reset_type"]),
8285
+ rolloverPercentage: json["rollover_percentage"],
8269
8286
  updatedAt: new Date(json["updated_at"])
8270
8287
  };
8271
8288
  }
@@ -8522,6 +8539,20 @@ function UpdateCreditBundleRequestBodyToJSONTyped(value, ignoreDiscriminator = f
8522
8539
  };
8523
8540
  }
8524
8541
 
8542
+ // src/api/checkoutexternal/models/CheckoutFieldValue.ts
8543
+ function CheckoutFieldValueToJSON(json) {
8544
+ return CheckoutFieldValueToJSONTyped(json, false);
8545
+ }
8546
+ function CheckoutFieldValueToJSONTyped(value, ignoreDiscriminator = false) {
8547
+ if (value == null) {
8548
+ return value;
8549
+ }
8550
+ return {
8551
+ id: value["id"],
8552
+ value: value["value"]
8553
+ };
8554
+ }
8555
+
8525
8556
  // src/api/checkoutexternal/models/UpdateAddOnRequestBody.ts
8526
8557
  function UpdateAddOnRequestBodyToJSON(json) {
8527
8558
  return UpdateAddOnRequestBodyToJSONTyped(json, false);
@@ -8571,8 +8602,12 @@ function ChangeSubscriptionRequestBodyToJSONTyped(value, ignoreDiscriminator = f
8571
8602
  credit_bundles: value["creditBundles"].map(
8572
8603
  UpdateCreditBundleRequestBodyToJSON
8573
8604
  ),
8605
+ custom_field_values: value["customFieldValues"].map(
8606
+ CheckoutFieldValueToJSON
8607
+ ),
8574
8608
  new_plan_id: value["newPlanId"],
8575
8609
  new_price_id: value["newPriceId"],
8610
+ opt_in_accepted: value["optInAccepted"],
8576
8611
  pay_in_advance: value["payInAdvance"].map(
8577
8612
  UpdatePayInAdvanceRequestBodyToJSON
8578
8613
  ),
@@ -8590,6 +8625,25 @@ function ChargeTypeFromJSONTyped(json, ignoreDiscriminator) {
8590
8625
  return json;
8591
8626
  }
8592
8627
 
8628
+ // src/api/checkoutexternal/models/CheckoutFieldWithValue.ts
8629
+ function CheckoutFieldWithValueFromJSON(json) {
8630
+ return CheckoutFieldWithValueFromJSONTyped(json, false);
8631
+ }
8632
+ function CheckoutFieldWithValueFromJSONTyped(json, ignoreDiscriminator) {
8633
+ if (json == null) {
8634
+ return json;
8635
+ }
8636
+ return {
8637
+ definitionId: json["definition_id"],
8638
+ helperText: json["helper_text"] == null ? void 0 : json["helper_text"],
8639
+ id: json["id"],
8640
+ name: json["name"],
8641
+ required: json["required"],
8642
+ stripeMetadataKey: json["stripe_metadata_key"],
8643
+ value: json["value"] == null ? void 0 : json["value"]
8644
+ };
8645
+ }
8646
+
8593
8647
  // src/api/checkoutexternal/models/ScheduledDowngradeConfigBehavior.ts
8594
8648
  function ScheduledDowngradeConfigBehaviorFromJSON(json) {
8595
8649
  return ScheduledDowngradeConfigBehaviorFromJSONTyped(json, false);
@@ -8802,6 +8856,7 @@ function CompanyPlanCreditGrantViewFromJSONTyped(json, ignoreDiscriminator) {
8802
8856
  resetCadence: json["reset_cadence"] == null ? void 0 : BillingPlanCreditGrantResetCadenceFromJSON(json["reset_cadence"]),
8803
8857
  resetStart: json["reset_start"] == null ? void 0 : BillingPlanCreditGrantResetStartFromJSON(json["reset_start"]),
8804
8858
  resetType: BillingPlanCreditGrantResetTypeFromJSON(json["reset_type"]),
8859
+ rolloverPercentage: json["rollover_percentage"],
8805
8860
  singularName: json["singular_name"] == null ? void 0 : json["singular_name"],
8806
8861
  updatedAt: new Date(json["updated_at"])
8807
8862
  };
@@ -8860,6 +8915,8 @@ function FeatureEntitlementFromJSONTyped(json, ignoreDiscriminator) {
8860
8915
  allocation: json["allocation"] == null ? void 0 : json["allocation"],
8861
8916
  creditId: json["credit_id"] == null ? void 0 : json["credit_id"],
8862
8917
  creditRemaining: json["credit_remaining"] == null ? void 0 : json["credit_remaining"],
8918
+ creditReserved: json["credit_reserved"] == null ? void 0 : json["credit_reserved"],
8919
+ creditSettled: json["credit_settled"] == null ? void 0 : json["credit_settled"],
8863
8920
  creditTotal: json["credit_total"] == null ? void 0 : json["credit_total"],
8864
8921
  creditUsed: json["credit_used"] == null ? void 0 : json["credit_used"],
8865
8922
  eventName: json["event_name"] == null ? void 0 : json["event_name"],
@@ -9664,6 +9721,7 @@ function PlanCreditGrantViewFromJSONTyped(json, ignoreDiscriminator) {
9664
9721
  resetCadence: json["reset_cadence"] == null ? void 0 : BillingPlanCreditGrantResetCadenceFromJSON(json["reset_cadence"]),
9665
9722
  resetStart: json["reset_start"] == null ? void 0 : BillingPlanCreditGrantResetStartFromJSON(json["reset_start"]),
9666
9723
  resetType: BillingPlanCreditGrantResetTypeFromJSON(json["reset_type"]),
9724
+ rolloverPercentage: json["rollover_percentage"],
9667
9725
  singularName: json["singular_name"] == null ? void 0 : json["singular_name"],
9668
9726
  updatedAt: new Date(json["updated_at"])
9669
9727
  };
@@ -10101,7 +10159,10 @@ function CreditCompanyGrantViewFromJSONTyped(json, ignoreDiscriminator) {
10101
10159
  quantityUsed: json["quantity_used"],
10102
10160
  renewalEnabled: json["renewal_enabled"],
10103
10161
  renewalPeriod: json["renewal_period"] == null ? void 0 : BillingPlanCreditGrantResetCadenceFromJSON(json["renewal_period"]),
10162
+ reserved: json["reserved"] == null ? void 0 : json["reserved"],
10163
+ settled: json["settled"] == null ? void 0 : json["settled"],
10104
10164
  singularName: json["singular_name"] == null ? void 0 : json["singular_name"],
10165
+ sourceGrantId: json["source_grant_id"] == null ? void 0 : json["source_grant_id"],
10105
10166
  sourceLabel: json["source_label"],
10106
10167
  transfers: json["transfers"] == null ? void 0 : json["transfers"].map(CreditTransferViewFromJSON),
10107
10168
  updatedAt: new Date(json["updated_at"]),
@@ -10210,6 +10271,9 @@ function ComponentHydrateResponseDataFromJSONTyped(json, ignoreDiscriminator) {
10210
10271
  creditGrants: json["credit_grants"].map(
10211
10272
  CreditCompanyGrantViewFromJSON
10212
10273
  ),
10274
+ customCheckoutFields: json["custom_checkout_fields"].map(
10275
+ CheckoutFieldWithValueFromJSON
10276
+ ),
10213
10277
  defaultPlan: json["default_plan"] == null ? void 0 : PlanDetailResponseDataFromJSON(json["default_plan"]),
10214
10278
  displaySettings: ComponentDisplaySettingsFromJSON(json["display_settings"]),
10215
10279
  featureUsage: json["feature_usage"] == null ? void 0 : FeatureUsageDetailResponseDataFromJSON(json["feature_usage"]),
@@ -10427,6 +10491,9 @@ function PreviewSubscriptionChangeResponseDataFromJSONTyped(json, ignoreDiscrimi
10427
10491
  finance: json["finance"] == null ? void 0 : PreviewSubscriptionFinanceResponseDataFromJSON(json["finance"]),
10428
10492
  isScheduledDowngrade: json["is_scheduled_downgrade"],
10429
10493
  newCharges: json["new_charges"],
10494
+ optInRequired: json["opt_in_required"],
10495
+ optInText: json["opt_in_text"] == null ? void 0 : json["opt_in_text"],
10496
+ optInTitle: json["opt_in_title"] == null ? void 0 : json["opt_in_title"],
10430
10497
  paymentMethodRequired: json["payment_method_required"],
10431
10498
  percentOff: json["percent_off"],
10432
10499
  periodStart: new Date(json["period_start"]),
@@ -10454,6 +10521,46 @@ function PreviewCheckoutResponseFromJSONTyped(json, ignoreDiscriminator) {
10454
10521
  };
10455
10522
  }
10456
10523
 
10524
+ // src/api/checkoutexternal/models/UpdateCheckoutFieldValuesRequestBody.ts
10525
+ function UpdateCheckoutFieldValuesRequestBodyToJSON(json) {
10526
+ return UpdateCheckoutFieldValuesRequestBodyToJSONTyped(json, false);
10527
+ }
10528
+ function UpdateCheckoutFieldValuesRequestBodyToJSONTyped(value, ignoreDiscriminator = false) {
10529
+ if (value == null) {
10530
+ return value;
10531
+ }
10532
+ return {
10533
+ values: value["values"].map(CheckoutFieldValueToJSON)
10534
+ };
10535
+ }
10536
+
10537
+ // src/api/checkoutexternal/models/UpdateCheckoutFieldValuesResponseData.ts
10538
+ function UpdateCheckoutFieldValuesResponseDataFromJSON(json) {
10539
+ return UpdateCheckoutFieldValuesResponseDataFromJSONTyped(json, false);
10540
+ }
10541
+ function UpdateCheckoutFieldValuesResponseDataFromJSONTyped(json, ignoreDiscriminator) {
10542
+ if (json == null) {
10543
+ return json;
10544
+ }
10545
+ return {
10546
+ company: json["company"] == null ? void 0 : CompanyDetailResponseDataFromJSON(json["company"])
10547
+ };
10548
+ }
10549
+
10550
+ // src/api/checkoutexternal/models/UpdateCheckoutFieldValuesResponse.ts
10551
+ function UpdateCheckoutFieldValuesResponseFromJSON(json) {
10552
+ return UpdateCheckoutFieldValuesResponseFromJSONTyped(json, false);
10553
+ }
10554
+ function UpdateCheckoutFieldValuesResponseFromJSONTyped(json, ignoreDiscriminator) {
10555
+ if (json == null) {
10556
+ return json;
10557
+ }
10558
+ return {
10559
+ data: UpdateCheckoutFieldValuesResponseDataFromJSON(json["data"]),
10560
+ params: json["params"]
10561
+ };
10562
+ }
10563
+
10457
10564
  // src/api/checkoutexternal/models/UpdatePaymentMethodRequestBody.ts
10458
10565
  function UpdatePaymentMethodRequestBodyToJSON(json) {
10459
10566
  return UpdatePaymentMethodRequestBodyToJSONTyped(json, false);
@@ -10915,6 +11022,51 @@ var CheckoutexternalApi = class extends BaseAPI {
10915
11022
  );
10916
11023
  return await response.value();
10917
11024
  }
11025
+ /**
11026
+ * Update checkout field values
11027
+ */
11028
+ async updateCheckoutFieldValuesRaw(requestParameters, initOverrides) {
11029
+ if (requestParameters["updateCheckoutFieldValuesRequestBody"] == null) {
11030
+ throw new RequiredError(
11031
+ "updateCheckoutFieldValuesRequestBody",
11032
+ 'Required parameter "updateCheckoutFieldValuesRequestBody" was null or undefined when calling updateCheckoutFieldValues().'
11033
+ );
11034
+ }
11035
+ const queryParameters = {};
11036
+ const headerParameters = {};
11037
+ headerParameters["Content-Type"] = "application/json";
11038
+ if (this.configuration && this.configuration.apiKey) {
11039
+ headerParameters["X-Schematic-Api-Key"] = await this.configuration.apiKey(
11040
+ "X-Schematic-Api-Key"
11041
+ );
11042
+ }
11043
+ const response = await this.request(
11044
+ {
11045
+ path: `/checkout/custom-field-values`,
11046
+ method: "POST",
11047
+ headers: headerParameters,
11048
+ query: queryParameters,
11049
+ body: UpdateCheckoutFieldValuesRequestBodyToJSON(
11050
+ requestParameters["updateCheckoutFieldValuesRequestBody"]
11051
+ )
11052
+ },
11053
+ initOverrides
11054
+ );
11055
+ return new JSONApiResponse(
11056
+ response,
11057
+ (jsonValue) => UpdateCheckoutFieldValuesResponseFromJSON(jsonValue)
11058
+ );
11059
+ }
11060
+ /**
11061
+ * Update checkout field values
11062
+ */
11063
+ async updateCheckoutFieldValues(requestParameters, initOverrides) {
11064
+ const response = await this.updateCheckoutFieldValuesRaw(
11065
+ requestParameters,
11066
+ initOverrides
11067
+ );
11068
+ return await response.value();
11069
+ }
10918
11070
  /**
10919
11071
  * Update payment method
10920
11072
  */
@@ -11242,6 +11394,14 @@ function BillingCreditExpiryUnitFromJSONTyped9(json, ignoreDiscriminator) {
11242
11394
  return json;
11243
11395
  }
11244
11396
 
11397
+ // src/api/componentspublic/models/BillingCreditLedgerAuthority.ts
11398
+ function BillingCreditLedgerAuthorityFromJSON2(json) {
11399
+ return BillingCreditLedgerAuthorityFromJSONTyped3(json, false);
11400
+ }
11401
+ function BillingCreditLedgerAuthorityFromJSONTyped3(json, ignoreDiscriminator) {
11402
+ return json;
11403
+ }
11404
+
11245
11405
  // src/api/componentspublic/models/BillingProductPriceInterval.ts
11246
11406
  function BillingProductPriceIntervalFromJSON2(json) {
11247
11407
  return BillingProductPriceIntervalFromJSONTyped5(json, false);
@@ -11480,6 +11640,9 @@ function BillingCreditViewFromJSONTyped4(json, ignoreDiscriminator) {
11480
11640
  environmentId: json["environment_id"],
11481
11641
  icon: json["icon"] == null ? void 0 : json["icon"],
11482
11642
  id: json["id"],
11643
+ ledgerAuthority: BillingCreditLedgerAuthorityFromJSON2(
11644
+ json["ledger_authority"]
11645
+ ),
11483
11646
  name: json["name"],
11484
11647
  pluralName: json["plural_name"] == null ? void 0 : json["plural_name"],
11485
11648
  price: json["price"] == null ? void 0 : BillingPriceViewFromJSON2(json["price"]),
@@ -12129,6 +12292,7 @@ function PlanCreditGrantViewFromJSONTyped3(json, ignoreDiscriminator) {
12129
12292
  resetCadence: json["reset_cadence"] == null ? void 0 : BillingPlanCreditGrantResetCadenceFromJSON2(json["reset_cadence"]),
12130
12293
  resetStart: json["reset_start"] == null ? void 0 : BillingPlanCreditGrantResetStartFromJSON2(json["reset_start"]),
12131
12294
  resetType: BillingPlanCreditGrantResetTypeFromJSON2(json["reset_type"]),
12295
+ rolloverPercentage: json["rollover_percentage"],
12132
12296
  singularName: json["singular_name"] == null ? void 0 : json["singular_name"],
12133
12297
  updatedAt: new Date(json["updated_at"])
12134
12298
  };
@@ -12380,6 +12544,17 @@ function getPlanPrice(plan, period = "month", options = { useSelectedPeriod: tru
12380
12544
  return { ...billingPrice, price: getPriceValue(billingPrice) };
12381
12545
  }
12382
12546
  }
12547
+ function planOffersCurrencyForPeriod(plan, period = "month", currency) {
12548
+ if (!currency) return true;
12549
+ const price = getPlanPrice(
12550
+ plan,
12551
+ period,
12552
+ { useSelectedPeriod: true },
12553
+ currency
12554
+ );
12555
+ if (!price) return true;
12556
+ return price.currency.toUpperCase() === currency.toUpperCase();
12557
+ }
12383
12558
  function getAddOnPrice(addOn, period = "month", currency) {
12384
12559
  if (currency && addOn.currencyPrices?.length) {
12385
12560
  const currencyPrice = addOn.currencyPrices.find(
@@ -13557,6 +13732,7 @@ function normalize(data) {
13557
13732
  },
13558
13733
  creditBundles: [],
13559
13734
  creditGrants: [],
13735
+ customCheckoutFields: [],
13560
13736
  preventSelfServiceDowngrade: false
13561
13737
  });
13562
13738
  }
@@ -13709,6 +13885,12 @@ var reducer = (state, action) => {
13709
13885
  bypassAddOnSelection,
13710
13886
  bypassCreditsSelection,
13711
13887
  ...config.addOnIds && { addOnIds: config.addOnIds },
13888
+ ...config.currency && {
13889
+ selectedCurrency: config.currency.toUpperCase()
13890
+ },
13891
+ ...config.showCurrencySelector !== void 0 && {
13892
+ showCurrencySelector: config.showCurrencySelector
13893
+ },
13712
13894
  hideSkippedStages: config.hideSkipped ?? false,
13713
13895
  startTrialIfAvailable: isStringFormat || config.startTrialIfAvailable === void 0 ? true : config.startTrialIfAvailable
13714
13896
  }
@@ -13738,7 +13920,7 @@ var reducer = (state, action) => {
13738
13920
  // src/context/EmbedProvider.tsx
13739
13921
  import { jsx, jsxs } from "react/jsx-runtime";
13740
13922
  var getCustomHeaders = (sessionId) => ({
13741
- "X-Schematic-Components-Version": "2.14.0",
13923
+ "X-Schematic-Components-Version": "2.15.0",
13742
13924
  "X-Schematic-Session-ID": sessionId
13743
13925
  });
13744
13926
  var normalizeCurrencyFilter = (filter2) => {
@@ -15839,7 +16021,7 @@ var Root = forwardRef6(
15839
16021
  Root.displayName = "Root";
15840
16022
 
15841
16023
  // src/components/layout/viewport/Viewport.tsx
15842
- var import_debounce3 = __toESM(require_debounce());
16024
+ var import_debounce4 = __toESM(require_debounce());
15843
16025
  import { forwardRef as forwardRef8, useLayoutEffect as useLayoutEffect8, useRef as useRef11, useState as useState14 } from "react";
15844
16026
  import { createPortal as createPortal3 } from "react-dom";
15845
16027
 
@@ -17289,6 +17471,7 @@ var Checkout = ({
17289
17471
  };
17290
17472
 
17291
17473
  // src/components/shared/checkout-dialog/CheckoutDialog.tsx
17474
+ var import_debounce3 = __toESM(require_debounce());
17292
17475
  import {
17293
17476
  useCallback as useCallback7,
17294
17477
  useEffect as useEffect4,
@@ -17469,11 +17652,16 @@ var CheckoutDialog = ({ top }) => {
17469
17652
  const lockedCurrency = useSubscriptionCurrency();
17470
17653
  const hasCurrencyFilter = !!currencyFilter && currencyFilter.length > 0;
17471
17654
  const filterBlocksSubscriptionCurrency = hasCurrencyFilter && !!lockedCurrency && !currencyFilter.includes(lockedCurrency);
17655
+ const prefilledCurrency = checkoutState?.selectedCurrency?.toUpperCase();
17472
17656
  const [selectedCurrency, setSelectedCurrency] = useState8(
17473
- () => (checkoutState?.selectedCurrency && currencies.includes(checkoutState.selectedCurrency) ? checkoutState.selectedCurrency : void 0) ?? currencies[0] ?? DEFAULT_CURRENCY
17657
+ () => prefilledCurrency ?? currencies[0] ?? DEFAULT_CURRENCY
17474
17658
  );
17659
+ if (currencies.length > 0 && !currencies.includes(selectedCurrency)) {
17660
+ setSelectedCurrency(currencies[0]);
17661
+ }
17475
17662
  const effectiveCurrency = lockedCurrency ?? selectedCurrency;
17476
- const showCurrencySelector = currencies.length > 1 && !lockedCurrency;
17663
+ const currencySelectorEnabled = checkoutState?.showCurrencySelector ?? true;
17664
+ const canSelectCurrency = currencies.length > 1 && !lockedCurrency && currencySelectorEnabled;
17477
17665
  const hasCurrency = !!lockedCurrency || currencies.length > 1 || hasCurrencyFilter;
17478
17666
  const hasNoUsableCurrency = !lockedCurrency && currencies.length === 0;
17479
17667
  useEffect4(() => {
@@ -17807,6 +17995,35 @@ var CheckoutDialog = ({ top }) => {
17807
17995
  }
17808
17996
  return id;
17809
17997
  }, [checkoutStage, checkoutStages, checkoutState, isBypassLoading]);
17998
+ const previewRequestIdRef = useRef6(0);
17999
+ const planStageVisible = checkoutStages.some((stage) => stage.id === "plan") && !checkoutState?.bypassPlanSelection;
18000
+ const checkoutStageCurrencies = useMemo12(() => {
18001
+ if (!selectedPlan) return currencies;
18002
+ return currencies.filter(
18003
+ (currency) => planOffersCurrencyForPeriod(selectedPlan, planPeriod, currency)
18004
+ );
18005
+ }, [currencies, selectedPlan, planPeriod]);
18006
+ const showPlanCurrencySelector = canSelectCurrency && planStageVisible;
18007
+ const showCheckoutCurrencySelector = canSelectCurrency && !planStageVisible && checkoutStageCurrencies.length > 1;
18008
+ const currencyPeriodMismatch = hasCurrency && !lockedCurrency && !planStageVisible && !!selectedPlan && !planOffersCurrencyForPeriod(selectedPlan, planPeriod, effectiveCurrency);
18009
+ useEffect4(() => {
18010
+ if (currencyPeriodMismatch) {
18011
+ console.error(
18012
+ `[Schematic] No ${effectiveCurrency} price for the "${planPeriod}" billing period on the selected plan; refusing to fall back to the default currency.`
18013
+ );
18014
+ debug("currency/period mismatch in checkout bypass config", {
18015
+ currency: effectiveCurrency,
18016
+ period: planPeriod,
18017
+ planId: selectedPlan?.id
18018
+ });
18019
+ }
18020
+ }, [
18021
+ currencyPeriodMismatch,
18022
+ effectiveCurrency,
18023
+ planPeriod,
18024
+ selectedPlan?.id,
18025
+ debug
18026
+ ]);
17810
18027
  const handlePreviewCheckout = useCallback7(
17811
18028
  async (updates) => {
17812
18029
  const period = updates.period || planPeriod;
@@ -17830,6 +18047,8 @@ var CheckoutDialog = ({ top }) => {
17830
18047
  setSelectedPlanId(null);
17831
18048
  return;
17832
18049
  }
18050
+ const requestId = ++previewRequestIdRef.current;
18051
+ const isStale = () => requestId !== previewRequestIdRef.current;
17833
18052
  setError(void 0);
17834
18053
  setCharges(void 0);
17835
18054
  setIsLoading(true);
@@ -17873,9 +18092,13 @@ var CheckoutDialog = ({ top }) => {
17873
18092
  autoTopupOverrides: isCreditOnly ? [] : autoTopupRequestBody,
17874
18093
  payInAdvance: isCreditOnly ? [] : [...planPayInAdvanceRequestBody, ...addOnPayInAdvanceRequestBody],
17875
18094
  creditBundles: creditBundlesRequestBody,
18095
+ customFieldValues: [],
17876
18096
  skipTrial,
17877
18097
  ...code && { promoCode: code }
17878
18098
  });
18099
+ if (isStale()) {
18100
+ return;
18101
+ }
17879
18102
  if (response) {
17880
18103
  setCharges(response.data.finance);
17881
18104
  setIsPaymentMethodRequired(response.data.paymentMethodRequired);
@@ -17885,6 +18108,9 @@ var CheckoutDialog = ({ top }) => {
17885
18108
  setPromoCode(code);
17886
18109
  }
17887
18110
  } catch (err2) {
18111
+ if (isStale()) {
18112
+ return;
18113
+ }
17888
18114
  if (err2 instanceof ResponseError) {
17889
18115
  if (err2.response.status === 401) {
17890
18116
  setError(t3("Session expired. Please refresh and try again."));
@@ -17919,9 +18145,11 @@ var CheckoutDialog = ({ top }) => {
17919
18145
  const { message: msg } = isError(err2) ? err2 : ERROR_UNKNOWN;
17920
18146
  setError(msg);
17921
18147
  } finally {
17922
- setIsLoading(false);
17923
- if (isBypassLoading) {
17924
- setIsBypassLoading(false);
18148
+ if (!isStale()) {
18149
+ setIsLoading(false);
18150
+ if (isBypassLoading) {
18151
+ setIsBypassLoading(false);
18152
+ }
17925
18153
  }
17926
18154
  }
17927
18155
  },
@@ -17944,6 +18172,29 @@ var CheckoutDialog = ({ top }) => {
17944
18172
  isBypassLoading
17945
18173
  ]
17946
18174
  );
18175
+ const handlePreviewCheckoutRef = useRef6(handlePreviewCheckout);
18176
+ useEffect4(() => {
18177
+ handlePreviewCheckoutRef.current = handlePreviewCheckout;
18178
+ }, [handlePreviewCheckout]);
18179
+ const debouncedPreviewCheckoutRef = useRef6(null);
18180
+ useEffect4(() => {
18181
+ const debounced = (0, import_debounce3.default)(
18182
+ (updates) => handlePreviewCheckoutRef.current(updates),
18183
+ FETCH_DEBOUNCE_TIMEOUT,
18184
+ TRAILING_DEBOUNCE_SETTINGS
18185
+ );
18186
+ debouncedPreviewCheckoutRef.current = debounced;
18187
+ return () => {
18188
+ debounced.cancel();
18189
+ debouncedPreviewCheckoutRef.current = null;
18190
+ };
18191
+ }, []);
18192
+ const debouncedPreviewCheckout = useCallback7(
18193
+ (updates) => {
18194
+ debouncedPreviewCheckoutRef.current?.(updates);
18195
+ },
18196
+ []
18197
+ );
17947
18198
  const selectPlan = useCallback7(
17948
18199
  (updates) => {
17949
18200
  const plan = updates.plan;
@@ -18107,11 +18358,11 @@ var CheckoutDialog = ({ top }) => {
18107
18358
  companyAutoTopupAmount: updates.companyAutoTopupAmount ?? prevConfig?.companyAutoTopupAmount ?? matchedCreditGrant?.billingCreditAutoTopupAmount ?? 0
18108
18359
  };
18109
18360
  nextMap.set(id, updatedConfig);
18110
- handlePreviewCheckout({ autoTopupConfigs: nextMap });
18361
+ debouncedPreviewCheckout({ autoTopupConfigs: nextMap });
18111
18362
  return nextMap;
18112
18363
  });
18113
18364
  },
18114
- [handlePreviewCheckout, planCreditGrants]
18365
+ [debouncedPreviewCheckout, planCreditGrants]
18115
18366
  );
18116
18367
  const updateUsageBasedEntitlementQuantity = useCallback7(
18117
18368
  (id, updatedQuantity) => {
@@ -18122,7 +18373,7 @@ var CheckoutDialog = ({ top }) => {
18122
18373
  quantity: updatedQuantity
18123
18374
  } : entitlement
18124
18375
  );
18125
- handlePreviewCheckout({
18376
+ debouncedPreviewCheckout({
18126
18377
  payInAdvanceEntitlements: updated.filter(
18127
18378
  ({ priceBehavior }) => priceBehavior === EntitlementPriceBehavior.PayInAdvance
18128
18379
  )
@@ -18130,7 +18381,7 @@ var CheckoutDialog = ({ top }) => {
18130
18381
  return updated;
18131
18382
  });
18132
18383
  },
18133
- [handlePreviewCheckout]
18384
+ [debouncedPreviewCheckout]
18134
18385
  );
18135
18386
  const updateCreditBundleCount = useCallback7(
18136
18387
  (id, updatedCount) => {
@@ -18141,11 +18392,11 @@ var CheckoutDialog = ({ top }) => {
18141
18392
  count: updatedCount
18142
18393
  } : bundle
18143
18394
  );
18144
- handlePreviewCheckout({ creditBundles: updated });
18395
+ debouncedPreviewCheckout({ creditBundles: updated });
18145
18396
  return updated;
18146
18397
  });
18147
18398
  },
18148
- [handlePreviewCheckout]
18399
+ [debouncedPreviewCheckout]
18149
18400
  );
18150
18401
  const updateAddOnEntitlementQuantity = useCallback7(
18151
18402
  (id, updatedQuantity) => {
@@ -18159,13 +18410,13 @@ var CheckoutDialog = ({ top }) => {
18159
18410
  const updatedAddOnPayInAdvanceEntitlements = updated.filter(
18160
18411
  (entitlement) => entitlement.priceBehavior === EntitlementPriceBehavior.PayInAdvance
18161
18412
  );
18162
- handlePreviewCheckout({
18413
+ debouncedPreviewCheckout({
18163
18414
  addOnPayInAdvanceEntitlements: updatedAddOnPayInAdvanceEntitlements
18164
18415
  });
18165
18416
  return updated;
18166
18417
  });
18167
18418
  },
18168
- [handlePreviewCheckout]
18419
+ [debouncedPreviewCheckout]
18169
18420
  );
18170
18421
  const updatePromoCode = useCallback7(
18171
18422
  async (code) => {
@@ -18284,6 +18535,35 @@ var CheckoutDialog = ({ top }) => {
18284
18535
  }
18285
18536
  );
18286
18537
  }
18538
+ if (currencyPeriodMismatch) {
18539
+ return /* @__PURE__ */ jsx24(
18540
+ Dialog2,
18541
+ {
18542
+ ref: setDialog,
18543
+ isModal,
18544
+ size: "lg",
18545
+ top,
18546
+ onClose: handleClose,
18547
+ ...!isModal && { open: layout === "checkout" },
18548
+ children: /* @__PURE__ */ jsx24(DialogContent2, { children: /* @__PURE__ */ jsx24(
18549
+ Flex,
18550
+ {
18551
+ $flexGrow: 1,
18552
+ $alignItems: "center",
18553
+ $justifyContent: "center",
18554
+ $padding: "2rem",
18555
+ children: /* @__PURE__ */ jsx24(
18556
+ CurrencyPeriodMismatchNotice,
18557
+ {
18558
+ currency: effectiveCurrency,
18559
+ period: planPeriod
18560
+ }
18561
+ )
18562
+ }
18563
+ ) })
18564
+ }
18565
+ );
18566
+ }
18287
18567
  return /* @__PURE__ */ jsxs16(
18288
18568
  Dialog2,
18289
18569
  {
@@ -18374,7 +18654,7 @@ var CheckoutDialog = ({ top }) => {
18374
18654
  activeCheckoutStage.description && /* @__PURE__ */ jsx24(Text, { as: "p", children: activeCheckoutStage.description })
18375
18655
  ] }),
18376
18656
  effectiveCheckoutStage === "plan" && /* @__PURE__ */ jsxs16(Flex, { $alignItems: "center", $gap: "0.75rem", children: [
18377
- showCurrencySelector && /* @__PURE__ */ jsx24(
18657
+ showPlanCurrencySelector && /* @__PURE__ */ jsx24(
18378
18658
  CurrencyToggle,
18379
18659
  {
18380
18660
  currencies,
@@ -18392,7 +18672,15 @@ var CheckoutDialog = ({ top }) => {
18392
18672
  onSelect: changePlanPeriod
18393
18673
  }
18394
18674
  )
18395
- ] })
18675
+ ] }),
18676
+ effectiveCheckoutStage === "checkout" && showCheckoutCurrencySelector && /* @__PURE__ */ jsx24(Flex, { $alignItems: "center", $gap: "0.75rem", children: /* @__PURE__ */ jsx24(
18677
+ CurrencyToggle,
18678
+ {
18679
+ currencies: checkoutStageCurrencies,
18680
+ selectedCurrency: effectiveCurrency,
18681
+ onSelect: setSelectedCurrency
18682
+ }
18683
+ ) })
18396
18684
  ]
18397
18685
  }
18398
18686
  ),
@@ -18519,8 +18807,49 @@ var CheckoutDialog = ({ top }) => {
18519
18807
  );
18520
18808
  };
18521
18809
 
18522
- // src/components/shared/currency-toggle/CurrencyToggle.tsx
18810
+ // src/components/shared/currency-period-mismatch-notice/CurrencyPeriodMismatchNotice.tsx
18523
18811
  import { jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
18812
+ var CurrencyPeriodMismatchNotice = ({
18813
+ currency,
18814
+ period
18815
+ }) => {
18816
+ const { settings } = useEmbed();
18817
+ const { t: t3 } = useTranslation();
18818
+ return /* @__PURE__ */ jsxs17(
18819
+ Flex,
18820
+ {
18821
+ "data-testid": "sch-currency-period-mismatch-notice",
18822
+ $flexDirection: "column",
18823
+ $alignItems: "center",
18824
+ $gap: "0.75rem",
18825
+ $padding: "1.5rem 2rem",
18826
+ $maxWidth: "28rem",
18827
+ $borderWidth: "1px",
18828
+ $borderStyle: "solid",
18829
+ $borderColor: settings.theme.danger,
18830
+ $borderRadius: "0.5rem",
18831
+ children: [
18832
+ /* @__PURE__ */ jsx25(Icon3, { name: "info-rounded", color: settings.theme.danger, size: "lg" }),
18833
+ /* @__PURE__ */ jsx25(Text, { $weight: 600, $size: 16, $color: settings.theme.danger, children: t3("This plan is not available in the selected currency and period.") }),
18834
+ /* @__PURE__ */ jsx25(
18835
+ Text,
18836
+ {
18837
+ $size: 13,
18838
+ $color: settings.theme.danger,
18839
+ style: { opacity: 0.85, textAlign: "center" },
18840
+ children: t3("No {{currency}} price for the {{period}} billing period.", {
18841
+ currency: currency.toUpperCase(),
18842
+ period
18843
+ })
18844
+ }
18845
+ )
18846
+ ]
18847
+ }
18848
+ );
18849
+ };
18850
+
18851
+ // src/components/shared/currency-toggle/CurrencyToggle.tsx
18852
+ import { jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
18524
18853
  var CurrencyToggle = ({
18525
18854
  currencies,
18526
18855
  selectedCurrency,
@@ -18529,7 +18858,7 @@ var CurrencyToggle = ({
18529
18858
  }) => {
18530
18859
  const { settings } = useEmbed();
18531
18860
  const isLightBackground = useIsLightBackground();
18532
- return /* @__PURE__ */ jsx25(
18861
+ return /* @__PURE__ */ jsx26(
18533
18862
  Flex,
18534
18863
  {
18535
18864
  "data-testid": "sch-currency-toggle",
@@ -18542,14 +18871,14 @@ var CurrencyToggle = ({
18542
18871
  $borderRadius: "2.5rem",
18543
18872
  $cursor: disabled ? "default" : "pointer",
18544
18873
  $opacity: disabled ? 0.6 : 1,
18545
- children: /* @__PURE__ */ jsxs17(
18874
+ children: /* @__PURE__ */ jsxs18(
18546
18875
  Flex,
18547
18876
  {
18548
18877
  $alignItems: "center",
18549
18878
  $padding: "0.375rem 0.75rem",
18550
18879
  style: { position: "relative" },
18551
18880
  children: [
18552
- /* @__PURE__ */ jsxs17(
18881
+ /* @__PURE__ */ jsxs18(
18553
18882
  Text,
18554
18883
  {
18555
18884
  style: {
@@ -18566,7 +18895,7 @@ var CurrencyToggle = ({
18566
18895
  ]
18567
18896
  }
18568
18897
  ),
18569
- /* @__PURE__ */ jsx25(
18898
+ /* @__PURE__ */ jsx26(
18570
18899
  "select",
18571
18900
  {
18572
18901
  "data-testid": "sch-currency-select",
@@ -18582,7 +18911,7 @@ var CurrencyToggle = ({
18582
18911
  cursor: disabled ? "default" : "pointer",
18583
18912
  fontSize: "inherit"
18584
18913
  },
18585
- children: currencies.map((currency) => /* @__PURE__ */ jsxs17("option", { value: currency, children: [
18914
+ children: currencies.map((currency) => /* @__PURE__ */ jsxs18("option", { value: currency, children: [
18586
18915
  getCurrencyFlag(currency),
18587
18916
  " ",
18588
18917
  getCurrencySymbol(currency),
@@ -18591,7 +18920,7 @@ var CurrencyToggle = ({
18591
18920
  ] }, currency))
18592
18921
  }
18593
18922
  ),
18594
- /* @__PURE__ */ jsx25(
18923
+ /* @__PURE__ */ jsx26(
18595
18924
  "svg",
18596
18925
  {
18597
18926
  width: 12,
@@ -18599,7 +18928,7 @@ var CurrencyToggle = ({
18599
18928
  viewBox: "0 0 12 12",
18600
18929
  fill: "none",
18601
18930
  style: { marginLeft: "0.25rem", flexShrink: 0 },
18602
- children: /* @__PURE__ */ jsx25(
18931
+ children: /* @__PURE__ */ jsx26(
18603
18932
  "path",
18604
18933
  {
18605
18934
  d: "M3 4.5L6 7.5L9 4.5",
@@ -18619,7 +18948,7 @@ var CurrencyToggle = ({
18619
18948
  };
18620
18949
 
18621
18950
  // src/components/shared/hard-limit-tooltip/HardLimitTooltip.tsx
18622
- import { jsx as jsx26 } from "react/jsx-runtime";
18951
+ import { jsx as jsx27 } from "react/jsx-runtime";
18623
18952
  var HardLimitTooltip = ({
18624
18953
  portal,
18625
18954
  feature,
@@ -18632,11 +18961,11 @@ var HardLimitTooltip = ({
18632
18961
  if (!showHardLimit || !feature || typeof limit !== "number") {
18633
18962
  return null;
18634
18963
  }
18635
- return /* @__PURE__ */ jsx26(
18964
+ return /* @__PURE__ */ jsx27(
18636
18965
  Tooltip,
18637
18966
  {
18638
18967
  portal,
18639
- trigger: /* @__PURE__ */ jsx26(
18968
+ trigger: /* @__PURE__ */ jsx27(
18640
18969
  Icon3,
18641
18970
  {
18642
18971
  title: "limit",
@@ -18645,7 +18974,7 @@ var HardLimitTooltip = ({
18645
18974
  style: { lineHeight: 0 }
18646
18975
  }
18647
18976
  ),
18648
- content: /* @__PURE__ */ jsx26(Text, { children: t3("Up to a limit of", {
18977
+ content: /* @__PURE__ */ jsx27(Text, { children: t3("Up to a limit of", {
18649
18978
  amount: limit,
18650
18979
  units: getFeatureName(feature, limit)
18651
18980
  }) })
@@ -18654,13 +18983,13 @@ var HardLimitTooltip = ({
18654
18983
  };
18655
18984
 
18656
18985
  // src/components/shared/invalid-currency-notice/InvalidCurrencyNotice.tsx
18657
- import { jsx as jsx27, jsxs as jsxs18 } from "react/jsx-runtime";
18986
+ import { jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
18658
18987
  var InvalidCurrencyNotice = ({
18659
18988
  invalidEntries = []
18660
18989
  }) => {
18661
18990
  const { settings } = useEmbed();
18662
18991
  const { t: t3 } = useTranslation();
18663
- return /* @__PURE__ */ jsxs18(
18992
+ return /* @__PURE__ */ jsxs19(
18664
18993
  Flex,
18665
18994
  {
18666
18995
  "data-testid": "sch-invalid-currency-notice",
@@ -18674,9 +19003,9 @@ var InvalidCurrencyNotice = ({
18674
19003
  $borderColor: settings.theme.danger,
18675
19004
  $borderRadius: "0.5rem",
18676
19005
  children: [
18677
- /* @__PURE__ */ jsx27(Icon3, { name: "info-rounded", color: settings.theme.danger, size: "lg" }),
18678
- /* @__PURE__ */ jsx27(Text, { $weight: 600, $size: 16, $color: settings.theme.danger, children: t3("No supported currencies are available.") }),
18679
- invalidEntries.length > 0 && /* @__PURE__ */ jsx27(
19006
+ /* @__PURE__ */ jsx28(Icon3, { name: "info-rounded", color: settings.theme.danger, size: "lg" }),
19007
+ /* @__PURE__ */ jsx28(Text, { $weight: 600, $size: 16, $color: settings.theme.danger, children: t3("No supported currencies are available.") }),
19008
+ invalidEntries.length > 0 && /* @__PURE__ */ jsx28(
18680
19009
  Text,
18681
19010
  {
18682
19011
  $size: 13,
@@ -18694,7 +19023,7 @@ var InvalidCurrencyNotice = ({
18694
19023
 
18695
19024
  // src/components/shared/payment-dialog/PaymentDialog.tsx
18696
19025
  import { useCallback as useCallback8, useLayoutEffect as useLayoutEffect5, useRef as useRef7, useState as useState9 } from "react";
18697
- import { jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
19026
+ import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
18698
19027
  var PaymentDialog = ({ top }) => {
18699
19028
  const { t: t3 } = useTranslation();
18700
19029
  const { layout, setLayout, clearCheckoutState } = useEmbed();
@@ -18720,7 +19049,7 @@ var PaymentDialog = ({ top }) => {
18720
19049
  element.show();
18721
19050
  }
18722
19051
  }, [layout]);
18723
- return /* @__PURE__ */ jsxs19(
19052
+ return /* @__PURE__ */ jsxs20(
18724
19053
  Dialog2,
18725
19054
  {
18726
19055
  ref: dialogRef,
@@ -18730,8 +19059,8 @@ var PaymentDialog = ({ top }) => {
18730
19059
  onClose: handleClose,
18731
19060
  ...!isModal && { open: layout === "payment" },
18732
19061
  children: [
18733
- /* @__PURE__ */ jsx28(DialogHeader, { bordered: true, onClose: handleClose, children: /* @__PURE__ */ jsx28(Text, { $size: 18, children: t3("Edit payment method") }) }),
18734
- /* @__PURE__ */ jsx28(DialogContent2, { children: /* @__PURE__ */ jsx28(Flex, { $position: "relative", $flexGrow: 1, $overflow: "auto", children: /* @__PURE__ */ jsx28(PaymentMethodDetails, {}) }) })
19062
+ /* @__PURE__ */ jsx29(DialogHeader, { bordered: true, onClose: handleClose, children: /* @__PURE__ */ jsx29(Text, { $size: 18, children: t3("Edit payment method") }) }),
19063
+ /* @__PURE__ */ jsx29(DialogContent2, { children: /* @__PURE__ */ jsx29(Flex, { $position: "relative", $flexGrow: 1, $overflow: "auto", children: /* @__PURE__ */ jsx29(PaymentMethodDetails, {}) }) })
18735
19064
  ]
18736
19065
  }
18737
19066
  );
@@ -18800,7 +19129,7 @@ var Input2 = gt2.input`
18800
19129
  `;
18801
19130
 
18802
19131
  // src/components/shared/payment-form/PaymentForm.tsx
18803
- import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
19132
+ import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
18804
19133
  var PaymentForm = ({ onConfirm, financeData }) => {
18805
19134
  const { t: t3 } = useTranslation();
18806
19135
  const stripe = useStripe();
@@ -18889,7 +19218,7 @@ var PaymentForm = ({ onConfirm, financeData }) => {
18889
19218
  }
18890
19219
  };
18891
19220
  }, [t3, isPaymentReady]);
18892
- return /* @__PURE__ */ jsxs20(
19221
+ return /* @__PURE__ */ jsxs21(
18893
19222
  Flex,
18894
19223
  {
18895
19224
  as: "form",
@@ -18897,8 +19226,8 @@ var PaymentForm = ({ onConfirm, financeData }) => {
18897
19226
  onSubmit: handleSubmit,
18898
19227
  $flexDirection: "column",
18899
19228
  children: [
18900
- /* @__PURE__ */ jsxs20(Box, { $marginBottom: "1.5rem", children: [
18901
- /* @__PURE__ */ jsx29(
19229
+ /* @__PURE__ */ jsxs21(Box, { $marginBottom: "1.5rem", children: [
19230
+ /* @__PURE__ */ jsx30(
18902
19231
  PaymentElement,
18903
19232
  {
18904
19233
  id: "payment-element",
@@ -18919,7 +19248,7 @@ var PaymentForm = ({ onConfirm, financeData }) => {
18919
19248
  }
18920
19249
  }
18921
19250
  ),
18922
- loadError && /* @__PURE__ */ jsx29(
19251
+ loadError && /* @__PURE__ */ jsx30(
18923
19252
  Flex,
18924
19253
  {
18925
19254
  as: TransitionBox,
@@ -18927,13 +19256,13 @@ var PaymentForm = ({ onConfirm, financeData }) => {
18927
19256
  $justifyContent: "center",
18928
19257
  $alignItems: "center",
18929
19258
  $gap: "1rem",
18930
- children: /* @__PURE__ */ jsx29(Text, { $weight: 500, $color: "#DB6669", children: loadError })
19259
+ children: /* @__PURE__ */ jsx30(Text, { $weight: 500, $color: "#DB6669", children: loadError })
18931
19260
  }
18932
19261
  )
18933
19262
  ] }),
18934
- stripe && collectEmail && /* @__PURE__ */ jsxs20(Box, { "data-field": "name", $marginBottom: "1.5rem", $verticalAlign: "top", children: [
18935
- /* @__PURE__ */ jsx29(Label, { htmlFor: "email", children: "Email" }),
18936
- /* @__PURE__ */ jsx29(
19263
+ stripe && collectEmail && /* @__PURE__ */ jsxs21(Box, { "data-field": "name", $marginBottom: "1.5rem", $verticalAlign: "top", children: [
19264
+ /* @__PURE__ */ jsx30(Label, { htmlFor: "email", children: "Email" }),
19265
+ /* @__PURE__ */ jsx30(
18937
19266
  Input2,
18938
19267
  {
18939
19268
  id: "email",
@@ -18948,7 +19277,7 @@ var PaymentForm = ({ onConfirm, financeData }) => {
18948
19277
  }
18949
19278
  )
18950
19279
  ] }),
18951
- showBillingAddress && /* @__PURE__ */ jsx29(Box, { $marginBottom: "3.5rem", children: /* @__PURE__ */ jsx29(
19280
+ showBillingAddress && /* @__PURE__ */ jsx30(Box, { $marginBottom: "3.5rem", children: /* @__PURE__ */ jsx30(
18952
19281
  AddressElement,
18953
19282
  {
18954
19283
  options: {
@@ -18967,7 +19296,7 @@ var PaymentForm = ({ onConfirm, financeData }) => {
18967
19296
  },
18968
19297
  addressDefaultsKey
18969
19298
  ) }),
18970
- /* @__PURE__ */ jsx29(
19299
+ /* @__PURE__ */ jsx30(
18971
19300
  Button,
18972
19301
  {
18973
19302
  id: "submit",
@@ -18979,7 +19308,7 @@ var PaymentForm = ({ onConfirm, financeData }) => {
18979
19308
  children: isLoading ? t3("Loading") : t3("Save payment method")
18980
19309
  }
18981
19310
  ),
18982
- message && /* @__PURE__ */ jsx29(Box, { $margin: "1rem 0", children: /* @__PURE__ */ jsx29(Text, { id: "payment-message", $size: 15, $weight: 500, $color: "#DB6669", children: message }) })
19311
+ message && /* @__PURE__ */ jsx30(Box, { $margin: "1rem 0", children: /* @__PURE__ */ jsx30(Text, { id: "payment-message", $size: 15, $weight: 500, $color: "#DB6669", children: message }) })
18983
19312
  ]
18984
19313
  }
18985
19314
  );
@@ -18987,7 +19316,7 @@ var PaymentForm = ({ onConfirm, financeData }) => {
18987
19316
 
18988
19317
  // src/components/shared/period-toggle/PeriodToggle.tsx
18989
19318
  import { useMemo as useMemo14 } from "react";
18990
- import { jsx as jsx30 } from "react/jsx-runtime";
19319
+ import { jsx as jsx31 } from "react/jsx-runtime";
18991
19320
  var PERIOD_MONTH_COUNT = {
18992
19321
  year: 12,
18993
19322
  quarter: 3
@@ -19020,7 +19349,7 @@ var PeriodToggle = ({
19020
19349
  }
19021
19350
  return result;
19022
19351
  }, [selectedPlan]);
19023
- return /* @__PURE__ */ jsx30(
19352
+ return /* @__PURE__ */ jsx31(
19024
19353
  Flex,
19025
19354
  {
19026
19355
  "data-testid": "sch-period-toggle",
@@ -19033,7 +19362,7 @@ var PeriodToggle = ({
19033
19362
  $borderRadius: "2.5rem",
19034
19363
  $cursor: "pointer",
19035
19364
  children: options.map((option) => {
19036
- const element = /* @__PURE__ */ jsx30(
19365
+ const element = /* @__PURE__ */ jsx31(
19037
19366
  Button,
19038
19367
  {
19039
19368
  "data-testid": "sch-period-toggle-button",
@@ -19057,7 +19386,7 @@ var PeriodToggle = ({
19057
19386
  backgroundColor: isLightBackground ? "hsla(0, 0%, 0%, 0.125)" : "hsla(0, 0%, 100%, 0.125)"
19058
19387
  }
19059
19388
  },
19060
- children: /* @__PURE__ */ jsx30(
19389
+ children: /* @__PURE__ */ jsx31(
19061
19390
  Text,
19062
19391
  {
19063
19392
  style: {
@@ -19075,12 +19404,12 @@ var PeriodToggle = ({
19075
19404
  const savingsPercentage = savingsByPeriod[option];
19076
19405
  if (typeof savingsPercentage === "number") {
19077
19406
  const isOptionYear = option === "year";
19078
- return /* @__PURE__ */ jsx30(
19407
+ return /* @__PURE__ */ jsx31(
19079
19408
  Tooltip,
19080
19409
  {
19081
19410
  portal,
19082
19411
  trigger: element,
19083
- content: /* @__PURE__ */ jsx30(Text, { $size: 11, $leading: "none", children: selectedOption === option ? t3(
19412
+ content: /* @__PURE__ */ jsx31(Text, { $size: 11, $leading: "none", children: selectedOption === option ? t3(
19084
19413
  isOptionYear ? "Saving with yearly billing" : "Saving with quarterly billing",
19085
19414
  { percent: savingsPercentage }
19086
19415
  ) : t3(
@@ -19104,7 +19433,7 @@ import { useMemo as useMemo16 } from "react";
19104
19433
 
19105
19434
  // src/components/shared/pricing-tiers-tooltip/PriceText.tsx
19106
19435
  import { useMemo as useMemo15 } from "react";
19107
- import { Fragment as Fragment10, jsx as jsx31, jsxs as jsxs21 } from "react/jsx-runtime";
19436
+ import { Fragment as Fragment10, jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
19108
19437
  var PriceText = ({
19109
19438
  feature,
19110
19439
  period,
@@ -19115,38 +19444,38 @@ var PriceText = ({
19115
19444
  const { settings } = useEmbed();
19116
19445
  const text = useMemo15(() => {
19117
19446
  if (!flatAmount && perUnitPrice) {
19118
- return /* @__PURE__ */ jsxs21(Fragment10, { children: [
19447
+ return /* @__PURE__ */ jsxs22(Fragment10, { children: [
19119
19448
  formatCurrency(perUnitPrice, currency),
19120
- /* @__PURE__ */ jsxs21("sub", { children: [
19449
+ /* @__PURE__ */ jsxs22("sub", { children: [
19121
19450
  "/",
19122
19451
  getFeatureName(feature, 1)
19123
19452
  ] })
19124
19453
  ] });
19125
19454
  }
19126
19455
  if (flatAmount && !perUnitPrice) {
19127
- return /* @__PURE__ */ jsxs21(Fragment10, { children: [
19456
+ return /* @__PURE__ */ jsxs22(Fragment10, { children: [
19128
19457
  formatCurrency(flatAmount, currency),
19129
- period && /* @__PURE__ */ jsxs21("sub", { children: [
19458
+ period && /* @__PURE__ */ jsxs22("sub", { children: [
19130
19459
  "/",
19131
19460
  shortenPeriod(period)
19132
19461
  ] })
19133
19462
  ] });
19134
19463
  }
19135
- return /* @__PURE__ */ jsxs21(Fragment10, { children: [
19464
+ return /* @__PURE__ */ jsxs22(Fragment10, { children: [
19136
19465
  formatCurrency(perUnitPrice, currency),
19137
- /* @__PURE__ */ jsxs21("sub", { children: [
19466
+ /* @__PURE__ */ jsxs22("sub", { children: [
19138
19467
  "/",
19139
19468
  getFeatureName(feature, 1)
19140
19469
  ] }),
19141
19470
  " + ",
19142
19471
  formatCurrency(flatAmount, currency),
19143
- period && /* @__PURE__ */ jsxs21("sub", { children: [
19472
+ period && /* @__PURE__ */ jsxs22("sub", { children: [
19144
19473
  "/",
19145
19474
  shortenPeriod(period)
19146
19475
  ] })
19147
19476
  ] });
19148
19477
  }, [feature, period, currency, flatAmount, perUnitPrice]);
19149
- return /* @__PURE__ */ jsx31(
19478
+ return /* @__PURE__ */ jsx32(
19150
19479
  Text,
19151
19480
  {
19152
19481
  $size: 0.875 * settings.theme.typography.text.fontSize,
@@ -19157,7 +19486,7 @@ var PriceText = ({
19157
19486
  };
19158
19487
 
19159
19488
  // src/components/shared/pricing-tiers-tooltip/PricingTiersTooltip.tsx
19160
- import { Fragment as Fragment11, jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
19489
+ import { Fragment as Fragment11, jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
19161
19490
  var PricingTiersTooltip = ({
19162
19491
  portal,
19163
19492
  feature,
@@ -19190,11 +19519,11 @@ var PricingTiersTooltip = ({
19190
19519
  if (!priceTiers.length) {
19191
19520
  return null;
19192
19521
  }
19193
- return /* @__PURE__ */ jsx32(
19522
+ return /* @__PURE__ */ jsx33(
19194
19523
  Tooltip,
19195
19524
  {
19196
19525
  portal,
19197
- trigger: /* @__PURE__ */ jsx32(
19526
+ trigger: /* @__PURE__ */ jsx33(
19198
19527
  Icon3,
19199
19528
  {
19200
19529
  title: "tiered pricing",
@@ -19203,11 +19532,11 @@ var PricingTiersTooltip = ({
19203
19532
  style: { lineHeight: 0 }
19204
19533
  }
19205
19534
  ),
19206
- content: /* @__PURE__ */ jsxs22(Flex, { $flexDirection: "column", $gap: "1rem", children: [
19207
- /* @__PURE__ */ jsx32("dl", { children: tiers.map((tier, index) => {
19535
+ content: /* @__PURE__ */ jsxs23(Flex, { $flexDirection: "column", $gap: "1rem", children: [
19536
+ /* @__PURE__ */ jsx33("dl", { children: tiers.map((tier, index) => {
19208
19537
  const flatAmount = typeof tier.flatAmount === "number" ? tier.flatAmount : void 0;
19209
19538
  const perUnitPrice = typeof tier.perUnitPriceDecimal === "string" ? Number(tier.perUnitPriceDecimal) : typeof tier.perUnitPrice === "number" ? tier.perUnitPrice : void 0;
19210
- return /* @__PURE__ */ jsxs22(
19539
+ return /* @__PURE__ */ jsxs23(
19211
19540
  Flex,
19212
19541
  {
19213
19542
  $justifyContent: "space-between",
@@ -19215,17 +19544,17 @@ var PricingTiersTooltip = ({
19215
19544
  $gap: "1rem",
19216
19545
  $padding: "0.5rem",
19217
19546
  children: [
19218
- /* @__PURE__ */ jsx32("dt", { children: /* @__PURE__ */ jsxs22(
19547
+ /* @__PURE__ */ jsx33("dt", { children: /* @__PURE__ */ jsxs23(
19219
19548
  Text,
19220
19549
  {
19221
19550
  $size: 0.875 * settings.theme.typography.text.fontSize,
19222
19551
  children: [
19223
19552
  tier.from,
19224
- tier.from !== tier.to && /* @__PURE__ */ jsx32(Fragment11, { children: tier.to === Infinity ? "+" : `\u2013${tier.to}` })
19553
+ tier.from !== tier.to && /* @__PURE__ */ jsx33(Fragment11, { children: tier.to === Infinity ? "+" : `\u2013${tier.to}` })
19225
19554
  ]
19226
19555
  }
19227
19556
  ) }),
19228
- /* @__PURE__ */ jsx32("dd", { children: /* @__PURE__ */ jsx32(
19557
+ /* @__PURE__ */ jsx33("dd", { children: /* @__PURE__ */ jsx33(
19229
19558
  PriceText,
19230
19559
  {
19231
19560
  period,
@@ -19240,8 +19569,8 @@ var PricingTiersTooltip = ({
19240
19569
  index
19241
19570
  );
19242
19571
  }) }),
19243
- tiersMode && /* @__PURE__ */ jsxs22(Fragment11, { children: [
19244
- /* @__PURE__ */ jsx32(
19572
+ tiersMode && /* @__PURE__ */ jsxs23(Fragment11, { children: [
19573
+ /* @__PURE__ */ jsx33(
19245
19574
  "hr",
19246
19575
  {
19247
19576
  style: {
@@ -19251,7 +19580,7 @@ var PricingTiersTooltip = ({
19251
19580
  }
19252
19581
  }
19253
19582
  ),
19254
- /* @__PURE__ */ jsx32(Box, { children: /* @__PURE__ */ jsxs22(Text, { $size: 0.875 * settings.theme.typography.text.fontSize, children: [
19583
+ /* @__PURE__ */ jsx33(Box, { children: /* @__PURE__ */ jsxs23(Text, { $size: 0.875 * settings.theme.typography.text.fontSize, children: [
19255
19584
  "\u2139\uFE0F",
19256
19585
  " ",
19257
19586
  tiersMode === BillingTiersMode.Volume ? t3("Price by unit based on final tier reached.") : t3("Tiers apply progressively as quantity increases.")
@@ -19275,7 +19604,7 @@ import {
19275
19604
  import { createPortal as createPortal2 } from "react-dom";
19276
19605
 
19277
19606
  // src/components/shared/subscription-sidebar/CheckoutStageButton.tsx
19278
- import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
19607
+ import { jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
19279
19608
  var NoPaymentRequired = ({
19280
19609
  isDisabled,
19281
19610
  isLoading,
@@ -19285,7 +19614,7 @@ var NoPaymentRequired = ({
19285
19614
  onClick
19286
19615
  }) => {
19287
19616
  const { t: t3 } = useTranslation();
19288
- return /* @__PURE__ */ jsx33(
19617
+ return /* @__PURE__ */ jsx34(
19289
19618
  Button,
19290
19619
  {
19291
19620
  type: "button",
@@ -19347,7 +19676,7 @@ var CheckoutStageButton = ({
19347
19676
  if (checkoutStage === "plan") {
19348
19677
  const nextStage = getNextStageId("plan");
19349
19678
  if (isSelectedPlanTrialable && trialPaymentMethodRequired && shouldTrial) {
19350
- return /* @__PURE__ */ jsx33(
19679
+ return /* @__PURE__ */ jsx34(
19351
19680
  Button,
19352
19681
  {
19353
19682
  type: "button",
@@ -19357,7 +19686,7 @@ var CheckoutStageButton = ({
19357
19686
  },
19358
19687
  $fullWidth: true,
19359
19688
  $isLoading: isLoading,
19360
- children: /* @__PURE__ */ jsxs23(
19689
+ children: /* @__PURE__ */ jsxs24(
19361
19690
  Flex,
19362
19691
  {
19363
19692
  $gap: "0.5rem",
@@ -19368,7 +19697,7 @@ var CheckoutStageButton = ({
19368
19697
  t3("Next"),
19369
19698
  ": ",
19370
19699
  t3("Checkout"),
19371
- /* @__PURE__ */ jsx33(Icon3, { name: "arrow-right" })
19700
+ /* @__PURE__ */ jsx34(Icon3, { name: "arrow-right" })
19372
19701
  ]
19373
19702
  }
19374
19703
  )
@@ -19376,7 +19705,7 @@ var CheckoutStageButton = ({
19376
19705
  );
19377
19706
  }
19378
19707
  if (!isPaymentMethodRequired && !nextStage) {
19379
- return /* @__PURE__ */ jsx33(
19708
+ return /* @__PURE__ */ jsx34(
19380
19709
  NoPaymentRequired,
19381
19710
  {
19382
19711
  isDisabled,
@@ -19387,7 +19716,7 @@ var CheckoutStageButton = ({
19387
19716
  }
19388
19717
  );
19389
19718
  }
19390
- return /* @__PURE__ */ jsx33(
19719
+ return /* @__PURE__ */ jsx34(
19391
19720
  Button,
19392
19721
  {
19393
19722
  type: "button",
@@ -19398,11 +19727,11 @@ var CheckoutStageButton = ({
19398
19727
  $size: isSticky ? "sm" : "md",
19399
19728
  $fullWidth: true,
19400
19729
  $isLoading: isLoading,
19401
- children: /* @__PURE__ */ jsxs23(Flex, { $gap: "0.5rem", $justifyContent: "center", $alignItems: "center", children: [
19730
+ children: /* @__PURE__ */ jsxs24(Flex, { $gap: "0.5rem", $justifyContent: "center", $alignItems: "center", children: [
19402
19731
  t3("Next"),
19403
19732
  ": ",
19404
19733
  getStageDisplayName(nextStage),
19405
- /* @__PURE__ */ jsx33(Icon3, { name: "arrow-right" })
19734
+ /* @__PURE__ */ jsx34(Icon3, { name: "arrow-right" })
19406
19735
  ] })
19407
19736
  }
19408
19737
  );
@@ -19410,7 +19739,7 @@ var CheckoutStageButton = ({
19410
19739
  if (checkoutStage === "autoTopup") {
19411
19740
  const nextStage = getNextStageId("autoTopup");
19412
19741
  if (!isPaymentMethodRequired && !nextStage) {
19413
- return /* @__PURE__ */ jsx33(
19742
+ return /* @__PURE__ */ jsx34(
19414
19743
  NoPaymentRequired,
19415
19744
  {
19416
19745
  isDisabled,
@@ -19421,7 +19750,7 @@ var CheckoutStageButton = ({
19421
19750
  }
19422
19751
  );
19423
19752
  }
19424
- return /* @__PURE__ */ jsx33(
19753
+ return /* @__PURE__ */ jsx34(
19425
19754
  Button,
19426
19755
  {
19427
19756
  type: "button",
@@ -19432,7 +19761,7 @@ var CheckoutStageButton = ({
19432
19761
  $size: isSticky ? "sm" : "md",
19433
19762
  $fullWidth: true,
19434
19763
  $isLoading: isLoading,
19435
- children: /* @__PURE__ */ jsxs23(
19764
+ children: /* @__PURE__ */ jsxs24(
19436
19765
  Flex,
19437
19766
  {
19438
19767
  $gap: "0.5rem",
@@ -19443,7 +19772,7 @@ var CheckoutStageButton = ({
19443
19772
  t3("Next"),
19444
19773
  ": ",
19445
19774
  getStageDisplayName(nextStage),
19446
- /* @__PURE__ */ jsx33(Icon3, { name: "arrow-right" })
19775
+ /* @__PURE__ */ jsx34(Icon3, { name: "arrow-right" })
19447
19776
  ]
19448
19777
  }
19449
19778
  )
@@ -19453,7 +19782,7 @@ var CheckoutStageButton = ({
19453
19782
  if (checkoutStage === "usage") {
19454
19783
  const nextStage = getNextStageId("usage");
19455
19784
  if (!isPaymentMethodRequired && !nextStage) {
19456
- return /* @__PURE__ */ jsx33(
19785
+ return /* @__PURE__ */ jsx34(
19457
19786
  NoPaymentRequired,
19458
19787
  {
19459
19788
  isDisabled,
@@ -19464,7 +19793,7 @@ var CheckoutStageButton = ({
19464
19793
  }
19465
19794
  );
19466
19795
  }
19467
- return /* @__PURE__ */ jsx33(
19796
+ return /* @__PURE__ */ jsx34(
19468
19797
  Button,
19469
19798
  {
19470
19799
  type: "button",
@@ -19475,7 +19804,7 @@ var CheckoutStageButton = ({
19475
19804
  $size: isSticky ? "sm" : "md",
19476
19805
  $fullWidth: true,
19477
19806
  $isLoading: isLoading,
19478
- children: /* @__PURE__ */ jsxs23(
19807
+ children: /* @__PURE__ */ jsxs24(
19479
19808
  Flex,
19480
19809
  {
19481
19810
  $gap: "0.5rem",
@@ -19486,7 +19815,7 @@ var CheckoutStageButton = ({
19486
19815
  t3("Next"),
19487
19816
  ": ",
19488
19817
  getStageDisplayName(nextStage),
19489
- /* @__PURE__ */ jsx33(Icon3, { name: "arrow-right" })
19818
+ /* @__PURE__ */ jsx34(Icon3, { name: "arrow-right" })
19490
19819
  ]
19491
19820
  }
19492
19821
  )
@@ -19496,7 +19825,7 @@ var CheckoutStageButton = ({
19496
19825
  if (checkoutStage === "addons") {
19497
19826
  const nextStage = getNextStageId("addons");
19498
19827
  if (!isPaymentMethodRequired && !nextStage) {
19499
- return /* @__PURE__ */ jsx33(
19828
+ return /* @__PURE__ */ jsx34(
19500
19829
  NoPaymentRequired,
19501
19830
  {
19502
19831
  isDisabled,
@@ -19507,7 +19836,7 @@ var CheckoutStageButton = ({
19507
19836
  }
19508
19837
  );
19509
19838
  }
19510
- return /* @__PURE__ */ jsx33(
19839
+ return /* @__PURE__ */ jsx34(
19511
19840
  Button,
19512
19841
  {
19513
19842
  type: "button",
@@ -19517,7 +19846,7 @@ var CheckoutStageButton = ({
19517
19846
  },
19518
19847
  $fullWidth: true,
19519
19848
  $isLoading: isLoading,
19520
- children: /* @__PURE__ */ jsxs23(
19849
+ children: /* @__PURE__ */ jsxs24(
19521
19850
  Flex,
19522
19851
  {
19523
19852
  $gap: "0.5rem",
@@ -19528,7 +19857,7 @@ var CheckoutStageButton = ({
19528
19857
  t3("Next"),
19529
19858
  ": ",
19530
19859
  getStageDisplayName(nextStage),
19531
- /* @__PURE__ */ jsx33(Icon3, { name: "arrow-right" })
19860
+ /* @__PURE__ */ jsx34(Icon3, { name: "arrow-right" })
19532
19861
  ]
19533
19862
  }
19534
19863
  )
@@ -19538,7 +19867,7 @@ var CheckoutStageButton = ({
19538
19867
  if (checkoutStage === "addonsUsage") {
19539
19868
  const nextStage = getNextStageId("addonsUsage");
19540
19869
  if (!isPaymentMethodRequired && !nextStage) {
19541
- return /* @__PURE__ */ jsx33(
19870
+ return /* @__PURE__ */ jsx34(
19542
19871
  NoPaymentRequired,
19543
19872
  {
19544
19873
  isDisabled,
@@ -19549,7 +19878,7 @@ var CheckoutStageButton = ({
19549
19878
  }
19550
19879
  );
19551
19880
  }
19552
- return /* @__PURE__ */ jsx33(
19881
+ return /* @__PURE__ */ jsx34(
19553
19882
  Button,
19554
19883
  {
19555
19884
  type: "button",
@@ -19560,7 +19889,7 @@ var CheckoutStageButton = ({
19560
19889
  $size: isSticky ? "sm" : "md",
19561
19890
  $fullWidth: true,
19562
19891
  $isLoading: isLoading,
19563
- children: /* @__PURE__ */ jsxs23(
19892
+ children: /* @__PURE__ */ jsxs24(
19564
19893
  Flex,
19565
19894
  {
19566
19895
  $gap: "0.5rem",
@@ -19571,7 +19900,7 @@ var CheckoutStageButton = ({
19571
19900
  t3("Next"),
19572
19901
  ": ",
19573
19902
  getStageDisplayName(nextStage),
19574
- /* @__PURE__ */ jsx33(Icon3, { name: "arrow-right" })
19903
+ /* @__PURE__ */ jsx34(Icon3, { name: "arrow-right" })
19575
19904
  ]
19576
19905
  }
19577
19906
  )
@@ -19581,7 +19910,7 @@ var CheckoutStageButton = ({
19581
19910
  if (checkoutStage === "credits") {
19582
19911
  const nextStage = getNextStageId("credits");
19583
19912
  if (!nextStage) {
19584
- return /* @__PURE__ */ jsx33(
19913
+ return /* @__PURE__ */ jsx34(
19585
19914
  NoPaymentRequired,
19586
19915
  {
19587
19916
  isDisabled,
@@ -19592,7 +19921,7 @@ var CheckoutStageButton = ({
19592
19921
  }
19593
19922
  );
19594
19923
  }
19595
- return /* @__PURE__ */ jsx33(
19924
+ return /* @__PURE__ */ jsx34(
19596
19925
  Button,
19597
19926
  {
19598
19927
  type: "button",
@@ -19602,7 +19931,7 @@ var CheckoutStageButton = ({
19602
19931
  },
19603
19932
  $fullWidth: true,
19604
19933
  $isLoading: isLoading,
19605
- children: /* @__PURE__ */ jsxs23(
19934
+ children: /* @__PURE__ */ jsxs24(
19606
19935
  Flex,
19607
19936
  {
19608
19937
  $gap: "0.5rem",
@@ -19613,7 +19942,7 @@ var CheckoutStageButton = ({
19613
19942
  t3("Next"),
19614
19943
  ": ",
19615
19944
  getStageDisplayName(nextStage),
19616
- /* @__PURE__ */ jsx33(Icon3, { name: "arrow-right" })
19945
+ /* @__PURE__ */ jsx34(Icon3, { name: "arrow-right" })
19617
19946
  ]
19618
19947
  }
19619
19948
  )
@@ -19622,7 +19951,7 @@ var CheckoutStageButton = ({
19622
19951
  }
19623
19952
  if (checkoutStage === "checkout") {
19624
19953
  if (!isPaymentMethodRequired) {
19625
- return /* @__PURE__ */ jsx33(
19954
+ return /* @__PURE__ */ jsx34(
19626
19955
  NoPaymentRequired,
19627
19956
  {
19628
19957
  isDisabled,
@@ -19633,7 +19962,7 @@ var CheckoutStageButton = ({
19633
19962
  }
19634
19963
  );
19635
19964
  }
19636
- return /* @__PURE__ */ jsx33(
19965
+ return /* @__PURE__ */ jsx34(
19637
19966
  Button,
19638
19967
  {
19639
19968
  type: "button",
@@ -19648,7 +19977,7 @@ var CheckoutStageButton = ({
19648
19977
  };
19649
19978
 
19650
19979
  // src/components/shared/subscription-sidebar/EntitlementRow.tsx
19651
- import { Fragment as Fragment12, jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
19980
+ import { Fragment as Fragment12, jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
19652
19981
  var EntitlementRow = (props) => {
19653
19982
  const { t: t3 } = useTranslation();
19654
19983
  const { settings } = useEmbed();
@@ -19668,41 +19997,41 @@ var EntitlementRow = (props) => {
19668
19997
  tiersMode
19669
19998
  } = entitlementPrice || {};
19670
19999
  const tiered = priceBehavior === EntitlementPriceBehavior.PayInAdvance && isTieredPrice(entitlementPrice);
19671
- return /* @__PURE__ */ jsxs24(Fragment12, { children: [
19672
- /* @__PURE__ */ jsx34(Box, { children: /* @__PURE__ */ jsx34(Text, { display: "heading4", children: priceBehavior === EntitlementPriceBehavior.PayInAdvance ? /* @__PURE__ */ jsxs24(Fragment12, { children: [
20000
+ return /* @__PURE__ */ jsxs25(Fragment12, { children: [
20001
+ /* @__PURE__ */ jsx35(Box, { children: /* @__PURE__ */ jsx35(Text, { display: "heading4", children: priceBehavior === EntitlementPriceBehavior.PayInAdvance ? /* @__PURE__ */ jsxs25(Fragment12, { children: [
19673
20002
  quantity,
19674
20003
  " ",
19675
20004
  getFeatureName(feature, quantity)
19676
- ] }) : priceBehavior === EntitlementPriceBehavior.Overage && typeof softLimit === "number" ? /* @__PURE__ */ jsxs24(Fragment12, { children: [
20005
+ ] }) : priceBehavior === EntitlementPriceBehavior.Overage && typeof softLimit === "number" ? /* @__PURE__ */ jsxs25(Fragment12, { children: [
19677
20006
  softLimit,
19678
20007
  " ",
19679
20008
  getFeatureName(feature, softLimit)
19680
20009
  ] }) : feature.name }) }),
19681
- /* @__PURE__ */ jsx34(Box, { $whiteSpace: "nowrap", $lineHeight: 1, children: priceBehavior === EntitlementPriceBehavior.PayInAdvance && !tiered ? /* @__PURE__ */ jsxs24(Text, { children: [
20010
+ /* @__PURE__ */ jsx35(Box, { $whiteSpace: "nowrap", $lineHeight: 1, children: priceBehavior === EntitlementPriceBehavior.PayInAdvance && !tiered ? /* @__PURE__ */ jsxs25(Text, { children: [
19682
20011
  formatCurrency((price ?? 0) * quantity, currency),
19683
- /* @__PURE__ */ jsxs24("sub", { children: [
20012
+ /* @__PURE__ */ jsxs25("sub", { children: [
19684
20013
  "/",
19685
20014
  shortenPeriod(planPeriod)
19686
20015
  ] })
19687
- ] }) : priceBehavior === EntitlementPriceBehavior.PayAsYouGo || priceBehavior === EntitlementPriceBehavior.Overage ? /* @__PURE__ */ jsxs24(Text, { children: [
19688
- priceBehavior === EntitlementPriceBehavior.Overage && /* @__PURE__ */ jsxs24(Fragment12, { children: [
20016
+ ] }) : priceBehavior === EntitlementPriceBehavior.PayAsYouGo || priceBehavior === EntitlementPriceBehavior.Overage ? /* @__PURE__ */ jsxs25(Text, { children: [
20017
+ priceBehavior === EntitlementPriceBehavior.Overage && /* @__PURE__ */ jsxs25(Fragment12, { children: [
19689
20018
  t3("then"),
19690
20019
  " "
19691
20020
  ] }),
19692
20021
  formatCurrency(price ?? 0, currency),
19693
- /* @__PURE__ */ jsxs24("sub", { children: [
20022
+ /* @__PURE__ */ jsxs25("sub", { children: [
19694
20023
  "/",
19695
- packageSize > 1 && /* @__PURE__ */ jsxs24(Fragment12, { children: [
20024
+ packageSize > 1 && /* @__PURE__ */ jsxs25(Fragment12, { children: [
19696
20025
  packageSize,
19697
20026
  " "
19698
20027
  ] }),
19699
20028
  getFeatureName(feature, packageSize),
19700
- feature.featureType === FeatureType.Trait && /* @__PURE__ */ jsxs24(Fragment12, { children: [
20029
+ feature.featureType === FeatureType.Trait && /* @__PURE__ */ jsxs25(Fragment12, { children: [
19701
20030
  "/",
19702
20031
  shortenPeriod(planPeriod)
19703
20032
  ] })
19704
20033
  ] })
19705
- ] }) : (priceBehavior === EntitlementPriceBehavior.Tier || tiered) && /* @__PURE__ */ jsxs24(
20034
+ ] }) : (priceBehavior === EntitlementPriceBehavior.Tier || tiered) && /* @__PURE__ */ jsxs25(
19706
20035
  Text,
19707
20036
  {
19708
20037
  style: { opacity: 0.54 },
@@ -19710,7 +20039,7 @@ var EntitlementRow = (props) => {
19710
20039
  $color: settings.theme.typography.text.color,
19711
20040
  children: [
19712
20041
  t3("Tier-based"),
19713
- /* @__PURE__ */ jsx34(
20042
+ /* @__PURE__ */ jsx35(
19714
20043
  PricingTiersTooltip,
19715
20044
  {
19716
20045
  portal,
@@ -19731,7 +20060,7 @@ var EntitlementRow = (props) => {
19731
20060
 
19732
20061
  // src/components/shared/subscription-sidebar/Proration.tsx
19733
20062
  import { useState as useState11 } from "react";
19734
- import { Fragment as Fragment13, jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
20063
+ import { Fragment as Fragment13, jsx as jsx36, jsxs as jsxs26 } from "react/jsx-runtime";
19735
20064
  var Proration = ({ currency, charges }) => {
19736
20065
  const { t: t3 } = useTranslation();
19737
20066
  const { settings } = useEmbed();
@@ -19741,21 +20070,21 @@ var Proration = ({ currency, charges }) => {
19741
20070
  e2.stopPropagation();
19742
20071
  setOpen((open2) => !open2);
19743
20072
  };
19744
- return /* @__PURE__ */ jsxs25(Fragment13, { children: [
19745
- /* @__PURE__ */ jsx35(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx35(Text, { $size: 14, children: t3("Proration") }) }),
19746
- /* @__PURE__ */ jsxs25(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
20073
+ return /* @__PURE__ */ jsxs26(Fragment13, { children: [
20074
+ /* @__PURE__ */ jsx36(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx36(Text, { $size: 14, children: t3("Proration") }) }),
20075
+ /* @__PURE__ */ jsxs26(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
19747
20076
  open && charges?.upcomingInvoiceLineItems.map(
19748
20077
  ({ amount, description }, index) => {
19749
- return /* @__PURE__ */ jsxs25(Flex, { $gap: "1rem", children: [
19750
- /* @__PURE__ */ jsx35(Text, { children: description }),
19751
- /* @__PURE__ */ jsx35(Text, { children: formatCurrency(amount, currency) })
20078
+ return /* @__PURE__ */ jsxs26(Flex, { $gap: "1rem", children: [
20079
+ /* @__PURE__ */ jsx36(Text, { children: description }),
20080
+ /* @__PURE__ */ jsx36(Text, { children: formatCurrency(amount, currency) })
19752
20081
  ] }, index);
19753
20082
  }
19754
20083
  ),
19755
- /* @__PURE__ */ jsxs25(Flex, { $justifyContent: "space-between", $alignItems: "center", $gap: "1rem", children: [
19756
- /* @__PURE__ */ jsxs25(Flex, { children: [
19757
- /* @__PURE__ */ jsx35(Text, { display: "heading4", children: t3("Total") }),
19758
- /* @__PURE__ */ jsxs25(
20084
+ /* @__PURE__ */ jsxs26(Flex, { $justifyContent: "space-between", $alignItems: "center", $gap: "1rem", children: [
20085
+ /* @__PURE__ */ jsxs26(Flex, { children: [
20086
+ /* @__PURE__ */ jsx36(Text, { display: "heading4", children: t3("Total") }),
20087
+ /* @__PURE__ */ jsxs26(
19759
20088
  Button,
19760
20089
  {
19761
20090
  type: "button",
@@ -19763,26 +20092,26 @@ var Proration = ({ currency, charges }) => {
19763
20092
  style: { height: "auto", padding: 0 },
19764
20093
  $variant: "text",
19765
20094
  children: [
19766
- /* @__PURE__ */ jsx35(
20095
+ /* @__PURE__ */ jsx36(
19767
20096
  Icon3,
19768
20097
  {
19769
20098
  name: open ? "chevron-up" : "chevron-down",
19770
20099
  color: settings.theme.typography.text.color
19771
20100
  }
19772
20101
  ),
19773
- /* @__PURE__ */ jsx35(Text, { children: open ? t3("Hide details") : t3("Show details") })
20102
+ /* @__PURE__ */ jsx36(Text, { children: open ? t3("Hide details") : t3("Show details") })
19774
20103
  ]
19775
20104
  }
19776
20105
  )
19777
20106
  ] }),
19778
- /* @__PURE__ */ jsx35(Flex, { children: /* @__PURE__ */ jsx35(Text, { children: formatCurrency(charges.proration, currency) }) })
20107
+ /* @__PURE__ */ jsx36(Flex, { children: /* @__PURE__ */ jsx36(Text, { children: formatCurrency(charges.proration, currency) }) })
19779
20108
  ] })
19780
20109
  ] })
19781
20110
  ] });
19782
20111
  };
19783
20112
 
19784
20113
  // src/components/shared/subscription-sidebar/SubscriptionSidebar.tsx
19785
- import { jsx as jsx36, jsxs as jsxs26 } from "react/jsx-runtime";
20114
+ import { jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
19786
20115
  var SubscriptionSidebar = forwardRef7(
19787
20116
  ({
19788
20117
  portal,
@@ -20085,6 +20414,7 @@ var SubscriptionSidebar = forwardRef7(
20085
20414
  autoTopupOverrides: isCreditOnlyPurchase ? [] : autoTopupRequestBody,
20086
20415
  payInAdvance: isCreditOnlyPurchase ? [] : [...planPayInAdvanceRequestBody, ...addOnPayInAdvanceRequestBody],
20087
20416
  creditBundles: creditBundlesRequestBody,
20417
+ customFieldValues: [],
20088
20418
  skipTrial: !shouldTrial,
20089
20419
  ...paymentMethodId && { paymentMethodId },
20090
20420
  ...promoCode && { promoCode }
@@ -20187,7 +20517,7 @@ var SubscriptionSidebar = forwardRef7(
20187
20517
  const isSticky = !isButtonInView;
20188
20518
  switch (layout) {
20189
20519
  case "checkout":
20190
- return /* @__PURE__ */ jsx36(
20520
+ return /* @__PURE__ */ jsx37(
20191
20521
  CheckoutStageButton,
20192
20522
  {
20193
20523
  canCheckout,
@@ -20210,7 +20540,7 @@ var SubscriptionSidebar = forwardRef7(
20210
20540
  }
20211
20541
  );
20212
20542
  case "unsubscribe":
20213
- return /* @__PURE__ */ jsx36(
20543
+ return /* @__PURE__ */ jsx37(
20214
20544
  Button,
20215
20545
  {
20216
20546
  type: "button",
@@ -20276,7 +20606,7 @@ var SubscriptionSidebar = forwardRef7(
20276
20606
  if (isSelectedPlanTrialable && selectedPlan.trialDays) {
20277
20607
  trialEndsOn.setDate(trialEndsOn.getDate() + selectedPlan.trialDays);
20278
20608
  }
20279
- return /* @__PURE__ */ jsxs26(
20609
+ return /* @__PURE__ */ jsxs27(
20280
20610
  Flex,
20281
20611
  {
20282
20612
  ref,
@@ -20293,7 +20623,7 @@ var SubscriptionSidebar = forwardRef7(
20293
20623
  },
20294
20624
  ...rest,
20295
20625
  children: [
20296
- showHeader && /* @__PURE__ */ jsx36(
20626
+ showHeader && /* @__PURE__ */ jsx37(
20297
20627
  Flex,
20298
20628
  {
20299
20629
  $position: "relative",
@@ -20305,10 +20635,10 @@ var SubscriptionSidebar = forwardRef7(
20305
20635
  $borderBottomWidth: "1px",
20306
20636
  $borderStyle: "solid",
20307
20637
  $borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.1)" : "hsla(0, 0%, 100%, 0.2)",
20308
- children: /* @__PURE__ */ jsx36(Flex, { $justifyContent: "space-between", children: /* @__PURE__ */ jsx36(Text, { as: "h3", display: "heading3", children: t3("Subscription") }) })
20638
+ children: /* @__PURE__ */ jsx37(Flex, { $justifyContent: "space-between", children: /* @__PURE__ */ jsx37(Text, { as: "h3", display: "heading3", children: t3("Subscription") }) })
20309
20639
  }
20310
20640
  ),
20311
- /* @__PURE__ */ jsxs26(
20641
+ /* @__PURE__ */ jsxs27(
20312
20642
  Flex,
20313
20643
  {
20314
20644
  $position: "relative",
@@ -20322,9 +20652,9 @@ var SubscriptionSidebar = forwardRef7(
20322
20652
  $borderStyle: "solid",
20323
20653
  $borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.1)" : "hsla(0, 0%, 100%, 0.2)",
20324
20654
  children: [
20325
- /* @__PURE__ */ jsx36(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx36(Text, { $size: 14, children: t3("Plan") }) }),
20326
- /* @__PURE__ */ jsxs26(Flex, { $flexDirection: "column", $gap: "0.5rem", $marginBottom: "1.5rem", children: [
20327
- currentPlan && /* @__PURE__ */ jsxs26(
20655
+ /* @__PURE__ */ jsx37(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx37(Text, { $size: 14, children: t3("Plan") }) }),
20656
+ /* @__PURE__ */ jsxs27(Flex, { $flexDirection: "column", $gap: "0.5rem", $marginBottom: "1.5rem", children: [
20657
+ currentPlan && /* @__PURE__ */ jsxs27(
20328
20658
  Flex,
20329
20659
  {
20330
20660
  $justifyContent: "space-between",
@@ -20336,13 +20666,13 @@ var SubscriptionSidebar = forwardRef7(
20336
20666
  $color: settings.theme.typography.heading4.color
20337
20667
  },
20338
20668
  children: [
20339
- /* @__PURE__ */ jsx36(Box, { children: /* @__PURE__ */ jsx36(Text, { display: "heading4", children: currentPlan.name }) }),
20340
- typeof currentPlan.planPrice === "number" && /* @__PURE__ */ jsx36(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs26(Text, { children: [
20669
+ /* @__PURE__ */ jsx37(Box, { children: /* @__PURE__ */ jsx37(Text, { display: "heading4", children: currentPlan.name }) }),
20670
+ typeof currentPlan.planPrice === "number" && /* @__PURE__ */ jsx37(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs27(Text, { children: [
20341
20671
  formatCurrency(
20342
20672
  currentPlan.planPrice,
20343
20673
  billingSubscription?.currency
20344
20674
  ),
20345
- /* @__PURE__ */ jsxs26("sub", { children: [
20675
+ /* @__PURE__ */ jsxs27("sub", { children: [
20346
20676
  "/",
20347
20677
  shortenPeriod(
20348
20678
  getSubscriptionPeriod(billingSubscription) || currentPlan.planPeriod || planPeriod
@@ -20352,8 +20682,8 @@ var SubscriptionSidebar = forwardRef7(
20352
20682
  ]
20353
20683
  }
20354
20684
  ),
20355
- selectedPlan && !selectedPlan.current && /* @__PURE__ */ jsxs26(Box, { children: [
20356
- /* @__PURE__ */ jsx36(
20685
+ selectedPlan && !selectedPlan.current && /* @__PURE__ */ jsxs27(Box, { children: [
20686
+ /* @__PURE__ */ jsx37(
20357
20687
  Box,
20358
20688
  {
20359
20689
  $width: "100%",
@@ -20361,7 +20691,7 @@ var SubscriptionSidebar = forwardRef7(
20361
20691
  $opacity: "50%",
20362
20692
  $marginBottom: "0.25rem",
20363
20693
  $marginTop: "-0.25rem",
20364
- children: /* @__PURE__ */ jsx36(
20694
+ children: /* @__PURE__ */ jsx37(
20365
20695
  Icon3,
20366
20696
  {
20367
20697
  name: "arrow-down",
@@ -20373,20 +20703,20 @@ var SubscriptionSidebar = forwardRef7(
20373
20703
  )
20374
20704
  }
20375
20705
  ),
20376
- /* @__PURE__ */ jsxs26(
20706
+ /* @__PURE__ */ jsxs27(
20377
20707
  Flex,
20378
20708
  {
20379
20709
  $justifyContent: "space-between",
20380
20710
  $alignItems: "center",
20381
20711
  $gap: "1rem",
20382
20712
  children: [
20383
- /* @__PURE__ */ jsx36(Flex, { children: /* @__PURE__ */ jsx36(Text, { display: "heading4", children: selectedPlan.name }) }),
20384
- /* @__PURE__ */ jsx36(Flex, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs26(Text, { children: [
20713
+ /* @__PURE__ */ jsx37(Flex, { children: /* @__PURE__ */ jsx37(Text, { display: "heading4", children: selectedPlan.name }) }),
20714
+ /* @__PURE__ */ jsx37(Flex, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs27(Text, { children: [
20385
20715
  formatCurrency(
20386
20716
  selectedPlanPrice ?? 0,
20387
20717
  selectedPlanCurrency
20388
20718
  ),
20389
- /* @__PURE__ */ jsxs26("sub", { children: [
20719
+ /* @__PURE__ */ jsxs27("sub", { children: [
20390
20720
  "/",
20391
20721
  shortenPeriod(planPeriod)
20392
20722
  ] })
@@ -20396,13 +20726,13 @@ var SubscriptionSidebar = forwardRef7(
20396
20726
  )
20397
20727
  ] })
20398
20728
  ] }),
20399
- updatedUsageBasedEntitlements.willChange && /* @__PURE__ */ jsxs26(Flex, { $flexDirection: "column", $gap: "0.5rem", $marginBottom: "1.5rem", children: [
20400
- /* @__PURE__ */ jsx36(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx36(Text, { $size: 14, children: t3("Usage-based") }) }),
20729
+ updatedUsageBasedEntitlements.willChange && /* @__PURE__ */ jsxs27(Flex, { $flexDirection: "column", $gap: "0.5rem", $marginBottom: "1.5rem", children: [
20730
+ /* @__PURE__ */ jsx37(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx37(Text, { $size: 14, children: t3("Usage-based") }) }),
20401
20731
  updatedUsageBasedEntitlements.removed.reduce(
20402
20732
  (acc, entitlement, index) => {
20403
20733
  if (entitlement.feature?.name) {
20404
20734
  acc.push(
20405
- /* @__PURE__ */ jsx36(
20735
+ /* @__PURE__ */ jsx37(
20406
20736
  Flex,
20407
20737
  {
20408
20738
  $justifyContent: "space-between",
@@ -20411,7 +20741,7 @@ var SubscriptionSidebar = forwardRef7(
20411
20741
  $opacity: "0.625",
20412
20742
  $textDecoration: "line-through",
20413
20743
  $color: settings.theme.typography.heading4.color,
20414
- children: /* @__PURE__ */ jsx36(
20744
+ children: /* @__PURE__ */ jsx37(
20415
20745
  EntitlementRow,
20416
20746
  {
20417
20747
  portal: resolvedPortal,
@@ -20433,8 +20763,8 @@ var SubscriptionSidebar = forwardRef7(
20433
20763
  (acc, { previous, next: next2 }, index) => {
20434
20764
  if (next2.feature?.name) {
20435
20765
  acc.push(
20436
- /* @__PURE__ */ jsxs26(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
20437
- /* @__PURE__ */ jsx36(
20766
+ /* @__PURE__ */ jsxs27(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
20767
+ /* @__PURE__ */ jsx37(
20438
20768
  Flex,
20439
20769
  {
20440
20770
  $justifyContent: "space-between",
@@ -20443,7 +20773,7 @@ var SubscriptionSidebar = forwardRef7(
20443
20773
  $opacity: "0.625",
20444
20774
  $textDecoration: "line-through",
20445
20775
  $color: settings.theme.typography.heading4.color,
20446
- children: /* @__PURE__ */ jsx36(
20776
+ children: /* @__PURE__ */ jsx37(
20447
20777
  EntitlementRow,
20448
20778
  {
20449
20779
  portal: resolvedPortal,
@@ -20454,13 +20784,13 @@ var SubscriptionSidebar = forwardRef7(
20454
20784
  )
20455
20785
  }
20456
20786
  ),
20457
- /* @__PURE__ */ jsx36(
20787
+ /* @__PURE__ */ jsx37(
20458
20788
  Flex,
20459
20789
  {
20460
20790
  $justifyContent: "space-between",
20461
20791
  $alignItems: "baseline",
20462
20792
  $gap: "1rem",
20463
- children: /* @__PURE__ */ jsx36(
20793
+ children: /* @__PURE__ */ jsx37(
20464
20794
  EntitlementRow,
20465
20795
  {
20466
20796
  portal: resolvedPortal,
@@ -20482,13 +20812,13 @@ var SubscriptionSidebar = forwardRef7(
20482
20812
  (acc, entitlement, index) => {
20483
20813
  if (entitlement.feature?.name) {
20484
20814
  acc.push(
20485
- /* @__PURE__ */ jsx36(
20815
+ /* @__PURE__ */ jsx37(
20486
20816
  Flex,
20487
20817
  {
20488
20818
  $justifyContent: "space-between",
20489
20819
  $alignItems: "baseline",
20490
20820
  $gap: "1rem",
20491
- children: /* @__PURE__ */ jsx36(
20821
+ children: /* @__PURE__ */ jsx37(
20492
20822
  EntitlementRow,
20493
20823
  {
20494
20824
  portal: resolvedPortal,
@@ -20507,33 +20837,33 @@ var SubscriptionSidebar = forwardRef7(
20507
20837
  []
20508
20838
  )
20509
20839
  ] }),
20510
- selectedPlan && isSelectedPlanTrialable && shouldTrial && /* @__PURE__ */ jsxs26(Box, { children: [
20511
- /* @__PURE__ */ jsx36(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx36(Text, { $size: 14, children: t3("Trial") }) }),
20512
- /* @__PURE__ */ jsxs26(
20840
+ selectedPlan && isSelectedPlanTrialable && shouldTrial && /* @__PURE__ */ jsxs27(Box, { children: [
20841
+ /* @__PURE__ */ jsx37(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx37(Text, { $size: 14, children: t3("Trial") }) }),
20842
+ /* @__PURE__ */ jsxs27(
20513
20843
  Flex,
20514
20844
  {
20515
20845
  $justifyContent: "space-between",
20516
20846
  $alignItems: "center",
20517
20847
  $gap: "1rem",
20518
20848
  children: [
20519
- /* @__PURE__ */ jsx36(Flex, { children: /* @__PURE__ */ jsx36(Text, { display: "heading4", children: t3("Ends on", { date: trialEndsOn.toLocaleDateString() }) }) }),
20520
- /* @__PURE__ */ jsx36(Flex, { children: /* @__PURE__ */ jsxs26(Text, { children: [
20849
+ /* @__PURE__ */ jsx37(Flex, { children: /* @__PURE__ */ jsx37(Text, { display: "heading4", children: t3("Ends on", { date: trialEndsOn.toLocaleDateString() }) }) }),
20850
+ /* @__PURE__ */ jsx37(Flex, { children: /* @__PURE__ */ jsxs27(Text, { children: [
20521
20851
  "-",
20522
20852
  formatCurrency(
20523
20853
  selectedPlanPrice ?? 0,
20524
20854
  selectedPlanCurrency
20525
20855
  ),
20526
20856
  "/",
20527
- /* @__PURE__ */ jsx36("sub", { children: shortenPeriod(planPeriod) })
20857
+ /* @__PURE__ */ jsx37("sub", { children: shortenPeriod(planPeriod) })
20528
20858
  ] }) })
20529
20859
  ]
20530
20860
  }
20531
20861
  )
20532
20862
  ] }),
20533
- (willAddOnsChange || selectedAddOnsWithPrice.length > 0) && /* @__PURE__ */ jsxs26(Flex, { $flexDirection: "column", $gap: "0.5rem", $marginBottom: "1.5rem", children: [
20534
- /* @__PURE__ */ jsx36(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx36(Text, { $size: 14, children: t3("Add-ons") }) }),
20863
+ (willAddOnsChange || selectedAddOnsWithPrice.length > 0) && /* @__PURE__ */ jsxs27(Flex, { $flexDirection: "column", $gap: "0.5rem", $marginBottom: "1.5rem", children: [
20864
+ /* @__PURE__ */ jsx37(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx37(Text, { $size: 14, children: t3("Add-ons") }) }),
20535
20865
  removedAddOns.map((addOn, index) => {
20536
- return /* @__PURE__ */ jsxs26(
20866
+ return /* @__PURE__ */ jsxs27(
20537
20867
  Flex,
20538
20868
  {
20539
20869
  $justifyContent: "space-between",
@@ -20543,13 +20873,13 @@ var SubscriptionSidebar = forwardRef7(
20543
20873
  $textDecoration: "line-through",
20544
20874
  $color: settings.theme.typography.heading4.color,
20545
20875
  children: [
20546
- /* @__PURE__ */ jsx36(Box, { children: /* @__PURE__ */ jsx36(Text, { display: "heading4", children: addOn.name }) }),
20547
- typeof addOn.planPrice === "number" && addOn.planPeriod && /* @__PURE__ */ jsx36(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs26(Text, { children: [
20876
+ /* @__PURE__ */ jsx37(Box, { children: /* @__PURE__ */ jsx37(Text, { display: "heading4", children: addOn.name }) }),
20877
+ typeof addOn.planPrice === "number" && addOn.planPeriod && /* @__PURE__ */ jsx37(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs27(Text, { children: [
20548
20878
  formatCurrency(
20549
20879
  addOn.planPrice,
20550
20880
  selectedPlanCurrency
20551
20881
  ),
20552
- addOn.planPeriod !== "one-time" && /* @__PURE__ */ jsxs26("sub", { children: [
20882
+ addOn.planPeriod !== "one-time" && /* @__PURE__ */ jsxs27("sub", { children: [
20553
20883
  "/",
20554
20884
  shortenPeriod(planPeriod)
20555
20885
  ] })
@@ -20561,17 +20891,17 @@ var SubscriptionSidebar = forwardRef7(
20561
20891
  }),
20562
20892
  selectedAddOnsWithPrice.map((addOn, index) => {
20563
20893
  const { price: addOnPrice, currency: addOnCurrency } = getAddOnPrice(addOn, planPeriod, currency) || {};
20564
- return /* @__PURE__ */ jsxs26(
20894
+ return /* @__PURE__ */ jsxs27(
20565
20895
  Flex,
20566
20896
  {
20567
20897
  $justifyContent: "space-between",
20568
20898
  $alignItems: "center",
20569
20899
  $gap: "1rem",
20570
20900
  children: [
20571
- /* @__PURE__ */ jsx36(Box, { children: /* @__PURE__ */ jsx36(Text, { display: "heading4", children: addOn.name }) }),
20572
- /* @__PURE__ */ jsx36(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs26(Text, { children: [
20901
+ /* @__PURE__ */ jsx37(Box, { children: /* @__PURE__ */ jsx37(Text, { display: "heading4", children: addOn.name }) }),
20902
+ /* @__PURE__ */ jsx37(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs27(Text, { children: [
20573
20903
  formatCurrency(addOnPrice ?? 0, addOnCurrency),
20574
- addOn.chargeType !== ChargeType.oneTime && /* @__PURE__ */ jsxs26("sub", { children: [
20904
+ addOn.chargeType !== ChargeType.oneTime && /* @__PURE__ */ jsxs27("sub", { children: [
20575
20905
  "/",
20576
20906
  shortenPeriod(planPeriod)
20577
20907
  ] })
@@ -20582,35 +20912,35 @@ var SubscriptionSidebar = forwardRef7(
20582
20912
  );
20583
20913
  })
20584
20914
  ] }),
20585
- addedCreditBundles.length > 0 && /* @__PURE__ */ jsxs26(Flex, { $flexDirection: "column", $gap: "0.5rem", $marginBottom: "1.5rem", children: [
20586
- /* @__PURE__ */ jsx36(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx36(Text, { $size: 14, children: t3("Credits") }) }),
20915
+ addedCreditBundles.length > 0 && /* @__PURE__ */ jsxs27(Flex, { $flexDirection: "column", $gap: "0.5rem", $marginBottom: "1.5rem", children: [
20916
+ /* @__PURE__ */ jsx37(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx37(Text, { $size: 14, children: t3("Credits") }) }),
20587
20917
  addedCreditBundles.reduce(
20588
20918
  (acc, bundle, index) => {
20589
20919
  const price = typeof bundle.price?.priceDecimal === "string" ? Number(bundle.price.priceDecimal) : typeof bundle.price?.price === "number" ? bundle.price.price : void 0;
20590
20920
  const amount = (bundle.quantity ?? 0) * bundle.count;
20591
20921
  if (price)
20592
20922
  acc.push(
20593
- /* @__PURE__ */ jsxs26(
20923
+ /* @__PURE__ */ jsxs27(
20594
20924
  Flex,
20595
20925
  {
20596
20926
  $justifyContent: "space-between",
20597
20927
  $alignItems: "center",
20598
20928
  $gap: "1rem",
20599
20929
  children: [
20600
- /* @__PURE__ */ jsxs26(Box, { children: [
20601
- /* @__PURE__ */ jsx36(Box, { children: /* @__PURE__ */ jsxs26(Text, { display: "heading4", children: [
20930
+ /* @__PURE__ */ jsxs27(Box, { children: [
20931
+ /* @__PURE__ */ jsx37(Box, { children: /* @__PURE__ */ jsxs27(Text, { display: "heading4", children: [
20602
20932
  bundle.name,
20603
20933
  " (",
20604
20934
  bundle.count,
20605
20935
  ")"
20606
20936
  ] }) }),
20607
- /* @__PURE__ */ jsx36(Box, { children: /* @__PURE__ */ jsxs26(Text, { children: [
20937
+ /* @__PURE__ */ jsx37(Box, { children: /* @__PURE__ */ jsxs27(Text, { children: [
20608
20938
  amount,
20609
20939
  " ",
20610
20940
  getFeatureName(bundle, amount)
20611
20941
  ] }) })
20612
20942
  ] }),
20613
- bundle.count > 0 && /* @__PURE__ */ jsx36(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsx36(Text, { children: formatCurrency(
20943
+ bundle.count > 0 && /* @__PURE__ */ jsx37(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsx37(Text, { children: formatCurrency(
20614
20944
  price * bundle.count,
20615
20945
  bundle.price?.currency
20616
20946
  ) }) })
@@ -20624,7 +20954,7 @@ var SubscriptionSidebar = forwardRef7(
20624
20954
  []
20625
20955
  )
20626
20956
  ] }),
20627
- proration !== 0 && charges && selectedPlanCurrency && /* @__PURE__ */ jsx36(
20957
+ proration !== 0 && charges && selectedPlanCurrency && /* @__PURE__ */ jsx37(
20628
20958
  Proration,
20629
20959
  {
20630
20960
  charges,
@@ -20635,7 +20965,7 @@ var SubscriptionSidebar = forwardRef7(
20635
20965
  ]
20636
20966
  }
20637
20967
  ),
20638
- /* @__PURE__ */ jsxs26(
20968
+ /* @__PURE__ */ jsxs27(
20639
20969
  Flex,
20640
20970
  {
20641
20971
  $flexDirection: "column",
@@ -20644,15 +20974,15 @@ var SubscriptionSidebar = forwardRef7(
20644
20974
  $width: "100%",
20645
20975
  $padding: "1.5rem",
20646
20976
  children: [
20647
- discountApplied && /* @__PURE__ */ jsxs26(
20977
+ discountApplied && /* @__PURE__ */ jsxs27(
20648
20978
  Flex,
20649
20979
  {
20650
20980
  $justifyContent: "space-between",
20651
20981
  $alignItems: "center",
20652
20982
  $gap: "1rem",
20653
20983
  children: [
20654
- /* @__PURE__ */ jsx36(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx36(Text, { children: t3("Discount") }) }),
20655
- /* @__PURE__ */ jsxs26(
20984
+ /* @__PURE__ */ jsx37(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx37(Text, { children: t3("Discount") }) }),
20985
+ /* @__PURE__ */ jsxs27(
20656
20986
  Flex,
20657
20987
  {
20658
20988
  $alignItems: "center",
@@ -20662,15 +20992,15 @@ var SubscriptionSidebar = forwardRef7(
20662
20992
  $outlineColor: isLightBackground ? "hsla(0, 0%, 0%, 0.15)" : "hsla(0, 0%, 100%, 0.15)",
20663
20993
  $borderRadius: "0.3125rem",
20664
20994
  children: [
20665
- /* @__PURE__ */ jsx36(Text, { $size: 0.75 * settings.theme.typography.text.fontSize, children: promoCode }),
20666
- /* @__PURE__ */ jsx36(
20995
+ /* @__PURE__ */ jsx37(Text, { $size: 0.75 * settings.theme.typography.text.fontSize, children: promoCode }),
20996
+ /* @__PURE__ */ jsx37(
20667
20997
  Box,
20668
20998
  {
20669
20999
  $cursor: "pointer",
20670
21000
  onClick: () => {
20671
21001
  updatePromoCode?.(null);
20672
21002
  },
20673
- children: /* @__PURE__ */ jsx36(
21003
+ children: /* @__PURE__ */ jsx37(
20674
21004
  Icon3,
20675
21005
  {
20676
21006
  name: "close",
@@ -20686,55 +21016,55 @@ var SubscriptionSidebar = forwardRef7(
20686
21016
  ]
20687
21017
  }
20688
21018
  ),
20689
- percentOff > 0 && /* @__PURE__ */ jsxs26(
21019
+ percentOff > 0 && /* @__PURE__ */ jsxs27(
20690
21020
  Flex,
20691
21021
  {
20692
21022
  $justifyContent: "space-between",
20693
21023
  $alignItems: "center",
20694
21024
  $gap: "1rem",
20695
21025
  children: [
20696
- /* @__PURE__ */ jsx36(Box, { $opacity: "0.625", $lineHeight: 1.15, children: /* @__PURE__ */ jsx36(Text, { children: t3("X% off", { percent: percentOff }) }) }),
20697
- /* @__PURE__ */ jsx36(Box, { children: /* @__PURE__ */ jsx36(Text, { children: formatCurrency(
21026
+ /* @__PURE__ */ jsx37(Box, { $opacity: "0.625", $lineHeight: 1.15, children: /* @__PURE__ */ jsx37(Text, { children: t3("X% off", { percent: percentOff }) }) }),
21027
+ /* @__PURE__ */ jsx37(Box, { children: /* @__PURE__ */ jsx37(Text, { children: formatCurrency(
20698
21028
  newCharges / 100 * percentOff,
20699
21029
  selectedPlanCurrency
20700
21030
  ) }) })
20701
21031
  ]
20702
21032
  }
20703
21033
  ),
20704
- amountOff > 0 && /* @__PURE__ */ jsxs26(
21034
+ amountOff > 0 && /* @__PURE__ */ jsxs27(
20705
21035
  Flex,
20706
21036
  {
20707
21037
  $justifyContent: "space-between",
20708
21038
  $alignItems: "center",
20709
21039
  $gap: "1rem",
20710
21040
  children: [
20711
- /* @__PURE__ */ jsx36(Box, { $opacity: "0.625", $lineHeight: 1.15, children: /* @__PURE__ */ jsx36(Text, { children: t3("X off", {
21041
+ /* @__PURE__ */ jsx37(Box, { $opacity: "0.625", $lineHeight: 1.15, children: /* @__PURE__ */ jsx37(Text, { children: t3("X off", {
20712
21042
  amount: formatCurrency(
20713
21043
  Math.abs(amountOff),
20714
21044
  selectedPlanCurrency
20715
21045
  )
20716
21046
  }) }) }),
20717
- /* @__PURE__ */ jsx36(Box, { children: /* @__PURE__ */ jsxs26(Text, { children: [
21047
+ /* @__PURE__ */ jsx37(Box, { children: /* @__PURE__ */ jsxs27(Text, { children: [
20718
21048
  "-",
20719
21049
  formatCurrency(Math.abs(amountOff), selectedPlanCurrency)
20720
21050
  ] }) })
20721
21051
  ]
20722
21052
  }
20723
21053
  ),
20724
- !isCreditOnlyPurchase && subscriptionPrice && /* @__PURE__ */ jsxs26(
21054
+ !isCreditOnlyPurchase && subscriptionPrice && /* @__PURE__ */ jsxs27(
20725
21055
  Flex,
20726
21056
  {
20727
21057
  $justifyContent: "space-between",
20728
21058
  $alignItems: "center",
20729
21059
  $gap: "1rem",
20730
21060
  children: [
20731
- /* @__PURE__ */ jsx36(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsxs26(Text, { children: [
21061
+ /* @__PURE__ */ jsx37(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsxs27(Text, { children: [
20732
21062
  planPeriod === "year" ? t3("Yearly total") : planPeriod === "quarter" ? t3("Quarterly total") : t3("Monthly total"),
20733
21063
  ":"
20734
21064
  ] }) }),
20735
- /* @__PURE__ */ jsx36(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs26(Text, { children: [
21065
+ /* @__PURE__ */ jsx37(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs27(Text, { children: [
20736
21066
  subscriptionPrice,
20737
- /* @__PURE__ */ jsxs26("sub", { children: [
21067
+ /* @__PURE__ */ jsxs27("sub", { children: [
20738
21068
  "/",
20739
21069
  shortenPeriod(planPeriod)
20740
21070
  ] })
@@ -20742,46 +21072,46 @@ var SubscriptionSidebar = forwardRef7(
20742
21072
  ]
20743
21073
  }
20744
21074
  ),
20745
- taxAmount > 0 && /* @__PURE__ */ jsxs26(
21075
+ taxAmount > 0 && /* @__PURE__ */ jsxs27(
20746
21076
  Flex,
20747
21077
  {
20748
21078
  $justifyContent: "space-between",
20749
21079
  $alignItems: "center",
20750
21080
  $gap: "1rem",
20751
21081
  children: [
20752
- /* @__PURE__ */ jsx36(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx36(Text, { children: t3("Tax (description):", {
21082
+ /* @__PURE__ */ jsx37(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx37(Text, { children: t3("Tax (description):", {
20753
21083
  description: taxDescription
20754
21084
  }) }) }),
20755
- /* @__PURE__ */ jsx36(Box, { children: /* @__PURE__ */ jsx36(Text, { children: formatCurrency(taxAmount, selectedPlanCurrency) }) })
21085
+ /* @__PURE__ */ jsx37(Box, { children: /* @__PURE__ */ jsx37(Text, { children: formatCurrency(taxAmount, selectedPlanCurrency) }) })
20756
21086
  ]
20757
21087
  }
20758
21088
  ),
20759
- charges && /* @__PURE__ */ jsxs26(
21089
+ charges && /* @__PURE__ */ jsxs27(
20760
21090
  Flex,
20761
21091
  {
20762
21092
  $justifyContent: "space-between",
20763
21093
  $alignItems: "center",
20764
21094
  $gap: "1rem",
20765
21095
  children: [
20766
- /* @__PURE__ */ jsx36(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsxs26(Text, { children: [
21096
+ /* @__PURE__ */ jsx37(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsxs27(Text, { children: [
20767
21097
  t3("Due today"),
20768
21098
  ":"
20769
21099
  ] }) }),
20770
- /* @__PURE__ */ jsx36(Box, { children: /* @__PURE__ */ jsx36(Text, { children: formatCurrency(Math.max(0, dueNow), selectedPlanCurrency) }) })
21100
+ /* @__PURE__ */ jsx37(Box, { children: /* @__PURE__ */ jsx37(Text, { children: formatCurrency(Math.max(0, dueNow), selectedPlanCurrency) }) })
20771
21101
  ]
20772
21102
  }
20773
21103
  ),
20774
- dueNow < 0 && /* @__PURE__ */ jsxs26(Flex, { $justifyContent: "space-between", $gap: "1rem", children: [
20775
- /* @__PURE__ */ jsx36(Box, { $opacity: "0.625", $lineHeight: 1.15, children: /* @__PURE__ */ jsxs26(Text, { children: [
21104
+ dueNow < 0 && /* @__PURE__ */ jsxs27(Flex, { $justifyContent: "space-between", $gap: "1rem", children: [
21105
+ /* @__PURE__ */ jsx37(Box, { $opacity: "0.625", $lineHeight: 1.15, children: /* @__PURE__ */ jsxs27(Text, { children: [
20776
21106
  t3("Credits to be applied to future invoices"),
20777
21107
  ":"
20778
21108
  ] }) }),
20779
- /* @__PURE__ */ jsx36(Box, { children: /* @__PURE__ */ jsx36(Text, { children: formatCurrency(Math.abs(dueNow), selectedPlanCurrency) }) })
21109
+ /* @__PURE__ */ jsx37(Box, { children: /* @__PURE__ */ jsx37(Text, { children: formatCurrency(Math.abs(dueNow), selectedPlanCurrency) }) })
20780
21110
  ] }),
20781
- /* @__PURE__ */ jsxs26("div", { ref: buttonRef, children: [
21111
+ /* @__PURE__ */ jsxs27("div", { ref: buttonRef, children: [
20782
21112
  button,
20783
21113
  createPortal2(
20784
- /* @__PURE__ */ jsx36(
21114
+ /* @__PURE__ */ jsx37(
20785
21115
  Box,
20786
21116
  {
20787
21117
  $position: "sticky",
@@ -20795,15 +21125,15 @@ var SubscriptionSidebar = forwardRef7(
20795
21125
  $borderTopWidth: "1px",
20796
21126
  $borderTopStyle: "solid",
20797
21127
  $borderTopColor: isLightBackground ? "hsla(0, 0%, 0%, 0.1)" : "hsla(0, 0%, 100%, 0.2)",
20798
- children: /* @__PURE__ */ jsx36(Box, { $padding: "1rem 1.5rem", children: button })
21128
+ children: /* @__PURE__ */ jsx37(Box, { $padding: "1rem 1.5rem", children: button })
20799
21129
  }
20800
21130
  ),
20801
21131
  resolvedPortal
20802
21132
  )
20803
21133
  ] }),
20804
- !isLoading && error && /* @__PURE__ */ jsxs26(Flex, { $flexDirection: "column", children: [
20805
- /* @__PURE__ */ jsx36(Text, { $weight: 500, $color: "#DB6669", children: error }),
20806
- error === t3("Downgrade not permitted.") && data?.preventSelfServiceDowngrade && data?.preventSelfServiceDowngradeUrl && data?.preventSelfServiceDowngradeButtonText && /* @__PURE__ */ jsx36(
21134
+ !isLoading && error && /* @__PURE__ */ jsxs27(Flex, { $flexDirection: "column", children: [
21135
+ /* @__PURE__ */ jsx37(Text, { $weight: 500, $color: "#DB6669", children: error }),
21136
+ error === t3("Downgrade not permitted.") && data?.preventSelfServiceDowngrade && data?.preventSelfServiceDowngradeUrl && data?.preventSelfServiceDowngradeButtonText && /* @__PURE__ */ jsx37(
20807
21137
  Text,
20808
21138
  {
20809
21139
  as: "a",
@@ -20813,7 +21143,7 @@ var SubscriptionSidebar = forwardRef7(
20813
21143
  }
20814
21144
  )
20815
21145
  ] }),
20816
- layout !== "unsubscribe" && !isCreditOnlyPurchase && /* @__PURE__ */ jsx36(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx36(Text, { children: willScheduleDowngrade && selectedPlan?.name && billingSubscription ? t3(
21146
+ layout !== "unsubscribe" && !isCreditOnlyPurchase && /* @__PURE__ */ jsx37(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx37(Text, { children: willScheduleDowngrade && selectedPlan?.name && billingSubscription ? t3(
20817
21147
  "You will be downgraded at the end of your billing period.",
20818
21148
  {
20819
21149
  plan: selectedPlan.name,
@@ -20894,7 +21224,7 @@ var TieredPricingDetails = ({
20894
21224
 
20895
21225
  // src/components/shared/unsubscribe-dialog/UnsubscribeDialog.tsx
20896
21226
  import { useCallback as useCallback10, useLayoutEffect as useLayoutEffect7, useMemo as useMemo19, useRef as useRef10, useState as useState13 } from "react";
20897
- import { jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
21227
+ import { jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
20898
21228
  var UnsubscribeDialog = ({ top }) => {
20899
21229
  const { t: t3 } = useTranslation();
20900
21230
  const { data, layout, setLayout, setCheckoutState, clearCheckoutState } = useEmbed();
@@ -20964,7 +21294,7 @@ var UnsubscribeDialog = ({ top }) => {
20964
21294
  element.show();
20965
21295
  }
20966
21296
  }, [layout]);
20967
- return /* @__PURE__ */ jsx37(
21297
+ return /* @__PURE__ */ jsx38(
20968
21298
  Dialog2,
20969
21299
  {
20970
21300
  ref: setDialog,
@@ -20973,8 +21303,8 @@ var UnsubscribeDialog = ({ top }) => {
20973
21303
  top,
20974
21304
  onClose: handleClose,
20975
21305
  ...!isModal && { open: layout === "unsubscribe" },
20976
- children: /* @__PURE__ */ jsxs27(DialogContent2, { children: [
20977
- /* @__PURE__ */ jsx37(
21306
+ children: /* @__PURE__ */ jsxs28(DialogContent2, { children: [
21307
+ /* @__PURE__ */ jsx38(
20978
21308
  DialogClose,
20979
21309
  {
20980
21310
  onClose: handleClose,
@@ -20984,7 +21314,7 @@ var UnsubscribeDialog = ({ top }) => {
20984
21314
  $margin: "1rem 0.75rem 0 0"
20985
21315
  }
20986
21316
  ),
20987
- /* @__PURE__ */ jsxs27(
21317
+ /* @__PURE__ */ jsxs28(
20988
21318
  Flex,
20989
21319
  {
20990
21320
  $flexDirection: "column",
@@ -20994,9 +21324,9 @@ var UnsubscribeDialog = ({ top }) => {
20994
21324
  $padding: "2.5rem",
20995
21325
  $overflow: "auto",
20996
21326
  children: [
20997
- /* @__PURE__ */ jsxs27(Flex, { $flexDirection: "column", $flexWrap: "wrap", $gap: "0.5rem", children: [
20998
- /* @__PURE__ */ jsx37(Text, { as: "h2", display: "heading2", children: t3("Cancel subscription") }),
20999
- /* @__PURE__ */ jsxs27(Text, { as: "p", children: [
21327
+ /* @__PURE__ */ jsxs28(Flex, { $flexDirection: "column", $flexWrap: "wrap", $gap: "0.5rem", children: [
21328
+ /* @__PURE__ */ jsx38(Text, { as: "h2", display: "heading2", children: t3("Cancel subscription") }),
21329
+ /* @__PURE__ */ jsxs28(Text, { as: "p", children: [
21000
21330
  t3(
21001
21331
  "You will retain access to your plan until the end of the billing period, on"
21002
21332
  ),
@@ -21006,9 +21336,9 @@ var UnsubscribeDialog = ({ top }) => {
21006
21336
  })
21007
21337
  ] })
21008
21338
  ] }),
21009
- /* @__PURE__ */ jsxs27(Flex, { $flexDirection: "column", $flexWrap: "wrap", $gap: "0.5rem", children: [
21010
- /* @__PURE__ */ jsx37(Text, { as: "p", children: t3("Not ready to cancel?") }),
21011
- /* @__PURE__ */ jsx37(
21339
+ /* @__PURE__ */ jsxs28(Flex, { $flexDirection: "column", $flexWrap: "wrap", $gap: "0.5rem", children: [
21340
+ /* @__PURE__ */ jsx38(Text, { as: "p", children: t3("Not ready to cancel?") }),
21341
+ /* @__PURE__ */ jsx38(
21012
21342
  Button,
21013
21343
  {
21014
21344
  type: "button",
@@ -21029,7 +21359,7 @@ var UnsubscribeDialog = ({ top }) => {
21029
21359
  ]
21030
21360
  }
21031
21361
  ),
21032
- /* @__PURE__ */ jsx37(
21362
+ /* @__PURE__ */ jsx38(
21033
21363
  SubscriptionSidebar,
21034
21364
  {
21035
21365
  ref: sidebarRef,
@@ -21056,14 +21386,14 @@ var UnsubscribeDialog = ({ top }) => {
21056
21386
  };
21057
21387
 
21058
21388
  // src/components/shared/usage-violation-text/UsageViolationText.tsx
21059
- import { jsx as jsx38 } from "react/jsx-runtime";
21389
+ import { jsx as jsx39 } from "react/jsx-runtime";
21060
21390
  var UsageViolationText = ({ violations }) => {
21061
21391
  const { t: t3 } = useTranslation();
21062
21392
  const { settings } = useEmbed();
21063
21393
  if (violations.length === 0) {
21064
21394
  return null;
21065
21395
  }
21066
- return /* @__PURE__ */ jsx38(
21396
+ return /* @__PURE__ */ jsx39(
21067
21397
  Text,
21068
21398
  {
21069
21399
  $size: 0.875 * settings.theme.typography.text.fontSize,
@@ -21082,11 +21412,11 @@ var UsageViolationText = ({ violations }) => {
21082
21412
  };
21083
21413
 
21084
21414
  // src/components/ui/badge/Badge.tsx
21085
- import { jsx as jsx39, jsxs as jsxs28 } from "react/jsx-runtime";
21415
+ import { jsx as jsx40, jsxs as jsxs29 } from "react/jsx-runtime";
21086
21416
  var Badge = () => {
21087
21417
  const { t: t3 } = useTranslation();
21088
21418
  const { settings } = useEmbed();
21089
- return /* @__PURE__ */ jsxs28(
21419
+ return /* @__PURE__ */ jsxs29(
21090
21420
  Flex,
21091
21421
  {
21092
21422
  as: "a",
@@ -21099,82 +21429,82 @@ var Badge = () => {
21099
21429
  $gridColumn: "1 / -1",
21100
21430
  $color: settings.theme.typography.text.color,
21101
21431
  children: [
21102
- /* @__PURE__ */ jsxs28(Text, { $size: 12, children: [
21432
+ /* @__PURE__ */ jsxs29(Text, { $size: 12, children: [
21103
21433
  t3("Powered by"),
21104
21434
  " "
21105
21435
  ] }),
21106
- /* @__PURE__ */ jsxs28("svg", { viewBox: "0 0 86 16", width: 86, height: 16, children: [
21107
- /* @__PURE__ */ jsx39(
21436
+ /* @__PURE__ */ jsxs29("svg", { viewBox: "0 0 86 16", width: 86, height: 16, children: [
21437
+ /* @__PURE__ */ jsx40(
21108
21438
  "path",
21109
21439
  {
21110
21440
  d: "M21.2354 6.16227C21.1796 5.95015 21.0494 5.76779 20.8261 5.61893C20.6028 5.46635 20.3423 5.39564 20.0408 5.39564C19.3151 5.39564 18.7941 5.69708 18.7941 6.2367C18.7941 6.49721 18.9095 6.69073 19.1402 6.81726C19.3635 6.94379 19.732 7.07033 20.2344 7.18569C21.0084 7.37177 21.4922 7.51691 21.9686 7.7402C22.203 7.85557 22.3928 7.97465 22.5305 8.10863C22.7948 8.3803 22.9548 8.74501 22.9362 9.20276C22.9176 9.86147 22.6571 10.375 22.1547 10.7397C21.6523 11.1082 20.9563 11.2905 20.0818 11.2905C19.2072 11.2905 18.5597 11.1268 18.0312 10.8067C17.5065 10.4867 17.2013 10.0215 17.1194 9.41116L18.6192 9.27719C18.6974 9.57491 18.8723 9.7982 19.1514 9.94706C19.4305 10.0959 19.7394 10.1778 20.0818 10.1778C20.4614 10.1778 20.7777 10.0996 21.0308 9.9359C21.2838 9.77959 21.4104 9.56002 21.4104 9.28835C21.4104 8.90876 21.0531 8.61104 20.5991 8.43613C20.3683 8.35053 20.0855 8.27238 19.7468 8.19423C19.2705 8.07886 18.8946 7.97094 18.6155 7.87418C18.3364 7.78486 18.0908 7.66205 17.8712 7.51319C17.4358 7.21547 17.2832 6.8247 17.2832 6.2367C17.2832 5.61521 17.5325 5.13141 18.0312 4.79648C18.5262 4.46526 19.2035 4.29407 20.0669 4.29407C21.5853 4.29407 22.5752 4.9044 22.7389 6.05807L21.228 6.16227H21.2354Z",
21111
21441
  fill: "currentColor"
21112
21442
  }
21113
21443
  ),
21114
- /* @__PURE__ */ jsx39(
21444
+ /* @__PURE__ */ jsx40(
21115
21445
  "path",
21116
21446
  {
21117
21447
  d: "M29.4145 8.9796L30.7803 9.55271C30.49 10.0923 30.0621 10.5129 29.5001 10.8217C28.9382 11.1344 28.3167 11.2944 27.6319 11.2944C26.9472 11.2944 26.3629 11.1567 25.8121 10.8701C25.2613 10.5873 24.8147 10.1742 24.4835 9.6383C24.1523 9.09868 23.9811 8.48835 23.9811 7.79987C23.9811 7.11138 24.1486 6.49361 24.4835 5.95771C24.8147 5.41809 25.2613 5.00873 25.8121 4.72589C26.3629 4.44305 26.9732 4.30164 27.6319 4.30164C28.2906 4.30164 28.9382 4.45794 29.5038 4.77427C30.0658 5.08688 30.4938 5.51113 30.7803 6.05075L29.4145 6.62015C29.0535 5.93539 28.3985 5.56323 27.6319 5.56323C27.0327 5.56323 26.5303 5.77536 26.1135 6.19961C25.6967 6.62387 25.492 7.15977 25.492 7.80731C25.492 8.45486 25.6967 8.99076 26.1135 9.40757C26.5303 9.83182 27.0327 10.0439 27.6319 10.0439C28.3985 10.0439 29.0535 9.66807 29.4145 8.98703V8.9796Z",
21118
21448
  fill: "currentColor"
21119
21449
  }
21120
21450
  ),
21121
- /* @__PURE__ */ jsx39(
21451
+ /* @__PURE__ */ jsx40(
21122
21452
  "path",
21123
21453
  {
21124
21454
  d: "M37.4386 11.2049V7.80341C37.4386 6.35945 36.9139 5.59282 35.697 5.59282C35.0978 5.59282 34.614 5.7975 34.2419 6.21059C33.8623 6.61996 33.6725 7.15214 33.6725 7.80713V11.2086H32.1615V1.9234H33.6725V5.47745C34.1004 4.73315 35.001 4.29773 36.1919 4.29773C37.167 4.29773 37.8666 4.59917 38.302 5.19834C38.7375 5.7975 38.9533 6.66834 38.9533 7.80341V11.2049H37.4349H37.4386Z",
21125
21455
  fill: "currentColor"
21126
21456
  }
21127
21457
  ),
21128
- /* @__PURE__ */ jsx39(
21458
+ /* @__PURE__ */ jsx40(
21129
21459
  "path",
21130
21460
  {
21131
21461
  d: "M46.5692 5.38819C47.2167 6.07295 47.5777 7.1187 47.5107 8.30587H41.8242C41.9284 8.83805 42.1741 9.26602 42.5611 9.59352C42.9481 9.92473 43.4022 10.0885 43.9157 10.0885C44.8052 10.0885 45.5234 9.59724 45.8844 8.78222L47.1795 9.40372C46.8818 9.99172 46.4352 10.4495 45.8509 10.7881C45.2629 11.1268 44.6191 11.2943 43.9157 11.2943C42.9295 11.2943 42.0178 10.9444 41.3516 10.3453C40.6855 9.7461 40.2649 8.83432 40.2649 7.79602C40.2649 6.75771 40.6892 5.84222 41.3516 5.23933C42.0178 4.64017 42.9295 4.29034 43.9157 4.29034C44.9801 4.29034 45.9216 4.69971 46.5692 5.38447V5.38819ZM42.5388 6.00224C42.1592 6.32974 41.921 6.75772 41.8205 7.29734H46.0221C45.9179 6.75772 45.6835 6.3223 45.3039 5.99852C44.9243 5.67847 44.4628 5.51473 43.9195 5.51473C43.3761 5.51473 42.9221 5.67847 42.5425 6.00597L42.5388 6.00224Z",
21132
21462
  fill: "currentColor"
21133
21463
  }
21134
21464
  ),
21135
- /* @__PURE__ */ jsx39(
21465
+ /* @__PURE__ */ jsx40(
21136
21466
  "path",
21137
21467
  {
21138
21468
  d: "M59.7699 5.23933C60.1495 5.86827 60.3132 6.68329 60.3132 7.80347V11.2049H58.8023V7.80347C58.8023 6.35952 58.3371 5.59288 57.2318 5.59288C56.6438 5.59288 56.1861 5.79384 55.8586 6.19577C55.5311 6.60141 55.3673 7.13731 55.3673 7.80347V11.2049H53.8489V7.80347C53.8489 6.35952 53.3838 5.59288 52.2785 5.59288C51.6905 5.59288 51.2327 5.79384 50.9052 6.19577C50.574 6.60141 50.4102 7.13731 50.4102 7.80347V11.2049H48.8993V4.39827H50.3433L50.4102 5.47379C50.8196 4.65878 51.5825 4.29407 52.8106 4.29407C53.9606 4.29407 54.7161 4.78531 55.077 5.76407C55.5199 4.81508 56.4428 4.29407 57.7677 4.29407C58.7093 4.29407 59.3829 4.61412 59.7699 5.23562V5.23933Z",
21139
21469
  fill: "currentColor"
21140
21470
  }
21141
21471
  ),
21142
- /* @__PURE__ */ jsx39(
21472
+ /* @__PURE__ */ jsx40(
21143
21473
  "path",
21144
21474
  {
21145
21475
  d: "M67.4264 5.47382L67.4934 4.3983H68.9373V11.205H67.4934L67.4264 10.1294C67.0282 10.9147 66.1797 11.3092 64.8809 11.3017C63.102 11.3427 61.591 9.79823 61.6283 7.8035C61.591 5.8162 63.102 4.2606 64.8809 4.29782C66.0643 4.29782 67.0096 4.7444 67.4264 5.47754V5.47382ZM66.8049 9.37398C67.2217 8.95717 67.4264 8.43243 67.4264 7.79605C67.4264 7.15967 67.2217 6.64238 66.8049 6.21813C66.3881 5.80132 65.8782 5.58919 65.2828 5.58919C64.6874 5.58919 64.1887 5.80132 63.7719 6.21813C63.355 6.64238 63.1504 7.16711 63.1504 7.79605C63.1504 8.42499 63.355 8.95717 63.7719 9.37398C64.1887 9.79823 64.6911 10.0104 65.2828 10.0104C65.8745 10.0104 66.3881 9.79823 66.8049 9.37398Z",
21146
21476
  fill: "currentColor"
21147
21477
  }
21148
21478
  ),
21149
- /* @__PURE__ */ jsx39(
21479
+ /* @__PURE__ */ jsx40(
21150
21480
  "path",
21151
21481
  {
21152
21482
  d: "M71.3891 2.85757H72.8926V4.39828H74.6455V5.58172H72.8926V8.9683C72.8926 9.5898 73.1048 9.90985 73.5923 9.96568C73.89 10.0252 74.2398 10.0141 74.6455 9.9359V11.1863C74.1989 11.257 73.7858 11.2943 73.4062 11.2943C72.6731 11.2943 72.1595 11.1082 71.8543 10.7323C71.5454 10.3639 71.3891 9.79076 71.3891 9.02041V5.58172H70.4215V4.39828H71.3891V2.85757Z",
21153
21483
  fill: "currentColor"
21154
21484
  }
21155
21485
  ),
21156
- /* @__PURE__ */ jsx39(
21486
+ /* @__PURE__ */ jsx40(
21157
21487
  "path",
21158
21488
  {
21159
21489
  d: "M76.1747 3.15526C75.9923 2.98035 75.903 2.76078 75.903 2.50772C75.903 2.25466 75.9923 2.04997 76.1747 1.86762C76.3496 1.69271 76.5691 1.60339 76.8222 1.60339C77.0753 1.60339 77.2874 1.69271 77.4623 1.86762C77.6372 2.04997 77.7265 2.2621 77.7265 2.50772C77.7265 2.75334 77.6372 2.97291 77.4623 3.15526C77.2874 3.33762 77.0678 3.42694 76.8222 3.42694C76.5766 3.42694 76.3496 3.33762 76.1747 3.15526ZM76.0593 4.39826H77.5777V11.2049H76.0593V4.39826Z",
21160
21490
  fill: "currentColor"
21161
21491
  }
21162
21492
  ),
21163
- /* @__PURE__ */ jsx39(
21493
+ /* @__PURE__ */ jsx40(
21164
21494
  "path",
21165
21495
  {
21166
21496
  d: "M84.3023 8.9796L85.6681 9.55271C85.3778 10.0923 84.9498 10.5129 84.3879 10.8217C83.8259 11.1344 83.2044 11.2944 82.5197 11.2944C81.8349 11.2944 81.2506 11.1567 80.6998 10.8701C80.1491 10.5873 79.7025 10.1742 79.3713 9.6383C79.04 9.09868 78.8689 8.48835 78.8689 7.79987C78.8689 7.11138 79.0363 6.49361 79.3713 5.95771C79.7025 5.41809 80.1528 5.00873 80.6998 4.72589C81.2469 4.44305 81.8609 4.30164 82.5197 4.30164C83.1784 4.30164 83.8259 4.45794 84.3916 4.77427C84.9535 5.08688 85.3815 5.51113 85.6681 6.05075L84.3023 6.62015C83.9413 5.93539 83.2863 5.56323 82.5197 5.56323C81.9205 5.56323 81.4181 5.77536 81.0013 6.19961C80.5845 6.62387 80.3798 7.15977 80.3798 7.80731C80.3798 8.45486 80.5845 8.99076 81.0013 9.40757C81.4181 9.83182 81.9205 10.0439 82.5197 10.0439C83.2863 10.0439 83.9413 9.66807 84.3023 8.98703V8.9796Z",
21167
21497
  fill: "currentColor"
21168
21498
  }
21169
21499
  ),
21170
- /* @__PURE__ */ jsx39(
21500
+ /* @__PURE__ */ jsx40(
21171
21501
  "path",
21172
21502
  {
21173
21503
  d: "M5.93091 10.8141L7.2758 9.41753L3.83719 5.84667C2.98568 4.9624 2.98568 3.52157 3.83719 2.63731C4.68871 1.75305 6.07617 1.75305 6.92769 2.63731L10.3663 6.20817L11.7112 4.81156L8.27258 1.24069C6.67975 -0.413401 4.08513 -0.413401 2.4923 1.24069C0.899472 2.89479 0.899472 5.58919 2.4923 7.24328L5.93091 10.8141Z",
21174
21504
  fill: "currentColor"
21175
21505
  }
21176
21506
  ),
21177
- /* @__PURE__ */ jsx39(
21507
+ /* @__PURE__ */ jsx40(
21178
21508
  "path",
21179
21509
  {
21180
21510
  d: "M6.05827 3.54751C5.68761 3.1626 5.08404 3.1626 4.71338 3.54751C4.34272 3.93243 4.34272 4.55921 4.71338 4.94413L9.02103 9.41746L5.93054 12.6268L1.62288 8.15349C1.25223 7.76857 0.648653 7.76857 0.277994 8.15349C-0.0926647 8.5384 -0.0926647 9.16519 0.277994 9.5501L5.93054 15.4201L11.7108 9.41746L6.05827 3.54751Z",
@@ -21188,9 +21518,9 @@ var Badge = () => {
21188
21518
  };
21189
21519
 
21190
21520
  // src/components/layout/RenderLayout.tsx
21191
- import { jsx as jsx40, jsxs as jsxs29 } from "react/jsx-runtime";
21521
+ import { jsx as jsx41, jsxs as jsxs30 } from "react/jsx-runtime";
21192
21522
  var Disabled = () => {
21193
- return /* @__PURE__ */ jsx40(Box, { $width: "max-content", $height: "max-content", children: /* @__PURE__ */ jsx40(Card, { children: /* @__PURE__ */ jsxs29(
21523
+ return /* @__PURE__ */ jsx41(Box, { $width: "max-content", $height: "max-content", children: /* @__PURE__ */ jsx41(Card, { children: /* @__PURE__ */ jsxs30(
21194
21524
  Element,
21195
21525
  {
21196
21526
  as: Flex,
@@ -21199,8 +21529,8 @@ var Disabled = () => {
21199
21529
  $alignItems: "center",
21200
21530
  $whiteSpace: "nowrap",
21201
21531
  children: [
21202
- /* @__PURE__ */ jsx40(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx40(Text, { as: "h1", display: "heading1", children: "Portal not found" }) }),
21203
- /* @__PURE__ */ jsx40(Text, { as: "p", children: "Please try again later." })
21532
+ /* @__PURE__ */ jsx41(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx41(Text, { as: "h1", display: "heading1", children: "Portal not found" }) }),
21533
+ /* @__PURE__ */ jsx41(Text, { as: "p", children: "Please try again later." })
21204
21534
  ]
21205
21535
  }
21206
21536
  ) }) });
@@ -21209,7 +21539,7 @@ var RenderLayout = ({ children }) => {
21209
21539
  const { layout } = useEmbed();
21210
21540
  switch (layout) {
21211
21541
  case "disabled":
21212
- return /* @__PURE__ */ jsx40(Disabled, {});
21542
+ return /* @__PURE__ */ jsx41(Disabled, {});
21213
21543
  default:
21214
21544
  return children;
21215
21545
  }
@@ -21234,7 +21564,7 @@ var StyledViewport = gt2.div.withConfig({
21234
21564
  `;
21235
21565
 
21236
21566
  // src/components/layout/viewport/Viewport.tsx
21237
- import { Fragment as Fragment14, jsx as jsx41, jsxs as jsxs30 } from "react/jsx-runtime";
21567
+ import { Fragment as Fragment14, jsx as jsx42, jsxs as jsxs31 } from "react/jsx-runtime";
21238
21568
  var Viewport = forwardRef8(
21239
21569
  ({ children, portal, ...props }, ref) => {
21240
21570
  portal = portal || document.body;
@@ -21243,7 +21573,7 @@ var Viewport = forwardRef8(
21243
21573
  const [top, setTop] = useState14(0);
21244
21574
  useLayoutEffect8(() => {
21245
21575
  const element = portalRef.current;
21246
- const setModalY = (0, import_debounce3.default)(() => {
21576
+ const setModalY = (0, import_debounce4.default)(() => {
21247
21577
  const value = Math.abs(
21248
21578
  (element === document.body ? window.scrollY : element.scrollTop) ?? 0
21249
21579
  );
@@ -21255,21 +21585,21 @@ var Viewport = forwardRef8(
21255
21585
  };
21256
21586
  }, []);
21257
21587
  const isBadgeVisible = !data?.capabilities?.badgeVisibility || settings.badge?.visibility !== "hidden";
21258
- return /* @__PURE__ */ jsxs30(Fragment14, { children: [
21259
- /* @__PURE__ */ jsxs30(StyledViewport, { ref, ...props, children: [
21260
- /* @__PURE__ */ jsx41(RenderLayout, { children }),
21261
- isBadgeVisible && /* @__PURE__ */ jsx41(Badge, {})
21588
+ return /* @__PURE__ */ jsxs31(Fragment14, { children: [
21589
+ /* @__PURE__ */ jsxs31(StyledViewport, { ref, ...props, children: [
21590
+ /* @__PURE__ */ jsx42(RenderLayout, { children }),
21591
+ isBadgeVisible && /* @__PURE__ */ jsx42(Badge, {})
21262
21592
  ] }),
21263
- layout === "checkout" && createPortal3(/* @__PURE__ */ jsx41(CheckoutDialog, { top }), portal),
21264
- layout === "unsubscribe" && createPortal3(/* @__PURE__ */ jsx41(UnsubscribeDialog, { top }), portal),
21265
- layout === "payment" && createPortal3(/* @__PURE__ */ jsx41(PaymentDialog, { top }), portal)
21593
+ layout === "checkout" && createPortal3(/* @__PURE__ */ jsx42(CheckoutDialog, { top }), portal),
21594
+ layout === "unsubscribe" && createPortal3(/* @__PURE__ */ jsx42(UnsubscribeDialog, { top }), portal),
21595
+ layout === "payment" && createPortal3(/* @__PURE__ */ jsx42(PaymentDialog, { top }), portal)
21266
21596
  ] });
21267
21597
  }
21268
21598
  );
21269
21599
  Viewport.displayName = "Viewport";
21270
21600
 
21271
21601
  // src/components/elements/button/Button.tsx
21272
- import { jsx as jsx42 } from "react/jsx-runtime";
21602
+ import { jsx as jsx43 } from "react/jsx-runtime";
21273
21603
  var resolveDesignProps = (props) => {
21274
21604
  return {
21275
21605
  button: {
@@ -21300,7 +21630,7 @@ var ButtonElement = forwardRef9(({ children, className, ...rest }, ref) => {
21300
21630
  variant: "text"
21301
21631
  }
21302
21632
  };
21303
- return /* @__PURE__ */ jsx42(
21633
+ return /* @__PURE__ */ jsx43(
21304
21634
  Element,
21305
21635
  {
21306
21636
  as: Flex,
@@ -21308,7 +21638,7 @@ var ButtonElement = forwardRef9(({ children, className, ...rest }, ref) => {
21308
21638
  className,
21309
21639
  $flexDirection: "column",
21310
21640
  $gap: "2rem",
21311
- children: /* @__PURE__ */ jsx42(
21641
+ children: /* @__PURE__ */ jsx43(
21312
21642
  Button,
21313
21643
  {
21314
21644
  as: "a",
@@ -21333,7 +21663,7 @@ import { Fragment as Fragment17, forwardRef as forwardRef10, useMemo as useMemo2
21333
21663
 
21334
21664
  // src/components/elements/included-features/UsageDetails.tsx
21335
21665
  import { Fragment as Fragment15, useMemo as useMemo20 } from "react";
21336
- import { Fragment as Fragment16, jsx as jsx43, jsxs as jsxs31 } from "react/jsx-runtime";
21666
+ import { Fragment as Fragment16, jsx as jsx44, jsxs as jsxs32 } from "react/jsx-runtime";
21337
21667
  var UsageDetails = ({ entitlement, layout }) => {
21338
21668
  const {
21339
21669
  allocation,
@@ -21464,7 +21794,7 @@ var UsageDetails = ({ entitlement, layout }) => {
21464
21794
  let index = 0;
21465
21795
  if (priceBehavior === EntitlementPriceBehavior.PayInAdvance && !tiered && typeof period === "string" && typeof price === "number") {
21466
21796
  acc.push(
21467
- /* @__PURE__ */ jsx43(Fragment15, { children: packageSize > 1 ? t3("$X/Y units/period", {
21797
+ /* @__PURE__ */ jsx44(Fragment15, { children: packageSize > 1 ? t3("$X/Y units/period", {
21468
21798
  cost: formatCurrency(price, currency),
21469
21799
  size: packageSize,
21470
21800
  units: getFeatureName(feature, packageSize),
@@ -21478,7 +21808,7 @@ var UsageDetails = ({ entitlement, layout }) => {
21478
21808
  index += 1;
21479
21809
  } else if ((priceBehavior === EntitlementPriceBehavior.PayAsYouGo || priceBehavior === EntitlementPriceBehavior.Overage || priceBehavior === EntitlementPriceBehavior.Tier || priceBehavior === EntitlementPriceBehavior.CreditBurndown || tiered) && typeof usage === "number") {
21480
21810
  acc.push(
21481
- /* @__PURE__ */ jsx43(Fragment15, { children: t3("X units used", {
21811
+ /* @__PURE__ */ jsx44(Fragment15, { children: t3("X units used", {
21482
21812
  amount: usage,
21483
21813
  units: getFeatureName(feature, usage)
21484
21814
  }) }, index)
@@ -21487,14 +21817,14 @@ var UsageDetails = ({ entitlement, layout }) => {
21487
21817
  }
21488
21818
  if (typeof cost === "number" && cost > 0) {
21489
21819
  acc.push(
21490
- /* @__PURE__ */ jsxs31(Fragment15, { children: [
21491
- acc.length > 0 && /* @__PURE__ */ jsx43(Fragment16, { children: " \u2022 " }),
21820
+ /* @__PURE__ */ jsxs32(Fragment15, { children: [
21821
+ acc.length > 0 && /* @__PURE__ */ jsx44(Fragment16, { children: " \u2022 " }),
21492
21822
  formatCurrency(cost, currency)
21493
21823
  ] }, index)
21494
21824
  );
21495
21825
  index += 1;
21496
21826
  if (feature.featureType === FeatureType.Trait && typeof period === "string") {
21497
- acc.push(/* @__PURE__ */ jsxs31(Fragment15, { children: [
21827
+ acc.push(/* @__PURE__ */ jsxs32(Fragment15, { children: [
21498
21828
  "/",
21499
21829
  shortenPeriod(period)
21500
21830
  ] }, index));
@@ -21503,8 +21833,8 @@ var UsageDetails = ({ entitlement, layout }) => {
21503
21833
  }
21504
21834
  if (metricResetAt) {
21505
21835
  acc.push(
21506
- /* @__PURE__ */ jsxs31(Fragment15, { children: [
21507
- acc.length > 0 && /* @__PURE__ */ jsx43(Fragment16, { children: " \u2022 " }),
21836
+ /* @__PURE__ */ jsxs32(Fragment15, { children: [
21837
+ acc.length > 0 && /* @__PURE__ */ jsx44(Fragment16, { children: " \u2022 " }),
21508
21838
  t3("Resets", {
21509
21839
  date: toPrettyDate(metricResetAt, {
21510
21840
  month: "numeric",
@@ -21543,8 +21873,8 @@ var UsageDetails = ({ entitlement, layout }) => {
21543
21873
  if (!text && !usageText || !feature) {
21544
21874
  return null;
21545
21875
  }
21546
- return /* @__PURE__ */ jsxs31(Fragment16, { children: [
21547
- layout.entitlement.isVisible && /* @__PURE__ */ jsx43(
21876
+ return /* @__PURE__ */ jsxs32(Fragment16, { children: [
21877
+ layout.entitlement.isVisible && /* @__PURE__ */ jsx44(
21548
21878
  Flex,
21549
21879
  {
21550
21880
  $marginTop: "0.75rem",
@@ -21554,9 +21884,9 @@ var UsageDetails = ({ entitlement, layout }) => {
21554
21884
  $marginTop: 0
21555
21885
  }
21556
21886
  },
21557
- children: /* @__PURE__ */ jsxs31(Text, { display: layout.entitlement.fontStyle, children: [
21887
+ children: /* @__PURE__ */ jsxs32(Text, { display: layout.entitlement.fontStyle, children: [
21558
21888
  text,
21559
- entitlementHasHardLimit(entitlement) && entitlement.allocationType === EntitlementValueType.Numeric && /* @__PURE__ */ jsx43(
21889
+ entitlementHasHardLimit(entitlement) && entitlement.allocationType === EntitlementValueType.Numeric && /* @__PURE__ */ jsx44(
21560
21890
  HardLimitTooltip,
21561
21891
  {
21562
21892
  feature: entitlement.feature,
@@ -21566,7 +21896,7 @@ var UsageDetails = ({ entitlement, layout }) => {
21566
21896
  ] })
21567
21897
  }
21568
21898
  ),
21569
- layout.usage.isVisible && usageText && /* @__PURE__ */ jsx43(
21899
+ layout.usage.isVisible && usageText && /* @__PURE__ */ jsx44(
21570
21900
  Flex,
21571
21901
  {
21572
21902
  $viewport: {
@@ -21574,9 +21904,9 @@ var UsageDetails = ({ entitlement, layout }) => {
21574
21904
  $justifyContent: "end"
21575
21905
  }
21576
21906
  },
21577
- children: /* @__PURE__ */ jsxs31(Text, { display: layout.usage.fontStyle, children: [
21907
+ children: /* @__PURE__ */ jsxs32(Text, { display: layout.usage.fontStyle, children: [
21578
21908
  usageText,
21579
- (priceBehavior === EntitlementPriceBehavior.Tier || tiered) && /* @__PURE__ */ jsx43(
21909
+ (priceBehavior === EntitlementPriceBehavior.Tier || tiered) && /* @__PURE__ */ jsx44(
21580
21910
  PricingTiersTooltip,
21581
21911
  {
21582
21912
  feature,
@@ -21593,7 +21923,7 @@ var UsageDetails = ({ entitlement, layout }) => {
21593
21923
  };
21594
21924
 
21595
21925
  // src/components/elements/included-features/IncludedFeatures.tsx
21596
- import { jsx as jsx44, jsxs as jsxs32 } from "react/jsx-runtime";
21926
+ import { jsx as jsx45, jsxs as jsxs33 } from "react/jsx-runtime";
21597
21927
  function resolveDesignProps2(props) {
21598
21928
  return {
21599
21929
  // there is a typescript bug with `DeepPartial` so we must cast to `string[] | undefined`
@@ -21668,9 +21998,9 @@ var IncludedFeatures = forwardRef10(({ className, ...rest }, ref) => {
21668
21998
  }
21669
21999
  const shouldShowExpand = featureListSize > VISIBLE_ENTITLEMENT_COUNT;
21670
22000
  const isExpanded = showCount > VISIBLE_ENTITLEMENT_COUNT;
21671
- return /* @__PURE__ */ jsxs32(Element, { ref, className, $containerType: "inline-size", children: [
21672
- props.header.isVisible && /* @__PURE__ */ jsx44(Box, { $marginBottom: "1.5rem", children: /* @__PURE__ */ jsx44(Text, { display: props.header.fontStyle, children: props.header.text }) }),
21673
- /* @__PURE__ */ jsx44(
22001
+ return /* @__PURE__ */ jsxs33(Element, { ref, className, $containerType: "inline-size", children: [
22002
+ props.header.isVisible && /* @__PURE__ */ jsx45(Box, { $marginBottom: "1.5rem", children: /* @__PURE__ */ jsx45(Text, { display: props.header.fontStyle, children: props.header.text }) }),
22003
+ /* @__PURE__ */ jsx45(
21674
22004
  Box,
21675
22005
  {
21676
22006
  $display: "grid",
@@ -21683,8 +22013,8 @@ var IncludedFeatures = forwardRef10(({ className, ...rest }, ref) => {
21683
22013
  }
21684
22014
  },
21685
22015
  children: featureUsage.slice(0, showCount).map((entitlement, index) => {
21686
- return /* @__PURE__ */ jsxs32(Fragment17, { children: [
21687
- props.icons.isVisible && entitlement.feature?.icon && /* @__PURE__ */ jsx44(
22016
+ return /* @__PURE__ */ jsxs33(Fragment17, { children: [
22017
+ props.icons.isVisible && entitlement.feature?.icon && /* @__PURE__ */ jsx45(
21688
22018
  Icon3,
21689
22019
  {
21690
22020
  name: entitlement.feature.icon,
@@ -21694,16 +22024,16 @@ var IncludedFeatures = forwardRef10(({ className, ...rest }, ref) => {
21694
22024
  style: { marginRight: "0.5rem" }
21695
22025
  }
21696
22026
  ),
21697
- /* @__PURE__ */ jsxs32(
22027
+ /* @__PURE__ */ jsxs33(
21698
22028
  Flex,
21699
22029
  {
21700
22030
  $flexDirection: "column",
21701
22031
  $alignSelf: "baseline",
21702
22032
  $gap: "0.25rem",
21703
22033
  children: [
21704
- entitlement.feature?.name && /* @__PURE__ */ jsx44(Text, { display: props.icons.fontStyle, children: entitlement.feature.name }),
21705
- props.description.isVisible && entitlement.feature?.description && /* @__PURE__ */ jsx44(Text, { display: props.description.fontStyle, children: entitlement.feature.description }),
21706
- props.entitlementExpiration.isVisible && entitlement.entitlementExpirationDate && /* @__PURE__ */ jsx44(
22034
+ entitlement.feature?.name && /* @__PURE__ */ jsx45(Text, { display: props.icons.fontStyle, children: entitlement.feature.name }),
22035
+ props.description.isVisible && entitlement.feature?.description && /* @__PURE__ */ jsx45(Text, { display: props.description.fontStyle, children: entitlement.feature.description }),
22036
+ props.entitlementExpiration.isVisible && entitlement.entitlementExpirationDate && /* @__PURE__ */ jsx45(
21707
22037
  Text,
21708
22038
  {
21709
22039
  as: "em",
@@ -21721,7 +22051,7 @@ var IncludedFeatures = forwardRef10(({ className, ...rest }, ref) => {
21721
22051
  ]
21722
22052
  }
21723
22053
  ),
21724
- /* @__PURE__ */ jsx44(
22054
+ /* @__PURE__ */ jsx45(
21725
22055
  Flex,
21726
22056
  {
21727
22057
  $gridColumn: "span 2",
@@ -21738,22 +22068,22 @@ var IncludedFeatures = forwardRef10(({ className, ...rest }, ref) => {
21738
22068
  $marginLeft: 0
21739
22069
  }
21740
22070
  },
21741
- children: /* @__PURE__ */ jsx44(UsageDetails, { entitlement, layout: props })
22071
+ children: /* @__PURE__ */ jsx45(UsageDetails, { entitlement, layout: props })
21742
22072
  }
21743
22073
  )
21744
22074
  ] }, index);
21745
22075
  })
21746
22076
  }
21747
22077
  ),
21748
- shouldShowExpand && /* @__PURE__ */ jsxs32(Flex, { $alignItems: "center", $marginTop: "1rem", children: [
21749
- /* @__PURE__ */ jsx44(
22078
+ shouldShowExpand && /* @__PURE__ */ jsxs33(Flex, { $alignItems: "center", $marginTop: "1rem", children: [
22079
+ /* @__PURE__ */ jsx45(
21750
22080
  Icon3,
21751
22081
  {
21752
22082
  name: isExpanded ? "chevron-up" : "chevron-down",
21753
22083
  color: "#D0D0D0"
21754
22084
  }
21755
22085
  ),
21756
- /* @__PURE__ */ jsx44(
22086
+ /* @__PURE__ */ jsx45(
21757
22087
  Text,
21758
22088
  {
21759
22089
  onClick: handleToggleShowAll,
@@ -21769,7 +22099,7 @@ IncludedFeatures.displayName = "IncludedFeatures";
21769
22099
 
21770
22100
  // src/components/elements/invoices/Invoices.tsx
21771
22101
  import { forwardRef as forwardRef11, useCallback as useCallback11, useEffect as useEffect6, useState as useState16 } from "react";
21772
- import { Fragment as Fragment18, jsx as jsx45, jsxs as jsxs33 } from "react/jsx-runtime";
22102
+ import { Fragment as Fragment18, jsx as jsx46, jsxs as jsxs34 } from "react/jsx-runtime";
21773
22103
  function resolveDesignProps3(props) {
21774
22104
  return {
21775
22105
  header: {
@@ -21872,9 +22202,9 @@ var Invoices = forwardRef11(({ className, ...rest }, ref) => {
21872
22202
  if (invoices.length === 0) {
21873
22203
  return null;
21874
22204
  }
21875
- return /* @__PURE__ */ jsxs33(Element, { ref, className, children: [
21876
- /* @__PURE__ */ jsx45(Flex, { as: TransitionBox, $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ jsx45(Loader, { $color: settings.theme.primary, $isLoading: isLoading }) }),
21877
- error ? /* @__PURE__ */ jsxs33(
22205
+ return /* @__PURE__ */ jsxs34(Element, { ref, className, children: [
22206
+ /* @__PURE__ */ jsx46(Flex, { as: TransitionBox, $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ jsx46(Loader, { $color: settings.theme.primary, $isLoading: isLoading }) }),
22207
+ error ? /* @__PURE__ */ jsxs34(
21878
22208
  Flex,
21879
22209
  {
21880
22210
  as: TransitionBox,
@@ -21883,8 +22213,8 @@ var Invoices = forwardRef11(({ className, ...rest }, ref) => {
21883
22213
  $alignItems: "center",
21884
22214
  $gap: "1rem",
21885
22215
  children: [
21886
- /* @__PURE__ */ jsx45(Text, { $weight: 500, $color: "#DB6669", children: t3("There was a problem retrieving your invoices.") }),
21887
- /* @__PURE__ */ jsx45(
22216
+ /* @__PURE__ */ jsx46(Text, { $weight: 500, $color: "#DB6669", children: t3("There was a problem retrieving your invoices.") }),
22217
+ /* @__PURE__ */ jsx46(
21888
22218
  Button,
21889
22219
  {
21890
22220
  type: "button",
@@ -21897,17 +22227,17 @@ var Invoices = forwardRef11(({ className, ...rest }, ref) => {
21897
22227
  )
21898
22228
  ]
21899
22229
  }
21900
- ) : !isLoading && /* @__PURE__ */ jsx45(TransitionBox, { children: /* @__PURE__ */ jsxs33(Flex, { $flexDirection: "column", $gap: "1rem", children: [
21901
- props.header.isVisible && /* @__PURE__ */ jsx45(Flex, { $justifyContent: "space-between", $alignItems: "center", children: /* @__PURE__ */ jsx45(Text, { display: props.header.fontStyle, children: t3("Invoices") }) }),
21902
- invoices.length > 0 ? /* @__PURE__ */ jsxs33(Fragment18, { children: [
21903
- /* @__PURE__ */ jsx45(Flex, { $flexDirection: "column", $gap: "0.5rem", children: invoices.slice(0, listSize).map(({ date, amount, amountDue, url }, index) => {
21904
- return /* @__PURE__ */ jsxs33(
22230
+ ) : !isLoading && /* @__PURE__ */ jsx46(TransitionBox, { children: /* @__PURE__ */ jsxs34(Flex, { $flexDirection: "column", $gap: "1rem", children: [
22231
+ props.header.isVisible && /* @__PURE__ */ jsx46(Flex, { $justifyContent: "space-between", $alignItems: "center", children: /* @__PURE__ */ jsx46(Text, { display: props.header.fontStyle, children: t3("Invoices") }) }),
22232
+ invoices.length > 0 ? /* @__PURE__ */ jsxs34(Fragment18, { children: [
22233
+ /* @__PURE__ */ jsx46(Flex, { $flexDirection: "column", $gap: "0.5rem", children: invoices.slice(0, listSize).map(({ date, amount, amountDue, url }, index) => {
22234
+ return /* @__PURE__ */ jsxs34(
21905
22235
  Flex,
21906
22236
  {
21907
22237
  $justifyContent: "space-between",
21908
22238
  $alignItems: "center",
21909
22239
  children: [
21910
- props.date.isVisible && /* @__PURE__ */ jsx45(
22240
+ props.date.isVisible && /* @__PURE__ */ jsx46(
21911
22241
  Text,
21912
22242
  {
21913
22243
  display: props.date.fontStyle,
@@ -21921,10 +22251,10 @@ var Invoices = forwardRef11(({ className, ...rest }, ref) => {
21921
22251
  children: date
21922
22252
  }
21923
22253
  ),
21924
- props.amount.isVisible && /* @__PURE__ */ jsx45(
22254
+ props.amount.isVisible && /* @__PURE__ */ jsx46(
21925
22255
  Tooltip,
21926
22256
  {
21927
- trigger: /* @__PURE__ */ jsx45(Text, { display: props.amount.fontStyle, children: amount }),
22257
+ trigger: /* @__PURE__ */ jsx46(Text, { display: props.amount.fontStyle, children: amount }),
21928
22258
  content: amountDue < 0 ? t3("Invoice credit tooltip") : t3("Invoice charge tooltip")
21929
22259
  }
21930
22260
  )
@@ -21933,15 +22263,15 @@ var Invoices = forwardRef11(({ className, ...rest }, ref) => {
21933
22263
  index
21934
22264
  );
21935
22265
  }) }),
21936
- props.collapse.isVisible && invoices.length > props.limit.number && /* @__PURE__ */ jsxs33(Flex, { $alignItems: "center", $gap: "0.5rem", children: [
21937
- /* @__PURE__ */ jsx45(
22266
+ props.collapse.isVisible && invoices.length > props.limit.number && /* @__PURE__ */ jsxs34(Flex, { $alignItems: "center", $gap: "0.5rem", children: [
22267
+ /* @__PURE__ */ jsx46(
21938
22268
  Icon3,
21939
22269
  {
21940
22270
  name: `chevron-${listSize === props.limit.number ? "down" : "up"}`,
21941
22271
  color: "#D0D0D0"
21942
22272
  }
21943
22273
  ),
21944
- /* @__PURE__ */ jsx45(
22274
+ /* @__PURE__ */ jsx46(
21945
22275
  Text,
21946
22276
  {
21947
22277
  onClick: toggleListSize,
@@ -21953,7 +22283,7 @@ var Invoices = forwardRef11(({ className, ...rest }, ref) => {
21953
22283
  }
21954
22284
  )
21955
22285
  ] })
21956
- ] }) : /* @__PURE__ */ jsx45(Text, { display: "heading2", children: t3("No invoices created yet") })
22286
+ ] }) : /* @__PURE__ */ jsx46(Text, { display: "heading2", children: t3("No invoices created yet") })
21957
22287
  ] }) })
21958
22288
  ] });
21959
22289
  });
@@ -21963,7 +22293,7 @@ Invoices.displayName = "Invoices";
21963
22293
  import { forwardRef as forwardRef12, useCallback as useCallback12, useMemo as useMemo22, useRef as useRef12, useState as useState17 } from "react";
21964
22294
 
21965
22295
  // src/components/elements/metered-features/Meter.tsx
21966
- import { jsx as jsx46 } from "react/jsx-runtime";
22296
+ import { jsx as jsx47 } from "react/jsx-runtime";
21967
22297
  var Meter = ({ entitlement }) => {
21968
22298
  const { allocation, priceBehavior, softLimit, usage } = entitlement;
21969
22299
  const limit = softLimit ?? allocation;
@@ -21971,7 +22301,7 @@ var Meter = ({ entitlement }) => {
21971
22301
  return null;
21972
22302
  }
21973
22303
  const progress = (priceBehavior === EntitlementPriceBehavior.Overage && usage > limit ? Math.min(usage, limit) / Math.max(usage, limit) : usage / limit) * 100;
21974
- const meter = /* @__PURE__ */ jsx46(
22304
+ const meter = /* @__PURE__ */ jsx47(
21975
22305
  ProgressBar,
21976
22306
  {
21977
22307
  progress,
@@ -21988,7 +22318,7 @@ var Meter = ({ entitlement }) => {
21988
22318
  };
21989
22319
 
21990
22320
  // src/components/elements/metered-features/PriceDetails.tsx
21991
- import { Fragment as Fragment19, jsx as jsx47, jsxs as jsxs34 } from "react/jsx-runtime";
22321
+ import { Fragment as Fragment19, jsx as jsx48, jsxs as jsxs35 } from "react/jsx-runtime";
21992
22322
  var PriceDetails = ({
21993
22323
  entitlement,
21994
22324
  usageDetails,
@@ -22015,7 +22345,7 @@ var PriceDetails = ({
22015
22345
  if (!feature || typeof currentTierPerUnitPrice !== "number") {
22016
22346
  return null;
22017
22347
  }
22018
- return /* @__PURE__ */ jsxs34(
22348
+ return /* @__PURE__ */ jsxs35(
22019
22349
  Flex,
22020
22350
  {
22021
22351
  $justifyContent: "space-between",
@@ -22029,28 +22359,28 @@ var PriceDetails = ({
22029
22359
  $borderBottomRightRadius: `${settings.theme.card.borderRadius / TEXT_BASE_SIZE}rem`
22030
22360
  },
22031
22361
  children: [
22032
- priceBehavior === EntitlementPriceBehavior.Overage ? /* @__PURE__ */ jsxs34(Text, { children: [
22362
+ priceBehavior === EntitlementPriceBehavior.Overage ? /* @__PURE__ */ jsxs35(Text, { children: [
22033
22363
  t3("Additional"),
22034
22364
  ": ",
22035
22365
  formatCurrency(currentTierPerUnitPrice, currency),
22036
- /* @__PURE__ */ jsxs34(Box, { as: "sub", $whiteSpace: "nowrap", children: [
22366
+ /* @__PURE__ */ jsxs35(Box, { as: "sub", $whiteSpace: "nowrap", children: [
22037
22367
  "/",
22038
- packageSize > 1 && /* @__PURE__ */ jsxs34(Fragment19, { children: [
22368
+ packageSize > 1 && /* @__PURE__ */ jsxs35(Fragment19, { children: [
22039
22369
  packageSize,
22040
22370
  " "
22041
22371
  ] }),
22042
22372
  getFeatureName(feature, packageSize),
22043
- feature.featureType === FeatureType.Trait && period && /* @__PURE__ */ jsxs34(Fragment19, { children: [
22373
+ feature.featureType === FeatureType.Trait && period && /* @__PURE__ */ jsxs35(Fragment19, { children: [
22044
22374
  "/",
22045
22375
  shortenPeriod(period)
22046
22376
  ] })
22047
22377
  ] })
22048
- ] }) : priceBehavior === EntitlementPriceBehavior.Tier && /* @__PURE__ */ jsxs34(Text, { children: [
22378
+ ] }) : priceBehavior === EntitlementPriceBehavior.Tier && /* @__PURE__ */ jsxs35(Text, { children: [
22049
22379
  t3("Tier"),
22050
22380
  ": ",
22051
22381
  currentTier?.from || 1,
22052
- typeof currentTier?.to === "number" && (currentTier.from || 1) !== currentTier.to && /* @__PURE__ */ jsx47(Fragment19, { children: currentTier.to === Infinity ? "+" : `\u2013${currentTier.to}` }),
22053
- /* @__PURE__ */ jsx47(
22382
+ typeof currentTier?.to === "number" && (currentTier.from || 1) !== currentTier.to && /* @__PURE__ */ jsx48(Fragment19, { children: currentTier.to === Infinity ? "+" : `\u2013${currentTier.to}` }),
22383
+ /* @__PURE__ */ jsx48(
22054
22384
  PricingTiersTooltip,
22055
22385
  {
22056
22386
  period,
@@ -22061,19 +22391,19 @@ var PriceDetails = ({
22061
22391
  }
22062
22392
  )
22063
22393
  ] }),
22064
- typeof amount === "number" && /* @__PURE__ */ jsx47(Fragment19, { children: priceBehavior === EntitlementPriceBehavior.Overage ? /* @__PURE__ */ jsxs34(Text, { children: [
22394
+ typeof amount === "number" && /* @__PURE__ */ jsx48(Fragment19, { children: priceBehavior === EntitlementPriceBehavior.Overage ? /* @__PURE__ */ jsxs35(Text, { children: [
22065
22395
  formatNumber(amount),
22066
22396
  " ",
22067
22397
  getFeatureName(feature, amount),
22068
22398
  " \xB7 ",
22069
22399
  formatCurrency(currentTierPerUnitPrice * amount, currency),
22070
- feature.featureType === FeatureType.Trait && typeof period === "string" && /* @__PURE__ */ jsxs34(Box, { as: "sub", $whiteSpace: "nowrap", children: [
22400
+ feature.featureType === FeatureType.Trait && typeof period === "string" && /* @__PURE__ */ jsxs35(Box, { as: "sub", $whiteSpace: "nowrap", children: [
22071
22401
  "/",
22072
22402
  shortenPeriod(period)
22073
22403
  ] })
22074
- ] }) : priceBehavior === EntitlementPriceBehavior.Tier && typeof cost === "number" && /* @__PURE__ */ jsxs34(Text, { children: [
22404
+ ] }) : priceBehavior === EntitlementPriceBehavior.Tier && typeof cost === "number" && /* @__PURE__ */ jsxs35(Text, { children: [
22075
22405
  formatCurrency(cost, currency),
22076
- feature.featureType === FeatureType.Trait && typeof period === "string" && /* @__PURE__ */ jsxs34(Box, { as: "sub", $whiteSpace: "nowrap", children: [
22406
+ feature.featureType === FeatureType.Trait && typeof period === "string" && /* @__PURE__ */ jsxs35(Box, { as: "sub", $whiteSpace: "nowrap", children: [
22077
22407
  "/",
22078
22408
  shortenPeriod(period)
22079
22409
  ] })
@@ -22101,7 +22431,7 @@ var Container2 = gt2.div`
22101
22431
  `;
22102
22432
 
22103
22433
  // src/components/elements/metered-features/MeteredFeatures.tsx
22104
- import { Fragment as Fragment20, jsx as jsx48, jsxs as jsxs35 } from "react/jsx-runtime";
22434
+ import { Fragment as Fragment20, jsx as jsx49, jsxs as jsxs36 } from "react/jsx-runtime";
22105
22435
  var Limit = ({ entitlement, usageDetails, fontStyle }) => {
22106
22436
  const { t: t3 } = useTranslation();
22107
22437
  const { data } = useEmbed();
@@ -22147,9 +22477,9 @@ var Limit = ({ entitlement, usageDetails, fontStyle }) => {
22147
22477
  })
22148
22478
  );
22149
22479
  }
22150
- return /* @__PURE__ */ jsxs35(Text, { display: fontStyle, children: [
22480
+ return /* @__PURE__ */ jsxs36(Text, { display: fontStyle, children: [
22151
22481
  acc.join(" \u2022 "),
22152
- entitlementHasHardLimit(entitlement) && entitlement.allocationType === EntitlementValueType.Numeric && /* @__PURE__ */ jsx48(
22482
+ entitlementHasHardLimit(entitlement) && entitlement.allocationType === EntitlementValueType.Numeric && /* @__PURE__ */ jsx49(
22153
22483
  HardLimitTooltip,
22154
22484
  {
22155
22485
  feature: entitlement.feature,
@@ -22227,7 +22557,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
22227
22557
  const period = getSubscriptionPeriod(data?.company?.billingSubscription) ?? (typeof data?.company?.plan?.planPeriod === "string" ? data.company?.plan?.planPeriod : void 0);
22228
22558
  const canCheckout = data?.capabilities?.checkout ?? false;
22229
22559
  const showCredits = data?.displaySettings?.showCredits ?? true;
22230
- return /* @__PURE__ */ jsxs35(Container2, { ref, className, children: [
22560
+ return /* @__PURE__ */ jsxs36(Container2, { ref, className, children: [
22231
22561
  meteredFeatures.reduce((acc, entitlement, index) => {
22232
22562
  if (!entitlement.feature) {
22233
22563
  return acc;
@@ -22236,9 +22566,9 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
22236
22566
  const usageDetails = getUsageDetails(entitlement, period);
22237
22567
  const { limit } = usageDetails;
22238
22568
  acc.push(
22239
- /* @__PURE__ */ jsxs35(Element, { as: Flex, $flexDirection: "column", $gap: "1.5rem", children: [
22240
- /* @__PURE__ */ jsxs35(Flex, { $gap: "1.5rem", children: [
22241
- props.icon.isVisible && /* @__PURE__ */ jsx48(
22569
+ /* @__PURE__ */ jsxs36(Element, { as: Flex, $flexDirection: "column", $gap: "1.5rem", children: [
22570
+ /* @__PURE__ */ jsxs36(Flex, { $gap: "1.5rem", children: [
22571
+ props.icon.isVisible && /* @__PURE__ */ jsx49(
22242
22572
  Icon3,
22243
22573
  {
22244
22574
  name: feature.icon,
@@ -22247,8 +22577,8 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
22247
22577
  rounded: true
22248
22578
  }
22249
22579
  ),
22250
- /* @__PURE__ */ jsxs35(Flex, { $flexDirection: "column", $gap: "2rem", $flexGrow: 1, children: [
22251
- /* @__PURE__ */ jsxs35(
22580
+ /* @__PURE__ */ jsxs36(Flex, { $flexDirection: "column", $gap: "2rem", $flexGrow: 1, children: [
22581
+ /* @__PURE__ */ jsxs36(
22252
22582
  Flex,
22253
22583
  {
22254
22584
  ref: (el) => {
@@ -22259,31 +22589,31 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
22259
22589
  $flexWrap: "wrap",
22260
22590
  $gap: "1rem",
22261
22591
  children: [
22262
- /* @__PURE__ */ jsxs35(Flex, { $flexDirection: "column", $gap: "0.5rem", $flexGrow: 1, children: [
22263
- /* @__PURE__ */ jsx48(Box, { children: /* @__PURE__ */ jsx48(Text, { display: props.header.fontStyle, children: feature.name }) }),
22264
- props.description.isVisible && feature.description && /* @__PURE__ */ jsx48(Box, { children: /* @__PURE__ */ jsx48(Text, { display: props.description.fontStyle, children: feature.description }) })
22592
+ /* @__PURE__ */ jsxs36(Flex, { $flexDirection: "column", $gap: "0.5rem", $flexGrow: 1, children: [
22593
+ /* @__PURE__ */ jsx49(Box, { children: /* @__PURE__ */ jsx49(Text, { display: props.header.fontStyle, children: feature.name }) }),
22594
+ props.description.isVisible && feature.description && /* @__PURE__ */ jsx49(Box, { children: /* @__PURE__ */ jsx49(Text, { display: props.description.fontStyle, children: feature.description }) })
22265
22595
  ] }),
22266
- /* @__PURE__ */ jsxs35(
22596
+ /* @__PURE__ */ jsxs36(
22267
22597
  Box,
22268
22598
  {
22269
22599
  $flexBasis: "min-content",
22270
22600
  $flexGrow: 1,
22271
22601
  $textAlign: shouldWrapChildren ? "left" : "right",
22272
22602
  children: [
22273
- props.usage.isVisible && /* @__PURE__ */ jsx48(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsx48(Text, { display: props.usage.fontStyle, children: priceBehavior === EntitlementPriceBehavior.PayInAdvance ? /* @__PURE__ */ jsxs35(Fragment20, { children: [
22274
- typeof limit === "number" && /* @__PURE__ */ jsxs35(Fragment20, { children: [
22603
+ props.usage.isVisible && /* @__PURE__ */ jsx49(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsx49(Text, { display: props.usage.fontStyle, children: priceBehavior === EntitlementPriceBehavior.PayInAdvance ? /* @__PURE__ */ jsxs36(Fragment20, { children: [
22604
+ typeof limit === "number" && /* @__PURE__ */ jsxs36(Fragment20, { children: [
22275
22605
  formatNumber(limit),
22276
22606
  " "
22277
22607
  ] }),
22278
22608
  getFeatureName(feature, limit)
22279
- ] }) : typeof usage === "number" && /* @__PURE__ */ jsxs35(Fragment20, { children: [
22609
+ ] }) : typeof usage === "number" && /* @__PURE__ */ jsxs36(Fragment20, { children: [
22280
22610
  formatNumber(usage),
22281
22611
  " ",
22282
22612
  getFeatureName(feature, usage),
22283
22613
  " ",
22284
22614
  t3("used")
22285
22615
  ] }) }) }),
22286
- props.allocation.isVisible && /* @__PURE__ */ jsx48(
22616
+ props.allocation.isVisible && /* @__PURE__ */ jsx49(
22287
22617
  Limit,
22288
22618
  {
22289
22619
  entitlement,
@@ -22297,8 +22627,8 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
22297
22627
  ]
22298
22628
  }
22299
22629
  ),
22300
- props.isVisible && priceBehavior !== EntitlementPriceBehavior.PayAsYouGo && priceBehavior !== EntitlementPriceBehavior.CreditBurndown && /* @__PURE__ */ jsx48(Meter, { entitlement }),
22301
- canCheckout && priceBehavior === EntitlementPriceBehavior.PayInAdvance && /* @__PURE__ */ jsx48(
22630
+ props.isVisible && priceBehavior !== EntitlementPriceBehavior.PayAsYouGo && priceBehavior !== EntitlementPriceBehavior.CreditBurndown && /* @__PURE__ */ jsx49(Meter, { entitlement }),
22631
+ canCheckout && priceBehavior === EntitlementPriceBehavior.PayInAdvance && /* @__PURE__ */ jsx49(
22302
22632
  Button,
22303
22633
  {
22304
22634
  type: "button",
@@ -22311,7 +22641,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
22311
22641
  )
22312
22642
  ] })
22313
22643
  ] }),
22314
- (priceBehavior === EntitlementPriceBehavior.Overage || priceBehavior === EntitlementPriceBehavior.Tier) && /* @__PURE__ */ jsx48(
22644
+ (priceBehavior === EntitlementPriceBehavior.Overage || priceBehavior === EntitlementPriceBehavior.Tier) && /* @__PURE__ */ jsx49(
22315
22645
  PriceDetails,
22316
22646
  {
22317
22647
  entitlement,
@@ -22325,9 +22655,9 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
22325
22655
  }, []),
22326
22656
  showCredits && creditGroups.map((credit, index) => {
22327
22657
  const isExpanded = creditVisibility.find(({ id }) => credit.id === id)?.isExpanded ?? false;
22328
- return /* @__PURE__ */ jsxs35(Element, { as: Flex, $flexDirection: "column", $gap: "1rem", children: [
22329
- /* @__PURE__ */ jsxs35(Flex, { $gap: "1.5rem", children: [
22330
- props.icon.isVisible && /* @__PURE__ */ jsx48(
22658
+ return /* @__PURE__ */ jsxs36(Element, { as: Flex, $flexDirection: "column", $gap: "1rem", children: [
22659
+ /* @__PURE__ */ jsxs36(Flex, { $gap: "1.5rem", children: [
22660
+ props.icon.isVisible && /* @__PURE__ */ jsx49(
22331
22661
  Icon3,
22332
22662
  {
22333
22663
  name: credit.icon,
@@ -22336,13 +22666,13 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
22336
22666
  rounded: true
22337
22667
  }
22338
22668
  ),
22339
- /* @__PURE__ */ jsxs35(Flex, { $flexDirection: "column", $gap: "2rem", $flexGrow: 1, children: [
22340
- /* @__PURE__ */ jsx48(Flex, { $flexWrap: "wrap", $gap: "1rem", children: /* @__PURE__ */ jsxs35(Flex, { $flexDirection: "column", $gap: "0.5rem", $flexGrow: 1, children: [
22341
- /* @__PURE__ */ jsx48(Box, { children: /* @__PURE__ */ jsx48(Text, { display: props.header.fontStyle, children: credit.name }) }),
22342
- props.description.isVisible && credit.description && /* @__PURE__ */ jsx48(Box, { children: /* @__PURE__ */ jsx48(Text, { display: props.description.fontStyle, children: credit.description }) })
22669
+ /* @__PURE__ */ jsxs36(Flex, { $flexDirection: "column", $gap: "2rem", $flexGrow: 1, children: [
22670
+ /* @__PURE__ */ jsx49(Flex, { $flexWrap: "wrap", $gap: "1rem", children: /* @__PURE__ */ jsxs36(Flex, { $flexDirection: "column", $gap: "0.5rem", $flexGrow: 1, children: [
22671
+ /* @__PURE__ */ jsx49(Box, { children: /* @__PURE__ */ jsx49(Text, { display: props.header.fontStyle, children: credit.name }) }),
22672
+ props.description.isVisible && credit.description && /* @__PURE__ */ jsx49(Box, { children: /* @__PURE__ */ jsx49(Text, { display: props.description.fontStyle, children: credit.description }) })
22343
22673
  ] }) }),
22344
- /* @__PURE__ */ jsxs35(Flex, { $gap: "1rem", children: [
22345
- /* @__PURE__ */ jsx48(
22674
+ /* @__PURE__ */ jsxs36(Flex, { $gap: "1rem", children: [
22675
+ /* @__PURE__ */ jsx49(
22346
22676
  ProgressBar,
22347
22677
  {
22348
22678
  progress: credit.total.used / credit.total.value * 100,
@@ -22353,7 +22683,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
22353
22683
  )]
22354
22684
  }
22355
22685
  ),
22356
- canCheckout && /* @__PURE__ */ jsx48(
22686
+ canCheckout && /* @__PURE__ */ jsx49(
22357
22687
  Button,
22358
22688
  {
22359
22689
  type: "button",
@@ -22368,12 +22698,12 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
22368
22698
  ] })
22369
22699
  ] })
22370
22700
  ] }),
22371
- /* @__PURE__ */ jsx48(
22701
+ /* @__PURE__ */ jsx49(
22372
22702
  Box,
22373
22703
  {
22374
22704
  $width: `calc(100% + ${2 * settings.theme.card.padding / TEXT_BASE_SIZE}rem)`,
22375
22705
  $margin: `0 0 0 -${settings.theme.card.padding / TEXT_BASE_SIZE}rem`,
22376
- children: /* @__PURE__ */ jsx48(
22706
+ children: /* @__PURE__ */ jsx49(
22377
22707
  TransitionBox,
22378
22708
  {
22379
22709
  $backgroundColor: isLightBackground ? "hsla(0, 0%, 0%, 0.0375)" : "hsla(0, 0%, 100%, 0.075)",
@@ -22381,19 +22711,19 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
22381
22711
  children: credit.grants.map((grant, index2) => {
22382
22712
  const paddingX = settings.theme.card.padding / TEXT_BASE_SIZE;
22383
22713
  const padding = index2 > 0 ? `0 ${paddingX}rem 1rem` : `1rem ${paddingX}rem`;
22384
- return /* @__PURE__ */ jsx48(Box, { $display: "table-row", children: grant.grantReason === BillingCreditGrantReason.Plan ? /* @__PURE__ */ jsxs35(Fragment20, { children: [
22385
- /* @__PURE__ */ jsx48(Box, { $display: "table-cell", $padding: padding, children: /* @__PURE__ */ jsx48(Text, { children: t3("X items included in plan", {
22714
+ return /* @__PURE__ */ jsx49(Box, { $display: "table-row", children: grant.grantReason === BillingCreditGrantReason.Plan ? /* @__PURE__ */ jsxs36(Fragment20, { children: [
22715
+ /* @__PURE__ */ jsx49(Box, { $display: "table-cell", $padding: padding, children: /* @__PURE__ */ jsx49(Text, { children: t3("X items included in plan", {
22386
22716
  amount: grant.quantity,
22387
22717
  item: getFeatureName(credit, grant.quantity)
22388
22718
  }) }) }),
22389
- /* @__PURE__ */ jsx48(
22719
+ /* @__PURE__ */ jsx49(
22390
22720
  Box,
22391
22721
  {
22392
22722
  $display: "table-cell",
22393
22723
  $padding: padding,
22394
22724
  $textAlign: "right",
22395
22725
  $whiteSpace: "nowrap",
22396
- children: grant.expiresAt && /* @__PURE__ */ jsx48(Text, { children: t3("Resets", {
22726
+ children: grant.expiresAt && /* @__PURE__ */ jsx49(Text, { children: t3("Resets", {
22397
22727
  date: toPrettyDate(
22398
22728
  modifyDate(grant.expiresAt, 1),
22399
22729
  {
@@ -22405,8 +22735,8 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
22405
22735
  }) })
22406
22736
  }
22407
22737
  )
22408
- ] }) : /* @__PURE__ */ jsxs35(Fragment20, { children: [
22409
- /* @__PURE__ */ jsx48(Box, { $display: "table-cell", $padding: padding, children: /* @__PURE__ */ jsx48(Text, { children: grant.grantReason === BillingCreditGrantReason.Purchased ? /* @__PURE__ */ jsx48(Fragment20, { children: t3("X item bundle", {
22738
+ ] }) : /* @__PURE__ */ jsxs36(Fragment20, { children: [
22739
+ /* @__PURE__ */ jsx49(Box, { $display: "table-cell", $padding: padding, children: /* @__PURE__ */ jsx49(Text, { children: grant.grantReason === BillingCreditGrantReason.Purchased ? /* @__PURE__ */ jsx49(Fragment20, { children: t3("X item bundle", {
22410
22740
  amount: grant.quantity,
22411
22741
  item: getFeatureName(credit, 1),
22412
22742
  createdAt: toPrettyDate(grant.createdAt, {
@@ -22414,7 +22744,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
22414
22744
  month: "2-digit",
22415
22745
  year: "2-digit"
22416
22746
  })
22417
- }) }) : grant.grantReason === BillingCreditGrantReason.BillingCreditAutoTopup ? /* @__PURE__ */ jsx48(Fragment20, { children: t3("X item auto-topup", {
22747
+ }) }) : grant.grantReason === BillingCreditGrantReason.BillingCreditAutoTopup ? /* @__PURE__ */ jsx49(Fragment20, { children: t3("X item auto-topup", {
22418
22748
  amount: grant.quantity,
22419
22749
  item: getFeatureName(
22420
22750
  credit,
@@ -22425,7 +22755,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
22425
22755
  month: "2-digit",
22426
22756
  year: "2-digit"
22427
22757
  })
22428
- }) }) : /* @__PURE__ */ jsx48(Fragment20, { children: t3("X item grant", {
22758
+ }) }) : /* @__PURE__ */ jsx49(Fragment20, { children: t3("X item grant", {
22429
22759
  amount: grant.quantity,
22430
22760
  item: getFeatureName(
22431
22761
  credit,
@@ -22437,14 +22767,14 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
22437
22767
  year: "2-digit"
22438
22768
  })
22439
22769
  }) }) }) }),
22440
- /* @__PURE__ */ jsx48(
22770
+ /* @__PURE__ */ jsx49(
22441
22771
  Box,
22442
22772
  {
22443
22773
  $display: "table-cell",
22444
22774
  $padding: padding,
22445
22775
  $textAlign: "right",
22446
22776
  $whiteSpace: "nowrap",
22447
- children: grant.expiresAt && /* @__PURE__ */ jsx48(Text, { children: t3("Expires", {
22777
+ children: grant.expiresAt && /* @__PURE__ */ jsx49(Text, { children: t3("Expires", {
22448
22778
  date: toPrettyDate(
22449
22779
  modifyDate(grant.expiresAt, 1),
22450
22780
  {
@@ -22462,8 +22792,8 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
22462
22792
  )
22463
22793
  }
22464
22794
  ),
22465
- /* @__PURE__ */ jsxs35(Flex, { $gap: "0.25rem", children: [
22466
- /* @__PURE__ */ jsx48(
22795
+ /* @__PURE__ */ jsxs36(Flex, { $gap: "0.25rem", children: [
22796
+ /* @__PURE__ */ jsx49(
22467
22797
  Icon3,
22468
22798
  {
22469
22799
  name: "chevron-down",
@@ -22474,7 +22804,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
22474
22804
  }
22475
22805
  }
22476
22806
  ),
22477
- /* @__PURE__ */ jsx48(
22807
+ /* @__PURE__ */ jsx49(
22478
22808
  Text,
22479
22809
  {
22480
22810
  onClick: () => toggleBalanceDetails(credit.id),
@@ -22494,7 +22824,7 @@ import { forwardRef as forwardRef13, useMemo as useMemo24 } from "react";
22494
22824
 
22495
22825
  // src/components/elements/payment-method/PaymentMethodElement.tsx
22496
22826
  import { useMemo as useMemo23 } from "react";
22497
- import { jsx as jsx49, jsxs as jsxs36 } from "react/jsx-runtime";
22827
+ import { jsx as jsx50, jsxs as jsxs37 } from "react/jsx-runtime";
22498
22828
  var PaymentElement2 = ({
22499
22829
  iconName,
22500
22830
  iconTitle,
@@ -22502,8 +22832,8 @@ var PaymentElement2 = ({
22502
22832
  paymentLast4
22503
22833
  }) => {
22504
22834
  const { settings } = useEmbed();
22505
- return /* @__PURE__ */ jsxs36(Flex, { $flexDirection: "row", $alignItems: "center", $gap: "0.5rem", children: [
22506
- iconName && /* @__PURE__ */ jsx49(
22835
+ return /* @__PURE__ */ jsxs37(Flex, { $flexDirection: "row", $alignItems: "center", $gap: "0.5rem", children: [
22836
+ iconName && /* @__PURE__ */ jsx50(
22507
22837
  Icon3,
22508
22838
  {
22509
22839
  name: iconName,
@@ -22511,15 +22841,15 @@ var PaymentElement2 = ({
22511
22841
  color: settings.theme.typography.text.color
22512
22842
  }
22513
22843
  ),
22514
- (label || paymentLast4) && /* @__PURE__ */ jsxs36(Box, { $flexGrow: 1, children: [
22515
- label && /* @__PURE__ */ jsx49(Text, { children: label }),
22844
+ (label || paymentLast4) && /* @__PURE__ */ jsxs37(Box, { $flexGrow: 1, children: [
22845
+ label && /* @__PURE__ */ jsx50(Text, { children: label }),
22516
22846
  " ",
22517
- paymentLast4 && /* @__PURE__ */ jsx49(Text, { children: paymentLast4 })
22847
+ paymentLast4 && /* @__PURE__ */ jsx50(Text, { children: paymentLast4 })
22518
22848
  ] })
22519
22849
  ] });
22520
22850
  };
22521
22851
  var EmptyPaymentElement = () => {
22522
- return /* @__PURE__ */ jsx49(Text, { children: /* @__PURE__ */ jsx49(Flex, { $flexDirection: "row", $alignItems: "center", children: /* @__PURE__ */ jsx49(Flex, { $alignItems: "center", children: /* @__PURE__ */ jsx49(Box, { $lineHeight: 1, children: t("No payment method added yet") }) }) }) });
22852
+ return /* @__PURE__ */ jsx50(Text, { children: /* @__PURE__ */ jsx50(Flex, { $flexDirection: "row", $alignItems: "center", children: /* @__PURE__ */ jsx50(Flex, { $alignItems: "center", children: /* @__PURE__ */ jsx50(Box, { $lineHeight: 1, children: t("No payment method added yet") }) }) }) });
22523
22853
  };
22524
22854
  var getPaymentMethodData = ({
22525
22855
  accountLast4,
@@ -22585,12 +22915,12 @@ var PaymentMethodElement = ({
22585
22915
  const { t: t3 } = useTranslation();
22586
22916
  const isLightBackground = useIsLightBackground();
22587
22917
  const sizeFactor = size === "lg" ? 1.5 : size === "md" ? 1 : 0.5;
22588
- return /* @__PURE__ */ jsxs36(Flex, { $flexDirection: "column", $gap: `${sizeFactor}rem`, children: [
22589
- props.header.isVisible && /* @__PURE__ */ jsxs36(Flex, { $justifyContent: "space-between", $alignItems: "center", children: [
22590
- /* @__PURE__ */ jsx49(Text, { display: props.header.fontStyle, children: t3("Payment Method") }),
22591
- props.functions.showExpiration && typeof monthsToExpiration === "number" && monthsToExpiration < 4 && /* @__PURE__ */ jsx49(Text, { $size: 14, $color: "#DB6769", children: monthsToExpiration > 0 ? t3("Expires in X months", { months: monthsToExpiration }) : t3("Expired") })
22918
+ return /* @__PURE__ */ jsxs37(Flex, { $flexDirection: "column", $gap: `${sizeFactor}rem`, children: [
22919
+ props.header.isVisible && /* @__PURE__ */ jsxs37(Flex, { $justifyContent: "space-between", $alignItems: "center", children: [
22920
+ /* @__PURE__ */ jsx50(Text, { display: props.header.fontStyle, children: t3("Payment Method") }),
22921
+ props.functions.showExpiration && typeof monthsToExpiration === "number" && monthsToExpiration < 4 && /* @__PURE__ */ jsx50(Text, { $size: 14, $color: "#DB6769", children: monthsToExpiration > 0 ? t3("Expires in X months", { months: monthsToExpiration }) : t3("Expired") })
22592
22922
  ] }),
22593
- /* @__PURE__ */ jsxs36(
22923
+ /* @__PURE__ */ jsxs37(
22594
22924
  Flex,
22595
22925
  {
22596
22926
  $justifyContent: "space-between",
@@ -22599,8 +22929,8 @@ var PaymentMethodElement = ({
22599
22929
  $padding: `${sizeFactor / 2.25}rem ${sizeFactor}rem`,
22600
22930
  $borderRadius: "9999px",
22601
22931
  children: [
22602
- paymentMethod ? /* @__PURE__ */ jsx49(PaymentElement2, { ...getPaymentMethodData(paymentMethod) }) : /* @__PURE__ */ jsx49(EmptyPaymentElement, {}),
22603
- onRemove && /* @__PURE__ */ jsx49(
22932
+ paymentMethod ? /* @__PURE__ */ jsx50(PaymentElement2, { ...getPaymentMethodData(paymentMethod) }) : /* @__PURE__ */ jsx50(EmptyPaymentElement, {}),
22933
+ onRemove && /* @__PURE__ */ jsx50(
22604
22934
  Text,
22605
22935
  {
22606
22936
  onClick: onRemove,
@@ -22610,7 +22940,7 @@ var PaymentMethodElement = ({
22610
22940
  children: t3("Remove")
22611
22941
  }
22612
22942
  ),
22613
- props.functions.allowEdit && onEdit && /* @__PURE__ */ jsx49(
22943
+ props.functions.allowEdit && onEdit && /* @__PURE__ */ jsx50(
22614
22944
  Text,
22615
22945
  {
22616
22946
  onClick: onEdit,
@@ -22644,7 +22974,7 @@ var PaymentListElement = ({
22644
22974
  }
22645
22975
  return `${cardExpMonth}/${formatedYear}`;
22646
22976
  }, [paymentMethod]);
22647
- return /* @__PURE__ */ jsxs36(
22977
+ return /* @__PURE__ */ jsxs37(
22648
22978
  Flex,
22649
22979
  {
22650
22980
  $flexDirection: "row",
@@ -22656,7 +22986,7 @@ var PaymentListElement = ({
22656
22986
  $borderStyle: "solid",
22657
22987
  $borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.175)" : "hsla(0, 0%, 100%, 0.175)",
22658
22988
  children: [
22659
- iconName && /* @__PURE__ */ jsx49(
22989
+ iconName && /* @__PURE__ */ jsx50(
22660
22990
  Icon3,
22661
22991
  {
22662
22992
  name: iconName,
@@ -22664,20 +22994,20 @@ var PaymentListElement = ({
22664
22994
  color: settings.theme.typography.text.color
22665
22995
  }
22666
22996
  ),
22667
- (label || paymentLast4) && /* @__PURE__ */ jsxs36(Box, { $flexGrow: 1, children: [
22668
- label && /* @__PURE__ */ jsx49(Text, { children: label }),
22997
+ (label || paymentLast4) && /* @__PURE__ */ jsxs37(Box, { $flexGrow: 1, children: [
22998
+ label && /* @__PURE__ */ jsx50(Text, { children: label }),
22669
22999
  " ",
22670
- paymentLast4 && /* @__PURE__ */ jsx49(Text, { children: paymentLast4 })
23000
+ paymentLast4 && /* @__PURE__ */ jsx50(Text, { children: paymentLast4 })
22671
23001
  ] }),
22672
- expirationDate && /* @__PURE__ */ jsx49(
23002
+ expirationDate && /* @__PURE__ */ jsx50(
22673
23003
  Box,
22674
23004
  {
22675
23005
  $flexGrow: 1,
22676
23006
  $color: isLightBackground ? "hsla(0, 0%, 0%, 0.375)" : "hsla(0, 0%, 100%, 0.375)",
22677
- children: /* @__PURE__ */ jsx49(Text, { children: t("Expires", { date: expirationDate }) })
23007
+ children: /* @__PURE__ */ jsx50(Text, { children: t("Expires", { date: expirationDate }) })
22678
23008
  }
22679
23009
  ),
22680
- /* @__PURE__ */ jsx49(Box, { children: /* @__PURE__ */ jsx49(
23010
+ /* @__PURE__ */ jsx50(Box, { children: /* @__PURE__ */ jsx50(
22681
23011
  Text,
22682
23012
  {
22683
23013
  onClick: () => {
@@ -22690,7 +23020,7 @@ var PaymentListElement = ({
22690
23020
  children: t("Set default")
22691
23021
  }
22692
23022
  ) }),
22693
- /* @__PURE__ */ jsx49(
23023
+ /* @__PURE__ */ jsx50(
22694
23024
  Icon3,
22695
23025
  {
22696
23026
  tabIndex: 0,
@@ -22712,7 +23042,7 @@ var PaymentListElement = ({
22712
23042
  };
22713
23043
 
22714
23044
  // src/components/elements/payment-method/PaymentMethod.tsx
22715
- import { jsx as jsx50 } from "react/jsx-runtime";
23045
+ import { jsx as jsx51 } from "react/jsx-runtime";
22716
23046
  var resolveDesignProps5 = (props) => {
22717
23047
  return {
22718
23048
  header: {
@@ -22747,7 +23077,7 @@ var PaymentMethod = forwardRef13(({ children, className, portal, allowEdit = tru
22747
23077
  monthsToExpiration: monthsToExpiration2
22748
23078
  };
22749
23079
  }, [data?.company?.defaultPaymentMethod, data?.subscription?.paymentMethod]);
22750
- return /* @__PURE__ */ jsx50(Element, { ref, className, children: /* @__PURE__ */ jsx50(
23080
+ return /* @__PURE__ */ jsx51(Element, { ref, className, children: /* @__PURE__ */ jsx51(
22751
23081
  PaymentMethodElement,
22752
23082
  {
22753
23083
  paymentMethod,
@@ -22816,7 +23146,7 @@ var registerWrapper = function registerWrapper2(stripe, startTime) {
22816
23146
  }
22817
23147
  stripe._registerWrapper({
22818
23148
  name: "stripe-js",
22819
- version: "9.6.0",
23149
+ version: "9.7.0",
22820
23150
  startTime
22821
23151
  });
22822
23152
  };
@@ -22894,7 +23224,7 @@ var initStripe = function initStripe2(maybeStripe, args, startTime) {
22894
23224
  var version = runtimeVersionToUrlVersion(maybeStripe.version);
22895
23225
  var expectedVersion = RELEASE_TRAIN;
22896
23226
  if (isTestKey && version !== expectedVersion) {
22897
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.6.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
23227
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.7.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
22898
23228
  }
22899
23229
  var stripe = maybeStripe.apply(void 0, args);
22900
23230
  registerWrapper(stripe, startTime);
@@ -22932,7 +23262,7 @@ var loadStripe = function loadStripe2() {
22932
23262
 
22933
23263
  // src/components/elements/payment-method/PaymentMethodDetails.tsx
22934
23264
  import { useCallback as useCallback13, useEffect as useEffect7, useMemo as useMemo25, useState as useState18 } from "react";
22935
- import { jsx as jsx51, jsxs as jsxs37 } from "react/jsx-runtime";
23265
+ import { jsx as jsx52, jsxs as jsxs38 } from "react/jsx-runtime";
22936
23266
  var resolveDesignProps6 = () => {
22937
23267
  return {
22938
23268
  header: {
@@ -23104,7 +23434,7 @@ var PaymentMethodDetails = ({
23104
23434
  showPaymentForm,
23105
23435
  initializePaymentMethod
23106
23436
  ]);
23107
- return /* @__PURE__ */ jsxs37(
23437
+ return /* @__PURE__ */ jsxs38(
23108
23438
  Flex,
23109
23439
  {
23110
23440
  $position: "relative",
@@ -23112,7 +23442,7 @@ var PaymentMethodDetails = ({
23112
23442
  $flexGrow: 1,
23113
23443
  $gap: "1.5rem",
23114
23444
  children: [
23115
- /* @__PURE__ */ jsx51(
23445
+ /* @__PURE__ */ jsx52(
23116
23446
  Flex,
23117
23447
  {
23118
23448
  $position: "absolute",
@@ -23121,7 +23451,7 @@ var PaymentMethodDetails = ({
23121
23451
  $alignItems: "center",
23122
23452
  $width: "100%",
23123
23453
  $height: "100%",
23124
- children: /* @__PURE__ */ jsx51(
23454
+ children: /* @__PURE__ */ jsx52(
23125
23455
  Loader,
23126
23456
  {
23127
23457
  $color: settings.theme.primary,
@@ -23131,7 +23461,7 @@ var PaymentMethodDetails = ({
23131
23461
  )
23132
23462
  }
23133
23463
  ),
23134
- /* @__PURE__ */ jsxs37(
23464
+ /* @__PURE__ */ jsxs38(
23135
23465
  Flex,
23136
23466
  {
23137
23467
  $zIndex: isLoading || isConfirmingPayment ? 0 : 1,
@@ -23148,7 +23478,7 @@ var PaymentMethodDetails = ({
23148
23478
  }
23149
23479
  },
23150
23480
  children: [
23151
- setupIntent && showPaymentForm && stripe ? /* @__PURE__ */ jsxs37(
23481
+ setupIntent && showPaymentForm && stripe ? /* @__PURE__ */ jsxs38(
23152
23482
  Elements,
23153
23483
  {
23154
23484
  stripe,
@@ -23178,7 +23508,7 @@ var PaymentMethodDetails = ({
23178
23508
  clientSecret: setupIntent?.setupIntentClientSecret
23179
23509
  },
23180
23510
  children: [
23181
- /* @__PURE__ */ jsx51(
23511
+ /* @__PURE__ */ jsx52(
23182
23512
  PaymentForm,
23183
23513
  {
23184
23514
  financeData,
@@ -23189,7 +23519,7 @@ var PaymentMethodDetails = ({
23189
23519
  }
23190
23520
  }
23191
23521
  ),
23192
- currentPaymentMethod && /* @__PURE__ */ jsx51(Box, { children: /* @__PURE__ */ jsx51(
23522
+ currentPaymentMethod && /* @__PURE__ */ jsx52(Box, { children: /* @__PURE__ */ jsx52(
23193
23523
  Text,
23194
23524
  {
23195
23525
  onClick: focusExistingPaymentMethods,
@@ -23202,8 +23532,8 @@ var PaymentMethodDetails = ({
23202
23532
  ) })
23203
23533
  ]
23204
23534
  }
23205
- ) : /* @__PURE__ */ jsxs37(Flex, { $flexDirection: "column", $gap: "2rem", children: [
23206
- /* @__PURE__ */ jsx51(
23535
+ ) : /* @__PURE__ */ jsxs38(Flex, { $flexDirection: "column", $gap: "2rem", children: [
23536
+ /* @__PURE__ */ jsx52(
23207
23537
  PaymentMethodElement,
23208
23538
  {
23209
23539
  paymentMethod: currentPaymentMethod,
@@ -23216,8 +23546,8 @@ var PaymentMethodDetails = ({
23216
23546
  ...props
23217
23547
  }
23218
23548
  ),
23219
- paymentMethods.length > 0 && /* @__PURE__ */ jsxs37(Flex, { $alignItems: "center", $gap: "0.5rem", children: [
23220
- /* @__PURE__ */ jsx51(
23549
+ paymentMethods.length > 0 && /* @__PURE__ */ jsxs38(Flex, { $alignItems: "center", $gap: "0.5rem", children: [
23550
+ /* @__PURE__ */ jsx52(
23221
23551
  Text,
23222
23552
  {
23223
23553
  onClick: toggleShowPaymentMethods,
@@ -23228,7 +23558,7 @@ var PaymentMethodDetails = ({
23228
23558
  children: t3("Choose different payment method")
23229
23559
  }
23230
23560
  ),
23231
- /* @__PURE__ */ jsx51(
23561
+ /* @__PURE__ */ jsx52(
23232
23562
  Icon3,
23233
23563
  {
23234
23564
  name: showDifferentPaymentMethods ? "chevron-up" : "chevron-down",
@@ -23236,10 +23566,10 @@ var PaymentMethodDetails = ({
23236
23566
  }
23237
23567
  )
23238
23568
  ] }),
23239
- showDifferentPaymentMethods && /* @__PURE__ */ jsxs37(Flex, { $flexDirection: "column", $gap: "2rem", $marginTop: "-1rem", children: [
23240
- paymentMethods.length > 1 && /* @__PURE__ */ jsx51(Flex, { $flexDirection: "column", $overflow: "auto", children: (paymentMethods.filter(
23569
+ showDifferentPaymentMethods && /* @__PURE__ */ jsxs38(Flex, { $flexDirection: "column", $gap: "2rem", $marginTop: "-1rem", children: [
23570
+ paymentMethods.length > 1 && /* @__PURE__ */ jsx52(Flex, { $flexDirection: "column", $overflow: "auto", children: (paymentMethods.filter(
23241
23571
  (paymentMethod) => paymentMethod.id !== currentPaymentMethod?.id
23242
- ) || []).map((paymentMethod) => /* @__PURE__ */ jsx51(
23572
+ ) || []).map((paymentMethod) => /* @__PURE__ */ jsx52(
23243
23573
  PaymentListElement,
23244
23574
  {
23245
23575
  paymentMethod,
@@ -23248,7 +23578,7 @@ var PaymentMethodDetails = ({
23248
23578
  },
23249
23579
  paymentMethod.id
23250
23580
  )) }),
23251
- /* @__PURE__ */ jsx51(
23581
+ /* @__PURE__ */ jsx52(
23252
23582
  Button,
23253
23583
  {
23254
23584
  type: "button",
@@ -23263,7 +23593,7 @@ var PaymentMethodDetails = ({
23263
23593
  )
23264
23594
  ] })
23265
23595
  ] }),
23266
- !isLoading && error && /* @__PURE__ */ jsx51(Box, { children: /* @__PURE__ */ jsx51(Text, { $weight: 500, $color: "#DB6669", children: error }) })
23596
+ !isLoading && error && /* @__PURE__ */ jsx52(Box, { children: /* @__PURE__ */ jsx52(Text, { $weight: 500, $color: "#DB6669", children: error }) })
23267
23597
  ]
23268
23598
  }
23269
23599
  )
@@ -23276,10 +23606,10 @@ var PaymentMethodDetails = ({
23276
23606
  import { forwardRef as forwardRef14, useMemo as useMemo27 } from "react";
23277
23607
 
23278
23608
  // src/components/elements/plan-manager/AddOn.tsx
23279
- import { jsx as jsx52, jsxs as jsxs38 } from "react/jsx-runtime";
23609
+ import { jsx as jsx53, jsxs as jsxs39 } from "react/jsx-runtime";
23280
23610
  var AddOn = ({ addOn, currency, period, layout }) => {
23281
23611
  const resolvedPeriod = addOn.planPeriod === "one-time" ? addOn.planPeriod : period ?? addOn.planPeriod;
23282
- return /* @__PURE__ */ jsxs38(
23612
+ return /* @__PURE__ */ jsxs39(
23283
23613
  Flex,
23284
23614
  {
23285
23615
  $justifyContent: "space-between",
@@ -23287,10 +23617,10 @@ var AddOn = ({ addOn, currency, period, layout }) => {
23287
23617
  $flexWrap: "wrap",
23288
23618
  $gap: "1rem",
23289
23619
  children: [
23290
- /* @__PURE__ */ jsx52(Text, { display: layout.addOns.fontStyle, children: addOn.name }),
23291
- typeof addOn.planPrice === "number" && resolvedPeriod && /* @__PURE__ */ jsxs38(Text, { children: [
23620
+ /* @__PURE__ */ jsx53(Text, { display: layout.addOns.fontStyle, children: addOn.name }),
23621
+ typeof addOn.planPrice === "number" && resolvedPeriod && /* @__PURE__ */ jsxs39(Text, { children: [
23292
23622
  formatCurrency(addOn.planPrice, currency),
23293
- /* @__PURE__ */ jsx52("sub", { children: resolvedPeriod === "one-time" ? shortenPeriod(resolvedPeriod) : `/${shortenPeriod(resolvedPeriod)}` })
23623
+ /* @__PURE__ */ jsx53("sub", { children: resolvedPeriod === "one-time" ? shortenPeriod(resolvedPeriod) : `/${shortenPeriod(resolvedPeriod)}` })
23294
23624
  ] })
23295
23625
  ]
23296
23626
  }
@@ -23299,7 +23629,7 @@ var AddOn = ({ addOn, currency, period, layout }) => {
23299
23629
 
23300
23630
  // src/components/elements/plan-manager/UsageDetails.tsx
23301
23631
  import { Fragment as Fragment21, useMemo as useMemo26 } from "react";
23302
- import { Fragment as Fragment22, jsx as jsx53, jsxs as jsxs39 } from "react/jsx-runtime";
23632
+ import { Fragment as Fragment22, jsx as jsx54, jsxs as jsxs40 } from "react/jsx-runtime";
23303
23633
  var UsageDetails2 = ({
23304
23634
  entitlement,
23305
23635
  period,
@@ -23321,30 +23651,30 @@ var UsageDetails2 = ({
23321
23651
  const acc = [];
23322
23652
  let index = 0;
23323
23653
  if (entitlement.priceBehavior === EntitlementPriceBehavior.Overage) {
23324
- acc.push(/* @__PURE__ */ jsxs39(Fragment21, { children: [
23654
+ acc.push(/* @__PURE__ */ jsxs40(Fragment21, { children: [
23325
23655
  t3("Additional"),
23326
23656
  ": "
23327
23657
  ] }, index));
23328
23658
  index += 1;
23329
23659
  }
23330
23660
  if (entitlement.priceBehavior === EntitlementPriceBehavior.Tier) {
23331
- acc.push(/* @__PURE__ */ jsx53(Fragment21, { children: t3("Tier-based") }, index));
23661
+ acc.push(/* @__PURE__ */ jsx54(Fragment21, { children: t3("Tier-based") }, index));
23332
23662
  index += 1;
23333
23663
  }
23334
23664
  const { price } = getEntitlementPrice(entitlement, period, currency) || {};
23335
23665
  if ((entitlement.priceBehavior === EntitlementPriceBehavior.PayAsYouGo || entitlement.priceBehavior === EntitlementPriceBehavior.Overage) && entitlement.feature && typeof price === "number") {
23336
23666
  const packageSize = billingPrice?.packageSize ?? 1;
23337
23667
  acc.push(
23338
- /* @__PURE__ */ jsxs39(Fragment21, { children: [
23668
+ /* @__PURE__ */ jsxs40(Fragment21, { children: [
23339
23669
  formatCurrency(price, billingPrice?.currency),
23340
- /* @__PURE__ */ jsxs39("sub", { children: [
23670
+ /* @__PURE__ */ jsxs40("sub", { children: [
23341
23671
  "/",
23342
- packageSize > 1 && /* @__PURE__ */ jsxs39(Fragment22, { children: [
23672
+ packageSize > 1 && /* @__PURE__ */ jsxs40(Fragment22, { children: [
23343
23673
  packageSize,
23344
23674
  " "
23345
23675
  ] }),
23346
23676
  getFeatureName(entitlement.feature, packageSize),
23347
- entitlement.feature.featureType === FeatureType.Trait && /* @__PURE__ */ jsxs39(Fragment22, { children: [
23677
+ entitlement.feature.featureType === FeatureType.Trait && /* @__PURE__ */ jsxs40(Fragment22, { children: [
23348
23678
  "/",
23349
23679
  shortenPeriod(period)
23350
23680
  ] })
@@ -23355,7 +23685,7 @@ var UsageDetails2 = ({
23355
23685
  }
23356
23686
  if (showCredits && entitlement.priceBehavior === EntitlementPriceBehavior.CreditBurndown && entitlement.planEntitlement?.consumptionRate && entitlement.planEntitlement?.valueCredit) {
23357
23687
  acc.push(
23358
- /* @__PURE__ */ jsxs39(Fragment21, { children: [
23688
+ /* @__PURE__ */ jsxs40(Fragment21, { children: [
23359
23689
  entitlement.planEntitlement.consumptionRate,
23360
23690
  " ",
23361
23691
  getFeatureName(
@@ -23383,7 +23713,7 @@ var UsageDetails2 = ({
23383
23713
  return null;
23384
23714
  }
23385
23715
  const quantity = entitlement.priceBehavior !== EntitlementPriceBehavior.CreditBurndown ? limit : void 0;
23386
- return /* @__PURE__ */ jsxs39(
23716
+ return /* @__PURE__ */ jsxs40(
23387
23717
  Flex,
23388
23718
  {
23389
23719
  $justifyContent: "space-between",
@@ -23391,13 +23721,13 @@ var UsageDetails2 = ({
23391
23721
  $flexWrap: "wrap",
23392
23722
  $gap: "0.5rem",
23393
23723
  children: [
23394
- /* @__PURE__ */ jsx53(Text, { display: layout.addOns.fontStyle, children: typeof quantity === "number" ? /* @__PURE__ */ jsxs39(Fragment22, { children: [
23724
+ /* @__PURE__ */ jsx54(Text, { display: layout.addOns.fontStyle, children: typeof quantity === "number" ? /* @__PURE__ */ jsxs40(Fragment22, { children: [
23395
23725
  quantity,
23396
23726
  " ",
23397
23727
  getFeatureName(entitlement.feature, quantity, true)
23398
23728
  ] }) : entitlement.feature.name }),
23399
- /* @__PURE__ */ jsxs39(Text, { children: [
23400
- description.length > 0 && /* @__PURE__ */ jsx53(
23729
+ /* @__PURE__ */ jsxs40(Text, { children: [
23730
+ description.length > 0 && /* @__PURE__ */ jsx54(
23401
23731
  Text,
23402
23732
  {
23403
23733
  style: { opacity: 0.54 },
@@ -23408,15 +23738,15 @@ var UsageDetails2 = ({
23408
23738
  ),
23409
23739
  // only show cost for pay-in-advance entitlements
23410
23740
  // `description` will include price for other price behaviors
23411
- entitlement.priceBehavior === EntitlementPriceBehavior.PayInAdvance && /* @__PURE__ */ jsxs39(Fragment22, { children: [
23741
+ entitlement.priceBehavior === EntitlementPriceBehavior.PayInAdvance && /* @__PURE__ */ jsxs40(Fragment22, { children: [
23412
23742
  " ",
23413
23743
  formatCurrency(cost, billingPrice?.currency),
23414
- entitlement.feature.featureType === FeatureType.Trait && /* @__PURE__ */ jsxs39("sub", { children: [
23744
+ entitlement.feature.featureType === FeatureType.Trait && /* @__PURE__ */ jsxs40("sub", { children: [
23415
23745
  "/",
23416
23746
  shortenPeriod(period)
23417
23747
  ] })
23418
23748
  ] }),
23419
- entitlement.priceBehavior === EntitlementPriceBehavior.Tier && /* @__PURE__ */ jsx53(
23749
+ entitlement.priceBehavior === EntitlementPriceBehavior.Tier && /* @__PURE__ */ jsx54(
23420
23750
  PricingTiersTooltip,
23421
23751
  {
23422
23752
  feature: entitlement.feature,
@@ -23426,7 +23756,7 @@ var UsageDetails2 = ({
23426
23756
  tiersMode: billingPrice?.tiersMode ?? void 0
23427
23757
  }
23428
23758
  ),
23429
- entitlementHasHardLimit(entitlement) && entitlement.allocationType === EntitlementValueType.Numeric && /* @__PURE__ */ jsx53(
23759
+ entitlementHasHardLimit(entitlement) && entitlement.allocationType === EntitlementValueType.Numeric && /* @__PURE__ */ jsx54(
23430
23760
  HardLimitTooltip,
23431
23761
  {
23432
23762
  feature: entitlement.feature,
@@ -23440,7 +23770,7 @@ var UsageDetails2 = ({
23440
23770
  };
23441
23771
 
23442
23772
  // src/components/elements/plan-manager/PlanManager.tsx
23443
- import { Fragment as Fragment23, jsx as jsx54, jsxs as jsxs40 } from "react/jsx-runtime";
23773
+ import { Fragment as Fragment23, jsx as jsx55, jsxs as jsxs41 } from "react/jsx-runtime";
23444
23774
  var resolveDesignProps7 = (props) => {
23445
23775
  return {
23446
23776
  header: {
@@ -23562,8 +23892,8 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23562
23892
  const hasAutoTopupSelfService = currentPlan?.includedCreditGrants.some((grant) => {
23563
23893
  return grant.billingCreditAutoTopupSelfService;
23564
23894
  }) ?? false;
23565
- return /* @__PURE__ */ jsxs40(Fragment23, { children: [
23566
- isTrialSubscription && !willSubscriptionCancel ? /* @__PURE__ */ jsxs40(
23895
+ return /* @__PURE__ */ jsxs41(Fragment23, { children: [
23896
+ isTrialSubscription && !willSubscriptionCancel ? /* @__PURE__ */ jsxs41(
23567
23897
  Notice,
23568
23898
  {
23569
23899
  as: Flex,
@@ -23573,8 +23903,8 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23573
23903
  $textAlign: "center",
23574
23904
  $backgroundColor: isLightBackground ? darken(settings.theme.card.background, 0.04) : lighten(settings.theme.card.background, 0.04),
23575
23905
  children: [
23576
- typeof trialEnd.endDate !== "undefined" && /* @__PURE__ */ jsx54(Text, { as: "h3", display: "heading3", children: t3("Trial ends in", trialEnd) }),
23577
- (trialPaymentMethodRequired || postTrialPlan || currentPlan) && /* @__PURE__ */ jsx54(
23906
+ typeof trialEnd.endDate !== "undefined" && /* @__PURE__ */ jsx55(Text, { as: "h3", display: "heading3", children: t3("Trial ends in", trialEnd) }),
23907
+ (trialPaymentMethodRequired || postTrialPlan || currentPlan) && /* @__PURE__ */ jsx55(
23578
23908
  Text,
23579
23909
  {
23580
23910
  as: "p",
@@ -23588,7 +23918,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23588
23918
  )
23589
23919
  ]
23590
23920
  }
23591
- ) : willSubscriptionCancel ? /* @__PURE__ */ jsxs40(
23921
+ ) : willSubscriptionCancel ? /* @__PURE__ */ jsxs41(
23592
23922
  Notice,
23593
23923
  {
23594
23924
  as: Flex,
@@ -23598,8 +23928,8 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23598
23928
  $textAlign: "center",
23599
23929
  $backgroundColor: isLightBackground ? darken(settings.theme.card.background, 0.04) : lighten(settings.theme.card.background, 0.04),
23600
23930
  children: [
23601
- /* @__PURE__ */ jsx54(Text, { as: "h3", display: "heading3", children: t3("Subscription canceled") }),
23602
- typeof billingSubscription?.cancelAt === "number" && /* @__PURE__ */ jsx54(
23931
+ /* @__PURE__ */ jsx55(Text, { as: "h3", display: "heading3", children: t3("Subscription canceled") }),
23932
+ typeof billingSubscription?.cancelAt === "number" && /* @__PURE__ */ jsx55(
23603
23933
  Text,
23604
23934
  {
23605
23935
  as: "p",
@@ -23617,7 +23947,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23617
23947
  )
23618
23948
  ]
23619
23949
  }
23620
- ) : customPlanBilling ? /* @__PURE__ */ jsxs40(
23950
+ ) : customPlanBilling ? /* @__PURE__ */ jsxs41(
23621
23951
  Notice,
23622
23952
  {
23623
23953
  as: Flex,
@@ -23627,7 +23957,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23627
23957
  $textAlign: "center",
23628
23958
  $backgroundColor: isLightBackground ? darken(settings.theme.card.background, 0.04) : lighten(settings.theme.card.background, 0.04),
23629
23959
  children: [
23630
- /* @__PURE__ */ jsx54(Text, { as: "h3", display: "heading3", children: customPlanBilling.isAwaitingActivation ? t3("Custom plan awaiting payment", {
23960
+ /* @__PURE__ */ jsx55(Text, { as: "h3", display: "heading3", children: customPlanBilling.isAwaitingActivation ? t3("Custom plan awaiting payment", {
23631
23961
  plan: customPlanBilling.planName ?? t3("your plan")
23632
23962
  }) : t3("Custom plan payment due", {
23633
23963
  plan: customPlanBilling.planName ?? t3("your plan"),
@@ -23635,7 +23965,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23635
23965
  month: "numeric"
23636
23966
  })
23637
23967
  }) }),
23638
- /* @__PURE__ */ jsx54(Text, { as: "p", $size: 0.8125 * settings.theme.typography.text.fontSize, children: customPlanBilling.isAwaitingActivation ? t3("Custom plan awaiting payment description", {
23968
+ /* @__PURE__ */ jsx55(Text, { as: "p", $size: 0.8125 * settings.theme.typography.text.fontSize, children: customPlanBilling.isAwaitingActivation ? t3("Custom plan awaiting payment description", {
23639
23969
  date: toPrettyDate(customPlanBilling.deadline, {
23640
23970
  month: "numeric"
23641
23971
  })
@@ -23645,7 +23975,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23645
23975
  month: "numeric"
23646
23976
  })
23647
23977
  }) }),
23648
- customPlanBilling.billing.stripeInvoiceUrl && /* @__PURE__ */ jsx54(
23978
+ customPlanBilling.billing.stripeInvoiceUrl && /* @__PURE__ */ jsx55(
23649
23979
  Button,
23650
23980
  {
23651
23981
  as: "a",
@@ -23659,7 +23989,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23659
23989
  )
23660
23990
  ]
23661
23991
  }
23662
- ) : data?.company?.scheduledDowngrade?.toPlanName && /* @__PURE__ */ jsxs40(
23992
+ ) : data?.company?.scheduledDowngrade?.toPlanName && /* @__PURE__ */ jsxs41(
23663
23993
  Notice,
23664
23994
  {
23665
23995
  as: Flex,
@@ -23669,10 +23999,10 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23669
23999
  $textAlign: "center",
23670
24000
  $backgroundColor: isLightBackground ? darken(settings.theme.card.background, 0.04) : lighten(settings.theme.card.background, 0.04),
23671
24001
  children: [
23672
- /* @__PURE__ */ jsx54(Text, { as: "h3", display: "heading3", children: t3("Downgrade to plan scheduled", {
24002
+ /* @__PURE__ */ jsx55(Text, { as: "h3", display: "heading3", children: t3("Downgrade to plan scheduled", {
23673
24003
  plan: data.company.scheduledDowngrade.toPlanName
23674
24004
  }) }),
23675
- typeof billingSubscription?.periodEnd === "number" && /* @__PURE__ */ jsx54(
24005
+ typeof billingSubscription?.periodEnd === "number" && /* @__PURE__ */ jsx55(
23676
24006
  Text,
23677
24007
  {
23678
24008
  as: "p",
@@ -23691,7 +24021,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23691
24021
  ]
23692
24022
  }
23693
24023
  ),
23694
- /* @__PURE__ */ jsxs40(
24024
+ /* @__PURE__ */ jsxs41(
23695
24025
  Element,
23696
24026
  {
23697
24027
  as: Flex,
@@ -23700,19 +24030,19 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23700
24030
  $flexDirection: "column",
23701
24031
  $gap: "2rem",
23702
24032
  children: [
23703
- props.header.isVisible && currentPlan && /* @__PURE__ */ jsxs40(
24033
+ props.header.isVisible && currentPlan && /* @__PURE__ */ jsxs41(
23704
24034
  Flex,
23705
24035
  {
23706
24036
  $justifyContent: "space-between",
23707
24037
  $alignItems: "center",
23708
24038
  $gap: "1rem",
23709
24039
  children: [
23710
- /* @__PURE__ */ jsxs40(Flex, { $flexDirection: "column", $gap: "1rem", children: [
23711
- /* @__PURE__ */ jsx54(Text, { display: props.header.title.fontStyle, $leading: "none", children: currentPlan.name }),
23712
- props.header.description.isVisible && currentPlan.description && /* @__PURE__ */ jsx54(Text, { display: props.header.description.fontStyle, children: currentPlan.description })
24040
+ /* @__PURE__ */ jsxs41(Flex, { $flexDirection: "column", $gap: "1rem", children: [
24041
+ /* @__PURE__ */ jsx55(Text, { display: props.header.title.fontStyle, $leading: "none", children: currentPlan.name }),
24042
+ props.header.description.isVisible && currentPlan.description && /* @__PURE__ */ jsx55(Text, { display: props.header.description.fontStyle, children: currentPlan.description })
23713
24043
  ] }),
23714
- props.header.price.isVisible && typeof currentPlan.planPrice === "number" && /* @__PURE__ */ jsxs40(Box, { children: [
23715
- /* @__PURE__ */ jsx54(
24044
+ props.header.price.isVisible && typeof currentPlan.planPrice === "number" && /* @__PURE__ */ jsxs41(Box, { children: [
24045
+ /* @__PURE__ */ jsx55(
23716
24046
  Text,
23717
24047
  {
23718
24048
  display: isUsageBasedPlan ? "heading3" : props.header.price.fontStyle,
@@ -23722,7 +24052,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23722
24052
  )
23723
24053
  }
23724
24054
  ),
23725
- !isFreePlan && currentPlanPeriod && /* @__PURE__ */ jsx54(Text, { display: props.header.price.fontStyle, children: /* @__PURE__ */ jsxs40("sub", { children: [
24055
+ !isFreePlan && currentPlanPeriod && /* @__PURE__ */ jsx55(Text, { display: props.header.price.fontStyle, children: /* @__PURE__ */ jsxs41("sub", { children: [
23726
24056
  "/",
23727
24057
  shortenPeriod(currentPlanPeriod)
23728
24058
  ] }) })
@@ -23730,8 +24060,8 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23730
24060
  ]
23731
24061
  }
23732
24062
  ),
23733
- props.addOns.isVisible && currentAddOns.length > 0 && /* @__PURE__ */ jsxs40(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
23734
- props.addOns.showLabel && /* @__PURE__ */ jsx54(
24063
+ props.addOns.isVisible && currentAddOns.length > 0 && /* @__PURE__ */ jsxs41(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
24064
+ props.addOns.showLabel && /* @__PURE__ */ jsx55(
23735
24065
  Text,
23736
24066
  {
23737
24067
  $color: isLightBackground ? darken(settings.theme.card.background, 0.46) : lighten(settings.theme.card.background, 0.46),
@@ -23739,7 +24069,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23739
24069
  children: t3("Add-ons")
23740
24070
  }
23741
24071
  ),
23742
- /* @__PURE__ */ jsx54(Flex, { $flexDirection: "column", $gap: "1rem", children: currentAddOns.map((addOn, addOnIndex) => /* @__PURE__ */ jsx54(
24072
+ /* @__PURE__ */ jsx55(Flex, { $flexDirection: "column", $gap: "1rem", children: currentAddOns.map((addOn, addOnIndex) => /* @__PURE__ */ jsx55(
23743
24073
  AddOn,
23744
24074
  {
23745
24075
  addOn,
@@ -23750,8 +24080,8 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23750
24080
  addOnIndex
23751
24081
  )) })
23752
24082
  ] }),
23753
- props.addOns.isVisible && usageBasedEntitlements.length > 0 && /* @__PURE__ */ jsxs40(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
23754
- props.addOns.showLabel && /* @__PURE__ */ jsx54(
24083
+ props.addOns.isVisible && usageBasedEntitlements.length > 0 && /* @__PURE__ */ jsxs41(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
24084
+ props.addOns.showLabel && /* @__PURE__ */ jsx55(
23755
24085
  Text,
23756
24086
  {
23757
24087
  $color: isLightBackground ? darken(settings.theme.card.background, 0.46) : lighten(settings.theme.card.background, 0.46),
@@ -23759,8 +24089,8 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23759
24089
  children: t3("Usage-based")
23760
24090
  }
23761
24091
  ),
23762
- /* @__PURE__ */ jsx54(Flex, { $flexDirection: "column", $gap: "1rem", children: usageBasedEntitlements.map((entitlement, entitlementIndex) => {
23763
- return /* @__PURE__ */ jsx54(
24092
+ /* @__PURE__ */ jsx55(Flex, { $flexDirection: "column", $gap: "1rem", children: usageBasedEntitlements.map((entitlement, entitlementIndex) => {
24093
+ return /* @__PURE__ */ jsx55(
23764
24094
  UsageDetails2,
23765
24095
  {
23766
24096
  entitlement,
@@ -23773,8 +24103,8 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23773
24103
  );
23774
24104
  }) })
23775
24105
  ] }),
23776
- props.addOns.isVisible && showCredits && creditGroups.plan.length > 0 && /* @__PURE__ */ jsxs40(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
23777
- props.addOns.showLabel && /* @__PURE__ */ jsx54(
24106
+ props.addOns.isVisible && showCredits && creditGroups.plan.length > 0 && /* @__PURE__ */ jsxs41(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
24107
+ props.addOns.showLabel && /* @__PURE__ */ jsx55(
23778
24108
  Text,
23779
24109
  {
23780
24110
  $color: isLightBackground ? darken(settings.theme.card.background, 0.46) : lighten(settings.theme.card.background, 0.46),
@@ -23782,19 +24112,19 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23782
24112
  children: t3("Credits in plan")
23783
24113
  }
23784
24114
  ),
23785
- /* @__PURE__ */ jsx54(Flex, { $flexDirection: "column", $gap: "1rem", children: creditGroups.plan.map((group, groupIndex) => {
24115
+ /* @__PURE__ */ jsx55(Flex, { $flexDirection: "column", $gap: "1rem", children: creditGroups.plan.map((group, groupIndex) => {
23786
24116
  const planCreditGrant = currentPlan?.includedCreditGrants.find(
23787
24117
  (grant) => grant.creditId === group.id
23788
24118
  );
23789
24119
  const hasAutoTopup = isAutoTopupEnabled(planCreditGrant);
23790
24120
  const thresholdCredits = getAutoTopupThresholdCredits(planCreditGrant);
23791
24121
  const topupAmount = getAutoTopupAmount(planCreditGrant);
23792
- return /* @__PURE__ */ jsx54(
24122
+ return /* @__PURE__ */ jsx55(
23793
24123
  Flex,
23794
24124
  {
23795
24125
  $flexDirection: "column",
23796
24126
  $gap: "0.25rem",
23797
- children: /* @__PURE__ */ jsxs40(
24127
+ children: /* @__PURE__ */ jsxs41(
23798
24128
  Flex,
23799
24129
  {
23800
24130
  $justifyContent: "space-between",
@@ -23802,18 +24132,18 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23802
24132
  $flexWrap: "wrap",
23803
24133
  $gap: "0.5rem",
23804
24134
  children: [
23805
- /* @__PURE__ */ jsxs40(Text, { display: props.addOns.fontStyle, children: [
24135
+ /* @__PURE__ */ jsxs41(Text, { display: props.addOns.fontStyle, children: [
23806
24136
  group.quantity,
23807
24137
  " ",
23808
24138
  getFeatureName(group, group.quantity),
23809
24139
  " ",
23810
- subscriptionInterval && /* @__PURE__ */ jsxs40(Fragment23, { children: [
24140
+ subscriptionInterval && /* @__PURE__ */ jsxs41(Fragment23, { children: [
23811
24141
  t3("per"),
23812
24142
  " ",
23813
24143
  t3(subscriptionInterval)
23814
24144
  ] })
23815
24145
  ] }),
23816
- group.total.used > 0 && /* @__PURE__ */ jsx54(Flex, { $alignItems: "baseline", children: /* @__PURE__ */ jsxs40(
24146
+ group.total.used > 0 && /* @__PURE__ */ jsx55(Flex, { $alignItems: "baseline", children: /* @__PURE__ */ jsxs41(
23817
24147
  Text,
23818
24148
  {
23819
24149
  style: { opacity: 0.54 },
@@ -23823,7 +24153,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23823
24153
  group.total.used,
23824
24154
  " ",
23825
24155
  t3("used"),
23826
- hasAutoTopup && planCreditGrant && /* @__PURE__ */ jsx54(
24156
+ hasAutoTopup && planCreditGrant && /* @__PURE__ */ jsx55(
23827
24157
  AutoTopupNotice,
23828
24158
  {
23829
24159
  thresholdCredits,
@@ -23840,7 +24170,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23840
24170
  groupIndex
23841
24171
  );
23842
24172
  }) }),
23843
- hasAutoTopupSelfService && /* @__PURE__ */ jsxs40(
24173
+ hasAutoTopupSelfService && /* @__PURE__ */ jsxs41(
23844
24174
  Flex,
23845
24175
  {
23846
24176
  $justifyContent: "space-between",
@@ -23850,8 +24180,8 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23850
24180
  $backgroundColor: isLightBackground ? darken(settings.theme.card.background, 0.04) : lighten(settings.theme.card.background, 0.04),
23851
24181
  $borderRadius: "0.5rem",
23852
24182
  children: [
23853
- /* @__PURE__ */ jsxs40(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
23854
- /* @__PURE__ */ jsx54(Text, { display: props.addOns.fontStyle, children: t3("Auto top-up") }),
24183
+ /* @__PURE__ */ jsxs41(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
24184
+ /* @__PURE__ */ jsx55(Text, { display: props.addOns.fontStyle, children: t3("Auto top-up") }),
23855
24185
  currentPlan?.includedCreditGrants.reduce(
23856
24186
  (acc, grant) => {
23857
24187
  if (!grant.credit || !grant.billingCreditAutoTopupSelfService) {
@@ -23860,7 +24190,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23860
24190
  const autoTopupEnabled = grant.companyAutoTopupEnabled ?? false;
23861
24191
  if (!autoTopupEnabled) {
23862
24192
  acc.push(
23863
- /* @__PURE__ */ jsx54(Text, { $leading: "tight", children: t3("Auto top-up disabled for token", {
24193
+ /* @__PURE__ */ jsx55(Text, { $leading: "tight", children: t3("Auto top-up disabled for token", {
23864
24194
  unit: getFeatureName(grant.credit, 1)
23865
24195
  }) }, grant.id)
23866
24196
  );
@@ -23870,7 +24200,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23870
24200
  const autoTopupAmount = getAutoTopupAmount(grant);
23871
24201
  if (typeof autoTopupThresholdCredits === "number" && typeof autoTopupAmount === "number") {
23872
24202
  acc.push(
23873
- /* @__PURE__ */ jsx54(Text, { $leading: "tight", children: t3("Adds X tokens when Y remaining in balance", {
24203
+ /* @__PURE__ */ jsx55(Text, { $leading: "tight", children: t3("Adds X tokens when Y remaining in balance", {
23874
24204
  unit: getFeatureName(
23875
24205
  grant.credit,
23876
24206
  autoTopupAmount
@@ -23885,7 +24215,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23885
24215
  []
23886
24216
  )
23887
24217
  ] }),
23888
- /* @__PURE__ */ jsx54(
24218
+ /* @__PURE__ */ jsx55(
23889
24219
  Button,
23890
24220
  {
23891
24221
  type: "button",
@@ -23902,8 +24232,8 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23902
24232
  }
23903
24233
  )
23904
24234
  ] }),
23905
- props.addOns.isVisible && creditGroups.bundles.length > 0 && /* @__PURE__ */ jsxs40(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
23906
- props.addOns.showLabel && /* @__PURE__ */ jsx54(
24235
+ props.addOns.isVisible && creditGroups.bundles.length > 0 && /* @__PURE__ */ jsxs41(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
24236
+ props.addOns.showLabel && /* @__PURE__ */ jsx55(
23907
24237
  Text,
23908
24238
  {
23909
24239
  $color: isLightBackground ? darken(settings.theme.card.background, 0.46) : lighten(settings.theme.card.background, 0.46),
@@ -23911,9 +24241,9 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23911
24241
  children: t3("Credit bundles")
23912
24242
  }
23913
24243
  ),
23914
- /* @__PURE__ */ jsx54(Flex, { $flexDirection: "column", $gap: "1rem", children: creditGroups.bundles.map((group, groupIndex) => {
24244
+ /* @__PURE__ */ jsx55(Flex, { $flexDirection: "column", $gap: "1rem", children: creditGroups.bundles.map((group, groupIndex) => {
23915
24245
  const bundle = group?.bundleId ? creditBundles.find((b3) => b3.id === group.bundleId) : void 0;
23916
- return /* @__PURE__ */ jsxs40(
24246
+ return /* @__PURE__ */ jsxs41(
23917
24247
  Flex,
23918
24248
  {
23919
24249
  $justifyContent: "space-between",
@@ -23921,8 +24251,8 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23921
24251
  $flexWrap: "wrap",
23922
24252
  $gap: "0.5rem",
23923
24253
  children: [
23924
- bundle ? /* @__PURE__ */ jsxs40(Text, { display: props.addOns.fontStyle, children: [
23925
- group.grants.length > 1 && /* @__PURE__ */ jsxs40(Text, { style: { opacity: 0.5 }, children: [
24254
+ bundle ? /* @__PURE__ */ jsxs41(Text, { display: props.addOns.fontStyle, children: [
24255
+ group.grants.length > 1 && /* @__PURE__ */ jsxs41(Text, { style: { opacity: 0.5 }, children: [
23926
24256
  "(",
23927
24257
  group.grants.length,
23928
24258
  ")",
@@ -23934,12 +24264,12 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23934
24264
  " ",
23935
24265
  getFeatureName(group, group.quantity),
23936
24266
  ")"
23937
- ] }) : /* @__PURE__ */ jsxs40(Text, { display: props.addOns.fontStyle, children: [
24267
+ ] }) : /* @__PURE__ */ jsxs41(Text, { display: props.addOns.fontStyle, children: [
23938
24268
  group.quantity,
23939
24269
  " ",
23940
24270
  getFeatureName(group, group.quantity)
23941
24271
  ] }),
23942
- group.total.used > 0 && /* @__PURE__ */ jsxs40(
24272
+ group.total.used > 0 && /* @__PURE__ */ jsxs41(
23943
24273
  Text,
23944
24274
  {
23945
24275
  style: { opacity: 0.54 },
@@ -23958,8 +24288,8 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23958
24288
  );
23959
24289
  }) })
23960
24290
  ] }),
23961
- props.addOns.isVisible && creditGroups.promotional.length > 0 && /* @__PURE__ */ jsxs40(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
23962
- props.addOns.showLabel && /* @__PURE__ */ jsx54(
24291
+ props.addOns.isVisible && creditGroups.promotional.length > 0 && /* @__PURE__ */ jsxs41(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
24292
+ props.addOns.showLabel && /* @__PURE__ */ jsx55(
23963
24293
  Text,
23964
24294
  {
23965
24295
  $color: isLightBackground ? darken(settings.theme.card.background, 0.46) : lighten(settings.theme.card.background, 0.46),
@@ -23967,8 +24297,8 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23967
24297
  children: t3("Promotional credits")
23968
24298
  }
23969
24299
  ),
23970
- /* @__PURE__ */ jsx54(Flex, { $flexDirection: "column", $gap: "1rem", children: creditGroups.promotional.map((group, groupIndex) => {
23971
- return /* @__PURE__ */ jsxs40(
24300
+ /* @__PURE__ */ jsx55(Flex, { $flexDirection: "column", $gap: "1rem", children: creditGroups.promotional.map((group, groupIndex) => {
24301
+ return /* @__PURE__ */ jsxs41(
23972
24302
  Flex,
23973
24303
  {
23974
24304
  $justifyContent: "space-between",
@@ -23976,12 +24306,12 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
23976
24306
  $flexWrap: "wrap",
23977
24307
  $gap: "0.5rem",
23978
24308
  children: [
23979
- /* @__PURE__ */ jsxs40(Text, { display: props.addOns.fontStyle, children: [
24309
+ /* @__PURE__ */ jsxs41(Text, { display: props.addOns.fontStyle, children: [
23980
24310
  group.quantity,
23981
24311
  " ",
23982
24312
  getFeatureName(group, group.quantity)
23983
24313
  ] }),
23984
- group.total.used > 0 && /* @__PURE__ */ jsxs40(
24314
+ group.total.used > 0 && /* @__PURE__ */ jsxs41(
23985
24315
  Text,
23986
24316
  {
23987
24317
  style: { opacity: 0.54 },
@@ -24000,7 +24330,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
24000
24330
  );
24001
24331
  }) })
24002
24332
  ] }),
24003
- canCheckout && props.callToAction.isVisible && !customPlanBilling?.isAwaitingActivation && /* @__PURE__ */ jsx54(
24333
+ canCheckout && props.callToAction.isVisible && !customPlanBilling?.isAwaitingActivation && /* @__PURE__ */ jsx55(
24004
24334
  Button,
24005
24335
  {
24006
24336
  type: "button",
@@ -24032,7 +24362,7 @@ import {
24032
24362
 
24033
24363
  // src/components/elements/pricing-table/AddOn.tsx
24034
24364
  import { useMemo as useMemo28 } from "react";
24035
- import { Fragment as Fragment24, jsx as jsx55, jsxs as jsxs41 } from "react/jsx-runtime";
24365
+ import { Fragment as Fragment24, jsx as jsx56, jsxs as jsxs42 } from "react/jsx-runtime";
24036
24366
  function renderMeteredEntitlementPricing2({
24037
24367
  priceBehavior,
24038
24368
  softLimit,
@@ -24044,7 +24374,7 @@ function renderMeteredEntitlementPricing2({
24044
24374
  isTiered
24045
24375
  }) {
24046
24376
  if (priceBehavior === EntitlementPriceBehavior.Overage && softLimit) {
24047
- return /* @__PURE__ */ jsxs41(Fragment24, { children: [
24377
+ return /* @__PURE__ */ jsxs42(Fragment24, { children: [
24048
24378
  "Additional: ",
24049
24379
  formatCurrency(price, currency),
24050
24380
  "/",
@@ -24055,13 +24385,13 @@ function renderMeteredEntitlementPricing2({
24055
24385
  ] });
24056
24386
  }
24057
24387
  if (isTiered) {
24058
- return /* @__PURE__ */ jsx55(Fragment24, { children: "Tier-based pricing" });
24388
+ return /* @__PURE__ */ jsx56(Fragment24, { children: "Tier-based pricing" });
24059
24389
  }
24060
24390
  if (priceBehavior === EntitlementPriceBehavior.PayAsYouGo || priceBehavior === EntitlementPriceBehavior.PayInAdvance) {
24061
- return /* @__PURE__ */ jsxs41(Fragment24, { children: [
24391
+ return /* @__PURE__ */ jsxs42(Fragment24, { children: [
24062
24392
  formatCurrency(price, currency),
24063
24393
  "/",
24064
- packageSize > 1 && /* @__PURE__ */ jsxs41(Fragment24, { children: [
24394
+ packageSize > 1 && /* @__PURE__ */ jsxs42(Fragment24, { children: [
24065
24395
  packageSize,
24066
24396
  " "
24067
24397
  ] }),
@@ -24125,7 +24455,7 @@ var AddOn2 = ({
24125
24455
  isTiered: entitlement.priceBehavior === EntitlementPriceBehavior.Tier || isTieredPrice(priceData)
24126
24456
  };
24127
24457
  }) || [];
24128
- return /* @__PURE__ */ jsxs41(
24458
+ return /* @__PURE__ */ jsxs42(
24129
24459
  Flex,
24130
24460
  {
24131
24461
  as: "li",
@@ -24145,7 +24475,7 @@ var AddOn2 = ({
24145
24475
  $boxShadow: cardBoxShadow
24146
24476
  },
24147
24477
  children: [
24148
- /* @__PURE__ */ jsxs41(
24478
+ /* @__PURE__ */ jsxs42(
24149
24479
  Flex,
24150
24480
  {
24151
24481
  $flexDirection: "column",
@@ -24156,7 +24486,7 @@ var AddOn2 = ({
24156
24486
  $borderStyle: "solid",
24157
24487
  $borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.175)" : "hsla(0, 0%, 100%, 0.175)",
24158
24488
  children: [
24159
- /* @__PURE__ */ jsx55(Box, { children: /* @__PURE__ */ jsx55(
24489
+ /* @__PURE__ */ jsx56(Box, { children: /* @__PURE__ */ jsx56(
24160
24490
  Text,
24161
24491
  {
24162
24492
  as: "h3",
@@ -24165,22 +24495,22 @@ var AddOn2 = ({
24165
24495
  children: addOn.name
24166
24496
  }
24167
24497
  ) }),
24168
- layout.addOns.showDescription && /* @__PURE__ */ jsx55(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx55(Text, { display: layout.plans.description.fontStyle, children: addOn.description }) }),
24169
- /* @__PURE__ */ jsx55(Box, { children: /* @__PURE__ */ jsx55(
24498
+ layout.addOns.showDescription && /* @__PURE__ */ jsx56(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx56(Text, { display: layout.plans.description.fontStyle, children: addOn.description }) }),
24499
+ /* @__PURE__ */ jsx56(Box, { children: /* @__PURE__ */ jsx56(
24170
24500
  Text,
24171
24501
  {
24172
24502
  "data-testid": "sch-addon-price",
24173
24503
  display: layout.plans.name.fontStyle,
24174
- children: shouldShowUsageBased2(addOnPrice ?? 0, displayableEntitlements) ? t3("Usage-based") : /* @__PURE__ */ jsxs41(Fragment24, { children: [
24504
+ children: shouldShowUsageBased2(addOnPrice ?? 0, displayableEntitlements) ? t3("Usage-based") : /* @__PURE__ */ jsxs42(Fragment24, { children: [
24175
24505
  formatCurrency(addOnPrice ?? 0, addOnCurrency),
24176
- /* @__PURE__ */ jsxs41("sub", { children: [
24506
+ /* @__PURE__ */ jsxs42("sub", { children: [
24177
24507
  "/",
24178
24508
  selectedPeriod
24179
24509
  ] })
24180
24510
  ] })
24181
24511
  }
24182
24512
  ) }),
24183
- isActiveAddOn && /* @__PURE__ */ jsx55(
24513
+ isActiveAddOn && /* @__PURE__ */ jsx56(
24184
24514
  Flex,
24185
24515
  {
24186
24516
  "data-testid": "sch-addon-active",
@@ -24190,7 +24520,7 @@ var AddOn2 = ({
24190
24520
  $backgroundColor: settings.theme.primary,
24191
24521
  $borderRadius: "9999px",
24192
24522
  $padding: "0.125rem 0.85rem",
24193
- children: /* @__PURE__ */ jsx55(
24523
+ children: /* @__PURE__ */ jsx56(
24194
24524
  Text,
24195
24525
  {
24196
24526
  $size: 0.75 * settings.theme.typography.text.fontSize,
@@ -24203,7 +24533,7 @@ var AddOn2 = ({
24203
24533
  ]
24204
24534
  }
24205
24535
  ),
24206
- /* @__PURE__ */ jsxs41(
24536
+ /* @__PURE__ */ jsxs42(
24207
24537
  Flex,
24208
24538
  {
24209
24539
  $flexDirection: "column",
@@ -24212,7 +24542,7 @@ var AddOn2 = ({
24212
24542
  $flexGrow: 1,
24213
24543
  $padding: `${0.75 * cardPadding}rem ${cardPadding}rem 0`,
24214
24544
  children: [
24215
- layout.addOns.showEntitlements && displayableEntitlements.length > 0 && /* @__PURE__ */ jsx55(
24545
+ layout.addOns.showEntitlements && displayableEntitlements.length > 0 && /* @__PURE__ */ jsx56(
24216
24546
  Flex,
24217
24547
  {
24218
24548
  as: "ul",
@@ -24224,7 +24554,7 @@ var AddOn2 = ({
24224
24554
  $listStyle: "none",
24225
24555
  children: displayableEntitlements.map((entitlement, idx) => {
24226
24556
  if (entitlement.isUnlimited) {
24227
- return /* @__PURE__ */ jsxs41(
24557
+ return /* @__PURE__ */ jsxs42(
24228
24558
  Flex,
24229
24559
  {
24230
24560
  as: "li",
@@ -24233,8 +24563,8 @@ var AddOn2 = ({
24233
24563
  $alignItems: "center",
24234
24564
  $gap: "1rem",
24235
24565
  children: [
24236
- /* @__PURE__ */ jsxs41(Flex, { $gap: "1rem", children: [
24237
- layout.addOns.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ jsx55(
24566
+ /* @__PURE__ */ jsxs42(Flex, { $gap: "1rem", children: [
24567
+ layout.addOns.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ jsx56(
24238
24568
  Icon3,
24239
24569
  {
24240
24570
  name: entitlement.feature.icon,
@@ -24243,16 +24573,16 @@ var AddOn2 = ({
24243
24573
  rounded: true
24244
24574
  }
24245
24575
  ),
24246
- entitlement.feature && /* @__PURE__ */ jsx55(
24576
+ entitlement.feature && /* @__PURE__ */ jsx56(
24247
24577
  Flex,
24248
24578
  {
24249
24579
  $flexDirection: "column",
24250
24580
  $justifyContent: "center",
24251
- children: /* @__PURE__ */ jsx55(Text, { children: getFeatureName(entitlement.feature) })
24581
+ children: /* @__PURE__ */ jsx56(Text, { children: getFeatureName(entitlement.feature) })
24252
24582
  }
24253
24583
  )
24254
24584
  ] }),
24255
- /* @__PURE__ */ jsx55(
24585
+ /* @__PURE__ */ jsx56(
24256
24586
  Text,
24257
24587
  {
24258
24588
  style: { opacity: 0.54 },
@@ -24267,7 +24597,7 @@ var AddOn2 = ({
24267
24597
  );
24268
24598
  }
24269
24599
  const meteredEntitlement = entitlement;
24270
- return /* @__PURE__ */ jsxs41(
24600
+ return /* @__PURE__ */ jsxs42(
24271
24601
  Flex,
24272
24602
  {
24273
24603
  as: "li",
@@ -24277,8 +24607,8 @@ var AddOn2 = ({
24277
24607
  $gap: "1rem",
24278
24608
  $listStyle: "none",
24279
24609
  children: [
24280
- /* @__PURE__ */ jsxs41(Flex, { $gap: "1rem", children: [
24281
- meteredEntitlement.feature?.icon && /* @__PURE__ */ jsx55(
24610
+ /* @__PURE__ */ jsxs42(Flex, { $gap: "1rem", children: [
24611
+ meteredEntitlement.feature?.icon && /* @__PURE__ */ jsx56(
24282
24612
  Icon3,
24283
24613
  {
24284
24614
  "data-testid": "sch-feature-icon",
@@ -24288,9 +24618,9 @@ var AddOn2 = ({
24288
24618
  rounded: true
24289
24619
  }
24290
24620
  ),
24291
- /* @__PURE__ */ jsx55(Flex, { $flexDirection: "column", $justifyContent: "center", children: /* @__PURE__ */ jsx55(Text, { children: meteredEntitlement.priceBehavior === EntitlementPriceBehavior.Overage && meteredEntitlement.softLimit ? `${meteredEntitlement.softLimit} ${getEntitlementFeatureName(meteredEntitlement, "units")}` : getEntitlementFeatureName(meteredEntitlement) }) })
24621
+ /* @__PURE__ */ jsx56(Flex, { $flexDirection: "column", $justifyContent: "center", children: /* @__PURE__ */ jsx56(Text, { children: meteredEntitlement.priceBehavior === EntitlementPriceBehavior.Overage && meteredEntitlement.softLimit ? `${meteredEntitlement.softLimit} ${getEntitlementFeatureName(meteredEntitlement, "units")}` : getEntitlementFeatureName(meteredEntitlement) }) })
24292
24622
  ] }),
24293
- /* @__PURE__ */ jsx55(
24623
+ /* @__PURE__ */ jsx56(
24294
24624
  Text,
24295
24625
  {
24296
24626
  style: { opacity: 0.54 },
@@ -24306,7 +24636,7 @@ var AddOn2 = ({
24306
24636
  })
24307
24637
  }
24308
24638
  ),
24309
- sharedProps.showCallToAction && (layout.upgrade.isVisible || layout.downgrade.isVisible) && /* @__PURE__ */ jsx55(Flex, { $flexDirection: "column", $gap: "0.5rem", children: /* @__PURE__ */ jsx55(
24639
+ sharedProps.showCallToAction && (layout.upgrade.isVisible || layout.downgrade.isVisible) && /* @__PURE__ */ jsx56(Flex, { $flexDirection: "column", $gap: "0.5rem", children: /* @__PURE__ */ jsx56(
24310
24640
  Button,
24311
24641
  {
24312
24642
  type: "button",
@@ -24348,7 +24678,7 @@ var AddOn2 = ({
24348
24678
  import { useState as useState19 } from "react";
24349
24679
 
24350
24680
  // src/components/elements/pricing-table/Entitlement.tsx
24351
- import { Fragment as Fragment25, jsx as jsx56, jsxs as jsxs42 } from "react/jsx-runtime";
24681
+ import { Fragment as Fragment25, jsx as jsx57, jsxs as jsxs43 } from "react/jsx-runtime";
24352
24682
  var Entitlement2 = ({
24353
24683
  entitlement,
24354
24684
  sharedProps,
@@ -24380,8 +24710,8 @@ var Entitlement2 = ({
24380
24710
  entitlement,
24381
24711
  credits
24382
24712
  );
24383
- return /* @__PURE__ */ jsxs42(Flex, { as: "li", $gap: "1rem", style: { listStyle: "none" }, children: [
24384
- layout.plans.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ jsx56(
24713
+ return /* @__PURE__ */ jsxs43(Flex, { as: "li", $gap: "1rem", style: { listStyle: "none" }, children: [
24714
+ layout.plans.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ jsx57(
24385
24715
  Icon3,
24386
24716
  {
24387
24717
  "data-testid": "sch-feature-icon",
@@ -24391,31 +24721,31 @@ var Entitlement2 = ({
24391
24721
  rounded: true
24392
24722
  }
24393
24723
  ),
24394
- entitlement.feature?.name && /* @__PURE__ */ jsxs42(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
24395
- /* @__PURE__ */ jsxs42(Flex, { $flexDirection: "column", $justifyContent: "center", $flexGrow: 1, children: [
24396
- /* @__PURE__ */ jsx56(Text, { children: typeof entitlementPrice === "number" && !tiered && (entitlement.priceBehavior === EntitlementPriceBehavior.PayInAdvance || entitlement.priceBehavior === EntitlementPriceBehavior.PayAsYouGo) ? /* @__PURE__ */ jsxs42(Fragment25, { children: [
24724
+ entitlement.feature?.name && /* @__PURE__ */ jsxs43(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
24725
+ /* @__PURE__ */ jsxs43(Flex, { $flexDirection: "column", $justifyContent: "center", $flexGrow: 1, children: [
24726
+ /* @__PURE__ */ jsx57(Text, { children: typeof entitlementPrice === "number" && !tiered && (entitlement.priceBehavior === EntitlementPriceBehavior.PayInAdvance || entitlement.priceBehavior === EntitlementPriceBehavior.PayAsYouGo) ? /* @__PURE__ */ jsxs43(Fragment25, { children: [
24397
24727
  formatCurrency(entitlementPrice, entitlementCurrency),
24398
24728
  " ",
24399
24729
  t3("per"),
24400
24730
  " ",
24401
- entitlementPackageSize > 1 && /* @__PURE__ */ jsxs42(Fragment25, { children: [
24731
+ entitlementPackageSize > 1 && /* @__PURE__ */ jsxs43(Fragment25, { children: [
24402
24732
  formatNumber(entitlementPackageSize),
24403
24733
  " "
24404
24734
  ] }),
24405
24735
  getFeatureName(entitlement.feature, entitlementPackageSize),
24406
- entitlement.priceBehavior === EntitlementPriceBehavior.PayInAdvance && /* @__PURE__ */ jsxs42(Fragment25, { children: [
24736
+ entitlement.priceBehavior === EntitlementPriceBehavior.PayInAdvance && /* @__PURE__ */ jsxs43(Fragment25, { children: [
24407
24737
  " ",
24408
24738
  t3("per"),
24409
24739
  " ",
24410
24740
  selectedPeriod
24411
24741
  ] })
24412
- ] }) : entitlement.priceBehavior === EntitlementPriceBehavior.Tier || tiered ? /* @__PURE__ */ jsx56(
24742
+ ] }) : entitlement.priceBehavior === EntitlementPriceBehavior.Tier || tiered ? /* @__PURE__ */ jsx57(
24413
24743
  TieredPricingDetails,
24414
24744
  {
24415
24745
  entitlement,
24416
24746
  period: selectedPeriod
24417
24747
  }
24418
- ) : showCredits && entitlement.priceBehavior === EntitlementPriceBehavior.CreditBurndown && entitlement.valueCredit && entitlement.consumptionRate ? /* @__PURE__ */ jsxs42(Fragment25, { children: [
24748
+ ) : showCredits && entitlement.priceBehavior === EntitlementPriceBehavior.CreditBurndown && entitlement.valueCredit && entitlement.consumptionRate ? /* @__PURE__ */ jsxs43(Fragment25, { children: [
24419
24749
  formatNumber(entitlement.consumptionRate),
24420
24750
  " ",
24421
24751
  getFeatureName(
@@ -24426,7 +24756,7 @@ var Entitlement2 = ({
24426
24756
  t3("per"),
24427
24757
  " ",
24428
24758
  getFeatureName(entitlement.feature, 1)
24429
- ] }) : entitlement.priceBehavior === EntitlementPriceBehavior.CreditBurndown && creditBasedEntitlementLimit ? /* @__PURE__ */ jsx56(Fragment25, { children: creditBasedEntitlementLimit?.period ? t3("Up to X units per period", {
24759
+ ] }) : entitlement.priceBehavior === EntitlementPriceBehavior.CreditBurndown && creditBasedEntitlementLimit ? /* @__PURE__ */ jsx57(Fragment25, { children: creditBasedEntitlementLimit?.period ? t3("Up to X units per period", {
24430
24760
  amount: formatNumber(creditBasedEntitlementLimit.limit),
24431
24761
  units: getFeatureName(
24432
24762
  entitlement.feature,
@@ -24439,25 +24769,25 @@ var Entitlement2 = ({
24439
24769
  entitlement.feature,
24440
24770
  creditBasedEntitlementLimit.limit
24441
24771
  )
24442
- }) }) : entitlement.valueType === EntitlementValueType.Numeric || entitlement.valueType === EntitlementValueType.Unlimited || entitlement.valueType === EntitlementValueType.Trait ? /* @__PURE__ */ jsxs42(Fragment25, { children: [
24772
+ }) }) : entitlement.valueType === EntitlementValueType.Numeric || entitlement.valueType === EntitlementValueType.Unlimited || entitlement.valueType === EntitlementValueType.Trait ? /* @__PURE__ */ jsxs43(Fragment25, { children: [
24443
24773
  entitlement.valueType === EntitlementValueType.Unlimited && !entitlement.priceBehavior ? t3("Unlimited", {
24444
24774
  item: getFeatureName(entitlement.feature)
24445
- }) : /* @__PURE__ */ jsxs42(Fragment25, { children: [
24446
- typeof limit === "number" && /* @__PURE__ */ jsxs42(Fragment25, { children: [
24775
+ }) : /* @__PURE__ */ jsxs43(Fragment25, { children: [
24776
+ typeof limit === "number" && /* @__PURE__ */ jsxs43(Fragment25, { children: [
24447
24777
  formatNumber(limit),
24448
24778
  " "
24449
24779
  ] }),
24450
24780
  getFeatureName(entitlement.feature, limit)
24451
24781
  ] }),
24452
- metricPeriodName && /* @__PURE__ */ jsxs42(Fragment25, { children: [
24782
+ metricPeriodName && /* @__PURE__ */ jsxs43(Fragment25, { children: [
24453
24783
  " ",
24454
24784
  t3("per"),
24455
24785
  " ",
24456
24786
  t3(metricPeriodName)
24457
24787
  ] })
24458
24788
  ] }) : entitlement.feature.name }),
24459
- /* @__PURE__ */ jsxs42(Text, { children: [
24460
- entitlement.priceBehavior === EntitlementPriceBehavior.Overage && typeof entitlementPrice === "number" ? /* @__PURE__ */ jsx56(Fragment25, { children: /* @__PURE__ */ jsxs42(
24789
+ /* @__PURE__ */ jsxs43(Text, { children: [
24790
+ entitlement.priceBehavior === EntitlementPriceBehavior.Overage && typeof entitlementPrice === "number" ? /* @__PURE__ */ jsx57(Fragment25, { children: /* @__PURE__ */ jsxs43(
24461
24791
  Text,
24462
24792
  {
24463
24793
  $size: 0.875 * settings.theme.typography.text.fontSize,
@@ -24467,7 +24797,7 @@ var Entitlement2 = ({
24467
24797
  " ",
24468
24798
  formatCurrency(entitlementPrice, entitlementCurrency),
24469
24799
  "/",
24470
- entitlementPackageSize > 1 && /* @__PURE__ */ jsxs42(Fragment25, { children: [
24800
+ entitlementPackageSize > 1 && /* @__PURE__ */ jsxs43(Fragment25, { children: [
24471
24801
  formatNumber(entitlementPackageSize),
24472
24802
  " "
24473
24803
  ] }),
@@ -24475,14 +24805,14 @@ var Entitlement2 = ({
24475
24805
  entitlement.feature,
24476
24806
  entitlementPackageSize
24477
24807
  ),
24478
- entitlement.feature.featureType === FeatureType.Trait && /* @__PURE__ */ jsxs42(Fragment25, { children: [
24808
+ entitlement.feature.featureType === FeatureType.Trait && /* @__PURE__ */ jsxs43(Fragment25, { children: [
24479
24809
  "/",
24480
24810
  shortenPeriod(selectedPeriod)
24481
24811
  ] })
24482
24812
  ]
24483
24813
  }
24484
- ) }) : (entitlement.priceBehavior === EntitlementPriceBehavior.Tier || tiered) && /* @__PURE__ */ jsxs42(Fragment25, { children: [
24485
- /* @__PURE__ */ jsx56(
24814
+ ) }) : (entitlement.priceBehavior === EntitlementPriceBehavior.Tier || tiered) && /* @__PURE__ */ jsxs43(Fragment25, { children: [
24815
+ /* @__PURE__ */ jsx57(
24486
24816
  Text,
24487
24817
  {
24488
24818
  style: { opacity: 0.54 },
@@ -24491,7 +24821,7 @@ var Entitlement2 = ({
24491
24821
  children: t3("Tier-based")
24492
24822
  }
24493
24823
  ),
24494
- /* @__PURE__ */ jsx56(
24824
+ /* @__PURE__ */ jsx57(
24495
24825
  PricingTiersTooltip,
24496
24826
  {
24497
24827
  feature: entitlement.feature,
@@ -24502,14 +24832,14 @@ var Entitlement2 = ({
24502
24832
  }
24503
24833
  )
24504
24834
  ] }),
24505
- entitlementHasHardLimit(entitlement) && entitlement.valueType === EntitlementValueType.Numeric && /* @__PURE__ */ jsx56(
24835
+ entitlementHasHardLimit(entitlement) && entitlement.valueType === EntitlementValueType.Numeric && /* @__PURE__ */ jsx57(
24506
24836
  HardLimitTooltip,
24507
24837
  {
24508
24838
  feature: entitlement.feature,
24509
24839
  limit: entitlement.valueNumeric
24510
24840
  }
24511
24841
  ),
24512
- entitlement.billingThreshold && /* @__PURE__ */ jsx56(
24842
+ entitlement.billingThreshold && /* @__PURE__ */ jsx57(
24513
24843
  BillingThresholdTooltip,
24514
24844
  {
24515
24845
  billingThreshold: entitlement.billingThreshold
@@ -24517,7 +24847,7 @@ var Entitlement2 = ({
24517
24847
  )
24518
24848
  ] })
24519
24849
  ] }),
24520
- layout.plans.showFeatureDescriptions && entitlement.feature?.description && /* @__PURE__ */ jsx56(
24850
+ layout.plans.showFeatureDescriptions && entitlement.feature?.description && /* @__PURE__ */ jsx57(
24521
24851
  Text,
24522
24852
  {
24523
24853
  $size: 0.875 * settings.theme.typography.text.fontSize,
@@ -24530,7 +24860,7 @@ var Entitlement2 = ({
24530
24860
  };
24531
24861
 
24532
24862
  // src/components/elements/pricing-table/Plan.tsx
24533
- import { Fragment as Fragment26, jsx as jsx57, jsxs as jsxs43 } from "react/jsx-runtime";
24863
+ import { Fragment as Fragment26, jsx as jsx58, jsxs as jsxs44 } from "react/jsx-runtime";
24534
24864
  var Plan2 = ({
24535
24865
  plan,
24536
24866
  index,
@@ -24573,7 +24903,7 @@ var Plan2 = ({
24573
24903
  const isUsageBasedPlan = isFreePlan && hasUsageBasedEntitlements;
24574
24904
  const headerPriceFontStyle = settings.theme.typography[layout.plans.name.fontStyle];
24575
24905
  const isExpanded = entitlementVisibility[plan.id] ?? false;
24576
- return /* @__PURE__ */ jsxs43(
24906
+ return /* @__PURE__ */ jsxs44(
24577
24907
  Flex,
24578
24908
  {
24579
24909
  as: "li",
@@ -24593,7 +24923,7 @@ var Plan2 = ({
24593
24923
  $boxShadow: cardBoxShadow
24594
24924
  },
24595
24925
  children: [
24596
- /* @__PURE__ */ jsxs43(
24926
+ /* @__PURE__ */ jsxs44(
24597
24927
  Flex,
24598
24928
  {
24599
24929
  $flexDirection: "column",
@@ -24604,7 +24934,7 @@ var Plan2 = ({
24604
24934
  $borderStyle: "solid",
24605
24935
  $borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.175)" : "hsla(0, 0%, 100%, 0.175)",
24606
24936
  children: [
24607
- /* @__PURE__ */ jsx57(Box, { children: /* @__PURE__ */ jsx57(
24937
+ /* @__PURE__ */ jsx58(Box, { children: /* @__PURE__ */ jsx58(
24608
24938
  Text,
24609
24939
  {
24610
24940
  as: "h3",
@@ -24613,8 +24943,8 @@ var Plan2 = ({
24613
24943
  children: plan.name
24614
24944
  }
24615
24945
  ) }),
24616
- layout.plans.description.isVisible && /* @__PURE__ */ jsx57(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx57(Text, { display: layout.plans.description.fontStyle, children: plan.description }) }),
24617
- /* @__PURE__ */ jsx57(Box, { children: /* @__PURE__ */ jsxs43(
24946
+ layout.plans.description.isVisible && /* @__PURE__ */ jsx58(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx58(Text, { display: layout.plans.description.fontStyle, children: plan.description }) }),
24947
+ /* @__PURE__ */ jsx58(Box, { children: /* @__PURE__ */ jsxs44(
24618
24948
  Text,
24619
24949
  {
24620
24950
  "data-testid": "sch-plan-price",
@@ -24630,14 +24960,14 @@ var Plan2 = ({
24630
24960
  currency: planCurrency,
24631
24961
  testSignificantDigits: false
24632
24962
  }) : formatCurrency(planPrice ?? 0, planCurrency),
24633
- !plan.custom && !isFreePlan && /* @__PURE__ */ jsxs43("sub", { children: [
24963
+ !plan.custom && !isFreePlan && /* @__PURE__ */ jsxs44("sub", { children: [
24634
24964
  "/",
24635
24965
  showAsMonthlyPrices && selectedPeriod === BillingProductPriceInterval.Year ? t3("month, billed yearly") : showAsMonthlyPrices && selectedPeriod === "quarter" ? t3("month, billed quarterly") : t3(selectedPeriod)
24636
24966
  ] })
24637
24967
  ]
24638
24968
  }
24639
24969
  ) }),
24640
- showCredits && credits.length > 0 && /* @__PURE__ */ jsx57(
24970
+ showCredits && credits.length > 0 && /* @__PURE__ */ jsx58(
24641
24971
  Flex,
24642
24972
  {
24643
24973
  as: "ul",
@@ -24649,8 +24979,8 @@ var Plan2 = ({
24649
24979
  $margin: 0,
24650
24980
  $listStyle: "none",
24651
24981
  children: credits.map((credit, idx) => {
24652
- return /* @__PURE__ */ jsxs43(Flex, { as: "li", $gap: "1rem", $listStyle: "none", children: [
24653
- layout.plans.showFeatureIcons && credit.icon && /* @__PURE__ */ jsx57(
24982
+ return /* @__PURE__ */ jsxs44(Flex, { as: "li", $gap: "1rem", $listStyle: "none", children: [
24983
+ layout.plans.showFeatureIcons && credit.icon && /* @__PURE__ */ jsx58(
24654
24984
  Icon3,
24655
24985
  {
24656
24986
  "data-testid": "sch-feature-icon",
@@ -24660,17 +24990,17 @@ var Plan2 = ({
24660
24990
  rounded: true
24661
24991
  }
24662
24992
  ),
24663
- credit.name && /* @__PURE__ */ jsx57(
24993
+ credit.name && /* @__PURE__ */ jsx58(
24664
24994
  Flex,
24665
24995
  {
24666
24996
  $flexDirection: "column",
24667
24997
  $justifyContent: "center",
24668
24998
  $gap: "0.5rem",
24669
- children: /* @__PURE__ */ jsxs43(Text, { children: [
24999
+ children: /* @__PURE__ */ jsxs44(Text, { children: [
24670
25000
  credit.quantity,
24671
25001
  " ",
24672
25002
  getFeatureName(credit, credit.quantity),
24673
- credit.period && /* @__PURE__ */ jsxs43(Fragment26, { children: [
25003
+ credit.period && /* @__PURE__ */ jsxs44(Fragment26, { children: [
24674
25004
  " ",
24675
25005
  t3("per"),
24676
25006
  " ",
@@ -24683,7 +25013,7 @@ var Plan2 = ({
24683
25013
  })
24684
25014
  }
24685
25015
  ),
24686
- isActivePlan && /* @__PURE__ */ jsx57(
25016
+ isActivePlan && /* @__PURE__ */ jsx58(
24687
25017
  Flex,
24688
25018
  {
24689
25019
  "data-testid": "sch-plan-active",
@@ -24693,7 +25023,7 @@ var Plan2 = ({
24693
25023
  $backgroundColor: settings.theme.primary,
24694
25024
  $borderRadius: "9999px",
24695
25025
  $padding: "0.125rem 0.85rem",
24696
- children: /* @__PURE__ */ jsx57(
25026
+ children: /* @__PURE__ */ jsx58(
24697
25027
  Text,
24698
25028
  {
24699
25029
  $size: 0.75 * settings.theme.typography.text.fontSize,
@@ -24706,7 +25036,7 @@ var Plan2 = ({
24706
25036
  ]
24707
25037
  }
24708
25038
  ),
24709
- /* @__PURE__ */ jsxs43(
25039
+ /* @__PURE__ */ jsxs44(
24710
25040
  Flex,
24711
25041
  {
24712
25042
  $flexDirection: "column",
@@ -24715,7 +25045,7 @@ var Plan2 = ({
24715
25045
  $gap: `${cardPadding}rem`,
24716
25046
  $padding: `${0.75 * cardPadding}rem ${cardPadding}rem 0`,
24717
25047
  children: [
24718
- layout.plans.showEntitlements && /* @__PURE__ */ jsxs43(
25048
+ layout.plans.showEntitlements && /* @__PURE__ */ jsxs44(
24719
25049
  Flex,
24720
25050
  {
24721
25051
  as: "ul",
@@ -24726,14 +25056,14 @@ var Plan2 = ({
24726
25056
  $margin: 0,
24727
25057
  $listStyle: "none",
24728
25058
  children: [
24729
- layout.plans.showInclusionText && index > 0 && /* @__PURE__ */ jsx57(Box, { $marginBottom: "1.5rem", children: /* @__PURE__ */ jsx57(Text, { children: t3("Everything in", {
25059
+ layout.plans.showInclusionText && index > 0 && /* @__PURE__ */ jsx58(Box, { $marginBottom: "1.5rem", children: /* @__PURE__ */ jsx58(Text, { children: t3("Everything in", {
24730
25060
  plan: plans[index - 1].name
24731
25061
  }) }) }),
24732
25062
  (plan.entitlements ?? []).reduce(
24733
25063
  (acc, entitlement, idx) => {
24734
25064
  if (isExpanded || idx < VISIBLE_ENTITLEMENT_COUNT) {
24735
25065
  acc.push(
24736
- /* @__PURE__ */ jsx57(
25066
+ /* @__PURE__ */ jsx58(
24737
25067
  Entitlement2,
24738
25068
  {
24739
25069
  entitlement,
@@ -24751,7 +25081,7 @@ var Plan2 = ({
24751
25081
  },
24752
25082
  []
24753
25083
  ),
24754
- (plan.entitlements ?? []).length > VISIBLE_ENTITLEMENT_COUNT && /* @__PURE__ */ jsxs43(
25084
+ (plan.entitlements ?? []).length > VISIBLE_ENTITLEMENT_COUNT && /* @__PURE__ */ jsxs44(
24755
25085
  Flex,
24756
25086
  {
24757
25087
  as: "li",
@@ -24761,14 +25091,14 @@ var Plan2 = ({
24761
25091
  $marginTop: "1rem",
24762
25092
  $listStyle: "none",
24763
25093
  children: [
24764
- /* @__PURE__ */ jsx57(
25094
+ /* @__PURE__ */ jsx58(
24765
25095
  Icon3,
24766
25096
  {
24767
25097
  name: isExpanded ? "chevron-up" : "chevron-down",
24768
25098
  color: "#D0D0D0"
24769
25099
  }
24770
25100
  ),
24771
- /* @__PURE__ */ jsx57(
25101
+ /* @__PURE__ */ jsx58(
24772
25102
  Text,
24773
25103
  {
24774
25104
  as: "button",
@@ -24797,7 +25127,7 @@ var Plan2 = ({
24797
25127
  ]
24798
25128
  }
24799
25129
  ),
24800
- isActivePlan ? /* @__PURE__ */ jsxs43(
25130
+ isActivePlan ? /* @__PURE__ */ jsxs44(
24801
25131
  Flex,
24802
25132
  {
24803
25133
  $justifyContent: "center",
@@ -24805,7 +25135,7 @@ var Plan2 = ({
24805
25135
  $gap: "0.25rem",
24806
25136
  $padding: "0.625rem 0",
24807
25137
  children: [
24808
- /* @__PURE__ */ jsx57(
25138
+ /* @__PURE__ */ jsx58(
24809
25139
  Icon3,
24810
25140
  {
24811
25141
  name: "check-rounded",
@@ -24813,11 +25143,11 @@ var Plan2 = ({
24813
25143
  color: settings.theme.primary
24814
25144
  }
24815
25145
  ),
24816
- /* @__PURE__ */ jsx57(Text, { $size: 15, $leading: "none", children: t3("Current plan") })
25146
+ /* @__PURE__ */ jsx58(Text, { $size: 15, $leading: "none", children: t3("Current plan") })
24817
25147
  ]
24818
25148
  }
24819
- ) : sharedProps.showCallToAction && (layout.upgrade.isVisible || layout.downgrade.isVisible) && /* @__PURE__ */ jsxs43(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
24820
- /* @__PURE__ */ jsx57(
25149
+ ) : sharedProps.showCallToAction && (layout.upgrade.isVisible || layout.downgrade.isVisible) && /* @__PURE__ */ jsxs44(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
25150
+ /* @__PURE__ */ jsx58(
24821
25151
  Button,
24822
25152
  {
24823
25153
  type: "button",
@@ -24855,10 +25185,10 @@ var Plan2 = ({
24855
25185
  }
24856
25186
  },
24857
25187
  $fullWidth: true,
24858
- children: plan.custom ? plan.customPlanConfig?.ctaText ?? t3("Talk to support") : !plan.valid ? /* @__PURE__ */ jsx57(Text, { as: Box, $align: "center", children: t3("Over plan limit") }) : t3("Choose plan")
25188
+ children: plan.custom ? plan.customPlanConfig?.ctaText ?? t3("Talk to support") : !plan.valid ? /* @__PURE__ */ jsx58(Text, { as: Box, $align: "center", children: t3("Over plan limit") }) : t3("Choose plan")
24859
25189
  }
24860
25190
  ),
24861
- !plan.valid && /* @__PURE__ */ jsx57(UsageViolationText, { violations: plan.usageViolations })
25191
+ !plan.valid && /* @__PURE__ */ jsx58(UsageViolationText, { violations: plan.usageViolations })
24862
25192
  ] })
24863
25193
  ]
24864
25194
  }
@@ -24869,7 +25199,7 @@ var Plan2 = ({
24869
25199
  };
24870
25200
 
24871
25201
  // src/components/elements/pricing-table/PricingTable.tsx
24872
- import { Fragment as Fragment28, jsx as jsx58, jsxs as jsxs44 } from "react/jsx-runtime";
25202
+ import { Fragment as Fragment28, jsx as jsx59, jsxs as jsxs45 } from "react/jsx-runtime";
24873
25203
  var resolveDesignProps8 = (props) => {
24874
25204
  return {
24875
25205
  showPeriodToggle: props.showPeriodToggle ?? true,
@@ -24974,7 +25304,7 @@ var PricingTable = forwardRef15(({ className, ...rest }, ref) => {
24974
25304
  }
24975
25305
  }, [data?.component, hydratePublic]);
24976
25306
  if (isPending) {
24977
- return /* @__PURE__ */ jsx58(
25307
+ return /* @__PURE__ */ jsx59(
24978
25308
  Flex,
24979
25309
  {
24980
25310
  $width: "100%",
@@ -24982,12 +25312,12 @@ var PricingTable = forwardRef15(({ className, ...rest }, ref) => {
24982
25312
  $alignItems: "center",
24983
25313
  $justifyContent: "center",
24984
25314
  $padding: `${settings.theme.card.padding / TEXT_BASE_SIZE}rem`,
24985
- children: /* @__PURE__ */ jsx58(Loader, { "aria-label": "loading", $size: "2xl" })
25315
+ children: /* @__PURE__ */ jsx59(Loader, { "aria-label": "loading", $size: "2xl" })
24986
25316
  }
24987
25317
  );
24988
25318
  }
24989
25319
  if (hasNoUsableCurrency) {
24990
- return /* @__PURE__ */ jsx58(Container, { children: /* @__PURE__ */ jsx58(Flex, { $justifyContent: "center", $padding: "2rem 0", children: /* @__PURE__ */ jsx58(InvalidCurrencyNotice, { invalidEntries: invalidFilterEntries }) }) });
25320
+ return /* @__PURE__ */ jsx59(Container, { children: /* @__PURE__ */ jsx59(Flex, { $justifyContent: "center", $padding: "2rem 0", children: /* @__PURE__ */ jsx59(InvalidCurrencyNotice, { invalidEntries: invalidFilterEntries }) }) });
24991
25321
  }
24992
25322
  const currentPlan = plans.find((plan) => plan.id === data?.company?.plan?.id);
24993
25323
  const showCallToAction = typeof data?.component !== "undefined" || typeof rest.callToActionUrl === "string" || typeof rest.onCallToAction === "function";
@@ -24996,7 +25326,7 @@ var PricingTable = forwardRef15(({ className, ...rest }, ref) => {
24996
25326
  rest.callToActionTarget
24997
25327
  );
24998
25328
  const Wrapper = typeof data?.component === "undefined" ? Container : Fragment27;
24999
- return /* @__PURE__ */ jsx58(Wrapper, { children: /* @__PURE__ */ jsxs44(
25329
+ return /* @__PURE__ */ jsx59(Wrapper, { children: /* @__PURE__ */ jsxs45(
25000
25330
  FussyChild,
25001
25331
  {
25002
25332
  ref,
@@ -25006,8 +25336,8 @@ var PricingTable = forwardRef15(({ className, ...rest }, ref) => {
25006
25336
  $flexDirection: "column",
25007
25337
  $gap: "2rem",
25008
25338
  children: [
25009
- /* @__PURE__ */ jsxs44(Box, { children: [
25010
- /* @__PURE__ */ jsxs44(
25339
+ /* @__PURE__ */ jsxs45(Box, { children: [
25340
+ /* @__PURE__ */ jsxs45(
25011
25341
  Flex,
25012
25342
  {
25013
25343
  $flexDirection: "column",
@@ -25022,7 +25352,7 @@ var PricingTable = forwardRef15(({ className, ...rest }, ref) => {
25022
25352
  }
25023
25353
  },
25024
25354
  children: [
25025
- /* @__PURE__ */ jsx58(
25355
+ /* @__PURE__ */ jsx59(
25026
25356
  Text,
25027
25357
  {
25028
25358
  as: "h2",
@@ -25031,8 +25361,8 @@ var PricingTable = forwardRef15(({ className, ...rest }, ref) => {
25031
25361
  children: props.header.isVisible && props.plans.isVisible && plans.length > 0 && t3("Plans")
25032
25362
  }
25033
25363
  ),
25034
- /* @__PURE__ */ jsxs44(Flex, { $alignItems: "center", $gap: "0.75rem", children: [
25035
- showCurrencySelector && /* @__PURE__ */ jsx58(
25364
+ /* @__PURE__ */ jsxs45(Flex, { $alignItems: "center", $gap: "0.75rem", children: [
25365
+ showCurrencySelector && /* @__PURE__ */ jsx59(
25036
25366
  CurrencyToggle,
25037
25367
  {
25038
25368
  currencies,
@@ -25040,7 +25370,7 @@ var PricingTable = forwardRef15(({ className, ...rest }, ref) => {
25040
25370
  onSelect: setSelectedCurrency
25041
25371
  }
25042
25372
  ),
25043
- showPeriodToggle && periods.length > 1 && /* @__PURE__ */ jsx58(
25373
+ showPeriodToggle && periods.length > 1 && /* @__PURE__ */ jsx59(
25044
25374
  PeriodToggle,
25045
25375
  {
25046
25376
  options: periods,
@@ -25057,7 +25387,7 @@ var PricingTable = forwardRef15(({ className, ...rest }, ref) => {
25057
25387
  ]
25058
25388
  }
25059
25389
  ),
25060
- props.plans.isVisible && plans.length > 0 && /* @__PURE__ */ jsx58(
25390
+ props.plans.isVisible && plans.length > 0 && /* @__PURE__ */ jsx59(
25061
25391
  Box,
25062
25392
  {
25063
25393
  as: "ul",
@@ -25070,7 +25400,7 @@ var PricingTable = forwardRef15(({ className, ...rest }, ref) => {
25070
25400
  $listStyle: "none",
25071
25401
  children: plans.map((plan, index, self2) => {
25072
25402
  const planPeriod = showPeriodToggle ? selectedPeriod : plan.monthlyPrice ? BillingProductPriceInterval.Month : plan.quarterlyPrice ? "quarter" : plan.yearlyPrice ? BillingProductPriceInterval.Year : BillingProductPriceInterval.Month;
25073
- return /* @__PURE__ */ jsx58(
25403
+ return /* @__PURE__ */ jsx59(
25074
25404
  Plan2,
25075
25405
  {
25076
25406
  plan,
@@ -25092,14 +25422,14 @@ var PricingTable = forwardRef15(({ className, ...rest }, ref) => {
25092
25422
  }
25093
25423
  )
25094
25424
  ] }),
25095
- /* @__PURE__ */ jsx58(Box, { children: props.addOns.isVisible && addOns.length > 0 && /* @__PURE__ */ jsxs44(Fragment28, { children: [
25096
- props.header.isVisible && /* @__PURE__ */ jsx58(
25425
+ /* @__PURE__ */ jsx59(Box, { children: props.addOns.isVisible && addOns.length > 0 && /* @__PURE__ */ jsxs45(Fragment28, { children: [
25426
+ props.header.isVisible && /* @__PURE__ */ jsx59(
25097
25427
  Flex,
25098
25428
  {
25099
25429
  $justifyContent: "space-between",
25100
25430
  $alignItems: "center",
25101
25431
  $marginBottom: "1rem",
25102
- children: /* @__PURE__ */ jsx58(
25432
+ children: /* @__PURE__ */ jsx59(
25103
25433
  Text,
25104
25434
  {
25105
25435
  as: "h2",
@@ -25110,7 +25440,7 @@ var PricingTable = forwardRef15(({ className, ...rest }, ref) => {
25110
25440
  )
25111
25441
  }
25112
25442
  ),
25113
- /* @__PURE__ */ jsx58(
25443
+ /* @__PURE__ */ jsx59(
25114
25444
  Box,
25115
25445
  {
25116
25446
  as: "ul",
@@ -25122,7 +25452,7 @@ var PricingTable = forwardRef15(({ className, ...rest }, ref) => {
25122
25452
  $listStyle: "none",
25123
25453
  children: addOns.map((addOn, index) => {
25124
25454
  const addOnPeriod = showPeriodToggle ? selectedPeriod : addOn.monthlyPrice ? BillingProductPriceInterval.Month : addOn.quarterlyPrice ? "quarter" : addOn.yearlyPrice ? BillingProductPriceInterval.Year : BillingProductPriceInterval.Month;
25125
- return /* @__PURE__ */ jsx58(
25455
+ return /* @__PURE__ */ jsx59(
25126
25456
  AddOn2,
25127
25457
  {
25128
25458
  addOn,
@@ -25150,7 +25480,7 @@ PricingTable.displayName = "PricingTable";
25150
25480
 
25151
25481
  // src/components/elements/text/Text.tsx
25152
25482
  import { forwardRef as forwardRef16 } from "react";
25153
- import { jsx as jsx59 } from "react/jsx-runtime";
25483
+ import { jsx as jsx60 } from "react/jsx-runtime";
25154
25484
  var resolveDesignProps9 = (props) => {
25155
25485
  return {
25156
25486
  text: {
@@ -25162,7 +25492,7 @@ var resolveDesignProps9 = (props) => {
25162
25492
  };
25163
25493
  var TextElement = forwardRef16(({ children, className, ...rest }, ref) => {
25164
25494
  const props = resolveDesignProps9(rest);
25165
- return /* @__PURE__ */ jsx59(Element, { as: Flex, ref, className, children: /* @__PURE__ */ jsx59(
25495
+ return /* @__PURE__ */ jsx60(Element, { as: Flex, ref, className, children: /* @__PURE__ */ jsx60(
25166
25496
  Text,
25167
25497
  {
25168
25498
  display: props.text.fontStyle,
@@ -25176,7 +25506,7 @@ TextElement.displayName = "Text";
25176
25506
 
25177
25507
  // src/components/elements/unsubscribe-button/UnsubscribeButton.tsx
25178
25508
  import { forwardRef as forwardRef17, useMemo as useMemo30 } from "react";
25179
- import { jsx as jsx60 } from "react/jsx-runtime";
25509
+ import { jsx as jsx61 } from "react/jsx-runtime";
25180
25510
  var buttonStyles = {
25181
25511
  primary: {
25182
25512
  color: "primary",
@@ -25212,7 +25542,7 @@ var UnsubscribeButton = forwardRef17(({ children, className, ...rest }, ref) =>
25212
25542
  if (!hasActiveSubscription) {
25213
25543
  return null;
25214
25544
  }
25215
- return /* @__PURE__ */ jsx60(
25545
+ return /* @__PURE__ */ jsx61(
25216
25546
  Element,
25217
25547
  {
25218
25548
  as: Flex,
@@ -25220,7 +25550,7 @@ var UnsubscribeButton = forwardRef17(({ children, className, ...rest }, ref) =>
25220
25550
  className,
25221
25551
  $flexDirection: "column",
25222
25552
  $gap: "2rem",
25223
- children: /* @__PURE__ */ jsx60(
25553
+ children: /* @__PURE__ */ jsx61(
25224
25554
  Button,
25225
25555
  {
25226
25556
  type: "button",
@@ -25242,7 +25572,7 @@ UnsubscribeButton.displayName = "UnsubscribeButton";
25242
25572
 
25243
25573
  // src/components/elements/upcoming-bill/UpcomingBill.tsx
25244
25574
  import { forwardRef as forwardRef18, useCallback as useCallback15, useEffect as useEffect9, useMemo as useMemo31, useState as useState21 } from "react";
25245
- import { jsx as jsx61, jsxs as jsxs45 } from "react/jsx-runtime";
25575
+ import { jsx as jsx62, jsxs as jsxs46 } from "react/jsx-runtime";
25246
25576
  function resolveDesignProps11(props) {
25247
25577
  return {
25248
25578
  header: {
@@ -25320,9 +25650,9 @@ var UpcomingBill = forwardRef18(({ className, ...rest }, ref) => {
25320
25650
  if (!data?.subscription || data.subscription.cancelAt) {
25321
25651
  return null;
25322
25652
  }
25323
- return /* @__PURE__ */ jsxs45(Element, { ref, className, children: [
25324
- /* @__PURE__ */ jsx61(Flex, { as: TransitionBox, $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ jsx61(Loader, { $color: settings.theme.primary, $isLoading: isLoading }) }),
25325
- error ? /* @__PURE__ */ jsxs45(
25653
+ return /* @__PURE__ */ jsxs46(Element, { ref, className, children: [
25654
+ /* @__PURE__ */ jsx62(Flex, { as: TransitionBox, $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ jsx62(Loader, { $color: settings.theme.primary, $isLoading: isLoading }) }),
25655
+ error ? /* @__PURE__ */ jsxs46(
25326
25656
  Flex,
25327
25657
  {
25328
25658
  as: TransitionBox,
@@ -25331,8 +25661,8 @@ var UpcomingBill = forwardRef18(({ className, ...rest }, ref) => {
25331
25661
  $alignItems: "center",
25332
25662
  $gap: "1rem",
25333
25663
  children: [
25334
- /* @__PURE__ */ jsx61(Text, { $weight: 500, $color: "#DB6669", children: t3("There was a problem retrieving your upcoming invoice.") }),
25335
- /* @__PURE__ */ jsx61(
25664
+ /* @__PURE__ */ jsx62(Text, { $weight: 500, $color: "#DB6669", children: t3("There was a problem retrieving your upcoming invoice.") }),
25665
+ /* @__PURE__ */ jsx62(
25336
25666
  Button,
25337
25667
  {
25338
25668
  type: "button",
@@ -25345,28 +25675,28 @@ var UpcomingBill = forwardRef18(({ className, ...rest }, ref) => {
25345
25675
  )
25346
25676
  ]
25347
25677
  }
25348
- ) : !isLoading && /* @__PURE__ */ jsx61(TransitionBox, { children: upcomingInvoice ? /* @__PURE__ */ jsxs45(Flex, { $flexDirection: "column", $gap: "1rem", children: [
25349
- props.header.isVisible && upcomingInvoice.dueDate && /* @__PURE__ */ jsxs45(Text, { display: props.header.fontStyle, children: [
25678
+ ) : !isLoading && /* @__PURE__ */ jsx62(TransitionBox, { children: upcomingInvoice ? /* @__PURE__ */ jsxs46(Flex, { $flexDirection: "column", $gap: "1rem", children: [
25679
+ props.header.isVisible && upcomingInvoice.dueDate && /* @__PURE__ */ jsxs46(Text, { display: props.header.fontStyle, children: [
25350
25680
  props.header.prefix,
25351
25681
  " ",
25352
25682
  toPrettyDate(upcomingInvoice.dueDate)
25353
25683
  ] }),
25354
- /* @__PURE__ */ jsxs45(
25684
+ /* @__PURE__ */ jsxs46(
25355
25685
  Flex,
25356
25686
  {
25357
25687
  $justifyContent: "space-between",
25358
25688
  $alignItems: "start",
25359
25689
  $gap: "1rem",
25360
25690
  children: [
25361
- props.price.isVisible && /* @__PURE__ */ jsx61(Text, { display: props.price.fontStyle, $leading: "none", children: formatCurrency(
25691
+ props.price.isVisible && /* @__PURE__ */ jsx62(Text, { display: props.price.fontStyle, $leading: "none", children: formatCurrency(
25362
25692
  upcomingInvoice.amountDue,
25363
25693
  upcomingInvoice.currency
25364
25694
  ) }),
25365
- /* @__PURE__ */ jsx61(Box, { $maxWidth: "10rem", $textAlign: "right", children: /* @__PURE__ */ jsx61(Text, { display: props.contractEndDate.fontStyle, children: t3("Estimated bill") }) })
25695
+ /* @__PURE__ */ jsx62(Box, { $maxWidth: "10rem", $textAlign: "right", children: /* @__PURE__ */ jsx62(Text, { display: props.contractEndDate.fontStyle, children: t3("Estimated bill") }) })
25366
25696
  ]
25367
25697
  }
25368
25698
  ),
25369
- balances.length > 0 && /* @__PURE__ */ jsxs45(
25699
+ balances.length > 0 && /* @__PURE__ */ jsxs46(
25370
25700
  Flex,
25371
25701
  {
25372
25702
  as: TransitionBox,
@@ -25374,20 +25704,20 @@ var UpcomingBill = forwardRef18(({ className, ...rest }, ref) => {
25374
25704
  $alignItems: "start",
25375
25705
  $gap: "1rem",
25376
25706
  children: [
25377
- /* @__PURE__ */ jsx61(Text, { $weight: 600, children: t3("Remaining balance") }),
25378
- /* @__PURE__ */ jsx61(Flex, { $flexDirection: "column", $gap: "0.5rem", children: balances.map((item, idx) => /* @__PURE__ */ jsx61(Text, { children: formatCurrency(item.balance, item.currency) }, idx)) })
25707
+ /* @__PURE__ */ jsx62(Text, { $weight: 600, children: t3("Remaining balance") }),
25708
+ /* @__PURE__ */ jsx62(Flex, { $flexDirection: "column", $gap: "0.5rem", children: balances.map((item, idx) => /* @__PURE__ */ jsx62(Text, { children: formatCurrency(item.balance, item.currency) }, idx)) })
25379
25709
  ]
25380
25710
  }
25381
25711
  ),
25382
- discounts.length > 0 && /* @__PURE__ */ jsxs45(
25712
+ discounts.length > 0 && /* @__PURE__ */ jsxs46(
25383
25713
  Flex,
25384
25714
  {
25385
25715
  $justifyContent: "space-between",
25386
25716
  $alignItems: "start",
25387
25717
  $gap: "1rem",
25388
25718
  children: [
25389
- /* @__PURE__ */ jsx61(Text, { $weight: 600, children: t3("Discount") }),
25390
- /* @__PURE__ */ jsx61(
25719
+ /* @__PURE__ */ jsx62(Text, { $weight: 600, children: t3("Discount") }),
25720
+ /* @__PURE__ */ jsx62(
25391
25721
  Flex,
25392
25722
  {
25393
25723
  $flexDirection: "column",
@@ -25397,13 +25727,13 @@ var UpcomingBill = forwardRef18(({ className, ...rest }, ref) => {
25397
25727
  (acc, discount) => {
25398
25728
  if (typeof discount.percentOff === "number" || typeof discount.amountOff === "number") {
25399
25729
  acc.push(
25400
- /* @__PURE__ */ jsxs45(
25730
+ /* @__PURE__ */ jsxs46(
25401
25731
  Flex,
25402
25732
  {
25403
25733
  $alignItems: "center",
25404
25734
  $gap: "0.5rem",
25405
25735
  children: [
25406
- discount.customerFacingCode && /* @__PURE__ */ jsx61(
25736
+ discount.customerFacingCode && /* @__PURE__ */ jsx62(
25407
25737
  Flex,
25408
25738
  {
25409
25739
  $alignItems: "center",
@@ -25412,7 +25742,7 @@ var UpcomingBill = forwardRef18(({ className, ...rest }, ref) => {
25412
25742
  $borderStyle: "solid",
25413
25743
  $borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.15)" : "hsla(0, 0%, 100%, 0.15)",
25414
25744
  $borderRadius: "0.3125rem",
25415
- children: /* @__PURE__ */ jsx61(
25745
+ children: /* @__PURE__ */ jsx62(
25416
25746
  Text,
25417
25747
  {
25418
25748
  $size: 0.75 * settings.theme.typography.text.fontSize,
@@ -25422,7 +25752,7 @@ var UpcomingBill = forwardRef18(({ className, ...rest }, ref) => {
25422
25752
  )
25423
25753
  }
25424
25754
  ),
25425
- /* @__PURE__ */ jsx61(Box, { children: /* @__PURE__ */ jsx61(Text, { children: typeof discount.percentOff === "number" ? t3("Percent off", {
25755
+ /* @__PURE__ */ jsx62(Box, { children: /* @__PURE__ */ jsx62(Text, { children: typeof discount.percentOff === "number" ? t3("Percent off", {
25426
25756
  percent: discount.percentOff
25427
25757
  }) : t3("Amount off", {
25428
25758
  amount: formatCurrency(
@@ -25446,7 +25776,7 @@ var UpcomingBill = forwardRef18(({ className, ...rest }, ref) => {
25446
25776
  ]
25447
25777
  }
25448
25778
  )
25449
- ] }) : /* @__PURE__ */ jsx61(Text, { display: "heading2", children: t3("No upcoming invoice") }) })
25779
+ ] }) : /* @__PURE__ */ jsx62(Text, { display: "heading2", children: t3("No upcoming invoice") }) })
25450
25780
  ] });
25451
25781
  });
25452
25782
  UpcomingBill.displayName = "UpcomingBill";
@@ -29706,11 +30036,11 @@ function createRenderer(options) {
29706
30036
  }
29707
30037
 
29708
30038
  // src/components/embed/Embed.tsx
29709
- import { jsx as jsx62, jsxs as jsxs46 } from "react/jsx-runtime";
30039
+ import { jsx as jsx63, jsxs as jsxs47 } from "react/jsx-runtime";
29710
30040
  var renderer = createRenderer();
29711
30041
  var Loading = () => {
29712
30042
  const { settings } = useEmbed();
29713
- return /* @__PURE__ */ jsx62(
30043
+ return /* @__PURE__ */ jsx63(
29714
30044
  Flex,
29715
30045
  {
29716
30046
  $width: "100%",
@@ -29718,13 +30048,13 @@ var Loading = () => {
29718
30048
  $alignItems: "center",
29719
30049
  $justifyContent: "center",
29720
30050
  $padding: `${settings.theme.card.padding / TEXT_BASE_SIZE}rem`,
29721
- children: /* @__PURE__ */ jsx62(Loader, { $color: settings.theme.primary, $size: "2xl" })
30051
+ children: /* @__PURE__ */ jsx63(Loader, { $color: settings.theme.primary, $size: "2xl" })
29722
30052
  }
29723
30053
  );
29724
30054
  };
29725
30055
  var Error2 = ({ message }) => {
29726
30056
  const { settings } = useEmbed();
29727
- return /* @__PURE__ */ jsxs46(
30057
+ return /* @__PURE__ */ jsxs47(
29728
30058
  Flex,
29729
30059
  {
29730
30060
  $flexDirection: "column",
@@ -29735,8 +30065,8 @@ var Error2 = ({ message }) => {
29735
30065
  $alignItems: "center",
29736
30066
  $justifyContent: "center",
29737
30067
  children: [
29738
- /* @__PURE__ */ jsx62(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx62(Text, { display: "heading1", children: "Error" }) }),
29739
- /* @__PURE__ */ jsx62(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx62(Text, { children: message }) })
30068
+ /* @__PURE__ */ jsx63(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx63(Text, { display: "heading1", children: "Error" }) }),
30069
+ /* @__PURE__ */ jsx63(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx63(Text, { children: message }) })
29740
30070
  ]
29741
30071
  }
29742
30072
  );
@@ -29810,13 +30140,13 @@ var SchematicEmbed = ({ id, accessToken }) => {
29810
30140
  return stub();
29811
30141
  }
29812
30142
  if (error) {
29813
- return /* @__PURE__ */ jsx62(Error2, { message: error.message });
30143
+ return /* @__PURE__ */ jsx63(Error2, { message: error.message });
29814
30144
  }
29815
30145
  if (accessToken?.length === 0) {
29816
- return /* @__PURE__ */ jsx62(Error2, { message: "Please provide an access token." });
30146
+ return /* @__PURE__ */ jsx63(Error2, { message: "Please provide an access token." });
29817
30147
  }
29818
30148
  if (!accessToken?.startsWith("token_")) {
29819
- return /* @__PURE__ */ jsx62(
30149
+ return /* @__PURE__ */ jsx63(
29820
30150
  Error2,
29821
30151
  {
29822
30152
  message: 'Invalid access token; your temporary access token will start with "token_".'
@@ -29824,9 +30154,9 @@ var SchematicEmbed = ({ id, accessToken }) => {
29824
30154
  );
29825
30155
  }
29826
30156
  if (isPending) {
29827
- return /* @__PURE__ */ jsx62(Loading, {});
30157
+ return /* @__PURE__ */ jsx63(Loading, {});
29828
30158
  }
29829
- return /* @__PURE__ */ jsx62(Box, { className: "sch-Embed", "data-testid": "sch-embed", children: children ?? /* @__PURE__ */ jsx62(Loading, {}) });
30159
+ return /* @__PURE__ */ jsx63(Box, { className: "sch-Embed", "data-testid": "sch-embed", children: children ?? /* @__PURE__ */ jsx63(Loading, {}) });
29830
30160
  };
29831
30161
  export {
29832
30162
  AddOns,