@burdenoff/microfe-devportal 2026.914.6 → 2026.915.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/devportal/components/ReportOrderIssueModal.d.ts +20 -0
- package/dist/devportal/components/ReportOrderIssueModal.d.ts.map +1 -0
- package/dist/devportal/components/ReportOrderIssueModal.js +157 -0
- package/dist/devportal/components/ReportOrderIssueModal.js.map +1 -0
- package/dist/devportal/components/index.d.ts +1 -0
- package/dist/devportal/components/index.d.ts.map +1 -1
- package/dist/devportal/components/index.js +1 -0
- package/dist/devportal/hooks/usePackageUpload.d.ts.map +1 -1
- package/dist/devportal/hooks/usePackageUpload.js.map +1 -1
- package/dist/devportal/pages/CreateOrganizationPage.d.ts.map +1 -1
- package/dist/devportal/pages/CreateOrganizationPage.js +11 -2
- package/dist/devportal/pages/CreateOrganizationPage.js.map +1 -1
- package/dist/devportal/pages/EditApplicationPage.d.ts.map +1 -1
- package/dist/devportal/pages/EditApplicationPage.js +4 -0
- package/dist/devportal/pages/EditApplicationPage.js.map +1 -1
- package/dist/devportal/pages/OrganizationDetailPage.d.ts.map +1 -1
- package/dist/devportal/pages/OrganizationDetailPage.js +145 -109
- package/dist/devportal/pages/OrganizationDetailPage.js.map +1 -1
- package/dist/devportal/pages/PublishPage.d.ts.map +1 -1
- package/dist/devportal/pages/PublishPage.js.map +1 -1
- package/dist/devportal/pages/RevenueDashboardPage.d.ts.map +1 -1
- package/dist/devportal/pages/RevenueDashboardPage.js +478 -258
- package/dist/devportal/pages/RevenueDashboardPage.js.map +1 -1
- package/dist/devportal/pages/SellerItemsPage.d.ts.map +1 -1
- package/dist/devportal/pages/SellerItemsPage.js.map +1 -1
- package/dist/devportal/pages/SellerOrdersPage.d.ts.map +1 -1
- package/dist/devportal/pages/SellerOrdersPage.js +186 -93
- package/dist/devportal/pages/SellerOrdersPage.js.map +1 -1
- package/dist/devportal/types/index.d.ts +1 -0
- package/dist/devportal/types/index.d.ts.map +1 -1
- package/dist/devportal/types/index.js.map +1 -1
- package/dist/generated/global-operations.d.ts +16 -0
- package/dist/generated/global-operations.d.ts.map +1 -1
- package/dist/generated/global-operations.js +74 -46
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +15 -0
- package/dist/generated/global-types.d.ts.map +1 -1
- package/dist/generated/global-types.js +8 -0
- package/dist/generated/global-types.js.map +1 -0
- package/package.json +1 -1
|
@@ -3,76 +3,122 @@ import { useTr as t } from "../utils/i18n.js";
|
|
|
3
3
|
import { cn as n } from "../utils/cn.js";
|
|
4
4
|
import { EmptyState as r } from "../components/EmptyState.js";
|
|
5
5
|
import { useIsSellerSection as ee } from "../hooks/useIsSellerSection.js";
|
|
6
|
-
import {
|
|
7
|
-
import { getErrorMessage as
|
|
8
|
-
import { PageLayout as
|
|
9
|
-
import { StatusBadge as
|
|
10
|
-
import { StatCard as
|
|
11
|
-
import { DataTable as
|
|
6
|
+
import { useAddPaymentMethodMutation as te, useGetBillingAccountsByOrgQuery as ne, useGetMyOrganizationsQuery as re, useGetPaymentMethodsQuery as ie, useGetRevenueDashboardDataQuery as ae, useLinkDevOrgBillingAccountMutation as oe, useRequestPayoutMutation as se } from "../../generated/global-operations.js";
|
|
7
|
+
import { getErrorMessage as ce } from "../hooks/useGraphQL.js";
|
|
8
|
+
import { PageLayout as i, PageSection as a } from "../components/PageLayout.js";
|
|
9
|
+
import { StatusBadge as o } from "../components/StatusBadge.js";
|
|
10
|
+
import { StatCard as s, StatCardGrid as le } from "../components/StatCard.js";
|
|
11
|
+
import { DataTable as c } from "../components/DataTable.js";
|
|
12
12
|
import "../hooks/index.js";
|
|
13
|
-
import { Tooltip as
|
|
14
|
-
import { ResponsiveContainer as
|
|
15
|
-
import { Bar as
|
|
16
|
-
import { CartesianGrid as
|
|
17
|
-
import { Line as
|
|
18
|
-
import { XAxis as
|
|
19
|
-
import { YAxis as
|
|
20
|
-
import { LineChart as
|
|
21
|
-
import { BarChart as
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
13
|
+
import { Tooltip as l } from "../../node_modules/recharts/es6/component/Tooltip.js";
|
|
14
|
+
import { ResponsiveContainer as ue } from "../../node_modules/recharts/es6/component/ResponsiveContainer.js";
|
|
15
|
+
import { Bar as de } from "../../node_modules/recharts/es6/cartesian/Bar.js";
|
|
16
|
+
import { CartesianGrid as fe } from "../../node_modules/recharts/es6/cartesian/CartesianGrid.js";
|
|
17
|
+
import { Line as pe } from "../../node_modules/recharts/es6/cartesian/Line.js";
|
|
18
|
+
import { XAxis as me } from "../../node_modules/recharts/es6/cartesian/XAxis.js";
|
|
19
|
+
import { YAxis as he } from "../../node_modules/recharts/es6/cartesian/YAxis.js";
|
|
20
|
+
import { LineChart as ge } from "../../node_modules/recharts/es6/chart/LineChart.js";
|
|
21
|
+
import { BarChart as _e } from "../../node_modules/recharts/es6/chart/BarChart.js";
|
|
22
|
+
import { DevPortalPaymentMethodType as u } from "../../generated/global-types.js";
|
|
23
|
+
import { useMemo as d, useState as f } from "react";
|
|
24
|
+
import { AlertCircle as ve, ArrowDownToLine as ye, Banknote as be, Building2 as xe, Check as p, CreditCard as m, DollarSign as h, Link2 as g, Loader2 as _, Send as Se, Wallet as Ce } from "lucide-react";
|
|
25
|
+
import { useSearchParams as we } from "react-router";
|
|
26
|
+
import { Fragment as Te, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
27
|
+
import { EmphasisPanel as Ee, GlassCard as b } from "@burdenoff/fe-libs/ui";
|
|
27
28
|
//#region src/devportal/pages/RevenueDashboardPage.tsx
|
|
28
|
-
var
|
|
29
|
+
var x = 100, S = {
|
|
29
30
|
primary: "var(--color-chart-1)",
|
|
30
31
|
secondary: "var(--color-chart-2)",
|
|
31
32
|
tertiary: "var(--color-chart-4)"
|
|
32
|
-
},
|
|
33
|
+
}, De = {
|
|
33
34
|
"30d": 30,
|
|
34
35
|
"90d": 90,
|
|
35
36
|
"12m": 365
|
|
36
|
-
},
|
|
37
|
-
let
|
|
37
|
+
}, C = () => {
|
|
38
|
+
let C = t(), { activeOrgId: Oe, activePhysicalOrgId: ke, tenantId: Ae } = e(), w = ee() ? ke : Oe, [T, je] = f("90d"), [E, D] = f(!1), [O, k] = f(null), [Me] = oe(), [A, j] = f(!1), [M, N] = f(null), [Ne] = we(), P = d(() => /* @__PURE__ */ new Date(), []), [Pe, F] = f(!1), [Fe, I] = f(null), [L, R] = f(null), [Ie, z] = f(!1), [B, Le] = f(u.BankAccount), [Re, ze] = f(""), [V, Be] = f(""), [Ve, He] = f(""), [H, Ue] = f(""), [We, U] = f(null), { data: Ge, loading: Ke } = ie({
|
|
39
|
+
variables: { organizationId: w ?? "" },
|
|
40
|
+
skip: !w,
|
|
41
|
+
fetchPolicy: "cache-and-network"
|
|
42
|
+
}), [qe, { loading: Je }] = te(), [Ye, { loading: Xe }] = se(), { data: Ze, loading: W } = ne({
|
|
38
43
|
fetchPolicy: "cache-and-network",
|
|
39
|
-
context: { headers: { "x-org-id":
|
|
40
|
-
}),
|
|
41
|
-
let e = new Date(
|
|
42
|
-
return e.setDate(e.getDate() -
|
|
43
|
-
}, [
|
|
44
|
+
context: { headers: { "x-org-id": Ae ?? "" } }
|
|
45
|
+
}), Qe = d(() => {
|
|
46
|
+
let e = new Date(P);
|
|
47
|
+
return e.setDate(e.getDate() - De[T]), e.toISOString();
|
|
48
|
+
}, [P, T]), { data: G, loading: $e, error: et } = re({ fetchPolicy: "cache-and-network" }), { data: K, loading: tt, error: nt } = ae({
|
|
44
49
|
variables: {
|
|
45
|
-
organizationId:
|
|
50
|
+
organizationId: w ?? "",
|
|
46
51
|
period: "monthly",
|
|
47
|
-
startDate:
|
|
48
|
-
endDate:
|
|
52
|
+
startDate: Qe,
|
|
53
|
+
endDate: P.toISOString(),
|
|
49
54
|
salesLimit: 10,
|
|
50
55
|
salesOffset: 0,
|
|
51
56
|
payoutsLimit: 10,
|
|
52
57
|
payoutsOffset: 0
|
|
53
58
|
},
|
|
54
|
-
skip: !
|
|
59
|
+
skip: !w,
|
|
55
60
|
fetchPolicy: "cache-and-network"
|
|
56
|
-
}), q =
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
if (!(!
|
|
60
|
-
|
|
61
|
+
}), q = d(() => G?.myDeveloperOrganizations?.map((e) => e) ?? [], [G?.myDeveloperOrganizations]).find((e) => e.id === w), J = Ze?.getBillingAccountsByOrg ?? [], Y = J.find((e) => e.id === q?.billingAccountId) ?? null, rt = () => {
|
|
62
|
+
N(q?.billingAccountId ?? J.find((e) => e.isDefault)?.id ?? J[0]?.id ?? null), j(!0);
|
|
63
|
+
}, it = async () => {
|
|
64
|
+
if (!(!w || !M)) {
|
|
65
|
+
D(!0), k(null);
|
|
61
66
|
try {
|
|
62
|
-
await
|
|
67
|
+
await Me({
|
|
63
68
|
variables: {
|
|
64
|
-
organizationId:
|
|
65
|
-
billingAccountId:
|
|
69
|
+
organizationId: w,
|
|
70
|
+
billingAccountId: M
|
|
66
71
|
},
|
|
67
72
|
refetchQueries: ["GetMyOrganizations"]
|
|
68
|
-
}),
|
|
73
|
+
}), j(!1);
|
|
69
74
|
} catch (e) {
|
|
70
|
-
|
|
75
|
+
k(e instanceof Error ? e.message : "Failed to link billing account");
|
|
71
76
|
} finally {
|
|
72
|
-
|
|
77
|
+
D(!1);
|
|
73
78
|
}
|
|
74
79
|
}
|
|
75
|
-
},
|
|
80
|
+
}, X = (Ge?.developerOrgPaymentMethods ?? []).filter((e) => e.isActive), at = () => {
|
|
81
|
+
R((X.find((e) => e.isDefault) ?? X[0])?.id ?? null), z(X.length === 0), U(null), I(null), F(!0);
|
|
82
|
+
}, ot = async () => {
|
|
83
|
+
if (!w) return;
|
|
84
|
+
U(null);
|
|
85
|
+
let e = B === u.Paypal, t = e ? { email: H } : {
|
|
86
|
+
accountNumber: V,
|
|
87
|
+
routingNumber: Ve
|
|
88
|
+
};
|
|
89
|
+
try {
|
|
90
|
+
let n = (await qe({
|
|
91
|
+
variables: {
|
|
92
|
+
organizationId: w,
|
|
93
|
+
input: {
|
|
94
|
+
type: B,
|
|
95
|
+
name: Re || (e ? "PayPal" : "Bank Account"),
|
|
96
|
+
accountDetails: t,
|
|
97
|
+
isDefault: X.length === 0
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
refetchQueries: ["GetPaymentMethods"]
|
|
101
|
+
})).data?.addDeveloperOrgPaymentMethod;
|
|
102
|
+
n && R(n.id), z(!1), ze(""), Be(""), He(""), Ue("");
|
|
103
|
+
} catch (e) {
|
|
104
|
+
U(e instanceof Error ? e.message : "Failed to add payout method");
|
|
105
|
+
}
|
|
106
|
+
}, st = async () => {
|
|
107
|
+
if (!(!w || !L)) {
|
|
108
|
+
I(null);
|
|
109
|
+
try {
|
|
110
|
+
await Ye({
|
|
111
|
+
variables: {
|
|
112
|
+
organizationId: w,
|
|
113
|
+
paymentMethodId: L
|
|
114
|
+
},
|
|
115
|
+
refetchQueries: ["GetRevenueDashboardData"]
|
|
116
|
+
}), F(!1);
|
|
117
|
+
} catch (e) {
|
|
118
|
+
I(e instanceof Error ? e.message : "Failed to request withdrawal");
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}, Z = K?.developerOrgRevenueSummary, Q = (Z?.pendingBalance ?? 0) >= x, ct = [...K?.developerOrgRevenueAnalytics ?? []].sort((e, t) => new Date(e.date).getTime() - new Date(t.date).getTime()), lt = K?.developerOrgSales?.edges?.map((e) => e.node) ?? [], ut = K?.developerOrgPayouts?.edges?.map((e) => e.node) ?? [], $ = ct.map((e) => ({
|
|
76
122
|
date: new Date(e.date).toLocaleDateString(void 0, {
|
|
77
123
|
month: "short",
|
|
78
124
|
day: "numeric"
|
|
@@ -83,360 +129,534 @@ var O = {
|
|
|
83
129
|
refunds: e.refunds,
|
|
84
130
|
salesCount: e.salesCount
|
|
85
131
|
}));
|
|
86
|
-
return
|
|
87
|
-
title:
|
|
88
|
-
description:
|
|
89
|
-
children: /* @__PURE__ */
|
|
132
|
+
return $e && !G ? /* @__PURE__ */ v(i, {
|
|
133
|
+
title: C("devportal.revenue.title", "Revenue"),
|
|
134
|
+
description: C("devportal.revenue.description", "Track real revenue, sales, and payout activity for your developer organizations"),
|
|
135
|
+
children: /* @__PURE__ */ v("div", {
|
|
90
136
|
className: "flex items-center justify-center py-16 text-text-secondary",
|
|
91
|
-
children: /* @__PURE__ */
|
|
137
|
+
children: /* @__PURE__ */ v(_, { className: "h-8 w-8 animate-spin" })
|
|
92
138
|
})
|
|
93
|
-
}) :
|
|
94
|
-
title:
|
|
95
|
-
description:
|
|
96
|
-
children: /* @__PURE__ */
|
|
97
|
-
icon: /* @__PURE__ */
|
|
139
|
+
}) : et ? /* @__PURE__ */ v(i, {
|
|
140
|
+
title: C("devportal.revenue.title", "Revenue"),
|
|
141
|
+
description: C("devportal.revenue.description", "Track real revenue, sales, and payout activity for your developer organizations"),
|
|
142
|
+
children: /* @__PURE__ */ v(r, {
|
|
143
|
+
icon: /* @__PURE__ */ v(ve, {
|
|
98
144
|
size: 32,
|
|
99
145
|
className: "text-status-error-text"
|
|
100
146
|
}),
|
|
101
|
-
title:
|
|
102
|
-
description:
|
|
147
|
+
title: C("devportal.revenue.errorLoadOrgs", "Unable to load organizations"),
|
|
148
|
+
description: ce(et)
|
|
103
149
|
})
|
|
104
|
-
}) :
|
|
105
|
-
title:
|
|
106
|
-
description:
|
|
107
|
-
children: /* @__PURE__ */
|
|
108
|
-
icon: /* @__PURE__ */
|
|
150
|
+
}) : w ? nt ? /* @__PURE__ */ v(i, {
|
|
151
|
+
title: C("devportal.revenue.title", "Revenue"),
|
|
152
|
+
description: C("devportal.revenue.description", "Track real revenue, sales, and payout activity for your developer organizations"),
|
|
153
|
+
children: /* @__PURE__ */ v(r, {
|
|
154
|
+
icon: /* @__PURE__ */ v(ve, {
|
|
109
155
|
size: 32,
|
|
110
156
|
className: "text-status-error-text"
|
|
111
157
|
}),
|
|
112
|
-
title:
|
|
113
|
-
description:
|
|
158
|
+
title: C("devportal.revenue.errorLoadData", "Unable to load revenue data"),
|
|
159
|
+
description: ce(nt)
|
|
114
160
|
})
|
|
115
|
-
}) : /* @__PURE__ */
|
|
116
|
-
title:
|
|
117
|
-
description: q ? `${
|
|
118
|
-
purpose:
|
|
119
|
-
actions: /* @__PURE__ */
|
|
161
|
+
}) : /* @__PURE__ */ y(i, {
|
|
162
|
+
title: C("devportal.revenue.title", "Revenue"),
|
|
163
|
+
description: q ? `${C("devportal.revenue.financialPerformanceFor", "Financial performance for")} ${q.name}` : C("devportal.revenue.shortDescription", "Track revenue, sales, and payouts"),
|
|
164
|
+
purpose: C("devportal.revenue.purpose", "Revenue tracks the money your paid apps earn — gross sales, platform fees, and what gets paid out to your organization. Link a billing account, then use this to reconcile payouts and watch growth across time ranges."),
|
|
165
|
+
actions: /* @__PURE__ */ v("div", {
|
|
120
166
|
className: "flex flex-wrap gap-2",
|
|
121
|
-
children: /* @__PURE__ */
|
|
122
|
-
value:
|
|
123
|
-
onChange: (e) =>
|
|
124
|
-
"aria-label":
|
|
167
|
+
children: /* @__PURE__ */ y("select", {
|
|
168
|
+
value: T,
|
|
169
|
+
onChange: (e) => je(e.target.value),
|
|
170
|
+
"aria-label": C("devportal.revenue.selectRangeAria", "Select time range"),
|
|
125
171
|
className: "rounded-md border bg-bg-surface px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary",
|
|
126
172
|
children: [
|
|
127
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ v("option", {
|
|
128
174
|
value: "30d",
|
|
129
|
-
children:
|
|
175
|
+
children: C("devportal.revenue.range.30d", "Last 30 days")
|
|
130
176
|
}),
|
|
131
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ v("option", {
|
|
132
178
|
value: "90d",
|
|
133
|
-
children:
|
|
179
|
+
children: C("devportal.revenue.range.90d", "Last 90 days")
|
|
134
180
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ v("option", {
|
|
136
182
|
value: "12m",
|
|
137
|
-
children:
|
|
183
|
+
children: C("devportal.revenue.range.12m", "Last 12 months")
|
|
138
184
|
})
|
|
139
185
|
]
|
|
140
186
|
})
|
|
141
187
|
}),
|
|
142
188
|
children: [
|
|
143
|
-
q && !q.billingAccountId && /* @__PURE__ */
|
|
189
|
+
q && !q.billingAccountId && /* @__PURE__ */ y("div", {
|
|
144
190
|
className: "mb-6 rounded-card border border-border-seam bg-status-info-bg-subtle p-4 flex flex-col gap-3",
|
|
145
191
|
children: [
|
|
146
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ y("div", {
|
|
147
193
|
className: "flex items-start gap-3",
|
|
148
194
|
children: [
|
|
149
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ v(g, {
|
|
150
196
|
size: 20,
|
|
151
197
|
className: "text-accent-blue flex-shrink-0 mt-0.5"
|
|
152
198
|
}),
|
|
153
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ y("div", {
|
|
154
200
|
className: "flex-1 min-w-0",
|
|
155
201
|
children: [
|
|
156
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ v("p", {
|
|
157
203
|
className: "text-sm font-medium text-status-info-text",
|
|
158
|
-
children:
|
|
204
|
+
children: C("devportal.revenue.billingNotLinkedTitle", "Link a billing account to receive store revenue")
|
|
159
205
|
}),
|
|
160
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ v("p", {
|
|
161
207
|
className: "mt-1 text-sm text-status-info-text",
|
|
162
|
-
children:
|
|
208
|
+
children: C("devportal.revenue.billingNotLinkedDesc", "Once linked, net earnings from app sales will appear in your billing credits — you can spend them on platform services or withdraw to your bank.")
|
|
163
209
|
}),
|
|
164
|
-
|
|
210
|
+
O && /* @__PURE__ */ v("p", {
|
|
165
211
|
className: "mt-2 text-sm text-status-error-text",
|
|
166
|
-
children:
|
|
212
|
+
children: O
|
|
167
213
|
})
|
|
168
214
|
]
|
|
169
215
|
}),
|
|
170
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ y("button", {
|
|
171
217
|
type: "button",
|
|
172
|
-
onClick:
|
|
173
|
-
disabled:
|
|
218
|
+
onClick: rt,
|
|
219
|
+
disabled: E || W,
|
|
174
220
|
className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50 flex-shrink-0",
|
|
175
|
-
children: [
|
|
221
|
+
children: [E || W ? /* @__PURE__ */ v(_, {
|
|
176
222
|
size: 14,
|
|
177
223
|
className: "animate-spin"
|
|
178
|
-
}) : /* @__PURE__ */
|
|
224
|
+
}) : /* @__PURE__ */ v(g, { size: 14 }), E ? C("devportal.revenue.linking", "Linking...") : C("devportal.revenue.linkBillingAccount", "Link Billing Account")]
|
|
179
225
|
})
|
|
180
226
|
]
|
|
181
227
|
}),
|
|
182
|
-
|
|
228
|
+
A && J.length === 0 && /* @__PURE__ */ v("div", {
|
|
183
229
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 ml-8 text-sm text-text-secondary",
|
|
184
|
-
children:
|
|
230
|
+
children: C("devportal.revenue.noBillingAccounts", "You don't have any billing accounts yet. Create one from your account billing settings first.")
|
|
185
231
|
}),
|
|
186
|
-
|
|
232
|
+
A && J.length > 0 && /* @__PURE__ */ y("div", {
|
|
187
233
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 ml-8 space-y-3",
|
|
188
234
|
children: [
|
|
189
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ v("p", {
|
|
190
236
|
className: "text-sm font-medium",
|
|
191
|
-
children:
|
|
237
|
+
children: C("devportal.revenue.chooseBillingAccount", "Choose a billing account to link")
|
|
192
238
|
}),
|
|
193
|
-
/* @__PURE__ */
|
|
239
|
+
/* @__PURE__ */ v("div", {
|
|
194
240
|
className: "space-y-2",
|
|
195
|
-
children: J.map((e) => /* @__PURE__ */
|
|
241
|
+
children: J.map((e) => /* @__PURE__ */ y("button", {
|
|
196
242
|
type: "button",
|
|
197
|
-
onClick: () =>
|
|
198
|
-
className: n("flex w-full items-center gap-3 rounded-md border px-3 py-2.5 text-sm text-left transition-colors",
|
|
199
|
-
children: [/* @__PURE__ */
|
|
243
|
+
onClick: () => N(e.id ?? null),
|
|
244
|
+
className: n("flex w-full items-center gap-3 rounded-md border px-3 py-2.5 text-sm text-left transition-colors", M === e.id ? "border-primary bg-action-primary-bg/5 text-text-primary" : "border-border-subtle hover:bg-accent text-text-primary"),
|
|
245
|
+
children: [/* @__PURE__ */ v(p, {
|
|
200
246
|
size: 14,
|
|
201
|
-
className: n("flex-shrink-0",
|
|
202
|
-
}), /* @__PURE__ */
|
|
247
|
+
className: n("flex-shrink-0", M === e.id ? "opacity-100 text-primary" : "opacity-0")
|
|
248
|
+
}), /* @__PURE__ */ y("div", {
|
|
203
249
|
className: "flex-1 min-w-0",
|
|
204
|
-
children: [/* @__PURE__ */
|
|
250
|
+
children: [/* @__PURE__ */ v("p", {
|
|
205
251
|
className: "font-medium truncate",
|
|
206
252
|
children: e.name
|
|
207
|
-
}), e.isDefault && /* @__PURE__ */
|
|
253
|
+
}), e.isDefault && /* @__PURE__ */ v("p", {
|
|
208
254
|
className: "text-xs text-text-secondary",
|
|
209
|
-
children:
|
|
255
|
+
children: C("devportal.revenue.defaultAccount", "Default")
|
|
210
256
|
})]
|
|
211
257
|
})]
|
|
212
258
|
}, e.id))
|
|
213
259
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ y("div", {
|
|
215
261
|
className: "flex items-center justify-end gap-2 pt-1",
|
|
216
|
-
children: [/* @__PURE__ */
|
|
262
|
+
children: [/* @__PURE__ */ v("button", {
|
|
217
263
|
type: "button",
|
|
218
264
|
onClick: () => {
|
|
219
|
-
|
|
265
|
+
j(!1), k(null);
|
|
220
266
|
},
|
|
221
267
|
className: "rounded-md px-3 py-1.5 text-xs font-medium text-text-secondary hover:bg-accent transition-colors",
|
|
222
|
-
children:
|
|
223
|
-
}), /* @__PURE__ */
|
|
268
|
+
children: C("devportal.cancel", "Cancel")
|
|
269
|
+
}), /* @__PURE__ */ y("button", {
|
|
224
270
|
type: "button",
|
|
225
|
-
disabled:
|
|
226
|
-
onClick: () => void
|
|
271
|
+
disabled: E || !M,
|
|
272
|
+
onClick: () => void it(),
|
|
227
273
|
className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50",
|
|
228
|
-
children: [
|
|
274
|
+
children: [E ? /* @__PURE__ */ v(_, {
|
|
229
275
|
size: 13,
|
|
230
276
|
className: "animate-spin"
|
|
231
|
-
}) : /* @__PURE__ */
|
|
277
|
+
}) : /* @__PURE__ */ v(g, { size: 13 }), C("devportal.revenue.confirm", "Confirm")]
|
|
232
278
|
})]
|
|
233
279
|
})
|
|
234
280
|
]
|
|
235
281
|
})
|
|
236
282
|
]
|
|
237
283
|
}),
|
|
238
|
-
q?.billingAccountId && /* @__PURE__ */
|
|
284
|
+
q?.billingAccountId && /* @__PURE__ */ y("div", {
|
|
239
285
|
className: "mb-6 rounded-lg border border-border-subtle bg-bg-surface p-3 flex flex-col gap-3",
|
|
240
|
-
children: [/* @__PURE__ */
|
|
286
|
+
children: [/* @__PURE__ */ y("div", {
|
|
241
287
|
className: "flex items-center gap-3",
|
|
242
288
|
children: [
|
|
243
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ v(m, {
|
|
244
290
|
size: 16,
|
|
245
291
|
className: "text-text-secondary flex-shrink-0"
|
|
246
292
|
}),
|
|
247
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ y("div", {
|
|
248
294
|
className: "flex-1 min-w-0",
|
|
249
|
-
children: [/* @__PURE__ */
|
|
295
|
+
children: [/* @__PURE__ */ v("p", {
|
|
250
296
|
className: "text-sm font-medium truncate",
|
|
251
|
-
children: Y?.name ??
|
|
252
|
-
}), /* @__PURE__ */
|
|
297
|
+
children: Y?.name ?? C("devportal.revenue.billingAccount", "Billing account")
|
|
298
|
+
}), /* @__PURE__ */ v("p", {
|
|
253
299
|
className: "text-xs text-text-secondary truncate",
|
|
254
300
|
children: Y ? `${Y.currency}${Y.email ? ` · ${Y.email}` : ""}` : q.billingAccountId
|
|
255
301
|
})]
|
|
256
302
|
}),
|
|
257
|
-
!
|
|
303
|
+
!A && /* @__PURE__ */ v("button", {
|
|
258
304
|
type: "button",
|
|
259
|
-
onClick:
|
|
260
|
-
disabled:
|
|
305
|
+
onClick: rt,
|
|
306
|
+
disabled: W,
|
|
261
307
|
className: "text-xs text-text-secondary hover:text-text-primary transition-colors flex-shrink-0 disabled:opacity-50",
|
|
262
|
-
children:
|
|
308
|
+
children: C("devportal.revenue.changeBillingAccount", "Change")
|
|
263
309
|
})
|
|
264
310
|
]
|
|
265
|
-
}),
|
|
311
|
+
}), A && J.length > 0 && /* @__PURE__ */ y("div", {
|
|
266
312
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 space-y-3",
|
|
267
313
|
children: [
|
|
268
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ v("p", {
|
|
269
315
|
className: "text-sm font-medium",
|
|
270
|
-
children:
|
|
316
|
+
children: C("devportal.revenue.chooseBillingAccount", "Choose a billing account to link")
|
|
271
317
|
}),
|
|
272
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ v("div", {
|
|
273
319
|
className: "space-y-2",
|
|
274
|
-
children: J.map((e) => /* @__PURE__ */
|
|
320
|
+
children: J.map((e) => /* @__PURE__ */ y("button", {
|
|
275
321
|
type: "button",
|
|
276
|
-
onClick: () =>
|
|
277
|
-
className: n("flex w-full items-center gap-3 rounded-md border px-3 py-2.5 text-sm text-left transition-colors",
|
|
278
|
-
children: [/* @__PURE__ */
|
|
322
|
+
onClick: () => N(e.id ?? null),
|
|
323
|
+
className: n("flex w-full items-center gap-3 rounded-md border px-3 py-2.5 text-sm text-left transition-colors", M === e.id ? "border-primary bg-action-primary-bg/5 text-text-primary" : "border-border-subtle hover:bg-accent text-text-primary"),
|
|
324
|
+
children: [/* @__PURE__ */ v(p, {
|
|
279
325
|
size: 14,
|
|
280
|
-
className: n("flex-shrink-0",
|
|
281
|
-
}), /* @__PURE__ */
|
|
326
|
+
className: n("flex-shrink-0", M === e.id ? "opacity-100 text-primary" : "opacity-0")
|
|
327
|
+
}), /* @__PURE__ */ y("div", {
|
|
282
328
|
className: "flex-1 min-w-0",
|
|
283
|
-
children: [/* @__PURE__ */
|
|
329
|
+
children: [/* @__PURE__ */ v("p", {
|
|
284
330
|
className: "font-medium truncate",
|
|
285
331
|
children: e.name
|
|
286
|
-
}), e.isDefault && /* @__PURE__ */
|
|
332
|
+
}), e.isDefault && /* @__PURE__ */ v("p", {
|
|
287
333
|
className: "text-xs text-text-secondary",
|
|
288
|
-
children:
|
|
334
|
+
children: C("devportal.revenue.defaultAccount", "Default")
|
|
289
335
|
})]
|
|
290
336
|
})]
|
|
291
337
|
}, e.id))
|
|
292
338
|
}),
|
|
293
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ y("div", {
|
|
294
340
|
className: "flex items-center justify-end gap-2 pt-1",
|
|
295
|
-
children: [/* @__PURE__ */
|
|
341
|
+
children: [/* @__PURE__ */ v("button", {
|
|
296
342
|
type: "button",
|
|
297
343
|
onClick: () => {
|
|
298
|
-
|
|
344
|
+
j(!1), k(null);
|
|
299
345
|
},
|
|
300
346
|
className: "rounded-md px-3 py-1.5 text-xs font-medium text-text-secondary hover:bg-accent transition-colors",
|
|
301
|
-
children:
|
|
302
|
-
}), /* @__PURE__ */
|
|
347
|
+
children: C("devportal.cancel", "Cancel")
|
|
348
|
+
}), /* @__PURE__ */ y("button", {
|
|
303
349
|
type: "button",
|
|
304
|
-
disabled:
|
|
305
|
-
onClick: () => void
|
|
350
|
+
disabled: E || !M,
|
|
351
|
+
onClick: () => void it(),
|
|
306
352
|
className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50",
|
|
307
|
-
children: [
|
|
353
|
+
children: [E ? /* @__PURE__ */ v(_, {
|
|
308
354
|
size: 13,
|
|
309
355
|
className: "animate-spin"
|
|
310
|
-
}) : /* @__PURE__ */
|
|
356
|
+
}) : /* @__PURE__ */ v(g, { size: 13 }), C("devportal.revenue.confirm", "Confirm")]
|
|
311
357
|
})]
|
|
312
358
|
}),
|
|
313
|
-
|
|
359
|
+
O && /* @__PURE__ */ v("p", {
|
|
314
360
|
className: "text-xs text-status-error-text",
|
|
315
|
-
children:
|
|
361
|
+
children: O
|
|
316
362
|
})
|
|
317
363
|
]
|
|
318
364
|
})]
|
|
319
365
|
}),
|
|
320
|
-
|
|
366
|
+
q?.billingAccountId && Z && /* @__PURE__ */ y("div", {
|
|
367
|
+
className: "mb-6 rounded-lg border border-border-subtle bg-bg-surface p-3 flex flex-col gap-3",
|
|
368
|
+
children: [/* @__PURE__ */ y("div", {
|
|
369
|
+
className: "flex items-center gap-3",
|
|
370
|
+
children: [
|
|
371
|
+
/* @__PURE__ */ v(be, {
|
|
372
|
+
size: 16,
|
|
373
|
+
className: "text-text-secondary flex-shrink-0"
|
|
374
|
+
}),
|
|
375
|
+
/* @__PURE__ */ y("div", {
|
|
376
|
+
className: "flex-1 min-w-0",
|
|
377
|
+
children: [/* @__PURE__ */ v("p", {
|
|
378
|
+
className: "text-sm font-medium",
|
|
379
|
+
children: C("devportal.revenue.withdrawTitle", "Withdraw earned credits")
|
|
380
|
+
}), /* @__PURE__ */ v("p", {
|
|
381
|
+
className: "text-xs text-text-secondary",
|
|
382
|
+
children: Q ? `${C("devportal.revenue.available", "Available")}: $${Z.pendingBalance.toLocaleString()}` : `${C("devportal.revenue.belowMinimum", "Minimum payout is")} $${x} — ${C("devportal.revenue.youHave", "you have")} $${Z.pendingBalance.toLocaleString()} ${C("devportal.revenue.pending", "pending")}.`
|
|
383
|
+
})]
|
|
384
|
+
}),
|
|
385
|
+
!Pe && /* @__PURE__ */ y("button", {
|
|
386
|
+
type: "button",
|
|
387
|
+
onClick: at,
|
|
388
|
+
disabled: !Q,
|
|
389
|
+
title: Q ? void 0 : C("devportal.revenue.belowMinimumHint", `Payouts require a pending balance of at least $${x}.`),
|
|
390
|
+
className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex-shrink-0",
|
|
391
|
+
children: [/* @__PURE__ */ v(Se, { size: 14 }), C("devportal.revenue.requestWithdrawal", "Request Withdrawal")]
|
|
392
|
+
})
|
|
393
|
+
]
|
|
394
|
+
}), Pe && /* @__PURE__ */ v("div", {
|
|
395
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 ml-8 space-y-3",
|
|
396
|
+
children: Ke ? /* @__PURE__ */ y("div", {
|
|
397
|
+
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
398
|
+
children: [/* @__PURE__ */ v(_, {
|
|
399
|
+
size: 14,
|
|
400
|
+
className: "animate-spin"
|
|
401
|
+
}), C("devportal.revenue.loadingMethods", "Loading payout methods...")]
|
|
402
|
+
}) : Ie ? /* @__PURE__ */ y("div", {
|
|
403
|
+
className: "space-y-3",
|
|
404
|
+
children: [
|
|
405
|
+
/* @__PURE__ */ v("p", {
|
|
406
|
+
className: "text-sm font-medium",
|
|
407
|
+
children: C("devportal.revenue.addPayoutMethod", "Add a payout method")
|
|
408
|
+
}),
|
|
409
|
+
/* @__PURE__ */ y("div", {
|
|
410
|
+
className: "grid grid-cols-2 gap-2",
|
|
411
|
+
children: [/* @__PURE__ */ v("button", {
|
|
412
|
+
type: "button",
|
|
413
|
+
onClick: () => Le(u.BankAccount),
|
|
414
|
+
className: n("rounded-md border px-3 py-2 text-sm text-left transition-colors", B === u.BankAccount ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-accent"),
|
|
415
|
+
children: C("devportal.revenue.bankAccount", "Bank Account")
|
|
416
|
+
}), /* @__PURE__ */ v("button", {
|
|
417
|
+
type: "button",
|
|
418
|
+
onClick: () => Le(u.Paypal),
|
|
419
|
+
className: n("rounded-md border px-3 py-2 text-sm text-left transition-colors", B === u.Paypal ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-accent"),
|
|
420
|
+
children: C("devportal.revenue.paypal", "PayPal")
|
|
421
|
+
})]
|
|
422
|
+
}),
|
|
423
|
+
/* @__PURE__ */ v("input", {
|
|
424
|
+
type: "text",
|
|
425
|
+
value: Re,
|
|
426
|
+
onChange: (e) => ze(e.target.value),
|
|
427
|
+
placeholder: C("devportal.revenue.methodNamePlaceholder", "Label (e.g. \"Primary account\")"),
|
|
428
|
+
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary"
|
|
429
|
+
}),
|
|
430
|
+
B === u.Paypal ? /* @__PURE__ */ v("input", {
|
|
431
|
+
type: "email",
|
|
432
|
+
value: H,
|
|
433
|
+
onChange: (e) => Ue(e.target.value),
|
|
434
|
+
placeholder: C("devportal.revenue.paypalEmailPlaceholder", "PayPal email"),
|
|
435
|
+
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary"
|
|
436
|
+
}) : /* @__PURE__ */ y(Te, { children: [/* @__PURE__ */ v("input", {
|
|
437
|
+
type: "text",
|
|
438
|
+
value: V,
|
|
439
|
+
onChange: (e) => Be(e.target.value),
|
|
440
|
+
placeholder: C("devportal.revenue.accountNumberPlaceholder", "Account number"),
|
|
441
|
+
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary"
|
|
442
|
+
}), /* @__PURE__ */ v("input", {
|
|
443
|
+
type: "text",
|
|
444
|
+
value: Ve,
|
|
445
|
+
onChange: (e) => He(e.target.value),
|
|
446
|
+
placeholder: C("devportal.revenue.routingNumberPlaceholder", "Routing number"),
|
|
447
|
+
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary"
|
|
448
|
+
})] }),
|
|
449
|
+
We && /* @__PURE__ */ v("p", {
|
|
450
|
+
className: "text-xs text-status-error-text",
|
|
451
|
+
children: We
|
|
452
|
+
}),
|
|
453
|
+
/* @__PURE__ */ y("div", {
|
|
454
|
+
className: "flex items-center justify-end gap-2 pt-1",
|
|
455
|
+
children: [/* @__PURE__ */ v("button", {
|
|
456
|
+
type: "button",
|
|
457
|
+
onClick: () => F(!1),
|
|
458
|
+
className: "rounded-md px-3 py-1.5 text-xs font-medium text-text-secondary hover:bg-accent transition-colors",
|
|
459
|
+
children: C("devportal.cancel", "Cancel")
|
|
460
|
+
}), /* @__PURE__ */ y("button", {
|
|
461
|
+
type: "button",
|
|
462
|
+
disabled: Je || (B === u.Paypal ? !H : !V),
|
|
463
|
+
onClick: () => void ot(),
|
|
464
|
+
className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50",
|
|
465
|
+
children: [Je ? /* @__PURE__ */ v(_, {
|
|
466
|
+
size: 13,
|
|
467
|
+
className: "animate-spin"
|
|
468
|
+
}) : /* @__PURE__ */ v(p, { size: 13 }), C("devportal.revenue.saveMethod", "Save method")]
|
|
469
|
+
})]
|
|
470
|
+
})
|
|
471
|
+
]
|
|
472
|
+
}) : /* @__PURE__ */ y("div", {
|
|
473
|
+
className: "space-y-3",
|
|
474
|
+
children: [
|
|
475
|
+
/* @__PURE__ */ v("p", {
|
|
476
|
+
className: "text-sm font-medium",
|
|
477
|
+
children: C("devportal.revenue.chooseMethod", "Choose where to send this payout")
|
|
478
|
+
}),
|
|
479
|
+
/* @__PURE__ */ y("div", {
|
|
480
|
+
className: "space-y-2",
|
|
481
|
+
children: [X.map((e) => /* @__PURE__ */ y("button", {
|
|
482
|
+
type: "button",
|
|
483
|
+
onClick: () => R(e.id),
|
|
484
|
+
className: n("flex w-full items-center gap-3 rounded-md border px-3 py-2.5 text-sm text-left transition-colors", L === e.id ? "border-primary bg-action-primary-bg/5 text-text-primary" : "border-border-subtle hover:bg-accent text-text-primary"),
|
|
485
|
+
children: [/* @__PURE__ */ v(p, {
|
|
486
|
+
size: 14,
|
|
487
|
+
className: n("flex-shrink-0", L === e.id ? "opacity-100 text-primary" : "opacity-0")
|
|
488
|
+
}), /* @__PURE__ */ y("div", {
|
|
489
|
+
className: "flex-1 min-w-0",
|
|
490
|
+
children: [/* @__PURE__ */ v("p", {
|
|
491
|
+
className: "font-medium truncate",
|
|
492
|
+
children: e.displayName ?? e.name
|
|
493
|
+
}), e.isDefault && /* @__PURE__ */ v("p", {
|
|
494
|
+
className: "text-xs text-text-secondary",
|
|
495
|
+
children: C("devportal.revenue.defaultAccount", "Default")
|
|
496
|
+
})]
|
|
497
|
+
})]
|
|
498
|
+
}, e.id)), /* @__PURE__ */ y("button", {
|
|
499
|
+
type: "button",
|
|
500
|
+
onClick: () => z(!0),
|
|
501
|
+
className: "w-full rounded-md border border-dashed border-border-subtle px-3 py-2 text-sm text-text-secondary hover:bg-accent transition-colors",
|
|
502
|
+
children: [
|
|
503
|
+
"+",
|
|
504
|
+
" ",
|
|
505
|
+
C("devportal.revenue.addAnotherMethod", "Add a different method")
|
|
506
|
+
]
|
|
507
|
+
})]
|
|
508
|
+
}),
|
|
509
|
+
Fe && /* @__PURE__ */ v("p", {
|
|
510
|
+
className: "text-xs text-status-error-text",
|
|
511
|
+
children: Fe
|
|
512
|
+
}),
|
|
513
|
+
/* @__PURE__ */ y("div", {
|
|
514
|
+
className: "flex items-center justify-end gap-2 pt-1",
|
|
515
|
+
children: [/* @__PURE__ */ v("button", {
|
|
516
|
+
type: "button",
|
|
517
|
+
onClick: () => F(!1),
|
|
518
|
+
className: "rounded-md px-3 py-1.5 text-xs font-medium text-text-secondary hover:bg-accent transition-colors",
|
|
519
|
+
children: C("devportal.cancel", "Cancel")
|
|
520
|
+
}), /* @__PURE__ */ y("button", {
|
|
521
|
+
type: "button",
|
|
522
|
+
disabled: Xe || !L,
|
|
523
|
+
onClick: () => void st(),
|
|
524
|
+
className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50",
|
|
525
|
+
children: [
|
|
526
|
+
Xe ? /* @__PURE__ */ v(_, {
|
|
527
|
+
size: 13,
|
|
528
|
+
className: "animate-spin"
|
|
529
|
+
}) : /* @__PURE__ */ v(Se, { size: 13 }),
|
|
530
|
+
C("devportal.revenue.confirmWithdrawal", "Request"),
|
|
531
|
+
" $",
|
|
532
|
+
Z.pendingBalance.toLocaleString()
|
|
533
|
+
]
|
|
534
|
+
})]
|
|
535
|
+
})
|
|
536
|
+
]
|
|
537
|
+
})
|
|
538
|
+
})]
|
|
539
|
+
}),
|
|
540
|
+
tt && !Z ? /* @__PURE__ */ v("div", {
|
|
321
541
|
className: "flex items-center justify-center py-16 text-text-secondary",
|
|
322
|
-
children: /* @__PURE__ */
|
|
323
|
-
}) :
|
|
324
|
-
/* @__PURE__ */
|
|
542
|
+
children: /* @__PURE__ */ v(_, { className: "h-8 w-8 animate-spin" })
|
|
543
|
+
}) : Z ? /* @__PURE__ */ y(Te, { children: [
|
|
544
|
+
/* @__PURE__ */ v(Ee, {
|
|
325
545
|
className: "mb-6",
|
|
326
|
-
children: /* @__PURE__ */
|
|
546
|
+
children: /* @__PURE__ */ y(le, {
|
|
327
547
|
columns: 4,
|
|
328
548
|
children: [
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
-
title:
|
|
331
|
-
value: `$${
|
|
332
|
-
icon: /* @__PURE__ */
|
|
549
|
+
/* @__PURE__ */ v(s, {
|
|
550
|
+
title: C("devportal.revenue.grossRevenue", "Gross Revenue"),
|
|
551
|
+
value: `$${Z.totalGrossRevenue.toLocaleString()}`,
|
|
552
|
+
icon: /* @__PURE__ */ v(h, { size: 20 })
|
|
333
553
|
}),
|
|
334
|
-
/* @__PURE__ */
|
|
335
|
-
title:
|
|
336
|
-
value: `$${
|
|
337
|
-
icon: /* @__PURE__ */
|
|
554
|
+
/* @__PURE__ */ v(s, {
|
|
555
|
+
title: C("devportal.revenue.netRevenue", "Net Revenue"),
|
|
556
|
+
value: `$${Z.totalNetRevenue.toLocaleString()}`,
|
|
557
|
+
icon: /* @__PURE__ */ v(Ce, { size: 20 })
|
|
338
558
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
-
title:
|
|
341
|
-
value: `$${
|
|
342
|
-
icon: /* @__PURE__ */
|
|
343
|
-
description:
|
|
559
|
+
/* @__PURE__ */ v(s, {
|
|
560
|
+
title: C("devportal.revenue.pendingBalance", "Pending Balance"),
|
|
561
|
+
value: `$${Z.pendingBalance.toLocaleString()}`,
|
|
562
|
+
icon: /* @__PURE__ */ v(m, { size: 20 }),
|
|
563
|
+
description: Z.nextPayoutDate ? `${C("devportal.revenue.nextPayout", "Next payout")} ${new Date(Z.nextPayoutDate).toLocaleDateString()}` : C("devportal.revenue.noPayoutScheduled", "No payout scheduled")
|
|
344
564
|
}),
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
-
title:
|
|
347
|
-
value: `$${
|
|
348
|
-
icon: /* @__PURE__ */
|
|
349
|
-
description: `${
|
|
565
|
+
/* @__PURE__ */ v(s, {
|
|
566
|
+
title: C("devportal.revenue.platformFees", "Platform Fees"),
|
|
567
|
+
value: `$${Z.totalPlatformFees.toLocaleString()}`,
|
|
568
|
+
icon: /* @__PURE__ */ v(ye, { size: 20 }),
|
|
569
|
+
description: `${Z.totalRefundsCount} ${C("devportal.revenue.refunds", "refunds")}`
|
|
350
570
|
})
|
|
351
571
|
]
|
|
352
572
|
})
|
|
353
573
|
}),
|
|
354
|
-
/* @__PURE__ */
|
|
574
|
+
/* @__PURE__ */ y("div", {
|
|
355
575
|
className: "grid gap-6 xl:grid-cols-2",
|
|
356
|
-
children: [/* @__PURE__ */
|
|
357
|
-
title:
|
|
358
|
-
children: /* @__PURE__ */
|
|
576
|
+
children: [/* @__PURE__ */ v(a, {
|
|
577
|
+
title: C("devportal.revenue.revenueTrend", "Revenue trend"),
|
|
578
|
+
children: /* @__PURE__ */ v(b, {
|
|
359
579
|
treatment: "insight",
|
|
360
580
|
className: "p-4",
|
|
361
|
-
children: $.length > 0 ? /* @__PURE__ */
|
|
581
|
+
children: $.length > 0 ? /* @__PURE__ */ v(ue, {
|
|
362
582
|
width: "100%",
|
|
363
583
|
height: 300,
|
|
364
|
-
children: /* @__PURE__ */
|
|
584
|
+
children: /* @__PURE__ */ y(ge, {
|
|
365
585
|
data: $,
|
|
366
586
|
children: [
|
|
367
|
-
/* @__PURE__ */
|
|
587
|
+
/* @__PURE__ */ v(fe, {
|
|
368
588
|
strokeDasharray: "3 3",
|
|
369
589
|
stroke: "var(--color-chart-grid)"
|
|
370
590
|
}),
|
|
371
|
-
/* @__PURE__ */
|
|
591
|
+
/* @__PURE__ */ v(me, {
|
|
372
592
|
dataKey: "date",
|
|
373
593
|
stroke: "var(--color-chart-axis)",
|
|
374
594
|
fontSize: 12
|
|
375
595
|
}),
|
|
376
|
-
/* @__PURE__ */
|
|
596
|
+
/* @__PURE__ */ v(he, {
|
|
377
597
|
stroke: "var(--color-chart-axis)",
|
|
378
598
|
fontSize: 12
|
|
379
599
|
}),
|
|
380
|
-
/* @__PURE__ */
|
|
600
|
+
/* @__PURE__ */ v(l, { contentStyle: {
|
|
381
601
|
backgroundColor: "var(--color-card)",
|
|
382
602
|
border: "1px solid var(--color-border-default)",
|
|
383
603
|
borderRadius: 12
|
|
384
604
|
} }),
|
|
385
|
-
/* @__PURE__ */
|
|
605
|
+
/* @__PURE__ */ v(pe, {
|
|
386
606
|
type: "monotone",
|
|
387
607
|
dataKey: "grossRevenue",
|
|
388
|
-
stroke:
|
|
608
|
+
stroke: S.primary,
|
|
389
609
|
strokeWidth: 2,
|
|
390
610
|
dot: !1
|
|
391
611
|
}),
|
|
392
|
-
/* @__PURE__ */
|
|
612
|
+
/* @__PURE__ */ v(pe, {
|
|
393
613
|
type: "monotone",
|
|
394
614
|
dataKey: "netRevenue",
|
|
395
|
-
stroke:
|
|
615
|
+
stroke: S.secondary,
|
|
396
616
|
strokeWidth: 2,
|
|
397
617
|
dot: !1
|
|
398
618
|
})
|
|
399
619
|
]
|
|
400
620
|
})
|
|
401
|
-
}) : /* @__PURE__ */
|
|
621
|
+
}) : /* @__PURE__ */ y("div", {
|
|
402
622
|
className: "flex h-[300px] flex-col items-center justify-center gap-2 text-text-secondary",
|
|
403
|
-
children: [/* @__PURE__ */
|
|
623
|
+
children: [/* @__PURE__ */ v("p", {
|
|
404
624
|
className: "text-sm font-medium",
|
|
405
|
-
children:
|
|
406
|
-
}), /* @__PURE__ */
|
|
625
|
+
children: C("devportal.revenue.noTrendData", "No trend data yet")
|
|
626
|
+
}), /* @__PURE__ */ v("p", {
|
|
407
627
|
className: "text-xs text-text-tertiary",
|
|
408
|
-
children:
|
|
628
|
+
children: C("devportal.revenue.noTrendDataHint", "Revenue trend appears once daily analytics have been aggregated.")
|
|
409
629
|
})]
|
|
410
630
|
})
|
|
411
631
|
})
|
|
412
|
-
}), /* @__PURE__ */
|
|
413
|
-
title:
|
|
414
|
-
children:
|
|
632
|
+
}), /* @__PURE__ */ v(a, {
|
|
633
|
+
title: C("devportal.revenue.topApps", "Top applications by revenue"),
|
|
634
|
+
children: Z.topApps.length > 0 ? /* @__PURE__ */ v("div", {
|
|
415
635
|
className: "space-y-2",
|
|
416
|
-
children:
|
|
636
|
+
children: Z.topApps.map((e) => /* @__PURE__ */ v(b, {
|
|
417
637
|
treatment: "insight",
|
|
418
638
|
className: "border-border-seam p-4",
|
|
419
|
-
children: /* @__PURE__ */
|
|
639
|
+
children: /* @__PURE__ */ y("div", {
|
|
420
640
|
className: "flex items-start justify-between gap-3",
|
|
421
|
-
children: [/* @__PURE__ */
|
|
641
|
+
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
422
642
|
className: "font-medium",
|
|
423
643
|
children: e.applicationName
|
|
424
|
-
}), /* @__PURE__ */
|
|
644
|
+
}), /* @__PURE__ */ y("p", {
|
|
425
645
|
className: "text-sm text-text-secondary",
|
|
426
646
|
children: [
|
|
427
647
|
e.salesCount,
|
|
428
648
|
" ",
|
|
429
|
-
|
|
649
|
+
C("devportal.revenue.sales", "sales")
|
|
430
650
|
]
|
|
431
|
-
})] }), /* @__PURE__ */
|
|
651
|
+
})] }), /* @__PURE__ */ y("div", {
|
|
432
652
|
className: "text-right",
|
|
433
|
-
children: [/* @__PURE__ */
|
|
653
|
+
children: [/* @__PURE__ */ y("p", {
|
|
434
654
|
className: "font-semibold",
|
|
435
655
|
children: ["$", e.grossRevenue.toLocaleString()]
|
|
436
|
-
}), /* @__PURE__ */
|
|
656
|
+
}), /* @__PURE__ */ y("p", {
|
|
437
657
|
className: "text-sm text-text-secondary",
|
|
438
658
|
children: [
|
|
439
|
-
|
|
659
|
+
C("devportal.revenue.net", "Net"),
|
|
440
660
|
" $",
|
|
441
661
|
e.netRevenue.toLocaleString()
|
|
442
662
|
]
|
|
@@ -444,46 +664,46 @@ var O = {
|
|
|
444
664
|
})]
|
|
445
665
|
})
|
|
446
666
|
}, e.applicationId))
|
|
447
|
-
}) : /* @__PURE__ */
|
|
667
|
+
}) : /* @__PURE__ */ v(r, {
|
|
448
668
|
illustration: "empty-data",
|
|
449
|
-
icon: /* @__PURE__ */
|
|
450
|
-
title:
|
|
451
|
-
description:
|
|
669
|
+
icon: /* @__PURE__ */ v(xe, { size: 24 }),
|
|
670
|
+
title: C("devportal.revenue.noLeadersTitle", "No revenue leaders yet"),
|
|
671
|
+
description: C("devportal.revenue.noLeadersDescription", "Top-performing applications will appear here once revenue is recorded.")
|
|
452
672
|
})
|
|
453
673
|
})]
|
|
454
674
|
}),
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
-
title:
|
|
457
|
-
children: /* @__PURE__ */
|
|
675
|
+
/* @__PURE__ */ v(a, {
|
|
676
|
+
title: C("devportal.revenue.salesVolume", "Sales volume"),
|
|
677
|
+
children: /* @__PURE__ */ v(b, {
|
|
458
678
|
treatment: "insight",
|
|
459
679
|
className: "p-4",
|
|
460
|
-
children: $.length > 0 ? /* @__PURE__ */
|
|
680
|
+
children: $.length > 0 ? /* @__PURE__ */ v(ue, {
|
|
461
681
|
width: "100%",
|
|
462
682
|
height: 280,
|
|
463
|
-
children: /* @__PURE__ */
|
|
683
|
+
children: /* @__PURE__ */ y(_e, {
|
|
464
684
|
data: $,
|
|
465
685
|
children: [
|
|
466
|
-
/* @__PURE__ */
|
|
686
|
+
/* @__PURE__ */ v(fe, {
|
|
467
687
|
strokeDasharray: "3 3",
|
|
468
688
|
stroke: "var(--color-chart-grid)"
|
|
469
689
|
}),
|
|
470
|
-
/* @__PURE__ */
|
|
690
|
+
/* @__PURE__ */ v(me, {
|
|
471
691
|
dataKey: "date",
|
|
472
692
|
stroke: "var(--color-chart-axis)",
|
|
473
693
|
fontSize: 12
|
|
474
694
|
}),
|
|
475
|
-
/* @__PURE__ */
|
|
695
|
+
/* @__PURE__ */ v(he, {
|
|
476
696
|
stroke: "var(--color-chart-axis)",
|
|
477
697
|
fontSize: 12
|
|
478
698
|
}),
|
|
479
|
-
/* @__PURE__ */
|
|
699
|
+
/* @__PURE__ */ v(l, { contentStyle: {
|
|
480
700
|
backgroundColor: "var(--color-card)",
|
|
481
701
|
border: "1px solid var(--color-border-default)",
|
|
482
702
|
borderRadius: 12
|
|
483
703
|
} }),
|
|
484
|
-
/* @__PURE__ */
|
|
704
|
+
/* @__PURE__ */ v(de, {
|
|
485
705
|
dataKey: "salesCount",
|
|
486
|
-
fill:
|
|
706
|
+
fill: S.tertiary,
|
|
487
707
|
radius: [
|
|
488
708
|
6,
|
|
489
709
|
6,
|
|
@@ -493,71 +713,71 @@ var O = {
|
|
|
493
713
|
})
|
|
494
714
|
]
|
|
495
715
|
})
|
|
496
|
-
}) : /* @__PURE__ */
|
|
716
|
+
}) : /* @__PURE__ */ y("div", {
|
|
497
717
|
className: "flex h-[280px] flex-col items-center justify-center gap-2 text-text-secondary",
|
|
498
|
-
children: [/* @__PURE__ */
|
|
718
|
+
children: [/* @__PURE__ */ v("p", {
|
|
499
719
|
className: "text-sm font-medium",
|
|
500
|
-
children:
|
|
501
|
-
}), /* @__PURE__ */
|
|
720
|
+
children: C("devportal.revenue.noVolumeData", "No sales volume data yet")
|
|
721
|
+
}), /* @__PURE__ */ v("p", {
|
|
502
722
|
className: "text-xs text-text-tertiary",
|
|
503
|
-
children:
|
|
723
|
+
children: C("devportal.revenue.noVolumeDataHint", "Sales volume by period appears once analytics have been aggregated.")
|
|
504
724
|
})]
|
|
505
725
|
})
|
|
506
726
|
})
|
|
507
727
|
}),
|
|
508
|
-
/* @__PURE__ */
|
|
728
|
+
/* @__PURE__ */ y("div", {
|
|
509
729
|
className: "grid gap-6 xl:grid-cols-2",
|
|
510
|
-
children: [/* @__PURE__ */
|
|
511
|
-
title:
|
|
512
|
-
children: /* @__PURE__ */
|
|
513
|
-
data:
|
|
730
|
+
children: [/* @__PURE__ */ v(a, {
|
|
731
|
+
title: C("devportal.revenue.recentSales", "Recent sales"),
|
|
732
|
+
children: /* @__PURE__ */ v(c, {
|
|
733
|
+
data: lt,
|
|
514
734
|
keyField: "id",
|
|
515
735
|
columns: [
|
|
516
736
|
{
|
|
517
737
|
key: "application",
|
|
518
|
-
header:
|
|
519
|
-
render: (e) => e.application?.name || e.planName ||
|
|
738
|
+
header: C("devportal.revenue.application", "Application"),
|
|
739
|
+
render: (e) => e.application?.name || e.planName || C("devportal.common.unknown", "Unknown")
|
|
520
740
|
},
|
|
521
741
|
{
|
|
522
742
|
key: "grossAmount",
|
|
523
|
-
header:
|
|
743
|
+
header: C("devportal.revenue.gross", "Gross"),
|
|
524
744
|
render: (e) => `$${e.grossAmount.toLocaleString()}`
|
|
525
745
|
},
|
|
526
746
|
{
|
|
527
747
|
key: "netAmount",
|
|
528
|
-
header:
|
|
748
|
+
header: C("devportal.revenue.net", "Net"),
|
|
529
749
|
render: (e) => `$${e.netAmount.toLocaleString()}`
|
|
530
750
|
},
|
|
531
751
|
{
|
|
532
752
|
key: "status",
|
|
533
|
-
header:
|
|
534
|
-
render: (e) => /* @__PURE__ */
|
|
753
|
+
header: C("devportal.revenue.status", "Status"),
|
|
754
|
+
render: (e) => /* @__PURE__ */ v(o, {
|
|
535
755
|
status: e.status,
|
|
536
756
|
type: "app"
|
|
537
757
|
})
|
|
538
758
|
}
|
|
539
759
|
]
|
|
540
760
|
})
|
|
541
|
-
}), /* @__PURE__ */
|
|
542
|
-
title:
|
|
543
|
-
children: /* @__PURE__ */
|
|
544
|
-
data:
|
|
761
|
+
}), /* @__PURE__ */ v(a, {
|
|
762
|
+
title: C("devportal.revenue.payoutHistory", "Payout history"),
|
|
763
|
+
children: /* @__PURE__ */ v(c, {
|
|
764
|
+
data: ut,
|
|
545
765
|
keyField: "id",
|
|
546
766
|
columns: [
|
|
547
767
|
{
|
|
548
768
|
key: "periodLabel",
|
|
549
|
-
header:
|
|
769
|
+
header: C("devportal.revenue.period", "Period"),
|
|
550
770
|
render: (e) => e.periodLabel
|
|
551
771
|
},
|
|
552
772
|
{
|
|
553
773
|
key: "netAmount",
|
|
554
|
-
header:
|
|
774
|
+
header: C("devportal.revenue.netPayout", "Net payout"),
|
|
555
775
|
render: (e) => `$${e.netAmount.toLocaleString()}`
|
|
556
776
|
},
|
|
557
777
|
{
|
|
558
778
|
key: "status",
|
|
559
|
-
header:
|
|
560
|
-
render: (e) => /* @__PURE__ */
|
|
779
|
+
header: C("devportal.revenue.status", "Status"),
|
|
780
|
+
render: (e) => /* @__PURE__ */ v(o, {
|
|
561
781
|
status: e.status,
|
|
562
782
|
type: "app"
|
|
563
783
|
})
|
|
@@ -566,28 +786,28 @@ var O = {
|
|
|
566
786
|
})
|
|
567
787
|
})]
|
|
568
788
|
})
|
|
569
|
-
] }) : /* @__PURE__ */
|
|
789
|
+
] }) : /* @__PURE__ */ v(r, {
|
|
570
790
|
illustration: "empty-data",
|
|
571
|
-
icon: /* @__PURE__ */
|
|
572
|
-
title:
|
|
573
|
-
description:
|
|
791
|
+
icon: /* @__PURE__ */ v(h, { size: 32 }),
|
|
792
|
+
title: C("devportal.revenue.noDataTitle", "No revenue data yet"),
|
|
793
|
+
description: C("devportal.revenue.noDataDescription", "Revenue metrics will appear after this organization starts recording marketplace sales.")
|
|
574
794
|
})
|
|
575
795
|
]
|
|
576
|
-
}) : /* @__PURE__ */
|
|
577
|
-
title:
|
|
578
|
-
description:
|
|
579
|
-
children: /* @__PURE__ */
|
|
796
|
+
}) : /* @__PURE__ */ v(i, {
|
|
797
|
+
title: C("devportal.revenue.title", "Revenue"),
|
|
798
|
+
description: C("devportal.revenue.description", "Track real revenue, sales, and payout activity for your developer organizations"),
|
|
799
|
+
children: /* @__PURE__ */ v(r, {
|
|
580
800
|
illustration: "empty-people",
|
|
581
|
-
icon: /* @__PURE__ */
|
|
801
|
+
icon: /* @__PURE__ */ v(xe, {
|
|
582
802
|
size: 32,
|
|
583
803
|
className: "text-text-secondary"
|
|
584
804
|
}),
|
|
585
|
-
title:
|
|
586
|
-
description:
|
|
805
|
+
title: C("devportal.revenue.selectOrgTitle", "Select an organization"),
|
|
806
|
+
description: C("devportal.revenue.selectOrgHint", "Use the organization switcher in the nav bar above to choose which organization's revenue to view.")
|
|
587
807
|
})
|
|
588
808
|
});
|
|
589
809
|
};
|
|
590
810
|
//#endregion
|
|
591
|
-
export {
|
|
811
|
+
export { C as RevenueDashboardPage };
|
|
592
812
|
|
|
593
813
|
//# sourceMappingURL=RevenueDashboardPage.js.map
|