@mx-cartographer/experiences 9.7.77 → 9.7.79

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 (57) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/core/stores/GlobalCopyStore.d.ts +6 -0
  3. package/dist/core/stores/GlobalCopyStore.es.js +14 -8
  4. package/dist/core/stores/GlobalCopyStore.es.js.map +1 -1
  5. package/dist/core/types/localization/InsightsFeedCopy.d.ts +24 -0
  6. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashContent.es.js +1 -1
  7. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashContent.es.js.map +1 -1
  8. package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.d.ts +6 -0
  9. package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +161 -0
  10. package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js.map +1 -0
  11. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.es.js +20 -20
  12. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.es.js.map +1 -1
  13. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.d.ts +2 -2
  14. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js +1 -1
  15. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
  16. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +89 -60
  17. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
  18. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +7 -1
  19. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +11 -6
  20. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
  21. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js +5 -5
  22. package/dist/insights-v2/components/BaseLayout.es.js +106 -105
  23. package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
  24. package/dist/insights-v2/components/CtaStatus.d.ts +5 -1
  25. package/dist/insights-v2/components/CtaStatus.es.js +25 -22
  26. package/dist/insights-v2/components/CtaStatus.es.js.map +1 -1
  27. package/dist/insights-v2/components/SaveAnExtraCard.es.js +5 -4
  28. package/dist/insights-v2/components/SaveAnExtraCard.es.js.map +1 -1
  29. package/dist/insights-v2/components/StatusMessageCard.d.ts +8 -3
  30. package/dist/insights-v2/components/StatusMessageCard.es.js +16 -15
  31. package/dist/insights-v2/components/StatusMessageCard.es.js.map +1 -1
  32. package/dist/insights-v2/components/TransactionListCard.d.ts +5 -1
  33. package/dist/insights-v2/components/TransactionListCard.es.js +61 -45
  34. package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
  35. package/dist/insights-v2/ctaActions/ctaConfig.es.js +35 -14
  36. package/dist/insights-v2/ctaActions/ctaConfig.es.js.map +1 -1
  37. package/dist/insights-v2/ctaActions/subscriptionAnswer.d.ts +9 -1
  38. package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js +62 -57
  39. package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js.map +1 -1
  40. package/dist/insights-v2/ctaActions/types.d.ts +10 -2
  41. package/dist/insights-v2/ctaActions/useCtaAction.d.ts +5 -2
  42. package/dist/insights-v2/ctaActions/useCtaAction.es.js +45 -37
  43. package/dist/insights-v2/ctaActions/useCtaAction.es.js.map +1 -1
  44. package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -0
  45. package/dist/insights-v2/mappings/actionBlocksKey.es.js +1 -0
  46. package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
  47. package/dist/insights-v2/mappings/blocks.es.js +82 -76
  48. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  49. package/dist/microinsights/cards/InsightCard.es.js +92 -83
  50. package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
  51. package/dist/microinsights/cards/MicroCtaStatus.d.ts +18 -0
  52. package/dist/microinsights/cards/MicroCtaStatus.es.js +50 -0
  53. package/dist/microinsights/cards/MicroCtaStatus.es.js.map +1 -0
  54. package/dist/microinsights/stores/CopyStore.d.ts +10 -1
  55. package/dist/microinsights/stores/CopyStore.es.js +20 -11
  56. package/dist/microinsights/stores/CopyStore.es.js.map +1 -1
  57. package/package.json +1 -1
@@ -1,102 +1,131 @@
1
- import { useCategoryStore as L, useGlobalCopyStore as O, useGlobalStore as B } from "../../../../common/context/hooks.es.js";
2
- import { slot as n } from "../../../../core/types/Insights.es.js";
3
- import { formatCurrency as f } from "../../../../core/utils/NumberFormatting.es.js";
4
- import { useBeatActions as k } from "../../../beatActions.es.js";
5
- import { repeatingTransactionOf as z } from "../../../ctaActions/subscriptionAnswer.es.js";
6
- import { logoFromRef as A } from "../../../components/shared/EntityLogo.es.js";
7
- import F from "../../../components/LogoFromGuid.es.js";
8
- import { resolveVariantConfig as M } from "../../resolveVariantConfig.es.js";
9
- import R from "../../../components/TransactionListCard.es.js";
10
- import q from "../../../components/StatusMessageCard.es.js";
11
- import { subscriptionFrequency as E } from "../../../components/SubscriptionStatus/subscriptionFrequency.es.js";
12
- import { getLayoutConfig as N, transactionBlockVariant as V } from "./layout.es.js";
13
- import { observer as Z } from "mobx-react-lite";
14
- import { CategoryIcon as j, InstitutionLogo as w, MerchantLogo as H } from "@mxenabled/mxui";
15
- import { Icon as W } from "@mxenabled/mx-icons";
1
+ import { useCategoryStore as F, useGlobalCopyStore as N, useGlobalStore as M } from "../../../../common/context/hooks.es.js";
2
+ import { slot as a } from "../../../../core/types/Insights.es.js";
3
+ import { formatCurrency as x } from "../../../../core/utils/NumberFormatting.es.js";
4
+ import { useBeatActions as Z } from "../../../beatActions.es.js";
5
+ import { USER_RESPONSE as $, repeatingTransactionOf as j } from "../../../ctaActions/subscriptionAnswer.es.js";
6
+ import { logoFromRef as q } from "../../../components/shared/EntityLogo.es.js";
7
+ import D from "../../../components/LogoFromGuid.es.js";
8
+ import { statusIconName as H, statusIconPalette as b } from "../../../components/statusIcon.es.js";
9
+ import { resolveVariantConfig as P } from "../../resolveVariantConfig.es.js";
10
+ import V from "../../../components/TransactionListCard.es.js";
11
+ import U from "../../../components/StatusMessageCard.es.js";
12
+ import { subscriptionFrequency as W } from "../../../components/SubscriptionStatus/subscriptionFrequency.es.js";
13
+ import { getLayoutConfig as Y, transactionBlockVariant as J } from "./layout.es.js";
14
+ import { observer as K } from "mobx-react-lite";
15
+ import { CategoryIcon as Q, InstitutionLogo as X, MerchantLogo as oo } from "@mxenabled/mxui";
16
+ import { Icon as I } from "@mxenabled/mx-icons";
16
17
  import { jsx as t } from "react/jsx-runtime";
17
- import { useTheme as $ } from "@mui/material/styles";
18
+ import { useTheme as to } from "@mui/material/styles";
18
19
  import u from "@mui/material/Box";
19
- var i = 32, U = Math.round(i * 0.625), D = 20, J = (a, s) => {
20
- const o = A(a.logo, a.primary_text);
20
+ var s = 32, ro = Math.round(s * 0.625), eo = 24, v = 32, no = 20, io = ({ icon: e }) => {
21
+ const n = H(e?.guid);
22
+ return n ? /* @__PURE__ */ t(u, {
23
+ "aria-hidden": !0,
24
+ "data-icon": n,
25
+ "data-testid": "subscription-badge",
26
+ sx: {
27
+ alignItems: "center",
28
+ bgcolor: `${b(e?.color)}.main`,
29
+ borderRadius: "50%",
30
+ display: "flex",
31
+ height: v,
32
+ justifyContent: "center",
33
+ width: v
34
+ },
35
+ children: /* @__PURE__ */ t(I, {
36
+ fill: !0,
37
+ name: n,
38
+ size: no,
39
+ sx: { color: `${b(e?.color)}.contrastText` }
40
+ })
41
+ }) : null;
42
+ }, ao = (e, n) => {
43
+ const o = q(e.logo, e.primary_text);
21
44
  if (o) {
22
45
  if (o.logo_name) return /* @__PURE__ */ t(u, {
23
46
  sx: {
24
47
  alignItems: "center",
25
48
  display: "flex",
26
- height: i,
49
+ height: s,
27
50
  justifyContent: "center",
28
- width: i
51
+ width: s
29
52
  },
30
- children: /* @__PURE__ */ t(W, {
53
+ children: /* @__PURE__ */ t(I, {
31
54
  name: o.logo_name,
32
- size: U,
55
+ size: ro,
33
56
  sx: { color: o.logo_color }
34
57
  })
35
58
  });
36
- if (o.merchant_guid) return /* @__PURE__ */ t(H, {
59
+ if (o.merchant_guid) return /* @__PURE__ */ t(oo, {
37
60
  alt: o.merchant_name ?? "",
38
- categoryGuid: o.category_guid ? s(o.category_guid) : "",
61
+ categoryGuid: o.category_guid ? n(o.category_guid) : "",
39
62
  merchantGuid: o.merchant_guid,
40
- size: i
63
+ size: s
41
64
  });
42
- if (o.institution_guid) return /* @__PURE__ */ t(w, {
65
+ if (o.institution_guid) return /* @__PURE__ */ t(X, {
43
66
  alt: o.institution_name ?? "",
44
67
  institutionGuid: o.institution_guid,
45
- size: i
68
+ size: s
46
69
  });
47
70
  if (o.category_guid) {
48
- const m = s(o.category_guid);
71
+ const c = n(o.category_guid);
49
72
  return /* @__PURE__ */ t(u, {
50
- "data-testid": `category-icon-${m}`,
73
+ "data-testid": `category-icon-${c}`,
51
74
  sx: { display: "flex" },
52
- children: /* @__PURE__ */ t(j, {
53
- categoryGuid: m,
54
- size: i
75
+ children: /* @__PURE__ */ t(Q, {
76
+ categoryGuid: c,
77
+ size: s
55
78
  })
56
79
  });
57
80
  }
58
81
  }
59
- }, lo = Z(({ payload: a }) => {
60
- const s = $(), { getTopLevelCategoryGuid: o } = L(), m = B(), { recurring: l } = O(), { beat: g } = k(), { data: e, variant: p } = a.instance_slot, { background: y, cardVariant: _, showFooter: h, showFrequency: x, showHeader: v, statusMessage: C } = M(N(s), p, V.NoHeader, "TransactionBlock");
61
- if (C) {
62
- const r = n(e, "message");
63
- return typeof r != "string" || !r.trim() ? (console.warn("[TransactionBlock] status_message has no message — rendering nothing."), null) : /* @__PURE__ */ t(q, {
82
+ }, To = K(({ payload: e }) => {
83
+ const n = to(), { getTopLevelCategoryGuid: o } = F(), c = M(), { recurring: S } = N(), { beat: l } = Z(), { data: i, variant: C } = e.instance_slot, { answeredBackground: f, background: m, cardVariant: G, followsSubscription: d, showFooter: E, showFrequency: p, showHeader: T, statusMessage: B, sx: k } = P(Y(n), C, J.NoHeader, "TransactionBlock"), _ = (p || d) && l ? j({
84
+ beat: l,
85
+ stores: c
86
+ }) : void 0, y = !!d && _?.user_response === $.CONFIRMED;
87
+ if (B) {
88
+ const r = a(i, "message");
89
+ return typeof r != "string" || !r.trim() ? (console.warn("[TransactionBlock] status_message has no message — rendering nothing."), null) : /* @__PURE__ */ t(U, {
64
90
  icon: /* @__PURE__ */ t(u, {
65
91
  "aria-hidden": "true",
66
92
  sx: { display: "flex" },
67
- children: /* @__PURE__ */ t(F, {
68
- logo: n(e, "icon"),
69
- size: D
93
+ children: /* @__PURE__ */ t(D, {
94
+ logo: a(i, "icon"),
95
+ size: eo
70
96
  })
71
97
  }),
72
- message: r
98
+ message: r,
99
+ sx: m ? {
100
+ backgroundImage: m,
101
+ bgcolor: "background.paper"
102
+ } : void 0
73
103
  });
74
104
  }
75
- const c = n(e, "series"), d = n(e, "header_text");
76
- if (!Array.isArray(c) || !c.length) return null;
77
- const G = v && typeof d == "string" ? d : void 0, I = n(e, "footer_text"), T = n(e, "footer_amount"), b = h ? {
78
- label: I,
79
- amount: f(T, "0,0.00")
80
- } : void 0, S = x && g ? E(l, z({
81
- beat: g,
82
- stores: m
83
- })) : void 0;
84
- return /* @__PURE__ */ t(R, {
85
- background: y,
86
- footer: b,
87
- header: G,
88
- variant: _,
89
- rows: c.map((r) => ({
90
- amount: typeof r.amount == "number" ? f(r.amount, "0,0.00") : "",
91
- amountCaption: S,
92
- leading: J(r, o),
105
+ const g = a(i, "series"), h = a(i, "header_text");
106
+ if (!Array.isArray(g) || !g.length) return null;
107
+ const L = T && typeof h == "string" ? h : void 0, O = a(i, "footer_text"), R = a(i, "footer_amount"), A = E ? {
108
+ label: O,
109
+ amount: x(R, "0,0.00")
110
+ } : void 0, w = p ? W(S, _) : void 0, z = d ? /* @__PURE__ */ t(io, { icon: a(i, y ? "reviewed_icon" : "icon") }) : void 0;
111
+ return /* @__PURE__ */ t(V, {
112
+ background: y && f ? f : m,
113
+ badge: z,
114
+ footer: A,
115
+ header: L,
116
+ sx: k,
117
+ variant: G,
118
+ rows: g.map((r) => ({
119
+ amount: typeof r.amount == "number" ? x(r.amount, "0,0.00") : "",
120
+ amountCaption: w,
121
+ leading: ao(r, o),
93
122
  subtitle: r.secondary_text ?? "",
94
123
  title: r.primary_text ?? ""
95
124
  }))
96
125
  });
97
126
  });
98
127
  export {
99
- lo as TransactionBlock
128
+ To as TransactionBlock
100
129
  };
101
130
 
102
131
  //# sourceMappingURL=TransactionBlock.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport { useTheme } from '@mui/material/styles'\n\nimport { CategoryIcon, InstitutionLogo, MerchantLogo } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useCategoryStore, useGlobalCopyStore, useGlobalStore } from '../../../../common'\nimport { slot } from '../../../../core'\nimport type { InsightsPayload, InstanceSlotRow, LogoRef } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport { useBeatActions } from '../../../beatActions'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport StatusMessageCard from '../../../components/StatusMessageCard'\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { logoFromRef } from '../../../components/shared/EntityLogo'\nimport { subscriptionFrequency } from '../../../components/SubscriptionStatus/subscriptionFrequency'\nimport { repeatingTransactionOf } from '../../../ctaActions/subscriptionAnswer'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { getLayoutConfig, transactionBlockVariant } from './layout'\n\ninterface TransactionBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\nconst ROW_LOGO_SIZE = 32\n// Same glyph-to-tile ratio mxui's `CategoryIcon` uses, so a status icon sits like the other logos.\nconst ROW_ICON_SIZE = Math.round(ROW_LOGO_SIZE * 0.625)\nconst STATUS_ICON_SIZE = 20\n\n/**\n * Renders the row's leading logo from its `LogoRef`: a status icon, or an entity guid whose prefix\n * names the entity. An unrecognized prefix renders no logo rather than guessing.\n *\n * `resolveTopLevelCategory`: mxui's `CategoryIcon` only knows the top-level category guids and\n * silently falls back to the Uncategorized icon for a sub-category. The details drawer avoids\n * this by passing `transaction.top_level_category_guid`; the row only has the raw guid, so it is\n * walked up to its parent here (identity until categories load). That applies both to a `CAT-`\n * row logo and to a merchant's `fallback_guid`, which `MerchantLogo` draws through the same\n * `CategoryIcon` when the merchant image fails to load.\n */\nconst renderRowLogo = (row: InstanceSlotRow, resolveTopLevelCategory: (guid: string) => string) => {\n const logo = logoFromRef(row.logo, row.primary_text)\n\n if (!logo) return undefined\n\n if (logo.logo_name) {\n // A fixed box the size of the other logos keeps the row's text column aligned.\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: ROW_LOGO_SIZE,\n justifyContent: 'center',\n width: ROW_LOGO_SIZE,\n }}\n >\n <Icon name={logo.logo_name} size={ROW_ICON_SIZE} sx={{ color: logo.logo_color }} />\n </Box>\n )\n }\n\n if (logo.merchant_guid) {\n return (\n <MerchantLogo\n alt={logo.merchant_name ?? ''}\n categoryGuid={logo.category_guid ? resolveTopLevelCategory(logo.category_guid) : ''}\n merchantGuid={logo.merchant_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.institution_guid) {\n return (\n <InstitutionLogo\n alt={logo.institution_name ?? ''}\n institutionGuid={logo.institution_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.category_guid) {\n const topLevelGuid = resolveTopLevelCategory(logo.category_guid)\n return (\n <Box data-testid={`category-icon-${topLevelGuid}`} sx={{ display: 'flex' }}>\n <CategoryIcon categoryGuid={topLevelGuid} size={ROW_LOGO_SIZE} />\n </Box>\n )\n }\n\n return undefined\n}\n\n/**\n * The `transaction_block`: rows the backend already localized, carried inline on\n * `instance_slot.data.series` (`logo`, `primary_text`, `secondary_text`, `amount`). Only the\n * amount is formatted here, because the contract sends it as a number. `instance_slot.variant`\n * picks the header and slot treatment from `./layout.ts`.\n *\n * This is the full/mini shape. The reduced widgets (micro, embedded) resolve to the row logo\n * alone, carried flat on `data.logo` with no `series`, and are drawn by `CompactInsightCard`.\n *\n * `status_message` draws no rows: `data.message` beside the `data.icon` logo, as a\n * `StatusMessageCard` banner (Uncategorized Transactions V2 `complete`).\n *\n * A header, when the variant shows one, comes from `instance_slot.data.header_text` (the\n * transaction date, or \"{count} transactions\"). It deliberately does *not* come from the first\n * row: on a `with_merchant` card a row's `secondary_text` is the category, so reading it here\n * rendered the category twice and dropped the date entirely.\n *\n * A footer/summary row (Replenish Savings' \"Remaining Balance\") renders under the\n * `with_header_footer` variant, from `data.footer_text` with `data.footer_amount` beside it,\n * formatted like the row amounts (the contract sends it as a number).\n */\nexport const TransactionBlock = observer(({ payload }: TransactionBlockProps) => {\n const theme = useTheme()\n const { getTopLevelCategoryGuid } = useCategoryStore()\n const stores = useGlobalStore()\n const { recurring: recurringCopy } = useGlobalCopyStore()\n const { beat } = useBeatActions()\n const { data, variant } = payload.instance_slot\n // The plain row is the safe default: it adds nothing a wrong variant could misstate.\n const { background, cardVariant, showFooter, showFrequency, showHeader, statusMessage } =\n resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n transactionBlockVariant.NoHeader,\n 'TransactionBlock',\n )\n\n if (statusMessage) {\n const message = slot<string>(data, 'message')\n if (typeof message !== 'string' || !message.trim()) {\n console.warn('[TransactionBlock] status_message has no message — rendering nothing.')\n return null\n }\n\n // The icon only decorates the message, so it is hidden from the status announcement.\n return (\n <StatusMessageCard\n icon={\n <Box aria-hidden=\"true\" sx={{ display: 'flex' }}>\n <LogoFromGuid logo={slot<LogoRef>(data, 'icon')} size={STATUS_ICON_SIZE} />\n </Box>\n }\n message={message}\n />\n )\n }\n\n const series = slot<InstanceSlotRow[]>(data, 'series')\n const headerText = slot<string>(data, 'header_text')\n\n if (!Array.isArray(series) || !series.length) return null\n\n const header = showHeader && typeof headerText === 'string' ? headerText : undefined\n\n const footerText = slot<string>(data, 'footer_text')\n const footerAmount = slot<number>(data, 'footer_amount')\n const footer = showFooter\n ? {\n label: footerText,\n amount: formatCurrency(footerAmount, '0,0.00'),\n }\n : undefined\n\n // Live, as pulse: the repeating transaction the CTA's `prepare` loads.\n const frequency =\n showFrequency && beat\n ? subscriptionFrequency(recurringCopy, repeatingTransactionOf({ beat, stores }))\n : undefined\n\n return (\n <TransactionListCard\n background={background}\n footer={footer}\n header={header}\n variant={cardVariant}\n rows={series.map((row) => ({\n amount: typeof row.amount === 'number' ? formatCurrency(row.amount, '0,0.00') : '',\n amountCaption: frequency,\n leading: renderRowLogo(row, getTopLevelCategoryGuid),\n subtitle: row.secondary_text ?? '',\n title: row.primary_text ?? '',\n }))}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;AA6BA,IAAM,IAAgB,IAEhB,IAAgB,KAAK,MAAM,IAAgB,KAAK,GAChD,IAAmB,IAanB,IAAA,CAAiB,GAAsB,MAAsD;AACjG,QAAM,IAAO,EAAY,EAAI,MAAM,EAAI,YAAY;AAEnD,MAAK,GAEL;AAAA,QAAI,EAAK,UAEP,QACE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,YAAY;AAAA,QACZ,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,gBAAgB;AAAA,QAChB,OAAO;AAAA,MACT;AAAA,MAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM,EAAK;AAAA,QAAW,MAAM;AAAA,QAAe,IAAI,EAAE,OAAO,EAAK,WAAW;AAAA,MAAI,CAAA;AAAA,IAC/E,CAAA;AAIT,QAAI,EAAK,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eAAY;AAAA,QAAO,IAAI,EAAE,SAAS,OAAO;AAAA,QAC5C,UAAA,gBAAA,EAAC,GAAD;AAAA,UAAc,MAAM,EAAc,GAAM,MAAM;AAAA,UAAG,MAAM;AAAA,QAAmB,CAAA;AAAA,MACvE,CAAA;AAAA,MAEE,SAAA;AAAA,IACV,CAAA;AAAA,EAEL;AAEA,QAAM,IAAS,EAAwB,GAAM,QAAQ,GAC/C,IAAa,EAAa,GAAM,aAAa;AAEnD,MAAI,CAAC,MAAM,QAAQ,CAAM,KAAK,CAAC,EAAO,OAAQ,QAAO;AAErD,QAAM,IAAS,KAAc,OAAO,KAAe,WAAW,IAAa,QAErE,IAAa,EAAa,GAAM,aAAa,GAC7C,IAAe,EAAa,GAAM,eAAe,GACjD,IAAS,IACX;AAAA,IACE,OAAO;AAAA,IACP,QAAQ,EAAe,GAAc,QAAQ;AAAA,EAC/C,IACA,QAGE,IACJ,KAAiB,IACb,EAAsB,GAAe,EAAuB;AAAA,IAAE,MAAA;AAAA,IAAM,QAAA;AAAA,EAAO,CAAC,CAAC,IAC7E;AAEN,SACE,gBAAA,EAAC,GAAD;AAAA,IACc,YAAA;AAAA,IACJ,QAAA;AAAA,IACA,QAAA;AAAA,IACR,SAAS;AAAA,IACT,MAAM,EAAO,IAAA,CAAK,OAAS;AAAA,MACzB,QAAQ,OAAO,EAAI,UAAW,WAAW,EAAe,EAAI,QAAQ,QAAQ,IAAI;AAAA,MAChF,eAAe;AAAA,MACf,SAAS,EAAc,GAAK,CAAuB;AAAA,MACnD,UAAU,EAAI,kBAAkB;AAAA,MAChC,OAAO,EAAI,gBAAgB;AAAA,IAC7B,EAAE;AAAA,EACH,CAAA;AAEL,CAAC"}
1
+ {"version":3,"file":"TransactionBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport { useTheme } from '@mui/material/styles'\n\nimport { CategoryIcon, InstitutionLogo, MerchantLogo } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useCategoryStore, useGlobalCopyStore, useGlobalStore } from '../../../../common'\nimport { slot } from '../../../../core'\nimport type { InsightsPayload, InstanceSlotRow, LogoRef } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport { useBeatActions } from '../../../beatActions'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport StatusMessageCard from '../../../components/StatusMessageCard'\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { logoFromRef } from '../../../components/shared/EntityLogo'\nimport { statusIconName, statusIconPalette } from '../../../components/statusIcon'\nimport { subscriptionFrequency } from '../../../components/SubscriptionStatus/subscriptionFrequency'\nimport { repeatingTransactionOf, USER_RESPONSE } from '../../../ctaActions/subscriptionAnswer'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { getLayoutConfig, transactionBlockVariant } from './layout'\n\ninterface TransactionBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\nconst ROW_LOGO_SIZE = 32\n// Same glyph-to-tile ratio mxui's `CategoryIcon` uses, so a status icon sits like the other logos.\nconst ROW_ICON_SIZE = Math.round(ROW_LOGO_SIZE * 0.625)\nconst STATUS_ICON_SIZE = 24\n// Status badge: palette disc, contrastText glyph.\nconst BADGE_SIZE = 32\nconst BADGE_GLYPH_SIZE = 20\n\n/** Status disc from `data.icon` / `data.reviewed_icon`. */\nconst SubscriptionBadge = ({ icon }: { icon?: LogoRef }) => {\n const name = statusIconName(icon?.guid)\n\n if (!name) return null\n\n return (\n <Box\n aria-hidden={true}\n data-icon={name}\n data-testid=\"subscription-badge\"\n sx={{\n alignItems: 'center',\n bgcolor: `${statusIconPalette(icon?.color)}.main`,\n borderRadius: '50%',\n display: 'flex',\n height: BADGE_SIZE,\n justifyContent: 'center',\n width: BADGE_SIZE,\n }}\n >\n <Icon\n fill={true}\n name={name}\n size={BADGE_GLYPH_SIZE}\n sx={{ color: `${statusIconPalette(icon?.color)}.contrastText` }}\n />\n </Box>\n )\n}\n\n/**\n * Renders the row's leading logo from its `LogoRef`: a status icon, or an entity guid whose prefix\n * names the entity. An unrecognized prefix renders no logo rather than guessing.\n *\n * `resolveTopLevelCategory`: mxui's `CategoryIcon` only knows the top-level category guids and\n * silently falls back to the Uncategorized icon for a sub-category. The details drawer avoids\n * this by passing `transaction.top_level_category_guid`; the row only has the raw guid, so it is\n * walked up to its parent here (identity until categories load). That applies both to a `CAT-`\n * row logo and to a merchant's `fallback_guid`, which `MerchantLogo` draws through the same\n * `CategoryIcon` when the merchant image fails to load.\n */\nconst renderRowLogo = (row: InstanceSlotRow, resolveTopLevelCategory: (guid: string) => string) => {\n const logo = logoFromRef(row.logo, row.primary_text)\n\n if (!logo) return undefined\n\n if (logo.logo_name) {\n // A fixed box the size of the other logos keeps the row's text column aligned.\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: ROW_LOGO_SIZE,\n justifyContent: 'center',\n width: ROW_LOGO_SIZE,\n }}\n >\n <Icon name={logo.logo_name} size={ROW_ICON_SIZE} sx={{ color: logo.logo_color }} />\n </Box>\n )\n }\n\n if (logo.merchant_guid) {\n return (\n <MerchantLogo\n alt={logo.merchant_name ?? ''}\n categoryGuid={logo.category_guid ? resolveTopLevelCategory(logo.category_guid) : ''}\n merchantGuid={logo.merchant_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.institution_guid) {\n return (\n <InstitutionLogo\n alt={logo.institution_name ?? ''}\n institutionGuid={logo.institution_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.category_guid) {\n const topLevelGuid = resolveTopLevelCategory(logo.category_guid)\n return (\n <Box data-testid={`category-icon-${topLevelGuid}`} sx={{ display: 'flex' }}>\n <CategoryIcon categoryGuid={topLevelGuid} size={ROW_LOGO_SIZE} />\n </Box>\n )\n }\n\n return undefined\n}\n\n/**\n * The `transaction_block`: rows the backend already localized, carried inline on\n * `instance_slot.data.series` (`logo`, `primary_text`, `secondary_text`, `amount`). Only the\n * amount is formatted here, because the contract sends it as a number. `instance_slot.variant`\n * picks the header and slot treatment from `./layout.ts`.\n *\n * This is the full/mini shape. The reduced widgets (micro, embedded) resolve to the row logo\n * alone, carried flat on `data.logo` with no `series`, and are drawn by `CompactInsightCard`.\n *\n * `status_message` draws no rows: `data.message` beside the `data.icon` logo, as a\n * `StatusMessageCard` banner (Uncategorized Transactions V2 `complete`).\n *\n * A header, when the variant shows one, comes from `instance_slot.data.header_text` (the\n * transaction date, or \"{count} transactions\"). It deliberately does *not* come from the first\n * row: on a `with_merchant` card a row's `secondary_text` is the category, so reading it here\n * rendered the category twice and dropped the date entirely.\n *\n * A footer/summary row (Replenish Savings' \"Remaining Balance\") renders under the\n * `with_header_footer` variant, from `data.footer_text` with `data.footer_amount` beside it,\n * formatted like the row amounts (the contract sends it as a number).\n */\nexport const TransactionBlock = observer(({ payload }: TransactionBlockProps) => {\n const theme = useTheme()\n const { getTopLevelCategoryGuid } = useCategoryStore()\n const stores = useGlobalStore()\n const { recurring: recurringCopy } = useGlobalCopyStore()\n const { beat } = useBeatActions()\n const { data, variant } = payload.instance_slot\n // The plain row is the safe default: it adds nothing a wrong variant could misstate.\n const {\n answeredBackground,\n background,\n cardVariant,\n followsSubscription,\n showFooter,\n showFrequency,\n showHeader,\n statusMessage,\n sx,\n } = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n transactionBlockVariant.NoHeader,\n 'TransactionBlock',\n )\n\n // The live repeating transaction (read-only), for the frequency and the badge / answered wash.\n const repeating =\n (showFrequency || followsSubscription) && beat\n ? repeatingTransactionOf({ beat, stores })\n : undefined\n const subscribed = !!followsSubscription && repeating?.user_response === USER_RESPONSE.CONFIRMED\n\n if (statusMessage) {\n const message = slot<string>(data, 'message')\n if (typeof message !== 'string' || !message.trim()) {\n console.warn('[TransactionBlock] status_message has no message — rendering nothing.')\n return null\n }\n\n // The icon only decorates the message, so it is hidden from the status announcement.\n return (\n <StatusMessageCard\n icon={\n <Box aria-hidden=\"true\" sx={{ display: 'flex' }}>\n <LogoFromGuid logo={slot<LogoRef>(data, 'icon')} size={STATUS_ICON_SIZE} />\n </Box>\n }\n message={message}\n // The 20% wash layers over paper, as Figma's slot does.\n sx={background ? { backgroundImage: background, bgcolor: 'background.paper' } : undefined}\n />\n )\n }\n\n const series = slot<InstanceSlotRow[]>(data, 'series')\n const headerText = slot<string>(data, 'header_text')\n\n if (!Array.isArray(series) || !series.length) return null\n\n const header = showHeader && typeof headerText === 'string' ? headerText : undefined\n\n const footerText = slot<string>(data, 'footer_text')\n const footerAmount = slot<number>(data, 'footer_amount')\n const footer = showFooter\n ? {\n label: footerText,\n amount: formatCurrency(footerAmount, '0,0.00'),\n }\n : undefined\n\n // Live, as pulse: the repeating transaction the CTA's `prepare` loads.\n const frequency = showFrequency ? subscriptionFrequency(recurringCopy, repeating) : undefined\n const badge = followsSubscription ? (\n <SubscriptionBadge icon={slot<LogoRef>(data, subscribed ? 'reviewed_icon' : 'icon')} />\n ) : undefined\n\n return (\n <TransactionListCard\n background={subscribed && answeredBackground ? answeredBackground : background}\n badge={badge}\n footer={footer}\n header={header}\n sx={sx}\n variant={cardVariant}\n rows={series.map((row) => ({\n amount: typeof row.amount === 'number' ? formatCurrency(row.amount, '0,0.00') : '',\n amountCaption: frequency,\n leading: renderRowLogo(row, getTopLevelCategoryGuid),\n subtitle: row.secondary_text ?? '',\n title: row.primary_text ?? '',\n }))}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA8BA,IAAM,IAAgB,IAEhB,KAAgB,KAAK,MAAM,IAAgB,KAAK,GAChD,KAAmB,IAEnB,IAAa,IACb,KAAmB,IAGnB,KAAA,CAAqB,EAAE,MAAA,EAAA,MAA+B;AAC1D,QAAM,IAAO,EAAe,GAAM,IAAI;AAEtC,SAAK,IAGH,gBAAA,EAAC,GAAD;AAAA,IACE,eAAa;AAAA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A;AAAA,MAET,IAAI,IAAa;AAAA,QAAE,iBAAiB;AAAA,QAAY,SAAS;AAAA,MAAmB,IAAI;AAAA,IACjF,CAAA;AAAA,EAEL;AAEA,QAAM,IAAS,EAAwB,GAAM,QAAQ,GAC/C,IAAa,EAAa,GAAM,aAAa;AAEnD,MAAI,CAAC,MAAM,QAAQ,CAAM,KAAK,CAAC,EAAO,OAAQ,QAAO;AAErD,QAAM,IAAS,KAAc,OAAO,KAAe,WAAW,IAAa,QAErE,IAAa,EAAa,GAAM,aAAa,GAC7C,IAAe,EAAa,GAAM,eAAe,GACjD,IAAS,IACX;AAAA,IACE,OAAO;AAAA,IACP,QAAQ,EAAe,GAAc,QAAQ;AAAA,EAC/C,IACA,QAGE,IAAY,IAAgB,EAAsB,GAAe,CAAS,IAAI,QAC9E,IAAQ,IACZ,gBAAA,EAAC,IAAD,EAAmB,MAAM,EAAc,GAAM,IAAa,kBAAkB,MAAM,EAAI,CAAA,IACpF;AAEJ,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,YAAY,KAAc,IAAqB,IAAqB;AAAA,IAC7D,OAAA;AAAA,IACC,QAAA;AAAA,IACA,QAAA;AAAA,IACJ,IAAA;AAAA,IACJ,SAAS;AAAA,IACT,MAAM,EAAO,IAAA,CAAK,OAAS;AAAA,MACzB,QAAQ,OAAO,EAAI,UAAW,WAAW,EAAe,EAAI,QAAQ,QAAQ,IAAI;AAAA,MAChF,eAAe;AAAA,MACf,SAAS,GAAc,GAAK,CAAuB;AAAA,MACnD,UAAU,EAAI,kBAAkB;AAAA,MAChC,OAAO,EAAI,gBAAgB;AAAA,IAC7B,EAAE;AAAA,EACH,CAAA;AAEL,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Theme } from '@mui/material/styles';
1
+ import { SxProps, Theme } from '@mui/material/styles';
2
2
  /**
3
3
  * Transaction block variants, keyed by the backend `instance_slot.variant`. All render the same
4
4
  * pre-localized rows through `TransactionListCard`; only the header and the slot differ.
@@ -38,6 +38,12 @@ export interface TransactionLayoutConfig {
38
38
  statusMessage?: boolean;
39
39
  /** Caption each amount with the beat's live repeating transaction frequency. */
40
40
  showFrequency?: boolean;
41
+ /** Status badge and answered wash from the live repeating transaction. */
42
+ followsSubscription?: boolean;
43
+ /** Wash once subscribed. */
44
+ answeredBackground?: string;
45
+ /** Slot padding override (CSS shorthand). */
46
+ sx?: SxProps;
41
47
  }
42
48
  /** Per-variant `TransactionListCard` props (mirrors DetailedAccountBlock's `getLayoutConfig`). */
43
49
  export declare const getLayoutConfig: (theme: Theme) => Record<TransactionBlockVariant, TransactionLayoutConfig>;
@@ -1,4 +1,4 @@
1
- import { WARNING_WASH_GRADIENT as r, getPrimaryWashGradient as t } from "../../../components/celebrationGradients.es.js";
1
+ import { WARM_LIME_ACCENT_GRADIENT as a, WARNING_WASH_GRADIENT as o, getPrimaryWashGradient as t } from "../../../components/celebrationGradients.es.js";
2
2
  var e = {
3
3
  WithHeader: "with_header",
4
4
  WithHeaderFooter: "with_header_footer",
@@ -7,7 +7,7 @@ var e = {
7
7
  InfoWash: "info_wash",
8
8
  WarningWash: "warning_wash",
9
9
  StatusMessage: "status_message"
10
- }, s = (a) => ({
10
+ }, n = (r) => ({
11
11
  [e.WithHeader]: { showHeader: !0 },
12
12
  [e.WithHeaderFooter]: {
13
13
  showHeader: !0,
@@ -20,20 +20,25 @@ var e = {
20
20
  },
21
21
  [e.InfoWash]: {
22
22
  showHeader: !1,
23
- background: t(a),
23
+ background: t(r),
24
24
  showFrequency: !0
25
25
  },
26
26
  [e.WarningWash]: {
27
27
  showHeader: !1,
28
- background: r
28
+ background: o,
29
+ showFrequency: !0,
30
+ followsSubscription: !0,
31
+ answeredBackground: a,
32
+ sx: { p: "28px 24px 24px 32px" }
29
33
  },
30
34
  [e.StatusMessage]: {
31
35
  showHeader: !1,
32
- statusMessage: !0
36
+ statusMessage: !0,
37
+ background: a
33
38
  }
34
39
  });
35
40
  export {
36
- s as getLayoutConfig,
41
+ n as getLayoutConfig,
37
42
  e as transactionBlockVariant
38
43
  };
39
44
 
@@ -1 +1 @@
1
- {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nimport {\n WARNING_WASH_GRADIENT,\n getPrimaryWashGradient,\n} from '../../../components/celebrationGradients'\n\n/**\n * Transaction block variants, keyed by the backend `instance_slot.variant`. All render the same\n * pre-localized rows through `TransactionListCard`; only the header and the slot differ.\n *\n * - `WithHeader` — row under a date header (Fee Detected, Large Transaction).\n * - `WithHeaderFooter` — date header above the rows plus the footer/summary row from\n * `data.footer_text` / `data.footer_amount` (Replenish Savings' \"Remaining Balance\").\n * - `NoHeader` — the row alone (Large Transaction without a merchant).\n * - `UncategorizedTransaction` — filled primary header (\"{count} transactions\").\n * - `InfoWash` — borderless row on the blue slot wash, with the subscription's live\n * frequency under the amount (e.g. Subscription Detected).\n * - `WarningWash` — borderless row on the warning slot wash (e.g. Unexpected\n * Subscription Payment). Treatment names, not beat names, so any beat can reuse the wash.\n * - `StatusMessage` — no rows: an icon + message banner from `data.icon` / `data.message`\n * (Uncategorized Transactions V2 `complete`, \"All Categorized!\").\n */\nexport const transactionBlockVariant = {\n WithHeader: 'with_header',\n WithHeaderFooter: 'with_header_footer',\n NoHeader: 'no_header',\n UncategorizedTransaction: 'uncategorized_transaction',\n InfoWash: 'info_wash',\n WarningWash: 'warning_wash',\n StatusMessage: 'status_message',\n} as const\n\nexport type TransactionBlockVariant =\n (typeof transactionBlockVariant)[keyof typeof transactionBlockVariant]\n\nexport interface TransactionLayoutConfig {\n /** Show `instance_slot.data.header_text` above the rows. */\n showHeader: boolean\n /** Show the `data.footer_text` / `data.footer_amount` summary row beneath the rows. */\n showFooter?: boolean\n /** `TransactionListCard` style: grey utility header, or filled primary header. */\n cardVariant?: 'default' | 'primary'\n /** CSS background for the slot behind the card; the card then renders borderless on paper. */\n background?: string\n /** Render `data.message` as a `StatusMessageCard` banner instead of the rows. */\n statusMessage?: boolean\n /** Caption each amount with the beat's live repeating transaction frequency. */\n showFrequency?: boolean\n}\n\n/** Per-variant `TransactionListCard` props (mirrors DetailedAccountBlock's `getLayoutConfig`). */\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<TransactionBlockVariant, TransactionLayoutConfig> => ({\n [transactionBlockVariant.WithHeader]: { showHeader: true },\n [transactionBlockVariant.WithHeaderFooter]: { showHeader: true, showFooter: true },\n [transactionBlockVariant.NoHeader]: { showHeader: false },\n [transactionBlockVariant.UncategorizedTransaction]: { showHeader: true, cardVariant: 'primary' },\n [transactionBlockVariant.InfoWash]: {\n showHeader: false,\n background: getPrimaryWashGradient(theme),\n showFrequency: true,\n },\n [transactionBlockVariant.WarningWash]: {\n showHeader: false,\n background: WARNING_WASH_GRADIENT,\n },\n [transactionBlockVariant.StatusMessage]: { showHeader: false, statusMessage: true },\n})\n"],"mappings":";AAuBA,IAAa,IAA0B;AAAA,EACrC,YAAY;AAAA,EACZ,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,0BAA0B;AAAA,EAC1B,UAAU;AAAA,EACV,aAAa;AAAA,EACb,eAAe;AACjB,GAqBa,IAAA,CACX,OAC8D;AAAA,EAC7D,CAAA,EAAwB,UAAA,GAAa,EAAE,YAAY,GAAK;AAAA,EACxD,CAAA,EAAwB,gBAAA,GAAmB;AAAA,IAAE,YAAY;AAAA,IAAM,YAAY;AAAA,EAAK;AAAA,EAChF,CAAA,EAAwB,QAAA,GAAW,EAAE,YAAY,GAAM;AAAA,EACvD,CAAA,EAAwB,wBAAA,GAA2B;AAAA,IAAE,YAAY;AAAA,IAAM,aAAa;AAAA,EAAU;AAAA,EAC9F,CAAA,EAAwB,QAAA,GAAW;AAAA,IAClC,YAAY;AAAA,IACZ,YAAY,EAAuB,CAAK;AAAA,IACxC,eAAe;AAAA,EACjB;AAAA,EACC,CAAA,EAAwB,WAAA,GAAc;AAAA,IACrC,YAAY;AAAA,IACZ,YAAY;AAAA,EACd;AAAA,EACC,CAAA,EAAwB,aAAA,GAAgB;AAAA,IAAE,YAAY;AAAA,IAAO,eAAe;AAAA,EAAK;AACpF"}
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.ts"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material/styles'\n\nimport {\n WARM_LIME_ACCENT_GRADIENT,\n WARNING_WASH_GRADIENT,\n getPrimaryWashGradient,\n} from '../../../components/celebrationGradients'\n\n/**\n * Transaction block variants, keyed by the backend `instance_slot.variant`. All render the same\n * pre-localized rows through `TransactionListCard`; only the header and the slot differ.\n *\n * - `WithHeader` — row under a date header (Fee Detected, Large Transaction).\n * - `WithHeaderFooter` — date header above the rows plus the footer/summary row from\n * `data.footer_text` / `data.footer_amount` (Replenish Savings' \"Remaining Balance\").\n * - `NoHeader` — the row alone (Large Transaction without a merchant).\n * - `UncategorizedTransaction` — filled primary header (\"{count} transactions\").\n * - `InfoWash` — borderless row on the blue slot wash, with the subscription's live\n * frequency under the amount (e.g. Subscription Detected).\n * - `WarningWash` — borderless row on the warning slot wash (e.g. Unexpected\n * Subscription Payment). Treatment names, not beat names, so any beat can reuse the wash.\n * - `StatusMessage` — no rows: an icon + message banner from `data.icon` / `data.message`\n * (Uncategorized Transactions V2 `complete`, \"All Categorized!\").\n */\nexport const transactionBlockVariant = {\n WithHeader: 'with_header',\n WithHeaderFooter: 'with_header_footer',\n NoHeader: 'no_header',\n UncategorizedTransaction: 'uncategorized_transaction',\n InfoWash: 'info_wash',\n WarningWash: 'warning_wash',\n StatusMessage: 'status_message',\n} as const\n\nexport type TransactionBlockVariant =\n (typeof transactionBlockVariant)[keyof typeof transactionBlockVariant]\n\nexport interface TransactionLayoutConfig {\n /** Show `instance_slot.data.header_text` above the rows. */\n showHeader: boolean\n /** Show the `data.footer_text` / `data.footer_amount` summary row beneath the rows. */\n showFooter?: boolean\n /** `TransactionListCard` style: grey utility header, or filled primary header. */\n cardVariant?: 'default' | 'primary'\n /** CSS background for the slot behind the card; the card then renders borderless on paper. */\n background?: string\n /** Render `data.message` as a `StatusMessageCard` banner instead of the rows. */\n statusMessage?: boolean\n /** Caption each amount with the beat's live repeating transaction frequency. */\n showFrequency?: boolean\n /** Status badge and answered wash from the live repeating transaction. */\n followsSubscription?: boolean\n /** Wash once subscribed. */\n answeredBackground?: string\n /** Slot padding override (CSS shorthand). */\n sx?: SxProps\n}\n\n/** Per-variant `TransactionListCard` props (mirrors DetailedAccountBlock's `getLayoutConfig`). */\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<TransactionBlockVariant, TransactionLayoutConfig> => ({\n [transactionBlockVariant.WithHeader]: { showHeader: true },\n [transactionBlockVariant.WithHeaderFooter]: { showHeader: true, showFooter: true },\n [transactionBlockVariant.NoHeader]: { showHeader: false },\n [transactionBlockVariant.UncategorizedTransaction]: { showHeader: true, cardVariant: 'primary' },\n [transactionBlockVariant.InfoWash]: {\n showHeader: false,\n background: getPrimaryWashGradient(theme),\n showFrequency: true,\n },\n [transactionBlockVariant.WarningWash]: {\n showHeader: false,\n background: WARNING_WASH_GRADIENT,\n showFrequency: true,\n followsSubscription: true,\n answeredBackground: WARM_LIME_ACCENT_GRADIENT,\n // Room for the badge.\n sx: { p: '28px 24px 24px 32px' },\n },\n // Figma 1941:207336: the banner sits on the warm-to-lime slot wash.\n [transactionBlockVariant.StatusMessage]: {\n showHeader: false,\n statusMessage: true,\n background: WARM_LIME_ACCENT_GRADIENT,\n },\n})\n"],"mappings":";AAwBA,IAAa,IAA0B;AAAA,EACrC,YAAY;AAAA,EACZ,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,0BAA0B;AAAA,EAC1B,UAAU;AAAA,EACV,aAAa;AAAA,EACb,eAAe;AACjB,GA2Ba,IAAA,CACX,OAC8D;AAAA,EAC7D,CAAA,EAAwB,UAAA,GAAa,EAAE,YAAY,GAAK;AAAA,EACxD,CAAA,EAAwB,gBAAA,GAAmB;AAAA,IAAE,YAAY;AAAA,IAAM,YAAY;AAAA,EAAK;AAAA,EAChF,CAAA,EAAwB,QAAA,GAAW,EAAE,YAAY,GAAM;AAAA,EACvD,CAAA,EAAwB,wBAAA,GAA2B;AAAA,IAAE,YAAY;AAAA,IAAM,aAAa;AAAA,EAAU;AAAA,EAC9F,CAAA,EAAwB,QAAA,GAAW;AAAA,IAClC,YAAY;AAAA,IACZ,YAAY,EAAuB,CAAK;AAAA,IACxC,eAAe;AAAA,EACjB;AAAA,EACC,CAAA,EAAwB,WAAA,GAAc;AAAA,IACrC,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,qBAAqB;AAAA,IACrB,oBAAoB;AAAA,IAEpB,IAAI,EAAE,GAAG,sBAAsB;AAAA,EACjC;AAAA,EAEC,CAAA,EAAwB,aAAA,GAAgB;AAAA,IACvC,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,YAAY;AAAA,EACd;AACF"}
@@ -1,12 +1,12 @@
1
1
  import { ThemedSVGImage as f } from "../../../components/chartblocks/ThemedSVGImage.es.js";
2
- import { resolveVariantConfig as p } from "../../resolveVariantConfig.es.js";
3
- import { getLayoutConfig as d } from "./layout.es.js";
4
- import { CtaStatus as v } from "../../../components/CtaStatus.es.js";
2
+ import { CtaStatus as p } from "../../../components/CtaStatus.es.js";
3
+ import { resolveVariantConfig as d } from "../../resolveVariantConfig.es.js";
4
+ import { getLayoutConfig as v } from "./layout.es.js";
5
5
  import { EmergencySavingsAccountPicker as h } from "./EmergencySavingsAccountPicker.es.js";
6
6
  import s from "@mui/material/Stack";
7
7
  import { jsx as o, jsxs as u } from "react/jsx-runtime";
8
8
  var V = ({ payload: { instance_slot: m, instance_slot_data: n, widget_type: t }, beatGuid: c }) => {
9
- const l = t === "mini", a = t === "full", { variant: g, data: e } = m, i = p(d(n?.isCIBC), g, "savings", "SVGImageBlock"), r = typeof e?.saved_label == "string" ? e.saved_label.trim() : "";
9
+ const l = t === "mini", a = t === "full", { variant: g, data: e } = m, i = d(v(n?.isCIBC), g, "savings", "SVGImageBlock"), r = typeof e?.saved_label == "string" ? e.saved_label.trim() : "";
10
10
  return /* @__PURE__ */ u(s, {
11
11
  alignItems: "center",
12
12
  sx: { width: "100%" },
@@ -25,7 +25,7 @@ var V = ({ payload: { instance_slot: m, instance_slot_data: n, widget_type: t },
25
25
  px: 16,
26
26
  width: "100%"
27
27
  },
28
- children: /* @__PURE__ */ o(v, {
28
+ children: /* @__PURE__ */ o(p, {
29
29
  icon: "check_circle",
30
30
  label: r,
31
31
  tone: "success"