@mx-cartographer/experiences 7.2.14-alpha.san1 → 7.2.14-alpha.san3

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 R } from "date-fns/format";
2
+ import { format as y } 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 c, jsxs as T } from "react/jsx-runtime";
7
+ import { jsx as i, 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 w } from "date-fns/differenceInMonths";
12
+ import { differenceInMonths as N } from "date-fns/differenceInMonths";
13
13
  import { differenceInWeeks as A } from "date-fns/differenceInWeeks";
14
- import { startOfToday as N } from "date-fns/startOfToday";
14
+ import { startOfToday as w } 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 W from "@mui/material/ListItemButton";
24
- import j from "@mui/material/ListItemText";
23
+ import j from "@mui/material/ListItemButton";
24
+ import z 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 z } from "./Localization-2MODESHW.mjs";
27
+ import { b as W } 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__ */ c(B, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ c(
56
+ const q = ({ list: e, onClickItem: t }) => /* @__PURE__ */ i(B, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ i(
57
57
  U,
58
58
  {
59
59
  sx: {
@@ -63,8 +63,8 @@ const q = ({ list: e, onClickItem: t }) => /* @__PURE__ */ c(B, { sx: { bgcolor:
63
63
  }
64
64
  },
65
65
  children: e.map((r, n) => /* @__PURE__ */ T($.Fragment, { children: [
66
- /* @__PURE__ */ c(X, { secondaryAction: /* @__PURE__ */ c(P, {}), children: /* @__PURE__ */ T(W, { onClick: () => t(r.key), children: [
67
- /* @__PURE__ */ c(V, { children: /* @__PURE__ */ c(
66
+ /* @__PURE__ */ i(X, { secondaryAction: /* @__PURE__ */ i(P, {}), children: /* @__PURE__ */ T(j, { onClick: () => t(r.key), children: [
67
+ /* @__PURE__ */ i(V, { children: /* @__PURE__ */ i(
68
68
  K,
69
69
  {
70
70
  sx: {
@@ -80,15 +80,15 @@ const q = ({ list: e, onClickItem: t }) => /* @__PURE__ */ c(B, { sx: { bgcolor:
80
80
  children: r.icon
81
81
  }
82
82
  ) }),
83
- /* @__PURE__ */ c(
84
- j,
83
+ /* @__PURE__ */ i(
84
+ z,
85
85
  {
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 })
86
+ primary: /* @__PURE__ */ i(F, { sx: { color: "text.secondary" }, variant: "caption", children: r.primaryText }),
87
+ secondary: /* @__PURE__ */ i(F, { sx: { color: "text.primary", fontWeight: 600 }, variant: "body1", children: r.secondaryText })
88
88
  }
89
89
  )
90
90
  ] }) }),
91
- n < e.length - 1 && /* @__PURE__ */ c(Y, { sx: { color: "divider", ml: 68 } })
91
+ n < e.length - 1 && /* @__PURE__ */ i(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__ */ c(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 }, wt = (e, t, r, n) => {
147
- const o = e.reduce((i, d) => i + d.value, 0);
146
+ } : { status: r.missing_data }, Nt = (e, t, r, n) => {
147
+ const o = e.reduce((c, d) => c + d.value, 0);
148
148
  let a = 0;
149
- const s = e.map((i) => {
150
- const d = i.value / o * t, p = r + a, f = p + d;
149
+ const s = e.map((c) => {
150
+ const d = c.value / o * t, p = r + a, f = p + d;
151
151
  return a += d, {
152
- ...i,
152
+ ...c,
153
153
  startAngle: p,
154
154
  endAngle: f
155
155
  };
156
156
  });
157
157
  return [s[n].startAngle, s[n].endAngle];
158
- }, Nt = (e, t, r, n, o) => {
158
+ }, wt = (e, t, r, n, o) => {
159
159
  let a = 0, s = 0;
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];
160
+ const c = Math.floor(n), d = n - c;
161
+ return c > r ? (a = e, s = t) : c === 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__ */ c(B, { sx: { bgcolor:
170
170
  label: o,
171
171
  value: a
172
172
  }) => {
173
- const s = !!a, i = s ? J(n, a) : e && z(e, t) || t;
173
+ const s = !!a, c = s ? J(n, a) : e && W(e, t) || t;
174
174
  return {
175
- icon: s ? /* @__PURE__ */ c(k, {}) : r,
175
+ icon: s ? /* @__PURE__ */ i(k, {}) : r,
176
176
  isComplete: s,
177
177
  key: n,
178
178
  primaryText: o,
179
- secondaryText: i
179
+ secondaryText: c
180
180
  };
181
181
  }, J = (e, t) => ({
182
- [O.DateOfBirth]: (n) => R(new Date(Number(n) * 1e3), "MMM d, yyyy"),
182
+ [O.DateOfBirth]: (n) => y(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__ */ c(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", Wt = (e, t) => {
202
+ }, Q = (e) => e === null ? "MISSING" : e === 0 ? "GOOD" : "OFF_TRACK", jt = (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__ */ c(B, { sx: { bgcolor:
210
210
  description: n[r],
211
211
  title: t.count_card_title
212
212
  };
213
- }, jt = (e) => ({
213
+ }, zt = (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__ */ c(B, { sx: { bgcolor:
220
220
  2: G,
221
221
  3: v
222
222
  }, rt = {
223
- 1: w,
223
+ 1: N,
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__ */ c(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
- ], zt = ({
231
+ ], Wt = ({
232
232
  contribution: e,
233
233
  goalAmount: t,
234
234
  goalPeriod: r,
@@ -237,9 +237,9 @@ const q = ({ list: e, onClickItem: t }) => /* @__PURE__ */ c(B, { sx: { bgcolor:
237
237
  }) => {
238
238
  const a = t - o;
239
239
  if (a <= 0) return 0;
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);
240
+ const s = w(), c = et[n], d = rt[e];
241
+ if (!c || !d) return a;
242
+ const p = c(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__ */ c(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 y {
256
+ class R {
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 y {
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 y("/", "");
272
+ api = new R("/", "");
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 y(t.endpoint, t.sessionToken, t.onError), D(this);
288
+ this.globalStore = t, this.api = new R(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 = R(b(this.globalStore.appDataStore.user.birthday), "yyyy");
358
+ const t = y(b(this.globalStore.appDataStore.user.birthday), "yyyy");
359
359
  try {
360
360
  const r = await this.api.getPeerScore(t);
361
361
  l(() => {
@@ -398,28 +398,25 @@ 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
- };
404
401
  }
405
402
  export {
406
403
  O as A,
407
404
  u as C,
408
405
  te as F,
409
406
  vt as P,
410
- Nt as a,
407
+ wt as a,
411
408
  Pt as b,
412
409
  Gt as c,
413
410
  Lt as d,
414
411
  g as e,
415
412
  Zt as f,
416
- wt as g,
417
- jt as h,
413
+ Nt as g,
414
+ zt as h,
418
415
  S as i,
419
416
  Vt as j,
420
417
  Qt as k,
421
418
  Jt as l,
422
- zt as m,
419
+ Wt as m,
423
420
  qt as n,
424
421
  Yt as o,
425
422
  Q as p,
@@ -427,9 +424,9 @@ export {
427
424
  Mt as r,
428
425
  $t as s,
429
426
  Kt as t,
430
- Wt as u,
427
+ jt as u,
431
428
  Ut as v,
432
429
  Xt as w,
433
430
  kt as x,
434
- y
431
+ R as y
435
432
  };
@@ -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-1MFI6RcM.mjs";
67
+ import { F as Ct } from "../FinstrongStore-bkPQR8ln.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";
@@ -5,7 +5,7 @@ export interface MiniWidgetProps {
5
5
  sx?: SxProps;
6
6
  }
7
7
  export interface WidgetProps {
8
- handleFinstrongWidgetPrimaryCtaClick?: (value: string) => () => void;
8
+ onPrimaryCtaClick?: (value: string) => () => void;
9
9
  onBackClick?: () => void;
10
10
  sx?: SxProps;
11
11
  title?: string;
@@ -1,5 +1,5 @@
1
1
  import { WidgetProps } from '../common';
2
- declare const _default: (({ onBackClick, sx, handleFinstrongWidgetPrimaryCtaClick, }: WidgetProps) => import("react/jsx-runtime").JSX.Element) & {
2
+ declare const _default: (({ onBackClick, sx, onPrimaryCtaClick }: WidgetProps) => import("react/jsx-runtime").JSX.Element) & {
3
3
  displayName: string;
4
4
  };
5
5
  export default _default;
@@ -1,3 +1,6 @@
1
1
  import { default as React } from 'react';
2
- declare const _default: React.FunctionComponent<{}>;
2
+ interface KeyIndicatorsSpendTabProps {
3
+ onPrimaryCtaClick?: (value: string) => () => void;
4
+ }
5
+ declare const _default: React.FunctionComponent<KeyIndicatorsSpendTabProps>;
3
6
  export default _default;
@@ -6,6 +6,7 @@ interface KeyIndicatorsTabsItemProps {
6
6
  title: string;
7
7
  description: string;
8
8
  cardState: keyof typeof CardStatus;
9
+ onPrimaryCtaClick?: (value: string) => () => void;
9
10
  }
10
11
  declare const KeyIndicatorsTabsItem: React.FC<KeyIndicatorsTabsItemProps>;
11
12
  export default KeyIndicatorsTabsItem;
@@ -3,8 +3,9 @@ interface KeyIndicatorsTabItemDrawerProps {
3
3
  drawerFor: KeyIndicatorsTabItemType;
4
4
  isOpen: boolean;
5
5
  onClose: () => void;
6
+ onPrimaryCtaClick?: (value: string) => () => void;
6
7
  }
7
- declare const _default: (({ drawerFor, isOpen, onClose, }: KeyIndicatorsTabItemDrawerProps) => import("react/jsx-runtime").JSX.Element) & {
8
+ declare const _default: (({ drawerFor, isOpen, onClose, onPrimaryCtaClick, }: KeyIndicatorsTabItemDrawerProps) => import("react/jsx-runtime").JSX.Element) & {
8
9
  displayName: string;
9
10
  };
10
11
  export default _default;
@@ -1,3 +1,6 @@
1
1
  import { default as React } from 'react';
2
- declare const _default: React.FunctionComponent<{}>;
2
+ interface KeyIndicatorsTabsWidgetProps {
3
+ onPrimaryCtaClick?: (value: string) => () => void;
4
+ }
5
+ declare const _default: React.FunctionComponent<KeyIndicatorsTabsWidgetProps>;
3
6
  export default _default;
@@ -1,3 +1,6 @@
1
1
  import { default as React } from 'react';
2
- declare const _default: React.FunctionComponent<{}>;
2
+ interface SpendLessThanYouMakeComponentProps {
3
+ onPrimaryCtaClick?: (value: string) => () => void;
4
+ }
5
+ declare const _default: React.FunctionComponent<SpendLessThanYouMakeComponentProps>;
3
6
  export default _default;