@mx-cartographer/experiences 9.7.69 → 9.7.71-alpha-ram-usp-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/core/stores/GlobalCopyStore.d.ts +6 -0
  3. package/dist/core/stores/GlobalCopyStore.es.js +14 -8
  4. package/dist/core/stores/GlobalCopyStore.es.js.map +1 -1
  5. package/dist/core/stores/GoalStore.d.ts +1 -1
  6. package/dist/core/stores/GoalStore.es.js +1 -1
  7. package/dist/core/stores/GoalStore.es.js.map +1 -1
  8. package/dist/core/types/localization/InsightsFeedCopy.d.ts +24 -0
  9. package/dist/goals/GoalsMiniWidget.d.ts +7 -0
  10. package/dist/goals/{GoalsMicroWidget.es.js → GoalsMiniWidget.es.js} +14 -14
  11. package/dist/goals/GoalsMiniWidget.es.js.map +1 -0
  12. package/dist/goals/components/{micro/GoalMicroStatusCard.d.ts → mini/GoalMiniStatusCard.d.ts} +1 -1
  13. package/dist/goals/components/{micro/GoalMicroStatusCard.es.js → mini/GoalMiniStatusCard.es.js} +2 -2
  14. package/dist/goals/components/mini/GoalMiniStatusCard.es.js.map +1 -0
  15. package/dist/goals/components/{micro/GoalsMicroEmptyState.d.ts → mini/GoalsMiniEmptyState.d.ts} +1 -1
  16. package/dist/goals/components/{micro/GoalsMicroEmptyState.es.js → mini/GoalsMiniEmptyState.es.js} +2 -2
  17. package/dist/goals/components/mini/GoalsMiniEmptyState.es.js.map +1 -0
  18. package/dist/goals/index.d.ts +1 -1
  19. package/dist/goals/index.es.js +4 -4
  20. package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.d.ts +6 -0
  21. package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +168 -0
  22. package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js.map +1 -0
  23. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +11 -11
  24. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js +3 -3
  25. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +92 -59
  26. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
  27. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +9 -1
  28. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +9 -5
  29. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
  30. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js +5 -5
  31. package/dist/insights-v2/components/AccountHeroCard.es.js +7 -5
  32. package/dist/insights-v2/components/AccountHeroCard.es.js.map +1 -1
  33. package/dist/insights-v2/components/BaseLayout.es.js +157 -138
  34. package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
  35. package/dist/insights-v2/components/CtaStatus.d.ts +14 -1
  36. package/dist/insights-v2/components/CtaStatus.es.js +76 -38
  37. package/dist/insights-v2/components/CtaStatus.es.js.map +1 -1
  38. package/dist/insights-v2/components/InsightTransactionRow.d.ts +3 -1
  39. package/dist/insights-v2/components/InsightTransactionRow.es.js +36 -20
  40. package/dist/insights-v2/components/InsightTransactionRow.es.js.map +1 -1
  41. package/dist/insights-v2/components/StatusPill.es.js +12 -11
  42. package/dist/insights-v2/components/StatusPill.es.js.map +1 -1
  43. package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.d.ts +4 -0
  44. package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.es.js +10 -0
  45. package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.es.js.map +1 -0
  46. package/dist/insights-v2/components/TransactionListCard.d.ts +5 -1
  47. package/dist/insights-v2/components/TransactionListCard.es.js +69 -49
  48. package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
  49. package/dist/insights-v2/components/shared/StatusSnackbar.d.ts +10 -1
  50. package/dist/insights-v2/components/shared/StatusSnackbar.es.js +27 -11
  51. package/dist/insights-v2/components/shared/StatusSnackbar.es.js.map +1 -1
  52. package/dist/insights-v2/components/shared/elevation.d.ts +16 -0
  53. package/dist/insights-v2/components/shared/elevation.es.js +15 -0
  54. package/dist/insights-v2/components/shared/elevation.es.js.map +1 -0
  55. package/dist/insights-v2/ctaActions/ctaConfig.es.js +23 -9
  56. package/dist/insights-v2/ctaActions/ctaConfig.es.js.map +1 -1
  57. package/dist/insights-v2/ctaActions/runCtaAction.d.ts +7 -0
  58. package/dist/insights-v2/ctaActions/runCtaAction.es.js +73 -62
  59. package/dist/insights-v2/ctaActions/runCtaAction.es.js.map +1 -1
  60. package/dist/insights-v2/ctaActions/subscriptionAnswer.d.ts +10 -1
  61. package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js +115 -0
  62. package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js.map +1 -0
  63. package/dist/insights-v2/ctaActions/types.d.ts +5 -2
  64. package/dist/insights-v2/ctaActions/useCtaAction.d.ts +6 -0
  65. package/dist/insights-v2/ctaActions/useCtaAction.es.js +32 -27
  66. package/dist/insights-v2/ctaActions/useCtaAction.es.js.map +1 -1
  67. package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -0
  68. package/dist/insights-v2/mappings/actionBlocksKey.es.js +1 -0
  69. package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
  70. package/dist/insights-v2/mappings/blocks.es.js +74 -68
  71. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  72. package/dist/microinsights/MicroCardTemplate.es.js +21 -17
  73. package/dist/microinsights/MicroCardTemplate.es.js.map +1 -1
  74. package/dist/microinsights/cards/InsightCard.es.js +91 -86
  75. package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
  76. package/dist/microinsights/cards/MicroCtaStatus.d.ts +18 -0
  77. package/dist/microinsights/cards/MicroCtaStatus.es.js +44 -0
  78. package/dist/microinsights/cards/MicroCtaStatus.es.js.map +1 -0
  79. package/dist/microinsights/stores/CopyStore.d.ts +4 -1
  80. package/dist/microinsights/stores/CopyStore.es.js +13 -10
  81. package/dist/microinsights/stores/CopyStore.es.js.map +1 -1
  82. package/package.json +1 -1
  83. package/dist/goals/GoalsMicroWidget.d.ts +0 -7
  84. package/dist/goals/GoalsMicroWidget.es.js.map +0 -1
  85. package/dist/goals/components/micro/GoalMicroStatusCard.es.js.map +0 -1
  86. package/dist/goals/components/micro/GoalsMicroEmptyState.es.js.map +0 -1
@@ -1,34 +1,34 @@
1
- import { useAppConfig as K, useGlobalCopyStore as Y, useGlobalStore as $, useInsightsV2Store as q } from "../../common/context/hooks.es.js";
2
- import { sendClientConfiguredCta as J } from "../../common/utils/PostMessage.es.js";
3
- import { BeatActionsProvider as Q } from "../beatActions.es.js";
4
- import { isContactSupportCtaDisabled as Z } from "../actionBlocks/ContactSupportActionBlock.es.js";
5
- import { reportCtaClick as oo } from "../ctaActions/runCtaAction.es.js";
6
- import { useBeatCtaActions as eo } from "../ctaActions/useCtaAction.es.js";
7
- import { actionBlocksKey as io } from "../mappings/actionBlocksKey.es.js";
8
- import { logoFromRef as to } from "./shared/EntityLogo.es.js";
9
- import { CtaStatus as ro } from "./CtaStatus.es.js";
10
- import no from "./FeedbackDialog.es.js";
11
- import { ErrorCard as so } from "./ErrorCard.es.js";
12
- import { blocks as ao } from "../mappings/blocks.es.js";
13
- import { ActionBlockLayer as lo } from "../actionBlocks/ActionBlockLayer.es.js";
14
- import co from "./Footer.es.js";
15
- import mo from "./Header.es.js";
16
- import { FeedbackBar as po } from "./FeedbackBar.es.js";
17
- import { DismissInsightDialog as uo } from "./DismissInsightDialog.es.js";
18
- import { HiddenConfirmationCard as fo } from "./HiddenConfirmationCard.es.js";
19
- import { LoadingCard as bo } from "./LoadingCard.es.js";
20
- import { ObsolesceBanner as Co } from "./ObsolesceBanner.es.js";
21
- import { useBeatFeedbackFlow as ho } from "../hooks/useBeatFeedbackFlow.es.js";
22
- import { useMemo as go } from "react";
23
- import { observer as yo } from "mobx-react-lite";
24
- import x from "@mui/material/Stack";
25
- import { P as _o } from "@mxenabled/mxui";
26
- import p from "@mui/material/Button";
27
- import { ChevronRight as A } from "@mxenabled/mx-icons";
28
- import { Fragment as ko, jsx as e, jsxs as u } from "react/jsx-runtime";
29
- import xo from "@mui/material/Box";
30
- import vo from "@mui/material/Card";
31
- var So = {}, wo = {
1
+ import { useAppConfig as Q, useGlobalCopyStore as Z, useGlobalStore as tt, useInsightsV2Store as ot } from "../../common/context/hooks.es.js";
2
+ import { sendClientConfiguredCta as it } from "../../common/utils/PostMessage.es.js";
3
+ import { BeatActionsProvider as et } from "../beatActions.es.js";
4
+ import { isContactSupportCtaDisabled as nt } from "../actionBlocks/ContactSupportActionBlock.es.js";
5
+ import { CtaStatus as rt } from "./CtaStatus.es.js";
6
+ import { reportCtaClick as st } from "../ctaActions/runCtaAction.es.js";
7
+ import { useBeatCtaActions as at } from "../ctaActions/useCtaAction.es.js";
8
+ import { actionBlocksKey as lt } from "../mappings/actionBlocksKey.es.js";
9
+ import { logoFromRef as ct } from "./shared/EntityLogo.es.js";
10
+ import dt from "./FeedbackDialog.es.js";
11
+ import { ErrorCard as mt } from "./ErrorCard.es.js";
12
+ import { blocks as pt } from "../mappings/blocks.es.js";
13
+ import { ActionBlockLayer as ut } from "../actionBlocks/ActionBlockLayer.es.js";
14
+ import ft from "./Footer.es.js";
15
+ import bt from "./Header.es.js";
16
+ import { FeedbackBar as Ct } from "./FeedbackBar.es.js";
17
+ import { DismissInsightDialog as ht } from "./DismissInsightDialog.es.js";
18
+ import { HiddenConfirmationCard as gt } from "./HiddenConfirmationCard.es.js";
19
+ import { LoadingCard as yt } from "./LoadingCard.es.js";
20
+ import { ObsolesceBanner as kt } from "./ObsolesceBanner.es.js";
21
+ import { useBeatFeedbackFlow as xt } from "../hooks/useBeatFeedbackFlow.es.js";
22
+ import { useMemo as _t } from "react";
23
+ import { observer as vt } from "mobx-react-lite";
24
+ import v from "@mui/material/Stack";
25
+ import { P as St } from "@mxenabled/mxui";
26
+ import u from "@mui/material/Button";
27
+ import { ChevronRight as I } from "@mxenabled/mx-icons";
28
+ import { Fragment as wt, jsx as o, jsxs as f } from "react/jsx-runtime";
29
+ import Dt from "@mui/material/Box";
30
+ import Lt from "@mui/material/Card";
31
+ var Tt = {}, Bt = {
32
32
  position: "absolute",
33
33
  top: 0,
34
34
  left: 0,
@@ -37,83 +37,97 @@ var So = {}, wo = {
37
37
  backgroundColor: "background.default",
38
38
  opacity: 0.7,
39
39
  zIndex: 3
40
- }, Do = {
40
+ }, At = {
41
41
  alignItems: "center",
42
42
  alignSelf: "flex-start",
43
43
  display: "flex",
44
+ fontSize: 13,
44
45
  fontWeight: 600,
45
- height: 44,
46
- px: 2,
46
+ height: "auto",
47
+ justifyContent: "flex-start",
48
+ lineHeight: "16px",
49
+ minHeight: 24,
50
+ minWidth: 0,
51
+ px: 0,
52
+ py: 4,
53
+ textAlign: "left",
47
54
  textTransform: "none"
48
- }, Bo = {
55
+ }, It = {
56
+ display: "-webkit-box",
57
+ overflow: "hidden",
58
+ WebkitBoxOrient: "vertical",
59
+ WebkitLineClamp: 3
60
+ }, Ot = {
49
61
  color: "text.secondary",
62
+ height: 40,
63
+ minHeight: 40,
50
64
  fontSize: 13,
51
65
  fontWeight: 600,
52
66
  lineHeight: "16px",
53
67
  "&.Mui-disabled": { color: "text.disabled" }
54
- }, re = yo(({ beat: i, beatActions: l = So, obsolete: C, isLoading: O = !1, isError: I = !1 }) => {
55
- const F = Y(), R = q(), { config: E } = K(), o = ho(i, l), v = $(), { runCta: M, primary: h, secondary: S } = eo(i, l, i.insights_payload?.primary_cta, i.insights_payload?.secondary_cta), f = i.insights_payload?.widget_type === "mini", N = go(() => ({
56
- ...o.wrappedActions,
68
+ }, co = vt(({ beat: i, beatActions: c = Tt, obsolete: h, isLoading: O = !1, isError: F = !1 }) => {
69
+ const R = Z(), E = ot(), { config: H } = Q(), t = xt(i, c), S = tt(), { runCta: M, primary: g, secondary: w, action: N } = at(i, c, i.insights_payload?.primary_cta, i.insights_payload?.secondary_cta), s = i.insights_payload?.widget_type === "mini", W = _t(() => ({
70
+ ...t.wrappedActions,
57
71
  beat: i
58
- }), [o.wrappedActions, i]);
59
- if (I) return /* @__PURE__ */ e(so, {});
60
- const t = i.insights_payload;
61
- if (!t || o.cardState === "dismissed") return null;
62
- const { instance_slot: H, primary_cta: n, secondary_cta: s, sub_title: P, title: W, guid: w, dismissed_at: G } = t, { block: V } = H, z = P ?? (t.subtitle ? {
63
- logo: to(t.logo),
64
- text: t.subtitle
65
- } : void 0), c = (a) => Z(a, E, l.onContactSupport), D = async (a, m) => {
66
- if (!c(m.block)) {
67
- if (m.block === io.CONTACT_SUPPORT_ACTION_BLOCK) {
68
- oo({
72
+ }), [t.wrappedActions, i]);
73
+ if (F) return /* @__PURE__ */ o(mt, {});
74
+ const e = i.insights_payload;
75
+ if (!e || t.cardState === "dismissed") return null;
76
+ const { instance_slot: P, primary_cta: r, secondary_cta: a, sub_title: z, title: G, guid: D, dismissed_at: V } = e, { block: X } = P, j = z ?? (e.subtitle ? {
77
+ logo: ct(e.logo),
78
+ text: e.subtitle
79
+ } : void 0), d = (l) => nt(l, H, c.onContactSupport), L = async (l, p) => {
80
+ if (!d(p.block)) {
81
+ if (p.block === lt.CONTACT_SUPPORT_ACTION_BLOCK) {
82
+ st({
69
83
  beat: i,
70
- stores: v,
71
- hostActions: l,
72
- slot: a
73
- }), l.onContactSupport?.();
84
+ stores: S,
85
+ hostActions: c,
86
+ slot: l
87
+ }), c.onContactSupport?.();
74
88
  return;
75
89
  }
76
- await M(a, m);
90
+ await M(l, p);
77
91
  }
78
- }, B = ao[V], d = t.in_description_cta, g = !f && d?.label && d.block ? d : void 0, y = n?.label || (g ? void 0 : d?.label) || void 0, b = !f && !!n?.label, L = i.in_description_cta || i.html_in_description_cta, U = () => {
79
- const { is_mobile_webview: a, clientConfig: m } = v.appDataStore.appConfig;
80
- J(i.template, {
81
- isMobileWebview: a,
82
- webviewScheme: m?.master?.ui_message_webview_url_scheme,
83
- userGuid: t.user_guid ?? i.user_guid
92
+ }, T = pt[X], m = e.in_description_cta, y = !s && m?.label && m.block ? m : void 0, U = r?.label || (y ? void 0 : m?.label) || void 0, b = !s && !!r?.label, B = i.in_description_cta || i.html_in_description_cta, K = () => {
93
+ const { is_mobile_webview: l, clientConfig: p } = S.appDataStore.appConfig;
94
+ it(i.template, {
95
+ isMobileWebview: l,
96
+ webviewScheme: p?.master?.ui_message_webview_url_scheme,
97
+ userGuid: e.user_guid ?? i.user_guid
84
98
  });
85
- }, r = b ? h.presentation : void 0, X = r?.kind === "hidden" && !!r.hideAll, T = !f && !!s?.label && !X, j = !!y && r?.kind !== "hidden" || T, _ = F.insights_feed?.general, k = C?.state === "not_refreshable" && !G && !!_;
86
- return /* @__PURE__ */ e(Q, {
87
- value: N,
88
- children: /* @__PURE__ */ u(x, {
99
+ }, n = b ? g.presentation : void 0, Y = n?.kind === "hidden" && !!n.hideAll, A = !s && !!a?.label && !Y, C = s ? N.presentation : void 0, $ = C?.kind === "status" ? C : void 0, k = C ? $?.action?.label : U, q = C?.title || G || "", J = !!k && n?.kind !== "hidden" || A, x = R.insights_feed?.general, _ = h?.state === "not_refreshable" && !V && !!x;
100
+ return /* @__PURE__ */ o(et, {
101
+ value: W,
102
+ children: /* @__PURE__ */ f(v, {
89
103
  sx: { mb: 16 },
90
104
  children: [
91
- o.cardState === "confirming" ? /* @__PURE__ */ e(fo, {
92
- onClose: o.collapseConfirmation,
93
- onLeaveFeedback: o.openHideSurvey,
94
- onUndo: o.undoDismiss
95
- }) : /* @__PURE__ */ u(ko, { children: [C && _ && /* @__PURE__ */ e(Co, {
96
- ...C,
97
- copy: _
98
- }), /* @__PURE__ */ u(vo, {
99
- inert: k,
100
- sx: { ...k && {
105
+ t.cardState === "confirming" ? /* @__PURE__ */ o(gt, {
106
+ onClose: t.collapseConfirmation,
107
+ onLeaveFeedback: t.openHideSurvey,
108
+ onUndo: t.undoDismiss
109
+ }) : /* @__PURE__ */ f(wt, { children: [h && x && /* @__PURE__ */ o(kt, {
110
+ ...h,
111
+ copy: x
112
+ }), /* @__PURE__ */ f(Lt, {
113
+ inert: _,
114
+ sx: { ..._ && {
101
115
  position: "relative",
102
116
  zIndex: 2,
103
117
  pointerEvents: "none"
104
118
  } },
105
119
  children: [
106
- k && /* @__PURE__ */ e(xo, { sx: wo }),
107
- /* @__PURE__ */ e(mo, {
108
- isMini: f,
109
- subtitle: z,
110
- title: W ?? ""
120
+ _ && /* @__PURE__ */ o(Dt, { sx: Bt }),
121
+ /* @__PURE__ */ o(bt, {
122
+ isMini: s,
123
+ subtitle: j,
124
+ title: q
111
125
  }),
112
- O ? /* @__PURE__ */ e(bo, {}) : B && /* @__PURE__ */ e(B, {
113
- beatGuid: w,
114
- payload: t
126
+ O ? /* @__PURE__ */ o(yt, {}) : T && /* @__PURE__ */ o(T, {
127
+ beatGuid: D,
128
+ payload: e
115
129
  }),
116
- /* @__PURE__ */ u(x, {
130
+ /* @__PURE__ */ f(v, {
117
131
  sx: {
118
132
  gap: 6,
119
133
  pb: 16,
@@ -121,15 +135,18 @@ var So = {}, wo = {
121
135
  px: 16
122
136
  },
123
137
  children: [
124
- /* @__PURE__ */ e(_o, {
125
- dangerouslySetInnerHTML: { __html: t.description.html_text },
126
- sx: { fontWeight: "fontWeightRegular" },
138
+ /* @__PURE__ */ o(St, {
139
+ dangerouslySetInnerHTML: { __html: e.description.html_text },
140
+ sx: {
141
+ fontWeight: "fontWeightRegular",
142
+ ...s && It
143
+ },
127
144
  variant: "subtitle2"
128
145
  }),
129
- g && /* @__PURE__ */ e(p, {
130
- endIcon: /* @__PURE__ */ e(A, {}),
131
- onClick: () => R.openActionDrawer({
132
- guid: w,
146
+ y && /* @__PURE__ */ o(u, {
147
+ endIcon: /* @__PURE__ */ o(I, {}),
148
+ onClick: () => E.openActionDrawer({
149
+ guid: D,
133
150
  trigger: "inDescriptionCta"
134
151
  }),
135
152
  sx: {
@@ -137,91 +154,93 @@ var So = {}, wo = {
137
154
  p: 4,
138
155
  width: "max-content"
139
156
  },
140
- children: g.label
157
+ children: y.label
141
158
  }),
142
- !d?.label && L && /* @__PURE__ */ e(p, {
143
- endIcon: /* @__PURE__ */ e(A, {}),
144
- onClick: U,
159
+ !m?.label && B && /* @__PURE__ */ o(u, {
160
+ endIcon: /* @__PURE__ */ o(I, {}),
161
+ onClick: K,
145
162
  sx: {
146
163
  height: 24,
147
164
  p: 4,
148
165
  width: "max-content"
149
166
  },
150
- children: L
167
+ children: B
151
168
  })
152
169
  ]
153
170
  }),
154
- j && /* @__PURE__ */ u(x, {
171
+ J && /* @__PURE__ */ f(v, {
155
172
  sx: {
156
173
  gap: 8,
157
174
  pb: 16,
158
175
  px: 16
159
176
  },
160
177
  children: [
161
- y && !b && /* @__PURE__ */ e(p, {
162
- sx: Do,
178
+ k && !b && /* @__PURE__ */ o(u, {
179
+ sx: At,
163
180
  variant: "text",
164
- children: y
181
+ children: k
165
182
  }),
166
- b && n && r?.kind === "status" && /* @__PURE__ */ e(ro, {
167
- action: r.action,
168
- icon: r.icon,
169
- label: r.label,
170
- tone: r.tone
183
+ b && r && n?.kind === "status" && /* @__PURE__ */ o(rt, {
184
+ action: n.action,
185
+ sx: n.sx,
186
+ variant: n.variant,
187
+ icon: n.icon,
188
+ label: n.label,
189
+ tone: n.tone
171
190
  }),
172
- b && n && !r && /* @__PURE__ */ e(p, {
173
- "aria-disabled": c(n.block) || h.disabled,
174
- disabled: h.disabled,
175
- onClick: () => D("primary", n),
176
- sx: { ...c(n.block) && { color: "text.disabled" } },
191
+ b && r && !n && /* @__PURE__ */ o(u, {
192
+ "aria-disabled": d(r.block) || g.disabled,
193
+ disabled: g.disabled,
194
+ onClick: () => L("primary", r),
195
+ sx: { ...d(r.block) && { color: "text.disabled" } },
177
196
  variant: "outlined",
178
- children: n.label
197
+ children: r.label
179
198
  }),
180
- T && s && /* @__PURE__ */ e(p, {
181
- "aria-disabled": c(s.block) || S.disabled,
199
+ A && a && /* @__PURE__ */ o(u, {
200
+ "aria-disabled": d(a.block) || w.disabled,
182
201
  color: "inherit",
183
- disabled: S.disabled,
184
- onClick: () => D("secondary", s),
202
+ disabled: w.disabled,
203
+ onClick: () => L("secondary", a),
185
204
  sx: {
186
- ...Bo,
187
- ...c(s.block) && { color: "text.disabled" }
205
+ ...Ot,
206
+ ...d(a.block) && { color: "text.disabled" }
188
207
  },
189
- children: s.label
208
+ children: a.label
190
209
  })
191
210
  ]
192
211
  }),
193
- /* @__PURE__ */ e(po, {
194
- onTellUsMore: o.openRatingSurvey,
195
- show: o.isFeedbackBarShown
212
+ /* @__PURE__ */ o(Ct, {
213
+ onTellUsMore: t.openRatingSurvey,
214
+ show: t.isFeedbackBarShown
196
215
  })
197
216
  ]
198
217
  })] }),
199
- /* @__PURE__ */ e(lo, { beat: i }),
200
- /* @__PURE__ */ e(uo, {
201
- isOpen: o.isDismissOpen,
202
- onClose: o.closeDismissDialog,
203
- onDismiss: o.confirmDismiss
218
+ /* @__PURE__ */ o(ut, { beat: i }),
219
+ /* @__PURE__ */ o(ht, {
220
+ isOpen: t.isDismissOpen,
221
+ onClose: t.closeDismissDialog,
222
+ onDismiss: t.confirmDismiss
204
223
  }),
205
- o.isSurveyOpen && /* @__PURE__ */ e(no, {
206
- characterLimitLabel: o.survey.characterLimitLabel,
207
- closeAriaLabel: o.survey.closeAriaLabel,
224
+ t.isSurveyOpen && /* @__PURE__ */ o(dt, {
225
+ characterLimitLabel: t.survey.characterLimitLabel,
226
+ closeAriaLabel: t.survey.closeAriaLabel,
208
227
  isOpen: !0,
209
- onBackClick: o.feedbackDialogCallbacks.onBackClick,
210
- onClose: o.closeSurvey,
211
- onSubmit: o.submitSurvey,
212
- onTextInputFocus: o.feedbackDialogCallbacks.onTextInputFocus,
213
- options: o.survey.options,
214
- primaryText: o.survey.submitText,
215
- secondaryText: o.survey.backText,
216
- title: o.survey.title
228
+ onBackClick: t.feedbackDialogCallbacks.onBackClick,
229
+ onClose: t.closeSurvey,
230
+ onSubmit: t.submitSurvey,
231
+ onTextInputFocus: t.feedbackDialogCallbacks.onTextInputFocus,
232
+ options: t.survey.options,
233
+ primaryText: t.survey.submitText,
234
+ secondaryText: t.survey.backText,
235
+ title: t.survey.title
217
236
  }),
218
- o.cardState === "visible" && t.footer && /* @__PURE__ */ e(co, { footer: t.footer })
237
+ t.cardState === "visible" && e.footer && /* @__PURE__ */ o(ft, { footer: e.footer })
219
238
  ]
220
239
  })
221
240
  });
222
241
  });
223
242
  export {
224
- re as default
243
+ co as default
225
244
  };
226
245
 
227
246
  //# 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 { 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 { CtaStatus } from './CtaStatus'\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\n// Full card's secondary CTA (e.g. Fee Detected's Contact Support): a quiet text button, 13/16\n// semibold in text.secondary. `color=\"inherit\"` keeps hover, ripple and focus off the primary palette.\n// An unavailable CTA (contact_support_block with no host handler) is dimmed at the call site, as the\n// primary CTA is, because it is only aria-disabled and so never matches `.Mui-disabled`.\nconst SECONDARY_CTA_SX = {\n color: 'text.secondary',\n fontSize: 13,\n fontWeight: 600,\n lineHeight: '16px',\n '&.Mui-disabled': { color: 'text.disabled' },\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 // The primary step's presenter may draw a status or nothing instead of the button (full card only).\n const primaryPresentation = isCtaButton ? primaryCtaState.presentation : undefined\n const hidesAllCtas = primaryPresentation?.kind === 'hidden' && !!primaryPresentation.hideAll\n const showSecondaryCta = !isMini && !!secondary_cta?.label && !hidesAllCtas\n const showCtaRow = (!!ctaLabel && primaryPresentation?.kind !== 'hidden') || showSecondaryCta\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 sx={{ fontWeight: 'fontWeightRegular' }}\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 {showCtaRow && (\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 && primaryPresentation?.kind === 'status' && (\n <CtaStatus\n action={primaryPresentation.action}\n icon={primaryPresentation.icon}\n label={primaryPresentation.label}\n tone={primaryPresentation.tone}\n />\n )}\n {isCtaButton && primary_cta && !primaryPresentation && (\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=\"inherit\"\n disabled={secondaryCtaState.disabled}\n onClick={() => onCtaClick('secondary', secondary_cta)}\n sx={{\n ...SECONDARY_CTA_SX,\n ...(isCtaDisabled(secondary_cta.block) && { color: 'text.disabled' }),\n }}\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,IAA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Q,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 { CtaStatus } from './CtaStatus'\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 as Figma's 24px text link, which fits Pulse's 312px mini slide: 13/16 semibold, 16px\n// line plus 4px above and below, its text starting at the card's 16px inset. A minimum height, not the\n// theme's fixed 44px Button height, so a long or translated label wraps instead of overflowing; MUI's\n// 64px minimum width and centring are undone for the same inset.\nconst MINI_CTA_SX = {\n alignItems: 'center',\n alignSelf: 'flex-start',\n display: 'flex',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n justifyContent: 'flex-start',\n lineHeight: '16px',\n minHeight: 24,\n minWidth: 0,\n px: 0,\n py: 4,\n textAlign: 'left',\n textTransform: 'none',\n} as const\n\n// Figma mini template: the description shows at most three lines, then an ellipsis.\nconst MINI_DESCRIPTION_SX = {\n display: '-webkit-box',\n overflow: 'hidden',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: 3,\n} as const\n\n// Full card's secondary CTA (e.g. Fee Detected's Contact Support): a quiet text button, 13/16\n// semibold in text.secondary. `color=\"inherit\"` keeps hover, ripple and focus off the primary palette.\n// An unavailable CTA (contact_support_block with no host handler) is dimmed at the call site, as the\n// primary CTA is, because it is only aria-disabled and so never matches `.Mui-disabled`.\nconst SECONDARY_CTA_SX = {\n color: 'text.secondary',\n // Figma: 40px (13/16 + 12px padding).\n height: 40,\n minHeight: 40,\n fontSize: 13,\n fontWeight: 600,\n lineHeight: '16px',\n '&.Mui-disabled': { color: 'text.disabled' },\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 action: actionCtaState,\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 // The primary step's presenter may draw a status or nothing instead of the button (full card only).\n const primaryPresentation = isCtaButton ? primaryCtaState.presentation : undefined\n const hidesAllCtas = primaryPresentation?.kind === 'hidden' && !!primaryPresentation.hideAll\n const showSecondaryCta = !isMini && !!secondary_cta?.label && !hidesAllCtas\n // Mini: the card's action (in_description_cta) mirrors the full card's state, as a label only.\n // Answered → the status's action word (Undo) and its answered title; hidden → no label. The tap\n // stays the host's (it opens the insight with its block), so nothing runs from mini itself.\n const miniPresentation = isMini ? actionCtaState.presentation : undefined\n const miniStatus = miniPresentation?.kind === 'status' ? miniPresentation : undefined\n const actionLabel = miniPresentation ? miniStatus?.action?.label : ctaLabel\n const cardTitle = miniPresentation?.title || title || ''\n const showCtaRow = (!!actionLabel && primaryPresentation?.kind !== 'hidden') || showSecondaryCta\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={cardTitle} />\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 sx={{ fontWeight: 'fontWeightRegular', ...(isMini && MINI_DESCRIPTION_SX) }}\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 {showCtaRow && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n {actionLabel &&\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 {actionLabel}\n </Button>\n )}\n {isCtaButton && primary_cta && primaryPresentation?.kind === 'status' && (\n <CtaStatus\n action={primaryPresentation.action}\n sx={primaryPresentation.sx}\n variant={primaryPresentation.variant}\n icon={primaryPresentation.icon}\n label={primaryPresentation.label}\n tone={primaryPresentation.tone}\n />\n )}\n {isCtaButton && primary_cta && !primaryPresentation && (\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=\"inherit\"\n disabled={secondaryCtaState.disabled}\n onClick={() => onCtaClick('secondary', secondary_cta)}\n sx={{\n ...SECONDARY_CTA_SX,\n ...(isCtaDisabled(secondary_cta.block) && { color: 'text.disabled' }),\n }}\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,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,GAMM,KAAc;AAAA,EAClB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,SAAS;AAAA,EACT,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,UAAU;AAAA,EACV,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,WAAW;AAAA,EACX,eAAe;AACjB,GAGM,KAAsB;AAAA,EAC1B,SAAS;AAAA,EACT,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,iBAAiB;AACnB,GAMM,KAAmB;AAAA,EACvB,OAAO;AAAA,EAEP,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,kBAAkB,EAAE,OAAO,gBAAgB;AAC7C,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,GAAmB,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AK,KAAK,EAAE,OAAO,gBAAgB;AAAA,kBACrE;AAAA,kBAEC,UAAA,EAAc;AAAA,gBACT,CAAA;AAAA,cAEL;AAAA;YAGT,gBAAA,EAAC,IAAD;AAAA,cAAa,cAAc,EAAK;AAAA,cAAkB,MAAM,EAAK;AAAA,YAAqB,CAAA;AAAA,UAC9E;AAAA,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,IAAD;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,11 +1,23 @@
1
+ import { SxProps } from '@mui/material/styles';
1
2
  export type CtaStatusTone = 'success' | 'neutral' | 'error';
3
+ /**
4
+ * How the status is drawn. `tinted` (default): a toned fill with toned text (Designate's "Account
5
+ * Saved!"). `alert`: Figma's `<Alert>`: the alert background, `text.primary` words and a small
6
+ * 13/16 action (Subscription Status's "Subscribed | Undo"). A new design adds a variant here; a CTA
7
+ * step picks one through its presenter.
8
+ */
9
+ export type CtaStatusVariant = 'tinted' | 'alert';
2
10
  export interface CtaStatusProps {
3
11
  /** The words, from the backend (copy or a slot) so they stay localized and customizable. */
4
12
  label: string;
5
13
  /** Background, border, icon and text colours. */
6
14
  tone: CtaStatusTone;
15
+ /** Which status design to draw; defaults to `tinted`. */
16
+ variant?: CtaStatusVariant;
7
17
  /** mx-icons name, drawn filled and hidden from assistive technology. */
8
18
  icon?: string;
19
+ /** Overrides for this status (outer bar); target the inner row via `CTA_STATUS_CONTENT_CLASS`. */
20
+ sx?: SxProps;
9
21
  /** An inline button inside the status (e.g. Subscription Detected's "Undo"). */
10
22
  action?: {
11
23
  label: string;
@@ -16,4 +28,5 @@ export interface CtaStatusProps {
16
28
  * A CTA slot's status: what the slot shows once its action is done, instead of a button. Not a
17
29
  * control itself (`role="status"`); only the optional inline `action` is pressable.
18
30
  */
19
- export declare const CtaStatus: ({ label, tone, icon, action }: CtaStatusProps) => import("react/jsx-runtime").JSX.Element;
31
+ export declare const CTA_STATUS_CONTENT_CLASS = "CtaStatus-content";
32
+ export declare const CtaStatus: ({ label, tone, variant, icon, action, sx, }: CtaStatusProps) => import("react/jsx-runtime").JSX.Element;