@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.
- package/CHANGELOG.md +128 -1
- package/dist/{Account-Bxw0_4FU.mjs → Account-B4CDD-zq.mjs} +1 -1
- package/dist/AccountDetailsContent-adZTkM52.mjs +683 -0
- package/dist/AccountDetailsHeader-DRjFuyJT.mjs +87 -0
- package/dist/{AccountFields-C9FlatNb.mjs → AccountFields-Cl4KHoSj.mjs} +14 -12
- package/dist/AccountListItem-wgmlex-_.mjs +90 -0
- package/dist/{AccountStore-BgNOyMdp.mjs → AccountStore-HbVblv86.mjs} +19 -8
- package/dist/{Accounts-BRf_YeTf.mjs → Accounts-CRUehOiy.mjs} +1 -1
- package/dist/{BeatApi-DhJpgCLz.mjs → BeatApi-De2IaqH2.mjs} +1 -1
- package/dist/{BeatStore-IBnXd4YK.mjs → BeatStore-D_NYuBSz.mjs} +1 -1
- package/dist/{BudgetUtil-B2ZXyw-g.mjs → BudgetUtil-Jv8h9H9l.mjs} +33 -33
- package/dist/{CashflowStore-D9Dpuz7X.mjs → CashflowStore-CA190BPF.mjs} +18 -25
- package/dist/{Category-CevNQ03n.mjs → Category-Ccoew_sA.mjs} +2 -2
- package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-Dl006GKy.mjs} +43 -41
- package/dist/{CategoryStore-yHI0hWmK.mjs → CategoryStore-MUwRWH9e.mjs} +13 -11
- package/dist/{CategoryUtil-pZRIYOgN.mjs → CategoryUtil-DfVKKkRf.mjs} +4 -4
- package/dist/{ConnectDrawer-BQNs-hjk.mjs → ConnectDrawer-DVp54lUH.mjs} +49 -48
- package/dist/{ConnectionsDrawer-ByGQE7D5.mjs → ConnectionsDrawer-Dsc04-4Z.mjs} +3 -3
- package/dist/CurrencyInput-D1cjbdCI.mjs +85 -0
- package/dist/{CurrencyText-kyC1aseI.mjs → CurrencyText-Dr0EZ7bp.mjs} +1 -1
- package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CDPZw_-m.mjs} +3 -3
- package/dist/{DebtsStore-C9bblOgW.mjs → DebtsStore-pL63fmdT.mjs} +3 -3
- package/dist/{Dialog-CWW597AF.mjs → Dialog-CDV0kKxj.mjs} +24 -24
- package/dist/{Donut-oaQFlbit.mjs → Donut-Dmy3JTWd.mjs} +12 -12
- package/dist/Drawer-BF40nbsH.mjs +163 -0
- package/dist/{EmptyState-DA_lfRBv.mjs → EmptyState-DoxNUae-.mjs} +24 -22
- package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-QhQK4_FU.mjs} +4 -4
- package/dist/{Fetch-87LIQbEA.mjs → Fetch-DecPFeGU.mjs} +24 -22
- package/dist/FinstrongStore-BGf36b0z.mjs +451 -0
- package/dist/{GoalStore-D-aB35SY.mjs → GoalStore-C1-w3Y1E.mjs} +7 -7
- package/dist/HeaderCell-P8w6CmfO.mjs +6 -0
- package/dist/{Help-B6dIcujh.mjs → Help-DBfsTkAi.mjs} +125 -146
- package/dist/{Help-DhcC-C05.mjs → Help-c-zHlDbv.mjs} +8 -8
- package/dist/{IconBacking-B9oC6uL2.mjs → IconBacking-DgT8DCeh.mjs} +11 -11
- package/dist/LineChart-C1PxNf7P.mjs +581 -0
- package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-BNCWQAN_.mjs} +10 -10
- package/dist/Loader-Ckqi9Rx6.mjs +21 -0
- package/dist/{ManageIncome-1s_q5W4X.mjs → ManageIncome-8EsStyIQ.mjs} +195 -192
- package/dist/{MerchantStore-DrFvsUyy.mjs → MerchantStore-WvZ4gnQe.mjs} +1 -1
- package/dist/MicroWidgetContainer-BGpNl5ZS.mjs +45 -0
- package/dist/MiniWidgetContainer-CKzf_Ira.mjs +56 -0
- package/dist/{NetWorthStore-DCsTZpuS.mjs → NetWorthStore-Bti6u-d9.mjs} +4 -4
- package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-B74rQVYC.mjs} +276 -273
- package/dist/{NotificationStore-BxP_P2dA.mjs → NotificationStore-Ck2KdNmT.mjs} +10 -10
- package/dist/{NumberFormatting-Buh7u8Oi.mjs → NumberFormatting-DjTD0t3W.mjs} +9 -9
- package/dist/{OriginalBalanceAction-CWuVvRq9.mjs → OriginalBalanceAction-2Y_3U_mg.mjs} +10 -10
- package/dist/{RecurringSettings-A_rAGCTP.mjs → RecurringSettings-DAncu--R.mjs} +17 -17
- package/dist/{RecurringTransactions-DK8dWldr.mjs → RecurringTransactions-CxcSL1dY.mjs} +106 -105
- package/dist/{RecurringTransactionsStore-C4YOD7_D.mjs → RecurringTransactionsStore-CNFxyGB6.mjs} +80 -73
- package/dist/{ResponsiveButton-DZFp78fJ.mjs → ResponsiveButton-Cn6-R7ue.mjs} +10 -10
- package/dist/SearchBox-B7km148n.mjs +39 -0
- package/dist/{SettingsStore-BcgS_Ohv.mjs → SettingsStore-BASMQSIp.mjs} +3 -3
- package/dist/{SingleSegmentDonut-BgbLgwHi.mjs → SingleSegmentDonut-7Uy6VEld.mjs} +6 -6
- package/dist/SkeletonLoader-BaNboJjD.mjs +38 -0
- package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-DPQ96k3x.mjs} +19 -19
- package/dist/SpendingLegend-6FqtMcBV.mjs +193 -0
- package/dist/{StatusBar-BK_uYHAB.mjs → StatusBar-CPfSXe80.mjs} +6 -6
- package/dist/{TabContentContainer-j01JYR_7.mjs → TabContentContainer-CnMXkVqr.mjs} +8 -8
- package/dist/{ToggleListItem-r0Kx56wF.mjs → ToggleListItem-ciFTiqRS.mjs} +19 -14
- package/dist/TransactionApi-CjBoLleL.mjs +86 -0
- package/dist/TransactionDetails-Bn0qY5Hw.mjs +1336 -0
- package/dist/{TransactionStore-ai3uII_r.mjs → TransactionStore-DbwAutwC.mjs} +146 -165
- package/dist/TrendsStore-_mRaFUdf.mjs +182 -0
- package/dist/{User-BQUxBeZV.mjs → User-BklmOUSd.mjs} +107 -107
- package/dist/{ViewMoreMicroCard-SCn2wt4i.mjs → ViewMoreMicroCard-DAkyNRlD.mjs} +706 -729
- package/dist/{WidgetContainer-BHWANqT4.mjs → WidgetContainer-CDh9fjpR.mjs} +36 -36
- package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +4 -1
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +2 -1
- package/dist/accounts/index.es.js +228 -221
- package/dist/accounts/stores/AccountStore.d.ts +2 -0
- package/dist/analytics/index.es.js +27 -27
- package/dist/budgets/index.es.js +459 -462
- package/dist/cashflow/index.es.js +419 -428
- package/dist/categories/index.es.js +2 -2
- package/dist/categories/stores/CategoryStore.d.ts +1 -1
- package/dist/common/components/ErrorBoundary.d.ts +1 -1
- package/dist/common/components/Loader.d.ts +1 -2
- package/dist/common/components/Select.d.ts +4 -2
- package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +1 -1
- package/dist/common/components/charts/LineChart.d.ts +12 -2
- package/dist/common/components/charts/index.d.ts +0 -3
- package/dist/common/components/charts/linechart/CustomLegend.d.ts +3 -1
- package/dist/common/components/charts/linechart/CustomMark.d.ts +5 -1
- package/dist/common/components/drawer/Drawer.d.ts +3 -0
- package/dist/common/components/drawer/Footer.d.ts +17 -0
- package/dist/common/components/index.d.ts +0 -1
- package/dist/common/hooks/index.d.ts +0 -1
- package/dist/common/hooks/useAriaLive.d.ts +1 -1
- package/dist/common/index.es.js +402 -668
- package/dist/common/stores/GlobalStore.d.ts +7 -1
- package/dist/common/types/Finstrong.d.ts +54 -0
- package/dist/common/types/Global.d.ts +1 -0
- package/dist/common/types/Widgets.d.ts +1 -0
- package/dist/common/types/index.d.ts +1 -1
- package/dist/common/types/localization/FinstrongCopy.d.ts +105 -2
- package/dist/common/types/localization/GoalsCopy.d.ts +1 -0
- package/dist/common/utils/Theme.d.ts +1 -3
- package/dist/dashboard/index.es.js +21 -21
- package/dist/debts/components/DebtsChart.d.ts +1 -2
- package/dist/debts/index.es.js +673 -665
- package/dist/exportTransactionsToCSV-BgV_wTLT.mjs +48 -0
- package/dist/finstrong/FinstrongWidget.d.ts +1 -1
- package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
- package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
- package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
- package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
- package/dist/finstrong/components/FinancialStrengthGraph.d.ts +7 -1
- package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
- package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
- package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
- package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
- package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
- package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
- package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
- package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
- package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
- package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
- package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
- package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
- package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
- package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
- package/dist/finstrong/components/ProgressBar.d.ts +15 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
- package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
- package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
- package/dist/finstrong/components/StatusChip.d.ts +5 -0
- package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
- package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +17 -0
- package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
- package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
- package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
- package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
- package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
- package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
- package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
- package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +25 -0
- package/dist/finstrong/components/shared/DialScoreCard.d.ts +7 -1
- package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
- package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
- package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
- package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
- package/dist/finstrong/constants/index.d.ts +9 -0
- package/dist/finstrong/index.es.js +3175 -1067
- package/dist/finstrong/stores/FinstrongStore.d.ts +25 -2
- package/dist/finstrong/util/finstrongUtils.d.ts +58 -1
- package/dist/goals/index.es.js +580 -570
- package/dist/help/components/content/BottomImageContent.d.ts +1 -1
- package/dist/help/components/content/LeftImageContent.d.ts +1 -1
- package/dist/help/components/content/RightImageContent.d.ts +1 -1
- package/dist/help/components/content/TopImageContent.d.ts +1 -1
- package/dist/help/index.es.js +6 -6
- package/dist/{hooks-D6XlXHf4.mjs → hooks-C41HAxM5.mjs} +3 -3
- package/dist/insights/index.es.js +1 -1
- package/dist/investments/index.es.js +537 -536
- package/dist/merchants/index.es.js +9 -9
- package/dist/microinsights/beaticons/BeatIcon.d.ts +2 -9
- package/dist/microinsights/beaticons/BeatMerchantLogo.d.ts +3 -2
- package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +2 -1
- package/dist/microinsights/cards/{MicroInsightCard.d.ts → BaseCard.d.ts} +1 -8
- package/dist/microinsights/cards/{BeatCard.d.ts → InsightCard.d.ts} +2 -2
- package/dist/microinsights/cards/NoRelevantInsightsCard.d.ts +2 -5
- package/dist/microinsights/cards/ZeroStateCard.d.ts +2 -5
- package/dist/microinsights/carousel/BeatList.d.ts +10 -0
- package/dist/microinsights/carousel/CarouselControls.d.ts +1 -3
- package/dist/microinsights/carousel/CarouselHeader.d.ts +1 -2
- package/dist/microinsights/constants/App.d.ts +0 -1
- package/dist/microinsights/index.d.ts +3 -3
- package/dist/microinsights/index.es.js +7 -7
- package/dist/microinsights/interfaces.d.ts +0 -6
- package/dist/networth/components/NetWorthChange.d.ts +3 -1
- package/dist/networth/index.es.js +262 -254
- package/dist/notifications/index.es.js +90 -91
- package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +3 -0
- package/dist/recurringtransactions/index.es.js +586 -562
- package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +1 -0
- package/dist/settings/index.es.js +371 -365
- package/dist/spending/index.es.js +267 -419
- package/dist/spending/utils/SpendingData.d.ts +2 -1
- package/dist/transactions/components/shared/TransactionDetails.d.ts +1 -0
- package/dist/transactions/components/shared/TransactionList.d.ts +1 -0
- package/dist/transactions/index.es.js +231 -226
- package/dist/transactions/stores/TransactionStore.d.ts +1 -1
- package/dist/transactions/stores/UiStore.d.ts +0 -2
- package/dist/trends/index.es.js +988 -612
- package/dist/{useAccountDisplayName-BUAApBIb.mjs → useAccountDisplayName-CcIp09Xc.mjs} +2 -2
- package/dist/{useCombineEvents-BUDIR1ba.mjs → useCombineEvents-kNzLTWCp.mjs} +3 -3
- package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-CNjP5cfR.mjs} +1 -1
- package/dist/{useScreenSize-B6JyS_Lj.mjs → useScreenSize-B5afALev.mjs} +1 -1
- package/package.json +51 -56
- package/dist/AccountDetailsContent-CAM9y39M.mjs +0 -679
- package/dist/AccountDetailsHeader-JtSX6Uf9.mjs +0 -120
- package/dist/AccountListItem-JFMZROh7.mjs +0 -90
- package/dist/CurrencyInput-DUsQbkXb.mjs +0 -85
- package/dist/Drawer-kEE73B87.mjs +0 -113
- package/dist/FinstrongStore-F2c607dj.mjs +0 -101
- package/dist/HeaderCell-DjuifqHJ.mjs +0 -6
- package/dist/LineChart-D4GI7nVh.mjs +0 -541
- package/dist/Loader-DUaFpDGv.mjs +0 -24
- package/dist/MicroWidgetContainer-DpeqN9n3.mjs +0 -45
- package/dist/MiniWidgetContainer-D0gfmbaF.mjs +0 -56
- package/dist/SearchBox-B2_zLv8-.mjs +0 -42
- package/dist/TransactionApi-B3Tksf7L.mjs +0 -86
- package/dist/TransactionDetails-oP1eSuiS.mjs +0 -1334
- package/dist/TrendsStore-DCYbpXPO.mjs +0 -559
- package/dist/common/components/barchart/Bar.d.ts +0 -25
- package/dist/common/components/barchart/BarChart.d.ts +0 -34
- package/dist/common/components/barchart/BarColumn.d.ts +0 -37
- package/dist/common/components/barchart/Legend.d.ts +0 -8
- package/dist/common/components/barchart/Util.d.ts +0 -42
- package/dist/common/components/barchart/index.d.ts +0 -1
- package/dist/common/hooks/usePrevious.d.ts +0 -2
- package/dist/exportTransactionsToCSV-7bVS7KXf.mjs +0 -47
- package/dist/finstrong/utils/Finstrong.d.ts +0 -6
- package/dist/transactions/components/shared/transactionlist/DateRow.d.ts +0 -7
- package/dist/useAriaLive-B3_pRUio.mjs +0 -35
|
@@ -1,218 +1,38 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { observer as
|
|
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
|
|
7
|
-
import
|
|
8
|
-
import
|
|
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
|
|
11
|
-
import { b as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
(
|
|
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
|
|
245
|
-
/* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ s(v, { width: "100%", children: [
|
|
57
|
+
/* @__PURE__ */ s(
|
|
246
58
|
at,
|
|
247
59
|
{
|
|
248
|
-
"aria-label":
|
|
249
|
-
onChange:
|
|
250
|
-
value:
|
|
60
|
+
"aria-label": o.mini_title,
|
|
61
|
+
onChange: A,
|
|
62
|
+
value: g,
|
|
251
63
|
variant: "fullWidth",
|
|
252
64
|
children: [
|
|
253
65
|
/* @__PURE__ */ t(
|
|
254
|
-
|
|
66
|
+
k,
|
|
255
67
|
{
|
|
256
68
|
"aria-controls": "spending-tabpanel",
|
|
257
69
|
id: "spending-tab",
|
|
258
70
|
label: /* @__PURE__ */ t(
|
|
259
|
-
|
|
71
|
+
j,
|
|
260
72
|
{
|
|
261
|
-
amount:
|
|
262
|
-
label:
|
|
73
|
+
amount: m.totalAmount,
|
|
74
|
+
label: o.spend_tab_title
|
|
263
75
|
}
|
|
264
76
|
),
|
|
265
|
-
tabIndex:
|
|
77
|
+
tabIndex: g === 0 ? 0 : -1
|
|
266
78
|
}
|
|
267
79
|
),
|
|
268
80
|
/* @__PURE__ */ t(
|
|
269
|
-
|
|
81
|
+
k,
|
|
270
82
|
{
|
|
271
83
|
"aria-controls": "income-tabpanel",
|
|
272
84
|
id: "income-tab",
|
|
273
85
|
label: /* @__PURE__ */ t(
|
|
274
|
-
|
|
86
|
+
j,
|
|
275
87
|
{
|
|
276
|
-
amount:
|
|
277
|
-
label:
|
|
88
|
+
amount: p.totalAmount,
|
|
89
|
+
label: o.income_tab_title
|
|
278
90
|
}
|
|
279
91
|
),
|
|
280
|
-
tabIndex:
|
|
92
|
+
tabIndex: g === 1 ? 0 : -1
|
|
281
93
|
}
|
|
282
94
|
)
|
|
283
95
|
]
|
|
284
96
|
}
|
|
285
97
|
),
|
|
286
98
|
/* @__PURE__ */ t(
|
|
287
|
-
|
|
99
|
+
v,
|
|
288
100
|
{
|
|
289
101
|
"aria-labelledby": "spending-tab",
|
|
290
|
-
hidden:
|
|
102
|
+
hidden: g !== 0,
|
|
291
103
|
id: "spending-tabpanel",
|
|
292
104
|
role: "tabpanel",
|
|
293
|
-
children: /* @__PURE__ */
|
|
105
|
+
children: /* @__PURE__ */ s(b, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
|
|
294
106
|
/* @__PURE__ */ t(
|
|
295
|
-
|
|
107
|
+
G,
|
|
296
108
|
{
|
|
297
|
-
data:
|
|
298
|
-
onSelected:
|
|
299
|
-
selectedId:
|
|
300
|
-
totalLabel:
|
|
109
|
+
data: m,
|
|
110
|
+
onSelected: f,
|
|
111
|
+
selectedId: e,
|
|
112
|
+
totalLabel: o.total_spending
|
|
301
113
|
}
|
|
302
114
|
),
|
|
303
|
-
/* @__PURE__ */ t(
|
|
115
|
+
/* @__PURE__ */ t(q, { data: m, onSelected: f, selectedId: e })
|
|
304
116
|
] })
|
|
305
117
|
}
|
|
306
118
|
),
|
|
307
119
|
/* @__PURE__ */ t(
|
|
308
|
-
|
|
120
|
+
v,
|
|
309
121
|
{
|
|
310
122
|
"aria-labelledby": "income-tab",
|
|
311
|
-
hidden:
|
|
123
|
+
hidden: g !== 1,
|
|
312
124
|
id: "income-tabpanel",
|
|
313
125
|
role: "tabpanel",
|
|
314
|
-
children: /* @__PURE__ */
|
|
126
|
+
children: /* @__PURE__ */ s(b, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
|
|
315
127
|
/* @__PURE__ */ t(
|
|
316
|
-
|
|
128
|
+
G,
|
|
317
129
|
{
|
|
318
|
-
data:
|
|
130
|
+
data: p,
|
|
319
131
|
isIncome: !0,
|
|
320
|
-
onSelected:
|
|
321
|
-
selectedId:
|
|
322
|
-
totalLabel:
|
|
132
|
+
onSelected: f,
|
|
133
|
+
selectedId: e,
|
|
134
|
+
totalLabel: o.total_income
|
|
323
135
|
}
|
|
324
136
|
),
|
|
325
|
-
/* @__PURE__ */ t(
|
|
137
|
+
/* @__PURE__ */ t(q, { data: p, onSelected: f, selectedId: e })
|
|
326
138
|
] })
|
|
327
139
|
}
|
|
328
140
|
)
|
|
329
|
-
] })
|
|
330
|
-
},
|
|
331
|
-
const {
|
|
332
|
-
return
|
|
333
|
-
o(
|
|
334
|
-
}, [
|
|
335
|
-
|
|
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:
|
|
340
|
-
sx:
|
|
341
|
-
title:
|
|
342
|
-
children: /* @__PURE__ */ t(
|
|
159
|
+
primaryCtaLabel: g.primary_cta,
|
|
160
|
+
sx: { height: "100%", ...d },
|
|
161
|
+
title: g.mini_title,
|
|
162
|
+
children: /* @__PURE__ */ t(At, {})
|
|
343
163
|
}
|
|
344
|
-
);
|
|
345
|
-
},
|
|
164
|
+
) : /* @__PURE__ */ t(lt, {});
|
|
165
|
+
}, me = w(It), Et = ({
|
|
346
166
|
data: n,
|
|
347
|
-
onSelected:
|
|
348
|
-
selectedId:
|
|
349
|
-
title:
|
|
167
|
+
onSelected: d,
|
|
168
|
+
selectedId: o = "",
|
|
169
|
+
title: r
|
|
350
170
|
}) => {
|
|
351
|
-
const { spending: a } =
|
|
352
|
-
return /* @__PURE__ */
|
|
353
|
-
/* @__PURE__ */ t(
|
|
354
|
-
/* @__PURE__ */ t(
|
|
355
|
-
/* @__PURE__ */ t(
|
|
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
|
-
|
|
177
|
+
X,
|
|
358
178
|
{
|
|
359
179
|
disableGutters: !0,
|
|
360
180
|
disablePadding: !0,
|
|
361
181
|
sx: {
|
|
362
182
|
minHeight: 44
|
|
363
183
|
},
|
|
364
|
-
children: /* @__PURE__ */
|
|
365
|
-
|
|
184
|
+
children: /* @__PURE__ */ s(
|
|
185
|
+
xt,
|
|
366
186
|
{
|
|
367
|
-
"aria-expanded":
|
|
368
|
-
onClick: () =>
|
|
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
|
-
|
|
192
|
+
v,
|
|
373
193
|
{
|
|
374
194
|
borderRadius: 4,
|
|
375
195
|
flexShrink: 0,
|
|
376
196
|
height: 8,
|
|
377
|
-
sx: { backgroundColor:
|
|
197
|
+
sx: { backgroundColor: e.color, mr: 8 },
|
|
378
198
|
width: 8
|
|
379
199
|
}
|
|
380
200
|
),
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
|
|
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(
|
|
390
|
-
/* @__PURE__ */ t(
|
|
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(
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
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__ */
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
|
|
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(
|
|
234
|
+
/* @__PURE__ */ t(C, { children: R(l.amount, "0,0") })
|
|
415
235
|
] })
|
|
416
236
|
},
|
|
417
|
-
|
|
237
|
+
l.guid
|
|
418
238
|
)),
|
|
419
|
-
/* @__PURE__ */ t(
|
|
239
|
+
/* @__PURE__ */ t(z, {})
|
|
420
240
|
] }) })
|
|
421
|
-
] },
|
|
422
|
-
/* @__PURE__ */ t(
|
|
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
|
-
},
|
|
244
|
+
}, Wt = w(Et), Nt = ({
|
|
425
245
|
data: n,
|
|
426
|
-
onSelected:
|
|
427
|
-
onViewTransactions:
|
|
428
|
-
selectedId:
|
|
246
|
+
onSelected: d,
|
|
247
|
+
onViewTransactions: o,
|
|
248
|
+
selectedId: r,
|
|
429
249
|
title: a
|
|
430
250
|
}) => {
|
|
431
|
-
const { isDesktop:
|
|
432
|
-
return /* @__PURE__ */
|
|
433
|
-
|
|
251
|
+
const { isDesktop: c, isMobile: e } = vt(), { isLoadingCategoryTotals: l } = W(), { spending: g } = L();
|
|
252
|
+
return /* @__PURE__ */ s(
|
|
253
|
+
b,
|
|
434
254
|
{
|
|
435
|
-
alignItems:
|
|
436
|
-
direction:
|
|
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
|
-
|
|
443
|
-
|
|
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:
|
|
273
|
+
size: c ? 400 : 300,
|
|
454
274
|
totalLabel: "Loading ...",
|
|
455
275
|
variant: "full"
|
|
456
276
|
}
|
|
457
277
|
),
|
|
458
|
-
!
|
|
459
|
-
|
|
278
|
+
!l && /* @__PURE__ */ t(
|
|
279
|
+
G,
|
|
460
280
|
{
|
|
461
281
|
data: n,
|
|
462
|
-
onSelected:
|
|
463
|
-
onViewTransactions:
|
|
464
|
-
selectedId:
|
|
465
|
-
size:
|
|
466
|
-
totalLabel:
|
|
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(
|
|
290
|
+
/* @__PURE__ */ t(Wt, { data: n, onSelected: d, selectedId: r, title: a })
|
|
471
291
|
]
|
|
472
292
|
}
|
|
473
293
|
);
|
|
474
|
-
}, et =
|
|
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
|
-
],
|
|
482
|
-
const n =
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
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 (
|
|
509
|
-
if (
|
|
510
|
-
const
|
|
511
|
-
|
|
512
|
-
...
|
|
513
|
-
custom: (
|
|
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
|
-
|
|
517
|
-
...
|
|
518
|
-
custom: (
|
|
519
|
-
showSplits: !!
|
|
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
|
-
|
|
523
|
-
...
|
|
524
|
-
custom: (
|
|
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
|
-
|
|
347
|
+
H(!0);
|
|
348
|
+
}, pt = () => {
|
|
349
|
+
St(A, f);
|
|
527
350
|
};
|
|
528
|
-
return /* @__PURE__ */
|
|
529
|
-
/* @__PURE__ */
|
|
351
|
+
return /* @__PURE__ */ s(v, { children: [
|
|
352
|
+
/* @__PURE__ */ s(at, { onChange: gt, value: D, variant: "fullWidth", children: [
|
|
530
353
|
/* @__PURE__ */ t(
|
|
531
|
-
|
|
354
|
+
k,
|
|
532
355
|
{
|
|
533
356
|
label: /* @__PURE__ */ t(
|
|
534
|
-
|
|
357
|
+
j,
|
|
535
358
|
{
|
|
536
|
-
amount:
|
|
537
|
-
label:
|
|
359
|
+
amount: $.totalAmount,
|
|
360
|
+
label: e.spend_tab_title
|
|
538
361
|
}
|
|
539
362
|
)
|
|
540
363
|
}
|
|
541
364
|
),
|
|
542
365
|
/* @__PURE__ */ t(
|
|
543
|
-
|
|
366
|
+
k,
|
|
544
367
|
{
|
|
545
368
|
label: /* @__PURE__ */ t(
|
|
546
|
-
|
|
369
|
+
j,
|
|
547
370
|
{
|
|
548
371
|
amount: K.totalAmount,
|
|
549
|
-
label:
|
|
372
|
+
label: e.income_tab_title
|
|
550
373
|
}
|
|
551
374
|
)
|
|
552
375
|
}
|
|
553
376
|
)
|
|
554
377
|
] }),
|
|
555
|
-
|
|
378
|
+
D === 0 && /* @__PURE__ */ t(
|
|
556
379
|
et,
|
|
557
380
|
{
|
|
558
|
-
data:
|
|
559
|
-
onSelected:
|
|
381
|
+
data: $,
|
|
382
|
+
onSelected: U,
|
|
560
383
|
onViewTransactions: Y,
|
|
561
|
-
selectedId:
|
|
562
|
-
title:
|
|
384
|
+
selectedId: M,
|
|
385
|
+
title: e.spend_tab_title
|
|
563
386
|
}
|
|
564
387
|
),
|
|
565
|
-
|
|
388
|
+
D === 1 && /* @__PURE__ */ t(
|
|
566
389
|
et,
|
|
567
390
|
{
|
|
568
391
|
data: K,
|
|
569
|
-
onSelected:
|
|
392
|
+
onSelected: U,
|
|
570
393
|
onViewTransactions: Y,
|
|
571
|
-
selectedId:
|
|
572
|
-
title:
|
|
394
|
+
selectedId: M,
|
|
395
|
+
title: e.income_tab_title
|
|
573
396
|
}
|
|
574
397
|
),
|
|
575
398
|
/* @__PURE__ */ t(
|
|
576
|
-
|
|
399
|
+
Z,
|
|
577
400
|
{
|
|
578
|
-
ariaLabelClose:
|
|
579
|
-
isOpen:
|
|
580
|
-
onClose: () =>
|
|
581
|
-
title:
|
|
582
|
-
children: /* @__PURE__ */
|
|
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
|
-
|
|
420
|
+
Z,
|
|
587
421
|
{
|
|
588
|
-
ariaLabelClose:
|
|
589
|
-
isOpen:
|
|
590
|
-
onClose: () =>
|
|
591
|
-
title:
|
|
592
|
-
children:
|
|
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
|
-
},
|
|
597
|
-
const { visibleAccounts:
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
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
|
|
607
|
-
|
|
454
|
+
return A ? /* @__PURE__ */ t(
|
|
455
|
+
wt,
|
|
608
456
|
{
|
|
609
|
-
accountOptions:
|
|
610
|
-
calendarActions: { onRangeChanged:
|
|
611
|
-
onAccountsFilterClick: () =>
|
|
457
|
+
accountOptions: o,
|
|
458
|
+
calendarActions: { onRangeChanged: O },
|
|
459
|
+
onAccountsFilterClick: () => M(tt.SPENDING_CLICK_FILTER),
|
|
612
460
|
onBackClick: n,
|
|
613
|
-
sx:
|
|
614
|
-
title:
|
|
615
|
-
children: /* @__PURE__ */ t(
|
|
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
|
-
},
|
|
465
|
+
) : /* @__PURE__ */ t(lt, {});
|
|
466
|
+
}, he = w(Gt);
|
|
619
467
|
export {
|
|
620
|
-
|
|
621
|
-
|
|
468
|
+
me as SpendingMiniWidget,
|
|
469
|
+
he as SpendingWidget
|
|
622
470
|
};
|