@schematichq/schematic-components 2.27.1 → 2.29.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.
- package/README.md +94 -1
- package/dist/schematic-components.browser.cjs.js +248 -107
- package/dist/schematic-components.browser.esm.js +248 -107
- package/dist/schematic-components.cjs.js +248 -107
- package/dist/schematic-components.d.ts +46 -0
- package/dist/schematic-components.esm.js +248 -107
- package/package.json +5 -5
|
@@ -1932,6 +1932,7 @@ var initialContext = {
|
|
|
1932
1932
|
hydrate: stub,
|
|
1933
1933
|
hydrateComponent: stub,
|
|
1934
1934
|
hydrateExternal: stub,
|
|
1935
|
+
rehydrateWithParams: stub,
|
|
1935
1936
|
getUpcomingInvoice: stub,
|
|
1936
1937
|
getCustomerBalance: stub,
|
|
1937
1938
|
listInvoices: stub,
|
|
@@ -7471,7 +7472,8 @@ function HydrateComponentParamsFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
7471
7472
|
return json;
|
|
7472
7473
|
}
|
|
7473
7474
|
return {
|
|
7474
|
-
catalogId: json["catalog_id"] == null ? void 0 : json["catalog_id"]
|
|
7475
|
+
catalogId: json["catalog_id"] == null ? void 0 : json["catalog_id"],
|
|
7476
|
+
includeAddOnIds: json["include_add_on_ids"] == null ? void 0 : json["include_add_on_ids"]
|
|
7475
7477
|
};
|
|
7476
7478
|
}
|
|
7477
7479
|
|
|
@@ -8503,6 +8505,9 @@ var CheckoutexternalApi = class extends BaseAPI {
|
|
|
8503
8505
|
if (requestParameters["catalogId"] != null) {
|
|
8504
8506
|
queryParameters["catalog_id"] = requestParameters["catalogId"];
|
|
8505
8507
|
}
|
|
8508
|
+
if (requestParameters["includeAddOnIds"] != null) {
|
|
8509
|
+
queryParameters["include_add_on_ids"] = requestParameters["includeAddOnIds"];
|
|
8510
|
+
}
|
|
8506
8511
|
const headerParameters = {};
|
|
8507
8512
|
if (this.configuration && this.configuration.apiKey) {
|
|
8508
8513
|
headerParameters["X-Schematic-Api-Key"] = await this.configuration.apiKey(
|
|
@@ -13129,6 +13134,7 @@ var en = {
|
|
|
13129
13134
|
"An invoice is created when charges reach $X; the rest is billed monthly.": "An invoice is created when charges reach {{amount}}; the rest is billed monthly.",
|
|
13130
13135
|
"An unknown error occurred.": "An unknown error occurred.",
|
|
13131
13136
|
"Billed": "Billed {{period}}",
|
|
13137
|
+
"Billing threshold": "Billing threshold",
|
|
13132
13138
|
"Bundle selected": "Bundle selected",
|
|
13133
13139
|
"Buy credits": "Buy credits",
|
|
13134
13140
|
"Cancel": "Cancel",
|
|
@@ -13163,8 +13169,11 @@ var en = {
|
|
|
13163
13169
|
"Due today": "Due today",
|
|
13164
13170
|
"Edit payment details": "Edit payment details",
|
|
13165
13171
|
"Edit": "Edit",
|
|
13172
|
+
"Email": "Email",
|
|
13166
13173
|
"Ends on": "Ends on {{date}}",
|
|
13167
13174
|
"Enter discount code": "Enter discount code",
|
|
13175
|
+
"Enter email address": "Enter email address",
|
|
13176
|
+
"Error": "Error",
|
|
13168
13177
|
"Error initializing payment method change. Please try again.": "Error initializing payment method change. Please try again.",
|
|
13169
13178
|
"Error processing payment. Please try a different payment method.": "Error processing payment. Please try a different payment method.",
|
|
13170
13179
|
"Error retrieving plan details. Please try again in a moment.": "Error retrieving plan details. Please try again in a moment.",
|
|
@@ -13185,6 +13194,7 @@ var en = {
|
|
|
13185
13194
|
"Invoice credit tooltip": "Credit \u2014 this amount was returned to your account, typically due to a plan change or proration",
|
|
13186
13195
|
"Invoice charge tooltip": "Charge \u2014 you were billed this amount",
|
|
13187
13196
|
"Invoices": "Invoices",
|
|
13197
|
+
"Limit": "Limit",
|
|
13188
13198
|
"Limit of": "Limit of {{amount}}",
|
|
13189
13199
|
"Loading": "Loading",
|
|
13190
13200
|
"Manage plan": "Manage plan",
|
|
@@ -13209,6 +13219,8 @@ var en = {
|
|
|
13209
13219
|
"Payment Details": "Payment Details",
|
|
13210
13220
|
"Plan selected": "Plan selected",
|
|
13211
13221
|
"Please accept the agreement to continue.": "Please accept the agreement to continue.",
|
|
13222
|
+
"Please try again later.": "Please try again later.",
|
|
13223
|
+
"Portal not found": "Portal not found",
|
|
13212
13224
|
"Plan": "Plan",
|
|
13213
13225
|
"Plans": "Plans",
|
|
13214
13226
|
"Please provide an access token.": "Please provide an access token.",
|
|
@@ -13260,6 +13272,7 @@ var en = {
|
|
|
13260
13272
|
"There was a problem retrieving your upcoming invoice.": "There was a problem retrieving your upcoming invoice.",
|
|
13261
13273
|
"There was a problem retrieving your invoices.": "There was a problem retrieving your invoices.",
|
|
13262
13274
|
"Tier-based": "Tier-based",
|
|
13275
|
+
"Tiered pricing": "Tiered pricing",
|
|
13263
13276
|
"Tiers apply progressively as quantity increases.": "Tiers apply progressively as quantity increases.",
|
|
13264
13277
|
"Top up balance with:": "Top up balance with:",
|
|
13265
13278
|
"Top-ups": "Top-ups",
|
|
@@ -13333,6 +13346,15 @@ var en = {
|
|
|
13333
13346
|
"$X/unit/period": "{{cost}}/{{unit}}/{{period}}",
|
|
13334
13347
|
"$X/Y units/period": "{{cost}}/{{size}} {{units}}/{{period}}",
|
|
13335
13348
|
"day": "day",
|
|
13349
|
+
"day_one": "day",
|
|
13350
|
+
"day_other": "days",
|
|
13351
|
+
"hour_one": "hour",
|
|
13352
|
+
"hour_other": "hours",
|
|
13353
|
+
"minute_one": "minute",
|
|
13354
|
+
"minute_other": "minutes",
|
|
13355
|
+
"second_one": "second",
|
|
13356
|
+
"second_other": "seconds",
|
|
13357
|
+
"week": "week",
|
|
13336
13358
|
"month": "month",
|
|
13337
13359
|
"quarter": "quarter",
|
|
13338
13360
|
"year": "year",
|
|
@@ -13341,6 +13363,13 @@ var en = {
|
|
|
13341
13363
|
"yr": "yr",
|
|
13342
13364
|
"one time": "one time",
|
|
13343
13365
|
"billing period": "billing period",
|
|
13366
|
+
"billing period_one": "billing period",
|
|
13367
|
+
"billing period_other": "billing periods",
|
|
13368
|
+
"daily": "daily",
|
|
13369
|
+
"weekly": "weekly",
|
|
13370
|
+
"monthly": "monthly",
|
|
13371
|
+
"quarterly": "quarterly",
|
|
13372
|
+
"yearly": "yearly",
|
|
13344
13373
|
"expires after purchase": "expires {{amount}} {{unit}} after purchase",
|
|
13345
13374
|
"expires at the end of the billing period": "expires at the end of the billing period",
|
|
13346
13375
|
"expires at the end of the next billing period": "expires at the end of the next billing period",
|
|
@@ -14030,11 +14059,9 @@ function formatBundleExpiry(bundle, t3) {
|
|
|
14030
14059
|
if (typeof bundle.expiryUnitCount !== "number") {
|
|
14031
14060
|
return void 0;
|
|
14032
14061
|
}
|
|
14033
|
-
const
|
|
14034
|
-
|
|
14035
|
-
|
|
14036
|
-
unit: pluralize(unit, bundle.expiryUnitCount)
|
|
14037
|
-
});
|
|
14062
|
+
const count = bundle.expiryUnitCount;
|
|
14063
|
+
const unit = bundle.expiryUnit === BillingCreditExpiryUnit.BillingPeriods ? t3("billing period", { count }) : t3("day", { count });
|
|
14064
|
+
return t3("expires after purchase", { amount: count, unit });
|
|
14038
14065
|
}
|
|
14039
14066
|
case BillingCreditExpiryType.EndOfBillingPeriod:
|
|
14040
14067
|
return t3("expires at the end of the billing period");
|
|
@@ -14279,16 +14306,33 @@ function entitlementHasHardLimit(entitlement) {
|
|
|
14279
14306
|
}
|
|
14280
14307
|
|
|
14281
14308
|
// src/utils/api/feature.ts
|
|
14282
|
-
function
|
|
14283
|
-
|
|
14309
|
+
function isEnglish(locale) {
|
|
14310
|
+
try {
|
|
14311
|
+
return new Intl.Locale(locale).language === "en";
|
|
14312
|
+
} catch {
|
|
14313
|
+
return true;
|
|
14314
|
+
}
|
|
14315
|
+
}
|
|
14316
|
+
function isOne(count, locale) {
|
|
14317
|
+
return new Intl.PluralRules(locale).select(count) === "one";
|
|
14318
|
+
}
|
|
14319
|
+
function getFeatureName(feature, locale, count, ignore = false) {
|
|
14320
|
+
if (!isEnglish(locale)) {
|
|
14321
|
+
const named = ignore ? { name: feature.name } : feature;
|
|
14322
|
+
const singularName2 = named.singularName || named.name;
|
|
14323
|
+
const pluralName2 = named.pluralName || singularName2;
|
|
14324
|
+
return count !== void 0 && isOne(count, locale) ? singularName2 : pluralName2;
|
|
14325
|
+
}
|
|
14326
|
+
const resolvedCount = count ?? 0;
|
|
14327
|
+
const shouldBePlural = resolvedCount === 0 || resolvedCount > 1;
|
|
14284
14328
|
const { name, singularName, pluralName } = feature;
|
|
14285
14329
|
if (!ignore && pluralName && shouldBePlural) {
|
|
14286
14330
|
return pluralName;
|
|
14287
14331
|
}
|
|
14288
14332
|
if (!ignore && singularName) {
|
|
14289
|
-
return shouldBePlural ? pluralize(singularName,
|
|
14333
|
+
return shouldBePlural ? pluralize(singularName, resolvedCount) : singularName;
|
|
14290
14334
|
}
|
|
14291
|
-
return pluralize(name,
|
|
14335
|
+
return pluralize(name, resolvedCount);
|
|
14292
14336
|
}
|
|
14293
14337
|
|
|
14294
14338
|
// src/utils/color.ts
|
|
@@ -14498,8 +14542,21 @@ function formatCurrency(amount, {
|
|
|
14498
14542
|
function formatOrdinal(n2, t3) {
|
|
14499
14543
|
return t3("Ordinal", { count: n2, ordinal: true });
|
|
14500
14544
|
}
|
|
14501
|
-
function adjectify(
|
|
14502
|
-
|
|
14545
|
+
function adjectify(period, t3) {
|
|
14546
|
+
switch (period) {
|
|
14547
|
+
case "day":
|
|
14548
|
+
return t3("daily");
|
|
14549
|
+
case "week":
|
|
14550
|
+
return t3("weekly");
|
|
14551
|
+
case "month":
|
|
14552
|
+
return t3("monthly");
|
|
14553
|
+
case "quarter":
|
|
14554
|
+
return t3("quarterly");
|
|
14555
|
+
case "year":
|
|
14556
|
+
return t3("yearly");
|
|
14557
|
+
default:
|
|
14558
|
+
return period;
|
|
14559
|
+
}
|
|
14503
14560
|
}
|
|
14504
14561
|
var CURRENCY_FLAGS = {
|
|
14505
14562
|
usd: "\u{1F1FA}\u{1F1F8}",
|
|
@@ -14615,11 +14672,12 @@ function getBillingPreviewText({
|
|
|
14615
14672
|
);
|
|
14616
14673
|
}
|
|
14617
14674
|
const schedule = scheduleParts.length > 0 ? `${scheduleParts.join(" ")} ` : "";
|
|
14675
|
+
const period = t3(planPeriod);
|
|
14618
14676
|
if (!discount) {
|
|
14619
14677
|
return t3("You will be billed", {
|
|
14620
14678
|
price: subscriptionPrice,
|
|
14621
14679
|
usage,
|
|
14622
|
-
period
|
|
14680
|
+
period,
|
|
14623
14681
|
schedule
|
|
14624
14682
|
});
|
|
14625
14683
|
}
|
|
@@ -14628,7 +14686,7 @@ function getBillingPreviewText({
|
|
|
14628
14686
|
return t3("You will be billed", {
|
|
14629
14687
|
price: discountedPrice,
|
|
14630
14688
|
usage,
|
|
14631
|
-
period
|
|
14689
|
+
period,
|
|
14632
14690
|
schedule
|
|
14633
14691
|
});
|
|
14634
14692
|
}
|
|
@@ -14636,7 +14694,7 @@ function getBillingPreviewText({
|
|
|
14636
14694
|
return t3("You will be billed with discount window", {
|
|
14637
14695
|
price: discountedPrice,
|
|
14638
14696
|
usage,
|
|
14639
|
-
period
|
|
14697
|
+
period,
|
|
14640
14698
|
schedule,
|
|
14641
14699
|
window: t3("for the next months", { count: durationInMonths }),
|
|
14642
14700
|
fullPrice: subscriptionPrice
|
|
@@ -14645,7 +14703,7 @@ function getBillingPreviewText({
|
|
|
14645
14703
|
return t3("You will be billed next bill discount", {
|
|
14646
14704
|
price: discountedPrice,
|
|
14647
14705
|
usage,
|
|
14648
|
-
period
|
|
14706
|
+
period,
|
|
14649
14707
|
schedule,
|
|
14650
14708
|
fullPrice: subscriptionPrice
|
|
14651
14709
|
});
|
|
@@ -15420,7 +15478,7 @@ var reducer = (state, action) => {
|
|
|
15420
15478
|
// src/context/EmbedProvider.tsx
|
|
15421
15479
|
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
15422
15480
|
var getCustomHeaders = (sessionId) => ({
|
|
15423
|
-
"X-Schematic-Components-Version": "2.
|
|
15481
|
+
"X-Schematic-Components-Version": "2.29.0",
|
|
15424
15482
|
"X-Schematic-Session-ID": sessionId
|
|
15425
15483
|
});
|
|
15426
15484
|
var normalizeCurrencyFilter = (filter2) => {
|
|
@@ -15618,6 +15676,34 @@ var EmbedProvider = ({
|
|
|
15618
15676
|
),
|
|
15619
15677
|
[hydrateExternal]
|
|
15620
15678
|
);
|
|
15679
|
+
const rehydrateWithParams = useCallback2(
|
|
15680
|
+
async (params) => {
|
|
15681
|
+
const componentId = state.data?.component?.id;
|
|
15682
|
+
if (!componentId || !checkoutApi) {
|
|
15683
|
+
throw new Error(
|
|
15684
|
+
"[Schematic] `rehydrateWithParams` needs a `SchematicEmbed` that has loaded."
|
|
15685
|
+
);
|
|
15686
|
+
}
|
|
15687
|
+
const response = await checkoutApi.hydrateComponent({
|
|
15688
|
+
componentId,
|
|
15689
|
+
includeAddOnIds: params.includeAddOnIds
|
|
15690
|
+
});
|
|
15691
|
+
const returnedIds = new Set(
|
|
15692
|
+
response.data.activeAddOns.map((addOn) => addOn.id)
|
|
15693
|
+
);
|
|
15694
|
+
const missingIds = (params.includeAddOnIds ?? []).filter(
|
|
15695
|
+
(id) => !returnedIds.has(id)
|
|
15696
|
+
);
|
|
15697
|
+
if (missingIds.length > 0) {
|
|
15698
|
+
console.warn(
|
|
15699
|
+
`[Schematic] These included add-ons were left out because each must be an add-on with a billing product: ${missingIds.join(", ")}`
|
|
15700
|
+
);
|
|
15701
|
+
}
|
|
15702
|
+
dispatch({ type: "HYDRATE_COMPONENT", data: response.data });
|
|
15703
|
+
return response.data;
|
|
15704
|
+
},
|
|
15705
|
+
[checkoutApi, state.data?.component?.id]
|
|
15706
|
+
);
|
|
15621
15707
|
const createSetupIntent = useCallback2(async () => {
|
|
15622
15708
|
return checkoutApi?.createSetupIntent();
|
|
15623
15709
|
}, [checkoutApi]);
|
|
@@ -15961,6 +16047,7 @@ var EmbedProvider = ({
|
|
|
15961
16047
|
hydrate: debouncedHydrate,
|
|
15962
16048
|
hydrateComponent: debouncedHydrateComponent,
|
|
15963
16049
|
hydrateExternal: debouncedHydrateExternal,
|
|
16050
|
+
rehydrateWithParams,
|
|
15964
16051
|
createSetupIntent: debouncedCreateSetupIntent,
|
|
15965
16052
|
updatePaymentMethod: debouncedUpdatePaymentMethod,
|
|
15966
16053
|
deletePaymentMethod: debouncedDeletePaymentMethod,
|
|
@@ -16315,6 +16402,7 @@ function useRequest(fn) {
|
|
|
16315
16402
|
import { useMemo as useMemo8 } from "react";
|
|
16316
16403
|
function useTrialEnd() {
|
|
16317
16404
|
const { data } = useEmbed();
|
|
16405
|
+
const { t: t3 } = useTranslation();
|
|
16318
16406
|
const { endDate, amount, units } = useMemo8(() => {
|
|
16319
16407
|
const billingSubscription = data?.company?.billingSubscription;
|
|
16320
16408
|
const end = typeof billingSubscription?.trialEnd === "number" ? new Date(billingSubscription.trialEnd * 1e3) : void 0;
|
|
@@ -16337,10 +16425,10 @@ function useTrialEnd() {
|
|
|
16337
16425
|
amount2 = Math.floor(difference / SECONDS_IN_MS);
|
|
16338
16426
|
unit = "second";
|
|
16339
16427
|
}
|
|
16340
|
-
units2 =
|
|
16428
|
+
units2 = t3(unit, { count: amount2 });
|
|
16341
16429
|
}
|
|
16342
16430
|
return { endDate: end, amount: amount2, units: units2 };
|
|
16343
|
-
}, [data?.company?.billingSubscription]);
|
|
16431
|
+
}, [data?.company?.billingSubscription, t3]);
|
|
16344
16432
|
return { endDate, amount, units };
|
|
16345
16433
|
}
|
|
16346
16434
|
|
|
@@ -17755,7 +17843,7 @@ var AutoTopupNotice = ({
|
|
|
17755
17843
|
trigger: /* @__PURE__ */ jsx14(
|
|
17756
17844
|
Icon3,
|
|
17757
17845
|
{
|
|
17758
|
-
title: "
|
|
17846
|
+
title: t3("Auto Top-up"),
|
|
17759
17847
|
name: "info-rounded",
|
|
17760
17848
|
color: `hsla(0, 0%, ${isLightBackground ? 0 : 100}%, 0.5)`,
|
|
17761
17849
|
style: { lineHeight: 0 }
|
|
@@ -17794,7 +17882,7 @@ var BillingThresholdTooltip = ({
|
|
|
17794
17882
|
trigger: /* @__PURE__ */ jsx15(
|
|
17795
17883
|
Icon3,
|
|
17796
17884
|
{
|
|
17797
|
-
title: "
|
|
17885
|
+
title: t3("Billing threshold"),
|
|
17798
17886
|
name: "info-rounded",
|
|
17799
17887
|
color: `hsla(0, 0%, ${isLightBackground ? 0 : 100}%, 0.5)`,
|
|
17800
17888
|
style: { lineHeight: 0 }
|
|
@@ -17990,7 +18078,7 @@ var Entitlement = ({
|
|
|
17990
18078
|
packageSize,
|
|
17991
18079
|
" "
|
|
17992
18080
|
] }),
|
|
17993
|
-
getFeatureName(entitlement.feature, packageSize),
|
|
18081
|
+
getFeatureName(entitlement.feature, locale, packageSize),
|
|
17994
18082
|
entitlement.priceBehavior === EntitlementPriceBehavior.PayInAdvance && /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
17995
18083
|
" ",
|
|
17996
18084
|
t3("per"),
|
|
@@ -18015,12 +18103,13 @@ var Entitlement = ({
|
|
|
18015
18103
|
" ",
|
|
18016
18104
|
getFeatureName(
|
|
18017
18105
|
entitlement.valueCredit,
|
|
18106
|
+
locale,
|
|
18018
18107
|
entitlement.consumptionRate || void 0
|
|
18019
18108
|
),
|
|
18020
18109
|
" ",
|
|
18021
18110
|
t3("per"),
|
|
18022
18111
|
" ",
|
|
18023
|
-
getFeatureName(entitlement.feature, 1)
|
|
18112
|
+
getFeatureName(entitlement.feature, locale, 1)
|
|
18024
18113
|
] });
|
|
18025
18114
|
}
|
|
18026
18115
|
if (entitlement.priceBehavior === EntitlementPriceBehavior.CreditBurndown && creditBasedEntitlementLimit) {
|
|
@@ -18028,13 +18117,17 @@ var Entitlement = ({
|
|
|
18028
18117
|
amount: creditBasedEntitlementLimit.limit,
|
|
18029
18118
|
units: getFeatureName(
|
|
18030
18119
|
entitlement.feature,
|
|
18120
|
+
locale,
|
|
18031
18121
|
creditBasedEntitlementLimit.limit
|
|
18032
18122
|
),
|
|
18033
|
-
period:
|
|
18123
|
+
period: t3(
|
|
18124
|
+
creditBasedEntitlementLimit.period
|
|
18125
|
+
)
|
|
18034
18126
|
}) : t3("Up to X units", {
|
|
18035
18127
|
amount: creditBasedEntitlementLimit.limit,
|
|
18036
18128
|
units: getFeatureName(
|
|
18037
18129
|
entitlement.feature,
|
|
18130
|
+
locale,
|
|
18038
18131
|
creditBasedEntitlementLimit.limit
|
|
18039
18132
|
)
|
|
18040
18133
|
}) });
|
|
@@ -18042,11 +18135,11 @@ var Entitlement = ({
|
|
|
18042
18135
|
if (hasNumericValue) {
|
|
18043
18136
|
return /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
18044
18137
|
entitlement.valueType === EntitlementValueType.Unlimited && !entitlement.priceBehavior ? t3("Unlimited", {
|
|
18045
|
-
item: getFeatureName(entitlement.feature)
|
|
18138
|
+
item: getFeatureName(entitlement.feature, locale)
|
|
18046
18139
|
}) : typeof limit === "number" && /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
18047
18140
|
formatNumber(limit, { locale }),
|
|
18048
18141
|
" ",
|
|
18049
|
-
getFeatureName(entitlement.feature, limit)
|
|
18142
|
+
getFeatureName(entitlement.feature, locale, limit)
|
|
18050
18143
|
] }),
|
|
18051
18144
|
metricPeriodName && /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
18052
18145
|
" ",
|
|
@@ -18085,7 +18178,7 @@ var Entitlement = ({
|
|
|
18085
18178
|
packageSize,
|
|
18086
18179
|
" "
|
|
18087
18180
|
] }),
|
|
18088
|
-
getFeatureName(entitlement.feature, packageSize),
|
|
18181
|
+
getFeatureName(entitlement.feature, locale, packageSize),
|
|
18089
18182
|
entitlement.feature.featureType === FeatureType.Trait && /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
18090
18183
|
"/",
|
|
18091
18184
|
shortenPeriod(period, t3)
|
|
@@ -18425,7 +18518,7 @@ var AutoTopup = ({
|
|
|
18425
18518
|
updateAutoTopupConfig
|
|
18426
18519
|
}) => {
|
|
18427
18520
|
const { settings } = useEmbed();
|
|
18428
|
-
const { t: t3 } = useTranslation();
|
|
18521
|
+
const { t: t3, locale } = useTranslation();
|
|
18429
18522
|
const cardPadding = settings.theme.card.padding / TEXT_BASE_SIZE;
|
|
18430
18523
|
const configurableCreditGrants = useMemo12(() => {
|
|
18431
18524
|
return planCreditGrants.reduce(
|
|
@@ -18472,7 +18565,7 @@ var AutoTopup = ({
|
|
|
18472
18565
|
}) }) }),
|
|
18473
18566
|
/* @__PURE__ */ jsx20(Box, { as: "p", $marginBottom: "2rem", children: /* @__PURE__ */ jsx20(Text, { children: t3(
|
|
18474
18567
|
"Automatically purchase more credits when your balance is low",
|
|
18475
|
-
{ units: getFeatureName(grant.credit) }
|
|
18568
|
+
{ units: getFeatureName(grant.credit, locale) }
|
|
18476
18569
|
) }) })
|
|
18477
18570
|
] }),
|
|
18478
18571
|
/* @__PURE__ */ jsxs10(Flex, { $alignItems: "center", $gap: "0.5rem", $marginBottom: "1rem", children: [
|
|
@@ -18669,7 +18762,7 @@ var Quantity = ({
|
|
|
18669
18762
|
$color: settings.theme.typography.text.color,
|
|
18670
18763
|
children: t3("Currently using", {
|
|
18671
18764
|
quantity: entitlement.usage,
|
|
18672
|
-
unit: getFeatureName(entitlement.feature)
|
|
18765
|
+
unit: getFeatureName(entitlement.feature, locale)
|
|
18673
18766
|
})
|
|
18674
18767
|
}
|
|
18675
18768
|
),
|
|
@@ -18734,7 +18827,11 @@ var Quantity = ({
|
|
|
18734
18827
|
packageSize,
|
|
18735
18828
|
" "
|
|
18736
18829
|
] }),
|
|
18737
|
-
getFeatureName(
|
|
18830
|
+
getFeatureName(
|
|
18831
|
+
entitlement.feature,
|
|
18832
|
+
locale,
|
|
18833
|
+
packageSize
|
|
18834
|
+
),
|
|
18738
18835
|
"/",
|
|
18739
18836
|
shortenPeriod(period, t3)
|
|
18740
18837
|
] })
|
|
@@ -18771,12 +18868,14 @@ var Quantity = ({
|
|
|
18771
18868
|
quantity: entitlement.quantity,
|
|
18772
18869
|
licenseName: getFeatureName(
|
|
18773
18870
|
entitlement.feature,
|
|
18871
|
+
locale,
|
|
18774
18872
|
entitlement.quantity
|
|
18775
18873
|
),
|
|
18776
18874
|
perUnit: perLicenseGrant.amount,
|
|
18777
18875
|
total: includedCredits,
|
|
18778
18876
|
creditName: getFeatureName(
|
|
18779
18877
|
licenseCredit,
|
|
18878
|
+
locale,
|
|
18780
18879
|
includedCredits
|
|
18781
18880
|
),
|
|
18782
18881
|
period: shortenPeriod(licenseCredit.period, t3)
|
|
@@ -18798,11 +18897,13 @@ var Quantity = ({
|
|
|
18798
18897
|
added: addedQuantity,
|
|
18799
18898
|
licenseName: getFeatureName(
|
|
18800
18899
|
entitlement.feature,
|
|
18900
|
+
locale,
|
|
18801
18901
|
addedQuantity
|
|
18802
18902
|
),
|
|
18803
18903
|
credits: addedCredits,
|
|
18804
18904
|
creditName: getFeatureName(
|
|
18805
18905
|
licenseCredit,
|
|
18906
|
+
locale,
|
|
18806
18907
|
addedCredits
|
|
18807
18908
|
)
|
|
18808
18909
|
}),
|
|
@@ -18812,9 +18913,10 @@ var Quantity = ({
|
|
|
18812
18913
|
total: includedCredits,
|
|
18813
18914
|
creditName: getFeatureName(
|
|
18814
18915
|
licenseCredit,
|
|
18916
|
+
locale,
|
|
18815
18917
|
includedCredits
|
|
18816
18918
|
),
|
|
18817
|
-
cadence: adjectify(licenseCredit.period),
|
|
18919
|
+
cadence: adjectify(licenseCredit.period, t3),
|
|
18818
18920
|
day: formatOrdinal(renewalDate.getDate(), t3)
|
|
18819
18921
|
})
|
|
18820
18922
|
] })
|
|
@@ -18853,6 +18955,7 @@ function renderMeteredEntitlementPricing({
|
|
|
18853
18955
|
"/",
|
|
18854
18956
|
feature ? getFeatureName(
|
|
18855
18957
|
feature,
|
|
18958
|
+
locale,
|
|
18856
18959
|
packageSize
|
|
18857
18960
|
) : featureName || "unit"
|
|
18858
18961
|
] });
|
|
@@ -18870,6 +18973,7 @@ function renderMeteredEntitlementPricing({
|
|
|
18870
18973
|
] }),
|
|
18871
18974
|
feature ? getFeatureName(
|
|
18872
18975
|
feature,
|
|
18976
|
+
locale,
|
|
18873
18977
|
packageSize
|
|
18874
18978
|
) : featureName || "unit"
|
|
18875
18979
|
] });
|
|
@@ -19187,7 +19291,7 @@ var Credits = ({
|
|
|
19187
19291
|
/* @__PURE__ */ jsx23(Box, { children: /* @__PURE__ */ jsxs13(Text, { display: "heading6", children: [
|
|
19188
19292
|
formatNumber(bundle.quantity ?? 0, { locale }),
|
|
19189
19293
|
" ",
|
|
19190
|
-
getFeatureName(bundle)
|
|
19294
|
+
getFeatureName(bundle, locale)
|
|
19191
19295
|
] }) })
|
|
19192
19296
|
] }),
|
|
19193
19297
|
typeof price === "number" && /* @__PURE__ */ jsx23(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx23(Text, { children: formatCurrency(price, {
|
|
@@ -21146,7 +21250,7 @@ var CurrencyPeriodMismatchNotice = ({
|
|
|
21146
21250
|
style: { opacity: 0.85, textAlign: "center" },
|
|
21147
21251
|
children: t3("No {{currency}} price for the {{period}} billing period.", {
|
|
21148
21252
|
currency: currency.toUpperCase(),
|
|
21149
|
-
period
|
|
21253
|
+
period: adjectify(period, t3)
|
|
21150
21254
|
})
|
|
21151
21255
|
}
|
|
21152
21256
|
)
|
|
@@ -21308,7 +21412,7 @@ var HardLimitTooltip = ({
|
|
|
21308
21412
|
feature,
|
|
21309
21413
|
limit
|
|
21310
21414
|
}) => {
|
|
21311
|
-
const { t: t3 } = useTranslation();
|
|
21415
|
+
const { t: t3, locale } = useTranslation();
|
|
21312
21416
|
const { data } = useEmbed();
|
|
21313
21417
|
const isLightBackground = useIsLightBackground();
|
|
21314
21418
|
const showHardLimit = data?.displaySettings?.showHardLimit ?? false;
|
|
@@ -21322,7 +21426,7 @@ var HardLimitTooltip = ({
|
|
|
21322
21426
|
trigger: /* @__PURE__ */ jsx32(
|
|
21323
21427
|
Icon3,
|
|
21324
21428
|
{
|
|
21325
|
-
title: "
|
|
21429
|
+
title: t3("Limit"),
|
|
21326
21430
|
name: "info-rounded",
|
|
21327
21431
|
color: `hsla(0, 0%, ${isLightBackground ? 0 : 100}%, 0.5)`,
|
|
21328
21432
|
style: { lineHeight: 0 }
|
|
@@ -21330,7 +21434,7 @@ var HardLimitTooltip = ({
|
|
|
21330
21434
|
),
|
|
21331
21435
|
content: /* @__PURE__ */ jsx32(Text, { children: t3("Up to a limit of", {
|
|
21332
21436
|
amount: limit,
|
|
21333
|
-
units: getFeatureName(feature, limit)
|
|
21437
|
+
units: getFeatureName(feature, locale, limit)
|
|
21334
21438
|
}) })
|
|
21335
21439
|
}
|
|
21336
21440
|
);
|
|
@@ -21699,7 +21803,7 @@ var PaymentForm = ({ onConfirm, financeData }) => {
|
|
|
21699
21803
|
)
|
|
21700
21804
|
] }),
|
|
21701
21805
|
stripe && collectEmail && /* @__PURE__ */ jsxs25(Box, { "data-field": "name", $marginBottom: "1.5rem", $verticalAlign: "top", children: [
|
|
21702
|
-
/* @__PURE__ */ jsx36(Label, { htmlFor: "email", children: "Email" }),
|
|
21806
|
+
/* @__PURE__ */ jsx36(Label, { htmlFor: "email", children: t3("Email") }),
|
|
21703
21807
|
/* @__PURE__ */ jsx36(
|
|
21704
21808
|
Input2,
|
|
21705
21809
|
{
|
|
@@ -21708,7 +21812,7 @@ var PaymentForm = ({ onConfirm, financeData }) => {
|
|
|
21708
21812
|
type: "email",
|
|
21709
21813
|
value: email,
|
|
21710
21814
|
autoComplete: "email",
|
|
21711
|
-
placeholder: "Enter email address",
|
|
21815
|
+
placeholder: t3("Enter email address"),
|
|
21712
21816
|
required: true,
|
|
21713
21817
|
onChange: (e) => {
|
|
21714
21818
|
userEditedEmailRef.current = true;
|
|
@@ -21835,7 +21939,7 @@ var PeriodToggle = ({
|
|
|
21835
21939
|
},
|
|
21836
21940
|
$size: 15,
|
|
21837
21941
|
$weight: option === selectedOption ? 600 : 400,
|
|
21838
|
-
children: t3("Billed", { period: adjectify(option) })
|
|
21942
|
+
children: t3("Billed", { period: adjectify(option, t3) })
|
|
21839
21943
|
}
|
|
21840
21944
|
)
|
|
21841
21945
|
},
|
|
@@ -21875,7 +21979,7 @@ var PlanCreditText = ({
|
|
|
21875
21979
|
entitlements,
|
|
21876
21980
|
children
|
|
21877
21981
|
}) => {
|
|
21878
|
-
const { t: t3 } = useTranslation();
|
|
21982
|
+
const { t: t3, locale } = useTranslation();
|
|
21879
21983
|
const { settings } = useEmbed();
|
|
21880
21984
|
const sources = entitlements ?? [];
|
|
21881
21985
|
const { perLicenseGrants } = credit;
|
|
@@ -21883,7 +21987,7 @@ var PlanCreditText = ({
|
|
|
21883
21987
|
return /* @__PURE__ */ jsxs26(Text, { children: [
|
|
21884
21988
|
credit.quantity,
|
|
21885
21989
|
" ",
|
|
21886
|
-
getFeatureName(credit, credit.quantity),
|
|
21990
|
+
getFeatureName(credit, locale, credit.quantity),
|
|
21887
21991
|
credit.period && /* @__PURE__ */ jsxs26(Fragment11, { children: [
|
|
21888
21992
|
" ",
|
|
21889
21993
|
t3("per"),
|
|
@@ -21895,18 +21999,18 @@ var PlanCreditText = ({
|
|
|
21895
21999
|
}
|
|
21896
22000
|
const resolveLicenseName = (grant) => {
|
|
21897
22001
|
const licenseFeature = (findLicenseSource(sources, grant.licenseId) ?? (grant.licenseId ? void 0 : findSoleLicenseSource(sources)))?.feature;
|
|
21898
|
-
return licenseFeature ? getFeatureName(licenseFeature, 1) : t3("license");
|
|
22002
|
+
return licenseFeature ? getFeatureName(licenseFeature, locale, 1) : t3("license");
|
|
21899
22003
|
};
|
|
21900
22004
|
return /* @__PURE__ */ jsxs26(Flex, { $flexDirection: "column", $gap: "0.25rem", children: [
|
|
21901
22005
|
perLicenseGrants.map((grant, grantIndex) => /* @__PURE__ */ jsxs26(Text, { children: [
|
|
21902
22006
|
credit.period ? t3("X credits per license per period", {
|
|
21903
22007
|
amount: grant.amount,
|
|
21904
|
-
creditName: getFeatureName(credit, grant.amount),
|
|
22008
|
+
creditName: getFeatureName(credit, locale, grant.amount),
|
|
21905
22009
|
licenseName: resolveLicenseName(grant),
|
|
21906
22010
|
period: t3(credit.period)
|
|
21907
22011
|
}) : t3("X credits per license", {
|
|
21908
22012
|
amount: grant.amount,
|
|
21909
|
-
creditName: getFeatureName(credit, grant.amount),
|
|
22013
|
+
creditName: getFeatureName(credit, locale, grant.amount),
|
|
21910
22014
|
licenseName: resolveLicenseName(grant)
|
|
21911
22015
|
}),
|
|
21912
22016
|
grantIndex === 0 && children
|
|
@@ -21919,7 +22023,7 @@ var PlanCreditText = ({
|
|
|
21919
22023
|
$color: settings.theme.typography.text.color,
|
|
21920
22024
|
children: t3("Plus X credits per period for your company", {
|
|
21921
22025
|
amount: credit.fixedQuantity,
|
|
21922
|
-
creditName: getFeatureName(credit, credit.fixedQuantity),
|
|
22026
|
+
creditName: getFeatureName(credit, locale, credit.fixedQuantity),
|
|
21923
22027
|
period: t3(credit.period)
|
|
21924
22028
|
})
|
|
21925
22029
|
}
|
|
@@ -21948,7 +22052,7 @@ var PriceText = ({
|
|
|
21948
22052
|
formatCurrency(perUnitPrice, { locale, currency }),
|
|
21949
22053
|
/* @__PURE__ */ jsxs27("sub", { children: [
|
|
21950
22054
|
"/",
|
|
21951
|
-
getFeatureName(feature, 1)
|
|
22055
|
+
getFeatureName(feature, locale, 1)
|
|
21952
22056
|
] })
|
|
21953
22057
|
] });
|
|
21954
22058
|
}
|
|
@@ -21965,7 +22069,7 @@ var PriceText = ({
|
|
|
21965
22069
|
formatCurrency(perUnitPrice, { locale, currency }),
|
|
21966
22070
|
/* @__PURE__ */ jsxs27("sub", { children: [
|
|
21967
22071
|
"/",
|
|
21968
|
-
getFeatureName(feature, 1)
|
|
22072
|
+
getFeatureName(feature, locale, 1)
|
|
21969
22073
|
] }),
|
|
21970
22074
|
" + ",
|
|
21971
22075
|
formatCurrency(flatAmount, { locale, currency }),
|
|
@@ -22026,7 +22130,7 @@ var PricingTiersTooltip = ({
|
|
|
22026
22130
|
trigger: /* @__PURE__ */ jsx40(
|
|
22027
22131
|
Icon3,
|
|
22028
22132
|
{
|
|
22029
|
-
title: "
|
|
22133
|
+
title: t3("Tiered pricing"),
|
|
22030
22134
|
name: "info-rounded",
|
|
22031
22135
|
color: `hsla(0, 0%, ${isLightBackground ? 0 : 100}%, 0.5)`,
|
|
22032
22136
|
style: { lineHeight: 0 }
|
|
@@ -22535,11 +22639,11 @@ var EntitlementRow = (props) => {
|
|
|
22535
22639
|
/* @__PURE__ */ jsx42(Box, { children: /* @__PURE__ */ jsx42(Text, { display: "heading4", children: priceBehavior === EntitlementPriceBehavior.PayInAdvance ? /* @__PURE__ */ jsxs30(Fragment14, { children: [
|
|
22536
22640
|
quantity,
|
|
22537
22641
|
" ",
|
|
22538
|
-
getFeatureName(feature, quantity)
|
|
22642
|
+
getFeatureName(feature, locale, quantity)
|
|
22539
22643
|
] }) : priceBehavior === EntitlementPriceBehavior.Overage && typeof softLimit === "number" ? /* @__PURE__ */ jsxs30(Fragment14, { children: [
|
|
22540
22644
|
softLimit,
|
|
22541
22645
|
" ",
|
|
22542
|
-
getFeatureName(feature, softLimit)
|
|
22646
|
+
getFeatureName(feature, locale, softLimit)
|
|
22543
22647
|
] }) : feature.name }) }),
|
|
22544
22648
|
/* @__PURE__ */ jsx42(Box, { $whiteSpace: "nowrap", $lineHeight: 1, children: priceBehavior === EntitlementPriceBehavior.PayInAdvance ? (
|
|
22545
22649
|
// A tiered scheme still resolves to a fixed amount at the chosen
|
|
@@ -22570,7 +22674,7 @@ var EntitlementRow = (props) => {
|
|
|
22570
22674
|
packageSize,
|
|
22571
22675
|
" "
|
|
22572
22676
|
] }),
|
|
22573
|
-
getFeatureName(feature, packageSize),
|
|
22677
|
+
getFeatureName(feature, locale, packageSize),
|
|
22574
22678
|
feature.featureType === FeatureType.Trait && /* @__PURE__ */ jsxs30(Fragment14, { children: [
|
|
22575
22679
|
"/",
|
|
22576
22680
|
shortenPeriod(planPeriod, t3)
|
|
@@ -22867,7 +22971,7 @@ var SubscriptionSidebar = forwardRef7(
|
|
|
22867
22971
|
$color: settings.theme.typography.text.color,
|
|
22868
22972
|
children: t3("Includes X credits per period", {
|
|
22869
22973
|
total: includedCredits,
|
|
22870
|
-
creditName: getFeatureName(credit, includedCredits),
|
|
22974
|
+
creditName: getFeatureName(credit, locale, includedCredits),
|
|
22871
22975
|
period: shortenPeriod(credit.period, t3)
|
|
22872
22976
|
})
|
|
22873
22977
|
}
|
|
@@ -23605,7 +23709,7 @@ var SubscriptionSidebar = forwardRef7(
|
|
|
23605
23709
|
/* @__PURE__ */ jsx44(Box, { children: /* @__PURE__ */ jsxs32(Text, { children: [
|
|
23606
23710
|
formatNumber(amount, { locale }),
|
|
23607
23711
|
" ",
|
|
23608
|
-
getFeatureName(bundle, amount),
|
|
23712
|
+
getFeatureName(bundle, locale, amount),
|
|
23609
23713
|
expiry && ` \xB7 ${expiry}`
|
|
23610
23714
|
] }) })
|
|
23611
23715
|
] }),
|
|
@@ -23899,21 +24003,21 @@ var TieredPricingDetails = ({
|
|
|
23899
24003
|
if (flatAmount === 0 && perUnitPrice === 0) {
|
|
23900
24004
|
return t3("Up to X units for free", {
|
|
23901
24005
|
X: upTo,
|
|
23902
|
-
units: getFeatureName(entitlement.feature, upTo)
|
|
24006
|
+
units: getFeatureName(entitlement.feature, locale, upTo)
|
|
23903
24007
|
});
|
|
23904
24008
|
}
|
|
23905
24009
|
if (flatAmount === 0 && perUnitPrice > 0) {
|
|
23906
24010
|
return t3("Up to X units at $Y/unit", {
|
|
23907
24011
|
X: upTo,
|
|
23908
|
-
units: getFeatureName(entitlement.feature, upTo),
|
|
24012
|
+
units: getFeatureName(entitlement.feature, locale, upTo),
|
|
23909
24013
|
Y: formatCurrency(perUnitPrice, { locale, currency }),
|
|
23910
|
-
unit: getFeatureName(entitlement.feature, 1)
|
|
24014
|
+
unit: getFeatureName(entitlement.feature, locale, 1)
|
|
23911
24015
|
});
|
|
23912
24016
|
}
|
|
23913
24017
|
if (flatAmount > 0 && perUnitPrice === 0) {
|
|
23914
24018
|
return t3("Up to X units for $Y/period", {
|
|
23915
24019
|
X: upTo,
|
|
23916
|
-
units: getFeatureName(entitlement.feature, upTo),
|
|
24020
|
+
units: getFeatureName(entitlement.feature, locale, upTo),
|
|
23917
24021
|
Y: formatCurrency(flatAmount, { locale, currency }),
|
|
23918
24022
|
period
|
|
23919
24023
|
});
|
|
@@ -23921,9 +24025,9 @@ var TieredPricingDetails = ({
|
|
|
23921
24025
|
if (flatAmount > 0 && perUnitPrice > 0) {
|
|
23922
24026
|
return t3("Up to X units at $Y/unit + $Z/period", {
|
|
23923
24027
|
X: upTo,
|
|
23924
|
-
units: getFeatureName(entitlement.feature, upTo),
|
|
24028
|
+
units: getFeatureName(entitlement.feature, locale, upTo),
|
|
23925
24029
|
Y: formatCurrency(perUnitPrice, { locale, currency }),
|
|
23926
|
-
unit: getFeatureName(entitlement.feature, 1),
|
|
24030
|
+
unit: getFeatureName(entitlement.feature, locale, 1),
|
|
23927
24031
|
Z: formatCurrency(flatAmount, { locale, currency }),
|
|
23928
24032
|
period
|
|
23929
24033
|
});
|
|
@@ -24226,6 +24330,7 @@ var Badge = () => {
|
|
|
24226
24330
|
// src/components/layout/RenderLayout.tsx
|
|
24227
24331
|
import { jsx as jsx48, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
24228
24332
|
var Disabled = () => {
|
|
24333
|
+
const { t: t3 } = useTranslation();
|
|
24229
24334
|
return /* @__PURE__ */ jsx48(Box, { $width: "max-content", $height: "max-content", children: /* @__PURE__ */ jsx48(Card, { children: /* @__PURE__ */ jsxs35(
|
|
24230
24335
|
Element,
|
|
24231
24336
|
{
|
|
@@ -24235,8 +24340,8 @@ var Disabled = () => {
|
|
|
24235
24340
|
$alignItems: "center",
|
|
24236
24341
|
$whiteSpace: "nowrap",
|
|
24237
24342
|
children: [
|
|
24238
|
-
/* @__PURE__ */ jsx48(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx48(Text, { as: "h1", display: "heading1", children: "Portal not found" }) }),
|
|
24239
|
-
/* @__PURE__ */ jsx48(Text, { as: "p", children: "Please try again later." })
|
|
24343
|
+
/* @__PURE__ */ jsx48(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx48(Text, { as: "h1", display: "heading1", children: t3("Portal not found") }) }),
|
|
24344
|
+
/* @__PURE__ */ jsx48(Text, { as: "p", children: t3("Please try again later.") })
|
|
24240
24345
|
]
|
|
24241
24346
|
}
|
|
24242
24347
|
) }) });
|
|
@@ -24430,12 +24535,12 @@ var UsageDetails = ({ entitlement, layout }) => {
|
|
|
24430
24535
|
if (priceBehavior === EntitlementPriceBehavior.PayInAdvance && typeof allocation === "number") {
|
|
24431
24536
|
return t3("X units", {
|
|
24432
24537
|
amount: formatNumber(allocation, { locale }),
|
|
24433
|
-
units: getFeatureName(feature, allocation)
|
|
24538
|
+
units: getFeatureName(feature, locale, allocation)
|
|
24434
24539
|
});
|
|
24435
24540
|
}
|
|
24436
24541
|
if (priceBehavior === EntitlementPriceBehavior.PayAsYouGo && typeof price === "number") {
|
|
24437
24542
|
const formattedCost = formatCurrency(price, { locale, currency });
|
|
24438
|
-
const featureName = getFeatureName(feature, packageSize);
|
|
24543
|
+
const featureName = getFeatureName(feature, locale, packageSize);
|
|
24439
24544
|
return packageSize > 1 ? t3("$X per Y units", {
|
|
24440
24545
|
cost: formattedCost,
|
|
24441
24546
|
size: packageSize,
|
|
@@ -24445,15 +24550,15 @@ var UsageDetails = ({ entitlement, layout }) => {
|
|
|
24445
24550
|
if (priceBehavior === EntitlementPriceBehavior.Overage && typeof softLimit === "number") {
|
|
24446
24551
|
return t3("X units", {
|
|
24447
24552
|
amount: formatNumber(softLimit, { locale }),
|
|
24448
|
-
units: getFeatureName(feature, softLimit)
|
|
24553
|
+
units: getFeatureName(feature, locale, softLimit)
|
|
24449
24554
|
});
|
|
24450
24555
|
}
|
|
24451
24556
|
if (priceBehavior === EntitlementPriceBehavior.Tier) {
|
|
24452
24557
|
return typeof currentTier?.to === "number" && (currentTier?.to === Infinity ? t3("Unlimited in this tier", {
|
|
24453
|
-
feature: getFeatureName(feature)
|
|
24558
|
+
feature: getFeatureName(feature, locale)
|
|
24454
24559
|
}) : t3("Up to X units in this tier", {
|
|
24455
24560
|
amount: formatNumber(currentTier.to, { locale }),
|
|
24456
|
-
feature: getFeatureName(feature, currentTier.to)
|
|
24561
|
+
feature: getFeatureName(feature, locale, currentTier.to)
|
|
24457
24562
|
}));
|
|
24458
24563
|
}
|
|
24459
24564
|
if (showCredits && priceBehavior === EntitlementPriceBehavior.CreditBurndown && planEntitlement?.valueCredit && typeof planEntitlement?.consumptionRate === "number") {
|
|
@@ -24461,6 +24566,7 @@ var UsageDetails = ({ entitlement, layout }) => {
|
|
|
24461
24566
|
amount: formatConsumptionRate(planEntitlement.consumptionRate, locale),
|
|
24462
24567
|
units: getFeatureName(
|
|
24463
24568
|
planEntitlement.valueCredit,
|
|
24569
|
+
locale,
|
|
24464
24570
|
planEntitlement.consumptionRate
|
|
24465
24571
|
)
|
|
24466
24572
|
});
|
|
@@ -24468,18 +24574,18 @@ var UsageDetails = ({ entitlement, layout }) => {
|
|
|
24468
24574
|
if (priceBehavior === EntitlementPriceBehavior.CreditBurndown && typeof limit === "number") {
|
|
24469
24575
|
return t3("X units remaining", {
|
|
24470
24576
|
amount: formatNumber(limit, { locale }),
|
|
24471
|
-
units: getFeatureName(feature, limit)
|
|
24577
|
+
units: getFeatureName(feature, locale, limit)
|
|
24472
24578
|
});
|
|
24473
24579
|
}
|
|
24474
24580
|
if (!priceBehavior && typeof allocation === "number") {
|
|
24475
24581
|
const numericLimit = limit ?? allocation;
|
|
24476
24582
|
return t3("X units", {
|
|
24477
24583
|
amount: formatNumber(numericLimit, { locale }),
|
|
24478
|
-
units: getFeatureName(feature, numericLimit)
|
|
24584
|
+
units: getFeatureName(feature, locale, numericLimit)
|
|
24479
24585
|
});
|
|
24480
24586
|
}
|
|
24481
24587
|
if (!priceBehavior && allocationType === "unlimited") {
|
|
24482
|
-
return t3("Unlimited", { item: getFeatureName(feature) });
|
|
24588
|
+
return t3("Unlimited", { item: getFeatureName(feature, locale) });
|
|
24483
24589
|
}
|
|
24484
24590
|
}, [
|
|
24485
24591
|
t3,
|
|
@@ -24508,11 +24614,11 @@ var UsageDetails = ({ entitlement, layout }) => {
|
|
|
24508
24614
|
/* @__PURE__ */ jsx51(Fragment17, { children: packageSize > 1 ? t3("$X/Y units/period", {
|
|
24509
24615
|
cost: formatCurrency(price, { locale, currency }),
|
|
24510
24616
|
size: packageSize,
|
|
24511
|
-
units: getFeatureName(feature, packageSize),
|
|
24617
|
+
units: getFeatureName(feature, locale, packageSize),
|
|
24512
24618
|
period: shortenPeriod(period, t3)
|
|
24513
24619
|
}) : t3("$X/unit/period", {
|
|
24514
24620
|
cost: formatCurrency(price, { locale, currency }),
|
|
24515
|
-
unit: getFeatureName(feature, packageSize),
|
|
24621
|
+
unit: getFeatureName(feature, locale, packageSize),
|
|
24516
24622
|
period: shortenPeriod(period, t3)
|
|
24517
24623
|
}) }, index)
|
|
24518
24624
|
);
|
|
@@ -24521,7 +24627,7 @@ var UsageDetails = ({ entitlement, layout }) => {
|
|
|
24521
24627
|
acc.push(
|
|
24522
24628
|
/* @__PURE__ */ jsx51(Fragment17, { children: t3("X units used", {
|
|
24523
24629
|
amount: usage,
|
|
24524
|
-
units: getFeatureName(feature, usage)
|
|
24630
|
+
units: getFeatureName(feature, locale, usage)
|
|
24525
24631
|
}) }, index)
|
|
24526
24632
|
);
|
|
24527
24633
|
index += 1;
|
|
@@ -24751,9 +24857,10 @@ var IncludedFeatures = forwardRef10(({ className, ...rest }, ref) => {
|
|
|
24751
24857
|
singularName: grant.singularName,
|
|
24752
24858
|
pluralName: grant.pluralName
|
|
24753
24859
|
},
|
|
24860
|
+
locale,
|
|
24754
24861
|
grant.creditAmount
|
|
24755
24862
|
),
|
|
24756
|
-
licenseName: entitlement.feature ? getFeatureName(entitlement.feature, 1) : ""
|
|
24863
|
+
licenseName: entitlement.feature ? getFeatureName(entitlement.feature, locale, 1) : ""
|
|
24757
24864
|
}) }, grantIndex)),
|
|
24758
24865
|
props.entitlementExpiration.isVisible && entitlement.entitlementExpirationDate && /* @__PURE__ */ jsx52(
|
|
24759
24866
|
Text,
|
|
@@ -25087,7 +25194,7 @@ var PriceDetails = ({
|
|
|
25087
25194
|
packageSize,
|
|
25088
25195
|
" "
|
|
25089
25196
|
] }),
|
|
25090
|
-
getFeatureName(feature, packageSize),
|
|
25197
|
+
getFeatureName(feature, locale, packageSize),
|
|
25091
25198
|
feature.featureType === FeatureType.Trait && period && /* @__PURE__ */ jsxs40(Fragment21, { children: [
|
|
25092
25199
|
"/",
|
|
25093
25200
|
shortenPeriod(period, t3)
|
|
@@ -25112,7 +25219,7 @@ var PriceDetails = ({
|
|
|
25112
25219
|
typeof amount === "number" && /* @__PURE__ */ jsx55(Fragment21, { children: priceBehavior === EntitlementPriceBehavior.Overage ? /* @__PURE__ */ jsxs40(Text, { children: [
|
|
25113
25220
|
formatNumber(amount, { locale }),
|
|
25114
25221
|
" ",
|
|
25115
|
-
getFeatureName(feature, amount),
|
|
25222
|
+
getFeatureName(feature, locale, amount),
|
|
25116
25223
|
" \xB7 ",
|
|
25117
25224
|
formatCurrency(currentTierPerUnitPrice * amount, {
|
|
25118
25225
|
locale,
|
|
@@ -25240,7 +25347,7 @@ var UsageByUser = ({ source, unit }) => {
|
|
|
25240
25347
|
const total = current?.section?.total ?? 0;
|
|
25241
25348
|
const totalUsers = current?.section?.totalUsers ?? 0;
|
|
25242
25349
|
const unattributed = current?.section?.unattributed;
|
|
25243
|
-
const formatAmount = (amount) => `${formatNumber(amount, { locale })} ${getFeatureName(unit, amount)}`;
|
|
25350
|
+
const formatAmount = (amount) => `${formatNumber(amount, { locale })} ${getFeatureName(unit, locale, amount)}`;
|
|
25244
25351
|
if (error) {
|
|
25245
25352
|
return /* @__PURE__ */ jsxs41(Flex, { $flexDirection: "column", $gap: "0.5rem", $alignItems: "flex-start", children: [
|
|
25246
25353
|
/* @__PURE__ */ jsx56(Text, { display: "heading4", children: t3("Usage by user") }),
|
|
@@ -25345,10 +25452,10 @@ var Limit = ({ entitlement, usageDetails, fontStyle }) => {
|
|
|
25345
25452
|
const acc = [];
|
|
25346
25453
|
acc.push(
|
|
25347
25454
|
priceBehavior === EntitlementPriceBehavior.Tier && typeof currentTier?.to === "number" && typeof feature !== "undefined" ? currentTier?.to === Infinity ? t3("Unlimited in this tier", {
|
|
25348
|
-
feature: getFeatureName(feature)
|
|
25455
|
+
feature: getFeatureName(feature, locale)
|
|
25349
25456
|
}) : t3("Up to X units in this tier", {
|
|
25350
25457
|
amount: currentTier.to,
|
|
25351
|
-
feature: getFeatureName(feature)
|
|
25458
|
+
feature: getFeatureName(feature, locale)
|
|
25352
25459
|
}) : priceBehavior === EntitlementPriceBehavior.Overage && typeof limit === "number" ? t3("X included", {
|
|
25353
25460
|
amount: formatNumber(limit, { locale })
|
|
25354
25461
|
}) : priceBehavior === EntitlementPriceBehavior.PayInAdvance && typeof usage === "number" ? `${formatNumber(usage, { locale })} ${t3("used")}` : priceBehavior === EntitlementPriceBehavior.PayAsYouGo && typeof cost === "number" ? formatCurrency(cost, { locale, currency: billingPrice?.currency }) : data?.displaySettings?.showCredits && priceBehavior === EntitlementPriceBehavior.CreditBurndown && typeof planEntitlement?.valueCredit !== "undefined" && typeof planEntitlement?.consumptionRate === "number" ? t3("X units per use", {
|
|
@@ -25358,11 +25465,12 @@ var Limit = ({ entitlement, usageDetails, fontStyle }) => {
|
|
|
25358
25465
|
),
|
|
25359
25466
|
units: getFeatureName(
|
|
25360
25467
|
planEntitlement.valueCredit,
|
|
25468
|
+
locale,
|
|
25361
25469
|
planEntitlement.consumptionRate
|
|
25362
25470
|
)
|
|
25363
25471
|
}) : priceBehavior === EntitlementPriceBehavior.CreditBurndown && typeof feature !== "undefined" && typeof limit === "number" ? t3("X units remaining", {
|
|
25364
25472
|
amount: formatNumber(limit, { locale }),
|
|
25365
|
-
units: getFeatureName(feature, limit)
|
|
25473
|
+
units: getFeatureName(feature, locale, limit)
|
|
25366
25474
|
}) : typeof limit === "number" ? t3("Limit of", {
|
|
25367
25475
|
amount: formatNumber(limit, { locale })
|
|
25368
25476
|
}) : t3("No limit")
|
|
@@ -25564,11 +25672,11 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
|
|
|
25564
25672
|
formatNumber(limit, { locale }),
|
|
25565
25673
|
" "
|
|
25566
25674
|
] }),
|
|
25567
|
-
getFeatureName(feature, limit)
|
|
25675
|
+
getFeatureName(feature, locale, limit)
|
|
25568
25676
|
] }) : typeof usage === "number" && /* @__PURE__ */ jsxs42(Fragment22, { children: [
|
|
25569
25677
|
formatNumber(usage, { locale }),
|
|
25570
25678
|
" ",
|
|
25571
|
-
getFeatureName(feature, usage),
|
|
25679
|
+
getFeatureName(feature, locale, usage),
|
|
25572
25680
|
" ",
|
|
25573
25681
|
t3("used")
|
|
25574
25682
|
] }) }) }),
|
|
@@ -25657,6 +25765,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
|
|
|
25657
25765
|
}),
|
|
25658
25766
|
units: getFeatureName(
|
|
25659
25767
|
credit,
|
|
25768
|
+
locale,
|
|
25660
25769
|
credit.total.remaining
|
|
25661
25770
|
)
|
|
25662
25771
|
}) }) }),
|
|
@@ -25698,6 +25807,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
|
|
|
25698
25807
|
quantity: licenseQuantity,
|
|
25699
25808
|
licenseName: getFeatureName(
|
|
25700
25809
|
licenseFeature,
|
|
25810
|
+
locale,
|
|
25701
25811
|
licenseQuantity
|
|
25702
25812
|
),
|
|
25703
25813
|
perUnit: perLicenseGrant.amount
|
|
@@ -25722,7 +25832,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
|
|
|
25722
25832
|
children: [
|
|
25723
25833
|
t3("Your plan includes credits", {
|
|
25724
25834
|
total,
|
|
25725
|
-
creditName: getFeatureName(credit, total),
|
|
25835
|
+
creditName: getFeatureName(credit, locale, total),
|
|
25726
25836
|
period: shortenPeriod(composition.period, t3),
|
|
25727
25837
|
composition: ` \u2014 ${parts.join(" + ")}`
|
|
25728
25838
|
}),
|
|
@@ -25757,6 +25867,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
|
|
|
25757
25867
|
amount: grant.quantity,
|
|
25758
25868
|
item: getFeatureName(
|
|
25759
25869
|
credit,
|
|
25870
|
+
locale,
|
|
25760
25871
|
grant.quantity
|
|
25761
25872
|
)
|
|
25762
25873
|
}) }) }),
|
|
@@ -25778,7 +25889,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
|
|
|
25778
25889
|
] }) : /* @__PURE__ */ jsxs42(Fragment22, { children: [
|
|
25779
25890
|
/* @__PURE__ */ jsx57(Box, { $display: "table-cell", $padding: padding, children: /* @__PURE__ */ jsx57(Text, { children: grant.grantReason === BillingCreditGrantReason.Purchased ? /* @__PURE__ */ jsx57(Fragment22, { children: t3("X item bundle", {
|
|
25780
25891
|
amount: grant.quantity,
|
|
25781
|
-
item: getFeatureName(credit, 1),
|
|
25892
|
+
item: getFeatureName(credit, locale, 1),
|
|
25782
25893
|
createdAt: toPrettyDate(
|
|
25783
25894
|
grant.createdAt,
|
|
25784
25895
|
{ locale, month: "short" }
|
|
@@ -25787,6 +25898,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
|
|
|
25787
25898
|
amount: grant.quantity,
|
|
25788
25899
|
item: getFeatureName(
|
|
25789
25900
|
credit,
|
|
25901
|
+
locale,
|
|
25790
25902
|
grant.quantity
|
|
25791
25903
|
),
|
|
25792
25904
|
createdAt: toPrettyDate(
|
|
@@ -25797,6 +25909,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
|
|
|
25797
25909
|
amount: grant.quantity,
|
|
25798
25910
|
item: getFeatureName(
|
|
25799
25911
|
credit,
|
|
25912
|
+
locale,
|
|
25800
25913
|
grant.quantity
|
|
25801
25914
|
),
|
|
25802
25915
|
createdAt: toPrettyDate(
|
|
@@ -26177,7 +26290,7 @@ PaymentMethod.displayName = "PaymentMethod";
|
|
|
26177
26290
|
// src/components/elements/payment-method/PaymentMethodDetails.tsx
|
|
26178
26291
|
import { Elements } from "@stripe/react-stripe-js";
|
|
26179
26292
|
|
|
26180
|
-
// node_modules/.pnpm/@stripe+stripe-js@9.
|
|
26293
|
+
// node_modules/.pnpm/@stripe+stripe-js@9.17.0/node_modules/@stripe/stripe-js/dist/index.mjs
|
|
26181
26294
|
function _typeof(obj) {
|
|
26182
26295
|
"@babel/helpers - typeof";
|
|
26183
26296
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
@@ -26231,7 +26344,7 @@ var registerWrapper = function registerWrapper2(stripe, startTime) {
|
|
|
26231
26344
|
}
|
|
26232
26345
|
stripe._registerWrapper({
|
|
26233
26346
|
name: "stripe-js",
|
|
26234
|
-
version: "9.
|
|
26347
|
+
version: "9.17.0",
|
|
26235
26348
|
startTime
|
|
26236
26349
|
});
|
|
26237
26350
|
};
|
|
@@ -26309,7 +26422,7 @@ var initStripe = function initStripe2(maybeStripe, args, startTime) {
|
|
|
26309
26422
|
var version = runtimeVersionToUrlVersion(maybeStripe.version);
|
|
26310
26423
|
var expectedVersion = RELEASE_TRAIN;
|
|
26311
26424
|
if (isTestKey && version !== expectedVersion) {
|
|
26312
|
-
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.
|
|
26425
|
+
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.17.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
|
|
26313
26426
|
}
|
|
26314
26427
|
var stripe = maybeStripe.apply(void 0, args);
|
|
26315
26428
|
registerWrapper(stripe, startTime);
|
|
@@ -26764,7 +26877,7 @@ var UsageDetails2 = ({
|
|
|
26764
26877
|
packageSize,
|
|
26765
26878
|
" "
|
|
26766
26879
|
] }),
|
|
26767
|
-
getFeatureName(entitlement.feature, packageSize),
|
|
26880
|
+
getFeatureName(entitlement.feature, locale, packageSize),
|
|
26768
26881
|
entitlement.feature.featureType === FeatureType.Trait && /* @__PURE__ */ jsxs46(Fragment24, { children: [
|
|
26769
26882
|
"/",
|
|
26770
26883
|
shortenPeriod(period, t3)
|
|
@@ -26784,6 +26897,7 @@ var UsageDetails2 = ({
|
|
|
26784
26897
|
" ",
|
|
26785
26898
|
getFeatureName(
|
|
26786
26899
|
entitlement.planEntitlement.valueCredit,
|
|
26900
|
+
locale,
|
|
26787
26901
|
entitlement.planEntitlement.consumptionRate
|
|
26788
26902
|
),
|
|
26789
26903
|
" ",
|
|
@@ -26819,7 +26933,7 @@ var UsageDetails2 = ({
|
|
|
26819
26933
|
/* @__PURE__ */ jsx62(Text, { display: layout.addOns.fontStyle, children: typeof quantity === "number" ? /* @__PURE__ */ jsxs46(Fragment24, { children: [
|
|
26820
26934
|
quantity,
|
|
26821
26935
|
" ",
|
|
26822
|
-
getFeatureName(entitlement.feature, quantity, true)
|
|
26936
|
+
getFeatureName(entitlement.feature, locale, quantity, true)
|
|
26823
26937
|
] }) : entitlement.feature.name }),
|
|
26824
26938
|
/* @__PURE__ */ jsxs46(Text, { children: [
|
|
26825
26939
|
description.length > 0 && /* @__PURE__ */ jsx62(
|
|
@@ -27280,9 +27394,14 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
|
|
|
27280
27394
|
amount: perLicenseGrant.amount,
|
|
27281
27395
|
creditName: getFeatureName(
|
|
27282
27396
|
group,
|
|
27397
|
+
locale,
|
|
27283
27398
|
perLicenseGrant.amount
|
|
27284
27399
|
),
|
|
27285
|
-
licenseName: getFeatureName(
|
|
27400
|
+
licenseName: getFeatureName(
|
|
27401
|
+
licenseFeature,
|
|
27402
|
+
locale,
|
|
27403
|
+
1
|
|
27404
|
+
)
|
|
27286
27405
|
}),
|
|
27287
27406
|
composition.fixedQuantity > 0 && creditPeriod && /* @__PURE__ */ jsxs47(Fragment25, { children: [
|
|
27288
27407
|
" ",
|
|
@@ -27290,6 +27409,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
|
|
|
27290
27409
|
amount: composition.fixedQuantity,
|
|
27291
27410
|
creditName: getFeatureName(
|
|
27292
27411
|
group,
|
|
27412
|
+
locale,
|
|
27293
27413
|
composition.fixedQuantity
|
|
27294
27414
|
),
|
|
27295
27415
|
period: t3(
|
|
@@ -27300,7 +27420,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
|
|
|
27300
27420
|
] }) : /* @__PURE__ */ jsxs47(Fragment25, { children: [
|
|
27301
27421
|
group.total.value,
|
|
27302
27422
|
" ",
|
|
27303
|
-
getFeatureName(group, group.total.value),
|
|
27423
|
+
getFeatureName(group, locale, group.total.value),
|
|
27304
27424
|
" ",
|
|
27305
27425
|
subscriptionInterval && /* @__PURE__ */ jsxs47(Fragment25, { children: [
|
|
27306
27426
|
t3("per"),
|
|
@@ -27343,6 +27463,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
|
|
|
27343
27463
|
quantity: licenseQuantity,
|
|
27344
27464
|
licenseName: getFeatureName(
|
|
27345
27465
|
licenseFeature,
|
|
27466
|
+
locale,
|
|
27346
27467
|
licenseQuantity
|
|
27347
27468
|
),
|
|
27348
27469
|
perUnit: perLicenseGrant.amount,
|
|
@@ -27350,6 +27471,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
|
|
|
27350
27471
|
total: resolvedTotal,
|
|
27351
27472
|
creditName: getFeatureName(
|
|
27352
27473
|
group,
|
|
27474
|
+
locale,
|
|
27353
27475
|
resolvedTotal
|
|
27354
27476
|
),
|
|
27355
27477
|
period: shortenPeriod(creditPeriod, t3)
|
|
@@ -27357,12 +27479,14 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
|
|
|
27357
27479
|
quantity: licenseQuantity,
|
|
27358
27480
|
licenseName: getFeatureName(
|
|
27359
27481
|
licenseFeature,
|
|
27482
|
+
locale,
|
|
27360
27483
|
licenseQuantity
|
|
27361
27484
|
),
|
|
27362
27485
|
perUnit: perLicenseGrant.amount,
|
|
27363
27486
|
total: resolvedTotal,
|
|
27364
27487
|
creditName: getFeatureName(
|
|
27365
27488
|
group,
|
|
27489
|
+
locale,
|
|
27366
27490
|
resolvedTotal
|
|
27367
27491
|
),
|
|
27368
27492
|
period: shortenPeriod(creditPeriod, t3)
|
|
@@ -27404,7 +27528,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
|
|
|
27404
27528
|
if (!autoTopupEnabled) {
|
|
27405
27529
|
acc.push(
|
|
27406
27530
|
/* @__PURE__ */ jsx63(Text, { $leading: "tight", children: t3("Auto top-up disabled for token", {
|
|
27407
|
-
unit: getFeatureName(grant.credit, 1)
|
|
27531
|
+
unit: getFeatureName(grant.credit, locale, 1)
|
|
27408
27532
|
}) }, grant.id)
|
|
27409
27533
|
);
|
|
27410
27534
|
return acc;
|
|
@@ -27416,6 +27540,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
|
|
|
27416
27540
|
/* @__PURE__ */ jsx63(Text, { $leading: "tight", children: t3("Adds X tokens when Y remaining in balance", {
|
|
27417
27541
|
unit: getFeatureName(
|
|
27418
27542
|
grant.credit,
|
|
27543
|
+
locale,
|
|
27419
27544
|
autoTopupAmount
|
|
27420
27545
|
),
|
|
27421
27546
|
amount: autoTopupAmount,
|
|
@@ -27475,7 +27600,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
|
|
|
27475
27600
|
" (",
|
|
27476
27601
|
group.quantity,
|
|
27477
27602
|
" ",
|
|
27478
|
-
getFeatureName(group, group.quantity),
|
|
27603
|
+
getFeatureName(group, locale, group.quantity),
|
|
27479
27604
|
")"
|
|
27480
27605
|
] }) : /* @__PURE__ */ jsxs47(Text, { display: props.addOns.fontStyle, children: [
|
|
27481
27606
|
group.grants.length > 1 && /* @__PURE__ */ jsxs47(Text, { style: { opacity: 0.5 }, children: [
|
|
@@ -27486,7 +27611,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
|
|
|
27486
27611
|
] }),
|
|
27487
27612
|
group.quantity,
|
|
27488
27613
|
" ",
|
|
27489
|
-
getFeatureName(group, group.quantity)
|
|
27614
|
+
getFeatureName(group, locale, group.quantity)
|
|
27490
27615
|
] }),
|
|
27491
27616
|
group.total.used > 0 && /* @__PURE__ */ jsxs47(
|
|
27492
27617
|
Text,
|
|
@@ -27546,12 +27671,12 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
|
|
|
27546
27671
|
" (",
|
|
27547
27672
|
group.quantity,
|
|
27548
27673
|
" ",
|
|
27549
|
-
getFeatureName(group, group.quantity),
|
|
27674
|
+
getFeatureName(group, locale, group.quantity),
|
|
27550
27675
|
")"
|
|
27551
27676
|
] }) : /* @__PURE__ */ jsxs47(Text, { display: props.addOns.fontStyle, children: [
|
|
27552
27677
|
group.quantity,
|
|
27553
27678
|
" ",
|
|
27554
|
-
getFeatureName(group, group.quantity)
|
|
27679
|
+
getFeatureName(group, locale, group.quantity)
|
|
27555
27680
|
] }),
|
|
27556
27681
|
group.total.used > 0 && /* @__PURE__ */ jsxs47(
|
|
27557
27682
|
Text,
|
|
@@ -27602,7 +27727,7 @@ var PlanManager = forwardRef14(({ children, className, portal, ...rest }, ref) =
|
|
|
27602
27727
|
/* @__PURE__ */ jsxs47(Text, { display: props.addOns.fontStyle, children: [
|
|
27603
27728
|
group.quantity,
|
|
27604
27729
|
" ",
|
|
27605
|
-
getFeatureName(group, group.quantity)
|
|
27730
|
+
getFeatureName(group, locale, group.quantity)
|
|
27606
27731
|
] }),
|
|
27607
27732
|
group.total.used > 0 && /* @__PURE__ */ jsxs47(
|
|
27608
27733
|
Text,
|
|
@@ -27682,6 +27807,7 @@ function renderMeteredEntitlementPricing2({
|
|
|
27682
27807
|
"/",
|
|
27683
27808
|
feature ? getFeatureName(
|
|
27684
27809
|
feature,
|
|
27810
|
+
locale,
|
|
27685
27811
|
packageSize
|
|
27686
27812
|
) : featureName || "unit"
|
|
27687
27813
|
] });
|
|
@@ -27699,6 +27825,7 @@ function renderMeteredEntitlementPricing2({
|
|
|
27699
27825
|
] }),
|
|
27700
27826
|
feature ? getFeatureName(
|
|
27701
27827
|
feature,
|
|
27828
|
+
locale,
|
|
27702
27829
|
packageSize
|
|
27703
27830
|
) : featureName || "unit"
|
|
27704
27831
|
] });
|
|
@@ -27888,7 +28015,7 @@ var AddOn2 = ({
|
|
|
27888
28015
|
{
|
|
27889
28016
|
$flexDirection: "column",
|
|
27890
28017
|
$justifyContent: "center",
|
|
27891
|
-
children: /* @__PURE__ */ jsx64(Text, { children: getFeatureName(entitlement.feature) })
|
|
28018
|
+
children: /* @__PURE__ */ jsx64(Text, { children: getFeatureName(entitlement.feature, locale) })
|
|
27892
28019
|
}
|
|
27893
28020
|
)
|
|
27894
28021
|
] }),
|
|
@@ -28050,7 +28177,11 @@ var Entitlement2 = ({
|
|
|
28050
28177
|
formatNumber(entitlementPackageSize, { locale }),
|
|
28051
28178
|
" "
|
|
28052
28179
|
] }),
|
|
28053
|
-
getFeatureName(
|
|
28180
|
+
getFeatureName(
|
|
28181
|
+
entitlement.feature,
|
|
28182
|
+
locale,
|
|
28183
|
+
entitlementPackageSize
|
|
28184
|
+
),
|
|
28054
28185
|
entitlement.priceBehavior === EntitlementPriceBehavior.PayInAdvance && /* @__PURE__ */ jsxs49(Fragment27, { children: [
|
|
28055
28186
|
" ",
|
|
28056
28187
|
t3("per"),
|
|
@@ -28068,12 +28199,13 @@ var Entitlement2 = ({
|
|
|
28068
28199
|
" ",
|
|
28069
28200
|
getFeatureName(
|
|
28070
28201
|
entitlement.valueCredit,
|
|
28202
|
+
locale,
|
|
28071
28203
|
entitlement.consumptionRate
|
|
28072
28204
|
),
|
|
28073
28205
|
" ",
|
|
28074
28206
|
t3("per"),
|
|
28075
28207
|
" ",
|
|
28076
|
-
getFeatureName(entitlement.feature, 1)
|
|
28208
|
+
getFeatureName(entitlement.feature, locale, 1)
|
|
28077
28209
|
] }) : entitlement.priceBehavior === EntitlementPriceBehavior.CreditBurndown && creditBasedEntitlementLimit ? /* @__PURE__ */ jsx65(Fragment27, { children: creditBasedEntitlementLimit?.period ? t3("Up to X units per period", {
|
|
28078
28210
|
amount: formatNumber(
|
|
28079
28211
|
creditBasedEntitlementLimit.limit,
|
|
@@ -28081,9 +28213,12 @@ var Entitlement2 = ({
|
|
|
28081
28213
|
),
|
|
28082
28214
|
units: getFeatureName(
|
|
28083
28215
|
entitlement.feature,
|
|
28216
|
+
locale,
|
|
28084
28217
|
creditBasedEntitlementLimit.limit
|
|
28085
28218
|
),
|
|
28086
|
-
period:
|
|
28219
|
+
period: t3(
|
|
28220
|
+
creditBasedEntitlementLimit.period
|
|
28221
|
+
)
|
|
28087
28222
|
}) : t3("Up to X units", {
|
|
28088
28223
|
amount: formatNumber(
|
|
28089
28224
|
creditBasedEntitlementLimit.limit,
|
|
@@ -28091,17 +28226,18 @@ var Entitlement2 = ({
|
|
|
28091
28226
|
),
|
|
28092
28227
|
units: getFeatureName(
|
|
28093
28228
|
entitlement.feature,
|
|
28229
|
+
locale,
|
|
28094
28230
|
creditBasedEntitlementLimit.limit
|
|
28095
28231
|
)
|
|
28096
28232
|
}) }) : entitlement.valueType === EntitlementValueType.Numeric || entitlement.valueType === EntitlementValueType.Unlimited || entitlement.valueType === EntitlementValueType.Trait ? /* @__PURE__ */ jsxs49(Fragment27, { children: [
|
|
28097
28233
|
entitlement.valueType === EntitlementValueType.Unlimited && !entitlement.priceBehavior ? t3("Unlimited", {
|
|
28098
|
-
item: getFeatureName(entitlement.feature)
|
|
28234
|
+
item: getFeatureName(entitlement.feature, locale)
|
|
28099
28235
|
}) : /* @__PURE__ */ jsxs49(Fragment27, { children: [
|
|
28100
28236
|
typeof limit === "number" && /* @__PURE__ */ jsxs49(Fragment27, { children: [
|
|
28101
28237
|
formatNumber(limit, { locale }),
|
|
28102
28238
|
" "
|
|
28103
28239
|
] }),
|
|
28104
|
-
getFeatureName(entitlement.feature, limit)
|
|
28240
|
+
getFeatureName(entitlement.feature, locale, limit)
|
|
28105
28241
|
] }),
|
|
28106
28242
|
metricPeriodName && /* @__PURE__ */ jsxs49(Fragment27, { children: [
|
|
28107
28243
|
" ",
|
|
@@ -28130,6 +28266,7 @@ var Entitlement2 = ({
|
|
|
28130
28266
|
] }),
|
|
28131
28267
|
getFeatureName(
|
|
28132
28268
|
entitlement.feature,
|
|
28269
|
+
locale,
|
|
28133
28270
|
entitlementPackageSize
|
|
28134
28271
|
),
|
|
28135
28272
|
entitlement.feature.featureType === FeatureType.Trait && /* @__PURE__ */ jsxs49(Fragment27, { children: [
|
|
@@ -28609,7 +28746,7 @@ var PricingTable = forwardRef15(({ className, ...rest }, ref) => {
|
|
|
28609
28746
|
$alignItems: "center",
|
|
28610
28747
|
$justifyContent: "center",
|
|
28611
28748
|
$padding: `${settings.theme.card.padding / TEXT_BASE_SIZE}rem`,
|
|
28612
|
-
children: /* @__PURE__ */ jsx67(Loader, { "aria-label": "
|
|
28749
|
+
children: /* @__PURE__ */ jsx67(Loader, { "aria-label": t3("Loading"), $size: "2xl" })
|
|
28613
28750
|
}
|
|
28614
28751
|
);
|
|
28615
28752
|
}
|
|
@@ -31826,6 +31963,7 @@ var Loading = () => {
|
|
|
31826
31963
|
};
|
|
31827
31964
|
var Error2 = ({ message }) => {
|
|
31828
31965
|
const { settings } = useEmbed();
|
|
31966
|
+
const { t: t3 } = useTranslation();
|
|
31829
31967
|
return /* @__PURE__ */ jsxs53(
|
|
31830
31968
|
Flex,
|
|
31831
31969
|
{
|
|
@@ -31837,7 +31975,7 @@ var Error2 = ({ message }) => {
|
|
|
31837
31975
|
$alignItems: "center",
|
|
31838
31976
|
$justifyContent: "center",
|
|
31839
31977
|
children: [
|
|
31840
|
-
/* @__PURE__ */ jsx71(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx71(Text, { display: "heading1", children: "Error" }) }),
|
|
31978
|
+
/* @__PURE__ */ jsx71(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx71(Text, { display: "heading1", children: t3("Error") }) }),
|
|
31841
31979
|
/* @__PURE__ */ jsx71(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx71(Text, { children: message }) })
|
|
31842
31980
|
]
|
|
31843
31981
|
}
|
|
@@ -31845,6 +31983,7 @@ var Error2 = ({ message }) => {
|
|
|
31845
31983
|
};
|
|
31846
31984
|
var SchematicEmbed = ({ id, accessToken }) => {
|
|
31847
31985
|
const theme = useContext3(nt);
|
|
31986
|
+
const { t: t3 } = useTranslation();
|
|
31848
31987
|
const {
|
|
31849
31988
|
data,
|
|
31850
31989
|
error,
|
|
@@ -31915,13 +32054,15 @@ var SchematicEmbed = ({ id, accessToken }) => {
|
|
|
31915
32054
|
return /* @__PURE__ */ jsx71(Error2, { message: error.message });
|
|
31916
32055
|
}
|
|
31917
32056
|
if (accessToken?.length === 0) {
|
|
31918
|
-
return /* @__PURE__ */ jsx71(Error2, { message: "Please provide an access token." });
|
|
32057
|
+
return /* @__PURE__ */ jsx71(Error2, { message: t3("Please provide an access token.") });
|
|
31919
32058
|
}
|
|
31920
32059
|
if (!accessToken?.startsWith("token_")) {
|
|
31921
32060
|
return /* @__PURE__ */ jsx71(
|
|
31922
32061
|
Error2,
|
|
31923
32062
|
{
|
|
31924
|
-
message:
|
|
32063
|
+
message: t3(
|
|
32064
|
+
"Invalid access token; your temporary access token will start with `token_`."
|
|
32065
|
+
)
|
|
31925
32066
|
}
|
|
31926
32067
|
);
|
|
31927
32068
|
}
|