@mx-cartographer/experiences 8.0.0-alpha.bb3 → 8.0.0-alpha.mega1

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 (203) hide show
  1. package/CHANGELOG.md +178 -1
  2. package/dist/{Account-Bxw0_4FU.mjs → Account-CvR2-dSR.mjs} +1 -1
  3. package/dist/{AccountDetailsContent-CAM9y39M.mjs → AccountDetailsContent-CitErkuS.mjs} +89 -82
  4. package/dist/AccountDetailsHeader-BkG3MNYo.mjs +87 -0
  5. package/dist/{AccountFields-C9FlatNb.mjs → AccountFields-zCMqet85.mjs} +6 -6
  6. package/dist/{AccountListItem-JFMZROh7.mjs → AccountListItem-DHrz8Mml.mjs} +9 -9
  7. package/dist/{AccountStore-BgNOyMdp.mjs → AccountStore-LgfBcYMe.mjs} +112 -75
  8. package/dist/Accounts-Bzy1_REQ.mjs +9 -0
  9. package/dist/{BeatApi-DhJpgCLz.mjs → BeatApi-De2IaqH2.mjs} +1 -1
  10. package/dist/{BeatStore-IBnXd4YK.mjs → BeatStore-D_NYuBSz.mjs} +1 -1
  11. package/dist/{BudgetUtil-B2ZXyw-g.mjs → BudgetUtil-BmZXkL0C.mjs} +2 -2
  12. package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-B-I3kajA.mjs} +23 -21
  13. package/dist/CategoryStore-CA3tS1BO.mjs +186 -0
  14. package/dist/CategoryUtil-DUM8NuGO.mjs +78 -0
  15. package/dist/{ConnectDrawer-BQNs-hjk.mjs → ConnectDrawer-BkvlItWx.mjs} +11 -11
  16. package/dist/{ConnectionsDrawer-ByGQE7D5.mjs → ConnectionsDrawer-VmuVFHbL.mjs} +5 -5
  17. package/dist/{CurrencyInput-DUsQbkXb.mjs → CurrencyInput-itK0R3wV.mjs} +2 -2
  18. package/dist/{CurrencyText-kyC1aseI.mjs → CurrencyText-Dr0EZ7bp.mjs} +1 -1
  19. package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CBdcsyuk.mjs} +3 -3
  20. package/dist/{DebtsStore-C9bblOgW.mjs → DebtsStore-Bq-aPy-5.mjs} +1 -1
  21. package/dist/{Dialog-CWW597AF.mjs → Dialog-BPTr3qHE.mjs} +2 -2
  22. package/dist/{Donut-oaQFlbit.mjs → Donut-Dmy3JTWd.mjs} +12 -12
  23. package/dist/Drawer-By9V-B5L.mjs +178 -0
  24. package/dist/{EmptyState-DA_lfRBv.mjs → EmptyState-DoxNUae-.mjs} +24 -22
  25. package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-Cglo8Mca.mjs} +3 -3
  26. package/dist/{Fetch-87LIQbEA.mjs → Fetch-DecPFeGU.mjs} +24 -22
  27. package/dist/FinstrongStore-BIrX0Xg2.mjs +451 -0
  28. package/dist/{GoalStore-D-aB35SY.mjs → GoalStore-1P19goZ7.mjs} +112 -152
  29. package/dist/{Help-B6dIcujh.mjs → Help-Ea3BlXQp.mjs} +2 -2
  30. package/dist/LineChart-KpPw1phO.mjs +580 -0
  31. package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-BxTkF6Tz.mjs} +10 -10
  32. package/dist/{ManageIncome-1s_q5W4X.mjs → ManageIncome-CaoQl609.mjs} +91 -88
  33. package/dist/{MerchantStore-DrFvsUyy.mjs → MerchantStore-WvZ4gnQe.mjs} +1 -1
  34. package/dist/MicroWidgetContainer-r6mtxRer.mjs +52 -0
  35. package/dist/MiniWidgetContainer-Bg02sF1Y.mjs +71 -0
  36. package/dist/{NetWorthStore-DCsTZpuS.mjs → NetWorthStore-rC0q7P7t.mjs} +2 -2
  37. package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-uzM8tCoH.mjs} +236 -231
  38. package/dist/{NotificationStore-BxP_P2dA.mjs → NotificationStore-CDX_kqHa.mjs} +7 -15
  39. package/dist/{NumberFormatting-Buh7u8Oi.mjs → NumberFormatting-DjTD0t3W.mjs} +9 -9
  40. package/dist/{OriginalBalanceAction-CWuVvRq9.mjs → OriginalBalanceAction-C6jdS4ws.mjs} +4 -4
  41. package/dist/{RecurringSettings-A_rAGCTP.mjs → RecurringSettings-B4ybrS0B.mjs} +4 -4
  42. package/dist/{RecurringTransactions-DK8dWldr.mjs → RecurringTransactions-BqijW_8S.mjs} +49 -48
  43. package/dist/{RecurringTransactionsStore-C4YOD7_D.mjs → RecurringTransactionsStore-BhBUVm9a.mjs} +26 -29
  44. package/dist/{SettingsStore-BcgS_Ohv.mjs → SettingsStore-krIRNwHK.mjs} +3 -3
  45. package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-DQ1b9uqq.mjs} +11 -13
  46. package/dist/SpendingLegend-CDO060GT.mjs +193 -0
  47. package/dist/{ToggleListItem-r0Kx56wF.mjs → ToggleListItem-ciFTiqRS.mjs} +19 -14
  48. package/dist/TransactionApi-CjBoLleL.mjs +86 -0
  49. package/dist/TransactionDetails-m5PddMQn.mjs +1380 -0
  50. package/dist/TransactionStore-PRlwE-TF.mjs +677 -0
  51. package/dist/TrendsStore-yO7qYv97.mjs +186 -0
  52. package/dist/{User-BQUxBeZV.mjs → User-Cnlegl1N.mjs} +2 -2
  53. package/dist/{ViewMoreMicroCard-SCn2wt4i.mjs → ViewMoreMicroCard-DwR0v_ll.mjs} +711 -728
  54. package/dist/{WidgetContainer-BHWANqT4.mjs → WidgetContainer-CoFDmQRE.mjs} +4 -4
  55. package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
  56. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +4 -1
  57. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +2 -1
  58. package/dist/accounts/index.es.js +245 -235
  59. package/dist/accounts/stores/AccountStore.d.ts +24 -25
  60. package/dist/accounts/utils/Accounts.d.ts +1 -2
  61. package/dist/analytics/index.es.js +2 -2
  62. package/dist/budgets/components/AddBudgets.d.ts +2 -1
  63. package/dist/budgets/index.es.js +611 -580
  64. package/dist/budgets/store/BudgetsStore.d.ts +0 -1
  65. package/dist/cashflow/index.es.js +187 -180
  66. package/dist/categories/index.es.js +2 -2
  67. package/dist/categories/stores/CategoryStore.d.ts +2 -5
  68. package/dist/categories/util/CategoryUtil.d.ts +2 -3
  69. package/dist/common/components/Select.d.ts +4 -2
  70. package/dist/common/components/charts/LineChart.d.ts +12 -2
  71. package/dist/common/components/charts/index.d.ts +0 -3
  72. package/dist/common/components/charts/linechart/CustomLegend.d.ts +3 -1
  73. package/dist/common/components/charts/linechart/CustomMark.d.ts +4 -0
  74. package/dist/common/components/charts/linechart/CustomTooltip.d.ts +6 -1
  75. package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
  76. package/dist/common/components/drawer/Drawer.d.ts +3 -0
  77. package/dist/common/components/drawer/Footer.d.ts +17 -0
  78. package/dist/common/hooks/index.d.ts +1 -0
  79. package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
  80. package/dist/common/index.es.js +397 -387
  81. package/dist/common/stores/AppDataStore.d.ts +1 -3
  82. package/dist/common/stores/GlobalCopyStore.d.ts +1 -0
  83. package/dist/common/stores/GlobalStore.d.ts +10 -4
  84. package/dist/common/stores/GlobalUiStore.d.ts +2 -3
  85. package/dist/common/stores/UserStore.d.ts +2 -3
  86. package/dist/common/types/Account.d.ts +6 -9
  87. package/dist/common/types/Finstrong.d.ts +54 -0
  88. package/dist/common/types/Global.d.ts +1 -0
  89. package/dist/common/types/Widgets.d.ts +1 -0
  90. package/dist/common/types/index.d.ts +1 -1
  91. package/dist/common/types/localization/FinstrongCopy.d.ts +105 -2
  92. package/dist/common/types/localization/GoalsCopy.d.ts +1 -0
  93. package/dist/common/types/localization/TransactionsCopy.d.ts +1 -0
  94. package/dist/dashboard/index.es.js +90 -88
  95. package/dist/debts/index.es.js +458 -448
  96. package/dist/exportTransactionsToCSV-DuAaI5XA.mjs +48 -0
  97. package/dist/finstrong/FinstrongWidget.d.ts +1 -1
  98. package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
  99. package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
  100. package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
  101. package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
  102. package/dist/finstrong/components/FinancialStrengthGraph.d.ts +7 -1
  103. package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
  104. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
  105. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
  106. package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
  107. package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
  108. package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
  109. package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
  110. package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
  111. package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
  112. package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
  113. package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
  114. package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
  115. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
  116. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
  117. package/dist/finstrong/components/ProgressBar.d.ts +15 -0
  118. package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
  119. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
  120. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
  121. package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
  122. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
  123. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
  124. package/dist/finstrong/components/StatusChip.d.ts +5 -0
  125. package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
  126. package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +17 -0
  127. package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
  128. package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
  129. package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
  130. package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
  131. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
  132. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
  133. package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
  134. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +24 -0
  135. package/dist/finstrong/components/shared/DialScoreCard.d.ts +7 -1
  136. package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
  137. package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
  138. package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
  139. package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
  140. package/dist/finstrong/constants/index.d.ts +9 -0
  141. package/dist/finstrong/index.es.js +3190 -1073
  142. package/dist/finstrong/stores/FinstrongStore.d.ts +25 -2
  143. package/dist/finstrong/util/finstrongUtils.d.ts +58 -1
  144. package/dist/goals/index.es.js +302 -291
  145. package/dist/goals/stores/GoalStore.d.ts +4 -17
  146. package/dist/help/index.es.js +13 -9
  147. package/dist/{hooks-D6XlXHf4.mjs → hooks-ZMp65DFz.mjs} +12 -12
  148. package/dist/insights/index.es.js +1 -1
  149. package/dist/investments/index.es.js +108 -104
  150. package/dist/investments/stores/HoldingStore.d.ts +0 -1
  151. package/dist/merchants/index.es.js +2 -2
  152. package/dist/microinsights/MicroCardTemplate.d.ts +16 -0
  153. package/dist/microinsights/beaticons/BeatIcon.d.ts +2 -9
  154. package/dist/microinsights/beaticons/BeatMerchantLogo.d.ts +3 -2
  155. package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +2 -1
  156. package/dist/microinsights/cards/{MicroInsightCard.d.ts → BaseCard.d.ts} +1 -8
  157. package/dist/microinsights/cards/{BeatCard.d.ts → InsightCard.d.ts} +2 -2
  158. package/dist/microinsights/cards/NoRelevantInsightsCard.d.ts +2 -5
  159. package/dist/microinsights/cards/ZeroStateCard.d.ts +2 -5
  160. package/dist/microinsights/carousel/BeatList.d.ts +10 -0
  161. package/dist/microinsights/carousel/CarouselControls.d.ts +1 -3
  162. package/dist/microinsights/carousel/CarouselHeader.d.ts +1 -2
  163. package/dist/microinsights/constants/App.d.ts +0 -1
  164. package/dist/microinsights/index.d.ts +4 -3
  165. package/dist/microinsights/index.es.js +101 -14
  166. package/dist/microinsights/interfaces.d.ts +0 -6
  167. package/dist/networth/index.es.js +197 -190
  168. package/dist/notifications/index.es.js +25 -25
  169. package/dist/notifications/stores/NotificationStore.d.ts +1 -3
  170. package/dist/recurringtransactions/index.es.js +395 -351
  171. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +2 -3
  172. package/dist/settings/index.es.js +307 -298
  173. package/dist/spending/index.es.js +299 -438
  174. package/dist/spending/utils/SpendingData.d.ts +2 -1
  175. package/dist/transactions/components/shared/TransactionDetails.d.ts +1 -0
  176. package/dist/transactions/components/shared/TransactionList.d.ts +1 -0
  177. package/dist/transactions/index.es.js +115 -112
  178. package/dist/transactions/stores/TransactionStore.d.ts +77 -21
  179. package/dist/trends/components/TrendsTable.d.ts +0 -2
  180. package/dist/trends/index.es.js +1025 -604
  181. package/dist/trends/utils/TrendsData.d.ts +1 -0
  182. package/dist/{useAccountDisplayName-BUAApBIb.mjs → useAccountDisplayName-B7iXTNM8.mjs} +2 -2
  183. package/dist/{useCombineEvents-BUDIR1ba.mjs → useCombineEvents-CRwX-qWE.mjs} +1 -1
  184. package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-B7dxpDrX.mjs} +1 -1
  185. package/dist/useWidgetLoadTimer-hIOioiKx.mjs +19 -0
  186. package/package.json +4 -4
  187. package/dist/AccountDetailsHeader-JtSX6Uf9.mjs +0 -120
  188. package/dist/Accounts-BRf_YeTf.mjs +0 -27
  189. package/dist/CategoryStore-yHI0hWmK.mjs +0 -174
  190. package/dist/CategoryUtil-pZRIYOgN.mjs +0 -80
  191. package/dist/Drawer-kEE73B87.mjs +0 -113
  192. package/dist/FinstrongStore-F2c607dj.mjs +0 -101
  193. package/dist/LineChart-D4GI7nVh.mjs +0 -541
  194. package/dist/MicroWidgetContainer-DpeqN9n3.mjs +0 -45
  195. package/dist/MiniWidgetContainer-D0gfmbaF.mjs +0 -56
  196. package/dist/TransactionApi-B3Tksf7L.mjs +0 -86
  197. package/dist/TransactionDetails-oP1eSuiS.mjs +0 -1334
  198. package/dist/TransactionStore-ai3uII_r.mjs +0 -690
  199. package/dist/TrendsStore-DCYbpXPO.mjs +0 -559
  200. package/dist/common/components/SkeletonLoader.d.ts +0 -7
  201. package/dist/exportTransactionsToCSV-7bVS7KXf.mjs +0 -47
  202. package/dist/finstrong/utils/Finstrong.d.ts +0 -6
  203. package/dist/useAriaLive-B3_pRUio.mjs +0 -35
@@ -1,37 +1,37 @@
1
- import { jsx as e, jsxs as s, Fragment as $ } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as s, Fragment as H } from "react/jsx-runtime";
2
2
  import x from "react";
3
3
  import { observer as D } from "mobx-react-lite";
4
- import g from "@mui/material/Stack";
5
- import { useTheme as X, Card as be, Stack as y, Box as G } from "@mui/material";
4
+ import w from "@mui/material/Stack";
5
+ import { useTheme as X, Card as be, Stack as _, Box as G } from "@mui/material";
6
6
  import { Text as l, H3 as ve, InstitutionLogo as De, Icon as ee } from "@mxenabled/mxui";
7
7
  import { intervalToDuration as Te, formatDuration as Ae } from "date-fns";
8
8
  import { addMonths as le } from "date-fns/addMonths";
9
9
  import { fromUnixTime as se } from "date-fns/fromUnixTime";
10
10
  import { getUnixTime as ce } from "date-fns/getUnixTime";
11
- import { D as B, M as Ee, I as Ie } from "../DebtsStore-C9bblOgW.mjs";
12
- import { a as Fr } from "../DebtsStore-C9bblOgW.mjs";
13
- import { f as M, a as Be } from "../NumberFormatting-Buh7u8Oi.mjs";
14
- import { f as K, D as U } from "../Dialog-CWW597AF.mjs";
15
- import { G as Me, y as q, u as C, l as V, g as k, d as Z, b as Pe } from "../hooks-D6XlXHf4.mjs";
11
+ import { D as P, M as Ee, I as Ie } from "../DebtsStore-Bq-aPy-5.mjs";
12
+ import { a as Lr } from "../DebtsStore-Bq-aPy-5.mjs";
13
+ import { f as k, a as Be } from "../NumberFormatting-DjTD0t3W.mjs";
14
+ import { f as K, a as U } from "../Dialog-BPTr3qHE.mjs";
15
+ import { G as Me, w as q, u as S, l as V, g as F, d as Z, b as Pe } from "../hooks-ZMp65DFz.mjs";
16
16
  import { u as Y } from "../useScreenSize-B6JyS_Lj.mjs";
17
- import { D as te } from "../Drawer-kEE73B87.mjs";
18
- import { b as A } from "../Localization-2MODESHW.mjs";
19
- import { A as ke, u as Ne } from "../AccountDetailsHeader-JtSX6Uf9.mjs";
17
+ import { D as te } from "../Drawer-By9V-B5L.mjs";
18
+ import { b as E } from "../Localization-2MODESHW.mjs";
19
+ import { A as ke, u as Ne } from "../AccountDetailsHeader-BkG3MNYo.mjs";
20
20
  import Fe from "@mui/material/Card";
21
21
  import Re from "@mui/material/CardContent";
22
22
  import Le from "@mui/material/CardHeader";
23
- import { LineChart as $e } from "@mui/x-charts";
24
23
  import re from "@mui/material/Box";
25
- import { useTheme as He } from "@mui/material/styles";
26
- import { A as T, W as Oe } from "../WidgetContainer-BHWANqT4.mjs";
24
+ import { useTheme as $e } from "@mui/material/styles";
25
+ import { LineChart as He } from "@mui/x-charts/LineChart";
26
+ import { A as T, W as Oe } from "../WidgetContainer-CoFDmQRE.mjs";
27
27
  import de from "@mui/material/Tab";
28
28
  import We from "@mui/material/Tabs";
29
29
  import _e from "@mui/material/List";
30
30
  import j from "@mui/material/Divider";
31
- import { M as Ge, I as je, O as ze } from "../OriginalBalanceAction-CWuVvRq9.mjs";
31
+ import { M as Ge, I as je, O as ze } from "../OriginalBalanceAction-C6jdS4ws.mjs";
32
32
  import Xe from "@mui/material/TextField";
33
- import { L as J } from "../ListItemAction-DHa3KJPs.mjs";
34
- import { C as ae } from "../CurrencyInput-DUsQbkXb.mjs";
33
+ import { L as J } from "../ListItemAction-BxTkF6Tz.mjs";
34
+ import { C as ae } from "../CurrencyInput-itK0R3wV.mjs";
35
35
  import pe from "@mui/material/Alert";
36
36
  import me from "@mui/material/AlertTitle";
37
37
  import he from "@mui/material/Paper";
@@ -39,33 +39,34 @@ import { Error as Ve, CheckCircle as ye } from "@mxenabled/mx-icons";
39
39
  import { T as ue } from "../TabContentContainer-j01JYR_7.mjs";
40
40
  import { DataGridPro as Ye } from "@mui/x-data-grid-pro";
41
41
  import { H as z } from "../HeaderCell-DjuifqHJ.mjs";
42
- import { i as Ke } from "../ConnectDrawer-BQNs-hjk.mjs";
42
+ import { f as Ke } from "../ConnectDrawer-BkvlItWx.mjs";
43
43
  import fe from "@mui/material/Button";
44
44
  import Ue from "@mui/material/IconButton";
45
45
  import qe from "@mui/material/ListItem";
46
46
  import Ze from "@mui/material/Popover";
47
- import { L as Je } from "../Loader-DUaFpDGv.mjs";
48
- const Qe = (a, n = 0, r = 0) => {
47
+ import { u as Je } from "../useWidgetLoadTimer-hIOioiKx.mjs";
48
+ import { L as Qe } from "../Loader-DUaFpDGv.mjs";
49
+ const et = (a, o = 0, r = 0) => {
49
50
  if (r === 0) return 0;
50
- const t = n / (Ee * Ie);
51
+ const t = o / (Ee * Ie);
51
52
  return Math.ceil(
52
53
  t === 0 ? a / r : -Math.log(1 - t * a / r) / Math.log(1 + t)
53
54
  );
54
- }, et = (a, n, r, t, o) => {
55
+ }, tt = (a, o, r, t, n) => {
55
56
  const i = [];
56
57
  if (r === 0) {
57
- for (let d = 0; d < a; d++) {
58
- const c = n - t * (d + 1), m = n - t * d, b = c >= 0 ? t : m;
58
+ for (let c = 0; c < a; c++) {
59
+ const d = o - t * (c + 1), m = o - t * c, b = d >= 0 ? t : m;
59
60
  i.push({
60
- balance: c >= 0 ? c : 0,
61
+ balance: d >= 0 ? d : 0,
61
62
  interest: r,
62
63
  payment: b,
63
64
  principal: b,
64
65
  timestamp: ce(
65
66
  le(
66
- se(o),
67
+ se(n),
67
68
  // convert seconds → Date
68
- d + 1
69
+ c + 1
69
70
  // add (index + 1) months
70
71
  )
71
72
  )
@@ -74,106 +75,106 @@ const Qe = (a, n = 0, r = 0) => {
74
75
  return i;
75
76
  }
76
77
  const p = r / 1200;
77
- for (let d = 0; d < a; d++) {
78
- const c = ce(le(se(o), d + 1)), m = Math.pow(1 + p, d), b = n * m - t * ((m - 1) / p), f = Math.pow(1 + p, d + 1), u = n * f - t * ((f - 1) / p), S = t + Math.min(u, 0), P = b * p;
78
+ for (let c = 0; c < a; c++) {
79
+ const d = ce(le(se(n), c + 1)), m = Math.pow(1 + p, c), b = o * m - t * ((m - 1) / p), f = Math.pow(1 + p, c + 1), u = o * f - t * ((f - 1) / p), v = t + Math.min(u, 0), M = b * p;
79
80
  i.push({
80
81
  balance: Math.max(0, u),
81
- interest: P,
82
- payment: S,
83
- principal: S - P,
84
- timestamp: c
82
+ interest: M,
83
+ payment: v,
84
+ principal: v - M,
85
+ timestamp: d
85
86
  });
86
87
  }
87
88
  return i;
88
- }, tt = (a) => (a[a.length - 1] || {}).timestamp, rt = (a) => {
89
- const { monthly_payment: n, interest_rate: r, balance: t, payment_due_date: o } = a, i = Qe(t, r ?? 0, n ?? 0), p = et(
89
+ }, rt = (a) => (a[a.length - 1] || {}).timestamp, at = (a) => {
90
+ const { monthly_payment: o, interest_rate: r, balance: t, payment_due_date: n } = a, i = et(t, r ?? 0, o ?? 0), p = tt(
90
91
  i,
91
92
  t,
92
93
  r ?? 0,
93
- n ?? 0,
94
- o
95
- ), d = tt(p);
94
+ o ?? 0,
95
+ n
96
+ ), c = rt(p);
96
97
  return {
97
98
  ...a,
98
- minimumFinalPayment: d,
99
+ minimumFinalPayment: c,
99
100
  minimumPayments: p
100
101
  };
101
- }, xe = (a, n) => {
102
+ }, ge = (a, o) => {
102
103
  const [r, t] = a.reduce(
103
- ([o, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : o.push(rt(p)), [o, i]),
104
+ ([n, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : n.push(at(p)), [n, i]),
104
105
  [[], []]
105
106
  );
106
- switch (n) {
107
- case B.FASTEST_PAYOFF_FIRST:
108
- r.sort((o, i) => (o.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
107
+ switch (o) {
108
+ case P.FASTEST_PAYOFF_FIRST:
109
+ r.sort((n, i) => (n.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
109
110
  break;
110
- case B.HIGHEST_INTEREST:
111
- r.sort((o, i) => (i.interest_rate ?? 0) - (o.interest_rate ?? 0));
111
+ case P.HIGHEST_INTEREST:
112
+ r.sort((n, i) => (i.interest_rate ?? 0) - (n.interest_rate ?? 0));
112
113
  break;
113
- case B.LOWEST_BALANCE:
114
- r.sort((o, i) => o.balance - i.balance);
114
+ case P.LOWEST_BALANCE:
115
+ r.sort((n, i) => n.balance - i.balance);
115
116
  break;
116
- case B.HIGHEST_BALANCE:
117
- r.sort((o, i) => i.balance - o.balance);
117
+ case P.HIGHEST_BALANCE:
118
+ r.sort((n, i) => i.balance - n.balance);
118
119
  break;
119
120
  default:
120
- r.sort((o, i) => o.balance - i.balance);
121
+ r.sort((n, i) => n.balance - i.balance);
121
122
  }
122
123
  a.splice(0, a.length, ...r, ...t);
123
124
  };
124
- function at(a, n, r = 0) {
125
+ function ot(a, o, r = 0) {
125
126
  const t = a.map((b) => ({ ...b })).filter(
126
127
  (b) => b.interest_rate !== void 0 && b.monthly_payment !== void 0 && !b.is_paid_off
127
128
  );
128
- xe(t, n);
129
- let o = 0, i = 0;
130
- const p = /* @__PURE__ */ new Date(), d = /* @__PURE__ */ new Date();
129
+ ge(t, o);
130
+ let n = 0, i = 0;
131
+ const p = /* @__PURE__ */ new Date(), c = /* @__PURE__ */ new Date();
131
132
  for (; t.some((b) => b.balance >= 0.01 && !b.is_impossible); ) {
132
133
  let b = !1;
133
134
  for (const [f, u] of t.entries()) {
134
135
  if (u.balance <= 0.01 || u.is_impossible) continue;
135
- const P = (u.interest_rate ?? 0) / 100 / 12, E = u.balance * P;
136
- let _ = u.monthly_payment ?? 0;
137
- f === 0 && r && (_ += r), u.balance += E;
138
- const v = Math.min(u.balance, _ + i);
139
- if (v <= E) {
136
+ const M = (u.interest_rate ?? 0) / 100 / 12, I = u.balance * M;
137
+ let C = u.monthly_payment ?? 0;
138
+ f === 0 && r && (C += r), u.balance += I;
139
+ const B = Math.min(u.balance, C + i);
140
+ if (B <= I) {
140
141
  u.is_impossible = !0;
141
142
  continue;
142
143
  }
143
- u.balance -= v, u.balance = u.balance < 0.01 ? 0 : u.balance, o += E, u.balance <= 0 && (i += _), v > 0 && (b = !0);
144
+ u.balance -= B, u.balance = u.balance < 0.01 ? 0 : u.balance, n += I, u.balance <= 0 && (i += C), B > 0 && (b = !0);
144
145
  }
145
- b && d.setMonth(d.getMonth() + 1);
146
+ b && c.setMonth(c.getMonth() + 1);
146
147
  }
147
- const c = t.some((b) => b.is_impossible && b.balance > 0), m = Te({ start: p, end: d });
148
+ const d = t.some((b) => b.is_impossible && b.balance > 0), m = Te({ start: p, end: c });
148
149
  return {
149
- payoffSavings: c ? "N/A" : M(o, "0,0.00"),
150
- payoffDate: c ? "Never" : K(d, U.MONTH_YEAR),
151
- payoffDuration: c ? "Stagnant" : Ae(m, { format: ["years", "months"] }) || "0 months"
150
+ payoffSavings: d ? "N/A" : k(n, "0,0.00"),
151
+ payoffDate: d ? "Never" : K(c, U.MONTH_YEAR),
152
+ payoffDuration: d ? "Stagnant" : Ae(m, { format: ["years", "months"] }) || "0 months"
152
153
  };
153
154
  }
154
- const R = () => {
155
+ const $ = () => {
155
156
  if (!x.useContext(Me))
156
157
  throw new Error("useCateUiStore() must be used within the GlobalDataContext");
157
158
  return q().uiStore;
158
- }, nt = ({ debts: a, onClickCta: n, sx: r }) => {
159
- const t = X(), { isMobile: o } = Y(), { debts: i } = C(), { selectedDebtPriority: p } = R(), { monthlyCashFlowProfile: d } = V(), { payoffDate: c, payoffSavings: m, payoffDuration: b } = x.useMemo(() => {
160
- const f = d?.extra_payment ?? 0;
161
- return at(a, p, f);
162
- }, [a, p, d]);
159
+ }, nt = ({ debts: a, onClickCta: o, sx: r }) => {
160
+ const t = X(), { isMobile: n } = Y(), { debts: i } = S(), { selectedDebtPriority: p } = $(), { monthlyCashFlowProfile: c } = V(), { payoffDate: d, payoffSavings: m, payoffDuration: b } = x.useMemo(() => {
161
+ const f = c?.extra_payment ?? 0;
162
+ return ot(a, p, f);
163
+ }, [a, p, c]);
163
164
  return /* @__PURE__ */ e(
164
165
  be,
165
166
  {
166
167
  sx: {
167
168
  boxShadow: t.shadows[2],
168
- width: o ? "100%" : "186px",
169
+ width: n ? "100%" : "186px",
169
170
  minWidth: "186px",
170
171
  ...r
171
172
  },
172
- children: /* @__PURE__ */ s(y, { sx: { gap: "12px", p: "16px" }, children: [
173
+ children: /* @__PURE__ */ s(_, { sx: { gap: "12px", p: "16px" }, children: [
173
174
  /* @__PURE__ */ s(
174
- y,
175
+ _,
175
176
  {
176
- gap: o ? "4px" : "0",
177
+ gap: n ? "4px" : "0",
177
178
  sx: {
178
179
  borderBottom: "1px solid",
179
180
  borderBottomColor: t.palette.grey[300],
@@ -181,15 +182,15 @@ const R = () => {
181
182
  },
182
183
  children: [
183
184
  /* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_date_description }),
184
- /* @__PURE__ */ e(l, { bold: !0, color: t.palette.primary.main, variant: "Small", children: c })
185
+ /* @__PURE__ */ e(l, { bold: !0, color: t.palette.primary.main, variant: "Small", children: d })
185
186
  ]
186
187
  }
187
188
  ),
188
- /* @__PURE__ */ s(y, { gap: o ? "4px" : "0", children: [
189
+ /* @__PURE__ */ s(_, { gap: n ? "4px" : "0", children: [
189
190
  /* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: m }),
190
191
  /* @__PURE__ */ e(l, { sx: { whiteSpace: "normal" }, variant: "XSmall", children: i.snowball_card_amount_description })
191
192
  ] }),
192
- /* @__PURE__ */ s(y, { gap: o ? "4px" : "0", children: [
193
+ /* @__PURE__ */ s(_, { gap: n ? "4px" : "0", children: [
193
194
  /* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: b }),
194
195
  /* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_duration_description })
195
196
  ] }),
@@ -198,7 +199,7 @@ const R = () => {
198
199
  {
199
200
  bold: !0,
200
201
  color: t.palette.primary.main,
201
- onClick: n,
202
+ onClick: o,
202
203
  sx: { cursor: "pointer" },
203
204
  variant: "Small",
204
205
  children: i.snowball_card_cta
@@ -207,18 +208,18 @@ const R = () => {
207
208
  ] })
208
209
  }
209
210
  );
210
- }, ot = D(nt), it = ({ isOpen: a, onClose: n }) => {
211
- const r = X(), { debts: t } = C(), [o, i] = x.useState(!1);
211
+ }, it = D(nt), lt = ({ isOpen: a, onClose: o }) => {
212
+ const r = X(), { debts: t } = S(), [n, i] = x.useState(!1);
212
213
  return /* @__PURE__ */ e(
213
214
  te,
214
215
  {
215
216
  ariaLabelClose: "",
216
217
  isOpen: a,
217
- onClose: n,
218
+ onClose: o,
218
219
  title: t.snowball_drawer_title,
219
- children: /* @__PURE__ */ s(y, { bgcolor: r.palette.background.default, height: "100%", children: [
220
- /* @__PURE__ */ s(y, { alignItems: "center", px: 24, py: 24, children: [
221
- /* @__PURE__ */ s(y, { alignItems: "center", pb: 24, children: [
220
+ children: /* @__PURE__ */ s(_, { bgcolor: r.palette.background.default, height: "100%", children: [
221
+ /* @__PURE__ */ s(_, { alignItems: "center", px: 24, py: 24, children: [
222
+ /* @__PURE__ */ s(_, { alignItems: "center", pb: 24, children: [
222
223
  /* @__PURE__ */ e(l, { mb: 12, variant: "H3", children: t.snowball_drawer_subtitle }),
223
224
  /* @__PURE__ */ e(l, { color: r.palette.secondary.main, variant: "Small", children: t.snowball_drawer_amount_description }),
224
225
  /* @__PURE__ */ e(l, { variant: "H1", children: t.snowball_drawer_savings }),
@@ -231,7 +232,7 @@ const R = () => {
231
232
  {
232
233
  color: r.palette.secondary.main,
233
234
  mb: 8,
234
- sx: { whiteSpace: o ? "normal" : "nowrap" },
235
+ sx: { whiteSpace: n ? "normal" : "nowrap" },
235
236
  variant: "ParagraphSmall",
236
237
  children: t.snowball_drawer_answer
237
238
  }
@@ -241,15 +242,15 @@ const R = () => {
241
242
  {
242
243
  bold: !0,
243
244
  color: r.palette.primary.main,
244
- onClick: () => i(!o),
245
+ onClick: () => i(!n),
245
246
  sx: { cursor: "pointer" },
246
247
  variant: "Small",
247
- children: o ? t.snowball_drawer_less : t.snowball_drawer_more
248
+ children: n ? t.snowball_drawer_less : t.snowball_drawer_more
248
249
  }
249
250
  )
250
251
  ] })
251
252
  ] }),
252
- /* @__PURE__ */ s(y, { children: [
253
+ /* @__PURE__ */ s(_, { children: [
253
254
  /* @__PURE__ */ e(
254
255
  l,
255
256
  {
@@ -260,12 +261,12 @@ const R = () => {
260
261
  children: t.snowball_drawer_disclaimer
261
262
  }
262
263
  ),
263
- /* @__PURE__ */ s(y, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
264
- /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: A(t.snowball_drawer_month_header, 1) }),
264
+ /* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
265
+ /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: E(t.snowball_drawer_month_header, 1) }),
265
266
  /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
266
267
  ] }),
267
- /* @__PURE__ */ s(y, { bgcolor: r.palette.background.paper, mb: 24, children: [
268
- /* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, children: [
268
+ /* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
269
+ /* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
269
270
  /* @__PURE__ */ e(
270
271
  G,
271
272
  {
@@ -283,7 +284,7 @@ const R = () => {
283
284
  }
284
285
  ),
285
286
  /* @__PURE__ */ s(
286
- y,
287
+ _,
287
288
  {
288
289
  sx: {
289
290
  borderBottom: `1px solid ${r.palette.border.light}`,
@@ -293,18 +294,18 @@ const R = () => {
293
294
  pr: 24
294
295
  },
295
296
  children: [
296
- /* @__PURE__ */ s(y, { flexGrow: 1, children: [
297
- /* @__PURE__ */ e(l, { variant: "Body", children: A(t.snowball_drawer_debt_label, "A") }),
297
+ /* @__PURE__ */ s(_, { flexGrow: 1, children: [
298
+ /* @__PURE__ */ e(l, { variant: "Body", children: E(t.snowball_drawer_debt_label, "A") }),
298
299
  /* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "XSmall", children: [
299
- A(
300
+ E(
300
301
  t.snowball_drawer_rollover_explainer_pt1,
301
302
  "$100"
302
303
  ),
303
- /* @__PURE__ */ e("strong", { children: A(t.snowball_drawer_debt_label, "B") }),
304
+ /* @__PURE__ */ e("strong", { children: E(t.snowball_drawer_debt_label, "B") }),
304
305
  t.snowball_drawer_rollover_explainer_pt2
305
306
  ] })
306
307
  ] }),
307
- /* @__PURE__ */ s(y, { children: [
308
+ /* @__PURE__ */ s(_, { children: [
308
309
  /* @__PURE__ */ e(l, { variant: "Body", children: "$100.00" }),
309
310
  /* @__PURE__ */ e(
310
311
  l,
@@ -321,7 +322,7 @@ const R = () => {
321
322
  }
322
323
  )
323
324
  ] }),
324
- /* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, children: [
325
+ /* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
325
326
  /* @__PURE__ */ e(
326
327
  G,
327
328
  {
@@ -335,7 +336,7 @@ const R = () => {
335
336
  }
336
337
  ),
337
338
  /* @__PURE__ */ s(
338
- y,
339
+ _,
339
340
  {
340
341
  sx: {
341
342
  borderBottom: `1px solid ${r.palette.border.light}`,
@@ -345,13 +346,13 @@ const R = () => {
345
346
  pr: 24
346
347
  },
347
348
  children: [
348
- /* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: A(t.snowball_drawer_debt_label, "B") }),
349
+ /* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: E(t.snowball_drawer_debt_label, "B") }),
349
350
  /* @__PURE__ */ e(l, { variant: "Body", children: "$400.00" })
350
351
  ]
351
352
  }
352
353
  )
353
354
  ] }),
354
- /* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, py: 14, children: [
355
+ /* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, py: 14, children: [
355
356
  /* @__PURE__ */ e(
356
357
  G,
357
358
  {
@@ -364,13 +365,13 @@ const R = () => {
364
365
  }
365
366
  }
366
367
  ),
367
- /* @__PURE__ */ s(y, { flexDirection: "row", flexGrow: 1, pr: 24, children: [
368
- /* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: A(t.snowball_drawer_debt_label, "C") }),
368
+ /* @__PURE__ */ s(_, { flexDirection: "row", flexGrow: 1, pr: 24, children: [
369
+ /* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: E(t.snowball_drawer_debt_label, "C") }),
369
370
  /* @__PURE__ */ e(l, { variant: "Body", children: "$1,000.00" })
370
371
  ] })
371
372
  ] }),
372
373
  /* @__PURE__ */ s(
373
- y,
374
+ _,
374
375
  {
375
376
  sx: {
376
377
  py: 8,
@@ -387,12 +388,12 @@ const R = () => {
387
388
  }
388
389
  )
389
390
  ] }),
390
- /* @__PURE__ */ s(y, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
391
- /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: A(t.snowball_drawer_month_header, 2) }),
391
+ /* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
392
+ /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: E(t.snowball_drawer_month_header, 2) }),
392
393
  /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
393
394
  ] }),
394
- /* @__PURE__ */ s(y, { bgcolor: r.palette.background.paper, mb: 24, children: [
395
- /* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, children: [
395
+ /* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
396
+ /* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
396
397
  /* @__PURE__ */ e(
397
398
  G,
398
399
  {
@@ -410,7 +411,7 @@ const R = () => {
410
411
  }
411
412
  ),
412
413
  /* @__PURE__ */ s(
413
- y,
414
+ _,
414
415
  {
415
416
  sx: {
416
417
  borderBottom: `1px solid ${r.palette.border.light}`,
@@ -420,18 +421,18 @@ const R = () => {
420
421
  pr: 24
421
422
  },
422
423
  children: [
423
- /* @__PURE__ */ s(y, { flexGrow: 1, children: [
424
- /* @__PURE__ */ e(l, { variant: "Body", children: A(t.snowball_drawer_debt_label, "B") }),
424
+ /* @__PURE__ */ s(_, { flexGrow: 1, children: [
425
+ /* @__PURE__ */ e(l, { variant: "Body", children: E(t.snowball_drawer_debt_label, "B") }),
425
426
  /* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "XSmall", children: [
426
- A(
427
+ E(
427
428
  t.snowball_drawer_rollover_explainer_pt1,
428
429
  "$500"
429
430
  ),
430
- /* @__PURE__ */ e("strong", { children: A(t.snowball_drawer_debt_label, "C") }),
431
+ /* @__PURE__ */ e("strong", { children: E(t.snowball_drawer_debt_label, "C") }),
431
432
  t.snowball_drawer_rollover_explainer_pt2
432
433
  ] })
433
434
  ] }),
434
- /* @__PURE__ */ s(y, { children: [
435
+ /* @__PURE__ */ s(_, { children: [
435
436
  /* @__PURE__ */ e(l, { variant: "Body", children: "$500.00" }),
436
437
  /* @__PURE__ */ e(
437
438
  l,
@@ -448,7 +449,7 @@ const R = () => {
448
449
  }
449
450
  )
450
451
  ] }),
451
- /* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, children: [
452
+ /* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
452
453
  /* @__PURE__ */ e(
453
454
  G,
454
455
  {
@@ -462,7 +463,7 @@ const R = () => {
462
463
  }
463
464
  ),
464
465
  /* @__PURE__ */ s(
465
- y,
466
+ _,
466
467
  {
467
468
  sx: {
468
469
  flexDirection: "row",
@@ -471,14 +472,14 @@ const R = () => {
471
472
  pr: 24
472
473
  },
473
474
  children: [
474
- /* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: A(t.snowball_drawer_debt_label, "C") }),
475
+ /* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: E(t.snowball_drawer_debt_label, "C") }),
475
476
  /* @__PURE__ */ e(l, { variant: "Body", children: "$1,000.00" })
476
477
  ]
477
478
  }
478
479
  )
479
480
  ] }),
480
481
  /* @__PURE__ */ s(
481
- y,
482
+ _,
482
483
  {
483
484
  sx: {
484
485
  py: 8,
@@ -495,12 +496,12 @@ const R = () => {
495
496
  }
496
497
  )
497
498
  ] }),
498
- /* @__PURE__ */ s(y, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
499
- /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: A(t.snowball_drawer_month_header, 3) }),
499
+ /* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
500
+ /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: E(t.snowball_drawer_month_header, 3) }),
500
501
  /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
501
502
  ] }),
502
- /* @__PURE__ */ s(y, { bgcolor: r.palette.background.paper, mb: 24, children: [
503
- /* @__PURE__ */ s(y, { alignItems: "center", flexDirection: "row", pl: 24, children: [
503
+ /* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
504
+ /* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
504
505
  /* @__PURE__ */ e(
505
506
  G,
506
507
  {
@@ -518,7 +519,7 @@ const R = () => {
518
519
  }
519
520
  ),
520
521
  /* @__PURE__ */ s(
521
- y,
522
+ _,
522
523
  {
523
524
  sx: {
524
525
  alignItems: "center",
@@ -528,8 +529,8 @@ const R = () => {
528
529
  pr: 24
529
530
  },
530
531
  children: [
531
- /* @__PURE__ */ e(y, { flexGrow: 1, children: /* @__PURE__ */ e(l, { variant: "Body", children: A(t.snowball_drawer_debt_label, "C") }) }),
532
- /* @__PURE__ */ s(y, { children: [
532
+ /* @__PURE__ */ e(_, { flexGrow: 1, children: /* @__PURE__ */ e(l, { variant: "Body", children: E(t.snowball_drawer_debt_label, "C") }) }),
533
+ /* @__PURE__ */ s(_, { children: [
533
534
  /* @__PURE__ */ e(l, { variant: "Body", children: "$1,500.00" }),
534
535
  /* @__PURE__ */ e(
535
536
  l,
@@ -547,7 +548,7 @@ const R = () => {
547
548
  )
548
549
  ] }),
549
550
  /* @__PURE__ */ s(
550
- y,
551
+ _,
551
552
  {
552
553
  sx: {
553
554
  py: 8,
@@ -568,50 +569,50 @@ const R = () => {
568
569
  ] })
569
570
  }
570
571
  );
571
- }, lt = D(it), st = "#FF7B08";
572
- function ct(a, n) {
573
- const [r, t, o] = a.replace(/^#/, "").match(/.{1,2}/g).map((p) => parseInt(p, 16)), i = [
574
- Math.max(0, Math.min(255, Math.round(r * n))),
575
- Math.max(0, Math.min(255, Math.round(t * n))),
576
- Math.max(0, Math.min(255, Math.round(o * n)))
572
+ }, st = D(lt), ct = "#FF7B08";
573
+ function dt(a, o) {
574
+ const [r, t, n] = a.replace(/^#/, "").match(/.{1,2}/g).map((p) => parseInt(p, 16)), i = [
575
+ Math.max(0, Math.min(255, Math.round(r * o))),
576
+ Math.max(0, Math.min(255, Math.round(t * o))),
577
+ Math.max(0, Math.min(255, Math.round(n * o)))
577
578
  ];
578
579
  return `rgb(${i[0]}, ${i[1]}, ${i[2]})`;
579
580
  }
580
- const ge = ({
581
+ const xe = ({
581
582
  sx: a,
582
- height: n = 500,
583
+ height: o = 500,
583
584
  width: r,
584
585
  debts: t,
585
- hoveredDebtGuid: o,
586
+ hoveredDebtGuid: n,
586
587
  onClickArea: i,
587
588
  onHoverArea: p
588
589
  }) => {
589
- const d = He(), { onEvent: c } = k(), m = t.filter((h) => !h.is_impossible), b = [
590
+ const c = $e(), { onEvent: d } = F(), m = t.filter((h) => !h.is_impossible), b = [
590
591
  ...new Set(
591
- m.flatMap((h) => h.dataset.map((w) => new Date(w.x).getTime()))
592
+ m.flatMap((h) => h.dataset.map((g) => new Date(g.x).getTime()))
592
593
  )
593
- ].sort((h, w) => h - w).map((h) => new Date(h)), f = m.map((h) => {
594
- const w = new Map(h.dataset.map((F) => [new Date(F.x).getTime(), F.y]));
595
- let I = w.get(b[0].getTime()) ?? 0;
596
- const N = b.map((F) => {
597
- const O = w.get(F.getTime()) ?? I;
598
- return I = O, { x: F, y: O };
594
+ ].sort((h, g) => h - g).map((h) => new Date(h)), f = m.map((h) => {
595
+ const g = new Map(h.dataset.map((L) => [new Date(L.x).getTime(), L.y]));
596
+ let A = g.get(b[0].getTime()) ?? 0;
597
+ const R = b.map((L) => {
598
+ const O = g.get(L.getTime()) ?? A;
599
+ return A = O, { x: L, y: O };
599
600
  });
600
- return { ...h, dataset: N };
601
+ return { ...h, dataset: R };
601
602
  }), u = f.reduce(
602
- (h, w) => h + (w.dataset[0]?.y ?? 0),
603
+ (h, g) => h + (g.dataset[0]?.y ?? 0),
603
604
  0
604
- ), S = b.map((h, w) => {
605
- const I = w / (b.length - 1), N = u * (1 - I);
606
- return { x: h, y: N };
607
- }), P = Math.ceil(u / 100) * 100, E = b, _ = f.map((h, w) => {
608
- const I = 1 - w / f.length * 0.5, N = ct(st, I);
605
+ ), v = b.map((h, g) => {
606
+ const A = g / (b.length - 1), R = u * (1 - A);
607
+ return { x: h, y: R };
608
+ }), M = Math.ceil(u / 100) * 100, I = b, C = f.map((h, g) => {
609
+ const A = 1 - g / f.length * 0.5, R = dt(ct, A);
609
610
  return {
610
- id: `debt-${w}`,
611
+ id: `debt-${g}`,
611
612
  guid: h.guid,
612
613
  label: h.name,
613
- data: h.dataset.map((F) => F.y),
614
- color: N,
614
+ data: h.dataset.map((L) => L.y),
615
+ color: R,
615
616
  curve: "linear",
616
617
  type: "line",
617
618
  area: !0,
@@ -619,18 +620,18 @@ const ge = ({
619
620
  showMark: !1
620
621
  };
621
622
  });
622
- _.push({
623
+ C.push({
623
624
  id: "payoff-line",
624
625
  label: "Payoff Line",
625
- data: S.map((h) => h.y),
626
- color: d.palette.grey[700],
626
+ data: v.map((h) => h.y),
627
+ color: c.palette.grey[700],
627
628
  curve: "linear",
628
629
  type: "line",
629
630
  stack: void 0,
630
631
  showMark: !1,
631
632
  disableHighlight: !0
632
633
  });
633
- const v = (h) => _.findIndex((w) => w?.guid === h);
634
+ const B = (h) => C.findIndex((g) => g?.guid === h);
634
635
  return /* @__PURE__ */ e(
635
636
  re,
636
637
  {
@@ -647,27 +648,25 @@ const ge = ({
647
648
  }
648
649
  },
649
650
  children: /* @__PURE__ */ e(
650
- $e,
651
+ He,
651
652
  {
652
653
  axisHighlight: { x: "none" },
653
654
  disableLineItemHighlight: !0,
654
- height: n,
655
- onAreaClick: (h, w) => {
655
+ height: o,
656
+ hideLegend: !0,
657
+ margin: { bottom: 24, left: 32, right: 72, top: 48 },
658
+ onAreaClick: (h, g) => {
656
659
  i?.();
657
- const I = _.find((N) => N.id === w.seriesId);
658
- c(T.DEBTS_CLICK_CHART_AREA, { account_guid: I?.guid });
660
+ const A = C.find((R) => R.id === g.seriesId);
661
+ d(T.DEBTS_CLICK_CHART_AREA, { account_guid: A?.guid });
659
662
  },
660
663
  onHighlightChange: (h) => {
661
- const w = _.find((I) => I.id === h?.seriesId)?.guid;
662
- p?.(w ?? "");
664
+ const g = C.find((A) => A.id === h?.seriesId)?.guid;
665
+ p?.(g ?? "");
663
666
  },
664
- series: _,
667
+ series: C,
665
668
  skipAnimation: !0,
666
- slotProps: {
667
- legend: {
668
- hidden: !0
669
- }
670
- },
669
+ slotProps: { tooltip: { trigger: "none" } },
671
670
  sx: {
672
671
  p: 4,
673
672
  "& .MuiBarLabel-root": {
@@ -685,43 +684,43 @@ const ge = ({
685
684
  strokeDasharray: "10 5",
686
685
  strokeWidth: 1
687
686
  },
688
- [`& .MuiLineElement-series-debt-${v(o ?? "0")}`]: {
687
+ [`& .MuiLineElement-series-debt-${B(n ?? "0")}`]: {
689
688
  opacity: 1
690
689
  },
691
- [`& .MuiAreaElement-series-debt-${v(o ?? "0")}`]: {
690
+ [`& .MuiAreaElement-series-debt-${B(n ?? "0")}`]: {
692
691
  opacity: 1
693
692
  },
694
693
  "& .MuiChartsAxis-tickLabel > tspan": {
695
- fontFamily: d.typography.Small.fontFamily
694
+ fontFamily: c.typography.Small.fontFamily
696
695
  },
697
696
  ...a
698
697
  },
699
- tooltip: { trigger: "none" },
700
698
  width: r,
701
699
  xAxis: [
702
700
  {
703
- data: E,
704
- scaleType: "time",
705
- min: b[0],
701
+ data: I,
706
702
  disableTicks: !0,
703
+ min: b[0],
704
+ scaleType: "time",
705
+ tickLabelMinGap: 24,
707
706
  valueFormatter: (h) => K(h, U.MONTH_SHORT_YEAR)
708
707
  }
709
708
  ],
710
709
  yAxis: [
711
710
  {
712
711
  min: 0,
713
- max: P,
712
+ max: M,
714
713
  disableTicks: !0,
715
- valueFormatter: (h) => M(h, "0a")
714
+ valueFormatter: (h) => k(h, "0a")
716
715
  }
717
716
  ]
718
717
  }
719
718
  )
720
719
  }
721
720
  );
722
- }, dt = () => {
723
- const a = X(), { debts: n } = C(), { selectedDebtChartData: r } = R();
724
- return /* @__PURE__ */ s($, { children: [
721
+ }, pt = () => {
722
+ const a = X(), { debts: o } = S(), { selectedDebtChartData: r } = $();
723
+ return /* @__PURE__ */ s(H, { children: [
725
724
  /* @__PURE__ */ s(
726
725
  Fe,
727
726
  {
@@ -731,8 +730,8 @@ const ge = ({
731
730
  }
732
731
  },
733
732
  children: [
734
- /* @__PURE__ */ e(Le, { sx: { pb: 0 }, title: /* @__PURE__ */ e(ve, { sx: { pb: 4 }, children: n.details_chart_title }) }),
735
- /* @__PURE__ */ e(Re, { sx: { p: 0 }, children: /* @__PURE__ */ e(ge, { debts: [r], height: 250 }) })
733
+ /* @__PURE__ */ e(Le, { sx: { pb: 0 }, title: /* @__PURE__ */ e(ve, { sx: { pb: 4 }, children: o.details_chart_title }) }),
734
+ /* @__PURE__ */ e(Re, { sx: { p: 0 }, children: /* @__PURE__ */ e(xe, { debts: [r], height: 250 }) })
736
735
  ]
737
736
  }
738
737
  ),
@@ -742,13 +741,13 @@ const ge = ({
742
741
  color: a.palette.text.secondary,
743
742
  sx: { whiteSpace: "normal", textAlign: "center", px: 8, py: 12 },
744
743
  variant: "Small",
745
- children: n.details_chart_description
744
+ children: o.details_chart_description
746
745
  }
747
746
  )
748
747
  ] });
749
- }, pt = D(dt), mt = () => {
750
- const a = X(), { onEvent: n } = k(), { debts: r } = C(), { selectedDebtChartData: t, showCompleted: o, showError: i } = R();
751
- return x.useEffect(() => n(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(_e, { children: i || o ? /* @__PURE__ */ e(
748
+ }, mt = D(pt), ht = () => {
749
+ const a = X(), { onEvent: o } = F(), { debts: r } = S(), { selectedDebtChartData: t, showCompleted: n, showError: i } = $();
750
+ return x.useEffect(() => o(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(_e, { children: i || n ? /* @__PURE__ */ e(
752
751
  l,
753
752
  {
754
753
  color: a.palette.secondary.main,
@@ -757,13 +756,13 @@ const ge = ({
757
756
  variant: "Small",
758
757
  children: i ? r.schedule_error_message : r.schedule_complete_message
759
758
  }
760
- ) : /* @__PURE__ */ s($, { children: [
761
- /* @__PURE__ */ s(g, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
759
+ ) : /* @__PURE__ */ s(H, { children: [
760
+ /* @__PURE__ */ s(w, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
762
761
  /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_month_heading }),
763
762
  /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_amount_heading })
764
763
  ] }),
765
- t.dataset.slice(1).map(({ x: p, y: d, payment: c }) => /* @__PURE__ */ e(g, { bgcolor: a.palette.background.paper, children: /* @__PURE__ */ e(g, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ s(
766
- g,
764
+ t.dataset.slice(1).map(({ x: p, y: c, payment: d }) => /* @__PURE__ */ e(w, { bgcolor: a.palette.background.paper, children: /* @__PURE__ */ e(w, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ s(
765
+ w,
767
766
  {
768
767
  sx: {
769
768
  borderBottom: `1px solid ${a.palette.border.light}`,
@@ -773,12 +772,12 @@ const ge = ({
773
772
  pr: 24
774
773
  },
775
774
  children: [
776
- /* @__PURE__ */ s(g, { flexGrow: 1, children: [
775
+ /* @__PURE__ */ s(w, { flexGrow: 1, children: [
777
776
  /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: K(p, U.MONTH_YEAR) }),
778
777
  /* @__PURE__ */ e(l, { color: a.palette.secondary.main, variant: "XSmall", children: r.schedule_month_label })
779
778
  ] }),
780
- /* @__PURE__ */ s(g, { children: [
781
- /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: M(d, "0,0.00") }),
779
+ /* @__PURE__ */ s(w, { children: [
780
+ /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: k(c, "0,0.00") }),
782
781
  /* @__PURE__ */ e(
783
782
  l,
784
783
  {
@@ -786,15 +785,15 @@ const ge = ({
786
785
  color: a.palette.success.main,
787
786
  textAlign: "end",
788
787
  variant: "Tiny",
789
- children: `+${M(c, "0,0")}`
788
+ children: `+${k(d, "0,0")}`
790
789
  }
791
790
  )
792
791
  ] })
793
792
  ]
794
793
  }
795
794
  ) }) }, String(p))),
796
- /* @__PURE__ */ e(g, { bgcolor: "background.paper", children: /* @__PURE__ */ s(
797
- g,
795
+ /* @__PURE__ */ e(w, { bgcolor: "background.paper", children: /* @__PURE__ */ s(
796
+ w,
798
797
  {
799
798
  sx: {
800
799
  alignItems: "center",
@@ -810,10 +809,10 @@ const ge = ({
810
809
  }
811
810
  ) })
812
811
  ] }) });
813
- }, ht = D(mt), ut = D(({ debt: a }) => {
814
- const { debts: n } = C(), { updateAccount: r } = Z(), { onEvent: t } = k(), [o, i] = x.useState(a.interest_rate ?? 0), p = o < 0, d = async () => {
815
- await r({ ...a.account, interest_rate: o }), a.interest_rate = o, t(T.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
816
- }, c = () => {
812
+ }, ut = D(ht), bt = D(({ debt: a }) => {
813
+ const { debts: o } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [n, i] = x.useState(a.interest_rate ?? 0), p = n < 0, c = async () => {
814
+ await r({ ...a.account, interest_rate: n }), a.interest_rate = n, t(T.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
815
+ }, d = () => {
817
816
  setTimeout(() => {
818
817
  i(a.interest_rate ?? 0);
819
818
  }, 250);
@@ -822,12 +821,12 @@ const ge = ({
822
821
  J,
823
822
  {
824
823
  isSaveDisabled: p,
825
- label: `${n.details_interest_rate} (%)`,
826
- onCancel: c,
827
- onSave: d,
828
- primaryText: n.details_interest_rate,
824
+ label: `${o.details_interest_rate} (%)`,
825
+ onCancel: d,
826
+ onSave: c,
827
+ primaryText: o.details_interest_rate,
829
828
  secondaryText: Be(Number(a.interest_rate) / 100),
830
- zeroStateText: a.interest_rate ? void 0 : n.add_interest_rate,
829
+ zeroStateText: a.interest_rate ? void 0 : o.add_interest_rate,
831
830
  children: /* @__PURE__ */ e(
832
831
  Xe,
833
832
  {
@@ -835,15 +834,15 @@ const ge = ({
835
834
  fullWidth: !0,
836
835
  onChange: (m) => i(isNaN(parseFloat(m.target.value)) ? 0 : parseFloat(m.target.value)),
837
836
  type: "number",
838
- value: o
837
+ value: n
839
838
  }
840
839
  )
841
840
  }
842
841
  );
843
- }), bt = D(({ debt: a }) => {
844
- const { debts: n } = C(), { updateAccount: r } = Z(), { onEvent: t } = k(), [o, i] = x.useState(a.monthly_payment ?? 0), p = o < 0 || o > 9999999999e-2, d = async () => {
845
- await r({ ...a.account, minimum_payment: o }), a.monthly_payment = o, t(T.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
846
- }, c = () => {
842
+ }), _t = D(({ debt: a }) => {
843
+ const { debts: o } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [n, i] = x.useState(a.monthly_payment ?? 0), p = n < 0 || n > 9999999999e-2, c = async () => {
844
+ await r({ ...a.account, minimum_payment: n }), a.monthly_payment = n, t(T.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
845
+ }, d = () => {
847
846
  setTimeout(() => {
848
847
  i(a.monthly_payment ?? 0);
849
848
  }, 250);
@@ -852,30 +851,30 @@ const ge = ({
852
851
  J,
853
852
  {
854
853
  isSaveDisabled: p,
855
- label: n.details_monthly_payment,
856
- onCancel: c,
857
- onSave: d,
858
- primaryText: n.details_monthly_payment,
859
- secondaryText: M(a.monthly_payment, "0,0"),
860
- zeroStateText: a.monthly_payment ? void 0 : n.add_monthly_payment,
854
+ label: o.details_monthly_payment,
855
+ onCancel: d,
856
+ onSave: c,
857
+ primaryText: o.details_monthly_payment,
858
+ secondaryText: k(a.monthly_payment, "0,0"),
859
+ zeroStateText: a.monthly_payment ? void 0 : o.add_monthly_payment,
861
860
  children: /* @__PURE__ */ e(
862
861
  ae,
863
862
  {
864
- amount: o,
863
+ amount: n,
865
864
  autoFocus: !0,
866
865
  error: p,
867
866
  fullWidth: !0,
868
867
  minAmount: 0,
869
- setAmount: (m) => i(isNaN(Number(m)) ? o : Number(m)),
868
+ setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
870
869
  sx: { ".MuiTypography-Body": { p: 0 } }
871
870
  }
872
871
  )
873
872
  }
874
873
  );
875
- }), _t = D(({ debt: a }) => {
876
- const { debts: n } = C(), { updateAccount: r } = Z(), { onEvent: t } = k(), [o, i] = x.useState(a.original_balance ?? 0), p = o < 0 || o > 9999999999e-2, d = async () => {
877
- await r({ ...a.account, original_balance: o }), a.original_balance = o, t(T.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
878
- }, c = () => {
874
+ }), yt = D(({ debt: a }) => {
875
+ const { debts: o } = S(), { updateAccount: r } = Z(), { onEvent: t } = F(), [n, i] = x.useState(a.original_balance ?? 0), p = n < 0 || n > 9999999999e-2, c = async () => {
876
+ await r({ ...a.account, original_balance: n }), a.original_balance = n, t(T.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
877
+ }, d = () => {
879
878
  setTimeout(() => {
880
879
  i(a.original_balance ?? 0);
881
880
  }, 250);
@@ -884,52 +883,52 @@ const ge = ({
884
883
  J,
885
884
  {
886
885
  isSaveDisabled: p,
887
- label: n.details_original_balance,
888
- onCancel: c,
889
- onSave: d,
890
- primaryText: n.details_original_balance,
891
- secondaryText: M(a.original_balance, "0,0"),
892
- zeroStateText: a.original_balance ? void 0 : n.add_original_balance,
886
+ label: o.details_original_balance,
887
+ onCancel: d,
888
+ onSave: c,
889
+ primaryText: o.details_original_balance,
890
+ secondaryText: k(a.original_balance, "0,0"),
891
+ zeroStateText: a.original_balance ? void 0 : o.add_original_balance,
893
892
  children: /* @__PURE__ */ e(
894
893
  ae,
895
894
  {
896
- amount: o,
895
+ amount: n,
897
896
  autoFocus: !0,
898
897
  error: p,
899
898
  fullWidth: !0,
900
899
  minAmount: 0,
901
- setAmount: (m) => i(isNaN(Number(m)) ? o : Number(m)),
900
+ setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
902
901
  sx: { ".MuiTypography-Body": { p: 0 } }
903
902
  }
904
903
  )
905
904
  }
906
905
  );
907
- }), yt = () => {
908
- const { onEvent: a } = k(), { selectedDebtChartData: n } = R();
909
- return x.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(g, { bgcolor: "background.paper", children: [
910
- n?.goal && /* @__PURE__ */ s($, { children: [
911
- /* @__PURE__ */ e(Ge, { goal: n.goal }),
906
+ }), ft = () => {
907
+ const { onEvent: a } = F(), { selectedDebtChartData: o } = $();
908
+ return x.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(w, { bgcolor: "background.paper", children: [
909
+ o?.goal && /* @__PURE__ */ s(H, { children: [
910
+ /* @__PURE__ */ e(Ge, { goal: o.goal }),
912
911
  /* @__PURE__ */ e(j, {}),
913
- /* @__PURE__ */ e(je, { goal: n.goal }),
912
+ /* @__PURE__ */ e(je, { goal: o.goal }),
914
913
  /* @__PURE__ */ e(j, {}),
915
- /* @__PURE__ */ e(ze, { goal: n.goal }),
914
+ /* @__PURE__ */ e(ze, { goal: o.goal }),
916
915
  /* @__PURE__ */ e(j, {})
917
916
  ] }),
918
- !n?.goal && n?.account && /* @__PURE__ */ s($, { children: [
919
- /* @__PURE__ */ e(bt, { debt: n }),
917
+ !o?.goal && o?.account && /* @__PURE__ */ s(H, { children: [
918
+ /* @__PURE__ */ e(_t, { debt: o }),
920
919
  /* @__PURE__ */ e(j, {}),
921
- /* @__PURE__ */ e(ut, { debt: n }),
920
+ /* @__PURE__ */ e(bt, { debt: o }),
922
921
  /* @__PURE__ */ e(j, {}),
923
- /* @__PURE__ */ e(_t, { debt: n }),
922
+ /* @__PURE__ */ e(yt, { debt: o }),
924
923
  /* @__PURE__ */ e(j, {})
925
924
  ] })
926
925
  ] });
927
- }, ft = D(yt), xt = ({ setTabValue: a, sx: n }) => {
928
- const { debts: r } = C(), { showError: t, showCompleted: o } = R();
926
+ }, gt = D(ft), xt = ({ setTabValue: a, sx: o }) => {
927
+ const { debts: r } = S(), { showError: t, showCompleted: n } = $();
929
928
  return x.useEffect(() => {
930
929
  t && a(1);
931
- }, [t]), !t && !o ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ s(g, { gap: 16, children: [
932
- /* @__PURE__ */ e(he, { sx: { my: 16, mx: 24, ...n }, children: /* @__PURE__ */ s(
930
+ }, [t]), !t && !n ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ s(w, { gap: 16, children: [
931
+ /* @__PURE__ */ e(he, { sx: { my: 16, mx: 24, ...o }, children: /* @__PURE__ */ s(
933
932
  pe,
934
933
  {
935
934
  icon: t ? /* @__PURE__ */ e(Ve, { filled: !0 }) : /* @__PURE__ */ e(ye, { color: "success", filled: !0 }),
@@ -950,10 +949,10 @@ const ge = ({
950
949
  ]
951
950
  }
952
951
  ) }),
953
- t && /* @__PURE__ */ e(he, { sx: { mb: 16, mt: 100, mx: 24, ...n }, children: /* @__PURE__ */ s(
952
+ t && /* @__PURE__ */ e(he, { sx: { mb: 16, mt: 100, mx: 24, ...o }, children: /* @__PURE__ */ s(
954
953
  pe,
955
954
  {
956
- icon: /* @__PURE__ */ e($, {}),
955
+ icon: /* @__PURE__ */ e(H, {}),
957
956
  severity: "error",
958
957
  sx: {
959
958
  borderRadius: 2,
@@ -969,16 +968,16 @@ const ge = ({
969
968
  }
970
969
  ) })
971
970
  ] });
972
- }, gt = D(xt), wt = () => {
973
- const { debts: a } = C(), { showError: n, showCompleted: r } = R(), [t, o] = x.useState(0);
974
- return /* @__PURE__ */ s($, { children: [
975
- (n || r) && /* @__PURE__ */ e(gt, { setTabValue: o, sx: { mt: -24 } }),
971
+ }, wt = D(xt), Ct = () => {
972
+ const { debts: a } = S(), { showError: o, showCompleted: r } = $(), [t, n] = x.useState(0);
973
+ return /* @__PURE__ */ s(H, { children: [
974
+ (o || r) && /* @__PURE__ */ e(wt, { setTabValue: n, sx: { mt: -24 } }),
976
975
  /* @__PURE__ */ s(
977
976
  We,
978
977
  {
979
978
  "aria-label": a.details_tabs_aria_label,
980
979
  centered: !0,
981
- onChange: (i, p) => o(p),
980
+ onChange: (i, p) => n(p),
982
981
  textColor: "primary",
983
982
  value: t,
984
983
  variant: "fullWidth",
@@ -1002,32 +1001,32 @@ const ge = ({
1002
1001
  ]
1003
1002
  }
1004
1003
  ),
1005
- /* @__PURE__ */ e(ue, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(ht, {}) }),
1006
- /* @__PURE__ */ e(ue, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(ft, {}) })
1004
+ /* @__PURE__ */ e(ue, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(ut, {}) }),
1005
+ /* @__PURE__ */ e(ue, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(gt, {}) })
1007
1006
  ] });
1008
- }, Ct = D(wt), St = ({ isOpen: a, onClose: n }) => {
1009
- const { debts: r } = C(), { showError: t, showCompleted: o } = R(), i = t || o ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ e(pt, {});
1007
+ }, St = D(Ct), vt = ({ isOpen: a, onClose: o }) => {
1008
+ const { debts: r } = S(), { showError: t, showCompleted: n } = $(), i = t || n ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ e(mt, {});
1010
1009
  return /* @__PURE__ */ e(
1011
1010
  te,
1012
1011
  {
1013
1012
  ariaLabelClose: r.details_close_aria,
1014
1013
  isOpen: a,
1015
- onClose: n,
1014
+ onClose: o,
1016
1015
  title: r.details_title,
1017
- children: /* @__PURE__ */ s(g, { bgcolor: "background.default", children: [
1016
+ children: /* @__PURE__ */ s(w, { bgcolor: "background.default", children: [
1018
1017
  /* @__PURE__ */ e(ke, { customDetailsChart: i }),
1019
- /* @__PURE__ */ e(Ct, {})
1018
+ /* @__PURE__ */ e(St, {})
1020
1019
  ] })
1021
1020
  }
1022
1021
  );
1023
- }, vt = D(() => {
1024
- const { debts: a } = C(), { monthlyCashFlowProfile: n, updateMonthlyCashFlowProfile: r } = V(), { onEvent: t } = k(), [o, i] = x.useState(n?.extra_payment ?? 0), p = o < 0 || o > 9999999999e-2, d = async () => {
1025
- n && (await r({ ...n, extra_payment: o }), n.extra_payment = o, t(T.DEBTS_SAVE_PAYDOWN_ACTION, {
1026
- user_guid: n?.user_guid
1022
+ }, Dt = D(() => {
1023
+ const { debts: a } = S(), { monthlyCashFlowProfile: o, updateMonthlyCashFlowProfile: r } = V(), { onEvent: t } = F(), [n, i] = x.useState(o?.extra_payment ?? 0), p = n < 0 || n > 9999999999e-2, c = async () => {
1024
+ o && (await r({ ...o, extra_payment: n }), o.extra_payment = n, t(T.DEBTS_SAVE_PAYDOWN_ACTION, {
1025
+ user_guid: o?.user_guid
1027
1026
  }));
1028
- }, c = () => {
1027
+ }, d = () => {
1029
1028
  setTimeout(() => {
1030
- i(n?.extra_payment ?? 0);
1029
+ i(o?.extra_payment ?? 0);
1031
1030
  }, 250);
1032
1031
  };
1033
1032
  return /* @__PURE__ */ e(
@@ -1035,77 +1034,77 @@ const ge = ({
1035
1034
  {
1036
1035
  isSaveDisabled: p,
1037
1036
  label: a.paydown_drawer_extra_payment,
1038
- onCancel: c,
1039
- onSave: d,
1037
+ onCancel: d,
1038
+ onSave: c,
1040
1039
  primaryText: a.paydown_drawer_extra_payment,
1041
- secondaryText: M(n?.extra_payment, "0,0"),
1042
- zeroStateText: n?.extra_payment ? void 0 : a.add_extra_payment,
1040
+ secondaryText: k(o?.extra_payment, "0,0"),
1041
+ zeroStateText: o?.extra_payment ? void 0 : a.add_extra_payment,
1043
1042
  children: /* @__PURE__ */ e(
1044
1043
  ae,
1045
1044
  {
1046
- amount: o,
1045
+ amount: n,
1047
1046
  autoFocus: !0,
1048
1047
  error: p,
1049
1048
  fullWidth: !0,
1050
1049
  minAmount: 0,
1051
- setAmount: (m) => i(isNaN(Number(m)) ? o : Number(m)),
1050
+ setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
1052
1051
  sx: { ".MuiTypography-Body": { p: 0 } }
1053
1052
  }
1054
1053
  )
1055
1054
  }
1056
1055
  );
1057
- }), Dt = () => {
1058
- const { debts: a } = C(), { totalMonthlyPayments: n } = q(), { monthlyCashFlowProfile: r } = V(), t = n + Number(r?.extra_payment);
1059
- return /* @__PURE__ */ s(g, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
1060
- /* @__PURE__ */ s(g, { p: 24, children: [
1061
- /* @__PURE__ */ s(g, { alignItems: "center", gap: 4, mb: 24, children: [
1056
+ }), Tt = () => {
1057
+ const { debts: a } = S(), { totalMonthlyPayments: o } = q(), { monthlyCashFlowProfile: r } = V(), t = o + Number(r?.extra_payment);
1058
+ return /* @__PURE__ */ s(w, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
1059
+ /* @__PURE__ */ s(w, { p: 24, children: [
1060
+ /* @__PURE__ */ s(w, { alignItems: "center", gap: 4, mb: 24, children: [
1062
1061
  /* @__PURE__ */ e(l, { variant: "Body", children: a.paydown_drawer_mimimum_label }),
1063
- /* @__PURE__ */ e(l, { bold: !0, variant: "H1", children: M(n, "0,0") }),
1062
+ /* @__PURE__ */ e(l, { bold: !0, variant: "H1", children: k(o, "0,0") }),
1064
1063
  /* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "Small", width: 208, children: a.paydown_drawer_minimum_info })
1065
1064
  ] }),
1066
- /* @__PURE__ */ s(g, { children: [
1065
+ /* @__PURE__ */ s(w, { children: [
1067
1066
  /* @__PURE__ */ e(l, { variant: "H3", children: a.paydown_drawer_subtitle }),
1068
1067
  /* @__PURE__ */ e(l, { truncate: !1, variant: "ParagraphSmall", children: a.paydown_drawer_description })
1069
1068
  ] })
1070
1069
  ] }),
1071
- /* @__PURE__ */ e(g, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(vt, {}) }),
1072
- /* @__PURE__ */ e(g, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(g, { gap: 4, children: [
1070
+ /* @__PURE__ */ e(w, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(Dt, {}) }),
1071
+ /* @__PURE__ */ e(w, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(w, { gap: 4, children: [
1073
1072
  /* @__PURE__ */ e(l, { variant: "Small", children: a.paydown_drawer_total_payment }),
1074
- /* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: M(t, "0,0") })
1073
+ /* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: k(t, "0,0") })
1075
1074
  ] }) })
1076
1075
  ] });
1077
- }, Tt = D(Dt), At = ({ isOpen: a, onClose: n }) => {
1078
- const { debts: r } = C();
1076
+ }, At = D(Tt), Et = ({ isOpen: a, onClose: o }) => {
1077
+ const { debts: r } = S();
1079
1078
  return /* @__PURE__ */ e(
1080
1079
  te,
1081
1080
  {
1082
1081
  ariaLabelClose: r.paydown_drawer_close_aria,
1083
1082
  isOpen: a,
1084
- onClose: n,
1083
+ onClose: o,
1085
1084
  title: r.paydown_drawer_title,
1086
- children: /* @__PURE__ */ e(Tt, {})
1085
+ children: /* @__PURE__ */ e(At, {})
1087
1086
  }
1088
1087
  );
1089
1088
  };
1090
- function Et(a, n) {
1089
+ function It(a, o) {
1091
1090
  const r = (t) => {
1092
1091
  if (typeof t == "number") return t;
1093
1092
  if (t === "!" || t === "✓") return 1 / 0;
1094
1093
  throw new Error("Unsupported value");
1095
1094
  };
1096
- return r(a) - r(n);
1095
+ return r(a) - r(o);
1097
1096
  }
1098
- function It(a) {
1097
+ function Bt(a) {
1099
1098
  return a.is_paid_off ? "✓" : a.priority === void 0 || a.is_impossible ? "!" : a.priority;
1100
1099
  }
1101
- const Bt = (a) => {
1102
- const n = {
1100
+ const Mt = (a) => {
1101
+ const o = {
1103
1102
  text: "#121417",
1104
1103
  background: "#FFB252"
1105
1104
  };
1106
- return a === "!" && (n.text = "#FFFFFF", n.background = "#DF320C"), a === "✓" && (n.text = "#FFFFFF", n.background = "#09A57F"), n;
1107
- }, Mt = (a) => {
1108
- const n = String(a.formattedValue), r = Bt(n);
1105
+ return a === "!" && (o.text = "#FFFFFF", o.background = "#DF320C"), a === "✓" && (o.text = "#FFFFFF", o.background = "#09A57F"), o;
1106
+ }, Pt = (a) => {
1107
+ const o = String(a.formattedValue), r = Mt(o);
1109
1108
  return /* @__PURE__ */ e(
1110
1109
  re,
1111
1110
  {
@@ -1120,80 +1119,80 @@ const Bt = (a) => {
1120
1119
  backgroundColor: r.background,
1121
1120
  marginLeft: "10px"
1122
1121
  },
1123
- children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children: n })
1122
+ children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children: o })
1124
1123
  }
1125
1124
  );
1126
- }, Pt = (a) => {
1127
- const n = a.row.account, r = Ke[n.account_type];
1128
- return /* @__PURE__ */ s(g, { alignItems: "center", flexDirection: "row", children: [
1125
+ }, kt = (a) => {
1126
+ const o = a.row.account, r = Ke[o.account_type];
1127
+ return /* @__PURE__ */ s(w, { alignItems: "center", flexDirection: "row", children: [
1129
1128
  /* @__PURE__ */ e(
1130
1129
  De,
1131
1130
  {
1132
- alt: `${n.institutionName}`,
1133
- institutionGuid: n.institution_guid || ""
1131
+ alt: `${o.institutionName}`,
1132
+ institutionGuid: o.institution_guid || ""
1134
1133
  }
1135
1134
  ),
1136
- /* @__PURE__ */ s(g, { ml: 12, children: [
1137
- /* @__PURE__ */ e(l, { variant: "Small", children: n.name }),
1135
+ /* @__PURE__ */ s(w, { ml: 12, children: [
1136
+ /* @__PURE__ */ e(l, { variant: "Small", children: o.name }),
1138
1137
  /* @__PURE__ */ e(l, { variant: "XSmall", children: r })
1139
1138
  ] })
1140
1139
  ] });
1141
- }, kt = ({
1140
+ }, Nt = ({
1142
1141
  sx: a = {},
1143
- debts: n,
1142
+ debts: o,
1144
1143
  hoveredDebtGuid: r,
1145
1144
  onHoverRow: t,
1146
- onClickRow: o
1145
+ onClickRow: n
1147
1146
  }) => {
1148
- const i = X(), { onEvent: p } = k(), { isMobile: d } = Y(), { debts: c } = C(), [m, b] = x.useState([
1147
+ const i = X(), { onEvent: p } = F(), { isMobile: c } = Y(), { debts: d } = S(), [m, b] = x.useState([
1149
1148
  { field: "priority", sort: "asc" }
1150
1149
  ]), f = [
1151
1150
  {
1152
1151
  field: "priority",
1153
- headerName: c.table_column_priority,
1152
+ headerName: d.table_column_priority,
1154
1153
  renderHeader: z,
1155
- renderCell: Mt,
1156
- sortComparator: Et,
1154
+ renderCell: Pt,
1155
+ sortComparator: It,
1157
1156
  sortable: !0,
1158
1157
  hideSortIcons: !0,
1159
1158
  type: "custom",
1160
1159
  align: "left",
1161
1160
  headerAlign: "left",
1162
- minWidth: d ? 67 : 72,
1163
- flex: d ? 0.2 : 0.4
1161
+ minWidth: c ? 67 : 72,
1162
+ flex: c ? 0.2 : 0.4
1164
1163
  },
1165
1164
  {
1166
1165
  field: "account",
1167
- headerName: c.table_column_account,
1166
+ headerName: d.table_column_account,
1168
1167
  renderHeader: z,
1169
- renderCell: Pt,
1168
+ renderCell: kt,
1170
1169
  sortable: !1,
1171
1170
  type: "custom",
1172
1171
  align: "left",
1173
1172
  headerAlign: "left",
1174
- minWidth: d ? 180 : 225,
1173
+ minWidth: c ? 180 : 225,
1175
1174
  flex: 1
1176
1175
  },
1177
1176
  {
1178
1177
  field: "balance",
1179
- headerName: c.table_column_balance,
1178
+ headerName: d.table_column_balance,
1180
1179
  renderHeader: z,
1181
- renderCell: (_) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: M(_.value, "0,0") }),
1180
+ renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: k(y.value, "0,0") }),
1182
1181
  sortable: !0,
1183
- hideSortIcons: d,
1182
+ hideSortIcons: c,
1184
1183
  type: "number",
1185
- align: d ? "right" : "left",
1186
- headerAlign: d ? "right" : "left",
1187
- minWidth: d ? 70 : 122,
1188
- flex: d ? 0.4 : 0.6
1184
+ align: c ? "right" : "left",
1185
+ headerAlign: c ? "right" : "left",
1186
+ minWidth: c ? 70 : 122,
1187
+ flex: c ? 0.4 : 0.6
1189
1188
  },
1190
1189
  {
1191
1190
  field: "interest_rate",
1192
- headerName: c.table_column_interest_rate,
1191
+ headerName: d.table_column_interest_rate,
1193
1192
  renderHeader: z,
1194
- renderCell: (_) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: isNaN(_.value) ? "---" : `${Number(_.value).toFixed(2)}%` }),
1193
+ renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: isNaN(y.value) ? "---" : `${Number(y.value).toFixed(2)}%` }),
1195
1194
  sortable: !0,
1196
- hideSortIcons: d,
1195
+ hideSortIcons: c,
1197
1196
  type: "number",
1198
1197
  align: "left",
1199
1198
  headerAlign: "left",
@@ -1202,11 +1201,11 @@ const Bt = (a) => {
1202
1201
  },
1203
1202
  {
1204
1203
  field: "projected_payoff_date",
1205
- headerName: c.table_column_payoff_date,
1204
+ headerName: d.table_column_payoff_date,
1206
1205
  renderHeader: z,
1207
- renderCell: (_) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: _.value ? K(_.value, U.MONTH_SHORT_YEAR) : "---" }),
1206
+ renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: y.value ? K(y.value, U.MONTH_SHORT_YEAR) : "---" }),
1208
1207
  sortable: !0,
1209
- hideSortIcons: d,
1208
+ hideSortIcons: c,
1210
1209
  type: "number",
1211
1210
  align: "left",
1212
1211
  headerAlign: "left",
@@ -1215,11 +1214,11 @@ const Bt = (a) => {
1215
1214
  },
1216
1215
  {
1217
1216
  field: "monthly_payment",
1218
- headerName: c.table_column_amount_due,
1217
+ headerName: d.table_column_amount_due,
1219
1218
  renderHeader: z,
1220
- renderCell: (_) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: typeof _.value == "number" ? M(_.value, "0,0") : "---" }),
1219
+ renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: typeof y.value == "number" ? k(y.value, "0,0") : "---" }),
1221
1220
  sortable: !0,
1222
- hideSortIcons: d,
1221
+ hideSortIcons: c,
1223
1222
  type: "number",
1224
1223
  align: "left",
1225
1224
  headerAlign: "left",
@@ -1240,14 +1239,18 @@ const Bt = (a) => {
1240
1239
  headerAlign: "right",
1241
1240
  width: 20
1242
1241
  }
1243
- ], S = x.useMemo(() => n.map((_, v) => ({
1244
- ..._,
1245
- id: v,
1246
- priority: It(_)
1247
- })), [n]), P = (_) => {
1248
- const L = _.target.closest("[data-id]")?.getAttribute("data-id"), h = n[Number(L)];
1249
- t?.(h?.guid ?? "");
1250
- }, E = (_) => S.find((v) => v.guid === _)?.id;
1242
+ ], v = x.useMemo(() => o.map((y, N) => ({
1243
+ ...y,
1244
+ id: N,
1245
+ priority: Bt(y)
1246
+ })), [o]), M = (y) => {
1247
+ const g = y.target.closest("[data-id]")?.getAttribute("data-id"), A = o[Number(g)];
1248
+ t?.(A?.guid ?? "");
1249
+ }, I = (y) => {
1250
+ c || M(y);
1251
+ }, C = (y) => {
1252
+ c && M(y);
1253
+ }, B = (y) => v.find((N) => N.guid === y)?.id;
1251
1254
  return /* @__PURE__ */ e(
1252
1255
  re,
1253
1256
  {
@@ -1262,29 +1265,31 @@ const Bt = (a) => {
1262
1265
  children: /* @__PURE__ */ e(
1263
1266
  Ye,
1264
1267
  {
1265
- columns: d ? u : f,
1268
+ columns: c ? u : f,
1266
1269
  disableColumnFilter: !0,
1267
1270
  disableColumnMenu: !0,
1268
1271
  hideFooter: !0,
1269
1272
  initialState: { sorting: { sortModel: m } },
1270
- onRowClick: (_) => {
1271
- o(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid: _.row.guid });
1273
+ onRowClick: (y) => {
1274
+ n(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid: y.row.guid });
1272
1275
  },
1273
- onSortModelChange: (_) => {
1274
- b(_), p(T.DEBTS_CLICK_TABLE_SORT);
1276
+ onSortModelChange: (y) => {
1277
+ b(y), p(T.DEBTS_CLICK_TABLE_SORT);
1275
1278
  },
1276
- rows: S,
1279
+ rows: v,
1277
1280
  slotProps: {
1278
1281
  baseIconButton: { color: "secondary", sx: { ml: 8 } },
1279
1282
  row: {
1280
- onMouseEnter: P,
1281
- onMouseLeave: () => t?.("")
1283
+ onMouseEnter: I,
1284
+ onMouseLeave: () => !c && t?.(""),
1285
+ onTouchStart: C,
1286
+ onClick: c ? C : void 0
1282
1287
  }
1283
1288
  },
1284
1289
  sortModel: m,
1285
1290
  sortingOrder: ["asc", "desc"],
1286
1291
  sx: {
1287
- [`& .MuiDataGrid-row[data-id="${E(r)}"]`]: {
1292
+ [`& .MuiDataGrid-row[data-id="${B(r)}"]`]: {
1288
1293
  backgroundColor: i.palette.mode === "light" ? "#f8f9fb" : "#1f2329",
1289
1294
  filter: "brightness(98%)"
1290
1295
  }
@@ -1293,9 +1298,9 @@ const Bt = (a) => {
1293
1298
  )
1294
1299
  }
1295
1300
  );
1296
- }, Nt = ({ buttonText: a, isOpen: n, onClick: r }) => {
1297
- const { isDesktop: t, isTablet: o } = Y(), i = n ? "unfold_less" : "unfold_more";
1298
- return t || o ? /* @__PURE__ */ e(
1301
+ }, Ft = ({ buttonText: a, isOpen: o, onClick: r }) => {
1302
+ const { isDesktop: t, isTablet: n } = Y(), i = o ? "unfold_less" : "unfold_more";
1303
+ return t || n ? /* @__PURE__ */ e(
1299
1304
  fe,
1300
1305
  {
1301
1306
  "aria-controls": "prioritize-debts",
@@ -1318,25 +1323,25 @@ const Bt = (a) => {
1318
1323
  children: /* @__PURE__ */ e(ee, { name: i })
1319
1324
  }
1320
1325
  );
1321
- }, Ft = D(({ buttonEl: a, onClose: n }) => {
1322
- const { onEvent: r } = k(), { debts: t } = C(), { selectedDebtPriority: o, setSelectedDebtPriority: i } = R(), p = !!a, d = [
1326
+ }, Rt = D(({ buttonEl: a, onClose: o }) => {
1327
+ const { onEvent: r } = F(), { debts: t } = S(), { selectedDebtPriority: n, setSelectedDebtPriority: i } = $(), p = !!a, c = [
1323
1328
  {
1324
- priority: B.FASTEST_PAYOFF_FIRST,
1329
+ priority: P.FASTEST_PAYOFF_FIRST,
1325
1330
  text: t.priority_sort_fastest_payoff
1326
1331
  },
1327
1332
  {
1328
- priority: B.HIGHEST_INTEREST,
1333
+ priority: P.HIGHEST_INTEREST,
1329
1334
  text: t.priority_sort_highest_interest
1330
1335
  },
1331
1336
  {
1332
- priority: B.LOWEST_BALANCE,
1337
+ priority: P.LOWEST_BALANCE,
1333
1338
  text: t.priority_sort_lowest_balance
1334
1339
  },
1335
1340
  {
1336
- priority: B.HIGHEST_BALANCE,
1341
+ priority: P.HIGHEST_BALANCE,
1337
1342
  text: t.priority_sort_highest_balance
1338
1343
  }
1339
- ], c = (m) => {
1344
+ ], d = (m) => {
1340
1345
  i(m), r(T.DEBTS_CLICK_PRIORITY, { debts_priority: m });
1341
1346
  };
1342
1347
  return /* @__PURE__ */ e(
@@ -1348,19 +1353,19 @@ const Bt = (a) => {
1348
1353
  horizontal: "left"
1349
1354
  },
1350
1355
  id: "prioritize-debts",
1351
- onClose: n,
1356
+ onClose: o,
1352
1357
  open: p,
1353
1358
  transformOrigin: {
1354
1359
  vertical: "top",
1355
1360
  horizontal: "left"
1356
1361
  },
1357
- children: /* @__PURE__ */ e(_e, { children: d.map(({ priority: m, text: b }) => /* @__PURE__ */ s(
1362
+ children: /* @__PURE__ */ e(_e, { children: c.map(({ priority: m, text: b }) => /* @__PURE__ */ s(
1358
1363
  qe,
1359
1364
  {
1360
- onClick: () => c(m),
1365
+ onClick: () => d(m),
1361
1366
  sx: {
1362
- bgcolor: o === m ? "primary.main" : void 0,
1363
- color: o === m ? "#fff" : void 0,
1367
+ bgcolor: n === m ? "primary.main" : void 0,
1368
+ color: n === m ? "#fff" : void 0,
1364
1369
  justifyContent: "space-between",
1365
1370
  minHeight: 44,
1366
1371
  minWidth: 268,
@@ -1374,67 +1379,67 @@ const Bt = (a) => {
1374
1379
  },
1375
1380
  children: [
1376
1381
  /* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children: b }),
1377
- o === m && /* @__PURE__ */ e(ye, { color: "inherit", filled: !0, fontSize: "small" })
1382
+ n === m && /* @__PURE__ */ e(ye, { color: "inherit", filled: !0, fontSize: "small" })
1378
1383
  ]
1379
1384
  },
1380
1385
  m
1381
1386
  )) })
1382
1387
  }
1383
1388
  );
1384
- }), Rt = D(() => {
1385
- const { onEvent: a } = k(), { debts: n } = C(), { selectedDebtPriority: r } = R(), [t, o] = x.useState(null), i = (m) => {
1386
- o(m.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
1389
+ }), Lt = D(() => {
1390
+ const { onEvent: a } = F(), { debts: o } = S(), { selectedDebtPriority: r } = $(), [t, n] = x.useState(null), i = (m) => {
1391
+ n(m.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
1387
1392
  }, p = () => {
1388
- o(null);
1389
- }, d = !!t, c = x.useMemo(() => ({
1390
- [B.FASTEST_PAYOFF_FIRST]: n.priority_sort_fastest_payoff,
1391
- [B.HIGHEST_INTEREST]: n.priority_sort_highest_interest,
1392
- [B.HIGHEST_BALANCE]: n.priority_sort_highest_balance,
1393
- [B.LOWEST_BALANCE]: n.priority_sort_lowest_balance
1394
- })[r] ?? n.priority_sort_lowest_balance, [r]);
1395
- return /* @__PURE__ */ s(y, { children: [
1396
- /* @__PURE__ */ e(Nt, { buttonText: c, isOpen: d, onClick: i }),
1397
- /* @__PURE__ */ e(Ft, { buttonEl: t, onClose: p })
1393
+ n(null);
1394
+ }, c = !!t, d = x.useMemo(() => ({
1395
+ [P.FASTEST_PAYOFF_FIRST]: o.priority_sort_fastest_payoff,
1396
+ [P.HIGHEST_INTEREST]: o.priority_sort_highest_interest,
1397
+ [P.HIGHEST_BALANCE]: o.priority_sort_highest_balance,
1398
+ [P.LOWEST_BALANCE]: o.priority_sort_lowest_balance
1399
+ })[r] ?? o.priority_sort_lowest_balance, [r]);
1400
+ return /* @__PURE__ */ s(_, { children: [
1401
+ /* @__PURE__ */ e(Ft, { buttonText: d, isOpen: c, onClick: i }),
1402
+ /* @__PURE__ */ e(Rt, { buttonEl: t, onClose: p })
1398
1403
  ] });
1399
- }), Lt = (a, n, r = 0) => {
1400
- const t = a.map((c) => ({ ...c }));
1401
- xe(t, n);
1402
- const o = /* @__PURE__ */ new Date(), i = [];
1403
- let p = 0, d = 1;
1404
- for (const c of t)
1404
+ }), $t = (a, o, r = 0) => {
1405
+ const t = a.map((d) => ({ ...d }));
1406
+ ge(t, o);
1407
+ const n = /* @__PURE__ */ new Date(), i = [];
1408
+ let p = 0, c = 1;
1409
+ for (const d of t)
1405
1410
  i.push({
1406
- ...c,
1411
+ ...d,
1407
1412
  // Start with the initial balance
1408
- dataset: [{ x: new Date(o), y: c.balance }]
1413
+ dataset: [{ x: new Date(n), y: d.balance }]
1409
1414
  });
1410
- for (; t.some((c) => c.balance >= 0.01 && !c.is_impossible); ) {
1411
- let c = !1, m = !1, b = !1;
1415
+ for (; t.some((d) => d.balance >= 0.01 && !d.is_impossible); ) {
1416
+ let d = !1, m = !1, b = !1;
1412
1417
  for (const [f, u] of t.entries()) {
1413
1418
  if (u.balance <= 0.01) continue;
1414
- const S = i[f].dataset, E = (u.interest_rate ?? 0) / 100 / 12, _ = u.balance * E, v = u.monthly_payment ?? 0;
1415
- let H = v, L = 0;
1416
- !b && r > 0 && (H += r, b = !0), !m && p > 0 && (L = p, m = !0), u.balance += _;
1417
- const h = Math.min(u.balance, H + L);
1418
- if (h <= _) {
1419
- u.is_impossible = !0, i[f].is_impossible = !0, i[f].priority = void 0, S.push({ x: new Date(o), y: u.balance });
1419
+ const v = i[f].dataset, I = (u.interest_rate ?? 0) / 100 / 12, C = u.balance * I, B = u.monthly_payment ?? 0;
1420
+ let y = B, N = 0;
1421
+ !b && r > 0 && (y += r, b = !0), !m && p > 0 && (N = p, m = !0), u.balance += C;
1422
+ const h = Math.min(u.balance, y + N);
1423
+ if (h <= C) {
1424
+ u.is_impossible = !0, i[f].is_impossible = !0, i[f].priority = void 0, v.push({ x: new Date(n), y: u.balance });
1420
1425
  continue;
1421
1426
  }
1422
- u.balance -= h, u.balance = u.balance < 0.01 ? 0 : u.balance, S.push({
1423
- x: new Date(o),
1427
+ u.balance -= h, u.balance = u.balance < 0.01 ? 0 : u.balance, v.push({
1428
+ x: new Date(n),
1424
1429
  y: Math.max(0, u.balance),
1425
1430
  payment: h,
1426
- extra: L
1427
- }), u.balance <= 0 && (p += v, i[f].projected_payoff_date = new Date(o)), h > 0 && (c = !0);
1431
+ extra: N
1432
+ }), u.balance <= 0 && (p += B, i[f].projected_payoff_date = new Date(n)), h > 0 && (d = !0);
1428
1433
  }
1429
- c && o.setMonth(o.getMonth() + 1);
1434
+ d && n.setMonth(n.getMonth() + 1);
1430
1435
  }
1431
- return i.forEach((c) => {
1432
- (c.interest_rate === void 0 || c.monthly_payment === void 0) && (c.projected_payoff_date = void 0);
1433
- }), i.forEach((c) => {
1434
- c.priority = !c.is_paid_off && !c.is_impossible ? d++ : void 0;
1436
+ return i.forEach((d) => {
1437
+ (d.interest_rate === void 0 || d.monthly_payment === void 0) && (d.projected_payoff_date = void 0);
1438
+ }), i.forEach((d) => {
1439
+ d.priority = !d.is_paid_off && !d.is_impossible ? c++ : void 0;
1435
1440
  }), i;
1436
- }, $t = D(({ onClick: a }) => {
1437
- const { debts: n } = C(), { isDesktop: r } = Y(), { totalMonthlyPayments: t } = q(), { monthlyCashFlowProfile: o } = V(), i = t + Number(o?.extra_payment), p = r ? n.paydown_button_long : n.paydown_button_short;
1441
+ }, Ht = D(({ onClick: a }) => {
1442
+ const { debts: o } = S(), { isDesktop: r } = Y(), { totalMonthlyPayments: t } = q(), { monthlyCashFlowProfile: n } = V(), i = t + Number(n?.extra_payment), p = r ? o.paydown_button_long : o.paydown_button_short;
1438
1443
  return /* @__PURE__ */ e(
1439
1444
  fe,
1440
1445
  {
@@ -1444,45 +1449,50 @@ const Bt = (a) => {
1444
1449
  "aria-label": "extra-paydown",
1445
1450
  onClick: a,
1446
1451
  sx: { justifyContent: "start", minWidth: 100, mx: 4 },
1447
- children: A(p, M(i, "0,0"))
1452
+ children: E(p, k(i, "0,0"))
1448
1453
  }
1449
1454
  );
1450
- }), Ht = ({ onBackClick: a, sx: n }) => {
1451
- const [r, t] = x.useState(!1), [o, i] = x.useState(!1), [p, d] = x.useState(!1), [c, m] = x.useState(""), { isDesktop: b, isMobile: f } = Y(), { debts: u } = C(), { onEvent: S } = k(), { isCopyLoaded: P, isInitialized: E, setSelectedAccounts: _ } = Pe(), { setSelectedAccount: v } = Ne(), { selectedDebtPriority: H, setSelectedDebtChartData: L } = R(), { visibleDebtAccounts: h } = Z(), { goalsLoaded: w, loadGoals: I, monthlyCashFlowProfile: N } = V(), { debts: F } = q(), O = x.useMemo(() => {
1452
- const W = N?.extra_payment ?? 0;
1453
- return Lt(F, H, W);
1454
- }, [F, H, N]);
1455
+ }), Ot = ({ onBackClick: a, sx: o }) => {
1456
+ const [r, t] = x.useState(!1), [n, i] = x.useState(!1), [p, c] = x.useState(!1), [d, m] = x.useState(""), { isDesktop: b, isMobile: f } = Y(), { debts: u } = S(), { onEvent: v } = F(), { isCopyLoaded: M, isInitialized: I, setSelectedAccounts: C } = Pe(), { setSelectedAccount: B } = Ne(), { selectedDebtPriority: y, setSelectedDebtChartData: N } = $(), { visibleDebtAccounts: h } = Z(), { goalsLoaded: g, loadGoals: A, monthlyCashFlowProfile: R } = V(), { debts: L } = q();
1457
+ Je({
1458
+ widgetName: "DebtsWidget",
1459
+ isLoaded: g
1460
+ });
1461
+ const O = x.useMemo(() => {
1462
+ const W = R?.extra_payment ?? 0;
1463
+ return $t(L, y, W);
1464
+ }, [L, y, R]);
1455
1465
  x.useEffect(() => {
1456
- _(h), S(T.DEBTS_VIEW);
1466
+ C(h), v(T.DEBTS_VIEW);
1457
1467
  }, []), x.useEffect(() => {
1458
- _(h);
1468
+ C(h);
1459
1469
  }, [h]), x.useEffect(() => {
1460
- E && I().finally();
1461
- }, [E]);
1462
- const ne = (W) => m(W), oe = () => {
1463
- const W = h.find((Q) => Q.guid === c), ie = O.find((Q) => Q.guid === c);
1464
- W && v(W), ie && L(ie), t(!0);
1465
- }, we = () => S(T.DEBTS_CLICK_FILTER), Ce = () => {
1466
- d(!0), S(T.DEBTS_CLICK_SNOWBALL_CTA);
1470
+ I && A().finally();
1471
+ }, [I]);
1472
+ const oe = (W) => m(W), ne = () => {
1473
+ const W = h.find((Q) => Q.guid === d), ie = O.find((Q) => Q.guid === d);
1474
+ W && B(W), ie && N(ie), t(!0);
1475
+ }, we = () => v(T.DEBTS_CLICK_FILTER), Ce = () => {
1476
+ c(!0), v(T.DEBTS_CLICK_SNOWBALL_CTA);
1467
1477
  }, Se = () => {
1468
- i(!0), S(T.DEBTS_CLICK_PAYDOWN);
1478
+ i(!0), v(T.DEBTS_CLICK_PAYDOWN);
1469
1479
  };
1470
- return !w || !P || !E ? /* @__PURE__ */ e(Je, {}) : /* @__PURE__ */ s(
1480
+ return !g || !M || !I ? /* @__PURE__ */ e(Qe, {}) : /* @__PURE__ */ s(
1471
1481
  Oe,
1472
1482
  {
1473
1483
  accountOptions: h,
1474
1484
  actions: [
1475
- /* @__PURE__ */ e(Rt, {}, "prioritize-debts"),
1476
- /* @__PURE__ */ e($t, { onClick: Se }, "extra-paydown")
1485
+ /* @__PURE__ */ e(Lt, {}, "prioritize-debts"),
1486
+ /* @__PURE__ */ e(Ht, { onClick: Se }, "extra-paydown")
1477
1487
  ],
1478
1488
  onAccountsFilterClick: we,
1479
1489
  onBackClick: a,
1480
- sx: n,
1490
+ sx: o,
1481
1491
  title: u.title,
1482
1492
  children: [
1483
- /* @__PURE__ */ s(g, { sx: { px: b ? "48px" : "24px" }, children: [
1493
+ /* @__PURE__ */ s(w, { sx: { px: b ? "48px" : "24px" }, children: [
1484
1494
  /* @__PURE__ */ s(
1485
- g,
1495
+ w,
1486
1496
  {
1487
1497
  sx: {
1488
1498
  alignItems: f ? "flex-start" : "flex-end",
@@ -1491,18 +1501,18 @@ const Bt = (a) => {
1491
1501
  },
1492
1502
  children: [
1493
1503
  /* @__PURE__ */ e(
1494
- ge,
1504
+ xe,
1495
1505
  {
1496
1506
  debts: O,
1497
1507
  height: f ? 250 : void 0,
1498
- hoveredDebtGuid: c,
1499
- onClickArea: oe,
1500
- onHoverArea: ne,
1508
+ hoveredDebtGuid: d,
1509
+ onClickArea: ne,
1510
+ onHoverArea: oe,
1501
1511
  sx: { mr: f ? "4px" : "-48px" }
1502
1512
  }
1503
1513
  ),
1504
1514
  /* @__PURE__ */ e(
1505
- ot,
1515
+ it,
1506
1516
  {
1507
1517
  debts: O,
1508
1518
  onClickCta: Ce,
@@ -1512,32 +1522,32 @@ const Bt = (a) => {
1512
1522
  ]
1513
1523
  }
1514
1524
  ),
1515
- /* @__PURE__ */ e(g, { sx: { mx: f ? "-24px" : 0 }, children: /* @__PURE__ */ e(
1516
- kt,
1525
+ /* @__PURE__ */ e(w, { sx: { mx: f ? "-24px" : 0 }, children: /* @__PURE__ */ e(
1526
+ Nt,
1517
1527
  {
1518
1528
  debts: O,
1519
- hoveredDebtGuid: c,
1520
- onClickRow: oe,
1521
- onHoverRow: ne
1529
+ hoveredDebtGuid: d,
1530
+ onClickRow: ne,
1531
+ onHoverRow: oe
1522
1532
  }
1523
1533
  ) })
1524
1534
  ] }),
1525
1535
  /* @__PURE__ */ e(
1526
- lt,
1536
+ st,
1527
1537
  {
1528
1538
  isOpen: p,
1529
- onClose: () => d(!1)
1539
+ onClose: () => c(!1)
1530
1540
  }
1531
1541
  ),
1532
- /* @__PURE__ */ e(St, { isOpen: r, onClose: () => t(!1) }),
1533
- /* @__PURE__ */ e(At, { isOpen: o, onClose: () => i(!1) })
1542
+ /* @__PURE__ */ e(vt, { isOpen: r, onClose: () => t(!1) }),
1543
+ /* @__PURE__ */ e(Et, { isOpen: n, onClose: () => i(!1) })
1534
1544
  ]
1535
1545
  }
1536
1546
  );
1537
- }, Pr = D(Ht);
1547
+ }, Nr = D(Ot);
1538
1548
  export {
1539
- ge as DebtsChart,
1540
- Fr as DebtsStore,
1541
- kt as DebtsTable,
1542
- Pr as DebtsWidget
1549
+ xe as DebtsChart,
1550
+ Lr as DebtsStore,
1551
+ Nt as DebtsTable,
1552
+ Nr as DebtsWidget
1543
1553
  };