@mx-cartographer/experiences 9.7.139 → 9.7.140

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 CHANGED
@@ -1,3 +1,7 @@
1
+ ## [9.7.140] - 11-12-2026
2
+
3
+ - **FIXED** - The micro card draws its status icon instead of an empty tile when its row logo is unusable, and its unanswered icon when the reviewed one is; the merchant quiz keeps only a row's checked fields and the Not Interested dialog only a text account name, so malformed data cannot break either (WEC-2259)
4
+
1
5
  ## [9.7.139] - 11-11-2026
2
6
 
3
7
  - **FIXED** - Bill Amount Not Standard: the embedded card is 98px, matching Figma, instead of 109px; its chart is a fixed 75x54 (was 85x54, `TinyBarChart`'s default width); the Full/Embedded/Mini chart color and the drilldown tip's close/dismiss icon color (`text.primary`, now `TipSection`'s shared default for the dismiss icon only — the action/chevron icon is unchanged, pending its own Figma confirmation) (WEC-2291)
@@ -1,20 +1,20 @@
1
1
  import { buildDynamicCopy as f } from "../../core/utils/Localization.es.js";
2
2
  import { useGlobalCopyStore as _, useInsightsV2Store as g } from "../../common/context/hooks.es.js";
3
- import { slot as y } from "../../core/types/Insights.es.js";
4
- import { useBeatActions as h } from "../beatActions.es.js";
5
- import { ANALYTICS_EVENTS_CONFIG as S } from "../analytics/analyticsEventsConfig.es.js";
6
- import { useAnalyticsEvent as A } from "../analytics/useAnalyticsEvent.es.js";
3
+ import { useBeatActions as y } from "../beatActions.es.js";
4
+ import { asText as h, slotOrFlat as S } from "../blocks/slotReaders.es.js";
5
+ import { ANALYTICS_EVENTS_CONFIG as A } from "../analytics/analyticsEventsConfig.es.js";
6
+ import { useAnalyticsEvent as x } from "../analytics/useAnalyticsEvent.es.js";
7
7
  import k from "../components/FeedbackModal.es.js";
8
- import { useRef as x } from "react";
9
- import { observer as F } from "mobx-react-lite";
10
- import { jsx as n } from "react/jsx-runtime";
11
- import T from "@mui/material/Box";
12
- var V = F(function({ beat: c }) {
13
- const { closeActionDrawer: r } = g(), { onDismissInsight: o, onFeedbackTextFocus: m, onSubmitFeedback: l } = h(), u = _(), d = A(), s = x(!1), t = c.insights_payload, e = u.insights_feed?.feedback_modal;
8
+ import { useRef as F } from "react";
9
+ import { observer as T } from "mobx-react-lite";
10
+ import { jsx as r } from "react/jsx-runtime";
11
+ import C from "@mui/material/Box";
12
+ var R = T(function({ beat: n }) {
13
+ const { closeActionDrawer: c } = g(), { onDismissInsight: o, onFeedbackTextFocus: m, onSubmitFeedback: l } = y(), u = _(), p = x(), s = F(!1), t = n.insights_payload, e = u.insights_feed?.feedback_modal;
14
14
  if (!t || !e) return null;
15
- const a = y(t.instance_slot?.data, "account_name") ?? t.instance_slot?.account_name ?? "", p = {
15
+ const a = h(S(t.instance_slot, "account_name")) ?? "", d = {
16
16
  title: e.title,
17
- description: f(e.description, a ? /* @__PURE__ */ n(T, {
17
+ description: f(e.description, a ? /* @__PURE__ */ r(C, {
18
18
  component: "span",
19
19
  sx: { fontWeight: 600 },
20
20
  children: a
@@ -29,16 +29,16 @@ var V = F(function({ beat: c }) {
29
29
  tryAgainText: e.try_again,
30
30
  toastCloseAriaLabel: e.toast_close_aria
31
31
  };
32
- return /* @__PURE__ */ n(k, {
33
- copy: p,
32
+ return /* @__PURE__ */ r(k, {
33
+ copy: d,
34
34
  isOpen: !0,
35
- onClose: () => r(),
35
+ onClose: () => c(),
36
36
  onSubmit: async (i, b) => {
37
37
  s.current || (s.current = !0, o?.({
38
38
  beatGuid: t.guid,
39
39
  type: "always"
40
- }), d({
41
- ...S.BEAT_DISMISSED,
40
+ }), p({
41
+ ...A.BEAT_DISMISSED,
42
42
  value: i
43
43
  })), await l?.({
44
44
  beatGuid: t.guid,
@@ -52,7 +52,7 @@ var V = F(function({ beat: c }) {
52
52
  });
53
53
  });
54
54
  export {
55
- V as FeedbackModalActionBlock
55
+ R as FeedbackModalActionBlock
56
56
  };
57
57
 
58
58
  //# sourceMappingURL=FeedbackModalActionBlock.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FeedbackModalActionBlock.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/FeedbackModalActionBlock.tsx"],"sourcesContent":["import { useRef, type ReactNode } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\n\nimport { useGlobalCopyStore, useInsightsV2Store } from '../../common'\nimport { slot } from '../../core'\nimport { buildDynamicCopy } from '../../core/utils/Localization'\nimport FeedbackModal, { type FeedbackModalContent } from '../components/FeedbackModal'\nimport { ANALYTICS_EVENTS_CONFIG, useAnalyticsEvent } from '../analytics'\nimport { useBeatActions } from '../beatActions'\nimport type { ActionBlockProps } from '../mappings/blocks'\n\n/**\n * `feedback_modal_block` — a CTA drilldown registered like any other drawer\n * block; its content is a MODAL (the dialog portals over the drawer).\n *\n * Flow: the CTA (e.g. Set Up Direct Deposit's \"Not Interested\") opens the\n * \"Can you tell us why?\" survey (Figma `1941:192803`). Submit dismisses the insight\n * (`onDismissInsight`), then forwards the selection via `onSubmitFeedback` (source\n * `hide`). A host that can dismiss shows its own confirmation; otherwise the dialog\n * swaps for the success snackbar (Figma `1941:167636`). Closing ends the drawer session.\n *\n * Copy comes from `insights_feed.feedback_modal` in GlobalCopy; the\n * description interpolates the beat's account name (`_1{account_name}`).\n */\nexport const FeedbackModalActionBlock = observer(function FeedbackModalActionBlock({\n beat,\n}: ActionBlockProps) {\n const { closeActionDrawer } = useInsightsV2Store()\n const { onDismissInsight, onFeedbackTextFocus, onSubmitFeedback } = useBeatActions()\n const copyStore = useGlobalCopyStore()\n const fireAnalyticsEvent = useAnalyticsEvent()\n // So a retry does not dismiss twice.\n const hasDismissed = useRef(false)\n\n const insights_payload = beat.insights_payload\n const modalCopy = copyStore.insights_feed?.feedback_modal\n\n if (!insights_payload || !modalCopy) return null\n\n // `data` first, the flat name is the earlier shape.\n const accountName =\n slot<string>(insights_payload.instance_slot?.data, 'account_name') ??\n insights_payload.instance_slot?.account_name ??\n ''\n\n const copy: FeedbackModalContent = {\n title: modalCopy.title,\n // Figma 1941:192803: the account name is semibold within the regular sentence.\n description: buildDynamicCopy(\n modalCopy.description,\n accountName ? (\n <Box component=\"span\" sx={{ fontWeight: 600 }}>\n {accountName}\n </Box>\n ) : (\n ''\n ),\n ) as ReactNode,\n options: Object.values(modalCopy.options ?? {}),\n submitText: modalCopy.submit,\n cancelText: modalCopy.no_thanks,\n closeAriaLabel: modalCopy.close_aria,\n characterLimitLabel: modalCopy.character_limit,\n successMessage: modalCopy.success_message,\n errorMessage: modalCopy.error_message,\n tryAgainText: modalCopy.try_again,\n toastCloseAriaLabel: modalCopy.toast_close_aria,\n }\n\n // As legacy: dismiss first (once), then send the survey. A failed send keeps the beat dismissed and\n // Try Again re-sends only the feedback. Awaited so a rejection drives the error snackbar.\n const handleSubmit = async (option: string, detail?: string) => {\n if (!hasDismissed.current) {\n hasDismissed.current = true\n onDismissInsight?.({ beatGuid: insights_payload.guid, type: 'always' })\n // The reason is the event's value, as legacy.\n fireAnalyticsEvent({ ...ANALYTICS_EVENTS_CONFIG.BEAT_DISMISSED, value: option })\n }\n\n await onSubmitFeedback?.({\n beatGuid: insights_payload.guid,\n source: 'not_interested',\n option,\n detail,\n })\n }\n\n return (\n <FeedbackModal\n copy={copy}\n isOpen={true}\n onClose={() => closeActionDrawer()}\n onSubmit={handleSubmit}\n onTextInputFocus={onFeedbackTextFocus}\n // A host that dismisses shows its own confirmation; the micro widget keeps the snackbar.\n showSuccessMessage={!onDismissInsight}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;AA2BA,IAAa,IAA2B,EAAS,SAAkC,EACjF,MAAA,EAAA,GACmB;AACnB,QAAM,EAAE,mBAAA,EAAA,IAAsB,EAAmB,GAC3C,EAAE,kBAAA,GAAkB,qBAAA,GAAqB,kBAAA,EAAA,IAAqB,EAAe,GAC7E,IAAY,EAAmB,GAC/B,IAAqB,EAAkB,GAEvC,IAAe,EAAO,EAAK,GAE3B,IAAmB,EAAK,kBACxB,IAAY,EAAU,eAAe;AAE3C,MAAI,CAAC,KAAoB,CAAC,EAAW,QAAO;AAG5C,QAAM,IACJ,EAAa,EAAiB,eAAe,MAAM,cAAc,KACjE,EAAiB,eAAe,gBAChC,IAEI,IAA6B;AAAA,IACjC,OAAO,EAAU;AAAA,IAEjB,aAAa,EACX,EAAU,aACV,IACE,gBAAA,EAAC,GAAD;AAAA,MAAK,WAAU;AAAA,MAAO,IAAI,EAAE,YAAY,IAAI;AAAA,MACzC,UAAA;AAAA,IACE,CAAA,IAEL,EAEJ;AAAA,IACA,SAAS,OAAO,OAAO,EAAU,WAAW,CAAC,CAAC;AAAA,IAC9C,YAAY,EAAU;AAAA,IACtB,YAAY,EAAU;AAAA,IACtB,gBAAgB,EAAU;AAAA,IAC1B,qBAAqB,EAAU;AAAA,IAC/B,gBAAgB,EAAU;AAAA,IAC1B,cAAc,EAAU;AAAA,IACxB,cAAc,EAAU;AAAA,IACxB,qBAAqB,EAAU;AAAA,EACjC;AAoBA,SACE,gBAAA,EAAC,GAAD;AAAA,IACQ,MAAA;AAAA,IACN,QAAQ;AAAA,IACR,SAAA,MAAe,EAAkB;AAAA,IACjC,UArBiB,OAAO,GAAgB,MAAoB;AAC9D,MAAK,EAAa,YAChB,EAAa,UAAU,IACvB,IAAmB;AAAA,QAAE,UAAU,EAAiB;AAAA,QAAM,MAAM;AAAA,MAAS,CAAC,GAEtE,EAAmB;AAAA,QAAE,GAAG,EAAwB;AAAA,QAAgB,OAAO;AAAA,MAAO,CAAC,IAGjF,MAAM,IAAmB;AAAA,QACvB,UAAU,EAAiB;AAAA,QAC3B,QAAQ;AAAA,QACR,QAAA;AAAA,QACA,QAAA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IAQI,kBAAkB;AAAA,IAElB,oBAAoB,CAAC;AAAA,EACtB,CAAA;AAEL,CAAC"}
1
+ {"version":3,"file":"FeedbackModalActionBlock.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/FeedbackModalActionBlock.tsx"],"sourcesContent":["import { useRef, type ReactNode } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\n\nimport { useGlobalCopyStore, useInsightsV2Store } from '../../common'\nimport { buildDynamicCopy } from '../../core/utils/Localization'\nimport FeedbackModal, { type FeedbackModalContent } from '../components/FeedbackModal'\nimport { ANALYTICS_EVENTS_CONFIG, useAnalyticsEvent } from '../analytics'\nimport { useBeatActions } from '../beatActions'\nimport { asText, slotOrFlat } from '../blocks/slotReaders'\nimport type { ActionBlockProps } from '../mappings/blocks'\n\n/**\n * `feedback_modal_block` — a CTA drilldown registered like any other drawer\n * block; its content is a MODAL (the dialog portals over the drawer).\n *\n * Flow: the CTA (e.g. Set Up Direct Deposit's \"Not Interested\") opens the\n * \"Can you tell us why?\" survey (Figma `1941:192803`). Submit dismisses the insight\n * (`onDismissInsight`), then forwards the selection via `onSubmitFeedback` (source\n * `hide`). A host that can dismiss shows its own confirmation; otherwise the dialog\n * swaps for the success snackbar (Figma `1941:167636`). Closing ends the drawer session.\n *\n * Copy comes from `insights_feed.feedback_modal` in GlobalCopy; the\n * description interpolates the beat's account name (`_1{account_name}`).\n */\nexport const FeedbackModalActionBlock = observer(function FeedbackModalActionBlock({\n beat,\n}: ActionBlockProps) {\n const { closeActionDrawer } = useInsightsV2Store()\n const { onDismissInsight, onFeedbackTextFocus, onSubmitFeedback } = useBeatActions()\n const copyStore = useGlobalCopyStore()\n const fireAnalyticsEvent = useAnalyticsEvent()\n // So a retry does not dismiss twice.\n const hasDismissed = useRef(false)\n\n const insights_payload = beat.insights_payload\n const modalCopy = copyStore.insights_feed?.feedback_modal\n\n if (!insights_payload || !modalCopy) return null\n\n const accountName = asText(slotOrFlat(insights_payload.instance_slot, 'account_name')) ?? ''\n\n const copy: FeedbackModalContent = {\n title: modalCopy.title,\n // Figma 1941:192803: the account name is semibold within the regular sentence.\n description: buildDynamicCopy(\n modalCopy.description,\n accountName ? (\n <Box component=\"span\" sx={{ fontWeight: 600 }}>\n {accountName}\n </Box>\n ) : (\n ''\n ),\n ) as ReactNode,\n options: Object.values(modalCopy.options ?? {}),\n submitText: modalCopy.submit,\n cancelText: modalCopy.no_thanks,\n closeAriaLabel: modalCopy.close_aria,\n characterLimitLabel: modalCopy.character_limit,\n successMessage: modalCopy.success_message,\n errorMessage: modalCopy.error_message,\n tryAgainText: modalCopy.try_again,\n toastCloseAriaLabel: modalCopy.toast_close_aria,\n }\n\n // As legacy: dismiss first (once), then send the survey. A failed send keeps the beat dismissed and\n // Try Again re-sends only the feedback. Awaited so a rejection drives the error snackbar.\n const handleSubmit = async (option: string, detail?: string) => {\n if (!hasDismissed.current) {\n hasDismissed.current = true\n onDismissInsight?.({ beatGuid: insights_payload.guid, type: 'always' })\n // The reason is the event's value, as legacy.\n fireAnalyticsEvent({ ...ANALYTICS_EVENTS_CONFIG.BEAT_DISMISSED, value: option })\n }\n\n await onSubmitFeedback?.({\n beatGuid: insights_payload.guid,\n source: 'not_interested',\n option,\n detail,\n })\n }\n\n return (\n <FeedbackModal\n copy={copy}\n isOpen={true}\n onClose={() => closeActionDrawer()}\n onSubmit={handleSubmit}\n onTextInputFocus={onFeedbackTextFocus}\n // A host that dismisses shows its own confirmation; the micro widget keeps the snackbar.\n showSuccessMessage={!onDismissInsight}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;AA2BA,IAAa,IAA2B,EAAS,SAAkC,EACjF,MAAA,EAAA,GACmB;AACnB,QAAM,EAAE,mBAAA,EAAA,IAAsB,EAAmB,GAC3C,EAAE,kBAAA,GAAkB,qBAAA,GAAqB,kBAAA,EAAA,IAAqB,EAAe,GAC7E,IAAY,EAAmB,GAC/B,IAAqB,EAAkB,GAEvC,IAAe,EAAO,EAAK,GAE3B,IAAmB,EAAK,kBACxB,IAAY,EAAU,eAAe;AAE3C,MAAI,CAAC,KAAoB,CAAC,EAAW,QAAO;AAE5C,QAAM,IAAc,EAAO,EAAW,EAAiB,eAAe,cAAc,CAAC,KAAK,IAEpF,IAA6B;AAAA,IACjC,OAAO,EAAU;AAAA,IAEjB,aAAa,EACX,EAAU,aACV,IACE,gBAAA,EAAC,GAAD;AAAA,MAAK,WAAU;AAAA,MAAO,IAAI,EAAE,YAAY,IAAI;AAAA,MACzC,UAAA;AAAA,IACE,CAAA,IAEL,EAEJ;AAAA,IACA,SAAS,OAAO,OAAO,EAAU,WAAW,CAAC,CAAC;AAAA,IAC9C,YAAY,EAAU;AAAA,IACtB,YAAY,EAAU;AAAA,IACtB,gBAAgB,EAAU;AAAA,IAC1B,qBAAqB,EAAU;AAAA,IAC/B,gBAAgB,EAAU;AAAA,IAC1B,cAAc,EAAU;AAAA,IACxB,cAAc,EAAU;AAAA,IACxB,qBAAqB,EAAU;AAAA,EACjC;AAoBA,SACE,gBAAA,EAAC,GAAD;AAAA,IACQ,MAAA;AAAA,IACN,QAAQ;AAAA,IACR,SAAA,MAAe,EAAkB;AAAA,IACjC,UArBiB,OAAO,GAAgB,MAAoB;AAC9D,MAAK,EAAa,YAChB,EAAa,UAAU,IACvB,IAAmB;AAAA,QAAE,UAAU,EAAiB;AAAA,QAAM,MAAM;AAAA,MAAS,CAAC,GAEtE,EAAmB;AAAA,QAAE,GAAG,EAAwB;AAAA,QAAgB,OAAO;AAAA,MAAO,CAAC,IAGjF,MAAM,IAAmB;AAAA,QACvB,UAAU,EAAiB;AAAA,QAC3B,QAAQ;AAAA,QACR,QAAA;AAAA,QACA,QAAA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IAQI,kBAAkB;AAAA,IAElB,oBAAoB,CAAC;AAAA,EACtB,CAAA;AAEL,CAAC"}
@@ -1,44 +1,50 @@
1
- import { CategoryGuids as t } from "../../../../core/constants/Category.es.js";
2
- import { slot as u } from "../../../../core/types/Insights.es.js";
3
- import { buildDataSeries as l } from "../../ChartBlocks/BarchartBlock/utils.es.js";
4
- import { asNumber as s, asText as d } from "../../slotReaders.es.js";
5
- var f = {
1
+ import { CategoryGuids as u } from "../../../../core/constants/Category.es.js";
2
+ import { slot as l } from "../../../../core/types/Insights.es.js";
3
+ import { buildDataSeries as g } from "../../ChartBlocks/BarchartBlock/utils.es.js";
4
+ import { asLogoRef as d, asNonEmptyText as i, asNumber as s, asText as c } from "../../slotReaders.es.js";
5
+ var E = {
6
6
  PICK: "quiz_pick",
7
7
  CHECKED: "quiz_checked",
8
8
  REVEALED: "quiz_revealed"
9
- }, E = { RESULTS: "results" }, g = (o) => {
10
- const { label: r, count: i } = o ?? {};
11
- return d(r) !== void 0 && s(i) !== void 0;
12
- }, c = (o, r) => o.filter((i) => r.guid ? i.merchant_guid === r.guid : !i.merchant_guid && i.description === r.label), y = (o, r = []) => {
13
- const i = c(r, o)[0], a = o.logo?.fallback_guid || o.category_guid || i?.top_level_category_guid || i?.category_guid || t.UNCATEGORIZED, e = o.logo?.guid || o.guid;
9
+ }, T = { RESULTS: "results" }, n = (o) => {
10
+ const { label: r, count: a } = o ?? {};
11
+ return c(r) !== void 0 && s(a) !== void 0;
12
+ }, _ = (o, r) => o.filter((a) => r.guid ? a.merchant_guid === r.guid : !a.merchant_guid && a.description === r.label), m = (o, r = []) => {
13
+ const a = _(r, o)[0], e = o.logo?.fallback_guid || o.category_guid || a?.top_level_category_guid || a?.category_guid || u.UNCATEGORIZED, t = o.logo?.guid || o.guid;
14
14
  return {
15
15
  ...o.logo,
16
16
  alt: o.logo?.alt ?? o.label,
17
- fallback_guid: a,
18
- guid: e || a
17
+ fallback_guid: e,
18
+ guid: t || e
19
19
  };
20
- }, n = (o) => o.guid || o.label, T = (o) => {
21
- const r = u(o, "data_series");
22
- return (Array.isArray(r) ? r : l(r)).filter(g);
23
- }, C = (o) => {
24
- const r = [...o].sort((i, a) => a.count - i.count || i.label.localeCompare(a.label));
25
- return r.map((i) => ({
26
- ...i,
27
- rank: r.findIndex(({ count: a }) => a === i.count) + 1
20
+ }, p = (o) => o.guid || o.label, C = (o) => {
21
+ const r = l(o, "data_series");
22
+ return (Array.isArray(r) ? r : g(r)).filter(n).map((a) => ({
23
+ label: a.label,
24
+ count: a.count,
25
+ guid: i(a.guid) ?? null,
26
+ category_guid: i(a.category_guid),
27
+ logo: d(a.logo)
28
28
  }));
29
- }, k = (o, r) => {
30
- const i = Math.max(...o.map(({ count: a }) => a));
31
- return o.some((a) => n(a) === r && a.count === i);
29
+ }, k = (o) => {
30
+ const r = [...o].sort((a, e) => e.count - a.count || a.label.localeCompare(e.label));
31
+ return r.map((a) => ({
32
+ ...a,
33
+ rank: r.findIndex(({ count: e }) => e === a.count) + 1
34
+ }));
35
+ }, z = (o, r) => {
36
+ const a = Math.max(...o.map(({ count: e }) => e));
37
+ return o.some((e) => p(e) === r && e.count === a);
32
38
  };
33
39
  export {
34
- f as QUIZ_CONTEXT,
35
- E as QUIZ_VARIANTS,
36
- k as isTopMerchant,
37
- n as merchantKey,
38
- c as merchantTransactions,
39
- y as quizMerchantLogo,
40
- C as rankQuizMerchants,
41
- T as readQuizMerchants
40
+ E as QUIZ_CONTEXT,
41
+ T as QUIZ_VARIANTS,
42
+ z as isTopMerchant,
43
+ p as merchantKey,
44
+ _ as merchantTransactions,
45
+ m as quizMerchantLogo,
46
+ k as rankQuizMerchants,
47
+ C as readQuizMerchants
42
48
  };
43
49
 
44
50
  //# sourceMappingURL=quiz.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"quiz.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/QuizBlock/quiz.ts"],"sourcesContent":["import {\n slot,\n type DataSeries,\n type InstanceSlotData,\n type LogoRef,\n type Transaction,\n} from '../../../../core'\nimport { CategoryGuids } from '../../../../core/constants/Category'\nimport { buildDataSeries } from '../../ChartBlocks/BarchartBlock/utils'\nimport { asNumber, asText } from '../../slotReaders'\n\n/** One merchant in the month, a row of the backend's `data_series`. */\nexport interface QuizMerchant {\n /** `null` for spending with no merchant; the drawer then matches transactions by `label`. */\n guid?: string | null\n label: string\n count: number\n /** The merchant's category: its logo's fallback, and the logo itself when it has no guid. */\n category_guid?: string | null\n logo?: LogoRef\n}\n\nexport interface RankedQuizMerchant extends QuizMerchant {\n rank: number\n}\n\n/** What a results row hands its drawer through `actionDrawer.context`. */\nexport interface QuizDrawerContext {\n quiz_merchant?: RankedQuizMerchant\n}\n\n/** The beat-context keys the block and the quiz CTA steps share. */\nexport const QUIZ_CONTEXT = {\n PICK: 'quiz_pick',\n CHECKED: 'quiz_checked',\n REVEALED: 'quiz_revealed',\n} as const\n\nexport const QUIZ_VARIANTS = { RESULTS: 'results' } as const\n\nconst isMerchant = (row: unknown): row is QuizMerchant => {\n const { label, count } = (row ?? {}) as Record<string, unknown>\n return asText(label) !== undefined && asNumber(count) !== undefined\n}\n\n/** The merchant's transactions: by merchant guid, or by description when it has none. */\nexport const merchantTransactions = (transactions: Transaction[], merchant: QuizMerchant) =>\n transactions.filter((transaction) =>\n merchant.guid\n ? transaction.merchant_guid === merchant.guid\n : !transaction.merchant_guid && transaction.description === merchant.label,\n )\n\n/** The merchant logo over its category fallback, or the category icon when it has no merchant guid. */\nexport const quizMerchantLogo = (\n merchant: QuizMerchant,\n transactions: Transaction[] = [],\n): LogoRef => {\n const transaction = merchantTransactions(transactions, merchant)[0]\n const category =\n merchant.logo?.fallback_guid ||\n merchant.category_guid ||\n transaction?.top_level_category_guid ||\n transaction?.category_guid ||\n CategoryGuids.UNCATEGORIZED\n const guid = merchant.logo?.guid || merchant.guid\n\n return {\n ...merchant.logo,\n alt: merchant.logo?.alt ?? merchant.label,\n fallback_guid: category,\n guid: guid || category,\n }\n}\n\n/** A merchant's id in the quiz: its guid, else its label. */\nexport const merchantKey = (merchant: QuizMerchant) => merchant.guid || merchant.label\n\n/** `data_series` rows: tupac's columnar `{ names, data }`, or an array of row objects. */\nexport const readQuizMerchants = (data: InstanceSlotData | undefined): QuizMerchant[] => {\n const series = slot<unknown[] | DataSeries>(data, 'data_series')\n const rows = Array.isArray(series) ? series : buildDataSeries(series)\n return rows.filter(isMerchant)\n}\n\n/** Most transactions first, ties by name; tied counts share a rank (1, 1, 3). */\nexport const rankQuizMerchants = (merchants: QuizMerchant[]): RankedQuizMerchant[] => {\n const sorted = [...merchants].sort((a, b) => b.count - a.count || a.label.localeCompare(b.label))\n return sorted.map((merchant) => ({\n ...merchant,\n rank: sorted.findIndex(({ count }) => count === merchant.count) + 1,\n }))\n}\n\n/** Any merchant tied for the most transactions is a right answer. */\nexport const isTopMerchant = (merchants: QuizMerchant[], key: string) => {\n const top = Math.max(...merchants.map(({ count }) => count))\n return merchants.some((merchant) => merchantKey(merchant) === key && merchant.count === top)\n}\n"],"mappings":";;;;AAgCA,IAAa,IAAe;AAAA,EAC1B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AACZ,GAEa,IAAgB,EAAE,SAAS,UAAU,GAE5C,IAAA,CAAc,MAAsC;AACxD,QAAM,EAAE,OAAA,GAAO,OAAA,EAAA,IAAW,KAAO,CAAC;AAClC,SAAO,EAAO,CAAK,MAAM,UAAa,EAAS,CAAK,MAAM;AAC5D,GAGa,IAAA,CAAwB,GAA6B,MAChE,EAAa,OAAA,CAAQ,MACnB,EAAS,OACL,EAAY,kBAAkB,EAAS,OACvC,CAAC,EAAY,iBAAiB,EAAY,gBAAgB,EAAS,KACzE,GAGW,IAAA,CACX,GACA,IAA8B,CAAC,MACnB;AACZ,QAAM,IAAc,EAAqB,GAAc,CAAQ,EAAE,CAAA,GAC3D,IACJ,EAAS,MAAM,iBACf,EAAS,iBACT,GAAa,2BACb,GAAa,iBACb,EAAc,eACV,IAAO,EAAS,MAAM,QAAQ,EAAS;AAE7C,SAAO;AAAA,IACL,GAAG,EAAS;AAAA,IACZ,KAAK,EAAS,MAAM,OAAO,EAAS;AAAA,IACpC,eAAe;AAAA,IACf,MAAM,KAAQ;AAAA,EAChB;AACF,GAGa,IAAA,CAAe,MAA2B,EAAS,QAAQ,EAAS,OAGpE,IAAA,CAAqB,MAAuD;AACvF,QAAM,IAAS,EAA6B,GAAM,aAAa;AAE/D,UADa,MAAM,QAAQ,CAAM,IAAI,IAAS,EAAgB,CAAM,GACxD,OAAO,CAAU;AAC/B,GAGa,IAAA,CAAqB,MAAoD;AACpF,QAAM,IAAS,CAAC,GAAG,CAAS,EAAE,KAAA,CAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,EAAE,KAAK,CAAC;AAChG,SAAO,EAAO,IAAA,CAAK,OAAc;AAAA,IAC/B,GAAG;AAAA,IACH,MAAM,EAAO,UAAA,CAAW,EAAE,OAAA,EAAA,MAAY,MAAU,EAAS,KAAK,IAAI;AAAA,EACpE,EAAE;AACJ,GAGa,IAAA,CAAiB,GAA2B,MAAgB;AACvE,QAAM,IAAM,KAAK,IAAI,GAAG,EAAU,IAAA,CAAK,EAAE,OAAA,EAAA,MAAY,CAAK,CAAC;AAC3D,SAAO,EAAU,KAAA,CAAM,MAAa,EAAY,CAAQ,MAAM,KAAO,EAAS,UAAU,CAAG;AAC7F"}
1
+ {"version":3,"file":"quiz.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/QuizBlock/quiz.ts"],"sourcesContent":["import {\n slot,\n type DataSeries,\n type InstanceSlotData,\n type LogoRef,\n type Transaction,\n} from '../../../../core'\nimport { CategoryGuids } from '../../../../core/constants/Category'\nimport { buildDataSeries } from '../../ChartBlocks/BarchartBlock/utils'\nimport { asLogoRef, asNonEmptyText, asNumber, asText } from '../../slotReaders'\n\n/** One merchant in the month, a row of the backend's `data_series`. */\nexport interface QuizMerchant {\n /** `null` for spending with no merchant; the drawer then matches transactions by `label`. */\n guid?: string | null\n label: string\n count: number\n /** The merchant's category: its logo's fallback, and the logo itself when it has no guid. */\n category_guid?: string | null\n logo?: LogoRef\n}\n\nexport interface RankedQuizMerchant extends QuizMerchant {\n rank: number\n}\n\n/** What a results row hands its drawer through `actionDrawer.context`. */\nexport interface QuizDrawerContext {\n quiz_merchant?: RankedQuizMerchant\n}\n\n/** The beat-context keys the block and the quiz CTA steps share. */\nexport const QUIZ_CONTEXT = {\n PICK: 'quiz_pick',\n CHECKED: 'quiz_checked',\n REVEALED: 'quiz_revealed',\n} as const\n\nexport const QUIZ_VARIANTS = { RESULTS: 'results' } as const\n\nconst isMerchant = (row: unknown): row is QuizMerchant => {\n const { label, count } = (row ?? {}) as Record<string, unknown>\n return asText(label) !== undefined && asNumber(count) !== undefined\n}\n\n/** The merchant's transactions: by merchant guid, or by description when it has none. */\nexport const merchantTransactions = (transactions: Transaction[], merchant: QuizMerchant) =>\n transactions.filter((transaction) =>\n merchant.guid\n ? transaction.merchant_guid === merchant.guid\n : !transaction.merchant_guid && transaction.description === merchant.label,\n )\n\n/** The merchant logo over its category fallback, or the category icon when it has no merchant guid. */\nexport const quizMerchantLogo = (\n merchant: QuizMerchant,\n transactions: Transaction[] = [],\n): LogoRef => {\n const transaction = merchantTransactions(transactions, merchant)[0]\n const category =\n merchant.logo?.fallback_guid ||\n merchant.category_guid ||\n transaction?.top_level_category_guid ||\n transaction?.category_guid ||\n CategoryGuids.UNCATEGORIZED\n const guid = merchant.logo?.guid || merchant.guid\n\n return {\n ...merchant.logo,\n alt: merchant.logo?.alt ?? merchant.label,\n fallback_guid: category,\n guid: guid || category,\n }\n}\n\n/** A merchant's id in the quiz: its guid, else its label. */\nexport const merchantKey = (merchant: QuizMerchant) => merchant.guid || merchant.label\n\n/** `data_series` rows: tupac's columnar `{ names, data }`, or an array of row objects. */\nexport const readQuizMerchants = (data: InstanceSlotData | undefined): QuizMerchant[] => {\n const series = slot<unknown[] | DataSeries>(data, 'data_series')\n const rows = Array.isArray(series) ? series : buildDataSeries(series)\n return rows.filter(isMerchant).map((row) => ({\n label: row.label,\n count: row.count,\n guid: asNonEmptyText(row.guid) ?? null,\n category_guid: asNonEmptyText(row.category_guid),\n logo: asLogoRef(row.logo),\n }))\n}\n\n/** Most transactions first, ties by name; tied counts share a rank (1, 1, 3). */\nexport const rankQuizMerchants = (merchants: QuizMerchant[]): RankedQuizMerchant[] => {\n const sorted = [...merchants].sort((a, b) => b.count - a.count || a.label.localeCompare(b.label))\n return sorted.map((merchant) => ({\n ...merchant,\n rank: sorted.findIndex(({ count }) => count === merchant.count) + 1,\n }))\n}\n\n/** Any merchant tied for the most transactions is a right answer. */\nexport const isTopMerchant = (merchants: QuizMerchant[], key: string) => {\n const top = Math.max(...merchants.map(({ count }) => count))\n return merchants.some((merchant) => merchantKey(merchant) === key && merchant.count === top)\n}\n"],"mappings":";;;;AAgCA,IAAa,IAAe;AAAA,EAC1B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AACZ,GAEa,IAAgB,EAAE,SAAS,UAAU,GAE5C,IAAA,CAAc,MAAsC;AACxD,QAAM,EAAE,OAAA,GAAO,OAAA,EAAA,IAAW,KAAO,CAAC;AAClC,SAAO,EAAO,CAAK,MAAM,UAAa,EAAS,CAAK,MAAM;AAC5D,GAGa,IAAA,CAAwB,GAA6B,MAChE,EAAa,OAAA,CAAQ,MACnB,EAAS,OACL,EAAY,kBAAkB,EAAS,OACvC,CAAC,EAAY,iBAAiB,EAAY,gBAAgB,EAAS,KACzE,GAGW,IAAA,CACX,GACA,IAA8B,CAAC,MACnB;AACZ,QAAM,IAAc,EAAqB,GAAc,CAAQ,EAAE,CAAA,GAC3D,IACJ,EAAS,MAAM,iBACf,EAAS,iBACT,GAAa,2BACb,GAAa,iBACb,EAAc,eACV,IAAO,EAAS,MAAM,QAAQ,EAAS;AAE7C,SAAO;AAAA,IACL,GAAG,EAAS;AAAA,IACZ,KAAK,EAAS,MAAM,OAAO,EAAS;AAAA,IACpC,eAAe;AAAA,IACf,MAAM,KAAQ;AAAA,EAChB;AACF,GAGa,IAAA,CAAe,MAA2B,EAAS,QAAQ,EAAS,OAGpE,IAAA,CAAqB,MAAuD;AACvF,QAAM,IAAS,EAA6B,GAAM,aAAa;AAE/D,UADa,MAAM,QAAQ,CAAM,IAAI,IAAS,EAAgB,CAAM,GACxD,OAAO,CAAU,EAAE,IAAA,CAAK,OAAS;AAAA,IAC3C,OAAO,EAAI;AAAA,IACX,OAAO,EAAI;AAAA,IACX,MAAM,EAAe,EAAI,IAAI,KAAK;AAAA,IAClC,eAAe,EAAe,EAAI,aAAa;AAAA,IAC/C,MAAM,EAAU,EAAI,IAAI;AAAA,EAC1B,EAAE;AACJ,GAGa,IAAA,CAAqB,MAAoD;AACpF,QAAM,IAAS,CAAC,GAAG,CAAS,EAAE,KAAA,CAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,EAAE,KAAK,CAAC;AAChG,SAAO,EAAO,IAAA,CAAK,OAAc;AAAA,IAC/B,GAAG;AAAA,IACH,MAAM,EAAO,UAAA,CAAW,EAAE,OAAA,EAAA,MAAY,MAAU,EAAS,KAAK,IAAI;AAAA,EACpE,EAAE;AACJ,GAGa,IAAA,CAAiB,GAA2B,MAAgB;AACvE,QAAM,IAAM,KAAK,IAAI,GAAG,EAAU,IAAA,CAAK,EAAE,OAAA,EAAA,MAAY,CAAK,CAAC;AAC3D,SAAO,EAAU,KAAA,CAAM,MAAa,EAAY,CAAQ,MAAM,KAAO,EAAS,UAAU,CAAG;AAC7F"}
@@ -1,4 +1,4 @@
1
- import { InstanceSlot, LogoRef } from '../../core';
1
+ import { InstanceSlot, LogoRef } from '../../core/types/Insights';
2
2
  /** A field V1 payloads carry flat on the slot, beside `data`. */
3
3
  export type FlatSlotKey = Exclude<keyof InstanceSlot, 'data' | 'block' | 'variant'>;
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"slotReaders.es.js","names":[],"sources":["../../../src/insights-v2/blocks/slotReaders.ts"],"sourcesContent":["import { slot, type InstanceSlot, type LogoRef } from '../../core'\n\n// Readers for untrusted payload values, in instance slots and drilldown_data: each returns the value\n// when it has the right shape, else undefined, so the caller drops it rather than drawing a guess.\n\n/** A field V1 payloads carry flat on the slot, beside `data`. */\nexport type FlatSlotKey = Exclude<keyof InstanceSlot, 'data' | 'block' | 'variant'>\n\n/**\n * `data` first, then the flat field V1 payloads carry beside it. Any non-null `data` value wins,\n * even one of the wrong kind (`data` is the truth; the caller's guard then drops it). For blocks\n * that still accept V1; a V2-only block reads `slot()` so a stale flat field never shows.\n */\nexport const slotOrFlat = (instanceSlot: InstanceSlot, key: FlatSlotKey): unknown =>\n slot(instanceSlot.data, key) ?? instanceSlot[key]\n\n/** A finite number, else undefined (so a card never shows a made-up value). */\nexport const asNumber = (value: unknown): number | undefined =>\n typeof value === 'number' && Number.isFinite(value) ? value : undefined\n\n/** Any string, empty included, else undefined. */\nexport const asText = (value: unknown): string | undefined =>\n typeof value === 'string' ? value : undefined\n\n/** A string with more than whitespace, else undefined: a blank guid or label is no value. */\nexport const asNonEmptyText = (value: unknown): string | undefined =>\n typeof value === 'string' && value.trim() !== '' ? value : undefined\n\n/** Guids, else undefined: an empty list or a blank guid names nothing to fetch or draw. */\nexport const asGuidList = (value: unknown): string[] | undefined =>\n Array.isArray(value) &&\n value.length > 0 &&\n value.every((item) => asNonEmptyText(item) !== undefined)\n ? (value as string[])\n : undefined\n\n/** A logo ref naming a `guid` or an `icon`, keeping only its fields of the right kind, else undefined. */\nexport const asLogoRef = (value: unknown): LogoRef | undefined => {\n if (typeof value !== 'object' || value === null) return undefined\n const { alt, color, fallback_guid, guid, icon } = value as Record<string, unknown>\n const ref = {\n alt: asText(alt),\n color: asText(color),\n fallback_guid: asNonEmptyText(fallback_guid),\n guid: asNonEmptyText(guid),\n icon: asNonEmptyText(icon),\n }\n return ref.guid || ref.icon ? ref : undefined\n}\n"],"mappings":";AAaA,IAAa,IAAA,CAAc,GAA4B,MACrD,EAAK,EAAa,MAAM,CAAG,KAAK,EAAa,CAAA,GAGlC,IAAA,CAAY,MACvB,OAAO,KAAU,YAAY,OAAO,SAAS,CAAK,IAAI,IAAQ,QAGnD,IAAA,CAAU,MACrB,OAAO,KAAU,WAAW,IAAQ,QAGzB,IAAA,CAAkB,MAC7B,OAAO,KAAU,YAAY,EAAM,KAAK,MAAM,KAAK,IAAQ,QAGhD,IAAA,CAAc,MACzB,MAAM,QAAQ,CAAK,KACnB,EAAM,SAAS,KACf,EAAM,MAAA,CAAO,MAAS,EAAe,CAAI,MAAM,MAAS,IACnD,IACD,QAGO,IAAA,CAAa,MAAwC;AAChE,MAAI,OAAO,KAAU,YAAY,MAAU,KAAM;AACjD,QAAM,EAAE,KAAA,GAAK,OAAA,GAAO,eAAA,GAAe,MAAA,GAAM,MAAA,EAAA,IAAS,GAC5C,IAAM;AAAA,IACV,KAAK,EAAO,CAAG;AAAA,IACf,OAAO,EAAO,CAAK;AAAA,IACnB,eAAe,EAAe,CAAa;AAAA,IAC3C,MAAM,EAAe,CAAI;AAAA,IACzB,MAAM,EAAe,CAAI;AAAA,EAC3B;AACA,SAAO,EAAI,QAAQ,EAAI,OAAO,IAAM;AACtC"}
1
+ {"version":3,"file":"slotReaders.es.js","names":[],"sources":["../../../src/insights-v2/blocks/slotReaders.ts"],"sourcesContent":["// Leaf import: the micro card uses this file, and the `core` barrel pulls every store into it.\nimport { slot, type InstanceSlot, type LogoRef } from '../../core/types/Insights'\n\n// Readers for untrusted payload values, in instance slots and drilldown_data: each returns the value\n// when it has the right shape, else undefined, so the caller drops it rather than drawing a guess.\n\n/** A field V1 payloads carry flat on the slot, beside `data`. */\nexport type FlatSlotKey = Exclude<keyof InstanceSlot, 'data' | 'block' | 'variant'>\n\n/**\n * `data` first, then the flat field V1 payloads carry beside it. Any non-null `data` value wins,\n * even one of the wrong kind (`data` is the truth; the caller's guard then drops it). For blocks\n * that still accept V1; a V2-only block reads `slot()` so a stale flat field never shows.\n */\nexport const slotOrFlat = (instanceSlot: InstanceSlot, key: FlatSlotKey): unknown =>\n slot(instanceSlot.data, key) ?? instanceSlot[key]\n\n/** A finite number, else undefined (so a card never shows a made-up value). */\nexport const asNumber = (value: unknown): number | undefined =>\n typeof value === 'number' && Number.isFinite(value) ? value : undefined\n\n/** Any string, empty included, else undefined. */\nexport const asText = (value: unknown): string | undefined =>\n typeof value === 'string' ? value : undefined\n\n/** A string with more than whitespace, else undefined: a blank guid or label is no value. */\nexport const asNonEmptyText = (value: unknown): string | undefined =>\n typeof value === 'string' && value.trim() !== '' ? value : undefined\n\n/** Guids, else undefined: an empty list or a blank guid names nothing to fetch or draw. */\nexport const asGuidList = (value: unknown): string[] | undefined =>\n Array.isArray(value) &&\n value.length > 0 &&\n value.every((item) => asNonEmptyText(item) !== undefined)\n ? (value as string[])\n : undefined\n\n/** A logo ref naming a `guid` or an `icon`, keeping only its fields of the right kind, else undefined. */\nexport const asLogoRef = (value: unknown): LogoRef | undefined => {\n if (typeof value !== 'object' || value === null) return undefined\n const { alt, color, fallback_guid, guid, icon } = value as Record<string, unknown>\n const ref = {\n alt: asText(alt),\n color: asText(color),\n fallback_guid: asNonEmptyText(fallback_guid),\n guid: asNonEmptyText(guid),\n icon: asNonEmptyText(icon),\n }\n return ref.guid || ref.icon ? ref : undefined\n}\n"],"mappings":";AAcA,IAAa,IAAA,CAAc,GAA4B,MACrD,EAAK,EAAa,MAAM,CAAG,KAAK,EAAa,CAAA,GAGlC,IAAA,CAAY,MACvB,OAAO,KAAU,YAAY,OAAO,SAAS,CAAK,IAAI,IAAQ,QAGnD,IAAA,CAAU,MACrB,OAAO,KAAU,WAAW,IAAQ,QAGzB,IAAA,CAAkB,MAC7B,OAAO,KAAU,YAAY,EAAM,KAAK,MAAM,KAAK,IAAQ,QAGhD,IAAA,CAAc,MACzB,MAAM,QAAQ,CAAK,KACnB,EAAM,SAAS,KACf,EAAM,MAAA,CAAO,MAAS,EAAe,CAAI,MAAM,MAAS,IACnD,IACD,QAGO,IAAA,CAAa,MAAwC;AAChE,MAAI,OAAO,KAAU,YAAY,MAAU,KAAM;AACjD,QAAM,EAAE,KAAA,GAAK,OAAA,GAAO,eAAA,GAAe,MAAA,GAAM,MAAA,EAAA,IAAS,GAC5C,IAAM;AAAA,IACV,KAAK,EAAO,CAAG;AAAA,IACf,OAAO,EAAO,CAAK;AAAA,IACnB,eAAe,EAAe,CAAa;AAAA,IAC3C,MAAM,EAAe,CAAI;AAAA,IACzB,MAAM,EAAe,CAAI;AAAA,EAC3B;AACA,SAAO,EAAI,QAAQ,EAAI,OAAO,IAAM;AACtC"}
@@ -1,44 +1,45 @@
1
- import { GlobalDataContext as U } from "../../common/context/GlobalDataProvider.es.js";
2
- import { slot as E } from "../../core/types/Insights.es.js";
3
- import { resolveInsightRender as X } from "../../insights-v2/resolveInsightRender.es.js";
4
- import { hasDrawerBlock as Y } from "../../insights-v2/mappings/hasDrawerBlock.es.js";
5
- import Z from "../../insights-v2/components/LogoFromGuid.es.js";
6
- import { statusIconAccentColor as b, statusIconName as O, statusIconPalette as ii } from "../../insights-v2/components/statusIcon.es.js";
7
- import { ON_CLICK_EVENT as S, ON_VIEW_EVENT as ti, ON_VIEW_FIRST_TIME_EVENT as ei } from "../constants/Analytics.es.js";
8
- import G from "../beaticons/BeatMaterialIcon.es.js";
9
- import { BeatIcon as oi } from "../beaticons/BeatIcon.es.js";
10
- import { useCopyStore as ri, useEvent as ni, useInsightsMicroWidgetStore as si } from "../context/hooks.es.js";
11
- import { microCardMinWidth as ci } from "../utils/cardWidth.es.js";
12
- import q from "../MicroCardTemplate.es.js";
13
- import li from "./InlineActionBlock.es.js";
14
- import { MicroCtaStatusGate as mi } from "./MicroCtaStatus.es.js";
15
- import ai from "../../insights-v2/components/InsightErrorCard.es.js";
16
- import pi, { useEffect as D, useState as _i } from "react";
17
- import { Fragment as di, jsx as e, jsxs as ui } from "react/jsx-runtime";
18
- import { alpha as j, useTheme as gi } from "@mui/material/styles";
19
- import fi from "@mui/material/Box";
20
- import { useInView as hi } from "react-intersection-observer";
21
- var Gi = ({ ariaLabel: g, beat: i, elevation: k, inDescriptionCtaBehavior: L = "external", index: s, isActiveCard: f, onCardClick: c, posthog: r, widthOverrides: h, variant: x, showIcon: N, heightOverrides: I }) => {
22
- const { ref: C, inView: l } = hi({ threshold: 1 }), y = gi(), { cardsCopy: z } = ri(), { onEvent: m } = ni(), { updateBeat: H, updateOffer: K } = si(), a = "is_insights_v2" in i && i.is_insights_v2, p = a ? { metadata: { is_insights_v2: !0 } } : void 0;
23
- D(() => {
24
- l && (i.has_been_displayed ? m(ti(i.template), p) : (i.guid.startsWith("OFR") ? K({
1
+ import { GlobalDataContext as Z } from "../../common/context/GlobalDataProvider.es.js";
2
+ import { slot as k } from "../../core/types/Insights.es.js";
3
+ import { resolveInsightRender as b } from "../../insights-v2/resolveInsightRender.es.js";
4
+ import { asLogoRef as S } from "../../insights-v2/blocks/slotReaders.es.js";
5
+ import { hasDrawerBlock as ii } from "../../insights-v2/mappings/hasDrawerBlock.es.js";
6
+ import ti, { isLogoGuid as ei } from "../../insights-v2/components/LogoFromGuid.es.js";
7
+ import { statusIconAccentColor as oi, statusIconName as x, statusIconPalette as ri } from "../../insights-v2/components/statusIcon.es.js";
8
+ import { ON_CLICK_EVENT as L, ON_VIEW_EVENT as ni, ON_VIEW_FIRST_TIME_EVENT as si } from "../constants/Analytics.es.js";
9
+ import q from "../beaticons/BeatMaterialIcon.es.js";
10
+ import { BeatIcon as ci } from "../beaticons/BeatIcon.es.js";
11
+ import { useCopyStore as mi, useEvent as li, useInsightsMicroWidgetStore as ai } from "../context/hooks.es.js";
12
+ import { microCardMinWidth as pi } from "../utils/cardWidth.es.js";
13
+ import D from "../MicroCardTemplate.es.js";
14
+ import di from "./InlineActionBlock.es.js";
15
+ import { MicroCtaStatusGate as _i } from "./MicroCtaStatus.es.js";
16
+ import ui from "../../insights-v2/components/InsightErrorCard.es.js";
17
+ import gi, { useEffect as j, useState as fi } from "react";
18
+ import { Fragment as hi, jsx as e, jsxs as Ii } from "react/jsx-runtime";
19
+ import { alpha as z, useTheme as Ci } from "@mui/material/styles";
20
+ import yi from "@mui/material/Box";
21
+ import { useInView as vi } from "react-intersection-observer";
22
+ var zi = ({ ariaLabel: g, beat: i, elevation: N, inDescriptionCtaBehavior: H = "external", index: s, isActiveCard: f, onCardClick: c, posthog: o, widthOverrides: h, variant: R, showIcon: T, heightOverrides: I }) => {
23
+ const { ref: C, inView: m } = vi({ threshold: 1 }), y = Ci(), { cardsCopy: K } = mi(), { onEvent: l } = li(), { updateBeat: $, updateOffer: J } = ai(), a = "is_insights_v2" in i && i.is_insights_v2, p = a ? { metadata: { is_insights_v2: !0 } } : void 0;
24
+ j(() => {
25
+ m && (i.has_been_displayed ? l(ni(i.template), p) : (i.guid.startsWith("OFR") ? J({
25
26
  ...i,
26
27
  has_been_displayed: !0
27
- }) : H({
28
+ }) : $({
28
29
  ...i,
29
30
  has_been_displayed: !0
30
- }), m(ei(i.template), p)));
31
- }, [l]), D(() => {
32
- if (l && i) if (i.template === "MarketingOffer") {
31
+ }), l(si(i.template), p)));
32
+ }, [m]), j(() => {
33
+ if (m && i) if (i.template === "MarketingOffer") {
33
34
  const t = i;
34
- r?.capture("viewed_messaging_insight", {
35
+ o?.capture("viewed_messaging_insight", {
35
36
  template: i.template,
36
37
  campaign_guid: t.campaign_guid,
37
38
  campaign_name: t.pulse_campaign_name,
38
39
  offer_guid: t.guid,
39
40
  user_guid: t.user_guid
40
41
  });
41
- } else r?.capture("viewed_insight", {
42
+ } else o?.capture("viewed_insight", {
42
43
  beat_guid: i.guid,
43
44
  template: i.template,
44
45
  position: s,
@@ -47,26 +48,26 @@ var Gi = ({ ariaLabel: g, beat: i, elevation: k, inDescriptionCtaBehavior: L = "
47
48
  }, [
48
49
  i,
49
50
  s,
50
- l
51
+ m
51
52
  ]);
52
- const T = X(i), o = T === "v2" ? i.insights_payload : void 0, $ = pi.useContext(U) !== null, V = L === "internal" && $ && Y(o?.in_description_cta?.block), [B, J] = _i(0), _ = () => {
53
- if (V ? J((t) => t + 1) : c && c(i), m(S(i.template), p), i.template === "MarketingOffer") {
53
+ const V = b(i), r = V === "v2" ? i.insights_payload : void 0, Q = gi.useContext(Z) !== null, B = H === "internal" && Q && ii(r?.in_description_cta?.block), [M, U] = fi(0), d = () => {
54
+ if (B ? U((t) => t + 1) : c && c(i), l(L(i.template), p), i.template === "MarketingOffer") {
54
55
  const t = i;
55
- r?.capture("clicked_messaging_insight", {
56
+ o?.capture("clicked_messaging_insight", {
56
57
  template: i.template,
57
58
  campaign_guid: t.campaign_guid,
58
59
  campaign_name: t.pulse_campaign_name,
59
60
  offer_guid: t.guid,
60
61
  user_guid: t.user_guid
61
62
  });
62
- } else r?.capture("clicked_insight", {
63
+ } else o?.capture("clicked_insight", {
63
64
  beat_guid: i.guid,
64
65
  template: i.template,
65
66
  position: s,
66
67
  ...a && { is_insights_v2: !0 }
67
68
  });
68
69
  };
69
- return T === "error" ? /* @__PURE__ */ e(fi, {
70
+ return V === "error" ? /* @__PURE__ */ e(yi, {
70
71
  "aria-hidden": !f,
71
72
  "aria-label": g,
72
73
  "aria-roledescription": "slide",
@@ -74,74 +75,74 @@ var Gi = ({ ariaLabel: g, beat: i, elevation: k, inDescriptionCtaBehavior: L = "
74
75
  role: "group",
75
76
  sx: {
76
77
  height: I ? "100%" : 120,
77
- minWidth: ci(h),
78
+ minWidth: pi(h),
78
79
  my: 1
79
80
  },
80
- children: /* @__PURE__ */ e(ai, { beat: i })
81
- }) : o ? /* @__PURE__ */ e(mi, {
81
+ children: /* @__PURE__ */ e(ui, { beat: i })
82
+ }) : r ? /* @__PURE__ */ e(_i, {
82
83
  beat: i,
83
- posthog: r,
84
+ posthog: o,
84
85
  children: ({ presentation: n }) => {
85
- const M = n?.kind === "status" ? n : void 0, d = E(o.instance_slot.data, "logo"), R = E(o.instance_slot.data, M && E(o.instance_slot.data, "reviewed_icon") ? "reviewed_icon" : "icon"), v = O(d?.guid), w = v ? d?.color || "primary.main" : R?.color, P = v ?? O(R?.guid), W = ii(w), u = b(y.palette, w), Q = n ? M?.action?.label : o.primary_cta?.label || o.in_description_cta?.label || void 0, A = () => {
86
- c && c(i), m(S(i.template), p), r?.capture("clicked_insight", {
86
+ const w = n?.kind === "status" ? n : void 0, { data: v } = r.instance_slot, _ = S(k(v, "logo")), P = [w ? k(v, "reviewed_icon") : void 0, k(v, "icon")].map(S).find((Y) => x(Y?.guid)), E = x(_?.guid), W = E ? _?.color || "primary.main" : P?.color, A = E ?? x(P?.guid), F = ri(W), u = oi(y.palette, W), X = n ? w?.action?.label : r.primary_cta?.label || r.in_description_cta?.label || void 0, G = () => {
87
+ c && c(i), l(L(i.template), p), o?.capture("clicked_insight", {
87
88
  beat_guid: i.guid,
88
89
  template: i.template,
89
90
  position: s,
90
91
  ...a && { is_insights_v2: !0 }
91
92
  });
92
- }, F = /* @__PURE__ */ e(q, {
93
+ }, O = /* @__PURE__ */ e(D, {
93
94
  "aria-roledescription": "slide",
94
95
  ariaLabel: g,
95
- description: o.description.html_text,
96
- elevation: k,
96
+ description: r.description.html_text,
97
+ elevation: N,
97
98
  heightOverrides: I,
98
- icon: N && (d && !v ? /* @__PURE__ */ e(Z, {
99
- logo: d,
99
+ icon: T && (ei(_?.guid) && !E ? /* @__PURE__ */ e(ti, {
100
+ logo: _,
100
101
  size: 32
101
- }) : P ? /* @__PURE__ */ e(G, {
102
- bgColor: j(u ?? y.palette[W].main, 0.15),
103
- iconColor: u ? "inherit" : W,
104
- name: P,
102
+ }) : A ? /* @__PURE__ */ e(q, {
103
+ bgColor: z(u ?? y.palette[F].main, 0.15),
104
+ iconColor: u ? "inherit" : F,
105
+ name: A,
105
106
  sx: u ? { color: u } : void 0
106
- }) : /* @__PURE__ */ e(G, {
107
- bgColor: j(y.palette.primary.main, 0.15),
107
+ }) : /* @__PURE__ */ e(q, {
108
+ bgColor: z(y.palette.primary.main, 0.15),
108
109
  name: "lightbulb"
109
110
  })),
110
111
  isActiveCard: f,
111
112
  isInsightsV2: !0,
112
- onCardClick: n ? A : _,
113
- onPrimaryAction: n ? A : _,
114
- primaryActionText: Q,
113
+ onCardClick: n ? G : d,
114
+ onPrimaryAction: n ? G : d,
115
+ primaryActionText: X,
115
116
  ref: C,
116
- title: n?.title || o.title || "",
117
- variant: x,
117
+ title: n?.title || r.title || "",
118
+ variant: R,
118
119
  widthOverrides: h
119
120
  });
120
- return V ? /* @__PURE__ */ ui(di, { children: [F, B > 0 && /* @__PURE__ */ e(li, {
121
+ return B ? /* @__PURE__ */ Ii(hi, { children: [O, M > 0 && /* @__PURE__ */ e(di, {
121
122
  beat: i,
122
- openRequest: B,
123
- posthog: r
124
- })] }) : F;
123
+ openRequest: M,
124
+ posthog: o
125
+ })] }) : O;
125
126
  }
126
- }) : /* @__PURE__ */ e(q, {
127
+ }) : /* @__PURE__ */ e(D, {
127
128
  "aria-roledescription": "slide",
128
129
  ariaLabel: g,
129
130
  description: i?.html_micro_description && i?.html_micro_description.length > 0 ? i.html_micro_description : i.html_description || "",
130
- elevation: k,
131
+ elevation: N,
131
132
  heightOverrides: I,
132
- icon: N && /* @__PURE__ */ e(oi, { beat: i }),
133
+ icon: T && /* @__PURE__ */ e(ci, { beat: i }),
133
134
  isActiveCard: f,
134
- onCardClick: _,
135
- onPrimaryAction: _,
136
- primaryActionText: i.micro_call_to_action || z?.micro_card_cta,
135
+ onCardClick: d,
136
+ onPrimaryAction: d,
137
+ primaryActionText: i.micro_call_to_action || K?.micro_card_cta,
137
138
  ref: C,
138
139
  title: i.micro_title && i.micro_title.length > 0 ? i.micro_title : i.title,
139
- variant: x,
140
+ variant: R,
140
141
  widthOverrides: h
141
142
  });
142
143
  };
143
144
  export {
144
- Gi as InsightCard
145
+ zi as InsightCard
145
146
  };
146
147
 
147
148
  //# sourceMappingURL=InsightCard.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InsightCard.es.js","names":[],"sources":["../../../src/microinsights/cards/InsightCard.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react'\nimport { useInView } from 'react-intersection-observer'\n\nimport Box from '@mui/material/Box'\nimport { alpha, useTheme } from '@mui/material/styles'\n\nimport { BeatIcon } from '../beaticons'\nimport BeatMaterialIcon from '../beaticons/BeatMaterialIcon'\n\nimport { useCopyStore, useEvent, useInsightsMicroWidgetStore } from '../context/hooks'\n\nimport { ON_CLICK_EVENT, ON_VIEW_EVENT, ON_VIEW_FIRST_TIME_EVENT } from '../constants/Analytics'\nimport { ICON_SIZE, VIEW_THRESHOLD } from '../constants/App'\nimport { microCardMinWidth } from '../utils/cardWidth'\n\nimport type { BeatLikeOffer, MicroInsightCardProps } from '../interfaces'\nimport type { Beat } from '../../core/types/Beat'\n// Leaf imports, not the `core` barrel: that pulls GlobalStore and every feature store into the\n// micro bundle, and through `core/stores` it reintroduces a circular path this module avoids.\nimport { slot } from '../../core/types/Insights'\nimport type { LogoRef } from '../../core/types/Insights'\nimport MicroCardTemplate from '../MicroCardTemplate'\n// Leaf import, not the `common` barrel, which would pull the shared layer into the micro bundle.\nimport { GlobalDataContext } from '../../common/context/GlobalDataProvider'\n// TODO: load this with `React.lazy` to keep the block registry and charts out of the micro bundle,\n// once it is verified in every host that embeds the micro widget.\nimport InlineActionBlock from './InlineActionBlock'\nimport MicroCtaStatusGate, { type MicroCtaStatus } from './MicroCtaStatus'\n// Leaf imports on purpose: the `insights-v2` barrel pulls in `mappings/blocks` and its charts.\nimport InsightErrorCard from '../../insights-v2/components/InsightErrorCard'\nimport LogoFromGuid from '../../insights-v2/components/LogoFromGuid'\nimport {\n statusIconAccentColor,\n statusIconName,\n statusIconPalette,\n} from '../../insights-v2/components/statusIcon'\nimport { hasDrawerBlock } from '../../insights-v2/mappings/hasDrawerBlock'\nimport { resolveInsightRender } from '../../insights-v2/resolveInsightRender'\n\nexport interface InsightCardProps extends MicroInsightCardProps {\n beat: Beat | BeatLikeOffer\n index?: number\n}\n\nexport const InsightCard: React.FC<InsightCardProps> = ({\n ariaLabel,\n beat,\n elevation,\n inDescriptionCtaBehavior = 'external',\n index,\n isActiveCard,\n onCardClick,\n posthog,\n widthOverrides,\n variant,\n showIcon,\n heightOverrides,\n}) => {\n const { ref, inView } = useInView({\n threshold: VIEW_THRESHOLD,\n })\n\n const theme = useTheme()\n\n // *************** Context functions *********************\n const { cardsCopy } = useCopyStore()\n const { onEvent } = useEvent()\n const { updateBeat, updateOffer } = useInsightsMicroWidgetStore()\n\n const isV2 = 'is_insights_v2' in beat && beat.is_insights_v2\n const eventProps = isV2 ? { metadata: { is_insights_v2: true } } : undefined\n\n // ************** Use Effects Hooks **********************\n useEffect(() => {\n if (inView) {\n if (!beat.has_been_displayed) {\n if (beat.guid.startsWith('OFR')) {\n updateOffer({\n ...beat,\n has_been_displayed: true,\n })\n } else {\n updateBeat({\n ...beat,\n has_been_displayed: true,\n })\n }\n onEvent(ON_VIEW_FIRST_TIME_EVENT(beat.template), eventProps)\n } else {\n onEvent(ON_VIEW_EVENT(beat.template), eventProps)\n }\n }\n }, [inView])\n\n useEffect(() => {\n if (inView && beat) {\n if (beat.template === 'MarketingOffer') {\n const offerBeat = beat as BeatLikeOffer\n posthog?.capture('viewed_messaging_insight', {\n template: beat.template,\n campaign_guid: offerBeat.campaign_guid,\n campaign_name: offerBeat.pulse_campaign_name,\n offer_guid: offerBeat.guid,\n user_guid: offerBeat.user_guid,\n })\n } else {\n posthog?.capture('viewed_insight', {\n beat_guid: beat.guid,\n template: beat.template,\n position: index,\n ...(isV2 && { is_insights_v2: true }),\n })\n }\n }\n }, [beat, index, inView])\n\n const insightRender = resolveInsightRender(beat as Beat)\n const v2Payload = insightRender === 'v2' ? beat.insights_payload : undefined\n // Only a V2 beat whose `in_description_cta` names a drawer block opens in place; everything else\n // keeps the host's behavior. Micro sends its one action as `in_description_cta`.\n // It also needs the host's `GlobalDataProvider`; without one the tap goes to the host instead.\n const hasGlobalData = React.useContext(GlobalDataContext) !== null\n const opensInline =\n inDescriptionCtaBehavior === 'internal' &&\n hasGlobalData &&\n hasDrawerBlock(v2Payload?.in_description_cta?.block)\n\n // *************** Click handlers ************************\n // Taps that opened the beat's own action block.\n const [inlineOpenRequest, setInlineOpenRequest] = useState(0)\n\n const handleClick = () => {\n /* eslint-disable no-unused-expressions */\n // Internal opens the block here and skips the host's `onCardClick`; analytics are unchanged.\n if (opensInline) {\n setInlineOpenRequest((count) => count + 1)\n } else {\n onCardClick && onCardClick(beat)\n }\n onEvent(ON_CLICK_EVENT(beat.template), eventProps)\n\n if (beat.template === 'MarketingOffer') {\n const offerBeat = beat as BeatLikeOffer\n posthog?.capture('clicked_messaging_insight', {\n template: beat.template,\n campaign_guid: offerBeat.campaign_guid,\n campaign_name: offerBeat.pulse_campaign_name,\n offer_guid: offerBeat.guid,\n user_guid: offerBeat.user_guid,\n })\n } else {\n posthog?.capture('clicked_insight', {\n beat_guid: beat.guid,\n template: beat.template,\n position: index,\n ...(isV2 && { is_insights_v2: true }),\n })\n }\n }\n\n if (insightRender === 'error') {\n // Keeps the carousel's slot sizing; the error card does not know about it.\n return (\n <Box\n aria-hidden={!isActiveCard}\n aria-label={ariaLabel}\n aria-roledescription=\"slide\"\n ref={ref}\n role=\"group\"\n sx={{\n height: heightOverrides ? '100%' : 120,\n minWidth: microCardMinWidth(widthOverrides),\n my: 1,\n }}\n >\n <InsightErrorCard beat={beat} />\n </Box>\n )\n }\n\n if (v2Payload) {\n // Figma (Micro Widget | Large Transaction) is the legacy micro card's layout fed from the envelope:\n // the slot's logo on the left (merchant, or the category without one), title, description, and the\n // primary CTA as a link. The logo falls back to the insight glyph when the slot carries none.\n // ditto ≥ 1.4.3 words micro's action as in_description_cta instead of primary_cta; either way\n // the label stays the card's tap (`micro-carousel/cta`), never a drawer.\n // A block with no row logo may name a status icon instead (account_block `minimal`: `ICO-error`),\n // drawn in the legacy card's tinted tile (Figma Micro | Low Account Balance).\n // The status tile takes the palette the slot names (Payday's on-track check is `success.main`),\n // falling back to error. `||` on the label: the copy may send the primary label as \"\".\n // Answered (mirrors the full card): reviewed title, icon and the Undo label. Display only: the card\n // and its label tap go to the host, which opens the insight with its block; nothing runs here.\n const renderCard = ({ presentation }: MicroCtaStatus) => {\n const answered = presentation?.kind === 'status' ? presentation : undefined\n const rowLogo = slot<LogoRef>(v2Payload.instance_slot.data, 'logo')\n const statusIcon = slot<LogoRef>(\n v2Payload.instance_slot.data,\n answered && slot<LogoRef>(v2Payload.instance_slot.data, 'reviewed_icon')\n ? 'reviewed_icon'\n : 'icon',\n )\n // An `ICO-` row logo is an icon, not an entity logo: it takes the same tinted tile (Figma Micro\n // Card) and wins over the status icon, as a row logo always has. The no-colour defaults differ\n // on purpose: a row icon with none is decorative (primary), a status icon with none is an error.\n const rowIconName = statusIconName(rowLogo?.guid)\n const tileColor = rowIconName ? rowLogo?.color || 'primary.main' : statusIcon?.color\n const tileName = rowIconName ?? statusIconName(statusIcon?.guid)\n const tilePalette = statusIconPalette(tileColor)\n // A non-status icon (`primary.main`, `chart.*`) tints the tile in its own colour.\n const tileAccent = statusIconAccentColor(theme.palette, tileColor)\n const actionLabel = presentation\n ? answered?.action?.label\n : v2Payload.primary_cta?.label || v2Payload.in_description_cta?.label || undefined\n const handleHostClick = () => {\n onCardClick && onCardClick(beat)\n onEvent(ON_CLICK_EVENT(beat.template), eventProps)\n posthog?.capture('clicked_insight', {\n beat_guid: beat.guid,\n template: beat.template,\n position: index,\n ...(isV2 && { is_insights_v2: true }),\n })\n }\n\n const card = (\n <MicroCardTemplate\n aria-roledescription=\"slide\"\n ariaLabel={ariaLabel}\n description={v2Payload.description.html_text}\n elevation={elevation}\n heightOverrides={heightOverrides}\n icon={\n showIcon &&\n (rowLogo && !rowIconName ? (\n <LogoFromGuid logo={rowLogo} size={ICON_SIZE} />\n ) : tileName ? (\n <BeatMaterialIcon\n bgColor={alpha(tileAccent ?? theme.palette[tilePalette].main, 0.15)}\n iconColor={tileAccent ? 'inherit' : tilePalette}\n name={tileName}\n sx={tileAccent ? { color: tileAccent } : undefined}\n />\n ) : (\n <BeatMaterialIcon\n bgColor={alpha(theme.palette.primary.main, 0.15)}\n name=\"lightbulb\"\n />\n ))\n }\n isActiveCard={isActiveCard}\n isInsightsV2={true}\n onCardClick={presentation ? handleHostClick : handleClick}\n onPrimaryAction={presentation ? handleHostClick : handleClick}\n primaryActionText={actionLabel}\n ref={ref}\n title={presentation?.title || v2Payload.title || ''}\n variant={variant}\n widthOverrides={widthOverrides}\n />\n )\n\n if (!opensInline) return card\n\n return (\n <>\n {card}\n {/* Nothing renders until the first tap. */}\n {inlineOpenRequest > 0 && (\n <InlineActionBlock\n beat={beat as Beat}\n openRequest={inlineOpenRequest}\n posthog={posthog}\n />\n )}\n </>\n )\n }\n\n return (\n <MicroCtaStatusGate beat={beat as Beat} posthog={posthog}>\n {renderCard}\n </MicroCtaStatusGate>\n )\n }\n\n return (\n <MicroCardTemplate\n aria-roledescription=\"slide\"\n ariaLabel={ariaLabel}\n description={\n beat?.html_micro_description && beat?.html_micro_description.length > 0\n ? beat.html_micro_description\n : beat.html_description || ''\n }\n elevation={elevation}\n heightOverrides={heightOverrides}\n icon={showIcon && <BeatIcon beat={beat} />}\n isActiveCard={isActiveCard}\n onCardClick={handleClick}\n onPrimaryAction={handleClick}\n primaryActionText={beat.micro_call_to_action || cardsCopy?.micro_card_cta}\n ref={ref}\n title={beat.micro_title && beat.micro_title.length > 0 ? beat.micro_title : beat.title}\n variant={variant}\n widthOverrides={widthOverrides}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4CA,IAAa,KAAA,CAA2C,EACtD,WAAA,GACA,MAAA,GACA,WAAA,GACA,0BAAA,IAA2B,YAC3B,OAAA,GACA,cAAA,GACA,aAAA,GACA,SAAA,GACA,gBAAA,GACA,SAAA,GACA,UAAA,GACA,iBAAA,EAAA,MACI;AACJ,QAAM,EAAE,KAAA,GAAK,QAAA,EAAA,IAAW,GAAU,EAChC,WAAA,EACF,CAAC,GAEK,IAAQ,GAAS,GAGjB,EAAE,WAAA,EAAA,IAAc,GAAa,GAC7B,EAAE,SAAA,EAAA,IAAY,GAAS,GACvB,EAAE,YAAA,GAAY,aAAA,EAAA,IAAgB,GAA4B,GAE1D,IAAO,oBAAoB,KAAQ,EAAK,gBACxC,IAAa,IAAO,EAAE,UAAU,EAAE,gBAAgB,GAAK,EAAE,IAAI;AAGnE,EAAA,EAAA,MAAgB;AACd,IAAI,MACG,EAAK,qBAcR,EAAQ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,EAKsB,CAAA,IAKtB,gBAAA,EAAC,GAAD;AAAA,IACE,wBAAqB;AAAA,IACV,WAAA;AAAA,IACX,aACE,GAAM,0BAA0B,GAAM,uBAAuB,SAAS,IAClE,EAAK,yBACL,EAAK,oBAAoB;AAAA,IAEpB,WAAA;AAAA,IACM,iBAAA;AAAA,IACjB,MAAM,KAAY,gBAAA,EAAC,IAAD,EAAgB,MAAA,EAAO,CAAA;AAAA,IAC3B,cAAA;AAAA,IACd,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,mBAAmB,EAAK,wBAAwB,GAAW;AAAA,IACtD,KAAA;AAAA,IACL,OAAO,EAAK,eAAe,EAAK,YAAY,SAAS,IAAI,EAAK,cAAc,EAAK;AAAA,IACxE,SAAA;AAAA,IACO,gBAAA;AAAA,EACjB,CAAA;AAEL"}
1
+ {"version":3,"file":"InsightCard.es.js","names":[],"sources":["../../../src/microinsights/cards/InsightCard.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react'\nimport { useInView } from 'react-intersection-observer'\n\nimport Box from '@mui/material/Box'\nimport { alpha, useTheme } from '@mui/material/styles'\n\nimport { BeatIcon } from '../beaticons'\nimport BeatMaterialIcon from '../beaticons/BeatMaterialIcon'\n\nimport { useCopyStore, useEvent, useInsightsMicroWidgetStore } from '../context/hooks'\n\nimport { ON_CLICK_EVENT, ON_VIEW_EVENT, ON_VIEW_FIRST_TIME_EVENT } from '../constants/Analytics'\nimport { ICON_SIZE, VIEW_THRESHOLD } from '../constants/App'\nimport { microCardMinWidth } from '../utils/cardWidth'\n\nimport type { BeatLikeOffer, MicroInsightCardProps } from '../interfaces'\nimport type { Beat } from '../../core/types/Beat'\n// Leaf imports, not the `core` barrel: that pulls GlobalStore and every feature store into the\n// micro bundle, and through `core/stores` it reintroduces a circular path this module avoids.\nimport { slot } from '../../core/types/Insights'\nimport MicroCardTemplate from '../MicroCardTemplate'\n// Leaf import, not the `common` barrel, which would pull the shared layer into the micro bundle.\nimport { GlobalDataContext } from '../../common/context/GlobalDataProvider'\n// TODO: load this with `React.lazy` to keep the block registry and charts out of the micro bundle,\n// once it is verified in every host that embeds the micro widget.\nimport InlineActionBlock from './InlineActionBlock'\nimport MicroCtaStatusGate, { type MicroCtaStatus } from './MicroCtaStatus'\n// Leaf imports on purpose: the `insights-v2` barrel pulls in `mappings/blocks` and its charts.\nimport { asLogoRef } from '../../insights-v2/blocks/slotReaders'\nimport InsightErrorCard from '../../insights-v2/components/InsightErrorCard'\nimport LogoFromGuid, { isLogoGuid } from '../../insights-v2/components/LogoFromGuid'\nimport {\n statusIconAccentColor,\n statusIconName,\n statusIconPalette,\n} from '../../insights-v2/components/statusIcon'\nimport { hasDrawerBlock } from '../../insights-v2/mappings/hasDrawerBlock'\nimport { resolveInsightRender } from '../../insights-v2/resolveInsightRender'\n\nexport interface InsightCardProps extends MicroInsightCardProps {\n beat: Beat | BeatLikeOffer\n index?: number\n}\n\nexport const InsightCard: React.FC<InsightCardProps> = ({\n ariaLabel,\n beat,\n elevation,\n inDescriptionCtaBehavior = 'external',\n index,\n isActiveCard,\n onCardClick,\n posthog,\n widthOverrides,\n variant,\n showIcon,\n heightOverrides,\n}) => {\n const { ref, inView } = useInView({\n threshold: VIEW_THRESHOLD,\n })\n\n const theme = useTheme()\n\n // *************** Context functions *********************\n const { cardsCopy } = useCopyStore()\n const { onEvent } = useEvent()\n const { updateBeat, updateOffer } = useInsightsMicroWidgetStore()\n\n const isV2 = 'is_insights_v2' in beat && beat.is_insights_v2\n const eventProps = isV2 ? { metadata: { is_insights_v2: true } } : undefined\n\n // ************** Use Effects Hooks **********************\n useEffect(() => {\n if (inView) {\n if (!beat.has_been_displayed) {\n if (beat.guid.startsWith('OFR')) {\n updateOffer({\n ...beat,\n has_been_displayed: true,\n })\n } else {\n updateBeat({\n ...beat,\n has_been_displayed: true,\n })\n }\n onEvent(ON_VIEW_FIRST_TIME_EVENT(beat.template), eventProps)\n } else {\n onEvent(ON_VIEW_EVENT(beat.template), eventProps)\n }\n }\n }, [inView])\n\n useEffect(() => {\n if (inView && beat) {\n if (beat.template === 'MarketingOffer') {\n const offerBeat = beat as BeatLikeOffer\n posthog?.capture('viewed_messaging_insight', {\n template: beat.template,\n campaign_guid: offerBeat.campaign_guid,\n campaign_name: offerBeat.pulse_campaign_name,\n offer_guid: offerBeat.guid,\n user_guid: offerBeat.user_guid,\n })\n } else {\n posthog?.capture('viewed_insight', {\n beat_guid: beat.guid,\n template: beat.template,\n position: index,\n ...(isV2 && { is_insights_v2: true }),\n })\n }\n }\n }, [beat, index, inView])\n\n const insightRender = resolveInsightRender(beat as Beat)\n const v2Payload = insightRender === 'v2' ? beat.insights_payload : undefined\n // Only a V2 beat whose `in_description_cta` names a drawer block opens in place; everything else\n // keeps the host's behavior. Micro sends its one action as `in_description_cta`.\n // It also needs the host's `GlobalDataProvider`; without one the tap goes to the host instead.\n const hasGlobalData = React.useContext(GlobalDataContext) !== null\n const opensInline =\n inDescriptionCtaBehavior === 'internal' &&\n hasGlobalData &&\n hasDrawerBlock(v2Payload?.in_description_cta?.block)\n\n // *************** Click handlers ************************\n // Taps that opened the beat's own action block.\n const [inlineOpenRequest, setInlineOpenRequest] = useState(0)\n\n const handleClick = () => {\n /* eslint-disable no-unused-expressions */\n // Internal opens the block here and skips the host's `onCardClick`; analytics are unchanged.\n if (opensInline) {\n setInlineOpenRequest((count) => count + 1)\n } else {\n onCardClick && onCardClick(beat)\n }\n onEvent(ON_CLICK_EVENT(beat.template), eventProps)\n\n if (beat.template === 'MarketingOffer') {\n const offerBeat = beat as BeatLikeOffer\n posthog?.capture('clicked_messaging_insight', {\n template: beat.template,\n campaign_guid: offerBeat.campaign_guid,\n campaign_name: offerBeat.pulse_campaign_name,\n offer_guid: offerBeat.guid,\n user_guid: offerBeat.user_guid,\n })\n } else {\n posthog?.capture('clicked_insight', {\n beat_guid: beat.guid,\n template: beat.template,\n position: index,\n ...(isV2 && { is_insights_v2: true }),\n })\n }\n }\n\n if (insightRender === 'error') {\n // Keeps the carousel's slot sizing; the error card does not know about it.\n return (\n <Box\n aria-hidden={!isActiveCard}\n aria-label={ariaLabel}\n aria-roledescription=\"slide\"\n ref={ref}\n role=\"group\"\n sx={{\n height: heightOverrides ? '100%' : 120,\n minWidth: microCardMinWidth(widthOverrides),\n my: 1,\n }}\n >\n <InsightErrorCard beat={beat} />\n </Box>\n )\n }\n\n if (v2Payload) {\n // Figma (Micro Widget | Large Transaction) is the legacy micro card's layout fed from the envelope:\n // the slot's logo on the left (merchant, or the category without one), title, description, and the\n // primary CTA as a link. The logo falls back to the insight glyph when the slot carries none.\n // ditto ≥ 1.4.3 words micro's action as in_description_cta instead of primary_cta; either way\n // the label stays the card's tap (`micro-carousel/cta`), never a drawer.\n // A block with no usable row logo may name a status icon instead (account_block `minimal`:\n // `ICO-error`), drawn in the legacy card's tinted tile (Figma Micro | Low Account Balance).\n // The status tile takes the palette the slot names (Payday's on-track check is `success.main`),\n // falling back to error. `||` on the label: the copy may send the primary label as \"\".\n // Answered (mirrors the full card): reviewed title, icon and the Undo label. Display only: the card\n // and its label tap go to the host, which opens the insight with its block; nothing runs here.\n const renderCard = ({ presentation }: MicroCtaStatus) => {\n const answered = presentation?.kind === 'status' ? presentation : undefined\n const { data } = v2Payload.instance_slot\n const rowLogo = asLogoRef(slot(data, 'logo'))\n // The reviewed icon once answered, else the icon: whichever names a status icon first.\n const statusIcon = [answered ? slot(data, 'reviewed_icon') : undefined, slot(data, 'icon')]\n .map(asLogoRef)\n .find((ref) => statusIconName(ref?.guid))\n // An `ICO-` row logo is an icon, not an entity logo: it takes the same tinted tile (Figma Micro\n // Card) and wins over the status icon, as a row logo always has. The no-colour defaults differ\n // on purpose: a row icon with none is decorative (primary), a status icon with none is an error.\n const rowIconName = statusIconName(rowLogo?.guid)\n const tileColor = rowIconName ? rowLogo?.color || 'primary.main' : statusIcon?.color\n const tileName = rowIconName ?? statusIconName(statusIcon?.guid)\n const tilePalette = statusIconPalette(tileColor)\n // A non-status icon (`primary.main`, `chart.*`) tints the tile in its own colour.\n const tileAccent = statusIconAccentColor(theme.palette, tileColor)\n const actionLabel = presentation\n ? answered?.action?.label\n : v2Payload.primary_cta?.label || v2Payload.in_description_cta?.label || undefined\n const handleHostClick = () => {\n onCardClick && onCardClick(beat)\n onEvent(ON_CLICK_EVENT(beat.template), eventProps)\n posthog?.capture('clicked_insight', {\n beat_guid: beat.guid,\n template: beat.template,\n position: index,\n ...(isV2 && { is_insights_v2: true }),\n })\n }\n\n const card = (\n <MicroCardTemplate\n aria-roledescription=\"slide\"\n ariaLabel={ariaLabel}\n description={v2Payload.description.html_text}\n elevation={elevation}\n heightOverrides={heightOverrides}\n icon={\n showIcon &&\n (isLogoGuid(rowLogo?.guid) && !rowIconName ? (\n <LogoFromGuid logo={rowLogo} size={ICON_SIZE} />\n ) : tileName ? (\n <BeatMaterialIcon\n bgColor={alpha(tileAccent ?? theme.palette[tilePalette].main, 0.15)}\n iconColor={tileAccent ? 'inherit' : tilePalette}\n name={tileName}\n sx={tileAccent ? { color: tileAccent } : undefined}\n />\n ) : (\n <BeatMaterialIcon\n bgColor={alpha(theme.palette.primary.main, 0.15)}\n name=\"lightbulb\"\n />\n ))\n }\n isActiveCard={isActiveCard}\n isInsightsV2={true}\n onCardClick={presentation ? handleHostClick : handleClick}\n onPrimaryAction={presentation ? handleHostClick : handleClick}\n primaryActionText={actionLabel}\n ref={ref}\n title={presentation?.title || v2Payload.title || ''}\n variant={variant}\n widthOverrides={widthOverrides}\n />\n )\n\n if (!opensInline) return card\n\n return (\n <>\n {card}\n {/* Nothing renders until the first tap. */}\n {inlineOpenRequest > 0 && (\n <InlineActionBlock\n beat={beat as Beat}\n openRequest={inlineOpenRequest}\n posthog={posthog}\n />\n )}\n </>\n )\n }\n\n return (\n <MicroCtaStatusGate beat={beat as Beat} posthog={posthog}>\n {renderCard}\n </MicroCtaStatusGate>\n )\n }\n\n return (\n <MicroCardTemplate\n aria-roledescription=\"slide\"\n ariaLabel={ariaLabel}\n description={\n beat?.html_micro_description && beat?.html_micro_description.length > 0\n ? beat.html_micro_description\n : beat.html_description || ''\n }\n elevation={elevation}\n heightOverrides={heightOverrides}\n icon={showIcon && <BeatIcon beat={beat} />}\n isActiveCard={isActiveCard}\n onCardClick={handleClick}\n onPrimaryAction={handleClick}\n primaryActionText={beat.micro_call_to_action || cardsCopy?.micro_card_cta}\n ref={ref}\n title={beat.micro_title && beat.micro_title.length > 0 ? beat.micro_title : beat.title}\n variant={variant}\n widthOverrides={widthOverrides}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4CA,IAAa,KAAA,CAA2C,EACtD,WAAA,GACA,MAAA,GACA,WAAA,GACA,0BAAA,IAA2B,YAC3B,OAAA,GACA,cAAA,GACA,aAAA,GACA,SAAA,GACA,gBAAA,GACA,SAAA,GACA,UAAA,GACA,iBAAA,EAAA,MACI;AACJ,QAAM,EAAE,KAAA,GAAK,QAAA,EAAA,IAAW,GAAU,EAChC,WAAA,EACF,CAAC,GAEK,IAAQ,GAAS,GAGjB,EAAE,WAAA,EAAA,IAAc,GAAa,GAC7B,EAAE,SAAA,EAAA,IAAY,GAAS,GACvB,EAAE,YAAA,GAAY,aAAA,EAAA,IAAgB,GAA4B,GAE1D,IAAO,oBAAoB,KAAQ,EAAK,gBACxC,IAAa,IAAO,EAAE,UAAU,EAAE,gBAAgB,GAAK,EAAE,IAAI;AAGnE,EAAA,EAAA,MAAgB;AACd,IAAI,MACG,EAAK,qBAcR,EAAQ,GAAc,EAAK,QAAQ,GAAG,CAAU,KAb5C,EAAK,KAAK,WAAW,KAAK,IAC5B,EAAY;AAAA,MACV,GAAG;AAAA,MACH,oBAAoB;AAAA,IACtB,CAAC,IAED,EAAW;AAAA,MACT,GAAG;AAAA,MACH,oBAAoB;AAAA,IACtB,CAAC,GAEH,EAAQ,GAAyB,EAAK,QAAQ,GAAG,CAAU;AAAA,EAKjE,GAAG,CAAC,CAAM,CAAC,GAEX,EAAA,MAAgB;AACd,QAAI,K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AAA,IACjB,MAAM,KAAY,gBAAA,EAAC,IAAD,EAAgB,MAAA,EAAO,CAAA;AAAA,IAC3B,cAAA;AAAA,IACd,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,mBAAmB,EAAK,wBAAwB,GAAW;AAAA,IACtD,KAAA;AAAA,IACL,OAAO,EAAK,eAAe,EAAK,YAAY,SAAS,IAAI,EAAK,cAAc,EAAK;AAAA,IACxE,SAAA;AAAA,IACO,gBAAA;AAAA,EACjB,CAAA;AAEL"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "9.7.139",
3
+ "version": "9.7.140",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",