@burdenoff/microfe-brainyrich 2026.706.4 → 2026.713.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.d.ts +5 -0
- package/dist/brainyrich/BrainyRichRoot.d.ts.map +1 -0
- package/dist/brainyrich/BrainyRichRoutes.d.ts +2 -0
- package/dist/brainyrich/BrainyRichRoutes.d.ts.map +1 -0
- package/dist/brainyrich/BrainyRichRoutes.js +27 -15
- package/dist/brainyrich/BrainyRichRoutes.js.map +1 -1
- package/dist/brainyrich/components/ActorName.d.ts +26 -0
- package/dist/brainyrich/components/ActorName.d.ts.map +1 -0
- package/dist/brainyrich/components/ConfirmDialog.d.ts +20 -0
- package/dist/brainyrich/components/ConfirmDialog.d.ts.map +1 -0
- package/dist/brainyrich/components/LoadMore.d.ts +21 -0
- package/dist/brainyrich/components/LoadMore.d.ts.map +1 -0
- package/dist/brainyrich/components/index.d.ts +11 -0
- package/dist/brainyrich/components/index.d.ts.map +1 -0
- package/dist/brainyrich/components/notify.d.ts +33 -0
- package/dist/brainyrich/components/notify.d.ts.map +1 -0
- package/dist/brainyrich/components/pickers.d.ts +63 -0
- package/dist/brainyrich/components/pickers.d.ts.map +1 -0
- package/dist/brainyrich/components/reuse/CommentThread.d.ts +35 -0
- package/dist/brainyrich/components/reuse/CommentThread.d.ts.map +1 -0
- package/dist/brainyrich/components/reuse/DocumentsPanel.d.ts +33 -0
- package/dist/brainyrich/components/reuse/DocumentsPanel.d.ts.map +1 -0
- package/dist/brainyrich/components/reuse/TagField.d.ts +34 -0
- package/dist/brainyrich/components/reuse/TagField.d.ts.map +1 -0
- package/dist/brainyrich/components/reuse/transport.d.ts +20 -0
- package/dist/brainyrich/components/reuse/transport.d.ts.map +1 -0
- package/dist/brainyrich/components/viz.d.ts +129 -0
- package/dist/brainyrich/components/viz.d.ts.map +1 -0
- package/dist/brainyrich/components/viz.js.map +1 -1
- package/dist/brainyrich/hooks/useBrainyRichAnalytics.d.ts +17 -0
- package/dist/brainyrich/hooks/useBrainyRichAnalytics.d.ts.map +1 -0
- package/dist/brainyrich/hooks/useBrainyRichAnalytics.js +24 -0
- package/dist/brainyrich/hooks/useBrainyRichAnalytics.js.map +1 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.d.ts +2125 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.d.ts.map +1 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.js +1 -1
- package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -1
- package/dist/brainyrich/index.d.ts +6 -0
- package/dist/brainyrich/index.d.ts.map +1 -0
- package/dist/brainyrich/index.js +1 -0
- package/dist/brainyrich/pages/AccountsPage.d.ts +2 -0
- package/dist/brainyrich/pages/AccountsPage.d.ts.map +1 -0
- package/dist/brainyrich/pages/AccountsPage.js +608 -593
- package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
- package/dist/brainyrich/pages/AiAssistantPage.d.ts +2 -0
- package/dist/brainyrich/pages/AiAssistantPage.d.ts.map +1 -0
- package/dist/brainyrich/pages/AnalyticsPage.d.ts +2 -0
- package/dist/brainyrich/pages/AnalyticsPage.d.ts.map +1 -0
- package/dist/brainyrich/pages/DashboardPage.d.ts +2 -0
- package/dist/brainyrich/pages/DashboardPage.d.ts.map +1 -0
- package/dist/brainyrich/pages/DashboardPage.js +264 -256
- package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
- package/dist/brainyrich/pages/FamilyPage.d.ts +2 -0
- package/dist/brainyrich/pages/FamilyPage.d.ts.map +1 -0
- package/dist/brainyrich/pages/FamilyPage.js +467 -446
- package/dist/brainyrich/pages/FamilyPage.js.map +1 -1
- package/dist/brainyrich/pages/GoalsPage.d.ts +2 -0
- package/dist/brainyrich/pages/GoalsPage.d.ts.map +1 -0
- package/dist/brainyrich/pages/GoalsPage.js +553 -531
- package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
- package/dist/brainyrich/pages/InvestmentsPage.d.ts +2 -0
- package/dist/brainyrich/pages/InvestmentsPage.d.ts.map +1 -0
- package/dist/brainyrich/pages/PortfoliosPage.d.ts +2 -0
- package/dist/brainyrich/pages/PortfoliosPage.d.ts.map +1 -0
- package/dist/brainyrich/pages/PortfoliosPage.js +378 -354
- package/dist/brainyrich/pages/PortfoliosPage.js.map +1 -1
- package/dist/brainyrich/pages/ReportsPage.d.ts +2 -0
- package/dist/brainyrich/pages/ReportsPage.d.ts.map +1 -0
- package/dist/brainyrich/pages/RiskPage.d.ts +2 -0
- package/dist/brainyrich/pages/RiskPage.d.ts.map +1 -0
- package/dist/brainyrich/pages/TaxPage.d.ts +2 -0
- package/dist/brainyrich/pages/TaxPage.d.ts.map +1 -0
- package/dist/brainyrich/pages/_shared.d.ts +77 -0
- package/dist/brainyrich/pages/_shared.d.ts.map +1 -0
- package/dist/brainyrich/providers/BrainyRichProvider.d.ts +6 -0
- package/dist/brainyrich/providers/BrainyRichProvider.d.ts.map +1 -0
- package/dist/brainyrich/services/createSandboxAssistantTransport.d.ts +24 -0
- package/dist/brainyrich/services/createSandboxAssistantTransport.d.ts.map +1 -0
- package/dist/brainyrich/services/createSandboxAssistantTransport.js +14 -0
- package/dist/brainyrich/services/createSandboxAssistantTransport.js.map +1 -0
- package/dist/brainyrich/types/bra.d.ts +394 -0
- package/dist/brainyrich/types/bra.d.ts.map +1 -0
- package/dist/brainyrich/types/index.d.ts +39 -0
- package/dist/brainyrich/types/index.d.ts.map +1 -0
- package/dist/brainyrich/utils/cn.d.ts +4 -0
- package/dist/brainyrich/utils/cn.d.ts.map +1 -0
- package/dist/brainyrich/utils/i18n.d.ts +6 -0
- package/dist/brainyrich/utils/i18n.d.ts.map +1 -0
- package/dist/brainyrich/utils/nativeControls.d.ts +12 -0
- package/dist/brainyrich/utils/nativeControls.d.ts.map +1 -0
- package/dist/brainyrich/utils/nativeControls.js +12 -0
- package/dist/brainyrich/utils/nativeControls.js.map +1 -0
- package/dist/brainyrich/utils/navigation.d.ts +2 -0
- package/dist/brainyrich/utils/navigation.d.ts.map +1 -0
- package/dist/brainyrich/utils/pageContext.d.ts +30 -0
- package/dist/brainyrich/utils/pageContext.d.ts.map +1 -0
- package/dist/brainyrich/utils/pageContext.js +46 -0
- package/dist/brainyrich/utils/pageContext.js.map +1 -0
- package/dist/dev/main.d.ts +2 -0
- package/dist/dev/main.d.ts.map +1 -0
- package/dist/generated/global-operations.d.ts +2 -0
- package/dist/generated/global-operations.d.ts.map +1 -0
- package/dist/generated/global-types.d.ts +18199 -0
- package/dist/generated/global-types.d.ts.map +1 -0
- package/dist/generated/wspace-operations.d.ts +2 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -0
- package/dist/generated/wspace-types.d.ts +43046 -0
- package/dist/generated/wspace-types.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -1
- package/package.json +6 -2
|
@@ -4,15 +4,17 @@ import { LoadMore as te } from "../components/LoadMore.js";
|
|
|
4
4
|
import { ConfirmDialog as ne } from "../components/ConfirmDialog.js";
|
|
5
5
|
import { FadeIn as d, GlassCard as re, MiniAreaChart as ie, ProgressRing as ae, StatTile as f } from "../components/viz.js";
|
|
6
6
|
import "../components/index.js";
|
|
7
|
-
import { EmptyState as oe, ErrorState as se, LoadingState as ce, SectionShell as p, formatCompact as le, formatDate as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
7
|
+
import { EmptyState as oe, ErrorState as se, LoadingState as ce, SectionShell as p, formatCompact as le, formatDate as m, formatMoney as h, formatPct as ue, statusBadgeVariant as de } from "./_shared.js";
|
|
8
|
+
import { hapticSuccess as g, showToast as _ } from "../utils/nativeControls.js";
|
|
9
|
+
import { useTrackBrainyRichPageView as v } from "../hooks/useBrainyRichAnalytics.js";
|
|
10
|
+
import { TagField as y } from "../components/reuse/TagField.js";
|
|
11
|
+
import { useMemo as b, useState as x } from "react";
|
|
12
|
+
import { AlertTriangle as S, CalendarClock as fe, Coins as pe, LineChart as me, Link2 as he, MoreHorizontal as C, PiggyBank as ge, Plus as w, RefreshCw as _e, Target as T, Trash2 as ve, TrendingDown as E, TrendingUp as D, Unlink as O, Wallet as k } from "lucide-react";
|
|
13
|
+
import { useI18n as A } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
14
|
+
import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
15
|
+
import { Badge as ye, Button as P, Card as be, CardContent as xe, CardDescription as F, CardHeader as I, CardTitle as L, Dialog as R, DialogContent as z, DialogDescription as B, DialogFooter as V, DialogHeader as H, DialogTitle as U, DropdownMenu as Se, DropdownMenuContent as Ce, DropdownMenuItem as we, DropdownMenuSeparator as Te, DropdownMenuTrigger as Ee, Input as W, Label as G, Select as K, SelectContent as q, SelectItem as J, SelectTrigger as Y, SelectValue as X, Sheet as De, SheetContent as Oe, SheetDescription as ke, SheetHeader as Ae, SheetTitle as je, Table as Me, TableBody as Ne, TableCell as Z, TableHead as Q, TableHeader as Pe, TableRow as Fe, Textarea as Ie } from "@burdenoff/fe-libs/ui";
|
|
14
16
|
//#region src/brainyrich/pages/GoalsPage.tsx
|
|
15
|
-
var
|
|
17
|
+
var Le = [
|
|
16
18
|
"RETIREMENT",
|
|
17
19
|
"EDUCATION",
|
|
18
20
|
"HOME",
|
|
@@ -20,39 +22,39 @@ var Fe = [
|
|
|
20
22
|
"MAJOR_PURCHASE",
|
|
21
23
|
"WEALTH_GROWTH",
|
|
22
24
|
"CUSTOM"
|
|
23
|
-
],
|
|
25
|
+
], Re = [
|
|
24
26
|
"ACTIVE",
|
|
25
27
|
"ACHIEVED",
|
|
26
28
|
"ON_HOLD",
|
|
27
29
|
"ABANDONED"
|
|
28
30
|
];
|
|
29
|
-
function
|
|
31
|
+
function ze(e) {
|
|
30
32
|
switch (e) {
|
|
31
33
|
case "AHEAD":
|
|
32
34
|
case "ON_TRACK": return {
|
|
33
|
-
icon:
|
|
35
|
+
icon: D,
|
|
34
36
|
tone: "text-status-success-text"
|
|
35
37
|
};
|
|
36
38
|
case "BEHIND": return {
|
|
37
|
-
icon:
|
|
39
|
+
icon: E,
|
|
38
40
|
tone: "text-status-warning-text"
|
|
39
41
|
};
|
|
40
42
|
default: return {
|
|
41
|
-
icon:
|
|
43
|
+
icon: S,
|
|
42
44
|
tone: "text-status-error-text"
|
|
43
45
|
};
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
|
-
function
|
|
48
|
+
function $(e) {
|
|
47
49
|
return e.toLowerCase().split("_").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
|
|
48
50
|
}
|
|
49
|
-
function
|
|
51
|
+
function Be(e) {
|
|
50
52
|
return e.fundings.reduce((e, t) => e + (t.fixedAmount ?? 0), 0);
|
|
51
53
|
}
|
|
52
|
-
function
|
|
53
|
-
return e.status === "ACHIEVED" ? 100 : e.targetAmount > 0 ? Math.max(0, Math.min(100,
|
|
54
|
+
function Ve(e) {
|
|
55
|
+
return e.status === "ACHIEVED" ? 100 : e.targetAmount > 0 ? Math.max(0, Math.min(100, Be(e) / e.targetAmount * 100)) : 0;
|
|
54
56
|
}
|
|
55
|
-
function
|
|
57
|
+
function He(e, t) {
|
|
56
58
|
if (e === "ACHIEVED") return "success";
|
|
57
59
|
switch (t) {
|
|
58
60
|
case "AHEAD":
|
|
@@ -61,7 +63,7 @@ function Be(e, t) {
|
|
|
61
63
|
default: return "error";
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
|
-
function
|
|
66
|
+
function Ue(e, t, n) {
|
|
65
67
|
if (!n) return [];
|
|
66
68
|
let r = new Date(n);
|
|
67
69
|
if (Number.isNaN(r.getTime())) return [];
|
|
@@ -80,12 +82,12 @@ function Ve(e, t, n) {
|
|
|
80
82
|
}
|
|
81
83
|
return c;
|
|
82
84
|
}
|
|
83
|
-
function
|
|
85
|
+
function We(e) {
|
|
84
86
|
if (!e) return "";
|
|
85
87
|
let t = new Date(e);
|
|
86
88
|
return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 10);
|
|
87
89
|
}
|
|
88
|
-
function
|
|
90
|
+
function Ge() {
|
|
89
91
|
return {
|
|
90
92
|
name: "",
|
|
91
93
|
type: "CUSTOM",
|
|
@@ -99,13 +101,13 @@ function Ue() {
|
|
|
99
101
|
notes: ""
|
|
100
102
|
};
|
|
101
103
|
}
|
|
102
|
-
function
|
|
104
|
+
function Ke(e) {
|
|
103
105
|
return {
|
|
104
106
|
name: e.name,
|
|
105
107
|
type: e.type,
|
|
106
108
|
status: e.status,
|
|
107
109
|
targetAmount: String(e.targetAmount),
|
|
108
|
-
targetDate:
|
|
110
|
+
targetDate: We(e.targetDate),
|
|
109
111
|
monthlyContribution: String(e.monthlyContribution),
|
|
110
112
|
priority: String(e.priority),
|
|
111
113
|
currency: e.currency,
|
|
@@ -113,369 +115,381 @@ function We(e) {
|
|
|
113
115
|
notes: e.notes ?? ""
|
|
114
116
|
};
|
|
115
117
|
}
|
|
116
|
-
var
|
|
117
|
-
function
|
|
118
|
-
let { t } =
|
|
118
|
+
var qe = "__none__";
|
|
119
|
+
function Je() {
|
|
120
|
+
let { t } = A(), i = (n, r, i) => e(t, n, r, i);
|
|
121
|
+
v("brainyrich.goals.viewed");
|
|
122
|
+
let { items: a, hasMore: s, loadMore: l, isFetchingNextPage: u, isLoading: re, isError: ie, refetch: le } = c(), { data: ue } = o(), y = r(), me = ee(), E = n(), [D, O] = x(!1), [k, R] = x(null), [z, B] = x(null), [V, H] = x(null), [U, W] = x(Ge), G = (e, t) => W((n) => ({
|
|
119
123
|
...n,
|
|
120
124
|
[e]: t
|
|
121
|
-
})),
|
|
125
|
+
})), K = b(() => ({
|
|
122
126
|
totalTarget: a.reduce((e, t) => e + t.targetAmount, 0),
|
|
123
127
|
totalMonthly: a.reduce((e, t) => e + t.monthlyContribution, 0),
|
|
124
128
|
atRisk: a.filter((e) => e.projection === "AT_RISK" || e.projection === "BEHIND").length
|
|
125
|
-
}), [a]),
|
|
126
|
-
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
},
|
|
130
|
-
return /* @__PURE__ */
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
description: i("brainyrich.goals.empty.description", "Create your first goal to start tracking progress toward a milestone."),
|
|
147
|
-
action: /* @__PURE__ */ A(M, {
|
|
148
|
-
size: "sm",
|
|
149
|
-
onClick: q,
|
|
150
|
-
children: [/* @__PURE__ */ k(x, {
|
|
151
|
-
className: "size-4",
|
|
129
|
+
}), [a]), q = a[0]?.currency ?? "USD", J = () => {
|
|
130
|
+
W(Ge()), O(!0);
|
|
131
|
+
}, Y = (e) => {
|
|
132
|
+
W(Ke(e)), R(e);
|
|
133
|
+
}, X = U.name.trim().length > 0 && Number(U.targetAmount) > 0 && U.targetDate.length > 0;
|
|
134
|
+
return /* @__PURE__ */ N("div", {
|
|
135
|
+
"data-tour": "brainyrich-page-goals",
|
|
136
|
+
className: "contents",
|
|
137
|
+
children: [
|
|
138
|
+
/* @__PURE__ */ M(p, {
|
|
139
|
+
title: i("brainyrich.goals.title", "Financial Goals"),
|
|
140
|
+
description: i("brainyrich.goals.description", "Track progress toward your wealth milestones and life objectives"),
|
|
141
|
+
actionLabel: i("brainyrich.goals.actions.createGoal", "New goal"),
|
|
142
|
+
onAction: J,
|
|
143
|
+
children: re ? /* @__PURE__ */ M(ce, { rows: 4 }) : ie ? /* @__PURE__ */ M(se, {
|
|
144
|
+
title: i("brainyrich.goals.error.title", "Could not load goals"),
|
|
145
|
+
description: i("brainyrich.goals.error.description", "We could not reach the goals service. Please try again."),
|
|
146
|
+
onRetry: () => le()
|
|
147
|
+
}) : a.length === 0 ? /* @__PURE__ */ M(oe, {
|
|
148
|
+
icon: /* @__PURE__ */ M(T, {
|
|
149
|
+
className: "size-6",
|
|
152
150
|
"aria-hidden": "true"
|
|
153
|
-
}),
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
"
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
"
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
"
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
151
|
+
}),
|
|
152
|
+
title: i("brainyrich.goals.empty.title", "No financial goals yet"),
|
|
153
|
+
description: i("brainyrich.goals.empty.description", "Create your first goal to start tracking progress toward a milestone."),
|
|
154
|
+
action: /* @__PURE__ */ N(P, {
|
|
155
|
+
size: "sm",
|
|
156
|
+
onClick: J,
|
|
157
|
+
children: [/* @__PURE__ */ M(w, {
|
|
158
|
+
className: "size-4",
|
|
159
|
+
"aria-hidden": "true"
|
|
160
|
+
}), i("brainyrich.goals.actions.createGoal", "New goal")]
|
|
161
|
+
})
|
|
162
|
+
}) : /* @__PURE__ */ N(j, { children: [
|
|
163
|
+
/* @__PURE__ */ N("div", {
|
|
164
|
+
className: "grid gap-4 sm:grid-cols-2 xl:grid-cols-4",
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ M(d, {
|
|
167
|
+
index: 0,
|
|
168
|
+
children: /* @__PURE__ */ M(f, {
|
|
169
|
+
glow: !0,
|
|
170
|
+
icon: /* @__PURE__ */ M(T, {
|
|
171
|
+
className: "size-4",
|
|
172
|
+
"aria-hidden": "true"
|
|
173
|
+
}),
|
|
174
|
+
label: i("brainyrich.goals.metrics.activeGoals", "Goals"),
|
|
175
|
+
value: String(a.length)
|
|
176
|
+
})
|
|
177
|
+
}),
|
|
178
|
+
/* @__PURE__ */ M(d, {
|
|
179
|
+
index: 1,
|
|
180
|
+
children: /* @__PURE__ */ M(f, {
|
|
181
|
+
icon: /* @__PURE__ */ M(ge, {
|
|
182
|
+
className: "size-4",
|
|
183
|
+
"aria-hidden": "true"
|
|
184
|
+
}),
|
|
185
|
+
label: i("brainyrich.goals.metrics.totalTarget", "Total target"),
|
|
186
|
+
value: h(K.totalTarget, q)
|
|
187
|
+
})
|
|
188
|
+
}),
|
|
189
|
+
/* @__PURE__ */ M(d, {
|
|
190
|
+
index: 2,
|
|
191
|
+
children: /* @__PURE__ */ M(f, {
|
|
192
|
+
icon: /* @__PURE__ */ M(pe, {
|
|
193
|
+
className: "size-4",
|
|
194
|
+
"aria-hidden": "true"
|
|
195
|
+
}),
|
|
196
|
+
label: i("brainyrich.goals.metrics.monthly", "Monthly contributions"),
|
|
197
|
+
value: h(K.totalMonthly, q)
|
|
198
|
+
})
|
|
199
|
+
}),
|
|
200
|
+
/* @__PURE__ */ M(d, {
|
|
201
|
+
index: 3,
|
|
202
|
+
children: /* @__PURE__ */ M(f, {
|
|
203
|
+
icon: /* @__PURE__ */ M(S, {
|
|
204
|
+
className: "size-4",
|
|
205
|
+
"aria-hidden": "true"
|
|
206
|
+
}),
|
|
207
|
+
label: i("brainyrich.goals.metrics.atRisk", "Needs attention"),
|
|
208
|
+
value: String(K.atRisk),
|
|
209
|
+
className: K.atRisk > 0 ? "ring-1 ring-status-error-text/30" : void 0
|
|
210
|
+
})
|
|
203
211
|
})
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
className: "size-4 shrink-0 text-text-secondary",
|
|
225
|
-
"aria-hidden": "true"
|
|
226
|
-
}), /* @__PURE__ */ k("span", {
|
|
227
|
-
className: "truncate",
|
|
228
|
-
children: e.name
|
|
229
|
-
})]
|
|
230
|
-
}), /* @__PURE__ */ A(P, {
|
|
231
|
-
className: "mt-1 flex flex-wrap items-center gap-2",
|
|
232
|
-
children: [/* @__PURE__ */ k(j, {
|
|
233
|
-
variant: "outline",
|
|
234
|
-
children: Q(e.type)
|
|
235
|
-
}), /* @__PURE__ */ k(j, {
|
|
236
|
-
variant: fe(e.status),
|
|
237
|
-
children: Q(e.status)
|
|
238
|
-
})]
|
|
239
|
-
})]
|
|
240
|
-
}), /* @__PURE__ */ A(be, { children: [/* @__PURE__ */ k(we, {
|
|
241
|
-
asChild: !0,
|
|
242
|
-
children: /* @__PURE__ */ k(M, {
|
|
243
|
-
variant: "ghost",
|
|
244
|
-
size: "icon",
|
|
245
|
-
"aria-label": i("brainyrich.goals.actions.menu", "Goal actions"),
|
|
246
|
-
children: /* @__PURE__ */ k(b, {
|
|
247
|
-
className: "size-4",
|
|
248
|
-
"aria-hidden": "true"
|
|
249
|
-
})
|
|
250
|
-
})
|
|
251
|
-
}), /* @__PURE__ */ A(xe, {
|
|
252
|
-
align: "end",
|
|
253
|
-
children: [
|
|
254
|
-
/* @__PURE__ */ A(Se, {
|
|
255
|
-
onSelect: () => z(e.id),
|
|
256
|
-
children: [/* @__PURE__ */ k(he, {
|
|
257
|
-
className: "size-4",
|
|
258
|
-
"aria-hidden": "true"
|
|
259
|
-
}), i("brainyrich.goals.actions.manageFunding", "Manage funding")]
|
|
260
|
-
}),
|
|
261
|
-
/* @__PURE__ */ A(Se, {
|
|
262
|
-
onSelect: () => J(e),
|
|
263
|
-
children: [/* @__PURE__ */ k(_e, {
|
|
264
|
-
className: "size-4",
|
|
212
|
+
]
|
|
213
|
+
}),
|
|
214
|
+
/* @__PURE__ */ M("div", {
|
|
215
|
+
className: "grid gap-4 md:grid-cols-2 xl:grid-cols-3",
|
|
216
|
+
children: a.map((e, t) => {
|
|
217
|
+
let n = ze(e.projection), r = n.icon, a = He(e.status, e.projection), o = Ve(e);
|
|
218
|
+
return /* @__PURE__ */ M(d, {
|
|
219
|
+
index: t,
|
|
220
|
+
children: /* @__PURE__ */ N(be, {
|
|
221
|
+
className: `group flex h-full flex-col transition-shadow motion-safe:hover:shadow-[var(--shadow-pop-hover,var(--shadow-elevation-2))] ${e.status === "ACHIEVED" ? "ring-1 ring-status-success-text/30" : ""}`,
|
|
222
|
+
children: [/* @__PURE__ */ M(I, {
|
|
223
|
+
className: "pb-3",
|
|
224
|
+
children: /* @__PURE__ */ N("div", {
|
|
225
|
+
className: "flex items-start justify-between gap-2",
|
|
226
|
+
children: [/* @__PURE__ */ N("div", {
|
|
227
|
+
className: "min-w-0",
|
|
228
|
+
children: [/* @__PURE__ */ N(L, {
|
|
229
|
+
className: "flex items-center gap-2 text-base",
|
|
230
|
+
children: [/* @__PURE__ */ M(T, {
|
|
231
|
+
className: "size-4 shrink-0 text-text-secondary",
|
|
265
232
|
"aria-hidden": "true"
|
|
266
|
-
}),
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
children: [/* @__PURE__ */
|
|
233
|
+
}), /* @__PURE__ */ M("span", {
|
|
234
|
+
className: "truncate",
|
|
235
|
+
children: e.name
|
|
236
|
+
})]
|
|
237
|
+
}), /* @__PURE__ */ N(F, {
|
|
238
|
+
className: "mt-1 flex flex-wrap items-center gap-2",
|
|
239
|
+
children: [/* @__PURE__ */ M(ye, {
|
|
240
|
+
variant: "outline",
|
|
241
|
+
children: $(e.type)
|
|
242
|
+
}), /* @__PURE__ */ M(ye, {
|
|
243
|
+
variant: de(e.status),
|
|
244
|
+
children: $(e.status)
|
|
245
|
+
})]
|
|
246
|
+
})]
|
|
247
|
+
}), /* @__PURE__ */ N(Se, { children: [/* @__PURE__ */ M(Ee, {
|
|
248
|
+
asChild: !0,
|
|
249
|
+
children: /* @__PURE__ */ M(P, {
|
|
250
|
+
variant: "ghost",
|
|
251
|
+
size: "icon",
|
|
252
|
+
"aria-label": i("brainyrich.goals.actions.menu", "Goal actions"),
|
|
253
|
+
children: /* @__PURE__ */ M(C, {
|
|
273
254
|
className: "size-4",
|
|
274
255
|
"aria-hidden": "true"
|
|
275
|
-
})
|
|
256
|
+
})
|
|
276
257
|
})
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
})
|
|
280
|
-
}), /* @__PURE__ */ A(N, {
|
|
281
|
-
className: "flex flex-1 flex-col gap-4",
|
|
282
|
-
children: [
|
|
283
|
-
/* @__PURE__ */ A("div", {
|
|
284
|
-
className: "flex items-center gap-4",
|
|
285
|
-
children: [/* @__PURE__ */ k(ae, {
|
|
286
|
-
value: o,
|
|
287
|
-
tone: a,
|
|
288
|
-
size: 92,
|
|
289
|
-
strokeWidth: 9,
|
|
290
|
-
label: i("brainyrich.goals.card.funded", "funded")
|
|
291
|
-
}), /* @__PURE__ */ A("div", {
|
|
292
|
-
className: "min-w-0 flex-1",
|
|
258
|
+
}), /* @__PURE__ */ N(Ce, {
|
|
259
|
+
align: "end",
|
|
293
260
|
children: [
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
-
|
|
296
|
-
children:
|
|
261
|
+
/* @__PURE__ */ N(we, {
|
|
262
|
+
onSelect: () => B(e.id),
|
|
263
|
+
children: [/* @__PURE__ */ M(he, {
|
|
264
|
+
className: "size-4",
|
|
265
|
+
"aria-hidden": "true"
|
|
266
|
+
}), i("brainyrich.goals.actions.manageFunding", "Manage funding")]
|
|
297
267
|
}),
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
|
|
300
|
-
children:
|
|
268
|
+
/* @__PURE__ */ N(we, {
|
|
269
|
+
onSelect: () => Y(e),
|
|
270
|
+
children: [/* @__PURE__ */ M(_e, {
|
|
271
|
+
className: "size-4",
|
|
272
|
+
"aria-hidden": "true"
|
|
273
|
+
}), i("brainyrich.goals.actions.editGoal", "Edit goal")]
|
|
301
274
|
}),
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
275
|
+
/* @__PURE__ */ M(Te, {}),
|
|
276
|
+
/* @__PURE__ */ N(we, {
|
|
277
|
+
className: "text-status-error-text focus:text-status-error-text",
|
|
278
|
+
onSelect: () => H(e),
|
|
279
|
+
children: [/* @__PURE__ */ M(ve, {
|
|
280
|
+
className: "size-4",
|
|
306
281
|
"aria-hidden": "true"
|
|
307
|
-
}),
|
|
282
|
+
}), i("brainyrich.goals.actions.archive", "Archive goal")]
|
|
308
283
|
})
|
|
309
284
|
]
|
|
310
|
-
})]
|
|
311
|
-
}),
|
|
312
|
-
/* @__PURE__ */ A("dl", {
|
|
313
|
-
className: "grid grid-cols-2 gap-3 rounded-lg bg-bg-sunken p-3 text-sm",
|
|
314
|
-
children: [
|
|
315
|
-
/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("dt", {
|
|
316
|
-
className: "text-xs text-text-secondary",
|
|
317
|
-
children: i("brainyrich.goals.card.targetDate", "Target date")
|
|
318
|
-
}), /* @__PURE__ */ A("dd", {
|
|
319
|
-
className: "flex items-center gap-1 font-medium text-text-primary",
|
|
320
|
-
children: [/* @__PURE__ */ k(pe, {
|
|
321
|
-
className: "size-3.5 text-text-secondary",
|
|
322
|
-
"aria-hidden": "true"
|
|
323
|
-
}), ue(e.targetDate)]
|
|
324
|
-
})] }),
|
|
325
|
-
/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("dt", {
|
|
326
|
-
className: "text-xs text-text-secondary",
|
|
327
|
-
children: i("brainyrich.goals.card.monthly", "Monthly")
|
|
328
|
-
}), /* @__PURE__ */ k("dd", {
|
|
329
|
-
className: "font-medium text-text-primary",
|
|
330
|
-
children: m(e.monthlyContribution, e.currency)
|
|
331
|
-
})] }),
|
|
332
|
-
/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("dt", {
|
|
333
|
-
className: "text-xs text-text-secondary",
|
|
334
|
-
children: i("brainyrich.goals.card.priority", "Priority")
|
|
335
|
-
}), /* @__PURE__ */ k("dd", {
|
|
336
|
-
className: "font-medium text-text-primary",
|
|
337
|
-
children: e.priority
|
|
338
|
-
})] }),
|
|
339
|
-
/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("dt", {
|
|
340
|
-
className: "text-xs text-text-secondary",
|
|
341
|
-
children: i("brainyrich.goals.card.fundings", "Funding links")
|
|
342
|
-
}), /* @__PURE__ */ k("dd", {
|
|
343
|
-
className: "font-medium text-text-primary",
|
|
344
|
-
children: e.fundings.length
|
|
345
|
-
})] })
|
|
346
|
-
]
|
|
347
|
-
}),
|
|
348
|
-
/* @__PURE__ */ k("div", {
|
|
349
|
-
className: "mt-auto",
|
|
350
|
-
children: /* @__PURE__ */ k(M, {
|
|
351
|
-
variant: "outline",
|
|
352
|
-
size: "sm",
|
|
353
|
-
className: "w-full",
|
|
354
|
-
onClick: () => z(e.id),
|
|
355
|
-
children: i("brainyrich.goals.actions.viewDetails", "View details & funding")
|
|
356
|
-
})
|
|
285
|
+
})] })]
|
|
357
286
|
})
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
287
|
+
}), /* @__PURE__ */ N(xe, {
|
|
288
|
+
className: "flex flex-1 flex-col gap-4",
|
|
289
|
+
children: [
|
|
290
|
+
/* @__PURE__ */ N("div", {
|
|
291
|
+
className: "flex items-center gap-4",
|
|
292
|
+
children: [/* @__PURE__ */ M(ae, {
|
|
293
|
+
value: o,
|
|
294
|
+
tone: a,
|
|
295
|
+
size: 92,
|
|
296
|
+
strokeWidth: 9,
|
|
297
|
+
label: i("brainyrich.goals.card.funded", "funded")
|
|
298
|
+
}), /* @__PURE__ */ N("div", {
|
|
299
|
+
className: "min-w-0 flex-1",
|
|
300
|
+
children: [
|
|
301
|
+
/* @__PURE__ */ M("p", {
|
|
302
|
+
className: "text-xs text-text-secondary",
|
|
303
|
+
children: i("brainyrich.goals.card.target", "Target amount")
|
|
304
|
+
}),
|
|
305
|
+
/* @__PURE__ */ M("p", {
|
|
306
|
+
className: "truncate text-2xl font-semibold text-text-primary",
|
|
307
|
+
children: h(e.targetAmount, e.currency)
|
|
308
|
+
}),
|
|
309
|
+
/* @__PURE__ */ N("span", {
|
|
310
|
+
className: `mt-1 inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium ${n.tone}`,
|
|
311
|
+
children: [/* @__PURE__ */ M(r, {
|
|
312
|
+
className: "size-3.5",
|
|
313
|
+
"aria-hidden": "true"
|
|
314
|
+
}), $(e.projection)]
|
|
315
|
+
})
|
|
316
|
+
]
|
|
317
|
+
})]
|
|
318
|
+
}),
|
|
319
|
+
/* @__PURE__ */ N("dl", {
|
|
320
|
+
className: "grid grid-cols-2 gap-3 rounded-lg bg-bg-sunken p-3 text-sm",
|
|
321
|
+
children: [
|
|
322
|
+
/* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("dt", {
|
|
323
|
+
className: "text-xs text-text-secondary",
|
|
324
|
+
children: i("brainyrich.goals.card.targetDate", "Target date")
|
|
325
|
+
}), /* @__PURE__ */ N("dd", {
|
|
326
|
+
className: "flex items-center gap-1 font-medium text-text-primary",
|
|
327
|
+
children: [/* @__PURE__ */ M(fe, {
|
|
328
|
+
className: "size-3.5 text-text-secondary",
|
|
329
|
+
"aria-hidden": "true"
|
|
330
|
+
}), m(e.targetDate)]
|
|
331
|
+
})] }),
|
|
332
|
+
/* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("dt", {
|
|
333
|
+
className: "text-xs text-text-secondary",
|
|
334
|
+
children: i("brainyrich.goals.card.monthly", "Monthly")
|
|
335
|
+
}), /* @__PURE__ */ M("dd", {
|
|
336
|
+
className: "font-medium text-text-primary",
|
|
337
|
+
children: h(e.monthlyContribution, e.currency)
|
|
338
|
+
})] }),
|
|
339
|
+
/* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("dt", {
|
|
340
|
+
className: "text-xs text-text-secondary",
|
|
341
|
+
children: i("brainyrich.goals.card.priority", "Priority")
|
|
342
|
+
}), /* @__PURE__ */ M("dd", {
|
|
343
|
+
className: "font-medium text-text-primary",
|
|
344
|
+
children: e.priority
|
|
345
|
+
})] }),
|
|
346
|
+
/* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("dt", {
|
|
347
|
+
className: "text-xs text-text-secondary",
|
|
348
|
+
children: i("brainyrich.goals.card.fundings", "Funding links")
|
|
349
|
+
}), /* @__PURE__ */ M("dd", {
|
|
350
|
+
className: "font-medium text-text-primary",
|
|
351
|
+
children: e.fundings.length
|
|
352
|
+
})] })
|
|
353
|
+
]
|
|
354
|
+
}),
|
|
355
|
+
/* @__PURE__ */ M("div", {
|
|
356
|
+
className: "mt-auto",
|
|
357
|
+
children: /* @__PURE__ */ M(P, {
|
|
358
|
+
variant: "outline",
|
|
359
|
+
size: "sm",
|
|
360
|
+
className: "w-full",
|
|
361
|
+
onClick: () => B(e.id),
|
|
362
|
+
children: i("brainyrich.goals.actions.viewDetails", "View details & funding")
|
|
363
|
+
})
|
|
364
|
+
})
|
|
365
|
+
]
|
|
366
|
+
})]
|
|
367
|
+
})
|
|
368
|
+
}, e.id);
|
|
369
|
+
})
|
|
370
|
+
}),
|
|
371
|
+
/* @__PURE__ */ M(te, {
|
|
372
|
+
hasMore: s,
|
|
373
|
+
loading: u,
|
|
374
|
+
onClick: l,
|
|
375
|
+
label: i("brainyrich.goals.actions.loadMore", "Load more goals"),
|
|
376
|
+
loadingLabel: i("brainyrich.goals.actions.loadingMore", "Loading…")
|
|
362
377
|
})
|
|
363
|
-
})
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
},
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
] });
|
|
378
|
+
] })
|
|
379
|
+
}),
|
|
380
|
+
/* @__PURE__ */ M(Ye, {
|
|
381
|
+
open: D,
|
|
382
|
+
mode: "create",
|
|
383
|
+
form: U,
|
|
384
|
+
setField: G,
|
|
385
|
+
households: ue.map((e) => ({
|
|
386
|
+
id: e.id,
|
|
387
|
+
name: e.name
|
|
388
|
+
})),
|
|
389
|
+
valid: X,
|
|
390
|
+
pending: y.isPending,
|
|
391
|
+
onSubmit: () => {
|
|
392
|
+
if (!X) return;
|
|
393
|
+
let e = {
|
|
394
|
+
name: U.name.trim(),
|
|
395
|
+
type: U.type,
|
|
396
|
+
targetAmount: Number(U.targetAmount),
|
|
397
|
+
targetDate: new Date(U.targetDate).toISOString(),
|
|
398
|
+
monthlyContribution: Number(U.monthlyContribution) || 0,
|
|
399
|
+
priority: Number(U.priority) || 1,
|
|
400
|
+
currency: U.currency.trim() || "USD",
|
|
401
|
+
notes: U.notes.trim() || null,
|
|
402
|
+
tags: [],
|
|
403
|
+
...U.householdId ? { householdId: U.householdId } : {}
|
|
404
|
+
};
|
|
405
|
+
y.mutate(e, { onSuccess: () => {
|
|
406
|
+
g(), _(i("brainyrich.goals.created", "Goal created")), O(!1);
|
|
407
|
+
} });
|
|
408
|
+
},
|
|
409
|
+
onOpenChange: (e) => O(e),
|
|
410
|
+
translate: i
|
|
411
|
+
}),
|
|
412
|
+
/* @__PURE__ */ M(Ye, {
|
|
413
|
+
open: !!k,
|
|
414
|
+
mode: "edit",
|
|
415
|
+
goalId: k?.id,
|
|
416
|
+
form: U,
|
|
417
|
+
setField: G,
|
|
418
|
+
households: ue.map((e) => ({
|
|
419
|
+
id: e.id,
|
|
420
|
+
name: e.name
|
|
421
|
+
})),
|
|
422
|
+
valid: X,
|
|
423
|
+
pending: me.isPending,
|
|
424
|
+
onSubmit: () => {
|
|
425
|
+
if (!k || !X) return;
|
|
426
|
+
let e = {
|
|
427
|
+
name: U.name.trim(),
|
|
428
|
+
type: U.type,
|
|
429
|
+
status: U.status,
|
|
430
|
+
targetAmount: Number(U.targetAmount),
|
|
431
|
+
targetDate: new Date(U.targetDate).toISOString(),
|
|
432
|
+
monthlyContribution: Number(U.monthlyContribution) || 0,
|
|
433
|
+
priority: Number(U.priority) || 1,
|
|
434
|
+
currency: U.currency.trim() || "USD",
|
|
435
|
+
notes: U.notes.trim() || null,
|
|
436
|
+
tags: k.tags
|
|
437
|
+
};
|
|
438
|
+
me.mutate({
|
|
439
|
+
id: k.id,
|
|
440
|
+
input: e
|
|
441
|
+
}, { onSuccess: () => {
|
|
442
|
+
g(), _(i("brainyrich.goals.saved", "Goal saved")), R(null);
|
|
443
|
+
} });
|
|
444
|
+
},
|
|
445
|
+
onOpenChange: (e) => {
|
|
446
|
+
e || R(null);
|
|
447
|
+
},
|
|
448
|
+
translate: i
|
|
449
|
+
}),
|
|
450
|
+
/* @__PURE__ */ M(Xe, {
|
|
451
|
+
goalId: z,
|
|
452
|
+
onClose: () => B(null),
|
|
453
|
+
translate: i
|
|
454
|
+
}),
|
|
455
|
+
/* @__PURE__ */ M(ne, {
|
|
456
|
+
open: !!V,
|
|
457
|
+
onOpenChange: (e) => {
|
|
458
|
+
e || H(null);
|
|
459
|
+
},
|
|
460
|
+
title: i("brainyrich.goals.archive.title", "Archive goal?"),
|
|
461
|
+
description: i("brainyrich.goals.archive.description", "This removes “{name}” from your active goals. You can no longer track its progress.", { name: V?.name ?? "" }),
|
|
462
|
+
confirmLabel: i("brainyrich.goals.archive.confirm", "Archive goal"),
|
|
463
|
+
pendingLabel: i("brainyrich.goals.archive.pending", "Archiving…"),
|
|
464
|
+
destructive: !0,
|
|
465
|
+
pending: E.isPending,
|
|
466
|
+
onConfirm: () => {
|
|
467
|
+
V && E.mutate(V.id, { onSuccess: () => {
|
|
468
|
+
g(), _(i("brainyrich.goals.archived", "Goal archived", { name: V.name })), H(null);
|
|
469
|
+
} });
|
|
470
|
+
}
|
|
471
|
+
})
|
|
472
|
+
]
|
|
473
|
+
});
|
|
460
474
|
}
|
|
461
|
-
function
|
|
462
|
-
return /* @__PURE__ */
|
|
475
|
+
function Ye({ open: e, mode: t, goalId: n, form: r, setField: i, households: a, valid: o, pending: s, onSubmit: c, onOpenChange: l, translate: u }) {
|
|
476
|
+
return /* @__PURE__ */ M(R, {
|
|
463
477
|
open: e,
|
|
464
478
|
onOpenChange: l,
|
|
465
|
-
children: /* @__PURE__ */
|
|
479
|
+
children: /* @__PURE__ */ N(z, {
|
|
466
480
|
className: "max-h-[90vh] overflow-y-auto sm:max-w-lg",
|
|
467
|
-
children: [/* @__PURE__ */
|
|
481
|
+
children: [/* @__PURE__ */ N(H, { children: [/* @__PURE__ */ M(U, { children: t === "create" ? u("brainyrich.goals.form.createTitle", "New goal") : u("brainyrich.goals.form.editTitle", "Edit goal") }), /* @__PURE__ */ M(B, { children: u("brainyrich.goals.form.subtitle", "Define the milestone, target and contribution plan.") })] }), /* @__PURE__ */ N("form", {
|
|
468
482
|
className: "space-y-4",
|
|
469
483
|
onSubmit: (e) => {
|
|
470
484
|
e.preventDefault(), c();
|
|
471
485
|
},
|
|
472
486
|
children: [
|
|
473
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ N("div", {
|
|
474
488
|
className: "space-y-1.5",
|
|
475
|
-
children: [/* @__PURE__ */
|
|
489
|
+
children: [/* @__PURE__ */ M(G, {
|
|
476
490
|
htmlFor: "goal-name",
|
|
477
491
|
children: u("brainyrich.goals.form.name", "Name")
|
|
478
|
-
}), /* @__PURE__ */
|
|
492
|
+
}), /* @__PURE__ */ M(W, {
|
|
479
493
|
id: "goal-name",
|
|
480
494
|
value: r.name,
|
|
481
495
|
onChange: (e) => i("name", e.target.value),
|
|
@@ -483,46 +497,46 @@ function Ke({ open: e, mode: t, goalId: n, form: r, setField: i, households: a,
|
|
|
483
497
|
required: !0
|
|
484
498
|
})]
|
|
485
499
|
}),
|
|
486
|
-
/* @__PURE__ */
|
|
500
|
+
/* @__PURE__ */ N("div", {
|
|
487
501
|
className: "grid grid-cols-2 gap-3",
|
|
488
|
-
children: [/* @__PURE__ */
|
|
502
|
+
children: [/* @__PURE__ */ N("div", {
|
|
489
503
|
className: "space-y-1.5",
|
|
490
|
-
children: [/* @__PURE__ */
|
|
504
|
+
children: [/* @__PURE__ */ M(G, {
|
|
491
505
|
htmlFor: "goal-type",
|
|
492
506
|
children: u("brainyrich.goals.form.type", "Type")
|
|
493
|
-
}), /* @__PURE__ */
|
|
507
|
+
}), /* @__PURE__ */ N(K, {
|
|
494
508
|
value: r.type,
|
|
495
509
|
onValueChange: (e) => i("type", e),
|
|
496
|
-
children: [/* @__PURE__ */
|
|
510
|
+
children: [/* @__PURE__ */ M(Y, {
|
|
497
511
|
id: "goal-type",
|
|
498
|
-
children: /* @__PURE__ */
|
|
499
|
-
}), /* @__PURE__ */
|
|
512
|
+
children: /* @__PURE__ */ M(X, {})
|
|
513
|
+
}), /* @__PURE__ */ M(q, { children: Le.map((e) => /* @__PURE__ */ M(J, {
|
|
500
514
|
value: e,
|
|
501
|
-
children:
|
|
515
|
+
children: $(e)
|
|
502
516
|
}, e)) })]
|
|
503
517
|
})]
|
|
504
|
-
}), t === "edit" ? /* @__PURE__ */
|
|
518
|
+
}), t === "edit" ? /* @__PURE__ */ N("div", {
|
|
505
519
|
className: "space-y-1.5",
|
|
506
|
-
children: [/* @__PURE__ */
|
|
520
|
+
children: [/* @__PURE__ */ M(G, {
|
|
507
521
|
htmlFor: "goal-status",
|
|
508
522
|
children: u("brainyrich.goals.form.status", "Status")
|
|
509
|
-
}), /* @__PURE__ */
|
|
523
|
+
}), /* @__PURE__ */ N(K, {
|
|
510
524
|
value: r.status,
|
|
511
525
|
onValueChange: (e) => i("status", e),
|
|
512
|
-
children: [/* @__PURE__ */
|
|
526
|
+
children: [/* @__PURE__ */ M(Y, {
|
|
513
527
|
id: "goal-status",
|
|
514
|
-
children: /* @__PURE__ */
|
|
515
|
-
}), /* @__PURE__ */
|
|
528
|
+
children: /* @__PURE__ */ M(X, {})
|
|
529
|
+
}), /* @__PURE__ */ M(q, { children: Re.map((e) => /* @__PURE__ */ M(J, {
|
|
516
530
|
value: e,
|
|
517
|
-
children:
|
|
531
|
+
children: $(e)
|
|
518
532
|
}, e)) })]
|
|
519
533
|
})]
|
|
520
|
-
}) : /* @__PURE__ */
|
|
534
|
+
}) : /* @__PURE__ */ N("div", {
|
|
521
535
|
className: "space-y-1.5",
|
|
522
|
-
children: [/* @__PURE__ */
|
|
536
|
+
children: [/* @__PURE__ */ M(G, {
|
|
523
537
|
htmlFor: "goal-priority",
|
|
524
538
|
children: u("brainyrich.goals.form.priority", "Priority")
|
|
525
|
-
}), /* @__PURE__ */
|
|
539
|
+
}), /* @__PURE__ */ M(W, {
|
|
526
540
|
id: "goal-priority",
|
|
527
541
|
type: "number",
|
|
528
542
|
min: 1,
|
|
@@ -531,14 +545,14 @@ function Ke({ open: e, mode: t, goalId: n, form: r, setField: i, households: a,
|
|
|
531
545
|
})]
|
|
532
546
|
})]
|
|
533
547
|
}),
|
|
534
|
-
/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ N("div", {
|
|
535
549
|
className: "grid grid-cols-2 gap-3",
|
|
536
|
-
children: [/* @__PURE__ */
|
|
550
|
+
children: [/* @__PURE__ */ N("div", {
|
|
537
551
|
className: "space-y-1.5",
|
|
538
|
-
children: [/* @__PURE__ */
|
|
552
|
+
children: [/* @__PURE__ */ M(G, {
|
|
539
553
|
htmlFor: "goal-target",
|
|
540
554
|
children: u("brainyrich.goals.form.targetAmount", "Target amount")
|
|
541
|
-
}), /* @__PURE__ */
|
|
555
|
+
}), /* @__PURE__ */ M(W, {
|
|
542
556
|
id: "goal-target",
|
|
543
557
|
type: "number",
|
|
544
558
|
min: 0,
|
|
@@ -547,12 +561,12 @@ function Ke({ open: e, mode: t, goalId: n, form: r, setField: i, households: a,
|
|
|
547
561
|
onChange: (e) => i("targetAmount", e.target.value),
|
|
548
562
|
required: !0
|
|
549
563
|
})]
|
|
550
|
-
}), /* @__PURE__ */
|
|
564
|
+
}), /* @__PURE__ */ N("div", {
|
|
551
565
|
className: "space-y-1.5",
|
|
552
|
-
children: [/* @__PURE__ */
|
|
566
|
+
children: [/* @__PURE__ */ M(G, {
|
|
553
567
|
htmlFor: "goal-date",
|
|
554
568
|
children: u("brainyrich.goals.form.targetDate", "Target date")
|
|
555
|
-
}), /* @__PURE__ */
|
|
569
|
+
}), /* @__PURE__ */ M(W, {
|
|
556
570
|
id: "goal-date",
|
|
557
571
|
type: "date",
|
|
558
572
|
value: r.targetDate,
|
|
@@ -561,14 +575,14 @@ function Ke({ open: e, mode: t, goalId: n, form: r, setField: i, households: a,
|
|
|
561
575
|
})]
|
|
562
576
|
})]
|
|
563
577
|
}),
|
|
564
|
-
/* @__PURE__ */
|
|
578
|
+
/* @__PURE__ */ N("div", {
|
|
565
579
|
className: "grid grid-cols-2 gap-3",
|
|
566
|
-
children: [/* @__PURE__ */
|
|
580
|
+
children: [/* @__PURE__ */ N("div", {
|
|
567
581
|
className: "space-y-1.5",
|
|
568
|
-
children: [/* @__PURE__ */
|
|
582
|
+
children: [/* @__PURE__ */ M(G, {
|
|
569
583
|
htmlFor: "goal-monthly",
|
|
570
584
|
children: u("brainyrich.goals.form.monthly", "Monthly contribution")
|
|
571
|
-
}), /* @__PURE__ */
|
|
585
|
+
}), /* @__PURE__ */ M(W, {
|
|
572
586
|
id: "goal-monthly",
|
|
573
587
|
type: "number",
|
|
574
588
|
min: 0,
|
|
@@ -576,12 +590,12 @@ function Ke({ open: e, mode: t, goalId: n, form: r, setField: i, households: a,
|
|
|
576
590
|
value: r.monthlyContribution,
|
|
577
591
|
onChange: (e) => i("monthlyContribution", e.target.value)
|
|
578
592
|
})]
|
|
579
|
-
}), /* @__PURE__ */
|
|
593
|
+
}), /* @__PURE__ */ N("div", {
|
|
580
594
|
className: "space-y-1.5",
|
|
581
|
-
children: [/* @__PURE__ */
|
|
595
|
+
children: [/* @__PURE__ */ M(G, {
|
|
582
596
|
htmlFor: "goal-currency",
|
|
583
597
|
children: u("brainyrich.goals.form.currency", "Currency")
|
|
584
|
-
}), /* @__PURE__ */
|
|
598
|
+
}), /* @__PURE__ */ M(W, {
|
|
585
599
|
id: "goal-currency",
|
|
586
600
|
value: r.currency,
|
|
587
601
|
onChange: (e) => i("currency", e.target.value.toUpperCase()),
|
|
@@ -589,12 +603,12 @@ function Ke({ open: e, mode: t, goalId: n, form: r, setField: i, households: a,
|
|
|
589
603
|
})]
|
|
590
604
|
})]
|
|
591
605
|
}),
|
|
592
|
-
t === "edit" ? /* @__PURE__ */
|
|
606
|
+
t === "edit" ? /* @__PURE__ */ N("div", {
|
|
593
607
|
className: "space-y-1.5",
|
|
594
|
-
children: [/* @__PURE__ */
|
|
608
|
+
children: [/* @__PURE__ */ M(G, {
|
|
595
609
|
htmlFor: "goal-priority-edit",
|
|
596
610
|
children: u("brainyrich.goals.form.priority", "Priority")
|
|
597
|
-
}), /* @__PURE__ */
|
|
611
|
+
}), /* @__PURE__ */ M(W, {
|
|
598
612
|
id: "goal-priority-edit",
|
|
599
613
|
type: "number",
|
|
600
614
|
min: 1,
|
|
@@ -602,56 +616,56 @@ function Ke({ open: e, mode: t, goalId: n, form: r, setField: i, households: a,
|
|
|
602
616
|
onChange: (e) => i("priority", e.target.value)
|
|
603
617
|
})]
|
|
604
618
|
}) : null,
|
|
605
|
-
/* @__PURE__ */
|
|
619
|
+
/* @__PURE__ */ N("div", {
|
|
606
620
|
className: "space-y-1.5",
|
|
607
|
-
children: [/* @__PURE__ */
|
|
621
|
+
children: [/* @__PURE__ */ M(G, {
|
|
608
622
|
htmlFor: "goal-household",
|
|
609
623
|
children: u("brainyrich.goals.form.household", "Household (optional)")
|
|
610
|
-
}), /* @__PURE__ */
|
|
611
|
-
value: r.householdId ||
|
|
612
|
-
onValueChange: (e) => i("householdId", e ===
|
|
613
|
-
children: [/* @__PURE__ */
|
|
624
|
+
}), /* @__PURE__ */ N(K, {
|
|
625
|
+
value: r.householdId || qe,
|
|
626
|
+
onValueChange: (e) => i("householdId", e === qe ? "" : e),
|
|
627
|
+
children: [/* @__PURE__ */ M(Y, {
|
|
614
628
|
id: "goal-household",
|
|
615
|
-
children: /* @__PURE__ */
|
|
616
|
-
}), /* @__PURE__ */
|
|
617
|
-
value:
|
|
629
|
+
children: /* @__PURE__ */ M(X, { placeholder: u("brainyrich.goals.form.householdNone", "None") })
|
|
630
|
+
}), /* @__PURE__ */ N(q, { children: [/* @__PURE__ */ M(J, {
|
|
631
|
+
value: qe,
|
|
618
632
|
children: u("brainyrich.goals.form.householdNone", "None")
|
|
619
|
-
}), a.map((e) => /* @__PURE__ */
|
|
633
|
+
}), a.map((e) => /* @__PURE__ */ M(J, {
|
|
620
634
|
value: e.id,
|
|
621
635
|
children: e.name
|
|
622
636
|
}, e.id))] })]
|
|
623
637
|
})]
|
|
624
638
|
}),
|
|
625
|
-
t === "edit" && n ? /* @__PURE__ */
|
|
639
|
+
t === "edit" && n ? /* @__PURE__ */ M(y, {
|
|
626
640
|
entityType: "brainyrich-goal",
|
|
627
641
|
entityId: n,
|
|
628
642
|
label: u("brainyrich.goals.form.tags", "Tags")
|
|
629
|
-
}) : /* @__PURE__ */
|
|
643
|
+
}) : /* @__PURE__ */ N("div", {
|
|
630
644
|
className: "space-y-1.5",
|
|
631
|
-
children: [/* @__PURE__ */
|
|
645
|
+
children: [/* @__PURE__ */ M(G, { children: u("brainyrich.goals.form.tags", "Tags") }), /* @__PURE__ */ M("p", {
|
|
632
646
|
className: "text-sm text-text-secondary",
|
|
633
647
|
children: u("brainyrich.goals.form.tagsAfterCreate", "You can add tags after creating the goal.")
|
|
634
648
|
})]
|
|
635
649
|
}),
|
|
636
|
-
/* @__PURE__ */
|
|
650
|
+
/* @__PURE__ */ N("div", {
|
|
637
651
|
className: "space-y-1.5",
|
|
638
|
-
children: [/* @__PURE__ */
|
|
652
|
+
children: [/* @__PURE__ */ M(G, {
|
|
639
653
|
htmlFor: "goal-notes",
|
|
640
654
|
children: u("brainyrich.goals.form.notes", "Notes")
|
|
641
|
-
}), /* @__PURE__ */
|
|
655
|
+
}), /* @__PURE__ */ M(Ie, {
|
|
642
656
|
id: "goal-notes",
|
|
643
657
|
value: r.notes,
|
|
644
658
|
onChange: (e) => i("notes", e.target.value),
|
|
645
659
|
rows: 3
|
|
646
660
|
})]
|
|
647
661
|
}),
|
|
648
|
-
/* @__PURE__ */
|
|
662
|
+
/* @__PURE__ */ N(V, { children: [/* @__PURE__ */ M(P, {
|
|
649
663
|
type: "button",
|
|
650
664
|
variant: "outline",
|
|
651
665
|
onClick: () => l(!1),
|
|
652
666
|
disabled: s,
|
|
653
667
|
children: u("brainyrich.goals.form.cancel", "Cancel")
|
|
654
|
-
}), /* @__PURE__ */
|
|
668
|
+
}), /* @__PURE__ */ M(P, {
|
|
655
669
|
type: "submit",
|
|
656
670
|
disabled: !o || s,
|
|
657
671
|
children: s ? u("brainyrich.goals.form.saving", "Saving…") : t === "create" ? u("brainyrich.goals.form.create", "Create goal") : u("brainyrich.goals.form.save", "Save changes")
|
|
@@ -661,173 +675,173 @@ function Ke({ open: e, mode: t, goalId: n, form: r, setField: i, households: a,
|
|
|
661
675
|
})
|
|
662
676
|
});
|
|
663
677
|
}
|
|
664
|
-
function
|
|
665
|
-
let { data: o, isLoading: c, isError: ee, refetch: te } = i(e ?? void 0), { data: d } = a(e ?? void 0), { data: p } = t(),
|
|
678
|
+
function Xe({ goalId: e, onClose: n, translate: r }) {
|
|
679
|
+
let { data: o, isLoading: c, isError: ee, refetch: te } = i(e ?? void 0), { data: d } = a(e ?? void 0), { data: p } = t(), g = s(), _ = u(), v = l(), [b, S] = x(""), [C, ge] = x("PERCENT"), [w, ve] = x(""), [E, D] = x(""), [A, F] = x(null), I = d.reduce((e, t) => e + (t.fixedAmount ?? 0), 0), L = o?.currency ?? "USD", R = o ? Ve(o) : 0, z = o ? He(o.status, o.projection) : "brand", B = o ? Ue(I, o.monthlyContribution, o.targetDate) : [], V = (e) => p.find((t) => t.id === e)?.name ?? e, H = () => {
|
|
666
680
|
if (!e || !b) return;
|
|
667
|
-
let t = Number(
|
|
668
|
-
!Number.isFinite(t) || t <= 0 ||
|
|
681
|
+
let t = Number(w);
|
|
682
|
+
!Number.isFinite(t) || t <= 0 || g.mutate({
|
|
669
683
|
goalId: e,
|
|
670
684
|
accountId: b,
|
|
671
|
-
...
|
|
685
|
+
...C === "PERCENT" ? { allocationPct: t } : { fixedAmount: t }
|
|
672
686
|
}, { onSuccess: () => {
|
|
673
|
-
|
|
687
|
+
S(""), ve("");
|
|
674
688
|
} });
|
|
675
|
-
},
|
|
689
|
+
}, U = () => {
|
|
676
690
|
if (!e) return;
|
|
677
|
-
let t =
|
|
691
|
+
let t = E === "" ? I : Number(E);
|
|
678
692
|
Number.isFinite(t) && v.mutate({
|
|
679
693
|
id: e,
|
|
680
694
|
fundedAmount: t
|
|
681
695
|
});
|
|
682
|
-
},
|
|
683
|
-
return /* @__PURE__ */
|
|
696
|
+
}, Se = !!b && Number(w) > 0, Ce = A ? A.fixedAmount == null ? V(A.accountId) : h(A.fixedAmount, L) : "";
|
|
697
|
+
return /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(De, {
|
|
684
698
|
open: !!e,
|
|
685
699
|
onOpenChange: (e) => {
|
|
686
700
|
e || n();
|
|
687
701
|
},
|
|
688
|
-
children: /* @__PURE__ */
|
|
702
|
+
children: /* @__PURE__ */ N(Oe, {
|
|
689
703
|
className: "flex w-full flex-col gap-0 overflow-y-auto sm:max-w-xl",
|
|
690
|
-
children: [/* @__PURE__ */
|
|
704
|
+
children: [/* @__PURE__ */ N(Ae, { children: [/* @__PURE__ */ M(je, { children: o?.name ?? r("brainyrich.goals.detail.title", "Goal") }), /* @__PURE__ */ M(ke, { children: r("brainyrich.goals.detail.subtitle", "Manage funding links and projection.") })] }), /* @__PURE__ */ M("div", {
|
|
691
705
|
className: "space-y-6 p-4",
|
|
692
|
-
children: c ? /* @__PURE__ */
|
|
706
|
+
children: c ? /* @__PURE__ */ M(ce, { rows: 3 }) : ee ? /* @__PURE__ */ M(se, {
|
|
693
707
|
title: r("brainyrich.goals.detail.error", "Could not load goal"),
|
|
694
708
|
onRetry: () => te()
|
|
695
|
-
}) : o ? /* @__PURE__ */
|
|
696
|
-
/* @__PURE__ */
|
|
709
|
+
}) : o ? /* @__PURE__ */ N(j, { children: [
|
|
710
|
+
/* @__PURE__ */ N(re, {
|
|
697
711
|
glow: !0,
|
|
698
712
|
className: "flex items-center gap-5",
|
|
699
|
-
children: [/* @__PURE__ */
|
|
700
|
-
value:
|
|
701
|
-
tone:
|
|
713
|
+
children: [/* @__PURE__ */ M(ae, {
|
|
714
|
+
value: R,
|
|
715
|
+
tone: z,
|
|
702
716
|
size: 116,
|
|
703
717
|
strokeWidth: 11,
|
|
704
718
|
label: r("brainyrich.goals.detail.funded", "funded")
|
|
705
|
-
}), /* @__PURE__ */
|
|
719
|
+
}), /* @__PURE__ */ N("div", {
|
|
706
720
|
className: "min-w-0 flex-1 space-y-1",
|
|
707
721
|
children: [
|
|
708
|
-
/* @__PURE__ */
|
|
709
|
-
variant:
|
|
710
|
-
children:
|
|
722
|
+
/* @__PURE__ */ M(ye, {
|
|
723
|
+
variant: de(o.projection),
|
|
724
|
+
children: $(o.projection)
|
|
711
725
|
}),
|
|
712
|
-
/* @__PURE__ */
|
|
726
|
+
/* @__PURE__ */ M("p", {
|
|
713
727
|
className: "text-2xl font-semibold text-text-primary",
|
|
714
|
-
children:
|
|
728
|
+
children: h(I, L)
|
|
715
729
|
}),
|
|
716
|
-
/* @__PURE__ */
|
|
730
|
+
/* @__PURE__ */ M("p", {
|
|
717
731
|
className: "text-xs text-text-secondary",
|
|
718
|
-
children: r("brainyrich.goals.detail.ofTarget", "of {target} target", { target: le(o.targetAmount,
|
|
732
|
+
children: r("brainyrich.goals.detail.ofTarget", "of {target} target", { target: le(o.targetAmount, L) })
|
|
719
733
|
})
|
|
720
734
|
]
|
|
721
735
|
})]
|
|
722
736
|
}),
|
|
723
|
-
/* @__PURE__ */
|
|
737
|
+
/* @__PURE__ */ N("div", {
|
|
724
738
|
className: "grid grid-cols-2 gap-3",
|
|
725
739
|
children: [
|
|
726
|
-
/* @__PURE__ */
|
|
727
|
-
icon: /* @__PURE__ */
|
|
740
|
+
/* @__PURE__ */ M(f, {
|
|
741
|
+
icon: /* @__PURE__ */ M(T, {
|
|
728
742
|
className: "size-4",
|
|
729
743
|
"aria-hidden": "true"
|
|
730
744
|
}),
|
|
731
745
|
label: r("brainyrich.goals.detail.target", "Target"),
|
|
732
|
-
value:
|
|
746
|
+
value: h(o.targetAmount, L)
|
|
733
747
|
}),
|
|
734
|
-
/* @__PURE__ */
|
|
735
|
-
icon: /* @__PURE__ */ k
|
|
748
|
+
/* @__PURE__ */ M(f, {
|
|
749
|
+
icon: /* @__PURE__ */ M(k, {
|
|
736
750
|
className: "size-4",
|
|
737
751
|
"aria-hidden": "true"
|
|
738
752
|
}),
|
|
739
753
|
label: r("brainyrich.goals.detail.funded", "Funded (fixed)"),
|
|
740
|
-
value:
|
|
754
|
+
value: h(I, L)
|
|
741
755
|
}),
|
|
742
|
-
/* @__PURE__ */
|
|
743
|
-
icon: /* @__PURE__ */
|
|
756
|
+
/* @__PURE__ */ M(f, {
|
|
757
|
+
icon: /* @__PURE__ */ M(pe, {
|
|
744
758
|
className: "size-4",
|
|
745
759
|
"aria-hidden": "true"
|
|
746
760
|
}),
|
|
747
761
|
label: r("brainyrich.goals.detail.monthly", "Monthly"),
|
|
748
|
-
value:
|
|
762
|
+
value: h(o.monthlyContribution, L)
|
|
749
763
|
}),
|
|
750
|
-
/* @__PURE__ */
|
|
751
|
-
icon: /* @__PURE__ */
|
|
764
|
+
/* @__PURE__ */ M(f, {
|
|
765
|
+
icon: /* @__PURE__ */ M(fe, {
|
|
752
766
|
className: "size-4",
|
|
753
767
|
"aria-hidden": "true"
|
|
754
768
|
}),
|
|
755
769
|
label: r("brainyrich.goals.detail.targetDate", "Target date"),
|
|
756
|
-
value:
|
|
770
|
+
value: m(o.targetDate)
|
|
757
771
|
})
|
|
758
772
|
]
|
|
759
773
|
}),
|
|
760
|
-
|
|
774
|
+
B.length >= 2 ? /* @__PURE__ */ N("section", {
|
|
761
775
|
className: "space-y-3 rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
762
776
|
children: [
|
|
763
|
-
/* @__PURE__ */
|
|
777
|
+
/* @__PURE__ */ N("div", {
|
|
764
778
|
className: "flex items-center gap-2",
|
|
765
|
-
children: [/* @__PURE__ */
|
|
779
|
+
children: [/* @__PURE__ */ M(me, {
|
|
766
780
|
className: "size-4 text-text-secondary",
|
|
767
781
|
"aria-hidden": "true"
|
|
768
|
-
}), /* @__PURE__ */
|
|
782
|
+
}), /* @__PURE__ */ M("h3", {
|
|
769
783
|
className: "text-sm font-semibold text-text-primary",
|
|
770
784
|
children: r("brainyrich.goals.detail.projectionChart", "Contribution projection")
|
|
771
785
|
})]
|
|
772
786
|
}),
|
|
773
|
-
/* @__PURE__ */
|
|
774
|
-
data:
|
|
787
|
+
/* @__PURE__ */ M(ie, {
|
|
788
|
+
data: B,
|
|
775
789
|
target: o.targetAmount,
|
|
776
|
-
tone:
|
|
790
|
+
tone: z,
|
|
777
791
|
height: 180,
|
|
778
|
-
valueFormatter: (e) => le(e,
|
|
792
|
+
valueFormatter: (e) => le(e, L)
|
|
779
793
|
}),
|
|
780
|
-
/* @__PURE__ */
|
|
794
|
+
/* @__PURE__ */ M("p", {
|
|
781
795
|
className: "text-xs text-text-secondary",
|
|
782
796
|
children: r("brainyrich.goals.detail.projectionHint", "Starting balance plus {monthly}/mo through {date}.", {
|
|
783
|
-
monthly:
|
|
784
|
-
date:
|
|
797
|
+
monthly: h(o.monthlyContribution, L),
|
|
798
|
+
date: m(o.targetDate)
|
|
785
799
|
})
|
|
786
800
|
})
|
|
787
801
|
]
|
|
788
802
|
}) : null,
|
|
789
|
-
/* @__PURE__ */
|
|
803
|
+
/* @__PURE__ */ N("section", {
|
|
790
804
|
className: "space-y-3",
|
|
791
|
-
children: [/* @__PURE__ */
|
|
805
|
+
children: [/* @__PURE__ */ M("h3", {
|
|
792
806
|
className: "text-sm font-semibold text-text-primary",
|
|
793
807
|
children: r("brainyrich.goals.detail.fundingLinks", "Funding sources")
|
|
794
|
-
}), d.length === 0 ? /* @__PURE__ */
|
|
808
|
+
}), d.length === 0 ? /* @__PURE__ */ M("p", {
|
|
795
809
|
className: "rounded-lg border border-dashed border-border-subtle bg-bg-surface px-4 py-6 text-center text-sm text-text-secondary",
|
|
796
810
|
children: r("brainyrich.goals.detail.noFundings", "No accounts linked to fund this goal yet.")
|
|
797
|
-
}) : /* @__PURE__ */
|
|
811
|
+
}) : /* @__PURE__ */ M("div", {
|
|
798
812
|
className: "overflow-x-auto rounded-lg border border-border-subtle",
|
|
799
|
-
children: /* @__PURE__ */
|
|
800
|
-
/* @__PURE__ */
|
|
801
|
-
/* @__PURE__ */
|
|
813
|
+
children: /* @__PURE__ */ N(Me, { children: [/* @__PURE__ */ M(Pe, { children: /* @__PURE__ */ N(Fe, { children: [
|
|
814
|
+
/* @__PURE__ */ M(Q, { children: r("brainyrich.goals.detail.account", "Account") }),
|
|
815
|
+
/* @__PURE__ */ M(Q, {
|
|
802
816
|
className: "text-right",
|
|
803
817
|
children: r("brainyrich.goals.detail.allocation", "Allocation")
|
|
804
818
|
}),
|
|
805
|
-
/* @__PURE__ */
|
|
819
|
+
/* @__PURE__ */ M(Q, {
|
|
806
820
|
className: "text-right",
|
|
807
821
|
children: r("brainyrich.goals.detail.fixedAmount", "Fixed amount")
|
|
808
822
|
}),
|
|
809
|
-
/* @__PURE__ */
|
|
810
|
-
] }) }), /* @__PURE__ */
|
|
811
|
-
/* @__PURE__ */
|
|
823
|
+
/* @__PURE__ */ M(Q, { className: "w-10" })
|
|
824
|
+
] }) }), /* @__PURE__ */ M(Ne, { children: d.map((e) => /* @__PURE__ */ N(Fe, { children: [
|
|
825
|
+
/* @__PURE__ */ M(Z, {
|
|
812
826
|
className: "font-medium text-text-primary",
|
|
813
|
-
children:
|
|
827
|
+
children: V(e.accountId)
|
|
814
828
|
}),
|
|
815
|
-
/* @__PURE__ */
|
|
829
|
+
/* @__PURE__ */ M(Z, {
|
|
816
830
|
className: "text-right tabular-nums text-text-secondary",
|
|
817
|
-
children: e.fixedAmount == null ?
|
|
831
|
+
children: e.fixedAmount == null ? ue(e.allocationPct) : "—"
|
|
818
832
|
}),
|
|
819
|
-
/* @__PURE__ */
|
|
833
|
+
/* @__PURE__ */ M(Z, {
|
|
820
834
|
className: "text-right tabular-nums text-text-secondary",
|
|
821
|
-
children: e.fixedAmount == null ? "—" :
|
|
835
|
+
children: e.fixedAmount == null ? "—" : h(e.fixedAmount, L)
|
|
822
836
|
}),
|
|
823
|
-
/* @__PURE__ */
|
|
837
|
+
/* @__PURE__ */ M(Z, {
|
|
824
838
|
className: "text-right",
|
|
825
|
-
children: /* @__PURE__ */
|
|
839
|
+
children: /* @__PURE__ */ M(P, {
|
|
826
840
|
variant: "ghost",
|
|
827
841
|
size: "icon",
|
|
828
842
|
"aria-label": r("brainyrich.goals.detail.unlink", "Unlink funding"),
|
|
829
|
-
onClick: () =>
|
|
830
|
-
children: /* @__PURE__ */
|
|
843
|
+
onClick: () => F(e),
|
|
844
|
+
children: /* @__PURE__ */ M(O, {
|
|
831
845
|
className: "size-4",
|
|
832
846
|
"aria-hidden": "true"
|
|
833
847
|
})
|
|
@@ -836,124 +850,132 @@ function qe({ goalId: e, onClose: n, translate: r }) {
|
|
|
836
850
|
] }, e.id)) })] })
|
|
837
851
|
})]
|
|
838
852
|
}),
|
|
839
|
-
/* @__PURE__ */
|
|
853
|
+
/* @__PURE__ */ N("section", {
|
|
840
854
|
className: "space-y-3 rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
841
|
-
children: [/* @__PURE__ */
|
|
855
|
+
children: [/* @__PURE__ */ M("h3", {
|
|
842
856
|
className: "text-sm font-semibold text-text-primary",
|
|
843
857
|
children: r("brainyrich.goals.detail.linkTitle", "Link an account")
|
|
844
|
-
}), p.length === 0 ? /* @__PURE__ */
|
|
858
|
+
}), p.length === 0 ? /* @__PURE__ */ M("p", {
|
|
845
859
|
className: "text-sm text-text-secondary",
|
|
846
860
|
children: r("brainyrich.goals.detail.noAccounts", "No accounts available to link.")
|
|
847
|
-
}) : /* @__PURE__ */
|
|
848
|
-
/* @__PURE__ */
|
|
861
|
+
}) : /* @__PURE__ */ N(j, { children: [
|
|
862
|
+
/* @__PURE__ */ N("div", {
|
|
849
863
|
className: "space-y-1.5",
|
|
850
|
-
children: [/* @__PURE__ */
|
|
864
|
+
children: [/* @__PURE__ */ M(G, {
|
|
851
865
|
htmlFor: "funding-account",
|
|
852
866
|
children: r("brainyrich.goals.detail.account", "Account")
|
|
853
|
-
}), /* @__PURE__ */
|
|
867
|
+
}), /* @__PURE__ */ N(K, {
|
|
854
868
|
value: b,
|
|
855
|
-
onValueChange:
|
|
856
|
-
children: [/* @__PURE__ */
|
|
869
|
+
onValueChange: S,
|
|
870
|
+
children: [/* @__PURE__ */ M(Y, {
|
|
857
871
|
id: "funding-account",
|
|
858
|
-
children: /* @__PURE__ */
|
|
859
|
-
}), /* @__PURE__ */
|
|
872
|
+
children: /* @__PURE__ */ M(X, { placeholder: r("brainyrich.goals.detail.selectAccount", "Select account") })
|
|
873
|
+
}), /* @__PURE__ */ M(q, { children: p.map((e) => /* @__PURE__ */ M(J, {
|
|
860
874
|
value: e.id,
|
|
861
875
|
children: e.name
|
|
862
876
|
}, e.id)) })]
|
|
863
877
|
})]
|
|
864
878
|
}),
|
|
865
|
-
/* @__PURE__ */
|
|
879
|
+
/* @__PURE__ */ N("div", {
|
|
866
880
|
className: "grid grid-cols-2 gap-3",
|
|
867
|
-
children: [/* @__PURE__ */
|
|
881
|
+
children: [/* @__PURE__ */ N("div", {
|
|
868
882
|
className: "space-y-1.5",
|
|
869
|
-
children: [/* @__PURE__ */
|
|
883
|
+
children: [/* @__PURE__ */ M(G, {
|
|
870
884
|
htmlFor: "funding-mode",
|
|
871
885
|
children: r("brainyrich.goals.detail.mode", "Method")
|
|
872
|
-
}), /* @__PURE__ */
|
|
873
|
-
value:
|
|
874
|
-
onValueChange: (e) =>
|
|
875
|
-
children: [/* @__PURE__ */
|
|
886
|
+
}), /* @__PURE__ */ N(K, {
|
|
887
|
+
value: C,
|
|
888
|
+
onValueChange: (e) => ge(e),
|
|
889
|
+
children: [/* @__PURE__ */ M(Y, {
|
|
876
890
|
id: "funding-mode",
|
|
877
|
-
children: /* @__PURE__ */
|
|
878
|
-
}), /* @__PURE__ */
|
|
891
|
+
children: /* @__PURE__ */ M(X, {})
|
|
892
|
+
}), /* @__PURE__ */ N(q, { children: [/* @__PURE__ */ M(J, {
|
|
879
893
|
value: "PERCENT",
|
|
880
894
|
children: r("brainyrich.goals.detail.percent", "Percentage")
|
|
881
|
-
}), /* @__PURE__ */
|
|
895
|
+
}), /* @__PURE__ */ M(J, {
|
|
882
896
|
value: "FIXED",
|
|
883
897
|
children: r("brainyrich.goals.detail.fixed", "Fixed amount")
|
|
884
898
|
})] })]
|
|
885
899
|
})]
|
|
886
|
-
}), /* @__PURE__ */
|
|
900
|
+
}), /* @__PURE__ */ N("div", {
|
|
887
901
|
className: "space-y-1.5",
|
|
888
|
-
children: [/* @__PURE__ */
|
|
902
|
+
children: [/* @__PURE__ */ M(G, {
|
|
889
903
|
htmlFor: "funding-value",
|
|
890
|
-
children:
|
|
891
|
-
}), /* @__PURE__ */
|
|
904
|
+
children: C === "PERCENT" ? r("brainyrich.goals.detail.pct", "Percent") : r("brainyrich.goals.detail.amount", "Amount")
|
|
905
|
+
}), /* @__PURE__ */ M(W, {
|
|
892
906
|
id: "funding-value",
|
|
893
907
|
type: "number",
|
|
894
908
|
min: 0,
|
|
895
909
|
step: "0.01",
|
|
896
|
-
value:
|
|
897
|
-
onChange: (e) =>
|
|
910
|
+
value: w,
|
|
911
|
+
onChange: (e) => ve(e.target.value)
|
|
898
912
|
})]
|
|
899
913
|
})]
|
|
900
914
|
}),
|
|
901
|
-
/* @__PURE__ */
|
|
915
|
+
/* @__PURE__ */ N(P, {
|
|
902
916
|
size: "sm",
|
|
903
917
|
className: "w-full",
|
|
904
|
-
disabled: !
|
|
905
|
-
onClick:
|
|
906
|
-
children: [/* @__PURE__ */
|
|
918
|
+
disabled: !Se || g.isPending,
|
|
919
|
+
onClick: H,
|
|
920
|
+
children: [/* @__PURE__ */ M(he, {
|
|
907
921
|
className: "size-4",
|
|
908
922
|
"aria-hidden": "true"
|
|
909
|
-
}),
|
|
923
|
+
}), g.isPending ? r("brainyrich.goals.detail.linking", "Linking…") : r("brainyrich.goals.detail.link", "Link funding")]
|
|
910
924
|
})
|
|
911
925
|
] })]
|
|
912
926
|
}),
|
|
913
|
-
/* @__PURE__ */
|
|
927
|
+
/* @__PURE__ */ M(be, { children: /* @__PURE__ */ M(xe, {
|
|
928
|
+
className: "p-4",
|
|
929
|
+
children: /* @__PURE__ */ M(y, {
|
|
930
|
+
entityType: "brainyrich-goal",
|
|
931
|
+
entityId: o.id,
|
|
932
|
+
label: r("brainyrich.goals.detail.tags", "Tags")
|
|
933
|
+
})
|
|
934
|
+
}) }),
|
|
935
|
+
/* @__PURE__ */ N("section", {
|
|
914
936
|
className: "space-y-3 rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
915
937
|
children: [
|
|
916
|
-
/* @__PURE__ */
|
|
938
|
+
/* @__PURE__ */ M("h3", {
|
|
917
939
|
className: "text-sm font-semibold text-text-primary",
|
|
918
940
|
children: r("brainyrich.goals.detail.recalcTitle", "Recalculate projection")
|
|
919
941
|
}),
|
|
920
|
-
/* @__PURE__ */
|
|
942
|
+
/* @__PURE__ */ N("div", {
|
|
921
943
|
className: "space-y-1.5",
|
|
922
944
|
children: [
|
|
923
|
-
/* @__PURE__ */
|
|
945
|
+
/* @__PURE__ */ M(G, {
|
|
924
946
|
htmlFor: "recalc-funded",
|
|
925
947
|
children: r("brainyrich.goals.detail.fundedAmount", "Funded amount")
|
|
926
948
|
}),
|
|
927
|
-
/* @__PURE__ */
|
|
949
|
+
/* @__PURE__ */ M(W, {
|
|
928
950
|
id: "recalc-funded",
|
|
929
951
|
type: "number",
|
|
930
952
|
min: 0,
|
|
931
953
|
step: "0.01",
|
|
932
|
-
value:
|
|
933
|
-
placeholder: String(
|
|
934
|
-
onChange: (e) =>
|
|
954
|
+
value: E,
|
|
955
|
+
placeholder: String(I),
|
|
956
|
+
onChange: (e) => D(e.target.value)
|
|
935
957
|
}),
|
|
936
|
-
/* @__PURE__ */
|
|
958
|
+
/* @__PURE__ */ M("p", {
|
|
937
959
|
className: "text-xs text-text-secondary",
|
|
938
960
|
children: r("brainyrich.goals.detail.recalcHint", "Defaults to the sum of fixed fundings when left blank.")
|
|
939
961
|
})
|
|
940
962
|
]
|
|
941
963
|
}),
|
|
942
|
-
/* @__PURE__ */
|
|
964
|
+
/* @__PURE__ */ N(P, {
|
|
943
965
|
size: "sm",
|
|
944
966
|
variant: "outline",
|
|
945
967
|
className: "w-full",
|
|
946
968
|
disabled: v.isPending,
|
|
947
|
-
onClick:
|
|
948
|
-
children: [/* @__PURE__ */
|
|
969
|
+
onClick: U,
|
|
970
|
+
children: [/* @__PURE__ */ M(_e, {
|
|
949
971
|
className: "size-4",
|
|
950
972
|
"aria-hidden": "true"
|
|
951
973
|
}), v.isPending ? r("brainyrich.goals.detail.recalculating", "Recalculating…") : r("brainyrich.goals.detail.recalc", "Recalculate")]
|
|
952
974
|
})
|
|
953
975
|
]
|
|
954
976
|
})
|
|
955
|
-
] }) : /* @__PURE__ */
|
|
956
|
-
icon: /* @__PURE__ */
|
|
977
|
+
] }) : /* @__PURE__ */ M(oe, {
|
|
978
|
+
icon: /* @__PURE__ */ M(T, {
|
|
957
979
|
className: "size-6",
|
|
958
980
|
"aria-hidden": "true"
|
|
959
981
|
}),
|
|
@@ -961,23 +983,23 @@ function qe({ goalId: e, onClose: n, translate: r }) {
|
|
|
961
983
|
})
|
|
962
984
|
})]
|
|
963
985
|
})
|
|
964
|
-
}), /* @__PURE__ */
|
|
965
|
-
open: !!
|
|
986
|
+
}), /* @__PURE__ */ M(ne, {
|
|
987
|
+
open: !!A,
|
|
966
988
|
onOpenChange: (e) => {
|
|
967
|
-
e ||
|
|
989
|
+
e || F(null);
|
|
968
990
|
},
|
|
969
991
|
title: r("brainyrich.goals.detail.unlinkTitle", "Unlink funding?"),
|
|
970
|
-
description: r("brainyrich.goals.detail.unlinkConfirm", "This removes the “{name}” funding link from this goal.", { name:
|
|
992
|
+
description: r("brainyrich.goals.detail.unlinkConfirm", "This removes the “{name}” funding link from this goal.", { name: Ce }),
|
|
971
993
|
confirmLabel: r("brainyrich.goals.detail.unlink", "Unlink funding"),
|
|
972
994
|
pendingLabel: r("brainyrich.goals.detail.unlinking", "Unlinking…"),
|
|
973
995
|
destructive: !0,
|
|
974
|
-
pending:
|
|
996
|
+
pending: _.isPending,
|
|
975
997
|
onConfirm: () => {
|
|
976
|
-
|
|
998
|
+
A && _.mutate(A.id, { onSuccess: () => F(null) });
|
|
977
999
|
}
|
|
978
1000
|
})] });
|
|
979
1001
|
}
|
|
980
1002
|
//#endregion
|
|
981
|
-
export {
|
|
1003
|
+
export { Je as GoalsPage };
|
|
982
1004
|
|
|
983
1005
|
//# sourceMappingURL=GoalsPage.js.map
|