@mx-cartographer/experiences 9.7.89 → 9.7.91

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 (28) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/core/types/Insights.d.ts +4 -0
  3. package/dist/core/types/Insights.es.js.map +1 -1
  4. package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +80 -70
  5. package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js.map +1 -1
  6. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +43 -42
  7. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
  8. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +2 -0
  9. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +4 -3
  10. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
  11. package/dist/insights-v2/components/CompactInsightCard.es.js +176 -127
  12. package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -1
  13. package/dist/insights-v2/components/TransactionListCard.d.ts +1 -1
  14. package/dist/insights-v2/components/TransactionListCard.es.js +30 -26
  15. package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
  16. package/dist/insights-v2/components/shared/StatusSnackbar.d.ts +5 -1
  17. package/dist/insights-v2/components/shared/StatusSnackbar.es.js +31 -11
  18. package/dist/insights-v2/components/shared/StatusSnackbar.es.js.map +1 -1
  19. package/dist/insights-v2/components/shared/elevation.d.ts +7 -0
  20. package/dist/insights-v2/components/shared/elevation.es.js +9 -0
  21. package/dist/insights-v2/components/shared/elevation.es.js.map +1 -0
  22. package/dist/insights-v2/ctaActions/ctaConfig.es.js +16 -8
  23. package/dist/insights-v2/ctaActions/ctaConfig.es.js.map +1 -1
  24. package/dist/insights-v2/ctaActions/index.d.ts +1 -1
  25. package/dist/insights-v2/ctaActions/runCtaAction.d.ts +6 -0
  26. package/dist/insights-v2/ctaActions/runCtaAction.es.js +1 -0
  27. package/dist/insights-v2/ctaActions/runCtaAction.es.js.map +1 -1
  28. package/package.json +1 -1
@@ -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 { alpha, useTheme } from '@mui/material/styles'\nimport type { Theme } 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 { getCategoryColor } from '../../../../core/utils/CategoryUtil'\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 resolution applies both to a\n * `CAT-` row logo and to a merchant's `fallback_guid`. The tinted/bordered tile is opt-in per variant\n * (`tintedCategoryLogo`) and only styles the `CAT-` row branch; a merchant's `fallback_guid` is drawn\n * by `MerchantLogo`'s own untinted `CategoryIcon` fallback when the merchant image fails to load.\n */\nconst renderRowLogo = (\n row: InstanceSlotRow,\n resolveTopLevelCategory: (guid: string) => string,\n theme: Theme,\n tintedCategoryLogo: boolean,\n) => {\n const logo = logoFromRef(row.logo, row.primary_text)\n\n if (!logo) return undefined\n\n if (logo.logo_name) {\n // A `{ icon, color }` status logo (e.g. an overdraft warning) renders as a bare coloured glyph.\n // An ICO- fill logo (the Weekly New Merchants \"Others\" row - `logo_fill` is set for ICO- refs\n // only, in EntityLogo) renders as an accent tile: per the MX accent-icon pattern the background is\n // the tile colour at 15% opacity and the glyph is the full tile colour (Figma). The tile colour is\n // the logo's own colour when it carries one, else chart-2 - so tile and glyph always match.\n const accentTile = !!logo.logo_fill\n const tileColor = logo.logo_color ?? theme.palette.chart.chart2 ?? theme.palette.primary.main\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 ...(accentTile && {\n bgcolor: alpha(tileColor, 0.15),\n borderRadius: '8px',\n }),\n }}\n >\n <Icon\n name={logo.logo_name}\n size={ROW_ICON_SIZE}\n sx={{ color: accentTile ? tileColor : logo.logo_color }}\n />\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 // When the variant opts in (`tintedCategoryLogo`), the tile is the Budget-style accent: the\n // category colour at 15% opacity, a 1px category-colour border, and a `text.primary` glyph\n // (Figma - Replenish Savings' multi-account Transfer row). Otherwise mxui's default tile, so other\n // beats' category logos are unchanged.\n const tintSx = tintedCategoryLogo\n ? {\n bgcolor: alpha(getCategoryColor(topLevelGuid, theme), 0.15),\n border: `1px solid ${getCategoryColor(topLevelGuid, theme)}`,\n color: 'text.primary',\n }\n : undefined\n return (\n <Box data-testid={`category-icon-${topLevelGuid}`} sx={{ display: 'flex' }}>\n <CategoryIcon categoryGuid={topLevelGuid} size={ROW_LOGO_SIZE} sx={tintSx} />\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\", Weekly New Merchants' \"Total\")\n * renders when the variant's `showFooter` config is set (`with_header_footer`, `with_footer`), from\n * `data.footer_text` with `data.footer_amount` beside it, formatted like the row amounts (the\n * 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 raised,\n showFooter,\n showFrequency,\n showHeader,\n statusMessage,\n sx,\n tintedCategoryLogo,\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 =\n showFooter && typeof footerText === 'string'\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 raised={raised}\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, theme, tintedCategoryLogo ?? false),\n subtitle: row.secondary_text ?? '',\n title: row.primary_text ?? '',\n }))}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgCA,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,GA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,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,GAAyB,GAAO,KAAsB,EAAK;AAAA,MACvF,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 { alpha, useTheme } from '@mui/material/styles'\nimport type { Theme } 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 { getCategoryColor } from '../../../../core/utils/CategoryUtil'\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 resolution applies both to a\n * `CAT-` row logo and to a merchant's `fallback_guid`. The tinted/bordered tile is opt-in per variant\n * (`tintedCategoryLogo`) and only styles the `CAT-` row branch; a merchant's `fallback_guid` is drawn\n * by `MerchantLogo`'s own untinted `CategoryIcon` fallback when the merchant image fails to load.\n */\nconst renderRowLogo = (\n row: InstanceSlotRow,\n resolveTopLevelCategory: (guid: string) => string,\n theme: Theme,\n tintedCategoryLogo: boolean,\n) => {\n const logo = logoFromRef(row.logo, row.primary_text)\n\n if (!logo) return undefined\n\n if (logo.logo_name) {\n // A `{ icon, color }` status logo (e.g. an overdraft warning) renders as a bare coloured glyph.\n // An ICO- fill logo (the Weekly New Merchants \"Others\" row - `logo_fill` is set for ICO- refs\n // only, in EntityLogo) renders as an accent tile: per the MX accent-icon pattern the background is\n // the tile colour at 15% opacity and the glyph is the full tile colour (Figma). The tile colour is\n // the logo's own colour when it carries one, else chart-2 - so tile and glyph always match.\n const accentTile = !!logo.logo_fill\n const tileColor = logo.logo_color ?? theme.palette.chart.chart2 ?? theme.palette.primary.main\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 ...(accentTile && {\n bgcolor: alpha(tileColor, 0.15),\n borderRadius: '8px',\n }),\n }}\n >\n <Icon\n name={logo.logo_name}\n size={ROW_ICON_SIZE}\n sx={{ color: accentTile ? tileColor : logo.logo_color }}\n />\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 // When the variant opts in (`tintedCategoryLogo`), the tile is the Budget-style accent: the\n // category colour at 15% opacity, a 1px category-colour border, and a `text.primary` glyph\n // (Figma - Replenish Savings' multi-account Transfer row). Otherwise mxui's default tile, so other\n // beats' category logos are unchanged.\n const tintSx = tintedCategoryLogo\n ? {\n bgcolor: alpha(getCategoryColor(topLevelGuid, theme), 0.15),\n border: `1px solid ${getCategoryColor(topLevelGuid, theme)}`,\n color: 'text.primary',\n }\n : undefined\n return (\n <Box data-testid={`category-icon-${topLevelGuid}`} sx={{ display: 'flex' }}>\n <CategoryIcon categoryGuid={topLevelGuid} size={ROW_LOGO_SIZE} sx={tintSx} />\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\", Weekly New Merchants' \"Total\")\n * renders when the variant's `showFooter` config is set (`with_header_footer`, `with_footer`), from\n * `data.footer_text` with `data.footer_amount` beside it, formatted like the row amounts (the\n * 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 elevated,\n followsSubscription,\n raised,\n showFooter,\n showFrequency,\n showHeader,\n statusMessage,\n sx,\n tintedCategoryLogo,\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 =\n showFooter && typeof footerText === 'string'\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 elevated={elevated}\n footer={footer}\n header={header}\n raised={raised}\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, theme, tintedCategoryLogo ?? false),\n subtitle: row.secondary_text ?? '',\n title: row.primary_text ?? '',\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AI,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,IACG,UAAA;AAAA,IACF,QAAA;AAAA,IACA,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,GAAyB,GAAO,KAAsB,EAAK;AAAA,MACvF,UAAU,EAAI,kBAAkB;AAAA,MAChC,OAAO,EAAI,gBAAgB;AAAA,IAC7B,EAAE;AAAA,EACH,CAAA;AAEL,CAAC"}
@@ -43,6 +43,8 @@ export interface TransactionLayoutConfig {
43
43
  followsSubscription?: boolean;
44
44
  /** Wash once subscribed. */
45
45
  answeredBackground?: string;
46
+ /** Row card at `elevation/1` (needs `background`). */
47
+ elevated?: boolean;
46
48
  /** Slot padding override (CSS shorthand). */
47
49
  sx?: SxProps;
48
50
  /** Border and shadow on the row card. */
@@ -1,4 +1,4 @@
1
- import { WARM_LIME_ACCENT_GRADIENT as a, WARNING_WASH_GRADIENT as o, getPrimaryWashGradient as t } from "../../../components/celebrationGradients.es.js";
1
+ import { WARM_LIME_ACCENT_GRADIENT as a, WARNING_WASH_GRADIENT as t, getPrimaryWashGradient as o } from "../../../components/celebrationGradients.es.js";
2
2
  var e = {
3
3
  WithHeader: "with_header",
4
4
  WithHeaderFooter: "with_header_footer",
@@ -28,16 +28,17 @@ var e = {
28
28
  },
29
29
  [e.InfoWash]: {
30
30
  showHeader: !1,
31
- background: t(r),
31
+ background: o(r),
32
32
  raised: !0,
33
33
  showFrequency: !0
34
34
  },
35
35
  [e.WarningWash]: {
36
36
  showHeader: !1,
37
- background: o,
37
+ background: t,
38
38
  showFrequency: !0,
39
39
  followsSubscription: !0,
40
40
  answeredBackground: a,
41
+ elevated: !0,
41
42
  sx: { p: "28px 24px 24px 32px" }
42
43
  },
43
44
  [e.StatusMessage]: {
@@ -1 +1 @@
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` — raised row (border + shadow) on the blue slot wash, with the\n * subscription's live 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 // A multi-row list with no in-card header plus a \"Total\" summary row (Weekly New Merchants; the\n // date range is the card subtitle). The plain no-footer list reuses `NoHeader`.\n WithFooter: 'with_footer',\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 renders borderless unless `raised`. */\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 /** Border and shadow on the row card. */\n raised?: boolean\n /**\n * Tint a `CAT-` row logo as the Budget-style accent tile (category colour at 15% opacity, a 1px\n * category-colour border, a `text.primary` glyph) instead of mxui's default. Opt-in per variant so\n * it stays scoped to the beats that want it (Replenish Savings' multi-account Transfer row), not\n * every `transaction_block` consumer.\n */\n tintedCategoryLogo?: boolean\n}\n\n/** Per-variant `TransactionListCard` props (mirrors DetailedAccountBlock's `getLayoutConfig`). */\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<TransactionBlockVariant, TransactionLayoutConfig> => ({\n // `with_header` is Replenish Savings' multi-account card: its one summary row is a `CAT-` Transfer\n // logo, which we tint. (Other `with_header` beats, e.g. Large Transaction, use a merchant logo, so\n // the `CAT-` tint path never runs for them.)\n [transactionBlockVariant.WithHeader]: { showHeader: true, tintedCategoryLogo: true },\n [transactionBlockVariant.WithHeaderFooter]: { showHeader: true, showFooter: true },\n [transactionBlockVariant.NoHeader]: { showHeader: false },\n [transactionBlockVariant.WithFooter]: { showHeader: false, showFooter: true },\n [transactionBlockVariant.UncategorizedTransaction]: { showHeader: true, cardVariant: 'primary' },\n [transactionBlockVariant.InfoWash]: {\n showHeader: false,\n background: getPrimaryWashGradient(theme),\n raised: true,\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,EAGV,YAAY;AAAA,EACZ,0BAA0B;AAAA,EAC1B,UAAU;AAAA,EACV,aAAa;AAAA,EACb,eAAe;AACjB,GAoCa,IAAA,CACX,OAC8D;AAAA,EAI7D,CAAA,EAAwB,UAAA,GAAa;AAAA,IAAE,YAAY;AAAA,IAAM,oBAAoB;AAAA,EAAK;AAAA,EAClF,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,UAAA,GAAa;AAAA,IAAE,YAAY;AAAA,IAAO,YAAY;AAAA,EAAK;AAAA,EAC3E,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,QAAQ;AAAA,IACR,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
+ {"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` — raised row (border + shadow) on the blue slot wash, with the\n * subscription's live 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 // A multi-row list with no in-card header plus a \"Total\" summary row (Weekly New Merchants; the\n // date range is the card subtitle). The plain no-footer list reuses `NoHeader`.\n WithFooter: 'with_footer',\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 renders borderless unless `raised`. */\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 /** Row card at `elevation/1` (needs `background`). */\n elevated?: boolean\n /** Slot padding override (CSS shorthand). */\n sx?: SxProps\n /** Border and shadow on the row card. */\n raised?: boolean\n /**\n * Tint a `CAT-` row logo as the Budget-style accent tile (category colour at 15% opacity, a 1px\n * category-colour border, a `text.primary` glyph) instead of mxui's default. Opt-in per variant so\n * it stays scoped to the beats that want it (Replenish Savings' multi-account Transfer row), not\n * every `transaction_block` consumer.\n */\n tintedCategoryLogo?: boolean\n}\n\n/** Per-variant `TransactionListCard` props (mirrors DetailedAccountBlock's `getLayoutConfig`). */\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<TransactionBlockVariant, TransactionLayoutConfig> => ({\n // `with_header` is Replenish Savings' multi-account card: its one summary row is a `CAT-` Transfer\n // logo, which we tint. (Other `with_header` beats, e.g. Large Transaction, use a merchant logo, so\n // the `CAT-` tint path never runs for them.)\n [transactionBlockVariant.WithHeader]: { showHeader: true, tintedCategoryLogo: true },\n [transactionBlockVariant.WithHeaderFooter]: { showHeader: true, showFooter: true },\n [transactionBlockVariant.NoHeader]: { showHeader: false },\n [transactionBlockVariant.WithFooter]: { showHeader: false, showFooter: true },\n [transactionBlockVariant.UncategorizedTransaction]: { showHeader: true, cardVariant: 'primary' },\n [transactionBlockVariant.InfoWash]: {\n showHeader: false,\n background: getPrimaryWashGradient(theme),\n raised: true,\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 elevated: true,\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,EAGV,YAAY;AAAA,EACZ,0BAA0B;AAAA,EAC1B,UAAU;AAAA,EACV,aAAa;AAAA,EACb,eAAe;AACjB,GAsCa,IAAA,CACX,OAC8D;AAAA,EAI7D,CAAA,EAAwB,UAAA,GAAa;AAAA,IAAE,YAAY;AAAA,IAAM,oBAAoB;AAAA,EAAK;AAAA,EAClF,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,UAAA,GAAa;AAAA,IAAE,YAAY;AAAA,IAAO,YAAY;AAAA,EAAK;AAAA,EAC3E,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,QAAQ;AAAA,IACR,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,IACpB,UAAU;AAAA,IAEV,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,89 +1,137 @@
1
- import { useInsightsV2Store as L } from "../../common/context/hooks.es.js";
2
- import { slot as u } from "../../core/types/Insights.es.js";
3
- import { getCategoryColor as R } from "../../core/utils/CategoryUtil.es.js";
4
- import { TinyBarChart as E } from "../../common/components/TinyBarChart.es.js";
5
- import { BAR_ARIA_LABEL as V, buildChartData as A, buildDataSeries as T } from "../blocks/ChartBlocks/BarchartBlock/utils.es.js";
6
- import { ThemedSVGImage as z } from "./chartblocks/ThemedSVGImage.es.js";
7
- import x from "./LogoFromGuid.es.js";
8
- import { createVariantBlock as O } from "../blocks/createVariantBlock.es.js";
9
- import { ActionBlockLayer as N } from "../actionBlocks/ActionBlockLayer.es.js";
10
- import k from "./BadgedTile.es.js";
11
- import { InsightOptionsMenu as G } from "./InsightOptionsMenu.es.js";
12
- import { ReactComponent as K } from "./shared/images/FeeDetected.es.js";
13
- import P from "./StatusBadge.es.js";
14
- import h from "@mui/material/Stack";
15
- import { P as W, Text as b } from "@mxenabled/mxui";
16
- import j from "@mui/material/Button";
17
- import { Icon as v } from "@mxenabled/mx-icons";
18
- import { Fragment as F, jsx as t, jsxs as s } from "react/jsx-runtime";
19
- import i from "@mui/material/Box";
20
- import H from "@mui/material/Card";
21
- var d = 44, y = 36, M = 75, X = 74, f = {
1
+ import { useGlobalStore as O, useInsightsV2Store as V } from "../../common/context/hooks.es.js";
2
+ import { slot as b } from "../../core/types/Insights.es.js";
3
+ import { getCategoryColor as N } from "../../core/utils/CategoryUtil.es.js";
4
+ import { TinyBarChart as W } from "../../common/components/TinyBarChart.es.js";
5
+ import { BAR_ARIA_LABEL as G, buildChartData as P, buildDataSeries as j } from "../blocks/ChartBlocks/BarchartBlock/utils.es.js";
6
+ import { ThemedSVGImage as K } from "./chartblocks/ThemedSVGImage.es.js";
7
+ import { postCtaMessage as F } from "../ctaActions/runCtaAction.es.js";
8
+ import _ from "./LogoFromGuid.es.js";
9
+ import { createVariantBlock as H } from "../blocks/createVariantBlock.es.js";
10
+ import { ActionBlockLayer as M } from "../actionBlocks/ActionBlockLayer.es.js";
11
+ import w from "./BadgedTile.es.js";
12
+ import { InsightOptionsMenu as X } from "./InsightOptionsMenu.es.js";
13
+ import { ReactComponent as Z } from "./shared/images/FeeDetected.es.js";
14
+ import $ from "./StatusBadge.es.js";
15
+ import u from "@mui/material/Stack";
16
+ import { P as q, Text as v } from "@mxenabled/mxui";
17
+ import J from "@mui/material/Button";
18
+ import { Icon as y } from "@mxenabled/mx-icons";
19
+ import { Fragment as Q, jsx as t, jsxs as d } from "react/jsx-runtime";
20
+ import e from "@mui/material/Box";
21
+ import U from "@mui/material/Card";
22
+ var Y = 2, c = 44, k = 36, tt = 75, rt = 74, g = {
22
23
  left: "50%",
23
24
  position: "absolute",
24
25
  top: "50%",
25
26
  transform: "translate(-50%, -50%)"
26
- }, C = ({ logo: r }) => r ? /* @__PURE__ */ t(x, {
27
+ }, C = ({ logo: r }) => r ? /* @__PURE__ */ t(_, {
27
28
  logo: r,
28
- size: d
29
- }) : /* @__PURE__ */ t(i, {
29
+ size: c
30
+ }) : /* @__PURE__ */ t(e, {
30
31
  "data-testid": "compact-insight-card-fallback-icon",
31
32
  sx: {
32
33
  alignItems: "center",
33
34
  bgcolor: "primary.lighter",
34
35
  display: "flex",
35
- height: d,
36
+ height: c,
36
37
  justifyContent: "center",
37
- width: d
38
+ width: c
38
39
  },
39
- children: /* @__PURE__ */ t(v, {
40
+ children: /* @__PURE__ */ t(y, {
40
41
  color: "primary",
41
42
  fill: !0,
42
43
  name: "lightbulb",
43
44
  size: 24
44
45
  })
45
- }), _ = ({ logo: r }) => /* @__PURE__ */ t(k, {
46
+ }), I = ({ logo: r }) => /* @__PURE__ */ t(w, {
46
47
  center: /* @__PURE__ */ t(C, { logo: r }),
47
- size: d,
48
+ size: c,
48
49
  sx: { flexShrink: 0 }
49
- }), Z = ({ logo: r }) => /* @__PURE__ */ t(k, {
50
+ }), it = ({ logo: r }) => /* @__PURE__ */ t(w, {
50
51
  center: /* @__PURE__ */ t(C, { logo: r }),
51
- size: d,
52
+ size: c,
52
53
  sx: { flexShrink: 0 },
53
- topRight: /* @__PURE__ */ t(P, { tone: "warning" })
54
- }), $ = () => /* @__PURE__ */ t(z, {
54
+ topRight: /* @__PURE__ */ t($, { tone: "warning" })
55
+ }), et = () => /* @__PURE__ */ t(K, {
55
56
  divProps: { style: {
56
57
  flexShrink: 0,
57
58
  lineHeight: 0,
58
59
  width: "max-content"
59
60
  } },
60
- image: K
61
- }), q = ({ data: r }) => {
62
- const { from_logo: o, to_logo: a } = r ?? {};
63
- return /* @__PURE__ */ s(i, {
61
+ image: Z
62
+ }), x = 24, ot = () => /* @__PURE__ */ t(e, {
63
+ "aria-hidden": !0,
64
+ "data-testid": "linked-logos-badge",
65
+ sx: {
66
+ ...g,
67
+ alignItems: "center",
68
+ bgcolor: "primary.main",
69
+ border: "2px solid",
70
+ borderColor: "primary.contrastText",
71
+ borderRadius: "12px",
72
+ display: "flex",
73
+ justifyContent: "center",
74
+ p: 2,
75
+ zIndex: 1
76
+ },
77
+ children: /* @__PURE__ */ t(y, {
78
+ name: "link",
79
+ size: 16,
80
+ sx: { color: "primary.contrastText" }
81
+ })
82
+ }), at = () => /* @__PURE__ */ t(e, {
83
+ "aria-hidden": !0,
84
+ "data-testid": "linked-logos-badge",
85
+ sx: {
86
+ ...g,
87
+ alignItems: "center",
88
+ bgcolor: "primary.contrastText",
89
+ borderRadius: "50%",
90
+ display: "flex",
91
+ height: x,
92
+ justifyContent: "center",
93
+ overflow: "hidden",
94
+ width: x,
95
+ zIndex: 1
96
+ },
97
+ children: /* @__PURE__ */ t(y, {
98
+ name: "swap_vertical_circle",
99
+ size: x * 1.2,
100
+ sx: {
101
+ color: "primary.main",
102
+ flexShrink: 0,
103
+ transform: "rotate(-90deg)"
104
+ }
105
+ })
106
+ }), nt = ({ data: r, template: o }) => {
107
+ const { from_logo: l, to_logo: a } = r ?? {}, i = o === "SwitchDirectDeposit";
108
+ return /* @__PURE__ */ d(e, {
64
109
  sx: {
65
110
  flexShrink: 0,
66
- height: X,
111
+ height: rt,
67
112
  position: "relative",
68
- width: M
113
+ width: tt
69
114
  },
70
115
  children: [
71
- /* @__PURE__ */ t(i, {
116
+ /* @__PURE__ */ t(e, {
72
117
  "aria-hidden": !0,
73
118
  "data-testid": "linked-logos-ring",
74
119
  sx: {
75
- ...f,
76
- bgcolor: "primary.light",
120
+ ...g,
77
121
  borderRadius: "50%",
78
122
  height: 36,
79
- width: 36
123
+ width: 36,
124
+ ...i ? {
125
+ border: "2px solid",
126
+ borderColor: "primary.light"
127
+ } : { bgcolor: "primary.light" }
80
128
  }
81
129
  }),
82
- /* @__PURE__ */ t(i, {
130
+ /* @__PURE__ */ t(e, {
83
131
  "aria-hidden": !0,
84
132
  "data-testid": "linked-logos-ring",
85
133
  sx: {
86
- ...f,
134
+ ...g,
87
135
  border: "1px solid",
88
136
  borderColor: "divider",
89
137
  borderRadius: "50%",
@@ -91,7 +139,7 @@ var d = 44, y = 36, M = 75, X = 74, f = {
91
139
  width: 48
92
140
  }
93
141
  }),
94
- /* @__PURE__ */ t(i, {
142
+ /* @__PURE__ */ t(e, {
95
143
  sx: {
96
144
  borderRadius: "4px",
97
145
  left: 0,
@@ -99,12 +147,12 @@ var d = 44, y = 36, M = 75, X = 74, f = {
99
147
  position: "absolute",
100
148
  top: 0
101
149
  },
102
- children: /* @__PURE__ */ t(x, {
103
- logo: o,
104
- size: y
150
+ children: /* @__PURE__ */ t(_, {
151
+ logo: l,
152
+ size: k
105
153
  })
106
154
  }),
107
- /* @__PURE__ */ t(i, {
155
+ /* @__PURE__ */ t(e, {
108
156
  sx: {
109
157
  borderRadius: "4px",
110
158
  bottom: 0,
@@ -112,57 +160,37 @@ var d = 44, y = 36, M = 75, X = 74, f = {
112
160
  position: "absolute",
113
161
  right: 0
114
162
  },
115
- children: /* @__PURE__ */ t(x, {
163
+ children: /* @__PURE__ */ t(_, {
116
164
  logo: a,
117
- size: y
165
+ size: k
118
166
  })
119
167
  }),
120
- /* @__PURE__ */ t(i, {
121
- "aria-hidden": !0,
122
- "data-testid": "linked-logos-badge",
123
- sx: {
124
- ...f,
125
- alignItems: "center",
126
- bgcolor: "primary.main",
127
- border: "2px solid",
128
- borderColor: "primary.contrastText",
129
- borderRadius: "12px",
130
- display: "flex",
131
- justifyContent: "center",
132
- p: 2,
133
- zIndex: 1
134
- },
135
- children: /* @__PURE__ */ t(v, {
136
- name: "link",
137
- size: 16,
138
- sx: { color: "primary.contrastText" }
139
- })
140
- })
168
+ i ? /* @__PURE__ */ t(at, {}) : /* @__PURE__ */ t(ot, {})
141
169
  ]
142
170
  });
143
- }, J = ({ data: r }) => {
144
- const o = T(u(r, "series"));
171
+ }, st = ({ data: r }) => {
172
+ const o = j(b(r, "series"));
145
173
  if (!o.length) return null;
146
- const a = u(r, "category_guid"), n = A(o, V).slice(-3);
147
- return /* @__PURE__ */ t(i, {
174
+ const l = b(r, "category_guid"), a = P(o, G).slice(-3);
175
+ return /* @__PURE__ */ t(e, {
148
176
  "data-testid": "compact-insight-card-bar-chart",
149
177
  sx: { flexShrink: 0 },
150
- children: /* @__PURE__ */ t(E, {
151
- color: (l) => a ? R(a, l) : l.palette.primary.main,
152
- data: n
178
+ children: /* @__PURE__ */ t(W, {
179
+ color: (i) => l ? N(l, i) : i.palette.primary.main,
180
+ data: a
153
181
  })
154
182
  });
155
- }, Q = O({
183
+ }, lt = H({
156
184
  variants: {
157
- category_color: J,
158
- linked_logos: q,
159
- minimal: _,
160
- with_illustration: $,
161
- with_warning_badge: Z
185
+ category_color: st,
186
+ linked_logos: nt,
187
+ minimal: I,
188
+ with_illustration: et,
189
+ with_warning_badge: it
162
190
  },
163
- fallback: _,
191
+ fallback: I,
164
192
  name: "InsightVisual"
165
- }), U = {
193
+ }), dt = {
166
194
  BillAmountNotStandard: {
167
195
  key: "in_description_cta",
168
196
  trigger: "inDescriptionCta"
@@ -170,26 +198,37 @@ var d = 44, y = 36, M = 75, X = 74, f = {
170
198
  ConnectDiscoveredAccountsV2: {
171
199
  key: "in_description_cta",
172
200
  trigger: "inDescriptionCta"
173
- }
174
- }, Y = (r) => r.stopPropagation(), kt = ({ beat: r, isCtaDisabled: o = !1, onCtaClick: a, onTap: n, payload: l }) => {
175
- const { openActionDrawer: I } = L(), { description: w, instance_slot: g, primary_cta: m, title: B } = l, c = U[l.template ?? ""], p = c ? l[c.key] : m, D = u(g.data, "logo"), S = (e) => {
176
- if (e.stopPropagation(), !(o || !p)) {
177
- if (c) {
178
- r && I({
201
+ },
202
+ SwitchDirectDeposit: { key: "in_description_cta" }
203
+ }, ct = (r) => r.stopPropagation(), Tt = ({ beat: r, isCtaDisabled: o = !1, onCtaClick: l, onTap: a, payload: i }) => {
204
+ const S = O(), { openActionDrawer: D } = V(), { description: B, instance_slot: m, primary_cta: p, title: L } = i, n = dt[i.template ?? ""], h = n ? i[n.key] : p, f = i.in_description_cta?.post_message_metadata, E = !n || !!n.trigger || !!r && !!f, A = b(m.data, "logo"), R = (s) => {
205
+ if (s.stopPropagation(), !(o || !h)) {
206
+ if (n) {
207
+ if (r && n.trigger) D({
179
208
  guid: r.guid,
180
- trigger: c.trigger
209
+ trigger: n.trigger
181
210
  });
211
+ else if (r && f) {
212
+ const { action: T, ...z } = f;
213
+ F({
214
+ beat: r,
215
+ stores: S
216
+ }, {
217
+ action: T,
218
+ payload: z
219
+ });
220
+ }
182
221
  return;
183
222
  }
184
- m && a?.(m);
223
+ p && l?.(p);
185
224
  }
186
225
  };
187
- return /* @__PURE__ */ s(F, { children: [/* @__PURE__ */ s(H, {
226
+ return /* @__PURE__ */ d(Q, { children: [/* @__PURE__ */ d(U, {
188
227
  "data-testid": "compact-insight-card",
189
- ...n ? {
190
- onClick: n,
191
- onKeyDown: (e) => {
192
- e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), n?.());
228
+ ...a ? {
229
+ onClick: a,
230
+ onKeyDown: (s) => {
231
+ s.target === s.currentTarget && (s.key === "Enter" || s.key === " ") && (s.preventDefault(), a?.());
193
232
  },
194
233
  role: "button",
195
234
  tabIndex: 0
@@ -200,9 +239,9 @@ var d = 44, y = 36, M = 75, X = 74, f = {
200
239
  pl: 8,
201
240
  pr: 16,
202
241
  pt: 8,
203
- ...n && { cursor: "pointer" }
242
+ ...a && { cursor: "pointer" }
204
243
  },
205
- children: [/* @__PURE__ */ s(h, {
244
+ children: [/* @__PURE__ */ d(u, {
206
245
  sx: {
207
246
  alignItems: "center",
208
247
  flexDirection: "row",
@@ -211,41 +250,50 @@ var d = 44, y = 36, M = 75, X = 74, f = {
211
250
  pl: 8,
212
251
  pt: 4
213
252
  },
214
- children: [/* @__PURE__ */ t(b, {
253
+ children: [/* @__PURE__ */ t(v, {
215
254
  bold: !0,
216
255
  variant: "body1",
217
- children: B ?? ""
218
- }), /* @__PURE__ */ t(i, {
219
- onClick: Y,
256
+ children: L ?? ""
257
+ }), /* @__PURE__ */ t(e, {
258
+ onClick: ct,
220
259
  sx: { display: "flex" },
221
- children: /* @__PURE__ */ t(G, {})
260
+ children: /* @__PURE__ */ t(X, {})
222
261
  })]
223
- }), /* @__PURE__ */ s(h, {
262
+ }), /* @__PURE__ */ d(u, {
224
263
  sx: {
264
+ alignItems: "center",
225
265
  flexDirection: "row",
226
266
  gap: 16,
227
- pl: 8,
228
- pt: 4
267
+ pl: 8
229
268
  },
230
- children: [/* @__PURE__ */ s(h, {
269
+ children: [/* @__PURE__ */ d(u, {
231
270
  sx: {
271
+ alignSelf: "stretch",
232
272
  flex: 1,
233
273
  gap: 8,
234
- minWidth: 0
274
+ minWidth: 0,
275
+ pt: 2
235
276
  },
236
- children: [/* @__PURE__ */ t(W, {
237
- dangerouslySetInnerHTML: { __html: w.html_text },
277
+ children: [/* @__PURE__ */ t(q, {
278
+ dangerouslySetInnerHTML: { __html: B.html_text },
238
279
  "data-testid": "compact-insight-card-description",
239
- sx: { fontWeight: "fontWeightRegular" },
280
+ sx: {
281
+ display: "-webkit-box",
282
+ fontWeight: "fontWeightRegular",
283
+ overflow: "hidden",
284
+ textOverflow: "ellipsis",
285
+ WebkitBoxOrient: "vertical",
286
+ WebkitLineClamp: Y
287
+ },
240
288
  variant: "subtitle2"
241
- }), p?.label && /* @__PURE__ */ t(j, {
289
+ }), h?.label && E && /* @__PURE__ */ t(J, {
242
290
  "aria-disabled": o,
243
- onClick: S,
291
+ onClick: R,
244
292
  size: "small",
245
293
  sx: {
246
294
  alignSelf: "flex-start",
247
- mt: 5,
248
295
  ml: -8,
296
+ my: 0,
249
297
  px: 8,
250
298
  ...o && {
251
299
  color: "text.disabled",
@@ -253,22 +301,23 @@ var d = 44, y = 36, M = 75, X = 74, f = {
253
301
  }
254
302
  },
255
303
  variant: "text",
256
- children: /* @__PURE__ */ t(b, {
304
+ children: /* @__PURE__ */ t(v, {
257
305
  bold: !0,
258
306
  variant: "body2",
259
- children: p.label
307
+ children: h.label
260
308
  })
261
309
  })]
262
- }), /* @__PURE__ */ t(Q, {
263
- data: g.data,
264
- logo: D,
265
- variant: g.variant
310
+ }), /* @__PURE__ */ t(lt, {
311
+ data: m.data,
312
+ logo: A,
313
+ template: i.template,
314
+ variant: m.variant
266
315
  })]
267
316
  })]
268
- }), r && /* @__PURE__ */ t(N, { beat: r })] });
317
+ }), r && /* @__PURE__ */ t(M, { beat: r })] });
269
318
  };
270
319
  export {
271
- kt as default
320
+ Tt as default
272
321
  };
273
322
 
274
323
  //# sourceMappingURL=CompactInsightCard.es.js.map