@mx-cartographer/experiences 9.7.197 → 9.7.199-alpha-moratorium

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 +11 -1
  2. package/dist/core/types/Insights.d.ts +1 -1
  3. package/dist/core/types/Insights.es.js.map +1 -1
  4. package/dist/core/types/localization/InsightsFeedCopy.d.ts +6 -0
  5. package/dist/insights/components/insights/BillAmountNotStandard/BillAmountNotStandard.es.js +4 -4
  6. package/dist/insights/components/insights/BillAmountNotStandard/BillAmountNotStandardMUI.es.js +4 -4
  7. package/dist/insights/components/insights/MonthlySpendingComparisonV2/MonthlySpendingComparisonV2.es.js +4 -4
  8. package/dist/insights/components/insights/WeeklyNoSpendDays/WeeklyNoSpendDays.es.js +8 -8
  9. package/dist/insights/components/shared/Charts/EmptyBarChart.es.js +4 -4
  10. package/dist/insights/components/shared/ZeroState/LinedCardZeroState.es.js +4 -4
  11. package/dist/insights/index.es.js +84 -84
  12. package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsV2.es.js +17 -17
  13. package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsV2.es.js.map +1 -1
  14. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.d.ts +1 -5
  15. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.es.js +37 -36
  16. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.es.js.map +1 -1
  17. package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.d.ts +9 -11
  18. package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.es.js +12 -6
  19. package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.es.js.map +1 -1
  20. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +1 -0
  21. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +216 -185
  22. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
  23. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.d.ts +3 -1
  24. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js +12 -11
  25. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js.map +1 -1
  26. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.d.ts +2 -2
  27. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js +13 -13
  28. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js.map +1 -1
  29. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.d.ts +10 -4
  30. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js +78 -71
  31. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js.map +1 -1
  32. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.d.ts +2 -4
  33. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.es.js +78 -82
  34. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.es.js.map +1 -1
  35. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js +30 -24
  36. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
  37. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.d.ts +7 -0
  38. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.es.js +46 -0
  39. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.es.js.map +1 -0
  40. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/index.d.ts +3 -0
  41. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.d.ts +10 -0
  42. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.es.js +17 -0
  43. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.es.js.map +1 -0
  44. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js +25 -25
  45. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js.map +1 -1
  46. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.d.ts +0 -2
  47. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js +17 -21
  48. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js.map +1 -1
  49. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js +46 -63
  50. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js.map +1 -1
  51. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.d.ts +3 -3
  52. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js +44 -53
  53. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js.map +1 -1
  54. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.d.ts +1 -1
  55. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.es.js +30 -31
  56. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.es.js.map +1 -1
  57. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +54 -53
  58. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
  59. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +5 -3
  60. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +11 -9
  61. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
  62. package/dist/insights-v2/blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js +28 -27
  63. package/dist/insights-v2/blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js.map +1 -1
  64. package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +1 -0
  65. package/dist/insights-v2/components/AccountHeroCard.d.ts +3 -1
  66. package/dist/insights-v2/components/AccountHeroCard.es.js.map +1 -1
  67. package/dist/insights-v2/components/CompactDirectDepositCard.d.ts +26 -0
  68. package/dist/insights-v2/components/CompactDirectDepositCard.es.js +73 -0
  69. package/dist/insights-v2/components/CompactDirectDepositCard.es.js.map +1 -0
  70. package/dist/insights-v2/components/DirectDepositCard.d.ts +6 -1
  71. package/dist/insights-v2/components/DirectDepositCard.es.js +22 -20
  72. package/dist/insights-v2/components/DirectDepositCard.es.js.map +1 -1
  73. package/dist/insights-v2/components/LogoFromGuid.d.ts +1 -1
  74. package/dist/insights-v2/components/LogoFromGuid.es.js.map +1 -1
  75. package/dist/insights-v2/components/MerchantHighlightCard.es.js +4 -4
  76. package/dist/insights-v2/components/TransactionListCard.d.ts +3 -1
  77. package/dist/insights-v2/components/TransactionListCard.es.js +25 -25
  78. package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
  79. package/dist/insights-v2/components/TransferLogoCard.es.js +1 -0
  80. package/dist/insights-v2/components/TransferLogoCard.es.js.map +1 -1
  81. package/dist/insights-v2/index.es.js +120 -116
  82. package/dist/insights-v2/mappings/blocks.es.js +118 -116
  83. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  84. package/dist/microinsights/cards/InsightCard.es.js +53 -53
  85. package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
  86. package/package.json +1 -1
@@ -1,54 +1,60 @@
1
- import { asNonEmptyText as s, asNumber as _ } from "../../blocks/slotReaders.es.js";
2
- import { readHelp as E } from "../HelpBlock/layout.es.js";
3
- import { parseISO as I } from "date-fns/parseISO";
4
- var a = {
1
+ import { asLogoRef as E, asNonEmptyText as s, asNumber as _ } from "../../blocks/slotReaders.es.js";
2
+ import { logoFromEntityGuid as S } from "../../components/shared/EntityLogo.es.js";
3
+ import { readHelp as v } from "../HelpBlock/layout.es.js";
4
+ import { parseISO as y } from "date-fns/parseISO";
5
+ var o = {
5
6
  SUMMARY_HEADER: "summary_header",
6
7
  GENERIC_LIST: "generic_list",
7
8
  HELP_HEADER: "help_header",
8
9
  DEPOSIT_HISTORY: "deposit_history",
9
10
  CREDIT_LIMIT_HEADER: "credit_limit_header",
10
- SUBSCRIPTION_LIST: "subscription_list"
11
- }, v = a.HELP_HEADER, f = (t) => t.transactions?.transactions_title, T = {
12
- [a.SUMMARY_HEADER]: { accountSubline: !0 },
13
- [a.GENERIC_LIST]: { title: f },
14
- [a.HELP_HEADER]: { title: f },
15
- [a.DEPOSIT_HISTORY]: { title: (t) => t.insights_feed?.transaction_list_block?.deposit_history_drawer_title },
16
- [a.CREDIT_LIMIT_HEADER]: { title: (t) => t.insights_feed?.transaction_list_block?.credit_limit_header_drawer_title },
17
- [a.SUBSCRIPTION_LIST]: {
11
+ SUBSCRIPTION_LIST: "subscription_list",
12
+ SUMMARY_LIST: "summary_list"
13
+ }, h = o.HELP_HEADER, m = (t) => t.transactions?.transactions_title, f = {
14
+ [o.SUMMARY_HEADER]: {
15
+ accountSubline: !0,
16
+ summary: !0
17
+ },
18
+ [o.GENERIC_LIST]: { title: m },
19
+ [o.HELP_HEADER]: { title: m },
20
+ [o.DEPOSIT_HISTORY]: { title: (t) => t.insights_feed?.transaction_list_block?.deposit_history_drawer_title },
21
+ [o.CREDIT_LIMIT_HEADER]: { title: (t) => t.insights_feed?.transaction_list_block?.credit_limit_header_drawer_title },
22
+ [o.SUBSCRIPTION_LIST]: {
18
23
  title: (t) => t.insights_feed?.transaction_list_block?.subscriptions_drawer_title,
19
24
  accountSubline: !0
20
- }
21
- }, S = (t) => t != null && Object.hasOwn(T, t) ? T[t] : {}, H = (t, e, r) => {
22
- const { title: n } = S(t);
23
- return (n ? n(e) : r?.insights_payload?.title) ?? "";
24
- }, N = (t, e) => {
25
- if (t?.variant !== v) return;
26
- const r = s(e?.help_label), n = E(e);
25
+ },
26
+ [o.SUMMARY_LIST]: { summary: !0 }
27
+ }, p = (t) => t != null && Object.hasOwn(f, t) ? f[t] : {}, w = (t, e, r) => {
28
+ const { title: i } = p(t);
29
+ return (i ? i(e) : r?.insights_payload?.title) ?? "";
30
+ }, M = (t, e) => {
31
+ if (t?.variant !== h) return;
32
+ const r = s(e?.help_label), i = v(e);
27
33
  return {
28
34
  descriptionHtml: s(e?.description_html),
29
- ...r && n && { learnMore: {
30
- ...n,
35
+ ...r && i && { learnMore: {
36
+ ...i,
31
37
  label: r
32
38
  } }
33
39
  };
34
- }, p = (t) => typeof t == "number" && Number.isInteger(t) && t > 0 ? t : void 0, h = Date.UTC(2e3, 0, 1), b = Date.UTC(2100, 0, 1), m = /* @__PURE__ */ new WeakMap(), c = (t, e) => {
35
- const r = m.get(t) ?? /* @__PURE__ */ new Set();
36
- r.has(e) || (m.set(t, r.add(e)), console.warn(e));
37
- }, l = (t, e, r) => {
40
+ }, I = (t) => typeof t == "number" && Number.isInteger(t) && t > 0 ? t : void 0, b = Date.UTC(2e3, 0, 1), L = Date.UTC(2100, 0, 1), T = /* @__PURE__ */ new WeakMap(), c = (t, e) => {
41
+ const r = T.get(t) ?? /* @__PURE__ */ new Set();
42
+ r.has(e) || (T.set(t, r.add(e)), console.warn(e));
43
+ }, u = (t, e, r) => {
38
44
  if (t == null || t === "") return;
39
- let n;
40
- if (typeof t == "number" && Number.isFinite(t)) n = t < 1e12 ? t * 1e3 : t;
45
+ let i;
46
+ if (typeof t == "number" && Number.isFinite(t)) i = t < 1e12 ? t * 1e3 : t;
41
47
  else if (typeof t == "string") {
42
- const i = I(t).getTime();
43
- n = Number.isNaN(i) ? void 0 : i;
48
+ const n = y(t).getTime();
49
+ i = Number.isNaN(n) ? void 0 : n;
44
50
  }
45
- if (n === void 0 || n < h || n > b) {
51
+ if (i === void 0 || i < b || i > L) {
46
52
  c(r, `[TransactionListBlock] drilldown_data.${e} is unparseable or out of range (${typeof t})`);
47
53
  return;
48
54
  }
49
- return new Date(n);
50
- }, w = (t) => {
51
- if (t?.variant !== a.SUMMARY_HEADER) return;
55
+ return new Date(i);
56
+ }, O = (t) => {
57
+ if (!p(t?.variant).summary) return;
52
58
  const e = t?.drilldown_data;
53
59
  if (!e) return;
54
60
  const r = _(e.amount);
@@ -58,66 +64,67 @@ var a = {
58
64
  }
59
65
  return {
60
66
  amount: r,
61
- startDate: l(e.start_date, "start_date", e),
62
- endDate: l(e.end_date, "end_date", e),
63
- count: p(e.count)
67
+ startDate: u(e.start_date, "start_date", e),
68
+ endDate: u(e.end_date, "end_date", e),
69
+ count: I(e.count),
70
+ icon: S(E(e.logo)?.guid)?.logo_name
64
71
  };
65
- }, O = (t) => {
66
- if (t?.variant !== a.CREDIT_LIMIT_HEADER) return;
67
- const e = t.drilldown_data, r = _(e?.current_balance), n = _(e?.credit_limit);
68
- if (r === void 0 || n === void 0 || n <= 0) return;
69
- const i = s(e?.institution_guid), o = s(e?.institution_name), d = s(e?.account_name);
72
+ }, C = (t) => {
73
+ if (t?.variant !== o.CREDIT_LIMIT_HEADER) return;
74
+ const e = t.drilldown_data, r = _(e?.current_balance), i = _(e?.credit_limit);
75
+ if (r === void 0 || i === void 0 || i <= 0) return;
76
+ const n = s(e?.institution_guid), a = s(e?.institution_name), d = s(e?.account_name);
70
77
  return {
71
78
  balance: r,
72
- limit: n,
73
- utilization: Math.max(0, Math.round(r / n * 100)),
74
- ...i && { institutionGuid: i },
75
- ...o && { institutionName: o },
79
+ limit: i,
80
+ utilization: Math.max(0, Math.round(r / i * 100)),
81
+ ...n && { institutionGuid: n },
82
+ ...a && { institutionName: a },
76
83
  ...d && { accountName: d }
77
84
  };
78
- }, R = /^(\d{4})-(\d{2})-\d{2}$/, y = (t, e) => {
79
- const r = typeof t == "string" ? R.exec(t) : null, n = r ? Number(r[2]) : 0;
80
- if (r && n >= 1 && n <= 12) return new Date(Number(r[1]), n - 1, 1);
81
- const i = l(t, "date", e);
82
- return i && new Date(i.getUTCFullYear(), i.getUTCMonth(), 1);
83
- }, g = (t) => {
84
- if (t?.variant !== a.SUBSCRIPTION_LIST) return;
85
+ }, R = /^(\d{4})-(\d{2})-\d{2}$/, g = (t, e) => {
86
+ const r = typeof t == "string" ? R.exec(t) : null, i = r ? Number(r[2]) : 0;
87
+ if (r && i >= 1 && i <= 12) return new Date(Number(r[1]), i - 1, 1);
88
+ const n = u(t, "date", e);
89
+ return n && new Date(n.getUTCFullYear(), n.getUTCMonth(), 1);
90
+ }, P = (t) => {
91
+ if (t?.variant !== o.SUBSCRIPTION_LIST) return;
85
92
  const e = t.drilldown_data, r = e?.transaction_frequencies;
86
93
  if (r == null) return;
87
94
  if (!Array.isArray(r)) {
88
95
  c(e, "[TransactionListBlock] drilldown_data.transaction_frequencies is not a list — captioning no rows.");
89
96
  return;
90
97
  }
91
- const n = /* @__PURE__ */ new Map();
92
- let i = 0;
93
- return r.forEach((o) => {
94
- const d = typeof o == "object" && o !== null ? s(o.transaction_guid) : void 0, u = typeof o == "object" && o !== null ? _(o.recurrence_type) : void 0;
95
- d && u !== void 0 ? n.set(d, u) : i += 1;
96
- }), i > 0 && c(e, `[TransactionListBlock] dropped ${i} malformed drilldown_data.transaction_frequencies row(s).`), n.size > 0 ? n : void 0;
97
- }, C = (t) => {
98
- if (t?.variant !== a.SUBSCRIPTION_LIST) return;
98
+ const i = /* @__PURE__ */ new Map();
99
+ let n = 0;
100
+ return r.forEach((a) => {
101
+ const d = typeof a == "object" && a !== null ? s(a.transaction_guid) : void 0, l = typeof a == "object" && a !== null ? _(a.recurrence_type) : void 0;
102
+ d && l !== void 0 ? i.set(d, l) : n += 1;
103
+ }), n > 0 && c(e, `[TransactionListBlock] dropped ${n} malformed drilldown_data.transaction_frequencies row(s).`), i.size > 0 ? i : void 0;
104
+ }, U = (t) => {
105
+ if (t?.variant !== o.SUBSCRIPTION_LIST) return;
99
106
  const e = t.drilldown_data;
100
107
  if (!e) return;
101
- const r = p(e.count);
108
+ const r = I(e.count);
102
109
  if (r === void 0) {
103
110
  Object.keys(e).length > 0 && c(e, "[TransactionListBlock] drilldown_data has no positive integer `count` — no subscription header.");
104
111
  return;
105
112
  }
106
113
  return {
107
114
  count: r,
108
- month: y(e.date, e)
115
+ month: g(e.date, e)
109
116
  };
110
117
  };
111
118
  export {
112
- v as HELP_HEADER_VARIANT,
113
- a as TRANSACTION_LIST_VARIANTS,
114
- H as getTransactionListDrawerTitle,
115
- O as readCreditLimitHeader,
116
- N as readHelpHeader,
117
- C as readSubscriptionHeader,
118
- w as readSummary,
119
- g as readTransactionFrequencies,
120
- S as transactionListLayout
119
+ h as HELP_HEADER_VARIANT,
120
+ o as TRANSACTION_LIST_VARIANTS,
121
+ w as getTransactionListDrawerTitle,
122
+ C as readCreditLimitHeader,
123
+ M as readHelpHeader,
124
+ U as readSubscriptionHeader,
125
+ O as readSummary,
126
+ P as readTransactionFrequencies,
127
+ p as transactionListLayout
121
128
  };
122
129
 
123
130
  //# sourceMappingURL=layout.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/layout.ts"],"sourcesContent":["import { parseISO } from 'date-fns/parseISO'\n\nimport type {\n Beat,\n DrilldownData,\n GlobalCopy,\n InDescriptionCTA,\n PrimaryCTA,\n SecondaryCTA,\n} from '../../../core'\nimport { asNonEmptyText, asNumber } from '../../blocks/slotReaders'\nimport { readHelp, type HelpContent } from '../HelpBlock/layout'\n\ntype DrilldownCta = PrimaryCTA | SecondaryCTA | InDescriptionCTA\n\n/** The transaction_list_block CTA variants. */\nexport const TRANSACTION_LIST_VARIANTS = {\n SUMMARY_HEADER: 'summary_header',\n GENERIC_LIST: 'generic_list',\n /** Opens the list under the beat's title, description and \"Learn More\". */\n HELP_HEADER: 'help_header',\n /** Opens Micro Deposits' Deposit History list. */\n DEPOSIT_HISTORY: 'deposit_history',\n /** Opens Credit Card Close to Limit's Spending list under the card's credit-limit header. */\n CREDIT_LIMIT_HEADER: 'credit_limit_header',\n /** Opens Monthly Subscription Aggregate's Subscriptions list under a count tile and a tip. */\n SUBSCRIPTION_LIST: 'subscription_list',\n} as const\n\nexport const HELP_HEADER_VARIANT = TRANSACTION_LIST_VARIANTS.HELP_HEADER\n\ninterface TransactionListLayout {\n /** The drawer title; absent: the beat's own title. */\n title?: (copy: GlobalCopy) => string | undefined\n /** Rows are subtitled with the account (institution logo and name), not the category. */\n accountSubline?: boolean\n}\n\nconst transactionsTitle = (copy: GlobalCopy) => copy.transactions?.transactions_title\n\n/** Per-variant drawer layout. Add new variants here. */\nconst LAYOUT: Record<string, TransactionListLayout> = {\n [TRANSACTION_LIST_VARIANTS.SUMMARY_HEADER]: { accountSubline: true },\n [TRANSACTION_LIST_VARIANTS.GENERIC_LIST]: { title: transactionsTitle },\n [TRANSACTION_LIST_VARIANTS.HELP_HEADER]: { title: transactionsTitle },\n [TRANSACTION_LIST_VARIANTS.DEPOSIT_HISTORY]: {\n title: (copy) => copy.insights_feed?.transaction_list_block?.deposit_history_drawer_title,\n },\n [TRANSACTION_LIST_VARIANTS.CREDIT_LIMIT_HEADER]: {\n title: (copy) => copy.insights_feed?.transaction_list_block?.credit_limit_header_drawer_title,\n },\n [TRANSACTION_LIST_VARIANTS.SUBSCRIPTION_LIST]: {\n title: (copy) => copy.insights_feed?.transaction_list_block?.subscriptions_drawer_title,\n accountSubline: true,\n },\n}\n\n// `Object.hasOwn`, as in resolveVariantConfig: the variant is backend-controlled.\nexport const transactionListLayout = (variant: string | null | undefined): TransactionListLayout =>\n variant != null && Object.hasOwn(LAYOUT, variant) ? LAYOUT[variant] : {}\n\n/** Drawer title: the variant's title when it has one, otherwise the beat's own title. */\nexport const getTransactionListDrawerTitle = (\n variant: string | null | undefined,\n copy: GlobalCopy,\n beat?: Beat,\n): string => {\n const { title } = transactionListLayout(variant)\n\n return (title ? title(copy) : beat?.insights_payload?.title) ?? ''\n}\n\nexport interface HelpHeaderContent {\n /** Pre-localized HTML under the title, from the payload's `drilldown_data.description_html`. */\n descriptionHtml?: string\n /** The \"Learn More\" link and the help drawer it opens; absent when the beat carries no help. */\n learnMore?: HelpContent & { label: string }\n}\n\n/**\n * The help-header variant's text, read from the payload's `drilldown_data` (shared by every CTA\n * of the card): `description_html`, and `help_label` with the `help_title` / `help_html` that\n * `readHelp` reads. Only the `help_header` variant renders the block.\n */\nexport const readHelpHeader = (\n cta: DrilldownCta | undefined,\n drilldown: DrilldownData | undefined,\n): HelpHeaderContent | undefined => {\n if (cta?.variant !== HELP_HEADER_VARIANT) return undefined\n\n const label = asNonEmptyText(drilldown?.help_label)\n const help = readHelp(drilldown)\n\n return {\n descriptionHtml: asNonEmptyText(drilldown?.description_html),\n ...(label && help && { learnMore: { ...help, label } }),\n }\n}\n\nexport interface TransactionListSummary {\n /** Headline figure (e.g. total withdrawn). */\n amount: number\n /** Validated range endpoints; rendered as `{start} – {end}`. Omitted when the payload value is\n * missing or unparseable (so the drawer never crashes on an Invalid Date). */\n startDate?: Date\n endDate?: Date\n /** Number of transactions for the pill, from the CTA's `drilldown_data.count`. */\n count?: number\n}\n\n// `> 0`: the card only shows with >= 1 guid, so a `count` of 0 is dropped and falls back to the\n// guid count rather than rendering \"0 transactions\".\nconst toCount = (value: unknown): number | undefined =>\n typeof value === 'number' && Number.isInteger(value) && value > 0 ? value : undefined\n\n// Sane epoch window so a bad/typo payload can't render a far-past/future date.\nconst EPOCH_MIN = Date.UTC(2000, 0, 1)\nconst EPOCH_MAX = Date.UTC(2100, 0, 1)\n\n// The readers run on every observer re-render, so each distinct warning fires once per payload object.\nconst warnedPayloads = new WeakMap<object, Set<string>>()\nconst warnOncePerPayload = (source: object, message: string): void => {\n const warned = warnedPayloads.get(source) ?? new Set<string>()\n if (warned.has(message)) return\n warnedPayloads.set(source, warned.add(message))\n console.warn(message)\n}\n\n/**\n * Parse a payload date value to a validated `Date`, or `undefined`. Accepts unix seconds or\n * milliseconds (auto-detected) and ISO strings. Fails closed (no throw): an unparseable or\n * out-of-range value returns undefined and warns, so `formatDate`/`intlFormat` never sees an Invalid\n * Date (which throws `RangeError` and takes down the whole drawer render).\n */\nconst toDate = (value: unknown, field: string, source: object): Date | undefined => {\n // Missing/empty is a normal \"no range\" case — return quietly, don't warn.\n if (value === undefined || value === null || value === '') return undefined\n\n let ms: number | undefined\n if (typeof value === 'number' && Number.isFinite(value)) {\n // < 1e12 is treated as seconds (1e12 ms is year 33658). Trade-off: genuine ms timestamps from\n // ~2000-2001 would be misread as seconds and fall outside the window below (dropped, not shown).\n ms = value < 1e12 ? value * 1000 : value\n } else if (typeof value === 'string') {\n const parsed = parseISO(value).getTime()\n ms = Number.isNaN(parsed) ? undefined : parsed\n }\n\n if (ms === undefined || ms < EPOCH_MIN || ms > EPOCH_MAX) {\n warnOncePerPayload(\n source,\n `[TransactionListBlock] drilldown_data.${field} is unparseable or out of range (${typeof value})`,\n )\n return undefined\n }\n return new Date(ms)\n}\n\n/**\n * Summary-header figures for the drawer, read from the clicked CTA's `drilldown_data` (the backend\n * hangs a drilldown's own data off the CTA that opens it). Fails closed throughout: only the\n * `summary_header` variant renders a header (so figures from a different CTA that `getDynamicCta…`\n * fell back to can't be misattributed), then without a finite `amount` there is still no header, and\n * each date is validated to a real `Date` or dropped — an unparseable value never reaches\n * `formatDate` (which throws on an Invalid Date).\n *\n * `drilldown_data` fields: `amount` (number), `start_date`/`end_date` (unix seconds|ms or ISO),\n * `count` (number of transactions).\n */\nexport const readSummary = (cta: DrilldownCta | undefined): TransactionListSummary | undefined => {\n // Defense-in-depth on financial figures: only the summary-header variant shows the card.\n if (cta?.variant !== TRANSACTION_LIST_VARIANTS.SUMMARY_HEADER) return undefined\n\n const source = cta?.drilldown_data\n if (!source) return undefined\n\n const amount = asNumber(source.amount)\n if (amount === undefined) {\n // `drilldown_data` present but no usable amount -> surface the likely contract drift (field\n // rename) instead of a silently missing header.\n if (Object.keys(source).length > 0) {\n warnOncePerPayload(\n source,\n '[TransactionListBlock] drilldown_data has no finite `amount` — no summary header.',\n )\n }\n return undefined\n }\n\n return {\n amount,\n startDate: toDate(source.start_date, 'start_date', source),\n endDate: toDate(source.end_date, 'end_date', source),\n count: toCount(source.count),\n }\n}\n\nexport interface CreditLimitHeader {\n balance: number\n limit: number\n /** Whole percent of the limit used; over 100 when the card is over its limit. */\n utilization: number\n institutionGuid?: string\n institutionName?: string\n accountName?: string\n}\n\n/** The credit-limit header from the clicked CTA's `drilldown_data`; only `credit_limit_header`, with a positive limit. */\nexport const readCreditLimitHeader = (\n cta: DrilldownCta | undefined,\n): CreditLimitHeader | undefined => {\n if (cta?.variant !== TRANSACTION_LIST_VARIANTS.CREDIT_LIMIT_HEADER) return undefined\n\n const source = cta.drilldown_data\n const balance = asNumber(source?.current_balance)\n const limit = asNumber(source?.credit_limit)\n if (balance === undefined || limit === undefined || limit <= 0) return undefined\n\n const institutionGuid = asNonEmptyText(source?.institution_guid)\n const institutionName = asNonEmptyText(source?.institution_name)\n const accountName = asNonEmptyText(source?.account_name)\n\n return {\n balance,\n limit,\n utilization: Math.max(0, Math.round((balance / limit) * 100)),\n ...(institutionGuid && { institutionGuid }),\n ...(institutionName && { institutionName }),\n ...(accountName && { accountName }),\n }\n}\n\nconst DATE_ONLY = /^(\\d{4})-(\\d{2})-\\d{2}$/\n\n/** The month a drilldown date names, as local midnight on the 1st. A date-only string already names its month. */\nconst toMonthStart = (value: unknown, source: object): Date | undefined => {\n const dateOnly = typeof value === 'string' ? DATE_ONLY.exec(value) : null\n const month = dateOnly ? Number(dateOnly[2]) : 0\n if (dateOnly && month >= 1 && month <= 12) return new Date(Number(dateOnly[1]), month - 1, 1)\n\n // An epoch or a timestamp is an instant: its UTC month is the one tupac meant.\n const date = toDate(value, 'date', source)\n return date && new Date(date.getUTCFullYear(), date.getUTCMonth(), 1)\n}\n\n/** Each listed transaction's schedule, from `drilldown_data.transaction_frequencies`; malformed rows are dropped. */\nexport const readTransactionFrequencies = (\n cta: DrilldownCta | undefined,\n): Map<string, number> | undefined => {\n if (cta?.variant !== TRANSACTION_LIST_VARIANTS.SUBSCRIPTION_LIST) return undefined\n\n const source = cta.drilldown_data\n const rows = source?.transaction_frequencies\n if (rows === undefined || rows === null) return undefined\n\n if (!Array.isArray(rows)) {\n warnOncePerPayload(\n source as object,\n '[TransactionListBlock] drilldown_data.transaction_frequencies is not a list — captioning no rows.',\n )\n return undefined\n }\n\n const byGuid = new Map<string, number>()\n let dropped = 0\n rows.forEach((row) => {\n const guid =\n typeof row === 'object' && row !== null ? asNonEmptyText(row.transaction_guid) : undefined\n const type = typeof row === 'object' && row !== null ? asNumber(row.recurrence_type) : undefined\n\n if (guid && type !== undefined) byGuid.set(guid, type)\n else dropped += 1\n })\n\n if (dropped > 0) {\n warnOncePerPayload(\n source as object,\n `[TransactionListBlock] dropped ${dropped} malformed drilldown_data.transaction_frequencies row(s).`,\n )\n }\n\n return byGuid.size > 0 ? byGuid : undefined\n}\n\nexport interface SubscriptionListHeader {\n /** Subscriptions paid in the month, from the CTA's `drilldown_data.count`. */\n count: number\n /** The month paid in, as local midnight on the 1st; omitted when missing or unparseable. */\n month?: Date\n}\n\n/** The count tile's figures; only for `subscription_list` with a positive integer `count`. */\nexport const readSubscriptionHeader = (\n cta: DrilldownCta | undefined,\n): SubscriptionListHeader | undefined => {\n if (cta?.variant !== TRANSACTION_LIST_VARIANTS.SUBSCRIPTION_LIST) return undefined\n\n const source = cta.drilldown_data\n if (!source) return undefined\n\n const count = toCount(source.count)\n if (count === undefined) {\n if (Object.keys(source).length > 0) {\n warnOncePerPayload(\n source,\n '[TransactionListBlock] drilldown_data has no positive integer `count` — no subscription header.',\n )\n }\n return undefined\n }\n\n return {\n count,\n month: toMonthStart(source.date, source),\n }\n}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CAAC,MAAM,QAAQ,CAAI,GAAG;AACxB,IAAA,EACE,GACA,mGACF;AACA;AAAA,EACF;AAEA,QAAM,IAAS,oBAAI,IAAoB;AACvC,MAAI,IAAU;AACd,SAAA,EAAK,QAAA,CAAS,MAAQ;AACpB,UAAM,IACJ,OAAO,KAAQ,YAAY,MAAQ,OAAO,EAAe,EAAI,gBAAgB,IAAI,QAC7E,IAAO,OAAO,KAAQ,YAAY,MAAQ,OAAO,EAAS,EAAI,eAAe,IAAI;AAEvF,IAAI,KAAQ,MAAS,SAAW,EAAO,IAAI,GAAM,CAAI,IAChD,KAAW;AAAA,EAClB,CAAC,GAEG,IAAU,KACZ,EACE,GACA,kCAAkC,CAAA,2DACpC,GAGK,EAAO,OAAO,IAAI,IAAS;AACpC,GAUa,IAAA,CACX,MACuC;AACvC,MAAI,GAAK,YAAY,EAA0B,kBAAmB;AAElE,QAAM,IAAS,EAAI;AACnB,MAAI,CAAC,EAAQ;AAEb,QAAM,IAAQ,EAAQ,EAAO,KAAK;AAClC,MAAI,MAAU,QAAW;AACvB,IAAI,OAAO,KAAK,CAAM,EAAE,SAAS,KAC/B,EACE,GACA,iGACF;AAEF;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAA;AAAA,IACA,OAAO,EAAa,EAAO,MAAM,CAAM;AAAA,EACzC;AACF"}
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/layout.ts"],"sourcesContent":["import { parseISO } from 'date-fns/parseISO'\n\nimport type {\n Beat,\n DrilldownData,\n GlobalCopy,\n InDescriptionCTA,\n PrimaryCTA,\n SecondaryCTA,\n} from '../../../core'\nimport { asLogoRef, asNonEmptyText, asNumber } from '../../blocks/slotReaders'\nimport { logoFromEntityGuid } from '../../components/shared/EntityLogo'\nimport { readHelp, type HelpContent } from '../HelpBlock/layout'\n\ntype DrilldownCta = PrimaryCTA | SecondaryCTA | InDescriptionCTA\n\n/** The transaction_list_block CTA variants. */\nexport const TRANSACTION_LIST_VARIANTS = {\n SUMMARY_HEADER: 'summary_header',\n GENERIC_LIST: 'generic_list',\n /** Opens the list under the beat's title, description and \"Learn More\". */\n HELP_HEADER: 'help_header',\n /** Opens Micro Deposits' Deposit History list. */\n DEPOSIT_HISTORY: 'deposit_history',\n /** Opens Credit Card Close to Limit's Spending list under the card's credit-limit header. */\n CREDIT_LIMIT_HEADER: 'credit_limit_header',\n /** Opens Monthly Subscription Aggregate's Subscriptions list under a count tile and a tip. */\n SUBSCRIPTION_LIST: 'subscription_list',\n /** The summary_header card over plain rows that keep the category subline (Weekly Small Purchases Summary). */\n SUMMARY_LIST: 'summary_list',\n} as const\n\nexport const HELP_HEADER_VARIANT = TRANSACTION_LIST_VARIANTS.HELP_HEADER\n\ninterface TransactionListLayout {\n /** The drawer title; absent: the beat's own title. */\n title?: (copy: GlobalCopy) => string | undefined\n /** Rows are subtitled with the account (institution logo and name), not the category. */\n accountSubline?: boolean\n /** The list opens under the summary card (total, date range, count pill). */\n summary?: boolean\n}\n\nconst transactionsTitle = (copy: GlobalCopy) => copy.transactions?.transactions_title\n\n/** Per-variant drawer layout. Add new variants here. */\nconst LAYOUT: Record<string, TransactionListLayout> = {\n [TRANSACTION_LIST_VARIANTS.SUMMARY_HEADER]: { accountSubline: true, summary: true },\n [TRANSACTION_LIST_VARIANTS.GENERIC_LIST]: { title: transactionsTitle },\n [TRANSACTION_LIST_VARIANTS.HELP_HEADER]: { title: transactionsTitle },\n [TRANSACTION_LIST_VARIANTS.DEPOSIT_HISTORY]: {\n title: (copy) => copy.insights_feed?.transaction_list_block?.deposit_history_drawer_title,\n },\n [TRANSACTION_LIST_VARIANTS.CREDIT_LIMIT_HEADER]: {\n title: (copy) => copy.insights_feed?.transaction_list_block?.credit_limit_header_drawer_title,\n },\n [TRANSACTION_LIST_VARIANTS.SUBSCRIPTION_LIST]: {\n title: (copy) => copy.insights_feed?.transaction_list_block?.subscriptions_drawer_title,\n accountSubline: true,\n },\n [TRANSACTION_LIST_VARIANTS.SUMMARY_LIST]: { summary: true },\n}\n\n// `Object.hasOwn`, as in resolveVariantConfig: the variant is backend-controlled.\nexport const transactionListLayout = (variant: string | null | undefined): TransactionListLayout =>\n variant != null && Object.hasOwn(LAYOUT, variant) ? LAYOUT[variant] : {}\n\n/** Drawer title: the variant's title when it has one, otherwise the beat's own title. */\nexport const getTransactionListDrawerTitle = (\n variant: string | null | undefined,\n copy: GlobalCopy,\n beat?: Beat,\n): string => {\n const { title } = transactionListLayout(variant)\n\n return (title ? title(copy) : beat?.insights_payload?.title) ?? ''\n}\n\nexport interface HelpHeaderContent {\n /** Pre-localized HTML under the title, from the payload's `drilldown_data.description_html`. */\n descriptionHtml?: string\n /** The \"Learn More\" link and the help drawer it opens; absent when the beat carries no help. */\n learnMore?: HelpContent & { label: string }\n}\n\n/**\n * The help-header variant's text, read from the payload's `drilldown_data` (shared by every CTA\n * of the card): `description_html`, and `help_label` with the `help_title` / `help_html` that\n * `readHelp` reads. Only the `help_header` variant renders the block.\n */\nexport const readHelpHeader = (\n cta: DrilldownCta | undefined,\n drilldown: DrilldownData | undefined,\n): HelpHeaderContent | undefined => {\n if (cta?.variant !== HELP_HEADER_VARIANT) return undefined\n\n const label = asNonEmptyText(drilldown?.help_label)\n const help = readHelp(drilldown)\n\n return {\n descriptionHtml: asNonEmptyText(drilldown?.description_html),\n ...(label && help && { learnMore: { ...help, label } }),\n }\n}\n\nexport interface TransactionListSummary {\n /** Headline figure (e.g. total withdrawn). */\n amount: number\n /** Validated range endpoints; rendered as `{start} – {end}`. Omitted when the payload value is\n * missing or unparseable (so the drawer never crashes on an Invalid Date). */\n startDate?: Date\n endDate?: Date\n /** Number of transactions for the pill, from the CTA's `drilldown_data.count`. */\n count?: number\n /** The tile's mx-icons name, from `drilldown_data.logo` (`ICO-<name>`); absent: the card's default. */\n icon?: string\n}\n\n// `> 0`: the card only shows with >= 1 guid, so a `count` of 0 is dropped and falls back to the\n// guid count rather than rendering \"0 transactions\".\nconst toCount = (value: unknown): number | undefined =>\n typeof value === 'number' && Number.isInteger(value) && value > 0 ? value : undefined\n\n// Sane epoch window so a bad/typo payload can't render a far-past/future date.\nconst EPOCH_MIN = Date.UTC(2000, 0, 1)\nconst EPOCH_MAX = Date.UTC(2100, 0, 1)\n\n// The readers run on every observer re-render, so each distinct warning fires once per payload object.\nconst warnedPayloads = new WeakMap<object, Set<string>>()\nconst warnOncePerPayload = (source: object, message: string): void => {\n const warned = warnedPayloads.get(source) ?? new Set<string>()\n if (warned.has(message)) return\n warnedPayloads.set(source, warned.add(message))\n console.warn(message)\n}\n\n/**\n * Parse a payload date value to a validated `Date`, or `undefined`. Accepts unix seconds or\n * milliseconds (auto-detected) and ISO strings. Fails closed (no throw): an unparseable or\n * out-of-range value returns undefined and warns, so `formatDate`/`intlFormat` never sees an Invalid\n * Date (which throws `RangeError` and takes down the whole drawer render).\n */\nconst toDate = (value: unknown, field: string, source: object): Date | undefined => {\n // Missing/empty is a normal \"no range\" case — return quietly, don't warn.\n if (value === undefined || value === null || value === '') return undefined\n\n let ms: number | undefined\n if (typeof value === 'number' && Number.isFinite(value)) {\n // < 1e12 is treated as seconds (1e12 ms is year 33658). Trade-off: genuine ms timestamps from\n // ~2000-2001 would be misread as seconds and fall outside the window below (dropped, not shown).\n ms = value < 1e12 ? value * 1000 : value\n } else if (typeof value === 'string') {\n const parsed = parseISO(value).getTime()\n ms = Number.isNaN(parsed) ? undefined : parsed\n }\n\n if (ms === undefined || ms < EPOCH_MIN || ms > EPOCH_MAX) {\n warnOncePerPayload(\n source,\n `[TransactionListBlock] drilldown_data.${field} is unparseable or out of range (${typeof value})`,\n )\n return undefined\n }\n return new Date(ms)\n}\n\n/**\n * Summary-header figures for the drawer, read from the clicked CTA's `drilldown_data` (the backend\n * hangs a drilldown's own data off the CTA that opens it). Fails closed throughout: only a summary\n * variant renders a header (so figures from a different CTA that `getDynamicCta…` fell back to can't\n * be misattributed), then without a finite `amount` there is still no header, and\n * each date is validated to a real `Date` or dropped — an unparseable value never reaches\n * `formatDate` (which throws on an Invalid Date).\n *\n * `drilldown_data` fields: `amount` (number), `start_date`/`end_date` (unix seconds|ms or ISO),\n * `count` (number of transactions), `logo` (the tile, `{ guid: 'ICO-<name>' }`).\n */\nexport const readSummary = (cta: DrilldownCta | undefined): TransactionListSummary | undefined => {\n // Defense-in-depth on financial figures: only the summary variants show the card.\n if (!transactionListLayout(cta?.variant).summary) return undefined\n\n const source = cta?.drilldown_data\n if (!source) return undefined\n\n const amount = asNumber(source.amount)\n if (amount === undefined) {\n // `drilldown_data` present but no usable amount -> surface the likely contract drift (field\n // rename) instead of a silently missing header.\n if (Object.keys(source).length > 0) {\n warnOncePerPayload(\n source,\n '[TransactionListBlock] drilldown_data has no finite `amount` — no summary header.',\n )\n }\n return undefined\n }\n\n return {\n amount,\n startDate: toDate(source.start_date, 'start_date', source),\n endDate: toDate(source.end_date, 'end_date', source),\n count: toCount(source.count),\n icon: logoFromEntityGuid(asLogoRef(source.logo)?.guid)?.logo_name,\n }\n}\n\nexport interface CreditLimitHeader {\n balance: number\n limit: number\n /** Whole percent of the limit used; over 100 when the card is over its limit. */\n utilization: number\n institutionGuid?: string\n institutionName?: string\n accountName?: string\n}\n\n/** The credit-limit header from the clicked CTA's `drilldown_data`; only `credit_limit_header`, with a positive limit. */\nexport const readCreditLimitHeader = (\n cta: DrilldownCta | undefined,\n): CreditLimitHeader | undefined => {\n if (cta?.variant !== TRANSACTION_LIST_VARIANTS.CREDIT_LIMIT_HEADER) return undefined\n\n const source = cta.drilldown_data\n const balance = asNumber(source?.current_balance)\n const limit = asNumber(source?.credit_limit)\n if (balance === undefined || limit === undefined || limit <= 0) return undefined\n\n const institutionGuid = asNonEmptyText(source?.institution_guid)\n const institutionName = asNonEmptyText(source?.institution_name)\n const accountName = asNonEmptyText(source?.account_name)\n\n return {\n balance,\n limit,\n utilization: Math.max(0, Math.round((balance / limit) * 100)),\n ...(institutionGuid && { institutionGuid }),\n ...(institutionName && { institutionName }),\n ...(accountName && { accountName }),\n }\n}\n\nconst DATE_ONLY = /^(\\d{4})-(\\d{2})-\\d{2}$/\n\n/** The month a drilldown date names, as local midnight on the 1st. A date-only string already names its month. */\nconst toMonthStart = (value: unknown, source: object): Date | undefined => {\n const dateOnly = typeof value === 'string' ? DATE_ONLY.exec(value) : null\n const month = dateOnly ? Number(dateOnly[2]) : 0\n if (dateOnly && month >= 1 && month <= 12) return new Date(Number(dateOnly[1]), month - 1, 1)\n\n // An epoch or a timestamp is an instant: its UTC month is the one tupac meant.\n const date = toDate(value, 'date', source)\n return date && new Date(date.getUTCFullYear(), date.getUTCMonth(), 1)\n}\n\n/** Each listed transaction's schedule, from `drilldown_data.transaction_frequencies`; malformed rows are dropped. */\nexport const readTransactionFrequencies = (\n cta: DrilldownCta | undefined,\n): Map<string, number> | undefined => {\n if (cta?.variant !== TRANSACTION_LIST_VARIANTS.SUBSCRIPTION_LIST) return undefined\n\n const source = cta.drilldown_data\n const rows = source?.transaction_frequencies\n if (rows === undefined || rows === null) return undefined\n\n if (!Array.isArray(rows)) {\n warnOncePerPayload(\n source as object,\n '[TransactionListBlock] drilldown_data.transaction_frequencies is not a list — captioning no rows.',\n )\n return undefined\n }\n\n const byGuid = new Map<string, number>()\n let dropped = 0\n rows.forEach((row) => {\n const guid =\n typeof row === 'object' && row !== null ? asNonEmptyText(row.transaction_guid) : undefined\n const type = typeof row === 'object' && row !== null ? asNumber(row.recurrence_type) : undefined\n\n if (guid && type !== undefined) byGuid.set(guid, type)\n else dropped += 1\n })\n\n if (dropped > 0) {\n warnOncePerPayload(\n source as object,\n `[TransactionListBlock] dropped ${dropped} malformed drilldown_data.transaction_frequencies row(s).`,\n )\n }\n\n return byGuid.size > 0 ? byGuid : undefined\n}\n\nexport interface SubscriptionListHeader {\n /** Subscriptions paid in the month, from the CTA's `drilldown_data.count`. */\n count: number\n /** The month paid in, as local midnight on the 1st; omitted when missing or unparseable. */\n month?: Date\n}\n\n/** The count tile's figures; only for `subscription_list` with a positive integer `count`. */\nexport const readSubscriptionHeader = (\n cta: DrilldownCta | undefined,\n): SubscriptionListHeader | undefined => {\n if (cta?.variant !== TRANSACTION_LIST_VARIANTS.SUBSCRIPTION_LIST) return undefined\n\n const source = cta.drilldown_data\n if (!source) return undefined\n\n const count = toCount(source.count)\n if (count === undefined) {\n if (Object.keys(source).length > 0) {\n warnOncePerPayload(\n source,\n '[TransactionListBlock] drilldown_data has no positive integer `count` — no subscription header.',\n )\n }\n return undefined\n }\n\n return {\n count,\n month: toMonthStart(source.date, source),\n }\n}\n"],"mappings":";;;;AAiBA,IAAa,IAA4B;AAAA,EACvC,gBAAgB;AAAA,EAChB,cAAc;AAAA,EAEd,aAAa;AAAA,EAEb,iBAAiB;AAAA,EAEjB,qBAAqB;AAAA,EAErB,mBAAmB;AAAA,EAEnB,cAAc;AAChB,GAEa,IAAsB,EAA0B,aAWvD,IAAA,CAAqB,MAAqB,EAAK,cAAc,oBAG7D,IAAgD;AAAA,EACnD,CAAA,EAA0B,cAAA,GAAiB;AAAA,IAAE,gBAAgB;AAAA,IAAM,SAAS;AAAA,EAAK;AAAA,EACjF,CAAA,EAA0B,YAAA,GAAe,EAAE,OAAO,EAAkB;AAAA,EACpE,CAAA,EAA0B,WAAA,GAAc,EAAE,OAAO,EAAkB;AAAA,EACnE,CAAA,EAA0B,eAAA,GAAkB,EAC3C,OAAA,CAAQ,MAAS,EAAK,eAAe,wBAAwB,6BAC/D;AAAA,EACC,CAAA,EAA0B,mBAAA,GAAsB,EAC/C,OAAA,CAAQ,MAAS,EAAK,eAAe,wBAAwB,iCAC/D;AAAA,EACC,CAAA,EAA0B,iBAAA,GAAoB;AAAA,IAC7C,OAAA,CAAQ,MAAS,EAAK,eAAe,wBAAwB;AAAA,IAC7D,gBAAgB;AAAA,EAClB;AAAA,EACC,CAAA,EAA0B,YAAA,GAAe,EAAE,SAAS,GAAK;AAC5D,GAGa,IAAA,CAAyB,MACpC,KAAW,QAAQ,OAAO,OAAO,G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,EACE,GACA,iGACF;AAEF;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAA;AAAA,IACA,OAAO,EAAa,EAAO,MAAM,CAAM;AAAA,EACzC;AACF"}
@@ -8,12 +8,10 @@ interface MilestoneProgressProps {
8
8
  label?: string;
9
9
  /** Full's headline ("$500 in Savings"). */
10
10
  headline?: string;
11
- /** Mini's one-line headline ("Nice Work!"), shown instead of the eyebrow and headline. */
12
- miniHeadline?: string;
13
11
  isMini: boolean;
14
12
  }
15
13
  /** The $100 / $500 / $1,000 goal stepper (Figma 1132:26517): checks before the current goal, a ring on it. */
16
- declare const MilestoneProgress: ({ currentStep, headline, isMini, label, miniHeadline, }: MilestoneProgressProps) => import("react/jsx-runtime").JSX.Element;
14
+ declare const MilestoneProgress: ({ currentStep, headline, isMini, label }: MilestoneProgressProps) => import("react/jsx-runtime").JSX.Element;
17
15
  export default MilestoneProgress;
18
- /** step_chart_block / milestone_progress: full shows the eyebrow and headline, mini the short headline. */
16
+ /** step_chart_block / milestone_progress: full shows the eyebrow and headline, mini the headline only. */
19
17
  export declare const MilestoneProgressBlock: ({ beatGuid, payload }: BlockProps<StepChartBlockData>) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,32 +1,32 @@
1
- import { slot as s } from "../../../../../core/types/Insights.es.js";
2
- import { CURRENCY_FORMAT as C, formatCurrency as v } from "../../../../../core/utils/NumberFormatting.es.js";
3
- import { asNonEmptyText as d } from "../../../slotReaders.es.js";
4
- import { ELEVATION_SHADOW as S } from "../../../../components/shared/elevation.es.js";
5
- import _ from "react";
6
- import l from "@mui/material/Stack";
7
- import { Text as h } from "@mxenabled/mxui";
8
- import { CheckCircle as R } from "@mxenabled/mx-icons";
1
+ import { slot as m } from "../../../../../core/types/Insights.es.js";
2
+ import { CURRENCY_FORMAT as b, formatCurrency as w } from "../../../../../core/utils/NumberFormatting.es.js";
3
+ import { asNonEmptyText as h } from "../../../slotReaders.es.js";
4
+ import { ELEVATION_SHADOW as C } from "../../../../components/shared/elevation.es.js";
5
+ import v from "react";
6
+ import s from "@mui/material/Stack";
7
+ import { Text as c } from "@mxenabled/mxui";
8
+ import { CheckCircle as S } from "@mxenabled/mx-icons";
9
9
  import { jsx as e, jsxs as n } from "react/jsx-runtime";
10
- import { alpha as f } from "@mui/material/styles";
11
- import m from "@mui/material/Box";
12
- var u = [
10
+ import { alpha as g } from "@mui/material/styles";
11
+ import l from "@mui/material/Box";
12
+ var f = [
13
13
  100,
14
14
  500,
15
15
  1e3
16
- ], y = 0.25, k = (r) => Number.isInteger(r) && r >= 1 && r <= u.length, g = ({ solid: r }) => /* @__PURE__ */ e(m, {
16
+ ], u = 0.25, M = (r) => Number.isInteger(r) && r >= 1 && r <= f.length, x = ({ solid: r }) => /* @__PURE__ */ e(l, {
17
17
  "aria-hidden": !0,
18
18
  sx: (t) => ({
19
- bgcolor: r ? "primary.main" : f(t.palette.primary.main, y),
19
+ bgcolor: r ? "primary.main" : g(t.palette.primary.main, u),
20
20
  flex: 1,
21
21
  height: 2,
22
22
  mt: 11
23
23
  })
24
- }), I = ({ state: r }) => r === "reached" ? /* @__PURE__ */ e(R, {
24
+ }), R = ({ state: r }) => r === "reached" ? /* @__PURE__ */ e(S, {
25
25
  "aria-hidden": !0,
26
26
  filled: !0,
27
27
  size: 24,
28
28
  sx: { color: "primary.main" }
29
- }) : /* @__PURE__ */ e(m, {
29
+ }) : /* @__PURE__ */ e(l, {
30
30
  "aria-hidden": !0,
31
31
  sx: {
32
32
  alignItems: "center",
@@ -35,92 +35,88 @@ var u = [
35
35
  justifyContent: "center",
36
36
  width: 24
37
37
  },
38
- children: /* @__PURE__ */ e(m, { sx: (t) => r === "current" ? {
38
+ children: /* @__PURE__ */ e(l, { sx: (t) => r === "current" ? {
39
39
  border: "2px solid",
40
40
  borderColor: "primary.main",
41
41
  borderRadius: "50%",
42
42
  height: 20,
43
43
  width: 20
44
44
  } : {
45
- bgcolor: f(t.palette.primary.main, y),
45
+ bgcolor: g(t.palette.primary.main, u),
46
46
  borderRadius: "50%",
47
47
  height: 20,
48
48
  width: 20
49
49
  } })
50
- }), M = ({ currentStep: r, headline: t, isMini: i, label: o, miniHeadline: b }) => {
51
- const p = i ? b ?? t : t;
52
- return /* @__PURE__ */ e(m, {
50
+ }), _ = ({ currentStep: r, headline: t, isMini: o, label: i }) => /* @__PURE__ */ e(l, {
51
+ sx: {
52
+ px: 16,
53
+ py: 4
54
+ },
55
+ children: /* @__PURE__ */ n(s, {
53
56
  sx: {
54
- px: 16,
55
- py: 4
57
+ bgcolor: "primary.lighter",
58
+ border: "1px solid",
59
+ borderColor: "primary.main",
60
+ borderRadius: "8px",
61
+ boxShadow: C[1],
62
+ gap: 16,
63
+ py: 16
56
64
  },
57
- children: /* @__PURE__ */ n(l, {
58
- sx: {
59
- bgcolor: "primary.lighter",
60
- border: "1px solid",
61
- borderColor: "primary.main",
62
- borderRadius: "8px",
63
- boxShadow: S[1],
64
- gap: 16,
65
- py: 16
66
- },
67
- children: [/* @__PURE__ */ n(l, {
68
- sx: { px: 16 },
69
- children: [!i && o && /* @__PURE__ */ e(h, {
70
- color: "text.secondary",
65
+ children: [/* @__PURE__ */ n(s, {
66
+ sx: { px: 16 },
67
+ children: [!o && i && /* @__PURE__ */ e(c, {
68
+ color: "text.secondary",
69
+ sx: {
70
+ letterSpacing: "0.27px",
71
+ textTransform: "uppercase"
72
+ },
73
+ variant: "tiny",
74
+ children: i
75
+ }), t && /* @__PURE__ */ e(c, {
76
+ component: "p",
77
+ sx: { color: "primary.dark" },
78
+ variant: "h3",
79
+ children: t
80
+ })]
81
+ }), /* @__PURE__ */ n(s, {
82
+ "aria-label": i ?? t,
83
+ role: "list",
84
+ sx: { flexDirection: "row" },
85
+ children: [f.map((d, y) => {
86
+ const p = y + 1, a = p < r ? "reached" : p === r ? "current" : "upcoming";
87
+ return /* @__PURE__ */ n(v.Fragment, { children: [/* @__PURE__ */ e(x, { solid: p <= r }), /* @__PURE__ */ n(s, {
88
+ "aria-current": a === "current" ? "step" : void 0,
89
+ role: "listitem",
71
90
  sx: {
72
- letterSpacing: "0.27px",
73
- textTransform: "uppercase"
91
+ alignItems: "center",
92
+ width: 24
74
93
  },
75
- variant: "tiny",
76
- children: o
77
- }), p && /* @__PURE__ */ e(h, {
78
- component: "p",
79
- sx: { color: "primary.dark" },
80
- variant: "h3",
81
- children: p
82
- })]
83
- }), /* @__PURE__ */ n(l, {
84
- "aria-label": o ?? p,
85
- role: "list",
86
- sx: { flexDirection: "row" },
87
- children: [u.map((x, w) => {
88
- const c = w + 1, a = c < r ? "reached" : c === r ? "current" : "upcoming";
89
- return /* @__PURE__ */ n(_.Fragment, { children: [/* @__PURE__ */ e(g, { solid: c <= r }), /* @__PURE__ */ n(l, {
90
- "aria-current": a === "current" ? "step" : void 0,
91
- role: "listitem",
94
+ children: [/* @__PURE__ */ e(R, { state: a }), /* @__PURE__ */ e(c, {
95
+ color: a === "upcoming" ? "text.secondary" : "text.primary",
92
96
  sx: {
93
- alignItems: "center",
94
- width: 24
97
+ fontWeight: a === "upcoming" ? "fontWeightRegular" : "fontWeightBold",
98
+ whiteSpace: "nowrap"
95
99
  },
96
- children: [/* @__PURE__ */ e(I, { state: a }), /* @__PURE__ */ e(h, {
97
- color: a === "upcoming" ? "text.secondary" : "text.primary",
98
- sx: {
99
- fontWeight: a === "upcoming" ? "fontWeightRegular" : "fontWeightBold",
100
- whiteSpace: "nowrap"
101
- },
102
- variant: "caption",
103
- children: v(x, C.whole)
104
- })]
105
- })] }, x);
106
- }), /* @__PURE__ */ e(g, { solid: !1 })]
107
- })]
108
- })
109
- });
110
- }, H = ({ beatGuid: r, payload: t }) => {
111
- const { data: i } = t.instance_slot, o = s(i, "current_step");
112
- return k(o) ? /* @__PURE__ */ e(M, {
113
- currentStep: o,
114
- headline: d(s(i, "headline")),
100
+ variant: "caption",
101
+ children: w(d, b.whole)
102
+ })]
103
+ })] }, d);
104
+ }), /* @__PURE__ */ e(x, { solid: !1 })]
105
+ })]
106
+ })
107
+ }), D = ({ beatGuid: r, payload: t }) => {
108
+ const { data: o } = t.instance_slot, i = m(o, "current_step");
109
+ return M(i) ? /* @__PURE__ */ e(_, {
110
+ currentStep: i,
111
+ headline: h(m(o, "headline")),
115
112
  isMini: t.widget_type === "mini",
116
- label: d(s(i, "label")),
117
- miniHeadline: d(s(i, "mini_headline"))
118
- }) : (console.warn(`[StepChartBlock] ${r ?? "unknown beat"}: milestone_progress current_step invalid (${typeof o}), rendering nothing`), null);
113
+ label: h(m(o, "label"))
114
+ }) : (console.warn(`[StepChartBlock] ${r ?? "unknown beat"}: milestone_progress current_step invalid (${typeof i}), rendering nothing`), null);
119
115
  };
120
116
  export {
121
- H as MilestoneProgressBlock,
122
- M as default,
123
- k as isMilestoneProgressStep
117
+ D as MilestoneProgressBlock,
118
+ _ as default,
119
+ M as isMilestoneProgressStep
124
120
  };
125
121
 
126
122
  //# sourceMappingURL=MilestoneProgress.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MilestoneProgress.es.js","names":[],"sources":["../../../../../../src/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { alpha } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\nimport { CheckCircle } from '@mxenabled/mx-icons'\n\nimport { slot } from '../../../../../core/types/Insights'\nimport type { StepChartBlockData } from '../../../../../core/types/InsightsInstanceSlotData'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../../core/utils/NumberFormatting'\nimport { ELEVATION_SHADOW } from '../../../../components/shared/elevation'\nimport { asNonEmptyText } from '../../../slotReaders'\nimport type { BlockProps } from '../../../types'\n\nconst MILESTONES = [100, 500, 1000] as const\nconst UPCOMING_OPACITY = 0.25\n\nexport type MilestoneProgressStep = 1 | 2 | 3\n\nexport const isMilestoneProgressStep = (value: unknown): value is MilestoneProgressStep =>\n Number.isInteger(value) && (value as number) >= 1 && (value as number) <= MILESTONES.length\n\ntype StepState = 'reached' | 'current' | 'upcoming'\n\n/** A track segment: solid primary up to the current goal, 25% primary after it. */\nconst Segment = ({ solid }: { solid: boolean }) => (\n <Box\n aria-hidden={true}\n sx={(theme) => ({\n bgcolor: solid ? 'primary.main' : alpha(theme.palette.primary.main, UPCOMING_OPACITY),\n flex: 1,\n height: 2,\n mt: 11,\n })}\n />\n)\n\n/** Reached: the filled check. Current: a 20px primary ring. Upcoming: a 25% primary disc. */\nconst StepMark = ({ state }: { state: StepState }) => {\n if (state === 'reached') {\n return <CheckCircle aria-hidden={true} filled={true} size={24} sx={{ color: 'primary.main' }} />\n }\n\n return (\n <Box\n aria-hidden={true}\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: 24,\n justifyContent: 'center',\n width: 24,\n }}\n >\n <Box\n sx={(theme) =>\n state === 'current'\n ? {\n border: '2px solid',\n borderColor: 'primary.main',\n borderRadius: '50%',\n height: 20,\n width: 20,\n }\n : {\n bgcolor: alpha(theme.palette.primary.main, UPCOMING_OPACITY),\n borderRadius: '50%',\n height: 20,\n width: 20,\n }\n }\n />\n </Box>\n )\n}\n\ninterface MilestoneProgressProps {\n currentStep: MilestoneProgressStep\n /** Full's eyebrow (\"Step two\"). */\n label?: string\n /** Full's headline (\"$500 in Savings\"). */\n headline?: string\n /** Mini's one-line headline (\"Nice Work!\"), shown instead of the eyebrow and headline. */\n miniHeadline?: string\n isMini: boolean\n}\n\n/** The $100 / $500 / $1,000 goal stepper (Figma 1132:26517): checks before the current goal, a ring on it. */\nconst MilestoneProgress = ({\n currentStep,\n headline,\n isMini,\n label,\n miniHeadline,\n}: MilestoneProgressProps) => {\n // Mini shows the short headline, falling back to full's.\n const title = isMini ? (miniHeadline ?? headline) : headline\n\n return (\n <Box sx={{ px: 16, py: 4 }}>\n <Stack\n sx={{\n bgcolor: 'primary.lighter',\n border: '1px solid',\n borderColor: 'primary.main',\n borderRadius: '8px',\n boxShadow: ELEVATION_SHADOW[1],\n gap: 16,\n py: 16,\n }}\n >\n <Stack sx={{ px: 16 }}>\n {!isMini && label && (\n <Text\n color=\"text.secondary\"\n sx={{ letterSpacing: '0.27px', textTransform: 'uppercase' }}\n variant=\"tiny\"\n >\n {label}\n </Text>\n )}\n {title && (\n <Text component=\"p\" sx={{ color: 'primary.dark' }} variant=\"h3\">\n {title}\n </Text>\n )}\n </Stack>\n {/* The aria-hidden track segments stay out of the accessibility tree; only the goals are items. */}\n <Stack aria-label={label ?? title} role=\"list\" sx={{ flexDirection: 'row' }}>\n {MILESTONES.map((amount, index) => {\n const step = index + 1\n const state: StepState =\n step < currentStep ? 'reached' : step === currentStep ? 'current' : 'upcoming'\n\n return (\n <React.Fragment key={amount}>\n <Segment solid={step <= currentStep} />\n <Stack\n aria-current={state === 'current' ? 'step' : undefined}\n role=\"listitem\"\n sx={{ alignItems: 'center', width: 24 }}\n >\n <StepMark state={state} />\n <Text\n color={state === 'upcoming' ? 'text.secondary' : 'text.primary'}\n sx={{\n fontWeight: state === 'upcoming' ? 'fontWeightRegular' : 'fontWeightBold',\n whiteSpace: 'nowrap',\n }}\n variant=\"caption\"\n >\n {formatCurrency(amount, CURRENCY_FORMAT.whole)}\n </Text>\n </Stack>\n </React.Fragment>\n )\n })}\n <Segment solid={false} />\n </Stack>\n </Stack>\n </Box>\n )\n}\n\nexport default MilestoneProgress\n\n/** step_chart_block / milestone_progress: full shows the eyebrow and headline, mini the short headline. */\nexport const MilestoneProgressBlock = ({ beatGuid, payload }: BlockProps<StepChartBlockData>) => {\n const { data } = payload.instance_slot\n const currentStep = slot(data, 'current_step')\n if (!isMilestoneProgressStep(currentStep)) {\n console.warn(\n `[StepChartBlock] ${beatGuid ?? 'unknown beat'}: milestone_progress current_step invalid (${typeof currentStep}), rendering nothing`,\n )\n return null\n }\n\n return (\n <MilestoneProgress\n currentStep={currentStep}\n headline={asNonEmptyText(slot(data, 'headline'))}\n isMini={payload.widget_type === 'mini'}\n label={asNonEmptyText(slot(data, 'label'))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OAAO;AAAA,YAAG;AAAA,YAHxC,UAAA,CAKE,gBAAA,EAAC,GAAD,EAAiB,OAAA,EAAQ,CAAA,GACzB,gBAAA,EAAC,GAAD;AAAA,cACE,OAAO,MAAU,aAAa,mBAAmB;AAAA,cACjD,IAAI;AAAA,gBACF,YAAY,MAAU,aAAa,sBAAsB;AAAA,gBACzD,YAAY;AAAA,cACd;AAAA,cACA,SAAQ;AAAA,cAEP,UAAA,EAAe,GAAQ,EAAgB,KAAK;AAAA,YACzC,CAAA,CACD;AAAA,UACO,CAAA,CAAA,EAAA,GAnBK,CAmBL;AAAA,QAEpB,CAAC,GACD,gBAAA,EAAC,GAAD,EAAS,OAAO,GAAQ,CAAA,CACnB;AAAA,MACF,CAAA,CAAA;AAAA;EACJ,CAAA;AAET,GAKa,IAAA,CAA0B,EAAE,UAAA,GAAU,SAAA,EAAA,MAA8C;AAC/F,QAAM,EAAE,MAAA,EAAA,IAAS,EAAQ,eACnB,IAAc,EAAK,GAAM,cAAc;AAC7C,SAAK,EAAwB,CAAW,IAQtC,gBAAA,EAAC,GAAD;AAAA,IACe,aAAA;AAAA,IACb,UAAU,EAAe,EAAK,GAAM,UAAU,CAAC;AAAA,IAC/C,QAAQ,EAAQ,gBAAgB;AAAA,IAChC,OAAO,EAAe,EAAK,GAAM,OAAO,CAAC;AAAA,IACzC,cAAc,EAAe,EAAK,GAAM,eAAe,CAAC;AAAA,EACzD,CAAA,KAbD,QAAQ,KACN,oBAAoB,KAAY,cAAA,8CAA4D,OAAO,CAAA,sBACrG,GACO;AAYX"}
1
+ {"version":3,"file":"MilestoneProgress.es.js","names":[],"sources":["../../../../../../src/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { alpha } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\nimport { CheckCircle } from '@mxenabled/mx-icons'\n\nimport { slot } from '../../../../../core/types/Insights'\nimport type { StepChartBlockData } from '../../../../../core/types/InsightsInstanceSlotData'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../../core/utils/NumberFormatting'\nimport { ELEVATION_SHADOW } from '../../../../components/shared/elevation'\nimport { asNonEmptyText } from '../../../slotReaders'\nimport type { BlockProps } from '../../../types'\n\nconst MILESTONES = [100, 500, 1000] as const\nconst UPCOMING_OPACITY = 0.25\n\nexport type MilestoneProgressStep = 1 | 2 | 3\n\nexport const isMilestoneProgressStep = (value: unknown): value is MilestoneProgressStep =>\n Number.isInteger(value) && (value as number) >= 1 && (value as number) <= MILESTONES.length\n\ntype StepState = 'reached' | 'current' | 'upcoming'\n\n/** A track segment: solid primary up to the current goal, 25% primary after it. */\nconst Segment = ({ solid }: { solid: boolean }) => (\n <Box\n aria-hidden={true}\n sx={(theme) => ({\n bgcolor: solid ? 'primary.main' : alpha(theme.palette.primary.main, UPCOMING_OPACITY),\n flex: 1,\n height: 2,\n mt: 11,\n })}\n />\n)\n\n/** Reached: the filled check. Current: a 20px primary ring. Upcoming: a 25% primary disc. */\nconst StepMark = ({ state }: { state: StepState }) => {\n if (state === 'reached') {\n return <CheckCircle aria-hidden={true} filled={true} size={24} sx={{ color: 'primary.main' }} />\n }\n\n return (\n <Box\n aria-hidden={true}\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: 24,\n justifyContent: 'center',\n width: 24,\n }}\n >\n <Box\n sx={(theme) =>\n state === 'current'\n ? {\n border: '2px solid',\n borderColor: 'primary.main',\n borderRadius: '50%',\n height: 20,\n width: 20,\n }\n : {\n bgcolor: alpha(theme.palette.primary.main, UPCOMING_OPACITY),\n borderRadius: '50%',\n height: 20,\n width: 20,\n }\n }\n />\n </Box>\n )\n}\n\ninterface MilestoneProgressProps {\n currentStep: MilestoneProgressStep\n /** Full's eyebrow (\"Step two\"). */\n label?: string\n /** Full's headline (\"$500 in Savings\"). */\n headline?: string\n isMini: boolean\n}\n\n/** The $100 / $500 / $1,000 goal stepper (Figma 1132:26517): checks before the current goal, a ring on it. */\nconst MilestoneProgress = ({ currentStep, headline, isMini, label }: MilestoneProgressProps) => {\n return (\n <Box sx={{ px: 16, py: 4 }}>\n <Stack\n sx={{\n bgcolor: 'primary.lighter',\n border: '1px solid',\n borderColor: 'primary.main',\n borderRadius: '8px',\n boxShadow: ELEVATION_SHADOW[1],\n gap: 16,\n py: 16,\n }}\n >\n <Stack sx={{ px: 16 }}>\n {/* Mini shows full's headline (design QA), without the eyebrow. */}\n {!isMini && label && (\n <Text\n color=\"text.secondary\"\n sx={{ letterSpacing: '0.27px', textTransform: 'uppercase' }}\n variant=\"tiny\"\n >\n {label}\n </Text>\n )}\n {headline && (\n <Text component=\"p\" sx={{ color: 'primary.dark' }} variant=\"h3\">\n {headline}\n </Text>\n )}\n </Stack>\n {/* The aria-hidden track segments stay out of the accessibility tree; only the goals are items. */}\n <Stack aria-label={label ?? headline} role=\"list\" sx={{ flexDirection: 'row' }}>\n {MILESTONES.map((amount, index) => {\n const step = index + 1\n const state: StepState =\n step < currentStep ? 'reached' : step === currentStep ? 'current' : 'upcoming'\n\n return (\n <React.Fragment key={amount}>\n <Segment solid={step <= currentStep} />\n <Stack\n aria-current={state === 'current' ? 'step' : undefined}\n role=\"listitem\"\n sx={{ alignItems: 'center', width: 24 }}\n >\n <StepMark state={state} />\n <Text\n color={state === 'upcoming' ? 'text.secondary' : 'text.primary'}\n sx={{\n fontWeight: state === 'upcoming' ? 'fontWeightRegular' : 'fontWeightBold',\n whiteSpace: 'nowrap',\n }}\n variant=\"caption\"\n >\n {formatCurrency(amount, CURRENCY_FORMAT.whole)}\n </Text>\n </Stack>\n </React.Fragment>\n )\n })}\n <Segment solid={false} />\n </Stack>\n </Stack>\n </Box>\n )\n}\n\nexport default MilestoneProgress\n\n/** step_chart_block / milestone_progress: full shows the eyebrow and headline, mini the headline only. */\nexport const MilestoneProgressBlock = ({ beatGuid, payload }: BlockProps<StepChartBlockData>) => {\n const { data } = payload.instance_slot\n const currentStep = slot(data, 'current_step')\n if (!isMilestoneProgressStep(currentStep)) {\n console.warn(\n `[StepChartBlock] ${beatGuid ?? 'unknown beat'}: milestone_progress current_step invalid (${typeof currentStep}), rendering nothing`,\n )\n return null\n }\n\n return (\n <MilestoneProgress\n currentStep={currentStep}\n headline={asNonEmptyText(slot(data, 'headline'))}\n isMini={payload.widget_type === 'mini'}\n label={asNonEmptyText(slot(data, 'label'))}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;AAgBA,IAAM,IAAa;AAAA,EAAC;AAAA,EAAK;AAAA,EAAK;AAAI,GAC5B,IAAmB,MAIZ,IAAA,CAA2B,MACtC,OAAO,UAAU,CAAK,KAAM,KAAoB,KAAM,KAAoB,EAAW,QAKjF,IAAA,CAAW,EAAE,OAAA,EAAA,MACjB,gBAAA,EAAC,GAAD;AAAA,EACE,eAAa;AAAA,EACb,IAAA,CAAK,OAAW;AAAA,IACd,SAAS,IAAQ,iBAAiB,EAAM,EAAM,QAAQ,QAAQ,MAAM,CAAgB;AAAA,IACpF,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,IAAI;AAAA,EACN;AACD,CAAA,GAIG,IAAA,CAAY,EAAE,OAAA,EAAA,MACd,MAAU,YACL,gBAAA,EAAC,GAAD;AAAA,EAAa,eAAa;AAAA,EAAM,QAAQ;AAAA,EAAM,MAAM;AAAA,EAAI,IAAI,EAAE,OAAO,eAAe;AAAI,CAAA,IAI/F,gBAAA,EAAC,GAAD;AAAA,EACE,eAAa;AAAA,EACb,IAAI;AAAA,IACF,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,OAAO;AAAA,EACT;AAAA,EAEA,UAAA,gBAAA,EAAC,GAAD,EACE,IAAA,CAAK,MACH,MAAU,YACN;AAAA,IACE,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,OAAO;AAAA,EACT,IACA;AAAA,IACE,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