@mx-cartographer/experiences 9.7.165 → 9.7.167

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/common/components/dialog/Dialog.es.js +26 -29
  3. package/dist/common/components/dialog/Dialog.es.js.map +1 -1
  4. package/dist/core/types/localization/InsightsFeedCopy.d.ts +0 -2
  5. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.es.js +1 -1
  6. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.es.js.map +1 -1
  7. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.d.ts +1 -5
  8. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +53 -58
  9. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
  10. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +92 -99
  11. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
  12. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +1 -3
  13. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +72 -81
  14. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
  15. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.d.ts +5 -6
  16. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.es.js +16 -16
  17. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.es.js.map +1 -1
  18. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +4 -32
  19. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js +59 -83
  20. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
  21. package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/layout.es.js +8 -7
  22. package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/layout.es.js.map +1 -1
  23. package/dist/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js +1 -1
  24. package/dist/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js.map +1 -1
  25. package/dist/insights-v2/components/celebrationGradients.d.ts +4 -3
  26. package/dist/insights-v2/components/celebrationGradients.es.js +14 -14
  27. package/dist/insights-v2/components/celebrationGradients.es.js.map +1 -1
  28. package/dist/insights-v2/mappings/blocks.es.js +0 -1
  29. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  30. package/dist/transactions/components/shared/transactiondetails/actions/CategoryAction.es.js +51 -49
  31. package/dist/transactions/components/shared/transactiondetails/actions/CategoryAction.es.js.map +1 -1
  32. package/dist/transactions/components/transactionwidget/actions/EditCategoryAction.es.js +25 -23
  33. package/dist/transactions/components/transactionwidget/actions/EditCategoryAction.es.js.map +1 -1
  34. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"blocks.es.js","names":[],"sources":["../../../src/insights-v2/mappings/blocks.ts"],"sourcesContent":["import {\n AccountBlock,\n AccountSwitchBlock,\n BarchartBlock,\n BudgetBlock,\n DebtsBlock,\n DetailedAccountBlock,\n DonutChartBlock,\n GasPurchaseBlock,\n GoalsBlock,\n MerchantBlock,\n DoubleBarChartBlock,\n DoubleProgressBarBlock,\n NoSpendDaysBlock,\n QuizBlock,\n RepeatingTransactionBlock,\n SaveExtraBlock,\n SavingsOpportunityBlock,\n SavingsSummaryBlock,\n SVGImageBlock,\n UpcomingSubscriptionBlock,\n WeeklySmallPurchasesBlock,\n WithdrawalBlock,\n TransactionBlock,\n} from '../blocks'\nimport StepChartBlock from '../blocks/ChartBlocks/StepChartBlock'\nimport ImageBlock from '../blocks/ImageBlocks/ImageBlock'\n\nimport type { Beat, GlobalCopy, InsightsPayload } from '../../core'\nimport { buildDynamicCopy } from '../../core/utils/Localization'\nimport { ContactSupportActionBlock } from '../actionBlocks/ContactSupportActionBlock'\nimport { FeedbackModalActionBlock } from '../actionBlocks/FeedbackModalActionBlock'\nimport { ConnectionDetailActionBlock } from '../actionBlocks/ConnectionDetailActionBlock'\nimport { ConnectWidgetActionBlock } from '../actionBlocks/ConnectWidgetActionBlock'\nimport { SurveyModalActionBlock } from '../actionBlocks/SurveyModalActionBlock'\nimport { SubscriptionStatusModalBlock } from '../actionBlocks/SubscriptionStatusModalBlock'\nimport { PlaceholderActionBlock } from '../actionBlocks/PlaceholderActionBlock'\nimport { MakeTransferActionBlockLayer } from '../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer'\nimport { getMakeTransferDrawerTitle } from '../actionBlocks/MakeTransferActionBlock/layout'\nimport {\n selectTransactionHistoryCopy,\n TransactionHistoryBlock,\n} from '../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock'\nimport { getDrawerHeaderTitle } from '../actionBlocks/TransactionHistoryBlock/utils'\nimport { useTransactionHistoryPrepare } from '../actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare'\nimport {\n TransactionDetailsBlock,\n useTransactionDetailsPrepare,\n} from '../actionBlocks/TransactionDetailsBlock'\nimport {\n RecurringTransactionBlock,\n useRecurringTransactionPrepare,\n} from '../actionBlocks/RecurringTransactionBlock'\nimport { TransactionListBlock } from '../actionBlocks/TransactionListBlock'\nimport { getTransactionListDrawerTitle } from '../actionBlocks/TransactionListBlock/layout'\nimport {\n RemainingCashBlock,\n selectRemainingCashCopy,\n useRemainingCashLoadState,\n} from '../actionBlocks/RemainingCashBlock'\nimport { AmountInputModalBlock } from '../actionBlocks/AmountInputModalBlock'\nimport {\n OverdraftBlock,\n selectOverdraftCopy,\n useOverdraftPrepare,\n} from '../actionBlocks/OverdraftBlock'\nimport {\n AccountListBlock,\n selectAccountListCopy,\n useAccountListPrepare,\n} from '../actionBlocks/AccountListBlock'\nimport {\n EmergencySavingsBlock,\n selectEmergencySavingsCopy,\n} from '../actionBlocks/EmergencySavingsBlock'\nimport {\n CreditUtilizationBlock,\n selectCreditUtilizationCopy,\n useCreditUtilizationPrepare,\n} from '../actionBlocks/CreditUtilizationBlock'\nimport {\n PayoffCalculatorBlock,\n selectPayoffCalculatorCopy,\n usePayoffCalculatorLoadState,\n usePayoffCalculatorPrepare,\n} from '../actionBlocks/PayoffCalculatorBlock'\nimport { BudgetDetailsBlock, selectBudgetDetailsCopy } from '../actionBlocks/BudgetDetailsBlock'\nimport { useBudgetDetailsPrepare } from '../actionBlocks/BudgetDetailsBlock/useBudgetDetailsPrepare'\nimport { resolveBudgetSubject } from '../actionBlocks/BudgetDetailsBlock/layout'\nimport { AccountDetailsBlock, useAccountDetailsPrepare } from '../actionBlocks/AccountDetailsBlock'\nimport { HelpBlock } from '../actionBlocks/HelpBlock'\nimport {\n PayoffStrategiesBlock,\n selectPayoffStrategiesCopy,\n usePayoffStrategiesPrepare,\n} from '../actionBlocks/PayoffStrategiesBlock'\nimport { QuizMerchantBlock } from '../actionBlocks/QuizMerchantBlock'\nimport { useAccountsLoadState } from '../actionBlocks/useAccountsLoadState'\n// Keys live in ./actionBlocksKey (imported directly by chart blocks/tests too) to avoid a\n// circular import between this module and the chart blocks — see that file for details.\nimport { actionBlocksKey } from './actionBlocksKey'\n\n// Drilldown indexes are not passed down: action blocks read them from\n// InsightsV2Store (useInsightsV2Store().actionDrawer).\nexport interface ActionBlockProps {\n beat: Beat\n}\n\nconst noop = (_: ActionBlockProps) => {}\n\n// Re-exported so existing `hasDrawerBlock` imports from this module keep working.\nexport { hasDrawerBlock } from './hasDrawerBlock'\n\nexport interface BlockLoadState {\n ready: boolean\n failed?: boolean\n retry?: () => void\n}\n\nexport interface ActionBlockEntry {\n Component: React.ComponentType<ActionBlockProps>\n usePrepare: (props: ActionBlockProps) => void // required; default to noop in each entry\n // The data the block waits for: a loader until `ready`, the error card while `failed`.\n useLoadState?: (props: ActionBlockProps) => BlockLoadState\n // Drawer title from the CTA's variant and copy; falls back to the CTA label when empty.\n title?: (variant: string | null | undefined, copy: GlobalCopy, beat?: Beat) => string\n // The copy section a drawer block needs; the layer shows BlockErrorMessage without it.\n copy?: (copy: GlobalCopy) => unknown\n // 'drawer' (default) or 'modal' (component renders its own dialog, no Drawer wrapper).\n presentation?: 'drawer' | 'modal'\n // The drawer header's close control: 'back' (default, arrow on the left) or 'close' (X on the right).\n headerAction?: 'back' | 'close'\n}\n\n// Registry of drawer drilldowns, keyed by the `block` name the backend sends Add\n// `usePrepare` when the block needs to load data before rendering.\n\n/**\n * Reads its imports on access, not at load: some blocks import this registry back through\n * `ActionBlockLayer`, so a value copied at load would still be `undefined`.\n */\nconst liveEntry = (resolve: () => ActionBlockEntry): ActionBlockEntry => ({\n get Component() {\n return resolve().Component\n },\n get usePrepare() {\n return resolve().usePrepare\n },\n get useLoadState() {\n return resolve().useLoadState\n },\n get title() {\n return resolve().title\n },\n get copy() {\n return resolve().copy\n },\n get presentation() {\n return resolve().presentation\n },\n get headerAction() {\n return resolve().headerAction\n },\n})\n\nexport const actionBlocks = {\n [actionBlocksKey.PLACEHOLDER_ACTION_BLOCK]: liveEntry(() => ({\n Component: PlaceholderActionBlock,\n usePrepare: noop,\n title: () => 'Action Block Layer Drilldown',\n })),\n [actionBlocksKey.MAKE_TRANSFER_ACTION_BLOCK]: liveEntry(() => ({\n Component: MakeTransferActionBlockLayer,\n headerAction: 'close',\n usePrepare: noop,\n title: getMakeTransferDrawerTitle,\n })),\n [actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionHistoryBlock,\n copy: selectTransactionHistoryCopy,\n usePrepare: useTransactionHistoryPrepare,\n title: getDrawerHeaderTitle,\n })),\n [actionBlocksKey.TRANSACTION_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionDetailsBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: () => 'Transaction Details',\n })),\n // Expense Details for one recurring subscription. Which subscription a beat names is resolved in\n // `RecurringTransactionBlock/subscriptionBeats.ts`, not through this registry.\n [actionBlocksKey.RECURRING_TRANSACTION_ACTION_BLOCK]: liveEntry(() => ({\n Component: RecurringTransactionBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.recurring?.expense_details ?? '',\n })),\n // Remaining Cash for the Payday Cash Left Over Status beat. Store-driven: reuses the recurring\n // loader, which also loads accounts and categories, so CashflowStore's computeds are ready.\n [actionBlocksKey.REMAINING_CASH_ACTION_BLOCK]: liveEntry(() => ({\n Component: RemainingCashBlock,\n copy: selectRemainingCashCopy,\n usePrepare: useRecurringTransactionPrepare,\n useLoadState: useRemainingCashLoadState,\n title: (_variant, copy) => selectRemainingCashCopy(copy)?.title ?? '',\n })),\n // The block renders its own drawer (the help module's RequestSupport) on top of the action\n // drawer, so the action drawer's title is the CTA label.\n [actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK]: liveEntry(() => ({\n Component: ContactSupportActionBlock,\n usePrepare: noop,\n title: (_variant, copy) => copy.help?.request_support ?? '',\n })),\n [actionBlocksKey.FEEDBACK_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: FeedbackModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.CONNECTION_DETAIL_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectionDetailActionBlock,\n usePrepare: noop,\n title: (_variant, copy) =>\n copy.insights_feed?.connection_details?.connection_details_drawer_title ?? '',\n })),\n // Boots MX's Connect widget (web-widget-sdk iframe) inside the action\n // drawer; the drawer title falls back to the CTA label.\n [actionBlocksKey.CONNECT_WIDGET_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectWidgetActionBlock,\n usePrepare: noop,\n })),\n [actionBlocksKey.SURVEY_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: SurveyModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n // Unexpected Subscription Payment's Subscription Status modal.\n [actionBlocksKey.SUBSCRIPTION_STATUS_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: SubscriptionStatusModalBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.TRANSACTION_LIST_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionListBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: getTransactionListDrawerTitle,\n })),\n // One whole-dollar setting in a dialog; the CTA variant picks which (low-balance threshold or\n // safety net). A modal: no drawer, so no drawer title.\n [actionBlocksKey.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: AmountInputModalBlock,\n presentation: 'modal',\n // Loads inside the block: it mounts only while open, so mounting is the open-time load.\n usePrepare: noop,\n })),\n // Savings Opportunity's safety net: `safety_net_block` opens the amount-input modal.\n [actionBlocksKey.SAFETY_NET_ACTION_BLOCK]: liveEntry(() => ({\n Component: AmountInputModalBlock,\n presentation: 'modal',\n usePrepare: noop,\n })),\n // Transparent Overdraft's \"Learn more\": the projected overdraft, its account and the confidence\n // meter. Titled from the beat, as the pulse drawer was.\n [actionBlocksKey.OVERDRAFT_ACTION_BLOCK]: liveEntry(() => ({\n Component: OverdraftBlock,\n copy: selectOverdraftCopy,\n usePrepare: useOverdraftPrepare,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n })),\n // Credit Utilization's \"Learn more\": the explanation, the band legend and the per-card list.\n [actionBlocksKey.CREDIT_UTILIZATION_ACTION_BLOCK]: liveEntry(() => ({\n Component: CreditUtilizationBlock,\n copy: selectCreditUtilizationCopy,\n usePrepare: useCreditUtilizationPrepare,\n title: (_variant, copy) => selectCreditUtilizationCopy(copy)?.title ?? '',\n })),\n [actionBlocksKey.EMERGENCY_SAVINGS_ACTION_BLOCK]: liveEntry(() => ({\n Component: EmergencySavingsBlock,\n copy: selectEmergencySavingsCopy,\n usePrepare: noop,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n })),\n // Monthly Credit Card Interest Summary's \"Learn how to save\": the credit card payoff calculator.\n [actionBlocksKey.PAYOFF_CALCULATOR_ACTION_BLOCK]: liveEntry(() => ({\n Component: PayoffCalculatorBlock,\n copy: selectPayoffCalculatorCopy,\n usePrepare: usePayoffCalculatorPrepare,\n useLoadState: usePayoffCalculatorLoadState,\n title: (_variant, copy) => selectPayoffCalculatorCopy(copy)?.title ?? '',\n })),\n [actionBlocksKey.BUDGET_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: BudgetDetailsBlock,\n copy: selectBudgetDetailsCopy,\n // Figma's Budget Details: a close X on the right, not the back arrow.\n headerAction: 'close',\n // Loads the budget data and points the transaction store at the budget month, as pulse did.\n usePrepare: useBudgetDetailsPrepare,\n // \"{subject} Budget\" (subject by the CTA variant), else the card's title.\n title: (variant, copy, beat) => {\n const subject = beat ? resolveBudgetSubject(variant, beat, copy) : undefined\n if (subject && copy.budgets?.details_type_title) {\n return buildDynamicCopy(copy.budgets.details_type_title, subject) as string\n }\n\n return beat?.insights_payload?.title || copy.budgets?.details_title || ''\n },\n })),\n // The accounts widget's account details (header, trend chart, tabs, connection, actions) for the\n // beat's primary account. Shared by every beat that opens an account.\n [actionBlocksKey.ACCOUNT_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: AccountDetailsBlock,\n usePrepare: useAccountDetailsPrepare,\n title: (_variant, copy) => copy.accounts?.account_details ?? '',\n })),\n // Monthly Obligations Status's account list: the beat's calculation and the accounts behind it.\n [actionBlocksKey.ACCOUNT_LIST_ACTION_BLOCK]: liveEntry(() => ({\n Component: AccountListBlock,\n copy: selectAccountListCopy,\n usePrepare: useAccountListPrepare,\n useLoadState: useAccountsLoadState,\n title: (_variant, copy) => selectAccountListCopy(copy)?.title ?? '',\n })),\n // A beat's \"Learn More\": its pre-localized help title and body from the payload's\n // `drilldown_data`. The drawer title is the CTA label.\n [actionBlocksKey.HELP_ACTION_BLOCK]: liveEntry(() => ({\n Component: HelpBlock,\n usePrepare: noop,\n })),\n // Debt Payoff Strategies' \"Learn more\": Avalanche / Snowball tabs over the beat's debt accounts.\n [actionBlocksKey.PAYOFF_STRATEGIES_ACTION_BLOCK]: liveEntry(() => ({\n Component: PayoffStrategiesBlock,\n copy: selectPayoffStrategiesCopy,\n usePrepare: usePayoffStrategiesPrepare,\n useLoadState: useAccountsLoadState,\n title: (_variant, copy) => selectPayoffStrategiesCopy(copy)?.debt_payoff_strategies ?? '',\n })),\n // A Monthly Top Transacted Merchant result row: that merchant's rank, totals and transactions.\n [actionBlocksKey.QUIZ_MERCHANT_ACTION_BLOCK]: liveEntry(() => ({\n Component: QuizMerchantBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: (_variant, copy) => copy.insights_feed?.quiz_block?.drawer_title ?? '',\n })),\n} as Record<string, ActionBlockEntry>\n\nexport const blocks = {\n account_block: AccountBlock,\n account_switch_block: AccountSwitchBlock,\n direct_deposit_block: DetailedAccountBlock,\n bar_chart_block: BarchartBlock,\n budget_block: BudgetBlock,\n debts_block: DebtsBlock,\n donut_chart_block: DonutChartBlock,\n double_bar_chart_block: DoubleBarChartBlock,\n double_progress_bar_block: DoubleProgressBarBlock,\n gas_purchase_block: GasPurchaseBlock,\n goals_block: GoalsBlock,\n image_block: ImageBlock,\n merchant_block: MerchantBlock,\n no_spend_days_block: NoSpendDaysBlock,\n quiz_block: QuizBlock,\n repeating_transaction_block: RepeatingTransactionBlock,\n save_extra_block: SaveExtraBlock,\n savings_amount_block: SavingsOpportunityBlock,\n savings_summary_block: SavingsSummaryBlock,\n step_chart_block: StepChartBlock,\n svg_image_block: SVGImageBlock,\n upcoming_bill_block: RepeatingTransactionBlock,\n upcoming_subscription_block: UpcomingSubscriptionBlock,\n weekly_small_purchases_block: WeeklySmallPurchasesBlock,\n withdrawal_block: WithdrawalBlock,\n transaction_block: TransactionBlock,\n} as Record<string, React.ComponentType<{ payload: Insights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,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,YAAY;AAAA,EACZ,6BAA6B;AAAA,EAC7B,kBAAkB;AAAA,EAClB,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EACvB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,8BAA8B;AAAA,EAC9B,kBAAkB;AAAA,EAClB,mBAAmB;AACrB"}
1
+ {"version":3,"file":"blocks.es.js","names":[],"sources":["../../../src/insights-v2/mappings/blocks.ts"],"sourcesContent":["import {\n AccountBlock,\n AccountSwitchBlock,\n BarchartBlock,\n BudgetBlock,\n DebtsBlock,\n DetailedAccountBlock,\n DonutChartBlock,\n GasPurchaseBlock,\n GoalsBlock,\n MerchantBlock,\n DoubleBarChartBlock,\n DoubleProgressBarBlock,\n NoSpendDaysBlock,\n QuizBlock,\n RepeatingTransactionBlock,\n SaveExtraBlock,\n SavingsOpportunityBlock,\n SavingsSummaryBlock,\n SVGImageBlock,\n UpcomingSubscriptionBlock,\n WeeklySmallPurchasesBlock,\n WithdrawalBlock,\n TransactionBlock,\n} from '../blocks'\nimport StepChartBlock from '../blocks/ChartBlocks/StepChartBlock'\nimport ImageBlock from '../blocks/ImageBlocks/ImageBlock'\n\nimport type { Beat, GlobalCopy, InsightsPayload } from '../../core'\nimport { buildDynamicCopy } from '../../core/utils/Localization'\nimport { ContactSupportActionBlock } from '../actionBlocks/ContactSupportActionBlock'\nimport { FeedbackModalActionBlock } from '../actionBlocks/FeedbackModalActionBlock'\nimport { ConnectionDetailActionBlock } from '../actionBlocks/ConnectionDetailActionBlock'\nimport { ConnectWidgetActionBlock } from '../actionBlocks/ConnectWidgetActionBlock'\nimport { SurveyModalActionBlock } from '../actionBlocks/SurveyModalActionBlock'\nimport { SubscriptionStatusModalBlock } from '../actionBlocks/SubscriptionStatusModalBlock'\nimport { PlaceholderActionBlock } from '../actionBlocks/PlaceholderActionBlock'\nimport { MakeTransferActionBlockLayer } from '../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer'\nimport { getMakeTransferDrawerTitle } from '../actionBlocks/MakeTransferActionBlock/layout'\nimport {\n selectTransactionHistoryCopy,\n TransactionHistoryBlock,\n} from '../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock'\nimport { getDrawerHeaderTitle } from '../actionBlocks/TransactionHistoryBlock/utils'\nimport { useTransactionHistoryPrepare } from '../actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare'\nimport {\n TransactionDetailsBlock,\n useTransactionDetailsPrepare,\n} from '../actionBlocks/TransactionDetailsBlock'\nimport {\n RecurringTransactionBlock,\n useRecurringTransactionPrepare,\n} from '../actionBlocks/RecurringTransactionBlock'\nimport { TransactionListBlock } from '../actionBlocks/TransactionListBlock'\nimport { getTransactionListDrawerTitle } from '../actionBlocks/TransactionListBlock/layout'\nimport {\n RemainingCashBlock,\n selectRemainingCashCopy,\n useRemainingCashLoadState,\n} from '../actionBlocks/RemainingCashBlock'\nimport { AmountInputModalBlock } from '../actionBlocks/AmountInputModalBlock'\nimport {\n OverdraftBlock,\n selectOverdraftCopy,\n useOverdraftPrepare,\n} from '../actionBlocks/OverdraftBlock'\nimport {\n AccountListBlock,\n selectAccountListCopy,\n useAccountListPrepare,\n} from '../actionBlocks/AccountListBlock'\nimport {\n EmergencySavingsBlock,\n selectEmergencySavingsCopy,\n} from '../actionBlocks/EmergencySavingsBlock'\nimport {\n CreditUtilizationBlock,\n selectCreditUtilizationCopy,\n useCreditUtilizationPrepare,\n} from '../actionBlocks/CreditUtilizationBlock'\nimport {\n PayoffCalculatorBlock,\n selectPayoffCalculatorCopy,\n usePayoffCalculatorLoadState,\n usePayoffCalculatorPrepare,\n} from '../actionBlocks/PayoffCalculatorBlock'\nimport { BudgetDetailsBlock, selectBudgetDetailsCopy } from '../actionBlocks/BudgetDetailsBlock'\nimport { useBudgetDetailsPrepare } from '../actionBlocks/BudgetDetailsBlock/useBudgetDetailsPrepare'\nimport { resolveBudgetSubject } from '../actionBlocks/BudgetDetailsBlock/layout'\nimport { AccountDetailsBlock, useAccountDetailsPrepare } from '../actionBlocks/AccountDetailsBlock'\nimport { HelpBlock } from '../actionBlocks/HelpBlock'\nimport {\n PayoffStrategiesBlock,\n selectPayoffStrategiesCopy,\n usePayoffStrategiesPrepare,\n} from '../actionBlocks/PayoffStrategiesBlock'\nimport { QuizMerchantBlock } from '../actionBlocks/QuizMerchantBlock'\nimport { useAccountsLoadState } from '../actionBlocks/useAccountsLoadState'\n// Keys live in ./actionBlocksKey (imported directly by chart blocks/tests too) to avoid a\n// circular import between this module and the chart blocks — see that file for details.\nimport { actionBlocksKey } from './actionBlocksKey'\n\n// Drilldown indexes are not passed down: action blocks read them from\n// InsightsV2Store (useInsightsV2Store().actionDrawer).\nexport interface ActionBlockProps {\n beat: Beat\n}\n\nconst noop = (_: ActionBlockProps) => {}\n\n// Re-exported so existing `hasDrawerBlock` imports from this module keep working.\nexport { hasDrawerBlock } from './hasDrawerBlock'\n\nexport interface BlockLoadState {\n ready: boolean\n failed?: boolean\n retry?: () => void\n}\n\nexport interface ActionBlockEntry {\n Component: React.ComponentType<ActionBlockProps>\n usePrepare: (props: ActionBlockProps) => void // required; default to noop in each entry\n // The data the block waits for: a loader until `ready`, the error card while `failed`.\n useLoadState?: (props: ActionBlockProps) => BlockLoadState\n // Drawer title from the CTA's variant and copy; falls back to the CTA label when empty.\n title?: (variant: string | null | undefined, copy: GlobalCopy, beat?: Beat) => string\n // The copy section a drawer block needs; the layer shows BlockErrorMessage without it.\n copy?: (copy: GlobalCopy) => unknown\n // 'drawer' (default) or 'modal' (component renders its own dialog, no Drawer wrapper).\n presentation?: 'drawer' | 'modal'\n // The drawer header's close control: 'back' (default, arrow on the left) or 'close' (X on the right).\n headerAction?: 'back' | 'close'\n}\n\n// Registry of drawer drilldowns, keyed by the `block` name the backend sends Add\n// `usePrepare` when the block needs to load data before rendering.\n\n/**\n * Reads its imports on access, not at load: some blocks import this registry back through\n * `ActionBlockLayer`, so a value copied at load would still be `undefined`.\n */\nconst liveEntry = (resolve: () => ActionBlockEntry): ActionBlockEntry => ({\n get Component() {\n return resolve().Component\n },\n get usePrepare() {\n return resolve().usePrepare\n },\n get useLoadState() {\n return resolve().useLoadState\n },\n get title() {\n return resolve().title\n },\n get copy() {\n return resolve().copy\n },\n get presentation() {\n return resolve().presentation\n },\n get headerAction() {\n return resolve().headerAction\n },\n})\n\nexport const actionBlocks = {\n [actionBlocksKey.PLACEHOLDER_ACTION_BLOCK]: liveEntry(() => ({\n Component: PlaceholderActionBlock,\n usePrepare: noop,\n title: () => 'Action Block Layer Drilldown',\n })),\n [actionBlocksKey.MAKE_TRANSFER_ACTION_BLOCK]: liveEntry(() => ({\n Component: MakeTransferActionBlockLayer,\n usePrepare: noop,\n title: getMakeTransferDrawerTitle,\n })),\n [actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionHistoryBlock,\n copy: selectTransactionHistoryCopy,\n usePrepare: useTransactionHistoryPrepare,\n title: getDrawerHeaderTitle,\n })),\n [actionBlocksKey.TRANSACTION_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionDetailsBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: () => 'Transaction Details',\n })),\n // Expense Details for one recurring subscription. Which subscription a beat names is resolved in\n // `RecurringTransactionBlock/subscriptionBeats.ts`, not through this registry.\n [actionBlocksKey.RECURRING_TRANSACTION_ACTION_BLOCK]: liveEntry(() => ({\n Component: RecurringTransactionBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.recurring?.expense_details ?? '',\n })),\n // Remaining Cash for the Payday Cash Left Over Status beat. Store-driven: reuses the recurring\n // loader, which also loads accounts and categories, so CashflowStore's computeds are ready.\n [actionBlocksKey.REMAINING_CASH_ACTION_BLOCK]: liveEntry(() => ({\n Component: RemainingCashBlock,\n copy: selectRemainingCashCopy,\n usePrepare: useRecurringTransactionPrepare,\n useLoadState: useRemainingCashLoadState,\n title: (_variant, copy) => selectRemainingCashCopy(copy)?.title ?? '',\n })),\n // The block renders its own drawer (the help module's RequestSupport) on top of the action\n // drawer, so the action drawer's title is the CTA label.\n [actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK]: liveEntry(() => ({\n Component: ContactSupportActionBlock,\n usePrepare: noop,\n title: (_variant, copy) => copy.help?.request_support ?? '',\n })),\n [actionBlocksKey.FEEDBACK_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: FeedbackModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.CONNECTION_DETAIL_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectionDetailActionBlock,\n usePrepare: noop,\n title: (_variant, copy) =>\n copy.insights_feed?.connection_details?.connection_details_drawer_title ?? '',\n })),\n // Boots MX's Connect widget (web-widget-sdk iframe) inside the action\n // drawer; the drawer title falls back to the CTA label.\n [actionBlocksKey.CONNECT_WIDGET_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectWidgetActionBlock,\n usePrepare: noop,\n })),\n [actionBlocksKey.SURVEY_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: SurveyModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n // Unexpected Subscription Payment's Subscription Status modal.\n [actionBlocksKey.SUBSCRIPTION_STATUS_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: SubscriptionStatusModalBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.TRANSACTION_LIST_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionListBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: getTransactionListDrawerTitle,\n })),\n // One whole-dollar setting in a dialog; the CTA variant picks which (low-balance threshold or\n // safety net). A modal: no drawer, so no drawer title.\n [actionBlocksKey.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: AmountInputModalBlock,\n presentation: 'modal',\n // Loads inside the block: it mounts only while open, so mounting is the open-time load.\n usePrepare: noop,\n })),\n // Savings Opportunity's safety net: `safety_net_block` opens the amount-input modal.\n [actionBlocksKey.SAFETY_NET_ACTION_BLOCK]: liveEntry(() => ({\n Component: AmountInputModalBlock,\n presentation: 'modal',\n usePrepare: noop,\n })),\n // Transparent Overdraft's \"Learn more\": the projected overdraft, its account and the confidence\n // meter. Titled from the beat, as the pulse drawer was.\n [actionBlocksKey.OVERDRAFT_ACTION_BLOCK]: liveEntry(() => ({\n Component: OverdraftBlock,\n copy: selectOverdraftCopy,\n usePrepare: useOverdraftPrepare,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n })),\n // Credit Utilization's \"Learn more\": the explanation, the band legend and the per-card list.\n [actionBlocksKey.CREDIT_UTILIZATION_ACTION_BLOCK]: liveEntry(() => ({\n Component: CreditUtilizationBlock,\n copy: selectCreditUtilizationCopy,\n usePrepare: useCreditUtilizationPrepare,\n title: (_variant, copy) => selectCreditUtilizationCopy(copy)?.title ?? '',\n })),\n [actionBlocksKey.EMERGENCY_SAVINGS_ACTION_BLOCK]: liveEntry(() => ({\n Component: EmergencySavingsBlock,\n copy: selectEmergencySavingsCopy,\n usePrepare: noop,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n })),\n // Monthly Credit Card Interest Summary's \"Learn how to save\": the credit card payoff calculator.\n [actionBlocksKey.PAYOFF_CALCULATOR_ACTION_BLOCK]: liveEntry(() => ({\n Component: PayoffCalculatorBlock,\n copy: selectPayoffCalculatorCopy,\n usePrepare: usePayoffCalculatorPrepare,\n useLoadState: usePayoffCalculatorLoadState,\n title: (_variant, copy) => selectPayoffCalculatorCopy(copy)?.title ?? '',\n })),\n [actionBlocksKey.BUDGET_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: BudgetDetailsBlock,\n copy: selectBudgetDetailsCopy,\n // Figma's Budget Details: a close X on the right, not the back arrow.\n headerAction: 'close',\n // Loads the budget data and points the transaction store at the budget month, as pulse did.\n usePrepare: useBudgetDetailsPrepare,\n // \"{subject} Budget\" (subject by the CTA variant), else the card's title.\n title: (variant, copy, beat) => {\n const subject = beat ? resolveBudgetSubject(variant, beat, copy) : undefined\n if (subject && copy.budgets?.details_type_title) {\n return buildDynamicCopy(copy.budgets.details_type_title, subject) as string\n }\n\n return beat?.insights_payload?.title || copy.budgets?.details_title || ''\n },\n })),\n // The accounts widget's account details (header, trend chart, tabs, connection, actions) for the\n // beat's primary account. Shared by every beat that opens an account.\n [actionBlocksKey.ACCOUNT_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: AccountDetailsBlock,\n usePrepare: useAccountDetailsPrepare,\n title: (_variant, copy) => copy.accounts?.account_details ?? '',\n })),\n // Monthly Obligations Status's account list: the beat's calculation and the accounts behind it.\n [actionBlocksKey.ACCOUNT_LIST_ACTION_BLOCK]: liveEntry(() => ({\n Component: AccountListBlock,\n copy: selectAccountListCopy,\n usePrepare: useAccountListPrepare,\n useLoadState: useAccountsLoadState,\n title: (_variant, copy) => selectAccountListCopy(copy)?.title ?? '',\n })),\n // A beat's \"Learn More\": its pre-localized help title and body from the payload's\n // `drilldown_data`. The drawer title is the CTA label.\n [actionBlocksKey.HELP_ACTION_BLOCK]: liveEntry(() => ({\n Component: HelpBlock,\n usePrepare: noop,\n })),\n // Debt Payoff Strategies' \"Learn more\": Avalanche / Snowball tabs over the beat's debt accounts.\n [actionBlocksKey.PAYOFF_STRATEGIES_ACTION_BLOCK]: liveEntry(() => ({\n Component: PayoffStrategiesBlock,\n copy: selectPayoffStrategiesCopy,\n usePrepare: usePayoffStrategiesPrepare,\n useLoadState: useAccountsLoadState,\n title: (_variant, copy) => selectPayoffStrategiesCopy(copy)?.debt_payoff_strategies ?? '',\n })),\n // A Monthly Top Transacted Merchant result row: that merchant's rank, totals and transactions.\n [actionBlocksKey.QUIZ_MERCHANT_ACTION_BLOCK]: liveEntry(() => ({\n Component: QuizMerchantBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: (_variant, copy) => copy.insights_feed?.quiz_block?.drawer_title ?? '',\n })),\n} as Record<string, ActionBlockEntry>\n\nexport const blocks = {\n account_block: AccountBlock,\n account_switch_block: AccountSwitchBlock,\n direct_deposit_block: DetailedAccountBlock,\n bar_chart_block: BarchartBlock,\n budget_block: BudgetBlock,\n debts_block: DebtsBlock,\n donut_chart_block: DonutChartBlock,\n double_bar_chart_block: DoubleBarChartBlock,\n double_progress_bar_block: DoubleProgressBarBlock,\n gas_purchase_block: GasPurchaseBlock,\n goals_block: GoalsBlock,\n image_block: ImageBlock,\n merchant_block: MerchantBlock,\n no_spend_days_block: NoSpendDaysBlock,\n quiz_block: QuizBlock,\n repeating_transaction_block: RepeatingTransactionBlock,\n save_extra_block: SaveExtraBlock,\n savings_amount_block: SavingsOpportunityBlock,\n savings_summary_block: SavingsSummaryBlock,\n step_chart_block: StepChartBlock,\n svg_image_block: SVGImageBlock,\n upcoming_bill_block: RepeatingTransactionBlock,\n upcoming_subscription_block: UpcomingSubscriptionBlock,\n weekly_small_purchases_block: WeeklySmallPurchasesBlock,\n withdrawal_block: WithdrawalBlock,\n transaction_block: TransactionBlock,\n} as Record<string, React.ComponentType<{ payload: InsightsPayload; beatGuid?: string }>>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4GA,IAAM,IAAA,CAAQ,MAAwB;AAAC,GAiCjC,IAAA,CAAa,OAAuD;AAAA,EACxE,IAAI,YAAY;AACd,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,aAAa;AACf,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,eAAe;AACjB,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,QAAQ;AACV,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,OAAO;AACT,WAAO,EAAQ,EAAE;AAAA,E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ACnE,EAAE;AAAA,EAGD,CAAA,EAAgB,iBAAA,GAAoB,EAAA,OAAiB;AAAA,IACpD,WAAW;AAAA,IACX,YAAY;AAAA,EACd,EAAE;AAAA,EAED,CAAA,EAAgB,8BAAA,GAAiC,EAAA,OAAiB;AAAA,IACjE,WAAW;AAAA,IACX,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,OAAA,CAAQ,GAAU,MAAS,EAA2B,CAAI,GAAG,0BAA0B;AAAA,EACzF,EAAE;AAAA,EAED,CAAA,EAAgB,0BAAA,GAA6B,EAAA,OAAiB;AAAA,IAC7D,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,CAAQ,GAAU,MAAS,EAAK,eAAe,YAAY,gBAAgB;AAAA,EAC7E,EAAE;AACJ,GAEa,KAAS;AAAA,EACpB,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,aAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,wBAAwB;AAAA,EACxB,2BAA2B;AAAA,EAC3B,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,YAAY;AAAA,EACZ,6BAA6B;AAAA,EAC7B,kBAAkB;AAAA,EAClB,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EACvB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,8BAA8B;AAAA,EAC9B,kBAAkB;AAAA,EAClB,mBAAmB;AACrB"}
@@ -1,65 +1,65 @@
1
- import { buildDynamicCopy as u } from "../../../../../core/utils/Localization.es.js";
2
- import { useCategoryStore as b, useEvent as L, useGlobalCopyStore as E, useTransactionStore as N } from "../../../../../common/context/hooks.es.js";
3
- import O from "../../../../../common/components/dialog/Dialog.es.js";
4
- import { ANALYTICS_EVENTS as R } from "../../../../../common/constants/Analytics.es.js";
5
- import { useTransactionsUiStore as w } from "../../../../context/hooks.es.js";
6
- import { ON_CLICK_EVENTS as D } from "../../../../constants/OnClickEvents.es.js";
7
- import G from "../../../../../categories/components/CategorySelectorDrawer.es.js";
1
+ import { buildDynamicCopy as y } from "../../../../../core/utils/Localization.es.js";
2
+ import { useCategoryStore as L, useEvent as E, useGlobalCopyStore as N, useTransactionStore as O } from "../../../../../common/context/hooks.es.js";
3
+ import R from "../../../../../common/components/dialog/Dialog.es.js";
4
+ import { ANALYTICS_EVENTS as w } from "../../../../../common/constants/Analytics.es.js";
5
+ import { useTransactionsUiStore as D } from "../../../../context/hooks.es.js";
6
+ import { ON_CLICK_EVENTS as G } from "../../../../constants/OnClickEvents.es.js";
7
+ import P from "../../../../../categories/components/CategorySelectorDrawer.es.js";
8
8
  import i from "react";
9
- import { CategoryIcon as P, CategoryIconVariants as K, P as V, Text as Y } from "@mxenabled/mxui";
10
- import { Icon as j } from "@mxenabled/mx-icons";
11
- import { jsx as t, jsxs as y } from "react/jsx-runtime";
12
- import { useTheme as k } from "@mui/material/styles";
13
- import z from "@mui/material/ListItem";
14
- import B from "@mui/material/Avatar";
15
- import M from "@mui/material/ListItemAvatar";
16
- import U from "@mui/material/ListItemButton";
17
- import F from "@mui/material/ListItemIcon";
18
- import W from "@mui/material/ListItemText";
19
- var de = ({ transaction: e }) => {
20
- const { addOrUpdateTransactionRule: g, updateTransaction: f } = N(), { categories: s } = b(), { onEvent: c } = L(), { setShouldDisableDrawerScroll: C, updateManualTransaction: T } = w(), { transactions: r } = E(), S = k(), l = i.useRef(null), [h, m] = i.useState(!1), [a, n] = i.useState(""), d = async (o) => {
21
- await f({
9
+ import { CategoryIcon as K, CategoryIconVariants as V, P as Y, Text as j } from "@mxenabled/mxui";
10
+ import { Icon as k } from "@mxenabled/mx-icons";
11
+ import { jsx as t, jsxs as g } from "react/jsx-runtime";
12
+ import { useTheme as z } from "@mui/material/styles";
13
+ import B from "@mui/material/ListItem";
14
+ import M from "@mui/material/Avatar";
15
+ import U from "@mui/material/ListItemAvatar";
16
+ import F from "@mui/material/ListItemButton";
17
+ import W from "@mui/material/ListItemIcon";
18
+ import $ from "@mui/material/ListItemText";
19
+ var pe = ({ transaction: e }) => {
20
+ const { addOrUpdateTransactionRule: f, updateTransaction: C } = O(), { categories: s } = L(), { onEvent: c } = E(), { setShouldDisableDrawerScroll: T, updateManualTransaction: h } = D(), { transactions: r } = N(), S = z(), l = i.useRef(null), m = i.useId(), [I, d] = i.useState(!1), [a, n] = i.useState(""), p = async (o) => {
21
+ await C({
22
22
  ...e,
23
23
  category_guid: a
24
- }), o && await g(a, e), n(""), c(R.TRANSACTION_DETAILS_CLICK_CATEGORY, { transaction_guid: e.guid });
25
- }, I = (o) => {
24
+ }), o && await f(a, e), n(""), c(w.TRANSACTION_DETAILS_CLICK_CATEGORY, { transaction_guid: e.guid });
25
+ }, x = (o) => {
26
26
  if (e.is_manual && !e.guid) {
27
- const _ = s.find((v) => v.guid === o);
28
- T({
27
+ const _ = s.find((b) => b.guid === o);
28
+ h({
29
29
  ...e,
30
30
  category: _?.name,
31
31
  category_guid: o,
32
32
  top_level_category_guid: _?.parent_guid || o
33
33
  });
34
34
  } else n(o);
35
- p();
36
- }, p = () => {
37
- m(!1), C(!1);
38
- }, x = i.useMemo(() => s.find((o) => o.guid === a), [a]), A = S.palette.mode === "dark" ? "grey.800" : "grey.100";
39
- return /* @__PURE__ */ y(z, {
35
+ u();
36
+ }, u = () => {
37
+ d(!1), T(!1);
38
+ }, A = i.useMemo(() => s.find((o) => o.guid === a), [a]), v = S.palette.mode === "dark" ? "grey.800" : "grey.100";
39
+ return /* @__PURE__ */ g(B, {
40
40
  disableGutters: !0,
41
41
  disablePadding: !0,
42
42
  children: [
43
- /* @__PURE__ */ y(U, {
43
+ /* @__PURE__ */ g(F, {
44
44
  ref: l,
45
45
  onClick: () => {
46
- c(D.ON_TRANSACTION_CATEGORY_CLICK), m(!0);
46
+ c(G.ON_TRANSACTION_CATEGORY_CLICK), d(!0);
47
47
  },
48
48
  children: [
49
- /* @__PURE__ */ t(M, { children: /* @__PURE__ */ t(B, {
50
- sx: { bgcolor: A },
49
+ /* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(M, {
50
+ sx: { bgcolor: v },
51
51
  variant: "rounded",
52
- children: /* @__PURE__ */ t(P, {
52
+ children: /* @__PURE__ */ t(K, {
53
53
  categoryGuid: e.top_level_category_guid,
54
54
  icon_ratio: 1,
55
55
  size: 20,
56
56
  sx: { color: "text.primary" },
57
- variant: K.Transparent
57
+ variant: V.Transparent
58
58
  })
59
59
  }) }),
60
- /* @__PURE__ */ t(W, {
60
+ /* @__PURE__ */ t($, {
61
61
  primary: r.category_title,
62
- secondary: /* @__PURE__ */ t(Y, {
62
+ secondary: /* @__PURE__ */ t(j, {
63
63
  bold: !0,
64
64
  sx: { color: "text.primary" },
65
65
  variant: "body1",
@@ -71,38 +71,40 @@ var de = ({ transaction: e }) => {
71
71
  fontWeight: "normal"
72
72
  } }
73
73
  }),
74
- /* @__PURE__ */ t(F, { children: /* @__PURE__ */ t(j, {
74
+ /* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(k, {
75
75
  name: "chevron_right",
76
76
  sx: { color: "text.primary" }
77
77
  }) })
78
78
  ]
79
79
  }),
80
- /* @__PURE__ */ t(G, {
80
+ /* @__PURE__ */ t(P, {
81
81
  initialSelected: e.category_guid,
82
- onClose: p,
83
- onSelect: I,
84
- showDrawer: h,
82
+ onClose: u,
83
+ onSelect: x,
84
+ showDrawer: I,
85
85
  title: r.actions_select_a_category
86
86
  }),
87
- /* @__PURE__ */ t(O, {
88
- copy: { title: u(r.actions_apply_to_all_transaction_types, e.description) },
87
+ /* @__PURE__ */ t(R, {
88
+ "aria-describedby": m,
89
+ copy: { title: y(r.actions_apply_to_all_transaction_types, e.description) },
89
90
  isOpen: !!a,
90
91
  onClose: () => n(""),
91
- onPrimaryAction: () => d(!0),
92
- onSecondaryAction: () => d(!1),
92
+ onPrimaryAction: () => p(!0),
93
+ onSecondaryAction: () => p(!1),
93
94
  primaryText: r.actions_apply_to_all,
94
95
  returnFocusTo: l,
95
96
  secondaryText: r.actions_this_time_only,
96
- children: /* @__PURE__ */ t(V, {
97
+ children: /* @__PURE__ */ t(Y, {
98
+ id: m,
97
99
  variant: "subtitle1",
98
- children: u(r.actions_all_past_and_future, e.description, x?.name)
100
+ children: y(r.actions_all_past_and_future, /* @__PURE__ */ t("strong", { children: e.description }), A?.name)
99
101
  })
100
102
  })
101
103
  ]
102
104
  });
103
105
  };
104
106
  export {
105
- de as default
107
+ pe as default
106
108
  };
107
109
 
108
110
  //# sourceMappingURL=CategoryAction.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CategoryAction.es.js","names":[],"sources":["../../../../../../src/transactions/components/shared/transactiondetails/actions/CategoryAction.tsx"],"sourcesContent":["import React from 'react'\n\nimport Avatar from '@mui/material/Avatar'\nimport ListItem from '@mui/material/ListItem'\nimport ListItemAvatar from '@mui/material/ListItemAvatar'\nimport ListItemButton from '@mui/material/ListItemButton'\nimport ListItemIcon from '@mui/material/ListItemIcon'\nimport ListItemText from '@mui/material/ListItemText'\nimport { useTheme } from '@mui/material/styles'\n\nimport { CategoryIcon, CategoryIconVariants, P, Text } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\nimport { CategorySelectorDrawer } from '../../../../../categories'\n\nimport {\n ANALYTICS_EVENTS,\n Dialog,\n useCategoryStore,\n useGlobalCopyStore,\n} from '../../../../../common'\nimport type { Transaction } from '../../../../../core'\n\nimport { ON_CLICK_EVENTS } from '../../../../constants/OnClickEvents'\nimport { useTransactionsUiStore } from '../../../../context/hooks'\nimport { useEvent, useTransactionStore } from '../../../../../common'\nimport { buildDynamicCopy } from '../../../../../core/utils/Localization'\n\ninterface CategoryActionProps {\n transaction: Transaction\n}\n\nconst CategoryAction: React.FC<CategoryActionProps> = ({ transaction }) => {\n const { addOrUpdateTransactionRule, updateTransaction } = useTransactionStore()\n const { categories } = useCategoryStore()\n const { onEvent } = useEvent()\n const { setShouldDisableDrawerScroll, updateManualTransaction } = useTransactionsUiStore()\n const { transactions: copy } = useGlobalCopyStore()\n\n const theme = useTheme()\n\n const categoryRowRef = React.useRef<HTMLDivElement>(null)\n const [open, setOpen] = React.useState(false)\n const [selectedGuid, setSelectedGuid] = React.useState('')\n\n const handleCategoryChange = async (applyToAll: boolean) => {\n await updateTransaction({ ...transaction, category_guid: selectedGuid })\n if (applyToAll) {\n await addOrUpdateTransactionRule(selectedGuid, transaction)\n }\n setSelectedGuid('')\n onEvent(ANALYTICS_EVENTS.TRANSACTION_DETAILS_CLICK_CATEGORY, {\n transaction_guid: transaction.guid,\n })\n }\n\n const handleSelected = (guid: string) => {\n if (transaction.is_manual && !transaction.guid) {\n const category = categories.find((c) => c.guid === guid)\n updateManualTransaction({\n ...transaction,\n category: category?.name,\n category_guid: guid,\n top_level_category_guid: category?.parent_guid || guid,\n })\n } else {\n setSelectedGuid(guid)\n }\n\n handleCloseDrawer()\n }\n\n const handleCloseDrawer = () => {\n setOpen(false)\n setShouldDisableDrawerScroll(false)\n }\n\n const category = React.useMemo(\n () => categories.find((item) => item.guid === selectedGuid),\n [selectedGuid],\n )\n\n const bgColor = theme.palette.mode === 'dark' ? 'grey.800' : 'grey.100'\n\n return (\n <ListItem disableGutters={true} disablePadding={true}>\n <ListItemButton\n ref={categoryRowRef}\n onClick={() => {\n onEvent(ON_CLICK_EVENTS.ON_TRANSACTION_CATEGORY_CLICK)\n setOpen(true)\n }}\n >\n <ListItemAvatar>\n <Avatar sx={{ bgcolor: bgColor }} variant=\"rounded\">\n <CategoryIcon\n categoryGuid={transaction.top_level_category_guid}\n icon_ratio={1}\n size={20}\n sx={{ color: 'text.primary' }}\n variant={CategoryIconVariants.Transparent}\n />\n </Avatar>\n </ListItemAvatar>\n <ListItemText\n primary={copy.category_title}\n secondary={\n <Text bold={true} sx={{ color: 'text.primary' }} variant=\"body1\">\n {transaction.category ?? copy.actions_select_a_category}\n </Text>\n }\n slotProps={{ primary: { variant: 'caption', fontSize: 11, fontWeight: 'normal' } }}\n />\n <ListItemIcon>\n <Icon name=\"chevron_right\" sx={{ color: 'text.primary' }} />\n </ListItemIcon>\n </ListItemButton>\n\n <CategorySelectorDrawer\n initialSelected={transaction.category_guid}\n onClose={handleCloseDrawer}\n onSelect={handleSelected}\n showDrawer={open}\n title={copy.actions_select_a_category}\n />\n\n <Dialog\n copy={{\n title: buildDynamicCopy(\n copy.actions_apply_to_all_transaction_types,\n transaction.description,\n ) as string,\n }}\n isOpen={Boolean(selectedGuid)}\n onClose={() => setSelectedGuid('')}\n onPrimaryAction={() => handleCategoryChange(true)}\n onSecondaryAction={() => handleCategoryChange(false)}\n primaryText={copy.actions_apply_to_all}\n returnFocusTo={categoryRowRef}\n secondaryText={copy.actions_this_time_only}\n >\n <P variant=\"subtitle1\">\n {\n buildDynamicCopy(\n copy.actions_all_past_and_future,\n transaction.description,\n category?.name,\n ) as string\n }\n </P>\n </Dialog>\n </ListItem>\n )\n}\n\nexport default CategoryAction\n"],"mappings":";;;;;;;;;;;;;;;;;;AA+BA,IAAM,KAAA,CAAiD,EAAE,aAAA,EAAA,MAAkB;AACzE,QAAM,EAAE,4BAAA,GAA4B,mBAAA,EAAA,IAAsB,EAAoB,GACxE,EAAE,YAAA,EAAA,IAAe,EAAiB,GAClC,EAAE,SAAA,EAAA,IAAY,EAAS,GACvB,EAAE,8BAAA,GAA8B,yBAAA,EAAA,IAA4B,EAAuB,GACnF,EAAE,cAAc,EAAA,IAAS,EAAmB,GAE5C,IAAQ,EAAS,GAEjB,IAAiB,EAAM,OAAuB,IAAI,GAClD,CAAC,GAAM,CAAA,IAAW,EAAM,SAAS,EAAK,GACtC,CAAC,GAAc,CAAA,IAAmB,EAAM,SAAS,EAAE,GAEnD,IAAuB,OAAO,MAAwB;AAC1D,UAAM,EAAkB;AAAA,MAAE,GAAG;AAAA,MAAa,eAAe;A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ACK,CAAA,EACM,CAAA;AAAA,UAChB,gBAAA,EAAC,GAAD;AAAA,YACE,SAAS,EAAK;AAAA,YACd,WACE,gBAAA,EAAC,GAAD;AAAA,cAAM,MAAM;AAAA,cAAM,IAAI,EAAE,OAAO,eAAe;AAAA,cAAG,SAAQ;AAAA,cACtD,UAAA,EAAY,YAAY,EAAK;AAAA,YAC1B,CAAA;AAAA,YAER,WAAW,EAAE,SAAS;AAAA,cAAE,SAAS;AAAA,cAAW,UAAU;AAAA,cAAI,YAAY;AAAA,YAAS,EAAE;AAAA,UAClF,CAAA;AAAA,UACD,gBAAA,EAAC,GAAD,EAAA,UACE,gBAAA,EAAC,GAAD;AAAA,YAAM,MAAK;AAAA,YAAgB,IAAI,EAAE,OAAO,eAAe;AAAA,UAAI,CAAA,EAC/C,CAAA;AAAA,QACA;AAAA;MAEhB,gBAAA,EAAC,GAAD;AAAA,QACE,iBAAiB,EAAY;AAAA,QAC7B,SAAS;AAAA,QACT,UAAU;AAAA,QACV,YAAY;AAAA,QACZ,OAAO,EAAK;AAAA,MACb,CAAA;AAAA,MAED,gBAAA,EAAC,GAAD;AAAA,QACE,MAAM,EACJ,OAAO,EACL,EAAK,wCACL,EAAY,WACd,EACF;AAAA,QACA,QAAQ,EAAQ;AAAA,QAChB,SAAA,MAAe,EAAgB,EAAE;AAAA,QACjC,iBAAA,MAAuB,EAAqB,EAAI;AAAA,QAChD,mBAAA,MAAyB,EAAqB,EAAK;AAAA,QACnD,aAAa,EAAK;AAAA,QAClB,eAAe;AAAA,QACf,eAAe,EAAK;AAAA,QAEpB,UAAA,gBAAA,EAAC,GAAD;AAAA,UAAG,SAAQ;AAAA,UAEP,UAAA,EACE,EAAK,6BACL,EAAY,aACZ,GAAU,IACZ;AAAA,QAED,CAAA;AAAA,MACG,CAAA;AAAA,IACA;AAAA;AAEd"}
1
+ {"version":3,"file":"CategoryAction.es.js","names":[],"sources":["../../../../../../src/transactions/components/shared/transactiondetails/actions/CategoryAction.tsx"],"sourcesContent":["import React from 'react'\n\nimport Avatar from '@mui/material/Avatar'\nimport ListItem from '@mui/material/ListItem'\nimport ListItemAvatar from '@mui/material/ListItemAvatar'\nimport ListItemButton from '@mui/material/ListItemButton'\nimport ListItemIcon from '@mui/material/ListItemIcon'\nimport ListItemText from '@mui/material/ListItemText'\nimport { useTheme } from '@mui/material/styles'\n\nimport { CategoryIcon, CategoryIconVariants, P, Text } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\nimport { CategorySelectorDrawer } from '../../../../../categories'\n\nimport {\n ANALYTICS_EVENTS,\n Dialog,\n useCategoryStore,\n useGlobalCopyStore,\n} from '../../../../../common'\nimport type { Transaction } from '../../../../../core'\n\nimport { ON_CLICK_EVENTS } from '../../../../constants/OnClickEvents'\nimport { useTransactionsUiStore } from '../../../../context/hooks'\nimport { useEvent, useTransactionStore } from '../../../../../common'\nimport { buildDynamicCopy } from '../../../../../core/utils/Localization'\n\ninterface CategoryActionProps {\n transaction: Transaction\n}\n\nconst CategoryAction: React.FC<CategoryActionProps> = ({ transaction }) => {\n const { addOrUpdateTransactionRule, updateTransaction } = useTransactionStore()\n const { categories } = useCategoryStore()\n const { onEvent } = useEvent()\n const { setShouldDisableDrawerScroll, updateManualTransaction } = useTransactionsUiStore()\n const { transactions: copy } = useGlobalCopyStore()\n\n const theme = useTheme()\n\n const categoryRowRef = React.useRef<HTMLDivElement>(null)\n const messageId = React.useId()\n const [open, setOpen] = React.useState(false)\n const [selectedGuid, setSelectedGuid] = React.useState('')\n\n const handleCategoryChange = async (applyToAll: boolean) => {\n await updateTransaction({ ...transaction, category_guid: selectedGuid })\n if (applyToAll) {\n await addOrUpdateTransactionRule(selectedGuid, transaction)\n }\n setSelectedGuid('')\n onEvent(ANALYTICS_EVENTS.TRANSACTION_DETAILS_CLICK_CATEGORY, {\n transaction_guid: transaction.guid,\n })\n }\n\n const handleSelected = (guid: string) => {\n if (transaction.is_manual && !transaction.guid) {\n const category = categories.find((c) => c.guid === guid)\n updateManualTransaction({\n ...transaction,\n category: category?.name,\n category_guid: guid,\n top_level_category_guid: category?.parent_guid || guid,\n })\n } else {\n setSelectedGuid(guid)\n }\n\n handleCloseDrawer()\n }\n\n const handleCloseDrawer = () => {\n setOpen(false)\n setShouldDisableDrawerScroll(false)\n }\n\n const category = React.useMemo(\n () => categories.find((item) => item.guid === selectedGuid),\n [selectedGuid],\n )\n\n const bgColor = theme.palette.mode === 'dark' ? 'grey.800' : 'grey.100'\n\n return (\n <ListItem disableGutters={true} disablePadding={true}>\n <ListItemButton\n ref={categoryRowRef}\n onClick={() => {\n onEvent(ON_CLICK_EVENTS.ON_TRANSACTION_CATEGORY_CLICK)\n setOpen(true)\n }}\n >\n <ListItemAvatar>\n <Avatar sx={{ bgcolor: bgColor }} variant=\"rounded\">\n <CategoryIcon\n categoryGuid={transaction.top_level_category_guid}\n icon_ratio={1}\n size={20}\n sx={{ color: 'text.primary' }}\n variant={CategoryIconVariants.Transparent}\n />\n </Avatar>\n </ListItemAvatar>\n <ListItemText\n primary={copy.category_title}\n secondary={\n <Text bold={true} sx={{ color: 'text.primary' }} variant=\"body1\">\n {transaction.category ?? copy.actions_select_a_category}\n </Text>\n }\n slotProps={{ primary: { variant: 'caption', fontSize: 11, fontWeight: 'normal' } }}\n />\n <ListItemIcon>\n <Icon name=\"chevron_right\" sx={{ color: 'text.primary' }} />\n </ListItemIcon>\n </ListItemButton>\n\n <CategorySelectorDrawer\n initialSelected={transaction.category_guid}\n onClose={handleCloseDrawer}\n onSelect={handleSelected}\n showDrawer={open}\n title={copy.actions_select_a_category}\n />\n\n <Dialog\n aria-describedby={messageId}\n copy={{\n title: buildDynamicCopy(\n copy.actions_apply_to_all_transaction_types,\n transaction.description,\n ) as string,\n }}\n isOpen={Boolean(selectedGuid)}\n onClose={() => setSelectedGuid('')}\n onPrimaryAction={() => handleCategoryChange(true)}\n onSecondaryAction={() => handleCategoryChange(false)}\n primaryText={copy.actions_apply_to_all}\n returnFocusTo={categoryRowRef}\n secondaryText={copy.actions_this_time_only}\n >\n <P id={messageId} variant=\"subtitle1\">\n {\n buildDynamicCopy(\n copy.actions_all_past_and_future,\n <strong>{transaction.description}</strong>,\n category?.name,\n ) as React.ReactNode\n }\n </P>\n </Dialog>\n </ListItem>\n )\n}\n\nexport default CategoryAction\n"],"mappings":";;;;;;;;;;;;;;;;;;AA+BA,IAAM,KAAA,CAAiD,EAAE,aAAA,EAAA,MAAkB;AACzE,QAAM,EAAE,4BAAA,GAA4B,mBAAA,EAAA,IAAsB,EAAoB,GACxE,EAAE,YAAA,EAAA,IAAe,EAAiB,GAClC,EAAE,SAAA,EAAA,IAAY,EAAS,GACvB,EAAE,8BAAA,GAA8B,yBAAA,EAAA,IAA4B,EAAuB,GACnF,EAAE,cAAc,EAAA,IAAS,EAAmB,GAE5C,IAAQ,EAAS,GAEjB,IAAiB,EAAM,OAAuB,IAAI,GAClD,IAAY,EAAM,MAAM,GACxB,CAAC,GAAM,CAAA,IAAW,EAAM,SAAS,EAAK,GACtC,CAAC,GAAc,CAAA,IAAmB,EAAM,SAAS,EAAE,GAEnD,IAAuB,OAAO,MAAwB;AAC1D,UAAM,EAAkB;AAAA,MAAE,GAAG;AAAA,MAAa,eAAe;AAAA,IAAa,CAAC,GACnE,KACF,MAAM,EAA2B,GAAc,CAAW,GAE5D,EAAgB,EAAE,GAClB,EAAQ,EAAiB,oCAAoC,EAC3D,kBAAkB,EAAY,KAChC,CAAC;AAAA,EACH,GAEM,IAAA,CAAkB,MAAiB;AACvC,QAAI,EAAY,aAAa,CAAC,EAAY,MAAM;AAC9C,YAAM,IAAW,EAAW,KAAA,CAAM,MAAM,EAAE,SAAS,CAAI;AACvD,MAAA,EAAwB;AAAA,QACtB,GAAG;AAAA,QACH,UAAU,GAAU;AAAA,QACpB,eAAe;AAAA,QACf,yBAAyB,GAAU,eAAe;AAAA,MACpD,CAAC;AAAA,IACH,MACE,CAAA,EAAgB,CAAI;AAGtB,IAAA,EAAkB;AAAA,EACpB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e;AAAA,UAAI,CAAA,EAC/C,CAAA;AAAA,QACA;AAAA;MAEhB,gBAAA,EAAC,GAAD;AAAA,QACE,iBAAiB,EAAY;AAAA,QAC7B,SAAS;AAAA,QACT,UAAU;AAAA,QACV,YAAY;AAAA,QACZ,OAAO,EAAK;AAAA,MACb,CAAA;AAAA,MAED,gBAAA,EAAC,GAAD;AAAA,QACE,oBAAkB;AAAA,QAClB,MAAM,EACJ,OAAO,EACL,EAAK,wCACL,EAAY,WACd,EACF;AAAA,QACA,QAAQ,EAAQ;AAAA,QAChB,SAAA,MAAe,EAAgB,EAAE;AAAA,QACjC,iBAAA,MAAuB,EAAqB,EAAI;AAAA,QAChD,mBAAA,MAAyB,EAAqB,EAAK;AAAA,QACnD,aAAa,EAAK;AAAA,QAClB,eAAe;AAAA,QACf,eAAe,EAAK;AAAA,QAEpB,UAAA,gBAAA,EAAC,GAAD;AAAA,UAAG,IAAI;AAAA,UAAW,SAAQ;AAAA,UAEtB,UAAA,EACE,EAAK,6BACL,gBAAA,EAAC,UAAD,EAAA,UAAS,EAAY,YAAoB,CAAA,GACzC,GAAU,IACZ;AAAA,QAED,CAAA;AAAA,MACG,CAAA;AAAA,IACA;AAAA;AAEd"}
@@ -1,38 +1,40 @@
1
- import { buildDynamicCopy as s } from "../../../../core/utils/Localization.es.js";
2
- import { useCategoryStore as _, useGlobalCopyStore as u, useTransactionStore as g } from "../../../../common/context/hooks.es.js";
3
- import f from "../../../../common/components/dialog/Dialog.es.js";
4
- import C from "../../../../categories/components/CategorySelectorDrawer.es.js";
5
- import l from "react";
1
+ import { buildDynamicCopy as l } from "../../../../core/utils/Localization.es.js";
2
+ import { useCategoryStore as _, useGlobalCopyStore as g, useTransactionStore as f } from "../../../../common/context/hooks.es.js";
3
+ import C from "../../../../common/components/dialog/Dialog.es.js";
4
+ import h from "../../../../categories/components/CategorySelectorDrawer.es.js";
5
+ import s from "react";
6
6
  import { observer as x } from "mobx-react-lite";
7
7
  import { P as S } from "@mxenabled/mxui";
8
- import { jsx as i, jsxs as h } from "react/jsx-runtime";
8
+ import { jsx as r, jsxs as b } from "react/jsx-runtime";
9
9
  import w from "@mui/material/Box";
10
10
  var T = ({ onClose: c, transaction: t }) => {
11
- const { addOrUpdateTransactionRule: d, updateTransaction: m } = g(), { transactions: o } = u(), { categories: p } = _(), [e, n] = l.useState(""), y = l.useMemo(() => p.find((a) => a.guid === e), [e]), r = async (a) => {
12
- await m({
11
+ const { addOrUpdateTransactionRule: m, updateTransaction: y } = f(), { transactions: e } = g(), { categories: p } = _(), [o, n] = s.useState(""), d = s.useId(), u = s.useMemo(() => p.find((a) => a.guid === o), [o]), i = async (a) => {
12
+ await y({
13
13
  ...t,
14
- category_guid: e
15
- }), a && await d(e, t), n(""), c();
14
+ category_guid: o
15
+ }), a && await m(o, t), n(""), c();
16
16
  };
17
- return /* @__PURE__ */ h(w, {
17
+ return /* @__PURE__ */ b(w, {
18
18
  className: "mx-txn-edit-category-action",
19
- children: [/* @__PURE__ */ i(C, {
19
+ children: [/* @__PURE__ */ r(h, {
20
20
  initialSelected: t.category_guid,
21
21
  onClose: c,
22
22
  onSelect: (a) => n(a),
23
23
  showDrawer: !!t,
24
- title: o.actions_select_a_category
25
- }), /* @__PURE__ */ i(f, {
26
- copy: { title: s(o.actions_apply_to_all_transaction_types, t.description) },
27
- isOpen: !!e,
28
- onClose: () => r(!1),
29
- onPrimaryAction: () => r(!0),
30
- onSecondaryAction: () => r(!1),
31
- primaryText: o.actions_apply_to_all,
32
- secondaryText: o.actions_this_time_only,
33
- children: /* @__PURE__ */ i(S, {
24
+ title: e.actions_select_a_category
25
+ }), /* @__PURE__ */ r(C, {
26
+ "aria-describedby": d,
27
+ copy: { title: l(e.actions_apply_to_all_transaction_types, t.description) },
28
+ isOpen: !!o,
29
+ onClose: () => i(!1),
30
+ onPrimaryAction: () => i(!0),
31
+ onSecondaryAction: () => i(!1),
32
+ primaryText: e.actions_apply_to_all,
33
+ secondaryText: e.actions_this_time_only,
34
+ children: /* @__PURE__ */ r(S, {
35
+ id: d,
34
36
  variant: "subtitle1",
35
- children: s(o.actions_all_past_and_future, t.description, y?.name)
37
+ children: l(e.actions_all_past_and_future, /* @__PURE__ */ r("strong", { children: t.description }), u?.name)
36
38
  })
37
39
  })]
38
40
  });
@@ -1 +1 @@
1
- {"version":3,"file":"EditCategoryAction.es.js","names":[],"sources":["../../../../../src/transactions/components/transactionwidget/actions/EditCategoryAction.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\n\nimport { P } from '@mxenabled/mxui'\n\nimport { CategorySelectorDrawer } from '../../../../categories'\n\nimport { Dialog, useCategoryStore, useGlobalCopyStore } from '../../../../common'\nimport type { Transaction } from '../../../../core'\n\nimport { useTransactionStore } from '../../../../common'\nimport { buildDynamicCopy } from '../../../../core/utils/Localization'\n\ninterface EditCategoryActionProps {\n onClose: () => void\n transaction: Transaction\n}\n\nconst EditCategoryAction: React.FC<EditCategoryActionProps> = ({ onClose, transaction }) => {\n const { addOrUpdateTransactionRule, updateTransaction } = useTransactionStore()\n const { transactions: copy } = useGlobalCopyStore()\n\n const { categories } = useCategoryStore()\n\n const [categoryGuid, setCategoryGuid] = React.useState('')\n\n const category = React.useMemo(\n () => categories.find((item) => item.guid === categoryGuid),\n [categoryGuid],\n )\n\n const handleCategoryChanged = async (applyToAll: boolean) => {\n await updateTransaction({ ...transaction, category_guid: categoryGuid })\n if (applyToAll) {\n await addOrUpdateTransactionRule(categoryGuid, transaction)\n }\n\n setCategoryGuid('')\n onClose()\n }\n\n return (\n <Box className=\"mx-txn-edit-category-action\">\n <CategorySelectorDrawer\n initialSelected={transaction.category_guid}\n onClose={onClose}\n onSelect={(guid: string) => setCategoryGuid(guid)}\n showDrawer={!!transaction}\n title={copy.actions_select_a_category}\n />\n <Dialog\n copy={{\n title: buildDynamicCopy(\n copy.actions_apply_to_all_transaction_types,\n transaction.description,\n ) as string,\n }}\n isOpen={!!categoryGuid}\n onClose={() => handleCategoryChanged(false)}\n onPrimaryAction={() => handleCategoryChanged(true)}\n onSecondaryAction={() => handleCategoryChanged(false)}\n primaryText={copy.actions_apply_to_all}\n secondaryText={copy.actions_this_time_only}\n >\n <P variant=\"subtitle1\">\n {\n buildDynamicCopy(\n copy.actions_all_past_and_future,\n transaction.description,\n category?.name,\n ) as string\n }\n </P>\n </Dialog>\n </Box>\n )\n}\n\nexport default observer(EditCategoryAction)\n"],"mappings":";;;;;;;;;AAoBA,IAAM,IAAA,CAAyD,EAAE,SAAA,GAAS,aAAA,EAAA,MAAkB;AAC1F,QAAM,EAAE,4BAAA,GAA4B,mBAAA,EAAA,IAAsB,EAAoB,GACxE,EAAE,cAAc,EAAA,IAAS,EAAmB,GAE5C,EAAE,YAAA,EAAA,IAAe,EAAiB,GAElC,CAAC,GAAc,CAAA,IAAmB,EAAM,SAAS,EAAE,GAEnD,IAAW,EAAM,QAAA,MACf,EAAW,KAAA,CAAM,MAAS,EAAK,SAAS,CAAY,GAC1D,CAAC,CAAY,CACf,GAEM,IAAwB,OAAO,MAAwB;AAC3D,UAAM,EAAkB;AAAA,MAAE,GAAG;AAAA,MAAa,eAAe;AAAA,IAAa,CAAC,GACnE,KACF,MAAM,EAA2B,GAAc,CAAW,GAG5D,EAAgB,EAAE,GAClB,EAAQ;AAAA,EACV;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IAAK,WAAU;AAAA,IAAf,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,iBAAiB,EAAY;AAAA,MACpB,SAAA;AAAA,MACT,UAAA,CAAW,MAAiB,EAAgB,CAAI;AAAA,MAChD,YAAY,CAAC,CAAC;AAAA,MACd,OAAO,EAAK;AAAA,IACb,CAAA,GACD,gBAAA,EAAC,GAAD;AAAA,MACE,MAAM,EACJ,OAAO,EACL,EAAK,wCACL,EAAY,WACd,EACF;AAAA,MACA,QAAQ,CAAC,CAAC;AAAA,MACV,SAAA,MAAe,EAAsB,EAAK;AAAA,MAC1C,iBAAA,MAAuB,EAAsB,EAAI;AAAA,MACjD,mBAAA,MAAyB,EAAsB,EAAK;AAAA,MACpD,aAAa,EAAK;AAAA,MAClB,eAAe,EAAK;AAAA,MAEpB,UAAA,gBAAA,EAAC,GAAD;AAAA,QAAG,SAAQ;AAAA,QAEP,UAAA,EACE,EAAK,6BACL,EAAY,aACZ,GAAU,IACZ;AAAA,MAED,CAAA;AAAA,IACG,CAAA,CACL;AAAA;AAET,GAEA,IAAe,EAAS,CAAkB"}
1
+ {"version":3,"file":"EditCategoryAction.es.js","names":[],"sources":["../../../../../src/transactions/components/transactionwidget/actions/EditCategoryAction.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\n\nimport { P } from '@mxenabled/mxui'\n\nimport { CategorySelectorDrawer } from '../../../../categories'\n\nimport { Dialog, useCategoryStore, useGlobalCopyStore } from '../../../../common'\nimport type { Transaction } from '../../../../core'\n\nimport { useTransactionStore } from '../../../../common'\nimport { buildDynamicCopy } from '../../../../core/utils/Localization'\n\ninterface EditCategoryActionProps {\n onClose: () => void\n transaction: Transaction\n}\n\nconst EditCategoryAction: React.FC<EditCategoryActionProps> = ({ onClose, transaction }) => {\n const { addOrUpdateTransactionRule, updateTransaction } = useTransactionStore()\n const { transactions: copy } = useGlobalCopyStore()\n\n const { categories } = useCategoryStore()\n\n const [categoryGuid, setCategoryGuid] = React.useState('')\n const messageId = React.useId()\n\n const category = React.useMemo(\n () => categories.find((item) => item.guid === categoryGuid),\n [categoryGuid],\n )\n\n const handleCategoryChanged = async (applyToAll: boolean) => {\n await updateTransaction({ ...transaction, category_guid: categoryGuid })\n if (applyToAll) {\n await addOrUpdateTransactionRule(categoryGuid, transaction)\n }\n\n setCategoryGuid('')\n onClose()\n }\n\n return (\n <Box className=\"mx-txn-edit-category-action\">\n <CategorySelectorDrawer\n initialSelected={transaction.category_guid}\n onClose={onClose}\n onSelect={(guid: string) => setCategoryGuid(guid)}\n showDrawer={!!transaction}\n title={copy.actions_select_a_category}\n />\n <Dialog\n aria-describedby={messageId}\n copy={{\n title: buildDynamicCopy(\n copy.actions_apply_to_all_transaction_types,\n transaction.description,\n ) as string,\n }}\n isOpen={!!categoryGuid}\n onClose={() => handleCategoryChanged(false)}\n onPrimaryAction={() => handleCategoryChanged(true)}\n onSecondaryAction={() => handleCategoryChanged(false)}\n primaryText={copy.actions_apply_to_all}\n secondaryText={copy.actions_this_time_only}\n >\n <P id={messageId} variant=\"subtitle1\">\n {\n buildDynamicCopy(\n copy.actions_all_past_and_future,\n <strong>{transaction.description}</strong>,\n category?.name,\n ) as React.ReactNode\n }\n </P>\n </Dialog>\n </Box>\n )\n}\n\nexport default observer(EditCategoryAction)\n"],"mappings":";;;;;;;;;AAoBA,IAAM,IAAA,CAAyD,EAAE,SAAA,GAAS,aAAA,EAAA,MAAkB;AAC1F,QAAM,EAAE,4BAAA,GAA4B,mBAAA,EAAA,IAAsB,EAAoB,GACxE,EAAE,cAAc,EAAA,IAAS,EAAmB,GAE5C,EAAE,YAAA,EAAA,IAAe,EAAiB,GAElC,CAAC,GAAc,CAAA,IAAmB,EAAM,SAAS,EAAE,GACnD,IAAY,EAAM,MAAM,GAExB,IAAW,EAAM,QAAA,MACf,EAAW,KAAA,CAAM,MAAS,EAAK,SAAS,CAAY,GAC1D,CAAC,CAAY,CACf,GAEM,IAAwB,OAAO,MAAwB;AAC3D,UAAM,EAAkB;AAAA,MAAE,GAAG;AAAA,MAAa,eAAe;AAAA,IAAa,CAAC,GACnE,KACF,MAAM,EAA2B,GAAc,CAAW,GAG5D,EAAgB,EAAE,GAClB,EAAQ;AAAA,EACV;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IAAK,WAAU;AAAA,IAAf,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,iBAAiB,EAAY;AAAA,MACpB,SAAA;AAAA,MACT,UAAA,CAAW,MAAiB,EAAgB,CAAI;AAAA,MAChD,YAAY,CAAC,CAAC;AAAA,MACd,OAAO,EAAK;AAAA,IACb,CAAA,GACD,gBAAA,EAAC,GAAD;AAAA,MACE,oBAAkB;AAAA,MAClB,MAAM,EACJ,OAAO,EACL,EAAK,wCACL,EAAY,WACd,EACF;AAAA,MACA,QAAQ,CAAC,CAAC;AAAA,MACV,SAAA,MAAe,EAAsB,EAAK;AAAA,MAC1C,iBAAA,MAAuB,EAAsB,EAAI;AAAA,MACjD,mBAAA,MAAyB,EAAsB,EAAK;AAAA,MACpD,aAAa,EAAK;AAAA,MAClB,eAAe,EAAK;AAAA,MAEpB,UAAA,gBAAA,EAAC,GAAD;AAAA,QAAG,IAAI;AAAA,QAAW,SAAQ;AAAA,QAEtB,UAAA,EACE,EAAK,6BACL,gBAAA,EAAC,UAAD,EAAA,UAAS,EAAY,YAAoB,CAAA,GACzC,GAAU,IACZ;AAAA,MAED,CAAA;AAAA,IACG,CAAA,CACL;AAAA;AAET,GAEA,IAAe,EAAS,CAAkB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "9.7.165",
3
+ "version": "9.7.167",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",