@mx-cartographer/experiences 9.1.0-alpha.bb1 → 9.1.1
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 +80 -0
- package/README.md +10 -10
- package/dist/Account-DR7Plrqy.mjs +119 -0
- package/dist/Account-DR7Plrqy.mjs.map +1 -0
- package/dist/AccountDetailsDrawer-C1hhmlmI.mjs +922 -0
- package/dist/AccountDetailsDrawer-C1hhmlmI.mjs.map +1 -0
- package/dist/AccountDetailsHeader-BliEZhz7.mjs +230 -0
- package/dist/AccountDetailsHeader-BliEZhz7.mjs.map +1 -0
- package/dist/AccountUtils-Cbh8r9cP.mjs +29 -0
- package/dist/AccountUtils-Cbh8r9cP.mjs.map +1 -0
- package/dist/Analytics-CkYXKvco.mjs +54 -0
- package/dist/Analytics-CkYXKvco.mjs.map +1 -0
- package/dist/Analytics-WeZYytR0.mjs +140 -0
- package/dist/Analytics-WeZYytR0.mjs.map +1 -0
- package/dist/ApiEndpoints-DXwIYNUV.mjs +50 -0
- package/dist/ApiEndpoints-DXwIYNUV.mjs.map +1 -0
- package/dist/BeatMaterialIcon-1KOfRZrA.mjs +27 -0
- package/dist/BeatMaterialIcon-1KOfRZrA.mjs.map +1 -0
- package/dist/BudgetUtil-Bg2AQJpQ.mjs +75 -0
- package/dist/BudgetUtil-Bg2AQJpQ.mjs.map +1 -0
- package/dist/Category-DEKZGLYe.mjs +302 -0
- package/dist/Category-DEKZGLYe.mjs.map +1 -0
- package/dist/CategorySelectorDrawer-NJsFsKP1.mjs +431 -0
- package/dist/CategorySelectorDrawer-NJsFsKP1.mjs.map +1 -0
- package/dist/Connect-BH0Pt6zc.mjs +43 -0
- package/dist/Connect-BH0Pt6zc.mjs.map +1 -0
- package/dist/ConnectCard-D7uxoH5Y.mjs +55 -0
- package/dist/ConnectCard-D7uxoH5Y.mjs.map +1 -0
- package/dist/ConnectDrawer-CW4LA3H3.mjs +58 -0
- package/dist/ConnectDrawer-CW4LA3H3.mjs.map +1 -0
- package/dist/ConnectionsDrawer-CZU9ku-k.mjs +54 -0
- package/dist/ConnectionsDrawer-CZU9ku-k.mjs.map +1 -0
- package/dist/CurrencyDialog-DumQCTPO.mjs +374 -0
- package/dist/CurrencyDialog-DumQCTPO.mjs.map +1 -0
- package/dist/CurrencyInput-DaGEQaLW.mjs +88 -0
- package/dist/CurrencyInput-DaGEQaLW.mjs.map +1 -0
- package/dist/CurrencyText-CCbE6MmF.mjs +21 -0
- package/dist/CurrencyText-CCbE6MmF.mjs.map +1 -0
- package/dist/DateFormats-HudZ3Bjs.mjs +65 -0
- package/dist/DateFormats-HudZ3Bjs.mjs.map +1 -0
- package/dist/DateUtil-CzBmbjmA.mjs +75 -0
- package/dist/DateUtil-CzBmbjmA.mjs.map +1 -0
- package/dist/DebtUtils-i4pI2Uoe.mjs +154 -0
- package/dist/DebtUtils-i4pI2Uoe.mjs.map +1 -0
- package/dist/Dialog-Bvd2n8hz.mjs +67 -0
- package/dist/Dialog-Bvd2n8hz.mjs.map +1 -0
- package/dist/Donut-SzzfZDHF.mjs +89 -0
- package/dist/Donut-SzzfZDHF.mjs.map +1 -0
- package/dist/Drawer-DsnW2o0v.mjs +175 -0
- package/dist/Drawer-DsnW2o0v.mjs.map +1 -0
- package/dist/EmbeddedCard-DH8vQ3qN.mjs +859 -0
- package/dist/EmbeddedCard-DH8vQ3qN.mjs.map +1 -0
- package/dist/EmptyState-CJUDc3kD.mjs +85 -0
- package/dist/EmptyState-CJUDc3kD.mjs.map +1 -0
- package/dist/Error-Dtw6yxkf.mjs +85 -0
- package/dist/Error-Dtw6yxkf.mjs.map +1 -0
- package/dist/ErrorBoundary-CsdOcnJ9.mjs +24 -0
- package/dist/ErrorBoundary-CsdOcnJ9.mjs.map +1 -0
- package/dist/ExportCsvAction-C9KWH3Az.mjs +25 -0
- package/dist/ExportCsvAction-C9KWH3Az.mjs.map +1 -0
- package/dist/GlobalAccountFilter-BhzR5Vb1.mjs +230 -0
- package/dist/GlobalAccountFilter-BhzR5Vb1.mjs.map +1 -0
- package/dist/GlobalCopyApi-wcnDUzMV.mjs +129 -0
- package/dist/GlobalCopyApi-wcnDUzMV.mjs.map +1 -0
- package/dist/GoalsUtil-C9EnLWvC.mjs +108 -0
- package/dist/GoalsUtil-C9EnLWvC.mjs.map +1 -0
- package/dist/HeaderCell-P8w6CmfO.mjs +7 -0
- package/dist/HeaderCell-P8w6CmfO.mjs.map +1 -0
- package/dist/Help-CkQTjORd.mjs +300 -0
- package/dist/Help-CkQTjORd.mjs.map +1 -0
- package/dist/Help-aERwhajy.mjs +3210 -0
- package/dist/Help-aERwhajy.mjs.map +1 -0
- package/dist/IconBacking-DgT8DCeh.mjs +40 -0
- package/dist/IconBacking-DgT8DCeh.mjs.map +1 -0
- package/dist/InformationTooltip-4su8bn1e.mjs +42 -0
- package/dist/InformationTooltip-4su8bn1e.mjs.map +1 -0
- package/dist/InvestmentUtil-BItV7uEs.mjs +135 -0
- package/dist/InvestmentUtil-BItV7uEs.mjs.map +1 -0
- package/dist/LineChart-CUfiH86G.mjs +613 -0
- package/dist/LineChart-CUfiH86G.mjs.map +1 -0
- package/dist/ListItemAction-BqUCLj_w.mjs +70 -0
- package/dist/ListItemAction-BqUCLj_w.mjs.map +1 -0
- package/dist/ListItemRow-kH1rn8Xu.mjs +68 -0
- package/dist/ListItemRow-kH1rn8Xu.mjs.map +1 -0
- package/dist/ListItemWrapper-DRse79Iu.mjs +44 -0
- package/dist/ListItemWrapper-DRse79Iu.mjs.map +1 -0
- package/dist/Loader-CxeBwuPG.mjs +22 -0
- package/dist/Loader-CxeBwuPG.mjs.map +1 -0
- package/dist/Localization-DnoVyBNK.mjs +39 -0
- package/dist/Localization-DnoVyBNK.mjs.map +1 -0
- package/dist/ManageIncome-Be9WHv-s.mjs +906 -0
- package/dist/ManageIncome-Be9WHv-s.mjs.map +1 -0
- package/dist/MicroWidgetContainer-B2NnKBgW.mjs +46 -0
- package/dist/MicroWidgetContainer-B2NnKBgW.mjs.map +1 -0
- package/dist/MiniWidgetContainer-Bmv_WeUd.mjs +67 -0
- package/dist/MiniWidgetContainer-Bmv_WeUd.mjs.map +1 -0
- package/dist/NetWorthUtils-Dj7CgAg2.mjs +96 -0
- package/dist/NetWorthUtils-Dj7CgAg2.mjs.map +1 -0
- package/dist/Notification-DTNYSd8P.mjs +8 -0
- package/dist/Notification-DTNYSd8P.mjs.map +1 -0
- package/dist/NotificationSettings-CW7okUrk.mjs +678 -0
- package/dist/NotificationSettings-CW7okUrk.mjs.map +1 -0
- package/dist/NotificationUtils-BRGFTePr.mjs +24 -0
- package/dist/NotificationUtils-BRGFTePr.mjs.map +1 -0
- package/dist/NumberFormatting--XMeeBfr.mjs +50 -0
- package/dist/NumberFormatting--XMeeBfr.mjs.map +1 -0
- package/dist/OriginalBalanceAction-YrvxBYAl.mjs +115 -0
- package/dist/OriginalBalanceAction-YrvxBYAl.mjs.map +1 -0
- package/dist/RecurringSettings-kRqAViNn.mjs +89 -0
- package/dist/RecurringSettings-kRqAViNn.mjs.map +1 -0
- package/dist/RecurringTransactionsUtil-CHWmqvW5.mjs +299 -0
- package/dist/RecurringTransactionsUtil-CHWmqvW5.mjs.map +1 -0
- package/dist/ResponsiveButton-CC9F_Ezk.mjs +46 -0
- package/dist/ResponsiveButton-CC9F_Ezk.mjs.map +1 -0
- package/dist/SearchBox-Cpgu_gdO.mjs +51 -0
- package/dist/SearchBox-Cpgu_gdO.mjs.map +1 -0
- package/dist/Select-CSpkK5cR.mjs +62 -0
- package/dist/Select-CSpkK5cR.mjs.map +1 -0
- package/dist/SelectionBox-B4xELRgp.mjs +49 -0
- package/dist/SelectionBox-B4xELRgp.mjs.map +1 -0
- package/dist/SingleSegmentDonut-7Uy6VEld.mjs +70 -0
- package/dist/SingleSegmentDonut-7Uy6VEld.mjs.map +1 -0
- package/dist/Sizes-DISGrlUg.mjs +7 -0
- package/dist/Sizes-DISGrlUg.mjs.map +1 -0
- package/dist/SkeletonLoader-BaNboJjD.mjs +39 -0
- package/dist/SkeletonLoader-BaNboJjD.mjs.map +1 -0
- package/dist/SpendingData-Fii_xATx.mjs +54 -0
- package/dist/SpendingData-Fii_xATx.mjs.map +1 -0
- package/dist/SpendingLegend-CxvNOg3c.mjs +204 -0
- package/dist/SpendingLegend-CxvNOg3c.mjs.map +1 -0
- package/dist/StatusBar-CPfSXe80.mjs +31 -0
- package/dist/StatusBar-CPfSXe80.mjs.map +1 -0
- package/dist/TabContentContainer-B0eYJP5p.mjs +49 -0
- package/dist/TabContentContainer-B0eYJP5p.mjs.map +1 -0
- package/dist/ToggleListItem-Dl1lXNwj.mjs +92 -0
- package/dist/ToggleListItem-Dl1lXNwj.mjs.map +1 -0
- package/dist/TransactionDetails-roZ5xLq8.mjs +1708 -0
- package/dist/TransactionDetails-roZ5xLq8.mjs.map +1 -0
- package/dist/TransactionUtils-BphBJBbU.mjs +235 -0
- package/dist/TransactionUtils-BphBJBbU.mjs.map +1 -0
- package/dist/TrendsUtil-D9z3kIj_.mjs +70 -0
- package/dist/TrendsUtil-D9z3kIj_.mjs.map +1 -0
- package/dist/UserStore-BjnNCO5a.mjs +3121 -0
- package/dist/UserStore-BjnNCO5a.mjs.map +1 -0
- package/dist/ViewMoreMicroCard-fnwE0hqd.mjs +1280 -0
- package/dist/ViewMoreMicroCard-fnwE0hqd.mjs.map +1 -0
- package/dist/WidgetContainer-DJnp6t6c.mjs +483 -0
- package/dist/WidgetContainer-DJnp6t6c.mjs.map +1 -0
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsDrawer.d.ts +6 -0
- package/dist/accounts/index.d.ts +1 -0
- package/dist/accounts/index.es.js +784 -12
- package/dist/accounts/index.es.js.map +1 -0
- package/dist/analytics/index.es.js +140 -155
- package/dist/analytics/index.es.js.map +1 -0
- package/dist/budgets/index.es.js +1267 -1317
- package/dist/budgets/index.es.js.map +1 -0
- package/dist/cashflow/context/hooks.d.ts +7 -6
- package/dist/cashflow/index.es.js +944 -1076
- package/dist/cashflow/index.es.js.map +1 -0
- package/dist/categories/index.es.js +5 -4
- package/dist/categories/index.es.js.map +1 -0
- package/dist/common/components/DataRow.d.ts +1 -0
- package/dist/common/components/ListItemWrapper.d.ts +2 -1
- package/dist/common/constants/Analytics.d.ts +3 -0
- package/dist/common/index.es.js +310 -101
- package/dist/common/index.es.js.map +1 -0
- package/dist/core/index.es.js +105 -80
- package/dist/core/index.es.js.map +1 -0
- package/dist/core/stores/CashflowStore.d.ts +8 -7
- package/dist/core/stores/RecurringTransactionsStore.d.ts +53 -1
- package/dist/core/stores/TransactionStore.d.ts +1 -0
- package/dist/core/types/localization/RecurringCopy.d.ts +14 -1
- package/dist/core/types/localization/SpendingCopy.d.ts +1 -0
- package/dist/core/utils/AccountUtils.d.ts +8 -0
- package/dist/core/utils/DateUtil.d.ts +2 -0
- package/dist/core/utils/RecurringTransactionsUtil.d.ts +2 -1
- package/dist/dashboard/index.es.js +142 -185
- package/dist/dashboard/index.es.js.map +1 -0
- package/dist/debts/index.es.js +1273 -1384
- package/dist/debts/index.es.js.map +1 -0
- package/dist/finstrong/index.es.js +3473 -3367
- package/dist/finstrong/index.es.js.map +1 -0
- package/dist/goals/index.es.js +984 -1103
- package/dist/goals/index.es.js.map +1 -0
- package/dist/help/index.es.js +26 -3
- package/dist/help/index.es.js.map +1 -0
- package/dist/hooks-97sNJ_lf.mjs +78 -0
- package/dist/hooks-97sNJ_lf.mjs.map +1 -0
- package/dist/insights/components/insights/WeeklyNoSpendDays/BubbleWeek.d.ts +4 -1
- package/dist/insights/components/insights/WeeklyNoSpendDays/WeeklyNoSpendDays.d.ts +4 -2
- package/dist/insights/index.es.js +4871 -93
- package/dist/insights/index.es.js.map +1 -0
- package/dist/investments/index.es.js +1523 -1533
- package/dist/investments/index.es.js.map +1 -0
- package/dist/merchants/index.es.js +65 -75
- package/dist/merchants/index.es.js.map +1 -0
- package/dist/microinsights/index.es.js +826 -15
- package/dist/microinsights/index.es.js.map +1 -0
- package/dist/networth/index.es.js +504 -550
- package/dist/networth/index.es.js.map +1 -0
- package/dist/notifications/index.es.js +162 -169
- package/dist/notifications/index.es.js.map +1 -0
- package/dist/recurringtransactions/components/RecurringTransactionDetails.d.ts +3 -2
- package/dist/recurringtransactions/components/RecurringTransactionDetailsDrawer.d.ts +3 -0
- package/dist/recurringtransactions/components/RecurringTransactionList.d.ts +11 -0
- package/dist/recurringtransactions/components/UpcomingRecurrenceCard.d.ts +8 -0
- package/dist/recurringtransactions/components/actions/LinkTransactionDrawer.d.ts +10 -0
- package/dist/recurringtransactions/components/actions/MarkAsPaidDialog.d.ts +7 -0
- package/dist/recurringtransactions/components/actions/MarkAsUnpaidDialog.d.ts +7 -0
- package/dist/recurringtransactions/index.es.js +1012 -10
- package/dist/recurringtransactions/index.es.js.map +1 -0
- package/dist/settings/index.es.js +892 -13
- package/dist/settings/index.es.js.map +1 -0
- package/dist/spending/index.es.js +457 -400
- package/dist/spending/index.es.js.map +1 -0
- package/dist/transactions/components/shared/transactionlist/TransactionRow.d.ts +1 -0
- package/dist/transactions/index.es.js +604 -10
- package/dist/transactions/index.es.js.map +1 -0
- package/dist/trends/index.es.js +1408 -1268
- package/dist/trends/index.es.js.map +1 -0
- package/dist/useAccountDisplayName-BsiXA0qf.mjs +24 -0
- package/dist/useAccountDisplayName-BsiXA0qf.mjs.map +1 -0
- package/dist/useAriaLive-MkYebyUR.mjs +36 -0
- package/dist/useAriaLive-MkYebyUR.mjs.map +1 -0
- package/dist/useDimensions-CeDR9V8N.mjs +37 -0
- package/dist/useDimensions-CeDR9V8N.mjs.map +1 -0
- package/dist/useInsightsEnabled-D5Sdm0TJ.mjs +12 -0
- package/dist/useInsightsEnabled-D5Sdm0TJ.mjs.map +1 -0
- package/dist/useScreenSize-mWpmnh5w.mjs +37 -0
- package/dist/useScreenSize-mWpmnh5w.mjs.map +1 -0
- package/dist/useWidgetLoadTimer-B0tB-yzL.mjs +20 -0
- package/dist/useWidgetLoadTimer-B0tB-yzL.mjs.map +1 -0
- package/package.json +30 -30
- package/dist/Analytics-BKzTPees.mjs +0 -61
- package/dist/GlobalCopyApi-BeXzaDH9.mjs +0 -487
- package/dist/HeaderCell-EhCUSjvj.mjs +0 -10
- package/dist/Loader-BlVzRtUd.mjs +0 -73
- package/dist/MiniWidgetContainer-COwnjfy7.mjs +0 -110
- package/dist/OriginalBalanceAction-sbiqaxok.mjs +0 -110
- package/dist/SpendingLegend-D15ixlQ1.mjs +0 -222
- package/dist/accounts-DkyAiLpg.mjs +0 -15632
- package/dist/core-BexP5oiV.mjs +0 -4047
- package/dist/help-CctDYrAH.mjs +0 -2308
- package/dist/insights/components/insights/P2pCategorization/_tests_/P2pCategorizationMultipleTransaction.test.d.ts +0 -0
- package/dist/insights/components/insights/P2pCategorization/_tests_/P2pCategorizationSingleTransaction.test.d.ts +0 -0
- package/dist/microinsights-CRf3ChsJ.mjs +0 -1814
- package/dist/recurringtransactions-gbJ_NA8u.mjs +0 -1564
- package/dist/settings-ZMHe439l.mjs +0 -1526
|
@@ -0,0 +1,1280 @@
|
|
|
1
|
+
import { jsx as o, jsxs as N, Fragment as we } from "react/jsx-runtime";
|
|
2
|
+
import E, { useEffect as le, useState as ce } from "react";
|
|
3
|
+
import { observer as z } from "mobx-react-lite";
|
|
4
|
+
import k from "@mui/material/Stack";
|
|
5
|
+
import He from "@mui/material/Button";
|
|
6
|
+
import { CategoryIcon as $e, MerchantLogo as je, InstitutionLogo as Ye, P as he, Text as ge, H3 as Xe } from "@mxenabled/mxui";
|
|
7
|
+
import { Close as Ze, ChevronLeft as Qe, ChevronRight as Ne } from "@mxenabled/mx-icons";
|
|
8
|
+
import { L as qe } from "./Loader-CxeBwuPG.mjs";
|
|
9
|
+
import de from "@mui/material/Box";
|
|
10
|
+
import Ie from "@mui/material/IconButton";
|
|
11
|
+
import { useTheme as P, alpha as s } from "@mui/material/styles";
|
|
12
|
+
import { useInView as Me } from "react-intersection-observer";
|
|
13
|
+
import { B as c } from "./BeatMaterialIcon-1KOfRZrA.mjs";
|
|
14
|
+
import { C as Je } from "./Category-DEKZGLYe.mjs";
|
|
15
|
+
import { b as et } from "./Localization-DnoVyBNK.mjs";
|
|
16
|
+
import tt from "@mui/material/CircularProgress";
|
|
17
|
+
import { makeAutoObservable as _e, runInAction as ve } from "mobx";
|
|
18
|
+
import { a as ot, u as nt, b as it } from "./Analytics-CkYXKvco.mjs";
|
|
19
|
+
import { G as Ee, B as ye } from "./GlobalCopyApi-wcnDUzMV.mjs";
|
|
20
|
+
import { u as rt } from "./useWidgetLoadTimer-B0tB-yzL.mjs";
|
|
21
|
+
import { Card as at, CardActionArea as st, Box as ct, IconButton as lt, Stack as K, Button as fe } from "@mui/material";
|
|
22
|
+
class dt {
|
|
23
|
+
copyApi = new Ee("/", "");
|
|
24
|
+
copyObject = {};
|
|
25
|
+
namespace = "experiences";
|
|
26
|
+
translationKey = "micro_insights";
|
|
27
|
+
constructor() {
|
|
28
|
+
_e(this);
|
|
29
|
+
}
|
|
30
|
+
// NOTE: Not sure if this is special case, but other stores have this deprecation todo
|
|
31
|
+
// DEPRECATED: Initialize api in constructor and use loadCopy instead
|
|
32
|
+
// TODO: Remove this function
|
|
33
|
+
initialize = async (e, n) => {
|
|
34
|
+
this.copyApi = new Ee(e, n), await this.loadCopy();
|
|
35
|
+
};
|
|
36
|
+
loadCopy = async () => {
|
|
37
|
+
const e = await this.copyApi.getGlobalCopy(this.namespace, this.translationKey);
|
|
38
|
+
ve(() => {
|
|
39
|
+
this.copyObject = e[this.translationKey];
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
get cardsCopy() {
|
|
43
|
+
return this.copyObject.cards;
|
|
44
|
+
}
|
|
45
|
+
get carouselCopy() {
|
|
46
|
+
return this.copyObject.carousel;
|
|
47
|
+
}
|
|
48
|
+
get zeroStateCopy() {
|
|
49
|
+
return this.copyObject.zero_state;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const pe = {
|
|
53
|
+
BillAmountNotStandard: "BillAmountNotStandard",
|
|
54
|
+
CanadianUpcomingDeadlineAlert: "CanadianUpcomingDeadlineAlert",
|
|
55
|
+
DuplicatePaymentV2: "DuplicatePaymentV2",
|
|
56
|
+
IntroducePulse: "IntroducePulse",
|
|
57
|
+
LargeTransaction: "LargeTransaction",
|
|
58
|
+
MonthlySpendToIncomeComparisonV2: "MonthlySpendToIncomeComparisonV2",
|
|
59
|
+
QuarterlySummary: "QuarterlySummary",
|
|
60
|
+
SpendingPlanCategorySpending: "SpendingPlanCategorySpending",
|
|
61
|
+
SubscriptionPriceIncrease: "SubscriptionPriceIncrease",
|
|
62
|
+
UncategorizedTransactionsV2: "UncategorizedTransactionsV2",
|
|
63
|
+
UpcomingBill: "UpcomingBill",
|
|
64
|
+
UnifiedDeposit: "UnifiedDeposit",
|
|
65
|
+
WeeklySpendingPlanSummary: "WeeklySpendingPlanSummary",
|
|
66
|
+
WeeklyNewMerchantsV2: "WeeklyNewMerchantsV2",
|
|
67
|
+
MonthlySpendComparison: "MonthlySpendComparison",
|
|
68
|
+
MonthlySpendToIncomeComparison: "MonthlySpendToIncomeComparison"
|
|
69
|
+
}, O = window?.app?.clientConfig?.microwidget_instance_id || "", Ae = {
|
|
70
|
+
INSIGHTS_MICRO_WIDGET: "/micro-insights-carousel"
|
|
71
|
+
}, be = (t) => `on${t}Click`, Le = (t) => `on${t}View`, xe = (t) => `on${t}ViewFirstTime`, me = (t) => t.replace(/([a-z])([A-Z])/g, "$1 $2"), _t = () => Object.values(pe).reduce(
|
|
72
|
+
(t, e) => ({
|
|
73
|
+
...t,
|
|
74
|
+
[be(e)]: {
|
|
75
|
+
action: L.MICRO_BEAT_CLICKED,
|
|
76
|
+
category: b.BEAT_INTERACTION,
|
|
77
|
+
label: me(e),
|
|
78
|
+
value: O
|
|
79
|
+
}
|
|
80
|
+
}),
|
|
81
|
+
{}
|
|
82
|
+
), pt = () => Object.values(pe).reduce(
|
|
83
|
+
(t, e) => ({
|
|
84
|
+
...t,
|
|
85
|
+
[Le(e)]: {
|
|
86
|
+
action: L.MICRO_BEAT_DISPLAYED,
|
|
87
|
+
category: b.BEAT_INTERACTION,
|
|
88
|
+
label: me(e),
|
|
89
|
+
value: O
|
|
90
|
+
}
|
|
91
|
+
}),
|
|
92
|
+
{}
|
|
93
|
+
), mt = () => Object.values(pe).reduce(
|
|
94
|
+
(t, e) => ({
|
|
95
|
+
...t,
|
|
96
|
+
[xe(e)]: {
|
|
97
|
+
action: L.MICRO_BEAT_DISPLAYED_FIRST_TIME,
|
|
98
|
+
category: b.BEAT_INTERACTION,
|
|
99
|
+
label: me(e),
|
|
100
|
+
value: O
|
|
101
|
+
}
|
|
102
|
+
}),
|
|
103
|
+
{}
|
|
104
|
+
), v = {
|
|
105
|
+
CAROUSEL_CONTROL: "Carousel Control",
|
|
106
|
+
MICRO_WIDGET: "Micro Widget",
|
|
107
|
+
VIEW_MORE: "View More"
|
|
108
|
+
}, b = {
|
|
109
|
+
MICRO_WIDGET_INTERACTION: "Micro Widget Interaction",
|
|
110
|
+
BEAT_INTERACTION: "Beat Interaction"
|
|
111
|
+
}, W = {
|
|
112
|
+
ON_CAROUSEL_BACK_CLICK: "onCarouselBackClick",
|
|
113
|
+
ON_CAROUSEL_BACK_SWIPE: "onCarouselBackSwipe",
|
|
114
|
+
ON_CAROUSEL_FORWARD_CLICK: "onCarouselForwardClick",
|
|
115
|
+
ON_CAROUSEL_FORWARD_SWIPE: "onCarouselForwardSwipe",
|
|
116
|
+
ON_NO_RELEVANT_INSIGHTS_CLICKED: "onNoRelevantInsightsClicked",
|
|
117
|
+
ON_VIEW_MORE_CLICKED: "onViewMoreClicked"
|
|
118
|
+
}, De = {
|
|
119
|
+
ON_VIEW_MORE_VIEWED: "onViewMoreCardView"
|
|
120
|
+
}, L = {
|
|
121
|
+
CONTROL_BACKWARD: "Control Backward",
|
|
122
|
+
CONTROL_FORWARD: "Control Forward",
|
|
123
|
+
MICRO_BEAT_CLICKED: "Micro Beat Clicked",
|
|
124
|
+
MICRO_BEAT_DISPLAYED: "Micro Beat Displayed",
|
|
125
|
+
MICRO_BEAT_DISPLAYED_FIRST_TIME: "Micro Beat Displayed For First Time",
|
|
126
|
+
SWIPE_BACKWARD: "Swipe Backward",
|
|
127
|
+
SWIPE_FORWARD: "Swipe Forward"
|
|
128
|
+
}, B = {
|
|
129
|
+
MICRO_WIDGET_CAROUSEL: "Micro Widget Carousel",
|
|
130
|
+
MICRO_WIDGET_CAROUSEL_ZERO_STATE: "Micro Widget Carousel Zero State",
|
|
131
|
+
MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS: "Micro Widget Carousel No Relevant Insights"
|
|
132
|
+
}, Se = {
|
|
133
|
+
[B.MICRO_WIDGET_CAROUSEL]: {
|
|
134
|
+
label: v.MICRO_WIDGET,
|
|
135
|
+
name: B.MICRO_WIDGET_CAROUSEL,
|
|
136
|
+
path: Ae.INSIGHTS_MICRO_WIDGET,
|
|
137
|
+
value: O
|
|
138
|
+
},
|
|
139
|
+
// zero state
|
|
140
|
+
[B.MICRO_WIDGET_CAROUSEL_ZERO_STATE]: {
|
|
141
|
+
label: v.MICRO_WIDGET,
|
|
142
|
+
name: B.MICRO_WIDGET_CAROUSEL_ZERO_STATE,
|
|
143
|
+
path: Ae.INSIGHTS_MICRO_WIDGET,
|
|
144
|
+
value: O
|
|
145
|
+
},
|
|
146
|
+
// no relevant cards
|
|
147
|
+
[B.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS]: {
|
|
148
|
+
label: v.MICRO_WIDGET,
|
|
149
|
+
name: B.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS,
|
|
150
|
+
path: "/micro-widget",
|
|
151
|
+
value: O
|
|
152
|
+
}
|
|
153
|
+
}, Te = {
|
|
154
|
+
// carousel control interaction events - clicks and swipes
|
|
155
|
+
[W.ON_CAROUSEL_BACK_CLICK]: {
|
|
156
|
+
action: L.CONTROL_BACKWARD,
|
|
157
|
+
category: b.MICRO_WIDGET_INTERACTION,
|
|
158
|
+
label: v.CAROUSEL_CONTROL,
|
|
159
|
+
value: O
|
|
160
|
+
},
|
|
161
|
+
[W.ON_CAROUSEL_FORWARD_CLICK]: {
|
|
162
|
+
action: L.CONTROL_FORWARD,
|
|
163
|
+
category: b.MICRO_WIDGET_INTERACTION,
|
|
164
|
+
label: v.CAROUSEL_CONTROL,
|
|
165
|
+
value: O
|
|
166
|
+
},
|
|
167
|
+
[W.ON_CAROUSEL_BACK_SWIPE]: {
|
|
168
|
+
action: L.SWIPE_BACKWARD,
|
|
169
|
+
category: b.MICRO_WIDGET_INTERACTION,
|
|
170
|
+
label: v.CAROUSEL_CONTROL,
|
|
171
|
+
value: O
|
|
172
|
+
},
|
|
173
|
+
[W.ON_CAROUSEL_FORWARD_SWIPE]: {
|
|
174
|
+
action: L.SWIPE_FORWARD,
|
|
175
|
+
category: b.MICRO_WIDGET_INTERACTION,
|
|
176
|
+
label: v.CAROUSEL_CONTROL,
|
|
177
|
+
value: O
|
|
178
|
+
},
|
|
179
|
+
// read more card events
|
|
180
|
+
[W.ON_VIEW_MORE_CLICKED]: {
|
|
181
|
+
action: L.MICRO_BEAT_CLICKED,
|
|
182
|
+
category: b.BEAT_INTERACTION,
|
|
183
|
+
label: v.VIEW_MORE,
|
|
184
|
+
value: O
|
|
185
|
+
},
|
|
186
|
+
[De.ON_VIEW_MORE_VIEWED]: {
|
|
187
|
+
action: L.MICRO_BEAT_DISPLAYED,
|
|
188
|
+
category: b.BEAT_INTERACTION,
|
|
189
|
+
label: v.VIEW_MORE,
|
|
190
|
+
value: O
|
|
191
|
+
},
|
|
192
|
+
..._t(),
|
|
193
|
+
...pt(),
|
|
194
|
+
...mt()
|
|
195
|
+
}, Re = async (t, e) => !e || !Te[t] ? null : e.sendAnalyticEvent(Te[t]).then((n) => n).catch((n) => {
|
|
196
|
+
throw n;
|
|
197
|
+
}), Oe = async (t, e) => !e || !Se[t] ? null : e.sendAnalyticsPageview(Se[t]).then((n) => n).catch((n) => {
|
|
198
|
+
throw n;
|
|
199
|
+
});
|
|
200
|
+
class ut {
|
|
201
|
+
onAnalyticEvent = Re;
|
|
202
|
+
onAnalyticPageView = Oe;
|
|
203
|
+
beatApi = new ye("/", "");
|
|
204
|
+
constructor() {
|
|
205
|
+
_e(this);
|
|
206
|
+
}
|
|
207
|
+
initialize = async (e, n, i) => {
|
|
208
|
+
this.onAnalyticEvent = (a, l) => {
|
|
209
|
+
Re(a, l).then((r) => r).catch((r) => {
|
|
210
|
+
throw r.status === 401 && i(), r;
|
|
211
|
+
});
|
|
212
|
+
}, this.onAnalyticPageView = (a, l) => {
|
|
213
|
+
Oe(a, l).then((r) => r).catch((r) => {
|
|
214
|
+
throw r.status === 401 && i(), r;
|
|
215
|
+
});
|
|
216
|
+
}, this.beatApi = new ye(e, n);
|
|
217
|
+
};
|
|
218
|
+
updateBeat = async (e) => {
|
|
219
|
+
this.beatApi.updateBeat(e);
|
|
220
|
+
};
|
|
221
|
+
updateOffer = async (e) => {
|
|
222
|
+
this.beatApi.updateOffer(e);
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
class Ct {
|
|
226
|
+
copyStore;
|
|
227
|
+
endpoint = "/";
|
|
228
|
+
insightsMicroWidgetStore;
|
|
229
|
+
session = null;
|
|
230
|
+
token = "";
|
|
231
|
+
isInitialized = !1;
|
|
232
|
+
constructor() {
|
|
233
|
+
this.copyStore = new dt(), this.insightsMicroWidgetStore = new ut(), _e(this);
|
|
234
|
+
}
|
|
235
|
+
initialize = async (e, n, i) => {
|
|
236
|
+
await this.copyStore.initialize(e, n), await this.insightsMicroWidgetStore.initialize(e, n, i);
|
|
237
|
+
const a = await ot(e, n, "1.0.0", "Micro Insights Carousel");
|
|
238
|
+
ve(() => {
|
|
239
|
+
this.session = a, this.isInitialized = !0;
|
|
240
|
+
});
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
const F = E.createContext(null), ht = ({
|
|
244
|
+
onEvent: t,
|
|
245
|
+
onPageview: e,
|
|
246
|
+
store: n,
|
|
247
|
+
children: i
|
|
248
|
+
}) => /* @__PURE__ */ o(F.Provider, { value: { onEvent: t, onPageview: e, store: n, children: i }, children: i }), gt = ({ beat: t }) => {
|
|
249
|
+
const { primary_category_guid: e, category_guids: n } = t, i = e || n?.[0] || Je.UNCATEGORIZED;
|
|
250
|
+
return /* @__PURE__ */ o($e, { categoryGuid: i, size: 32, sx: { minWidth: 32 } });
|
|
251
|
+
}, It = ({ beat: t }) => {
|
|
252
|
+
const { category_guids: e, merchant_guids: n, primary_category_guid: i, primary_merchant_guid: a } = t;
|
|
253
|
+
return /* @__PURE__ */ o(
|
|
254
|
+
je,
|
|
255
|
+
{
|
|
256
|
+
categoryGuid: i || e && e[0] || "",
|
|
257
|
+
merchantGuid: a || n[0],
|
|
258
|
+
size: 32,
|
|
259
|
+
sx: {
|
|
260
|
+
display: "flex",
|
|
261
|
+
mt: 2,
|
|
262
|
+
minWidth: 32
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
);
|
|
266
|
+
}, Et = (t) => t ? t.data ? t.data.map((e) => {
|
|
267
|
+
const n = {};
|
|
268
|
+
return t.names?.map((i, a) => {
|
|
269
|
+
n[i] = e[a];
|
|
270
|
+
}), n;
|
|
271
|
+
}) : [] : [], q = "primary", Be = "success", Pe = "error", Ve = (t) => {
|
|
272
|
+
const e = Et(t), n = Math.floor(e.length / 2);
|
|
273
|
+
if (n === 0 || n === e.length) return q;
|
|
274
|
+
const i = e[0]?.amount, a = e[n]?.amount;
|
|
275
|
+
return i == null || a == null ? q : i > a ? Pe : i < a ? Be : q;
|
|
276
|
+
}, yt = (t, e) => t < e ? Be : t > e ? Pe : q, ft = ({ beat: t }) => {
|
|
277
|
+
const e = P(), n = Ve(t.data_series), i = e.palette[n].main;
|
|
278
|
+
return /* @__PURE__ */ o(c, { bgColor: s(i, 0.15), iconColor: n, name: "bar_chart" });
|
|
279
|
+
}, At = ({ beat: t }) => {
|
|
280
|
+
const e = P(), n = t.payload?.average_spend || 0;
|
|
281
|
+
let i = 0;
|
|
282
|
+
if (t.data_series?.data && t.data_series.data.length > 0) {
|
|
283
|
+
const r = (t.data_series.names || []).indexOf("amount");
|
|
284
|
+
r !== -1 && (i = t.data_series.data[0][r] || 0);
|
|
285
|
+
}
|
|
286
|
+
const a = yt(i, n);
|
|
287
|
+
return /* @__PURE__ */ o(
|
|
288
|
+
c,
|
|
289
|
+
{
|
|
290
|
+
bgColor: s(e.palette[a].main, 0.15),
|
|
291
|
+
iconColor: a,
|
|
292
|
+
name: "timeline"
|
|
293
|
+
}
|
|
294
|
+
);
|
|
295
|
+
}, St = ({ beat: t }) => {
|
|
296
|
+
const e = P(), n = Ve(t.data_series), i = e.palette[n].main;
|
|
297
|
+
return /* @__PURE__ */ o(
|
|
298
|
+
c,
|
|
299
|
+
{
|
|
300
|
+
bgColor: s(i, 0.15),
|
|
301
|
+
fill: !1,
|
|
302
|
+
iconColor: n,
|
|
303
|
+
name: "area_chart"
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
}, Tt = ({ beat: t }) => /* @__PURE__ */ o(Ye, { alt: t.institutionName || "", institutionGuid: t.institutionGuid || "" }), Rt = {
|
|
307
|
+
0: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "error" }),
|
|
308
|
+
1: (t) => /* @__PURE__ */ o(gt, { beat: t }),
|
|
309
|
+
2: (t) => /* @__PURE__ */ o(It, { beat: t }),
|
|
310
|
+
3: (t) => /* @__PURE__ */ o(ft, { beat: t }),
|
|
311
|
+
4: (t, e) => /* @__PURE__ */ o(
|
|
312
|
+
c,
|
|
313
|
+
{
|
|
314
|
+
bgColor: s(e.palette.secondary.main, 0.15),
|
|
315
|
+
iconColor: "secondary",
|
|
316
|
+
name: "info"
|
|
317
|
+
}
|
|
318
|
+
),
|
|
319
|
+
5: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "campaign" }),
|
|
320
|
+
6: (t, e) => /* @__PURE__ */ o(
|
|
321
|
+
c,
|
|
322
|
+
{
|
|
323
|
+
bgColor: s(e.palette.success.main, 0.15),
|
|
324
|
+
iconColor: "success",
|
|
325
|
+
name: "check_circle"
|
|
326
|
+
}
|
|
327
|
+
),
|
|
328
|
+
7: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "today" }),
|
|
329
|
+
8: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "calendar_clock" }),
|
|
330
|
+
9: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "celebration" }),
|
|
331
|
+
// TODO: Waiting for the backend to accommodate the below icon types
|
|
332
|
+
10: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "problem" }),
|
|
333
|
+
11: (t, e) => /* @__PURE__ */ o(
|
|
334
|
+
c,
|
|
335
|
+
{
|
|
336
|
+
avatarSx: { border: `1px solid ${e.palette.secondary.main}` },
|
|
337
|
+
bgColor: s(e.palette.secondary.main, 0.15),
|
|
338
|
+
fill: !1,
|
|
339
|
+
name: "category",
|
|
340
|
+
sx: { color: "text.primary" }
|
|
341
|
+
}
|
|
342
|
+
),
|
|
343
|
+
12: (t) => /* @__PURE__ */ o(St, { beat: t }),
|
|
344
|
+
13: () => /* @__PURE__ */ o(
|
|
345
|
+
c,
|
|
346
|
+
{
|
|
347
|
+
avatarSx: { border: "1px solid #EB00D0" },
|
|
348
|
+
bgColor: s("#EB00D0", 0.25),
|
|
349
|
+
fill: !1,
|
|
350
|
+
name: "money_bag",
|
|
351
|
+
sx: { color: "text.primary" }
|
|
352
|
+
}
|
|
353
|
+
),
|
|
354
|
+
14: (t, e) => /* @__PURE__ */ o(
|
|
355
|
+
c,
|
|
356
|
+
{
|
|
357
|
+
bgColor: s(e.palette.secondary.main, 0.15),
|
|
358
|
+
fill: !1,
|
|
359
|
+
iconColor: "secondary",
|
|
360
|
+
name: "person"
|
|
361
|
+
}
|
|
362
|
+
),
|
|
363
|
+
15: (t, e) => /* @__PURE__ */ o(
|
|
364
|
+
c,
|
|
365
|
+
{
|
|
366
|
+
bgColor: s(e.palette.primary.main, 0.15),
|
|
367
|
+
name: "payment_arrow_down"
|
|
368
|
+
}
|
|
369
|
+
),
|
|
370
|
+
16: (t, e) => /* @__PURE__ */ o(
|
|
371
|
+
c,
|
|
372
|
+
{
|
|
373
|
+
bgColor: s(e.palette.success.main, 0.15),
|
|
374
|
+
name: "beenhere",
|
|
375
|
+
sx: { color: "success.main" }
|
|
376
|
+
}
|
|
377
|
+
),
|
|
378
|
+
17: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "savings" }),
|
|
379
|
+
18: (t, e) => /* @__PURE__ */ o(
|
|
380
|
+
c,
|
|
381
|
+
{
|
|
382
|
+
bgColor: t.payload.projected_overdraft_amount < 0 ? s(e.palette.warning.main, 0.15) : s(e.palette.error.main, 0.15),
|
|
383
|
+
iconColor: t?.payload?.projected_overdraft_amount < 0 ? "warning" : "error",
|
|
384
|
+
name: "error"
|
|
385
|
+
}
|
|
386
|
+
),
|
|
387
|
+
19: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "finance_mode" }),
|
|
388
|
+
20: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "tips_and_updates" }),
|
|
389
|
+
21: (t, e) => /* @__PURE__ */ o(
|
|
390
|
+
c,
|
|
391
|
+
{
|
|
392
|
+
bgColor: s(e.palette.primary.main, 0.15),
|
|
393
|
+
name: "currency_exchange"
|
|
394
|
+
}
|
|
395
|
+
),
|
|
396
|
+
22: (t, e) => /* @__PURE__ */ o(
|
|
397
|
+
c,
|
|
398
|
+
{
|
|
399
|
+
bgColor: s(e.palette.warning.main, 0.15),
|
|
400
|
+
name: "flag",
|
|
401
|
+
sx: { color: "warning.main" }
|
|
402
|
+
}
|
|
403
|
+
),
|
|
404
|
+
23: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "thumb_up" }),
|
|
405
|
+
24: () => /* @__PURE__ */ o(
|
|
406
|
+
c,
|
|
407
|
+
{
|
|
408
|
+
bgColor: s("#EB00D0", 0.15),
|
|
409
|
+
name: "attach_money",
|
|
410
|
+
sx: { color: "#EB00D0" }
|
|
411
|
+
}
|
|
412
|
+
),
|
|
413
|
+
25: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "note_stack" }),
|
|
414
|
+
26: (t, e) => /* @__PURE__ */ o(
|
|
415
|
+
c,
|
|
416
|
+
{
|
|
417
|
+
bgColor: s(e.palette.primary.main, 0.15),
|
|
418
|
+
fill: !1,
|
|
419
|
+
name: "price_change"
|
|
420
|
+
}
|
|
421
|
+
),
|
|
422
|
+
27: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "directions_car" }),
|
|
423
|
+
28: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "contract" }),
|
|
424
|
+
29: (t) => /* @__PURE__ */ o(At, { beat: t }),
|
|
425
|
+
30: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "calendar_month" }),
|
|
426
|
+
31: (t, e) => /* @__PURE__ */ o(
|
|
427
|
+
c,
|
|
428
|
+
{
|
|
429
|
+
bgColor: s(e.palette.warning.main, 0.15),
|
|
430
|
+
name: "star_rate",
|
|
431
|
+
sx: { color: "warning.400" }
|
|
432
|
+
}
|
|
433
|
+
),
|
|
434
|
+
32: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "help" }),
|
|
435
|
+
33: (t, e) => /* @__PURE__ */ o(
|
|
436
|
+
c,
|
|
437
|
+
{
|
|
438
|
+
bgColor: s(e.palette.primary.main, 0.15),
|
|
439
|
+
fill: !1,
|
|
440
|
+
name: "storefront"
|
|
441
|
+
}
|
|
442
|
+
),
|
|
443
|
+
34: (t) => /* @__PURE__ */ o(Tt, { beat: t })
|
|
444
|
+
}, Ot = ({ beat: t }) => {
|
|
445
|
+
const e = P(), { icon_type: n } = t, i = n != null ? Rt[n] : null;
|
|
446
|
+
return i ? i(t, e) : /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "error" });
|
|
447
|
+
}, x = () => {
|
|
448
|
+
const t = E.useContext(F);
|
|
449
|
+
if (!t)
|
|
450
|
+
throw new Error("useCopyStore() must be used within the InsightsMicroWidgetDataProvider");
|
|
451
|
+
return t.store.copyStore;
|
|
452
|
+
}, Wt = () => {
|
|
453
|
+
const t = E.useContext(F);
|
|
454
|
+
if (!t?.store?.insightsMicroWidgetStore)
|
|
455
|
+
throw new Error(
|
|
456
|
+
"useInsightsMicroWidgetStore() must be used within the InsightsMicroWidgetDataProvider"
|
|
457
|
+
);
|
|
458
|
+
return t.store.insightsMicroWidgetStore;
|
|
459
|
+
}, H = () => {
|
|
460
|
+
const t = E.useContext(F);
|
|
461
|
+
if (!t)
|
|
462
|
+
throw new Error("useEvent() must be used within the InsightsMicroWidgetDataProvider");
|
|
463
|
+
return { onEvent: t.onEvent };
|
|
464
|
+
}, Ge = () => {
|
|
465
|
+
const t = E.useContext(F);
|
|
466
|
+
if (!t)
|
|
467
|
+
throw new Error("usePageview() must be used within the InsightsMicroWidgetDataProvider");
|
|
468
|
+
return { onPageview: t.onPageview };
|
|
469
|
+
}, wt = {
|
|
470
|
+
LARGE: 180,
|
|
471
|
+
STANDARD: 154,
|
|
472
|
+
XLARGE: 200,
|
|
473
|
+
XXLARGE: 248
|
|
474
|
+
}, Nt = 50, ke = 1, J = E.forwardRef(
|
|
475
|
+
function({
|
|
476
|
+
ariaLabel: e,
|
|
477
|
+
closeAriaLabel: n,
|
|
478
|
+
description: i,
|
|
479
|
+
elevation: a,
|
|
480
|
+
icon: l,
|
|
481
|
+
isActiveCard: r,
|
|
482
|
+
heightOverrides: m,
|
|
483
|
+
onClose: C,
|
|
484
|
+
onCardClick: h,
|
|
485
|
+
onPrimaryAction: g,
|
|
486
|
+
onSecondaryAction: d,
|
|
487
|
+
primaryActionText: _,
|
|
488
|
+
secondaryActionText: p,
|
|
489
|
+
title: I,
|
|
490
|
+
variant: y,
|
|
491
|
+
widthOverrides: S,
|
|
492
|
+
...w
|
|
493
|
+
}, T) {
|
|
494
|
+
const f = !!(g && _), R = /* @__PURE__ */ N(we, { children: [
|
|
495
|
+
C && /* @__PURE__ */ o(
|
|
496
|
+
lt,
|
|
497
|
+
{
|
|
498
|
+
"aria-label": n,
|
|
499
|
+
onClick: (u) => {
|
|
500
|
+
u.stopPropagation(), C?.();
|
|
501
|
+
},
|
|
502
|
+
onMouseDown: (u) => {
|
|
503
|
+
u.stopPropagation();
|
|
504
|
+
},
|
|
505
|
+
onTouchStart: (u) => {
|
|
506
|
+
u.stopPropagation();
|
|
507
|
+
},
|
|
508
|
+
sx: { minHeight: 40, minWidth: 40, position: "absolute", right: 4, top: 4 },
|
|
509
|
+
children: /* @__PURE__ */ o(Ze, {})
|
|
510
|
+
}
|
|
511
|
+
),
|
|
512
|
+
/* @__PURE__ */ N(K, { sx: { gap: 6, height: "100%", justifyContent: "space-between" }, children: [
|
|
513
|
+
/* @__PURE__ */ N(K, { sx: { flexDirection: "row", gap: 12 }, children: [
|
|
514
|
+
l && l,
|
|
515
|
+
/* @__PURE__ */ N(K, { sx: { gap: 6 }, children: [
|
|
516
|
+
/* @__PURE__ */ o(K, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: /* @__PURE__ */ o(he, { bold: !0, sx: { lineHeight: "16px" }, variant: "body1", children: I }) }),
|
|
517
|
+
/* @__PURE__ */ o(
|
|
518
|
+
he,
|
|
519
|
+
{
|
|
520
|
+
dangerouslySetInnerHTML: { __html: i },
|
|
521
|
+
sx: {
|
|
522
|
+
display: "-webkit-box",
|
|
523
|
+
overflow: "hidden",
|
|
524
|
+
textOverflow: "ellipsis",
|
|
525
|
+
WebkitBoxOrient: "vertical",
|
|
526
|
+
WebkitLineClamp: f ? 2 : 3,
|
|
527
|
+
"& .bold-copy": {
|
|
528
|
+
fontWeight: "bold",
|
|
529
|
+
fontFamily: "inherit"
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
variant: "subtitle2"
|
|
533
|
+
}
|
|
534
|
+
)
|
|
535
|
+
] })
|
|
536
|
+
] }),
|
|
537
|
+
f && /* @__PURE__ */ N(
|
|
538
|
+
K,
|
|
539
|
+
{
|
|
540
|
+
sx: {
|
|
541
|
+
alignItems: "center",
|
|
542
|
+
flexDirection: "row",
|
|
543
|
+
height: 28,
|
|
544
|
+
pb: 4,
|
|
545
|
+
pl: l ? 36 : 0
|
|
546
|
+
},
|
|
547
|
+
children: [
|
|
548
|
+
f && /* @__PURE__ */ o(
|
|
549
|
+
fe,
|
|
550
|
+
{
|
|
551
|
+
onClick: (u) => {
|
|
552
|
+
u.stopPropagation(), g?.();
|
|
553
|
+
},
|
|
554
|
+
onMouseDown: (u) => {
|
|
555
|
+
u.stopPropagation();
|
|
556
|
+
},
|
|
557
|
+
onTouchStart: (u) => {
|
|
558
|
+
u.stopPropagation();
|
|
559
|
+
},
|
|
560
|
+
size: "small",
|
|
561
|
+
sx: { px: 8, ml: l ? 0 : -8 },
|
|
562
|
+
variant: "text",
|
|
563
|
+
children: /* @__PURE__ */ o(ge, { bold: !0, variant: "body2", children: _ })
|
|
564
|
+
}
|
|
565
|
+
),
|
|
566
|
+
!!(d && p) && /* @__PURE__ */ o(
|
|
567
|
+
fe,
|
|
568
|
+
{
|
|
569
|
+
onClick: (u) => {
|
|
570
|
+
u.stopPropagation(), d?.();
|
|
571
|
+
},
|
|
572
|
+
onMouseDown: (u) => {
|
|
573
|
+
u.stopPropagation();
|
|
574
|
+
},
|
|
575
|
+
onTouchStart: (u) => {
|
|
576
|
+
u.stopPropagation();
|
|
577
|
+
},
|
|
578
|
+
size: "small",
|
|
579
|
+
sx: { px: 8 },
|
|
580
|
+
variant: "text",
|
|
581
|
+
children: /* @__PURE__ */ o(ge, { bold: !0, sx: { color: "text.secondary" }, variant: "body2", children: p })
|
|
582
|
+
}
|
|
583
|
+
)
|
|
584
|
+
]
|
|
585
|
+
}
|
|
586
|
+
)
|
|
587
|
+
] })
|
|
588
|
+
] });
|
|
589
|
+
return /* @__PURE__ */ o(
|
|
590
|
+
at,
|
|
591
|
+
{
|
|
592
|
+
"aria-hidden": !r,
|
|
593
|
+
"aria-label": e,
|
|
594
|
+
elevation: a,
|
|
595
|
+
ref: T,
|
|
596
|
+
role: "group",
|
|
597
|
+
sx: {
|
|
598
|
+
backgroundColor: "background.paper",
|
|
599
|
+
height: m ? "100%" : 120,
|
|
600
|
+
minWidth: S ? `${S}px` : "100%",
|
|
601
|
+
position: "relative",
|
|
602
|
+
my: 1,
|
|
603
|
+
borderRadius: 2
|
|
604
|
+
},
|
|
605
|
+
tabIndex: h || !r ? -1 : 0,
|
|
606
|
+
variant: y,
|
|
607
|
+
...w,
|
|
608
|
+
children: h ? /* @__PURE__ */ o(
|
|
609
|
+
st,
|
|
610
|
+
{
|
|
611
|
+
component: "div",
|
|
612
|
+
onClick: h,
|
|
613
|
+
sx: {
|
|
614
|
+
pb: 8,
|
|
615
|
+
pt: 16,
|
|
616
|
+
px: 16,
|
|
617
|
+
height: "100%"
|
|
618
|
+
},
|
|
619
|
+
children: R
|
|
620
|
+
}
|
|
621
|
+
) : /* @__PURE__ */ o(ct, { sx: { pb: 8, pt: 16, px: 16, height: "100%" }, children: R })
|
|
622
|
+
}
|
|
623
|
+
);
|
|
624
|
+
}
|
|
625
|
+
), Mt = ({
|
|
626
|
+
ariaLabel: t,
|
|
627
|
+
beat: e,
|
|
628
|
+
elevation: n,
|
|
629
|
+
index: i,
|
|
630
|
+
isActiveCard: a,
|
|
631
|
+
onCardClick: l,
|
|
632
|
+
posthog: r,
|
|
633
|
+
widthOverrides: m,
|
|
634
|
+
variant: C,
|
|
635
|
+
showIcon: h,
|
|
636
|
+
heightOverrides: g
|
|
637
|
+
}) => {
|
|
638
|
+
const { ref: d, inView: _ } = Me({
|
|
639
|
+
threshold: ke
|
|
640
|
+
}), { cardsCopy: p } = x(), { onEvent: I } = H(), { updateBeat: y, updateOffer: S } = Wt();
|
|
641
|
+
le(() => {
|
|
642
|
+
_ && (e.has_been_displayed ? I(Le(e.template)) : (e.guid.startsWith("OFR") ? S({
|
|
643
|
+
...e,
|
|
644
|
+
has_been_displayed: !0
|
|
645
|
+
}) : y({
|
|
646
|
+
...e,
|
|
647
|
+
has_been_displayed: !0
|
|
648
|
+
}), I(xe(e.template))));
|
|
649
|
+
}, [_]), le(() => {
|
|
650
|
+
if (_ && e)
|
|
651
|
+
if (e.template === "MarketingOffer") {
|
|
652
|
+
const T = e;
|
|
653
|
+
r?.capture("viewed_messaging_insight", {
|
|
654
|
+
template: e.template,
|
|
655
|
+
campaign_guid: T.campaign_guid,
|
|
656
|
+
campaign_name: T.pulse_campaign_name
|
|
657
|
+
});
|
|
658
|
+
} else
|
|
659
|
+
r?.capture("viewed_insight", {
|
|
660
|
+
beat_guid: e.guid,
|
|
661
|
+
template: e.template,
|
|
662
|
+
position: i
|
|
663
|
+
});
|
|
664
|
+
}, [e, i, _]);
|
|
665
|
+
const w = () => {
|
|
666
|
+
if (l && l(e), I(be(e.template)), e.template === "MarketingOffer") {
|
|
667
|
+
const T = e;
|
|
668
|
+
r?.capture("clicked_messaging_insight", {
|
|
669
|
+
template: e.template,
|
|
670
|
+
campaign_guid: T.campaign_guid,
|
|
671
|
+
campaign_name: T.pulse_campaign_name
|
|
672
|
+
});
|
|
673
|
+
} else
|
|
674
|
+
r?.capture("clicked_insight", {
|
|
675
|
+
beat_guid: e.guid,
|
|
676
|
+
template: e.template,
|
|
677
|
+
position: i
|
|
678
|
+
});
|
|
679
|
+
};
|
|
680
|
+
return /* @__PURE__ */ o(
|
|
681
|
+
J,
|
|
682
|
+
{
|
|
683
|
+
"aria-roledescription": "slide",
|
|
684
|
+
ariaLabel: t,
|
|
685
|
+
description: e?.html_micro_description && e?.html_micro_description.length > 0 ? e.html_micro_description : e.html_description || "",
|
|
686
|
+
elevation: n,
|
|
687
|
+
heightOverrides: g,
|
|
688
|
+
icon: h && /* @__PURE__ */ o(Ot, { beat: e }),
|
|
689
|
+
isActiveCard: a,
|
|
690
|
+
onCardClick: w,
|
|
691
|
+
onPrimaryAction: w,
|
|
692
|
+
primaryActionText: e.micro_call_to_action || p?.micro_card_cta,
|
|
693
|
+
ref: d,
|
|
694
|
+
title: e.micro_title && e.micro_title.length > 0 ? e.micro_title : e.title,
|
|
695
|
+
variant: C,
|
|
696
|
+
widthOverrides: m
|
|
697
|
+
}
|
|
698
|
+
);
|
|
699
|
+
}, vt = ({
|
|
700
|
+
currentBeatIndex: t,
|
|
701
|
+
numBeats: e,
|
|
702
|
+
onNextClick: n,
|
|
703
|
+
onPreviousClick: i,
|
|
704
|
+
scrollRightBoundary: a,
|
|
705
|
+
scrollX: l,
|
|
706
|
+
shouldApplyDotAnimation: r = !1,
|
|
707
|
+
visibleCardsCount: m = 1
|
|
708
|
+
}) => {
|
|
709
|
+
const C = P(), { carouselCopy: h } = x(), g = Math.floor(l) > a || t - m + 1 === 0, d = l < 0 || e - 1 === t, _ = C.palette.grey[500], p = C.palette.primary.main;
|
|
710
|
+
return /* @__PURE__ */ N(
|
|
711
|
+
k,
|
|
712
|
+
{
|
|
713
|
+
direction: "row",
|
|
714
|
+
sx: {
|
|
715
|
+
alignItems: "center",
|
|
716
|
+
justifyContent: "center",
|
|
717
|
+
pt: 4,
|
|
718
|
+
width: "100%",
|
|
719
|
+
// we were using `gap` instead of margin, but it doesn't work in safari browsers older than iOS 14.1
|
|
720
|
+
"& button:first-child": {
|
|
721
|
+
mr: 8
|
|
722
|
+
}
|
|
723
|
+
},
|
|
724
|
+
children: [
|
|
725
|
+
/* @__PURE__ */ o(
|
|
726
|
+
Ie,
|
|
727
|
+
{
|
|
728
|
+
"aria-disabled": g,
|
|
729
|
+
"aria-label": h?.previous_insight_cta_aria,
|
|
730
|
+
disabled: g,
|
|
731
|
+
onClick: i,
|
|
732
|
+
children: /* @__PURE__ */ o(
|
|
733
|
+
Qe,
|
|
734
|
+
{
|
|
735
|
+
sx: {
|
|
736
|
+
color: g ? _ : p
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
)
|
|
740
|
+
}
|
|
741
|
+
),
|
|
742
|
+
Array.from({ length: e }).map((I, y) => {
|
|
743
|
+
const S = y === t;
|
|
744
|
+
return /* @__PURE__ */ o(
|
|
745
|
+
de,
|
|
746
|
+
{
|
|
747
|
+
className: "mx-insights-micro-carousel-dots",
|
|
748
|
+
sx: {
|
|
749
|
+
bgcolor: S ? p : _,
|
|
750
|
+
height: 8,
|
|
751
|
+
mr: 8,
|
|
752
|
+
// existing comment from meganthan "we were using `gap` instead of margin, but it doesn't work in safari browsers older than iOS 14.1"
|
|
753
|
+
...r ? {
|
|
754
|
+
borderRadius: "4px",
|
|
755
|
+
transformOrigin: "center",
|
|
756
|
+
transition: "all 0.5s ease-out",
|
|
757
|
+
willChange: "width, background-color"
|
|
758
|
+
} : {
|
|
759
|
+
borderRadius: "50%",
|
|
760
|
+
p: 0
|
|
761
|
+
},
|
|
762
|
+
width: S && r ? 24 : 8
|
|
763
|
+
}
|
|
764
|
+
},
|
|
765
|
+
`carousel-button-${y}`
|
|
766
|
+
);
|
|
767
|
+
}),
|
|
768
|
+
/* @__PURE__ */ o(
|
|
769
|
+
Ie,
|
|
770
|
+
{
|
|
771
|
+
"aria-disabled": d,
|
|
772
|
+
"aria-label": h?.next_insight_cta_aria,
|
|
773
|
+
disabled: d,
|
|
774
|
+
onClick: n,
|
|
775
|
+
children: /* @__PURE__ */ o(
|
|
776
|
+
Ne,
|
|
777
|
+
{
|
|
778
|
+
sx: {
|
|
779
|
+
color: d ? _ : p
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
)
|
|
783
|
+
}
|
|
784
|
+
)
|
|
785
|
+
]
|
|
786
|
+
}
|
|
787
|
+
);
|
|
788
|
+
}, bt = ({
|
|
789
|
+
activeCardIndex: t,
|
|
790
|
+
beats: e,
|
|
791
|
+
cardWidth: n,
|
|
792
|
+
elevation: i,
|
|
793
|
+
heightOverrides: a,
|
|
794
|
+
onCardClick: l,
|
|
795
|
+
posthog: r,
|
|
796
|
+
showIcon: m,
|
|
797
|
+
variant: C
|
|
798
|
+
}) => {
|
|
799
|
+
const { carouselCopy: h } = x(), g = {
|
|
800
|
+
elevation: i,
|
|
801
|
+
heightOverrides: a,
|
|
802
|
+
posthog: r,
|
|
803
|
+
showIcon: m,
|
|
804
|
+
variant: C
|
|
805
|
+
};
|
|
806
|
+
return /* @__PURE__ */ N(we, { children: [
|
|
807
|
+
e.map((d, _) => {
|
|
808
|
+
const p = _ + 1, I = e.length + 1, y = et(
|
|
809
|
+
h?.card_position_in_carousel_aria,
|
|
810
|
+
p.toString(),
|
|
811
|
+
I.toString()
|
|
812
|
+
), S = d.micro_title && d.micro_title.length > 0, w = d.micro_description && d.micro_description.length > 0, T = S ? d.micro_title : d.title, f = w ? d.micro_description : d.description;
|
|
813
|
+
return /* @__PURE__ */ o(
|
|
814
|
+
Mt,
|
|
815
|
+
{
|
|
816
|
+
ariaLabel: `${y}: ${T}, ${f}`,
|
|
817
|
+
beat: d,
|
|
818
|
+
index: _,
|
|
819
|
+
isActiveCard: _ === t,
|
|
820
|
+
onCardClick: l,
|
|
821
|
+
widthOverrides: n || void 0,
|
|
822
|
+
...g
|
|
823
|
+
},
|
|
824
|
+
`${d.guid} ${_}`
|
|
825
|
+
);
|
|
826
|
+
}),
|
|
827
|
+
/* @__PURE__ */ o(
|
|
828
|
+
zt,
|
|
829
|
+
{
|
|
830
|
+
isActiveCard: t === e.length,
|
|
831
|
+
onCardClick: l,
|
|
832
|
+
widthOverrides: n || void 0,
|
|
833
|
+
...g
|
|
834
|
+
}
|
|
835
|
+
)
|
|
836
|
+
] });
|
|
837
|
+
}, Lt = ({
|
|
838
|
+
analyticsMetadata: t,
|
|
839
|
+
allowSingleCardPeeking: e,
|
|
840
|
+
beats: n = [],
|
|
841
|
+
elevation: i,
|
|
842
|
+
heightOverrides: a,
|
|
843
|
+
onCardClick: l,
|
|
844
|
+
posthog: r,
|
|
845
|
+
showCarouselControls: m,
|
|
846
|
+
showIcon: C,
|
|
847
|
+
showWithMargin: h = !0,
|
|
848
|
+
variant: g,
|
|
849
|
+
widthOverrides: d,
|
|
850
|
+
visibleCardsCount: _ = 1
|
|
851
|
+
// Default to 1 card visible
|
|
852
|
+
}) => {
|
|
853
|
+
const p = E.useRef(null), I = E.useRef(null), [y, S] = E.useState(0), [w, T] = E.useState(null), [f, ee] = E.useState(null), [R, u] = E.useState(null), { carouselCopy: $ } = x(), { onEvent: M } = H();
|
|
854
|
+
E.useEffect(() => {
|
|
855
|
+
const A = (re) => {
|
|
856
|
+
const G = I.current;
|
|
857
|
+
if (!G) return;
|
|
858
|
+
const U = re ?? G.offsetWidth;
|
|
859
|
+
if (e) {
|
|
860
|
+
const Q = [
|
|
861
|
+
{ maxWidth: 320, cardWidth: 220 },
|
|
862
|
+
{ maxWidth: 375, cardWidth: 268 },
|
|
863
|
+
{ maxWidth: 444, cardWidth: 300 },
|
|
864
|
+
{ maxWidth: 599, cardWidth: 350 },
|
|
865
|
+
{ maxWidth: 749, cardWidth: 450 },
|
|
866
|
+
{ maxWidth: 900, cardWidth: 600 }
|
|
867
|
+
].find((Fe) => U <= Fe.maxWidth);
|
|
868
|
+
u(Q ? Q.cardWidth : 750);
|
|
869
|
+
return;
|
|
870
|
+
}
|
|
871
|
+
const ae = h ? Math.max(0, U - 32) : U, Ce = 8;
|
|
872
|
+
let se;
|
|
873
|
+
if (_ > 1) {
|
|
874
|
+
const Q = (ae - (_ - 1) * Ce) / _ / 3;
|
|
875
|
+
se = (ae - Q - (_ - 1) * Ce) / _;
|
|
876
|
+
} else
|
|
877
|
+
se = ae;
|
|
878
|
+
u(Math.max(0, se));
|
|
879
|
+
};
|
|
880
|
+
A();
|
|
881
|
+
const ue = () => A();
|
|
882
|
+
let ie = null;
|
|
883
|
+
return typeof ResizeObserver < "u" && I.current ? (ie = new ResizeObserver((re) => {
|
|
884
|
+
const G = re[0];
|
|
885
|
+
if (!G) return;
|
|
886
|
+
const U = G.borderBoxSize?.[0]?.inlineSize ?? G.contentRect.width;
|
|
887
|
+
A(U);
|
|
888
|
+
}), ie.observe(I.current)) : window.addEventListener("resize", ue), () => {
|
|
889
|
+
window.removeEventListener("resize", ue), ie?.disconnect();
|
|
890
|
+
};
|
|
891
|
+
}, [e, _, h]);
|
|
892
|
+
const V = () => {
|
|
893
|
+
M(W.ON_CAROUSEL_FORWARD_CLICK, t), p.current && R && p.current.scrollTo({
|
|
894
|
+
left: y + R + 8,
|
|
895
|
+
top: 0,
|
|
896
|
+
behavior: "smooth"
|
|
897
|
+
});
|
|
898
|
+
}, te = () => {
|
|
899
|
+
M(W.ON_CAROUSEL_BACK_CLICK, t), p.current && R && p.current.scrollTo({
|
|
900
|
+
left: Math.max(0, y - (R + 8)),
|
|
901
|
+
top: 0,
|
|
902
|
+
behavior: "smooth"
|
|
903
|
+
});
|
|
904
|
+
}, j = () => {
|
|
905
|
+
p.current && S(p.current.scrollLeft);
|
|
906
|
+
}, Y = () => {
|
|
907
|
+
if (!f || !w) return;
|
|
908
|
+
f - w > Nt ? M(W.ON_CAROUSEL_FORWARD_SWIPE, t) : M(W.ON_CAROUSEL_BACK_SWIPE, t);
|
|
909
|
+
}, oe = (A) => {
|
|
910
|
+
T(A.targetTouches[0].clientX);
|
|
911
|
+
}, ne = (A) => {
|
|
912
|
+
T(null), ee(A.targetTouches[0].clientX);
|
|
913
|
+
}, X = R ? Math.round(y / (R + 8)) : 0, Z = p.current ? p.current.scrollWidth - p.current.offsetWidth : 0;
|
|
914
|
+
return /* @__PURE__ */ N(
|
|
915
|
+
k,
|
|
916
|
+
{
|
|
917
|
+
"aria-label": $?.carousel_title,
|
|
918
|
+
"aria-roledescription": "carousel",
|
|
919
|
+
ref: I,
|
|
920
|
+
role: "region",
|
|
921
|
+
sx: {
|
|
922
|
+
alignItems: "center",
|
|
923
|
+
boxSizing: "border-box",
|
|
924
|
+
height: a,
|
|
925
|
+
width: d || "100%"
|
|
926
|
+
},
|
|
927
|
+
children: [
|
|
928
|
+
/* @__PURE__ */ o(
|
|
929
|
+
k,
|
|
930
|
+
{
|
|
931
|
+
direction: "row",
|
|
932
|
+
onScroll: j,
|
|
933
|
+
onTouchEnd: Y,
|
|
934
|
+
onTouchMove: oe,
|
|
935
|
+
onTouchStart: ne,
|
|
936
|
+
ref: p,
|
|
937
|
+
sx: {
|
|
938
|
+
alignItems: "center",
|
|
939
|
+
height: a && "100%",
|
|
940
|
+
gap: 8,
|
|
941
|
+
listStyleType: "none",
|
|
942
|
+
m: 0,
|
|
943
|
+
maxWidth: h ? "calc(100% - 32px)" : "100%",
|
|
944
|
+
overflowX: "auto",
|
|
945
|
+
overflowY: "hidden",
|
|
946
|
+
p: 0,
|
|
947
|
+
scrollbarWidth: "none",
|
|
948
|
+
"-ms-overflow-style": "none",
|
|
949
|
+
"-webkit-overflow-scrolling": "touch",
|
|
950
|
+
"&::-webkit-scrollbar": {
|
|
951
|
+
display: "none"
|
|
952
|
+
}
|
|
953
|
+
},
|
|
954
|
+
children: /* @__PURE__ */ o(
|
|
955
|
+
bt,
|
|
956
|
+
{
|
|
957
|
+
activeCardIndex: X,
|
|
958
|
+
beats: n,
|
|
959
|
+
cardWidth: R,
|
|
960
|
+
elevation: i,
|
|
961
|
+
heightOverrides: a,
|
|
962
|
+
onCardClick: l,
|
|
963
|
+
posthog: r,
|
|
964
|
+
showIcon: C,
|
|
965
|
+
variant: g
|
|
966
|
+
}
|
|
967
|
+
)
|
|
968
|
+
}
|
|
969
|
+
),
|
|
970
|
+
m && /* @__PURE__ */ o(
|
|
971
|
+
vt,
|
|
972
|
+
{
|
|
973
|
+
currentBeatIndex: X + _ - 1,
|
|
974
|
+
numBeats: n.length + 1,
|
|
975
|
+
onNextClick: V,
|
|
976
|
+
onPreviousClick: te,
|
|
977
|
+
scrollRightBoundary: Z,
|
|
978
|
+
scrollX: y,
|
|
979
|
+
shouldApplyDotAnimation: e,
|
|
980
|
+
visibleCardsCount: _
|
|
981
|
+
}
|
|
982
|
+
)
|
|
983
|
+
]
|
|
984
|
+
}
|
|
985
|
+
);
|
|
986
|
+
}, xt = z(Lt), Dt = ({
|
|
987
|
+
analyticsMetadata: t,
|
|
988
|
+
onCardClick: e,
|
|
989
|
+
posthog: n,
|
|
990
|
+
widthOverrides: i,
|
|
991
|
+
headerSx: a
|
|
992
|
+
}) => {
|
|
993
|
+
const { carouselCopy: l } = x(), { onEvent: r } = H(), m = () => {
|
|
994
|
+
r && (r(W.ON_VIEW_MORE_CLICKED, t), e(), n?.capture("clicked_view_more"));
|
|
995
|
+
};
|
|
996
|
+
return l ? /* @__PURE__ */ N(
|
|
997
|
+
k,
|
|
998
|
+
{
|
|
999
|
+
alignItems: "center",
|
|
1000
|
+
direction: "row",
|
|
1001
|
+
justifyContent: "space-between",
|
|
1002
|
+
spacing: 2,
|
|
1003
|
+
sx: {
|
|
1004
|
+
p: 16,
|
|
1005
|
+
pb: 8,
|
|
1006
|
+
width: i || void 0,
|
|
1007
|
+
...a
|
|
1008
|
+
},
|
|
1009
|
+
children: [
|
|
1010
|
+
/* @__PURE__ */ o(Xe, { children: l.carousel_title }),
|
|
1011
|
+
/* @__PURE__ */ o(
|
|
1012
|
+
He,
|
|
1013
|
+
{
|
|
1014
|
+
endIcon: /* @__PURE__ */ o(Ne, { size: 20 }),
|
|
1015
|
+
onClick: m,
|
|
1016
|
+
size: "small",
|
|
1017
|
+
variant: "text",
|
|
1018
|
+
children: l.view_all_insights_in_full_feed_cta_aria
|
|
1019
|
+
}
|
|
1020
|
+
)
|
|
1021
|
+
]
|
|
1022
|
+
}
|
|
1023
|
+
) : /* @__PURE__ */ o(qe, {});
|
|
1024
|
+
}, Bt = z(Dt), Pt = ({
|
|
1025
|
+
heightOverrides: t,
|
|
1026
|
+
widthOverrides: e,
|
|
1027
|
+
children: n
|
|
1028
|
+
}) => {
|
|
1029
|
+
const { carouselCopy: i } = x();
|
|
1030
|
+
return /* @__PURE__ */ o(
|
|
1031
|
+
de,
|
|
1032
|
+
{
|
|
1033
|
+
"aria-label": i?.carousel_title,
|
|
1034
|
+
"aria-roledescription": "carousel",
|
|
1035
|
+
role: "group",
|
|
1036
|
+
sx: {
|
|
1037
|
+
boxSizing: "border-box",
|
|
1038
|
+
height: t ? void 0 : "100%",
|
|
1039
|
+
m: "0 auto",
|
|
1040
|
+
width: e ? void 0 : "100%"
|
|
1041
|
+
},
|
|
1042
|
+
children: n
|
|
1043
|
+
}
|
|
1044
|
+
);
|
|
1045
|
+
}, ze = ({
|
|
1046
|
+
ariaLabel: t,
|
|
1047
|
+
elevation: e,
|
|
1048
|
+
heightOverrides: n,
|
|
1049
|
+
onCardClick: i,
|
|
1050
|
+
posthog: a,
|
|
1051
|
+
showIcon: l,
|
|
1052
|
+
variant: r
|
|
1053
|
+
}) => {
|
|
1054
|
+
const { cardsCopy: m } = x(), C = P(), { onEvent: h } = H(), { onPageview: g } = Ge();
|
|
1055
|
+
E.useEffect(() => {
|
|
1056
|
+
g(B.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS);
|
|
1057
|
+
}, []);
|
|
1058
|
+
const d = () => {
|
|
1059
|
+
i && i(), h(W.ON_NO_RELEVANT_INSIGHTS_CLICKED), a?.capture("clicked_insight", {
|
|
1060
|
+
template: "no_relevant_insights"
|
|
1061
|
+
});
|
|
1062
|
+
};
|
|
1063
|
+
return /* @__PURE__ */ o(
|
|
1064
|
+
J,
|
|
1065
|
+
{
|
|
1066
|
+
ariaLabel: t,
|
|
1067
|
+
description: m.no_relevant_insights_card_description,
|
|
1068
|
+
elevation: e,
|
|
1069
|
+
heightOverrides: n,
|
|
1070
|
+
icon: l && /* @__PURE__ */ o(c, { bgColor: s(C.palette.primary.main, 0.15), name: "lightbulb" }),
|
|
1071
|
+
onCardClick: d,
|
|
1072
|
+
onPrimaryAction: d,
|
|
1073
|
+
primaryActionText: m.micro_card_cta,
|
|
1074
|
+
title: m.no_relevant_insights_card_title,
|
|
1075
|
+
variant: r
|
|
1076
|
+
}
|
|
1077
|
+
);
|
|
1078
|
+
}, lo = z(ze), Ue = ({
|
|
1079
|
+
ariaLabel: t,
|
|
1080
|
+
elevation: e,
|
|
1081
|
+
heightOverrides: n,
|
|
1082
|
+
onCardClick: i,
|
|
1083
|
+
showIcon: a,
|
|
1084
|
+
variant: l
|
|
1085
|
+
}) => {
|
|
1086
|
+
const { onPageview: r } = Ge(), { zeroStateCopy: m } = x(), C = P();
|
|
1087
|
+
return E.useEffect(() => {
|
|
1088
|
+
r(B.MICRO_WIDGET_CAROUSEL_ZERO_STATE);
|
|
1089
|
+
}, []), /* @__PURE__ */ o(
|
|
1090
|
+
J,
|
|
1091
|
+
{
|
|
1092
|
+
ariaLabel: t,
|
|
1093
|
+
description: m.carousel_zero_state_description,
|
|
1094
|
+
elevation: e,
|
|
1095
|
+
heightOverrides: n,
|
|
1096
|
+
icon: a && /* @__PURE__ */ o(c, { bgColor: s(C.palette.primary.main, 0.15), name: "lightbulb" }),
|
|
1097
|
+
onCardClick: i,
|
|
1098
|
+
title: m.carousel_zero_state_title,
|
|
1099
|
+
variant: l
|
|
1100
|
+
}
|
|
1101
|
+
);
|
|
1102
|
+
}, _o = z(Ue), Vt = () => /* @__PURE__ */ o(
|
|
1103
|
+
de,
|
|
1104
|
+
{
|
|
1105
|
+
sx: {
|
|
1106
|
+
alignItems: "center",
|
|
1107
|
+
display: "flex",
|
|
1108
|
+
height: "100%",
|
|
1109
|
+
justifyContent: "center",
|
|
1110
|
+
width: "100%"
|
|
1111
|
+
},
|
|
1112
|
+
children: /* @__PURE__ */ o(tt, {})
|
|
1113
|
+
}
|
|
1114
|
+
), We = {
|
|
1115
|
+
featureVersion: "spendVsIncomeTrends"
|
|
1116
|
+
}, D = new Ct(), Gt = ({
|
|
1117
|
+
allowSingleCardPeeking: t = !0,
|
|
1118
|
+
areBeatsLoading: e = !1,
|
|
1119
|
+
beats: n = [],
|
|
1120
|
+
// This also determines the length of the carousel controls (beat.length + 1)
|
|
1121
|
+
cardStyle: i = "elevation 1",
|
|
1122
|
+
endpoint: a = "/",
|
|
1123
|
+
headerSx: l,
|
|
1124
|
+
heightOverrides: r,
|
|
1125
|
+
logOutUser: m = () => {
|
|
1126
|
+
},
|
|
1127
|
+
onCardClick: C = () => {
|
|
1128
|
+
},
|
|
1129
|
+
onEvent: h = () => {
|
|
1130
|
+
},
|
|
1131
|
+
onPageview: g = () => {
|
|
1132
|
+
},
|
|
1133
|
+
posthog: d,
|
|
1134
|
+
showCarouselControls: _,
|
|
1135
|
+
showHeader: p,
|
|
1136
|
+
showIcon: I,
|
|
1137
|
+
showWithMargin: y = !0,
|
|
1138
|
+
token: S = "",
|
|
1139
|
+
userHasFullInsightFeedBeats: w,
|
|
1140
|
+
visibleCardsCount: T = 1,
|
|
1141
|
+
widthOverrides: f
|
|
1142
|
+
}) => {
|
|
1143
|
+
const R = (() => {
|
|
1144
|
+
if (i === "border") return "outlined";
|
|
1145
|
+
if (i === "elevation 1") return "elevation";
|
|
1146
|
+
if (i !== "flat")
|
|
1147
|
+
return "elevation";
|
|
1148
|
+
})(), u = i === "flat" ? 0 : 1, [$, M] = ce("STANDARD"), [V, te] = ce(!1), [j, Y] = ce(!1), oe = nt([h], D), ne = it([g], D);
|
|
1149
|
+
rt({
|
|
1150
|
+
widgetName: "InsightsMicroWidget",
|
|
1151
|
+
isLoaded: V
|
|
1152
|
+
}), E.useEffect(() => {
|
|
1153
|
+
!D.isInitialized && !j && (D.initialize(a, S, m).catch(() => Y(!1)), Y(!0));
|
|
1154
|
+
}, [a, S, m, D.isInitialized, j]), E.useEffect(() => {
|
|
1155
|
+
const A = window.innerHeight;
|
|
1156
|
+
A < 180 ? M("STANDARD") : A >= 180 && A < 200 ? M("LARGE") : A >= 200 && A < 248 ? M("XLARGE") : A >= 248 && M("XXLARGE");
|
|
1157
|
+
}, [window.innerHeight]), E.useEffect(() => {
|
|
1158
|
+
te(!e && D.isInitialized);
|
|
1159
|
+
}, [e, D.isInitialized]);
|
|
1160
|
+
const X = {
|
|
1161
|
+
heightOverrides: r,
|
|
1162
|
+
onCardClick: C,
|
|
1163
|
+
posthog: d,
|
|
1164
|
+
showIcon: I,
|
|
1165
|
+
showWithMargin: y,
|
|
1166
|
+
widthOverrides: f
|
|
1167
|
+
}, Z = {
|
|
1168
|
+
carouselSize: $,
|
|
1169
|
+
elevation: u,
|
|
1170
|
+
variant: R,
|
|
1171
|
+
heightOverrides: r,
|
|
1172
|
+
onCardClick: C,
|
|
1173
|
+
posthog: d,
|
|
1174
|
+
showIcon: I
|
|
1175
|
+
};
|
|
1176
|
+
return /* @__PURE__ */ o(ht, { onEvent: oe, onPageview: ne, store: D, children: /* @__PURE__ */ N(Pt, { heightOverrides: r, widthOverrides: f, children: [
|
|
1177
|
+
!V && /* @__PURE__ */ o(Vt, {}),
|
|
1178
|
+
V && p && /* @__PURE__ */ o(
|
|
1179
|
+
Bt,
|
|
1180
|
+
{
|
|
1181
|
+
analyticsMetadata: We,
|
|
1182
|
+
headerSx: l,
|
|
1183
|
+
onCardClick: C,
|
|
1184
|
+
posthog: d,
|
|
1185
|
+
widthOverrides: f
|
|
1186
|
+
}
|
|
1187
|
+
),
|
|
1188
|
+
V && !!n.length && /* @__PURE__ */ o(
|
|
1189
|
+
xt,
|
|
1190
|
+
{
|
|
1191
|
+
allowSingleCardPeeking: t,
|
|
1192
|
+
analyticsMetadata: We,
|
|
1193
|
+
beats: n,
|
|
1194
|
+
elevation: u,
|
|
1195
|
+
showCarouselControls: _,
|
|
1196
|
+
variant: R,
|
|
1197
|
+
visibleCardsCount: T,
|
|
1198
|
+
...X
|
|
1199
|
+
}
|
|
1200
|
+
),
|
|
1201
|
+
V && !n.length && /* @__PURE__ */ o(
|
|
1202
|
+
k,
|
|
1203
|
+
{
|
|
1204
|
+
sx: {
|
|
1205
|
+
alignItems: "center",
|
|
1206
|
+
height: r,
|
|
1207
|
+
width: f || "100%"
|
|
1208
|
+
},
|
|
1209
|
+
children: /* @__PURE__ */ o(
|
|
1210
|
+
k,
|
|
1211
|
+
{
|
|
1212
|
+
sx: {
|
|
1213
|
+
height: `calc(${wt[$]}px - 44px)`,
|
|
1214
|
+
width: y ? `calc(${f}px - 32px)` : "100%"
|
|
1215
|
+
},
|
|
1216
|
+
children: w ? /* @__PURE__ */ o(ze, { ...Z }) : /* @__PURE__ */ o(Ue, { ...Z })
|
|
1217
|
+
}
|
|
1218
|
+
)
|
|
1219
|
+
}
|
|
1220
|
+
)
|
|
1221
|
+
] }) });
|
|
1222
|
+
}, po = z(Gt), kt = ({
|
|
1223
|
+
ariaLabel: t,
|
|
1224
|
+
elevation: e,
|
|
1225
|
+
heightOverrides: n,
|
|
1226
|
+
isActiveCard: i,
|
|
1227
|
+
onCardClick: a,
|
|
1228
|
+
posthog: l,
|
|
1229
|
+
widthOverrides: r,
|
|
1230
|
+
showIcon: m,
|
|
1231
|
+
variant: C
|
|
1232
|
+
}) => {
|
|
1233
|
+
const h = P(), { ref: g, inView: d } = Me({
|
|
1234
|
+
threshold: ke
|
|
1235
|
+
}), { cardsCopy: _ } = x(), { onEvent: p } = H();
|
|
1236
|
+
le(() => {
|
|
1237
|
+
d && (p(De.ON_VIEW_MORE_VIEWED), l?.capture("viewed_insight", {
|
|
1238
|
+
template: "view_more_card"
|
|
1239
|
+
}));
|
|
1240
|
+
}, [d]);
|
|
1241
|
+
const I = () => {
|
|
1242
|
+
a && a(), p(W.ON_VIEW_MORE_CLICKED), l?.capture("clicked_insight", {
|
|
1243
|
+
template: "view_more_card"
|
|
1244
|
+
});
|
|
1245
|
+
};
|
|
1246
|
+
return /* @__PURE__ */ o(
|
|
1247
|
+
J,
|
|
1248
|
+
{
|
|
1249
|
+
"aria-roledescription": "slide",
|
|
1250
|
+
ariaLabel: t,
|
|
1251
|
+
description: _?.view_more_card_description,
|
|
1252
|
+
elevation: e,
|
|
1253
|
+
heightOverrides: n,
|
|
1254
|
+
icon: m && /* @__PURE__ */ o(c, { bgColor: s(h.palette.primary.main, 0.15), name: "show_chart" }),
|
|
1255
|
+
isActiveCard: i,
|
|
1256
|
+
onCardClick: I,
|
|
1257
|
+
onPrimaryAction: I,
|
|
1258
|
+
primaryActionText: _?.micro_card_cta,
|
|
1259
|
+
ref: g,
|
|
1260
|
+
title: _?.view_more_card_title,
|
|
1261
|
+
variant: C,
|
|
1262
|
+
widthOverrides: r
|
|
1263
|
+
}
|
|
1264
|
+
);
|
|
1265
|
+
}, zt = z(kt);
|
|
1266
|
+
export {
|
|
1267
|
+
Ct as A,
|
|
1268
|
+
Bt as C,
|
|
1269
|
+
Mt as I,
|
|
1270
|
+
xt as M,
|
|
1271
|
+
lo as N,
|
|
1272
|
+
We as T,
|
|
1273
|
+
zt as V,
|
|
1274
|
+
_o as Z,
|
|
1275
|
+
po as a,
|
|
1276
|
+
ht as b,
|
|
1277
|
+
J as c,
|
|
1278
|
+
ft as d
|
|
1279
|
+
};
|
|
1280
|
+
//# sourceMappingURL=ViewMoreMicroCard-fnwE0hqd.mjs.map
|