@mx-cartographer/experiences 7.2.8 → 7.2.9-alpha-finstrong-testing

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 (125) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{Account-B-CuHOYf.mjs → Account-CBQnFO6w.mjs} +1 -1
  3. package/dist/{AccountDetailsContent-DfzPOeMI.mjs → AccountDetailsContent-BcX5y6ja.mjs} +10 -10
  4. package/dist/{AccountDetailsHeader-vcy67tuH.mjs → AccountDetailsHeader-Cj5DDzkQ.mjs} +8 -8
  5. package/dist/{AccountFields-cUP-9Hm6.mjs → AccountFields-CLbLAhLf.mjs} +5 -5
  6. package/dist/{AccountListItem-DChcf3SN.mjs → AccountListItem-CPm3572e.mjs} +4 -4
  7. package/dist/{AccountStore-D6KiXA1B.mjs → AccountStore-DttEGFeu.mjs} +40 -29
  8. package/dist/{Accounts-IeEtQjzA.mjs → Accounts-B5Yr0e_o.mjs} +1 -1
  9. package/dist/{BudgetUtil-B2ZXyw-g.mjs → BudgetUtil-wjoNuj7B.mjs} +1 -1
  10. package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-ZO9N26Kx.mjs} +3 -3
  11. package/dist/{CategoryStore-BCcpI3oJ.mjs → CategoryStore-C1IfDPCE.mjs} +1 -1
  12. package/dist/{CategoryUtil-BR3H5i6n.mjs → CategoryUtil-DUM8NuGO.mjs} +1 -1
  13. package/dist/{ConnectDrawer-DaFRU5st.mjs → ConnectDrawer-FyY0AWYQ.mjs} +2 -2
  14. package/dist/{ConnectionsDrawer-DHJ7qdWL.mjs → ConnectionsDrawer-Cd_rztVC.mjs} +3 -3
  15. package/dist/{CurrencyInput-CsCy7uaS.mjs → CurrencyInput-CBOkNlNP.mjs} +1 -1
  16. package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CBdcsyuk.mjs} +3 -3
  17. package/dist/{DebtsStore-z3VARSO6.mjs → DebtsStore-DB5U2WMC.mjs} +1 -1
  18. package/dist/{Dialog-CWW597AF.mjs → Dialog-BPTr3qHE.mjs} +2 -2
  19. package/dist/Drawer-BEtCk82g.mjs +163 -0
  20. package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-DlGZfm4y.mjs} +3 -3
  21. package/dist/FinstrongStore-CjErZ73K.mjs +432 -0
  22. package/dist/{GoalStore-TD0BfzWX.mjs → GoalStore-deVLYr7n.mjs} +3 -3
  23. package/dist/{Help-B6dIcujh.mjs → Help-BnPXM_N2.mjs} +2 -2
  24. package/dist/{LineChart-D4GI7nVh.mjs → LineChart-CDnYtQKZ.mjs} +3 -3
  25. package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-uobBrm_a.mjs} +10 -10
  26. package/dist/{ManageIncome-D3n1EWxe.mjs → ManageIncome-DB_lKOIy.mjs} +63 -61
  27. package/dist/{MicroWidgetContainer-DpeqN9n3.mjs → MicroWidgetContainer-DEiRnYVa.mjs} +1 -1
  28. package/dist/{MiniWidgetContainer-D0gfmbaF.mjs → MiniWidgetContainer-CmXpTylX.mjs} +1 -1
  29. package/dist/{NetWorthStore-B_1oulrt.mjs → NetWorthStore-CUz0bwVm.mjs} +2 -2
  30. package/dist/{NotificationSettings-BRm_EJZV.mjs → NotificationSettings-Bfb3T7nN.mjs} +5 -5
  31. package/dist/{OriginalBalanceAction-CAaVbVMO.mjs → OriginalBalanceAction-BLiU-7Lf.mjs} +3 -3
  32. package/dist/{RecurringSettings-C28GrQcP.mjs → RecurringSettings-dJJxtLyU.mjs} +4 -4
  33. package/dist/{RecurringTransactions-ej39mgA6.mjs → RecurringTransactions-CngsRZ3K.mjs} +45 -44
  34. package/dist/{RecurringTransactionsStore-DrzS1LmF.mjs → RecurringTransactionsStore-C4RVULF8.mjs} +1 -1
  35. package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-BuJ03S9d.mjs} +16 -16
  36. package/dist/SpendingLegend-squvjEhu.mjs +170 -0
  37. package/dist/{TransactionDetails-BWffqew4.mjs → TransactionDetails-CJvE4LNC.mjs} +11 -8
  38. package/dist/{TransactionStore-DxPLdF3B.mjs → TransactionStore-DvOEbOzL.mjs} +3 -3
  39. package/dist/{TrendsStore-DCYbpXPO.mjs → TrendsStore-BVNxGsE4.mjs} +14 -14
  40. package/dist/{User-BQUxBeZV.mjs → User-wXzDI4M8.mjs} +2 -2
  41. package/dist/{WidgetContainer-C88Ecu2W.mjs → WidgetContainer-GoNq8wwm.mjs} +4 -4
  42. package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
  43. package/dist/accounts/index.es.js +14 -14
  44. package/dist/accounts/stores/AccountStore.d.ts +2 -0
  45. package/dist/analytics/index.es.js +2 -2
  46. package/dist/budgets/index.es.js +12 -12
  47. package/dist/cashflow/index.es.js +44 -44
  48. package/dist/categories/index.es.js +2 -2
  49. package/dist/common/components/Select.d.ts +4 -2
  50. package/dist/common/components/drawer/Drawer.d.ts +3 -0
  51. package/dist/common/components/drawer/Footer.d.ts +17 -0
  52. package/dist/common/index.es.js +33 -33
  53. package/dist/common/types/Finstrong.d.ts +50 -0
  54. package/dist/common/types/index.d.ts +1 -1
  55. package/dist/common/types/localization/FinstrongCopy.d.ts +58 -1
  56. package/dist/dashboard/index.es.js +2 -2
  57. package/dist/debts/index.es.js +11 -11
  58. package/dist/{exportTransactionsToCSV-7bVS7KXf.mjs → exportTransactionsToCSV-hrNpJ77n.mjs} +2 -2
  59. package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
  60. package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
  61. package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
  62. package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
  63. package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
  64. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
  65. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
  66. package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
  67. package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
  68. package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
  69. package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
  70. package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
  71. package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
  72. package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
  73. package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
  74. package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
  75. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
  76. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
  77. package/dist/finstrong/components/ProgressBar.d.ts +15 -0
  78. package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
  79. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
  80. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
  81. package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
  82. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
  83. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
  84. package/dist/finstrong/components/StatusChip.d.ts +5 -0
  85. package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
  86. package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +11 -0
  87. package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
  88. package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
  89. package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
  90. package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
  91. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
  92. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
  93. package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
  94. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +25 -0
  95. package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
  96. package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
  97. package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
  98. package/dist/finstrong/components/shared/TransactionList.d.ts +15 -0
  99. package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
  100. package/dist/finstrong/constants/index.d.ts +8 -0
  101. package/dist/finstrong/index.es.js +2893 -1005
  102. package/dist/finstrong/stores/FinstrongStore.d.ts +9 -1
  103. package/dist/finstrong/util/finstrongUtils.d.ts +60 -1
  104. package/dist/goals/index.es.js +14 -14
  105. package/dist/help/index.es.js +3 -3
  106. package/dist/{hooks-D6XlXHf4.mjs → hooks-C41HAxM5.mjs} +3 -3
  107. package/dist/investments/index.es.js +4 -4
  108. package/dist/merchants/index.es.js +1 -1
  109. package/dist/microinsights/{components/insightsmicrowidget/InsightsMicroWidget.d.ts → InsightsMicroWidget.d.ts} +2 -2
  110. package/dist/microinsights/index.d.ts +1 -1
  111. package/dist/networth/index.es.js +34 -34
  112. package/dist/notifications/index.es.js +4 -4
  113. package/dist/recurringtransactions/index.es.js +13 -13
  114. package/dist/settings/index.es.js +8 -8
  115. package/dist/spending/index.es.js +222 -373
  116. package/dist/transactions/index.es.js +15 -15
  117. package/dist/trends/index.es.js +94 -94
  118. package/dist/{useAccountDisplayName-BcRqfar8.mjs → useAccountDisplayName-B5O6hQ1B.mjs} +2 -2
  119. package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-CNjP5cfR.mjs} +1 -1
  120. package/package.json +1 -1
  121. package/dist/Drawer-kEE73B87.mjs +0 -113
  122. package/dist/FinstrongStore-F2c607dj.mjs +0 -101
  123. package/dist/finstrong/utils/Finstrong.d.ts +0 -6
  124. /package/dist/microinsights/{components/MicroWidgetContainer.d.ts → MicroWidgetContainer.d.ts} +0 -0
  125. /package/dist/microinsights/{components/spinner/Spinner.d.ts → Spinner.d.ts} +0 -0
@@ -1,280 +1,172 @@
1
- import { jsx as e, jsxs as u, Fragment as re } from "react/jsx-runtime";
2
- import x from "@mui/material/Box";
3
- import g from "@mui/material/Stack";
4
- import { useTheme as G, alpha as te } from "@mui/material/styles";
5
- import { PieChart as Oe } from "@mui/x-charts";
6
- import { ChevronRight as j, Check as De, TrendingUp as Me, ArrowRightAlt as Te, TrendingDown as we, AccountBalance as me, ExpandMore as Re, Payments as Fe, CalendarMonth as Pe, CreditCard as ue, Savings as Ge, ContentCopy as Le, MultilineChart as Ee } from "@mxenabled/mx-icons";
7
- import { Text as W, P as y, H3 as H, Icon as he } from "@mxenabled/mxui";
8
- import { format as _e } from "date-fns/format";
9
- import C from "react";
10
- import We from "@mui/material/Avatar";
11
- import ge from "@mui/material/Divider";
12
- import Be from "@mui/material/List";
13
- import He from "@mui/material/ListItem";
14
- import ze from "@mui/material/ListItemAvatar";
15
- import $e from "@mui/material/ListItemButton";
16
- import Ne from "@mui/material/ListItemText";
17
- import { b } from "../Localization-2MODESHW.mjs";
18
- import * as ce from "d3";
19
- import { observer as I } from "mobx-react-lite";
20
- import { u as S, b as z, x as $, p as Y, d as fe, i as ye, m as Ke } from "../hooks-D6XlXHf4.mjs";
21
- import { L as N } from "../Loader-DUaFpDGv.mjs";
22
- import { F as No, a as Ko } from "../FinstrongStore-F2c607dj.mjs";
23
- import q from "@mui/material/Button";
24
- import J from "@mui/material/Card";
25
- import { L as be } from "../LineChart-D4GI7nVh.mjs";
26
- import { l as xe } from "../ConnectDrawer-DaFRU5st.mjs";
27
- import Xe from "@mui/material/Accordion";
28
- import je from "@mui/material/AccordionDetails";
29
- import Ue from "@mui/material/AccordionSummary";
30
- import Ve from "@mui/material/CardHeader";
31
- import { u as Ye } from "../useDimensions-27p2evRx.mjs";
32
- import { C as qe } from "../ConnectionsDrawer-DHJ7qdWL.mjs";
33
- import { R as Je } from "../RecurringSettings-C28GrQcP.mjs";
34
- import Qe from "@mui/material/TextField";
35
- import { u as Ce } from "../useScreenSize-B6JyS_Lj.mjs";
36
- import { a as Ze } from "../Dialog-CWW597AF.mjs";
37
- import { AdapterDateFns as et } from "@mui/x-date-pickers/AdapterDateFnsV3";
38
- import { StaticDatePicker as tt } from "@mui/x-date-pickers";
39
- import { LocalizationProvider as ot } from "@mui/x-date-pickers/LocalizationProvider";
40
- import { D as V } from "../Drawer-kEE73B87.mjs";
41
- import oe from "@mui/material/Tab";
42
- import nt from "@mui/material/Tabs";
43
- import { f as rt } from "../NumberFormatting-Buh7u8Oi.mjs";
44
- import { T as ne } from "../TabContentContainer-j01JYR_7.mjs";
45
- import it from "@mui/lab/Timeline";
46
- import st, { timelineItemClasses as at } from "@mui/lab/TimelineItem";
47
- import ct from "@mui/lab/TimelineConnector";
48
- import lt from "@mui/lab/TimelineContent";
49
- import dt from "@mui/lab/TimelineDot";
50
- import pt from "@mui/lab/TimelineSeparator";
51
- import { W as mt } from "../WidgetContainer-C88Ecu2W.mjs";
52
- var A = /* @__PURE__ */ ((n) => (n.Connections = "connections", n.CreditScore = "credit_score", n.DateOfBirth = "date_of_birth", n.MonthlyIncome = "monthly_income", n))(A || {});
53
- const ut = ({ list: n, onClickItem: o }) => /* @__PURE__ */ e(x, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(
54
- Be,
55
- {
56
- sx: {
57
- "& .MuiListItemSecondaryAction-root": {
58
- color: "text.primary",
59
- pr: 24
60
- }
61
- },
62
- children: n.map((t, i) => /* @__PURE__ */ u(C.Fragment, { children: [
63
- /* @__PURE__ */ e(He, { secondaryAction: /* @__PURE__ */ e(j, {}), children: /* @__PURE__ */ u($e, { onClick: () => o(t.key), children: [
64
- /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(
65
- We,
66
- {
67
- sx: {
68
- bgcolor: "primary.main",
69
- ...!t.isComplete && {
70
- bgcolor: "transparent",
71
- borderColor: "action.active",
72
- borderStyle: "solid",
73
- borderWidth: 1,
74
- color: "action.active"
75
- }
76
- },
77
- children: t.icon
78
- }
79
- ) }),
80
- /* @__PURE__ */ e(
81
- Ne,
82
- {
83
- primary: /* @__PURE__ */ e(W, { sx: { color: "text.secondary" }, variant: "caption", children: t.primaryText }),
84
- secondary: /* @__PURE__ */ e(W, { sx: { color: "text.primary", fontWeight: 600 }, variant: "body1", children: t.secondaryText })
85
- }
86
- )
87
- ] }) }),
88
- i < n.length - 1 && /* @__PURE__ */ e(ge, { sx: { color: "divider", ml: 68 } })
89
- ] }, t.key))
90
- }
91
- ) }), ht = ut, le = (n) => n * (180 / Math.PI), ie = (n, o) => [
92
- {
93
- description: o.vulnerable_description,
94
- max: 25,
95
- scoreContent: o.accordion_details_text.vulnerable,
96
- status: o.vulnerable
97
- },
98
- {
99
- description: o.building_description,
100
- max: 50,
101
- scoreContent: o.accordion_details_text.building,
102
- status: o.building
103
- },
104
- {
105
- description: o.stable_description,
106
- max: 75,
107
- scoreContent: o.accordion_details_text.stable,
108
- status: o.stable
109
- },
110
- {
111
- description: o.strong_description,
112
- max: 100,
113
- scoreContent: o.accordion_details_text.strong,
114
- status: o.strong
115
- }
116
- ].find((d) => n > 0 && n <= d.max) || { status: o.insufficient_data, description: "", scoreContent: "" }, D = {
117
- POOR: "#8C0E0E",
118
- FAIR: "#E32727",
119
- GOOD: "#FFB70D",
120
- VERY_GOOD: "#0EA26C",
121
- EXCEPTIONAL: "#005C3D"
122
- }, M = {
123
- POOR: "#B21C1C",
124
- FAIR: "#FF3232",
125
- GOOD: "#FFC02C",
126
- VERY_GOOD: "#29C76B",
127
- EXCEPTIONAL: "#008A5A"
128
- }, _t = (n, o, t) => n >= 300 && n < 580 ? {
129
- status: t.poor,
130
- color: o ? M.POOR : D.POOR
131
- } : n >= 580 && n < 670 ? {
132
- status: t.fair,
133
- color: o ? M.FAIR : D.FAIR
134
- } : n >= 670 && n < 740 ? {
135
- status: t.good,
136
- color: o ? M.GOOD : D.GOOD
137
- } : n >= 740 && n < 800 ? {
138
- status: t.very_good,
139
- color: o ? M.VERY_GOOD : D.VERY_GOOD
140
- } : n >= 800 && n <= 850 ? {
141
- status: t.exceptional,
142
- color: o ? M.EXCEPTIONAL : D.EXCEPTIONAL
143
- } : { status: t.missing_data }, gt = (n, o, t, i) => {
144
- const d = n.reduce((r, a) => r + a.value, 0);
145
- let l = 0;
146
- const s = n.map((r) => {
147
- const a = r.value / d * o, c = t + l, p = c + a;
148
- return l += a, {
149
- ...r,
150
- startAngle: c,
151
- endAngle: p
152
- };
153
- });
154
- return [s[i].startAngle, s[i].endAngle];
155
- }, ft = (n, o, t, i, d) => {
156
- let l = 0, s = 0;
157
- const r = Math.floor(i), a = i - r;
158
- return r > t ? (l = n, s = o) : r === t && a > 0 && (l = n, s = d), [l, s];
159
- }, yt = (n, o, t = 0) => {
160
- const i = n * Math.sin(o - t), d = -n * Math.cos(o - t);
161
- return [i, d];
162
- }, bt = ({
163
- dynamicCopy: n,
164
- fallbackLabel: o,
165
- icon: t,
166
- key: i,
167
- label: d,
168
- value: l
169
- }) => {
170
- const s = !!l, r = s ? xt(i, l) : n && b(n, o) || o;
171
- return {
172
- icon: s ? /* @__PURE__ */ e(De, {}) : t,
173
- isComplete: s,
174
- key: i,
175
- primaryText: d,
176
- secondaryText: r
177
- };
178
- }, xt = (n, o) => ({
179
- [A.DateOfBirth]: (i) => _e(new Date(Number(i) * 1e3), "MMM d, yyyy"),
180
- [A.MonthlyIncome]: (i) => `$${i}`
181
- })[n]?.(o) ?? String(o), de = (n) => n !== null ? Math.round(n * 100) : null, Ct = ({
182
- dialScoreData: n,
183
- dataIndex: o,
184
- arcColor: t,
185
- arcStartAngle: i,
186
- totalAngularSpan: d,
187
- centerX: l,
188
- centerY: s,
189
- arcRadius: r,
190
- innerArcRadius: a,
191
- outterArcRadius: c,
192
- progressEndAngle: p,
193
- unitsPerSegment: h,
194
- isFinacialStrengthGraph: m
1
+ import { jsxs as i, Fragment as E, jsx as e } from "react/jsx-runtime";
2
+ import D from "@mui/material/Box";
3
+ import u from "@mui/material/Stack";
4
+ import { useTheme as H, alpha as pe } from "@mui/material/styles";
5
+ import { PieChart as Kt, BarPlot as jt } from "@mui/x-charts";
6
+ import { TrendingUp as rt, ArrowRightAlt as Vt, TrendingDown as Yt, AccountBalance as at, ChevronRight as Z, CheckCircle as Xt, Cancel as Ut, MultilineChart as it, CreditCard as st, Savings as qt, ContentCopy as Zt, Add as ct, Cardiology as Qt, Payments as Jt, CalendarMonth as en, ExpandMore as tn } from "@mxenabled/mx-icons";
7
+ import { P as k, H3 as Y, Text as T, InstitutionLogo as lt, H2 as De, MerchantLogo as nn, Icon as on } from "@mxenabled/mxui";
8
+ import { g as rn, a as an, r as Ve, b as sn, c as $e, d as cn, C as ge, e as ye, f as ln, h as dn, i as dt, j as Ye, k as pn, l as Xe, m as un, n as pt, o as _n, p as hn, q as ut, s as ve, t as mn, u as gn, v as yn, w as bn, A as Q, x as fn, P as xn } from "../FinstrongStore-CjErZ73K.mjs";
9
+ import { y as _i, F as hi } from "../FinstrongStore-CjErZ73K.mjs";
10
+ import * as Ue from "d3";
11
+ import { observer as S } from "mobx-react-lite";
12
+ import { u as C, b as X, p as ee, z as F, q as Sn, a as _t, d as fe, m as Le, g as Cn, f as vn, j as wn, h as kn, i as ht } from "../hooks-C41HAxM5.mjs";
13
+ import { L as te } from "../Loader-DUaFpDGv.mjs";
14
+ import h from "react";
15
+ import L from "@mui/material/Button";
16
+ import K from "@mui/material/Card";
17
+ import { L as We } from "../LineChart-CDnYtQKZ.mjs";
18
+ import { C as mt } from "../ConnectionsDrawer-Cd_rztVC.mjs";
19
+ import { l as ne, g as gt, A as Re } from "../ConnectDrawer-FyY0AWYQ.mjs";
20
+ import re from "@mui/material/Tab";
21
+ import Ee from "@mui/material/Tabs";
22
+ import we from "@mui/material/TextField";
23
+ import { u as Ge } from "../useScreenSize-B6JyS_Lj.mjs";
24
+ import { D as Dn, f as An, a as Mn } from "../Dialog-BPTr3qHE.mjs";
25
+ import In from "@mui/material/Chip";
26
+ import { D as ie } from "../Drawer-BEtCk82g.mjs";
27
+ import J from "@mui/material/Divider";
28
+ import yt from "@mui/material/ListItem";
29
+ import bt from "@mui/material/ListItemAvatar";
30
+ import ft from "@mui/material/ListItemText";
31
+ import { g as xt } from "../AccountFields-CLbLAhLf.mjs";
32
+ import St from "@mui/material/List";
33
+ import Tn from "@mui/material/ListItemButton";
34
+ import On from "@mui/material/ListSubheader";
35
+ import { f as B } from "../NumberFormatting-Buh7u8Oi.mjs";
36
+ import { S as qe, F as Fn } from "../RecurringTransactions-CngsRZ3K.mjs";
37
+ import { Button as Pn } from "@mui/material";
38
+ import { S as Rn } from "../StatusBar-BK_uYHAB.mjs";
39
+ import { h as ze } from "../DateUtil-CBdcsyuk.mjs";
40
+ import { useVirtualizer as Bn } from "@tanstack/react-virtual";
41
+ import { u as $n, s as Be, h as Ct, S as vt, b as wt, Z as Ln } from "../TransactionDetails-CJvE4LNC.mjs";
42
+ import { A as Wn, W as En } from "../WidgetContainer-GoNq8wwm.mjs";
43
+ import { u as kt } from "../useDimensions-27p2evRx.mjs";
44
+ import { T as ae } from "../TabContentContainer-j01JYR_7.mjs";
45
+ import { b as V } from "../Localization-2MODESHW.mjs";
46
+ import { E as ke } from "../EmptyState-DA_lfRBv.mjs";
47
+ import Gn from "@mui/material/useMediaQuery";
48
+ import { ChartsXAxis as zn } from "@mui/x-charts/ChartsXAxis";
49
+ import { ChartsYAxis as Hn } from "@mui/x-charts/ChartsYAxis";
50
+ import { ResponsiveChartContainer as Nn } from "@mui/x-charts/ResponsiveChartContainer";
51
+ import { useSpring as Kn, animated as Ze } from "@react-spring/web";
52
+ import { startOfMonth as Dt } from "date-fns/startOfMonth";
53
+ import { endOfMonth as At } from "date-fns/endOfMonth";
54
+ import { g as jn, S as Vn, b as Yn } from "../SpendingLegend-squvjEhu.mjs";
55
+ import { startOfToday as Qe } from "date-fns/startOfToday";
56
+ import { subDays as Xn } from "date-fns/subDays";
57
+ import { c as Un, d as Je, S as qn, i as Zn } from "../ManageIncome-DB_lKOIy.mjs";
58
+ import { LocalizationProvider as Qn, DatePicker as Jn, StaticDatePicker as eo } from "@mui/x-date-pickers";
59
+ import { AdapterDateFns as Mt } from "@mui/x-date-pickers/AdapterDateFnsV3";
60
+ import { R as to } from "../RecurringSettings-dJJxtLyU.mjs";
61
+ import { LocalizationProvider as no } from "@mui/x-date-pickers/LocalizationProvider";
62
+ import { format as oo } from "date-fns/format";
63
+ import ro from "@mui/lab/Timeline";
64
+ import ao, { timelineItemClasses as io } from "@mui/lab/TimelineItem";
65
+ import so from "@mui/lab/TimelineConnector";
66
+ import co from "@mui/lab/TimelineContent";
67
+ import lo from "@mui/lab/TimelineDot";
68
+ import po from "@mui/lab/TimelineSeparator";
69
+ import uo from "@mui/material/Accordion";
70
+ import _o from "@mui/material/AccordionDetails";
71
+ import ho from "@mui/material/AccordionSummary";
72
+ import mo from "@mui/material/CardHeader";
73
+ const go = ({
74
+ dialScoreData: t,
75
+ dataIndex: r,
76
+ arcColor: n,
77
+ arcStartAngle: o,
78
+ totalAngularSpan: l,
79
+ centerX: s,
80
+ centerY: a,
81
+ arcRadius: p,
82
+ innerArcRadius: c,
83
+ outterArcRadius: d,
84
+ progressEndAngle: _,
85
+ unitsPerSegment: m,
86
+ isFinacialStrengthGraph: g
195
87
  }) => {
196
- const _ = G(), R = [
197
- { offset: "13.62%", color: _.palette.chartMono.chartMono2 },
198
- { offset: "36.67%", color: _.palette.chartMono.chartMono3 },
199
- { offset: "59.72%", color: _.palette.chartMono.chartMono4 },
200
- { offset: "83.46%", color: _.palette.chartMono.chartMono5 }
201
- ], [T, v] = gt(
202
- n,
203
- d,
204
- i,
205
- o
206
- ), [L, E] = ft(
207
- T,
208
- v,
88
+ const y = H(), v = [
89
+ { offset: "13.62%", color: y.palette.chartMono.chartMono2 },
90
+ { offset: "36.67%", color: y.palette.chartMono.chartMono3 },
91
+ { offset: "59.72%", color: y.palette.chartMono.chartMono4 },
92
+ { offset: "83.46%", color: y.palette.chartMono.chartMono5 }
93
+ ], [b, f] = rn(
94
+ t,
95
+ l,
209
96
  o,
210
- h,
211
- p
212
- ), K = ce.arc().innerRadius(a).outerRadius(c).startAngle(T).endAngle(v).padAngle(0.02).cornerRadius(8), F = ce.arc().innerRadius(a).outerRadius(c).startAngle(L).endAngle(E).padAngle(0.02).cornerRadius(8);
213
- return /* @__PURE__ */ u(re, { children: [
97
+ r
98
+ ), [x, w] = an(
99
+ b,
100
+ f,
101
+ r,
102
+ m,
103
+ _
104
+ ), O = Ue.arc().innerRadius(c).outerRadius(d).startAngle(b).endAngle(f).padAngle(0.02).cornerRadius(8), A = Ue.arc().innerRadius(c).outerRadius(d).startAngle(x).endAngle(w).padAngle(0.02).cornerRadius(8);
105
+ return /* @__PURE__ */ i(E, { children: [
214
106
  /* @__PURE__ */ e(
215
107
  "path",
216
108
  {
217
- d: K({}),
218
- fill: m ? _.palette.divider : t
109
+ d: O({}),
110
+ fill: g ? y.palette.divider : n
219
111
  }
220
112
  ),
221
- m && /* @__PURE__ */ e("path", { d: F({}), fill: "url(#arcGradient)" }),
113
+ g && /* @__PURE__ */ e("path", { d: A({}), fill: "url(#arcGradient)" }),
222
114
  /* @__PURE__ */ e("defs", { children: /* @__PURE__ */ e(
223
115
  "linearGradient",
224
116
  {
225
- gradientTransform: `rotate(5, ${l}, ${s})`,
117
+ gradientTransform: `rotate(5, ${s}, ${a})`,
226
118
  gradientUnits: "userSpaceOnUse",
227
119
  id: "arcGradient",
228
- x1: l + r * 0.8 * Math.cos(Math.PI / 1.35),
229
- x2: l - r * 0.8 * Math.cos(Math.PI / 1.35),
230
- y1: s + r * 0.8 * Math.sin(Math.PI / 1.35),
231
- y2: s - r * 0.8 * Math.sin(Math.PI / 1.35),
232
- children: R.map((w, O) => /* @__PURE__ */ e("stop", { offset: w.offset, stopColor: w.color }, O))
120
+ x1: s + p * 0.8 * Math.cos(Math.PI / 1.35),
121
+ x2: s - p * 0.8 * Math.cos(Math.PI / 1.35),
122
+ y1: a + p * 0.8 * Math.sin(Math.PI / 1.35),
123
+ y2: a - p * 0.8 * Math.sin(Math.PI / 1.35),
124
+ children: v.map((N, G) => /* @__PURE__ */ e("stop", { offset: N.offset, stopColor: N.color }, G))
233
125
  }
234
126
  ) })
235
127
  ] });
236
- }, Se = ({
237
- arcRadius: n = 100,
238
- healthScore: o,
239
- size: t = "L",
240
- dialScoreData: i,
241
- minValue: d = 0,
242
- maxValue: l = 100,
243
- markerColor: s,
244
- healthScoreStatus: r,
245
- footerCenterContent: a,
246
- footerLeftContent: c,
247
- footerRightContent: p,
248
- isFinacialStrengthGraph: h = !1
128
+ }, It = ({
129
+ arcRadius: t = 100,
130
+ healthScore: r,
131
+ size: n = "L",
132
+ dialScoreData: o,
133
+ minValue: l = 0,
134
+ maxValue: s = 100,
135
+ markerColor: a,
136
+ healthScoreStatus: p,
137
+ footerCenterContent: c,
138
+ footerLeftContent: d,
139
+ footerRightContent: _,
140
+ isFinacialStrengthGraph: m = !1
249
141
  }) => {
250
- const m = G(), _ = -Math.PI / 1.35, R = Math.PI / 1.35, T = R - _, v = T / (l - d), L = (o - d) * v, E = _ + L + 0.02, K = t !== "SM" ? 0.1 : 0.12, F = n, w = n * (1 - K), O = F * 2.5, k = O / 2, P = O / 2, U = (w + F) / 2, Z = o !== 25 && o !== 50 && o !== 75 && o !== 100 ? 0 : 0.12, [ee, ke] = yt(U, E, Z), Ae = o / 25, se = {
142
+ const g = H(), y = -Math.PI / 1.35, v = Math.PI / 1.35, b = v - y, f = b / (s - l), x = (r - l) * f, w = y + x + 0.02, O = n !== "SM" ? 0.1 : 0.12, A = t, N = t * (1 - O), G = A * 2.5, z = G / 2, W = G / 2, ce = (N + A) / 2, j = r !== 25 && r !== 50 && r !== 75 && r !== 100 ? 0 : 0.12, [oe, le] = sn(ce, w, j), he = r / 25, U = {
251
143
  L: { markerSize: 12, healthScoreFontSize: 64 },
252
144
  M: { markerSize: 10, healthScoreFontSize: 48 },
253
145
  SM: { markerSize: 3, healthScoreFontSize: 14 }
254
- }, Ie = a === 0 ? Te : we;
255
- return /* @__PURE__ */ u(
256
- g,
146
+ }, Oe = c === 0 ? Vt : Yt;
147
+ return /* @__PURE__ */ i(
148
+ u,
257
149
  {
258
150
  sx: {
259
- width: O,
260
- height: O,
151
+ width: G,
152
+ height: G,
261
153
  position: "relative",
262
154
  alignSelf: "center"
263
155
  },
264
156
  children: [
265
157
  /* @__PURE__ */ e(
266
- Oe,
158
+ Kt,
267
159
  {
268
- height: O,
160
+ height: G,
269
161
  margin: { top: 0, right: 0, bottom: 0, left: 0 },
270
162
  series: [
271
163
  {
272
- data: i,
273
- innerRadius: w,
274
- outerRadius: F,
275
- startAngle: Math.round(le(_)),
164
+ data: o,
165
+ innerRadius: N,
166
+ outerRadius: A,
167
+ startAngle: Math.round(Ve(y)),
276
168
  // Use Math.degrees to convert
277
- endAngle: Math.round(le(R))
169
+ endAngle: Math.round(Ve(v))
278
170
  // Use Math.degrees to convert
279
171
  }
280
172
  ],
@@ -283,22 +175,22 @@ const ut = ({ list: n, onClickItem: o }) => /* @__PURE__ */ e(x, { sx: { bgcolor
283
175
  legend: { hidden: !0 }
284
176
  },
285
177
  slots: {
286
- pieArc: (ae) => /* @__PURE__ */ e(
287
- Ct,
178
+ pieArc: (xe) => /* @__PURE__ */ e(
179
+ go,
288
180
  {
289
- arcColor: ae.color,
290
- arcRadius: n,
291
- arcStartAngle: _,
292
- centerX: k,
293
- centerY: P,
294
- dataIndex: ae.dataIndex,
295
- dialScoreData: i,
296
- innerArcRadius: w,
297
- isFinacialStrengthGraph: h,
298
- outterArcRadius: F,
299
- progressEndAngle: E,
300
- totalAngularSpan: T,
301
- unitsPerSegment: Ae
181
+ arcColor: xe.color,
182
+ arcRadius: t,
183
+ arcStartAngle: y,
184
+ centerX: z,
185
+ centerY: W,
186
+ dataIndex: xe.dataIndex,
187
+ dialScoreData: o,
188
+ innerArcRadius: N,
189
+ isFinacialStrengthGraph: m,
190
+ outterArcRadius: A,
191
+ progressEndAngle: w,
192
+ totalAngularSpan: b,
193
+ unitsPerSegment: he
302
194
  }
303
195
  )
304
196
  },
@@ -307,923 +199,2847 @@ const ut = ({ list: n, onClickItem: o }) => /* @__PURE__ */ e(x, { sx: { bgcolor
307
199
  stroke: "none"
308
200
  }
309
201
  },
310
- width: O,
311
- children: o >= d && o <= l && /* @__PURE__ */ e(
202
+ width: G,
203
+ children: r >= l && r <= s && /* @__PURE__ */ e(
312
204
  "circle",
313
205
  {
314
- cx: k + ee,
315
- cy: P + ke,
316
- fill: m.palette.common.white,
317
- r: se[t].markerSize,
318
- stroke: h ? "url(#arcGradient)" : s,
319
- strokeWidth: t !== "SM" ? 3 : 1
206
+ cx: z + oe,
207
+ cy: W + le,
208
+ fill: g.palette.common.white,
209
+ r: U[n].markerSize,
210
+ stroke: m ? "url(#arcGradient)" : a,
211
+ strokeWidth: n !== "SM" ? 3 : 1
320
212
  }
321
213
  )
322
214
  }
323
215
  ),
324
216
  /* @__PURE__ */ e(
325
- x,
217
+ D,
326
218
  {
327
219
  sx: {
328
220
  position: "absolute",
329
- top: `${P}px`,
330
- left: `${k}px`,
221
+ top: `${W}px`,
222
+ left: `${z}px`,
331
223
  transform: "translate(-50%, -50%)",
332
224
  textAlign: "center"
333
225
  },
334
- children: /* @__PURE__ */ u(
335
- g,
226
+ children: /* @__PURE__ */ i(
227
+ u,
336
228
  {
337
229
  spacing: 1,
338
- sx: { alignItems: "center", justifyContent: "center", gap: t !== "M" ? 10 : 3 },
230
+ sx: { alignItems: "center", justifyContent: "center", gap: n !== "M" ? 10 : 3 },
339
231
  children: [
340
232
  /* @__PURE__ */ e(
341
- y,
233
+ k,
342
234
  {
343
235
  sx: {
344
- fontSize: se[t].healthScoreFontSize,
345
- lineHeight: t !== "SM" ? "48px" : "100%"
236
+ fontSize: U[n].healthScoreFontSize,
237
+ lineHeight: n !== "SM" ? "48px" : "100%"
346
238
  },
347
239
  variant: "H1",
348
- children: o
240
+ children: r
349
241
  }
350
242
  ),
351
- t !== "SM" && /* @__PURE__ */ e(y, { sx: { fontWeight: 600 }, variant: t === "L" ? "body1" : "body2", children: r })
243
+ n !== "SM" && /* @__PURE__ */ e(k, { sx: { fontWeight: 600 }, variant: n === "L" ? "body1" : "body2", children: p })
352
244
  ]
353
245
  }
354
246
  )
355
247
  }
356
248
  ),
357
- a !== void 0 && /* @__PURE__ */ e(
358
- x,
249
+ c !== void 0 && /* @__PURE__ */ e(
250
+ D,
359
251
  {
360
252
  sx: {
361
253
  position: "absolute",
362
- top: `${P * 2 * 0.83}px`,
363
- left: `${k}px`,
254
+ top: `${W * 2 * 0.83}px`,
255
+ left: `${z}px`,
364
256
  transform: "translate(-50%, -50%)",
365
257
  textAlign: "center"
366
258
  },
367
- children: typeof a == "number" ? /* @__PURE__ */ u(g, { sx: { flexDirection: "row", alignItems: "center", gap: 4 }, children: [
368
- a > 0 ? /* @__PURE__ */ e(Me, { size: 16, sx: { color: "success.main" } }) : /* @__PURE__ */ e(Ie, { size: 16, sx: { color: "text.secondary" } }),
259
+ children: typeof c == "number" ? /* @__PURE__ */ i(u, { sx: { flexDirection: "row", alignItems: "center", gap: 4 }, children: [
260
+ c > 0 ? /* @__PURE__ */ e(rt, { size: 16, sx: { color: "success.main" } }) : /* @__PURE__ */ e(Oe, { size: 16, sx: { color: "text.secondary" } }),
369
261
  /* @__PURE__ */ e(
370
- y,
262
+ k,
371
263
  {
372
264
  sx: {
373
265
  fontWeight: 600,
374
- color: a > 0 ? "success.main" : "text.secondary"
266
+ color: c > 0 ? "success.main" : "text.secondary"
375
267
  },
376
268
  variant: "body1",
377
- children: a
269
+ children: c
378
270
  }
379
271
  )
380
- ] }) : /* @__PURE__ */ e(y, { sx: { color: "text.secondary" }, variant: "subtitle2", children: a })
272
+ ] }) : /* @__PURE__ */ e(k, { sx: { color: "text.secondary" }, variant: "subtitle2", children: c })
381
273
  }
382
274
  ),
383
- c !== void 0 && /* @__PURE__ */ e(
384
- x,
275
+ d !== void 0 && /* @__PURE__ */ e(
276
+ D,
385
277
  {
386
278
  sx: {
387
279
  position: "absolute",
388
- top: `${P * 2 * 0.83}px`,
389
- left: `${k - k / 2}px`,
280
+ top: `${W * 2 * 0.83}px`,
281
+ left: `${z - z / 2}px`,
390
282
  // shift left from center
391
283
  transform: "translate(-50%, -50%)",
392
284
  textAlign: "left"
393
285
  },
394
- children: /* @__PURE__ */ e(y, { variant: "body1", children: c })
286
+ children: /* @__PURE__ */ e(k, { variant: "body1", children: d })
395
287
  }
396
288
  ),
397
- p !== void 0 && /* @__PURE__ */ e(
398
- x,
289
+ _ !== void 0 && /* @__PURE__ */ e(
290
+ D,
399
291
  {
400
292
  sx: {
401
293
  position: "absolute",
402
- top: `${P * 2 * 0.83}px`,
403
- left: `${k + k / 2}px`,
294
+ top: `${W * 2 * 0.83}px`,
295
+ left: `${z + z / 2}px`,
404
296
  transform: "translate(-50%, -50%)",
405
297
  textAlign: "right"
406
298
  },
407
- children: /* @__PURE__ */ e(y, { variant: "body1", children: p })
299
+ children: /* @__PURE__ */ e(k, { variant: "body1", children: _ })
408
300
  }
409
301
  )
410
302
  ]
411
303
  }
412
304
  );
413
- }, ve = I(
414
- ({ arcRadius: n, size: o = "L", healthScore: t, footerCenterContent: i }) => {
415
- const d = [
305
+ }, Tt = S(
306
+ ({ arcRadius: t, size: r = "L", healthScore: n, footerCenterContent: o }) => {
307
+ const l = [
416
308
  { id: 1, label: "Group A", value: 25 },
417
309
  { id: 2, label: "Group B", value: 25 },
418
310
  { id: 3, label: "Group C", value: 25 },
419
311
  { id: 4, label: "Group D", value: 25 }
420
- ], { finstrong: l } = S(), s = ie(t, l);
312
+ ], { finstrong: s } = C(), a = $e(n, s);
421
313
  return /* @__PURE__ */ e(
422
- Se,
314
+ It,
423
315
  {
424
- arcRadius: n,
425
- dialScoreData: d,
426
- footerCenterContent: o === "L" ? l.footer_center_content_updated_just_now : i,
427
- healthScore: t,
428
- healthScoreStatus: s.status,
316
+ arcRadius: t,
317
+ dialScoreData: l,
318
+ footerCenterContent: r === "L" ? s.footer_center_content_updated_just_now : o,
319
+ healthScore: n,
320
+ healthScoreStatus: a.status,
429
321
  isFinacialStrengthGraph: !0,
430
- size: o
322
+ size: r
431
323
  }
432
324
  );
433
325
  }
434
- ), Bo = I(
326
+ ), yo = S(
435
327
  ({
436
- arcRadius: n,
437
- size: o = "L",
438
- healthScore: t,
439
- maxValue: i = 850,
440
- minValue: d = 300,
441
- footerCenterContent: l
328
+ arcRadius: t,
329
+ size: r = "L",
330
+ healthScore: n,
331
+ maxValue: o = 850,
332
+ minValue: l = 300,
333
+ footerCenterContent: s
442
334
  }) => {
443
- const r = G().palette.mode === "dark", a = [
335
+ const p = H().palette.mode === "dark", c = [
444
336
  {
445
337
  id: 1,
446
338
  label: "Poor",
447
- value: 279,
448
- color: r ? M.POOR : D.POOR
339
+ value: 29,
340
+ color: p ? ge.POOR : ye.POOR
449
341
  },
450
342
  {
451
343
  id: 2,
452
344
  label: "Fair",
453
- value: 89,
454
- color: r ? M.FAIR : D.FAIR
345
+ value: 25,
346
+ color: p ? ge.FAIR : ye.FAIR
455
347
  },
456
348
  {
457
349
  id: 3,
458
350
  label: "Good",
459
- value: 69,
460
- color: r ? M.GOOD : D.GOOD
351
+ value: 17,
352
+ color: p ? ge.GOOD : ye.GOOD
461
353
  },
462
354
  {
463
355
  id: 4,
464
356
  label: "Very Good",
465
- value: 59,
466
- color: r ? M.VERY_GOOD : D.VERY_GOOD
357
+ value: 17,
358
+ color: p ? ge.VERY_GOOD : ye.VERY_GOOD
467
359
  },
468
360
  {
469
361
  id: 5,
470
362
  label: "Exceptional",
471
- value: 50,
472
- color: r ? M.EXCEPTIONAL : D.EXCEPTIONAL
363
+ value: 12,
364
+ color: p ? ge.EXCEPTIONAL : ye.EXCEPTIONAL
473
365
  }
474
- ], { finstrong: c } = S(), { isCopyLoaded: p } = z();
475
- if (!p) return /* @__PURE__ */ e(N, {});
476
- const { status: h, color: m = "none" } = _t(
477
- t,
478
- r,
479
- c.credit_score_status
366
+ ], { finstrong: d } = C(), { isCopyLoaded: _ } = X();
367
+ if (!_) return /* @__PURE__ */ e(te, {});
368
+ const { status: m, color: g = "none" } = cn(
369
+ n,
370
+ p,
371
+ d.credit_score_status
480
372
  );
481
373
  return /* @__PURE__ */ e(
482
- Se,
374
+ It,
483
375
  {
484
- arcRadius: n,
485
- dialScoreData: a,
486
- footerCenterContent: l,
487
- footerLeftContent: d,
488
- footerRightContent: i,
489
- healthScore: t,
490
- healthScoreStatus: h,
491
- markerColor: m,
492
- maxValue: i,
493
- minValue: d,
494
- size: o
376
+ arcRadius: t,
377
+ dialScoreData: c,
378
+ footerCenterContent: s,
379
+ footerLeftContent: l,
380
+ footerRightContent: o,
381
+ healthScore: n,
382
+ healthScoreStatus: m,
383
+ markerColor: g,
384
+ maxValue: o,
385
+ minValue: l,
386
+ size: r
495
387
  }
496
388
  );
497
389
  }
498
- ), Q = ({
499
- isDashboard: n = !1,
500
- hasIcon: o = !0,
501
- buttonText: t,
502
- title: i,
503
- description: d,
504
- sx: l
390
+ ), Ae = ({
391
+ drawerType: t,
392
+ isDashboard: r = !1,
393
+ hasIcon: n = !0,
394
+ buttonText: o,
395
+ title: l,
396
+ titleDrawer: s,
397
+ description: a,
398
+ sx: p
505
399
  }) => {
506
- const [s, r] = C.useState(!1), { connect: a, finstrong: c } = S();
507
- return /* @__PURE__ */ u(
508
- J,
400
+ const [c, d] = h.useState(!1), { connect: _, finstrong: m } = C();
401
+ return t ? /* @__PURE__ */ i(
402
+ K,
509
403
  {
510
404
  sx: {
511
405
  pb: 24,
512
406
  pt: 18,
513
407
  px: 24,
514
408
  width: "100%",
515
- ...l
409
+ ...p
516
410
  },
517
411
  children: [
518
- /* @__PURE__ */ u(
519
- g,
412
+ /* @__PURE__ */ i(
413
+ u,
520
414
  {
521
415
  sx: {
522
416
  gap: 8,
523
- ...n && { flexDirection: "row", alignItems: "center" }
417
+ ...r && { flexDirection: "row", alignItems: "center" }
524
418
  },
525
419
  children: [
526
- o && /* @__PURE__ */ e(me, { sx: { height: 20, width: 20 } }),
527
- /* @__PURE__ */ e(H, { className: "connect-more-accounts-title", sx: { ...n && { fontSize: 15 } }, children: i || c.connect_more_accounts_title })
420
+ n && /* @__PURE__ */ e(at, { sx: { height: 20, width: 20 } }),
421
+ /* @__PURE__ */ e(Y, { className: "connect-more-accounts-title", sx: { ...r && { fontSize: 15 } }, children: l || m.connect_more_accounts_title })
528
422
  ]
529
423
  }
530
424
  ),
531
425
  /* @__PURE__ */ e(
532
- y,
426
+ k,
533
427
  {
534
428
  className: "connect-more-accounts-description",
535
429
  sx: { color: "text.secondary", mt: 8 },
536
430
  variant: "subtitle1",
537
- children: d || c.connect_more_accounts_description
431
+ children: a || m.connect_more_accounts_description
538
432
  }
539
433
  ),
540
434
  /* @__PURE__ */ e(
541
- q,
435
+ L,
542
436
  {
543
- endIcon: /* @__PURE__ */ e(j, {}),
544
- onClick: () => r(!0),
437
+ endIcon: /* @__PURE__ */ e(Z, {}),
438
+ onClick: () => d(!0),
545
439
  size: "small",
546
440
  sx: { p: 0, mt: 8, "&:hover": { backgroundColor: "transparent" } },
547
- children: /* @__PURE__ */ e(W, { sx: { fontWeight: 600 }, variant: "body2", children: t || c.connect_more_accounts_button })
441
+ children: /* @__PURE__ */ e(T, { sx: { fontWeight: 600 }, variant: "body2", children: o || m.connect_more_accounts_button })
548
442
  }
549
443
  ),
550
- /* @__PURE__ */ e(
551
- xe,
444
+ t === "connectDrawer" && /* @__PURE__ */ e(
445
+ ne,
446
+ {
447
+ onClose: () => d(!1),
448
+ showConnectWidget: c,
449
+ title: s || _.mini_title
450
+ }
451
+ ),
452
+ t === "connectionsDrawer" && /* @__PURE__ */ e(
453
+ mt,
552
454
  {
553
- onClose: () => r(!1),
554
- showConnectWidget: s,
555
- title: a.mini_title
455
+ onClose: () => d(!1),
456
+ showConnectionsWidget: c,
457
+ title: s || _.mini_title
556
458
  }
557
459
  )
558
460
  ]
559
461
  }
560
- );
561
- }, St = I(() => {
562
- const n = G(), [o, { width: t }] = Ye(), { finstrong: i } = S(), { isCopyLoaded: d, isInitialized: l } = z(), { healthScore: s, healthScoreChange: r } = $(), a = n.palette.mode === "dark", c = ie(s?.health_score, i);
563
- return !d || !l ? /* @__PURE__ */ e(N, {}) : /* @__PURE__ */ u(J, { ref: o, sx: { p: 16 }, children: [
564
- /* @__PURE__ */ e(
565
- Ve,
566
- {
567
- action: /* @__PURE__ */ e(
568
- q,
569
- {
570
- endIcon: /* @__PURE__ */ e(j, {}),
571
- sx: {
572
- fontSize: 13,
573
- lineHeight: "16px",
574
- fontWeight: 600,
575
- color: "primary.main"
576
- },
577
- variant: "text",
578
- children: i.financial_strength_header_action
579
- }
580
- ),
581
- subheader: /* @__PURE__ */ e(H, { color: "text.primary", children: i.financial_strength_header }),
582
- sx: {
583
- p: 0,
584
- "& .MuiCardHeader-content": {
585
- overflow: "hidden"
586
- }
587
- }
588
- }
589
- ),
590
- /* @__PURE__ */ e(g, { sx: { justifyContent: "center", alignItems: "center" }, children: /* @__PURE__ */ e(
591
- ve,
592
- {
593
- arcRadius: t <= 323 ? 73 : 154,
594
- footerCenterContent: r,
595
- healthScore: s?.health_score || 0,
596
- size: t <= 323 ? "M" : "L"
597
- }
598
- ) }),
599
- s?.health_score ? /* @__PURE__ */ u(
600
- Xe,
601
- {
602
- sx: {
603
- px: 16,
604
- backgroundColor: a ? "grey.800" : "grey.50",
605
- //TODO: Need to change the background color to palette (supporting both darkmode and lightmode)
606
- "&.Mui-expanded": {
607
- m: 0
608
- },
609
- "&::before": {
610
- display: "none"
611
- }
612
- },
613
- children: [
614
- /* @__PURE__ */ e(
615
- Ue,
616
- {
617
- expandIcon: /* @__PURE__ */ e(Re, { size: 20 }),
618
- sx: {
619
- height: 52,
620
- p: 0,
621
- "&.Mui-expanded": {
622
- minHeight: 0
623
- }
624
- },
625
- children: /* @__PURE__ */ e(y, { sx: { fontWeight: 600 }, variant: "body1", children: i.accordion_title_text })
626
- }
627
- ),
628
- /* @__PURE__ */ e(je, { sx: { "&.MuiAccordionDetails-root": { padding: 0, pb: 16 } }, children: /* @__PURE__ */ e(y, { variant: "subtitle1", children: c.scoreContent }) })
629
- ]
630
- }
631
- ) : /* @__PURE__ */ e(
632
- Q,
633
- {
634
- buttonText: i.connect_more_accounts_title,
635
- description: i.health_score_zero_description,
636
- hasIcon: !1,
637
- isDashboard: !0,
638
- sx: {
639
- backgroundColor: a ? "grey.800" : "grey.50",
640
- //TODO: Need to change the background color to palette (supporting both darkmode and lightmode)
641
- ".connect-more-accounts-title": {
642
- fontWeight: 600,
643
- lineHeight: "20px",
644
- color: "text.primary"
645
- },
646
- ".connect-more-accounts-description": { color: "text.primary" }
647
- },
648
- title: i.health_score_zero_title
649
- }
650
- )
651
- ] });
652
- }), vt = ({ isOpen: n, onClose: o }) => {
653
- const { common: t, finstrong: i } = S(), { isMobile: d } = Ce(), { updateUser: l, user: s } = Y(), [r, a] = C.useState(s.credit_score || 0), c = !isNaN(r), p = () => {
654
- o(), setTimeout(() => a(s.credit_score || 0), 300);
655
- }, h = () => {
656
- !r || r === s.credit_score || l({ ...s, credit_score: r });
462
+ ) : null;
463
+ };
464
+ var se = /* @__PURE__ */ ((t) => (t.SpendLessThanYouMake = "spendLessThanYouMake", t.PayBillsOnTime = "payBillsOnTime", t.SaveEnoughToLiveOn = "saveEnoughToLiveOn", t.MaintainEmergencySavings = "maintainEmergencySavings", t.HaveManageableDebt = "haveManageableDebt", t.HaveAGoodCreditScore = "haveAGoodCreditScore", t))(se || {});
465
+ const bo = ({ isOpen: t, onClose: r }) => {
466
+ const { common: n, finstrong: o } = C(), { isMobile: l } = Ge(), { updateUser: s, user: a } = ee(), [p, c] = h.useState(a.credit_score || 0), d = !isNaN(p), _ = () => {
467
+ r(), setTimeout(() => c(a.credit_score || 0), 300);
468
+ }, m = () => {
469
+ !p || p === a.credit_score || s({ ...a, credit_score: p });
657
470
  };
658
471
  return /* @__PURE__ */ e(
659
- Ze,
472
+ Dn,
660
473
  {
661
- copy: { close_aria: t.close_aria, title: i.edit_credit_score },
662
- disablePrimaryButton: !r || !c,
663
- isOpen: n,
474
+ copy: { close_aria: n.close_aria, title: o.edit_credit_score },
475
+ disablePrimaryButton: !p || !d,
476
+ isOpen: t,
664
477
  maxWidth: "xs",
665
- onClose: p,
666
- onPrimaryAction: h,
478
+ onClose: _,
479
+ onPrimaryAction: m,
667
480
  primaryColor: "primary",
668
- primaryText: t.save_button,
481
+ primaryText: n.save_button,
669
482
  sx: {
670
483
  "& .MuiDialog-paper": {
671
- minWidth: d ? "100%" : 400
484
+ minWidth: l ? "100%" : 400
672
485
  }
673
486
  },
674
487
  children: /* @__PURE__ */ e(
675
- Qe,
488
+ "form",
676
489
  {
677
- error: !c,
678
- fullWidth: !0,
679
- inputMode: "numeric",
680
- inputProps: {
681
- noValidate: !0,
682
- pattern: "[0-9]*"
490
+ onSubmit: (g) => {
491
+ g.preventDefault(), m(), _();
683
492
  },
684
- onChange: (m) => a(Number(m.target.value)),
685
- value: c ? r : ""
493
+ children: /* @__PURE__ */ e(
494
+ we,
495
+ {
496
+ error: !d,
497
+ fullWidth: !0,
498
+ inputMode: "numeric",
499
+ inputProps: {
500
+ noValidate: !0,
501
+ pattern: "[0-9]*"
502
+ },
503
+ onChange: (g) => c(Number(g.target.value)),
504
+ value: d ? p : ""
505
+ }
506
+ )
686
507
  }
687
508
  )
688
509
  }
689
510
  );
690
- }, kt = I(vt), At = ({ isOpen: n, onClose: o }) => {
691
- const { finstrong: t } = S(), i = G(), { updateUser: d, user: l } = Y(), [s, r] = C.useState(l.birthday), a = (p) => {
692
- r(Math.floor(new Date(p).getTime() / 1e3));
693
- };
511
+ }, Ot = S(bo), fo = {
512
+ updated_score: "Updated Score"
513
+ }, xo = () => {
514
+ const { healthScoreChange: t } = F(), { user: r } = ee(), { availableWidth: n } = Sn(), { isSmallMobile: o } = Ge(n), [l, s] = h.useState(!1);
515
+ return /* @__PURE__ */ i(u, { sx: { gap: 28 }, children: [
516
+ /* @__PURE__ */ e(
517
+ yo,
518
+ {
519
+ arcRadius: o ? 124 : 154,
520
+ footerCenterContent: t,
521
+ healthScore: r.credit_score ?? 0,
522
+ size: o ? "M" : "L"
523
+ }
524
+ ),
525
+ /* @__PURE__ */ e(L, { onClick: () => s(!0), variant: "contained", children: fo.updated_score }),
526
+ /* @__PURE__ */ e(Ot, { isOpen: l, onClose: () => s(!1) })
527
+ ] });
528
+ }, So = S(xo), Me = ({ status: t }) => {
529
+ const { finstrong: r } = C(), n = ln(dn[t]), o = {
530
+ GOOD: r.key_indicators_good,
531
+ FAIR: r.key_indicators_fair,
532
+ OFF_TRACK: r.key_indicators_off_track,
533
+ MISSING: r.key_indicators_missing
534
+ }[t];
694
535
  return /* @__PURE__ */ e(
695
- V,
536
+ In,
696
537
  {
697
- isOpen: n,
698
- onClose: o,
699
- onPrimaryAction: () => {
700
- !s || s === l.birthday || (d({ ...l, birthday: s }), o());
701
- },
702
- onSecondaryAction: o,
703
- title: t.date_of_birth,
704
- children: /* @__PURE__ */ e(ot, { dateAdapter: et, children: /* @__PURE__ */ e(
705
- tt,
538
+ label: /* @__PURE__ */ e(
539
+ k,
706
540
  {
707
- disableFuture: !0,
708
- onChange: a,
709
- slotProps: {
710
- nextIconButton: {
711
- sx: {
712
- color: "primary.main",
713
- "&:hover": { bgcolor: te(i.palette.primary.light, 0.1) }
714
- }
715
- },
716
- previousIconButton: {
717
- sx: {
718
- color: "primary.main",
719
- "&:hover": { bgcolor: te(i.palette.primary.light, 0.1) }
720
- }
721
- }
722
- },
723
- slots: {
724
- actionBar: () => null,
725
- toolbar: () => null
726
- },
727
- sx: {
728
- width: "100%",
729
- "& .MuiIconButton-edgeEnd": {
730
- color: "primary.main",
731
- "&:hover": { bgcolor: te(i.palette.primary.light, 0.1) }
732
- }
733
- },
734
- value: s ? new Date(s * 1e3) : /* @__PURE__ */ new Date()
541
+ fontWeight: 700,
542
+ sx: { color: n.color, minHeight: 12 },
543
+ uppercase: !0,
544
+ variant: "tiny",
545
+ children: o
735
546
  }
736
- ) })
547
+ ),
548
+ size: "small",
549
+ sx: {
550
+ bgcolor: n.backgroundColor,
551
+ height: 16
552
+ },
553
+ variant: "filled"
737
554
  }
738
555
  );
739
- }, It = I(At), Ot = ({ value: n, completeCopy: o }) => /* @__PURE__ */ u(g, { sx: { gap: 8 }, children: [
740
- /* @__PURE__ */ e(g, { sx: { flexDirection: "row", gap: 4 }, children: Array.from({ length: 4 }).map((t, i) => /* @__PURE__ */ e(
741
- x,
742
- {
743
- sx: {
744
- bgcolor: i < n ? "primary.main" : "neutral.light",
745
- borderRadius: "24px",
746
- height: 4,
747
- width: "100%"
556
+ }, Co = {
557
+ keep_strong_credit_score: "Keep a Strong Credit Score"
558
+ }, vo = () => {
559
+ const { user: t } = ee(), r = dt(t.credit_score ?? null);
560
+ return /* @__PURE__ */ i(u, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: [
561
+ /* @__PURE__ */ e(Y, { children: Co.keep_strong_credit_score }),
562
+ /* @__PURE__ */ e(Me, { status: r })
563
+ ] });
564
+ }, wo = S(vo), ko = ({
565
+ additionalContent: t,
566
+ connectTitle: r,
567
+ connectDescription: n,
568
+ children: o,
569
+ description: l,
570
+ drawerTitle: s,
571
+ isOpen: a,
572
+ loadConnectAccountsCard: p = !0,
573
+ onClose: c,
574
+ stickyComponent: d,
575
+ title: _,
576
+ drawerType: m
577
+ }) => {
578
+ const { finstrong: g } = C(), { isCopyLoaded: y } = X();
579
+ return y ? /* @__PURE__ */ i(ie, { isOpen: a, onClose: c, title: s || g.key_indicators, children: [
580
+ (_ || l) && /* @__PURE__ */ i(
581
+ u,
582
+ {
583
+ sx: {
584
+ backgroundColor: "background.paper",
585
+ gap: 8,
586
+ p: 24
587
+ },
588
+ children: [
589
+ _ && typeof _ == "string" ? /* @__PURE__ */ e(Y, { children: _ }) : _,
590
+ l && /* @__PURE__ */ e(k, { children: l })
591
+ ]
748
592
  }
593
+ ),
594
+ d && /* @__PURE__ */ e(
595
+ D,
596
+ {
597
+ sx: {
598
+ position: "sticky",
599
+ top: 0,
600
+ zIndex: 1
601
+ },
602
+ children: d
603
+ }
604
+ ),
605
+ t && /* @__PURE__ */ e(D, { children: t }),
606
+ /* @__PURE__ */ i(u, { sx: { p: 24, gap: 24 }, children: [
607
+ o,
608
+ p && /* @__PURE__ */ e(
609
+ Ae,
610
+ {
611
+ description: n,
612
+ drawerType: m,
613
+ isDashboard: !0,
614
+ sx: { backgroundColor: "background.paper" },
615
+ title: r
616
+ }
617
+ )
618
+ ] })
619
+ ] }) : /* @__PURE__ */ e(te, {});
620
+ }, Ft = S(ko), Do = ({
621
+ onClick: t,
622
+ shouldShowBalance: r = !0,
623
+ loadAccounts: n
624
+ }) => {
625
+ const { config: o } = _t(), { accounts: l } = C(), { selectedAccounts: s } = X(), a = h.useCallback(
626
+ (c) => {
627
+ t?.(c);
749
628
  },
750
- i
751
- )) }),
752
- /* @__PURE__ */ u(W, { sx: { color: "text.secondary" }, variant: "body2", children: [
753
- n / 4 * 100,
754
- "% ",
755
- o
756
- ] })
757
- ] }), Dt = ({ isOpen: n, onClose: o }) => {
758
- const { visibleFinstrongAccounts: t } = fe(), { incomeBudget: i } = ye(), {
759
- accounts: d,
760
- common: l,
761
- finstrong: s
762
- } = S(), { user: r } = Y(), [a, c] = C.useState(null), h = [
763
- {
764
- dynamicCopy: s.add_profile_item,
765
- fallbackLabel: s.monthly_income,
766
- icon: /* @__PURE__ */ e(Fe, {}),
767
- key: A.MonthlyIncome,
768
- label: s.monthly_income,
769
- value: i
770
- },
771
- {
772
- dynamicCopy: s.add_profile_item,
773
- fallbackLabel: s.date_of_birth,
774
- icon: /* @__PURE__ */ e(Pe, {}),
775
- key: A.DateOfBirth,
776
- label: s.date_of_birth,
777
- value: r.birthday
778
- },
779
- {
780
- dynamicCopy: s.add_profile_item,
781
- fallbackLabel: s.credit_score,
782
- icon: /* @__PURE__ */ e(ue, {}),
783
- key: A.CreditScore,
784
- label: s.credit_score,
785
- value: r.credit_score
786
- },
787
- {
788
- fallbackLabel: s.connect_your_accounts,
789
- icon: /* @__PURE__ */ e(me, {}),
790
- key: A.Connections,
791
- label: s.connections,
792
- value: t.length > 0 ? b(
793
- s.connected_account,
794
- String(t.length),
795
- t.length > 1 ? s.accounts : s.account
796
- ) : void 0
797
- }
798
- ].map((m) => bt(m));
799
- return /* @__PURE__ */ u(V, { isOpen: n, onClose: o, title: s.financial_profile, children: [
800
- /* @__PURE__ */ u(g, { sx: { gap: 20, p: 24 }, children: [
801
- /* @__PURE__ */ u(g, { sx: { gap: 8 }, children: [
802
- /* @__PURE__ */ e(H, { children: s.your_financial_profile }),
803
- /* @__PURE__ */ e(y, { children: s.financial_profile_description })
629
+ [t]
630
+ ), p = h.useMemo(
631
+ () => Array.from(new Set(s.map((c) => c.account_type))).filter(
632
+ (c) => n ? n.includes(c) : !0
633
+ ),
634
+ [s, n]
635
+ );
636
+ return s.length ? /* @__PURE__ */ e(h.Fragment, { children: p.map((c) => {
637
+ const { accountsForType: d, totalBalanceForType: _ } = s.reduce(
638
+ (m, g) => (g.account_type === c && (m.accountsForType.push(g), m.totalBalanceForType += g.balance || 0), m),
639
+ { accountsForType: [], totalBalanceForType: 0 }
640
+ );
641
+ return /* @__PURE__ */ i(
642
+ St,
643
+ {
644
+ subheader: /* @__PURE__ */ e(On, { sx: { pb: 4, position: "static", pt: 12, px: 24 }, children: /* @__PURE__ */ i(u, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: [
645
+ /* @__PURE__ */ e(T, { bold: !0, variant: "caption", children: l.account_types[c] }),
646
+ r && /* @__PURE__ */ e(T, { bold: !0, variant: "caption", children: B(_, "0,0.00") })
647
+ ] }) }),
648
+ sx: { bgcolor: "background.paper" },
649
+ children: [
650
+ d.map((m, g) => {
651
+ const { firstValue: y } = xt(m, l), v = gt(m, {
652
+ allowNickname: o?.show_account_nicknames_in_master
653
+ }), b = /* @__PURE__ */ i(E, { children: [
654
+ /* @__PURE__ */ e(bt, { children: /* @__PURE__ */ e(lt, { alt: "MX", institutionGuid: m.institution_guid ?? "" }) }),
655
+ /* @__PURE__ */ e(
656
+ ft,
657
+ {
658
+ primary: `${v}${m.account_number ? ` *${m.account_number}` : ""}`,
659
+ primaryTypographyProps: { noWrap: !0, pr: 4, variant: "body1" }
660
+ }
661
+ ),
662
+ r && /* @__PURE__ */ e(k, { bold: !0, variant: "body2", children: B(y ?? 0, "0,0.00") })
663
+ ] });
664
+ return /* @__PURE__ */ i(h.Fragment, { children: [
665
+ /* @__PURE__ */ e(yt, { sx: { px: t ? 0 : 24 }, children: t ? /* @__PURE__ */ e(Tn, { onClick: () => a(m), children: b }) : b }),
666
+ g !== d.length - 1 && /* @__PURE__ */ e(J, { variant: "inset" })
667
+ ] }, m.guid);
668
+ }),
669
+ /* @__PURE__ */ e(J, {})
670
+ ]
671
+ },
672
+ c
673
+ );
674
+ }) }) : null;
675
+ }, Pt = S(Do), Ao = ({ loadAccounts: t, loadMoreLabel: r }) => {
676
+ const n = H(), { config: o } = _t(), { connect: l, finstrong: s } = C(), { accounts: a } = C(), { selectedAccounts: p } = X(), [c, d] = h.useState(!1), [_, m] = h.useState(!1), g = h.useMemo(
677
+ () => p.filter(
678
+ (b) => t ? t.includes(b.account_type) : !0
679
+ ),
680
+ [p, t]
681
+ ), y = h.useMemo(() => g.slice(0, 3), [g]), v = (b) => {
682
+ const { firstValue: f } = xt(b, a);
683
+ return f;
684
+ };
685
+ return g.length >= 1 ? /* @__PURE__ */ i(E, { children: [
686
+ /* @__PURE__ */ e(D, { sx: { border: `1px solid ${n.palette.divider}`, borderRadius: 2 }, children: y.map((b, f) => /* @__PURE__ */ i(h.Fragment, { children: [
687
+ /* @__PURE__ */ i(yt, { sx: { px: 24 }, children: [
688
+ /* @__PURE__ */ e(bt, { children: /* @__PURE__ */ e(lt, { alt: "MX", institutionGuid: b.institution_guid ?? "" }) }),
689
+ /* @__PURE__ */ e(
690
+ ft,
691
+ {
692
+ primary: `${gt(b, {
693
+ allowNickname: o?.show_account_nicknames_in_master
694
+ })}
695
+ ${b.account_number ? ` *${b.account_number}` : ""}`,
696
+ primaryTypographyProps: { noWrap: !0, pr: 4, variant: "body1" }
697
+ }
698
+ ),
699
+ /* @__PURE__ */ e(k, { bold: !0, variant: "body2", children: B(v(b), "0,0.00") })
804
700
  ] }),
805
- /* @__PURE__ */ e(
806
- Ot,
701
+ f < y.length - 1 && /* @__PURE__ */ e(J, { variant: "inset" })
702
+ ] }, b.guid)) }),
703
+ g.length > 3 && /* @__PURE__ */ i(E, { children: [
704
+ /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(
705
+ L,
807
706
  {
808
- completeCopy: s.complete,
809
- value: h.reduce((m, _) => m + (_.isComplete ? 1 : 0), 0)
707
+ endIcon: /* @__PURE__ */ e(Z, {}),
708
+ onClick: () => d(!0),
709
+ size: "small",
710
+ sx: { my: 0, px: 16, py: 12, width: "100%" },
711
+ children: /* @__PURE__ */ i(T, { bold: !0, variant: "body1", children: [
712
+ g.length - 3,
713
+ " ",
714
+ r
715
+ ] })
810
716
  }
811
- )
812
- ] }),
813
- /* @__PURE__ */ e(ht, { list: h, onClickItem: c }),
814
- /* @__PURE__ */ e(x, { sx: { p: 24 }, children: /* @__PURE__ */ e(
815
- Q,
717
+ ) }),
718
+ /* @__PURE__ */ e(ie, { isOpen: c, onClose: () => d(!1), title: s.accounts, children: /* @__PURE__ */ e(Pt, { loadAccounts: t }) })
719
+ ] })
720
+ ] }) : /* @__PURE__ */ i(E, { children: [
721
+ /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(
722
+ L,
816
723
  {
817
- description: s.connect_more_accounts_to_view_more_accurate_financial_picture,
818
- isDashboard: !0,
819
- title: s.dont_see_all_your_accounts
724
+ onClick: () => m(!0),
725
+ size: "small",
726
+ sx: { my: 0, px: 16, py: 12, width: "100%" },
727
+ variant: "contained",
728
+ children: /* @__PURE__ */ e(T, { bold: !0, variant: "body1", children: s.connect_more_accounts_button })
820
729
  }
821
730
  ) }),
822
731
  /* @__PURE__ */ e(
823
- V,
824
- {
825
- isOpen: a === A.MonthlyIncome,
826
- onClose: () => c(null),
827
- title: l.settings,
828
- children: /* @__PURE__ */ e(Je, {})
829
- }
830
- ),
831
- /* @__PURE__ */ e(It, { isOpen: a === A.DateOfBirth, onClose: () => c(null) }),
832
- /* @__PURE__ */ e(kt, { isOpen: a === A.CreditScore, onClose: () => c(null) }),
833
- /* @__PURE__ */ e(
834
- qe,
732
+ ne,
835
733
  {
836
- onClose: () => c(null),
837
- showConnectionsWidget: a === A.Connections,
838
- title: d.manage_connections
734
+ onClose: () => m(!1),
735
+ showConnectWidget: _,
736
+ title: l.mini_title
839
737
  }
840
738
  )
841
739
  ] });
842
- }, Mt = I(Dt), X = {
843
- creditScore: {
844
- poor: 600,
845
- good: 720
846
- },
847
- daysOfCashOnHand: {
848
- poor: 30,
849
- good: 90
850
- },
851
- debtToIncomeRatio: {
852
- poor: 40,
853
- good: 30
854
- },
855
- emergencySavings: {
856
- poor: 750,
857
- good: 1e3
858
- },
859
- spendToIncomeRatio: {
860
- poor: 110,
861
- good: 100
862
- }
863
- }, f = {
864
- GOOD: "Good",
865
- FAIR: "Fair",
866
- OFF_TRACK: "Off Track",
867
- MISSING: "Missing"
868
- }, B = ({
869
- title: n,
870
- description: o,
871
- cardState: t = f.MISSING,
872
- stateTitle: i
873
- }) => {
874
- const d = {
875
- [f.GOOD]: { backgroundColor: "success.lighter", color: "success.main" },
876
- [f.FAIR]: { backgroundColor: "warning.lighter", color: "warning.main" },
877
- [f.OFF_TRACK]: { backgroundColor: "error.lighter", color: "error.main" },
878
- [f.MISSING]: { backgroundColor: "divider", color: "text.secondary" }
879
- }[t];
880
- return /* @__PURE__ */ u(
881
- g,
882
- {
740
+ }, Rt = S(Ao), _e = ({ balance: t, title: r, sx: n }) => /* @__PURE__ */ i(
741
+ u,
742
+ {
743
+ sx: {
883
744
  alignItems: "center",
884
- flexDirection: "row",
885
- gap: 12,
886
- justifyContent: "space-between",
887
- sx: {
888
- p: 16,
889
- border: "1px solid",
890
- borderColor: "divider",
891
- borderRadius: 2
892
- },
893
- children: [
894
- /* @__PURE__ */ u(x, { sx: { minHeight: 48 }, children: [
895
- /* @__PURE__ */ u(g, { flexDirection: "row", gap: 4, children: [
896
- /* @__PURE__ */ e(y, { fontWeight: 600, sx: { mb: 8 }, truncate: !0, variant: "body1", children: n }),
897
- /* @__PURE__ */ e(
898
- x,
899
- {
900
- sx: {
901
- borderRadius: 3,
902
- backgroundColor: d.backgroundColor,
903
- px: 8,
904
- py: 2,
905
- height: 16
906
- },
907
- children: /* @__PURE__ */ e(y, { fontWeight: 700, sx: { minHeight: 12 }, uppercase: !0, variant: "tiny", children: i })
908
- }
909
- )
910
- ] }),
911
- /* @__PURE__ */ e(y, { color: "secondary", variant: "subtitle2", children: o })
912
- ] }),
913
- /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(he, { color: "secondary", name: "chevron_right", size: 24 }) })
914
- ]
915
- }
916
- );
917
- }, Tt = () => {
918
- const { healthScore: n } = $(), { finstrong: o } = S(), { key_indicators_spend: t } = o, i = (r) => {
919
- const { good: a, poor: c } = X.spendToIncomeRatio;
920
- let p = f.MISSING, h = t.ratio_missing_description, m = o.key_indicators_missing;
921
- return r !== null && (r < a ? (p = f.GOOD, h = b(t.ratio_good_description, r), m = o.key_indicators_good) : r >= a && r < c ? (p = f.FAIR, h = b(t.ratio_fair_description, r), m = o.key_indicators_fair) : r >= c && (p = f.OFF_TRACK, h = b(t.ratio_off_track_description, r), m = o.key_indicators_off_track)), {
922
- cardState: p,
923
- description: h,
924
- title: t.ratio_card_title,
925
- stateTitle: m
926
- };
927
- }, d = (r) => {
928
- let a = f.MISSING, c = t.count_missing_description, p = o.key_indicators_missing;
929
- return r !== null && (r === 0 ? (a = f.GOOD, c = t.count_good_description, p = o.key_indicators_good) : r >= 1 && (a = f.OFF_TRACK, c = t.count_off_track_description, p = o.key_indicators_off_track)), {
930
- cardState: a,
931
- description: c,
932
- title: t.count_card_title,
933
- stateTitle: p
934
- };
935
- }, { spendToIncomeRatio: l, spendFeeCount: s } = C.useMemo(() => {
936
- const r = n.spend_to_income_ratio !== null ? Math.round(n.spend_to_income_ratio * 100) : null, a = i(r), c = d(n.spending_fee_transaction_count);
937
- return { spendToIncomeRatio: a, spendFeeCount: c };
938
- }, [
939
- n.spend_to_income_ratio,
940
- n.spending_fee_transaction_count,
941
- t,
942
- o
943
- ]);
944
- return /* @__PURE__ */ u(g, { direction: "column", gap: 24, sx: { p: 8, pt: 24 }, children: [
745
+ backgroundColor: "background.default",
746
+ borderRadius: 2,
747
+ height: 72,
748
+ justifyContent: "center",
749
+ p: 12,
750
+ ...n
751
+ },
752
+ children: [
753
+ typeof t == "number" ? /* @__PURE__ */ e(k, { variant: "h2", children: B(t, "0,0.00") }) : t,
754
+ /* @__PURE__ */ e(k, { color: "text.secondary", fontWeight: "400", variant: "subtitle2", children: r })
755
+ ]
756
+ }
757
+ );
758
+ var I = /* @__PURE__ */ ((t) => (t[t.ConnectAccounts = 1] = "ConnectAccounts", t[t.MonthlyIncome = 2] = "MonthlyIncome", t[t.Birthday = 3] = "Birthday", t[t.CreditScore = 4] = "CreditScore", t))(I || {}), be = /* @__PURE__ */ ((t) => (t[t.Months = 1] = "Months", t[t.Years = 2] = "Years", t[t.Days = 3] = "Days", t))(be || {}), q = /* @__PURE__ */ ((t) => (t[t.Monthly = 1] = "Monthly", t[t.BiWeekly = 2] = "BiWeekly", t[t.Weekly = 3] = "Weekly", t[t.Daily = 4] = "Daily", t))(q || {});
759
+ const R = {
760
+ bi_weekly: "Bi-Weekly",
761
+ calculate: "Calculate",
762
+ daily: "Daily",
763
+ day: "day",
764
+ days: "Days",
765
+ estimated_contribution: "Estimated Contribution",
766
+ estimated_period_bi_weekly: "bi-weekly",
767
+ estimated_period_daily: "day",
768
+ estimated_period_monthly: "month",
769
+ estimated_period_weekly: "week",
770
+ how_often_contribute: "How often will you contribute?",
771
+ meet_your_goal_within: "Meet your goal within",
772
+ months: "Months",
773
+ monthly: "Monthly",
774
+ savings_goal: "Savings Goal",
775
+ suggested_goal: "Suggested Goal: $25,000",
776
+ weekly: "Weekly",
777
+ years: "Years"
778
+ }, Mo = [
779
+ { id: q.Monthly, label: R.monthly },
780
+ { id: q.BiWeekly, label: R.bi_weekly },
781
+ { id: q.Weekly, label: R.weekly },
782
+ { id: q.Daily, label: R.daily }
783
+ ], Io = {
784
+ [q.Monthly]: R.estimated_period_monthly,
785
+ [q.BiWeekly]: R.estimated_period_bi_weekly,
786
+ [q.Weekly]: R.estimated_period_weekly,
787
+ [q.Daily]: R.estimated_period_daily
788
+ }, To = [
789
+ { id: be.Months, label: R.months },
790
+ { id: be.Years, label: R.years },
791
+ { id: be.Days, label: R.days }
792
+ ], Oo = ({ total: t }) => {
793
+ const r = Math.ceil((t + 1) / 1e3) * 1e3, [n, o] = h.useState(0), [l, s] = h.useState(Ye(t)), [a, p] = h.useState(
794
+ Ye(t)
795
+ ), [c, d] = h.useState(r), [_, m] = h.useState(pn(t)), [g, y] = h.useState(be.Months);
796
+ h.useEffect(() => {
797
+ o(
798
+ Xe({
799
+ contribution: a,
800
+ goalAmount: c,
801
+ goalPeriod: _,
802
+ targetPeriod: g,
803
+ totalSaved: t
804
+ })
805
+ ), s(a);
806
+ }, []);
807
+ const v = (b) => {
808
+ b.preventDefault(), o(
809
+ Xe({
810
+ contribution: a,
811
+ goalAmount: c,
812
+ goalPeriod: _,
813
+ targetPeriod: g,
814
+ totalSaved: t
815
+ })
816
+ ), s(a);
817
+ };
818
+ return /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e("form", { onSubmit: v, children: /* @__PURE__ */ i(u, { sx: { gap: 24, pb: 24, pt: 16, px: 16 }, children: [
945
819
  /* @__PURE__ */ e(
946
- B,
820
+ _e,
947
821
  {
948
- cardState: l.cardState,
949
- description: l.description,
950
- stateTitle: l.stateTitle,
951
- title: l.title
822
+ balance: /* @__PURE__ */ i(u, { sx: { flexDirection: "row", height: 32 }, children: [
823
+ /* @__PURE__ */ e(T, { variant: "h2", children: B(n, "0,0") }),
824
+ /* @__PURE__ */ i(T, { sx: { alignSelf: "end", height: 24 }, variant: "subtitle2", children: [
825
+ "/",
826
+ Io[l]
827
+ ] })
828
+ ] }),
829
+ title: R.estimated_contribution
952
830
  }
953
831
  ),
954
832
  /* @__PURE__ */ e(
955
- B,
833
+ we,
956
834
  {
957
- cardState: s.cardState,
958
- description: s.description,
959
- stateTitle: s.stateTitle,
960
- title: s.title
835
+ "aria-label": R.savings_goal,
836
+ helperText: R.suggested_goal,
837
+ inputProps: {
838
+ noValidate: !0,
839
+ pattern: "[0-9]*"
840
+ },
841
+ label: R.savings_goal,
842
+ onChange: (b) => {
843
+ b.target.value && d(Number(b.target.value.replace(/[^0-9]/g, "")));
844
+ },
845
+ value: c ? B(c, "0,0") : ""
846
+ }
847
+ ),
848
+ /* @__PURE__ */ e(
849
+ qe,
850
+ {
851
+ label: R.how_often_contribute,
852
+ onChange: p,
853
+ options: Mo,
854
+ required: !0,
855
+ value: a
856
+ }
857
+ ),
858
+ /* @__PURE__ */ i(u, { sx: { flexDirection: "row" }, children: [
859
+ /* @__PURE__ */ e(
860
+ we,
861
+ {
862
+ "aria-label": R.meet_your_goal_within,
863
+ fullWidth: !0,
864
+ inputProps: {
865
+ noValidate: !0,
866
+ pattern: "[0-9]*"
867
+ },
868
+ label: R.meet_your_goal_within,
869
+ onChange: (b) => m(Number(b.target.value)),
870
+ sx: {
871
+ "& .MuiInputBase-root": {
872
+ borderBottomRightRadius: 0,
873
+ borderTopRightRadius: 0,
874
+ fieldset: {
875
+ borderRightWidth: 0.5
876
+ }
877
+ }
878
+ },
879
+ value: _
880
+ }
881
+ ),
882
+ /* @__PURE__ */ e(
883
+ D,
884
+ {
885
+ sx: {
886
+ "& .MuiInputBase-root": {
887
+ borderBottomLeftRadius: 0,
888
+ borderTopLeftRadius: 0,
889
+ fieldset: {
890
+ borderLeftWidth: 0.5
891
+ }
892
+ }
893
+ },
894
+ children: /* @__PURE__ */ e(qe, { label: "", onChange: y, options: To, value: g })
895
+ }
896
+ )
897
+ ] }),
898
+ /* @__PURE__ */ e(L, { fullWidth: !0, onClick: v, type: "submit", variant: "contained", children: R.calculate })
899
+ ] }) }) });
900
+ }, Fo = S(Oo), Ce = {
901
+ connect_accounts: "Connect Accounts",
902
+ more_accounts: "More Accounts",
903
+ your_savings: "Your Savings"
904
+ }, Po = () => {
905
+ const { savingsAccounts: t } = fe(), [r, n] = h.useState(!1), o = h.useMemo(
906
+ () => t.reduce((l, s) => l + (s.balance ?? 0), 0),
907
+ [t]
908
+ );
909
+ return /* @__PURE__ */ i(u, { sx: { gap: 24 }, children: [
910
+ /* @__PURE__ */ e(K, { sx: { bgcolor: "background.paper", p: 16 }, children: /* @__PURE__ */ i(u, { sx: { gap: 16 }, children: [
911
+ /* @__PURE__ */ e(_e, { balance: o, title: Ce.your_savings }),
912
+ t.length ? /* @__PURE__ */ e(Rt, { loadAccounts: [Re.SAVINGS], loadMoreLabel: Ce.connect_accounts }) : /* @__PURE__ */ e(Pn, { onClick: () => n(!0), variant: "contained", children: Ce.connect_accounts })
913
+ ] }) }),
914
+ /* @__PURE__ */ e(Fo, { total: o }),
915
+ /* @__PURE__ */ e(
916
+ ne,
917
+ {
918
+ onClose: () => n(!1),
919
+ showConnectWidget: r,
920
+ title: Ce.connect_accounts
961
921
  }
962
922
  )
963
923
  ] });
964
- }, wt = () => {
965
- const { healthScore: n } = $(), { finstrong: o } = S(), { key_indicators_save: t } = o, i = (r) => {
966
- const { good: a, poor: c } = X.daysOfCashOnHand;
967
- let p = f.MISSING, h = t.days_of_cash_missing_description, m = o.key_indicators_missing;
968
- return r !== null && (r >= a ? (p = f.GOOD, h = b(t.days_of_cash_good_description, r), m = o.key_indicators_good) : r < a && r >= c ? (p = f.FAIR, h = b(t.days_of_cash_fair_description, r), m = o.key_indicators_fair) : r < c && (p = f.OFF_TRACK, h = b(t.days_of_cash_off_track_description, r), m = o.key_indicators_off_track)), {
969
- cardState: p,
970
- description: h,
971
- title: t.days_of_cash_title,
972
- stateTitle: m
924
+ }, Ro = S(Po), Ie = S(
925
+ ({ label: t, value: r, status: n, bottomComponent: o, statusBarData: l = [] }) => {
926
+ const { finstrong: s } = C(), a = {
927
+ GOOD: {
928
+ backgroundColor: "success.lighter",
929
+ color: "success.main",
930
+ progressBarColor: "primary.main",
931
+ label: s?.key_indicators_good
932
+ },
933
+ FAIR: {
934
+ backgroundColor: "warning.lighter",
935
+ color: "warning.main",
936
+ progressBarColor: "warning.main",
937
+ label: s?.key_indicators_fair
938
+ },
939
+ OFF_TRACK: {
940
+ backgroundColor: "error.lighter",
941
+ color: "error.main",
942
+ progressBarColor: "error.main",
943
+ label: s?.key_indicators_off_track
944
+ },
945
+ MISSING: {
946
+ backgroundColor: "divider",
947
+ color: "text.secondary",
948
+ progressBarColor: "text.secondary",
949
+ label: s?.key_indicators_missing
950
+ }
951
+ }[n], p = l.map((c, d) => l.length === 2 ? {
952
+ color: d === 0 ? "primary.main" : c.color || a?.progressBarColor,
953
+ percentage: c.percentage
954
+ } : {
955
+ color: c.color || a?.progressBarColor,
956
+ percentage: c.percentage
957
+ });
958
+ return /* @__PURE__ */ i(
959
+ u,
960
+ {
961
+ sx: {
962
+ backgroundColor: "background.paper",
963
+ gap: 8,
964
+ p: 24,
965
+ pt: 0,
966
+ borderBottom: "1px solid",
967
+ borderColor: "divider"
968
+ },
969
+ children: [
970
+ /* @__PURE__ */ i(u, { sx: { gap: 2 }, children: [
971
+ /* @__PURE__ */ e(T, { variant: "body2", children: t }),
972
+ /* @__PURE__ */ i(
973
+ u,
974
+ {
975
+ sx: {
976
+ alignItems: "center",
977
+ flexDirection: "row",
978
+ gap: 12,
979
+ justifyContent: "space-between"
980
+ },
981
+ children: [
982
+ /* @__PURE__ */ e(De, { children: r }),
983
+ /* @__PURE__ */ e(Me, { status: n })
984
+ ]
985
+ }
986
+ )
987
+ ] }),
988
+ /* @__PURE__ */ i(u, { children: [
989
+ /* @__PURE__ */ e(Rn, { data: p, height: 16 }),
990
+ o
991
+ ] })
992
+ ]
993
+ }
994
+ );
995
+ }
996
+ ), Bo = {
997
+ sticky_label: "You have saved"
998
+ }, $o = ["$0", "$250", "$500", "$750", "$1k"], Lo = () => {
999
+ const { healthScore: t } = F(), r = Math.round(t.emergency_savings_on_hand ?? NaN) || null, n = un(r), o = pt(r);
1000
+ return /* @__PURE__ */ e(
1001
+ Ie,
1002
+ {
1003
+ bottomComponent: /* @__PURE__ */ e(u, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: $o.map((l) => /* @__PURE__ */ i(u, { sx: { alignItems: "center", height: 24, width: 30 }, children: [
1004
+ /* @__PURE__ */ e(
1005
+ J,
1006
+ {
1007
+ orientation: "vertical",
1008
+ sx: {
1009
+ borderWidth: 0.5,
1010
+ height: 8,
1011
+ mt: 2
1012
+ }
1013
+ }
1014
+ ),
1015
+ /* @__PURE__ */ e(T, { variant: "caption", children: l })
1016
+ ] }, l)) }),
1017
+ label: Bo.sticky_label,
1018
+ status: o,
1019
+ statusBarData: [
1020
+ {
1021
+ percentage: n
1022
+ }
1023
+ ],
1024
+ value: B(r ?? 0, "0,0.00")
1025
+ }
1026
+ );
1027
+ }, Wo = S(Lo), et = 65, tt = 34, Eo = ({
1028
+ transactions: t,
1029
+ bgcolor: r,
1030
+ height: n = "calc(100dvh - 36px)",
1031
+ loader: o = /* @__PURE__ */ e(te, { label: "Loading", size: 40 }),
1032
+ onClick: l,
1033
+ showInsights: s = !1,
1034
+ showLoader: a = !1,
1035
+ width: p = "100%",
1036
+ zeroState: c = /* @__PURE__ */ e(Ln, {})
1037
+ }) => {
1038
+ const { getCategoryName: d } = Le(), { onEvent: _ } = Cn(), { categories: m } = C(), { clearExpandedSplits: g, setShowInsights: y, toggleSplit: v } = $n(), b = (w) => {
1039
+ const O = t.find((A) => A.guid === w);
1040
+ if (O?.has_been_split) {
1041
+ v(O.guid);
1042
+ return;
1043
+ }
1044
+ _(Wn.ACCOUNT_DETAILS_CLICK_TRANSACTION, {
1045
+ account_guid: O?.account_guid,
1046
+ transaction_guid: w
1047
+ }), l?.(w);
1048
+ }, f = h.useRef(null), x = Bn({
1049
+ count: t.length,
1050
+ getScrollElement: () => f.current,
1051
+ estimateSize: (w) => et + (Be(w, t) ? tt : 0),
1052
+ overscan: 5
1053
+ });
1054
+ return h.useEffect(() => x.measure(), [t]), h.useEffect(() => y(s), [s]), h.useEffect(() => () => g(), []), /* @__PURE__ */ e(St, { sx: { width: p }, children: /* @__PURE__ */ e(D, { height: n, overflow: "auto", ref: f, width: p, children: /* @__PURE__ */ i(
1055
+ D,
1056
+ {
1057
+ height: (
1058
+ // set the height to auto when there are no transactions so the zero state isn't set to 0
1059
+ x.getVirtualItems().length === 0 ? "auto" : x.getTotalSize()
1060
+ ),
1061
+ position: "relative",
1062
+ width: "100%",
1063
+ children: [
1064
+ a && o,
1065
+ !a && x.getVirtualItems().length === 0 && c,
1066
+ !a && x.getVirtualItems().length > 0 && x.getVirtualItems().map((w) => {
1067
+ const O = t[w.index], A = Be(w.index, t), N = Ct(w.index, t), G = et + (A ? tt : 0);
1068
+ return /* @__PURE__ */ i(
1069
+ D,
1070
+ {
1071
+ sx: {
1072
+ height: G,
1073
+ position: "absolute",
1074
+ transform: `translateY(${w.start}px)`,
1075
+ width: "100%"
1076
+ },
1077
+ children: [
1078
+ A && /* @__PURE__ */ e(vt, { bgcolor: r, children: ze(O.date) }),
1079
+ /* @__PURE__ */ e(
1080
+ wt,
1081
+ {
1082
+ ...l && { onClick: b },
1083
+ transaction: {
1084
+ ...O,
1085
+ category: m.default_categories[O.top_level_category_guid]?.replace(
1086
+ /&amp;/g,
1087
+ "&"
1088
+ ) ?? d(O.top_level_category_guid)
1089
+ }
1090
+ }
1091
+ ),
1092
+ /* @__PURE__ */ e(J, { sx: { ml: N ? 24 : 0 } })
1093
+ ]
1094
+ },
1095
+ O.guid
1096
+ );
1097
+ })
1098
+ ]
1099
+ }
1100
+ ) }) });
1101
+ }, Go = S(Eo), Te = ({
1102
+ transactions: t = [],
1103
+ amountColor: r = "success.main",
1104
+ amountPosition: n = "center",
1105
+ formatDate: o = ze,
1106
+ secondaryIcon: l
1107
+ }) => {
1108
+ const s = H(), { connect: a, finstrong: p } = C(), [c, d] = h.useState(!1), [_, m] = h.useState(!1), g = 3, y = t.length > g, v = t.length - g;
1109
+ return !t || t.length === 0 ? /* @__PURE__ */ i(E, { children: [
1110
+ /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(
1111
+ L,
1112
+ {
1113
+ onClick: () => m(!0),
1114
+ size: "small",
1115
+ sx: { my: 0, px: 16, py: 12, width: "100%" },
1116
+ variant: "contained",
1117
+ children: /* @__PURE__ */ e(T, { bold: !0, variant: "body1", children: p.connect_more_accounts_button })
1118
+ }
1119
+ ) }),
1120
+ /* @__PURE__ */ e(
1121
+ ne,
1122
+ {
1123
+ onClose: () => m(!1),
1124
+ showConnectWidget: _,
1125
+ title: a.mini_title
1126
+ }
1127
+ )
1128
+ ] }) : /* @__PURE__ */ i(u, { sx: { gap: 16 }, children: [
1129
+ /* @__PURE__ */ e(D, { sx: { border: `1px solid ${s.palette.divider}`, borderRadius: 2 }, children: t.slice(0, g).map((b, f) => /* @__PURE__ */ i(
1130
+ u,
1131
+ {
1132
+ sx: {
1133
+ alignItems: "center",
1134
+ flexDirection: "row",
1135
+ gap: 16,
1136
+ pl: 24,
1137
+ pt: 14
1138
+ },
1139
+ children: [
1140
+ /* @__PURE__ */ e(u, { sx: { pb: 14 }, children: /* @__PURE__ */ e(
1141
+ nn,
1142
+ {
1143
+ categoryGuid: b.top_level_category_guid || "",
1144
+ merchantGuid: b.merchant_guid || "",
1145
+ size: 32
1146
+ }
1147
+ ) }),
1148
+ /* @__PURE__ */ i(
1149
+ u,
1150
+ {
1151
+ sx: {
1152
+ alignItems: n,
1153
+ flexDirection: "row",
1154
+ gap: 12,
1155
+ justifyContent: "space-between",
1156
+ ...f < Math.min(t.length, g) - 1 && {
1157
+ borderBottom: `1px solid ${s.palette.divider}`
1158
+ },
1159
+ pb: 14,
1160
+ pr: 24,
1161
+ width: "100%"
1162
+ },
1163
+ children: [
1164
+ /* @__PURE__ */ i(u, { sx: { gap: 4 }, children: [
1165
+ /* @__PURE__ */ e(k, { bold: !0, variant: "body1", children: b.description }),
1166
+ /* @__PURE__ */ i(u, { sx: { flexDirection: "row", alignItems: "center", gap: 4 }, children: [
1167
+ !!l && l,
1168
+ /* @__PURE__ */ e(T, { variant: "caption", children: o(b.date) })
1169
+ ] })
1170
+ ] }),
1171
+ /* @__PURE__ */ e(k, { bold: !0, sx: { color: r, flexShrink: 0 }, variant: "body1", children: B(b.amount, "0,0.00") })
1172
+ ]
1173
+ },
1174
+ b.guid || f
1175
+ )
1176
+ ]
1177
+ },
1178
+ f
1179
+ )) }),
1180
+ y && /* @__PURE__ */ i(E, { children: [
1181
+ /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(
1182
+ L,
1183
+ {
1184
+ endIcon: /* @__PURE__ */ e(Z, {}),
1185
+ onClick: () => d(!0),
1186
+ size: "small",
1187
+ sx: { my: 0, px: 16, py: 12, width: "100%" },
1188
+ children: /* @__PURE__ */ i(T, { bold: !0, variant: "body1", children: [
1189
+ v,
1190
+ " ",
1191
+ p.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_more_transactions
1192
+ ] })
1193
+ }
1194
+ ) }),
1195
+ /* @__PURE__ */ e(
1196
+ ie,
1197
+ {
1198
+ isOpen: c,
1199
+ onClose: () => d(!1),
1200
+ title: p.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_transactions,
1201
+ children: /* @__PURE__ */ e(Go, { transactions: t })
1202
+ }
1203
+ )
1204
+ ] })
1205
+ ] });
1206
+ }, zo = () => {
1207
+ const {
1208
+ finstrong: {
1209
+ key_indicators_spend: { pay_bills_on_time_drawer: t }
1210
+ }
1211
+ } = C(), { getSpendingFeeTransactions: r, allTransactions: n } = F();
1212
+ return h.useEffect(() => {
1213
+ r().finally();
1214
+ }, []), /* @__PURE__ */ e(E, { children: n.spendingFee.length === 0 ? /* @__PURE__ */ i(
1215
+ K,
1216
+ {
1217
+ sx: {
1218
+ backgroundColor: "background.paper",
1219
+ pb: 48,
1220
+ pt: 32,
1221
+ px: 24,
1222
+ textAlign: "center",
1223
+ width: "100%"
1224
+ },
1225
+ children: [
1226
+ /* @__PURE__ */ e(Xt, { filled: !0, size: 48, sx: { color: "success.main" } }),
1227
+ /* @__PURE__ */ i(u, { sx: { alignItems: "center", gap: 4, pt: 24 }, children: [
1228
+ /* @__PURE__ */ e(Y, { children: t.pay_bills_on_time_zero_fees_title }),
1229
+ /* @__PURE__ */ e(k, { variant: "subtitle1", children: t.pay_bills_on_time_zero_fees_description })
1230
+ ] })
1231
+ ]
1232
+ }
1233
+ ) : /* @__PURE__ */ i(
1234
+ K,
1235
+ {
1236
+ sx: {
1237
+ p: 16,
1238
+ width: "100%",
1239
+ backgroundColor: "background.paper"
1240
+ },
1241
+ children: [
1242
+ /* @__PURE__ */ e(Y, { sx: { textAlign: "left", pb: 8 }, children: t.pay_bills_on_time_sticky_fee_count }),
1243
+ /* @__PURE__ */ e(
1244
+ Te,
1245
+ {
1246
+ amountColor: "text.primary",
1247
+ amountPosition: "flex-start",
1248
+ formatDate: (o) => An(new Date(o * 1e3), Mn.MONTH_DAY),
1249
+ secondaryIcon: /* @__PURE__ */ e(Ut, { color: "error", filled: !0, size: 12 }),
1250
+ transactions: n.spendingFee
1251
+ }
1252
+ )
1253
+ ]
1254
+ }
1255
+ ) });
1256
+ }, Ho = S(zo), No = () => {
1257
+ const { healthScore: t } = F(), { finstrong: r } = C(), { key_indicators_spend: n } = r, { pay_bills_on_time_drawer: o } = n, l = _n(t.spending_fee_transaction_count);
1258
+ return /* @__PURE__ */ i(
1259
+ u,
1260
+ {
1261
+ sx: {
1262
+ p: 24,
1263
+ backgroundColor: "background.paper",
1264
+ borderBottom: "1px solid",
1265
+ borderColor: "divider"
1266
+ },
1267
+ children: [
1268
+ /* @__PURE__ */ e(k, { variant: "body2", children: o.pay_bills_on_time_sticky_description }),
1269
+ /* @__PURE__ */ i(u, { direction: "row", sx: { alignItems: "center", justifyContent: "space-between" }, children: [
1270
+ /* @__PURE__ */ i(De, { children: [
1271
+ t.spending_fee_transaction_count,
1272
+ " ",
1273
+ o.pay_bills_on_time_sticky_fee_count
1274
+ ] }),
1275
+ /* @__PURE__ */ e(Me, { status: l })
1276
+ ] })
1277
+ ]
1278
+ }
1279
+ );
1280
+ }, Ko = S(No), jo = () => {
1281
+ const { savingsAndCheckingAccountsBalance: t } = fe(), { finstrong: r } = C();
1282
+ return /* @__PURE__ */ i(u, { gap: 16, sx: { p: 16 }, children: [
1283
+ /* @__PURE__ */ e(
1284
+ _e,
1285
+ {
1286
+ balance: t,
1287
+ title: r.key_indicators_save.drawer_available_balance
1288
+ }
1289
+ ),
1290
+ /* @__PURE__ */ e(
1291
+ Rt,
1292
+ {
1293
+ loadAccounts: [Re.SAVINGS, Re.CHECKING],
1294
+ loadMoreLabel: r.more_accounts
1295
+ }
1296
+ )
1297
+ ] });
1298
+ }, Vo = S(jo), Yo = ({ chartFor: t }) => {
1299
+ const r = H(), { monthlySummaries: n } = F(), { finstrong: o } = C(), [l, { width: s }] = kt(), a = {
1300
+ savingsOverTime: {
1301
+ icon: /* @__PURE__ */ e(rt, { size: 48, style: { marginBottom: 8 } }),
1302
+ title: o.key_indicators_save.zero_state_title,
1303
+ description: o.key_indicators_save.zero_state_description
1304
+ },
1305
+ debtOverTime: {
1306
+ icon: /* @__PURE__ */ e(it, { size: 48, style: { marginBottom: 8 } }),
1307
+ title: "",
1308
+ description: ""
1309
+ }
1310
+ }[t], c = {
1311
+ savingsOverTime: {
1312
+ title: o.key_indicators_save.savings_over_time,
1313
+ valueKey: "available_cash"
1314
+ },
1315
+ debtOverTime: {
1316
+ title: o.key_indicators_borrow.have_manageable_debt_drawer.debt_over_time,
1317
+ valueKey: "debt_balance"
1318
+ }
1319
+ }[t], d = hn(n, c.valueKey), _ = Math.max(...n.map((b) => b[c.valueKey])), m = () => _ >= 1e6 ? { formatter: "0.000a", leftMargin: 55 } : _ >= 1e3 ? { formatter: "0a", leftMargin: 35 } : { formatter: "0a", leftMargin: 30 }, { formatter: g, leftMargin: y } = m(), v = c.title;
1320
+ return /* @__PURE__ */ e(K, { ref: l, sx: { backgroundColor: "background.paper" }, children: d.length >= 1 ? /* @__PURE__ */ i(u, { gap: 8, sx: { pl: 18 }, children: [
1321
+ /* @__PURE__ */ e(k, { sx: { pb: 8, pt: 16 }, variant: "h3", children: v }),
1322
+ /* @__PURE__ */ e(
1323
+ We,
1324
+ {
1325
+ axisColor: r.palette.divider,
1326
+ baseline: "min",
1327
+ colors: [r.palette.primary.main],
1328
+ curveType: "natural",
1329
+ datasets: d ? [d] : [],
1330
+ height: 244,
1331
+ labels: [o.key_indicators_label],
1332
+ margin: { left: y, top: 5, right: 10 },
1333
+ showArea: !0,
1334
+ showAverage: !0,
1335
+ showXAxis: !0,
1336
+ useCustomMark: !0,
1337
+ valueFormatterString: g,
1338
+ width: s < 342 ? s - 48 : 342
1339
+ }
1340
+ )
1341
+ ] }) : /* @__PURE__ */ i(u, { gap: 8, sx: { alignItems: "center", p: 24, pb: 48 }, children: [
1342
+ a.icon,
1343
+ /* @__PURE__ */ e(k, { fontWeight: 600, variant: "body1", children: a.title }),
1344
+ /* @__PURE__ */ e(k, { align: "center", variant: "subtitle1", children: a.description })
1345
+ ] }) });
1346
+ }, Bt = S(Yo), Xo = () => {
1347
+ const { finstrong: t } = C(), { healthScore: r, allTransactions: n, loadSpendTransactions: o, loadDebtSpend: l } = F(), { isInitialized: s } = X();
1348
+ h.useEffect(() => {
1349
+ s && (o().finally(), l().finally());
1350
+ }, [s]);
1351
+ const a = h.useMemo(() => {
1352
+ const p = n.spend.map((d) => d.transaction), c = n.debtSpend.map((d) => d.transaction);
1353
+ return [...p, ...c];
1354
+ }, [n.spend, n.debtSpend]);
1355
+ return s ? /* @__PURE__ */ i(u, { gap: 16, sx: { p: 16 }, children: [
1356
+ /* @__PURE__ */ e(
1357
+ _e,
1358
+ {
1359
+ balance: r.ninety_day_spend / 90,
1360
+ title: t.key_indicators_save.drawer_daily_spend
1361
+ }
1362
+ ),
1363
+ /* @__PURE__ */ e(Te, { amountColor: "text.primary", transactions: a })
1364
+ ] }) : /* @__PURE__ */ e(te, {});
1365
+ }, Uo = S(Xo), qo = () => {
1366
+ const [t, r] = h.useState(0), { finstrong: n } = C();
1367
+ return /* @__PURE__ */ i(E, { children: [
1368
+ /* @__PURE__ */ i(K, { children: [
1369
+ /* @__PURE__ */ i(
1370
+ Ee,
1371
+ {
1372
+ "aria-label": n.key_indicators_save.drawer_title,
1373
+ centered: !0,
1374
+ onChange: (o, l) => r(l),
1375
+ sx: { mb: 0 },
1376
+ value: t,
1377
+ variant: "fullWidth",
1378
+ children: [
1379
+ /* @__PURE__ */ e(
1380
+ re,
1381
+ {
1382
+ "aria-controls": "available-details-tabpanel-0",
1383
+ label: n.key_indicators_save.drawer_available,
1384
+ sx: { minHeight: 44 }
1385
+ }
1386
+ ),
1387
+ /* @__PURE__ */ e(
1388
+ re,
1389
+ {
1390
+ "aria-controls": "spending-details-tabpanel-1",
1391
+ label: n.key_indicators_save.drawer_spending,
1392
+ sx: { minHeight: 44 }
1393
+ }
1394
+ )
1395
+ ]
1396
+ }
1397
+ ),
1398
+ /* @__PURE__ */ e(ae, { index: 0, name: "available-details", value: t, children: /* @__PURE__ */ e(Vo, {}) }),
1399
+ /* @__PURE__ */ e(ae, { index: 1, name: "spending-details", value: t, children: /* @__PURE__ */ e(Uo, {}) })
1400
+ ] }),
1401
+ /* @__PURE__ */ e(Bt, { chartFor: "savingsOverTime" })
1402
+ ] });
1403
+ }, Zo = S(qo), Qo = () => {
1404
+ const { finstrong: t } = C(), { healthScore: r } = F(), n = r.months_of_cash_on_hand, o = ut(n ? n * 30 : null), l = 183 / 6, s = Math.floor(n), a = Math.round((n - s) * l), p = n / 6 * 100;
1405
+ return /* @__PURE__ */ e(
1406
+ Ie,
1407
+ {
1408
+ bottomComponent: /* @__PURE__ */ e(
1409
+ u,
1410
+ {
1411
+ sx: {
1412
+ flexDirection: "row",
1413
+ height: 24,
1414
+ justifyContent: "space-between",
1415
+ mt: 2,
1416
+ px: 1
1417
+ },
1418
+ children: ["0 Mo", "1 Mo", "2 Mo", "3 Mo", "4 Mo", "5 Mo", "6 Mo"].map((d) => /* @__PURE__ */ i(
1419
+ u,
1420
+ {
1421
+ sx: {
1422
+ alignItems: "center",
1423
+ height: 24
1424
+ },
1425
+ children: [
1426
+ /* @__PURE__ */ e(
1427
+ J,
1428
+ {
1429
+ orientation: "vertical",
1430
+ sx: {
1431
+ borderWidth: 1,
1432
+ height: 8
1433
+ }
1434
+ }
1435
+ ),
1436
+ /* @__PURE__ */ e(T, { variant: "XSmall", children: d })
1437
+ ]
1438
+ },
1439
+ d
1440
+ ))
1441
+ }
1442
+ ),
1443
+ label: t.key_indicators_save.drawer_progress_bar_label,
1444
+ status: o,
1445
+ statusBarData: [
1446
+ {
1447
+ percentage: `${p}%`
1448
+ }
1449
+ ],
1450
+ value: V(t.key_indicators_save.drawer_progress_bar_value, s, a)
1451
+ }
1452
+ );
1453
+ }, Jo = S(Qo), er = () => {
1454
+ const { healthScore: t } = F(), { finstrong: r } = C(), n = ve(t.debt_to_income_ratio) ?? 0, o = Object.keys(t).length === 0, s = ((a) => o ? "MISSING" : a <= 30 ? "GOOD" : a >= 31 && a <= 39 ? "FAIR" : a >= 40 ? "OFF_TRACK" : "MISSING")(n);
1455
+ return /* @__PURE__ */ e(
1456
+ Ie,
1457
+ {
1458
+ bottomComponent: /* @__PURE__ */ i(
1459
+ u,
1460
+ {
1461
+ sx: {
1462
+ alignItems: "flex-end",
1463
+ flexDirection: "row",
1464
+ height: 24,
1465
+ justifyContent: "space-between",
1466
+ mt: 2,
1467
+ position: "relative"
1468
+ },
1469
+ children: [
1470
+ /* @__PURE__ */ e(
1471
+ D,
1472
+ {
1473
+ sx: {
1474
+ left: "30%",
1475
+ position: "absolute",
1476
+ transform: "translateX(-50%)"
1477
+ },
1478
+ children: /* @__PURE__ */ i(
1479
+ u,
1480
+ {
1481
+ sx: {
1482
+ alignItems: "center",
1483
+ flexDirection: "column",
1484
+ height: 24,
1485
+ justifyContent: "flex-end"
1486
+ },
1487
+ children: [
1488
+ /* @__PURE__ */ e(
1489
+ J,
1490
+ {
1491
+ orientation: "vertical",
1492
+ sx: {
1493
+ borderWidth: 1,
1494
+ height: 8
1495
+ }
1496
+ }
1497
+ ),
1498
+ /* @__PURE__ */ e(T, { sx: { color: "text.primary" }, variant: "XSmall", children: "30%" })
1499
+ ]
1500
+ }
1501
+ )
1502
+ }
1503
+ ),
1504
+ /* @__PURE__ */ e(
1505
+ D,
1506
+ {
1507
+ sx: {
1508
+ display: "flex",
1509
+ flexDirection: "column",
1510
+ height: 24,
1511
+ justifyContent: "center",
1512
+ marginLeft: "auto"
1513
+ },
1514
+ children: /* @__PURE__ */ e(T, { variant: "Small", children: V(
1515
+ r.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_sticky_description,
1516
+ n
1517
+ ) })
1518
+ }
1519
+ )
1520
+ ]
1521
+ }
1522
+ ),
1523
+ label: r.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_sticky_title,
1524
+ status: s,
1525
+ statusBarData: [
1526
+ {
1527
+ percentage: `${n}%`
1528
+ }
1529
+ ],
1530
+ value: B(t.ninety_day_debt_spend, "0,0.00")
1531
+ }
1532
+ );
1533
+ }, tr = S(er), nr = () => {
1534
+ const { healthScore: t, allTransactions: r } = F(), { connect: n, finstrong: o } = C(), [l, s] = h.useState(!1);
1535
+ return /* @__PURE__ */ i(u, { gap: 16, sx: { p: 16 }, children: [
1536
+ /* @__PURE__ */ e(
1537
+ _e,
1538
+ {
1539
+ balance: t.ninety_day_income,
1540
+ sx: { flexDirection: "column-reverse" },
1541
+ title: o.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_income
1542
+ }
1543
+ ),
1544
+ r.income.length ? (
1545
+ // TODO: Need to add More Transactions functionality
1546
+ /* @__PURE__ */ e(Te, { transactions: r.income.map((a) => a.transaction) })
1547
+ ) : /* @__PURE__ */ e(
1548
+ L,
1549
+ {
1550
+ onClick: () => {
1551
+ s(!0);
1552
+ },
1553
+ variant: "contained",
1554
+ children: o.connect_more_accounts_button
1555
+ }
1556
+ ),
1557
+ /* @__PURE__ */ e(
1558
+ ne,
1559
+ {
1560
+ onClose: () => s(!1),
1561
+ showConnectWidget: l,
1562
+ title: n.mini_title
1563
+ }
1564
+ )
1565
+ ] });
1566
+ }, or = S(nr), rr = () => {
1567
+ const { allTransactions: t, healthScore: r } = F(), { connect: n, finstrong: o } = C(), [l, s] = h.useState(!1);
1568
+ return /* @__PURE__ */ i(u, { gap: 16, sx: { p: 16 }, children: [
1569
+ /* @__PURE__ */ e(
1570
+ _e,
1571
+ {
1572
+ balance: r.ninety_day_debt_spend,
1573
+ sx: { flexDirection: "column-reverse" },
1574
+ title: o.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_payments
1575
+ }
1576
+ ),
1577
+ t.debtSpend.length ? (
1578
+ //TODO: Need to add More Transactions functionality
1579
+ /* @__PURE__ */ e(
1580
+ Te,
1581
+ {
1582
+ amountColor: "text.primary",
1583
+ transactions: t.debtSpend.map((a) => a.transaction)
1584
+ }
1585
+ )
1586
+ ) : /* @__PURE__ */ e(
1587
+ L,
1588
+ {
1589
+ onClick: () => {
1590
+ s(!0);
1591
+ },
1592
+ variant: "contained",
1593
+ children: o.connect_more_accounts_button
1594
+ }
1595
+ ),
1596
+ /* @__PURE__ */ e(
1597
+ ne,
1598
+ {
1599
+ onClose: () => s(!1),
1600
+ showConnectWidget: l,
1601
+ title: n.mini_title
1602
+ }
1603
+ )
1604
+ ] });
1605
+ }, ar = S(rr), ir = ({
1606
+ color: t,
1607
+ data: r,
1608
+ series: n,
1609
+ style: o,
1610
+ ...l
1611
+ }) => {
1612
+ const s = H(), a = h.useRef(null), { width: p } = Kn({
1613
+ width: o.width
1614
+ });
1615
+ h.useLayoutEffect(() => {
1616
+ const m = new ResizeObserver(() => {
1617
+ window.requestAnimationFrame(() => {
1618
+ if (a.current) {
1619
+ const { width: g } = a.current.getBoundingClientRect(), y = g / 2, v = a.current.querySelector("text");
1620
+ v && v.setAttribute("transform", `translate(${y}, -8)`);
1621
+ }
1622
+ });
1623
+ });
1624
+ return a.current && m.observe(a.current), () => {
1625
+ a.current && m.unobserve(a.current);
973
1626
  };
974
- }, d = (r) => {
975
- const { good: a, poor: c } = X.emergencySavings;
976
- let p = f.MISSING, h = t.emergency_savings_missing_description, m = o.key_indicators_missing;
977
- return r !== null && (r >= a ? (p = f.GOOD, h = t.emergency_savings_good_description, m = o.key_indicators_good) : r < a && r >= c ? (p = f.FAIR, h = b(
978
- t.emergency_savings_fair_description,
979
- rt(r, "0,0.00")
980
- ), m = o.key_indicators_fair) : r < c && (p = f.OFF_TRACK, h = t.emergency_savings_off_track_description, m = o.key_indicators_off_track)), {
1627
+ }, []);
1628
+ const { formattedComparison: c, formattedMain: d } = r[n.index], _ = n.type === 0 ? d : c;
1629
+ return /* @__PURE__ */ i("g", { children: [
1630
+ /* @__PURE__ */ e(Ze.rect, { ...l, fill: t, ref: a, rx: 2, style: o }),
1631
+ /* @__PURE__ */ e(
1632
+ Ze.text,
1633
+ {
1634
+ fill: s.palette.text.secondary,
1635
+ fontSize: 9,
1636
+ fontWeight: 400,
1637
+ textAnchor: "middle",
1638
+ transform: p.to((m) => `translate(${m / 2}, -5)`),
1639
+ x: o.x,
1640
+ y: o.y,
1641
+ children: _
1642
+ }
1643
+ )
1644
+ ] });
1645
+ }, $t = ({
1646
+ chartFor: t,
1647
+ data: r,
1648
+ title: n,
1649
+ buttonLabel: o,
1650
+ onClick: l,
1651
+ legendLabelMain: s,
1652
+ legendLabelComparison: a,
1653
+ totalComparison: p,
1654
+ totalMain: c
1655
+ }) => {
1656
+ const d = H(), _ = Gn(d.breakpoints.down("xs")), m = h.useMemo(
1657
+ () => r.sort((x, w) => x.month - w.month).map((x) => {
1658
+ const w = mn(x.month), O = {
1659
+ spending_vs_income: {
1660
+ main: x.standard_spend,
1661
+ comparison: x.income,
1662
+ formattedMain: B(x.standard_spend, "0.0a"),
1663
+ formattedComparison: B(x.income, "0.0a")
1664
+ },
1665
+ debt_payment_vs_income: {
1666
+ main: x.income,
1667
+ comparison: x.debt_spend,
1668
+ formattedMain: B(x.income, "0.0a"),
1669
+ formattedComparison: B(x.debt_spend, "0.0a")
1670
+ }
1671
+ };
1672
+ return {
1673
+ label: w,
1674
+ ...O[t]
1675
+ };
1676
+ }),
1677
+ [r, t]
1678
+ ), g = {
1679
+ dataKey: "label",
1680
+ scaleType: "band"
1681
+ }, y = Math.max(...m.map((x) => Math.max(x.main, x.comparison))), v = Math.ceil(y * 1.2 / 1e3) * 1e3, b = v / 3, f = {
1682
+ scaleType: "linear",
1683
+ min: 0,
1684
+ max: v,
1685
+ tickNumber: 4,
1686
+ tickMinStep: b,
1687
+ valueFormatter: (x) => x === 0 ? "$0" : `$${(x / 1e3).toFixed(0)}K`
1688
+ };
1689
+ return /* @__PURE__ */ i(
1690
+ K,
1691
+ {
1692
+ sx: {
1693
+ px: 16,
1694
+ py: 24
1695
+ },
1696
+ children: [
1697
+ /* @__PURE__ */ i(
1698
+ u,
1699
+ {
1700
+ sx: {
1701
+ alignItems: "center",
1702
+ flexDirection: "row",
1703
+ justifyContent: "space-between",
1704
+ gap: 12,
1705
+ pb: 8
1706
+ },
1707
+ children: [
1708
+ /* @__PURE__ */ e(Y, { children: n }),
1709
+ o && /* @__PURE__ */ e(
1710
+ L,
1711
+ {
1712
+ endIcon: /* @__PURE__ */ e(Z, {}),
1713
+ onClick: l,
1714
+ size: "small",
1715
+ sx: {
1716
+ pl: 8,
1717
+ height: 24
1718
+ },
1719
+ variant: "text",
1720
+ children: o
1721
+ }
1722
+ )
1723
+ ]
1724
+ }
1725
+ ),
1726
+ /* @__PURE__ */ i(u, { sx: { alignItems: "center", flexDirection: "row", gap: 24, py: 4 }, children: [
1727
+ /* @__PURE__ */ i(u, { sx: { gap: 8, alignItems: "center", flexDirection: "row" }, children: [
1728
+ /* @__PURE__ */ e(
1729
+ D,
1730
+ {
1731
+ sx: {
1732
+ width: 10,
1733
+ height: 10,
1734
+ backgroundColor: "chart.chart3",
1735
+ borderRadius: "2px"
1736
+ }
1737
+ }
1738
+ ),
1739
+ /* @__PURE__ */ i(u, { sx: { alignItems: "center", flexDirection: "row" }, children: [
1740
+ /* @__PURE__ */ i(T, { variant: "subtitle2", children: [
1741
+ s,
1742
+ " "
1743
+ ] }),
1744
+ !_ && c && /* @__PURE__ */ e(T, { bold: !0, variant: "subtitle2", children: c })
1745
+ ] })
1746
+ ] }),
1747
+ /* @__PURE__ */ i(u, { alignItems: "center", direction: "row", spacing: 8, children: [
1748
+ /* @__PURE__ */ e(
1749
+ D,
1750
+ {
1751
+ sx: {
1752
+ width: 10,
1753
+ height: 10,
1754
+ backgroundColor: "chart.chart5",
1755
+ borderRadius: "2px"
1756
+ }
1757
+ }
1758
+ ),
1759
+ /* @__PURE__ */ i(u, { sx: { alignItems: "center", flexDirection: "row" }, children: [
1760
+ /* @__PURE__ */ i(T, { variant: "subtitle2", children: [
1761
+ a,
1762
+ " "
1763
+ ] }),
1764
+ !_ && p && /* @__PURE__ */ e(T, { bold: !0, variant: "subtitle2", children: p })
1765
+ ] })
1766
+ ] })
1767
+ ] }),
1768
+ /* @__PURE__ */ i(
1769
+ Nn,
1770
+ {
1771
+ colors: [`${d.palette.chart.chart3}`, `${d.palette.chart.chart5}`],
1772
+ dataset: m,
1773
+ height: 240,
1774
+ margin: { top: 20, bottom: 30, right: 10 },
1775
+ series: [
1776
+ { dataKey: "main", type: "bar" },
1777
+ { dataKey: "comparison", type: "bar" }
1778
+ ],
1779
+ xAxis: [g],
1780
+ yAxis: [f],
1781
+ children: [
1782
+ /* @__PURE__ */ e(
1783
+ jt,
1784
+ {
1785
+ slots: {
1786
+ bar: (x) => {
1787
+ const { ownerState: w, style: O, ...A } = x;
1788
+ return /* @__PURE__ */ e(
1789
+ ir,
1790
+ {
1791
+ ...A,
1792
+ color: w.color,
1793
+ data: m,
1794
+ series: {
1795
+ index: w.dataIndex,
1796
+ type: Number(w.id.toString().split("-").pop())
1797
+ },
1798
+ style: O
1799
+ }
1800
+ );
1801
+ }
1802
+ }
1803
+ }
1804
+ ),
1805
+ /* @__PURE__ */ e(
1806
+ zn,
1807
+ {
1808
+ sx: () => ({
1809
+ ".MuiChartsAxis-line": {
1810
+ stroke: d.palette.divider
1811
+ },
1812
+ ".MuiChartsAxis-tick": {
1813
+ stroke: d.palette.divider
1814
+ },
1815
+ ".MuiChartsAxis-tickLabel": {
1816
+ transform: "translateY(10px)"
1817
+ }
1818
+ }),
1819
+ tickLabelStyle: {
1820
+ fontSize: 11,
1821
+ fill: "text.secondary"
1822
+ }
1823
+ }
1824
+ ),
1825
+ /* @__PURE__ */ e(
1826
+ Hn,
1827
+ {
1828
+ sx: () => ({
1829
+ ".MuiChartsAxis-line": {
1830
+ stroke: d.palette.divider
1831
+ },
1832
+ ".MuiChartsAxis-tick": {
1833
+ stroke: d.palette.divider
1834
+ },
1835
+ ".MuiChartsAxis-tickLabel": {
1836
+ transform: "translateX(-8px)"
1837
+ }
1838
+ }),
1839
+ tickLabelStyle: {
1840
+ fontSize: 11,
1841
+ fill: "text.secondary"
1842
+ }
1843
+ }
1844
+ )
1845
+ ]
1846
+ }
1847
+ )
1848
+ ]
1849
+ }
1850
+ );
1851
+ }, sr = () => {
1852
+ const { loadDebtSpend: t, loadIncome: r, monthlySummaries: n } = F(), { isInitialized: o } = X(), [l, s] = h.useState(0), { finstrong: a } = C();
1853
+ return h.useEffect(() => {
1854
+ o && (t().finally(), r().finally());
1855
+ }, [o]), /* @__PURE__ */ i(E, { children: [
1856
+ /* @__PURE__ */ i(K, { children: [
1857
+ /* @__PURE__ */ i(
1858
+ Ee,
1859
+ {
1860
+ "aria-label": a.key_indicators_save.drawer_title,
1861
+ centered: !0,
1862
+ onChange: (p, c) => s(c),
1863
+ sx: { mb: 0 },
1864
+ value: l,
1865
+ variant: "fullWidth",
1866
+ children: [
1867
+ /* @__PURE__ */ e(
1868
+ re,
1869
+ {
1870
+ "aria-controls": "income-details-tabpanel-0",
1871
+ id: "income-details-tab-0",
1872
+ label: a.key_indicators_borrow.have_manageable_debt_drawer.income,
1873
+ sx: { minHeight: 44 }
1874
+ }
1875
+ ),
1876
+ /* @__PURE__ */ e(
1877
+ re,
1878
+ {
1879
+ "aria-controls": "debt-payment-details-tabpanel-1",
1880
+ id: "debt-payment-details-tab-1",
1881
+ label: a.key_indicators_borrow.have_manageable_debt_drawer.debt_payment,
1882
+ sx: { minHeight: 44 }
1883
+ }
1884
+ )
1885
+ ]
1886
+ }
1887
+ ),
1888
+ /* @__PURE__ */ e(
1889
+ ae,
1890
+ {
1891
+ "aria-labelledby": "income-details-tab-0",
1892
+ index: 0,
1893
+ name: "income-details",
1894
+ value: l,
1895
+ children: /* @__PURE__ */ e(or, {})
1896
+ }
1897
+ ),
1898
+ /* @__PURE__ */ e(
1899
+ ae,
1900
+ {
1901
+ "aria-labelledby": "debt-payment-details-tab-1",
1902
+ index: 1,
1903
+ name: "debt-payment-details",
1904
+ value: l,
1905
+ children: /* @__PURE__ */ e(ar, {})
1906
+ }
1907
+ )
1908
+ ] }),
1909
+ n.length ? /* @__PURE__ */ i(E, { children: [
1910
+ /* @__PURE__ */ e(
1911
+ $t,
1912
+ {
1913
+ chartFor: "debt_payment_vs_income",
1914
+ data: n,
1915
+ legendLabelComparison: a.key_indicators_borrow.have_manageable_debt_drawer.debt_payment,
1916
+ legendLabelMain: a.key_indicators_borrow.have_manageable_debt_drawer.income,
1917
+ title: a.key_indicators_borrow.have_manageable_debt_drawer.debt_payment
1918
+ }
1919
+ ),
1920
+ /* @__PURE__ */ e(Bt, { chartFor: "debtOverTime" })
1921
+ ] }) : /* @__PURE__ */ i(E, { children: [
1922
+ /* @__PURE__ */ e(
1923
+ ke,
1924
+ {
1925
+ header: a.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_double_bar_chart_empty_state_header,
1926
+ icon: "multiline_chart",
1927
+ subText: a.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_double_bar_chart_empty_state_description,
1928
+ sx: {
1929
+ backgroundColor: "background.paper",
1930
+ borderRadius: "8px",
1931
+ boxShadow: 1,
1932
+ p: 24,
1933
+ pb: 48
1934
+ },
1935
+ variant: "no-buttons"
1936
+ }
1937
+ ),
1938
+ /* @__PURE__ */ e(
1939
+ ke,
1940
+ {
1941
+ header: a.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_line_chart_empty_state_header,
1942
+ icon: "multiline_chart",
1943
+ subText: a.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_line_chart_empty_state_description,
1944
+ sx: {
1945
+ backgroundColor: "background.paper",
1946
+ borderRadius: "8px",
1947
+ boxShadow: 1,
1948
+ p: 24,
1949
+ pb: 48
1950
+ },
1951
+ variant: "no-buttons"
1952
+ }
1953
+ )
1954
+ ] })
1955
+ ] });
1956
+ }, cr = S(sr), lr = () => {
1957
+ const { healthScore: t } = F(), { finstrong: r } = C(), n = ve(t.spend_to_income_ratio) ?? 0, o = Object.keys(t).length === 0, s = ((p) => o ? "MISSING" : p < 100 ? "GOOD" : p >= 100 && p <= 109 ? "FAIR" : p >= 110 ? "OFF_TRACK" : "MISSING")(n), a = {
1958
+ GOOD: [{ percentage: `${n}%` }],
1959
+ FAIR: [{ percentage: "100%" }, { percentage: `${n - 100}%` }],
1960
+ OFF_TRACK: [{ percentage: "100%" }, { percentage: `${n - 100}%` }],
1961
+ MISSING: [{ percentage: "0%" }]
1962
+ }[s];
1963
+ return /* @__PURE__ */ e(
1964
+ Ie,
1965
+ {
1966
+ bottomComponent: /* @__PURE__ */ i(
1967
+ u,
1968
+ {
1969
+ sx: {
1970
+ flexDirection: "row",
1971
+ justifyContent: "space-between",
1972
+ alignItems: "center",
1973
+ mt: 8
1974
+ },
1975
+ children: [
1976
+ /* @__PURE__ */ i(T, { variant: "body2", children: [
1977
+ o ? "-" : B(t.ninety_day_income, "0,0.00"),
1978
+ " ",
1979
+ r?.key_indicators_spend.spend_less_than_you_make_drawer.income
1980
+ ] }),
1981
+ /* @__PURE__ */ i(T, { variant: "body2", children: [
1982
+ o ? "-%" : `${n}%`,
1983
+ r?.key_indicators_spend.spend_less_than_you_make_drawer.spent
1984
+ ] })
1985
+ ]
1986
+ }
1987
+ ),
1988
+ label: r?.key_indicators_spend.spend_less_than_you_make_drawer.spend_less_than_you_make_sticky_description,
1989
+ status: s,
1990
+ statusBarData: a,
1991
+ value: o ? "$0" : B(t.ninety_day_spend, "0,0.00")
1992
+ }
1993
+ );
1994
+ }, dr = S(lr), pr = () => {
1995
+ const t = H(), { monthlySummaries: r } = F(), { finstrong: n, goals: o, spending: l } = C(), { selectedAccounts: s } = X(), { categories: a, dateRangeCategoryTotals: p, loadDateRangeCategoryTotals: c } = Le(), { appDataStore: d } = vn(), [_, m] = h.useState("");
1996
+ h.useEffect(() => {
1997
+ c(
1998
+ s,
1999
+ Dt(/* @__PURE__ */ new Date()),
2000
+ At(/* @__PURE__ */ new Date())
2001
+ ).finally();
2002
+ }, [s]);
2003
+ const g = h.useMemo(
2004
+ () => jn(a, o, t, p),
2005
+ [a, p]
2006
+ ), y = (f) => {
2007
+ m(_ === f ? "" : f);
2008
+ }, { totalSpending: v, totalIncome: b } = h.useMemo(() => r?.reduce(
2009
+ (f, { standard_spend: x = 0, income: w = 0 }) => ({
2010
+ totalSpending: f.totalSpending + x,
2011
+ totalIncome: f.totalIncome + w
2012
+ }),
2013
+ { totalSpending: 0, totalIncome: 0 }
2014
+ ), [r]);
2015
+ return /* @__PURE__ */ i(u, { sx: { gap: 24 }, children: [
2016
+ r.length ? /* @__PURE__ */ e(
2017
+ $t,
2018
+ {
2019
+ ...d.appData.client_profile?.allow_trends_widget && {
2020
+ buttonLabel: n.key_indicators_spend.spend_less_than_you_make_drawer.view_more
2021
+ },
2022
+ chartFor: "spending_vs_income",
2023
+ data: r,
2024
+ legendLabelComparison: n.key_indicators_spend.spend_less_than_you_make_drawer.income,
2025
+ legendLabelMain: n.key_indicators_spend.spend_less_than_you_make_drawer.spending,
2026
+ title: n.key_indicators_spend.spend_less_than_you_make_drawer.trends,
2027
+ totalComparison: B(b, "0,0.00"),
2028
+ totalMain: B(v, "0,0.00")
2029
+ }
2030
+ ) : /* @__PURE__ */ e(
2031
+ ke,
2032
+ {
2033
+ header: n.key_indicators_spend.spend_less_than_you_make_drawer.trends_zero_state_title,
2034
+ icon: "multiline_chart",
2035
+ subText: n.key_indicators_spend.spend_less_than_you_make_drawer.trends_zero_state_description,
2036
+ sx: {
2037
+ backgroundColor: "background.paper",
2038
+ borderRadius: "8px",
2039
+ boxShadow: 1,
2040
+ p: 24,
2041
+ pb: 48
2042
+ },
2043
+ variant: "no-buttons"
2044
+ }
2045
+ ),
2046
+ g ? /* @__PURE__ */ i(
2047
+ K,
2048
+ {
2049
+ sx: {
2050
+ px: 16,
2051
+ py: 24
2052
+ },
2053
+ children: [
2054
+ /* @__PURE__ */ i(
2055
+ u,
2056
+ {
2057
+ sx: {
2058
+ alignItems: "center",
2059
+ flexDirection: "row",
2060
+ justifyContent: "space-between",
2061
+ gap: 12,
2062
+ pb: 8
2063
+ },
2064
+ children: [
2065
+ /* @__PURE__ */ e(Y, { children: n.key_indicators_spend.spend_less_than_you_make_drawer.spending }),
2066
+ d.appData.client_profile?.allow_spending_widget && /* @__PURE__ */ e(
2067
+ L,
2068
+ {
2069
+ endIcon: /* @__PURE__ */ e(Z, {}),
2070
+ size: "small",
2071
+ sx: {
2072
+ pl: 8,
2073
+ height: 24
2074
+ },
2075
+ variant: "text",
2076
+ children: n.key_indicators_spend.spend_less_than_you_make_drawer.view_more
2077
+ }
2078
+ )
2079
+ ]
2080
+ }
2081
+ ),
2082
+ /* @__PURE__ */ i(u, { sx: { gap: 12, py: 16, flexDirection: "row", justifyContent: "center" }, children: [
2083
+ /* @__PURE__ */ e(
2084
+ Vn,
2085
+ {
2086
+ data: g,
2087
+ onSelected: y,
2088
+ selectedId: _,
2089
+ totalLabel: l.total_spending
2090
+ }
2091
+ ),
2092
+ /* @__PURE__ */ e(
2093
+ Yn,
2094
+ {
2095
+ data: g,
2096
+ onSelected: y,
2097
+ selectedId: _
2098
+ }
2099
+ )
2100
+ ] })
2101
+ ]
2102
+ }
2103
+ ) : /* @__PURE__ */ e(
2104
+ ke,
2105
+ {
2106
+ header: n.key_indicators_spend.spend_less_than_you_make_drawer.spending_zero_state_title,
2107
+ icon: "donut_small",
2108
+ subText: n.key_indicators_spend.spend_less_than_you_make_drawer.spending_zero_state_description,
2109
+ sx: {
2110
+ backgroundColor: "background.paper",
2111
+ borderRadius: "8px",
2112
+ boxShadow: 1,
2113
+ p: 24,
2114
+ pb: 48
2115
+ },
2116
+ variant: "no-buttons"
2117
+ }
2118
+ )
2119
+ ] });
2120
+ }, ur = S(pr), Fe = {
2121
+ credit_score_description: "Credit scores usually go from 300 to 850. Think of 700+ as good, 800+ as awesome, and below 600 as needing work. You can often check yours for free with your bank or credit card company.",
2122
+ maintain_emergency_savings_description: "With at least $1,000 saved, you're ready for surprises, freeing you to save for major goals.",
2123
+ maintain_emergency_savings_title: "Maintain Emergency Savings"
2124
+ }, _r = ({
2125
+ drawerFor: t,
2126
+ isOpen: r,
2127
+ onClose: n
2128
+ }) => {
2129
+ const { finstrong: o } = C(), s = {
2130
+ spendLessThanYouMake: {
2131
+ title: o.key_indicators_spend.spend_less_than_you_make_drawer.spend_less_than_you_make_title,
2132
+ description: o.key_indicators_spend.spend_less_than_you_make_drawer.spend_less_than_you_make_description,
2133
+ stickyComponent: /* @__PURE__ */ e(dr, {}),
2134
+ content: /* @__PURE__ */ e(ur, {}),
2135
+ drawerType: "connectDrawer",
2136
+ connectTitle: o.connect_your_accounts,
2137
+ connectDescription: o.connect_more_accounts_to_unlock_a_fuller_understanding_of_your_finances
2138
+ },
2139
+ payBillsOnTime: {
2140
+ title: o.key_indicators_spend.pay_bills_on_time_drawer.pay_bills_on_time_title,
2141
+ description: o.key_indicators_spend.pay_bills_on_time_drawer.pay_bills_on_time_description,
2142
+ stickyComponent: /* @__PURE__ */ e(Ko, {}),
2143
+ content: /* @__PURE__ */ e(Ho, {}),
2144
+ drawerType: "connectDrawer",
2145
+ connectTitle: o.connect_your_accounts,
2146
+ connectDescription: o.connect_more_accounts_to_unlock_a_fuller_understanding_of_your_finances
2147
+ },
2148
+ maintainEmergencySavings: {
2149
+ content: /* @__PURE__ */ e(Ro, {}),
2150
+ description: Fe.maintain_emergency_savings_description,
2151
+ stickyComponent: /* @__PURE__ */ e(Wo, {}),
2152
+ title: Fe.maintain_emergency_savings_title,
2153
+ drawerType: "connectDrawer",
2154
+ connectTitle: o.connect_your_accounts,
2155
+ connectDescription: o.connect_more_accounts_to_unlock_a_fuller_understanding_of_your_finances
2156
+ },
2157
+ haveManageableDebt: {
2158
+ title: o.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_title,
2159
+ description: o.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_description,
2160
+ stickyComponent: /* @__PURE__ */ e(tr, {}),
2161
+ content: /* @__PURE__ */ e(cr, {}),
2162
+ drawerType: "connectDrawer",
2163
+ connectTitle: o.dont_see_all_your_accounts,
2164
+ connectDescription: o.connect_more_accounts_to_view_more_accurate_financial_picture
2165
+ },
2166
+ haveAGoodCreditScore: {
2167
+ title: /* @__PURE__ */ e(wo, {}),
2168
+ description: Fe.credit_score_description,
2169
+ stickyComponent: null,
2170
+ content: /* @__PURE__ */ e(So, {})
2171
+ },
2172
+ saveEnoughToLiveOn: {
2173
+ title: o.key_indicators_save.drawer_title,
2174
+ description: o.key_indicators_save.drawer_description,
2175
+ stickyComponent: /* @__PURE__ */ e(Jo, {}),
2176
+ content: /* @__PURE__ */ e(Zo, {}),
2177
+ drawerType: "connectDrawer",
2178
+ connectTitle: o.dont_see_all_your_accounts,
2179
+ connectDescription: o.connect_more_accounts_to_view_more_accurate_financial_picture
2180
+ }
2181
+ }[t];
2182
+ return /* @__PURE__ */ e(
2183
+ Ft,
2184
+ {
2185
+ connectDescription: s?.connectDescription,
2186
+ connectTitle: s?.connectTitle,
2187
+ description: s?.description,
2188
+ drawerTitle: o.key_indicators,
2189
+ drawerType: s.drawerType,
2190
+ isOpen: r,
2191
+ loadConnectAccountsCard: !0,
2192
+ onClose: n,
2193
+ stickyComponent: s.stickyComponent,
2194
+ title: s.title,
2195
+ children: /* @__PURE__ */ e(u, { sx: { gap: 16 }, children: s.content })
2196
+ }
2197
+ );
2198
+ }, hr = S(_r), ue = ({
2199
+ drawerFor: t,
2200
+ title: r,
2201
+ description: n,
2202
+ cardState: o = "MISSING"
2203
+ }) => {
2204
+ const [l, s] = h.useState(!1);
2205
+ return /* @__PURE__ */ i(E, { children: [
2206
+ /* @__PURE__ */ i(
2207
+ u,
2208
+ {
2209
+ onClick: () => s(!0),
2210
+ sx: {
2211
+ alignItems: "center",
2212
+ flexDirection: "row",
2213
+ justifyContent: "space-between",
2214
+ gap: 12,
2215
+ p: 16,
2216
+ border: "1px solid",
2217
+ borderColor: "divider",
2218
+ borderRadius: 2,
2219
+ cursor: "pointer"
2220
+ },
2221
+ children: [
2222
+ /* @__PURE__ */ i(u, { sx: { gap: 4 }, children: [
2223
+ /* @__PURE__ */ i(u, { sx: { alignItems: "center", flexDirection: "row", gap: 8 }, children: [
2224
+ /* @__PURE__ */ e(k, { sx: { fontWeight: 600 }, variant: "body1", children: r }),
2225
+ /* @__PURE__ */ e(Me, { status: o })
2226
+ ] }),
2227
+ /* @__PURE__ */ e(k, { color: "secondary", variant: "subtitle2", children: n })
2228
+ ] }),
2229
+ /* @__PURE__ */ e(Z, { color: "secondary", size: 24 })
2230
+ ]
2231
+ }
2232
+ ),
2233
+ /* @__PURE__ */ e(
2234
+ hr,
2235
+ {
2236
+ drawerFor: t,
2237
+ isOpen: l,
2238
+ onClose: () => s(!1)
2239
+ }
2240
+ )
2241
+ ] });
2242
+ }, mr = () => {
2243
+ const { finstrong: t } = C(), { key_indicators_spend: r } = t, { healthScore: n } = F(), o = (a) => {
2244
+ const p = yn(a), c = {
2245
+ GOOD: r.ratio_good_description,
2246
+ FAIR: r.ratio_fair_description,
2247
+ OFF_TRACK: r.ratio_off_track_description,
2248
+ MISSING: r.ratio_missing_description
2249
+ }, d = p === "MISSING" ? c[p] : V(c[p], a);
2250
+ return {
981
2251
  cardState: p,
982
- description: h,
983
- title: t.emergency_savings_title,
984
- stateTitle: m
2252
+ description: d,
2253
+ title: r.ratio_card_title
985
2254
  };
986
- }, { daysOfCashOnHand: l, emergencySavings: s } = C.useMemo(() => {
987
- const r = n.months_of_cash_on_hand !== null ? Math.round(n.months_of_cash_on_hand * 30) : null, a = i(r), c = n.emergency_savings_on_hand !== null ? Math.round(n.emergency_savings_on_hand) : null, p = d(c);
988
- return { daysOfCashOnHand: a, emergencySavings: p };
2255
+ }, { spendToIncomeRatio: l, spendFeeCount: s } = h.useMemo(() => {
2256
+ const a = n.spend_to_income_ratio !== null ? Math.round(n.spend_to_income_ratio * 100) : null, p = o(a), c = gn(
2257
+ n.spending_fee_transaction_count,
2258
+ r
2259
+ );
2260
+ return { spendToIncomeRatio: p, spendFeeCount: c };
989
2261
  }, [
990
- n.months_of_cash_on_hand,
991
- n.emergency_savings_on_hand,
992
- t,
993
- o
2262
+ n.spend_to_income_ratio,
2263
+ n.spending_fee_transaction_count,
2264
+ r,
2265
+ t
994
2266
  ]);
995
- return /* @__PURE__ */ u(g, { direction: "column", gap: 24, sx: { p: 8, pt: 24 }, children: [
2267
+ return /* @__PURE__ */ i(u, { sx: { gap: 24, p: 8, pt: 24 }, children: [
996
2268
  /* @__PURE__ */ e(
997
- B,
2269
+ ue,
998
2270
  {
999
2271
  cardState: l.cardState,
1000
2272
  description: l.description,
1001
- stateTitle: l.stateTitle,
2273
+ drawerFor: se.SpendLessThanYouMake,
1002
2274
  title: l.title
1003
2275
  }
1004
2276
  ),
1005
2277
  /* @__PURE__ */ e(
1006
- B,
2278
+ ue,
1007
2279
  {
1008
2280
  cardState: s.cardState,
1009
2281
  description: s.description,
1010
- stateTitle: s.stateTitle,
2282
+ drawerFor: se.PayBillsOnTime,
1011
2283
  title: s.title
1012
2284
  }
1013
2285
  )
1014
2286
  ] });
1015
- }, Rt = () => {
1016
- const { healthScore: n } = $(), { finstrong: o } = S(), { key_indicators_borrow: t } = o, { user: i } = Y(), d = (a) => {
1017
- const { good: c, poor: p } = X.debtToIncomeRatio;
1018
- let h = f.MISSING, m = t.manage_debit_missing_description, _ = o.key_indicators_missing;
1019
- return a != null && (a <= c ? (h = f.GOOD, m = t.manage_debit_good_description, _ = o.key_indicators_good) : a > c && a <= p ? (h = f.FAIR, m = b(t.manage_debit_fair_description, a), _ = o.key_indicators_fair) : a > p && (h = f.OFF_TRACK, m = b(
1020
- t.manage_debit_off_track_description,
1021
- a
1022
- ), _ = o.key_indicators_off_track)), {
1023
- cardState: h,
1024
- description: m,
1025
- title: t.manage_debit_title,
1026
- stateTitle: _
2287
+ }, gr = S(mr), yr = () => {
2288
+ const { healthScore: t } = F(), { finstrong: r } = C(), { key_indicators_save: n } = r, o = (p) => {
2289
+ const c = ut(p), d = {
2290
+ GOOD: n.days_of_cash_good_description,
2291
+ FAIR: n.days_of_cash_fair_description,
2292
+ OFF_TRACK: n.days_of_cash_off_track_description,
2293
+ MISSING: n.days_of_cash_missing_description
2294
+ }, _ = c === "MISSING" ? d[c] : V(d[c], p);
2295
+ return {
2296
+ cardState: c,
2297
+ description: _,
2298
+ title: n.days_of_cash_title
1027
2299
  };
1028
- }, l = (a) => {
1029
- const { good: c, poor: p } = X.creditScore;
1030
- let h = f.MISSING, m = t.credit_score_missing_description, _ = o.key_indicators_missing;
1031
- return a !== null && (a >= c ? (h = f.GOOD, m = b(t.credit_score_good_description, a), _ = o.key_indicators_good) : a < c && a >= p ? (h = f.FAIR, m = b(t.credit_score_fair_description, a), _ = o.key_indicators_fair) : a < p && (h = f.OFF_TRACK, m = b(
1032
- t.credit_score_off_track_description,
1033
- a
1034
- ), _ = o.key_indicators_off_track)), {
1035
- cardState: h,
1036
- description: m,
1037
- title: t.credit_score_title,
1038
- stateTitle: _
2300
+ }, l = (p) => {
2301
+ const c = pt(p), d = {
2302
+ GOOD: n.emergency_savings_good_description,
2303
+ FAIR: n.emergency_savings_fair_description,
2304
+ OFF_TRACK: n.emergency_savings_off_track_description,
2305
+ MISSING: n.emergency_savings_missing_description
1039
2306
  };
1040
- }, { manageDebtStatus: s, creditScoreStatus: r } = C.useMemo(() => {
1041
- const a = n.debt_to_income_ratio !== null ? Math.round(n.debt_to_income_ratio * 100) : null, c = d(a), p = l(i.credit_score || null);
1042
- return {
1043
- manageDebtStatus: c,
1044
- creditScoreStatus: p
2307
+ let _;
2308
+ return c === "FAIR" && p !== null ? _ = V(
2309
+ d[c],
2310
+ B(p, "0,0.00")
2311
+ ) : _ = d[c], {
2312
+ cardState: c,
2313
+ description: _,
2314
+ title: n.emergency_savings_title
1045
2315
  };
1046
- }, [n.debt_to_income_ratio, i.credit_score, t, o]);
1047
- return /* @__PURE__ */ u(g, { direction: "column", gap: 24, sx: { p: 8, pt: 24 }, children: [
2316
+ }, { daysOfCashOnHand: s, emergencySavings: a } = h.useMemo(() => {
2317
+ const p = t.months_of_cash_on_hand !== null ? Math.round(t.months_of_cash_on_hand * 30) : null, c = o(p), d = t.emergency_savings_on_hand !== null ? Math.round(t.emergency_savings_on_hand) : null, _ = l(d);
2318
+ return { daysOfCashOnHand: c, emergencySavings: _ };
2319
+ }, [
2320
+ t.months_of_cash_on_hand,
2321
+ t.emergency_savings_on_hand,
2322
+ n,
2323
+ r
2324
+ ]);
2325
+ return /* @__PURE__ */ i(u, { direction: "column", gap: 24, sx: { p: 8, pt: 24 }, children: [
1048
2326
  /* @__PURE__ */ e(
1049
- B,
2327
+ ue,
1050
2328
  {
1051
2329
  cardState: s.cardState,
1052
2330
  description: s.description,
1053
- stateTitle: s.stateTitle,
2331
+ drawerFor: se.SaveEnoughToLiveOn,
1054
2332
  title: s.title
1055
2333
  }
1056
2334
  ),
1057
2335
  /* @__PURE__ */ e(
1058
- B,
2336
+ ue,
2337
+ {
2338
+ cardState: a.cardState,
2339
+ description: a.description,
2340
+ drawerFor: se.MaintainEmergencySavings,
2341
+ title: a.title
2342
+ }
2343
+ )
2344
+ ] });
2345
+ }, br = S(yr), fr = () => {
2346
+ const { healthScore: t } = F(), { finstrong: r } = C(), { key_indicators_borrow: n } = r, { user: o } = ee(), l = (c) => {
2347
+ const d = bn(c), _ = {
2348
+ GOOD: n.manage_debit_good_description,
2349
+ FAIR: n.manage_debit_fair_description,
2350
+ OFF_TRACK: n.manage_debit_off_track_description,
2351
+ MISSING: n.manage_debit_missing_description
2352
+ }, m = d === "FAIR" || d === "OFF_TRACK" ? V(_[d], c) : _[d];
2353
+ return {
2354
+ cardState: d,
2355
+ description: m,
2356
+ title: n.manage_debit_title
2357
+ };
2358
+ }, s = (c) => {
2359
+ const d = dt(c), _ = {
2360
+ GOOD: n.credit_score_good_description,
2361
+ FAIR: n.credit_score_fair_description,
2362
+ OFF_TRACK: n.credit_score_off_track_description,
2363
+ MISSING: n.credit_score_missing_description
2364
+ }, m = d === "MISSING" ? _[d] : V(_[d], c);
2365
+ return {
2366
+ cardState: d,
2367
+ description: m,
2368
+ title: n.credit_score_title
2369
+ };
2370
+ }, { manageDebtStatus: a, creditScoreStatus: p } = h.useMemo(() => {
2371
+ const c = t.debt_to_income_ratio !== null ? Math.round(t.debt_to_income_ratio * 100) : null, d = l(c), _ = s(o.credit_score || null);
2372
+ return {
2373
+ manageDebtStatus: d,
2374
+ creditScoreStatus: _
2375
+ };
2376
+ }, [t.debt_to_income_ratio, o.credit_score, n, r]);
2377
+ return /* @__PURE__ */ i(u, { direction: "column", gap: 24, sx: { p: 8, pt: 24 }, children: [
2378
+ /* @__PURE__ */ e(
2379
+ ue,
2380
+ {
2381
+ cardState: a.cardState,
2382
+ description: a.description,
2383
+ drawerFor: se.HaveManageableDebt,
2384
+ title: a.title
2385
+ }
2386
+ ),
2387
+ /* @__PURE__ */ e(
2388
+ ue,
1059
2389
  {
1060
- cardState: r.cardState,
1061
- description: r.description,
1062
- stateTitle: r.stateTitle,
1063
- title: r.title
2390
+ cardState: p.cardState,
2391
+ description: p.description,
2392
+ drawerFor: se.HaveAGoodCreditScore,
2393
+ title: p.title
1064
2394
  }
1065
2395
  )
1066
2396
  ] });
1067
- }, Ft = () => {
1068
- const [n, o] = C.useState(0), { finstrong: t } = S();
1069
- return /* @__PURE__ */ u(re, { children: [
1070
- /* @__PURE__ */ u(
1071
- nt,
2397
+ }, xr = S(fr), Sr = () => {
2398
+ const [t, r] = h.useState(0), { finstrong: n } = C();
2399
+ return /* @__PURE__ */ i(E, { children: [
2400
+ /* @__PURE__ */ i(
2401
+ Ee,
1072
2402
  {
1073
2403
  "aria-label": "Key Indicators",
1074
2404
  centered: !0,
1075
- onChange: (i, d) => o(d),
1076
- sx: { mb: 0 },
2405
+ onChange: (o, l) => r(l),
2406
+ sx: {
2407
+ mb: 0,
2408
+ "& .MuiTab-root": {
2409
+ minWidth: 0
2410
+ }
2411
+ },
1077
2412
  textColor: "primary",
1078
- value: n,
2413
+ value: t,
1079
2414
  variant: "fullWidth",
1080
2415
  children: [
1081
2416
  /* @__PURE__ */ e(
1082
- oe,
2417
+ re,
1083
2418
  {
1084
2419
  "aria-controls": "spend-details-tabpanel-0",
1085
- icon: /* @__PURE__ */ e(ue, { sx: { mr: 8 } }),
2420
+ icon: /* @__PURE__ */ e(st, { sx: { mr: 8 } }),
1086
2421
  iconPosition: "start",
1087
2422
  id: "spend-details-tab-0",
1088
- label: t.key_indicators_spend.title,
2423
+ label: n.key_indicators_spend.title,
1089
2424
  sx: { minHeight: 44 }
1090
2425
  }
1091
2426
  ),
1092
2427
  /* @__PURE__ */ e(
1093
- oe,
2428
+ re,
1094
2429
  {
1095
2430
  "aria-controls": "save-details-tabpanel-1",
1096
- icon: /* @__PURE__ */ e(Ge, { sx: { mr: 8 } }),
2431
+ icon: /* @__PURE__ */ e(qt, { sx: { mr: 8 } }),
1097
2432
  iconPosition: "start",
1098
2433
  id: "save-details-tab-1",
1099
- label: t.key_indicators_save.title,
2434
+ label: n.key_indicators_save.title,
1100
2435
  sx: { minHeight: 44 }
1101
2436
  }
1102
2437
  ),
1103
2438
  /* @__PURE__ */ e(
1104
- oe,
2439
+ re,
1105
2440
  {
1106
2441
  "aria-controls": "borrow-details-tabpanel-2",
1107
- icon: /* @__PURE__ */ e(Le, { sx: { mr: 8 } }),
2442
+ icon: /* @__PURE__ */ e(Zt, { sx: { mr: 8 } }),
1108
2443
  iconPosition: "start",
1109
2444
  id: "borrow-details-tab-2",
1110
- label: t.key_indicators_borrow.title,
2445
+ label: n.key_indicators_borrow.title,
1111
2446
  sx: { minHeight: 44 }
1112
2447
  }
1113
2448
  )
1114
2449
  ]
1115
2450
  }
1116
2451
  ),
1117
- /* @__PURE__ */ e(ne, { index: 0, name: "spend-details", value: n, children: /* @__PURE__ */ e(Tt, {}) }),
1118
- /* @__PURE__ */ e(ne, { index: 1, name: "save-details", value: n, children: /* @__PURE__ */ e(wt, {}) }),
1119
- /* @__PURE__ */ e(ne, { index: 2, name: "borrow-details", value: n, children: /* @__PURE__ */ e(Rt, {}) })
2452
+ /* @__PURE__ */ e(ae, { index: 0, name: "spend-details", value: t, children: /* @__PURE__ */ e(gr, {}) }),
2453
+ /* @__PURE__ */ e(ae, { index: 1, name: "save-details", value: t, children: /* @__PURE__ */ e(br, {}) }),
2454
+ /* @__PURE__ */ e(ae, { index: 2, name: "borrow-details", value: t, children: /* @__PURE__ */ e(xr, {}) })
1120
2455
  ] });
1121
- }, Pt = ({
1122
- additionalContent: n,
1123
- children: o,
1124
- description: t,
1125
- drawerTitle: i,
1126
- isOpen: d,
1127
- loadConnectAccountsCard: l = !0,
1128
- onClose: s,
1129
- stickyComponent: r,
1130
- title: a
1131
- }) => {
1132
- const { finstrong: c } = S(), { isCopyLoaded: p } = z();
1133
- return p ? /* @__PURE__ */ u(V, { isOpen: d, onClose: s, title: i || c.key_indicators, children: [
1134
- (a || t) && /* @__PURE__ */ u(g, { sx: { p: 24, pb: 0, gap: 8, backgroundColor: "background.paper" }, children: [
1135
- a && /* @__PURE__ */ e(H, { children: a }),
1136
- t && /* @__PURE__ */ e(y, { children: t })
2456
+ }, Cr = S(Sr), vr = ({ onClick: t }) => {
2457
+ const { finstrong: r } = C(), { isCopyLoaded: n } = X();
2458
+ return n ? /* @__PURE__ */ i(u, { sx: { alignItems: "center", gap: 12, pt: 12, pb: 32 }, children: [
2459
+ /* @__PURE__ */ e(it, { size: 48 }),
2460
+ /* @__PURE__ */ i(u, { sx: { alignItems: "center", gap: 4, textAlign: "center" }, children: [
2461
+ /* @__PURE__ */ e(Y, { children: r.missing_data_title }),
2462
+ /* @__PURE__ */ e(k, { sx: { width: { sm: 348 } }, variant: "subtitle1", children: r.missing_data_description })
1137
2463
  ] }),
1138
- r && /* @__PURE__ */ e(
1139
- x,
2464
+ /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(
2465
+ L,
1140
2466
  {
2467
+ endIcon: /* @__PURE__ */ e(Z, {}),
2468
+ onClick: t,
2469
+ size: "small",
1141
2470
  sx: {
1142
- position: "sticky",
1143
- top: 0,
1144
- zIndex: 1
2471
+ fontSize: 13,
2472
+ ":hover": {
2473
+ bgcolor: "transparent"
2474
+ }
2475
+ },
2476
+ variant: "text",
2477
+ children: r.connect_more_accounts_button
2478
+ }
2479
+ ) })
2480
+ ] }) : /* @__PURE__ */ e(te, {});
2481
+ }, wr = S(vr), kr = {
2482
+ add_more_income: "Add More Income"
2483
+ }, Dr = ({
2484
+ incomeTransactions: t,
2485
+ setCurrentStep: r,
2486
+ transaction: n
2487
+ }) => /* @__PURE__ */ i(h.Fragment, { children: [
2488
+ /* @__PURE__ */ i(u, { children: [
2489
+ !!t.length && /* @__PURE__ */ e(D, { sx: { pb: 24 }, children: t.reduce((o, l, s) => {
2490
+ if (l.guid === n.guid) return o;
2491
+ const a = Be(s, t), p = Ct(s, t);
2492
+ return o.push(
2493
+ /* @__PURE__ */ i(h.Fragment, { children: [
2494
+ a && /* @__PURE__ */ e(vt, { children: ze(l.date) }),
2495
+ /* @__PURE__ */ e(wt, { transaction: l }),
2496
+ /* @__PURE__ */ e(J, { sx: { ml: p ? 44 : 0 } })
2497
+ ] }, l.guid)
2498
+ ), o;
2499
+ }, []) }),
2500
+ /* @__PURE__ */ e(
2501
+ Un,
2502
+ {
2503
+ firstDay: 1,
2504
+ frequency: Fn.EveryMonth,
2505
+ onFirstDayChange: () => {
2506
+ },
2507
+ onFrequencyChange: () => {
2508
+ },
2509
+ onSecondDayChange: () => {
2510
+ },
2511
+ secondDay: 15,
2512
+ transaction: n
2513
+ }
2514
+ )
2515
+ ] }),
2516
+ /* @__PURE__ */ e(D, { sx: { px: 24 }, children: /* @__PURE__ */ e(
2517
+ L,
2518
+ {
2519
+ fullWidth: !0,
2520
+ onClick: () => r({ step: I.MonthlyIncome, type: "main" }),
2521
+ startIcon: /* @__PURE__ */ e(ct, {}),
2522
+ children: kr.add_more_income
2523
+ }
2524
+ ) })
2525
+ ] }), Ar = S(Dr), Mr = {
2526
+ select_date: "Select Date"
2527
+ }, Ir = ({ selectedDate: t, setSelectedDate: r }) => {
2528
+ const n = H(), o = (l) => {
2529
+ r(Math.floor(new Date(l).getTime() / 1e3));
2530
+ };
2531
+ return /* @__PURE__ */ e(D, { sx: { p: 24 }, children: /* @__PURE__ */ e(Qn, { dateAdapter: Mt, children: /* @__PURE__ */ e(
2532
+ Jn,
2533
+ {
2534
+ disableFuture: !0,
2535
+ label: Mr.select_date,
2536
+ onChange: o,
2537
+ slotProps: {
2538
+ nextIconButton: {
2539
+ sx: {
2540
+ color: "primary.main",
2541
+ "&:hover": { bgcolor: pe(n.palette.primary.light, 0.1) }
2542
+ }
2543
+ },
2544
+ previousIconButton: {
2545
+ sx: {
2546
+ color: "primary.main",
2547
+ "&:hover": { bgcolor: pe(n.palette.primary.light, 0.1) }
2548
+ }
2549
+ }
2550
+ },
2551
+ sx: {
2552
+ width: "100%",
2553
+ "& .MuiIconButton-edgeEnd": {
2554
+ color: "primary.main",
2555
+ "&:hover": { bgcolor: pe(n.palette.primary.light, 0.1) }
2556
+ }
2557
+ },
2558
+ value: t ? new Date(t * 1e3) : null
2559
+ }
2560
+ ) }) });
2561
+ }, Tr = S(Ir), Or = {
2562
+ credit_score: "Credit Score"
2563
+ }, Fr = ({ creditScore: t, setCreditScore: r }) => {
2564
+ const n = !isNaN(t);
2565
+ return /* @__PURE__ */ e(D, { sx: { p: 24 }, children: /* @__PURE__ */ e(
2566
+ we,
2567
+ {
2568
+ error: !n,
2569
+ fullWidth: !0,
2570
+ inputMode: "numeric",
2571
+ inputProps: {
2572
+ noValidate: !0,
2573
+ pattern: "[0-9]*"
2574
+ },
2575
+ label: Or.credit_score,
2576
+ onChange: (o) => r(Number(o.target.value)),
2577
+ value: n ? t : ""
2578
+ }
2579
+ ) });
2580
+ }, Pr = S(Fr), Lt = ({ value: t, completeCopy: r }) => /* @__PURE__ */ i(u, { sx: { gap: 8 }, children: [
2581
+ /* @__PURE__ */ e(u, { sx: { flexDirection: "row", gap: 4 }, children: Array.from({ length: 4 }).map((n, o) => /* @__PURE__ */ e(
2582
+ D,
2583
+ {
2584
+ sx: {
2585
+ bgcolor: o < t ? "primary.main" : "neutral.light",
2586
+ borderRadius: "24px",
2587
+ height: 4,
2588
+ width: "100%"
2589
+ }
2590
+ },
2591
+ o
2592
+ )) }),
2593
+ /* @__PURE__ */ i(T, { sx: { color: "text.secondary" }, variant: "body2", children: [
2594
+ t / 4 * 100,
2595
+ "% ",
2596
+ r
2597
+ ] })
2598
+ ] }), Rr = ({
2599
+ completeCopy: t,
2600
+ primaryText: r,
2601
+ secondaryText: n,
2602
+ value: o
2603
+ }) => /* @__PURE__ */ i(u, { sx: { gap: 20, p: 24 }, children: [
2604
+ /* @__PURE__ */ i(u, { sx: { gap: 8 }, children: [
2605
+ /* @__PURE__ */ e(Y, { children: r }),
2606
+ /* @__PURE__ */ e(k, { variant: "subtitle1", children: n })
2607
+ ] }),
2608
+ /* @__PURE__ */ e(Lt, { completeCopy: t, value: o })
2609
+ ] }), nt = {
2610
+ step: I.ConnectAccounts,
2611
+ type: "main"
2612
+ }, P = {
2613
+ add_accounts: "Add Accounts",
2614
+ add_income_primary: "What is your monthly income?",
2615
+ add_income_secondary: "Add your income so that we can accurately measure your financial strength.",
2616
+ add_more_income: "Add More Income",
2617
+ back: "Back",
2618
+ birthday_primary: "When is your birthday?",
2619
+ birthday_secondary: "Get the most helpful tips and see how you’re doing compared to others your age.",
2620
+ calculate_primary: "Calculating now ...",
2621
+ calculate_secondary: "We’re analyzing your financial data to calculate your FinStrong score. Hold tight!",
2622
+ confirm_income: "Confirm Income",
2623
+ connect_accounts: "Connect Accounts",
2624
+ connect_your_accounts_primary: "Connect Your Accounts",
2625
+ connect_your_accounts_secondary: "Connect all of your accounts to get the most accurate FinStrong score.",
2626
+ credit_score_primary: "What is your credit score?",
2627
+ credit_score_secondary: "Your ability to borrow money is a key part of your financial strength score.",
2628
+ do_it_later: "Do It Later",
2629
+ next: "Next"
2630
+ }, Br = ({ isOpen: t, onClose: r }) => {
2631
+ const { visibleAccounts: n } = fe(), { calculateHealthScore: o } = F(), { finstrong: l } = C(), { setSelectedAccounts: s } = X(), { setDateRange: a } = wn(), { filter: p, setFilter: c, transactions: d } = kn(), { user: _, userProfile: m, updateUser: g, updateUserProfile: y } = ee(), [v, b] = h.useState(_.credit_score || 0), [f, x] = h.useState(
2632
+ nt
2633
+ ), [w, O] = h.useState([]), [A, N] = h.useState(!1), [G, z] = h.useState(!1), [W, ce] = h.useState(_.birthday), [j, oe] = h.useState("");
2634
+ h.useEffect(() => {
2635
+ a({ start: Dt(Qe()), end: At(Qe()) });
2636
+ }, []), h.useEffect(() => {
2637
+ c({
2638
+ accounts: n.map((M) => M.guid),
2639
+ dateRange: {
2640
+ start: Xn(/* @__PURE__ */ new Date(), 90),
2641
+ end: /* @__PURE__ */ new Date()
2642
+ },
2643
+ custom: Je
2644
+ }), s(n);
2645
+ }, [n]);
2646
+ const le = h.useMemo(
2647
+ () => d.find((M) => M.guid === j),
2648
+ [j, d]
2649
+ ), he = h.useMemo(() => ({
2650
+ [I.ConnectAccounts]: !0,
2651
+ [I.MonthlyIncome]: !!j,
2652
+ [I.Birthday]: !!_.birthday || !!W,
2653
+ [I.CreditScore]: !!_.credit_score || !!v
2654
+ })[f.step], [v, f, W, j, _]), U = n.length > 0, Oe = h.useMemo(() => {
2655
+ const { step: M } = f;
2656
+ let $ = 0;
2657
+ return M >= I.MonthlyIncome && U && $++, M >= I.Birthday && w.length && $++, M >= I.CreditScore && (_.birthday || _.credit_score) && $++, $;
2658
+ }, [f.step, U, w.length, _.birthday, _.credit_score]), xe = (M) => {
2659
+ c({
2660
+ ...p,
2661
+ custom: ($) => M ? Zn($, M) : Je($)
2662
+ });
2663
+ }, Wt = {
2664
+ [I.ConnectAccounts]: {
2665
+ main: U ? /* @__PURE__ */ e(Pt, { shouldShowBalance: !1 }) : null,
2666
+ mainActionContent: U ? P.next : P.add_accounts,
2667
+ primaryText: P.connect_your_accounts_primary,
2668
+ secondaryText: P.connect_your_accounts_secondary
2669
+ },
2670
+ [I.MonthlyIncome]: {
2671
+ detail: /* @__PURE__ */ e(
2672
+ Ar,
2673
+ {
2674
+ incomeTransactions: w,
2675
+ setCurrentStep: (M) => {
2676
+ x(M), O(($) => {
2677
+ if ($.some((me) => me.guid === j)) return $.filter((me) => me.guid !== j);
2678
+ const je = d.find((me) => me.guid === j);
2679
+ return je ? [...$, je] : $;
2680
+ });
2681
+ },
2682
+ transaction: le
2683
+ }
2684
+ ),
2685
+ detailActionContent: P.confirm_income,
2686
+ main: /* @__PURE__ */ e(
2687
+ qn,
2688
+ {
2689
+ onSearch: xe,
2690
+ onSelected: (M) => {
2691
+ x({ step: I.MonthlyIncome, type: "detail" }), oe(M);
2692
+ }
2693
+ }
2694
+ ),
2695
+ mainActionContent: P.confirm_income,
2696
+ primaryText: P.add_income_primary,
2697
+ secondaryText: P.add_income_secondary
2698
+ },
2699
+ [I.Birthday]: {
2700
+ main: /* @__PURE__ */ e(Tr, { selectedDate: W, setSelectedDate: ce }),
2701
+ mainActionContent: P.next,
2702
+ primaryText: P.birthday_primary,
2703
+ secondaryText: P.birthday_secondary
2704
+ },
2705
+ [I.CreditScore]: {
2706
+ main: /* @__PURE__ */ e(Pr, { creditScore: v, setCreditScore: b }),
2707
+ mainActionContent: P.next,
2708
+ primaryText: P.credit_score_primary,
2709
+ secondaryText: P.credit_score_secondary
2710
+ }
2711
+ }, He = () => {
2712
+ x(nt), N(!1), oe(""), r();
2713
+ }, Ne = async () => {
2714
+ N(!0), await o(), await y({ ...m, has_completed_finstrong_onboarding: !0 }), He();
2715
+ }, Et = () => {
2716
+ if (f.step === I.CreditScore) {
2717
+ Ne();
2718
+ return;
2719
+ }
2720
+ x({ step: f.step + 1, type: "main" });
2721
+ }, Gt = () => {
2722
+ const { step: M } = f, $ = M + 1;
2723
+ switch (M) {
2724
+ case I.Birthday:
2725
+ W && W !== _.birthday && g({ ..._, birthday: W });
2726
+ break;
2727
+ case I.CreditScore:
2728
+ v && v !== _.credit_score && g({ ..._, credit_score: v }), Ne();
2729
+ return;
2730
+ case I.MonthlyIncome:
2731
+ j && w.length === 0 && O((Ke) => [...Ke, le]);
2732
+ break;
2733
+ case I.ConnectAccounts:
2734
+ if (!U) {
2735
+ z(!0);
2736
+ return;
2737
+ }
2738
+ break;
2739
+ }
2740
+ $ in I && x({ step: $, type: "main" });
2741
+ }, zt = () => {
2742
+ const { step: M, type: $ } = f;
2743
+ if ($ === "detail") {
2744
+ x({ step: M, type: "main" });
2745
+ return;
2746
+ }
2747
+ if (M === I.Birthday && w.length) {
2748
+ x({ step: M - 1, type: "detail" });
2749
+ return;
2750
+ }
2751
+ M > I.ConnectAccounts && x({ step: M - 1, type: "main" });
2752
+ }, de = Wt[f.step], Se = f.step === I.ConnectAccounts, Ht = {
2753
+ fullWidth: !0,
2754
+ ...Se && !U && { startIcon: /* @__PURE__ */ e(ct, {}) }
2755
+ }, Nt = !Se || Se && !U;
2756
+ return /* @__PURE__ */ i(h.Fragment, { children: [
2757
+ /* @__PURE__ */ i(
2758
+ ie,
2759
+ {
2760
+ footerStyles: { px: 24, py: 16 },
2761
+ hasSecondaryAction: !Se,
2762
+ isOpen: t,
2763
+ isPrimaryDisabled: !he,
2764
+ onClose: He,
2765
+ onSecondaryAction: zt,
2766
+ primaryButtonProps: Ht,
2767
+ primaryText: de?.mainActionContent,
2768
+ secondaryColor: "primary",
2769
+ secondaryText: P.back,
2770
+ title: l.title,
2771
+ ...!A && { onPrimaryAction: Gt },
2772
+ children: [
2773
+ A && /* @__PURE__ */ i(u, { sx: { alignItems: "center", gap: 24, position: "relative", px: 16, top: 126 }, children: [
2774
+ /* @__PURE__ */ e(De, { children: P.calculate_primary }),
2775
+ /* @__PURE__ */ e(k, { sx: { textAlign: "center" }, variant: "subtitle1", children: P.calculate_secondary })
2776
+ ] }),
2777
+ de && !A && /* @__PURE__ */ i(h.Fragment, { children: [
2778
+ /* @__PURE__ */ e(
2779
+ Rr,
2780
+ {
2781
+ completeCopy: l.complete,
2782
+ primaryText: de.primaryText,
2783
+ secondaryText: de.secondaryText,
2784
+ value: Oe
2785
+ }
2786
+ ),
2787
+ f.type === "main" && /* @__PURE__ */ i(D, { children: [
2788
+ de.main,
2789
+ Nt && /* @__PURE__ */ e(u, { sx: { alignItems: "center", px: 24, py: 12 }, children: /* @__PURE__ */ e(L, { fullWidth: !0, onClick: Et, children: P.do_it_later }) })
2790
+ ] }),
2791
+ f.type === "detail" && de.detail
2792
+ ] })
2793
+ ]
2794
+ }
2795
+ ),
2796
+ /* @__PURE__ */ e(
2797
+ ne,
2798
+ {
2799
+ onClose: () => z(!1),
2800
+ showConnectWidget: G,
2801
+ title: P.connect_accounts
2802
+ }
2803
+ )
2804
+ ] });
2805
+ }, $r = S(Br), Pe = {
2806
+ onboarding_title: "Financial Strength Starts Here",
2807
+ onboarding_subtitle: "By analyzing your spending and saving, FinStrong provides a score and guidance to help you improve your financial habits.",
2808
+ get_started: "Get Started"
2809
+ }, Lr = () => {
2810
+ const [t, r] = h.useState(!1);
2811
+ return /* @__PURE__ */ i(h.Fragment, { children: [
2812
+ /* @__PURE__ */ i(
2813
+ u,
2814
+ {
2815
+ sx: {
2816
+ alignItems: "center",
2817
+ gap: 48,
2818
+ pb: 24,
2819
+ pt: 72,
2820
+ px: 16
1145
2821
  },
1146
- children: r
2822
+ children: [
2823
+ /* @__PURE__ */ i(u, { sx: { alignItems: { sm: "center" }, gap: 24, width: "100%" }, children: [
2824
+ /* @__PURE__ */ e(D, { sx: { textAlign: "center" }, children: /* @__PURE__ */ e(Qt, { size: 72 }) }),
2825
+ /* @__PURE__ */ i(u, { sx: { gap: 4, textAlign: "center", width: { sm: 400 } }, children: [
2826
+ /* @__PURE__ */ e(De, { children: Pe.onboarding_title }),
2827
+ /* @__PURE__ */ e(k, { sx: { color: "text.secondary" }, variant: "subtitle1", children: Pe.onboarding_subtitle })
2828
+ ] })
2829
+ ] }),
2830
+ /* @__PURE__ */ e(L, { onClick: () => r(!0), variant: "contained", children: Pe.get_started })
2831
+ ]
1147
2832
  }
1148
2833
  ),
1149
- n && /* @__PURE__ */ e(x, { children: n }),
1150
- /* @__PURE__ */ e(ge, {}),
1151
- /* @__PURE__ */ u(g, { sx: { p: 24, gap: 24 }, children: [
1152
- o,
1153
- l && /* @__PURE__ */ e(Q, { isDashboard: !0 })
1154
- ] })
1155
- ] }) : /* @__PURE__ */ e(N, {});
1156
- }, Gt = I(Pt), pe = ({
1157
- content: n,
1158
- islast: o = !1
1159
- }) => /* @__PURE__ */ u(st, { sx: { minHeight: 0 }, children: [
1160
- /* @__PURE__ */ u(pt, { children: [
1161
- /* @__PURE__ */ e(dt, { sx: { bgcolor: "divider", borderWidth: 1, p: 3 } }),
1162
- !o && /* @__PURE__ */ e(ct, { sx: { bgcolor: "divider", width: 0.1 } })
2834
+ /* @__PURE__ */ e($r, { isOpen: t, onClose: () => r(!1) })
2835
+ ] });
2836
+ }, Wr = ({ isOpen: t, onClose: r }) => {
2837
+ const { finstrong: n } = C(), o = H(), { updateUser: l, user: s } = ee(), [a, p] = h.useState(s.birthday), c = (_) => {
2838
+ p(Math.floor(new Date(_).getTime() / 1e3));
2839
+ };
2840
+ return /* @__PURE__ */ e(
2841
+ ie,
2842
+ {
2843
+ isOpen: t,
2844
+ onClose: r,
2845
+ onPrimaryAction: () => {
2846
+ !a || a === s.birthday || (l({ ...s, birthday: a }), r());
2847
+ },
2848
+ onSecondaryAction: r,
2849
+ title: n.date_of_birth,
2850
+ children: /* @__PURE__ */ e(no, { dateAdapter: Mt, children: /* @__PURE__ */ e(
2851
+ eo,
2852
+ {
2853
+ disableFuture: !0,
2854
+ onChange: c,
2855
+ slotProps: {
2856
+ nextIconButton: {
2857
+ sx: {
2858
+ color: "primary.main",
2859
+ "&:hover": { bgcolor: pe(o.palette.primary.light, 0.1) }
2860
+ }
2861
+ },
2862
+ previousIconButton: {
2863
+ sx: {
2864
+ color: "primary.main",
2865
+ "&:hover": { bgcolor: pe(o.palette.primary.light, 0.1) }
2866
+ }
2867
+ }
2868
+ },
2869
+ slots: {
2870
+ actionBar: () => null,
2871
+ toolbar: () => null
2872
+ },
2873
+ sx: {
2874
+ width: "100%",
2875
+ "& .MuiIconButton-edgeEnd": {
2876
+ color: "primary.main",
2877
+ "&:hover": { bgcolor: pe(o.palette.primary.light, 0.1) }
2878
+ }
2879
+ },
2880
+ value: a ? new Date(a * 1e3) : /* @__PURE__ */ new Date()
2881
+ }
2882
+ ) })
2883
+ }
2884
+ );
2885
+ }, Er = S(Wr), Gr = ({ isOpen: t, onClose: r }) => {
2886
+ const { visibleFinstrongAccounts: n } = fe(), { incomeBudget: o } = ht(), {
2887
+ accounts: l,
2888
+ common: s,
2889
+ finstrong: a
2890
+ } = C(), { user: p } = ee(), [c, d] = h.useState(null), m = [
2891
+ {
2892
+ dynamicCopy: a.add_profile_item,
2893
+ fallbackLabel: a.monthly_income,
2894
+ icon: /* @__PURE__ */ e(Jt, {}),
2895
+ key: Q.MonthlyIncome,
2896
+ label: a.monthly_income,
2897
+ value: o
2898
+ },
2899
+ {
2900
+ dynamicCopy: a.add_profile_item,
2901
+ fallbackLabel: a.date_of_birth,
2902
+ icon: /* @__PURE__ */ e(en, {}),
2903
+ key: Q.DateOfBirth,
2904
+ label: a.date_of_birth,
2905
+ value: p.birthday
2906
+ },
2907
+ {
2908
+ dynamicCopy: a.add_profile_item,
2909
+ fallbackLabel: a.credit_score,
2910
+ icon: /* @__PURE__ */ e(st, {}),
2911
+ key: Q.CreditScore,
2912
+ label: a.credit_score,
2913
+ value: p.credit_score
2914
+ },
2915
+ {
2916
+ fallbackLabel: a.connect_your_accounts,
2917
+ icon: /* @__PURE__ */ e(at, {}),
2918
+ key: Q.Connections,
2919
+ label: a.connections,
2920
+ value: n.length > 0 ? V(
2921
+ a.connected_account,
2922
+ String(n.length),
2923
+ n.length > 1 ? a.accounts : a.account
2924
+ ) : void 0
2925
+ }
2926
+ ].map((g) => fn(g));
2927
+ return /* @__PURE__ */ i(ie, { isOpen: t, onClose: r, title: a.financial_profile, children: [
2928
+ /* @__PURE__ */ i(u, { sx: { gap: 20, p: 24 }, children: [
2929
+ /* @__PURE__ */ i(u, { sx: { gap: 8 }, children: [
2930
+ /* @__PURE__ */ e(Y, { children: a.your_financial_profile }),
2931
+ /* @__PURE__ */ e(k, { children: a.financial_profile_description })
2932
+ ] }),
2933
+ /* @__PURE__ */ e(
2934
+ Lt,
2935
+ {
2936
+ completeCopy: a.complete,
2937
+ value: m.reduce((g, y) => g + (y.isComplete ? 1 : 0), 0)
2938
+ }
2939
+ )
2940
+ ] }),
2941
+ /* @__PURE__ */ e(xn, { list: m, onClickItem: d }),
2942
+ /* @__PURE__ */ e(D, { sx: { p: 24 }, children: /* @__PURE__ */ e(
2943
+ Ae,
2944
+ {
2945
+ description: a.connect_more_accounts_to_view_more_accurate_financial_picture,
2946
+ drawerType: "connectDrawer",
2947
+ isDashboard: !0,
2948
+ title: a.dont_see_all_your_accounts,
2949
+ titleDrawer: s.add_accounts
2950
+ }
2951
+ ) }),
2952
+ /* @__PURE__ */ e(
2953
+ ie,
2954
+ {
2955
+ isOpen: c === Q.MonthlyIncome,
2956
+ onClose: () => d(null),
2957
+ title: s.settings,
2958
+ children: /* @__PURE__ */ e(to, {})
2959
+ }
2960
+ ),
2961
+ /* @__PURE__ */ e(Er, { isOpen: c === Q.DateOfBirth, onClose: () => d(null) }),
2962
+ /* @__PURE__ */ e(Ot, { isOpen: c === Q.CreditScore, onClose: () => d(null) }),
2963
+ /* @__PURE__ */ e(
2964
+ mt,
2965
+ {
2966
+ onClose: () => d(null),
2967
+ showConnectionsWidget: c === Q.Connections,
2968
+ title: l.manage_connections
2969
+ }
2970
+ )
2971
+ ] });
2972
+ }, zr = S(Gr), ot = ({
2973
+ content: t,
2974
+ islast: r = !1
2975
+ }) => /* @__PURE__ */ i(ao, { sx: { minHeight: 0 }, children: [
2976
+ /* @__PURE__ */ i(po, { children: [
2977
+ /* @__PURE__ */ e(lo, { sx: { bgcolor: "divider", borderWidth: 1, p: 3 } }),
2978
+ !r && /* @__PURE__ */ e(so, { sx: { bgcolor: "divider", width: 0.1 } })
1163
2979
  ] }),
1164
- /* @__PURE__ */ e(lt, { sx: { pb: 16, pl: 12, pr: 0, pt: 5 }, children: /* @__PURE__ */ e(y, { fontSize: 13, fontWeight: 400, variant: "subtitle2", children: n }) })
1165
- ] }), Lt = ({ report: n }) => {
1166
- const { finstrong: o } = S(), { score_history_drawer_timeline: t } = o, {
1167
- health_score_point_difference: i,
1168
- newer_credit_score: d,
1169
- older_credit_score: l,
1170
- older_spend_to_income_ratio: s,
1171
- newer_spend_to_income_ratio: r,
1172
- older_health_score: a,
1173
- newer_health_score: c,
1174
- newer_score_calculated_at: p
1175
- } = n, h = _e(new Date(p), "MMM d"), m = () => i === 0 ? "info.lighter" : i > 0 ? "success.lighter" : "error.lighter", _ = () => i === 0 ? b(t.stayed_at, a) : i > 0 ? t.less_spending : t.more_spending, R = () => {
1176
- if (i === 0) return null;
1177
- const T = i > 0 ? t.up_from : t.down_from, v = b(T, a, c);
1178
- return /* @__PURE__ */ u(re, { children: [
2980
+ /* @__PURE__ */ e(co, { sx: { pb: 16, pl: 12, pr: 0, pt: 5 }, children: /* @__PURE__ */ e(k, { fontSize: 13, fontWeight: 400, variant: "subtitle2", children: t }) })
2981
+ ] }), Hr = ({ report: t }) => {
2982
+ const { finstrong: r } = C(), { score_history_drawer_timeline: n } = r, {
2983
+ health_score_point_difference: o,
2984
+ newer_credit_score: l,
2985
+ older_credit_score: s,
2986
+ older_spend_to_income_ratio: a,
2987
+ newer_spend_to_income_ratio: p,
2988
+ older_health_score: c,
2989
+ newer_health_score: d,
2990
+ newer_score_calculated_at: _
2991
+ } = t, m = oo(new Date(_), "MMM d"), g = () => o === 0 ? "info.lighter" : o > 0 ? "success.lighter" : "error.lighter", y = () => o === 0 ? V(n.stayed_at, c) : o > 0 ? n.less_spending : n.more_spending, v = () => {
2992
+ if (o === 0) return null;
2993
+ const b = o > 0 ? n.up_from : n.down_from, f = V(b, c, d);
2994
+ return /* @__PURE__ */ i(E, { children: [
1179
2995
  /* @__PURE__ */ e(
1180
- he,
2996
+ on,
1181
2997
  {
1182
2998
  fill: !0,
1183
2999
  name: "circle",
1184
3000
  sx: { color: "text.secondary", fontSize: 8, mx: 4, p: 1 }
1185
3001
  }
1186
3002
  ),
1187
- v
3003
+ f
1188
3004
  ] });
1189
3005
  };
1190
- return /* @__PURE__ */ e(J, { children: /* @__PURE__ */ u(g, { sx: { backgroundColor: "background.paper" }, children: [
1191
- /* @__PURE__ */ e(x, { sx: { borderBottom: "1px solid", borderBottomColor: "divider", p: 16 }, children: /* @__PURE__ */ u(
1192
- g,
3006
+ return /* @__PURE__ */ e(K, { children: /* @__PURE__ */ i(u, { sx: { backgroundColor: "background.paper" }, children: [
3007
+ /* @__PURE__ */ e(D, { sx: { borderBottom: "1px solid", borderBottomColor: "divider", p: 16 }, children: /* @__PURE__ */ i(
3008
+ u,
1193
3009
  {
1194
3010
  flexDirection: "row",
1195
3011
  sx: { alignItems: "center", gap: 16, height: 48, width: "100%" },
1196
3012
  children: [
1197
3013
  /* @__PURE__ */ e(
1198
- g,
3014
+ u,
1199
3015
  {
1200
3016
  sx: {
1201
3017
  alignItems: "center",
1202
- backgroundColor: m(),
3018
+ backgroundColor: g(),
1203
3019
  borderRadius: 999,
1204
3020
  height: 48,
1205
3021
  justifyContent: "center",
1206
3022
  minWidth: 48
1207
3023
  },
1208
- children: /* @__PURE__ */ e(y, { sx: { fontWeight: 600 }, variant: "Body", children: i > 0 ? `+${i}` : i })
3024
+ children: /* @__PURE__ */ e(k, { sx: { fontWeight: 600 }, variant: "Body", children: o > 0 ? `+${o}` : o })
1209
3025
  }
1210
3026
  ),
1211
- /* @__PURE__ */ u(g, { sx: { gap: 2, width: "80%" }, children: [
1212
- /* @__PURE__ */ e(W, { fontWeight: 600, variant: "Body", children: _() }),
1213
- /* @__PURE__ */ u(W, { sx: { color: "text.secondary" }, variant: "subtitle2", children: [
1214
- h,
3027
+ /* @__PURE__ */ i(u, { sx: { gap: 2, width: "80%" }, children: [
3028
+ /* @__PURE__ */ e(T, { fontWeight: 600, variant: "Body", children: y() }),
3029
+ /* @__PURE__ */ i(T, { sx: { color: "text.secondary" }, variant: "subtitle2", children: [
3030
+ m,
1215
3031
  " ",
1216
- R()
3032
+ v()
1217
3033
  ] })
1218
3034
  ] })
1219
3035
  ]
1220
3036
  }
1221
3037
  ) }),
1222
- i !== 0 && /* @__PURE__ */ e(x, { sx: { color: "text.secondary", pb: 8, pl: 32, pr: 16, pt: 12 }, children: /* @__PURE__ */ u(
1223
- it,
3038
+ o !== 0 && /* @__PURE__ */ e(D, { sx: { color: "text.secondary", pb: 8, pl: 32, pr: 16, pt: 12 }, children: /* @__PURE__ */ i(
3039
+ ro,
1224
3040
  {
1225
3041
  sx: {
1226
- [`& .${at.root}:before`]: {
3042
+ [`& .${io.root}:before`]: {
1227
3043
  flex: 0,
1228
3044
  padding: 0
1229
3045
  },
@@ -1232,22 +3048,22 @@ const ut = ({ list: n, onClickItem: o }) => /* @__PURE__ */ e(x, { sx: { bgcolor
1232
3048
  },
1233
3049
  children: [
1234
3050
  /* @__PURE__ */ e(
1235
- pe,
3051
+ ot,
1236
3052
  {
1237
- content: b(
1238
- t.spend_to_income_description,
1239
- de(s),
1240
- de(r)
3053
+ content: V(
3054
+ n.spend_to_income_description,
3055
+ ve(a),
3056
+ ve(p)
1241
3057
  )
1242
3058
  }
1243
3059
  ),
1244
3060
  /* @__PURE__ */ e(
1245
- pe,
3061
+ ot,
1246
3062
  {
1247
- content: b(
1248
- t.credit_score_description,
1249
- l,
1250
- d
3063
+ content: V(
3064
+ n.credit_score_description,
3065
+ s,
3066
+ l
1251
3067
  ),
1252
3068
  islast: !0
1253
3069
  }
@@ -1256,205 +3072,277 @@ const ut = ({ list: n, onClickItem: o }) => /* @__PURE__ */ e(x, { sx: { bgcolor
1256
3072
  }
1257
3073
  ) })
1258
3074
  ] }) });
1259
- }, Et = I(Lt), Wt = ({ isOpen: n, onClose: o }) => {
1260
- const t = G(), { finstrong: i } = S(), { isCopyLoaded: d, isInitialized: l } = z(), { healthScore: s, healthScoreChangeReports: r, augmentedChartData: a } = $();
1261
- if (!d || !l) return /* @__PURE__ */ e(N, {});
1262
- const c = ie(s.health_score || 0, i), p = r.slice().reverse();
3075
+ }, Nr = S(Hr), Kr = ({ isOpen: t, onClose: r }) => {
3076
+ const n = H(), { finstrong: o } = C(), { isCopyLoaded: l, isInitialized: s } = X(), { healthScore: a, healthScoreChangeReports: p, augmentedChartData: c } = F();
3077
+ if (!l || !s) return /* @__PURE__ */ e(te, {});
3078
+ const d = $e(a.health_score || 0, o), _ = p.slice().reverse();
1263
3079
  return /* @__PURE__ */ e(
1264
- Gt,
3080
+ Ft,
1265
3081
  {
1266
- additionalContent: /* @__PURE__ */ e(g, { sx: { pl: 18, backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(
1267
- be,
3082
+ additionalContent: /* @__PURE__ */ e(u, { sx: { pl: 18, backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(
3083
+ We,
1268
3084
  {
1269
- axisColor: t.palette.divider,
3085
+ axisColor: n.palette.divider,
1270
3086
  baseline: "min",
1271
- colors: [t.palette.primary.main],
3087
+ colors: [n.palette.primary.main],
1272
3088
  curveType: "natural",
1273
- datasets: [a],
3089
+ datasets: [c],
1274
3090
  height: 160,
1275
- labels: [i.key_indicators_label],
3091
+ labels: [o.key_indicators_label],
1276
3092
  margin: { top: 12, left: 24 },
1277
3093
  showArea: !0,
1278
3094
  showAverage: !0,
1279
- title: i.peer_average,
3095
+ title: o.peer_average,
1280
3096
  useCustomMark: !0
1281
3097
  }
1282
3098
  ) }),
1283
- drawerTitle: i.score_history,
1284
- isOpen: n,
3099
+ drawerTitle: o.score_history,
3100
+ isOpen: t,
1285
3101
  loadConnectAccountsCard: !1,
1286
- onClose: o,
1287
- stickyComponent: /* @__PURE__ */ u(
1288
- g,
3102
+ onClose: r,
3103
+ stickyComponent: /* @__PURE__ */ i(
3104
+ u,
1289
3105
  {
1290
3106
  direction: "row",
1291
3107
  sx: { backgroundColor: "background.paper", gap: 16, pb: 12, pt: 8, px: 24 },
1292
3108
  children: [
1293
- /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(
1294
- ve,
3109
+ /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(
3110
+ Tt,
1295
3111
  {
1296
3112
  arcRadius: 20,
1297
- healthScore: s?.health_score,
3113
+ healthScore: a?.health_score,
1298
3114
  size: "SM"
1299
3115
  }
1300
3116
  ) }),
1301
- /* @__PURE__ */ u(x, { children: [
1302
- /* @__PURE__ */ e(y, { fontSize: 18, fontWeight: 700, sx: { mb: 4 }, variant: "subtitle1", children: c.status }),
1303
- /* @__PURE__ */ e(y, { variant: "caption", children: c.description })
3117
+ /* @__PURE__ */ i(D, { children: [
3118
+ /* @__PURE__ */ e(k, { fontSize: 18, fontWeight: 700, sx: { mb: 4 }, variant: "subtitle1", children: d.status }),
3119
+ /* @__PURE__ */ e(k, { variant: "caption", children: d.description })
1304
3120
  ] })
1305
3121
  ]
1306
3122
  }
1307
3123
  ),
1308
- children: /* @__PURE__ */ e(g, { sx: { gap: 16 }, children: p.map((h, m) => /* @__PURE__ */ e(Et, { report: h }, m)) })
3124
+ children: /* @__PURE__ */ e(u, { sx: { gap: 16 }, children: _.map((m, g) => /* @__PURE__ */ e(Nr, { report: m }, g)) })
1309
3125
  }
1310
3126
  );
1311
- }, Bt = I(Wt), Ht = ({ onClick: n }) => {
1312
- const { finstrong: o } = S(), { isCopyLoaded: t } = z();
1313
- return t ? /* @__PURE__ */ u(g, { sx: { alignItems: "center", gap: 12, pt: 12, pb: 32 }, children: [
1314
- /* @__PURE__ */ e(Ee, { size: 48 }),
1315
- /* @__PURE__ */ u(g, { sx: { alignItems: "center", gap: 4, textAlign: "center" }, children: [
1316
- /* @__PURE__ */ e(H, { children: o.missing_data_title }),
1317
- /* @__PURE__ */ e(y, { sx: { width: { sm: 348 } }, variant: "subtitle1", children: o.missing_data_description })
1318
- ] }),
1319
- /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(
1320
- q,
3127
+ }, jr = S(Kr), Vr = S(() => {
3128
+ const t = H(), [r, { width: n }] = kt(), { finstrong: o } = C(), { isCopyLoaded: l, isInitialized: s } = X(), { healthScore: a, healthScoreChange: p } = F(), c = t.palette.mode === "dark", d = $e(a?.health_score, o);
3129
+ return !l || !s ? /* @__PURE__ */ e(te, {}) : /* @__PURE__ */ i(K, { ref: r, sx: { p: 16 }, children: [
3130
+ /* @__PURE__ */ e(
3131
+ mo,
1321
3132
  {
1322
- endIcon: /* @__PURE__ */ e(j, {}),
1323
- onClick: n,
1324
- size: "small",
3133
+ action: /* @__PURE__ */ e(
3134
+ L,
3135
+ {
3136
+ endIcon: /* @__PURE__ */ e(Z, {}),
3137
+ sx: {
3138
+ fontSize: 13,
3139
+ lineHeight: "16px",
3140
+ fontWeight: 600,
3141
+ color: "primary.main"
3142
+ },
3143
+ variant: "text",
3144
+ children: o.financial_strength_header_action
3145
+ }
3146
+ ),
3147
+ subheader: /* @__PURE__ */ e(Y, { color: "text.primary", children: o.financial_strength_header }),
1325
3148
  sx: {
1326
- fontSize: 13,
1327
- ":hover": {
1328
- bgcolor: "transparent"
3149
+ p: 0,
3150
+ "& .MuiCardHeader-content": {
3151
+ overflow: "hidden"
3152
+ }
3153
+ }
3154
+ }
3155
+ ),
3156
+ /* @__PURE__ */ e(u, { sx: { justifyContent: "center", alignItems: "center" }, children: /* @__PURE__ */ e(
3157
+ Tt,
3158
+ {
3159
+ arcRadius: n <= 323 ? 73 : 154,
3160
+ footerCenterContent: p,
3161
+ healthScore: a?.health_score || 0,
3162
+ size: n <= 323 ? "M" : "L"
3163
+ }
3164
+ ) }),
3165
+ a?.health_score ? /* @__PURE__ */ i(
3166
+ uo,
3167
+ {
3168
+ sx: {
3169
+ px: 16,
3170
+ backgroundColor: c ? "grey.800" : "grey.50",
3171
+ //TODO: Need to change the background color to palette (supporting both darkmode and lightmode)
3172
+ "&.Mui-expanded": {
3173
+ m: 0
3174
+ },
3175
+ "&::before": {
3176
+ display: "none"
1329
3177
  }
1330
3178
  },
1331
- variant: "text",
1332
- children: o.connect_more_accounts_button
3179
+ children: [
3180
+ /* @__PURE__ */ e(
3181
+ ho,
3182
+ {
3183
+ expandIcon: /* @__PURE__ */ e(tn, { size: 20 }),
3184
+ sx: {
3185
+ height: 52,
3186
+ p: 0,
3187
+ "&.Mui-expanded": {
3188
+ minHeight: 0
3189
+ }
3190
+ },
3191
+ children: /* @__PURE__ */ e(k, { sx: { fontWeight: 600 }, variant: "body1", children: o.accordion_title_text })
3192
+ }
3193
+ ),
3194
+ /* @__PURE__ */ e(_o, { sx: { "&.MuiAccordionDetails-root": { padding: 0, pb: 16 } }, children: /* @__PURE__ */ e(k, { variant: "subtitle1", children: d.scoreContent }) })
3195
+ ]
1333
3196
  }
1334
- ) })
1335
- ] }) : /* @__PURE__ */ e(N, {});
1336
- }, zt = I(Ht), $t = ({ onBackClick: n, sx: o }) => {
1337
- const t = G(), { visibleAccounts: i } = fe(), { dateRange: d, isDataLoaded: l, loadBudgetData: s, setTheme: r } = ye(), { reloadCategoryTotals: a } = Ke(), { augmentedChartData: c, calculateHealthScore: p, healthScore: h, loadAugmentedChartData: m } = $(), { finstrong: _, connect: R } = S(), { isCopyLoaded: T, isInitialized: v, selectedAccounts: L, setSelectedAccounts: E } = z(), { isMobile: K } = Ce(), [F, w] = C.useState(!1);
1338
- C.useEffect(() => {
1339
- r(t);
1340
- }, []), C.useEffect(() => E(i), [i]), C.useEffect(() => {
1341
- v && (p().finally(), m().finally());
1342
- }, [v]), C.useEffect(() => {
1343
- v && (a(L, d.start, d.end), l || s());
1344
- }, [d, l, v, L]);
1345
- const [O, k] = C.useState(!1), [P, U] = C.useState(!1);
1346
- if (!T || !v) return /* @__PURE__ */ e(N, {});
1347
- const Z = () => {
1348
- }, ee = () => k(!0);
1349
- return /* @__PURE__ */ u(
1350
- mt,
3197
+ ) : /* @__PURE__ */ e(
3198
+ Ae,
3199
+ {
3200
+ buttonText: o.connect_more_accounts_title,
3201
+ description: o.health_score_zero_description,
3202
+ drawerType: "connectDrawer",
3203
+ hasIcon: !1,
3204
+ isDashboard: !0,
3205
+ sx: {
3206
+ backgroundColor: c ? "grey.800" : "grey.50",
3207
+ //TODO: Need to change the background color to palette (supporting both darkmode and lightmode)
3208
+ ".connect-more-accounts-title": {
3209
+ fontWeight: 600,
3210
+ lineHeight: "20px",
3211
+ color: "text.primary"
3212
+ },
3213
+ ".connect-more-accounts-description": { color: "text.primary" }
3214
+ },
3215
+ title: o.health_score_zero_title
3216
+ }
3217
+ )
3218
+ ] });
3219
+ }), Yr = ({ onBackClick: t, sx: r }) => {
3220
+ const { visibleAccounts: n } = fe(), { dateRange: o, isDataLoaded: l, loadBudgetData: s, setTheme: a } = ht(), { reloadCategoryTotals: p } = Le(), {
3221
+ augmentedChartData: c,
3222
+ calculateHealthScore: d,
3223
+ healthScore: _,
3224
+ loadAugmentedChartData: m,
3225
+ loadMonthlySummaries: g
3226
+ } = F(), { finstrong: y, connect: v } = C(), { isCopyLoaded: b, isInitialized: f, selectedAccounts: x, setSelectedAccounts: w } = X(), { isMobile: O } = Ge(), A = H(), { userProfile: N } = ee(), [G, z] = h.useState(!1), [W, ce] = h.useState(!1), [j, oe] = h.useState(!1);
3227
+ if (h.useEffect(() => {
3228
+ a(A);
3229
+ }, []), h.useEffect(() => w(n), [n]), h.useEffect(() => {
3230
+ f && (d().finally(), m().finally(), g().finally());
3231
+ }, [f]), h.useEffect(() => {
3232
+ f && (p(x, o.start, o.end), l || s());
3233
+ }, [o, l, f, x]), !b || !f) return /* @__PURE__ */ e(te, {});
3234
+ const le = () => {
3235
+ }, he = () => z(!0);
3236
+ return /* @__PURE__ */ i(
3237
+ En,
1351
3238
  {
1352
- accountOptions: i,
3239
+ accountOptions: n,
1353
3240
  actions: [
1354
3241
  {
1355
3242
  iconName: "person",
1356
- label: _.profile,
1357
- onClick: ee
3243
+ label: y.profile,
3244
+ onClick: he
1358
3245
  }
1359
3246
  ],
1360
3247
  hasDivider: !0,
1361
- onAccountsFilterClick: Z,
1362
- onBackClick: n,
1363
- sx: o,
1364
- title: _.title,
3248
+ onAccountsFilterClick: le,
3249
+ onBackClick: t,
3250
+ sx: r,
3251
+ title: y.title,
1365
3252
  children: [
1366
- /* @__PURE__ */ u(
1367
- g,
3253
+ N.has_completed_finstrong_onboarding ? /* @__PURE__ */ i(
3254
+ u,
1368
3255
  {
1369
3256
  sx: {
1370
3257
  flexDirection: { md: "row" },
1371
3258
  gap: 24,
1372
3259
  justifyContent: "center",
1373
- pt: K ? 24 : 16,
3260
+ pt: O ? 24 : 16,
1374
3261
  px: 24
1375
3262
  },
1376
3263
  children: [
1377
- /* @__PURE__ */ u(g, { sx: { gap: 24, width: { md: 432 } }, children: [
1378
- /* @__PURE__ */ e(St, {}),
3264
+ /* @__PURE__ */ i(u, { sx: { gap: 24, width: { md: 432 } }, children: [
3265
+ /* @__PURE__ */ e(Vr, {}),
1379
3266
  /* @__PURE__ */ e(
1380
- Q,
3267
+ Ae,
1381
3268
  {
1382
- description: _.connect_more_accounts_description,
1383
- title: _.connect_more_accounts_title
3269
+ description: y.connect_more_accounts_description,
3270
+ drawerType: "connectDrawer",
3271
+ title: y.connect_more_accounts_title
1384
3272
  }
1385
3273
  )
1386
3274
  ] }),
1387
- /* @__PURE__ */ e(g, { sx: { maxWidth: 848, minWidth: 288, width: { md: 720 } }, children: /* @__PURE__ */ u(J, { sx: { background: t.palette.background.paper, p: 16 }, children: [
1388
- /* @__PURE__ */ u(g, { direction: "row", sx: { alignItems: "center", justifyContent: "space-between" }, children: [
1389
- /* @__PURE__ */ e(H, { children: _.key_indicators }),
3275
+ /* @__PURE__ */ e(u, { sx: { maxWidth: 848, minWidth: 288, width: { md: 720 } }, children: /* @__PURE__ */ i(K, { sx: { background: A.palette.background.paper, p: 16 }, children: [
3276
+ /* @__PURE__ */ i(u, { direction: "row", sx: { alignItems: "center", justifyContent: "space-between" }, children: [
3277
+ /* @__PURE__ */ e(Y, { children: y.key_indicators }),
1390
3278
  /* @__PURE__ */ e(
1391
- q,
3279
+ L,
1392
3280
  {
1393
- endIcon: /* @__PURE__ */ e(j, {}),
1394
- onClick: () => U(!0),
3281
+ endIcon: /* @__PURE__ */ e(Z, {}),
3282
+ onClick: () => ce(!0),
1395
3283
  sx: {
1396
3284
  fontSize: 13
1397
3285
  },
1398
3286
  variant: "text",
1399
- children: _.whats_changed
3287
+ children: y.whats_changed
1400
3288
  }
1401
3289
  )
1402
3290
  ] }),
1403
3291
  c.length ? /* @__PURE__ */ e(
1404
- be,
3292
+ We,
1405
3293
  {
1406
- axisColor: t.palette.divider,
3294
+ axisColor: A.palette.divider,
1407
3295
  baseline: "min",
1408
- colors: [t.palette.primary.main],
3296
+ colors: [A.palette.primary.main],
1409
3297
  curveType: "natural",
1410
3298
  customLegendVariant: "XSmall",
1411
3299
  datasets: [c],
1412
3300
  height: 300,
1413
3301
  isGraphClippingXAxis: !0,
1414
- labelBackgroundColor: t.palette.border.dark,
1415
- labelFontColor: t.palette.common.white,
1416
- labelFontSize: typeof t.typography.XSmall?.fontSize == "string" ? parseFloat(t.typography.XSmall.fontSize) : t.typography.XSmall?.fontSize,
1417
- labels: [_.key_indicators_label],
3302
+ labelBackgroundColor: A.palette.border.dark,
3303
+ labelFontColor: A.palette.common.white,
3304
+ labelFontSize: typeof A.typography.XSmall?.fontSize == "string" ? parseFloat(A.typography.XSmall.fontSize) : A.typography.XSmall?.fontSize,
3305
+ labels: [y.key_indicators_label],
1418
3306
  margin: { right: 20, left: 25 },
1419
3307
  showArea: !0,
1420
3308
  showAverage: !0,
1421
3309
  showLegend: !0,
1422
3310
  showMarkLabel: !0,
1423
3311
  showXAxis: !0,
1424
- title: _.peer_average,
3312
+ title: y.peer_average,
1425
3313
  useCustomMark: !0
1426
3314
  }
1427
- ) : /* @__PURE__ */ e(zt, { onClick: () => w(!0) }),
1428
- h.health_score !== null && /* @__PURE__ */ e(Ft, {})
3315
+ ) : /* @__PURE__ */ e(wr, { onClick: () => oe(!0) }),
3316
+ _.health_score !== null && /* @__PURE__ */ e(Cr, {})
1429
3317
  ] }) })
1430
3318
  ]
1431
3319
  }
1432
- ),
1433
- /* @__PURE__ */ e(Mt, { isOpen: O, onClose: () => k(!1) }),
3320
+ ) : /* @__PURE__ */ e(Lr, {}),
3321
+ /* @__PURE__ */ e(zr, { isOpen: G, onClose: () => z(!1) }),
1434
3322
  /* @__PURE__ */ e(
1435
- xe,
3323
+ ne,
1436
3324
  {
1437
- onClose: () => w(!1),
1438
- showConnectWidget: F,
1439
- title: R.mini_title
3325
+ onClose: () => oe(!1),
3326
+ showConnectWidget: j,
3327
+ title: v.mini_title
1440
3328
  }
1441
3329
  ),
1442
3330
  /* @__PURE__ */ e(
1443
- Bt,
3331
+ jr,
1444
3332
  {
1445
- isOpen: P,
1446
- onClose: () => U(!1)
3333
+ isOpen: W,
3334
+ onClose: () => ce(!1)
1447
3335
  }
1448
3336
  )
1449
3337
  ]
1450
3338
  }
1451
3339
  );
1452
- }, Ho = I($t);
3340
+ }, di = S(Yr);
1453
3341
  export {
1454
- Bo as CreditScoreGraph,
1455
- Se as DialScoreCard,
1456
- ve as FinancialStrengthGraph,
1457
- No as FinstrongApi,
1458
- Ko as FinstrongStore,
1459
- Ho as FinstrongWidget
3342
+ yo as CreditScoreGraph,
3343
+ It as DialScoreCard,
3344
+ Tt as FinancialStrengthGraph,
3345
+ _i as FinstrongApi,
3346
+ hi as FinstrongStore,
3347
+ di as FinstrongWidget
1460
3348
  };