@burdenoff/microfe-brainyrich 2026.705.1 → 2026.706.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/brainyrich/BrainyRichRoot.js +13 -13
- package/dist/brainyrich/components/ActorName.js +38 -0
- package/dist/brainyrich/components/ActorName.js.map +1 -0
- package/dist/brainyrich/components/ConfirmDialog.js +25 -0
- package/dist/brainyrich/components/ConfirmDialog.js.map +1 -0
- package/dist/brainyrich/components/LoadMore.js +24 -0
- package/dist/brainyrich/components/LoadMore.js.map +1 -0
- package/dist/brainyrich/components/index.js +5 -0
- package/dist/brainyrich/components/notify.js +38 -0
- package/dist/brainyrich/components/notify.js.map +1 -0
- package/dist/brainyrich/components/pickers.js +232 -0
- package/dist/brainyrich/components/pickers.js.map +1 -0
- package/dist/brainyrich/components/reuse/CommentThread.js +208 -0
- package/dist/brainyrich/components/reuse/CommentThread.js.map +1 -0
- package/dist/brainyrich/components/reuse/DocumentsPanel.js +237 -0
- package/dist/brainyrich/components/reuse/DocumentsPanel.js.map +1 -0
- package/dist/brainyrich/components/reuse/TagField.js +206 -0
- package/dist/brainyrich/components/reuse/TagField.js.map +1 -0
- package/dist/brainyrich/components/reuse/transport.js +24 -0
- package/dist/brainyrich/components/reuse/transport.js.map +1 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.js +644 -372
- package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -1
- package/dist/brainyrich/pages/AccountsPage.js +346 -293
- package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
- package/dist/brainyrich/pages/AiAssistantPage.js +339 -320
- package/dist/brainyrich/pages/AiAssistantPage.js.map +1 -1
- package/dist/brainyrich/pages/AnalyticsPage.js +178 -164
- package/dist/brainyrich/pages/AnalyticsPage.js.map +1 -1
- package/dist/brainyrich/pages/DashboardPage.js +195 -169
- package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
- package/dist/brainyrich/pages/FamilyPage.js +247 -198
- package/dist/brainyrich/pages/FamilyPage.js.map +1 -1
- package/dist/brainyrich/pages/GoalsPage.js +478 -442
- package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
- package/dist/brainyrich/pages/InvestmentsPage.js.map +1 -1
- package/dist/brainyrich/pages/PortfoliosPage.js +438 -396
- package/dist/brainyrich/pages/PortfoliosPage.js.map +1 -1
- package/dist/brainyrich/pages/ReportsPage.js +246 -213
- package/dist/brainyrich/pages/ReportsPage.js.map +1 -1
- package/dist/brainyrich/pages/RiskPage.js +321 -173
- package/dist/brainyrich/pages/RiskPage.js.map +1 -1
- package/dist/brainyrich/pages/TaxPage.js +258 -225
- package/dist/brainyrich/pages/TaxPage.js.map +1 -1
- package/dist/brainyrich/pages/_shared.js.map +1 -1
- package/dist/node_modules/sonner/dist/index.js +163 -0
- package/dist/node_modules/sonner/dist/index.js.map +1 -0
- package/package.json +3 -2
|
@@ -1,249 +1,282 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { useBrainyRich as e } from "../providers/BrainyRichProvider.js";
|
|
2
|
+
import { tWithFallback as t } from "../utils/i18n.js";
|
|
3
|
+
import { fetchAllAccounts as n, useAllTransactions as r, useNetWorthSummary as i } from "../hooks/useBrainyRichApi.js";
|
|
4
|
+
import { AllocationBars as a, EmptyState as o, ErrorState as s, KpiGrid as c, LoadingState as l, SectionShell as u, deltaToneClass as d, formatDate as f, formatMoney as p } from "./_shared.js";
|
|
5
|
+
import { useMemo as m, useState as h } from "react";
|
|
6
|
+
import { ChevronDown as g, Download as _, FileText as v, Layers as y, Printer as b, Receipt as x, Wallet as S } from "lucide-react";
|
|
7
|
+
import { useI18n as C } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
8
|
+
import { useQuery as w } from "@tanstack/react-query";
|
|
9
|
+
import { jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
10
|
+
import { Badge as D, Button as ee, Card as O, CardContent as k, CardDescription as A, CardHeader as j, CardTitle as M, DropdownMenu as N, DropdownMenuContent as P, DropdownMenuItem as F, DropdownMenuTrigger as I, Table as L, TableBody as R, TableCell as z, TableHead as B, TableHeader as V, TableRow as H, Tabs as U, TabsList as W, TabsTrigger as G } from "@burdenoff/fe-libs/ui";
|
|
11
|
+
import { graphqlFetch as K } from "@burdenoff/fe-libs/shared/graphql";
|
|
9
12
|
//#region src/brainyrich/pages/ReportsPage.tsx
|
|
10
|
-
function
|
|
13
|
+
function q(e, t) {
|
|
11
14
|
let n = (e) => {
|
|
12
15
|
let t = String(e ?? "");
|
|
13
16
|
return /[",\n]/.test(t) ? `"${t.replace(/"/g, "\"\"")}"` : t;
|
|
14
17
|
};
|
|
15
18
|
return [e, ...t].map((e) => e.map(n).join(",")).join("\n");
|
|
16
19
|
}
|
|
17
|
-
function
|
|
20
|
+
function J(e, t) {
|
|
18
21
|
let n = new Blob([t], { type: "text/csv;charset=utf-8;" }), r = URL.createObjectURL(n), i = document.createElement("a");
|
|
19
22
|
i.href = r, i.download = e, document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(r);
|
|
20
23
|
}
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
var Y = "query BraReportHoldings($accountId: ID) {\n braListHoldings(accountId: $accountId) {\n id workspaceId accountId portfolioId symbol name assetClass quantity lastPrice\n costBasis marketValue currency asOf createdAt updatedAt\n }\n}";
|
|
25
|
+
function X() {
|
|
26
|
+
let { apiGatewayUrl: t } = e(), r = w({
|
|
27
|
+
queryKey: [
|
|
28
|
+
"brainyrich",
|
|
29
|
+
"holdings",
|
|
30
|
+
"report-all"
|
|
31
|
+
],
|
|
32
|
+
queryFn: async () => {
|
|
33
|
+
let e = await n(t);
|
|
34
|
+
return (await Promise.all(e.map(async (e) => {
|
|
35
|
+
let n = await K({
|
|
36
|
+
gateway: "workspace",
|
|
37
|
+
baseUrl: t,
|
|
38
|
+
query: Y,
|
|
39
|
+
variables: { accountId: e.id },
|
|
40
|
+
workspaceToken: !0
|
|
41
|
+
});
|
|
42
|
+
if (n.errors?.length) throw Error(n.errors[0]?.message ?? "Failed to load holdings");
|
|
43
|
+
return n.data?.braListHoldings ?? [];
|
|
44
|
+
}))).flat();
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
...r,
|
|
49
|
+
data: r.data ?? []
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function Z() {
|
|
53
|
+
let { t: e } = C(), n = (n, r, i) => t(e, n, r, i), [a, o] = h("networth"), s = i(), l = X(), d = r(), v = s.data, w = v?.currency ?? "USD", D = m(() => l.data.slice().sort((e, t) => t.marketValue - e.marketValue), [l.data]), O = m(() => d.data.slice().sort((e, t) => new Date(t.tradeDate).getTime() - new Date(e.tradeDate).getTime()), [d.data]), k = v ? [
|
|
23
54
|
{
|
|
24
|
-
label:
|
|
25
|
-
value:
|
|
55
|
+
label: n("brainyrich.reports.kpis.netWorth", "Net Worth"),
|
|
56
|
+
value: p(v.totalNetWorth, w)
|
|
26
57
|
},
|
|
27
58
|
{
|
|
28
|
-
label:
|
|
29
|
-
value:
|
|
59
|
+
label: n("brainyrich.reports.kpis.marketValue", "Invested Value"),
|
|
60
|
+
value: p(v.totalMarketValue, w)
|
|
30
61
|
},
|
|
31
62
|
{
|
|
32
|
-
label:
|
|
33
|
-
value: String(
|
|
63
|
+
label: n("brainyrich.reports.kpis.holdings", "Holdings on Schedule"),
|
|
64
|
+
value: String(D.length)
|
|
34
65
|
},
|
|
35
66
|
{
|
|
36
|
-
label:
|
|
37
|
-
value: String(
|
|
67
|
+
label: n("brainyrich.reports.kpis.transactions", "Ledger Entries"),
|
|
68
|
+
value: String(O.length)
|
|
38
69
|
}
|
|
39
70
|
] : [{
|
|
40
|
-
label:
|
|
41
|
-
value: String(
|
|
71
|
+
label: n("brainyrich.reports.kpis.holdings", "Holdings on Schedule"),
|
|
72
|
+
value: String(D.length)
|
|
42
73
|
}, {
|
|
43
|
-
label:
|
|
44
|
-
value: String(
|
|
45
|
-
}]
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
74
|
+
label: n("brainyrich.reports.kpis.transactions", "Ledger Entries"),
|
|
75
|
+
value: String(O.length)
|
|
76
|
+
}], A = () => {
|
|
77
|
+
if (a === "networth") {
|
|
78
|
+
if (!v) return;
|
|
79
|
+
J("brainyrich-net-worth-statement.csv", q([
|
|
80
|
+
"Metric",
|
|
81
|
+
"Amount",
|
|
82
|
+
"Currency"
|
|
83
|
+
], [
|
|
84
|
+
[
|
|
85
|
+
"Total Net Worth",
|
|
86
|
+
v.totalNetWorth,
|
|
87
|
+
w
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
"Total Market Value",
|
|
91
|
+
v.totalMarketValue,
|
|
92
|
+
w
|
|
93
|
+
],
|
|
94
|
+
[
|
|
95
|
+
"Total Cash",
|
|
96
|
+
v.totalCash,
|
|
97
|
+
w
|
|
98
|
+
],
|
|
99
|
+
[
|
|
100
|
+
"Account Count",
|
|
101
|
+
v.accountCount,
|
|
102
|
+
""
|
|
103
|
+
],
|
|
104
|
+
...v.byAssetClass.map((e) => [
|
|
105
|
+
`Asset Class: ${e.assetClass.replace(/_/g, " ")}`,
|
|
106
|
+
e.marketValue,
|
|
107
|
+
w
|
|
108
|
+
])
|
|
109
|
+
]));
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (a === "holdings") {
|
|
113
|
+
J("brainyrich-holdings-schedule.csv", q([
|
|
114
|
+
"Symbol",
|
|
115
|
+
"Name",
|
|
116
|
+
"Asset Class",
|
|
117
|
+
"Quantity",
|
|
118
|
+
"Cost Basis",
|
|
119
|
+
"Market Value",
|
|
120
|
+
"Currency"
|
|
121
|
+
], D.map((e) => [
|
|
122
|
+
e.symbol,
|
|
123
|
+
e.name ?? "",
|
|
124
|
+
e.assetClass.replace(/_/g, " "),
|
|
125
|
+
e.quantity,
|
|
126
|
+
e.costBasis,
|
|
127
|
+
e.marketValue,
|
|
128
|
+
e.currency
|
|
129
|
+
])));
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
J("brainyrich-transaction-ledger.csv", q([
|
|
133
|
+
"Trade Date",
|
|
134
|
+
"Type",
|
|
135
|
+
"Symbol",
|
|
136
|
+
"Quantity",
|
|
137
|
+
"Price",
|
|
138
|
+
"Amount",
|
|
139
|
+
"Fee",
|
|
140
|
+
"Currency"
|
|
141
|
+
], O.map((e) => [
|
|
142
|
+
f(e.tradeDate),
|
|
143
|
+
e.type,
|
|
144
|
+
e.symbol ?? "",
|
|
145
|
+
e.quantity,
|
|
146
|
+
e.price,
|
|
147
|
+
e.amount,
|
|
148
|
+
e.fee,
|
|
149
|
+
e.currency
|
|
150
|
+
])));
|
|
151
|
+
}, j = a === "networth" && (s.isLoading || !v) || a === "holdings" && (l.isLoading || D.length === 0) || a === "transactions" && (d.isLoading || O.length === 0);
|
|
152
|
+
return /* @__PURE__ */ E(u, {
|
|
153
|
+
title: n("brainyrich.reports.title", "Reports & Statements"),
|
|
154
|
+
description: n("brainyrich.reports.description", "Generate statements directly from your live portfolio data — no fabricated schedules."),
|
|
155
|
+
actions: /* @__PURE__ */ E(N, { children: [/* @__PURE__ */ T(I, {
|
|
50
156
|
asChild: !0,
|
|
51
|
-
children: /* @__PURE__ */
|
|
157
|
+
children: /* @__PURE__ */ E(ee, {
|
|
52
158
|
size: "sm",
|
|
159
|
+
disabled: j,
|
|
160
|
+
"aria-label": n("brainyrich.reports.actions.export", "Print / Export"),
|
|
53
161
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ T(_, {
|
|
55
163
|
className: "size-4",
|
|
56
164
|
"aria-hidden": "true"
|
|
57
165
|
}),
|
|
58
|
-
|
|
59
|
-
/* @__PURE__ */
|
|
166
|
+
n("brainyrich.reports.actions.export", "Print / Export"),
|
|
167
|
+
/* @__PURE__ */ T(g, {
|
|
60
168
|
className: "size-4",
|
|
61
169
|
"aria-hidden": "true"
|
|
62
170
|
})
|
|
63
171
|
]
|
|
64
172
|
})
|
|
65
|
-
}), /* @__PURE__ */
|
|
173
|
+
}), /* @__PURE__ */ E(P, {
|
|
66
174
|
align: "end",
|
|
67
|
-
children: [/* @__PURE__ */
|
|
68
|
-
onSelect:
|
|
69
|
-
|
|
70
|
-
if (!D) return;
|
|
71
|
-
K("brainyrich-net-worth-statement.csv", G([
|
|
72
|
-
"Metric",
|
|
73
|
-
"Amount",
|
|
74
|
-
"Currency"
|
|
75
|
-
], [
|
|
76
|
-
[
|
|
77
|
-
"Total Net Worth",
|
|
78
|
-
D.totalNetWorth,
|
|
79
|
-
O
|
|
80
|
-
],
|
|
81
|
-
[
|
|
82
|
-
"Total Market Value",
|
|
83
|
-
D.totalMarketValue,
|
|
84
|
-
O
|
|
85
|
-
],
|
|
86
|
-
[
|
|
87
|
-
"Total Cash",
|
|
88
|
-
D.totalCash,
|
|
89
|
-
O
|
|
90
|
-
],
|
|
91
|
-
[
|
|
92
|
-
"Account Count",
|
|
93
|
-
D.accountCount,
|
|
94
|
-
""
|
|
95
|
-
],
|
|
96
|
-
...D.byAssetClass.map((e) => [
|
|
97
|
-
`Asset Class: ${e.assetClass.replace(/_/g, " ")}`,
|
|
98
|
-
e.marketValue,
|
|
99
|
-
O
|
|
100
|
-
])
|
|
101
|
-
]));
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
if (o === "holdings") {
|
|
105
|
-
K("brainyrich-holdings-schedule.csv", G([
|
|
106
|
-
"Symbol",
|
|
107
|
-
"Name",
|
|
108
|
-
"Asset Class",
|
|
109
|
-
"Quantity",
|
|
110
|
-
"Cost Basis",
|
|
111
|
-
"Market Value",
|
|
112
|
-
"Currency"
|
|
113
|
-
], k.map((e) => [
|
|
114
|
-
e.symbol,
|
|
115
|
-
e.name ?? "",
|
|
116
|
-
e.assetClass.replace(/_/g, " "),
|
|
117
|
-
e.quantity,
|
|
118
|
-
e.costBasis,
|
|
119
|
-
e.marketValue,
|
|
120
|
-
e.currency
|
|
121
|
-
])));
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
K("brainyrich-transaction-ledger.csv", G([
|
|
125
|
-
"Trade Date",
|
|
126
|
-
"Type",
|
|
127
|
-
"Symbol",
|
|
128
|
-
"Quantity",
|
|
129
|
-
"Price",
|
|
130
|
-
"Amount",
|
|
131
|
-
"Fee",
|
|
132
|
-
"Currency"
|
|
133
|
-
], A.map((e) => [
|
|
134
|
-
d(e.tradeDate),
|
|
135
|
-
e.type,
|
|
136
|
-
e.symbol ?? "",
|
|
137
|
-
e.quantity,
|
|
138
|
-
e.price,
|
|
139
|
-
e.amount,
|
|
140
|
-
e.fee,
|
|
141
|
-
e.currency
|
|
142
|
-
])));
|
|
143
|
-
},
|
|
144
|
-
children: [/* @__PURE__ */ C(g, {
|
|
175
|
+
children: [/* @__PURE__ */ E(F, {
|
|
176
|
+
onSelect: A,
|
|
177
|
+
children: [/* @__PURE__ */ T(_, {
|
|
145
178
|
className: "size-4",
|
|
146
179
|
"aria-hidden": "true"
|
|
147
|
-
}),
|
|
148
|
-
}), /* @__PURE__ */
|
|
180
|
+
}), n("brainyrich.reports.actions.downloadCsv", "Download CSV")]
|
|
181
|
+
}), /* @__PURE__ */ E(F, {
|
|
149
182
|
onSelect: () => window.print(),
|
|
150
|
-
children: [/* @__PURE__ */
|
|
183
|
+
children: [/* @__PURE__ */ T(b, {
|
|
151
184
|
className: "size-4",
|
|
152
185
|
"aria-hidden": "true"
|
|
153
|
-
}),
|
|
186
|
+
}), n("brainyrich.reports.actions.print", "Print statement")]
|
|
154
187
|
})]
|
|
155
188
|
})] }),
|
|
156
189
|
children: [
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
-
value:
|
|
160
|
-
onValueChange: (e) =>
|
|
161
|
-
children: /* @__PURE__ */
|
|
162
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ T(c, { items: k }),
|
|
191
|
+
/* @__PURE__ */ T(U, {
|
|
192
|
+
value: a,
|
|
193
|
+
onValueChange: (e) => o(e),
|
|
194
|
+
children: /* @__PURE__ */ E(W, { children: [
|
|
195
|
+
/* @__PURE__ */ E(G, {
|
|
163
196
|
value: "networth",
|
|
164
|
-
children: [/* @__PURE__ */
|
|
197
|
+
children: [/* @__PURE__ */ T(S, {
|
|
165
198
|
className: "size-4",
|
|
166
199
|
"aria-hidden": "true"
|
|
167
|
-
}),
|
|
200
|
+
}), n("brainyrich.reports.tabs.netWorth", "Net Worth")]
|
|
168
201
|
}),
|
|
169
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ E(G, {
|
|
170
203
|
value: "holdings",
|
|
171
|
-
children: [/* @__PURE__ */
|
|
204
|
+
children: [/* @__PURE__ */ T(y, {
|
|
172
205
|
className: "size-4",
|
|
173
206
|
"aria-hidden": "true"
|
|
174
|
-
}),
|
|
207
|
+
}), n("brainyrich.reports.tabs.holdings", "Holdings")]
|
|
175
208
|
}),
|
|
176
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ E(G, {
|
|
177
210
|
value: "transactions",
|
|
178
|
-
children: [/* @__PURE__ */
|
|
211
|
+
children: [/* @__PURE__ */ T(x, {
|
|
179
212
|
className: "size-4",
|
|
180
213
|
"aria-hidden": "true"
|
|
181
|
-
}),
|
|
214
|
+
}), n("brainyrich.reports.tabs.ledger", "Ledger")]
|
|
182
215
|
})
|
|
183
216
|
] })
|
|
184
217
|
}),
|
|
185
|
-
|
|
186
|
-
query:
|
|
187
|
-
translate:
|
|
188
|
-
}) :
|
|
189
|
-
query:
|
|
190
|
-
holdings:
|
|
191
|
-
translate:
|
|
192
|
-
}) : /* @__PURE__ */
|
|
193
|
-
query:
|
|
194
|
-
transactions:
|
|
195
|
-
translate:
|
|
218
|
+
a === "networth" ? /* @__PURE__ */ T(Q, {
|
|
219
|
+
query: s,
|
|
220
|
+
translate: n
|
|
221
|
+
}) : a === "holdings" ? /* @__PURE__ */ T(te, {
|
|
222
|
+
query: l,
|
|
223
|
+
holdings: D,
|
|
224
|
+
translate: n
|
|
225
|
+
}) : /* @__PURE__ */ T(ne, {
|
|
226
|
+
query: d,
|
|
227
|
+
transactions: O,
|
|
228
|
+
translate: n
|
|
196
229
|
})
|
|
197
230
|
]
|
|
198
231
|
});
|
|
199
232
|
}
|
|
200
|
-
function
|
|
201
|
-
let n = e.data, r = n?.currency ?? "USD",
|
|
233
|
+
function Q({ query: e, translate: t }) {
|
|
234
|
+
let n = e.data, r = n?.currency ?? "USD", i = m(() => {
|
|
202
235
|
if (!n) return [];
|
|
203
236
|
let e = n.byAssetClass.reduce((e, t) => e + t.marketValue, 0);
|
|
204
237
|
return e <= 0 ? [] : n.byAssetClass.slice().sort((e, t) => t.marketValue - e.marketValue).map((t) => ({
|
|
205
238
|
label: t.assetClass.replace(/_/g, " "),
|
|
206
239
|
value: t.marketValue / e * 100,
|
|
207
|
-
caption:
|
|
240
|
+
caption: p(t.marketValue, r)
|
|
208
241
|
}));
|
|
209
242
|
}, [n, r]);
|
|
210
|
-
return /* @__PURE__ */
|
|
243
|
+
return /* @__PURE__ */ E(O, { children: [/* @__PURE__ */ E(j, { children: [/* @__PURE__ */ E(M, {
|
|
211
244
|
className: "flex items-center gap-2",
|
|
212
|
-
children: [/* @__PURE__ */
|
|
245
|
+
children: [/* @__PURE__ */ T(S, {
|
|
213
246
|
className: "size-5",
|
|
214
247
|
"aria-hidden": "true"
|
|
215
248
|
}), t("brainyrich.reports.netWorth.title", "Net Worth Statement")]
|
|
216
|
-
}), /* @__PURE__ */
|
|
249
|
+
}), /* @__PURE__ */ T(A, { children: t("brainyrich.reports.netWorth.description", "Consolidated assets, cash, and asset-class allocation as of today.") })] }), /* @__PURE__ */ T(k, { children: e.isLoading ? /* @__PURE__ */ T(l, { rows: 3 }) : e.isError ? /* @__PURE__ */ T(s, { onRetry: () => e.refetch() }) : n ? /* @__PURE__ */ E("div", {
|
|
217
250
|
className: "space-y-6",
|
|
218
|
-
children: [/* @__PURE__ */
|
|
251
|
+
children: [/* @__PURE__ */ E("div", {
|
|
219
252
|
className: "grid gap-4 sm:grid-cols-3",
|
|
220
253
|
children: [
|
|
221
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ T($, {
|
|
222
255
|
label: t("brainyrich.reports.netWorth.total", "Total Net Worth"),
|
|
223
|
-
value:
|
|
256
|
+
value: p(n.totalNetWorth, r),
|
|
224
257
|
emphasis: !0
|
|
225
258
|
}),
|
|
226
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ T($, {
|
|
227
260
|
label: t("brainyrich.reports.netWorth.invested", "Invested Value"),
|
|
228
|
-
value:
|
|
261
|
+
value: p(n.totalMarketValue, r)
|
|
229
262
|
}),
|
|
230
|
-
/* @__PURE__ */
|
|
263
|
+
/* @__PURE__ */ T($, {
|
|
231
264
|
label: t("brainyrich.reports.netWorth.cash", "Cash & Liquidity"),
|
|
232
|
-
value:
|
|
265
|
+
value: p(n.totalCash, r)
|
|
233
266
|
})
|
|
234
267
|
]
|
|
235
|
-
}), /* @__PURE__ */
|
|
268
|
+
}), /* @__PURE__ */ E("div", {
|
|
236
269
|
className: "space-y-3",
|
|
237
|
-
children: [/* @__PURE__ */
|
|
270
|
+
children: [/* @__PURE__ */ T("p", {
|
|
238
271
|
className: "text-sm font-medium text-text-primary",
|
|
239
272
|
children: t("brainyrich.reports.netWorth.allocation", "Allocation by Asset Class")
|
|
240
|
-
}),
|
|
273
|
+
}), i.length > 0 ? /* @__PURE__ */ T(a, { data: i }) : /* @__PURE__ */ T("p", {
|
|
241
274
|
className: "text-sm text-text-secondary",
|
|
242
275
|
children: t("brainyrich.reports.netWorth.noAllocation", "No holdings to allocate yet.")
|
|
243
276
|
})]
|
|
244
277
|
})]
|
|
245
|
-
}) : /* @__PURE__ */
|
|
246
|
-
icon: /* @__PURE__ */
|
|
278
|
+
}) : /* @__PURE__ */ T(o, {
|
|
279
|
+
icon: /* @__PURE__ */ T(S, {
|
|
247
280
|
className: "size-6",
|
|
248
281
|
"aria-hidden": "true"
|
|
249
282
|
}),
|
|
@@ -251,80 +284,80 @@ function J({ query: e, translate: t }) {
|
|
|
251
284
|
description: t("brainyrich.reports.netWorth.emptyDesc", "Link an account and add holdings to generate a net-worth statement.")
|
|
252
285
|
}) })] });
|
|
253
286
|
}
|
|
254
|
-
function
|
|
255
|
-
return /* @__PURE__ */
|
|
287
|
+
function $({ label: e, value: t, emphasis: n }) {
|
|
288
|
+
return /* @__PURE__ */ E("div", {
|
|
256
289
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
257
|
-
children: [/* @__PURE__ */
|
|
290
|
+
children: [/* @__PURE__ */ T("p", {
|
|
258
291
|
className: "text-xs text-text-secondary",
|
|
259
292
|
children: e
|
|
260
|
-
}), /* @__PURE__ */
|
|
293
|
+
}), /* @__PURE__ */ T("p", {
|
|
261
294
|
className: n ? "mt-1 text-2xl font-semibold text-text-primary" : "mt-1 text-xl font-semibold text-text-primary",
|
|
262
295
|
children: t
|
|
263
296
|
})]
|
|
264
297
|
});
|
|
265
298
|
}
|
|
266
|
-
function
|
|
267
|
-
return /* @__PURE__ */
|
|
299
|
+
function te({ query: e, holdings: t, translate: n }) {
|
|
300
|
+
return /* @__PURE__ */ E(O, { children: [/* @__PURE__ */ E(j, { children: [/* @__PURE__ */ E(M, {
|
|
268
301
|
className: "flex items-center gap-2",
|
|
269
|
-
children: [/* @__PURE__ */
|
|
302
|
+
children: [/* @__PURE__ */ T(y, {
|
|
270
303
|
className: "size-5",
|
|
271
304
|
"aria-hidden": "true"
|
|
272
305
|
}), n("brainyrich.reports.holdings.title", "Holdings Schedule")]
|
|
273
|
-
}), /* @__PURE__ */
|
|
306
|
+
}), /* @__PURE__ */ T(A, { children: n("brainyrich.reports.holdings.description", "Every position across your portfolios with cost basis and market value.") })] }), /* @__PURE__ */ T(k, { children: e.isLoading ? /* @__PURE__ */ T(l, { rows: 4 }) : e.isError ? /* @__PURE__ */ T(s, { onRetry: () => e.refetch() }) : t.length > 0 ? /* @__PURE__ */ T("div", {
|
|
274
307
|
className: "overflow-x-auto",
|
|
275
|
-
children: /* @__PURE__ */
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
-
/* @__PURE__ */
|
|
308
|
+
children: /* @__PURE__ */ E(L, { children: [/* @__PURE__ */ T(V, { children: /* @__PURE__ */ E(H, { children: [
|
|
309
|
+
/* @__PURE__ */ T(B, { children: n("brainyrich.reports.holdings.symbol", "Symbol") }),
|
|
310
|
+
/* @__PURE__ */ T(B, { children: n("brainyrich.reports.holdings.assetClass", "Asset Class") }),
|
|
311
|
+
/* @__PURE__ */ T(B, {
|
|
279
312
|
className: "text-right",
|
|
280
313
|
children: n("brainyrich.reports.holdings.quantity", "Quantity")
|
|
281
314
|
}),
|
|
282
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ T(B, {
|
|
283
316
|
className: "text-right",
|
|
284
317
|
children: n("brainyrich.reports.holdings.costBasis", "Cost Basis")
|
|
285
318
|
}),
|
|
286
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ T(B, {
|
|
287
320
|
className: "text-right",
|
|
288
321
|
children: n("brainyrich.reports.holdings.marketValue", "Market Value")
|
|
289
322
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ T(B, {
|
|
291
324
|
className: "text-right",
|
|
292
325
|
children: n("brainyrich.reports.holdings.gainLoss", "Unrealized")
|
|
293
326
|
})
|
|
294
|
-
] }) }), /* @__PURE__ */
|
|
327
|
+
] }) }), /* @__PURE__ */ T(R, { children: t.map((e) => {
|
|
295
328
|
let t = e.marketValue - e.costBasis;
|
|
296
|
-
return /* @__PURE__ */
|
|
297
|
-
/* @__PURE__ */
|
|
329
|
+
return /* @__PURE__ */ E(H, { children: [
|
|
330
|
+
/* @__PURE__ */ E(z, { children: [/* @__PURE__ */ T("div", {
|
|
298
331
|
className: "font-medium text-text-primary",
|
|
299
332
|
children: e.symbol
|
|
300
|
-
}), e.name ? /* @__PURE__ */
|
|
333
|
+
}), e.name ? /* @__PURE__ */ T("div", {
|
|
301
334
|
className: "text-xs text-text-secondary",
|
|
302
335
|
children: e.name
|
|
303
336
|
}) : null] }),
|
|
304
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ T(z, { children: /* @__PURE__ */ T(D, {
|
|
305
338
|
variant: "outline",
|
|
306
339
|
children: e.assetClass.replace(/_/g, " ")
|
|
307
340
|
}) }),
|
|
308
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ T(z, {
|
|
309
342
|
className: "text-right tabular-nums text-text-primary",
|
|
310
343
|
children: e.quantity
|
|
311
344
|
}),
|
|
312
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ T(z, {
|
|
313
346
|
className: "text-right tabular-nums text-text-primary",
|
|
314
|
-
children:
|
|
347
|
+
children: p(e.costBasis, e.currency)
|
|
315
348
|
}),
|
|
316
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ T(z, {
|
|
317
350
|
className: "text-right tabular-nums text-text-primary",
|
|
318
|
-
children:
|
|
351
|
+
children: p(e.marketValue, e.currency)
|
|
319
352
|
}),
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
className: `text-right tabular-nums font-medium ${
|
|
322
|
-
children: [t > 0 ? "+" : "",
|
|
353
|
+
/* @__PURE__ */ E(z, {
|
|
354
|
+
className: `text-right tabular-nums font-medium ${d(t)}`,
|
|
355
|
+
children: [t > 0 ? "+" : "", p(t, e.currency)]
|
|
323
356
|
})
|
|
324
357
|
] }, e.id);
|
|
325
358
|
}) })] })
|
|
326
|
-
}) : /* @__PURE__ */
|
|
327
|
-
icon: /* @__PURE__ */
|
|
359
|
+
}) : /* @__PURE__ */ T(o, {
|
|
360
|
+
icon: /* @__PURE__ */ T(y, {
|
|
328
361
|
className: "size-6",
|
|
329
362
|
"aria-hidden": "true"
|
|
330
363
|
}),
|
|
@@ -332,59 +365,59 @@ function X({ query: e, holdings: t, translate: n }) {
|
|
|
332
365
|
description: n("brainyrich.reports.holdings.emptyDesc", "Add holdings to your portfolios to generate a holdings schedule.")
|
|
333
366
|
}) })] });
|
|
334
367
|
}
|
|
335
|
-
function
|
|
336
|
-
return /* @__PURE__ */
|
|
368
|
+
function ne({ query: e, transactions: t, translate: n }) {
|
|
369
|
+
return /* @__PURE__ */ E(O, { children: [/* @__PURE__ */ E(j, { children: [/* @__PURE__ */ E(M, {
|
|
337
370
|
className: "flex items-center gap-2",
|
|
338
|
-
children: [/* @__PURE__ */
|
|
371
|
+
children: [/* @__PURE__ */ T(x, {
|
|
339
372
|
className: "size-5",
|
|
340
373
|
"aria-hidden": "true"
|
|
341
374
|
}), n("brainyrich.reports.ledger.title", "Transaction Ledger")]
|
|
342
|
-
}), /* @__PURE__ */
|
|
375
|
+
}), /* @__PURE__ */ T(A, { children: n("brainyrich.reports.ledger.description", "Every recorded transaction across your accounts, newest first.") })] }), /* @__PURE__ */ T(k, { children: e.isLoading ? /* @__PURE__ */ T(l, { rows: 4 }) : e.isError ? /* @__PURE__ */ T(s, { onRetry: () => e.refetch() }) : t.length > 0 ? /* @__PURE__ */ T("div", {
|
|
343
376
|
className: "overflow-x-auto",
|
|
344
|
-
children: /* @__PURE__ */
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
/* @__PURE__ */
|
|
348
|
-
/* @__PURE__ */
|
|
377
|
+
children: /* @__PURE__ */ E(L, { children: [/* @__PURE__ */ T(V, { children: /* @__PURE__ */ E(H, { children: [
|
|
378
|
+
/* @__PURE__ */ T(B, { children: n("brainyrich.reports.ledger.date", "Trade Date") }),
|
|
379
|
+
/* @__PURE__ */ T(B, { children: n("brainyrich.reports.ledger.type", "Type") }),
|
|
380
|
+
/* @__PURE__ */ T(B, { children: n("brainyrich.reports.ledger.symbol", "Symbol") }),
|
|
381
|
+
/* @__PURE__ */ T(B, {
|
|
349
382
|
className: "text-right",
|
|
350
383
|
children: n("brainyrich.reports.ledger.quantity", "Quantity")
|
|
351
384
|
}),
|
|
352
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ T(B, {
|
|
353
386
|
className: "text-right",
|
|
354
387
|
children: n("brainyrich.reports.ledger.price", "Price")
|
|
355
388
|
}),
|
|
356
|
-
/* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ T(B, {
|
|
357
390
|
className: "text-right",
|
|
358
391
|
children: n("brainyrich.reports.ledger.amount", "Amount")
|
|
359
392
|
})
|
|
360
|
-
] }) }), /* @__PURE__ */
|
|
361
|
-
/* @__PURE__ */
|
|
393
|
+
] }) }), /* @__PURE__ */ T(R, { children: t.map((e) => /* @__PURE__ */ E(H, { children: [
|
|
394
|
+
/* @__PURE__ */ T(z, {
|
|
362
395
|
className: "text-text-primary",
|
|
363
|
-
children:
|
|
396
|
+
children: f(e.tradeDate)
|
|
364
397
|
}),
|
|
365
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ T(z, { children: /* @__PURE__ */ T(D, {
|
|
366
399
|
variant: "outline",
|
|
367
400
|
children: e.type
|
|
368
401
|
}) }),
|
|
369
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ T(z, {
|
|
370
403
|
className: "text-text-primary",
|
|
371
404
|
children: e.symbol ?? "—"
|
|
372
405
|
}),
|
|
373
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ T(z, {
|
|
374
407
|
className: "text-right tabular-nums text-text-primary",
|
|
375
408
|
children: e.quantity
|
|
376
409
|
}),
|
|
377
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ T(z, {
|
|
378
411
|
className: "text-right tabular-nums text-text-primary",
|
|
379
|
-
children:
|
|
412
|
+
children: p(e.price, e.currency)
|
|
380
413
|
}),
|
|
381
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ T(z, {
|
|
382
415
|
className: "text-right tabular-nums text-text-primary",
|
|
383
|
-
children:
|
|
416
|
+
children: p(e.amount, e.currency)
|
|
384
417
|
})
|
|
385
418
|
] }, e.id)) })] })
|
|
386
|
-
}) : /* @__PURE__ */
|
|
387
|
-
icon: /* @__PURE__ */
|
|
419
|
+
}) : /* @__PURE__ */ T(o, {
|
|
420
|
+
icon: /* @__PURE__ */ T(v, {
|
|
388
421
|
className: "size-6",
|
|
389
422
|
"aria-hidden": "true"
|
|
390
423
|
}),
|
|
@@ -393,6 +426,6 @@ function Z({ query: e, transactions: t, translate: n }) {
|
|
|
393
426
|
}) })] });
|
|
394
427
|
}
|
|
395
428
|
//#endregion
|
|
396
|
-
export {
|
|
429
|
+
export { Z as ReportsPage };
|
|
397
430
|
|
|
398
431
|
//# sourceMappingURL=ReportsPage.js.map
|