@burdenoff/microfe-billing 2026.1116.1 → 2026.1119.2
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/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 +125 -125
- 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
|
@@ -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
|
|
13
|
-
import { Fragment as
|
|
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
|
|
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
|
-
],
|
|
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
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
|
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
|
|
85
|
+
function A(e, t) {
|
|
86
86
|
return t === c.Yearly ? e / 12 : e;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
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
|
|
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 =
|
|
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
|
|
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 =
|
|
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
|
|
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
|
|
130
|
-
let a = i(), [c,
|
|
131
|
-
let e =
|
|
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 +
|
|
134
|
-
}, 0), t = e * 12, n =
|
|
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:
|
|
143
|
+
activeSubscriptions: U.length
|
|
144
144
|
};
|
|
145
145
|
}, [
|
|
146
|
-
|
|
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
|
-
|
|
155
|
-
|
|
156
|
-
]),
|
|
154
|
+
j,
|
|
155
|
+
F
|
|
156
|
+
]), q = u(() => N(H, c, j, F), [
|
|
157
157
|
c,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
]),
|
|
158
|
+
j,
|
|
159
|
+
F,
|
|
160
|
+
H
|
|
161
|
+
]), J = u(() => {
|
|
162
162
|
let e = /* @__PURE__ */ new Map();
|
|
163
|
-
return
|
|
164
|
-
let n = t.plan?.name || "Unknown Plan", r = t.seatCount && t.seatCount > 0 ? t.seatCount : 1, i =
|
|
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
|
-
}, [
|
|
172
|
-
let t = (e.subscriptions ?? []).filter((e) => e ?
|
|
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 +
|
|
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), [
|
|
184
|
-
return a.canViewAnalytics ? /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
190
|
+
actions: /* @__PURE__ */ w("div", {
|
|
191
191
|
className: "flex flex-col gap-2 sm:flex-row sm:items-center",
|
|
192
|
-
children: [/* @__PURE__ */
|
|
192
|
+
children: [/* @__PURE__ */ C(h, {
|
|
193
193
|
value: c,
|
|
194
|
-
onChange: (e) =>
|
|
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:
|
|
197
|
+
children: T.map((e) => /* @__PURE__ */ C("option", {
|
|
198
198
|
value: e.value,
|
|
199
199
|
children: e.label
|
|
200
200
|
}, e.value))
|
|
201
|
-
}), /* @__PURE__ */
|
|
201
|
+
}), /* @__PURE__ */ C(r, { actions: [{
|
|
202
202
|
label: "Refresh",
|
|
203
203
|
onSelect: () => {
|
|
204
|
-
|
|
204
|
+
z();
|
|
205
205
|
},
|
|
206
|
-
icon: /* @__PURE__ */
|
|
206
|
+
icon: /* @__PURE__ */ C(v, { className: "size-4" })
|
|
207
207
|
}] })]
|
|
208
208
|
})
|
|
209
209
|
}),
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
-
|
|
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__ */
|
|
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__ */
|
|
216
|
+
}), /* @__PURE__ */ C("p", {
|
|
217
217
|
className: "mt-1 text-sm",
|
|
218
|
-
children:
|
|
218
|
+
children: R.message
|
|
219
219
|
})] })]
|
|
220
220
|
}),
|
|
221
|
-
|
|
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__ */
|
|
223
|
+
children: /* @__PURE__ */ w("div", {
|
|
224
224
|
className: "flex flex-col items-center gap-3 text-text-muted",
|
|
225
|
-
children: [/* @__PURE__ */
|
|
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
|
-
}) :
|
|
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__ */
|
|
235
|
-
/* @__PURE__ */
|
|
234
|
+
}) : /* @__PURE__ */ w(S, { children: [
|
|
235
|
+
/* @__PURE__ */ C(f, {
|
|
236
236
|
className: "p-4 sm:p-5",
|
|
237
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
240
|
+
/* @__PURE__ */ C(n, {
|
|
241
241
|
label: "MRR",
|
|
242
|
-
value:
|
|
243
|
-
icon: /* @__PURE__ */
|
|
242
|
+
value: P(G.mrr, W),
|
|
243
|
+
icon: /* @__PURE__ */ C(y, { className: "size-5" })
|
|
244
244
|
}),
|
|
245
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ C(n, {
|
|
246
246
|
label: "ARR",
|
|
247
|
-
value:
|
|
248
|
-
icon: /* @__PURE__ */
|
|
247
|
+
value: P(G.arr, W),
|
|
248
|
+
icon: /* @__PURE__ */ C(_, { className: "size-5" })
|
|
249
249
|
}),
|
|
250
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ C(n, {
|
|
251
251
|
label: "ARPU",
|
|
252
|
-
value:
|
|
253
|
-
icon: /* @__PURE__ */
|
|
252
|
+
value: P(G.arpu, W),
|
|
253
|
+
icon: /* @__PURE__ */ C(x, { className: "size-5" })
|
|
254
254
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ C(n, {
|
|
256
256
|
label: "Churn Rate",
|
|
257
|
-
value: o(
|
|
258
|
-
icon: /* @__PURE__ */
|
|
257
|
+
value: o(G.churnRate),
|
|
258
|
+
icon: /* @__PURE__ */ C(b, { className: "size-5" })
|
|
259
259
|
})
|
|
260
260
|
]
|
|
261
261
|
})
|
|
262
262
|
}),
|
|
263
|
-
/* @__PURE__ */
|
|
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__ */
|
|
266
|
+
/* @__PURE__ */ C(n, {
|
|
267
267
|
label: "Total Customers",
|
|
268
|
-
value:
|
|
268
|
+
value: G.totalCustomers
|
|
269
269
|
}),
|
|
270
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ C(n, {
|
|
271
271
|
label: "New Customers",
|
|
272
|
-
value:
|
|
272
|
+
value: G.newCustomers
|
|
273
273
|
}),
|
|
274
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ C(n, {
|
|
275
275
|
label: "Active Subscriptions",
|
|
276
|
-
value:
|
|
276
|
+
value: G.activeSubscriptions
|
|
277
277
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ C(n, {
|
|
279
279
|
label: "Estimated LTV",
|
|
280
|
-
value:
|
|
280
|
+
value: P(G.ltv, W)
|
|
281
281
|
})
|
|
282
282
|
]
|
|
283
283
|
}),
|
|
284
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ w("div", {
|
|
285
285
|
className: "grid grid-cols-1 gap-6 xl:grid-cols-2",
|
|
286
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
288
|
+
children: [/* @__PURE__ */ w("div", {
|
|
289
289
|
className: "mb-4 flex items-center justify-between gap-3",
|
|
290
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
293
|
+
}), /* @__PURE__ */ C("p", {
|
|
294
294
|
className: "text-sm text-text-muted",
|
|
295
295
|
children: "Successful payments received during the selected period."
|
|
296
|
-
})] }), /* @__PURE__ */
|
|
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
|
-
|
|
299
|
+
K.length,
|
|
300
300
|
" data point",
|
|
301
|
-
|
|
301
|
+
K.length === 1 ? "" : "s"
|
|
302
302
|
]
|
|
303
303
|
})]
|
|
304
|
-
}),
|
|
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__ */
|
|
307
|
+
}) : /* @__PURE__ */ C("div", {
|
|
308
308
|
className: "space-y-3",
|
|
309
|
-
children:
|
|
309
|
+
children: K.map((e) => /* @__PURE__ */ w("div", {
|
|
310
310
|
className: "space-y-1",
|
|
311
|
-
children: [/* @__PURE__ */
|
|
311
|
+
children: [/* @__PURE__ */ w("div", {
|
|
312
312
|
className: "flex items-center justify-between gap-3 text-sm",
|
|
313
|
-
children: [/* @__PURE__ */
|
|
313
|
+
children: [/* @__PURE__ */ C("span", {
|
|
314
314
|
className: "font-medium text-text-primary",
|
|
315
315
|
children: e.label
|
|
316
|
-
}), /* @__PURE__ */
|
|
316
|
+
}), /* @__PURE__ */ C("span", {
|
|
317
317
|
className: "text-text-muted",
|
|
318
|
-
children:
|
|
318
|
+
children: P(e.value, W)
|
|
319
319
|
})]
|
|
320
|
-
}), /* @__PURE__ */
|
|
320
|
+
}), /* @__PURE__ */ C("div", {
|
|
321
321
|
className: "h-2 rounded-full bg-bg-sunken",
|
|
322
|
-
children: /* @__PURE__ */
|
|
322
|
+
children: /* @__PURE__ */ C("div", {
|
|
323
323
|
className: "h-2 rounded-full bg-action-primary-bg transition-[width]",
|
|
324
|
-
style: { width: `${
|
|
324
|
+
style: { width: `${X > 0 ? e.value / X * 100 : 0}%` }
|
|
325
325
|
})
|
|
326
326
|
})]
|
|
327
327
|
}, e.label))
|
|
328
328
|
})]
|
|
329
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
331
|
+
children: [/* @__PURE__ */ w("div", {
|
|
332
332
|
className: "mb-4 flex items-center justify-between gap-3",
|
|
333
|
-
children: [/* @__PURE__ */
|
|
333
|
+
children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("h3", {
|
|
334
334
|
className: "font-semibold text-text-primary",
|
|
335
335
|
children: "Subscription growth"
|
|
336
|
-
}), /* @__PURE__ */
|
|
336
|
+
}), /* @__PURE__ */ C("p", {
|
|
337
337
|
className: "text-sm text-text-muted",
|
|
338
338
|
children: "New subscriptions created during the selected period."
|
|
339
|
-
})] }), /* @__PURE__ */
|
|
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: [
|
|
341
|
+
children: [q.reduce((e, t) => e + t.value, 0), " created"]
|
|
342
342
|
})]
|
|
343
|
-
}),
|
|
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__ */
|
|
346
|
+
}) : /* @__PURE__ */ C("div", {
|
|
347
347
|
className: "space-y-3",
|
|
348
|
-
children:
|
|
348
|
+
children: q.map((e) => /* @__PURE__ */ w("div", {
|
|
349
349
|
className: "space-y-1",
|
|
350
|
-
children: [/* @__PURE__ */
|
|
350
|
+
children: [/* @__PURE__ */ w("div", {
|
|
351
351
|
className: "flex items-center justify-between gap-3 text-sm",
|
|
352
|
-
children: [/* @__PURE__ */
|
|
352
|
+
children: [/* @__PURE__ */ C("span", {
|
|
353
353
|
className: "font-medium text-text-primary",
|
|
354
354
|
children: e.label
|
|
355
|
-
}), /* @__PURE__ */
|
|
355
|
+
}), /* @__PURE__ */ w("span", {
|
|
356
356
|
className: "text-text-muted",
|
|
357
357
|
children: [e.value, " new"]
|
|
358
358
|
})]
|
|
359
|
-
}), /* @__PURE__ */
|
|
359
|
+
}), /* @__PURE__ */ C("div", {
|
|
360
360
|
className: "h-2 rounded-full bg-bg-sunken",
|
|
361
|
-
children: /* @__PURE__ */
|
|
361
|
+
children: /* @__PURE__ */ C("div", {
|
|
362
362
|
className: "h-2 rounded-full bg-status-success-bg transition-[width]",
|
|
363
|
-
style: { width: `${
|
|
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__ */
|
|
370
|
+
/* @__PURE__ */ w("div", {
|
|
371
371
|
className: "grid grid-cols-1 gap-6 xl:grid-cols-2",
|
|
372
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
374
|
+
children: [/* @__PURE__ */ w("div", {
|
|
375
375
|
className: "border-b border-border-subtle p-4",
|
|
376
|
-
children: [/* @__PURE__ */
|
|
376
|
+
children: [/* @__PURE__ */ C("h3", {
|
|
377
377
|
className: "font-semibold text-text-primary",
|
|
378
378
|
children: "Revenue by plan"
|
|
379
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
383
|
+
}), /* @__PURE__ */ C("div", {
|
|
384
384
|
className: "p-4",
|
|
385
|
-
children:
|
|
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__ */
|
|
388
|
+
}) : /* @__PURE__ */ C("div", {
|
|
389
389
|
className: "space-y-3",
|
|
390
|
-
children:
|
|
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__ */
|
|
392
|
+
children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
|
|
393
393
|
className: "font-medium text-text-primary",
|
|
394
394
|
children: e.name
|
|
395
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
402
|
+
})] }), /* @__PURE__ */ w("p", {
|
|
403
403
|
className: "text-sm font-semibold text-text-primary",
|
|
404
|
-
children: [
|
|
404
|
+
children: [P(e.estimatedMrr, W), " / month"]
|
|
405
405
|
})]
|
|
406
406
|
}, e.name))
|
|
407
407
|
})
|
|
408
408
|
})]
|
|
409
|
-
}), /* @__PURE__ */
|
|
409
|
+
}), /* @__PURE__ */ w("section", {
|
|
410
410
|
className: "rounded-card border border-border-seam bg-bg-surface shadow-[var(--shadow-elevation-1)]",
|
|
411
|
-
children: [/* @__PURE__ */
|
|
411
|
+
children: [/* @__PURE__ */ w("div", {
|
|
412
412
|
className: "border-b border-border-subtle p-4",
|
|
413
|
-
children: [/* @__PURE__ */
|
|
413
|
+
children: [/* @__PURE__ */ C("h3", {
|
|
414
414
|
className: "font-semibold text-text-primary",
|
|
415
415
|
children: "Top customers"
|
|
416
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
420
|
+
}), /* @__PURE__ */ C("div", {
|
|
421
421
|
className: "p-4",
|
|
422
|
-
children:
|
|
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__ */
|
|
425
|
+
}) : /* @__PURE__ */ C("div", {
|
|
426
426
|
className: "space-y-3",
|
|
427
|
-
children:
|
|
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__ */
|
|
429
|
+
children: [/* @__PURE__ */ w("div", {
|
|
430
430
|
className: "min-w-0",
|
|
431
|
-
children: [/* @__PURE__ */
|
|
431
|
+
children: [/* @__PURE__ */ C("p", {
|
|
432
432
|
className: "truncate font-medium text-text-primary",
|
|
433
433
|
children: e.name
|
|
434
|
-
}), /* @__PURE__ */
|
|
434
|
+
}), /* @__PURE__ */ C("p", {
|
|
435
435
|
className: "truncate text-sm text-text-muted",
|
|
436
436
|
children: e.email
|
|
437
437
|
})]
|
|
438
|
-
}), /* @__PURE__ */
|
|
438
|
+
}), /* @__PURE__ */ w("div", {
|
|
439
439
|
className: "text-left sm:text-right",
|
|
440
|
-
children: [/* @__PURE__ */
|
|
440
|
+
children: [/* @__PURE__ */ w("p", {
|
|
441
441
|
className: "text-sm font-semibold text-text-primary",
|
|
442
|
-
children: [
|
|
443
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
459
|
+
}) : /* @__PURE__ */ C(e, { message: "You don't have permission to view analytics." });
|
|
460
460
|
};
|
|
461
|
-
export {
|
|
461
|
+
export { F as AnalyticsPage };
|
|
462
462
|
|
|
463
463
|
//# sourceMappingURL=AnalyticsPage.js.map
|