@burdenoff/microfe-billing 2026.623.3 → 2026.624.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.
Files changed (43) hide show
  1. package/dist/billing/BillingUserRoutes.js +3 -3
  2. package/dist/billing/BillingUserRoutes.js.map +1 -1
  3. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +34 -34
  4. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -1
  5. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +94 -94
  6. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
  7. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +162 -187
  8. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  9. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +146 -153
  10. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  11. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +10 -10
  12. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
  13. package/dist/billing/modules/billing/pages/TransactionsPage.js +62 -62
  14. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
  15. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +164 -179
  16. package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
  17. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +8 -8
  18. package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
  19. package/dist/billing/modules/earnings/pages/EarningsPage.js +243 -305
  20. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  21. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +73 -78
  22. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  23. package/dist/billing/modules/earnings/pages/PayoutsPage.js +173 -179
  24. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  25. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +4 -4
  26. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
  27. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +4 -4
  28. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
  29. package/dist/billing/modules/settings/pages/SettingsPage.js +181 -173
  30. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  31. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +111 -99
  32. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  33. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +68 -83
  34. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js.map +1 -1
  35. package/dist/billing/shared/components/AccessDenied.js +4 -4
  36. package/dist/billing/shared/components/AccessDenied.js.map +1 -1
  37. package/dist/billing/shared/components/ActorIdentity.js +8 -8
  38. package/dist/billing/shared/components/ActorIdentity.js.map +1 -1
  39. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js +11 -11
  40. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js.map +1 -1
  41. package/dist/billing/shared/ui/MetricCard.js +1 -1
  42. package/dist/billing/shared/ui/MetricCard.js.map +1 -1
  43. package/package.json +1 -1
@@ -1,435 +1,373 @@
1
1
  import { useBilling as e } from "../../../providers/BillingProvider.js";
2
2
  import { AccessDenied as t } from "../../../shared/components/AccessDenied.js";
3
- import { PageHeader as n } from "../../../shared/components/PageHeader.js";
4
- import { StatCard as r } from "../../../shared/components/StatCard.js";
5
- import { EmptyState as i } from "../../../shared/components/EmptyState.js";
6
- import { ServerError as a } from "../../../shared/components/ServerError.js";
3
+ import { PageHeader as ee } from "../../../shared/components/PageHeader.js";
4
+ import { StatCard as n } from "../../../shared/components/StatCard.js";
5
+ import { EmptyState as r } from "../../../shared/components/EmptyState.js";
6
+ import { ServerError as i } from "../../../shared/components/ServerError.js";
7
7
  import "../../../shared/components/index.js";
8
- import { formatCurrency as o, formatDateTime as s } from "../../../shared/utils/format.js";
9
- import { isServerError as c } from "../../../shared/utils/error.js";
8
+ import { formatCurrency as a, formatDateTime as o } from "../../../shared/utils/format.js";
9
+ import { isServerError as s } from "../../../shared/utils/error.js";
10
10
  import "../../../shared/utils/index.js";
11
- import { useBillingPermissions as l } from "../../../hooks/useBillingPermissions.js";
12
- import { useGetDefaultBillingAccountSettingsQuery as u } from "../../../../generated/global-operations.js";
13
- import { fetchDeveloperPortalRevenueDashboard as d, fetchEarningsEntries as f, fetchEarningsSummary as p } from "../api.js";
14
- import { useEffect as m, useMemo as h, useState as g } from "react";
15
- import { Coins as _, HandCoins as v, RefreshCw as y, Wallet as b } from "lucide-react";
16
- import { useSearchParams as x } from "react-router-dom";
17
- import { jsx as S, jsxs as C } from "react/jsx-runtime";
11
+ import { useBillingPermissions as c } from "../../../hooks/useBillingPermissions.js";
12
+ import { useGetDefaultBillingAccountSettingsQuery as l } from "../../../../generated/global-operations.js";
13
+ import { fetchDeveloperPortalRevenueDashboard as u, fetchEarningsEntries as d, fetchEarningsSummary as f } from "../api.js";
14
+ import { useEffect as p, useMemo as m, useState as h } from "react";
15
+ import { Coins as g, HandCoins as _, RefreshCw as v, Wallet as y } from "lucide-react";
16
+ import { useSearchParams as b } from "react-router-dom";
17
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
18
+ import { ResponsiveTable as C } from "@burdenoff/fe-libs/ui";
18
19
  //#region src/billing/modules/earnings/pages/EarningsPage.tsx
19
- var w = () => {
20
- let [w] = x(), T = l(), { apiGatewayUrl: E, authToken: D, orgId: O } = e(), k = w.get("developerOrgId"), A = w.get("developerOrgName"), { data: j, loading: M } = u({}), N = j?.getDefaultBillingAccount?.id, [P, F] = g(null), [I, L] = g([]), [R, z] = g(null), [B, V] = g("ALL"), [H, U] = g(!0), [W, G] = g(null), K = h(() => ({
21
- apiGatewayUrl: E,
22
- authToken: D,
23
- orgId: O
20
+ var w = [
21
+ {
22
+ key: "application",
23
+ header: "Application",
24
+ priority: "primary",
25
+ cell: (e) => e.application?.name || e.application?.slug || "Unknown app"
26
+ },
27
+ {
28
+ key: "pricing",
29
+ header: "Pricing",
30
+ cell: (e) => e.pricingModel
31
+ },
32
+ {
33
+ key: "gross",
34
+ header: "Gross",
35
+ cell: (e) => /* @__PURE__ */ x("span", {
36
+ className: "tabular-nums",
37
+ children: a(e.grossAmount, e.currency || "USD")
38
+ })
39
+ },
40
+ {
41
+ key: "net",
42
+ header: "Net",
43
+ cell: (e) => /* @__PURE__ */ x("span", {
44
+ className: "tabular-nums",
45
+ children: a(e.netAmount, e.currency || "USD")
46
+ })
47
+ },
48
+ {
49
+ key: "status",
50
+ header: "Status",
51
+ cell: (e) => e.status
52
+ },
53
+ {
54
+ key: "purchased",
55
+ header: "Purchased",
56
+ cell: (e) => o(e.purchasedAt)
57
+ }
58
+ ], T = [
59
+ {
60
+ key: "period",
61
+ header: "Period",
62
+ priority: "primary",
63
+ cell: (e) => e.periodLabel || "-"
64
+ },
65
+ {
66
+ key: "amount",
67
+ header: "Amount",
68
+ cell: (e) => /* @__PURE__ */ x("span", {
69
+ className: "tabular-nums",
70
+ children: a(e.netAmount, e.currency || "USD")
71
+ })
72
+ },
73
+ {
74
+ key: "status",
75
+ header: "Status",
76
+ cell: (e) => e.status
77
+ },
78
+ {
79
+ key: "scheduled",
80
+ header: "Scheduled",
81
+ cell: (e) => e.scheduledAt ? o(e.scheduledAt) : "-"
82
+ },
83
+ {
84
+ key: "completed",
85
+ header: "Completed",
86
+ cell: (e) => e.completedAt ? o(e.completedAt) : "-"
87
+ }
88
+ ], E = [
89
+ {
90
+ key: "category",
91
+ header: "Category",
92
+ priority: "primary",
93
+ cell: (e) => e.sourceCategory
94
+ },
95
+ {
96
+ key: "description",
97
+ header: "Description",
98
+ cell: (e) => e.description || e.sourceSubcategory || "-"
99
+ },
100
+ {
101
+ key: "unit",
102
+ header: "Unit",
103
+ cell: (e) => e.unitType
104
+ },
105
+ {
106
+ key: "amount",
107
+ header: "Amount",
108
+ cell: (e) => /* @__PURE__ */ x("span", {
109
+ className: "tabular-nums",
110
+ children: e.unitType === "CREDITS" ? `${e.amount.toLocaleString()} credits` : a(e.amount, e.currency || "USD")
111
+ })
112
+ },
113
+ {
114
+ key: "status",
115
+ header: "Status",
116
+ cell: (e) => e.status
117
+ },
118
+ {
119
+ key: "created",
120
+ header: "Created",
121
+ cell: (e) => o(e.createdAt)
122
+ }
123
+ ], D = () => {
124
+ let [o] = b(), D = c(), { apiGatewayUrl: O, authToken: k, orgId: A } = e(), j = o.get("developerOrgId"), M = o.get("developerOrgName"), { data: N, loading: P } = l({}), F = N?.getDefaultBillingAccount?.id, [I, L] = h(null), [R, z] = h([]), [B, V] = h(null), [H, U] = h("ALL"), [W, G] = h(!0), [K, q] = h(null), J = m(() => ({
125
+ apiGatewayUrl: O,
126
+ authToken: k,
127
+ orgId: A
24
128
  }), [
25
- E,
26
- D,
27
- O
28
- ]), q = async () => {
29
- U(!0), G(null);
129
+ O,
130
+ k,
131
+ A
132
+ ]), Y = async () => {
133
+ G(!0), q(null);
30
134
  try {
31
- if (k) {
32
- z(await d(k, K)), F(null), L([]);
135
+ if (j) {
136
+ V(await u(j, J)), L(null), z([]);
33
137
  return;
34
138
  }
35
- if (!N) {
36
- F(null), L([]), z(null);
139
+ if (!F) {
140
+ L(null), z([]), V(null);
37
141
  return;
38
142
  }
39
- let [e, t] = await Promise.all([p(N, K), f(N, K)]);
40
- F(e), L(t), z(null);
143
+ let [e, t] = await Promise.all([f(F, J), d(F, J)]);
144
+ L(e), z(t), V(null);
41
145
  } catch (e) {
42
- G(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load earnings"));
146
+ q(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load earnings"));
43
147
  } finally {
44
- U(!1);
148
+ G(!1);
45
149
  }
46
150
  };
47
- if (m(() => {
48
- q();
151
+ if (p(() => {
152
+ Y();
49
153
  }, [
50
- N,
51
- k,
52
- K
53
- ]), !T.canViewBillingAccount) return /* @__PURE__ */ S(t, { message: "You don't have permission to view earnings." });
54
- if (!k && !N && !M) return /* @__PURE__ */ S(i, {
55
- icon: /* @__PURE__ */ S(b, { className: "size-8" }),
154
+ F,
155
+ j,
156
+ J
157
+ ]), !D.canViewBillingAccount) return /* @__PURE__ */ x(t, { message: "You don't have permission to view earnings." });
158
+ if (!j && !F && !P) return /* @__PURE__ */ x(r, {
159
+ icon: /* @__PURE__ */ x(y, { className: "size-8" }),
56
160
  title: "No billing account found",
57
161
  description: "Create a billing account first to view earnings."
58
162
  });
59
- if (W && c(W)) return /* @__PURE__ */ S(a, {
163
+ if (K && s(K)) return /* @__PURE__ */ x(i, {
60
164
  title: "Earnings unavailable",
61
- message: W.message,
62
- onRetry: () => void q(),
165
+ message: K.message,
166
+ onRetry: () => void Y(),
63
167
  showRetry: !0
64
168
  });
65
- let J = P ? [
169
+ let X = I ? [
66
170
  {
67
171
  title: "Available",
68
- value: o(P.availableAmount, "USD"),
69
- icon: /* @__PURE__ */ S(v, { className: "size-5" })
172
+ value: a(I.availableAmount, "USD"),
173
+ icon: /* @__PURE__ */ x(_, { className: "size-5" })
70
174
  },
71
175
  {
72
176
  title: "Reserved",
73
- value: o(P.reservedAmount, "USD"),
74
- icon: /* @__PURE__ */ S(_, { className: "size-5" })
177
+ value: a(I.reservedAmount, "USD"),
178
+ icon: /* @__PURE__ */ x(g, { className: "size-5" })
75
179
  },
76
180
  {
77
181
  title: "Paid out",
78
- value: o(P.paidAmount, "USD"),
79
- icon: /* @__PURE__ */ S(b, { className: "size-5" })
182
+ value: a(I.paidAmount, "USD"),
183
+ icon: /* @__PURE__ */ x(y, { className: "size-5" })
80
184
  },
81
185
  {
82
186
  title: "Lifetime",
83
- value: o(P.totalLifetimeAmount, "USD"),
84
- icon: /* @__PURE__ */ S(y, { className: "size-5" })
187
+ value: a(I.totalLifetimeAmount, "USD"),
188
+ icon: /* @__PURE__ */ x(v, { className: "size-5" })
85
189
  }
86
- ] : [], Y = B === "ALL" ? I : I.filter((e) => e.sourceCategory === B), X = P?.categoryBreakdown?.map((e) => ({
190
+ ] : [], Z = H === "ALL" ? R : R.filter((e) => e.sourceCategory === H), Q = I?.categoryBreakdown?.map((e) => ({
87
191
  title: `${e.category} earnings`,
88
- value: o(e.amount, "USD"),
192
+ value: a(e.amount, "USD"),
89
193
  helperText: `${e.count} entries`
90
- })) ?? [], Z = R?.summary ? [
194
+ })) ?? [], te = B?.summary ? [
91
195
  {
92
196
  title: "Gross revenue",
93
- value: o(R.summary.totalGrossRevenue, "USD"),
94
- icon: /* @__PURE__ */ S(v, { className: "size-5" })
197
+ value: a(B.summary.totalGrossRevenue, "USD"),
198
+ icon: /* @__PURE__ */ x(_, { className: "size-5" })
95
199
  },
96
200
  {
97
201
  title: "Net revenue",
98
- value: o(R.summary.totalNetRevenue, "USD"),
99
- icon: /* @__PURE__ */ S(b, { className: "size-5" })
202
+ value: a(B.summary.totalNetRevenue, "USD"),
203
+ icon: /* @__PURE__ */ x(y, { className: "size-5" })
100
204
  },
101
205
  {
102
206
  title: "Pending balance",
103
- value: o(R.summary.pendingBalance, "USD"),
104
- icon: /* @__PURE__ */ S(_, { className: "size-5" })
207
+ value: a(B.summary.pendingBalance, "USD"),
208
+ icon: /* @__PURE__ */ x(g, { className: "size-5" })
105
209
  },
106
210
  {
107
211
  title: "Platform fees",
108
- value: o(R.summary.totalPlatformFees, "USD"),
109
- icon: /* @__PURE__ */ S(y, { className: "size-5" })
212
+ value: a(B.summary.totalPlatformFees, "USD"),
213
+ icon: /* @__PURE__ */ x(v, { className: "size-5" })
110
214
  }
111
- ] : [], Q = !!k;
112
- return /* @__PURE__ */ C("div", {
215
+ ] : [], $ = !!j;
216
+ return /* @__PURE__ */ S("div", {
113
217
  className: "space-y-6 p-6",
114
218
  children: [
115
- /* @__PURE__ */ S(n, {
116
- title: Q ? "Marketplace earnings" : "Earnings",
117
- description: Q ? `Developer portal revenue, sales, and payouts${A ? ` for ${A}` : ""}.` : "Track affiliate, store, and other earning sources in one ledger."
219
+ /* @__PURE__ */ x(ee, {
220
+ title: $ ? "Marketplace earnings" : "Earnings",
221
+ description: $ ? `Developer portal revenue, sales, and payouts${M ? ` for ${M}` : ""}.` : "Track affiliate, store, and other earning sources in one ledger."
118
222
  }),
119
- H ? /* @__PURE__ */ S("div", {
223
+ W ? /* @__PURE__ */ x("div", {
120
224
  className: "grid gap-4 md:grid-cols-2 xl:grid-cols-4",
121
225
  children: [
122
226
  1,
123
227
  2,
124
228
  3,
125
229
  4
126
- ].map((e) => /* @__PURE__ */ S("div", { className: "h-28 animate-pulse rounded-lg border border-border bg-card" }, e))
127
- }) : Q ? R?.summary ? /* @__PURE__ */ C("div", {
230
+ ].map((e) => /* @__PURE__ */ x("div", { className: "h-28 animate-pulse rounded-lg border border-border-subtle bg-bg-surface" }, e))
231
+ }) : $ ? B?.summary ? /* @__PURE__ */ S("div", {
128
232
  className: "space-y-6",
129
233
  children: [
130
- /* @__PURE__ */ S("div", {
234
+ /* @__PURE__ */ x("div", {
131
235
  className: "grid gap-4 md:grid-cols-2 xl:grid-cols-4",
132
- children: Z.map((e) => /* @__PURE__ */ S(r, {
236
+ children: te.map((e) => /* @__PURE__ */ x(n, {
133
237
  label: e.title,
134
238
  value: e.value,
135
239
  icon: e.icon
136
240
  }, e.title))
137
241
  }),
138
- /* @__PURE__ */ C("section", {
139
- className: "rounded-lg border border-border bg-card p-4",
140
- children: [/* @__PURE__ */ C("div", {
242
+ /* @__PURE__ */ S("section", {
243
+ className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
244
+ children: [/* @__PURE__ */ S("div", {
141
245
  className: "mb-4 flex items-center justify-between",
142
- children: [/* @__PURE__ */ S("h2", {
143
- className: "text-lg font-semibold text-foreground",
246
+ children: [/* @__PURE__ */ x("h2", {
247
+ className: "text-lg font-semibold text-text-primary",
144
248
  children: "Recent sales"
145
- }), /* @__PURE__ */ C("button", {
249
+ }), /* @__PURE__ */ S("button", {
146
250
  type: "button",
147
- onClick: () => void q(),
148
- className: "inline-flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm font-medium text-foreground",
149
- children: [/* @__PURE__ */ S(y, { className: "size-4" }), "Refresh"]
251
+ onClick: () => void Y(),
252
+ className: "inline-flex items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary",
253
+ children: [/* @__PURE__ */ x(v, { className: "size-4" }), "Refresh"]
150
254
  })]
151
- }), R.sales.length === 0 ? /* @__PURE__ */ S(i, {
152
- icon: /* @__PURE__ */ S(_, { className: "size-8" }),
255
+ }), B.sales.length === 0 ? /* @__PURE__ */ x(r, {
256
+ icon: /* @__PURE__ */ x(g, { className: "size-8" }),
153
257
  title: "No sales yet",
154
258
  description: "Sales will appear here when customers start purchasing your apps."
155
- }) : /* @__PURE__ */ S("div", {
156
- className: "overflow-x-auto",
157
- children: /* @__PURE__ */ C("table", {
158
- className: "min-w-full text-sm",
159
- children: [/* @__PURE__ */ S("thead", { children: /* @__PURE__ */ C("tr", {
160
- className: "border-b border-border text-left text-muted-foreground",
161
- children: [
162
- /* @__PURE__ */ S("th", {
163
- className: "px-3 py-2",
164
- children: "Application"
165
- }),
166
- /* @__PURE__ */ S("th", {
167
- className: "px-3 py-2",
168
- children: "Pricing"
169
- }),
170
- /* @__PURE__ */ S("th", {
171
- className: "px-3 py-2",
172
- children: "Gross"
173
- }),
174
- /* @__PURE__ */ S("th", {
175
- className: "px-3 py-2",
176
- children: "Net"
177
- }),
178
- /* @__PURE__ */ S("th", {
179
- className: "px-3 py-2",
180
- children: "Status"
181
- }),
182
- /* @__PURE__ */ S("th", {
183
- className: "px-3 py-2",
184
- children: "Purchased"
185
- })
186
- ]
187
- }) }), /* @__PURE__ */ S("tbody", { children: R.sales.map((e) => /* @__PURE__ */ C("tr", {
188
- className: "border-b border-border/70 text-foreground",
189
- children: [
190
- /* @__PURE__ */ S("td", {
191
- className: "px-3 py-2 font-medium",
192
- children: e.application?.name || e.application?.slug || "Unknown app"
193
- }),
194
- /* @__PURE__ */ S("td", {
195
- className: "px-3 py-2",
196
- children: e.pricingModel
197
- }),
198
- /* @__PURE__ */ S("td", {
199
- className: "px-3 py-2",
200
- children: o(e.grossAmount, e.currency || "USD")
201
- }),
202
- /* @__PURE__ */ S("td", {
203
- className: "px-3 py-2",
204
- children: o(e.netAmount, e.currency || "USD")
205
- }),
206
- /* @__PURE__ */ S("td", {
207
- className: "px-3 py-2",
208
- children: e.status
209
- }),
210
- /* @__PURE__ */ S("td", {
211
- className: "px-3 py-2",
212
- children: s(e.purchasedAt)
213
- })
214
- ]
215
- }, e.id)) })]
216
- })
259
+ }) : /* @__PURE__ */ x(C, {
260
+ data: B.sales,
261
+ rowKey: (e) => e.id,
262
+ columns: w
217
263
  })]
218
264
  }),
219
- /* @__PURE__ */ C("section", {
220
- className: "rounded-lg border border-border bg-card p-4",
221
- children: [/* @__PURE__ */ S("h2", {
222
- className: "mb-4 text-lg font-semibold text-foreground",
265
+ /* @__PURE__ */ S("section", {
266
+ className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
267
+ children: [/* @__PURE__ */ x("h2", {
268
+ className: "mb-4 text-lg font-semibold text-text-primary",
223
269
  children: "Payouts"
224
- }), R.payouts.length === 0 ? /* @__PURE__ */ S(i, {
225
- icon: /* @__PURE__ */ S(b, { className: "size-8" }),
270
+ }), B.payouts.length === 0 ? /* @__PURE__ */ x(r, {
271
+ icon: /* @__PURE__ */ x(y, { className: "size-8" }),
226
272
  title: "No payouts yet",
227
273
  description: "Scheduled and completed payouts will appear here."
228
- }) : /* @__PURE__ */ S("div", {
229
- className: "overflow-x-auto",
230
- children: /* @__PURE__ */ C("table", {
231
- className: "min-w-full text-sm",
232
- children: [/* @__PURE__ */ S("thead", { children: /* @__PURE__ */ C("tr", {
233
- className: "border-b border-border text-left text-muted-foreground",
234
- children: [
235
- /* @__PURE__ */ S("th", {
236
- className: "px-3 py-2",
237
- children: "Period"
238
- }),
239
- /* @__PURE__ */ S("th", {
240
- className: "px-3 py-2",
241
- children: "Amount"
242
- }),
243
- /* @__PURE__ */ S("th", {
244
- className: "px-3 py-2",
245
- children: "Status"
246
- }),
247
- /* @__PURE__ */ S("th", {
248
- className: "px-3 py-2",
249
- children: "Scheduled"
250
- }),
251
- /* @__PURE__ */ S("th", {
252
- className: "px-3 py-2",
253
- children: "Completed"
254
- })
255
- ]
256
- }) }), /* @__PURE__ */ S("tbody", { children: R.payouts.map((e) => /* @__PURE__ */ C("tr", {
257
- className: "border-b border-border/70 text-foreground",
258
- children: [
259
- /* @__PURE__ */ S("td", {
260
- className: "px-3 py-2 font-medium",
261
- children: e.periodLabel || "-"
262
- }),
263
- /* @__PURE__ */ S("td", {
264
- className: "px-3 py-2",
265
- children: o(e.netAmount, e.currency || "USD")
266
- }),
267
- /* @__PURE__ */ S("td", {
268
- className: "px-3 py-2",
269
- children: e.status
270
- }),
271
- /* @__PURE__ */ S("td", {
272
- className: "px-3 py-2",
273
- children: e.scheduledAt ? s(e.scheduledAt) : "-"
274
- }),
275
- /* @__PURE__ */ S("td", {
276
- className: "px-3 py-2",
277
- children: e.completedAt ? s(e.completedAt) : "-"
278
- })
279
- ]
280
- }, e.id)) })]
281
- })
274
+ }) : /* @__PURE__ */ x(C, {
275
+ data: B.payouts,
276
+ rowKey: (e) => e.id,
277
+ columns: T
282
278
  })]
283
279
  })
284
280
  ]
285
- }) : /* @__PURE__ */ S(i, {
286
- icon: /* @__PURE__ */ S(_, { className: "size-8" }),
281
+ }) : /* @__PURE__ */ x(r, {
282
+ icon: /* @__PURE__ */ x(g, { className: "size-8" }),
287
283
  title: "No developer portal revenue yet",
288
284
  description: "Marketplace revenue will appear here once your developer organization records sales."
289
- }) : P ? /* @__PURE__ */ C("div", {
285
+ }) : I ? /* @__PURE__ */ S("div", {
290
286
  className: "space-y-4",
291
- children: [/* @__PURE__ */ S("div", {
287
+ children: [/* @__PURE__ */ x("div", {
292
288
  className: "grid gap-4 md:grid-cols-2 xl:grid-cols-4",
293
- children: J.map((e) => /* @__PURE__ */ S(r, {
289
+ children: X.map((e) => /* @__PURE__ */ x(n, {
294
290
  label: e.title,
295
291
  value: e.value,
296
292
  icon: e.icon
297
293
  }, e.title))
298
- }), X.length > 0 ? /* @__PURE__ */ S("div", {
294
+ }), Q.length > 0 ? /* @__PURE__ */ x("div", {
299
295
  className: "grid gap-4 md:grid-cols-2 xl:grid-cols-3",
300
- children: X.map((e) => /* @__PURE__ */ C("div", {
301
- className: "rounded-lg border border-border bg-card p-4",
296
+ children: Q.map((e) => /* @__PURE__ */ S("div", {
297
+ className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
302
298
  children: [
303
- /* @__PURE__ */ S("p", {
304
- className: "text-sm text-muted-foreground",
299
+ /* @__PURE__ */ x("p", {
300
+ className: "text-sm text-text-secondary",
305
301
  children: e.title
306
302
  }),
307
- /* @__PURE__ */ S("p", {
308
- className: "mt-2 text-xl font-semibold text-foreground",
303
+ /* @__PURE__ */ x("p", {
304
+ className: "mt-2 text-xl font-semibold text-text-primary",
309
305
  children: e.value
310
306
  }),
311
- /* @__PURE__ */ S("p", {
312
- className: "mt-1 text-xs text-muted-foreground",
307
+ /* @__PURE__ */ x("p", {
308
+ className: "mt-1 text-xs text-text-secondary",
313
309
  children: e.helperText
314
310
  })
315
311
  ]
316
312
  }, e.title))
317
313
  }) : null]
318
314
  }) : null,
319
- W && !c(W) ? /* @__PURE__ */ S("div", {
320
- className: "rounded-lg border border-border bg-card p-4 text-sm text-destructive",
321
- children: W.message
315
+ K && !s(K) ? /* @__PURE__ */ x("div", {
316
+ className: "rounded-lg border border-border-subtle bg-bg-surface p-4 text-sm text-status-error-text",
317
+ children: K.message
322
318
  }) : null,
323
- /* @__PURE__ */ C("section", {
324
- className: "rounded-lg border border-border bg-card p-4",
325
- children: [/* @__PURE__ */ C("div", {
319
+ /* @__PURE__ */ S("section", {
320
+ className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
321
+ children: [/* @__PURE__ */ S("div", {
326
322
  className: "mb-4 flex items-center justify-between",
327
- children: [/* @__PURE__ */ S("h2", {
328
- className: "text-lg font-semibold text-foreground",
323
+ children: [/* @__PURE__ */ x("h2", {
324
+ className: "text-lg font-semibold text-text-primary",
329
325
  children: "Ledger"
330
- }), /* @__PURE__ */ C("div", {
326
+ }), /* @__PURE__ */ S("div", {
331
327
  className: "flex items-center gap-3",
332
- children: [/* @__PURE__ */ C("select", {
333
- value: B,
334
- onChange: (e) => V(e.target.value),
335
- className: "rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground",
328
+ children: [/* @__PURE__ */ S("select", {
329
+ value: H,
330
+ onChange: (e) => U(e.target.value),
331
+ className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
336
332
  children: [
337
- /* @__PURE__ */ S("option", {
333
+ /* @__PURE__ */ x("option", {
338
334
  value: "ALL",
339
335
  children: "All sources"
340
336
  }),
341
- /* @__PURE__ */ S("option", {
337
+ /* @__PURE__ */ x("option", {
342
338
  value: "AFFILIATE",
343
339
  children: "Affiliate"
344
340
  }),
345
- /* @__PURE__ */ S("option", {
341
+ /* @__PURE__ */ x("option", {
346
342
  value: "STORE",
347
343
  children: "Store"
348
344
  }),
349
- /* @__PURE__ */ S("option", {
345
+ /* @__PURE__ */ x("option", {
350
346
  value: "OTHER",
351
347
  children: "Other"
352
348
  })
353
349
  ]
354
- }), /* @__PURE__ */ C("button", {
350
+ }), /* @__PURE__ */ S("button", {
355
351
  type: "button",
356
- onClick: () => void q(),
357
- className: "inline-flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm font-medium text-foreground",
358
- children: [/* @__PURE__ */ S(y, { className: "size-4" }), "Refresh"]
352
+ onClick: () => void Y(),
353
+ className: "inline-flex items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary",
354
+ children: [/* @__PURE__ */ x(v, { className: "size-4" }), "Refresh"]
359
355
  })]
360
356
  })]
361
- }), Y.length === 0 && !H ? /* @__PURE__ */ S(i, {
362
- icon: /* @__PURE__ */ S(_, { className: "size-8" }),
357
+ }), Z.length === 0 && !W ? /* @__PURE__ */ x(r, {
358
+ icon: /* @__PURE__ */ x(g, { className: "size-8" }),
363
359
  title: "No earnings yet",
364
360
  description: "Eligible affiliate rewards and other earnings will appear here."
365
- }) : /* @__PURE__ */ S("div", {
366
- className: "overflow-x-auto",
367
- children: /* @__PURE__ */ C("table", {
368
- className: "min-w-full text-sm",
369
- children: [/* @__PURE__ */ S("thead", { children: /* @__PURE__ */ C("tr", {
370
- className: "border-b border-border text-left text-muted-foreground",
371
- children: [
372
- /* @__PURE__ */ S("th", {
373
- className: "px-3 py-2",
374
- children: "Category"
375
- }),
376
- /* @__PURE__ */ S("th", {
377
- className: "px-3 py-2",
378
- children: "Description"
379
- }),
380
- /* @__PURE__ */ S("th", {
381
- className: "px-3 py-2",
382
- children: "Unit"
383
- }),
384
- /* @__PURE__ */ S("th", {
385
- className: "px-3 py-2",
386
- children: "Amount"
387
- }),
388
- /* @__PURE__ */ S("th", {
389
- className: "px-3 py-2",
390
- children: "Status"
391
- }),
392
- /* @__PURE__ */ S("th", {
393
- className: "px-3 py-2",
394
- children: "Created"
395
- })
396
- ]
397
- }) }), /* @__PURE__ */ S("tbody", { children: Y.map((e) => /* @__PURE__ */ C("tr", {
398
- className: "border-b border-border/70 text-foreground",
399
- children: [
400
- /* @__PURE__ */ S("td", {
401
- className: "px-3 py-2 font-medium",
402
- children: e.sourceCategory
403
- }),
404
- /* @__PURE__ */ S("td", {
405
- className: "px-3 py-2",
406
- children: e.description || e.sourceSubcategory || "-"
407
- }),
408
- /* @__PURE__ */ S("td", {
409
- className: "px-3 py-2",
410
- children: e.unitType
411
- }),
412
- /* @__PURE__ */ S("td", {
413
- className: "px-3 py-2",
414
- children: e.unitType === "CREDITS" ? `${e.amount.toLocaleString()} credits` : o(e.amount, e.currency || "USD")
415
- }),
416
- /* @__PURE__ */ S("td", {
417
- className: "px-3 py-2",
418
- children: e.status
419
- }),
420
- /* @__PURE__ */ S("td", {
421
- className: "px-3 py-2",
422
- children: s(e.createdAt)
423
- })
424
- ]
425
- }, e.id)) })]
426
- })
361
+ }) : /* @__PURE__ */ x(C, {
362
+ data: Z,
363
+ rowKey: (e) => e.id,
364
+ columns: E
427
365
  })]
428
366
  })
429
367
  ]
430
368
  });
431
369
  };
432
370
  //#endregion
433
- export { w as EarningsPage };
371
+ export { D as EarningsPage };
434
372
 
435
373
  //# sourceMappingURL=EarningsPage.js.map