@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
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
import { jsxs as p, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import b from "react";
|
|
3
|
+
import { css as A } from "@mxenabled/cssinjs";
|
|
4
|
+
import { addDays as O } from "date-fns/addDays";
|
|
5
|
+
import { addMonths as _ } from "date-fns/addMonths";
|
|
6
|
+
import { eachDayOfInterval as H } from "date-fns/eachDayOfInterval";
|
|
7
|
+
import { eachWeekOfInterval as L } from "date-fns/eachWeekOfInterval";
|
|
8
|
+
import { endOfMonth as z } from "date-fns/endOfMonth";
|
|
9
|
+
import { format as T } from "date-fns/format";
|
|
10
|
+
import { isBefore as F } from "date-fns/isBefore";
|
|
11
|
+
import { isSameMonth as G } from "date-fns/isSameMonth";
|
|
12
|
+
import { startOfMonth as Y } from "date-fns/startOfMonth";
|
|
13
|
+
import { startOfToday as $ } from "date-fns/startOfToday";
|
|
14
|
+
import { subMonths as Z } from "date-fns/subMonths";
|
|
15
|
+
import C from "@mui/material/Button";
|
|
16
|
+
import q from "@mui/material/Paper";
|
|
17
|
+
import { H2 as D, Text as W, H3 as J, P as K } from "@mxenabled/mxui";
|
|
18
|
+
import { ChevronLeft as P, ChevronRight as Q, Icon as U } from "@mxenabled/mx-icons";
|
|
19
|
+
import { f as V, D as X } from "./DateFormats-HudZ3Bjs.mjs";
|
|
20
|
+
import { isSameDay as d } from "date-fns/isSameDay";
|
|
21
|
+
import { isWithinInterval as tt } from "date-fns/isWithinInterval";
|
|
22
|
+
import nt from "@mui/material/styles/useTheme";
|
|
23
|
+
import et from "@mui/material/Dialog";
|
|
24
|
+
import ot from "@mui/material/DialogActions";
|
|
25
|
+
import rt from "@mui/material/DialogContent";
|
|
26
|
+
import at from "@mui/material/IconButton";
|
|
27
|
+
import it from "@mui/material/InputAdornment";
|
|
28
|
+
import j from "@mui/material/Stack";
|
|
29
|
+
import lt from "@mui/material/TextField";
|
|
30
|
+
import { u as mt } from "./useScreenSize-CeFhWTt_.mjs";
|
|
31
|
+
const ct = ({ copy: t, date: r, onNextClick: o, onPreviousClick: l }) => {
|
|
32
|
+
const c = st();
|
|
33
|
+
return /* @__PURE__ */ p("div", { className: `mx-cmn-calendar-header ${c}`, children: [
|
|
34
|
+
/* @__PURE__ */ n(D, { className: "mx-cmn-calendar-header-title", variant: "h3", children: V(r, X.MONTH_YEAR) }),
|
|
35
|
+
/* @__PURE__ */ p("div", { className: "mx-cmn-calendar-header-button-container", children: [
|
|
36
|
+
/* @__PURE__ */ n(C, { "aria-label": t.prevAria, onClick: l, children: /* @__PURE__ */ n(P, { size: 24 }) }),
|
|
37
|
+
/* @__PURE__ */ n(C, { "aria-label": t.nextAria, onClick: o, children: /* @__PURE__ */ n(Q, { size: 24 }) })
|
|
38
|
+
] })
|
|
39
|
+
] });
|
|
40
|
+
}, st = () => A({
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
display: "flex",
|
|
43
|
+
marginBottom: 16,
|
|
44
|
+
marginRight: -16,
|
|
45
|
+
paddingLeft: 8,
|
|
46
|
+
"& .mx-cmn-calendar-header-title": {
|
|
47
|
+
flexGrow: 1
|
|
48
|
+
},
|
|
49
|
+
"& .mx-cmn-calendar-header-button-container": {
|
|
50
|
+
display: "flex",
|
|
51
|
+
gap: 4
|
|
52
|
+
}
|
|
53
|
+
}), dt = ({ beginDate: t, date: r, endDate: o, isInMonth: l, onClick: c }) => {
|
|
54
|
+
const h = nt(), x = ht(h), a = t && o && tt(r, { start: t, end: o }) && !d(r, t) && !d(r, o), f = t && o && d(t, r) && !d(t, o), m = o && t && d(o, r) && !d(t, o), i = t && d(t, r) || o && d(o, r), u = d(r, $());
|
|
55
|
+
return /* @__PURE__ */ n(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
className: `
|
|
59
|
+
mx-cmn-calendar-day
|
|
60
|
+
${x}
|
|
61
|
+
${l ? "" : "mx-cmn-out-of-month"}
|
|
62
|
+
${a ? "mx-cmn-date-interval" : ""}
|
|
63
|
+
`,
|
|
64
|
+
children: /* @__PURE__ */ n(
|
|
65
|
+
C,
|
|
66
|
+
{
|
|
67
|
+
className: `
|
|
68
|
+
mx-cmn-calendar-day-button
|
|
69
|
+
${f ? "mx-cmn-range-start" : ""}
|
|
70
|
+
${m ? "mx-cmn-range-end" : ""}
|
|
71
|
+
`,
|
|
72
|
+
color: i ? "primary" : "secondary",
|
|
73
|
+
onClick: () => c(r),
|
|
74
|
+
variant: i ? "contained" : "text",
|
|
75
|
+
children: /* @__PURE__ */ n(
|
|
76
|
+
W,
|
|
77
|
+
{
|
|
78
|
+
className: `
|
|
79
|
+
mx-cmn-calendar-day-text
|
|
80
|
+
${i ? "mx-cmn-day-selected" : ""}
|
|
81
|
+
${u ? "mx-cmn-today" : ""}`,
|
|
82
|
+
variant: "body2",
|
|
83
|
+
children: T(r, "d")
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}, ht = (t) => A({
|
|
91
|
+
height: w,
|
|
92
|
+
width: w,
|
|
93
|
+
display: "flex",
|
|
94
|
+
justifyContent: "center",
|
|
95
|
+
"&.mx-cmn-out-of-month": {
|
|
96
|
+
backgroundColor: t.palette.background.default
|
|
97
|
+
},
|
|
98
|
+
"&.mx-cmn-date-interval": {
|
|
99
|
+
backgroundColor: t.palette.secondary.light
|
|
100
|
+
},
|
|
101
|
+
"& .MuiButton-root": {
|
|
102
|
+
maxWidth: 44,
|
|
103
|
+
minWidth: 44,
|
|
104
|
+
height: 44,
|
|
105
|
+
padding: 0,
|
|
106
|
+
width: 44,
|
|
107
|
+
"&.mx-cmn-range-start": {
|
|
108
|
+
borderTopRightRadius: 0,
|
|
109
|
+
borderBottomRightRadius: 0,
|
|
110
|
+
"&:focus": {
|
|
111
|
+
boxShadow: "none"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"&.mx-cmn-range-end": {
|
|
115
|
+
borderTopLeftRadius: 0,
|
|
116
|
+
borderBottomLeftRadius: 0,
|
|
117
|
+
"&:focus": {
|
|
118
|
+
boxShadow: "none"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"& .mx-cmn-calendar-day-text": {
|
|
123
|
+
"&.mx-cmn-day-selected": {
|
|
124
|
+
color: t.palette.primary,
|
|
125
|
+
"&.mx-cmn-day-selected": {
|
|
126
|
+
borderColor: t.palette.common.white
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"&.mx-cmn-today": {
|
|
130
|
+
borderBottom: `solid 2px ${t.palette.primary.main}`,
|
|
131
|
+
marginBottom: -6,
|
|
132
|
+
paddingBottom: 5
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}), ft = 340, w = 44;
|
|
136
|
+
var pt = /* @__PURE__ */ ((t) => (t.None = "None", t.Single = "Single", t.Range = "Range", t))(pt || {});
|
|
137
|
+
const Dt = ({
|
|
138
|
+
copy: t,
|
|
139
|
+
beginDate: r = void 0,
|
|
140
|
+
endDate: o = void 0,
|
|
141
|
+
onDateSelected: l,
|
|
142
|
+
onRangeSelected: c,
|
|
143
|
+
selectionType: h = "Single"
|
|
144
|
+
/* Single */
|
|
145
|
+
}) => {
|
|
146
|
+
const x = xt(), [a, f] = b.useState($), [m, i] = b.useState(r), [u, s] = b.useState(o);
|
|
147
|
+
b.useEffect(() => {
|
|
148
|
+
i(r), s(o), r && f(r);
|
|
149
|
+
}, [r, o]);
|
|
150
|
+
const k = b.useMemo(() => {
|
|
151
|
+
const e = L({ start: Y(a), end: z(a) }), y = [];
|
|
152
|
+
for (let v = 0; v < e.length; v++) {
|
|
153
|
+
const N = e[v], B = H({ start: N, end: O(N, 6) }), E = [];
|
|
154
|
+
for (let R = 0; R < B.length; R++)
|
|
155
|
+
E.push(B[R]);
|
|
156
|
+
y.push(E);
|
|
157
|
+
}
|
|
158
|
+
return y;
|
|
159
|
+
}, [a]), S = (e) => {
|
|
160
|
+
if (h !== "None") {
|
|
161
|
+
if (h === "Single") {
|
|
162
|
+
i(e), l?.(e);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
!m || u ? (i(e), s(void 0)) : F(e, m) ? (s(m), i(e), c?.(e, m)) : (s(e), c?.(m, e));
|
|
166
|
+
}
|
|
167
|
+
}, I = () => {
|
|
168
|
+
const e = $();
|
|
169
|
+
f(e), h !== "None" && (i(e), h === "Single" ? l?.(e) : (s(e), c?.(e, e)));
|
|
170
|
+
}, M = () => {
|
|
171
|
+
f(_(a, 1));
|
|
172
|
+
}, g = () => {
|
|
173
|
+
f(Z(a, 1));
|
|
174
|
+
};
|
|
175
|
+
return /* @__PURE__ */ n("div", { className: `mx-cmn-calendar ${x}`, children: /* @__PURE__ */ p(q, { sx: { boxShadow: "none" }, children: [
|
|
176
|
+
/* @__PURE__ */ n(
|
|
177
|
+
ct,
|
|
178
|
+
{
|
|
179
|
+
copy: t,
|
|
180
|
+
date: a,
|
|
181
|
+
onNextClick: M,
|
|
182
|
+
onPreviousClick: g
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
/* @__PURE__ */ n("div", { className: "mx-cmn-calendar-header-row", children: k[0].map((e, y) => /* @__PURE__ */ n("div", { className: "mx-cmn-calendar-header-cell", children: /* @__PURE__ */ n(W, { bold: !0, variant: "body2", children: T(e, "EEEEE") }) }, y)) }),
|
|
186
|
+
k.map((e, y) => /* @__PURE__ */ n("div", { className: "mx-cmn-calendar-week", children: e.map((v, N) => /* @__PURE__ */ n(
|
|
187
|
+
dt,
|
|
188
|
+
{
|
|
189
|
+
beginDate: m,
|
|
190
|
+
date: v,
|
|
191
|
+
endDate: u,
|
|
192
|
+
isInMonth: G(v, a),
|
|
193
|
+
onClick: S
|
|
194
|
+
},
|
|
195
|
+
N
|
|
196
|
+
)) }, `w-${y}`)),
|
|
197
|
+
/* @__PURE__ */ n("div", { className: "mx-cmn-calendar-today-container", children: /* @__PURE__ */ n(C, { onClick: I, size: "small", variant: "text", children: t.today }) })
|
|
198
|
+
] }) });
|
|
199
|
+
}, xt = () => A({
|
|
200
|
+
width: ft,
|
|
201
|
+
"& .MuiPaper-root": {
|
|
202
|
+
paddingLeft: 24,
|
|
203
|
+
paddingRight: 24,
|
|
204
|
+
paddingTop: 4,
|
|
205
|
+
paddingBottom: 4
|
|
206
|
+
},
|
|
207
|
+
"& .mx-cmn-calendar-header-row": {
|
|
208
|
+
display: "flex",
|
|
209
|
+
justifyContent: "center",
|
|
210
|
+
textAlign: "center",
|
|
211
|
+
"& .mx-cmn-calendar-header-cell": {
|
|
212
|
+
height: w,
|
|
213
|
+
width: w,
|
|
214
|
+
minWidth: w,
|
|
215
|
+
"& .kmui-text": {
|
|
216
|
+
alignItems: "center",
|
|
217
|
+
display: "flex",
|
|
218
|
+
height: "100%",
|
|
219
|
+
justifyContent: "center",
|
|
220
|
+
width: "100%"
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"& .mx-cmn-calendar-week": {
|
|
225
|
+
display: "flex",
|
|
226
|
+
justifyContent: "center",
|
|
227
|
+
textAlign: "center"
|
|
228
|
+
},
|
|
229
|
+
"& .mx-cmn-calendar-today-container": {
|
|
230
|
+
display: "block",
|
|
231
|
+
marginTop: 16,
|
|
232
|
+
textAlign: "center",
|
|
233
|
+
width: "100%",
|
|
234
|
+
"& > .MuiButton-root": {
|
|
235
|
+
display: "inline-block",
|
|
236
|
+
marginLeft: "auto",
|
|
237
|
+
marginRight: "auto"
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}), Jt = ({
|
|
241
|
+
closeAriaLabel: t,
|
|
242
|
+
content: r,
|
|
243
|
+
inputLabel: o,
|
|
244
|
+
inputValue: l,
|
|
245
|
+
isOpen: c,
|
|
246
|
+
handleInputChange: h,
|
|
247
|
+
handleModalClose: x,
|
|
248
|
+
handlePrimaryAction: a,
|
|
249
|
+
handleSecondaryAction: f,
|
|
250
|
+
primaryColor: m = "primary",
|
|
251
|
+
primaryText: i,
|
|
252
|
+
secondaryColor: u = "primary",
|
|
253
|
+
secondaryText: s,
|
|
254
|
+
title: k
|
|
255
|
+
}) => {
|
|
256
|
+
const S = parseFloat(l ?? "0"), I = l !== "" && l !== "0" && !isNaN(S), { isSmallMobile: M } = mt();
|
|
257
|
+
return /* @__PURE__ */ n(
|
|
258
|
+
et,
|
|
259
|
+
{
|
|
260
|
+
"aria-label": k,
|
|
261
|
+
"aria-labelledby": "modal-title",
|
|
262
|
+
maxWidth: "xs",
|
|
263
|
+
onClose: x,
|
|
264
|
+
open: c,
|
|
265
|
+
role: "dialog",
|
|
266
|
+
sx: {
|
|
267
|
+
"& .MuiDialogContent-root": { p: 0 },
|
|
268
|
+
...M && { "& .MuiDialog-paper": { minWidth: "100%" } }
|
|
269
|
+
},
|
|
270
|
+
children: /* @__PURE__ */ n(rt, { children: /* @__PURE__ */ p(
|
|
271
|
+
"form",
|
|
272
|
+
{
|
|
273
|
+
onSubmit: (g) => {
|
|
274
|
+
g.preventDefault(), a();
|
|
275
|
+
},
|
|
276
|
+
children: [
|
|
277
|
+
/* @__PURE__ */ p(
|
|
278
|
+
j,
|
|
279
|
+
{
|
|
280
|
+
sx: {
|
|
281
|
+
alignItems: "center",
|
|
282
|
+
flexDirection: "row",
|
|
283
|
+
justifyContent: "space-between",
|
|
284
|
+
pb: 12,
|
|
285
|
+
pl: 24,
|
|
286
|
+
position: "relative",
|
|
287
|
+
pr: 16,
|
|
288
|
+
pt: 24
|
|
289
|
+
},
|
|
290
|
+
children: [
|
|
291
|
+
/* @__PURE__ */ n(J, { id: "modal-title", children: k }),
|
|
292
|
+
/* @__PURE__ */ n(
|
|
293
|
+
at,
|
|
294
|
+
{
|
|
295
|
+
"aria-label": t,
|
|
296
|
+
onClick: x,
|
|
297
|
+
sx: { minHeight: 24, position: "absolute", right: 8, top: 18 },
|
|
298
|
+
children: /* @__PURE__ */ n(U, { name: "close", sx: { color: "action.active" } })
|
|
299
|
+
}
|
|
300
|
+
)
|
|
301
|
+
]
|
|
302
|
+
}
|
|
303
|
+
),
|
|
304
|
+
/* @__PURE__ */ p(j, { sx: { gap: 24, px: 24 }, children: [
|
|
305
|
+
/* @__PURE__ */ n(K, { variant: "subtitle1", children: r }),
|
|
306
|
+
o && /* @__PURE__ */ n(
|
|
307
|
+
lt,
|
|
308
|
+
{
|
|
309
|
+
InputProps: {
|
|
310
|
+
startAdornment: /* @__PURE__ */ n(it, { position: "start", children: "$" })
|
|
311
|
+
},
|
|
312
|
+
autoFocus: !0,
|
|
313
|
+
inputMode: "decimal",
|
|
314
|
+
inputProps: {
|
|
315
|
+
"aria-label": o,
|
|
316
|
+
noValidate: !0,
|
|
317
|
+
pattern: "[0-9]*\\.?[0-9]*"
|
|
318
|
+
},
|
|
319
|
+
label: o,
|
|
320
|
+
onChange: ({ target: { value: g } }) => {
|
|
321
|
+
/^\d*\.?\d*$/.test(g) && h?.(g);
|
|
322
|
+
},
|
|
323
|
+
type: "text",
|
|
324
|
+
value: l
|
|
325
|
+
}
|
|
326
|
+
)
|
|
327
|
+
] }),
|
|
328
|
+
/* @__PURE__ */ p(
|
|
329
|
+
ot,
|
|
330
|
+
{
|
|
331
|
+
sx: {
|
|
332
|
+
justifyContent: "flex-end",
|
|
333
|
+
gap: 16,
|
|
334
|
+
p: 24,
|
|
335
|
+
">:not(style)~:not(style)": { ml: 0 }
|
|
336
|
+
},
|
|
337
|
+
children: [
|
|
338
|
+
s && /* @__PURE__ */ n(
|
|
339
|
+
C,
|
|
340
|
+
{
|
|
341
|
+
"aria-label": s,
|
|
342
|
+
color: u,
|
|
343
|
+
onClick: f,
|
|
344
|
+
children: s
|
|
345
|
+
}
|
|
346
|
+
),
|
|
347
|
+
/* @__PURE__ */ n(
|
|
348
|
+
C,
|
|
349
|
+
{
|
|
350
|
+
"aria-label": i,
|
|
351
|
+
color: m,
|
|
352
|
+
disabled: o ? !I : !1,
|
|
353
|
+
onClick: a,
|
|
354
|
+
variant: "contained",
|
|
355
|
+
children: i
|
|
356
|
+
}
|
|
357
|
+
)
|
|
358
|
+
]
|
|
359
|
+
}
|
|
360
|
+
)
|
|
361
|
+
]
|
|
362
|
+
}
|
|
363
|
+
) })
|
|
364
|
+
}
|
|
365
|
+
);
|
|
366
|
+
};
|
|
367
|
+
export {
|
|
368
|
+
Dt as C,
|
|
369
|
+
pt as a,
|
|
370
|
+
Jt as b
|
|
371
|
+
};
|
|
@@ -3,11 +3,10 @@ import i from "react";
|
|
|
3
3
|
import { css as k } from "@mxenabled/cssinjs";
|
|
4
4
|
import { v4 as q } from "uuid";
|
|
5
5
|
import { TextField as B, P as _ } from "@mxenabled/mxui";
|
|
6
|
-
import { g as L, C as O, f as y, M as C } from "./NumberFormatting
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
const K = ({
|
|
6
|
+
import { g as L, C as O, f as y, M as C } from "./NumberFormatting--XMeeBfr.mjs";
|
|
7
|
+
import { b, g } from "./Localization-DnoVyBNK.mjs";
|
|
8
|
+
import { u as W } from "./hooks-BaO_gOI6.mjs";
|
|
9
|
+
const J = ({
|
|
11
10
|
allowDecimals: o = !0,
|
|
12
11
|
ariaLabel: h,
|
|
13
12
|
amount: c,
|
|
@@ -18,12 +17,12 @@ const K = ({
|
|
|
18
17
|
label: u,
|
|
19
18
|
minAmount: f = 1,
|
|
20
19
|
setAmount: x,
|
|
21
|
-
setHasValidInput:
|
|
20
|
+
setHasValidInput: r,
|
|
22
21
|
...N
|
|
23
22
|
}) => {
|
|
24
23
|
const [d, t] = i.useState(""), { common: P } = W(), n = a || P.currency_input, R = j(), A = /^[0-9]*$/, E = /^(\d)*(\,)?([0-9]{1,2})?$/, T = /^(\d)*(\.)?([0-9]{1,2})?$/;
|
|
25
24
|
let s;
|
|
26
|
-
const
|
|
25
|
+
const l = i.useRef(q());
|
|
27
26
|
if (o)
|
|
28
27
|
switch (L()) {
|
|
29
28
|
case O.CAD:
|
|
@@ -36,20 +35,20 @@ const K = ({
|
|
|
36
35
|
else
|
|
37
36
|
s = A;
|
|
38
37
|
i.useEffect(() => {
|
|
39
|
-
|
|
38
|
+
p(c);
|
|
40
39
|
}, [c]);
|
|
41
|
-
const
|
|
42
|
-
!M && (
|
|
40
|
+
const p = (e) => {
|
|
41
|
+
!M && (e === "" || e === "." || e === ",") ? (t(""), r?.(!1)) : Number(e) < f ? (t(
|
|
43
42
|
b(
|
|
44
43
|
n.error_amount_must_be_equal_to,
|
|
45
44
|
y(f, "0")
|
|
46
45
|
)
|
|
47
|
-
),
|
|
46
|
+
), r?.(!1)) : Number(e) > C ? (t(
|
|
48
47
|
b(
|
|
49
48
|
n.error_amount_must_be_less_than_or_equal_to,
|
|
50
49
|
y(C, o ? "0,0.00" : "0,0", Math.floor)
|
|
51
50
|
)
|
|
52
|
-
),
|
|
51
|
+
), r?.(!1)) : e.toString().match(s) ? $() ? (t(""), r?.(!0)) : (t(S), r?.(!1)) : (t(n.error_amount_is_invalid), r?.(!1)), x(e.toString());
|
|
53
52
|
};
|
|
54
53
|
return /* @__PURE__ */ m(
|
|
55
54
|
B,
|
|
@@ -62,7 +61,7 @@ const K = ({
|
|
|
62
61
|
error: !!d,
|
|
63
62
|
helperText: d,
|
|
64
63
|
hiddenLabel: !u,
|
|
65
|
-
id: `currency-input-${
|
|
64
|
+
id: `currency-input-${l.current}`,
|
|
66
65
|
inputMode: o ? "decimal" : "numeric",
|
|
67
66
|
inputProps: {
|
|
68
67
|
"aria-label": h || n.enter_amount,
|
|
@@ -70,8 +69,8 @@ const K = ({
|
|
|
70
69
|
pattern: o ? "[0-9]*\\.?[0-9]*" : "[0-9]*"
|
|
71
70
|
},
|
|
72
71
|
label: u,
|
|
73
|
-
name: `currency-input-${
|
|
74
|
-
onChange: (
|
|
72
|
+
name: `currency-input-${l.current}`,
|
|
73
|
+
onChange: (e) => p(e.target.value),
|
|
75
74
|
value: c,
|
|
76
75
|
...N
|
|
77
76
|
}
|
|
@@ -82,5 +81,5 @@ const K = ({
|
|
|
82
81
|
}
|
|
83
82
|
});
|
|
84
83
|
export {
|
|
85
|
-
|
|
84
|
+
J as C
|
|
86
85
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { intlFormat as t } from "date-fns/intlFormat";
|
|
2
|
-
import { g as
|
|
3
|
-
const
|
|
2
|
+
import { g as r } from "./Localization-DnoVyBNK.mjs";
|
|
3
|
+
const _ = "do", a = {
|
|
4
4
|
TIME_STAMP_HOUR_MINUTE: {
|
|
5
5
|
hour: "numeric",
|
|
6
6
|
minute: "numeric"
|
|
@@ -56,10 +56,9 @@ const m = "do", a = "MMM do, yyyy", O = {
|
|
|
56
56
|
day: "numeric",
|
|
57
57
|
year: "numeric"
|
|
58
58
|
}
|
|
59
|
-
},
|
|
59
|
+
}, i = (o, n) => t(new Date(o), Object.assign(n), { locale: r() });
|
|
60
60
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
A as f
|
|
61
|
+
a as D,
|
|
62
|
+
_ as O,
|
|
63
|
+
i as f
|
|
65
64
|
};
|
|
@@ -8,7 +8,7 @@ import { nextDay as T } from "date-fns/nextDay";
|
|
|
8
8
|
import { setDate as c } from "date-fns/setDate";
|
|
9
9
|
import { startOfToday as r } from "date-fns/startOfToday";
|
|
10
10
|
import { fromUnixTime as s } from "date-fns/fromUnixTime";
|
|
11
|
-
import { f as D, D as f } from "./DateFormats-
|
|
11
|
+
import { f as D, D as f } from "./DateFormats-HudZ3Bjs.mjs";
|
|
12
12
|
const Y = (e) => {
|
|
13
13
|
const t = x(e);
|
|
14
14
|
let o = T(e, t);
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { getDate as D } from "date-fns/getDate";
|
|
2
|
+
import { addMonths as A } from "date-fns/addMonths";
|
|
3
|
+
import { fromUnixTime as d } from "date-fns/fromUnixTime";
|
|
4
|
+
import { getUnixTime as M } from "date-fns/getUnixTime";
|
|
5
|
+
import { startOfMonth as I } from "date-fns/startOfMonth";
|
|
6
|
+
import { A as w } from "./Account-BaJmiJAG.mjs";
|
|
7
|
+
const H = 12, C = 100;
|
|
8
|
+
var y = /* @__PURE__ */ ((t) => (t[t.FASTEST_PAYOFF_FIRST = 1] = "FASTEST_PAYOFF_FIRST", t[t.HIGHEST_INTEREST = 2] = "HIGHEST_INTEREST", t[t.LOWEST_BALANCE = 3] = "LOWEST_BALANCE", t[t.HIGHEST_BALANCE = 4] = "HIGHEST_BALANCE", t))(y || {});
|
|
9
|
+
const N = {
|
|
10
|
+
unnamed_label: "Unnamed Debt"
|
|
11
|
+
}, W = (t, n, e = 0) => {
|
|
12
|
+
const o = t.map((r) => ({ ...r }));
|
|
13
|
+
L(o, n);
|
|
14
|
+
const s = /* @__PURE__ */ new Date(), a = [];
|
|
15
|
+
let i = 0, m = 1;
|
|
16
|
+
for (const r of o)
|
|
17
|
+
a.push({
|
|
18
|
+
...r,
|
|
19
|
+
// Start with the initial balance
|
|
20
|
+
dataset: [{ x: new Date(s), y: r.balance }]
|
|
21
|
+
});
|
|
22
|
+
for (; o.some((r) => r.balance >= 0.01 && !r.is_impossible); ) {
|
|
23
|
+
let r = !1, _ = !1, l = !1;
|
|
24
|
+
for (const [p, c] of o.entries()) {
|
|
25
|
+
if (c.balance <= 0.01) continue;
|
|
26
|
+
const u = a[p].dataset, x = (c.interest_rate ?? 0) / 100 / 12, E = c.balance * x, T = c.monthly_payment ?? 0;
|
|
27
|
+
let S = T, h = 0;
|
|
28
|
+
!l && e > 0 && (S += e, l = !0), !_ && i > 0 && (h = i, _ = !0), c.balance += E;
|
|
29
|
+
const f = Math.min(c.balance, S + h);
|
|
30
|
+
if (f <= E) {
|
|
31
|
+
c.is_impossible = !0, a[p].is_impossible = !0, a[p].priority = void 0, u.push({ x: new Date(s), y: c.balance });
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
c.balance -= f, c.balance = c.balance < 0.01 ? 0 : c.balance, u.push({
|
|
35
|
+
x: new Date(s),
|
|
36
|
+
y: Math.max(0, c.balance),
|
|
37
|
+
payment: f,
|
|
38
|
+
extra: h
|
|
39
|
+
}), c.balance <= 0 && (i += T, a[p].projected_payoff_date = new Date(s)), f > 0 && (r = !0);
|
|
40
|
+
}
|
|
41
|
+
r && s.setMonth(s.getMonth() + 1);
|
|
42
|
+
}
|
|
43
|
+
return a.forEach((r) => {
|
|
44
|
+
(r.interest_rate === void 0 || r.monthly_payment === void 0) && (r.projected_payoff_date = void 0);
|
|
45
|
+
}), a.forEach((r) => {
|
|
46
|
+
r.priority = !r.is_paid_off && !r.is_impossible ? m++ : void 0;
|
|
47
|
+
}), a;
|
|
48
|
+
}, Y = (t, n, e) => ({
|
|
49
|
+
description: n ? t.empty_state_description : t.empty_state_description_no_aggregation,
|
|
50
|
+
header: n ? t.empty_state_header : t.empty_state_header_no_aggregation,
|
|
51
|
+
onClickHandler: n ? e : void 0,
|
|
52
|
+
primaryButton: n ? t.connect_accounts : void 0
|
|
53
|
+
});
|
|
54
|
+
function K(t, n) {
|
|
55
|
+
const e = t.filter((a) => a.account_type === w.CHECKING_LINE_OF_CREDIT ? Number(a.balance) <= 0 : a.is_excluded_from_debts !== !0), o = n.filter((a) => e.some((i) => i.guid === a.account_guid)).map(
|
|
56
|
+
(a) => F(e.find((i) => i.guid === a.account_guid), a)
|
|
57
|
+
), s = e.filter((a) => !o.some((i) => i.account.guid === a.guid)).map((a) => F(a));
|
|
58
|
+
return [...o, ...s];
|
|
59
|
+
}
|
|
60
|
+
function F(t, n) {
|
|
61
|
+
const e = { account: t, goal: n, guid: t.guid };
|
|
62
|
+
if (n) {
|
|
63
|
+
const o = n.payment_due_at ? D(d(n.payment_due_at)) : 1, s = I(/* @__PURE__ */ new Date()).setDate(o);
|
|
64
|
+
e.balance = Math.abs(n.amount - n.current_amount), e.interest_rate = n.interest_rate, e.is_paid_off = n.is_complete, e.monthly_payment = n.monthly_payment, e.name = n.name, e.original_balance = n.initial_amount, e.payment_due_date = s;
|
|
65
|
+
} else {
|
|
66
|
+
const o = t.payment_due_at ? D(d(t.payment_due_at)) : 1, s = I(/* @__PURE__ */ new Date()).setDate(o), a = t.balance ?? 0, i = t.minimum_payment ?? void 0, m = t.interest_rate ?? t.apr ?? t.apy;
|
|
67
|
+
e.balance = Math.max(a, 0), e.interest_rate = m, e.is_paid_off = a === 0, e.monthly_payment = i, e.name = t?.name ?? N.unnamed_label, e.original_balance = t.original_balance, e.payment_due_date = s;
|
|
68
|
+
}
|
|
69
|
+
return e.is_impossible = !1, e.priority = void 0, e.projected_payoff_date = void 0, e;
|
|
70
|
+
}
|
|
71
|
+
const v = (t) => (t[t.length - 1] || {}).timestamp, L = (t, n) => {
|
|
72
|
+
const [e, o] = t.reduce(
|
|
73
|
+
([s, a], i) => (i.is_paid_off || i.is_impossible ? a.push({ ...i, minimumPayments: [] }) : s.push(R(i)), [s, a]),
|
|
74
|
+
[[], []]
|
|
75
|
+
);
|
|
76
|
+
switch (n) {
|
|
77
|
+
case y.FASTEST_PAYOFF_FIRST:
|
|
78
|
+
e.sort((s, a) => (s.minimumFinalPayment ?? 0) - (a.minimumFinalPayment ?? 0));
|
|
79
|
+
break;
|
|
80
|
+
case y.HIGHEST_INTEREST:
|
|
81
|
+
e.sort((s, a) => (a.interest_rate ?? 0) - (s.interest_rate ?? 0));
|
|
82
|
+
break;
|
|
83
|
+
case y.LOWEST_BALANCE:
|
|
84
|
+
e.sort((s, a) => s.balance - a.balance);
|
|
85
|
+
break;
|
|
86
|
+
case y.HIGHEST_BALANCE:
|
|
87
|
+
e.sort((s, a) => a.balance - s.balance);
|
|
88
|
+
break;
|
|
89
|
+
default:
|
|
90
|
+
e.sort((s, a) => s.balance - a.balance);
|
|
91
|
+
}
|
|
92
|
+
t.splice(0, t.length, ...e, ...o);
|
|
93
|
+
}, R = (t) => {
|
|
94
|
+
const { monthly_payment: n, interest_rate: e, balance: o, payment_due_date: s } = t, a = O(o, e ?? 0, n ?? 0), i = B(
|
|
95
|
+
a,
|
|
96
|
+
o,
|
|
97
|
+
e ?? 0,
|
|
98
|
+
n ?? 0,
|
|
99
|
+
s
|
|
100
|
+
), m = v(i);
|
|
101
|
+
return {
|
|
102
|
+
...t,
|
|
103
|
+
minimumFinalPayment: m,
|
|
104
|
+
minimumPayments: i
|
|
105
|
+
};
|
|
106
|
+
}, O = (t, n = 0, e = 0) => {
|
|
107
|
+
if (e === 0) return 0;
|
|
108
|
+
const o = n / (H * C);
|
|
109
|
+
return Math.ceil(
|
|
110
|
+
o === 0 ? t / e : -Math.log(1 - o * t / e) / Math.log(1 + o)
|
|
111
|
+
);
|
|
112
|
+
}, B = (t, n, e, o, s) => {
|
|
113
|
+
const a = [];
|
|
114
|
+
if (e === 0) {
|
|
115
|
+
for (let m = 0; m < t; m++) {
|
|
116
|
+
const r = n - o * (m + 1), _ = n - o * m, l = r >= 0 ? o : _;
|
|
117
|
+
a.push({
|
|
118
|
+
balance: r >= 0 ? r : 0,
|
|
119
|
+
interest: e,
|
|
120
|
+
payment: l,
|
|
121
|
+
principal: l,
|
|
122
|
+
timestamp: M(
|
|
123
|
+
A(
|
|
124
|
+
d(s),
|
|
125
|
+
// convert seconds → Date
|
|
126
|
+
m + 1
|
|
127
|
+
// add (index + 1) months
|
|
128
|
+
)
|
|
129
|
+
)
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
return a;
|
|
133
|
+
}
|
|
134
|
+
const i = e / 1200;
|
|
135
|
+
for (let m = 0; m < t; m++) {
|
|
136
|
+
const r = M(A(d(s), m + 1)), _ = Math.pow(1 + i, m), l = n * _ - o * ((_ - 1) / i), p = Math.pow(1 + i, m + 1), c = n * p - o * ((p - 1) / i), u = o + Math.min(c, 0), b = l * i;
|
|
137
|
+
a.push({
|
|
138
|
+
balance: Math.max(0, c),
|
|
139
|
+
interest: b,
|
|
140
|
+
payment: u,
|
|
141
|
+
principal: u - b,
|
|
142
|
+
timestamp: r
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return a;
|
|
146
|
+
};
|
|
147
|
+
export {
|
|
148
|
+
y as D,
|
|
149
|
+
Y as b,
|
|
150
|
+
K as l,
|
|
151
|
+
L as s,
|
|
152
|
+
W as t
|
|
153
|
+
};
|