@mx-cartographer/experiences 9.7.163 → 9.7.165

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 (25) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js +34 -37
  3. package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js.map +1 -1
  4. package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js +40 -37
  5. package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js.map +1 -1
  6. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.d.ts +3 -1
  7. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js +54 -51
  8. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js.map +1 -1
  9. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/index.d.ts +1 -1
  10. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js +24 -27
  11. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js.map +1 -1
  12. package/dist/insights-v2/actionBlocks/PlaceholderActionBlock.es.js.map +1 -1
  13. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.d.ts +3 -1
  14. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js +49 -46
  15. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js.map +1 -1
  16. package/dist/insights-v2/actionBlocks/RemainingCashBlock/index.d.ts +1 -1
  17. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +2 -2
  18. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
  19. package/dist/insights-v2/actionBlocks/useAccountsLoadState.d.ts +3 -0
  20. package/dist/insights-v2/actionBlocks/useAccountsLoadState.es.js +7 -0
  21. package/dist/insights-v2/actionBlocks/useAccountsLoadState.es.js.map +1 -0
  22. package/dist/insights-v2/mappings/blocks.d.ts +6 -0
  23. package/dist/insights-v2/mappings/blocks.es.js +144 -136
  24. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  25. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [9.7.165] - 11-16-2026
2
+
3
+ - **CHANGED** - Insights 2.0 action block registry entries declare the data their block waits for; the shared runner shows the loader and the error card with Try Again instead of each block checking its own (WEC-2262)
4
+
5
+ ## [9.7.164] - 11-16-2026
6
+
7
+ - **FIXED** - Transaction History drawers without a chart (Low Account Balance): the transaction list starts right under the header, as in Figma (WEC-2320)
8
+
1
9
  ## [9.7.163] - 11-16-2026
2
10
 
3
11
  - **FIXED** - Monthly Spend to Income Comparison: the full card chart matches the Figma height (WEC-2329)
@@ -1,57 +1,54 @@
1
- import N from "../../../common/utils/AccountDisplayName.es.js";
2
- import { useAccountStore as O, useAppConfig as $, useCashflowStore as j, useGlobalCopyStore as z, useRecurringTransactionsStore as I } from "../../../common/context/hooks.es.js";
3
- import { getFrequencyLabel as H } from "../../../core/utils/RecurringTransactionsUtil.es.js";
1
+ import q from "../../../common/utils/AccountDisplayName.es.js";
2
+ import { useAccountStore as N, useAppConfig as O, useCashflowStore as $, useGlobalCopyStore as j, useRecurringTransactionsStore as z } from "../../../common/context/hooks.es.js";
3
+ import { getFrequencyLabel as I } from "../../../core/utils/RecurringTransactionsUtil.es.js";
4
4
  import h from "../../../common/components/drawer/Drawer.es.js";
5
- import J from "../../../common/components/Loader.es.js";
6
- import K from "../../components/CategoryTile.es.js";
7
- import { useOpenedCta as M } from "../useOpenedCta.es.js";
8
- import { useRequiredCopy as P } from "../useRequiredCopy.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 v, resolveBeatAccounts as Y, toAccountSection as G } from "./layout.es.js";
5
+ import H from "../../components/CategoryTile.es.js";
6
+ import { useOpenedCta as J } from "../useOpenedCta.es.js";
7
+ import { useRequiredCopy as K } from "../useRequiredCopy.es.js";
8
+ import { useRecurringExpensesLoadState as M } from "../RecurringTransactionBlock/useRecurringTransactionPrepare.es.js";
9
+ import { RecurringTransactionBlock as P } from "../RecurringTransactionBlock/RecurringTransactionBlock.es.js";
10
+ import { AccountDetailsBlock as Q } from "../AccountDetailsBlock/AccountDetailsBlock.es.js";
11
+ import U from "./AccountListContent.es.js";
12
+ import { buildSummary as V, isCheckingAccount as v, resolveBeatAccounts as W, toAccountSection as G } from "./layout.es.js";
14
13
  import { useState as T } from "react";
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 et = (l) => l.insights_feed?.account_list, _t = Z(function({ beat: e }) {
18
- const [n, m] = T(null), [s, p] = T(null), { accounts: d, recurring: r } = z(), { accountsLoaded: k, cashAccounts: L, visibleAccounts: g } = O(), S = M(e), { uiStore: b } = j(), { detailedRepeatingTransactions: R } = I(), { config: x } = $(), { failed: f, ready: y, retry: D } = Q(), c = P(et);
19
- if (!k) return /* @__PURE__ */ o(J, {});
20
- const A = Y(e, g, L), w = A.filter(v), B = A.filter((t) => !v(t)), a = x.display_available_balance_in_accounts, E = [G("checking", c.checking, w, a), G("savings", c.savings, B, a)].filter((t) => t.rows.length > 0), F = y ? [...b.expensesTilNextIncome].sort((t, i) => i.amount - t.amount).map((t) => {
21
- const i = g.find(({ guid: u }) => u === t.accountGuid), _ = R.find(({ guid: u }) => u === t.repeatingTransactionGuid);
14
+ import { observer as X } from "mobx-react-lite";
15
+ import { Fragment as Y, jsx as o, jsxs as Z } from "react/jsx-runtime";
16
+ var tt = (l) => l.insights_feed?.account_list, yt = X(function({ beat: e }) {
17
+ const [n, m] = T(null), [s, p] = T(null), { accounts: d, recurring: a } = j(), { cashAccounts: k, visibleAccounts: g } = N(), L = J(e), { uiStore: S } = $(), { detailedRepeatingTransactions: b } = z(), { config: R } = O(), { failed: f, ready: y, retry: x } = M(), c = K(tt), A = W(e, g, k), D = A.filter(v), w = A.filter((t) => !v(t)), r = R.display_available_balance_in_accounts, B = [G("checking", c.checking, D, r), G("savings", c.savings, w, r)].filter((t) => t.rows.length > 0), E = y ? [...S.expensesTilNextIncome].sort((t, i) => i.amount - t.amount).map((t) => {
18
+ const i = g.find(({ guid: u }) => u === t.accountGuid), _ = b.find(({ guid: u }) => u === t.repeatingTransactionGuid);
22
19
  return {
23
20
  account: {
24
21
  institutionGuid: t.institutionGuid,
25
- name: i ? N(i) : t.institutionName
22
+ name: i ? q(i) : t.institutionName
26
23
  },
27
24
  amount: t.amount,
28
- frequency: _ && H(r, _, !1),
25
+ frequency: _ && I(a, _, !1),
29
26
  key: `${t.repeatingTransactionGuid}-${t.expectedDate.getTime()}`,
30
- leading: /* @__PURE__ */ o(K, {
27
+ leading: /* @__PURE__ */ o(H, {
31
28
  categoryGuid: t.categoryGuid,
32
29
  size: 32
33
30
  }),
34
31
  name: t.name,
35
32
  onClick: () => m(t)
36
33
  };
37
- }) : [], C = () => m(null), q = () => p(null);
38
- return /* @__PURE__ */ ot(tt, { children: [
39
- /* @__PURE__ */ o(W, {
34
+ }) : [], C = () => m(null), F = () => p(null);
35
+ return /* @__PURE__ */ Z(Y, { children: [
36
+ /* @__PURE__ */ o(U, {
40
37
  copy: c,
41
- expenses: F,
38
+ expenses: E,
42
39
  expensesLoading: !y && !f,
43
40
  onAccountClick: p,
44
- onRetryExpenses: f ? D : void 0,
45
- sections: E,
46
- showAvailable: a,
47
- summary: X(S, c)
41
+ onRetryExpenses: f ? x : void 0,
42
+ sections: B,
43
+ showAvailable: r,
44
+ summary: V(L, c)
48
45
  }),
49
46
  /* @__PURE__ */ o(h, {
50
- ariaLabelClose: r.close_drawer_aria,
47
+ ariaLabelClose: a.close_drawer_aria,
51
48
  isOpen: n !== null,
52
49
  onClose: C,
53
- title: r.expense_details,
54
- children: n && /* @__PURE__ */ o(U, {
50
+ title: a.expense_details,
51
+ children: n && /* @__PURE__ */ o(P, {
55
52
  beat: e,
56
53
  layout: "insights",
57
54
  onDeleted: C,
@@ -62,9 +59,9 @@ var et = (l) => l.insights_feed?.account_list, _t = Z(function({ beat: e }) {
62
59
  /* @__PURE__ */ o(h, {
63
60
  ariaLabelClose: d?.close_account_details_aria,
64
61
  isOpen: s !== null,
65
- onClose: q,
62
+ onClose: F,
66
63
  title: d?.account_details,
67
- children: s && /* @__PURE__ */ o(V, { beat: {
64
+ children: s && /* @__PURE__ */ o(Q, { beat: {
68
65
  ...e,
69
66
  primary_account: void 0,
70
67
  primary_account_guid: s
@@ -73,8 +70,8 @@ var et = (l) => l.insights_feed?.account_list, _t = Z(function({ beat: e }) {
73
70
  ] });
74
71
  });
75
72
  export {
76
- _t as AccountListBlock,
77
- et as selectAccountListCopy
73
+ yt as AccountListBlock,
74
+ tt as selectAccountListCopy
78
75
  };
79
76
 
80
77
  //# 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 { 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 { GlobalCopy, 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 {\n RecurringTransactionBlock,\n useRecurringExpensesLoadState,\n} from '../RecurringTransactionBlock'\nimport { useOpenedCta } from '../useOpenedCta'\nimport { useRequiredCopy } from '../useRequiredCopy'\n\nimport AccountListContent, { type ExpenseRow } from './AccountListContent'\nimport { buildSummary, isCheckingAccount, resolveBeatAccounts, toAccountSection } from './layout'\n\nexport const selectAccountListCopy = (copy: GlobalCopy) => copy.insights_feed?.account_list\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 { accounts: accountsCopy, recurring: recurringCopy } = 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 = useRequiredCopy(selectAccountListCopy)\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":";;;;;;;;;;;;;;;;AA6BA,IAAa,KAAA,CAAyB,MAAqB,EAAK,eAAe,cAOlE,KAAmB,E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G;AAAA,QAAM,iBAAiB;AAAA,QAAW,sBAAsB;AAAA,MAAkB,EACtF,CAAA;AAAA,IAEG,CAAA;AAAA,EACR,EAAA,CAAA;AAEN,CAAC"}
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 useAccountStore,\n useAppConfig,\n useCashflowStore,\n useGlobalCopyStore,\n useRecurringTransactionsStore,\n} from '../../../common'\nimport getAccountDisplayName from '../../../common/utils/AccountDisplayName'\nimport type { GlobalCopy, 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 {\n RecurringTransactionBlock,\n useRecurringExpensesLoadState,\n} from '../RecurringTransactionBlock'\nimport { useOpenedCta } from '../useOpenedCta'\nimport { useRequiredCopy } from '../useRequiredCopy'\n\nimport AccountListContent, { type ExpenseRow } from './AccountListContent'\nimport { buildSummary, isCheckingAccount, resolveBeatAccounts, toAccountSection } from './layout'\n\nexport const selectAccountListCopy = (copy: GlobalCopy) => copy.insights_feed?.account_list\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 { accounts: accountsCopy, recurring: recurringCopy } = useGlobalCopyStore()\n const { 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 = useRequiredCopy(selectAccountListCopy)\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":";;;;;;;;;;;;;;;AA4BA,IAAa,KAAA,CAAyB,MAAqB,EAAK,eAAe,cAOlE,KAAmB,EAAS,SAA0B,EAAE,MAAA,EAAA,GAA0B;AAC7F,QAAM,CAAC,GAAe,CAAA,IAAoB,EAA4B,IAAI,GACpE,CAAC,GAAmB,CAAA,IAAwB,EAAwB,IAAI,GACxE,EAAE,UAAU,GAAc,WAAW,EAAA,IAAkB,EAAmB,GAC1E,EAAE,cAAA,GAAc,iBAAA,EAAA,IAAoB,EAAgB,GACpD,IAAM,EAAa,CAAI,GACvB,EAAE,SAAA,EAAA,IAAY,EAAiB,GAC/B,EAAE,+BAAA,EAAA,IAAkC,EAA8B,GAClE,EAAE,QAAA,EAAA,IAAW,EAAa,GAC1B,EAAE,QAAQ,GAAgB,OAAO,GAAe,OAAA,EAAA,IAAU,EAA8B,GACxF,IAAO,EAAgB,EAAqB,GAE5C,IAAS,EAAoB,GAAM,GAAiB,CAAY,GAChE,IAAW,EAAO,OAAO,CAAiB,GAC1C,IAAU,EAAO,OAAA,CAAQ,MAAY,CAAC,EAAkB,CAAO,CAAC,GAChE,IAAgB,EAAO,uCACvB,IAAW,CACf,EAAiB,YAAY,EAAK,UAAU,GAAU,CAAa,GACnE,EAAiB,WAAW,EAAK,SAAS,GAAS,CAAa,CAClE,EAAE,OAAA,CAAQ,MAAY,EAAQ,KAAK,SAAS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,EAAc;AAAA,MAEpB,UAAA,KACC,gBAAA,EAAC,GAAD;AAAA,QACQ,MAAA;AAAA,QACN,QAAO;AAAA,QACP,WAAW;AAAA,QACX,0BAA0B,EAAc;AAAA,QACxC,oBAAoB;AAAA,MACrB,CAAA;AAAA,IAEG,CAAA;AAAA,IACR,gBAAA,EAAC,GAAD;AAAA,MACE,gBAAgB,GAAc;AAAA,MAC9B,QAAQ,MAAsB;AAAA,MAC9B,SAAS;AAAA,MACT,OAAO,GAAc;AAAA,MAEpB,UAAA,KAEC,gBAAA,EAAC,GAAD,EACE,MAAM;AAAA,QAAE,GAAG;AAAA,QAAM,iBAAiB;AAAA,QAAW,sBAAsB;AAAA,MAAkB,EACtF,CAAA;AAAA,IAEG,CAAA;AAAA,EACR,EAAA,CAAA;AAEN,CAAC"}
@@ -1,55 +1,58 @@
1
- import { useGlobalCopyStore as w, useGlobalStore as L, useGlobalUiStore as x, useInsightsV2Store as D } from "../../common/context/hooks.es.js";
1
+ import { useGlobalCopyStore as D, useGlobalStore as E, useGlobalUiStore as R, useInsightsV2Store as x } from "../../common/context/hooks.es.js";
2
2
  import O from "../../common/components/drawer/Drawer.es.js";
3
- import E from "../../common/components/ErrorBoundary.es.js";
4
- import G from "../../common/components/Loader.es.js";
5
- import { BlockErrorMessage as k } from "./BlockErrorMessage.es.js";
3
+ import G from "../../common/components/ErrorBoundary.es.js";
4
+ import B from "../../common/components/Loader.es.js";
5
+ import { BlockErrorMessage as v } from "./BlockErrorMessage.es.js";
6
6
  import { hasDrawerBlock as _ } from "../mappings/hasDrawerBlock.es.js";
7
7
  import j from "../components/shared/StatusSnackbar.es.js";
8
8
  import { useOpenedCta as F } from "./useOpenedCta.es.js";
9
- import { actionBlocks as M } from "../mappings/blocks.es.js";
10
- import { useRef as N } from "react";
11
- import { observer as R } from "mobx-react-lite";
9
+ import { ErrorCard as M } from "../components/ErrorCard.es.js";
10
+ import { actionBlocks as N } from "../mappings/blocks.es.js";
11
+ import { useRef as T } from "react";
12
+ import { observer as h } from "mobx-react-lite";
12
13
  import { Fragment as C, jsx as e, jsxs as g } from "react/jsx-runtime";
13
- var T = (i, o) => {
14
- const r = N(void 0);
15
- return i ? (r.current ??= o, r.current) : (r.current = void 0, o);
16
- }, v = ({ actionBlock: i, ...o }) => {
17
- const { Component: r, usePrepare: s } = i;
18
- return s(o), /* @__PURE__ */ e(r, { ...o });
19
- }, X = R(function({ beat: o }) {
20
- const r = w(), { captureException: s } = L(), u = r.common, m = u?.close_aria ?? "Close", { isCopyLoaded: y } = x(), { actionDrawer: p, actionNotice: h, closeActionDrawer: B, setActionNotice: A } = D(), c = p.isDrawerOpen && p.guid === o.guid, t = T(c, F(o));
14
+ var V = (l, o) => {
15
+ const r = T(void 0);
16
+ return l ? (r.current ??= o, r.current) : (r.current = void 0, o);
17
+ }, I = { ready: !0 }, U = () => I, A = h(function({ actionBlock: o, ...r }) {
18
+ const { Component: u, useLoadState: i = U, usePrepare: c } = o;
19
+ c(r);
20
+ const { failed: m, ready: a, retry: p } = i(r);
21
+ return m ? /* @__PURE__ */ e(M, { onRetry: p }) : a ? /* @__PURE__ */ e(u, { ...r }) : /* @__PURE__ */ e(B, {});
22
+ }), ro = h(function({ beat: o }) {
23
+ const r = D(), { captureException: u } = E(), i = r.common, c = i?.close_aria ?? "Close", { isCopyLoaded: m } = R(), { actionDrawer: a, actionNotice: p, closeActionDrawer: S, setActionNotice: b } = x(), s = a.isDrawerOpen && a.guid === o.guid, t = V(s, F(o));
21
24
  if (!o.insights_payload) return null;
22
- if (!y) return c ? /* @__PURE__ */ e(G, {}) : null;
23
- const a = h[o.guid], d = /* @__PURE__ */ e(j, {
24
- closeAriaLabel: m,
25
- message: a?.message ?? "",
26
- onClose: () => A(o.guid, void 0),
27
- open: !!a,
28
- severity: a?.severity
29
- }), l = _(t?.block), n = l ? M[t?.block] : void 0;
30
- if (n?.presentation === "modal") return /* @__PURE__ */ g(C, { children: [c && /* @__PURE__ */ e(v, {
25
+ if (!m) return s ? /* @__PURE__ */ e(B, {}) : null;
26
+ const d = p[o.guid], y = /* @__PURE__ */ e(j, {
27
+ closeAriaLabel: c,
28
+ message: d?.message ?? "",
29
+ onClose: () => b(o.guid, void 0),
30
+ open: !!d,
31
+ severity: d?.severity
32
+ }), f = _(t?.block), n = f ? N[t?.block] : void 0;
33
+ if (n?.presentation === "modal") return /* @__PURE__ */ g(C, { children: [s && /* @__PURE__ */ e(A, {
31
34
  actionBlock: n,
32
35
  beat: o
33
- }, t?.block), d] });
34
- const f = n && (n.copy === void 0 || n.copy(r) != null), b = n?.title?.(t?.variant, r, o), S = f ? b || t?.label || "" : l ? u?.error_heading ?? "Oops" : t?.label ?? "";
36
+ }, t?.block), y] });
37
+ const k = n && (n.copy === void 0 || n.copy(r) != null), L = n?.title?.(t?.variant, r, o), w = k ? L || t?.label || "" : f ? i?.error_heading ?? "Oops" : t?.label ?? "";
35
38
  return /* @__PURE__ */ g(C, { children: [/* @__PURE__ */ e(O, {
36
- ariaLabelClose: m,
39
+ ariaLabelClose: c,
37
40
  headerAction: n?.headerAction,
38
- isOpen: c,
39
- onClose: B,
40
- title: S,
41
- children: f ? /* @__PURE__ */ e(E, {
42
- fallback: /* @__PURE__ */ e(k, {}),
43
- onCaptureException: s,
44
- children: /* @__PURE__ */ e(v, {
41
+ isOpen: s,
42
+ onClose: S,
43
+ title: w,
44
+ children: k ? /* @__PURE__ */ e(G, {
45
+ fallback: /* @__PURE__ */ e(v, {}),
46
+ onCaptureException: u,
47
+ children: /* @__PURE__ */ e(A, {
45
48
  actionBlock: n,
46
49
  beat: o
47
50
  })
48
- }, t?.block) : l ? /* @__PURE__ */ e(k, {}) : null
49
- }), d] });
51
+ }, t?.block) : f ? /* @__PURE__ */ e(v, {}) : null
52
+ }), y] });
50
53
  });
51
54
  export {
52
- X as ActionBlockLayer
55
+ ro as ActionBlockLayer
53
56
  };
54
57
 
55
58
  //# 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 { observer } from 'mobx-react-lite'\n\nimport {\n Drawer,\n ErrorBoundary,\n Loader,\n useGlobalCopyStore,\n useGlobalStore,\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 it (or its wrapper) 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 { captureException } = useGlobalStore()\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 canMount = actionBlock && (actionBlock.copy === undefined || actionBlock.copy(copy) != null)\n const resolvedTitle = actionBlock?.title?.(currentCta?.variant, copy, beat)\n const drawerTitle = canMount\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 {canMount ? (\n // A block that throws (e.g. its entry declares no `copy`) fails inside the drawer.\n <ErrorBoundary\n fallback={<BlockErrorMessage />}\n key={currentCta?.block}\n onCaptureException={captureException}\n >\n <ActionBlockRunner actionBlock={actionBlock} beat={beat} />\n </ErrorBoundary>\n ) : blockValid ? (\n <BlockErrorMessage />\n ) : null}\n </Drawer>\n {noticeSnackbar}\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;;AA8BA,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,EAAE,kBAAA,EAAA,IAAqB,EAAe,GACtC,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,IAAW,MAAgB,EAAY,SAAS,UAAa,EAAY,KAAK,CAAI,KAAK,OACvF,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,IAEC,gBAAA,EAAC,GAAD;AAAA,MACE,UAAU,gBAAA,EAAC,GAAD,CAAoB,CAAA;AAAA,MAE9B,oBAAoB;AAAA,MAEpB,UAAA,gBAAA,EAAC,GAAD;AAAA,QAAgC,aAAA;AAAA,QAAmB,MAAA;AAAA,MAAO,CAAA;AAAA,IAC7C,GAJR,GAAY,KAIJ,IACb,IACF,gBAAA,EAAC,GAAD,CAAoB,CAAA,IAClB;AAAA,EACE,CAAA,GACP,CACD,EAAA,CAAA;AAEN,CAAC"}
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 ErrorBoundary,\n Loader,\n useGlobalCopyStore,\n useGlobalStore,\n useGlobalUiStore,\n useInsightsV2Store,\n} from '../../common'\nimport type { Beat } from '../../core'\nimport {\n actionBlocks,\n hasDrawerBlock,\n type ActionBlockEntry,\n type ActionBlockProps,\n type BlockLoadState,\n} from '../mappings/blocks'\nimport { ErrorCard } from '../components/ErrorCard'\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\nconst READY: BlockLoadState = { ready: true }\nconst useReady = () => READY\n\n/**\n * Renders a registered action block once its data is in. Callers MUST key it (or its wrapper) per\n * block name — blocks run different hooks, so reusing the same fiber across a block switch\n * violates the rules of hooks.\n */\nconst ActionBlockRunner = observer(function ActionBlockRunner({\n actionBlock,\n ...blockProps\n}: ActionBlockProps & { actionBlock: ActionBlockEntry }) {\n const { Component, useLoadState = useReady, usePrepare } = actionBlock\n\n usePrepare(blockProps)\n const { failed, ready, retry } = useLoadState(blockProps)\n\n if (failed) return <ErrorCard onRetry={retry} />\n if (!ready) return <Loader />\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 { captureException } = useGlobalStore()\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 canMount = actionBlock && (actionBlock.copy === undefined || actionBlock.copy(copy) != null)\n const resolvedTitle = actionBlock?.title?.(currentCta?.variant, copy, beat)\n const drawerTitle = canMount\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 {canMount ? (\n // A block that throws (e.g. its entry declares no `copy`) fails inside the drawer.\n <ErrorBoundary\n fallback={<BlockErrorMessage />}\n key={currentCta?.block}\n onCaptureException={captureException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
1
1
  import { GlobalCopy, PayoffCalculatorCopy } from '../../../core';
2
- import { ActionBlockProps } from '../../mappings/blocks';
2
+ import { ActionBlockProps, BlockLoadState } from '../../mappings/blocks';
3
3
  /** Loads accounts once per open when the host did not attach the beat's primary account. */
4
4
  export declare const usePayoffCalculatorPrepare: ({ beat }: ActionBlockProps) => void;
5
+ /** Ready at once when the host attached the beat's account, else once the accounts load. */
6
+ export declare const usePayoffCalculatorLoadState: ({ beat }: ActionBlockProps) => BlockLoadState;
5
7
  export declare const selectPayoffCalculatorCopy: (copy: GlobalCopy) => PayoffCalculatorCopy | undefined;
6
8
  /**
7
9
  * Monthly Credit Card Interest Summary's "Learn how to save" drawer: the credit card payoff
@@ -1,51 +1,53 @@
1
1
  import _ from "../../../common/utils/AccountDisplayName.es.js";
2
- import { useAccountStore as x } from "../../../common/context/hooks.es.js";
3
- import A from "../../../common/components/Loader.es.js";
2
+ import { useAccountStore as d } from "../../../common/context/hooks.es.js";
4
3
  import { useRequiredCopy as S } from "../useRequiredCopy.es.js";
5
- import { isPayoffPossible as w } from "./payoff.es.js";
6
- import { buildPayoffRows as R, initialPayoffInputs as k, parsePayoffInputs as D, resolvePrimaryAccount as F, validatePayoffInputs as L } from "./layout.es.js";
7
- import { CalculationFailed as $, PayoffResults as j } from "./PayoffResults.es.js";
4
+ import { isPayoffPossible as A } from "./payoff.es.js";
5
+ import { buildPayoffRows as w, initialPayoffInputs as R, parsePayoffInputs as k, resolvePrimaryAccount as D, validatePayoffInputs as F } from "./layout.es.js";
6
+ import { CalculationFailed as L, PayoffResults as $ } from "./PayoffResults.es.js";
8
7
  import l from "react";
9
- import { observer as B } from "mobx-react-lite";
8
+ import { observer as j } from "mobx-react-lite";
10
9
  import c from "@mui/material/Stack";
11
- import { InstitutionLogo as E, Text as b, TextField as T } from "@mxenabled/mxui";
12
- import N from "@mui/material/Button";
13
- import { jsx as o, jsxs as u } from "react/jsx-runtime";
14
- import O from "@mui/material/InputAdornment";
15
- var et = ({ beat: e }) => {
16
- const { accountsLoaded: t, loadAccounts: s } = x();
10
+ import { InstitutionLogo as B, Text as b, TextField as E } from "@mxenabled/mxui";
11
+ import T from "@mui/material/Button";
12
+ import { jsx as r, jsxs as u } from "react/jsx-runtime";
13
+ import N from "@mui/material/InputAdornment";
14
+ var tt = ({ beat: o }) => {
15
+ const { accountsLoaded: t, loadAccounts: i } = d();
17
16
  l.useEffect(() => {
18
- !e.primary_account && !t && s();
17
+ !o.primary_account && !t && i();
19
18
  }, []);
20
- }, W = ({ account: e, copy: t }) => {
21
- const s = l.useId(), [n, m] = l.useState(() => k(e)), [p, v] = l.useState({}), [f, g] = l.useState({ status: "idle" }), y = e ? _(e) : "", C = (r) => (a) => m((i) => ({
22
- ...i,
23
- [r]: a.target.value
24
- })), I = (r) => {
25
- r.preventDefault();
26
- const a = L(n, t);
27
- if (v(a), Object.keys(a).length > 0) return;
28
- const { balance: i, interestRate: h, monthlyPayment: P } = D(n);
29
- g(w(h, i, P) ? {
19
+ }, ot = ({ beat: o }) => {
20
+ const { accountsLoaded: t } = d();
21
+ return { ready: !!o.primary_account || t };
22
+ }, O = ({ account: o, copy: t }) => {
23
+ const i = l.useId(), [n, x] = l.useState(() => R(o)), [p, v] = l.useState({}), [f, g] = l.useState({ status: "idle" }), y = o ? _(o) : "", C = (e) => (s) => x((a) => ({
24
+ ...a,
25
+ [e]: s.target.value
26
+ })), I = (e) => {
27
+ e.preventDefault();
28
+ const s = F(n, t);
29
+ if (v(s), Object.keys(s).length > 0) return;
30
+ const { balance: a, interestRate: h, monthlyPayment: P } = k(n);
31
+ g(A(h, a, P) ? {
30
32
  status: "calculated",
31
- rows: R(h, i, P)
33
+ rows: w(h, a, P)
32
34
  } : { status: "failed" });
33
- }, d = (r, a, i) => /* @__PURE__ */ o(T, {
34
- error: !!p[r],
35
+ }, m = (e, s, a) => /* @__PURE__ */ r(E, {
36
+ error: !!p[e],
35
37
  fullWidth: !0,
36
- helperText: p[r],
37
- id: `${s}-${r}`,
38
- label: a,
39
- onChange: C(r),
38
+ helperText: p[e],
39
+ id: `${i}-${e}`,
40
+ label: s,
41
+ onChange: C(e),
40
42
  slotProps: {
41
43
  htmlInput: { inputMode: "decimal" },
42
- input: { [i.position === "start" ? "startAdornment" : "endAdornment"]: /* @__PURE__ */ o(O, {
44
+ input: { [a.position === "start" ? "startAdornment" : "endAdornment"]: /* @__PURE__ */ r(N, {
43
45
  "aria-hidden": "true",
44
- position: i.position,
45
- children: i.symbol
46
+ position: a.position,
47
+ children: a.symbol
46
48
  }) }
47
49
  },
48
- value: n[r]
50
+ value: n[e]
49
51
  });
50
52
  return /* @__PURE__ */ u(c, {
51
53
  component: "form",
@@ -59,17 +61,17 @@ var et = ({ beat: e }) => {
59
61
  flexDirection: "row",
60
62
  gap: 8
61
63
  },
62
- children: [/* @__PURE__ */ o(E, {
64
+ children: [/* @__PURE__ */ r(B, {
63
65
  alt: "",
64
- institutionGuid: e?.institution_guid ?? "",
66
+ institutionGuid: o?.institution_guid ?? "",
65
67
  size: 24
66
- }), /* @__PURE__ */ o(b, {
68
+ }), /* @__PURE__ */ r(b, {
67
69
  component: "p",
68
70
  variant: "body2",
69
71
  children: y
70
72
  })]
71
73
  }),
72
- /* @__PURE__ */ o(b, {
74
+ /* @__PURE__ */ r(b, {
73
75
  color: "text.secondary",
74
76
  component: "p",
75
77
  sx: { mt: 16 },
@@ -82,7 +84,7 @@ var et = ({ beat: e }) => {
82
84
  pb: 24,
83
85
  pt: 32
84
86
  },
85
- children: [d("balance", t.credit_card_balance, {
87
+ children: [m("balance", t.credit_card_balance, {
86
88
  position: "start",
87
89
  symbol: "$"
88
90
  }), /* @__PURE__ */ u(c, {
@@ -90,16 +92,16 @@ var et = ({ beat: e }) => {
90
92
  flexDirection: "row",
91
93
  gap: 16
92
94
  },
93
- children: [d("interestRate", t.interest_rate, {
95
+ children: [m("interestRate", t.interest_rate, {
94
96
  position: "end",
95
97
  symbol: "%"
96
- }), d("monthlyPayment", t.monthly_payment, {
98
+ }), m("monthlyPayment", t.monthly_payment, {
97
99
  position: "start",
98
100
  symbol: "$"
99
101
  })]
100
102
  })]
101
103
  }),
102
- /* @__PURE__ */ o(N, {
104
+ /* @__PURE__ */ r(T, {
103
105
  fullWidth: !0,
104
106
  sx: {
105
107
  mb: 24,
@@ -109,23 +111,24 @@ var et = ({ beat: e }) => {
109
111
  variant: "contained",
110
112
  children: t.calculate
111
113
  }),
112
- f.status === "failed" ? /* @__PURE__ */ o($, { copy: t }) : /* @__PURE__ */ o(j, {
114
+ f.status === "failed" ? /* @__PURE__ */ r(L, { copy: t }) : /* @__PURE__ */ r($, {
113
115
  copy: t,
114
116
  rows: f.status === "calculated" ? f.rows : void 0
115
117
  })
116
118
  ]
117
119
  });
118
- }, q = (e) => e.insights_feed?.payoff_calculator, rt = B(function({ beat: t }) {
119
- const { accounts: s, accountsLoaded: n } = x(), m = S(q);
120
- return !t.primary_account && !n ? /* @__PURE__ */ o(A, {}) : /* @__PURE__ */ o(W, {
121
- account: F(t, s),
122
- copy: m
120
+ }, W = (o) => o.insights_feed?.payoff_calculator, et = j(function({ beat: t }) {
121
+ const { accounts: i } = d(), n = S(W);
122
+ return /* @__PURE__ */ r(O, {
123
+ account: D(t, i),
124
+ copy: n
123
125
  }, t.guid);
124
126
  });
125
127
  export {
126
- rt as PayoffCalculatorBlock,
127
- q as selectPayoffCalculatorCopy,
128
- et as usePayoffCalculatorPrepare
128
+ et as PayoffCalculatorBlock,
129
+ W as selectPayoffCalculatorCopy,
130
+ ot as usePayoffCalculatorLoadState,
131
+ tt as usePayoffCalculatorPrepare
129
132
  };
130
133
 
131
134
  //# sourceMappingURL=PayoffCalculatorBlock.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PayoffCalculatorBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport Button from '@mui/material/Button'\nimport InputAdornment from '@mui/material/InputAdornment'\nimport Stack from '@mui/material/Stack'\n\nimport { InstitutionLogo, Text, TextField } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport { Loader, useAccountStore } from '../../../common'\nimport getAccountDisplayName from '../../../common/utils/AccountDisplayName'\nimport type { Account, GlobalCopy, PayoffCalculatorCopy } from '../../../core'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { useRequiredCopy } from '../useRequiredCopy'\n\nimport {\n buildPayoffRows,\n initialPayoffInputs,\n parsePayoffInputs,\n resolvePrimaryAccount,\n validatePayoffInputs,\n type PayoffErrors,\n type PayoffField,\n type PayoffInputs,\n type PayoffRow,\n} from './layout'\nimport { isPayoffPossible } from './payoff'\nimport { CalculationFailed, PayoffResults } from './PayoffResults'\n\n/** Loads accounts once per open when the host did not attach the beat's primary account. */\nexport const usePayoffCalculatorPrepare = ({ beat }: ActionBlockProps) => {\n const { accountsLoaded, loadAccounts } = useAccountStore()\n\n React.useEffect(() => {\n if (!beat.primary_account && !accountsLoaded) void loadAccounts()\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n}\n\ntype Outcome =\n | { status: 'idle' }\n | { status: 'calculated'; rows: PayoffRow[] }\n | { status: 'failed' }\n\ninterface PayoffCalculatorFormProps {\n account?: Account\n copy: PayoffCalculatorCopy\n}\n\nconst PayoffCalculatorForm = ({ account, copy }: PayoffCalculatorFormProps) => {\n const id = React.useId()\n const [inputs, setInputs] = React.useState<PayoffInputs>(() => initialPayoffInputs(account))\n const [errors, setErrors] = React.useState<PayoffErrors>({})\n const [outcome, setOutcome] = React.useState<Outcome>({ status: 'idle' })\n\n const accountName = account ? getAccountDisplayName(account) : ''\n\n const setField = (field: PayoffField) => (event: React.ChangeEvent<HTMLInputElement>) =>\n setInputs((previous) => ({ ...previous, [field]: event.target.value }))\n\n const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault()\n\n const nextErrors = validatePayoffInputs(inputs, copy)\n\n setErrors(nextErrors)\n if (Object.keys(nextErrors).length > 0) return\n\n const { balance, interestRate, monthlyPayment } = parsePayoffInputs(inputs)\n\n setOutcome(\n isPayoffPossible(interestRate, balance, monthlyPayment)\n ? { status: 'calculated', rows: buildPayoffRows(interestRate, balance, monthlyPayment) }\n : { status: 'failed' },\n )\n }\n\n const field = (\n name: PayoffField,\n label: string,\n adornment: { position: 'start' | 'end'; symbol: string },\n ) => (\n <TextField\n error={!!errors[name]}\n fullWidth={true}\n helperText={errors[name]}\n id={`${id}-${name}`}\n label={label}\n onChange={setField(name)}\n slotProps={{\n htmlInput: { inputMode: 'decimal' },\n input: {\n [adornment.position === 'start' ? 'startAdornment' : 'endAdornment']: (\n <InputAdornment aria-hidden=\"true\" position={adornment.position}>\n {adornment.symbol}\n </InputAdornment>\n ),\n },\n }}\n value={inputs[name]}\n />\n )\n\n return (\n <Stack component=\"form\" noValidate={true} onSubmit={handleSubmit} sx={{ p: 16 }}>\n {accountName && (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 8 }}>\n <InstitutionLogo alt=\"\" institutionGuid={account?.institution_guid ?? ''} size={24} />\n <Text component=\"p\" variant=\"body2\">\n {accountName}\n </Text>\n </Stack>\n )}\n <Text color=\"text.secondary\" component=\"p\" sx={{ mt: 16 }} variant=\"body2\">\n {copy.description}\n </Text>\n <Stack sx={{ gap: 24, pb: 24, pt: 32 }}>\n {field('balance', copy.credit_card_balance, { position: 'start', symbol: '$' })}\n <Stack sx={{ flexDirection: 'row', gap: 16 }}>\n {field('interestRate', copy.interest_rate, { position: 'end', symbol: '%' })}\n {field('monthlyPayment', copy.monthly_payment, { position: 'start', symbol: '$' })}\n </Stack>\n </Stack>\n <Button fullWidth={true} sx={{ mb: 24, mt: 8 }} type=\"submit\" variant=\"contained\">\n {copy.calculate}\n </Button>\n {outcome.status === 'failed' ? (\n <CalculationFailed copy={copy} />\n ) : (\n <PayoffResults\n copy={copy}\n rows={outcome.status === 'calculated' ? outcome.rows : undefined}\n />\n )}\n </Stack>\n )\n}\n\nexport const selectPayoffCalculatorCopy = (copy: GlobalCopy) =>\n copy.insights_feed?.payoff_calculator\n\n/**\n * Monthly Credit Card Interest Summary's \"Learn how to save\" drawer: the credit card payoff\n * calculator. The beat's account prefills the balance, interest rate and minimum payment; the\n * user edits them and compares the payoff at that payment, $10 more and $20 more.\n */\nexport const PayoffCalculatorBlock = observer(function PayoffCalculatorBlock({\n beat,\n}: ActionBlockProps) {\n const { accounts, accountsLoaded } = useAccountStore()\n const copy = useRequiredCopy(selectPayoffCalculatorCopy)\n\n if (!beat.primary_account && !accountsLoaded) return <Loader />\n\n return (\n <PayoffCalculatorForm\n account={resolvePrimaryAccount(beat, accounts)}\n copy={copy}\n key={beat.guid}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;;AA8BA,IAAa,KAAA,CAA8B,EAAE,MAAA,EAAA,MAA6B;AACxE,QAAM,EAAE,gBAAA,GAAgB,cAAA,EAAA,IAAiB,EAAgB;AAEzD,EAAA,EAAM,UAAA,MAAgB;AACpB,IAAI,CAAC,EAAK,mBAAmB,CAAC,KAAgB,EAAkB;AAAA,EAElE,GAAG,CAAC,CAAC;AACP,GAYM,IAAA,CAAwB,EAAE,SAAA,GAAS,MAAA,EAAA,MAAsC;AAC7E,QAAM,IAAK,EAAM,MAAM,GACjB,CAAC,GAAQ,CAAA,IAAa,EAAM,SAAA,MAA6B,EAAoB,CAAO,CAAC,GACrF,CAAC,GAAQ,CAAA,IAAa,EAAM,SAAuB,CAAC,CAAC,GACrD,CAAC,GAAS,CAAA,IAAc,EAAM,SAAkB,EAAE,QAAQ,OAAO,CAAC,GAElE,IAAc,IAAU,EAAsB,CAAO,IAAI,IAEzD,IAAA,CAAY,MAAA,CAAwB,MACxC,EAAA,CAAW,OAAc;AAAA,IAAE,GAAG;AAAA,IAAW,CAAA,CAAA,GAAQ,EAAM,OAAO;AAAA,EAAM,EAAE,GAElE,IAAA,CAAgB,MAA4C;AAChE,IAAA,EAAM,eAAe;AAErB,UA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AAA,CAA8B,MACzC,EAAK,eAAe,mBAOT,KAAwB,EAAS,SAA+B,EAC3E,MAAA,EAAA,GACmB;AACnB,QAAM,EAAE,UAAA,GAAU,gBAAA,EAAA,IAAmB,EAAgB,GAC/C,IAAO,EAAgB,CAA0B;AAEvD,SAAI,CAAC,EAAK,mBAAmB,CAAC,IAAuB,gBAAA,EAAC,GAAD,CAAS,CAAA,IAG5D,gBAAA,EAAC,GAAD;AAAA,IACE,SAAS,EAAsB,GAAM,CAAQ;AAAA,IACvC,MAAA;AAAA,EAEP,GADM,EAAK,IACX;AAEL,CAAC"}
1
+ {"version":3,"file":"PayoffCalculatorBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport Button from '@mui/material/Button'\nimport InputAdornment from '@mui/material/InputAdornment'\nimport Stack from '@mui/material/Stack'\n\nimport { InstitutionLogo, Text, TextField } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport { useAccountStore } from '../../../common'\nimport getAccountDisplayName from '../../../common/utils/AccountDisplayName'\nimport type { Account, GlobalCopy, PayoffCalculatorCopy } from '../../../core'\nimport type { ActionBlockProps, BlockLoadState } from '../../mappings/blocks'\nimport { useRequiredCopy } from '../useRequiredCopy'\n\nimport {\n buildPayoffRows,\n initialPayoffInputs,\n parsePayoffInputs,\n resolvePrimaryAccount,\n validatePayoffInputs,\n type PayoffErrors,\n type PayoffField,\n type PayoffInputs,\n type PayoffRow,\n} from './layout'\nimport { isPayoffPossible } from './payoff'\nimport { CalculationFailed, PayoffResults } from './PayoffResults'\n\n/** Loads accounts once per open when the host did not attach the beat's primary account. */\nexport const usePayoffCalculatorPrepare = ({ beat }: ActionBlockProps) => {\n const { accountsLoaded, loadAccounts } = useAccountStore()\n\n React.useEffect(() => {\n if (!beat.primary_account && !accountsLoaded) void loadAccounts()\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n}\n\n/** Ready at once when the host attached the beat's account, else once the accounts load. */\nexport const usePayoffCalculatorLoadState = ({ beat }: ActionBlockProps): BlockLoadState => {\n const { accountsLoaded } = useAccountStore()\n\n return { ready: !!beat.primary_account || accountsLoaded }\n}\n\ntype Outcome =\n | { status: 'idle' }\n | { status: 'calculated'; rows: PayoffRow[] }\n | { status: 'failed' }\n\ninterface PayoffCalculatorFormProps {\n account?: Account\n copy: PayoffCalculatorCopy\n}\n\nconst PayoffCalculatorForm = ({ account, copy }: PayoffCalculatorFormProps) => {\n const id = React.useId()\n const [inputs, setInputs] = React.useState<PayoffInputs>(() => initialPayoffInputs(account))\n const [errors, setErrors] = React.useState<PayoffErrors>({})\n const [outcome, setOutcome] = React.useState<Outcome>({ status: 'idle' })\n\n const accountName = account ? getAccountDisplayName(account) : ''\n\n const setField = (field: PayoffField) => (event: React.ChangeEvent<HTMLInputElement>) =>\n setInputs((previous) => ({ ...previous, [field]: event.target.value }))\n\n const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault()\n\n const nextErrors = validatePayoffInputs(inputs, copy)\n\n setErrors(nextErrors)\n if (Object.keys(nextErrors).length > 0) return\n\n const { balance, interestRate, monthlyPayment } = parsePayoffInputs(inputs)\n\n setOutcome(\n isPayoffPossible(interestRate, balance, monthlyPayment)\n ? { status: 'calculated', rows: buildPayoffRows(interestRate, balance, monthlyPayment) }\n : { status: 'failed' },\n )\n }\n\n const field = (\n name: PayoffField,\n label: string,\n adornment: { position: 'start' | 'end'; symbol: string },\n ) => (\n <TextField\n error={!!errors[name]}\n fullWidth={true}\n helperText={errors[name]}\n id={`${id}-${name}`}\n label={label}\n onChange={setField(name)}\n slotProps={{\n htmlInput: { inputMode: 'decimal' },\n input: {\n [adornment.position === 'start' ? 'startAdornment' : 'endAdornment']: (\n <InputAdornment aria-hidden=\"true\" position={adornment.position}>\n {adornment.symbol}\n </InputAdornment>\n ),\n },\n }}\n value={inputs[name]}\n />\n )\n\n return (\n <Stack component=\"form\" noValidate={true} onSubmit={handleSubmit} sx={{ p: 16 }}>\n {accountName && (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 8 }}>\n <InstitutionLogo alt=\"\" institutionGuid={account?.institution_guid ?? ''} size={24} />\n <Text component=\"p\" variant=\"body2\">\n {accountName}\n </Text>\n </Stack>\n )}\n <Text color=\"text.secondary\" component=\"p\" sx={{ mt: 16 }} variant=\"body2\">\n {copy.description}\n </Text>\n <Stack sx={{ gap: 24, pb: 24, pt: 32 }}>\n {field('balance', copy.credit_card_balance, { position: 'start', symbol: '$' })}\n <Stack sx={{ flexDirection: 'row', gap: 16 }}>\n {field('interestRate', copy.interest_rate, { position: 'end', symbol: '%' })}\n {field('monthlyPayment', copy.monthly_payment, { position: 'start', symbol: '$' })}\n </Stack>\n </Stack>\n <Button fullWidth={true} sx={{ mb: 24, mt: 8 }} type=\"submit\" variant=\"contained\">\n {copy.calculate}\n </Button>\n {outcome.status === 'failed' ? (\n <CalculationFailed copy={copy} />\n ) : (\n <PayoffResults\n copy={copy}\n rows={outcome.status === 'calculated' ? outcome.rows : undefined}\n />\n )}\n </Stack>\n )\n}\n\nexport const selectPayoffCalculatorCopy = (copy: GlobalCopy) =>\n copy.insights_feed?.payoff_calculator\n\n/**\n * Monthly Credit Card Interest Summary's \"Learn how to save\" drawer: the credit card payoff\n * calculator. The beat's account prefills the balance, interest rate and minimum payment; the\n * user edits them and compares the payoff at that payment, $10 more and $20 more.\n */\nexport const PayoffCalculatorBlock = observer(function PayoffCalculatorBlock({\n beat,\n}: ActionBlockProps) {\n const { accounts } = useAccountStore()\n const copy = useRequiredCopy(selectPayoffCalculatorCopy)\n\n return (\n <PayoffCalculatorForm\n account={resolvePrimaryAccount(beat, accounts)}\n copy={copy}\n key={beat.guid}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;AA8BA,IAAa,KAAA,CAA8B,EAAE,MAAA,EAAA,MAA6B;AACxE,QAAM,EAAE,gBAAA,GAAgB,cAAA,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AAM,WAAW,EAAK,qBAAqB;AAAA,UAAE,UAAU;AAAA,UAAS,QAAQ;AAAA,QAAI,CAAC,GAC9E,gBAAA,EAAC,GAAD;AAAA,UAAO,IAAI;AAAA,YAAE,eAAe;AAAA,YAAO,KAAK;AAAA,UAAG;AAAA,UAA3C,UAAA,CACG,EAAM,gBAAgB,EAAK,eAAe;AAAA,YAAE,UAAU;AAAA,YAAO,QAAQ;AAAA,UAAI,CAAC,GAC1E,EAAM,kBAAkB,EAAK,iBAAiB;AAAA,YAAE,UAAU;AAAA,YAAS,QAAQ;AAAA,UAAI,CAAC,CAC5E;AAAA,QACF,CAAA,CAAA;AAAA;MACP,gBAAA,EAAC,GAAD;AAAA,QAAQ,WAAW;AAAA,QAAM,IAAI;AAAA,UAAE,IAAI;AAAA,UAAI,IAAI;AAAA,QAAE;AAAA,QAAG,MAAK;AAAA,QAAS,SAAQ;AAAA,QACnE,UAAA,EAAK;AAAA,MACA,CAAA;AAAA,MACP,EAAQ,WAAW,WAClB,gBAAA,EAAC,GAAD,EAAyB,MAAA,EAAO,CAAA,IAEhC,gBAAA,EAAC,GAAD;AAAA,QACQ,MAAA;AAAA,QACN,MAAM,EAAQ,WAAW,eAAe,EAAQ,OAAO;AAAA,MACxD,CAAA;AAAA,IAEE;AAAA;AAEX,GAEa,IAAA,CAA8B,MACzC,EAAK,eAAe,mBAOT,KAAwB,EAAS,SAA+B,EAC3E,MAAA,EAAA,GACmB;AACnB,QAAM,EAAE,UAAA,EAAA,IAAa,EAAgB,GAC/B,IAAO,EAAgB,CAA0B;AAEvD,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,SAAS,EAAsB,GAAM,CAAQ;AAAA,IACvC,MAAA;AAAA,EAEP,GADM,EAAK,IACX;AAEL,CAAC"}
@@ -1 +1 @@
1
- export { PayoffCalculatorBlock, usePayoffCalculatorPrepare, selectPayoffCalculatorCopy, } from './PayoffCalculatorBlock';
1
+ export { PayoffCalculatorBlock, usePayoffCalculatorLoadState, usePayoffCalculatorPrepare, selectPayoffCalculatorCopy, } from './PayoffCalculatorBlock';
@@ -1,37 +1,34 @@
1
- import { useAccountStore as m, useGlobalCopyStore as p } from "../../../common/context/hooks.es.js";
2
- import f from "../../../common/components/drawer/Drawer.es.js";
3
- import d from "../../../common/components/Loader.es.js";
4
- import { useRequiredCopy as y } from "../useRequiredCopy.es.js";
5
- import { AccountDetailsBlock as g } from "../AccountDetailsBlock/AccountDetailsBlock.es.js";
6
- import { buildStrategies as A, resolveStrategyAccounts as S, toPayoffAccountRow as C } from "./layout.es.js";
7
- import _ from "./PayoffStrategiesContent.es.js";
8
- import { useState as v } from "react";
9
- import { observer as b } from "mobx-react-lite";
10
- import { Fragment as P, jsx as o, jsxs as k } from "react/jsx-runtime";
11
- var h = (e) => e.insights_feed?.general, O = b(function({ beat: r }) {
12
- const [t, c] = v(null), { accounts: a } = p(), { accountsLoaded: i, visibleAccounts: n } = m(), s = y(h);
13
- if (!i) return /* @__PURE__ */ o(d, {});
14
- const u = S(r, n).map(C), l = () => c(null);
15
- return /* @__PURE__ */ k(P, { children: [/* @__PURE__ */ o(_, {
16
- accounts: u,
17
- copy: s,
1
+ import { useAccountStore as l, useGlobalCopyStore as m } from "../../../common/context/hooks.es.js";
2
+ import p from "../../../common/components/drawer/Drawer.es.js";
3
+ import { useRequiredCopy as f } from "../useRequiredCopy.es.js";
4
+ import { AccountDetailsBlock as d } from "../AccountDetailsBlock/AccountDetailsBlock.es.js";
5
+ import { buildStrategies as y, resolveStrategyAccounts as g, toPayoffAccountRow as A } from "./layout.es.js";
6
+ import S from "./PayoffStrategiesContent.es.js";
7
+ import { useState as C } from "react";
8
+ import { observer as _ } from "mobx-react-lite";
9
+ import { Fragment as v, jsx as t, jsxs as b } from "react/jsx-runtime";
10
+ var P = (e) => e.insights_feed?.general, R = _(function({ beat: r }) {
11
+ const [o, c] = C(null), { accounts: s } = m(), { visibleAccounts: i } = l(), a = f(P), n = g(r, i).map(A), u = () => c(null);
12
+ return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ t(S, {
13
+ accounts: n,
14
+ copy: a,
18
15
  onAccountClick: c,
19
- strategies: A(s)
20
- }), /* @__PURE__ */ o(f, {
21
- ariaLabelClose: a?.close_account_details_aria,
22
- isOpen: t !== null,
23
- onClose: l,
24
- title: a?.account_details,
25
- children: t && /* @__PURE__ */ o(g, { beat: {
16
+ strategies: y(a)
17
+ }), /* @__PURE__ */ t(p, {
18
+ ariaLabelClose: s?.close_account_details_aria,
19
+ isOpen: o !== null,
20
+ onClose: u,
21
+ title: s?.account_details,
22
+ children: o && /* @__PURE__ */ t(d, { beat: {
26
23
  ...r,
27
24
  primary_account: void 0,
28
- primary_account_guid: t
25
+ primary_account_guid: o
29
26
  } })
30
27
  })] });
31
28
  });
32
29
  export {
33
- O as PayoffStrategiesBlock,
34
- h as selectPayoffStrategiesCopy
30
+ R as PayoffStrategiesBlock,
31
+ P as selectPayoffStrategiesCopy
35
32
  };
36
33
 
37
34
  //# sourceMappingURL=PayoffStrategiesBlock.es.js.map