@salesmind-ai/design-system 0.3.3 → 0.3.4

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 (215) hide show
  1. package/dist/{SectionShell-BfBw5q0Y.d.cts → SectionShell-GlglHCzz.d.cts} +1 -0
  2. package/dist/{SectionShell-BfBw5q0Y.d.ts → SectionShell-GlglHCzz.d.ts} +1 -0
  3. package/dist/StatsSection-B8iD9L-o.d.ts +68 -0
  4. package/dist/StatsSection-wgd8Vge1.d.cts +68 -0
  5. package/dist/admin/index.cjs +2928 -68
  6. package/dist/admin/index.cjs.map +1 -1
  7. package/dist/admin/index.js +2915 -5
  8. package/dist/admin/index.js.map +1 -1
  9. package/dist/blog/index.cjs +1064 -53
  10. package/dist/blog/index.cjs.map +1 -1
  11. package/dist/blog/index.d.cts +1 -1
  12. package/dist/blog/index.d.ts +1 -1
  13. package/dist/blog/index.js +1054 -8
  14. package/dist/blog/index.js.map +1 -1
  15. package/dist/charts/index.cjs +2694 -46
  16. package/dist/charts/index.cjs.map +1 -1
  17. package/dist/charts/index.js +2680 -3
  18. package/dist/charts/index.js.map +1 -1
  19. package/dist/core/index.cjs +4333 -807
  20. package/dist/core/index.cjs.map +1 -1
  21. package/dist/core/index.js +4130 -14
  22. package/dist/core/index.js.map +1 -1
  23. package/dist/i18n/index.cjs +558 -86
  24. package/dist/i18n/index.cjs.map +1 -1
  25. package/dist/i18n/index.js +544 -1
  26. package/dist/i18n/index.js.map +1 -1
  27. package/dist/index.cjs +17140 -1432
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.css +24 -13
  30. package/dist/index.css.map +1 -1
  31. package/dist/index.d.cts +2 -2
  32. package/dist/index.d.ts +2 -2
  33. package/dist/index.js +16785 -31
  34. package/dist/index.js.map +1 -1
  35. package/dist/marketing/index.cjs +3072 -142
  36. package/dist/marketing/index.cjs.map +1 -1
  37. package/dist/marketing/index.d.cts +1 -1
  38. package/dist/marketing/index.d.ts +1 -1
  39. package/dist/marketing/index.js +3042 -11
  40. package/dist/marketing/index.js.map +1 -1
  41. package/dist/motion/index.cjs +1222 -26
  42. package/dist/motion/index.cjs.map +1 -1
  43. package/dist/motion/index.js +1215 -2
  44. package/dist/motion/index.js.map +1 -1
  45. package/dist/nav/index.cjs +1518 -101
  46. package/dist/nav/index.cjs.map +1 -1
  47. package/dist/nav/index.css +24 -13
  48. package/dist/nav/index.css.map +1 -1
  49. package/dist/nav/index.js +1498 -4
  50. package/dist/nav/index.js.map +1 -1
  51. package/dist/report/index.cjs +2403 -171
  52. package/dist/report/index.cjs.map +1 -1
  53. package/dist/report/index.js +2363 -3
  54. package/dist/report/index.js.map +1 -1
  55. package/dist/sections/index.cjs +382 -28
  56. package/dist/sections/index.cjs.map +1 -1
  57. package/dist/sections/index.d.cts +15 -69
  58. package/dist/sections/index.d.ts +15 -69
  59. package/dist/sections/index.js +376 -4
  60. package/dist/sections/index.js.map +1 -1
  61. package/dist/social-proof/index.cjs +1250 -53
  62. package/dist/social-proof/index.cjs.map +1 -1
  63. package/dist/social-proof/index.d.cts +1 -1
  64. package/dist/social-proof/index.d.ts +1 -1
  65. package/dist/social-proof/index.js +1235 -6
  66. package/dist/social-proof/index.js.map +1 -1
  67. package/dist/theme/index.cjs +565 -38
  68. package/dist/theme/index.cjs.map +1 -1
  69. package/dist/theme/index.js +555 -2
  70. package/dist/theme/index.js.map +1 -1
  71. package/dist/web/client/index.cjs +491 -38
  72. package/dist/web/client/index.cjs.map +1 -1
  73. package/dist/web/client/index.js +483 -4
  74. package/dist/web/client/index.js.map +1 -1
  75. package/dist/web/index.cjs +1346 -158
  76. package/dist/web/index.cjs.map +1 -1
  77. package/dist/web/index.js +1305 -9
  78. package/dist/web/index.js.map +1 -1
  79. package/dist/web/server/index.cjs +563 -26
  80. package/dist/web/server/index.cjs.map +1 -1
  81. package/dist/web/server/index.js +560 -1
  82. package/dist/web/server/index.js.map +1 -1
  83. package/package.json +1 -1
  84. package/dist/chunk-2GARWEJK.js +0 -17
  85. package/dist/chunk-2GARWEJK.js.map +0 -1
  86. package/dist/chunk-3NKRFUAR.js +0 -37
  87. package/dist/chunk-3NKRFUAR.js.map +0 -1
  88. package/dist/chunk-3TGSIILM.cjs +0 -201
  89. package/dist/chunk-3TGSIILM.cjs.map +0 -1
  90. package/dist/chunk-4GM5BGBN.cjs +0 -801
  91. package/dist/chunk-4GM5BGBN.cjs.map +0 -1
  92. package/dist/chunk-5LGDEZWY.cjs +0 -2434
  93. package/dist/chunk-5LGDEZWY.cjs.map +0 -1
  94. package/dist/chunk-6H4DSTXR.js +0 -786
  95. package/dist/chunk-6H4DSTXR.js.map +0 -1
  96. package/dist/chunk-6UNG76Y2.js +0 -153
  97. package/dist/chunk-6UNG76Y2.js.map +0 -1
  98. package/dist/chunk-7PX2AZ6Y.js +0 -39
  99. package/dist/chunk-7PX2AZ6Y.js.map +0 -1
  100. package/dist/chunk-B6AVAX4F.js +0 -1415
  101. package/dist/chunk-B6AVAX4F.js.map +0 -1
  102. package/dist/chunk-BILT5KD3.js +0 -264
  103. package/dist/chunk-BILT5KD3.js.map +0 -1
  104. package/dist/chunk-C2BCDNAV.js +0 -24
  105. package/dist/chunk-C2BCDNAV.js.map +0 -1
  106. package/dist/chunk-CH42VPWE.cjs +0 -421
  107. package/dist/chunk-CH42VPWE.cjs.map +0 -1
  108. package/dist/chunk-CJ2MKVAF.cjs +0 -46
  109. package/dist/chunk-CJ2MKVAF.cjs.map +0 -1
  110. package/dist/chunk-DP74LUXG.cjs +0 -98
  111. package/dist/chunk-DP74LUXG.cjs.map +0 -1
  112. package/dist/chunk-E7D6EKJ4.cjs +0 -44
  113. package/dist/chunk-E7D6EKJ4.cjs.map +0 -1
  114. package/dist/chunk-ECXBTUH6.cjs +0 -584
  115. package/dist/chunk-ECXBTUH6.cjs.map +0 -1
  116. package/dist/chunk-EFRAP5ES.js +0 -157
  117. package/dist/chunk-EFRAP5ES.js.map +0 -1
  118. package/dist/chunk-F6YYWMME.js +0 -485
  119. package/dist/chunk-F6YYWMME.js.map +0 -1
  120. package/dist/chunk-FAFAP4L5.js +0 -183
  121. package/dist/chunk-FAFAP4L5.js.map +0 -1
  122. package/dist/chunk-GUZIMHWS.js +0 -1608
  123. package/dist/chunk-GUZIMHWS.js.map +0 -1
  124. package/dist/chunk-H2Y6BSTL.cjs +0 -69
  125. package/dist/chunk-H2Y6BSTL.cjs.map +0 -1
  126. package/dist/chunk-HN4PHABT.js +0 -126
  127. package/dist/chunk-HN4PHABT.js.map +0 -1
  128. package/dist/chunk-HRENHNDJ.js +0 -211
  129. package/dist/chunk-HRENHNDJ.js.map +0 -1
  130. package/dist/chunk-I75BFEYT.cjs +0 -2561
  131. package/dist/chunk-I75BFEYT.cjs.map +0 -1
  132. package/dist/chunk-IFRATNLU.js +0 -562
  133. package/dist/chunk-IFRATNLU.js.map +0 -1
  134. package/dist/chunk-IYPXJ6YC.cjs +0 -69
  135. package/dist/chunk-IYPXJ6YC.cjs.map +0 -1
  136. package/dist/chunk-JPJN4YBC.js +0 -409
  137. package/dist/chunk-JPJN4YBC.js.map +0 -1
  138. package/dist/chunk-KBA2LFBG.js +0 -62
  139. package/dist/chunk-KBA2LFBG.js.map +0 -1
  140. package/dist/chunk-KCKUSU2M.cjs +0 -166
  141. package/dist/chunk-KCKUSU2M.cjs.map +0 -1
  142. package/dist/chunk-KJ2OXQF4.js +0 -287
  143. package/dist/chunk-KJ2OXQF4.js.map +0 -1
  144. package/dist/chunk-KNQEIU7O.cjs +0 -1202
  145. package/dist/chunk-KNQEIU7O.cjs.map +0 -1
  146. package/dist/chunk-KVGSVGRK.cjs +0 -569
  147. package/dist/chunk-KVGSVGRK.cjs.map +0 -1
  148. package/dist/chunk-L352JRV6.cjs +0 -105
  149. package/dist/chunk-L352JRV6.cjs.map +0 -1
  150. package/dist/chunk-LJADZITX.cjs +0 -298
  151. package/dist/chunk-LJADZITX.cjs.map +0 -1
  152. package/dist/chunk-LMJPWXTZ.cjs +0 -194
  153. package/dist/chunk-LMJPWXTZ.cjs.map +0 -1
  154. package/dist/chunk-LOWEAQST.js +0 -701
  155. package/dist/chunk-LOWEAQST.js.map +0 -1
  156. package/dist/chunk-MDB2WCRQ.cjs +0 -137
  157. package/dist/chunk-MDB2WCRQ.cjs.map +0 -1
  158. package/dist/chunk-MQDEE7HC.cjs +0 -283
  159. package/dist/chunk-MQDEE7HC.cjs.map +0 -1
  160. package/dist/chunk-MQRB634A.cjs +0 -34
  161. package/dist/chunk-MQRB634A.cjs.map +0 -1
  162. package/dist/chunk-MTI27RDV.js +0 -185
  163. package/dist/chunk-MTI27RDV.js.map +0 -1
  164. package/dist/chunk-MU6GW5ZV.js +0 -2317
  165. package/dist/chunk-MU6GW5ZV.js.map +0 -1
  166. package/dist/chunk-NN3TUHIH.js +0 -28
  167. package/dist/chunk-NN3TUHIH.js.map +0 -1
  168. package/dist/chunk-NT4LBP7D.cjs +0 -111
  169. package/dist/chunk-NT4LBP7D.cjs.map +0 -1
  170. package/dist/chunk-OLV7OD3X.cjs +0 -502
  171. package/dist/chunk-OLV7OD3X.cjs.map +0 -1
  172. package/dist/chunk-OXNXEQY7.js +0 -2538
  173. package/dist/chunk-OXNXEQY7.js.map +0 -1
  174. package/dist/chunk-P5BOFE5A.js +0 -546
  175. package/dist/chunk-P5BOFE5A.js.map +0 -1
  176. package/dist/chunk-Q2MFGYTE.cjs +0 -1449
  177. package/dist/chunk-Q2MFGYTE.cjs.map +0 -1
  178. package/dist/chunk-Q75DBVDY.cjs +0 -68
  179. package/dist/chunk-Q75DBVDY.cjs.map +0 -1
  180. package/dist/chunk-REQ5Q6ZI.js +0 -1022
  181. package/dist/chunk-REQ5Q6ZI.js.map +0 -1
  182. package/dist/chunk-SICKWUWB.js +0 -62
  183. package/dist/chunk-SICKWUWB.js.map +0 -1
  184. package/dist/chunk-T343CCH5.js +0 -1190
  185. package/dist/chunk-T343CCH5.js.map +0 -1
  186. package/dist/chunk-TEC62D4A.cjs +0 -1624
  187. package/dist/chunk-TEC62D4A.cjs.map +0 -1
  188. package/dist/chunk-TW5JB35D.js +0 -2122
  189. package/dist/chunk-TW5JB35D.js.map +0 -1
  190. package/dist/chunk-VC5LMUVQ.cjs +0 -20
  191. package/dist/chunk-VC5LMUVQ.cjs.map +0 -1
  192. package/dist/chunk-VM7WFMKI.cjs +0 -76
  193. package/dist/chunk-VM7WFMKI.cjs.map +0 -1
  194. package/dist/chunk-W2WTP6HS.cjs +0 -233
  195. package/dist/chunk-W2WTP6HS.cjs.map +0 -1
  196. package/dist/chunk-WH7PYHZY.cjs +0 -35
  197. package/dist/chunk-WH7PYHZY.cjs.map +0 -1
  198. package/dist/chunk-XQZVY7JJ.cjs +0 -717
  199. package/dist/chunk-XQZVY7JJ.cjs.map +0 -1
  200. package/dist/chunk-XU3OMQ7V.js +0 -98
  201. package/dist/chunk-XU3OMQ7V.js.map +0 -1
  202. package/dist/chunk-XWPDRMZG.js +0 -62
  203. package/dist/chunk-XWPDRMZG.js.map +0 -1
  204. package/dist/chunk-Y3CPKNB7.js +0 -67
  205. package/dist/chunk-Y3CPKNB7.js.map +0 -1
  206. package/dist/chunk-YNVRDD2P.js +0 -98
  207. package/dist/chunk-YNVRDD2P.js.map +0 -1
  208. package/dist/chunk-YSYR54XR.js +0 -92
  209. package/dist/chunk-YSYR54XR.js.map +0 -1
  210. package/dist/chunk-YTYDQBVY.cjs +0 -162
  211. package/dist/chunk-YTYDQBVY.cjs.map +0 -1
  212. package/dist/chunk-ZDLOA2UT.cjs +0 -1042
  213. package/dist/chunk-ZDLOA2UT.cjs.map +0 -1
  214. package/dist/chunk-ZWUKRCOJ.cjs +0 -2162
  215. package/dist/chunk-ZWUKRCOJ.cjs.map +0 -1
@@ -1,182 +1,2414 @@
1
1
  'use strict';
2
2
 
3
- var chunk4GM5BGBN_cjs = require('../chunk-4GM5BGBN.cjs');
4
- var chunkQ2MFGYTE_cjs = require('../chunk-Q2MFGYTE.cjs');
5
- var chunk3TGSIILM_cjs = require('../chunk-3TGSIILM.cjs');
3
+ var React2 = require('react');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+ var clsx12 = require('clsx');
6
+ var select = require('@base-ui/react/select');
7
+ var menu = require('@base-ui/react/menu');
6
8
 
9
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
7
10
 
11
+ var React2__default = /*#__PURE__*/_interopDefault(React2);
12
+ var clsx12__default = /*#__PURE__*/_interopDefault(clsx12);
8
13
 
9
- Object.defineProperty(exports, "CaveatBlock", {
10
- enumerable: true,
11
- get: function () { return chunk4GM5BGBN_cjs.CaveatBlock; }
12
- });
13
- Object.defineProperty(exports, "EvidenceGroup", {
14
- enumerable: true,
15
- get: function () { return chunk4GM5BGBN_cjs.EvidenceGroup; }
16
- });
17
- Object.defineProperty(exports, "ExecutiveThesis", {
18
- enumerable: true,
19
- get: function () { return chunk4GM5BGBN_cjs.ExecutiveThesis; }
20
- });
21
- Object.defineProperty(exports, "ExportMenu", {
22
- enumerable: true,
23
- get: function () { return chunk4GM5BGBN_cjs.ExportMenu; }
24
- });
25
- Object.defineProperty(exports, "InsightBlock", {
26
- enumerable: true,
27
- get: function () { return chunk4GM5BGBN_cjs.InsightBlock; }
28
- });
29
- Object.defineProperty(exports, "KeyMetric", {
30
- enumerable: true,
31
- get: function () { return chunk4GM5BGBN_cjs.KeyMetric; }
32
- });
33
- Object.defineProperty(exports, "MethodologyNote", {
34
- enumerable: true,
35
- get: function () { return chunk4GM5BGBN_cjs.MethodologyNote; }
36
- });
37
- Object.defineProperty(exports, "ReportShell", {
38
- enumerable: true,
39
- get: function () { return chunk4GM5BGBN_cjs.ReportShell; }
40
- });
41
- Object.defineProperty(exports, "TrendIndicator", {
42
- enumerable: true,
43
- get: function () { return chunk4GM5BGBN_cjs.TrendIndicator; }
44
- });
45
- Object.defineProperty(exports, "ANALYST_MODE", {
46
- enumerable: true,
47
- get: function () { return chunkQ2MFGYTE_cjs.ANALYST_MODE; }
48
- });
49
- Object.defineProperty(exports, "ANALYTICAL_STATE_CONFIG", {
50
- enumerable: true,
51
- get: function () { return chunkQ2MFGYTE_cjs.ANALYTICAL_STATE_CONFIG; }
52
- });
53
- Object.defineProperty(exports, "CHART_REGISTRY", {
54
- enumerable: true,
55
- get: function () { return chunkQ2MFGYTE_cjs.CHART_REGISTRY; }
56
- });
57
- Object.defineProperty(exports, "CONFIDENCE_THRESHOLDS", {
58
- enumerable: true,
59
- get: function () { return chunkQ2MFGYTE_cjs.CONFIDENCE_THRESHOLDS; }
60
- });
61
- Object.defineProperty(exports, "ConfidenceIndicator", {
62
- enumerable: true,
63
- get: function () { return chunkQ2MFGYTE_cjs.ConfidenceIndicator; }
64
- });
65
- Object.defineProperty(exports, "DataCoverageBadge", {
66
- enumerable: true,
67
- get: function () { return chunkQ2MFGYTE_cjs.DataCoverageBadge; }
68
- });
69
- Object.defineProperty(exports, "DataStateIndicator", {
70
- enumerable: true,
71
- get: function () { return chunkQ2MFGYTE_cjs.DataStateIndicator; }
72
- });
73
- Object.defineProperty(exports, "EXECUTIVE_MODE", {
74
- enumerable: true,
75
- get: function () { return chunkQ2MFGYTE_cjs.EXECUTIVE_MODE; }
76
- });
77
- Object.defineProperty(exports, "INSIGHT_TYPE_CONTRACTS", {
78
- enumerable: true,
79
- get: function () { return chunkQ2MFGYTE_cjs.INSIGHT_TYPE_CONTRACTS; }
80
- });
81
- Object.defineProperty(exports, "INTENT_CHART_FAMILIES", {
82
- enumerable: true,
83
- get: function () { return chunkQ2MFGYTE_cjs.INTENT_CHART_FAMILIES; }
84
- });
85
- Object.defineProperty(exports, "MINIMUM_SAMPLE_SIZES", {
86
- enumerable: true,
87
- get: function () { return chunkQ2MFGYTE_cjs.MINIMUM_SAMPLE_SIZES; }
88
- });
89
- Object.defineProperty(exports, "ReportModeProvider", {
90
- enumerable: true,
91
- get: function () { return chunkQ2MFGYTE_cjs.ReportModeProvider; }
92
- });
93
- Object.defineProperty(exports, "calculateCompleteness", {
94
- enumerable: true,
95
- get: function () { return chunkQ2MFGYTE_cjs.calculateCompleteness; }
96
- });
97
- Object.defineProperty(exports, "calculateConfidence", {
98
- enumerable: true,
99
- get: function () { return chunkQ2MFGYTE_cjs.calculateConfidence; }
100
- });
101
- Object.defineProperty(exports, "calculateNormalizedVariance", {
102
- enumerable: true,
103
- get: function () { return chunkQ2MFGYTE_cjs.calculateNormalizedVariance; }
104
- });
105
- Object.defineProperty(exports, "calculateRecency", {
106
- enumerable: true,
107
- get: function () { return chunkQ2MFGYTE_cjs.calculateRecency; }
108
- });
109
- Object.defineProperty(exports, "canSwitchChart", {
110
- enumerable: true,
111
- get: function () { return chunkQ2MFGYTE_cjs.canSwitchChart; }
112
- });
113
- Object.defineProperty(exports, "getAllowedSwitchTargets", {
114
- enumerable: true,
115
- get: function () { return chunkQ2MFGYTE_cjs.getAllowedSwitchTargets; }
116
- });
117
- Object.defineProperty(exports, "getConfidenceLevel", {
118
- enumerable: true,
119
- get: function () { return chunkQ2MFGYTE_cjs.getConfidenceLevel; }
120
- });
121
- Object.defineProperty(exports, "getConfidenceThreshold", {
122
- enumerable: true,
123
- get: function () { return chunkQ2MFGYTE_cjs.getConfidenceThreshold; }
124
- });
125
- Object.defineProperty(exports, "getDefaultChartForIntent", {
126
- enumerable: true,
127
- get: function () { return chunkQ2MFGYTE_cjs.getDefaultChartForIntent; }
128
- });
129
- Object.defineProperty(exports, "getMVPChartsForIntent", {
130
- enumerable: true,
131
- get: function () { return chunkQ2MFGYTE_cjs.getMVPChartsForIntent; }
132
- });
133
- Object.defineProperty(exports, "suggestChartType", {
134
- enumerable: true,
135
- get: function () { return chunkQ2MFGYTE_cjs.suggestChartType; }
136
- });
137
- Object.defineProperty(exports, "useChartData", {
138
- enumerable: true,
139
- get: function () { return chunkQ2MFGYTE_cjs.useChartData; }
140
- });
141
- Object.defineProperty(exports, "useDataState", {
142
- enumerable: true,
143
- get: function () { return chunkQ2MFGYTE_cjs.useDataState; }
144
- });
145
- Object.defineProperty(exports, "useReportMode", {
146
- enumerable: true,
147
- get: function () { return chunkQ2MFGYTE_cjs.useReportMode; }
148
- });
149
- Object.defineProperty(exports, "validateChartData", {
150
- enumerable: true,
151
- get: function () { return chunkQ2MFGYTE_cjs.validateChartData; }
152
- });
153
- Object.defineProperty(exports, "validateReportStructure", {
154
- enumerable: true,
155
- get: function () { return chunkQ2MFGYTE_cjs.validateReportStructure; }
156
- });
157
- Object.defineProperty(exports, "Select", {
158
- enumerable: true,
159
- get: function () { return chunk3TGSIILM_cjs.Select; }
160
- });
161
- Object.defineProperty(exports, "SelectContent", {
162
- enumerable: true,
163
- get: function () { return chunk3TGSIILM_cjs.SelectContent; }
164
- });
165
- Object.defineProperty(exports, "SelectGroup", {
166
- enumerable: true,
167
- get: function () { return chunk3TGSIILM_cjs.SelectGroup; }
14
+ // src/report-engine/constants.ts
15
+ var EXECUTIVE_MODE = {
16
+ mode: "executive",
17
+ features: {
18
+ showMethodology: false,
19
+ showConfidenceScores: false,
20
+ showRawData: false,
21
+ showStatisticalTests: false,
22
+ chartDetailLevel: "summary",
23
+ maxInsightsShown: 5,
24
+ allowDrilldown: false
25
+ }
26
+ };
27
+ var ANALYST_MODE = {
28
+ mode: "analyst",
29
+ features: {
30
+ showMethodology: true,
31
+ showConfidenceScores: true,
32
+ showRawData: true,
33
+ showStatisticalTests: true,
34
+ chartDetailLevel: "detailed",
35
+ maxInsightsShown: 20,
36
+ allowDrilldown: true
37
+ }
38
+ };
39
+ var CONFIDENCE_THRESHOLDS = [
40
+ { level: "high", min: 90, max: 100, label: "High Confidence", color: "var(--status-success)" },
41
+ {
42
+ level: "moderate",
43
+ min: 70,
44
+ max: 89,
45
+ label: "Moderate Confidence",
46
+ color: "var(--status-info)"
47
+ },
48
+ { level: "low", min: 50, max: 69, label: "Low Confidence", color: "var(--status-warning)" },
49
+ {
50
+ level: "insufficient",
51
+ min: 0,
52
+ max: 49,
53
+ label: "Insufficient Data",
54
+ color: "var(--status-error)"
55
+ }
56
+ ];
57
+ var MINIMUM_SAMPLE_SIZES = {
58
+ overall: 30,
59
+ segment: 30,
60
+ mbtiType: 50,
61
+ correlation: 100,
62
+ timeSeries: 7
63
+ };
64
+ var INSIGHT_TYPE_CONTRACTS = {
65
+ "performance-delta": {
66
+ type: "performance-delta",
67
+ allowedCharts: ["BarChart", "LineChart", "KeyMetric"],
68
+ requiredFields: ["metric_name", "current_value", "previous_value", "time_period"],
69
+ minSampleSize: 30,
70
+ headlinePattern: "{metric} {direction} by {delta}% {timeframe}",
71
+ recommendationFormats: ["maintain-strategy", "investigate-decline", "scale-success"]
72
+ },
73
+ "behavioral-correlation": {
74
+ type: "behavioral-correlation",
75
+ allowedCharts: ["HeatmapChart", "BarChart"],
76
+ requiredFields: ["variable_a", "variable_b", "correlation_coefficient"],
77
+ minSampleSize: 100,
78
+ headlinePattern: "{variable_a} correlates with {variable_b}",
79
+ recommendationFormats: ["leverage-correlation", "investigate-causation"]
80
+ },
81
+ "funnel-leakage": {
82
+ type: "funnel-leakage",
83
+ allowedCharts: ["FunnelChart", "BarChart"],
84
+ requiredFields: ["stages", "stage_counts", "drop_rates"],
85
+ minSampleSize: 50,
86
+ headlinePattern: "{drop_rate}% drop-off at {stage}",
87
+ recommendationFormats: ["optimize-stage", "remove-friction"]
88
+ },
89
+ "audience-mismatch": {
90
+ type: "audience-mismatch",
91
+ allowedCharts: ["BarChart", "PieChart"],
92
+ requiredFields: ["target_audience", "actual_audience", "overlap_percentage"],
93
+ minSampleSize: 50,
94
+ headlinePattern: "Target audience differs by {mismatch}%",
95
+ recommendationFormats: ["refine-targeting", "expand-audience"]
96
+ },
97
+ "message-fatigue": {
98
+ type: "message-fatigue",
99
+ allowedCharts: ["LineChart", "BarChart"],
100
+ requiredFields: ["message_sequence", "engagement_rates", "fatigue_point"],
101
+ minSampleSize: 100,
102
+ headlinePattern: "Engagement drops {drop}% after message {n}",
103
+ recommendationFormats: ["reduce-frequency", "vary-content"]
104
+ },
105
+ "psychological-resonance": {
106
+ type: "psychological-resonance",
107
+ allowedCharts: ["MBTIRadar", "MBTITypeGrid", "BarChart"],
108
+ requiredFields: ["mbti_types", "response_rates", "message_type"],
109
+ minSampleSize: 50,
110
+ headlinePattern: "{mbti_type} responds {rate}% better to {message_type}",
111
+ recommendationFormats: ["personalize-messaging", "segment-by-type"]
112
+ },
113
+ "timing-pattern": {
114
+ type: "timing-pattern",
115
+ allowedCharts: ["HeatmapChart", "LineChart"],
116
+ requiredFields: ["time_slots", "engagement_rates"],
117
+ minSampleSize: 100,
118
+ headlinePattern: "Best engagement on {day} at {time}",
119
+ recommendationFormats: ["optimize-timing", "schedule-sends"]
120
+ },
121
+ "segment-outperformance": {
122
+ type: "segment-outperformance",
123
+ allowedCharts: ["BarChart", "KeyMetric"],
124
+ requiredFields: ["segments", "performance_metrics", "baseline"],
125
+ minSampleSize: 30,
126
+ headlinePattern: "{segment} outperforms by {delta}%",
127
+ recommendationFormats: ["double-down", "investigate-success"]
128
+ },
129
+ "anomaly-detection": {
130
+ type: "anomaly-detection",
131
+ allowedCharts: ["LineChart", "BarChart"],
132
+ requiredFields: ["metric", "expected_value", "actual_value", "deviation"],
133
+ minSampleSize: 30,
134
+ headlinePattern: "Unusual {direction} in {metric}",
135
+ recommendationFormats: ["investigate", "monitor"]
136
+ },
137
+ "competitive-benchmark": {
138
+ type: "competitive-benchmark",
139
+ allowedCharts: ["BarChart", "KeyMetric"],
140
+ requiredFields: ["metric", "our_value", "benchmark_value"],
141
+ minSampleSize: 30,
142
+ headlinePattern: "{position} industry benchmark by {delta}%",
143
+ recommendationFormats: ["maintain-lead", "close-gap"]
144
+ }
145
+ };
146
+ var ANALYTICAL_STATE_CONFIG = {
147
+ VALID: {
148
+ label: "Valid",
149
+ icon: "check",
150
+ color: "var(--status-success)",
151
+ action: null
152
+ },
153
+ INSUFFICIENT_SAMPLE: {
154
+ label: "Insufficient Sample",
155
+ icon: "alert-triangle",
156
+ color: "var(--status-warning)",
157
+ action: "Add more data"
158
+ },
159
+ LOW_CONFIDENCE: {
160
+ label: "Low Confidence",
161
+ icon: "alert-circle",
162
+ color: "var(--status-warning)",
163
+ action: "Interpret with caution"
164
+ },
165
+ PARTIAL_TIME_WINDOW: {
166
+ label: "Partial Data",
167
+ icon: "clock",
168
+ color: "var(--status-info)",
169
+ action: "Expand date range"
170
+ },
171
+ DATA_SKEW_DETECTED: {
172
+ label: "Data Skew",
173
+ icon: "bar-chart-2",
174
+ color: "var(--status-warning)",
175
+ action: "Review methodology"
176
+ },
177
+ CONFLICTING_SIGNALS: {
178
+ label: "Conflicting Signals",
179
+ icon: "git-merge",
180
+ color: "var(--status-error)",
181
+ action: "Manual review needed"
182
+ },
183
+ INFERRED_NOT_OBSERVED: {
184
+ label: "AI Generated",
185
+ icon: "cpu",
186
+ color: "var(--status-info)",
187
+ action: "Verify with data"
188
+ },
189
+ STALE_DATA: {
190
+ label: "Stale Data",
191
+ icon: "clock",
192
+ color: "var(--status-warning)",
193
+ action: "Refresh data"
194
+ },
195
+ FIELD_MISSING: {
196
+ label: "Missing Field",
197
+ icon: "file-x",
198
+ color: "var(--status-error)",
199
+ action: "Upload complete data"
200
+ },
201
+ CALCULATION_ERROR: {
202
+ label: "Calculation Error",
203
+ icon: "x-circle",
204
+ color: "var(--status-error)",
205
+ action: "Contact support"
206
+ }
207
+ };
208
+
209
+ // src/report-engine/confidence.ts
210
+ function calculateConfidence(params) {
211
+ const { sampleSize, requiredSize, completeness, recency, variance, aiInference } = params;
212
+ const sampleScore = Math.min(40, sampleSize / requiredSize * 40);
213
+ const completenessScore = completeness * 20;
214
+ const recencyScore = recency * 20;
215
+ const variancePenalty = variance * 10;
216
+ const aiPenalty = aiInference ? 10 : 0;
217
+ const rawScore = sampleScore + completenessScore + recencyScore - variancePenalty - aiPenalty;
218
+ return Math.max(0, Math.min(100, Math.round(rawScore)));
219
+ }
220
+ function getConfidenceLevel(score) {
221
+ const threshold = CONFIDENCE_THRESHOLDS.find((t) => score >= t.min && score <= t.max);
222
+ return threshold?.level ?? "insufficient";
223
+ }
224
+ function getConfidenceThreshold(score) {
225
+ return CONFIDENCE_THRESHOLDS.find((t) => score >= t.min && score <= t.max) ?? CONFIDENCE_THRESHOLDS[CONFIDENCE_THRESHOLDS.length - 1];
226
+ }
227
+ function calculateRecency(dataDate, maxAgeDays = 30) {
228
+ const now = /* @__PURE__ */ new Date();
229
+ const ageInDays = (now.getTime() - dataDate.getTime()) / (1e3 * 60 * 60 * 24);
230
+ if (ageInDays <= 0) return 1;
231
+ if (ageInDays >= maxAgeDays) return 0;
232
+ return 1 - ageInDays / maxAgeDays;
233
+ }
234
+ function calculateCompleteness(data, requiredFields) {
235
+ if (data.length === 0 || requiredFields.length === 0) return 0;
236
+ let totalFields = 0;
237
+ let filledFields = 0;
238
+ for (const record of data) {
239
+ for (const field of requiredFields) {
240
+ totalFields++;
241
+ const value = record[field];
242
+ if (value !== null && value !== void 0 && value !== "") {
243
+ filledFields++;
244
+ }
245
+ }
246
+ }
247
+ return totalFields > 0 ? filledFields / totalFields : 0;
248
+ }
249
+ function calculateNormalizedVariance(values) {
250
+ if (values.length < 2) return 0;
251
+ const mean = values.reduce((a, b) => a + b, 0) / values.length;
252
+ const squaredDiffs = values.map((v) => Math.pow(v - mean, 2));
253
+ const variance = squaredDiffs.reduce((a, b) => a + b, 0) / values.length;
254
+ const stdDev = Math.sqrt(variance);
255
+ const cv = mean !== 0 ? stdDev / Math.abs(mean) : 0;
256
+ return Math.min(1, cv);
257
+ }
258
+ var ReportModeContext = React2.createContext(null);
259
+ function ReportModeProvider({
260
+ mode = "executive",
261
+ children,
262
+ onModeChange
263
+ }) {
264
+ const config = mode === "executive" ? EXECUTIVE_MODE : ANALYST_MODE;
265
+ const value = React2.useMemo(
266
+ () => ({
267
+ ...config,
268
+ setMode: onModeChange
269
+ }),
270
+ [config, onModeChange]
271
+ );
272
+ return /* @__PURE__ */ jsxRuntime.jsx(ReportModeContext.Provider, { value, children });
273
+ }
274
+ function useReportMode() {
275
+ const context = React2.useContext(ReportModeContext);
276
+ if (!context) {
277
+ return EXECUTIVE_MODE;
278
+ }
279
+ return context;
280
+ }
281
+ function useDataState(params) {
282
+ const {
283
+ sampleSize,
284
+ requiredSize = MINIMUM_SAMPLE_SIZES.overall,
285
+ completeness = 1,
286
+ recency = 1,
287
+ variance = 0,
288
+ aiInferred = false,
289
+ missingFields = [],
290
+ staleDays
291
+ } = params;
292
+ return React2.useMemo(() => {
293
+ const confidenceParams = {
294
+ sampleSize,
295
+ requiredSize,
296
+ completeness,
297
+ recency,
298
+ variance,
299
+ aiInference: aiInferred
300
+ };
301
+ const confidence = calculateConfidence(confidenceParams);
302
+ const confidenceLevel = getConfidenceLevel(confidence);
303
+ let state = "VALID";
304
+ if (missingFields.length > 0) {
305
+ state = "FIELD_MISSING";
306
+ } else if (sampleSize < requiredSize) {
307
+ state = "INSUFFICIENT_SAMPLE";
308
+ } else if (staleDays && staleDays > 30) {
309
+ state = "STALE_DATA";
310
+ } else if (aiInferred) {
311
+ state = "INFERRED_NOT_OBSERVED";
312
+ } else if (confidence < 50) {
313
+ state = "LOW_CONFIDENCE";
314
+ } else if (variance > 0.7) {
315
+ state = "DATA_SKEW_DETECTED";
316
+ } else if (recency < 0.3) {
317
+ state = "PARTIAL_TIME_WINDOW";
318
+ }
319
+ const details = {
320
+ sampleSize,
321
+ requiredSize,
322
+ confidence,
323
+ missingFields: missingFields.length > 0 ? missingFields : void 0,
324
+ staleDays
325
+ };
326
+ return {
327
+ state,
328
+ confidence,
329
+ confidenceLevel,
330
+ details,
331
+ isValid: state === "VALID"
332
+ };
333
+ }, [
334
+ sampleSize,
335
+ requiredSize,
336
+ completeness,
337
+ recency,
338
+ variance,
339
+ aiInferred,
340
+ missingFields,
341
+ staleDays
342
+ ]);
343
+ }
344
+ function useChartData({
345
+ data,
346
+ requiredFields,
347
+ minSampleSize = MINIMUM_SAMPLE_SIZES.overall
348
+ }) {
349
+ return React2.useMemo(() => {
350
+ const missingFields = [];
351
+ if (data.length > 0) {
352
+ const firstRecord = data[0];
353
+ for (const field of requiredFields) {
354
+ if (!(field in firstRecord)) {
355
+ missingFields.push(field);
356
+ }
357
+ }
358
+ }
359
+ let completeness = 1;
360
+ if (data.length > 0 && requiredFields.length > 0) {
361
+ let filled = 0;
362
+ let total = 0;
363
+ for (const record of data) {
364
+ for (const field of requiredFields) {
365
+ total++;
366
+ const value = record[field];
367
+ if (value !== null && value !== void 0 && value !== "") {
368
+ filled++;
369
+ }
370
+ }
371
+ }
372
+ completeness = total > 0 ? filled / total : 0;
373
+ }
374
+ let state = "VALID";
375
+ let message;
376
+ if (missingFields.length > 0) {
377
+ state = "FIELD_MISSING";
378
+ message = `Missing fields: ${missingFields.join(", ")}`;
379
+ } else if (data.length === 0) {
380
+ state = "INSUFFICIENT_SAMPLE";
381
+ message = "No data available";
382
+ } else if (data.length < minSampleSize) {
383
+ state = "INSUFFICIENT_SAMPLE";
384
+ message = `Sample size ${data.length} is below minimum ${minSampleSize}`;
385
+ } else if (completeness < 0.7) {
386
+ state = "LOW_CONFIDENCE";
387
+ message = `Data completeness is ${Math.round(completeness * 100)}%`;
388
+ }
389
+ const confidence = calculateConfidence({
390
+ sampleSize: data.length,
391
+ requiredSize: minSampleSize,
392
+ completeness,
393
+ recency: 1,
394
+ // Assume fresh data if not specified
395
+ variance: 0,
396
+ aiInference: false
397
+ });
398
+ const isRenderable = state === "VALID" || state === "LOW_CONFIDENCE";
399
+ return {
400
+ data,
401
+ state,
402
+ confidence,
403
+ isRenderable,
404
+ message
405
+ };
406
+ }, [data, requiredFields, minSampleSize]);
407
+ }
408
+
409
+ // src/report-engine/chart-types.ts
410
+ var CHART_REGISTRY = {
411
+ // ══════════════════════════════════════════════════════════════════════════
412
+ // TREND CHARTS (MVP)
413
+ // ══════════════════════════════════════════════════════════════════════════
414
+ line: {
415
+ id: "line",
416
+ name: "Line Chart",
417
+ description: "Shows trends over time with connected data points",
418
+ intent: "trend",
419
+ phase: "mvp",
420
+ contract: {
421
+ requiredDimensions: 1,
422
+ requiredMeasures: 1,
423
+ minDataPoints: 3,
424
+ idealDataPoints: 7,
425
+ allowNegativeValues: true,
426
+ requireNonZeroTotal: false,
427
+ warningThresholds: { sparseData: 3 },
428
+ fallback: { type: "show_kpi", message: "Insufficient data for trend visualization" }
429
+ },
430
+ switchableTo: ["smooth_line", "area", "stacked_area"],
431
+ supportsStacking: false,
432
+ supportsMultipleSeries: true,
433
+ requiresTimeAxis: true
434
+ },
435
+ smooth_line: {
436
+ id: "smooth_line",
437
+ name: "Smooth Line Chart",
438
+ description: "Curved line chart for smoother trend visualization",
439
+ intent: "trend",
440
+ phase: "mvp",
441
+ contract: {
442
+ requiredDimensions: 1,
443
+ requiredMeasures: 1,
444
+ minDataPoints: 3,
445
+ idealDataPoints: 7,
446
+ allowNegativeValues: true,
447
+ requireNonZeroTotal: false,
448
+ warningThresholds: { sparseData: 3 },
449
+ fallback: { type: "show_kpi", message: "Insufficient data for trend visualization" }
450
+ },
451
+ switchableTo: ["line", "area", "stacked_area"],
452
+ supportsStacking: false,
453
+ supportsMultipleSeries: true,
454
+ requiresTimeAxis: true
455
+ },
456
+ area: {
457
+ id: "area",
458
+ name: "Area Chart",
459
+ description: "Filled area under line, emphasizes volume over time",
460
+ intent: "trend",
461
+ phase: "mvp",
462
+ contract: {
463
+ requiredDimensions: 1,
464
+ requiredMeasures: 1,
465
+ minDataPoints: 3,
466
+ idealDataPoints: 7,
467
+ allowNegativeValues: false,
468
+ requireNonZeroTotal: false,
469
+ warningThresholds: { sparseData: 3 },
470
+ fallback: { type: "show_kpi", message: "Insufficient data for area visualization" }
471
+ },
472
+ switchableTo: ["line", "smooth_line", "stacked_area", "area_100pct"],
473
+ supportsStacking: true,
474
+ supportsMultipleSeries: true,
475
+ requiresTimeAxis: true
476
+ },
477
+ stacked_area: {
478
+ id: "stacked_area",
479
+ name: "Stacked Area Chart",
480
+ description: "Multiple series stacked to show cumulative trends",
481
+ intent: "trend",
482
+ phase: "mvp",
483
+ contract: {
484
+ requiredDimensions: 1,
485
+ requiredMeasures: 2,
486
+ minDataPoints: 3,
487
+ idealDataPoints: 7,
488
+ allowNegativeValues: false,
489
+ requireNonZeroTotal: true,
490
+ warningThresholds: { sparseData: 3 },
491
+ fallback: { type: "warn", message: "Stacked area requires non-negative values" }
492
+ },
493
+ switchableTo: ["line", "area", "area_100pct"],
494
+ supportsStacking: true,
495
+ supportsMultipleSeries: true,
496
+ requiresTimeAxis: true
497
+ },
498
+ area_100pct: {
499
+ id: "area_100pct",
500
+ name: "100% Stacked Area",
501
+ description: "Shows proportional contribution over time",
502
+ intent: "trend",
503
+ phase: "mvp",
504
+ contract: {
505
+ requiredDimensions: 1,
506
+ requiredMeasures: 2,
507
+ minDataPoints: 3,
508
+ idealDataPoints: 7,
509
+ allowNegativeValues: false,
510
+ requireNonZeroTotal: true,
511
+ warningThresholds: { sparseData: 3 },
512
+ fallback: { type: "warn", message: "100% stacked requires positive totals" }
513
+ },
514
+ switchableTo: ["stacked_area", "area"],
515
+ supportsStacking: true,
516
+ supportsMultipleSeries: true,
517
+ requiresTimeAxis: true
518
+ },
519
+ // ══════════════════════════════════════════════════════════════════════════
520
+ // COMPARISON CHARTS (MVP)
521
+ // ══════════════════════════════════════════════════════════════════════════
522
+ bar: {
523
+ id: "bar",
524
+ name: "Horizontal Bar Chart",
525
+ description: "Horizontal bars for comparing categories",
526
+ intent: "comparison",
527
+ phase: "mvp",
528
+ contract: {
529
+ requiredDimensions: 1,
530
+ requiredMeasures: 1,
531
+ minDataPoints: 2,
532
+ idealDataPoints: 5,
533
+ maxDataPoints: 15,
534
+ allowNegativeValues: true,
535
+ requireNonZeroTotal: false,
536
+ warningThresholds: { tooManyCategories: 12 },
537
+ fallback: { type: "aggregate", strategy: "top_n" }
538
+ },
539
+ switchableTo: ["column", "stacked_bar", "stacked_column"],
540
+ supportsStacking: true,
541
+ supportsMultipleSeries: true,
542
+ requiresTimeAxis: false
543
+ },
544
+ column: {
545
+ id: "column",
546
+ name: "Vertical Column Chart",
547
+ description: "Vertical bars for comparing categories",
548
+ intent: "comparison",
549
+ phase: "mvp",
550
+ contract: {
551
+ requiredDimensions: 1,
552
+ requiredMeasures: 1,
553
+ minDataPoints: 2,
554
+ idealDataPoints: 5,
555
+ maxDataPoints: 12,
556
+ allowNegativeValues: true,
557
+ requireNonZeroTotal: false,
558
+ warningThresholds: { tooManyCategories: 10 },
559
+ fallback: { type: "aggregate", strategy: "top_n" }
560
+ },
561
+ switchableTo: ["bar", "stacked_column", "stacked_bar"],
562
+ supportsStacking: true,
563
+ supportsMultipleSeries: true,
564
+ requiresTimeAxis: false
565
+ },
566
+ stacked_bar: {
567
+ id: "stacked_bar",
568
+ name: "Stacked Horizontal Bar",
569
+ description: "Horizontal stacked bars showing composition per category",
570
+ intent: "comparison",
571
+ phase: "mvp",
572
+ contract: {
573
+ requiredDimensions: 1,
574
+ requiredMeasures: 2,
575
+ minDataPoints: 2,
576
+ idealDataPoints: 5,
577
+ maxDataPoints: 10,
578
+ allowNegativeValues: false,
579
+ requireNonZeroTotal: true,
580
+ warningThresholds: { tooManyCategories: 8, imbalancedRatio: 0.9 },
581
+ fallback: { type: "aggregate", strategy: "other_bucket" }
582
+ },
583
+ switchableTo: ["bar", "stacked_column", "column_100pct"],
584
+ supportsStacking: true,
585
+ supportsMultipleSeries: true,
586
+ requiresTimeAxis: false
587
+ },
588
+ stacked_column: {
589
+ id: "stacked_column",
590
+ name: "Stacked Vertical Column",
591
+ description: "Vertical stacked columns showing composition per category",
592
+ intent: "comparison",
593
+ phase: "mvp",
594
+ contract: {
595
+ requiredDimensions: 1,
596
+ requiredMeasures: 2,
597
+ minDataPoints: 2,
598
+ idealDataPoints: 5,
599
+ maxDataPoints: 10,
600
+ allowNegativeValues: false,
601
+ requireNonZeroTotal: true,
602
+ warningThresholds: { tooManyCategories: 8, imbalancedRatio: 0.9 },
603
+ fallback: { type: "aggregate", strategy: "other_bucket" }
604
+ },
605
+ switchableTo: ["column", "stacked_bar", "column_100pct"],
606
+ supportsStacking: true,
607
+ supportsMultipleSeries: true,
608
+ requiresTimeAxis: false
609
+ },
610
+ column_100pct: {
611
+ id: "column_100pct",
612
+ name: "100% Stacked Column",
613
+ description: "Shows proportional composition per category",
614
+ intent: "comparison",
615
+ phase: "mvp",
616
+ contract: {
617
+ requiredDimensions: 1,
618
+ requiredMeasures: 2,
619
+ minDataPoints: 2,
620
+ idealDataPoints: 5,
621
+ maxDataPoints: 10,
622
+ allowNegativeValues: false,
623
+ requireNonZeroTotal: true,
624
+ warningThresholds: { tooManyCategories: 8 },
625
+ fallback: { type: "warn", message: "100% stacked requires positive totals" }
626
+ },
627
+ switchableTo: ["stacked_column", "stacked_bar"],
628
+ supportsStacking: true,
629
+ supportsMultipleSeries: true,
630
+ requiresTimeAxis: false
631
+ },
632
+ combo: {
633
+ id: "combo",
634
+ name: "Combo Chart",
635
+ description: "Combines bars with line overlay (Phase 2)",
636
+ intent: "comparison",
637
+ phase: "phase2",
638
+ contract: {
639
+ requiredDimensions: 1,
640
+ requiredMeasures: 2,
641
+ minDataPoints: 3,
642
+ idealDataPoints: 6,
643
+ allowNegativeValues: true,
644
+ requireNonZeroTotal: false,
645
+ warningThresholds: { tooManyCategories: 10 },
646
+ fallback: { type: "warn", message: "Combo chart requires dual measures" }
647
+ },
648
+ switchableTo: ["column", "line"],
649
+ supportsStacking: false,
650
+ supportsMultipleSeries: true,
651
+ requiresTimeAxis: false
652
+ },
653
+ // ══════════════════════════════════════════════════════════════════════════
654
+ // COMPOSITION CHARTS (MVP)
655
+ // ══════════════════════════════════════════════════════════════════════════
656
+ pie: {
657
+ id: "pie",
658
+ name: "Pie Chart",
659
+ description: "Shows proportional composition of a whole",
660
+ intent: "composition",
661
+ phase: "mvp",
662
+ contract: {
663
+ requiredDimensions: 1,
664
+ requiredMeasures: 1,
665
+ minDataPoints: 2,
666
+ idealDataPoints: 4,
667
+ maxDataPoints: 6,
668
+ allowNegativeValues: false,
669
+ requireNonZeroTotal: true,
670
+ warningThresholds: { tooManyCategories: 6, imbalancedRatio: 0.95 },
671
+ fallback: { type: "aggregate", strategy: "other_bucket" }
672
+ },
673
+ switchableTo: ["donut", "column_100pct"],
674
+ supportsStacking: false,
675
+ supportsMultipleSeries: false,
676
+ requiresTimeAxis: false,
677
+ maxSlices: 6
678
+ },
679
+ donut: {
680
+ id: "donut",
681
+ name: "Donut Chart",
682
+ description: "Pie chart with center cutout, can display total",
683
+ intent: "composition",
684
+ phase: "mvp",
685
+ contract: {
686
+ requiredDimensions: 1,
687
+ requiredMeasures: 1,
688
+ minDataPoints: 2,
689
+ idealDataPoints: 4,
690
+ maxDataPoints: 6,
691
+ allowNegativeValues: false,
692
+ requireNonZeroTotal: true,
693
+ warningThresholds: { tooManyCategories: 6, imbalancedRatio: 0.95 },
694
+ fallback: { type: "aggregate", strategy: "other_bucket" }
695
+ },
696
+ switchableTo: ["pie", "column_100pct"],
697
+ supportsStacking: false,
698
+ supportsMultipleSeries: false,
699
+ requiresTimeAxis: false,
700
+ maxSlices: 6
701
+ },
702
+ treemap: {
703
+ id: "treemap",
704
+ name: "Treemap",
705
+ description: "Nested rectangles showing hierarchical composition (Phase 2)",
706
+ intent: "composition",
707
+ phase: "phase2",
708
+ contract: {
709
+ requiredDimensions: 1,
710
+ requiredMeasures: 1,
711
+ minDataPoints: 3,
712
+ idealDataPoints: 10,
713
+ maxDataPoints: 50,
714
+ allowNegativeValues: false,
715
+ requireNonZeroTotal: true,
716
+ warningThresholds: { tooManyCategories: 30 },
717
+ fallback: { type: "aggregate", strategy: "top_n" }
718
+ },
719
+ switchableTo: ["pie", "donut"],
720
+ supportsStacking: false,
721
+ supportsMultipleSeries: false,
722
+ requiresTimeAxis: false
723
+ },
724
+ // ══════════════════════════════════════════════════════════════════════════
725
+ // DISTRIBUTION CHARTS (MVP)
726
+ // ══════════════════════════════════════════════════════════════════════════
727
+ histogram: {
728
+ id: "histogram",
729
+ name: "Histogram",
730
+ description: "Shows distribution of values across bins",
731
+ intent: "distribution",
732
+ phase: "mvp",
733
+ contract: {
734
+ requiredDimensions: 0,
735
+ requiredMeasures: 1,
736
+ minDataPoints: 10,
737
+ idealDataPoints: 50,
738
+ allowNegativeValues: true,
739
+ requireNonZeroTotal: false,
740
+ warningThresholds: { sparseData: 10 },
741
+ fallback: { type: "show_kpi", message: "Insufficient data for distribution" }
742
+ },
743
+ switchableTo: ["radar"],
744
+ supportsStacking: false,
745
+ supportsMultipleSeries: false,
746
+ requiresTimeAxis: false
747
+ },
748
+ radar: {
749
+ id: "radar",
750
+ name: "Radar Chart",
751
+ description: "Multi-dimensional comparison in radial layout (Phase 2)",
752
+ intent: "distribution",
753
+ phase: "phase2",
754
+ contract: {
755
+ requiredDimensions: 1,
756
+ requiredMeasures: 3,
757
+ minDataPoints: 3,
758
+ idealDataPoints: 6,
759
+ maxDataPoints: 8,
760
+ allowNegativeValues: false,
761
+ requireNonZeroTotal: false,
762
+ warningThresholds: { tooManyCategories: 8 },
763
+ fallback: { type: "warn", message: "Radar works best with 3-8 dimensions" }
764
+ },
765
+ switchableTo: ["histogram"],
766
+ supportsStacking: false,
767
+ supportsMultipleSeries: true,
768
+ requiresTimeAxis: false
769
+ },
770
+ // ══════════════════════════════════════════════════════════════════════════
771
+ // RELATIONSHIP CHARTS
772
+ // ══════════════════════════════════════════════════════════════════════════
773
+ heatmap: {
774
+ id: "heatmap",
775
+ name: "Heatmap",
776
+ description: "Color-coded matrix showing intensity",
777
+ intent: "relationship",
778
+ phase: "mvp",
779
+ contract: {
780
+ requiredDimensions: 2,
781
+ requiredMeasures: 1,
782
+ minDataPoints: 9,
783
+ idealDataPoints: 25,
784
+ allowNegativeValues: true,
785
+ requireNonZeroTotal: false,
786
+ warningThresholds: { sparseData: 9 },
787
+ fallback: { type: "warn", message: "Heatmap requires grid data" }
788
+ },
789
+ switchableTo: ["scatter"],
790
+ supportsStacking: false,
791
+ supportsMultipleSeries: false,
792
+ requiresTimeAxis: false
793
+ },
794
+ scatter: {
795
+ id: "scatter",
796
+ name: "Scatter Plot",
797
+ description: "Shows correlation between two variables (Phase 2)",
798
+ intent: "relationship",
799
+ phase: "phase2",
800
+ contract: {
801
+ requiredDimensions: 0,
802
+ requiredMeasures: 2,
803
+ minDataPoints: 20,
804
+ idealDataPoints: 100,
805
+ allowNegativeValues: true,
806
+ requireNonZeroTotal: false,
807
+ warningThresholds: { sparseData: 20 },
808
+ fallback: { type: "show_kpi", message: "Scatter requires 20+ points" }
809
+ },
810
+ switchableTo: ["bubble", "heatmap"],
811
+ supportsStacking: false,
812
+ supportsMultipleSeries: true,
813
+ requiresTimeAxis: false
814
+ },
815
+ bubble: {
816
+ id: "bubble",
817
+ name: "Bubble Chart",
818
+ description: "Scatter with sized points for third dimension (Phase 2)",
819
+ intent: "relationship",
820
+ phase: "phase2",
821
+ contract: {
822
+ requiredDimensions: 0,
823
+ requiredMeasures: 3,
824
+ minDataPoints: 10,
825
+ idealDataPoints: 50,
826
+ allowNegativeValues: true,
827
+ requireNonZeroTotal: false,
828
+ warningThresholds: { sparseData: 10 },
829
+ fallback: { type: "show_kpi", message: "Bubble requires 3 measures" }
830
+ },
831
+ switchableTo: ["scatter"],
832
+ supportsStacking: false,
833
+ supportsMultipleSeries: true,
834
+ requiresTimeAxis: false
835
+ },
836
+ // ══════════════════════════════════════════════════════════════════════════
837
+ // GEOGRAPHIC CHARTS (Phase 2)
838
+ // ══════════════════════════════════════════════════════════════════════════
839
+ geo: {
840
+ id: "geo",
841
+ name: "Geographic Map",
842
+ description: "Map with regional data markers (Phase 2)",
843
+ intent: "geo",
844
+ phase: "phase2",
845
+ contract: {
846
+ requiredDimensions: 1,
847
+ // geo dimension (country/region)
848
+ requiredMeasures: 1,
849
+ minDataPoints: 1,
850
+ idealDataPoints: 10,
851
+ allowNegativeValues: true,
852
+ requireNonZeroTotal: false,
853
+ warningThresholds: {},
854
+ fallback: { type: "hide" }
855
+ },
856
+ switchableTo: ["choropleth"],
857
+ supportsStacking: false,
858
+ supportsMultipleSeries: false,
859
+ requiresTimeAxis: false
860
+ },
861
+ choropleth: {
862
+ id: "choropleth",
863
+ name: "Choropleth Map",
864
+ description: "Color-shaded regions by value (Phase 2)",
865
+ intent: "geo",
866
+ phase: "phase2",
867
+ contract: {
868
+ requiredDimensions: 1,
869
+ requiredMeasures: 1,
870
+ minDataPoints: 3,
871
+ idealDataPoints: 20,
872
+ allowNegativeValues: false,
873
+ requireNonZeroTotal: false,
874
+ warningThresholds: {},
875
+ fallback: { type: "hide" }
876
+ },
877
+ switchableTo: ["geo"],
878
+ supportsStacking: false,
879
+ supportsMultipleSeries: false,
880
+ requiresTimeAxis: false
881
+ },
882
+ // ══════════════════════════════════════════════════════════════════════════
883
+ // SPECIAL CHARTS
884
+ // ══════════════════════════════════════════════════════════════════════════
885
+ funnel: {
886
+ id: "funnel",
887
+ name: "Funnel Chart",
888
+ description: "Shows conversion through sequential stages",
889
+ intent: "comparison",
890
+ phase: "mvp",
891
+ contract: {
892
+ requiredDimensions: 1,
893
+ requiredMeasures: 1,
894
+ minDataPoints: 3,
895
+ idealDataPoints: 5,
896
+ maxDataPoints: 7,
897
+ allowNegativeValues: false,
898
+ requireNonZeroTotal: true,
899
+ warningThresholds: { tooManyCategories: 7 },
900
+ fallback: { type: "warn", message: "Funnel requires sequential stages" }
901
+ },
902
+ switchableTo: ["bar"],
903
+ supportsStacking: false,
904
+ supportsMultipleSeries: false,
905
+ requiresTimeAxis: false
906
+ },
907
+ waterfall: {
908
+ id: "waterfall",
909
+ name: "Waterfall Chart",
910
+ description: "Shows cumulative effect of sequential changes (Phase 2)",
911
+ intent: "comparison",
912
+ phase: "phase2",
913
+ contract: {
914
+ requiredDimensions: 1,
915
+ requiredMeasures: 1,
916
+ minDataPoints: 3,
917
+ idealDataPoints: 6,
918
+ maxDataPoints: 12,
919
+ allowNegativeValues: true,
920
+ requireNonZeroTotal: false,
921
+ warningThresholds: { tooManyCategories: 10 },
922
+ fallback: { type: "warn", message: "Waterfall requires sequential data" }
923
+ },
924
+ switchableTo: ["bar", "column"],
925
+ supportsStacking: false,
926
+ supportsMultipleSeries: false,
927
+ requiresTimeAxis: false
928
+ },
929
+ timeline: {
930
+ id: "timeline",
931
+ name: "Timeline",
932
+ description: "Shows events along time axis (Phase 2)",
933
+ intent: "trend",
934
+ phase: "phase2",
935
+ contract: {
936
+ requiredDimensions: 1,
937
+ requiredMeasures: 0,
938
+ minDataPoints: 2,
939
+ idealDataPoints: 10,
940
+ allowNegativeValues: false,
941
+ requireNonZeroTotal: false,
942
+ warningThresholds: {},
943
+ fallback: { type: "hide" }
944
+ },
945
+ switchableTo: ["line"],
946
+ supportsStacking: false,
947
+ supportsMultipleSeries: false,
948
+ requiresTimeAxis: true
949
+ }
950
+ };
951
+ var INTENT_CHART_FAMILIES = {
952
+ trend: ["line", "smooth_line", "area", "stacked_area", "area_100pct"],
953
+ comparison: ["bar", "column", "stacked_bar", "stacked_column", "column_100pct", "funnel"],
954
+ composition: ["pie", "donut"],
955
+ distribution: ["histogram"],
956
+ relationship: ["heatmap"],
957
+ geo: []
958
+ };
959
+ function getAllowedSwitchTargets(currentType) {
960
+ const metadata = CHART_REGISTRY[currentType];
961
+ if (!metadata) return [];
962
+ return metadata.switchableTo.filter((type) => {
963
+ const targetMeta = CHART_REGISTRY[type];
964
+ return targetMeta && targetMeta.phase === "mvp";
965
+ });
966
+ }
967
+ function canSwitchChart(from, to) {
968
+ const fromMeta = CHART_REGISTRY[from];
969
+ const toMeta = CHART_REGISTRY[to];
970
+ if (!fromMeta || !toMeta) return false;
971
+ if (fromMeta.intent !== toMeta.intent) return false;
972
+ return fromMeta.switchableTo.includes(to);
973
+ }
974
+ function validateChartData(chartType, data, dimensions, measures) {
975
+ const metadata = CHART_REGISTRY[chartType];
976
+ if (!metadata) {
977
+ return {
978
+ isValid: false,
979
+ warnings: [],
980
+ errors: [`Unknown chart type: ${chartType}`]
981
+ };
982
+ }
983
+ const contract = metadata.contract;
984
+ const warnings = [];
985
+ const errors = [];
986
+ if (data.length < contract.minDataPoints) {
987
+ errors.push(`Requires at least ${contract.minDataPoints} data points, got ${data.length}`);
988
+ }
989
+ if (contract.maxDataPoints && data.length > contract.maxDataPoints) {
990
+ warnings.push(`Chart works best with \u2264${contract.maxDataPoints} items. Consider aggregating.`);
991
+ }
992
+ if (dimensions.length < contract.requiredDimensions) {
993
+ errors.push(`Requires ${contract.requiredDimensions} dimension(s), got ${dimensions.length}`);
994
+ }
995
+ if (measures.length < contract.requiredMeasures) {
996
+ errors.push(`Requires ${contract.requiredMeasures} measure(s), got ${measures.length}`);
997
+ }
998
+ if (!contract.allowNegativeValues && data.length > 0) {
999
+ const hasNegative = data.some((row) => {
1000
+ if (typeof row !== "object" || row === null) return false;
1001
+ return measures.some((m) => {
1002
+ const val = row[m];
1003
+ return typeof val === "number" && val < 0;
1004
+ });
1005
+ });
1006
+ if (hasNegative) {
1007
+ errors.push("This chart type does not support negative values");
1008
+ }
1009
+ }
1010
+ if (contract.warningThresholds.tooManyCategories && data.length > contract.warningThresholds.tooManyCategories) {
1011
+ warnings.push(`Too many categories (${data.length}). Consider grouping smaller values.`);
1012
+ }
1013
+ return {
1014
+ isValid: errors.length === 0,
1015
+ warnings,
1016
+ errors,
1017
+ fallbackAction: errors.length > 0 ? contract.fallback : void 0
1018
+ };
1019
+ }
1020
+ function getMVPChartsForIntent(intent) {
1021
+ return Object.values(CHART_REGISTRY).filter(
1022
+ (meta) => meta.intent === intent && meta.phase === "mvp"
1023
+ );
1024
+ }
1025
+ function getDefaultChartForIntent(intent) {
1026
+ const defaults = {
1027
+ trend: "line",
1028
+ comparison: "column",
1029
+ composition: "donut",
1030
+ distribution: "histogram",
1031
+ relationship: "heatmap",
1032
+ geo: "geo"
1033
+ };
1034
+ return defaults[intent];
1035
+ }
1036
+ function suggestChartType(params) {
1037
+ const {
1038
+ hasTimeAxis,
1039
+ dimensionCount,
1040
+ measureCount,
1041
+ dataPointCount,
1042
+ hasNegativeValues,
1043
+ isSequential
1044
+ } = params;
1045
+ if (hasTimeAxis && measureCount >= 1) {
1046
+ if (measureCount > 1 && !hasNegativeValues) return "stacked_area";
1047
+ return "line";
1048
+ }
1049
+ if (isSequential && !hasNegativeValues && dataPointCount <= 7) {
1050
+ return "funnel";
1051
+ }
1052
+ if (measureCount === 1 && dataPointCount <= 6 && !hasNegativeValues) {
1053
+ return "donut";
1054
+ }
1055
+ if (dimensionCount === 2 && measureCount === 1) {
1056
+ return "heatmap";
1057
+ }
1058
+ return "column";
1059
+ }
1060
+ function validateReportStructure(children) {
1061
+ const issues = [];
1062
+ const childArray = React2__default.default.Children.toArray(children);
1063
+ let hasThesis = false;
1064
+ let thesisIndex = -1;
1065
+ const getComponentName2 = (child) => {
1066
+ if (!React2__default.default.isValidElement(child)) return void 0;
1067
+ const type = child.type;
1068
+ return type.displayName || type.name;
1069
+ };
1070
+ const isChart2 = (name) => {
1071
+ return name && (name.endsWith("Chart") || name === "MBTIRadar" || name === "MBTITypeGrid" || name === "KeyMetric");
1072
+ };
1073
+ childArray.forEach((child, index) => {
1074
+ const name = getComponentName2(child);
1075
+ if (name === "ExecutiveThesis") {
1076
+ if (hasThesis) {
1077
+ issues.push({
1078
+ ruleId: "R1",
1079
+ severity: "error",
1080
+ message: "Only one ExecutiveThesis is allowed per report.",
1081
+ component: "ExecutiveThesis"
1082
+ });
1083
+ }
1084
+ hasThesis = true;
1085
+ thesisIndex = index;
1086
+ }
1087
+ if (isChart2(name)) {
1088
+ issues.push({
1089
+ ruleId: "R3",
1090
+ severity: "error",
1091
+ message: `Orphan chart detected: <${name} />. Charts must be placed inside an InsightBlock or EvidenceGroup.`,
1092
+ component: name
1093
+ });
1094
+ }
1095
+ if (name === "InsightBlock" && React2__default.default.isValidElement(child)) {
1096
+ validateInsightBlock(child, issues);
1097
+ }
1098
+ });
1099
+ if (!hasThesis) {
1100
+ issues.push({
1101
+ ruleId: "R1",
1102
+ severity: "error",
1103
+ message: "Report must contain an ExecutiveThesis."
1104
+ });
1105
+ } else if (thesisIndex > 2) {
1106
+ issues.push({
1107
+ ruleId: "R1",
1108
+ severity: "warning",
1109
+ message: "ExecutiveThesis should be the first major component in the report."
1110
+ });
1111
+ }
1112
+ return {
1113
+ isValid: issues.filter((i) => i.severity === "error").length === 0,
1114
+ issues
1115
+ };
1116
+ }
1117
+ function validateInsightBlock(node, issues) {
1118
+ const children = node.props.children;
1119
+ const childArray = React2__default.default.Children.toArray(children);
1120
+ let chartsInBlock = 0;
1121
+ const countCharts = (nodes) => {
1122
+ nodes.forEach((n) => {
1123
+ const name = getComponentName(n);
1124
+ if (isChart(name)) {
1125
+ chartsInBlock++;
1126
+ }
1127
+ if (name === "EvidenceGroup" && React2__default.default.isValidElement(n)) {
1128
+ countCharts(React2__default.default.Children.toArray(n.props.children));
1129
+ }
1130
+ });
1131
+ };
1132
+ countCharts(childArray);
1133
+ if (chartsInBlock > 3) {
1134
+ issues.push({
1135
+ ruleId: "R6",
1136
+ severity: "warning",
1137
+ message: `InsightBlock contains ${chartsInBlock} charts. Recommended maximum is 3 to prevent data dumping.`,
1138
+ component: "InsightBlock"
1139
+ });
1140
+ }
1141
+ }
1142
+ var getComponentName = (child) => {
1143
+ if (!React2__default.default.isValidElement(child)) return void 0;
1144
+ const type = child.type;
1145
+ return type.displayName || type.name;
1146
+ };
1147
+ var isChart = (name) => {
1148
+ return name && (name.endsWith("Chart") || name === "MBTIRadar" || name === "MBTITypeGrid" || name === "KeyMetric");
1149
+ };
1150
+ var ReportShell = React2__default.default.forwardRef(
1151
+ ({
1152
+ title,
1153
+ subtitle,
1154
+ mode = "executive",
1155
+ brand,
1156
+ onModeChange,
1157
+ children,
1158
+ actions,
1159
+ className,
1160
+ ...props
1161
+ }, ref) => {
1162
+ return /* @__PURE__ */ jsxRuntime.jsx(ReportModeProvider, { mode, onModeChange, children: /* @__PURE__ */ jsxRuntime.jsxs(
1163
+ "div",
1164
+ {
1165
+ ref,
1166
+ className: clsx12__default.default("ds-report-shell", className),
1167
+ "data-mode": mode,
1168
+ "data-brand": brand,
1169
+ ...props,
1170
+ children: [
1171
+ (title || subtitle || actions) && /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "ds-report-shell__header", children: [
1172
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-report-shell__header-content", children: [
1173
+ title && /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "ds-report-shell__title", children: title }),
1174
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "ds-report-shell__subtitle", children: subtitle })
1175
+ ] }),
1176
+ actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-report-shell__actions", children: actions })
1177
+ ] }),
1178
+ /* @__PURE__ */ jsxRuntime.jsx("main", { className: "ds-report-shell__content", children })
1179
+ ]
1180
+ }
1181
+ ) });
1182
+ }
1183
+ );
1184
+ ReportShell.displayName = "ReportShell";
1185
+ var ExecutiveThesis = React2__default.default.forwardRef(
1186
+ ({ thesis, context, metric, aiGenerated, className, ...props }, ref) => {
1187
+ const { features } = useReportMode();
1188
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1189
+ "section",
1190
+ {
1191
+ ref,
1192
+ className: clsx12__default.default("ds-executive-thesis", className),
1193
+ "aria-labelledby": "executive-thesis-title",
1194
+ ...props,
1195
+ children: [
1196
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-executive-thesis__content", children: [
1197
+ /* @__PURE__ */ jsxRuntime.jsxs("h2", { id: "executive-thesis-title", className: "ds-executive-thesis__title", children: [
1198
+ "Key Finding",
1199
+ aiGenerated && features.showConfidenceScores && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-executive-thesis__ai-badge", children: "AI Generated" })
1200
+ ] }),
1201
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "ds-executive-thesis__thesis", children: thesis }),
1202
+ context && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "ds-executive-thesis__context", children: context })
1203
+ ] }),
1204
+ metric && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-executive-thesis__metric", children: [
1205
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-executive-thesis__metric-label", children: metric.label }),
1206
+ /* @__PURE__ */ jsxRuntime.jsxs(
1207
+ "span",
1208
+ {
1209
+ className: clsx12__default.default(
1210
+ "ds-executive-thesis__metric-value",
1211
+ metric.trend && `ds-executive-thesis__metric-value--${metric.trend}`
1212
+ ),
1213
+ children: [
1214
+ metric.trend === "up" && "\u2191 ",
1215
+ metric.trend === "down" && "\u2193 ",
1216
+ metric.value
1217
+ ]
1218
+ }
1219
+ )
1220
+ ] })
1221
+ ]
1222
+ }
1223
+ );
1224
+ }
1225
+ );
1226
+ ExecutiveThesis.displayName = "ExecutiveThesis";
1227
+ var InsightBlock = React2__default.default.forwardRef(
1228
+ ({ type, headline, description, confidence, methodology, children, className, ...props }, ref) => {
1229
+ const { features } = useReportMode();
1230
+ const contract = INSIGHT_TYPE_CONTRACTS[type];
1231
+ const getConfidenceClass = () => {
1232
+ if (confidence === void 0) return "";
1233
+ if (confidence >= 90) return "ds-insight-block--confidence-high";
1234
+ if (confidence >= 70) return "ds-insight-block--confidence-moderate";
1235
+ if (confidence >= 50) return "ds-insight-block--confidence-low";
1236
+ return "ds-insight-block--confidence-insufficient";
1237
+ };
1238
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1239
+ "section",
1240
+ {
1241
+ ref,
1242
+ className: clsx12__default.default("ds-insight-block", getConfidenceClass(), className),
1243
+ "data-insight-type": type,
1244
+ "aria-labelledby": `insight-${type}-title`,
1245
+ ...props,
1246
+ children: [
1247
+ /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "ds-insight-block__header", children: [
1248
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-insight-block__meta", children: [
1249
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-insight-block__type", children: type.replace(/-/g, " ") }),
1250
+ features.showConfidenceScores && confidence !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ds-insight-block__confidence", children: [
1251
+ confidence,
1252
+ "% confidence"
1253
+ ] })
1254
+ ] }),
1255
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { id: `insight-${type}-title`, className: "ds-insight-block__headline", children: headline }),
1256
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "ds-insight-block__description", children: description })
1257
+ ] }),
1258
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-insight-block__evidence", children }),
1259
+ features.showMethodology && methodology && /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: "ds-insight-block__methodology", children: [
1260
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "ds-insight-block__methodology-title", children: "Methodology" }),
1261
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "ds-insight-block__methodology-text", children: methodology }),
1262
+ contract && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "ds-insight-block__methodology-contract", children: [
1263
+ "Min sample: ",
1264
+ contract.minSampleSize,
1265
+ " | Allowed charts:",
1266
+ " ",
1267
+ contract.allowedCharts.join(", ")
1268
+ ] })
1269
+ ] })
1270
+ ]
1271
+ }
1272
+ );
1273
+ }
1274
+ );
1275
+ InsightBlock.displayName = "InsightBlock";
1276
+ var EvidenceGroup = React2__default.default.forwardRef(
1277
+ ({ title, layout = "row", columns = 2, children, className, ...props }, ref) => {
1278
+ const childCount = React2__default.default.Children.count(children);
1279
+ if (childCount > 3) {
1280
+ console.warn(
1281
+ `EvidenceGroup: Maximum 3 charts allowed per insight block (received ${childCount}). This violates composition rule R6.`
1282
+ );
1283
+ }
1284
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1285
+ "div",
1286
+ {
1287
+ ref,
1288
+ className: clsx12__default.default(
1289
+ "ds-evidence-group",
1290
+ `ds-evidence-group--${layout}`,
1291
+ layout === "grid" && `ds-evidence-group--cols-${columns}`,
1292
+ className
1293
+ ),
1294
+ role: "group",
1295
+ "aria-label": title || "Evidence charts",
1296
+ ...props,
1297
+ children: [
1298
+ title && /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "ds-evidence-group__title", children: title }),
1299
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-evidence-group__content", children })
1300
+ ]
1301
+ }
1302
+ );
1303
+ }
1304
+ );
1305
+ EvidenceGroup.displayName = "EvidenceGroup";
1306
+ var ConfidenceIndicator = React2__default.default.forwardRef(
1307
+ ({ score, showScore = true, showLabel = true, size = "md", className, ...props }, ref) => {
1308
+ const threshold = getConfidenceThreshold(score);
1309
+ const normalizedScore = Math.max(0, Math.min(100, score));
1310
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1311
+ "div",
1312
+ {
1313
+ ref,
1314
+ className: clsx12__default.default(
1315
+ "ds-confidence-indicator",
1316
+ `ds-confidence-indicator--${size}`,
1317
+ `ds-confidence-indicator--${threshold.level}`,
1318
+ className
1319
+ ),
1320
+ role: "meter",
1321
+ "aria-valuenow": normalizedScore,
1322
+ "aria-valuemin": 0,
1323
+ "aria-valuemax": 100,
1324
+ "aria-label": `Confidence: ${threshold.label} (${normalizedScore}%)`,
1325
+ ...props,
1326
+ children: [
1327
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-confidence-indicator__bar", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-confidence-indicator__fill", style: { width: `${normalizedScore}%` } }) }),
1328
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-confidence-indicator__text", children: [
1329
+ showScore && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ds-confidence-indicator__score", children: [
1330
+ normalizedScore,
1331
+ "%"
1332
+ ] }),
1333
+ showLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-confidence-indicator__label", children: threshold.label })
1334
+ ] })
1335
+ ]
1336
+ }
1337
+ );
1338
+ }
1339
+ );
1340
+ ConfidenceIndicator.displayName = "ConfidenceIndicator";
1341
+ var DataCoverageBadge = React2__default.default.forwardRef(
1342
+ ({ sampleSize, requiredSize, dateRange, showDateRange = true, size = "md", className, ...props }, ref) => {
1343
+ const isSufficient = !requiredSize || sampleSize >= requiredSize;
1344
+ const percentage = requiredSize ? Math.min(100, Math.round(sampleSize / requiredSize * 100)) : 100;
1345
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1346
+ "div",
1347
+ {
1348
+ ref,
1349
+ className: clsx12__default.default(
1350
+ "ds-data-coverage-badge",
1351
+ `ds-data-coverage-badge--${size}`,
1352
+ !isSufficient && "ds-data-coverage-badge--insufficient",
1353
+ className
1354
+ ),
1355
+ ...props,
1356
+ children: [
1357
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-data-coverage-badge__sample", children: [
1358
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-data-coverage-badge__icon", children: /* @__PURE__ */ jsxRuntime.jsxs(
1359
+ "svg",
1360
+ {
1361
+ width: "14",
1362
+ height: "14",
1363
+ viewBox: "0 0 24 24",
1364
+ fill: "none",
1365
+ stroke: "currentColor",
1366
+ strokeWidth: "2",
1367
+ children: [
1368
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" }),
1369
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "9", cy: "7", r: "4" }),
1370
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M23 21v-2a4 4 0 0 0-3-3.87" }),
1371
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })
1372
+ ]
1373
+ }
1374
+ ) }),
1375
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ds-data-coverage-badge__count", children: [
1376
+ "n=",
1377
+ sampleSize.toLocaleString()
1378
+ ] }),
1379
+ requiredSize && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ds-data-coverage-badge__required", children: [
1380
+ "(",
1381
+ percentage,
1382
+ "% of min ",
1383
+ requiredSize,
1384
+ ")"
1385
+ ] })
1386
+ ] }),
1387
+ showDateRange && dateRange && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-data-coverage-badge__date", children: [
1388
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-data-coverage-badge__icon", children: /* @__PURE__ */ jsxRuntime.jsxs(
1389
+ "svg",
1390
+ {
1391
+ width: "14",
1392
+ height: "14",
1393
+ viewBox: "0 0 24 24",
1394
+ fill: "none",
1395
+ stroke: "currentColor",
1396
+ strokeWidth: "2",
1397
+ children: [
1398
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
1399
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
1400
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
1401
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
1402
+ ]
1403
+ }
1404
+ ) }),
1405
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
1406
+ dateRange.start,
1407
+ " \u2013 ",
1408
+ dateRange.end
1409
+ ] })
1410
+ ] })
1411
+ ]
1412
+ }
1413
+ );
1414
+ }
1415
+ );
1416
+ DataCoverageBadge.displayName = "DataCoverageBadge";
1417
+ var DataStateIndicator = React2__default.default.forwardRef(
1418
+ ({ state, details, variant = "compact", onAction, className, ...props }, ref) => {
1419
+ const config = ANALYTICAL_STATE_CONFIG[state];
1420
+ if (state === "VALID" && variant === "compact") {
1421
+ return null;
1422
+ }
1423
+ const renderIcon = () => {
1424
+ switch (config.icon) {
1425
+ case "check":
1426
+ return /* @__PURE__ */ jsxRuntime.jsx(
1427
+ "svg",
1428
+ {
1429
+ width: "16",
1430
+ height: "16",
1431
+ viewBox: "0 0 24 24",
1432
+ fill: "none",
1433
+ stroke: "currentColor",
1434
+ strokeWidth: "2",
1435
+ children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "20,6 9,17 4,12" })
1436
+ }
1437
+ );
1438
+ case "alert-triangle":
1439
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1440
+ "svg",
1441
+ {
1442
+ width: "16",
1443
+ height: "16",
1444
+ viewBox: "0 0 24 24",
1445
+ fill: "none",
1446
+ stroke: "currentColor",
1447
+ strokeWidth: "2",
1448
+ children: [
1449
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
1450
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
1451
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
1452
+ ]
1453
+ }
1454
+ );
1455
+ case "alert-circle":
1456
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1457
+ "svg",
1458
+ {
1459
+ width: "16",
1460
+ height: "16",
1461
+ viewBox: "0 0 24 24",
1462
+ fill: "none",
1463
+ stroke: "currentColor",
1464
+ strokeWidth: "2",
1465
+ children: [
1466
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
1467
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
1468
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
1469
+ ]
1470
+ }
1471
+ );
1472
+ case "x-circle":
1473
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1474
+ "svg",
1475
+ {
1476
+ width: "16",
1477
+ height: "16",
1478
+ viewBox: "0 0 24 24",
1479
+ fill: "none",
1480
+ stroke: "currentColor",
1481
+ strokeWidth: "2",
1482
+ children: [
1483
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
1484
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
1485
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
1486
+ ]
1487
+ }
1488
+ );
1489
+ case "cpu":
1490
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1491
+ "svg",
1492
+ {
1493
+ width: "16",
1494
+ height: "16",
1495
+ viewBox: "0 0 24 24",
1496
+ fill: "none",
1497
+ stroke: "currentColor",
1498
+ strokeWidth: "2",
1499
+ children: [
1500
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "4", y: "4", width: "16", height: "16", rx: "2", ry: "2" }),
1501
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "9", y: "9", width: "6", height: "6" }),
1502
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "9", y1: "1", x2: "9", y2: "4" }),
1503
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "15", y1: "1", x2: "15", y2: "4" }),
1504
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "9", y1: "20", x2: "9", y2: "23" }),
1505
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "15", y1: "20", x2: "15", y2: "23" }),
1506
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "20", y1: "9", x2: "23", y2: "9" }),
1507
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "20", y1: "14", x2: "23", y2: "14" }),
1508
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "1", y1: "9", x2: "4", y2: "9" }),
1509
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "1", y1: "14", x2: "4", y2: "14" })
1510
+ ]
1511
+ }
1512
+ );
1513
+ default:
1514
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1515
+ "svg",
1516
+ {
1517
+ width: "16",
1518
+ height: "16",
1519
+ viewBox: "0 0 24 24",
1520
+ fill: "none",
1521
+ stroke: "currentColor",
1522
+ strokeWidth: "2",
1523
+ children: [
1524
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
1525
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
1526
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
1527
+ ]
1528
+ }
1529
+ );
1530
+ }
1531
+ };
1532
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1533
+ "div",
1534
+ {
1535
+ ref,
1536
+ className: clsx12__default.default(
1537
+ "ds-data-state-indicator",
1538
+ `ds-data-state-indicator--${variant}`,
1539
+ `ds-data-state-indicator--${state.toLowerCase().replace(/_/g, "-")}`,
1540
+ className
1541
+ ),
1542
+ role: "status",
1543
+ "aria-live": "polite",
1544
+ ...props,
1545
+ children: [
1546
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-data-state-indicator__icon", style: { color: config.color }, children: renderIcon() }),
1547
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-data-state-indicator__content", children: [
1548
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-data-state-indicator__label", children: config.label }),
1549
+ variant === "full" && details && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ds-data-state-indicator__details", children: [
1550
+ details.message,
1551
+ details.sampleSize !== void 0 && details.requiredSize !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1552
+ " ",
1553
+ "(n=",
1554
+ details.sampleSize,
1555
+ "/",
1556
+ details.requiredSize,
1557
+ ")"
1558
+ ] }),
1559
+ details.confidence !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1560
+ " \u2022 ",
1561
+ details.confidence,
1562
+ "% confidence"
1563
+ ] }),
1564
+ details.missingFields && details.missingFields.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1565
+ " \u2022 Missing: ",
1566
+ details.missingFields.join(", ")
1567
+ ] })
1568
+ ] })
1569
+ ] }),
1570
+ config.action && onAction && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "ds-data-state-indicator__action", onClick: onAction, children: config.action })
1571
+ ]
1572
+ }
1573
+ );
1574
+ }
1575
+ );
1576
+ DataStateIndicator.displayName = "DataStateIndicator";
1577
+ var MethodologyNote = React2__default.default.forwardRef(
1578
+ ({ children, sampleSize, sources, calculation, forceShow = false, className, labels, ...props }, ref) => {
1579
+ const titleText = labels?.title ?? "Methodology";
1580
+ const sampleSizeLabel = labels?.sampleSize ?? "Sample Size";
1581
+ const dataSourcesLabel = labels?.dataSources ?? "Data Sources";
1582
+ const calculationLabel = labels?.calculation ?? "Calculation";
1583
+ const { features } = useReportMode();
1584
+ const shouldShow = forceShow || features.showMethodology || sampleSize !== void 0 && sampleSize < 100;
1585
+ if (!shouldShow) {
1586
+ return null;
1587
+ }
1588
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1589
+ "aside",
1590
+ {
1591
+ ref,
1592
+ className: clsx12__default.default("ds-methodology-note", className),
1593
+ "aria-label": titleText,
1594
+ ...props,
1595
+ children: [
1596
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-methodology-note__header", children: [
1597
+ /* @__PURE__ */ jsxRuntime.jsxs(
1598
+ "svg",
1599
+ {
1600
+ className: "ds-methodology-note__icon",
1601
+ width: "16",
1602
+ height: "16",
1603
+ viewBox: "0 0 24 24",
1604
+ fill: "none",
1605
+ stroke: "currentColor",
1606
+ strokeWidth: "2",
1607
+ children: [
1608
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
1609
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
1610
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
1611
+ ]
1612
+ }
1613
+ ),
1614
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-methodology-note__title", children: titleText })
1615
+ ] }),
1616
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-methodology-note__content", children }),
1617
+ (sources || calculation || sampleSize !== void 0) && /* @__PURE__ */ jsxRuntime.jsxs("dl", { className: "ds-methodology-note__details", children: [
1618
+ sampleSize !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1619
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { children: sampleSizeLabel }),
1620
+ /* @__PURE__ */ jsxRuntime.jsxs("dd", { children: [
1621
+ "n=",
1622
+ sampleSize.toLocaleString()
1623
+ ] })
1624
+ ] }),
1625
+ sources && sources.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1626
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { children: dataSourcesLabel }),
1627
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { children: sources.join(", ") })
1628
+ ] }),
1629
+ calculation && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1630
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { children: calculationLabel }),
1631
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { children: calculation })
1632
+ ] })
1633
+ ] })
1634
+ ]
1635
+ }
1636
+ );
1637
+ }
1638
+ );
1639
+ MethodologyNote.displayName = "MethodologyNote";
1640
+ var CaveatBlock = React2__default.default.forwardRef(
1641
+ ({
1642
+ title = "Important Caveat",
1643
+ children,
1644
+ severity = "warning",
1645
+ confidence,
1646
+ forceShow = false,
1647
+ className,
1648
+ ...props
1649
+ }, ref) => {
1650
+ const { features } = useReportMode();
1651
+ const shouldShow = forceShow || features.showMethodology || confidence !== void 0 && confidence < 70;
1652
+ if (!shouldShow) {
1653
+ return null;
1654
+ }
1655
+ const renderIcon = () => {
1656
+ if (severity === "critical") {
1657
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1658
+ "svg",
1659
+ {
1660
+ width: "18",
1661
+ height: "18",
1662
+ viewBox: "0 0 24 24",
1663
+ fill: "none",
1664
+ stroke: "currentColor",
1665
+ strokeWidth: "2",
1666
+ children: [
1667
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
1668
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
1669
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
1670
+ ]
1671
+ }
1672
+ );
1673
+ }
1674
+ if (severity === "info") {
1675
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1676
+ "svg",
1677
+ {
1678
+ width: "18",
1679
+ height: "18",
1680
+ viewBox: "0 0 24 24",
1681
+ fill: "none",
1682
+ stroke: "currentColor",
1683
+ strokeWidth: "2",
1684
+ children: [
1685
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
1686
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
1687
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
1688
+ ]
1689
+ }
1690
+ );
1691
+ }
1692
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1693
+ "svg",
1694
+ {
1695
+ width: "18",
1696
+ height: "18",
1697
+ viewBox: "0 0 24 24",
1698
+ fill: "none",
1699
+ stroke: "currentColor",
1700
+ strokeWidth: "2",
1701
+ children: [
1702
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
1703
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
1704
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
1705
+ ]
1706
+ }
1707
+ );
1708
+ };
1709
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1710
+ "aside",
1711
+ {
1712
+ ref,
1713
+ className: clsx12__default.default("ds-caveat-block", `ds-caveat-block--${severity}`, className),
1714
+ role: "note",
1715
+ "aria-label": title,
1716
+ ...props,
1717
+ children: [
1718
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-caveat-block__header", children: [
1719
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-caveat-block__icon", children: renderIcon() }),
1720
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-caveat-block__title", children: title }),
1721
+ confidence !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ds-caveat-block__confidence", children: [
1722
+ confidence,
1723
+ "% confidence"
1724
+ ] })
1725
+ ] }),
1726
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-caveat-block__content", children })
1727
+ ]
1728
+ }
1729
+ );
1730
+ }
1731
+ );
1732
+ CaveatBlock.displayName = "CaveatBlock";
1733
+ var KeyMetric = React2__default.default.forwardRef(
1734
+ ({
1735
+ title,
1736
+ value,
1737
+ prefix,
1738
+ suffix,
1739
+ trend,
1740
+ secondary,
1741
+ sampleSize,
1742
+ confidence,
1743
+ onClick,
1744
+ loading,
1745
+ size = "md",
1746
+ className,
1747
+ ...props
1748
+ }, ref) => {
1749
+ const { features } = useReportMode();
1750
+ const { isValid } = useDataState({
1751
+ sampleSize: sampleSize ?? 100,
1752
+ requiredSize: 30
1753
+ });
1754
+ const isClickable = onClick && !loading;
1755
+ const formatValue = (val) => {
1756
+ if (typeof val === "number") {
1757
+ return val.toLocaleString();
1758
+ }
1759
+ return val;
1760
+ };
1761
+ const getTrendIcon = (direction) => {
1762
+ switch (direction) {
1763
+ case "up":
1764
+ return "\u2191";
1765
+ case "down":
1766
+ return "\u2193";
1767
+ default:
1768
+ return "\u2192";
1769
+ }
1770
+ };
1771
+ const Component = isClickable ? "button" : "div";
1772
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1773
+ Component,
1774
+ {
1775
+ ref,
1776
+ className: clsx12__default.default(
1777
+ "ds-key-metric",
1778
+ `ds-key-metric--${size}`,
1779
+ loading && "ds-key-metric--loading",
1780
+ isClickable && "ds-key-metric--clickable",
1781
+ !isValid && "ds-key-metric--invalid",
1782
+ className
1783
+ ),
1784
+ onClick: isClickable ? onClick : void 0,
1785
+ type: isClickable ? "button" : void 0,
1786
+ ...props,
1787
+ children: [
1788
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-key-metric__header", children: [
1789
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-key-metric__title", children: title }),
1790
+ features.showConfidenceScores && confidence !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ds-key-metric__confidence", children: [
1791
+ confidence,
1792
+ "%"
1793
+ ] })
1794
+ ] }),
1795
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-key-metric__value-row", children: [
1796
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ds-key-metric__value", children: [
1797
+ prefix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-key-metric__prefix", children: prefix }),
1798
+ loading ? "\u2014" : formatValue(value),
1799
+ suffix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-key-metric__suffix", children: suffix })
1800
+ ] }),
1801
+ trend && /* @__PURE__ */ jsxRuntime.jsxs(
1802
+ "span",
1803
+ {
1804
+ className: clsx12__default.default("ds-key-metric__trend", `ds-key-metric__trend--${trend.direction}`),
1805
+ children: [
1806
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-key-metric__trend-icon", children: getTrendIcon(trend.direction) }),
1807
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ds-key-metric__trend-value", children: [
1808
+ Math.abs(trend.value),
1809
+ "%"
1810
+ ] }),
1811
+ trend.label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-key-metric__trend-label", children: trend.label })
1812
+ ]
1813
+ }
1814
+ )
1815
+ ] }),
1816
+ secondary && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-key-metric__secondary", children: [
1817
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ds-key-metric__secondary-label", children: [
1818
+ secondary.label,
1819
+ ":"
1820
+ ] }),
1821
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-key-metric__secondary-value", children: formatValue(secondary.value) })
1822
+ ] }),
1823
+ features.showMethodology && sampleSize !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-key-metric__sample", children: [
1824
+ "n=",
1825
+ sampleSize.toLocaleString()
1826
+ ] })
1827
+ ]
1828
+ }
1829
+ );
1830
+ }
1831
+ );
1832
+ KeyMetric.displayName = "KeyMetric";
1833
+ var TrendIndicator = React2__default.default.forwardRef(
1834
+ ({
1835
+ value,
1836
+ direction: directionOverride,
1837
+ positiveIsGood = true,
1838
+ showIcon = true,
1839
+ showPercent = true,
1840
+ size = "md",
1841
+ className,
1842
+ ...props
1843
+ }, ref) => {
1844
+ const direction = directionOverride ?? (value > 0 ? "up" : value < 0 ? "down" : "neutral");
1845
+ const isGood = positiveIsGood ? direction === "up" : direction === "down";
1846
+ const isBad = positiveIsGood ? direction === "down" : direction === "up";
1847
+ const getIcon = () => {
1848
+ switch (direction) {
1849
+ case "up":
1850
+ return /* @__PURE__ */ jsxRuntime.jsx(
1851
+ "svg",
1852
+ {
1853
+ width: "12",
1854
+ height: "12",
1855
+ viewBox: "0 0 24 24",
1856
+ fill: "none",
1857
+ stroke: "currentColor",
1858
+ strokeWidth: "3",
1859
+ children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "18,15 12,9 6,15" })
1860
+ }
1861
+ );
1862
+ case "down":
1863
+ return /* @__PURE__ */ jsxRuntime.jsx(
1864
+ "svg",
1865
+ {
1866
+ width: "12",
1867
+ height: "12",
1868
+ viewBox: "0 0 24 24",
1869
+ fill: "none",
1870
+ stroke: "currentColor",
1871
+ strokeWidth: "3",
1872
+ children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "6,9 12,15 18,9" })
1873
+ }
1874
+ );
1875
+ default:
1876
+ return /* @__PURE__ */ jsxRuntime.jsx(
1877
+ "svg",
1878
+ {
1879
+ width: "12",
1880
+ height: "12",
1881
+ viewBox: "0 0 24 24",
1882
+ fill: "none",
1883
+ stroke: "currentColor",
1884
+ strokeWidth: "3",
1885
+ children: /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
1886
+ }
1887
+ );
1888
+ }
1889
+ };
1890
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1891
+ "span",
1892
+ {
1893
+ ref,
1894
+ className: clsx12__default.default(
1895
+ "ds-trend-indicator",
1896
+ `ds-trend-indicator--${size}`,
1897
+ `ds-trend-indicator--${direction}`,
1898
+ isGood && "ds-trend-indicator--good",
1899
+ isBad && "ds-trend-indicator--bad",
1900
+ className
1901
+ ),
1902
+ "aria-label": `${direction === "up" ? "Increased" : direction === "down" ? "Decreased" : "No change"} by ${Math.abs(value)}%`,
1903
+ ...props,
1904
+ children: [
1905
+ showIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-trend-indicator__icon", children: getIcon() }),
1906
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ds-trend-indicator__value", children: [
1907
+ value > 0 && "+",
1908
+ value.toFixed(1),
1909
+ showPercent && "%"
1910
+ ] })
1911
+ ]
1912
+ }
1913
+ );
1914
+ }
1915
+ );
1916
+ TrendIndicator.displayName = "TrendIndicator";
1917
+ function Select({
1918
+ value,
1919
+ defaultValue,
1920
+ onValueChange,
1921
+ disabled,
1922
+ required,
1923
+ name,
1924
+ items,
1925
+ children
1926
+ }) {
1927
+ return /* @__PURE__ */ jsxRuntime.jsx(
1928
+ select.Select.Root,
1929
+ {
1930
+ value,
1931
+ defaultValue,
1932
+ onValueChange: onValueChange ? (val) => onValueChange(val) : void 0,
1933
+ disabled,
1934
+ required,
1935
+ name,
1936
+ items,
1937
+ children
1938
+ }
1939
+ );
1940
+ }
1941
+ Select.displayName = "Select";
1942
+ var SelectTrigger = React2__default.default.forwardRef(
1943
+ ({ className, placeholder = "Select...", size = "md", ...props }, ref) => {
1944
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ds-select__trigger-wrapper", children: /* @__PURE__ */ jsxRuntime.jsxs(
1945
+ select.Select.Trigger,
1946
+ {
1947
+ ref,
1948
+ className: clsx12__default.default("ds-select__trigger", `ds-select__trigger--${size}`, className),
1949
+ "aria-label": props["aria-label"] || (typeof placeholder === "string" ? placeholder : "Select"),
1950
+ ...props,
1951
+ children: [
1952
+ /* @__PURE__ */ jsxRuntime.jsx(select.Select.Value, { className: "ds-select__value", placeholder }),
1953
+ /* @__PURE__ */ jsxRuntime.jsx(select.Select.Icon, { className: "ds-select__icon", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDownIcon, {}) })
1954
+ ]
1955
+ }
1956
+ ) });
1957
+ }
1958
+ );
1959
+ SelectTrigger.displayName = "SelectTrigger";
1960
+ var SelectContent = React2__default.default.forwardRef(
1961
+ ({ className, side = "bottom", sideOffset = 4, align = "start", children, ...props }, ref) => {
1962
+ return /* @__PURE__ */ jsxRuntime.jsx(select.Select.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
1963
+ select.Select.Positioner,
1964
+ {
1965
+ side,
1966
+ sideOffset,
1967
+ align,
1968
+ alignItemWithTrigger: false,
1969
+ children: /* @__PURE__ */ jsxRuntime.jsx(select.Select.Popup, { ref, className: clsx12__default.default("ds-select__content", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(select.Select.List, { className: "ds-select__list", children }) })
1970
+ }
1971
+ ) });
1972
+ }
1973
+ );
1974
+ SelectContent.displayName = "SelectContent";
1975
+ var SelectItem = React2__default.default.forwardRef(
1976
+ ({ className, value, children, disabled, ...props }, ref) => {
1977
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1978
+ select.Select.Item,
1979
+ {
1980
+ ref,
1981
+ value,
1982
+ disabled,
1983
+ className: clsx12__default.default("ds-select__item", className),
1984
+ ...props,
1985
+ children: [
1986
+ /* @__PURE__ */ jsxRuntime.jsx(select.Select.ItemIndicator, { className: "ds-select__item-indicator", children: /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, {}) }),
1987
+ /* @__PURE__ */ jsxRuntime.jsx(select.Select.ItemText, { children })
1988
+ ]
1989
+ }
1990
+ );
1991
+ }
1992
+ );
1993
+ SelectItem.displayName = "SelectItem";
1994
+ var SelectGroup = React2__default.default.forwardRef(
1995
+ ({ className, label, children, ...props }, ref) => {
1996
+ return /* @__PURE__ */ jsxRuntime.jsxs(select.Select.Group, { ref, className: clsx12__default.default("ds-select__group", className), ...props, children: [
1997
+ label && /* @__PURE__ */ jsxRuntime.jsx(select.Select.GroupLabel, { className: "ds-select__group-label", children: label }),
1998
+ children
1999
+ ] });
2000
+ }
2001
+ );
2002
+ SelectGroup.displayName = "SelectGroup";
2003
+ var SelectSeparator = React2__default.default.forwardRef(({ className, ...props }, ref) => {
2004
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: clsx12__default.default("ds-select__separator", className), ...props });
168
2005
  });
169
- Object.defineProperty(exports, "SelectItem", {
170
- enumerable: true,
171
- get: function () { return chunk3TGSIILM_cjs.SelectItem; }
2006
+ SelectSeparator.displayName = "SelectSeparator";
2007
+ function ChevronDownIcon() {
2008
+ return /* @__PURE__ */ jsxRuntime.jsx(
2009
+ "svg",
2010
+ {
2011
+ xmlns: "http://www.w3.org/2000/svg",
2012
+ width: "16",
2013
+ height: "16",
2014
+ viewBox: "0 0 24 24",
2015
+ fill: "none",
2016
+ stroke: "currentColor",
2017
+ strokeWidth: "2",
2018
+ strokeLinecap: "round",
2019
+ strokeLinejoin: "round",
2020
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6 9 6 6 6-6" })
2021
+ }
2022
+ );
2023
+ }
2024
+ function CheckIcon() {
2025
+ return /* @__PURE__ */ jsxRuntime.jsx(
2026
+ "svg",
2027
+ {
2028
+ xmlns: "http://www.w3.org/2000/svg",
2029
+ width: "14",
2030
+ height: "14",
2031
+ viewBox: "0 0 24 24",
2032
+ fill: "none",
2033
+ stroke: "currentColor",
2034
+ strokeWidth: "2",
2035
+ strokeLinecap: "round",
2036
+ strokeLinejoin: "round",
2037
+ children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "20 6 9 17 4 12" })
2038
+ }
2039
+ );
2040
+ }
2041
+ var DropdownMenu = menu.Menu.Root;
2042
+ var DropdownMenuTrigger = React2__default.default.forwardRef(({ className, ...props }, ref) => {
2043
+ return /* @__PURE__ */ jsxRuntime.jsx(
2044
+ menu.Menu.Trigger,
2045
+ {
2046
+ ref,
2047
+ className: clsx12__default.default("ds-dropdown-menu__trigger", className),
2048
+ ...props
2049
+ }
2050
+ );
172
2051
  });
173
- Object.defineProperty(exports, "SelectSeparator", {
174
- enumerable: true,
175
- get: function () { return chunk3TGSIILM_cjs.SelectSeparator; }
2052
+ DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
2053
+ var DropdownMenuContent = React2__default.default.forwardRef(
2054
+ ({ className, side = "bottom", align = "start", sideOffset = 4, alignOffset = 0, ...props }, ref) => {
2055
+ return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
2056
+ menu.Menu.Positioner,
2057
+ {
2058
+ side,
2059
+ align,
2060
+ sideOffset,
2061
+ alignOffset,
2062
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2063
+ menu.Menu.Popup,
2064
+ {
2065
+ ref,
2066
+ className: clsx12__default.default("ds-dropdown-menu__content", className),
2067
+ ...props
2068
+ }
2069
+ )
2070
+ }
2071
+ ) });
2072
+ }
2073
+ );
2074
+ DropdownMenuContent.displayName = "DropdownMenuContent";
2075
+ var DropdownMenuItem = React2__default.default.forwardRef(
2076
+ ({ className, ...props }, ref) => {
2077
+ return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Item, { ref, className: clsx12__default.default("ds-dropdown-menu__item", className), ...props });
2078
+ }
2079
+ );
2080
+ DropdownMenuItem.displayName = "DropdownMenuItem";
2081
+ var DropdownMenuSeparator = React2__default.default.forwardRef(({ className, ...props }, ref) => {
2082
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: clsx12__default.default("ds-dropdown-menu__separator", className), ...props });
176
2083
  });
177
- Object.defineProperty(exports, "SelectTrigger", {
178
- enumerable: true,
179
- get: function () { return chunk3TGSIILM_cjs.SelectTrigger; }
2084
+ DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
2085
+ var DropdownMenuLabel = React2__default.default.forwardRef(({ className, ...props }, ref) => {
2086
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: clsx12__default.default("ds-dropdown-menu__label", className), ...props });
180
2087
  });
2088
+ DropdownMenuLabel.displayName = "DropdownMenuLabel";
2089
+ var DEFAULT_OPTIONS = [
2090
+ { format: "pdf", label: "PDF Document", description: "Best for sharing reports" },
2091
+ { format: "pptx", label: "PowerPoint", description: "Editable presentation" },
2092
+ { format: "xlsx", label: "Excel Spreadsheet", description: "Data with charts" },
2093
+ { format: "csv", label: "CSV Data", description: "Raw data only" },
2094
+ { format: "png", label: "PNG Image", description: "Chart screenshot" },
2095
+ { format: "json", label: "JSON", description: "Developer format" }
2096
+ ];
2097
+ var FORMAT_ICONS = {
2098
+ pdf: /* @__PURE__ */ jsxRuntime.jsx(PdfIcon, {}),
2099
+ csv: /* @__PURE__ */ jsxRuntime.jsx(CsvIcon, {}),
2100
+ xlsx: /* @__PURE__ */ jsxRuntime.jsx(ExcelIcon, {}),
2101
+ pptx: /* @__PURE__ */ jsxRuntime.jsx(PptIcon, {}),
2102
+ png: /* @__PURE__ */ jsxRuntime.jsx(ImageIcon, {}),
2103
+ json: /* @__PURE__ */ jsxRuntime.jsx(JsonIcon, {})
2104
+ };
2105
+ function ExportMenu({
2106
+ options = DEFAULT_OPTIONS,
2107
+ onExport,
2108
+ isExporting = false,
2109
+ label = "Export",
2110
+ size = "md",
2111
+ variant = "secondary",
2112
+ className,
2113
+ disabled
2114
+ }) {
2115
+ const documentOptions = options.filter((o) => ["pdf", "pptx"].includes(o.format));
2116
+ const dataOptions = options.filter((o) => ["xlsx", "csv", "json"].includes(o.format));
2117
+ const imageOptions = options.filter((o) => ["png"].includes(o.format));
2118
+ return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
2119
+ /* @__PURE__ */ jsxRuntime.jsx(
2120
+ DropdownMenuTrigger,
2121
+ {
2122
+ className: clsx12__default.default(
2123
+ "ds-export-menu__trigger",
2124
+ "ds-button",
2125
+ `ds-button--${variant}`,
2126
+ `ds-button--${size}`,
2127
+ className
2128
+ ),
2129
+ disabled: disabled || isExporting,
2130
+ children: isExporting ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2131
+ /* @__PURE__ */ jsxRuntime.jsx(LoadingIcon, {}),
2132
+ "Exporting..."
2133
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2134
+ /* @__PURE__ */ jsxRuntime.jsx(ExportIcon, {}),
2135
+ label
2136
+ ] })
2137
+ }
2138
+ ),
2139
+ /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuContent, { side: "bottom", align: "end", sideOffset: 4, children: [
2140
+ documentOptions.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2141
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuLabel, { children: "Documents" }),
2142
+ documentOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
2143
+ DropdownMenuItem,
2144
+ {
2145
+ disabled: option.disabled,
2146
+ onClick: () => onExport(option.format),
2147
+ children: [
2148
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-export-menu__item-icon", children: FORMAT_ICONS[option.format] }),
2149
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ds-export-menu__item-content", children: [
2150
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-export-menu__item-label", children: option.label }),
2151
+ option.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-export-menu__item-description", children: option.description })
2152
+ ] })
2153
+ ]
2154
+ },
2155
+ option.format
2156
+ ))
2157
+ ] }),
2158
+ documentOptions.length > 0 && dataOptions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {}),
2159
+ dataOptions.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2160
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuLabel, { children: "Data" }),
2161
+ dataOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
2162
+ DropdownMenuItem,
2163
+ {
2164
+ disabled: option.disabled,
2165
+ onClick: () => onExport(option.format),
2166
+ children: [
2167
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-export-menu__item-icon", children: FORMAT_ICONS[option.format] }),
2168
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ds-export-menu__item-content", children: [
2169
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-export-menu__item-label", children: option.label }),
2170
+ option.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-export-menu__item-description", children: option.description })
2171
+ ] })
2172
+ ]
2173
+ },
2174
+ option.format
2175
+ ))
2176
+ ] }),
2177
+ imageOptions.length > 0 && (dataOptions.length > 0 || documentOptions.length > 0) && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {}),
2178
+ imageOptions.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2179
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuLabel, { children: "Image" }),
2180
+ imageOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
2181
+ DropdownMenuItem,
2182
+ {
2183
+ disabled: option.disabled,
2184
+ onClick: () => onExport(option.format),
2185
+ children: [
2186
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-export-menu__item-icon", children: FORMAT_ICONS[option.format] }),
2187
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ds-export-menu__item-content", children: [
2188
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-export-menu__item-label", children: option.label }),
2189
+ option.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-export-menu__item-description", children: option.description })
2190
+ ] })
2191
+ ]
2192
+ },
2193
+ option.format
2194
+ ))
2195
+ ] })
2196
+ ] })
2197
+ ] });
2198
+ }
2199
+ ExportMenu.displayName = "ExportMenu";
2200
+ function ExportIcon() {
2201
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2202
+ "svg",
2203
+ {
2204
+ xmlns: "http://www.w3.org/2000/svg",
2205
+ width: "16",
2206
+ height: "16",
2207
+ viewBox: "0 0 24 24",
2208
+ fill: "none",
2209
+ stroke: "currentColor",
2210
+ strokeWidth: "2",
2211
+ strokeLinecap: "round",
2212
+ strokeLinejoin: "round",
2213
+ children: [
2214
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
2215
+ /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "17 8 12 3 7 8" }),
2216
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "3", x2: "12", y2: "15" })
2217
+ ]
2218
+ }
2219
+ );
2220
+ }
2221
+ function LoadingIcon() {
2222
+ return /* @__PURE__ */ jsxRuntime.jsx(
2223
+ "svg",
2224
+ {
2225
+ className: "ds-export-menu__loading-icon",
2226
+ xmlns: "http://www.w3.org/2000/svg",
2227
+ width: "16",
2228
+ height: "16",
2229
+ viewBox: "0 0 24 24",
2230
+ fill: "none",
2231
+ stroke: "currentColor",
2232
+ strokeWidth: "2",
2233
+ strokeLinecap: "round",
2234
+ strokeLinejoin: "round",
2235
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
2236
+ }
2237
+ );
2238
+ }
2239
+ function PdfIcon() {
2240
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2241
+ "svg",
2242
+ {
2243
+ xmlns: "http://www.w3.org/2000/svg",
2244
+ width: "16",
2245
+ height: "16",
2246
+ viewBox: "0 0 24 24",
2247
+ fill: "none",
2248
+ stroke: "currentColor",
2249
+ strokeWidth: "2",
2250
+ strokeLinecap: "round",
2251
+ strokeLinejoin: "round",
2252
+ children: [
2253
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
2254
+ /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "14 2 14 8 20 8" }),
2255
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
2256
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
2257
+ /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "10 9 9 9 8 9" })
2258
+ ]
2259
+ }
2260
+ );
2261
+ }
2262
+ function CsvIcon() {
2263
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2264
+ "svg",
2265
+ {
2266
+ xmlns: "http://www.w3.org/2000/svg",
2267
+ width: "16",
2268
+ height: "16",
2269
+ viewBox: "0 0 24 24",
2270
+ fill: "none",
2271
+ stroke: "currentColor",
2272
+ strokeWidth: "2",
2273
+ strokeLinecap: "round",
2274
+ strokeLinejoin: "round",
2275
+ children: [
2276
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
2277
+ /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "14 2 14 8 20 8" }),
2278
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "8", y1: "13", x2: "16", y2: "13" }),
2279
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "8", y1: "17", x2: "16", y2: "17" })
2280
+ ]
2281
+ }
2282
+ );
2283
+ }
2284
+ function ExcelIcon() {
2285
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2286
+ "svg",
2287
+ {
2288
+ xmlns: "http://www.w3.org/2000/svg",
2289
+ width: "16",
2290
+ height: "16",
2291
+ viewBox: "0 0 24 24",
2292
+ fill: "none",
2293
+ stroke: "currentColor",
2294
+ strokeWidth: "2",
2295
+ strokeLinecap: "round",
2296
+ strokeLinejoin: "round",
2297
+ children: [
2298
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
2299
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 9h18" }),
2300
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 15h18" }),
2301
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 3v18" }),
2302
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 3v18" })
2303
+ ]
2304
+ }
2305
+ );
2306
+ }
2307
+ function PptIcon() {
2308
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2309
+ "svg",
2310
+ {
2311
+ xmlns: "http://www.w3.org/2000/svg",
2312
+ width: "16",
2313
+ height: "16",
2314
+ viewBox: "0 0 24 24",
2315
+ fill: "none",
2316
+ stroke: "currentColor",
2317
+ strokeWidth: "2",
2318
+ strokeLinecap: "round",
2319
+ strokeLinejoin: "round",
2320
+ children: [
2321
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
2322
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
2323
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
2324
+ ]
2325
+ }
2326
+ );
2327
+ }
2328
+ function ImageIcon() {
2329
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2330
+ "svg",
2331
+ {
2332
+ xmlns: "http://www.w3.org/2000/svg",
2333
+ width: "16",
2334
+ height: "16",
2335
+ viewBox: "0 0 24 24",
2336
+ fill: "none",
2337
+ stroke: "currentColor",
2338
+ strokeWidth: "2",
2339
+ strokeLinecap: "round",
2340
+ strokeLinejoin: "round",
2341
+ children: [
2342
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
2343
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8.5", cy: "8.5", r: "1.5" }),
2344
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m21 15-5-5L5 21" })
2345
+ ]
2346
+ }
2347
+ );
2348
+ }
2349
+ function JsonIcon() {
2350
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2351
+ "svg",
2352
+ {
2353
+ xmlns: "http://www.w3.org/2000/svg",
2354
+ width: "16",
2355
+ height: "16",
2356
+ viewBox: "0 0 24 24",
2357
+ fill: "none",
2358
+ stroke: "currentColor",
2359
+ strokeWidth: "2",
2360
+ strokeLinecap: "round",
2361
+ strokeLinejoin: "round",
2362
+ children: [
2363
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5a2 2 0 0 0 2 2h1" }),
2364
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 21h1a2 2 0 0 0 2-2v-5a2 2 0 0 1 2-2 2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1" })
2365
+ ]
2366
+ }
2367
+ );
2368
+ }
2369
+
2370
+ exports.ANALYST_MODE = ANALYST_MODE;
2371
+ exports.ANALYTICAL_STATE_CONFIG = ANALYTICAL_STATE_CONFIG;
2372
+ exports.CHART_REGISTRY = CHART_REGISTRY;
2373
+ exports.CONFIDENCE_THRESHOLDS = CONFIDENCE_THRESHOLDS;
2374
+ exports.CaveatBlock = CaveatBlock;
2375
+ exports.ConfidenceIndicator = ConfidenceIndicator;
2376
+ exports.DataCoverageBadge = DataCoverageBadge;
2377
+ exports.DataStateIndicator = DataStateIndicator;
2378
+ exports.EXECUTIVE_MODE = EXECUTIVE_MODE;
2379
+ exports.EvidenceGroup = EvidenceGroup;
2380
+ exports.ExecutiveThesis = ExecutiveThesis;
2381
+ exports.ExportMenu = ExportMenu;
2382
+ exports.INSIGHT_TYPE_CONTRACTS = INSIGHT_TYPE_CONTRACTS;
2383
+ exports.INTENT_CHART_FAMILIES = INTENT_CHART_FAMILIES;
2384
+ exports.InsightBlock = InsightBlock;
2385
+ exports.KeyMetric = KeyMetric;
2386
+ exports.MINIMUM_SAMPLE_SIZES = MINIMUM_SAMPLE_SIZES;
2387
+ exports.MethodologyNote = MethodologyNote;
2388
+ exports.ReportModeProvider = ReportModeProvider;
2389
+ exports.ReportShell = ReportShell;
2390
+ exports.Select = Select;
2391
+ exports.SelectContent = SelectContent;
2392
+ exports.SelectGroup = SelectGroup;
2393
+ exports.SelectItem = SelectItem;
2394
+ exports.SelectSeparator = SelectSeparator;
2395
+ exports.SelectTrigger = SelectTrigger;
2396
+ exports.TrendIndicator = TrendIndicator;
2397
+ exports.calculateCompleteness = calculateCompleteness;
2398
+ exports.calculateConfidence = calculateConfidence;
2399
+ exports.calculateNormalizedVariance = calculateNormalizedVariance;
2400
+ exports.calculateRecency = calculateRecency;
2401
+ exports.canSwitchChart = canSwitchChart;
2402
+ exports.getAllowedSwitchTargets = getAllowedSwitchTargets;
2403
+ exports.getConfidenceLevel = getConfidenceLevel;
2404
+ exports.getConfidenceThreshold = getConfidenceThreshold;
2405
+ exports.getDefaultChartForIntent = getDefaultChartForIntent;
2406
+ exports.getMVPChartsForIntent = getMVPChartsForIntent;
2407
+ exports.suggestChartType = suggestChartType;
2408
+ exports.useChartData = useChartData;
2409
+ exports.useDataState = useDataState;
2410
+ exports.useReportMode = useReportMode;
2411
+ exports.validateChartData = validateChartData;
2412
+ exports.validateReportStructure = validateReportStructure;
181
2413
  //# sourceMappingURL=out.js.map
182
2414
  //# sourceMappingURL=index.cjs.map