@mx-cartographer/experiences 8.1.12 → 8.2.0
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 +4 -0
- package/dist/{Account-CMjOp7S2.mjs → Account-BaJmiJAG.mjs} +4 -4
- package/dist/{Account-BIKn4XEZ.mjs → Account-BxHMlV9R.mjs} +1 -1
- package/dist/{AccountDetailsHeader-CzefHTWU.mjs → AccountDetailsHeader-CfdnKyJK.mjs} +21 -21
- package/dist/{AccountFields-BWmpVsS3.mjs → AccountFields-CAy0x_4i.mjs} +6 -6
- package/dist/{AccountListItem-DRDxaRBe.mjs → AccountListItem-BYyeeCf6.mjs} +7 -7
- package/dist/{Accounts-DX3xJE97.mjs → AccountUtils-T5_Odvos.mjs} +1 -1
- package/dist/{Analytics-CxK7O19c.mjs → Analytics-CkYXKvco.mjs} +1 -1
- package/dist/ApiEndpoints-DXwIYNUV.mjs +49 -0
- package/dist/BudgetUtil-Bg2AQJpQ.mjs +74 -0
- package/dist/{Category-Ccoew_sA.mjs → Category-DEKZGLYe.mjs} +3 -3
- package/dist/{CategorySelectorDrawer-hhDdSFHO.mjs → CategorySelectorDrawer-Cu1ohxeM.mjs} +2 -2
- package/dist/{Connect-CBBTL1HJ.mjs → Connect-Dk6GZEsA.mjs} +1 -1
- package/dist/ConnectCard-Dix8BoV_.mjs +54 -0
- package/dist/{ConnectDrawer-DNnuF80E.mjs → ConnectDrawer-DgfsTpyW.mjs} +2 -2
- package/dist/{ConnectionsDrawer-DX6d7uwJ.mjs → ConnectionsDrawer-D7IXAza2.mjs} +2 -2
- package/dist/CurrencyDialog-d4dL7vA5.mjs +371 -0
- package/dist/{CurrencyInput-BMbUVSvz.mjs → CurrencyInput-B59ugxPN.mjs} +15 -16
- package/dist/{CurrencyText-oqd6cX3M.mjs → CurrencyText-CCbE6MmF.mjs} +1 -1
- package/dist/{DateFormats-CaOj_4eI.mjs → DateFormats-HudZ3Bjs.mjs} +6 -7
- package/dist/{DateUtil-D0TO0DaZ.mjs → DateUtil-Bhq59ZVg.mjs} +1 -1
- package/dist/DebtUtils-DD3186U-.mjs +153 -0
- package/dist/EmbeddedCard-BNl3quCs.mjs +856 -0
- package/dist/Error-Dogaw2jO.mjs +84 -0
- package/dist/ErrorBoundary-CsdOcnJ9.mjs +23 -0
- package/dist/{ExportCsvAction-BDFu6YIe.mjs → ExportCsvAction-hDprC41l.mjs} +6 -5
- package/dist/{GlobalAccountFilter-jkFxqPg6.mjs → GlobalAccountFilter-DrhtwPqh.mjs} +1 -1
- package/dist/GlobalCopyApi-wcnDUzMV.mjs +128 -0
- package/dist/GoalsUtil-C9EnLWvC.mjs +107 -0
- package/dist/{Help-C_CM4gpK.mjs → Help-BSQm9o29.mjs} +68 -67
- package/dist/{Help-CgpJK03Q.mjs → Help-CkQTjORd.mjs} +6 -27
- package/dist/InformationTooltip-4su8bn1e.mjs +41 -0
- package/dist/{LineChart-CeZnCZ7j.mjs → LineChart-CejWS_rh.mjs} +2 -2
- package/dist/{ListItemAction-CNpknVvo.mjs → ListItemAction-DGjHxNDJ.mjs} +1 -1
- package/dist/ListItemRow-kH1rn8Xu.mjs +67 -0
- package/dist/ListItemWrapper-B5r-YQQ_.mjs +42 -0
- package/dist/Localization-DnoVyBNK.mjs +38 -0
- package/dist/{ManageIncome-BX2IqW57.mjs → ManageIncome-DwylSiWs.mjs} +51 -51
- package/dist/{MicroWidgetContainer-DAesImQ6.mjs → MicroWidgetContainer-CfKdQfhi.mjs} +1 -1
- package/dist/{MiniWidgetContainer-BOv3n4iw.mjs → MiniWidgetContainer-BdPiUU-u.mjs} +1 -1
- package/dist/NetWorthUtils-DilGN1nW.mjs +95 -0
- package/dist/{NotificationSettings-DatCL2Ej.mjs → NotificationSettings-CCg-Tml2.mjs} +13 -13
- package/dist/NotificationUtils-BRGFTePr.mjs +23 -0
- package/dist/{NumberFormatting-CyrvFgfd.mjs → NumberFormatting--XMeeBfr.mjs} +2 -1
- package/dist/{OriginalBalanceAction-CWQ0CK-T.mjs → OriginalBalanceAction-CvDx0K6k.mjs} +4 -4
- package/dist/{RecurringSettings-DCplGEv_.mjs → RecurringSettings-CPXLW6AR.mjs} +9 -9
- package/dist/RecurringTransactionsUtil-B3rLEx_g.mjs +253 -0
- package/dist/Select-BZRUpOib.mjs +51 -0
- package/dist/SelectionBox-Bx2a5rh4.mjs +48 -0
- package/dist/Sizes-DISGrlUg.mjs +6 -0
- package/dist/{SpendingData-Dj85XEUp.mjs → SpendingData-PKlh8caU.mjs} +6 -6
- package/dist/{SpendingLegend-BS8mHUbu.mjs → SpendingLegend-BmkEr9Nh.mjs} +4 -4
- package/dist/{TransactionDetails-C_skrQk8.mjs → TransactionDetails-CbBSxdOi.mjs} +33 -33
- package/dist/TransactionUtils-BphBJBbU.mjs +234 -0
- package/dist/TrendsUtil-D9z3kIj_.mjs +69 -0
- package/dist/UserStore-CRpKQjpP.mjs +3002 -0
- package/dist/{ViewMoreMicroCard-D1j0w64K.mjs → ViewMoreMicroCard-K69RRs_b.mjs} +28 -30
- package/dist/{WidgetContainer-BPJoDkhL.mjs → WidgetContainer-DalWyz5A.mjs} +3 -3
- package/dist/accounts/hooks/useUiStore.d.ts +6 -1
- package/dist/accounts/index.d.ts +0 -1
- package/dist/accounts/index.es.js +62 -64
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/index.es.js +18 -18
- package/dist/cashflow/context/hooks.d.ts +15 -1
- package/dist/cashflow/index.d.ts +0 -1
- package/dist/cashflow/index.es.js +28 -31
- package/dist/categories/context/hooks.d.ts +19 -1
- package/dist/categories/index.d.ts +0 -1
- package/dist/categories/index.es.js +4 -6
- package/dist/common/constants/ScheduledPayment.d.ts +1 -1
- package/dist/common/constants/index.d.ts +0 -3
- package/dist/common/context/GlobalDataProvider.d.ts +1 -1
- package/dist/common/context/hooks.d.ts +20 -20
- package/dist/common/index.d.ts +3 -1
- package/dist/common/index.es.js +215 -961
- package/dist/common/utils/AccountFilter.d.ts +1 -1
- package/dist/common/utils/index.d.ts +0 -4
- package/dist/{common → core}/constants/DefaultConfig.d.ts +1 -1
- package/dist/core/constants/Transaction.d.ts +10 -0
- package/dist/core/constants/index.d.ts +2 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.es.js +94 -79
- package/dist/{accounts → core}/stores/AccountStore.d.ts +14 -4
- package/dist/{analytics → core}/stores/AnalyticsStore.d.ts +1 -1
- package/dist/{common → core}/stores/AppDataStore.d.ts +4 -5
- package/dist/{insights/store → core/stores}/BeatStore.d.ts +3 -3
- package/dist/{budgets/store → core/stores}/BudgetsStore.d.ts +3 -4
- package/dist/{cashflow/stores/UiStore.d.ts → core/stores/CashflowStore.d.ts} +10 -2
- package/dist/{categories → core}/stores/CategoryStore.d.ts +24 -4
- package/dist/{common → core}/stores/ConnectStore.d.ts +2 -2
- package/dist/core/stores/DebtsStore.d.ts +22 -0
- package/dist/{finstrong → core}/stores/FinstrongStore.d.ts +4 -4
- package/dist/{common → core}/stores/GlobalCopyStore.d.ts +2 -2
- package/dist/{common → core}/stores/GlobalStore.d.ts +2 -25
- package/dist/{common → core}/stores/GlobalUiStore.d.ts +3 -3
- package/dist/{goals → core}/stores/GoalStore.d.ts +3 -3
- package/dist/{help/store → core/stores}/HelpStore.d.ts +4 -6
- package/dist/{investments → core}/stores/HoldingStore.d.ts +4 -4
- package/dist/{merchants → core}/stores/MerchantStore.d.ts +3 -3
- package/dist/{networth → core}/stores/NetWorthStore.d.ts +3 -4
- package/dist/{notifications → core}/stores/NotificationStore.d.ts +3 -3
- package/dist/{recurringtransactions → core}/stores/RecurringTransactionsStore.d.ts +3 -3
- package/dist/{settings → core}/stores/SettingsStore.d.ts +4 -5
- package/dist/{transactions → core}/stores/TransactionStore.d.ts +27 -6
- package/dist/{trends → core}/stores/TrendsStore.d.ts +11 -5
- package/dist/{common → core}/stores/UserStore.d.ts +2 -2
- package/dist/core/stores/index.d.ts +24 -0
- package/dist/{networth → core}/types/NetWorth.d.ts +1 -10
- package/dist/core/types/Offer.d.ts +32 -0
- package/dist/core/types/index.d.ts +3 -1
- package/dist/{accounts/utils/Accounts.d.ts → core/utils/AccountUtils.d.ts} +1 -1
- package/dist/{microinsights/utils/beatUtils.d.ts → core/utils/BeatUtils.d.ts} +1 -1
- package/dist/{budgets → core}/utils/BudgetUtil.d.ts +2 -2
- package/dist/{categories/util → core/utils}/CategoryUtil.d.ts +6 -1
- package/dist/core/utils/DebtUtils.d.ts +31 -0
- package/dist/core/utils/FinstrongUtils.d.ts +7 -0
- package/dist/{goals/util → core/utils}/GoalsUtil.d.ts +1 -1
- package/dist/core/utils/HelpUtil.d.ts +3 -0
- package/dist/{investments/util → core/utils}/InvestmentUtil.d.ts +2 -2
- package/dist/core/utils/Localization.d.ts +3 -0
- package/dist/{networth → core}/utils/NetWorthUtils.d.ts +1 -2
- package/dist/{notifications → core}/utils/NotificationUtils.d.ts +1 -1
- package/dist/{common → core}/utils/NumberFormatting.d.ts +1 -1
- package/dist/{recurringtransactions/util/RecurringTransactions.d.ts → core/utils/RecurringTransactionsUtil.d.ts} +1 -1
- package/dist/{settings/util/Notifications.d.ts → core/utils/SettingsUtil.d.ts} +1 -1
- package/dist/{transactions/utils/buildDetailedTransactions.d.ts → core/utils/TransactionUtils.d.ts} +12 -2
- package/dist/{trends/utils/TrendsData.d.ts → core/utils/TrendsUtil.d.ts} +1 -1
- package/dist/{common/utils/User.d.ts → core/utils/UserUtils.d.ts} +1 -1
- package/dist/core/utils/index.d.ts +1 -1
- package/dist/dashboard/index.es.js +4 -4
- package/dist/debts/components/DebtsChart.d.ts +1 -1
- package/dist/debts/components/DebtsTable.d.ts +1 -1
- package/dist/debts/components/SnowballCard.d.ts +1 -1
- package/dist/debts/components/actions/InterestRateAction.d.ts +1 -1
- package/dist/debts/components/actions/MonthlyPaymentAction.d.ts +1 -1
- package/dist/debts/components/actions/OriginalBalanceAction.d.ts +1 -1
- package/dist/debts/hooks/useDebtsUiStore.d.ts +1 -1
- package/dist/debts/index.d.ts +0 -1
- package/dist/debts/index.es.js +568 -691
- package/dist/debts/utils/DebtsTable.d.ts +1 -1
- package/dist/debts/utils/SnowballCard.d.ts +2 -2
- package/dist/finstrong/index.d.ts +0 -1
- package/dist/finstrong/index.es.js +1565 -1342
- package/dist/finstrong/util/finstrongUtils.d.ts +1 -7
- package/dist/goals/components/addgoal/AddGoalListItem.d.ts +1 -1
- package/dist/goals/index.d.ts +0 -1
- package/dist/goals/index.es.js +71 -73
- package/dist/help/index.es.js +4 -4
- package/dist/help/utils/index.d.ts +0 -1
- package/dist/{hooks-RzCoiTd0.mjs → hooks-BaO_gOI6.mjs} +17 -17
- package/dist/insights/index.d.ts +0 -1
- package/dist/insights/index.es.js +52 -54
- package/dist/investments/components/AnalysisDetails.d.ts +1 -1
- package/dist/investments/index.es.js +6 -6
- package/dist/merchants/index.d.ts +0 -1
- package/dist/merchants/index.es.js +12 -14
- package/dist/microinsights/index.es.js +1 -1
- package/dist/microinsights/interfaces.d.ts +1 -33
- package/dist/networth/components/AssetsLiabilitiesDetail.d.ts +1 -1
- package/dist/networth/components/GainsLossesDetail.d.ts +1 -1
- package/dist/networth/components/NetWorthChange.d.ts +1 -1
- package/dist/networth/components/NetWorthListItem.d.ts +1 -1
- package/dist/networth/components/NetWorthSummary.d.ts +1 -1
- package/dist/networth/index.d.ts +0 -4
- package/dist/networth/index.es.js +232 -237
- package/dist/notifications/index.d.ts +0 -2
- package/dist/notifications/index.es.js +23 -26
- package/dist/recurringtransactions/index.d.ts +0 -1
- package/dist/recurringtransactions/index.es.js +92 -96
- package/dist/settings/index.d.ts +0 -1
- package/dist/settings/index.es.js +11 -13
- package/dist/spending/index.es.js +10 -10
- package/dist/transactions/context/hooks.d.ts +1 -1
- package/dist/transactions/index.d.ts +0 -4
- package/dist/transactions/index.es.js +102 -109
- package/dist/trends/index.d.ts +0 -1
- package/dist/trends/index.es.js +67 -68
- package/dist/trends/utils/shared.d.ts +1 -1
- package/dist/{useAccountDisplayName-pliH6hz0.mjs → useAccountDisplayName-CFa_MrS6.mjs} +1 -1
- package/dist/{useInsightsEnabled-CzJoG8xi.mjs → useInsightsEnabled-DaNLPmUU.mjs} +1 -1
- package/dist/{useWidgetLoadTimer-BZjr-BiE.mjs → useWidgetLoadTimer-CJb-RELP.mjs} +1 -1
- package/package.json +1 -1
- package/dist/AccountApi-WEM2M9tg.mjs +0 -19
- package/dist/AccountStore-CGrjC2Oe.mjs +0 -253
- package/dist/ApiEndpoints-C5IA97i7.mjs +0 -118
- package/dist/BeatApi-C6pBa0Rb.mjs +0 -21
- package/dist/BeatStore-C7-PIhpB.mjs +0 -163
- package/dist/BudgetUtil-H9igoNVm.mjs +0 -479
- package/dist/CashflowStore-BEi92kJg.mjs +0 -91
- package/dist/CategoryApi-CogDFScz.mjs +0 -29
- package/dist/CategoryStore-CA4NTaKH.mjs +0 -160
- package/dist/CategoryUtil-BJOHgYKS.mjs +0 -80
- package/dist/DebtsStore-BJlC2-yO.mjs +0 -63
- package/dist/EmbeddedCard-B9JoBaan.mjs +0 -811
- package/dist/FinstrongApi-FpmsS_sy.mjs +0 -19
- package/dist/FinstrongStore-DYawCv1d.mjs +0 -435
- package/dist/GlobalCopyApi-DkS-2Zf_.mjs +0 -41
- package/dist/Goal-MFBpoOIC.mjs +0 -29
- package/dist/GoalStore-BBAEbf43.mjs +0 -395
- package/dist/Localization-C_HZg9tJ.mjs +0 -15
- package/dist/Localization-CkQ49EKr.mjs +0 -26
- package/dist/MerchantApi-D8ahYxiG.mjs +0 -15
- package/dist/MerchantStore-CyZTv-BM.mjs +0 -26
- package/dist/NetWorthStore-BY-B_hxy.mjs +0 -168
- package/dist/NotificationApi-DF0obHoR.mjs +0 -20
- package/dist/NotificationStore-DlAM5Ue0.mjs +0 -69
- package/dist/RecurringTransactions-DCt94TN4.mjs +0 -297
- package/dist/RecurringTransactionsStore-CFJYC7lI.mjs +0 -264
- package/dist/RepeatingTransaction-D2gmBTd0.mjs +0 -7
- package/dist/RepeatingTransactionsApi-BNZgZPLs.mjs +0 -17
- package/dist/SettingsApi-D9d7SLhB.mjs +0 -22
- package/dist/SettingsStore-BcbuKfFO.mjs +0 -250
- package/dist/Transaction-Cn5_iFm0.mjs +0 -5
- package/dist/TransactionApi-CLG2eSNe.mjs +0 -86
- package/dist/TransactionStore-amPYxHnA.mjs +0 -710
- package/dist/TrendsStore-bYjIGqyR.mjs +0 -183
- package/dist/WidgetApi-C0BA2cFX.mjs +0 -102
- package/dist/accounts/stores/UiStore.d.ts +0 -10
- package/dist/accounts/utils/index.d.ts +0 -1
- package/dist/cashflow/stores/CashflowStore.d.ts +0 -8
- package/dist/categories/stores/UiStore.d.ts +0 -20
- package/dist/common/stores/index.d.ts +0 -3
- package/dist/common/utils/Categories.d.ts +0 -6
- package/dist/common/utils/Localization.d.ts +0 -3
- package/dist/debts/store/DebtsStore.d.ts +0 -10
- package/dist/debts/store/DebtsUiStore.d.ts +0 -13
- package/dist/debts/utils/DebtStore.d.ts +0 -4
- package/dist/debts/utils/DebtsWidget.d.ts +0 -20
- package/dist/debts/utils/shared.d.ts +0 -12
- package/dist/exportTransactionsToCSV-CSvbZrvL.mjs +0 -133
- package/dist/help/constants/index.d.ts +0 -1
- package/dist/help/utils/getAccessibleHelpCategories.d.ts +0 -3
- package/dist/transactions/analytics.d.ts +0 -3
- package/dist/transactions/constants/Transaction.d.ts +0 -2
- package/dist/transactions/constants/TransactionsTable.d.ts +0 -17
- package/dist/transactions/stores/UiStore.d.ts +0 -25
- package/dist/transactions/utils/exportTransactionsToCSV.d.ts +0 -9
- package/dist/transactions/utils/sortAndFilterTransactions.d.ts +0 -3
- /package/dist/{common → core}/constants/Category.d.ts +0 -0
- /package/dist/{common → core}/constants/DateFormats.d.ts +0 -0
- /package/dist/{debts/constants/index.d.ts → core/constants/Debts.d.ts} +0 -0
- /package/dist/{help → core}/constants/Help.d.ts +0 -0
- /package/dist/{investments/constants/index.d.ts → core/constants/Investments.d.ts} +0 -0
- /package/dist/{common → core}/constants/Numbers.d.ts +0 -0
- /package/dist/{common → core}/constants/Table.d.ts +0 -0
- /package/dist/{common → core}/utils/DateUtil.d.ts +0 -0
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { makeAutoObservable as c, observable as f, runInAction as l } from "mobx";
|
|
2
|
-
import { N as s } from "./NotificationApi-DF0obHoR.mjs";
|
|
3
|
-
import { fromUnixTime as a, isSameDay as u } from "date-fns";
|
|
4
|
-
import { I as d } from "./Notification-DTNYSd8P.mjs";
|
|
5
|
-
let n = null;
|
|
6
|
-
const _ = () => (n || (n = new Set(
|
|
7
|
-
Object.values(d).filter(
|
|
8
|
-
(t) => typeof t == "number"
|
|
9
|
-
)
|
|
10
|
-
)), n), g = (t, i) => {
|
|
11
|
-
const e = a(i[t].delivered_at), o = a(i[t - 1]?.delivered_at);
|
|
12
|
-
return !u(e, o);
|
|
13
|
-
};
|
|
14
|
-
function h(t) {
|
|
15
|
-
const e = Math.floor(Date.now() / 1e3);
|
|
16
|
-
return t.filter((o) => {
|
|
17
|
-
const r = o.delivered_at;
|
|
18
|
-
return e - r <= 2592e3;
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
class v {
|
|
22
|
-
globalStore;
|
|
23
|
-
api = new s("/", "");
|
|
24
|
-
isLoading = !0;
|
|
25
|
-
notifications = [];
|
|
26
|
-
notificationsLoaded = !1;
|
|
27
|
-
constructor(i) {
|
|
28
|
-
this.globalStore = i, this.api = new s(
|
|
29
|
-
i.endpoint,
|
|
30
|
-
i.sessionToken,
|
|
31
|
-
i.onError
|
|
32
|
-
), c(this, { notifications: f });
|
|
33
|
-
}
|
|
34
|
-
// Used in Money Dashboard
|
|
35
|
-
get newNotifications() {
|
|
36
|
-
return this.recentNotifications.filter((i) => !i.has_been_viewed);
|
|
37
|
-
}
|
|
38
|
-
get recentNotifications() {
|
|
39
|
-
return h(this.notifications);
|
|
40
|
-
}
|
|
41
|
-
setNotifications = (i) => {
|
|
42
|
-
this.notifications = i, this.notificationsLoaded = !0;
|
|
43
|
-
};
|
|
44
|
-
loadNotifications = async () => {
|
|
45
|
-
this.isLoading = !0;
|
|
46
|
-
try {
|
|
47
|
-
const i = await this.api.getNotifications();
|
|
48
|
-
this.setNotifications(i);
|
|
49
|
-
} catch (i) {
|
|
50
|
-
console.error(`Error occurred while loading notifications: ${i}`);
|
|
51
|
-
} finally {
|
|
52
|
-
l(() => {
|
|
53
|
-
this.isLoading = !1;
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
markAllAsViewed = async () => {
|
|
58
|
-
await this.api.markAllAsViewed();
|
|
59
|
-
};
|
|
60
|
-
updateNotification = async (i) => {
|
|
61
|
-
i.has_been_viewed = !0, await this.api.updateNotification(i);
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
export {
|
|
65
|
-
v as N,
|
|
66
|
-
h as f,
|
|
67
|
-
_ as g,
|
|
68
|
-
g as s
|
|
69
|
-
};
|
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
import { jsx as d, jsxs as O, Fragment as L } from "react/jsx-runtime";
|
|
2
|
-
import F from "@mui/material/Avatar";
|
|
3
|
-
import M from "@mui/material/ListItem";
|
|
4
|
-
import G from "@mui/material/ListItemAvatar";
|
|
5
|
-
import P from "@mui/material/ListItemButton";
|
|
6
|
-
import R from "@mui/material/ListItemIcon";
|
|
7
|
-
import q from "@mui/material/ListItemText";
|
|
8
|
-
import { Icon as w } from "@mxenabled/mxui";
|
|
9
|
-
import C from "@mui/material/MenuItem";
|
|
10
|
-
import U from "@mui/material/TextField";
|
|
11
|
-
import { ExpandMore as $ } from "@mxenabled/mx-icons";
|
|
12
|
-
import { addDays as A } from "date-fns/addDays";
|
|
13
|
-
import { addMonths as p } from "date-fns/addMonths";
|
|
14
|
-
import { addQuarters as Q } from "date-fns/addQuarters";
|
|
15
|
-
import { addWeeks as W } from "date-fns/addWeeks";
|
|
16
|
-
import { addYears as j } from "date-fns/addYears";
|
|
17
|
-
import { formatISO as z } from "date-fns/formatISO";
|
|
18
|
-
import { fromUnixTime as K } from "date-fns/fromUnixTime";
|
|
19
|
-
import { getUnixTime as f } from "date-fns/getUnixTime";
|
|
20
|
-
import { isAfter as y } from "date-fns/isAfter";
|
|
21
|
-
import { isBefore as u } from "date-fns/isBefore";
|
|
22
|
-
import { isSameDay as H } from "date-fns/isSameDay";
|
|
23
|
-
import { lastDayOfMonth as T } from "date-fns/lastDayOfMonth";
|
|
24
|
-
import { nextDay as b } from "date-fns/nextDay";
|
|
25
|
-
import { parseISO as V } from "date-fns/parseISO";
|
|
26
|
-
import { setDate as _ } from "date-fns/setDate";
|
|
27
|
-
import { setDay as J } from "date-fns/setDay";
|
|
28
|
-
import { setDayOfYear as S } from "date-fns/setDayOfYear";
|
|
29
|
-
import { startOfToday as E } from "date-fns/startOfToday";
|
|
30
|
-
import { subDays as I } from "date-fns/subDays";
|
|
31
|
-
import { subMonths as X } from "date-fns/subMonths";
|
|
32
|
-
import { subQuarters as B } from "date-fns/subQuarters";
|
|
33
|
-
import { subWeeks as Z } from "date-fns/subWeeks";
|
|
34
|
-
import { subYears as ee } from "date-fns/subYears";
|
|
35
|
-
import { g as te, a as re, b as ae, c as oe, d as se, e as ne, h as ce } from "./DateUtil-D0TO0DaZ.mjs";
|
|
36
|
-
import { F as n, b as ie, a as Y, R as g } from "./RepeatingTransaction-D2gmBTd0.mjs";
|
|
37
|
-
import { b as N } from "./NumberFormatting-CyrvFgfd.mjs";
|
|
38
|
-
import { b as h } from "./Localization-CkQ49EKr.mjs";
|
|
39
|
-
import { f as v, D as k } from "./DateFormats-CaOj_4eI.mjs";
|
|
40
|
-
const ot = ({ iconName: e, label: o, onClick: r, value: a }) => {
|
|
41
|
-
const t = /* @__PURE__ */ O(L, { children: [
|
|
42
|
-
/* @__PURE__ */ d(G, { children: /* @__PURE__ */ d(F, { sx: { bgcolor: "neutral.light" }, variant: "rounded", children: /* @__PURE__ */ d(w, { name: e, sx: { color: "text.primary" } }) }) }),
|
|
43
|
-
/* @__PURE__ */ d(
|
|
44
|
-
q,
|
|
45
|
-
{
|
|
46
|
-
primary: o,
|
|
47
|
-
primaryTypographyProps: { variant: "caption" },
|
|
48
|
-
secondary: a,
|
|
49
|
-
secondaryTypographyProps: { color: "text.default", variant: "body1", fontWeight: 600 }
|
|
50
|
-
}
|
|
51
|
-
)
|
|
52
|
-
] });
|
|
53
|
-
return r ? /* @__PURE__ */ d(M, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ O(P, { onClick: r, children: [
|
|
54
|
-
t,
|
|
55
|
-
/* @__PURE__ */ d(R, { children: /* @__PURE__ */ d(w, { name: "chevron_right", size: 24 }) })
|
|
56
|
-
] }) }) : /* @__PURE__ */ d(M, { disableGutters: !1, disablePadding: !1, children: t });
|
|
57
|
-
}, st = ({ label: e, onChange: o, options: r, value: a, ...t }) => /* @__PURE__ */ d(
|
|
58
|
-
U,
|
|
59
|
-
{
|
|
60
|
-
InputLabelProps: { shrink: !0 },
|
|
61
|
-
SelectProps: {
|
|
62
|
-
IconComponent: (c) => /* @__PURE__ */ d($, { size: 20, sx: { mr: 4 }, ...c })
|
|
63
|
-
},
|
|
64
|
-
defaultValue: 0,
|
|
65
|
-
label: e,
|
|
66
|
-
onChange: (c) => {
|
|
67
|
-
o(Number(c.target.value));
|
|
68
|
-
},
|
|
69
|
-
select: !0,
|
|
70
|
-
value: a,
|
|
71
|
-
variant: "outlined",
|
|
72
|
-
...t,
|
|
73
|
-
children: r.map((c) => /* @__PURE__ */ d(C, { value: c.id, children: c.label }, c.id))
|
|
74
|
-
}
|
|
75
|
-
), ue = (e) => {
|
|
76
|
-
if (!e) return "";
|
|
77
|
-
let o = e.user_name || e.feed_name || "";
|
|
78
|
-
return e.account_number && (o = `${o} *${e.account_number}`), o;
|
|
79
|
-
}, de = (e, o) => {
|
|
80
|
-
const r = [], a = e.recurrence_type === n.EveryYear, t = e.transactions.find(
|
|
81
|
-
(m) => m.repeating_transaction_guid === e.guid
|
|
82
|
-
);
|
|
83
|
-
if (!a && !t) return [];
|
|
84
|
-
const s = V(e.predicted_occurs_on), c = {
|
|
85
|
-
accountGuid: e.account?.guid || "",
|
|
86
|
-
amount: e.amount,
|
|
87
|
-
categoryGuid: t?.category_guid || "",
|
|
88
|
-
expectedDate: s,
|
|
89
|
-
frequency: e.recurrence_type,
|
|
90
|
-
institutionGuid: e.account?.institution_guid || "",
|
|
91
|
-
institutionName: ue(e.account),
|
|
92
|
-
merchantGuid: e.merchant_guid,
|
|
93
|
-
name: e.description,
|
|
94
|
-
recurrenceDay: e.recurrence_day,
|
|
95
|
-
repeatingTransactionGuid: e.guid,
|
|
96
|
-
secondRecurrenceDay: e.second_recurrence_day,
|
|
97
|
-
status: g.Upcoming,
|
|
98
|
-
type: e.repeating_transaction_type === ie.Income ? Y.Income : Y.Expense,
|
|
99
|
-
transaction: void 0
|
|
100
|
-
}, i = o.start, l = o.end;
|
|
101
|
-
switch (e.recurrence_type) {
|
|
102
|
-
case n.EveryWeek:
|
|
103
|
-
r.push(...me(c, i, l));
|
|
104
|
-
break;
|
|
105
|
-
case n.EveryOtherWeek:
|
|
106
|
-
r.push(...le(c, i, l));
|
|
107
|
-
break;
|
|
108
|
-
case n.TwiceAMonth:
|
|
109
|
-
r.push(...he(c, i, l));
|
|
110
|
-
break;
|
|
111
|
-
case n.EveryMonth:
|
|
112
|
-
r.push(...pe(c, i, l));
|
|
113
|
-
break;
|
|
114
|
-
case n.EveryOtherMonth:
|
|
115
|
-
r.push(...ye(c, i, l));
|
|
116
|
-
break;
|
|
117
|
-
case n.EveryQuarter:
|
|
118
|
-
r.push(...fe(c, i, l));
|
|
119
|
-
break;
|
|
120
|
-
case n.EveryOtherQuarter:
|
|
121
|
-
r.push(..._e(c, i, l));
|
|
122
|
-
break;
|
|
123
|
-
case n.EveryYear:
|
|
124
|
-
r.push(...De(c, i, l));
|
|
125
|
-
break;
|
|
126
|
-
}
|
|
127
|
-
for (const m of r) {
|
|
128
|
-
const D = e.transactions.find(
|
|
129
|
-
(x) => x.repeating_transaction_guid === e.guid && x.date > f(I(m.expectedDate, 5)) && x.date < f(A(m.expectedDate, 5))
|
|
130
|
-
);
|
|
131
|
-
D ? (m.transaction = D, m.status = g.Paid, m.occurredOnDate = K(D.date)) : u(m.expectedDate, I(E(), 3)) && (m.status = g.Missed);
|
|
132
|
-
}
|
|
133
|
-
return r;
|
|
134
|
-
}, me = (e, o, r) => {
|
|
135
|
-
const a = [];
|
|
136
|
-
let t = b(o, e.recurrenceDay);
|
|
137
|
-
for (; u(t, r); )
|
|
138
|
-
a.push({ ...e, expectedDate: t }), t = b(t, e.recurrenceDay);
|
|
139
|
-
return a;
|
|
140
|
-
}, le = (e, o, r) => {
|
|
141
|
-
const a = [];
|
|
142
|
-
let t = e.expectedDate;
|
|
143
|
-
if (u(t, o))
|
|
144
|
-
for (; u(t, o); )
|
|
145
|
-
t = W(t, 2);
|
|
146
|
-
else {
|
|
147
|
-
for (; y(t, o) || H(t, o); )
|
|
148
|
-
t = Z(t, 2);
|
|
149
|
-
t = W(t, 2);
|
|
150
|
-
}
|
|
151
|
-
for (; u(t, r); )
|
|
152
|
-
a.push({ ...e, expectedDate: t }), t = A(t, 14);
|
|
153
|
-
return a;
|
|
154
|
-
}, he = (e, o, r) => {
|
|
155
|
-
const a = [];
|
|
156
|
-
let t = _(o, e.recurrenceDay);
|
|
157
|
-
for (; u(t, r); )
|
|
158
|
-
a.push({ ...e, expectedDate: t }), t = p(t, 1);
|
|
159
|
-
let s = e.secondRecurrenceDay && e.secondRecurrenceDay < 28 ? _(o, e.secondRecurrenceDay) : T(o);
|
|
160
|
-
for (; u(s, r); )
|
|
161
|
-
a.push({ ...e, expectedDate: s }), s = p(s, 1);
|
|
162
|
-
return a;
|
|
163
|
-
}, pe = (e, o, r) => {
|
|
164
|
-
const a = [];
|
|
165
|
-
let t = _(o, e.recurrenceDay);
|
|
166
|
-
for (a.push({ ...e, expectedDate: t }), t = p(t, 1); u(t, r); )
|
|
167
|
-
a.push({ ...e, expectedDate: t }), t = p(t, 1);
|
|
168
|
-
return a;
|
|
169
|
-
}, ye = (e, o, r) => {
|
|
170
|
-
const a = [], t = e.expectedDate;
|
|
171
|
-
let s = u(t, r) ? t : X(t, 2);
|
|
172
|
-
for (; u(s, r); )
|
|
173
|
-
y(s, o) && a.push({ ...e, expectedDate: s }), s = p(s, 2);
|
|
174
|
-
return a;
|
|
175
|
-
}, fe = (e, o, r) => {
|
|
176
|
-
const a = [], t = e.expectedDate;
|
|
177
|
-
let s = u(t, r) ? t : B(t, 1);
|
|
178
|
-
for (; u(s, r); )
|
|
179
|
-
y(s, o) && a.push({ ...e, expectedDate: s }), s = Q(s, 1);
|
|
180
|
-
return a;
|
|
181
|
-
}, _e = (e, o, r) => {
|
|
182
|
-
const a = [], t = e.expectedDate;
|
|
183
|
-
let s = u(t, r) ? t : B(t, 2);
|
|
184
|
-
for (; u(s, r); )
|
|
185
|
-
y(s, o) && a.push({ ...e, expectedDate: s }), s = Q(s, 2);
|
|
186
|
-
return a;
|
|
187
|
-
}, De = (e, o, r) => {
|
|
188
|
-
const a = [], t = e.expectedDate;
|
|
189
|
-
let s = u(t, r) ? t : ee(t, 1);
|
|
190
|
-
for (; u(s, r); )
|
|
191
|
-
y(s, o) && a.push({ ...e, expectedDate: s }), s = j(s, 1);
|
|
192
|
-
return a;
|
|
193
|
-
}, nt = (e, o) => {
|
|
194
|
-
const r = [];
|
|
195
|
-
for (const a of e) {
|
|
196
|
-
const t = de(a, o);
|
|
197
|
-
r.push(...t);
|
|
198
|
-
}
|
|
199
|
-
return r.sort(
|
|
200
|
-
(a, t) => f(a.occurredOnDate || a.expectedDate) - f(t.occurredOnDate || t.expectedDate)
|
|
201
|
-
);
|
|
202
|
-
}, ct = (e, o, r) => {
|
|
203
|
-
const a = [];
|
|
204
|
-
for (const t of o) {
|
|
205
|
-
const s = r.filter(
|
|
206
|
-
(c) => c.repeating_transaction_guid === t.guid
|
|
207
|
-
);
|
|
208
|
-
r.length > 0 && a.push({
|
|
209
|
-
...t,
|
|
210
|
-
account: e.find((c) => c.guid === t.account_guid),
|
|
211
|
-
transactions: s
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
return a;
|
|
215
|
-
}, it = (e) => e.reduce((o, r) => {
|
|
216
|
-
const a = z(r.expectedDate, { representation: "date" }), t = o.find(
|
|
217
|
-
(s) => s.date.toString() === r.expectedDate.toString()
|
|
218
|
-
);
|
|
219
|
-
return t ? t.recurrences.push(r) : o.push({
|
|
220
|
-
date: r.expectedDate,
|
|
221
|
-
id: `date-${a}`,
|
|
222
|
-
recurrences: [r]
|
|
223
|
-
}), o;
|
|
224
|
-
}, []), ut = (e, o, r) => {
|
|
225
|
-
const a = b(E(), o.recurrence_day), t = S(E(), o.recurrence_day), s = N(o.recurrence_day), c = o.second_recurrence_day ? N(o.second_recurrence_day) : "";
|
|
226
|
-
let i = r ? h(e.monthly_ordinal, s) : e.monthly;
|
|
227
|
-
switch (o.recurrence_type) {
|
|
228
|
-
case n.EveryQuarter:
|
|
229
|
-
i = r ? h(e.quarterly_ordinal, s) : e.quarterly;
|
|
230
|
-
break;
|
|
231
|
-
case n.EveryWeek:
|
|
232
|
-
i = r ? h(
|
|
233
|
-
e.weekly_ordinal,
|
|
234
|
-
v(a, k.DAY_OF_WEEK)
|
|
235
|
-
) : e.weekly;
|
|
236
|
-
break;
|
|
237
|
-
case n.EveryYear:
|
|
238
|
-
i = r ? h(
|
|
239
|
-
e.anually_ordinal,
|
|
240
|
-
v(t, k.MONTH_DAY)
|
|
241
|
-
) : e.anually;
|
|
242
|
-
break;
|
|
243
|
-
case n.EveryOtherWeek:
|
|
244
|
-
i = r ? h(
|
|
245
|
-
e.every_other_week_ordinal,
|
|
246
|
-
v(a, k.DAY_OF_WEEK)
|
|
247
|
-
) : e.every_other_week;
|
|
248
|
-
break;
|
|
249
|
-
case n.EveryOtherMonth:
|
|
250
|
-
i = r ? h(e.every_other_month_ordinal, s) : e.every_other_month;
|
|
251
|
-
break;
|
|
252
|
-
case n.EveryOtherQuarter:
|
|
253
|
-
i = r ? h(e.every_other_quarter_ordinal, s) : e.every_other_quarter;
|
|
254
|
-
break;
|
|
255
|
-
case n.TwiceAMonth:
|
|
256
|
-
i = r ? h(e.twice_a_month_ordinal, s, c) : e.twice_a_month;
|
|
257
|
-
break;
|
|
258
|
-
}
|
|
259
|
-
return i;
|
|
260
|
-
}, dt = (e, o, r) => {
|
|
261
|
-
let a = o;
|
|
262
|
-
r !== void 0 && (e === n.EveryWeek || e === n.EveryOtherWeek ? a = J(o, r) : e === n.EveryYear ? a = S(o, r) : a = _(o, r));
|
|
263
|
-
let t = a;
|
|
264
|
-
switch (e) {
|
|
265
|
-
case n.EveryWeek:
|
|
266
|
-
t = ce(a);
|
|
267
|
-
break;
|
|
268
|
-
case n.EveryOtherWeek:
|
|
269
|
-
t = ne(a);
|
|
270
|
-
break;
|
|
271
|
-
case n.EveryMonth:
|
|
272
|
-
t = se(a);
|
|
273
|
-
break;
|
|
274
|
-
case n.EveryOtherMonth:
|
|
275
|
-
t = oe(a);
|
|
276
|
-
break;
|
|
277
|
-
case n.EveryQuarter:
|
|
278
|
-
t = ae(a);
|
|
279
|
-
break;
|
|
280
|
-
case n.EveryOtherQuarter:
|
|
281
|
-
t = re(a);
|
|
282
|
-
break;
|
|
283
|
-
case n.EveryYear:
|
|
284
|
-
t = te(a);
|
|
285
|
-
break;
|
|
286
|
-
}
|
|
287
|
-
return t;
|
|
288
|
-
};
|
|
289
|
-
export {
|
|
290
|
-
ot as D,
|
|
291
|
-
st as S,
|
|
292
|
-
ct as a,
|
|
293
|
-
nt as b,
|
|
294
|
-
dt as c,
|
|
295
|
-
it as d,
|
|
296
|
-
ut as g
|
|
297
|
-
};
|
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
import { makeAutoObservable as T, runInAction as o } from "mobx";
|
|
2
|
-
import { endOfMonth as f } from "date-fns/endOfMonth";
|
|
3
|
-
import { isAfter as u } from "date-fns/isAfter";
|
|
4
|
-
import { isBefore as R } from "date-fns/isBefore";
|
|
5
|
-
import { isSameDay as g } from "date-fns/isSameDay";
|
|
6
|
-
import { isWithinInterval as h } from "date-fns/isWithinInterval";
|
|
7
|
-
import { startOfMonth as x } from "date-fns/startOfMonth";
|
|
8
|
-
import { startOfToday as i } from "date-fns/startOfToday";
|
|
9
|
-
import { subDays as S } from "date-fns/subDays";
|
|
10
|
-
import { R as p } from "./RepeatingTransactionsApi-BNZgZPLs.mjs";
|
|
11
|
-
import { a as c, b as y } from "./RecurringTransactions-DCt94TN4.mjs";
|
|
12
|
-
import { R as a, a as l } from "./RepeatingTransaction-D2gmBTd0.mjs";
|
|
13
|
-
var D = /* @__PURE__ */ ((n) => (n.Small = "small", n.Medium = "medium", n.Large = "large", n))(D || {});
|
|
14
|
-
const L = 44, d = (n, e) => h(e.expectedDate, n), s = (n, e) => n + e.amount;
|
|
15
|
-
class k {
|
|
16
|
-
globalStore;
|
|
17
|
-
api = new p("/", "");
|
|
18
|
-
repeatingTransactions = [];
|
|
19
|
-
isDataLoaded = !1;
|
|
20
|
-
selectedDay;
|
|
21
|
-
dateRange = { start: x(i()), end: f(i()) };
|
|
22
|
-
constructor(e) {
|
|
23
|
-
this.globalStore = e, this.api = new p(
|
|
24
|
-
e.endpoint,
|
|
25
|
-
e.sessionToken,
|
|
26
|
-
e.onError
|
|
27
|
-
), T(this);
|
|
28
|
-
}
|
|
29
|
-
get detailedRepeatingTransactions() {
|
|
30
|
-
return c(
|
|
31
|
-
this.globalStore.accountStore.visibleAccounts,
|
|
32
|
-
this.repeatingTransactions,
|
|
33
|
-
this.globalStore.transactionStore.transactions
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Returns all recurrences built from repeating transactions and filtered by accounts.
|
|
38
|
-
*/
|
|
39
|
-
get recurrences() {
|
|
40
|
-
const e = this.globalStore.accountStore.visibleAccounts;
|
|
41
|
-
return y(this.detailedRepeatingTransactions, this.dateRange).filter((t) => e.some((r) => r.guid === t.accountGuid && !r.is_excluded_from_accounts)).filter((t) => h(t.expectedDate, this.dateRange));
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Returns all recurrences that have occurred in the past, including those that are paid or missed
|
|
45
|
-
*/
|
|
46
|
-
get pastRecurrences() {
|
|
47
|
-
return this.recurrences.filter(
|
|
48
|
-
(e) => e.status === a.Paid || e.status === a.Missed
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Returns all recurrences that are expected to occur through the end of the month
|
|
53
|
-
* or should have occurred in the last 3 days.
|
|
54
|
-
*/
|
|
55
|
-
get upcomingRecurrences() {
|
|
56
|
-
return this.recurrences.filter(
|
|
57
|
-
(e) => u(e.expectedDate, S(i(), 3)) && R(e.expectedDate, this.dateRange.end) && e.status === a.Upcoming
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Returns all expense recurrences.
|
|
62
|
-
*/
|
|
63
|
-
get expenses() {
|
|
64
|
-
return this.recurrences.filter(
|
|
65
|
-
(e) => e.type === l.Expense
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Returns the upcoming expense recurrences.
|
|
70
|
-
*/
|
|
71
|
-
get upcomingExpenses() {
|
|
72
|
-
return this.expenses.filter(
|
|
73
|
-
(e) => e.status === a.Upcoming
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Returns all income recurrences.
|
|
78
|
-
*/
|
|
79
|
-
get income() {
|
|
80
|
-
return this.recurrences.filter(
|
|
81
|
-
(e) => e.type === l.Income
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Returns the upcoming income recurrences.
|
|
86
|
-
*/
|
|
87
|
-
get upcomingIncome() {
|
|
88
|
-
return this.income.filter(
|
|
89
|
-
(e) => e.status === a.Upcoming
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
get nextIncomeRecurrence() {
|
|
93
|
-
return this.upcomingIncome.find((e) => u(e.expectedDate, i()));
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Returns the expense recurrences for the current month.
|
|
97
|
-
*/
|
|
98
|
-
get currentMonthExpenses() {
|
|
99
|
-
return this.expenses.filter(
|
|
100
|
-
(e) => d(this.dateRange, e)
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Returns the income recurrences for the current month.
|
|
105
|
-
*/
|
|
106
|
-
get currentMonthIncome() {
|
|
107
|
-
return this.income.filter(
|
|
108
|
-
(e) => d(this.dateRange, e)
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Calculates the total amount of all expenses for the current month.
|
|
113
|
-
*/
|
|
114
|
-
get expenseTotal() {
|
|
115
|
-
return this.currentMonthExpenses.reduce(s, 0);
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Calculates the total amount of all paid expenses for the current month.
|
|
119
|
-
*/
|
|
120
|
-
get paidExpenseTotal() {
|
|
121
|
-
return this.currentMonthExpenses.filter((e) => e.status === a.Paid).reduce(s, 0);
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Calculates the total amount of all missed expenses for the current month.
|
|
125
|
-
*/
|
|
126
|
-
get missedExpenseTotal() {
|
|
127
|
-
return this.currentMonthExpenses.filter((e) => e.status === a.Missed).reduce(s, 0);
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Calculates the total amount of all upcoming expenses for the current month.
|
|
131
|
-
*/
|
|
132
|
-
get upcomingExpenseTotal() {
|
|
133
|
-
return this.currentMonthExpenses.filter((e) => e.status === a.Upcoming).reduce(s, 0);
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Calculates the total amount of all income for the current month.
|
|
137
|
-
*/
|
|
138
|
-
get incomeTotal() {
|
|
139
|
-
return this.currentMonthIncome.reduce(s, 0);
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Calculates the total amount of all paid income for the current month.
|
|
143
|
-
*/
|
|
144
|
-
get paidIncomeTotal() {
|
|
145
|
-
return this.currentMonthIncome.filter((e) => e.status === a.Paid).reduce(s, 0);
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Calculates the total amount of all upcoming income for the current month.
|
|
149
|
-
*/
|
|
150
|
-
get upcomingIncomeTotal() {
|
|
151
|
-
return this.currentMonthIncome.filter((e) => e.status === a.Upcoming).reduce(s, 0);
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Get the recurrences for the currently selected day.
|
|
155
|
-
*/
|
|
156
|
-
get selectedDayRecurrences() {
|
|
157
|
-
return this.selectedDay && this.recurrences.filter(
|
|
158
|
-
(e) => this.selectedDay && g(e.occurredOnDate || e.expectedDate, this.selectedDay)
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
setRepeatingTransactions = (e) => {
|
|
162
|
-
this.repeatingTransactions = e, this.isDataLoaded = !0;
|
|
163
|
-
};
|
|
164
|
-
/**
|
|
165
|
-
* Set the date range for filtering recurrences.
|
|
166
|
-
* @param dateRange - The date range to set.
|
|
167
|
-
*/
|
|
168
|
-
setDateRange = (e) => this.dateRange = e;
|
|
169
|
-
/**
|
|
170
|
-
* Set the currently selected day.
|
|
171
|
-
* @param day - The day to select.
|
|
172
|
-
*/
|
|
173
|
-
setSelectedDay = (e) => {
|
|
174
|
-
this.selectedDay = this.selectedDay && g(e, this.selectedDay) ? void 0 : e;
|
|
175
|
-
};
|
|
176
|
-
loadRepeatingTransactionData = async () => {
|
|
177
|
-
await Promise.all([
|
|
178
|
-
this.globalStore.accountStore.loadAccountData(),
|
|
179
|
-
this.globalStore.categoryStore.loadCategories(),
|
|
180
|
-
this.globalStore.transactionStore.loadTransactionData()
|
|
181
|
-
]), await this.loadRepeatingTransactions();
|
|
182
|
-
};
|
|
183
|
-
/**
|
|
184
|
-
* Load repeating transactions and augment them with additional data.
|
|
185
|
-
*/
|
|
186
|
-
loadRepeatingTransactions = async () => {
|
|
187
|
-
try {
|
|
188
|
-
const e = await this.api.getRepeatingTransactions();
|
|
189
|
-
this.setRepeatingTransactions(e);
|
|
190
|
-
} catch (e) {
|
|
191
|
-
console.error(`Error occurred while getting repeating transactions: ${e}`);
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
/**
|
|
195
|
-
* Add a new repeating transaction and link it to the associated transaction.
|
|
196
|
-
* @param repeatingTransaction - The repeating transaction to add.
|
|
197
|
-
* @param transaction - The transaction associated with the repeating transaction.
|
|
198
|
-
*/
|
|
199
|
-
addRepeatingTransaction = async (e, t) => {
|
|
200
|
-
try {
|
|
201
|
-
const r = await this.api.addRepeatingTransaction(e);
|
|
202
|
-
await this.globalStore.transactionStore.updateTransaction({
|
|
203
|
-
...t,
|
|
204
|
-
repeating_transaction_guid: r.guid
|
|
205
|
-
}), o(() => {
|
|
206
|
-
this.repeatingTransactions = [
|
|
207
|
-
...this.repeatingTransactions,
|
|
208
|
-
...c(
|
|
209
|
-
this.globalStore.accountStore.visibleAccounts,
|
|
210
|
-
[r],
|
|
211
|
-
this.globalStore.transactionStore.transactions
|
|
212
|
-
)
|
|
213
|
-
];
|
|
214
|
-
});
|
|
215
|
-
} catch (r) {
|
|
216
|
-
console.error(`Error occurred while adding repeating transaction: ${r}`);
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
/**
|
|
220
|
-
* Delete a repeating transaction by its GUID.
|
|
221
|
-
* @param guid - The GUID of the repeating transaction to delete.
|
|
222
|
-
*/
|
|
223
|
-
deleteRepeatingTransaction = async (e) => {
|
|
224
|
-
try {
|
|
225
|
-
await this.api.deleteRepeatingTransaction(e), o(() => {
|
|
226
|
-
this.repeatingTransactions = [
|
|
227
|
-
...this.repeatingTransactions.filter((t) => t.guid !== e)
|
|
228
|
-
];
|
|
229
|
-
});
|
|
230
|
-
} catch (t) {
|
|
231
|
-
console.error(`Error occurred while deleting repeating transaction: ${t}`);
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
/**
|
|
235
|
-
* Update an existing repeating transaction.
|
|
236
|
-
* @param transaction - The repeating transaction to update.
|
|
237
|
-
*/
|
|
238
|
-
updateRepeatingTransaction = async (e) => {
|
|
239
|
-
try {
|
|
240
|
-
const t = await this.api.updateRepeatingTransaction(e), r = this.repeatingTransactions.findIndex(
|
|
241
|
-
(m) => m.guid === t.guid
|
|
242
|
-
);
|
|
243
|
-
if (r < 0) return;
|
|
244
|
-
o(() => {
|
|
245
|
-
this.repeatingTransactions = [
|
|
246
|
-
...this.repeatingTransactions.slice(0, r),
|
|
247
|
-
...c(
|
|
248
|
-
this.globalStore.accountStore.visibleAccounts,
|
|
249
|
-
[t],
|
|
250
|
-
this.globalStore.transactionStore.transactions
|
|
251
|
-
),
|
|
252
|
-
...this.repeatingTransactions.slice(r + 1)
|
|
253
|
-
];
|
|
254
|
-
});
|
|
255
|
-
} catch (t) {
|
|
256
|
-
console.error(`Error occurred while updating repeating transaction: ${t}`);
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
export {
|
|
261
|
-
k as R,
|
|
262
|
-
D as S,
|
|
263
|
-
L as T
|
|
264
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
var v = /* @__PURE__ */ ((o) => (o[o.Unknown = 0] = "Unknown", o[o.EveryWeek = 1] = "EveryWeek", o[o.EveryOtherWeek = 2] = "EveryOtherWeek", o[o.EveryMonth = 3] = "EveryMonth", o[o.EveryOtherMonth = 4] = "EveryOtherMonth", o[o.EveryQuarter = 5] = "EveryQuarter", o[o.EveryOtherQuarter = 6] = "EveryOtherQuarter", o[o.EveryYear = 7] = "EveryYear", o[o.TwiceAMonth = 8] = "TwiceAMonth", o))(v || {}), r = /* @__PURE__ */ ((o) => (o[o.Paid = 0] = "Paid", o[o.Missed = 1] = "Missed", o[o.Upcoming = 2] = "Upcoming", o))(r || {}), E = /* @__PURE__ */ ((o) => (o[o.Expense = 0] = "Expense", o[o.Income = 1] = "Income", o))(E || {}), h = /* @__PURE__ */ ((o) => (o[o.Unknown = 0] = "Unknown", o[o.Subscription = 1] = "Subscription", o[o.Bill = 2] = "Bill", o[o.Income = 3] = "Income", o[o.Transfer = 4] = "Transfer", o))(h || {});
|
|
2
|
-
export {
|
|
3
|
-
v as F,
|
|
4
|
-
r as R,
|
|
5
|
-
E as a,
|
|
6
|
-
h as b
|
|
7
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { F as s, A as e } from "./ApiEndpoints-C5IA97i7.mjs";
|
|
2
|
-
class r {
|
|
3
|
-
fetchInstance;
|
|
4
|
-
constructor(t, n, a) {
|
|
5
|
-
this.fetchInstance = new s(t, n, void 0, a);
|
|
6
|
-
}
|
|
7
|
-
addRepeatingTransaction = async (t) => this.fetchInstance.post(e.REPEATING_TRANSACTIONS, t).then((n) => n.repeating_transaction);
|
|
8
|
-
getRepeatingTransactions = async () => this.fetchInstance.get(e.REPEATING_TRANSACTIONS).then((t) => t.repeating_transactions);
|
|
9
|
-
updateRepeatingTransaction = async (t) => this.fetchInstance.put(
|
|
10
|
-
`${e.REPEATING_TRANSACTIONS}/${t.guid}`,
|
|
11
|
-
t
|
|
12
|
-
).then((n) => n.repeating_transaction);
|
|
13
|
-
deleteRepeatingTransaction = async (t) => this.fetchInstance.delete(`${e.REPEATING_TRANSACTIONS}/${t}`).then((n) => n);
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
r as R
|
|
17
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { F as s, A as n } from "./ApiEndpoints-C5IA97i7.mjs";
|
|
2
|
-
class r {
|
|
3
|
-
fetchInstance;
|
|
4
|
-
constructor(e, t, i) {
|
|
5
|
-
this.fetchInstance = new s(e, t, void 0, i);
|
|
6
|
-
}
|
|
7
|
-
deleteDevice = async (e) => this.fetchInstance.delete(`${n.DEVICES}/${e}`).then((t) => t);
|
|
8
|
-
generateDeviceToken = async () => this.fetchInstance.get(`${n.USER}/mobile_token`).then((e) => e.mobile_token);
|
|
9
|
-
getDevices = async () => this.fetchInstance.get(n.DEVICES).then((e) => e.map((t) => t.device));
|
|
10
|
-
getNotificationProfiles = async () => this.fetchInstance.get(n.NOTIFICATION_PROFILES).then((e) => e.notification_profiles);
|
|
11
|
-
// verifications endpoints respond with HTTP status codes; they error otherwise
|
|
12
|
-
sendEmailVerification = async () => this.fetchInstance.post(n.EMAIL_VERIFICATIONS);
|
|
13
|
-
sendPhoneVerification = async () => this.fetchInstance.post(n.PHONE_VERIFICATIONS + "/deliver");
|
|
14
|
-
verifyPhoneToken = async (e) => this.fetchInstance.post(n.PHONE_VERIFICATIONS + "/verify", { sms_verification_token: e }).then((t) => ({ verified: t.verified }));
|
|
15
|
-
updateDevice = async (e) => this.fetchInstance.put(`${n.DEVICES}/${e.guid}`, e).then((t) => t.device);
|
|
16
|
-
updateNotificationProfile = async (e) => this.fetchInstance.put(`${n.NOTIFICATION_PROFILES}/${e.guid}`, e).then((t) => t.notification_profile);
|
|
17
|
-
updateUserCommunicationProfile = async (e) => this.fetchInstance.put(n.USER_COMMUNICATION_PROFILE, e).then((t) => t.user_communication_profile);
|
|
18
|
-
getInsightsNotificationProfiles = async () => this.fetchInstance.get(`${n.NOTIFICATION_PROFILES}/${n.INSIGHTS_NOTIFICATION_PROFILES}`).then((e) => e);
|
|
19
|
-
}
|
|
20
|
-
export {
|
|
21
|
-
r as S
|
|
22
|
-
};
|