@mx-cartographer/experiences 9.7.154 → 9.7.156
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 +13 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js +19 -22
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js +43 -48
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js +30 -34
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js +52 -52
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/BlockErrorMessage.d.ts +4 -0
- package/dist/insights-v2/actionBlocks/BlockErrorMessage.es.js +17 -0
- package/dist/insights-v2/actionBlocks/BlockErrorMessage.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js +131 -135
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/ContactSupportActionBlock.es.js +14 -18
- package/dist/insights-v2/actionBlocks/ContactSupportActionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js +19 -25
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js +26 -28
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/HelpBlock/HelpBlock.es.js +11 -14
- package/dist/insights-v2/actionBlocks/HelpBlock/HelpBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js +12 -12
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/OverdraftBlock/OverdraftBlock.es.js +28 -30
- package/dist/insights-v2/actionBlocks/OverdraftBlock/OverdraftBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js +53 -55
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js +26 -31
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.es.js +18 -18
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PlaceholderActionBlock.es.js +23 -22
- package/dist/insights-v2/actionBlocks/PlaceholderActionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js +38 -41
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +44 -44
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/SurveyModalActionBlock.es.js +24 -24
- package/dist/insights-v2/actionBlocks/SurveyModalActionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js +11 -16
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js +20 -20
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/util.d.ts +1 -2
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/util.es.js +3 -7
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/util.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +39 -42
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +102 -104
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js +11 -11
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js +58 -58
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.d.ts +7 -0
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js +28 -0
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSubscriptionHeader.es.js +14 -33
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSubscriptionHeader.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js +24 -41
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/useOpenedCta.d.ts +9 -0
- package/dist/insights-v2/actionBlocks/useOpenedCta.es.js +11 -0
- package/dist/insights-v2/actionBlocks/useOpenedCta.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/util.d.ts +2 -1
- package/dist/insights-v2/actionBlocks/util.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## [9.7.156] - 11-13-2026
|
|
2
|
+
|
|
3
|
+
- **CHANGED** - Insights 2.0 action blocks show one shared error message when their copy or data is missing; no visible change when copy has loaded (WEC-2262)
|
|
4
|
+
- **CHANGED** - Action blocks rely on `ActionBlockLayer`'s copy loader and no longer check copy loading themselves (WEC-2262)
|
|
5
|
+
- **FIXED** - After a failed copy request, the error drawer shows "Something went wron...
|
|
6
|
+
|
|
7
|
+
## [9.7.155] - 11-13-2026
|
|
8
|
+
|
|
9
|
+
- **CHANGED** - Insights 2.0 action blocks read the CTA that opened their drawer through one shared `useOpenedCta` hook instead of resolving it themselves; drawers behave the same (WEC-2262)
|
|
10
|
+
- **CHANGED** - The placeholder action block resolves its in-description link and chart-bar trigger like the other action blocks (WEC-2262)
|
|
11
|
+
- **CHANGED** - Debt Payoff Strategies uses the shared currency format for account balances; no visible change (WEC-2259)
|
|
12
|
+
- **CHANGED** - The Transaction List summary and Subscriptions header cards share one icon tile; no visible change (WEC-2262)
|
|
13
|
+
|
|
1
14
|
## [9.7.154] - 11-13-2026
|
|
2
15
|
|
|
3
16
|
- **FIXED** - Monthly Subscription Aggregate: the single subscription card matches Figma, and the Subscriptions drawer keeps each row two lines tall with the frequency on the account line (WEC-2298)
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import { useAccountStore as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { useAccountStore as a } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import c from "../../../common/components/Loader.es.js";
|
|
3
|
+
import l from "../../../trends/components/TrendsChart.es.js";
|
|
4
|
+
import { BlockErrorMessage as p } from "../BlockErrorMessage.es.js";
|
|
5
|
+
import A from "../../../accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.es.js";
|
|
6
|
+
import { resolveAccount as b } from "./layout.es.js";
|
|
7
|
+
import g from "../../../accounts/components/detailsdrawer/Accounts/AccountDetailsContent.es.js";
|
|
8
|
+
import { useEffect as S } from "react";
|
|
8
9
|
import { observer as k } from "mobx-react-lite";
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import { jsx as e, jsxs as L } from "react/jsx-runtime";
|
|
10
|
+
import x from "@mui/material/Stack";
|
|
11
|
+
import { jsx as e, jsxs as C } from "react/jsx-runtime";
|
|
12
12
|
var w = k(function({ beat: i }) {
|
|
13
|
-
const {
|
|
14
|
-
return
|
|
15
|
-
|
|
13
|
+
const { accounts: n, accountsLoaded: m, institutionsLoaded: u, members: r, membersLoaded: s, uiStore: o } = a(), t = b(i, n), d = !!t && o.selectedAccount.guid === t.guid;
|
|
14
|
+
return S(() => {
|
|
15
|
+
t && (o.setSelectedAccount(t), o.setSelectedMember(r.find((f) => f.guid === t.member_guid) ?? {}));
|
|
16
16
|
}, [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
]),
|
|
17
|
+
t,
|
|
18
|
+
r,
|
|
19
|
+
o
|
|
20
|
+
]), t ? !d || !s || !u ? /* @__PURE__ */ e(c, {}) : /* @__PURE__ */ C(x, {
|
|
21
21
|
sx: { bgcolor: "background.default" },
|
|
22
|
-
children: [/* @__PURE__ */ e(
|
|
23
|
-
}) :
|
|
24
|
-
sx: { p: 24 },
|
|
25
|
-
children: /* @__PURE__ */ e(D, { children: s.error_message })
|
|
26
|
-
}) : /* @__PURE__ */ e(r, {}) : /* @__PURE__ */ e(r, {});
|
|
22
|
+
children: [/* @__PURE__ */ e(A, { ChartComponent: l }), /* @__PURE__ */ e(g, {})]
|
|
23
|
+
}) : m ? /* @__PURE__ */ e(p, {}) : /* @__PURE__ */ e(c, {});
|
|
27
24
|
});
|
|
28
25
|
export {
|
|
29
26
|
w as AccountDetailsBlock
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountDetailsBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.tsx"],"sourcesContent":["import { useEffect } from 'react'\n\nimport Stack from '@mui/material/Stack'\n\nimport {
|
|
1
|
+
{"version":3,"file":"AccountDetailsBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.tsx"],"sourcesContent":["import { useEffect } from 'react'\n\nimport Stack from '@mui/material/Stack'\n\nimport { observer } from 'mobx-react-lite'\n\nimport AccountDetailsContent from '../../../accounts/components/detailsdrawer/Accounts/AccountDetailsContent'\nimport AccountDetailsHeader from '../../../accounts/components/detailsdrawer/Accounts/AccountDetailsHeader'\nimport { Loader, useAccountStore } from '../../../common'\nimport type { Member } from '../../../core'\nimport TrendsChart from '../../../trends/components/TrendsChart'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { BlockErrorMessage } from '../BlockErrorMessage'\n\nimport { resolveAccount } from './layout'\n\n/**\n * Account Details drawer (MEW2-2633): the accounts widget's details header (logo, institution,\n * name, balances, trend chart) and content (Transactions / Account Details tabs, connection status,\n * actions) for the beat's account. Those components read the account store's selection, so the\n * beat's account is selected here first and nothing renders until the selection matches and the\n * members and institutions are in (the connection section reads the member's status): a guid the\n * store cannot resolve shows the error message, never the previously selected account.\n */\nexport const AccountDetailsBlock = observer(function AccountDetailsBlock({\n beat,\n}: ActionBlockProps) {\n const { accounts, accountsLoaded, institutionsLoaded, members, membersLoaded, uiStore } =\n useAccountStore()\n const account = resolveAccount(beat, accounts)\n const isSelected = !!account && uiStore.selectedAccount.guid === account.guid\n\n useEffect(() => {\n if (!account) return\n\n uiStore.setSelectedAccount(account)\n uiStore.setSelectedMember(\n members.find((member) => member.guid === account.member_guid) ?? ({} as Member),\n )\n }, [account, members, uiStore])\n\n if (!account) {\n if (!accountsLoaded) return <Loader />\n\n return <BlockErrorMessage />\n }\n\n if (!isSelected || !membersLoaded || !institutionsLoaded) return <Loader />\n\n return (\n <Stack sx={{ bgcolor: 'background.default' }}>\n <AccountDetailsHeader ChartComponent={TrendsChart} />\n <AccountDetailsContent />\n </Stack>\n )\n})\n"],"mappings":";;;;;;;;;;;AAwBA,IAAa,IAAsB,EAAS,SAA6B,EACvE,MAAA,EAAA,GACmB;AACnB,QAAM,EAAE,UAAA,GAAU,gBAAA,GAAgB,oBAAA,GAAoB,SAAA,GAAS,eAAA,GAAe,SAAA,EAAA,IAC5E,EAAgB,GACZ,IAAU,EAAe,GAAM,CAAQ,GACvC,IAAa,CAAC,CAAC,KAAW,EAAQ,gBAAgB,SAAS,EAAQ;AAWzE,SATA,EAAA,MAAgB;AACd,IAAK,MAEL,EAAQ,mBAAmB,CAAO,GAClC,EAAQ,kBACN,EAAQ,KAAA,CAAM,MAAW,EAAO,SAAS,EAAQ,WAAW,KAAM,CAAC,CACrE;AAAA,EACF,GAAG;AAAA,IAAC;AAAA,IAAS;AAAA,IAAS;AAAA,EAAO,CAAC,GAEzB,IAMD,CAAC,KAAc,CAAC,KAAiB,CAAC,IAA2B,gBAAA,EAAC,GAAD,CAAS,CAAA,IAGxE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,SAAS,qBAAqB;AAAA,IAA3C,UAAA,CACE,gBAAA,EAAC,GAAD,EAAsB,gBAAgB,EAAc,CAAA,GACpD,gBAAA,EAAC,GAAD,CAAwB,CAAA,CACnB;AAAA,OAXF,IAEE,gBAAA,EAAC,GAAD,CAAoB,CAAA,IAFC,gBAAA,EAAC,GAAD,CAAS,CAAA;AAazC,CAAC"}
|
|
@@ -1,85 +1,80 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useAccountStore as
|
|
3
|
-
import { getFrequencyLabel as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
1
|
+
import O from "../../../common/utils/AccountDisplayName.es.js";
|
|
2
|
+
import { useAccountStore as $, useAppConfig as j, useCashflowStore as q, useGlobalCopyStore as z, useRecurringTransactionsStore as I } from "../../../common/context/hooks.es.js";
|
|
3
|
+
import { getFrequencyLabel as M } from "../../../core/utils/RecurringTransactionsUtil.es.js";
|
|
4
|
+
import _ from "../../../common/components/drawer/Drawer.es.js";
|
|
5
|
+
import H from "../../../common/components/Loader.es.js";
|
|
6
|
+
import { BlockErrorMessage as J } from "../BlockErrorMessage.es.js";
|
|
7
|
+
import K from "../../components/CategoryTile.es.js";
|
|
8
|
+
import { useOpenedCta as P } from "../useOpenedCta.es.js";
|
|
9
|
+
import { useRecurringExpensesLoadState as Q } from "../RecurringTransactionBlock/useRecurringTransactionPrepare.es.js";
|
|
10
|
+
import { RecurringTransactionBlock as U } from "../RecurringTransactionBlock/RecurringTransactionBlock.es.js";
|
|
11
|
+
import { AccountDetailsBlock as V } from "../AccountDetailsBlock/AccountDetailsBlock.es.js";
|
|
12
|
+
import W from "./AccountListContent.es.js";
|
|
13
|
+
import { buildSummary as X, isCheckingAccount as h, resolveBeatAccounts as Y, toAccountSection as k } from "./layout.es.js";
|
|
13
14
|
import { useState as G } from "react";
|
|
14
|
-
import { observer as
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
sx: { p: 24 },
|
|
23
|
-
children: /* @__PURE__ */ o(at, { children: v?.error_message ?? "Something went wrong." })
|
|
24
|
-
});
|
|
25
|
-
if (!b) return /* @__PURE__ */ o(C, {});
|
|
26
|
-
const { primary_cta: F, secondary_cta: $, in_description_cta: I } = n.insights_payload ?? {}, N = Z(D, F, $, I), y = ct(n, d, x), O = y.filter(S), j = y.filter((t) => !S(t)), a = B.display_available_balance_in_accounts, q = [T("checking", e.checking, O, a), T("savings", e.savings, j, a)].filter((t) => t.rows.length > 0), z = f ? [...w.expensesTilNextIncome].sort((t, c) => c.amount - t.amount).map((t) => {
|
|
27
|
-
const c = d.find(({ guid: u }) => u === t.accountGuid), h = R.find(({ guid: u }) => u === t.repeatingTransactionGuid);
|
|
15
|
+
import { observer as Z } from "mobx-react-lite";
|
|
16
|
+
import { Fragment as tt, jsx as o, jsxs as ot } from "react/jsx-runtime";
|
|
17
|
+
var _t = Z(function({ beat: n }) {
|
|
18
|
+
const [i, l] = G(null), [s, m] = G(null), { accounts: p, insights_feed: T, recurring: r } = z(), { accountsLoaded: v, cashAccounts: L, visibleAccounts: d } = $(), S = P(n), { uiStore: b } = q(), { detailedRepeatingTransactions: x } = I(), { config: D } = j(), { failed: g, ready: f, retry: R } = Q(), e = T?.account_list;
|
|
19
|
+
if (!e) return /* @__PURE__ */ o(J, {});
|
|
20
|
+
if (!v) return /* @__PURE__ */ o(H, {});
|
|
21
|
+
const y = Y(n, d, L), B = y.filter(h), E = y.filter((t) => !h(t)), a = D.display_available_balance_in_accounts, w = [k("checking", e.checking, B, a), k("savings", e.savings, E, a)].filter((t) => t.rows.length > 0), F = f ? [...b.expensesTilNextIncome].sort((t, c) => c.amount - t.amount).map((t) => {
|
|
22
|
+
const c = d.find(({ guid: u }) => u === t.accountGuid), C = x.find(({ guid: u }) => u === t.repeatingTransactionGuid);
|
|
28
23
|
return {
|
|
29
24
|
account: {
|
|
30
25
|
institutionGuid: t.institutionGuid,
|
|
31
|
-
name: c ?
|
|
26
|
+
name: c ? O(c) : t.institutionName
|
|
32
27
|
},
|
|
33
28
|
amount: t.amount,
|
|
34
|
-
frequency:
|
|
29
|
+
frequency: C && M(r, C, !1),
|
|
35
30
|
key: `${t.repeatingTransactionGuid}-${t.expectedDate.getTime()}`,
|
|
36
|
-
leading: /* @__PURE__ */ o(
|
|
31
|
+
leading: /* @__PURE__ */ o(K, {
|
|
37
32
|
categoryGuid: t.categoryGuid,
|
|
38
33
|
size: 32
|
|
39
34
|
}),
|
|
40
35
|
name: t.name,
|
|
41
36
|
onClick: () => l(t)
|
|
42
37
|
};
|
|
43
|
-
}) : [],
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */ o(
|
|
38
|
+
}) : [], A = () => l(null), N = () => m(null);
|
|
39
|
+
return /* @__PURE__ */ ot(tt, { children: [
|
|
40
|
+
/* @__PURE__ */ o(W, {
|
|
46
41
|
copy: e,
|
|
47
|
-
expenses:
|
|
42
|
+
expenses: F,
|
|
48
43
|
expensesLoading: !f && !g,
|
|
49
44
|
onAccountClick: m,
|
|
50
|
-
onRetryExpenses: g ?
|
|
51
|
-
sections:
|
|
45
|
+
onRetryExpenses: g ? R : void 0,
|
|
46
|
+
sections: w,
|
|
52
47
|
showAvailable: a,
|
|
53
|
-
summary:
|
|
48
|
+
summary: X(S, e)
|
|
54
49
|
}),
|
|
55
|
-
/* @__PURE__ */ o(
|
|
56
|
-
ariaLabelClose:
|
|
50
|
+
/* @__PURE__ */ o(_, {
|
|
51
|
+
ariaLabelClose: r.close_drawer_aria,
|
|
57
52
|
isOpen: i !== null,
|
|
58
|
-
onClose:
|
|
59
|
-
title:
|
|
60
|
-
children: i && /* @__PURE__ */ o(
|
|
53
|
+
onClose: A,
|
|
54
|
+
title: r.expense_details,
|
|
55
|
+
children: i && /* @__PURE__ */ o(U, {
|
|
61
56
|
beat: n,
|
|
62
57
|
layout: "insights",
|
|
63
|
-
onDeleted:
|
|
58
|
+
onDeleted: A,
|
|
64
59
|
repeatingTransactionGuid: i.repeatingTransactionGuid,
|
|
65
60
|
selectedRecurrence: i
|
|
66
61
|
})
|
|
67
62
|
}),
|
|
68
|
-
/* @__PURE__ */ o(
|
|
63
|
+
/* @__PURE__ */ o(_, {
|
|
69
64
|
ariaLabelClose: p?.close_account_details_aria,
|
|
70
|
-
isOpen:
|
|
71
|
-
onClose:
|
|
65
|
+
isOpen: s !== null,
|
|
66
|
+
onClose: N,
|
|
72
67
|
title: p?.account_details,
|
|
73
|
-
children:
|
|
68
|
+
children: s && /* @__PURE__ */ o(V, { beat: {
|
|
74
69
|
...n,
|
|
75
70
|
primary_account: void 0,
|
|
76
|
-
primary_account_guid:
|
|
71
|
+
primary_account_guid: s
|
|
77
72
|
} })
|
|
78
73
|
})
|
|
79
74
|
] });
|
|
80
75
|
});
|
|
81
76
|
export {
|
|
82
|
-
|
|
77
|
+
_t as AccountListBlock
|
|
83
78
|
};
|
|
84
79
|
|
|
85
80
|
//# sourceMappingURL=AccountListBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountListBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.tsx"],"sourcesContent":["import { useState } from 'react'\n\nimport
|
|
1
|
+
{"version":3,"file":"AccountListBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.tsx"],"sourcesContent":["import { useState } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Drawer,\n Loader,\n useAccountStore,\n useAppConfig,\n useCashflowStore,\n useGlobalCopyStore,\n useRecurringTransactionsStore,\n} from '../../../common'\nimport getAccountDisplayName from '../../../common/utils/AccountDisplayName'\nimport type { Recurrence } from '../../../core'\nimport { getFrequencyLabel } from '../../../core/utils/RecurringTransactionsUtil'\nimport CategoryTile from '../../components/CategoryTile'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { AccountDetailsBlock } from '../AccountDetailsBlock'\nimport { BlockErrorMessage } from '../BlockErrorMessage'\nimport {\n RecurringTransactionBlock,\n useRecurringExpensesLoadState,\n} from '../RecurringTransactionBlock'\nimport { useOpenedCta } from '../useOpenedCta'\n\nimport AccountListContent, { type ExpenseRow } from './AccountListContent'\nimport { buildSummary, isCheckingAccount, resolveBeatAccounts, toAccountSection } from './layout'\n\n/**\n * Account List drawer: the CTA's calculation, then Accounts and Recurring Expenses tabs.\n * A tapped expense opens its Expense Details, and a tapped account its Account Details (the shared\n * AccountDetailsBlock), each in a nested drawer.\n */\nexport const AccountListBlock = observer(function AccountListBlock({ beat }: ActionBlockProps) {\n const [tappedExpense, setTappedExpense] = useState<Recurrence | null>(null)\n const [tappedAccountGuid, setTappedAccountGuid] = useState<string | null>(null)\n const {\n accounts: accountsCopy,\n insights_feed: insightsFeedCopy,\n recurring: recurringCopy,\n } = useGlobalCopyStore()\n const { accountsLoaded, cashAccounts, visibleAccounts } = useAccountStore()\n const cta = useOpenedCta(beat)\n const { uiStore } = useCashflowStore()\n const { detailedRepeatingTransactions } = useRecurringTransactionsStore()\n const { config } = useAppConfig()\n const { failed: expensesFailed, ready: expensesReady, retry } = useRecurringExpensesLoadState()\n const copy = insightsFeedCopy?.account_list\n\n if (!copy) {\n return <BlockErrorMessage />\n }\n\n if (!accountsLoaded) return <Loader />\n\n const listed = resolveBeatAccounts(beat, visibleAccounts, cashAccounts)\n const checking = listed.filter(isCheckingAccount)\n const savings = listed.filter((account) => !isCheckingAccount(account))\n const showAvailable = config.display_available_balance_in_accounts\n const sections = [\n toAccountSection('checking', copy.checking, checking, showAvailable),\n toAccountSection('savings', copy.savings, savings, showAvailable),\n ].filter((section) => section.rows.length > 0)\n\n // Every upcoming expense as its own row, largest first (Figma); no \"Other\" fold, so each opens its details.\n const expenses: ExpenseRow[] = expensesReady\n ? [...uiStore.expensesTilNextIncome]\n .sort((a, b) => b.amount - a.amount)\n .map((expense) => {\n const account = visibleAccounts.find(({ guid }) => guid === expense.accountGuid)\n const repeating = detailedRepeatingTransactions.find(\n ({ guid }) => guid === expense.repeatingTransactionGuid,\n )\n\n return {\n account: {\n institutionGuid: expense.institutionGuid,\n name: account ? getAccountDisplayName(account) : expense.institutionName,\n },\n amount: expense.amount,\n frequency: repeating && getFrequencyLabel(recurringCopy, repeating, false),\n key: `${expense.repeatingTransactionGuid}-${expense.expectedDate.getTime()}`,\n leading: <CategoryTile categoryGuid={expense.categoryGuid} size={32} />,\n name: expense.name,\n onClick: () => setTappedExpense(expense),\n }\n })\n : []\n\n const closeExpenseDetails = () => setTappedExpense(null)\n const closeAccountDetails = () => setTappedAccountGuid(null)\n\n return (\n <>\n <AccountListContent\n copy={copy}\n expenses={expenses}\n expensesLoading={!expensesReady && !expensesFailed}\n onAccountClick={setTappedAccountGuid}\n onRetryExpenses={expensesFailed ? retry : undefined}\n sections={sections}\n showAvailable={showAvailable}\n summary={buildSummary(cta, copy)}\n />\n <Drawer\n ariaLabelClose={recurringCopy.close_drawer_aria}\n isOpen={tappedExpense !== null}\n onClose={closeExpenseDetails}\n title={recurringCopy.expense_details}\n >\n {tappedExpense && (\n <RecurringTransactionBlock\n beat={beat}\n layout=\"insights\"\n onDeleted={closeExpenseDetails}\n repeatingTransactionGuid={tappedExpense.repeatingTransactionGuid}\n selectedRecurrence={tappedExpense}\n />\n )}\n </Drawer>\n <Drawer\n ariaLabelClose={accountsCopy?.close_account_details_aria}\n isOpen={tappedAccountGuid !== null}\n onClose={closeAccountDetails}\n title={accountsCopy?.account_details}\n >\n {tappedAccountGuid && (\n // The shared block shows the beat's account, so hand it the tapped one instead.\n <AccountDetailsBlock\n beat={{ ...beat, primary_account: undefined, primary_account_guid: tappedAccountGuid }}\n />\n )}\n </Drawer>\n </>\n )\n})\n"],"mappings":"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"}
|
|
@@ -1,54 +1,50 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
2
|
-
import
|
|
1
|
+
import { useGlobalCopyStore as B, useGlobalUiStore as S, useInsightsV2Store as b } from "../../common/context/hooks.es.js";
|
|
2
|
+
import w from "../../common/components/drawer/Drawer.es.js";
|
|
3
3
|
import L from "../../common/components/Loader.es.js";
|
|
4
|
-
import {
|
|
5
|
-
import O from "../
|
|
6
|
-
import
|
|
4
|
+
import { BlockErrorMessage as D } from "./BlockErrorMessage.es.js";
|
|
5
|
+
import { hasDrawerBlock as O } from "../mappings/hasDrawerBlock.es.js";
|
|
6
|
+
import x from "../components/shared/StatusSnackbar.es.js";
|
|
7
|
+
import { useOpenedCta as _ } from "./useOpenedCta.es.js";
|
|
7
8
|
import { actionBlocks as j } from "../mappings/blocks.es.js";
|
|
8
9
|
import { useRef as F } from "react";
|
|
9
10
|
import { observer as G } from "mobx-react-lite";
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
import { Fragment as d, jsx as e, jsxs as u } from "react/jsx-runtime";
|
|
13
|
-
var V = (c, o) => {
|
|
11
|
+
import { Fragment as d, jsx as t, jsxs as f } from "react/jsx-runtime";
|
|
12
|
+
var N = (i, o) => {
|
|
14
13
|
const r = F(void 0);
|
|
15
|
-
return
|
|
16
|
-
},
|
|
17
|
-
const { Component: r, usePrepare:
|
|
18
|
-
return
|
|
19
|
-
},
|
|
20
|
-
const r =
|
|
14
|
+
return i ? (r.current ??= o, r.current) : (r.current = void 0, o);
|
|
15
|
+
}, k = ({ actionBlock: i, ...o }) => {
|
|
16
|
+
const { Component: r, usePrepare: c } = i;
|
|
17
|
+
return c(o), /* @__PURE__ */ t(r, { ...o });
|
|
18
|
+
}, J = G(function({ beat: o }) {
|
|
19
|
+
const r = B(), c = r.common, m = c?.close_aria ?? "Close", { isCopyLoaded: g } = S(), { actionDrawer: u, actionNotice: C, closeActionDrawer: v, setActionNotice: h } = b(), s = u.isDrawerOpen && u.guid === o.guid, e = N(s, _(o));
|
|
21
20
|
if (!o.insights_payload) return null;
|
|
22
|
-
if (!g) return s ? /* @__PURE__ */
|
|
23
|
-
const
|
|
24
|
-
closeAriaLabel:
|
|
25
|
-
message:
|
|
21
|
+
if (!g) return s ? /* @__PURE__ */ t(L, {}) : null;
|
|
22
|
+
const a = C[o.guid], p = /* @__PURE__ */ t(x, {
|
|
23
|
+
closeAriaLabel: m,
|
|
24
|
+
message: a?.message ?? "",
|
|
26
25
|
onClose: () => h(o.guid, void 0),
|
|
27
|
-
open: !!
|
|
28
|
-
severity:
|
|
29
|
-
}),
|
|
30
|
-
if (n?.presentation === "modal") return /* @__PURE__ */
|
|
26
|
+
open: !!a,
|
|
27
|
+
severity: a?.severity
|
|
28
|
+
}), l = O(e?.block), n = l ? j[e?.block] : void 0;
|
|
29
|
+
if (n?.presentation === "modal") return /* @__PURE__ */ f(d, { children: [s && /* @__PURE__ */ t(k, {
|
|
31
30
|
actionBlock: n,
|
|
32
31
|
beat: o
|
|
33
|
-
},
|
|
34
|
-
const
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
ariaLabelClose:
|
|
32
|
+
}, e?.block), p] });
|
|
33
|
+
const y = n?.title?.(e?.variant, r, o), A = n ? y || e?.label || "" : l ? c?.error_heading ?? "Oops" : e?.label ?? "";
|
|
34
|
+
return /* @__PURE__ */ f(d, { children: [/* @__PURE__ */ t(w, {
|
|
35
|
+
ariaLabelClose: m,
|
|
37
36
|
headerAction: n?.headerAction,
|
|
38
37
|
isOpen: s,
|
|
39
|
-
onClose:
|
|
38
|
+
onClose: v,
|
|
40
39
|
title: A,
|
|
41
|
-
children: n ? /* @__PURE__ */
|
|
40
|
+
children: n ? /* @__PURE__ */ t(k, {
|
|
42
41
|
actionBlock: n,
|
|
43
42
|
beat: o
|
|
44
|
-
},
|
|
45
|
-
sx: { p: 24 },
|
|
46
|
-
children: /* @__PURE__ */ e(R, { children: i.error_message })
|
|
47
|
-
}) : null
|
|
43
|
+
}, e?.block) : l ? /* @__PURE__ */ t(D, {}) : null
|
|
48
44
|
}), p] });
|
|
49
45
|
});
|
|
50
46
|
export {
|
|
51
|
-
|
|
47
|
+
J as ActionBlockLayer
|
|
52
48
|
};
|
|
53
49
|
|
|
54
50
|
//# sourceMappingURL=ActionBlockLayer.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionBlockLayer.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/ActionBlockLayer.tsx"],"sourcesContent":["import { useRef } from 'react'\n\nimport
|
|
1
|
+
{"version":3,"file":"ActionBlockLayer.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/ActionBlockLayer.tsx"],"sourcesContent":["import { useRef } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Drawer,\n Loader,\n useGlobalCopyStore,\n useGlobalUiStore,\n useInsightsV2Store,\n} from '../../common'\nimport type { Beat } from '../../core'\nimport {\n actionBlocks,\n hasDrawerBlock,\n type ActionBlockEntry,\n type ActionBlockProps,\n} from '../mappings/blocks'\nimport StatusSnackbar from '../components/shared/StatusSnackbar'\nimport { BlockErrorMessage } from './BlockErrorMessage'\nimport { useOpenedCta } from './useOpenedCta'\nimport type { OpenedCta } from './util'\n\ninterface ActionBlockLayerProps {\n beat: Beat\n}\n\n/** Keeps the CTA the user pressed for the open session: a refreshed beat may name another CTA there. */\nconst useSessionCta = (isOpen: boolean, resolved: OpenedCta): OpenedCta => {\n const pinned = useRef<OpenedCta>(undefined)\n\n if (!isOpen) {\n pinned.current = undefined\n return resolved\n }\n pinned.current ??= resolved\n\n return pinned.current\n}\n\n/**\n * Renders a registered action block. Callers MUST key this per block name — a\n * block with `usePrepare` and one without run a different number of hooks, so\n * reusing the same fiber across a block switch violates the rules of hooks.\n */\nconst ActionBlockRunner = ({\n actionBlock,\n ...blockProps\n}: ActionBlockProps & { actionBlock: ActionBlockEntry }) => {\n const { Component, usePrepare } = actionBlock\n\n usePrepare(blockProps)\n\n return <Component {...blockProps} />\n}\n\n// `observer` is required: this reads `isCopyLoaded` off GlobalUiStore and the\n// action drawer off InsightsV2Store. Without it the component never re-renders\n// and stays stuck on <Loader /> forever.\nexport const ActionBlockLayer = observer(function ActionBlockLayer({\n beat,\n}: ActionBlockLayerProps) {\n const copy = useGlobalCopyStore()\n const commonCopy = copy.common\n const closeAria = commonCopy?.close_aria ?? 'Close'\n const { isCopyLoaded } = useGlobalUiStore()\n const { actionDrawer, actionNotice, closeActionDrawer, setActionNotice } = useInsightsV2Store()\n\n // Every card in the feed renders its own layer against the shared store, so\n // this card's drawer only opens when its beat is the one that triggered it.\n const isCurrentBeatOpen = actionDrawer.isDrawerOpen && actionDrawer.guid === beat.guid\n\n const currentCta = useSessionCta(isCurrentBeatOpen, useOpenedCta(beat))\n\n // Mirrors BaseLayout's guard — the layer is exported, so callers are not\n // guaranteed to have narrowed this already.\n if (!beat.insights_payload) return null\n\n if (!isCopyLoaded) return isCurrentBeatOpen ? <Loader /> : null\n\n // A block that closes its own drawer hands its message here, so it shows after the unmount.\n const notice = actionNotice[beat.guid]\n const noticeSnackbar = (\n <StatusSnackbar\n closeAriaLabel={closeAria}\n message={notice?.message ?? ''}\n onClose={() => setActionNotice(beat.guid, undefined)}\n open={Boolean(notice)}\n severity={notice?.severity}\n />\n )\n\n // A CTA without a real block never opens a drawer (BaseLayout won't trigger it);\n // a real-but-unknown block shows the error (\"oops\") content.\n const blockValid = hasDrawerBlock(currentCta?.block)\n const actionBlock = blockValid\n ? actionBlocks[currentCta?.block as keyof typeof actionBlocks]\n : undefined\n\n // A modal block owns its dialog: no drawer behind it, and nothing mounted until it is opened.\n if (actionBlock?.presentation === 'modal') {\n return (\n <>\n {isCurrentBeatOpen && (\n <ActionBlockRunner actionBlock={actionBlock} beat={beat} key={currentCta?.block} />\n )}\n {noticeSnackbar}\n </>\n )\n }\n\n const resolvedTitle = actionBlock?.title?.(currentCta?.variant, copy, beat)\n const drawerTitle = actionBlock\n ? resolvedTitle || currentCta?.label || ''\n : blockValid\n ? (commonCopy?.error_heading ?? 'Oops')\n : (currentCta?.label ?? '')\n\n return (\n <>\n <Drawer\n ariaLabelClose={closeAria}\n headerAction={actionBlock?.headerAction}\n isOpen={isCurrentBeatOpen}\n onClose={closeActionDrawer}\n title={drawerTitle}\n >\n {actionBlock ? (\n <ActionBlockRunner actionBlock={actionBlock} beat={beat} key={currentCta?.block} />\n ) : blockValid ? (\n <BlockErrorMessage />\n ) : null}\n </Drawer>\n {noticeSnackbar}\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;AA4BA,IAAM,IAAA,CAAiB,GAAiB,MAAmC;AACzE,QAAM,IAAS,EAAkB,MAAS;AAE1C,SAAK,KAIL,EAAO,YAAY,GAEZ,EAAO,YALZ,EAAO,UAAU,QACV;AAKX,GAOM,IAAA,CAAqB,EACzB,aAAA,GACA,GAAG,EAAA,MACuD;AAC1D,QAAM,EAAE,WAAA,GAAW,YAAA,EAAA,IAAe;AAElC,SAAA,EAAW,CAAU,GAEd,gBAAA,EAAC,GAAD,EAAW,GAAI,EAAa,CAAA;AACrC,GAKa,IAAmB,EAAS,SAA0B,EACjE,MAAA,EAAA,GACwB;AACxB,QAAM,IAAO,EAAmB,GAC1B,IAAa,EAAK,QAClB,IAAY,GAAY,cAAc,SACtC,EAAE,cAAA,EAAA,IAAiB,EAAiB,GACpC,EAAE,cAAA,GAAc,cAAA,GAAc,mBAAA,GAAmB,iBAAA,EAAA,IAAoB,EAAmB,GAIxF,IAAoB,EAAa,gBAAgB,EAAa,SAAS,EAAK,MAE5E,IAAa,EAAc,GAAmB,EAAa,CAAI,CAAC;AAItE,MAAI,CAAC,EAAK,iBAAkB,QAAO;AAEnC,MAAI,CAAC,EAAc,QAAO,IAAoB,gBAAA,EAAC,GAAD,CAAS,CAAA,IAAI;AAG3D,QAAM,IAAS,EAAa,EAAK,IAAA,GAC3B,IACJ,gBAAA,EAAC,GAAD;AAAA,IACE,gBAAgB;AAAA,IAChB,SAAS,GAAQ,WAAW;AAAA,IAC5B,SAAA,MAAe,EAAgB,EAAK,MAAM,MAAS;AAAA,IACnD,MAAM,EAAQ;AAAA,IACd,UAAU,GAAQ;AAAA,EACnB,CAAA,GAKG,IAAa,EAAe,GAAY,KAAK,GAC7C,IAAc,IAChB,EAAa,GAAY,KAAA,IACzB;AAGJ,MAAI,GAAa,iBAAiB,QAChC,QACE,gBAAA,EAAA,GAAA,EAAA,UAAA,CACG,KACC,gBAAA,EAAC,GAAD;AAAA,IAAgC,aAAA;AAAA,IAAmB,MAAA;AAAA,EAA+B,GAApB,GAAY,KAAQ,GAEnF,CACD,EAAA,CAAA;AAIN,QAAM,IAAgB,GAAa,QAAQ,GAAY,SAAS,GAAM,CAAI,GACpE,IAAc,IAChB,KAAiB,GAAY,SAAS,KACtC,IACG,GAAY,iBAAiB,SAC7B,GAAY,SAAS;AAE5B,SACE,gBAAA,EAAA,GAAA,EAAA,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,IACE,gBAAgB;AAAA,IAChB,cAAc,GAAa;AAAA,IAC3B,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,OAAO;AAAA,IAEN,UAAA,IACC,gBAAA,EAAC,GAAD;AAAA,MAAgC,aAAA;AAAA,MAAmB,MAAA;AAAA,IAA+B,GAApB,GAAY,KAAQ,IAChF,IACF,gBAAA,EAAC,GAAD,CAAoB,CAAA,IAClB;AAAA,EACE,CAAA,GACP,CACD,EAAA,CAAA;AAEN,CAAC"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { buildDynamicCopy as j } from "../../../core/utils/Localization.es.js";
|
|
2
2
|
import z from "../../../common/utils/AccountDisplayName.es.js";
|
|
3
|
-
import { useCategoryStore as q, useGlobalCopyStore as
|
|
3
|
+
import { useCategoryStore as q, useGlobalCopyStore as w, useInsightsV2Store as P, useSettingsStore as J, useUserStore as K } from "../../../common/context/hooks.es.js";
|
|
4
4
|
import B from "../../../common/components/Loader.es.js";
|
|
5
5
|
import Q from "../../../common/components/CurrencyDialog.es.js";
|
|
6
6
|
import { useBeatActions as X } from "../../beatActions.es.js";
|
|
7
7
|
import { ANALYTICS_EVENTS_CONFIG as d } from "../../analytics/analyticsEventsConfig.es.js";
|
|
8
8
|
import { useCtaHandler as Z } from "../../ctaActions/useCtaAction.es.js";
|
|
9
9
|
import { useAnalyticsEvent as oo } from "../../analytics/useAnalyticsEvent.es.js";
|
|
10
|
-
import {
|
|
10
|
+
import { useOpenedCta as eo } from "../useOpenedCta.es.js";
|
|
11
11
|
import { CreateBudgetDialog as to } from "./CreateBudgetDialog.es.js";
|
|
12
12
|
import { AMOUNT_INPUT_VARIANTS as io, CREATE_BUDGET_VARIANT as no, findLowBalanceProfile as ro, isAmountInputVariant as x, isWholeAmount as ao, resolveAmountInputVariant as so, toInputValue as co } from "./layout.es.js";
|
|
13
|
-
import
|
|
13
|
+
import r from "react";
|
|
14
14
|
import { observer as V } from "mobx-react-lite";
|
|
15
15
|
import k from "@mui/material/Stack";
|
|
16
|
-
import { H3 as lo, InstitutionLogo as uo, Text as
|
|
16
|
+
import { H3 as lo, InstitutionLogo as uo, Text as H } from "@mxenabled/mxui";
|
|
17
17
|
import { Icon as mo } from "@mxenabled/mx-icons";
|
|
18
18
|
import { jsx as o, jsxs as O } from "react/jsx-runtime";
|
|
19
19
|
import po from "@mui/material/Dialog";
|
|
20
|
-
import
|
|
21
|
-
var
|
|
22
|
-
const
|
|
20
|
+
import fo from "@mui/material/IconButton";
|
|
21
|
+
var S = ({ children: g, closeAriaLabel: i, heading: n, onClose: e }) => {
|
|
22
|
+
const a = r.useId();
|
|
23
23
|
return /* @__PURE__ */ o(po, {
|
|
24
|
-
"aria-labelledby": n ?
|
|
24
|
+
"aria-labelledby": n ? a : void 0,
|
|
25
25
|
maxWidth: "xs",
|
|
26
26
|
onClose: e,
|
|
27
27
|
open: !0,
|
|
@@ -33,10 +33,10 @@ var E = ({ children: y, closeAriaLabel: i, heading: n, onClose: e }) => {
|
|
|
33
33
|
},
|
|
34
34
|
children: [
|
|
35
35
|
n && /* @__PURE__ */ o(lo, {
|
|
36
|
-
id:
|
|
36
|
+
id: a,
|
|
37
37
|
children: n
|
|
38
38
|
}),
|
|
39
|
-
/* @__PURE__ */ o(
|
|
39
|
+
/* @__PURE__ */ o(fo, {
|
|
40
40
|
"aria-label": i || "Close",
|
|
41
41
|
onClick: e,
|
|
42
42
|
sx: {
|
|
@@ -49,74 +49,74 @@ var E = ({ children: y, closeAriaLabel: i, heading: n, onClose: e }) => {
|
|
|
49
49
|
sx: { color: "action.active" }
|
|
50
50
|
})
|
|
51
51
|
}),
|
|
52
|
-
|
|
52
|
+
g
|
|
53
53
|
]
|
|
54
54
|
})
|
|
55
55
|
});
|
|
56
56
|
}, ko = V(function({ beat: i }) {
|
|
57
|
-
const { common: n } =
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
}, [
|
|
57
|
+
const { common: n } = w(), { closeActionDrawer: e } = P(), a = q(), l = eo(i), [u] = r.useState(() => so(l)), m = u === no;
|
|
58
|
+
return r.useEffect(() => {
|
|
59
|
+
m && !a.categoriesLoaded && a.loadCategories();
|
|
60
|
+
}, [a, m]), m ? a.categoriesLoaded ? /* @__PURE__ */ o(to, { beat: i }) : /* @__PURE__ */ o(S, {
|
|
61
61
|
closeAriaLabel: n?.close_aria,
|
|
62
|
-
onClose:
|
|
62
|
+
onClose: e,
|
|
63
63
|
children: /* @__PURE__ */ o(B, {})
|
|
64
|
-
}) : /* @__PURE__ */ o(
|
|
64
|
+
}) : /* @__PURE__ */ o(_o, {
|
|
65
65
|
beat: i,
|
|
66
|
-
variant:
|
|
66
|
+
variant: u
|
|
67
67
|
});
|
|
68
|
-
}),
|
|
69
|
-
const { common: e, insights_feed:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}), []),
|
|
68
|
+
}), _o = V(function({ beat: i, variant: n }) {
|
|
69
|
+
const { common: e, insights_feed: a } = w(), { closeActionDrawer: l } = P(), u = J(), { userInsightProfile: m } = K(), A = Z(i, X()), E = oo(), c = a?.amount_input_modal, t = n === io.LOW_BALANCE_THRESHOLD, h = t ? ro(u.notificationProfiles, i.primary_account_guid) : void 0, T = t ? h?.threshold : m?.savings_opportunity_minimum_checking_account_balance, [R, G] = r.useState(t), p = r.useRef(!0);
|
|
70
|
+
r.useEffect(() => (p.current = !0, () => {
|
|
71
|
+
p.current = !1;
|
|
72
|
+
}), []), r.useEffect(() => {
|
|
73
73
|
t && u.loadNotificationProfiles().finally(() => {
|
|
74
|
-
|
|
74
|
+
p.current && G(!1);
|
|
75
75
|
});
|
|
76
76
|
}, [t, u]);
|
|
77
|
-
const [F, M] =
|
|
78
|
-
if (R) return /* @__PURE__ */ o(
|
|
77
|
+
const [F, M] = r.useState(null), [C, v] = r.useState(!1), [U, y] = r.useState(!1), f = F ?? co(T);
|
|
78
|
+
if (R) return /* @__PURE__ */ o(S, {
|
|
79
79
|
closeAriaLabel: e?.close_aria,
|
|
80
|
-
onClose:
|
|
80
|
+
onClose: l,
|
|
81
81
|
children: /* @__PURE__ */ o(B, {})
|
|
82
82
|
});
|
|
83
|
-
const
|
|
84
|
-
if (!
|
|
85
|
-
return console.warn(`amount_input_modal_block: ${
|
|
83
|
+
const s = x(n) ? c?.[n] : void 0, D = !!s?.title && !!s.description && !!s.input_label && !!c?.whole_number_error && !!c.save_error && !!e?.save_button && (!t || !!e.cancel_button) && !!e.close_aria;
|
|
84
|
+
if (!c || !s || !D || !(t ? h : m))
|
|
85
|
+
return console.warn(`amount_input_modal_block: ${c ? x(n) ? D ? t ? "no low-balance profile for the account" : "user insight profile not set by the host" : `copy incomplete for "${n}"` : `unknown variant "${n}"` : "copy namespace missing"}`), /* @__PURE__ */ o(S, {
|
|
86
86
|
closeAriaLabel: e?.close_aria,
|
|
87
87
|
heading: e?.error_heading,
|
|
88
|
-
onClose:
|
|
89
|
-
children: /* @__PURE__ */ o(
|
|
88
|
+
onClose: l,
|
|
89
|
+
children: /* @__PURE__ */ o(H, { children: e?.error_message })
|
|
90
90
|
});
|
|
91
91
|
const L = () => {
|
|
92
|
-
|
|
93
|
-
}, b = !t && !!T, N = i.primary_account ? z(i.primary_account) : "",
|
|
94
|
-
if (!
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
const Y = t ? await
|
|
98
|
-
profileGuid:
|
|
99
|
-
threshold:
|
|
100
|
-
}, { analytics: d.EDIT_INSIGHT_THRESHOLD_SAVE }) : await
|
|
101
|
-
|
|
92
|
+
E(t ? d.EDIT_INSIGHT_THRESHOLD_CANCELED : d.EDIT_SAFETY_NET_CANCEL), l();
|
|
93
|
+
}, b = !t && !!T, N = i.primary_account ? z(i.primary_account) : "", I = ao(f), $ = f !== "" && !I, W = async () => {
|
|
94
|
+
if (!I || C) return;
|
|
95
|
+
const _ = Number(f);
|
|
96
|
+
v(!0), y(!1);
|
|
97
|
+
const Y = t ? await A("updateNotificationProfileThreshold", {
|
|
98
|
+
profileGuid: h?.guid,
|
|
99
|
+
threshold: _
|
|
100
|
+
}, { analytics: d.EDIT_INSIGHT_THRESHOLD_SAVE }) : await A("updateUserInsightProfile", { fields: { savings_opportunity_minimum_checking_account_balance: _ } }, { analytics: d.EDIT_SAFETY_NET_SAVE });
|
|
101
|
+
p.current && (v(!1), Y ? l() : y(!0));
|
|
102
102
|
};
|
|
103
103
|
return /* @__PURE__ */ o(Q, {
|
|
104
104
|
closeAriaLabel: e.close_aria,
|
|
105
|
-
content: j(b &&
|
|
106
|
-
errorText: $ ?
|
|
107
|
-
handleInputChange: (
|
|
108
|
-
M(
|
|
105
|
+
content: j(b && s.description_edit || s.description, /* @__PURE__ */ o("strong", { children: N }, "account")),
|
|
106
|
+
errorText: $ ? c.whole_number_error : U ? c.save_error : void 0,
|
|
107
|
+
handleInputChange: (_) => {
|
|
108
|
+
M(_), y(!1);
|
|
109
109
|
},
|
|
110
|
-
handleInputClick: t ? () =>
|
|
110
|
+
handleInputClick: t ? () => E(d.EDIT_INSIGHT_THRESHOLD_INPUT_SELECTED) : void 0,
|
|
111
111
|
handleModalClose: L,
|
|
112
112
|
handlePrimaryAction: () => {
|
|
113
113
|
W();
|
|
114
114
|
},
|
|
115
115
|
handleSecondaryAction: L,
|
|
116
|
-
inputLabel:
|
|
117
|
-
inputValue:
|
|
116
|
+
inputLabel: s.input_label,
|
|
117
|
+
inputValue: f,
|
|
118
118
|
isOpen: !0,
|
|
119
|
-
isPrimaryDisabled:
|
|
119
|
+
isPrimaryDisabled: C || !I,
|
|
120
120
|
primaryText: e.save_button,
|
|
121
121
|
secondaryText: t ? e.cancel_button : void 0,
|
|
122
122
|
subtitle: t && i.primary_account ? /* @__PURE__ */ O(k, {
|
|
@@ -129,14 +129,14 @@ var E = ({ children: y, closeAriaLabel: i, heading: n, onClose: e }) => {
|
|
|
129
129
|
alt: "",
|
|
130
130
|
institutionGuid: i.primary_account.institution_guid ?? "",
|
|
131
131
|
size: 16
|
|
132
|
-
}), /* @__PURE__ */ o(
|
|
132
|
+
}), /* @__PURE__ */ o(H, {
|
|
133
133
|
color: "text.secondary",
|
|
134
134
|
uppercase: !0,
|
|
135
135
|
variant: "body2",
|
|
136
136
|
children: N
|
|
137
137
|
})]
|
|
138
138
|
}) : void 0,
|
|
139
|
-
title: b &&
|
|
139
|
+
title: b && s.title_edit || s.title
|
|
140
140
|
});
|
|
141
141
|
});
|
|
142
142
|
export {
|