@mx-cartographer/experiences 9.7.206 → 10.0.0

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 (259) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +2 -0
  3. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.es.js +39 -23
  4. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.es.js.map +1 -1
  5. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +3 -1
  6. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.es.js +37 -33
  7. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.es.js.map +1 -1
  8. package/dist/accounts/utils/AccountFields.d.ts +3 -1
  9. package/dist/accounts/utils/AccountFields.es.js +39 -39
  10. package/dist/accounts/utils/AccountFields.es.js.map +1 -1
  11. package/dist/common/components/charts/LineChart.d.ts +4 -0
  12. package/dist/common/components/charts/LineChart.es.js +114 -112
  13. package/dist/common/components/charts/LineChart.es.js.map +1 -1
  14. package/dist/common/components/charts/linechart/CustomLegend.es.js +24 -21
  15. package/dist/common/components/charts/linechart/CustomLegend.es.js.map +1 -1
  16. package/dist/core/types/Insights.d.ts +9 -1
  17. package/dist/core/types/Insights.es.js.map +1 -1
  18. package/dist/core/types/localization/InsightsFeedCopy.d.ts +42 -0
  19. package/dist/core/types/localization/index.d.ts +1 -1
  20. package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.d.ts +7 -1
  21. package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js +39 -20
  22. package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js.map +1 -1
  23. package/dist/insights-v2/actionBlocks/AccountDetailsBlock/SpendVsIncomeChart.d.ts +4 -0
  24. package/dist/insights-v2/actionBlocks/AccountDetailsBlock/SpendVsIncomeChart.es.js +42 -0
  25. package/dist/insights-v2/actionBlocks/AccountDetailsBlock/SpendVsIncomeChart.es.js.map +1 -0
  26. package/dist/insights-v2/actionBlocks/AccountDetailsBlock/SpendVsPaymentChart.d.ts +7 -0
  27. package/dist/insights-v2/actionBlocks/AccountDetailsBlock/SpendVsPaymentChart.es.js +54 -0
  28. package/dist/insights-v2/actionBlocks/AccountDetailsBlock/SpendVsPaymentChart.es.js.map +1 -0
  29. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js +10 -10
  30. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/CreateBudgetDialog.es.js +24 -23
  31. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/CreateBudgetDialog.es.js.map +1 -1
  32. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js +75 -73
  33. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js.map +1 -1
  34. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetSummary.d.ts +5 -1
  35. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetSummary.es.js +21 -21
  36. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetSummary.es.js.map +1 -1
  37. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/layout.d.ts +11 -0
  38. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/layout.es.js +65 -58
  39. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/layout.es.js.map +1 -1
  40. package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsV2.es.js +17 -17
  41. package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsV2.es.js.map +1 -1
  42. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/BalanceStepper.es.js +9 -10
  43. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/BalanceStepper.es.js.map +1 -1
  44. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.es.js +21 -22
  45. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.es.js.map +1 -1
  46. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js +35 -35
  47. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js.map +1 -1
  48. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffResults.d.ts +1 -1
  49. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffResults.es.js +44 -49
  50. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffResults.es.js.map +1 -1
  51. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.d.ts +1 -1
  52. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js +19 -16
  53. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js.map +1 -1
  54. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.d.ts +2 -2
  55. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.es.js +212 -166
  56. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.es.js.map +1 -1
  57. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/StepIcon.d.ts +4 -0
  58. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/StepIcon.es.js +24 -0
  59. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/StepIcon.es.js.map +1 -0
  60. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/layout.d.ts +6 -5
  61. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/layout.es.js +38 -38
  62. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/layout.es.js.map +1 -1
  63. package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +1 -1
  64. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.d.ts +1 -5
  65. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.es.js +37 -36
  66. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.es.js.map +1 -1
  67. package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.d.ts +9 -11
  68. package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.es.js +12 -6
  69. package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.es.js.map +1 -1
  70. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +46 -40
  71. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
  72. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +141 -126
  73. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
  74. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +8 -1
  75. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +243 -200
  76. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
  77. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +2 -0
  78. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
  79. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js +54 -53
  80. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js.map +1 -1
  81. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.d.ts +6 -1
  82. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js +14 -13
  83. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js.map +1 -1
  84. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.d.ts +4 -3
  85. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js +24 -21
  86. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js.map +1 -1
  87. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.d.ts +14 -4
  88. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js +79 -67
  89. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js.map +1 -1
  90. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChart.d.ts +3 -1
  91. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChart.es.js +48 -32
  92. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChart.es.js.map +1 -1
  93. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js +19 -14
  94. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js.map +1 -1
  95. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.d.ts +4 -0
  96. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.es.js +19 -15
  97. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.es.js.map +1 -1
  98. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js +26 -19
  99. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js.map +1 -1
  100. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.d.ts +1 -0
  101. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js +17 -21
  102. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js.map +1 -1
  103. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/StepChartBlock.d.ts +1 -1
  104. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js +11 -11
  105. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js.map +1 -1
  106. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/index.es.js +15 -11
  107. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/index.es.js.map +1 -1
  108. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/layout.d.ts +20 -0
  109. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/layout.es.js +21 -0
  110. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/layout.es.js.map +1 -0
  111. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.d.ts +2 -4
  112. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.es.js +78 -82
  113. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.es.js.map +1 -1
  114. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/WithText.d.ts +10 -2
  115. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/WithText.es.js +115 -54
  116. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/WithText.es.js.map +1 -1
  117. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.d.ts +1 -1
  118. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js +37 -36
  119. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js.map +1 -1
  120. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js +27 -22
  121. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
  122. package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js +8 -8
  123. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.d.ts +7 -0
  124. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.es.js +46 -0
  125. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.es.js.map +1 -0
  126. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/index.d.ts +3 -0
  127. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.d.ts +13 -0
  128. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.es.js +22 -0
  129. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.es.js.map +1 -0
  130. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js +29 -21
  131. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js.map +1 -1
  132. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.d.ts +0 -2
  133. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js +17 -21
  134. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js.map +1 -1
  135. package/dist/insights-v2/blocks/ComponentBlocks/FeeChargedBlock/FeeChargedBlock.es.js +5 -6
  136. package/dist/insights-v2/blocks/ComponentBlocks/FeeChargedBlock/FeeChargedBlock.es.js.map +1 -1
  137. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/FeedbackBlock.d.ts +3 -7
  138. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/FeedbackBlock.es.js +120 -306
  139. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/FeedbackBlock.es.js.map +1 -1
  140. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/RatingScale.d.ts +17 -0
  141. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/RatingScale.es.js +93 -0
  142. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/RatingScale.es.js.map +1 -0
  143. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/StepBar.d.ts +5 -0
  144. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/StepBar.es.js +21 -0
  145. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/StepBar.es.js.map +1 -0
  146. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/SurveyResult.d.ts +18 -0
  147. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/SurveyResult.es.js +71 -0
  148. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/SurveyResult.es.js.map +1 -0
  149. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/survey.d.ts +82 -8
  150. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/survey.es.js +66 -15
  151. package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/survey.es.js.map +1 -1
  152. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js +46 -63
  153. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js.map +1 -1
  154. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.d.ts +3 -3
  155. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js +44 -53
  156. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js.map +1 -1
  157. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.d.ts +1 -1
  158. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.es.js +30 -31
  159. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.es.js.map +1 -1
  160. package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js +25 -20
  161. package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js.map +1 -1
  162. package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/layout.d.ts +22 -0
  163. package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/layout.es.js +24 -0
  164. package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/layout.es.js.map +1 -0
  165. package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/StrategiesBlock.d.ts +7 -0
  166. package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/StrategiesBlock.es.js +89 -0
  167. package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/StrategiesBlock.es.js.map +1 -0
  168. package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/index.d.ts +1 -0
  169. package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/layout.d.ts +43 -0
  170. package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/layout.es.js +28 -0
  171. package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/layout.es.js.map +1 -0
  172. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +54 -53
  173. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
  174. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +7 -3
  175. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +20 -11
  176. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
  177. package/dist/insights-v2/blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js +29 -28
  178. package/dist/insights-v2/blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js.map +1 -1
  179. package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +2 -0
  180. package/dist/insights-v2/blocks/ImageBlocks/ImageBlock.es.js +6 -5
  181. package/dist/insights-v2/blocks/ImageBlocks/ImageBlock.es.js.map +1 -1
  182. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/images/FederalBankHoliday.es.js +117 -71
  183. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/images/FederalBankHoliday.es.js.map +1 -1
  184. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.d.ts +1 -1
  185. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.es.js +10 -7
  186. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.es.js.map +1 -1
  187. package/dist/insights-v2/components/AccountHeroCard.d.ts +3 -1
  188. package/dist/insights-v2/components/AccountHeroCard.es.js.map +1 -1
  189. package/dist/insights-v2/components/BaseLayout.d.ts +3 -1
  190. package/dist/insights-v2/components/BaseLayout.es.js +134 -119
  191. package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
  192. package/dist/insights-v2/components/CompactDirectDepositCard.d.ts +28 -0
  193. package/dist/insights-v2/components/CompactDirectDepositCard.es.js +78 -0
  194. package/dist/insights-v2/components/CompactDirectDepositCard.es.js.map +1 -0
  195. package/dist/insights-v2/components/CompactInsightCard.es.js +122 -118
  196. package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -1
  197. package/dist/insights-v2/components/DirectDepositCard.d.ts +6 -1
  198. package/dist/insights-v2/components/DirectDepositCard.es.js +24 -22
  199. package/dist/insights-v2/components/DirectDepositCard.es.js.map +1 -1
  200. package/dist/insights-v2/components/LoadingCard.es.js +13 -9
  201. package/dist/insights-v2/components/LoadingCard.es.js.map +1 -1
  202. package/dist/insights-v2/components/LogoFromGuid.d.ts +1 -1
  203. package/dist/insights-v2/components/LogoFromGuid.es.js.map +1 -1
  204. package/dist/insights-v2/components/MerchantHighlightCard.es.js +4 -4
  205. package/dist/insights-v2/components/SaveAnExtraCard.d.ts +4 -1
  206. package/dist/insights-v2/components/SaveAnExtraCard.es.js +32 -20
  207. package/dist/insights-v2/components/SaveAnExtraCard.es.js.map +1 -1
  208. package/dist/insights-v2/components/SubTabs.d.ts +2 -1
  209. package/dist/insights-v2/components/SubTabs.es.js +29 -24
  210. package/dist/insights-v2/components/SubTabs.es.js.map +1 -1
  211. package/dist/insights-v2/components/TransactionListCard.d.ts +3 -1
  212. package/dist/insights-v2/components/TransactionListCard.es.js +39 -37
  213. package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
  214. package/dist/insights-v2/components/TransferLogoCard.es.js +1 -0
  215. package/dist/insights-v2/components/TransferLogoCard.es.js.map +1 -1
  216. package/dist/insights-v2/components/UpcomingBillCard.es.js +39 -35
  217. package/dist/insights-v2/components/UpcomingBillCard.es.js.map +1 -1
  218. package/dist/insights-v2/components/celebrationGradients.d.ts +17 -8
  219. package/dist/insights-v2/components/celebrationGradients.es.js +14 -14
  220. package/dist/insights-v2/components/celebrationGradients.es.js.map +1 -1
  221. package/dist/insights-v2/components/chartblocks/ChartLegend.es.js +16 -10
  222. package/dist/insights-v2/components/chartblocks/ChartLegend.es.js.map +1 -1
  223. package/dist/insights-v2/components/chartblocks/DoubleBarChart.d.ts +10 -4
  224. package/dist/insights-v2/components/chartblocks/DoubleBarChart.es.js +62 -61
  225. package/dist/insights-v2/components/chartblocks/DoubleBarChart.es.js.map +1 -1
  226. package/dist/insights-v2/components/chartblocks/EmptyBarChart.es.js +13 -6
  227. package/dist/insights-v2/components/chartblocks/EmptyBarChart.es.js.map +1 -1
  228. package/dist/insights-v2/components/shared/images/DesignateEmergencySavings.es.js +2 -3
  229. package/dist/insights-v2/components/shared/images/DesignateEmergencySavings.es.js.map +1 -1
  230. package/dist/insights-v2/components/statusIcon.d.ts +2 -1
  231. package/dist/insights-v2/components/statusIcon.es.js +10 -8
  232. package/dist/insights-v2/components/statusIcon.es.js.map +1 -1
  233. package/dist/insights-v2/ctaActions/ctaConfig.es.js +19 -17
  234. package/dist/insights-v2/ctaActions/ctaConfig.es.js.map +1 -1
  235. package/dist/insights-v2/ctaActions/ctaHandlers.d.ts +5 -1
  236. package/dist/insights-v2/ctaActions/ctaHandlers.es.js +71 -54
  237. package/dist/insights-v2/ctaActions/ctaHandlers.es.js.map +1 -1
  238. package/dist/insights-v2/ctaActions/ctaPostMessages.es.js +41 -24
  239. package/dist/insights-v2/ctaActions/ctaPostMessages.es.js.map +1 -1
  240. package/dist/insights-v2/ctaActions/feedbackSurvey.d.ts +9 -0
  241. package/dist/insights-v2/ctaActions/feedbackSurvey.es.js +51 -0
  242. package/dist/insights-v2/ctaActions/feedbackSurvey.es.js.map +1 -0
  243. package/dist/insights-v2/ctaActions/runCtaAction.es.js +36 -35
  244. package/dist/insights-v2/ctaActions/runCtaAction.es.js.map +1 -1
  245. package/dist/insights-v2/ctaActions/types.d.ts +7 -0
  246. package/dist/insights-v2/index.es.js +126 -120
  247. package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -1
  248. package/dist/insights-v2/mappings/actionBlocksKey.es.js +1 -1
  249. package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
  250. package/dist/insights-v2/mappings/blocks.es.js +126 -122
  251. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  252. package/dist/microinsights/MicroCardTemplate.es.js +1 -1
  253. package/dist/microinsights/MicroCardTemplate.es.js.map +1 -1
  254. package/dist/microinsights/cards/InsightCard.es.js +53 -53
  255. package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
  256. package/package.json +1 -1
  257. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/index.d.ts +0 -13
  258. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/images/DesignateEmergencySavingsAccount.es.js +0 -296
  259. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/images/DesignateEmergencySavingsAccount.es.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { WARM_LIME_ACCENT_GRADIENT as r, celebrateGradient as i } from "../../../components/celebrationGradients.es.js";
2
- var t = {
1
+ import { WARM_LIME_ACCENT_GRADIENT as t, celebrateGradient as e } from "../../../components/celebrationGradients.es.js";
2
+ var n = {
3
3
  Highlight: "highlight",
4
4
  SingleStandard: "single_standard",
5
5
  SingleSuccess: "single_success",
@@ -8,10 +8,33 @@ var t = {
8
8
  MultipleSuccess: "multiple_success",
9
9
  MultipleSubscription: "multiple_subscription",
10
10
  MultipleBadged: "multiple_badged"
11
- }, l = { bgcolor: "secondary.lighter" }, a = {
12
- background: r,
11
+ }, l = {
12
+ kind: "cascade",
13
+ cascade: {
14
+ overlap: 8,
15
+ offsets: {
16
+ 2: [0, 34],
17
+ 3: [
18
+ 0,
19
+ 17,
20
+ 34
21
+ ],
22
+ 4: [
23
+ 0,
24
+ 11,
25
+ 23,
26
+ 34
27
+ ]
28
+ }
29
+ },
30
+ logo: {
31
+ size: 72,
32
+ borderColor: "divider"
33
+ }
34
+ }, a = { bgcolor: "secondary.lighter" }, r = {
35
+ background: t,
13
36
  status: !0
14
- }, e = {
37
+ }, i = {
15
38
  kind: "single",
16
39
  amountVariant: "pill",
17
40
  fullBleed: !0,
@@ -22,7 +45,7 @@ var t = {
22
45
  borderColor: "divider",
23
46
  radius: 8
24
47
  }
25
- }, n = {
48
+ }, d = {
26
49
  highlight: {
27
50
  kind: "single",
28
51
  amountVariant: "text",
@@ -30,79 +53,47 @@ var t = {
30
53
  borderColor: "warning.light"
31
54
  },
32
55
  single_standard: {
33
- ...e,
34
- ...l
56
+ ...i,
57
+ ...a
35
58
  },
36
59
  single_success: {
37
- ...e,
38
- ...a
60
+ ...i,
61
+ ...r
39
62
  },
40
63
  single_subscription: {
41
- ...e,
64
+ ...i,
42
65
  amountPill: {
43
66
  px: 10,
44
67
  fontWeight: 400
45
68
  },
46
- background: i(232.03),
69
+ background: e(232.03),
47
70
  gap: 12,
48
71
  logo: {
49
- ...e.logo,
72
+ ...i.logo,
50
73
  size: 64
51
74
  },
52
75
  nameVariant: "h3"
53
76
  },
54
77
  multiple_standard: {
55
78
  kind: "cascade",
56
- ...l
79
+ ...a
57
80
  },
58
81
  multiple_success: {
59
82
  kind: "cascade",
60
- ...a
83
+ ...r
61
84
  },
62
85
  multiple_subscription: {
63
- kind: "cascade",
64
- background: i(200.73),
65
- cascade: {
66
- overlap: 8,
67
- offsets: {
68
- 2: [0, 34],
69
- 3: [
70
- 0,
71
- 17,
72
- 34
73
- ],
74
- 4: [
75
- 0,
76
- 11,
77
- 23,
78
- 34
79
- ]
80
- }
81
- },
82
- logo: {
83
- size: 72,
84
- borderColor: "divider"
85
- }
86
+ ...l,
87
+ background: e(200.73)
86
88
  },
87
89
  multiple_badged: {
88
- kind: "ranked",
89
- background: i(242.46),
90
- cascade: {
91
- overlap: 8,
92
- offsets: {
93
- 2: [0, 34],
94
- 3: [
95
- 0,
96
- 17,
97
- 34
98
- ]
99
- }
100
- }
90
+ ...l,
91
+ background: e(242.46)
101
92
  }
102
93
  };
103
94
  export {
104
- n as MERCHANT_LAYOUT,
105
- t as merchantBlockVariant
95
+ d as MERCHANT_LAYOUT,
96
+ n as merchantBlockVariant
106
97
  };
107
98
 
108
99
  //# sourceMappingURL=layout.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.ts"],"sourcesContent":["import type { CascadeOffsets } from '../../../components/P2PLogoStack'\nimport {\n celebrateGradient,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\nimport type { AmountPillProps } from '../../../components/AmountPill'\n\n/** ditto declares only `highlight` today. */\nexport const merchantBlockVariant = {\n Highlight: 'highlight',\n SingleStandard: 'single_standard',\n SingleSuccess: 'single_success',\n SingleSubscription: 'single_subscription',\n MultipleStandard: 'multiple_standard',\n MultipleSuccess: 'multiple_success',\n MultipleSubscription: 'multiple_subscription',\n MultipleBadged: 'multiple_badged',\n} as const\n\nexport type MerchantBlockVariant = (typeof merchantBlockVariant)[keyof typeof merchantBlockVariant]\n\nexport interface MerchantBlockLayoutConfig {\n /** Merchant card, logo cascade, or ranked logos. */\n kind: 'single' | 'cascade' | 'ranked'\n amountVariant?: 'pill' | 'text'\n /** The amount pill's horizontal padding and text weight. */\n amountPill?: Pick<AmountPillProps, 'px' | 'fontWeight'>\n /** Gap between the logo and the text column. */\n gap?: number\n /** The merchant name's type; the card defaults to h2 beside a pill. */\n nameVariant?: 'h2' | 'h3'\n /** A wash; replaces `bgcolor`. */\n background?: string\n bgcolor?: string\n borderColor?: string\n fullBleed?: boolean\n hideDate?: boolean\n logo?: { size?: number; shadow?: 'offset' | 'elevation'; borderColor?: string; radius?: number }\n /** Cascade and ranked: px the tiles overlap, and each tile's drop from the top of the row per tile count. */\n cascade?: { overlap?: number; offsets?: CascadeOffsets }\n /** Draw `status_text` in a success pill. */\n status?: boolean\n}\n\nconst STANDARD = { bgcolor: 'secondary.lighter' }\nconst SUCCESS = { background: WARM_LIME_ACCENT_GRADIENT, status: true }\n\n// Figma 14633:139111\nconst SINGLE: MerchantBlockLayoutConfig = {\n kind: 'single',\n amountVariant: 'pill',\n fullBleed: true,\n hideDate: true,\n logo: { size: 72, shadow: 'elevation', borderColor: 'divider', radius: 8 },\n}\n\nexport const MERCHANT_LAYOUT: Record<MerchantBlockVariant, MerchantBlockLayoutConfig> = {\n highlight: {\n kind: 'single',\n amountVariant: 'text',\n bgcolor: 'warning.lighter',\n borderColor: 'warning.light',\n },\n single_standard: { ...SINGLE, ...STANDARD },\n single_success: { ...SINGLE, ...SUCCESS },\n // Figma 1268:54330 (Single): 64 logo, 12 gap, h3 name, pill 2/10 at 400.\n single_subscription: {\n ...SINGLE,\n amountPill: { px: 10, fontWeight: 400 },\n background: celebrateGradient(232.03),\n gap: 12,\n logo: { ...SINGLE.logo, size: 64 },\n nameVariant: 'h3',\n },\n multiple_standard: { kind: 'cascade', ...STANDARD },\n multiple_success: { kind: 'cascade', ...SUCCESS },\n // Figma 1268:54330 `Logos`: 72px tiles with a divider border, 64px apart, top/centre/bottom of 106px.\n // The 2- and 4-tile staircases (not drawn in Figma) keep the shared shape over the same 34px drop.\n multiple_subscription: {\n kind: 'cascade',\n background: celebrateGradient(200.73),\n cascade: { overlap: 8, offsets: { 2: [0, 34], 3: [0, 17, 34], 4: [0, 11, 23, 34] } },\n logo: { size: 72, borderColor: 'divider' },\n },\n // Figma 587:129812 `Logos` (Monthly Top Merchant Spending): 72px badged tiles overlapping 8px, top/centre/bottom\n // of 106px. Two tiles (not drawn in Figma) keep the same 34px drop, as multiple_subscription does.\n multiple_badged: {\n kind: 'ranked',\n background: celebrateGradient(242.46),\n cascade: { overlap: 8, offsets: { 2: [0, 34], 3: [0, 17, 34] } },\n },\n}\n"],"mappings":";AAQA,IAAa,IAAuB;AAAA,EAClC,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,gBAAgB;AAClB,GA2BM,IAAW,EAAE,SAAS,oBAAoB,GAC1C,IAAU;AAAA,EAAE,YAAY;AAAA,EAA2B,QAAQ;AAAK,GAGhE,IAAoC;AAAA,EACxC,MAAM;AAAA,EACN,eAAe;AAAA,EACf,WAAW;AAAA,EACX,UAAU;AAAA,EACV,MAAM;AAAA,IAAE,MAAM;AAAA,IAAI,QAAQ;AAAA,IAAa,aAAa;AAAA,IAAW,QAAQ;AAAA,EAAE;AAC3E,GAEa,IAA2E;AAAA,EACtF,WAAW;AAAA,IACT,MAAM;AAAA,IACN,eAAe;AAAA,IACf,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,iBAAiB;AAAA,IAAE,GAAG;AAAA,IAAQ,GAAG;AAAA,EAAS;AAAA,EAC1C,gBAAgB;AAAA,IAAE,GAAG;AAAA,IAAQ,GAAG;AAAA,EAAQ;AAAA,EAExC,qBAAqB;AAAA,IACnB,GAAG;AAAA,IACH,YAAY;AAAA,MAAE,IAAI;AAAA,MAAI,YAAY;AAAA,IAAI;AAAA,IACtC,YAAY,EAAkB,MAAM;AAAA,IACpC,KAAK;AAAA,IACL,MAAM;AAAA,MAAE,GAAG,EAAO;AAAA,MAAM,MAAM;AAAA,IAAG;AAAA,IACjC,aAAa;AAAA,EACf;AAAA,EACA,mBAAmB;AAAA,IAAE,MAAM;AAAA,IAAW,GAAG;AAAA,EAAS;AAAA,EAClD,kBAAkB;AAAA,IAAE,MAAM;AAAA,IAAW,GAAG;AAAA,EAAQ;AAAA,EAGhD,uBAAuB;AAAA,IACrB,MAAM;AAAA,IACN,YAAY,EAAkB,MAAM;AAAA,IACpC,SAAS;AAAA,MAAE,SAAS;AAAA,MAAG,SAAS;AAAA,QAAE,GAAG,CAAC,GAAG,EAAE;AAAA,QAAG,GAAG;AAAA,UAAC;AAAA,UAAG;AAAA,UAAI;AAAA,QAAE;AAAA,QAAG,GAAG;AAAA,UAAC;AAAA,UAAG;AAAA,UAAI;AAAA,UAAI;AAAA,QAAE;AAAA,MAAE;AAAA,IAAE;AAAA,IACnF,MAAM;AAAA,MAAE,MAAM;AAAA,MAAI,aAAa;AAAA,IAAU;AAAA,EAC3C;AAAA,EAGA,iBAAiB;AAAA,IACf,MAAM;AAAA,IACN,YAAY,EAAkB,MAAM;AAAA,IACpC,SAAS;AAAA,MAAE,SAAS;AAAA,MAAG,SAAS;AAAA,QAAE,GAAG,CAAC,GAAG,EAAE;AAAA,QAAG,GAAG;AAAA,UAAC;AAAA,UAAG;AAAA,UAAI;AAAA,QAAE;AAAA,MAAE;AAAA,IAAE;AAAA,EACjE;AACF"}
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.ts"],"sourcesContent":["import type { CascadeOffsets } from '../../../components/P2PLogoStack'\nimport {\n celebrateGradient,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\nimport type { AmountPillProps } from '../../../components/AmountPill'\n\n/** ditto declares only `highlight` today. */\nexport const merchantBlockVariant = {\n Highlight: 'highlight',\n SingleStandard: 'single_standard',\n SingleSuccess: 'single_success',\n SingleSubscription: 'single_subscription',\n MultipleStandard: 'multiple_standard',\n MultipleSuccess: 'multiple_success',\n MultipleSubscription: 'multiple_subscription',\n MultipleBadged: 'multiple_badged',\n} as const\n\nexport type MerchantBlockVariant = (typeof merchantBlockVariant)[keyof typeof merchantBlockVariant]\n\nexport interface MerchantBlockLayoutConfig {\n /** Merchant card or logo cascade. */\n kind: 'single' | 'cascade'\n amountVariant?: 'pill' | 'text'\n /** The amount pill's horizontal padding and text weight. */\n amountPill?: Pick<AmountPillProps, 'px' | 'fontWeight'>\n /** Gap between the logo and the text column. */\n gap?: number\n /** The merchant name's type; the card defaults to h2 beside a pill. */\n nameVariant?: 'h2' | 'h3'\n /** A wash; replaces `bgcolor`. */\n background?: string\n bgcolor?: string\n borderColor?: string\n fullBleed?: boolean\n hideDate?: boolean\n logo?: { size?: number; shadow?: 'offset' | 'elevation'; borderColor?: string; radius?: number }\n /** Cascade: px the tiles overlap, and each tile's drop per tile count. */\n cascade?: { overlap?: number; offsets?: CascadeOffsets }\n /** Draw `status_text` in a success pill. */\n status?: boolean\n}\n\n// 72px bordered tiles, 64px apart; 2 and 4 tiles keep the same 34px drop.\nconst SUBSCRIPTION_CASCADE = {\n kind: 'cascade',\n cascade: { overlap: 8, offsets: { 2: [0, 34], 3: [0, 17, 34], 4: [0, 11, 23, 34] } },\n logo: { size: 72, borderColor: 'divider' },\n} as const satisfies MerchantBlockLayoutConfig\n\nconst STANDARD = { bgcolor: 'secondary.lighter' }\nconst SUCCESS = { background: WARM_LIME_ACCENT_GRADIENT, status: true }\n\nconst SINGLE: MerchantBlockLayoutConfig = {\n kind: 'single',\n amountVariant: 'pill',\n fullBleed: true,\n hideDate: true,\n logo: { size: 72, shadow: 'elevation', borderColor: 'divider', radius: 8 },\n}\n\nexport const MERCHANT_LAYOUT: Record<MerchantBlockVariant, MerchantBlockLayoutConfig> = {\n highlight: {\n kind: 'single',\n amountVariant: 'text',\n bgcolor: 'warning.lighter',\n borderColor: 'warning.light',\n },\n single_standard: { ...SINGLE, ...STANDARD },\n single_success: { ...SINGLE, ...SUCCESS },\n // 64 logo, 12 gap, h3 name, pill 2/10 at 400.\n single_subscription: {\n ...SINGLE,\n amountPill: { px: 10, fontWeight: 400 },\n background: celebrateGradient(232.03),\n gap: 12,\n logo: { ...SINGLE.logo, size: 64 },\n nameVariant: 'h3',\n },\n multiple_standard: { kind: 'cascade', ...STANDARD },\n multiple_success: { kind: 'cascade', ...SUCCESS },\n multiple_subscription: { ...SUBSCRIPTION_CASCADE, background: celebrateGradient(200.73) },\n // Same cascade as multiple_subscription, on its own wash; no rank badges per design QA.\n multiple_badged: { ...SUBSCRIPTION_CASCADE, background: celebrateGradient(242.46) },\n}\n"],"mappings":";AAQA,IAAa,IAAuB;AAAA,EAClC,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,gBAAgB;AAClB,GA4BM,IAAuB;AAAA,EAC3B,MAAM;AAAA,EACN,SAAS;AAAA,IAAE,SAAS;AAAA,IAAG,SAAS;AAAA,MAAE,GAAG,CAAC,GAAG,EAAE;AAAA,MAAG,GAAG;AAAA,QAAC;AAAA,QAAG;AAAA,QAAI;AAAA,MAAE;AAAA,MAAG,GAAG;AAAA,QAAC;AAAA,QAAG;AAAA,QAAI;AAAA,QAAI;AAAA,MAAE;AAAA,IAAE;AAAA,EAAE;AAAA,EACnF,MAAM;AAAA,IAAE,MAAM;AAAA,IAAI,aAAa;AAAA,EAAU;AAC3C,GAEM,IAAW,EAAE,SAAS,oBAAoB,GAC1C,IAAU;AAAA,EAAE,YAAY;AAAA,EAA2B,QAAQ;AAAK,GAEhE,IAAoC;AAAA,EACxC,MAAM;AAAA,EACN,eAAe;AAAA,EACf,WAAW;AAAA,EACX,UAAU;AAAA,EACV,MAAM;AAAA,IAAE,MAAM;AAAA,IAAI,QAAQ;AAAA,IAAa,aAAa;AAAA,IAAW,QAAQ;AAAA,EAAE;AAC3E,GAEa,IAA2E;AAAA,EACtF,WAAW;AAAA,IACT,MAAM;AAAA,IACN,eAAe;AAAA,IACf,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,iBAAiB;AAAA,IAAE,GAAG;AAAA,IAAQ,GAAG;AAAA,EAAS;AAAA,EAC1C,gBAAgB;AAAA,IAAE,GAAG;AAAA,IAAQ,GAAG;AAAA,EAAQ;AAAA,EAExC,qBAAqB;AAAA,IACnB,GAAG;AAAA,IACH,YAAY;AAAA,MAAE,IAAI;AAAA,MAAI,YAAY;AAAA,IAAI;AAAA,IACtC,YAAY,EAAkB,MAAM;AAAA,IACpC,KAAK;AAAA,IACL,MAAM;AAAA,MAAE,GAAG,EAAO;AAAA,MAAM,MAAM;AAAA,IAAG;AAAA,IACjC,aAAa;AAAA,EACf;AAAA,EACA,mBAAmB;AAAA,IAAE,MAAM;AAAA,IAAW,GAAG;AAAA,EAAS;AAAA,EAClD,kBAAkB;AAAA,IAAE,MAAM;AAAA,IAAW,GAAG;AAAA,EAAQ;AAAA,EAChD,uBAAuB;AAAA,IAAE,GAAG;AAAA,IAAsB,YAAY,EAAkB,MAAM;AAAA,EAAE;AAAA,EAExF,iBAAiB;AAAA,IAAE,GAAG;AAAA,IAAsB,YAAY,EAAkB,MAAM;AAAA,EAAE;AACpF"}
@@ -1,6 +1,6 @@
1
1
  import { BlockProps } from '../../types';
2
2
  /** Monthly Top Transacted Merchant quiz; its progress lives in beat context for the quiz CTAs. */
3
- declare const QuizBlock: (({ beatGuid, payload }: BlockProps) => import("react/jsx-runtime").JSX.Element) & {
3
+ declare const QuizBlock: (({ beatGuid, payload }: BlockProps) => import("react/jsx-runtime").JSX.Element | null) & {
4
4
  displayName: string;
5
5
  };
6
6
  export default QuizBlock;
@@ -2,21 +2,20 @@ import { buildDynamicCopy as L, buildPluralCopy as y } from "../../../../core/ut
2
2
  import { useGlobalCopyStore as B, useInsightsV2Store as M, useTransactionStore as D } from "../../../../common/context/hooks.es.js";
3
3
  import { QUIZ_CONTEXT as c, QUIZ_VARIANTS as O, isTopMerchant as K, merchantKey as S, quizMerchantLogo as q, rankQuizMerchants as Q, readQuizMerchants as W } from "./quiz.es.js";
4
4
  import { actionBlocksKey as F } from "../../../mappings/actionBlocksKey.es.js";
5
- import { SMALL_CARD_SHADOW as Z } from "../../../components/shared/elevation.es.js";
6
- import { LinedCardZeroState as N } from "../../../../insights/components/shared/ZeroState/LinedCardZeroState.es.js";
7
- import U from "../../../components/LogoFromGuid.es.js";
8
- import { ConfettiOverlay as V } from "../../../components/shared/ConfettiOverlay.es.js";
9
- import j from "../../../components/LogoTile.es.js";
10
- import { useEffect as E, useState as H } from "react";
5
+ import { SMALL_CARD_SHADOW as N } from "../../../components/shared/elevation.es.js";
6
+ import { ConfettiOverlay as U } from "../../../components/shared/ConfettiOverlay.es.js";
7
+ import V from "../../../components/LogoFromGuid.es.js";
8
+ import Z from "../../../components/LogoTile.es.js";
9
+ import { useEffect as E, useState as j } from "react";
11
10
  import { observer as A } from "mobx-react-lite";
12
11
  import a from "@mui/material/Stack";
13
12
  import { Text as d } from "@mxenabled/mxui";
14
13
  import { Icon as I } from "@mxenabled/mx-icons";
15
14
  import { jsx as r, jsxs as p } from "react/jsx-runtime";
16
15
  import { alpha as _ } from "@mui/material/styles";
17
- import P from "@mui/material/Radio";
18
- import $ from "@mui/material/ButtonBase";
19
- var X = 3e3, z = 32, T = {
16
+ import H from "@mui/material/Radio";
17
+ import P from "@mui/material/ButtonBase";
18
+ var $ = 3e3, z = 32, T = {
20
19
  alignItems: "center",
21
20
  border: 1,
22
21
  borderColor: "divider",
@@ -25,7 +24,7 @@ var X = 3e3, z = 32, T = {
25
24
  height: 50,
26
25
  pl: 8,
27
26
  width: "100%"
28
- }, G = (o) => o.map((e) => ({
27
+ }, X = (o) => o.map((e) => ({
29
28
  item: e,
30
29
  order: Math.random()
31
30
  })).sort((e, t) => e.order - t.order).map(({ item: e }) => e), R = A(({ merchant: o }) => {
@@ -33,7 +32,7 @@ var X = 3e3, z = 32, T = {
33
32
  ...q(o, e),
34
33
  alt: ""
35
34
  };
36
- return /* @__PURE__ */ r(j, {
35
+ return /* @__PURE__ */ r(Z, {
37
36
  borderColor: null,
38
37
  borderRadius: 4,
39
38
  size: z,
@@ -41,19 +40,19 @@ var X = 3e3, z = 32, T = {
41
40
  position: "relative",
42
41
  textAlign: "left"
43
42
  },
44
- children: /* @__PURE__ */ r(U, {
43
+ children: /* @__PURE__ */ r(V, {
45
44
  logo: t,
46
45
  size: z
47
46
  })
48
47
  });
49
- }), J = ({ correct: o, copy: e }) => /* @__PURE__ */ p(a, {
48
+ }), G = ({ correct: o, copy: e }) => /* @__PURE__ */ p(a, {
50
49
  role: "status",
51
50
  sx: {
52
51
  alignItems: "center",
53
52
  backdropFilter: o ? void 0 : "blur(6px)",
54
53
  bgcolor: (t) => o ? "success.main" : _(t.palette.common.black, 0.5),
55
54
  borderRadius: "8px",
56
- boxShadow: o ? Z : void 0,
55
+ boxShadow: o ? N : void 0,
57
56
  color: o ? "success.contrastText" : "common.white",
58
57
  gap: 18,
59
58
  inset: 16,
@@ -76,11 +75,11 @@ var X = 3e3, z = 32, T = {
76
75
  variant: "h2",
77
76
  children: o ? e?.nailed_it : e?.not_quite
78
77
  })]
79
- }), Y = ({ copy: o, merchant: e, onClick: t }) => {
78
+ }), J = ({ copy: o, merchant: e, onClick: t }) => {
80
79
  const l = o ? y(o.transaction_count_one, o.transaction_count, e.count, String(e.count)) : "", f = o ? L(o.rank_aria, String(e.rank), e.label, l) : e.label;
81
80
  return /* @__PURE__ */ p(a, {
82
81
  "aria-label": f,
83
- component: $,
82
+ component: P,
84
83
  direction: "row",
85
84
  onClick: t,
86
85
  sx: {
@@ -118,11 +117,11 @@ var X = 3e3, z = 32, T = {
118
117
  })
119
118
  ]
120
119
  });
121
- }, vo = A(({ beatGuid: o = "", payload: e }) => {
122
- const t = B().insights_feed?.quiz_block, { beatContext: l, openActionDrawer: f, setBeatContext: h } = M(), m = W(e.instance_slot.data), [w] = H(() => G(m)), g = l[o] ?? {}, x = g[c.PICK], v = !!g[c.CHECKED], k = e.instance_slot.variant === O.RESULTS || !!g[c.REVEALED], s = v && !k;
120
+ }, go = A(({ beatGuid: o = "", payload: e }) => {
121
+ const t = B().insights_feed?.quiz_block, { beatContext: l, openActionDrawer: f, setBeatContext: h } = M(), u = W(e.instance_slot.data), [w] = j(() => X(u)), g = l[o] ?? {}, x = g[c.PICK], v = !!g[c.CHECKED], k = e.instance_slot.variant === O.RESULTS || !!g[c.REVEALED], s = v && !k;
123
122
  if (E(() => {
124
123
  if (!s) return;
125
- const n = setTimeout(() => h(o, { [c.REVEALED]: !0 }), X);
124
+ const n = setTimeout(() => h(o, { [c.REVEALED]: !0 }), $);
126
125
  return () => clearTimeout(n);
127
126
  }, [
128
127
  o,
@@ -130,7 +129,7 @@ var X = 3e3, z = 32, T = {
130
129
  s
131
130
  ]), E(() => {
132
131
  t || console.warn("quiz_block: copy namespace missing; rendering without its labels");
133
- }, [t]), !m.length) return /* @__PURE__ */ r(N, {});
132
+ }, [t]), !u.length) return null;
134
133
  if (k) {
135
134
  const n = (i) => f({
136
135
  guid: o,
@@ -146,14 +145,14 @@ var X = 3e3, z = 32, T = {
146
145
  gap: 12,
147
146
  p: 16
148
147
  },
149
- children: Q(m).map((i) => /* @__PURE__ */ r(Y, {
148
+ children: Q(u).map((i) => /* @__PURE__ */ r(J, {
150
149
  copy: t,
151
150
  merchant: i,
152
151
  onClick: () => n(i)
153
152
  }, S(i)))
154
153
  });
155
154
  }
156
- const C = !!x && K(m, x ?? "");
155
+ const C = !!x && K(u, x ?? "");
157
156
  return /* @__PURE__ */ p(a, {
158
157
  sx: {
159
158
  gap: 12,
@@ -161,8 +160,8 @@ var X = 3e3, z = 32, T = {
161
160
  position: "relative"
162
161
  },
163
162
  children: [
164
- s && C && /* @__PURE__ */ r(V, {}),
165
- s && /* @__PURE__ */ r(J, {
163
+ s && C && /* @__PURE__ */ r(U, {}),
164
+ s && /* @__PURE__ */ r(G, {
166
165
  copy: t,
167
166
  correct: C
168
167
  }),
@@ -177,15 +176,15 @@ var X = 3e3, z = 32, T = {
177
176
  visibility: s && C ? "hidden" : "visible"
178
177
  },
179
178
  children: w.map((n) => {
180
- const i = S(n), u = i === x;
179
+ const i = S(n), m = i === x;
181
180
  return /* @__PURE__ */ p(a, {
182
181
  component: "label",
183
182
  direction: "row",
184
183
  sx: {
185
184
  ...T,
186
- bgcolor: (b) => u ? _(b.palette.primary.main, 0.16) : "background.paper",
187
- borderColor: (b) => u ? _(b.palette.primary.main, 0.5) : b.palette.divider,
188
- borderWidth: u ? 2 : 1,
185
+ bgcolor: (b) => m ? _(b.palette.primary.main, 0.16) : "background.paper",
186
+ borderColor: (b) => m ? _(b.palette.primary.main, 0.5) : b.palette.divider,
187
+ borderWidth: m ? 2 : 1,
189
188
  cursor: v ? "default" : "pointer",
190
189
  pr: 4
191
190
  },
@@ -198,8 +197,8 @@ var X = 3e3, z = 32, T = {
198
197
  variant: "body1",
199
198
  children: n.label
200
199
  }),
201
- /* @__PURE__ */ r(P, {
202
- checked: u,
200
+ /* @__PURE__ */ r(H, {
201
+ checked: m,
203
202
  disabled: v,
204
203
  name: `quiz-${o}`,
205
204
  onChange: () => h(o, { [c.PICK]: i }),
@@ -214,7 +213,7 @@ var X = 3e3, z = 32, T = {
214
213
  });
215
214
  });
216
215
  export {
217
- vo as default
216
+ go as default
218
217
  };
219
218
 
220
219
  //# sourceMappingURL=QuizBlock.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"QuizBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\n\nimport ButtonBase from '@mui/material/ButtonBase'\nimport Radio from '@mui/material/Radio'\nimport Stack from '@mui/material/Stack'\nimport { alpha } from '@mui/material/styles'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport { useGlobalCopyStore, useInsightsV2Store, useTransactionStore } from '../../../../common'\nimport type { QuizBlockCopy } from '../../../../core/types/localization/InsightsFeedCopy'\nimport { buildDynamicCopy, buildPluralCopy } from '../../../../core/utils/Localization'\nimport { LinedCardZeroState } from '../../../../insights/components/shared/ZeroState/LinedCardZeroState'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport LogoTile from '../../../components/LogoTile'\nimport { ConfettiOverlay } from '../../../components/shared/ConfettiOverlay'\nimport { SMALL_CARD_SHADOW } from '../../../components/shared/elevation'\nimport { actionBlocksKey } from '../../../mappings/actionBlocksKey'\nimport type { BlockProps } from '../../types'\nimport {\n QUIZ_CONTEXT,\n QUIZ_VARIANTS,\n isTopMerchant,\n merchantKey,\n quizMerchantLogo,\n rankQuizMerchants,\n readQuizMerchants,\n type QuizDrawerContext,\n type QuizMerchant,\n type RankedQuizMerchant,\n} from './quiz'\n\n/** How long the \"Nailed it!\" / \"Not quite...\" card shows before the results. */\nconst FEEDBACK_MS = 3000\n\nconst LOGO_SIZE = 32\nconst ROW_SX = {\n alignItems: 'center',\n border: 1,\n borderColor: 'divider',\n borderRadius: '8px',\n gap: 12,\n height: 50,\n pl: 8,\n width: '100%',\n} as const\n\nconst shuffle = <T,>(items: T[]) =>\n items\n .map((item) => ({ item, order: Math.random() }))\n .sort((a, b) => a.order - b.order)\n .map(({ item }) => item)\n\nconst MerchantLogo = observer(({ merchant }: { merchant: QuizMerchant }) => {\n const { detailedTransactions } = useTransactionStore()\n // Empty alt: the merchant's name sits beside it.\n const logo = { ...quizMerchantLogo(merchant, detailedTransactions), alt: '' }\n\n return (\n // mxui's MerchantLogo image is absolute with no left; a button row's centered text pushes it halfway out.\n <LogoTile\n borderColor={null}\n borderRadius={4}\n size={LOGO_SIZE}\n sx={{ position: 'relative', textAlign: 'left' }}\n >\n <LogoFromGuid logo={logo} size={LOGO_SIZE} />\n </LogoTile>\n )\n})\n\nconst FeedbackCard = ({ correct, copy }: { correct: boolean; copy?: QuizBlockCopy }) => (\n <Stack\n role=\"status\"\n sx={{\n alignItems: 'center',\n backdropFilter: correct ? undefined : 'blur(6px)',\n bgcolor: (theme) => (correct ? 'success.main' : alpha(theme.palette.common.black, 0.5)),\n borderRadius: '8px',\n boxShadow: correct ? SMALL_CARD_SHADOW : undefined,\n color: correct ? 'success.contrastText' : 'common.white',\n gap: 18,\n inset: 16,\n justifyContent: 'center',\n p: 16,\n position: 'absolute',\n zIndex: 2,\n }}\n >\n <Icon aria-hidden={true} fill={true} name={correct ? 'check_circle' : 'cancel'} size={56} />\n <Text component=\"p\" sx={{ color: 'inherit', textAlign: 'center' }} variant=\"h2\">\n {correct ? copy?.nailed_it : copy?.not_quite}\n </Text>\n </Stack>\n)\n\nconst ResultRow = ({\n copy,\n merchant,\n onClick,\n}: {\n copy?: QuizBlockCopy\n merchant: RankedQuizMerchant\n onClick: () => void\n}) => {\n const count = copy\n ? (buildPluralCopy(\n copy.transaction_count_one,\n copy.transaction_count,\n merchant.count,\n String(merchant.count),\n ) as string)\n : ''\n const label = copy\n ? (buildDynamicCopy(copy.rank_aria, String(merchant.rank), merchant.label, count) as string)\n : merchant.label\n\n return (\n <Stack\n aria-label={label}\n component={ButtonBase}\n direction=\"row\"\n onClick={onClick}\n sx={{ ...ROW_SX, pr: 8 }}\n >\n <MerchantLogo merchant={merchant} />\n <Stack sx={{ flexGrow: 1, minWidth: 0, textAlign: 'left' }}>\n <Text bold={true} noWrap={true} variant=\"body1\">\n {merchant.label}\n </Text>\n {count && <Text variant=\"caption\">{count}</Text>}\n </Stack>\n <Text bold={true} variant=\"body1\">\n {merchant.rank}\n </Text>\n <Icon aria-hidden={true} name=\"chevron_right\" size={16} sx={{ color: 'action.active' }} />\n </Stack>\n )\n}\n\n/** Monthly Top Transacted Merchant quiz; its progress lives in beat context for the quiz CTAs. */\nconst QuizBlock = observer(({ beatGuid = '', payload }: BlockProps) => {\n const copy = useGlobalCopyStore().insights_feed?.quiz_block\n const { beatContext, openActionDrawer, setBeatContext } = useInsightsV2Store()\n\n const merchants = readQuizMerchants(payload.instance_slot.data)\n const [options] = useState(() => shuffle(merchants))\n\n const context = beatContext[beatGuid] ?? {}\n const pick = context[QUIZ_CONTEXT.PICK] as string | undefined\n const checked = Boolean(context[QUIZ_CONTEXT.CHECKED])\n const revealed =\n payload.instance_slot.variant === QUIZ_VARIANTS.RESULTS ||\n Boolean(context[QUIZ_CONTEXT.REVEALED])\n const showFeedback = checked && !revealed\n\n useEffect(() => {\n if (!showFeedback) return\n const timer = setTimeout(\n () => setBeatContext(beatGuid, { [QUIZ_CONTEXT.REVEALED]: true }),\n FEEDBACK_MS,\n )\n return () => clearTimeout(timer)\n }, [beatGuid, setBeatContext, showFeedback])\n\n useEffect(() => {\n if (!copy) console.warn('quiz_block: copy namespace missing; rendering without its labels')\n }, [copy])\n\n // tupac's zero_state sends no data_series.\n if (!merchants.length) return <LinedCardZeroState />\n\n if (revealed) {\n const openMerchant = (merchant: RankedQuizMerchant) =>\n openActionDrawer({\n guid: beatGuid,\n trigger: 'inDescriptionCta',\n cta: { block: actionBlocksKey.QUIZ_MERCHANT_ACTION_BLOCK, variant: null },\n context: { quiz_merchant: merchant } satisfies QuizDrawerContext,\n })\n\n return (\n <Stack sx={{ gap: 12, p: 16 }}>\n {rankQuizMerchants(merchants).map((merchant) => (\n <ResultRow\n copy={copy}\n key={merchantKey(merchant)}\n merchant={merchant}\n onClick={() => openMerchant(merchant)}\n />\n ))}\n </Stack>\n )\n }\n\n const correct = Boolean(pick) && isTopMerchant(merchants, pick ?? '')\n\n return (\n <Stack sx={{ gap: 12, p: 16, position: 'relative' }}>\n {showFeedback && correct && <ConfettiOverlay />}\n {showFeedback && <FeedbackCard copy={copy} correct={correct} />}\n <Stack\n aria-label={payload.title}\n component=\"fieldset\"\n sx={{\n border: 0,\n gap: 12,\n m: 0,\n p: 0,\n visibility: showFeedback && correct ? 'hidden' : 'visible',\n }}\n >\n {options.map((merchant) => {\n const key = merchantKey(merchant)\n const selected = key === pick\n\n return (\n <Stack\n component=\"label\"\n direction=\"row\"\n key={key}\n sx={{\n ...ROW_SX,\n bgcolor: (theme) =>\n selected ? alpha(theme.palette.primary.main, 0.16) : 'background.paper',\n borderColor: (theme) =>\n selected ? alpha(theme.palette.primary.main, 0.5) : theme.palette.divider,\n borderWidth: selected ? 2 : 1,\n cursor: checked ? 'default' : 'pointer',\n pr: 4,\n }}\n >\n <MerchantLogo merchant={merchant} />\n <Text bold={true} noWrap={true} sx={{ flexGrow: 1 }} variant=\"body1\">\n {merchant.label}\n </Text>\n <Radio\n checked={selected}\n disabled={checked}\n name={`quiz-${beatGuid}`}\n onChange={() => setBeatContext(beatGuid, { [QUIZ_CONTEXT.PICK]: key })}\n size=\"small\"\n value={key}\n />\n </Stack>\n )\n })}\n </Stack>\n </Stack>\n )\n})\n\nexport default QuizBlock\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmCA,IAAM,IAAc,KAEd,IAAY,IACZ,IAAS;AAAA,EACb,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,cAAc;AAAA,EACd,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,IAAI;AAAA,EACJ,OAAO;AACT,GAEM,IAAA,CAAe,MACnB,EACG,IAAA,CAAK,OAAU;AAAA,EAAE,MAAA;AAAA,EAAM,OAAO,KAAK,OAAO;AAAE,EAAE,EAC9C,KAAA,CAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,KAAK,EAChC,IAAA,CAAK,EAAE,MAAA,EAAA,MAAW,CAAI,GAErB,IAAe,EAAA,CAAU,EAAE,UAAA,EAAA,MAA2C;AAC1E,QAAM,EAAE,sBAAA,EAAA,IAAyB,EAAoB,GAE/C,IAAO;AAAA,IAAE,GAAG,EAAiB,GAAU,CAAoB;AAAA,IAAG,KAAK;AAAA,EAAG;AAE5E,SAEE,gBAAA,EAAC,GAAD;AAAA,IACE,aAAa;AAAA,IACb,cAAc;AA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,GAAO,EAAI,CAAC;AAAA,gBACrE,MAAK;AAAA,gBACL,OAAO;AAAA,cACR,CAAA;AAAA,YACI;AAAA,UAxBA,GAAA,CAwBA;AAAA,QAEX,CAAC;AAAA,MACI,CAAA;AAAA,IACF;AAAA;AAEX,CAAC"}
1
+ {"version":3,"file":"QuizBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\n\nimport ButtonBase from '@mui/material/ButtonBase'\nimport Radio from '@mui/material/Radio'\nimport Stack from '@mui/material/Stack'\nimport { alpha } from '@mui/material/styles'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport { useGlobalCopyStore, useInsightsV2Store, useTransactionStore } from '../../../../common'\nimport type { QuizBlockCopy } from '../../../../core/types/localization/InsightsFeedCopy'\nimport { buildDynamicCopy, buildPluralCopy } from '../../../../core/utils/Localization'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport LogoTile from '../../../components/LogoTile'\nimport { ConfettiOverlay } from '../../../components/shared/ConfettiOverlay'\nimport { SMALL_CARD_SHADOW } from '../../../components/shared/elevation'\nimport { actionBlocksKey } from '../../../mappings/actionBlocksKey'\nimport type { BlockProps } from '../../types'\nimport {\n QUIZ_CONTEXT,\n QUIZ_VARIANTS,\n isTopMerchant,\n merchantKey,\n quizMerchantLogo,\n rankQuizMerchants,\n readQuizMerchants,\n type QuizDrawerContext,\n type QuizMerchant,\n type RankedQuizMerchant,\n} from './quiz'\n\n/** How long the \"Nailed it!\" / \"Not quite...\" card shows before the results. */\nconst FEEDBACK_MS = 3000\n\nconst LOGO_SIZE = 32\nconst ROW_SX = {\n alignItems: 'center',\n border: 1,\n borderColor: 'divider',\n borderRadius: '8px',\n gap: 12,\n height: 50,\n pl: 8,\n width: '100%',\n} as const\n\nconst shuffle = <T,>(items: T[]) =>\n items\n .map((item) => ({ item, order: Math.random() }))\n .sort((a, b) => a.order - b.order)\n .map(({ item }) => item)\n\nconst MerchantLogo = observer(({ merchant }: { merchant: QuizMerchant }) => {\n const { detailedTransactions } = useTransactionStore()\n // Empty alt: the merchant's name sits beside it.\n const logo = { ...quizMerchantLogo(merchant, detailedTransactions), alt: '' }\n\n return (\n // mxui's MerchantLogo image is absolute with no left; a button row's centered text pushes it halfway out.\n <LogoTile\n borderColor={null}\n borderRadius={4}\n size={LOGO_SIZE}\n sx={{ position: 'relative', textAlign: 'left' }}\n >\n <LogoFromGuid logo={logo} size={LOGO_SIZE} />\n </LogoTile>\n )\n})\n\nconst FeedbackCard = ({ correct, copy }: { correct: boolean; copy?: QuizBlockCopy }) => (\n <Stack\n role=\"status\"\n sx={{\n alignItems: 'center',\n backdropFilter: correct ? undefined : 'blur(6px)',\n bgcolor: (theme) => (correct ? 'success.main' : alpha(theme.palette.common.black, 0.5)),\n borderRadius: '8px',\n boxShadow: correct ? SMALL_CARD_SHADOW : undefined,\n color: correct ? 'success.contrastText' : 'common.white',\n gap: 18,\n inset: 16,\n justifyContent: 'center',\n p: 16,\n position: 'absolute',\n zIndex: 2,\n }}\n >\n <Icon aria-hidden={true} fill={true} name={correct ? 'check_circle' : 'cancel'} size={56} />\n <Text component=\"p\" sx={{ color: 'inherit', textAlign: 'center' }} variant=\"h2\">\n {correct ? copy?.nailed_it : copy?.not_quite}\n </Text>\n </Stack>\n)\n\nconst ResultRow = ({\n copy,\n merchant,\n onClick,\n}: {\n copy?: QuizBlockCopy\n merchant: RankedQuizMerchant\n onClick: () => void\n}) => {\n const count = copy\n ? (buildPluralCopy(\n copy.transaction_count_one,\n copy.transaction_count,\n merchant.count,\n String(merchant.count),\n ) as string)\n : ''\n const label = copy\n ? (buildDynamicCopy(copy.rank_aria, String(merchant.rank), merchant.label, count) as string)\n : merchant.label\n\n return (\n <Stack\n aria-label={label}\n component={ButtonBase}\n direction=\"row\"\n onClick={onClick}\n sx={{ ...ROW_SX, pr: 8 }}\n >\n <MerchantLogo merchant={merchant} />\n <Stack sx={{ flexGrow: 1, minWidth: 0, textAlign: 'left' }}>\n <Text bold={true} noWrap={true} variant=\"body1\">\n {merchant.label}\n </Text>\n {count && <Text variant=\"caption\">{count}</Text>}\n </Stack>\n <Text bold={true} variant=\"body1\">\n {merchant.rank}\n </Text>\n <Icon aria-hidden={true} name=\"chevron_right\" size={16} sx={{ color: 'action.active' }} />\n </Stack>\n )\n}\n\n/** Monthly Top Transacted Merchant quiz; its progress lives in beat context for the quiz CTAs. */\nconst QuizBlock = observer(({ beatGuid = '', payload }: BlockProps) => {\n const copy = useGlobalCopyStore().insights_feed?.quiz_block\n const { beatContext, openActionDrawer, setBeatContext } = useInsightsV2Store()\n\n const merchants = readQuizMerchants(payload.instance_slot.data)\n const [options] = useState(() => shuffle(merchants))\n\n const context = beatContext[beatGuid] ?? {}\n const pick = context[QUIZ_CONTEXT.PICK] as string | undefined\n const checked = Boolean(context[QUIZ_CONTEXT.CHECKED])\n const revealed =\n payload.instance_slot.variant === QUIZ_VARIANTS.RESULTS ||\n Boolean(context[QUIZ_CONTEXT.REVEALED])\n const showFeedback = checked && !revealed\n\n useEffect(() => {\n if (!showFeedback) return\n const timer = setTimeout(\n () => setBeatContext(beatGuid, { [QUIZ_CONTEXT.REVEALED]: true }),\n FEEDBACK_MS,\n )\n return () => clearTimeout(timer)\n }, [beatGuid, setBeatContext, showFeedback])\n\n useEffect(() => {\n if (!copy) console.warn('quiz_block: copy namespace missing; rendering without its labels')\n }, [copy])\n\n // zero_state sends no data_series; the card shows only its copy.\n if (!merchants.length) return null\n\n if (revealed) {\n const openMerchant = (merchant: RankedQuizMerchant) =>\n openActionDrawer({\n guid: beatGuid,\n trigger: 'inDescriptionCta',\n cta: { block: actionBlocksKey.QUIZ_MERCHANT_ACTION_BLOCK, variant: null },\n context: { quiz_merchant: merchant } satisfies QuizDrawerContext,\n })\n\n return (\n <Stack sx={{ gap: 12, p: 16 }}>\n {rankQuizMerchants(merchants).map((merchant) => (\n <ResultRow\n copy={copy}\n key={merchantKey(merchant)}\n merchant={merchant}\n onClick={() => openMerchant(merchant)}\n />\n ))}\n </Stack>\n )\n }\n\n const correct = Boolean(pick) && isTopMerchant(merchants, pick ?? '')\n\n return (\n <Stack sx={{ gap: 12, p: 16, position: 'relative' }}>\n {showFeedback && correct && <ConfettiOverlay />}\n {showFeedback && <FeedbackCard copy={copy} correct={correct} />}\n <Stack\n aria-label={payload.title}\n component=\"fieldset\"\n sx={{\n border: 0,\n gap: 12,\n m: 0,\n p: 0,\n visibility: showFeedback && correct ? 'hidden' : 'visible',\n }}\n >\n {options.map((merchant) => {\n const key = merchantKey(merchant)\n const selected = key === pick\n\n return (\n <Stack\n component=\"label\"\n direction=\"row\"\n key={key}\n sx={{\n ...ROW_SX,\n bgcolor: (theme) =>\n selected ? alpha(theme.palette.primary.main, 0.16) : 'background.paper',\n borderColor: (theme) =>\n selected ? alpha(theme.palette.primary.main, 0.5) : theme.palette.divider,\n borderWidth: selected ? 2 : 1,\n cursor: checked ? 'default' : 'pointer',\n pr: 4,\n }}\n >\n <MerchantLogo merchant={merchant} />\n <Text bold={true} noWrap={true} sx={{ flexGrow: 1 }} variant=\"body1\">\n {merchant.label}\n </Text>\n <Radio\n checked={selected}\n disabled={checked}\n name={`quiz-${beatGuid}`}\n onChange={() => setBeatContext(beatGuid, { [QUIZ_CONTEXT.PICK]: key })}\n size=\"small\"\n value={key}\n />\n </Stack>\n )\n })}\n </Stack>\n </Stack>\n )\n})\n\nexport default QuizBlock\n"],"mappings":";;;;;;;;;;;;;;;;;AAkCA,IAAM,IAAc,KAEd,IAAY,IACZ,IAAS;AAAA,EACb,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,cAAc;AAAA,EACd,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,IAAI;AAAA,EACJ,OAAO;AACT,GAEM,IAAA,CAAe,MACnB,EACG,IAAA,CAAK,OAAU;AAAA,E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AAA,EAAC,GAAD,EAAwB,UAAA,EAAW,CAAA;AAAA,cACnC,gBAAA,EAAC,GAAD;AAAA,gBAAM,MAAM;AAAA,gBAAM,QAAQ;AAAA,gBAAM,IAAI,EAAE,UAAU,EAAE;AAAA,gBAAG,SAAQ;AAAA,gBAC1D,UAAA,EAAS;AAAA,cACN,CAAA;AAAA,cACN,gBAAA,EAAC,GAAD;AAAA,gBACE,SAAS;AAAA,gBACT,UAAU;AAAA,gBACV,MAAM,QAAQ,CAAA;AAAA,gBACd,UAAA,MAAgB,EAAe,GAAU,EAAA,CAAG,EAAa,IAAA,GAAO,EAAI,CAAC;AAAA,gBACrE,MAAK;AAAA,gBACL,OAAO;AAAA,cACR,CAAA;AAAA,YACI;AAAA,UAxBA,GAAA,CAwBA;AAAA,QAEX,CAAC;AAAA,MACI,CAAA;AAAA,IACF;AAAA;AAEX,CAAC"}
@@ -1,33 +1,38 @@
1
1
  import { slot as r } from "../../../../core/types/Insights.es.js";
2
- import { CURRENCY_FORMAT as i, formatCurrency as x } from "../../../../core/utils/NumberFormatting.es.js";
3
- import { asNumber as s, asText as a } from "../../slotReaders.es.js";
4
- import c from "../../../components/SaveAnExtraCard.es.js";
2
+ import { CURRENCY_FORMAT as c, formatCurrency as x } from "../../../../core/utils/NumberFormatting.es.js";
3
+ import { resolveVariantConfig as f } from "../../resolveVariantConfig.es.js";
4
+ import { asNumber as s, asText as n } from "../../slotReaders.es.js";
5
+ import v from "../../../components/SaveAnExtraCard.es.js";
6
+ import { SAVE_EXTRA_LAYOUT as l, saveExtraBlockVariant as u } from "./layout.es.js";
5
7
  import d from "@mui/material/Stack";
6
- import { jsx as m } from "react/jsx-runtime";
7
- var u = (e) => {
8
- const t = e.instance_slot?.data, o = s(r(t, "savings_amount"));
9
- if (o === void 0) return null;
10
- const n = s(r(t, "amount"));
8
+ import { jsx as i } from "react/jsx-runtime";
9
+ var p = (o) => {
10
+ const t = o.instance_slot?.data, a = s(r(t, "savings_amount"));
11
+ if (a === void 0) return null;
12
+ const e = s(r(t, "amount"));
11
13
  return {
12
14
  primaryText: [
13
- a(r(t, "header_text")) ?? "",
14
- String(o),
15
- a(r(t, "primary_text")) ?? ""
15
+ n(r(t, "header_text")) ?? "",
16
+ String(a),
17
+ n(r(t, "primary_text")) ?? ""
16
18
  ],
17
- secondaryText: n !== void 0 ? [x(n, i.cents), a(r(t, "secondary_text")) ?? ""] : void 0
19
+ secondaryText: e !== void 0 ? [x(e, c.cents), n(r(t, "secondary_text")) ?? ""] : void 0
18
20
  };
19
- }, _ = ({ payload: e }) => {
20
- const t = u(e);
21
- return t ? /* @__PURE__ */ m(d, {
22
- sx: { px: 16 },
23
- children: /* @__PURE__ */ m(c, {
21
+ }, k = ({ payload: o }) => {
22
+ const t = p(o);
23
+ if (!t) return null;
24
+ const { showFooter: a, containerSx: e, fill: m } = f(l, o.instance_slot?.variant, u.SaveAmount, "SaveExtraBlock");
25
+ return /* @__PURE__ */ i(d, {
26
+ sx: e,
27
+ children: /* @__PURE__ */ i(v, {
28
+ fill: m,
24
29
  primaryText: t.primaryText,
25
- secondaryText: t.secondaryText
30
+ secondaryText: a ? t.secondaryText : void 0
26
31
  })
27
- }) : null;
32
+ });
28
33
  };
29
34
  export {
30
- _ as default
35
+ k as default
31
36
  };
32
37
 
33
38
  //# sourceMappingURL=SaveExtraBlock.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SaveExtraBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { slot } from '../../../../core/types/Insights'\nimport type { SaveExtraBlockData } from '../../../../core/types/InsightsInstanceSlotData'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport SaveAnExtraCard from '../../../components/SaveAnExtraCard'\n\nimport { asNumber, asText } from '../../slotReaders'\nimport type { BlockProps } from '../../types'\n\ninterface Segments {\n primaryText: string[]\n secondaryText?: string[]\n}\n\n/** No tile without `savings_amount` (never a made-up \"$0.00\"); the footer needs `amount`. */\nconst segmentsOf = (payload: BlockProps<SaveExtraBlockData>['payload']): Segments | null => {\n const data = payload.instance_slot?.data\n const savingsAmount = asNumber(slot(data, 'savings_amount'))\n if (savingsAmount === undefined) return null\n\n const amount = asNumber(slot(data, 'amount'))\n\n return {\n primaryText: [\n asText(slot(data, 'header_text')) ?? '',\n String(savingsAmount),\n asText(slot(data, 'primary_text')) ?? '',\n ],\n secondaryText:\n amount !== undefined\n ? [\n formatCurrency(amount, CURRENCY_FORMAT.cents),\n asText(slot(data, 'secondary_text')) ?? '',\n ]\n : undefined,\n }\n}\n\nconst SaveExtraBlock = ({ payload }: BlockProps<SaveExtraBlockData>) => {\n const segments = segmentsOf(payload)\n if (!segments) return null\n\n return (\n <Stack sx={{ px: 16 }}>\n <SaveAnExtraCard primaryText={segments.primaryText} secondaryText={segments.secondaryText} />\n </Stack>\n )\n}\n\nexport default SaveExtraBlock\n"],"mappings":";;;;;;AAiBA,IAAM,IAAA,CAAc,MAAwE;AAC1F,QAAM,IAAO,EAAQ,eAAe,MAC9B,IAAgB,EAAS,EAAK,GAAM,gBAAgB,CAAC;AAC3D,MAAI,MAAkB,OAAW,QAAO;AAExC,QAAM,IAAS,EAAS,EAAK,GAAM,QAAQ,CAAC;AAE5C,SAAO;AAAA,IACL,aAAa;AAAA,MACX,EAAO,EAAK,GAAM,aAAa,CAAC,KAAK;AAAA,MACrC,OAAO,CAAa;AAAA,MACpB,EAAO,EAAK,GAAM,cAAc,CAAC,KAAK;AAAA,IACxC;AAAA,IACA,eACE,MAAW,SACP,CACE,EAAe,GAAQ,EAAgB,KAAK,GAC5C,EAAO,EAAK,GAAM,gBAAgB,CAAC,KAAK,EAC1C,IACA;AAAA,EACR;AACF,GAEM,IAAA,CAAkB,EAAE,SAAA,EAAA,MAA8C;AACtE,QAAM,IAAW,EAAW,CAAO;AACnC,SAAK,IAGH,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,IAAI,GAAG;AAAA,IAClB,UAAA,gBAAA,EAAC,GAAD;AAAA,MAAiB,aAAa,EAAS;AAAA,MAAa,eAAe,EAAS;AAAA,IAAgB,CAAA;AAAA,EACvF,CAAA,IALa;AAOxB"}
1
+ {"version":3,"file":"SaveExtraBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { slot } from '../../../../core/types/Insights'\nimport type { SaveExtraBlockData } from '../../../../core/types/InsightsInstanceSlotData'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport SaveAnExtraCard from '../../../components/SaveAnExtraCard'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asNumber, asText } from '../../slotReaders'\nimport type { BlockProps } from '../../types'\n\nimport { SAVE_EXTRA_LAYOUT, saveExtraBlockVariant } from './layout'\n\ninterface Segments {\n primaryText: string[]\n secondaryText?: string[]\n}\n\n/** No tile without `savings_amount` (never a made-up \"$0.00\"); the footer needs `amount`. */\nconst segmentsOf = (payload: BlockProps<SaveExtraBlockData>['payload']): Segments | null => {\n const data = payload.instance_slot?.data\n const savingsAmount = asNumber(slot(data, 'savings_amount'))\n if (savingsAmount === undefined) return null\n\n const amount = asNumber(slot(data, 'amount'))\n\n return {\n primaryText: [\n asText(slot(data, 'header_text')) ?? '',\n String(savingsAmount),\n asText(slot(data, 'primary_text')) ?? '',\n ],\n secondaryText:\n amount !== undefined\n ? [\n formatCurrency(amount, CURRENCY_FORMAT.cents),\n asText(slot(data, 'secondary_text')) ?? '',\n ]\n : undefined,\n }\n}\n\nconst SaveExtraBlock = ({ payload }: BlockProps<SaveExtraBlockData>) => {\n const segments = segmentsOf(payload)\n if (!segments) return null\n\n const { showFooter, containerSx, fill } = resolveVariantConfig(\n SAVE_EXTRA_LAYOUT,\n payload.instance_slot?.variant,\n saveExtraBlockVariant.SaveAmount,\n 'SaveExtraBlock',\n )\n\n return (\n <Stack sx={containerSx}>\n <SaveAnExtraCard\n fill={fill}\n primaryText={segments.primaryText}\n secondaryText={showFooter ? segments.secondaryText : undefined}\n />\n </Stack>\n )\n}\n\nexport default SaveExtraBlock\n"],"mappings":";;;;;;;;AAoBA,IAAM,IAAA,CAAc,MAAwE;AAC1F,QAAM,IAAO,EAAQ,eAAe,MAC9B,IAAgB,EAAS,EAAK,GAAM,gBAAgB,CAAC;AAC3D,MAAI,MAAkB,OAAW,QAAO;AAExC,QAAM,IAAS,EAAS,EAAK,GAAM,QAAQ,CAAC;AAE5C,SAAO;AAAA,IACL,aAAa;AAAA,MACX,EAAO,EAAK,GAAM,aAAa,CAAC,KAAK;AAAA,MACrC,OAAO,CAAa;AAAA,MACpB,EAAO,EAAK,GAAM,cAAc,CAAC,KAAK;AAAA,IACxC;AAAA,IACA,eACE,MAAW,SACP,CACE,EAAe,GAAQ,EAAgB,KAAK,GAC5C,EAAO,EAAK,GAAM,gBAAgB,CAAC,KAAK,EAC1C,IACA;AAAA,EACR;AACF,GAEM,IAAA,CAAkB,EAAE,SAAA,EAAA,MAA8C;AACtE,QAAM,IAAW,EAAW,CAAO;AACnC,MAAI,CAAC,EAAU,QAAO;AAEtB,QAAM,EAAE,YAAA,GAAY,aAAA,GAAa,MAAA,EAAA,IAAS,EACxC,GACA,EAAQ,eAAe,SACvB,EAAsB,YACtB,gBACF;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,IACT,UAAA,gBAAA,EAAC,GAAD;AAAA,MACQ,MAAA;AAAA,MACN,aAAa,EAAS;AAAA,MACtB,eAAe,IAAa,EAAS,gBAAgB;AAAA,IACtD,CAAA;AAAA,EACI,CAAA;AAEX"}
@@ -0,0 +1,22 @@
1
+ import { SxProps, Theme } from '@mui/material/styles';
2
+ /**
3
+ * Save Extra block variants, keyed by the backend `instance_slot.variant` (ditto save_extra_block.yml).
4
+ *
5
+ * - `SaveAmount` — full: the green savings tile above the white projected-balance footer.
6
+ * - `SaveAmountCompact` — mini (Figma 17031:312158): the green tile alone, filling the slot
7
+ * (`SaveAnExtraCard`'s `fill`).
8
+ */
9
+ export declare const saveExtraBlockVariant: {
10
+ readonly SaveAmount: "save_amount";
11
+ readonly SaveAmountCompact: "save_amount_compact";
12
+ };
13
+ export type SaveExtraBlockVariant = (typeof saveExtraBlockVariant)[keyof typeof saveExtraBlockVariant];
14
+ export interface SaveExtraBlockLayoutConfig {
15
+ /** Draw the projected-balance footer (when the slot carries `amount`). */
16
+ showFooter: boolean;
17
+ /** The block's wrapper around the card. */
18
+ containerSx: SxProps<Theme>;
19
+ /** `SaveAnExtraCard` grows to the slot with its copy centered. */
20
+ fill: boolean;
21
+ }
22
+ export declare const SAVE_EXTRA_LAYOUT: Record<SaveExtraBlockVariant, SaveExtraBlockLayoutConfig>;
@@ -0,0 +1,24 @@
1
+ var a = {
2
+ SaveAmount: "save_amount",
3
+ SaveAmountCompact: "save_amount_compact"
4
+ }, o = {
5
+ [a.SaveAmount]: {
6
+ showFooter: !0,
7
+ containerSx: { px: 16 },
8
+ fill: !1
9
+ },
10
+ [a.SaveAmountCompact]: {
11
+ showFooter: !1,
12
+ containerSx: {
13
+ height: "100%",
14
+ px: 16
15
+ },
16
+ fill: !0
17
+ }
18
+ };
19
+ export {
20
+ o as SAVE_EXTRA_LAYOUT,
21
+ a as saveExtraBlockVariant
22
+ };
23
+
24
+ //# sourceMappingURL=layout.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/layout.ts"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material/styles'\n\n/**\n * Save Extra block variants, keyed by the backend `instance_slot.variant` (ditto save_extra_block.yml).\n *\n * - `SaveAmount` — full: the green savings tile above the white projected-balance footer.\n * - `SaveAmountCompact` — mini (Figma 17031:312158): the green tile alone, filling the slot\n * (`SaveAnExtraCard`'s `fill`).\n */\nexport const saveExtraBlockVariant = {\n SaveAmount: 'save_amount',\n SaveAmountCompact: 'save_amount_compact',\n} as const\n\nexport type SaveExtraBlockVariant =\n (typeof saveExtraBlockVariant)[keyof typeof saveExtraBlockVariant]\n\nexport interface SaveExtraBlockLayoutConfig {\n /** Draw the projected-balance footer (when the slot carries `amount`). */\n showFooter: boolean\n /** The block's wrapper around the card. */\n containerSx: SxProps<Theme>\n /** `SaveAnExtraCard` grows to the slot with its copy centered. */\n fill: boolean\n}\n\nexport const SAVE_EXTRA_LAYOUT: Record<SaveExtraBlockVariant, SaveExtraBlockLayoutConfig> = {\n [saveExtraBlockVariant.SaveAmount]: {\n showFooter: true,\n containerSx: { px: 16 },\n fill: false,\n },\n [saveExtraBlockVariant.SaveAmountCompact]: {\n showFooter: false,\n containerSx: { height: '100%', px: 16 },\n fill: true,\n },\n}\n"],"mappings":"AASA,IAAa,IAAwB;AAAA,EACnC,YAAY;AAAA,EACZ,mBAAmB;AACrB,GAca,IAA+E;AAAA,EACzF,CAAA,EAAsB,UAAA,GAAa;AAAA,IAClC,YAAY;AAAA,IACZ,aAAa,EAAE,IAAI,GAAG;AAAA,IACtB,MAAM;AAAA,EACR;AAAA,EACC,CAAA,EAAsB,iBAAA,GAAoB;AAAA,IACzC,YAAY;AAAA,IACZ,aAAa;AAAA,MAAE,QAAQ;AAAA,MAAQ,IAAI;AAAA,IAAG;AAAA,IACtC,MAAM;AAAA,EACR;AACF"}
@@ -0,0 +1,7 @@
1
+ import { BlockProps } from '../../types';
2
+ /**
3
+ * The strategy tiles (ditto `strategies_block`, Debt Payoff Strategies, Figma 1943:219418): each an
4
+ * `ICO-` glyph on a 25% wash of its colour, with a title and, on full, a line of text.
5
+ */
6
+ declare const StrategiesBlock: ({ payload }: BlockProps) => import("react/jsx-runtime").JSX.Element | null;
7
+ export default StrategiesBlock;