@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.
Files changed (64) hide show
  1. package/dist/billing/modules/addons/pages/AddonCreatePage.js +143 -143
  2. package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
  3. package/dist/billing/modules/addons/pages/AddonEditPage.js +170 -170
  4. package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
  5. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +148 -148
  6. package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
  7. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +115 -115
  8. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js.map +1 -1
  9. package/dist/billing/modules/billing/pages/InvoicesListPage.js +136 -136
  10. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
  11. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +129 -129
  12. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js.map +1 -1
  13. package/dist/billing/modules/billing/pages/RefundsPage.js +325 -325
  14. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  15. package/dist/billing/modules/billing/pages/UserRefundsPage.js +149 -149
  16. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  17. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js +99 -98
  18. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js.map +1 -1
  19. package/dist/billing/modules/checkout/components/StoreShippingSection.js +125 -124
  20. package/dist/billing/modules/checkout/components/StoreShippingSection.js.map +1 -1
  21. package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js +61 -60
  22. package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js.map +1 -1
  23. package/dist/billing/modules/checkout/pages/CheckoutPage.js +1 -1
  24. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
  25. package/dist/billing/modules/coupons/pages/CouponsListPage.js +177 -177
  26. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  27. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +231 -231
  28. package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
  29. package/dist/billing/modules/coupons/pages/EditCouponPage.js +139 -139
  30. package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -1
  31. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +54 -54
  32. package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
  33. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +65 -65
  34. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
  35. package/dist/billing/modules/credits/pages/CreditsPage.js +95 -95
  36. package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
  37. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js +232 -231
  38. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js.map +1 -1
  39. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +328 -328
  40. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  41. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +57 -57
  42. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
  43. package/dist/billing/modules/earnings/pages/EarningsPage.js +53 -53
  44. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  45. package/dist/billing/modules/earnings/pages/PayoutsPage.js +100 -100
  46. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  47. package/dist/billing/modules/plans/pages/PlanCreatePage.js +150 -150
  48. package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
  49. package/dist/billing/modules/plans/pages/PlanEditPage.js +125 -125
  50. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  51. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +113 -113
  52. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
  53. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +132 -132
  54. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
  55. package/dist/billing/modules/settings/pages/SettingsPage.js +101 -101
  56. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  57. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +175 -171
  58. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  59. package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js +51 -50
  60. package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js.map +1 -1
  61. package/dist/billing/modules/usage/pages/UsagePage.js +107 -107
  62. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  63. package/dist/billing/shared/components/GeoPricingOverridesEditor.js +1 -0
  64. package/package.json +2 -2
@@ -8,11 +8,11 @@ import { formatCurrency as a, formatPercentage as o } from "../../../shared/util
8
8
  import { useGetBillingAnalyticsPageDataQuery as s } from "../../../../generated/global-operations.js";
9
9
  import { PlanDuration as c, SubscriptionStatus as l } from "../../../../generated/global-types.js";
10
10
  import { useMemo as u, useState as d } from "react";
11
- import { EmphasisPanel as f, IllustratedEmptyState as p, PagePurpose as m } from "@burdenoff/fe-libs/ui";
12
- import { AlertCircle as h, BarChart3 as g, RefreshCw as _, TrendingUp as v, Users as y, Wallet as b } from "lucide-react";
13
- import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
11
+ import { EmphasisPanel as f, IllustratedEmptyState as p, PagePurpose as m, ThemedSelect as h } from "@burdenoff/fe-libs/ui";
12
+ import { AlertCircle as g, BarChart3 as _, RefreshCw as v, TrendingUp as y, Users as b, Wallet as x } from "lucide-react";
13
+ import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
14
14
  // src/billing/modules/analytics/pages/AnalyticsPage.tsx
15
- var w = [
15
+ var T = [
16
16
  {
17
17
  value: "LAST_7_DAYS",
18
18
  label: "Last 7 days"
@@ -33,37 +33,37 @@ var w = [
33
33
  value: "LAST_MONTH",
34
34
  label: "Last month"
35
35
  }
36
- ], T = /* @__PURE__ */ new Set([
36
+ ], E = /* @__PURE__ */ new Set([
37
37
  l.Active,
38
38
  l.Trialing,
39
39
  l.PastDue,
40
40
  l.Paused
41
41
  ]);
42
- function E(e) {
42
+ function D(e) {
43
43
  let t = new Date(e);
44
44
  return t.setHours(0, 0, 0, 0), t;
45
45
  }
46
- function D(e) {
46
+ function O(e) {
47
47
  let t = /* @__PURE__ */ new Date(), n = t;
48
48
  switch (e) {
49
49
  case "LAST_7_DAYS": {
50
50
  let e = new Date(t);
51
51
  return e.setDate(e.getDate() - 6), {
52
- start: E(e),
52
+ start: D(e),
53
53
  end: n
54
54
  };
55
55
  }
56
56
  case "LAST_30_DAYS": {
57
57
  let e = new Date(t);
58
58
  return e.setDate(e.getDate() - 29), {
59
- start: E(e),
59
+ start: D(e),
60
60
  end: n
61
61
  };
62
62
  }
63
63
  case "LAST_90_DAYS": {
64
64
  let e = new Date(t);
65
65
  return e.setDate(e.getDate() - 89), {
66
- start: E(e),
66
+ start: D(e),
67
67
  end: n
68
68
  };
69
69
  }
@@ -77,45 +77,45 @@ function D(e) {
77
77
  };
78
78
  }
79
79
  }
80
- function O(e, t, n) {
80
+ function k(e, t, n) {
81
81
  if (!e) return !1;
82
82
  let r = new Date(e);
83
83
  return r >= t && r <= n;
84
84
  }
85
- function k(e, t) {
85
+ function A(e, t) {
86
86
  return t === c.Yearly ? e / 12 : e;
87
87
  }
88
- function A(e, t) {
88
+ function j(e, t) {
89
89
  return new Intl.DateTimeFormat("en-US", {
90
90
  month: "short",
91
91
  day: "numeric"
92
92
  }).format(e);
93
93
  }
94
- function j(e, t, n, r) {
94
+ function M(e, t, n, r) {
95
95
  let i = /* @__PURE__ */ new Map();
96
96
  return e.forEach((e) => {
97
97
  let a = new Date(e.paidAt || e.createdAt);
98
98
  if (a < n || a > r) return;
99
- let o = A(a, t);
99
+ let o = j(a, t);
100
100
  i.set(o, (i.get(o) ?? 0) + e.amount);
101
101
  }), Array.from(i.entries()).map(([e, t]) => ({
102
102
  label: e,
103
103
  value: t
104
104
  }));
105
105
  }
106
- function M(e, t, n, r) {
106
+ function N(e, t, n, r) {
107
107
  let i = /* @__PURE__ */ new Map();
108
108
  return e.forEach((e) => {
109
109
  let a = new Date(e.createdAt);
110
110
  if (a < n || a > r) return;
111
- let o = A(a, t);
111
+ let o = j(a, t);
112
112
  i.set(o, (i.get(o) ?? 0) + 1);
113
113
  }), Array.from(i.entries()).map(([e, t]) => ({
114
114
  label: e,
115
115
  value: t
116
116
  }));
117
117
  }
118
- function N(e, t) {
118
+ function P(e, t) {
119
119
  try {
120
120
  return a(e, t);
121
121
  } catch {
@@ -126,12 +126,12 @@ function N(e, t) {
126
126
  }).format(e);
127
127
  }
128
128
  }
129
- var P = () => {
130
- let a = i(), [c, E] = d("LAST_30_DAYS"), { start: A, end: P } = u(() => D(c), [c]), { data: F, loading: I, error: L, refetch: R } = s({ fetchPolicy: "cache-and-network" }), z = u(() => F?.getBillingAccountsByOrg ?? [], [F?.getBillingAccountsByOrg]), B = u(() => F?.getPayments ?? [], [F?.getPayments]), V = u(() => z.flatMap((e) => (e.subscriptions ?? []).filter((e) => !!e)), [z]), H = u(() => V.filter((e) => T.has(e.status)), [V]), U = H.find((e) => e.plan?.currency)?.plan?.currency || B[0]?.currency || z[0]?.currency || "USD", W = u(() => {
131
- let e = H.reduce((e, t) => {
129
+ var F = () => {
130
+ let a = i(), [c, D] = d("LAST_30_DAYS"), { start: j, end: F } = u(() => O(c), [c]), { data: I, loading: L, error: R, refetch: z } = s({ fetchPolicy: "cache-and-network" }), B = u(() => I?.getBillingAccountsByOrg ?? [], [I?.getBillingAccountsByOrg]), V = u(() => I?.getPayments ?? [], [I?.getPayments]), H = u(() => B.flatMap((e) => (e.subscriptions ?? []).filter((e) => !!e)), [B]), U = u(() => H.filter((e) => E.has(e.status)), [H]), W = U.find((e) => e.plan?.currency)?.plan?.currency || V[0]?.currency || B[0]?.currency || "USD", G = u(() => {
131
+ let e = U.reduce((e, t) => {
132
132
  let n = t.plan?.price ?? 0, r = t.seatCount && t.seatCount > 0 ? t.seatCount : 1;
133
- return e + k(n, t.plan?.duration) * r;
134
- }, 0), t = e * 12, n = z.length, r = z.filter((e) => O(e.createdAt, A, P)).length, i = V.filter((e) => (e.status === l.Canceled || e.status === l.Expired) && O(e.canceledAt || e.endDate, A, P)).length, a = H.length + i, o = a > 0 ? i / a * 100 : 0, s = n > 0 ? e / n : 0;
133
+ return e + A(n, t.plan?.duration) * r;
134
+ }, 0), t = e * 12, n = B.length, r = B.filter((e) => k(e.createdAt, j, F)).length, i = H.filter((e) => (e.status === l.Canceled || e.status === l.Expired) && k(e.canceledAt || e.endDate, j, F)).length, a = U.length + i, o = a > 0 ? i / a * 100 : 0, s = n > 0 ? e / n : 0;
135
135
  return {
136
136
  mrr: e,
137
137
  arr: t,
@@ -140,38 +140,38 @@ var P = () => {
140
140
  ltv: o > 0 ? s / (o / 100) : t,
141
141
  totalCustomers: n,
142
142
  newCustomers: r,
143
- activeSubscriptions: H.length
143
+ activeSubscriptions: U.length
144
144
  };
145
145
  }, [
146
- H,
147
- z,
148
- A,
149
- P,
150
- V
151
- ]), G = u(() => j(B, c, A, P), [
146
+ U,
152
147
  B,
148
+ j,
149
+ F,
150
+ H
151
+ ]), K = u(() => M(V, c, j, F), [
152
+ V,
153
153
  c,
154
- A,
155
- P
156
- ]), K = u(() => M(V, c, A, P), [
154
+ j,
155
+ F
156
+ ]), q = u(() => N(H, c, j, F), [
157
157
  c,
158
- A,
159
- P,
160
- V
161
- ]), q = u(() => {
158
+ j,
159
+ F,
160
+ H
161
+ ]), J = u(() => {
162
162
  let e = /* @__PURE__ */ new Map();
163
- return H.forEach((t) => {
164
- let n = t.plan?.name || "Unknown Plan", r = t.seatCount && t.seatCount > 0 ? t.seatCount : 1, i = k(t.plan?.price ?? 0, t.plan?.duration) * r, a = e.get(n);
163
+ return U.forEach((t) => {
164
+ let n = t.plan?.name || "Unknown Plan", r = t.seatCount && t.seatCount > 0 ? t.seatCount : 1, i = A(t.plan?.price ?? 0, t.plan?.duration) * r, a = e.get(n);
165
165
  e.set(n, {
166
166
  name: n,
167
167
  activeSubscriptions: (a?.activeSubscriptions ?? 0) + 1,
168
168
  estimatedMrr: (a?.estimatedMrr ?? 0) + i
169
169
  });
170
170
  }), Array.from(e.values()).sort((e, t) => t.estimatedMrr - e.estimatedMrr);
171
- }, [H]), J = u(() => z.map((e) => {
172
- let t = (e.subscriptions ?? []).filter((e) => e ? T.has(e.status) : !1), n = t.reduce((e, t) => {
171
+ }, [U]), Y = u(() => B.map((e) => {
172
+ let t = (e.subscriptions ?? []).filter((e) => e ? E.has(e.status) : !1), n = t.reduce((e, t) => {
173
173
  let n = t.seatCount && t.seatCount > 0 ? t.seatCount : 1;
174
- return e + k(t.plan?.price ?? 0, t.plan?.duration) * n;
174
+ return e + A(t.plan?.price ?? 0, t.plan?.duration) * n;
175
175
  }, 0);
176
176
  return {
177
177
  id: e.id ?? e.name ?? e.email ?? "unknown-account",
@@ -180,267 +180,267 @@ var P = () => {
180
180
  activeSubscriptions: t.length,
181
181
  estimatedMrr: n
182
182
  };
183
- }).sort((e, t) => t.estimatedMrr - e.estimatedMrr).slice(0, 5), [z]), Y = Math.max(...G.map((e) => e.value), 0), X = Math.max(...K.map((e) => e.value), 0);
184
- return a.canViewAnalytics ? /* @__PURE__ */ C("div", {
183
+ }).sort((e, t) => t.estimatedMrr - e.estimatedMrr).slice(0, 5), [B]), X = Math.max(...K.map((e) => e.value), 0), Z = Math.max(...q.map((e) => e.value), 0);
184
+ return a.canViewAnalytics ? /* @__PURE__ */ w("div", {
185
185
  className: "space-y-6 p-4 sm:p-6",
186
186
  children: [
187
- /* @__PURE__ */ S(t, {
187
+ /* @__PURE__ */ C(t, {
188
188
  title: "Revenue Analytics",
189
189
  description: "Track recurring revenue, customer growth, and billing performance using live billing data.",
190
- actions: /* @__PURE__ */ C("div", {
190
+ actions: /* @__PURE__ */ w("div", {
191
191
  className: "flex flex-col gap-2 sm:flex-row sm:items-center",
192
- children: [/* @__PURE__ */ S("select", {
192
+ children: [/* @__PURE__ */ C(h, {
193
193
  value: c,
194
- onChange: (e) => E(e.target.value),
194
+ onChange: (e) => D(e.target.value),
195
195
  "aria-label": "Analytics period",
196
196
  className: "rounded-input border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
197
- children: w.map((e) => /* @__PURE__ */ S("option", {
197
+ children: T.map((e) => /* @__PURE__ */ C("option", {
198
198
  value: e.value,
199
199
  children: e.label
200
200
  }, e.value))
201
- }), /* @__PURE__ */ S(r, { actions: [{
201
+ }), /* @__PURE__ */ C(r, { actions: [{
202
202
  label: "Refresh",
203
203
  onSelect: () => {
204
- R();
204
+ z();
205
205
  },
206
- icon: /* @__PURE__ */ S(_, { className: "size-4" })
206
+ icon: /* @__PURE__ */ C(v, { className: "size-4" })
207
207
  }] })]
208
208
  })
209
209
  }),
210
- /* @__PURE__ */ S(m, { children: "Understand the financial health of your business at a glance — recurring revenue (MRR/ARR), customer growth, churn and your highest-value customers — all computed from live billing data. Use the period selector to compare timeframes and spot trends." }),
211
- L && /* @__PURE__ */ C("div", {
210
+ /* @__PURE__ */ C(m, { children: "Understand the financial health of your business at a glance — recurring revenue (MRR/ARR), customer growth, churn and your highest-value customers — all computed from live billing data. Use the period selector to compare timeframes and spot trends." }),
211
+ R && /* @__PURE__ */ w("div", {
212
212
  className: "flex items-start gap-3 rounded-lg border border-status-error-border bg-status-error-bg-subtle p-4 text-status-error-text",
213
- children: [/* @__PURE__ */ S(h, { className: "mt-0.5 size-4 shrink-0" }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
213
+ children: [/* @__PURE__ */ C(g, { className: "mt-0.5 size-4 shrink-0" }), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
214
214
  className: "font-medium",
215
215
  children: "Unable to load billing analytics"
216
- }), /* @__PURE__ */ S("p", {
216
+ }), /* @__PURE__ */ C("p", {
217
217
  className: "mt-1 text-sm",
218
- children: L.message
218
+ children: R.message
219
219
  })] })]
220
220
  }),
221
- I && z.length === 0 ? /* @__PURE__ */ S("div", {
221
+ L && B.length === 0 ? /* @__PURE__ */ C("div", {
222
222
  className: "flex min-h-[320px] items-center justify-center rounded-lg border border-border-subtle bg-bg-surface",
223
- children: /* @__PURE__ */ C("div", {
223
+ children: /* @__PURE__ */ w("div", {
224
224
  className: "flex flex-col items-center gap-3 text-text-muted",
225
- children: [/* @__PURE__ */ S(_, { className: "size-6 animate-spin" }), /* @__PURE__ */ S("p", {
225
+ children: [/* @__PURE__ */ C(v, { className: "size-6 animate-spin" }), /* @__PURE__ */ C("p", {
226
226
  className: "text-sm",
227
227
  children: "Loading live billing analytics…"
228
228
  })]
229
229
  })
230
- }) : z.length === 0 ? /* @__PURE__ */ S(p, {
230
+ }) : B.length === 0 ? /* @__PURE__ */ C(p, {
231
231
  illustration: "empty-data",
232
232
  title: "No billing data available yet",
233
233
  description: "Create a billing account and complete a subscription or payment to unlock live analytics."
234
- }) : /* @__PURE__ */ C(x, { children: [
235
- /* @__PURE__ */ S(f, {
234
+ }) : /* @__PURE__ */ w(S, { children: [
235
+ /* @__PURE__ */ C(f, {
236
236
  className: "p-4 sm:p-5",
237
- children: /* @__PURE__ */ C("div", {
237
+ children: /* @__PURE__ */ w("div", {
238
238
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4",
239
239
  children: [
240
- /* @__PURE__ */ S(n, {
240
+ /* @__PURE__ */ C(n, {
241
241
  label: "MRR",
242
- value: N(W.mrr, U),
243
- icon: /* @__PURE__ */ S(v, { className: "size-5" })
242
+ value: P(G.mrr, W),
243
+ icon: /* @__PURE__ */ C(y, { className: "size-5" })
244
244
  }),
245
- /* @__PURE__ */ S(n, {
245
+ /* @__PURE__ */ C(n, {
246
246
  label: "ARR",
247
- value: N(W.arr, U),
248
- icon: /* @__PURE__ */ S(g, { className: "size-5" })
247
+ value: P(G.arr, W),
248
+ icon: /* @__PURE__ */ C(_, { className: "size-5" })
249
249
  }),
250
- /* @__PURE__ */ S(n, {
250
+ /* @__PURE__ */ C(n, {
251
251
  label: "ARPU",
252
- value: N(W.arpu, U),
253
- icon: /* @__PURE__ */ S(b, { className: "size-5" })
252
+ value: P(G.arpu, W),
253
+ icon: /* @__PURE__ */ C(x, { className: "size-5" })
254
254
  }),
255
- /* @__PURE__ */ S(n, {
255
+ /* @__PURE__ */ C(n, {
256
256
  label: "Churn Rate",
257
- value: o(W.churnRate),
258
- icon: /* @__PURE__ */ S(y, { className: "size-5" })
257
+ value: o(G.churnRate),
258
+ icon: /* @__PURE__ */ C(b, { className: "size-5" })
259
259
  })
260
260
  ]
261
261
  })
262
262
  }),
263
- /* @__PURE__ */ C("div", {
263
+ /* @__PURE__ */ w("div", {
264
264
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4",
265
265
  children: [
266
- /* @__PURE__ */ S(n, {
266
+ /* @__PURE__ */ C(n, {
267
267
  label: "Total Customers",
268
- value: W.totalCustomers
268
+ value: G.totalCustomers
269
269
  }),
270
- /* @__PURE__ */ S(n, {
270
+ /* @__PURE__ */ C(n, {
271
271
  label: "New Customers",
272
- value: W.newCustomers
272
+ value: G.newCustomers
273
273
  }),
274
- /* @__PURE__ */ S(n, {
274
+ /* @__PURE__ */ C(n, {
275
275
  label: "Active Subscriptions",
276
- value: W.activeSubscriptions
276
+ value: G.activeSubscriptions
277
277
  }),
278
- /* @__PURE__ */ S(n, {
278
+ /* @__PURE__ */ C(n, {
279
279
  label: "Estimated LTV",
280
- value: N(W.ltv, U)
280
+ value: P(G.ltv, W)
281
281
  })
282
282
  ]
283
283
  }),
284
- /* @__PURE__ */ C("div", {
284
+ /* @__PURE__ */ w("div", {
285
285
  className: "grid grid-cols-1 gap-6 xl:grid-cols-2",
286
- children: [/* @__PURE__ */ C("section", {
286
+ children: [/* @__PURE__ */ w("section", {
287
287
  className: "rounded-card border border-border-seam bg-bg-surface p-4 sm:p-6 shadow-[var(--shadow-elevation-1)]",
288
- children: [/* @__PURE__ */ C("div", {
288
+ children: [/* @__PURE__ */ w("div", {
289
289
  className: "mb-4 flex items-center justify-between gap-3",
290
- children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("h3", {
290
+ children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("h3", {
291
291
  className: "font-semibold text-text-primary",
292
292
  children: "Revenue over time"
293
- }), /* @__PURE__ */ S("p", {
293
+ }), /* @__PURE__ */ C("p", {
294
294
  className: "text-sm text-text-muted",
295
295
  children: "Successful payments received during the selected period."
296
- })] }), /* @__PURE__ */ C("span", {
296
+ })] }), /* @__PURE__ */ w("span", {
297
297
  className: "rounded-full bg-status-info-bg-subtle px-2.5 py-1 text-xs font-medium text-status-info-text",
298
298
  children: [
299
- G.length,
299
+ K.length,
300
300
  " data point",
301
- G.length === 1 ? "" : "s"
301
+ K.length === 1 ? "" : "s"
302
302
  ]
303
303
  })]
304
- }), G.length === 0 ? /* @__PURE__ */ S("p", {
304
+ }), K.length === 0 ? /* @__PURE__ */ C("p", {
305
305
  className: "rounded-lg bg-bg-sunken/40 p-4 text-sm text-text-muted",
306
306
  children: "No successful payments were recorded during this period."
307
- }) : /* @__PURE__ */ S("div", {
307
+ }) : /* @__PURE__ */ C("div", {
308
308
  className: "space-y-3",
309
- children: G.map((e) => /* @__PURE__ */ C("div", {
309
+ children: K.map((e) => /* @__PURE__ */ w("div", {
310
310
  className: "space-y-1",
311
- children: [/* @__PURE__ */ C("div", {
311
+ children: [/* @__PURE__ */ w("div", {
312
312
  className: "flex items-center justify-between gap-3 text-sm",
313
- children: [/* @__PURE__ */ S("span", {
313
+ children: [/* @__PURE__ */ C("span", {
314
314
  className: "font-medium text-text-primary",
315
315
  children: e.label
316
- }), /* @__PURE__ */ S("span", {
316
+ }), /* @__PURE__ */ C("span", {
317
317
  className: "text-text-muted",
318
- children: N(e.value, U)
318
+ children: P(e.value, W)
319
319
  })]
320
- }), /* @__PURE__ */ S("div", {
320
+ }), /* @__PURE__ */ C("div", {
321
321
  className: "h-2 rounded-full bg-bg-sunken",
322
- children: /* @__PURE__ */ S("div", {
322
+ children: /* @__PURE__ */ C("div", {
323
323
  className: "h-2 rounded-full bg-action-primary-bg transition-[width]",
324
- style: { width: `${Y > 0 ? e.value / Y * 100 : 0}%` }
324
+ style: { width: `${X > 0 ? e.value / X * 100 : 0}%` }
325
325
  })
326
326
  })]
327
327
  }, e.label))
328
328
  })]
329
- }), /* @__PURE__ */ C("section", {
329
+ }), /* @__PURE__ */ w("section", {
330
330
  className: "rounded-card border border-border-seam bg-bg-surface p-4 sm:p-6 shadow-[var(--shadow-elevation-1)]",
331
- children: [/* @__PURE__ */ C("div", {
331
+ children: [/* @__PURE__ */ w("div", {
332
332
  className: "mb-4 flex items-center justify-between gap-3",
333
- children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("h3", {
333
+ children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("h3", {
334
334
  className: "font-semibold text-text-primary",
335
335
  children: "Subscription growth"
336
- }), /* @__PURE__ */ S("p", {
336
+ }), /* @__PURE__ */ C("p", {
337
337
  className: "text-sm text-text-muted",
338
338
  children: "New subscriptions created during the selected period."
339
- })] }), /* @__PURE__ */ C("span", {
339
+ })] }), /* @__PURE__ */ w("span", {
340
340
  className: "rounded-full bg-status-success-bg-subtle px-2.5 py-1 text-xs font-medium text-status-success-text",
341
- children: [K.reduce((e, t) => e + t.value, 0), " created"]
341
+ children: [q.reduce((e, t) => e + t.value, 0), " created"]
342
342
  })]
343
- }), K.length === 0 ? /* @__PURE__ */ S("p", {
343
+ }), q.length === 0 ? /* @__PURE__ */ C("p", {
344
344
  className: "rounded-lg bg-bg-sunken/40 p-4 text-sm text-text-muted",
345
345
  children: "No new subscriptions were created during this period."
346
- }) : /* @__PURE__ */ S("div", {
346
+ }) : /* @__PURE__ */ C("div", {
347
347
  className: "space-y-3",
348
- children: K.map((e) => /* @__PURE__ */ C("div", {
348
+ children: q.map((e) => /* @__PURE__ */ w("div", {
349
349
  className: "space-y-1",
350
- children: [/* @__PURE__ */ C("div", {
350
+ children: [/* @__PURE__ */ w("div", {
351
351
  className: "flex items-center justify-between gap-3 text-sm",
352
- children: [/* @__PURE__ */ S("span", {
352
+ children: [/* @__PURE__ */ C("span", {
353
353
  className: "font-medium text-text-primary",
354
354
  children: e.label
355
- }), /* @__PURE__ */ C("span", {
355
+ }), /* @__PURE__ */ w("span", {
356
356
  className: "text-text-muted",
357
357
  children: [e.value, " new"]
358
358
  })]
359
- }), /* @__PURE__ */ S("div", {
359
+ }), /* @__PURE__ */ C("div", {
360
360
  className: "h-2 rounded-full bg-bg-sunken",
361
- children: /* @__PURE__ */ S("div", {
361
+ children: /* @__PURE__ */ C("div", {
362
362
  className: "h-2 rounded-full bg-status-success-bg transition-[width]",
363
- style: { width: `${X > 0 ? e.value / X * 100 : 0}%` }
363
+ style: { width: `${Z > 0 ? e.value / Z * 100 : 0}%` }
364
364
  })
365
365
  })]
366
366
  }, e.label))
367
367
  })]
368
368
  })]
369
369
  }),
370
- /* @__PURE__ */ C("div", {
370
+ /* @__PURE__ */ w("div", {
371
371
  className: "grid grid-cols-1 gap-6 xl:grid-cols-2",
372
- children: [/* @__PURE__ */ C("section", {
372
+ children: [/* @__PURE__ */ w("section", {
373
373
  className: "rounded-card border border-border-seam bg-bg-surface shadow-[var(--shadow-elevation-1)]",
374
- children: [/* @__PURE__ */ C("div", {
374
+ children: [/* @__PURE__ */ w("div", {
375
375
  className: "border-b border-border-subtle p-4",
376
- children: [/* @__PURE__ */ S("h3", {
376
+ children: [/* @__PURE__ */ C("h3", {
377
377
  className: "font-semibold text-text-primary",
378
378
  children: "Revenue by plan"
379
- }), /* @__PURE__ */ S("p", {
379
+ }), /* @__PURE__ */ C("p", {
380
380
  className: "mt-1 text-sm text-text-muted",
381
381
  children: "Estimated monthly recurring revenue based on currently active subscriptions."
382
382
  })]
383
- }), /* @__PURE__ */ S("div", {
383
+ }), /* @__PURE__ */ C("div", {
384
384
  className: "p-4",
385
- children: q.length === 0 ? /* @__PURE__ */ S("p", {
385
+ children: J.length === 0 ? /* @__PURE__ */ C("p", {
386
386
  className: "text-sm text-text-muted",
387
387
  children: "No active plans to analyse yet."
388
- }) : /* @__PURE__ */ S("div", {
388
+ }) : /* @__PURE__ */ C("div", {
389
389
  className: "space-y-3",
390
- children: q.map((e) => /* @__PURE__ */ C("div", {
390
+ children: J.map((e) => /* @__PURE__ */ w("div", {
391
391
  className: "flex flex-col gap-2 rounded-lg border border-border-subtle p-3 sm:flex-row sm:items-center sm:justify-between",
392
- children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
392
+ children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
393
393
  className: "font-medium text-text-primary",
394
394
  children: e.name
395
- }), /* @__PURE__ */ C("p", {
395
+ }), /* @__PURE__ */ w("p", {
396
396
  className: "text-sm text-text-muted",
397
397
  children: [
398
398
  e.activeSubscriptions,
399
399
  " active subscription",
400
400
  e.activeSubscriptions === 1 ? "" : "s"
401
401
  ]
402
- })] }), /* @__PURE__ */ C("p", {
402
+ })] }), /* @__PURE__ */ w("p", {
403
403
  className: "text-sm font-semibold text-text-primary",
404
- children: [N(e.estimatedMrr, U), " / month"]
404
+ children: [P(e.estimatedMrr, W), " / month"]
405
405
  })]
406
406
  }, e.name))
407
407
  })
408
408
  })]
409
- }), /* @__PURE__ */ C("section", {
409
+ }), /* @__PURE__ */ w("section", {
410
410
  className: "rounded-card border border-border-seam bg-bg-surface shadow-[var(--shadow-elevation-1)]",
411
- children: [/* @__PURE__ */ C("div", {
411
+ children: [/* @__PURE__ */ w("div", {
412
412
  className: "border-b border-border-subtle p-4",
413
- children: [/* @__PURE__ */ S("h3", {
413
+ children: [/* @__PURE__ */ C("h3", {
414
414
  className: "font-semibold text-text-primary",
415
415
  children: "Top customers"
416
- }), /* @__PURE__ */ S("p", {
416
+ }), /* @__PURE__ */ C("p", {
417
417
  className: "mt-1 text-sm text-text-muted",
418
418
  children: "Ranked by estimated monthly recurring revenue from active subscriptions."
419
419
  })]
420
- }), /* @__PURE__ */ S("div", {
420
+ }), /* @__PURE__ */ C("div", {
421
421
  className: "p-4",
422
- children: J.length === 0 ? /* @__PURE__ */ S("p", {
422
+ children: Y.length === 0 ? /* @__PURE__ */ C("p", {
423
423
  className: "text-sm text-text-muted",
424
424
  children: "No customer revenue data available yet."
425
- }) : /* @__PURE__ */ S("div", {
425
+ }) : /* @__PURE__ */ C("div", {
426
426
  className: "space-y-3",
427
- children: J.map((e) => /* @__PURE__ */ C("div", {
427
+ children: Y.map((e) => /* @__PURE__ */ w("div", {
428
428
  className: "flex flex-col gap-2 rounded-lg border border-border-subtle p-3 sm:flex-row sm:items-center sm:justify-between",
429
- children: [/* @__PURE__ */ C("div", {
429
+ children: [/* @__PURE__ */ w("div", {
430
430
  className: "min-w-0",
431
- children: [/* @__PURE__ */ S("p", {
431
+ children: [/* @__PURE__ */ C("p", {
432
432
  className: "truncate font-medium text-text-primary",
433
433
  children: e.name
434
- }), /* @__PURE__ */ S("p", {
434
+ }), /* @__PURE__ */ C("p", {
435
435
  className: "truncate text-sm text-text-muted",
436
436
  children: e.email
437
437
  })]
438
- }), /* @__PURE__ */ C("div", {
438
+ }), /* @__PURE__ */ w("div", {
439
439
  className: "text-left sm:text-right",
440
- children: [/* @__PURE__ */ C("p", {
440
+ children: [/* @__PURE__ */ w("p", {
441
441
  className: "text-sm font-semibold text-text-primary",
442
- children: [N(e.estimatedMrr, U), " / month"]
443
- }), /* @__PURE__ */ C("p", {
442
+ children: [P(e.estimatedMrr, W), " / month"]
443
+ }), /* @__PURE__ */ w("p", {
444
444
  className: "text-xs text-text-muted",
445
445
  children: [
446
446
  e.activeSubscriptions,
@@ -456,8 +456,8 @@ var P = () => {
456
456
  })
457
457
  ] })
458
458
  ]
459
- }) : /* @__PURE__ */ S(e, { message: "You don't have permission to view analytics." });
459
+ }) : /* @__PURE__ */ C(e, { message: "You don't have permission to view analytics." });
460
460
  };
461
- export { P as AnalyticsPage };
461
+ export { F as AnalyticsPage };
462
462
 
463
463
  //# sourceMappingURL=AnalyticsPage.js.map