@mx-cartographer/experiences 9.7.168 → 9.7.170

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 (32) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/core/types/localization/InsightsFeedCopy.d.ts +10 -1
  3. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/layout.d.ts +5 -1
  4. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/layout.es.js +71 -59
  5. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/layout.es.js.map +1 -1
  6. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlock.es.js +17 -17
  7. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlock.es.js.map +1 -1
  8. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/layout.d.ts +6 -2
  9. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/layout.es.js +12 -10
  10. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/layout.es.js.map +1 -1
  11. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js +118 -102
  12. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js.map +1 -1
  13. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffResults.d.ts +8 -1
  14. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffResults.es.js +140 -73
  15. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffResults.es.js.map +1 -1
  16. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +2 -1
  17. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +74 -71
  18. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
  19. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +4 -0
  20. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js +47 -51
  21. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
  22. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js +35 -35
  23. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js.map +1 -1
  24. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.d.ts +8 -3
  25. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js +65 -66
  26. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js.map +1 -1
  27. package/dist/insights-v2/components/Header.es.js +4 -4
  28. package/dist/insights-v2/components/shared/elevation.es.js +2 -3
  29. package/dist/insights-v2/components/shared/elevation.es.js.map +1 -1
  30. package/dist/insights-v2/mappings/blocks.es.js +179 -183
  31. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  32. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { asNonEmptyText as s, asNumber as _ } from "../../blocks/slotReaders.es.js";
2
- import { readHelp as I } from "../HelpBlock/layout.es.js";
3
- import { parseISO as m } from "date-fns/parseISO";
2
+ import { readHelp as E } from "../HelpBlock/layout.es.js";
3
+ import { parseISO as I } from "date-fns/parseISO";
4
4
  var a = {
5
5
  SUMMARY_HEADER: "summary_header",
6
6
  GENERIC_LIST: "generic_list",
@@ -8,66 +8,65 @@ var a = {
8
8
  DEPOSIT_HISTORY: "deposit_history",
9
9
  CREDIT_LIMIT_HEADER: "credit_limit_header",
10
10
  SUBSCRIPTION_LIST: "subscription_list"
11
- }, b = /* @__PURE__ */ new Set([a.SUMMARY_HEADER, a.SUBSCRIPTION_LIST]), E = a.HELP_HEADER, D = (e, t, r) => {
12
- switch (e) {
13
- case a.GENERIC_LIST:
14
- case a.HELP_HEADER:
15
- return t.transactions?.transactions_title ?? "";
16
- case a.DEPOSIT_HISTORY:
17
- return t.insights_feed?.transaction_list_block?.deposit_history_drawer_title ?? "";
18
- case a.CREDIT_LIMIT_HEADER:
19
- return t.insights_feed?.transaction_list_block?.credit_limit_header_drawer_title ?? "";
20
- case a.SUBSCRIPTION_LIST:
21
- return t.insights_feed?.transaction_list_block?.subscriptions_drawer_title ?? "";
22
- default:
23
- return r?.insights_payload?.title ?? "";
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]: {
18
+ title: (t) => t.insights_feed?.transaction_list_block?.subscriptions_drawer_title,
19
+ accountSubline: !0
24
20
  }
25
- }, H = (e, t) => {
26
- if (e?.variant !== E) return;
27
- const r = s(t?.help_label), n = I(t);
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);
28
27
  return {
29
- descriptionHtml: s(t?.description_html),
28
+ descriptionHtml: s(e?.description_html),
30
29
  ...r && n && { learnMore: {
31
30
  ...n,
32
31
  label: r
33
32
  } }
34
33
  };
35
- }, f = (e) => typeof e == "number" && Number.isInteger(e) && e > 0 ? e : void 0, p = Date.UTC(2e3, 0, 1), S = Date.UTC(2100, 0, 1), T = /* @__PURE__ */ new WeakMap(), c = (e, t) => {
36
- const r = T.get(e) ?? /* @__PURE__ */ new Set();
37
- r.has(t) || (T.set(e, r.add(t)), console.warn(t));
38
- }, u = (e, t, r) => {
39
- if (e == null || e === "") return;
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) => {
38
+ if (t == null || t === "") return;
40
39
  let n;
41
- if (typeof e == "number" && Number.isFinite(e)) n = e < 1e12 ? e * 1e3 : e;
42
- else if (typeof e == "string") {
43
- const i = m(e).getTime();
40
+ if (typeof t == "number" && Number.isFinite(t)) n = t < 1e12 ? t * 1e3 : t;
41
+ else if (typeof t == "string") {
42
+ const i = I(t).getTime();
44
43
  n = Number.isNaN(i) ? void 0 : i;
45
44
  }
46
- if (n === void 0 || n < p || n > S) {
47
- c(r, `[TransactionListBlock] drilldown_data.${t} is unparseable or out of range (${typeof e})`);
45
+ if (n === void 0 || n < h || n > b) {
46
+ c(r, `[TransactionListBlock] drilldown_data.${e} is unparseable or out of range (${typeof t})`);
48
47
  return;
49
48
  }
50
49
  return new Date(n);
51
- }, L = (e) => {
52
- if (e?.variant !== a.SUMMARY_HEADER) return;
53
- const t = e?.drilldown_data;
54
- if (!t) return;
55
- const r = _(t.amount);
50
+ }, w = (t) => {
51
+ if (t?.variant !== a.SUMMARY_HEADER) return;
52
+ const e = t?.drilldown_data;
53
+ if (!e) return;
54
+ const r = _(e.amount);
56
55
  if (r === void 0) {
57
- Object.keys(t).length > 0 && c(t, "[TransactionListBlock] drilldown_data has no finite `amount` — no summary header.");
56
+ Object.keys(e).length > 0 && c(e, "[TransactionListBlock] drilldown_data has no finite `amount` — no summary header.");
58
57
  return;
59
58
  }
60
59
  return {
61
60
  amount: r,
62
- startDate: u(t.start_date, "start_date", t),
63
- endDate: u(t.end_date, "end_date", t),
64
- count: f(t.count)
61
+ startDate: l(e.start_date, "start_date", e),
62
+ endDate: l(e.end_date, "end_date", e),
63
+ count: p(e.count)
65
64
  };
66
- }, w = (e) => {
67
- if (e?.variant !== a.CREDIT_LIMIT_HEADER) return;
68
- const t = e.drilldown_data, r = _(t?.current_balance), n = _(t?.credit_limit);
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);
69
68
  if (r === void 0 || n === void 0 || n <= 0) return;
70
- const i = s(t?.institution_guid), o = s(t?.institution_name), d = s(t?.account_name);
69
+ const i = s(e?.institution_guid), o = s(e?.institution_name), d = s(e?.account_name);
71
70
  return {
72
71
  balance: r,
73
72
  limit: n,
@@ -76,49 +75,49 @@ var a = {
76
75
  ...o && { institutionName: o },
77
76
  ...d && { accountName: d }
78
77
  };
79
- }, v = /^(\d{4})-(\d{2})-\d{2}$/, h = (e, t) => {
80
- const r = typeof e == "string" ? v.exec(e) : null, n = r ? Number(r[2]) : 0;
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;
81
80
  if (r && n >= 1 && n <= 12) return new Date(Number(r[1]), n - 1, 1);
82
- const i = u(e, "date", t);
81
+ const i = l(t, "date", e);
83
82
  return i && new Date(i.getUTCFullYear(), i.getUTCMonth(), 1);
84
- }, y = (e) => {
85
- if (e?.variant !== a.SUBSCRIPTION_LIST) return;
86
- const t = e.drilldown_data, r = t?.transaction_frequencies;
83
+ }, g = (t) => {
84
+ if (t?.variant !== a.SUBSCRIPTION_LIST) return;
85
+ const e = t.drilldown_data, r = e?.transaction_frequencies;
87
86
  if (r == null) return;
88
87
  if (!Array.isArray(r)) {
89
- c(t, "[TransactionListBlock] drilldown_data.transaction_frequencies is not a list — captioning no rows.");
88
+ c(e, "[TransactionListBlock] drilldown_data.transaction_frequencies is not a list — captioning no rows.");
90
89
  return;
91
90
  }
92
91
  const n = /* @__PURE__ */ new Map();
93
92
  let i = 0;
94
93
  return r.forEach((o) => {
95
- const d = typeof o == "object" && o !== null ? s(o.transaction_guid) : void 0, l = typeof o == "object" && o !== null ? _(o.recurrence_type) : void 0;
96
- d && l !== void 0 ? n.set(d, l) : i += 1;
97
- }), i > 0 && c(t, `[TransactionListBlock] dropped ${i} malformed drilldown_data.transaction_frequencies row(s).`), n.size > 0 ? n : void 0;
98
- }, C = (e) => {
99
- if (e?.variant !== a.SUBSCRIPTION_LIST) return;
100
- const t = e.drilldown_data;
101
- if (!t) return;
102
- const r = f(t.count);
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;
99
+ const e = t.drilldown_data;
100
+ if (!e) return;
101
+ const r = p(e.count);
103
102
  if (r === void 0) {
104
- Object.keys(t).length > 0 && c(t, "[TransactionListBlock] drilldown_data has no positive integer `count` — no subscription header.");
103
+ Object.keys(e).length > 0 && c(e, "[TransactionListBlock] drilldown_data has no positive integer `count` — no subscription header.");
105
104
  return;
106
105
  }
107
106
  return {
108
107
  count: r,
109
- month: h(t.date, t)
108
+ month: y(e.date, e)
110
109
  };
111
110
  };
112
111
  export {
113
- b as ACCOUNT_SUBLINE_VARIANTS,
114
- E as HELP_HEADER_VARIANT,
112
+ v as HELP_HEADER_VARIANT,
115
113
  a as TRANSACTION_LIST_VARIANTS,
116
- D as getTransactionListDrawerTitle,
117
- w as readCreditLimitHeader,
118
- H as readHelpHeader,
114
+ H as getTransactionListDrawerTitle,
115
+ O as readCreditLimitHeader,
116
+ N as readHelpHeader,
119
117
  C as readSubscriptionHeader,
120
- L as readSummary,
121
- y as readTransactionFrequencies
118
+ w as readSummary,
119
+ g as readTransactionFrequencies,
120
+ S as transactionListLayout
122
121
  };
123
122
 
124
123
  //# 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\n/** Variants whose rows are subtitled with the account (institution logo and name), not the category. */\nexport const ACCOUNT_SUBLINE_VARIANTS: ReadonlySet<string | null | undefined> = new Set([\n TRANSACTION_LIST_VARIANTS.SUMMARY_HEADER,\n TRANSACTION_LIST_VARIANTS.SUBSCRIPTION_LIST,\n])\n\nexport const HELP_HEADER_VARIANT = TRANSACTION_LIST_VARIANTS.HELP_HEADER\n\n/** Drawer title: the variant's title when it has one, otherwise the beat's own title. Add new variants here. */\nexport const getTransactionListDrawerTitle = (\n variant: string | null | undefined,\n copy: GlobalCopy,\n beat?: Beat,\n): string => {\n switch (variant) {\n case TRANSACTION_LIST_VARIANTS.GENERIC_LIST:\n case TRANSACTION_LIST_VARIANTS.HELP_HEADER:\n return copy.transactions?.transactions_title ?? ''\n case TRANSACTION_LIST_VARIANTS.DEPOSIT_HISTORY:\n return copy.insights_feed?.transaction_list_block?.deposit_history_drawer_title ?? ''\n case TRANSACTION_LIST_VARIANTS.CREDIT_LIMIT_HEADER:\n return copy.insights_feed?.transaction_list_block?.credit_limit_header_drawer_title ?? ''\n case TRANSACTION_LIST_VARIANTS.SUBSCRIPTION_LIST:\n return copy.insights_feed?.transaction_list_block?.subscriptions_drawer_title ?? ''\n default:\n return beat?.insights_payload?.title ?? ''\n }\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}\n"],"mappings":";;;AAgBA,IAAa,IAA4B;AAAA,EACvC,gBAAgB;AAAA,EAChB,cAAc;AAAA,EAEd,aAAa;AAAA,EAEb,iBAAiB;AAAA,EAEjB,qBAAqB;AAAA,EAErB,mBAAmB;AACrB,GAGa,IAAmE,oBAAI,IAAI,CACtF,EAA0B,gBAC1B,EAA0B,iBAC5B,CAAC,GAEY,IAAsB,EAA0B,aAGhD,IAAA,CACX,GACA,GACA,MACW;AACX,UAAQ,GAAR;AAAA,IACE,KAAK,EAA0B;AAAA,IAC/B,KAAK,EAA0B;AAC7B,aAAO,EAAK,cAAc,sBAAsB;AAAA,IAClD,KAAK,EAA0B;AAC7B,aAAO,EAAK,eAAe,wBAAwB,gCAAgC;AAAA,IACrF,KAAK,EAA0B;AAC7B,aAAO,EAAK,eAAe,wBAAwB,oCAAoC;AAAA,IACzF,KAAK,EAA0B;AAC7B,aAAO,EAAK,eAAe,wBAAwB,8BAA8B;AAAA,IACnF;AACE,aAAO,GAAM,kBAAkB,SAAS;AAAA,EAC5C;AACF,GAca,IAAA,CACX,GACA,MACkC;AAClC,MAAI,GAAK,YAAY,EAAqB;AAE1C,QAAM,IAAQ,EAAe,GAAW,UAAU,GAC5C,IAAO,EAAS,CAAS;AAE/B,SAAO;AAAA,IACL,iBAAiB,EAAe,GAAW,gBAAgB;AAAA,IAC3D,GAAI,KAAS,KAAQ,EAAE,WAAW;AAAA,MAAE,GAAG;AAAA,MAAM,OAAA;AAAA,IAAM,EAAE;AAAA,EACvD;AACF,GAeM,IAAA,CAAW,MACf,OAAO,KAAU,YAAY,OAAO,UAAU,CAAK,KAAK,IAAQ,IAAI,IAAQ,QAGxE,IAAY,KAAK,IAAI,KAAM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AK,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 { 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}\n"],"mappings":";;;AAgBA,IAAa,IAA4B;AAAA,EACvC,gBAAgB;AAAA,EAChB,cAAc;AAAA,EAEd,aAAa;AAAA,EAEb,iBAAiB;AAA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AI,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,6 +1,6 @@
1
1
  import { useBeatActions as s } from "../beatActions.es.js";
2
- import { InsightOptionsMenu as m } from "./InsightOptionsMenu.es.js";
3
- import a from "./SubHeader.es.js";
2
+ import m from "./SubHeader.es.js";
3
+ import { InsightOptionsMenu as a } from "./InsightOptionsMenu.es.js";
4
4
  import e from "@mui/material/Stack";
5
5
  import { H3 as c } from "@mxenabled/mxui";
6
6
  import { jsx as r, jsxs as o } from "react/jsx-runtime";
@@ -23,8 +23,8 @@ var g = ({ isMini: n, subtitle: t, title: i }) => {
23
23
  children: [/* @__PURE__ */ r(c, {
24
24
  truncate: !0,
25
25
  children: i
26
- }), !n && p && /* @__PURE__ */ r(m, {})]
27
- }), t && /* @__PURE__ */ r(a, { subtitle: t })]
26
+ }), !n && p && /* @__PURE__ */ r(a, {})]
27
+ }), t && /* @__PURE__ */ r(m, { subtitle: t })]
28
28
  });
29
29
  };
30
30
  export {
@@ -1,11 +1,10 @@
1
1
  var p = {
2
2
  1: "0px 2px 8px rgba(0, 0, 0, 0.12)",
3
3
  16: "0px 12px 20px rgba(0, 0, 0, 0.22)"
4
- }, x = "0px 6px 12px rgba(106, 115, 129, 0.16), 0px 3px 8px rgba(87, 102, 117, 0.06)", r = "0px 2px 4px rgba(0, 0, 0, 0.12)";
4
+ }, x = "0px 2px 4px rgba(0, 0, 0, 0.12)";
5
5
  export {
6
6
  p as ELEVATION_SHADOW,
7
- x as RAISED_CARD_SHADOW,
8
- r as SMALL_CARD_SHADOW
7
+ x as SMALL_CARD_SHADOW
9
8
  };
10
9
 
11
10
  //# sourceMappingURL=elevation.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"elevation.es.js","names":[],"sources":["../../../../src/insights-v2/components/shared/elevation.ts"],"sourcesContent":["/** Figma elevation shadows (single drop shadows, not MUI's `shadows[n]`). */\nexport const ELEVATION_SHADOW = {\n /** `elevation/1`: rows on a wash. */\n 1: '0px 2px 8px rgba(0, 0, 0, 0.12)',\n /** `elevation/16`: dialogs, snackbars. */\n 16: '0px 12px 20px rgba(0, 0, 0, 0.22)',\n} as const\n\n/** Soft two-layer card shadow (Figma) for a raised result card; off the numbered scale above. */\nexport const RAISED_CARD_SHADOW =\n '0px 6px 12px rgba(106, 115, 129, 0.16), 0px 3px 8px rgba(87, 102, 117, 0.06)'\n\n/** Small card shadow (Figma 0 / 2 / blur 4, black @ 0.12): the quiz feedback card and merchant header. */\nexport const SMALL_CARD_SHADOW = '0px 2px 4px rgba(0, 0, 0, 0.12)'\n"],"mappings":"AACA,IAAa,IAAmB;AAAA,EAE9B,GAAG;AAAA,EAEH,IAAI;AACN,GAGa,IACX,gFAGW,IAAoB"}
1
+ {"version":3,"file":"elevation.es.js","names":[],"sources":["../../../../src/insights-v2/components/shared/elevation.ts"],"sourcesContent":["/** Figma elevation shadows (single drop shadows, not MUI's `shadows[n]`). */\nexport const ELEVATION_SHADOW = {\n /** `elevation/1`: rows on a wash. */\n 1: '0px 2px 8px rgba(0, 0, 0, 0.12)',\n /** `elevation/16`: dialogs, snackbars. */\n 16: '0px 12px 20px rgba(0, 0, 0, 0.22)',\n} as const\n\n/** Soft two-layer card shadow (Figma) for a raised result card; off the numbered scale above. */\nexport const RAISED_CARD_SHADOW =\n '0px 6px 12px rgba(106, 115, 129, 0.16), 0px 3px 8px rgba(87, 102, 117, 0.06)'\n\n/** Small card shadow (Figma 0 / 2 / blur 4, black @ 0.12): the quiz feedback card and merchant header. */\nexport const SMALL_CARD_SHADOW = '0px 2px 4px rgba(0, 0, 0, 0.12)'\n"],"mappings":"AACA,IAAa,IAAmB;AAAA,EAE9B,GAAG;AAAA,EAEH,IAAI;AACN,GAOa,IAAoB"}