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

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 (219) hide show
  1. package/CHANGELOG.md +128 -1
  2. package/dist/{Account-Bxw0_4FU.mjs → Account-B4CDD-zq.mjs} +1 -1
  3. package/dist/AccountDetailsContent-adZTkM52.mjs +683 -0
  4. package/dist/AccountDetailsHeader-DRjFuyJT.mjs +87 -0
  5. package/dist/{AccountFields-C9FlatNb.mjs → AccountFields-Cl4KHoSj.mjs} +14 -12
  6. package/dist/AccountListItem-wgmlex-_.mjs +90 -0
  7. package/dist/{AccountStore-BgNOyMdp.mjs → AccountStore-HbVblv86.mjs} +19 -8
  8. package/dist/{Accounts-BRf_YeTf.mjs → Accounts-CRUehOiy.mjs} +1 -1
  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-Jv8h9H9l.mjs} +33 -33
  12. package/dist/{CashflowStore-D9Dpuz7X.mjs → CashflowStore-CA190BPF.mjs} +18 -25
  13. package/dist/{Category-CevNQ03n.mjs → Category-Ccoew_sA.mjs} +2 -2
  14. package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-Dl006GKy.mjs} +43 -41
  15. package/dist/{CategoryStore-yHI0hWmK.mjs → CategoryStore-MUwRWH9e.mjs} +13 -11
  16. package/dist/{CategoryUtil-pZRIYOgN.mjs → CategoryUtil-DfVKKkRf.mjs} +4 -4
  17. package/dist/{ConnectDrawer-BQNs-hjk.mjs → ConnectDrawer-DVp54lUH.mjs} +49 -48
  18. package/dist/{ConnectionsDrawer-ByGQE7D5.mjs → ConnectionsDrawer-Dsc04-4Z.mjs} +3 -3
  19. package/dist/CurrencyInput-D1cjbdCI.mjs +85 -0
  20. package/dist/{CurrencyText-kyC1aseI.mjs → CurrencyText-Dr0EZ7bp.mjs} +1 -1
  21. package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CDPZw_-m.mjs} +3 -3
  22. package/dist/{DebtsStore-C9bblOgW.mjs → DebtsStore-pL63fmdT.mjs} +3 -3
  23. package/dist/{Dialog-CWW597AF.mjs → Dialog-CDV0kKxj.mjs} +24 -24
  24. package/dist/{Donut-oaQFlbit.mjs → Donut-Dmy3JTWd.mjs} +12 -12
  25. package/dist/Drawer-BF40nbsH.mjs +163 -0
  26. package/dist/{EmptyState-DA_lfRBv.mjs → EmptyState-DoxNUae-.mjs} +24 -22
  27. package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-QhQK4_FU.mjs} +4 -4
  28. package/dist/{Fetch-87LIQbEA.mjs → Fetch-DecPFeGU.mjs} +24 -22
  29. package/dist/FinstrongStore-BGf36b0z.mjs +451 -0
  30. package/dist/{GoalStore-D-aB35SY.mjs → GoalStore-C1-w3Y1E.mjs} +7 -7
  31. package/dist/HeaderCell-P8w6CmfO.mjs +6 -0
  32. package/dist/{Help-B6dIcujh.mjs → Help-DBfsTkAi.mjs} +125 -146
  33. package/dist/{Help-DhcC-C05.mjs → Help-c-zHlDbv.mjs} +8 -8
  34. package/dist/{IconBacking-B9oC6uL2.mjs → IconBacking-DgT8DCeh.mjs} +11 -11
  35. package/dist/LineChart-C1PxNf7P.mjs +581 -0
  36. package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-BNCWQAN_.mjs} +10 -10
  37. package/dist/Loader-Ckqi9Rx6.mjs +21 -0
  38. package/dist/{ManageIncome-1s_q5W4X.mjs → ManageIncome-8EsStyIQ.mjs} +195 -192
  39. package/dist/{MerchantStore-DrFvsUyy.mjs → MerchantStore-WvZ4gnQe.mjs} +1 -1
  40. package/dist/MicroWidgetContainer-BGpNl5ZS.mjs +45 -0
  41. package/dist/MiniWidgetContainer-CKzf_Ira.mjs +56 -0
  42. package/dist/{NetWorthStore-DCsTZpuS.mjs → NetWorthStore-Bti6u-d9.mjs} +4 -4
  43. package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-B74rQVYC.mjs} +276 -273
  44. package/dist/{NotificationStore-BxP_P2dA.mjs → NotificationStore-Ck2KdNmT.mjs} +10 -10
  45. package/dist/{NumberFormatting-Buh7u8Oi.mjs → NumberFormatting-DjTD0t3W.mjs} +9 -9
  46. package/dist/{OriginalBalanceAction-CWuVvRq9.mjs → OriginalBalanceAction-2Y_3U_mg.mjs} +10 -10
  47. package/dist/{RecurringSettings-A_rAGCTP.mjs → RecurringSettings-DAncu--R.mjs} +17 -17
  48. package/dist/{RecurringTransactions-DK8dWldr.mjs → RecurringTransactions-CxcSL1dY.mjs} +106 -105
  49. package/dist/{RecurringTransactionsStore-C4YOD7_D.mjs → RecurringTransactionsStore-CNFxyGB6.mjs} +80 -73
  50. package/dist/{ResponsiveButton-DZFp78fJ.mjs → ResponsiveButton-Cn6-R7ue.mjs} +10 -10
  51. package/dist/SearchBox-B7km148n.mjs +39 -0
  52. package/dist/{SettingsStore-BcgS_Ohv.mjs → SettingsStore-BASMQSIp.mjs} +3 -3
  53. package/dist/{SingleSegmentDonut-BgbLgwHi.mjs → SingleSegmentDonut-7Uy6VEld.mjs} +6 -6
  54. package/dist/SkeletonLoader-BaNboJjD.mjs +38 -0
  55. package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-DPQ96k3x.mjs} +19 -19
  56. package/dist/SpendingLegend-6FqtMcBV.mjs +193 -0
  57. package/dist/{StatusBar-BK_uYHAB.mjs → StatusBar-CPfSXe80.mjs} +6 -6
  58. package/dist/{TabContentContainer-j01JYR_7.mjs → TabContentContainer-CnMXkVqr.mjs} +8 -8
  59. package/dist/{ToggleListItem-r0Kx56wF.mjs → ToggleListItem-ciFTiqRS.mjs} +19 -14
  60. package/dist/TransactionApi-CjBoLleL.mjs +86 -0
  61. package/dist/TransactionDetails-Bn0qY5Hw.mjs +1336 -0
  62. package/dist/{TransactionStore-ai3uII_r.mjs → TransactionStore-DbwAutwC.mjs} +146 -165
  63. package/dist/TrendsStore-_mRaFUdf.mjs +182 -0
  64. package/dist/{User-BQUxBeZV.mjs → User-BklmOUSd.mjs} +107 -107
  65. package/dist/{ViewMoreMicroCard-SCn2wt4i.mjs → ViewMoreMicroCard-DAkyNRlD.mjs} +706 -729
  66. package/dist/{WidgetContainer-BHWANqT4.mjs → WidgetContainer-CDh9fjpR.mjs} +36 -36
  67. package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
  68. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +4 -1
  69. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +2 -1
  70. package/dist/accounts/index.es.js +228 -221
  71. package/dist/accounts/stores/AccountStore.d.ts +2 -0
  72. package/dist/analytics/index.es.js +27 -27
  73. package/dist/budgets/index.es.js +459 -462
  74. package/dist/cashflow/index.es.js +419 -428
  75. package/dist/categories/index.es.js +2 -2
  76. package/dist/categories/stores/CategoryStore.d.ts +1 -1
  77. package/dist/common/components/ErrorBoundary.d.ts +1 -1
  78. package/dist/common/components/Loader.d.ts +1 -2
  79. package/dist/common/components/Select.d.ts +4 -2
  80. package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +1 -1
  81. package/dist/common/components/charts/LineChart.d.ts +12 -2
  82. package/dist/common/components/charts/index.d.ts +0 -3
  83. package/dist/common/components/charts/linechart/CustomLegend.d.ts +3 -1
  84. package/dist/common/components/charts/linechart/CustomMark.d.ts +5 -1
  85. package/dist/common/components/drawer/Drawer.d.ts +3 -0
  86. package/dist/common/components/drawer/Footer.d.ts +17 -0
  87. package/dist/common/components/index.d.ts +0 -1
  88. package/dist/common/hooks/index.d.ts +0 -1
  89. package/dist/common/hooks/useAriaLive.d.ts +1 -1
  90. package/dist/common/index.es.js +402 -668
  91. package/dist/common/stores/GlobalStore.d.ts +7 -1
  92. package/dist/common/types/Finstrong.d.ts +54 -0
  93. package/dist/common/types/Global.d.ts +1 -0
  94. package/dist/common/types/Widgets.d.ts +1 -0
  95. package/dist/common/types/index.d.ts +1 -1
  96. package/dist/common/types/localization/FinstrongCopy.d.ts +105 -2
  97. package/dist/common/types/localization/GoalsCopy.d.ts +1 -0
  98. package/dist/common/utils/Theme.d.ts +1 -3
  99. package/dist/dashboard/index.es.js +21 -21
  100. package/dist/debts/components/DebtsChart.d.ts +1 -2
  101. package/dist/debts/index.es.js +673 -665
  102. package/dist/exportTransactionsToCSV-BgV_wTLT.mjs +48 -0
  103. package/dist/finstrong/FinstrongWidget.d.ts +1 -1
  104. package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
  105. package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
  106. package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
  107. package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
  108. package/dist/finstrong/components/FinancialStrengthGraph.d.ts +7 -1
  109. package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
  110. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
  111. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
  112. package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
  113. package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
  114. package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
  115. package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
  116. package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
  117. package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
  118. package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
  119. package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
  120. package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
  121. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
  122. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
  123. package/dist/finstrong/components/ProgressBar.d.ts +15 -0
  124. package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
  125. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
  126. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
  127. package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
  128. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
  129. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
  130. package/dist/finstrong/components/StatusChip.d.ts +5 -0
  131. package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
  132. package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +17 -0
  133. package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
  134. package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
  135. package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
  136. package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
  137. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
  138. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
  139. package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
  140. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +25 -0
  141. package/dist/finstrong/components/shared/DialScoreCard.d.ts +7 -1
  142. package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
  143. package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
  144. package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
  145. package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
  146. package/dist/finstrong/constants/index.d.ts +9 -0
  147. package/dist/finstrong/index.es.js +3175 -1067
  148. package/dist/finstrong/stores/FinstrongStore.d.ts +25 -2
  149. package/dist/finstrong/util/finstrongUtils.d.ts +58 -1
  150. package/dist/goals/index.es.js +580 -570
  151. package/dist/help/components/content/BottomImageContent.d.ts +1 -1
  152. package/dist/help/components/content/LeftImageContent.d.ts +1 -1
  153. package/dist/help/components/content/RightImageContent.d.ts +1 -1
  154. package/dist/help/components/content/TopImageContent.d.ts +1 -1
  155. package/dist/help/index.es.js +6 -6
  156. package/dist/{hooks-D6XlXHf4.mjs → hooks-C41HAxM5.mjs} +3 -3
  157. package/dist/insights/index.es.js +1 -1
  158. package/dist/investments/index.es.js +537 -536
  159. package/dist/merchants/index.es.js +9 -9
  160. package/dist/microinsights/beaticons/BeatIcon.d.ts +2 -9
  161. package/dist/microinsights/beaticons/BeatMerchantLogo.d.ts +3 -2
  162. package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +2 -1
  163. package/dist/microinsights/cards/{MicroInsightCard.d.ts → BaseCard.d.ts} +1 -8
  164. package/dist/microinsights/cards/{BeatCard.d.ts → InsightCard.d.ts} +2 -2
  165. package/dist/microinsights/cards/NoRelevantInsightsCard.d.ts +2 -5
  166. package/dist/microinsights/cards/ZeroStateCard.d.ts +2 -5
  167. package/dist/microinsights/carousel/BeatList.d.ts +10 -0
  168. package/dist/microinsights/carousel/CarouselControls.d.ts +1 -3
  169. package/dist/microinsights/carousel/CarouselHeader.d.ts +1 -2
  170. package/dist/microinsights/constants/App.d.ts +0 -1
  171. package/dist/microinsights/index.d.ts +3 -3
  172. package/dist/microinsights/index.es.js +7 -7
  173. package/dist/microinsights/interfaces.d.ts +0 -6
  174. package/dist/networth/components/NetWorthChange.d.ts +3 -1
  175. package/dist/networth/index.es.js +262 -254
  176. package/dist/notifications/index.es.js +90 -91
  177. package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +3 -0
  178. package/dist/recurringtransactions/index.es.js +586 -562
  179. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +1 -0
  180. package/dist/settings/index.es.js +371 -365
  181. package/dist/spending/index.es.js +267 -419
  182. package/dist/spending/utils/SpendingData.d.ts +2 -1
  183. package/dist/transactions/components/shared/TransactionDetails.d.ts +1 -0
  184. package/dist/transactions/components/shared/TransactionList.d.ts +1 -0
  185. package/dist/transactions/index.es.js +231 -226
  186. package/dist/transactions/stores/TransactionStore.d.ts +1 -1
  187. package/dist/transactions/stores/UiStore.d.ts +0 -2
  188. package/dist/trends/index.es.js +988 -612
  189. package/dist/{useAccountDisplayName-BUAApBIb.mjs → useAccountDisplayName-CcIp09Xc.mjs} +2 -2
  190. package/dist/{useCombineEvents-BUDIR1ba.mjs → useCombineEvents-kNzLTWCp.mjs} +3 -3
  191. package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-CNjP5cfR.mjs} +1 -1
  192. package/dist/{useScreenSize-B6JyS_Lj.mjs → useScreenSize-B5afALev.mjs} +1 -1
  193. package/package.json +51 -56
  194. package/dist/AccountDetailsContent-CAM9y39M.mjs +0 -679
  195. package/dist/AccountDetailsHeader-JtSX6Uf9.mjs +0 -120
  196. package/dist/AccountListItem-JFMZROh7.mjs +0 -90
  197. package/dist/CurrencyInput-DUsQbkXb.mjs +0 -85
  198. package/dist/Drawer-kEE73B87.mjs +0 -113
  199. package/dist/FinstrongStore-F2c607dj.mjs +0 -101
  200. package/dist/HeaderCell-DjuifqHJ.mjs +0 -6
  201. package/dist/LineChart-D4GI7nVh.mjs +0 -541
  202. package/dist/Loader-DUaFpDGv.mjs +0 -24
  203. package/dist/MicroWidgetContainer-DpeqN9n3.mjs +0 -45
  204. package/dist/MiniWidgetContainer-D0gfmbaF.mjs +0 -56
  205. package/dist/SearchBox-B2_zLv8-.mjs +0 -42
  206. package/dist/TransactionApi-B3Tksf7L.mjs +0 -86
  207. package/dist/TransactionDetails-oP1eSuiS.mjs +0 -1334
  208. package/dist/TrendsStore-DCYbpXPO.mjs +0 -559
  209. package/dist/common/components/barchart/Bar.d.ts +0 -25
  210. package/dist/common/components/barchart/BarChart.d.ts +0 -34
  211. package/dist/common/components/barchart/BarColumn.d.ts +0 -37
  212. package/dist/common/components/barchart/Legend.d.ts +0 -8
  213. package/dist/common/components/barchart/Util.d.ts +0 -42
  214. package/dist/common/components/barchart/index.d.ts +0 -1
  215. package/dist/common/hooks/usePrevious.d.ts +0 -2
  216. package/dist/exportTransactionsToCSV-7bVS7KXf.mjs +0 -47
  217. package/dist/finstrong/utils/Finstrong.d.ts +0 -6
  218. package/dist/transactions/components/shared/transactionlist/DateRow.d.ts +0 -7
  219. package/dist/useAriaLive-B3_pRUio.mjs +0 -35
@@ -1,218 +1,38 @@
1
- import { jsxs as h, jsx as t, Fragment as mt } from "react/jsx-runtime";
2
- import p from "react";
3
- import { observer as v } from "mobx-react-lite";
1
+ import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
+ import i from "react";
3
+ import { observer as w } from "mobx-react-lite";
4
4
  import { startOfMonth as nt } from "date-fns/startOfMonth";
5
5
  import { endOfMonth as ot } from "date-fns/endOfMonth";
6
- import x from "@mui/material/Box";
7
- import C from "@mui/material/Stack";
8
- import N from "@mui/material/Tab";
6
+ import v from "@mui/material/Box";
7
+ import b from "@mui/material/Stack";
8
+ import k from "@mui/material/Tab";
9
9
  import at from "@mui/material/Tabs";
10
- import ht from "@mui/material/styles/useTheme";
11
- import { b as V } from "../CategoryUtil-pZRIYOgN.mjs";
12
- import { b as S } from "../Category-CevNQ03n.mjs";
13
- import { Text as y, CategoryIcon as ft, CategoryIconVariants as yt } from "@mxenabled/mxui";
14
- import { f as w } from "../NumberFormatting-Buh7u8Oi.mjs";
15
- import { u as bt } from "../useAriaLive-B3_pRUio.mjs";
16
- import Ct from "@mui/material/Button";
17
- import { useTheme as it } from "@mui/material";
18
- import { u as I, b as R, m as z, d as rt, a as st, h as _t, g as St } from "../hooks-D6XlXHf4.mjs";
19
- import { u as lt } from "../useScreenSize-B6JyS_Lj.mjs";
20
- import { D as Tt } from "../Donut-oaQFlbit.mjs";
21
- import { L as F } from "../Loader-DUaFpDGv.mjs";
22
- import { M as Mt } from "../MiniWidgetContainer-D0gfmbaF.mjs";
23
- import { startOfToday as U } from "date-fns/startOfToday";
24
- import { T as Dt, a as xt } from "../TransactionDetails-oP1eSuiS.mjs";
25
- import wt from "@mui/material/Collapse";
26
- import B from "@mui/material/Divider";
27
- import q from "@mui/material/List";
28
- import J from "@mui/material/ListItem";
29
- import vt from "@mui/material/ListItemButton";
30
- import { D as Q } from "../Drawer-kEE73B87.mjs";
31
- import { A as Z, W as It } from "../WidgetContainer-BHWANqT4.mjs";
32
- const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
33
- if (a.total > 0) {
34
- const i = n.find((s) => s.guid === a.category_guid);
35
- if (!i) return l;
36
- const o = i.parent_guid ?? i.guid, e = n.find((s) => s.guid === o);
37
- if (!e) return l;
38
- const d = {
39
- guid: i.guid,
40
- name: i.guid === o ? `General ${i.name}` : i.name,
41
- color: V(e.guid, c),
42
- amount: a.total
43
- }, u = l.find((s) => s.guid === o);
44
- u ? (u.amount += a.total, u.categoryTotals?.push(d)) : l.push({
45
- guid: o,
46
- name: e.name,
47
- color: V(e.guid, c),
48
- categoryTotals: [d],
49
- amount: a.total
50
- });
51
- }
52
- return l;
53
- }, []), ct = (n, c, r, l) => {
54
- const a = Et(n, r, l), i = a.filter(
55
- (s) => s.guid !== S.INCOME && s.guid !== S.INVESTMENTS && s.guid !== S.TRANSFER
56
- ).sort((s, m) => m.amount - s.amount), o = i.reduce(
57
- (s, m) => s + m.amount,
58
- 0
59
- ), e = i.length > j ? j : i.length, d = i.slice(0, e), u = d.map((s) => ({
60
- id: s.guid,
61
- color: V(s.guid, r),
62
- label: s.name,
63
- value: s.amount / o * 100
64
- }));
65
- if (i.length > 5) {
66
- const s = i.slice(j, a.length), m = s.reduce(
67
- (T, g) => T + g.amount,
68
- 0
69
- );
70
- d.push({
71
- guid: "other",
72
- color: r.palette.categories.others || "",
73
- name: c.saving_goal_other,
74
- categoryTotals: s,
75
- amount: m
76
- }), u.push({
77
- id: "other",
78
- color: r.palette.categories.others || "",
79
- label: c.saving_goal_other,
80
- value: m / o * 100
81
- });
82
- }
83
- return {
84
- categoryData: d,
85
- donutData: u,
86
- totalAmount: o
87
- };
88
- }, dt = (n, c, r) => {
89
- const l = n.filter(
90
- (e) => e.guid === S.INCOME || e.parent_guid === S.INCOME
91
- ), a = c.filter((e) => l.some((d) => d.guid === e.category_guid)).sort((e, d) => e.total - d.total).map((e, d) => ({
92
- guid: e.category_guid,
93
- name: n.find((u) => u.guid === e.category_guid)?.name,
94
- color: r[d],
95
- categoryTotals: [],
96
- amount: Math.abs(e.total)
97
- })), i = a.reduce(
98
- (e, d) => e + d.amount,
99
- 0
100
- ), o = a.map((e) => ({
101
- id: e.guid,
102
- color: e.color,
103
- label: e.name,
104
- value: e.amount / i * 100
105
- }));
106
- return {
107
- categoryData: a,
108
- donutData: o,
109
- totalAmount: i
110
- };
111
- }, W = ({ amount: n, label: c }) => /* @__PURE__ */ h(C, { direction: "column", children: [
112
- /* @__PURE__ */ t(y, { bold: !0, sx: { textTransform: "none" }, variant: "Body", children: c }),
113
- /* @__PURE__ */ t(y, { variant: "XSmall", children: w(n, "0,0") })
114
- ] }), At = ({
115
- data: n,
116
- isIncome: c = !1,
117
- onSelected: r,
118
- onViewTransactions: l,
119
- selectedId: a,
120
- size: i = 150,
121
- totalLabel: o,
122
- variant: e = "mini"
123
- }) => {
124
- const { spending: d } = I(), u = it(), { isTablet: s } = lt(), { announce: m, ariaLive: T } = bt(), g = p.useMemo(
125
- () => a ? n.categoryData.find((D) => D.guid === a) : void 0,
126
- [a]
127
- );
128
- p.useEffect(() => {
129
- if (g) {
130
- const D = w(g.amount, "0,0");
131
- m(`${g.name}: ${D}`);
132
- }
133
- }, [g, m]);
134
- const b = p.useMemo(() => n.donutData.length > 0 ? n.donutData : [{ id: "0", color: u.palette.divider, value: 100 }], [n, u]), E = () => {
135
- l?.(a);
136
- }, _ = s ? 32 : 48;
137
- return /* @__PURE__ */ h(mt, { children: [
138
- T,
139
- /* @__PURE__ */ t(Tt, { data: b, onClick: r, selectedId: a, size: i, children: /* @__PURE__ */ t(C, { alignItems: "center", height: "100%", justifyContent: "center", width: "100%", children: /* @__PURE__ */ h(C, { alignItems: "center", justifyContent: "center", minHeight: i, minWidth: i, children: [
140
- g && /* @__PURE__ */ h(
141
- C,
142
- {
143
- alignItems: "center",
144
- gap: e === "mini" ? 0 : 8,
145
- mb: e === "mini" ? 0 : 8,
146
- mt: e === "mini" ? 0 : -16,
147
- sx: e === "mini" ? { gap: 0, mb: 0 } : { gap: { xs: 4, xl: 8 }, mb: { xs: 4, xl: 8 } },
148
- children: [
149
- /* @__PURE__ */ t(
150
- ft,
151
- {
152
- categoryGuid: c ? S.INCOME : g.guid,
153
- size: e === "mini" ? 24 : _,
154
- variant: yt.Transparent
155
- }
156
- ),
157
- /* @__PURE__ */ t(
158
- y,
159
- {
160
- color: "secondary",
161
- noWrap: !0,
162
- variant: e === "mini" ? "Tiny" : "Body",
163
- children: g ? g.name : o
164
- }
165
- )
166
- ]
167
- }
168
- ),
169
- !g && e === "full" && /* @__PURE__ */ t(y, { bold: !0, color: "secondary", sx: { mb: { xs: 4, xl: 8 } }, children: o }),
170
- /* @__PURE__ */ t(y, { variant: e === "mini" ? "H2" : "H1", children: g ? w(g.amount, "0,0") : w(n.totalAmount, "0,0") }),
171
- !g && e === "mini" && /* @__PURE__ */ t(y, { color: "secondary", noWrap: !0, variant: "Tiny", children: o }),
172
- e === "full" && /* @__PURE__ */ t(
173
- Ct,
174
- {
175
- "aria-label": `View ${g?.name || ""} Transactions`,
176
- disabled: n.categoryData.length === 0,
177
- onClick: E,
178
- sx: { mt: { xl: 4, xs: 0 }, zIndex: 1 },
179
- variant: "text",
180
- children: d.view_transactions
181
- }
182
- )
183
- ] }) }) })
184
- ] });
185
- }, O = v(At), tt = ({ data: n, onSelected: c, selectedId: r }) => {
186
- const l = (a, i) => {
187
- (a.key === "Enter" || a.key === " ") && (a.preventDefault(), c(i));
188
- };
189
- return /* @__PURE__ */ t(C, { gap: 8, height: "100%", justifyContent: "center", my: "auto", children: n.categoryData.map((a) => /* @__PURE__ */ h(
190
- C,
191
- {
192
- alignItems: "center",
193
- "aria-label": a.name,
194
- "aria-pressed": a.guid === r,
195
- direction: "row",
196
- gap: 8,
197
- onClick: () => c(a.guid),
198
- onKeyDown: (i) => l(i, a.guid),
199
- role: "button",
200
- sx: { cursor: "pointer" },
201
- tabIndex: 0,
202
- children: [
203
- /* @__PURE__ */ t(x, { borderRadius: 4, height: 8, sx: { backgroundColor: a.color }, width: 8 }),
204
- /* @__PURE__ */ t(y, { bold: a.guid === r, variant: "XSmall", children: a.name })
205
- ]
206
- },
207
- a.guid
208
- )) });
209
- }, Lt = () => {
210
- const n = ht(), { goals: c, spending: r } = I(), { selectedAccounts: l } = R(), {
211
- categories: a,
212
- dateRangeCategoryTotals: i,
213
- dataRangeTotalsLoaded: o,
214
- loadDateRangeCategoryTotals: e
215
- } = z(), d = p.useMemo(
10
+ import { useTheme as mt } from "@mui/material/styles";
11
+ import { g as it, a as rt, S as G, b as q } from "../SpendingLegend-6FqtMcBV.mjs";
12
+ import { Text as C, Icon as ht } from "@mxenabled/mxui";
13
+ import { f as R } from "../NumberFormatting-DjTD0t3W.mjs";
14
+ import { u as L, m as W, d as st, b as P, a as F, h as ct, g as ft, n as bt } from "../hooks-C41HAxM5.mjs";
15
+ import { L as lt } from "../Loader-Ckqi9Rx6.mjs";
16
+ import { M as _t } from "../MiniWidgetContainer-CKzf_Ira.mjs";
17
+ import { startOfToday as J } from "date-fns/startOfToday";
18
+ import yt from "@mui/material/Button";
19
+ import { useTheme as Ct } from "@mui/material";
20
+ import { e as St } from "../exportTransactionsToCSV-BgV_wTLT.mjs";
21
+ import { T as Tt, a as Mt } from "../TransactionDetails-Bn0qY5Hw.mjs";
22
+ import Dt from "@mui/material/Collapse";
23
+ import z from "@mui/material/Divider";
24
+ import Q from "@mui/material/List";
25
+ import X from "@mui/material/ListItem";
26
+ import xt from "@mui/material/ListItemButton";
27
+ import { u as vt } from "../useScreenSize-B5afALev.mjs";
28
+ import { D as Z } from "../Drawer-BF40nbsH.mjs";
29
+ import { b as x } from "../Category-Ccoew_sA.mjs";
30
+ import { A as tt, W as wt } from "../WidgetContainer-CDh9fjpR.mjs";
31
+ const j = ({ amount: n, label: d }) => /* @__PURE__ */ s(b, { direction: "column", children: [
32
+ /* @__PURE__ */ t(C, { bold: !0, sx: { textTransform: "none" }, variant: "body1", children: d }),
33
+ /* @__PURE__ */ t(C, { variant: "caption", children: R(n, "0,0") })
34
+ ] }), Lt = () => {
35
+ const n = mt(), { goals: d, spending: o } = L(), { categories: r, dateRangeCategoryTotals: a } = W(), c = i.useMemo(
216
36
  () => [
217
37
  n.palette.chartMono.chartMono5,
218
38
  n.palette.chartMono.chartMono4,
@@ -222,172 +42,172 @@ const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
222
42
  n.palette.chartMono.chartMono6
223
43
  ],
224
44
  [n]
225
- );
226
- p.useEffect(() => {
227
- e(
228
- l,
229
- nt(/* @__PURE__ */ new Date()),
230
- ot(/* @__PURE__ */ new Date())
231
- ).finally();
232
- }, [l]);
233
- const [u, s] = p.useState(""), [m, T] = p.useState(0), g = p.useMemo(
234
- () => ct(a, c, n, i),
235
- [a, i]
236
- ), b = p.useMemo(
237
- () => dt(a, i, d),
238
- [a, i, d]
239
- ), E = (D, L) => {
240
- T(L), s("");
241
- }, _ = (D) => {
242
- s(u === D ? "" : D);
45
+ ), [e, l] = i.useState(""), [g, _] = i.useState(0), m = i.useMemo(
46
+ () => it(r, d, n, a),
47
+ [r, a]
48
+ ), p = i.useMemo(
49
+ () => rt(r, a, c),
50
+ [r, a, c]
51
+ ), A = (y, T) => {
52
+ _(T), l("");
53
+ }, f = (y) => {
54
+ l(e === y ? "" : y);
243
55
  };
244
- return o ? /* @__PURE__ */ h(x, { width: "100%", children: [
245
- /* @__PURE__ */ h(
56
+ return /* @__PURE__ */ s(v, { width: "100%", children: [
57
+ /* @__PURE__ */ s(
246
58
  at,
247
59
  {
248
- "aria-label": r.mini_title,
249
- onChange: E,
250
- value: m,
60
+ "aria-label": o.mini_title,
61
+ onChange: A,
62
+ value: g,
251
63
  variant: "fullWidth",
252
64
  children: [
253
65
  /* @__PURE__ */ t(
254
- N,
66
+ k,
255
67
  {
256
68
  "aria-controls": "spending-tabpanel",
257
69
  id: "spending-tab",
258
70
  label: /* @__PURE__ */ t(
259
- W,
71
+ j,
260
72
  {
261
- amount: g.totalAmount,
262
- label: r.spend_tab_title
73
+ amount: m.totalAmount,
74
+ label: o.spend_tab_title
263
75
  }
264
76
  ),
265
- tabIndex: m === 0 ? 0 : -1
77
+ tabIndex: g === 0 ? 0 : -1
266
78
  }
267
79
  ),
268
80
  /* @__PURE__ */ t(
269
- N,
81
+ k,
270
82
  {
271
83
  "aria-controls": "income-tabpanel",
272
84
  id: "income-tab",
273
85
  label: /* @__PURE__ */ t(
274
- W,
86
+ j,
275
87
  {
276
- amount: b.totalAmount,
277
- label: r.income_tab_title
88
+ amount: p.totalAmount,
89
+ label: o.income_tab_title
278
90
  }
279
91
  ),
280
- tabIndex: m === 1 ? 0 : -1
92
+ tabIndex: g === 1 ? 0 : -1
281
93
  }
282
94
  )
283
95
  ]
284
96
  }
285
97
  ),
286
98
  /* @__PURE__ */ t(
287
- x,
99
+ v,
288
100
  {
289
101
  "aria-labelledby": "spending-tab",
290
- hidden: m !== 0,
102
+ hidden: g !== 0,
291
103
  id: "spending-tabpanel",
292
104
  role: "tabpanel",
293
- children: /* @__PURE__ */ h(C, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
105
+ children: /* @__PURE__ */ s(b, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
294
106
  /* @__PURE__ */ t(
295
- O,
107
+ G,
296
108
  {
297
- data: g,
298
- onSelected: _,
299
- selectedId: u,
300
- totalLabel: r.total_spending
109
+ data: m,
110
+ onSelected: f,
111
+ selectedId: e,
112
+ totalLabel: o.total_spending
301
113
  }
302
114
  ),
303
- /* @__PURE__ */ t(tt, { data: g, onSelected: _, selectedId: u })
115
+ /* @__PURE__ */ t(q, { data: m, onSelected: f, selectedId: e })
304
116
  ] })
305
117
  }
306
118
  ),
307
119
  /* @__PURE__ */ t(
308
- x,
120
+ v,
309
121
  {
310
122
  "aria-labelledby": "income-tab",
311
- hidden: m !== 1,
123
+ hidden: g !== 1,
312
124
  id: "income-tabpanel",
313
125
  role: "tabpanel",
314
- children: /* @__PURE__ */ h(C, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
126
+ children: /* @__PURE__ */ s(b, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
315
127
  /* @__PURE__ */ t(
316
- O,
128
+ G,
317
129
  {
318
- data: b,
130
+ data: p,
319
131
  isIncome: !0,
320
- onSelected: _,
321
- selectedId: u,
322
- totalLabel: r.total_income
132
+ onSelected: f,
133
+ selectedId: e,
134
+ totalLabel: o.total_income
323
135
  }
324
136
  ),
325
- /* @__PURE__ */ t(tt, { data: b, onSelected: _, selectedId: u })
137
+ /* @__PURE__ */ t(q, { data: p, onSelected: f, selectedId: e })
326
138
  ] })
327
139
  }
328
140
  )
329
- ] }) : /* @__PURE__ */ t(F, { height: 250 });
330
- }, Nt = v(Lt), Wt = ({ onPrimaryCtaClick: n, sx: c = {} }) => {
331
- const { visibleAccounts: r } = rt(), { spending: l } = I(), { isCopyLoaded: a, isInitialized: i, setSelectedAccounts: o } = R();
332
- return p.useEffect(() => {
333
- o(r);
334
- }, [r]), !a || !i ? /* @__PURE__ */ t(F, {}) : /* @__PURE__ */ t(
335
- Mt,
141
+ ] });
142
+ }, At = w(Lt), It = ({ onPrimaryCtaClick: n, sx: d = {} }) => {
143
+ const { isAccountDataLoaded: o, loadAccountData: r, visibleAccounts: a } = st(), { categoriesLoaded: c, loadCategories: e, loadDateRangeCategoryTotals: l } = W(), { spending: g } = L(), { isInitialized: _, selectedAccounts: m, setSelectedAccounts: p } = P();
144
+ return i.useEffect(() => {
145
+ o || r().finally(), c || e().finally();
146
+ }, []), i.useEffect(() => {
147
+ p(a);
148
+ }, [a]), i.useEffect(() => {
149
+ l(
150
+ m,
151
+ nt(/* @__PURE__ */ new Date()),
152
+ ot(/* @__PURE__ */ new Date())
153
+ ).finally();
154
+ }, [m]), _ ? /* @__PURE__ */ t(
155
+ _t,
336
156
  {
337
157
  className: "mx-exp-spending-miniwidget",
338
158
  onPrimaryCtaClick: n,
339
- primaryCtaLabel: l.primary_cta,
340
- sx: c,
341
- title: l.mini_title,
342
- children: /* @__PURE__ */ t(Nt, {})
159
+ primaryCtaLabel: g.primary_cta,
160
+ sx: { height: "100%", ...d },
161
+ title: g.mini_title,
162
+ children: /* @__PURE__ */ t(At, {})
343
163
  }
344
- );
345
- }, be = v(Wt), Ot = ({
164
+ ) : /* @__PURE__ */ t(lt, {});
165
+ }, me = w(It), Et = ({
346
166
  data: n,
347
- onSelected: c,
348
- selectedId: r = "",
349
- title: l
167
+ onSelected: d,
168
+ selectedId: o = "",
169
+ title: r
350
170
  }) => {
351
- const { spending: a } = I(), i = n.categoryData.find((o) => o.guid === r);
352
- return /* @__PURE__ */ h(C, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
353
- /* @__PURE__ */ t(y, { bold: !0, sx: { py: 12 }, children: `${l} ${a.by_category}` }),
354
- /* @__PURE__ */ t(B, { "aria-hidden": "true" }),
355
- /* @__PURE__ */ t(q, { children: n.categoryData.map((o) => /* @__PURE__ */ h(p.Fragment, { children: [
171
+ const { spending: a } = L(), c = n.categoryData.find((e) => e.guid === o);
172
+ return /* @__PURE__ */ s(b, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
173
+ /* @__PURE__ */ t(C, { bold: !0, sx: { py: 12 }, children: `${r} ${a.by_category}` }),
174
+ /* @__PURE__ */ t(z, { "aria-hidden": "true" }),
175
+ /* @__PURE__ */ t(Q, { children: n.categoryData.map((e) => /* @__PURE__ */ s(i.Fragment, { children: [
356
176
  /* @__PURE__ */ t(
357
- J,
177
+ X,
358
178
  {
359
179
  disableGutters: !0,
360
180
  disablePadding: !0,
361
181
  sx: {
362
182
  minHeight: 44
363
183
  },
364
- children: /* @__PURE__ */ h(
365
- vt,
184
+ children: /* @__PURE__ */ s(
185
+ xt,
366
186
  {
367
- "aria-expanded": i?.guid === o.guid,
368
- onClick: () => c(o.guid),
187
+ "aria-expanded": c?.guid === e.guid,
188
+ onClick: () => d(e.guid),
369
189
  sx: { minHeight: 44, px: 8, py: 0 },
370
190
  children: [
371
191
  /* @__PURE__ */ t(
372
- x,
192
+ v,
373
193
  {
374
194
  borderRadius: 4,
375
195
  flexShrink: 0,
376
196
  height: 8,
377
- sx: { backgroundColor: o.color, mr: 8 },
197
+ sx: { backgroundColor: e.color, mr: 8 },
378
198
  width: 8
379
199
  }
380
200
  ),
381
- /* @__PURE__ */ h(
382
- C,
201
+ /* @__PURE__ */ s(
202
+ b,
383
203
  {
384
204
  alignItems: "center",
385
205
  direction: "row",
386
206
  justifyContent: "space-between",
387
207
  width: "100%",
388
208
  children: [
389
- /* @__PURE__ */ t(y, { bold: r === o.guid, children: o.name }),
390
- /* @__PURE__ */ t(y, { bold: r === o.guid, variant: "Body", children: w(o.amount, "0,0") })
209
+ /* @__PURE__ */ t(C, { bold: o === e.guid, children: e.name }),
210
+ /* @__PURE__ */ t(C, { bold: o === e.guid, variant: "body1", children: R(e.amount, "0,0") })
391
211
  ]
392
212
  }
393
213
  )
@@ -396,51 +216,51 @@ const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
396
216
  )
397
217
  }
398
218
  ),
399
- /* @__PURE__ */ t(B, {}),
400
- o.categoryTotals && o.categoryTotals.length > 0 && /* @__PURE__ */ t(wt, { in: i?.guid === o.guid, unmountOnExit: !0, children: /* @__PURE__ */ h(q, { children: [
401
- i?.categoryTotals?.map((e) => /* @__PURE__ */ t(
402
- J,
219
+ /* @__PURE__ */ t(z, {}),
220
+ e.categoryTotals && e.categoryTotals.length > 0 && /* @__PURE__ */ t(Dt, { in: c?.guid === e.guid, unmountOnExit: !0, children: /* @__PURE__ */ s(Q, { children: [
221
+ c?.categoryTotals?.map((l) => /* @__PURE__ */ t(
222
+ X,
403
223
  {
404
224
  sx: {
405
225
  pl: 24,
406
226
  pr: 8,
407
227
  py: 0
408
228
  },
409
- children: /* @__PURE__ */ h(C, { direction: "row", justifyContent: "space-between", width: "100%", children: [
410
- /* @__PURE__ */ h(y, { children: [
411
- e.name,
229
+ children: /* @__PURE__ */ s(b, { direction: "row", justifyContent: "space-between", width: "100%", children: [
230
+ /* @__PURE__ */ s(C, { children: [
231
+ l.name,
412
232
  " "
413
233
  ] }),
414
- /* @__PURE__ */ t(y, { children: w(e.amount, "0,0") })
234
+ /* @__PURE__ */ t(C, { children: R(l.amount, "0,0") })
415
235
  ] })
416
236
  },
417
- e.guid
237
+ l.guid
418
238
  )),
419
- /* @__PURE__ */ t(B, {})
239
+ /* @__PURE__ */ t(z, {})
420
240
  ] }) })
421
- ] }, o.guid)) }),
422
- /* @__PURE__ */ t(y, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${a.total}: ${w(n.totalAmount, "0,0")}` })
241
+ ] }, e.guid)) }),
242
+ /* @__PURE__ */ t(C, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${a.total}: ${R(n.totalAmount, "0,0")}` })
423
243
  ] });
424
- }, Rt = v(Ot), kt = ({
244
+ }, Wt = w(Et), Nt = ({
425
245
  data: n,
426
- onSelected: c,
427
- onViewTransactions: r,
428
- selectedId: l,
246
+ onSelected: d,
247
+ onViewTransactions: o,
248
+ selectedId: r,
429
249
  title: a
430
250
  }) => {
431
- const { isDesktop: i, isMobile: o } = lt(), { isLoadingCategoryTotals: e } = z(), { spending: d } = I();
432
- return /* @__PURE__ */ h(
433
- C,
251
+ const { isDesktop: c, isMobile: e } = vt(), { isLoadingCategoryTotals: l } = W(), { spending: g } = L();
252
+ return /* @__PURE__ */ s(
253
+ b,
434
254
  {
435
- alignItems: o ? "center" : "flex-start",
436
- direction: o ? "column" : "row",
255
+ alignItems: e ? "center" : "flex-start",
256
+ direction: e ? "column" : "row",
437
257
  gap: { xs: 16, md: 64, xl: 100 },
438
258
  justifyContent: "center",
439
259
  pt: 50,
440
260
  px: 8,
441
261
  children: [
442
- e && /* @__PURE__ */ t(
443
- O,
262
+ l && /* @__PURE__ */ t(
263
+ G,
444
264
  {
445
265
  data: {
446
266
  categoryData: [],
@@ -450,173 +270,201 @@ const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
450
270
  onSelected: () => {
451
271
  },
452
272
  selectedId: "",
453
- size: i ? 400 : 300,
273
+ size: c ? 400 : 300,
454
274
  totalLabel: "Loading ...",
455
275
  variant: "full"
456
276
  }
457
277
  ),
458
- !e && /* @__PURE__ */ t(
459
- O,
278
+ !l && /* @__PURE__ */ t(
279
+ G,
460
280
  {
461
281
  data: n,
462
- onSelected: c,
463
- onViewTransactions: r,
464
- selectedId: l,
465
- size: i ? 400 : 300,
466
- totalLabel: d.total_amount,
282
+ onSelected: d,
283
+ onViewTransactions: o,
284
+ selectedId: r,
285
+ size: c ? 400 : 300,
286
+ totalLabel: g.total_amount,
467
287
  variant: "full"
468
288
  }
469
289
  ),
470
- /* @__PURE__ */ t(Rt, { data: n, onSelected: c, selectedId: l, title: a })
290
+ /* @__PURE__ */ t(Wt, { data: n, onSelected: d, selectedId: r, title: a })
471
291
  ]
472
292
  }
473
293
  );
474
- }, et = v(kt), $t = (n) => [
294
+ }, et = w(Nt), Ot = (n) => [
475
295
  n.palette.chartMono.chartMono5,
476
296
  n.palette.chartMono.chartMono4,
477
297
  n.palette.chartMono.chartMono3,
478
298
  n.palette.chartMono.chartMono2,
479
299
  n.palette.chartMono.chartMono1,
480
300
  n.palette.chartMono.chartMono6
481
- ], Gt = () => {
482
- const n = it(), { clientConfig: c } = st(), { categories: r, dateRangeCategoryTotals: l, loadDateRangeCategoryTotals: a } = z(), { goals: i, spending: o } = I(), { displayedDateRange: e, selectedAccounts: d, selectedAccountGuids: u } = R(), { setFilter: s, sortedTransactions: m } = _t(), T = c?.master?.deep_link_params?.account_guids, g = c?.master?.deep_link_params?.view, [b, E] = p.useState(""), [_, D] = p.useState(g === "income" ? 1 : 0), [L, H] = p.useState(""), [gt, P] = p.useState(!1);
483
- p.useEffect(() => {
484
- a(
485
- d,
486
- e.start,
487
- e.end
488
- ).finally();
489
- }, [d, e]);
490
- const k = p.useMemo(
491
- () => ct(r, i, n, l),
492
- [r, l]
493
- ), K = p.useMemo(
494
- () => dt(r, l, $t(n)),
495
- [r, l]
496
- ), $ = p.useMemo(
497
- () => m.find((f) => f.guid === L),
498
- [L, m]
499
- ), ut = (f, A) => {
500
- D(A), E("");
501
- }, X = (f) => {
502
- E(b === f || f === "0" ? "" : f);
503
- }, Y = (f) => {
504
- const A = {
505
- accounts: T || u,
506
- dateRange: e
301
+ ], Rt = () => {
302
+ const n = Ct(), { is_mobile_webview: d } = F(), { clientConfig: o } = F(), { categories: r, dateRangeCategoryTotals: a } = W(), {
303
+ goals: c,
304
+ spending: e,
305
+ transactions: l
306
+ } = L(), { displayedDateRange: g, selectedAccountGuids: _ } = P(), {
307
+ setFilter: m,
308
+ sortedTransactions: p,
309
+ sortedTransactionsWithSplits: A,
310
+ tags: f
311
+ } = ct(), y = o?.master?.deep_link_params?.account_guids, T = o?.master?.deep_link_params?.view, [M, N] = i.useState(""), [D, S] = i.useState(T === "income" ? 1 : 0), [O, I] = i.useState(""), [dt, H] = i.useState(!1), $ = i.useMemo(
312
+ () => it(r, c, n, a),
313
+ [r, a]
314
+ ), K = i.useMemo(
315
+ () => rt(r, a, Ot(n)),
316
+ [r, a]
317
+ ), B = i.useMemo(
318
+ () => p.find((u) => u.guid === O),
319
+ [O, p]
320
+ ), gt = (u, E) => {
321
+ S(E), N("");
322
+ }, U = (u) => {
323
+ N(M === u || u === "0" ? "" : u);
324
+ }, Y = (u) => {
325
+ const E = {
326
+ accounts: y || _,
327
+ dateRange: g
507
328
  };
508
- if (_ === 0)
509
- if (f === "other") {
510
- const M = k.categoryData.find((G) => G.guid === "other");
511
- s({
512
- ...A,
513
- custom: (G) => !!M?.categoryTotals?.find((pt) => pt.guid === G.top_level_category_guid)
329
+ if (D === 0)
330
+ if (u === "other") {
331
+ const h = $.categoryData.find((V) => V.guid === "other");
332
+ m({
333
+ ...E,
334
+ custom: (V) => !!h?.categoryTotals?.find((ut) => ut.guid === V.top_level_category_guid)
514
335
  });
515
336
  } else
516
- s({
517
- ...A,
518
- custom: (M) => f ? M.top_level_category_guid === f : M.top_level_category_guid !== S.INCOME && M.top_level_category_guid !== S.INVESTMENTS && M.top_level_category_guid !== S.TRANSFER,
519
- showSplits: !!f
337
+ m({
338
+ ...E,
339
+ custom: (h) => u ? h.top_level_category_guid === u : h.top_level_category_guid !== x.INCOME && h.category_guid !== x.INCOME && h.top_level_category_guid !== x.INVESTMENTS && h.top_level_category_guid !== x.TRANSFER,
340
+ showSplits: !!u
520
341
  });
521
342
  else
522
- s({
523
- ...A,
524
- custom: (M) => f ? M.category_guid === f : M.category_guid === S.INCOME || M.top_level_category_guid === S.INCOME
343
+ m({
344
+ ...E,
345
+ custom: (h) => u ? h.category_guid === u : h.category_guid === x.INCOME || h.top_level_category_guid === x.INCOME
525
346
  });
526
- P(!0);
347
+ H(!0);
348
+ }, pt = () => {
349
+ St(A, f);
527
350
  };
528
- return /* @__PURE__ */ h(x, { children: [
529
- /* @__PURE__ */ h(at, { onChange: ut, value: _, variant: "fullWidth", children: [
351
+ return /* @__PURE__ */ s(v, { children: [
352
+ /* @__PURE__ */ s(at, { onChange: gt, value: D, variant: "fullWidth", children: [
530
353
  /* @__PURE__ */ t(
531
- N,
354
+ k,
532
355
  {
533
356
  label: /* @__PURE__ */ t(
534
- W,
357
+ j,
535
358
  {
536
- amount: k.totalAmount,
537
- label: o.spend_tab_title
359
+ amount: $.totalAmount,
360
+ label: e.spend_tab_title
538
361
  }
539
362
  )
540
363
  }
541
364
  ),
542
365
  /* @__PURE__ */ t(
543
- N,
366
+ k,
544
367
  {
545
368
  label: /* @__PURE__ */ t(
546
- W,
369
+ j,
547
370
  {
548
371
  amount: K.totalAmount,
549
- label: o.income_tab_title
372
+ label: e.income_tab_title
550
373
  }
551
374
  )
552
375
  }
553
376
  )
554
377
  ] }),
555
- _ === 0 && /* @__PURE__ */ t(
378
+ D === 0 && /* @__PURE__ */ t(
556
379
  et,
557
380
  {
558
- data: k,
559
- onSelected: X,
381
+ data: $,
382
+ onSelected: U,
560
383
  onViewTransactions: Y,
561
- selectedId: b,
562
- title: o.spend_tab_title
384
+ selectedId: M,
385
+ title: e.spend_tab_title
563
386
  }
564
387
  ),
565
- _ === 1 && /* @__PURE__ */ t(
388
+ D === 1 && /* @__PURE__ */ t(
566
389
  et,
567
390
  {
568
391
  data: K,
569
- onSelected: X,
392
+ onSelected: U,
570
393
  onViewTransactions: Y,
571
- selectedId: b,
572
- title: o.income_tab_title
394
+ selectedId: M,
395
+ title: e.income_tab_title
573
396
  }
574
397
  ),
575
398
  /* @__PURE__ */ t(
576
- Q,
399
+ Z,
577
400
  {
578
- ariaLabelClose: o.close_drawer_aria,
579
- isOpen: gt,
580
- onClose: () => P(!1),
581
- title: o.transactions_drawer_title,
582
- children: /* @__PURE__ */ t(Dt, { onClick: H })
401
+ ariaLabelClose: e.close_drawer_aria,
402
+ isOpen: dt,
403
+ onClose: () => H(!1),
404
+ title: e.transactions_drawer_title,
405
+ children: /* @__PURE__ */ s(b, { children: [
406
+ !d && p.length > 0 && /* @__PURE__ */ t(b, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ t(
407
+ yt,
408
+ {
409
+ onClick: pt,
410
+ startIcon: /* @__PURE__ */ t(ht, { name: "ios_share" }),
411
+ variant: "text",
412
+ children: l.export_csv_btn
413
+ }
414
+ ) }),
415
+ /* @__PURE__ */ t(Tt, { onClick: I })
416
+ ] })
583
417
  }
584
418
  ),
585
419
  /* @__PURE__ */ t(
586
- Q,
420
+ Z,
587
421
  {
588
- ariaLabelClose: o.close_drawer_aria,
589
- isOpen: !!$,
590
- onClose: () => H(""),
591
- title: o.transaction_details_drawer_title,
592
- children: $ && /* @__PURE__ */ t(xt, { transaction: $ })
422
+ ariaLabelClose: e.close_drawer_aria,
423
+ isOpen: !!B,
424
+ onClose: () => I(""),
425
+ title: e.transaction_details_drawer_title,
426
+ children: B && /* @__PURE__ */ t(Mt, { transaction: B })
593
427
  }
594
428
  )
595
429
  ] });
596
- }, Bt = v(Gt), jt = ({ onBackClick: n, sx: c = {} }) => {
597
- const { visibleAccounts: r } = rt(), { spending: l } = I(), { isCopyLoaded: a, isInitialized: i, setDisplayedDate: o, setSelectedAccounts: e } = R(), { onEvent: d } = St(), { clientConfig: u } = st(), s = u?.master?.deep_link_params?.date_range, [m, T] = p.useState(!1);
598
- p.useEffect(() => {
599
- e(r);
600
- }, [r]), p.useEffect(() => {
601
- s && Array.isArray(s) && s.length === 2 ? o(s[0], s[1]) : o(nt(U()), ot(U())), T(!0), d(Z.SPENDING_VIEW);
602
- }, []);
603
- const g = (b) => {
604
- o(b[0], b[1]);
430
+ }, kt = w(Rt), Gt = ({ onBackClick: n, sx: d = {} }) => {
431
+ const { visibleAccounts: o, isAccountDataLoaded: r, loadAccountData: a } = st(), { categoriesLoaded: c, loadCategories: e, loadDateRangeCategoryTotals: l } = W(), { isTransactionDataLoaded: g, loadTransactionData: _ } = ct(), { spending: m } = L(), {
432
+ displayedDateRange: p,
433
+ isInitialized: A,
434
+ setDisplayedDate: f,
435
+ setSelectedAccounts: y,
436
+ selectedAccounts: T
437
+ } = P(), { onEvent: M } = ft(), { onLoad: N } = bt(), { clientConfig: D } = F(), S = D?.master?.deep_link_params?.date_range;
438
+ i.useEffect(() => {
439
+ S && Array.isArray(S) && S.length === 2 ? f(S[0], S[1]) : f(nt(J()), ot(J())), r || a().finally(), c || e().finally(), g || _().finally(), M(tt.SPENDING_VIEW);
440
+ }, []), i.useEffect(() => {
441
+ y(o);
442
+ }, [o]), i.useEffect(() => {
443
+ l(
444
+ T,
445
+ p.start,
446
+ p.end
447
+ ).finally(() => {
448
+ N?.("SpendingWidget");
449
+ });
450
+ }, [p, T]);
451
+ const O = (I) => {
452
+ f(I[0], I[1]);
605
453
  };
606
- return !a || !i || !m ? /* @__PURE__ */ t(F, {}) : /* @__PURE__ */ t(
607
- It,
454
+ return A ? /* @__PURE__ */ t(
455
+ wt,
608
456
  {
609
- accountOptions: r,
610
- calendarActions: { onRangeChanged: g },
611
- onAccountsFilterClick: () => d(Z.SPENDING_CLICK_FILTER),
457
+ accountOptions: o,
458
+ calendarActions: { onRangeChanged: O },
459
+ onAccountsFilterClick: () => M(tt.SPENDING_CLICK_FILTER),
612
460
  onBackClick: n,
613
- sx: c,
614
- title: l.title,
615
- children: /* @__PURE__ */ t(x, { height: "calc(100dvh - 150px)", overflow: "scroll", width: "100%", children: /* @__PURE__ */ t(Bt, {}) })
461
+ sx: d,
462
+ title: m.title,
463
+ children: /* @__PURE__ */ t(v, { height: "calc(100dvh - 150px)", overflow: "scroll", width: "100%", children: /* @__PURE__ */ t(kt, {}) })
616
464
  }
617
- );
618
- }, Ce = v(jt);
465
+ ) : /* @__PURE__ */ t(lt, {});
466
+ }, he = w(Gt);
619
467
  export {
620
- be as SpendingMiniWidget,
621
- Ce as SpendingWidget
468
+ me as SpendingMiniWidget,
469
+ he as SpendingWidget
622
470
  };