@mx-cartographer/experiences 9.7.199 → 9.7.201
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/core/types/Insights.d.ts +1 -1
- package/dist/core/types/Insights.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/FeeChargedBlock/FeeChargedBlock.d.ts +12 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeeChargedBlock/FeeChargedBlock.es.js +131 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeeChargedBlock/FeeChargedBlock.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeeChargedBlock/index.d.ts +3 -0
- package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +1 -1
- package/dist/insights-v2/components/BaseLayout.es.js +39 -39
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/statusIcon.d.ts +5 -5
- package/dist/insights-v2/components/statusIcon.es.js +7 -6
- package/dist/insights-v2/components/statusIcon.es.js.map +1 -1
- package/dist/insights-v2/index.es.js +39 -39
- package/dist/insights-v2/mappings/blocks.es.js +24 -24
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/GreenStatementFeeBlock/GreenStatementFeeBlock.d.ts +0 -8
- package/dist/insights-v2/blocks/ComponentBlocks/GreenStatementFeeBlock/GreenStatementFeeBlock.es.js +0 -88
- package/dist/insights-v2/blocks/ComponentBlocks/GreenStatementFeeBlock/GreenStatementFeeBlock.es.js.map +0 -1
- package/dist/insights-v2/blocks/ComponentBlocks/GreenStatementFeeBlock/index.d.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## [9.7.201] - 11-23-2026
|
|
2
|
+
|
|
3
|
+
- **CHANGED** - Green Statement Fee block matches Figma and is renamed `fee_charged_block`, reading all its content from the slot (WELL-222)
|
|
4
|
+
|
|
5
|
+
## [9.7.200] - 11-23-2026
|
|
6
|
+
|
|
7
|
+
- **ADDED** - Account Discoverability Change sample cards, story and contract test (WELL-223)
|
|
8
|
+
- **FIXED** - Block-less insight cards no longer double the gap between the header and description (WELL-223)
|
|
9
|
+
- **CHANGED** - Micro insight status icon accepts action.active for a neutral grey tile (WELL-223)
|
|
10
|
+
|
|
1
11
|
## [9.7.199] - 11-20-2026
|
|
2
12
|
|
|
3
13
|
- **ADDED** - Monthly Spend to Income Comparison V2 Storybook QA page with every size and state (WEC-2101)
|
|
@@ -284,7 +284,7 @@ export declare const BlockType: {
|
|
|
284
284
|
readonly UpcomingSubscriptionBlock: "upcoming_subscription_block";
|
|
285
285
|
readonly WeeklySmallPurchasesBlock: "weekly_small_purchases_block";
|
|
286
286
|
readonly WithdrawalBlock: "withdrawal_block";
|
|
287
|
-
readonly
|
|
287
|
+
readonly FeeChargedBlock: "fee_charged_block";
|
|
288
288
|
};
|
|
289
289
|
export type BlockType = (typeof BlockType)[keyof typeof BlockType];
|
|
290
290
|
/**
|
|
@@ -1 +1 @@
|
|
|
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/** A row in a drilldown list fact (e.g. the Subscriptions drawer's per-transaction schedule). */\nexport type DrilldownRow = Record<string, string | number | boolean | null>\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, a `data_series` (the months a history drawer charts), or rows of scalars\n * (`transaction_frequencies`), omitted when the insight has none. Never carries copy or user actions\n * (memo, tags, hide, flag come from the transaction store). Values come from the server, so a reader\n * still checks each value's runtime shape.\n */\nexport type DrilldownData = Record<\n string,\n string | number | boolean | null | string[] | DataSeries | DrilldownRow[]\n>\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 QuarterlySummaryBlock: 'quarterly_summary_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 GreenStatementFeeBlock: 'green_statement_fee_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 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":"AAyVA,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/** A row in a drilldown list fact (e.g. the Subscriptions drawer's per-transaction schedule). */\nexport type DrilldownRow = Record<string, string | number | boolean | null>\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, a `data_series` (the months a history drawer charts), or rows of scalars\n * (`transaction_frequencies`), omitted when the insight has none. Never carries copy or user actions\n * (memo, tags, hide, flag come from the transaction store). Values come from the server, so a reader\n * still checks each value's runtime shape.\n */\nexport type DrilldownData = Record<\n string,\n string | number | boolean | null | string[] | DataSeries | DrilldownRow[]\n>\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 QuarterlySummaryBlock: 'quarterly_summary_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 FeeChargedBlock: 'fee_charged_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 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":"AAyVA,IAAa,IAAA,CACX,GACA,MACkB,IAAO,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BlockProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Formats an ISO `YYYY-MM-DD` date (local midnight) or a unix timestamp (its UTC calendar day) as
|
|
4
|
+
* `MM/dd/yy`; undefined for any other string.
|
|
5
|
+
*/
|
|
6
|
+
export declare const formatStatementDate: (value?: string | number) => string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* The fee card (Figma 433:94157): every value and word comes from `instance_slot.data`. The card
|
|
9
|
+
* renders nothing if any is missing.
|
|
10
|
+
*/
|
|
11
|
+
declare const FeeChargedBlock: ({ payload }: BlockProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export default FeeChargedBlock;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { formatDate as b } from "../../../../core/constants/DateFormats.es.js";
|
|
2
|
+
import { slot as a } from "../../../../core/types/Insights.es.js";
|
|
3
|
+
import { fromUnixUTC as v } from "../../../../core/utils/DateUtil.es.js";
|
|
4
|
+
import { CURRENCY_FORMAT as S, formatCurrency as _ } from "../../../../core/utils/NumberFormatting.es.js";
|
|
5
|
+
import { asNonEmptyText as n, asNumber as y } from "../../slotReaders.es.js";
|
|
6
|
+
import { ELEVATION_SHADOW as A } from "../../../components/shared/elevation.es.js";
|
|
7
|
+
import i from "@mui/material/Stack";
|
|
8
|
+
import { Text as m } from "@mxenabled/mxui";
|
|
9
|
+
import { AccountBalance as E } from "@mxenabled/mx-icons";
|
|
10
|
+
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
11
|
+
import N from "@mui/material/Box";
|
|
12
|
+
import { parseISO as $ } from "date-fns";
|
|
13
|
+
var w = /^\d{4}-\d{2}-\d{2}$/, T = {
|
|
14
|
+
month: "2-digit",
|
|
15
|
+
day: "2-digit",
|
|
16
|
+
year: "2-digit"
|
|
17
|
+
}, k = (t) => {
|
|
18
|
+
if (typeof t == "number") return b(v(t), T);
|
|
19
|
+
if (!t || !w.test(t)) return;
|
|
20
|
+
const r = $(t);
|
|
21
|
+
return Number.isNaN(r.getTime()) ? void 0 : b(r, T);
|
|
22
|
+
}, C = [
|
|
23
|
+
34,
|
|
24
|
+
120,
|
|
25
|
+
120,
|
|
26
|
+
112,
|
|
27
|
+
77,
|
|
28
|
+
153,
|
|
29
|
+
153,
|
|
30
|
+
153,
|
|
31
|
+
153
|
|
32
|
+
].map((t, r) => ({
|
|
33
|
+
height: r === 0 ? "2px" : "1px",
|
|
34
|
+
line: r,
|
|
35
|
+
width: t
|
|
36
|
+
})), O = ({ title: t }) => /* @__PURE__ */ d(i, {
|
|
37
|
+
"aria-hidden": !0,
|
|
38
|
+
sx: {
|
|
39
|
+
bgcolor: "background.paper",
|
|
40
|
+
bottom: 0,
|
|
41
|
+
boxShadow: A[1],
|
|
42
|
+
gap: 10,
|
|
43
|
+
left: 144,
|
|
44
|
+
overflow: "clip",
|
|
45
|
+
p: 13,
|
|
46
|
+
position: "absolute",
|
|
47
|
+
right: -12,
|
|
48
|
+
top: 24
|
|
49
|
+
},
|
|
50
|
+
children: [/* @__PURE__ */ e(i, {
|
|
51
|
+
sx: {
|
|
52
|
+
alignItems: "center",
|
|
53
|
+
alignSelf: "flex-start",
|
|
54
|
+
bgcolor: "action.selected",
|
|
55
|
+
borderRadius: "4px",
|
|
56
|
+
color: "primary.light",
|
|
57
|
+
justifyContent: "center",
|
|
58
|
+
p: 2
|
|
59
|
+
},
|
|
60
|
+
children: /* @__PURE__ */ e(E, { sx: { fontSize: 12 } })
|
|
61
|
+
}), /* @__PURE__ */ d(i, {
|
|
62
|
+
sx: { gap: 3 },
|
|
63
|
+
children: [/* @__PURE__ */ e(m, {
|
|
64
|
+
bold: !0,
|
|
65
|
+
sx: { color: "primary.light" },
|
|
66
|
+
variant: "tiny",
|
|
67
|
+
children: t
|
|
68
|
+
}), C.map(({ height: r, line: s, width: o }) => /* @__PURE__ */ e(N, { sx: {
|
|
69
|
+
bgcolor: "action.selected",
|
|
70
|
+
borderRadius: "34px",
|
|
71
|
+
flexShrink: 0,
|
|
72
|
+
height: r,
|
|
73
|
+
maxWidth: "100%",
|
|
74
|
+
width: o
|
|
75
|
+
} }, s))]
|
|
76
|
+
})]
|
|
77
|
+
}), G = ({ payload: t }) => {
|
|
78
|
+
const { instance_slot: r = {}, is_zero_state: s } = t, o = r.data, f = y(a(o, "amount")), x = a(o, "date"), l = k(n(x) ?? y(x)), p = n(a(o, "primary_text")), c = n(a(o, "amount_label")), h = n(a(o, "header_text"));
|
|
79
|
+
if (s || f === void 0 || !l || !p || !c || !h) return null;
|
|
80
|
+
const g = _(Math.abs(f), S.cents);
|
|
81
|
+
return /* @__PURE__ */ d(i, {
|
|
82
|
+
"aria-label": `${p} ${g} ${c} ${l}`,
|
|
83
|
+
"data-testid": "fee-charged-block",
|
|
84
|
+
direction: "row",
|
|
85
|
+
role: "img",
|
|
86
|
+
sx: {
|
|
87
|
+
background: (u) => `linear-gradient(145deg, ${u.palette.primary.main} 0.56%, ${u.palette.primary.dark} 112.3%)`,
|
|
88
|
+
alignItems: "center",
|
|
89
|
+
justifyContent: "flex-start",
|
|
90
|
+
overflow: "clip",
|
|
91
|
+
pl: 24,
|
|
92
|
+
pr: 16,
|
|
93
|
+
position: "relative",
|
|
94
|
+
py: 24,
|
|
95
|
+
width: "100%"
|
|
96
|
+
},
|
|
97
|
+
children: [/* @__PURE__ */ d(i, {
|
|
98
|
+
"aria-hidden": !0,
|
|
99
|
+
sx: {
|
|
100
|
+
color: "primary.contrastText",
|
|
101
|
+
flex: 1,
|
|
102
|
+
gap: 2,
|
|
103
|
+
maxWidth: 120,
|
|
104
|
+
minWidth: 0
|
|
105
|
+
},
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ e(m, {
|
|
108
|
+
variant: "body2",
|
|
109
|
+
children: p
|
|
110
|
+
}),
|
|
111
|
+
/* @__PURE__ */ e(m, {
|
|
112
|
+
bold: !0,
|
|
113
|
+
component: "span",
|
|
114
|
+
sx: { overflowWrap: "anywhere" },
|
|
115
|
+
variant: "h2",
|
|
116
|
+
children: g
|
|
117
|
+
}),
|
|
118
|
+
/* @__PURE__ */ e(m, {
|
|
119
|
+
variant: "body2",
|
|
120
|
+
children: `${c} ${l}`
|
|
121
|
+
})
|
|
122
|
+
]
|
|
123
|
+
}), /* @__PURE__ */ e(O, { title: h })]
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
export {
|
|
127
|
+
G as default,
|
|
128
|
+
k as formatStatementDate
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
//# sourceMappingURL=FeeChargedBlock.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeeChargedBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/FeeChargedBlock/FeeChargedBlock.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\n\nimport { parseISO } from 'date-fns'\n\nimport { Text } from '@mxenabled/mxui'\nimport { AccountBalance } from '@mxenabled/mx-icons'\n\nimport { slot } from '../../../../core/types/Insights'\nimport { formatDate } from '../../../../core/constants'\nimport { fromUnixUTC } from '../../../../core/utils/DateUtil'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\nimport { ELEVATION_SHADOW } from '../../../components/shared/elevation'\nimport { asNonEmptyText, asNumber } from '../../slotReaders'\nimport type { BlockProps } from '../../types'\n\nconst ISO_DATE = /^\\d{4}-\\d{2}-\\d{2}$/\nconst SHORT_DATE_FORMAT = { month: '2-digit', day: '2-digit', year: '2-digit' }\n\n/**\n * Formats an ISO `YYYY-MM-DD` date (local midnight) or a unix timestamp (its UTC calendar day) as\n * `MM/dd/yy`; undefined for any other string.\n */\nexport const formatStatementDate = (value?: string | number): string | undefined => {\n if (typeof value === 'number') return formatDate(fromUnixUTC(value), SHORT_DATE_FORMAT)\n if (!value || !ISO_DATE.test(value)) return undefined\n\n const parsed = parseISO(value)\n\n return Number.isNaN(parsed.getTime()) ? undefined : formatDate(parsed, SHORT_DATE_FORMAT)\n}\n\n// Widths (px) of the statement drawing's placeholder text lines, from Figma.\nconst STATEMENT_LINES = [34, 120, 120, 112, 77, 153, 153, 153, 153].map((width, line) => ({\n height: line === 0 ? '2px' : '1px',\n line,\n width,\n}))\n\nconst StatementGraphic = ({ title }: { title: string }) => (\n <Stack\n aria-hidden={true}\n sx={{\n bgcolor: 'background.paper',\n bottom: 0,\n boxShadow: ELEVATION_SHADOW[1],\n gap: 10,\n left: 144,\n overflow: 'clip',\n p: 13,\n position: 'absolute',\n right: -12,\n top: 24,\n }}\n >\n <Stack\n sx={{\n alignItems: 'center',\n alignSelf: 'flex-start',\n bgcolor: 'action.selected',\n borderRadius: '4px',\n color: 'primary.light',\n justifyContent: 'center',\n p: 2,\n }}\n >\n <AccountBalance sx={{ fontSize: 12 }} />\n </Stack>\n <Stack sx={{ gap: 3 }}>\n <Text bold={true} sx={{ color: 'primary.light' }} variant=\"tiny\">\n {title}\n </Text>\n {STATEMENT_LINES.map(({ height, line, width }) => (\n <Box\n key={line}\n sx={{\n bgcolor: 'action.selected',\n borderRadius: '34px',\n flexShrink: 0,\n height,\n maxWidth: '100%',\n width,\n }}\n />\n ))}\n </Stack>\n </Stack>\n)\n\n/**\n * The fee card (Figma 433:94157): every value and word comes from `instance_slot.data`. The card\n * renders nothing if any is missing.\n */\nconst FeeChargedBlock = ({ payload }: BlockProps) => {\n const { instance_slot = {}, is_zero_state } = payload\n const data = instance_slot.data\n const amount = asNumber(slot(data, 'amount'))\n const rawDate = slot(data, 'date')\n // An ISO date string or unix seconds.\n const date = formatStatementDate(asNonEmptyText(rawDate) ?? asNumber(rawDate))\n const primaryText = asNonEmptyText(slot(data, 'primary_text'))\n const amountLabel = asNonEmptyText(slot(data, 'amount_label'))\n const headerText = asNonEmptyText(slot(data, 'header_text'))\n\n if (\n is_zero_state ||\n amount === undefined ||\n !date ||\n !primaryText ||\n !amountLabel ||\n !headerText\n ) {\n return null\n }\n\n const formattedAmount = formatCurrency(Math.abs(amount), CURRENCY_FORMAT.cents)\n\n return (\n <Stack\n aria-label={`${primaryText} ${formattedAmount} ${amountLabel} ${date}`}\n data-testid=\"fee-charged-block\"\n direction=\"row\"\n role=\"img\"\n sx={{\n // Figma 433:94157\n background: (theme) =>\n `linear-gradient(145deg, ${theme.palette.primary.main} 0.56%, ${theme.palette.primary.dark} 112.3%)`,\n alignItems: 'center',\n // Needed: the shared Stack theme centres row content by default.\n justifyContent: 'flex-start',\n overflow: 'clip',\n pl: 24,\n pr: 16,\n position: 'relative',\n py: 24,\n width: '100%',\n }}\n >\n <Stack\n aria-hidden={true}\n sx={{ color: 'primary.contrastText', flex: 1, gap: 2, maxWidth: 120, minWidth: 0 }}\n >\n <Text variant=\"body2\">{primaryText}</Text>\n {/* Long amounts ($1,234.56) wrap inside the column rather than run under the drawing. */}\n <Text bold={true} component=\"span\" sx={{ overflowWrap: 'anywhere' }} variant=\"h2\">\n {formattedAmount}\n </Text>\n <Text variant=\"body2\">{`${amountLabel} ${date}`}</Text>\n </Stack>\n <StatementGraphic title={headerText} />\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Q,IAAA,WAAe,EAAM,QAAQ,QAAQ,IAAA;AAAA,MACxF,YAAY;AAAA,MAEZ,gBAAgB;AAAA,MAChB,UAAU;AAAA,MACV,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,UAAU;AAAA,MACV,IAAI;AAAA,MACJ,OAAO;AAAA,IACT;AAAA,IAlBF,UAAA,CAoBE,gBAAA,EAAC,GAAD;AAAA,MACE,eAAa;AAAA,MACb,IAAI;AAAA,QAAE,OAAO;AAAA,QAAwB,MAAM;AAAA,QAAG,KAAK;AAAA,QAAG,UAAU;AAAA,QAAK,UAAU;AAAA,MAAE;AAAA,MAFnF,UAAA;AAAA,QAIE,gBAAA,EAAC,GAAD;AAAA,UAAM,SAAQ;AAAA,UAAS,UAAA;AAAA,QAAkB,CAAA;AAAA,QAEzC,gBAAA,EAAC,GAAD;AAAA,UAAM,MAAM;AAAA,UAAM,WAAU;AAAA,UAAO,IAAI,EAAE,cAAc,WAAW;AAAA,UAAG,SAAQ;AAAA,UAC1E,UAAA;AAAA,QACG,CAAA;AAAA,QACN,gBAAA,EAAC,GAAD;AAAA,UAAM,SAAQ;AAAA,UAAS,UAAA,GAAG,CAAA,IAAe,CAAA;AAAA,QAAa,CAAA;AAAA,MACjD;AAAA,IACP,CAAA,GAAA,gBAAA,EAAC,GAAD,EAAkB,OAAO,EAAa,CAAA,CACjC;AAAA;AAEX"}
|
|
@@ -23,12 +23,12 @@ import { ObsolesceBanner as Bo } from "./ObsolesceBanner.es.js";
|
|
|
23
23
|
import { useBeatFeedbackFlow as Do } from "../hooks/useBeatFeedbackFlow.es.js";
|
|
24
24
|
import { useEffect as Oo, useMemo as Io } from "react";
|
|
25
25
|
import { observer as Eo } from "mobx-react-lite";
|
|
26
|
-
import
|
|
26
|
+
import w from "@mui/material/Stack";
|
|
27
27
|
import { P as Fo } from "@mxenabled/mxui";
|
|
28
28
|
import f from "@mui/material/Button";
|
|
29
|
-
import { ChevronRight as
|
|
29
|
+
import { ChevronRight as H } from "@mxenabled/mx-icons";
|
|
30
30
|
import { Fragment as Ho, jsx as i, jsxs as C } from "react/jsx-runtime";
|
|
31
|
-
import
|
|
31
|
+
import N from "@mui/material/Box";
|
|
32
32
|
import No from "@mui/material/Card";
|
|
33
33
|
var Mo = {}, Po = {
|
|
34
34
|
position: "absolute",
|
|
@@ -39,7 +39,7 @@ var Mo = {}, Po = {
|
|
|
39
39
|
backgroundColor: "background.default",
|
|
40
40
|
opacity: 0.7,
|
|
41
41
|
zIndex: 3
|
|
42
|
-
},
|
|
42
|
+
}, A = {
|
|
43
43
|
alignSelf: "flex-start",
|
|
44
44
|
fontSize: 13,
|
|
45
45
|
fontWeight: 600,
|
|
@@ -52,7 +52,7 @@ var Mo = {}, Po = {
|
|
|
52
52
|
py: 4,
|
|
53
53
|
textAlign: "left"
|
|
54
54
|
}, Ro = {
|
|
55
|
-
...
|
|
55
|
+
...A,
|
|
56
56
|
alignItems: "center",
|
|
57
57
|
display: "flex",
|
|
58
58
|
textTransform: "none"
|
|
@@ -76,8 +76,8 @@ var Mo = {}, Po = {
|
|
|
76
76
|
px: 16,
|
|
77
77
|
py: 12,
|
|
78
78
|
"&.Mui-disabled": { color: "text.disabled" }
|
|
79
|
-
}, yi = Eo(({ beat: t, beatActions: l = Mo, obsolete: _, isLoading:
|
|
80
|
-
const P = ro(), b = ao(), { config: R } = no(), o = Do(t, l), y = so(), { runCta: G, primary: v, secondary:
|
|
79
|
+
}, yi = Eo(({ beat: t, beatActions: l = Mo, obsolete: _, isLoading: L = !1, isError: M = !1 }) => {
|
|
80
|
+
const P = ro(), b = ao(), { config: R } = no(), o = Do(t, l), y = so(), { runCta: G, primary: v, secondary: B, linkPresentation: W } = ho(t, l, t.insights_payload?.primary_cta ?? void 0, t.insights_payload?.secondary_cta ?? void 0, t.insights_payload?.in_description_cta ?? void 0), c = t.insights_payload?.widget_type === "mini", h = t.active_at ?? t.insights_payload?.active_at;
|
|
81
81
|
Oo(() => {
|
|
82
82
|
h == null || h === "" || b.setBeatContext(t.guid, { [lo]: h });
|
|
83
83
|
}, [
|
|
@@ -92,10 +92,10 @@ var Mo = {}, Po = {
|
|
|
92
92
|
if (M) return /* @__PURE__ */ i(yo, {});
|
|
93
93
|
const e = t.insights_payload;
|
|
94
94
|
if (!e || o.cardState === "dismissed") return null;
|
|
95
|
-
const { instance_slot: V, primary_cta: r, secondary_cta: d, sub_title: j, title: z, guid:
|
|
95
|
+
const { instance_slot: V, primary_cta: r, secondary_cta: d, sub_title: j, title: z, guid: D, dismissed_at: K } = e, { block: U } = V, Y = j ?? (e.subtitle ? {
|
|
96
96
|
logo: _o(e.logo),
|
|
97
97
|
text: e.subtitle
|
|
98
|
-
} : void 0), p = (s) => mo(s, R, l.onContactSupport),
|
|
98
|
+
} : void 0), p = (s) => mo(s, R, l.onContactSupport), O = async (s, a) => {
|
|
99
99
|
if (!p(a.block)) {
|
|
100
100
|
if (a.block === go.CONTACT_SUPPORT_ACTION_BLOCK) {
|
|
101
101
|
Co({
|
|
@@ -108,14 +108,14 @@ var Mo = {}, Po = {
|
|
|
108
108
|
}
|
|
109
109
|
await G(s, a);
|
|
110
110
|
}
|
|
111
|
-
},
|
|
111
|
+
}, k = vo[U], m = e.in_description_cta, x = !c && m?.label && m.block ? m : void 0, $ = r?.label || (x ? void 0 : m?.label) || void 0, u = !c && !!r?.label, I = t.in_description_cta || t.html_in_description_cta, q = () => {
|
|
112
112
|
const { is_mobile_webview: s, clientConfig: a } = y.appDataStore.appConfig;
|
|
113
113
|
co(t.template, {
|
|
114
114
|
isMobileWebview: s,
|
|
115
115
|
webviewScheme: a?.master?.ui_message_webview_url_scheme,
|
|
116
116
|
userGuid: e.user_guid ?? t.user_guid
|
|
117
117
|
});
|
|
118
|
-
}, n = u ? v.presentation : void 0, J = n?.kind === "hidden" && !!n.hideAll,
|
|
118
|
+
}, n = u ? v.presentation : void 0, J = n?.kind === "hidden" && !!n.hideAll, E = !c && !!d?.label && !J, g = c ? W : void 0, Q = g?.kind === "status" ? g : void 0, F = g ? Q?.action?.label : $, Z = g?.title || z || "", oo = !!F && !u, io = u && n?.kind !== "hidden" || E, to = (s) => {
|
|
119
119
|
const { onCtaAction: a } = l;
|
|
120
120
|
a && (s.stopPropagation(), Promise.resolve().then(() => a({
|
|
121
121
|
beatGuid: t.guid,
|
|
@@ -125,49 +125,49 @@ var Mo = {}, Po = {
|
|
|
125
125
|
template: t.template,
|
|
126
126
|
handler: "cardClick"
|
|
127
127
|
})));
|
|
128
|
-
},
|
|
128
|
+
}, S = P.insights_feed?.general, T = _?.state === "not_refreshable" && !K && !!S;
|
|
129
129
|
return /* @__PURE__ */ i(po, {
|
|
130
130
|
value: X,
|
|
131
|
-
children: /* @__PURE__ */ C(
|
|
131
|
+
children: /* @__PURE__ */ C(w, {
|
|
132
132
|
sx: { mb: 16 },
|
|
133
133
|
children: [
|
|
134
134
|
o.cardState === "confirming" ? /* @__PURE__ */ i(Ao, {
|
|
135
135
|
onClose: o.collapseConfirmation,
|
|
136
136
|
onLeaveFeedback: o.openHideSurvey,
|
|
137
137
|
onUndo: o.undoDismiss
|
|
138
|
-
}) : /* @__PURE__ */ C(Ho, { children: [_ &&
|
|
138
|
+
}) : /* @__PURE__ */ C(Ho, { children: [_ && S && /* @__PURE__ */ i(Bo, {
|
|
139
139
|
..._,
|
|
140
|
-
copy:
|
|
140
|
+
copy: S
|
|
141
141
|
}), /* @__PURE__ */ C(No, {
|
|
142
|
-
inert:
|
|
142
|
+
inert: T,
|
|
143
143
|
sx: {
|
|
144
144
|
display: "flex",
|
|
145
145
|
flexDirection: "column",
|
|
146
|
-
...
|
|
146
|
+
...T && {
|
|
147
147
|
position: "relative",
|
|
148
148
|
zIndex: 2,
|
|
149
149
|
pointerEvents: "none"
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
152
|
children: [
|
|
153
|
-
|
|
153
|
+
T && /* @__PURE__ */ i(N, { sx: Po }),
|
|
154
154
|
/* @__PURE__ */ i(So, {
|
|
155
155
|
isMini: c,
|
|
156
156
|
subtitle: Y,
|
|
157
157
|
title: Z
|
|
158
158
|
}),
|
|
159
|
-
/* @__PURE__ */ i(
|
|
159
|
+
/* @__PURE__ */ i(N, {
|
|
160
160
|
sx: Go,
|
|
161
|
-
children:
|
|
162
|
-
beatGuid:
|
|
161
|
+
children: L ? /* @__PURE__ */ i(Lo, {}) : k && /* @__PURE__ */ i(k, {
|
|
162
|
+
beatGuid: D,
|
|
163
163
|
payload: e
|
|
164
164
|
})
|
|
165
165
|
}),
|
|
166
|
-
/* @__PURE__ */ C(
|
|
166
|
+
/* @__PURE__ */ C(w, {
|
|
167
167
|
sx: {
|
|
168
168
|
gap: 6,
|
|
169
169
|
pb: 16,
|
|
170
|
-
pt: 12,
|
|
170
|
+
pt: L || k ? 12 : 0,
|
|
171
171
|
px: 16
|
|
172
172
|
},
|
|
173
173
|
children: [
|
|
@@ -176,30 +176,30 @@ var Mo = {}, Po = {
|
|
|
176
176
|
sx: { fontWeight: "fontWeightRegular" },
|
|
177
177
|
variant: "subtitle2"
|
|
178
178
|
}),
|
|
179
|
-
|
|
180
|
-
endIcon: /* @__PURE__ */ i(
|
|
179
|
+
x && /* @__PURE__ */ i(f, {
|
|
180
|
+
endIcon: /* @__PURE__ */ i(H, {}),
|
|
181
181
|
onClick: () => b.openActionDrawer({
|
|
182
|
-
guid:
|
|
182
|
+
guid: D,
|
|
183
183
|
trigger: "inDescriptionCta"
|
|
184
184
|
}),
|
|
185
|
-
sx:
|
|
186
|
-
children:
|
|
185
|
+
sx: A,
|
|
186
|
+
children: x.label
|
|
187
187
|
}),
|
|
188
188
|
oo && /* @__PURE__ */ i(f, {
|
|
189
189
|
onClick: c ? to : void 0,
|
|
190
190
|
sx: Ro,
|
|
191
191
|
variant: "text",
|
|
192
|
-
children:
|
|
192
|
+
children: F
|
|
193
193
|
}),
|
|
194
|
-
!m?.label &&
|
|
195
|
-
endIcon: /* @__PURE__ */ i(
|
|
194
|
+
!m?.label && I && /* @__PURE__ */ i(f, {
|
|
195
|
+
endIcon: /* @__PURE__ */ i(H, {}),
|
|
196
196
|
onClick: q,
|
|
197
|
-
sx:
|
|
198
|
-
children:
|
|
197
|
+
sx: A,
|
|
198
|
+
children: I
|
|
199
199
|
})
|
|
200
200
|
]
|
|
201
201
|
}),
|
|
202
|
-
io && /* @__PURE__ */ C(
|
|
202
|
+
io && /* @__PURE__ */ C(w, {
|
|
203
203
|
sx: {
|
|
204
204
|
gap: 8,
|
|
205
205
|
pb: 16,
|
|
@@ -216,16 +216,16 @@ var Mo = {}, Po = {
|
|
|
216
216
|
u && r && !n && /* @__PURE__ */ i(f, {
|
|
217
217
|
"aria-disabled": p(r.block) || v.disabled,
|
|
218
218
|
disabled: v.disabled,
|
|
219
|
-
onClick: () =>
|
|
219
|
+
onClick: () => O("primary", r),
|
|
220
220
|
sx: { ...p(r.block) && { color: "text.disabled" } },
|
|
221
221
|
variant: "outlined",
|
|
222
222
|
children: r.label
|
|
223
223
|
}),
|
|
224
|
-
|
|
225
|
-
"aria-disabled": p(d.block) ||
|
|
224
|
+
E && d && /* @__PURE__ */ i(f, {
|
|
225
|
+
"aria-disabled": p(d.block) || B.disabled,
|
|
226
226
|
color: "inherit",
|
|
227
|
-
disabled:
|
|
228
|
-
onClick: () =>
|
|
227
|
+
disabled: B.disabled,
|
|
228
|
+
onClick: () => O("secondary", d),
|
|
229
229
|
sx: {
|
|
230
230
|
...Wo,
|
|
231
231
|
...p(d.block) && { color: "text.disabled" }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import { type MouseEvent, useEffect, useMemo } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { ChevronRight } from '@mxenabled/mx-icons'\nimport { P } from '@mxenabled/mxui'\n\nimport { blocks } from '../mappings/blocks'\nimport { actionBlocksKey } from '../mappings/actionBlocksKey'\nimport { isContactSupportCtaDisabled } from '../actionBlocks/ContactSupportActionBlock'\nimport { logoFromRef } from './shared/EntityLogo'\n\nimport Footer from './Footer'\nimport Header from './Header'\nimport FeedbackBar from './FeedbackBar'\nimport FeedbackDialog from './FeedbackDialog'\nimport DismissInsightDialog from './DismissInsightDialog'\nimport HiddenConfirmationCard from './HiddenConfirmationCard'\nimport ErrorCard from './ErrorCard'\nimport LoadingCard from './LoadingCard'\nimport { ObsolesceBanner, type ObsolesceBannerState } from './ObsolesceBanner'\nimport { useAppConfig, useGlobalCopyStore, useGlobalStore, useInsightsV2Store } from '../../common'\nimport { sendClientConfiguredCta } from '../../common/utils/PostMessage'\nimport type { Beat, PrimaryCTA, SecondaryCTA } from '../../core'\nimport { BEAT_ACTIVE_AT_KEY } from '../../core/stores/InsightsV2Store'\nimport { BeatActionsProvider, type BeatActions } from '../beatActions'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\nimport { HOST_ACTIONS, reportCtaClick, useBeatCtaActions } from '../ctaActions'\nimport { CtaStatus } from './CtaStatus'\nimport { useBeatFeedbackFlow } from '../hooks/useBeatFeedbackFlow'\n\nexport interface ObsoleteState {\n state: ObsolesceBannerState\n onRefresh: () => void\n onDismiss: () => void\n}\n\ninterface BaseLayoutProps {\n beat: Beat\n beatActions?: BeatActions\n obsolete?: ObsoleteState\n /** Swap only the block slot for a LoadingCard (e.g. while a sampled beat loads). */\n isLoading?: boolean\n /** Replace the entire card with an ErrorCard (e.g. when the sample fails to load). */\n isError?: boolean\n}\n\nconst NO_BEAT_ACTIONS: BeatActions = {}\n\nconst OBSOLETE_OVERLAY_SX = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n backgroundColor: 'background.default',\n opacity: 0.7,\n // Above every block's own z-index (hero card 1, AccountBlock 2), or that section shows through.\n zIndex: 3,\n} as const\n\n// Figma's 24px text link: 13/16 semibold, 16px line plus 4px above and below, its text starting at the\n// card's 16px inset. A minimum height, not the theme's fixed 44px Button height, so a long or translated\n// label wraps instead of overflowing; MUI's 64px minimum width and centring are undone for the same inset.\n// The in-description links use it as is, with the Button's 20px chevron, so they are 28px tall, as in\n// Figma's Low Account Balance full card (node 438:27877); the 24px is the mini CTA's, which has no icon.\nconst TEXT_LINK_SX = {\n alignSelf: 'flex-start',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n justifyContent: 'flex-start',\n lineHeight: '16px',\n minHeight: 24,\n minWidth: 0,\n px: 0,\n py: 4,\n textAlign: 'left',\n} as const\n\n// Mini CTA label, which fits Pulse's 312px mini slide as a text link.\nconst MINI_CTA_SX = {\n ...TEXT_LINK_SX,\n alignItems: 'center',\n display: 'flex',\n textTransform: 'none',\n} as const\n\n// The instance_slot grows into the height a fixed-height host leaves (Pulse's 312px mini slide; a full card leaves\n// none) and shrinks so a chart sized from its container fits. `clip` cuts a block that still cannot fit at the\n// slot's edge without making the slot a scroll container; the 4px margin keeps focus rings and edge shadows.\nconst INSTANCE_SLOT_SX = {\n flexGrow: 1,\n minHeight: 0,\n overflow: 'clip',\n overflowClipMargin: 4,\n // The block's root fills the slot, contents centred: `justifyContent` for a column, `alignContent` for a block or\n // a row. Zero specificity (`*:where(&)`), so any value the block sets wins; a row-root block must set its own\n // `justifyContent`, or this centres it sideways. `:first-of-type`, not `:first-child`: Emotion flags the latter\n // as SSR-unsafe, and a block renders one root.\n '*:where(&) > :where(:first-of-type)': {\n alignContent: 'center',\n height: '100%',\n justifyContent: 'center',\n },\n} as const\n\n// Full card's secondary CTA (e.g. Fee Detected's Contact Support): a quiet text button, 13/16\n// semibold in text.secondary, at least 40px tall with 12/16 padding, as in Figma. `color=\"inherit\"` keeps\n// hover, ripple and focus off the primary palette. An unavailable CTA (contact_support_block with no host\n// handler) is dimmed at the call site, as the primary CTA is, because it is only aria-disabled and so\n// never matches `.Mui-disabled`.\nconst SECONDARY_CTA_SX = {\n color: 'text.secondary',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n lineHeight: '16px',\n minHeight: 40,\n px: 16,\n py: 12,\n '&.Mui-disabled': { color: 'text.disabled' },\n} as const\n\nconst BaseLayout = observer(\n ({\n beat,\n beatActions = NO_BEAT_ACTIONS,\n obsolete,\n isLoading = false,\n isError = false,\n }: BaseLayoutProps) => {\n const copy = useGlobalCopyStore()\n const insightsV2Store = useInsightsV2Store()\n const { config } = useAppConfig()\n const flow = useBeatFeedbackFlow(beat, beatActions)\n\n const stores = useGlobalStore()\n const {\n runCta: handleCtaClick,\n primary: primaryCtaState,\n secondary: secondaryCtaState,\n linkPresentation,\n } = useBeatCtaActions(\n beat,\n beatActions,\n beat.insights_payload?.primary_cta ?? undefined,\n beat.insights_payload?.secondary_cta ?? undefined,\n beat.insights_payload?.in_description_cta ?? undefined,\n )\n\n // Guard: payload may not be loaded yet (isLoading/isError states).\n const isMini = beat.insights_payload?.widget_type === 'mini'\n\n // A sampled beat is re-read without active_at after a CTA; keep the card's for its drawers.\n const activeAt = beat.active_at ?? beat.insights_payload?.active_at\n useEffect(() => {\n if (activeAt == null || activeAt === '') return\n insightsV2Store.setBeatContext(beat.guid, { [BEAT_ACTIVE_AT_KEY]: activeAt })\n }, [activeAt, beat.guid, insightsV2Store])\n\n // Memoized: an inline object here would change identity every render, making every\n // useAnalyticsEvent() consumer's callback (and its effect deps) unstable too.\n const beatActionsValue = useMemo(\n () => ({ ...flow.wrappedActions, beat }),\n [flow.wrappedActions, beat],\n )\n\n // Error replaces the entire card; loading only swaps the block slot (below).\n if (isError) return <ErrorCard />\n\n const insights_payload = beat.insights_payload\n\n if (!insights_payload) return null\n if (flow.cardState === 'dismissed') return null\n\n const { instance_slot, primary_cta, secondary_cta, sub_title, title, guid, dismissed_at } =\n insights_payload\n const { block } = instance_slot\n\n // Rebuild V1 subtitle shape; sub_title wins if present.\n const subtitle =\n sub_title ??\n (insights_payload.subtitle\n ? {\n logo: logoFromRef(insights_payload.logo),\n text: insights_payload.subtitle,\n }\n : undefined)\n\n // CTAs run via ctaActions; contact_support_block bypasses it.\n const isCtaDisabled = (ctaBlock: string | null | undefined) =>\n isContactSupportCtaDisabled(ctaBlock, config, beatActions.onContactSupport)\n\n const onCtaClick = async (slot: 'primary' | 'secondary', cta: PrimaryCTA | SecondaryCTA) => {\n if (isCtaDisabled(cta.block)) return\n\n if (cta.block === actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK) {\n // Bypasses the runner, but still reports the press like any other CTA: the generic\n // press event, and (on a first primary press) FIRST_TIME_PRIMARY_ACTION_SELECTED +\n // cta_clicked_at.\n reportCtaClick({ beat, stores, hostActions: beatActions, slot })\n beatActions.onContactSupport?.()\n return\n }\n\n await handleCtaClick(slot, cta)\n }\n\n const Block = blocks[block as keyof typeof blocks]\n\n const inDescriptionCta = insights_payload.in_description_cta\n // Full card: the envelope's link opens the drawer its block names. A link with no block (mini's\n // \"Make a Transfer\") is the card's action, drawn as the mini label below, never a dead link.\n const envelopeLink =\n !isMini && inDescriptionCta?.label && inDescriptionCta.block ? inDescriptionCta : undefined\n // The card's action label: the primary CTA's, else a block-less envelope link's (ditto ≥ 1.4.3\n // sends mini's action as in_description_cta). `||`, not `??`: the copy may send the primary label\n // as \"\" rather than omit it, and an empty string must fall through. It is a button only on a full\n // card with a primary CTA; otherwise a label, so a tap reaches the host's card handler.\n const ctaLabel =\n primary_cta?.label || (envelopeLink ? undefined : inDescriptionCta?.label) || undefined\n const isCtaButton = !isMini && !!primary_cta?.label\n const clientConfiguredLabel = beat.in_description_cta || beat.html_in_description_cta\n const onClientConfiguredLinkClick = () => {\n const { is_mobile_webview, clientConfig } = stores.appDataStore.appConfig\n\n sendClientConfiguredCta(beat.template, {\n isMobileWebview: is_mobile_webview,\n webviewScheme: clientConfig?.master?.ui_message_webview_url_scheme,\n userGuid: insights_payload.user_guid ?? beat.user_guid,\n })\n }\n // The primary step's presenter may draw a status or nothing instead of the button (full card only).\n const primaryPresentation = isCtaButton ? primaryCtaState.presentation : undefined\n const hidesAllCtas = primaryPresentation?.kind === 'hidden' && !!primaryPresentation.hideAll\n const showSecondaryCta = !isMini && !!secondary_cta?.label && !hidesAllCtas\n // Mini: the card's action (in_description_cta) mirrors the full card's state, as a label only.\n // Answered → the status's action word (Undo) and its answered title; hidden → no label. The tap\n // stays the host's (it opens the insight with its block), so nothing runs from mini itself.\n const miniPresentation = isMini ? linkPresentation : undefined\n const miniStatus = miniPresentation?.kind === 'status' ? miniPresentation : undefined\n const actionLabel = miniPresentation ? miniStatus?.action?.label : ctaLabel\n const cardTitle = miniPresentation?.title || title || ''\n const showActionLink = !!actionLabel && !isCtaButton\n const showCtaRow = (isCtaButton && primaryPresentation?.kind !== 'hidden') || showSecondaryCta\n const handleMiniActionClick = (event: MouseEvent) => {\n const { onCtaAction } = beatActions\n if (!onCtaAction) return\n event.stopPropagation()\n Promise.resolve()\n .then(() => onCtaAction({ beatGuid: beat.guid, name: HOST_ACTIONS.cardClick }))\n .catch((error) =>\n stores.captureException(error, {\n store: 'BaseLayout',\n template: beat.template,\n handler: 'cardClick',\n }),\n )\n }\n const obsoleteCopy = copy.insights_feed?.general\n const isObsoleteDimmed =\n obsolete?.state === 'not_refreshable' && !dismissed_at && !!obsoleteCopy\n\n return (\n <BeatActionsProvider value={beatActionsValue}>\n <Stack sx={{ mb: 16 }}>\n {flow.cardState === 'confirming' ? (\n <HiddenConfirmationCard\n onClose={flow.collapseConfirmation}\n onLeaveFeedback={flow.openHideSurvey}\n onUndo={flow.undoDismiss}\n />\n ) : (\n <>\n {obsolete && obsoleteCopy && <ObsolesceBanner {...obsolete} copy={obsoleteCopy} />}\n <Card\n inert={isObsoleteDimmed}\n sx={{\n display: 'flex',\n flexDirection: 'column',\n ...(isObsoleteDimmed && {\n position: 'relative',\n zIndex: 2,\n pointerEvents: 'none',\n }),\n }}\n >\n {isObsoleteDimmed && <Box sx={OBSOLETE_OVERLAY_SX} />}\n <Header isMini={isMini} subtitle={subtitle} title={cardTitle} />\n <Box sx={INSTANCE_SLOT_SX}>\n {isLoading ? (\n <LoadingCard />\n ) : (\n Block && <Block beatGuid={guid} payload={insights_payload} />\n )}\n </Box>\n\n <Stack sx={{ gap: 6, pb: 16, pt: 12, px: 16 }}>\n <P\n dangerouslySetInnerHTML={{\n __html: insights_payload.description.html_text,\n }}\n sx={{ fontWeight: 'fontWeightRegular' }}\n variant=\"subtitle2\"\n />\n {/* V2: the envelope's link opens the action block it names. */}\n {envelopeLink && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() =>\n insightsV2Store.openActionDrawer({ guid, trigger: 'inDescriptionCta' })\n }\n sx={TEXT_LINK_SX}\n >\n {envelopeLink.label}\n </Button>\n )}\n {/* The card's action with no primary CTA button, never a drawer: mini hands its tap to\n the host (`cardClick`); a full card's block-less link bubbles to the host's card handler. */}\n {showActionLink && (\n <Button\n onClick={isMini ? handleMiniActionClick : undefined}\n sx={MINI_CTA_SX}\n variant=\"text\"\n >\n {actionLabel}\n </Button>\n )}\n {/* Custom-copy link when the envelope sends none; legacy mini shows it too, so no mini guard. */}\n {!inDescriptionCta?.label && clientConfiguredLabel && (\n <Button\n endIcon={<ChevronRight />}\n onClick={onClientConfiguredLinkClick}\n sx={TEXT_LINK_SX}\n >\n {clientConfiguredLabel}\n </Button>\n )}\n </Stack>\n\n {showCtaRow && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n {isCtaButton && primary_cta && primaryPresentation?.kind === 'status' && (\n <CtaStatus\n action={primaryPresentation.action}\n sx={primaryPresentation.sx}\n icon={primaryPresentation.icon}\n label={primaryPresentation.label}\n tone={primaryPresentation.tone}\n />\n )}\n {isCtaButton && primary_cta && !primaryPresentation && (\n <Button\n aria-disabled={isCtaDisabled(primary_cta.block) || primaryCtaState.disabled}\n disabled={primaryCtaState.disabled}\n onClick={() => onCtaClick('primary', primary_cta)}\n sx={{\n ...(isCtaDisabled(primary_cta.block) && { color: 'text.disabled' }),\n }}\n variant=\"outlined\"\n >\n {primary_cta.label}\n </Button>\n )}\n {/* Mini has room for one CTA. */}\n {showSecondaryCta && secondary_cta && (\n <Button\n aria-disabled={\n isCtaDisabled(secondary_cta.block) || secondaryCtaState.disabled\n }\n color=\"inherit\"\n disabled={secondaryCtaState.disabled}\n onClick={() => onCtaClick('secondary', secondary_cta)}\n sx={{\n ...SECONDARY_CTA_SX,\n ...(isCtaDisabled(secondary_cta.block) && { color: 'text.disabled' }),\n }}\n >\n {secondary_cta.label}\n </Button>\n )}\n </Stack>\n )}\n\n <FeedbackBar onTellUsMore={flow.openRatingSurvey} show={flow.isFeedbackBarShown} />\n </Card>\n </>\n )}\n\n <ActionBlockLayer beat={beat} />\n\n <DismissInsightDialog\n isOpen={flow.isDismissOpen}\n onClose={flow.closeDismissDialog}\n onDismiss={flow.confirmDismiss}\n />\n\n {flow.isSurveyOpen && (\n <FeedbackDialog\n characterLimitLabel={flow.survey.characterLimitLabel}\n closeAriaLabel={flow.survey.closeAriaLabel}\n isOpen={true}\n onBackClick={flow.feedbackDialogCallbacks.onBackClick}\n onClose={flow.closeSurvey}\n onSubmit={flow.submitSurvey}\n onTextInputFocus={flow.feedbackDialogCallbacks.onTextInputFocus}\n options={flow.survey.options}\n primaryText={flow.survey.submitText}\n secondaryText={flow.survey.backText}\n title={flow.survey.title}\n />\n )}\n\n {flow.cardState === 'visible' && insights_payload.footer && (\n <Footer footer={insights_payload.footer} />\n )}\n </Stack>\n </BeatActionsProvider>\n )\n },\n)\n\nexport default BaseLayout\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,IAAM,KAA+B,CAAC,GAEhC,KAAsB;AAAA,EAC1B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,SAAS;AAAA,EAET,QAAQ;AACV,GAOM,IAAe;AAAA,EACnB,WAAW;AAAA,EACX,UAAU;AAAA,EACV,YAAY;AAA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EAAkB;AAAA,kBAC5B,SAAA,MAAe,EAAW,aAAa,CAAa;AAAA,kBACpD,IAAI;AAAA,oBACF,GAAG;AAAA,oBACH,GAAI,EAAc,EAAc,KAAK,KAAK,EAAE,OAAO,gBAAgB;AAAA,kBACrE;AAAA,kBAEC,UAAA,EAAc;AAAA,gBACT,CAAA;AAAA,cAEL;AAAA;YAGT,gBAAA,EAAC,IAAD;AAAA,cAAa,cAAc,EAAK;AAAA,cAAkB,MAAM,EAAK;AAAA,YAAqB,CAAA;AAAA,UAC9E;AAAA,QACN,CAAA,CAAA,EAAA,CAAA;AAAA,QAGJ,gBAAA,EAAC,IAAD,EAAwB,MAAA,EAAO,CAAA;AAAA,QAE/B,gBAAA,EAAC,IAAD;AAAA,UACE,QAAQ,EAAK;AAAA,UACb,SAAS,EAAK;AAAA,UACd,WAAW,EAAK;AAAA,QACjB,CAAA;AAAA,QAEA,EAAK,gBACJ,gBAAA,EAAC,IAAD;AAAA,UACE,qBAAqB,EAAK,OAAO;AAAA,UACjC,gBAAgB,EAAK,OAAO;AAAA,UAC5B,QAAQ;AAAA,UACR,aAAa,EAAK,wBAAwB;AAAA,UAC1C,SAAS,EAAK;AAAA,UACd,UAAU,EAAK;AAAA,UACf,kBAAkB,EAAK,wBAAwB;AAAA,UAC/C,SAAS,EAAK,OAAO;AAAA,UACrB,aAAa,EAAK,OAAO;AAAA,UACzB,eAAe,EAAK,OAAO;AAAA,UAC3B,OAAO,EAAK,OAAO;AAAA,QACpB,CAAA;AAAA,QAGF,EAAK,cAAc,aAAa,EAAiB,UAChD,gBAAA,EAAC,IAAD,EAAQ,QAAQ,EAAiB,OAAS,CAAA;AAAA,MAEvC;AAAA;EACY,CAAA;AAEzB,CACF"}
|
|
1
|
+
{"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import { type MouseEvent, useEffect, useMemo } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { ChevronRight } from '@mxenabled/mx-icons'\nimport { P } from '@mxenabled/mxui'\n\nimport { blocks } from '../mappings/blocks'\nimport { actionBlocksKey } from '../mappings/actionBlocksKey'\nimport { isContactSupportCtaDisabled } from '../actionBlocks/ContactSupportActionBlock'\nimport { logoFromRef } from './shared/EntityLogo'\n\nimport Footer from './Footer'\nimport Header from './Header'\nimport FeedbackBar from './FeedbackBar'\nimport FeedbackDialog from './FeedbackDialog'\nimport DismissInsightDialog from './DismissInsightDialog'\nimport HiddenConfirmationCard from './HiddenConfirmationCard'\nimport ErrorCard from './ErrorCard'\nimport LoadingCard from './LoadingCard'\nimport { ObsolesceBanner, type ObsolesceBannerState } from './ObsolesceBanner'\nimport { useAppConfig, useGlobalCopyStore, useGlobalStore, useInsightsV2Store } from '../../common'\nimport { sendClientConfiguredCta } from '../../common/utils/PostMessage'\nimport type { Beat, PrimaryCTA, SecondaryCTA } from '../../core'\nimport { BEAT_ACTIVE_AT_KEY } from '../../core/stores/InsightsV2Store'\nimport { BeatActionsProvider, type BeatActions } from '../beatActions'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\nimport { HOST_ACTIONS, reportCtaClick, useBeatCtaActions } from '../ctaActions'\nimport { CtaStatus } from './CtaStatus'\nimport { useBeatFeedbackFlow } from '../hooks/useBeatFeedbackFlow'\n\nexport interface ObsoleteState {\n state: ObsolesceBannerState\n onRefresh: () => void\n onDismiss: () => void\n}\n\ninterface BaseLayoutProps {\n beat: Beat\n beatActions?: BeatActions\n obsolete?: ObsoleteState\n /** Swap only the block slot for a LoadingCard (e.g. while a sampled beat loads). */\n isLoading?: boolean\n /** Replace the entire card with an ErrorCard (e.g. when the sample fails to load). */\n isError?: boolean\n}\n\nconst NO_BEAT_ACTIONS: BeatActions = {}\n\nconst OBSOLETE_OVERLAY_SX = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n backgroundColor: 'background.default',\n opacity: 0.7,\n // Above every block's own z-index (hero card 1, AccountBlock 2), or that section shows through.\n zIndex: 3,\n} as const\n\n// Figma's 24px text link: 13/16 semibold, 16px line plus 4px above and below, its text starting at the\n// card's 16px inset. A minimum height, not the theme's fixed 44px Button height, so a long or translated\n// label wraps instead of overflowing; MUI's 64px minimum width and centring are undone for the same inset.\n// The in-description links use it as is, with the Button's 20px chevron, so they are 28px tall, as in\n// Figma's Low Account Balance full card (node 438:27877); the 24px is the mini CTA's, which has no icon.\nconst TEXT_LINK_SX = {\n alignSelf: 'flex-start',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n justifyContent: 'flex-start',\n lineHeight: '16px',\n minHeight: 24,\n minWidth: 0,\n px: 0,\n py: 4,\n textAlign: 'left',\n} as const\n\n// Mini CTA label, which fits Pulse's 312px mini slide as a text link.\nconst MINI_CTA_SX = {\n ...TEXT_LINK_SX,\n alignItems: 'center',\n display: 'flex',\n textTransform: 'none',\n} as const\n\n// The instance_slot grows into the height a fixed-height host leaves (Pulse's 312px mini slide; a full card leaves\n// none) and shrinks so a chart sized from its container fits. `clip` cuts a block that still cannot fit at the\n// slot's edge without making the slot a scroll container; the 4px margin keeps focus rings and edge shadows.\nconst INSTANCE_SLOT_SX = {\n flexGrow: 1,\n minHeight: 0,\n overflow: 'clip',\n overflowClipMargin: 4,\n // The block's root fills the slot, contents centred: `justifyContent` for a column, `alignContent` for a block or\n // a row. Zero specificity (`*:where(&)`), so any value the block sets wins; a row-root block must set its own\n // `justifyContent`, or this centres it sideways. `:first-of-type`, not `:first-child`: Emotion flags the latter\n // as SSR-unsafe, and a block renders one root.\n '*:where(&) > :where(:first-of-type)': {\n alignContent: 'center',\n height: '100%',\n justifyContent: 'center',\n },\n} as const\n\n// Full card's secondary CTA (e.g. Fee Detected's Contact Support): a quiet text button, 13/16\n// semibold in text.secondary, at least 40px tall with 12/16 padding, as in Figma. `color=\"inherit\"` keeps\n// hover, ripple and focus off the primary palette. An unavailable CTA (contact_support_block with no host\n// handler) is dimmed at the call site, as the primary CTA is, because it is only aria-disabled and so\n// never matches `.Mui-disabled`.\nconst SECONDARY_CTA_SX = {\n color: 'text.secondary',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n lineHeight: '16px',\n minHeight: 40,\n px: 16,\n py: 12,\n '&.Mui-disabled': { color: 'text.disabled' },\n} as const\n\nconst BaseLayout = observer(\n ({\n beat,\n beatActions = NO_BEAT_ACTIONS,\n obsolete,\n isLoading = false,\n isError = false,\n }: BaseLayoutProps) => {\n const copy = useGlobalCopyStore()\n const insightsV2Store = useInsightsV2Store()\n const { config } = useAppConfig()\n const flow = useBeatFeedbackFlow(beat, beatActions)\n\n const stores = useGlobalStore()\n const {\n runCta: handleCtaClick,\n primary: primaryCtaState,\n secondary: secondaryCtaState,\n linkPresentation,\n } = useBeatCtaActions(\n beat,\n beatActions,\n beat.insights_payload?.primary_cta ?? undefined,\n beat.insights_payload?.secondary_cta ?? undefined,\n beat.insights_payload?.in_description_cta ?? undefined,\n )\n\n // Guard: payload may not be loaded yet (isLoading/isError states).\n const isMini = beat.insights_payload?.widget_type === 'mini'\n\n // A sampled beat is re-read without active_at after a CTA; keep the card's for its drawers.\n const activeAt = beat.active_at ?? beat.insights_payload?.active_at\n useEffect(() => {\n if (activeAt == null || activeAt === '') return\n insightsV2Store.setBeatContext(beat.guid, { [BEAT_ACTIVE_AT_KEY]: activeAt })\n }, [activeAt, beat.guid, insightsV2Store])\n\n // Memoized: an inline object here would change identity every render, making every\n // useAnalyticsEvent() consumer's callback (and its effect deps) unstable too.\n const beatActionsValue = useMemo(\n () => ({ ...flow.wrappedActions, beat }),\n [flow.wrappedActions, beat],\n )\n\n // Error replaces the entire card; loading only swaps the block slot (below).\n if (isError) return <ErrorCard />\n\n const insights_payload = beat.insights_payload\n\n if (!insights_payload) return null\n if (flow.cardState === 'dismissed') return null\n\n const { instance_slot, primary_cta, secondary_cta, sub_title, title, guid, dismissed_at } =\n insights_payload\n const { block } = instance_slot\n\n // Rebuild V1 subtitle shape; sub_title wins if present.\n const subtitle =\n sub_title ??\n (insights_payload.subtitle\n ? {\n logo: logoFromRef(insights_payload.logo),\n text: insights_payload.subtitle,\n }\n : undefined)\n\n // CTAs run via ctaActions; contact_support_block bypasses it.\n const isCtaDisabled = (ctaBlock: string | null | undefined) =>\n isContactSupportCtaDisabled(ctaBlock, config, beatActions.onContactSupport)\n\n const onCtaClick = async (slot: 'primary' | 'secondary', cta: PrimaryCTA | SecondaryCTA) => {\n if (isCtaDisabled(cta.block)) return\n\n if (cta.block === actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK) {\n // Bypasses the runner, but still reports the press like any other CTA: the generic\n // press event, and (on a first primary press) FIRST_TIME_PRIMARY_ACTION_SELECTED +\n // cta_clicked_at.\n reportCtaClick({ beat, stores, hostActions: beatActions, slot })\n beatActions.onContactSupport?.()\n return\n }\n\n await handleCtaClick(slot, cta)\n }\n\n const Block = blocks[block as keyof typeof blocks]\n\n const inDescriptionCta = insights_payload.in_description_cta\n // Full card: the envelope's link opens the drawer its block names. A link with no block (mini's\n // \"Make a Transfer\") is the card's action, drawn as the mini label below, never a dead link.\n const envelopeLink =\n !isMini && inDescriptionCta?.label && inDescriptionCta.block ? inDescriptionCta : undefined\n // The card's action label: the primary CTA's, else a block-less envelope link's (ditto ≥ 1.4.3\n // sends mini's action as in_description_cta). `||`, not `??`: the copy may send the primary label\n // as \"\" rather than omit it, and an empty string must fall through. It is a button only on a full\n // card with a primary CTA; otherwise a label, so a tap reaches the host's card handler.\n const ctaLabel =\n primary_cta?.label || (envelopeLink ? undefined : inDescriptionCta?.label) || undefined\n const isCtaButton = !isMini && !!primary_cta?.label\n const clientConfiguredLabel = beat.in_description_cta || beat.html_in_description_cta\n const onClientConfiguredLinkClick = () => {\n const { is_mobile_webview, clientConfig } = stores.appDataStore.appConfig\n\n sendClientConfiguredCta(beat.template, {\n isMobileWebview: is_mobile_webview,\n webviewScheme: clientConfig?.master?.ui_message_webview_url_scheme,\n userGuid: insights_payload.user_guid ?? beat.user_guid,\n })\n }\n // The primary step's presenter may draw a status or nothing instead of the button (full card only).\n const primaryPresentation = isCtaButton ? primaryCtaState.presentation : undefined\n const hidesAllCtas = primaryPresentation?.kind === 'hidden' && !!primaryPresentation.hideAll\n const showSecondaryCta = !isMini && !!secondary_cta?.label && !hidesAllCtas\n // Mini: the card's action (in_description_cta) mirrors the full card's state, as a label only.\n // Answered → the status's action word (Undo) and its answered title; hidden → no label. The tap\n // stays the host's (it opens the insight with its block), so nothing runs from mini itself.\n const miniPresentation = isMini ? linkPresentation : undefined\n const miniStatus = miniPresentation?.kind === 'status' ? miniPresentation : undefined\n const actionLabel = miniPresentation ? miniStatus?.action?.label : ctaLabel\n const cardTitle = miniPresentation?.title || title || ''\n const showActionLink = !!actionLabel && !isCtaButton\n const showCtaRow = (isCtaButton && primaryPresentation?.kind !== 'hidden') || showSecondaryCta\n const handleMiniActionClick = (event: MouseEvent) => {\n const { onCtaAction } = beatActions\n if (!onCtaAction) return\n event.stopPropagation()\n Promise.resolve()\n .then(() => onCtaAction({ beatGuid: beat.guid, name: HOST_ACTIONS.cardClick }))\n .catch((error) =>\n stores.captureException(error, {\n store: 'BaseLayout',\n template: beat.template,\n handler: 'cardClick',\n }),\n )\n }\n const obsoleteCopy = copy.insights_feed?.general\n const isObsoleteDimmed =\n obsolete?.state === 'not_refreshable' && !dismissed_at && !!obsoleteCopy\n\n return (\n <BeatActionsProvider value={beatActionsValue}>\n <Stack sx={{ mb: 16 }}>\n {flow.cardState === 'confirming' ? (\n <HiddenConfirmationCard\n onClose={flow.collapseConfirmation}\n onLeaveFeedback={flow.openHideSurvey}\n onUndo={flow.undoDismiss}\n />\n ) : (\n <>\n {obsolete && obsoleteCopy && <ObsolesceBanner {...obsolete} copy={obsoleteCopy} />}\n <Card\n inert={isObsoleteDimmed}\n sx={{\n display: 'flex',\n flexDirection: 'column',\n ...(isObsoleteDimmed && {\n position: 'relative',\n zIndex: 2,\n pointerEvents: 'none',\n }),\n }}\n >\n {isObsoleteDimmed && <Box sx={OBSOLETE_OVERLAY_SX} />}\n <Header isMini={isMini} subtitle={subtitle} title={cardTitle} />\n <Box sx={INSTANCE_SLOT_SX}>\n {isLoading ? (\n <LoadingCard />\n ) : (\n Block && <Block beatGuid={guid} payload={insights_payload} />\n )}\n </Box>\n\n {/* Figma Template/Insight Card: with an empty slot, the description follows the header's 12px. */}\n <Stack sx={{ gap: 6, pb: 16, pt: isLoading || Block ? 12 : 0, px: 16 }}>\n <P\n dangerouslySetInnerHTML={{\n __html: insights_payload.description.html_text,\n }}\n sx={{ fontWeight: 'fontWeightRegular' }}\n variant=\"subtitle2\"\n />\n {/* V2: the envelope's link opens the action block it names. */}\n {envelopeLink && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() =>\n insightsV2Store.openActionDrawer({ guid, trigger: 'inDescriptionCta' })\n }\n sx={TEXT_LINK_SX}\n >\n {envelopeLink.label}\n </Button>\n )}\n {/* The card's action with no primary CTA button, never a drawer: mini hands its tap to\n the host (`cardClick`); a full card's block-less link bubbles to the host's card handler. */}\n {showActionLink && (\n <Button\n onClick={isMini ? handleMiniActionClick : undefined}\n sx={MINI_CTA_SX}\n variant=\"text\"\n >\n {actionLabel}\n </Button>\n )}\n {/* Custom-copy link when the envelope sends none; legacy mini shows it too, so no mini guard. */}\n {!inDescriptionCta?.label && clientConfiguredLabel && (\n <Button\n endIcon={<ChevronRight />}\n onClick={onClientConfiguredLinkClick}\n sx={TEXT_LINK_SX}\n >\n {clientConfiguredLabel}\n </Button>\n )}\n </Stack>\n\n {showCtaRow && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n {isCtaButton && primary_cta && primaryPresentation?.kind === 'status' && (\n <CtaStatus\n action={primaryPresentation.action}\n sx={primaryPresentation.sx}\n icon={primaryPresentation.icon}\n label={primaryPresentation.label}\n tone={primaryPresentation.tone}\n />\n )}\n {isCtaButton && primary_cta && !primaryPresentation && (\n <Button\n aria-disabled={isCtaDisabled(primary_cta.block) || primaryCtaState.disabled}\n disabled={primaryCtaState.disabled}\n onClick={() => onCtaClick('primary', primary_cta)}\n sx={{\n ...(isCtaDisabled(primary_cta.block) && { color: 'text.disabled' }),\n }}\n variant=\"outlined\"\n >\n {primary_cta.label}\n </Button>\n )}\n {/* Mini has room for one CTA. */}\n {showSecondaryCta && secondary_cta && (\n <Button\n aria-disabled={\n isCtaDisabled(secondary_cta.block) || secondaryCtaState.disabled\n }\n color=\"inherit\"\n disabled={secondaryCtaState.disabled}\n onClick={() => onCtaClick('secondary', secondary_cta)}\n sx={{\n ...SECONDARY_CTA_SX,\n ...(isCtaDisabled(secondary_cta.block) && { color: 'text.disabled' }),\n }}\n >\n {secondary_cta.label}\n </Button>\n )}\n </Stack>\n )}\n\n <FeedbackBar onTellUsMore={flow.openRatingSurvey} show={flow.isFeedbackBarShown} />\n </Card>\n </>\n )}\n\n <ActionBlockLayer beat={beat} />\n\n <DismissInsightDialog\n isOpen={flow.isDismissOpen}\n onClose={flow.closeDismissDialog}\n onDismiss={flow.confirmDismiss}\n />\n\n {flow.isSurveyOpen && (\n <FeedbackDialog\n characterLimitLabel={flow.survey.characterLimitLabel}\n closeAriaLabel={flow.survey.closeAriaLabel}\n isOpen={true}\n onBackClick={flow.feedbackDialogCallbacks.onBackClick}\n onClose={flow.closeSurvey}\n onSubmit={flow.submitSurvey}\n onTextInputFocus={flow.feedbackDialogCallbacks.onTextInputFocus}\n options={flow.survey.options}\n primaryText={flow.survey.submitText}\n secondaryText={flow.survey.backText}\n title={flow.survey.title}\n />\n )}\n\n {flow.cardState === 'visible' && insights_payload.footer && (\n <Footer footer={insights_payload.footer} />\n )}\n </Stack>\n </BeatActionsProvider>\n )\n },\n)\n\nexport default BaseLayout\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,IAAM,KAA+B,CAAC,GAEhC,KAAsB;AAAA,EAC1B,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