@mx-cartographer/experiences 6.26.18-alpha.mega4 → 6.26.18-alpha.sms1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/common/context/hooks.d.ts +13 -13
  2. package/dist/help/components/content/section/index.d.ts +15 -15
  3. package/dist/index.d.ts +22 -0
  4. package/dist/index.es.js +30335 -0
  5. package/dist/index.es.js.map +1 -0
  6. package/package.json +3 -155
  7. package/dist/Account-DM32_5k9.mjs +0 -30
  8. package/dist/AccountDetailsContent-B_qRSB8l.mjs +0 -677
  9. package/dist/AccountDetailsHeader-CAm6ADMq.mjs +0 -119
  10. package/dist/AccountFields-Bb4pds0q.mjs +0 -135
  11. package/dist/AccountListItem-G7iAesaO.mjs +0 -90
  12. package/dist/AccountStore-RSanus_m.mjs +0 -230
  13. package/dist/Accounts-BfAQRG8R.mjs +0 -9
  14. package/dist/BeatApi-DLu87ijw.mjs +0 -21
  15. package/dist/BeatStore-By4aGoRM.mjs +0 -81
  16. package/dist/BudgetUtil-DcqclhiQ.mjs +0 -101
  17. package/dist/CashflowStore-D9Dpuz7X.mjs +0 -91
  18. package/dist/Category-5S6uwuXz.mjs +0 -301
  19. package/dist/CategorySelectorDrawer-DgrePTRg.mjs +0 -397
  20. package/dist/CategoryStore-B5EW6I1d.mjs +0 -183
  21. package/dist/CategoryUtil-DRyruNgi.mjs +0 -78
  22. package/dist/ConnectDrawer-DPnfeIfn.mjs +0 -508
  23. package/dist/ConnectionsDrawer-BCzpuNsK.mjs +0 -52
  24. package/dist/CurrencyInput-DzsPiUsU.mjs +0 -83
  25. package/dist/CurrencyText-YUhH2caW.mjs +0 -20
  26. package/dist/DateUtil-BcuH7ErC.mjs +0 -48
  27. package/dist/DebtsStore-C6VcBnpG.mjs +0 -60
  28. package/dist/Dialog-CWW597AF.mjs +0 -123
  29. package/dist/Donut-1UMNcG67.mjs +0 -57
  30. package/dist/Drawer-kEE73B87.mjs +0 -113
  31. package/dist/EmptyState-Dcb-o2tl.mjs +0 -55
  32. package/dist/Fetch-CkFKy79O.mjs +0 -116
  33. package/dist/FinstrongStore-mkALvztw.mjs +0 -101
  34. package/dist/GoalStore-DyCr4wNc.mjs +0 -263
  35. package/dist/HeaderCell-DjuifqHJ.mjs +0 -6
  36. package/dist/Help-DhcC-C05.mjs +0 -320
  37. package/dist/Help-toqAK5eD.mjs +0 -3173
  38. package/dist/IconBacking-B9oC6uL2.mjs +0 -39
  39. package/dist/InvestmentUtil-jOyOgzIB.mjs +0 -134
  40. package/dist/LineChart-CQWu5KoO.mjs +0 -403
  41. package/dist/ListItemAction-Df3OPMOW.mjs +0 -69
  42. package/dist/Loader-Dp1P2gNw.mjs +0 -14
  43. package/dist/Localization-2MODESHW.mjs +0 -30
  44. package/dist/ManageIncome-BVt_XQbo.mjs +0 -535
  45. package/dist/MerchantStore-DVH-QOf0.mjs +0 -37
  46. package/dist/MicroWidgetContainer-DaLW43tE.mjs +0 -45
  47. package/dist/MiniWidgetContainer-BcNPxZt2.mjs +0 -39
  48. package/dist/NetWorthStore-DE8CQBMM.mjs +0 -150
  49. package/dist/Notification-AMGWM1Al.mjs +0 -78
  50. package/dist/NotificationSettings-CPZN0l8X.mjs +0 -667
  51. package/dist/NotificationStore-DHtSGySy.mjs +0 -67
  52. package/dist/NumberFormatting-CtWHhyBX.mjs +0 -40
  53. package/dist/OriginalBalanceAction-s9sUxofR.mjs +0 -115
  54. package/dist/RecurringSettings-DIEsympT.mjs +0 -57
  55. package/dist/RecurringTransactionsStore-BKLD3OWo.mjs +0 -263
  56. package/dist/RepeatingTransaction-BPWfaB3f.mjs +0 -282
  57. package/dist/SearchBox-B2_zLv8-.mjs +0 -42
  58. package/dist/SettingsStore-CE7jDVFL.mjs +0 -265
  59. package/dist/SingleSegmentDonut-BgbLgwHi.mjs +0 -69
  60. package/dist/SpendingData-ByFCw95X.mjs +0 -53
  61. package/dist/StatusBar-BK_uYHAB.mjs +0 -30
  62. package/dist/TabContentContainer-j01JYR_7.mjs +0 -21
  63. package/dist/Transaction-C-5-Iuab.mjs +0 -312
  64. package/dist/TransactionApi-DbbcjI2L.mjs +0 -86
  65. package/dist/TransactionDetails-B5qfs9Zh.mjs +0 -1283
  66. package/dist/TransactionStore-BWi6_2Ny.mjs +0 -669
  67. package/dist/TrendsStore-Borh98aN.mjs +0 -448
  68. package/dist/ViewMoreMicroCard-CAPFNz-J.mjs +0 -1959
  69. package/dist/WidgetContainer-CmGNZW0M.mjs +0 -548
  70. package/dist/accounts/index.es.js +0 -752
  71. package/dist/analytics/index.es.js +0 -171
  72. package/dist/budgets/index.es.js +0 -1070
  73. package/dist/cashflow/index.es.js +0 -1098
  74. package/dist/categories/index.es.js +0 -9
  75. package/dist/common/index.es.js +0 -1451
  76. package/dist/dashboard/index.es.js +0 -181
  77. package/dist/debts/index.es.js +0 -1460
  78. package/dist/exportTransactionsToCSV-j4g8bdVZ.mjs +0 -47
  79. package/dist/finstrong/index.es.js +0 -1455
  80. package/dist/goals/index.es.js +0 -1209
  81. package/dist/help/index.es.js +0 -14
  82. package/dist/hooks-ClhFlg78.mjs +0 -71
  83. package/dist/insights/index.d.ts +0 -1
  84. package/dist/insights/index.es.js +0 -4
  85. package/dist/investments/index.es.js +0 -1638
  86. package/dist/merchants/index.es.js +0 -79
  87. package/dist/microinsights/index.es.js +0 -16
  88. package/dist/networth/index.es.js +0 -542
  89. package/dist/notifications/index.es.js +0 -192
  90. package/dist/recurringtransactions/index.es.js +0 -879
  91. package/dist/settings/index.es.js +0 -879
  92. package/dist/spending/index.es.js +0 -570
  93. package/dist/transactions/index.es.js +0 -587
  94. package/dist/trends/index.es.js +0 -1103
  95. package/dist/useCombineEvents-DaDBSR_1.mjs +0 -92
  96. package/dist/useDimensions-27p2evRx.mjs +0 -36
  97. package/dist/useScreenSize-B6JyS_Lj.mjs +0 -36
@@ -1,48 +0,0 @@
1
- import { addMonths as s } from "date-fns/addMonths";
2
- import { addQuarters as a } from "date-fns/addQuarters";
3
- import { addWeeks as m } from "date-fns/addWeeks";
4
- import { addYears as l } from "date-fns/addYears";
5
- import { getDay as y } from "date-fns/getDay";
6
- import { isBefore as n } from "date-fns/isBefore";
7
- import { nextDay as c } from "date-fns/nextDay";
8
- import { setDate as d } from "date-fns/setDate";
9
- import { startOfToday as o } from "date-fns/startOfToday";
10
- import { fromUnixTime as D } from "date-fns/fromUnixTime";
11
- import { f as i, D as f } from "./Dialog-CWW597AF.mjs";
12
- const x = (t) => {
13
- const e = y(t);
14
- let r = c(t, e);
15
- for (; n(r, o()); )
16
- r = m(r, 1);
17
- return r;
18
- }, Y = (t) => {
19
- const e = x(t);
20
- return m(e, 1);
21
- }, B = (t) => {
22
- let e = d(o(), t.getDate());
23
- for (; n(e, o()); )
24
- e = s(e, 1);
25
- return e;
26
- }, E = (t) => {
27
- const e = x(t);
28
- return s(e, 1);
29
- }, p = (t) => {
30
- let e = a(t, 1);
31
- for (; n(e, o()); )
32
- e = a(e, 1);
33
- return e;
34
- }, Q = (t) => {
35
- const e = p(t);
36
- return a(e, 1);
37
- }, w = (t) => l(t, 1), F = (t) => i(D(t), f.DAY_OF_WEEK_MONTH_DAY), H = (t) => t ? i(D(t), f.MONTH_YEAR) : "";
38
- export {
39
- Q as a,
40
- p as b,
41
- E as c,
42
- B as d,
43
- Y as e,
44
- x as f,
45
- w as g,
46
- F as h,
47
- H as i
48
- };
@@ -1,60 +0,0 @@
1
- import { makeAutoObservable as l } from "mobx";
2
- import { getDate as o, fromUnixTime as m, startOfMonth as _ } from "date-fns";
3
- import { A as b } from "./ConnectDrawer-DPnfeIfn.mjs";
4
- var u = /* @__PURE__ */ ((a) => (a[a.HIGHEST_INTEREST = 1] = "HIGHEST_INTEREST", a[a.LOWEST_BALANCE = 2] = "LOWEST_BALANCE", a[a.HIGHEST_BALANCE = 3] = "HIGHEST_BALANCE", a))(u || {});
5
- const p = {
6
- unnamed_label: "Unnamed Debt"
7
- };
8
- function y(a, e) {
9
- const t = a.filter((n) => n.account_type === b.CHECKING_LINE_OF_CREDIT ? Number(n.balance) <= 0 : n.is_excluded_from_debts !== !0), s = e.filter((n) => t.some((i) => i.guid === n.account_guid)).map(
10
- (n) => d(t.find((i) => i.guid === n.account_guid), n)
11
- ), r = t.filter((n) => !s.some((i) => i.account.guid === n.guid)).map((n) => d(n));
12
- return [...s, ...r];
13
- }
14
- function d(a, e) {
15
- const t = { account: a, goal: e, guid: a.guid };
16
- if (e) {
17
- const s = e.payment_due_at ? o(m(e.payment_due_at)) : 1, r = _(/* @__PURE__ */ new Date()).setDate(s);
18
- t.balance = Math.abs(e.amount - e.current_amount), t.interest_rate = e.interest_rate, t.is_paid_off = e.is_complete, t.monthly_payment = e.monthly_payment, t.name = e.name, t.original_balance = e.initial_amount, t.payment_due_date = r;
19
- } else {
20
- const s = a.payment_due_at ? o(m(a.payment_due_at)) : 1, r = _(/* @__PURE__ */ new Date()).setDate(s), n = a.balance ?? 0, i = a.minimum_payment ?? void 0, c = a.interest_rate ?? a.apr ?? a.apy;
21
- t.balance = Math.max(n, 0), t.interest_rate = c, t.is_paid_off = n === 0, t.monthly_payment = i, t.name = a?.name ?? p.unnamed_label, t.original_balance = a.original_balance, t.payment_due_date = r;
22
- }
23
- return t.is_impossible = !1, t.priority = void 0, t.projected_payoff_date = void 0, t;
24
- }
25
- class h {
26
- isLoading = !1;
27
- selectedDebtChartData = {};
28
- selectedDebtPriority = u.LOWEST_BALANCE;
29
- constructor() {
30
- l(this);
31
- }
32
- get showError() {
33
- const { interest_rate: e, monthly_payment: t } = this.selectedDebtChartData;
34
- return e === void 0 || t === void 0;
35
- }
36
- get showCompleted() {
37
- return this.selectedDebtChartData.is_paid_off;
38
- }
39
- setIsLoading = (e) => this.isLoading = e;
40
- setSelectedDebtChartData = (e) => this.selectedDebtChartData = e;
41
- setSelectedDebtPriority = (e) => this.selectedDebtPriority = e;
42
- }
43
- class E {
44
- globalStore;
45
- uiStore;
46
- constructor(e) {
47
- this.globalStore = e, this.uiStore = new h(), l(this);
48
- }
49
- get debts() {
50
- const { visibleDebtAccounts: e } = this.globalStore.accountStore, { debtGoals: t } = this.globalStore.goalStore;
51
- return y(e, t);
52
- }
53
- get totalMonthlyPayments() {
54
- return this.debts.map((t) => Number(t.monthly_payment)).filter((t) => !isNaN(t)).reduce((t, s) => t + s, 0);
55
- }
56
- }
57
- export {
58
- u as D,
59
- E as a
60
- };
@@ -1,123 +0,0 @@
1
- import { intlFormat as h } from "date-fns/intlFormat";
2
- import { g } from "./Localization-2MODESHW.mjs";
3
- import { jsx as a, jsxs as y } from "react/jsx-runtime";
4
- import M from "@mui/material/Dialog";
5
- import T from "@mui/material/DialogContent";
6
- import { DialogHeader as u, DialogFooter as H } from "@mxenabled/mxui";
7
- const L = "do", S = "MMM do, yyyy", x = {
8
- TIME_STAMP_HOUR_MINUTE: {
9
- hour: "numeric",
10
- minute: "numeric"
11
- },
12
- DAY: {
13
- day: "numeric"
14
- },
15
- DAY_OF_WEEK: {
16
- weekday: "long"
17
- },
18
- DAY_OF_WEEK_MONTH_DAY: {
19
- day: "numeric",
20
- month: "long",
21
- weekday: "long"
22
- },
23
- FULL_MONTH_DAY: {
24
- day: "numeric",
25
- month: "long"
26
- },
27
- MONTH: {
28
- month: "short"
29
- },
30
- MONTH_DAY: {
31
- day: "numeric",
32
- month: "short"
33
- },
34
- MONTH_LONG: {
35
- month: "long"
36
- },
37
- MONTH_SHORT: {
38
- month: "short"
39
- },
40
- MONTH_SHORT_YEAR: {
41
- month: "short",
42
- year: "numeric"
43
- },
44
- MONTH_YEAR: {
45
- month: "long",
46
- year: "numeric"
47
- },
48
- YEAR_MONTH_DAY: {
49
- day: "2-digit",
50
- month: "2-digit",
51
- year: "numeric"
52
- },
53
- MONTH_DAY_YEAR: {
54
- month: "short",
55
- day: "2-digit",
56
- year: "numeric"
57
- },
58
- MED_MONTH_SHORT_DAY_FULL_YEAR: {
59
- month: "short",
60
- day: "numeric",
61
- year: "numeric"
62
- }
63
- }, b = (i, o) => h(new Date(i), Object.assign(o), { locale: g() }), N = ({
64
- className: i,
65
- copy: o = {
66
- title: "",
67
- close_aria: "Close"
68
- },
69
- disablePrimaryButton: n = !1,
70
- isOpen: e = !1,
71
- onClose: r,
72
- onPrimaryAction: m,
73
- primaryColor: c = "primary",
74
- primaryText: _ = "Confirm",
75
- onSecondaryAction: t,
76
- secondaryColor: l = "primary",
77
- secondaryText: s = "Cancel",
78
- children: A,
79
- ...d
80
- }) => {
81
- const D = () => {
82
- m?.(), r();
83
- }, O = () => {
84
- t && t(), r();
85
- };
86
- return /* @__PURE__ */ a("div", { className: `mx-cmn-dialog ${i}`, children: /* @__PURE__ */ y(
87
- M,
88
- {
89
- onClose: r,
90
- open: e,
91
- sx: {
92
- "& .MuiDialog-paperScrollPaper": {
93
- backgroundColor: "background.default"
94
- },
95
- height: "100%"
96
- },
97
- ...d,
98
- children: [
99
- /* @__PURE__ */ a(u, { copy: { title: o.title, close_aria: o.close_aria }, onClose: r }),
100
- /* @__PURE__ */ a(T, { sx: { lineHeight: 1.5 }, children: A }),
101
- /* @__PURE__ */ a(
102
- H,
103
- {
104
- isPrimaryDisabled: n,
105
- onPrimaryAction: D,
106
- onSecondaryAction: O,
107
- primaryColor: c,
108
- primaryText: _,
109
- secondaryColor: l,
110
- secondaryText: s
111
- }
112
- )
113
- ]
114
- }
115
- ) });
116
- }, I = N;
117
- export {
118
- x as D,
119
- L as O,
120
- I as a,
121
- S as b,
122
- b as f
123
- };
@@ -1,57 +0,0 @@
1
- import { jsxs as g, jsx as e } from "react/jsx-runtime";
2
- import R from "react";
3
- import { selectAll as A, interpolateString as D, arc as I } from "d3";
4
- import n from "@mui/material/Box";
5
- const m = 100, v = 140, w = 10, x = ({
6
- data: s,
7
- hoveredId: i,
8
- onClick: a,
9
- onMouseEnter: l,
10
- onMouseLeave: c,
11
- selectedId: d,
12
- size: o = 300,
13
- children: u
14
- }) => {
15
- let r = 0;
16
- return R.useEffect(() => {
17
- A(".arc-outer").transition("roll").duration(500).attrTween("transform", () => D("rotate(0)", "rotate(360)"));
18
- }, []), /* @__PURE__ */ g(n, { height: o, position: "relative", width: o, children: [
19
- /* @__PURE__ */ e(n, { height: "100%", width: "100%", children: u }),
20
- /* @__PURE__ */ e(
21
- "svg",
22
- {
23
- height: o,
24
- style: { position: "absolute", top: 0, left: 0 },
25
- viewBox: "-150 -150 300 300",
26
- width: o,
27
- children: /* @__PURE__ */ e("g", { children: s.map((t) => {
28
- const h = r;
29
- r = r + 2 * Math.PI * (t.value / 100);
30
- const p = r, f = I().cornerRadius(4)({
31
- innerRadius: m,
32
- outerRadius: v + (t.id === d || t.id === i ? w : 0),
33
- startAngle: h,
34
- endAngle: p,
35
- padAngle: 0.025
36
- });
37
- return /* @__PURE__ */ e(
38
- "path",
39
- {
40
- className: "arc-outer",
41
- d: f,
42
- fill: t.color,
43
- onClick: () => a?.(t.id),
44
- onMouseEnter: () => l?.(t.id),
45
- onMouseLeave: () => c?.(t.id),
46
- style: { cursor: "pointer" }
47
- },
48
- t.id
49
- );
50
- }) })
51
- }
52
- )
53
- ] });
54
- }, M = x;
55
- export {
56
- M as D
57
- };
@@ -1,113 +0,0 @@
1
- import { jsxs as p, jsx as r } from "react/jsx-runtime";
2
- import n from "@mui/material/Box";
3
- import c from "@mui/material/Stack";
4
- import { H2 as D, Drawer as S, Footer as y } from "@mxenabled/mxui";
5
- import B from "@mui/material/IconButton";
6
- import { ArrowBack as C } from "@mxenabled/mx-icons";
7
- const j = ({
8
- ariaLabelClose: o,
9
- onClose: e,
10
- shouldShowBorders: a,
11
- shouldShowShadow: t,
12
- title: i
13
- }) => /* @__PURE__ */ p(
14
- c,
15
- {
16
- "aria-level": 1,
17
- direction: "row",
18
- role: "heading",
19
- sx: {
20
- alignItems: "center",
21
- backgroundColor: "background.paper",
22
- ...a && {
23
- borderBottom: 1,
24
- borderTop: 1,
25
- borderColor: "border.light"
26
- },
27
- ...t && {
28
- boxShadow: "0px 2px 8px 0px #6A73811F"
29
- },
30
- padding: "8px 8px 8px 8px"
31
- },
32
- children: [
33
- /* @__PURE__ */ r(B, { "aria-label": o, color: "primary", onClick: e, children: /* @__PURE__ */ r(C, { color: "primary", sx: { fontSize: 22 } }) }),
34
- /* @__PURE__ */ r(
35
- n,
36
- {
37
- sx: {
38
- flexGrow: 1,
39
- margin: "auto",
40
- textAlign: "center"
41
- },
42
- children: /* @__PURE__ */ r(D, { bold: !0, variant: "Body", children: i })
43
- }
44
- ),
45
- /* @__PURE__ */ r(n, { width: "44px" })
46
- ]
47
- }
48
- ), v = ({
49
- ariaLabelClose: o = "Close",
50
- children: e,
51
- hasSecondaryAction: a = !0,
52
- id: t,
53
- isOpen: i,
54
- isPrimaryDisabled: h,
55
- onClose: d,
56
- onPrimaryAction: l,
57
- onSecondaryAction: u,
58
- primaryColor: s = "primary",
59
- primaryText: x,
60
- secondaryColor: m = "secondary",
61
- secondaryText: b,
62
- shouldShowHeaderBorders: w = !0,
63
- shouldShowHeaderShadow: g = !1,
64
- title: f,
65
- ...k
66
- }) => /* @__PURE__ */ r(
67
- S,
68
- {
69
- id: t,
70
- isOpen: i,
71
- onClose: d,
72
- sx: {
73
- "& .MuiDrawer-paper": {
74
- backgroundColor: "background.default",
75
- borderRadius: 0
76
- },
77
- height: "100%",
78
- "& .MuiToolbar-root": {
79
- backgroundColor: "background.paper"
80
- }
81
- },
82
- ...k,
83
- children: /* @__PURE__ */ p(c, { height: "100%", justifyContent: "space-between", children: [
84
- /* @__PURE__ */ r(
85
- j,
86
- {
87
- ariaLabelClose: o,
88
- onClose: d,
89
- shouldShowBorders: w,
90
- shouldShowShadow: g,
91
- title: f
92
- }
93
- ),
94
- /* @__PURE__ */ r(n, { height: "100%", overflow: "auto", children: e }),
95
- l && /* @__PURE__ */ r(
96
- y,
97
- {
98
- hasSecondaryAction: a,
99
- isPrimaryDisabled: h,
100
- onPrimaryAction: l,
101
- onSecondaryAction: u ?? d,
102
- primaryColor: s,
103
- primaryText: x,
104
- secondaryColor: m,
105
- secondaryText: b
106
- }
107
- )
108
- ] })
109
- }
110
- ), $ = v;
111
- export {
112
- $ as D
113
- };
@@ -1,55 +0,0 @@
1
- import { jsxs as a, jsx as r } from "react/jsx-runtime";
2
- import n from "@mui/material/Button";
3
- import o from "@mui/material/Stack";
4
- import { Icon as l } from "@mxenabled/mx-icons";
5
- import { H2 as d, Text as f } from "@mxenabled/mxui";
6
- const v = ({
7
- iconColor: i,
8
- header: c,
9
- icon: x,
10
- onClick: t,
11
- primaryButton: p,
12
- secondaryButton: e,
13
- subText: m,
14
- sx: s
15
- }) => /* @__PURE__ */ a(
16
- o,
17
- {
18
- sx: {
19
- mt: 54,
20
- alignItems: "center",
21
- alignSelf: "center",
22
- ...s
23
- },
24
- children: [
25
- /* @__PURE__ */ r(l, { name: x, size: 54, sx: { color: i } }),
26
- /* @__PURE__ */ r(d, { color: "text.primary", sx: { textWrap: "wrap", textAlign: "center" }, children: c }),
27
- /* @__PURE__ */ r(
28
- f,
29
- {
30
- color: "text.secondary",
31
- sx: { textAlign: "center", textWrap: "wrap" },
32
- variant: "Paragraph",
33
- children: m
34
- }
35
- ),
36
- /* @__PURE__ */ a(
37
- o,
38
- {
39
- className: "buttons-footer",
40
- sx: {
41
- gap: 12,
42
- mt: 48
43
- },
44
- children: [
45
- /* @__PURE__ */ r(n, { onClick: () => t("primary"), sx: { textWrap: "nowrap" }, variant: "contained", children: p }),
46
- e && /* @__PURE__ */ r(n, { onClick: () => t("secondary"), sx: { textWrap: "nowrap" }, variant: "text", children: e })
47
- ]
48
- }
49
- )
50
- ]
51
- }
52
- );
53
- export {
54
- v as E
55
- };
@@ -1,116 +0,0 @@
1
- import { g as a } from "./Localization-2MODESHW.mjs";
2
- const S = {
3
- ACCOUNTS: "accounts",
4
- ANALYTICS_EVENTS: "analytics_events",
5
- ANALYTICS_FEATURE_VISITS: "feature_visits",
6
- ANALYTICS_PAGEVIEWS: "analytics_pageviews",
7
- ANALYTICS_SESSION: "analytics_sessions",
8
- APP_DATA: "raja/data?type=master",
9
- BEATS: "beats",
10
- BUDGETS: "budgets",
11
- CASHFLOW_EVENTS: "cashflow_events",
12
- CASHFLOW_SEQUENCES: "cashflow_sequences",
13
- CATEGORIES: "categories",
14
- DATE_RANGE_CATEGORY_TOTALS: "date_range_category_totals",
15
- DEVICES: "devices",
16
- EMAIL_VERIFICATIONS: "email_verifications",
17
- GOALS: "goals",
18
- HEALTH_SCORES: "health_scores",
19
- HOLDINGS: "holdings",
20
- INSTITUTIONS: "institutions",
21
- INSIGHTS_NOTIFICATION_PROFILES: "insight_notification_profiles",
22
- LOCALIZED_COPY: "localized_copies",
23
- LOCALIZED_CONTENT: "localized_content",
24
- MEMBERS: "members",
25
- MERCHANTS: "merchants",
26
- MONTHLY_CASH_FLOW_PROFILE: "monthly_cash_flow_profile",
27
- MONTHLY_CATEGORY_TOTALS: "monthly_category_totals",
28
- OFFERS: "offers",
29
- NOTIFICATION_PROFILES: "notification_profiles",
30
- NOTIFICATIONS: "notifications",
31
- PHONE_VERIFICATIONS: "sms_verification",
32
- PULSE_COMMUNICATIONS: "pulse_communications",
33
- REPEATING_TRANSACTIONS: "repeating_transactions",
34
- RETIREMENT_GOALS: "retirement_goals",
35
- RETIREMENT_GOAL_ACCOUNTS: "retirement_goal_accounts",
36
- SCHEDULED_PAYMENTS: "scheduled_payments",
37
- SPENDING_PLANS: "spending_plans",
38
- SUPPORT_TICKETS: "support_tickets",
39
- TAGGINGS: "taggings",
40
- TAGS: "tags",
41
- TRANSACTION_RULES: "transaction_rules",
42
- TRANSACTIONS: "transactions",
43
- USER: "user",
44
- USER_COMMUNICATION_PROFILE: "user_communication_profile",
45
- USER_FEATURES: "user_features",
46
- USER_PROFILES: "user_profiles",
47
- WIDGET_URLS: "widget_urls"
48
- };
49
- class c {
50
- endpoint = "/";
51
- headers;
52
- constructor(s, n, t) {
53
- this.endpoint = s;
54
- const o = {
55
- Accept: "application/json",
56
- "Accept-Language": a(),
57
- "Content-Type": "application/json",
58
- "MD-Session-Token": n
59
- };
60
- this.headers = t || o;
61
- }
62
- get = async (s) => {
63
- const n = {
64
- method: "GET",
65
- headers: this.headers
66
- };
67
- return fetch(`${this.endpoint}${s}`, n).then((t) => {
68
- if (t.ok)
69
- return t.text();
70
- throw t;
71
- }).then((t) => t.length ? JSON.parse(t) : {}).then((t) => t).catch((t) => {
72
- throw t;
73
- });
74
- };
75
- post = async (s, n) => {
76
- const t = n ? JSON.stringify(n) : void 0, o = {
77
- method: "POST",
78
- headers: this.headers,
79
- body: t
80
- };
81
- return fetch(`${this.endpoint}${s}`, o).then((e) => {
82
- if (!e.ok)
83
- throw e;
84
- return e.text();
85
- }).then((e) => e.length ? JSON.parse(e) : {}).then((e) => e).catch((e) => {
86
- throw e;
87
- });
88
- };
89
- put = async (s, n) => {
90
- const t = JSON.stringify(n), o = {
91
- method: "PUT",
92
- headers: this.headers,
93
- body: t
94
- };
95
- return fetch(`${this.endpoint}${s}`, o).then((e) => e.ok ? e.text() : e.text().then((i) => {
96
- throw new Error(i);
97
- })).then((e) => e.length ? JSON.parse(e) : {}).then((e) => e).catch((e) => {
98
- throw e;
99
- });
100
- };
101
- delete = async (s) => {
102
- const n = {
103
- method: "DELETE",
104
- headers: this.headers
105
- };
106
- return fetch(`${this.endpoint}${s}`, n).then((t) => t.ok ? t.text() : t.text().then((o) => {
107
- throw new Error(o);
108
- })).then((t) => t.length ? JSON.parse(t) : {}).then((t) => t).catch((t) => {
109
- throw t;
110
- });
111
- };
112
- }
113
- export {
114
- S as A,
115
- c as F
116
- };
@@ -1,101 +0,0 @@
1
- import { makeAutoObservable as l, runInAction as r } from "mobx";
2
- import { format as i } from "date-fns/format";
3
- import { fromUnixTime as g } from "date-fns/fromUnixTime";
4
- import { getUnixTime as s } from "date-fns/getUnixTime";
5
- import { subMonths as S } from "date-fns/subMonths";
6
- import { F as m, A as o } from "./Fetch-CkFKy79O.mjs";
7
- import { f as p, D as u } from "./Dialog-CWW597AF.mjs";
8
- class n {
9
- fetchInstance;
10
- constructor(e, t) {
11
- this.fetchInstance = new m(e, t);
12
- }
13
- calculateHealthScore = async () => this.fetchInstance.post(`${o.HEALTH_SCORES}/calculate`).then((e) => e.health_score);
14
- getAverageHealthScores = async () => this.fetchInstance.get(`${o.HEALTH_SCORES}/monthly_averages`).then((e) => e);
15
- getHealthScoreChangeReports = async (e, t) => this.fetchInstance.get(`${o.HEALTH_SCORES}/change_report/from/${e}/to/${t}`).then((a) => a);
16
- getPeerScore = async (e) => this.fetchInstance.get(`${o.HEALTH_SCORES}/average/${e}`).then((t) => t.average_health_score);
17
- }
18
- const y = (h) => h?.health_scores.map((e) => {
19
- const t = e.monthly_health_score_average, a = new Date(0, t.month - 1, 1);
20
- return {
21
- x: p(a, u.MONTH_SHORT),
22
- y: t.average_health_score,
23
- month: t.month
24
- // Keep original month for sorting
25
- };
26
- }).sort((e, t) => e.month - t.month).map((e) => ({ x: e.x, y: e.y }));
27
- class v {
28
- api = new n("/", "");
29
- augmentedChartData = [];
30
- averageHealthScores = [];
31
- globalStore;
32
- healthScore = {};
33
- healthScoreChange;
34
- healthScoreChangeReports = [];
35
- peerScore = null;
36
- constructor(e) {
37
- this.globalStore = e, this.api = new n(e.endpoint, e.sessionToken), l(this);
38
- }
39
- calculateHealthScore = async () => {
40
- try {
41
- const e = await this.api.calculateHealthScore();
42
- let t = 0;
43
- await this.loadHealthScoreChangeReports();
44
- const a = e?.health_score || 0, c = this.healthScoreChangeReports.at(-1)?.older_health_score || 0;
45
- t = a - c, r(() => {
46
- this.healthScore = e, this.healthScoreChange = t;
47
- });
48
- } catch (e) {
49
- console.error("Error calculating health score:", e);
50
- }
51
- };
52
- loadAverageHealthScores = async () => {
53
- try {
54
- const e = await this.api.getAverageHealthScores();
55
- r(() => {
56
- this.averageHealthScores = e;
57
- });
58
- } catch (e) {
59
- console.error("Error loading average health scores:", e);
60
- }
61
- };
62
- loadHealthScoreChangeReports = async () => {
63
- const e = s(S(/* @__PURE__ */ new Date(), 2)), t = s(/* @__PURE__ */ new Date());
64
- try {
65
- const a = await this.api.getHealthScoreChangeReports(
66
- e,
67
- t
68
- );
69
- r(() => {
70
- this.healthScoreChangeReports = a;
71
- });
72
- } catch (a) {
73
- console.error("Error loading health score change reports:", a);
74
- }
75
- };
76
- loadPeerScore = async () => {
77
- const e = i(g(this.globalStore.appDataStore.user.birthday), "yyyy");
78
- try {
79
- const t = await this.api.getPeerScore(e);
80
- r(() => {
81
- this.peerScore = t;
82
- });
83
- } catch (t) {
84
- console.error("Error loading peer score:", t);
85
- }
86
- };
87
- loadAugmentedChartData = async () => {
88
- try {
89
- const e = await this.api.getAverageHealthScores();
90
- r(() => {
91
- this.augmentedChartData = y(e);
92
- });
93
- } catch (e) {
94
- console.error(`Error occurred while getting augmented chart data: ${e}`);
95
- }
96
- };
97
- }
98
- export {
99
- n as F,
100
- v as a
101
- };