@mx-cartographer/experiences 9.3.0-alpha.bb2 → 9.3.0
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 +42 -0
- package/dist/accounts/AccountsMiniWidget.es.js.map +1 -1
- package/dist/accounts/AccountsWidget.es.js.map +1 -1
- package/dist/accounts/ConnectMiniWidget.es.js.map +1 -1
- package/dist/accounts/components/AccountListItem.es.js.map +1 -1
- package/dist/accounts/components/AccountsList.es.js.map +1 -1
- package/dist/accounts/components/AccountsListCompact.es.js.map +1 -1
- package/dist/accounts/components/ConnectImage.es.js.map +1 -1
- package/dist/accounts/components/ConnectMiniWidgetCard.es.js.map +1 -1
- package/dist/accounts/components/ConnectionStatusIcons.es.js.map +1 -1
- package/dist/accounts/components/ConnectionsDrawer.es.js.map +1 -1
- package/dist/accounts/components/detailsdrawer/Accounts/AccountActions.es.js +40 -37
- package/dist/accounts/components/detailsdrawer/Accounts/AccountActions.es.js.map +1 -1
- package/dist/accounts/components/detailsdrawer/Accounts/AccountActionsRow.es.js.map +1 -1
- package/dist/accounts/components/detailsdrawer/Accounts/AccountConnection.es.js.map +1 -1
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailEdit.es.js.map +1 -1
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetails.es.js.map +1 -1
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.es.js.map +1 -1
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsContent.es.js.map +1 -1
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsDrawer.es.js.map +1 -1
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.es.js.map +1 -1
- package/dist/accounts/components/detailsdrawer/Accounts/ConnectionErrorMessage.es.js.map +1 -1
- package/dist/accounts/components/detailsdrawer/Transactions/TransactionsTab.es.js.map +1 -1
- package/dist/accounts/utils/AccountFields.es.js +4 -1
- package/dist/accounts/utils/AccountFields.es.js.map +1 -1
- package/dist/analytics/SurveyMiniWidget.es.js.map +1 -1
- package/dist/analytics/components/RatingScale.es.js.map +1 -1
- package/dist/budgets/BubbleBudgetsMiniWidget.es.js +46 -44
- package/dist/budgets/BubbleBudgetsMiniWidget.es.js.map +1 -1
- package/dist/budgets/BubbleBudgetsWidget.es.js.map +1 -1
- package/dist/budgets/components/AddBudgets.es.js.map +1 -1
- package/dist/budgets/components/BubbleBudgets.es.js.map +1 -1
- package/dist/budgets/components/BubbleChart.es.js +12 -12
- package/dist/budgets/components/BubbleChart.es.js.map +1 -1
- package/dist/budgets/components/BudgetDetailsDrawer.es.js.map +1 -1
- package/dist/budgets/components/BudgetDetailsDrawerV2.es.js.map +1 -1
- package/dist/budgets/components/BudgetList.es.js.map +1 -1
- package/dist/budgets/components/MerchantBudgetDetailsDrawer.es.js.map +1 -1
- package/dist/budgets/components/Overview.es.js.map +1 -1
- package/dist/budgets/components/addbudget/Header.es.js.map +1 -1
- package/dist/budgets/components/addbudget/RecalculateBudgets.es.js.map +1 -1
- package/dist/budgets/components/addbudget/UnbudgetedRow.es.js.map +1 -1
- package/dist/budgets/components/bubblechart/Bubble.es.js.map +1 -1
- package/dist/budgets/components/bubblechart/Mercury.es.js +13 -11
- package/dist/budgets/components/bubblechart/Mercury.es.js.map +1 -1
- package/dist/budgets/components/budgetdetails/AddSubBudget.es.js.map +1 -1
- package/dist/budgets/components/budgetdetails/BudgetDetails.es.js.map +1 -1
- package/dist/budgets/components/budgetdetails/Header.es.js.map +1 -1
- package/dist/budgets/components/budgetdetails/SubBudgetList.es.js.map +1 -1
- package/dist/budgets/components/budgetlist/BudgetRow.es.js.map +1 -1
- package/dist/budgets/components/budgetlist/SubBudgetRow.es.js.map +1 -1
- package/dist/budgets/components/budgetlist/SubBudgetZeroState.es.js.map +1 -1
- package/dist/budgets/components/shared/BudgetAmount.es.js.map +1 -1
- package/dist/budgets/components/shared/BudgetDetailsTopSection.es.js.map +1 -1
- package/dist/budgets/utils/BubblesSVG.es.js +10 -10
- package/dist/budgets/utils/BubblesSVG.es.js.map +1 -1
- package/dist/cashflow/CashflowMiniWidget.es.js.map +1 -1
- package/dist/cashflow/CashflowOnboarding.es.js.map +1 -1
- package/dist/cashflow/CashflowWidget.es.js.map +1 -1
- package/dist/cashflow/components/CashflowAmountHeading.es.js.map +1 -1
- package/dist/cashflow/components/CashflowContent.es.js.map +1 -1
- package/dist/cashflow/components/CashflowHeading.es.js.map +1 -1
- package/dist/cashflow/components/CashflowWidgetContent.es.js.map +1 -1
- package/dist/cashflow/components/DetailsExpenseHeader.es.js.map +1 -1
- package/dist/cashflow/components/DetailsExpenseRow.es.js.map +1 -1
- package/dist/cashflow/components/DetailsFooter.es.js.map +1 -1
- package/dist/cashflow/components/DetailsTab.es.js.map +1 -1
- package/dist/cashflow/components/RemainingCash.es.js.map +1 -1
- package/dist/cashflow/components/SummaryTab.es.js.map +1 -1
- package/dist/cashflow/components/onboarding/StepOne.es.js.map +1 -1
- package/dist/cashflow/components/onboarding/StepTwo.es.js.map +1 -1
- package/dist/categories/components/CategoryList.es.js +24 -24
- package/dist/categories/components/CategoryList.es.js.map +1 -1
- package/dist/categories/components/CategoryRow.es.js +6 -6
- package/dist/categories/components/CategoryRow.es.js.map +1 -1
- package/dist/categories/components/CategorySelector.es.js +36 -32
- package/dist/categories/components/CategorySelector.es.js.map +1 -1
- package/dist/categories/components/CategorySelectorDrawer.es.js.map +1 -1
- package/dist/categories/components/CustomCategories/AddSubcategory.es.js.map +1 -1
- package/dist/categories/components/CustomCategories/CustomCategoryModal.es.js +0 -1
- package/dist/categories/components/CustomCategories/CustomCategoryModal.es.js.map +1 -1
- package/dist/categories/components/SubcategoryList.es.js.map +1 -1
- package/dist/categories/components/SubcategoryRow.es.js.map +1 -1
- package/dist/common/components/Banner.es.js.map +1 -1
- package/dist/common/components/ConnectCard.es.js.map +1 -1
- package/dist/common/components/ConnectDrawer.es.js.map +1 -1
- package/dist/common/components/ConnectStatus.es.js.map +1 -1
- package/dist/common/components/CurrencyDialog.es.js.map +1 -1
- package/dist/common/components/CurrencyInput.es.js +11 -11
- package/dist/common/components/CurrencyText.es.js.map +1 -1
- package/dist/common/components/DataRow.es.js +7 -7
- package/dist/common/components/DataRow.es.js.map +1 -1
- package/dist/common/components/EmptyState.es.js.map +1 -1
- package/dist/common/components/Error.es.js.map +1 -1
- package/dist/common/components/ErrorBoundary.es.js.map +1 -1
- package/dist/common/components/GlobalAccountFilter.es.js.map +1 -1
- package/dist/common/components/IconBacking.es.js.map +1 -1
- package/dist/common/components/InformationTooltip.es.js.map +1 -1
- package/dist/common/components/ListItemAction.es.js.map +1 -1
- package/dist/common/components/ListItemRow.es.js +1 -1
- package/dist/common/components/ListItemRow.es.js.map +1 -1
- package/dist/common/components/ListItemWrapper.es.js.map +1 -1
- package/dist/common/components/Loader.es.js.map +1 -1
- package/dist/common/components/MicroWidgetContainer.es.js.map +1 -1
- package/dist/common/components/MiniWidgetContainer.es.js.map +1 -1
- package/dist/common/components/ResponsiveButton.es.js.map +1 -1
- package/dist/common/components/SearchBox.es.js.map +1 -1
- package/dist/common/components/Select.es.js.map +1 -1
- package/dist/common/components/SelectionBox.es.js.map +1 -1
- package/dist/common/components/SkeletonLoader.es.js.map +1 -1
- package/dist/common/components/SubheaderRow.es.js.map +1 -1
- package/dist/common/components/TabContentContainer.es.js.map +1 -1
- package/dist/common/components/TinyBarChart.es.js.map +1 -1
- package/dist/common/components/WidgetContainer.es.js.map +1 -1
- package/dist/common/components/WidgetDateRangeSelector.es.js +28 -28
- package/dist/common/components/WidgetDateRangeSelector.es.js.map +1 -1
- package/dist/common/components/addaccounts/AddAccounts.es.js +13 -13
- package/dist/common/components/addaccounts/AddAccounts.es.js.map +1 -1
- package/dist/common/components/calendar/Calendar.es.js.map +1 -1
- package/dist/common/components/calendar/Day.es.js.map +1 -1
- package/dist/common/components/calendar/Header.es.js +26 -23
- package/dist/common/components/calendar/Header.es.js.map +1 -1
- package/dist/common/components/charts/Donut.es.js.map +1 -1
- package/dist/common/components/charts/LineChart.es.js.map +1 -1
- package/dist/common/components/charts/StackedLineChart.es.js.map +1 -1
- package/dist/common/components/charts/StatusBar.es.js.map +1 -1
- package/dist/common/components/charts/linechart/CustomLegend.es.js.map +1 -1
- package/dist/common/components/charts/linechart/CustomLine.es.js.map +1 -1
- package/dist/common/components/charts/linechart/CustomMark.es.js.map +1 -1
- package/dist/common/components/charts/linechart/CustomTooltip.es.js.map +1 -1
- package/dist/common/components/charts/stackedlinechart/CategoryIconLabel.es.js.map +1 -1
- package/dist/common/components/charts/stackedlinechart/CustomAreaTooltip.es.js.map +1 -1
- package/dist/common/components/charts/stackedlinechart/CustomLegend.es.js.map +1 -1
- package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.es.js.map +1 -1
- package/dist/common/components/daterangeselector/DateRangeSelector.d.ts +14 -0
- package/dist/common/components/daterangeselector/DateRangeSelector.es.js +113 -101
- package/dist/common/components/daterangeselector/DateRangeSelector.es.js.map +1 -1
- package/dist/common/components/dialog/Dialog.es.js.map +1 -1
- package/dist/common/components/donuts/MultiSegmentDonut.es.js.map +1 -1
- package/dist/common/components/donuts/SingleSegmentDonut.es.js.map +1 -1
- package/dist/common/components/drawer/Drawer.es.js.map +1 -1
- package/dist/common/components/drawer/Footer.es.js.map +1 -1
- package/dist/common/components/drawer/Header.es.js.map +1 -1
- package/dist/common/components/globalaccountfilter/GlobalAccountFilterList.es.js +71 -87
- package/dist/common/components/globalaccountfilter/GlobalAccountFilterList.es.js.map +1 -1
- package/dist/common/components/listitems/CollapseExpandListItem.es.js +4 -4
- package/dist/common/components/listitems/CollapseExpandListItem.es.js.map +1 -1
- package/dist/common/components/listitems/ToggleButtonListItem.es.js +6 -6
- package/dist/common/components/listitems/ToggleButtonListItem.es.js.map +1 -1
- package/dist/common/components/listitems/ToggleListItem.es.js.map +1 -1
- package/dist/common/hooks/useAriaLive.es.js.map +1 -1
- package/dist/common/utils/AccountFilter.es.js.map +1 -1
- package/dist/core/constants/Category.es.js.map +1 -1
- package/dist/core/stores/CategoryStore.d.ts +2 -0
- package/dist/core/stores/CategoryStore.es.js +55 -47
- package/dist/core/stores/CategoryStore.es.js.map +1 -1
- package/dist/core/stores/DebtsStore.es.js +10 -10
- package/dist/core/stores/DebtsStore.es.js.map +1 -1
- package/dist/core/stores/FinstrongStore.es.js +4 -4
- package/dist/core/stores/FinstrongStore.es.js.map +1 -1
- package/dist/core/stores/TrendsStore.es.js +6 -6
- package/dist/core/types/Account.es.js.map +1 -1
- package/dist/core/utils/DateUtil.es.js +24 -23
- package/dist/core/utils/DateUtil.es.js.map +1 -1
- package/dist/core/utils/DebtUtils.es.js +28 -28
- package/dist/core/utils/DebtUtils.es.js.map +1 -1
- package/dist/core/utils/GoalsUtil.es.js +11 -8
- package/dist/core/utils/GoalsUtil.es.js.map +1 -1
- package/dist/core/utils/InvestmentUtil.es.js +26 -23
- package/dist/core/utils/InvestmentUtil.es.js.map +1 -1
- package/dist/core/utils/NotificationUtils.es.js +11 -8
- package/dist/core/utils/NotificationUtils.es.js.map +1 -1
- package/dist/core/utils/RecurringTransactionsUtil.es.js +5 -8
- package/dist/core/utils/RecurringTransactionsUtil.es.js.map +1 -1
- package/dist/core/utils/SettingsUtil.es.js.map +1 -1
- package/dist/core/utils/TransactionUtils.es.js.map +1 -1
- package/dist/dashboard/Dashboard.es.js.map +1 -1
- package/dist/dashboard/Greeting.es.js.map +1 -1
- package/dist/debts/DebtsWidget.es.js.map +1 -1
- package/dist/debts/components/DebtDrawer.es.js.map +1 -1
- package/dist/debts/components/DebtsChart.es.js +36 -36
- package/dist/debts/components/DebtsChart.es.js.map +1 -1
- package/dist/debts/components/DebtsTable.es.js +13 -13
- package/dist/debts/components/DebtsTable.es.js.map +1 -1
- package/dist/debts/components/PaydownDrawer.es.js.map +1 -1
- package/dist/debts/components/SnowballCard.es.js.map +1 -1
- package/dist/debts/components/SnowballDrawer.es.js.map +1 -1
- package/dist/debts/components/actions/DebtsPriorityAction.es.js +23 -23
- package/dist/debts/components/actions/DebtsPriorityAction.es.js.map +1 -1
- package/dist/debts/components/actions/ExtraPaymentAction.es.js.map +1 -1
- package/dist/debts/components/actions/InterestRateAction.es.js.map +1 -1
- package/dist/debts/components/actions/MonthlyPaymentAction.es.js.map +1 -1
- package/dist/debts/components/actions/OriginalBalanceAction.es.js.map +1 -1
- package/dist/debts/components/debtsdrawer/DebtDetailsChart.es.js.map +1 -1
- package/dist/debts/components/debtsdrawer/DebtDetailsContent.es.js.map +1 -1
- package/dist/debts/components/debtsdrawer/DebtDetailsTab.es.js.map +1 -1
- package/dist/debts/components/debtsdrawer/DebtScheduleTab.es.js.map +1 -1
- package/dist/debts/components/debtsdrawer/DebtStatusCard.es.js.map +1 -1
- package/dist/debts/components/debtspaydown/PaydownButton.es.js.map +1 -1
- package/dist/debts/components/debtspaydown/PaydownContent.es.js.map +1 -1
- package/dist/debts/components/debtspriority/DebtsPriorityButton.es.js.map +1 -1
- package/dist/debts/components/debtspriority/DebtsPrioriyPopover.es.js.map +1 -1
- package/dist/debts/components/debtstable/AccountCell.es.js.map +1 -1
- package/dist/debts/components/debtstable/PriorityCell.es.js.map +1 -1
- package/dist/finstrong/FinancialStrengthCard.es.js.map +1 -1
- package/dist/finstrong/FinstrongWidget.es.js.map +1 -1
- package/dist/finstrong/components/ConnectMoreAccountsCard.es.js.map +1 -1
- package/dist/finstrong/components/CreditScore/CreditScoreContent.es.js.map +1 -1
- package/dist/finstrong/components/CreditScore/CreditScoreHeader.es.js.map +1 -1
- package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.es.js.map +1 -1
- package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.es.js.map +1 -1
- package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.es.js.map +1 -1
- package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.es.js.map +1 -1
- package/dist/finstrong/components/HealthChart.es.js.map +1 -1
- package/dist/finstrong/components/KeyIndicatorsBorrowTab.es.js.map +1 -1
- package/dist/finstrong/components/KeyIndicatorsDrawer.es.js.map +1 -1
- package/dist/finstrong/components/KeyIndicatorsSaveTab.es.js.map +1 -1
- package/dist/finstrong/components/KeyIndicatorsSpendTab.es.js.map +1 -1
- package/dist/finstrong/components/KeyIndicatorsTabItem.es.js.map +1 -1
- package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.es.js.map +1 -1
- package/dist/finstrong/components/KeyIndicatorsTabsWidget.es.js.map +1 -1
- package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.es.js.map +1 -1
- package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.es.js.map +1 -1
- package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.es.js.map +1 -1
- package/dist/finstrong/components/ManageCreditScore.es.js.map +1 -1
- package/dist/finstrong/components/ManageDOB.es.js.map +1 -1
- package/dist/finstrong/components/MissingData.es.js.map +1 -1
- package/dist/finstrong/components/ProfileDrawer.es.js.map +1 -1
- package/dist/finstrong/components/ProfileList.es.js.map +1 -1
- package/dist/finstrong/components/ProfileProgressBar.es.js.map +1 -1
- package/dist/finstrong/components/ProgressBar.es.js.map +1 -1
- package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.es.js.map +1 -1
- package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.es.js.map +1 -1
- package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.es.js.map +1 -1
- package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.es.js.map +1 -1
- package/dist/finstrong/components/ScoreHistoryDrawer.es.js.map +1 -1
- package/dist/finstrong/components/ScoreRubricDrawer.es.js.map +1 -1
- package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.es.js.map +1 -1
- package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.es.js.map +1 -1
- package/dist/finstrong/components/StatusChip.es.js.map +1 -1
- package/dist/finstrong/components/onboarding/Onboarding.es.js.map +1 -1
- package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.es.js.map +1 -1
- package/dist/finstrong/components/onboarding/OnboardingBirthday.es.js.map +1 -1
- package/dist/finstrong/components/onboarding/OnboardingCreditScore.es.js.map +1 -1
- package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.es.js +15 -18
- package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.es.js.map +1 -1
- package/dist/finstrong/components/onboarding/OnboardingStepsHeader.es.js.map +1 -1
- package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.es.js.map +1 -1
- package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.es.js.map +1 -1
- package/dist/finstrong/components/shared/Accounts.es.js.map +1 -1
- package/dist/finstrong/components/shared/CustomDoubleBarPlot.es.js.map +1 -1
- package/dist/finstrong/components/shared/CustomPieArc.es.js.map +1 -1
- package/dist/finstrong/components/shared/DialScoreCard.es.js +27 -27
- package/dist/finstrong/components/shared/DialScoreCard.es.js.map +1 -1
- package/dist/finstrong/components/shared/DoubleBarChart.es.js.map +1 -1
- package/dist/finstrong/components/shared/LineGraph.es.js +20 -19
- package/dist/finstrong/components/shared/LineGraph.es.js.map +1 -1
- package/dist/finstrong/components/shared/ScoreHistoryTimeline.es.js +28 -28
- package/dist/finstrong/components/shared/ScoreHistoryTimeline.es.js.map +1 -1
- package/dist/finstrong/components/shared/ScoreHistoryTimelineItem.es.js.map +1 -1
- package/dist/finstrong/components/shared/TotalCard.es.js.map +1 -1
- package/dist/finstrong/components/shared/Transactions.es.js.map +1 -1
- package/dist/finstrong/util/finstrongUtils.es.js +4 -1
- package/dist/finstrong/util/finstrongUtils.es.js.map +1 -1
- package/dist/goals/GoalsMicroWidget.es.js.map +1 -1
- package/dist/goals/GoalsWidget.es.js.map +1 -1
- package/dist/goals/components/AccountSelectionDrawer.es.js.map +1 -1
- package/dist/goals/components/AddGoal.es.js.map +1 -1
- package/dist/goals/components/GoalDetails.es.js.map +1 -1
- package/dist/goals/components/GoalDetailsDrawer.es.js.map +1 -1
- package/dist/goals/components/GoalList.es.js.map +1 -1
- package/dist/goals/components/GoalStatusCard.es.js.map +1 -1
- package/dist/goals/components/ManageGoals.es.js.map +1 -1
- package/dist/goals/components/TabTitle.es.js.map +1 -1
- package/dist/goals/components/actions/AccountAction.es.js.map +1 -1
- package/dist/goals/components/actions/AddRetirementAccountAction.es.js.map +1 -1
- package/dist/goals/components/actions/AmountToSaveAction.es.js.map +1 -1
- package/dist/goals/components/actions/BirthdayAction.es.js.map +1 -1
- package/dist/goals/components/actions/ChangeAccountAction.es.js.map +1 -1
- package/dist/goals/components/actions/ContributionAction.es.js.map +1 -1
- package/dist/goals/components/actions/GoalNameAction.es.js.map +1 -1
- package/dist/goals/components/actions/InterestRateAction.es.js.map +1 -1
- package/dist/goals/components/actions/MonthlyPaymentAction.es.js.map +1 -1
- package/dist/goals/components/actions/OriginalBalanceAction.es.js.map +1 -1
- package/dist/goals/components/actions/RetirementAgeAction.es.js.map +1 -1
- package/dist/goals/components/addgoal/AddGoalListItem.es.js +5 -5
- package/dist/goals/components/addgoal/AddGoalListItem.es.js.map +1 -1
- package/dist/goals/components/managegoals/CompleteListItem.es.js.map +1 -1
- package/dist/goals/components/managegoals/OngoingListItem.es.js.map +1 -1
- package/dist/goals/components/micro/GoalMicroStatusCard.es.js.map +1 -1
- package/dist/goals/components/micro/GoalsMicroEmptyState.es.js.map +1 -1
- package/dist/help/HelpWidget.es.js.map +1 -1
- package/dist/help/components/Help.es.js.map +1 -1
- package/dist/help/components/HelpList.es.js +32 -32
- package/dist/help/components/HelpList.es.js.map +1 -1
- package/dist/help/components/content/BottomImageContent.es.js.map +1 -1
- package/dist/help/components/content/ContentItem.es.js.map +1 -1
- package/dist/help/components/content/Header.es.js.map +1 -1
- package/dist/help/components/content/LeftImageContent.es.js.map +1 -1
- package/dist/help/components/content/NoImageContent.es.js.map +1 -1
- package/dist/help/components/content/RightImageContent.es.js.map +1 -1
- package/dist/help/components/content/TopImageContent.es.js.map +1 -1
- package/dist/help/components/requestsupport/ContactSupport.es.js.map +1 -1
- package/dist/help/components/requestsupport/HelpByCategoryList.es.js.map +1 -1
- package/dist/help/components/requestsupport/MissingInstitution.es.js.map +1 -1
- package/dist/help/components/requestsupport/PopularTopicsDrawer.es.js.map +1 -1
- package/dist/help/components/requestsupport/PopularTopicsList.es.js.map +1 -1
- package/dist/help/components/requestsupport/PopularTopicsRow.es.js +6 -6
- package/dist/help/components/requestsupport/PopularTopicsRow.es.js.map +1 -1
- package/dist/help/components/requestsupport/RequestSupport.es.js.map +1 -1
- package/dist/help/components/requestsupport/RequestSupportFooter.es.js.map +1 -1
- package/dist/help/components/requestsupport/RequestSupportHeader.es.js.map +1 -1
- package/dist/help/components/requestsupport/RequestSupportInstitution.es.js.map +1 -1
- package/dist/help/components/requestsupport/SupportSuccessMessage.es.js.map +1 -1
- package/dist/insights/components/feed/Header.es.js.map +1 -1
- package/dist/insights/components/insights/AmericanUpcomingTaxDeadlineAlert/AmericanUpcomingTaxDeadlineAlert.es.js.map +1 -1
- package/dist/insights/components/insights/BillAmountNotStandard/BillAmountNotStandard.es.js.map +1 -1
- package/dist/insights/components/insights/BillAmountNotStandard/BillAmountNotStandardMUI.es.js.map +1 -1
- package/dist/insights/components/insights/CashBack/CashBack.es.js.map +1 -1
- package/dist/insights/components/insights/CategoryBudget/CategoryBudget.es.js +17 -17
- package/dist/insights/components/insights/CategoryBudget/CategoryBudget.es.js.map +1 -1
- package/dist/insights/components/insights/CategorySpendingV2/CategorySpendingV2.es.js.map +1 -1
- package/dist/insights/components/insights/CategorySpendingV2/CategorySpendingV2MUI.es.js.map +1 -1
- package/dist/insights/components/insights/CelebrateCreditCardPayoff/CelebrateCreditCardPayoff.es.js.map +1 -1
- package/dist/insights/components/insights/CustomTransaction/CustomTransaction.es.js.map +1 -1
- package/dist/insights/components/insights/DiscoveredAccounts/DiscoveredAccountsBody.es.js.map +1 -1
- package/dist/insights/components/insights/DiscoveredAccounts/DiscoveredAccountsLearnMoreDrawerContent.es.js +6 -6
- package/dist/insights/components/insights/DiscoveredAccounts/DiscoveredAccountsLearnMoreDrawerContent.es.js.map +1 -1
- package/dist/insights/components/insights/DiscoveredAccounts/DiscoveredAccountsMiniInsight.es.js.map +1 -1
- package/dist/insights/components/insights/FederalBankHoliday/FederalBankHoliday.es.js.map +1 -1
- package/dist/insights/components/insights/FederalBankHoliday/FederalBankHolidayMUI.es.js.map +1 -1
- package/dist/insights/components/insights/MarketingHub/Offer.es.js.map +1 -1
- package/dist/insights/components/insights/MonthlyDebtToIncomeComparisonV2/MonthlyDebtToIncomeComparisonV2.es.js.map +1 -1
- package/dist/insights/components/insights/MonthlyEmergencyFundReview/LastMonthsContributionSection.es.js.map +1 -1
- package/dist/insights/components/insights/MonthlyEmergencyFundReview/MonthlyEmergencyFundReviewBody.es.js +38 -35
- package/dist/insights/components/insights/MonthlyEmergencyFundReview/MonthlyEmergencyFundReviewBody.es.js.map +1 -1
- package/dist/insights/components/insights/MonthlyEmergencyFundReview/ProjectedCompletionSection.es.js.map +1 -1
- package/dist/insights/components/insights/MonthlyEmergencyFundReview/TotalSection.es.js.map +1 -1
- package/dist/insights/components/insights/MonthlySavingsToIncomeComparison/MonthlySavingsToIncomeComparison.es.js.map +1 -1
- package/dist/insights/components/insights/MonthlySpendToIncomeComparisonV2/MonthlySpendToIncomeComparisonV2.es.js.map +1 -1
- package/dist/insights/components/insights/MonthlySpendingComparisonV2/MonthlySpendingComparisonV2.es.js.map +1 -1
- package/dist/insights/components/insights/P2pCategorization/P2pCategorization.es.js.map +1 -1
- package/dist/insights/components/insights/P2pCategorization/shared/P2pCategorizationMultipleTransactions.es.js.map +1 -1
- package/dist/insights/components/insights/P2pCategorization/shared/P2pCategorizationSingleTransaction.es.js.map +1 -1
- package/dist/insights/components/insights/SavingsAccountBalancesSummary/SavingsAccountBalancesSummary.es.js.map +1 -1
- package/dist/insights/components/insights/SharedDeposit/SharedDeposit.es.js.map +1 -1
- package/dist/insights/components/insights/SwitchDirectDeposit/AccountBox.es.js.map +1 -1
- package/dist/insights/components/insights/SwitchDirectDeposit/SwitchDirectDepositMainContainer.es.js.map +1 -1
- package/dist/insights/components/insights/UnifiedDeposit/UnifiedDeposit.es.js.map +1 -1
- package/dist/insights/components/insights/UnifiedDeposit/UnifiedDepositBody.es.js.map +1 -1
- package/dist/insights/components/insights/UserFeedback/UserFeedback.es.js.map +1 -1
- package/dist/insights/components/insights/WeeklyNoSpendDays/BubbleWeek.es.js.map +1 -1
- package/dist/insights/components/insights/WeeklyNoSpendDays/WeeklyNoSpendDays.es.js.map +1 -1
- package/dist/insights/components/shared/ChartDrawerTemplate/ChartDrawerTemplate.es.js +22 -22
- package/dist/insights/components/shared/ChartDrawerTemplate/ChartDrawerTemplate.es.js.map +1 -1
- package/dist/insights/components/shared/ChartDrawerTemplate/TipSection.es.js.map +1 -1
- package/dist/insights/components/shared/ChartTransactionWithDrillDown.es.js.map +1 -1
- package/dist/insights/components/shared/Charts/BarChart/BarChart.es.js.map +1 -1
- package/dist/insights/components/shared/Charts/BarChart/BarChartV2.es.js.map +1 -1
- package/dist/insights/components/shared/Charts/BarChart/ChartLegend.es.js.map +1 -1
- package/dist/insights/components/shared/Charts/BarChart/ChartLegendV2.es.js.map +1 -1
- package/dist/insights/components/shared/Charts/BarChart/CustomBarPlot.es.js.map +1 -1
- package/dist/insights/components/shared/Charts/BarChart/CustomBarPlotV2.es.js.map +1 -1
- package/dist/insights/components/shared/Charts/BarChart/CustomDoubleBarPlot.es.js.map +1 -1
- package/dist/insights/components/shared/Charts/BarChart/CustomDoubleBarPlotMXUI.es.js.map +1 -1
- package/dist/insights/components/shared/Charts/BarChart/DoubleBarChart.es.js.map +1 -1
- package/dist/insights/components/shared/Charts/BarChart/DoubleBarChartLegend.es.js.map +1 -1
- package/dist/insights/components/shared/Charts/BarChart/DoubleBarChartLegendMXUI.es.js.map +1 -1
- package/dist/insights/components/shared/Charts/BarChart/DoubleBarChartMXUI.es.js.map +1 -1
- package/dist/insights/components/shared/ConnectionCard.es.js.map +1 -1
- package/dist/insights/components/shared/Coupon.es.js.map +1 -1
- package/dist/insights/components/shared/DeepLinks/DeepLinkDialog.es.js.map +1 -1
- package/dist/insights/components/shared/DeepLinks/DirectDeposit/DirectDepositDeepLink.es.js.map +1 -1
- package/dist/insights/components/shared/DeepLinks/DirectDeposit/Dot.es.js.map +1 -1
- package/dist/insights/components/shared/DirectDeposit/DirectDeposit.es.js.map +1 -1
- package/dist/insights/components/shared/DirectDeposit/DirectDepositSubHeader.es.js.map +1 -1
- package/dist/insights/components/shared/DirectDeposit/FullFeedBodyHeader.es.js.map +1 -1
- package/dist/insights/components/shared/DirectDeposit/LeftBox.es.js.map +1 -1
- package/dist/insights/components/shared/DirectDeposit/MiniBodyHeader.es.js.map +1 -1
- package/dist/insights/components/shared/DirectDeposit/RightBox.es.js.map +1 -1
- package/dist/insights/components/shared/DiscoveredAccountsConnect.es.js.map +1 -1
- package/dist/insights/components/shared/DrillDownCalculation/BalanceStepper.es.js.map +1 -1
- package/dist/insights/components/shared/DrillDownCalculation/DrillDownCalculation.es.js.map +1 -1
- package/dist/insights/components/shared/ErrorCard/ErrorCard.es.js.map +1 -1
- package/dist/insights/components/shared/GenericFeedback/FeedbackButtons.es.js.map +1 -1
- package/dist/insights/components/shared/GenericFeedback/FeedbackDescription.es.js.map +1 -1
- package/dist/insights/components/shared/GenericFeedback/FeedbackHeader.es.js.map +1 -1
- package/dist/insights/components/shared/GenericFeedback/FeedbackOptions.es.js.map +1 -1
- package/dist/insights/components/shared/GenericFeedback/FeedbackText.es.js.map +1 -1
- package/dist/insights/components/shared/GoalProgress.es.js.map +1 -1
- package/dist/insights/components/shared/GradientBox.es.js.map +1 -1
- package/dist/insights/components/shared/InsightsCard/BeatCard.es.js.map +1 -1
- package/dist/insights/components/shared/InsightsCard/BeatCardMUI.es.js.map +1 -1
- package/dist/insights/components/shared/InsightsCard/CardButtonSection.es.js.map +1 -1
- package/dist/insights/components/shared/InsightsCard/CardError.es.js.map +1 -1
- package/dist/insights/components/shared/InsightsCard/CardFooter.es.js.map +1 -1
- package/dist/insights/components/shared/InsightsCard/CardLoading.es.js.map +1 -1
- package/dist/insights/components/shared/InsightsCard/ClientConfigurableCta.es.js.map +1 -1
- package/dist/insights/components/shared/InsightsCard/ContentAndDescription.es.js.map +1 -1
- package/dist/insights/components/shared/InsightsCard/ContentAndDescriptionMUI.es.js.map +1 -1
- package/dist/insights/components/shared/InsightsCard/Description.es.js.map +1 -1
- package/dist/insights/components/shared/InsightsCard/DescriptionMUI.es.js.map +1 -1
- package/dist/insights/components/shared/InsightsCard/EmbeddedCard.es.js.map +1 -1
- package/dist/insights/components/shared/InsightsCard/FeedbackCard.es.js +4 -4
- package/dist/insights/components/shared/InsightsCard/FeedbackCard.es.js.map +1 -1
- package/dist/insights/components/shared/InsightsCard/InsightButton.es.js.map +1 -1
- package/dist/insights/components/shared/MenuAction.es.js +4 -4
- package/dist/insights/components/shared/MenuAction.es.js.map +1 -1
- package/dist/insights/components/shared/MiniInsightCard.es.js.map +1 -1
- package/dist/insights/components/shared/P2P/P2PMultipleCategorization.es.js +23 -23
- package/dist/insights/components/shared/P2P/P2PMultipleCategorization.es.js.map +1 -1
- package/dist/insights/components/shared/P2PCategorizationSingleAccount/P2PCategorizationSingleAccount.es.js +24 -24
- package/dist/insights/components/shared/P2PCategorizationSingleAccount/P2PCategorizationSingleAccount.es.js.map +1 -1
- package/dist/insights/components/shared/ProgressBar.es.js.map +1 -1
- package/dist/insights/components/shared/SaveAnExtra100/SaveAnExtra100.es.js.map +1 -1
- package/dist/insights/components/shared/SaveEnoughToLiveOnBottomSection.es.js.map +1 -1
- package/dist/insights/components/shared/StatusIndicator.es.js.map +1 -1
- package/dist/insights/components/shared/ThemedSVGImage.es.js.map +1 -1
- package/dist/insights/components/shared/TransactionCard.es.js.map +1 -1
- package/dist/insights/components/shared/ZeroState/LinedCardZeroState.es.js.map +1 -1
- package/dist/investments/InvestmentsWidget.es.js.map +1 -1
- package/dist/investments/components/Allocation.es.js.map +1 -1
- package/dist/investments/components/Analysis.es.js.map +1 -1
- package/dist/investments/components/AnalysisDetails.es.js.map +1 -1
- package/dist/investments/components/EmptyStateFooterComponent.es.js.map +1 -1
- package/dist/investments/components/HeaderCell.es.js.map +1 -1
- package/dist/investments/components/HoldingDrawer.es.js.map +1 -1
- package/dist/investments/components/HoldingTable.es.js +167 -164
- package/dist/investments/components/HoldingTable.es.js.map +1 -1
- package/dist/investments/components/InfoToolTip.es.js.map +1 -1
- package/dist/investments/components/Overview.es.js.map +1 -1
- package/dist/investments/components/TabTitle.es.js.map +1 -1
- package/dist/investments/components/allocation/InvestementAllocationList.es.js.map +1 -1
- package/dist/investments/components/allocation/InvestmentsAllocationChart.es.js.map +1 -1
- package/dist/merchants/components/MerchantLookup.es.js.map +1 -1
- package/dist/microinsights/InsightsMicroWidget.es.js.map +1 -1
- package/dist/microinsights/MicroCardTemplate.es.js.map +1 -1
- package/dist/microinsights/Spinner.es.js.map +1 -1
- package/dist/microinsights/beaticons/BeatCategoryIcon.es.js +8 -8
- package/dist/microinsights/beaticons/BeatCategoryIcon.es.js.map +1 -1
- package/dist/microinsights/beaticons/BeatMaterialIcon.es.js.map +1 -1
- package/dist/microinsights/beaticons/ChartFilledIcon.es.js.map +1 -1
- package/dist/microinsights/beaticons/ZeroStateIcon.es.js.map +1 -1
- package/dist/microinsights/cards/ViewMoreMicroCard.d.ts +1 -0
- package/dist/microinsights/cards/ViewMoreMicroCard.es.js.map +1 -1
- package/dist/microinsights/carousel/BeatList.es.js +17 -17
- package/dist/microinsights/carousel/BeatList.es.js.map +1 -1
- package/dist/microinsights/carousel/CarouselControls.es.js.map +1 -1
- package/dist/microinsights/carousel/CarouselHeader.es.js.map +1 -1
- package/dist/microinsights/carousel/MicroBeatCarousel.es.js.map +1 -1
- package/dist/microinsights/constants/Analytics.es.js.map +1 -1
- package/dist/networth/NetWorthMicroWidget.es.js.map +1 -1
- package/dist/networth/NetWorthWidget.es.js.map +1 -1
- package/dist/networth/components/AssetsLiabilitiesDetail.es.js +1 -1
- package/dist/networth/components/AssetsLiabilitiesDetail.es.js.map +1 -1
- package/dist/networth/components/GainsLossesDetail.es.js.map +1 -1
- package/dist/networth/components/NetWorthChange.es.js.map +1 -1
- package/dist/networth/components/NetWorthChart.es.js.map +1 -1
- package/dist/networth/components/NetWorthList.es.js.map +1 -1
- package/dist/networth/components/NetWorthListItem.es.js.map +1 -1
- package/dist/networth/components/NetWorthSummary.es.js.map +1 -1
- package/dist/networth/components/micro/NetworthData.es.js.map +1 -1
- package/dist/networth/components/micro/ZeroState.es.js.map +1 -1
- package/dist/notifications/components/DateRow.es.js.map +1 -1
- package/dist/notifications/components/NotificationBadge.es.js.map +1 -1
- package/dist/notifications/components/NotificationCard.es.js.map +1 -1
- package/dist/notifications/components/NotificationDrawer.es.js.map +1 -1
- package/dist/notifications/components/NotificationList.es.js +33 -30
- package/dist/notifications/components/NotificationList.es.js.map +1 -1
- package/dist/notifications/components/NotificationsEmptyState.es.js.map +1 -1
- package/dist/recurringtransactions/RecurringTransactionsMicroWidget.es.js.map +1 -1
- package/dist/recurringtransactions/RecurringTransactionsMiniWidget.es.js.map +1 -1
- package/dist/recurringtransactions/RecurringTransactionsWidget.es.js.map +1 -1
- package/dist/recurringtransactions/ZeroStateMicroWidget.es.js.map +1 -1
- package/dist/recurringtransactions/components/MicroWidgetContent.es.js.map +1 -1
- package/dist/recurringtransactions/components/MiniWidgetContent.es.js.map +1 -1
- package/dist/recurringtransactions/components/PaymentSchedule.es.js.map +1 -1
- package/dist/recurringtransactions/components/RecurrenceBadges.es.js.map +1 -1
- package/dist/recurringtransactions/components/RecurrenceList.es.js.map +1 -1
- package/dist/recurringtransactions/components/RecurrenceRow.es.js.map +1 -1
- package/dist/recurringtransactions/components/RecurringSettingsDrawer.es.js.map +1 -1
- package/dist/recurringtransactions/components/RecurringStatus.es.js.map +1 -1
- package/dist/recurringtransactions/components/RecurringTransactionDetails.es.js.map +1 -1
- package/dist/recurringtransactions/components/RecurringTransactionDetailsDrawer.es.js.map +1 -1
- package/dist/recurringtransactions/components/RecurringTransactionList.es.js.map +1 -1
- package/dist/recurringtransactions/components/RecurringTransactions.es.js.map +1 -1
- package/dist/recurringtransactions/components/UpcomingRecurrenceCard.es.js.map +1 -1
- package/dist/recurringtransactions/components/actions/LinkTransactionDrawer.es.js.map +1 -1
- package/dist/recurringtransactions/components/actions/MarkAsPaidDialog.es.js.map +1 -1
- package/dist/recurringtransactions/components/actions/MarkAsUnpaidDialog.es.js.map +1 -1
- package/dist/recurringtransactions/components/actions/PaymentScheduleAction.es.js.map +1 -1
- package/dist/recurringtransactions/components/micro/MerchantLogosRow.es.js.map +1 -1
- package/dist/recurringtransactions/components/micro/OverlappingMerchantLogos.es.js.map +1 -1
- package/dist/recurringtransactions/components/micro/RecurrenceLegend.es.js.map +1 -1
- package/dist/recurringtransactions/components/recurrencecalendar/Legend.es.js.map +1 -1
- package/dist/recurringtransactions/components/recurrencecalendar/RecurrenceCalendar.es.js.map +1 -1
- package/dist/recurringtransactions/components/recurrencecalendar/RecurrenceDay.es.js.map +1 -1
- package/dist/recurringtransactions/components/shared/RecurringSettings.es.js.map +1 -1
- package/dist/recurringtransactions/components/shared/recurringsettings/AddRecurringTransaction.es.js.map +1 -1
- package/dist/recurringtransactions/components/shared/recurringsettings/AddRecurringTransactionDetails.es.js.map +1 -1
- package/dist/recurringtransactions/components/shared/recurringsettings/ManageExpenses.es.js.map +1 -1
- package/dist/recurringtransactions/components/shared/recurringsettings/ManageIncome.es.js.map +1 -1
- package/dist/recurringtransactions/components/shared/recurringsettings/RecurringRow.es.js.map +1 -1
- package/dist/recurringtransactions/components/shared/recurringsettings/RecurringSettingsZeroState.es.js.map +1 -1
- package/dist/recurringtransactions/components/shared/recurringsettings/SelectTransaction.es.js.map +1 -1
- package/dist/settings/NotificationSettingsWidget.es.js.map +1 -1
- package/dist/settings/SettingsWidget.es.js.map +1 -1
- package/dist/settings/TransactionRulesWidget.es.js.map +1 -1
- package/dist/settings/components/SettingsWidgetContents.es.js.map +1 -1
- package/dist/settings/components/devices/DeviceDialog.es.js.map +1 -1
- package/dist/settings/components/devices/DeviceList.es.js.map +1 -1
- package/dist/settings/components/devices/DeviceTab.es.js.map +1 -1
- package/dist/settings/components/devices/DeviceTable.es.js +82 -82
- package/dist/settings/components/devices/DeviceTable.es.js.map +1 -1
- package/dist/settings/components/notifications/AccountNotificationProfile.es.js.map +1 -1
- package/dist/settings/components/notifications/AccountNotificationProfiles.es.js.map +1 -1
- package/dist/settings/components/notifications/AccountProfileListItem.es.js.map +1 -1
- package/dist/settings/components/notifications/DeliveryMethods.es.js.map +1 -1
- package/dist/settings/components/notifications/NotificationProfile.es.js.map +1 -1
- package/dist/settings/components/notifications/NotificationSettings.es.js.map +1 -1
- package/dist/settings/components/notifications/PersonalDetails.es.js.map +1 -1
- package/dist/settings/components/profile/ProfileTab.es.js.map +1 -1
- package/dist/settings/components/profile/actions/VerifyEmailAction.es.js.map +1 -1
- package/dist/settings/components/profile/actions/VerifyPhoneAction.es.js.map +1 -1
- package/dist/settings/components/profile/actions/VerifyTokenAction.es.js.map +1 -1
- package/dist/settings/components/transactionrules/TransactionRulesTab.es.js.map +1 -1
- package/dist/settings/components/transactionrules/actions/DeleteRuleAction.es.js.map +1 -1
- package/dist/settings/components/transactionrules/actions/EditPayeeAction.es.js.map +1 -1
- package/dist/settings/components/transactionrules/components/EditRuleDetails.es.js.map +1 -1
- package/dist/settings/components/transactionrules/components/RuleListItem.es.js +24 -21
- package/dist/settings/components/transactionrules/components/RuleListItem.es.js.map +1 -1
- package/dist/spending/SpendingMiniWidget.es.js.map +1 -1
- package/dist/spending/SpendingWidget.es.js +48 -39
- package/dist/spending/SpendingWidget.es.js.map +1 -1
- package/dist/spending/components/MiniSpendingChart.es.js.map +1 -1
- package/dist/spending/components/Spending.es.js.map +1 -1
- package/dist/spending/components/SpendingChart.es.js.map +1 -1
- package/dist/spending/components/SpendingDonut.es.js.map +1 -1
- package/dist/spending/components/SpendingLegend.es.js.map +1 -1
- package/dist/spending/components/SpendingList.es.js.map +1 -1
- package/dist/spending/components/SpendingTabLabel.es.js.map +1 -1
- package/dist/transactions/TransactionWidget.es.js.map +1 -1
- package/dist/transactions/components/shared/TransactionDetails.es.js.map +1 -1
- package/dist/transactions/components/shared/TransactionList.es.js.map +1 -1
- package/dist/transactions/components/shared/TransactionTable.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/Description.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/FlagTransaction.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/ManualTransactionDetails.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/TransactionAmountHeader.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/TransactionDetailsView.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/actions/AddMerchantBudgetAction.es.js +7 -7
- package/dist/transactions/components/shared/transactiondetails/actions/AddMerchantBudgetAction.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/actions/CategoryAction.es.js +29 -29
- package/dist/transactions/components/shared/transactiondetails/actions/CategoryAction.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/actions/DateAction.es.js +36 -36
- package/dist/transactions/components/shared/transactiondetails/actions/DateAction.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/actions/DeleteAction.es.js +7 -7
- package/dist/transactions/components/shared/transactiondetails/actions/DeleteAction.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/actions/DeleteLogoAction.es.js +7 -7
- package/dist/transactions/components/shared/transactiondetails/actions/DeleteLogoAction.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/actions/ExcludeAction.es.js +7 -7
- package/dist/transactions/components/shared/transactiondetails/actions/ExcludeAction.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/actions/MemoAction.es.js +24 -24
- package/dist/transactions/components/shared/transactiondetails/actions/MemoAction.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/actions/SplitAction.es.js +40 -40
- package/dist/transactions/components/shared/transactiondetails/actions/SplitAction.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/actions/TagsAction.es.js +34 -34
- package/dist/transactions/components/shared/transactiondetails/actions/TagsAction.es.js.map +1 -1
- package/dist/transactions/components/shared/transactionlist/TransactionRow.es.js.map +1 -1
- package/dist/transactions/components/shared/transactionlist/ZeroState.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiontable/cells/AccountCell.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiontable/cells/AmountCell.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiontable/cells/CategoryCell.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiontable/cells/DateCell.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiontable/cells/FlagCell.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiontable/cells/HeaderCell.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiontable/cells/PayeeCell.es.js.map +1 -1
- package/dist/transactions/components/splitmanager/SplitManager.es.js.map +1 -1
- package/dist/transactions/components/splitmanager/SplitRow.es.js.map +1 -1
- package/dist/transactions/components/tagmanager/Header.es.js.map +1 -1
- package/dist/transactions/components/tagmanager/SearchBox.es.js.map +1 -1
- package/dist/transactions/components/tagmanager/TagManager.es.js.map +1 -1
- package/dist/transactions/components/tagmanager/TagRow.es.js +4 -4
- package/dist/transactions/components/tagmanager/TagRow.es.js.map +1 -1
- package/dist/transactions/components/transactionwidget/AddAccountModal.es.js.map +1 -1
- package/dist/transactions/components/transactionwidget/actions/EditCategoryAction.es.js.map +1 -1
- package/dist/transactions/components/transactionwidget/actions/ExportCsvAction.es.js.map +1 -1
- package/dist/transactions/utils/Transactions.es.js +20 -12
- package/dist/transactions/utils/Transactions.es.js.map +1 -1
- package/dist/trends/TrendsFullWidget.es.js +47 -47
- package/dist/trends/TrendsFullWidget.es.js.map +1 -1
- package/dist/trends/TrendsMicroWidget.es.js.map +1 -1
- package/dist/trends/TrendsMiniWidget.es.js.map +1 -1
- package/dist/trends/TrendsWidget.es.js +88 -89
- package/dist/trends/TrendsWidget.es.js.map +1 -1
- package/dist/trends/ZeroStateMicroWidget.es.js.map +1 -1
- package/dist/trends/components/CategoriesList.es.js.map +1 -1
- package/dist/trends/components/CategoryDetailChart.es.js.map +1 -1
- package/dist/trends/components/CategoryDetails.es.js.map +1 -1
- package/dist/trends/components/DateRangeText.es.js.map +1 -1
- package/dist/trends/components/TrendsChart.es.js.map +1 -1
- package/dist/trends/components/TrendsDrawer.es.js.map +1 -1
- package/dist/trends/components/TrendsInsights.es.js +21 -21
- package/dist/trends/components/TrendsInsights.es.js.map +1 -1
- package/dist/trends/components/TrendsMicroSpendingIncomeBox.es.js.map +1 -1
- package/dist/trends/components/TrendsTableContainer.es.js.map +1 -1
- package/dist/trends/components/TrendsViewToggle.es.js.map +1 -1
- package/dist/trends/components/trendstable/AccessibleSortIcon.es.js.map +1 -1
- package/dist/trends/components/trendstable/AmountCell.es.js.map +1 -1
- package/dist/trends/components/trendstable/CategoryCell.es.js.map +1 -1
- package/dist/trends/components/trendstable/HeaderCell.es.js.map +1 -1
- package/package.json +36 -35
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecurringTransactionsUtil.es.js","names":[],"sources":["../../../src/core/utils/RecurringTransactionsUtil.ts"],"sourcesContent":["import { addDays } from 'date-fns/addDays'\nimport { addMonths } from 'date-fns/addMonths'\nimport { addQuarters } from 'date-fns/addQuarters'\nimport { addWeeks } from 'date-fns/addWeeks'\nimport { addYears } from 'date-fns/addYears'\nimport { differenceInDays } from 'date-fns/differenceInDays'\nimport { formatISO } from 'date-fns/formatISO'\nimport { fromUnixTime } from 'date-fns/fromUnixTime'\nimport { getUnixTime } from 'date-fns/getUnixTime'\nimport { isAfter } from 'date-fns/isAfter'\nimport { isBefore } from 'date-fns/isBefore'\nimport { isSameDay } from 'date-fns/isSameDay'\nimport { lastDayOfMonth } from 'date-fns/lastDayOfMonth'\nimport { nextDay } from 'date-fns/nextDay'\nimport { parseISO } from 'date-fns/parseISO'\nimport { setDate } from 'date-fns/setDate'\nimport { setDay } from 'date-fns/setDay'\nimport { setDayOfYear } from 'date-fns/setDayOfYear'\nimport { startOfToday } from 'date-fns/startOfToday'\nimport { subDays } from 'date-fns/subDays'\nimport { subMonths } from 'date-fns/subMonths'\nimport { subQuarters } from 'date-fns/subQuarters'\nimport { subWeeks } from 'date-fns/subWeeks'\nimport { subYears } from 'date-fns/subYears'\n\nimport type { Day } from 'date-fns'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../constants'\nimport {\n type Account,\n type DateRange,\n type Recurrence,\n type RecurringCopy,\n type RepeatingTransaction,\n type Transaction,\n RecurrenceType,\n RecurrenceStatus,\n RepeatingType,\n Frequency,\n} from '../types'\n\nimport {\n getNextBiMonthlyDate,\n getNextBiQuarterlyDate,\n getNextBiWeeklyDate,\n getNextMonthlyDate,\n getNextQuarterlyDate,\n getNextTwiceMonthlyDate,\n getNextWeeklyDate,\n getNextYearlyDate,\n getTwiceMonthlyDates,\n} from './DateUtil'\nimport { formatOrdinal } from './NumberFormatting'\nimport { buildDynamicCopy } from './Localization'\n\nexport type GroupedRecurrence = {\n recurrences: Recurrence[]\n id: string\n date: Date\n}\n\nexport const buildInstitutionName = (account?: Account) => {\n if (!account) return ''\n\n let name = account.user_name || account.feed_name || ''\n if (account.account_number) {\n name = `${name} *${account.account_number}`\n }\n return name\n}\n\nconst buildRepeatingRecurrences = (\n repeatingTransaction: RepeatingTransaction,\n dateRange: DateRange,\n) => {\n const recurrences: Recurrence[] = []\n\n const isYearly = repeatingTransaction.recurrence_type === Frequency.EveryYear\n\n const pastTransaction = repeatingTransaction.transactions.find(\n (t) => t.repeating_transaction_guid === repeatingTransaction.guid,\n )\n\n /*\n Since past transactions for yearly recurrences can be outside the 90 day data range, we need to display them\n even if there is no past transaction to match to. This will display it without a category, but that's the\n tradeoff until we impove our transactions service to return past transactions for all recurring transactions.\n */\n if (!isYearly && !pastTransaction) return []\n\n const occursOn = parseISO(repeatingTransaction.predicted_occurs_on)\n const baseRecurrence: Recurrence = {\n accountGuid: repeatingTransaction.account?.guid || '',\n amount: repeatingTransaction.amount,\n categoryGuid: pastTransaction?.category_guid || '',\n expectedDate: occursOn,\n frequency: repeatingTransaction.recurrence_type,\n institutionGuid: repeatingTransaction.account?.institution_guid || '',\n institutionName: buildInstitutionName(repeatingTransaction.account),\n merchantGuid: repeatingTransaction.merchant_guid,\n name: repeatingTransaction.description,\n recurrenceDay: repeatingTransaction.recurrence_day,\n repeatingTransactionGuid: repeatingTransaction.guid,\n secondRecurrenceDay: repeatingTransaction.second_recurrence_day,\n status: RecurrenceStatus.Upcoming,\n type:\n repeatingTransaction.repeating_transaction_type === RepeatingType.Income\n ? RecurrenceType.Income\n : RecurrenceType.Expense,\n transaction: undefined,\n }\n\n const startDate = dateRange.start\n const endDate = dateRange.end\n\n switch (repeatingTransaction.recurrence_type) {\n case Frequency.EveryWeek:\n recurrences.push(...getWeeklyRecurrences(baseRecurrence, startDate, endDate))\n break\n case Frequency.EveryOtherWeek:\n recurrences.push(...getBiWeeklyRecurrences(baseRecurrence, startDate, endDate))\n break\n case Frequency.TwiceAMonth:\n recurrences.push(...getTwiceMonthlyRecurrences(baseRecurrence, startDate, endDate))\n break\n case Frequency.EveryMonth:\n recurrences.push(...getMonthlyRecurrences(baseRecurrence, startDate, endDate))\n break\n case Frequency.EveryOtherMonth:\n recurrences.push(...getBiMonthlyRecurrences(baseRecurrence, startDate, endDate))\n break\n case Frequency.EveryQuarter:\n recurrences.push(...getQuarterlyRecurrences(baseRecurrence, startDate, endDate))\n break\n case Frequency.EveryOtherQuarter:\n recurrences.push(...getBiQuarterlyRecurrences(baseRecurrence, startDate, endDate))\n break\n case Frequency.EveryYear:\n recurrences.push(...getYearlyRecurrences(baseRecurrence, startDate, endDate))\n break\n }\n\n // Track which transactions have already been matched to avoid double-counting\n const matchedTransactionGuids = new Set<string>()\n\n for (const recurrence of recurrences) {\n // First, try to find a manually linked transaction (any date)\n const linkedTransactions = repeatingTransaction.transactions.filter(\n (t) =>\n t.repeating_transaction_guid === repeatingTransaction.guid &&\n !matchedTransactionGuids.has(t.guid),\n )\n\n const transaction =\n linkedTransactions.find(\n (t) =>\n t.date > getUnixTime(subDays(recurrence.expectedDate, 5)) &&\n t.date < getUnixTime(addDays(recurrence.expectedDate, 5)),\n ) ||\n (isBefore(recurrence.expectedDate, startOfToday())\n ? linkedTransactions.reduce<Transaction | undefined>((closest, t) => {\n const dist = Math.abs(t.date - getUnixTime(recurrence.expectedDate))\n const closestDist = closest\n ? Math.abs(closest.date - getUnixTime(recurrence.expectedDate))\n : Infinity\n return dist < closestDist ? t : closest\n }, undefined)\n : undefined)\n\n if (transaction) {\n matchedTransactionGuids.add(transaction.guid)\n recurrence.transaction = transaction\n recurrence.status = RecurrenceStatus.Paid\n recurrence.occurredOnDate = fromUnixTime(transaction.date)\n } else if (isBefore(recurrence.expectedDate, subDays(startOfToday(), 3))) {\n recurrence.status = RecurrenceStatus.Missed\n }\n }\n\n return recurrences\n}\n\nconst getWeeklyRecurrences = (baseRecurrence: Recurrence, startDate: Date, endDate: Date) => {\n const activities: Recurrence[] = []\n\n // Add recurrence for each week for the current month and next month\n let nextDate = nextDay(startDate, baseRecurrence.recurrenceDay as Day)\n while (isBefore(nextDate, endDate)) {\n activities.push({ ...baseRecurrence, expectedDate: nextDate })\n nextDate = nextDay(nextDate, baseRecurrence.recurrenceDay as Day)\n }\n\n return activities\n}\n\nconst getBiWeeklyRecurrences = (baseRecurrence: Recurrence, startDate: Date, endDate: Date) => {\n const recurrences: Recurrence[] = []\n\n // Determine the first occurrence of the bi-weekly recurrence within the date range\n let nextDate = baseRecurrence.expectedDate\n if (isBefore(nextDate, startDate)) {\n while (isBefore(nextDate, startDate)) {\n nextDate = addWeeks(nextDate, 2)\n }\n } else {\n while (isAfter(nextDate, startDate) || isSameDay(nextDate, startDate)) {\n nextDate = subWeeks(nextDate, 2)\n }\n nextDate = addWeeks(nextDate, 2)\n }\n\n while (isBefore(nextDate, endDate)) {\n recurrences.push({ ...baseRecurrence, expectedDate: nextDate })\n nextDate = addDays(nextDate, 14)\n }\n\n return recurrences\n}\n\nconst getTwiceMonthlyRecurrences = (baseRecurrence: Recurrence, startDate: Date, endDate: Date) => {\n const recurrences: Recurrence[] = []\n\n let firstOccurrence = setDate(startDate, baseRecurrence.recurrenceDay)\n\n while (isBefore(firstOccurrence, endDate)) {\n recurrences.push({ ...baseRecurrence, expectedDate: firstOccurrence })\n firstOccurrence = addMonths(firstOccurrence, 1)\n }\n\n let secondOccurrence =\n baseRecurrence.secondRecurrenceDay && baseRecurrence.secondRecurrenceDay < 28\n ? setDate(startDate, baseRecurrence.secondRecurrenceDay)\n : lastDayOfMonth(startDate)\n\n while (isBefore(secondOccurrence, endDate)) {\n recurrences.push({ ...baseRecurrence, expectedDate: secondOccurrence })\n secondOccurrence = addMonths(secondOccurrence, 1)\n }\n\n return recurrences\n}\n\nconst getMonthlyRecurrences = (baseRecurrence: Recurrence, startDate: Date, endDate: Date) => {\n const recurrences: Recurrence[] = []\n\n let expectedDate = setDate(startDate, baseRecurrence.recurrenceDay)\n\n // Add current month's repeating transaction recurrence\n recurrences.push({ ...baseRecurrence, expectedDate })\n\n expectedDate = addMonths(expectedDate, 1)\n while (isBefore(expectedDate, endDate)) {\n recurrences.push({ ...baseRecurrence, expectedDate })\n expectedDate = addMonths(expectedDate, 1)\n }\n\n return recurrences\n}\n\nconst getBiMonthlyRecurrences = (baseRecurrence: Recurrence, startDate: Date, endDate: Date) => {\n const recurrences: Recurrence[] = []\n\n const occursOn = baseRecurrence.expectedDate\n let nextDate = isBefore(occursOn, endDate) ? occursOn : subMonths(occursOn, 2)\n while (isBefore(nextDate, endDate)) {\n if (isAfter(nextDate, startDate)) {\n recurrences.push({ ...baseRecurrence, expectedDate: nextDate })\n }\n nextDate = addMonths(nextDate, 2)\n }\n\n return recurrences\n}\n\nconst getQuarterlyRecurrences = (baseRecurrence: Recurrence, startDate: Date, endDate: Date) => {\n const recurrences: Recurrence[] = []\n\n const occursOn = baseRecurrence.expectedDate\n let nextDate = isBefore(occursOn, endDate) ? occursOn : subQuarters(occursOn, 1)\n while (isBefore(nextDate, endDate)) {\n if (isAfter(nextDate, startDate)) {\n recurrences.push({ ...baseRecurrence, expectedDate: nextDate })\n }\n nextDate = addQuarters(nextDate, 1)\n }\n\n return recurrences\n}\n\nconst getBiQuarterlyRecurrences = (baseRecurrence: Recurrence, startDate: Date, endDate: Date) => {\n const recurrences: Recurrence[] = []\n\n const occursOn = baseRecurrence.expectedDate\n let nextDate = isBefore(occursOn, endDate) ? occursOn : subQuarters(occursOn, 2)\n while (isBefore(nextDate, endDate)) {\n if (isAfter(nextDate, startDate)) {\n recurrences.push({ ...baseRecurrence, expectedDate: nextDate })\n }\n nextDate = addQuarters(nextDate, 2)\n }\n\n return recurrences\n}\n\nconst getYearlyRecurrences = (baseRecurrence: Recurrence, startDate: Date, endDate: Date) => {\n const recurrences: Recurrence[] = []\n\n const occursOn = baseRecurrence.expectedDate\n let nextDate = isBefore(occursOn, endDate) ? occursOn : subYears(occursOn, 1)\n while (isBefore(nextDate, endDate)) {\n if (isAfter(nextDate, startDate)) {\n recurrences.push({ ...baseRecurrence, expectedDate: nextDate })\n }\n nextDate = addYears(nextDate, 1)\n }\n\n return recurrences\n}\n\nexport const buildAllRecurrences = (\n repeatingTransactions: RepeatingTransaction[],\n dateRange: DateRange,\n) => {\n const recurrences: Recurrence[] = []\n\n for (const repeatingTransaction of repeatingTransactions) {\n const activity = buildRepeatingRecurrences(repeatingTransaction, dateRange)\n recurrences.push(...activity)\n }\n\n return recurrences.sort(\n (a, b) =>\n getUnixTime(a.occurredOnDate || a.expectedDate) -\n getUnixTime(b.occurredOnDate || b.expectedDate),\n )\n}\n\nexport const augmentRepeatingTransactions = (\n accounts: Account[],\n repeatingTransactions: RepeatingTransaction[],\n transactions: Transaction[],\n) => {\n const augmentedRepeatingTransactions: RepeatingTransaction[] = []\n\n for (const repeatingTransaction of repeatingTransactions) {\n const relatedTransactions = transactions.filter(\n (t) => t.repeating_transaction_guid === repeatingTransaction.guid,\n )\n\n if (transactions.length > 0) {\n augmentedRepeatingTransactions.push({\n ...repeatingTransaction,\n account: accounts.find((account) => account.guid === repeatingTransaction.account_guid),\n transactions: relatedTransactions,\n })\n }\n }\n\n return augmentedRepeatingTransactions\n}\n\nexport const groupRecurrencesByDate = (recurrences: Recurrence[]): GroupedRecurrence[] => {\n return recurrences.reduce((groupedRecurrences: GroupedRecurrence[], recurrence) => {\n const dateString = formatISO(recurrence.expectedDate, { representation: 'date' })\n const existingGroup = groupedRecurrences.find(\n (group) => group.date.toString() === recurrence.expectedDate.toString(),\n )\n\n if (existingGroup) {\n existingGroup.recurrences.push(recurrence)\n } else {\n groupedRecurrences.push({\n date: recurrence.expectedDate,\n id: `date-${dateString}`,\n recurrences: [recurrence],\n })\n }\n\n return groupedRecurrences\n }, [])\n}\n\nexport const getFrequencyLabel = (\n copy: RecurringCopy,\n repeatingTransaction: RepeatingTransaction,\n showOrdinal: boolean,\n) => {\n const nextWeekday = nextDay(startOfToday(), repeatingTransaction.recurrence_day as Day)\n const nextAnnualDate = setDayOfYear(startOfToday(), repeatingTransaction.recurrence_day)\n const firstDateOrdinal = formatOrdinal(repeatingTransaction.recurrence_day)\n const secondDateOrdinal = repeatingTransaction.second_recurrence_day\n ? formatOrdinal(repeatingTransaction.second_recurrence_day)\n : ''\n\n let frequencyLabel = showOrdinal\n ? buildDynamicCopy(copy.monthly_ordinal, firstDateOrdinal)\n : copy.monthly\n\n switch (repeatingTransaction.recurrence_type) {\n case Frequency.EveryQuarter:\n frequencyLabel = showOrdinal\n ? buildDynamicCopy(copy.quarterly_ordinal, firstDateOrdinal)\n : copy.quarterly\n break\n case Frequency.EveryWeek:\n frequencyLabel = showOrdinal\n ? buildDynamicCopy(\n copy.weekly_ordinal,\n formatDate(nextWeekday, DATE_FORMATS_INTL.DAY_OF_WEEK),\n )\n : copy.weekly\n break\n case Frequency.EveryYear:\n frequencyLabel = showOrdinal\n ? buildDynamicCopy(\n copy.anually_ordinal,\n formatDate(nextAnnualDate, DATE_FORMATS_INTL.MONTH_DAY),\n )\n : copy.anually\n break\n case Frequency.EveryOtherWeek:\n frequencyLabel = showOrdinal\n ? buildDynamicCopy(\n copy.every_other_week_ordinal,\n formatDate(nextWeekday, DATE_FORMATS_INTL.DAY_OF_WEEK),\n )\n : copy.every_other_week\n break\n case Frequency.EveryOtherMonth:\n frequencyLabel = showOrdinal\n ? buildDynamicCopy(copy.every_other_month_ordinal, firstDateOrdinal)\n : copy.every_other_month\n break\n case Frequency.EveryOtherQuarter:\n frequencyLabel = showOrdinal\n ? buildDynamicCopy(copy.every_other_quarter_ordinal, firstDateOrdinal)\n : copy.every_other_quarter\n break\n case Frequency.TwiceAMonth:\n frequencyLabel = showOrdinal\n ? buildDynamicCopy(copy.twice_a_month_ordinal, firstDateOrdinal, secondDateOrdinal)\n : copy.twice_a_month\n break\n }\n\n return frequencyLabel as string\n}\n\nexport const getNextPaymentDate = (\n frequency: Frequency,\n date: Date,\n recurrenceDay?: number,\n secondRecurrenceDay?: number,\n) => {\n let baseDate = date\n\n // Apply user selected recurrenceDay based on frequency type\n if (recurrenceDay !== undefined) {\n if (frequency === Frequency.EveryWeek || frequency === Frequency.EveryOtherWeek) {\n baseDate = setDay(date, recurrenceDay)\n } else if (frequency === Frequency.EveryYear) {\n baseDate = setDayOfYear(date, recurrenceDay)\n } else {\n baseDate = setDate(date, recurrenceDay)\n }\n }\n\n let nextDate = baseDate\n\n switch (frequency) {\n case Frequency.EveryWeek:\n nextDate = getNextWeeklyDate(baseDate)\n break\n case Frequency.EveryOtherWeek:\n nextDate = getNextBiWeeklyDate(baseDate)\n break\n case Frequency.TwiceAMonth:\n nextDate = getNextTwiceMonthlyDate(\n recurrenceDay ?? baseDate.getDate(),\n secondRecurrenceDay ?? 28,\n )\n break\n case Frequency.EveryMonth:\n nextDate = getNextMonthlyDate(baseDate)\n break\n case Frequency.EveryOtherMonth:\n nextDate = getNextBiMonthlyDate(baseDate)\n break\n case Frequency.EveryQuarter:\n nextDate = getNextQuarterlyDate(baseDate)\n break\n case Frequency.EveryOtherQuarter:\n nextDate = getNextBiQuarterlyDate(baseDate)\n break\n case Frequency.EveryYear:\n nextDate = getNextYearlyDate(baseDate)\n break\n }\n\n return nextDate\n}\n\nexport const getNextUpcomingDate = (\n recurringTransaction: RepeatingTransaction,\n recurrences: Recurrence[],\n): Date => {\n const nextUpcoming = recurrences.find(\n (r) =>\n r.repeatingTransactionGuid === recurringTransaction.guid &&\n r.status === RecurrenceStatus.Upcoming,\n )\n if (nextUpcoming) return nextUpcoming.expectedDate\n\n const isPaidNearDate = (date: Date) =>\n recurrences.some(\n (r) =>\n r.repeatingTransactionGuid === recurringTransaction.guid &&\n r.status === RecurrenceStatus.Paid &&\n Math.abs(differenceInDays(r.expectedDate, date)) <= 5,\n )\n\n const frequencyAdvancers: Partial<Record<Frequency, (d: Date) => Date>> = {\n [Frequency.EveryWeek]: (d) => addWeeks(d, 1),\n [Frequency.EveryOtherWeek]: (d) => addWeeks(d, 2),\n [Frequency.TwiceAMonth]: (d) => {\n const candidates = getTwiceMonthlyDates(\n recurringTransaction.recurrence_day,\n recurringTransaction.second_recurrence_day ?? 28,\n )\n return candidates.find((c) => isAfter(c, d)) ?? candidates[candidates.length - 1]\n },\n [Frequency.EveryMonth]: (d) => addMonths(d, 1),\n [Frequency.EveryOtherMonth]: (d) => addMonths(d, 2),\n [Frequency.EveryQuarter]: (d) => addMonths(d, 3),\n [Frequency.EveryOtherQuarter]: (d) => addMonths(d, 6),\n [Frequency.EveryYear]: (d) => addYears(d, 1),\n }\n\n const baseNext = getNextPaymentDate(\n recurringTransaction.recurrence_type,\n parseISO(recurringTransaction.predicted_occurs_on),\n recurringTransaction.recurrence_day,\n recurringTransaction.second_recurrence_day,\n )\n\n if (!isPaidNearDate(baseNext)) return baseNext\n\n const advance = frequencyAdvancers[recurringTransaction.recurrence_type]\n return advance ? advance(baseNext) : baseNext\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,IAAa,KAAA,CAAwB,MAAsB;AACzD,MAAI,CAAC,EAAS,QAAO;AAErB,MAAI,IAAO,EAAQ,aAAa,EAAQ,aAAa;AACrD,SAAI,EAAQ,mBACV,IAAO,GAAG,CAAA,KAAS,EAAQ,cAAA,KAEtB;AACT,GAEM,KAAA,CACJ,GACA,MACG;AACH,QAAM,IAA4B,CAAC,GAE7B,IAAW,EAAqB,oBAAoB,EAAU,WAE9D,IAAkB,EAAqB,aAAa,KAAA,CACvD,MAAM,EAAE,+BAA+B,EAAqB,IAC/D;AAOA,MAAI,CAAC,KAAY,CAAC,EAAiB,QAAO,CAAC;AAE3C,QAAM,IAAW,EAAS,EAAqB,mBAAmB,GAC5D,IAA6B;AAAA,IACjC,aAAa,EAAqB,SAAS,QAAQ;AAAA,IACnD,QAAQ,EAAqB;AAAA,IAC7B,cAAc,GAAiB,iBAAiB;AAAA,IAChD,cAAc;AAAA,IACd,WAAW,EAAqB;AAAA,IAChC,iBAAiB,EAAqB,SAAS,oBAAoB;AAAA,IACnE,iBAAiB,GAAqB,EAAqB,OAAO;AAAA,IAClE,cAAc,EAAqB;AAAA,IACnC,MAAM,EAAqB;AAAA,IAC3B,eAAe,EAAqB;AAAA,IACpC,0BAA0B,EAAqB;AAAA,IAC/C,qBAAqB,EAAqB;AAAA,IAC1C,QAAQ,EAAiB;AAAA,IACzB,MACE,EAAqB,+BAA+B,EAAc,SAC9D,EAAe,SACf,EAAe;AAAA,IACrB,aAAa;AAAA,EACf,GAEM,IAAY,EAAU,OACtB,IAAU,EAAU;AAE1B,UAAQ,EAAqB,i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U,EAAQ,CAAQ,IAAI;AACvC"}
|
|
1
|
+
{"version":3,"file":"RecurringTransactionsUtil.es.js","names":[],"sources":["../../../src/core/utils/RecurringTransactionsUtil.ts"],"sourcesContent":["import { addDays } from 'date-fns/addDays'\nimport { addMonths } from 'date-fns/addMonths'\nimport { addQuarters } from 'date-fns/addQuarters'\nimport { addWeeks } from 'date-fns/addWeeks'\nimport { addYears } from 'date-fns/addYears'\nimport { differenceInDays } from 'date-fns/differenceInDays'\nimport { formatISO } from 'date-fns/formatISO'\nimport { fromUnixTime } from 'date-fns/fromUnixTime'\nimport { getUnixTime } from 'date-fns/getUnixTime'\nimport { isAfter } from 'date-fns/isAfter'\nimport { isBefore } from 'date-fns/isBefore'\nimport { isSameDay } from 'date-fns/isSameDay'\nimport { lastDayOfMonth } from 'date-fns/lastDayOfMonth'\nimport { nextDay } from 'date-fns/nextDay'\nimport { parseISO } from 'date-fns/parseISO'\nimport { setDate } from 'date-fns/setDate'\nimport { setDay } from 'date-fns/setDay'\nimport { setDayOfYear } from 'date-fns/setDayOfYear'\nimport { startOfToday } from 'date-fns/startOfToday'\nimport { subDays } from 'date-fns/subDays'\nimport { subMonths } from 'date-fns/subMonths'\nimport { subQuarters } from 'date-fns/subQuarters'\nimport { subWeeks } from 'date-fns/subWeeks'\nimport { subYears } from 'date-fns/subYears'\n\nimport type { Day } from 'date-fns'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../constants'\nimport {\n type Account,\n type DateRange,\n type Recurrence,\n type RecurringCopy,\n type RepeatingTransaction,\n type Transaction,\n RecurrenceType,\n RecurrenceStatus,\n RepeatingType,\n Frequency,\n} from '../types'\n\nimport {\n getNextBiMonthlyDate,\n getNextBiQuarterlyDate,\n getNextBiWeeklyDate,\n getNextMonthlyDate,\n getNextQuarterlyDate,\n getNextTwiceMonthlyDate,\n getNextWeeklyDate,\n getNextYearlyDate,\n getTwiceMonthlyDates,\n} from './DateUtil'\nimport { formatOrdinal } from './NumberFormatting'\nimport { buildDynamicCopy } from './Localization'\n\nexport type GroupedRecurrence = {\n recurrences: Recurrence[]\n id: string\n date: Date\n}\n\nexport const buildInstitutionName = (account?: Account) => {\n if (!account) return ''\n\n let name = account.user_name || account.feed_name || ''\n if (account.account_number) {\n name = `${name} *${account.account_number}`\n }\n return name\n}\n\nconst buildRepeatingRecurrences = (\n repeatingTransaction: RepeatingTransaction,\n dateRange: DateRange,\n) => {\n const recurrences: Recurrence[] = []\n\n const isYearly = repeatingTransaction.recurrence_type === Frequency.EveryYear\n\n const pastTransaction = repeatingTransaction.transactions.find(\n (t) => t.repeating_transaction_guid === repeatingTransaction.guid,\n )\n\n /*\n Since past transactions for yearly recurrences can be outside the 90 day data range, we need to display them\n even if there is no past transaction to match to. This will display it without a category, but that's the\n tradeoff until we impove our transactions service to return past transactions for all recurring transactions.\n */\n if (!isYearly && !pastTransaction) return []\n\n const occursOn = parseISO(repeatingTransaction.predicted_occurs_on)\n const baseRecurrence: Recurrence = {\n accountGuid: repeatingTransaction.account?.guid || '',\n amount: repeatingTransaction.amount,\n categoryGuid: pastTransaction?.category_guid || '',\n expectedDate: occursOn,\n frequency: repeatingTransaction.recurrence_type,\n institutionGuid: repeatingTransaction.account?.institution_guid || '',\n institutionName: buildInstitutionName(repeatingTransaction.account),\n merchantGuid: repeatingTransaction.merchant_guid,\n name: repeatingTransaction.description,\n recurrenceDay: repeatingTransaction.recurrence_day,\n repeatingTransactionGuid: repeatingTransaction.guid,\n secondRecurrenceDay: repeatingTransaction.second_recurrence_day,\n status: RecurrenceStatus.Upcoming,\n type:\n repeatingTransaction.repeating_transaction_type === RepeatingType.Income\n ? RecurrenceType.Income\n : RecurrenceType.Expense,\n transaction: undefined,\n }\n\n const startDate = dateRange.start\n const endDate = dateRange.end\n\n switch (repeatingTransaction.recurrence_type) {\n case Frequency.EveryWeek:\n recurrences.push(...getWeeklyRecurrences(baseRecurrence, startDate, endDate))\n break\n case Frequency.EveryOtherWeek:\n recurrences.push(...getBiWeeklyRecurrences(baseRecurrence, startDate, endDate))\n break\n case Frequency.TwiceAMonth:\n recurrences.push(...getTwiceMonthlyRecurrences(baseRecurrence, startDate, endDate))\n break\n case Frequency.EveryMonth:\n recurrences.push(...getMonthlyRecurrences(baseRecurrence, startDate, endDate))\n break\n case Frequency.EveryOtherMonth:\n recurrences.push(...getBiMonthlyRecurrences(baseRecurrence, startDate, endDate))\n break\n case Frequency.EveryQuarter:\n recurrences.push(...getQuarterlyRecurrences(baseRecurrence, startDate, endDate))\n break\n case Frequency.EveryOtherQuarter:\n recurrences.push(...getBiQuarterlyRecurrences(baseRecurrence, startDate, endDate))\n break\n case Frequency.EveryYear:\n recurrences.push(...getYearlyRecurrences(baseRecurrence, startDate, endDate))\n break\n }\n\n // Track which transactions have already been matched to avoid double-counting\n const matchedTransactionGuids = new Set<string>()\n\n for (const recurrence of recurrences) {\n // First, try to find a manually linked transaction (any date)\n const linkedTransactions = repeatingTransaction.transactions.filter(\n (t) =>\n t.repeating_transaction_guid === repeatingTransaction.guid &&\n !matchedTransactionGuids.has(t.guid),\n )\n\n const transaction =\n linkedTransactions.find(\n (t) =>\n t.date > getUnixTime(subDays(recurrence.expectedDate, 5)) &&\n t.date < getUnixTime(addDays(recurrence.expectedDate, 5)),\n ) ||\n (isBefore(recurrence.expectedDate, startOfToday())\n ? linkedTransactions.reduce<Transaction | undefined>((closest, t) => {\n const dist = Math.abs(t.date - getUnixTime(recurrence.expectedDate))\n const closestDist = closest\n ? Math.abs(closest.date - getUnixTime(recurrence.expectedDate))\n : Infinity\n return dist < closestDist ? t : closest\n }, undefined)\n : undefined)\n\n if (transaction) {\n matchedTransactionGuids.add(transaction.guid)\n recurrence.transaction = transaction\n recurrence.status = RecurrenceStatus.Paid\n recurrence.occurredOnDate = fromUnixTime(transaction.date)\n } else if (isBefore(recurrence.expectedDate, subDays(startOfToday(), 3))) {\n recurrence.status = RecurrenceStatus.Missed\n }\n }\n\n return recurrences\n}\n\nconst getWeeklyRecurrences = (baseRecurrence: Recurrence, startDate: Date, endDate: Date) => {\n const activities: Recurrence[] = []\n\n // Add recurrence for each week for the current month and next month\n let nextDate = nextDay(startDate, baseRecurrence.recurrenceDay as Day)\n while (isBefore(nextDate, endDate)) {\n activities.push({ ...baseRecurrence, expectedDate: nextDate })\n nextDate = nextDay(nextDate, baseRecurrence.recurrenceDay as Day)\n }\n\n return activities\n}\n\nconst getBiWeeklyRecurrences = (baseRecurrence: Recurrence, startDate: Date, endDate: Date) => {\n const recurrences: Recurrence[] = []\n\n // Determine the first occurrence of the bi-weekly recurrence within the date range\n let nextDate = baseRecurrence.expectedDate\n if (isBefore(nextDate, startDate)) {\n while (isBefore(nextDate, startDate)) {\n nextDate = addWeeks(nextDate, 2)\n }\n } else {\n while (isAfter(nextDate, startDate) || isSameDay(nextDate, startDate)) {\n nextDate = subWeeks(nextDate, 2)\n }\n nextDate = addWeeks(nextDate, 2)\n }\n\n while (isBefore(nextDate, endDate)) {\n recurrences.push({ ...baseRecurrence, expectedDate: nextDate })\n nextDate = addDays(nextDate, 14)\n }\n\n return recurrences\n}\n\nconst getTwiceMonthlyRecurrences = (baseRecurrence: Recurrence, startDate: Date, endDate: Date) => {\n const recurrences: Recurrence[] = []\n\n let firstOccurrence = setDate(startDate, baseRecurrence.recurrenceDay)\n\n while (isBefore(firstOccurrence, endDate)) {\n recurrences.push({ ...baseRecurrence, expectedDate: firstOccurrence })\n firstOccurrence = addMonths(firstOccurrence, 1)\n }\n\n let secondOccurrence =\n baseRecurrence.secondRecurrenceDay && baseRecurrence.secondRecurrenceDay < 28\n ? setDate(startDate, baseRecurrence.secondRecurrenceDay)\n : lastDayOfMonth(startDate)\n\n while (isBefore(secondOccurrence, endDate)) {\n recurrences.push({ ...baseRecurrence, expectedDate: secondOccurrence })\n secondOccurrence = addMonths(secondOccurrence, 1)\n }\n\n return recurrences\n}\n\nconst getMonthlyRecurrences = (baseRecurrence: Recurrence, startDate: Date, endDate: Date) => {\n const recurrences: Recurrence[] = []\n\n let expectedDate = setDate(startDate, baseRecurrence.recurrenceDay)\n\n // Add current month's repeating transaction recurrence\n recurrences.push({ ...baseRecurrence, expectedDate })\n\n expectedDate = addMonths(expectedDate, 1)\n while (isBefore(expectedDate, endDate)) {\n recurrences.push({ ...baseRecurrence, expectedDate })\n expectedDate = addMonths(expectedDate, 1)\n }\n\n return recurrences\n}\n\nconst getBiMonthlyRecurrences = (baseRecurrence: Recurrence, startDate: Date, endDate: Date) => {\n const recurrences: Recurrence[] = []\n\n const occursOn = baseRecurrence.expectedDate\n let nextDate = isBefore(occursOn, endDate) ? occursOn : subMonths(occursOn, 2)\n while (isBefore(nextDate, endDate)) {\n if (isAfter(nextDate, startDate)) {\n recurrences.push({ ...baseRecurrence, expectedDate: nextDate })\n }\n nextDate = addMonths(nextDate, 2)\n }\n\n return recurrences\n}\n\nconst getQuarterlyRecurrences = (baseRecurrence: Recurrence, startDate: Date, endDate: Date) => {\n const recurrences: Recurrence[] = []\n\n const occursOn = baseRecurrence.expectedDate\n let nextDate = isBefore(occursOn, endDate) ? occursOn : subQuarters(occursOn, 1)\n while (isBefore(nextDate, endDate)) {\n if (isAfter(nextDate, startDate)) {\n recurrences.push({ ...baseRecurrence, expectedDate: nextDate })\n }\n nextDate = addQuarters(nextDate, 1)\n }\n\n return recurrences\n}\n\nconst getBiQuarterlyRecurrences = (baseRecurrence: Recurrence, startDate: Date, endDate: Date) => {\n const recurrences: Recurrence[] = []\n\n const occursOn = baseRecurrence.expectedDate\n let nextDate = isBefore(occursOn, endDate) ? occursOn : subQuarters(occursOn, 2)\n while (isBefore(nextDate, endDate)) {\n if (isAfter(nextDate, startDate)) {\n recurrences.push({ ...baseRecurrence, expectedDate: nextDate })\n }\n nextDate = addQuarters(nextDate, 2)\n }\n\n return recurrences\n}\n\nconst getYearlyRecurrences = (baseRecurrence: Recurrence, startDate: Date, endDate: Date) => {\n const recurrences: Recurrence[] = []\n\n const occursOn = baseRecurrence.expectedDate\n let nextDate = isBefore(occursOn, endDate) ? occursOn : subYears(occursOn, 1)\n while (isBefore(nextDate, endDate)) {\n if (isAfter(nextDate, startDate)) {\n recurrences.push({ ...baseRecurrence, expectedDate: nextDate })\n }\n nextDate = addYears(nextDate, 1)\n }\n\n return recurrences\n}\n\nexport const buildAllRecurrences = (\n repeatingTransactions: RepeatingTransaction[],\n dateRange: DateRange,\n) => {\n const recurrences: Recurrence[] = []\n\n for (const repeatingTransaction of repeatingTransactions) {\n const activity = buildRepeatingRecurrences(repeatingTransaction, dateRange)\n recurrences.push(...activity)\n }\n\n return recurrences.sort(\n (a, b) =>\n getUnixTime(a.occurredOnDate || a.expectedDate) -\n getUnixTime(b.occurredOnDate || b.expectedDate),\n )\n}\n\nexport const augmentRepeatingTransactions = (\n accounts: Account[],\n repeatingTransactions: RepeatingTransaction[],\n transactions: Transaction[],\n) => {\n const augmentedRepeatingTransactions: RepeatingTransaction[] = []\n\n for (const repeatingTransaction of repeatingTransactions) {\n const relatedTransactions = transactions.filter(\n (t) => t.repeating_transaction_guid === repeatingTransaction.guid,\n )\n\n if (transactions.length > 0) {\n augmentedRepeatingTransactions.push({\n ...repeatingTransaction,\n account: accounts.find((account) => account.guid === repeatingTransaction.account_guid),\n transactions: relatedTransactions,\n })\n }\n }\n\n return augmentedRepeatingTransactions\n}\n\nexport const groupRecurrencesByDate = (recurrences: Recurrence[]): GroupedRecurrence[] => {\n return recurrences.reduce((groupedRecurrences: GroupedRecurrence[], recurrence) => {\n const dateString = formatISO(recurrence.expectedDate, { representation: 'date' })\n const existingGroup = groupedRecurrences.find(\n (group) => group.date.toString() === recurrence.expectedDate.toString(),\n )\n\n if (existingGroup) {\n existingGroup.recurrences.push(recurrence)\n } else {\n groupedRecurrences.push({\n date: recurrence.expectedDate,\n id: `date-${dateString}`,\n recurrences: [recurrence],\n })\n }\n\n return groupedRecurrences\n }, [])\n}\n\nexport const getFrequencyLabel = (\n copy: RecurringCopy,\n repeatingTransaction: RepeatingTransaction,\n showOrdinal: boolean,\n) => {\n const nextWeekday = nextDay(startOfToday(), repeatingTransaction.recurrence_day as Day)\n const nextAnnualDate = setDayOfYear(startOfToday(), repeatingTransaction.recurrence_day)\n const firstDateOrdinal = formatOrdinal(repeatingTransaction.recurrence_day)\n const secondDateOrdinal = repeatingTransaction.second_recurrence_day\n ? formatOrdinal(repeatingTransaction.second_recurrence_day)\n : ''\n\n let frequencyLabel = showOrdinal\n ? buildDynamicCopy(copy.monthly_ordinal, firstDateOrdinal)\n : copy.monthly\n\n switch (repeatingTransaction.recurrence_type) {\n case Frequency.EveryQuarter:\n frequencyLabel = showOrdinal\n ? buildDynamicCopy(copy.quarterly_ordinal, firstDateOrdinal)\n : copy.quarterly\n break\n case Frequency.EveryWeek:\n frequencyLabel = showOrdinal\n ? buildDynamicCopy(\n copy.weekly_ordinal,\n formatDate(nextWeekday, DATE_FORMATS_INTL.DAY_OF_WEEK),\n )\n : copy.weekly\n break\n case Frequency.EveryYear:\n frequencyLabel = showOrdinal\n ? buildDynamicCopy(\n copy.anually_ordinal,\n formatDate(nextAnnualDate, DATE_FORMATS_INTL.MONTH_DAY),\n )\n : copy.anually\n break\n case Frequency.EveryOtherWeek:\n frequencyLabel = showOrdinal\n ? buildDynamicCopy(\n copy.every_other_week_ordinal,\n formatDate(nextWeekday, DATE_FORMATS_INTL.DAY_OF_WEEK),\n )\n : copy.every_other_week\n break\n case Frequency.EveryOtherMonth:\n frequencyLabel = showOrdinal\n ? buildDynamicCopy(copy.every_other_month_ordinal, firstDateOrdinal)\n : copy.every_other_month\n break\n case Frequency.EveryOtherQuarter:\n frequencyLabel = showOrdinal\n ? buildDynamicCopy(copy.every_other_quarter_ordinal, firstDateOrdinal)\n : copy.every_other_quarter\n break\n case Frequency.TwiceAMonth:\n frequencyLabel = showOrdinal\n ? buildDynamicCopy(copy.twice_a_month_ordinal, firstDateOrdinal, secondDateOrdinal)\n : copy.twice_a_month\n break\n }\n\n return frequencyLabel as string\n}\n\nexport const getNextPaymentDate = (\n frequency: Frequency,\n date: Date,\n recurrenceDay?: number,\n secondRecurrenceDay?: number,\n) => {\n let baseDate = date\n\n // Apply user selected recurrenceDay based on frequency type\n if (recurrenceDay !== undefined) {\n if (frequency === Frequency.EveryWeek || frequency === Frequency.EveryOtherWeek) {\n baseDate = setDay(date, recurrenceDay)\n } else if (frequency === Frequency.EveryYear) {\n baseDate = setDayOfYear(date, recurrenceDay)\n } else {\n baseDate = setDate(date, recurrenceDay)\n }\n }\n\n let nextDate = baseDate\n\n switch (frequency) {\n case Frequency.EveryWeek:\n nextDate = getNextWeeklyDate(baseDate)\n break\n case Frequency.EveryOtherWeek:\n nextDate = getNextBiWeeklyDate(baseDate)\n break\n case Frequency.TwiceAMonth:\n nextDate = getNextTwiceMonthlyDate(\n recurrenceDay ?? baseDate.getDate(),\n secondRecurrenceDay ?? 28,\n )\n break\n case Frequency.EveryMonth:\n nextDate = getNextMonthlyDate(baseDate)\n break\n case Frequency.EveryOtherMonth:\n nextDate = getNextBiMonthlyDate(baseDate)\n break\n case Frequency.EveryQuarter:\n nextDate = getNextQuarterlyDate(baseDate)\n break\n case Frequency.EveryOtherQuarter:\n nextDate = getNextBiQuarterlyDate(baseDate)\n break\n case Frequency.EveryYear:\n nextDate = getNextYearlyDate(baseDate)\n break\n }\n\n return nextDate\n}\n\nexport const getNextUpcomingDate = (\n recurringTransaction: RepeatingTransaction,\n recurrences: Recurrence[],\n): Date => {\n const nextUpcoming = recurrences.find(\n (r) =>\n r.repeatingTransactionGuid === recurringTransaction.guid &&\n r.status === RecurrenceStatus.Upcoming,\n )\n if (nextUpcoming) return nextUpcoming.expectedDate\n\n const isPaidNearDate = (date: Date) =>\n recurrences.some(\n (r) =>\n r.repeatingTransactionGuid === recurringTransaction.guid &&\n r.status === RecurrenceStatus.Paid &&\n Math.abs(differenceInDays(r.expectedDate, date)) <= 5,\n )\n\n const frequencyAdvancers: Partial<Record<Frequency, (d: Date) => Date>> = {\n [Frequency.EveryWeek]: (d) => addWeeks(d, 1),\n [Frequency.EveryOtherWeek]: (d) => addWeeks(d, 2),\n [Frequency.TwiceAMonth]: (d) => {\n const candidates = getTwiceMonthlyDates(\n recurringTransaction.recurrence_day,\n recurringTransaction.second_recurrence_day ?? 28,\n )\n return candidates.find((c) => isAfter(c, d)) ?? candidates[candidates.length - 1]\n },\n [Frequency.EveryMonth]: (d) => addMonths(d, 1),\n [Frequency.EveryOtherMonth]: (d) => addMonths(d, 2),\n [Frequency.EveryQuarter]: (d) => addMonths(d, 3),\n [Frequency.EveryOtherQuarter]: (d) => addMonths(d, 6),\n [Frequency.EveryYear]: (d) => addYears(d, 1),\n }\n\n const baseNext = getNextPaymentDate(\n recurringTransaction.recurrence_type,\n parseISO(recurringTransaction.predicted_occurs_on),\n recurringTransaction.recurrence_day,\n recurringTransaction.second_recurrence_day,\n )\n\n if (!isPaidNearDate(baseNext)) return baseNext\n\n const advance = frequencyAdvancers[recurringTransaction.recurrence_type]\n return advance ? advance(baseNext) : baseNext\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,IAAa,KAAA,CAAwB,MAAsB;AACzD,MAAI,CAAC,EAAS,QAAO;AAErB,MAAI,IAAO,EAAQ,aAAa,EAAQ,aAAa;AACrD,SAAI,EAAQ,mBACV,IAAO,GAAG,CAAA,KAAS,EAAQ,cAAA,KAEtB;AACT,GAEM,KAAA,CACJ,GACA,MACG;AACH,QAAM,IAA4B,CAAC,GAE7B,IAAW,EAAqB,oBAAoB,EAAU,WAE9D,IAAkB,EAAqB,aAAa,KAAA,CACvD,MAAM,EAAE,+BAA+B,EAAqB,IAC/D;AAOA,MAAI,CAAC,KAAY,CAAC,EAAiB,QAAO,CAAC;AAE3C,QAAM,IAAW,EAAS,EAAqB,mBAAmB,GAC5D,IAA6B;AAAA,IACjC,aAAa,EAAqB,SAAS,QAAQ;AAAA,IACnD,QAAQ,EAAqB;AAAA,IAC7B,cAAc,GAAiB,iBAAiB;AAAA,IAChD,cAAc;AAAA,IACd,WAAW,EAAqB;AAAA,IACh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U,GAAG,CAAC;AAAA,IACjD,CAAA,EAAU,YAAA,GAAA,CAAgB,MAAM,EAAU,GAAG,CAAC;AAAA,IAC9C,CAAA,EAAU,iBAAA,GAAA,CAAqB,MAAM,EAAU,GAAG,CAAC;AAAA,IACnD,CAAA,EAAU,SAAA,GAAA,CAAa,MAAM,EAAS,GAAG,CAAC;AAAA,EAC7C,GAEM,IAAW,GACf,EAAqB,iBACrB,EAAS,EAAqB,mBAAmB,GACjD,EAAqB,gBACrB,EAAqB,qBACvB;AAEA,MAAI,CAAC,EAAe,CAAQ,EAAG,QAAO;AAEtC,QAAM,IAAU,EAAmB,EAAqB,eAAA;AACxD,SAAO,IAAU,EAAQ,CAAQ,IAAI;AACvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsUtil.es.js","names":[],"sources":["../../../src/core/utils/SettingsUtil.ts"],"sourcesContent":["import {\n type Account,\n type ClientCommunicationProfile,\n type DetailedNotificationProfile,\n type NotificationProfile,\n type SettingsCopy,\n type User,\n type UserCommunicationProfile,\n AccountNotificationTypes,\n BudgetNotificationTypes,\n InsightNotificationTypes,\n} from '../types'\n\nconst PARENT_ENTITY = 'PARENT-ENTITY'\n\nconst getProfileLabel = (notificationType: number, copy: SettingsCopy) => {\n const labelMap: Record<number, string> = {\n [BudgetNotificationTypes.BudgetExceeded]: copy.notification_budget_exceeded,\n [BudgetNotificationTypes.BudgetOffTarget]: copy.notification_budget_off_target,\n [AccountNotificationTypes.DebtPaymentReminder]: copy.notification_debt_payment_reminder,\n [AccountNotificationTypes.AccountBalanceLow]: copy.notification_low_balance,\n [AccountNotificationTypes.AccountDepositLargePosted]: copy.notification_large_deposit,\n [AccountNotificationTypes.AccountDepositLarge]: copy.notification_large_deposit,\n [AccountNotificationTypes.TransactionExpenseLarge]: copy.notification_large_expense,\n [AccountNotificationTypes.TransactionFeeCharge]: copy.notification_transaction_fee,\n [AccountNotificationTypes.InternationalTransaction]:\n copy.notification_transaction_is_international,\n [InsightNotificationTypes.AccountBalanceLow]: copy.account_balance_low,\n [InsightNotificationTypes.BillAmountNotStandard]: copy.bill_amount_not_standard,\n [InsightNotificationTypes.CategorySpending]: copy.category_spending,\n [InsightNotificationTypes.CreditCardCloseToLimit]: copy.credit_card_close_to_limit,\n [InsightNotificationTypes.DebtPaymentReminder]: copy.debt_payment_reminder,\n [InsightNotificationTypes.DuplicatePayment]: copy.duplicate_payment,\n [InsightNotificationTypes.MonthlySpendComparison]: copy.monthly_spend_comparison,\n [InsightNotificationTypes.MonthlySpendToIncomeComparison]:\n copy.monthly_spend_to_income_comparison,\n [InsightNotificationTypes.MonthlySubscriptionAggregate]: copy.monthly_subscription_aggregate,\n [InsightNotificationTypes.MonthlyTopMerchantSpending]: copy.monthly_top_merchant_spending,\n [InsightNotificationTypes.SaveAnExtra100Dollars]: copy.save_an_extra_100_dollars,\n [InsightNotificationTypes.SavingsOpportunity]: copy.savings_opportunity,\n [InsightNotificationTypes.SetUpDirectDeposit]: copy.set_up_direct_deposit,\n [InsightNotificationTypes.SwitchDirectDeposit]: copy.switch_direct_deposit,\n [InsightNotificationTypes.UncategorizedTransactions]: copy.uncategorized_transactions,\n [InsightNotificationTypes.UnifiedDeposit]: copy.unified_deposit,\n [InsightNotificationTypes.UpcomingBill]: copy.upcoming_bill,\n [InsightNotificationTypes.WeekendSpendingSummary]: copy.weekend_spending_summary,\n [InsightNotificationTypes.WeeklyNewMerchants]: copy.weekly_new_merchants,\n [InsightNotificationTypes.DiscoveredAccounts]: copy.discovered_account,\n [InsightNotificationTypes.TransactionExpenseLarge]: copy.large_transaction,\n [InsightNotificationTypes.PromotionalCampaignMessages]: copy.promotional_campaign_messages,\n [InsightNotificationTypes.TransparentOverdraft]: copy.transparent_overdraft,\n }\n\n return labelMap[notificationType] || ''\n}\n\nexport const augmentNotificationProfiles = (\n accounts: Account[],\n clientCommunicationsProfile: ClientCommunicationProfile,\n copy: SettingsCopy,\n profiles: NotificationProfile[],\n userCommunicationsProfile: UserCommunicationProfile,\n user: User,\n) => {\n const detailedProfiles = [] as DetailedNotificationProfile[]\n const {\n email_notifications_enabled: clientEmailEnabled,\n sms_notifications_enabled: clientSmsEnabled,\n push_notifications_enabled: clientPushEnabled,\n } = clientCommunicationsProfile\n\n const {\n opted_out_of_email_notifications: userEmailOptedOut,\n opted_out_of_sms_notifications: userSmsOptedOut,\n opted_out_of_push_notifications: userPushOptedOut,\n } = userCommunicationsProfile\n\n for (const profile of profiles.filter((profile) => profile.entity_guid === PARENT_ENTITY)) {\n const label = getProfileLabel(profile.notification_type, copy)\n const children = profiles.filter(\n (child) =>\n child.entity_guid !== PARENT_ENTITY &&\n child.notification_type === profile.notification_type &&\n accounts.some((account) => account.guid === child.entity_guid),\n )\n\n const deliveryMethods = [] as string[]\n if (clientEmailEnabled && !userEmailOptedOut && profile.email_channel && user.email) {\n deliveryMethods.push(copy.delivery_method_email_label)\n }\n if (clientSmsEnabled && !userSmsOptedOut && profile.sms_channel && user.phone) {\n deliveryMethods.push(copy.delivery_method_sms_label)\n }\n if (clientPushEnabled && !userPushOptedOut && profile.push_channel) {\n deliveryMethods.push(copy.delivery_method_push_label)\n }\n\n detailedProfiles.push({\n ...profile,\n children: children.map((child) => ({\n ...child,\n account: accounts.find((a) => a.guid === child.entity_guid),\n label,\n })),\n deliveryMethodsLabel: deliveryMethods.join(', '),\n label,\n })\n }\n\n return detailedProfiles\n}\n"],"mappings":";AAaA,IAAM,IAAgB,iBAEhB,IAAA,CAAmB,GAA0B,OAsC1C;AAAA,
|
|
1
|
+
{"version":3,"file":"SettingsUtil.es.js","names":[],"sources":["../../../src/core/utils/SettingsUtil.ts"],"sourcesContent":["import {\n type Account,\n type ClientCommunicationProfile,\n type DetailedNotificationProfile,\n type NotificationProfile,\n type SettingsCopy,\n type User,\n type UserCommunicationProfile,\n AccountNotificationTypes,\n BudgetNotificationTypes,\n InsightNotificationTypes,\n} from '../types'\n\nconst PARENT_ENTITY = 'PARENT-ENTITY'\n\nconst getProfileLabel = (notificationType: number, copy: SettingsCopy) => {\n const labelMap: Record<number, string> = {\n [BudgetNotificationTypes.BudgetExceeded]: copy.notification_budget_exceeded,\n [BudgetNotificationTypes.BudgetOffTarget]: copy.notification_budget_off_target,\n [AccountNotificationTypes.DebtPaymentReminder]: copy.notification_debt_payment_reminder,\n [AccountNotificationTypes.AccountBalanceLow]: copy.notification_low_balance,\n [AccountNotificationTypes.AccountDepositLargePosted]: copy.notification_large_deposit,\n [AccountNotificationTypes.AccountDepositLarge]: copy.notification_large_deposit,\n [AccountNotificationTypes.TransactionExpenseLarge]: copy.notification_large_expense,\n [AccountNotificationTypes.TransactionFeeCharge]: copy.notification_transaction_fee,\n [AccountNotificationTypes.InternationalTransaction]:\n copy.notification_transaction_is_international,\n [InsightNotificationTypes.AccountBalanceLow]: copy.account_balance_low,\n [InsightNotificationTypes.BillAmountNotStandard]: copy.bill_amount_not_standard,\n [InsightNotificationTypes.CategorySpending]: copy.category_spending,\n [InsightNotificationTypes.CreditCardCloseToLimit]: copy.credit_card_close_to_limit,\n [InsightNotificationTypes.DebtPaymentReminder]: copy.debt_payment_reminder,\n [InsightNotificationTypes.DuplicatePayment]: copy.duplicate_payment,\n [InsightNotificationTypes.MonthlySpendComparison]: copy.monthly_spend_comparison,\n [InsightNotificationTypes.MonthlySpendToIncomeComparison]:\n copy.monthly_spend_to_income_comparison,\n [InsightNotificationTypes.MonthlySubscriptionAggregate]: copy.monthly_subscription_aggregate,\n [InsightNotificationTypes.MonthlyTopMerchantSpending]: copy.monthly_top_merchant_spending,\n [InsightNotificationTypes.SaveAnExtra100Dollars]: copy.save_an_extra_100_dollars,\n [InsightNotificationTypes.SavingsOpportunity]: copy.savings_opportunity,\n [InsightNotificationTypes.SetUpDirectDeposit]: copy.set_up_direct_deposit,\n [InsightNotificationTypes.SwitchDirectDeposit]: copy.switch_direct_deposit,\n [InsightNotificationTypes.UncategorizedTransactions]: copy.uncategorized_transactions,\n [InsightNotificationTypes.UnifiedDeposit]: copy.unified_deposit,\n [InsightNotificationTypes.UpcomingBill]: copy.upcoming_bill,\n [InsightNotificationTypes.WeekendSpendingSummary]: copy.weekend_spending_summary,\n [InsightNotificationTypes.WeeklyNewMerchants]: copy.weekly_new_merchants,\n [InsightNotificationTypes.DiscoveredAccounts]: copy.discovered_account,\n [InsightNotificationTypes.TransactionExpenseLarge]: copy.large_transaction,\n [InsightNotificationTypes.PromotionalCampaignMessages]: copy.promotional_campaign_messages,\n [InsightNotificationTypes.TransparentOverdraft]: copy.transparent_overdraft,\n }\n\n return labelMap[notificationType] || ''\n}\n\nexport const augmentNotificationProfiles = (\n accounts: Account[],\n clientCommunicationsProfile: ClientCommunicationProfile,\n copy: SettingsCopy,\n profiles: NotificationProfile[],\n userCommunicationsProfile: UserCommunicationProfile,\n user: User,\n) => {\n const detailedProfiles = [] as DetailedNotificationProfile[]\n const {\n email_notifications_enabled: clientEmailEnabled,\n sms_notifications_enabled: clientSmsEnabled,\n push_notifications_enabled: clientPushEnabled,\n } = clientCommunicationsProfile\n\n const {\n opted_out_of_email_notifications: userEmailOptedOut,\n opted_out_of_sms_notifications: userSmsOptedOut,\n opted_out_of_push_notifications: userPushOptedOut,\n } = userCommunicationsProfile\n\n for (const profile of profiles.filter((profile) => profile.entity_guid === PARENT_ENTITY)) {\n const label = getProfileLabel(profile.notification_type, copy)\n const children = profiles.filter(\n (child) =>\n child.entity_guid !== PARENT_ENTITY &&\n child.notification_type === profile.notification_type &&\n accounts.some((account) => account.guid === child.entity_guid),\n )\n\n const deliveryMethods = [] as string[]\n if (clientEmailEnabled && !userEmailOptedOut && profile.email_channel && user.email) {\n deliveryMethods.push(copy.delivery_method_email_label)\n }\n if (clientSmsEnabled && !userSmsOptedOut && profile.sms_channel && user.phone) {\n deliveryMethods.push(copy.delivery_method_sms_label)\n }\n if (clientPushEnabled && !userPushOptedOut && profile.push_channel) {\n deliveryMethods.push(copy.delivery_method_push_label)\n }\n\n detailedProfiles.push({\n ...profile,\n children: children.map((child) => ({\n ...child,\n account: accounts.find((a) => a.guid === child.entity_guid),\n label,\n })),\n deliveryMethodsLabel: deliveryMethods.join(', '),\n label,\n })\n }\n\n return detailedProfiles\n}\n"],"mappings":";AAaA,IAAM,IAAgB,iBAEhB,IAAA,CAAmB,GAA0B,OAsC1C;AAAA,EApCJ,CAAA,EAAwB,cAAA,GAAiB,EAAK;AAAA,EAC9C,CAAA,EAAwB,eAAA,GAAkB,EAAK;AAAA,EAC/C,CAAA,EAAyB,mBAAA,GAAsB,EAAK;AAAA,EACpD,CAAA,EAAyB,iBAAA,GAAoB,EAAK;AAAA,EAClD,CAAA,EAAyB,yBAAA,GAA4B,EAAK;AAAA,EAC1D,CAAA,EAAyB,mBAAA,GAAsB,EAAK;AAAA,EACpD,CAAA,EAAyB,uBAAA,GAA0B,EAAK;AAAA,EACxD,CAAA,EAAyB,oBAAA,GAAuB,EAAK;AAAA,EACrD,CAAA,EAAyB,wBAAA,GACxB,EAAK;AAAA,EACN,CAAA,EAAyB,iBAAA,GAAoB,EAAK;AAAA,EAClD,CAAA,EAAyB,qBAAA,GAAwB,EAAK;AAAA,EACtD,CAAA,EAAyB,gBAAA,GAAmB,EAAK;AAAA,EACjD,CAAA,EAAyB,sBAAA,GAAyB,EAAK;AAAA,EACvD,CAAA,EAAyB,mBAAA,GAAsB,EAAK;AAAA,EACpD,CAAA,EAAyB,gBAAA,GAAmB,EAAK;AAAA,EACjD,CAAA,EAAyB,sBAAA,GAAyB,EAAK;AAAA,EACvD,CAAA,EAAyB,8BAAA,GACxB,EAAK;AAAA,EACN,CAAA,EAAyB,4BAAA,GAA+B,EAAK;AAAA,EAC7D,CAAA,EAAyB,0BAAA,GAA6B,EAAK;AAAA,EAC3D,CAAA,EAAyB,qBAAA,GAAwB,EAAK;AAAA,EACtD,CAAA,EAAyB,kBAAA,GAAqB,EAAK;AAAA,EACnD,CAAA,EAAyB,kBAAA,GAAqB,EAAK;AAAA,EACnD,CAAA,EAAyB,mBAAA,GAAsB,EAAK;A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W;AAAA,QACjC,GAAG;AAAA,QACH,SAAS,EAAS,KAAA,CAAM,MAAM,EAAE,SAAS,EAAM,WAAW;AAAA,QAC1D,OAAA;AAAA,MACF,EAAE;AAAA,MACF,sBAAsB,EAAgB,KAAK,IAAI;AAAA,MAC/C,OAAA;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionUtils.es.js","names":[],"sources":["../../../src/core/utils/TransactionUtils.ts"],"sourcesContent":["import { endOfToday } from 'date-fns/endOfToday'\nimport { format } from 'date-fns/format'\nimport { fromUnixTime } from 'date-fns/fromUnixTime'\nimport { getUnixTime } from 'date-fns/getUnixTime'\nimport { startOfMonth } from 'date-fns/startOfMonth'\nimport { startOfToday } from 'date-fns/startOfToday'\n\nimport { TABLE_CONST } from '../constants/Table'\nimport {\n CategoryGuids,\n CategoryGuidToName,\n DATE_FORMATS_INTL,\n formatDate,\n ORDINAL_DATE_FORMAT,\n} from '../constants'\nimport { COLUMN_NAMES } from '../constants/Transaction'\nimport { TransactionStatus, TransactionType } from '../types'\nimport type { Account, Category, Tag, Tagging, Transaction } from '../types'\n\nimport { type TransactionFilter } from '../stores/TransactionStore'\n\nimport { formatCurrency } from './NumberFormatting'\n\ninterface AccountsMap {\n [key: string]: Account\n}\n\ninterface CategoriesMap {\n [key: string]: Category\n}\n\ninterface TaggingsMap {\n [key: string]: string[]\n}\n\nexport const buildDetailedTransactions = (\n transactions: Transaction[],\n accounts: Account[],\n categories: Category[],\n taggings: Tagging[] = [],\n) => {\n const accountsMap = accounts.reduce((acc: AccountsMap, account: Account) => {\n return { ...acc, [account.guid]: account }\n }, {})\n\n const categoriesMap = categories.reduce((acc: CategoriesMap, category: Category) => {\n return { ...acc, [category.guid]: category }\n }, {})\n\n const taggingsMap = taggings.reduce((acc: TaggingsMap, tagging: Tagging) => {\n const { transaction_guid, tag_guid } = tagging\n\n if (!acc[transaction_guid]) {\n return {\n ...acc,\n [transaction_guid]: [tag_guid],\n }\n }\n const tags = [...acc[transaction_guid], tag_guid] as string[]\n\n return {\n ...acc,\n [transaction_guid]: tags,\n }\n }, {})\n\n return transactions.map((transaction: Transaction) => {\n const account = accountsMap[transaction.account_guid]\n const category = transaction.category_guid ? categoriesMap[transaction.category_guid] : null\n const tags = taggingsMap[transaction.guid] ?? []\n\n return {\n ...transaction,\n account: account?.user_name || 'Unknown',\n accountIsClosed: account?.is_closed,\n accountIsHidden: account?.is_hidden,\n category: category?.name || 'Uncategorized',\n isIncome: transaction.top_level_category_guid === CategoryGuids.INCOME,\n isPending: transaction.feed_status === TransactionStatus.PENDING,\n number: account?.account_number || '',\n payee: transaction.description,\n tags,\n }\n })\n}\n\nconst UNCATEGORIZED_TERM = 'uncategorized'\n\nexport const sortAndFilterTransactions = (\n filter: TransactionFilter,\n expandedSplits: string[],\n sortColumn: string,\n sortDirection: string,\n tags: Tag[],\n transactions: Transaction[],\n) => {\n const filteredTransactions = filterTransactions(filter, tags, transactions)\n\n const sortedTransactions = sortTransactions(filteredTransactions, sortColumn, sortDirection)\n\n expandedSplits.forEach((guid) => {\n const index = sortedTransactions.findIndex((t) => t.guid === guid)\n const children = transactions.filter((t) => t.parent_guid === guid)\n sortedTransactions.splice(index + 1, 0, ...children)\n })\n return sortedTransactions\n}\n\nconst filterTransactions = (\n filter: TransactionFilter,\n tags: Tag[],\n transactions: Transaction[],\n) => {\n const {\n accounts = [],\n dateRange = { start: startOfMonth(startOfToday()), end: endOfToday() },\n custom = () => true,\n searchTerm: searchFilter = '',\n showSplits = false,\n } = filter\n\n return (\n transactions\n // Filters out parent of split transactions when showSplits is true and filters out split\n // transaction children when showSplits is false\n .filter((t) => (showSplits ? !t.has_been_split : !t.parent_guid))\n // Filter for selected accounts\n .filter((t) => Boolean(accounts.find((guid) => guid === t.account_guid)))\n // Filter for Date Range\n .filter((t) => t.date >= getUnixTime(dateRange.start) && t.date <= getUnixTime(dateRange.end))\n // Custom filter\n .filter(custom)\n // Search filter\n .filter((transaction) => {\n // Don't return uncategorized split transactions\n if (searchFilter === UNCATEGORIZED_TERM && transaction.has_been_split) {\n return false\n }\n\n // Split check - When searching for \"Splits\" and transaction is a split or is a parent of a split(s)\n const splitPattern = /^spl/i\n if (\n splitPattern.test(searchFilter) &&\n (transaction.has_been_split || Boolean(transaction.parent_guid))\n ) {\n return true\n }\n\n // Check transactions tags\n const isTagIncludedInSearch = transaction.tags.some((guid) =>\n isIncludedInSearch(searchFilter, tags.find((tag) => tag.guid === guid)?.name),\n )\n const date = fromUnixTime(transaction.date)\n return (\n isIncludedInSearch(searchFilter, transaction.payee) ||\n isIncludedInSearch(searchFilter, transaction.feed_description) ||\n isIncludedInSearch(searchFilter, transaction.category) ||\n isIncludedInSearch(searchFilter, formatDate(date, DATE_FORMATS_INTL.MONTH)) ||\n isIncludedInSearch(searchFilter, formatDate(date, DATE_FORMATS_INTL.DAY)) ||\n isIncludedInSearch(searchFilter, formatDate(date, DATE_FORMATS_INTL.FULL_MONTH_DAY)) ||\n isIncludedInSearch(searchFilter, formatDate(date, DATE_FORMATS_INTL.MONTH_DAY_YEAR)) ||\n isIncludedInSearch(searchFilter, format(date, ORDINAL_DATE_FORMAT)) ||\n isIncludedInSearch(searchFilter, transaction.account) ||\n isIncludedInSearch(searchFilter, formatCurrency(transaction.amount, '0,0.00')) ||\n isIncludedInSearch(searchFilter, transaction.memo) ||\n isTagIncludedInSearch\n )\n })\n )\n}\n\nconst sortTransactions = (\n transactions: Transaction[],\n sortColumn: string,\n sortDirection: string,\n) => {\n return [...transactions].sort((a: Transaction, b: Transaction) => {\n const column = sortColumn as keyof Transaction\n const sortCompare = (a[column] || '') > (b[column] || '')\n\n let sortASC = sortCompare ? -1 : 1\n let sortDESC = sortCompare ? 1 : -1\n\n if (sortColumn === COLUMN_NAMES.DATE || sortColumn === COLUMN_NAMES.AMOUNT) {\n sortASC = sortCompare ? 1 : -1\n sortDESC = sortCompare ? -1 : 1\n }\n\n return sortDirection === TABLE_CONST.ASC ? sortASC : sortDESC\n })\n}\n\n/**\n * Determines if a value is included within the terms set in the search bar\n */\nconst isIncludedInSearch = (searchFilter: string, value: string | null | undefined) => {\n const lowerCasedTerms = searchFilter.toLowerCase().split(' ')\n const lowerCasedValue = value?.toString().toLowerCase() ?? ''\n\n return lowerCasedTerms.every((filter) => lowerCasedValue.indexOf(filter) > -1)\n}\n\n// TODO: Change the way formatting data is exported in order to handle localization\ntype FormattedTransaction = {\n Date: string\n Description: string\n 'Original Description': string\n Amount: string\n Type: string\n 'Parent Category': string\n Category: string\n Account: string\n Tags: string\n Memo: string\n Pending: string\n}\n\n/**\n * Collects the GUIDs of all transactions that act as parents\n * to one or more split (child) transactions.\n */\nfunction extractParentTransactionGuids(transactions: Transaction[]): Set<string> {\n return new Set(\n transactions.filter((tx) => tx.parent_guid !== undefined).map((tx) => tx.parent_guid!),\n )\n}\n\n/**\n * Organizes child transactions by their parent transaction GUID.\n * Returns a map from parent GUID to an array of its child transactions.\n */\nfunction mapChildTransactionsByParent(transactions: Transaction[]): Record<string, Transaction[]> {\n return transactions.reduce<Record<string, Transaction[]>>((accumulator, tx) => {\n if (tx.parent_guid) {\n if (!accumulator[tx.parent_guid]) accumulator[tx.parent_guid] = []\n accumulator[tx.parent_guid].push(tx)\n }\n return accumulator\n }, {})\n}\n\n/**\n * Produces a list of transactions based on the given sorted transactions,\n * where parent transactions that have split children are replaced by those\n * children sorted by descending absolute amount. All other transactions\n * are included as-is, with duplicates removed.\n */\nexport function flattenTransactionsWithSplits(\n sortedTransactions: Transaction[],\n allTransactions: Transaction[],\n): Transaction[] {\n // Set of parent transaction GUIDs that have split child transactions\n const parentTransactionGuidsWithSplits = extractParentTransactionGuids(allTransactions)\n\n // Map from parent GUID to array of its child split transactions\n const childTransactionsGroupedByParent = mapChildTransactionsByParent(allTransactions)\n\n // Track GUIDs of transactions already included in the result to avoid duplicates\n const processedTransactionGuids = new Set<string>()\n\n // Resulting list of transactions with parents replaced by their split children\n const flattenedTransactionList: Transaction[] = []\n\n for (const transaction of sortedTransactions) {\n if (parentTransactionGuidsWithSplits.has(transaction.guid)) {\n // This transaction is a parent with splits, so replace it with its children\n const splitChildTransactions = childTransactionsGroupedByParent[transaction.guid] ?? []\n\n splitChildTransactions\n .slice()\n .sort((a, b) => Math.abs(b.amount) - Math.abs(a.amount))\n .forEach((childTransaction) => {\n if (!processedTransactionGuids.has(childTransaction.guid)) {\n flattenedTransactionList.push(childTransaction)\n processedTransactionGuids.add(childTransaction.guid)\n }\n })\n } else if (!processedTransactionGuids.has(transaction.guid)) {\n // Normal transaction (no splits), add as-is if not already added\n flattenedTransactionList.push(transaction)\n processedTransactionGuids.add(transaction.guid)\n }\n }\n\n return flattenedTransactionList\n}\n\nexport const exportTransactionsToCSV = (transactions: Transaction[], tags: Tag[]) => {\n const csvContent = structureCSVData(formatTransactions(transactions, tags))\n\n const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' })\n const link = document.createElement('a')\n link.href = URL.createObjectURL(blob)\n link.setAttribute('download', 'transactions.csv')\n\n document.body.appendChild(link)\n link.click()\n document.body.removeChild(link)\n\n URL.revokeObjectURL(link.href)\n}\n\n/**\n * Formats a list of transactions into a list that will be used when\n * downloaded to a CSV file.\n */\nconst formatTransactions = (transactions: Transaction[], tags: Tag[]) => {\n return transactions.map((transaction) => ({\n Date: formatDate(fromUnixTime(transaction.date), DATE_FORMATS_INTL.YEAR_MONTH_DAY),\n Description: getDescription(transaction),\n 'Original Description': transaction.feed_description,\n Amount: `${transaction.amount}`,\n Type: transaction.transaction_type === TransactionType.CREDIT ? 'Credit' : 'Debit',\n 'Parent Category': CategoryGuidToName[transaction.top_level_category_guid || ''],\n Category: transaction.category,\n Account: transaction.account,\n Tags: getTags(transaction, tags),\n Memo: transaction.memo,\n Pending: transaction.isPending ? 'TRUE' : 'FALSE',\n })) as FormattedTransaction[]\n}\n\n/**\n * Escapes a value for safe CSV output\n */\nconst escapeCsvField = (field?: string | null): string => {\n if (!field) return ''\n return /[,\"\\n\\r]/.test(field) ? `\"${field.replace(/\"/g, '\"\"')}\"` : field\n}\n\n/**\n * Structures the CSV file data using the formatted transactions\n */\nconst structureCSVData = (formattedTransactions: FormattedTransaction[]) => {\n const csvHeader = Object.keys(formattedTransactions[0]).join(',').concat('\\r\\n')\n const csvRows = formattedTransactions\n .map((transaction) => Object.values(transaction).map(escapeCsvField).join(','))\n .join('\\r\\n')\n\n return csvHeader + csvRows\n}\n\n/**\n * Get the description for a transaction that will be used within the CSV copy.\n * We want to highlight that split transactions are a split as well as\n * hidden transactions are hidden.\n */\nconst getDescription = (transaction: Transaction) => {\n let description = transaction.parent_guid ? 'Split: ' : ''\n description += transaction.is_hidden ? '(Excluded) ' : ''\n description += transaction.description\n\n return description\n}\n\nconst getTags = (transaction: Transaction, tags: Tag[]) => {\n return transaction.tags\n .map((tagGuid) => {\n const tag = tags.filter((t) => t.guid === tagGuid)[0]\n\n return tag?.name ?? ''\n })\n .join(' ')\n}\n"],"mappings":";;;;;;;;;;;;AAmCA,IAAa,IAAA,CACX,GACA,GACA,GACA,IAAsB,CAAC,MACpB;AACH,QAAM,IAAc,EAAS,OAAA,CAAQ,GAAkB,OAC9C;AAAA,IAAE,GAAG;AAAA,KAAM,EAAQ,IAAA,GAAO;AAAA,EAAQ,IACxC,CAAC,CAAC,GAEC,IAAgB,EAAW,OAAA,CAAQ,GAAoB,OACpD;AAAA,IAAE,GAAG;AAAA,KAAM,EAAS,IAAA,GAAO;AAAA,EAAS,IAC1C,CAAC,CAAC,GAEC,IAAc,EAAS,OAAA,CAAQ,GAAkB,MAAqB;AAC1E,UAAM,EAAE,kBAAA,GAAkB,UAAA,EAAA,IAAa;AAEvC,QAAI,CAAC,EAAI,CAAA,EACP,QAAO;AAAA,MACL,GAAG;AAAA,OACF,CAAA,GAAmB,CAAC,CAAQ;AAAA,IAC/B;AAEF,UAAM,IAAO,CAAC,GAAG,EAAI,CAAA,GAAmB,CAAQ;AAEhD,WAA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C7E,KAAK;AAAA,CAEW,GAQf,IAAA,CAAkB,MAA6B;AACnD,MAAI,IAAc,EAAY,cAAc,YAAY;AACxD,SAAA,KAAe,EAAY,YAAY,gBAAgB,IACvD,KAAe,EAAY,aAEpB;AACT,GAEM,IAAA,CAAW,GAA0B,MAClC,EAAY,KAChB,IAAA,CAAK,MACQ,EAAK,OAAA,CAAQ,MAAM,EAAE,SAAS,CAAO,EAAE,CAAA,GAEvC,QAAQ,EACrB,EACA,KAAK,GAAG"}
|
|
1
|
+
{"version":3,"file":"TransactionUtils.es.js","names":[],"sources":["../../../src/core/utils/TransactionUtils.ts"],"sourcesContent":["import { endOfToday } from 'date-fns/endOfToday'\nimport { format } from 'date-fns/format'\nimport { fromUnixTime } from 'date-fns/fromUnixTime'\nimport { getUnixTime } from 'date-fns/getUnixTime'\nimport { startOfMonth } from 'date-fns/startOfMonth'\nimport { startOfToday } from 'date-fns/startOfToday'\n\nimport { TABLE_CONST } from '../constants/Table'\nimport {\n CategoryGuids,\n CategoryGuidToName,\n DATE_FORMATS_INTL,\n formatDate,\n ORDINAL_DATE_FORMAT,\n} from '../constants'\nimport { COLUMN_NAMES } from '../constants/Transaction'\nimport { TransactionStatus, TransactionType } from '../types'\nimport type { Account, Category, Tag, Tagging, Transaction } from '../types'\n\nimport { type TransactionFilter } from '../stores/TransactionStore'\n\nimport { formatCurrency } from './NumberFormatting'\n\ninterface AccountsMap {\n [key: string]: Account\n}\n\ninterface CategoriesMap {\n [key: string]: Category\n}\n\ninterface TaggingsMap {\n [key: string]: string[]\n}\n\nexport const buildDetailedTransactions = (\n transactions: Transaction[],\n accounts: Account[],\n categories: Category[],\n taggings: Tagging[] = [],\n) => {\n const accountsMap = accounts.reduce((acc: AccountsMap, account: Account) => {\n return { ...acc, [account.guid]: account }\n }, {})\n\n const categoriesMap = categories.reduce((acc: CategoriesMap, category: Category) => {\n return { ...acc, [category.guid]: category }\n }, {})\n\n const taggingsMap = taggings.reduce((acc: TaggingsMap, tagging: Tagging) => {\n const { transaction_guid, tag_guid } = tagging\n\n if (!acc[transaction_guid]) {\n return {\n ...acc,\n [transaction_guid]: [tag_guid],\n }\n }\n const tags = [...acc[transaction_guid], tag_guid] as string[]\n\n return {\n ...acc,\n [transaction_guid]: tags,\n }\n }, {})\n\n return transactions.map((transaction: Transaction) => {\n const account = accountsMap[transaction.account_guid]\n const category = transaction.category_guid ? categoriesMap[transaction.category_guid] : null\n const tags = taggingsMap[transaction.guid] ?? []\n\n return {\n ...transaction,\n account: account?.user_name || 'Unknown',\n accountIsClosed: account?.is_closed,\n accountIsHidden: account?.is_hidden,\n category: category?.name || 'Uncategorized',\n isIncome: transaction.top_level_category_guid === CategoryGuids.INCOME,\n isPending: transaction.feed_status === TransactionStatus.PENDING,\n number: account?.account_number || '',\n payee: transaction.description,\n tags,\n }\n })\n}\n\nconst UNCATEGORIZED_TERM = 'uncategorized'\n\nexport const sortAndFilterTransactions = (\n filter: TransactionFilter,\n expandedSplits: string[],\n sortColumn: string,\n sortDirection: string,\n tags: Tag[],\n transactions: Transaction[],\n) => {\n const filteredTransactions = filterTransactions(filter, tags, transactions)\n\n const sortedTransactions = sortTransactions(filteredTransactions, sortColumn, sortDirection)\n\n expandedSplits.forEach((guid) => {\n const index = sortedTransactions.findIndex((t) => t.guid === guid)\n const children = transactions.filter((t) => t.parent_guid === guid)\n sortedTransactions.splice(index + 1, 0, ...children)\n })\n return sortedTransactions\n}\n\nconst filterTransactions = (\n filter: TransactionFilter,\n tags: Tag[],\n transactions: Transaction[],\n) => {\n const {\n accounts = [],\n dateRange = { start: startOfMonth(startOfToday()), end: endOfToday() },\n custom = () => true,\n searchTerm: searchFilter = '',\n showSplits = false,\n } = filter\n\n return (\n transactions\n // Filters out parent of split transactions when showSplits is true and filters out split\n // transaction children when showSplits is false\n .filter((t) => (showSplits ? !t.has_been_split : !t.parent_guid))\n // Filter for selected accounts\n .filter((t) => Boolean(accounts.find((guid) => guid === t.account_guid)))\n // Filter for Date Range\n .filter((t) => t.date >= getUnixTime(dateRange.start) && t.date <= getUnixTime(dateRange.end))\n // Custom filter\n .filter(custom)\n // Search filter\n .filter((transaction) => {\n // Don't return uncategorized split transactions\n if (searchFilter === UNCATEGORIZED_TERM && transaction.has_been_split) {\n return false\n }\n\n // Split check - When searching for \"Splits\" and transaction is a split or is a parent of a split(s)\n const splitPattern = /^spl/i\n if (\n splitPattern.test(searchFilter) &&\n (transaction.has_been_split || Boolean(transaction.parent_guid))\n ) {\n return true\n }\n\n // Check transactions tags\n const isTagIncludedInSearch = transaction.tags.some((guid) =>\n isIncludedInSearch(searchFilter, tags.find((tag) => tag.guid === guid)?.name),\n )\n const date = fromUnixTime(transaction.date)\n return (\n isIncludedInSearch(searchFilter, transaction.payee) ||\n isIncludedInSearch(searchFilter, transaction.feed_description) ||\n isIncludedInSearch(searchFilter, transaction.category) ||\n isIncludedInSearch(searchFilter, formatDate(date, DATE_FORMATS_INTL.MONTH)) ||\n isIncludedInSearch(searchFilter, formatDate(date, DATE_FORMATS_INTL.DAY)) ||\n isIncludedInSearch(searchFilter, formatDate(date, DATE_FORMATS_INTL.FULL_MONTH_DAY)) ||\n isIncludedInSearch(searchFilter, formatDate(date, DATE_FORMATS_INTL.MONTH_DAY_YEAR)) ||\n isIncludedInSearch(searchFilter, format(date, ORDINAL_DATE_FORMAT)) ||\n isIncludedInSearch(searchFilter, transaction.account) ||\n isIncludedInSearch(searchFilter, formatCurrency(transaction.amount, '0,0.00')) ||\n isIncludedInSearch(searchFilter, transaction.memo) ||\n isTagIncludedInSearch\n )\n })\n )\n}\n\nconst sortTransactions = (\n transactions: Transaction[],\n sortColumn: string,\n sortDirection: string,\n) => {\n return [...transactions].sort((a: Transaction, b: Transaction) => {\n const column = sortColumn as keyof Transaction\n const sortCompare = (a[column] || '') > (b[column] || '')\n\n let sortASC = sortCompare ? -1 : 1\n let sortDESC = sortCompare ? 1 : -1\n\n if (sortColumn === COLUMN_NAMES.DATE || sortColumn === COLUMN_NAMES.AMOUNT) {\n sortASC = sortCompare ? 1 : -1\n sortDESC = sortCompare ? -1 : 1\n }\n\n return sortDirection === TABLE_CONST.ASC ? sortASC : sortDESC\n })\n}\n\n/**\n * Determines if a value is included within the terms set in the search bar\n */\nconst isIncludedInSearch = (searchFilter: string, value: string | null | undefined) => {\n const lowerCasedTerms = searchFilter.toLowerCase().split(' ')\n const lowerCasedValue = value?.toString().toLowerCase() ?? ''\n\n return lowerCasedTerms.every((filter) => lowerCasedValue.indexOf(filter) > -1)\n}\n\n// TODO: Change the way formatting data is exported in order to handle localization\ntype FormattedTransaction = {\n Date: string\n Description: string\n 'Original Description': string\n Amount: string\n Type: string\n 'Parent Category': string\n Category: string\n Account: string\n Tags: string\n Memo: string\n Pending: string\n}\n\n/**\n * Collects the GUIDs of all transactions that act as parents\n * to one or more split (child) transactions.\n */\nfunction extractParentTransactionGuids(transactions: Transaction[]): Set<string> {\n return new Set(\n transactions.filter((tx) => tx.parent_guid !== undefined).map((tx) => tx.parent_guid!),\n )\n}\n\n/**\n * Organizes child transactions by their parent transaction GUID.\n * Returns a map from parent GUID to an array of its child transactions.\n */\nfunction mapChildTransactionsByParent(transactions: Transaction[]): Record<string, Transaction[]> {\n return transactions.reduce<Record<string, Transaction[]>>((accumulator, tx) => {\n if (tx.parent_guid) {\n if (!accumulator[tx.parent_guid]) accumulator[tx.parent_guid] = []\n accumulator[tx.parent_guid].push(tx)\n }\n return accumulator\n }, {})\n}\n\n/**\n * Produces a list of transactions based on the given sorted transactions,\n * where parent transactions that have split children are replaced by those\n * children sorted by descending absolute amount. All other transactions\n * are included as-is, with duplicates removed.\n */\nexport function flattenTransactionsWithSplits(\n sortedTransactions: Transaction[],\n allTransactions: Transaction[],\n): Transaction[] {\n // Set of parent transaction GUIDs that have split child transactions\n const parentTransactionGuidsWithSplits = extractParentTransactionGuids(allTransactions)\n\n // Map from parent GUID to array of its child split transactions\n const childTransactionsGroupedByParent = mapChildTransactionsByParent(allTransactions)\n\n // Track GUIDs of transactions already included in the result to avoid duplicates\n const processedTransactionGuids = new Set<string>()\n\n // Resulting list of transactions with parents replaced by their split children\n const flattenedTransactionList: Transaction[] = []\n\n for (const transaction of sortedTransactions) {\n if (parentTransactionGuidsWithSplits.has(transaction.guid)) {\n // This transaction is a parent with splits, so replace it with its children\n const splitChildTransactions = childTransactionsGroupedByParent[transaction.guid] ?? []\n\n splitChildTransactions\n .slice()\n .sort((a, b) => Math.abs(b.amount) - Math.abs(a.amount))\n .forEach((childTransaction) => {\n if (!processedTransactionGuids.has(childTransaction.guid)) {\n flattenedTransactionList.push(childTransaction)\n processedTransactionGuids.add(childTransaction.guid)\n }\n })\n } else if (!processedTransactionGuids.has(transaction.guid)) {\n // Normal transaction (no splits), add as-is if not already added\n flattenedTransactionList.push(transaction)\n processedTransactionGuids.add(transaction.guid)\n }\n }\n\n return flattenedTransactionList\n}\n\nexport const exportTransactionsToCSV = (transactions: Transaction[], tags: Tag[]) => {\n const csvContent = structureCSVData(formatTransactions(transactions, tags))\n\n const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' })\n const link = document.createElement('a')\n link.href = URL.createObjectURL(blob)\n link.setAttribute('download', 'transactions.csv')\n\n document.body.appendChild(link)\n link.click()\n document.body.removeChild(link)\n\n URL.revokeObjectURL(link.href)\n}\n\n/**\n * Formats a list of transactions into a list that will be used when\n * downloaded to a CSV file.\n */\nconst formatTransactions = (transactions: Transaction[], tags: Tag[]) => {\n return transactions.map((transaction) => ({\n Date: formatDate(fromUnixTime(transaction.date), DATE_FORMATS_INTL.YEAR_MONTH_DAY),\n Description: getDescription(transaction),\n 'Original Description': transaction.feed_description,\n Amount: `${transaction.amount}`,\n Type: transaction.transaction_type === TransactionType.CREDIT ? 'Credit' : 'Debit',\n 'Parent Category': CategoryGuidToName[transaction.top_level_category_guid || ''],\n Category: transaction.category,\n Account: transaction.account,\n Tags: getTags(transaction, tags),\n Memo: transaction.memo,\n Pending: transaction.isPending ? 'TRUE' : 'FALSE',\n })) as FormattedTransaction[]\n}\n\n/**\n * Escapes a value for safe CSV output\n */\nconst escapeCsvField = (field?: string | null): string => {\n if (!field) return ''\n return /[,\"\\n\\r]/.test(field) ? `\"${field.replace(/\"/g, '\"\"')}\"` : field\n}\n\n/**\n * Structures the CSV file data using the formatted transactions\n */\nconst structureCSVData = (formattedTransactions: FormattedTransaction[]) => {\n const csvHeader = Object.keys(formattedTransactions[0]).join(',').concat('\\r\\n')\n const csvRows = formattedTransactions\n .map((transaction) => Object.values(transaction).map(escapeCsvField).join(','))\n .join('\\r\\n')\n\n return csvHeader + csvRows\n}\n\n/**\n * Get the description for a transaction that will be used within the CSV copy.\n * We want to highlight that split transactions are a split as well as\n * hidden transactions are hidden.\n */\nconst getDescription = (transaction: Transaction) => {\n let description = transaction.parent_guid ? 'Split: ' : ''\n description += transaction.is_hidden ? '(Excluded) ' : ''\n description += transaction.description\n\n return description\n}\n\nconst getTags = (transaction: Transaction, tags: Tag[]) => {\n return transaction.tags\n .map((tagGuid) => {\n const tag = tags.filter((t) => t.guid === tagGuid)[0]\n\n return tag?.name ?? ''\n })\n .join(' ')\n}\n"],"mappings":";;;;;;;;;;;;AAmCA,IAAa,IAAA,CACX,GACA,GACA,GACA,IAAsB,CAAC,MACpB;AACH,QAAM,IAAc,EAAS,OAAA,CAAQ,GAAkB,OAC9C;AAAA,IAAE,GAAG;AAAA,IAAM,CAAA,EAAQ,IAAA,GAAO;AAAA,EAAQ,IACxC,CAAC,CAAC,GAEC,IAAgB,EAAW,OAAA,CAAQ,GAAoB,OACpD;AAAA,IAAE,GAAG;AAAA,IAAM,CAAA,EAAS,IAAA,GAAO;AAAA,EAAS,IAC1C,CAAC,CAAC,GAEC,IAAc,EAAS,OAAA,CAAQ,GAAkB,MAAqB;AAC1E,UAAM,EAAE,kBAAA,GAAkB,UAAA,EAAA,IAAa;AAEvC,QAAI,CAAC,EAAI,CAAA,EACP,QAAO;AAAA,MACL,GAAG;AAAA,MACF,CAAA,CAAA,GAAmB,CAAC,CAAQ;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EACb,IAAA,CAAK,MAAgB,OAAO,OAAO,CAAW,EAAE,IAAI,CAAc,EAAE,KAAK,GAAG,CAAC,EAC7E,KAAK;AAAA,CAEW,GAQf,IAAA,CAAkB,MAA6B;AACnD,MAAI,IAAc,EAAY,cAAc,YAAY;AACxD,SAAA,KAAe,EAAY,YAAY,gBAAgB,IACvD,KAAe,EAAY,aAEpB;AACT,GAEM,IAAA,CAAW,GAA0B,MAClC,EAAY,KAChB,IAAA,CAAK,MACQ,EAAK,OAAA,CAAQ,MAAM,EAAE,SAAS,CAAO,EAAE,CAAA,GAEvC,QAAQ,EACrB,EACA,KAAK,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dashboard.es.js","names":[],"sources":["../../src/dashboard/Dashboard.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Grid from '@mui/material/Grid'\nimport Skeleton from '@mui/material/Skeleton'\nimport Stack from '@mui/material/Stack'\n\nimport { useGlobalStore, useScreenSize, useWidgetLoadTimer } from '../common'\n\nimport { Banner } from '../common/components/Banner'\n\nimport Greeting from './Greeting'\nimport { DashboardLocation } from './constants/Dashboard'\nimport type { DashboardWidget } from './types/DashboardTypes'\n\nexport interface DashboardProps {\n widgets: DashboardWidget[]\n isLoading: boolean\n}\n\nconst Dashboard: React.FC<DashboardProps> = ({ widgets, isLoading }) => {\n const { isDesktop, isMobile } = useScreenSize()\n const { copyStore } = useGlobalStore()\n\n useWidgetLoadTimer({\n widgetName: 'Dashboard',\n isLoaded: !isLoading,\n })\n\n const sortedWidgets = React.useMemo(\n () =>\n widgets\n .filter((widget) => widget.location !== DashboardLocation.Disabled)\n .sort((w1, w2) => w1.index - w2.index),\n [widgets],\n )\n\n const mainWidgets = React.useMemo(\n () => sortedWidgets.filter((widget) => widget.location === DashboardLocation.Main),\n [sortedWidgets],\n )\n\n const sideWidgets = React.useMemo(\n () => sortedWidgets.filter((widget) => widget.location === DashboardLocation.RightSide),\n [sortedWidgets],\n )\n\n return (\n <Grid container={true} spacing={isMobile ? 0 : 24}>\n <Grid size={12} sx={{ pt: 16 }}>\n {copyStore.isInitialized && <Greeting />}\n </Grid>\n\n {/* Main Column */}\n <Grid size={{ xs: 12, lg: 8 }}>\n <Banner />\n {isLoading && (\n <Stack direction=\"column\" spacing={24}>\n <Skeleton height={100} variant=\"rounded\" width=\"100%\" />\n <Skeleton height={300} variant=\"rounded\" width=\"100%\" />\n <Skeleton height={300} variant=\"rounded\" width=\"100%\" />\n </Stack>\n )}\n {!isLoading && (\n <Stack direction=\"column\" spacing={24}>\n {isDesktop\n ? mainWidgets.map((widget) => (\n <React.Fragment key={widget.index}>{widget.component}</React.Fragment>\n ))\n : sortedWidgets.map((widget) => (\n <React.Fragment key={widget.index}>{widget.component}</React.Fragment>\n ))}\n </Stack>\n )}\n </Grid>\n\n {/* Right Column */}\n {isDesktop && (\n <Grid size={{ lg: 4 }}>\n {isLoading ? (\n <Stack direction=\"column\" spacing={24}>\n <Skeleton height={200} variant=\"rounded\" width=\"100%\" />\n <Skeleton height={100} variant=\"rounded\" width=\"100%\" />\n <Skeleton height={300} variant=\"rounded\" width=\"100%\" />\n </Stack>\n ) : (\n <Stack direction=\"column\" spacing={24}>\n {sideWidgets.map((widget) => (\n <React.Fragment key={widget.index}>{widget.component}</React.Fragment>\n ))}\n </Stack>\n )}\n </Grid>\n )}\n </Grid>\n )\n}\n\nexport default observer(Dashboard)\n"],"mappings":";;;;;;;;;;;;AAoBA,IAAM,IAAA,CAAuC,EAAE,SAAA,GAAS,WAAA,EAAA,MAAgB;AACtE,QAAM,EAAE,WAAA,GAAW,UAAA,EAAA,IAAa,EAAc,GACxC,EAAE,WAAA,EAAA,IAAc,EAAe;AAErC,EAAA,EAAmB;AAAA,IACjB,YAAY;AAAA,IACZ,UAAU,CAAC;AAAA,EACb,CAAC;AAED,QAAM,IAAgB,EAAM,QAAA,MAExB,EACG,OAAA,CAAQ,MAAW,EAAO,aAAa,EAAkB,QAAQ,EACjE,KAAA,CAAM,GAAI,MAAO,EAAG,QAAQ,EAAG,KAAK,GACzC,CAAC,CAAO,CACV,GAEM,IAAc,EAAM,QAAA,MAClB,EAAc,OAAA,CAAQ,MAAW,EAAO,aAAa,EAAkB,IAAI,GACjF,CAAC,CAAa,CAChB,GAEM,IAAc,EAAM,QAAA,MAClB,EAAc,OAAA,CAAQ,MAAW,EAAO,aAAa,EAAkB,SAAS,GACtF,CAAC,CAAa,CAChB;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IAAM,WAAW;AAAA,IAAM,SAAS,IAAW,IAAI;AAAA,
|
|
1
|
+
{"version":3,"file":"Dashboard.es.js","names":[],"sources":["../../src/dashboard/Dashboard.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Grid from '@mui/material/Grid'\nimport Skeleton from '@mui/material/Skeleton'\nimport Stack from '@mui/material/Stack'\n\nimport { useGlobalStore, useScreenSize, useWidgetLoadTimer } from '../common'\n\nimport { Banner } from '../common/components/Banner'\n\nimport Greeting from './Greeting'\nimport { DashboardLocation } from './constants/Dashboard'\nimport type { DashboardWidget } from './types/DashboardTypes'\n\nexport interface DashboardProps {\n widgets: DashboardWidget[]\n isLoading: boolean\n}\n\nconst Dashboard: React.FC<DashboardProps> = ({ widgets, isLoading }) => {\n const { isDesktop, isMobile } = useScreenSize()\n const { copyStore } = useGlobalStore()\n\n useWidgetLoadTimer({\n widgetName: 'Dashboard',\n isLoaded: !isLoading,\n })\n\n const sortedWidgets = React.useMemo(\n () =>\n widgets\n .filter((widget) => widget.location !== DashboardLocation.Disabled)\n .sort((w1, w2) => w1.index - w2.index),\n [widgets],\n )\n\n const mainWidgets = React.useMemo(\n () => sortedWidgets.filter((widget) => widget.location === DashboardLocation.Main),\n [sortedWidgets],\n )\n\n const sideWidgets = React.useMemo(\n () => sortedWidgets.filter((widget) => widget.location === DashboardLocation.RightSide),\n [sortedWidgets],\n )\n\n return (\n <Grid container={true} spacing={isMobile ? 0 : 24}>\n <Grid size={12} sx={{ pt: 16 }}>\n {copyStore.isInitialized && <Greeting />}\n </Grid>\n\n {/* Main Column */}\n <Grid size={{ xs: 12, lg: 8 }}>\n <Banner />\n {isLoading && (\n <Stack direction=\"column\" spacing={24}>\n <Skeleton height={100} variant=\"rounded\" width=\"100%\" />\n <Skeleton height={300} variant=\"rounded\" width=\"100%\" />\n <Skeleton height={300} variant=\"rounded\" width=\"100%\" />\n </Stack>\n )}\n {!isLoading && (\n <Stack direction=\"column\" spacing={24}>\n {isDesktop\n ? mainWidgets.map((widget) => (\n <React.Fragment key={widget.index}>{widget.component}</React.Fragment>\n ))\n : sortedWidgets.map((widget) => (\n <React.Fragment key={widget.index}>{widget.component}</React.Fragment>\n ))}\n </Stack>\n )}\n </Grid>\n\n {/* Right Column */}\n {isDesktop && (\n <Grid size={{ lg: 4 }}>\n {isLoading ? (\n <Stack direction=\"column\" spacing={24}>\n <Skeleton height={200} variant=\"rounded\" width=\"100%\" />\n <Skeleton height={100} variant=\"rounded\" width=\"100%\" />\n <Skeleton height={300} variant=\"rounded\" width=\"100%\" />\n </Stack>\n ) : (\n <Stack direction=\"column\" spacing={24}>\n {sideWidgets.map((widget) => (\n <React.Fragment key={widget.index}>{widget.component}</React.Fragment>\n ))}\n </Stack>\n )}\n </Grid>\n )}\n </Grid>\n )\n}\n\nexport default observer(Dashboard)\n"],"mappings":";;;;;;;;;;;;AAoBA,IAAM,IAAA,CAAuC,EAAE,SAAA,GAAS,WAAA,EAAA,MAAgB;AACtE,QAAM,EAAE,WAAA,GAAW,UAAA,EAAA,IAAa,EAAc,GACxC,EAAE,WAAA,EAAA,IAAc,EAAe;AAErC,EAAA,EAAmB;AAAA,IACjB,YAAY;AAAA,IACZ,UAAU,CAAC;AAAA,EACb,CAAC;AAED,QAAM,IAAgB,EAAM,QAAA,MAExB,EACG,OAAA,CAAQ,MAAW,EAAO,aAAa,EAAkB,QAAQ,EACjE,KAAA,CAAM,GAAI,MAAO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,MACf,gBAAA,EAAC,EAAM,UAAP,EAAA,UAAoC,EAAO,UAA0B,GAAhD,EAAO,KAAyC,CACtE,IACD,EAAc,IAAA,CAAK,MACjB,gBAAA,EAAC,EAAM,UAAP,EAAA,UAAoC,EAAO,UAA0B,GAAhD,EAAO,KAAyC,CACtE;AAAA,UACA,CAAA;AAAA,QAEL;AAAA;MAGL,KACC,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM,EAAE,IAAI,EAAE;AAAA,QACjB,UAAA,IACC,gBAAA,EAAC,GAAD;AAAA,UAAO,WAAU;AAAA,UAAS,SAAS;AAAA,UAAnC,UAAA;AAAA,YACE,gBAAA,EAAC,GAAD;AAAA,cAAU,QAAQ;AAAA,cAAK,SAAQ;AAAA,cAAU,OAAM;AAAA,YAAQ,CAAA;AAAA,YACvD,gBAAA,EAAC,GAAD;AAAA,cAAU,QAAQ;AAAA,cAAK,SAAQ;AAAA,cAAU,OAAM;AAAA,YAAQ,CAAA;AAAA,YACvD,gBAAA,EAAC,GAAD;AAAA,cAAU,QAAQ;AAAA,cAAK,SAAQ;AAAA,cAAU,OAAM;AAAA,YAAQ,CAAA;AAAA,UAClD;AAAA,QAEP,CAAA,IAAA,gBAAA,EAAC,GAAD;AAAA,UAAO,WAAU;AAAA,UAAS,SAAS;AAAA,UAChC,UAAA,EAAY,IAAA,CAAK,MAChB,gBAAA,EAAC,EAAM,UAAP,EAAA,UAAoC,EAAO,UAA0B,GAAhD,EAAO,KAAyC,CACtE;AAAA,QACI,CAAA;AAAA,MAEL,CAAA;AAAA,IAEJ;AAAA;AAEV,GAEA,IAAe,EAAS,CAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Greeting.es.js","names":[],"sources":["../../src/dashboard/Greeting.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Stack from '@mui/material/Stack'\nimport Paper from '@mui/material/Paper'\n\nimport { H2, P } from '@mxenabled/mxui'\nimport { useMediaQuery } from '@mui/system'\n\nimport { ConnectDrawer, useAppConfig, useGlobalCopyStore, useScreenSize } from '../common'\n\nimport AddAccounts from '../common/components/addaccounts/AddAccounts'\nimport { GlobalAccountFilter } from '../common/components/GlobalAccountFilter'\n\nconst Greeting = () => {\n const [showConnectWidget, setShowConnectWidget] = React.useState(false)\n\n const isSmallMobileDevice = useMediaQuery('(max-width:320px)')\n\n const { common: commonCopy, connect: connectCopy } = useGlobalCopyStore()\n const { config } = useAppConfig()\n const { isMobile } = useScreenSize()\n\n const getGreeting = () => {\n const now = new Date()\n const hour = now.getHours()\n\n if (hour > 1 && hour < 12) {\n return commonCopy.good_morning\n } else if (hour >= 12 && hour < 18) {\n return commonCopy.good_afternoon\n } else {\n return commonCopy.good_evening\n }\n }\n\n return (\n <React.Fragment>\n <Paper sx={{ gap: 12, mb: isMobile ? 24 : 0, p: 24 }}>\n <Stack alignItems=\"center\" flexDirection=\"row\" justifyContent=\"space-between\">\n <Stack>\n <H2 variant={isSmallMobileDevice ? 'h2' : 'h1'}>{getGreeting()}</H2>\n <P color=\"text.secondary\">{commonCopy.heres_your_spending_overview}</P>\n </Stack>\n <Stack flexDirection=\"row\">\n {config.show_connections_widget_in_master && (\n <AddAccounts handleConnectClick={() => setShowConnectWidget(true)} />\n )}\n <GlobalAccountFilter />\n </Stack>\n </Stack>\n </Paper>\n {showConnectWidget && (\n <ConnectDrawer\n onClose={() => setShowConnectWidget(false)}\n showConnectWidget={showConnectWidget}\n title={connectCopy.mini_title}\n />\n )}\n </React.Fragment>\n )\n}\n\nexport default observer(Greeting)\n"],"mappings":";;;;;;;;;;;;AAcA,IAAM,IAAA,MAAiB;AACrB,QAAM,CAAC,GAAmB,CAAA,IAAwB,EAAM,SAAS,EAAK,GAEhE,IAAsB,EAAc,mBAAmB,GAEvD,EAAE,QAAQ,GAAY,SAAS,EAAA,IAAgB,EAAmB,GAClE,EAAE,QAAA,EAAA,IAAW,EAAa,GAC1B,EAAE,UAAA,EAAA,IAAa,EAAc,GAE7B,IAAA,MAAoB;AAExB,UAAM,KAAO,oBADG,KACH,GAAI,SAAS;AAE1B,WAAI,IAAO,KAAK,IAAO,KACd,EAAW,eACT,KAAQ,MAAM,IAAO,KACvB,EAAW,iBAEX,EAAW;AAAA,EAEtB;AAEA,SACE,gBAAA,EAAC,EAAM,UAAP,EAAA,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,KAAK;AAAA,MAAI,IAAI,IAAW,KAAK;AAAA,MAAG,GAAG;AAAA,IAAG;AAAA,
|
|
1
|
+
{"version":3,"file":"Greeting.es.js","names":[],"sources":["../../src/dashboard/Greeting.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Stack from '@mui/material/Stack'\nimport Paper from '@mui/material/Paper'\n\nimport { H2, P } from '@mxenabled/mxui'\nimport { useMediaQuery } from '@mui/system'\n\nimport { ConnectDrawer, useAppConfig, useGlobalCopyStore, useScreenSize } from '../common'\n\nimport AddAccounts from '../common/components/addaccounts/AddAccounts'\nimport { GlobalAccountFilter } from '../common/components/GlobalAccountFilter'\n\nconst Greeting = () => {\n const [showConnectWidget, setShowConnectWidget] = React.useState(false)\n\n const isSmallMobileDevice = useMediaQuery('(max-width:320px)')\n\n const { common: commonCopy, connect: connectCopy } = useGlobalCopyStore()\n const { config } = useAppConfig()\n const { isMobile } = useScreenSize()\n\n const getGreeting = () => {\n const now = new Date()\n const hour = now.getHours()\n\n if (hour > 1 && hour < 12) {\n return commonCopy.good_morning\n } else if (hour >= 12 && hour < 18) {\n return commonCopy.good_afternoon\n } else {\n return commonCopy.good_evening\n }\n }\n\n return (\n <React.Fragment>\n <Paper sx={{ gap: 12, mb: isMobile ? 24 : 0, p: 24 }}>\n <Stack alignItems=\"center\" flexDirection=\"row\" justifyContent=\"space-between\">\n <Stack>\n <H2 variant={isSmallMobileDevice ? 'h2' : 'h1'}>{getGreeting()}</H2>\n <P color=\"text.secondary\">{commonCopy.heres_your_spending_overview}</P>\n </Stack>\n <Stack flexDirection=\"row\">\n {config.show_connections_widget_in_master && (\n <AddAccounts handleConnectClick={() => setShowConnectWidget(true)} />\n )}\n <GlobalAccountFilter />\n </Stack>\n </Stack>\n </Paper>\n {showConnectWidget && (\n <ConnectDrawer\n onClose={() => setShowConnectWidget(false)}\n showConnectWidget={showConnectWidget}\n title={connectCopy.mini_title}\n />\n )}\n </React.Fragment>\n )\n}\n\nexport default observer(Greeting)\n"],"mappings":";;;;;;;;;;;;AAcA,IAAM,IAAA,MAAiB;AACrB,QAAM,CAAC,GAAmB,CAAA,IAAwB,EAAM,SAAS,EAAK,GAEhE,IAAsB,EAAc,mBAAmB,GAEvD,EAAE,QAAQ,GAAY,SAAS,EAAA,IAAgB,EAAmB,GAClE,EAAE,QAAA,EAAA,IAAW,EAAa,GAC1B,EAAE,UAAA,EAAA,IAAa,EAAc,GAE7B,IAAA,MAAoB;AAExB,UAAM,KAAO,oBADG,KACH,GAAI,SAAS;AAE1B,WAAI,IAAO,KAAK,IAAO,KACd,EAAW,eACT,KAAQ,MAAM,IAAO,KACvB,EAAW,iBAEX,EAAW;AAAA,EAEtB;AAEA,SACE,gBAAA,EAAC,EAAM,UAAP,EAAA,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,KAAK;AAAA,MAAI,IAAI,IAAW,KAAK;AAAA,MAAG,GAAG;AAAA,IAAG;AAAA,IACjD,UAAA,gBAAA,EAAC,GAAD;AAAA,MAAO,YAAW;AAAA,MAAS,eAAc;AAAA,MAAM,gBAAe;AAAA,MAA9D,UAAA,CACE,gBAAA,EAAC,GAAD,EAAA,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,QAAI,SAAS,IAAsB,OAAO;AAAA,QAAO,UAAA,EAAY;AAAA,MAAM,CAAA,GACnE,gBAAA,EAAC,GAAD;AAAA,QAAG,OAAM;AAAA,QAAkB,UAAA,EAAW;AAAA,MAAgC,CAAA,CACjE,EAAA,CAAA,GACP,gBAAA,EAAC,GAAD;AAAA,QAAO,eAAc;AAAA,QAArB,UAAA,CACG,EAAO,qCACN,gBAAA,EAAC,GAAD,EAAa,oBAAA,MAA0B,EAAqB,EAAI,EAAI,CAAA,GAEtE,gBAAA,EAAC,GAAD,CAAsB,CAAA,CACjB;AAAA,MACF,CAAA,CAAA;AAAA;EACF,CAAA,GACN,KACC,gBAAA,EAAC,GAAD;AAAA,IACE,SAAA,MAAe,EAAqB,EAAK;AAAA,IACtB,mBAAA;AAAA,IACnB,OAAO,EAAY;AAAA,EACpB,CAAA,CAEW,EAAA,CAAA;AAEpB,GAEA,IAAe,EAAS,CAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebtsWidget.es.js","names":[],"sources":["../../src/debts/DebtsWidget.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\nimport Stack from '@mui/material/Stack'\n\nimport {\n ANALYTICS_EVENTS,\n ConnectDrawer,\n EmptyState,\n Loader,\n useAccountStore,\n useAppConfig,\n useDebtStore,\n useEvent,\n useGlobalCopyStore,\n useGlobalUiStore,\n useGoalStore,\n useScreenSize,\n useWidgetLoadTimer,\n WidgetContainer,\n} from '../common'\nimport { AccountType, WidgetProps } from '../core'\n\nimport SnowballCard from './components/SnowballCard'\nimport SnowballDrawer from './components/SnowballDrawer'\nimport DebtDrawer from './components/DebtDrawer'\nimport PaydownDrawer from './components/PaydownDrawer'\nimport { DebtsChart } from './components/DebtsChart'\nimport { DebtsTable } from './components/DebtsTable'\nimport { DebtsPriorityAction } from './components/actions/DebtsPriorityAction'\nimport { buildEmptyStateProps, transformDebtsChartData } from '../core/utils/DebtUtils'\nimport { useAccountUiStore } from '../accounts'\nimport { useDebtsUiStore } from './hooks/useDebtsUiStore'\nimport { PaydownButton } from './components/debtspaydown/PaydownButton'\n\nconst DebtsWidget: React.FC<WidgetProps> = ({ onBackClick, onMenuClick, sx }) => {\n const { isDesktop, isMobile } = useScreenSize()\n const { connect: connectCopy, debts: copy } = useGlobalCopyStore()\n const { onEvent } = useEvent()\n const {\n config: { show_connections_widget_in_master },\n } = useAppConfig()\n const { isInitialized } = useGlobalUiStore()\n const { setSelectedAccount } = useAccountUiStore()\n const { selectedDebtPriority, setSelectedDebtChartData } = useDebtsUiStore()\n\n const {\n isAccountDataLoaded,\n loadAccountData,\n detailedAccounts,\n visibleDebtAccounts: accounts,\n } = useAccountStore()\n const { isAllGoalDataLoaded, loadGoalData, monthlyCashFlowProfile } = useGoalStore()\n const { debts } = useDebtStore()\n\n const [isDebtDrawerOpen, setIsDebtDrawerOpen] = React.useState(false)\n const [isPaydownDrawerOpen, setIsPaydownDrawerOpen] = React.useState(false)\n const [isSnowballDrawerOpen, setIsSnowballDrawerOpen] = React.useState(false)\n const [hoveredDebtGuid, setHoveredDebtGuid] = React.useState('')\n const [showConnectWidget, setShowConnectWidget] = React.useState(false)\n\n useWidgetLoadTimer({\n widgetName: 'DebtsWidget',\n isLoaded: isAccountDataLoaded && isAllGoalDataLoaded,\n })\n\n const debtsChartData = React.useMemo(() => {\n const extraPaydown = monthlyCashFlowProfile?.extra_payment ?? 0\n return transformDebtsChartData(debts, selectedDebtPriority, extraPaydown)\n }, [debts, selectedDebtPriority, monthlyCashFlowProfile])\n\n React.useEffect(() => {\n if (!isAccountDataLoaded) {\n loadAccountData().finally()\n }\n onEvent(ANALYTICS_EVENTS.DEBTS_VIEW)\n }, [])\n\n React.useEffect(() => {\n if (isInitialized) {\n loadGoalData().finally()\n }\n }, [isInitialized])\n\n const onHoverDebt = (guid: string) => setHoveredDebtGuid(guid)\n\n const onClickDebt = () => {\n const account = accounts.find((a) => a.guid === hoveredDebtGuid)\n const chartData = debtsChartData.find((d) => d.guid === hoveredDebtGuid)\n if (account) setSelectedAccount(account)\n if (chartData) setSelectedDebtChartData(chartData)\n setIsDebtDrawerOpen(true)\n }\n\n const onClickAccountFilter = () => onEvent(ANALYTICS_EVENTS.DEBTS_CLICK_FILTER)\n\n const onClickSnowballCta = () => {\n setIsSnowballDrawerOpen(true)\n onEvent(ANALYTICS_EVENTS.DEBTS_CLICK_SNOWBALL_CTA)\n }\n\n const onClickPaydown = () => {\n setIsPaydownDrawerOpen(true)\n onEvent(ANALYTICS_EVENTS.DEBTS_CLICK_PAYDOWN)\n }\n\n if (!isInitialized || !isAccountDataLoaded || !isAllGoalDataLoaded) {\n return <Loader />\n }\n\n const hasNoAccounts = detailedAccounts.length === 0\n const hasNoDebtAccounts = accounts.length === 0\n const hasNoDebts = debts.length === 0\n const showEmptyState = hasNoAccounts || hasNoDebtAccounts || hasNoDebts\n\n const emptyStateProps = buildEmptyStateProps(copy, show_connections_widget_in_master, () =>\n setShowConnectWidget(true),\n )\n\n return (\n <WidgetContainer\n actions={[<DebtsPriorityAction disabled={showEmptyState} key=\"prioritize-debts\" />]}\n allowedAccountTypes={[\n AccountType.CREDIT_CARD,\n AccountType.LOAN,\n AccountType.MORTGAGE,\n AccountType.LINE_OF_CREDIT,\n AccountType.CHECKING_LINE_OF_CREDIT,\n ]}\n hasDivider={true}\n onAccountsFilterClick={onClickAccountFilter}\n onBackClick={onBackClick}\n onMenuClick={onMenuClick}\n slotComponent={\n <PaydownButton disabled={showEmptyState} key=\"extra-paydown\" onClick={onClickPaydown} />\n }\n sx={sx}\n title={copy.title}\n >\n <Stack sx={{ pt: 48, px: isDesktop ? '48px' : '24px' }}>\n {showEmptyState && (\n <EmptyState\n header={emptyStateProps.header}\n icon=\"note_stack\"\n onClick={emptyStateProps.onClickHandler}\n primaryButton={emptyStateProps.primaryButton}\n subText={emptyStateProps.description}\n sx={{ maxWidth: 400 }}\n />\n )}\n {!showEmptyState && (\n <>\n <Stack\n sx={{\n alignItems: isMobile ? 'flex-start' : 'flex-end',\n flexDirection: isMobile ? 'column' : 'row',\n mx: isMobile ? '-12px' : 0,\n }}\n >\n <DebtsChart\n debts={debtsChartData}\n height={isMobile ? 250 : undefined}\n hoveredDebtGuid={hoveredDebtGuid}\n onClickArea={onClickDebt}\n onHoverArea={onHoverDebt}\n sx={{ mr: isMobile ? '4px' : '-48px' }}\n />\n <SnowballCard\n debts={debtsChartData}\n onClickCta={onClickSnowballCta}\n sx={{ mb: isMobile ? '0px' : '64px' }}\n />\n </Stack>\n <Stack sx={{ mx: isMobile ? '-24px' : 0 }}>\n <DebtsTable\n debts={debtsChartData}\n hoveredDebtGuid={hoveredDebtGuid}\n onClickRow={onClickDebt}\n onHoverRow={onHoverDebt}\n />\n </Stack>\n </>\n )}\n </Stack>\n <SnowballDrawer\n isOpen={isSnowballDrawerOpen}\n onClose={() => setIsSnowballDrawerOpen(false)}\n />\n <DebtDrawer isOpen={isDebtDrawerOpen} onClose={() => setIsDebtDrawerOpen(false)} />\n <PaydownDrawer isOpen={isPaydownDrawerOpen} onClose={() => setIsPaydownDrawerOpen(false)} />\n <ConnectDrawer\n onClose={() => setShowConnectWidget(false)}\n showConnectWidget={showConnectWidget}\n title={connectCopy.mini_title}\n />\n </WidgetContainer>\n )\n}\n\nexport default observer(DebtsWidget)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAM,KAAA,CAAsC,EAAE,aAAA,GAAa,aAAA,GAAa,IAAA,EAAA,MAAS;AAC/E,QAAM,EAAE,WAAA,GAAW,UAAA,EAAA,IAAa,GAAc,GACxC,EAAE,SAAS,GAAa,OAAO,EAAA,IAAS,GAAmB,GAC3D,EAAE,SAAA,EAAA,IAAY,GAAS,GACvB,EACJ,QAAQ,EAAE,mCAAA,EAAA,EAAA,IACR,EAAa,GACX,EAAE,eAAA,EAAA,IAAkB,GAAiB,GACrC,EAAE,oBAAA,EAAA,IAAuB,GAAkB,GAC3C,EAAE,sBAAA,GAAsB,0BAAA,EAAA,IAA6B,GAAgB,GAErE,EACJ,qBAAA,GACA,iBAAA,GACA,kBAAA,GACA,qBAAqB,EAAA,IACnB,EAAgB,GACd,EAAE,qBAAA,GAAqB,cAAA,GAAc,wBAAA,EAAA,IAA2B,GAAa,GAC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;AAAA,YACrC,IAAI,IAAW,UAAU;AAAA,UAC3B;AAAA,oBALF,CAOE,gBAAA,EAAC,IAAD;AAAA,YACE,OAAO;AAAA,YACP,QAAQ,IAAW,MAAM;AAAA,YACR,iBAAA;AAAA,YACjB,aAAa;AAAA,YACb,aAAa;AAAA,YACb,IAAI,EAAE,IAAI,IAAW,QAAQ,QAAQ;AAAA,UACtC,CAAA,GACD,gBAAA,EAAC,IAAD;AAAA,YACE,OAAO;AAAA,YACP,YAAY;AAAA,YACZ,IAAI,EAAE,IAAI,IAAW,QAAQ,OAAO;AAAA,UACrC,CAAA,CACI;AAAA,YACP,gBAAA,EAAC,GAAD;AAAA,UAAO,IAAI,EAAE,IAAI,IAAW,UAAU,EAAE;AAAA,oBACtC,gBAAA,EAAC,IAAD;AAAA,YACE,OAAO;AAAA,YACU,iBAAA;AAAA,YACjB,YAAY;AAAA,YACZ,YAAY;AAAA,UACb,CAAA;AAAA,QACI,CAAA,CACP,EAAA,CAAA,CAEC;AAAA;MACP,gBAAA,EAAC,IAAD;AAAA,QACE,QAAQ;AAAA,QACR,SAAA,MAAe,EAAwB,EAAK;AAAA,MAC7C,CAAA;AAAA,MACD,gBAAA,EAAC,IAAD;AAAA,QAAY,QAAQ;AAAA,QAAkB,SAAA,MAAe,EAAoB,EAAK;AAAA,MAAI,CAAA;AAAA,MAClF,gBAAA,EAAC,IAAD;AAAA,QAAe,QAAQ;AAAA,QAAqB,SAAA,MAAe,EAAuB,EAAK;AAAA,MAAI,CAAA;AAAA,MAC3F,gBAAA,EAAC,IAAD;AAAA,QACE,SAAA,MAAe,EAAqB,EAAK;AAAA,QACtB,mBAAA;AAAA,QACnB,OAAO,EAAY;AAAA,MACpB,CAAA;AAAA,IACc;AAAA;AAErB,GAEA,KAAe,GAAS,EAAW"}
|
|
1
|
+
{"version":3,"file":"DebtsWidget.es.js","names":[],"sources":["../../src/debts/DebtsWidget.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\nimport Stack from '@mui/material/Stack'\n\nimport {\n ANALYTICS_EVENTS,\n ConnectDrawer,\n EmptyState,\n Loader,\n useAccountStore,\n useAppConfig,\n useDebtStore,\n useEvent,\n useGlobalCopyStore,\n useGlobalUiStore,\n useGoalStore,\n useScreenSize,\n useWidgetLoadTimer,\n WidgetContainer,\n} from '../common'\nimport { AccountType, WidgetProps } from '../core'\n\nimport SnowballCard from './components/SnowballCard'\nimport SnowballDrawer from './components/SnowballDrawer'\nimport DebtDrawer from './components/DebtDrawer'\nimport PaydownDrawer from './components/PaydownDrawer'\nimport { DebtsChart } from './components/DebtsChart'\nimport { DebtsTable } from './components/DebtsTable'\nimport { DebtsPriorityAction } from './components/actions/DebtsPriorityAction'\nimport { buildEmptyStateProps, transformDebtsChartData } from '../core/utils/DebtUtils'\nimport { useAccountUiStore } from '../accounts'\nimport { useDebtsUiStore } from './hooks/useDebtsUiStore'\nimport { PaydownButton } from './components/debtspaydown/PaydownButton'\n\nconst DebtsWidget: React.FC<WidgetProps> = ({ onBackClick, onMenuClick, sx }) => {\n const { isDesktop, isMobile } = useScreenSize()\n const { connect: connectCopy, debts: copy } = useGlobalCopyStore()\n const { onEvent } = useEvent()\n const {\n config: { show_connections_widget_in_master },\n } = useAppConfig()\n const { isInitialized } = useGlobalUiStore()\n const { setSelectedAccount } = useAccountUiStore()\n const { selectedDebtPriority, setSelectedDebtChartData } = useDebtsUiStore()\n\n const {\n isAccountDataLoaded,\n loadAccountData,\n detailedAccounts,\n visibleDebtAccounts: accounts,\n } = useAccountStore()\n const { isAllGoalDataLoaded, loadGoalData, monthlyCashFlowProfile } = useGoalStore()\n const { debts } = useDebtStore()\n\n const [isDebtDrawerOpen, setIsDebtDrawerOpen] = React.useState(false)\n const [isPaydownDrawerOpen, setIsPaydownDrawerOpen] = React.useState(false)\n const [isSnowballDrawerOpen, setIsSnowballDrawerOpen] = React.useState(false)\n const [hoveredDebtGuid, setHoveredDebtGuid] = React.useState('')\n const [showConnectWidget, setShowConnectWidget] = React.useState(false)\n\n useWidgetLoadTimer({\n widgetName: 'DebtsWidget',\n isLoaded: isAccountDataLoaded && isAllGoalDataLoaded,\n })\n\n const debtsChartData = React.useMemo(() => {\n const extraPaydown = monthlyCashFlowProfile?.extra_payment ?? 0\n return transformDebtsChartData(debts, selectedDebtPriority, extraPaydown)\n }, [debts, selectedDebtPriority, monthlyCashFlowProfile])\n\n React.useEffect(() => {\n if (!isAccountDataLoaded) {\n loadAccountData().finally()\n }\n onEvent(ANALYTICS_EVENTS.DEBTS_VIEW)\n }, [])\n\n React.useEffect(() => {\n if (isInitialized) {\n loadGoalData().finally()\n }\n }, [isInitialized])\n\n const onHoverDebt = (guid: string) => setHoveredDebtGuid(guid)\n\n const onClickDebt = () => {\n const account = accounts.find((a) => a.guid === hoveredDebtGuid)\n const chartData = debtsChartData.find((d) => d.guid === hoveredDebtGuid)\n if (account) setSelectedAccount(account)\n if (chartData) setSelectedDebtChartData(chartData)\n setIsDebtDrawerOpen(true)\n }\n\n const onClickAccountFilter = () => onEvent(ANALYTICS_EVENTS.DEBTS_CLICK_FILTER)\n\n const onClickSnowballCta = () => {\n setIsSnowballDrawerOpen(true)\n onEvent(ANALYTICS_EVENTS.DEBTS_CLICK_SNOWBALL_CTA)\n }\n\n const onClickPaydown = () => {\n setIsPaydownDrawerOpen(true)\n onEvent(ANALYTICS_EVENTS.DEBTS_CLICK_PAYDOWN)\n }\n\n if (!isInitialized || !isAccountDataLoaded || !isAllGoalDataLoaded) {\n return <Loader />\n }\n\n const hasNoAccounts = detailedAccounts.length === 0\n const hasNoDebtAccounts = accounts.length === 0\n const hasNoDebts = debts.length === 0\n const showEmptyState = hasNoAccounts || hasNoDebtAccounts || hasNoDebts\n\n const emptyStateProps = buildEmptyStateProps(copy, show_connections_widget_in_master, () =>\n setShowConnectWidget(true),\n )\n\n return (\n <WidgetContainer\n actions={[<DebtsPriorityAction disabled={showEmptyState} key=\"prioritize-debts\" />]}\n allowedAccountTypes={[\n AccountType.CREDIT_CARD,\n AccountType.LOAN,\n AccountType.MORTGAGE,\n AccountType.LINE_OF_CREDIT,\n AccountType.CHECKING_LINE_OF_CREDIT,\n ]}\n hasDivider={true}\n onAccountsFilterClick={onClickAccountFilter}\n onBackClick={onBackClick}\n onMenuClick={onMenuClick}\n slotComponent={\n <PaydownButton disabled={showEmptyState} key=\"extra-paydown\" onClick={onClickPaydown} />\n }\n sx={sx}\n title={copy.title}\n >\n <Stack sx={{ pt: 48, px: isDesktop ? '48px' : '24px' }}>\n {showEmptyState && (\n <EmptyState\n header={emptyStateProps.header}\n icon=\"note_stack\"\n onClick={emptyStateProps.onClickHandler}\n primaryButton={emptyStateProps.primaryButton}\n subText={emptyStateProps.description}\n sx={{ maxWidth: 400 }}\n />\n )}\n {!showEmptyState && (\n <>\n <Stack\n sx={{\n alignItems: isMobile ? 'flex-start' : 'flex-end',\n flexDirection: isMobile ? 'column' : 'row',\n mx: isMobile ? '-12px' : 0,\n }}\n >\n <DebtsChart\n debts={debtsChartData}\n height={isMobile ? 250 : undefined}\n hoveredDebtGuid={hoveredDebtGuid}\n onClickArea={onClickDebt}\n onHoverArea={onHoverDebt}\n sx={{ mr: isMobile ? '4px' : '-48px' }}\n />\n <SnowballCard\n debts={debtsChartData}\n onClickCta={onClickSnowballCta}\n sx={{ mb: isMobile ? '0px' : '64px' }}\n />\n </Stack>\n <Stack sx={{ mx: isMobile ? '-24px' : 0 }}>\n <DebtsTable\n debts={debtsChartData}\n hoveredDebtGuid={hoveredDebtGuid}\n onClickRow={onClickDebt}\n onHoverRow={onHoverDebt}\n />\n </Stack>\n </>\n )}\n </Stack>\n <SnowballDrawer\n isOpen={isSnowballDrawerOpen}\n onClose={() => setIsSnowballDrawerOpen(false)}\n />\n <DebtDrawer isOpen={isDebtDrawerOpen} onClose={() => setIsDebtDrawerOpen(false)} />\n <PaydownDrawer isOpen={isPaydownDrawerOpen} onClose={() => setIsPaydownDrawerOpen(false)} />\n <ConnectDrawer\n onClose={() => setShowConnectWidget(false)}\n showConnectWidget={showConnectWidget}\n title={connectCopy.mini_title}\n />\n </WidgetContainer>\n )\n}\n\nexport default observer(DebtsWidget)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAM,KAAA,CAAsC,EAAE,aAAA,GAAa,aAAA,GAAa,IAAA,EAAA,MAAS;AAC/E,QAAM,EAAE,WAAA,GAAW,UAAA,EAAA,IAAa,GAAc,GACxC,EAAE,SAAS,GAAa,OAAO,EAAA,IAAS,GAAmB,GAC3D,EAAE,SAAA,EAAA,IAAY,GAAS,GACvB,EACJ,QAAQ,EAAE,mCAAA,EAAA,EAAA,IACR,EAAa,GACX,EAAE,eAAA,EAAA,IAAkB,GAAiB,GACrC,EAAE,oBAAA,EAAA,IAAuB,GAAkB,GAC3C,EAAE,sBAAA,GAAsB,0BAAA,EAAA,IAA6B,GAAgB,GAErE,EACJ,qBAAA,GACA,iBAAA,GACA,kBAAA,GACA,qBAAqB,EAAA,IACnB,EAAgB,GACd,EAAE,qBAAA,GAAqB,cAAA,GAAc,wBAAA,EAAA,IAA2B,GAAa,GAC7E,EAAE,OAAA,EAAA,IAAU,EAAa,GAEzB,CAAC,GAAkB,CAAA,IAAuB,EAAM,SAAS,EAAK,GAC9D,CAAC,GAAqB,CAAA,IAA0B,EAAM,SAAS,EAAK,GACpE,CAAC,GAAsB,CAAA,IAA2B,EAAM,SAAS,EAAK,GACtE,CAAC,GAAiB,CAAA,IAAsB,EAAM,SAAS,EAAE,GACzD,CAAC,GAAmB,CAAA,IAAwB,EAAM,SAAS,EAAK;AAEtE,EAAA,GAAmB;AAAA,IACjB,YAAY;AAAA,IACZ,UAAU,KAAuB;AAAA,EACnC,CAAC;AAED,QAAM,IAAiB,EAAM,QAAA,MAAc;AACzC,UAAM,IAAe,GAAwB,iBAAiB;AAC9D,WAAO,GAAwB,GAAO,GAAsB,CAAY;AAAA,EAC1E,GAAG;AAAA,IAAC;AAAA,IAAO;AAAA,IAAsB;AAAA,EAAsB,CA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AAA;AAAA,YACjB,YAAY;AAAA,YACZ,YAAY;AAAA,UACb,CAAA;AAAA,QACI,CAAA,CACP,EAAA,CAAA,CAEC;AAAA;MACP,gBAAA,EAAC,IAAD;AAAA,QACE,QAAQ;AAAA,QACR,SAAA,MAAe,EAAwB,EAAK;AAAA,MAC7C,CAAA;AAAA,MACD,gBAAA,EAAC,IAAD;AAAA,QAAY,QAAQ;AAAA,QAAkB,SAAA,MAAe,EAAoB,EAAK;AAAA,MAAI,CAAA;AAAA,MAClF,gBAAA,EAAC,IAAD;AAAA,QAAe,QAAQ;AAAA,QAAqB,SAAA,MAAe,EAAuB,EAAK;AAAA,MAAI,CAAA;AAAA,MAC3F,gBAAA,EAAC,IAAD;AAAA,QACE,SAAA,MAAe,EAAqB,EAAK;AAAA,QACtB,mBAAA;AAAA,QACnB,OAAO,EAAY;AAAA,MACpB,CAAA;AAAA,IACc;AAAA;AAErB,GAEA,KAAe,GAAS,EAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebtDrawer.es.js","names":[],"sources":["../../../src/debts/components/DebtDrawer.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Drawer, useGlobalCopyStore } from '../../common'\nimport { useDebtsUiStore } from '../hooks/useDebtsUiStore'\n\nimport AccountDetailsHeader from '../../accounts/components/detailsdrawer/Accounts/AccountDetailsHeader'\nimport DebtDetailsChart from './debtsdrawer/DebtDetailsChart'\nimport DebtDetailsContent from './debtsdrawer/DebtDetailsContent'\n\ninterface DebtDrawerProps {\n isOpen: boolean\n onClose: () => void\n}\n\nconst DebtDrawer = ({ isOpen, onClose }: DebtDrawerProps) => {\n const { debts: copy } = useGlobalCopyStore()\n const { showError, showCompleted } = useDebtsUiStore()\n const headerChart = showError || showCompleted ? <></> : <DebtDetailsChart />\n\n return (\n <Drawer\n ariaLabelClose={copy.details_close_aria}\n isOpen={isOpen}\n onClose={onClose}\n title={copy.details_title}\n >\n <Stack bgcolor=\"background.default\">\n <AccountDetailsHeader customDetailsChart={headerChart} />\n <DebtDetailsContent />\n </Stack>\n </Drawer>\n )\n}\n\nexport default DebtDrawer\n"],"mappings":";;;;;;;;AAcA,IAAM,IAAA,CAAc,EAAE,QAAA,GAAQ,SAAA,EAAA,MAA+B;AAC3D,QAAM,EAAE,OAAO,EAAA,IAAS,EAAmB,GACrC,EAAE,WAAA,GAAW,eAAA,EAAA,IAAkB,EAAgB,GAC/C,IAAc,KAAa,IAAgB,gBAAA,EAAA,GAAA,CAAI,CAAA,IAAI,gBAAA,EAAC,GAAD,CAAmB,CAAA;AAE5E,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,gBAAgB,EAAK;AAAA,IACb,QAAA;AAAA,IACC,SAAA;AAAA,IACT,OAAO,EAAK;AAAA,
|
|
1
|
+
{"version":3,"file":"DebtDrawer.es.js","names":[],"sources":["../../../src/debts/components/DebtDrawer.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Drawer, useGlobalCopyStore } from '../../common'\nimport { useDebtsUiStore } from '../hooks/useDebtsUiStore'\n\nimport AccountDetailsHeader from '../../accounts/components/detailsdrawer/Accounts/AccountDetailsHeader'\nimport DebtDetailsChart from './debtsdrawer/DebtDetailsChart'\nimport DebtDetailsContent from './debtsdrawer/DebtDetailsContent'\n\ninterface DebtDrawerProps {\n isOpen: boolean\n onClose: () => void\n}\n\nconst DebtDrawer = ({ isOpen, onClose }: DebtDrawerProps) => {\n const { debts: copy } = useGlobalCopyStore()\n const { showError, showCompleted } = useDebtsUiStore()\n const headerChart = showError || showCompleted ? <></> : <DebtDetailsChart />\n\n return (\n <Drawer\n ariaLabelClose={copy.details_close_aria}\n isOpen={isOpen}\n onClose={onClose}\n title={copy.details_title}\n >\n <Stack bgcolor=\"background.default\">\n <AccountDetailsHeader customDetailsChart={headerChart} />\n <DebtDetailsContent />\n </Stack>\n </Drawer>\n )\n}\n\nexport default DebtDrawer\n"],"mappings":";;;;;;;;AAcA,IAAM,IAAA,CAAc,EAAE,QAAA,GAAQ,SAAA,EAAA,MAA+B;AAC3D,QAAM,EAAE,OAAO,EAAA,IAAS,EAAmB,GACrC,EAAE,WAAA,GAAW,eAAA,EAAA,IAAkB,EAAgB,GAC/C,IAAc,KAAa,IAAgB,gBAAA,EAAA,GAAA,CAAI,CAAA,IAAI,gBAAA,EAAC,GAAD,CAAmB,CAAA;AAE5E,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,gBAAgB,EAAK;AAAA,IACb,QAAA;AAAA,IACC,SAAA;AAAA,IACT,OAAO,EAAK;AAAA,IAEZ,UAAA,gBAAA,EAAC,GAAD;AAAA,MAAO,SAAQ;AAAA,MAAf,UAAA,CACE,gBAAA,EAAC,GAAD,EAAsB,oBAAoB,EAAc,CAAA,GACxD,gBAAA,EAAC,GAAD,CAAqB,CAAA,CAChB;AAAA;EACD,CAAA;AAEZ"}
|
|
@@ -4,39 +4,39 @@ import { ANALYTICS_EVENTS as D } from "../../common/constants/Analytics.es.js";
|
|
|
4
4
|
import { formatCurrency as v } from "../../core/utils/NumberFormatting.es.js";
|
|
5
5
|
import { BASE_LINE_COLOR as S, adjustBrightness as w } from "../utils/DebtsChart.es.js";
|
|
6
6
|
import "react";
|
|
7
|
-
import { jsx as
|
|
7
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
8
8
|
import { useTheme as I } from "@mui/material/styles";
|
|
9
9
|
import H from "@mui/material/Box";
|
|
10
10
|
import { LineChart as R } from "@mui/x-charts/LineChart";
|
|
11
11
|
var K = ({ sx: g, height: f = 500, width: y, debts: A, hoveredDebtGuid: l, onClickArea: T, onHoverArea: M }) => {
|
|
12
|
-
const m = I(), { onEvent:
|
|
13
|
-
const
|
|
14
|
-
let a =
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
return a =
|
|
18
|
-
x:
|
|
19
|
-
y:
|
|
12
|
+
const m = I(), { onEvent: b } = _(), c = A.filter((t) => !t.is_impossible), o = [...new Set(c.flatMap((t) => t.dataset.map((e) => new Date(e.x).getTime())))].sort((t, e) => t - e).map((t) => new Date(t)), s = c.map((t) => {
|
|
13
|
+
const e = new Map(t.dataset.map((i) => [new Date(i.x).getTime(), i.y]));
|
|
14
|
+
let a = e.get(o[0].getTime()) ?? 0;
|
|
15
|
+
const n = o.map((i) => {
|
|
16
|
+
const h = e.get(i.getTime()) ?? a;
|
|
17
|
+
return a = h, {
|
|
18
|
+
x: i,
|
|
19
|
+
y: h
|
|
20
20
|
};
|
|
21
21
|
});
|
|
22
22
|
return {
|
|
23
|
-
...
|
|
24
|
-
dataset:
|
|
23
|
+
...t,
|
|
24
|
+
dataset: n
|
|
25
25
|
};
|
|
26
|
-
}), p = s.reduce((
|
|
27
|
-
const a =
|
|
26
|
+
}), p = s.reduce((t, e) => t + (e.dataset[0]?.y ?? 0), 0), x = o.map((t, e) => {
|
|
27
|
+
const a = e / (o.length - 1);
|
|
28
28
|
return {
|
|
29
|
-
x:
|
|
29
|
+
x: t,
|
|
30
30
|
y: p * (1 - a)
|
|
31
31
|
};
|
|
32
|
-
}), E = Math.ceil(p / 100) * 100, L =
|
|
33
|
-
const a =
|
|
32
|
+
}), E = Math.ceil(p / 100) * 100, L = o, r = s.map((t, e) => {
|
|
33
|
+
const a = 1 - e / s.length * 0.5, n = w(S, a);
|
|
34
34
|
return {
|
|
35
|
-
id: `debt-${
|
|
36
|
-
guid:
|
|
37
|
-
label:
|
|
38
|
-
data:
|
|
39
|
-
color:
|
|
35
|
+
id: `debt-${e}`,
|
|
36
|
+
guid: t.guid,
|
|
37
|
+
label: t.name,
|
|
38
|
+
data: t.dataset.map((i) => i.y),
|
|
39
|
+
color: n,
|
|
40
40
|
curve: "linear",
|
|
41
41
|
type: "line",
|
|
42
42
|
area: !0,
|
|
@@ -44,10 +44,10 @@ var K = ({ sx: g, height: f = 500, width: y, debts: A, hoveredDebtGuid: l, onCli
|
|
|
44
44
|
showMark: !1
|
|
45
45
|
};
|
|
46
46
|
});
|
|
47
|
-
|
|
47
|
+
r.push({
|
|
48
48
|
id: "payoff-line",
|
|
49
49
|
label: "Payoff Line",
|
|
50
|
-
data:
|
|
50
|
+
data: x.map((t) => t.y),
|
|
51
51
|
color: m.palette.grey[700],
|
|
52
52
|
curve: "linear",
|
|
53
53
|
type: "line",
|
|
@@ -55,8 +55,8 @@ var K = ({ sx: g, height: f = 500, width: y, debts: A, hoveredDebtGuid: l, onCli
|
|
|
55
55
|
showMark: !1,
|
|
56
56
|
disableHighlight: !0
|
|
57
57
|
});
|
|
58
|
-
const u = (
|
|
59
|
-
return /* @__PURE__ */
|
|
58
|
+
const u = (t) => r.findIndex((e) => e?.guid === t);
|
|
59
|
+
return /* @__PURE__ */ d(H, {
|
|
60
60
|
sx: {
|
|
61
61
|
width: "100%",
|
|
62
62
|
height: "100%",
|
|
@@ -67,7 +67,7 @@ var K = ({ sx: g, height: f = 500, width: y, debts: A, hoveredDebtGuid: l, onCli
|
|
|
67
67
|
},
|
|
68
68
|
"& .recharts-wrapper": { touchAction: "pan-y" }
|
|
69
69
|
},
|
|
70
|
-
children: /* @__PURE__ */
|
|
70
|
+
children: /* @__PURE__ */ d(R, {
|
|
71
71
|
axisHighlight: { x: "none" },
|
|
72
72
|
disableLineItemHighlight: !0,
|
|
73
73
|
height: f,
|
|
@@ -78,16 +78,16 @@ var K = ({ sx: g, height: f = 500, width: y, debts: A, hoveredDebtGuid: l, onCli
|
|
|
78
78
|
right: 72,
|
|
79
79
|
top: 48
|
|
80
80
|
},
|
|
81
|
-
onAreaClick: (
|
|
81
|
+
onAreaClick: (t, e) => {
|
|
82
82
|
T?.();
|
|
83
|
-
const a =
|
|
84
|
-
|
|
83
|
+
const a = r.find((n) => n.id === e.seriesId);
|
|
84
|
+
b(D.DEBTS_CLICK_CHART_AREA, { account_guid: a?.guid });
|
|
85
85
|
},
|
|
86
|
-
onHighlightChange: (
|
|
87
|
-
const
|
|
88
|
-
M?.(
|
|
86
|
+
onHighlightChange: (t) => {
|
|
87
|
+
const e = r.find((a) => a.id === t?.seriesId)?.guid;
|
|
88
|
+
M?.(e ?? "");
|
|
89
89
|
},
|
|
90
|
-
series:
|
|
90
|
+
series: r,
|
|
91
91
|
skipAnimation: !0,
|
|
92
92
|
slotProps: { tooltip: { trigger: "none" } },
|
|
93
93
|
sx: {
|
|
@@ -114,16 +114,16 @@ var K = ({ sx: g, height: f = 500, width: y, debts: A, hoveredDebtGuid: l, onCli
|
|
|
114
114
|
xAxis: [{
|
|
115
115
|
data: L,
|
|
116
116
|
disableTicks: !0,
|
|
117
|
-
min:
|
|
117
|
+
min: o[0],
|
|
118
118
|
scaleType: "time",
|
|
119
119
|
tickLabelMinGap: 24,
|
|
120
|
-
valueFormatter: (
|
|
120
|
+
valueFormatter: (t) => k(t, C.MONTH_SHORT_YEAR)
|
|
121
121
|
}],
|
|
122
122
|
yAxis: [{
|
|
123
123
|
min: 0,
|
|
124
124
|
max: E,
|
|
125
125
|
disableTicks: !0,
|
|
126
|
-
valueFormatter: (
|
|
126
|
+
valueFormatter: (t) => v(t, "0a")
|
|
127
127
|
}]
|
|
128
128
|
})
|
|
129
129
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebtsChart.es.js","names":[],"sources":["../../../src/debts/components/DebtsChart.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport { useTheme } from '@mui/material/styles'\n\nimport type { LineSeriesType, HighlightItemData, LineItemIdentifier } from '@mui/x-charts'\nimport { LineChart } from '@mui/x-charts/LineChart'\n\nimport { useEvent, ANALYTICS_EVENTS } from '../../common'\nimport { DATE_FORMATS_INTL, formatDate } from '../../core/constants'\nimport { DebtChartData } from '../../core/utils/DebtUtils'\nimport { adjustBrightness, BASE_LINE_COLOR } from '../utils/DebtsChart'\nimport { formatCurrency } from '../../core/utils/NumberFormatting'\n\ninterface DebtsChartProps {\n sx?: any\n height?: number\n width?: number\n debts: DebtChartData[]\n hoveredDebtGuid?: string\n onClickArea?: () => void\n onHoverArea?: (debtGuid: string) => void\n}\n\ninterface DebtsChartSeries extends LineSeriesType {\n guid?: string | null\n}\n\nexport const DebtsChart: React.FC<DebtsChartProps> = ({\n sx,\n height = 500,\n width,\n debts,\n hoveredDebtGuid,\n onClickArea,\n onHoverArea,\n}) => {\n const theme = useTheme()\n const { onEvent } = useEvent()\n\n const possibleDebts = debts.filter((d) => !d.is_impossible)\n\n // Generate sorted array of unique dates\n const uniqueXValues = [\n ...new Set(\n possibleDebts.flatMap((debt) => debt.dataset.map((point) => new Date(point.x).getTime())),\n ),\n ]\n .sort((a, b) => a - b)\n .map((timestamp) => new Date(timestamp))\n\n // Normalize datasets with missing dates\n const normalizedDatasets = possibleDebts.map((debt) => {\n const datasetMap = new Map(debt.dataset.map((point) => [new Date(point.x).getTime(), point.y]))\n\n let lastY = datasetMap.get(uniqueXValues[0].getTime()) ?? 0\n const normalizedDataset = uniqueXValues.map((x) => {\n const y = datasetMap.get(x.getTime()) ?? lastY // Use last known value for missing points\n lastY = y\n return { x, y }\n })\n\n return { ...debt, dataset: normalizedDataset }\n })\n\n const initialTotalDebt = normalizedDatasets.reduce(\n (sum, debt) => sum + (debt.dataset[0]?.y ?? 0),\n 0,\n )\n\n const payoffLine = uniqueXValues.map((x, index) => {\n const linearRate = index / (uniqueXValues.length - 1)\n const y = initialTotalDebt * (1 - linearRate)\n return { x, y }\n })\n\n const yMax = Math.ceil(initialTotalDebt / 100) * 100\n const xData = uniqueXValues\n\n const series: DebtsChartSeries[] = normalizedDatasets.map((debt, index) => {\n const brightnessFactor = 1 - (index / normalizedDatasets.length) * 0.5\n const seriesColor = adjustBrightness(BASE_LINE_COLOR, brightnessFactor)\n\n return {\n id: `debt-${index}`,\n guid: debt.guid,\n label: debt.name,\n data: debt.dataset.map((point) => point.y),\n color: seriesColor,\n curve: 'linear',\n type: 'line',\n area: true,\n stack: 'total',\n showMark: false,\n }\n })\n\n series.push({\n id: 'payoff-line',\n label: 'Payoff Line',\n data: payoffLine.map((point) => point.y),\n color: theme.palette.grey[700],\n curve: 'linear',\n type: 'line',\n stack: undefined,\n showMark: false,\n disableHighlight: true,\n })\n\n const getIndexByGuid = (guid: string) => {\n return series.findIndex((s) => s?.guid === guid)\n }\n\n const onHighlightChange = (line: HighlightItemData | null) => {\n const highlightedGuid = series.find((s) => s.id === line?.seriesId)?.guid\n onHoverArea?.(highlightedGuid ?? '')\n }\n\n const onAreaClick = (\n _event: React.MouseEvent<SVGElement, MouseEvent>,\n lineItemIdentifier: LineItemIdentifier,\n ) => {\n onClickArea?.()\n const areaSeries = series.find((s) => s.id === lineItemIdentifier.seriesId)\n onEvent(ANALYTICS_EVENTS.DEBTS_CLICK_CHART_AREA, { account_guid: areaSeries?.guid })\n }\n\n return (\n <Box\n sx={{\n width: '100%',\n height: '100%',\n touchAction: 'pan-y',\n '& svg': {\n touchAction: 'pan-y',\n userSelect: 'none',\n },\n '& .recharts-wrapper': {\n touchAction: 'pan-y',\n },\n }}\n >\n <LineChart\n axisHighlight={{ x: 'none' }}\n disableLineItemHighlight={true}\n height={height}\n hideLegend={true}\n margin={{ bottom: 24, left: 32, right: 72, top: 48 }}\n onAreaClick={onAreaClick}\n onHighlightChange={onHighlightChange}\n series={series}\n skipAnimation={true}\n slotProps={{ tooltip: { trigger: 'none' } }}\n sx={{\n p: 4,\n '& .MuiBarLabel-root': {\n fontSize: 10,\n fontWeight: 600,\n },\n '& .MuiAreaElement-root': {\n opacity: 0.4,\n transition: 'opacity 0.3s ease',\n },\n '& .MuiAreaElement-root:hover': {\n opacity: 1,\n },\n '& .MuiLineElement-series-payoff-line': {\n strokeDasharray: '10 5',\n strokeWidth: 1,\n },\n [`& .MuiLineElement-series-debt-${getIndexByGuid(hoveredDebtGuid ?? '0')}`]: {\n opacity: 1,\n },\n [`& .MuiAreaElement-series-debt-${getIndexByGuid(hoveredDebtGuid ?? '0')}`]: {\n opacity: 1,\n },\n '& .MuiChartsAxis-tickLabel > tspan': {\n fontFamily: theme.typography.body2.fontFamily,\n },\n ...sx,\n }}\n width={width}\n xAxis={[\n {\n data: xData,\n disableTicks: true,\n min: uniqueXValues[0],\n scaleType: 'time',\n tickLabelMinGap: 24,\n valueFormatter: (value: Date) => formatDate(value, DATE_FORMATS_INTL.MONTH_SHORT_YEAR),\n },\n ]}\n yAxis={[\n {\n min: 0,\n max: yMax,\n disableTicks: true,\n valueFormatter: (value: number) => formatCurrency(value, '0a'),\n },\n ]}\n />\n </Box>\n )\n}\n"],"mappings":";;;;;;;;;;AA4BA,IAAa,IAAA,CAAyC,EACpD,IAAA,GACA,QAAA,IAAS,KACT,OAAA,GACA,OAAA,GACA,iBAAA,GACA,aAAA,GACA,aAAA,EAAA,MACI;AACJ,QAAM,IAAQ,EAAS,GACjB,EAAE,SAAA,EAAA,IAAY,EAAS,GAEvB,IAAgB,EAAM,OAAA,CAAQ,MAAM,CAAC,EAAE,aAAa,GAGpD,IAAgB,CACpB,GAAG,IAAI,IACL,EAAc,QAAA,CAAS,MAAS,EAAK,QAAQ,IAAA,CAAK,MAAU,IAAI,KAAK,EAAM,CAAC,EAAE,QAAQ,CAAC,CAAC,CAC1F,CACF,EACG,KAAA,CAAM,GAAG,MAAM,IAAI,CAAC,EACpB,IAAA,CAAK,MAAc,IAAI,KAAK,CAAS,CAAC,GAGnC,IAAqB,EAAc,IAAA,CAAK,MAAS;AACrD,UAAM,IAAa,IAAI,IAAI,EAAK,QAAQ,IAAA,CAAK,MAAU,CAAC,IAAI,KAAK,EAAM,CAAC,EAAE,QAAQ,GAAG,EAAM,CAAC,CAAC,CAAC;AAE9F,QAAI,IAAQ,EAAW,IAAI,EAAc,CAAA,EAAG,QAAQ,CAAC,KAAK;AAC1D,UAAM,IAAoB,EAAc,IAAA,CAAK,MAAM;AACjD,YAAM,IAAI,EAAW,IAAI,EAAE,QAAQ,CAAC,KAAK;AACzC,aAAA,IAAQ,GACD;AAAA,QAAE,GAAA;AAAA,QAAG,GAAA;AAAA,MAAE;AAAA,IAChB,CAAC;AAED,WAAO;AAAA,MAAE,GAAG;AAAA,MAAM,SAAS;AAAA,IAAkB;AAAA,EAC/C,CAAC,GAEK,IAAmB,EAAmB,OAAA,CACzC,GAAK,MAAS,KAAO,EAAK,QAAQ,CAAA,GAAI,KAAK,IAC5C,CACF,GAEM,IAAa,EAAc,IAAA,CAAK,GAAG,MAAU;AACjD,UAAM,IAAa,KAAS,EAAc,SAAS;AAEnD,WAAO;AAAA,MAAE,GAAA;AAAA,MAAG,GADF,KAAoB,IAAI;AAAA,IACpB;AAAA,EAChB,CAAC,GAEK,IAAO,KAAK,KAAK,IAAmB,GAAG,IAAI,KAC3C,IAAQ,GAER,IAA6B,EAAmB,IAAA,CAAK,GAAM,MAAU;
|
|
1
|
+
{"version":3,"file":"DebtsChart.es.js","names":[],"sources":["../../../src/debts/components/DebtsChart.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport { useTheme } from '@mui/material/styles'\n\nimport type { LineSeriesType, HighlightItemData, LineItemIdentifier } from '@mui/x-charts'\nimport { LineChart } from '@mui/x-charts/LineChart'\n\nimport { useEvent, ANALYTICS_EVENTS } from '../../common'\nimport { DATE_FORMATS_INTL, formatDate } from '../../core/constants'\nimport { DebtChartData } from '../../core/utils/DebtUtils'\nimport { adjustBrightness, BASE_LINE_COLOR } from '../utils/DebtsChart'\nimport { formatCurrency } from '../../core/utils/NumberFormatting'\n\ninterface DebtsChartProps {\n sx?: any\n height?: number\n width?: number\n debts: DebtChartData[]\n hoveredDebtGuid?: string\n onClickArea?: () => void\n onHoverArea?: (debtGuid: string) => void\n}\n\ninterface DebtsChartSeries extends LineSeriesType {\n guid?: string | null\n}\n\nexport const DebtsChart: React.FC<DebtsChartProps> = ({\n sx,\n height = 500,\n width,\n debts,\n hoveredDebtGuid,\n onClickArea,\n onHoverArea,\n}) => {\n const theme = useTheme()\n const { onEvent } = useEvent()\n\n const possibleDebts = debts.filter((d) => !d.is_impossible)\n\n // Generate sorted array of unique dates\n const uniqueXValues = [\n ...new Set(\n possibleDebts.flatMap((debt) => debt.dataset.map((point) => new Date(point.x).getTime())),\n ),\n ]\n .sort((a, b) => a - b)\n .map((timestamp) => new Date(timestamp))\n\n // Normalize datasets with missing dates\n const normalizedDatasets = possibleDebts.map((debt) => {\n const datasetMap = new Map(debt.dataset.map((point) => [new Date(point.x).getTime(), point.y]))\n\n let lastY = datasetMap.get(uniqueXValues[0].getTime()) ?? 0\n const normalizedDataset = uniqueXValues.map((x) => {\n const y = datasetMap.get(x.getTime()) ?? lastY // Use last known value for missing points\n lastY = y\n return { x, y }\n })\n\n return { ...debt, dataset: normalizedDataset }\n })\n\n const initialTotalDebt = normalizedDatasets.reduce(\n (sum, debt) => sum + (debt.dataset[0]?.y ?? 0),\n 0,\n )\n\n const payoffLine = uniqueXValues.map((x, index) => {\n const linearRate = index / (uniqueXValues.length - 1)\n const y = initialTotalDebt * (1 - linearRate)\n return { x, y }\n })\n\n const yMax = Math.ceil(initialTotalDebt / 100) * 100\n const xData = uniqueXValues\n\n const series: DebtsChartSeries[] = normalizedDatasets.map((debt, index) => {\n const brightnessFactor = 1 - (index / normalizedDatasets.length) * 0.5\n const seriesColor = adjustBrightness(BASE_LINE_COLOR, brightnessFactor)\n\n return {\n id: `debt-${index}`,\n guid: debt.guid,\n label: debt.name,\n data: debt.dataset.map((point) => point.y),\n color: seriesColor,\n curve: 'linear',\n type: 'line',\n area: true,\n stack: 'total',\n showMark: false,\n }\n })\n\n series.push({\n id: 'payoff-line',\n label: 'Payoff Line',\n data: payoffLine.map((point) => point.y),\n color: theme.palette.grey[700],\n curve: 'linear',\n type: 'line',\n stack: undefined,\n showMark: false,\n disableHighlight: true,\n })\n\n const getIndexByGuid = (guid: string) => {\n return series.findIndex((s) => s?.guid === guid)\n }\n\n const onHighlightChange = (line: HighlightItemData | null) => {\n const highlightedGuid = series.find((s) => s.id === line?.seriesId)?.guid\n onHoverArea?.(highlightedGuid ?? '')\n }\n\n const onAreaClick = (\n _event: React.MouseEvent<SVGElement, MouseEvent>,\n lineItemIdentifier: LineItemIdentifier,\n ) => {\n onClickArea?.()\n const areaSeries = series.find((s) => s.id === lineItemIdentifier.seriesId)\n onEvent(ANALYTICS_EVENTS.DEBTS_CLICK_CHART_AREA, { account_guid: areaSeries?.guid })\n }\n\n return (\n <Box\n sx={{\n width: '100%',\n height: '100%',\n touchAction: 'pan-y',\n '& svg': {\n touchAction: 'pan-y',\n userSelect: 'none',\n },\n '& .recharts-wrapper': {\n touchAction: 'pan-y',\n },\n }}\n >\n <LineChart\n axisHighlight={{ x: 'none' }}\n disableLineItemHighlight={true}\n height={height}\n hideLegend={true}\n margin={{ bottom: 24, left: 32, right: 72, top: 48 }}\n onAreaClick={onAreaClick}\n onHighlightChange={onHighlightChange}\n series={series}\n skipAnimation={true}\n slotProps={{ tooltip: { trigger: 'none' } }}\n sx={{\n p: 4,\n '& .MuiBarLabel-root': {\n fontSize: 10,\n fontWeight: 600,\n },\n '& .MuiAreaElement-root': {\n opacity: 0.4,\n transition: 'opacity 0.3s ease',\n },\n '& .MuiAreaElement-root:hover': {\n opacity: 1,\n },\n '& .MuiLineElement-series-payoff-line': {\n strokeDasharray: '10 5',\n strokeWidth: 1,\n },\n [`& .MuiLineElement-series-debt-${getIndexByGuid(hoveredDebtGuid ?? '0')}`]: {\n opacity: 1,\n },\n [`& .MuiAreaElement-series-debt-${getIndexByGuid(hoveredDebtGuid ?? '0')}`]: {\n opacity: 1,\n },\n '& .MuiChartsAxis-tickLabel > tspan': {\n fontFamily: theme.typography.body2.fontFamily,\n },\n ...sx,\n }}\n width={width}\n xAxis={[\n {\n data: xData,\n disableTicks: true,\n min: uniqueXValues[0],\n scaleType: 'time',\n tickLabelMinGap: 24,\n valueFormatter: (value: Date) => formatDate(value, DATE_FORMATS_INTL.MONTH_SHORT_YEAR),\n },\n ]}\n yAxis={[\n {\n min: 0,\n max: yMax,\n disableTicks: true,\n valueFormatter: (value: number) => formatCurrency(value, '0a'),\n },\n ]}\n />\n </Box>\n )\n}\n"],"mappings":";;;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