@mx-cartographer/experiences 9.7.30 → 9.7.31

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 CHANGED
@@ -1,3 +1,7 @@
1
+ ## [9.7.31] - 10-22-2026
2
+
3
+ - **ADDED** - `emergency_savings_block` action block (savings calculator drawer) for Monthly Emergency Savings Reminder (MEW2-3352)
4
+
1
5
  ## [9.7.30] - 10-22-2026
2
6
 
3
7
  - **ADDED** - `payoff_calculator_block` action block: the credit card payoff calculator drawer behind Monthly Credit Card Interest Summary's "Learn how to save", ported from pulse. Prefills the beat account's balance, interest rate and minimum payment, validates the inputs and compares the payoff at that payment, $10 more and $20 more, with a failure state. Copy under the new `insights_feed.payoff_calculator` namespace; fixture, stories, tests and `docs/action-blocks/payoff-calculator-block.md` (MEW2-3357)
@@ -247,6 +247,31 @@ export interface AmountInputModalCopy {
247
247
  /** Shown in the dialog when the save request fails; the value stays so Save can be retried. */
248
248
  save_error: string;
249
249
  }
250
+ export interface EmergencySavingsCopy {
251
+ total_savings_balance: string;
252
+ savings_goal: string;
253
+ how_to_get_there: string;
254
+ adjust_the_inputs_below_to_find_a_comfortable_amount: string;
255
+ how_often_can_you_contribute: string;
256
+ once_per_week: string;
257
+ every_other_week: string;
258
+ once_per_month: string;
259
+ every_three_months: string;
260
+ meet_your_goal_within: string;
261
+ days: string;
262
+ weeks: string;
263
+ months: string;
264
+ estimated_contribution: string;
265
+ week: string;
266
+ every_other_week_period: string;
267
+ month: string;
268
+ three_month_period: string;
269
+ calculate: string;
270
+ amount_in_savings: string;
271
+ step_one: string;
272
+ step_two: string;
273
+ final_step: string;
274
+ }
250
275
  /** Labels for the Debts component block; the values come pre-formatted off `instance_slot`. */
251
276
  export interface DebtsBlockCopy {
252
277
  balance_label: string;
@@ -294,6 +319,7 @@ export interface InsightsFeedCopy {
294
319
  make_transfer: MakeTransferCopy;
295
320
  /** Optional until the localized-content service ships it; the drawer shows an error without it. */
296
321
  remaining_cash?: RemainingCashCopy;
322
+ emergency_savings?: EmergencySavingsCopy;
297
323
  overflow_menu: OverflowMenuCopy;
298
324
  transaction_history_block: TransactionHistoryBlock;
299
325
  hidden_confirmation: HiddenConfirmationCopy;
@@ -13,7 +13,7 @@ export type { DebtsCopy } from './DebtsCopy';
13
13
  export type { FinstrongCopy } from './FinstrongCopy';
14
14
  export type { GoalsCopy } from './GoalsCopy';
15
15
  export type { HelpCopy, HelpByCategoryList } from './HelpCopy';
16
- export type { AmountInputModalCopy, AmountInputModalVariantCopy, InsightsFeedCopy, MakeTransferCopy, PayoffCalculatorCopy, RemainingCashCopy, OverflowMenuCopy, DismissInsightCopy, DismissInsightOptionCopy, HiddenConfirmationCopy, HideFeedbackCopy, FeedbackCopy, FeedbackBarCopy, } from './InsightsFeedCopy';
16
+ export type { AmountInputModalCopy, AmountInputModalVariantCopy, EmergencySavingsCopy, InsightsFeedCopy, MakeTransferCopy, PayoffCalculatorCopy, RemainingCashCopy, OverflowMenuCopy, DismissInsightCopy, DismissInsightOptionCopy, HiddenConfirmationCopy, HideFeedbackCopy, FeedbackCopy, FeedbackBarCopy, } from './InsightsFeedCopy';
17
17
  export type { InvestmentsCopy } from './InvestmentsCopy';
18
18
  export type { MicroInsightsCopy } from './MicroInsightsCopy';
19
19
  export type { NetWorthCopy } from './NetWorthCopy';
@@ -0,0 +1,4 @@
1
+ import { ActionBlockProps } from '../../mappings/blocks';
2
+ export declare const EmergencySavingsBlock: (({ beat, }: ActionBlockProps) => import("react/jsx-runtime").JSX.Element) & {
3
+ displayName: string;
4
+ };
@@ -0,0 +1,80 @@
1
+ import { buildDynamicCopy as x } from "../../../core/utils/Localization.es.js";
2
+ import { useGlobalCopyStore as v } from "../../../common/context/hooks.es.js";
3
+ import { formatCurrency as c } from "../../../core/utils/NumberFormatting.es.js";
4
+ import { variants as _ } from "../../blocks/ChartBlocks/StepChartBlock/index.es.js";
5
+ import { stepForBalance as y } from "./layout.es.js";
6
+ import { SavingsCalculator as h } from "./SavingsCalculator.es.js";
7
+ import { observer as C } from "mobx-react-lite";
8
+ import e from "@mui/material/Stack";
9
+ import { Text as p } from "@mxenabled/mxui";
10
+ import { jsx as o, jsxs as n } from "react/jsx-runtime";
11
+ var m = ({ label: i, value: a }) => /* @__PURE__ */ n(e, {
12
+ "aria-label": i,
13
+ role: "group",
14
+ sx: {
15
+ border: "1px solid",
16
+ borderColor: "divider",
17
+ borderRadius: "8px",
18
+ flex: 1,
19
+ gap: 4,
20
+ p: 12
21
+ },
22
+ children: [/* @__PURE__ */ o(p, {
23
+ color: "text.secondary",
24
+ variant: "caption",
25
+ children: i
26
+ }), /* @__PURE__ */ o(p, {
27
+ bold: !0,
28
+ component: "p",
29
+ variant: "h3",
30
+ children: a
31
+ })]
32
+ }), A = C(function({ beat: a }) {
33
+ const { common: d, insights_feed: g } = v(), r = g?.emergency_savings;
34
+ if (!r) return /* @__PURE__ */ o(e, {
35
+ sx: { p: 24 },
36
+ children: /* @__PURE__ */ o(p, { children: d?.error_message })
37
+ });
38
+ const t = a.insights_payload?.drilldown_data?.savings_account_balance, l = typeof t == "number" && Number.isFinite(t) ? t : 0, { goal: s, index: u, labelKey: b } = y(l), { WithText: f } = _;
39
+ return /* @__PURE__ */ n(e, {
40
+ sx: {
41
+ bgcolor: "background.default",
42
+ gap: 24,
43
+ p: 24
44
+ },
45
+ children: [/* @__PURE__ */ n(e, {
46
+ sx: {
47
+ bgcolor: "background.paper",
48
+ borderRadius: "8px",
49
+ gap: 16,
50
+ p: 16
51
+ },
52
+ children: [/* @__PURE__ */ o(f, { slotData: {
53
+ completed_steps: u,
54
+ label_1: r[b].toUpperCase(),
55
+ label_2: x(r.amount_in_savings, c(s, "0"))
56
+ } }), /* @__PURE__ */ n(e, {
57
+ sx: {
58
+ flexDirection: "row",
59
+ gap: 12
60
+ },
61
+ children: [/* @__PURE__ */ o(m, {
62
+ label: r.total_savings_balance,
63
+ value: c(l, "0,0.00")
64
+ }), /* @__PURE__ */ o(m, {
65
+ label: r.savings_goal,
66
+ value: c(s, "0,0")
67
+ })]
68
+ })]
69
+ }), /* @__PURE__ */ o(h, {
70
+ balance: l,
71
+ copy: r,
72
+ goal: s
73
+ }, a.guid)]
74
+ });
75
+ });
76
+ export {
77
+ A as EmergencySavingsBlock
78
+ };
79
+
80
+ //# sourceMappingURL=EmergencySavingsBlock.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmergencySavingsBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport { useGlobalCopyStore } from '../../../common'\nimport { buildDynamicCopy } from '../../../core'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { variants as stepChartVariants } from '../../blocks/ChartBlocks/StepChartBlock'\nimport type { ActionBlockProps } from '../../mappings/blocks'\n\nimport { SavingsCalculator } from './SavingsCalculator'\nimport { stepForBalance } from './layout'\n\nconst AmountBox = ({ label, value }: { label: string; value: string }) => (\n <Stack\n aria-label={label}\n role=\"group\"\n sx={{\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: '8px',\n flex: 1,\n gap: 4,\n p: 12,\n }}\n >\n <Text color=\"text.secondary\" variant=\"caption\">\n {label}\n </Text>\n <Text bold={true} component=\"p\" variant=\"h3\">\n {value}\n </Text>\n </Stack>\n)\n\nexport const EmergencySavingsBlock = observer(function EmergencySavingsBlock({\n beat,\n}: ActionBlockProps) {\n const { common: commonCopy, insights_feed: insightsFeedCopy } = useGlobalCopyStore()\n const copy = insightsFeedCopy?.emergency_savings\n\n if (!copy) {\n return (\n <Stack sx={{ p: 24 }}>\n <Text>{commonCopy?.error_message}</Text>\n </Stack>\n )\n }\n\n const raw = beat.insights_payload?.drilldown_data?.savings_account_balance\n const balance = typeof raw === 'number' && Number.isFinite(raw) ? raw : 0\n const { goal, index, labelKey } = stepForBalance(balance)\n const { WithText: Stepper } = stepChartVariants\n\n return (\n <Stack sx={{ bgcolor: 'background.default', gap: 24, p: 24 }}>\n <Stack sx={{ bgcolor: 'background.paper', borderRadius: '8px', gap: 16, p: 16 }}>\n <Stepper\n slotData={{\n completed_steps: index,\n label_1: copy[labelKey].toUpperCase(),\n label_2: buildDynamicCopy(copy.amount_in_savings, formatCurrency(goal, '0')) as string,\n }}\n />\n <Stack sx={{ flexDirection: 'row', gap: 12 }}>\n <AmountBox label={copy.total_savings_balance} value={formatCurrency(balance, '0,0.00')} />\n <AmountBox label={copy.savings_goal} value={formatCurrency(goal, '0,0')} />\n </Stack>\n </Stack>\n <SavingsCalculator balance={balance} copy={copy} goal={goal} key={beat.guid} />\n </Stack>\n )\n})\n"],"mappings":";;;;;;;;;;AAcA,IAAM,IAAA,CAAa,EAAE,OAAA,GAAO,OAAA,EAAA,MAC1B,gBAAA,EAAC,GAAD;AAAA,EACE,cAAY;AAAA,EACZ,MAAK;AAAA,EACL,IAAI;AAAA,IACF,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,cAAc;AAAA,IACd,MAAM;AAAA,IACN,KAAK;AAAA,IACL,GAAG;AAAA,EACL;AAAA,EAVF,UAAA,CAYE,gBAAA,EAAC,GAAD;AAAA,IAAM,OAAM;AAAA,IAAiB,SAAQ;AAAA,IAClC,UAAA;AAAA,EACG,CAAA,GACN,gBAAA,EAAC,GAAD;AAAA,IAAM,MAAM;AAAA,IAAM,WAAU;AAAA,IAAI,SAAQ;AAAA,IACrC,UAAA;AAAA,EACG,CAAA,CACD;IAGI,IAAwB,EAAS,SAA+B,EAC3E,MAAA,EAAA,GACmB;AACnB,QAAM,EAAE,QAAQ,GAAY,eAAe,EAAA,IAAqB,EAAmB,GAC7E,IAAO,GAAkB;AAE/B,MAAI,CAAC,EACH,QACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,GAAG,GAAG;AAAA,IACjB,UAAA,gBAAA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
@@ -0,0 +1,8 @@
1
+ import { EmergencySavingsCopy } from '../../../core';
2
+ interface SavingsCalculatorProps {
3
+ balance: number;
4
+ goal: number;
5
+ copy: EmergencySavingsCopy;
6
+ }
7
+ export declare const SavingsCalculator: ({ balance, copy, goal }: SavingsCalculatorProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,138 @@
1
+ import { formatCurrency as E } from "../../../core/utils/NumberFormatting.es.js";
2
+ import { Select as g } from "../../../common/components/Select.es.js";
3
+ import { CADENCES as v, DEADLINE_UNITS as _, calculateContribution as A } from "./layout.es.js";
4
+ import i from "react";
5
+ import l from "@mui/material/Stack";
6
+ import { Text as d } from "@mxenabled/mxui";
7
+ import L from "@mui/material/Button";
8
+ import { jsx as a, jsxs as r } from "react/jsx-runtime";
9
+ import f from "@mui/material/TextField";
10
+ var U = 2, j = 2, M = "6", x = (o) => {
11
+ const [e, ...s] = o.replace(/[^0-9.]/g, "").split(".");
12
+ return s.length ? `${e}.${s.join("")}` : e;
13
+ }, S = (o) => o === "" ? NaN : Number(o), I = { htmlInput: {
14
+ inputMode: "decimal",
15
+ pattern: "[0-9]*[.]?[0-9]*"
16
+ } }, O = ({ balance: o, copy: e, goal: s }) => {
17
+ const [c, C] = i.useState(String(s)), [m, N] = i.useState(U), [p, D] = i.useState(j), [h, w] = i.useState(M), [u, T] = i.useState();
18
+ return /* @__PURE__ */ r(l, {
19
+ component: "form",
20
+ onSubmit: (t) => {
21
+ t.preventDefault();
22
+ const n = v[m], b = A({
23
+ balance: o,
24
+ goal: S(c),
25
+ cadence: n,
26
+ deadline: _[p],
27
+ deadlineQuantity: S(h)
28
+ });
29
+ T(b === void 0 ? void 0 : {
30
+ amount: b,
31
+ period: e[n.periodKey]
32
+ });
33
+ },
34
+ sx: {
35
+ bgcolor: "background.paper",
36
+ borderRadius: "8px",
37
+ gap: 24,
38
+ p: 16
39
+ },
40
+ children: [
41
+ /* @__PURE__ */ r(l, {
42
+ sx: { gap: 8 },
43
+ children: [/* @__PURE__ */ a(d, {
44
+ component: "h3",
45
+ variant: "h3",
46
+ children: e.how_to_get_there
47
+ }), /* @__PURE__ */ a(d, {
48
+ color: "text.secondary",
49
+ truncate: !1,
50
+ variant: "body2",
51
+ children: e.adjust_the_inputs_below_to_find_a_comfortable_amount
52
+ })]
53
+ }),
54
+ /* @__PURE__ */ a(f, {
55
+ fullWidth: !0,
56
+ label: e.savings_goal,
57
+ onChange: (t) => C(x(t.target.value)),
58
+ slotProps: I,
59
+ value: c
60
+ }),
61
+ /* @__PURE__ */ a(g, {
62
+ label: e.how_often_can_you_contribute,
63
+ onChange: N,
64
+ options: v.map(({ labelKey: t }, n) => ({
65
+ id: n,
66
+ label: e[t]
67
+ })),
68
+ value: m
69
+ }),
70
+ /* @__PURE__ */ r(l, {
71
+ sx: {
72
+ flexDirection: "row",
73
+ gap: 8
74
+ },
75
+ children: [/* @__PURE__ */ a(f, {
76
+ fullWidth: !0,
77
+ label: e.meet_your_goal_within,
78
+ onChange: (t) => w(x(t.target.value)),
79
+ slotProps: I,
80
+ value: h
81
+ }), /* @__PURE__ */ a(g, {
82
+ inputProps: { "aria-label": e.meet_your_goal_within },
83
+ label: "",
84
+ onChange: D,
85
+ options: _.map(({ labelKey: t }, n) => ({
86
+ id: n,
87
+ label: e[t]
88
+ })),
89
+ sx: { minWidth: 128 },
90
+ value: p
91
+ })]
92
+ }),
93
+ u && /* @__PURE__ */ r(l, {
94
+ role: "status",
95
+ sx: {
96
+ alignItems: "center",
97
+ border: "1px solid",
98
+ borderColor: "divider",
99
+ borderRadius: "8px",
100
+ gap: 4,
101
+ p: 12
102
+ },
103
+ children: [/* @__PURE__ */ a(d, {
104
+ bold: !0,
105
+ variant: "body1",
106
+ children: e.estimated_contribution
107
+ }), /* @__PURE__ */ r(l, {
108
+ sx: {
109
+ alignItems: "baseline",
110
+ flexDirection: "row",
111
+ gap: 8
112
+ },
113
+ children: [/* @__PURE__ */ a(d, {
114
+ bold: !0,
115
+ color: "success.main",
116
+ component: "p",
117
+ variant: "h2",
118
+ children: E(u.amount, "0,0.00")
119
+ }), /* @__PURE__ */ r(d, {
120
+ variant: "body1",
121
+ children: ["/ ", u.period.toLowerCase()]
122
+ })]
123
+ })]
124
+ }),
125
+ /* @__PURE__ */ a(L, {
126
+ fullWidth: !0,
127
+ type: "submit",
128
+ variant: "contained",
129
+ children: e.calculate
130
+ })
131
+ ]
132
+ });
133
+ };
134
+ export {
135
+ O as SavingsCalculator
136
+ };
137
+
138
+ //# sourceMappingURL=SavingsCalculator.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SavingsCalculator.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/EmergencySavingsBlock/SavingsCalculator.tsx"],"sourcesContent":["import React from 'react'\n\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport TextField from '@mui/material/TextField'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { Select } from '../../../common'\nimport type { EmergencySavingsCopy } from '../../../core'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\n\nimport { CADENCES, DEADLINE_UNITS, calculateContribution } from './layout'\n\nconst MONTHLY = 2\nconst MONTHS = 2\nconst DEFAULT_DEADLINE_QUANTITY = '6'\n\nconst toDecimalInput = (value: string) => {\n const [whole, ...fraction] = value.replace(/[^0-9.]/g, '').split('.')\n\n return fraction.length ? `${whole}.${fraction.join('')}` : whole\n}\n\nconst toNumber = (input: string) => (input === '' ? Number.NaN : Number(input))\n\nconst NUMERIC_INPUT = { htmlInput: { inputMode: 'decimal', pattern: '[0-9]*[.]?[0-9]*' } } as const\n\ninterface SavingsCalculatorProps {\n balance: number\n goal: number\n copy: EmergencySavingsCopy\n}\n\ninterface Solution {\n amount: number\n period: string\n}\n\nexport const SavingsCalculator = ({ balance, copy, goal }: SavingsCalculatorProps) => {\n const [savingsGoal, setSavingsGoal] = React.useState(String(goal))\n const [cadenceIndex, setCadenceIndex] = React.useState(MONTHLY)\n const [deadlineIndex, setDeadlineIndex] = React.useState(MONTHS)\n const [deadlineQuantity, setDeadlineQuantity] = React.useState(DEFAULT_DEADLINE_QUANTITY)\n const [solution, setSolution] = React.useState<Solution>()\n\n const handleSubmit = (event: React.FormEvent) => {\n event.preventDefault()\n\n const cadence = CADENCES[cadenceIndex]\n const amount = calculateContribution({\n balance,\n goal: toNumber(savingsGoal),\n cadence,\n deadline: DEADLINE_UNITS[deadlineIndex],\n deadlineQuantity: toNumber(deadlineQuantity),\n })\n\n setSolution(amount === undefined ? undefined : { amount, period: copy[cadence.periodKey] })\n }\n\n return (\n <Stack\n component=\"form\"\n onSubmit={handleSubmit}\n sx={{ bgcolor: 'background.paper', borderRadius: '8px', gap: 24, p: 16 }}\n >\n <Stack sx={{ gap: 8 }}>\n <Text component=\"h3\" variant=\"h3\">\n {copy.how_to_get_there}\n </Text>\n <Text color=\"text.secondary\" truncate={false} variant=\"body2\">\n {copy.adjust_the_inputs_below_to_find_a_comfortable_amount}\n </Text>\n </Stack>\n <TextField\n fullWidth={true}\n label={copy.savings_goal}\n onChange={(event) => setSavingsGoal(toDecimalInput(event.target.value))}\n slotProps={NUMERIC_INPUT}\n value={savingsGoal}\n />\n <Select\n label={copy.how_often_can_you_contribute}\n onChange={setCadenceIndex}\n options={CADENCES.map(({ labelKey }, id) => ({ id, label: copy[labelKey] }))}\n value={cadenceIndex}\n />\n <Stack sx={{ flexDirection: 'row', gap: 8 }}>\n <TextField\n fullWidth={true}\n label={copy.meet_your_goal_within}\n onChange={(event) => setDeadlineQuantity(toDecimalInput(event.target.value))}\n slotProps={NUMERIC_INPUT}\n value={deadlineQuantity}\n />\n <Select\n inputProps={{ 'aria-label': copy.meet_your_goal_within }}\n label=\"\"\n onChange={setDeadlineIndex}\n options={DEADLINE_UNITS.map(({ labelKey }, id) => ({ id, label: copy[labelKey] }))}\n sx={{ minWidth: 128 }}\n value={deadlineIndex}\n />\n </Stack>\n {solution && (\n <Stack\n role=\"status\"\n sx={{\n alignItems: 'center',\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: '8px',\n gap: 4,\n p: 12,\n }}\n >\n <Text bold={true} variant=\"body1\">\n {copy.estimated_contribution}\n </Text>\n <Stack sx={{ alignItems: 'baseline', flexDirection: 'row', gap: 8 }}>\n <Text bold={true} color=\"success.main\" component=\"p\" variant=\"h2\">\n {formatCurrency(solution.amount, '0,0.00')}\n </Text>\n <Text variant=\"body1\">/ {solution.period.toLowerCase()}</Text>\n </Stack>\n </Stack>\n )}\n <Button fullWidth={true} type=\"submit\" variant=\"contained\">\n {copy.calculate}\n </Button>\n </Stack>\n )\n}\n"],"mappings":";;;;;;;;;AAcA,IAAM,IAAU,GACV,IAAS,GACT,IAA4B,KAE5B,IAAA,CAAkB,MAAkB;AACxC,QAAM,CAAC,GAAO,GAAG,CAAA,IAAY,EAAM,QAAQ,YAAY,EAAE,EAAE,MAAM,GAAG;AAEpE,SAAO,EAAS,SAAS,GAAG,CAAA,IAAS,EAAS,KAAK,EAAE,CAAA,KAAM;AAC7D,GAEM,IAAA,CAAY,MAAmB,MAAU,KAAK,MAAa,OAAO,CAAK,GAEvE,IAAgB,EAAE,WAAW;AAAA,EAAE,WAAW;AAAA,EAAW,SAAS;AAAmB,EAAE,GAa5E,IAAA,CAAqB,EAAE,SAAA,GAAS,MAAA,GAAM,MAAA,EAAA,MAAmC;AACpF,QAAM,CAAC,GAAa,CAAA,IAAkB,EAAM,SAAS,OAAO,CAAI,CAAC,GAC3D,CAAC,GAAc,CAAA,IAAmB,EAAM,SAAS,CAAO,GACxD,CAAC,GAAe,CAAA,IAAoB,EAAM,SAAS,CAAM,GACzD,CAAC,GAAkB,CAAA,IAAuB,EAAM,SAAS,CAAyB,GAClF,CAAC,GAAU,CAAA,IAAe,EAAM,SAAmB;AAiBzD,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,WAAU;AAAA,IACV,UAlBE,CAAgB,MAA2B;AAC/C,MAAA,EAAM,eAAe;AAErB,YAAM,IAAU,EAAS,CAAA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,UACxD,CAAA,CAAA;AAAA,QACF,CAAA,CAAA;AAAA;MAET,gBAAA,EAAC,GAAD;AAAA,QAAQ,WAAW;AAAA,QAAM,MAAK;AAAA,QAAS,SAAQ;AAAA,QAC5C,UAAA,EAAK;AAAA,MACA,CAAA;AAAA,IACH;AAAA;AAEX"}
@@ -0,0 +1 @@
1
+ export { EmergencySavingsBlock } from './EmergencySavingsBlock';
@@ -0,0 +1,52 @@
1
+ export declare const stepForBalance: (balance: number) => {
2
+ below: 100;
3
+ goal: 100;
4
+ labelKey: "step_one";
5
+ index: number;
6
+ } | {
7
+ below: 500;
8
+ goal: 500;
9
+ labelKey: "step_two";
10
+ index: number;
11
+ } | {
12
+ below: number;
13
+ goal: 1000;
14
+ labelKey: "final_step";
15
+ index: number;
16
+ };
17
+ export declare const CADENCES: readonly [{
18
+ readonly labelKey: "once_per_week";
19
+ readonly periodKey: "week";
20
+ readonly months: 0.25;
21
+ }, {
22
+ readonly labelKey: "every_other_week";
23
+ readonly periodKey: "every_other_week_period";
24
+ readonly months: 0.5;
25
+ }, {
26
+ readonly labelKey: "once_per_month";
27
+ readonly periodKey: "month";
28
+ readonly months: 1;
29
+ }, {
30
+ readonly labelKey: "every_three_months";
31
+ readonly periodKey: "three_month_period";
32
+ readonly months: 3;
33
+ }];
34
+ export declare const DEADLINE_UNITS: readonly [{
35
+ readonly labelKey: "days";
36
+ readonly months: 0.0323;
37
+ }, {
38
+ readonly labelKey: "weeks";
39
+ readonly months: 0.25;
40
+ }, {
41
+ readonly labelKey: "months";
42
+ readonly months: 1;
43
+ }];
44
+ interface ContributionInput {
45
+ balance: number;
46
+ goal: number;
47
+ cadence: (typeof CADENCES)[number];
48
+ deadline: (typeof DEADLINE_UNITS)[number];
49
+ deadlineQuantity: number;
50
+ }
51
+ export declare const calculateContribution: ({ balance, goal, cadence, deadline, deadlineQuantity, }: ContributionInput) => number | undefined;
52
+ export {};
@@ -0,0 +1,72 @@
1
+ var a = [
2
+ {
3
+ below: 100,
4
+ goal: 100,
5
+ labelKey: "step_one"
6
+ },
7
+ {
8
+ below: 500,
9
+ goal: 500,
10
+ labelKey: "step_two"
11
+ },
12
+ {
13
+ below: 1 / 0,
14
+ goal: 1e3,
15
+ labelKey: "final_step"
16
+ }
17
+ ], m = (t) => {
18
+ const e = a.findIndex(({ below: n }) => t < n);
19
+ return {
20
+ index: e,
21
+ ...a[e]
22
+ };
23
+ }, y = [
24
+ {
25
+ labelKey: "once_per_week",
26
+ periodKey: "week",
27
+ months: 0.25
28
+ },
29
+ {
30
+ labelKey: "every_other_week",
31
+ periodKey: "every_other_week_period",
32
+ months: 0.5
33
+ },
34
+ {
35
+ labelKey: "once_per_month",
36
+ periodKey: "month",
37
+ months: 1
38
+ },
39
+ {
40
+ labelKey: "every_three_months",
41
+ periodKey: "three_month_period",
42
+ months: 3
43
+ }
44
+ ], h = [
45
+ {
46
+ labelKey: "days",
47
+ months: 0.0323
48
+ },
49
+ {
50
+ labelKey: "weeks",
51
+ months: 0.25
52
+ },
53
+ {
54
+ labelKey: "months",
55
+ months: 1
56
+ }
57
+ ], b = ({ balance: t, goal: e, cadence: n, deadline: l, deadlineQuantity: i }) => {
58
+ const o = e - t;
59
+ if (Number.isNaN(o)) return;
60
+ if (o <= 0) return 0;
61
+ const s = i * l.months / n.months, r = Number((o / s).toFixed(2));
62
+ if (!Number.isNaN(r))
63
+ return Math.min(r, Number(o.toFixed(2)));
64
+ };
65
+ export {
66
+ y as CADENCES,
67
+ h as DEADLINE_UNITS,
68
+ b as calculateContribution,
69
+ m as stepForBalance
70
+ };
71
+
72
+ //# sourceMappingURL=layout.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/EmergencySavingsBlock/layout.ts"],"sourcesContent":["const STEPS = [\n { below: 100, goal: 100, labelKey: 'step_one' },\n { below: 500, goal: 500, labelKey: 'step_two' },\n { below: Infinity, goal: 1000, labelKey: 'final_step' },\n] as const\n\nexport const stepForBalance = (balance: number) => {\n const index = STEPS.findIndex(({ below }) => balance < below)\n\n return { index, ...STEPS[index] }\n}\n\nexport const CADENCES = [\n { labelKey: 'once_per_week', periodKey: 'week', months: 0.25 },\n { labelKey: 'every_other_week', periodKey: 'every_other_week_period', months: 0.5 },\n { labelKey: 'once_per_month', periodKey: 'month', months: 1 },\n { labelKey: 'every_three_months', periodKey: 'three_month_period', months: 3 },\n] as const\n\nexport const DEADLINE_UNITS = [\n { labelKey: 'days', months: 0.0323 },\n { labelKey: 'weeks', months: 0.25 },\n { labelKey: 'months', months: 1 },\n] as const\n\ninterface ContributionInput {\n balance: number\n goal: number\n cadence: (typeof CADENCES)[number]\n deadline: (typeof DEADLINE_UNITS)[number]\n deadlineQuantity: number\n}\n\nexport const calculateContribution = ({\n balance,\n goal,\n cadence,\n deadline,\n deadlineQuantity,\n}: ContributionInput): number | undefined => {\n const remainingToSave = goal - balance\n\n if (Number.isNaN(remainingToSave)) return undefined\n if (remainingToSave <= 0) return 0\n\n const periods = (deadlineQuantity * deadline.months) / cadence.months\n const payment = Number((remainingToSave / periods).toFixed(2))\n\n if (Number.isNaN(payment)) return undefined\n\n return Math.min(payment, Number(remainingToSave.toFixed(2)))\n}\n"],"mappings":"AAAA,IAAM,IAAQ;AAAA,EACZ;AAAA,IAAE,OAAO;AAAA,IAAK,MAAM;AAAA,IAAK,UAAU;AAAA,EAAW;AAAA,EAC9C;AAAA,IAAE,OAAO;AAAA,IAAK,MAAM;AAAA,IAAK,UAAU;AAAA,EAAW;AAAA,EAC9C;AAAA,IAAE,OAAO;AAAA,IAAU,MAAM;AAAA,IAAM,UAAU;AAAA,EAAa;AACxD,GAEa,IAAA,CAAkB,MAAoB;AACjD,QAAM,IAAQ,EAAM,UAAA,CAAW,EAAE,OAAA,EAAA,MAAY,IAAU,CAAK;AAE5D,SAAO;AAAA,IAAE,OAAA;AAAA,IAAO,GAAG,EAAM,CAAA;AAAA,EAAO;AAClC,GAEa,IAAW;AAAA,EACtB;AAAA,IAAE,UAAU;AAAA,IAAiB,WAAW;AAAA,IAAQ,QAAQ;AAAA,EAAK;AAAA,EAC7D;AAAA,IAAE,UAAU;AAAA,IAAoB,WAAW;AAAA,IAA2B,QAAQ;AAAA,EAAI;AAAA,EAClF;AAAA,IAAE,UAAU;AAAA,IAAkB,WAAW;AAAA,IAAS,QAAQ;AAAA,EAAE;AAAA,EAC5D;AAAA,IAAE,UAAU;AAAA,IAAsB,WAAW;AAAA,IAAsB,QAAQ;AAAA,EAAE;AAC/E,GAEa,IAAiB;AAAA,EAC5B;AAAA,IAAE,UAAU;AAAA,IAAQ,QAAQ;AAAA,EAAO;AAAA,EACnC;AAAA,IAAE,UAAU;AAAA,IAAS,QAAQ;AAAA,EAAK;AAAA,EAClC;AAAA,IAAE,UAAU;AAAA,IAAU,QAAQ;AAAA,EAAE;AAClC,GAUa,IAAA,CAAyB,EACpC,SAAA,GACA,MAAA,GACA,SAAA,GACA,UAAA,GACA,kBAAA,EAAA,MAC2C;AAC3C,QAAM,IAAkB,IAAO;AAE/B,MAAI,OAAO,MAAM,CAAe,EAAG;AACnC,MAAI,KAAmB,EAAG,QAAO;AAEjC,QAAM,IAAW,IAAmB,EAAS,SAAU,EAAQ,QACzD,IAAU,QAAQ,IAAkB,GAAS,QAAQ,CAAC,CAAC;AAE7D,MAAI,QAAO,MAAM,CAAO;AAExB,WAAO,KAAK,IAAI,GAAS,OAAO,EAAgB,QAAQ,CAAC,CAAC,CAAC;AAC7D"}
@@ -12,5 +12,6 @@ export declare const actionBlocksKey: {
12
12
  TRANSACTION_LIST_ACTION_BLOCK: string;
13
13
  REMAINING_CASH_ACTION_BLOCK: string;
14
14
  AMOUNT_INPUT_MODAL_ACTION_BLOCK: string;
15
+ EMERGENCY_SAVINGS_ACTION_BLOCK: string;
15
16
  PAYOFF_CALCULATOR_ACTION_BLOCK: string;
16
17
  };
@@ -12,6 +12,7 @@ var _ = {
12
12
  TRANSACTION_LIST_ACTION_BLOCK: "transaction_list_block",
13
13
  REMAINING_CASH_ACTION_BLOCK: "remaining_cash_block",
14
14
  AMOUNT_INPUT_MODAL_ACTION_BLOCK: "amount_input_modal_block",
15
+ EMERGENCY_SAVINGS_ACTION_BLOCK: "emergency_savings_block",
15
16
  PAYOFF_CALCULATOR_ACTION_BLOCK: "payoff_calculator_block"
16
17
  };
17
18
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"actionBlocksKey.es.js","names":[],"sources":["../../../src/insights-v2/mappings/actionBlocksKey.ts"],"sourcesContent":["// Keys for the drawer drilldown registry in `blocks.ts`, extracted into their own module.\n//\n// Why: chart blocks (e.g. BarchartBlock, DoubleBarChartBlock) need\n// `TRANSCATION_HISTORY_ACTION_BLOCK` to tag a chart bar's drilldown context, but they are\n// themselves re-exported through `../blocks` -> `mappings/blocks.ts` imports from that same\n// barrel to build its `blocks` registry. Importing the key straight from `mappings/blocks.ts`\n// closed that loop into a circular import: evaluating `mappings/blocks.ts` pulled in the\n// `blocks` barrel, which (before it got to `ComponentBlocks`/`AccountBlock`) loaded\n// `BarchartBlock`, which imported back into the still-initializing `mappings/blocks.ts` —\n// tripping a \"Cannot access 'AccountBlock' before initialization\" TDZ error in Storybook/Vite.\n//\n// Keeping the keys here (no dependency on `mappings/blocks.ts`) lets chart blocks reference\n// them without re-entering that module.\n//\n// Names follow ditto: its registry ends every CTA block in `_block` and the V2 envelope copies those\n// names verbatim (`transaction_details_block`, `contact_support_block`, `make_transfer_block`).\nexport const actionBlocksKey = {\n PLACEHOLDER_ACTION_BLOCK: 'placeholder_block',\n MAKE_TRANSFER_ACTION_BLOCK: 'make_transfer_block',\n TRANSCATION_HISTORY_ACTION_BLOCK: 'transaction_history_block',\n TRANSACTION_DETAILS_ACTION_BLOCK: 'transaction_details_block',\n CONTACT_SUPPORT_ACTION_BLOCK: 'contact_support_block',\n FEEDBACK_MODAL_ACTION_BLOCK: 'feedback_modal_block',\n CONNECTION_DETAIL_ACTION_BLOCK: 'connection_detail_block',\n CONNECT_WIDGET_ACTION_BLOCK: 'connect_widget_block',\n SURVEY_MODAL_ACTION_BLOCK: 'survey_modal_block',\n RECURRING_TRANSACTION_ACTION_BLOCK: 'recurring_transaction_block',\n TRANSACTION_LIST_ACTION_BLOCK: 'transaction_list_block',\n REMAINING_CASH_ACTION_BLOCK: 'remaining_cash_block',\n AMOUNT_INPUT_MODAL_ACTION_BLOCK: 'amount_input_modal_block',\n PAYOFF_CALCULATOR_ACTION_BLOCK: 'payoff_calculator_block',\n}\n"],"mappings":"AAgBA,IAAa,IAAkB;AAAA,EAC7B,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAC5B,kCAAkC;AAAA,EAClC,kCAAkC;AAAA,EAClC,8BAA8B;AAAA,EAC9B,6BAA6B;AAAA,EAC7B,gCAAgC;AAAA,EAChC,6BAA6B;AAAA,EAC7B,2BAA2B;AAAA,EAC3B,oCAAoC;AAAA,EACpC,+BAA+B;AAAA,EAC/B,6BAA6B;AAAA,EAC7B,iCAAiC;AAAA,EACjC,gCAAgC;AAClC"}
1
+ {"version":3,"file":"actionBlocksKey.es.js","names":[],"sources":["../../../src/insights-v2/mappings/actionBlocksKey.ts"],"sourcesContent":["// Keys for the drawer drilldown registry in `blocks.ts`, extracted into their own module.\n//\n// Why: chart blocks (e.g. BarchartBlock, DoubleBarChartBlock) need\n// `TRANSCATION_HISTORY_ACTION_BLOCK` to tag a chart bar's drilldown context, but they are\n// themselves re-exported through `../blocks` -> `mappings/blocks.ts` imports from that same\n// barrel to build its `blocks` registry. Importing the key straight from `mappings/blocks.ts`\n// closed that loop into a circular import: evaluating `mappings/blocks.ts` pulled in the\n// `blocks` barrel, which (before it got to `ComponentBlocks`/`AccountBlock`) loaded\n// `BarchartBlock`, which imported back into the still-initializing `mappings/blocks.ts` —\n// tripping a \"Cannot access 'AccountBlock' before initialization\" TDZ error in Storybook/Vite.\n//\n// Keeping the keys here (no dependency on `mappings/blocks.ts`) lets chart blocks reference\n// them without re-entering that module.\n//\n// Names follow ditto: its registry ends every CTA block in `_block` and the V2 envelope copies those\n// names verbatim (`transaction_details_block`, `contact_support_block`, `make_transfer_block`).\nexport const actionBlocksKey = {\n PLACEHOLDER_ACTION_BLOCK: 'placeholder_block',\n MAKE_TRANSFER_ACTION_BLOCK: 'make_transfer_block',\n TRANSCATION_HISTORY_ACTION_BLOCK: 'transaction_history_block',\n TRANSACTION_DETAILS_ACTION_BLOCK: 'transaction_details_block',\n CONTACT_SUPPORT_ACTION_BLOCK: 'contact_support_block',\n FEEDBACK_MODAL_ACTION_BLOCK: 'feedback_modal_block',\n CONNECTION_DETAIL_ACTION_BLOCK: 'connection_detail_block',\n CONNECT_WIDGET_ACTION_BLOCK: 'connect_widget_block',\n SURVEY_MODAL_ACTION_BLOCK: 'survey_modal_block',\n RECURRING_TRANSACTION_ACTION_BLOCK: 'recurring_transaction_block',\n TRANSACTION_LIST_ACTION_BLOCK: 'transaction_list_block',\n REMAINING_CASH_ACTION_BLOCK: 'remaining_cash_block',\n AMOUNT_INPUT_MODAL_ACTION_BLOCK: 'amount_input_modal_block',\n EMERGENCY_SAVINGS_ACTION_BLOCK: 'emergency_savings_block',\n PAYOFF_CALCULATOR_ACTION_BLOCK: 'payoff_calculator_block',\n}\n"],"mappings":"AAgBA,IAAa,IAAkB;AAAA,EAC7B,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAC5B,kCAAkC;AAAA,EAClC,kCAAkC;AAAA,EAClC,8BAA8B;AAAA,EAC9B,6BAA6B;AAAA,EAC7B,gCAAgC;AAAA,EAChC,6BAA6B;AAAA,EAC7B,2BAA2B;AAAA,EAC3B,oCAAoC;AAAA,EACpC,+BAA+B;AAAA,EAC/B,6BAA6B;AAAA,EAC7B,iCAAiC;AAAA,EACjC,gCAAgC;AAAA,EAChC,gCAAgC;AAClC"}
@@ -1,7 +1,7 @@
1
- import { ContactSupportActionBlock as m } from "../actionBlocks/ContactSupportActionBlock.es.js";
2
- import { hasDrawerBlock as j } from "./hasDrawerBlock.es.js";
1
+ import { ContactSupportActionBlock as p } from "../actionBlocks/ContactSupportActionBlock.es.js";
2
+ import { hasDrawerBlock as z } from "./hasDrawerBlock.es.js";
3
3
  import { actionBlocksKey as o } from "./actionBlocksKey.es.js";
4
- import { BarchartBlock as p } from "../blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js";
4
+ import { BarchartBlock as m } from "../blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js";
5
5
  import { DoubleBarChartBlock as _ } from "../blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js";
6
6
  import s from "../blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js";
7
7
  import C from "../blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js";
@@ -12,32 +12,33 @@ import f from "../blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.e
12
12
  import { BudgetBlock as A } from "../blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
13
13
  import T from "../blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js";
14
14
  import O from "../blocks/ComponentBlocks/GoalsBlock/GoalsBlock.es.js";
15
- import b from "../blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendDaysBlock.es.js";
16
- import i from "../blocks/ComponentBlocks/RepeatingTransactionBlock/RepeatingTransactionBlock.es.js";
17
- import N from "../blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
18
- import d from "../blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js";
19
- import { TransactionBlock as g } from "../blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
15
+ import N from "../blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendDaysBlock.es.js";
16
+ import n from "../blocks/ComponentBlocks/RepeatingTransactionBlock/RepeatingTransactionBlock.es.js";
17
+ import b from "../blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
18
+ import g from "../blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js";
19
+ import { TransactionBlock as d } from "../blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
20
20
  import I from "../blocks/ComponentBlocks/UpcomingSubscriptionBlock/UpcomingSubscriptionBlock.es.js";
21
21
  import P from "../blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js";
22
22
  import L from "../blocks/ImageBlocks/ImageBlock.es.js";
23
- import { SVGImageBlock as D } from "../blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
23
+ import { SVGImageBlock as S } from "../blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
24
24
  import { FeedbackModalActionBlock as h } from "../actionBlocks/FeedbackModalActionBlock.es.js";
25
- import { ConnectionDetailActionBlock as S } from "../actionBlocks/ConnectionDetailActionBlock.es.js";
26
- import { ConnectWidgetActionBlock as R } from "../actionBlocks/ConnectWidgetActionBlock.es.js";
27
- import { SurveyModalActionBlock as K } from "../actionBlocks/SurveyModalActionBlock.es.js";
28
- import { PlaceholderActionBlock as E } from "../actionBlocks/PlaceholderActionBlock.es.js";
29
- import { getMakeTransferDrawerTitle as y } from "../actionBlocks/MakeTransferActionBlock/layout.es.js";
25
+ import { ConnectionDetailActionBlock as D } from "../actionBlocks/ConnectionDetailActionBlock.es.js";
26
+ import { ConnectWidgetActionBlock as E } from "../actionBlocks/ConnectWidgetActionBlock.es.js";
27
+ import { SurveyModalActionBlock as R } from "../actionBlocks/SurveyModalActionBlock.es.js";
28
+ import { PlaceholderActionBlock as y } from "../actionBlocks/PlaceholderActionBlock.es.js";
29
+ import { getMakeTransferDrawerTitle as K } from "../actionBlocks/MakeTransferActionBlock/layout.es.js";
30
30
  import { MakeTransferActionBlockLayer as v } from "../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js";
31
31
  import { getDrawerHeaderTitle as M } from "../actionBlocks/TransactionHistoryBlock/utils.es.js";
32
32
  import { TransactionDetailsBlock as w } from "../actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js";
33
- import { useTransactionDetailsPrepare as n } from "../actionBlocks/TransactionDetailsBlock/useTransactionDetailsPrepare.es.js";
34
- import { TransactionHistoryBlock as U } from "../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js";
35
- import { useRecurringTransactionPrepare as c } from "../actionBlocks/RecurringTransactionBlock/useRecurringTransactionPrepare.es.js";
36
- import { RecurringTransactionBlock as F } from "../actionBlocks/RecurringTransactionBlock/RecurringTransactionBlock.es.js";
37
- import { TransactionListBlock as G } from "../actionBlocks/TransactionListBlock/TransactionListBlock.es.js";
33
+ import { useTransactionDetailsPrepare as c } from "../actionBlocks/TransactionDetailsBlock/useTransactionDetailsPrepare.es.js";
34
+ import { TransactionHistoryBlock as G } from "../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js";
35
+ import { useRecurringTransactionPrepare as l } from "../actionBlocks/RecurringTransactionBlock/useRecurringTransactionPrepare.es.js";
36
+ import { RecurringTransactionBlock as U } from "../actionBlocks/RecurringTransactionBlock/RecurringTransactionBlock.es.js";
37
+ import { TransactionListBlock as F } from "../actionBlocks/TransactionListBlock/TransactionListBlock.es.js";
38
38
  import { RemainingCashBlock as H } from "../actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js";
39
39
  import { AmountInputModalBlock as x } from "../actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js";
40
- import { PayoffCalculatorBlock as W, usePayoffCalculatorPrepare as Y } from "../actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js";
40
+ import { EmergencySavingsBlock as Y } from "../actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js";
41
+ import { PayoffCalculatorBlock as V, usePayoffCalculatorPrepare as W } from "../actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js";
41
42
  var a = (t) => {
42
43
  }, r = (t) => ({
43
44
  get Component() {
@@ -52,39 +53,39 @@ var a = (t) => {
52
53
  get presentation() {
53
54
  return t().presentation;
54
55
  }
55
- }), Eo = {
56
+ }), vo = {
56
57
  [o.PLACEHOLDER_ACTION_BLOCK]: r(() => ({
57
- Component: E,
58
+ Component: y,
58
59
  usePrepare: a,
59
60
  title: () => "Action Block Layer Drilldown"
60
61
  })),
61
62
  [o.MAKE_TRANSFER_ACTION_BLOCK]: r(() => ({
62
63
  Component: v,
63
64
  usePrepare: a,
64
- title: y
65
+ title: K
65
66
  })),
66
67
  [o.TRANSCATION_HISTORY_ACTION_BLOCK]: r(() => ({
67
- Component: U,
68
+ Component: G,
68
69
  usePrepare: a,
69
70
  title: M
70
71
  })),
71
72
  [o.TRANSACTION_DETAILS_ACTION_BLOCK]: r(() => ({
72
73
  Component: w,
73
- usePrepare: n,
74
+ usePrepare: c,
74
75
  title: () => "Transaction Details"
75
76
  })),
76
77
  [o.RECURRING_TRANSACTION_ACTION_BLOCK]: r(() => ({
77
- Component: F,
78
- usePrepare: c,
78
+ Component: U,
79
+ usePrepare: l,
79
80
  title: (t, e) => e.recurring?.expense_details ?? ""
80
81
  })),
81
82
  [o.REMAINING_CASH_ACTION_BLOCK]: r(() => ({
82
83
  Component: H,
83
- usePrepare: c,
84
+ usePrepare: l,
84
85
  title: (t, e) => e.insights_feed?.remaining_cash?.title ?? ""
85
86
  })),
86
87
  [o.CONTACT_SUPPORT_ACTION_BLOCK]: r(() => ({
87
- Component: m,
88
+ Component: p,
88
89
  usePrepare: a,
89
90
  title: (t, e) => e.help?.request_support ?? ""
90
91
  })),
@@ -94,39 +95,44 @@ var a = (t) => {
94
95
  presentation: "modal"
95
96
  })),
96
97
  [o.CONNECTION_DETAIL_ACTION_BLOCK]: r(() => ({
97
- Component: S,
98
+ Component: D,
98
99
  usePrepare: a,
99
100
  title: (t, e) => e.insights_feed?.connection_details?.connection_details_drawer_title ?? ""
100
101
  })),
101
102
  [o.CONNECT_WIDGET_ACTION_BLOCK]: r(() => ({
102
- Component: R,
103
+ Component: E,
103
104
  usePrepare: a
104
105
  })),
105
106
  [o.SURVEY_MODAL_ACTION_BLOCK]: r(() => ({
106
- Component: K,
107
+ Component: R,
107
108
  usePrepare: a,
108
109
  presentation: "modal"
109
110
  })),
110
111
  [o.TRANSACTION_LIST_ACTION_BLOCK]: r(() => ({
111
- Component: G,
112
- usePrepare: n,
113
- title: (t, e, l) => l?.insights_payload?.title ?? ""
112
+ Component: F,
113
+ usePrepare: c,
114
+ title: (t, e, i) => i?.insights_payload?.title ?? ""
114
115
  })),
115
116
  [o.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: r(() => ({
116
117
  Component: x,
117
118
  presentation: "modal",
118
119
  usePrepare: a
119
120
  })),
121
+ [o.EMERGENCY_SAVINGS_ACTION_BLOCK]: r(() => ({
122
+ Component: Y,
123
+ usePrepare: a,
124
+ title: (t, e, i) => i?.insights_payload?.title ?? ""
125
+ })),
120
126
  [o.PAYOFF_CALCULATOR_ACTION_BLOCK]: r(() => ({
121
- Component: W,
122
- usePrepare: Y,
127
+ Component: V,
128
+ usePrepare: W,
123
129
  title: (t, e) => e.insights_feed?.payoff_calculator?.title ?? ""
124
130
  }))
125
- }, yo = {
131
+ }, Mo = {
126
132
  account_block: u,
127
133
  account_switch_block: f,
128
134
  direct_deposit_block: B,
129
- bar_chart_block: p,
135
+ bar_chart_block: m,
130
136
  budget_block: A,
131
137
  debts_block: T,
132
138
  donut_chart_block: C,
@@ -134,21 +140,21 @@ var a = (t) => {
134
140
  double_progress_bar_block: k,
135
141
  goals_block: O,
136
142
  image_block: L,
137
- no_spend_days_block: b,
138
- repeating_transaction_block: i,
139
- save_extra_block: N,
140
- savings_opportunity_block: d,
143
+ no_spend_days_block: N,
144
+ repeating_transaction_block: n,
145
+ save_extra_block: b,
146
+ savings_opportunity_block: g,
141
147
  step_chart_block: s,
142
- svg_image_block: D,
143
- upcoming_bill_block: i,
148
+ svg_image_block: S,
149
+ upcoming_bill_block: n,
144
150
  upcoming_subscription_block: I,
145
151
  withdrawal_block: P,
146
- transaction_block: g
152
+ transaction_block: d
147
153
  };
148
154
  export {
149
- Eo as actionBlocks,
150
- yo as blocks,
151
- j as hasDrawerBlock
155
+ vo as actionBlocks,
156
+ Mo as blocks,
157
+ z as hasDrawerBlock
152
158
  };
153
159
 
154
160
  //# sourceMappingURL=blocks.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"blocks.es.js","names":[],"sources":["../../../src/insights-v2/mappings/blocks.ts"],"sourcesContent":["import {\n AccountBlock,\n AccountSwitchBlock,\n BarchartBlock,\n BudgetBlock,\n DebtsBlock,\n DetailedAccountBlock,\n DonutChartBlock,\n GoalsBlock,\n DoubleBarChartBlock,\n DoubleProgressBarBlock,\n NoSpendDaysBlock,\n RepeatingTransactionBlock,\n SaveExtraBlock,\n SavingsOpportunityBlock,\n SVGImageBlock,\n UpcomingSubscriptionBlock,\n WithdrawalBlock,\n TransactionBlock,\n} from '../blocks'\nimport StepChartBlock from '../blocks/ChartBlocks/StepChartBlock'\nimport ImageBlock from '../blocks/ImageBlocks/ImageBlock'\n\nimport type { Beat, GlobalCopy, InsightsPayload } from '../../core'\nimport { ContactSupportActionBlock } from '../actionBlocks/ContactSupportActionBlock'\nimport { FeedbackModalActionBlock } from '../actionBlocks/FeedbackModalActionBlock'\nimport { ConnectionDetailActionBlock } from '../actionBlocks/ConnectionDetailActionBlock'\nimport { ConnectWidgetActionBlock } from '../actionBlocks/ConnectWidgetActionBlock'\nimport { SurveyModalActionBlock } from '../actionBlocks/SurveyModalActionBlock'\nimport { PlaceholderActionBlock } from '../actionBlocks/PlaceholderActionBlock'\nimport { MakeTransferActionBlockLayer } from '../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer'\nimport { getMakeTransferDrawerTitle } from '../actionBlocks/MakeTransferActionBlock/layout'\nimport { TransactionHistoryBlock } from '../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock'\nimport { getDrawerHeaderTitle } from '../actionBlocks/TransactionHistoryBlock/utils'\nimport {\n TransactionDetailsBlock,\n useTransactionDetailsPrepare,\n} from '../actionBlocks/TransactionDetailsBlock'\nimport {\n RecurringTransactionBlock,\n useRecurringTransactionPrepare,\n} from '../actionBlocks/RecurringTransactionBlock'\nimport { TransactionListBlock } from '../actionBlocks/TransactionListBlock'\nimport { RemainingCashBlock } from '../actionBlocks/RemainingCashBlock'\nimport { AmountInputModalBlock } from '../actionBlocks/AmountInputModalBlock'\nimport {\n PayoffCalculatorBlock,\n usePayoffCalculatorPrepare,\n} from '../actionBlocks/PayoffCalculatorBlock'\n// Keys live in ./actionBlocksKey (imported directly by chart blocks/tests too) to avoid a\n// circular import between this module and the chart blocks — see that file for details.\nimport { actionBlocksKey } from './actionBlocksKey'\n\n// Drilldown indexes are not passed down: action blocks read them from\n// InsightsV2Store (useInsightsV2Store().actionDrawer).\nexport interface ActionBlockProps {\n beat: Beat\n}\n\nconst noop = (_: ActionBlockProps) => {}\n\n// Re-exported so existing `hasDrawerBlock` imports from this module keep working.\nexport { hasDrawerBlock } from './hasDrawerBlock'\n\nexport interface ActionBlockEntry {\n Component: React.ComponentType<ActionBlockProps>\n usePrepare: (props: ActionBlockProps) => void // required; default to noop in each entry\n // Resolves the drawer title from the clicked CTA's variant + copy, with the beat available\n // for blocks that title from beat fields (e.g. transaction-list reads insights_payload.title).\n // Falls back to the CTA label when the resolver returns an empty string / is absent.\n title?: (variant: string | null | undefined, copy: GlobalCopy, beat?: Beat) => string\n // 'drawer' (default) or 'modal' (component renders its own dialog, no Drawer wrapper).\n presentation?: 'drawer' | 'modal'\n}\n\n// Registry of drawer drilldowns, keyed by the `block` name the backend sends Add\n// `usePrepare` when the block needs to load data before rendering.\n\n/**\n * A registry entry whose fields read their imports when used, not when this module loads. Some\n * registered blocks render `TransactionDetails`, whose embedded card mounts `ActionBlockLayer`,\n * which imports this registry: when one of those blocks loads first, its own import is not\n * initialised yet while this module evaluates, so a value copied at load would be `undefined`\n * (or throw under native ES modules). Reading on access sees the finished import.\n */\nconst liveEntry = (resolve: () => ActionBlockEntry): ActionBlockEntry => ({\n get Component() {\n return resolve().Component\n },\n get usePrepare() {\n return resolve().usePrepare\n },\n get title() {\n return resolve().title\n },\n get presentation() {\n return resolve().presentation\n },\n})\n\nexport const actionBlocks = {\n [actionBlocksKey.PLACEHOLDER_ACTION_BLOCK]: liveEntry(() => ({\n Component: PlaceholderActionBlock,\n usePrepare: noop,\n title: () => 'Action Block Layer Drilldown',\n })),\n [actionBlocksKey.MAKE_TRANSFER_ACTION_BLOCK]: liveEntry(() => ({\n Component: MakeTransferActionBlockLayer,\n usePrepare: noop,\n title: getMakeTransferDrawerTitle,\n })),\n [actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionHistoryBlock,\n usePrepare: noop,\n title: getDrawerHeaderTitle,\n })),\n [actionBlocksKey.TRANSACTION_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionDetailsBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: () => 'Transaction Details',\n })),\n // Expense Details for one recurring subscription. Which subscription a beat names is resolved in\n // `RecurringTransactionBlock/subscriptionBeats.ts`, not through this registry.\n [actionBlocksKey.RECURRING_TRANSACTION_ACTION_BLOCK]: liveEntry(() => ({\n Component: RecurringTransactionBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.recurring?.expense_details ?? '',\n })),\n // Remaining Cash for the Payday Cash Left Over Status beat. Store-driven: reuses the recurring\n // loader, which also loads accounts and categories, so CashflowStore's computeds are ready.\n [actionBlocksKey.REMAINING_CASH_ACTION_BLOCK]: liveEntry(() => ({\n Component: RemainingCashBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.insights_feed?.remaining_cash?.title ?? '',\n })),\n // The block renders its own drawer (the help module's RequestSupport) on top of the action\n // drawer, so the action drawer's title is the CTA label.\n [actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK]: liveEntry(() => ({\n Component: ContactSupportActionBlock,\n usePrepare: noop,\n title: (_variant, copy) => copy.help?.request_support ?? '',\n })),\n [actionBlocksKey.FEEDBACK_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: FeedbackModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.CONNECTION_DETAIL_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectionDetailActionBlock,\n usePrepare: noop,\n title: (_variant, copy) =>\n copy.insights_feed?.connection_details?.connection_details_drawer_title ?? '',\n })),\n // Boots MX's Connect widget (web-widget-sdk iframe) inside the action\n // drawer; the drawer title falls back to the CTA label.\n [actionBlocksKey.CONNECT_WIDGET_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectWidgetActionBlock,\n usePrepare: noop,\n })),\n [actionBlocksKey.SURVEY_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: SurveyModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.TRANSACTION_LIST_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionListBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n })),\n // One whole-dollar setting in a dialog; the CTA variant picks which (low-balance threshold or\n // safety net). A modal: no drawer, so no drawer title.\n [actionBlocksKey.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: AmountInputModalBlock,\n presentation: 'modal',\n // Loads inside the block: it mounts only while open, so mounting is the open-time load.\n usePrepare: noop,\n })),\n // Monthly Credit Card Interest Summary's \"Learn how to save\": the credit card payoff calculator.\n [actionBlocksKey.PAYOFF_CALCULATOR_ACTION_BLOCK]: liveEntry(() => ({\n Component: PayoffCalculatorBlock,\n usePrepare: usePayoffCalculatorPrepare,\n title: (_variant, copy) => copy.insights_feed?.payoff_calculator?.title ?? '',\n })),\n} as Record<string, ActionBlockEntry>\n\nexport const blocks = {\n account_block: AccountBlock,\n account_switch_block: AccountSwitchBlock,\n direct_deposit_block: DetailedAccountBlock,\n bar_chart_block: BarchartBlock,\n budget_block: BudgetBlock,\n debts_block: DebtsBlock,\n donut_chart_block: DonutChartBlock,\n double_bar_chart_block: DoubleBarChartBlock,\n double_progress_bar_block: DoubleProgressBarBlock,\n goals_block: GoalsBlock,\n image_block: ImageBlock,\n no_spend_days_block: NoSpendDaysBlock,\n repeating_transaction_block: RepeatingTransactionBlock,\n save_extra_block: SaveExtraBlock,\n savings_opportunity_block: SavingsOpportunityBlock,\n step_chart_block: StepChartBlock,\n svg_image_block: SVGImageBlock,\n upcoming_bill_block: RepeatingTransactionBlock,\n upcoming_subscription_block: UpcomingSubscriptionBlock,\n withdrawal_block: WithdrawalBlock,\n transaction_block: TransactionBlock,\n} as Record<string, React.ComponentType<{ payload: InsightsPayload; beatGuid?: string }>>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DA,IAAM,IAAA,CAAQ,MAAwB;AAAC,GA0BjC,IAAA,CAAa,OAAuD;AAAA,EACxE,IAAI,YAAY;AACd,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,aAAa;AACf,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,QAAQ;AACV,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,eAAe;AACjB,WAAO,EAAQ,EAAE;AAAA,EACnB;AACF,IAEa,KAAe;AAAA,EACzB,CAAA,EAAgB,wBAAA,GAA2B,EAAA,OAAiB;AAAA,IAC3D,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,MAAa;AAAA,EACf,EAAE;AAAA,EACD,CAAA,EAAgB,0BAAA,GAA6B,EAAA,OAAiB;AAAA,IAC7D,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO;AAAA,EACT,EAAE;AAAA,EACD,CAAA,EAAgB,gCAAA,GAAmC,EAAA,OAAiB;AAAA,IACnE,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO;AAAA,EACT,EAAE;AAAA,EACD,CAAA,EAAgB,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AA,CAAQ,GAAU,GAAO,MAAS,GAAM,kBAAkB,SAAS;AAAA,EACrE,EAAE;AAAA,EAGD,CAAA,EAAgB,+BAAA,GAAkC,EAAA,OAAiB;AAAA,IAClE,WAAW;AAAA,IACX,cAAc;AAAA,IAEd,YAAY;AAAA,EACd,EAAE;AAAA,EAED,CAAA,EAAgB,8BAAA,GAAiC,EAAA,OAAiB;AAAA,IACjE,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,CAAQ,GAAU,MAAS,EAAK,eAAe,mBAAmB,SAAS;AAAA,EAC7E,EAAE;AACJ,GAEa,KAAS;AAAA,EACpB,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,aAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,wBAAwB;AAAA,EACxB,2BAA2B;AAAA,EAC3B,aAAa;AAAA,EACb,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,kBAAkB;AAAA,EAClB,2BAA2B;AAAA,EAC3B,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,kBAAkB;AAAA,EAClB,mBAAmB;AACrB"}
1
+ {"version":3,"file":"blocks.es.js","names":[],"sources":["../../../src/insights-v2/mappings/blocks.ts"],"sourcesContent":["import {\n AccountBlock,\n AccountSwitchBlock,\n BarchartBlock,\n BudgetBlock,\n DebtsBlock,\n DetailedAccountBlock,\n DonutChartBlock,\n GoalsBlock,\n DoubleBarChartBlock,\n DoubleProgressBarBlock,\n NoSpendDaysBlock,\n RepeatingTransactionBlock,\n SaveExtraBlock,\n SavingsOpportunityBlock,\n SVGImageBlock,\n UpcomingSubscriptionBlock,\n WithdrawalBlock,\n TransactionBlock,\n} from '../blocks'\nimport StepChartBlock from '../blocks/ChartBlocks/StepChartBlock'\nimport ImageBlock from '../blocks/ImageBlocks/ImageBlock'\n\nimport type { Beat, GlobalCopy, InsightsPayload } from '../../core'\nimport { ContactSupportActionBlock } from '../actionBlocks/ContactSupportActionBlock'\nimport { FeedbackModalActionBlock } from '../actionBlocks/FeedbackModalActionBlock'\nimport { ConnectionDetailActionBlock } from '../actionBlocks/ConnectionDetailActionBlock'\nimport { ConnectWidgetActionBlock } from '../actionBlocks/ConnectWidgetActionBlock'\nimport { SurveyModalActionBlock } from '../actionBlocks/SurveyModalActionBlock'\nimport { PlaceholderActionBlock } from '../actionBlocks/PlaceholderActionBlock'\nimport { MakeTransferActionBlockLayer } from '../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer'\nimport { getMakeTransferDrawerTitle } from '../actionBlocks/MakeTransferActionBlock/layout'\nimport { TransactionHistoryBlock } from '../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock'\nimport { getDrawerHeaderTitle } from '../actionBlocks/TransactionHistoryBlock/utils'\nimport {\n TransactionDetailsBlock,\n useTransactionDetailsPrepare,\n} from '../actionBlocks/TransactionDetailsBlock'\nimport {\n RecurringTransactionBlock,\n useRecurringTransactionPrepare,\n} from '../actionBlocks/RecurringTransactionBlock'\nimport { TransactionListBlock } from '../actionBlocks/TransactionListBlock'\nimport { RemainingCashBlock } from '../actionBlocks/RemainingCashBlock'\nimport { AmountInputModalBlock } from '../actionBlocks/AmountInputModalBlock'\nimport { EmergencySavingsBlock } from '../actionBlocks/EmergencySavingsBlock'\nimport {\n PayoffCalculatorBlock,\n usePayoffCalculatorPrepare,\n} from '../actionBlocks/PayoffCalculatorBlock'\n// Keys live in ./actionBlocksKey (imported directly by chart blocks/tests too) to avoid a\n// circular import between this module and the chart blocks — see that file for details.\nimport { actionBlocksKey } from './actionBlocksKey'\n\n// Drilldown indexes are not passed down: action blocks read them from\n// InsightsV2Store (useInsightsV2Store().actionDrawer).\nexport interface ActionBlockProps {\n beat: Beat\n}\n\nconst noop = (_: ActionBlockProps) => {}\n\n// Re-exported so existing `hasDrawerBlock` imports from this module keep working.\nexport { hasDrawerBlock } from './hasDrawerBlock'\n\nexport interface ActionBlockEntry {\n Component: React.ComponentType<ActionBlockProps>\n usePrepare: (props: ActionBlockProps) => void // required; default to noop in each entry\n // Resolves the drawer title from the clicked CTA's variant + copy, with the beat available\n // for blocks that title from beat fields (e.g. transaction-list reads insights_payload.title).\n // Falls back to the CTA label when the resolver returns an empty string / is absent.\n title?: (variant: string | null | undefined, copy: GlobalCopy, beat?: Beat) => string\n // 'drawer' (default) or 'modal' (component renders its own dialog, no Drawer wrapper).\n presentation?: 'drawer' | 'modal'\n}\n\n// Registry of drawer drilldowns, keyed by the `block` name the backend sends Add\n// `usePrepare` when the block needs to load data before rendering.\n\n/**\n * A registry entry whose fields read their imports when used, not when this module loads. Some\n * registered blocks render `TransactionDetails`, whose embedded card mounts `ActionBlockLayer`,\n * which imports this registry: when one of those blocks loads first, its own import is not\n * initialised yet while this module evaluates, so a value copied at load would be `undefined`\n * (or throw under native ES modules). Reading on access sees the finished import.\n */\nconst liveEntry = (resolve: () => ActionBlockEntry): ActionBlockEntry => ({\n get Component() {\n return resolve().Component\n },\n get usePrepare() {\n return resolve().usePrepare\n },\n get title() {\n return resolve().title\n },\n get presentation() {\n return resolve().presentation\n },\n})\n\nexport const actionBlocks = {\n [actionBlocksKey.PLACEHOLDER_ACTION_BLOCK]: liveEntry(() => ({\n Component: PlaceholderActionBlock,\n usePrepare: noop,\n title: () => 'Action Block Layer Drilldown',\n })),\n [actionBlocksKey.MAKE_TRANSFER_ACTION_BLOCK]: liveEntry(() => ({\n Component: MakeTransferActionBlockLayer,\n usePrepare: noop,\n title: getMakeTransferDrawerTitle,\n })),\n [actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionHistoryBlock,\n usePrepare: noop,\n title: getDrawerHeaderTitle,\n })),\n [actionBlocksKey.TRANSACTION_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionDetailsBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: () => 'Transaction Details',\n })),\n // Expense Details for one recurring subscription. Which subscription a beat names is resolved in\n // `RecurringTransactionBlock/subscriptionBeats.ts`, not through this registry.\n [actionBlocksKey.RECURRING_TRANSACTION_ACTION_BLOCK]: liveEntry(() => ({\n Component: RecurringTransactionBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.recurring?.expense_details ?? '',\n })),\n // Remaining Cash for the Payday Cash Left Over Status beat. Store-driven: reuses the recurring\n // loader, which also loads accounts and categories, so CashflowStore's computeds are ready.\n [actionBlocksKey.REMAINING_CASH_ACTION_BLOCK]: liveEntry(() => ({\n Component: RemainingCashBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.insights_feed?.remaining_cash?.title ?? '',\n })),\n // The block renders its own drawer (the help module's RequestSupport) on top of the action\n // drawer, so the action drawer's title is the CTA label.\n [actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK]: liveEntry(() => ({\n Component: ContactSupportActionBlock,\n usePrepare: noop,\n title: (_variant, copy) => copy.help?.request_support ?? '',\n })),\n [actionBlocksKey.FEEDBACK_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: FeedbackModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.CONNECTION_DETAIL_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectionDetailActionBlock,\n usePrepare: noop,\n title: (_variant, copy) =>\n copy.insights_feed?.connection_details?.connection_details_drawer_title ?? '',\n })),\n // Boots MX's Connect widget (web-widget-sdk iframe) inside the action\n // drawer; the drawer title falls back to the CTA label.\n [actionBlocksKey.CONNECT_WIDGET_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectWidgetActionBlock,\n usePrepare: noop,\n })),\n [actionBlocksKey.SURVEY_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: SurveyModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.TRANSACTION_LIST_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionListBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n })),\n // One whole-dollar setting in a dialog; the CTA variant picks which (low-balance threshold or\n // safety net). A modal: no drawer, so no drawer title.\n [actionBlocksKey.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: AmountInputModalBlock,\n presentation: 'modal',\n // Loads inside the block: it mounts only while open, so mounting is the open-time load.\n usePrepare: noop,\n })),\n [actionBlocksKey.EMERGENCY_SAVINGS_ACTION_BLOCK]: liveEntry(() => ({\n Component: EmergencySavingsBlock,\n usePrepare: noop,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n })),\n // Monthly Credit Card Interest Summary's \"Learn how to save\": the credit card payoff calculator.\n [actionBlocksKey.PAYOFF_CALCULATOR_ACTION_BLOCK]: liveEntry(() => ({\n Component: PayoffCalculatorBlock,\n usePrepare: usePayoffCalculatorPrepare,\n title: (_variant, copy) => copy.insights_feed?.payoff_calculator?.title ?? '',\n })),\n} as Record<string, ActionBlockEntry>\n\nexport const blocks = {\n account_block: AccountBlock,\n account_switch_block: AccountSwitchBlock,\n direct_deposit_block: DetailedAccountBlock,\n bar_chart_block: BarchartBlock,\n budget_block: BudgetBlock,\n debts_block: DebtsBlock,\n donut_chart_block: DonutChartBlock,\n double_bar_chart_block: DoubleBarChartBlock,\n double_progress_bar_block: DoubleProgressBarBlock,\n goals_block: GoalsBlock,\n image_block: ImageBlock,\n no_spend_days_block: NoSpendDaysBlock,\n repeating_transaction_block: RepeatingTransactionBlock,\n save_extra_block: SaveExtraBlock,\n savings_opportunity_block: SavingsOpportunityBlock,\n step_chart_block: StepChartBlock,\n svg_image_block: SVGImageBlock,\n upcoming_bill_block: RepeatingTransactionBlock,\n upcoming_subscription_block: UpcomingSubscriptionBlock,\n withdrawal_block: WithdrawalBlock,\n transaction_block: TransactionBlock,\n} as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AiB;AAAA,IACjE,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,CAAQ,GAAU,MAAS,EAAK,eAAe,mBAAmB,SAAS;AAAA,EAC7E,EAAE;AACJ,GAEa,KAAS;AAAA,EACpB,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,aAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,wBAAwB;AAAA,EACxB,2BAA2B;AAAA,EAC3B,aAAa;AAAA,EACb,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,kBAAkB;AAAA,EAClB,2BAA2B;AAAA,EAC3B,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,kBAAkB;AAAA,EAClB,mBAAmB;AACrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "9.7.30",
3
+ "version": "9.7.31",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",