@mx-cartographer/experiences 9.7.165 → 9.7.166
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 +9 -0
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +0 -2
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.es.js +1 -1
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.d.ts +1 -5
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +53 -58
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +92 -99
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +1 -3
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +72 -81
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.d.ts +5 -6
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.es.js +16 -16
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +4 -32
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js +59 -83
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/layout.es.js +8 -7
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js.map +1 -1
- package/dist/insights-v2/components/celebrationGradients.d.ts +4 -3
- package/dist/insights-v2/components/celebrationGradients.es.js +14 -14
- package/dist/insights-v2/components/celebrationGradients.es.js.map +1 -1
- package/dist/insights-v2/mappings/blocks.es.js +0 -1
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/package.json +1 -1
package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionHistoryBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.tsx"],"sourcesContent":["import { useLayoutEffect, useState } from 'react'\n\nimport { useTheme } from '@mui/material/styles'\nimport { observer } from 'mobx-react-lite'\n\nimport type { Beat, DataSeries, GlobalCopy, Transaction } from '../../../core'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { ANALYTICS_EVENTS_CONFIG, useAnalyticsEvent } from '../../analytics'\nimport { BarChartV2 } from '../../components/chartblocks/BarchartV2'\nimport { DoubleBarChart } from '../../components/chartblocks/DoubleBarChart'\nimport { EmptyBarChart } from '../../components/chartblocks/EmptyBarChart'\nimport { BAR_ARIA_LABEL } from '../../blocks/ChartBlocks/BarchartBlock/utils'\nimport {\n COMPARISON_BAR_ARIA_LABEL,\n toLegendItems,\n} from '../../blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils'\n\nimport { TransactionDrillDown } from './TransactionDrillDown'\nimport { useTransactionHistory } from './useTransactionHistory'\nimport {\n getDefaultSelection,\n getDrillDownConfig,\n getFlattenedDataSeries,\n resolveDrillDownSubHeader,\n splitProjectedTransaction,\n toStoreFilter,\n} from './utils'\nimport { Drawer, useInsightsV2Store, useGlobalCopyStore } from '../../../common'\nimport { TransactionDetailsBlock } from '../TransactionDetailsBlock'\nimport { useOpenedCta } from '../useOpenedCta'\nimport { useRequiredCopy } from '../useRequiredCopy'\n\ninterface TransactionHistoryProp {\n beat: Beat\n}\n\nexport const selectTransactionHistoryCopy = (copy: GlobalCopy) => copy.insights_feed\n\nexport const TransactionHistoryBlock = observer(({ beat }: TransactionHistoryProp) => {\n const theme = useTheme()\n\n const { actionDrawer, setActionContext } = useInsightsV2Store()\n\n const { insights_payload } = beat\n\n // The CTA that opened the drawer: its variant picks the view, and its drilldown_data feeds a\n // variant that reads its facts from the opener (Monthly Debt to Income). Only drilldown_data is passed\n // on: it is the payload's own object, stable across renders, while the opener may be rebuilt per render.\n const openedCta = useOpenedCta(beat)\n const dynamicCtaVariant = openedCta?.variant\n\n const {\n top,\n filterMode,\n header,\n colors,\n filterStrategy,\n tipSection,\n subTabAriaLabels,\n slotData,\n beatTransactions: resolveBeatTransactions,\n averageFormat,\n subTabs,\n boldLabel,\n } = getDrillDownConfig(dynamicCtaVariant ?? '')\n\n const {\n instanceSlotData,\n beatTransactions,\n spendCategoryGuids,\n allAccountGuids,\n categoryName,\n displayedDateRange,\n transactionStore,\n } = useTransactionHistory(\n beat,\n { slotData, beatTransactions: resolveBeatTransactions },\n openedCta?.drilldown_data,\n )\n\n const { common: commonCopy } = useGlobalCopyStore()\n const insightsCopy = useRequiredCopy(selectTransactionHistoryCopy)\n\n const [isTransactionDetailsOpen, setIsTransactionDetailsOpen] = useState(false)\n\n const [closeTipSection, setCloseTipSection] = useState(false)\n\n const fireAnalyticsEvent = useAnalyticsEvent()\n\n const { dataSeries, chartData, comparisonBars } = getFlattenedDataSeries({\n data: instanceSlotData?.data_series as DataSeries,\n ariaLabel:\n top === 'doubleBar'\n ? (insightsCopy?.general?.in_month_you_had_a_category_of_amount ??\n COMPARISON_BAR_ARIA_LABEL)\n : BAR_ARIA_LABEL,\n top,\n beatTransactions,\n })\n\n const isDoubleBar = top === 'doubleBar'\n const isTabsOnly = top === 'tabsOnly'\n // The drawer's columns (and tabs): the double bar's month pairs, or the single bar's bars.\n const bars = isDoubleBar ? comparisonBars : chartData\n\n const { chartBarIndex, subTabIndex } = getDefaultSelection({\n chartTabCount: chartData.length,\n comparisonTabCount: comparisonBars.length,\n actionDrawer,\n beatGuid: beat.guid,\n })\n\n const [selectedIndex, setSelectedIndex] = useState(chartBarIndex)\n // The double-bar drawer's series tab (0 = main, e.g. Spend; 1 = comparison, e.g. Income).\n const [subIndex, setSubIndex] = useState(subTabIndex)\n\n // Bars built from the transaction store (Upcoming Bill's paid bills) can arrive after the drawer\n // opens: re-select the default when the bar count changes. Payload-built bars never change count.\n const [defaultedTabCount, setDefaultedTabCount] = useState(bars.length)\n if (bars.length !== defaultedTabCount) {\n setDefaultedTabCount(bars.length)\n setSelectedIndex(chartBarIndex)\n }\n\n const resolveFilter = (index: number) =>\n filterStrategy({\n beat,\n beatTransactions,\n dataSeries,\n comparisonBars,\n selectedIndex: index,\n subIndex,\n isLastTab: index === bars.length - 1,\n instanceSlotData,\n spendCategoryGuids,\n displayedDateRange,\n })\n\n // Content keys for the effect deps: these arrays get a new identity every render (MEW-3732).\n const beatTransactionGuidsKey = beatTransactions.map((transaction) => transaction.guid).join(',')\n const spendCategoryGuidsKey = spendCategoryGuids.join(',')\n const allAccountGuidsKey = allAccountGuids.join(',')\n\n // Re-applied on selection change and when the nested details drawer closes: AddMerchantBudgetAction\n // overwrites transactionStore.filter and never restores it. Chartless tops filter with no bars.\n const canApplyFilter =\n top === 'list' || top === 'tabsOnly' || top === 'monthTabs' || dataSeries.length > 0\n const applyCurrentSelectionFilter = () => {\n if (filterMode !== 'store') return\n // A chart drawer with no bars can name no rows: fail closed rather than keep the store's default\n // (every account) or a previous drawer's filter.\n const filter = canApplyFilter\n ? resolveFilter(selectedIndex)\n : { accounts: [], custom: () => false }\n transactionStore.setFilter(toStoreFilter(filter, { allAccountGuids, displayedDateRange }))\n }\n\n // store variants route the selection through the shared store filter; local (upcomingBill) variants\n // filter beatTransactions directly, so there's nothing to push to the store for them.\n useLayoutEffect(() => {\n applyCurrentSelectionFilter()\n }, [\n beat.guid,\n selectedIndex,\n subIndex,\n filterMode,\n dataSeries.length,\n instanceSlotData,\n displayedDateRange,\n spendCategoryGuidsKey,\n allAccountGuidsKey,\n beatTransactionGuidsKey,\n top,\n ])\n\n const subHeader = resolveDrillDownSubHeader(insights_payload)\n\n const headerContent = header?.({\n title: insights_payload?.title,\n subHeader,\n categoryName,\n selectedDate: chartData[selectedIndex]?.date ?? undefined,\n slotData: instanceSlotData,\n })\n\n const barColors = colors(theme, instanceSlotData?.category_guid)\n\n // `legends` is the block's additional_data ([0] main, [1] second series), as BarchartBlock reads it.\n const [mainLegend, comparisonLegend] = instanceSlotData?.legends ?? []\n\n const transactionFilter =\n filterMode === 'local'\n ? (index: number) => resolveFilter(index).custom ?? (() => true)\n : undefined\n\n // Upcoming Bill appends a synthesized projected bill: it draws the last bar and its own labelled\n // row, but is never a plain list row or a CSV line.\n const { transactions: listTransactions, projectedTransaction } =\n splitProjectedTransaction(beatTransactions)\n\n const baseTransactions: Transaction[] | undefined =\n filterMode === 'local' ? listTransactions : undefined\n\n const projectedHeading = insightsCopy.general.projected_amount\n const projectedRow =\n projectedTransaction &&\n projectedHeading &&\n resolveFilter(selectedIndex).custom?.(projectedTransaction)\n ? { heading: projectedHeading, transaction: projectedTransaction }\n : undefined\n\n // A chart bar click selects its column (and, on the double bar, its series); a month tab change\n // selects the month. MUI Tabs only fires onChange on real user selection, not on mount. The\n // series (Spend / Income) tab fires its own analytics via the shared SubTabs component.\n const selectBar = (index: number, seriesIndex?: number) => {\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.DRAWER_CHART_BAR_CLICKED)\n setSelectedIndex(index)\n if (seriesIndex !== undefined) setSubIndex(seriesIndex)\n }\n const selectMonth = (index: number) => {\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.TAB_SELECTED)\n setSelectedIndex(index)\n }\n\n // Double bar: the Spend / Income labels come from copy (additional_data); the legend carries the\n // selected month's two totals, and its labels name the series tabs.\n const doubleBarLegends = isDoubleBar\n ? toLegendItems([\n { ...mainLegend, value: comparisonBars[selectedIndex]?.main },\n { ...comparisonLegend, value: comparisonBars[selectedIndex]?.comparison },\n ])\n : undefined\n\n // Legacy pulse named these tabs \"Spend transactions\" / \"Income transactions\" for screen readers.\n const seriesAriaLabels = subTabAriaLabels?.(insightsCopy) ?? []\n\n // The second tab row: the double bar's series, a tabs-only drawer's sides, or the variant's `subTabs`.\n const sideTabs = isDoubleBar\n ? (doubleBarLegends ?? []).map((legend, index) => ({\n label: legend.label,\n ariaLabel: seriesAriaLabels[index],\n }))\n : isTabsOnly\n ? dataSeries.flatMap((row) => (row.localized_label ? [{ label: row.localized_label }] : []))\n : (subTabs?.({ instanceSlotData, copy: insightsCopy }).map((label) => ({ label })) ?? [])\n\n const renderChart = () => {\n if (!bars.length) return <EmptyBarChart />\n\n return isDoubleBar ? (\n <DoubleBarChart\n bars={comparisonBars}\n boldLabel={boldLabel}\n colors={barColors}\n legendPosition=\"top\"\n legends={doubleBarLegends}\n onBarClick={selectBar}\n selectedIndex={selectedIndex}\n />\n ) : (\n <BarChartV2\n amounts={{\n average: instanceSlotData?.average_amount,\n formattedAverage: formatCurrency(\n instanceSlotData?.average_amount ?? 0,\n averageFormat ?? CURRENCY_FORMAT.cents,\n ),\n }}\n color={barColors[0] ?? theme.palette.primary.main}\n data={chartData}\n legendPosition=\"top\"\n // Figma's chart drawer: 172px of bars under the 24px legend, 200px in all.\n heightOverride={172}\n margin={{\n bottom: 8,\n top: 24,\n left: 24,\n right: 24,\n }}\n // TODO: Temporary fallback while the backend doesn't always send `legends` on every\n // beat/variant. Remove this once the backend guarantees `legends` on the payload.\n monthlyAmountLabel={mainLegend?.label ?? insightsCopy.general.monthly_amount}\n onBarClick={selectBar}\n selectedTabIndex={selectedIndex}\n trendAmountLabel={comparisonLegend?.label ?? insightsCopy.general.trend}\n />\n )\n }\n\n // `list` (Low Account Balance), `tabsOnly` (Non-Essential Category Summary) and `monthTabs`\n // (Monthly Subscription Aggregate) drawers have no chart above their transaction list.\n const chartTop =\n isDoubleBar || top === 'singleBar' || top === 'upcomingBill' ? renderChart() : null\n\n return (\n <>\n <TransactionDrillDown\n baseTransactions={baseTransactions}\n projectedRow={projectedRow}\n heading={headerContent?.heading}\n icon={headerContent?.icon}\n onSelectionChange={selectMonth}\n selectedIndex={selectedIndex}\n subHeadingText={headerContent?.subHeadingText}\n tabs={bars}\n top={chartTop}\n {...(sideTabs.length > 0 && {\n subTabs: { tabs: sideTabs, selectedIndex: subIndex, onChange: setSubIndex },\n })}\n {...(tipSection && {\n tipSection:\n !closeTipSection &&\n (tipSection(setCloseTipSection, insightsCopy, subHeader?.text, instanceSlotData) ??\n false),\n })}\n transactionFilter={transactionFilter}\n onEachRowClick={(guid) => {\n setActionContext({ transaction_guid: guid })\n setIsTransactionDetailsOpen(true)\n }}\n />\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isTransactionDetailsOpen}\n onClose={() => {\n setIsTransactionDetailsOpen(false)\n // Clear only the key this nested drawer owns — setActionContext merges, so an\n // explicit `{}` would be a no-op and leave transaction_guid stuck in the shared\n // context, and the outer drawer's own context (e.g. chartBarIndex) must survive.\n setActionContext({ transaction_guid: undefined })\n // Re-apply this block's own filter: a further-nested AddMerchantBudgetAction drawer may\n // have overwritten transactionStore.filter (merchant_guid-only) without restoring it.\n applyCurrentSelectionFilter()\n }}\n title={insightsCopy.general.transaction_details_title}\n >\n <TransactionDetailsBlock beat={beat} />\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoCA,IAAa,KAAA,CAAgC,MAAqB,EAAK,eAE1D,KAA0B,GAAA,CAAU,EAAE,MAAA,EAAA,MAAmC;AACpF,QAAM,IAAQ,GAAS,GAEjB,EAAE,cAAA,GA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B,EAAE,kBAAkB,EAAK,CAAC,GAC3C,EAA4B,EAAI;AAAA,IAClC;AAAA,EACD,CAAA,GACD,gBAAA,EAAC,IAAD;AAAA,IACE,gBAAgB,GAAW;AAAA,IAC3B,QAAQ;AAAA,IACR,SAAA,MAAe;AACb,MAAA,EAA4B,EAAK,GAIjC,EAAiB,EAAE,kBAAkB,OAAU,CAAC,GAGhD,EAA4B;AAAA,IAC9B;AAAA,IACA,OAAO,EAAa,QAAQ;AAAA,IAE5B,UAAA,gBAAA,EAAC,IAAD,EAA+B,MAAA,EAAO,CAAA;AAAA,EAChC,CAAA,CACR,EAAA,CAAA;AAEN,CAAC"}
|
|
1
|
+
{"version":3,"file":"TransactionHistoryBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.tsx"],"sourcesContent":["import { useLayoutEffect, useState } from 'react'\n\nimport { useTheme } from '@mui/material/styles'\nimport { observer } from 'mobx-react-lite'\n\nimport type { Beat, DataSeries, GlobalCopy, Transaction } from '../../../core'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { ANALYTICS_EVENTS_CONFIG, useAnalyticsEvent } from '../../analytics'\nimport { BarChartV2 } from '../../components/chartblocks/BarchartV2'\nimport { DoubleBarChart } from '../../components/chartblocks/DoubleBarChart'\nimport { EmptyBarChart } from '../../components/chartblocks/EmptyBarChart'\nimport { BAR_ARIA_LABEL } from '../../blocks/ChartBlocks/BarchartBlock/utils'\nimport {\n COMPARISON_BAR_ARIA_LABEL,\n toLegendItems,\n} from '../../blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils'\n\nimport { TransactionDrillDown } from './TransactionDrillDown'\nimport { useTransactionHistory } from './useTransactionHistory'\nimport {\n getDefaultSelection,\n getDrillDownConfig,\n getFlattenedDataSeries,\n resolveDrillDownSubHeader,\n toStoreFilter,\n} from './utils'\nimport { Drawer, useInsightsV2Store, useGlobalCopyStore } from '../../../common'\nimport { TransactionDetailsBlock } from '../TransactionDetailsBlock'\nimport { useOpenedCta } from '../useOpenedCta'\nimport { useRequiredCopy } from '../useRequiredCopy'\n\ninterface TransactionHistoryProp {\n beat: Beat\n}\n\nexport const selectTransactionHistoryCopy = (copy: GlobalCopy) => copy.insights_feed\n\nexport const TransactionHistoryBlock = observer(({ beat }: TransactionHistoryProp) => {\n const theme = useTheme()\n\n const { actionDrawer, setActionContext } = useInsightsV2Store()\n\n const { insights_payload } = beat\n\n // The CTA that opened the drawer: its variant picks the view, and its drilldown_data feeds a\n // variant that reads its facts from the opener (Monthly Debt to Income). Only drilldown_data is passed\n // on: it is the payload's own object, stable across renders, while the opener may be rebuilt per render.\n const openedCta = useOpenedCta(beat)\n const dynamicCtaVariant = openedCta?.variant\n\n const {\n top,\n filterMode,\n header,\n colors,\n filterStrategy,\n tipSection,\n subTabAriaLabels,\n slotData,\n averageFormat,\n subTabs,\n boldLabel,\n } = getDrillDownConfig(dynamicCtaVariant ?? '')\n\n const {\n instanceSlotData,\n beatTransactions,\n spendCategoryGuids,\n allAccountGuids,\n categoryName,\n displayedDateRange,\n transactionStore,\n } = useTransactionHistory(beat, { slotData }, openedCta?.drilldown_data)\n\n const { common: commonCopy } = useGlobalCopyStore()\n const insightsCopy = useRequiredCopy(selectTransactionHistoryCopy)\n\n const [isTransactionDetailsOpen, setIsTransactionDetailsOpen] = useState(false)\n\n const [closeTipSection, setCloseTipSection] = useState(false)\n\n const fireAnalyticsEvent = useAnalyticsEvent()\n\n const { dataSeries, chartData, comparisonBars } = getFlattenedDataSeries({\n data: instanceSlotData?.data_series as DataSeries,\n ariaLabel:\n top === 'doubleBar'\n ? (insightsCopy?.general?.in_month_you_had_a_category_of_amount ??\n COMPARISON_BAR_ARIA_LABEL)\n : BAR_ARIA_LABEL,\n top,\n beatTransactions,\n })\n\n const isDoubleBar = top === 'doubleBar'\n const isTabsOnly = top === 'tabsOnly'\n // The drawer's columns (and tabs): the double bar's month pairs, or the single bar's bars.\n const bars = isDoubleBar ? comparisonBars : chartData\n\n const { chartBarIndex, subTabIndex } = getDefaultSelection({\n chartTabCount: chartData.length,\n comparisonTabCount: comparisonBars.length,\n actionDrawer,\n beatGuid: beat.guid,\n })\n\n const [selectedIndex, setSelectedIndex] = useState(chartBarIndex)\n // The double-bar drawer's series tab (0 = main, e.g. Spend; 1 = comparison, e.g. Income).\n const [subIndex, setSubIndex] = useState(subTabIndex)\n\n // Bars built from the transaction store (Upcoming Bill's paid bills) can arrive after the drawer\n // opens: re-select the default when the bar count changes. Payload-built bars never change count.\n const [defaultedTabCount, setDefaultedTabCount] = useState(bars.length)\n if (bars.length !== defaultedTabCount) {\n setDefaultedTabCount(bars.length)\n setSelectedIndex(chartBarIndex)\n }\n\n const resolveFilter = (index: number) =>\n filterStrategy({\n beat,\n beatTransactions,\n dataSeries,\n comparisonBars,\n selectedIndex: index,\n subIndex,\n isLastTab: index === bars.length - 1,\n instanceSlotData,\n spendCategoryGuids,\n displayedDateRange,\n })\n\n // Content keys for the effect deps: these arrays get a new identity every render (MEW-3732).\n const beatTransactionGuidsKey = beatTransactions.map((transaction) => transaction.guid).join(',')\n const spendCategoryGuidsKey = spendCategoryGuids.join(',')\n const allAccountGuidsKey = allAccountGuids.join(',')\n\n // Re-applied on selection change and when the nested details drawer closes: AddMerchantBudgetAction\n // overwrites transactionStore.filter and never restores it. Chartless tops filter with no bars.\n const canApplyFilter =\n top === 'list' || top === 'tabsOnly' || top === 'monthTabs' || dataSeries.length > 0\n const applyCurrentSelectionFilter = () => {\n if (filterMode !== 'store') return\n // A chart drawer with no bars can name no rows: fail closed rather than keep the store's default\n // (every account) or a previous drawer's filter.\n const filter = canApplyFilter\n ? resolveFilter(selectedIndex)\n : { accounts: [], custom: () => false }\n transactionStore.setFilter(toStoreFilter(filter, { allAccountGuids, displayedDateRange }))\n }\n\n // store variants route the selection through the shared store filter; local (upcomingBill) variants\n // filter beatTransactions directly, so there's nothing to push to the store for them.\n useLayoutEffect(() => {\n applyCurrentSelectionFilter()\n }, [\n beat.guid,\n selectedIndex,\n subIndex,\n filterMode,\n dataSeries.length,\n instanceSlotData,\n displayedDateRange,\n spendCategoryGuidsKey,\n allAccountGuidsKey,\n beatTransactionGuidsKey,\n top,\n ])\n\n const subHeader = resolveDrillDownSubHeader(insights_payload)\n\n const headerContent = header?.({\n title: insights_payload?.title,\n subHeader,\n categoryName,\n selectedDate: chartData[selectedIndex]?.date ?? undefined,\n slotData: instanceSlotData,\n })\n\n const barColors = colors(theme, instanceSlotData?.category_guid)\n\n // `legends` is the block's additional_data ([0] main, [1] second series), as BarchartBlock reads it.\n const [mainLegend, comparisonLegend] = instanceSlotData?.legends ?? []\n\n const transactionFilter =\n filterMode === 'local'\n ? (index: number) => resolveFilter(index).custom ?? (() => true)\n : undefined\n\n const baseTransactions: Transaction[] | undefined =\n filterMode === 'local' ? beatTransactions : undefined\n\n // A chart bar click selects its column (and, on the double bar, its series); a month tab change\n // selects the month. MUI Tabs only fires onChange on real user selection, not on mount. The\n // series (Spend / Income) tab fires its own analytics via the shared SubTabs component.\n const selectBar = (index: number, seriesIndex?: number) => {\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.DRAWER_CHART_BAR_CLICKED)\n setSelectedIndex(index)\n if (seriesIndex !== undefined) setSubIndex(seriesIndex)\n }\n const selectMonth = (index: number) => {\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.TAB_SELECTED)\n setSelectedIndex(index)\n }\n\n // Double bar: the Spend / Income labels come from copy (additional_data); the legend carries the\n // selected month's two totals, and its labels name the series tabs.\n const doubleBarLegends = isDoubleBar\n ? toLegendItems([\n { ...mainLegend, value: comparisonBars[selectedIndex]?.main },\n { ...comparisonLegend, value: comparisonBars[selectedIndex]?.comparison },\n ])\n : undefined\n\n // Legacy pulse named these tabs \"Spend transactions\" / \"Income transactions\" for screen readers.\n const seriesAriaLabels = subTabAriaLabels?.(insightsCopy) ?? []\n\n // The second tab row: the double bar's series, a tabs-only drawer's sides, or the variant's `subTabs`.\n const sideTabs = isDoubleBar\n ? (doubleBarLegends ?? []).map((legend, index) => ({\n label: legend.label,\n ariaLabel: seriesAriaLabels[index],\n }))\n : isTabsOnly\n ? dataSeries.flatMap((row) => (row.localized_label ? [{ label: row.localized_label }] : []))\n : (subTabs?.({ instanceSlotData, copy: insightsCopy }).map((label) => ({ label })) ?? [])\n\n const renderChart = () => {\n if (!bars.length) return <EmptyBarChart />\n\n return isDoubleBar ? (\n <DoubleBarChart\n bars={comparisonBars}\n boldLabel={boldLabel}\n colors={barColors}\n legendPosition=\"top\"\n legends={doubleBarLegends}\n onBarClick={selectBar}\n selectedIndex={selectedIndex}\n />\n ) : (\n <BarChartV2\n amounts={{\n average: instanceSlotData?.average_amount,\n formattedAverage: formatCurrency(\n instanceSlotData?.average_amount ?? 0,\n averageFormat ?? CURRENCY_FORMAT.cents,\n ),\n }}\n color={barColors[0] ?? theme.palette.primary.main}\n data={chartData}\n legendPosition=\"top\"\n // Figma's chart drawer: 172px of bars under the 24px legend, 200px in all.\n heightOverride={172}\n margin={{\n bottom: 8,\n top: 24,\n left: 24,\n right: 24,\n }}\n // TODO: Temporary fallback while the backend doesn't always send `legends` on every\n // beat/variant. Remove this once the backend guarantees `legends` on the payload.\n monthlyAmountLabel={mainLegend?.label ?? insightsCopy.general.monthly_amount}\n onBarClick={selectBar}\n selectedTabIndex={selectedIndex}\n trendAmountLabel={comparisonLegend?.label ?? insightsCopy.general.trend}\n />\n )\n }\n\n // `list` (Low Account Balance), `tabsOnly` (Non-Essential Category Summary) and `monthTabs`\n // (Monthly Subscription Aggregate) drawers have no chart above their transaction list.\n const chartTop =\n isDoubleBar || top === 'singleBar' || top === 'upcomingBill' ? renderChart() : null\n\n return (\n <>\n <TransactionDrillDown\n baseTransactions={baseTransactions}\n heading={headerContent?.heading}\n icon={headerContent?.icon}\n onSelectionChange={selectMonth}\n selectedIndex={selectedIndex}\n subHeadingText={headerContent?.subHeadingText}\n tabs={bars}\n top={chartTop}\n {...(sideTabs.length > 0 && {\n subTabs: { tabs: sideTabs, selectedIndex: subIndex, onChange: setSubIndex },\n })}\n {...(tipSection && {\n tipSection:\n !closeTipSection &&\n (tipSection(setCloseTipSection, insightsCopy, subHeader?.text, instanceSlotData) ??\n false),\n })}\n transactionFilter={transactionFilter}\n onEachRowClick={(guid) => {\n setActionContext({ transaction_guid: guid })\n setIsTransactionDetailsOpen(true)\n }}\n />\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isTransactionDetailsOpen}\n onClose={() => {\n setIsTransactionDetailsOpen(false)\n // Clear only the key this nested drawer owns — setActionContext merges, so an\n // explicit `{}` would be a no-op and leave transaction_guid stuck in the shared\n // context, and the outer drawer's own context (e.g. chartBarIndex) must survive.\n setActionContext({ transaction_guid: undefined })\n // Re-apply this block's own filter: a further-nested AddMerchantBudgetAction drawer may\n // have overwritten transactionStore.filter (merchant_guid-only) without restoring it.\n applyCurrentSelectionFilter()\n }}\n title={insightsCopy.general.transaction_details_title}\n >\n <TransactionDetailsBlock beat={beat} />\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmCA,IAAa,KAAA,CAAgC,MAAqB,EAAK,eAE1D,KAA0B,GAAA,CAAU,EAAE,MAAA,EAAA,MAAmC;AACpF,QAAM,IAAQ,GAAS,GAEjB,EAAE,cAAA,GAAc,kBAAA,EAAA,IAAqB,GAAmB,GAExD,EAAE,kBAAA,EAAA,IAAqB,GAKvB,IAAY,GAAa,CAAI,GAC7B,IAAoB,GAAW,SAE/B,EACJ,KAAA,GACA,YAAA,GACA,QAAA,GACA,QAAA,GACA,gBAAA,GACA,YAAA,GACA,kBAAA,GACA,UAAA,GACA,eAAA,GACA,SAAA,GACA,WAAA,EAAA,IACE,GAAmB,KAAqB,EAAE,GAExC,EACJ,kBAAA,GACA,kBAAA,GACA,oBAAA,GACA,iBAAA,GACA,cAAA,GACA,oBAAA,GACA,kBAAA,EAAA,IACE,GAAsB,GAAM,EAAE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ACnE,CAAA,IAtCsB,gBAAA,EAAC,IAAD,CAAgB,CAAA,IA6CsC;AAEjF,SACE,gBAAA,GAAA,IAAA,EAAA,UAAA,CACE,gBAAA,EAAC,IAAD;AAAA,IACoB,kBAAA;AAAA,IAClB,SAAS,GAAe;AAAA,IACxB,MAAM,GAAe;AAAA,IACrB,mBAAmB;AAAA,IACJ,eAAA;AAAA,IACf,gBAAgB,GAAe;AAAA,IAC/B,MAAM;AAAA,IACN,KAAK;AAAA,IACL,GAAK,EAAS,SAAS,KAAK,EAC1B,SAAS;AAAA,MAAE,MAAM;AAAA,MAAU,eAAe;AAAA,MAAU,UAAU;AAAA,IAAY,EAC5E;AAAA,IACA,GAAK,KAAc,EACjB,YACE,CAAC,OACA,EAAW,IAAoB,GAAc,GAAW,MAAM,CAAgB,KAC7E,IACN;AAAA,IACmB,mBAAA;AAAA,IACnB,gBAAA,CAAiB,MAAS;AACxB,MAAA,EAAiB,EAAE,kBAAkB,EAAK,CAAC,GAC3C,EAA4B,EAAI;AAAA,IAClC;AAAA,EACD,CAAA,GACD,gBAAA,EAAC,IAAD;AAAA,IACE,gBAAgB,EAAW;AAAA,IAC3B,QAAQ;AAAA,IACR,SAAA,MAAe;AACb,MAAA,EAA4B,EAAK,GAIjC,EAAiB,EAAE,kBAAkB,OAAU,CAAC,GAGhD,EAA4B;AAAA,IAC9B;AAAA,IACA,OAAO,EAAa,QAAQ;AAAA,IAE5B,UAAA,gBAAA,EAAC,IAAD,EAA+B,MAAA,EAAO,CAAA;AAAA,EAChC,CAAA,CACR,EAAA,CAAA;AAEN,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { DataSet } from '../../../core/types/InsightsInstanceSlotData';
|
|
|
6
6
|
import { CurrencyFormat } from '../../../core/utils/NumberFormatting';
|
|
7
7
|
import { ChartDataSeriesItem } from '../../blocks/ChartBlocks/BarchartBlock/utils';
|
|
8
8
|
import { TipSectionProps } from '../../../insights/components/shared/ChartDrawerTemplate/TipSection';
|
|
9
|
-
import {
|
|
9
|
+
import { DrillDownSlotData, SlotDataResolver } from './utils';
|
|
10
10
|
export interface DrillDownHeader {
|
|
11
11
|
heading?: string;
|
|
12
12
|
subHeadingText?: string;
|
|
@@ -71,7 +71,6 @@ export interface DrillDownVariantConfig {
|
|
|
71
71
|
header?: HeaderKind;
|
|
72
72
|
subTabs?: SubTabsKind;
|
|
73
73
|
slotData?: SlotDataResolver;
|
|
74
|
-
beatTransactions?: BeatTransactionsResolver;
|
|
75
74
|
fetchMissingTransactions?: (beat: Beat, ctaDrilldownData?: DrilldownData) => unknown;
|
|
76
75
|
tipSection?: (setCloseTipSection: (flag: boolean) => void, copy: InsightsFeedCopy, merchantName?: string, slotData?: DrillDownSlotData) => TipSectionProps | undefined;
|
|
77
76
|
scope: 'store' | 'beat';
|
|
@@ -85,6 +84,5 @@ export declare const resolveSavingsContributionsSlotData: SlotDataResolver;
|
|
|
85
84
|
export declare const resolveMerchantBudgetSlotData: SlotDataResolver;
|
|
86
85
|
export declare const resolveDepositSummarySlotData: SlotDataResolver;
|
|
87
86
|
export declare const resolveDebtToIncomeSlotData: SlotDataResolver;
|
|
88
|
-
export declare const resolveUpcomingBillTransactions: BeatTransactionsResolver;
|
|
89
87
|
export declare const layout: Partial<Record<DrillDownVariant, DrillDownVariantConfig>>;
|
|
90
88
|
export declare const FALLBACK: DrillDownVariantConfig;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { buildDynamicCopy as
|
|
1
|
+
import { buildDynamicCopy as h } from "../../../core/utils/Localization.es.js";
|
|
2
2
|
import { DATE_FORMATS_INTL as N, formatDate as O } from "../../../core/constants/DateFormats.es.js";
|
|
3
3
|
import { TransactionStatus as H } from "../../../core/types/Transaction.es.js";
|
|
4
4
|
import { fromUnixUTC as L } from "../../../core/utils/DateUtil.es.js";
|
|
5
5
|
import { CURRENCY_FORMAT as Y } from "../../../core/utils/NumberFormatting.es.js";
|
|
6
6
|
import { getCategoryColor as F } from "../../../core/utils/CategoryUtil.es.js";
|
|
7
7
|
import { buildDataSeries as R } from "../../blocks/ChartBlocks/BarchartBlock/utils.es.js";
|
|
8
|
-
import { asGuidList as A, asNonEmptyText as l, asNumber as
|
|
8
|
+
import { asGuidList as A, asNonEmptyText as l, asNumber as b } from "../../blocks/slotReaders.es.js";
|
|
9
9
|
import { getLayoutConfig as y } from "../../blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js";
|
|
10
10
|
import k from "../../components/LogoMark.es.js";
|
|
11
|
-
import {
|
|
11
|
+
import { calendarDateOf as V, toDrillDownSlotData as x } from "./utils.es.js";
|
|
12
12
|
import { Icon as B } from "@mxenabled/mx-icons";
|
|
13
13
|
import { jsx as c } from "react/jsx-runtime";
|
|
14
|
-
import { endOfMonth as M, fromUnixTime as
|
|
14
|
+
import { endOfMonth as M, fromUnixTime as W, isValid as E, parseISO as m, startOfMonth as I } from "date-fns";
|
|
15
15
|
var n = {
|
|
16
16
|
TRANSACTION: "not_standard_amount",
|
|
17
17
|
CATEGORY_SPEND: "category_spend",
|
|
@@ -27,10 +27,10 @@ var n = {
|
|
|
27
27
|
LOW_BALANCE: "low_balance",
|
|
28
28
|
SUBSCRIPTION_AGGREGATE: "monthly_subscription_aggregate",
|
|
29
29
|
MERCHANT_BUDGET: "merchant_budget"
|
|
30
|
-
}, g = (t, e) => e && F(e, t) || t.palette.primary.main,
|
|
31
|
-
start: I(
|
|
32
|
-
end: M(
|
|
33
|
-
}), U = (t) => t?.length ? { accounts: t } : {},
|
|
30
|
+
}, g = (t, e) => e && F(e, t) || t.palette.primary.main, f = (t) => typeof t == "string" ? m(t) : new Date(t ?? NaN), T = (t) => ({
|
|
31
|
+
start: I(f(t)),
|
|
32
|
+
end: M(f(t))
|
|
33
|
+
}), U = (t) => t?.length ? { accounts: t } : {}, z = ({ beat: t }) => {
|
|
34
34
|
const { account_guid: e, from_date: a, to_date: r } = t.insights_payload?.drilldown_data ?? {};
|
|
35
35
|
return typeof e != "string" || typeof a != "number" || typeof r != "number" || !Number.isFinite(a) || !Number.isFinite(r) || r <= a ? {
|
|
36
36
|
accounts: [],
|
|
@@ -44,80 +44,73 @@ var n = {
|
|
|
44
44
|
end: L(r - 1)
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
},
|
|
47
|
+
}, j = (t) => {
|
|
48
48
|
const e = t?.drilldown_data ?? {};
|
|
49
49
|
return {
|
|
50
50
|
transaction_guids: A(e.transaction_guids),
|
|
51
|
-
date:
|
|
52
|
-
amount: m(e.amount),
|
|
51
|
+
date: V(e.due_date),
|
|
53
52
|
category_guid: l(e.category_guid),
|
|
54
|
-
average_amount:
|
|
53
|
+
average_amount: b(e.average_amount),
|
|
55
54
|
merchant_name: l(e.merchant_name)
|
|
56
55
|
};
|
|
57
56
|
}, _ = (t) => {
|
|
58
57
|
const e = t;
|
|
59
58
|
return Array.isArray(e?.names) && Array.isArray(e?.data) ? e : void 0;
|
|
60
|
-
},
|
|
59
|
+
}, K = (t) => {
|
|
61
60
|
const e = t?.drilldown_data ?? {};
|
|
62
61
|
return {
|
|
63
62
|
account_guids: A(e.account_guids),
|
|
64
63
|
data_series: _(e.data_series),
|
|
65
|
-
average_amount:
|
|
64
|
+
average_amount: b(e.average_amount)
|
|
66
65
|
};
|
|
67
|
-
},
|
|
66
|
+
}, q = (t) => {
|
|
68
67
|
const e = t?.drilldown_data ?? {}, a = t?.instance_slot?.data, r = t?.instance_slot_data;
|
|
69
68
|
return {
|
|
70
69
|
data_series: _(e.data_series),
|
|
71
|
-
average_amount:
|
|
70
|
+
average_amount: b(e.average_amount),
|
|
72
71
|
merchant_guid: l(a?.merchant_guid) ?? l(r?.merchant_guid),
|
|
73
72
|
merchant_name: l(a?.merchant_name) ?? l(r?.merchant_name)
|
|
74
73
|
};
|
|
75
|
-
}, w = ["income", "other"],
|
|
74
|
+
}, w = ["income", "other"], J = (t) => {
|
|
76
75
|
const e = t?.drilldown_data ?? {}, a = t?.instance_slot?.data?.legends?.map(({ label: r }) => r);
|
|
77
76
|
return {
|
|
78
77
|
data_series: _(e.data_series),
|
|
79
|
-
average_amount:
|
|
78
|
+
average_amount: b(e.average_amount),
|
|
80
79
|
income_transaction_guids: A(e.income_transaction_guids),
|
|
81
80
|
sub_tab_labels: a?.length === w.length ? a : void 0
|
|
82
81
|
};
|
|
83
|
-
},
|
|
82
|
+
}, Q = 2, P = (t, e) => {
|
|
84
83
|
const a = e ?? {}, r = _(a.series), o = Array.isArray(a.labels) ? a.labels.map(l) : [];
|
|
85
|
-
return !r || o.length !==
|
|
84
|
+
return !r || o.length !== Q || !o.every((s) => !!s) ? {} : {
|
|
86
85
|
data_series: r,
|
|
87
86
|
legends: o.map((s) => ({
|
|
88
87
|
label: s,
|
|
89
88
|
value: 0
|
|
90
89
|
}))
|
|
91
90
|
};
|
|
92
|
-
}, G = (t, e) => R(_(e?.series)).flatMap((a) => a.aggregated_guids ?? []),
|
|
91
|
+
}, G = (t, e) => R(_(e?.series)).flatMap((a) => a.aggregated_guids ?? []), X = (t, e) => {
|
|
93
92
|
const a = e.transaction_history_block?.monthly_debt_to_income_tip_message, r = e.transaction_history_block?.monthly_debt_to_income_tip_limit;
|
|
94
93
|
if (!(!a || !r))
|
|
95
94
|
return {
|
|
96
|
-
message:
|
|
95
|
+
message: h(a, /* @__PURE__ */ c("strong", { children: e.general.tip_section_title }), /* @__PURE__ */ c("strong", { children: r })),
|
|
97
96
|
onDismiss: () => t(!0)
|
|
98
97
|
};
|
|
99
|
-
},
|
|
98
|
+
}, Z = (t, e) => {
|
|
100
99
|
const a = P(t, e);
|
|
101
|
-
return a.data_series ? a :
|
|
102
|
-
},
|
|
100
|
+
return a.data_series ? a : x(t?.instance_slot?.data ?? {});
|
|
101
|
+
}, $ = (t, e) => {
|
|
103
102
|
const a = e.transaction_history_block?.savings_to_income_tip_message, r = e.transaction_history_block?.savings_to_income_tip_percentage;
|
|
104
103
|
if (!(!a || !r))
|
|
105
104
|
return {
|
|
106
|
-
message:
|
|
105
|
+
message: h(a, /* @__PURE__ */ c("strong", { children: e.general.tip_section_title }), /* @__PURE__ */ c("strong", { children: r })),
|
|
107
106
|
onDismiss: () => t(!0)
|
|
108
107
|
};
|
|
109
|
-
},
|
|
110
|
-
const a = V(t, e);
|
|
111
|
-
return a ? [...t, a] : t;
|
|
112
|
-
}, rt = (t, e, a, r) => {
|
|
108
|
+
}, tt = (t) => R(_(t.insights_payload?.drilldown_data?.data_series)).flatMap((e) => e.aggregated_guids ?? []), et = (t, e, a, r) => {
|
|
113
109
|
const o = r?.merchant_name, s = r?.date;
|
|
114
110
|
if (!o || !s) return;
|
|
115
111
|
const i = e.transaction_history_block?.upcoming_bill_tip_message;
|
|
116
112
|
if (i)
|
|
117
|
-
return {
|
|
118
|
-
message: b(i, /* @__PURE__ */ c("strong", { children: e.general.tip_section_title }), o, O(u(s), N.FULL_MONTH_DAY)),
|
|
119
|
-
onDismiss: () => t(!0)
|
|
120
|
-
};
|
|
113
|
+
return { message: h(i, /* @__PURE__ */ c("strong", { children: e.general.tip_section_title }), o, O(m(s), N.FULL_MONTH_DAY)) };
|
|
121
114
|
}, D = ({ beatTransactions: t, dataSeries: e, selectedIndex: a }) => {
|
|
122
115
|
const r = e[a], o = r?.guid, s = t.find((i) => i.guid === o)?.has_been_split;
|
|
123
116
|
return {
|
|
@@ -125,21 +118,21 @@ var n = {
|
|
|
125
118
|
dateRange: T(r?.date),
|
|
126
119
|
showSplits: !s
|
|
127
120
|
};
|
|
128
|
-
},
|
|
121
|
+
}, at = ({ dataSeries: t, selectedIndex: e, instanceSlotData: a }) => {
|
|
129
122
|
const r = t[e], o = a.category_guid ?? r?.guid;
|
|
130
123
|
return {
|
|
131
124
|
custom: (s) => s.category_guid === o || s.top_level_category_guid === o,
|
|
132
125
|
dateRange: T(r?.date)
|
|
133
126
|
};
|
|
134
|
-
},
|
|
127
|
+
}, rt = ({ dataSeries: t, selectedIndex: e, spendCategoryGuids: a, instanceSlotData: r }) => {
|
|
135
128
|
const o = t[e];
|
|
136
129
|
return {
|
|
137
130
|
custom: (s) => !!s.top_level_category_guid && a.includes(s.top_level_category_guid),
|
|
138
131
|
dateRange: T(o?.date),
|
|
139
132
|
...U(r.account_guids)
|
|
140
133
|
};
|
|
141
|
-
},
|
|
142
|
-
const r = a.merchant_guid, o =
|
|
134
|
+
}, ot = ({ dataSeries: t, selectedIndex: e, instanceSlotData: a }) => {
|
|
135
|
+
const r = a.merchant_guid, o = m(t[e]?.date ?? "");
|
|
143
136
|
return !r || !E(o) ? {
|
|
144
137
|
accounts: [],
|
|
145
138
|
custom: () => !1
|
|
@@ -150,21 +143,21 @@ var n = {
|
|
|
150
143
|
end: M(o)
|
|
151
144
|
}
|
|
152
145
|
};
|
|
153
|
-
},
|
|
154
|
-
const s = e[a], { start: i, end:
|
|
146
|
+
}, st = (t) => typeof t == "number" ? W(t) : m(t ?? ""), nt = ({ beat: t, dataSeries: e, selectedIndex: a, isLastTab: r, instanceSlotData: o }) => {
|
|
147
|
+
const s = e[a], { start: i, end: u } = T(s?.date), d = st(t.created_at), p = o.account_guids, C = {
|
|
155
148
|
start: i,
|
|
156
|
-
end: r && E(d) && d <
|
|
149
|
+
end: r && E(d) && d < u ? d : u
|
|
157
150
|
};
|
|
158
|
-
return
|
|
151
|
+
return p?.length ? {
|
|
159
152
|
dateRange: C,
|
|
160
|
-
accounts:
|
|
153
|
+
accounts: p
|
|
161
154
|
} : {
|
|
162
155
|
dateRange: C,
|
|
163
156
|
accounts: [],
|
|
164
157
|
custom: () => !1
|
|
165
158
|
};
|
|
166
159
|
}, v = (t, e, a) => {
|
|
167
|
-
const r = new Set(t), o =
|
|
160
|
+
const r = new Set(t), o = m(e ?? "");
|
|
168
161
|
return !r.size || !E(o) ? {
|
|
169
162
|
accounts: [],
|
|
170
163
|
custom: () => !1
|
|
@@ -176,13 +169,13 @@ var n = {
|
|
|
176
169
|
},
|
|
177
170
|
...U(a)
|
|
178
171
|
};
|
|
179
|
-
},
|
|
172
|
+
}, it = ({ beat: t, dataSeries: e, selectedIndex: a }) => v(e[a]?.aggregated_guids, e[a]?.date, t.account_guids), S = ({ beat: t, comparisonBars: e, selectedIndex: a, subIndex: r }) => {
|
|
180
173
|
const o = e[a];
|
|
181
174
|
return v(r === 1 ? o?.comparisonGuids : o?.mainGuids, o?.date, t.account_guids);
|
|
182
|
-
},
|
|
183
|
-
const { dataSeries: e, selectedIndex: a, subIndex: r, instanceSlotData: o } = t, s = e[a], i = new Set(o.income_transaction_guids),
|
|
175
|
+
}, ct = ({ beat: t, dataSeries: e, subIndex: a }) => v(e[a]?.aggregated_guids, e[a]?.date, t.account_guids), lt = (t) => {
|
|
176
|
+
const { dataSeries: e, selectedIndex: a, subIndex: r, instanceSlotData: o } = t, s = e[a], i = new Set(o.income_transaction_guids), u = w[r] === "income", d = o.sub_tab_labels ? s?.aggregated_guids?.filter((p) => i.has(p) === u) : s?.aggregated_guids;
|
|
184
177
|
return v(d, s?.date);
|
|
185
|
-
},
|
|
178
|
+
}, Ot = {
|
|
186
179
|
[n.TRANSACTION]: {
|
|
187
180
|
top: "singleBar",
|
|
188
181
|
scope: "store",
|
|
@@ -204,20 +197,20 @@ var n = {
|
|
|
204
197
|
};
|
|
205
198
|
},
|
|
206
199
|
tipSection: (t, e, a = "") => ({
|
|
207
|
-
message:
|
|
200
|
+
message: h(e.general.tip_section_message, /* @__PURE__ */ c("strong", { children: e.general.tip_section_title }), /* @__PURE__ */ c("strong", { children: a })),
|
|
208
201
|
onDismiss: () => t(!0)
|
|
209
202
|
})
|
|
210
203
|
},
|
|
211
204
|
[n.CATEGORY_SPEND]: {
|
|
212
205
|
top: "singleBar",
|
|
213
206
|
averageFormat: Y.whole,
|
|
214
|
-
filterStrategy:
|
|
207
|
+
filterStrategy: at,
|
|
215
208
|
scope: "store",
|
|
216
209
|
filterMode: "store",
|
|
217
210
|
colors: (t, e) => [g(t, e)],
|
|
218
211
|
header: (t) => ({
|
|
219
212
|
heading: t.categoryName,
|
|
220
|
-
subHeadingText: t.selectedDate && O(
|
|
213
|
+
subHeadingText: t.selectedDate && O(f(t.selectedDate), N.MONTH_LONG) || "",
|
|
221
214
|
icon: /* @__PURE__ */ c(B, {
|
|
222
215
|
color: "primary",
|
|
223
216
|
name: "calendar_month",
|
|
@@ -227,15 +220,15 @@ var n = {
|
|
|
227
220
|
},
|
|
228
221
|
[n.MONTHLY_SPEND]: {
|
|
229
222
|
top: "singleBar",
|
|
230
|
-
filterStrategy:
|
|
223
|
+
filterStrategy: rt,
|
|
231
224
|
scope: "store",
|
|
232
225
|
filterMode: "store",
|
|
233
226
|
colors: (t) => [t.palette.chart.chart2 ?? t.palette.primary.main]
|
|
234
227
|
},
|
|
235
228
|
[n.ACCOUNT_BALANCE]: {
|
|
236
229
|
top: "singleBar",
|
|
237
|
-
filterStrategy:
|
|
238
|
-
slotData:
|
|
230
|
+
filterStrategy: nt,
|
|
231
|
+
slotData: K,
|
|
239
232
|
scope: "store",
|
|
240
233
|
filterMode: "store",
|
|
241
234
|
colors: (t) => [t.palette.success.main]
|
|
@@ -246,45 +239,44 @@ var n = {
|
|
|
246
239
|
scope: "beat",
|
|
247
240
|
filterMode: "local",
|
|
248
241
|
colors: (t, e) => [g(t, e)],
|
|
249
|
-
slotData:
|
|
250
|
-
beatTransactions: at,
|
|
242
|
+
slotData: j,
|
|
251
243
|
fetchMissingTransactions: (t) => t.insights_payload?.drilldown_data?.transaction_guids,
|
|
252
|
-
tipSection:
|
|
244
|
+
tipSection: et
|
|
253
245
|
},
|
|
254
246
|
[n.DEPOSIT_SUMMARY]: {
|
|
255
247
|
top: "singleBar",
|
|
256
|
-
filterStrategy:
|
|
248
|
+
filterStrategy: lt,
|
|
257
249
|
scope: "store",
|
|
258
250
|
filterMode: "store",
|
|
259
251
|
colors: (t) => [t.palette.success.main],
|
|
260
|
-
slotData:
|
|
261
|
-
fetchMissingTransactions:
|
|
252
|
+
slotData: J,
|
|
253
|
+
fetchMissingTransactions: tt,
|
|
262
254
|
subTabs: ({ instanceSlotData: t }) => t.sub_tab_labels ?? []
|
|
263
255
|
},
|
|
264
256
|
[n.LOW_BALANCE]: {
|
|
265
257
|
top: "list",
|
|
266
|
-
filterStrategy:
|
|
258
|
+
filterStrategy: z,
|
|
267
259
|
scope: "store",
|
|
268
260
|
filterMode: "store",
|
|
269
261
|
colors: (t) => [t.palette.primary.main]
|
|
270
262
|
},
|
|
271
263
|
[n.SUBSCRIPTION_AGGREGATE]: {
|
|
272
264
|
top: "monthTabs",
|
|
273
|
-
filterStrategy:
|
|
265
|
+
filterStrategy: it,
|
|
274
266
|
scope: "store",
|
|
275
267
|
filterMode: "store",
|
|
276
268
|
colors: (t) => [t.palette.primary.main]
|
|
277
269
|
},
|
|
278
270
|
[n.MERCHANT_BUDGET]: {
|
|
279
271
|
top: "singleBar",
|
|
280
|
-
filterStrategy:
|
|
281
|
-
slotData:
|
|
272
|
+
filterStrategy: ot,
|
|
273
|
+
slotData: q,
|
|
282
274
|
scope: "store",
|
|
283
275
|
filterMode: "store",
|
|
284
276
|
colors: (t) => [t.palette.chart.chart1 ?? t.palette.primary.main],
|
|
285
277
|
header: (t) => ({
|
|
286
278
|
heading: t.slotData?.merchant_name ?? t.title,
|
|
287
|
-
subHeadingText: t.selectedDate && O(
|
|
279
|
+
subHeadingText: t.selectedDate && O(f(t.selectedDate), N.MONTH_LONG) || "",
|
|
288
280
|
icon: /* @__PURE__ */ c(B, {
|
|
289
281
|
color: "primary",
|
|
290
282
|
name: "calendar_month",
|
|
@@ -294,7 +286,7 @@ var n = {
|
|
|
294
286
|
},
|
|
295
287
|
[n.SPEND_TO_INCOME]: {
|
|
296
288
|
top: "doubleBar",
|
|
297
|
-
filterStrategy:
|
|
289
|
+
filterStrategy: S,
|
|
298
290
|
scope: "store",
|
|
299
291
|
filterMode: "store",
|
|
300
292
|
colors: (t) => y(t, "spend_to_income")?.color ?? [],
|
|
@@ -303,7 +295,7 @@ var n = {
|
|
|
303
295
|
},
|
|
304
296
|
[n.COST_OF_LIVING]: {
|
|
305
297
|
top: "doubleBar",
|
|
306
|
-
filterStrategy:
|
|
298
|
+
filterStrategy: S,
|
|
307
299
|
scope: "store",
|
|
308
300
|
filterMode: "store",
|
|
309
301
|
colors: (t, e) => [g(t, e), t.palette.chart.chart4 ?? t.palette.primary.main],
|
|
@@ -311,7 +303,7 @@ var n = {
|
|
|
311
303
|
},
|
|
312
304
|
[n.DEBT_TO_INCOME]: {
|
|
313
305
|
top: "doubleBar",
|
|
314
|
-
filterStrategy:
|
|
306
|
+
filterStrategy: S,
|
|
315
307
|
scope: "store",
|
|
316
308
|
filterMode: "store",
|
|
317
309
|
colors: (t) => y(t, "debt_to_income")?.color ?? [],
|
|
@@ -319,28 +311,28 @@ var n = {
|
|
|
319
311
|
subTabAriaLabels: (t) => [void 0, t.general.income_transactions],
|
|
320
312
|
slotData: P,
|
|
321
313
|
fetchMissingTransactions: G,
|
|
322
|
-
tipSection:
|
|
314
|
+
tipSection: X
|
|
323
315
|
},
|
|
324
316
|
[n.SAVINGS_TO_INCOME]: {
|
|
325
317
|
top: "doubleBar",
|
|
326
|
-
filterStrategy:
|
|
318
|
+
filterStrategy: S,
|
|
327
319
|
scope: "store",
|
|
328
320
|
filterMode: "store",
|
|
329
321
|
colors: (t) => y(t, "savings_to_income")?.color ?? [],
|
|
330
322
|
boldLabel: !0,
|
|
331
323
|
subTabAriaLabels: (t) => [t.general.savings_transactions, t.general.income_transactions],
|
|
332
|
-
slotData:
|
|
324
|
+
slotData: Z,
|
|
333
325
|
fetchMissingTransactions: G,
|
|
334
|
-
tipSection:
|
|
326
|
+
tipSection: $
|
|
335
327
|
},
|
|
336
328
|
[n.NON_ESSENTIAL_CATEGORY]: {
|
|
337
329
|
top: "tabsOnly",
|
|
338
|
-
filterStrategy:
|
|
330
|
+
filterStrategy: ct,
|
|
339
331
|
scope: "store",
|
|
340
332
|
filterMode: "store",
|
|
341
333
|
colors: (t) => [t.palette.primary.main]
|
|
342
334
|
}
|
|
343
|
-
},
|
|
335
|
+
}, Dt = {
|
|
344
336
|
top: "singleBar",
|
|
345
337
|
filterStrategy: D,
|
|
346
338
|
scope: "store",
|
|
@@ -349,14 +341,13 @@ var n = {
|
|
|
349
341
|
};
|
|
350
342
|
export {
|
|
351
343
|
n as DRILLDOWN_VARIANTS,
|
|
352
|
-
|
|
353
|
-
|
|
344
|
+
Dt as FALLBACK,
|
|
345
|
+
Ot as layout,
|
|
354
346
|
P as resolveDebtToIncomeSlotData,
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
at as resolveUpcomingBillTransactions
|
|
347
|
+
J as resolveDepositSummarySlotData,
|
|
348
|
+
q as resolveMerchantBudgetSlotData,
|
|
349
|
+
K as resolveSavingsContributionsSlotData,
|
|
350
|
+
j as resolveUpcomingBillSlotData
|
|
360
351
|
};
|
|
361
352
|
|
|
362
353
|
//# sourceMappingURL=layout.es.js.map
|