@mx-cartographer/experiences 7.2.14-alpha.san4 → 7.2.14-alpha.san5
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.
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { makeAutoObservable as D, runInAction as l } from "mobx";
|
|
2
|
-
import { format as
|
|
2
|
+
import { format as R } from "date-fns/format";
|
|
3
3
|
import { fromUnixTime as b } from "date-fns/fromUnixTime";
|
|
4
4
|
import { getUnixTime as I } from "date-fns/getUnixTime";
|
|
5
5
|
import { subMonths as H } from "date-fns/subMonths";
|
|
6
6
|
import { F as x, A as h } from "./Fetch-87LIQbEA.mjs";
|
|
7
|
-
import { jsx as
|
|
7
|
+
import { jsx as c, jsxs as T } from "react/jsx-runtime";
|
|
8
8
|
import { addDays as v } from "date-fns/addDays";
|
|
9
9
|
import { addMonths as M } from "date-fns/addMonths";
|
|
10
10
|
import { addYears as G } from "date-fns/addYears";
|
|
11
11
|
import { differenceInDays as L } from "date-fns/differenceInDays";
|
|
12
|
-
import { differenceInMonths as
|
|
12
|
+
import { differenceInMonths as w } from "date-fns/differenceInMonths";
|
|
13
13
|
import { differenceInWeeks as A } from "date-fns/differenceInWeeks";
|
|
14
|
-
import { startOfToday as
|
|
14
|
+
import { startOfToday as N } from "date-fns/startOfToday";
|
|
15
15
|
import { ChevronRight as P, Check as k } from "@mxenabled/mx-icons";
|
|
16
16
|
import $ from "react";
|
|
17
17
|
import K from "@mui/material/Avatar";
|
|
@@ -20,11 +20,11 @@ import Y from "@mui/material/Divider";
|
|
|
20
20
|
import U from "@mui/material/List";
|
|
21
21
|
import X from "@mui/material/ListItem";
|
|
22
22
|
import V from "@mui/material/ListItemAvatar";
|
|
23
|
-
import
|
|
24
|
-
import
|
|
23
|
+
import W from "@mui/material/ListItemButton";
|
|
24
|
+
import j from "@mui/material/ListItemText";
|
|
25
25
|
import { Text as F } from "@mxenabled/mxui";
|
|
26
26
|
import { f as _, a as C } from "./Dialog-BPTr3qHE.mjs";
|
|
27
|
-
import { b as
|
|
27
|
+
import { b as z } from "./Localization-2MODESHW.mjs";
|
|
28
28
|
const m = {
|
|
29
29
|
creditScore: {
|
|
30
30
|
poor: 600,
|
|
@@ -53,7 +53,7 @@ const m = {
|
|
|
53
53
|
MISSING: "MISSING DATA"
|
|
54
54
|
};
|
|
55
55
|
var O = /* @__PURE__ */ ((e) => (e.Connections = "connections", e.CreditScore = "credit_score", e.DateOfBirth = "date_of_birth", e.MonthlyIncome = "monthly_income", e))(O || {});
|
|
56
|
-
const q = ({ list: e, onClickItem: t }) => /* @__PURE__ */
|
|
56
|
+
const q = ({ list: e, onClickItem: t }) => /* @__PURE__ */ c(B, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ c(
|
|
57
57
|
U,
|
|
58
58
|
{
|
|
59
59
|
sx: {
|
|
@@ -63,8 +63,8 @@ const q = ({ list: e, onClickItem: t }) => /* @__PURE__ */ i(B, { sx: { bgcolor:
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
children: e.map((r, n) => /* @__PURE__ */ T($.Fragment, { children: [
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ c(X, { secondaryAction: /* @__PURE__ */ c(P, {}), children: /* @__PURE__ */ T(W, { onClick: () => t(r.key), children: [
|
|
67
|
+
/* @__PURE__ */ c(V, { children: /* @__PURE__ */ c(
|
|
68
68
|
K,
|
|
69
69
|
{
|
|
70
70
|
sx: {
|
|
@@ -80,15 +80,15 @@ const q = ({ list: e, onClickItem: t }) => /* @__PURE__ */ i(B, { sx: { bgcolor:
|
|
|
80
80
|
children: r.icon
|
|
81
81
|
}
|
|
82
82
|
) }),
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
|
|
83
|
+
/* @__PURE__ */ c(
|
|
84
|
+
j,
|
|
85
85
|
{
|
|
86
|
-
primary: /* @__PURE__ */
|
|
87
|
-
secondary: /* @__PURE__ */
|
|
86
|
+
primary: /* @__PURE__ */ c(F, { sx: { color: "text.secondary" }, variant: "caption", children: r.primaryText }),
|
|
87
|
+
secondary: /* @__PURE__ */ c(F, { sx: { color: "text.primary", fontWeight: 600 }, variant: "body1", children: r.secondaryText })
|
|
88
88
|
}
|
|
89
89
|
)
|
|
90
90
|
] }) }),
|
|
91
|
-
n < e.length - 1 && /* @__PURE__ */
|
|
91
|
+
n < e.length - 1 && /* @__PURE__ */ c(Y, { sx: { color: "divider", ml: 68 } })
|
|
92
92
|
] }, r.key))
|
|
93
93
|
}
|
|
94
94
|
) }), vt = q, Mt = (e) => e * (180 / Math.PI), Gt = (e, t) => [
|
|
@@ -143,22 +143,22 @@ const q = ({ list: e, onClickItem: t }) => /* @__PURE__ */ i(B, { sx: { bgcolor:
|
|
|
143
143
|
} : e >= 800 && e <= 850 ? {
|
|
144
144
|
status: r.exceptional,
|
|
145
145
|
color: t ? u.EXCEPTIONAL : g.EXCEPTIONAL
|
|
146
|
-
} : { status: r.missing_data },
|
|
147
|
-
const o = e.reduce((
|
|
146
|
+
} : { status: r.missing_data }, wt = (e, t, r, n) => {
|
|
147
|
+
const o = e.reduce((i, d) => i + d.value, 0);
|
|
148
148
|
let a = 0;
|
|
149
|
-
const s = e.map((
|
|
150
|
-
const d =
|
|
149
|
+
const s = e.map((i) => {
|
|
150
|
+
const d = i.value / o * t, p = r + a, f = p + d;
|
|
151
151
|
return a += d, {
|
|
152
|
-
...
|
|
152
|
+
...i,
|
|
153
153
|
startAngle: p,
|
|
154
154
|
endAngle: f
|
|
155
155
|
};
|
|
156
156
|
});
|
|
157
157
|
return [s[n].startAngle, s[n].endAngle];
|
|
158
|
-
},
|
|
158
|
+
}, Nt = (e, t, r, n, o) => {
|
|
159
159
|
let a = 0, s = 0;
|
|
160
|
-
const
|
|
161
|
-
return
|
|
160
|
+
const i = Math.floor(n), d = n - i;
|
|
161
|
+
return i > r ? (a = e, s = t) : i === r && d > 0 && (a = e, s = o), [a, s];
|
|
162
162
|
}, Pt = (e, t, r = 0) => {
|
|
163
163
|
const n = e * Math.sin(t - r), o = -e * Math.cos(t - r);
|
|
164
164
|
return [n, o];
|
|
@@ -170,16 +170,16 @@ const q = ({ list: e, onClickItem: t }) => /* @__PURE__ */ i(B, { sx: { bgcolor:
|
|
|
170
170
|
label: o,
|
|
171
171
|
value: a
|
|
172
172
|
}) => {
|
|
173
|
-
const s = !!a,
|
|
173
|
+
const s = !!a, i = s ? J(n, a) : e && z(e, t) || t;
|
|
174
174
|
return {
|
|
175
|
-
icon: s ? /* @__PURE__ */
|
|
175
|
+
icon: s ? /* @__PURE__ */ c(k, {}) : r,
|
|
176
176
|
isComplete: s,
|
|
177
177
|
key: n,
|
|
178
178
|
primaryText: o,
|
|
179
|
-
secondaryText:
|
|
179
|
+
secondaryText: i
|
|
180
180
|
};
|
|
181
181
|
}, J = (e, t) => ({
|
|
182
|
-
[O.DateOfBirth]: (n) =>
|
|
182
|
+
[O.DateOfBirth]: (n) => R(new Date(Number(n) * 1e3), "MMM d, yyyy"),
|
|
183
183
|
[O.MonthlyIncome]: (n) => `$${n}`
|
|
184
184
|
})[e]?.(t) ?? String(t), $t = (e) => e !== null ? Math.round(e * 100) : null, Kt = (e) => {
|
|
185
185
|
const t = new Date((/* @__PURE__ */ new Date()).getFullYear(), e - 1, 1);
|
|
@@ -199,7 +199,7 @@ const q = ({ list: e, onClickItem: t }) => /* @__PURE__ */ i(B, { sx: { bgcolor:
|
|
|
199
199
|
}, Vt = (e) => {
|
|
200
200
|
const { good: t, poor: r } = m.creditScore;
|
|
201
201
|
return e === null ? "MISSING" : e >= t ? "GOOD" : e >= r ? "FAIR" : "OFF_TRACK";
|
|
202
|
-
}, Q = (e) => e === null ? "MISSING" : e === 0 ? "GOOD" : "OFF_TRACK",
|
|
202
|
+
}, Q = (e) => e === null ? "MISSING" : e === 0 ? "GOOD" : "OFF_TRACK", Wt = (e, t) => {
|
|
203
203
|
const r = Q(e), n = {
|
|
204
204
|
GOOD: t.count_good_description,
|
|
205
205
|
OFF_TRACK: t.count_off_track_description,
|
|
@@ -210,7 +210,7 @@ const q = ({ list: e, onClickItem: t }) => /* @__PURE__ */ i(B, { sx: { bgcolor:
|
|
|
210
210
|
description: n[r],
|
|
211
211
|
title: t.count_card_title
|
|
212
212
|
};
|
|
213
|
-
},
|
|
213
|
+
}, jt = (e) => ({
|
|
214
214
|
[S.GOOD]: { backgroundColor: "success.lighter", color: "success.dark" },
|
|
215
215
|
[S.FAIR]: { backgroundColor: "warning.lighter", color: "warning.dark" },
|
|
216
216
|
[S.OFF_TRACK]: { backgroundColor: "error.lighter", color: "error.dark" },
|
|
@@ -220,7 +220,7 @@ const q = ({ list: e, onClickItem: t }) => /* @__PURE__ */ i(B, { sx: { bgcolor:
|
|
|
220
220
|
2: G,
|
|
221
221
|
3: v
|
|
222
222
|
}, rt = {
|
|
223
|
-
1:
|
|
223
|
+
1: w,
|
|
224
224
|
2: (e, t) => A(e, t) / 2,
|
|
225
225
|
3: A,
|
|
226
226
|
4: L
|
|
@@ -228,7 +228,7 @@ const q = ({ list: e, onClickItem: t }) => /* @__PURE__ */ i(B, { sx: { bgcolor:
|
|
|
228
228
|
{ contributionPeriodIndex: 3, targetAmount: 6, upperLimit: 500 },
|
|
229
229
|
{ contributionPeriodIndex: 3, targetAmount: 3, upperLimit: 900 },
|
|
230
230
|
{ contributionPeriodIndex: 2, targetAmount: 1, upperLimit: 1e3 }
|
|
231
|
-
],
|
|
231
|
+
], zt = ({
|
|
232
232
|
contribution: e,
|
|
233
233
|
goalAmount: t,
|
|
234
234
|
goalPeriod: r,
|
|
@@ -237,9 +237,9 @@ const q = ({ list: e, onClickItem: t }) => /* @__PURE__ */ i(B, { sx: { bgcolor:
|
|
|
237
237
|
}) => {
|
|
238
238
|
const a = t - o;
|
|
239
239
|
if (a <= 0) return 0;
|
|
240
|
-
const s =
|
|
241
|
-
if (!
|
|
242
|
-
const p =
|
|
240
|
+
const s = N(), i = et[n], d = rt[e];
|
|
241
|
+
if (!i || !d) return a;
|
|
242
|
+
const p = i(s, r), f = d(p, s);
|
|
243
243
|
return Math.max(a / (f || 1), 1);
|
|
244
244
|
}, qt = (e) => !e || e <= 0 ? "0%" : e >= 1e3 ? "100%" : `${Math.round(e / 10)}%`, Jt = (e) => E.find((r) => e < r.upperLimit)?.targetAmount ?? tt, Qt = (e) => E.find((n) => e < n.upperLimit)?.contributionPeriodIndex ?? Z, Zt = (e, t) => e.map((n) => {
|
|
245
245
|
const o = new Date(0, n.month - 1, 1);
|
|
@@ -253,7 +253,7 @@ const q = ({ list: e, onClickItem: t }) => /* @__PURE__ */ i(B, { sx: { bgcolor:
|
|
|
253
253
|
})), ot = (e) => e.sort((r, n) => n.transaction.date - r.transaction.date).map(({ transaction: r }) => ({
|
|
254
254
|
...r
|
|
255
255
|
}));
|
|
256
|
-
class
|
|
256
|
+
class y {
|
|
257
257
|
fetchInstance;
|
|
258
258
|
constructor(t, r, n) {
|
|
259
259
|
this.fetchInstance = new x(t, r, void 0, n);
|
|
@@ -269,7 +269,7 @@ class R {
|
|
|
269
269
|
getStandardSpend = async () => this.fetchInstance.get(`${h.HEALTH_SCORES}/transactions/standard_spend`).then((t) => t);
|
|
270
270
|
}
|
|
271
271
|
class te {
|
|
272
|
-
api = new
|
|
272
|
+
api = new y("/", "");
|
|
273
273
|
augmentedChartData = [];
|
|
274
274
|
averageHealthScores = [];
|
|
275
275
|
monthlySummaries = [];
|
|
@@ -285,7 +285,7 @@ class te {
|
|
|
285
285
|
healthScoreChangeReports = [];
|
|
286
286
|
peerScore = null;
|
|
287
287
|
constructor(t) {
|
|
288
|
-
this.globalStore = t, this.api = new
|
|
288
|
+
this.globalStore = t, this.api = new y(t.endpoint, t.sessionToken, t.onError), D(this);
|
|
289
289
|
}
|
|
290
290
|
calculateHealthScore = async () => {
|
|
291
291
|
try {
|
|
@@ -355,7 +355,7 @@ class te {
|
|
|
355
355
|
}
|
|
356
356
|
};
|
|
357
357
|
loadPeerScore = async () => {
|
|
358
|
-
const t =
|
|
358
|
+
const t = R(b(this.globalStore.appDataStore.user.birthday), "yyyy");
|
|
359
359
|
try {
|
|
360
360
|
const r = await this.api.getPeerScore(t);
|
|
361
361
|
l(() => {
|
|
@@ -398,25 +398,28 @@ class te {
|
|
|
398
398
|
get spendAndDebtTransactions() {
|
|
399
399
|
return [...this.allTransactions.spend, ...this.allTransactions.debtSpend];
|
|
400
400
|
}
|
|
401
|
+
handleFinstrongWidgetPrimaryCtaClick = (t) => () => {
|
|
402
|
+
console.log("Finstrong widget primary CTA clicked:", t);
|
|
403
|
+
};
|
|
401
404
|
}
|
|
402
405
|
export {
|
|
403
406
|
O as A,
|
|
404
407
|
u as C,
|
|
405
408
|
te as F,
|
|
406
409
|
vt as P,
|
|
407
|
-
|
|
410
|
+
Nt as a,
|
|
408
411
|
Pt as b,
|
|
409
412
|
Gt as c,
|
|
410
413
|
Lt as d,
|
|
411
414
|
g as e,
|
|
412
415
|
Zt as f,
|
|
413
|
-
|
|
414
|
-
|
|
416
|
+
wt as g,
|
|
417
|
+
jt as h,
|
|
415
418
|
S as i,
|
|
416
419
|
Vt as j,
|
|
417
420
|
Qt as k,
|
|
418
421
|
Jt as l,
|
|
419
|
-
|
|
422
|
+
zt as m,
|
|
420
423
|
qt as n,
|
|
421
424
|
Yt as o,
|
|
422
425
|
Q as p,
|
|
@@ -424,9 +427,9 @@ export {
|
|
|
424
427
|
Mt as r,
|
|
425
428
|
$t as s,
|
|
426
429
|
Kt as t,
|
|
427
|
-
|
|
430
|
+
Wt as u,
|
|
428
431
|
Ut as v,
|
|
429
432
|
Xt as w,
|
|
430
433
|
kt as x,
|
|
431
|
-
|
|
434
|
+
y
|
|
432
435
|
};
|
package/dist/common/index.es.js
CHANGED
|
@@ -64,7 +64,7 @@ import { startOfToday as U } from "date-fns/startOfToday";
|
|
|
64
64
|
import { f as bt, a as wt, b as L } from "../BudgetUtil-wjoNuj7B.mjs";
|
|
65
65
|
import { g as ta, e as ea, c as sa, d as ra, i as oa } from "../BudgetUtil-wjoNuj7B.mjs";
|
|
66
66
|
import { a as xt } from "../DebtsStore-Bu8rRRSL.mjs";
|
|
67
|
-
import { F as Ct } from "../FinstrongStore-
|
|
67
|
+
import { F as Ct } from "../FinstrongStore-1MFI6RcM.mjs";
|
|
68
68
|
import { A as vt, m as Dt, a as At, b as Et } from "../InvestmentUtil-jOyOgzIB.mjs";
|
|
69
69
|
import { M as Tt } from "../MerchantStore-DrFvsUyy.mjs";
|
|
70
70
|
import { N as Bt } from "../NetWorthStore-CpL_kqvx.mjs";
|