@mx-cartographer/experiences 9.7.52 → 9.7.53

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,9 @@
1
+ ## [9.7.53] - 10-27-2026
2
+
3
+ - **ADDED** - Switch Direct Deposit on Insights 2.0 (WEC-2134): fixtures from tupac's real envelopes, one per widget and state (`SwitchDirectDeposit_<state>_<widget>` in `AccountSwitchBlockPayload.json`, `switchBeats` and friends in `AccountSwitchBlockBeats.ts`), the `InsightsV2/Insights/SwitchDirectDeposit` story and `SwitchDirectDepositContract.test.tsx`. It pins that the pending card draws both logos on `account_switch_block` (and omits a missing one), the complete card is the held account's tile on `direct_deposit_block`, embedded draws both logos and no action link (an open point), micro (the micro card) the held logo and the Atomic action, and the "Not Now" survey names the account from `instance_slot.data.account_name`
4
+ - **FIXED** - The client-configured in-description link (custom copy) on an Insights 2.0 card did nothing when clicked (WEC-2119). It now posts `client_configured_cta` with the beat's template, or on a mobile webview navigates through the client's webview scheme with the template and `user_guid`, and it shows `html_in_description_cta` as its label when `in_description_cta` is empty, as the legacy link does. Applies to every Insights 2.0 beat, Set Up Direct Deposit and Switch Direct Deposit included; the envelope's own link, which opens a drawer, is unchanged
5
+ - **ADDED** - `sendClientConfiguredCta(template, options)` in `common/utils/PostMessage`: the webview-aware sender for the client-configured link, modelled on `sendBeatCta` (WEC-2119)
6
+
1
7
  ## [9.7.52] - 10-27-2026
2
8
 
3
9
  - **ADDED** - `merchant_block` component block: the Merchant card (WEC-1303 single, WEC-1305 multi) registered for Insights 2.0. The architecture doc's seven variants (`single_standard`, `single_large`, `single_success`, `single_error`, `multiple_standard`, `multiple_success`, `multiple_error`) render the existing `MerchantHighlightCard` or `LogoClusterCard` from `instance_slot.data` (`merchant_name`, `logo`, `amount`, `date`, `status_text`, `logos`), falling back to the flat slot fields. No logo guid draws a storefront tile, a zero or missing amount draws no figure, a missing merchant name draws no card, and an unknown variant degrades to `single_standard`. Fixtures, stories and tests (MEW2-3372)
@@ -63,3 +63,17 @@ export interface SendBeatCtaOptions {
63
63
  * Pulse's `postMessages` epic (minus the RxJS buffering).
64
64
  */
65
65
  export declare function sendBeatCta(beat: BeatCtaSource, { isMobileWebview, webviewScheme, userGuid, op, event, extras }?: SendBeatCtaOptions): void;
66
+ export declare const CLIENT_CONFIGURED_CTA_EVENT = "client_configured_cta";
67
+ export interface SendClientConfiguredCtaOptions {
68
+ isMobileWebview?: boolean;
69
+ /** Custom URL scheme for webview navigation (from client config). */
70
+ webviewScheme?: string;
71
+ /** Added to the webview metadata, as the Pulse epic does. */
72
+ userGuid?: string;
73
+ }
74
+ /**
75
+ * Tell the host a client-configured in-description link (custom copy) was clicked. On web it posts
76
+ * `mx/pulse/client_configured_cta` with the template; a native webview cannot receive that, so it
77
+ * navigates to the scheme URL, as Pulse's PostMessage epic does for the legacy beat.
78
+ */
79
+ export declare function sendClientConfiguredCta(template: string, { isMobileWebview, webviewScheme, userGuid }?: SendClientConfiguredCtaOptions): boolean;
@@ -1,64 +1,73 @@
1
- function f() {
1
+ function l() {
2
2
  return window.opener && window.opener.location ? window.opener.location.toString() : document.referrer;
3
3
  }
4
4
  function a(e) {
5
- const n = f().replace(/([^:]+:\/\/[^\/]+).*/, "$1"), t = window.parent || window.opener || !1;
5
+ const n = l().replace(/([^:]+:\/\/[^\/]+).*/, "$1"), t = window.parent || window.opener || !1;
6
6
  return t && t.postMessage && n ? (t.postMessage(e, n), !0) : !1;
7
7
  }
8
- function T(e) {
8
+ function E(e) {
9
9
  return a({
10
10
  metadata: { beat_guid: e },
11
11
  mx: !0,
12
12
  type: "mx/moneyDashboard/insightOnTransaction"
13
13
  });
14
14
  }
15
- function y(e) {
15
+ function g(e) {
16
16
  return a({
17
17
  metadata: { template: e },
18
18
  mx: !0,
19
19
  type: "mx/pulse/client_configured_cta"
20
20
  });
21
21
  }
22
- var l = "beat/cta", g = "op_1", x = "op_2";
23
- function w(e, n = g) {
22
+ var _ = "beat/cta", w = "op_1", y = "op_2";
23
+ function m(e, n = w) {
24
24
  const t = {
25
25
  action: n,
26
26
  beat_guid: e.guid,
27
27
  beat_template: e.template
28
28
  };
29
- return e?.payload?.action_string && (t.action_string = e.payload.action_string), [l, t];
29
+ return e?.payload?.action_string && (t.action_string = e.payload.action_string), [_, t];
30
30
  }
31
- function m(e, n, t = "mx/pulse") {
31
+ function C(e, n, t = "mx/pulse") {
32
32
  return window.self === window.top ? !1 : a({
33
33
  metadata: n,
34
34
  mx: !0,
35
35
  type: `${t}/${e}`
36
36
  });
37
37
  }
38
- function _(e, n, t = "mx") {
38
+ function s(e, n, t = "mx") {
39
39
  let o = `${t}://pulse/${e}`;
40
40
  n && (o += "?metadata=" + encodeURIComponent(JSON.stringify(n))), window.location.href = o;
41
41
  }
42
- function E(e, { isMobileWebview: n, webviewScheme: t, userGuid: o, op: s, event: u, extras: c } = {}) {
43
- const [d, p] = w(e, s), r = {
42
+ function v(e, { isMobileWebview: n, webviewScheme: t, userGuid: o, op: u, event: c, extras: d } = {}) {
43
+ const [f, p] = m(e, u), r = {
44
44
  ...p,
45
45
  ...o ? { user_guid: o } : {},
46
- ...c
47
- }, i = u || d;
48
- n ? _(i, r, t) : m(i, r);
46
+ ...d
47
+ }, i = c || f;
48
+ n ? s(i, r, t) : C(i, r);
49
+ }
50
+ var T = "client_configured_cta";
51
+ function x(e, { isMobileWebview: n, webviewScheme: t, userGuid: o } = {}) {
52
+ return n ? (s(T, {
53
+ template: e,
54
+ ...o ? { user_guid: o } : {}
55
+ }, t), !0) : g(e);
49
56
  }
50
57
  export {
51
- l as BEAT_CTA_EVENT,
52
- g as BEAT_OPERATION_1,
53
- x as BEAT_OPERATION_2,
54
- w as getBaseCtaPostMessage,
55
- f as getReferrer,
56
- y as postClientConfiguredCta,
57
- T as postInsightOnTransaction,
58
+ _ as BEAT_CTA_EVENT,
59
+ w as BEAT_OPERATION_1,
60
+ y as BEAT_OPERATION_2,
61
+ T as CLIENT_CONFIGURED_CTA_EVENT,
62
+ m as getBaseCtaPostMessage,
63
+ l as getReferrer,
64
+ g as postClientConfiguredCta,
65
+ E as postInsightOnTransaction,
58
66
  a as postMessageToParent,
59
- E as sendBeatCta,
60
- m as sendBeatPostMessage,
61
- _ as setWebviewURL
67
+ v as sendBeatCta,
68
+ C as sendBeatPostMessage,
69
+ x as sendClientConfiguredCta,
70
+ s as setWebviewURL
62
71
  };
63
72
 
64
73
  //# sourceMappingURL=PostMessage.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PostMessage.es.js","names":[],"sources":["../../../src/common/utils/PostMessage.ts"],"sourcesContent":["export function getReferrer(): string {\n if (window.opener && window.opener.location) {\n return window.opener.location.toString()\n } else {\n return document.referrer\n }\n}\n\nexport interface PostMessageData {\n metadata?: Record<string, any>\n mx: boolean\n type: string\n [key: string]: any\n}\n\nexport function postMessageToParent(message: PostMessageData): boolean {\n const postUrl = getReferrer().replace(/([^:]+:\\/\\/[^\\/]+).*/, '$1') // eslint-disable-line\n const otherWindow = window.parent || window.opener || false\n\n if (otherWindow && otherWindow.postMessage && postUrl) {\n otherWindow.postMessage(message, postUrl)\n return true\n }\n\n return false\n}\n\nexport function postInsightOnTransaction(beatGuid: string): boolean {\n const message: PostMessageData = {\n metadata: { beat_guid: beatGuid },\n mx: true,\n type: 'mx/moneyDashboard/insightOnTransaction',\n }\n\n return postMessageToParent(message)\n}\n\nexport function postClientConfiguredCta(template: string): boolean {\n const message: PostMessageData = {\n metadata: { template: template },\n mx: true,\n type: 'mx/pulse/client_configured_cta',\n }\n\n return postMessageToParent(message)\n}\n\n// ============================================================================\n// Beat CTA post messages (ported from Pulse: src/utils/PostMessage.js +\n// src/constants/PostMessage.js + src/epics/PostMessage.js).\n//\n// Scope: currently only the Save an extra $100 beat uses this. When a beat CTA\n// has no drilldown drawer, clicking it notifies the host app via a beat/cta\n// post message instead of opening a drawer. Native (mobile webview) hosts can't\n// receive post messages, so we navigate the webview to a custom-scheme URL.\n// ============================================================================\n\nexport const BEAT_CTA_EVENT = 'beat/cta'\nexport const BEAT_OPERATION_1 = 'op_1'\nexport const BEAT_OPERATION_2 = 'op_2'\nexport const BEAT_OPERATION_3 = 'op_3'\n\n/** Minimal beat shape needed to build a CTA post message. */\nexport interface BeatCtaSource {\n guid: string\n template: string\n payload?: { action_string?: string } | null\n}\n\nexport interface BeatCtaPayload {\n action: string\n beat_guid: string\n beat_template: string\n action_string?: string\n [key: string]: unknown\n}\n\n/**\n * Build the `[event, payload]` tuple for a beat CTA post message.\n * Mirrors Pulse's `getBaseCtaPostMessage`.\n */\nexport function getBaseCtaPostMessage(\n beat: BeatCtaSource,\n op: string = BEAT_OPERATION_1,\n): [string, BeatCtaPayload] {\n const payload: BeatCtaPayload = {\n action: op,\n beat_guid: beat.guid,\n beat_template: beat.template,\n }\n\n if (beat?.payload?.action_string) {\n payload.action_string = beat.payload.action_string\n }\n\n return [BEAT_CTA_EVENT, payload]\n}\n\n/**\n * Send a beat post message to the parent window. Only posts when embedded in an\n * iframe (`window.self !== window.top`), mirroring Pulse's `sendPostMessage`\n * (default scheme `mx/pulse`). Returns false when not embedded or no target.\n */\nexport function sendBeatPostMessage(\n event: string,\n data: Record<string, unknown>,\n scheme = 'mx/pulse',\n): boolean {\n if (window.self === window.top) {\n return false\n }\n\n const message: PostMessageData = {\n metadata: data,\n mx: true,\n type: `${scheme}/${event}`,\n }\n\n return postMessageToParent(message)\n}\n\n/**\n * Navigate a mobile webview to a custom-scheme URL instead of posting a message.\n * Mirrors Pulse's `setWebviewURL` (default scheme `mx`).\n */\nexport function setWebviewURL(event: string, data?: Record<string, unknown>, scheme = 'mx'): void {\n let webviewUrl = `${scheme}://pulse/${event}`\n\n if (data) {\n webviewUrl += '?metadata=' + encodeURIComponent(JSON.stringify(data))\n }\n\n window.location.href = webviewUrl\n}\n\nexport interface SendBeatCtaOptions {\n /** True when running inside a native mobile webview. */\n isMobileWebview?: boolean\n /** Custom URL scheme for webview navigation (from client config). */\n webviewScheme?: string\n /** Current user guid, added to the metadata like the Pulse epic does. */\n userGuid?: string\n /** Operation string sent with the CTA (defaults to op_1). */\n op?: string\n /** Post message event name (defaults to `beat/cta`). */\n event?: string\n /** Beat-specific fields merged into the metadata after the base payload and `user_guid`. */\n extras?: Record<string, unknown>\n}\n\n/**\n * Send a beat CTA to the host: builds the payload, adds `user_guid`, then either\n * posts a message to the host or navigates the webview. Mirrors the behaviour of\n * Pulse's `postMessages` epic (minus the RxJS buffering).\n */\nexport function sendBeatCta(\n beat: BeatCtaSource,\n { isMobileWebview, webviewScheme, userGuid, op, event, extras }: SendBeatCtaOptions = {},\n): void {\n const [defaultEvent, basePayload] = getBaseCtaPostMessage(beat, op)\n const metadata: BeatCtaPayload = {\n ...basePayload,\n ...(userGuid ? { user_guid: userGuid } : {}),\n ...extras,\n }\n const eventName = event || defaultEvent\n\n if (isMobileWebview) {\n setWebviewURL(eventName, metadata, webviewScheme)\n } else {\n sendBeatPostMessage(eventName, metadata)\n }\n}\n"],"mappings":"AAAA,SAAgB,IAAsB;AACpC,SAAI,OAAO,UAAU,OAAO,OAAO,WAC1B,OAAO,OAAO,SAAS,SAAS,IAEhC,SAAS;AAEpB;AASA,SAAgB,EAAoB,GAAmC;AACrE,QAAM,IAAU,EAAY,EAAE,QAAQ,wBAAwB,IAAI,GAC5D,IAAc,OAAO,UAAU,OAAO,UAAU;AAEtD,SAAI,KAAe,EAAY,eAAe,KAC5C,EAAY,YAAY,GAAS,CAAO,GACjC,MAGF;AACT;AAEA,SAAgB,EAAyB,GAA2B;AAOlE,SAAO,EAAoB;AAAA,IALzB,UAAU,EAAE,WAAW,EAAS;AAAA,IAChC,IAAI;AAAA,IACJ,MAAM;AAAA,EAGmB,CAAO;AACpC;AAEA,SAAgB,EAAwB,GAA2B;AAOjE,SAAO,EAAoB;AAAA,IALzB,UAAU,EAAY,UAAA,EAAS;AAAA,IAC/B,IAAI;AAAA,IACJ,MAAM;AAAA,EAGmB,CAAO;AACpC;AAYA,IAAa,IAAiB,YACjB,IAAmB,QACnB,IAAmB;AAsBhC,SAAgB,EACd,GACA,IAAa,GACa;AAC1B,QAAM,IAA0B;AAAA,IAC9B,QAAQ;AAAA,IACR,WAAW,EAAK;AAAA,IAChB,eAAe,EAAK;AAAA,EACtB;AAEA,SAAI,GAAM,SAAS,kBACjB,EAAQ,gBAAgB,EAAK,QAAQ,gBAGhC,CAAC,GAAgB,CAAO;AACjC;AAOA,SAAgB,EACd,GACA,GACA,IAAS,YACA;AACT,SAAI,OAAO,SAAS,OAAO,MAClB,KASF,EAAoB;AAAA,IALzB,UAAU;AAAA,IACV,IAAI;AAAA,IACJ,MAAM,GAAG,CAAA,IAAU,CAAA;AAAA,EAGM,CAAO;AACpC;AAMA,SAAgB,EAAc,GAAe,GAAgC,IAAS,MAAY;AAChG,MAAI,IAAa,GAAG,CAAA,YAAkB,CAAA;AAEtC,EAAI,MACF,KAAc,eAAe,mBAAmB,KAAK,UAAU,CAAI,CAAC,IAGtE,OAAO,SAAS,OAAO;AACzB;AAsBA,SAAgB,EACd,GACA,EAAE,iBAAA,GAAiB,eAAA,GAAe,UAAA,GAAU,IAAA,GAAI,OAAA,GAAO,QAAA,EAAA,IAA+B,CAAC,GACjF;AACN,QAAM,CAAC,GAAc,CAAA,IAAe,EAAsB,GAAM,CAAE,GAC5D,IAA2B;AAAA,IAC/B,GAAG;AAAA,IACH,GAAI,IAAW,EAAE,WAAW,EAAS,IAAI,CAAC;AAAA,IAC1C,GAAG;AAAA,EACL,GACM,IAAY,KAAS;AAE3B,EAAI,IACF,EAAc,GAAW,GAAU,CAAa,IAEhD,EAAoB,GAAW,CAAQ;AAE3C"}
1
+ {"version":3,"file":"PostMessage.es.js","names":[],"sources":["../../../src/common/utils/PostMessage.ts"],"sourcesContent":["export function getReferrer(): string {\n if (window.opener && window.opener.location) {\n return window.opener.location.toString()\n } else {\n return document.referrer\n }\n}\n\nexport interface PostMessageData {\n metadata?: Record<string, any>\n mx: boolean\n type: string\n [key: string]: any\n}\n\nexport function postMessageToParent(message: PostMessageData): boolean {\n const postUrl = getReferrer().replace(/([^:]+:\\/\\/[^\\/]+).*/, '$1') // eslint-disable-line\n const otherWindow = window.parent || window.opener || false\n\n if (otherWindow && otherWindow.postMessage && postUrl) {\n otherWindow.postMessage(message, postUrl)\n return true\n }\n\n return false\n}\n\nexport function postInsightOnTransaction(beatGuid: string): boolean {\n const message: PostMessageData = {\n metadata: { beat_guid: beatGuid },\n mx: true,\n type: 'mx/moneyDashboard/insightOnTransaction',\n }\n\n return postMessageToParent(message)\n}\n\nexport function postClientConfiguredCta(template: string): boolean {\n const message: PostMessageData = {\n metadata: { template: template },\n mx: true,\n type: 'mx/pulse/client_configured_cta',\n }\n\n return postMessageToParent(message)\n}\n\n// ============================================================================\n// Beat CTA post messages (ported from Pulse: src/utils/PostMessage.js +\n// src/constants/PostMessage.js + src/epics/PostMessage.js).\n//\n// Scope: currently only the Save an extra $100 beat uses this. When a beat CTA\n// has no drilldown drawer, clicking it notifies the host app via a beat/cta\n// post message instead of opening a drawer. Native (mobile webview) hosts can't\n// receive post messages, so we navigate the webview to a custom-scheme URL.\n// ============================================================================\n\nexport const BEAT_CTA_EVENT = 'beat/cta'\nexport const BEAT_OPERATION_1 = 'op_1'\nexport const BEAT_OPERATION_2 = 'op_2'\nexport const BEAT_OPERATION_3 = 'op_3'\n\n/** Minimal beat shape needed to build a CTA post message. */\nexport interface BeatCtaSource {\n guid: string\n template: string\n payload?: { action_string?: string } | null\n}\n\nexport interface BeatCtaPayload {\n action: string\n beat_guid: string\n beat_template: string\n action_string?: string\n [key: string]: unknown\n}\n\n/**\n * Build the `[event, payload]` tuple for a beat CTA post message.\n * Mirrors Pulse's `getBaseCtaPostMessage`.\n */\nexport function getBaseCtaPostMessage(\n beat: BeatCtaSource,\n op: string = BEAT_OPERATION_1,\n): [string, BeatCtaPayload] {\n const payload: BeatCtaPayload = {\n action: op,\n beat_guid: beat.guid,\n beat_template: beat.template,\n }\n\n if (beat?.payload?.action_string) {\n payload.action_string = beat.payload.action_string\n }\n\n return [BEAT_CTA_EVENT, payload]\n}\n\n/**\n * Send a beat post message to the parent window. Only posts when embedded in an\n * iframe (`window.self !== window.top`), mirroring Pulse's `sendPostMessage`\n * (default scheme `mx/pulse`). Returns false when not embedded or no target.\n */\nexport function sendBeatPostMessage(\n event: string,\n data: Record<string, unknown>,\n scheme = 'mx/pulse',\n): boolean {\n if (window.self === window.top) {\n return false\n }\n\n const message: PostMessageData = {\n metadata: data,\n mx: true,\n type: `${scheme}/${event}`,\n }\n\n return postMessageToParent(message)\n}\n\n/**\n * Navigate a mobile webview to a custom-scheme URL instead of posting a message.\n * Mirrors Pulse's `setWebviewURL` (default scheme `mx`).\n */\nexport function setWebviewURL(event: string, data?: Record<string, unknown>, scheme = 'mx'): void {\n let webviewUrl = `${scheme}://pulse/${event}`\n\n if (data) {\n webviewUrl += '?metadata=' + encodeURIComponent(JSON.stringify(data))\n }\n\n window.location.href = webviewUrl\n}\n\nexport interface SendBeatCtaOptions {\n /** True when running inside a native mobile webview. */\n isMobileWebview?: boolean\n /** Custom URL scheme for webview navigation (from client config). */\n webviewScheme?: string\n /** Current user guid, added to the metadata like the Pulse epic does. */\n userGuid?: string\n /** Operation string sent with the CTA (defaults to op_1). */\n op?: string\n /** Post message event name (defaults to `beat/cta`). */\n event?: string\n /** Beat-specific fields merged into the metadata after the base payload and `user_guid`. */\n extras?: Record<string, unknown>\n}\n\n/**\n * Send a beat CTA to the host: builds the payload, adds `user_guid`, then either\n * posts a message to the host or navigates the webview. Mirrors the behaviour of\n * Pulse's `postMessages` epic (minus the RxJS buffering).\n */\nexport function sendBeatCta(\n beat: BeatCtaSource,\n { isMobileWebview, webviewScheme, userGuid, op, event, extras }: SendBeatCtaOptions = {},\n): void {\n const [defaultEvent, basePayload] = getBaseCtaPostMessage(beat, op)\n const metadata: BeatCtaPayload = {\n ...basePayload,\n ...(userGuid ? { user_guid: userGuid } : {}),\n ...extras,\n }\n const eventName = event || defaultEvent\n\n if (isMobileWebview) {\n setWebviewURL(eventName, metadata, webviewScheme)\n } else {\n sendBeatPostMessage(eventName, metadata)\n }\n}\n\nexport const CLIENT_CONFIGURED_CTA_EVENT = 'client_configured_cta'\n\nexport interface SendClientConfiguredCtaOptions {\n isMobileWebview?: boolean\n /** Custom URL scheme for webview navigation (from client config). */\n webviewScheme?: string\n /** Added to the webview metadata, as the Pulse epic does. */\n userGuid?: string\n}\n\n/**\n * Tell the host a client-configured in-description link (custom copy) was clicked. On web it posts\n * `mx/pulse/client_configured_cta` with the template; a native webview cannot receive that, so it\n * navigates to the scheme URL, as Pulse's PostMessage epic does for the legacy beat.\n */\nexport function sendClientConfiguredCta(\n template: string,\n { isMobileWebview, webviewScheme, userGuid }: SendClientConfiguredCtaOptions = {},\n): boolean {\n if (!isMobileWebview) return postClientConfiguredCta(template)\n\n setWebviewURL(\n CLIENT_CONFIGURED_CTA_EVENT,\n { template, ...(userGuid ? { user_guid: userGuid } : {}) },\n webviewScheme,\n )\n\n return true\n}\n"],"mappings":"AAAA,SAAgB,IAAsB;AACpC,SAAI,OAAO,UAAU,OAAO,OAAO,WAC1B,OAAO,OAAO,SAAS,SAAS,IAEhC,SAAS;AAEpB;AASA,SAAgB,EAAoB,GAAmC;AACrE,QAAM,IAAU,EAAY,EAAE,QAAQ,wBAAwB,IAAI,GAC5D,IAAc,OAAO,UAAU,OAAO,UAAU;AAEtD,SAAI,KAAe,EAAY,eAAe,KAC5C,EAAY,YAAY,GAAS,CAAO,GACjC,MAGF;AACT;AAEA,SAAgB,EAAyB,GAA2B;AAOlE,SAAO,EAAoB;AAAA,IALzB,UAAU,EAAE,WAAW,EAAS;AAAA,IAChC,IAAI;AAAA,IACJ,MAAM;AAAA,EAGmB,CAAO;AACpC;AAEA,SAAgB,EAAwB,GAA2B;AAOjE,SAAO,EAAoB;AAAA,IALzB,UAAU,EAAY,UAAA,EAAS;AAAA,IAC/B,IAAI;AAAA,IACJ,MAAM;AAA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AE,WAAW,EAAS,IAAI,CAAC;AAAA,EAAG,GACzD,CACF,GAEO,MARsB,EAAwB,CAAQ;AAS/D"}
@@ -1,32 +1,33 @@
1
- import { useAppConfig as U, useGlobalCopyStore as j, useGlobalStore as z, useInsightsV2Store as K } from "../../common/context/hooks.es.js";
2
- import { BeatActionsProvider as X } from "../beatActions.es.js";
3
- import { isContactSupportCtaDisabled as W } from "../actionBlocks/ContactSupportActionBlock.es.js";
4
- import { reportCtaClick as Y } from "../ctaActions/runCtaAction.es.js";
5
- import { useBeatCtaActions as $ } from "../ctaActions/useCtaAction.es.js";
6
- import { actionBlocksKey as q } from "../mappings/actionBlocksKey.es.js";
7
- import { logoFromRef as J } from "./shared/EntityLogo.es.js";
8
- import Q from "./FeedbackDialog.es.js";
9
- import { ErrorCard as Z } from "./ErrorCard.es.js";
10
- import { blocks as oo } from "../mappings/blocks.es.js";
11
- import { ActionBlockLayer as to } from "../actionBlocks/ActionBlockLayer.es.js";
12
- import io from "./Footer.es.js";
13
- import eo from "./Header.es.js";
14
- import { FeedbackBar as ro } from "./FeedbackBar.es.js";
15
- import { DismissInsightDialog as so } from "./DismissInsightDialog.es.js";
16
- import { HiddenConfirmationCard as no } from "./HiddenConfirmationCard.es.js";
17
- import { LoadingCard as ao } from "./LoadingCard.es.js";
18
- import { ObsolesceBanner as lo } from "./ObsolesceBanner.es.js";
19
- import { useBeatFeedbackFlow as co } from "../hooks/useBeatFeedbackFlow.es.js";
20
- import { useMemo as po } from "react";
21
- import { observer as mo } from "mobx-react-lite";
22
- import g from "@mui/material/Stack";
23
- import { P as fo } from "@mxenabled/mxui";
24
- import l from "@mui/material/Button";
1
+ import { useAppConfig as z, useGlobalCopyStore as K, useGlobalStore as W, useInsightsV2Store as X } from "../../common/context/hooks.es.js";
2
+ import { sendClientConfiguredCta as Y } from "../../common/utils/PostMessage.es.js";
3
+ import { BeatActionsProvider as $ } from "../beatActions.es.js";
4
+ import { isContactSupportCtaDisabled as q } from "../actionBlocks/ContactSupportActionBlock.es.js";
5
+ import { reportCtaClick as J } from "../ctaActions/runCtaAction.es.js";
6
+ import { useBeatCtaActions as Q } from "../ctaActions/useCtaAction.es.js";
7
+ import { actionBlocksKey as Z } from "../mappings/actionBlocksKey.es.js";
8
+ import { logoFromRef as oo } from "./shared/EntityLogo.es.js";
9
+ import eo from "./FeedbackDialog.es.js";
10
+ import { ErrorCard as io } from "./ErrorCard.es.js";
11
+ import { blocks as to } from "../mappings/blocks.es.js";
12
+ import { ActionBlockLayer as ro } from "../actionBlocks/ActionBlockLayer.es.js";
13
+ import no from "./Footer.es.js";
14
+ import so from "./Header.es.js";
15
+ import { FeedbackBar as ao } from "./FeedbackBar.es.js";
16
+ import { DismissInsightDialog as lo } from "./DismissInsightDialog.es.js";
17
+ import { HiddenConfirmationCard as co } from "./HiddenConfirmationCard.es.js";
18
+ import { LoadingCard as mo } from "./LoadingCard.es.js";
19
+ import { ObsolesceBanner as po } from "./ObsolesceBanner.es.js";
20
+ import { useBeatFeedbackFlow as uo } from "../hooks/useBeatFeedbackFlow.es.js";
21
+ import { useMemo as fo } from "react";
22
+ import { observer as Co } from "mobx-react-lite";
23
+ import y from "@mui/material/Stack";
24
+ import { P as bo } from "@mxenabled/mxui";
25
+ import d from "@mui/material/Button";
25
26
  import { ChevronRight as T } from "@mxenabled/mx-icons";
26
- import { Fragment as uo, jsx as t, jsxs as c } from "react/jsx-runtime";
27
- import bo from "@mui/material/Box";
28
- import Co from "@mui/material/Card";
29
- var ho = {}, yo = {
27
+ import { Fragment as go, jsx as e, jsxs as m } from "react/jsx-runtime";
28
+ import ho from "@mui/material/Box";
29
+ import yo from "@mui/material/Card";
30
+ var _o = {}, ko = {
30
31
  position: "absolute",
31
32
  top: 0,
32
33
  left: 0,
@@ -35,7 +36,7 @@ var ho = {}, yo = {
35
36
  backgroundColor: "background.default",
36
37
  opacity: 0.7,
37
38
  zIndex: 3
38
- }, go = {
39
+ }, vo = {
39
40
  alignItems: "center",
40
41
  alignSelf: "flex-start",
41
42
  display: "flex",
@@ -43,44 +44,51 @@ var ho = {}, yo = {
43
44
  height: 44,
44
45
  px: 2,
45
46
  textTransform: "none"
46
- }, Yo = mo(({ beat: i, beatActions: s = ho, obsolete: f, isLoading: L = !1, isError: O = !1 }) => {
47
- const I = j(), w = K(), { config: A } = U(), o = co(i, s), F = z(), { runCta: E, primary: k, secondary: x } = $(i, s, i.insights_payload?.primary_cta, i.insights_payload?.secondary_cta), d = i.insights_payload?.widget_type === "mini", M = po(() => ({
47
+ }, Qo = Co(({ beat: i, beatActions: s = _o, obsolete: f, isLoading: O = !1, isError: I = !1 }) => {
48
+ const A = K(), F = X(), { config: E } = z(), o = uo(i, s), _ = W(), { runCta: M, primary: k, secondary: v } = Q(i, s, i.insights_payload?.primary_cta, i.insights_payload?.secondary_cta), p = i.insights_payload?.widget_type === "mini", N = fo(() => ({
48
49
  ...o.wrappedActions,
49
50
  beat: i
50
51
  }), [o.wrappedActions, i]);
51
- if (O) return /* @__PURE__ */ t(Z, {});
52
- const e = i.insights_payload;
53
- if (!e || o.cardState === "dismissed") return null;
54
- const { instance_slot: N, primary_cta: r, secondary_cta: n, sub_title: R, title: H, guid: _, dismissed_at: P } = e, { block: V } = N, G = R ?? (e.subtitle ? {
55
- logo: J(e.logo),
56
- text: e.subtitle
57
- } : void 0), p = (m) => W(m, A, s.onContactSupport), v = async (m, y) => {
58
- if (!p(y.block)) {
59
- if (y.block === q.CONTACT_SUPPORT_ACTION_BLOCK) {
60
- Y({
52
+ if (I) return /* @__PURE__ */ e(io, {});
53
+ const t = i.insights_payload;
54
+ if (!t || o.cardState === "dismissed") return null;
55
+ const { instance_slot: R, primary_cta: r, secondary_cta: a, sub_title: G, title: H, guid: x, dismissed_at: P } = t, { block: V } = R, U = G ?? (t.subtitle ? {
56
+ logo: oo(t.logo),
57
+ text: t.subtitle
58
+ } : void 0), u = (n) => q(n, E, s.onContactSupport), S = async (n, c) => {
59
+ if (!u(c.block)) {
60
+ if (c.block === Z.CONTACT_SUPPORT_ACTION_BLOCK) {
61
+ J({
61
62
  beat: i,
62
- stores: F,
63
+ stores: _,
63
64
  hostActions: s,
64
- slot: m
65
+ slot: n
65
66
  }), s.onContactSupport?.();
66
67
  return;
67
68
  }
68
- await E(m, y);
69
+ await M(n, c);
69
70
  }
70
- }, S = oo[V], a = e.in_description_cta, u = !d && a?.label && a.block ? a : void 0, b = r?.label || (u ? void 0 : a?.label) || void 0, B = !d && !!r?.label, D = !d && !!n?.label, C = I.insights_feed?.general, h = f?.state === "not_refreshable" && !P && !!C;
71
- return /* @__PURE__ */ t(X, {
72
- value: M,
73
- children: /* @__PURE__ */ c(g, {
71
+ }, w = to[V], l = t.in_description_cta, C = !p && l?.label && l.block ? l : void 0, b = r?.label || (C ? void 0 : l?.label) || void 0, B = !p && !!r?.label, D = i.in_description_cta || i.html_in_description_cta, j = () => {
72
+ const { is_mobile_webview: n, clientConfig: c } = _.appDataStore.appConfig;
73
+ Y(i.template, {
74
+ isMobileWebview: n,
75
+ webviewScheme: c?.master?.ui_message_webview_url_scheme,
76
+ userGuid: t.user_guid ?? i.user_guid
77
+ });
78
+ }, L = !p && !!a?.label, g = A.insights_feed?.general, h = f?.state === "not_refreshable" && !P && !!g;
79
+ return /* @__PURE__ */ e($, {
80
+ value: N,
81
+ children: /* @__PURE__ */ m(y, {
74
82
  sx: { mb: 16 },
75
83
  children: [
76
- o.cardState === "confirming" ? /* @__PURE__ */ t(no, {
84
+ o.cardState === "confirming" ? /* @__PURE__ */ e(co, {
77
85
  onClose: o.collapseConfirmation,
78
86
  onLeaveFeedback: o.openHideSurvey,
79
87
  onUndo: o.undoDismiss
80
- }) : /* @__PURE__ */ c(uo, { children: [f && C && /* @__PURE__ */ t(lo, {
88
+ }) : /* @__PURE__ */ m(go, { children: [f && g && /* @__PURE__ */ e(po, {
81
89
  ...f,
82
- copy: C
83
- }), /* @__PURE__ */ c(Co, {
90
+ copy: g
91
+ }), /* @__PURE__ */ m(yo, {
84
92
  inert: h,
85
93
  sx: { ...h && {
86
94
  position: "relative",
@@ -88,17 +96,17 @@ var ho = {}, yo = {
88
96
  pointerEvents: "none"
89
97
  } },
90
98
  children: [
91
- h && /* @__PURE__ */ t(bo, { sx: yo }),
92
- /* @__PURE__ */ t(eo, {
93
- isMini: d,
94
- subtitle: G,
99
+ h && /* @__PURE__ */ e(ho, { sx: ko }),
100
+ /* @__PURE__ */ e(so, {
101
+ isMini: p,
102
+ subtitle: U,
95
103
  title: H ?? ""
96
104
  }),
97
- L ? /* @__PURE__ */ t(ao, {}) : S && /* @__PURE__ */ t(S, {
98
- beatGuid: _,
99
- payload: e
105
+ O ? /* @__PURE__ */ e(mo, {}) : w && /* @__PURE__ */ e(w, {
106
+ beatGuid: x,
107
+ payload: t
100
108
  }),
101
- /* @__PURE__ */ c(g, {
109
+ /* @__PURE__ */ m(y, {
102
110
  sx: {
103
111
  gap: 6,
104
112
  pb: 16,
@@ -106,14 +114,14 @@ var ho = {}, yo = {
106
114
  px: 16
107
115
  },
108
116
  children: [
109
- /* @__PURE__ */ t(fo, {
110
- dangerouslySetInnerHTML: { __html: e.description.html_text },
117
+ /* @__PURE__ */ e(bo, {
118
+ dangerouslySetInnerHTML: { __html: t.description.html_text },
111
119
  variant: "subtitle2"
112
120
  }),
113
- u && /* @__PURE__ */ t(l, {
114
- endIcon: /* @__PURE__ */ t(T, {}),
115
- onClick: () => w.openActionDrawer({
116
- guid: _,
121
+ C && /* @__PURE__ */ e(d, {
122
+ endIcon: /* @__PURE__ */ e(T, {}),
123
+ onClick: () => F.openActionDrawer({
124
+ guid: x,
117
125
  trigger: "inDescriptionCta"
118
126
  }),
119
127
  sx: {
@@ -121,63 +129,62 @@ var ho = {}, yo = {
121
129
  p: 4,
122
130
  width: "max-content"
123
131
  },
124
- children: u.label
132
+ children: C.label
125
133
  }),
126
- !a?.label && i?.in_description_cta && /* @__PURE__ */ t(l, {
127
- endIcon: /* @__PURE__ */ t(T, {}),
128
- onClick: () => {
129
- },
134
+ !l?.label && D && /* @__PURE__ */ e(d, {
135
+ endIcon: /* @__PURE__ */ e(T, {}),
136
+ onClick: j,
130
137
  sx: {
131
138
  height: 24,
132
139
  p: 4,
133
140
  width: "max-content"
134
141
  },
135
- children: i.in_description_cta
142
+ children: D
136
143
  })
137
144
  ]
138
145
  }),
139
- (b || D) && /* @__PURE__ */ c(g, {
146
+ (b || L) && /* @__PURE__ */ m(y, {
140
147
  sx: {
141
148
  gap: 8,
142
149
  pb: 16,
143
150
  px: 16
144
151
  },
145
152
  children: [
146
- b && !B && /* @__PURE__ */ t(l, {
147
- sx: go,
153
+ b && !B && /* @__PURE__ */ e(d, {
154
+ sx: vo,
148
155
  variant: "text",
149
156
  children: b
150
157
  }),
151
- B && r && /* @__PURE__ */ t(l, {
152
- "aria-disabled": p(r.block) || k.disabled,
158
+ B && r && /* @__PURE__ */ e(d, {
159
+ "aria-disabled": u(r.block) || k.disabled,
153
160
  disabled: k.disabled,
154
- onClick: () => v("primary", r),
155
- sx: { ...p(r.block) && { color: "text.disabled" } },
161
+ onClick: () => S("primary", r),
162
+ sx: { ...u(r.block) && { color: "text.disabled" } },
156
163
  variant: "outlined",
157
164
  children: r.label
158
165
  }),
159
- D && n && /* @__PURE__ */ t(l, {
160
- "aria-disabled": p(n.block) || x.disabled,
166
+ L && a && /* @__PURE__ */ e(d, {
167
+ "aria-disabled": u(a.block) || v.disabled,
161
168
  color: "secondary",
162
- disabled: x.disabled,
163
- onClick: () => v("secondary", n),
164
- children: n.label
169
+ disabled: v.disabled,
170
+ onClick: () => S("secondary", a),
171
+ children: a.label
165
172
  })
166
173
  ]
167
174
  }),
168
- /* @__PURE__ */ t(ro, {
175
+ /* @__PURE__ */ e(ao, {
169
176
  onTellUsMore: o.openRatingSurvey,
170
177
  show: o.isFeedbackBarShown
171
178
  })
172
179
  ]
173
180
  })] }),
174
- /* @__PURE__ */ t(to, { beat: i }),
175
- /* @__PURE__ */ t(so, {
181
+ /* @__PURE__ */ e(ro, { beat: i }),
182
+ /* @__PURE__ */ e(lo, {
176
183
  isOpen: o.isDismissOpen,
177
184
  onClose: o.closeDismissDialog,
178
185
  onDismiss: o.confirmDismiss
179
186
  }),
180
- o.isSurveyOpen && /* @__PURE__ */ t(Q, {
187
+ o.isSurveyOpen && /* @__PURE__ */ e(eo, {
181
188
  characterLimitLabel: o.survey.characterLimitLabel,
182
189
  closeAriaLabel: o.survey.closeAriaLabel,
183
190
  isOpen: !0,
@@ -190,13 +197,13 @@ var ho = {}, yo = {
190
197
  secondaryText: o.survey.backText,
191
198
  title: o.survey.title
192
199
  }),
193
- o.cardState === "visible" && e.footer && /* @__PURE__ */ t(io, { footer: e.footer })
200
+ o.cardState === "visible" && t.footer && /* @__PURE__ */ e(no, { footer: t.footer })
194
201
  ]
195
202
  })
196
203
  });
197
204
  });
198
205
  export {
199
- Yo as default
206
+ Qo as default
200
207
  };
201
208
 
202
209
  //# sourceMappingURL=BaseLayout.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import { useMemo } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { ChevronRight } from '@mxenabled/mx-icons'\nimport { P } from '@mxenabled/mxui'\n\nimport { blocks } from '../mappings/blocks'\nimport { actionBlocksKey } from '../mappings/actionBlocksKey'\nimport { isContactSupportCtaDisabled } from '../actionBlocks/ContactSupportActionBlock'\nimport { logoFromRef } from './shared/EntityLogo'\n\nimport Footer from './Footer'\nimport Header from './Header'\nimport FeedbackBar from './FeedbackBar'\nimport FeedbackDialog from './FeedbackDialog'\nimport DismissInsightDialog from './DismissInsightDialog'\nimport HiddenConfirmationCard from './HiddenConfirmationCard'\nimport ErrorCard from './ErrorCard'\nimport LoadingCard from './LoadingCard'\nimport { ObsolesceBanner, type ObsolesceBannerState } from './ObsolesceBanner'\nimport { useAppConfig, useGlobalCopyStore, useGlobalStore, useInsightsV2Store } from '../../common'\nimport type { Beat, PrimaryCTA, SecondaryCTA } from '../../core'\nimport { BeatActionsProvider, type BeatActions } from '../beatActions'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\nimport { reportCtaClick, useBeatCtaActions } from '../ctaActions'\nimport { useBeatFeedbackFlow } from '../hooks/useBeatFeedbackFlow'\n\nexport interface ObsoleteState {\n state: ObsolesceBannerState\n onRefresh: () => void\n onDismiss: () => void\n}\n\ninterface BaseLayoutProps {\n beat: Beat\n beatActions?: BeatActions\n obsolete?: ObsoleteState\n /** Swap only the block slot for a LoadingCard (e.g. while a sampled beat loads). */\n isLoading?: boolean\n /** Replace the entire card with an ErrorCard (e.g. when the sample fails to load). */\n isError?: boolean\n}\n\nconst NO_BEAT_ACTIONS: BeatActions = {}\n\nconst OBSOLETE_OVERLAY_SX = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n backgroundColor: 'background.default',\n opacity: 0.7,\n // Above every block's own z-index (hero card 1, AccountBlock 2), or that section shows through.\n zIndex: 3,\n} as const\n\n// Mini CTA label styled like a Button.\nconst MINI_CTA_SX = {\n alignItems: 'center',\n alignSelf: 'flex-start',\n display: 'flex',\n fontWeight: 600,\n height: 44,\n px: 2,\n textTransform: 'none',\n} as const\n\nconst BaseLayout = observer(\n ({\n beat,\n beatActions = NO_BEAT_ACTIONS,\n obsolete,\n isLoading = false,\n isError = false,\n }: BaseLayoutProps) => {\n const copy = useGlobalCopyStore()\n const insightsV2Store = useInsightsV2Store()\n const { config } = useAppConfig()\n const flow = useBeatFeedbackFlow(beat, beatActions)\n\n const stores = useGlobalStore()\n const {\n runCta: handleCtaClick,\n primary: primaryCtaState,\n secondary: secondaryCtaState,\n } = useBeatCtaActions(\n beat,\n beatActions,\n beat.insights_payload?.primary_cta,\n beat.insights_payload?.secondary_cta,\n )\n\n // Guard: payload may not be loaded yet (isLoading/isError states).\n const isMini = beat.insights_payload?.widget_type === 'mini'\n\n // Memoized: an inline object here would change identity every render, making every\n // useAnalyticsEvent() consumer's callback (and its effect deps) unstable too.\n const beatActionsValue = useMemo(\n () => ({ ...flow.wrappedActions, beat }),\n [flow.wrappedActions, beat],\n )\n\n // Error replaces the entire card; loading only swaps the block slot (below).\n if (isError) return <ErrorCard />\n\n const insights_payload = beat.insights_payload\n\n if (!insights_payload) return null\n if (flow.cardState === 'dismissed') return null\n\n const { instance_slot, primary_cta, secondary_cta, sub_title, title, guid, dismissed_at } =\n insights_payload\n const { block } = instance_slot\n\n // Rebuild V1 subtitle shape; sub_title wins if present.\n const subtitle =\n sub_title ??\n (insights_payload.subtitle\n ? {\n logo: logoFromRef(insights_payload.logo),\n text: insights_payload.subtitle,\n }\n : undefined)\n\n // CTAs run via ctaActions; contact_support_block bypasses it.\n const isCtaDisabled = (ctaBlock: string | null | undefined) =>\n isContactSupportCtaDisabled(ctaBlock, config, beatActions.onContactSupport)\n\n const onCtaClick = async (slot: 'primary' | 'secondary', cta: PrimaryCTA | SecondaryCTA) => {\n if (isCtaDisabled(cta.block)) return\n\n if (cta.block === actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK) {\n // Bypasses the runner, but still reports the press like any other CTA: the generic\n // press event, and (on a first primary press) FIRST_TIME_PRIMARY_ACTION_SELECTED +\n // cta_clicked_at.\n reportCtaClick({ beat, stores, hostActions: beatActions, slot })\n beatActions.onContactSupport?.()\n return\n }\n\n await handleCtaClick(slot, cta)\n }\n\n const Block = blocks[block as keyof typeof blocks]\n\n const inDescriptionCta = insights_payload.in_description_cta\n // Full card: the envelope's link opens the drawer its block names. A link with no block (mini's\n // \"Make a Transfer\") is the card's action, drawn as the mini label below, never a dead link.\n const envelopeLink =\n !isMini && inDescriptionCta?.label && inDescriptionCta.block ? inDescriptionCta : undefined\n // The card's action label: the primary CTA's, else a block-less envelope link's (ditto ≥ 1.4.3\n // sends mini's action as in_description_cta). `||`, not `??`: the copy may send the primary label\n // as \"\" rather than omit it, and an empty string must fall through. It is a button only on a full\n // card with a primary CTA; otherwise a label, so a tap reaches the host's card handler.\n const ctaLabel =\n primary_cta?.label || (envelopeLink ? undefined : inDescriptionCta?.label) || undefined\n const isCtaButton = !isMini && !!primary_cta?.label\n const showSecondaryCta = !isMini && !!secondary_cta?.label\n const obsoleteCopy = copy.insights_feed?.general\n const isObsoleteDimmed =\n obsolete?.state === 'not_refreshable' && !dismissed_at && !!obsoleteCopy\n\n return (\n <BeatActionsProvider value={beatActionsValue}>\n <Stack sx={{ mb: 16 }}>\n {flow.cardState === 'confirming' ? (\n <HiddenConfirmationCard\n onClose={flow.collapseConfirmation}\n onLeaveFeedback={flow.openHideSurvey}\n onUndo={flow.undoDismiss}\n />\n ) : (\n <>\n {obsolete && obsoleteCopy && <ObsolesceBanner {...obsolete} copy={obsoleteCopy} />}\n <Card\n inert={isObsoleteDimmed}\n sx={{\n ...(isObsoleteDimmed && {\n position: 'relative',\n zIndex: 2,\n pointerEvents: 'none',\n }),\n }}\n >\n {isObsoleteDimmed && <Box sx={OBSOLETE_OVERLAY_SX} />}\n <Header isMini={isMini} subtitle={subtitle} title={title ?? ''} />\n {isLoading ? (\n <LoadingCard />\n ) : (\n Block && <Block beatGuid={guid} payload={insights_payload} />\n )}\n\n <Stack sx={{ gap: 6, pb: 16, pt: 12, px: 16 }}>\n <P\n dangerouslySetInnerHTML={{\n __html: insights_payload.description.html_text,\n }}\n variant=\"subtitle2\"\n />\n {/* V2: the envelope's link opens the action block it names. */}\n {envelopeLink && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() =>\n insightsV2Store.openActionDrawer({ guid, trigger: 'inDescriptionCta' })\n }\n sx={{ height: 24, p: 4, width: 'max-content' }}\n >\n {envelopeLink.label}\n </Button>\n )}\n {/* V1: the legacy field, shown for beats that do not send the envelope link. */}\n {!inDescriptionCta?.label && beat?.in_description_cta && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() => {}}\n sx={{ height: 24, p: 4, width: 'max-content' }}\n >\n {beat.in_description_cta}\n </Button>\n )}\n </Stack>\n\n {(ctaLabel || showSecondaryCta) && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n {ctaLabel &&\n !isCtaButton && (\n // The card's action when it has no primary CTA button (mini always; a full card whose\n // only link names no block). What the tap does is the host's decision (Pulse posts\n // `carousel/cta`, the same redirect a V1 mini card sends), never the action drawer the\n // full card's CTA opens. It is a real (blue, focusable) button for that tap, but has no\n // handler of its own and does not stop the click, so it reaches the host's card handler\n // exactly as a tap on the card does.\n <Button sx={MINI_CTA_SX} variant=\"text\">\n {ctaLabel}\n </Button>\n )}\n {isCtaButton && primary_cta && (\n <Button\n aria-disabled={isCtaDisabled(primary_cta.block) || primaryCtaState.disabled}\n disabled={primaryCtaState.disabled}\n onClick={() => onCtaClick('primary', primary_cta)}\n sx={{\n ...(isCtaDisabled(primary_cta.block) && { color: 'text.disabled' }),\n }}\n variant=\"outlined\"\n >\n {primary_cta.label}\n </Button>\n )}\n {/* Mini has room for one CTA. */}\n {showSecondaryCta && secondary_cta && (\n <Button\n aria-disabled={\n isCtaDisabled(secondary_cta.block) || secondaryCtaState.disabled\n }\n color=\"secondary\"\n disabled={secondaryCtaState.disabled}\n onClick={() => onCtaClick('secondary', secondary_cta)}\n >\n {secondary_cta.label}\n </Button>\n )}\n </Stack>\n )}\n\n <FeedbackBar onTellUsMore={flow.openRatingSurvey} show={flow.isFeedbackBarShown} />\n </Card>\n </>\n )}\n\n <ActionBlockLayer beat={beat} />\n\n <DismissInsightDialog\n isOpen={flow.isDismissOpen}\n onClose={flow.closeDismissDialog}\n onDismiss={flow.confirmDismiss}\n />\n\n {flow.isSurveyOpen && (\n <FeedbackDialog\n characterLimitLabel={flow.survey.characterLimitLabel}\n closeAriaLabel={flow.survey.closeAriaLabel}\n isOpen={true}\n onBackClick={flow.feedbackDialogCallbacks.onBackClick}\n onClose={flow.closeSurvey}\n onSubmit={flow.submitSurvey}\n onTextInputFocus={flow.feedbackDialogCallbacks.onTextInputFocus}\n options={flow.survey.options}\n primaryText={flow.survey.submitText}\n secondaryText={flow.survey.backText}\n title={flow.survey.title}\n />\n )}\n\n {flow.cardState === 'visible' && insights_payload.footer && (\n <Footer footer={insights_payload.footer} />\n )}\n </Stack>\n </BeatActionsProvider>\n )\n },\n)\n\nexport default BaseLayout\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAM,KAA+B,CAAC,GAEhC,KAAsB;AAAA,EAC1B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,SAAS;AAAA,EAET,QAAQ;AACV,GAGM,KAAc;AAAA,EAClB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,IAAI;AAAA,EACJ,eAAe;AACjB,GAEM,KAAa,GAAA,CAChB,EACC,MAAA,GACA,aAAA,IAAc,IACd,UAAA,GACA,WAAA,IAAY,IACZ,SAAA,IAAU,GAAA,MACW;AACrB,QAAM,IAAO,EAAmB,GAC1B,IAAkB,EAAmB,GACrC,EAAE,QAAA,EAAA,IAAW,EAAa,GAC1B,IAAO,GAAoB,GAAM,CAAW,GAE5C,IAAS,EAAe,GACxB,EACJ,QAAQ,GACR,SAAS,GACT,WAAW,EAAA,IACT,EACF,GACA,GACA,EAAK,kBAAkB,aACvB,EAAK,kBAAkB,aACzB,GAGM,IAAS,EAAK,kBAAkB,gBAAgB,QAIhD,IAAmB,GAAA,OAChB;AAAA,IAAE,GAAG,EAAK;AAAA,IAAgB,MAAA;AAAA,EAAK,IACtC,CAAC,EAAK,gBAAgB,CAAI,CAC5B;AAGA,MAAI,EAAS,QAAO,gBAAA,EAAC,GAAD,CAAY,CAAA;AAEhC,QAAM,IAAmB,EAAK;AAG9B,MADI,CAAC,KACD,EAAK,cAAc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QACN,CAAA,CAAA,EAAA,CAAA;AAAA,QAGJ,gBAAA,EAAC,IAAD,EAAwB,MAAA,EAAO,CAAA;AAAA,QAE/B,gBAAA,EAAC,IAAD;AAAA,UACE,QAAQ,EAAK;AAAA,UACb,SAAS,EAAK;AAAA,UACd,WAAW,EAAK;AAAA,QACjB,CAAA;AAAA,QAEA,EAAK,gBACJ,gBAAA,EAAC,GAAD;AAAA,UACE,qBAAqB,EAAK,OAAO;AAAA,UACjC,gBAAgB,EAAK,OAAO;AAAA,UAC5B,QAAQ;AAAA,UACR,aAAa,EAAK,wBAAwB;AAAA,UAC1C,SAAS,EAAK;AAAA,UACd,UAAU,EAAK;AAAA,UACf,kBAAkB,EAAK,wBAAwB;AAAA,UAC/C,SAAS,EAAK,OAAO;AAAA,UACrB,aAAa,EAAK,OAAO;AAAA,UACzB,eAAe,EAAK,OAAO;AAAA,UAC3B,OAAO,EAAK,OAAO;AAAA,QACpB,CAAA;AAAA,QAGF,EAAK,cAAc,aAAa,EAAiB,UAChD,gBAAA,EAAC,IAAD,EAAQ,QAAQ,EAAiB,OAAS,CAAA;AAAA,MAEvC;AAAA;EACY,CAAA;AAEzB,CACF"}
1
+ {"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import { useMemo } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { ChevronRight } from '@mxenabled/mx-icons'\nimport { P } from '@mxenabled/mxui'\n\nimport { blocks } from '../mappings/blocks'\nimport { actionBlocksKey } from '../mappings/actionBlocksKey'\nimport { isContactSupportCtaDisabled } from '../actionBlocks/ContactSupportActionBlock'\nimport { logoFromRef } from './shared/EntityLogo'\n\nimport Footer from './Footer'\nimport Header from './Header'\nimport FeedbackBar from './FeedbackBar'\nimport FeedbackDialog from './FeedbackDialog'\nimport DismissInsightDialog from './DismissInsightDialog'\nimport HiddenConfirmationCard from './HiddenConfirmationCard'\nimport ErrorCard from './ErrorCard'\nimport LoadingCard from './LoadingCard'\nimport { ObsolesceBanner, type ObsolesceBannerState } from './ObsolesceBanner'\nimport { useAppConfig, useGlobalCopyStore, useGlobalStore, useInsightsV2Store } from '../../common'\nimport { sendClientConfiguredCta } from '../../common/utils/PostMessage'\nimport type { Beat, PrimaryCTA, SecondaryCTA } from '../../core'\nimport { BeatActionsProvider, type BeatActions } from '../beatActions'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\nimport { reportCtaClick, useBeatCtaActions } from '../ctaActions'\nimport { useBeatFeedbackFlow } from '../hooks/useBeatFeedbackFlow'\n\nexport interface ObsoleteState {\n state: ObsolesceBannerState\n onRefresh: () => void\n onDismiss: () => void\n}\n\ninterface BaseLayoutProps {\n beat: Beat\n beatActions?: BeatActions\n obsolete?: ObsoleteState\n /** Swap only the block slot for a LoadingCard (e.g. while a sampled beat loads). */\n isLoading?: boolean\n /** Replace the entire card with an ErrorCard (e.g. when the sample fails to load). */\n isError?: boolean\n}\n\nconst NO_BEAT_ACTIONS: BeatActions = {}\n\nconst OBSOLETE_OVERLAY_SX = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n backgroundColor: 'background.default',\n opacity: 0.7,\n // Above every block's own z-index (hero card 1, AccountBlock 2), or that section shows through.\n zIndex: 3,\n} as const\n\n// Mini CTA label styled like a Button.\nconst MINI_CTA_SX = {\n alignItems: 'center',\n alignSelf: 'flex-start',\n display: 'flex',\n fontWeight: 600,\n height: 44,\n px: 2,\n textTransform: 'none',\n} as const\n\nconst BaseLayout = observer(\n ({\n beat,\n beatActions = NO_BEAT_ACTIONS,\n obsolete,\n isLoading = false,\n isError = false,\n }: BaseLayoutProps) => {\n const copy = useGlobalCopyStore()\n const insightsV2Store = useInsightsV2Store()\n const { config } = useAppConfig()\n const flow = useBeatFeedbackFlow(beat, beatActions)\n\n const stores = useGlobalStore()\n const {\n runCta: handleCtaClick,\n primary: primaryCtaState,\n secondary: secondaryCtaState,\n } = useBeatCtaActions(\n beat,\n beatActions,\n beat.insights_payload?.primary_cta,\n beat.insights_payload?.secondary_cta,\n )\n\n // Guard: payload may not be loaded yet (isLoading/isError states).\n const isMini = beat.insights_payload?.widget_type === 'mini'\n\n // Memoized: an inline object here would change identity every render, making every\n // useAnalyticsEvent() consumer's callback (and its effect deps) unstable too.\n const beatActionsValue = useMemo(\n () => ({ ...flow.wrappedActions, beat }),\n [flow.wrappedActions, beat],\n )\n\n // Error replaces the entire card; loading only swaps the block slot (below).\n if (isError) return <ErrorCard />\n\n const insights_payload = beat.insights_payload\n\n if (!insights_payload) return null\n if (flow.cardState === 'dismissed') return null\n\n const { instance_slot, primary_cta, secondary_cta, sub_title, title, guid, dismissed_at } =\n insights_payload\n const { block } = instance_slot\n\n // Rebuild V1 subtitle shape; sub_title wins if present.\n const subtitle =\n sub_title ??\n (insights_payload.subtitle\n ? {\n logo: logoFromRef(insights_payload.logo),\n text: insights_payload.subtitle,\n }\n : undefined)\n\n // CTAs run via ctaActions; contact_support_block bypasses it.\n const isCtaDisabled = (ctaBlock: string | null | undefined) =>\n isContactSupportCtaDisabled(ctaBlock, config, beatActions.onContactSupport)\n\n const onCtaClick = async (slot: 'primary' | 'secondary', cta: PrimaryCTA | SecondaryCTA) => {\n if (isCtaDisabled(cta.block)) return\n\n if (cta.block === actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK) {\n // Bypasses the runner, but still reports the press like any other CTA: the generic\n // press event, and (on a first primary press) FIRST_TIME_PRIMARY_ACTION_SELECTED +\n // cta_clicked_at.\n reportCtaClick({ beat, stores, hostActions: beatActions, slot })\n beatActions.onContactSupport?.()\n return\n }\n\n await handleCtaClick(slot, cta)\n }\n\n const Block = blocks[block as keyof typeof blocks]\n\n const inDescriptionCta = insights_payload.in_description_cta\n // Full card: the envelope's link opens the drawer its block names. A link with no block (mini's\n // \"Make a Transfer\") is the card's action, drawn as the mini label below, never a dead link.\n const envelopeLink =\n !isMini && inDescriptionCta?.label && inDescriptionCta.block ? inDescriptionCta : undefined\n // The card's action label: the primary CTA's, else a block-less envelope link's (ditto ≥ 1.4.3\n // sends mini's action as in_description_cta). `||`, not `??`: the copy may send the primary label\n // as \"\" rather than omit it, and an empty string must fall through. It is a button only on a full\n // card with a primary CTA; otherwise a label, so a tap reaches the host's card handler.\n const ctaLabel =\n primary_cta?.label || (envelopeLink ? undefined : inDescriptionCta?.label) || undefined\n const isCtaButton = !isMini && !!primary_cta?.label\n const clientConfiguredLabel = beat.in_description_cta || beat.html_in_description_cta\n const onClientConfiguredLinkClick = () => {\n const { is_mobile_webview, clientConfig } = stores.appDataStore.appConfig\n\n sendClientConfiguredCta(beat.template, {\n isMobileWebview: is_mobile_webview,\n webviewScheme: clientConfig?.master?.ui_message_webview_url_scheme,\n userGuid: insights_payload.user_guid ?? beat.user_guid,\n })\n }\n const showSecondaryCta = !isMini && !!secondary_cta?.label\n const obsoleteCopy = copy.insights_feed?.general\n const isObsoleteDimmed =\n obsolete?.state === 'not_refreshable' && !dismissed_at && !!obsoleteCopy\n\n return (\n <BeatActionsProvider value={beatActionsValue}>\n <Stack sx={{ mb: 16 }}>\n {flow.cardState === 'confirming' ? (\n <HiddenConfirmationCard\n onClose={flow.collapseConfirmation}\n onLeaveFeedback={flow.openHideSurvey}\n onUndo={flow.undoDismiss}\n />\n ) : (\n <>\n {obsolete && obsoleteCopy && <ObsolesceBanner {...obsolete} copy={obsoleteCopy} />}\n <Card\n inert={isObsoleteDimmed}\n sx={{\n ...(isObsoleteDimmed && {\n position: 'relative',\n zIndex: 2,\n pointerEvents: 'none',\n }),\n }}\n >\n {isObsoleteDimmed && <Box sx={OBSOLETE_OVERLAY_SX} />}\n <Header isMini={isMini} subtitle={subtitle} title={title ?? ''} />\n {isLoading ? (\n <LoadingCard />\n ) : (\n Block && <Block beatGuid={guid} payload={insights_payload} />\n )}\n\n <Stack sx={{ gap: 6, pb: 16, pt: 12, px: 16 }}>\n <P\n dangerouslySetInnerHTML={{\n __html: insights_payload.description.html_text,\n }}\n variant=\"subtitle2\"\n />\n {/* V2: the envelope's link opens the action block it names. */}\n {envelopeLink && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() =>\n insightsV2Store.openActionDrawer({ guid, trigger: 'inDescriptionCta' })\n }\n sx={{ height: 24, p: 4, width: 'max-content' }}\n >\n {envelopeLink.label}\n </Button>\n )}\n {/* Custom-copy link when the envelope sends none; legacy mini shows it too, so no mini guard. */}\n {!inDescriptionCta?.label && clientConfiguredLabel && (\n <Button\n endIcon={<ChevronRight />}\n onClick={onClientConfiguredLinkClick}\n sx={{ height: 24, p: 4, width: 'max-content' }}\n >\n {clientConfiguredLabel}\n </Button>\n )}\n </Stack>\n\n {(ctaLabel || showSecondaryCta) && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n {ctaLabel &&\n !isCtaButton && (\n // The card's action when it has no primary CTA button (mini always; a full card whose\n // only link names no block). What the tap does is the host's decision (Pulse posts\n // `carousel/cta`, the same redirect a V1 mini card sends), never the action drawer the\n // full card's CTA opens. It is a real (blue, focusable) button for that tap, but has no\n // handler of its own and does not stop the click, so it reaches the host's card handler\n // exactly as a tap on the card does.\n <Button sx={MINI_CTA_SX} variant=\"text\">\n {ctaLabel}\n </Button>\n )}\n {isCtaButton && primary_cta && (\n <Button\n aria-disabled={isCtaDisabled(primary_cta.block) || primaryCtaState.disabled}\n disabled={primaryCtaState.disabled}\n onClick={() => onCtaClick('primary', primary_cta)}\n sx={{\n ...(isCtaDisabled(primary_cta.block) && { color: 'text.disabled' }),\n }}\n variant=\"outlined\"\n >\n {primary_cta.label}\n </Button>\n )}\n {/* Mini has room for one CTA. */}\n {showSecondaryCta && secondary_cta && (\n <Button\n aria-disabled={\n isCtaDisabled(secondary_cta.block) || secondaryCtaState.disabled\n }\n color=\"secondary\"\n disabled={secondaryCtaState.disabled}\n onClick={() => onCtaClick('secondary', secondary_cta)}\n >\n {secondary_cta.label}\n </Button>\n )}\n </Stack>\n )}\n\n <FeedbackBar onTellUsMore={flow.openRatingSurvey} show={flow.isFeedbackBarShown} />\n </Card>\n </>\n )}\n\n <ActionBlockLayer beat={beat} />\n\n <DismissInsightDialog\n isOpen={flow.isDismissOpen}\n onClose={flow.closeDismissDialog}\n onDismiss={flow.confirmDismiss}\n />\n\n {flow.isSurveyOpen && (\n <FeedbackDialog\n characterLimitLabel={flow.survey.characterLimitLabel}\n closeAriaLabel={flow.survey.closeAriaLabel}\n isOpen={true}\n onBackClick={flow.feedbackDialogCallbacks.onBackClick}\n onClose={flow.closeSurvey}\n onSubmit={flow.submitSurvey}\n onTextInputFocus={flow.feedbackDialogCallbacks.onTextInputFocus}\n options={flow.survey.options}\n primaryText={flow.survey.submitText}\n secondaryText={flow.survey.backText}\n title={flow.survey.title}\n />\n )}\n\n {flow.cardState === 'visible' && insights_payload.footer && (\n <Footer footer={insights_payload.footer} />\n )}\n </Stack>\n </BeatActionsProvider>\n )\n },\n)\n\nexport default BaseLayout\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,IAAM,KAA+B,CAAC,GAEhC,KAAsB;AAAA,EAC1B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,SAAS;AAAA,EAET,QAAQ;AACV,GAGM,KAAc;AAAA,EAClB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,IAAI;AAAA,EACJ,eAAe;AACjB,GAEM,KAAa,GAAA,CAChB,EACC,MAAA,GACA,aAAA,IAAc,IACd,UAAA,GACA,WAAA,IAAY,IACZ,SAAA,IAAU,GAAA,MACW;AACrB,QAAM,IAAO,EAAmB,GAC1B,IAAkB,EAAmB,GACrC,EAAE,QAAA,EAAA,IAAW,EAAa,GAC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O;AAAA,QACpB,CAAA;AAAA,QAGF,EAAK,cAAc,aAAa,EAAiB,UAChD,gBAAA,EAAC,IAAD,EAAQ,QAAQ,EAAiB,OAAS,CAAA;AAAA,MAEvC;AAAA;EACY,CAAA;AAEzB,CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "9.7.52",
3
+ "version": "9.7.53",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",