@mx-cartographer/experiences 9.7.54 → 9.7.56

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 (24) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/core/types/Insights.d.ts +13 -5
  3. package/dist/core/types/Insights.es.js.map +1 -1
  4. package/dist/core/types/localization/InsightsFeedCopy.d.ts +7 -0
  5. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +100 -100
  6. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
  7. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +63 -43
  8. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
  9. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +2 -3
  10. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js +25 -20
  11. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
  12. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js +45 -29
  13. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js.map +1 -1
  14. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.d.ts +18 -0
  15. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js +81 -0
  16. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js.map +1 -0
  17. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.d.ts +33 -0
  18. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js +37 -0
  19. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js.map +1 -0
  20. package/dist/insights-v2/actionBlocks/util.es.js +14 -6
  21. package/dist/insights-v2/actionBlocks/util.es.js.map +1 -1
  22. package/dist/insights-v2/mappings/blocks.es.js +83 -82
  23. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  24. package/package.json +1 -1
@@ -0,0 +1,18 @@
1
+ import { InsightsFeedCopy } from '../../../core/types/localization';
2
+ import { TransactionListSummary } from './layout';
3
+ export interface TransactionListSummaryCardProps {
4
+ summary: TransactionListSummary;
5
+ /** Rendered in the pill; the block passes the resolved row count. */
6
+ count: number;
7
+ copy: Pick<InsightsFeedCopy['general'], 'transaction_count' | 'transaction_count_one'>;
8
+ }
9
+ /**
10
+ * Summary header for the Transaction List drawer: a white card with a themed icon tile, the date
11
+ * range, the headline amount, and a `{count} transactions` pill. Driven by the beat's summary
12
+ * figures (see `readSummary` in layout.ts). Theme-aware tokens keep it correct in dark mode.
13
+ *
14
+ * Figma: Drilldown | Replenish Savings ("Savings Withdrawal"). The card is shared by every beat on
15
+ * the `summary_header` variant, so the tile carries a neutral receipt rather than that beat's icon.
16
+ */
17
+ export declare const TransactionListSummaryCard: ({ summary, count, copy, }: TransactionListSummaryCardProps) => import("react/jsx-runtime").JSX.Element;
18
+ export default TransactionListSummaryCard;
@@ -0,0 +1,81 @@
1
+ import { buildPluralCopy as d } from "../../../core/utils/Localization.es.js";
2
+ import { DATE_FORMATS_INTL as s, formatDate as f } from "../../../core/constants/DateFormats.es.js";
3
+ import { formatCurrency as x } from "../../../core/utils/NumberFormatting.es.js";
4
+ import { getLogoElevation as h } from "../../components/logoShadow.es.js";
5
+ import e from "@mui/material/Stack";
6
+ import { Text as n } from "@mxenabled/mxui";
7
+ import { Icon as u } from "@mxenabled/mx-icons";
8
+ import { jsx as r, jsxs as p } from "react/jsx-runtime";
9
+ import { alpha as l } from "@mui/material/styles";
10
+ import c from "@mui/material/Box";
11
+ var g = "_1{count} transactions", _ = "_1{count} transaction", b = (o, a) => [o, a].filter((t) => t !== void 0).map((t) => f(t, s.MONTH_DAY)).join(" – "), L = ({ summary: o, count: a, copy: t }) => {
12
+ const m = b(o.startDate, o.endDate);
13
+ return /* @__PURE__ */ r(c, {
14
+ sx: {
15
+ px: 24,
16
+ pt: 24,
17
+ pb: 12
18
+ },
19
+ children: /* @__PURE__ */ p(e, {
20
+ sx: {
21
+ bgcolor: "background.paper",
22
+ borderRadius: "8px",
23
+ boxShadow: h,
24
+ gap: 11,
25
+ p: 16
26
+ },
27
+ children: [/* @__PURE__ */ p(e, {
28
+ sx: {
29
+ alignItems: "center",
30
+ flexDirection: "row",
31
+ gap: 12
32
+ },
33
+ children: [/* @__PURE__ */ r(c, {
34
+ sx: {
35
+ alignItems: "center",
36
+ bgcolor: (i) => l(i.palette.primary.main, 0.15),
37
+ borderRadius: "4px",
38
+ color: "primary.main",
39
+ display: "flex",
40
+ height: 56,
41
+ justifyContent: "center",
42
+ width: 56
43
+ },
44
+ children: /* @__PURE__ */ r(u, {
45
+ "aria-hidden": !0,
46
+ fill: !0,
47
+ name: "receipt",
48
+ size: 32
49
+ })
50
+ }), /* @__PURE__ */ p(e, { children: [m && /* @__PURE__ */ r(n, {
51
+ color: "text.secondary",
52
+ variant: "caption",
53
+ children: m
54
+ }), /* @__PURE__ */ r(n, {
55
+ bold: !0,
56
+ component: "p",
57
+ variant: "h1",
58
+ children: x(o.amount, "0,0.00")
59
+ })] })]
60
+ }), /* @__PURE__ */ r(c, {
61
+ sx: {
62
+ bgcolor: (i) => l(i.palette.primary.main, 0.15),
63
+ borderRadius: "999px",
64
+ px: 12,
65
+ py: 2
66
+ },
67
+ children: /* @__PURE__ */ r(n, {
68
+ color: "primary.dark",
69
+ variant: "caption",
70
+ children: d(t.transaction_count_one ?? _, t.transaction_count ?? g, a, String(a))
71
+ })
72
+ })]
73
+ })
74
+ });
75
+ };
76
+ export {
77
+ L as TransactionListSummaryCard,
78
+ L as default
79
+ };
80
+
81
+ //# sourceMappingURL=TransactionListSummaryCard.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TransactionListSummaryCard.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { alpha } from '@mui/material/styles'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { Text } from '@mxenabled/mxui'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../../../core/constants'\nimport type { InsightsFeedCopy } from '../../../core/types/localization'\nimport { buildPluralCopy } from '../../../core/utils/Localization'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { getLogoElevation } from '../../components/logoShadow'\n\nimport type { TransactionListSummary } from './layout'\n\nexport interface TransactionListSummaryCardProps {\n summary: TransactionListSummary\n /** Rendered in the pill; the block passes the resolved row count. */\n count: number\n copy: Pick<InsightsFeedCopy['general'], 'transaction_count' | 'transaction_count_one'>\n}\n\n// Until the localized-content service ships the pill copy.\nconst DEFAULT_COUNT_COPY = '_1{count} transactions'\nconst DEFAULT_COUNT_ONE_COPY = '_1{count} transaction'\n\n// Endpoints are already validated `Date`s from `readSummary` (invalid/junk omitted there).\nconst formatRange = (start?: Date, end?: Date): string =>\n [start, end]\n .filter((d): d is Date => d !== undefined)\n .map((d) => formatDate(d, DATE_FORMATS_INTL.MONTH_DAY))\n .join(' – ')\n\n/**\n * Summary header for the Transaction List drawer: a white card with a themed icon tile, the date\n * range, the headline amount, and a `{count} transactions` pill. Driven by the beat's summary\n * figures (see `readSummary` in layout.ts). Theme-aware tokens keep it correct in dark mode.\n *\n * Figma: Drilldown | Replenish Savings (\"Savings Withdrawal\"). The card is shared by every beat on\n * the `summary_header` variant, so the tile carries a neutral receipt rather than that beat's icon.\n */\nexport const TransactionListSummaryCard = ({\n summary,\n count,\n copy,\n}: TransactionListSummaryCardProps) => {\n const dateRange = formatRange(summary.startDate, summary.endDate)\n\n return (\n <Box sx={{ px: 24, pt: 24, pb: 12 }}>\n <Stack\n sx={{\n bgcolor: 'background.paper',\n borderRadius: '8px',\n boxShadow: getLogoElevation,\n gap: 11,\n p: 16,\n }}\n >\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 12 }}>\n <Box\n sx={{\n alignItems: 'center',\n bgcolor: (theme) => alpha(theme.palette.primary.main, 0.15),\n borderRadius: '4px',\n color: 'primary.main',\n display: 'flex',\n height: 56,\n justifyContent: 'center',\n width: 56,\n }}\n >\n <Icon aria-hidden={true} fill={true} name=\"receipt\" size={32} />\n </Box>\n <Stack>\n {dateRange && (\n <Text color=\"text.secondary\" variant=\"caption\">\n {dateRange}\n </Text>\n )}\n <Text bold={true} component=\"p\" variant=\"h1\">\n {formatCurrency(summary.amount, '0,0.00')}\n </Text>\n </Stack>\n </Stack>\n\n <Box\n sx={{\n bgcolor: (theme) => alpha(theme.palette.primary.main, 0.15),\n borderRadius: '999px',\n px: 12,\n py: 2,\n }}\n >\n <Text color=\"primary.dark\" variant=\"caption\">\n {\n buildPluralCopy(\n copy.transaction_count_one ?? DEFAULT_COUNT_ONE_COPY,\n copy.transaction_count ?? DEFAULT_COUNT_COPY,\n count,\n String(count),\n ) as string\n }\n </Text>\n </Box>\n </Stack>\n </Box>\n )\n}\n\nexport default TransactionListSummaryCard\n"],"mappings":";;;;;;;;;;AAuBA,IAAM,IAAqB,0BACrB,IAAyB,yBAGzB,IAAA,CAAe,GAAc,MACjC,CAAC,GAAO,CAAG,EACR,OAAA,CAAQ,MAAiB,MAAM,MAAS,EACxC,IAAA,CAAK,MAAM,EAAW,GAAG,EAAkB,SAAS,CAAC,EACrD,KAAK,KAAK,GAUF,IAAA,CAA8B,EACzC,SAAA,GACA,OAAA,GACA,MAAA,EAAA,MACqC;AACrC,QAAM,IAAY,EAAY,EAAQ,WAAW,EAAQ,OAAO;AAEhE,SACE,gBAAA,EAAC,GAAD;AAAA,IAAK,IAAI;AAAA,MAAE,IAAI;AAAA,MAAI,IAAI;AAAA,MAAI,IAAI;AAAA,IAAG;AAAA,IAChC,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,SAAS;AAAA,QACT,cAAc;AAAA,QACd,WAAW;A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AK,CACd;AAAA,QAEE,CAAA;AAAA,MACH,CAAA,CACA;AAAA;EACJ,CAAA;AAET"}
@@ -0,0 +1,33 @@
1
+ import { Beat, GlobalCopy, InDescriptionCTA, PrimaryCTA, SecondaryCTA } from '../../../core';
2
+ type DrilldownCta = PrimaryCTA | SecondaryCTA | InDescriptionCTA;
3
+ /** The CTA variant that opens the summary-header drilldown. */
4
+ export declare const SUMMARY_HEADER_VARIANT = "summary_header";
5
+ /**
6
+ * Drawer title: the beat's own localized title, whatever the variant. A variant names a layout the
7
+ * drawer shares between beats (Replenish Savings' "Savings Withdrawal" and Weekly New Merchants'
8
+ * "Purchases for review" both open `summary_header`), so no variant carries one beat's title.
9
+ */
10
+ export declare const getTransactionListDrawerTitle: (_variant: string | null | undefined, _copy: GlobalCopy, beat?: Beat) => string;
11
+ export interface TransactionListSummary {
12
+ /** Headline figure (e.g. total withdrawn). */
13
+ amount: number;
14
+ /** Validated range endpoints; rendered as `{start} – {end}`. Omitted when the payload value is
15
+ * missing or unparseable (so the drawer never crashes on an Invalid Date). */
16
+ startDate?: Date;
17
+ endDate?: Date;
18
+ /** Transaction count for the pill; the block falls back to the resolved rows' length. */
19
+ count?: number;
20
+ }
21
+ /**
22
+ * Summary-header figures for the drawer, read from the clicked CTA's `drilldown_data` (the backend
23
+ * hangs a drilldown's own data off the CTA that opens it). Fails closed throughout: only the
24
+ * `summary_header` variant renders a header (so figures from a different CTA that `getDynamicCta…`
25
+ * fell back to can't be misattributed), then without a finite `amount` there is still no header, and
26
+ * each date is validated to a real `Date` or dropped — an unparseable value never reaches
27
+ * `formatDate` (which throws on an Invalid Date).
28
+ *
29
+ * `drilldown_data` fields: `amount` (number), `start_date`/`end_date` (unix seconds|ms or ISO),
30
+ * `count` (number).
31
+ */
32
+ export declare const readSummary: (cta: DrilldownCta | undefined) => TransactionListSummary | undefined;
33
+ export {};
@@ -0,0 +1,37 @@
1
+ import { parseISO as i } from "date-fns/parseISO";
2
+ var _ = "summary_header", c = (t, e, r) => r?.insights_payload?.title || "", a = (t) => typeof t == "number" && Number.isFinite(t) ? t : void 0, s = Date.UTC(2e3, 0, 1), d = Date.UTC(2100, 0, 1), m = (t) => typeof t == "number" && Number.isInteger(t) && t >= 0 ? t : void 0, o = (t, e) => {
3
+ if (t == null || t === "") return;
4
+ let r;
5
+ if (typeof t == "number" && Number.isFinite(t)) r = t < 1e12 ? t * 1e3 : t;
6
+ else if (typeof t == "string") {
7
+ const n = i(t).getTime();
8
+ r = Number.isNaN(n) ? void 0 : n;
9
+ }
10
+ if (r === void 0 || r < s || r > d) {
11
+ console.warn(`[TransactionListBlock] drilldown_data.${e} is unparseable or out of range (${typeof t})`);
12
+ return;
13
+ }
14
+ return new Date(r);
15
+ }, u = (t) => {
16
+ if (t?.variant !== "summary_header") return;
17
+ const e = t?.drilldown_data;
18
+ if (!e) return;
19
+ const r = a(e.amount);
20
+ if (r === void 0) {
21
+ Object.keys(e).length > 0 && console.warn("[TransactionListBlock] drilldown_data has no finite `amount` — no summary header.");
22
+ return;
23
+ }
24
+ return {
25
+ amount: r,
26
+ startDate: o(e.start_date, "start_date"),
27
+ endDate: o(e.end_date, "end_date"),
28
+ count: m(e.count)
29
+ };
30
+ };
31
+ export {
32
+ _ as SUMMARY_HEADER_VARIANT,
33
+ c as getTransactionListDrawerTitle,
34
+ u as readSummary
35
+ };
36
+
37
+ //# sourceMappingURL=layout.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/layout.ts"],"sourcesContent":["import { parseISO } from 'date-fns/parseISO'\n\nimport type { Beat, GlobalCopy, InDescriptionCTA, PrimaryCTA, SecondaryCTA } from '../../../core'\n\ntype DrilldownCta = PrimaryCTA | SecondaryCTA | InDescriptionCTA\n\n/** The CTA variant that opens the summary-header drilldown. */\nexport const SUMMARY_HEADER_VARIANT = 'summary_header'\n\n/**\n * Drawer title: the beat's own localized title, whatever the variant. A variant names a layout the\n * drawer shares between beats (Replenish Savings' \"Savings Withdrawal\" and Weekly New Merchants'\n * \"Purchases for review\" both open `summary_header`), so no variant carries one beat's title.\n */\nexport const getTransactionListDrawerTitle = (\n _variant: string | null | undefined,\n _copy: GlobalCopy,\n beat?: Beat,\n): string => beat?.insights_payload?.title || ''\n\nexport interface TransactionListSummary {\n /** Headline figure (e.g. total withdrawn). */\n amount: number\n /** Validated range endpoints; rendered as `{start} – {end}`. Omitted when the payload value is\n * missing or unparseable (so the drawer never crashes on an Invalid Date). */\n startDate?: Date\n endDate?: Date\n /** Transaction count for the pill; the block falls back to the resolved rows' length. */\n count?: number\n}\n\nconst toFiniteNumber = (value: unknown): number | undefined =>\n typeof value === 'number' && Number.isFinite(value) ? value : undefined\n\n// Sane epoch window so a bad/typo payload can't render a far-past/future date.\nconst EPOCH_MIN = Date.UTC(2000, 0, 1)\nconst EPOCH_MAX = Date.UTC(2100, 0, 1)\n\n/**\n * Parse a payload date value to a validated `Date`, or `undefined`. Accepts unix seconds or\n * milliseconds (auto-detected) and ISO strings. Fails closed (no throw): an unparseable or\n * out-of-range value returns undefined and warns, so `formatDate`/`intlFormat` never sees an Invalid\n * Date (which throws `RangeError` and takes down the whole drawer render).\n */\nconst toCount = (value: unknown): number | undefined =>\n typeof value === 'number' && Number.isInteger(value) && value >= 0 ? value : undefined\n\nconst toDate = (value: unknown, field: string): Date | undefined => {\n // Missing/empty is a normal \"no range\" case — return quietly, don't warn.\n if (value === undefined || value === null || value === '') return undefined\n\n let ms: number | undefined\n if (typeof value === 'number' && Number.isFinite(value)) {\n // < 1e12 is treated as seconds (1e12 ms is year 33658). Trade-off: genuine ms timestamps from\n // ~2000-2001 would be misread as seconds and fall outside the window below (dropped, not shown).\n ms = value < 1e12 ? value * 1000 : value\n } else if (typeof value === 'string') {\n const parsed = parseISO(value).getTime()\n ms = Number.isNaN(parsed) ? undefined : parsed\n }\n\n if (ms === undefined || ms < EPOCH_MIN || ms > EPOCH_MAX) {\n console.warn(\n `[TransactionListBlock] drilldown_data.${field} is unparseable or out of range (${typeof value})`,\n )\n return undefined\n }\n return new Date(ms)\n}\n\n/**\n * Summary-header figures for the drawer, read from the clicked CTA's `drilldown_data` (the backend\n * hangs a drilldown's own data off the CTA that opens it). Fails closed throughout: only the\n * `summary_header` variant renders a header (so figures from a different CTA that `getDynamicCta…`\n * fell back to can't be misattributed), then without a finite `amount` there is still no header, and\n * each date is validated to a real `Date` or dropped — an unparseable value never reaches\n * `formatDate` (which throws on an Invalid Date).\n *\n * `drilldown_data` fields: `amount` (number), `start_date`/`end_date` (unix seconds|ms or ISO),\n * `count` (number).\n */\nexport const readSummary = (cta: DrilldownCta | undefined): TransactionListSummary | undefined => {\n // Defense-in-depth on financial figures: only the summary-header variant shows the card.\n if (cta?.variant !== SUMMARY_HEADER_VARIANT) return undefined\n\n const source = cta?.drilldown_data\n if (!source) return undefined\n\n const amount = toFiniteNumber(source.amount)\n if (amount === undefined) {\n // `drilldown_data` present but no usable amount -> surface the likely contract drift (field\n // rename) instead of a silently missing header.\n if (Object.keys(source).length > 0) {\n console.warn(\n '[TransactionListBlock] drilldown_data has no finite `amount` — no summary header.',\n )\n }\n return undefined\n }\n\n return {\n amount,\n startDate: toDate(source.start_date, 'start_date'),\n endDate: toDate(source.end_date, 'end_date'),\n count: toCount(source.count),\n }\n}\n"],"mappings":";AAOA,IAAa,IAAyB,kBAOzB,IAAA,CACX,GACA,GACA,MACW,GAAM,kBAAkB,SAAS,IAaxC,IAAA,CAAkB,MACtB,OAAO,KAAU,YAAY,OAAO,SAAS,CAAK,IAAI,IAAQ,QAG1D,IAAY,KAAK,IAAI,KAAM,GAAG,CAAC,GAC/B,IAAY,KAAK,IAAI,MAAM,GAAG,CAAC,GAQ/B,IAAA,CAAW,MACf,OAAO,KAAU,YAAY,OAAO,UAAU,CAAK,KAAK,KAAS,IAAI,IAAQ,QAEzE,IAAA,CAAU,GAAgB,MAAoC;AAElE,MAA2B,KAAU,QAAQ,MAAU,GAAI;AAE3D,MAAI;AACJ,MAAI,OAAO,KAAU,YAAY,OAAO,SAAS,CAAK,EAGpD,CAAA,IAAK,IAAQ,OAAO,IAAQ,MAAO;AAAA,WAC1B,OAAO,KAAU,UAAU;AACpC,UAAM,IAAS,EAAS,CAAK,EAAE,QAAQ;AACvC,IAAA,IAAK,OAAO,MAAM,CAAM,IAAI,SAAY;AAAA,EAC1C;AAEA,MAAI,MAAO,UAAa,IAAK,KAAa,IAAK,GAAW;AACxD,YAAQ,KACN,yCAAyC,CAAA,oCAAyC,OAAO,CAAA,GAC3F;AACA;AAAA,EACF;AACA,SAAO,IAAI,KAAK,CAAE;AACpB,GAaa,IAAA,CAAe,MAAsE;AAEhG,MAAI,GAAK,YAAA,iBAAoC;AAE7C,QAAM,IAAS,GAAK;AACpB,MAAI,CAAC,EAAQ;AAEb,QAAM,IAAS,EAAe,EAAO,MAAM;AAC3C,MAAI,MAAW,QAAW;AAGxB,IAAI,OAAO,KAAK,CAAM,EAAE,SAAS,KAC/B,QAAQ,KACN,mFACF;AAEF;AAAA,EACF;AAEA,SAAO;AAAA,IACL,QAAA;AAAA,IACA,WAAW,EAAO,EAAO,YAAY,YAAY;AAAA,IACjD,SAAS,EAAO,EAAO,UAAU,UAAU;AAAA,IAC3C,OAAO,EAAQ,EAAO,KAAK;AAAA,EAC7B;AACF"}
@@ -1,10 +1,18 @@
1
- var C = (t, e, r) => t.context?.block === e?.block ? e : r, n = (t, e, r, g) => t.trigger === "inDescriptionCta" ? t.cta ? {
2
- label: "",
3
- ...t.cta
4
- } : g : t.trigger === "secondaryCta" ? r ?? e : t.trigger === "primaryCta" ? e : C(t, e, r) ?? e;
1
+ var n = (t, r, e) => t.context?.block === r?.block ? r : e, u = (t, r, e, g) => {
2
+ if (t.trigger === "inDescriptionCta") {
3
+ if (!t.cta) return g;
4
+ const { drilldown_data: l } = g ?? {};
5
+ return {
6
+ label: "",
7
+ ...l && { drilldown_data: l },
8
+ ...t.cta
9
+ };
10
+ }
11
+ return t.trigger === "secondaryCta" ? e ?? r : t.trigger === "primaryCta" ? r : n(t, r, e) ?? r;
12
+ };
5
13
  export {
6
- C as getCtaForChartBarClick,
7
- n as getDynamicCtaBasedOnTriggers
14
+ n as getCtaForChartBarClick,
15
+ u as getDynamicCtaBasedOnTriggers
8
16
  };
9
17
 
10
18
  //# sourceMappingURL=util.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"util.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/util.ts"],"sourcesContent":["import type {\n ActionDrawerState,\n DrilldownPayload,\n InDescriptionCTA,\n PrimaryCTA,\n SecondaryCTA,\n} from '../../core'\n\n/**\n * A chart-bar drilldown's context carries which block it targets (see BarchartBlock /\n * DoubleBarChartBlock), since either CTA could in principle open the same drawer. Match that\n * against `primary_cta.block`; anything else is assumed to be the secondary CTA's block.\n */\nexport const getCtaForChartBarClick = (\n actionDrawer: ActionDrawerState,\n primary_cta: PrimaryCTA | undefined,\n secondary_cta: SecondaryCTA | undefined,\n): PrimaryCTA | SecondaryCTA | undefined => {\n const context = actionDrawer.context as DrilldownPayload | undefined\n const blockName = context?.block\n\n if (blockName === primary_cta?.block) {\n return primary_cta\n }\n return secondary_cta\n}\n\n/**\n * Resolves which CTA (primary/secondary/in-description) drives the currently open drawer's\n * title/variant, based on what triggered it. Falls back to `primary_cta` whenever resolution comes\n * up empty (e.g. a `secondaryCta` trigger with no configured secondary CTA), so callers never have\n * to null-check.\n */\nexport const getDynamicCtaBasedOnTriggers = (\n actionDrawer: ActionDrawerState,\n primary_cta: PrimaryCTA | undefined,\n secondary_cta: SecondaryCTA | undefined,\n in_description_cta?: InDescriptionCTA,\n): PrimaryCTA | SecondaryCTA | InDescriptionCTA | undefined => {\n // The opener may supply the block and variant, else the beat's link names them. Nothing to fall\n // back to: only the link's own button fires this trigger.\n if (actionDrawer.trigger === 'inDescriptionCta') {\n return actionDrawer.cta ? { label: '', ...actionDrawer.cta } : in_description_cta\n }\n if (actionDrawer.trigger === 'secondaryCta') {\n return secondary_cta ?? primary_cta\n }\n if (actionDrawer.trigger === 'primaryCta') {\n return primary_cta\n }\n return getCtaForChartBarClick(actionDrawer, primary_cta, secondary_cta) ?? primary_cta\n}\n"],"mappings":"AAaA,IAAa,IAAA,CACX,GACA,GACA,MAEgB,EAAa,SACF,UAET,GAAa,QACtB,IAEF,GASI,IAAA,CACX,GACA,GACA,GACA,MAII,EAAa,YAAY,qBACpB,EAAa,MAAM;AAAA,EAAE,OAAO;AAAA,EAAI,GAAG,EAAa;AAAI,IAAI,IAE7D,EAAa,YAAY,iBACpB,KAAiB,IAEtB,EAAa,YAAY,eACpB,IAEF,EAAuB,GAAc,GAAa,CAAa,KAAK"}
1
+ {"version":3,"file":"util.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/util.ts"],"sourcesContent":["import type {\n ActionDrawerState,\n DrilldownPayload,\n InDescriptionCTA,\n PrimaryCTA,\n SecondaryCTA,\n} from '../../core'\n\n/**\n * A chart-bar drilldown's context carries which block it targets (see BarchartBlock /\n * DoubleBarChartBlock), since either CTA could in principle open the same drawer. Match that\n * against `primary_cta.block`; anything else is assumed to be the secondary CTA's block.\n */\nexport const getCtaForChartBarClick = (\n actionDrawer: ActionDrawerState,\n primary_cta: PrimaryCTA | undefined,\n secondary_cta: SecondaryCTA | undefined,\n): PrimaryCTA | SecondaryCTA | undefined => {\n const context = actionDrawer.context as DrilldownPayload | undefined\n const blockName = context?.block\n\n if (blockName === primary_cta?.block) {\n return primary_cta\n }\n return secondary_cta\n}\n\n/**\n * Resolves which CTA (primary/secondary/in-description) drives the currently open drawer's\n * title/variant, based on what triggered it. Falls back to `primary_cta` whenever resolution comes\n * up empty (e.g. a `secondaryCta` trigger with no configured secondary CTA), so callers never have\n * to null-check.\n */\nexport const getDynamicCtaBasedOnTriggers = (\n actionDrawer: ActionDrawerState,\n primary_cta: PrimaryCTA | undefined,\n secondary_cta: SecondaryCTA | undefined,\n in_description_cta?: InDescriptionCTA,\n): PrimaryCTA | SecondaryCTA | InDescriptionCTA | undefined => {\n // The opener may supply the block and variant, else the beat's link names them; the link's own\n // drilldown figures travel with either. Nothing to fall back to: only the link's own button fires\n // this trigger.\n if (actionDrawer.trigger === 'inDescriptionCta') {\n if (!actionDrawer.cta) return in_description_cta\n const { drilldown_data } = in_description_cta ?? {}\n return { label: '', ...(drilldown_data && { drilldown_data }), ...actionDrawer.cta }\n }\n if (actionDrawer.trigger === 'secondaryCta') {\n return secondary_cta ?? primary_cta\n }\n if (actionDrawer.trigger === 'primaryCta') {\n return primary_cta\n }\n return getCtaForChartBarClick(actionDrawer, primary_cta, secondary_cta) ?? primary_cta\n}\n"],"mappings":"AAaA,IAAa,IAAA,CACX,GACA,GACA,MAEgB,EAAa,SACF,UAET,GAAa,QACtB,IAEF,GASI,IAAA,CACX,GACA,GACA,GACA,MAC6D;AAI7D,MAAI,EAAa,YAAY,oBAAoB;AAC/C,QAAI,CAAC,EAAa,IAAK,QAAO;AAC9B,UAAM,EAAE,gBAAA,EAAA,IAAmB,KAAsB,CAAC;AAClD,WAAO;AAAA,MAAE,OAAO;AAAA,MAAI,GAAI,KAAkB,EAAE,gBAAA,EAAe;AAAA,MAAI,GAAG,EAAa;AAAA,IAAI;AAAA,EACrF;AACA,SAAI,EAAa,YAAY,iBACpB,KAAiB,IAEtB,EAAa,YAAY,eACpB,IAEF,EAAuB,GAAc,GAAa,CAAa,KAAK;AAC7E"}
@@ -1,16 +1,16 @@
1
- import { ContactSupportActionBlock as p } from "../actionBlocks/ContactSupportActionBlock.es.js";
2
- import { hasDrawerBlock as ao } from "./hasDrawerBlock.es.js";
3
- import { actionBlocksKey as t } from "./actionBlocksKey.es.js";
4
- import { BarchartBlock as m } from "../blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js";
1
+ import { ContactSupportActionBlock as m } from "../actionBlocks/ContactSupportActionBlock.es.js";
2
+ import { hasDrawerBlock as no } from "./hasDrawerBlock.es.js";
3
+ import { actionBlocksKey as o } from "./actionBlocksKey.es.js";
4
+ import { BarchartBlock as p } 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";
8
8
  import u from "../blocks/ChartBlocks/DoubleProgressBarBlock/DoubleProgressBarBlock.es.js";
9
9
  import B from "../blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js";
10
10
  import k from "../blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js";
11
- import A from "../blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js";
11
+ import T from "../blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js";
12
12
  import { BudgetBlock as f } from "../blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
13
- import T from "../blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js";
13
+ import A from "../blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js";
14
14
  import O from "../blocks/ComponentBlocks/GoalsBlock/GoalsBlock.es.js";
15
15
  import d from "../blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js";
16
16
  import N from "../blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendDaysBlock.es.js";
@@ -24,9 +24,9 @@ import D from "../blocks/ImageBlocks/ImageBlock.es.js";
24
24
  import { SVGImageBlock as h } from "../blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
25
25
  import { FeedbackModalActionBlock as S } from "../actionBlocks/FeedbackModalActionBlock.es.js";
26
26
  import { ConnectionDetailActionBlock as E } from "../actionBlocks/ConnectionDetailActionBlock.es.js";
27
- import { ConnectWidgetActionBlock as v } from "../actionBlocks/ConnectWidgetActionBlock.es.js";
28
- import { SurveyModalActionBlock as K } from "../actionBlocks/SurveyModalActionBlock.es.js";
29
- import { PlaceholderActionBlock as R } from "../actionBlocks/PlaceholderActionBlock.es.js";
27
+ import { ConnectWidgetActionBlock as K } from "../actionBlocks/ConnectWidgetActionBlock.es.js";
28
+ import { SurveyModalActionBlock as R } from "../actionBlocks/SurveyModalActionBlock.es.js";
29
+ import { PlaceholderActionBlock as v } from "../actionBlocks/PlaceholderActionBlock.es.js";
30
30
  import { getMakeTransferDrawerTitle as y } from "../actionBlocks/MakeTransferActionBlock/layout.es.js";
31
31
  import { MakeTransferActionBlockLayer as M } from "../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js";
32
32
  import { getDrawerHeaderTitle as U } from "../actionBlocks/TransactionHistoryBlock/utils.es.js";
@@ -36,21 +36,22 @@ import { TransactionHistoryBlock as G } from "../actionBlocks/TransactionHistory
36
36
  import { useTransactionHistoryPrepare as F } from "../actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js";
37
37
  import { useRecurringTransactionPrepare as l } from "../actionBlocks/RecurringTransactionBlock/useRecurringTransactionPrepare.es.js";
38
38
  import { RecurringTransactionBlock as H } from "../actionBlocks/RecurringTransactionBlock/RecurringTransactionBlock.es.js";
39
- import { TransactionListBlock as x } from "../actionBlocks/TransactionListBlock/TransactionListBlock.es.js";
40
- import { RemainingCashBlock as V } from "../actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js";
41
- import { AmountInputModalBlock as Y } from "../actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js";
42
- import { OverdraftBlock as z, useOverdraftPrepare as W } from "../actionBlocks/OverdraftBlock/OverdraftBlock.es.js";
43
- import { AccountListBlock as q } from "../actionBlocks/AccountListBlock/AccountListBlock.es.js";
44
- import { useAccountListPrepare as Z } from "../actionBlocks/AccountListBlock/useAccountListPrepare.es.js";
45
- import { EmergencySavingsBlock as j } from "../actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js";
46
- import { CreditUtilizationBlock as J } from "../actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js";
47
- import { useCreditUtilizationPrepare as Q } from "../actionBlocks/CreditUtilizationBlock/useCreditUtilizationPrepare.es.js";
48
- import { PayoffCalculatorBlock as X, usePayoffCalculatorPrepare as $ } from "../actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js";
49
- import { BudgetDetailsBlock as oo } from "../actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js";
50
- import { AccountDetailsBlock as to } from "../actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js";
51
- import { useAccountDetailsPrepare as ro } from "../actionBlocks/AccountDetailsBlock/useAccountDetailsPrepare.es.js";
39
+ import { getTransactionListDrawerTitle as x } from "../actionBlocks/TransactionListBlock/layout.es.js";
40
+ import { TransactionListBlock as V } from "../actionBlocks/TransactionListBlock/TransactionListBlock.es.js";
41
+ import { RemainingCashBlock as Y } from "../actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js";
42
+ import { AmountInputModalBlock as z } from "../actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js";
43
+ import { OverdraftBlock as W, useOverdraftPrepare as q } from "../actionBlocks/OverdraftBlock/OverdraftBlock.es.js";
44
+ import { AccountListBlock as Z } from "../actionBlocks/AccountListBlock/AccountListBlock.es.js";
45
+ import { useAccountListPrepare as j } from "../actionBlocks/AccountListBlock/useAccountListPrepare.es.js";
46
+ import { EmergencySavingsBlock as J } from "../actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js";
47
+ import { CreditUtilizationBlock as Q } from "../actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js";
48
+ import { useCreditUtilizationPrepare as X } from "../actionBlocks/CreditUtilizationBlock/useCreditUtilizationPrepare.es.js";
49
+ import { PayoffCalculatorBlock as $, usePayoffCalculatorPrepare as oo } from "../actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js";
50
+ import { BudgetDetailsBlock as to } from "../actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js";
51
+ import { AccountDetailsBlock as ro } from "../actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js";
52
+ import { useAccountDetailsPrepare as eo } from "../actionBlocks/AccountDetailsBlock/useAccountDetailsPrepare.es.js";
52
53
  var i = (e) => {
53
- }, r = (e) => ({
54
+ }, t = (e) => ({
54
55
  get Component() {
55
56
  return e().Component;
56
57
  },
@@ -63,113 +64,113 @@ var i = (e) => {
63
64
  get presentation() {
64
65
  return e().presentation;
65
66
  }
66
- }), rt = {
67
- [t.PLACEHOLDER_ACTION_BLOCK]: r(() => ({
68
- Component: R,
67
+ }), it = {
68
+ [o.PLACEHOLDER_ACTION_BLOCK]: t(() => ({
69
+ Component: v,
69
70
  usePrepare: i,
70
71
  title: () => "Action Block Layer Drilldown"
71
72
  })),
72
- [t.MAKE_TRANSFER_ACTION_BLOCK]: r(() => ({
73
+ [o.MAKE_TRANSFER_ACTION_BLOCK]: t(() => ({
73
74
  Component: M,
74
75
  usePrepare: i,
75
76
  title: y
76
77
  })),
77
- [t.TRANSCATION_HISTORY_ACTION_BLOCK]: r(() => ({
78
+ [o.TRANSCATION_HISTORY_ACTION_BLOCK]: t(() => ({
78
79
  Component: G,
79
80
  usePrepare: F,
80
81
  title: U
81
82
  })),
82
- [t.TRANSACTION_DETAILS_ACTION_BLOCK]: r(() => ({
83
+ [o.TRANSACTION_DETAILS_ACTION_BLOCK]: t(() => ({
83
84
  Component: w,
84
85
  usePrepare: c,
85
86
  title: () => "Transaction Details"
86
87
  })),
87
- [t.RECURRING_TRANSACTION_ACTION_BLOCK]: r(() => ({
88
+ [o.RECURRING_TRANSACTION_ACTION_BLOCK]: t(() => ({
88
89
  Component: H,
89
90
  usePrepare: l,
90
- title: (e, o) => o.recurring?.expense_details ?? ""
91
+ title: (e, r) => r.recurring?.expense_details ?? ""
91
92
  })),
92
- [t.REMAINING_CASH_ACTION_BLOCK]: r(() => ({
93
- Component: V,
93
+ [o.REMAINING_CASH_ACTION_BLOCK]: t(() => ({
94
+ Component: Y,
94
95
  usePrepare: l,
95
- title: (e, o) => o.insights_feed?.remaining_cash?.title ?? ""
96
+ title: (e, r) => r.insights_feed?.remaining_cash?.title ?? ""
96
97
  })),
97
- [t.CONTACT_SUPPORT_ACTION_BLOCK]: r(() => ({
98
- Component: p,
98
+ [o.CONTACT_SUPPORT_ACTION_BLOCK]: t(() => ({
99
+ Component: m,
99
100
  usePrepare: i,
100
- title: (e, o) => o.help?.request_support ?? ""
101
+ title: (e, r) => r.help?.request_support ?? ""
101
102
  })),
102
- [t.FEEDBACK_MODAL_ACTION_BLOCK]: r(() => ({
103
+ [o.FEEDBACK_MODAL_ACTION_BLOCK]: t(() => ({
103
104
  Component: S,
104
105
  usePrepare: i,
105
106
  presentation: "modal"
106
107
  })),
107
- [t.CONNECTION_DETAIL_ACTION_BLOCK]: r(() => ({
108
+ [o.CONNECTION_DETAIL_ACTION_BLOCK]: t(() => ({
108
109
  Component: E,
109
110
  usePrepare: i,
110
- title: (e, o) => o.insights_feed?.connection_details?.connection_details_drawer_title ?? ""
111
+ title: (e, r) => r.insights_feed?.connection_details?.connection_details_drawer_title ?? ""
111
112
  })),
112
- [t.CONNECT_WIDGET_ACTION_BLOCK]: r(() => ({
113
- Component: v,
113
+ [o.CONNECT_WIDGET_ACTION_BLOCK]: t(() => ({
114
+ Component: K,
114
115
  usePrepare: i
115
116
  })),
116
- [t.SURVEY_MODAL_ACTION_BLOCK]: r(() => ({
117
- Component: K,
117
+ [o.SURVEY_MODAL_ACTION_BLOCK]: t(() => ({
118
+ Component: R,
118
119
  usePrepare: i,
119
120
  presentation: "modal"
120
121
  })),
121
- [t.TRANSACTION_LIST_ACTION_BLOCK]: r(() => ({
122
- Component: x,
122
+ [o.TRANSACTION_LIST_ACTION_BLOCK]: t(() => ({
123
+ Component: V,
123
124
  usePrepare: c,
124
- title: (e, o, a) => a?.insights_payload?.title ?? ""
125
+ title: x
125
126
  })),
126
- [t.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: r(() => ({
127
- Component: Y,
127
+ [o.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: t(() => ({
128
+ Component: z,
128
129
  presentation: "modal",
129
130
  usePrepare: i
130
131
  })),
131
- [t.OVERDRAFT_ACTION_BLOCK]: r(() => ({
132
- Component: z,
133
- usePrepare: W,
134
- title: (e, o, a) => a?.insights_payload?.title ?? ""
132
+ [o.OVERDRAFT_ACTION_BLOCK]: t(() => ({
133
+ Component: W,
134
+ usePrepare: q,
135
+ title: (e, r, a) => a?.insights_payload?.title ?? ""
135
136
  })),
136
- [t.CREDIT_UTILIZATION_ACTION_BLOCK]: r(() => ({
137
- Component: J,
138
- usePrepare: Q,
139
- title: (e, o) => o.insights_feed?.credit_utilization?.title ?? ""
137
+ [o.CREDIT_UTILIZATION_ACTION_BLOCK]: t(() => ({
138
+ Component: Q,
139
+ usePrepare: X,
140
+ title: (e, r) => r.insights_feed?.credit_utilization?.title ?? ""
140
141
  })),
141
- [t.EMERGENCY_SAVINGS_ACTION_BLOCK]: r(() => ({
142
- Component: j,
142
+ [o.EMERGENCY_SAVINGS_ACTION_BLOCK]: t(() => ({
143
+ Component: J,
143
144
  usePrepare: i,
144
- title: (e, o, a) => a?.insights_payload?.title ?? ""
145
+ title: (e, r, a) => a?.insights_payload?.title ?? ""
145
146
  })),
146
- [t.PAYOFF_CALCULATOR_ACTION_BLOCK]: r(() => ({
147
- Component: X,
148
- usePrepare: $,
149
- title: (e, o) => o.insights_feed?.payoff_calculator?.title ?? ""
147
+ [o.PAYOFF_CALCULATOR_ACTION_BLOCK]: t(() => ({
148
+ Component: $,
149
+ usePrepare: oo,
150
+ title: (e, r) => r.insights_feed?.payoff_calculator?.title ?? ""
150
151
  })),
151
- [t.BUDGET_DETAILS_ACTION_BLOCK]: r(() => ({
152
- Component: oo,
152
+ [o.BUDGET_DETAILS_ACTION_BLOCK]: t(() => ({
153
+ Component: to,
153
154
  usePrepare: i,
154
- title: (e, o, a) => a?.insights_payload?.title || o.budgets?.details_title || ""
155
+ title: (e, r, a) => a?.insights_payload?.title || r.budgets?.details_title || ""
155
156
  })),
156
- [t.ACCOUNT_DETAILS_ACTION_BLOCK]: r(() => ({
157
- Component: to,
158
- usePrepare: ro,
159
- title: (e, o) => o.accounts?.account_details ?? ""
157
+ [o.ACCOUNT_DETAILS_ACTION_BLOCK]: t(() => ({
158
+ Component: ro,
159
+ usePrepare: eo,
160
+ title: (e, r) => r.accounts?.account_details ?? ""
160
161
  })),
161
- [t.ACCOUNT_LIST_ACTION_BLOCK]: r(() => ({
162
- Component: q,
163
- usePrepare: Z,
164
- title: (e, o) => o.insights_feed?.account_list?.title ?? ""
162
+ [o.ACCOUNT_LIST_ACTION_BLOCK]: t(() => ({
163
+ Component: Z,
164
+ usePrepare: j,
165
+ title: (e, r) => r.insights_feed?.account_list?.title ?? ""
165
166
  }))
166
- }, et = {
167
+ }, at = {
167
168
  account_block: k,
168
- account_switch_block: A,
169
+ account_switch_block: T,
169
170
  direct_deposit_block: B,
170
- bar_chart_block: m,
171
+ bar_chart_block: p,
171
172
  budget_block: f,
172
- debts_block: T,
173
+ debts_block: A,
173
174
  donut_chart_block: C,
174
175
  double_bar_chart_block: _,
175
176
  double_progress_bar_block: u,
@@ -188,9 +189,9 @@ var i = (e) => {
188
189
  transaction_block: L
189
190
  };
190
191
  export {
191
- rt as actionBlocks,
192
- et as blocks,
193
- ao as hasDrawerBlock
192
+ it as actionBlocks,
193
+ at as blocks,
194
+ no as hasDrawerBlock
194
195
  };
195
196
 
196
197
  //# 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 MerchantBlock,\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 { useTransactionHistoryPrepare } from '../actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare'\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 { OverdraftBlock, useOverdraftPrepare } from '../actionBlocks/OverdraftBlock'\nimport { AccountListBlock, useAccountListPrepare } from '../actionBlocks/AccountListBlock'\nimport { EmergencySavingsBlock } from '../actionBlocks/EmergencySavingsBlock'\nimport {\n CreditUtilizationBlock,\n useCreditUtilizationPrepare,\n} from '../actionBlocks/CreditUtilizationBlock'\nimport {\n PayoffCalculatorBlock,\n usePayoffCalculatorPrepare,\n} from '../actionBlocks/PayoffCalculatorBlock'\nimport { BudgetDetailsBlock } from '../actionBlocks/BudgetDetailsBlock'\nimport { AccountDetailsBlock, useAccountDetailsPrepare } from '../actionBlocks/AccountDetailsBlock'\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: useTransactionHistoryPrepare,\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 // Transparent Overdraft's \"Learn more\": the projected overdraft, its account and the confidence\n // meter. Titled from the beat, as the pulse drawer was.\n [actionBlocksKey.OVERDRAFT_ACTION_BLOCK]: liveEntry(() => ({\n Component: OverdraftBlock,\n usePrepare: useOverdraftPrepare,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n })),\n // Credit Utilization's \"Learn more\": donut summary, legend and the per-card list. Loads accounts\n // for the institution logos; the rows themselves ride on the beat.\n [actionBlocksKey.CREDIT_UTILIZATION_ACTION_BLOCK]: liveEntry(() => ({\n Component: CreditUtilizationBlock,\n usePrepare: useCreditUtilizationPrepare,\n title: (_variant, copy) => copy.insights_feed?.credit_utilization?.title ?? '',\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 [actionBlocksKey.BUDGET_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: BudgetDetailsBlock,\n usePrepare: noop,\n title: (_variant, copy, beat) =>\n beat?.insights_payload?.title || copy.budgets?.details_title || '',\n })),\n // The accounts widget's account details (header, trend chart, tabs, connection, actions) for the\n // beat's primary account. Shared by every beat that opens an account.\n [actionBlocksKey.ACCOUNT_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: AccountDetailsBlock,\n usePrepare: useAccountDetailsPrepare,\n title: (_variant, copy) => copy.accounts?.account_details ?? '',\n })),\n // Monthly Obligations Status's account list: the beat's calculation and the accounts behind it.\n [actionBlocksKey.ACCOUNT_LIST_ACTION_BLOCK]: liveEntry(() => ({\n Component: AccountListBlock,\n usePrepare: useAccountListPrepare,\n title: (_variant, copy) => copy.insights_feed?.account_list?.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 merchant_block: MerchantBlock,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,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,gCAAA,GAAmC,EAAA,OAAiB;AAAA,IACnE,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,MAAa;AA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Z,OAAA,CAAQ,GAAU,MAAS,EAAK,eAAe,cAAc,SAAS;AAAA,EACxE,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,gBAAgB;AAAA,EAChB,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 MerchantBlock,\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 { useTransactionHistoryPrepare } from '../actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare'\nimport {\n TransactionDetailsBlock,\n useTransactionDetailsPrepare,\n} from '../actionBlocks/TransactionDetailsBlock'\nimport {\n RecurringTransactionBlock,\n useRecurringTransactionPrepare,\n} from '../actionBlocks/RecurringTransactionBlock'\nimport { TransactionListBlock } from '../actionBlocks/TransactionListBlock'\nimport { getTransactionListDrawerTitle } from '../actionBlocks/TransactionListBlock/layout'\nimport { RemainingCashBlock } from '../actionBlocks/RemainingCashBlock'\nimport { AmountInputModalBlock } from '../actionBlocks/AmountInputModalBlock'\nimport { OverdraftBlock, useOverdraftPrepare } from '../actionBlocks/OverdraftBlock'\nimport { AccountListBlock, useAccountListPrepare } from '../actionBlocks/AccountListBlock'\nimport { EmergencySavingsBlock } from '../actionBlocks/EmergencySavingsBlock'\nimport {\n CreditUtilizationBlock,\n useCreditUtilizationPrepare,\n} from '../actionBlocks/CreditUtilizationBlock'\nimport {\n PayoffCalculatorBlock,\n usePayoffCalculatorPrepare,\n} from '../actionBlocks/PayoffCalculatorBlock'\nimport { BudgetDetailsBlock } from '../actionBlocks/BudgetDetailsBlock'\nimport { AccountDetailsBlock, useAccountDetailsPrepare } from '../actionBlocks/AccountDetailsBlock'\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: useTransactionHistoryPrepare,\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: getTransactionListDrawerTitle,\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 // Transparent Overdraft's \"Learn more\": the projected overdraft, its account and the confidence\n // meter. Titled from the beat, as the pulse drawer was.\n [actionBlocksKey.OVERDRAFT_ACTION_BLOCK]: liveEntry(() => ({\n Component: OverdraftBlock,\n usePrepare: useOverdraftPrepare,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n })),\n // Credit Utilization's \"Learn more\": donut summary, legend and the per-card list. Loads accounts\n // for the institution logos; the rows themselves ride on the beat.\n [actionBlocksKey.CREDIT_UTILIZATION_ACTION_BLOCK]: liveEntry(() => ({\n Component: CreditUtilizationBlock,\n usePrepare: useCreditUtilizationPrepare,\n title: (_variant, copy) => copy.insights_feed?.credit_utilization?.title ?? '',\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 [actionBlocksKey.BUDGET_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: BudgetDetailsBlock,\n usePrepare: noop,\n title: (_variant, copy, beat) =>\n beat?.insights_payload?.title || copy.budgets?.details_title || '',\n })),\n // The accounts widget's account details (header, trend chart, tabs, connection, actions) for the\n // beat's primary account. Shared by every beat that opens an account.\n [actionBlocksKey.ACCOUNT_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: AccountDetailsBlock,\n usePrepare: useAccountDetailsPrepare,\n title: (_variant, copy) => copy.accounts?.account_details ?? '',\n })),\n // Monthly Obligations Status's account list: the beat's calculation and the accounts behind it.\n [actionBlocksKey.ACCOUNT_LIST_ACTION_BLOCK]: liveEntry(() => ({\n Component: AccountListBlock,\n usePrepare: useAccountListPrepare,\n title: (_variant, copy) => copy.insights_feed?.account_list?.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 merchant_block: MerchantBlock,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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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.54",
3
+ "version": "9.7.56",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",