@burdenoff/microfe-billing 2026.1115.2 → 2026.1119.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billing/modules/addons/pages/AddonCreatePage.js +143 -143
- package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonEditPage.js +170 -170
- package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js +148 -148
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +115 -115
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +136 -136
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +129 -129
- package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/RefundsPage.js +325 -325
- package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +149 -149
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js +99 -98
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js.map +1 -1
- package/dist/billing/modules/checkout/components/StoreShippingSection.js +125 -124
- package/dist/billing/modules/checkout/components/StoreShippingSection.js.map +1 -1
- package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js +61 -60
- package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js.map +1 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +1 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponsListPage.js +177 -177
- package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js +231 -231
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/EditCouponPage.js +139 -139
- package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js +54 -54
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +65 -65
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditsPage.js +95 -95
- package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js +232 -231
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js.map +1 -1
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js +328 -328
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +57 -57
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.js +53 -53
- package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +100 -100
- package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanCreatePage.js +150 -150
- package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanEditPage.js +125 -125
- package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +113 -113
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +132 -132
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/SettingsPage.js +101 -101
- package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +175 -171
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
- package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js +51 -50
- package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js.map +1 -1
- package/dist/billing/modules/usage/pages/UsagePage.js +107 -107
- package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
- package/dist/billing/shared/components/GeoPricingOverridesEditor.js +1 -0
- package/package.json +2 -2
|
@@ -2,31 +2,31 @@ import { AccessDenied as e } from "../../../shared/components/AccessDenied.js";
|
|
|
2
2
|
import { PageHeader as t } from "../../../shared/components/PageHeader.js";
|
|
3
3
|
import { ServerError as n } from "../../../shared/components/ServerError.js";
|
|
4
4
|
import { CurrencyPriceOverridesEditor as r } from "../../../shared/components/CurrencyPriceOverridesEditor.js";
|
|
5
|
-
import { useBillingNavigate as
|
|
5
|
+
import { useBillingNavigate as i } from "../../../hooks/useBillingNavigate.js";
|
|
6
6
|
import "../hooks/index.js";
|
|
7
|
-
import { useBillingPermissions as
|
|
8
|
-
import { isServerError as
|
|
9
|
-
import { getPlanFeatureQuantity as
|
|
7
|
+
import { useBillingPermissions as a } from "../../../hooks/useBillingPermissions.js";
|
|
8
|
+
import { isServerError as o } from "../../../shared/utils/error.js";
|
|
9
|
+
import { getPlanFeatureQuantity as s } from "../../../shared/utils/planFeatureQuantity.js";
|
|
10
10
|
import "../../../shared/components/index.js";
|
|
11
11
|
import "../../../shared/utils/index.js";
|
|
12
|
-
import { usePlan as
|
|
13
|
-
import { useQuotas as
|
|
14
|
-
import { PlanDuration as
|
|
15
|
-
import { getChangedCurrencyPriceOverrides as
|
|
16
|
-
import { useEffect as
|
|
17
|
-
import { PagePurpose as
|
|
18
|
-
import { useParams as
|
|
19
|
-
import { Fragment as
|
|
20
|
-
import { useI18n as
|
|
12
|
+
import { usePlan as c, usePlanMutations as l } from "../hooks/usePlans.js";
|
|
13
|
+
import { useQuotas as u } from "../hooks/useQuotas.js";
|
|
14
|
+
import { PlanDuration as d } from "../../../shared/types/graphql.js";
|
|
15
|
+
import { getChangedCurrencyPriceOverrides as f } from "../utils/currencyPriceOverrides.js";
|
|
16
|
+
import { useEffect as p, useState as m } from "react";
|
|
17
|
+
import { PagePurpose as ee, ThemedSelect as h } from "@burdenoff/fe-libs/ui";
|
|
18
|
+
import { useParams as te } from "react-router";
|
|
19
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
20
|
+
import { useI18n as y } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
21
21
|
// src/billing/modules/plans/pages/PlanEditPage.tsx
|
|
22
|
-
var
|
|
23
|
-
let { t:
|
|
24
|
-
let n =
|
|
22
|
+
var b = () => {
|
|
23
|
+
let { t: b } = y(), x = (e, t) => {
|
|
24
|
+
let n = b(e);
|
|
25
25
|
return n === e ? t : n;
|
|
26
|
-
}, { planId:
|
|
27
|
-
if (
|
|
26
|
+
}, { planId: S } = te(), C = i(), ne = a(), { plan: w, isLoading: T, error: E, refetch: D } = c(S), { quotas: O, isLoading: k } = u({ onlyActive: !0 }), { updatePlan: A, isUpdating: j } = l(), [M, N] = m(""), [re, P] = m(""), [F, I] = m("USD"), [L, R] = m(d.MONTHLY), [z, B] = m(!0), [V, H] = m(!0), [U, W] = m([]), [G, K] = m([]), [q, J] = m([]), [Y, X] = m(null), [Z, Q] = m(!1);
|
|
27
|
+
if (p(() => {
|
|
28
28
|
if (w) {
|
|
29
|
-
if (N(w.name ?? ""), P(String(w.price ?? "")), I(w.currency ?? "USD"), R(w.duration ??
|
|
29
|
+
if (N(w.name ?? ""), P(String(w.price ?? "")), I(w.currency ?? "USD"), R(w.duration ?? d.MONTHLY), B(w.isActive ?? !0), H(w.isPurchasable ?? !0), w.currencyPrices && typeof w.currencyPrices == "object") {
|
|
30
30
|
let e = w.currencyPrices, t = Object.entries(e).filter(([, e]) => typeof e == "number").map(([e, t]) => ({
|
|
31
31
|
currency: e,
|
|
32
32
|
amount: t
|
|
@@ -36,7 +36,7 @@ var y = () => {
|
|
|
36
36
|
if (w.features && w.features.length > 0) {
|
|
37
37
|
let e = [], t = /* @__PURE__ */ new Map();
|
|
38
38
|
for (let e of w.features) if (e.quota?.id) {
|
|
39
|
-
let n = e.quota.id, r =
|
|
39
|
+
let n = e.quota.id, r = s(e) || 1;
|
|
40
40
|
t.set(n, r);
|
|
41
41
|
}
|
|
42
42
|
for (let [n, r] of t) e.push({
|
|
@@ -46,10 +46,10 @@ var y = () => {
|
|
|
46
46
|
W(e);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
}, [w]), !
|
|
50
|
-
if (T || k) return /* @__PURE__ */
|
|
49
|
+
}, [w]), !ne.canManagePlans) return /* @__PURE__ */ _(e, { message: x("billing.plans.noEditPermission", "You don't have permission to edit plans.") });
|
|
50
|
+
if (T || k) return /* @__PURE__ */ v("div", {
|
|
51
51
|
className: "space-y-6 p-6",
|
|
52
|
-
children: [/* @__PURE__ */
|
|
52
|
+
children: [/* @__PURE__ */ _("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ _("div", {
|
|
53
53
|
className: "max-w-2xl space-y-4",
|
|
54
54
|
children: [
|
|
55
55
|
1,
|
|
@@ -57,53 +57,53 @@ var y = () => {
|
|
|
57
57
|
3,
|
|
58
58
|
4,
|
|
59
59
|
5
|
|
60
|
-
].map((e) => /* @__PURE__ */
|
|
60
|
+
].map((e) => /* @__PURE__ */ _("div", { className: "h-16 bg-bg-sunken animate-pulse rounded" }, e))
|
|
61
61
|
})]
|
|
62
62
|
});
|
|
63
|
-
if (E &&
|
|
63
|
+
if (E && o(E)) return /* @__PURE__ */ _("div", {
|
|
64
64
|
className: "p-6",
|
|
65
|
-
children: /* @__PURE__ */
|
|
66
|
-
title:
|
|
67
|
-
message:
|
|
65
|
+
children: /* @__PURE__ */ _(n, {
|
|
66
|
+
title: x("billing.plans.serverUnavailable", "Server Unavailable"),
|
|
67
|
+
message: x("billing.plans.serverUnavailableLoadPlan", "Unable to load plan. The server might be down or experiencing issues."),
|
|
68
68
|
onRetry: () => D(),
|
|
69
69
|
showRetry: !0
|
|
70
70
|
})
|
|
71
71
|
});
|
|
72
|
-
if (!w) return /* @__PURE__ */
|
|
72
|
+
if (!w) return /* @__PURE__ */ _("div", {
|
|
73
73
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
74
|
-
children: /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ v("div", {
|
|
75
75
|
className: "text-center space-y-4",
|
|
76
|
-
children: [/* @__PURE__ */
|
|
76
|
+
children: [/* @__PURE__ */ _("h2", {
|
|
77
77
|
className: "text-lg font-semibold text-text-primary",
|
|
78
|
-
children:
|
|
79
|
-
}), /* @__PURE__ */
|
|
78
|
+
children: x("billing.plans.planNotFound", "Plan not found")
|
|
79
|
+
}), /* @__PURE__ */ _("button", {
|
|
80
80
|
type: "button",
|
|
81
|
-
onClick: () =>
|
|
81
|
+
onClick: () => C("/plans"),
|
|
82
82
|
className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover",
|
|
83
83
|
children: "Back to Plans"
|
|
84
84
|
})]
|
|
85
85
|
})
|
|
86
86
|
});
|
|
87
|
-
let
|
|
87
|
+
let ie = () => {
|
|
88
88
|
W([{
|
|
89
89
|
quotaId: "",
|
|
90
90
|
quantity: 1
|
|
91
91
|
}, ...U]);
|
|
92
|
-
},
|
|
92
|
+
}, ae = (e) => {
|
|
93
93
|
W(U.filter((t, n) => n !== e));
|
|
94
94
|
}, $ = (e, t, n) => {
|
|
95
95
|
let r = [...U];
|
|
96
96
|
t === "quotaId" ? r[e].quotaId = n : r[e].quantity = Number(n), W(r);
|
|
97
97
|
};
|
|
98
|
-
return /* @__PURE__ */
|
|
98
|
+
return /* @__PURE__ */ v("div", {
|
|
99
99
|
className: "space-y-6 p-6",
|
|
100
100
|
children: [
|
|
101
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ _(t, {
|
|
102
102
|
title: `Edit Plan: ${w.name}`,
|
|
103
|
-
description:
|
|
103
|
+
description: x("billing.plans.editPlanDesc", "Update the plan details and quota allocations")
|
|
104
104
|
}),
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ _(ee, { children: x("billing.plans.editPurpose", "Update this plan's price, currency/seat pricing and the quotas it grants. Changes apply to new subscriptions; existing subscribers keep the terms they signed up with until they renew or change plans.") }),
|
|
106
|
+
/* @__PURE__ */ v("form", {
|
|
107
107
|
onSubmit: async (e) => {
|
|
108
108
|
if (e.preventDefault(), X(null), Q(!1), !M.trim()) {
|
|
109
109
|
X("Plan name is required");
|
|
@@ -118,7 +118,7 @@ var y = () => {
|
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
120
|
let t = {
|
|
121
|
-
id:
|
|
121
|
+
id: S,
|
|
122
122
|
name: M.trim(),
|
|
123
123
|
isActive: z,
|
|
124
124
|
isPurchasable: V,
|
|
@@ -126,78 +126,78 @@ var y = () => {
|
|
|
126
126
|
quotaId: e.quotaId,
|
|
127
127
|
quantity: e.quantity
|
|
128
128
|
})),
|
|
129
|
-
...
|
|
129
|
+
...f(q, G).length > 0 ? { currencyPriceOverrides: f(q, G) } : {}
|
|
130
130
|
};
|
|
131
131
|
try {
|
|
132
|
-
await A(t), Q(!0), setTimeout(() =>
|
|
132
|
+
await A(t), Q(!0), setTimeout(() => C(`/plans/${S}`), 1500);
|
|
133
133
|
} catch (e) {
|
|
134
134
|
X(e instanceof Error ? e.message : "Failed to update plan");
|
|
135
135
|
}
|
|
136
136
|
},
|
|
137
137
|
className: "space-y-6",
|
|
138
138
|
children: [
|
|
139
|
-
Y && /* @__PURE__ */
|
|
139
|
+
Y && /* @__PURE__ */ _("div", {
|
|
140
140
|
className: "p-4 bg-status-error-bg-subtle border border-border-subtle rounded-lg",
|
|
141
|
-
children: /* @__PURE__ */
|
|
141
|
+
children: /* @__PURE__ */ _("p", {
|
|
142
142
|
className: "text-sm text-status-error-text",
|
|
143
143
|
children: Y
|
|
144
144
|
})
|
|
145
145
|
}),
|
|
146
|
-
Z && /* @__PURE__ */
|
|
146
|
+
Z && /* @__PURE__ */ _("div", {
|
|
147
147
|
className: "p-4 bg-status-success-bg-subtle border border-border-subtle rounded-lg",
|
|
148
|
-
children: /* @__PURE__ */
|
|
148
|
+
children: /* @__PURE__ */ _("p", {
|
|
149
149
|
className: "text-sm text-status-success-text",
|
|
150
|
-
children:
|
|
150
|
+
children: x("billing.plans.updateSuccess", "Plan updated successfully! Redirecting...")
|
|
151
151
|
})
|
|
152
152
|
}),
|
|
153
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ v("div", {
|
|
154
154
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
155
|
-
children: [/* @__PURE__ */
|
|
155
|
+
children: [/* @__PURE__ */ v("div", {
|
|
156
156
|
className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
|
|
157
|
-
children: [/* @__PURE__ */
|
|
157
|
+
children: [/* @__PURE__ */ _("div", {
|
|
158
158
|
className: "p-4 border-b border-border-subtle bg-bg-sunken/30",
|
|
159
|
-
children: /* @__PURE__ */
|
|
159
|
+
children: /* @__PURE__ */ _("h2", {
|
|
160
160
|
className: "font-semibold text-text-primary",
|
|
161
|
-
children:
|
|
161
|
+
children: x("billing.plans.basicInfo", "Basic Information")
|
|
162
162
|
})
|
|
163
|
-
}), /* @__PURE__ */
|
|
163
|
+
}), /* @__PURE__ */ v("div", {
|
|
164
164
|
className: "p-4 space-y-4",
|
|
165
165
|
children: [
|
|
166
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
|
|
167
167
|
htmlFor: "name",
|
|
168
168
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
169
|
-
children: [
|
|
170
|
-
}), /* @__PURE__ */
|
|
169
|
+
children: [x("billing.plans.planNameLabel", "Plan Name"), " *"]
|
|
170
|
+
}), /* @__PURE__ */ _("input", {
|
|
171
171
|
id: "name",
|
|
172
172
|
type: "text",
|
|
173
173
|
value: M,
|
|
174
174
|
onChange: (e) => N(e.target.value),
|
|
175
175
|
className: "w-full px-3 py-2 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
176
|
-
placeholder:
|
|
176
|
+
placeholder: x("billing.plans.planNamePlaceholder", "e.g., Pro Plan"),
|
|
177
177
|
required: !0
|
|
178
178
|
})] }),
|
|
179
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ v("div", {
|
|
180
180
|
className: "grid grid-cols-2 gap-4",
|
|
181
|
-
children: [/* @__PURE__ */
|
|
181
|
+
children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
|
|
182
182
|
htmlFor: "price",
|
|
183
183
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
184
|
-
children: [
|
|
185
|
-
}), /* @__PURE__ */
|
|
184
|
+
children: [x("billing.plans.priceLabel", "Price"), " *"]
|
|
185
|
+
}), /* @__PURE__ */ _("input", {
|
|
186
186
|
id: "price",
|
|
187
187
|
type: "number",
|
|
188
188
|
step: "0.01",
|
|
189
189
|
min: "0",
|
|
190
|
-
value:
|
|
190
|
+
value: re,
|
|
191
191
|
onChange: (e) => P(e.target.value),
|
|
192
192
|
disabled: !0,
|
|
193
193
|
title: "Price cannot be changed on an existing plan. Create a new plan instead.",
|
|
194
194
|
className: "w-full disabled:opacity-60 disabled:cursor-not-allowed px-3 py-2 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
195
195
|
placeholder: "49.99"
|
|
196
|
-
})] }), /* @__PURE__ */
|
|
196
|
+
})] }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
|
|
197
197
|
htmlFor: "currency",
|
|
198
198
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
199
|
-
children: [
|
|
200
|
-
}), /* @__PURE__ */
|
|
199
|
+
children: [x("billing.plans.currencyLabel", "Currency"), " *"]
|
|
200
|
+
}), /* @__PURE__ */ v(h, {
|
|
201
201
|
id: "currency",
|
|
202
202
|
value: F,
|
|
203
203
|
onChange: (e) => I(e.target.value),
|
|
@@ -205,140 +205,140 @@ var y = () => {
|
|
|
205
205
|
title: "Currency cannot be changed on an existing plan. Create a new plan instead.",
|
|
206
206
|
className: "w-full disabled:opacity-60 disabled:cursor-not-allowed px-3 py-2 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
207
207
|
children: [
|
|
208
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ _("option", {
|
|
209
209
|
value: "USD",
|
|
210
210
|
children: "USD ($)"
|
|
211
211
|
}),
|
|
212
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ _("option", {
|
|
213
213
|
value: "EUR",
|
|
214
214
|
children: "EUR"
|
|
215
215
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ _("option", {
|
|
217
217
|
value: "GBP",
|
|
218
218
|
children: "GBP"
|
|
219
219
|
}),
|
|
220
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ _("option", {
|
|
221
221
|
value: "INR",
|
|
222
222
|
children: "INR"
|
|
223
223
|
}),
|
|
224
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ _("option", {
|
|
225
225
|
value: "AUD",
|
|
226
226
|
children: "AUD"
|
|
227
227
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ _("option", {
|
|
229
229
|
value: "CAD",
|
|
230
230
|
children: "CAD"
|
|
231
231
|
}),
|
|
232
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ _("option", {
|
|
233
233
|
value: "JPY",
|
|
234
234
|
children: "JPY"
|
|
235
235
|
}),
|
|
236
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ _("option", {
|
|
237
237
|
value: "SGD",
|
|
238
238
|
children: "SGD"
|
|
239
239
|
})
|
|
240
240
|
]
|
|
241
241
|
})] })]
|
|
242
242
|
}),
|
|
243
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
|
|
244
244
|
htmlFor: "duration",
|
|
245
245
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
246
|
-
children: [
|
|
247
|
-
}), /* @__PURE__ */
|
|
246
|
+
children: [x("billing.plans.billingPeriodLabel", "Billing Period"), " *"]
|
|
247
|
+
}), /* @__PURE__ */ v(h, {
|
|
248
248
|
id: "duration",
|
|
249
249
|
value: L,
|
|
250
250
|
onChange: (e) => R(e.target.value),
|
|
251
251
|
disabled: !0,
|
|
252
252
|
title: "Billing period cannot be changed on an existing plan. Create a new plan instead.",
|
|
253
253
|
className: "w-full disabled:opacity-60 disabled:cursor-not-allowed px-3 py-2 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
254
|
-
children: [/* @__PURE__ */
|
|
255
|
-
value:
|
|
254
|
+
children: [/* @__PURE__ */ _("option", {
|
|
255
|
+
value: d.MONTHLY,
|
|
256
256
|
children: "Monthly"
|
|
257
|
-
}), /* @__PURE__ */
|
|
258
|
-
value:
|
|
257
|
+
}), /* @__PURE__ */ _("option", {
|
|
258
|
+
value: d.YEARLY,
|
|
259
259
|
children: "Yearly"
|
|
260
260
|
})]
|
|
261
261
|
})] }),
|
|
262
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ v("div", {
|
|
263
263
|
className: "flex items-center gap-3",
|
|
264
|
-
children: [/* @__PURE__ */
|
|
264
|
+
children: [/* @__PURE__ */ _("input", {
|
|
265
265
|
id: "isActive",
|
|
266
266
|
type: "checkbox",
|
|
267
267
|
checked: z,
|
|
268
268
|
onChange: (e) => B(e.target.checked),
|
|
269
269
|
className: "size-4 rounded border-border-subtle text-text-link focus:ring-[var(--color-focus-ring)]"
|
|
270
|
-
}), /* @__PURE__ */
|
|
270
|
+
}), /* @__PURE__ */ _("label", {
|
|
271
271
|
htmlFor: "isActive",
|
|
272
272
|
className: "text-sm font-medium text-text-primary",
|
|
273
|
-
children:
|
|
273
|
+
children: x("billing.plans.planIsActive", "Plan is active")
|
|
274
274
|
})]
|
|
275
275
|
}),
|
|
276
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ v("div", {
|
|
277
277
|
className: "flex items-start justify-between gap-4 pt-1",
|
|
278
|
-
children: [/* @__PURE__ */
|
|
278
|
+
children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
|
|
279
279
|
className: "text-sm font-medium text-text-primary",
|
|
280
|
-
children:
|
|
281
|
-
}), /* @__PURE__ */
|
|
280
|
+
children: x("billing.plans.isPurchasableLabel", "Publicly purchasable")
|
|
281
|
+
}), /* @__PURE__ */ _("p", {
|
|
282
282
|
className: "text-xs text-text-muted mt-0.5",
|
|
283
|
-
children: V ?
|
|
284
|
-
})] }), /* @__PURE__ */
|
|
283
|
+
children: V ? x("billing.plans.isPurchasableOn", "Visible on pricing page — users can subscribe directly.") : x("billing.plans.isPurchasableOff", "Internal / custom plan — hidden from pricing page, assign via API only.")
|
|
284
|
+
})] }), /* @__PURE__ */ _("button", {
|
|
285
285
|
type: "button",
|
|
286
286
|
role: "switch",
|
|
287
287
|
"aria-checked": V,
|
|
288
288
|
onClick: () => H((e) => !e),
|
|
289
289
|
className: `relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:ring-offset-2 ${V ? "bg-action-primary-bg" : "bg-text-muted/30"}`,
|
|
290
|
-
children: /* @__PURE__ */
|
|
290
|
+
children: /* @__PURE__ */ _("span", { className: `inline-block h-5 w-5 transform rounded-full bg-bg-surface shadow transition-transform ${V ? "translate-x-5" : "translate-x-0"}` })
|
|
291
291
|
})]
|
|
292
292
|
})
|
|
293
293
|
]
|
|
294
294
|
})]
|
|
295
|
-
}), /* @__PURE__ */
|
|
295
|
+
}), /* @__PURE__ */ v("div", {
|
|
296
296
|
className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
|
|
297
|
-
children: [/* @__PURE__ */
|
|
297
|
+
children: [/* @__PURE__ */ v("div", {
|
|
298
298
|
className: "p-4 border-b border-border-subtle bg-bg-sunken/30 flex items-center justify-between",
|
|
299
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ _("h2", {
|
|
300
300
|
className: "font-semibold text-text-primary",
|
|
301
|
-
children:
|
|
302
|
-
}), /* @__PURE__ */
|
|
301
|
+
children: x("billing.plans.quotaAllocations", "Quota Allocations")
|
|
302
|
+
}), /* @__PURE__ */ _("button", {
|
|
303
303
|
type: "button",
|
|
304
|
-
onClick:
|
|
304
|
+
onClick: ie,
|
|
305
305
|
className: "px-3 py-1 text-sm font-medium text-text-link hover:bg-[var(--color-accent-soft)] rounded-md transition-colors",
|
|
306
306
|
children: "+ Add Quota"
|
|
307
307
|
})]
|
|
308
|
-
}), /* @__PURE__ */
|
|
308
|
+
}), /* @__PURE__ */ _("div", {
|
|
309
309
|
className: "p-4 space-y-3",
|
|
310
|
-
children: U.length === 0 ? /* @__PURE__ */
|
|
310
|
+
children: U.length === 0 ? /* @__PURE__ */ _("p", {
|
|
311
311
|
className: "text-sm text-text-muted",
|
|
312
|
-
children:
|
|
312
|
+
children: x("billing.plans.noQuotasAllocated", "No quotas allocated. Click \"Add Quota\" to add one.")
|
|
313
313
|
}) : U.map((e, t) => {
|
|
314
314
|
let n = O.find((t) => t.id === e.quotaId), r = n?.limits?.type ?? "unknown";
|
|
315
|
-
return /* @__PURE__ */
|
|
315
|
+
return /* @__PURE__ */ v("div", {
|
|
316
316
|
className: "p-3 border border-border-subtle rounded-lg bg-bg-sunken/20 space-y-3",
|
|
317
|
-
children: [/* @__PURE__ */
|
|
317
|
+
children: [/* @__PURE__ */ v("div", {
|
|
318
318
|
className: "flex items-center gap-3",
|
|
319
|
-
children: [/* @__PURE__ */
|
|
319
|
+
children: [/* @__PURE__ */ v(h, {
|
|
320
320
|
value: e.quotaId,
|
|
321
321
|
onChange: (e) => $(t, "quotaId", e.target.value),
|
|
322
322
|
className: `flex-1 px-3 py-2 border border-border-subtle rounded-input bg-bg-surface scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] ${e.quotaId === "" ? "text-text-muted" : "text-text-primary"}`,
|
|
323
|
-
children: [/* @__PURE__ */
|
|
323
|
+
children: [/* @__PURE__ */ _("option", {
|
|
324
324
|
value: "",
|
|
325
325
|
disabled: !0,
|
|
326
|
-
children:
|
|
327
|
-
}), O.map((e) => /* @__PURE__ */
|
|
326
|
+
children: x("billing.plans.selectQuota", "Select a quota...")
|
|
327
|
+
}), O.map((e) => /* @__PURE__ */ _("option", {
|
|
328
328
|
value: e.id,
|
|
329
329
|
children: e.name
|
|
330
330
|
}, e.id))]
|
|
331
|
-
}), /* @__PURE__ */
|
|
331
|
+
}), /* @__PURE__ */ _("button", {
|
|
332
332
|
type: "button",
|
|
333
|
-
onClick: () =>
|
|
333
|
+
onClick: () => ae(t),
|
|
334
334
|
className: "p-2 text-status-error-text hover:bg-status-error-bg-subtle rounded-md transition-colors",
|
|
335
335
|
title: "Remove quota",
|
|
336
|
-
children: /* @__PURE__ */
|
|
336
|
+
children: /* @__PURE__ */ _("svg", {
|
|
337
337
|
className: "size-5",
|
|
338
338
|
fill: "none",
|
|
339
339
|
viewBox: "0 0 24 24",
|
|
340
340
|
stroke: "currentColor",
|
|
341
|
-
children: /* @__PURE__ */
|
|
341
|
+
children: /* @__PURE__ */ _("path", {
|
|
342
342
|
strokeLinecap: "round",
|
|
343
343
|
strokeLinejoin: "round",
|
|
344
344
|
strokeWidth: 2,
|
|
@@ -346,18 +346,18 @@ var y = () => {
|
|
|
346
346
|
})
|
|
347
347
|
})
|
|
348
348
|
})]
|
|
349
|
-
}), n && /* @__PURE__ */
|
|
349
|
+
}), n && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", {
|
|
350
350
|
className: "flex items-center justify-between text-sm",
|
|
351
|
-
children: /* @__PURE__ */
|
|
351
|
+
children: /* @__PURE__ */ v("span", {
|
|
352
352
|
className: "capitalize text-text-muted",
|
|
353
353
|
children: ["Type: ", r]
|
|
354
354
|
})
|
|
355
|
-
}), /* @__PURE__ */
|
|
355
|
+
}), /* @__PURE__ */ v("div", {
|
|
356
356
|
className: "flex items-center gap-2",
|
|
357
|
-
children: [/* @__PURE__ */
|
|
357
|
+
children: [/* @__PURE__ */ v("label", {
|
|
358
358
|
className: "text-sm text-text-muted",
|
|
359
|
-
children: [
|
|
360
|
-
}), /* @__PURE__ */
|
|
359
|
+
children: [x("billing.plans.limit", "Limit"), ":"]
|
|
360
|
+
}), /* @__PURE__ */ _("input", {
|
|
361
361
|
type: "number",
|
|
362
362
|
min: "1",
|
|
363
363
|
value: e.quantity,
|
|
@@ -370,20 +370,20 @@ var y = () => {
|
|
|
370
370
|
})]
|
|
371
371
|
})]
|
|
372
372
|
}),
|
|
373
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ _(r, {
|
|
374
374
|
overrides: G,
|
|
375
375
|
onChange: K
|
|
376
376
|
}),
|
|
377
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ v("div", {
|
|
378
378
|
className: "flex items-center gap-3 pt-4",
|
|
379
|
-
children: [/* @__PURE__ */
|
|
379
|
+
children: [/* @__PURE__ */ _("button", {
|
|
380
380
|
type: "submit",
|
|
381
381
|
disabled: j,
|
|
382
382
|
className: "px-6 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors disabled:opacity-50",
|
|
383
|
-
children: j ?
|
|
384
|
-
}), /* @__PURE__ */
|
|
383
|
+
children: j ? x("billing.plans.saving", "Saving...") : x("billing.plans.saveChanges", "Save Changes")
|
|
384
|
+
}), /* @__PURE__ */ _("button", {
|
|
385
385
|
type: "button",
|
|
386
|
-
onClick: () =>
|
|
386
|
+
onClick: () => C(`/plans/${S}`),
|
|
387
387
|
className: "px-6 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
|
|
388
388
|
children: "Cancel"
|
|
389
389
|
})]
|
|
@@ -393,6 +393,6 @@ var y = () => {
|
|
|
393
393
|
]
|
|
394
394
|
});
|
|
395
395
|
};
|
|
396
|
-
export {
|
|
396
|
+
export { b as PlanEditPage };
|
|
397
397
|
|
|
398
398
|
//# sourceMappingURL=PlanEditPage.js.map
|