@mx-cartographer/experiences 9.7.143 → 9.7.145

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 (30) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/core/types/Insights.d.ts +6 -5
  3. package/dist/core/types/Insights.es.js.map +1 -1
  4. package/dist/core/types/localization/InsightsFeedCopy.d.ts +33 -1
  5. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.d.ts +9 -0
  6. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js +42 -0
  7. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js.map +1 -0
  8. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.d.ts +13 -0
  9. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.es.js +339 -0
  10. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.es.js.map +1 -0
  11. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/index.d.ts +2 -0
  12. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/layout.d.ts +41 -0
  13. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/layout.es.js +61 -0
  14. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/layout.es.js.map +1 -0
  15. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/usePayoffStrategiesPrepare.d.ts +2 -0
  16. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/usePayoffStrategiesPrepare.es.js +14 -0
  17. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/usePayoffStrategiesPrepare.es.js.map +1 -0
  18. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +2 -1
  19. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
  20. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +3 -0
  21. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +170 -131
  22. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
  23. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +1 -0
  24. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
  25. package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -0
  26. package/dist/insights-v2/mappings/actionBlocksKey.es.js +1 -0
  27. package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
  28. package/dist/insights-v2/mappings/blocks.es.js +47 -40
  29. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  30. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [9.7.145] - 11-12-2026
2
+
3
+ - Merchant Budget Spending History drawer on the Transaction History action block (WEC-2275)
4
+
5
+ ## [9.7.144] - 11-12-2026
6
+
7
+ - **ADDED** - Debt Payoff Strategies action block on Insights 2.0 with Avalanche and Snowball tabs, each with its strategy, pros, cons, steps and the beat's debt accounts in payoff order, a tapped account opening Account Details (WEC-2276)
8
+
1
9
  ## [9.7.143] - 11-12-2026
2
10
 
3
11
  - **ADDED** - Subscription Price Increase V2 embedded card shows the previous and new amounts as two bars (WEC-2290)
@@ -1,3 +1,4 @@
1
+ import { DataSeries } from './Beat';
1
2
  import { InsightsInstanceSlotData } from './InsightsInstanceSlotData';
2
3
  export interface ThemedSVGImageProps {
3
4
  divProps?: React.HTMLAttributes<HTMLDivElement>;
@@ -33,12 +34,12 @@ export interface Pill {
33
34
  * V2: facts a drilldown shows that the card does not. On the payload: what every CTA of the card
34
35
  * shares (e.g. the account number for the Transaction Details drawer, or the guid list a list drawer
35
36
  * shows, `transaction_guids`). On a CTA: the figures that CTA's own drilldown renders (the Transaction
36
- * List summary header's `amount`, `start_date` / `end_date` and `count`, see `readSummary`). Scalars
37
- * or string lists, omitted when the insight has none. Never carries copy or user actions (memo,
38
- * tags, hide, flag come from the transaction store). Values come from the server, so a reader still
39
- * checks each value's runtime shape.
37
+ * List summary header's `amount`, `start_date` / `end_date` and `count`, see `readSummary`). Scalars,
38
+ * string lists or a `data_series` (the months a history drawer charts), omitted when the insight has
39
+ * none. Never carries copy or user actions (memo, tags, hide, flag come from the transaction store).
40
+ * Values come from the server, so a reader still checks each value's runtime shape.
40
41
  */
41
- export type DrilldownData = Record<string, string | number | boolean | null | string[]>;
42
+ export type DrilldownData = Record<string, string | number | boolean | null | string[] | DataSeries>;
42
43
  export interface InsightsPayload {
43
44
  widget_type: WidgetType;
44
45
  instance_slot: InstanceSlot;
@@ -1 +1 @@
1
- {"version":3,"file":"Insights.es.js","names":[],"sources":["../../../src/core/types/Insights.ts"],"sourcesContent":["// ============ Core InsightsV2 Types ============\n\nimport { InsightsInstanceSlotData } from './InsightsInstanceSlotData'\n\nexport interface ThemedSVGImageProps {\n divProps?: React.HTMLAttributes<HTMLDivElement>\n image: React.ComponentType<React.SVGProps<SVGSVGElement>>\n isMini?: boolean\n}\n\n/**\n * Emitted by a block when the user drills into a specific datum (e.g. clicks a\n * chart bar). Named fields rather than positional args so blocks with differing\n * shapes can extend this without the call sites transposing values.\n */\nexport interface DrilldownPayload {\n chartBarIndex: number\n tabIndex?: number\n transaction_guid?: string\n block?: string\n}\n\n/**\n * Which envelope a beat was fetched with. `embedded` (the transaction-row pill + details-drawer\n * card) and `notification` are V2 additions; a surface asks for one with `widget_type=` on the fetch.\n */\nexport type WidgetType = 'full' | 'mini' | 'micro' | 'embedded' | 'notification'\n\n/**\n * V2: the transaction-row tag, its own small section of the `embedded` envelope (the same grammar\n * as `description` / `footer`, with room for a tone or an icon later). Omitted for an insight that\n * tags no transaction row. It deliberately is *not* `short_title`, which stays a per-variant\n * attribute with a second consumer (the bank-holiday sub-header).\n */\nexport interface Pill {\n text: string\n}\n\n/**\n * V2: facts a drilldown shows that the card does not. On the payload: what every CTA of the card\n * shares (e.g. the account number for the Transaction Details drawer, or the guid list a list drawer\n * shows, `transaction_guids`). On a CTA: the figures that CTA's own drilldown renders (the Transaction\n * List summary header's `amount`, `start_date` / `end_date` and `count`, see `readSummary`). Scalars\n * or string lists, omitted when the insight has none. Never carries copy or user actions (memo,\n * tags, hide, flag come from the transaction store). Values come from the server, so a reader still\n * checks each value's runtime shape.\n */\nexport type DrilldownData = Record<string, string | number | boolean | null | string[]>\n\nexport interface InsightsPayload {\n widget_type: WidgetType\n instance_slot: InstanceSlot\n /**\n * V1 only. The v2 contract carries everything a block needs on `instance_slot.data`,\n * and omits this key entirely (see the LargeTransactionV2 payload). Blocks that still require it\n * get it as a required field through `BlockProps`, which re-declares it.\n */\n instance_slot_data?: InsightsInstanceSlotData\n description: Description\n primary_cta?: PrimaryCTA\n secondary_cta?: SecondaryCTA\n title?: string\n sub_title?: Subtitle\n /**\n * V2 rename of `sub_title`: a flat string, with the logo promoted to the payload-level `logo`\n * field below. `sub_title` wins when both are present.\n */\n subtitle?: string\n /** V2: header logo paired with the flat `subtitle`: an entity guid or a status icon (`LogoRef`). */\n logo?: LogoRef\n /** V2: which design branch the backend picked (e.g. `no_merchant`). */\n variant?: string\n /** V2, `embedded` envelope only: the transaction-row pill. */\n pill?: Pill\n /**\n * V2: drilldown-only facts, e.g. `{ account_number: 'XXXXXXXX043' }`, or the guid list a list\n * drawer shows (`{ transaction_guids: [...] }`).\n */\n drilldown_data?: DrilldownData\n footer?: Footer\n /**\n * V2: the link inside the description: on the full card a drawer of its own (Low Account\n * Balance's \"Transactions ›\"); on mini and micro the card's action, sent instead of `primary_cta`.\n * Absent when the beat has no link.\n */\n in_description_cta?: InDescriptionCTA\n guid: string\n user_guid: string\n client_guid?: string\n /** Template name, e.g. `LargeTransactionV2`. */\n template?: string\n revision?: number\n /** Unix seconds. */\n created_at?: number\n /** Unix seconds. */\n updated_at?: number\n /** Unix seconds. */\n active_at?: number\n displayed_at?: number | null\n dismissed_at: number | null\n cta_clicked_at?: number | null\n has_been_displayed?: boolean\n is_dismissed: boolean\n is_deleted?: boolean\n is_hidden_by_system?: boolean\n is_obsolete?: boolean\n is_refreshable?: boolean\n is_sampled?: boolean\n is_zero_state?: boolean\n status?: string | null\n /**\n * V2 (LargeTransactionV2 onward): the entities the beat is about, carried on the payload so\n * action blocks do not have to reach back out to the beat envelope.\n */\n primary_account_guid?: string | null\n primary_transaction_guid?: string | null\n primary_category_guid?: string | null\n primary_merchant_guid?: string | null\n /**\n * V2: the repeating transaction a subscription beat is about (Upcoming Subscription, Subscription\n * Price Increase). Read by `recurring_transaction_block`, see\n * `actionBlocks/RecurringTransactionBlock/subscriptionBeats.ts`.\n */\n primary_repeating_transaction_guid?: string | null\n}\n\nexport interface Legends {\n label: string\n value: number\n additional_value?: number\n additional_value_type?: string\n value_type?: string\n}\n\nexport interface Logo {\n category_guid?: string\n category_name?: string\n institution_guid?: string\n institution_name?: string\n logo_color?: string\n /** Draw the `logo_name` icon filled (V2 `ICO-` logos). */\n logo_fill?: boolean\n logo_name?: string\n merchant_guid?: string\n merchant_name?: string\n}\n\nexport interface Subtitle {\n logo?: Logo\n text: string\n}\n\n/**\n * A V2 logo, shared by the header (`InsightsPayload.logo`) and every instance-slot row. It takes\n * one of two shapes:\n *\n * - **Entity**: `guid`, whose prefix (`INS-` / `MCH-` / `CAT-`) picks the logo component, plus an\n * optional `fallback_guid` for when that component's asset cannot load. Today that is the\n * category behind an `MCH-` guid, which `MerchantLogo` shows as a tile when the merchant image\n * is missing.\n * - **Status icon**: `icon` (an mx-icons name, e.g. `warning`) and `color` (a theme palette path,\n * e.g. `error.main`), for subheaders that show a state rather than an entity (V1's\n * `logo_name` / `logo_color`).\n *\n * `alt` is the accessible name for either shape. A logo sends one shape; if it sends both, `icon`\n * wins, as `logo_name` does in V1's `SubHeader`.\n */\nexport interface LogoRef {\n alt?: string\n color?: string\n fallback_guid?: string\n guid?: string\n icon?: string\n}\n\nexport interface CategoryLogo {\n category_guid: string\n category_name: string\n}\n\nexport interface MerchantLogo {\n merchant_guid: string\n merchant_name: string\n}\n\nexport interface InstitutionLogo {\n institution_guid: string\n institution_name: string\n}\n\nexport interface Description {\n text: string\n html_text: string\n}\n\n/**\n * Post message a CTA press sends to the host, resolved by the backend for the beat's current\n * state. Absent/null = the backend has not described one: the frontend uses the template's\n * interim `ctaPostMessages` entry if there is one, else sends no message. `payload` carries only\n * beat-specific extras; the frontend always adds `beat_guid`, `beat_template`, `user_guid` and\n * `action_string`.\n */\nexport interface CtaPostMessageMetadata {\n /** Post message event; defaults to `beat/cta`. */\n event?: string | null\n /** Operation the host should perform, e.g. `op_1`, `op_2`, `op_3`. Defaults to `op_1`. */\n action?: string | null\n /** Beat-specific fields merged into the message metadata (account ids, amounts, ...). */\n payload?: Record<string, unknown> | null\n}\n\nexport interface PrimaryCTA {\n label: string\n block: string\n variant?: string | null\n /**\n * What pressing the CTA does beyond opening its block, named by the backend (ditto\n * `primary_cta_action`, passed through by tupac). Looked up in `insights-v2/ctaActions`;\n * null / absent / unknown means the CTA only opens its block or posts its message.\n */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\nexport interface SecondaryCTA {\n label: string\n /**\n * Drawer block to open. `null` when the CTA opens nothing (ditto `secondary_cta_block: null`,\n * e.g. Fee Detected's \"Contact Support\"): the press posts its message to the host instead.\n */\n block: string | null\n variant?: string | null\n /** See `PrimaryCTA.action_key` (ditto `secondary_cta_action`). */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\n/**\n * The description link: its label, the action block it opens and, like a CTA's, the variant that\n * tells that block what to show (ditto's `in_description_cta_variant`, e.g. `low_balance`). On mini\n * and micro it words the card's action; `block` is empty when that action opens no drawer.\n */\nexport interface InDescriptionCTA {\n label: string\n block?: string\n variant?: string | null\n action_key?: string | null\n /** tupac's flat host message for the link (`action` plus fields), e.g. Switch's op_1. */\n post_message_metadata?: ({ action?: string | null } & Record<string, unknown>) | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\nexport interface Footer {\n /** V1: a pre-formatted date string. */\n date?: string\n /**\n * The account label, on both V1 and V2. The backend resolves the plurality: one account sends\n * its name (e.g. `Epic Bank`), several send a localized count (e.g. `2 Accounts`), none sends\n * `null` (tupac's `footer_account_label` returns nil for a beat with no accounts, as Payday Cash\n * Left Over Status does). There is deliberately no separate `accounts` key.\n */\n account?: string | null\n /**\n * V2 (LargeTransactionV2 onward): unix seconds, formatted by `Footer` for display.\n * Replaces `date`; `date` wins when a beat somehow sends both.\n */\n timestamp?: number\n}\n\n// ============ Instance Slot Types ============\n// Values are the snake_case block names the backend sends on a beat's instance slot; the PascalCase\n// keys stay as friendly references (e.g. BlockType.BarChartBlock === 'bar_chart_block').\nexport const BlockType = {\n AccountBlock: 'account_block',\n AccountSwitchBlock: 'account_switch_block',\n BarChartBlock: 'bar_chart_block',\n BudgetBlock: 'budget_block',\n DirectDepositBlock: 'direct_deposit_block',\n ImageBlock: 'image_block',\n MerchantBlock: 'merchant_block',\n TransactionBlock: 'transaction_block',\n DonutChartBlock: 'donut_chart_block',\n DoubleBarChartBlock: 'double_bar_chart_block',\n DoubleProgressBarBlock: 'double_progress_bar_block',\n DebtsBlock: 'debts_block',\n GasPurchaseBlock: 'gas_purchase_block',\n GoalsBlock: 'goals_block',\n NoSpendDaysBlock: 'no_spend_days_block',\n QuizBlock: 'quiz_block',\n RepeatingTransactionBlock: 'repeating_transaction_block',\n SaveExtraBlock: 'save_extra_block',\n SavingsAmountBlock: 'savings_amount_block',\n SavingsSummaryBlock: 'savings_summary_block',\n StepChartBlock: 'step_chart_block',\n SVGImageBlock: 'svg_image_block',\n UpcomingBillBlock: 'upcoming_bill_block',\n UpcomingSubscriptionBlock: 'upcoming_subscription_block',\n WeeklySmallPurchasesBlock: 'weekly_small_purchases_block',\n WithdrawalBlock: 'withdrawal_block',\n} as const\n\nexport type BlockType = (typeof BlockType)[keyof typeof BlockType]\n\n/**\n * A pre-localized row on a V2 instance slot. The backend resolves the copy and formatting; the\n * logo is a `LogoRef` (an entity guid or a status icon, see `logoFromRef`).\n */\nexport interface InstanceSlotRow {\n amount?: number\n logo?: LogoRef\n primary_text?: string\n secondary_text?: string\n}\n\n/**\n * V2: the slots a block's variant filled, keyed by slot name; ditto owns the names and omits any\n * slot it has no value for (`lib/ditto/blocks/<block>.yml`). Read with `slot()`, which names the\n * kind the caller expects.\n */\nexport interface InstanceSlotData {\n [slot: string]: unknown\n}\n\n/**\n * Reads one slot off a block's `data`; undefined when ditto did not fill it.\n *\n * The caller names the kind, because the slot's kind lives in the block's ditto schema and not\n * here — a block fills slots with whatever its card needs, so no fixed list of kinds would hold\n * (`account_switch_block` alone carries a boolean and `budget_block` a nested object).\n */\nexport const slot = <T = unknown>(\n data: InstanceSlotData | undefined,\n name: string,\n): T | undefined => data?.[name] as T | undefined\n\n/**\n * V2: which block renders this beat's content, and what it renders.\n *\n * `block` is optional: a beat whose template has no ditto config arrives as an empty `{}` and the\n * card renders its copy and CTAs alone, so a reader cannot assume a block is named. One interface\n * with `block` optional rather than a union with `Record<string, never>`, which TypeScript absorbs\n * — that union left `block` reading as required and typed a promise it did not keep.\n *\n * `variant` is optional for the same reason — the empty `{}` carries neither. Every ditto beat\n * file that names a block also names a variant, so a *filled* slot always has one; ditto drops a\n * nil variant rather than sending null, which is why the type is `string | null | undefined`.\n */\nexport interface InstanceSlot {\n block?: BlockType\n variant?: string | null\n /** The slots this block's variant declares in ditto. */\n data?: InstanceSlotData\n // Direct Deposit block (Set Up Direct Deposit, Switch Direct Deposit, Missing\n // Interest Rate): account facts carried flat on the slot, beside `data`.\n /** Primary line on the hero card, e.g. \"Epic Bank Checking, *1234\". */\n account_name?: string\n /** Secondary line beneath the name, e.g. \"Checking Account\" / \"Credit Card\". */\n account_type?: string\n /** Status pill label, e.g. \"Direct Deposit Not Set Up\" / \"Interest Rate: 19.99% APR\". */\n status_text?: string\n institution_guid?: string\n institution_name?: string\n // Shared across multiple V2 component blocks:\n // `amount` — UpcomingBillBlock (projected bill), UpcomingSubscriptionBlock (price per cadence).\n // (SavingsOpportunityBlock now reads `amount` off `instance_slot.data`, not this flat field.)\n // `merchant_guid` / `merchant_name` — UpcomingBillBlock (bill row logo + name),\n // UpcomingSubscriptionBlock (hero logo + name).\n /** Dollar amount (unformatted); the block formats it as currency. */\n amount?: number\n // Withdrawal block (Emergency Fund Withdrawal): one row flat on the slot - `amount` above is the\n // withdrawal, shown with its date line \"{amount_label} {withdrawal_date}\" over the balance row.\n /** Pre-localized lead-in for the date line, e.g. \"Withdrawn on\". */\n amount_label?: string\n /** The withdrawal's calendar day, `YYYY-MM-DD` (e.g. `2026-10-20`); the card formats it. */\n withdrawal_date?: string\n /** Account balance after the withdrawal (unformatted); the card formats it as currency. */\n balance?: number\n /** Pre-localized label for the balance row, e.g. \"Balance\". */\n balance_label?: string\n /** Merchant guid used to render the inline / hero logo via `LogoFromGuid` (`MCH-...`). */\n merchant_guid?: string\n /** Merchant display name — shown as logo alt text and as the merchant/hero label. */\n merchant_name?: string\n // Upcoming Bill block (Projected Bill Payment): the block derives the Sun→Sat week strip\n // around `due_date` at render time.\n /** Due date of the projected bill in ISO form (e.g. `2025-10-30`). */\n due_date?: string\n // Account block (confetti tile): V1 flat fallback for the label line when `instance_slot.data` is\n // absent — `AccountBlock` reads `data.sub_text` first, then this. (The Savings Opportunity coupon\n // now reads `primary_text`/`amount` off `data`, so it no longer reads this flat field.)\n /** Caption/label line for the confetti tile (V1 fallback). */\n label?: string\n // Upcoming Subscription block: billing cadence for the price pill (`${amount} / ${cadence}`).\n /** Billing cadence word that trails the price, e.g. `month` or `year`. */\n cadence?: string\n // Account block (status on/off-track, deposit, payoff variants): card content carried flat on\n // the slot (the V2 contract drops `instance_slot_data`). `amount`, `label`, `merchant_guid`,\n // `merchant_name`, `institution_guid`, `institution_name` are shared fields declared above.\n /** Secondary line beneath the amount on the standard card, e.g. \"Remaining after expenses\". */\n sub_text?: string\n /** Header bar text (standard card) or the colored category strip label (deposit cards). */\n header_text?: string\n /** Generic-tile icon name used when no merchant/institution logo is available. */\n icon_name?: string\n /** Category guid used to render the deposit-card logo fallback. */\n category_guid?: string\n // Debts block: `amount` is the current balance; the shared account/institution fields above.\n /** Projected payoff date in ISO form (e.g. `2027-03-01`); the block formats it as month + year. */\n payoff_date?: string\n /** Monthly payment toward the debt (unformatted); the block formats it as currency. */\n monthly_payment?: number\n /** Annual interest rate as a percentage (e.g. `19.99`); the block formats it as a percent. */\n interest_rate?: number\n start_date?: string\n no_spend_days?: string[]\n /** First day of the month a monthly summary covers, in ISO form (e.g. `2026-09-01`). */\n date?: string\n /** Number of gas station visits in the month. */\n total_fill_up_visits?: number\n /** Amount spent at gas stations in the month, unformatted. */\n total_spend?: number\n /** V1 name for `total_spend`, read when `total_spend` is absent. */\n total_debt_for_fill_up_visits_in_prev_month?: number\n /** Total available balance across the user's accounts, unformatted. */\n available_balance?: number\n /** Average monthly spend, unformatted. */\n avg_monthly_spend?: number\n /** How long the balance lasts, e.g. \"2 months, 11 days\". */\n time_period?: string\n /** One row per unique merchant in the period, in the order sent. */\n data_series?: InstanceSlotRow[]\n}\n"],"mappings":"AA+UA,IAAa,IAAA,CACX,GACA,MACkB,IAAO,CAAA"}
1
+ {"version":3,"file":"Insights.es.js","names":[],"sources":["../../../src/core/types/Insights.ts"],"sourcesContent":["// ============ Core InsightsV2 Types ============\n\nimport type { DataSeries } from './Beat'\nimport { InsightsInstanceSlotData } from './InsightsInstanceSlotData'\n\nexport interface ThemedSVGImageProps {\n divProps?: React.HTMLAttributes<HTMLDivElement>\n image: React.ComponentType<React.SVGProps<SVGSVGElement>>\n isMini?: boolean\n}\n\n/**\n * Emitted by a block when the user drills into a specific datum (e.g. clicks a\n * chart bar). Named fields rather than positional args so blocks with differing\n * shapes can extend this without the call sites transposing values.\n */\nexport interface DrilldownPayload {\n chartBarIndex: number\n tabIndex?: number\n transaction_guid?: string\n block?: string\n}\n\n/**\n * Which envelope a beat was fetched with. `embedded` (the transaction-row pill + details-drawer\n * card) and `notification` are V2 additions; a surface asks for one with `widget_type=` on the fetch.\n */\nexport type WidgetType = 'full' | 'mini' | 'micro' | 'embedded' | 'notification'\n\n/**\n * V2: the transaction-row tag, its own small section of the `embedded` envelope (the same grammar\n * as `description` / `footer`, with room for a tone or an icon later). Omitted for an insight that\n * tags no transaction row. It deliberately is *not* `short_title`, which stays a per-variant\n * attribute with a second consumer (the bank-holiday sub-header).\n */\nexport interface Pill {\n text: string\n}\n\n/**\n * V2: facts a drilldown shows that the card does not. On the payload: what every CTA of the card\n * shares (e.g. the account number for the Transaction Details drawer, or the guid list a list drawer\n * shows, `transaction_guids`). On a CTA: the figures that CTA's own drilldown renders (the Transaction\n * List summary header's `amount`, `start_date` / `end_date` and `count`, see `readSummary`). Scalars,\n * string lists or a `data_series` (the months a history drawer charts), omitted when the insight has\n * none. Never carries copy or user actions (memo, tags, hide, flag come from the transaction store).\n * Values come from the server, so a reader still checks each value's runtime shape.\n */\nexport type DrilldownData = Record<string, string | number | boolean | null | string[] | DataSeries>\n\nexport interface InsightsPayload {\n widget_type: WidgetType\n instance_slot: InstanceSlot\n /**\n * V1 only. The v2 contract carries everything a block needs on `instance_slot.data`,\n * and omits this key entirely (see the LargeTransactionV2 payload). Blocks that still require it\n * get it as a required field through `BlockProps`, which re-declares it.\n */\n instance_slot_data?: InsightsInstanceSlotData\n description: Description\n primary_cta?: PrimaryCTA\n secondary_cta?: SecondaryCTA\n title?: string\n sub_title?: Subtitle\n /**\n * V2 rename of `sub_title`: a flat string, with the logo promoted to the payload-level `logo`\n * field below. `sub_title` wins when both are present.\n */\n subtitle?: string\n /** V2: header logo paired with the flat `subtitle`: an entity guid or a status icon (`LogoRef`). */\n logo?: LogoRef\n /** V2: which design branch the backend picked (e.g. `no_merchant`). */\n variant?: string\n /** V2, `embedded` envelope only: the transaction-row pill. */\n pill?: Pill\n /**\n * V2: drilldown-only facts, e.g. `{ account_number: 'XXXXXXXX043' }`, or the guid list a list\n * drawer shows (`{ transaction_guids: [...] }`).\n */\n drilldown_data?: DrilldownData\n footer?: Footer\n /**\n * V2: the link inside the description: on the full card a drawer of its own (Low Account\n * Balance's \"Transactions ›\"); on mini and micro the card's action, sent instead of `primary_cta`.\n * Absent when the beat has no link.\n */\n in_description_cta?: InDescriptionCTA\n guid: string\n user_guid: string\n client_guid?: string\n /** Template name, e.g. `LargeTransactionV2`. */\n template?: string\n revision?: number\n /** Unix seconds. */\n created_at?: number\n /** Unix seconds. */\n updated_at?: number\n /** Unix seconds. */\n active_at?: number\n displayed_at?: number | null\n dismissed_at: number | null\n cta_clicked_at?: number | null\n has_been_displayed?: boolean\n is_dismissed: boolean\n is_deleted?: boolean\n is_hidden_by_system?: boolean\n is_obsolete?: boolean\n is_refreshable?: boolean\n is_sampled?: boolean\n is_zero_state?: boolean\n status?: string | null\n /**\n * V2 (LargeTransactionV2 onward): the entities the beat is about, carried on the payload so\n * action blocks do not have to reach back out to the beat envelope.\n */\n primary_account_guid?: string | null\n primary_transaction_guid?: string | null\n primary_category_guid?: string | null\n primary_merchant_guid?: string | null\n /**\n * V2: the repeating transaction a subscription beat is about (Upcoming Subscription, Subscription\n * Price Increase). Read by `recurring_transaction_block`, see\n * `actionBlocks/RecurringTransactionBlock/subscriptionBeats.ts`.\n */\n primary_repeating_transaction_guid?: string | null\n}\n\nexport interface Legends {\n label: string\n value: number\n additional_value?: number\n additional_value_type?: string\n value_type?: string\n}\n\nexport interface Logo {\n category_guid?: string\n category_name?: string\n institution_guid?: string\n institution_name?: string\n logo_color?: string\n /** Draw the `logo_name` icon filled (V2 `ICO-` logos). */\n logo_fill?: boolean\n logo_name?: string\n merchant_guid?: string\n merchant_name?: string\n}\n\nexport interface Subtitle {\n logo?: Logo\n text: string\n}\n\n/**\n * A V2 logo, shared by the header (`InsightsPayload.logo`) and every instance-slot row. It takes\n * one of two shapes:\n *\n * - **Entity**: `guid`, whose prefix (`INS-` / `MCH-` / `CAT-`) picks the logo component, plus an\n * optional `fallback_guid` for when that component's asset cannot load. Today that is the\n * category behind an `MCH-` guid, which `MerchantLogo` shows as a tile when the merchant image\n * is missing.\n * - **Status icon**: `icon` (an mx-icons name, e.g. `warning`) and `color` (a theme palette path,\n * e.g. `error.main`), for subheaders that show a state rather than an entity (V1's\n * `logo_name` / `logo_color`).\n *\n * `alt` is the accessible name for either shape. A logo sends one shape; if it sends both, `icon`\n * wins, as `logo_name` does in V1's `SubHeader`.\n */\nexport interface LogoRef {\n alt?: string\n color?: string\n fallback_guid?: string\n guid?: string\n icon?: string\n}\n\nexport interface CategoryLogo {\n category_guid: string\n category_name: string\n}\n\nexport interface MerchantLogo {\n merchant_guid: string\n merchant_name: string\n}\n\nexport interface InstitutionLogo {\n institution_guid: string\n institution_name: string\n}\n\nexport interface Description {\n text: string\n html_text: string\n}\n\n/**\n * Post message a CTA press sends to the host, resolved by the backend for the beat's current\n * state. Absent/null = the backend has not described one: the frontend uses the template's\n * interim `ctaPostMessages` entry if there is one, else sends no message. `payload` carries only\n * beat-specific extras; the frontend always adds `beat_guid`, `beat_template`, `user_guid` and\n * `action_string`.\n */\nexport interface CtaPostMessageMetadata {\n /** Post message event; defaults to `beat/cta`. */\n event?: string | null\n /** Operation the host should perform, e.g. `op_1`, `op_2`, `op_3`. Defaults to `op_1`. */\n action?: string | null\n /** Beat-specific fields merged into the message metadata (account ids, amounts, ...). */\n payload?: Record<string, unknown> | null\n}\n\nexport interface PrimaryCTA {\n label: string\n block: string\n variant?: string | null\n /**\n * What pressing the CTA does beyond opening its block, named by the backend (ditto\n * `primary_cta_action`, passed through by tupac). Looked up in `insights-v2/ctaActions`;\n * null / absent / unknown means the CTA only opens its block or posts its message.\n */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\nexport interface SecondaryCTA {\n label: string\n /**\n * Drawer block to open. `null` when the CTA opens nothing (ditto `secondary_cta_block: null`,\n * e.g. Fee Detected's \"Contact Support\"): the press posts its message to the host instead.\n */\n block: string | null\n variant?: string | null\n /** See `PrimaryCTA.action_key` (ditto `secondary_cta_action`). */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\n/**\n * The description link: its label, the action block it opens and, like a CTA's, the variant that\n * tells that block what to show (ditto's `in_description_cta_variant`, e.g. `low_balance`). On mini\n * and micro it words the card's action; `block` is empty when that action opens no drawer.\n */\nexport interface InDescriptionCTA {\n label: string\n block?: string\n variant?: string | null\n action_key?: string | null\n /** tupac's flat host message for the link (`action` plus fields), e.g. Switch's op_1. */\n post_message_metadata?: ({ action?: string | null } & Record<string, unknown>) | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\nexport interface Footer {\n /** V1: a pre-formatted date string. */\n date?: string\n /**\n * The account label, on both V1 and V2. The backend resolves the plurality: one account sends\n * its name (e.g. `Epic Bank`), several send a localized count (e.g. `2 Accounts`), none sends\n * `null` (tupac's `footer_account_label` returns nil for a beat with no accounts, as Payday Cash\n * Left Over Status does). There is deliberately no separate `accounts` key.\n */\n account?: string | null\n /**\n * V2 (LargeTransactionV2 onward): unix seconds, formatted by `Footer` for display.\n * Replaces `date`; `date` wins when a beat somehow sends both.\n */\n timestamp?: number\n}\n\n// ============ Instance Slot Types ============\n// Values are the snake_case block names the backend sends on a beat's instance slot; the PascalCase\n// keys stay as friendly references (e.g. BlockType.BarChartBlock === 'bar_chart_block').\nexport const BlockType = {\n AccountBlock: 'account_block',\n AccountSwitchBlock: 'account_switch_block',\n BarChartBlock: 'bar_chart_block',\n BudgetBlock: 'budget_block',\n DirectDepositBlock: 'direct_deposit_block',\n ImageBlock: 'image_block',\n MerchantBlock: 'merchant_block',\n TransactionBlock: 'transaction_block',\n DonutChartBlock: 'donut_chart_block',\n DoubleBarChartBlock: 'double_bar_chart_block',\n DoubleProgressBarBlock: 'double_progress_bar_block',\n DebtsBlock: 'debts_block',\n GasPurchaseBlock: 'gas_purchase_block',\n GoalsBlock: 'goals_block',\n NoSpendDaysBlock: 'no_spend_days_block',\n QuizBlock: 'quiz_block',\n RepeatingTransactionBlock: 'repeating_transaction_block',\n SaveExtraBlock: 'save_extra_block',\n SavingsAmountBlock: 'savings_amount_block',\n SavingsSummaryBlock: 'savings_summary_block',\n StepChartBlock: 'step_chart_block',\n SVGImageBlock: 'svg_image_block',\n UpcomingBillBlock: 'upcoming_bill_block',\n UpcomingSubscriptionBlock: 'upcoming_subscription_block',\n WeeklySmallPurchasesBlock: 'weekly_small_purchases_block',\n WithdrawalBlock: 'withdrawal_block',\n} as const\n\nexport type BlockType = (typeof BlockType)[keyof typeof BlockType]\n\n/**\n * A pre-localized row on a V2 instance slot. The backend resolves the copy and formatting; the\n * logo is a `LogoRef` (an entity guid or a status icon, see `logoFromRef`).\n */\nexport interface InstanceSlotRow {\n amount?: number\n logo?: LogoRef\n primary_text?: string\n secondary_text?: string\n}\n\n/**\n * V2: the slots a block's variant filled, keyed by slot name; ditto owns the names and omits any\n * slot it has no value for (`lib/ditto/blocks/<block>.yml`). Read with `slot()`, which names the\n * kind the caller expects.\n */\nexport interface InstanceSlotData {\n [slot: string]: unknown\n}\n\n/**\n * Reads one slot off a block's `data`; undefined when ditto did not fill it.\n *\n * The caller names the kind, because the slot's kind lives in the block's ditto schema and not\n * here — a block fills slots with whatever its card needs, so no fixed list of kinds would hold\n * (`account_switch_block` alone carries a boolean and `budget_block` a nested object).\n */\nexport const slot = <T = unknown>(\n data: InstanceSlotData | undefined,\n name: string,\n): T | undefined => data?.[name] as T | undefined\n\n/**\n * V2: which block renders this beat's content, and what it renders.\n *\n * `block` is optional: a beat whose template has no ditto config arrives as an empty `{}` and the\n * card renders its copy and CTAs alone, so a reader cannot assume a block is named. One interface\n * with `block` optional rather than a union with `Record<string, never>`, which TypeScript absorbs\n * — that union left `block` reading as required and typed a promise it did not keep.\n *\n * `variant` is optional for the same reason — the empty `{}` carries neither. Every ditto beat\n * file that names a block also names a variant, so a *filled* slot always has one; ditto drops a\n * nil variant rather than sending null, which is why the type is `string | null | undefined`.\n */\nexport interface InstanceSlot {\n block?: BlockType\n variant?: string | null\n /** The slots this block's variant declares in ditto. */\n data?: InstanceSlotData\n // Direct Deposit block (Set Up Direct Deposit, Switch Direct Deposit, Missing\n // Interest Rate): account facts carried flat on the slot, beside `data`.\n /** Primary line on the hero card, e.g. \"Epic Bank Checking, *1234\". */\n account_name?: string\n /** Secondary line beneath the name, e.g. \"Checking Account\" / \"Credit Card\". */\n account_type?: string\n /** Status pill label, e.g. \"Direct Deposit Not Set Up\" / \"Interest Rate: 19.99% APR\". */\n status_text?: string\n institution_guid?: string\n institution_name?: string\n // Shared across multiple V2 component blocks:\n // `amount` — UpcomingBillBlock (projected bill), UpcomingSubscriptionBlock (price per cadence).\n // (SavingsOpportunityBlock now reads `amount` off `instance_slot.data`, not this flat field.)\n // `merchant_guid` / `merchant_name` — UpcomingBillBlock (bill row logo + name),\n // UpcomingSubscriptionBlock (hero logo + name).\n /** Dollar amount (unformatted); the block formats it as currency. */\n amount?: number\n // Withdrawal block (Emergency Fund Withdrawal): one row flat on the slot - `amount` above is the\n // withdrawal, shown with its date line \"{amount_label} {withdrawal_date}\" over the balance row.\n /** Pre-localized lead-in for the date line, e.g. \"Withdrawn on\". */\n amount_label?: string\n /** The withdrawal's calendar day, `YYYY-MM-DD` (e.g. `2026-10-20`); the card formats it. */\n withdrawal_date?: string\n /** Account balance after the withdrawal (unformatted); the card formats it as currency. */\n balance?: number\n /** Pre-localized label for the balance row, e.g. \"Balance\". */\n balance_label?: string\n /** Merchant guid used to render the inline / hero logo via `LogoFromGuid` (`MCH-...`). */\n merchant_guid?: string\n /** Merchant display name — shown as logo alt text and as the merchant/hero label. */\n merchant_name?: string\n // Upcoming Bill block (Projected Bill Payment): the block derives the Sun→Sat week strip\n // around `due_date` at render time.\n /** Due date of the projected bill in ISO form (e.g. `2025-10-30`). */\n due_date?: string\n // Account block (confetti tile): V1 flat fallback for the label line when `instance_slot.data` is\n // absent — `AccountBlock` reads `data.sub_text` first, then this. (The Savings Opportunity coupon\n // now reads `primary_text`/`amount` off `data`, so it no longer reads this flat field.)\n /** Caption/label line for the confetti tile (V1 fallback). */\n label?: string\n // Upcoming Subscription block: billing cadence for the price pill (`${amount} / ${cadence}`).\n /** Billing cadence word that trails the price, e.g. `month` or `year`. */\n cadence?: string\n // Account block (status on/off-track, deposit, payoff variants): card content carried flat on\n // the slot (the V2 contract drops `instance_slot_data`). `amount`, `label`, `merchant_guid`,\n // `merchant_name`, `institution_guid`, `institution_name` are shared fields declared above.\n /** Secondary line beneath the amount on the standard card, e.g. \"Remaining after expenses\". */\n sub_text?: string\n /** Header bar text (standard card) or the colored category strip label (deposit cards). */\n header_text?: string\n /** Generic-tile icon name used when no merchant/institution logo is available. */\n icon_name?: string\n /** Category guid used to render the deposit-card logo fallback. */\n category_guid?: string\n // Debts block: `amount` is the current balance; the shared account/institution fields above.\n /** Projected payoff date in ISO form (e.g. `2027-03-01`); the block formats it as month + year. */\n payoff_date?: string\n /** Monthly payment toward the debt (unformatted); the block formats it as currency. */\n monthly_payment?: number\n /** Annual interest rate as a percentage (e.g. `19.99`); the block formats it as a percent. */\n interest_rate?: number\n start_date?: string\n no_spend_days?: string[]\n /** First day of the month a monthly summary covers, in ISO form (e.g. `2026-09-01`). */\n date?: string\n /** Number of gas station visits in the month. */\n total_fill_up_visits?: number\n /** Amount spent at gas stations in the month, unformatted. */\n total_spend?: number\n /** V1 name for `total_spend`, read when `total_spend` is absent. */\n total_debt_for_fill_up_visits_in_prev_month?: number\n /** Total available balance across the user's accounts, unformatted. */\n available_balance?: number\n /** Average monthly spend, unformatted. */\n avg_monthly_spend?: number\n /** How long the balance lasts, e.g. \"2 months, 11 days\". */\n time_period?: string\n /** One row per unique merchant in the period, in the order sent. */\n data_series?: InstanceSlotRow[]\n}\n"],"mappings":"AAgVA,IAAa,IAAA,CACX,GACA,MACkB,IAAO,CAAA"}
@@ -2,7 +2,7 @@
2
2
  interface DynamicKeyValue {
3
3
  [key: string]: string;
4
4
  }
5
- interface GeneralInsightsFeedCopy {
5
+ export interface GeneralInsightsFeedCopy {
6
6
  decreased_text: string;
7
7
  dismiss: string;
8
8
  embedded_description: string;
@@ -51,6 +51,36 @@ interface GeneralInsightsFeedCopy {
51
51
  subscribed?: string;
52
52
  not_subscribed?: string;
53
53
  undo?: string;
54
+ /** Debt Payoff Strategies drawer words (the pulse drawer's keys); optional until mrs_content ships them to every host. */
55
+ avalanche?: string;
56
+ snowball?: string;
57
+ debt_payoff_strategies?: string;
58
+ the_strategy?: string;
59
+ pros?: string;
60
+ cons?: string;
61
+ pay_off_debts_with_high_interest_rates_first?: string;
62
+ pay_off_debts_with_low_balances_first?: string;
63
+ fastest_way_to_eliminate_debt?: string;
64
+ costs_less_in_interest?: string;
65
+ takes_time_to_see_results?: string;
66
+ requires_patience_and_discipline?: string;
67
+ provides_small_wins_quickly?: string;
68
+ builds_momentum_to_pay_off_debts?: string;
69
+ takes_longer_to_pay_off_all_debts?: string;
70
+ may_cost_more_in_interest?: string;
71
+ how_to_get_started?: string;
72
+ step_one?: string;
73
+ step_two?: string;
74
+ step_three?: string;
75
+ make_minimum_monthly_payments_on_all_debt_accounts?: string;
76
+ when_possible_pay_extra_on_the_account_with_the_highest_interest_rate?: string;
77
+ when_possible_pay_extra_on_the_account_with_the_lowest_balance?: string;
78
+ when_paid_off_move_to_the_next_debt_with_the_highest?: string;
79
+ when_paid_off_move_to_the_next_debt_with_the_lowest?: string;
80
+ highest_to_lowest_rate?: string;
81
+ lowest_to_highest_balance?: string;
82
+ balance?: string;
83
+ interest_rate?: string;
54
84
  }
55
85
  interface SettingsMenuCopy {
56
86
  close: string;
@@ -124,6 +154,8 @@ export interface TransactionHistoryBlock {
124
154
  non_essential_category_summary_drawer_title: string;
125
155
  monthly_deposit_summary_drawer_title: string;
126
156
  monthly_subscription_aggregate_drawer_title: string;
157
+ /** Merchant Budget's Spending History drawer; optional until the localized-content service ships it. */
158
+ merchant_budget_drawer_title?: string;
127
159
  /** Upcoming Bill tip: `_1{tip}`, `_2{merchant}`, `_3{date}`; optional, no tip without it. */
128
160
  upcoming_bill_tip_message?: string;
129
161
  /**
@@ -0,0 +1,9 @@
1
+ import { ActionBlockProps } from '../../mappings/blocks';
2
+ /**
3
+ * Debt Payoff Strategies drawer: Avalanche / Snowball tabs, each with the strategy's words and the
4
+ * beat's debt accounts in that strategy's order. A tapped account opens its Account Details (the
5
+ * shared AccountDetailsBlock) in a nested drawer.
6
+ */
7
+ export declare const PayoffStrategiesBlock: (({ beat, }: ActionBlockProps) => import("react/jsx-runtime").JSX.Element) & {
8
+ displayName: string;
9
+ };
@@ -0,0 +1,42 @@
1
+ import { useAccountStore as d, useGlobalCopyStore as g, useGlobalStore as y } from "../../../common/context/hooks.es.js";
2
+ import S from "../../../common/components/drawer/Drawer.es.js";
3
+ import i from "../../../common/components/Loader.es.js";
4
+ import { AccountDetailsBlock as A } from "../AccountDetailsBlock/AccountDetailsBlock.es.js";
5
+ import { buildStrategies as _, resolveStrategyAccounts as C, toPayoffAccountRow as h } from "./layout.es.js";
6
+ import b from "./PayoffStrategiesContent.es.js";
7
+ import { useState as k } from "react";
8
+ import { observer as v } from "mobx-react-lite";
9
+ import w from "@mui/material/Stack";
10
+ import { Text as x } from "@mxenabled/mxui";
11
+ import { Fragment as G, jsx as o, jsxs as P } from "react/jsx-runtime";
12
+ var E = v(function({ beat: r }) {
13
+ const [t, c] = k(null), { copyStore: s } = y(), { accounts: n, common: a, insights_feed: l } = g(), { accountsLoaded: m, visibleAccounts: u } = d(), e = l?.general;
14
+ if (!s.isInitialized) return /* @__PURE__ */ o(i, {});
15
+ if (!e) return /* @__PURE__ */ o(w, {
16
+ sx: { p: 24 },
17
+ children: /* @__PURE__ */ o(x, { children: a?.error_message ?? "Something went wrong." })
18
+ });
19
+ if (!m) return /* @__PURE__ */ o(i, {});
20
+ const p = C(r, u).map(h), f = () => c(null);
21
+ return /* @__PURE__ */ P(G, { children: [/* @__PURE__ */ o(b, {
22
+ accounts: p,
23
+ copy: e,
24
+ onAccountClick: c,
25
+ strategies: _(e)
26
+ }), /* @__PURE__ */ o(S, {
27
+ ariaLabelClose: n?.close_account_details_aria,
28
+ isOpen: t !== null,
29
+ onClose: f,
30
+ title: n?.account_details,
31
+ children: t && /* @__PURE__ */ o(A, { beat: {
32
+ ...r,
33
+ primary_account: void 0,
34
+ primary_account_guid: t
35
+ } })
36
+ })] });
37
+ });
38
+ export {
39
+ E as PayoffStrategiesBlock
40
+ };
41
+
42
+ //# sourceMappingURL=PayoffStrategiesBlock.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PayoffStrategiesBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.tsx"],"sourcesContent":["import { useState } from 'react'\n\nimport Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Drawer,\n Loader,\n useAccountStore,\n useGlobalCopyStore,\n useGlobalStore,\n} from '../../../common'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { AccountDetailsBlock } from '../AccountDetailsBlock'\n\nimport PayoffStrategiesContent from './PayoffStrategiesContent'\nimport { buildStrategies, resolveStrategyAccounts, toPayoffAccountRow } from './layout'\n\n/**\n * Debt Payoff Strategies drawer: Avalanche / Snowball tabs, each with the strategy's words and the\n * beat's debt accounts in that strategy's order. A tapped account opens its Account Details (the\n * shared AccountDetailsBlock) in a nested drawer.\n */\nexport const PayoffStrategiesBlock = observer(function PayoffStrategiesBlock({\n beat,\n}: ActionBlockProps) {\n const [tappedAccountGuid, setTappedAccountGuid] = useState<string | null>(null)\n const { copyStore } = useGlobalStore()\n const {\n accounts: accountsCopy,\n common: commonCopy,\n insights_feed: insightsFeedCopy,\n } = useGlobalCopyStore()\n const { accountsLoaded, visibleAccounts } = useAccountStore()\n const copy = insightsFeedCopy?.general\n\n if (!copyStore.isInitialized) return <Loader />\n\n // Copy loads once at app start, so a retry cannot clear a missing namespace: a plain message.\n if (!copy) {\n return (\n <Stack sx={{ p: 24 }}>\n <Text>{commonCopy?.error_message ?? 'Something went wrong.'}</Text>\n </Stack>\n )\n }\n\n if (!accountsLoaded) return <Loader />\n\n const rows = resolveStrategyAccounts(beat, visibleAccounts).map(toPayoffAccountRow)\n const closeAccountDetails = () => setTappedAccountGuid(null)\n\n return (\n <>\n <PayoffStrategiesContent\n accounts={rows}\n copy={copy}\n onAccountClick={setTappedAccountGuid}\n strategies={buildStrategies(copy)}\n />\n <Drawer\n ariaLabelClose={accountsCopy?.close_account_details_aria}\n isOpen={tappedAccountGuid !== null}\n onClose={closeAccountDetails}\n title={accountsCopy?.account_details}\n >\n {tappedAccountGuid && (\n // The shared block shows the beat's account, so hand it the tapped one instead.\n <AccountDetailsBlock\n beat={{ ...beat, primary_account: undefined, primary_account_guid: tappedAccountGuid }}\n />\n )}\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;AAyBA,IAAa,IAAwB,EAAS,SAA+B,EAC3E,MAAA,EAAA,GACmB;AACnB,QAAM,CAAC,GAAmB,CAAA,IAAwB,EAAwB,IAAI,GACxE,EAAE,WAAA,EAAA,IAAc,EAAe,GAC/B,EACJ,UAAU,GACV,QAAQ,GACR,eAAe,EAAA,IACb,EAAmB,GACjB,EAAE,gBAAA,GAAgB,iBAAA,EAAA,IAAoB,EAAgB,GACtD,IAAO,GAAkB;AAE/B,MAAI,CAAC,EAAU,cAAe,QAAO,gBAAA,EAAC,GAAD,CAAS,CAAA;AAG9C,MAAI,CAAC,EACH,QACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,GAAG,GAAG;AAAA,IACjB,UAAA,gBAAA,EAAC,GAAD,EAAA,UAAO,GAAY,iBAAiB,wBAA8B,CAAA;AAAA,EAC7D,CAAA;AAIX,MAAI,CAAC,EAAgB,QAAO,gBAAA,EAAC,GAAD,CAAS,CAAA;AAErC,QAAM,IAAO,EAAwB,GAAM,CAAe,EAAE,IAAI,CAAkB,GAC5E,IAAA,MAA4B,EAAqB,IAAI;AAE3D,SACE,gBAAA,EAAA,GAAA,EAAA,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,IACE,UAAU;AAAA,IACJ,MAAA;AAAA,IACN,gBAAgB;AAAA,IAChB,YAAY,EAAgB,CAAI;AAAA,EACjC,CAAA,GACD,gBAAA,EAAC,GAAD;AAAA,IACE,gBAAgB,GAAc;AAAA,IAC9B,QAAQ,MAAsB;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO,GAAc;AAAA,IAEpB,UAAA,KAEC,gBAAA,EAAC,GAAD,EACE,MAAM;AAAA,MAAE,GAAG;AAAA,MAAM,iBAAiB;AAAA,MAAW,sBAAsB;AAAA,IAAkB,EACtF,CAAA;AAAA,EAEG,CAAA,CACR,EAAA,CAAA;AAEN,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { GeneralInsightsFeedCopy } from '../../../core/types/localization/InsightsFeedCopy';
2
+ import { PayoffAccountRow, PayoffStrategy } from './layout';
3
+ export interface PayoffStrategiesContentProps {
4
+ copy: GeneralInsightsFeedCopy;
5
+ strategies: PayoffStrategy[];
6
+ /** The beat's debt accounts, unordered; each tab orders them its own way. */
7
+ accounts: PayoffAccountRow[];
8
+ /** Tapping an account row opens its Account Details; rows are static without it. */
9
+ onAccountClick?: (accountGuid: string) => void;
10
+ }
11
+ /** Presentational body of the Debt Payoff Strategies drawer, minus the drawer header. */
12
+ declare const PayoffStrategiesContent: ({ accounts, copy, onAccountClick, strategies, }: PayoffStrategiesContentProps) => import("react/jsx-runtime").JSX.Element | null;
13
+ export default PayoffStrategiesContent;
@@ -0,0 +1,339 @@
1
+ import { DEFAULT_INSTITUTION_LOGO_URL as T } from "../../../core/constants/InstitutionLogo.es.js";
2
+ import { formatCurrency as I } from "../../../core/utils/NumberFormatting.es.js";
3
+ import { SubTabs as k, subTabPanelProps as D } from "../../components/SubTabs.es.js";
4
+ import { orderAccounts as w } from "./layout.es.js";
5
+ import { useRef as C, useState as S } from "react";
6
+ import o from "@mui/material/Stack";
7
+ import { InstitutionLogo as R, Text as d } from "@mxenabled/mxui";
8
+ import { Icon as u } from "@mxenabled/mx-icons";
9
+ import { jsx as e, jsxs as n } from "react/jsx-runtime";
10
+ import x from "@mui/material/Box";
11
+ import f from "@mui/material/IconButton";
12
+ import L from "@mui/material/Divider";
13
+ import A from "@mui/material/ButtonBase";
14
+ var _ = {
15
+ bgcolor: "background.paper",
16
+ border: "1px solid",
17
+ borderColor: "divider",
18
+ borderRadius: 1
19
+ }, g = ({ children: l }) => /* @__PURE__ */ e(d, {
20
+ color: "text.secondary",
21
+ component: "h3",
22
+ sx: {
23
+ letterSpacing: 0.5,
24
+ textTransform: "uppercase"
25
+ },
26
+ variant: "caption",
27
+ children: l
28
+ }), v = ({ items: l, kind: t, title: s }) => /* @__PURE__ */ n(o, {
29
+ component: "section",
30
+ sx: {
31
+ ..._,
32
+ flex: 1,
33
+ gap: 12,
34
+ p: 16
35
+ },
36
+ children: [/* @__PURE__ */ e(d, {
37
+ bold: !0,
38
+ component: "h4",
39
+ variant: "body1",
40
+ children: s
41
+ }), /* @__PURE__ */ e(o, {
42
+ component: "ul",
43
+ sx: {
44
+ gap: 12,
45
+ listStyle: "none",
46
+ m: 0,
47
+ p: 0
48
+ },
49
+ children: l.map((c) => /* @__PURE__ */ n(o, {
50
+ component: "li",
51
+ sx: {
52
+ flexDirection: "row",
53
+ gap: 6
54
+ },
55
+ children: [/* @__PURE__ */ e(u, {
56
+ color: t === "pros" ? "success" : "error",
57
+ name: t === "pros" ? "check_circle" : "cancel",
58
+ size: 16,
59
+ sx: {
60
+ flexShrink: 0,
61
+ mt: 2
62
+ }
63
+ }), /* @__PURE__ */ e(d, {
64
+ variant: "body2",
65
+ children: c
66
+ })]
67
+ }, c))
68
+ })]
69
+ }), G = 172, y = "—", P = ({ steps: l }) => {
70
+ const [t, s] = S(0), c = C(null), i = (a) => {
71
+ const r = Math.min(Math.max(a, 0), l.length - 1);
72
+ s(r), c.current?.scrollTo({
73
+ behavior: "smooth",
74
+ left: r * 184
75
+ });
76
+ };
77
+ return l.length ? /* @__PURE__ */ n(o, {
78
+ sx: { gap: 16 },
79
+ children: [/* @__PURE__ */ e(x, {
80
+ component: "ol",
81
+ ref: c,
82
+ sx: {
83
+ display: "flex",
84
+ flexDirection: "row",
85
+ gap: 12,
86
+ listStyle: "none",
87
+ m: 0,
88
+ overflowX: "auto",
89
+ p: 0,
90
+ scrollSnapType: "x mandatory",
91
+ scrollbarWidth: "none",
92
+ "&::-webkit-scrollbar": { display: "none" }
93
+ },
94
+ children: l.map((a) => /* @__PURE__ */ n(o, {
95
+ component: "li",
96
+ sx: {
97
+ ..._,
98
+ alignItems: "center",
99
+ flexShrink: 0,
100
+ gap: 16,
101
+ p: 16,
102
+ scrollSnapAlign: "start",
103
+ textAlign: "center",
104
+ width: G
105
+ },
106
+ children: [/* @__PURE__ */ e(u, {
107
+ color: "action",
108
+ name: a.icon,
109
+ size: 48
110
+ }), /* @__PURE__ */ n(o, {
111
+ sx: { gap: 4 },
112
+ children: [/* @__PURE__ */ e(d, {
113
+ bold: !0,
114
+ sx: { textTransform: "uppercase" },
115
+ variant: "caption",
116
+ children: a.caption
117
+ }), /* @__PURE__ */ e(d, {
118
+ color: "text.secondary",
119
+ variant: "body2",
120
+ children: a.text
121
+ })]
122
+ })]
123
+ }, a.caption + a.text))
124
+ }), /* @__PURE__ */ n(o, {
125
+ sx: {
126
+ alignItems: "center",
127
+ flexDirection: "row",
128
+ gap: 16,
129
+ justifyContent: "center"
130
+ },
131
+ children: [
132
+ /* @__PURE__ */ e(f, {
133
+ "aria-label": "previous",
134
+ disabled: t === 0,
135
+ onClick: () => i(t - 1),
136
+ children: /* @__PURE__ */ e(u, {
137
+ name: "chevron_left",
138
+ size: 20
139
+ })
140
+ }),
141
+ /* @__PURE__ */ e(o, {
142
+ "aria-hidden": "true",
143
+ sx: {
144
+ alignItems: "center",
145
+ flexDirection: "row",
146
+ gap: 4
147
+ },
148
+ children: l.map((a, r) => /* @__PURE__ */ e(x, { sx: {
149
+ bgcolor: r === t ? "primary.main" : "action.disabled",
150
+ borderRadius: 3,
151
+ height: 6,
152
+ width: r === t ? 20 : 6
153
+ } }, a.caption + a.text))
154
+ }),
155
+ /* @__PURE__ */ e(f, {
156
+ "aria-label": "next",
157
+ disabled: t === l.length - 1,
158
+ onClick: () => i(t + 1),
159
+ children: /* @__PURE__ */ e(u, {
160
+ color: "primary",
161
+ name: "chevron_right",
162
+ size: 20
163
+ })
164
+ })
165
+ ]
166
+ })]
167
+ }) : null;
168
+ }, z = ({ balanceLabel: l, isLast: t, onClick: s, rateLabel: c, row: i, sortKey: a }) => {
169
+ const r = {
170
+ label: c,
171
+ value: i.interestRate === null ? y : `${i.interestRate}%`
172
+ }, m = {
173
+ label: l,
174
+ value: i.balance === null ? y : I(i.balance, "0,0.00")
175
+ }, p = a === "rate" ? [r, m] : [m, r];
176
+ return /* @__PURE__ */ n(x, {
177
+ component: "li",
178
+ sx: { position: "relative" },
179
+ children: [/* @__PURE__ */ n(o, {
180
+ component: s ? A : "div",
181
+ onClick: s,
182
+ sx: {
183
+ alignItems: "flex-start",
184
+ flexDirection: "row",
185
+ gap: 12,
186
+ px: 24,
187
+ py: 16,
188
+ textAlign: "left",
189
+ width: "100%",
190
+ ...s && {
191
+ "&:hover": { bgcolor: "action.hover" },
192
+ "&.Mui-focusVisible": { bgcolor: "action.focus" }
193
+ }
194
+ },
195
+ children: [/* @__PURE__ */ e(x, {
196
+ sx: {
197
+ display: "flex",
198
+ flexShrink: 0,
199
+ height: 32,
200
+ width: 32
201
+ },
202
+ children: /* @__PURE__ */ e(R, {
203
+ alt: "",
204
+ institutionGuid: i.institutionGuid,
205
+ logoUrl: i.institutionGuid ? void 0 : T,
206
+ size: 32
207
+ })
208
+ }), /* @__PURE__ */ n(o, {
209
+ sx: {
210
+ flexGrow: 1,
211
+ gap: 4,
212
+ minWidth: 0
213
+ },
214
+ children: [/* @__PURE__ */ e(d, {
215
+ bold: !0,
216
+ truncate: !0,
217
+ variant: "body1",
218
+ children: i.name
219
+ }), p.map((h, b) => /* @__PURE__ */ n(o, {
220
+ sx: {
221
+ flexDirection: "row",
222
+ gap: 12,
223
+ justifyContent: "space-between"
224
+ },
225
+ children: [/* @__PURE__ */ e(d, {
226
+ color: "text.secondary",
227
+ variant: "caption",
228
+ children: h.label
229
+ }), /* @__PURE__ */ e(d, {
230
+ bold: b === 0,
231
+ color: b === 0 ? "text.primary" : "text.secondary",
232
+ sx: { fontVariantNumeric: "tabular-nums" },
233
+ variant: "caption",
234
+ children: h.value
235
+ })]
236
+ }, h.label))]
237
+ })]
238
+ }), /* @__PURE__ */ e(L, { sx: {
239
+ bottom: 0,
240
+ left: t ? 0 : 68,
241
+ position: "absolute",
242
+ right: 0
243
+ } })]
244
+ });
245
+ }, $ = ({ accounts: l, copy: t, onAccountClick: s, strategies: c }) => {
246
+ const [i, a] = S(0), r = c[i] ?? c[0];
247
+ if (!r) return null;
248
+ const m = w(l, r.sortKey);
249
+ return /* @__PURE__ */ n(o, {
250
+ sx: {
251
+ bgcolor: "background.default",
252
+ pb: 24
253
+ },
254
+ children: [/* @__PURE__ */ e(k, {
255
+ id: "payoff-strategies",
256
+ isTypeFilter: !1,
257
+ onChange: a,
258
+ selectedIndex: i,
259
+ tabs: c.map(({ label: p }) => ({ label: p }))
260
+ }), /* @__PURE__ */ n(o, {
261
+ ...D("payoff-strategies", i),
262
+ sx: { gap: 12 },
263
+ children: [
264
+ /* @__PURE__ */ n(o, {
265
+ component: "section",
266
+ sx: {
267
+ bgcolor: "background.paper",
268
+ gap: 16,
269
+ p: 24
270
+ },
271
+ children: [/* @__PURE__ */ n(o, {
272
+ sx: { gap: 4 },
273
+ children: [t.the_strategy && /* @__PURE__ */ e(g, { children: t.the_strategy }), /* @__PURE__ */ e(d, {
274
+ component: "p",
275
+ variant: "body1",
276
+ children: r.description
277
+ })]
278
+ }), /* @__PURE__ */ n(o, {
279
+ sx: {
280
+ flexDirection: "row",
281
+ gap: 12
282
+ },
283
+ children: [/* @__PURE__ */ e(v, {
284
+ items: r.pros,
285
+ kind: "pros",
286
+ title: t.pros ?? ""
287
+ }), /* @__PURE__ */ e(v, {
288
+ items: r.cons,
289
+ kind: "cons",
290
+ title: t.cons ?? ""
291
+ })]
292
+ })]
293
+ }),
294
+ r.steps.length > 0 && /* @__PURE__ */ n(o, {
295
+ component: "section",
296
+ sx: {
297
+ gap: 16,
298
+ px: 24,
299
+ py: 24
300
+ },
301
+ children: [t.how_to_get_started && /* @__PURE__ */ e(g, { children: t.how_to_get_started }), /* @__PURE__ */ e(P, { steps: r.steps }, r.key)]
302
+ }),
303
+ /* @__PURE__ */ n(o, {
304
+ component: "section",
305
+ sx: {
306
+ gap: 16,
307
+ pt: 12
308
+ },
309
+ children: [/* @__PURE__ */ e(x, {
310
+ sx: { px: 24 },
311
+ children: /* @__PURE__ */ e(g, { children: r.orderHeader })
312
+ }), /* @__PURE__ */ e(o, {
313
+ "aria-label": r.orderHeader,
314
+ component: "ul",
315
+ sx: {
316
+ bgcolor: "background.paper",
317
+ listStyle: "none",
318
+ m: 0,
319
+ p: 0
320
+ },
321
+ children: m.map((p, h) => /* @__PURE__ */ e(z, {
322
+ balanceLabel: t.balance ?? "",
323
+ isLast: h === m.length - 1,
324
+ onClick: s ? () => s(p.guid) : void 0,
325
+ rateLabel: t.interest_rate ?? "",
326
+ row: p,
327
+ sortKey: r.sortKey
328
+ }, p.guid))
329
+ })]
330
+ })
331
+ ]
332
+ })]
333
+ });
334
+ };
335
+ export {
336
+ $ as default
337
+ };
338
+
339
+ //# sourceMappingURL=PayoffStrategiesContent.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PayoffStrategiesContent.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.tsx"],"sourcesContent":["import { useRef, useState } from 'react'\n\nimport Box from '@mui/material/Box'\nimport ButtonBase from '@mui/material/ButtonBase'\nimport Divider from '@mui/material/Divider'\nimport IconButton from '@mui/material/IconButton'\nimport Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { InstitutionLogo, Text } from '@mxenabled/mxui'\n\nimport { DEFAULT_INSTITUTION_LOGO_URL } from '../../../core/constants/InstitutionLogo'\nimport type { GeneralInsightsFeedCopy } from '../../../core/types/localization/InsightsFeedCopy'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { SubTabs, subTabPanelProps } from '../../components/SubTabs'\n\nimport type { PayoffAccountRow, PayoffStep, PayoffStrategy } from './layout'\nimport { orderAccounts } from './layout'\n\nexport interface PayoffStrategiesContentProps {\n copy: GeneralInsightsFeedCopy\n strategies: PayoffStrategy[]\n /** The beat's debt accounts, unordered; each tab orders them its own way. */\n accounts: PayoffAccountRow[]\n /** Tapping an account row opens its Account Details; rows are static without it. */\n onAccountClick?: (accountGuid: string) => void\n}\n\nconst CARD_SX = {\n bgcolor: 'background.paper',\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: 1,\n} as const\n\n/** The small uppercase section label (STRATEGY, HOW TO GET STARTED, HIGHEST TO LOWEST RATE). */\nconst SectionLabel = ({ children }: { children: string }) => (\n <Text\n color=\"text.secondary\"\n component=\"h3\"\n sx={{ letterSpacing: 0.5, textTransform: 'uppercase' }}\n variant=\"caption\"\n >\n {children}\n </Text>\n)\n\nconst ProsConsCard = ({\n items,\n kind,\n title,\n}: {\n items: string[]\n kind: 'pros' | 'cons'\n title: string\n}) => (\n <Stack component=\"section\" sx={{ ...CARD_SX, flex: 1, gap: 12, p: 16 }}>\n <Text bold={true} component=\"h4\" variant=\"body1\">\n {title}\n </Text>\n <Stack component=\"ul\" sx={{ gap: 12, listStyle: 'none', m: 0, p: 0 }}>\n {items.map((item) => (\n <Stack component=\"li\" key={item} sx={{ flexDirection: 'row', gap: 6 }}>\n <Icon\n color={kind === 'pros' ? 'success' : 'error'}\n name={kind === 'pros' ? 'check_circle' : 'cancel'}\n size={16}\n sx={{ flexShrink: 0, mt: 2 }}\n />\n <Text variant=\"body2\">{item}</Text>\n </Stack>\n ))}\n </Stack>\n </Stack>\n)\n\nconst STEP_CARD_WIDTH = 172\nconst MISSING_VALUE = '—'\n\n/** The three step cards in a scroll-snap row, paged by the arrows and the dots under it. */\nconst StepsCarousel = ({ steps }: { steps: PayoffStep[] }) => {\n const [page, setPage] = useState(0)\n const rowRef = useRef<HTMLOListElement>(null)\n\n const goTo = (next: number) => {\n const index = Math.min(Math.max(next, 0), steps.length - 1)\n setPage(index)\n rowRef.current?.scrollTo({ behavior: 'smooth', left: index * (STEP_CARD_WIDTH + 12) })\n }\n\n if (!steps.length) return null\n\n return (\n <Stack sx={{ gap: 16 }}>\n <Box\n component=\"ol\"\n ref={rowRef}\n sx={{\n display: 'flex',\n flexDirection: 'row',\n gap: 12,\n listStyle: 'none',\n m: 0,\n overflowX: 'auto',\n p: 0,\n scrollSnapType: 'x mandatory',\n scrollbarWidth: 'none',\n '&::-webkit-scrollbar': { display: 'none' },\n }}\n >\n {steps.map((step) => (\n <Stack\n component=\"li\"\n key={step.caption + step.text}\n sx={{\n ...CARD_SX,\n alignItems: 'center',\n flexShrink: 0,\n gap: 16,\n p: 16,\n scrollSnapAlign: 'start',\n textAlign: 'center',\n width: STEP_CARD_WIDTH,\n }}\n >\n <Icon color=\"action\" name={step.icon} size={48} />\n <Stack sx={{ gap: 4 }}>\n <Text bold={true} sx={{ textTransform: 'uppercase' }} variant=\"caption\">\n {step.caption}\n </Text>\n <Text color=\"text.secondary\" variant=\"body2\">\n {step.text}\n </Text>\n </Stack>\n </Stack>\n ))}\n </Box>\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 16, justifyContent: 'center' }}>\n <IconButton aria-label=\"previous\" disabled={page === 0} onClick={() => goTo(page - 1)}>\n <Icon name=\"chevron_left\" size={20} />\n </IconButton>\n <Stack aria-hidden=\"true\" sx={{ alignItems: 'center', flexDirection: 'row', gap: 4 }}>\n {steps.map((step, index) => (\n <Box\n key={step.caption + step.text}\n sx={{\n bgcolor: index === page ? 'primary.main' : 'action.disabled',\n borderRadius: 3,\n height: 6,\n width: index === page ? 20 : 6,\n }}\n />\n ))}\n </Stack>\n <IconButton\n aria-label=\"next\"\n disabled={page === steps.length - 1}\n onClick={() => goTo(page + 1)}\n >\n <Icon color=\"primary\" name=\"chevron_right\" size={20} />\n </IconButton>\n </Stack>\n </Stack>\n )\n}\n\nconst AccountRow = ({\n balanceLabel,\n isLast,\n onClick,\n rateLabel,\n row,\n sortKey,\n}: {\n balanceLabel: string\n isLast: boolean\n onClick?: () => void\n rateLabel: string\n row: PayoffAccountRow\n sortKey: PayoffStrategy['sortKey']\n}) => {\n const rate = {\n label: rateLabel,\n value: row.interestRate === null ? MISSING_VALUE : `${row.interestRate}%`,\n }\n const balance = {\n label: balanceLabel,\n value: row.balance === null ? MISSING_VALUE : formatCurrency(row.balance, '0,0.00'),\n }\n const lines = sortKey === 'rate' ? [rate, balance] : [balance, rate]\n\n return (\n <Box component=\"li\" sx={{ position: 'relative' }}>\n <Stack\n component={onClick ? ButtonBase : 'div'}\n onClick={onClick}\n sx={{\n alignItems: 'flex-start',\n flexDirection: 'row',\n gap: 12,\n px: 24,\n py: 16,\n textAlign: 'left',\n width: '100%',\n ...(onClick && {\n '&:hover': { bgcolor: 'action.hover' },\n '&.Mui-focusVisible': { bgcolor: 'action.focus' },\n }),\n }}\n >\n <Box sx={{ display: 'flex', flexShrink: 0, height: 32, width: 32 }}>\n <InstitutionLogo\n alt=\"\"\n institutionGuid={row.institutionGuid}\n logoUrl={row.institutionGuid ? undefined : DEFAULT_INSTITUTION_LOGO_URL}\n size={32}\n />\n </Box>\n <Stack sx={{ flexGrow: 1, gap: 4, minWidth: 0 }}>\n <Text bold={true} truncate={true} variant=\"body1\">\n {row.name}\n </Text>\n {lines.map((line, index) => (\n <Stack\n key={line.label}\n sx={{ flexDirection: 'row', gap: 12, justifyContent: 'space-between' }}\n >\n <Text color=\"text.secondary\" variant=\"caption\">\n {line.label}\n </Text>\n <Text\n bold={index === 0}\n color={index === 0 ? 'text.primary' : 'text.secondary'}\n sx={{ fontVariantNumeric: 'tabular-nums' }}\n variant=\"caption\"\n >\n {line.value}\n </Text>\n </Stack>\n ))}\n </Stack>\n </Stack>\n <Divider sx={{ bottom: 0, left: isLast ? 0 : 68, position: 'absolute', right: 0 }} />\n </Box>\n )\n}\n\n/** Presentational body of the Debt Payoff Strategies drawer, minus the drawer header. */\nconst PayoffStrategiesContent = ({\n accounts,\n copy,\n onAccountClick,\n strategies,\n}: PayoffStrategiesContentProps) => {\n const [tab, setTab] = useState(0)\n const strategy = strategies[tab] ?? strategies[0]\n\n if (!strategy) return null\n\n const ordered = orderAccounts(accounts, strategy.sortKey)\n\n return (\n <Stack sx={{ bgcolor: 'background.default', pb: 24 }}>\n <SubTabs\n id=\"payoff-strategies\"\n isTypeFilter={false}\n onChange={setTab}\n selectedIndex={tab}\n tabs={strategies.map(({ label }) => ({ label }))}\n />\n <Stack {...subTabPanelProps('payoff-strategies', tab)} sx={{ gap: 12 }}>\n <Stack component=\"section\" sx={{ bgcolor: 'background.paper', gap: 16, p: 24 }}>\n <Stack sx={{ gap: 4 }}>\n {copy.the_strategy && <SectionLabel>{copy.the_strategy}</SectionLabel>}\n <Text component=\"p\" variant=\"body1\">\n {strategy.description}\n </Text>\n </Stack>\n <Stack sx={{ flexDirection: 'row', gap: 12 }}>\n <ProsConsCard items={strategy.pros} kind=\"pros\" title={copy.pros ?? ''} />\n <ProsConsCard items={strategy.cons} kind=\"cons\" title={copy.cons ?? ''} />\n </Stack>\n </Stack>\n {strategy.steps.length > 0 && (\n <Stack component=\"section\" sx={{ gap: 16, px: 24, py: 24 }}>\n {copy.how_to_get_started && <SectionLabel>{copy.how_to_get_started}</SectionLabel>}\n <StepsCarousel key={strategy.key} steps={strategy.steps} />\n </Stack>\n )}\n <Stack component=\"section\" sx={{ gap: 16, pt: 12 }}>\n <Box sx={{ px: 24 }}>\n <SectionLabel>{strategy.orderHeader}</SectionLabel>\n </Box>\n <Stack\n aria-label={strategy.orderHeader}\n component=\"ul\"\n sx={{ bgcolor: 'background.paper', listStyle: 'none', m: 0, p: 0 }}\n >\n {ordered.map((row, index) => (\n <AccountRow\n balanceLabel={copy.balance ?? ''}\n isLast={index === ordered.length - 1}\n key={row.guid}\n onClick={onAccountClick ? () => onAccountClick(row.guid) : undefined}\n rateLabel={copy.interest_rate ?? ''}\n row={row}\n sortKey={strategy.sortKey}\n />\n ))}\n </Stack>\n </Stack>\n </Stack>\n </Stack>\n )\n}\n\nexport default PayoffStrategiesContent\n"],"mappings":";;;;;;;;;;;;;AA4BA,IAAM,IAAU;AAAA,EACd,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,cAAc;AAChB,GAGM,IAAA,CAAgB,EAAE,UAAA,EAAA,MACtB,gBAAA,EAAC,GAAD;AAAA,EACE,OAAM;AAAA,EACN,WAAU;AAAA,EACV,IAAI;AAAA,IAAE,eAAe;AAAA,IAAK,eAAe;AAAA,EAAY;AAAA,EACrD,SAAQ;AAAA,EAEP,UAAA;AACG,CAAA,GAGF,IAAA,CAAgB,EACpB,OAAA,GACA,MAAA,GACA,OAAA,EAAA,MAMA,gBAAA,EAAC,GAAD;AAAA,EAAO,WAAU;AAAA,EAAU,IAAI;AAAA,IAAE,GAAG;AAAA,IAAS,MAAM;AAAA,IAAG,KAAK;AAAA,I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