@burdenoff/microfe-brainyrich 2026.1101.2 → 2026.1101.3

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