semiotic 3.12.0 → 3.12.1

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 (256) hide show
  1. package/README.md +50 -46
  2. package/ai/artifact-surface-inventory.json +1 -1
  3. package/ai/behaviorContracts.cjs +1 -1
  4. package/ai/dist/diagnose-operation.js +3 -3
  5. package/ai/dist/mcp-server.js +1 -1
  6. package/ai/reference.md +15 -3
  7. package/ai/schema.json +908 -96
  8. package/ai/surface-manifest.json +1 -1
  9. package/ai/task-packets/compare-category-totals.json +5 -5
  10. package/ai/task-packets/compare-category-totals.md +2 -2
  11. package/ai/task-packets/correct-published-chart.json +5 -5
  12. package/ai/task-packets/correct-published-chart.md +2 -2
  13. package/ai/task-packets/index.json +6 -6
  14. package/ai/task-packets/update-live-chart.json +5 -5
  15. package/ai/task-packets/update-live-chart.md +2 -2
  16. package/dist/c-27DCB5T6.min.js +7 -7
  17. package/dist/c-2CKIGFD2.min.js +1 -1
  18. package/dist/c-3FATLOH4.min.js +1 -0
  19. package/dist/{c-STVM6CBI.min.js → c-4SCJKAWZ.min.js} +200 -200
  20. package/dist/c-5FUOKMH6.min.js +7 -0
  21. package/dist/c-AAIPWVQ5.min.js +6 -6
  22. package/dist/{c-2RG4WOVX.min.js → c-ALLF3Y77.min.js} +1 -1
  23. package/dist/{c-QMKQVCCZ.min.js → c-C5GXUHUO.min.js} +6 -6
  24. package/dist/c-C67QDKTU.min.js +34 -0
  25. package/dist/c-F76M77YC.min.js +1 -0
  26. package/dist/c-FEVXPKQH.min.js +1 -1
  27. package/dist/c-G42WVQO2.min.js +1 -0
  28. package/dist/c-G5A3YWTN.min.js +66 -0
  29. package/dist/c-H4HVKBU3.min.js +1 -0
  30. package/dist/c-HU3ASFKT.min.js +1 -0
  31. package/dist/c-I4FYCVJB.min.js +391 -0
  32. package/dist/{c-5L7JGWQW.min.js → c-IATPZOL7.min.js} +28 -28
  33. package/dist/c-IE5EBBP6.min.js +110 -0
  34. package/dist/c-IGONIKZL.min.js +1 -0
  35. package/dist/c-IKPM53JH.min.js +1 -0
  36. package/dist/c-IU4QZ7Y5.min.js +1 -1
  37. package/dist/{c-2ACLVPKF.min.js → c-K5VE57OI.min.js} +1 -1
  38. package/dist/c-KWJIBJ4R.min.js +1 -0
  39. package/dist/c-LIMFU6RD.min.js +1 -0
  40. package/dist/c-M4T43G76.min.js +1 -0
  41. package/dist/c-M7QUZZCE.min.js +1 -1
  42. package/dist/c-NVSINXE5.min.js +1 -0
  43. package/dist/{c-FAF6EV4E.min.js → c-NWRYV6ZF.min.js} +1 -1
  44. package/dist/c-O5GU2R5W.min.js +1 -0
  45. package/dist/c-OC7GNXGZ.min.js +1 -0
  46. package/dist/c-OV5F3DQP.min.js +1 -0
  47. package/dist/{c-5TAXHW7I.min.js → c-PJ5CAYAW.min.js} +1 -1
  48. package/dist/c-Q5LZRQGD.min.js +1 -0
  49. package/dist/c-QP3PXK3N.min.js +1 -0
  50. package/dist/c-SGZ7ZD2I.min.js +51 -0
  51. package/dist/c-SSKV5JPW.min.js +1 -1
  52. package/dist/c-THWTHWXU.min.js +37 -0
  53. package/dist/c-TRMNDRC4.min.js +41 -0
  54. package/dist/c-UP656CST.min.js +1 -1
  55. package/dist/c-USYOK5OX.min.js +1 -0
  56. package/dist/c-VI753KBO.min.js +1 -0
  57. package/dist/{c-TT4CTEBR.min.js → c-VLAAAFST.min.js} +1 -1
  58. package/dist/c-VSOQPII4.min.js +5 -5
  59. package/dist/c-WGDM4ZRP.min.js +26 -0
  60. package/dist/c-XCV7VUU3.min.js +87 -0
  61. package/dist/c-XGDZPYBI.min.js +1 -0
  62. package/dist/c-XI6CLZII.min.js +1 -0
  63. package/dist/{c-L4Q2YMXO.min.js → c-XLC7PKM7.min.js} +1 -1
  64. package/dist/{c-3YAGKCPU.min.js → c-YEB6Z35F.min.js} +1 -1
  65. package/dist/c-YWZBFG63.min.js +1 -0
  66. package/dist/c-ZMYO3NZU.min.js +2 -0
  67. package/dist/c-ZO36H5VH.min.js +48 -0
  68. package/dist/components/LinkedCharts.d.ts +6 -1
  69. package/dist/components/Tooltip/Tooltip.d.ts +11 -1
  70. package/dist/components/Tooltip/tooltipChrome.d.ts +8 -2
  71. package/dist/components/bundling/semioticVite.d.ts +24 -0
  72. package/dist/components/charts/physics/cruciblePhysics.d.ts +2 -2
  73. package/dist/components/charts/physics/gauntletPhysics.d.ts +2 -6
  74. package/dist/components/charts/physics/physicsHocUtils.d.ts +8 -1
  75. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +2 -0
  76. package/dist/components/charts/shared/chartSize.d.ts +58 -0
  77. package/dist/components/charts/shared/chartSizeDefaults.d.ts +189 -0
  78. package/dist/components/charts/shared/chartSizeDefaultsAtlas.d.ts +9 -0
  79. package/dist/components/charts/shared/chartSizeDefaultsNetwork.d.ts +29 -0
  80. package/dist/components/charts/shared/chartSizeDefaultsOrdinal.d.ts +13 -0
  81. package/dist/components/charts/shared/chartSizeDefaultsPhysics.d.ts +41 -0
  82. package/dist/components/charts/shared/chartSizeDefaultsValue.d.ts +19 -0
  83. package/dist/components/charts/shared/chartSizeDefaultsXY.d.ts +10 -0
  84. package/dist/components/charts/shared/networkPerspectiveWireSchema.d.ts +3 -0
  85. package/dist/components/charts/shared/useChartSetup.d.ts +3 -0
  86. package/dist/components/charts/shared/useCustomChartSetup.d.ts +4 -0
  87. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +2 -0
  88. package/dist/components/charts/shared/withChartWrapper.d.ts +6 -2
  89. package/dist/components/charts/value/BigNumber.d.ts +0 -8
  90. package/dist/components/charts/xy/minimapLayout.d.ts +10 -0
  91. package/dist/components/realtime/BinAccumulator.d.ts +5 -2
  92. package/dist/components/recipes/atlas/dependencyForestChartProps.d.ts +4 -4
  93. package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +177 -1
  94. package/dist/components/recipes/atlas/flowCircuitLayout.d.ts +3 -0
  95. package/dist/components/recipes/atlas/motifBraidChartProps.d.ts +2 -0
  96. package/dist/components/recipes/atlas/resolution/BoundaryLoomChart.d.ts +3 -0
  97. package/dist/components/recipes/atlas/resolution/ComponentCutaway.d.ts +16 -0
  98. package/dist/components/recipes/atlas/resolution/ResolutionAtlasChart.d.ts +3 -0
  99. package/dist/components/recipes/atlas/resolution/ResolutionGlyphs.d.ts +15 -0
  100. package/dist/components/recipes/atlas/resolution/ResolutionReader.d.ts +5 -0
  101. package/dist/components/recipes/atlas/resolution/appearance.d.ts +58 -0
  102. package/dist/components/recipes/atlas/resolution/boundaryLoomLayout.d.ts +4 -0
  103. package/dist/components/recipes/atlas/resolution/chartProps.d.ts +75 -0
  104. package/dist/components/recipes/atlas/resolution/componentCutawayLayout.d.ts +12 -0
  105. package/dist/components/recipes/atlas/resolution/cutawayContext.d.ts +23 -0
  106. package/dist/components/recipes/atlas/resolution/cutawayGraph.d.ts +4 -0
  107. package/dist/components/recipes/atlas/resolution/cycles.d.ts +7 -0
  108. package/dist/components/recipes/atlas/resolution/evidence.d.ts +43 -0
  109. package/dist/components/recipes/atlas/resolution/glyphs.d.ts +40 -0
  110. package/dist/components/recipes/atlas/resolution/identity.d.ts +4 -0
  111. package/dist/components/recipes/atlas/resolution/indexGraph.d.ts +32 -0
  112. package/dist/components/recipes/atlas/resolution/ownership.d.ts +25 -0
  113. package/dist/components/recipes/atlas/resolution/plan.d.ts +12 -0
  114. package/dist/components/recipes/atlas/resolution/ports.d.ts +44 -0
  115. package/dist/components/recipes/atlas/resolution/prepare.d.ts +4 -0
  116. package/dist/components/recipes/atlas/resolution/project.d.ts +70 -0
  117. package/dist/components/recipes/atlas/resolution/queries.d.ts +23 -0
  118. package/dist/components/recipes/atlas/resolution/resolutionAtlasLayout.d.ts +9 -0
  119. package/dist/components/recipes/atlas/resolution/rules.d.ts +14 -0
  120. package/dist/components/recipes/atlas/resolution/scene.d.ts +52 -0
  121. package/dist/components/recipes/atlas/resolution/selection.d.ts +3 -0
  122. package/dist/components/recipes/atlas/resolution/sets.d.ts +10 -0
  123. package/dist/components/recipes/atlas/resolution/types.d.ts +401 -0
  124. package/dist/components/recipes/atlas/resolution/validate.d.ts +4 -0
  125. package/dist/components/recipes/atlas/resolution/witnesses.d.ts +18 -0
  126. package/dist/components/recipes/atlas/resolution/worker.d.ts +34 -0
  127. package/dist/components/recipes/lineageDag.d.ts +4 -0
  128. package/dist/components/recipes/recipeUtils.d.ts +2 -0
  129. package/dist/components/recipes/transitDiagram.d.ts +2 -61
  130. package/dist/components/recipes/transitDiagramTypes.d.ts +65 -0
  131. package/dist/components/semiotic-ai.d.ts +2 -0
  132. package/dist/components/semiotic-experimental-network-resolution-react.d.ts +12 -0
  133. package/dist/components/semiotic-experimental-network-resolution.d.ts +13 -0
  134. package/dist/components/semiotic-geo.d.ts +1 -1
  135. package/dist/components/semiotic-network-perspective-core.d.ts +6 -0
  136. package/dist/components/semiotic-network.d.ts +1 -1
  137. package/dist/components/semiotic-ordinal.d.ts +1 -1
  138. package/dist/components/semiotic-physics.d.ts +1 -1
  139. package/dist/components/semiotic-realtime-core.d.ts +1 -1
  140. package/dist/components/semiotic-realtime-react.d.ts +2 -0
  141. package/dist/components/semiotic-utils-core.d.ts +3 -1
  142. package/dist/components/semiotic-vite.d.ts +2 -0
  143. package/dist/components/semiotic-xy.d.ts +3 -1
  144. package/dist/components/semiotic.d.ts +3 -1
  145. package/dist/components/server/renderToStaticSVG.d.ts +2 -1
  146. package/dist/components/server/serverChartConfigShared.d.ts +2 -0
  147. package/dist/components/store/LinkedCrosshairStore.d.ts +43 -11
  148. package/dist/components/store/themeCore.d.ts +2 -0
  149. package/dist/components/stream/frameKeyboardNavigation.d.ts +3 -1
  150. package/dist/components/stream/hoverUtils.d.ts +5 -0
  151. package/dist/components/stream/networkCustomLayout.d.ts +3 -0
  152. package/dist/components/stream/networkPerspective.d.ts +2 -0
  153. package/dist/components/stream/networkPerspectiveFit.d.ts +12 -1
  154. package/dist/components/stream/networkPerspectiveSolid.d.ts +1 -1
  155. package/dist/components/stream/networkSceneTypes.d.ts +4 -0
  156. package/dist/components/stream/networkTypes.d.ts +2 -0
  157. package/dist/components/stream/pipelineConfig.d.ts +2 -0
  158. package/dist/components/stream/pipelineDomainResolution.d.ts +4 -1
  159. package/dist/components/stream/types.d.ts +2 -0
  160. package/dist/components/stream/useFrame.d.ts +2 -0
  161. package/dist/components/stream/xySceneBuilders/types.d.ts +2 -0
  162. package/dist/controls.module.min.js +31 -31
  163. package/dist/geo.min.js +150 -150
  164. package/dist/geo.module.min.js +31 -31
  165. package/dist/network.module.min.js +1 -1
  166. package/dist/ordinal.module.min.js +1 -1
  167. package/dist/physics.module.min.js +1 -1
  168. package/dist/rough.module.min.js +1 -1
  169. package/dist/semiotic-ai-core.min.js +1 -1
  170. package/dist/semiotic-ai-core.module.min.js +1 -1
  171. package/dist/semiotic-ai.d.ts +2 -0
  172. package/dist/semiotic-ai.module.min.js +13 -13
  173. package/dist/semiotic-artifact-react.module.min.js +4 -4
  174. package/dist/semiotic-artifact.min.js +1 -1
  175. package/dist/semiotic-artifact.module.min.js +1 -1
  176. package/dist/semiotic-atlas-selection.module.min.js +1 -1
  177. package/dist/semiotic-atlas.module.min.js +10 -12
  178. package/dist/semiotic-client-cjs-shared.min.js +1078 -925
  179. package/dist/semiotic-client-glyph.module.min.js +2 -2
  180. package/dist/semiotic-client-shared.module.min.js +1 -1
  181. package/dist/semiotic-experimental-auxiliary.module.min.js +8 -9
  182. package/dist/semiotic-experimental-network-resolution-react.d.ts +12 -0
  183. package/dist/semiotic-experimental-network-resolution-react.min.js +2 -0
  184. package/dist/semiotic-experimental-network-resolution-react.module.min.js +89 -0
  185. package/dist/semiotic-experimental-network-resolution.d.ts +13 -0
  186. package/dist/semiotic-experimental-network-resolution.min.js +2 -0
  187. package/dist/semiotic-experimental-network-resolution.module.min.js +2 -0
  188. package/dist/semiotic-experimental-node-auxiliary.module.min.js +9 -10
  189. package/dist/semiotic-geo.d.ts +1 -1
  190. package/dist/semiotic-line.module.min.js +1 -1
  191. package/dist/semiotic-network-perspective-core.d.ts +6 -0
  192. package/dist/semiotic-network-perspective-core.min.js +1 -0
  193. package/dist/semiotic-network-perspective-core.module.min.js +1 -0
  194. package/dist/semiotic-network-perspective.module.min.js +1 -1
  195. package/dist/semiotic-network-placement.min.js +4 -0
  196. package/dist/semiotic-network-placement.module.min.js +4 -0
  197. package/dist/semiotic-network-zoom.module.min.js +1 -1
  198. package/dist/semiotic-network.d.ts +1 -1
  199. package/dist/semiotic-ordinal.d.ts +1 -1
  200. package/dist/semiotic-physics.d.ts +1 -1
  201. package/dist/semiotic-realtime-core.d.ts +1 -1
  202. package/dist/semiotic-realtime-core.module.min.js +1 -1
  203. package/dist/semiotic-realtime-react.d.ts +2 -0
  204. package/dist/semiotic-realtime-react.module.min.js +1 -1
  205. package/dist/semiotic-recipes-core-cjs-base.min.js +101 -106
  206. package/dist/semiotic-recipes-core.module.min.js +75 -76
  207. package/dist/semiotic-server-edge-node.module.min.js +391 -392
  208. package/dist/semiotic-server-edge.min.js +387 -388
  209. package/dist/semiotic-server-edge.module.min.js +371 -371
  210. package/dist/semiotic-server-node.min.js +387 -388
  211. package/dist/semiotic-server-node.module.min.js +1 -1
  212. package/dist/semiotic-utils-core.d.ts +3 -1
  213. package/dist/semiotic-utils-core.min.js +12 -11
  214. package/dist/semiotic-utils-core.module.min.js +12 -11
  215. package/dist/semiotic-value.module.min.js +4 -4
  216. package/dist/semiotic-vite.d.ts +2 -0
  217. package/dist/semiotic-vite.min.js +1 -0
  218. package/dist/semiotic-vite.module.min.js +1 -0
  219. package/dist/semiotic-xy.d.ts +3 -1
  220. package/dist/semiotic.d.ts +3 -1
  221. package/dist/semiotic.module.min.js +12 -12
  222. package/dist/server.min.js +387 -388
  223. package/dist/server.module.min.js +1 -1
  224. package/dist/xy.module.min.js +1 -1
  225. package/package.json +42 -13
  226. package/dist/c-2AB65V3L.min.js +0 -1
  227. package/dist/c-2U5JMOPN.min.js +0 -88
  228. package/dist/c-3DCTIRW4.min.js +0 -1
  229. package/dist/c-3OKFRTYM.min.js +0 -1
  230. package/dist/c-3VZHOPFW.min.js +0 -1
  231. package/dist/c-4ZSQIBC7.min.js +0 -1
  232. package/dist/c-5M4RUS7V.min.js +0 -34
  233. package/dist/c-6O5WWP7F.min.js +0 -1
  234. package/dist/c-73TOIYIW.min.js +0 -48
  235. package/dist/c-AE4M7BWH.min.js +0 -1
  236. package/dist/c-AEIK2NFW.min.js +0 -30
  237. package/dist/c-AFQSEIZ4.min.js +0 -4
  238. package/dist/c-BBX7DVVB.min.js +0 -51
  239. package/dist/c-CNYFCSG4.min.js +0 -5
  240. package/dist/c-E6QH2WYE.min.js +0 -1
  241. package/dist/c-GOMQWQJR.min.js +0 -1
  242. package/dist/c-GTYG4PDT.min.js +0 -1
  243. package/dist/c-H23GIKTK.min.js +0 -1
  244. package/dist/c-HQLUUSRJ.min.js +0 -1
  245. package/dist/c-HXUOFDSD.min.js +0 -64
  246. package/dist/c-L3LKYOLK.min.js +0 -1
  247. package/dist/c-MIKDFGKH.min.js +0 -1
  248. package/dist/c-OYSPTIAG.min.js +0 -1
  249. package/dist/c-PWPJNYQP.min.js +0 -1
  250. package/dist/c-QZ5SWKHC.min.js +0 -392
  251. package/dist/c-RXJH4IRX.min.js +0 -41
  252. package/dist/c-SN2D6QMH.min.js +0 -1
  253. package/dist/c-U5YGK6HL.min.js +0 -1
  254. package/dist/c-VIN5ASK2.min.js +0 -37
  255. package/dist/c-XZ3GASUJ.min.js +0 -1
  256. package/dist/c-ZLZZTH4I.min.js +0 -118
@@ -1,12 +1,13 @@
1
- function e(e){return Object.prototype.hasOwnProperty.call(yl,e)?yl[e]:void 0}function t(e){let t={"--semiotic-bg":e.colors.background,"--semiotic-text":e.colors.text,"--semiotic-text-secondary":e.colors.textSecondary,"--semiotic-grid":e.colors.grid,"--semiotic-border":e.colors.border,"--semiotic-cell-border":e.colors.cellBorder||e.colors.border,"--semiotic-primary":e.colors.primary,"--semiotic-font-family":e.typography.fontFamily,"--semiotic-secondary":e.colors.secondary||e.colors.primary,"--semiotic-surface":e.colors.surface||e.colors.background};e.colors.categorical.forEach((e,r)=>{t[`--semiotic-category-${r+1}`]=e}),e.colors.focus&&(t["--semiotic-focus"]=e.colors.focus),e.colors.selection&&(t["--semiotic-selection-color"]=e.colors.selection),null!=e.colors.selectionOpacity&&(t["--semiotic-selection-opacity"]=String(e.colors.selectionOpacity)),e.colors.diverging&&(t["--semiotic-diverging"]=e.colors.diverging),e.colors.annotation&&(t["--semiotic-annotation-color"]=e.colors.annotation),e.colors.success&&(t["--semiotic-success"]=e.colors.success),e.colors.danger&&(t["--semiotic-danger"]=e.colors.danger),e.colors.warning&&(t["--semiotic-warning"]=e.colors.warning),e.colors.error&&(t["--semiotic-error"]=e.colors.error),e.colors.info&&(t["--semiotic-info"]=e.colors.info),e.tooltip?.background&&(t["--semiotic-tooltip-bg"]=e.tooltip.background),e.tooltip?.text&&(t["--semiotic-tooltip-text"]=e.tooltip.text),e.tooltip?.borderRadius&&(t["--semiotic-tooltip-radius"]=e.tooltip.borderRadius),e.tooltip?.fontSize&&(t["--semiotic-tooltip-font-size"]=e.tooltip.fontSize),e.tooltip?.shadow&&(t["--semiotic-tooltip-shadow"]=e.tooltip.shadow),e.borderRadius&&(t["--semiotic-border-radius"]=e.borderRadius);let r=e.typography.legendSize??e.typography.labelSize;null!=r&&(t["--semiotic-legend-font-size"]=`${r}px`),null!=e.typography.legendFontFamily&&(t["--semiotic-legend-font-family"]=e.typography.legendFontFamily),null!=e.typography.legendFontWeight&&(t["--semiotic-legend-font-weight"]=String(e.typography.legendFontWeight));let a=e.typography.titleFontSize??e.typography.titleSize;return null!=a&&(t["--semiotic-title-font-size"]=`${a}px`),null!=e.typography.titleFontFamily&&(t["--semiotic-title-font-family"]=e.typography.titleFontFamily),null!=e.typography.titleFontWeight&&(t["--semiotic-title-font-weight"]=String(e.typography.titleFontWeight)),null!=e.typography.tickFontFamily&&(t["--semiotic-tick-font-family"]=e.typography.tickFontFamily),null!=e.typography.tickSize&&(t["--semiotic-tick-font-size"]=`${e.typography.tickSize}px`),null!=e.typography.labelSize&&(t["--semiotic-axis-label-font-size"]=`${e.typography.labelSize}px`),t}function r(e,r=":root"){return`${r} {\n${Object.entries(t(e)).map(([e,t])=>` ${e}: ${t};`).join("\n")}\n}`}function a(e){return{semiotic:{bg:{$value:e.colors.background,$type:"color"},text:{$value:e.colors.text,$type:"color"},"text-secondary":{$value:e.colors.textSecondary,$type:"color"},grid:{$value:e.colors.grid,$type:"color"},border:{$value:e.colors.border,$type:"color"},primary:{$value:e.colors.primary,$type:"color"},focus:{$value:e.colors.focus||e.colors.primary,$type:"color"},"font-family":{$value:e.typography.fontFamily,$type:"fontFamily"},"border-radius":{$value:e.borderRadius||"8px",$type:"dimension"},tooltip:{bg:{$value:e.tooltip?.background||e.colors.background,$type:"color"},text:{$value:e.tooltip?.text||e.colors.text,$type:"color"},radius:{$value:e.tooltip?.borderRadius||"6px",$type:"dimension"},"font-size":{$value:e.tooltip?.fontSize||"14px",$type:"dimension"},shadow:{$value:e.tooltip?.shadow||"0 2px 8px rgba(0,0,0,0.15)",$type:"shadow"}},selection:{color:{$value:e.colors.selection||e.colors.primary,$type:"color"},opacity:{$value:e.colors.selectionOpacity??.2,$type:"number"}},categorical:{$value:e.colors.categorical,$type:"color",$description:"Categorical color palette"},sequential:{$value:e.colors.sequential,$type:"string",$description:"d3-scale-chromatic sequential scheme name"},...e.aesthetics?{aesthetics:{...e.aesthetics.name?{profile:{$value:e.aesthetics.name,$type:"string"}}:{},...null!=e.aesthetics.minimumScore?{"minimum-score":{$value:e.aesthetics.minimumScore,$type:"number"}}:{},weights:Object.fromEntries(Object.entries(e.aesthetics.weights??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),thresholds:Object.fromEntries(Object.entries(e.aesthetics.thresholds??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),rationales:Object.fromEntries(Object.entries(e.aesthetics.rationales??{}).map(([e,t])=>[e,{$value:t,$type:"string"}]))}}:{},...e.colors.diverging?{diverging:{$value:e.colors.diverging,$type:"string",$description:"d3-scale-chromatic diverging scheme name"}}:{},...e.colors.annotation?{"annotation-color":{$value:e.colors.annotation,$type:"color"}}:{},...null!=e.typography.legendSize?{"legend-font-size":{$value:`${e.typography.legendSize}px`,$type:"dimension"}}:{},...null!=e.typography.legendFontFamily?{"legend-font-family":{$value:e.typography.legendFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.legendFontWeight?{"legend-font-weight":{$value:e.typography.legendFontWeight,$type:"fontWeight"}}:{},"title-font-size":{$value:`${e.typography.titleFontSize??e.typography.titleSize}px`,$type:"dimension"},...null!=e.typography.titleFontFamily?{"title-font-family":{$value:e.typography.titleFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.titleFontWeight?{"title-font-weight":{$value:e.typography.titleFontWeight,$type:"fontWeight"}}:{},...null!=e.typography.tickFontFamily?{"tick-font-family":{$value:e.typography.tickFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.tickSize?{"tick-font-size":{$value:`${e.typography.tickSize}px`,$type:"dimension"}}:{},...null!=e.typography.labelSize?{"axis-label-font-size":{$value:`${e.typography.labelSize}px`,$type:"dimension"}}:{},secondary:{$value:e.colors.secondary||e.colors.primary,$type:"color"},surface:{$value:e.colors.surface||e.colors.background,$type:"color"},...e.colors.success?{success:{$value:e.colors.success,$type:"color"}}:{},...e.colors.danger?{danger:{$value:e.colors.danger,$type:"color"}}:{},...e.colors.warning?{warning:{$value:e.colors.warning,$type:"color"}}:{},...e.colors.error?{error:{$value:e.colors.error,$type:"color"}}:{},...e.colors.info?{info:{$value:e.colors.info,$type:"color"}}:{}}}}function i(e){if(null==e)return()=>{};let t="function"==typeof e?e:t=>t[e];return e=>s(t(e))}function n(e,t){let r=i(e),a=i(t);return(e,t)=>{let i=a(e);return{value:i,x:r(e),y:i,category:t}}}function o(e,t){let r=i(t??"value"),a=null==e?void 0:"function"==typeof e?e:t=>t[e];return e=>{let t=a?a(e):void 0;return{value:r(e),category:null==t?void 0:String(t)}}}function s(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){let t=Number(e);return Number.isFinite(t)?t:void 0}}function l(e,t,r){let a=null!=e.axis?r[e.axis]:null!=e.field?t[e.field]:r.value;if(void 0!==e.eq&&a!==e.eq||void 0!==e.ne&&a===e.ne||void 0!==e.in&&!e.in.includes(a))return!1;if(void 0===e.gt&&void 0===e.gte&&void 0===e.lt&&void 0===e.lte&&void 0===e.within&&void 0===e.outside)return!0;let i=s(a);if(!(void 0!==i&&(void 0===e.gt||i>e.gt)&&(void 0===e.gte||i>=e.gte)&&(void 0===e.lt||i<e.lt)&&(void 0===e.lte||i<=e.lte)))return!1;if(void 0!==e.within){let[t,r]=e.within;if(!(i>=t&&i<=r))return!1}if(void 0!==e.outside){let[t,r]=e.outside;if(!(i<t||i>r))return!1}return!0}function c(e,t,r){let a=e.when;return void 0===a||!0===a||!1!==a&&("function"==typeof a?a(t,r):l(a,t,r))}function u(e,t,r){if(!t||0===t.length)return{};let a={};for(let i of t){if(!c(i,e,r))continue;let t="function"==typeof i.style?i.style(e,r):i.style;t&&(a={...a,...t})}return a}function d(e,t,r,a=e=>e){let i=e??(()=>({}));return t&&0!==t.length?(e,n)=>{let o=a(e),s={...i(e,n)};return Object.assign(s,u(o,t,r(o,n))),s}:i}function h(e,t,r){return e&&0!==e.length?(a,i)=>{let n=u(a,e,t(a,i)),o=r?r(a,i):void 0;return o?{...n,...o}:n}:r}function p(e){let t=e.replace(/^#/,"");/^[a-f\d]{3}$/i.test(t)&&(t=t.split("").map(e=>e+e).join(""));let r=t.match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!r)return null;let[a,i,n]=[parseInt(r[1],16)/255,parseInt(r[2],16)/255,parseInt(r[3],16)/255],o=e=>e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4);return.2126*o(a)+.7152*o(i)+.0722*o(n)}function f(e,t){let r=p(e),a=p(t);return null===r||null===a?null:(Math.max(r,a)+.05)/(Math.min(r,a)+.05)}function m(e){return Math.min(255,Math.max(0,Math.round(e)))}function g(e){if("string"!=typeof e)return null;let t=e.trim().toLowerCase(),r=t.match(/^#([a-f\d]{3,4}|[a-f\d]{6}|[a-f\d]{8})$/i)?.[1];if(r){let e=r.length<=4?r.split("").map(e=>`${e}${e}`).join(""):r;return{r:Number.parseInt(e.slice(0,2),16),g:Number.parseInt(e.slice(2,4),16),b:Number.parseInt(e.slice(4,6),16),a:8===e.length?Number.parseInt(e.slice(6,8),16)/255:1}}let a=t.match(/^rgba?\(\s*(-?(?:\d+|\d*\.\d+))\s*,\s*(-?(?:\d+|\d*\.\d+))\s*,\s*(-?(?:\d+|\d*\.\d+))(?:\s*,\s*(-?(?:\d+|\d*\.\d+)))?\s*\)$/);if(!a)return null;let i=[Number(a[1]),Number(a[2]),Number(a[3])],n=void 0===a[4]?1:Number(a[4]);return i.some(e=>!Number.isFinite(e)||e<0||e>255)||!Number.isFinite(n)||n<0||n>1?null:{r:i[0],g:i[1],b:i[2],a:n}}function y(e,t){return t.a<1?null:{r:m(e.r*e.a+t.r*(1-e.a)),g:m(e.g*e.a+t.g*(1-e.a)),b:m(e.b*e.a+t.b*(1-e.a)),a:1}}function b(e){return e.a<1?null:`#${[e.r,e.g,e.b].map(e=>m(e).toString(16).padStart(2,"0")).join("")}`}function v(e){if("string"!=typeof e||""===e.trim())return;let t=g(e);return t?b(t)??`rgba(${m(t.r)},${m(t.g)},${m(t.b)},${t.a})`:e.trim().toLowerCase()}function w(e,t,r){let a=g(e),i=g(t);if(!a||!i)return null;let n=y({...a,a:a.a*Math.min(1,Math.max(0,r))},i);return n?b(n):null}function A(e){let t=g(e.backgroundColor),r=t?b(t):null,a=w(e.scaffoldColor,e.backgroundColor,e.scaffoldOpacity??1),i=a&&r?f(a,r):null,n=e.dataColors.map(t=>w(t,e.backgroundColor,1)).map(e=>e&&r?f(e,r):null).filter(e=>null!==e);if(null===i||n.length!==e.dataColors.length||0===n.length)return{ok:!0,status:"manual",method:"mark-to-scaffold-contrast",finding:{code:"VISUAL_HIERARCHY_MANUAL",status:"manual",message:"Visual hierarchy could not be computed from the supplied colors.",fix:"Resolve CSS variables, gradients, or named colors to solid colors and run the audit again."}};let o=Math.min(...n),s=o/i,l={weakestDataContrast:o,scaffoldContrast:i,hierarchyRatio:s},c=Math.max(1,e.minimumScaffoldContrast??1.1),u=Math.max(c,e.maximumScaffoldContrast??2),d=Math.max(1,e.minimumHierarchyRatio??2);return i<c?{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_VISIBILITY",status:"warn",message:"Reference scaffolding may be too faint to remain useful.",fix:"Increase grid or guide contrast while keeping it below the primary data marks."}}:o>=3&&i<=u&&s>=d?{ok:!0,status:"pass",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_DOMINANCE",status:"pass",message:"Primary data marks lead while reference scaffolding remains visible and subordinate."}}:{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_DOMINANCE",status:"warn",message:"Reference scaffolding competes with the primary data marks.",fix:"Increase mark contrast or lighten grid and guide colors until marks have at least twice the scaffold contrast."}}}function $(e){return Math.min(1,Math.max(0,e))}function x(e,t){return Number.isFinite(e)?e:t}function S(e){let t=e.thresholds??{},r=Math.max(1,x(t.scaffoldContrastMin,vl.scaffoldContrastMin)),a=$(x(t.emphasisRatioMin,vl.emphasisRatioMin));return{hierarchyRatio:Math.max(1,x(t.hierarchyRatio,vl.hierarchyRatio)),scaffoldContrastMin:r,scaffoldContrastMax:Math.max(r,x(t.scaffoldContrastMax,vl.scaffoldContrastMax)),titleScaleRatio:Math.max(1.01,x(t.titleScaleRatio,vl.titleScaleRatio)),categoricalColorMax:Math.max(1,Math.round(x(t.categoricalColorMax,vl.categoricalColorMax))),emphasisRatioMin:a,emphasisRatioMax:Math.max(a,$(x(t.emphasisRatioMax,vl.emphasisRatioMax)))}}function C(e){return v(e)}function k(e){return(Array.isArray(e)?e:e&&"object"==typeof e?Object.values(e):[e]).map(C).filter(e=>!!e)}function R(e){return Array.isArray(e)||e&&"object"==typeof e?k(e):[]}function P(e){return!(e.length<4)&&$l.some(t=>e.length===t.length&&e.every((e,r)=>e===t[r]))}function N(e){let t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,r=[...R(e.colorScheme),...k(e.color),...k(e.fill),...k(e.stroke),...k(t?.fill),...k(t?.stroke)],a=Array.isArray(e.styleRules)?e.styleRules:[];for(let e of a)!e.style||"function"==typeof e.style||r.push(...k(e.style.fill),...k(e.style.stroke));return Array.from(new Set(r))}function E(e){let t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,r=[...R(e.colorScheme),...k(e.color),...k(e.fill),...k(t?.fill)],a=Array.isArray(e.styleRules)?e.styleRules:[];for(let e of a)!e.style||"function"==typeof e.style||r.push(...k(e.style.fill));return Array.from(new Set(r))}function I(e,t){let r=Array.isArray(e.data)?e.data:[];return"string"==typeof t?Array.from(new Set(r.map(e=>String(e[t])))):"function"==typeof t?Array.from(new Set(r.map((e,r)=>String(t(e,r))))):[]}function T(e){let t=Array.isArray(e.data)?e.data:[],r=Array.isArray(e.styleRules)?e.styleRules:[],a="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",i="string"==typeof e.categoryAccessor?e.categoryAccessor:"category",n=[];for(let e of r)!e.style||"function"==typeof e.style||t.some((t,r)=>c(e,t,{value:Number(t[a]),category:String(t[i]??""),index:r}))&&n.push(...k(e.style.fill));return Array.from(new Set(n))}function M(e,t,r){let a=R(t.colorScheme),i=k(t.color),n=I(t,t.colorBy),o=Sl.has(e)?I(t,t.categoryAccessor??"category"):[],s=t.colorScheme&&"object"==typeof t.colorScheme&&!Array.isArray(t.colorScheme)?t.colorScheme:void 0,l=(e,t)=>e.map((e,a)=>C(s?.[e])??("gray"===t?"#999999":r.colors.categorical.length>0?r.colors.categorical[a%r.colors.categorical.length]:"#007bff")),c=n.length>0?s?l(n,"gray"):a.length>0?a:r.colors.categorical:i.length>0?i:o.length>0&&s?l(o,"theme"):a.length>0&&!s?a:r.colors.categorical,u=Math.max(1,n.length||o.length||1),d=n.length>0||o.length>0?c.slice(0,Math.min(c.length,u)):c.slice(0,1),h=T(t).filter(e=>!d.includes(e));return Array.from(/* @__PURE__ */new Set([...d,...h]))}function O(e){let t=e.colors.surface??e.colors.background,r=g(t),a=g(e.colors.background);if(!r)return t;if(1===r.a)return b(r)??t;if(!a)return t;let i=y(r,a);return i?b(i)??t:t}function F(e,t){if(!e.evidence)return.5;let{weakestDataContrast:r,scaffoldContrast:a,hierarchyRatio:i}=e.evidence;return Math.min($(r/3),$(a/t.scaffoldContrastMin),$(t.scaffoldContrastMax/a),$(i/t.hierarchyRatio))}function j(e,t,r,a,i,n,o){let s=r[e];return{id:e,label:Cl[e],status:0===s?"disabled":o??(t>=.8?"pass":"warn"),score:t,weight:s,contribution:t*s,message:a,...n?.[e]?{rationale:n[e]}:{},evidence:i}}function z(e){return Math.max(1,e.length)}function B(e){let t=Array.isArray(e.data)?e.data:[],r=Array.isArray(e.styleRules)?e.styleRules:[];if(0===t.length||0===r.length)return{ratio:0,authored:!1};let a="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",i="string"==typeof e.categoryAccessor?e.categoryAccessor:"category";return{ratio:t.filter((e,t)=>r.some(r=>c(r,e,{value:Number(e[a]),category:String(e[i]??""),index:t}))).length/t.length,authored:!0}}function L(e,t,r={}){let a=r.theme??hl,i=r.profile??a.aesthetics??wl,n={...bl,...i.weights??{}};for(let e of Object.keys(n)){let t=n[e];n[e]=Number.isFinite(t)?Math.max(0,t):0}let o=S(i),s=M(e,t,a),l=A({backgroundColor:O(a),dataColors:s,scaffoldColor:a.colors.grid,minimumHierarchyRatio:o.hierarchyRatio,minimumScaffoldContrast:o.scaffoldContrastMin,maximumScaffoldContrast:o.scaffoldContrastMax}),c=N(t),u=P(a.colors.categorical.map(C).filter(e=>!!e)),d=E(t),h="string"==typeof t.colorScheme?t.colorScheme.trim().toLowerCase():void 0,p=d.length>0||h?"chart":"theme",f="chart"===p?P(d)||!!h&&xl.has(h):u,m=f?.2:"chart"===p?1:.8,g=z(s),y=g<=o.categoricalColorMax?1:$(1-(g-o.categoricalColorMax)/o.categoricalColorMax),b=a.typography.titleFontSize??a.typography.titleSize,v=Math.max(a.typography.tickSize,a.typography.labelSize),w=v>0?b/v:1,k=$((w-1)/(o.titleScaleRatio-1)),R=new Set([...a.colors.categorical,a.colors.primary,a.colors.secondary,a.colors.background,a.colors.surface,a.colors.text,a.colors.textSecondary,a.colors.grid,a.colors.border,a.colors.annotation].map(C).filter(e=>!!e)),I=c.filter(e=>!R.has(e)).length,T=0===c.length?1:$(1-I/c.length),L=B(t),_=L.authored?L.ratio<o.emphasisRatioMin?$(L.ratio/o.emphasisRatioMin):L.ratio<=o.emphasisRatioMax?1:$(o.emphasisRatioMax/L.ratio):.35,D=[j("mark-scaffold-hierarchy",F(l,o),n,l.finding.message,{hierarchyRatio:l.evidence?.hierarchyRatio??0,markContrast:l.evidence?.weakestDataContrast??0,scaffoldContrast:l.evidence?.scaffoldContrast??0},i.rationales,l.status),j("palette-authorship",m,n,f?"theme"===p?"The chart inherits a ubiquitous categorical default without an organizational palette decision.":"The chart explicitly selects a ubiquitous categorical palette.":"The effective palette records an authored choice beyond the ubiquitous defaults.",{paletteSource:p,ubiquitousDefault:f,colorCount:s.length},i.rationales),j("palette-economy",y,n,`${g} color role(s) are used against a policy ceiling of ${o.categoricalColorMax}.`,{colorRoles:g,maximum:o.categoricalColorMax},i.rationales),j("typographic-hierarchy",k,n,`Title-to-supporting-type scale is ${w.toFixed(2)}×.`,{titleSize:b,supportingSize:v,ratio:w},i.rationales),j("theme-coherence",T,n,`${I} of ${c.length} explicit chart color(s) fall outside the theme vocabulary.`,{explicitColors:c.length,outsideTheme:I},i.rationales),j("editorial-emphasis",_,n,L.authored?`${Math.round(100*L.ratio)}% of marks receive authored emphasis.`:"No machine-visible editorial emphasis rule is declared.",{authored:L.authored,emphasizedRatio:L.ratio},i.rationales)],U=D.reduce((e,t)=>e+t.weight,0),V=D.reduce((e,t)=>e+t.contribution,0),G=0===U?null:V/U*100,H=100*$(x(i.minimumScore,wl.minimumScore??70)/100);return{component:e,profile:i.name??"Unnamed aesthetic profile",ok:null===G||G>=H,score:G,minimumScore:H,weightedPoints:V,totalWeight:U,features:D,method:"weighted-machine-visible-features"}}function _(e){if(e.length<2)return"days";let t=[];for(let r=1;r<e.length;r++)t.push(e[r]-e[r-1]);t.sort((e,t)=>e-t);let r=t[Math.floor(t.length/2)];return r<12e4?"seconds":r<72e5?"minutes":r<1728e5?"hours":r<5184e6?"days":r<3456e7?"months":"years"}function D(e){return e<10?`0${e}`:String(e)}function U(e={}){let t=e.timeZone;return"UTC"===t?{kind:"utc"}:"local"===t?{kind:"local"}:"string"==typeof t&&t.length>0?{kind:"iana",id:t}:!1===e.utc?{kind:"local"}:{kind:"utc"}}function V(e,t){return t?{month:e.getUTCMonth(),day:e.getUTCDate(),year:e.getUTCFullYear(),hours:e.getUTCHours(),minutes:e.getUTCMinutes(),seconds:e.getUTCSeconds()}:{month:e.getMonth(),day:e.getDate(),year:e.getFullYear(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}function G(e){let t;try{t=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hourCycle:"h23"})}catch{return e=>V(e,!0)}return e=>{let r={};for(let a of t.formatToParts(e))"literal"!==a.type&&(r[a.type]=a.value);return{month:Math.max(0,(Number(r.month)||1)-1),day:Number(r.day)||1,year:Number(r.year)||1970,hours:Number(r.hour)||0,minutes:Number(r.minute)||0,seconds:Number(r.second)||0}}}function H(e){return"utc"===e.kind?e=>V(e,!0):"local"===e.kind?e=>V(e,!1):G(e.id)}function q(e,t,r,a=Pl){let{month:i,day:n,year:o,hours:s,minutes:l,seconds:c}=r(e),u=Rl[i],d=D(s),h=D(l),p=D(c),f=a.year?`${u} ${n}, ${o} `:`${u} ${n} `;switch(t){case"seconds":return`${a.date?f:""}${d}:${h}:${p}`;case"minutes":case"hours":return`${a.date?f:""}${d}:${h}`;case"days":return a.year?`${u} ${n}, ${o}`:`${u} ${n}`;case"months":return a.year?`${u} ${o}`:`${u}`;case"years":return`${o}`}}function W(e,t,r,a,i=Pl,n=!1){let o=a(e),s=a(t),l=o.year!==s.year,c=l||o.month!==s.month,u=c||o.day!==s.day,d=u||o.hours!==s.hours,h=d||o.minutes!==s.minutes,p=i.date,f=l&&i.year,m=Rl[o.month],{day:g,year:y}=o,b=D(o.hours),v=D(o.minutes),w=D(o.seconds);switch(r){case"seconds":return f&&p?`${m} ${g}, ${y} ${b}:${v}:${w}`:u&&p?`${m} ${g} ${b}:${v}:${w}`:d||n?`${b}:${v}:${w}`:h?`${v}:${w}`:`:${w}`;case"minutes":return f&&p?`${m} ${g}, ${y} ${b}:${v}`:u&&p?`${m} ${g} ${b}:${v}`:d||n?`${b}:${v}`:`:${v}`;case"hours":return f&&p?`${m} ${g}, ${y} ${b}:${v}`:u&&p?`${m} ${g} ${b}:${v}`:`${b}:${v}`;case"days":return f?`${m} ${g}, ${y}`:c||n?`${m} ${g}`:`${g}`;case"months":return f?`${m} ${y}`:`${m}`;case"years":return`${y}`}}function Y(e,t={}){let r,a,i=e,n=H(U(t)),{includeYear:o="always",includeDate:s="always"}=t,l="clock"===t.deltaStyle,c="auto"===o?n(new Date(t.referenceTime??Date.now())).year:void 0,u={referenceYear:!1,oneDay:!1},d=e=>{if(e!==a){a=e;let t=e.map(e=>n(new Date(e))),[r]=t;u={referenceYear:t.every(e=>e.year===c),oneDay:t.every(e=>e.year===r.year&&e.month===r.month&&e.day===r.day)}}return u};return(t,a,c)=>{let h=t instanceof Date?t:new Date(t);!e&&c&&c.length>=2&&c!==r&&(r=c,i=_(c));let p=i||"days";if(null==a||!c||0===c.length)return q(h,p,n);let f="seconds"===p||"minutes"===p||"hours"===p,m="always"===o&&"always"===s?Pl:{year:"years"===p||"never"!==o,date:!f||"never"!==s};if(0===a){if(m===Pl)return q(h,p,n);let{referenceYear:e,oneDay:t}="auto"===o||"auto"===s?d(c):u,r=m.date&&!(f&&"auto"===s&&t),a=r&&m.year&&!("years"!==p&&"auto"===o&&e);return q(h,p,n,{year:a||"years"===p,date:r})}return W(h,new Date(c[a-1]),p,n,m,l)}}function K(e){if(null==e)return"";if("number"!=typeof e||!isFinite(e))return String(e);if(0===e)return"0";let t=parseFloat(e.toPrecision(12)),r=Math.abs(t);if(r>=1e4)for(let e=Nl.length-1;e>=0;e--){let[a,i]=Nl[e];if(r<a)continue;let n=parseFloat((t/a).toPrecision(3));if(Math.abs(n)>=1e3&&e<Nl.length-1){let[r,a]=Nl[e+1];return`${parseFloat((t/r).toPrecision(3))}${a}`}return`${n}${i}`}return Number.isInteger(t)?String(t):String(parseFloat(t.toPrecision(6)))}function J(e,t=0,r=1/0,a=0){let i=Number.isFinite(t)?t:0,n=Number.isFinite(r)?Math.max(i,r):1/0,o=Number.isFinite(e)?Math.floor(e):i,s=Math.max(i,Math.min(n,o));return a>0&&Number.isFinite(a)?Math.max(i,Math.min(n,Math.round(s/a)*a)):s}function X(e,t=.5){let r=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!r)return e;let a=Math.round(parseInt(r[1],16)*(1-t)),i=Math.round(parseInt(r[2],16)*(1-t)),n=Math.round(parseInt(r[3],16)*(1-t));return`#${a.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function Z(e,t=.5){let r=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!r)return e;let a=Math.round(parseInt(r[1],16)+(255-parseInt(r[1],16))*t),i=Math.round(parseInt(r[2],16)+(255-parseInt(r[2],16))*t),n=Math.round(parseInt(r[3],16)+(255-parseInt(r[3],16))*t);return`#${a.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function Q(e){let t=Number.isFinite(e)&&e>0?e:6;return{width:Math.max(8,t),height:t,lineY:t/2}}function ee(e){return{type:"hatch",background:e.background,stroke:e.stroke,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle,...1!==e.lineOpacity?{lineOpacity:e.lineOpacity}:{}}}function te(e,t){return typeof OffscreenCanvas<"u"?new OffscreenCanvas(e,t):(El||(El=document.createElement("canvas")),El.width=e,El.height=t,El)}function re(){let e=typeof window<"u"&&window.devicePixelRatio||1;return Math.min(3,Math.max(1,e))}function ae(e,t,r,a){t&&"transparent"!==t&&"none"!==t?(e.fillStyle=t,e.fillRect(0,0,r,a)):e.clearRect(0,0,r,a)}function ie(e={},t){let r,{background:a="transparent",stroke:i="#000",lineWidth:n=1.5,spacing:o=6,angle:s=45,lineOpacity:l=1}=e,c={background:a,stroke:i,lineWidth:n,spacing:o,angle:s,lineOpacity:l},u=Q(o),d=re(),h=Math.max(1,Math.round(u.width*d)),p=Math.max(1,Math.round(u.height*d));try{r=te(h,p)}catch{return ee(c)}let f=r.getContext("2d");if(!f)return ee(c);ae(f,a,h,p);let m=p/u.height,g=Math.max(0,n)*m;f.save(),f.globalAlpha=Math.min(1,Math.max(0,l)),f.fillStyle=i,f.fillRect(0,u.lineY*m-g/2,h,g),f.restore();let y=(t||f).createPattern(r,"repeat");if(!y)return y;let b=s*Math.PI/180,v=Math.cos(b),w=Math.sin(b),A=u.width/h,$=u.height/p;return y.setTransform?.({a:v*A,b:w*A,c:-w*$,d:v*$,e:0,f:0}),y}function ne(e,t=2166136261){let r=t;for(let t=0;t<e.length;t++)r^=e.charCodeAt(t),r=Math.imul(r,16777619);return r>>>0}function oe(e){return"object"==typeof e&&null!==e&&"hatch"===e.type}function se(e){return["hatch",e.background??"transparent",e.stroke??"#000",e.lineWidth??1.5,e.spacing??6,e.angle??45,e.lineOpacity??1].join("|")}function le(e,t){return`${e}-hatch-${ne(se(t)).toString(36)}`}function ce(e,t){let r=e.length,a=t.length,i=new Array(a+1);for(let e=0;e<=a;e++)i[e]=e;for(let n=1;n<=r;n++){let r=i[0];i[0]=n;for(let o=1;o<=a;o++){let a=i[o];i[o]=e[n-1]===t[o-1]?r:1+Math.min(r,i[o],i[o-1]),r=a}}return i[a]}function ue(e,t,r=3){let a,i=r+1;for(let r of t){let t=ce(e.toLowerCase(),r.toLowerCase());t<i&&(i=t,a=r)}return i<=r?a:void 0}function de(e){if(e.length<=3)return[...e];let t=Math.floor(e.length/2);return[e[0],e[t],e[e.length-1]]}function he(e,t){if(0===t.length)return null;let r=e.toLowerCase();return t.find(e=>e.toLowerCase().includes(r)||r.includes(e.toLowerCase()))||(ue(e,t,3)??null)}function pe(e){return` Or use a function: ${e}={d => d.myValue}.`}function fe({componentName:e,data:t,accessors:r,requiredProps:a}){if(a)for(let[t,r]of Object.entries(a))if(null==r)return`${e}: ${t} is required. Provide a field name or function.`;if(null==t)return null;if(!Array.isArray(t)&&"object"==typeof t)return`${e}: data should be an array, but received an object. If this is hierarchical data, use TreeDiagram, Treemap, or CirclePack instead.`;if(!Array.isArray(t)||0===t.length)return`${e}: No data provided. Pass a non-empty array to the data prop.`;if(r){let a=de(t).find(e=>e&&"object"==typeof e);if(a){let t=Object.keys(a);for(let[i,n]of Object.entries(r))if(n&&"string"==typeof n&&!(n in a)){let r=he(n,t),a=r?` Try ${i}="${r}".`:"";return`${e}: ${i} "${n}" not found in data. Available fields: ${t.join(", ")}.${a}`+pe(i)}}}return null}function me({componentName:e,data:t,dataLabel:r="data"}){return null==t?`${e}: No ${r} provided. Pass a hierarchical object with children: { name: "root", children: [...] }.`:Array.isArray(t)?`${e}: ${r} should be a single root object, not an array. Expected: { name: "root", children: [...] }. If you have flat data, use LineChart, BarChart, or Scatterplot instead.`:null}function ge({componentName:e,nodes:t,edges:r,nodesRequired:a=!1,edgesRequired:i=!0,accessors:n}){if(null==t&&null==r)return null;if(i&&(!r||!Array.isArray(r)||0===r.length))return`${e}: No edges provided. Pass a non-empty array: edges={[{ source: "A", target: "B", value: 10 }, ...]}.`;if(a&&(!t||!Array.isArray(t)||0===t.length))return`${e}: No nodes provided. Pass a non-empty array: nodes={[{ id: "A" }, { id: "B" }, ...]}.`;if(n&&t&&t.length>0){let r=de(t).find(e=>e&&"object"==typeof e);if(r){let t=Object.keys(r);for(let[a,i]of Object.entries(n))if(i&&"string"==typeof i&&!(i in r)){let r=he(i,t),n=r?` Try ${a}="${r}".`:"";return`${e}: ${a} "${i}" not found in node data. Available fields: ${t.join(", ")}.${n}`+pe(a)}}}return null}function ye(e){return Ol.has(e)}function be(e,t){return ye(e)&&!Fl[t].includes(e)}function ve(e){let[t,r]=Array.isArray(e)?e:[e,void 0],a=jl[t],i=Array.isArray(a)?[...a]:a;return void 0===r?{type:i}:{type:i,enum:[...zl[r]]}}function we(){return Object.fromEntries(Ll.map(([e,t,r,a,i],n)=>[Ml[n],{required:[...e],dataShape:t,dataAccessors:[...r],props:Object.fromEntries(Object.entries(Object.assign({},...a.map(e=>Bl[e]),i)).map(([e,t])=>[e,ve(t)]))}]))}function Ae(e){if(!Array.isArray(e))return[];let t=[];return e.forEach((e,r)=>{if(e&&"object"==typeof e&&!Array.isArray(e))for(let a of Object.keys(e)){if(Ul(a))continue;let i=e.orient;t.push({index:r,..."string"==typeof i&&{orient:i},key:a,suggestion:ue(a,Dl)})}}),t}function $e(e,t){let r=Array.isArray(t)?t:[t],a=Array.isArray(e)?"array":typeof e;return r.includes(a)}function xe(e,t){return"mechanical"===t.mode&&("GaltonBoardChart"===e||"UnitPileChart"===e)}function Se(e){if(!Array.isArray(e.thresholds))return[];let t=[];return 0===e.thresholds.length&&t.push('"thresholds" for GaugeChart must contain at least one { value, color, label? } object.'),e.thresholds.forEach((e,r)=>{if(!e||"object"!=typeof e||Array.isArray(e))return void t.push(`"thresholds[${r}]" for GaugeChart should be an object with numeric "value" and string "color".`);let a=e;("number"!=typeof a.value||!Number.isFinite(a.value))&&t.push(`"thresholds[${r}].value" is required for GaugeChart and must be a finite number. BigNumber's "at" threshold key is not supported here.`),("string"!=typeof a.color||0===a.color.length)&&t.push(`"thresholds[${r}].color" is required for GaugeChart and must be a non-empty string.`),void 0!==a.label&&"string"!=typeof a.label&&t.push(`"thresholds[${r}].label" for GaugeChart should be a string.`);let i=Object.keys(a).filter(e=>"value"!==e&&"color"!==e&&"label"!==e);i.length>0&&t.push(`"thresholds[${r}]" has unsupported GaugeChart key(s): ${i.join(", ")}. Use { value, color, label? }; { at, level } belongs to BigNumber.`)}),t}function Ce(e){let t=e.frameProps;return null==t||"object"!=typeof t||Array.isArray(t)?[]:[...ke(t.axes,"frameProps.axes"),...Re(t)]}function ke(e,t){return Ae(e).map(({index:e,key:r,suggestion:a})=>`Unknown "${t}[${e}]" key "${r}" is ignored.`+(a?` Did you mean "${a}"?`:""))}function Re(e){let t=e.legendLayout;if(null==t||"object"!=typeof t||Array.isArray(t))return null==t?[]:['"frameProps.legendLayout" should be object, got '+(Array.isArray(t)?"array":typeof t)+"."];let r=[],a=t,i=/* @__PURE__ */new Set(["align",...Object.keys(Gl)]);for(let e of Object.keys(a))i.has(e)||r.push(`Unknown "frameProps.legendLayout" key "${e}". Valid keys: ${[...i].join(", ")}.`);void 0!==a.align&&"string"!=typeof a.align?r.push(`"frameProps.legendLayout.align" should be string, got ${Array.isArray(a.align)?"array":typeof a.align}.`):"string"==typeof a.align&&!Vl.has(a.align)&&r.push(`"frameProps.legendLayout.align" value "${a.align}" is not valid. Expected one of: ${[...Vl].join(", ")}.`);for(let[e,t]of Object.entries(Gl)){let i=a[e];void 0!==i&&("number"==typeof i&&Number.isFinite(i)?i<t.minimum&&r.push(`"frameProps.legendLayout.${e}" should be ${t.label} (minimum ${t.minimum}), got ${i}.`):r.push(`"frameProps.legendLayout.${e}" should be ${t.label}, got ${Array.isArray(i)?"array":typeof i}.`))}return r}function Pe(e,t){let r=[];(null==t||"object"!=typeof t)&&(t={});let a=_l[e];if(!a)return{valid:!1,errors:[`Unknown component "${e}". Valid components: ${Object.keys(_l).join(", ")}`]};for(let i of a.required)(void 0===t[i]||null===t[i])&&r.push(`"${i}" is required for ${e}.`);"array"===a.dataShape&&Object.prototype.hasOwnProperty.call(a.props,"data")&&!a.required.includes("data")&&!xe(e,t)&&(void 0===t.data||null===t.data)&&r.push(`"data" is required for ${e}.`);for(let[e,i]of Object.entries(t)){if(null==i)continue;let t=a.props[e];if(t){if(!$e(i,t.type)){let a=Array.isArray(t.type)?t.type.join(" | "):t.type;r.push(`"${e}" should be ${a}, got ${Array.isArray(i)?"array":typeof i}.`);continue}t.enum&&"string"==typeof i&&!t.enum.includes(i)&&r.push(`"${e}" value "${i}" is not valid. Expected one of: ${t.enum.join(", ")}.`)}}let i=Object.keys(a.props),n=new Set(i);for(let a of Object.keys(t))if(void 0!==t[a]&&!n.has(a)){let t=ue(a,i),n=t?`Unknown prop "${a}" for ${e}. Did you mean "${t}"?`:`Unknown prop "${a}" for ${e}. Valid props: ${i.join(", ")}.`;r.push(n)}if(n.has("axes")&&r.push(...ke(t.axes,"axes")),"array"===a.dataShape){let i=t.data,n={};for(let e of a.dataAccessors){let r=t[e];"string"==typeof r&&(n[e]=r)}let o=fe({componentName:e,data:i,accessors:Object.keys(n).length>0?n:void 0});o&&r.push(o)}else if("object"===a.dataShape){let a=me({componentName:e,data:t.data});a&&r.push(a)}else if("network"===a.dataShape){let i=t.nodeIdAccessor??t.nodeIDAccessor??"id",n="string"==typeof i?{nodeIdAccessor:i}:void 0,o=ge({componentName:e,nodes:t.nodes,edges:t.edges,nodesRequired:a.required.includes("nodes"),edgesRequired:a.required.includes("edges"),accessors:n});o&&r.push(o)}return"GaugeChart"===e&&r.push(...Se(t)),"ScatterplotMatrix"===e&&null!=t.frameProps&&r.push('"frameProps" is not supported for ScatterplotMatrix; configure its matrix props directly.'),r.push(...Ce(t)),{valid:0===r.length,errors:r}}function Ne(e){let t=e>>>0;return function(){t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function Ee(e){if(null==e)return null;let t=e;return t.data??t.datum??e}function Ie(e){let t=Number(e);return Number.isFinite(t)?Math.max(0,t):0}function Te(e,t={}){let r=[],a=e.tokenSemantics,i=e.countStrategy,n=t.maxRecommendedTokens??("fixed-denominator"===i&&Ie(e.denominator)<=100?100:80);return a||r.push({code:"TOKEN_SEMANTICS_UNCLEAR",severity:"warning",message:"Every tokenized encoding should state what one token represents."}),i||r.push({code:"MISSING_COUNT_STRATEGY",severity:"warning",message:"Every tokenized encoding should state how token counts are produced."}),("icon"===e.tokenType||"glyph"===e.tokenType)&&("icon-only"===e.labelPolicy||"token-only"===e.labelPolicy)&&r.push({code:"ICON_ONLY_LABELS",severity:"warning",message:"Icons should supplement text labels, not replace them."}),null!=t.visibleTokens&&t.visibleTokens>n&&r.push({code:"TOO_MANY_VISIBLE_TOKENS",severity:"warning",message:`This encoding renders ${t.visibleTokens} visible tokens. Consider unitizing, sampling, or a hybrid bar/token view.`}),"decorative"===a&&("icon"===e.tokenType||"glyph"===e.tokenType)&&r.push({code:"DECORATIVE_PICTOGRAPHS",severity:"warning",message:"Decorative pictographs can harm recall and speed when they do not clarify the data."}),"unitized-measure"===a&&i&&"unitized"!==i&&r.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Unitized measures should use the unitized count strategy so each token has a stable value."}),"risk-case"===a&&i&&"fixed-denominator"!==i&&r.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Risk cases are usually clearest as a fixed-denominator natural frequency."}),("possible-outcome"===a||"posterior-sample"===a||"hypothetical-case"===a)&&i&&"quantile"!==i&&"sample"!==i&&"posterior-sample"!==i&&"random-sample"!==i&&r.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Outcome/sample tokens should come from quantiles or samples, not from a unitized magnitude."}),"unitized-measure"===a&&"unitized"===i&&null==e.unitValue&&null==e.unit&&r.push({code:"MISSING_UNIT_VALUE",severity:"warning",message:"Unitized measures should set unitValue so each token has a declared value."}),"unitized-measure"===a&&"unitized"===i&&!e.unitMeaning&&r.push({code:"MISSING_UNIT_MEANING",severity:"info",message:"Add unitMeaning so readers know what one full token represents."}),r}function Me(e){return"string"==typeof e?.type?e.type:""}function Oe(e){return!!e&&"object"==typeof e&&fc.has(Me(e))}function Fe(e){return Array.isArray(e?.disable)&&e.disable.includes("connector")}function je(e){return mc.has(Me(e))&&!Fe(e)}function ze(e,t,r={}){if("number"==typeof r.maxAnnotations&&Number.isFinite(r.maxAnnotations))return Math.max(0,Math.floor(r.maxAnnotations));if(!(e>0&&t>0))return 1/0;let a=r.areaPerAnnotation&&r.areaPerAnnotation>0?r.areaPerAnnotation:2e4;return Math.max(1,Math.round(e*t/a))}function Be(e){let t=e.provenance,r=e.id??e.stableId??t?.stableId;return null==r||""===r?void 0:String(r)}function Le(e){return e.length<=5?1:2}function _e(e,{dataKeys:t=[],accessorFields:r=[]}={}){if(!Array.isArray(e))return[];let a=/* @__PURE__ */new Set([...t,...r]),i=[];return e.forEach((e,t)=>{if(e&&"object"==typeof e&&!Array.isArray(e))for(let r of Object.keys(e)){if(yc.has(r)||a.has(r)||r.startsWith("_")||r.length<3)continue;let n,o=Le(r)+1;for(let e of gc){let t=ce(r.toLowerCase(),e.toLowerCase());t<o&&(n=e,o=t)}if(!n)continue;let s=e.type;i.push({index:t,type:"string"==typeof s?s:"",key:r,suggestion:n})}}),i}function De(e,t,r){let a=Array.isArray(t.annotations)?t.annotations:null;if(a)for(let e of a)!e||"object"!=typeof e||"widget"!==Me(e)||null==e.content||Be(e)||r.push({severity:"warning",code:"ANNOTATION_INTERACTIVE_ID",message:"An interactive widget annotation has no stable id, so its activation cannot be normalized or replayed reliably.",fix:"Add id, stableId, or provenance.stableId to the widget annotation. Do not identify interactive annotations by array index."})}function Ue(e,t,r){let a=Array.isArray(t.annotations)?t.annotations:null;if(a)for(let e of a){if(!e||"object"!=typeof e)continue;let t=Me(e);if(!Oe(e)||"widget"===t)continue;let a="number"==typeof e.dx?e.dx:0,i="number"==typeof e.dy?e.dy:0,n=Math.hypot(a,i),o="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:t,s=je(e);!s&&n>120?r.push({severity:"warning",code:"ANNOTATION_FAR_NO_CONNECTOR",message:`Annotation "${o}" sits ~${Math.round(n)}px from its anchor with no connector — a reader can't tell what it refers to.`,fix:'Add a connector (connector: { end: "arrow" }, the label/callout default) or place the note adjacent to its target (smaller dx/dy).'}):s&&n>250&&r.push({severity:"warning",code:"ANNOTATION_LONG_CONNECTOR",message:`Annotation "${o}" uses a very long connector (~${Math.round(n)}px); prefer placing the note adjacent to its target when space allows.`,fix:"Reduce dx/dy so the note sits near its target, or keep the long connector only if proximity is genuinely infeasible."})}}function Ve(e,t,r){let a=Array.isArray(t.annotations)?t.annotations:null;if(!a)return;let i=a.filter(Oe).length;if(0===i)return;let n="number"==typeof t.width?t.width:600,o="number"==typeof t.height?t.height:400,s=ze(n,o);!Number.isFinite(s)||i<=s||r.push({severity:"warning",code:"ANNOTATION_DENSITY",message:`${i} note annotations on a ${n}×${o} chart exceed the ~${s} notes the plot area carries comfortably — the chart may read as cluttered.`,fix:'Mark the essential notes emphasis: "primary" and let density management shed the rest (autoPlaceAnnotations: { density: true }), enable progressive disclosure to reveal secondary notes on hover, or give the chart more room.'})}function Ge(e,t,r){if(!Array.isArray(t.annotations)||0===t.annotations.length)return;let a=/* @__PURE__ */new Set;for(let e of[t.data,t.nodes,t.edges,t.points,t.areas])if(Array.isArray(e))for(let t of e)if(t&&"object"==typeof t)for(let e of Object.keys(t))a.add(e);let i=Object.entries(t).filter(([e,t])=>/Accessor$|By$/.test(e)&&"string"==typeof t).map(([,e])=>e);for(let e of _e(t.annotations,{dataKeys:a,accessorFields:i})){let t=e.type?` ${e.type}`:"";r.push({severity:"warning",code:"ANNOTATION_UNKNOWN_FIELD",message:`annotations[${e.index}]${t} has an unknown field "${e.key}", which no renderer reads.`,fix:`Did you mean "${e.suggestion}"? Rename the field; unknown annotation fields are ignored.`})}}function He(e,t,r){for(let e of bc){let a=t[e];if(!Array.isArray(a)||a.length<2)continue;let[i,n]=a;"number"!=typeof i||"number"!=typeof n||i>n&&r.push({severity:"warning",code:"INVERTED_AXIS",message:`${e}=[${i}, ${n}] is descending — the axis renders inverted, so "up" reads as less. Inverted axes are a classic misleading-design pattern unless the inversion is the point.`,fix:`Order the extent ascending (${e}={[${n}, ${i}]}). If the inversion is deliberate (e.g. rank #1 at top), say so in the title or an annotation so readers aren't misled.`})}}function qe(e,t,r){if("MultiAxisLineChart"!==e)return;let a=t.series;if(!Array.isArray(a)||2!==a.length)return;let i=a.filter(e=>!e||"object"!=typeof e||"string"!=typeof e.label||0===e.label.trim().length);i.length>0&&r.push({severity:"warning",code:"DUAL_AXIS_UNLABELED",message:`Dual-axis chart with ${i.length} unlabeled series. Two y-scales invite false equivalence between the lines; without per-series labels a reader can't tell which scale is whose.`,fix:'Give every series a label: series={[{ yAccessor: "a", label: "Revenue ($)" }, { yAccessor: "b", label: "Users" }]} — and consider whether two separate charts read more honestly.'})}function We(e,t,r){if(!Kl.has(e))return;let a=t.xExtent;if(!Array.isArray(a)||a.length<2)return;let[i,n]=a;if("number"!=typeof i||"number"!=typeof n||i>=n)return;let o=t.data;if(!o||!Array.isArray(o)||o.length<4)return;let s=t.xAccessor??"x";if("string"!=typeof s)return;let l=1/0,c=-1/0;for(let e of o){let t=e?.[s];"number"!=typeof t||!Number.isFinite(t)||(t<l&&(l=t),t>c&&(c=t))}if(!Number.isFinite(l)||!Number.isFinite(c)||c<=l)return;let u=c-l,d=Math.max(0,Math.min(n,c)-Math.max(i,l))/u;d<.7&&r.push({severity:"warning",code:"CHERRY_PICKED_WINDOW",message:`xExtent=[${i}, ${n}] shows only ~${Math.round(100*d)}% of the data's x range [${l}, ${c}] — a trend cropped to a favorable window is a classic misleading-design pattern.`,fix:'Widen xExtent to cover the data, filter the data itself so the chart shows what it has, or annotate the visible window ("Q4 only") so the cropping is explicit.'})}function Ye(e,t,r){let a=Ql[e],i=tc[e];if(!a&&!i||i&&!t.normalize)return;let n=a??i,o=t[n],s="string"==typeof o?o:"yAccessor"===n?"y":"value",l=t.data;if(!l||!Array.isArray(l)||0===l.length)return;let c=l.filter(e=>{let t=e?.[s];return"number"==typeof t&&t<0});c.length>0&&r.push({severity:a?"error":"warning",code:"PART_TO_WHOLE_NEGATIVE",message:`${c.length} negative value(s) in "${s}" — a part-to-whole encoding cannot represent negative parts${a?"; slice angles/areas for negatives are meaningless":"; normalized shares distort when parts are negative"}.`,fix:a?"Filter or transform negative values first, or switch to a BarChart/WaterfallChart, which encode signed values honestly.":"Drop normalize for signed data, or use a diverging BarChart so negative contributions read as negative."})}function Ke(e,t,r){Xl.has(e)&&"basis"===t.curve&&r.push({severity:"warning",code:"NON_PASSING_CURVE",message:'curve="basis" draws a B-spline that does NOT pass through your data points — rendered values differ from actual values everywhere except the endpoints.',fix:'Use curve="monotoneX" or curve="catmullRom" (both interpolate through every point), or keep "basis" only for deliberately schematic, clearly-labeled smoothing.'})}function Je(e,t,r){if("LineChart"!==e&&"AreaChart"!==e||"sparkline"===t.mode||t.responsiveWidth||t.responsiveHeight)return;let a="number"==typeof t.width?t.width:600,i="number"==typeof t.height?t.height:400;if(a<=0||i<=0)return;let n=a/i;if(n>8||n<.25){let e=n>8?"flattens":"exaggerates";r.push({severity:"warning",code:"EXTREME_ASPECT_RATIO",message:`${a}×${i} (${n.toFixed(1)}:1) is an extreme aspect ratio that ${e} the slopes a reader perceives — aspect-ratio distortion is a documented misleading-design pattern.`,fix:n>8?'Use a more balanced aspect (e.g. width/height between 1 and 3), or set mode="sparkline" if this is genuinely a sparkline strip.':"Use a more balanced aspect (e.g. width/height between 1 and 3); very tall trend charts overstate every change."})}}function Xe(e,t,r){if(!Zl.has(e))return;let a=t.data;if(!a||!Array.isArray(a)||0===a.length)return;let i=t.categoryAccessor,n="string"==typeof i?i:"category",o=/* @__PURE__ */new Set;for(let e of a){let t=e?.[n];null!=t&&o.add(t)}o.size>8&&r.push({severity:"warning",code:"PIE_TOO_MANY_SLICES",message:`${o.size} slices — angle judgments degrade rapidly past ~8 categories (Cleveland & McGill), and thin slices become unreadable and unlabelable.`,fix:`Use a BarChart or DotPlot for ${o.size} categories, or group the long tail into an "Other" slice before charting.`})}function Ze(e,t,r){if(!Wl.has(e)&&!ql.has(e)&&!/^(Process|Network)(Sankey|CustomChart)$/.test(e))return;let a=t.perspective;"ProcessSankey"===e&&a&&"flat"!==a&&"flat"!==a.type&&r.push({severity:"warning",code:"PERSPECTIVE_MEASURED_POSITION",message:"ProcessSankey positions flows on a time axis; perspective foreshortens it, so equal durations stop looking equal.",fix:"Keep ProcessSankey flat when readers compare durations, or pair it with a flat view."}),void 0!==t.projection&&r.push({severity:"warning",code:"NETWORK_PROJECTION_PROP",message:`${e} has no projection prop (that is the geo map projection).`,fix:'Use perspective instead, e.g. perspective="isometric".'})}function Qe(e,t,r){return"function"==typeof r?r(e,t):e[r]}function et(e){if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?t:null}let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function tt(e,t,r){return Math.max(t,Math.min(r,e))}function rt(e,t){let r=et(e);return null!=r&&r>0?r:t}function at(e){if(!e)return;let t=et(e[0]),r=et(e[1]);return null!=t&&null!=r?t<=r?[t,r]:[r,t]:void 0}function it(e={}){let t=(e.categories?.length?e.categories:["Intake","Review","Build","Ship"]).map(e=>String(e).trim()).filter(Boolean),r=t.length?t:["Intake"],a=Math.max(r.length,Math.round(e.count??Math.max(48,12*r.length))),i=rt(e.unitValue,1),n=Ne(e.seed??1),o=e.idPrefix??"mechanical-pile",s=r.map(()=>.65+.9*n()),l=s.reduce((e,t)=>e+t,0)||1,c=a-r.length,u=s.map(e=>e/l*c),d=u.map(e=>1+Math.floor(e)),h=a-d.reduce((e,t)=>e+t,0),p=u.map((e,t)=>({index:t,fraction:e-Math.floor(e)})).sort((e,t)=>t.fraction-e.fraction);for(let e=0;h>0;e=(e+1)%p.length)d[p[e].index]+=1,h-=1;return r.map((e,t)=>({id:`${o}-${t}`,category:e,value:d[t]*i,mechanical:!0,unitCount:d[t],unitValue:i,share:d[t]/a}))}function nt(e,t){let r=e/t,a=Math.round(r);return Math.ceil(a>0&&Math.abs(r-a)<=Number.EPSILON*r*4?a:r)}function ot(e,t,r=0){let a=new Set(e.filter(e=>null!=e.id).map(e=>String(e.id))),i=/* @__PURE__ */new Map;for(let n of e){let e=null==n.id?`${t}-${r++}`:String(n.id);for(;null==n.id&&a.has(e);)e=`${t}-${r++}`;a.add(e),i.set(e,null==n.id?{...n,id:e}:n)}return{seed:e,rows:Array.from(i.values()),nextId:r}}function st(e){let t=e instanceof Date?e.getTime():Number(e);return Number.isFinite(t)?t:null}function lt(e,t,r){return"function"==typeof t?t(e):e?.["string"==typeof t?t:r]}function ct(e,t,r){if(lc.has(e)){if("GaltonBoardChart"===e){let e=t.bins;"number"==typeof e&&e<2&&r.push({severity:"error",code:"PHYSICS_BAD_BINS",message:`bins=${e} leaves no meaningful settled projection for a Galton board.`,fix:"Use at least two bins; 8-24 bins is a practical range for physics distributions."});let a=st(t.branchProbability);null!=t.branchProbability&&(null==a||a<0||a>1)&&r.push({severity:"error",code:"PHYSICS_BAD_BRANCH_PROBABILITY",message:`branchProbability=${String(t.branchProbability)} must be between 0 and 1.`,fix:"Use branchProbability={0.5} for a balanced Galton board, or bias it within the [0, 1] range."});let i=st(t.mechanicalCount);null!=t.mechanicalCount&&(null==i||i<=0)&&r.push({severity:"error",code:"PHYSICS_BAD_MECHANICAL_COUNT",message:`mechanicalCount=${String(t.mechanicalCount)} cannot generate a mechanical Galton board.`,fix:"Use a positive mechanicalCount, for example 96."})}if("EventDropChart"===e){let e=t.windows,a=e&&"object"==typeof e?st(e.size):null;null!=a&&a<=0&&r.push({severity:"error",code:"PHYSICS_BAD_WINDOW_SIZE",message:`windows.size=${a} cannot form event-time barriers.`,fix:"Set windows={{ size: positiveNumber }} so each event can settle into a real time window."}),"number"==typeof t.timeScale&&t.timeScale<=0&&r.push({severity:"error",code:"PHYSICS_BAD_TIME_SCALE",message:`timeScale=${t.timeScale} prevents arrival replay from advancing.`,fix:"Use a positive timeScale, or omit it for the default pace."});let i=Array.isArray(t.data)?t.data:[];if(i.length>0){let e=t.timeAccessor||"time",a=t.arrivalAccessor||"arrivalTime";i.some(t=>{let r=st(lt(t,e,"time")),i=st(lt(t,a,"arrivalTime"));return null!=r&&null!=i&&r!==i})||r.push({severity:"warning",code:"PHYSICS_EVENTDROP_NO_ARRIVAL_SPREAD",message:"EventDropChart data does not show distinct arrival times, so the physics replay collapses to event order.",fix:"Provide an arrivalAccessor field with event-arrival times when demonstrating lateness, watermarks, or out-of-order streams."})}}if("UnitPileChart"===e){let e="mechanical"===(t.simulationMode??t.mode),a=st(t.mechanicalCount);null!=t.mechanicalCount&&(null==a||a<=0)&&r.push({severity:"error",code:"PHYSICS_BAD_MECHANICAL_COUNT",message:`mechanicalCount=${String(t.mechanicalCount)} cannot generate a mechanical pile chart.`,fix:"Use a positive mechanicalCount, for example 80."}),e&&Array.isArray(t.mechanicalCategories)&&0===t.mechanicalCategories.length&&r.push({severity:"error",code:"PHYSICS_EMPTY_MECHANICAL_CATEGORIES",message:"mechanicalCategories=[] leaves no containers for the generated unit pile.",fix:"Provide at least one category label, or omit mechanicalCategories for the default set."});let i=et(t.unitValue??1);if(null==i||i<=0)return void r.push({severity:"error",code:"PHYSICS_BAD_UNIT_VALUE",message:`unitValue=${t.unitValue} cannot unitize values into physical bodies.`,fix:"Set unitValue to a positive number represented by one body."});let n=e?it({count:a??void 0,categories:Array.isArray(t.mechanicalCategories)?t.mechanicalCategories:void 0,seed:et(t.seed)??1,unitValue:i}):Array.isArray(t.data)?t.data:[],{rows:o}=ot(n,"pile"),s=t.valueAccessor??(e?"value":void 0),l=o.reduce((e,t,r)=>{let a="function"==typeof s?s(t,r):"string"==typeof s&&s?t[s]:1;return e+nt(Math.max(0,et(a)??0),i)},0);l>1500&&r.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`UnitPileChart would create about ${l} live bodies; motion may dominate the chart and stress the frame budget.`,fix:"Sample or aggregate source records, or use a bounded window with sediment. A larger unitValue reduces full circles but still leaves at least one body per positive source record."})}if("CollisionSwarmChart"===e){if((st(t.pointRadius??5)??5)<=0&&r.push({severity:"error",code:"PHYSICS_BAD_POINT_RADIUS",message:`pointRadius=${t.pointRadius} cannot produce collision bodies.`,fix:"Use a positive pointRadius, for example 5."}),(st(t.collisionIterations??6)??6)<=0&&r.push({severity:"error",code:"PHYSICS_BAD_COLLISION_ITERATIONS",message:`collisionIterations=${t.collisionIterations} disables collision relaxation.`,fix:"Use at least one collision iteration; 4-8 is a practical range for swarms."}),null!=t.xExtent){let e=Array.isArray(t.xExtent)?t.xExtent:[],a=st(e[0]),i=st(e[1]);(e.length<2||null==a||null==i)&&r.push({severity:"error",code:"PHYSICS_BAD_X_EXTENT",message:"xExtent must be a numeric [min, max] pair for CollisionSwarmChart.",fix:"Pass xExtent={[min, max]} or omit it so the chart infers the domain from data."})}let e=Array.isArray(t.data)?t.data:[];e.length>1200&&r.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`CollisionSwarmChart would create ${e.length} live bodies; collision relaxation may dominate the frame budget.`,fix:"Sample, aggregate, reduce point radius, or move to a static SwarmPlot when every row does not need a physical body."});let a=t.groupAccessor;if(e.length>0&&a){let t=/* @__PURE__ */new Set;for(let r of e){let e=lt(r,a,"group");null!=e&&t.add(e)}t.size>12&&r.push({severity:"warning",code:"PHYSICS_TOO_MANY_SWARM_LANES",message:`CollisionSwarmChart has ${t.size} group lanes, which leaves little vertical room for collision separation.`,fix:"Facet or filter groups, or use an ordinary SwarmPlot/BoxPlot for dense grouped comparison."})}}if(("GaltonBoardChart"===e||"UnitPileChart"===e||"CollisionSwarmChart"===e||"ProcessFlowChart"===e||"EventDropChart"===e)&&(null!=t.massBy||null!=t.massAccessor||t.frameProps&&"object"==typeof t.frameProps&&null!=t.frameProps.bodyMassBy)&&r.push({severity:"warning",code:"PHYSICS_DATA_IN_DYNAMICS",message:`${e} appears to map a data field to mass/dynamics. Mass is not a readable quantitative channel.`,fix:"Encode quantities in spawn position, bin, size, color, or glyph — keep mass/friction/restitution as process texture. Use showProjection for the truth layer."}),("UnitPileChart"===e||"GaltonBoardChart"===e||"CollisionSwarmChart"===e||"ProcessFlowChart"===e||"CrucibleChart"===e)&&!1===t.showProjection&&r.push({severity:"warning",code:"PHYSICS_NO_PROJECTION",message:`${e} has showProjection={false}. Without a settled projection, motion is easy to over-read as data.`,fix:"Keep showProjection enabled (default) so the chart collapses to a legible static reading, or document why the process alone is the claim."}),"ProcessFlowChart"===e){let e=Array.isArray(t.stages)?t.stages:[];if(0===e.length)r.push({severity:"error",code:"PROCESS_FLOW_MISSING_STAGES",message:"ProcessFlowChart requires a non-empty stages array.",fix:'Provide stages={[{ id: "coding", force: 12 }, { id: "merged", absorb: true }]}.'});else{e.some(e=>!e||null==e.id||""===String(e.id).trim())&&r.push({severity:"error",code:"PROCESS_FLOW_BAD_STAGE",message:"Every ProcessFlowChart stage needs a stable id.",fix:'Use stages like { id: "review", label: "Review", capacity: { unitsPerSecond: 4 } }.'});let a=e.filter(e=>e?.absorb).length;t.groupBy&&0===a&&r.push({severity:"warning",code:"PROCESS_FLOW_GROUP_NO_ABSORB",message:"groupBy is set but no stage has absorb: true, so all-members completion cannot resolve.",fix:'Mark a terminal stage with absorb: true (e.g. merged), or set groupCompletion="none".'})}}if("GauntletChart"===e&&(Array.isArray(t.negativeProperties)||r.push({severity:"warning",code:"GAUNTLET_MISSING_NEGATIVE_PROPERTIES",message:"GauntletChart usually needs negativeProperties for drag/cost bodies (empty array is ok if intentional).",fix:'Provide negativeProperties={[{ id: "cost", label: "Cost", load: 1 }]} or explicitly pass [].'})),"CrucibleChart"===e){let e=Array.isArray(t.phases)?t.phases:[],a=Array.isArray(t.products)?t.products:[],i=Array.isArray(t.events)?t.events:[],n=Array.isArray(t.outlets)?t.outlets:[];0===e.length?r.push({severity:"error",code:"CRUCIBLE_MISSING_PHASES",message:"CrucibleChart requires an authored, non-empty phases array; a treatment program cannot be inferred from flat data.",fix:'Provide phases={[{ id: "charge", label: "Charge", duration: 1, motion: "charge" }]}.'}):e.some(e=>!e||null==e.id||""===String(e.id).trim()||null==st(e.duration)||Number(e.duration)<=0)&&r.push({severity:"error",code:"CRUCIBLE_BAD_PHASE",message:"Every CrucibleChart phase needs a stable id and a positive finite duration.",fix:'Use phases like { id: "assay", label: "Assay", duration: 2, motion: "mix" }.'}),0===a.length&&r.push({severity:"warning",code:"CRUCIBLE_NO_PRODUCTS",message:"CrucibleChart has no declared product molds. Products are never discovered from collisions or source fields.",fix:'Declare products={[{ id: "accepted", label: "Accepted", outletId: "product" }]} when the treatment forms an output.'}),0===i.length&&r.push({severity:"warning",code:"CRUCIBLE_NO_EVENTS",message:"CrucibleChart has no authored events, so its phases cannot transform, combine, split, or route the charge.",fix:"Supply an explicit events array; do not ask the chart or an AI layer to infer a treatment from the rows."}),Array.isArray(t.outlets)||r.push({severity:"warning",code:"CRUCIBLE_IMPLICIT_OUTLETS",message:"CrucibleChart is using generic default outlets rather than domain-specific destinations.",fix:"Provide reason-labelled outlets and reference their ids from products, complete-product, and eject effects."});let o=new Set(a.map(e=>e?.id).filter(e=>null!=e).map(String)),s=/* @__PURE__ */new Set(["product","retained","residue","failed","recovered",...n.map(e=>e?.id).filter(e=>null!=e).map(String)]),l=/* @__PURE__ */new Set,c=/* @__PURE__ */new Set;for(let e of i)if(e&&Array.isArray(e.effects))for(let t of e.effects){if(!t||"object"!=typeof t)continue;let e=t.type;if(("combine"===e||"contribute"===e||"complete-product"===e)&&null!=t.productId&&!o.has(String(t.productId))&&l.add(String(t.productId)),"split"===e&&Array.isArray(t.products))for(let e of t.products)null!=e?.productId&&!o.has(String(e.productId))&&l.add(String(e.productId));null!=t.outletId&&!s.has(String(t.outletId))&&c.add(String(t.outletId))}l.size>0&&r.push({severity:"error",code:"CRUCIBLE_UNKNOWN_PRODUCT",message:`CrucibleChart events reference undeclared product molds: ${[...l].sort().join(", ")}.`,fix:"Declare every referenced product id in products; do not create product definitions implicitly inside events."}),c.size>0&&r.push({severity:"error",code:"CRUCIBLE_UNKNOWN_OUTLET",message:`CrucibleChart events reference undeclared outlets: ${[...c].sort().join(", ")}.`,fix:"Declare every domain outlet in outlets and reuse its stable id in authored effects."});let u=st(t.playbackRate);null!=t.playbackRate&&(null==u||u<=0)&&r.push({severity:"error",code:"CRUCIBLE_BAD_PLAYBACK_RATE",message:`playbackRate=${String(t.playbackRate)} cannot advance the authored CrucibleChart tape.`,fix:"Use a positive playbackRate such as 0.5 for half speed or 2 for double speed."});let d=st(t.rerunMS);null!=t.rerunMS&&(null==d||d<0)&&r.push({severity:"error",code:"CRUCIBLE_BAD_RERUN_MS",message:`rerunMS=${String(t.rerunMS)} must be a finite non-negative delay or null.`,fix:"Use rerunMS={3000}, rerunMS={0}, or omit the prop for a single run."})}if("GaltonBoardChart"===e||"CollisionSwarmChart"===e||"ProcessFlowChart"===e||"EventDropChart"===e||"CrucibleChart"===e){let a=Array.isArray(t.data)?t.data:[],i=st(t.mechanicalCount)??0,n=a.length>0?a.length:i;n>2500&&r.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`${e} may spawn ~${Math.round(n)} live bodies, which can overwhelm the simulation loop.`,fix:"Lower mechanicalCount / unitize with a larger unitValue, enable sediment/windowSize, or sample the data before spawn."})}}}function ut(e){let t=e.trim();if(!t||!Number.isNaN(Number(t)))return NaN;let r=vc.exec(t);if(r){let e=Number(r[1]),t=Number(r[2])-1,a=Number(r[3]??1),i=/* @__PURE__ */new Date(0);return i.setUTCFullYear(e,t,a),i.getUTCFullYear()===e&&i.getUTCMonth()===t&&i.getUTCDate()===a?i.getTime():NaN}if(t.length<10)return NaN;let a=Date.parse(t);return Number.isFinite(a)?a:NaN}function dt(e){if(e instanceof Date)return e.getTime();if("number"==typeof e)return Number.isFinite(e)?e:NaN;if("string"!=typeof e||!e.trim())return NaN;let t=e.trim(),r=Number(t);if(!Number.isNaN(r))return Number.isFinite(r)?r:NaN;if(/^\d{4}-\d{1,2}(?:-\d{1,2})?$/.test(t))return ut(t);let a=/^(\d{4}-\d{2}-\d{2})[Tt ](\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)([Zz]|[+-]\d{2}:?\d{2})?$/.exec(t);return a&&Number.isFinite(ut(a[1]))?Date.parse(`${a[1]}T${a[2]}${a[3]||"Z"}`):NaN}function ht(e){let t=[],r=e.domain,a=Array.isArray(r)?dt(r[0]):NaN,i=Array.isArray(r)?dt(r[1]):NaN;null==r?t.push({severity:"error",code:"PROCESS_SANKEY_MISSING_DOMAIN",message:"ProcessSankey requires domain: [tStart, tEnd].",fix:"Pass domain={[start, end]} using numbers, Dates, numeric strings, or ISO date strings."}):(!Array.isArray(r)||2!==r.length||!Number.isFinite(a)||!Number.isFinite(i)||a>i)&&t.push({severity:"error",code:"PROCESS_SANKEY_BAD_DOMAIN",message:"domain must be a 2-tuple of finite times with start <= end.",fix:"Use domain={[t0, t1]} with t0 <= t1."});let n=e.edges;if(Array.isArray(n)&&n.length>0){let e=n[0];(null==e.startTime||null==e.endTime)&&t.push({severity:"warning",code:"PROCESS_SANKEY_EDGE_TIMES",message:"Edges should carry startTime and endTime for temporal layout.",fix:"Add startTime/endTime fields or set startTimeAccessor/endTimeAccessor."})}let o=e.nodes,s=Array.isArray(o)?o.length:0;return!0===e.showLabels&&s>=24&&t.push({severity:"warning",code:"PROCESS_SANKEY_LABEL_DENSITY",message:`showLabels={true} with ${s} nodes may overcrowd the plot.`,fix:'Use showLabels="auto" with optional labelPriorityAccessor / maxLabels.'}),(Array.isArray(n)?n.length:0)>=80&&null==e.layoutExecution&&"off"!==e.packing&&t.push({severity:"warning",code:"PROCESS_SANKEY_WORKER_HINT",message:"Dense ProcessSankey layouts benefit from worker packing/order.",fix:'layoutExecution defaults to "auto"; set layoutExecution="worker" or raise layoutWorkerThreshold deliberately.'}),t}function pt(e,t){let r=e.nestedDataAccessorProp?t[e.nestedDataAccessorProp]:void 0;return"string"==typeof r?r:e.defaultNestedDataAccessor}function ft(e,t,r){let a=e.dataProp??"data",i=t[a],n=r??(Array.isArray(i)?i:[]),o=pt(e,t);if(!o)return{dataProp:a,rows:n};let s=[],l=!1;for(let e of n){let t=e?.[o];if(Array.isArray(t)){l=!0;for(let e of t)e&&"object"==typeof e&&s.push(e)}}return{dataProp:a,rows:l?s:n}}function mt(e,t,r){let a=/* @__PURE__ */new Set;for(let i of e.fields){let e=i.dataProp??"data",n=r??t[e];if(!Array.isArray(n))continue;if(0===n.length){a.add(e);continue}let o=pt(i,t);if(!o)continue;let s=n.map(e=>e?.[o]).filter(Array.isArray);s.length>0&&s.every(e=>0===e.length)&&a.add(`${e}.${o}`)}return[...a]}function gt(){let e=globalThis;return e[Oc]??(e[Oc]={contracts:/* @__PURE__ */new Map}),e[Oc]}function yt(e){return gt().contracts.get(e)??Mc[e]}function bt(e){if("number"==typeof e)return e;if("string"!=typeof e)return;let t=e.trim();return/^[+-]?nan$/i.test(t)?NaN:/^[+-]?Infinity$/.test(t)||/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/.test(t)&&!/^[+-]?0\d+$/.test(t)?Number(t):void 0}function vt(e){return null==e||"string"==typeof e&&""===e.trim()}function wt(e,t,r){let a={numbers:r?[]:void 0,finite:0,min:1/0,max:-1/0,missing:0,nonFinite:0,nonNumeric:0,zero:0,negative:0,fractional:0};for(let r of e){let e=r?.[t];if(vt(e)){a.missing++;continue}let i=bt(e);void 0!==i?Number.isFinite(i)?(a.numbers?.push(i),a.finite++,i<a.min&&(a.min=i),i>a.max&&(a.max=i),0===i&&a.zero++,i<0&&a.negative++,Number.isInteger(i)||a.fractional++):a.nonFinite++:a.nonNumeric++}return a}function At(e,t){if(0===e.length)return;let r=(e.length-1)*t,a=Math.floor(r),i=Math.ceil(r);if(a===i)return e[a];let n=r-a;return e[a]*(1-n)+e[i]*n}function $t(e,t={}){if(!Array.isArray(e)||0===e.length)return{};let r=/* @__PURE__ */new Set;for(let t of e)if(t&&"object"==typeof t)for(let e of Object.keys(t))r.add(e);let a={};for(let i of r){let r=wt(e,i,!1!==t.quantiles),n=r.numbers?.sort((e,t)=>e-t);a[i]={field:i,observedCount:e.length-r.missing,finiteCount:r.finite,missingCount:r.missing,nonFiniteCount:r.nonFinite,nonNumericCount:r.nonNumeric,zeroCount:r.zero,negativeCount:r.negative,fractionalCount:r.fractional,...r.finite>0?{min:r.min,...n?{q1:At(n,.25),median:At(n,.5),q3:At(n,.75)}:{},max:r.max}:{}}}return a}function xt(e){let t=e.ok?"✓ numerically safe":"✗ numeric hazards found",r=[`${e.component}: ${t}`,`${e.rowCount} rows · ${e.summary.fieldsChecked} numeric fields · ${e.summary.errors} errors · ${e.summary.warnings} warnings`];for(let t of e.diagnoses)r.push(`${"error"===t.severity?"ERROR":"WARN"} ${t.code}${t.field?` [${t.field}]`:""}: ${t.message}`),t.fix&&r.push(` Fix: ${t.fix}`);return r.join("\n")}function St(e){return e.code.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Ct(e,t={}){let r=Number.isFinite(t.max)?Math.max(0,Math.floor(t.max)):6,a=e.diagnoses.map((e,t)=>({item:e,diagnosisIndex:t})).filter(({item:e})=>!t.errorsOnly||"error"===e.severity),i=a.slice(0,r).map(({item:e,diagnosisIndex:t})=>({id:`data-audit:${e.code}:${e.role??"chart"}:${e.field??"chart"}:${t}`,level:e.severity,title:e.field?`${St(e)} · ${e.field}`:St(e),message:e.fix?`${e.message} ${e.fix}`:e.message,source:"Semiotic data audit",dismissible:!0}));return a.length>r&&i.push({id:"data-audit:overflow:chart",level:a.slice(r).some(({item:e})=>"error"===e.severity)?"error":"warning",title:`${a.length-r} more numeric finding${a.length-r===1?"":"s"}`,message:"Run auditData() or diagnoseConfig() to inspect the complete report.",source:"Semiotic data audit",dismissible:!0}),i}function kt(e){let t=[];for(let[r,a]of Object.entries(Fc))"string"!=typeof e[r]&&"function"!=typeof e[r]||t.push({role:a,accessor:r,..."size"===a?{requirements:["finite","non-negative"]}:{},..."x"===a||"y"===a?{domain:!0}:{}});return t.length>0?{fields:t}:void 0}function Rt(e,t,r){return"function"==typeof e?e(t,r):t[e]}function Pt(e,t){if("number"==typeof e)return Number.isFinite(e)?e:null;if(e instanceof Date){let r=e.getTime();return t&&Number.isFinite(r)?r:null}if("string"==typeof e){let r=e.trim(),a=Number(r);if(r&&Number.isFinite(a))return a;if("date-like"===t){let e=ut(r);return Number.isFinite(e)?e:null}}return null}function Nt(e){return"number"==typeof e&&!Number.isFinite(e)}function Et(e,t,r,a,i){let n={field:r,numbers:[],finiteRows:[],missingRows:[],nonFiniteRows:[],nonNumericRows:[],accessorErrorRows:[],zeroRows:[],negativeRows:[],fractionalRows:[]};for(let r=0;r<e.length;r++){let o;try{o=Rt(t,e[r],r)}catch{n.accessorErrorRows.push(r);continue}if(null==o||""===o){if(void 0!==i){n.numbers.push(i),n.finiteRows.push(r),0===i&&n.zeroRows.push(r),i<0&&n.negativeRows.push(r),Number.isInteger(i)||n.fractionalRows.push(r);continue}n.missingRows.push(r);continue}let s=Pt(o,a);null!=s?(n.numbers.push(s),n.finiteRows.push(r),0===s&&n.zeroRows.push(r),s<0&&n.negativeRows.push(r),Number.isInteger(s)||n.fractionalRows.push(r)):Nt(o)?n.nonFiniteRows.push(r):n.nonNumericRows.push(r)}return n}function It(e,t){let r=new Set(e.requirements??["finite"]);return r.add("finite"),("x"===e.role&&"log"===t.xScaleType||"y"===e.role&&"log"===t.yScaleType)&&r.add("positive"),[...r]}function Tt(e){let t=1/0,r=-1/0;for(let a of e)a<t&&(t=a),a>r&&(r=a);return[t,r]}function Mt(e,t,r){let a=[],i=/* @__PURE__ */new Set;for(let n of e.fields){if(n.whenProps?.some(e=>null==t[e]))continue;let e=t[n.accessor],o="string"==typeof e||"function"==typeof e?e:n.defaultAccessor;if("string"!=typeof o&&"function"!=typeof o)continue;let{dataProp:s,rows:l}=ft(n,t,r);if(0===l.length)continue;let c="string"==typeof o?o:`${n.accessor}()`,u=`${s}:${n.role}:${c}`;if(i.has(u))continue;i.add(u);let d=n.temporalValues??("time"===n.role||"x"===n.role&&"time"===t.xScaleType?"date-like":void 0),h="x"===n.role&&"log"===t.xScaleType||"y"===n.role&&"log"===t.yScaleType,p=It(n,t);a.push({contract:n,accessor:o,accessorLabel:c,dataProp:s,rows:l,requirements:p,logScale:h,observation:Et(l,o,c,d,n.missingValue)})}return a}function Ot(e){return e.slice(0,5)}function Ft(e){return{domain:"data",...e}}function jt(e){let t=e.observation.numbers.map((t,r)=>({value:t,row:e.observation.finiteRows[r]})).sort((e,t)=>e.value-t.value);if(t.length<8)return[];let r=t.map(e=>e.value),a=At(r,.25),i=At(r,.75),n=At(r,.5),o=i-a;if(o>0){let e=a-10*o,r=i+10*o;return t.filter(t=>t.value<e||t.value>r).map(e=>e.row)}let s=100*Math.max(1,Math.abs(n));return t.filter(e=>Math.abs(e.value-n)>s).map(e=>e.row)}function zt(e,t){let r=[],{observation:a,contract:i,accessorLabel:n,requirements:o}=e,s={field:n,role:i.role},l=[...a.nonFiniteRows,...a.nonNumericRows,...a.accessorErrorRows].sort((e,t)=>e-t);if(0===a.numbers.length)return r.push(Ft({severity:"error",code:"DEGENERATE_EXTENT",message:`${i.accessor}="${n}" produces no finite numeric values; the chart cannot resolve its ${i.role} input.`,fix:`Ensure ${n} contains finite numbers${"x"===i.role?" (or valid dates for a time scale)":""}.`,...s,...l.length>0?{rows:Ot(l),count:l.length}:{}})),r;a.nonFiniteRows.length>0&&r.push(Ft({severity:"error",code:"NON_FINITE_VALUE",message:`${n} contains ${a.nonFiniteRows.length} NaN or infinite value${1===a.nonFiniteRows.length?"":"s"}; scale and layout math require finite numbers.`,fix:`Filter or replace NaN/Infinity in ${n} before rendering.`,...s,rows:Ot(a.nonFiniteRows),count:a.nonFiniteRows.length})),!i.allowMissing&&a.missingRows.length>0&&r.push(Ft({severity:"error",code:"MISSING_NUMERIC_VALUE",message:`${n} is missing for ${a.missingRows.length} row${1===a.missingRows.length?"":"s"}; the ${i.role} role requires an explicit numeric value.`,fix:`Fill or filter missing ${n} values before rendering.`,...s,rows:Ot(a.missingRows),count:a.missingRows.length}));let c=[...a.nonNumericRows,...a.accessorErrorRows].sort((e,t)=>e-t);if(c.length>0&&r.push(Ft({severity:"error",code:"NON_NUMERIC_VALUE",message:`${n} produces ${c.length} non-numeric value${1===c.length?"":"s"} for the ${i.role} role.`,fix:`Bind ${i.accessor} to a numeric field or return finite numbers from the accessor.`,...s,rows:Ot(c),count:c.length})),i.domain&&a.numbers.length>=2){let[e,t]=Tt(a.numbers);e===t&&r.push(Ft({severity:"warning",code:"ZERO_SPAN_DOMAIN",message:`${n} is constant at ${e}; its ${i.role} scale has a zero-span data domain.`,fix:`Provide varying ${i.role} values, set an explicit extent around ${e}, or use a single-value display.`,...s,rows:Ot(a.finiteRows),count:a.finiteRows.length}))}if(o.includes("positive")){let t=a.numbers.map((e,t)=>({number:e,row:a.finiteRows[t]})).filter(({number:e})=>e<=0).map(({row:e})=>e);if(t.length>0){let a=e.logScale;r.push(Ft({severity:"error",code:a?"LOG_NON_POSITIVE":"NON_POSITIVE_VALUE",message:`${n} contains ${t.length} non-positive value${1===t.length?"":"s"}, which ${a?"cannot be represented on a log scale":"violate the positive-value contract"}.`,fix:a?"Remove or transform values ≤ 0, or use a linear/symlog scale.":"Provide values greater than zero.",...s,rows:Ot(t),count:t.length}))}}if(o.includes("non-negative")&&a.negativeRows.length>0&&r.push(Ft({severity:"error",code:"size"===i.role?"NEGATIVE_SIZE":"NEGATIVE_VALUE",message:`${n} contains ${a.negativeRows.length} negative ${i.role} value${1===a.negativeRows.length?"":"s"}; the chart maps this role to non-negative geometry.`,fix:"Use a non-negative measure, clamp intentionally, or encode sign with position/color instead.",...s,rows:Ot(a.negativeRows),count:a.negativeRows.length})),o.includes("integer")){let e=[.../* @__PURE__ */new Set([...a.negativeRows,...a.zeroRows,...a.fractionalRows])].sort((e,t)=>e-t);e.length>0&&r.push(Ft({severity:"error",code:"INVALID_COUNT",message:`${n} contains ${e.length} value${1===e.length?"":"s"} that are not positive integers.`,fix:"Counts must be integers ≥ 1; aggregate, round intentionally, or use a continuous-value encoding.",...s,rows:Ot(e),count:e.length}))}if(o.includes("unit-interval")){let e=a.numbers.map((e,t)=>({number:e,row:a.finiteRows[t]})).filter(({number:e})=>e<0||e>1).map(({row:e})=>e);e.length>0&&r.push(Ft({severity:"error",code:"OUTSIDE_UNIT_INTERVAL",message:`${n} contains ${e.length} value${1===e.length?"":"s"} outside [0, 1].`,fix:`Normalize ${n} to [0, 1] before using it as ${i.role}.`,...s,rows:Ot(e),count:e.length}))}if(t&&i.domain){let t=jt(e);t.length>0&&r.push(Ft({severity:"warning",code:"OUTLIER_DOMINATED_DOMAIN",message:`${n} has ${t.length} extreme value${1===t.length?"":"s"} beyond the 10×IQR guardrail; the main distribution may collapse visually.`,fix:"Verify the extreme values, then consider a log scale, robust extent, inset, or explicit annotation rather than silently clipping them.",...s,rows:Ot(t),count:t.length}))}return r}function Bt(e,t,r){if(!e)return"__all__";try{return String(Rt(e,t,r))}catch{return"__accessor_error__"}}function Lt(e,t,r){if(e.whenProp&&!0!==r[e.whenProp])return[];let a=t.find(t=>t.contract.role===e.role);if(!a||0===a.observation.numbers.length)return[];let i=e.groupAccessor?r[e.groupAccessor]:void 0,n="string"==typeof i||"function"==typeof i?i:e.defaultGroupAccessor,o=/* @__PURE__ */new Map;for(let e=0;e<a.rows.length;e++){let t;try{t=Rt(a.accessor,a.rows[e],e)}catch{continue}let r=Pt(t,void 0);if(null==r)continue;let i=Bt(n,a.rows[e],e),s=o.get(i)??{sum:0,magnitude:0,positive:!1,negative:!1,rows:[],negativeRows:[]};s.sum+=r,s.magnitude+=Math.abs(r),s.positive||(s.positive=r>0),s.negative||(s.negative=r<0),s.rows.push(e),r<0&&s.negativeRows.push(e),o.set(i,s)}let s=[],l=[],c=[],u=[],d=[],h=[];for(let[t,r]of o){let a=Math.abs(r.sum)<=Number.EPSILON*Math.max(1,r.magnitude)*10;("positive-total"===e.kind&&r.sum<=0||"normalized-total"===e.kind&&a)&&(s.push(t),u.push(...r.rows)),"normalized-total"===e.kind&&r.positive&&r.negative&&(l.push(t),d.push(...r.rows)),"normalized-total"===e.kind&&r.negative&&(c.push(t),h.push(...r.negativeRows))}let p=[];return s.length>0&&p.push(Ft({severity:"error",code:"normalized-total"===e.kind?"ZERO_NORMALIZED_TOTAL":"NON_POSITIVE_TOTAL",message:"normalized-total"===e.kind?`${s.length} normalization group${1===s.length?" has":"s have"} a zero total, so division would be undefined.`:"The part-to-whole total is not positive, so meaningful shares cannot be computed.",fix:"normalized-total"===e.kind?"Remove empty/zero-sum groups or disable normalization.":"Provide at least one positive value and ensure the total is greater than zero.",field:a.accessorLabel,role:e.role,rows:Ot([...new Set(u)].sort((e,t)=>e-t)),count:s.length})),c.length>0&&p.push(Ft({severity:"error",code:"NEGATIVE_NORMALIZED_VALUE",message:`${c.length} normalization group${1===c.length?" contains":"s contain"} negative contributions, so conventional percentage shares are not defined.`,fix:"Use non-negative contributions, a diverging stack, or disable normalization.",field:a.accessorLabel,role:e.role,rows:Ot([...new Set(h)].sort((e,t)=>e-t)),count:h.length})),l.length>0&&p.push(Ft({severity:"warning",code:"MIXED_SIGN_NORMALIZATION",message:`${l.length} normalization group${1===l.length?" mixes":"s mix"} positive and negative contributions; percentage shares may be unstable or misleading.`,fix:"Separate positive and negative contributions, use diverging stacks, or disable normalization.",field:a.accessorLabel,role:e.role,rows:Ot([...new Set(d)].sort((e,t)=>e-t)),count:l.length})),p}function _t(e,t,r,a={}){let i=a.contracts??yt(e)??kt(t);if(!i)return{component:e,ok:!0,rowCount:r?.length??(Array.isArray(t.data)?t.data.length:0),summary:{fieldsChecked:0,errors:0,warnings:0},contracts:[],diagnoses:[]};let n=Mt(i,t,r),o=[],s=!1!==a.checkOutliers;for(let e of mt(i,t,r))o.push(Ft({severity:"error",code:"EMPTY_DATA",message:`${e} is an explicitly empty array; there are no numeric inputs to render.`,fix:`Provide at least one valid row, render an intentional empty state, or omit ${e} when using the ref push API.`,count:0,rows:[]}));let l=new Set(n.filter(e=>e.contract.domain&&1===e.rows.length).map(e=>e.dataProp));for(let e of l)o.push(Ft({severity:"warning",code:"SINGLE_ROW_DOMAIN",message:`${e} has one row; a quantitative scale cannot establish variation from a single observation.`,fix:"Provide at least two observations or use a single-value display such as BigNumber.",count:1,rows:[0]}));for(let e of n)o.push(...zt(e,s));for(let e of i.aggregates??[])o.push(...Lt(e,n,t));let c=o.filter(e=>"error"===e.severity).length,u=o.length-c;return{component:e,ok:0===c,rowCount:n.reduce((e,t)=>Math.max(e,t.rows.length),r?.length??(Array.isArray(t.data)?t.data.length:0)),summary:{fieldsChecked:n.length,errors:c,warnings:u},contracts:n.map(e=>({role:e.contract.role,accessor:e.accessorLabel,dataProp:e.dataProp,requirements:e.requirements,allowMissing:!0===e.contract.allowMissing,...void 0!==e.contract.missingValue?{missingValue:e.contract.missingValue}:{},domain:!0===e.contract.domain})),diagnoses:o}}function Dt(e,t,r){let a=_l[e];if(a){if("array"===a.dataShape||"realtime"===a.dataShape){let e=t.data;e&&Array.isArray(e)&&0===e.length&&r.push({severity:"error",code:"EMPTY_DATA",message:"data is an empty array — chart will render blank.",fix:"realtime"===a.dataShape?"Provide at least one observation: data={[{ time: 0, value: 1 }]}, or omit data for React ref push mode.":"Provide at least one data point: data={[{ x: 1, y: 2 }]}."})}"network"===a.dataShape&&t.edges&&Array.isArray(t.edges)&&0===t.edges.length&&r.push({severity:"error",code:"EMPTY_EDGES",message:"edges is an empty array — network chart will render blank.",fix:'Provide at least one edge: edges={[{ source: "A", target: "B" }]}.'})}}function Ut(e,t){for(let[r,a]of[["width",600],["height",400]]){let i=e[r];void 0!==i&&("number"!=typeof i||i<=0)&&t.push({severity:"error",code:"width"===r?"BAD_WIDTH":"BAD_HEIGHT",message:`${r}=${JSON.stringify(i)} — chart needs a positive number.`,fix:`Set ${r}={${a}}.`})}if(e.size&&Array.isArray(e.size)){let[r,a]=e.size;(null!=r&&r<=0||null!=a&&a<=0)&&t.push({severity:"error",code:"BAD_SIZE",message:`size=[${r}, ${a}] — both dimensions must be positive.`,fix:"Set size={[600, 400]}."})}}function Vt(e,t,r){let a=_l[e];if(!a||"array"!==a.dataShape)return;let i=t.data;if(!i||!Array.isArray(i)||0===i.length)return;let n=i[0];if(!n||"object"!=typeof n)return;let o=Object.keys(n);for(let e of a.dataAccessors){let a=t[e];"string"==typeof a&&(a in n||r.push({severity:"error",code:"ACCESSOR_MISSING",message:`${e}="${a}" not found in data. Available fields: ${o.join(", ")}.`,fix:`Change ${e} to one of: ${o.map(e=>`"${e}"`).join(", ")}, or use a function: ${e}={d => d.myValue}.`}))}}function Gt(e,t,r){ql.has(e)&&Array.isArray(t.data)&&r.push({severity:"error",code:"HIERARCHY_FLAT_ARRAY",message:`${e} expects hierarchical data but received a flat array.`,fix:'Pass a root object: data={{ name: "root", children: [...] }}. For flat data, use BarChart or LineChart.'})}function Ht(e,t,r){Wl.has(e)&&!t.edges&&!t.data&&r.push({severity:"error",code:"NETWORK_NO_EDGES",message:`${e} requires an edges prop.`,fix:'Provide edges={[{ source: "A", target: "B", value: 10 }]}.'})}function qt(e,t,r){let a=_l[e];if(!a||"array"!==a.dataShape)return;let i=t.data;if(!i||!Array.isArray(i)||0===i.length)return;let n=i[0];if(!n||"object"!=typeof n)return;let o=t.xAccessor;"string"==typeof o&&n[o]instanceof Date&&!t.xFormat&&r.push({severity:"warning",code:"DATE_NO_FORMAT",message:`xAccessor "${o}" contains Date objects but no xFormat is provided. Axis ticks may display "[object Object]".`,fix:"Add xFormat={d => d.toLocaleDateString()} or use timestamps (d.getTime()) instead of Date objects."})}function Wt(e,t,r){t.linkedHover&&!t.selection&&r.push({severity:"warning",code:"LINKED_HOVER_NO_SELECTION",message:"linkedHover is set but selection is not — this chart emits hover events but won't highlight from others.",fix:`Add selection={{ name: "${"object"==typeof t.linkedHover&&t.linkedHover.name||"hl"}" }} to receive cross-highlights.`})}function Yt(e,t,r){if(!Kl.has(e)||t.gapStrategy)return;let a=t.data;if(!a||!Array.isArray(a)||0===a.length)return;let i=t.yAccessor||"y";"string"==typeof i&&a.some(e=>{let t=e?.[i];return null==t||Number.isNaN(t)})&&r.push({severity:"warning",code:"DATA_GAPS",message:`Data contains null/undefined/NaN values in "${i}". Default behavior breaks the line at gaps.`,fix:'Set gapStrategy="break" (default), "interpolate", or "zero" to control gap handling.'})}function Kt(e,t,r){if(!Yl.has(e))return;let a=t.rExtent||t.yExtent||t.valueExtent;a&&Array.isArray(a)&&a.length>=1&&null!=a[0]&&0!==a[0]&&r.push({severity:"warning",code:"NON_ZERO_BASELINE",message:`${e} has a non-zero baseline (${a[0]}). Bar and area charts should start at zero to avoid exaggerating differences.`,fix:`Remove the custom extent minimum or set it to 0: rExtent={[0, ${a[1]??"auto"}]}. For trend-focused charts, use LineChart instead.`})}function Jt(e,t,r){if(!Jl.has(e))return;let a=t.barPadding;"number"==typeof a&&a<10&&r.push({severity:"warning",code:"BAR_PADDING_INVISIBLE",message:`barPadding=${a} is very small — bars may appear to have no spacing between them.`,fix:"Increase barPadding to at least 10 for visible gaps, e.g. barPadding={12}."})}function Xt(e,t,r){if("Heatmap"!==e)return;let a=t.data;if(!a||!Array.isArray(a)||0===a.length)return;let i=a[0];if(i&&"object"==typeof i)for(let e of["xAccessor","yAccessor"]){let a=t[e];if("string"!=typeof a)continue;let n=i[a];"string"==typeof n&&r.push({severity:"warning",code:"HEATMAP_STRING_ACCESSOR",message:`${e}="${a}" resolves to string values (e.g. "${n}"). Heatmap will use categorical axis handling which may produce unexpected cell layout.`,fix:"If you intend categorical axes this is fine. Otherwise, convert values to numbers before passing data."})}}function Zt(e,t,r){let a=t.colorScheme;if(!a||!Array.isArray(a))return;let i="string"==typeof t.background?t.background:"#ffffff";if(!i.startsWith("#"))return;let n=[];for(let e of a){if("string"!=typeof e||!e.startsWith("#"))continue;let t=f(e,i);null!==t&&t<3&&n.push(`${e} (${t.toFixed(1)}:1)`)}n.length>0&&r.push({severity:"warning",code:"LOW_COLOR_CONTRAST",message:`${n.length} color(s) in colorScheme have < 3:1 contrast against background "${i}": ${n.join(", ")}. Data marks may be hard to see.`,fix:"Choose colors with at least 3:1 contrast against the chart background."})}function Qt(e,t){let r=e.width??600,a=e.height??400,i=e.margin;if(!i||"object"!=typeof i)return;let n=(i.left||0)+(i.right||0),o=(i.top||0)+(i.bottom||0);n>=r&&t.push({severity:"error",code:"MARGIN_OVERFLOW_H",message:`Horizontal margins (${n}px) >= width (${r}px) — no drawing area left.`,fix:"Reduce margin.left/right or increase width."}),o>=a&&t.push({severity:"error",code:"MARGIN_OVERFLOW_V",message:`Vertical margins (${o}px) >= height (${a}px) — no drawing area left.`,fix:"Reduce margin.top/bottom or increase height."})}function er(e,t,r){let a=_l[e]?.props,i=e=>!!a?.[e]&&"string"==typeof t[e]&&t[e].trim().length>0,n=i("title"),o=i("description"),s=i("summary");!n&&!o&&!s&&r.push({severity:"warning",code:"MISSING_DESCRIPTION",message:"No title, description, or summary provided. Screen readers will fall back to a generic chart-type label.",fix:'Add a title="..." prop for a brief label, or description="..." for a detailed aria-label, or summary="..." for a screen-reader-only note describing the chart\'s purpose.'})}function tr(e,t,r){let a=t.colorScheme;"string"!=typeof a||_l[e]?.props?.colorScheme?.enum||jc.has(a)||r.push({severity:"warning",code:"UNKNOWN_COLOR_SCHEME",message:`colorScheme "${a}" is not a recognized named scheme — the chart will fall back to the default palette.`,fix:`Use a known scheme name (${[...jc].join(", ")}) or pass an explicit color array, e.g. colorScheme={["#1f77b4", "#ff7f0e"]}.`})}function rr(e,t,r){let a=t.colorScheme;if(!a||!Array.isArray(a)||a.length<2)return;let i=a.filter(e=>"string"==typeof e&&e.startsWith("#"));if(i.length<2)return;let n=[];for(let e=0;e<i.length-1;e++){let t=f(i[e],i[e+1]);null!==t&&t<1.5&&n.push(`${i[e]} / ${i[e+1]} (${t.toFixed(1)}:1)`)}n.length>0&&r.push({severity:"warning",code:"LOW_ADJACENT_CONTRAST",message:`${n.length} adjacent color pair(s) in colorScheme have very similar luminance: ${n.join("; ")}. Categories may be hard to distinguish.`,fix:'Alternate light and dark colors in the scheme, or use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic" for a pre-tested palette.'})}function ar(e,t,r){let a=[];for(let e of zc)"function"==typeof t[e]&&a.push(e);a.length>0&&r.push({severity:"warning",code:"FUNCTION_ACCESSOR",message:`Function accessor${a.length>1?"s":""} detected: ${a.join(", ")}. If defined inline (e.g. \`xAccessor={d => d.value}\`), every parent re-render creates a new reference; closures over changing values can force unnecessary scene rebuilds on resize/rotation.`,fix:'Use string accessors when possible (e.g. xAccessor="value"), or memoize with useCallback / define outside the component.'})}function ir(e,t,r){let a=t.hoverRadius,i=!1!==t.enableHover&&(!1!==t.hoverAnnotation||t.tooltip||t.customHoverBehavior||t.customClickBehavior||t.onClick);"number"==typeof a&&a>0&&a<24&&i&&r.push({severity:"warning",code:"TOUCH_TARGET_SMALL",message:`hoverRadius=${a}px is below the ~24px radius needed for reliable 48px touch targets on mobile screens.`,fix:"Use hoverRadius={24} or larger for touch-heavy views. Semiotic floors touch pointer hit testing to 24px, but explicit desktop-only radii should be documented."})}function nr(e,t,r){!0===t.responsiveWidth&&!0===t.responsiveHeight&&r.push({severity:"warning",code:"RESPONSIVE_BOTH_AXES",message:"responsiveWidth and responsiveHeight are both true. On mobile this can create resize feedback loops when the parent height depends on chart content.",fix:"Prefer responsiveWidth={true} with a fixed parent height or size={[width, fixedHeight]}; use a ResizeObserver outside the chart if the height must follow aspect ratio."})}function or(e,t,r){if(!0!==t.showParticles)return;let a=t.particleStyle&&"object"==typeof t.particleStyle?t.particleStyle:{},i="number"==typeof a.maxPerLine?a.maxPerLine:void 0,n="number"==typeof a.spawnRate?a.spawnRate:void 0;("number"==typeof i&&i>20||"number"==typeof n&&n>.08)&&r.push({severity:"warning",code:"GEO_PARTICLE_MOBILE_COST",message:"Animated geo particles run a continuous canvas loop that can drain battery and trigger thermal throttling on mobile GPUs.",fix:"Set particleStyle={{ maxPerLine: 12, spawnRate: 0.06 }} for mobile-heavy views, or disable showParticles when reduced-motion or low-power modes are active."})}function sr(e){return"object"==typeof e&&null!==e&&("tokenType"in e||"tokenSemantics"in e||"countStrategy"in e||"unitValue"in e||"unit"in e)}function lr(e){return"number"==typeof e&&Number.isFinite(e)&&e>=0?e:void 0}function cr(e,t){let r=lr(e.visibleTokens);if(null!=r)return r;let a=lr(t.denominator);if("fixed-denominator"===t.countStrategy&&null!=a)return a;let i=lr(t.tokenCount),n=lr(t.maxTokens);return null!=i&&null!=n?Math.min(i,n):i??a??n}function ur(e,t,r){let a=[];sr(t.tokenEncoding)&&a.push({source:"tokenEncoding",encoding:t.tokenEncoding}),sr(t.encoding)&&a.push({source:"encoding",encoding:t.encoding});for(let{source:e,encoding:i}of a){let a=cr(t,i);for(let t of Te(i,{visibleTokens:a}))r.push({severity:"warning",code:`TOKEN_${t.code}`,message:t.message,fix:"MISSING_UNIT_VALUE"===t.code?`Set ${e}.unitValue to the value represented by one full token.`:"MISSING_UNIT_MEANING"===t.code?`Set ${e}.unitMeaning so readers know what one full token represents.`:"MISSING_COUNT_STRATEGY"===t.code?`Set ${e}.countStrategy to actual, unitized, fixed-denominator, quantile, sample, posterior-sample, or random-sample.`:"TOKEN_SEMANTICS_UNCLEAR"===t.code?`Set ${e}.tokenSemantics to observed-unit, unitized-measure, risk-case, possible-outcome, posterior-sample, hypothetical-case, topic-anchor, or decorative.`:`Adjust ${e} so its semantics, strategy, labels, and visible token count match the task.`})}}function dr(e){let t={...e};return delete t.tokenEncoding,delete t.visibleTokens,sr(t.encoding)&&delete t.encoding,t}function hr(e,t){let r=t.match(/^Unknown prop "([^"]+)"/);if(r)return`Remove \`${r[1]}\` or replace it with a documented ${e} prop.`;let a=t.match(/^"([^"]+)" is required for .+\.$/i)??t.match(/(?:Missing|required) prop "?([^". ]+)/i);return a?`Add the required \`${a[1]}\` prop using the ${e} schema and example.`:t.startsWith("Unknown component")?"Choose a component returned by getSchema() or check the component name for a typo.":`Correct this ${e} prop configuration to match its schema: ${t}`}function pr(e,t){void 0!==e.accessibleTable&&t.push({severity:"error",code:"BIGNUMBER_ACCESSIBLE_TABLE",message:"BigNumber is a value component and does not support accessibleTable.",fix:"Remove accessibleTable. Use label, description, and summary to provide BigNumber's accessible text."})}function fr(e,t){let r=[],a=()=>({ok:r.every(e=>"warning"===e.severity),diagnoses:r}),i=/^(XY|Ordinal|Network|Physics|Geo)CustomChart$/.test(e),n=i?[]:Pe(e,dr(t)).errors;if(i){"function"!=typeof t.layout&&n.push("Provide a layout function.");let r="NetworkCustomChart"===e?["nodes","edges"]:"GeoCustomChart"===e?["points","areas","lines"]:["data"];for(let e of r)null!=t[e]&&!Array.isArray(t[e])&&n.push(`Provide an array for ${e}.`)}for(let a of n)"BigNumber"===e&&void 0!==t.accessibleTable&&a.startsWith('Unknown prop "accessibleTable"')||r.push({severity:"error",code:"VALIDATION",message:a,fix:i?a:hr(e,a)});if("BigNumber"===e&&pr(t,r),(i||_l[e])&&(Ut(t,r),Qt(t,r),De(0,t,r)),!_l[e])return a();Dt(e,t,r),Vt(e,t,r),Gt(e,t,r),Ht(e,t,r),qt(e,t,r),Wt(0,t,r),Kt(e,t,r),Yt(e,t,r);let o=_t(e,t,void 0,{checkOutliers:!1}).diagnoses;for(let e of o)"EMPTY_DATA"===e.code&&r.some(e=>"EMPTY_DATA"===e.code||"EMPTY_EDGES"===e.code)||r.push(e);if(Jt(e,t,r),Xt(e,t,r),Zt(0,t,r),rr(0,t,r),tr(e,t,r),er(e,t,r),ar(0,t,r),ir(0,t,r),nr(0,t,r),or(0,t,r),ur(0,t,r),Ue(0,t,r),Ve(0,t,r),Ge(0,t,r),He(0,t,r),Ze(e,t,r),qe(e,t,r),We(e,t,r),r.some(e=>"NEGATIVE_VALUE"===e.code||"NEGATIVE_NORMALIZED_VALUE"===e.code)||Ye(e,t,r),Ke(e,t,r),Je(e,t,r),Xe(e,t,r),ct(e,t,r),"ProcessSankey"===e)for(let e of ht(t))r.push(e);return a()}function mr(e){return"string"==typeof e&&e.trim().length>0}function gr(e,t,r){let a=Lc.has(e)||void 0!==r&&_c.has(r),i=t=>be(e,t)||a,n=Bc.filter(e=>mr(t[e])&&!i(e));return{hasTitle:i("title")&&mr(t.title),hasDescription:i("description")&&mr(t.description),hasSummary:i("summary")&&mr(t.summary),unsupportedFinding:n.length>0?{id:"understandable.unsupported-description-prop",principle:"understandable",heuristic:"Descriptive text is connected to the rendered chart",critical:!0,status:"warn",message:`Useful ${n.join(" and ")} text was supplied, but ${1===n.length?"that prop is":"those props are"} not supported by ${e}'s declared chart API and cannot be credited as rendered accessibility text.`,fix:"Use the component's declared title, description, and summary props when available; for richer generated description or navigation, use ChartContainer with chartConfig plus describe and/or navigable."}:void 0}}function yr(e){return!!Array.isArray(e.styleRules)&&e.styleRules.some(e=>{if("object"!=typeof e||null===e)return!1;let t=e.style;if("object"!=typeof t||null===t||Array.isArray(t))return!1;let r=t.fill;return"object"==typeof r&&null!==r&&"hatch"===r.type})}function br(e){if(!Array.isArray(e))return!1;let t=e.filter(e=>"string"==typeof e&&e.startsWith("#")).map(e=>e.toLowerCase());return t.length>0&&t.every(e=>Dc.has(e))}function vr(e,t){return"number"==typeof t?`${e}[${t}]`:`${e}.${t}`}function wr(e,t){return`${e}[Symbol(${t.description??""})]`}function Ar(e,t){if(!/^(0|[1-9][0-9]*)$/.test(e))return!1;let r=Number(e);return Number.isSafeInteger(r)&&r>=0&&r<t}function $r(e,t){try{return Object.getOwnPropertyDescriptor(e,t)}catch{return}}function xr(e,t,r,a){let i=$r(e,t);return i&&"value"in i&&i.enumerable?Sr(i.value,r,a):[r]}function Sr(e,t="$",r=/* @__PURE__ */new Set){if(null===e||"string"==typeof e||"boolean"==typeof e)return[];if("number"==typeof e)return Number.isFinite(e)&&!Object.is(e,-0)?[]:[t];if("object"!=typeof e)return[t];if(r.has(e))return[t];let a,i,n;try{n=Array.isArray(e),a=Object.getPrototypeOf(e),i=Reflect.ownKeys(e)}catch{return[t]}if(a!==(n?Array.prototype:Object.prototype)&&null!==a)return[t];r.add(e);let o=[];try{if(n){let a=$r(e,"length")?.value;if(!Number.isSafeInteger(a)||a<0)return[vr(t,"length")];for(let e of i)"length"===e||"string"==typeof e&&Ar(e,a)||o.push("symbol"==typeof e?wr(t,e):vr(t,e));for(let i=0;i<a;i+=1)o.push(...xr(e,String(i),vr(t,i),r))}else for(let a of i)"symbol"!=typeof a?o.push(...xr(e,a,vr(t,a),r)):o.push(wr(t,a));return o}catch{return[t]}finally{r.delete(e)}}function Cr(){let e=globalThis;return e[Uc]||(e[Uc]={recipes:/* @__PURE__ */new Map,capabilities:/* @__PURE__ */new Map,layouts:/* @__PURE__ */new Map}),e[Uc]}function kr(e){return Cr().recipes.get(e)}function Rr(e){return Cr().layouts.get(e)?.layout}function Pr(e){let t=Cr().layouts.get(e)?.identity;return t?{...t}:void 0}function Nr(e){return"string"==typeof e?kr(e):e&&"object"==typeof e&&"string"==typeof e.id?e:void 0}function Er(e){let t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?t:null}function Ir(e){return"primary"===e?.emphasis||"secondary"===e?.emphasis||null!=Er(e)}function Tr(e){let t=e.split(/[.!?]+/).map(e=>e.trim()).filter(Boolean),r=e.trim().split(/\s+/).filter(Boolean);if(0===r.length||0===t.length)return null;let a=0;for(let e of r)a+=Mr(e);return r.length/t.length*.39+a/r.length*11.8-15.59}function Mr(e){let t=e.toLowerCase().replace(/[^a-z]/g,"");if(!t)return 0;if(t.length<=3)return 1;let r=t.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/,"").replace(/^y/,"").match(/[aeiouy]{1,2}/g);return r?r.length:1}function Or(e){return!1!==e.tooltip||null!=e.onClick||null!=e.brush||null!=e.onBrush||null!=e.selection||null!=e.linkedHover||null!=e.linkedBrush}function Fr(e){return e.physics&&"object"==typeof e.physics?e.physics:{}}function jr(e){let t=Fr(e),r=e.controls&&"object"==typeof e.controls?e.controls:{};return!0===e.pauseControl||!0===t.pauseControl||!0===r.pause||"function"==typeof r.pause}function zr(e){let t=Fr(e);return!0===e.settledProjection||!0===t.settledProjection}function Br(e){let t=Fr(e);return!0===e.reducedMotionSettle||"settle"===e.reducedMotion||!0===t.reducedMotionSettle||"settle"===t.reducedMotion}function Lr(e){let t={id:"perceivable.low-contrast",principle:"perceivable",heuristic:"Low contrast",critical:!0},r=e.colorScheme,a="string"==typeof e.background?e.background:null;if(a&&!a.startsWith("#"))return{...t,status:"manual",message:`Background "${a}" isn't a hex literal (theme/CSS variable) — contrast can't be verified statically.`,fix:'Pass a hex `background` (e.g. "#ffffff"/"#000000"), or verify contrast manually once the theme resolves.'};let i=a??"#ffffff";if(!Array.isArray(r))return{...t,status:"manual",message:"Mark colors come from the theme/CSS variables — contrast can't be verified statically.",fix:"Confirm geometries/large text have ≥ 3:1 and regular text ≥ 4.5:1 contrast against the background."};let n=[],o=0;for(let e of r){if("string"!=typeof e||!e.startsWith("#"))continue;let t=f(e,i);null!=t&&(o++,t<3&&n.push(`${e} (${t.toFixed(1)}:1)`))}return 0===o?{...t,status:"manual",message:"colorScheme has no parseable hex colors to check.",fix:"Verify contrast manually for non-hex colors."}:n.length>0?{...t,status:"fail",message:`${n.length} color(s) fall below 3:1 contrast vs ${i}: ${n.join(", ")}.`,fix:"Darken (light background) or lighten (dark background) those colors, or use COLOR_BLIND_SAFE_CATEGORICAL."}:{...t,status:"pass",message:`All ${o} checked colorScheme color(s) meet ≥ 3:1 contrast vs ${i}.`}}function _r(e,t,r={}){let a=[],i=kr(e),n=nc.has(e),o=ye(e)||!!i||n,s=!0===r.inChartContainer,l=!0===r.describe,c=!0===r.navigable,u=rc.has(e),d=ql.has(e),{hasTitle:h,hasDescription:p,hasSummary:f,unsupportedFinding:m}=gr(e,t,i?.frameFamily),g=!1!==t.accessibleTable&&!u,y=h||p||f,b=Or(t),v=jr(t),w=n,A=zr(t)||sc.has(e)&&g,$=Br(t)||w,x=Array.isArray(t.annotations)?t.annotations.filter(e=>!!e&&"object"==typeof e):[],S=o?"pass":"manual",C=o?"":` (unrecognized component "${e}" — verify manually that the built-in applies)`;if(m&&a.push(m),a.push(Lr(t)),a.push({id:"perceivable.content-only-visual",principle:"perceivable",heuristic:"Content is only visual",critical:!0,...u?{status:"pass",message:"BigNumber renders its value as real text with an ARIA label — available without vision."}:g?{status:"pass",message:"A screen-reader data table + live region expose the data non-visually (accessibleTable is on)."}:p&&f?{status:"manual",message:"accessibleTable is off; a description + summary are present. Verify they convey everything the chart shows.",fix:"Re-enable accessibleTable, or confirm via screen reader that the text alternative is complete."}:{status:"fail",message:"accessibleTable is disabled and there's no full text alternative — the data is only available visually.",fix:"Remove accessibleTable={false}, or provide a complete description/summary plus a data table."}}),a.push({id:"perceivable.small-text",principle:"perceivable",heuristic:"Small text size",critical:!0,status:"pass",message:"Semiotic's default tick and axis-label fonts are 12px, meeting Chartability's 9pt/12px floor.",fix:"If a theme or override lowers --semiotic-tick-font-size below 12px, raise it back for low-vision audiences."}),a.push({id:"perceivable.seizure-risk",principle:"perceivable",heuristic:"Visual presents seizure risk",critical:!0,...null!=t.pulse||oc.has(e)?{status:"manual",message:"Pulse/continuous animation is in use. Confirm nothing flashes more than 3×/sec, especially saturated red.",fix:"Avoid red flashes and rapid (>3 Hz) flicker; reduced-motion is auto-honored, but verify the default presentation."}:{status:"manual",message:"No flashing detected statically. Confirm no element flashes more than 3×/sec.",fix:"Manual check — most static charts pass trivially."}}),null!=t.colorBy){let e=!0===t.directLabel||!0===t.showLabels,r=yr(t);a.push({id:"perceivable.color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...e?{status:"pass",message:"Categories are encoded by color (colorBy) and also directly labeled, so color isn't the only channel."}:{status:"warn",message:r?"Categories use colorBy and this config authors a HatchFill through styleRules, but a static audit cannot prove those rules give every category a distinct non-color cue. Semiotic does not automatically assign per-category textures.":"Categories are encoded by color (colorBy) with no declared redundant channel. Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor and there is no automatic per-category texture assignment.",fix:r?"Verify every category remains distinguishable with color removed; add direct labels where hatching is incomplete, keep categories ≤ ~7, and use a CVD-safe palette.":"Add direct labels (directLabel on LineChart/AreaChart, showLabels on network/hierarchy) or category-targeted styleRules with distinct HatchFill descriptors; keep categories ≤ ~7 and use a CVD-safe palette."}});let i=br(t.colorScheme);a.push({id:"perceivable.cvd-safe",principle:"perceivable",heuristic:"Not CVD-friendly",critical:!1,...i?{status:"pass",message:"colorScheme uses Semiotic's Wong colorblind-safe palette."}:{status:"manual",message:"Color encodes meaning; statically we can't confirm the palette is colorblind-safe.",fix:'Use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic", or test your scheme with Viz Palette / Chroma.'}}),a.push({id:"flexible.textures-adjustable",principle:"flexible",heuristic:"Contrast and textures cannot be adjusted",critical:!1,status:"warn",message:r?"This config uses an author-supplied HatchFill through styleRules, but Semiotic has no automatic, theme-aware per-category texture channel or user-facing texture toggle.":"Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor; there is no automatic, theme-aware per-category texture channel or user-facing texture toggle.",fix:r?"Verify the authored hatches cover every meaningful category and remain legible in the active theme; pair them with direct labels and a CVD-safe palette.":"Use category-targeted styleRules with distinct HatchFill descriptors or direct labels so the encoding survives color removal. Contrast itself is themeable via CSS variables."})}{let e=x.filter(Oe);if(e.length>0){let r=t.autoPlaceAnnotations,i="object"==typeof r&&null!==r&&!0===r.redundantCues,n=e.filter(e=>{if("string"!=typeof e.color)return!1;let t=Me(e),r=i&&"text"===t;return!(je(e)||r)});a.push({id:"perceivable.annotation-association",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...0===n.length?{status:"pass",message:"No annotation relies on color alone to indicate its target — wherever color is used, a connector, enclosure, or reference-line cue is present too."}:{status:"warn",message:`${n.length} of ${e.length} annotation(s) carry a color but no connector, enclosure, or reference-line cue, so a color-blind or non-visual reader can't tie them to their target (the correspondence problem).`,fix:"Add a connector (the label/callout default), place the note adjacent to its target, enclose the target, or enable autoPlaceAnnotations: { redundantCues: true } to give colored text notes a leader line — don't rely on color matching alone."}})}}a.push({id:"operable.single-input-modality",principle:"operable",heuristic:"Interaction modality only has one input type",critical:!0,...o?{status:"pass",message:"Built-in keyboard navigation (arrows/Home/End/PageUp-Down/Enter) mirrors mouse hover."}:{status:"manual",message:`Can't confirm keyboard support for "${e}".`,fix:"Verify Tab + arrow-key operation."}});{let e=[];(null!=t.brush||null!=t.onBrush)&&e.push("brushing"),!0===t.zoomable&&e.push("zoom/pan"),("isolate"===t.legendInteraction||"highlight"===t.legendInteraction)&&e.push("legend filtering"),e.length>0&&a.push({id:"operable.complex-action-alternatives",principle:"operable",heuristic:"Complex actions have no alternatives",critical:!1,status:"warn",message:`Mouse-driven ${e.join(", ")} ${e.length>1?"have":"has"} no built-in keyboard/standard-UI equivalent.`,fix:"Pair the complex interaction with a standard control (range inputs for a brush, buttons for zoom, a checkbox list for legend filtering) operable by keyboard and screen reader."})}{let r=hc[e];if(r&&b){let e=t[r];"number"==typeof e&&e>0&&2*e<24&&a.push({id:"operable.target-size",principle:"operable",heuristic:"Target pointer interaction size is too small",critical:!1,status:"warn",message:`${r}=${e} gives a ~${2*e}px hit target, below the 24×24px minimum for pointer interaction.`,fix:"Increase the radius, or rely on the chart's hoverRadius / keyboard navigation as the alternative for precise selection."})}}a.push({id:"operable.tab-stops",principle:"operable",heuristic:"Inappropriate tab stops",critical:!1,status:S,message:`The chart takes a single tab stop and navigates data with arrow keys${C} — the recommended pattern for dense charts (no per-datum tab stops to wade through).`}),a.push({id:"operable.interaction-cues",principle:"operable",heuristic:"No interaction cues or instructions",critical:!0,...b?f||p?{status:"manual",message:"Chart is interactive and has descriptive text. Confirm that text explains how to interact (keyboard + pointer).",fix:'State the interaction model in summary, e.g. "Use arrow keys to move between points."'}:{status:"warn",message:"Chart is interactive but nothing explains how to use it.",fix:"Describe the interaction in a summary or nearby text (keyboard navigation, what hover/click reveals)."}:{status:"not-applicable",message:"No interactive behavior detected."}}),a.push({id:"operable.controls-override-at",principle:"operable",heuristic:"Controls override AT controls",critical:!0,status:S,message:`Keyboard handlers fire only while the chart has focus, so they don't hijack page/app screen-reader shortcuts${C}.`}),a.push({id:"operable.focus-indicator",principle:"operable",heuristic:"Keyboard focus indicator missing, obscured, or low contrast",critical:!1,status:S,message:`A shape-adaptive focus ring (var(--semiotic-focus)) marks the focused element${C}.`,fix:o?"Ensure --semiotic-focus keeps ≥ 3:1 contrast against your background.":void 0}),a.push({id:"understandable.title-summary-caption",principle:"understandable",heuristic:"No title, summary, or caption",critical:!0,...y?{status:"pass",message:`Provided: ${[h&&"title",p&&"description",f&&"summary"].filter(Boolean).join(", ")}.`}:s?{status:"manual",message:"No title/description/summary on the chart. If the wrapping ChartContainer supplies a title/subtitle, this is covered at that layer — verify it does.",fix:"Give the ChartContainer a title (and optionally enable describe), or set title/description/summary on the chart."}:{status:"fail",message:"No title, description, or summary — the screen reader falls back to a generic label.",fix:"Add title/description/summary on the chart, or wrap it in a ChartContainer (the opt-in layer for title/caption/description chrome)."}}),a.push({id:"understandable.explain-purpose",principle:"understandable",heuristic:"No explanation for purpose or for how to read",critical:!0,...p||f?{status:"pass",message:"A description/summary is available to explain purpose and how to read the chart."}:l?{status:"manual",message:"ChartContainer's describe option explains how to read the chart (type, stats, trend). Confirm the domain purpose — why this chart exists — is also conveyed (title/subtitle).",fix:"Give the ChartContainer a title/subtitle stating the purpose; describe() covers the how-to-read half."}:h?{status:"warn",message:"Only a title is set — a label, not an explanation of purpose or how to read the chart.",fix:"Add a summary, or enable ChartContainer's describe option for an auto-generated how-to-read description."}:{status:"fail",message:"Nothing explains the chart's purpose or how to read it.",fix:"Add a summary/description, or wrap in a ChartContainer with a title and the describe option (the opt-in full-accessibility layer)."}});{let e=[t.description,t.summary].filter(mr).join(". "),r=e?Tr(e):null;a.push({id:"understandable.reading-level",principle:"understandable",heuristic:"Reading level inappropriate",critical:!0,...null==r?{status:"not-applicable",message:"No description/summary text to grade."}:r>9?{status:"warn",message:`Description/summary reads at ~grade ${r.toFixed(0)}; Chartability targets grade 9 or lower.`,fix:"Shorten sentences and prefer common words."}:{status:"pass",message:`Description/summary reads at ~grade ${Math.max(0,Math.round(r))} (≤ 9).`}})}if(ac.has(e)){let e=mr(t.xLabel),r=mr(t.yLabel);a.push({id:"understandable.axis-labels",principle:"understandable",heuristic:"Axis labels are unclear or missing",critical:!1,...e&&r?{status:"pass",message:"Both axes are labeled (xLabel, yLabel)."}:{status:"warn",message:`Missing axis label: ${[!e&&"xLabel",!r&&"yLabel"].filter(Boolean).join(", ")}. Ticks alone may not name the variable.`,fix:"Set xLabel and yLabel to name each axis's variable and units."}})}if(uc.has(e)&&a.push({id:"understandable.information-complexity",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,status:"warn",message:"Dual-axis chart: two y-scales are hard to read accurately and notoriously easy to misinterpret (the crossover point is arbitrary).",fix:"Confirm the second axis is necessary; consider two aligned charts (small multiples) or indexing both series to a common baseline. Label each axis and its series unambiguously."}),x.length>1){let e=x.filter(Ir).length,t=x.length-e;a.push({id:"understandable.annotation-hierarchy",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,...e===x.length?{status:"pass",message:`All ${x.length} annotation(s) declare hierarchy through emphasis or provenance confidence, so the renderer can resolve reading order and visual priority.`}:0===e?{status:"warn",message:`${x.length} annotations are present with no emphasis or provenance confidence; readers may not know which note is primary.`,fix:'Mark the main annotation with emphasis="primary", set supporting notes to emphasis="secondary", or provide provenance.confidence so Semiotic can infer order.'}:{status:"warn",message:`${t} of ${x.length} annotation(s) have no emphasis or provenance confidence; readers may not know which note is primary among the unordered notes.`,fix:"Set emphasis on each annotation (primary/secondary), or provide provenance.confidence on all annotations so Semiotic can infer order."}})}(null!=t.forecast||null!=t.anomaly||null!=t.band||null!=t.regression)&&a.push({id:"understandable.uncertainty",principle:"understandable",heuristic:"Statistical uncertainty isn't clearly communicated",critical:!1,status:"manual",message:"The chart shows a forecast/regression/band/anomaly overlay. Confirm the uncertainty it represents is explained in text, not just drawn.",fix:"State the confidence interval / method in the summary, and label the band so it isn't mistaken for data."}),null!=t.animate&&!1!==t.animate&&a.push({id:"understandable.changes-followable",principle:"understandable",heuristic:"Changes are not easy to follow",critical:!1,status:S,message:`Transitions animate with object constancy and data changes are mirrored to the live region${C}.`,fix:o?"Keep transition durations in the 250ms–2s range so changes are followable but not slow.":void 0}),a.push({id:"robust.conforms-to-standards",principle:"robust",heuristic:"Does not conform to standards",critical:!1,status:"manual",message:"WCAG 2.1 / Section 508 conformance can't be settled from config alone.",fix:"Run an automated checker (axe) on the rendered output and test with real assistive tech."}),a.push({id:"robust.semantically-valid",principle:"robust",heuristic:"Semantically invalid",critical:!1,status:"manual",message:"Whether interactive elements expose correct roles/names is a render-time, screen-reader question.",fix:"Verify with a screen reader that buttons read as buttons, the chart as an image/group, etc."}),a.push({id:"robust.fragile-technology-support",principle:"robust",heuristic:"Fragile technology support",critical:!1,status:S,message:`Charts render on canvas with an SVG overlay and render to SVG in SSR, so access isn't tied to one rendering path${C}.`,fix:o?"Still test across NVDA+Firefox, JAWS+Chrome, and VoiceOver+Safari — AT support varies.":void 0}),a.push({id:"compromising.table",principle:"compromising",heuristic:"No table",critical:!0,...u?{status:"not-applicable",message:"Single-value display — a table isn't meaningful."}:g?{status:"pass",message:"A human-readable data table is provided (accessibleTable)."}:{status:"fail",message:"accessibleTable is disabled — no human-readable table of the underlying data.",fix:"Remove accessibleTable={false} (unless title/summary/annotations already convey all the data)."}}),u||a.push({id:"compromising.table-static",principle:"compromising",heuristic:"Table/data is static",critical:!1,...s?{status:"manual",message:"Rendered in a ChartContainer. If a data-download action is enabled, the data is exportable.",fix:"Enable the ChartContainer data-download action so users can save the underlying data (keep it opt-in)."}:{status:"warn",message:"The data table is read-only — not downloadable, sortable, or filterable.",fix:"Wrap the chart in a ChartContainer and enable its data-download action (opt-in, so deployments can withhold it where export isn't allowed)."}}),a.push({id:"compromising.shareable-state",principle:"compromising",heuristic:"State is not easy to share and reproduce",critical:!1,status:o?"pass":"manual",message:`Chart state serializes via toConfig/toURL/copyConfig${o?"":C}.`,fix:o?"Expose it to users via the ChartContainer copyConfig action or a shareable URL.":void 0}),a.push({id:"compromising.navigable-structure",principle:"compromising",heuristic:"Information cannot be navigated according to narrative or structure",critical:!1,...c?d?{status:"pass",message:"ChartContainer's navigable option mounts a structured navigation tree, including hierarchy/network branches and their data items."}:{status:"pass",message:"ChartContainer's navigable option mounts a structured tree (chart → axes/series → data points) that screen readers can traverse."}:d?{status:"warn",message:"Hierarchical chart: built-in keyboard navigation is largely flat — it doesn't descend the tree structure.",fix:"Enable ChartContainer's navigable option for a structured navigation tree, or lean on the data table and a summary that conveys the hierarchy."}:{status:S,message:`Keyboard navigation steps through points and switches series/groups${C}.`,fix:o?"For deeper structure (axis → series → datum), enable ChartContainer's navigable option.":void 0}});{let r,i=Array.isArray(t.data)?t.data:null,n=Array.isArray(t.nodes)?t.nodes:null,o={id:"assistive.data-density",principle:"assistive",heuristic:"Data density is inappropriate",critical:!0};r=ec.has(e)&&i&&i.length>7?{...o,status:"warn",message:`${i.length} slices in a part-to-whole chart. Chartability suggests ≤ 5 categories; many thin slices are hard to perceive and to describe.`,fix:'Group small slices into an "Other" category, or switch to a ranked bar chart.'}:n&&n.length>200?{...o,status:"warn",message:`${n.length} nodes. A network this size is hard to navigate non-visually node by node.`,fix:"Provide a summary of structure (clusters, hubs, components) and consider filtering or aggregating the graph."}:i&&i.length>5e3?{...o,status:"warn",message:`${i.length} data points. Canvas renders this fine, but the non-visual table/navigation become unwieldy.`,fix:"Aggregate or bin for the accessible representation, or expose summary statistics rather than every row."}:i?{...o,status:"pass",message:`${i.length} data points — a reasonable density for non-visual consumption.`}:n?{...o,status:"pass",message:`${n.length} nodes — a reasonable density for non-visual consumption.`}:{...o,status:"manual",message:"Data not provided inline (push mode); verify density at runtime."},a.push(r)}{let e=Array.isArray(t.data)?t.data:null,r=["valueFormat","yFormat","xFormat","tickFormat","format"].some(e=>"function"==typeof t[e]||"string"==typeof t[e]),i=!1;if(e&&!r)for(let t of e.slice(0,50))if(t&&"object"==typeof t){for(let e of Object.values(t))if("number"==typeof e&&Number.isFinite(e)&&Math.abs(e)>=1e5){i=!0;break}if(i)break}i&&a.push({id:"assistive.human-readable-numbers",principle:"assistive",heuristic:"Data in text is not human-readable",critical:!1,status:"warn",message:'Data includes large numbers (≥ 100,000) and no value/tick formatter — screen readers will read every digit (e.g. "six hundred fifty thousand…").',fix:'Pass valueFormat / yFormat (e.g. a compact formatter so 6,500,000 reads as "6.5M"); the formatter flows to ticks, tooltips, and the data table.'})}a.push({id:"assistive.features-described",principle:"assistive",heuristic:"Visually apparent features and relationships are not described",critical:!1,...l?{status:"pass",message:"ChartContainer's describe option auto-generates an L1–L3 description (chart type, statistics, and trend) via describeChart()."}:f?{status:"manual",message:"A summary is present. Confirm it describes trends, extrema, clusters, and outliers — not just what the chart is.",fix:"Cover the L2/L3 content blind readers value most: direction of trend, peak/trough, notable outliers."}:{status:"warn",message:"No text describes the visually apparent trends, extrema, or outliers.",fix:"Enable ChartContainer's describe option (auto-generates via describeChart()), or write a summary covering the key trend and notable points."}}),a.push({id:"assistive.skippable-navigation",principle:"assistive",heuristic:"Navigation and interaction is tedious",critical:!0,...u?{status:"not-applicable",message:"Single value — nothing to skip."}:g?{status:"pass",message:'A "Skip to data table" link lets screen-reader users bypass point-by-point navigation.'}:{status:"warn",message:"accessibleTable is off, removing the skip-to-table affordance.",fix:"Keep accessibleTable enabled so users can skip past dense point navigation."}}),a.push({id:"flexible.user-style-respected",principle:"flexible",heuristic:"User style change not respected",critical:!0,status:S,message:`Styling flows through CSS custom properties and honors forced-colors mode, so user/user-agent style changes cascade in${C}.`,fix:o?"Avoid hardcoding colors via frameProps style fns that bypass theme variables.":void 0}),a.push({id:"flexible.reduced-motion",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...oc.has(e)||cc.has(e)?v?{status:"pass",message:`${e} animates continuously and declares an in-chart pause/stop control.`}:{status:"warn",message:`${e} animates continuously. prefers-reduced-motion is auto-honored, but there's no in-chart pause/stop control for users who don't set that preference.`,fix:"Offer a pause/stop control for looping/streaming motion (Chartability requires it for animation > 2s)."}:{status:S,message:`prefers-reduced-motion is auto-detected; transitions fast-forward and looping animation stops${C}.`}}),n&&(a.push({id:"flexible.sim-pause-control",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...v?{status:"pass",message:"Physics simulation exposes a pause/stop control for users who need to stop motion."}:{status:"warn",message:"Physics simulation has no declared pause/stop control.",fix:"Provide a visible pause control and set physics.pauseControl=true (or pauseControl=true) so the contract is auditable."}}),a.push({id:"flexible.settled-projection",principle:"flexible",heuristic:"User style change not respected",critical:!1,...A?{status:"pass",message:"A settled-projection table is declared, so non-visual readers get aggregate chart semantics instead of trajectories."}:{status:"warn",message:"Physics chart does not declare a settled projection for its accessible table.",fix:"Provide aggregate rows from the settled projection and set physics.settledProjection=true."}}),a.push({id:"flexible.reduced-motion-settle",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...$?{status:"pass",message:"Reduced-motion mode settles the simulation to a static chart state instead of freezing bodies mid-flight."}:{status:"warn",message:"Physics chart does not declare reduced-motion synchronous settle behavior.",fix:"In reduced motion, run the world to its settled projection and paint once; set physics.reducedMotionSettle=true."}}));{let r=!0===t.responsiveWidth||!0===t.responsiveHeight,i=dc.has(e)&&!0===t.zoomable;a.push({id:"flexible.zoom-reflow",principle:"flexible",heuristic:"Zoom and reflow are not supported",critical:!1,...r?{status:"pass",message:`Chart reflows to its container (${[!0===t.responsiveWidth&&"responsiveWidth",!0===t.responsiveHeight&&"responsiveHeight"].filter(Boolean).join(", ")}), so page zoom doesn't clip it.`}:i?{status:"pass",message:"Geo chart is zoomable/pannable."}:{status:"manual",message:"Fixed width/height — verify the chart survives browser zoom and reflow without clipping or loss of function.",fix:"Use responsiveWidth/responsiveHeight so the chart reflows to its container."}})}i&&(i.encodings?.some(e=>"color"===e.channel&&(!e.redundantWith||0===e.redundantWith.length))&&a.push({id:"perceivable.recipe-color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,status:"warn",message:`${i.name} declares a color encoding without a redundant cue.`,fix:"Add shape, label, position, texture, or a textual category summary to the recipe encoding."}),"required"===i.accessibility.description&&!p&&a.push({id:"understandable.recipe-description",principle:"understandable",heuristic:"Features are not described",critical:!1,status:"fail",message:`${i.name} requires a recipe-aware description, but none is attached.`,fix:"Call describeChart with recipeId/recipe metadata and attach the returned text as description."}),i.accessibility.fallbackTable&&!1===t.accessibleTable&&a.push({id:"compromising.recipe-fallback",principle:"compromising",heuristic:"No data table is provided",critical:!0,status:"fail",message:`${i.name} requires a fallback table, but accessibleTable is disabled.`,fix:"Enable accessibleTable and preserve recipe-declared table fields on scene nodes."}));let k=a.filter(e=>"not-applicable"!==e.status).filter(e=>e.critical),R={criticalsPassed:k.filter(e=>"pass"===e.status).length,criticalsEvaluated:k.length,fails:a.filter(e=>"fail"===e.status).length,warnings:a.filter(e=>"warn"===e.status).length,manual:a.filter(e=>"manual"===e.status).length,passes:a.filter(e=>"pass"===e.status).length};return{component:e,ok:!k.some(e=>"fail"===e.status),summary:R,findings:a,reference:"Chartability (POUR-CAF) — https://chartability.github.io/POUR-CAF/. Not a pass/fail cert; pair with manual screen-reader testing (NVDA+Firefox, JAWS+Chrome, VoiceOver+Safari)."}}function Dr(e,{onlyCritical:t=!1}={}){let r=[];for(let a of e.findings)"fail"!==a.status&&"warn"!==a.status||t&&!a.critical||r.push(a.message);return r}function Ur(e){let t=[],r=e.summary,a=e.ok?`${r.criticalsPassed}/${r.criticalsEvaluated} critical heuristics pass`:`${r.fails} blocking failure(s) — ${r.criticalsPassed}/${r.criticalsEvaluated} critical heuristics pass`;t.push(`${e.ok?"✓":"✗"} ${e.component}: accessibility audit (Chartability POUR-CAF)`),t.push(` ${a} · ${r.warnings} warning(s) · ${r.manual} to verify manually`);for(let r of Gc){let a=e.findings.filter(e=>e.principle===r&&"not-applicable"!==e.status);if(0!==a.length){t.push(""),t.push(` ${r.toUpperCase()}`);for(let e of a){let r=e.critical?" [critical]":"";t.push(` ${Vc[e.status]} ${e.id}${r}: ${e.message}`),e.fix&&("fail"===e.status||"warn"===e.status||"manual"===e.status)&&t.push(` → ${e.fix}`)}}}return t.push(""),t.push(` Ref: ${e.reference}`),t.join("\n")}function Vr(e){return e.semanticDiagnostics?.length?e.semanticDiagnostics:"degenerate"===e.semanticStatus?[Hc]:[]}function Gr(e){let{contract:t,transfer:r,binding:a}=e;if(void 0===t&&void 0===r&&void 0===a)return[];let i=[],n=Array.isArray(a?.mismatchPaths)?a.mismatchPaths.filter(e=>"string"==typeof e):[];return r&&"preserved"!==r.status&&"excluded"!==r.status?i.push({id:"artifact.transfer-invalid",status:"fail",message:`The attached artifact transfer is ${r.status}; its contract cannot be relied on for publication.`}):(!r||void 0===t)&&i.push({id:"artifact.transfer-unknown",status:"unknown",message:"The attached artifact lacks a contract or a transfer report."}),"mismatch"===a?.status||n.length>0?i.push({id:"artifact.identity-mismatch",status:"fail",message:"The attached artifact does not identify this chart input"+(n.length?`: ${n.join(", ")}`:".")}):("match"!==a?.status||!Array.isArray(a.mismatchPaths)||!Array.isArray(a.unknownPaths)||a.mismatchPaths.length>0||a.unknownPaths.length>0)&&i.push({id:"artifact.identity-unknown",status:"unknown",message:"The attached artifact identity has not been fully verified."}),i}function Hr(e){return e.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function qr(e,t,r){return{id:`${t}.${e.code.toLowerCase()}.${r+1}`,stage:t,severity:e.severity,code:e.code,message:e.message,...e.fix?{fix:e.fix}:{},source:"data"===t?"auditData":"diagnoseConfig",...e.field?{field:e.field}:{},...e.role?{role:e.role}:{},...e.rows?{rows:e.rows}:{},...void 0!==e.count?{count:e.count}:{}}}function Wr(e,t){let r="fail"===e.status?"error":"warn"===e.status?"warning":"manual";return{id:e.id||`accessibility.${t+1}`,stage:"accessibility",severity:r,code:e.id,message:e.message,...e.fix?{fix:e.fix}:{},source:"auditAccessibility",critical:e.critical,principle:e.principle,heuristic:e.heuristic}}function Yr(e){return e.map((e,t)=>({finding:e,index:t})).sort((e,t)=>{let r=qc[e.finding.severity]-qc[t.finding.severity];if(0!==r)return r;let a=!0===e.finding.critical;if(a!==(!0===t.finding.critical))return a?-1:1;let i=Wc[e.finding.stage]-Wc[t.finding.stage];return 0!==i?i:e.index-t.index}).map(({finding:e},t)=>({...e,rank:t+1}))}function Kr(e,t){let r=[];e.component!==t&&r.push({id:"render.component-mismatch",stage:"render",severity:"error",code:"RENDER_COMPONENT_MISMATCH",message:"The render evidence names a different chart component.",source:"renderChartWithEvidence"});for(let t of Gr({contract:e.artifactContract,transfer:e.artifactTransfer,binding:e.artifactBinding}))r.push({id:`render.${t.id}`,stage:"render",severity:"fail"===t.status?"error":"manual",code:t.id.toUpperCase().replace(/[.-]/g,"_"),message:t.message,source:"artifactAttachmentIssues"});e.empty&&r.push({id:"render.empty-scene",stage:"render",severity:"error",code:"EMPTY_SCENE",message:"The renderer produced no data marks.",fix:"Check the data shape, accessors, scales, and filters against the rendered evidence.",source:"renderChartWithEvidence"});let a=/* @__PURE__ */new Set;for(let t of Vr(e))a.add(t.code),r.push({id:`render.${t.code.toLowerCase()}`,stage:"render",severity:t.severity,code:t.code,message:t.message,...t.fix?{fix:t.fix}:{},source:"capability.semanticViability"});for(let t of e.warnings)a.has(t)||r.push({id:`render.${t.toLowerCase()}`,stage:"render",severity:"warning",code:t,message:`The renderer reported ${Hr(t).toLowerCase()}.`,fix:"Inspect the render evidence and resolve the warning before relying on the chart.",source:"renderChartWithEvidence"});return r}function Jr(e,t){let r=e.filter(e=>"manual"!==e.severity),a=r.slice(0,t).map(e=>({id:`chart-evaluation-${e.id}`,level:"error"===e.severity?"error":"warning",title:`${e.stage}: ${Hr(e.code)}`,message:e.fix?`${e.message} ${e.fix}`:e.message,source:"Semiotic chart evaluation",dismissible:!0}));return r.length>t&&a.push({id:"chart-evaluation-overflow",level:"warning",title:"Additional chart evaluation findings",message:r.length-t+" additional finding(s) are available in the ranked evaluation result.",source:"Semiotic chart evaluation",dismissible:!0}),a}function Xr(e){let t=e.ok?"PASS":"ISSUES FOUND",r=[`${e.component}: ${t}`,`${e.summary.errors} error(s) · ${e.summary.warnings} warning(s) · ${e.summary.manual} manual check(s)`];for(let t of e.findings)r.push(`${t.rank}. [${t.stage}/${t.code}] ${t.message}`),t.fix&&r.push(` Fix: ${t.fix}`);return r.join("\n")}function Zr(e,t={},r,a={}){let i=void 0===r?t:{...t,data:r},n=Pe(e,i),o=_t(e,i,r,a.dataAudit),s=fr(e,i).diagnoses.filter(e=>"data"!==e.domain&&"VALIDATION"!==e.code),l=_r(e,i,{inChartContainer:a.inChartContainer,describe:a.describe,navigable:a.navigable}),c=[];for(let[e,t]of n.errors.entries())c.push({id:`validation.${e+1}`,stage:"deception",severity:"error",code:"VALIDATION",message:t,fix:"Correct the component name, required props, prop types, and data shape.",source:"validateProps"});o.diagnoses.forEach((e,t)=>{c.push(qr(e,"data",t))}),s.forEach((e,t)=>{c.push(qr(e,"deception",t))}),l.findings.filter(e=>"pass"!==e.status&&"not-applicable"!==e.status).forEach((e,t)=>{c.push(Wr(e,t))});let u,d=c.some(e=>"error"===e.severity&&"accessibility"!==e.stage);if(a.render&&n.valid&&!d)try{u=a.render(e,i).evidence,c.push(...Kr(u,e))}catch{c.push({id:"render.failed",stage:"render",severity:"error",code:"RENDER_FAILED",message:"The injected renderer failed before producing render evidence.",fix:"Check the chart configuration and renderer-specific requirements.",source:"renderChartWithEvidence"})}let h=Yr(c),p=h.filter(e=>"error"===e.severity).length,f=h.filter(e=>"warning"===e.severity).length,m=h.filter(e=>"manual"===e.severity).length,g=Jr(h,Math.max(0,Math.floor(a.notificationMax??8)));return{component:e,validation:n,data:o,deception:s,accessibility:l,...u?{evidence:u}:{},ok:0===p,summary:{errors:p,warnings:f,manual:m,findings:h.length,notifications:g.length},findings:h,notifications:g}}function Qr(e,t=8){return Jr(e,Math.max(0,Math.floor(t)))}function ea(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function ta(e){if(!("number"!=typeof e.height||e.height<=0))return e.width>=e.height?"landscape":"portrait"}function ra(e){if(!("number"!=typeof e.height||e.height<=0))return e.width/e.height}function aa(e,t){let{when:r}=e,a=t.width,i=t.height,n=ra(t),o=ta(t);return!("number"==typeof r.minWidth&&a<r.minWidth||"number"==typeof r.maxWidth&&a>r.maxWidth||"number"==typeof r.minHeight&&("number"!=typeof i||i<r.minHeight)||"number"==typeof r.maxHeight&&("number"!=typeof i||i>r.maxHeight)||"number"==typeof r.minAspectRatio&&("number"!=typeof n||n<r.minAspectRatio)||"number"==typeof r.maxAspectRatio&&("number"!=typeof n||n>r.maxAspectRatio)||r.orientation&&o!==r.orientation)}function ia(e,t){let r={...e,...t};for(let a of["margin","frameProps","mobileSemantics","style"])ea(e[a])&&ea(t[a])&&(r[a]={...e[a],...t[a]});return"string"==typeof e.className&&"string"==typeof t.className&&(r.className=`${e.className} ${t.className}`),r}function na(e,t,r=e.responsiveRules){if(!Array.isArray(r)||0===r.length)return{props:e,matches:[]};let a=r.map((e,t)=>({rule:e,index:t})).filter(e=>aa(e.rule,t)).sort((e,t)=>("number"==typeof e.rule.priority?e.rule.priority:e.index)-("number"==typeof t.rule.priority?t.rule.priority:t.index));return{props:a.reduce((e,t)=>ia(e,t.rule.transform),e),matches:a}}function oa(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function sa(e){return"string"==typeof e&&e.trim().length>0}function la(e){let t=oa(e.capability)?e.capability:null,r=oa(e.recipe)?e.recipe:null,a=[e.mobileSemantics,e.mobileVisualization,e.mobile,t?.mobile,r?.mobile];for(let e of a)if(oa(e))return e;return null}function ca(e,t){return e.includes("CustomChart")||e.includes("Custom")||null!=t.recipeId||null!=t.mobileSemantics}function ua(e){return Array.isArray(e)&&e.length>=2&&"number"==typeof e[0]&&"number"==typeof e[1]&&Number.isFinite(e[0])&&Number.isFinite(e[1])?[e[0],e[1]]:null}function da(e){return ua(e.size)||ua(oa(e.frameProps)?e.frameProps.size:void 0)||("number"==typeof e.width&&"number"==typeof e.height?[e.width,e.height]:null)}function ha(e){let t=la(e);return!0===e.responsive||!0===e.mobile||!0===t?.responsive||!0===t?.supportsResponsiveLayout||Array.isArray(t?.breakpoints)||"number"==typeof t?.minViewportWidth||"responsive"===t?.strategy||"small-multiples"===t?.strategy||"summary-cards"===t?.strategy||null!=e.mobileLayout||null!=e.responsiveRules||"mobile-readable"===e.density}function pa(e){let t=la(e),r=oa(e.mobileInteraction)?e.mobileInteraction:null;return null!=e.controls||null!=e.mobileControls||!0===e.alternativeControls||null!=e.selection||null!=e.onClick||null!=e.onSelect||!0===e.mobileInteraction||!0===r?.tapToSelect||!0===r?.tapToLockTooltip||Array.isArray(t?.interaction?.alternatives)&&t.interaction.alternatives.length>0||"tap"===t?.interaction?.primary||"button"===t?.interaction?.primary||sa(t?.interaction?.hoverFallback)}function fa(e,t){let r=la(e),a=(oa(e.mobileInteraction)?e.mobileInteraction:null)?.standardControls,i=Array.isArray(r?.interaction?.alternatives)&&r.interaction.alternatives.length>0;return!(null==e.controls&&null==e.mobileControls&&!0!==e.alternativeControls&&!i&&!0!==a&&"all"!==a)||t.every(e=>"brush"===e?Array.isArray(a)?a.includes("brush"):"brush"===a:"pan/zoom"===e?Array.isArray(a)?a.includes("zoom"):"zoom"===a:"legend filtering"===e&&(Array.isArray(a)?a.includes("legend"):"legend"===a))}function ma(e){let t=oa(e.frameProps)?e.frameProps:{};return(!0===e.enableHover||null!=e.tooltipContent||null!=e.tooltip||null!=t.tooltipContent||!0===t.enableHover)&&!pa(e)}function ga(e){let t=[e.data,e.points,e.lines,e.nodes,e.edges,e.areas,oa(e.frameProps)?e.frameProps.data:void 0],r=0;for(let e of t)Array.isArray(e)&&(r+=e.length);return r}function ya(e){let t=[e.tickValues,e.xTickValues,e.yTickValues,e.rTickValues,e.oTickValues],r=0;for(let e of t)Array.isArray(e)&&(r+=e.length);return r>0?r:null}function ba(e,t){let r=Kc[e];if(!r)return null;let a=r.includes("hoverRadius")?30:null;for(let e of r){let r=t[e];"number"==typeof r&&Number.isFinite(r)&&r>0&&(a=null==a?r:Math.max(a,r))}return null==a?null:2*a}function va(e,t){e.push({...t,status:"pass"})}function wa(e,t){e.push({...t,status:"warn"})}function Aa(e,t){e.push({...t,status:"manual"})}function $a(e,t={},r={}){let a=r.viewportWidth??390,i=r.targetSize??44,n=da(t),o=na(t,{width:a,height:n?.[1]}),s=[],l=da(t=o.props),c=la(t),u=ca(e,t),d=ha(t),h=!0===r.inChartContainer,p=sa(t.title)||sa(t.summary)||sa(t.description)||!0===c?.summary||sa(c?.summary);if(o.matches.length>0&&va(s,{id:"layout.responsive-rule-applied",category:"layout",impact:"medium",message:`${o.matches.length} responsive rule(s) applied for the ${a}px mobile audit.`}),l){let[t,r]=l;t>a&&!d?wa(s,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:`Chart size is ${t}px wide against a ${a}px mobile viewport with no responsive/mobile transform hint.`,fix:"Use responsive sizing, responsiveRules/mobileLayout, or an explicit mobile variant that preserves the task instead of clipping the desktop chart."}):va(s,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:"No fixed desktop-width overflow risk is visible from the config."}),"number"==typeof c?.minViewportWidth&&c.minViewportWidth>a&&wa(s,{id:"layout.mobile-min-width",category:"layout",impact:"high",message:`The declared mobile contract supports ${c.minViewportWidth}px minimum, wider than the audited ${a}px viewport.`,fix:"Add a narrower breakpoint, summary-card fallback, or explicit horizontal-scroll affordance with a non-visual equivalent."});let i=t/Math.max(1,r);a<=430&&i>2.4&&"BigNumber"!==e&&wa(s,{id:"layout.wide-aspect-ratio",category:"layout",impact:"medium",message:`Chart aspect ratio is ${i.toFixed(1)}:1, which tends to compress phone charts vertically.`,fix:"Prefer stacked sections, small multiples, cards plus a sparkline, or a taller mobile-specific chart ratio."}),r<160&&"BigNumber"!==e&&wa(s,{id:"layout.too-short-for-reading",category:"layout",impact:"medium",message:`Chart height is ${r}px; most phone charts need enough vertical room for marks plus readable labels.`,fix:"Reserve more vertical space, remove nonessential axes, or switch to a card/sparkline pattern with external labels."})}else Aa(s,{id:"layout.unknown-size",category:"layout",impact:"medium",message:"No explicit size is available to audit. This may be responsive, but static mobile overflow cannot be checked.",fix:"Audit rendered widths at 320, 360, 390, and 430px, or pass size/responsiveRules metadata into the config."});let f=ga(t);f>0&&(f>("number"==typeof c?.maxMarks?c.maxMarks:Yc.has(e)?1.25*a:ic.has(e)?Math.max(8,Math.floor(a/34)):a)?wa(s,{id:"density.mark-budget",category:"density",impact:Yc.has(e)?"medium":"high",message:`${f} data item(s) exceed the rough mobile density budget for ${e} at ${a}px.`,fix:"Aggregate, filter, facet into small multiples, switch to a summary-card plus detail view, or use progressive disclosure."}):va(s,{id:"density.mark-budget",category:"density",impact:"medium",message:`${f} data item(s) are within the rough mobile density budget for this component.`}));let m=ya(t),g=!1!==t.showAxes&&!1!==t.axis;if(g&&null!=m){let e=Math.max(3,Math.floor(a/58));m>e&&wa(s,{id:"density.explicit-tick-count",category:"density",impact:"medium",message:`${m} explicit tick(s) exceed a phone-friendly budget of about ${e} at ${a}px.`,fix:"Use adaptive ticks, fewer tickValues, direct labels, or move exact values into a tap-accessible detail panel."})}else g&&(Yc.has(e)||ic.has(e))&&Aa(s,{id:"density.axis-label-collision",category:"density",impact:"medium",message:"Axes are enabled, but label collision depends on rendered tick text and cannot be checked statically.",fix:"Verify tick labels at phone widths or provide explicit mobile tick density."});ma(t)?wa(s,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"The chart exposes tooltip/hover detail without an obvious tap, selection, or control alternative.",fix:"Enable tap-to-select, a persistent details panel, visible segment buttons, or another non-hover path for the same information."}):va(s,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"No hover-only detail path is visible from the config."});let y=ba(e,t),b=oa(t.mobileInteraction)?t.mobileInteraction:null,v="number"==typeof b?.targetSize?b.targetSize:!0===t.mobileInteraction?44:"number"==typeof c?.minimumHitTarget?c.minimumHitTarget:"number"==typeof c?.interaction?.targetSize?c.interaction.targetSize:null,w=y??v;null!=w&&(w<24?wa(s,{id:"interaction.target-size-minimum",category:"interaction",impact:"high",message:`Small interactive marks expose an estimated ${w}px pointer target, below WCAG's 24px minimum.`,fix:"Increase mark radius/hoverRadius, add tap snapping to nearest datum, or provide larger external controls."}):w<i?wa(s,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${w}px, above 24px but below the ${i}px comfortable phone target.`,fix:"Use hoverRadius/tapRadius near 44px while keeping the visible mark small if needed."}):va(s,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${w}px, meeting the configured ${i}px target.`}));let A=[];(null!=t.brush||null!=t.onBrush)&&A.push("brush"),!0===t.zoomable&&A.push("pan/zoom"),("isolate"===t.legendInteraction||"highlight"===t.legendInteraction)&&A.push("legend filtering"),A.length>0&&!fa(t,A)&&wa(s,{id:"interaction.complex-gesture-alternative",category:"interaction",impact:"high",message:`Mobile-hostile complex interaction detected: ${A.join(", ")} without standard control alternatives.`,fix:"Pair gestures with buttons, range inputs, chips, or a details panel that works with touch and keyboard."});let $=!1!==t.showLegend&&!1!==t.legend&&(!0===t.showLegend||!0===t.legend||null!=t.colorBy||null!=t.groupBy||null!=t.lineBy||null!=t.areaBy||null!=t.stackBy),x=!0===t.directLabel||!0===t.showLabels||"direct"===t.labelStrategy||"direct-end"===t.labelStrategy||"direct"===c?.labels?.strategy||"inline"===c?.labels?.strategy||"external"===c?.labels?.strategy;$&&!x&&a<=430&&wa(s,{id:"semantics.legend-over-direct-labels",category:"semantics",impact:"medium",message:"The chart appears to rely on a legend instead of direct labels at phone width.",fix:"Prefer direct end labels, inline labels, or a compact chip selector so readers do not bounce between plot and legend."});let S=Array.isArray(t.annotations)?t.annotations.filter(e=>oa(e)):[],C="number"==typeof c?.maxAnnotations?c.maxAnnotations:3;if(S.length>C&&a<=430&&wa(s,{id:"annotation.mobile-density",category:"annotation",impact:"medium",message:`${S.length} annotation(s) compete for phone plot space.`,fix:"Assign annotation priority, collapse secondary notes into a callout list, or provide shorter mobileText."}),S.length>0){let e=S.filter(e=>!sa(e.mobileText)&&!sa(e.shortText)&&!sa(e.label));e.length>0&&Aa(s,{id:"annotation.mobile-copy",category:"annotation",impact:"low",message:`${e.length} annotation(s) lack explicit short/mobile copy.`,fix:"Add mobileText or shortText for notes that need to survive narrow layouts."})}!d&&"BigNumber"!==e&&Aa(s,{id:"layout.no-responsive-transform",category:"layout",impact:"low",message:"No explicit responsive transformation hint is present.",fix:"Declare responsiveRules/mobileLayout or a density/label strategy so the mobile version is a designed transformation, not an accidental resize."}),u&&(c?(va(s,{id:"semantics.custom-mobile-contract",category:"semantics",impact:"medium",message:"Custom chart/recipe provides a mobileSemantics/mobile contract, so the audit can inspect its authored phone behavior."}),!1===c.custom?.dataBearingSceneNodes?wa(s,{id:"semantics.custom-data-bearing-scene",category:"semantics",impact:"medium",message:"Custom mobile contract says emitted scene nodes are not data-bearing.",fix:"Preserve datum references, semantic roles, or accessible-table fields so intelligence, navigation, and tap details can recover the chart's meaning."}):!0!==c.custom?.dataBearingSceneNodes&&Aa(s,{id:"semantics.custom-data-bearing-scene",category:"semantics",impact:"low",message:"Custom chart mobile contract does not state whether scene nodes are data-bearing.",fix:"Set mobile.custom.dataBearingSceneNodes and mobile.custom.navigationGranularity for custom layouts and interoperability adapters."})):Aa(s,{id:"semantics.custom-mobile-contract",category:"semantics",impact:"medium",message:"Custom chart layout is opaque to static mobile analysis because no mobileSemantics/mobile contract is present.",fix:"Declare mobileSemantics with strategy, breakpoints, mark budgets, touch target size, interaction alternatives, and custom scene semantics."})),!p&&!h&&wa(s,{id:"semantics.no-mobile-summary",category:"semantics",impact:"medium",message:"No title, summary, description, or ChartContainer context is visible from the config.",fix:"Add title/summary text or wrap in ChartContainer so the small-screen reader gets the task before the chart."});let k=s.filter(e=>"warn"===e.status),R={highRisk:k.filter(e=>"high"===e.impact).length,warnings:k.length,manual:s.filter(e=>"manual"===e.status).length,passes:s.filter(e=>"pass"===e.status).length};return{component:e,viewportWidth:a,ok:0===R.highRisk,summary:R,findings:s,reference:"Mobile visualization audit: informed by MobileVisFixer, mobile exploratory interaction research, small-multiple mobile studies, responsive visualization grammars, constraint-based breakpoints, and WCAG 2.2 input modalities."}}function xa(e){let t=[],r=e.summary,a=e.ok?`no high-risk mobile blockers at ${e.viewportWidth}px`:`${r.highRisk} high-risk mobile issue(s) at ${e.viewportWidth}px`;t.push(`${e.ok?"PASS":"WARN"} ${e.component}: mobile visualization audit`),t.push(` ${a} - ${r.warnings} warning(s) - ${r.manual} manual check(s)`);for(let r of Xc){let a=e.findings.filter(e=>e.category===r&&"not-applicable"!==e.status);if(0!==a.length){t.push(""),t.push(` ${r.toUpperCase()}`);for(let e of a)t.push(` ${Jc[e.status]} [${e.impact}] ${e.id}: ${e.message}`),e.fix&&("warn"===e.status||"manual"===e.status)&&t.push(` -> ${e.fix}`)}}return t.push(""),t.push(` Ref: ${e.reference}`),t.join("\n")}function Sa(){return["Static audit only: rendered label collision, CSS-resolved type size, and actual touch behavior still require viewport testing.","Use multiple widths, usually 320, 360, 390, 430, and 768 CSS pixels.","A mobile pass means no high-risk static warnings, not that the chart is perceptually or ergonomically optimal."]}function Ca(e,t){if("function"==typeof e)return t=>+e(t);let r=e||t;return e=>+e[r]}function ka(e,t){if("function"==typeof e)return e;let r=e||t;return e=>e[r]}function Ra(){let e=globalThis;return e[Zc]??(e[Zc]={intents:/* @__PURE__ */new Map}),e[Zc]}function Pa(e,t){return eu.has(e)||tu.has(e)||"SwimlaneChart"===e||"GaugeChart"===e?{measure:t.valueAccessor,measureFallback:"value",dimension:t.categoryAccessor??t.stepAccessor,dimensionFallback:"category"}:{measure:t.yAccessor??t.valueAccessor,measureFallback:"y",dimension:t.xAccessor,dimensionFallback:"x"}}function Na(e){for(let t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){let r=e[t];if("string"==typeof r&&r)return r}}function Ea(e,t){return null==e?"—":e instanceof Date?e.toISOString().slice(0,10):"number"==typeof e?t(e):String(e)}function Ia(e,t={}){let r=!0===t.showRetractedAnnotations,a=!0===t.showSupersededAnnotations,i=/* @__PURE__ */new Set;for(let t of e){let e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&i.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!r)return!1;let t=e?.provenance?.stableId;return!(t&&i.has(t)&&!a)})}function Ta(e){return"string"==typeof e?e:e.id??e.name}function Ma(e){return e.layoutConfig&&"object"==typeof e.layoutConfig?e.layoutConfig:{}}function Oa(e){return Array.isArray(e.data)?e.data:Array.isArray(e.nodes)?e.nodes:Array.isArray(e.points)?e.points:Array.isArray(e.areas)?e.areas:[]}function Fa(e,t,r){return r??Nr(t.recipe)??Nr(t.recipeId)??kr(e)}function ja(e,t,r=[]){let a=e.accessor?t[e.accessor]:void 0;if("string"==typeof a&&a)return a;if(e.field)return e.field;let i=r.find(e=>e&&"object"==typeof e);if(!i)return;let n=Object.entries(i).filter(([e,t])=>!e.startsWith("_")&&null!=t);return"quantitative"===e.semanticType?n.find(([,e])=>"number"==typeof e)?.[0]:"identifier"===e.semanticType?["id","key","name"].find(e=>e in i):n.find(([,e])=>"string"==typeof e)?.[0]}function za(e,t){return e.dataRoles.find(e=>e.role===t)}function Ba(e,t){return e.dataRoles.find(e=>t.includes(e.semanticType))}function La(e,t,r,a,i,n={}){let o={...n};if(t)for(let[e,r]of Object.entries(t))o[e]=r;for(let e of r.dataRoles){let r=ja(e,a,i),n=t&&r?t[r]:r;void 0!==n&&(o[e.role]=n)}return e.replace(/\{([^}]+)\}/g,(e,t)=>{let r=o[t];return null==r?`{${t}}`:String(r)})}function _a(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Da(e){try{return{number:new Intl.NumberFormat(e,{maximumFractionDigits:2}),percent:new Intl.NumberFormat(e,{style:"percent",maximumFractionDigits:1})}}catch{return{number:new Intl.NumberFormat("en",{maximumFractionDigits:2}),percent:new Intl.NumberFormat("en",{style:"percent",maximumFractionDigits:1})}}}function Ua(e,t,r,a){let i=Ba(e,["nominal","ordinal"]),n=Ba(e,["quantitative"]),o=i?ja(i,r,t):void 0,s=n?ja(n,r,t):void 0,l=i?.role??o??"category",c=n?.role??s??"value",u=e.encodings??[],d=u.length?u.slice(0,3).map(e=>e.meaning.replace(/\.$/,"")).join("; "):`${l} and ${c} are mapped through the recipe's declared visual semantics`,{number:h,percent:p}=Da(a),f=/* @__PURE__ */new Map;if(o&&s)for(let e of t){let t=String(e[o]??"Uncategorized"),r=Number(e[s]);Number.isFinite(r)&&f.set(t,(f.get(t)??0)+r)}let m=[...f].sort((e,t)=>t[1]-e[1]),g=m.reduce((e,[,t])=>e+t,0),y=m[0],b=m[1],v=g>0?((y?.[1]??0)+(b?.[1]??0))/g:0,w=e.intents.map(e=>({id:Ta(e),strength:"string"==typeof e?void 0:e.strength})).sort((e,t)=>"primary"===e.strength?-1:"primary"===t.strength?1:0)[0]?.id,A=e.audience?.primary??e.audienceFit?.find(e=>"strong"===e.fit)?.audience;return{l1:`A ${e.name.toLowerCase()} encodes ${l} and ${c}. ${_a(d)}.`,l2:m.length>0?`${m.length} categories total ${h.format(g)}. ${y[0]} accounts for ${h.format(y[1])}${g>0?` (${p.format(y[1]/g)})`:""}${b?`, followed by ${b[0]} at ${h.format(b[1])}`:""}.`:`${t.length} data ${1===t.length?"item is":"items are"} represented.`,l3:m.length>=2?v>=.5?`Most of the total is concentrated in ${y[0]} and ${b[0]}, which together account for ${p.format(v)}.`:`The total is distributed across ${m.length} categories without the first two forming a majority.`:y?`${y[0]} is the only represented category.`:"No quantitative pattern can be derived from the available data.",l4:`The chart is intended for ${w??"explanation"}${A?` with a ${A} audience`:""}: ${e.designContract.whyCustom}`}}function Va(e,t,r={}){let a=Oa(t),i=Ma(t),n=r.locale??"en",o=("function"==typeof e.description?e.description({data:a,config:i,locale:n}):void 0)?.levels??Ua(e,a,i,n),s=r.levels??["l1","l2","l3","l4"],l={};for(let e of s)o[e]&&(l[e]=o[e]);let c=["l1","l2","l3","l4"].map(e=>l[e]).filter(e=>!!e).join(" "),u=r.includeCaveats?[...e.reception?.risks??[],...e.caveats??[],...(e.designContract.misuse??[]).map(e=>`Misuse: ${e}`)]:void 0;return{text:c,levels:l,...u?.length?{caveats:u}:{}}}function Ga(e){let t=Math.max(2,Math.round(e.bins)),r=Math.max(1,Math.round(e.pegRows??t-1)),a=Math.max(1,Math.round(e.count??Math.max(64,4*t))),i=tt(Number.isFinite(e.branchProbability)?e.branchProbability??.5:.5,0,1),n=Ne(e.seed??1),o=e.idPrefix??"mechanical";return Array.from({length:a},(e,t)=>{let a=0;for(let e=0;e<r;e+=1)n()<i&&(a+=1);let s=r/2;return{id:`${o}-${t}`,value:a,mechanical:!0,pegRows:r,branchProbability:i,pathRights:a,side:a<s?"left":a>s?"right":"center"}})}function Ha(e){let{windowSize:t,watermark:r,watermarkAtArrivalAccessor:a}=e;if(!(Number.isFinite(t)&&t>0))throw new RangeError("EventDrop windows.size must be a finite positive number");let{rows:i}=ot(e.data,"event"),n=i.flatMap((t,r)=>{let a=et(Qe(t,r,e.timeAccessor));return null==a?[]:[{datum:t,index:r,eventTime:a,arrivalTime:et(Qe(t,r,e.arrivalAccessor))??a,watermarkAtArrival:0,late:!1}]}),o="function"==typeof r?null:et(r?.value),s="function"==typeof r?t:et(r?.delay)??t,l=-1/0,c=-1/0;for(let e of n.slice().sort((e,t)=>e.arrivalTime-t.arrivalTime||e.index-t.index)){l=Math.max(l,e.eventTime);let i="function"==typeof r?et(r(l)):l-s;c=o??Math.max(c,i??l-t);let n=a?et(Qe(e.datum,e.index,a)):null;e.watermarkAtArrival=n??c;let u=(Math.floor(e.eventTime/t)+1)*t;e.late=u<=e.watermarkAtArrival}return{events:n,watermarkValue:n.length?c:o??-s}}function qa(e,t){let r="mechanical"===(t.simulationMode??t.mode)&&("GaltonBoardChart"===e||"UnitPileChart"===e);if(!Array.isArray(t.data)&&!r)return null;let a=Array.isArray(t.data)?t.data:[],i=Math.max(2,Math.round(et(t.bins)??21)),n=Math.max(1,Math.round(et(t.pegRows)??i-1));if(r&&(a="GaltonBoardChart"===e?Ga({bins:i,count:t.mechanicalCount,pegRows:n,branchProbability:t.branchProbability,seed:t.seed}):it({count:t.mechanicalCount,categories:t.mechanicalCategories,unitValue:t.unitValue,seed:t.seed})),a=ot(a,"UnitPileChart"===e?"pile":"GaltonBoardChart"===e?"galton":"EventDropChart"===e?"event":"collision-swarm").rows,"UnitPileChart"===e){let e=/* @__PURE__ */new Map,i=t.valueAccessor??(r?"value":void 0);return a.forEach((r,a)=>{let n=String(Qe(r,a,t.categoryAccessor??"category")??"unknown"),o=i?et(Qe(r,a,i)):1;e.set(n,(e.get(n)??0)+Math.max(0,o??0))}),{generated:r,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("GaltonBoardChart"===e){let e=a.map((e,r)=>et(Qe(e,r,t.valueAccessor??"value"))).filter(e=>null!=e),o=r?[0,n]:at(t.valueExtent),s=o?.[0]??(e.length?Math.min(...e):0),l=o?.[1]??(e.length?Math.max(...e):1),c=s===l?1:l-s,u=Array.from({length:i},(e,t)=>({label:String(t+1),value:0}));for(let t of e)u[Math.max(0,Math.min(i-1,Math.floor((t-s)/c*i)))].value+=1;return{generated:r,rows:u}}if("CollisionSwarmChart"===e){let e=/* @__PURE__ */new Map;return a.forEach((r,a)=>{if(null==et(Qe(r,a,t.xAccessor??"x")))return;let i=t.groupAccessor?String(Qe(r,a,t.groupAccessor)??"All"):"All";e.set(i,(e.get(i)??0)+1)}),{generated:r,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("EventDropChart"===e){let e=et(t.windows?.size??10);if(null==e||e<=0)return null;let{events:i}=Ha({data:a,timeAccessor:t.timeAccessor??"time",arrivalAccessor:t.arrivalAccessor??"arrivalTime",windowSize:e,watermark:t.watermark,watermarkAtArrivalAccessor:t.watermarkAtArrivalAccessor}),n=i.map(e=>e.eventTime),o=n.length?Math.min(...n):0,s=n.length?Math.max(...n):o+e,l=Math.min(et(t.timeExtent?.[0])??o,o),c=Math.max(et(t.timeExtent?.[1])??s,s),u=Math.floor(l/e)*e,d=Math.max(1,Math.ceil((c-u+e)/e)),h=Array.from({length:d},(t,r)=>({label:`${u+r*e}-${u+(r+1)*e}`,value:0,secondary:0,secondaryLabel:"late"}));for(let t of i){let r=h[Math.max(0,Math.min(d-1,Math.floor((t.eventTime-u)/e)))];t.late?r.secondary+=1:r.value+=1}return{generated:r,rows:h}}return null}function Wa(e){let t="number"==typeof e?e:"string"==typeof e?Number(e):NaN;return Number.isFinite(t)?t:void 0}function Ya(e,t){let r=e.physics&&"object"==typeof e.physics?e.physics:null,a=e.settledProjection&&"object"==typeof e.settledProjection?e.settledProjection:null,i=[e.settledProjectionRows,e.projectionRows,a?.rows,r?.settledProjectionRows,r?.projectionRows,r?.settledProjection&&"object"==typeof r.settledProjection?r.settledProjection.rows:void 0].find(e=>Array.isArray(e));return Array.isArray(i)?i.map((e,r)=>{if(!e||"object"!=typeof e)return null;let a=e,i=Wa(a.count??a.value??a.total??a.bodies??a.events);if(null==i)return null;let n=a.label??a.id??a.name??`container ${r+1}`,o=Wa(a.secondary??a.secondaryCount),s=Wa(a.observed??a.observedCount);return{label:Ea(n,t),count:i,...null!=o?{secondary:o}:{},..."string"==typeof a.secondaryLabel&&a.secondaryLabel?{secondaryLabel:a.secondaryLabel}:{},...null!=s?{observed:s}:{}}}).filter(e=>null!=e):null}function Ka(e){return"EventDropChart"===e?"time window":"GaltonBoardChart"===e?"bin":"CollisionSwarmChart"===e?"group lane":"PacketFlowChart"===e?"flow node":"CrucibleChart"===e?"result group":"container"}function Ja(e){return"EventDropChart"===e?"event":"GaltonBoardChart"===e?"sample":"CollisionSwarmChart"===e?"point":"PacketFlowChart"===e?"packet":"CrucibleChart"===e?"settled item":"UnitPileChart"===e?"unit":"body"}function Xa(e,t){return"EventDropChart"===e?"An event-drop physics chart that collapses moving events into a settled projection by event-time window.":"GaltonBoardChart"===e?"A Galton board chart that collapses falling samples into a settled histogram projection.":"UnitPileChart"===e?"A physics pile chart that collapses moving bodies into a settled bar-style projection by container.":"CollisionSwarmChart"===e?"A collision swarm chart that separates overlapping points while preserving their quantitative axis position.":"PacketFlowChart"===e?"A physical flow chart that keeps authored routes visible while packet bodies show throughput and proximity events.":"CrucibleChart"===e?"A crucible physics chart that replays authored phases and events into declared products and outlets; the settled ledger, not collisions, determines the result.":`A ${t} whose accessible reading is the settled projection rather than individual trajectories.`}function Za(e,t){if(!(t>0))return"0%";let r=e/t*100;return`${r>=10?Math.round(r):Math.round(10*r)/10}%`}function Qa(e,t,r,a,i,n,o=null){let s=Ka(e),l=o&&"EventDropChart"===e?"accepted event":Ja(e),c=o?o.generated?"The generated sample projection":"The source projection":"The settled projection";if(i.has("l1")&&(a.l1=Xa(e,t)),!i.has("l2")&&!i.has("l3"))return;if(!r||0===r.length)return void(i.has("l2")&&(a.l2=o?"No valid source records are available.":"No settled projection is loaded yet."));let u=r.reduce((e,t)=>e+t.count,0),d=r.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),h=d[0]??r.slice().sort((e,t)=>t.count-e.count)[0];if(!h)return;let p=r.reduce((e,t)=>e+(t.secondary??0),0),f=r.find(e=>e.secondaryLabel)?.secondaryLabel??"secondary";if(i.has("l2"))if(o&&"EventDropChart"===e)a.l2=`${c} classifies ${n(u+p)} ${ei(u+p,"event")} across ${r.length} ${ei(r.length,s)}: ${n(u)} accepted and ${n(p)} late.`;else if(0===d.length)a.l2=`${c} contains ${n(u)} ${ei(u,l)} across ${r.length} ${ei(r.length,s)}; no ${ei(2,s)} are non-empty yet.`;else{let e=p>0?` ${n(p)} ${ei(p,l)} ${1===p?"is":"are"} marked ${f}.`:"";a.l2=`${c} contains ${n(u)} ${ei(u,l)} across ${r.length} ${ei(r.length,s)}; ${d.length} ${ei(d.length,s)} ${1===d.length?"is":"are"} non-empty. The largest ${s} is ${h.label} with ${n(h.count)} ${ei(h.count,l)}.${e}`}if(i.has("l3")&&u>0&&d.length>0){let e=d.find(e=>e!==h),t=Za(h.count,u);a.l3=e?`${c} is most concentrated in ${h.label}, which holds ${n(h.count)} ${ei(h.count,l)} (${t}); ${e.label} follows with ${n(e.count)} ${ei(e.count,l)}.`:`${c} is concentrated in ${h.label}, which holds all ${n(h.count)} ${ei(h.count,l)}.`}}function ei(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:`${t}s`}function ti(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()}function ri(e){return au[e]||`${ti(e)} chart`}function ai(e){let t=/* @__PURE__ */new Set,r=e=>{let a=su[e];if(a)return a;if(t.has(e))return;let i=Ra().intents.get(e);if(!i?.composes?.length)return;t.add(e);let n=[...i.composes].sort((e,t)=>{let r=e=>{let t=cu.indexOf(e);return t<0?cu.length:t};return(i.weights?.[t]??1)-(i.weights?.[e]??1)||r(e)-r(t)});for(let a of n){let i=r(a);if(i)return t.delete(e),i}t.delete(e)};return r(e)}function ii(e){let t,r=0;for(let[a,i]of Object.entries(e))if("number"==typeof i&&i>0){if(i>r){t=a,r=i;continue}if(i===r&&void 0!==t){let e=cu.indexOf(a),r=cu.indexOf(t);-1!==e&&(-1===r||e<r)&&(t=a)}}return t}function ni(e){return"BumpChart"===e?"ranking":tu.has(e)||"StackedAreaChart"===e?"apportioning":ou.has(e)?"relating":eu.has(e)?"comparing":ru.has(e)?"characterizing":Qc.has(e)?"tracking":iu.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}function oi(e){if(e){if("fits"in e||"buildProps"in e){let t=e,r={};for(let[e,a]of Object.entries(t.intentScores))"number"==typeof a&&Number.isFinite(a)&&(r[e]=a);return{family:t.family,intentScores:Object.keys(r).length?r:void 0}}return e}}function si(e,t){let r=oi(t);if(r?.act)return r.act;if(r?.intentScores){let e=ii(r.intentScores);if(e&&su[e]&&(r.intentScores[e]??0)>=3)return su[e]}return r?.family?lu[r.family]:ni(e)}function li(e){let t=e.annotations;return!!Array.isArray(t)&&t.some(e=>{if(!e||"object"!=typeof e)return!1;let t=e;if("string"!=typeof t.type||!du.has(t.type))return!1;let r=t.provenance;return!(!r||"object"!=typeof r)&&(hu.has(r.authorKind)||pu.has(r.source)||fu.has(r.basis))})}function ci(e="en"){let t,r;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),r=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch{t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),r=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?Math.abs(e)>=1e4?t.format(e):r.format(e):String(e)}function ui(e,t,r,a){let i=0,n=0,o=1/0,s=-1/0,l=null,c=null,u=0,d=0,h=null,p=null,f=NaN,m=NaN;for(let r of e){let e=t(r);Number.isFinite(e)&&(0===i&&(f=e,h=r),m=e,p=r,e<o&&(o=e,l=r,u=i),e>s&&(s=e,c=r,d=i),i++,n+=e)}return 0===i?null:{count:i,min:o,max:s,mean:n/i,minLabel:Ea(null!=l?r(l):null,a),maxLabel:Ea(null!=c?r(c):null,a),first:f,last:m,firstLabel:Ea(null!=h?r(h):null,a),lastLabel:Ea(null!=p?r(p):null,a),minIndex:u,maxIndex:d}}function di(e){return e.length<=1?e[0]??"":2===e.length?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`}function hi(e){let t=e.provenance&&"object"==typeof e.provenance?e.provenance:null,r=t?.authorKind??t?.source??t?.basis;return"watcher"===r?"a watcher-flagged ":"agent"===r||"ai"===r||"llm-inference"===r?"an AI-suggested ":""}function pi(e){let t="string"==typeof e.type?e.type:"annotation",r=mu[t]||"an annotation",a=hi(e),i=a?a+r.replace(/^an? /,""):r,n="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return n?`${i} labeled "${n}"`:i}function fi(e){let t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;let r=Ia(t.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return;let a=r.map(pi),i=a.slice(0,5),n=a.length-i.length,o=di(i)+(n>0?`, and ${n} more`:""),s=r.length;return`The author has marked ${1===s?"one feature":`${s} features`} on this chart: ${o}.`}function mi(e,t,r={}){let a=void 0!==r.levels,i=new Set(r.levels??["l1","l2","l3"]);!a&&(r.capability||li(t))&&i.add("l4");let n=Fa(e,t,r.recipe);if(n){let e=["l1","l2","l3","l4"].filter(e=>i.has(e));!a&&!e.includes("l4")&&e.push("l4");let o=Va(n,t,{levels:e,locale:r.locale,audience:r.audience,includeCaveats:r.includeCaveats}),s=fi(t);return{...o,text:s?`${s} ${o.text}`.trim():o.text,...s?{annotations:s}:{}}}let o=ci(r.locale??"en"),s=ri(e),l=Array.isArray(t.data)?t.data:null,c=Na(t),u=nu.has(e)?Ya(t,o):null,d=nu.has(e)&&null===u?qa(e,t):null,{measure:h,measureFallback:p,dimension:f,dimensionFallback:m}=Pa(e,t),g="string"==typeof h&&h?h:p,y="string"==typeof f&&f?f:m,b={};if(nu.has(e)&&Qa(e,s,u??(d?Ya({projectionRows:d.rows},o):null),b,i,o,d),i.has("l1")&&!nu.has(e))if("BumpChart"===e)b.l1=`A ${s} ranking ${c??"series"} by ${g} across ${y}.`;else if(Qc.has(e)||eu.has(e))b.l1=`A ${s} of ${g} by ${y}`+(c?`, split by ${c}.`:".");else if(tu.has(e))b.l1=`A ${s} showing ${g} across ${y} categories.`;else if(ru.has(e))b.l1=`A ${s} of the distribution of ${g}`+(c?` by ${c}.`:".");else if(iu.has(e)){let e=Array.isArray(t.nodes)?t.nodes.length:void 0,r=Array.isArray(t.edges)?t.edges.length:void 0,a=[null!=e?`${e} ${Si(e,"node")}`:null,null!=r?`${r} ${Si(r,"edge")}`:null].filter(Boolean);b.l1=`A ${s}${a.length?` with ${a.join(" and ")}`:""}.`}else if("BigNumber"===e){let e="string"==typeof t.label?t.label:g;b.l1=`A single value${e?` for ${e}`:""}.`}else b.l1=`A ${s}.`;let v=Qc.has(e)||"BumpChart"===e||eu.has(e)||tu.has(e)||ru.has(e),w=null;if((i.has("l2")||i.has("l3")||i.has("l4"))&&v&&l&&l.length>0&&(w=ui(l,Ca(h,p),ka(f,m),o)),i.has("l2")&&v&&(l&&0!==l.length?w&&(tu.has(e)?b.l2=`${w.count} segments totaling ${o(gi(w))}. Largest is ${w.maxLabel} at ${o(w.max)}; smallest is ${w.minLabel} at ${o(w.min)}.`:b.l2=`${g} ranges from ${o(w.min)} (${w.minLabel}) to ${o(w.max)} (${w.maxLabel}), with a mean of ${o(w.mean)} across ${w.count} points.`):b.l2="No data is loaded yet."),i.has("l3")&&w&&!c&&Qc.has(e)?b.l3=yi(w,g,o):i.has("l3")&&w&&!c&&eu.has(e)&&(b.l3=`The highest ${y} is ${w.maxLabel} and the lowest is ${w.minLabel}.`),i.has("l4")){let a=li(t)?"alerting":si(e,r.capability);if(a){let i=c?null:w;b.l4=bi(a,e,t,i,g,y,o,r.audience)}}let A=["l1","l2","l3","l4"].filter(e=>i.has(e)&&b[e]).map(e=>b[e]).join(" "),$=fi(t);return{text:$?`${$} ${A}`.trim():A,levels:b,...$?{annotations:$}:{}}}function gi(e){return e.mean*e.count}function yi(e,t,r){let{first:a,last:i,min:n,max:o,maxLabel:s,minLabel:l,firstLabel:c,lastLabel:u,minIndex:d,maxIndex:h,count:p}=e,f=o-n,m=i-a;if(0===f)return`${xi(t)} is constant at ${r(a)} across the series.`;if(f/(Math.abs(e.mean)||1)<.04)return`${xi(t)} ends roughly where it started (${r(a)} at ${c} to ${r(i)} at ${u}), ranging between ${r(n)} and ${r(o)}.`;let g=h>0&&h<p-1,y=d>0&&d<p-1,b=(o-Math.max(a,i))/f,v=(Math.min(a,i)-n)/f;return g&&b>.15?`Overall ${t} climbs to a peak of ${r(o)} (${s}), then falls to ${r(i)} (${u}).`:y&&v>.15?`Overall ${t} drops to a low of ${r(n)} (${l}), then recovers to ${r(i)} (${u}).`:Math.abs(m)/f<.05?`${xi(t)} ends roughly where it started (${r(a)} at ${c} to ${r(i)} at ${u}), ranging between ${r(n)} and ${r(o)}.`:m>0?h===p-1?`Overall ${t} rises from ${r(a)} (${c}) to a peak of ${r(i)} (${u}).`:`Overall ${t} rises from ${r(a)} (${c}) to ${r(i)} (${u}), after peaking at ${r(o)} (${s}).`:d===p-1?`Overall ${t} falls from ${r(a)} (${c}) to a low of ${r(i)} (${u}).`:`Overall ${t} falls from ${r(a)} (${c}) to ${r(i)} (${u}), after dipping to ${r(n)} (${l}).`}function bi(e,t,r,a,i,n,o,s){let l,c,u=uu[e],d=/^[aeiou]/i.test(u)?"an":"a";switch(e){case"locating":l="This is a map",c="read values by location";break;case"presenting":l="This is a single-value display",c=`read ${"string"==typeof r.label&&r.label?r.label:i} as the headline number`;break;case"tracing":l=`This is ${d} ${u} chart`,c="follow the movement between states";break;case"nesting":l=`This is ${d} ${u} chart`,c="read it for nested structure and how children sum into their parents";break;case"relating":l=`This is ${d} ${u} chart`,c=`read it for whether ${n} and ${i} move together`;break;default:l=`This is ${d} ${u} chart`,c=vi(e,a,i,n,o,t)}return`${l}; ${c}.${$i(t,s)}`}function vi(e,t,r,a,i,n){if(!t)switch(e){case"alerting":return"watch for points that break from the rest";case"tracking":return`read it for the overall direction of ${r}`;case"comparing":return`compare ${r} across ${a}`;case"ranking":return`read it top to bottom by ${r}`;case"apportioning":return`read each ${a}'s share of the whole`;case"characterizing":return`read it for the spread and shape of ${r}`;default:return"read the highlighted features"}switch(e){case"alerting":return wi(t,i,n);case"tracking":return`read it for the trajectory of ${r}, which ${Ai(t)} from ${i(t.first)} (${t.firstLabel}) to ${i(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${r} across ${a}; ${t.maxLabel} leads at ${i(t.max)}`;case"ranking":return`read it top to bottom by ${r}; ${t.maxLabel} ranks highest at ${i(t.max)}`;case"apportioning":{let e=t.mean*t.count,r=e>0?Math.round(t.max/e*100):null;return`read each ${a}'s share of the ${i(e)} total; ${t.maxLabel} is the largest at ${i(t.max)}${null!=r?` (${r}%)`:""}`}case"characterizing":return`read it for the spread of ${r}, from ${i(t.min)} to ${i(t.max)}`;default:return"read the highlighted features"}}function wi(e,t,r){if(eu.has(r)||tu.has(r))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;let{first:a,last:i,min:n,max:o,minLabel:s,maxLabel:l,lastLabel:c,minIndex:u,maxIndex:d,count:h}=e,p=o-n;if(p>0){let e=d>0&&d<h-1,r=u>0&&u<h-1,f=(o-Math.max(a,i))/p,m=(Math.min(a,i)-n)/p;if(e&&f>.15)return`the peak of ${t(o)} at ${l} is the point to investigate`;if(r&&m>.15)return`the dip to ${t(n)} at ${s} is the point to investigate`;if(i>=o)return`the climb to ${t(i)} at ${c} warrants a closer look`;if(i<=n)return`the drop to ${t(i)} at ${c} warrants a closer look`}return`the extremes — ${l} (${t(o)}) and ${s} (${t(n)}) — are the points to check`}function Ai(e){let t=e.max-e.min,r=e.last-e.first;return 0===t||Math.abs(r)/t<.05?"holds roughly steady":r>0?"rises":"falls"}function $i(e,t){if(!t)return"";let r=t.familiarity?.[e];return"number"==typeof r&&r<=2?` This ${ri(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`:""}function xi(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function Si(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:`${t}s`}function Ci(e){return String(e??"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function ki(e){return!!e&&"object"==typeof e}function Ri(e,t,r,a){let i=Ba(t,["nominal","ordinal"]),n=t.dataRoles.filter(e=>"quantitative"===e.semanticType),o=i?ja(i,r,a):void 0,s=[];o&&null!=e[o]&&s.push(String(e[o]));for(let t of n){let i=ja(t,r,a);i&&null!=e[i]&&s.push(`${t.role}: ${String(e[i])}`)}return s.length>0?s.join(", "):"Data item"}function Pi(e,t,r={}){let a=Oa(t),i=Ma(t),n=Math.max(1,r.maxLeaves??200),o=r.locale??"en";if("function"==typeof e.navigation)return e.navigation({data:a,config:i,locale:o});let s=ki(e.navigation)?e.navigation:void 0,l=(s?.groupByRole?za(e,s.groupByRole):void 0)??(s?.groupBy?.[0]?za(e,s.groupBy[0])??e.dataRoles.find(e=>e.field===s.groupBy?.[0]):void 0)??Ba(e,["nominal","ordinal"]),c=l?ja(l,i,a):void 0,u=(s?.idRole?za(e,s.idRole):void 0)??Ba(e,["identifier"]),d=u?ja(u,i,a):void 0,h={id:"root",role:"chart",label:s?.summaryTemplate?La(s.summaryTemplate,void 0,e,i,a,{count:a.length}):`${e.name}: ${a.length} ${1===a.length?"item":"items"} represented.`,level:1,children:[]},p=0,f=(t,r,n)=>{let o=d?t[d]:void 0,l=s?.itemLabelTemplate?La(s.itemLabelTemplate,t,e,i,a,{count:a.length}):Ri(t,e,i,a);return{id:`datum-${Ci(o??r)}`,role:"datum",label:l,level:n,datum:t}};if(c){let e=/* @__PURE__ */new Map;for(let t of a){let r=String(t[c]??"Uncategorized"),a=e.get(r);a?a.push(t):e.set(r,[t])}h.children=[...e].map(([e,t],r)=>{let a=Math.max(0,n-p),i=t.slice(0,a);p+=i.length;let o=i.map((e,t)=>f(e,1e5*r+t,3));return i.length<t.length&&o.push({id:`more-${Ci(e)}`,role:"datum",label:`…and ${t.length-i.length} more items`,level:3}),{id:`group-${Ci(e)}`,role:"series",label:`${e}: ${t.length} ${1===t.length?"item":"items"}.`,level:2,children:o}})}else{let e=a.slice(0,n);h.children=e.map((e,t)=>f(e,t,2)),e.length<a.length&&h.children.push({id:"more",role:"datum",label:`…and ${a.length-e.length} more items`,level:2})}return h}function Ni(e,t,r){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:r]}function Ei(e,t="—"){if(null==e||""===e)return t;if("object"==typeof e){let r=e;return Ei(r.id??r.name??r.label,t)}return String(e)}function Ii(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function Ti(e){return Ei(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Mi(e,t){let r=Ni(e,t,"children");return Array.isArray(r)?r:[]}function Oi(e,t,r){return`${e} ${1===e?t:r}`}function Fi(e,t){return 0===e.numericLeaves?"":e.numericLeaves===e.leaves?`, leaf total ${t(e.leafTotal)}`:`, known leaf total ${t(e.leafTotal)} across ${Oi(e.numericLeaves,"valued leaf","valued leaves")}`}function ji(e){return"TreeDiagram"===e?"tree":"Treemap"===e?"treemap":"CirclePack"===e?"circle-packing":"orbit"}function zi(e,t,r,a){let i=t.data&&"object"==typeof t.data?t.data:null,n=t.childrenAccessor??"children",o=t.valueAccessor??"value",s=t.nodeLabel??t.nodeIdAccessor,l=/* @__PURE__ */new WeakMap,c=/* @__PURE__ */new WeakSet,u=e=>{let t=l.get(e);if(t)return t;if(c.has(e))return{descendants:0,depth:0,leaves:0,numericLeaves:0,leafTotal:0};c.add(e);let r,a=Mi(e,n);if(0===a.length){let t=Ii(Ni(e,o,"value"));r={descendants:0,depth:1,leaves:1,numericLeaves:null==t?0:1,leafTotal:t??0}}else r=a.reduce((e,t)=>{let r=u(t);return{descendants:e.descendants+1+r.descendants,depth:Math.max(e.depth,r.depth+1),leaves:e.leaves+r.leaves,numericLeaves:e.numericLeaves+r.numericLeaves,leafTotal:e.leafTotal+r.leafTotal}},{descendants:0,depth:1,leaves:0,numericLeaves:0,leafTotal:0});return c.delete(e),l.set(e,r),r},d=0,h=(e,t,i,l)=>{let c=Ei(Ni(e,s,"name"),`item ${i}`);if(l.has(e))return{id:`hierarchy-${Ti(i)}-cycle`,role:"datum",level:t,label:`Repeated hierarchy reference to ${c}; branch omitted.`};let p=Mi(e,n),f=u(e);if(0===p.length){if(d>=r)return null;d+=1;let n=Ii(Ni(e,o,"value"));return{id:`hierarchy-${Ti(i)}-${Ti(c)}`,role:"datum",level:t,label:`${c}${null==n?"":`: ${a(n)}`}.`,...null==n?{}:{value:n},datum:e}}let m=new Set(l);m.add(e);let g=[],y=0;for(let[e,a]of p.entries()){if(d>=r){y+=u(a).leaves;continue}let n=h(a,t+1,`${i}-${e}`,m);n&&g.push(n)}return y>0&&g.push({id:`hierarchy-${Ti(i)}-more`,role:"datum",level:t+1,label:`${Oi(y,"more leaf","more leaves")} in ${c} not shown; navigation is capped at ${r}.`}),{id:`hierarchy-${Ti(i)}-${Ti(c)}`,role:"series",level:t,label:`${c}: ${Oi(p.length,"direct child","direct children")}, ${Oi(f.descendants,"total descendant","total descendants")}, ${Oi(f.leaves,"leaf","leaves")}${Fi(f,a)}.`,datum:e,children:g}},p=i?u(i):null,f={id:"root",role:"chart",level:1,label:i?`A ${ji(e)} chart with ${Oi(p.leaves,"leaf","leaves")} and ${Oi(p.descendants,"total descendant","total descendants")} across ${Oi(p.depth,"hierarchy level","hierarchy levels")}${Fi(p,a)}.`:"A hierarchy chart with no hierarchy data loaded.",children:[]};if(i){let e=h(i,2,"root",/* @__PURE__ */new Set);if(e){let t=Ei(Ni(i,s,"name"),"");f.children="series"===e.role&&""===t?e.children:[e]}}return f}function Bi(e,t,r){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:r]}function Li(e,t="—"){if(null==e||""===e)return t;if("object"==typeof e){let r=e;return Li(r.id??r.name??r.label,t)}return String(e)}function _i(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function Di(e){return Li(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Ui(e){let t=[];return(e.linkedHover||e.selection||e.linkedBrush)&&t.push("Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&t.push("Hover or focus a mark for its details."),t.length>0?` ${t.join(" ")}`:""}function Vi(e){if(Array.isArray(e))return e;if(!e||"object"!=typeof e)return[];let t=e;return Array.isArray(t.features)?t.features:"Feature"===t.type?[t]:[]}function Gi(e,t,r){let a=Bi(e,t,r);if(void 0!==a)return a;let i=e.properties;return i&&"object"==typeof i?Bi(i,t,r):void 0}function Hi(e,t,r){return Li(Gi(e,t,"id")??Gi(e,"name","name")??Gi(e,"NAME","NAME")??Gi(e,"label","label"),r)}function qi(e){let t=0,r=1/0,a=-1/0,i=0;for(let n of e)null!=n.value&&(t+=1,r=Math.min(r,n.value),a=Math.max(a,n.value),i+=n.value);return 0===t?null:{count:t,min:r,max:a,total:i,average:i/t}}function Wi(e,t){let r=qi(e);return r?`range ${t(r.min)} to ${t(r.max)}, average ${t(r.average)}, total ${t(r.total)}`:"no numeric values"}function Yi(e){let t=e.filter(e=>null!=e.value),r=e.filter(e=>null==e.value),a=[],i=qi(t);if(i)if(i.min===i.max)a.push({id:"equal",label:"Equal values",rows:t});else{let e=i.min+(i.max-i.min)/3,r=i.min+2*(i.max-i.min)/3,n=t.filter(e=>e.value>=r),o=t.filter(t=>t.value>=e&&t.value<r),s=t.filter(t=>t.value<e);n.length>0&&a.push({id:"highest",label:"Highest values",rows:n}),o.length>0&&a.push({id:"middle",label:"Middle values",rows:o}),s.length>0&&a.push({id:"lowest",label:"Lowest values",rows:s})}return r.length>0&&a.push({id:"missing",label:"No numeric value",rows:r}),a}function Ki(e,t,r){let a,i=e.filter(e=>null!=e.value).sort((e,t)=>t.value-e.value||e.index-t.index),n=/* @__PURE__ */new Map,o=0;for(let[e,t]of i.entries())a!==t.value&&(o=e+1,a=t.value),n.set(t.index,o);let s=0;return Yi(e).map(e=>{let a=Math.max(0,t-s),o=e.rows.slice(0,a);s+=o.length;let l=o.map(e=>{let t=n.get(e.index),a=null==t||i.length<2?"":`, rank ${t} of ${i.length}`;return{id:`geo-${Di(e.label)}-${e.index}`,role:"datum",level:3,label:null==e.value?`${e.label}: no numeric value.`:`${e.label}: ${r(e.value)}${a}.`,...null==e.value?{}:{value:e.value},datum:e.datum}}),c=e.rows.length-o.length;return c>0&&l.push({id:`geo-${e.id}-more`,role:"datum",level:3,label:`${c} more ${1===c?"region":"regions"} in ${e.label.toLowerCase()} not shown; navigation is capped at ${t}.`}),{id:`regions-${e.id}`,role:"series",level:2,label:`${e.label}: ${e.rows.length} ${1===e.rows.length?"region":"regions"}, ${Wi(e.rows,r)}.`,children:l}})}function Ji(e,t,r,a){let i=Vi(t.areas),n="FlowMap"===e&&Array.isArray(t.nodes)?t.nodes:Array.isArray(t.points)?t.points:[],o=Array.isArray(t.flows)?t.flows:[],s=Array.isArray(t.lines)?t.lines:[],l=t.valueAccessor??t.sizeBy??t.costAccessor??"value",c=t.pointIdAccessor??t.nodeIdAccessor??"id",u=("ChoroplethMap"===e?i:n).map((r,a)=>({datum:r,index:a,label:Hi(r,"ChoroplethMap"===e?t.idAccessor:c,`${"ChoroplethMap"===e?"region":"location"} ${a+1}`),value:_i(Gi(r,l,"value"))})),d=u.filter(e=>null!=e.value),h={id:"root",role:"chart",level:1,label:`${"ChoroplethMap"===e?`A choropleth map with ${i.length} regions.${d.length>0?` Values are available for ${d.length} of ${i.length} regions; ${Wi(d,a)}.`:" No regions have numeric values."}`:"FlowMap"===e?`A flow map with ${o.length} flows and ${n.length} locations.`:"DistanceCartogram"===e?`A distance cartogram with ${n.length} locations and ${s.length} routes.`:`A proportional-symbol map with ${n.length} locations.`}${Ui(t)}`,children:[]};if("ChoroplethMap"===e)h.children=Ki(u,r,a);else if(u.length>0){let e=u.slice(0,r).map(e=>({id:`geo-${Di(e.label)}-${e.index}`,role:"datum",level:3,label:`${e.label}${null==e.value?"":`: ${a(e.value)}`}.`,...null==e.value?{}:{value:e.value},datum:e.datum}));u.length>r&&e.push({id:"geo-more",role:"datum",level:3,label:`…and ${u.length-r} more locations.`}),h.children?.push({id:"locations",role:"series",level:2,label:`Locations: ${u.length} marks.`,children:e})}let p="FlowMap"===e?o:s;if(p.length>0){let e=p.slice(0,r).map((e,t)=>{let r=Li(e.source,"unknown"),i=Li(e.target,"unknown"),n=_i(Bi(e,l,"value"));return{id:`route-${Di(r)}-${Di(i)}-${t}`,role:"datum",level:3,label:`${r} to ${i}${null==n?"":`: ${a(n)}`}.`,...null==n?{}:{value:n},datum:e}});h.children?.push({id:"routes",role:"series",level:2,label:`Routes: ${p.length} ${1===p.length?"route":"routes"}.`,children:e})}return h}function Xi(e,t={},r={}){return!!Fa(e,t,r.recipe)||gu.has(e)||yu.has(e)||bu.has(e)||Qc.has(e)||eu.has(e)||tu.has(e)||ru.has(e)}function Zi(e,t,r){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:r]}function Qi(e,t="—"){if(null==e||""===e)return t;if("object"==typeof e){let r=e;return Qi(r.id??r.name??r.label,t)}return String(e)}function en(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function tn(e){return Qi(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function rn(e,t){let r=[];return(e.linkedHover||e.selection||e.linkedBrush)&&r.push("network"===t?"Use linked highlighting to trace related marks.":"Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&r.push("Hover or focus a mark for its details."),r.length>0?` ${r.join(" ")}`:""}function an(e,t){t&&e.children?.push(t)}function nn(e,t,r,a){let i=Array.isArray(t.nodes)?t.nodes:[],n=Array.isArray(t.edges)?t.edges:Array.isArray(t.flows)?t.flows:[],o=t.nodeIdAccessor??t.nodeIDAccessor,s=t.sourceAccessor??"source",l=t.targetAccessor??"target",c=t.valueAccessor??"value",u=e=>Qi(Zi(e,o,"id"),"unknown"),d=(e,t)=>Qi(Zi(e,t,""),"unknown"),h=/* @__PURE__ */new Set;for(let e of n)h.add(d(e,s)),h.add(d(e,l));let p=i.length>0?i:[...h].map(e=>({id:e})),f=/* @__PURE__ */new Map;for(let e of p)f.set(u(e),{links:0,value:0});for(let e of n){let t=d(e,s),r=d(e,l),a=en(Zi(e,c,"value"))??0;for(let e of[t,r]){let t=f.get(e)??{links:0,value:0};t.links+=1,t.value+=a,f.set(e,t)}}let m={id:"root",role:"chart",level:1,label:`A ${"SankeyDiagram"===e||"ProcessSankey"===e?"flow diagram":"ChordDiagram"===e?"chord diagram":"network graph"} with ${p.length} nodes and ${n.length} links.${rn(t,"network")}`,children:[]},g=0,y=/* @__PURE__ */new Map,b=t.colorBy??"group";for(let e of p){let t=Qi(Zi(e,b,"group"),"Ungrouped"),r=y.get(t);r?r.push(e):y.set(t,[e])}let v=[...y].map(([e,t],i)=>{let n=[];for(let[e,o]of t.entries()){if(g>=r)break;g+=1;let t=u(o),s=f.get(t)??{links:0,value:0},l=s.value>0?`, ${a(s.value)} total flow`:"";n.push({id:`node-${i}-${e}-${tn(t)}`,role:"datum",level:3,label:`${t}: ${s.links} ${1===s.links?"link":"links"}${l}.`,value:s.value>0?s.value:void 0,datum:o})}return{id:`nodes-${i}-${tn(e)}`,role:"series",level:2,label:`${e}: ${t.length} ${1===t.length?"node":"nodes"}.`,children:n}});v.length>0&&m.children?.push(...v);let w=n.slice(0,r).map((e,t)=>{let r=d(e,s),i=d(e,l),n=en(Zi(e,c,"value"));return{id:`link-${tn(r)}-${tn(i)}-${t}`,role:"datum",level:3,label:`${r} to ${i}${null==n?"":`: ${a(n)}`}.`,value:n,datum:e}});return n.length>r&&w.push({id:"links-more",role:"datum",level:3,label:`…and ${n.length-r} more links.`,value:void 0}),w.length>0&&m.children?.push({id:"links",role:"series",level:2,label:`Links: ${n.length} ${1===n.length?"connection":"connections"}.`,children:w}),m}function on(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function sn(e,t){let r=Array.isArray(e.annotations)?e.annotations:null;if(!r)return null;let a=Ia(r.filter(e=>!!e&&"object"==typeof e));if(0===a.length)return null;let i=0,n=a.slice(0,t).map(e=>{let t=e.lifecycle?.status,r=t&&"accepted"!==t?` (${t})`:"";return{id:"annotation-"+i++,role:"annotation",level:3,label:`${on(pi(e))}${r}.`,datum:e}});a.length>t&&n.push({id:"annotation-"+i++,role:"annotation",level:3,label:`…and ${a.length-t} more annotations.`});let o=a.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===o?"one marked feature":`${o} marked features`}.`,children:n}}function ln(e,t,r={}){let a=r.locale??"en",i=Math.max(1,r.maxLeaves??200),n=ci(a),o=Fa(e,t,r.recipe);if(o)return Pi(o,t,{maxLeaves:i,locale:a});let s={id:"root",role:"chart",label:mi(e,t,{locale:a}).text||"Chart.",level:1,children:[]},l=sn(t,i);if(gu.has(e)){let r=nn(e,t,i,n);return an(r,l),r}if(yu.has(e)){let r=zi(e,t,i,n);return an(r,l),r}if(bu.has(e)){let r=Ji(e,t,i,n);return an(r,l),r}let c=Array.isArray(t.data)?t.data:null,u=Xi(e,t,r);if(!c||0===c.length||!u)return l&&(s.children=[l]),s;let{measure:d,measureFallback:h,dimension:p,dimensionFallback:f}=Pa(e,t),m=Ca(d,h),g=ka(p,f),y="string"==typeof d&&d?d:h,b="string"==typeof p&&p?p:f,v=Na(t),w=0,A=e=>`${e}-${w++}`,$=(e,t)=>{let r=m(e),a=Ea(g(e),n);return{id:A("datum"),role:"datum",level:t,label:`${a}: ${Number.isFinite(r)?n(r):"—"}`,value:Number.isFinite(r)?r:void 0,datum:e}},x=(e,t)=>{let r=e.slice(0,i).map(e=>$(e,t));return e.length>i&&r.push({id:A("more"),role:"datum",level:t,label:`…and ${e.length-i} more points`}),r},S=[];if(Qc.has(e)||eu.has(e)){let t=1/0,r=-1/0,a=1/0,i=-1/0,o=[],s=!0;for(let e of c){let n=m(e);Number.isFinite(n)&&(n<t&&(t=n),n>r&&(r=n));let l=g(e);o.push(l),"number"==typeof l&&Number.isFinite(l)?(l<a&&(a=l),l>i&&(i=l)):s=!1}let l=/* @__PURE__ */new Set,u=[];for(let e of o){let t=String(e);l.has(t)||(l.add(t),u.push(e))}let d=s?`${n(a)} to ${n(i)}`:`${Ea(u[0],n)} to ${Ea(u[u.length-1],n)} (${eu.has(e)?`${u.length} categories`:`${c.length} points`})`;S.push({id:A("axis"),role:"axis",level:2,label:`${eu.has(e)?"Category axis":"X axis"}: ${b}, ${d}.`}),r>=t&&S.push({id:A("axis"),role:"axis",level:2,label:`Value axis: ${y}, ${n(t)} to ${n(r)}.`})}if(v){let r=ka(v,v),i=/* @__PURE__ */new Map;for(let e of c){let t=String(r(e)??"—"),a=i.get(t);a?a.push(e):i.set(t,[e])}let n=[];for(let[r,o]of i){let i=mi(e,{...t,data:o},{levels:["l2","l3"],locale:a}).text;n.push({id:A("series"),role:"series",level:2,label:`Series ${r}: ${i}`,children:x(o,3)})}s.children=[...S,...n]}else s.children=[...S,...x(c,2)];return l&&s.children.push(l),s}function cn(e,t){let r=[],a=e=>{if(r.push(e),e.children&&e.children.length>0&&t.has(e.id))for(let t of e.children)a(t)};return a(e),r}function un(e){let t=1;if(e.children)for(let r of e.children)t+=un(r);return t}function dn(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function hn(e){return dn(e)?e:void 0}function pn(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:void 0}function fn(e){let t=pn(e);return null==t?void 0:Math.max(0,Math.floor(t))}function mn(...e){return e.map(hn).find(Boolean)}function gn(...e){return e.find(Array.isArray)}function yn(e){let t={};for(let[r,a]of Object.entries(e))void 0!==a&&(t[r]=a);return t}function bn(e,t,r){return e["string"==typeof t&&t?t:r]}function vn(e){return e instanceof Date?e.toISOString():"number"==typeof e?Number.isInteger(e)?String(e):String(Math.round(1e3*e)/1e3):String(e??"—")}function wn(e,t,r){let a=[];if("GaugeChart"===e){"number"==typeof t.value&&Number.isFinite(t.value)&&a.push(`Current value is ${vn(t.value)}.`);let e="number"==typeof t.min&&Number.isFinite(t.min)?t.min:0,r="number"==typeof t.max&&Number.isFinite(t.max)?t.max:100;a.push(`The gauge scale runs from ${vn(e)} to ${vn(r)}.`)}if("SankeyDiagram"===e||"ProcessSankey"===e){let i=Array.isArray(t.edges)?t.edges:[];if("ProcessSankey"===e&&Array.isArray(t.domain)&&2===t.domain.length&&a.push(`The ProcessSankey time domain runs from ${vn(t.domain[0])} to ${vn(t.domain[1])}.`),i.length>0){a.push(`${i.length} source flow${1===i.length?"":"s"} are supplied.`);for(let n of i.slice(0,r)){let r=bn(n,t.sourceAccessor,"source"),i=bn(n,t.targetAccessor,"target"),o=bn(n,t.valueAccessor,"value"),s="ProcessSankey"===e&&(null!=n.startTime||null!=n.endTime);a.push(s?`${vn(r)} to ${vn(i)} has value ${vn(o)} over ${vn(n.startTime)}–${vn(n.endTime)}.`:`${vn(r)} to ${vn(i)} has value ${vn(o)}.`)}}}if("Treemap"===e||"CirclePack"===e||"TreeDiagram"===e||"OrbitDiagram"===e){let e=hn(t.data),i="string"==typeof t.childrenAccessor&&t.childrenAccessor?t.childrenAccessor:"children",n="string"==typeof t.valueAccessor&&t.valueAccessor?t.valueAccessor:"value",o="string"==typeof t.nodeIdAccessor&&t.nodeIdAccessor?t.nodeIdAccessor:"string"==typeof t.nodeIDAccessor&&t.nodeIDAccessor?t.nodeIDAccessor:"name",s=[],l=e=>{let t=Array.isArray(e[i])?e[i]:[];if(0!==t.length)for(let e of t){let t=hn(e);t&&l(t)}else s.push(e)};if(e&&l(e),s.length>0){a.push(`${s.length} hierarchy leaves are supplied.`);for(let e of s.slice(0,r))a.push(`${vn(e[o])} has value ${vn(e[n])}.`)}}if(vu.has(e)&&Array.isArray(t.data)){let r=t.data;a.push(`${r.length} observed source row${1===r.length?"":"s"} are supplied.`);let i="CollisionSwarmChart"===e?t.xAccessor:t.valueAccessor,n="CollisionSwarmChart"===e?"x":"value",o=r.map(e=>pn(bn(e,i,n))).filter(e=>null!=e);o.length>0&&a.push(`Observed ${"string"==typeof i?i:n} ranges from ${vn(Math.min(...o))} to ${vn(Math.max(...o))}.`)}if(0!==a.length)return{source:"chart-props",statements:a,text:`Exact chart-prop facts: ${a.join(" ")}`}}function An(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:`${t}s`}function $n(e){return Number.isInteger(e)?String(e):String(Math.round(1e3*e)/1e3)}function xn(e,t,r,a){let i=hn(e.settledProjection),n=hn(t?.settledProjection);return gn(r?.projectionRows,r?.aggregates,e.settledProjectionRows,e.projectionRows,i?.rows,t?.settledProjectionRows,t?.projectionRows,n?.rows,a?.binCounts)}function Sn(e){if(!e||0===e.length)return;let t=e.map((e,t)=>{let r=hn(e);if(!r)return;let a=pn(r.count??r.value??r.total??r.bodies??r.events);if(null==a)return;let i=String(r.label??r.id??r.name??`container ${t+1}`),n=null==r.id?void 0:String(r.id),o=pn(r.secondary??r.secondaryCount),s=pn(r.observed??r.observedCount);return yn({id:n,label:i,count:a,secondary:o,secondaryLabel:"string"==typeof r.secondaryLabel?r.secondaryLabel:void 0,observed:s})}).filter(e=>null!=e);if(0===t.length)return;let r=t.reduce((e,t)=>e+t.count,0),a=t.filter(e=>e.count>0).length,i=t.slice().sort((e,t)=>t.count-e.count)[0];return{rows:t,totalCount:r,populatedCount:a,...i?{leader:i}:{}}}function Cn(e,t){let r=e?.map((e,t)=>{let r=hn(e);if(!r)return;let a=pn(r.count)??0,i=pn(r.total),n={label:String(r.label??r.id??`sediment ${t+1}`),count:a};return null!=r.id&&(n.id=String(r.id)),null!=i&&(n.total=i),n}).filter(e=>null!=e),a=fn(t?.bins)??r?.length??0,i=pn(t?.count)??r?.reduce((e,t)=>e+t.count,0)??0,n=pn(t?.total)??r?.reduce((e,t)=>e+(t.total??0),0),o=r?.slice().sort((e,t)=>t.count-e.count)[0];if(0!==a||0!==i||n)return{bins:a,count:i,...null!=n&&n>0?{total:n}:{},...o?{leader:o}:{}}}function kn(e){let t=hn(e);return!!t&&(dn(t.world)||"simulationState"in t||"liveBodyOrder"in t)}function Rn(e){if(e)return e.filter(e=>!0===hn(e)?.sleeping).length}function Pn(e,t,r){let a=e?.filter(e=>!0===hn(e)?.sensor).length,i=hn(t?.observation),n=hn(i?.sensors),o=gn(r?.activeSensors);return Math.max(a??0,n?Object.keys(n).length:0,o?.length??0)||void 0}function Nn(e){let t=[],r=e.simulation,a=[r.state??(r.settled?"settled":void 0),null!=r.liveBodies?`${r.liveBodies} live ${An(r.liveBodies,"body")}`:void 0,null!=r.sleepingBodies?`${r.sleepingBodies} sleeping`:void 0,null!=r.queued?`${r.queued} queued`:void 0,null!=r.seed?`seed ${$n(r.seed)}`:void 0,r.gravity?`gravity (${$n(r.gravity.x)}, ${$n(r.gravity.y)})`:void 0,null!=r.fixedDt?`fixed step ${$n(r.fixedDt)}s`:void 0,null!=r.timeScale?`${$n(r.timeScale)}x time`:void 0].filter(Boolean);a.length>0&&t.push(`Physics simulation: ${a.join("; ")}.`);let i=e.geometry;if(i){let e=[null!=i.colliders?`${i.colliders} ${An(i.colliders,"collider")}`:void 0,null!=i.sensors?`${i.sensors} ${An(i.sensors,"sensor")}`:void 0,null!=i.springs?`${i.springs} ${An(i.springs,"spring")}`:void 0,null!=i.activeSensorPairs?`${i.activeSensorPairs} active sensor ${An(i.activeSensorPairs,"pair")}`:void 0].filter(Boolean);e.length>0&&t.push(`Physics geometry: ${e.join("; ")}.`)}let n=e.aggregates;if(n){let e=n.leader,r=e?` Largest is ${e.label} with ${$n(e.count)}.`:"";t.push(`Physics aggregates: ${$n(n.totalCount)} settled ${An(n.totalCount,"body")} across ${n.rows.length} ${An(n.rows.length,"container")}; ${n.populatedCount} populated.${r}`)}let o=e.sediment;if(o){let e=null!=o.total?`, value total ${$n(o.total)}`:"",r=o.leader?`; largest sediment bin is ${o.leader.label} with ${$n(o.leader.count)}`:"";t.push(`Physics sediment: ${o.count} retained ${An(o.count,"body")} in ${o.bins} ${An(o.bins,"bin")}${e}${r}.`)}return t.join(" ")}function En(e,t,r){if(!1===r)return;let a=dn(r)?r:void 0,i=hn(t.physics),n=mn(a?.snapshot,i?.snapshot,t.physicsSnapshot,kn(t.snapshot)?t.snapshot:void 0),o=mn(a?.evidence,i?.evidence,t.physicsEvidence,t.settledEvidence),s=mn(a?.config,i?.config,n?.config,t.config),l=mn(hn(n?.world),hn(i?.world)),c=mn(hn(s?.kernel),hn(l?.options)),u=gn(l?.bodies),d=gn(l?.colliders,s?.colliders),h=gn(n?.queue,i?.queue),p=gn(n?.liveBodyOrder),f=gn(l?.springs),m=gn(n?.activeSensorPairs),g=Sn(xn(t,i,a,o)),y=Cn(gn(a?.sediment,i?.sediment,n?.sediment),mn(a?.sedimentTotals,i?.sedimentTotals)),b=p?.length??u?.length??fn(o?.bodyCount),v=Rn(u)??fn(o?.sleepingCount),w=h?.length,A="string"==typeof n?.simulationState?n.simulationState:void 0,$="boolean"==typeof o?.settled?o.settled:A?"settled"===A:null!=b||null!=v||null!=w?null!=b&&v===b&&0===(w??0):void 0,x=hn(c?.gravity),S=pn(x?.x),C=pn(x?.y),k=yn({state:A,settled:$,elapsedSeconds:pn(n?.elapsedSeconds),paused:"boolean"==typeof n?.paused?n.paused:void 0,visible:"boolean"==typeof n?.visible?n.visible:void 0,seed:pn(c?.seed),gravity:null!=S&&null!=C?{x:S,y:C}:void 0,fixedDt:pn(s?.fixedDt??c?.fixedDt),timeScale:pn(s?.timeScale),maxSubsteps:fn(s?.maxSubsteps),liveBodies:b,sleepingBodies:v,queued:w,bodyLimit:pn(s?.bodyLimit),eviction:"string"==typeof s?.eviction?s.eviction:void 0}),R=yn({colliders:d?.length,sensors:Pn(d,s,l),springs:f?.length,activeSensorPairs:m?.length}),P=Object.keys(R).length>0,N=vu.has(e);if(!(Object.keys(k).length>0||P||g||y)||!N&&null==r)return;let E={simulation:k,...P?{geometry:R}:{},...g?{aggregates:g}:{},...y?{sediment:y}:{}},I=Nn(E);return{...E,text:I}}function In(e){if(!e)return{};if("fits"in e||"buildProps"in e)return{family:e.family};let t=e;return{family:t.family,intentScores:t.intentScores}}function Tn(e,t,r={}){let a,{capability:i,audience:n,locale:o}=r,s=r.levels??["l1","l2","l3"],l=!1!==r.includeStructure,c=si(e,i),u=mi(e,t,{levels:c?[...s,"l4"]:s,locale:o,capability:i,audience:n}),{l4:d,...h}=u.levels,p=["l1","l2","l3"].map(e=>u.levels[e]).filter(Boolean).join(" "),f={levels:h,text:u.annotations?`${u.annotations} ${p}`.trim():p,...u.annotations?{annotations:u.annotations}:{}};if(c&&d){let e=In(i);a={act:c,sentence:d,family:e.family,intentScores:e.intentScores}}let m=l?ln(e,t,{maxLeaves:r.maxLeaves,locale:o}):void 0,g=En(e,t,r.physics),y=wn(e,t,Math.max(1,r.maxLeaves??200)),b=[f.text,a?.sentence,g?.text,y?.text].filter(Boolean).join(" ");return{component:e,description:f,intent:a,structure:m,physics:g,facts:y,text:b}}function Mn(e,t=30){return Math.max((e??4)+5,12,t)}function On(e,t){return t?.length&&Object.defineProperty(e,wu,{configurable:!0,enumerable:!1,value:t}),e}function Fn(e){return e?.[wu]}function jn(e){let t=e;return Fn(!0===t?.__semioticHoverData?t.data:e)}function zn(e,t){return Object.defineProperty(e,"__semioticSelectionCoverage",{configurable:!0,enumerable:!1,value:t}),e}function Bn(e){if(null==e||"string"==typeof e&&""===e.trim())return NaN;if(e instanceof Date)return e.getTime();if("string"==typeof e){let t=ut(e);if(Number.isFinite(t))return t}return Number(e)}function Ln(e){return t=>"number"!=typeof t.binStart||"number"!=typeof t.binEnd?t:zn(On({...t},Fn(t)),{ranges:{[e]:[t.binStart,t.binEnd]},toNumber:Bn})}function _n(e,t){return Au.has(e)&&!("reading"===e&&"string"==typeof t)}function Dn(e){let t=[...Su],r=Array.from((new TextEncoder).encode(e)),a=8*r.length;for(r.push(128);r.length%64!=56;)r.push(0);let i=Math.floor(a/4294967296),n=a>>>0;r.push(i>>>24&255,i>>>16&255,i>>>8&255,255&i,n>>>24&255,n>>>16&255,n>>>8&255,255&n);let o=[];for(let e=0;e<r.length;e+=4)o.push((r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0);for(let e=0;e<o.length;e+=16){let r=[...o.slice(e,e+16)];for(let e=16;e<64;e+=1){let t=$u(r[e-15],7)^$u(r[e-15],18)^r[e-15]>>>3,a=$u(r[e-2],17)^$u(r[e-2],19)^r[e-2]>>>10;r[e]=r[e-16]+t+r[e-7]+a>>>0}let[a,i,n,s,l,c,u,d]=t;for(let e=0;e<64;e+=1){let t=d+($u(l,6)^$u(l,11)^$u(l,25))+(l&c^~l&u)+Cu[e]+r[e]>>>0,o=a&i^a&n^i&n;d=u,u=c,c=l,l=s+t>>>0,s=n,n=i,i=a,a=t+(($u(a,2)^$u(a,13)^$u(a,22))+o>>>0)>>>0}let h=[a,i,n,s,l,c,u,d];for(let e=0;e<8;e+=1)t[e]=t[e]+h[e]>>>0}return t.map(e=>e.toString(16).padStart(8,"0")).join("")}function Un(e,t){return`${e}[Symbol(${t.description??""})]`}function Vn(e,t){if(!/^(0|[1-9][0-9]*)$/.test(e))return!1;let r=Number(e);return Number.isSafeInteger(r)&&r>=0&&r<t}function Gn(e,t){return"number"==typeof t?`${e}[${t}]`:e?`${e}.${t}`:t}function Hn(e){return e.sort((e,t)=>{let r=JSON.stringify(e),a=JSON.stringify(t);return r<a?-1:r>a?1:0})}function qn(e,t,r){if(null===e)return null;if(e instanceof Date){let a=e.getTime();return Number.isFinite(a)?{$type:"date",value:e.toISOString()}:void r.excluded.push(t)}switch(typeof e){case"string":case"boolean":return e;case"number":return Number.isNaN(e)?{$type:"number",value:"NaN"}:e===1/0?{$type:"number",value:"Infinity"}:e===-1/0?{$type:"number",value:"-Infinity"}:Object.is(e,-0)?{$type:"number",value:"-0"}:e;case"bigint":return{$type:"bigint",value:e.toString()};case"undefined":case"function":case"symbol":return void r.excluded.push(t);case"object":{let a=e;if(r.ancestors.has(a))return void r.excluded.push(t);r.ancestors.add(a);try{if(Array.isArray(e)){for(let a of Reflect.ownKeys(e))"length"===a||"string"==typeof a&&Vn(a,e.length)||r.excluded.push("symbol"==typeof a?Un(t,a):Gn(t,a));return Array.from({length:e.length},(a,i)=>{let n=Gn(t,i),o=Object.getOwnPropertyDescriptor(e,String(i));if(!o||!("value"in o)||!o.enumerable)return r.excluded.push(n),null;let s=qn(o.value,n,r);return void 0===s?null:s})}let a={},i=Object.getPrototypeOf(e);if(i!==Object.prototype&&null!==i)return void r.excluded.push(t);let n=[];for(let a of Reflect.ownKeys(e)){if("symbol"==typeof a){r.excluded.push(Un(t,a));continue}let i=Object.getOwnPropertyDescriptor(e,a);i&&"value"in i&&i.enumerable?n.push(a):r.excluded.push(Gn(t,a))}for(let i of n.sort()){let n=Object.getOwnPropertyDescriptor(e,i),o=qn(n&&"value"in n?n.value:void 0,Gn(t,i),r);void 0!==o&&Object.defineProperty(a,i,{value:o,enumerable:!0,configurable:!0,writable:!0})}return a}finally{r.ancestors.delete(a)}}default:return void r.excluded.push(t)}}function Wn(e,t=/* @__PURE__ */new Set){if(null===e)return["null"];if(e instanceof Date)return Number.isFinite(e.getTime())?["date",e.toISOString()]:["excluded"];switch(typeof e){case"string":return["string",e];case"boolean":return["boolean",e];case"number":return["number",Number.isNaN(e)?"NaN":e===1/0?"Infinity":e===-1/0?"-Infinity":Object.is(e,-0)?"-0":String(e)];case"bigint":return["bigint",e.toString()];case"undefined":case"function":case"symbol":return["excluded"];case"object":if(t.has(e))return["excluded"];t.add(e);try{let r=r=>{let a="symbol"==typeof r?["symbol-key",r.description??""]:["string-key",r],i=Object.getOwnPropertyDescriptor(e,r);return i?"value"in i?[a,"data",!!i.enumerable,Wn(i.value,t)]:[a,"accessor",!!i.enumerable,!!i.get,!!i.set]:[a,"missing"]};if(Array.isArray(e))return["array",Array.from({length:e.length},(t,a)=>{let i=String(a);return Object.prototype.hasOwnProperty.call(e,i)?r(i):["hole"]}),Hn(Reflect.ownKeys(e).filter(t=>"length"!==t&&!("string"==typeof t&&Vn(t,e.length))).map(r))];let a=Object.getPrototypeOf(e);return[a!==Object.prototype&&null!==a?"non-json-object":"object",Hn(Reflect.ownKeys(e).map(r))]}finally{t.delete(e)}default:return["excluded"]}}function Yn(e){let t={excluded:[],ancestors:/* @__PURE__ */new Set},r=qn(e,"$",t)??null;return{value:r,text:JSON.stringify(r),excludedPaths:t.excluded}}function Kn(e){let t=Yn(e),r=Dn(JSON.stringify(["semiotic-value-fingerprint","v2",Wn(e)]));return{...t,algorithm:"sha256",digest:r,fingerprint:`sha256:${r}`}}function Jn(e,t,r,a){ao(e,Object.keys(t),r,a);for(let[i,n]of Object.entries(t))n.values?(n.required||void 0!==e[i])&&no(e,i,r,n.values,a):n.required?io(e,i,r,a):uo(e,i,r,a)}function Xn(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Zn(e,t,r,a){void 0!==e[t]&&("number"!=typeof e[t]||!Number.isFinite(e[t]))&&a.push({path:`${r}.${t}`,message:"Expected a finite number."})}function Qn(e,t,r,a){void 0!==e[t]&&"boolean"!=typeof e[t]&&a.push({path:`${r}.${t}`,message:"Expected a boolean."})}function eo(e){return null===e||"string"==typeof e||"boolean"==typeof e||("number"==typeof e?Number.isFinite(e):Array.isArray(e)?e.every(eo):Xn(e)&&Object.values(e).every(eo))}function to(e,t,r,a){void 0!==e[t]&&(!Xn(e[t])||!eo(e[t]))&&a.push({path:`${r}.${t}`,message:"Expected a JSON object."})}function ro(e){return e.every(eo)}function ao(e,t,r,a){let i=new Set(t);for(let t of Object.keys(e))i.has(t)||a.push({path:`${r}.${t}`,message:"Unexpected property."})}function io(e,t,r,a){("string"!=typeof e[t]||!e[t])&&a.push({path:`${r}.${t}`,message:"Expected a non-empty string."})}function no(e,t,r,a,i){("string"!=typeof e[t]||!a.includes(e[t]))&&i.push({path:`${r}.${t}`,message:`Expected one of: ${a.join(", ")}.`})}function oo(e,t,r,a){let i=e[t];if(void 0!==i)return Xn(i)?i:void a.push({path:`${r}.${t}`,message:"Expected an object."})}function so(e,t,r,a){let i=e[t];if(void 0!==i)return Array.isArray(i)?i:void a.push({path:`${r}.${t}`,message:"Expected an array."})}function lo(e,t,r){e?.some(e=>"string"!=typeof e||!e)&&r.push({path:t,message:"Expected non-empty string values."})}function co(e,t,r,a,i){void 0!==e[t]&&no(e,t,r,a,i)}function uo(e,t,r,a){void 0!==e[t]&&"string"!=typeof e[t]&&a.push({path:`${r}.${t}`,message:"Expected a string."})}function ho(e,t,r){Xn(e)?(ao(e,["id","name","kind"],t,r),io(e,"kind",t,r),uo(e,"id",t,r),uo(e,"name",t,r)):r.push({path:t,message:"Expected an actor object."})}function po(e,t){let r=oo(e,"reception","$",t);if(!r)return;ao(r,["channels","audience","strengths","risks","scaffolds","description","dataFallback","manualChecks"],"$.reception",t);let a=so(r,"channels","$.reception",t);a||t.push({path:"$.reception.channels",message:"Expected a reception-channel array."}),a?.forEach((e,r)=>{let a=`$.reception.channels[${r}]`;Xn(e)?(ao(e,["channel","disclosure","navigation","interactionInstructions","rawData","tokenBudget","privacyNotes"],a,t),no(e,"channel",a,["visual","screen-reader","sonified","agent","print","low-bandwidth"],t),co(e,"disclosure",a,["summary","standard","detailed"],t),co(e,"rawData",a,["deny","bounded","allow"],t),Qn(e,"navigation",a,t),Qn(e,"interactionInstructions",a,t),Zn(e,"tokenBudget",a,t),lo(so(e,"privacyNotes",a,t),`${a}.privacyNotes`,t)):t.push({path:a,message:"Expected a channel object."})});for(let e of["strengths","risks","scaffolds","manualChecks"])lo(so(r,e,"$.reception",t),`$.reception.${e}`,t);uo(r,"audience","$.reception",t),uo(r,"description","$.reception",t),Qn(r,"dataFallback","$.reception",t)}function fo(e,t){let r=oo(e,"form","$",t);r&&(ao(r,["chartFamily","whyThisForm","rejectedAlternatives","risks","misuse"],"$.form",t),uo(r,"chartFamily","$.form",t),uo(r,"whyThisForm","$.form",t),lo(so(r,"risks","$.form",t),"$.form.risks",t),lo(so(r,"misuse","$.form",t),"$.form.misuse",t),so(r,"rejectedAlternatives","$.form",t)?.forEach((e,r)=>{let a=`$.form.rejectedAlternatives[${r}]`;Xn(e)?(ao(e,["representation","reason"],a,t),io(e,"representation",a,t),io(e,"reason",a,t)):t.push({path:a,message:"Expected an alternative object."})}))}function mo(e,t){let r=oo(e,"contestability","$",t);r&&(ao(r,["sourceRequestsAllowed","alternativeViews","challenges","corrections","editorialExceptions"],"$.contestability",t),Qn(r,"sourceRequestsAllowed","$.contestability",t),so(r,"challenges","$.contestability",t)?.forEach((e,r)=>{let a=`$.contestability.challenges[${r}]`;if(Xn(e)){ao(e,["id","claimId","status","reason","raisedBy","raisedAt","counterclaimId","resolution"],a,t),io(e,"id",a,t),io(e,"claimId",a,t),io(e,"reason",a,t),no(e,"status",a,["open","accepted","declined","resolved"],t),void 0!==e.raisedBy&&ho(e.raisedBy,`${a}.raisedBy`,t);for(let r of["raisedAt","counterclaimId","resolution"])uo(e,r,a,t)}else t.push({path:a,message:"Expected a challenge object."})}),so(r,"corrections","$.contestability",t)?.forEach((e,r)=>{let a=`$.contestability.corrections[${r}]`;if(!Xn(e))return void t.push({path:a,message:"Expected a correction object."});ao(e,["id","affectedClaimIds","replacementClaimIds","reason","createdAt","createdBy"],a,t),io(e,"id",a,t),io(e,"reason",a,t);let i=so(e,"affectedClaimIds",a,t);i||t.push({path:`${a}.affectedClaimIds`,message:"Expected an affected-claim array."}),lo(i,`${a}.affectedClaimIds`,t),lo(so(e,"replacementClaimIds",a,t),`${a}.replacementClaimIds`,t),uo(e,"createdAt",a,t),void 0!==e.createdBy&&ho(e.createdBy,`${a}.createdBy`,t)}),so(r,"alternativeViews","$.contestability",t)?.forEach((e,r)=>{let a=`$.contestability.alternativeViews[${r}]`;Xn(e)?(ao(e,["id","label","rationale"],a,t),io(e,"id",a,t),io(e,"label",a,t),uo(e,"rationale",a,t)):t.push({path:a,message:"Expected an alternative-view object."})}),so(r,"editorialExceptions","$.contestability",t)?.forEach((e,r)=>{let a=`$.contestability.editorialExceptions[${r}]`;Xn(e)?(ao(e,["ruleId","rationale","owner","reviewAt"],a,t),io(e,"ruleId",a,t),io(e,"rationale",a,t),uo(e,"owner",a,t),uo(e,"reviewAt",a,t)):t.push({path:a,message:"Expected an editorial-exception object."})}))}function go(e,t){let r=oo(e,"accountability","$",t);r&&(ao(r,["authors","generatedBy","dataSources","codeRef","reviews","actions"],"$.accountability",t),so(r,"authors","$.accountability",t)?.forEach((e,r)=>ho(e,`$.accountability.authors[${r}]`,t)),lo(so(r,"dataSources","$.accountability",t),"$.accountability.dataSources",t),uo(r,"generatedBy","$.accountability",t),uo(r,"codeRef","$.accountability",t),so(r,"reviews","$.accountability",t)?.forEach((e,r)=>{let a=`$.accountability.reviews[${r}]`;if(Xn(e)){ao(e,["id","status","reviewer","reviewedAt","rationale","policyId"],a,t),io(e,"id",a,t),no(e,"status",a,["pending","approved","changes-requested","rejected"],t),void 0!==e.reviewer&&ho(e.reviewer,`${a}.reviewer`,t);for(let r of["reviewedAt","rationale","policyId"])uo(e,r,a,t)}else t.push({path:a,message:"Expected a review object."})}),so(r,"actions","$.accountability",t)?.forEach((e,r)=>{let a=`$.accountability.actions[${r}]`;if(!Xn(e))return void t.push({path:a,message:"Expected an action object."});ao(e,["id","action","actor","actedAt","claimIds","artifactId","artifactRevision","policyId","status","invalidatedByClaimId"],a,t),io(e,"id",a,t),io(e,"action",a,t);let i=so(e,"claimIds",a,t);i||t.push({path:`${a}.claimIds`,message:"Expected a claim identifier array."}),lo(i,`${a}.claimIds`,t),void 0!==e.actor&&ho(e.actor,`${a}.actor`,t);for(let r of["actedAt","artifactId","artifactRevision","policyId","invalidatedByClaimId"])uo(e,r,a,t);co(e,"status",a,["proposed","taken","reversed","invalidated"],t)}))}function yo(e,t){let r=oo(e,"inheritance","$",t);if(r){ao(r,["requiredPaths","prohibitedExports","privacy","rawDataDefault","preservation","sourceArtifactIds"],"$.inheritance",t);for(let e of["requiredPaths","prohibitedExports","sourceArtifactIds"])lo(so(r,e,"$.inheritance",t),`$.inheritance.${e}`,t);co(r,"privacy","$.inheritance",["public","restricted","confidential","unknown"],t),co(r,"rawDataDefault","$.inheritance",["exclude","bounded","include"],t),co(r,"preservation","$.inheritance",["full-fidelity","claim-evidence-preserved","visual-only","lossy","unknown"],t)}}function bo(e,t){po(e,t),fo(e,t),mo(e,t),go(e,t),yo(e,t)}function vo(e){for(let t of Object.values(e))Object.freeze(t.suppliedBy),Object.freeze(t);return Object.freeze(e)}function wo(e,t){if(void 0===e||Xn(e)){if(Xn(e))for(let[r,a]of Object.entries(e)){let e=`$.fieldStatus.${r}`;if(!Xn(a)||"string"!=typeof a.status){t.push({path:e,message:"Expected a field state with a status."});continue}ao(a,["status","reason","suppliedBy","derived","reviewedBy"],e,t),["known","unknown","manual","not-applicable"].includes(a.status)||t.push({path:`${e}.status`,message:"Expected one of: known, unknown, manual, not-applicable."}),void 0!==a.suppliedBy&&("string"!=typeof a.suppliedBy||!["author","system","model-proposal","import"].includes(a.suppliedBy))&&t.push({path:`${e}.suppliedBy`,message:"Expected one of: author, system, model-proposal, import."}),uo(a,"reason",e,t),uo(a,"reviewedBy",e,t),Qn(a,"derived",e,t);let i=Object.prototype.hasOwnProperty.call(ku,r)?ku[r]:void 0,n="model-proposal"===a.suppliedBy,o=n&&!0===i?.modelMayPropose&&"known"!==a.status;i&&"known"===a.status&&"string"!=typeof a.suppliedBy&&t.push({path:`${e}.suppliedBy`,message:`Known field "${r}" must identify an allowed supplier.`}),i&&"string"==typeof a.suppliedBy&&!o&&!i.suppliedBy.includes(a.suppliedBy)&&t.push({path:`${e}.suppliedBy`,message:`Field "${r}" cannot be supplied by ${a.suppliedBy}.`}),i&&!0===a.derived&&!i.derivable&&t.push({path:`${e}.derived`,message:`Field "${r}" cannot be marked as derived.`}),i&&n&&(!i.modelMayPropose||"known"===a.status)&&t.push({path:`${e}.suppliedBy`,message:"known"===a.status?`A model proposal cannot finalize field "${r}" as known.`:`Field "${r}" does not accept model proposals.`}),"required"===i?.humanReview&&"known"===a.status&&("string"!=typeof a.reviewedBy||!a.reviewedBy.trim())&&t.push({path:`${e}.reviewedBy`,message:`Known field "${r}" requires an attributable human review.`})}}else t.push({path:"$.fieldStatus",message:"Expected a field-state object."})}function Ao(e,t){let r="$.time";ao(e,[...Nu,...Object.keys(Eu),"sources"],r,t);for(let a of Nu)uo(e,a,r,t);for(let[a,i]of Object.entries(Eu)){let n=oo(e,a,r,t);n&&Jn(n,i,`${r}.${a}`,t)}so(e,"sources",r,t)?.forEach((e,a)=>{let i=`${r}.sources[${a}]`;Xn(e)?Jn(e,Iu,i,t):t.push({path:i,message:"Expected a source object."})})}function $o(e){try{return xo(e)}catch{return{valid:!1,errors:[{path:"$",message:"Artifact contract could not be inspected safely."}],warnings:[]}}}function xo(e){let t=[],r=[];if(!Xn(e))return{valid:!1,errors:[{path:"$",message:"Expected an object."}],warnings:r};let a=Sr(e);if(a.length>0)return{valid:!1,errors:a.map(e=>({path:e,message:"Expected a JSON-compatible value that survives serialization unchanged."})),warnings:r};if(ao(e,["contractVersion","artifact","purpose","claims","evidence","time","reception","form","contestability","accountability","inheritance","fieldStatus","extensions"],"$",t),"0.1"!==e.contractVersion&&t.push({path:"$.contractVersion",message:"Expected contract version 0.1."}),Xn(e.artifact)){ao(e.artifact,["id","kind","component","title","createdAt","configFingerprint","dataFingerprint","revision"],"$.artifact",t),io(e.artifact,"id","$.artifact",t),no(e.artifact,"kind","$.artifact",["chart","dashboard","story","alert","agent-answer"],t);for(let r of["component","title","createdAt","configFingerprint","dataFingerprint","revision"])uo(e.artifact,r,"$.artifact",t)}else t.push({path:"$.artifact",message:"Expected an artifact identity object."});if(Xn(e.purpose))if(Array.isArray(e.purpose.intents)){ao(e.purpose,["intents","communicativeAct","decisionContext","stakes","allowedUses","prohibitedUses"],"$.purpose",t),e.purpose.intents.forEach((e,r)=>{(!Xn(e)||"string"!=typeof e.id||!e.id)&&t.push({path:`$.purpose.intents[${r}].id`,message:"Expected a non-empty intent identifier."}),Xn(e)&&ao(e,["id","strength","source","rationale"],`$.purpose.intents[${r}]`,t),Xn(e)&&void 0!==e.strength&&no(e,"strength",`$.purpose.intents[${r}]`,["primary","secondary"],t),Xn(e)&&(co(e,"source",`$.purpose.intents[${r}]`,["author","derived","model-proposal","import"],t),uo(e,"rationale",`$.purpose.intents[${r}]`,t))});for(let r of["allowedUses","prohibitedUses"])lo(so(e.purpose,r,"$.purpose",t),`$.purpose.${r}`,t);co(e.purpose,"stakes","$.purpose",["exploratory","informational","operational","high"],t),uo(e.purpose,"communicativeAct","$.purpose",t),uo(e.purpose,"decisionContext","$.purpose",t)}else t.push({path:"$.purpose.intents",message:"Expected an intent array."});else t.push({path:"$.purpose",message:"Expected a purpose object."});Array.isArray(e.claims)?e.claims.forEach((e,r)=>{if(!Xn(e))return void t.push({path:`$.claims[${r}]`,message:"Expected a claim object."});ao(e,["id","text","kind","status","evidenceIds","scope","uncertainty","asOf","supersedes","authoredBy","review","tags"],`$.claims[${r}]`,t),io(e,"id",`$.claims[${r}]`,t),no(e,"kind",`$.claims[${r}]`,["description","observation","aggregation","inference","forecast","simulation","alert","recommendation","normative"],t),no(e,"status",`$.claims[${r}]`,["supported","provisional","disputed","superseded","retracted","unsupported","unknown"],t),Array.isArray(e.evidenceIds)?e.evidenceIds.some(e=>"string"!=typeof e||!e)&&t.push({path:`$.claims[${r}].evidenceIds`,message:"Expected non-empty string evidence identifiers."}):t.push({path:`$.claims[${r}].evidenceIds`,message:"Expected an evidence identifier array."}),lo(so(e,"supersedes",`$.claims[${r}]`,t),`$.claims[${r}].supersedes`,t),uo(e,"text",`$.claims[${r}]`,t),uo(e,"asOf",`$.claims[${r}]`,t),to(e,"scope",`$.claims[${r}]`,t),lo(so(e,"tags",`$.claims[${r}]`,t),`$.claims[${r}].tags`,t),void 0!==e.authoredBy&&ho(e.authoredBy,`$.claims[${r}].authoredBy`,t);let a=oo(e,"review",`$.claims[${r}]`,t);a&&(ao(a,["status","reviewer","reviewedAt","rationale"],`$.claims[${r}].review`,t),no(a,"status",`$.claims[${r}].review`,["proposed","reviewed","approved","rejected"],t),void 0!==a.reviewer&&ho(a.reviewer,`$.claims[${r}].review.reviewer`,t),uo(a,"reviewedAt",`$.claims[${r}].review`,t),uo(a,"rationale",`$.claims[${r}].review`,t));let i=oo(e,"uncertainty",`$.claims[${r}]`,t);if(i){ao(i,["kind","lower","upper","confidence","unit","description"],`$.claims[${r}].uncertainty`,t),no(i,"kind",`$.claims[${r}].uncertainty`,["interval","distribution","qualitative","unknown"],t);for(let e of["lower","upper","confidence"])Zn(i,e,`$.claims[${r}].uncertainty`,t);uo(i,"unit",`$.claims[${r}].uncertainty`,t),uo(i,"description",`$.claims[${r}].uncertainty`,t)}}):t.push({path:"$.claims",message:"Expected a claim array."}),Array.isArray(e.evidence)?e.evidence.forEach((e,r)=>{if(!Xn(e))return void t.push({path:`$.evidence[${r}]`,message:"Expected an evidence object."});ao(e,["id","role","label","source","fingerprint","dataVersion","observedAt","scope","sample","transformation","generatedClaimId","relationship"],`$.evidence[${r}]`,t),io(e,"id",`$.evidence[${r}]`,t),no(e,"role",`$.evidence[${r}]`,["source-data","external-source","transformation","statistical-test","model-output","human-observation","policy-rule","quality-check"],t);for(let a of["label","fingerprint","dataVersion","observedAt","generatedClaimId"])uo(e,a,`$.evidence[${r}]`,t);to(e,"scope",`$.evidence[${r}]`,t);let a=oo(e,"source",`$.evidence[${r}]`,t);if(a){ao(a,["name","uri","version","retrievedAt","publisher"],`$.evidence[${r}].source`,t);for(let e of["name","uri","version","retrievedAt","publisher"])uo(a,e,`$.evidence[${r}].source`,t)}let i=oo(e,"transformation",`$.evidence[${r}]`,t);if(i){ao(i,["id","kind","description","inputEvidenceIds","parameters","assumptions","implementation","performedAt","performedBy"],`$.evidence[${r}].transformation`,t),io(i,"id",`$.evidence[${r}].transformation`,t),no(i,"kind",`$.evidence[${r}].transformation`,["aggregation","filter","normalization","binning","join","smoothing","forecasting","simulation","other"],t);let e=so(i,"inputEvidenceIds",`$.evidence[${r}].transformation`,t);e?lo(e,`$.evidence[${r}].transformation.inputEvidenceIds`,t):t.push({path:`$.evidence[${r}].transformation.inputEvidenceIds`,message:"Expected an evidence identifier array."}),lo(so(i,"assumptions",`$.evidence[${r}].transformation`,t),`$.evidence[${r}].transformation.assumptions`,t),uo(i,"description",`$.evidence[${r}].transformation`,t),uo(i,"implementation",`$.evidence[${r}].transformation`,t),uo(i,"performedAt",`$.evidence[${r}].transformation`,t),to(i,"parameters",`$.evidence[${r}].transformation`,t),void 0!==i.performedBy&&ho(i.performedBy,`$.evidence[${r}].transformation.performedBy`,t)}let n=oo(e,"sample",`$.evidence[${r}]`,t);if(n){ao(n,["rowCount","fields","values","truncated"],`$.evidence[${r}].sample`,t),lo(so(n,"fields",`$.evidence[${r}].sample`,t),`$.evidence[${r}].sample.fields`,t);let e=so(n,"values",`$.evidence[${r}].sample`,t);e&&!ro(e)&&t.push({path:`$.evidence[${r}].sample.values`,message:"Expected JSON values."}),Zn(n,"rowCount",`$.evidence[${r}].sample`,t),Qn(n,"truncated",`$.evidence[${r}].sample`,t)}co(e,"relationship",`$.evidence[${r}]`,["descriptive","correlational","causal","unknown"],t)}):t.push({path:"$.evidence",message:"Expected an evidence array."}),wo(e.fieldStatus,t);let i=oo(e,"time","$",t);return i&&Ao(i,t),bo(e,t),to(e,"extensions","$",t),Array.isArray(e.claims)&&0===e.claims.length&&r.push({path:"$.claims",message:"The contract declares no claims."}),Array.isArray(e.evidence)&&0===e.evidence.length&&r.push({path:"$.evidence",message:"The contract declares no evidence."}),{valid:0===t.length,errors:t,warnings:r}}function So(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Co(e,t){if(!t||!So(e)||!Array.isArray(e.evidence))return[];let r=[];return e.evidence.forEach((e,t)=>{So(e)&&Object.prototype.hasOwnProperty.call(e,"sample")&&(delete e.sample,r.push(`$.evidence[${t}].sample`))}),r}function ko(e,t={}){try{return Ro(e,t)}catch{let t=Sr(e);return{transfer:{status:"invalid",omittedPaths:t.length?t:["$"],warnings:["Artifact contract could not be inspected safely."]}}}}function Ro(e,t){if(!So(e))return{transfer:{status:"invalid",omittedPaths:["artifactContract"],warnings:["Artifact contract must be a JSON object."]}};let r=Yn(e),a=[.../* @__PURE__ */new Set([...r.excludedPaths,...Sr(e)])].sort(),i=r.value,n=Co(i,t.excludeEvidenceSamples),o=n.length?["Bounded evidence samples were excluded by the transfer policy."]:[],s=i?.contractVersion;if("string"!=typeof s||!s)return{contract:i,transfer:{status:"invalid",omittedPaths:[...a,...n],warnings:["Artifact contract is missing a string contractVersion.",...o]}};if("0.1"!==s)return{contract:i,transfer:{status:a.length>0?"invalid":"unsupported-version",omittedPaths:[...a,...n],warnings:[`Contract version ${s} is not interpreted by this runtime.`,...a.length>0?[`Non-JSON values could not be preserved at: ${a.join(", ")}.`]:[],...o]}};let l=$o(i),c=[...l.errors.map(({path:e,message:t})=>`${e}: ${t}`),...l.warnings.map(({path:e,message:t})=>`${e}: ${t}`),...a.length?[`Non-JSON values could not be preserved at: ${a.join(", ")}.`]:[],...o];return{contract:i,transfer:{status:!l.valid||a.length>0?"invalid":n.length>0?"excluded":"preserved",omittedPaths:[...a,...n],warnings:c}}}function Po(e){let t=ko(e);if(!t.contract||"preserved"!==t.transfer.status)throw new TypeError(t.transfer.warnings.join(" ")||"Artifact contract could not be serialized without loss.");return t}function No(e){let t=Object.entries(e).filter(([e,t])=>_n(e,t)&&void 0!==t);if(0!==t.length)return 1===t.length&&"data"===t[0][0]?t[0][1]:Object.fromEntries(t)}function Eo(e,t=[]){if(void 0===e)return;let r=t.filter(e=>!!e.transformation).map(({id:e,transformation:t})=>({evidenceId:e,transformation:t})).sort(({evidenceId:e},{evidenceId:t})=>e<t?-1:e>t?1:0);return Kn(r.length>0?{data:e,transformations:r}:e).fingerprint}function Io(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!_n(e,t)&&"recipeId"!==e))}function To(e,t,r,a=No(t)){let i=Io(t),n=0===Sr(i).length?Kn(i).fingerprint:void 0,o=void 0!==a&&0===Sr(a).length?Eo(a,e.evidence):void 0,s="ChartRecipe"===r&&"string"==typeof t.recipeId?t.recipeId:r,l=[],c=[];return void 0!==s&&(void 0===e.artifact.component?c.push("artifact.component"):e.artifact.component!==s&&l.push("artifact.component")),void 0===e.artifact.configFingerprint||void 0===n?c.push("artifact.configFingerprint"):e.artifact.configFingerprint!==n&&l.push("artifact.configFingerprint"),void 0!==e.artifact.dataFingerprint&&o?e.artifact.dataFingerprint!==o&&l.push("artifact.dataFingerprint"):c.push("artifact.dataFingerprint"),{status:l.length>0?"mismatch":c.length>0?"unknown":"match",mismatchPaths:l,unknownPaths:c}}function Mo(e,t,r){let a=To(e,t,r);return{mismatchPaths:[...a.mismatchPaths,...void 0!==r&&a.unknownPaths.includes("artifact.component")?["artifact.component"]:[]]}}function Oo(e,t){return[.../* @__PURE__ */new Set([...Object.keys(e),...Object.keys(t)])].filter(r=>{if(Object.prototype.hasOwnProperty.call(e,r)!==Object.prototype.hasOwnProperty.call(t,r))return!0;let a=Kn(e[r]),i=Kn(t[r]);return a.excludedPaths.length>0||a.fingerprint!==i.fingerprint}).map(e=>`props.${e}`).sort()}function Fo(e){if(e.startsWith("props."))return e.slice(6).split(/[.[\]]/,1)[0]}function jo(e,t){let r=t.map(Fo).filter(e=>void 0!==e);return"artifact.dataFingerprint"===e?r.some(e=>Au.has(e)):"artifact.configFingerprint"===e&&r.some(e=>!Au.has(e))}function zo(e){if(!e||"object"!=typeof e)return!1;let t=e,r=t.serializedDataFingerprint;return"string"==typeof t.status&&Tu.has(t.status)&&Array.isArray(t.omittedPaths)&&t.omittedPaths.every(e=>"string"==typeof e)&&Array.isArray(t.warnings)&&t.warnings.every(e=>"string"==typeof e)&&(void 0===t.serializedConfigFingerprint||"string"==typeof t.serializedConfigFingerprint)&&(null==r||"string"==typeof r)&&(void 0===t.transferFingerprint||"string"==typeof t.transferFingerprint)}function Bo(e,t,r,a){return Kn({component:t,version:a.version,createdAt:a.createdAt,...void 0!==a.recipeId?{recipeId:a.recipeId}:{},...void 0!==a.portable?{portable:a.portable}:{},...void 0!==a.manifest?{manifest:a.manifest}:{},...void 0!==a.reason?{reason:a.reason}:{},...void 0!==a.warnings?{warnings:a.warnings}:{},...void 0!==a.selections?{selections:a.selections}:{},artifactContract:r,status:e.status,omittedPaths:e.omittedPaths,warnings:e.warnings,...void 0!==e.serializedConfigFingerprint?{serializedConfigFingerprint:e.serializedConfigFingerprint}:{},...Object.prototype.hasOwnProperty.call(e,"serializedDataFingerprint")?{serializedDataFingerprint:e.serializedDataFingerprint}:{}}).fingerprint}function Lo(e,t,r,a,i){let n=No(r),o={...e,serializedConfigFingerprint:Kn(Io(r)).fingerprint,serializedDataFingerprint:void 0===n?null:Kn(n).fingerprint};return{...o,transferFingerprint:Bo(o,t,a,i)}}function _o(e,t){let r=[],a=Kn(Io(t.props)).fingerprint,i=No(t.props),n=void 0===i?null:Kn(i).fingerprint;return void 0!==e.transferFingerprint&&e.transferFingerprint!==Bo(e,t.component,t.artifactContract,t)&&r.push("artifactTransfer.transferFingerprint"),void 0!==e.serializedConfigFingerprint&&e.serializedConfigFingerprint!==a&&r.push("artifactTransfer.serializedConfigFingerprint"),Object.prototype.hasOwnProperty.call(e,"serializedDataFingerprint")&&e.serializedDataFingerprint!==n&&r.push("artifactTransfer.serializedDataFingerprint"),r}function Do(e,t){if("artifactContract"===t||"$.artifactContract"===t)return void 0!==e.artifactContract;let r,a;if("props"===t||t.startsWith("props.")?(r=e,a=t):(r=e.artifactContract,a=t.startsWith("$.")?t.slice(2):t),"$"===a||""===a)return void 0!==r;let i=[...a.matchAll(/(?:^|\.)([^.[\]]+)|\[(\d+)\]/g)].map(e=>e[1]??Number(e[2]));if(0===i.length)return!1;for(let e of i){if(null===r||"object"!=typeof r||!Object.prototype.hasOwnProperty.call(r,e))return!1;r=r[e]}return!0}function Uo(e,t,r,a,i){if(!t)return{};let n=Po(t),o=i.recipeId??e,s=Mo(t,r,o),l=Oo(r,a),c=Mo(t,a,o);return s.mismatchPaths.length>0?{artifactContract:n.contract,artifactTransfer:Lo({status:"invalid",omittedPaths:s.mismatchPaths,warnings:["The artifact contract fingerprints do not match the supplied chart props or data."]},e,a,n.contract,i)}:l.length>0?{artifactContract:n.contract,artifactTransfer:Lo({status:"excluded",omittedPaths:l,warnings:["Chart props or data were excluded from the serialized configuration."]},e,a,n.contract,i)}:c.mismatchPaths.length>0?{artifactContract:n.contract,artifactTransfer:Lo({status:"invalid",omittedPaths:c.mismatchPaths,warnings:["Serialized chart props or data differ from the values bound to the artifact contract."]},e,a,n.contract,i)}:{artifactContract:n.contract,artifactTransfer:Lo(n.transfer,e,a,n.contract,i)}}function Vo(e){if(!e.artifactContract){if(!e.artifactTransfer)return{};if(zo(e.artifactTransfer)&&"excluded"===e.artifactTransfer.status&&e.artifactTransfer.omittedPaths.includes("artifactContract")){let t=e.artifactTransfer.omittedPaths.filter(t=>"artifactContract"!==t&&Do(e,t));return 0===t.length?{artifactTransfer:Mu(e.artifactTransfer)}:{artifactTransfer:{status:"invalid",omittedPaths:[...e.artifactTransfer.omittedPaths],warnings:[`The declared omitted path is still present: ${t.join(", ")}.`]}}}return{artifactTransfer:{status:"invalid",omittedPaths:["artifactContract"],warnings:["An artifact transfer report cannot claim preservation without an artifact contract."]}}}let t=ko(e.artifactContract),r=e.artifactTransfer,a=t.transfer,i=(()=>{if(!r)return{status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...a.omittedPaths,"artifactTransfer"])],warnings:[...a.warnings,"The artifact contract has no transfer report, so its transport history cannot be verified."]};if(!zo(r))return{status:"invalid",omittedPaths:a.omittedPaths,warnings:[...a.warnings,"The declared artifact transfer report is malformed."]};let t="excluded"===r.status||"unsupported-version"===r.status?r.omittedPaths.filter(t=>Do(e,t)):[];return t.length>0?{status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...r.omittedPaths,...a.omittedPaths])],warnings:[...a.warnings,`The declared omitted path is still present: ${t.join(", ")}.`]}:"preserved"===r.status&&r.omittedPaths.length>0||"excluded"===r.status&&0===r.omittedPaths.length?{status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...r.omittedPaths,...a.omittedPaths])],warnings:[...a.warnings,"The declared artifact transfer status contradicts its omitted paths."]}:r.status===a.status||"preserved"===a.status&&("excluded"===r.status||"invalid"===r.status)&&r.omittedPaths.length>0?Mu(r):{status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...r.omittedPaths,...a.omittedPaths])],warnings:[.../* @__PURE__ */new Set([...r.warnings,...a.warnings,`Declared artifact transfer status ${r.status} does not match the restored contract status ${a.status}.`])]}})();if(r&&zo(r)){let t=_o(r,e),a="invalid"!==r.status,n=[...a&&void 0===r.serializedConfigFingerprint?["artifactTransfer.serializedConfigFingerprint"]:[],...a&&!Object.prototype.hasOwnProperty.call(r,"serializedDataFingerprint")?["artifactTransfer.serializedDataFingerprint"]:[],...a&&void 0===r.transferFingerprint?["artifactTransfer.transferFingerprint"]:[]];(t.length>0||n.length>0)&&(i={status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...i.omittedPaths,...t,...n])],warnings:[.../* @__PURE__ */new Set([...i.warnings,t.length>0?"The serialized chart payload no longer matches its transfer fingerprints.":"The declared chart transfer cannot be verified without serialized transfer fingerprints."])]})}if("preserved"===t.transfer.status&&"0.1"===t.contract?.contractVersion){let r=Mo(t.contract,e.props,e.recipeId??e.component).mismatchPaths.filter(e=>!jo(e,i.omittedPaths));r.length>0&&(i={status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...i.omittedPaths,...r])],warnings:[.../* @__PURE__ */new Set([...i.warnings,"Restored chart props or data do not match the artifact contract fingerprints."])]})}return{...t.contract?{artifactContract:t.contract}:{},artifactTransfer:i}}function Go(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0})}function Ho(e,t){return!(!_n(e,t)||"areas"===e&&"string"==typeof t)}function qo(e,t,r){if(r?.selections&&Sr(r.selections).length>0)throw new TypeError("Serialized selection state must contain only values that survive JSON serialization unchanged.");let a=kr(e)??Nr(t.recipe)??Nr(t.recipeId);if(a)return Yo(a,t,r);if(!ye(e))throw new Error(`Unknown component "${e}". Known components: ${Ml.join(", ")}`);let i=!1!==r?.includeData,n={};for(let[e,r]of Object.entries(t))if(null!=r&&!Fu.has(e)&&(i||!Ho(e,r))&&"function"!=typeof r&&!(Sr(r).length>0))try{Go(n,e,ju(r))}catch{}let o=/* @__PURE__ */(new Date).toISOString(),s={version:Ou,createdAt:o,...r?.selections?{selections:r.selections}:{}};return{component:e,props:n,version:Ou,createdAt:o,...Uo(e,r?.artifactContract,t,n,s),...r?.selections?{selections:r.selections}:{}}}function Wo(e,t,r){let a={};for(let[i,n]of Object.entries(e))if(null!=n&&!Fu.has(i)&&"recipeId"!==i&&(t||!Ho(i,n))){if("function"==typeof n){if(r)throw new Error(`Portable recipe prop "${i}" is not JSON-safe.`);continue}if(Sr(n).length>0){if(r)throw new Error(`Portable recipe prop "${i}" is not JSON-safe.`);continue}Go(a,i,ju(n))}return a}function Yo(e,t,r){let a=!1!==r?.includeData,i=Sr(e);if("portable"===e.portability&&i.length>0)throw new Error(`Portable recipe "${e.id}" has non-JSON definition values at: ${i.join(", ")}.`);let n=Wo(t,a,"portable"===e.portability),o=e.intents.map(Ta).filter(e=>!!e),s=e.layout&&"object"==typeof e.layout&&"string"==typeof e.layout.id?e.layout.id:void 0,l=s?Pr(s):void 0,c=e.layout&&"object"==typeof e.layout&&"string"==typeof e.layout.version&&e.layout.version?{version:e.layout.version,...e.layout.fingerprint?{fingerprint:e.layout.fingerprint}:{}}:void 0;if(l&&c&&(l.version!==c.version||l.fingerprint!==c.fingerprint))throw new Error(`Recipe layout "${s}" registry identity does not match its portable declaration.`);let u=l??c;if("portable"===e.portability&&s&&!u)throw new Error(`Portable recipe layout "${s}" must be registered with an explicit version identity.`);let d={name:e.name,intents:o,...e.audience?.primary?{audience:[e.audience.primary]}:{},frameFamily:e.frameFamily,...e.version?{recipeVersion:e.version}:{},...0===i.length?{definitionFingerprint:Kn(e).fingerprint}:{},...s?{layoutId:s}:{},...u?{layoutVersion:u.version}:{},...u?.fingerprint?{layoutFingerprint:u.fingerprint}:{}},h=/* @__PURE__ */(new Date).toISOString();if("portable"===e.portability){if(Sr(n).length>0)throw new Error(`Portable recipe "${e.id}" contains non-JSON-safe props or layoutConfig.`);let a={version:Ou,createdAt:h,recipeId:e.id,portable:!0,manifest:d,...r?.selections?{selections:r.selections}:{}};return{component:"ChartRecipe",recipeId:e.id,portable:!0,props:n,manifest:d,version:Ou,createdAt:h,...Uo("ChartRecipe",r?.artifactContract,t,n,a),...r?.selections?{selections:r.selections}:{}}}let p="Recipe contains or may depend on non-serializable local layout callbacks.",f=["This config is inspectable but cannot be rendered remotely by CLI or MCP."],m={version:Ou,createdAt:h,recipeId:e.id,portable:!1,manifest:d,reason:p,warnings:f,...r?.selections?{selections:r.selections}:{}};return{component:"ChartRecipe",recipeId:e.id,portable:!1,reason:p,warnings:f,props:n,manifest:d,version:Ou,createdAt:h,...Uo("ChartRecipe",r?.artifactContract,t,n,m),...r?.selections?{selections:r.selections}:{}}}function Ko(e){try{if(!e||"object"!=typeof e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}catch{return!1}}function Jo(e){if(!Ko(e))throw new Error("Invalid chart config: expected a plain object");let t=Sr(e);if(t.length>0)throw new TypeError(`Chart config contains values that cannot survive JSON serialization at: ${t.join(", ")}.`);if(e.version!==Ou)throw new Error(`Unsupported chart config version ${String(e.version)}; expected ${Ou}.`);if("string"!=typeof e.component||!e.component.trim())throw new Error("Invalid chart config: missing component");if(!Ko(e.props))throw new Error("Invalid chart config: props must be a plain object");if("string"!=typeof e.createdAt||!Number.isFinite(Date.parse(e.createdAt)))throw new Error("Invalid chart config: createdAt must be a valid timestamp");if(void 0!==e.recipeId&&("string"!=typeof e.recipeId||!e.recipeId.trim()))throw new Error("Invalid chart config: recipeId must be a non-empty string");if(void 0!==e.portable&&"boolean"!=typeof e.portable)throw new Error("Invalid chart config: portable must be a boolean");if(void 0!==e.selections&&!Ko(e.selections))throw new Error("Invalid chart config: selections must be a plain object");if(void 0!==e.manifest){if(!Ko(e.manifest))throw new Error("Invalid chart config: manifest must be a plain object");if("string"!=typeof e.manifest.name||!e.manifest.name.trim()||"string"!=typeof e.manifest.frameFamily||!e.manifest.frameFamily.trim()||!Array.isArray(e.manifest.intents)||e.manifest.intents.some(e=>"string"!=typeof e||!e.trim())||void 0!==e.manifest.audience&&(!Array.isArray(e.manifest.audience)||e.manifest.audience.some(e=>"string"!=typeof e||!e.trim()))||void 0!==e.manifest.recipeVersion&&("string"!=typeof e.manifest.recipeVersion||!e.manifest.recipeVersion.trim())||void 0!==e.manifest.definitionFingerprint&&("string"!=typeof e.manifest.definitionFingerprint||!e.manifest.definitionFingerprint.trim())||void 0!==e.manifest.layoutId&&("string"!=typeof e.manifest.layoutId||!e.manifest.layoutId.trim())||void 0!==e.manifest.layoutVersion&&("string"!=typeof e.manifest.layoutVersion||!e.manifest.layoutVersion.trim())||void 0!==e.manifest.layoutFingerprint&&("string"!=typeof e.manifest.layoutFingerprint||!e.manifest.layoutFingerprint.trim())||void 0!==e.manifest.layoutVersion&&void 0===e.manifest.layoutId||void 0!==e.manifest.layoutFingerprint&&void 0===e.manifest.layoutVersion)throw new Error("Invalid chart config: malformed recipe manifest")}}function Xo(e){if(Jo(e),"ChartRecipe"===e.component||"LocalChartRecipe"===e.component){if(!e.recipeId)throw new Error("Invalid chart recipe config: missing recipeId");let t=kr(e.recipeId);if(!t)throw new Error(`Unknown chart recipe "${e.recipeId}". Register it before deserializing this config.`);if(e.manifest?.definitionFingerprint&&e.manifest.definitionFingerprint!==Kn(t).fingerprint)throw new Error(`Chart recipe "${e.recipeId}" no longer matches the serialized definition.`);if(void 0!==e.manifest?.recipeVersion&&e.manifest.recipeVersion!==t.version)throw new Error(`Chart recipe "${e.recipeId}" version does not match the serialized config.`);if(e.manifest?.layoutVersion){let r=e.manifest.layoutId,a=r?Rr(r):void 0,i=r?Pr(r):void 0,n=t.layout&&"object"==typeof t.layout&&t.layout.id===r&&t.layout.version?{version:t.layout.version,fingerprint:t.layout.fingerprint}:void 0,o=a?i:i??n;if(!o||o.version!==e.manifest.layoutVersion||o.fingerprint!==e.manifest.layoutFingerprint)throw new Error(`Chart recipe "${e.recipeId}" layout implementation no longer matches the serialized config.`)}if("LocalChartRecipe"!==e.component&&!1!==e.portable&&"portable"!==t.portability)throw new Error(`Chart recipe "${e.recipeId}" is registered as local, not portable.`);return{componentName:"ChartRecipe",props:{...ju(e.props),recipeId:e.recipeId},...Vo(e)}}if(!ye(e.component))throw new Error(`Unknown component "${e.component}". This config may require a newer version of semiotic.`);return{componentName:e.component,props:ju(e.props),...Vo(e)}}function Zo(e,t={}){Jo(e);let r=JSON.stringify(e),a=`sc=${btoa(unescape(encodeURIComponent(r))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}`;if(void 0!==t.maxLength&&a.length>Math.max(0,Math.floor(t.maxLength)))throw new RangeError(`Serialized chart config is ${a.length} characters; the declared URL limit is ${t.maxLength}. Use a file or sidecar export instead.`);return a}function Qo(e){let t=new URLSearchParams(e.includes("?")?e.split("?")[1]:e).get("sc");if(!t)throw new Error("No chart config found in URL (missing 'sc' parameter)");let r=t.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(escape(atob(r))),i=JSON.parse(a);return Jo(i),i}async function es(e,t="json"){let r="jsx"===t?ts(e):JSON.stringify(e,null,2);if(!(typeof navigator<"u"&&navigator.clipboard))throw new Error("Clipboard API not available. copyConfig requires a browser environment.");await navigator.clipboard.writeText(r)}function ts(e){Jo(e);let{props:t}=e,r="LocalChartRecipe"===e.component?"ChartRecipe":e.component;if("ChartRecipe"!==r&&!ye(r))throw new Error(`Cannot project unknown component "${r}" to JSX.`);let a=[`<${r}`];e.recipeId&&a.push(` recipeId={${as(e.recipeId)}}`);for(let[e,r]of Object.entries(t)){if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(e)){let t={};Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),a.push(` {...${as(t)}}`);continue}if("string"==typeof r)a.push(rs(r)?` ${e}="${r}"`:` ${e}={${as(r)}}`);else if("boolean"==typeof r&&!0===r)a.push(` ${e}`);else if("boolean"==typeof r&&!1===r)a.push(` ${e}={false}`);else if("number"==typeof r)a.push(` ${e}={${r}}`);else{let t=as(r);t.length<80?a.push(` ${e}={${t}}`):a.push(` ${e}={${as(r,2)}}`)}}return a.push("/>"),a.join("\n")}function rs(e){return!/["&<>{}\r\n\u2028\u2029]/.test(e)}function as(e,t){return JSON.stringify(e,null,t).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function is(e){let t=[...e.artifactContract?["artifactContract"]:[],...e.artifactTransfer?["artifactTransfer"]:[],...e.selections?["selections"]:[]];return{jsx:ts(e),omittedPaths:t,warnings:t.length?["JSX represents the chart props only. Preserve the reported top-level fields as a separate artifact packet."]:[]}}function ns(e){let t=/* @__PURE__ */Object.create(null);for(let[r,a]of e){let e=[];for(let[,t]of a.clauses){let r=/* @__PURE__ */Object.create(null);for(let[e,a]of Object.entries(t.fields))"point"===a.type?r[e]={type:"point",values:Array.from(a.values)}:r[e]={type:"interval",range:a.range};e.push({clientId:t.clientId,type:t.type,fields:r})}t[r]={name:a.name,resolution:a.resolution,clauses:e}}return t}function os(e){let t=/* @__PURE__ */new Map;for(let[r,a]of Object.entries(e)){let e=/* @__PURE__ */new Map;for(let t of a.clauses){let r=/* @__PURE__ */Object.create(null);for(let[e,a]of Object.entries(t.fields))"point"===a.type?r[e]={type:"point",values:new Set(a.values)}:r[e]={type:"interval",range:a.range};e.set(t.clientId,{clientId:t.clientId,type:t.type,fields:r})}t.set(r,{name:a.name,resolution:a.resolution,clauses:e})}return t}async function ss(e,t){let{format:r="png",filename:a="chart",scale:i=2,background:n="white"}=t||{},o=e.querySelector('svg[role="img"]')||e.querySelector("svg");if(!o)throw new Error("No SVG element found in the container");let s=o.cloneNode(!0),l=o.getBoundingClientRect();if(s.getAttribute("width")||s.setAttribute("width",String(l.width)),s.getAttribute("height")||s.setAttribute("height",String(l.height)),s.getAttribute("xmlns")||s.setAttribute("xmlns","http://www.w3.org/2000/svg"),ls(o,s),"svg"===r){let e=(new XMLSerializer).serializeToString(s);cs(new Blob([e],{type:"image/svg+xml;charset=utf-8"}),`${a}.svg`)}else{let t=l.width*i,r=l.height*i,o=document.createElement("canvas");o.width=t,o.height=r;let c=o.getContext("2d");c.fillStyle=n,c.fillRect(0,0,t,r),c.scale(i,i);let u=e.querySelector("canvas");u&&c.drawImage(u,0,0,l.width,l.height);let d=(new XMLSerializer).serializeToString(s),h=new Blob([d],{type:"image/svg+xml;charset=utf-8"}),p=URL.createObjectURL(h),f=new Image;f.width=l.width,f.height=l.height,await new Promise((e,t)=>{f.onload=()=>{c.drawImage(f,0,0),o.toBlob(r=>{r?(cs(r,`${a}.png`),e()):t(new Error("Failed to create PNG blob"))},"image/png"),URL.revokeObjectURL(p)},f.onerror=()=>{URL.revokeObjectURL(p),t(new Error("Failed to load SVG image"))},f.src=p})}}function ls(e,t){let r=e.children,a=t.children,i=window.getComputedStyle(e),n=["fill","stroke","stroke-width","stroke-dasharray","opacity","fill-opacity","stroke-opacity","font-family","font-size","font-weight","text-anchor","dominant-baseline"];for(let e of n){let r=i.getPropertyValue(e);r&&"none"!==r&&""!==r&&t.style?.setProperty(e,r)}for(let e=0;e<Math.min(r.length,a.length);e++)ls(r[e],a[e])}function cs(e,t){let r=URL.createObjectURL(e),a=document.createElement("a");a.href=r,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(r)}function us(e){let t={};if(null==e||"object"!=typeof e)return t;for(let[r,a]of Object.entries(e))r.startsWith("_")||null==a||""===a||("number"==typeof a?Number.isFinite(a)&&(t[r]=a):"string"==typeof a?t[r]=a:"boolean"==typeof a?t[r]=String(a):a instanceof Date&&(t[r]=a.toISOString().slice(0,10)));return t}function ds(e){return e&&"object"==typeof e?e:{}}function hs(e){return ds(e.accessibility).tableFields??e.accessibleDatum??e.datum}function ps(e){let t=/* @__PURE__ */new Set;if(!e.some(e=>e&&("point"===e.type||"symbol"===e.type||"glyph"===e.type)))return t;for(let r of e)if(r&&["line","area","boxplot","violin"].includes(String(r.type))&&Array.isArray(r.datum))for(let e of r.datum)t.add(e);return t}function fs(e){let t=[];if(!Array.isArray(e))return t;let r=ps(e);for(let a of e)if(a&&"object"==typeof a&&null!==a.datum)try{switch(a.type){case"point":case"symbol":case"glyph":if(r.has(a.datum))break;t.push({label:"Point",values:us(hs(a))});break;case"line":case"area":{let e=hs(a),r=Array.isArray(e)?e:null!=e&&"object"==typeof e?[e]:[],i="line"===a.type?"Line point":"Area point";for(let e of r)t.push({label:i,values:us(e)});break}case"boxplot":case"violin":{let e=hs(a),r="boxplot"===a.type?"Boxplot":"Distribution",i="string"==typeof a.category?{category:a.category}:{};if(Array.isArray(e)){t.push({label:r,values:{...i,...us(a.stats)}});for(let a of e)t.push({label:`${r} observation`,values:{...i,...us(a)}})}else t.push({label:r,values:{...i,...us(e)}});break}case"rect":{let e=hs(a),r=null!=e&&"object"==typeof e?e:{},i=r.category??a.group??"",n=r.value??r.__aggregateValue??r.total,o=us(r);null==o.category&&""!==i&&(o.category=String(i)),null==o.value&&null!=n&&(o.value="number"==typeof n||"string"==typeof n?n:String(n)),t.push({label:"Bar",values:o});break}case"heatcell":{let e=us(hs(a));null==e.value&&"number"==typeof a.value&&Number.isFinite(a.value)&&(e.value=a.value),t.push({label:"Cell",values:e});break}case"wedge":{let e=hs(a),r=us(e);if(null==r.category){let t=ds(e),a=t.category??t.label;null!=a&&(r.category=String(a))}t.push({label:"Wedge",values:r});break}case"circle":t.push({label:"Node",values:us(hs(a))});break;case"arc":t.push({label:"Arc",values:us(hs(a))});break;case"candlestick":t.push({label:"Candlestick",values:us(hs(a))});break;case"connector":case"trapezoid":case"bezier":case"ribbon":case"curved":t.push({label:"Connection",values:us(hs(a))});break;case"geoarea":{let e=ds(hs(a)),r=us(e);if(null==r.name){let t=ds(e.properties).name??e.name;null!=t&&(r.name=String(t))}t.push({label:"Region",values:r});break}}}catch{}return t}function ms(e){if(Array.isArray(e))return e;if(!e||"object"!=typeof e)return[];let t=e;return[...t.nodes??t.sceneNodes??[],...t.sceneEdges??[]]}function gs(e){let t=e.pointId??e.id??e._transitionKey;return null==t||""===t?void 0:String(t)}function ys(e){return e.accessibility?.tableFields??e.accessibleDatum??e.datum??null}function bs(e){return"number"==typeof e&&Number.isFinite(e)}function vs(e){if(bs(e.x)&&bs(e.y)&&bs(e.w)&&bs(e.h))return{x0:e.x,y0:e.y,x1:e.x+e.w,y1:e.y+e.h};if(bs(e.x)&&bs(e.y)&&bs(e.r))return{x0:e.x-e.r,y0:e.y-e.r,x1:e.x+e.r,y1:e.y+e.r};if(bs(e.cx)&&bs(e.cy)&&bs(e.r))return{x0:e.cx-e.r,y0:e.cy-e.r,x1:e.cx+e.r,y1:e.cy+e.r};if(bs(e.cx)&&bs(e.cy)&&bs(e.outerR))return{x0:e.cx-e.outerR,y0:e.cy-e.outerR,x1:e.cx+e.outerR,y1:e.cy+e.outerR};let t=[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat().filter(e=>Array.isArray(e)&&bs(e[0])&&bs(e[1]));return t.length>0?{x0:Math.min(...t.map(e=>e[0])),y0:Math.min(...t.map(e=>e[1])),x1:Math.max(...t.map(e=>e[0])),y1:Math.max(...t.map(e=>e[1]))}:null}function ws(e){return[...[e.x,e.y,e.w,e.h,e.r,e.cx,e.cy,e.innerR,e.outerR,e.x1,e.x2,e.y1,e.y2,e.openY,e.closeY,e.highY,e.lowY,e.bodyWidth].filter(e=>void 0!==e),...[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat(2)]}function As(e,t){let r=Math.max(0,Math.min(e.x1,t.x1)-Math.max(e.x0,t.x0))*Math.max(0,Math.min(e.y1,t.y1)-Math.max(e.y0,t.y0)),a=Math.max(0,e.x1-e.x0)*Math.max(0,e.y1-e.y0),i=Math.max(0,t.x1-t.x0)*Math.max(0,t.y1-t.y0),n=Math.min(a,i);return n>0?r/n:0}function $s(e,t,r,a,i){if(e===t)return!0;let n=r.dataRoles.map(e=>ja(e,a,i)).filter(e=>!!e).filter(r=>null!=e[r]&&null!=t[r]);return n.length>0&&n.every(r=>String(e[r])===String(t[r]))}function xs(e,t,r,a,i,n="warn",o){return{id:e,category:t,status:r?"pass":n,message:r?a:i,...o?{evidence:o}:{}}}function Ss(e){let{recipe:t}=e,r=ms(e.scene),a=e.layoutConfig??Ma({layoutConfig:e.layoutConfig}),i=e.dimensions.plot??{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},n=i.x??0,o=i.y??0,s=[],l=r.filter(e=>null!=ys(e)),c=r.filter(e=>!("string"!=typeof e.pathD||!/NaN|Infinity|undefined/.test(e.pathD))||ws(e).some(e=>"number"!=typeof e||!Number.isFinite(e)));s.push(xs("geometry.finite","geometry",0===c.length,"All emitted geometry is finite.",`${c.length} marks contain non-finite geometry.`,"fail",{count:c.length}));let u=r.map(vs),d=u.filter(e=>e&&(e.x1<=e.x0||e.y1<=e.y0)).length;s.push(xs("geometry.nonzero-area","geometry",0===d,"All bounded marks have positive area.",`${d} marks have zero or negative area.`,"warn",{count:d}));let h=u.filter(e=>e&&(e.x0<n||e.y0<o||e.x1>n+i.width||e.y1>o+i.height)).length;s.push(xs("geometry.bounds","geometry",0===h,"All bounded marks stay inside the plot.",`${h} marks extend outside the plot bounds.`,"warn",{count:h}));let p=t.audit?.minimumHitTargetSize??t.accessibility.minimumHitTarget??24,m=u.filter(e=>!!e&&(e.x1-e.x0<p||e.y1-e.y0<p)).length;s.push(xs("interaction.target-size","interaction",0===m,`All bounded targets meet the declared ${p}px minimum.`,`${m} targets are smaller than ${p}px in at least one dimension.`,"warn",{count:m,minimumTarget:p}));let g=l.map(gs),y=g.filter(e=>!e).length,b=/* @__PURE__ */new Set,v=g.filter(e=>!(!e||!b.has(e)&&(b.add(e),1)));s.push(xs("identity.stable-ids","identity",0===y,"Every data-bearing mark exposes a stable id.",`${y} data-bearing marks have no pointId, id, or transition key.`,t.audit?.requireStableIds?"fail":"warn",{missing:y})),s.push(xs("identity.unique-ids","identity",0===v.length,"Stable mark ids are unique.",`${v.length} duplicate stable ids were observed.`,"fail",{duplicates:[...new Set(v)].slice(0,10)}));let w=g.filter(e=>e&&/^(datum|mark|node|point|rect)-?\d+$/.test(e)).length;w>0&&s.push({id:"identity.index-pattern",category:"identity",status:"warn",message:`${w} ids look index-derived and may change when data is reordered.`,remediation:"Derive ids from a declared identifier role or stable domain key."});let A=/* @__PURE__ */new Set,$=0,x=e.inputData;for(let e of l){let r=ys(e),i=Array.isArray(r)?r:[r],n=!1;for(let e of i)if(e&&"object"==typeof e)for(let r=0;r<x.length;r+=1)$s(e,x[r],t,a,x)&&(A.add(r),n=!0);n||($+=1)}let S=Math.max(0,x.length-A.size);s.push(xs("coverage.input-data","coverage",0===S,"Every input datum is represented by the observed scene.",`${S} input data items have no matching scene mark.`,t.audit?.requireDatumCoverage?"fail":"warn",{represented:A.size,input:x.length})),s.push(xs("coverage.scene-data","coverage",0===$,"Every data-bearing scene mark maps back to input data.",`${$} scene marks do not map back to an input datum.`,"warn",{count:$})),!t.encodings?.some(e=>"count"===e.channel)&&l.length>A.size&&A.size>0&&s.push({id:"coverage.duplicate-references",category:"coverage",status:"warn",message:"Input data is referenced by multiple marks, but multiplicity is not declared as an encoding.",remediation:"Declare count/repetition semantics or preserve a one-to-one datum-to-mark mapping."});let C=l.filter(e=>!1===e.interactive).length;s.push(xs("interaction.hit-targets","interaction",0===C&&l.length>0,"Every observed data-bearing scene node participates in hit testing.",0===l.length?"No data-bearing scene nodes were emitted for interaction.":`${C} data-bearing marks explicitly disable interaction.`,"fail"));let k=(e.annotations??[]).map(e=>e.pointId).filter(e=>null!=e).map(String),R=k.filter(e=>!b.has(e));s.push(xs("coverage.annotation-anchors","coverage",0===R.length,k.length?"All pointId annotation anchors resolve to observed scene nodes.":"No pointId annotations require scene resolution.",`${R.length} annotations point to missing scene ids.`,"fail",{unresolved:R}));let P=(e.chart?.selectedIds??[]).filter(e=>!b.has(e));e.chart?.selectedIds&&s.push(xs("interaction.selection-reachability","interaction",0===P.length,"Selected/highlighted states resolve to observed marks.",`${P.length} selected ids are not reachable in the scene.`,"fail",{missing:P}));let N=fs(r),E=(t.accessibility.tableFields??t.accessibility.tableRoles?.map(e=>({role:e,label:e}))??[]).map(e=>{if(e.field)return e.field;let r=e.role?t.dataRoles.find(t=>t.role===e.role):void 0;return r?ja(r,a,x):void 0}).filter(e=>!!e),I=new Set(N.flatMap(e=>Object.keys(e.values))),T=E.filter(e=>!I.has(e));s.push(xs("accessibility.table-fields","accessibility",0===T.length,E.length?"The accessible table preserves all recipe-declared fields.":"The recipe declares no explicit accessible table field projection.",`The accessible table loses declared fields: ${T.join(", ")}.`,"fail",{expectedFields:E,observedFields:[...I]})),new Set(x.flatMap(e=>Object.entries(e).filter(([,e])=>["string","number","boolean"].includes(typeof e)).map(([e])=>e))).size>2&&I.size<=2&&[...I].every(e=>"category"===e||"value"===e)&&s.push({id:"accessibility.generic-table-loss",category:"accessibility",status:"warn",message:"The table exposes only generic category/value fields although richer input data exists.",remediation:"Emit accessibleDatum or accessibility.tableFields on scene nodes."});let M=(t.encodings?.filter(e=>"color"===e.channel)??[]).filter(e=>!e.redundantWith||0===e.redundantWith.length);s.push(xs("accessibility.color-only","accessibility",0===M.length,"Every declared color encoding names a redundant cue.",`${M.length} color encodings have no declared redundant cue.`,"warn"));let O=e.chart;if(O){for(let[e,r]of[["title",t.accessibility.requiresTitle],["summary",t.accessibility.requiresSummary],["description","required"===t.accessibility.description]])r&&s.push(xs(`accessibility.${e}`,"accessibility","string"==typeof O[e]&&O[e].trim().length>0,`A chart ${e} is present.`,`The recipe requires a chart ${e}, but none was supplied.`,"fail"));(t.accessibility.requiresAccessibleTable||"required"===t.accessibility.accessibleTable||t.accessibility.fallbackTable)&&s.push(xs("accessibility.fallback-table","accessibility",!1!==O.accessibleTable,"The accessible fallback table is enabled.","The recipe requires a fallback table, but accessibleTable is disabled.","fail")),O.navigationTree&&s.push(xs("accessibility.navigation-depth","accessibility",(O.navigationTree.children?.length??0)>0,"The navigation tree exposes structure below the root.","The navigation tree is root-only.","fail"))}let F=e.theme?.background??"#ffffff",j=r.filter(e=>{let t=e.style?.fill??e.fill;if("string"!=typeof t||!t.startsWith("#")||!F.startsWith("#"))return!1;let r=f(t,F);return null!=r&&r<3}).length;s.push(xs("visual.contrast","visual",0===j,"All statically checkable mark fills meet 3:1 contrast.",`${j} marks have fill contrast below 3:1.`,"warn",{background:F}));let z=0,B=u.filter(e=>!!e).slice(0,500);for(let e=0;e<B.length;e+=1)for(let t=e+1;t<B.length;t+=1)As(B[e],B[t])>=.8&&(z+=1);z>B.length&&s.push({id:"visual.overlap-density",category:"visual",status:"warn",message:`${z} near-total mark overlaps suggest occlusion or excessive density.`,remediation:"Aggregate, jitter, layer explicitly, or declare overlap as intentional."});let L=[["manual-at.screen-reader","Verify real screen-reader behavior with the target browser/AT combinations."],["manual-at.cognitive-load","Assess cognitive load and whether the custom metaphor is understood."],["manual-at.keyboard-order","Verify that keyboard order is meaningful, not merely mechanically available."],["manual-at.animation","Verify that animation is not distracting and reduced-motion behavior is sufficient."],["manual-at.reception","Test whether the memorable form is received as intended by the target audience."],["manual-at.overlay-occlusion","Inspect labels, overlays, annotations, and important marks for clipping or occlusion."],["manual-at.observation","Exercise hover, focus, selection, and observation emission in the rendered chart."]].map(([e,t])=>({id:e,category:"manual-at",status:"manual",message:t})),_={dataRoles:t.dataRoles.map(e=>e.role),intents:t.intents.map(Ta).filter(e=>!!e),accessibilityExpectations:[...t.accessibility.requirements??[],...t.accessibility.tableFields?.map(e=>`table field: ${e.label}`)??[]],fallbackDeclared:!0===t.accessibility.fallbackTable||"required"===t.accessibility.accessibleTable||!0===t.accessibility.requiresAccessibleTable,designContractDeclared:!!t.designContract?.whyCustom},D=[...s,...L],U=s.filter(e=>"fail"===e.status).length;return{recipeId:t.id,ok:0===U,summary:{marks:r.length,passes:D.filter(e=>"pass"===e.status).length,warnings:D.filter(e=>"warn"===e.status).length,failures:U,manual:D.filter(e=>"manual"===e.status).length},declaredSemantics:_,observedSceneEvidence:s,manualATChecks:L}}function Cs(e){switch(e){case"sum":case"mean":case"count":case"min":case"max":return e;case"average":return"mean";default:return}}function ks(e){let t="value",r=0;for(;e.has(t);)t="value_"+ ++r;return t}function Rs(e,t,r){if(!Array.isArray(e))throw new TypeError("aggregate data must be an array of rows");if(t.some(e=>"string"!=typeof e||0===e.length))throw new TypeError("groupBy must contain nonempty field names");let a=[...new Set(t)],i=new Set(a);for(let e of r){if(Cs(e.operation)!==e.operation||!e.operation)throw new TypeError("Unsupported aggregate operation");if("string"!=typeof e.outputField||!e.outputField||i.has(e.outputField))throw new TypeError("outputField must be a nonempty field distinct from groupBy and other aggregate outputs");if("count"!==e.operation&&("string"!=typeof e.field||!e.field))throw new TypeError("A value field is required for this aggregate");i.add(e.outputField)}let n={},o=[];for(let t=0;t<e.length;t++){let i=e[t];if(!i||"object"!=typeof i||Array.isArray(i))throw new TypeError(`aggregate data row ${t} must be an object`);let s=n;for(let e of a){let t=i[e],r=t instanceof Date?s.dates??(s.dates=/* @__PURE__ */new Map):s.values??(s.values=/* @__PURE__ */new Map),a=t instanceof Date?t.getTime():t,n=r.get(a);n||(n={},r.set(a,n)),s=n}s.group||(s.group={keys:Object.fromEntries(a.map(e=>[e,i[e]])),count:0,measures:r.map(()=>({total:0,count:0}))},o.push(s.group));let l=s.group;l.count++;for(let e=0;e<r.length;e++){let t=r[e];if("count"===t.operation)continue;let a=bt(i[t.field]);if(void 0===a||!Number.isFinite(a))continue;let n=l.measures[e];"min"===t.operation||"max"===t.operation?(!n.count||("min"===t.operation?a<n.total:a>n.total))&&(n.total=a):n.total+=a,n.count++}}return o.map(e=>Object.fromEntries([...Object.entries(e.keys),...r.map((t,r)=>{let a=e.measures[r],i="count"===t.operation?e.count:a.count?"mean"===t.operation?a.total/a.count:a.total:null;return[t.outputField,i]})]))}function Ps(e){let t=e.encoding??{},r=[];if(Object.values(t).some(e=>void 0!==e.aggregate)&&void 0!==e.data?.values){let t=e.data.values;(!Array.isArray(t)||t.some(e=>!e||"object"!=typeof e||Array.isArray(e)))&&r.push({code:"INVALID_AGGREGATE_DATA",severity:"error",path:"/data/values",message:"Aggregation requires data.values to be an array of row objects."})}for(let[a,i]of Object.entries(t)){if(void 0===i.aggregate)continue;let n,o=Cs(i.aggregate),s="UNSUPPORTED_AGGREGATE";o?(t.x?.bin||t.y?.bin)&&"count"!==o?n=`Binned aggregate "${i.aggregate}" on ${a} is not supported; Histogram counts source rows.`:"count"===o||i.field?e.data?.values||(s="INVALID_AGGREGATE",n=`aggregate: "${i.aggregate}" on ${a} requires inline data.values; accessors remain unchanged.`):(s="INVALID_AGGREGATE",n=`aggregate: "${i.aggregate}" on ${a} requires an encoded value field.`):n=`Unsupported aggregate "${i.aggregate}" on ${a}; data was not aggregated.`,n&&r.push({code:s,severity:"error",path:`/encoding/${a}/aggregate`,message:n})}return r}function Ns(e,t){let r=e.encoding??{},a=e.data?.values,i=Ps(e);if(t.push(...i.map(({message:e})=>e)),!a||i.length||r.x?.bin||r.y?.bin)return{data:a,encoding:r};let n=new Set(Object.values(r).filter(e=>void 0===e.aggregate&&e.field).map(e=>e.field)),o=new Set(n),s=[],l={...r};for(let[e,t]of Object.entries(r)){let r=Cs(t.aggregate);if(!r)continue;let a=ks(o);o.add(a),s.push({field:t.field,operation:r,outputField:a}),l[e]={...t,field:a,aggregate:void 0}}return s.length?{data:Rs(a,[...n],s),encoding:l}:{data:a,encoding:r}}function Es(e){if(!e)return{type:"",markProps:{}};if("string"==typeof e)return{type:e,markProps:{}};let{type:t,...r}=e;return{type:t,markProps:r}}function Is(e){if(e)return"string"==typeof e?e:e.text}function Ts(e){return"nominal"===e||"ordinal"===e}function Ms(e){return"quantitative"===e||"temporal"===e}function Os(e){return e.usermeta?.idid}function Fs(e){return"annotation-layer"===e.usermeta?.idid?.role}function js(e){if(!Os(e)||!Array.isArray(e.layer))return e;let t=e.layer.filter(e=>!Fs(e));if(1!==t.length)return e;let{layer:r,...a}=e,{usermeta:i,...n}=t[0];return{...a,...n}}function zs(e){e=js(e);let t=[],{type:r,markProps:a}=Es(e.mark),{data:i,encoding:n}=Ns(e,t),o=n.x,s=n.y,l=n.color,c=n.size,u=n.theta,d=n.opacity;!i&&e.data?.url&&t.push("data.url is not supported — only inline data.values can be translated. Provide data manually."),e.transform&&e.transform.length>0&&t.push("Vega-Lite transforms are not supported. Pre-transform your data before passing to fromVegaLite()."),e.layer&&t.push('Layered specs ("layer") are not supported. Only single-mark specs can be translated.'),(e.hconcat||e.vconcat||e.concat)&&t.push('Concatenated views ("hconcat"/"vconcat"/"concat") are not supported. Translate each sub-spec individually.'),(e.facet||n.facet||n.row||n.column)&&t.push("Faceted views are not supported. Use Semiotic's LinkedCharts or render multiple charts manually."),e.repeat&&t.push('Repeated views ("repeat") are not supported. Translate each field combination individually.'),(e.params||e.selection)&&t.push("Selections/params are not supported. Use Semiotic's LinkedCharts and selection props for interactivity.");let h={};e.width&&(h.width=e.width),e.height&&(h.height=e.height);let p,f=Is(e.title);if(f&&(h.title=f),l?.field&&(h.colorBy=l.field,l.scale?.scheme)){let e=zu[l.scale.scheme];e&&(h.colorScheme=e)}if(void 0!==d?.value&&(h.pointOpacity=d.value),o?.bin||s?.bin){let e="Histogram";i&&(h.data=i),o?.bin?(h.valueAccessor=o.field,o.axis?.title&&(h.valueLabel=o.axis.title)):s?.bin&&(h.valueAccessor=s.field,s.axis?.title&&(h.valueLabel=s.axis.title)),l?.field&&(h.categoryAccessor=l.field);let r=o?.bin||s?.bin,a="object"==typeof r?r.maxbins:void 0;return a&&(h.bins=a),_s(e,h,t)}switch(r){case"bar":p=Bs(o,s,l,h,i);break;case"line":if(p="LineChart",Ls(o,s,h),l?.field&&(h.lineBy=l.field),a.interpolate){let e=Bu[a.interpolate];e&&(h.curve=e)}!0===a.point&&(h.showPoints=!0),i&&(h.data=i);break;case"area":if(l?.field?(p="StackedAreaChart",h.areaBy=l.field):p="AreaChart",Ls(o,s,h),a.interpolate){let e=Bu[a.interpolate];e&&(h.curve=e)}void 0!==a.opacity&&(h.areaOpacity=a.opacity),i&&(h.data=i);break;case"point":case"circle":case"square":c?.field?(p="BubbleChart",h.sizeBy=c.field,c.scale?.range&&(h.sizeRange=c.scale.range)):p="Scatterplot",Ls(o,s,h),i&&(h.data=i);break;case"rect":p="Heatmap",o?.field&&(h.xAccessor=o.field),s?.field&&(h.yAccessor=s.field),l?.field&&(h.valueAccessor=l.field,delete h.colorBy),o?.axis?.title&&(h.xLabel=o.axis.title),s?.axis?.title&&(h.yLabel=s.axis.title),i&&(h.data=i);break;case"arc":a.innerRadius&&a.innerRadius>0?(p="DonutChart",h.innerRadius=a.innerRadius):p="PieChart",u?.field?h.valueAccessor=u.field:s?.field&&(h.valueAccessor=s.field),l?.field&&(h.categoryAccessor=l.field),o?.field&&!u?.field&&(h.categoryAccessor=o.field),i&&(h.data=i);break;case"tick":p="DotPlot",Ts(o?.type)?(h.categoryAccessor=o.field,s?.field&&(h.valueAccessor=s.field),o?.axis?.title&&(h.categoryLabel=o.axis.title),s?.axis?.title&&(h.valueLabel=s.axis.title)):Ts(s?.type)?(h.categoryAccessor=s.field,o?.field&&(h.valueAccessor=o.field),h.orientation="horizontal",s?.axis?.title&&(h.categoryLabel=s.axis.title),o?.axis?.title&&(h.valueLabel=o.axis.title)):(o?.field&&(h.categoryAccessor=o.field),s?.field&&(h.valueAccessor=s.field)),i&&(h.data=i);break;default:t.push(`Unsupported mark type "${r}". Defaulting to Scatterplot.`),p="Scatterplot",Ls(o,s,h),i&&(h.data=i)}return _s(p,h,t)}function Bs(e,t,r,a,i){let n;return r?.field&&!1!==e?.stack&&!1!==t?.stack&&null!==e?.stack&&null!==t?.stack?(n="StackedBarChart",a.stackBy=r.field):n="BarChart",Ts(e?.type)&&Ms(t?.type)?(a.categoryAccessor=e.field,a.valueAccessor=t.field,e?.axis?.title&&(a.categoryLabel=e.axis.title),t?.axis?.title&&(a.valueLabel=t.axis.title)):Ms(e?.type)&&Ts(t?.type)?(a.categoryAccessor=t.field,a.valueAccessor=e.field,a.orientation="horizontal",t?.axis?.title&&(a.categoryLabel=t.axis.title),e?.axis?.title&&(a.valueLabel=e.axis.title)):(e?.field&&(a.categoryAccessor=e.field),t?.field&&(a.valueAccessor=t.field),e?.axis?.title&&(a.categoryLabel=e.axis.title),t?.axis?.title&&(a.valueLabel=t.axis.title)),i&&(a.data=i),n}function Ls(e,t,r){e?.field&&(r.xAccessor=e.field),t?.field&&(r.yAccessor=t.field),e?.axis?.title&&(r.xLabel=e.axis.title),t?.axis?.title&&(r.yLabel=t.axis.title)}function _s(e,t,r){let a={component:e,props:t,version:"1",createdAt:/* @__PURE__ */(new Date).toISOString()};if(r.length>0){a.warnings=r;for(let e of r)console.warn(`[semiotic/fromVegaLite] ${e}`)}return a}function Ds(e){if(!Number.isFinite(e))return String(e);let t=Number.isInteger(e)?e:Number(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():String(t)}function Us(e){return Array.isArray(e)?e[0]:e}function Vs(e){let t=!0===e?.__semioticHoverData,r=e&&("node"===e.type||"edge"===e.type||void 0!==e.nodeOrEdge||void 0!==e.allSeries||void 0!==e.stats||void 0!==e.__chartType),a=t||e&&void 0!==e.data&&"number"==typeof e.x&&"number"==typeof e.y&&r,i=Us(a?e.data??{}:e);if(!i||(("node"===e?.nodeOrEdge&&"number"==typeof i?.x0&&"number"==typeof i?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof i?.sankeyWidth)&&i.data&&"object"==typeof i.data&&(i=i.data),!i))return null;if(a&&(void 0!==e.allSeries||void 0!==e.xValue)){let t=On({...i},Fn(i));void 0!==e.allSeries&&void 0===t.allSeries&&(t.allSeries=e.allSeries),void 0!==e.xValue&&void 0===t.xValue&&(t.xValue=e.xValue),i=t}return i}function Gs(e){return e.getHours()||e.getMinutes()||e.getSeconds()||e.getMilliseconds()?e.toLocaleString():e.toLocaleDateString()}function Hs(e,t){for(let r of t){let t=e.find(e=>e.lower===r);if(t)return t}}function qs(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};let r=t.maxEntries??6,a=!1!==t.skipPositional,i=[];for(let[t,r]of Object.entries(e)){if(t.startsWith("_")||"data"===t)continue;let e=t.toLowerCase();if(a&&Gu.has(e)||null==r)continue;let n=typeof r;"string"!==n&&"number"!==n&&"boolean"!==n&&!(r instanceof Date)||i.push({key:t,lower:e,value:r})}if(0===i.length)return{entries:[]};let n=i.findIndex(e=>Du.includes(e.lower)),o=n>=0;n<0&&(n=i.findIndex(e=>"id"===e.lower)),n<0&&(n=i.findIndex(e=>"string"==typeof e.value));let s=n>=0?i[n]:void 0,l=i.filter((e,t)=>t!==n&&(!o||"id"!==e.lower)),c=Hs(l,Uu),u=Hs(l,Vu),d=[];c&&d.push({key:c.key,value:c.value}),u&&d.push({key:u.key,value:u.value});for(let e of l){if(d.length>=r)break;Uu.includes(e.lower)||Vu.includes(e.lower)||d.push({key:e.key,value:e.value})}return{titleKey:s?.key,title:s?.value,entries:d}}function Ws(e){return null!=e&&"boolean"!=typeof e&&("string"==typeof e?e.trim().length>0:Array.isArray(e)?e.some(Ws):!Hu.isValidElement(e)||e.type!==Hu.Fragment||Ws(e.props.children))}function Ys(e){return e.ownsChrome=!0,e}function Ks(e){if("string"!=typeof e)return null!=e;let t=e.trim().toLowerCase();return!(!t||"transparent"===t||/^rgba\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t)||/^hsla\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t))}function Js(e){if("function"==typeof e)return!0===e.ownsChrome;if(!Hu.isValidElement(e))return!1;let t=e.type;if("string"!=typeof t&&t&&!0===t.ownsChrome)return!0;let r=e.props,a=r["data-semiotic-tooltip-chrome"];if(null!=a&&!1!==a&&"false"!==a)return!0;let i=r.style;return!(!i||"object"!=typeof i||!Ks(i.background)&&!Ks(i.backgroundColor))}function Xs(e,t){return"function"==typeof t?t(e):e[t]}function Zs(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e)return Number.isFinite(e)?Ds(e):String(e);if(e instanceof Date)return Gs(e);if("object"==typeof e&&null!==e){let t=e;if(void 0!==t.id)return String(t.id);if(void 0!==t.name)return String(t.name);try{return JSON.stringify(e)}catch{return Array.isArray(e)?`[Array(${e.length})]`:"[Object]"}}return String(e)}function Qs(e={}){let{fields:t,title:r,format:a,style:i={},className:n=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let o,s=[];if(r){let t=Xs(e,r);o=Zs(t,a)}if(t&&t.length>0)t.forEach(t=>{let r,i,n;"string"==typeof t?(r=t,i=t,n=a):(r=t.label,i=t.accessor||t.key||"",n=t.format||a);let o=Xs(e,i);s.push({label:r,value:Zs(o,n)})});else if(!r){let t=["value","y","name","id","label"];for(let r of t)if(void 0!==e[r]){o=Zs(e[r],a);break}if(!o){let t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(o=Zs(e[t[0]],a))}}/* @__PURE__ */
2
- return Ju(Yu,{className:n,style:i,children:[o&&/* @__PURE__ */Ku("div",{style:{fontWeight:s.length>0?"bold":"normal"},children:o}),s.map((e,t)=>/* @__PURE__ */Ju("div",{style:{marginTop:0===t&&o?"4px":0},children:[e.label&&/* @__PURE__ */Ju("span",{children:[e.label,": "]}),e.value]},t))]})}}function el(e={}){let{fields:t=[],title:r,format:a,style:i={},className:n="",showLabels:o=!0,separator:s=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;let l=[];if(r){let t=Xs(e,r);l.push({value:Zs(t,a)})}if(t&&Array.isArray(t)&&t.length>0)t.forEach(t=>{let r,i,n;"string"==typeof t?(r=t,i=t,n=a):(r=t.label,i=t.accessor||t.key||"",n=t.format||a);let s=Zs(Xs(e,i),n);l.push({label:o?r:void 0,value:s})});else{let t=qs(e,{skipPositional:!1});null!=t.title&&l.push({label:void 0,value:Zs(t.title,a),bold:!0}),t.entries.forEach(e=>{l.push({label:o?e.key:void 0,value:Zs(e.value,a)})})}return Array.isArray(l)&&0!==l.length?/* @__PURE__ */Ku(Yu,{className:`semiotic-tooltip-multiline ${n}`.trim(),style:i,children:l.map((e,t)=>/* @__PURE__ */Ju("div",{style:{marginBottom:t<l.length-1?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&/* @__PURE__ */Ju("strong",{children:[e.label,s]}),e.value]},t))}):null}}function tl(e){return"multi"===e||rl(e)}function rl(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"mode"in e&&"multi"===e.mode}function al(e){let{tooltip:t,defaultTooltipContent:r,multiDefaultContent:a=nl(),customFunctionContext:i="datum"}=e,n=t;return!1===t?{tooltipContent:()=>null}:tl(n)?{tooltipContent:(rl(n)&&"function"==typeof n.content?ol(n.content):void 0)||a,tooltipMode:"multi"}:"hover"===i&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:ol(n)||r}}function il(e){let{tooltip:t,defaultTooltipContent:r,customFunctionContext:a="datum"}=e;return!1===t?{tooltipContent:()=>null}:"hover"===a&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:ol(t)||r}}function nl({xFormat:e,yFormat:t}={}){function r(e,t){if(t)try{let r=t(e);if(null!=r)return r}catch{}return Zs(e)}return a=>{let i=a.allSeries;if(!i||0===i.length){let e=a.data?.value??a.data?.y;/* @__PURE__ */
3
- return Ku(Yu,{children:/* @__PURE__ */Ku("div",{children:r(e,t)})})}let n=a.xValue??a.data?.time??a.data?.x;/* @__PURE__ */
4
- return Ju(Yu,{children:[null!=n&&/* @__PURE__ */Ku("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:r(n,e)}),i.map((e,a)=>/* @__PURE__ */Ju("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[
5
- /* @__PURE__ */Ku("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:e.color,flexShrink:0}}),
6
- /* @__PURE__ */Ku("span",{style:{flex:1,fontSize:"0.85em"},children:e.group}),
7
- /* @__PURE__ */Ku("span",{style:{fontWeight:500,fontSize:"0.85em"},children:r(e.value,t&&(r=>t(r,e.group)))})]},a))]})}}function ol(e){if(!0!==e){if("function"==typeof e){let t=e,r=e=>{let r=Vs(e);if(!r)return null;let a=t(r);return Ws(a)?Js(t)||Js(a)?a:/* @__PURE__ */Ku(Yu,{children:a}):null};return Js(t)?Ys(r):r}if(!1===e||void 0===e)return!1;if(rl(e)){if("function"==typeof e.content)return!Xu&&"production"!==process.env.NODE_ENV&&(Xu=!0,console.warn('[semiotic] tooltip={{ mode: "multi", content }} reached a chart without multi-series hover. content receives one datum and no allSeries.')),ol(e.content);"production"!==process.env.NODE_ENV&&console.warn('[semiotic] tooltip={{ mode: "multi" }} reached normalizeTooltip without a chart that wires tooltipMode. Use a line/area-family chart with multi support, or pass frameProps.tooltipMode: "multi" to StreamXYFrame.');let t=el();return ol(e=>t(e))}if("object"==typeof e&&null!==e&&("fields"in e||"title"in e)){let t=Qs(e);return ol(e=>t(e))}if("multi"===e){"production"!==process.env.NODE_ENV&&console.warn('[semiotic] tooltip="multi" reached normalizeTooltip on a single-tooltip chart. Rendering multi-field content as a backward-compatible fallback.');let e=el();return ol(t=>e(t))}return Qs()}}function sl(e){let t=1/0,r=-1/0;for(let a of e)a<t&&(t=a),a>r&&(r=a);return[t,r]}function ll(e=240){let t=e*Math.PI/180,r=360-e,a=180+r/2,i=a*Math.PI/180;return{sweepRad:t,gapDeg:r,startAngleDeg:a,startAngleRad:i,offsetRad:-Math.PI/2+i}}function cl(e,t,r,a,i){let n=r-t||1;return i+(Math.max(t,Math.min(r,e))-t)/n*a}function ul(e=240){let{sweepRad:t,offsetRad:r}=ll(e),a=[[Math.cos(r),Math.sin(r)],[Math.cos(r+t),Math.sin(r+t)],[0,0]];for(let e=0;e<2*Math.PI;e+=Math.PI/2)((e-r)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<=t+.001&&a.push([Math.cos(e),Math.sin(e)]);let i=a.map(e=>e[0]),n=a.map(e=>e[1]),[o,s]=sl(i),[l,c]=sl(n);return{minX:o,maxX:s,minY:l,maxY:c,width:s-o,height:c-l,cx:(o+s)/2,cy:(l+c)/2}}var dl=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],hl={mode:"light",colors:{primary:"#00a2ce",secondary:"#6c757d",categorical:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],sequential:"blues",diverging:"RdBu",background:"transparent",surface:"#ffffff",text:"#333",textSecondary:"#666",grid:"#e0e0e0",border:"#ccc",selection:"#00a2ce",selectionOpacity:.15,success:"#2ca02c",danger:"#d62728",warning:"#f0ad4e",error:"#b4181b",info:"#00a2ce"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},pl={mode:"dark",colors:{primary:"#4fc3f7",secondary:"#90a4ae",categorical:["#4fc3f7","#ffb74d","#81c784","#ef5350","#ba68c8","#a1887f","#f06292","#90a4ae","#dce775","#4dd0e1"],sequential:"blues",diverging:"RdBu",background:"#1a1a2e",surface:"#252540",text:"#e0e0e0",textSecondary:"#aaa",grid:"#333",border:"#555",selection:"#4fc3f7",selectionOpacity:.15,success:"#81c784",danger:"#ef5350",warning:"#ffb74d",error:"#d84848",info:"#4fc3f7"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},fl={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:dl,sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#000000",textSecondary:"#333333",grid:"#999999",border:"#000000",focus:"#0000cc",selection:"#0000cc",selectionOpacity:.1,success:"#006400",danger:"#cc0000",warning:"#b15a00",error:"#8b0000",info:"#0000cc"},typography:{fontFamily:"system-ui, sans-serif",titleSize:18,labelSize:14,tickSize:12},tooltip:{background:"#000000",text:"#ffffff",borderRadius:"4px",fontSize:"14px",shadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},borderRadius:"4px"},ml=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"],gl={danger:"#da1e28",warning:"#f1c21b",success:"#24a148",info:"#0043ce"},yl={light:hl,dark:pl,"high-contrast":fl,pastels:{mode:"light",colors:{primary:"#c9a0dc",secondary:"#b8a8c8",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#fdf6f0",surface:"#fff5ee",text:"#4a3728",textSecondary:"#7a644a",grid:"#e8d5c4",border:"#e8d5c4",focus:"#8a5fae",annotation:"#8a5fae",success:"#9ad4a3",danger:"#e8869a",warning:"#f0c888",error:"#c86070",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#fff5ee",text:"#4a3728",borderRadius:"8px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"10px"},"pastels-dark":{mode:"dark",colors:{primary:"#c9a0dc",secondary:"#a899c0",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#1a1525",surface:"#251e35",text:"#e8ddf0",textSecondary:"#a899c0",grid:"#3d3455",border:"#3d3455",focus:"#c9a0dc",annotation:"#c9a0dc",success:"#88d4ab",danger:"#f0a0c0",warning:"#f0c888",error:"#e87690",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#251e35",text:"#e8ddf0",borderRadius:"8px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"10px"},"bi-tool":{mode:"light",colors:{primary:"#2563eb",secondary:"#6b7280",categorical:["#2563eb","#0d9488","#ea580c","#6b7280"],sequential:"blues",background:"#f5f6f8",surface:"#ffffff",text:"#2c3e50",textSecondary:"#64717f",grid:"#d8dce3",border:"#d8dce3",focus:"#2563eb",annotation:"#2563eb",success:"#10b981",danger:"#ef4444",warning:"#f59e0b",error:"#dc2626",info:"#2563eb"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2c3e50",borderRadius:"6px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"8px"},"bi-tool-dark":{mode:"dark",colors:{primary:"#3b82f6",secondary:"#9ca3af",categorical:["#3b82f6","#14b8a6","#f97316","#9ca3af"],sequential:"blues",background:"#111827",surface:"#1f2937",text:"#f3f4f6",textSecondary:"#9ca3af",grid:"#374151",border:"#374151",focus:"#3b82f6",annotation:"#3b82f6",success:"#34d399",danger:"#f87171",warning:"#fbbf24",error:"#ef4444",info:"#60a5fa"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f2937",text:"#f3f4f6",borderRadius:"6px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"8px"},italian:{mode:"light",colors:{primary:"#cc0000",secondary:"#666666",categorical:["#cc0000","#333333","#c8a415","#4682b4"],sequential:"reds",background:"#fafafa",surface:"#ffffff",text:"#1a1a1a",textSecondary:"#666666",grid:"#e0e0e0",border:"#e0e0e0",focus:"#cc0000",annotation:"#cc0000",success:"#556b2f",danger:"#cc0000",warning:"#c8a415",error:"#8b0000",info:"#4682b4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#1a1a1a",borderRadius:"2px",shadow:"0 2px 4px rgba(0, 0, 0, 0.15)"},borderRadius:"2px"},"italian-dark":{mode:"dark",colors:{primary:"#ff3333",secondary:"#aaaaaa",categorical:["#ff3333","#aaaaaa","#d4a843","#6aa4d4"],sequential:"reds",background:"#0a0a0a",surface:"#1a1a1a",text:"#f5f5f5",textSecondary:"#aaaaaa",grid:"#333333",border:"#333333",focus:"#ff3333",annotation:"#ff3333",success:"#7a8b5a",danger:"#ff3333",warning:"#d4a843",error:"#cc0000",info:"#6aa4d4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1a1a1a",text:"#f5f5f5",borderRadius:"2px",shadow:"0 2px 8px rgba(0, 0, 0, 0.5)"},borderRadius:"2px"},tufte:{mode:"light",colors:{primary:"#8b0000",secondary:"#555555",categorical:["#8b4513","#556b2f","#4a5568","#800020"],sequential:"oranges",background:"#fffff8",surface:"#fffff8",text:"#111111",textSecondary:"#555555",grid:"#e0ddd0",border:"#e0ddd0",focus:"#8b0000",annotation:"#8b0000",success:"#556b2f",danger:"#8b0000",warning:"#b88700",error:"#6b0000",info:"#4a5568"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#fffff8",text:"#111111",borderRadius:"2px",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},borderRadius:"0px"},"tufte-dark":{mode:"dark",colors:{primary:"#c05050",secondary:"#a09880",categorical:["#c08050","#7a8b5a","#8090a0","#a05060"],sequential:"oranges",background:"#1c1b18",surface:"#262520",text:"#e8e4d8",textSecondary:"#a09880",grid:"#3d3c35",border:"#3d3c35",focus:"#c05050",annotation:"#d06a6a",success:"#7a8b5a",danger:"#c05050",warning:"#c8a060",error:"#a04040",info:"#8090a0"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262520",text:"#e8e4d8",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.4)"},borderRadius:"0px"},journalist:{mode:"light",colors:{primary:"#e45050",secondary:"#666666",categorical:["#3a86c8","#e45050","#d4a843","#888888"],sequential:"blues",background:"#ffffff",surface:"#f8f8f8",text:"#222222",textSecondary:"#666666",grid:"#d4d4d4",border:"#d4d4d4",focus:"#e45050",annotation:"#c63b3b",success:"#2d7a3d",danger:"#c8303a",warning:"#d4a843",error:"#a02028",info:"#3a86c8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:18,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#f8f8f8",text:"#222222",borderRadius:"4px",shadow:"0 2px 6px rgba(0, 0, 0, 0.12)"},borderRadius:"4px"},"journalist-dark":{mode:"dark",colors:{primary:"#ff6b6b",secondary:"#a0a0a0",categorical:["#5a9fd8","#ff6b6b","#e0c060","#aaaaaa"],sequential:"blues",background:"#141414",surface:"#1e1e1e",text:"#ededed",textSecondary:"#a0a0a0",grid:"#383838",border:"#383838",focus:"#ff6b6b",annotation:"#ff6b6b",success:"#6fba78",danger:"#ff6b6b",warning:"#e0c060",error:"#d04040",info:"#5a9fd8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1e1e1e",text:"#ededed",borderRadius:"4px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"4px"},playful:{mode:"light",colors:{primary:"#8b5cf6",secondary:"#7c5a9e",categorical:["#8b5cf6","#ec4899","#06b6d4","#84cc16"],sequential:"viridis",background:"#fdf8ff",surface:"#ffffff",text:"#2d1b4e",textSecondary:"#7c5a9e",grid:"#e8d0f8",border:"#e8d0f8",focus:"#8b5cf6",annotation:"#7a47e8",success:"#10d870",danger:"#ff4b6e",warning:"#ffaa33",error:"#e11d48",info:"#06b6d4"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2d1b4e",borderRadius:"12px",shadow:"0 4px 12px rgba(139, 92, 246, 0.15)"},borderRadius:"12px"},"playful-dark":{mode:"dark",colors:{primary:"#a78bfa",secondary:"#b8a0d8",categorical:["#a78bfa","#f472b6","#22d3ee","#a3e635"],sequential:"viridis",background:"#150a28",surface:"#1f1138",text:"#f0e8ff",textSecondary:"#b8a0d8",grid:"#3a2560",border:"#3a2560",focus:"#a78bfa",annotation:"#a78bfa",success:"#4ade80",danger:"#fb7185",warning:"#fbbf24",error:"#f43f5e",info:"#22d3ee"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f1138",text:"#f0e8ff",borderRadius:"12px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"12px"},carbon:{mode:"light",colors:{primary:"#0f62fe",secondary:"#525252",categorical:["#6929c4","#1192e8","#005d5d","#9f1853"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#161616",textSecondary:"#525252",grid:"#e0e0e0",border:"#e0e0e0",focus:"#0f62fe",annotation:"#0f62fe",success:"#24a148",danger:"#da1e28",warning:"#f1c21b",error:"#a2191f",info:"#0043ce"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#161616",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.2)"},borderRadius:"0px"},"carbon-dark":{mode:"dark",colors:{primary:"#4589ff",secondary:"#a8a8a8",categorical:["#a56eff","#33b1ff","#08bdba","#ff7eb6"],sequential:"blues",diverging:"RdBu",background:"#161616",surface:"#262626",text:"#f4f4f4",textSecondary:"#a8a8a8",grid:"#393939",border:"#393939",focus:"#4589ff",annotation:"#4589ff",success:"#42be65",danger:"#fa4d56",warning:"#f1c21b",error:"#da1e28",info:"#4589ff"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262626",text:"#f4f4f4",borderRadius:"2px",shadow:"0 4px 12px rgba(0, 0, 0, 0.5)"},borderRadius:"0px"}},bl=Object.freeze({"mark-scaffold-hierarchy":3,"palette-authorship":1,"palette-economy":1,"typographic-hierarchy":1,"theme-coherence":2,"editorial-emphasis":1}),vl=Object.freeze({hierarchyRatio:2,scaffoldContrastMin:1.1,scaffoldContrastMax:2,titleScaleRatio:1.25,categoricalColorMax:7,emphasisRatioMin:.05,emphasisRatioMax:.35}),wl=Object.freeze({name:"Semiotic balanced",weights:bl,thresholds:vl,minimumScore:70}),Al=Object.freeze({name:"Aesthetics off",weights:/* @__PURE__ */Object.freeze(
1
+ function e(e){return Object.prototype.hasOwnProperty.call(Rl,e)?Rl[e]:void 0}function t(e){let t={"--semiotic-bg":e.colors.background,"--semiotic-text":e.colors.text,"--semiotic-text-secondary":e.colors.textSecondary,"--semiotic-grid":e.colors.grid,"--semiotic-border":e.colors.border,"--semiotic-cell-border":e.colors.cellBorder||e.colors.border,"--semiotic-primary":e.colors.primary,"--semiotic-font-family":e.typography.fontFamily,"--semiotic-secondary":e.colors.secondary||e.colors.primary,"--semiotic-surface":e.colors.surface||e.colors.background};e.colors.categorical.forEach((e,r)=>{t[`--semiotic-category-${r+1}`]=e}),e.colors.focus&&(t["--semiotic-focus"]=e.colors.focus),e.colors.selection&&(t["--semiotic-selection-color"]=e.colors.selection),null!=e.colors.selectionOpacity&&(t["--semiotic-selection-opacity"]=String(e.colors.selectionOpacity)),e.colors.diverging&&(t["--semiotic-diverging"]=e.colors.diverging),e.colors.annotation&&(t["--semiotic-annotation-color"]=e.colors.annotation),e.colors.success&&(t["--semiotic-success"]=e.colors.success),e.colors.danger&&(t["--semiotic-danger"]=e.colors.danger),e.colors.warning&&(t["--semiotic-warning"]=e.colors.warning),e.colors.error&&(t["--semiotic-error"]=e.colors.error),e.colors.info&&(t["--semiotic-info"]=e.colors.info),e.tooltip?.background&&(t["--semiotic-tooltip-bg"]=e.tooltip.background),e.tooltip?.text&&(t["--semiotic-tooltip-text"]=e.tooltip.text),e.tooltip?.borderRadius&&(t["--semiotic-tooltip-radius"]=e.tooltip.borderRadius),e.tooltip?.fontSize&&(t["--semiotic-tooltip-font-size"]=e.tooltip.fontSize),e.tooltip?.shadow&&(t["--semiotic-tooltip-shadow"]=e.tooltip.shadow),e.borderRadius&&(t["--semiotic-border-radius"]=e.borderRadius);let r=e.typography.legendSize??e.typography.labelSize;null!=r&&(t["--semiotic-legend-font-size"]=`${r}px`),null!=e.typography.legendFontFamily&&(t["--semiotic-legend-font-family"]=e.typography.legendFontFamily),null!=e.typography.legendFontWeight&&(t["--semiotic-legend-font-weight"]=String(e.typography.legendFontWeight));let a=e.typography.titleFontSize??e.typography.titleSize;return null!=a&&(t["--semiotic-title-font-size"]=`${a}px`),null!=e.typography.titleFontFamily&&(t["--semiotic-title-font-family"]=e.typography.titleFontFamily),null!=e.typography.titleFontWeight&&(t["--semiotic-title-font-weight"]=String(e.typography.titleFontWeight)),null!=e.typography.tickFontFamily&&(t["--semiotic-tick-font-family"]=e.typography.tickFontFamily),null!=e.typography.tickSize&&(t["--semiotic-tick-font-size"]=`${e.typography.tickSize}px`),null!=e.typography.labelSize&&(t["--semiotic-axis-label-font-size"]=`${e.typography.labelSize}px`),t}function r(e,r=":root"){return`${r} {\n${Object.entries(t(e)).map(([e,t])=>` ${e}: ${t};`).join("\n")}\n}`}function a(e){return{semiotic:{bg:{$value:e.colors.background,$type:"color"},text:{$value:e.colors.text,$type:"color"},"text-secondary":{$value:e.colors.textSecondary,$type:"color"},grid:{$value:e.colors.grid,$type:"color"},border:{$value:e.colors.border,$type:"color"},primary:{$value:e.colors.primary,$type:"color"},focus:{$value:e.colors.focus||e.colors.primary,$type:"color"},"font-family":{$value:e.typography.fontFamily,$type:"fontFamily"},"border-radius":{$value:e.borderRadius||"8px",$type:"dimension"},tooltip:{bg:{$value:e.tooltip?.background||e.colors.background,$type:"color"},text:{$value:e.tooltip?.text||e.colors.text,$type:"color"},radius:{$value:e.tooltip?.borderRadius||"6px",$type:"dimension"},"font-size":{$value:e.tooltip?.fontSize||"14px",$type:"dimension"},shadow:{$value:e.tooltip?.shadow||"0 2px 8px rgba(0,0,0,0.15)",$type:"shadow"}},selection:{color:{$value:e.colors.selection||e.colors.primary,$type:"color"},opacity:{$value:e.colors.selectionOpacity??.2,$type:"number"}},categorical:{$value:e.colors.categorical,$type:"color",$description:"Categorical color palette"},sequential:{$value:e.colors.sequential,$type:"string",$description:"d3-scale-chromatic sequential scheme name"},...e.aesthetics?{aesthetics:{...e.aesthetics.name?{profile:{$value:e.aesthetics.name,$type:"string"}}:{},...null!=e.aesthetics.minimumScore?{"minimum-score":{$value:e.aesthetics.minimumScore,$type:"number"}}:{},weights:Object.fromEntries(Object.entries(e.aesthetics.weights??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),thresholds:Object.fromEntries(Object.entries(e.aesthetics.thresholds??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),rationales:Object.fromEntries(Object.entries(e.aesthetics.rationales??{}).map(([e,t])=>[e,{$value:t,$type:"string"}]))}}:{},...e.colors.diverging?{diverging:{$value:e.colors.diverging,$type:"string",$description:"d3-scale-chromatic diverging scheme name"}}:{},...e.colors.annotation?{"annotation-color":{$value:e.colors.annotation,$type:"color"}}:{},...null!=e.typography.legendSize?{"legend-font-size":{$value:`${e.typography.legendSize}px`,$type:"dimension"}}:{},...null!=e.typography.legendFontFamily?{"legend-font-family":{$value:e.typography.legendFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.legendFontWeight?{"legend-font-weight":{$value:e.typography.legendFontWeight,$type:"fontWeight"}}:{},"title-font-size":{$value:`${e.typography.titleFontSize??e.typography.titleSize}px`,$type:"dimension"},...null!=e.typography.titleFontFamily?{"title-font-family":{$value:e.typography.titleFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.titleFontWeight?{"title-font-weight":{$value:e.typography.titleFontWeight,$type:"fontWeight"}}:{},...null!=e.typography.tickFontFamily?{"tick-font-family":{$value:e.typography.tickFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.tickSize?{"tick-font-size":{$value:`${e.typography.tickSize}px`,$type:"dimension"}}:{},...null!=e.typography.labelSize?{"axis-label-font-size":{$value:`${e.typography.labelSize}px`,$type:"dimension"}}:{},secondary:{$value:e.colors.secondary||e.colors.primary,$type:"color"},surface:{$value:e.colors.surface||e.colors.background,$type:"color"},...e.colors.success?{success:{$value:e.colors.success,$type:"color"}}:{},...e.colors.danger?{danger:{$value:e.colors.danger,$type:"color"}}:{},...e.colors.warning?{warning:{$value:e.colors.warning,$type:"color"}}:{},...e.colors.error?{error:{$value:e.colors.error,$type:"color"}}:{},...e.colors.info?{info:{$value:e.colors.info,$type:"color"}}:{}}}}function i(e){if(null==e)return()=>{};let t="function"==typeof e?e:t=>t[e];return e=>s(t(e))}function n(e,t){let r=i(e),a=i(t);return(e,t)=>{let i=a(e);return{value:i,x:r(e),y:i,category:t}}}function o(e,t){let r=i(t??"value"),a=null==e?void 0:"function"==typeof e?e:t=>t[e];return e=>{let t=a?a(e):void 0;return{value:r(e),category:null==t?void 0:String(t)}}}function s(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){let t=Number(e);return Number.isFinite(t)?t:void 0}}function l(e,t,r){let a=null!=e.axis?r[e.axis]:null!=e.field?t[e.field]:r.value;if(void 0!==e.eq&&a!==e.eq||void 0!==e.ne&&a===e.ne||void 0!==e.in&&!e.in.includes(a))return!1;if(void 0===e.gt&&void 0===e.gte&&void 0===e.lt&&void 0===e.lte&&void 0===e.within&&void 0===e.outside)return!0;let i=s(a);if(!(void 0!==i&&(void 0===e.gt||i>e.gt)&&(void 0===e.gte||i>=e.gte)&&(void 0===e.lt||i<e.lt)&&(void 0===e.lte||i<=e.lte)))return!1;if(void 0!==e.within){let[t,r]=e.within;if(!(i>=t&&i<=r))return!1}if(void 0!==e.outside){let[t,r]=e.outside;if(!(i<t||i>r))return!1}return!0}function c(e,t,r){let a=e.when;return void 0===a||!0===a||!1!==a&&("function"==typeof a?a(t,r):l(a,t,r))}function u(e,t,r){if(!t||0===t.length)return{};let a={};for(let i of t){if(!c(i,e,r))continue;let t="function"==typeof i.style?i.style(e,r):i.style;t&&(a={...a,...t})}return a}function d(e,t,r,a=e=>e){let i=e??(()=>({}));return t&&0!==t.length?(e,n)=>{let o=a(e),s={...i(e,n)};return Object.assign(s,u(o,t,r(o,n))),s}:i}function h(e,t,r){return e&&0!==e.length?(a,i)=>{let n=u(a,e,t(a,i)),o=r?r(a,i):void 0;return o?{...n,...o}:n}:r}function p(e){let t=e.replace(/^#/,"");/^[a-f\d]{3}$/i.test(t)&&(t=t.split("").map(e=>e+e).join(""));let r=t.match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!r)return null;let[a,i,n]=[parseInt(r[1],16)/255,parseInt(r[2],16)/255,parseInt(r[3],16)/255],o=e=>e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4);return.2126*o(a)+.7152*o(i)+.0722*o(n)}function f(e,t){let r=p(e),a=p(t);return null===r||null===a?null:(Math.max(r,a)+.05)/(Math.min(r,a)+.05)}function m(e){return Math.min(255,Math.max(0,Math.round(e)))}function g(e){if("string"!=typeof e)return null;let t=e.trim().toLowerCase(),r=t.match(/^#([a-f\d]{3,4}|[a-f\d]{6}|[a-f\d]{8})$/i)?.[1];if(r){let e=r.length<=4?r.split("").map(e=>`${e}${e}`).join(""):r;return{r:Number.parseInt(e.slice(0,2),16),g:Number.parseInt(e.slice(2,4),16),b:Number.parseInt(e.slice(4,6),16),a:8===e.length?Number.parseInt(e.slice(6,8),16)/255:1}}let a=t.match(/^rgba?\(\s*(-?(?:\d+|\d*\.\d+))\s*,\s*(-?(?:\d+|\d*\.\d+))\s*,\s*(-?(?:\d+|\d*\.\d+))(?:\s*,\s*(-?(?:\d+|\d*\.\d+)))?\s*\)$/);if(!a)return null;let i=[Number(a[1]),Number(a[2]),Number(a[3])],n=void 0===a[4]?1:Number(a[4]);return i.some(e=>!Number.isFinite(e)||e<0||e>255)||!Number.isFinite(n)||n<0||n>1?null:{r:i[0],g:i[1],b:i[2],a:n}}function y(e,t){return t.a<1?null:{r:m(e.r*e.a+t.r*(1-e.a)),g:m(e.g*e.a+t.g*(1-e.a)),b:m(e.b*e.a+t.b*(1-e.a)),a:1}}function b(e){return e.a<1?null:`#${[e.r,e.g,e.b].map(e=>m(e).toString(16).padStart(2,"0")).join("")}`}function v(e){if("string"!=typeof e||""===e.trim())return;let t=g(e);return t?b(t)??`rgba(${m(t.r)},${m(t.g)},${m(t.b)},${t.a})`:e.trim().toLowerCase()}function w(e,t,r){let a=g(e),i=g(t);if(!a||!i)return null;let n=y({...a,a:a.a*Math.min(1,Math.max(0,r))},i);return n?b(n):null}function A(e){let t=g(e.backgroundColor),r=t?b(t):null,a=w(e.scaffoldColor,e.backgroundColor,e.scaffoldOpacity??1),i=a&&r?f(a,r):null,n=e.dataColors.map(t=>w(t,e.backgroundColor,1)).map(e=>e&&r?f(e,r):null).filter(e=>null!==e);if(null===i||n.length!==e.dataColors.length||0===n.length)return{ok:!0,status:"manual",method:"mark-to-scaffold-contrast",finding:{code:"VISUAL_HIERARCHY_MANUAL",status:"manual",message:"Visual hierarchy could not be computed from the supplied colors.",fix:"Resolve CSS variables, gradients, or named colors to solid colors and run the audit again."}};let o=Math.min(...n),s=o/i,l={weakestDataContrast:o,scaffoldContrast:i,hierarchyRatio:s},c=Math.max(1,e.minimumScaffoldContrast??1.1),u=Math.max(c,e.maximumScaffoldContrast??2),d=Math.max(1,e.minimumHierarchyRatio??2);return i<c?{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_VISIBILITY",status:"warn",message:"Reference scaffolding may be too faint to remain useful.",fix:"Increase grid or guide contrast while keeping it below the primary data marks."}}:o>=3&&i<=u&&s>=d?{ok:!0,status:"pass",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_DOMINANCE",status:"pass",message:"Primary data marks lead while reference scaffolding remains visible and subordinate."}}:{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_DOMINANCE",status:"warn",message:"Reference scaffolding competes with the primary data marks.",fix:"Increase mark contrast or lighten grid and guide colors until marks have at least twice the scaffold contrast."}}}function $(e){return Math.min(1,Math.max(0,e))}function x(e,t){return Number.isFinite(e)?e:t}function C(e){let t=e.thresholds??{},r=Math.max(1,x(t.scaffoldContrastMin,Nl.scaffoldContrastMin)),a=$(x(t.emphasisRatioMin,Nl.emphasisRatioMin));return{hierarchyRatio:Math.max(1,x(t.hierarchyRatio,Nl.hierarchyRatio)),scaffoldContrastMin:r,scaffoldContrastMax:Math.max(r,x(t.scaffoldContrastMax,Nl.scaffoldContrastMax)),titleScaleRatio:Math.max(1.01,x(t.titleScaleRatio,Nl.titleScaleRatio)),categoricalColorMax:Math.max(1,Math.round(x(t.categoricalColorMax,Nl.categoricalColorMax))),emphasisRatioMin:a,emphasisRatioMax:Math.max(a,$(x(t.emphasisRatioMax,Nl.emphasisRatioMax)))}}function S(e){return v(e)}function k(e){return(Array.isArray(e)?e:e&&"object"==typeof e?Object.values(e):[e]).map(S).filter(e=>!!e)}function R(e){return Array.isArray(e)||e&&"object"==typeof e?k(e):[]}function P(e){return!(e.length<4)&&Il.some(t=>e.length===t.length&&e.every((e,r)=>e===t[r]))}function N(e){let t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,r=[...R(e.colorScheme),...k(e.color),...k(e.fill),...k(e.stroke),...k(t?.fill),...k(t?.stroke)],a=Array.isArray(e.styleRules)?e.styleRules:[];for(let e of a)!e.style||"function"==typeof e.style||r.push(...k(e.style.fill),...k(e.style.stroke));return Array.from(new Set(r))}function E(e){let t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,r=[...R(e.colorScheme),...k(e.color),...k(e.fill),...k(t?.fill)],a=Array.isArray(e.styleRules)?e.styleRules:[];for(let e of a)!e.style||"function"==typeof e.style||r.push(...k(e.style.fill));return Array.from(new Set(r))}function T(e,t){let r=Array.isArray(e.data)?e.data:[];return"string"==typeof t?Array.from(new Set(r.map(e=>String(e[t])))):"function"==typeof t?Array.from(new Set(r.map((e,r)=>String(t(e,r))))):[]}function I(e){let t=Array.isArray(e.data)?e.data:[],r=Array.isArray(e.styleRules)?e.styleRules:[],a="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",i="string"==typeof e.categoryAccessor?e.categoryAccessor:"category",n=[];for(let e of r)!e.style||"function"==typeof e.style||t.some((t,r)=>c(e,t,{value:Number(t[a]),category:String(t[i]??""),index:r}))&&n.push(...k(e.style.fill));return Array.from(new Set(n))}function M(e,t,r){let a=R(t.colorScheme),i=k(t.color),n=T(t,t.colorBy),o=Ol.has(e)?T(t,t.categoryAccessor??"category"):[],s=t.colorScheme&&"object"==typeof t.colorScheme&&!Array.isArray(t.colorScheme)?t.colorScheme:void 0,l=(e,t)=>e.map((e,a)=>S(s?.[e])??("gray"===t?"#999999":r.colors.categorical.length>0?r.colors.categorical[a%r.colors.categorical.length]:"#007bff")),c=n.length>0?s?l(n,"gray"):a.length>0?a:r.colors.categorical:i.length>0?i:o.length>0&&s?l(o,"theme"):a.length>0&&!s?a:r.colors.categorical,u=Math.max(1,n.length||o.length||1),d=n.length>0||o.length>0?c.slice(0,Math.min(c.length,u)):c.slice(0,1),h=I(t).filter(e=>!d.includes(e));return Array.from(/* @__PURE__ */new Set([...d,...h]))}function O(e){let t=e.colors.surface??e.colors.background,r=g(t),a=g(e.colors.background);if(!r)return t;if(1===r.a)return b(r)??t;if(!a)return t;let i=y(r,a);return i?b(i)??t:t}function F(e,t){if(!e.evidence)return.5;let{weakestDataContrast:r,scaffoldContrast:a,hierarchyRatio:i}=e.evidence;return Math.min($(r/3),$(a/t.scaffoldContrastMin),$(t.scaffoldContrastMax/a),$(i/t.hierarchyRatio))}function j(e,t,r,a,i,n,o){let s=r[e];return{id:e,label:Fl[e],status:0===s?"disabled":o??(t>=.8?"pass":"warn"),score:t,weight:s,contribution:t*s,message:a,...n?.[e]?{rationale:n[e]}:{},evidence:i}}function L(e){return Math.max(1,e.length)}function z(e){let t=Array.isArray(e.data)?e.data:[],r=Array.isArray(e.styleRules)?e.styleRules:[];if(0===t.length||0===r.length)return{ratio:0,authored:!1};let a="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",i="string"==typeof e.categoryAccessor?e.categoryAccessor:"category";return{ratio:t.filter((e,t)=>r.some(r=>c(r,e,{value:Number(e[a]),category:String(e[i]??""),index:t}))).length/t.length,authored:!0}}function B(e,t,r={}){let a=r.theme??$l,i=r.profile??a.aesthetics??El,n={...Pl,...i.weights??{}};for(let e of Object.keys(n)){let t=n[e];n[e]=Number.isFinite(t)?Math.max(0,t):0}let o=C(i),s=M(e,t,a),l=A({backgroundColor:O(a),dataColors:s,scaffoldColor:a.colors.grid,minimumHierarchyRatio:o.hierarchyRatio,minimumScaffoldContrast:o.scaffoldContrastMin,maximumScaffoldContrast:o.scaffoldContrastMax}),c=N(t),u=P(a.colors.categorical.map(S).filter(e=>!!e)),d=E(t),h="string"==typeof t.colorScheme?t.colorScheme.trim().toLowerCase():void 0,p=d.length>0||h?"chart":"theme",f="chart"===p?P(d)||!!h&&Ml.has(h):u,m=f?.2:"chart"===p?1:.8,g=L(s),y=g<=o.categoricalColorMax?1:$(1-(g-o.categoricalColorMax)/o.categoricalColorMax),b=a.typography.titleFontSize??a.typography.titleSize,v=Math.max(a.typography.tickSize,a.typography.labelSize),w=v>0?b/v:1,k=$((w-1)/(o.titleScaleRatio-1)),R=new Set([...a.colors.categorical,a.colors.primary,a.colors.secondary,a.colors.background,a.colors.surface,a.colors.text,a.colors.textSecondary,a.colors.grid,a.colors.border,a.colors.annotation].map(S).filter(e=>!!e)),T=c.filter(e=>!R.has(e)).length,I=0===c.length?1:$(1-T/c.length),B=z(t),D=B.authored?B.ratio<o.emphasisRatioMin?$(B.ratio/o.emphasisRatioMin):B.ratio<=o.emphasisRatioMax?1:$(o.emphasisRatioMax/B.ratio):.35,_=[j("mark-scaffold-hierarchy",F(l,o),n,l.finding.message,{hierarchyRatio:l.evidence?.hierarchyRatio??0,markContrast:l.evidence?.weakestDataContrast??0,scaffoldContrast:l.evidence?.scaffoldContrast??0},i.rationales,l.status),j("palette-authorship",m,n,f?"theme"===p?"The chart inherits a ubiquitous categorical default without an organizational palette decision.":"The chart explicitly selects a ubiquitous categorical palette.":"The effective palette records an authored choice beyond the ubiquitous defaults.",{paletteSource:p,ubiquitousDefault:f,colorCount:s.length},i.rationales),j("palette-economy",y,n,`${g} color role(s) are used against a policy ceiling of ${o.categoricalColorMax}.`,{colorRoles:g,maximum:o.categoricalColorMax},i.rationales),j("typographic-hierarchy",k,n,`Title-to-supporting-type scale is ${w.toFixed(2)}×.`,{titleSize:b,supportingSize:v,ratio:w},i.rationales),j("theme-coherence",I,n,`${T} of ${c.length} explicit chart color(s) fall outside the theme vocabulary.`,{explicitColors:c.length,outsideTheme:T},i.rationales),j("editorial-emphasis",D,n,B.authored?`${Math.round(100*B.ratio)}% of marks receive authored emphasis.`:"No machine-visible editorial emphasis rule is declared.",{authored:B.authored,emphasizedRatio:B.ratio},i.rationales)],U=_.reduce((e,t)=>e+t.weight,0),G=_.reduce((e,t)=>e+t.contribution,0),H=0===U?null:G/U*100,V=100*$(x(i.minimumScore,El.minimumScore??70)/100);return{component:e,profile:i.name??"Unnamed aesthetic profile",ok:null===H||H>=V,score:H,minimumScore:V,weightedPoints:G,totalWeight:U,features:_,method:"weighted-machine-visible-features"}}function D(e){if(e.length<2)return"days";let t=[];for(let r=1;r<e.length;r++)t.push(e[r]-e[r-1]);t.sort((e,t)=>e-t);let r=t[Math.floor(t.length/2)];return r<12e4?"seconds":r<72e5?"minutes":r<1728e5?"hours":r<5184e6?"days":r<3456e7?"months":"years"}function _(e){return e<10?`0${e}`:String(e)}function U(e={}){let t=e.timeZone;return"UTC"===t?{kind:"utc"}:"local"===t?{kind:"local"}:"string"==typeof t&&t.length>0?{kind:"iana",id:t}:!1===e.utc?{kind:"local"}:{kind:"utc"}}function G(e,t){return t?{month:e.getUTCMonth(),day:e.getUTCDate(),year:e.getUTCFullYear(),hours:e.getUTCHours(),minutes:e.getUTCMinutes(),seconds:e.getUTCSeconds()}:{month:e.getMonth(),day:e.getDate(),year:e.getFullYear(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}function H(e){let t;try{t=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hourCycle:"h23"})}catch{return e=>G(e,!0)}return e=>{let r={};for(let a of t.formatToParts(e))"literal"!==a.type&&(r[a.type]=a.value);return{month:Math.max(0,(Number(r.month)||1)-1),day:Number(r.day)||1,year:Number(r.year)||1970,hours:Number(r.hour)||0,minutes:Number(r.minute)||0,seconds:Number(r.second)||0}}}function V(e){return"utc"===e.kind?e=>G(e,!0):"local"===e.kind?e=>G(e,!1):H(e.id)}function q(e,t,r,a=zl){let{month:i,day:n,year:o,hours:s,minutes:l,seconds:c}=r(e),u=Ll[i],d=_(s),h=_(l),p=_(c),f=a.year?`${u} ${n}, ${o} `:`${u} ${n} `;switch(t){case"seconds":return`${a.date?f:""}${d}:${h}:${p}`;case"minutes":case"hours":return`${a.date?f:""}${d}:${h}`;case"days":return a.year?`${u} ${n}, ${o}`:`${u} ${n}`;case"months":return a.year?`${u} ${o}`:`${u}`;case"years":return`${o}`}}function W(e,t,r,a,i=zl,n=!1){let o=a(e),s=a(t),l=o.year!==s.year,c=l||o.month!==s.month,u=c||o.day!==s.day,d=u||o.hours!==s.hours,h=d||o.minutes!==s.minutes,p=i.date,f=l&&i.year,m=Ll[o.month],{day:g,year:y}=o,b=_(o.hours),v=_(o.minutes),w=_(o.seconds);switch(r){case"seconds":return f&&p?`${m} ${g}, ${y} ${b}:${v}:${w}`:u&&p?`${m} ${g} ${b}:${v}:${w}`:d||n?`${b}:${v}:${w}`:h?`${v}:${w}`:`:${w}`;case"minutes":return f&&p?`${m} ${g}, ${y} ${b}:${v}`:u&&p?`${m} ${g} ${b}:${v}`:d||n?`${b}:${v}`:`:${v}`;case"hours":return f&&p?`${m} ${g}, ${y} ${b}:${v}`:u&&p?`${m} ${g} ${b}:${v}`:`${b}:${v}`;case"days":return f?`${m} ${g}, ${y}`:c||n?`${m} ${g}`:`${g}`;case"months":return f?`${m} ${y}`:`${m}`;case"years":return`${y}`}}function Y(e,t={}){let r,a,i=e,n=V(U(t)),{includeYear:o="always",includeDate:s="always"}=t,l="clock"===t.deltaStyle,c="auto"===o?n(new Date(t.referenceTime??Date.now())).year:void 0,u={referenceYear:!1,oneDay:!1},d=e=>{if(e!==a){a=e;let t=e.map(e=>n(new Date(e))),[r]=t;u={referenceYear:t.every(e=>e.year===c),oneDay:t.every(e=>e.year===r.year&&e.month===r.month&&e.day===r.day)}}return u};return(t,a,c)=>{let h=t instanceof Date?t:new Date(t);!e&&c&&c.length>=2&&c!==r&&(r=c,i=D(c));let p=i||"days";if(null==a||!c||0===c.length)return q(h,p,n);let f="seconds"===p||"minutes"===p||"hours"===p,m="always"===o&&"always"===s?zl:{year:"years"===p||"never"!==o,date:!f||"never"!==s};if(0===a){if(m===zl)return q(h,p,n);let{referenceYear:e,oneDay:t}="auto"===o||"auto"===s?d(c):u,r=m.date&&!(f&&"auto"===s&&t),a=r&&m.year&&!("years"!==p&&"auto"===o&&e);return q(h,p,n,{year:a||"years"===p,date:r})}return W(h,new Date(c[a-1]),p,n,m,l)}}function K(e){if(null==e)return"";if("number"!=typeof e||!isFinite(e))return String(e);if(0===e)return"0";let t=parseFloat(e.toPrecision(12)),r=Math.abs(t);if(r>=1e4)for(let e=Bl.length-1;e>=0;e--){let[a,i]=Bl[e];if(r<a)continue;let n=parseFloat((t/a).toPrecision(3));if(Math.abs(n)>=1e3&&e<Bl.length-1){let[r,a]=Bl[e+1];return`${parseFloat((t/r).toPrecision(3))}${a}`}return`${n}${i}`}return Number.isInteger(t)?String(t):String(parseFloat(t.toPrecision(6)))}function J(e,t=0,r=1/0,a=0){let i=Number.isFinite(t)?t:0,n=Number.isFinite(r)?Math.max(i,r):1/0,o=Number.isFinite(e)?Math.floor(e):i,s=Math.max(i,Math.min(n,o));return a>0&&Number.isFinite(a)?Math.max(i,Math.min(n,Math.round(s/a)*a)):s}function X(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Z(e){if(!("number"!=typeof e.height||e.height<=0))return e.width>=e.height?"landscape":"portrait"}function Q(e){if(!("number"!=typeof e.height||e.height<=0))return e.width/e.height}function ee(e,t){let{when:r}=e,a=t.width,i=t.height,n=Q(t),o=Z(t);return!("number"==typeof r.minWidth&&a<r.minWidth||"number"==typeof r.maxWidth&&a>r.maxWidth||"number"==typeof r.minHeight&&("number"!=typeof i||i<r.minHeight)||"number"==typeof r.maxHeight&&("number"!=typeof i||i>r.maxHeight)||"number"==typeof r.minAspectRatio&&("number"!=typeof n||n<r.minAspectRatio)||"number"==typeof r.maxAspectRatio&&("number"!=typeof n||n>r.maxAspectRatio)||r.orientation&&o!==r.orientation)}function te(e,t){let r={...e,...t};for(let a of["margin","frameProps","mobileSemantics","style"])X(e[a])&&X(t[a])&&(r[a]={...e[a],...t[a]});return"string"==typeof e.className&&"string"==typeof t.className&&(r.className=`${e.className} ${t.className}`),r}function re(e,t,r=e.responsiveRules){if(!Array.isArray(r)||0===r.length)return{props:e,matches:[]};let a=r.map((e,t)=>({rule:e,index:t})).filter(e=>ee(e.rule,t)).sort((e,t)=>("number"==typeof e.rule.priority?e.rule.priority:e.index)-("number"==typeof t.rule.priority?t.rule.priority:t.index));return{props:a.reduce((e,t)=>te(e,t.rule.transform),e),matches:a}}function ae(e,t={}){let r=t.mobileSemantics?.interaction,a="number"==typeof r?.targetSize?r.targetSize:"number"==typeof t.mobileSemantics?.minimumHitTarget?t.mobileSemantics.minimumHitTarget:void 0,i="mobile"===t.mode||"number"==typeof t.width&&t.width<=480,n=!!r||void 0!==a,o=e&&"object"==typeof e?e:void 0;if(!1===e||!1===o?.enabled||void 0===e&&!i&&!n)return Dl;let s=o??{};return{enabled:!0,tapToSelect:s.tapToSelect??!0,tapToLockTooltip:s.tapToLockTooltip??!0,clearSelection:s.clearSelection??"backgroundTap",targetSize:s.targetSize??a??44,snap:s.snap??"nearestDatum",brushHandleSize:s.brushHandleSize??44,standardControls:s.standardControls??!1}}function ie(e){return"string"==typeof e&&Object.prototype.hasOwnProperty.call(_l,e)}function ne(e,t,r){let a=_l[e||"primary"],i=e&&"primary"!==e||!r?.width?a.width:r.width,n=e&&"primary"!==e||!r?.height?a.height:r.height,o=re({...t,mode:e},{width:t.width??i,height:t.height??n}).props,s=o.mode||e||"primary",l=_l[s],c="context"===s||"sparkline"===s,u="primary"===s&&r?.width?r.width:l.width,d="primary"===s&&r?.height?r.height:l.height;return{mode:s,width:o.width??u,height:o.height??d,showAxes:o.showAxes??l.showAxes,showGrid:o.showGrid??l.showGrid,enableHover:o.enableHover??(!!o.linkedHover||l.enableHover),showLegend:o.showLegend??l.showLegend,showLabels:o.showLabels??l.showLabels,title:c?void 0:o.title,description:o.description,summary:o.summary,accessibleTable:o.accessibleTable,xLabel:c?void 0:o.xLabel,yLabel:c?void 0:o.yLabel,categoryLabel:c?void 0:o.categoryLabel,valueLabel:c?void 0:o.valueLabel,marginDefaults:oe(l.marginDefaults,o.showCategoryTicks,o.orientation),compactMode:c,mobileInteraction:ae(o.mobileInteraction,{mode:s,width:o.width??u,mobileSemantics:o.mobileSemantics}),mobileSemantics:o.mobileSemantics}}function oe(e,t,r){if(!1!==t)return e;let a={...e};return"horizontal"===r?a.left=Math.min(a.left,15):a.bottom=Math.min(a.bottom,15),a}function se(e){return["MinimapChart","ProcessSankey","ChainReactionChart","DependencyForestChart","FlowCircuitChart"].includes(e)}function le(e){let t=ce(e);return(e.height||60)+(e.margin?.top??t.top)+(e.margin?.bottom??t.bottom)}function ce(e){let t=e.handles&&"object"==typeof e.handles?e.handles:e.handles?{}:null,r="number"==typeof t?.size&&Number.isFinite(t.size)?t.size:12;return{top:t?.move?Math.ceil(Wl(r)/2)+2:0,bottom:e.showExtentLabels?34:20}}function ue(e,t={}){if("BigNumber"===e){let e=t,r=e.mode&&Object.hasOwn(Ul,e.mode)?Ul[e.mode]:Ul.tile;return{width:e.width??r.width,height:e.height??r.height}}if(!Object.hasOwn(ql,e))throw new Error(`Unknown chart: ${e}`);let r=t;if("ScatterplotMatrix"===e){let e=r.fields?.length??0,t=Vl+e*((r.cellSize??Gl)+(r.cellGap??Hl));return{width:t,height:t}}let a=se(e),i=["GaltonBoardChart","UnitPileChart","CollisionSwarmChart","EventDropChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart","GauntletChart","CrucibleChart"].includes(e),n=i||e.startsWith("Realtime")||"TemporalHistogram"===e?r.size:void 0,o=ne("Sparkline"===e?"sparkline":a?void 0:ie(r.mode)?r.mode:void 0,{width:!i&&n?n[0]:r.width,height:!i&&n?n[1]:r.height,responsiveRules:a?void 0:r.responsiveRules},ql[e]),s=n?n[0]:o.width,l=n?n[1]:o.height;return r.responsiveWidth&&void 0!==r.containerSize?.width&&(s=J(r.containerSize.width)),r.responsiveHeight&&void 0!==r.containerSize?.height&&(l=J(r.containerSize.height)),"MinimapChart"===e&&(l+=le(r.minimap??{})),(i||"ChainReactionChart"===e||"FlowCircuitChart"===e)&&(s=Math.max(1,s),l=Math.max(1,l)),{width:s,height:l}}function de(e,t=.5){let r=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!r)return e;let a=Math.round(parseInt(r[1],16)*(1-t)),i=Math.round(parseInt(r[2],16)*(1-t)),n=Math.round(parseInt(r[3],16)*(1-t));return`#${a.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function he(e,t=.5){let r=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!r)return e;let a=Math.round(parseInt(r[1],16)+(255-parseInt(r[1],16))*t),i=Math.round(parseInt(r[2],16)+(255-parseInt(r[2],16))*t),n=Math.round(parseInt(r[3],16)+(255-parseInt(r[3],16))*t);return`#${a.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function pe(e){let t=Number.isFinite(e)&&e>0?e:6;return{width:Math.max(8,t),height:t,lineY:t/2}}function fe(e){return{type:"hatch",background:e.background,stroke:e.stroke,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle,...1!==e.lineOpacity?{lineOpacity:e.lineOpacity}:{}}}function me(e,t){return typeof OffscreenCanvas<"u"?new OffscreenCanvas(e,t):(Yl||(Yl=document.createElement("canvas")),Yl.width=e,Yl.height=t,Yl)}function ge(){let e=typeof window<"u"&&window.devicePixelRatio||1;return Math.min(3,Math.max(1,e))}function ye(e,t,r,a){t&&"transparent"!==t&&"none"!==t?(e.fillStyle=t,e.fillRect(0,0,r,a)):e.clearRect(0,0,r,a)}function be(e={},t){let r,{background:a="transparent",stroke:i="#000",lineWidth:n=1.5,spacing:o=6,angle:s=45,lineOpacity:l=1}=e,c={background:a,stroke:i,lineWidth:n,spacing:o,angle:s,lineOpacity:l},u=pe(o),d=ge(),h=Math.max(1,Math.round(u.width*d)),p=Math.max(1,Math.round(u.height*d));try{r=me(h,p)}catch{return fe(c)}let f=r.getContext("2d");if(!f)return fe(c);ye(f,a,h,p);let m=p/u.height,g=Math.max(0,n)*m;f.save(),f.globalAlpha=Math.min(1,Math.max(0,l)),f.fillStyle=i,f.fillRect(0,u.lineY*m-g/2,h,g),f.restore();let y=(t||f).createPattern(r,"repeat");if(!y)return y;let b=s*Math.PI/180,v=Math.cos(b),w=Math.sin(b),A=u.width/h,$=u.height/p;return y.setTransform?.({a:v*A,b:w*A,c:-w*$,d:v*$,e:0,f:0}),y}function ve(e,t=2166136261){let r=t;for(let t=0;t<e.length;t++)r^=e.charCodeAt(t),r=Math.imul(r,16777619);return r>>>0}function we(e){return"object"==typeof e&&null!==e&&"hatch"===e.type}function Ae(e){return["hatch",e.background??"transparent",e.stroke??"#000",e.lineWidth??1.5,e.spacing??6,e.angle??45,e.lineOpacity??1].join("|")}function $e(e,t){return`${e}-hatch-${ve(Ae(t)).toString(36)}`}function xe(e,t){let r=e.length,a=t.length,i=new Array(a+1);for(let e=0;e<=a;e++)i[e]=e;for(let n=1;n<=r;n++){let r=i[0];i[0]=n;for(let o=1;o<=a;o++){let a=i[o];i[o]=e[n-1]===t[o-1]?r:1+Math.min(r,i[o],i[o-1]),r=a}}return i[a]}function Ce(e,t,r=3){let a,i=r+1;for(let r of t){let t=xe(e.toLowerCase(),r.toLowerCase());t<i&&(i=t,a=r)}return i<=r?a:void 0}function Se(e){if(e.length<=3)return[...e];let t=Math.floor(e.length/2);return[e[0],e[t],e[e.length-1]]}function ke(e,t){if(0===t.length)return null;let r=e.toLowerCase();return t.find(e=>e.toLowerCase().includes(r)||r.includes(e.toLowerCase()))||(Ce(e,t,3)??null)}function Re(e){return` Or use a function: ${e}={d => d.myValue}.`}function Pe({componentName:e,data:t,accessors:r,requiredProps:a}){if(a)for(let[t,r]of Object.entries(a))if(null==r)return`${e}: ${t} is required. Provide a field name or function.`;if(null==t)return null;if(!Array.isArray(t)&&"object"==typeof t)return`${e}: data should be an array, but received an object. If this is hierarchical data, use TreeDiagram, Treemap, or CirclePack instead.`;if(!Array.isArray(t)||0===t.length)return`${e}: No data provided. Pass a non-empty array to the data prop.`;if(r){let a=Se(t).find(e=>e&&"object"==typeof e);if(a){let t=Object.keys(a);for(let[i,n]of Object.entries(r))if(n&&"string"==typeof n&&!(n in a)){let r=ke(n,t),a=r?` Try ${i}="${r}".`:"";return`${e}: ${i} "${n}" not found in data. Available fields: ${t.join(", ")}.${a}`+Re(i)}}}return null}function Ne({componentName:e,data:t,dataLabel:r="data"}){return null==t?`${e}: No ${r} provided. Pass a hierarchical object with children: { name: "root", children: [...] }.`:Array.isArray(t)?`${e}: ${r} should be a single root object, not an array. Expected: { name: "root", children: [...] }. If you have flat data, use LineChart, BarChart, or Scatterplot instead.`:null}function Ee({componentName:e,nodes:t,edges:r,nodesRequired:a=!1,edgesRequired:i=!0,accessors:n}){if(null==t&&null==r)return null;if(i&&(!r||!Array.isArray(r)||0===r.length))return`${e}: No edges provided. Pass a non-empty array: edges={[{ source: "A", target: "B", value: 10 }, ...]}.`;if(a&&(!t||!Array.isArray(t)||0===t.length))return`${e}: No nodes provided. Pass a non-empty array: nodes={[{ id: "A" }, { id: "B" }, ...]}.`;if(n&&t&&t.length>0){let r=Se(t).find(e=>e&&"object"==typeof e);if(r){let t=Object.keys(r);for(let[a,i]of Object.entries(n))if(i&&"string"==typeof i&&!(i in r)){let r=ke(i,t),n=r?` Try ${a}="${r}".`:"";return`${e}: ${a} "${i}" not found in node data. Available fields: ${t.join(", ")}.${n}`+Re(a)}}}return null}function Te(e){return Zl.has(e)}function Ie(e,t){return Te(e)&&!Ql[t].includes(e)}function Me(e){let[t,r]=Array.isArray(e)?e:[e,void 0],a=ec[t],i=Array.isArray(a)?[...a]:a;return void 0===r?{type:i}:{type:i,enum:[...tc[r]]}}function Oe(){return Object.fromEntries(ac.map(([e,t,r,a,i],n)=>[Xl[n],{required:[...e],dataShape:t,dataAccessors:[...r],props:Object.fromEntries(Object.entries(Object.assign({},...a.map(e=>rc[e]),i)).map(([e,t])=>[e,Me(t)]))}]))}function Fe(e){if(!Array.isArray(e))return[];let t=[];return e.forEach((e,r)=>{if(e&&"object"==typeof e&&!Array.isArray(e))for(let a of Object.keys(e)){if(oc(a))continue;let i=e.orient;t.push({index:r,..."string"==typeof i&&{orient:i},key:a,suggestion:Ce(a,nc)})}}),t}function je(e,t){let r=Array.isArray(t)?t:[t],a=Array.isArray(e)?"array":typeof e;return r.includes(a)}function Le(e,t){return"mechanical"===t.mode&&("GaltonBoardChart"===e||"UnitPileChart"===e)}function ze(e){if(!Array.isArray(e.thresholds))return[];let t=[];return 0===e.thresholds.length&&t.push('"thresholds" for GaugeChart must contain at least one { value, color, label? } object.'),e.thresholds.forEach((e,r)=>{if(!e||"object"!=typeof e||Array.isArray(e))return void t.push(`"thresholds[${r}]" for GaugeChart should be an object with numeric "value" and string "color".`);let a=e;("number"!=typeof a.value||!Number.isFinite(a.value))&&t.push(`"thresholds[${r}].value" is required for GaugeChart and must be a finite number. BigNumber's "at" threshold key is not supported here.`),("string"!=typeof a.color||0===a.color.length)&&t.push(`"thresholds[${r}].color" is required for GaugeChart and must be a non-empty string.`),void 0!==a.label&&"string"!=typeof a.label&&t.push(`"thresholds[${r}].label" for GaugeChart should be a string.`);let i=Object.keys(a).filter(e=>"value"!==e&&"color"!==e&&"label"!==e);i.length>0&&t.push(`"thresholds[${r}]" has unsupported GaugeChart key(s): ${i.join(", ")}. Use { value, color, label? }; { at, level } belongs to BigNumber.`)}),t}function Be(e){let t=e.frameProps;return null==t||"object"!=typeof t||Array.isArray(t)?[]:[...De(t.axes,"frameProps.axes"),..._e(t)]}function De(e,t){return Fe(e).map(({index:e,key:r,suggestion:a})=>`Unknown "${t}[${e}]" key "${r}" is ignored.`+(a?` Did you mean "${a}"?`:""))}function _e(e){let t=e.legendLayout;if(null==t||"object"!=typeof t||Array.isArray(t))return null==t?[]:['"frameProps.legendLayout" should be object, got '+(Array.isArray(t)?"array":typeof t)+"."];let r=[],a=t,i=/* @__PURE__ */new Set(["align",...Object.keys(lc)]);for(let e of Object.keys(a))i.has(e)||r.push(`Unknown "frameProps.legendLayout" key "${e}". Valid keys: ${[...i].join(", ")}.`);void 0!==a.align&&"string"!=typeof a.align?r.push(`"frameProps.legendLayout.align" should be string, got ${Array.isArray(a.align)?"array":typeof a.align}.`):"string"==typeof a.align&&!sc.has(a.align)&&r.push(`"frameProps.legendLayout.align" value "${a.align}" is not valid. Expected one of: ${[...sc].join(", ")}.`);for(let[e,t]of Object.entries(lc)){let i=a[e];void 0!==i&&("number"==typeof i&&Number.isFinite(i)?i<t.minimum&&r.push(`"frameProps.legendLayout.${e}" should be ${t.label} (minimum ${t.minimum}), got ${i}.`):r.push(`"frameProps.legendLayout.${e}" should be ${t.label}, got ${Array.isArray(i)?"array":typeof i}.`))}return r}function Ue(e,t){let r=[];(null==t||"object"!=typeof t)&&(t={});let a=ic[e];if(!a)return{valid:!1,errors:[`Unknown component "${e}". Valid components: ${Object.keys(ic).join(", ")}`]};for(let i of a.required)(void 0===t[i]||null===t[i])&&r.push(`"${i}" is required for ${e}.`);"array"===a.dataShape&&Object.prototype.hasOwnProperty.call(a.props,"data")&&!a.required.includes("data")&&!Le(e,t)&&(void 0===t.data||null===t.data)&&r.push(`"data" is required for ${e}.`);for(let[e,i]of Object.entries(t)){if(null==i)continue;let t=a.props[e];if(t){if(!je(i,t.type)){let a=Array.isArray(t.type)?t.type.join(" | "):t.type;r.push(`"${e}" should be ${a}, got ${Array.isArray(i)?"array":typeof i}.`);continue}t.enum&&"string"==typeof i&&!t.enum.includes(i)&&r.push(`"${e}" value "${i}" is not valid. Expected one of: ${t.enum.join(", ")}.`)}}let i=Object.keys(a.props),n=new Set(i);for(let a of Object.keys(t))if(void 0!==t[a]&&!n.has(a)){let t=Ce(a,i),n=t?`Unknown prop "${a}" for ${e}. Did you mean "${t}"?`:`Unknown prop "${a}" for ${e}. Valid props: ${i.join(", ")}.`;r.push(n)}if(n.has("axes")&&r.push(...De(t.axes,"axes")),"array"===a.dataShape){let i=t.data,n={};for(let e of a.dataAccessors){let r=t[e];"string"==typeof r&&(n[e]=r)}let o=Pe({componentName:e,data:i,accessors:Object.keys(n).length>0?n:void 0});o&&r.push(o)}else if("object"===a.dataShape){let a=Ne({componentName:e,data:t.data});a&&r.push(a)}else if("network"===a.dataShape){let i=t.nodeIdAccessor??t.nodeIDAccessor??"id",n="string"==typeof i?{nodeIdAccessor:i}:void 0,o=Ee({componentName:e,nodes:t.nodes,edges:t.edges,nodesRequired:a.required.includes("nodes"),edgesRequired:a.required.includes("edges"),accessors:n});o&&r.push(o)}return"GaugeChart"===e&&r.push(...ze(t)),"ScatterplotMatrix"===e&&null!=t.frameProps&&r.push('"frameProps" is not supported for ScatterplotMatrix; configure its matrix props directly.'),r.push(...Be(t)),{valid:0===r.length,errors:r}}function Ge(e){let t=e>>>0;return function(){t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function He(e){if(null==e)return null;let t=e;return t.data??t.datum??e}function Ve(e){let t=Number(e);return Number.isFinite(t)?Math.max(0,t):0}function qe(e,t={}){let r=[],a=e.tokenSemantics,i=e.countStrategy,n=t.maxRecommendedTokens??("fixed-denominator"===i&&Ve(e.denominator)<=100?100:80);return a||r.push({code:"TOKEN_SEMANTICS_UNCLEAR",severity:"warning",message:"Every tokenized encoding should state what one token represents."}),i||r.push({code:"MISSING_COUNT_STRATEGY",severity:"warning",message:"Every tokenized encoding should state how token counts are produced."}),("icon"===e.tokenType||"glyph"===e.tokenType)&&("icon-only"===e.labelPolicy||"token-only"===e.labelPolicy)&&r.push({code:"ICON_ONLY_LABELS",severity:"warning",message:"Icons should supplement text labels, not replace them."}),null!=t.visibleTokens&&t.visibleTokens>n&&r.push({code:"TOO_MANY_VISIBLE_TOKENS",severity:"warning",message:`This encoding renders ${t.visibleTokens} visible tokens. Consider unitizing, sampling, or a hybrid bar/token view.`}),"decorative"===a&&("icon"===e.tokenType||"glyph"===e.tokenType)&&r.push({code:"DECORATIVE_PICTOGRAPHS",severity:"warning",message:"Decorative pictographs can harm recall and speed when they do not clarify the data."}),"unitized-measure"===a&&i&&"unitized"!==i&&r.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Unitized measures should use the unitized count strategy so each token has a stable value."}),"risk-case"===a&&i&&"fixed-denominator"!==i&&r.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Risk cases are usually clearest as a fixed-denominator natural frequency."}),("possible-outcome"===a||"posterior-sample"===a||"hypothetical-case"===a)&&i&&"quantile"!==i&&"sample"!==i&&"posterior-sample"!==i&&"random-sample"!==i&&r.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Outcome/sample tokens should come from quantiles or samples, not from a unitized magnitude."}),"unitized-measure"===a&&"unitized"===i&&null==e.unitValue&&null==e.unit&&r.push({code:"MISSING_UNIT_VALUE",severity:"warning",message:"Unitized measures should set unitValue so each token has a declared value."}),"unitized-measure"===a&&"unitized"===i&&!e.unitMeaning&&r.push({code:"MISSING_UNIT_MEANING",severity:"info",message:"Add unitMeaning so readers know what one full token represents."}),r}function We(e){return"string"==typeof e?.type?e.type:""}function Ye(e){return!!e&&"object"==typeof e&&Ic.has(We(e))}function Ke(e){return Array.isArray(e?.disable)&&e.disable.includes("connector")}function Je(e){return Mc.has(We(e))&&!Ke(e)}function Xe(e,t,r={}){if("number"==typeof r.maxAnnotations&&Number.isFinite(r.maxAnnotations))return Math.max(0,Math.floor(r.maxAnnotations));if(!(e>0&&t>0))return 1/0;let a=r.areaPerAnnotation&&r.areaPerAnnotation>0?r.areaPerAnnotation:2e4;return Math.max(1,Math.round(e*t/a))}function Ze(e){let t=e.provenance,r=e.id??e.stableId??t?.stableId;return null==r||""===r?void 0:String(r)}function Qe(e){return e.length<=5?1:2}function et(e,{dataKeys:t=[],accessorFields:r=[]}={}){if(!Array.isArray(e))return[];let a=/* @__PURE__ */new Set([...t,...r]),i=[];return e.forEach((e,t)=>{if(e&&"object"==typeof e&&!Array.isArray(e))for(let r of Object.keys(e)){if(Fc.has(r)||a.has(r)||r.startsWith("_")||r.length<3)continue;let n,o=Qe(r)+1;for(let e of Oc){let t=xe(r.toLowerCase(),e.toLowerCase());t<o&&(n=e,o=t)}if(!n)continue;let s=e.type;i.push({index:t,type:"string"==typeof s?s:"",key:r,suggestion:n})}}),i}function tt(e,t,r){let a=Array.isArray(t.annotations)?t.annotations:null;if(a)for(let e of a)!e||"object"!=typeof e||"widget"!==We(e)||null==e.content||Ze(e)||r.push({severity:"warning",code:"ANNOTATION_INTERACTIVE_ID",message:"An interactive widget annotation has no stable id, so its activation cannot be normalized or replayed reliably.",fix:"Add id, stableId, or provenance.stableId to the widget annotation. Do not identify interactive annotations by array index."})}function rt(e,t,r){let a=Array.isArray(t.annotations)?t.annotations:null;if(a)for(let e of a){if(!e||"object"!=typeof e)continue;let t=We(e);if(!Ye(e)||"widget"===t)continue;let a="number"==typeof e.dx?e.dx:0,i="number"==typeof e.dy?e.dy:0,n=Math.hypot(a,i),o="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:t,s=Je(e);!s&&n>120?r.push({severity:"warning",code:"ANNOTATION_FAR_NO_CONNECTOR",message:`Annotation "${o}" sits ~${Math.round(n)}px from its anchor with no connector — a reader can't tell what it refers to.`,fix:'Add a connector (connector: { end: "arrow" }, the label/callout default) or place the note adjacent to its target (smaller dx/dy).'}):s&&n>250&&r.push({severity:"warning",code:"ANNOTATION_LONG_CONNECTOR",message:`Annotation "${o}" uses a very long connector (~${Math.round(n)}px); prefer placing the note adjacent to its target when space allows.`,fix:"Reduce dx/dy so the note sits near its target, or keep the long connector only if proximity is genuinely infeasible."})}}function at(e,t,r){let a=Array.isArray(t.annotations)?t.annotations:null;if(!a)return;let i=a.filter(Ye).length;if(0===i)return;let n="number"==typeof t.width?t.width:600,o="number"==typeof t.height?t.height:400,s=Xe(n,o);!Number.isFinite(s)||i<=s||r.push({severity:"warning",code:"ANNOTATION_DENSITY",message:`${i} note annotations on a ${n}×${o} chart exceed the ~${s} notes the plot area carries comfortably — the chart may read as cluttered.`,fix:'Mark the essential notes emphasis: "primary" and let density management shed the rest (autoPlaceAnnotations: { density: true }), enable progressive disclosure to reveal secondary notes on hover, or give the chart more room.'})}function it(e,t,r){if(!Array.isArray(t.annotations)||0===t.annotations.length)return;let a=/* @__PURE__ */new Set;for(let e of[t.data,t.nodes,t.edges,t.points,t.areas])if(Array.isArray(e))for(let t of e)if(t&&"object"==typeof t)for(let e of Object.keys(t))a.add(e);let i=Object.entries(t).filter(([e,t])=>/Accessor$|By$/.test(e)&&"string"==typeof t).map(([,e])=>e);for(let e of et(t.annotations,{dataKeys:a,accessorFields:i})){let t=e.type?` ${e.type}`:"";r.push({severity:"warning",code:"ANNOTATION_UNKNOWN_FIELD",message:`annotations[${e.index}]${t} has an unknown field "${e.key}", which no renderer reads.`,fix:`Did you mean "${e.suggestion}"? Rename the field; unknown annotation fields are ignored.`})}}function nt(e,t,r){for(let e of jc){let a=t[e];if(!Array.isArray(a)||a.length<2)continue;let[i,n]=a;"number"!=typeof i||"number"!=typeof n||i>n&&r.push({severity:"warning",code:"INVERTED_AXIS",message:`${e}=[${i}, ${n}] is descending — the axis renders inverted, so "up" reads as less. Inverted axes are a classic misleading-design pattern unless the inversion is the point.`,fix:`Order the extent ascending (${e}={[${n}, ${i}]}). If the inversion is deliberate (e.g. rank #1 at top), say so in the title or an annotation so readers aren't misled.`})}}function ot(e,t,r){if("MultiAxisLineChart"!==e)return;let a=t.series;if(!Array.isArray(a)||2!==a.length)return;let i=a.filter(e=>!e||"object"!=typeof e||"string"!=typeof e.label||0===e.label.trim().length);i.length>0&&r.push({severity:"warning",code:"DUAL_AXIS_UNLABELED",message:`Dual-axis chart with ${i.length} unlabeled series. Two y-scales invite false equivalence between the lines; without per-series labels a reader can't tell which scale is whose.`,fix:'Give every series a label: series={[{ yAccessor: "a", label: "Revenue ($)" }, { yAccessor: "b", label: "Users" }]} — and consider whether two separate charts read more honestly.'})}function st(e,t,r){if(!pc.has(e))return;let a=t.xExtent;if(!Array.isArray(a)||a.length<2)return;let[i,n]=a;if("number"!=typeof i||"number"!=typeof n||i>=n)return;let o=t.data;if(!o||!Array.isArray(o)||o.length<4)return;let s=t.xAccessor??"x";if("string"!=typeof s)return;let l=1/0,c=-1/0;for(let e of o){let t=e?.[s];"number"!=typeof t||!Number.isFinite(t)||(t<l&&(l=t),t>c&&(c=t))}if(!Number.isFinite(l)||!Number.isFinite(c)||c<=l)return;let u=c-l,d=Math.max(0,Math.min(n,c)-Math.max(i,l))/u;d<.7&&r.push({severity:"warning",code:"CHERRY_PICKED_WINDOW",message:`xExtent=[${i}, ${n}] shows only ~${Math.round(100*d)}% of the data's x range [${l}, ${c}] — a trend cropped to a favorable window is a classic misleading-design pattern.`,fix:'Widen xExtent to cover the data, filter the data itself so the chart shows what it has, or annotate the visible window ("Q4 only") so the cropping is explicit.'})}function lt(e,t,r){let a=yc[e],i=vc[e];if(!a&&!i||i&&!t.normalize)return;let n=a??i,o=t[n],s="string"==typeof o?o:"yAccessor"===n?"y":"value",l=t.data;if(!l||!Array.isArray(l)||0===l.length)return;let c=l.filter(e=>{let t=e?.[s];return"number"==typeof t&&t<0});c.length>0&&r.push({severity:a?"error":"warning",code:"PART_TO_WHOLE_NEGATIVE",message:`${c.length} negative value(s) in "${s}" — a part-to-whole encoding cannot represent negative parts${a?"; slice angles/areas for negatives are meaningless":"; normalized shares distort when parts are negative"}.`,fix:a?"Filter or transform negative values first, or switch to a BarChart/WaterfallChart, which encode signed values honestly.":"Drop normalize for signed data, or use a diverging BarChart so negative contributions read as negative."})}function ct(e,t,r){mc.has(e)&&"basis"===t.curve&&r.push({severity:"warning",code:"NON_PASSING_CURVE",message:'curve="basis" draws a B-spline that does NOT pass through your data points — rendered values differ from actual values everywhere except the endpoints.',fix:'Use curve="monotoneX" or curve="catmullRom" (both interpolate through every point), or keep "basis" only for deliberately schematic, clearly-labeled smoothing.'})}function ut(e,t,r){if("LineChart"!==e&&"AreaChart"!==e||"sparkline"===t.mode||t.responsiveWidth||t.responsiveHeight)return;let a="number"==typeof t.width?t.width:600,i="number"==typeof t.height?t.height:400;if(a<=0||i<=0)return;let n=a/i;if(n>8||n<.25){let e=n>8?"flattens":"exaggerates";r.push({severity:"warning",code:"EXTREME_ASPECT_RATIO",message:`${a}×${i} (${n.toFixed(1)}:1) is an extreme aspect ratio that ${e} the slopes a reader perceives — aspect-ratio distortion is a documented misleading-design pattern.`,fix:n>8?'Use a more balanced aspect (e.g. width/height between 1 and 3), or set mode="sparkline" if this is genuinely a sparkline strip.':"Use a more balanced aspect (e.g. width/height between 1 and 3); very tall trend charts overstate every change."})}}function dt(e,t,r){if(!gc.has(e))return;let a=t.data;if(!a||!Array.isArray(a)||0===a.length)return;let i=t.categoryAccessor,n="string"==typeof i?i:"category",o=/* @__PURE__ */new Set;for(let e of a){let t=e?.[n];null!=t&&o.add(t)}o.size>8&&r.push({severity:"warning",code:"PIE_TOO_MANY_SLICES",message:`${o.size} slices — angle judgments degrade rapidly past ~8 categories (Cleveland & McGill), and thin slices become unreadable and unlabelable.`,fix:`Use a BarChart or DotPlot for ${o.size} categories, or group the long tail into an "Other" slice before charting.`})}function ht(e,t,r){if(!dc.has(e)&&!uc.has(e)&&!/^(Process|Network)(Sankey|CustomChart)$/.test(e))return;let a=t.perspective;"ProcessSankey"===e&&a&&"flat"!==a&&"flat"!==a.type&&r.push({severity:"warning",code:"PERSPECTIVE_MEASURED_POSITION",message:"ProcessSankey positions flows on a time axis; perspective foreshortens it, so equal durations stop looking equal.",fix:"Keep ProcessSankey flat when readers compare durations, or pair it with a flat view."}),void 0!==t.projection&&r.push({severity:"warning",code:"NETWORK_PROJECTION_PROP",message:`${e} has no projection prop (that is the geo map projection).`,fix:'Use perspective instead, e.g. perspective="isometric".'})}function pt(e,t,r){return"function"==typeof r?r(e,t):e[r]}function ft(e){if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?t:null}let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function mt(e,t,r){return Math.max(t,Math.min(r,e))}function gt(e,t){let r=ft(e);return null!=r&&r>0?r:t}function yt(e){if(!e)return;let t=ft(e[0]),r=ft(e[1]);return null!=t&&null!=r?t<=r?[t,r]:[r,t]:void 0}function bt(e={}){let t=(e.categories?.length?e.categories:["Intake","Review","Build","Ship"]).map(e=>String(e).trim()).filter(Boolean),r=t.length?t:["Intake"],a=Math.max(r.length,Math.round(e.count??Math.max(48,12*r.length))),i=gt(e.unitValue,1),n=Ge(e.seed??1),o=e.idPrefix??"mechanical-pile",s=r.map(()=>.65+.9*n()),l=s.reduce((e,t)=>e+t,0)||1,c=a-r.length,u=s.map(e=>e/l*c),d=u.map(e=>1+Math.floor(e)),h=a-d.reduce((e,t)=>e+t,0),p=u.map((e,t)=>({index:t,fraction:e-Math.floor(e)})).sort((e,t)=>t.fraction-e.fraction);for(let e=0;h>0;e=(e+1)%p.length)d[p[e].index]+=1,h-=1;return r.map((e,t)=>({id:`${o}-${t}`,category:e,value:d[t]*i,mechanical:!0,unitCount:d[t],unitValue:i,share:d[t]/a}))}function vt(e,t){let r=e/t,a=Math.round(r);return Math.ceil(a>0&&Math.abs(r-a)<=Number.EPSILON*r*4?a:r)}function wt(e,t,r=0){let a=new Set(e.filter(e=>null!=e.id).map(e=>String(e.id))),i=/* @__PURE__ */new Map;for(let n of e){let e=null==n.id?`${t}-${r++}`:String(n.id);for(;null==n.id&&a.has(e);)e=`${t}-${r++}`;a.add(e),i.set(e,null==n.id?{...n,id:e}:n)}return{seed:e,rows:Array.from(i.values()),nextId:r}}function At(e){let t=e instanceof Date?e.getTime():Number(e);return Number.isFinite(t)?t:null}function $t(e,t,r){return"function"==typeof t?t(e):e?.["string"==typeof t?t:r]}function xt(e,t,r){if(kc.has(e)){if("GaltonBoardChart"===e){let e=t.bins;"number"==typeof e&&e<2&&r.push({severity:"error",code:"PHYSICS_BAD_BINS",message:`bins=${e} leaves no meaningful settled projection for a Galton board.`,fix:"Use at least two bins; 8-24 bins is a practical range for physics distributions."});let a=At(t.branchProbability);null!=t.branchProbability&&(null==a||a<0||a>1)&&r.push({severity:"error",code:"PHYSICS_BAD_BRANCH_PROBABILITY",message:`branchProbability=${String(t.branchProbability)} must be between 0 and 1.`,fix:"Use branchProbability={0.5} for a balanced Galton board, or bias it within the [0, 1] range."});let i=At(t.mechanicalCount);null!=t.mechanicalCount&&(null==i||i<=0)&&r.push({severity:"error",code:"PHYSICS_BAD_MECHANICAL_COUNT",message:`mechanicalCount=${String(t.mechanicalCount)} cannot generate a mechanical Galton board.`,fix:"Use a positive mechanicalCount, for example 96."})}if("EventDropChart"===e){let e=t.windows,a=e&&"object"==typeof e?At(e.size):null;null!=a&&a<=0&&r.push({severity:"error",code:"PHYSICS_BAD_WINDOW_SIZE",message:`windows.size=${a} cannot form event-time barriers.`,fix:"Set windows={{ size: positiveNumber }} so each event can settle into a real time window."}),"number"==typeof t.timeScale&&t.timeScale<=0&&r.push({severity:"error",code:"PHYSICS_BAD_TIME_SCALE",message:`timeScale=${t.timeScale} prevents arrival replay from advancing.`,fix:"Use a positive timeScale, or omit it for the default pace."});let i=Array.isArray(t.data)?t.data:[];if(i.length>0){let e=t.timeAccessor||"time",a=t.arrivalAccessor||"arrivalTime";i.some(t=>{let r=At($t(t,e,"time")),i=At($t(t,a,"arrivalTime"));return null!=r&&null!=i&&r!==i})||r.push({severity:"warning",code:"PHYSICS_EVENTDROP_NO_ARRIVAL_SPREAD",message:"EventDropChart data does not show distinct arrival times, so the physics replay collapses to event order.",fix:"Provide an arrivalAccessor field with event-arrival times when demonstrating lateness, watermarks, or out-of-order streams."})}}if("UnitPileChart"===e){let e="mechanical"===(t.simulationMode??t.mode),a=At(t.mechanicalCount);null!=t.mechanicalCount&&(null==a||a<=0)&&r.push({severity:"error",code:"PHYSICS_BAD_MECHANICAL_COUNT",message:`mechanicalCount=${String(t.mechanicalCount)} cannot generate a mechanical pile chart.`,fix:"Use a positive mechanicalCount, for example 80."}),e&&Array.isArray(t.mechanicalCategories)&&0===t.mechanicalCategories.length&&r.push({severity:"error",code:"PHYSICS_EMPTY_MECHANICAL_CATEGORIES",message:"mechanicalCategories=[] leaves no containers for the generated unit pile.",fix:"Provide at least one category label, or omit mechanicalCategories for the default set."});let i=ft(t.unitValue??1);if(null==i||i<=0)return void r.push({severity:"error",code:"PHYSICS_BAD_UNIT_VALUE",message:`unitValue=${t.unitValue} cannot unitize values into physical bodies.`,fix:"Set unitValue to a positive number represented by one body."});let n=e?bt({count:a??void 0,categories:Array.isArray(t.mechanicalCategories)?t.mechanicalCategories:void 0,seed:ft(t.seed)??1,unitValue:i}):Array.isArray(t.data)?t.data:[],{rows:o}=wt(n,"pile"),s=t.valueAccessor??(e?"value":void 0),l=o.reduce((e,t,r)=>{let a="function"==typeof s?s(t,r):"string"==typeof s&&s?t[s]:1;return e+vt(Math.max(0,ft(a)??0),i)},0);l>1500&&r.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`UnitPileChart would create about ${l} live bodies; motion may dominate the chart and stress the frame budget.`,fix:"Sample or aggregate source records, or use a bounded window with sediment. A larger unitValue reduces full circles but still leaves at least one body per positive source record."})}if("CollisionSwarmChart"===e){if((At(t.pointRadius??5)??5)<=0&&r.push({severity:"error",code:"PHYSICS_BAD_POINT_RADIUS",message:`pointRadius=${t.pointRadius} cannot produce collision bodies.`,fix:"Use a positive pointRadius, for example 5."}),(At(t.collisionIterations??6)??6)<=0&&r.push({severity:"error",code:"PHYSICS_BAD_COLLISION_ITERATIONS",message:`collisionIterations=${t.collisionIterations} disables collision relaxation.`,fix:"Use at least one collision iteration; 4-8 is a practical range for swarms."}),null!=t.xExtent){let e=Array.isArray(t.xExtent)?t.xExtent:[],a=At(e[0]),i=At(e[1]);(e.length<2||null==a||null==i)&&r.push({severity:"error",code:"PHYSICS_BAD_X_EXTENT",message:"xExtent must be a numeric [min, max] pair for CollisionSwarmChart.",fix:"Pass xExtent={[min, max]} or omit it so the chart infers the domain from data."})}let e=Array.isArray(t.data)?t.data:[];e.length>1200&&r.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`CollisionSwarmChart would create ${e.length} live bodies; collision relaxation may dominate the frame budget.`,fix:"Sample, aggregate, reduce point radius, or move to a static SwarmPlot when every row does not need a physical body."});let a=t.groupAccessor;if(e.length>0&&a){let t=/* @__PURE__ */new Set;for(let r of e){let e=$t(r,a,"group");null!=e&&t.add(e)}t.size>12&&r.push({severity:"warning",code:"PHYSICS_TOO_MANY_SWARM_LANES",message:`CollisionSwarmChart has ${t.size} group lanes, which leaves little vertical room for collision separation.`,fix:"Facet or filter groups, or use an ordinary SwarmPlot/BoxPlot for dense grouped comparison."})}}if(("GaltonBoardChart"===e||"UnitPileChart"===e||"CollisionSwarmChart"===e||"ProcessFlowChart"===e||"EventDropChart"===e)&&(null!=t.massBy||null!=t.massAccessor||t.frameProps&&"object"==typeof t.frameProps&&null!=t.frameProps.bodyMassBy)&&r.push({severity:"warning",code:"PHYSICS_DATA_IN_DYNAMICS",message:`${e} appears to map a data field to mass/dynamics. Mass is not a readable quantitative channel.`,fix:"Encode quantities in spawn position, bin, size, color, or glyph — keep mass/friction/restitution as process texture. Use showProjection for the truth layer."}),("UnitPileChart"===e||"GaltonBoardChart"===e||"CollisionSwarmChart"===e||"ProcessFlowChart"===e||"CrucibleChart"===e)&&!1===t.showProjection&&r.push({severity:"warning",code:"PHYSICS_NO_PROJECTION",message:`${e} has showProjection={false}. Without a settled projection, motion is easy to over-read as data.`,fix:"Keep showProjection enabled (default) so the chart collapses to a legible static reading, or document why the process alone is the claim."}),"ProcessFlowChart"===e){let e=Array.isArray(t.stages)?t.stages:[];if(0===e.length)r.push({severity:"error",code:"PROCESS_FLOW_MISSING_STAGES",message:"ProcessFlowChart requires a non-empty stages array.",fix:'Provide stages={[{ id: "coding", force: 12 }, { id: "merged", absorb: true }]}.'});else{e.some(e=>!e||null==e.id||""===String(e.id).trim())&&r.push({severity:"error",code:"PROCESS_FLOW_BAD_STAGE",message:"Every ProcessFlowChart stage needs a stable id.",fix:'Use stages like { id: "review", label: "Review", capacity: { unitsPerSecond: 4 } }.'});let a=e.filter(e=>e?.absorb).length;t.groupBy&&0===a&&r.push({severity:"warning",code:"PROCESS_FLOW_GROUP_NO_ABSORB",message:"groupBy is set but no stage has absorb: true, so all-members completion cannot resolve.",fix:'Mark a terminal stage with absorb: true (e.g. merged), or set groupCompletion="none".'})}}if("GauntletChart"===e&&(Array.isArray(t.negativeProperties)||r.push({severity:"warning",code:"GAUNTLET_MISSING_NEGATIVE_PROPERTIES",message:"GauntletChart usually needs negativeProperties for drag/cost bodies (empty array is ok if intentional).",fix:'Provide negativeProperties={[{ id: "cost", label: "Cost", load: 1 }]} or explicitly pass [].'})),"CrucibleChart"===e){let e=Array.isArray(t.phases)?t.phases:[],a=Array.isArray(t.products)?t.products:[],i=Array.isArray(t.events)?t.events:[],n=Array.isArray(t.outlets)?t.outlets:[];0===e.length?r.push({severity:"error",code:"CRUCIBLE_MISSING_PHASES",message:"CrucibleChart requires an authored, non-empty phases array; a treatment program cannot be inferred from flat data.",fix:'Provide phases={[{ id: "charge", label: "Charge", duration: 1, motion: "charge" }]}.'}):e.some(e=>!e||null==e.id||""===String(e.id).trim()||null==At(e.duration)||Number(e.duration)<=0)&&r.push({severity:"error",code:"CRUCIBLE_BAD_PHASE",message:"Every CrucibleChart phase needs a stable id and a positive finite duration.",fix:'Use phases like { id: "assay", label: "Assay", duration: 2, motion: "mix" }.'}),0===a.length&&r.push({severity:"warning",code:"CRUCIBLE_NO_PRODUCTS",message:"CrucibleChart has no declared product molds. Products are never discovered from collisions or source fields.",fix:'Declare products={[{ id: "accepted", label: "Accepted", outletId: "product" }]} when the treatment forms an output.'}),0===i.length&&r.push({severity:"warning",code:"CRUCIBLE_NO_EVENTS",message:"CrucibleChart has no authored events, so its phases cannot transform, combine, split, or route the charge.",fix:"Supply an explicit events array; do not ask the chart or an AI layer to infer a treatment from the rows."}),Array.isArray(t.outlets)||r.push({severity:"warning",code:"CRUCIBLE_IMPLICIT_OUTLETS",message:"CrucibleChart is using generic default outlets rather than domain-specific destinations.",fix:"Provide reason-labelled outlets and reference their ids from products, complete-product, and eject effects."});let o=new Set(a.map(e=>e?.id).filter(e=>null!=e).map(String)),s=/* @__PURE__ */new Set(["product","retained","residue","failed","recovered",...n.map(e=>e?.id).filter(e=>null!=e).map(String)]),l=/* @__PURE__ */new Set,c=/* @__PURE__ */new Set;for(let e of i)if(e&&Array.isArray(e.effects))for(let t of e.effects){if(!t||"object"!=typeof t)continue;let e=t.type;if(("combine"===e||"contribute"===e||"complete-product"===e)&&null!=t.productId&&!o.has(String(t.productId))&&l.add(String(t.productId)),"split"===e&&Array.isArray(t.products))for(let e of t.products)null!=e?.productId&&!o.has(String(e.productId))&&l.add(String(e.productId));null!=t.outletId&&!s.has(String(t.outletId))&&c.add(String(t.outletId))}l.size>0&&r.push({severity:"error",code:"CRUCIBLE_UNKNOWN_PRODUCT",message:`CrucibleChart events reference undeclared product molds: ${[...l].sort().join(", ")}.`,fix:"Declare every referenced product id in products; do not create product definitions implicitly inside events."}),c.size>0&&r.push({severity:"error",code:"CRUCIBLE_UNKNOWN_OUTLET",message:`CrucibleChart events reference undeclared outlets: ${[...c].sort().join(", ")}.`,fix:"Declare every domain outlet in outlets and reuse its stable id in authored effects."});let u=At(t.playbackRate);null!=t.playbackRate&&(null==u||u<=0)&&r.push({severity:"error",code:"CRUCIBLE_BAD_PLAYBACK_RATE",message:`playbackRate=${String(t.playbackRate)} cannot advance the authored CrucibleChart tape.`,fix:"Use a positive playbackRate such as 0.5 for half speed or 2 for double speed."});let d=At(t.rerunMS);null!=t.rerunMS&&(null==d||d<0)&&r.push({severity:"error",code:"CRUCIBLE_BAD_RERUN_MS",message:`rerunMS=${String(t.rerunMS)} must be a finite non-negative delay or null.`,fix:"Use rerunMS={3000}, rerunMS={0}, or omit the prop for a single run."})}if("GaltonBoardChart"===e||"CollisionSwarmChart"===e||"ProcessFlowChart"===e||"EventDropChart"===e||"CrucibleChart"===e){let a=Array.isArray(t.data)?t.data:[],i=At(t.mechanicalCount)??0,n=a.length>0?a.length:i;n>2500&&r.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`${e} may spawn ~${Math.round(n)} live bodies, which can overwhelm the simulation loop.`,fix:"Lower mechanicalCount / unitize with a larger unitValue, enable sediment/windowSize, or sample the data before spawn."})}}}function Ct(e){let t=e.trim();if(!t||!Number.isNaN(Number(t)))return NaN;let r=Lc.exec(t);if(r){let e=Number(r[1]),t=Number(r[2])-1,a=Number(r[3]??1),i=/* @__PURE__ */new Date(0);return i.setUTCFullYear(e,t,a),i.getUTCFullYear()===e&&i.getUTCMonth()===t&&i.getUTCDate()===a?i.getTime():NaN}if(t.length<10)return NaN;let a=Date.parse(t);return Number.isFinite(a)?a:NaN}function St(e){if(e instanceof Date)return e.getTime();if("number"==typeof e)return Number.isFinite(e)?e:NaN;if("string"!=typeof e||!e.trim())return NaN;let t=e.trim(),r=Number(t);if(!Number.isNaN(r))return Number.isFinite(r)?r:NaN;if(/^\d{4}-\d{1,2}(?:-\d{1,2})?$/.test(t))return Ct(t);let a=/^(\d{4}-\d{2}-\d{2})[Tt ](\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)([Zz]|[+-]\d{2}:?\d{2})?$/.exec(t);return a&&Number.isFinite(Ct(a[1]))?Date.parse(`${a[1]}T${a[2]}${a[3]||"Z"}`):NaN}function kt(e){let t=[],r=e.domain,a=Array.isArray(r)?St(r[0]):NaN,i=Array.isArray(r)?St(r[1]):NaN;null==r?t.push({severity:"error",code:"PROCESS_SANKEY_MISSING_DOMAIN",message:"ProcessSankey requires domain: [tStart, tEnd].",fix:"Pass domain={[start, end]} using numbers, Dates, numeric strings, or ISO date strings."}):(!Array.isArray(r)||2!==r.length||!Number.isFinite(a)||!Number.isFinite(i)||a>i)&&t.push({severity:"error",code:"PROCESS_SANKEY_BAD_DOMAIN",message:"domain must be a 2-tuple of finite times with start <= end.",fix:"Use domain={[t0, t1]} with t0 <= t1."});let n=e.edges;if(Array.isArray(n)&&n.length>0){let e=n[0];(null==e.startTime||null==e.endTime)&&t.push({severity:"warning",code:"PROCESS_SANKEY_EDGE_TIMES",message:"Edges should carry startTime and endTime for temporal layout.",fix:"Add startTime/endTime fields or set startTimeAccessor/endTimeAccessor."})}let o=e.nodes,s=Array.isArray(o)?o.length:0;return!0===e.showLabels&&s>=24&&t.push({severity:"warning",code:"PROCESS_SANKEY_LABEL_DENSITY",message:`showLabels={true} with ${s} nodes may overcrowd the plot.`,fix:'Use showLabels="auto" with optional labelPriorityAccessor / maxLabels.'}),(Array.isArray(n)?n.length:0)>=80&&null==e.layoutExecution&&"off"!==e.packing&&t.push({severity:"warning",code:"PROCESS_SANKEY_WORKER_HINT",message:"Dense ProcessSankey layouts benefit from worker packing/order.",fix:'layoutExecution defaults to "auto"; set layoutExecution="worker" or raise layoutWorkerThreshold deliberately.'}),t}function Rt(e,t){let r=e.nestedDataAccessorProp?t[e.nestedDataAccessorProp]:void 0;return"string"==typeof r?r:e.defaultNestedDataAccessor}function Pt(e,t,r){let a=e.dataProp??"data",i=t[a],n=r??(Array.isArray(i)?i:[]),o=Rt(e,t);if(!o)return{dataProp:a,rows:n};let s=[],l=!1;for(let e of n){let t=e?.[o];if(Array.isArray(t)){l=!0;for(let e of t)e&&"object"==typeof e&&s.push(e)}}return{dataProp:a,rows:l?s:n}}function Nt(e,t,r){let a=/* @__PURE__ */new Set;for(let i of e.fields){let e=i.dataProp??"data",n=r??t[e];if(!Array.isArray(n))continue;if(0===n.length){a.add(e);continue}let o=Rt(i,t);if(!o)continue;let s=n.map(e=>e?.[o]).filter(Array.isArray);s.length>0&&s.every(e=>0===e.length)&&a.add(`${e}.${o}`)}return[...a]}function Et(){let e=globalThis;return e[Zc]??(e[Zc]={contracts:/* @__PURE__ */new Map}),e[Zc]}function Tt(e){return Et().contracts.get(e)??Xc[e]}function It(e){if("number"==typeof e)return e;if("string"!=typeof e)return;let t=e.trim();return/^[+-]?nan$/i.test(t)?NaN:/^[+-]?Infinity$/.test(t)||/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/.test(t)&&!/^[+-]?0\d+$/.test(t)?Number(t):void 0}function Mt(e){return null==e||"string"==typeof e&&""===e.trim()}function Ot(e,t,r){let a={numbers:r?[]:void 0,finite:0,min:1/0,max:-1/0,missing:0,nonFinite:0,nonNumeric:0,zero:0,negative:0,fractional:0};for(let r of e){let e=r?.[t];if(Mt(e)){a.missing++;continue}let i=It(e);void 0!==i?Number.isFinite(i)?(a.numbers?.push(i),a.finite++,i<a.min&&(a.min=i),i>a.max&&(a.max=i),0===i&&a.zero++,i<0&&a.negative++,Number.isInteger(i)||a.fractional++):a.nonFinite++:a.nonNumeric++}return a}function Ft(e,t){if(0===e.length)return;let r=(e.length-1)*t,a=Math.floor(r),i=Math.ceil(r);if(a===i)return e[a];let n=r-a;return e[a]*(1-n)+e[i]*n}function jt(e,t={}){if(!Array.isArray(e)||0===e.length)return{};let r=/* @__PURE__ */new Set;for(let t of e)if(t&&"object"==typeof t)for(let e of Object.keys(t))r.add(e);let a={};for(let i of r){let r=Ot(e,i,!1!==t.quantiles),n=r.numbers?.sort((e,t)=>e-t);a[i]={field:i,observedCount:e.length-r.missing,finiteCount:r.finite,missingCount:r.missing,nonFiniteCount:r.nonFinite,nonNumericCount:r.nonNumeric,zeroCount:r.zero,negativeCount:r.negative,fractionalCount:r.fractional,...r.finite>0?{min:r.min,...n?{q1:Ft(n,.25),median:Ft(n,.5),q3:Ft(n,.75)}:{},max:r.max}:{}}}return a}function Lt(e){let t=e.ok?"✓ numerically safe":"✗ numeric hazards found",r=[`${e.component}: ${t}`,`${e.rowCount} rows · ${e.summary.fieldsChecked} numeric fields · ${e.summary.errors} errors · ${e.summary.warnings} warnings`];for(let t of e.diagnoses)r.push(`${"error"===t.severity?"ERROR":"WARN"} ${t.code}${t.field?` [${t.field}]`:""}: ${t.message}`),t.fix&&r.push(` Fix: ${t.fix}`);return r.join("\n")}function zt(e){return e.code.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Bt(e,t={}){let r=Number.isFinite(t.max)?Math.max(0,Math.floor(t.max)):6,a=e.diagnoses.map((e,t)=>({item:e,diagnosisIndex:t})).filter(({item:e})=>!t.errorsOnly||"error"===e.severity),i=a.slice(0,r).map(({item:e,diagnosisIndex:t})=>({id:`data-audit:${e.code}:${e.role??"chart"}:${e.field??"chart"}:${t}`,level:e.severity,title:e.field?`${zt(e)} · ${e.field}`:zt(e),message:e.fix?`${e.message} ${e.fix}`:e.message,source:"Semiotic data audit",dismissible:!0}));return a.length>r&&i.push({id:"data-audit:overflow:chart",level:a.slice(r).some(({item:e})=>"error"===e.severity)?"error":"warning",title:`${a.length-r} more numeric finding${a.length-r===1?"":"s"}`,message:"Run auditData() or diagnoseConfig() to inspect the complete report.",source:"Semiotic data audit",dismissible:!0}),i}function Dt(e){let t=[];for(let[r,a]of Object.entries(Qc))"string"!=typeof e[r]&&"function"!=typeof e[r]||t.push({role:a,accessor:r,..."size"===a?{requirements:["finite","non-negative"]}:{},..."x"===a||"y"===a?{domain:!0}:{}});return t.length>0?{fields:t}:void 0}function _t(e,t,r){return"function"==typeof e?e(t,r):t[e]}function Ut(e,t){if("number"==typeof e)return Number.isFinite(e)?e:null;if(e instanceof Date){let r=e.getTime();return t&&Number.isFinite(r)?r:null}if("string"==typeof e){let r=e.trim(),a=Number(r);if(r&&Number.isFinite(a))return a;if("date-like"===t){let e=Ct(r);return Number.isFinite(e)?e:null}}return null}function Gt(e){return"number"==typeof e&&!Number.isFinite(e)}function Ht(e,t,r,a,i){let n={field:r,numbers:[],finiteRows:[],missingRows:[],nonFiniteRows:[],nonNumericRows:[],accessorErrorRows:[],zeroRows:[],negativeRows:[],fractionalRows:[]};for(let r=0;r<e.length;r++){let o;try{o=_t(t,e[r],r)}catch{n.accessorErrorRows.push(r);continue}if(null==o||""===o){if(void 0!==i){n.numbers.push(i),n.finiteRows.push(r),0===i&&n.zeroRows.push(r),i<0&&n.negativeRows.push(r),Number.isInteger(i)||n.fractionalRows.push(r);continue}n.missingRows.push(r);continue}let s=Ut(o,a);null!=s?(n.numbers.push(s),n.finiteRows.push(r),0===s&&n.zeroRows.push(r),s<0&&n.negativeRows.push(r),Number.isInteger(s)||n.fractionalRows.push(r)):Gt(o)?n.nonFiniteRows.push(r):n.nonNumericRows.push(r)}return n}function Vt(e,t){let r=new Set(e.requirements??["finite"]);return r.add("finite"),("x"===e.role&&"log"===t.xScaleType||"y"===e.role&&"log"===t.yScaleType)&&r.add("positive"),[...r]}function qt(e){let t=1/0,r=-1/0;for(let a of e)a<t&&(t=a),a>r&&(r=a);return[t,r]}function Wt(e,t,r){let a=[],i=/* @__PURE__ */new Set;for(let n of e.fields){if(n.whenProps?.some(e=>null==t[e]))continue;let e=t[n.accessor],o="string"==typeof e||"function"==typeof e?e:n.defaultAccessor;if("string"!=typeof o&&"function"!=typeof o)continue;let{dataProp:s,rows:l}=Pt(n,t,r);if(0===l.length)continue;let c="string"==typeof o?o:`${n.accessor}()`,u=`${s}:${n.role}:${c}`;if(i.has(u))continue;i.add(u);let d=n.temporalValues??("time"===n.role||"x"===n.role&&"time"===t.xScaleType?"date-like":void 0),h="x"===n.role&&"log"===t.xScaleType||"y"===n.role&&"log"===t.yScaleType,p=Vt(n,t);a.push({contract:n,accessor:o,accessorLabel:c,dataProp:s,rows:l,requirements:p,logScale:h,observation:Ht(l,o,c,d,n.missingValue)})}return a}function Yt(e){return e.slice(0,5)}function Kt(e){return{domain:"data",...e}}function Jt(e){let t=e.observation.numbers.map((t,r)=>({value:t,row:e.observation.finiteRows[r]})).sort((e,t)=>e.value-t.value);if(t.length<8)return[];let r=t.map(e=>e.value),a=Ft(r,.25),i=Ft(r,.75),n=Ft(r,.5),o=i-a;if(o>0){let e=a-10*o,r=i+10*o;return t.filter(t=>t.value<e||t.value>r).map(e=>e.row)}let s=100*Math.max(1,Math.abs(n));return t.filter(e=>Math.abs(e.value-n)>s).map(e=>e.row)}function Xt(e,t){let r=[],{observation:a,contract:i,accessorLabel:n,requirements:o}=e,s={field:n,role:i.role},l=[...a.nonFiniteRows,...a.nonNumericRows,...a.accessorErrorRows].sort((e,t)=>e-t);if(0===a.numbers.length)return r.push(Kt({severity:"error",code:"DEGENERATE_EXTENT",message:`${i.accessor}="${n}" produces no finite numeric values; the chart cannot resolve its ${i.role} input.`,fix:`Ensure ${n} contains finite numbers${"x"===i.role?" (or valid dates for a time scale)":""}.`,...s,...l.length>0?{rows:Yt(l),count:l.length}:{}})),r;a.nonFiniteRows.length>0&&r.push(Kt({severity:"error",code:"NON_FINITE_VALUE",message:`${n} contains ${a.nonFiniteRows.length} NaN or infinite value${1===a.nonFiniteRows.length?"":"s"}; scale and layout math require finite numbers.`,fix:`Filter or replace NaN/Infinity in ${n} before rendering.`,...s,rows:Yt(a.nonFiniteRows),count:a.nonFiniteRows.length})),!i.allowMissing&&a.missingRows.length>0&&r.push(Kt({severity:"error",code:"MISSING_NUMERIC_VALUE",message:`${n} is missing for ${a.missingRows.length} row${1===a.missingRows.length?"":"s"}; the ${i.role} role requires an explicit numeric value.`,fix:`Fill or filter missing ${n} values before rendering.`,...s,rows:Yt(a.missingRows),count:a.missingRows.length}));let c=[...a.nonNumericRows,...a.accessorErrorRows].sort((e,t)=>e-t);if(c.length>0&&r.push(Kt({severity:"error",code:"NON_NUMERIC_VALUE",message:`${n} produces ${c.length} non-numeric value${1===c.length?"":"s"} for the ${i.role} role.`,fix:`Bind ${i.accessor} to a numeric field or return finite numbers from the accessor.`,...s,rows:Yt(c),count:c.length})),i.domain&&a.numbers.length>=2){let[e,t]=qt(a.numbers);e===t&&r.push(Kt({severity:"warning",code:"ZERO_SPAN_DOMAIN",message:`${n} is constant at ${e}; its ${i.role} scale has a zero-span data domain.`,fix:`Provide varying ${i.role} values, set an explicit extent around ${e}, or use a single-value display.`,...s,rows:Yt(a.finiteRows),count:a.finiteRows.length}))}if(o.includes("positive")){let t=a.numbers.map((e,t)=>({number:e,row:a.finiteRows[t]})).filter(({number:e})=>e<=0).map(({row:e})=>e);if(t.length>0){let a=e.logScale;r.push(Kt({severity:"error",code:a?"LOG_NON_POSITIVE":"NON_POSITIVE_VALUE",message:`${n} contains ${t.length} non-positive value${1===t.length?"":"s"}, which ${a?"cannot be represented on a log scale":"violate the positive-value contract"}.`,fix:a?"Remove or transform values ≤ 0, or use a linear/symlog scale.":"Provide values greater than zero.",...s,rows:Yt(t),count:t.length}))}}if(o.includes("non-negative")&&a.negativeRows.length>0&&r.push(Kt({severity:"error",code:"size"===i.role?"NEGATIVE_SIZE":"NEGATIVE_VALUE",message:`${n} contains ${a.negativeRows.length} negative ${i.role} value${1===a.negativeRows.length?"":"s"}; the chart maps this role to non-negative geometry.`,fix:"Use a non-negative measure, clamp intentionally, or encode sign with position/color instead.",...s,rows:Yt(a.negativeRows),count:a.negativeRows.length})),o.includes("integer")){let e=[.../* @__PURE__ */new Set([...a.negativeRows,...a.zeroRows,...a.fractionalRows])].sort((e,t)=>e-t);e.length>0&&r.push(Kt({severity:"error",code:"INVALID_COUNT",message:`${n} contains ${e.length} value${1===e.length?"":"s"} that are not positive integers.`,fix:"Counts must be integers ≥ 1; aggregate, round intentionally, or use a continuous-value encoding.",...s,rows:Yt(e),count:e.length}))}if(o.includes("unit-interval")){let e=a.numbers.map((e,t)=>({number:e,row:a.finiteRows[t]})).filter(({number:e})=>e<0||e>1).map(({row:e})=>e);e.length>0&&r.push(Kt({severity:"error",code:"OUTSIDE_UNIT_INTERVAL",message:`${n} contains ${e.length} value${1===e.length?"":"s"} outside [0, 1].`,fix:`Normalize ${n} to [0, 1] before using it as ${i.role}.`,...s,rows:Yt(e),count:e.length}))}if(t&&i.domain){let t=Jt(e);t.length>0&&r.push(Kt({severity:"warning",code:"OUTLIER_DOMINATED_DOMAIN",message:`${n} has ${t.length} extreme value${1===t.length?"":"s"} beyond the 10×IQR guardrail; the main distribution may collapse visually.`,fix:"Verify the extreme values, then consider a log scale, robust extent, inset, or explicit annotation rather than silently clipping them.",...s,rows:Yt(t),count:t.length}))}return r}function Zt(e,t,r){if(!e)return"__all__";try{return String(_t(e,t,r))}catch{return"__accessor_error__"}}function Qt(e,t,r){if(e.whenProp&&!0!==r[e.whenProp])return[];let a=t.find(t=>t.contract.role===e.role);if(!a||0===a.observation.numbers.length)return[];let i=e.groupAccessor?r[e.groupAccessor]:void 0,n="string"==typeof i||"function"==typeof i?i:e.defaultGroupAccessor,o=/* @__PURE__ */new Map;for(let e=0;e<a.rows.length;e++){let t;try{t=_t(a.accessor,a.rows[e],e)}catch{continue}let r=Ut(t,void 0);if(null==r)continue;let i=Zt(n,a.rows[e],e),s=o.get(i)??{sum:0,magnitude:0,positive:!1,negative:!1,rows:[],negativeRows:[]};s.sum+=r,s.magnitude+=Math.abs(r),s.positive||(s.positive=r>0),s.negative||(s.negative=r<0),s.rows.push(e),r<0&&s.negativeRows.push(e),o.set(i,s)}let s=[],l=[],c=[],u=[],d=[],h=[];for(let[t,r]of o){let a=Math.abs(r.sum)<=Number.EPSILON*Math.max(1,r.magnitude)*10;("positive-total"===e.kind&&r.sum<=0||"normalized-total"===e.kind&&a)&&(s.push(t),u.push(...r.rows)),"normalized-total"===e.kind&&r.positive&&r.negative&&(l.push(t),d.push(...r.rows)),"normalized-total"===e.kind&&r.negative&&(c.push(t),h.push(...r.negativeRows))}let p=[];return s.length>0&&p.push(Kt({severity:"error",code:"normalized-total"===e.kind?"ZERO_NORMALIZED_TOTAL":"NON_POSITIVE_TOTAL",message:"normalized-total"===e.kind?`${s.length} normalization group${1===s.length?" has":"s have"} a zero total, so division would be undefined.`:"The part-to-whole total is not positive, so meaningful shares cannot be computed.",fix:"normalized-total"===e.kind?"Remove empty/zero-sum groups or disable normalization.":"Provide at least one positive value and ensure the total is greater than zero.",field:a.accessorLabel,role:e.role,rows:Yt([...new Set(u)].sort((e,t)=>e-t)),count:s.length})),c.length>0&&p.push(Kt({severity:"error",code:"NEGATIVE_NORMALIZED_VALUE",message:`${c.length} normalization group${1===c.length?" contains":"s contain"} negative contributions, so conventional percentage shares are not defined.`,fix:"Use non-negative contributions, a diverging stack, or disable normalization.",field:a.accessorLabel,role:e.role,rows:Yt([...new Set(h)].sort((e,t)=>e-t)),count:h.length})),l.length>0&&p.push(Kt({severity:"warning",code:"MIXED_SIGN_NORMALIZATION",message:`${l.length} normalization group${1===l.length?" mixes":"s mix"} positive and negative contributions; percentage shares may be unstable or misleading.`,fix:"Separate positive and negative contributions, use diverging stacks, or disable normalization.",field:a.accessorLabel,role:e.role,rows:Yt([...new Set(d)].sort((e,t)=>e-t)),count:l.length})),p}function er(e,t,r,a={}){let i=a.contracts??Tt(e)??Dt(t);if(!i)return{component:e,ok:!0,rowCount:r?.length??(Array.isArray(t.data)?t.data.length:0),summary:{fieldsChecked:0,errors:0,warnings:0},contracts:[],diagnoses:[]};let n=Wt(i,t,r),o=[],s=!1!==a.checkOutliers;for(let e of Nt(i,t,r))o.push(Kt({severity:"error",code:"EMPTY_DATA",message:`${e} is an explicitly empty array; there are no numeric inputs to render.`,fix:`Provide at least one valid row, render an intentional empty state, or omit ${e} when using the ref push API.`,count:0,rows:[]}));let l=new Set(n.filter(e=>e.contract.domain&&1===e.rows.length).map(e=>e.dataProp));for(let e of l)o.push(Kt({severity:"warning",code:"SINGLE_ROW_DOMAIN",message:`${e} has one row; a quantitative scale cannot establish variation from a single observation.`,fix:"Provide at least two observations or use a single-value display such as BigNumber.",count:1,rows:[0]}));for(let e of n)o.push(...Xt(e,s));for(let e of i.aggregates??[])o.push(...Qt(e,n,t));let c=o.filter(e=>"error"===e.severity).length,u=o.length-c;return{component:e,ok:0===c,rowCount:n.reduce((e,t)=>Math.max(e,t.rows.length),r?.length??(Array.isArray(t.data)?t.data.length:0)),summary:{fieldsChecked:n.length,errors:c,warnings:u},contracts:n.map(e=>({role:e.contract.role,accessor:e.accessorLabel,dataProp:e.dataProp,requirements:e.requirements,allowMissing:!0===e.contract.allowMissing,...void 0!==e.contract.missingValue?{missingValue:e.contract.missingValue}:{},domain:!0===e.contract.domain})),diagnoses:o}}function tr(e,t,r){let a=ic[e];if(a){if("array"===a.dataShape||"realtime"===a.dataShape){let e=t.data;e&&Array.isArray(e)&&0===e.length&&r.push({severity:"error",code:"EMPTY_DATA",message:"data is an empty array — chart will render blank.",fix:"realtime"===a.dataShape?"Provide at least one observation: data={[{ time: 0, value: 1 }]}, or omit data for React ref push mode.":"Provide at least one data point: data={[{ x: 1, y: 2 }]}."})}"network"===a.dataShape&&t.edges&&Array.isArray(t.edges)&&0===t.edges.length&&r.push({severity:"error",code:"EMPTY_EDGES",message:"edges is an empty array — network chart will render blank.",fix:'Provide at least one edge: edges={[{ source: "A", target: "B" }]}.'})}}function rr(e,t){for(let[r,a]of[["width",600],["height",400]]){let i=e[r];void 0!==i&&("number"!=typeof i||i<=0)&&t.push({severity:"error",code:"width"===r?"BAD_WIDTH":"BAD_HEIGHT",message:`${r}=${JSON.stringify(i)} — chart needs a positive number.`,fix:`Set ${r}={${a}}.`})}if(e.size&&Array.isArray(e.size)){let[r,a]=e.size;(null!=r&&r<=0||null!=a&&a<=0)&&t.push({severity:"error",code:"BAD_SIZE",message:`size=[${r}, ${a}] — both dimensions must be positive.`,fix:"Set size={[600, 400]}."})}}function ar(e,t,r){let a=ic[e];if(!a||"array"!==a.dataShape)return;let i=t.data;if(!i||!Array.isArray(i)||0===i.length)return;let n=i[0];if(!n||"object"!=typeof n)return;let o=Object.keys(n);for(let e of a.dataAccessors){let a=t[e];"string"==typeof a&&(a in n||r.push({severity:"error",code:"ACCESSOR_MISSING",message:`${e}="${a}" not found in data. Available fields: ${o.join(", ")}.`,fix:`Change ${e} to one of: ${o.map(e=>`"${e}"`).join(", ")}, or use a function: ${e}={d => d.myValue}.`}))}}function ir(e,t,r){uc.has(e)&&Array.isArray(t.data)&&r.push({severity:"error",code:"HIERARCHY_FLAT_ARRAY",message:`${e} expects hierarchical data but received a flat array.`,fix:'Pass a root object: data={{ name: "root", children: [...] }}. For flat data, use BarChart or LineChart.'})}function nr(e,t,r){dc.has(e)&&!t.edges&&!t.data&&r.push({severity:"error",code:"NETWORK_NO_EDGES",message:`${e} requires an edges prop.`,fix:'Provide edges={[{ source: "A", target: "B", value: 10 }]}.'})}function or(e,t,r){let a=ic[e];if(!a||"array"!==a.dataShape)return;let i=t.data;if(!i||!Array.isArray(i)||0===i.length)return;let n=i[0];if(!n||"object"!=typeof n)return;let o=t.xAccessor;"string"==typeof o&&n[o]instanceof Date&&!t.xFormat&&r.push({severity:"warning",code:"DATE_NO_FORMAT",message:`xAccessor "${o}" contains Date objects but no xFormat is provided. Axis ticks may display "[object Object]".`,fix:"Add xFormat={d => d.toLocaleDateString()} or use timestamps (d.getTime()) instead of Date objects."})}function sr(e,t,r){t.linkedHover&&!t.selection&&r.push({severity:"warning",code:"LINKED_HOVER_NO_SELECTION",message:"linkedHover is set but selection is not — this chart emits hover events but won't highlight from others.",fix:`Add selection={{ name: "${"object"==typeof t.linkedHover&&t.linkedHover.name||"hl"}" }} to receive cross-highlights.`})}function lr(e,t,r){if(!pc.has(e)||t.gapStrategy)return;let a=t.data;if(!a||!Array.isArray(a)||0===a.length)return;let i=t.yAccessor||"y";"string"==typeof i&&a.some(e=>{let t=e?.[i];return null==t||Number.isNaN(t)})&&r.push({severity:"warning",code:"DATA_GAPS",message:`Data contains null/undefined/NaN values in "${i}". Default behavior breaks the line at gaps.`,fix:'Set gapStrategy="break" (default), "interpolate", or "zero" to control gap handling.'})}function cr(e,t,r){if(!hc.has(e))return;let a=t.rExtent||t.yExtent||t.valueExtent;a&&Array.isArray(a)&&a.length>=1&&null!=a[0]&&0!==a[0]&&r.push({severity:"warning",code:"NON_ZERO_BASELINE",message:`${e} has a non-zero baseline (${a[0]}). Bar and area charts should start at zero to avoid exaggerating differences.`,fix:`Remove the custom extent minimum or set it to 0: rExtent={[0, ${a[1]??"auto"}]}. For trend-focused charts, use LineChart instead.`})}function ur(e,t,r){if(!fc.has(e))return;let a=t.barPadding;"number"==typeof a&&a<10&&r.push({severity:"warning",code:"BAR_PADDING_INVISIBLE",message:`barPadding=${a} is very small — bars may appear to have no spacing between them.`,fix:"Increase barPadding to at least 10 for visible gaps, e.g. barPadding={12}."})}function dr(e,t,r){if("Heatmap"!==e)return;let a=t.data;if(!a||!Array.isArray(a)||0===a.length)return;let i=a[0];if(i&&"object"==typeof i)for(let e of["xAccessor","yAccessor"]){let a=t[e];if("string"!=typeof a)continue;let n=i[a];"string"==typeof n&&r.push({severity:"warning",code:"HEATMAP_STRING_ACCESSOR",message:`${e}="${a}" resolves to string values (e.g. "${n}"). Heatmap will use categorical axis handling which may produce unexpected cell layout.`,fix:"If you intend categorical axes this is fine. Otherwise, convert values to numbers before passing data."})}}function hr(e,t,r){let a=t.colorScheme;if(!a||!Array.isArray(a))return;let i="string"==typeof t.background?t.background:"#ffffff";if(!i.startsWith("#"))return;let n=[];for(let e of a){if("string"!=typeof e||!e.startsWith("#"))continue;let t=f(e,i);null!==t&&t<3&&n.push(`${e} (${t.toFixed(1)}:1)`)}n.length>0&&r.push({severity:"warning",code:"LOW_COLOR_CONTRAST",message:`${n.length} color(s) in colorScheme have < 3:1 contrast against background "${i}": ${n.join(", ")}. Data marks may be hard to see.`,fix:"Choose colors with at least 3:1 contrast against the chart background."})}function pr(e,t){let r=e.width??600,a=e.height??400,i=e.margin;if(!i||"object"!=typeof i)return;let n=(i.left||0)+(i.right||0),o=(i.top||0)+(i.bottom||0);n>=r&&t.push({severity:"error",code:"MARGIN_OVERFLOW_H",message:`Horizontal margins (${n}px) >= width (${r}px) — no drawing area left.`,fix:"Reduce margin.left/right or increase width."}),o>=a&&t.push({severity:"error",code:"MARGIN_OVERFLOW_V",message:`Vertical margins (${o}px) >= height (${a}px) — no drawing area left.`,fix:"Reduce margin.top/bottom or increase height."})}function fr(e,t,r){let a=ic[e]?.props,i=e=>!!a?.[e]&&"string"==typeof t[e]&&t[e].trim().length>0,n=i("title"),o=i("description"),s=i("summary");!n&&!o&&!s&&r.push({severity:"warning",code:"MISSING_DESCRIPTION",message:"No title, description, or summary provided. Screen readers will fall back to a generic chart-type label.",fix:'Add a title="..." prop for a brief label, or description="..." for a detailed aria-label, or summary="..." for a screen-reader-only note describing the chart\'s purpose.'})}function mr(e,t,r){let a=t.colorScheme;"string"!=typeof a||ic[e]?.props?.colorScheme?.enum||eu.has(a)||r.push({severity:"warning",code:"UNKNOWN_COLOR_SCHEME",message:`colorScheme "${a}" is not a recognized named scheme — the chart will fall back to the default palette.`,fix:`Use a known scheme name (${[...eu].join(", ")}) or pass an explicit color array, e.g. colorScheme={["#1f77b4", "#ff7f0e"]}.`})}function gr(e,t,r){let a=t.colorScheme;if(!a||!Array.isArray(a)||a.length<2)return;let i=a.filter(e=>"string"==typeof e&&e.startsWith("#"));if(i.length<2)return;let n=[];for(let e=0;e<i.length-1;e++){let t=f(i[e],i[e+1]);null!==t&&t<1.5&&n.push(`${i[e]} / ${i[e+1]} (${t.toFixed(1)}:1)`)}n.length>0&&r.push({severity:"warning",code:"LOW_ADJACENT_CONTRAST",message:`${n.length} adjacent color pair(s) in colorScheme have very similar luminance: ${n.join("; ")}. Categories may be hard to distinguish.`,fix:'Alternate light and dark colors in the scheme, or use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic" for a pre-tested palette.'})}function yr(e,t,r){let a=[];for(let e of tu)"function"==typeof t[e]&&a.push(e);a.length>0&&r.push({severity:"warning",code:"FUNCTION_ACCESSOR",message:`Function accessor${a.length>1?"s":""} detected: ${a.join(", ")}. If defined inline (e.g. \`xAccessor={d => d.value}\`), every parent re-render creates a new reference; closures over changing values can force unnecessary scene rebuilds on resize/rotation.`,fix:'Use string accessors when possible (e.g. xAccessor="value"), or memoize with useCallback / define outside the component.'})}function br(e,t,r){let a=t.hoverRadius,i=!1!==t.enableHover&&(!1!==t.hoverAnnotation||t.tooltip||t.customHoverBehavior||t.customClickBehavior||t.onClick);"number"==typeof a&&a>0&&a<24&&i&&r.push({severity:"warning",code:"TOUCH_TARGET_SMALL",message:`hoverRadius=${a}px is below the ~24px radius needed for reliable 48px touch targets on mobile screens.`,fix:"Use hoverRadius={24} or larger for touch-heavy views. Semiotic floors touch pointer hit testing to 24px, but explicit desktop-only radii should be documented."})}function vr(e,t,r){!0===t.responsiveWidth&&!0===t.responsiveHeight&&r.push({severity:"warning",code:"RESPONSIVE_BOTH_AXES",message:"responsiveWidth and responsiveHeight are both true. On mobile this can create resize feedback loops when the parent height depends on chart content.",fix:"Prefer responsiveWidth={true} with a fixed parent height or size={[width, fixedHeight]}; use a ResizeObserver outside the chart if the height must follow aspect ratio."})}function wr(e,t,r){if(!0!==t.showParticles)return;let a=t.particleStyle&&"object"==typeof t.particleStyle?t.particleStyle:{},i="number"==typeof a.maxPerLine?a.maxPerLine:void 0,n="number"==typeof a.spawnRate?a.spawnRate:void 0;("number"==typeof i&&i>20||"number"==typeof n&&n>.08)&&r.push({severity:"warning",code:"GEO_PARTICLE_MOBILE_COST",message:"Animated geo particles run a continuous canvas loop that can drain battery and trigger thermal throttling on mobile GPUs.",fix:"Set particleStyle={{ maxPerLine: 12, spawnRate: 0.06 }} for mobile-heavy views, or disable showParticles when reduced-motion or low-power modes are active."})}function Ar(e){return"object"==typeof e&&null!==e&&("tokenType"in e||"tokenSemantics"in e||"countStrategy"in e||"unitValue"in e||"unit"in e)}function $r(e){return"number"==typeof e&&Number.isFinite(e)&&e>=0?e:void 0}function xr(e,t){let r=$r(e.visibleTokens);if(null!=r)return r;let a=$r(t.denominator);if("fixed-denominator"===t.countStrategy&&null!=a)return a;let i=$r(t.tokenCount),n=$r(t.maxTokens);return null!=i&&null!=n?Math.min(i,n):i??a??n}function Cr(e,t,r){let a=[];Ar(t.tokenEncoding)&&a.push({source:"tokenEncoding",encoding:t.tokenEncoding}),Ar(t.encoding)&&a.push({source:"encoding",encoding:t.encoding});for(let{source:e,encoding:i}of a){let a=xr(t,i);for(let t of qe(i,{visibleTokens:a}))r.push({severity:"warning",code:`TOKEN_${t.code}`,message:t.message,fix:"MISSING_UNIT_VALUE"===t.code?`Set ${e}.unitValue to the value represented by one full token.`:"MISSING_UNIT_MEANING"===t.code?`Set ${e}.unitMeaning so readers know what one full token represents.`:"MISSING_COUNT_STRATEGY"===t.code?`Set ${e}.countStrategy to actual, unitized, fixed-denominator, quantile, sample, posterior-sample, or random-sample.`:"TOKEN_SEMANTICS_UNCLEAR"===t.code?`Set ${e}.tokenSemantics to observed-unit, unitized-measure, risk-case, possible-outcome, posterior-sample, hypothetical-case, topic-anchor, or decorative.`:`Adjust ${e} so its semantics, strategy, labels, and visible token count match the task.`})}}function Sr(e){let t={...e};return delete t.tokenEncoding,delete t.visibleTokens,Ar(t.encoding)&&delete t.encoding,t}function kr(e,t){let r=t.match(/^Unknown prop "([^"]+)"/);if(r)return`Remove \`${r[1]}\` or replace it with a documented ${e} prop.`;let a=t.match(/^"([^"]+)" is required for .+\.$/i)??t.match(/(?:Missing|required) prop "?([^". ]+)/i);return a?`Add the required \`${a[1]}\` prop using the ${e} schema and example.`:t.startsWith("Unknown component")?"Choose a component returned by getSchema() or check the component name for a typo.":`Correct this ${e} prop configuration to match its schema: ${t}`}function Rr(e,t){void 0!==e.accessibleTable&&t.push({severity:"error",code:"BIGNUMBER_ACCESSIBLE_TABLE",message:"BigNumber is a value component and does not support accessibleTable.",fix:"Remove accessibleTable. Use label, description, and summary to provide BigNumber's accessible text."})}function Pr(e,t){let r=[],a=()=>({ok:r.every(e=>"warning"===e.severity),diagnoses:r}),i=/^(XY|Ordinal|Network|Physics|Geo)CustomChart$/.test(e),n=i?[]:Ue(e,Sr(t)).errors;if(i){"function"!=typeof t.layout&&n.push("Provide a layout function.");let r="NetworkCustomChart"===e?["nodes","edges"]:"GeoCustomChart"===e?["points","areas","lines"]:["data"];for(let e of r)null!=t[e]&&!Array.isArray(t[e])&&n.push(`Provide an array for ${e}.`)}for(let a of n)"BigNumber"===e&&void 0!==t.accessibleTable&&a.startsWith('Unknown prop "accessibleTable"')||r.push({severity:"error",code:"VALIDATION",message:a,fix:i?a:kr(e,a)});if("BigNumber"===e&&Rr(t,r),(i||ic[e])&&(rr(t,r),pr(t,r),tt(0,t,r)),!ic[e])return a();tr(e,t,r),ar(e,t,r),ir(e,t,r),nr(e,t,r),or(e,t,r),sr(0,t,r),cr(e,t,r),lr(e,t,r);let o=er(e,t,void 0,{checkOutliers:!1}).diagnoses;for(let e of o)"EMPTY_DATA"===e.code&&r.some(e=>"EMPTY_DATA"===e.code||"EMPTY_EDGES"===e.code)||r.push(e);if(ur(e,t,r),dr(e,t,r),hr(0,t,r),gr(0,t,r),mr(e,t,r),fr(e,t,r),yr(0,t,r),br(0,t,r),vr(0,t,r),wr(0,t,r),Cr(0,t,r),rt(0,t,r),at(0,t,r),it(0,t,r),nt(0,t,r),ht(e,t,r),ot(e,t,r),st(e,t,r),r.some(e=>"NEGATIVE_VALUE"===e.code||"NEGATIVE_NORMALIZED_VALUE"===e.code)||lt(e,t,r),ct(e,t,r),ut(e,t,r),dt(e,t,r),xt(e,t,r),"ProcessSankey"===e)for(let e of kt(t))r.push(e);return a()}function Nr(e){return"string"==typeof e&&e.trim().length>0}function Er(e,t,r){let a=au.has(e)||void 0!==r&&iu.has(r),i=t=>Ie(e,t)||a,n=ru.filter(e=>Nr(t[e])&&!i(e));return{hasTitle:i("title")&&Nr(t.title),hasDescription:i("description")&&Nr(t.description),hasSummary:i("summary")&&Nr(t.summary),unsupportedFinding:n.length>0?{id:"understandable.unsupported-description-prop",principle:"understandable",heuristic:"Descriptive text is connected to the rendered chart",critical:!0,status:"warn",message:`Useful ${n.join(" and ")} text was supplied, but ${1===n.length?"that prop is":"those props are"} not supported by ${e}'s declared chart API and cannot be credited as rendered accessibility text.`,fix:"Use the component's declared title, description, and summary props when available; for richer generated description or navigation, use ChartContainer with chartConfig plus describe and/or navigable."}:void 0}}function Tr(e){return!!Array.isArray(e.styleRules)&&e.styleRules.some(e=>{if("object"!=typeof e||null===e)return!1;let t=e.style;if("object"!=typeof t||null===t||Array.isArray(t))return!1;let r=t.fill;return"object"==typeof r&&null!==r&&"hatch"===r.type})}function Ir(e){if(!Array.isArray(e))return!1;let t=e.filter(e=>"string"==typeof e&&e.startsWith("#")).map(e=>e.toLowerCase());return t.length>0&&t.every(e=>nu.has(e))}function Mr(e,t){return"number"==typeof t?`${e}[${t}]`:`${e}.${t}`}function Or(e,t){return`${e}[Symbol(${t.description??""})]`}function Fr(e,t){if(!/^(0|[1-9][0-9]*)$/.test(e))return!1;let r=Number(e);return Number.isSafeInteger(r)&&r>=0&&r<t}function jr(e,t){try{return Object.getOwnPropertyDescriptor(e,t)}catch{return}}function Lr(e,t,r,a){let i=jr(e,t);return i&&"value"in i&&i.enumerable?zr(i.value,r,a):[r]}function zr(e,t="$",r=/* @__PURE__ */new Set){if(null===e||"string"==typeof e||"boolean"==typeof e)return[];if("number"==typeof e)return Number.isFinite(e)&&!Object.is(e,-0)?[]:[t];if("object"!=typeof e)return[t];if(r.has(e))return[t];let a,i,n;try{n=Array.isArray(e),a=Object.getPrototypeOf(e),i=Reflect.ownKeys(e)}catch{return[t]}if(a!==(n?Array.prototype:Object.prototype)&&null!==a)return[t];r.add(e);let o=[];try{if(n){let a=jr(e,"length")?.value;if(!Number.isSafeInteger(a)||a<0)return[Mr(t,"length")];for(let e of i)"length"===e||"string"==typeof e&&Fr(e,a)||o.push("symbol"==typeof e?Or(t,e):Mr(t,e));for(let i=0;i<a;i+=1)o.push(...Lr(e,String(i),Mr(t,i),r))}else for(let a of i)"symbol"!=typeof a?o.push(...Lr(e,a,Mr(t,a),r)):o.push(Or(t,a));return o}catch{return[t]}finally{r.delete(e)}}function Br(){let e=globalThis;return e[ou]||(e[ou]={recipes:/* @__PURE__ */new Map,capabilities:/* @__PURE__ */new Map,layouts:/* @__PURE__ */new Map}),e[ou]}function Dr(e){return Br().recipes.get(e)}function _r(e){return Br().layouts.get(e)?.layout}function Ur(e){let t=Br().layouts.get(e)?.identity;return t?{...t}:void 0}function Gr(e){return"string"==typeof e?Dr(e):e&&"object"==typeof e&&"string"==typeof e.id?e:void 0}function Hr(e){let t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?t:null}function Vr(e){return"primary"===e?.emphasis||"secondary"===e?.emphasis||null!=Hr(e)}function qr(e){let t=e.split(/[.!?]+/).map(e=>e.trim()).filter(Boolean),r=e.trim().split(/\s+/).filter(Boolean);if(0===r.length||0===t.length)return null;let a=0;for(let e of r)a+=Wr(e);return r.length/t.length*.39+a/r.length*11.8-15.59}function Wr(e){let t=e.toLowerCase().replace(/[^a-z]/g,"");if(!t)return 0;if(t.length<=3)return 1;let r=t.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/,"").replace(/^y/,"").match(/[aeiouy]{1,2}/g);return r?r.length:1}function Yr(e){return!1!==e.tooltip||null!=e.onClick||null!=e.brush||null!=e.onBrush||null!=e.selection||null!=e.linkedHover||null!=e.linkedBrush}function Kr(e){return e.physics&&"object"==typeof e.physics?e.physics:{}}function Jr(e){let t=Kr(e),r=e.controls&&"object"==typeof e.controls?e.controls:{};return!0===e.pauseControl||!0===t.pauseControl||!0===r.pause||"function"==typeof r.pause}function Xr(e){let t=Kr(e);return!0===e.settledProjection||!0===t.settledProjection}function Zr(e){let t=Kr(e);return!0===e.reducedMotionSettle||"settle"===e.reducedMotion||!0===t.reducedMotionSettle||"settle"===t.reducedMotion}function Qr(e){let t={id:"perceivable.low-contrast",principle:"perceivable",heuristic:"Low contrast",critical:!0},r=e.colorScheme,a="string"==typeof e.background?e.background:null;if(a&&!a.startsWith("#"))return{...t,status:"manual",message:`Background "${a}" isn't a hex literal (theme/CSS variable) — contrast can't be verified statically.`,fix:'Pass a hex `background` (e.g. "#ffffff"/"#000000"), or verify contrast manually once the theme resolves.'};let i=a??"#ffffff";if(!Array.isArray(r))return{...t,status:"manual",message:"Mark colors come from the theme/CSS variables — contrast can't be verified statically.",fix:"Confirm geometries/large text have ≥ 3:1 and regular text ≥ 4.5:1 contrast against the background."};let n=[],o=0;for(let e of r){if("string"!=typeof e||!e.startsWith("#"))continue;let t=f(e,i);null!=t&&(o++,t<3&&n.push(`${e} (${t.toFixed(1)}:1)`))}return 0===o?{...t,status:"manual",message:"colorScheme has no parseable hex colors to check.",fix:"Verify contrast manually for non-hex colors."}:n.length>0?{...t,status:"fail",message:`${n.length} color(s) fall below 3:1 contrast vs ${i}: ${n.join(", ")}.`,fix:"Darken (light background) or lighten (dark background) those colors, or use COLOR_BLIND_SAFE_CATEGORICAL."}:{...t,status:"pass",message:`All ${o} checked colorScheme color(s) meet ≥ 3:1 contrast vs ${i}.`}}function ea(e,t,r={}){let a=[],i=Dr(e),n=xc.has(e),o=Te(e)||!!i||n,s=!0===r.inChartContainer,l=!0===r.describe,c=!0===r.navigable,u=wc.has(e),d=uc.has(e),{hasTitle:h,hasDescription:p,hasSummary:f,unsupportedFinding:m}=Er(e,t,i?.frameFamily),g=!1!==t.accessibleTable&&!u,y=h||p||f,b=Yr(t),v=Jr(t),w=n,A=Xr(t)||Sc.has(e)&&g,$=Zr(t)||w,x=Array.isArray(t.annotations)?t.annotations.filter(e=>!!e&&"object"==typeof e):[],C=o?"pass":"manual",S=o?"":` (unrecognized component "${e}" — verify manually that the built-in applies)`;if(m&&a.push(m),a.push(Qr(t)),a.push({id:"perceivable.content-only-visual",principle:"perceivable",heuristic:"Content is only visual",critical:!0,...u?{status:"pass",message:"BigNumber renders its value as real text with an ARIA label — available without vision."}:g?{status:"pass",message:"A screen-reader data table + live region expose the data non-visually (accessibleTable is on)."}:p&&f?{status:"manual",message:"accessibleTable is off; a description + summary are present. Verify they convey everything the chart shows.",fix:"Re-enable accessibleTable, or confirm via screen reader that the text alternative is complete."}:{status:"fail",message:"accessibleTable is disabled and there's no full text alternative — the data is only available visually.",fix:"Remove accessibleTable={false}, or provide a complete description/summary plus a data table."}}),a.push({id:"perceivable.small-text",principle:"perceivable",heuristic:"Small text size",critical:!0,status:"pass",message:"Semiotic's default tick and axis-label fonts are 12px, meeting Chartability's 9pt/12px floor.",fix:"If a theme or override lowers --semiotic-tick-font-size below 12px, raise it back for low-vision audiences."}),a.push({id:"perceivable.seizure-risk",principle:"perceivable",heuristic:"Visual presents seizure risk",critical:!0,...null!=t.pulse||Cc.has(e)?{status:"manual",message:"Pulse/continuous animation is in use. Confirm nothing flashes more than 3×/sec, especially saturated red.",fix:"Avoid red flashes and rapid (>3 Hz) flicker; reduced-motion is auto-honored, but verify the default presentation."}:{status:"manual",message:"No flashing detected statically. Confirm no element flashes more than 3×/sec.",fix:"Manual check — most static charts pass trivially."}}),null!=t.colorBy){let e=!0===t.directLabel||!0===t.showLabels,r=Tr(t);a.push({id:"perceivable.color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...e?{status:"pass",message:"Categories are encoded by color (colorBy) and also directly labeled, so color isn't the only channel."}:{status:"warn",message:r?"Categories use colorBy and this config authors a HatchFill through styleRules, but a static audit cannot prove those rules give every category a distinct non-color cue. Semiotic does not automatically assign per-category textures.":"Categories are encoded by color (colorBy) with no declared redundant channel. Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor and there is no automatic per-category texture assignment.",fix:r?"Verify every category remains distinguishable with color removed; add direct labels where hatching is incomplete, keep categories ≤ ~7, and use a CVD-safe palette.":"Add direct labels (directLabel on LineChart/AreaChart, showLabels on network/hierarchy) or category-targeted styleRules with distinct HatchFill descriptors; keep categories ≤ ~7 and use a CVD-safe palette."}});let i=Ir(t.colorScheme);a.push({id:"perceivable.cvd-safe",principle:"perceivable",heuristic:"Not CVD-friendly",critical:!1,...i?{status:"pass",message:"colorScheme uses Semiotic's Wong colorblind-safe palette."}:{status:"manual",message:"Color encodes meaning; statically we can't confirm the palette is colorblind-safe.",fix:'Use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic", or test your scheme with Viz Palette / Chroma.'}}),a.push({id:"flexible.textures-adjustable",principle:"flexible",heuristic:"Contrast and textures cannot be adjusted",critical:!1,status:"warn",message:r?"This config uses an author-supplied HatchFill through styleRules, but Semiotic has no automatic, theme-aware per-category texture channel or user-facing texture toggle.":"Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor; there is no automatic, theme-aware per-category texture channel or user-facing texture toggle.",fix:r?"Verify the authored hatches cover every meaningful category and remain legible in the active theme; pair them with direct labels and a CVD-safe palette.":"Use category-targeted styleRules with distinct HatchFill descriptors or direct labels so the encoding survives color removal. Contrast itself is themeable via CSS variables."})}{let e=x.filter(Ye);if(e.length>0){let r=t.autoPlaceAnnotations,i="object"==typeof r&&null!==r&&!0===r.redundantCues,n=e.filter(e=>{if("string"!=typeof e.color)return!1;let t=We(e),r=i&&"text"===t;return!(Je(e)||r)});a.push({id:"perceivable.annotation-association",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...0===n.length?{status:"pass",message:"No annotation relies on color alone to indicate its target — wherever color is used, a connector, enclosure, or reference-line cue is present too."}:{status:"warn",message:`${n.length} of ${e.length} annotation(s) carry a color but no connector, enclosure, or reference-line cue, so a color-blind or non-visual reader can't tie them to their target (the correspondence problem).`,fix:"Add a connector (the label/callout default), place the note adjacent to its target, enclose the target, or enable autoPlaceAnnotations: { redundantCues: true } to give colored text notes a leader line — don't rely on color matching alone."}})}}a.push({id:"operable.single-input-modality",principle:"operable",heuristic:"Interaction modality only has one input type",critical:!0,...o?{status:"pass",message:"Built-in keyboard navigation (arrows/Home/End/PageUp-Down/Enter) mirrors mouse hover."}:{status:"manual",message:`Can't confirm keyboard support for "${e}".`,fix:"Verify Tab + arrow-key operation."}});{let e=[];(null!=t.brush||null!=t.onBrush)&&e.push("brushing"),!0===t.zoomable&&e.push("zoom/pan"),("isolate"===t.legendInteraction||"highlight"===t.legendInteraction)&&e.push("legend filtering"),e.length>0&&a.push({id:"operable.complex-action-alternatives",principle:"operable",heuristic:"Complex actions have no alternatives",critical:!1,status:"warn",message:`Mouse-driven ${e.join(", ")} ${e.length>1?"have":"has"} no built-in keyboard/standard-UI equivalent.`,fix:"Pair the complex interaction with a standard control (range inputs for a brush, buttons for zoom, a checkbox list for legend filtering) operable by keyboard and screen reader."})}{let r=Ec[e];if(r&&b){let e=t[r];"number"==typeof e&&e>0&&2*e<24&&a.push({id:"operable.target-size",principle:"operable",heuristic:"Target pointer interaction size is too small",critical:!1,status:"warn",message:`${r}=${e} gives a ~${2*e}px hit target, below the 24×24px minimum for pointer interaction.`,fix:"Increase the radius, or rely on the chart's hoverRadius / keyboard navigation as the alternative for precise selection."})}}a.push({id:"operable.tab-stops",principle:"operable",heuristic:"Inappropriate tab stops",critical:!1,status:C,message:`The chart takes a single tab stop and navigates data with arrow keys${S} — the recommended pattern for dense charts (no per-datum tab stops to wade through).`}),a.push({id:"operable.interaction-cues",principle:"operable",heuristic:"No interaction cues or instructions",critical:!0,...b?f||p?{status:"manual",message:"Chart is interactive and has descriptive text. Confirm that text explains how to interact (keyboard + pointer).",fix:'State the interaction model in summary, e.g. "Use arrow keys to move between points."'}:{status:"warn",message:"Chart is interactive but nothing explains how to use it.",fix:"Describe the interaction in a summary or nearby text (keyboard navigation, what hover/click reveals)."}:{status:"not-applicable",message:"No interactive behavior detected."}}),a.push({id:"operable.controls-override-at",principle:"operable",heuristic:"Controls override AT controls",critical:!0,status:C,message:`Keyboard handlers fire only while the chart has focus, so they don't hijack page/app screen-reader shortcuts${S}.`}),a.push({id:"operable.focus-indicator",principle:"operable",heuristic:"Keyboard focus indicator missing, obscured, or low contrast",critical:!1,status:C,message:`A shape-adaptive focus ring (var(--semiotic-focus)) marks the focused element${S}.`,fix:o?"Ensure --semiotic-focus keeps ≥ 3:1 contrast against your background.":void 0}),a.push({id:"understandable.title-summary-caption",principle:"understandable",heuristic:"No title, summary, or caption",critical:!0,...y?{status:"pass",message:`Provided: ${[h&&"title",p&&"description",f&&"summary"].filter(Boolean).join(", ")}.`}:s?{status:"manual",message:"No title/description/summary on the chart. If the wrapping ChartContainer supplies a title/subtitle, this is covered at that layer — verify it does.",fix:"Give the ChartContainer a title (and optionally enable describe), or set title/description/summary on the chart."}:{status:"fail",message:"No title, description, or summary — the screen reader falls back to a generic label.",fix:"Add title/description/summary on the chart, or wrap it in a ChartContainer (the opt-in layer for title/caption/description chrome)."}}),a.push({id:"understandable.explain-purpose",principle:"understandable",heuristic:"No explanation for purpose or for how to read",critical:!0,...p||f?{status:"pass",message:"A description/summary is available to explain purpose and how to read the chart."}:l?{status:"manual",message:"ChartContainer's describe option explains how to read the chart (type, stats, trend). Confirm the domain purpose — why this chart exists — is also conveyed (title/subtitle).",fix:"Give the ChartContainer a title/subtitle stating the purpose; describe() covers the how-to-read half."}:h?{status:"warn",message:"Only a title is set — a label, not an explanation of purpose or how to read the chart.",fix:"Add a summary, or enable ChartContainer's describe option for an auto-generated how-to-read description."}:{status:"fail",message:"Nothing explains the chart's purpose or how to read it.",fix:"Add a summary/description, or wrap in a ChartContainer with a title and the describe option (the opt-in full-accessibility layer)."}});{let e=[t.description,t.summary].filter(Nr).join(". "),r=e?qr(e):null;a.push({id:"understandable.reading-level",principle:"understandable",heuristic:"Reading level inappropriate",critical:!0,...null==r?{status:"not-applicable",message:"No description/summary text to grade."}:r>9?{status:"warn",message:`Description/summary reads at ~grade ${r.toFixed(0)}; Chartability targets grade 9 or lower.`,fix:"Shorten sentences and prefer common words."}:{status:"pass",message:`Description/summary reads at ~grade ${Math.max(0,Math.round(r))} (≤ 9).`}})}if(Ac.has(e)){let e=Nr(t.xLabel),r=Nr(t.yLabel);a.push({id:"understandable.axis-labels",principle:"understandable",heuristic:"Axis labels are unclear or missing",critical:!1,...e&&r?{status:"pass",message:"Both axes are labeled (xLabel, yLabel)."}:{status:"warn",message:`Missing axis label: ${[!e&&"xLabel",!r&&"yLabel"].filter(Boolean).join(", ")}. Ticks alone may not name the variable.`,fix:"Set xLabel and yLabel to name each axis's variable and units."}})}if(Pc.has(e)&&a.push({id:"understandable.information-complexity",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,status:"warn",message:"Dual-axis chart: two y-scales are hard to read accurately and notoriously easy to misinterpret (the crossover point is arbitrary).",fix:"Confirm the second axis is necessary; consider two aligned charts (small multiples) or indexing both series to a common baseline. Label each axis and its series unambiguously."}),x.length>1){let e=x.filter(Vr).length,t=x.length-e;a.push({id:"understandable.annotation-hierarchy",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,...e===x.length?{status:"pass",message:`All ${x.length} annotation(s) declare hierarchy through emphasis or provenance confidence, so the renderer can resolve reading order and visual priority.`}:0===e?{status:"warn",message:`${x.length} annotations are present with no emphasis or provenance confidence; readers may not know which note is primary.`,fix:'Mark the main annotation with emphasis="primary", set supporting notes to emphasis="secondary", or provide provenance.confidence so Semiotic can infer order.'}:{status:"warn",message:`${t} of ${x.length} annotation(s) have no emphasis or provenance confidence; readers may not know which note is primary among the unordered notes.`,fix:"Set emphasis on each annotation (primary/secondary), or provide provenance.confidence on all annotations so Semiotic can infer order."}})}(null!=t.forecast||null!=t.anomaly||null!=t.band||null!=t.regression)&&a.push({id:"understandable.uncertainty",principle:"understandable",heuristic:"Statistical uncertainty isn't clearly communicated",critical:!1,status:"manual",message:"The chart shows a forecast/regression/band/anomaly overlay. Confirm the uncertainty it represents is explained in text, not just drawn.",fix:"State the confidence interval / method in the summary, and label the band so it isn't mistaken for data."}),null!=t.animate&&!1!==t.animate&&a.push({id:"understandable.changes-followable",principle:"understandable",heuristic:"Changes are not easy to follow",critical:!1,status:C,message:`Transitions animate with object constancy and data changes are mirrored to the live region${S}.`,fix:o?"Keep transition durations in the 250ms–2s range so changes are followable but not slow.":void 0}),a.push({id:"robust.conforms-to-standards",principle:"robust",heuristic:"Does not conform to standards",critical:!1,status:"manual",message:"WCAG 2.1 / Section 508 conformance can't be settled from config alone.",fix:"Run an automated checker (axe) on the rendered output and test with real assistive tech."}),a.push({id:"robust.semantically-valid",principle:"robust",heuristic:"Semantically invalid",critical:!1,status:"manual",message:"Whether interactive elements expose correct roles/names is a render-time, screen-reader question.",fix:"Verify with a screen reader that buttons read as buttons, the chart as an image/group, etc."}),a.push({id:"robust.fragile-technology-support",principle:"robust",heuristic:"Fragile technology support",critical:!1,status:C,message:`Charts render on canvas with an SVG overlay and render to SVG in SSR, so access isn't tied to one rendering path${S}.`,fix:o?"Still test across NVDA+Firefox, JAWS+Chrome, and VoiceOver+Safari — AT support varies.":void 0}),a.push({id:"compromising.table",principle:"compromising",heuristic:"No table",critical:!0,...u?{status:"not-applicable",message:"Single-value display — a table isn't meaningful."}:g?{status:"pass",message:"A human-readable data table is provided (accessibleTable)."}:{status:"fail",message:"accessibleTable is disabled — no human-readable table of the underlying data.",fix:"Remove accessibleTable={false} (unless title/summary/annotations already convey all the data)."}}),u||a.push({id:"compromising.table-static",principle:"compromising",heuristic:"Table/data is static",critical:!1,...s?{status:"manual",message:"Rendered in a ChartContainer. If a data-download action is enabled, the data is exportable.",fix:"Enable the ChartContainer data-download action so users can save the underlying data (keep it opt-in)."}:{status:"warn",message:"The data table is read-only — not downloadable, sortable, or filterable.",fix:"Wrap the chart in a ChartContainer and enable its data-download action (opt-in, so deployments can withhold it where export isn't allowed)."}}),a.push({id:"compromising.shareable-state",principle:"compromising",heuristic:"State is not easy to share and reproduce",critical:!1,status:o?"pass":"manual",message:`Chart state serializes via toConfig/toURL/copyConfig${o?"":S}.`,fix:o?"Expose it to users via the ChartContainer copyConfig action or a shareable URL.":void 0}),a.push({id:"compromising.navigable-structure",principle:"compromising",heuristic:"Information cannot be navigated according to narrative or structure",critical:!1,...c?d?{status:"pass",message:"ChartContainer's navigable option mounts a structured navigation tree, including hierarchy/network branches and their data items."}:{status:"pass",message:"ChartContainer's navigable option mounts a structured tree (chart → axes/series → data points) that screen readers can traverse."}:d?{status:"warn",message:"Hierarchical chart: built-in keyboard navigation is largely flat — it doesn't descend the tree structure.",fix:"Enable ChartContainer's navigable option for a structured navigation tree, or lean on the data table and a summary that conveys the hierarchy."}:{status:C,message:`Keyboard navigation steps through points and switches series/groups${S}.`,fix:o?"For deeper structure (axis → series → datum), enable ChartContainer's navigable option.":void 0}});{let r,i=Array.isArray(t.data)?t.data:null,n=Array.isArray(t.nodes)?t.nodes:null,o={id:"assistive.data-density",principle:"assistive",heuristic:"Data density is inappropriate",critical:!0};r=bc.has(e)&&i&&i.length>7?{...o,status:"warn",message:`${i.length} slices in a part-to-whole chart. Chartability suggests ≤ 5 categories; many thin slices are hard to perceive and to describe.`,fix:'Group small slices into an "Other" category, or switch to a ranked bar chart.'}:n&&n.length>200?{...o,status:"warn",message:`${n.length} nodes. A network this size is hard to navigate non-visually node by node.`,fix:"Provide a summary of structure (clusters, hubs, components) and consider filtering or aggregating the graph."}:i&&i.length>5e3?{...o,status:"warn",message:`${i.length} data points. Canvas renders this fine, but the non-visual table/navigation become unwieldy.`,fix:"Aggregate or bin for the accessible representation, or expose summary statistics rather than every row."}:i?{...o,status:"pass",message:`${i.length} data points — a reasonable density for non-visual consumption.`}:n?{...o,status:"pass",message:`${n.length} nodes — a reasonable density for non-visual consumption.`}:{...o,status:"manual",message:"Data not provided inline (push mode); verify density at runtime."},a.push(r)}{let e=Array.isArray(t.data)?t.data:null,r=["valueFormat","yFormat","xFormat","tickFormat","format"].some(e=>"function"==typeof t[e]||"string"==typeof t[e]),i=!1;if(e&&!r)for(let t of e.slice(0,50))if(t&&"object"==typeof t){for(let e of Object.values(t))if("number"==typeof e&&Number.isFinite(e)&&Math.abs(e)>=1e5){i=!0;break}if(i)break}i&&a.push({id:"assistive.human-readable-numbers",principle:"assistive",heuristic:"Data in text is not human-readable",critical:!1,status:"warn",message:'Data includes large numbers (≥ 100,000) and no value/tick formatter — screen readers will read every digit (e.g. "six hundred fifty thousand…").',fix:'Pass valueFormat / yFormat (e.g. a compact formatter so 6,500,000 reads as "6.5M"); the formatter flows to ticks, tooltips, and the data table.'})}a.push({id:"assistive.features-described",principle:"assistive",heuristic:"Visually apparent features and relationships are not described",critical:!1,...l?{status:"pass",message:"ChartContainer's describe option auto-generates an L1–L3 description (chart type, statistics, and trend) via describeChart()."}:f?{status:"manual",message:"A summary is present. Confirm it describes trends, extrema, clusters, and outliers — not just what the chart is.",fix:"Cover the L2/L3 content blind readers value most: direction of trend, peak/trough, notable outliers."}:{status:"warn",message:"No text describes the visually apparent trends, extrema, or outliers.",fix:"Enable ChartContainer's describe option (auto-generates via describeChart()), or write a summary covering the key trend and notable points."}}),a.push({id:"assistive.skippable-navigation",principle:"assistive",heuristic:"Navigation and interaction is tedious",critical:!0,...u?{status:"not-applicable",message:"Single value — nothing to skip."}:g?{status:"pass",message:'A "Skip to data table" link lets screen-reader users bypass point-by-point navigation.'}:{status:"warn",message:"accessibleTable is off, removing the skip-to-table affordance.",fix:"Keep accessibleTable enabled so users can skip past dense point navigation."}}),a.push({id:"flexible.user-style-respected",principle:"flexible",heuristic:"User style change not respected",critical:!0,status:C,message:`Styling flows through CSS custom properties and honors forced-colors mode, so user/user-agent style changes cascade in${S}.`,fix:o?"Avoid hardcoding colors via frameProps style fns that bypass theme variables.":void 0}),a.push({id:"flexible.reduced-motion",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...Cc.has(e)||Rc.has(e)?v?{status:"pass",message:`${e} animates continuously and declares an in-chart pause/stop control.`}:{status:"warn",message:`${e} animates continuously. prefers-reduced-motion is auto-honored, but there's no in-chart pause/stop control for users who don't set that preference.`,fix:"Offer a pause/stop control for looping/streaming motion (Chartability requires it for animation > 2s)."}:{status:C,message:`prefers-reduced-motion is auto-detected; transitions fast-forward and looping animation stops${S}.`}}),n&&(a.push({id:"flexible.sim-pause-control",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...v?{status:"pass",message:"Physics simulation exposes a pause/stop control for users who need to stop motion."}:{status:"warn",message:"Physics simulation has no declared pause/stop control.",fix:"Provide a visible pause control and set physics.pauseControl=true (or pauseControl=true) so the contract is auditable."}}),a.push({id:"flexible.settled-projection",principle:"flexible",heuristic:"User style change not respected",critical:!1,...A?{status:"pass",message:"A settled-projection table is declared, so non-visual readers get aggregate chart semantics instead of trajectories."}:{status:"warn",message:"Physics chart does not declare a settled projection for its accessible table.",fix:"Provide aggregate rows from the settled projection and set physics.settledProjection=true."}}),a.push({id:"flexible.reduced-motion-settle",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...$?{status:"pass",message:"Reduced-motion mode settles the simulation to a static chart state instead of freezing bodies mid-flight."}:{status:"warn",message:"Physics chart does not declare reduced-motion synchronous settle behavior.",fix:"In reduced motion, run the world to its settled projection and paint once; set physics.reducedMotionSettle=true."}}));{let r=!0===t.responsiveWidth||!0===t.responsiveHeight,i=Nc.has(e)&&!0===t.zoomable;a.push({id:"flexible.zoom-reflow",principle:"flexible",heuristic:"Zoom and reflow are not supported",critical:!1,...r?{status:"pass",message:`Chart reflows to its container (${[!0===t.responsiveWidth&&"responsiveWidth",!0===t.responsiveHeight&&"responsiveHeight"].filter(Boolean).join(", ")}), so page zoom doesn't clip it.`}:i?{status:"pass",message:"Geo chart is zoomable/pannable."}:{status:"manual",message:"Fixed width/height — verify the chart survives browser zoom and reflow without clipping or loss of function.",fix:"Use responsiveWidth/responsiveHeight so the chart reflows to its container."}})}i&&(i.encodings?.some(e=>"color"===e.channel&&(!e.redundantWith||0===e.redundantWith.length))&&a.push({id:"perceivable.recipe-color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,status:"warn",message:`${i.name} declares a color encoding without a redundant cue.`,fix:"Add shape, label, position, texture, or a textual category summary to the recipe encoding."}),"required"===i.accessibility.description&&!p&&a.push({id:"understandable.recipe-description",principle:"understandable",heuristic:"Features are not described",critical:!1,status:"fail",message:`${i.name} requires a recipe-aware description, but none is attached.`,fix:"Call describeChart with recipeId/recipe metadata and attach the returned text as description."}),i.accessibility.fallbackTable&&!1===t.accessibleTable&&a.push({id:"compromising.recipe-fallback",principle:"compromising",heuristic:"No data table is provided",critical:!0,status:"fail",message:`${i.name} requires a fallback table, but accessibleTable is disabled.`,fix:"Enable accessibleTable and preserve recipe-declared table fields on scene nodes."}));let k=a.filter(e=>"not-applicable"!==e.status).filter(e=>e.critical),R={criticalsPassed:k.filter(e=>"pass"===e.status).length,criticalsEvaluated:k.length,fails:a.filter(e=>"fail"===e.status).length,warnings:a.filter(e=>"warn"===e.status).length,manual:a.filter(e=>"manual"===e.status).length,passes:a.filter(e=>"pass"===e.status).length};return{component:e,ok:!k.some(e=>"fail"===e.status),summary:R,findings:a,reference:"Chartability (POUR-CAF) — https://chartability.github.io/POUR-CAF/. Not a pass/fail cert; pair with manual screen-reader testing (NVDA+Firefox, JAWS+Chrome, VoiceOver+Safari)."}}function ta(e,{onlyCritical:t=!1}={}){let r=[];for(let a of e.findings)"fail"!==a.status&&"warn"!==a.status||t&&!a.critical||r.push(a.message);return r}function ra(e){let t=[],r=e.summary,a=e.ok?`${r.criticalsPassed}/${r.criticalsEvaluated} critical heuristics pass`:`${r.fails} blocking failure(s) — ${r.criticalsPassed}/${r.criticalsEvaluated} critical heuristics pass`;t.push(`${e.ok?"✓":"✗"} ${e.component}: accessibility audit (Chartability POUR-CAF)`),t.push(` ${a} · ${r.warnings} warning(s) · ${r.manual} to verify manually`);for(let r of lu){let a=e.findings.filter(e=>e.principle===r&&"not-applicable"!==e.status);if(0!==a.length){t.push(""),t.push(` ${r.toUpperCase()}`);for(let e of a){let r=e.critical?" [critical]":"";t.push(` ${su[e.status]} ${e.id}${r}: ${e.message}`),e.fix&&("fail"===e.status||"warn"===e.status||"manual"===e.status)&&t.push(` → ${e.fix}`)}}}return t.push(""),t.push(` Ref: ${e.reference}`),t.join("\n")}function aa(e){return e.semanticDiagnostics?.length?e.semanticDiagnostics:"degenerate"===e.semanticStatus?[cu]:[]}function ia(e){let{contract:t,transfer:r,binding:a}=e;if(void 0===t&&void 0===r&&void 0===a)return[];let i=[],n=Array.isArray(a?.mismatchPaths)?a.mismatchPaths.filter(e=>"string"==typeof e):[];return r&&"preserved"!==r.status&&"excluded"!==r.status?i.push({id:"artifact.transfer-invalid",status:"fail",message:`The attached artifact transfer is ${r.status}; its contract cannot be relied on for publication.`}):(!r||void 0===t)&&i.push({id:"artifact.transfer-unknown",status:"unknown",message:"The attached artifact lacks a contract or a transfer report."}),"mismatch"===a?.status||n.length>0?i.push({id:"artifact.identity-mismatch",status:"fail",message:"The attached artifact does not identify this chart input"+(n.length?`: ${n.join(", ")}`:".")}):("match"!==a?.status||!Array.isArray(a.mismatchPaths)||!Array.isArray(a.unknownPaths)||a.mismatchPaths.length>0||a.unknownPaths.length>0)&&i.push({id:"artifact.identity-unknown",status:"unknown",message:"The attached artifact identity has not been fully verified."}),i}function na(e){return e.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function oa(e,t,r){return{id:`${t}.${e.code.toLowerCase()}.${r+1}`,stage:t,severity:e.severity,code:e.code,message:e.message,...e.fix?{fix:e.fix}:{},source:"data"===t?"auditData":"diagnoseConfig",...e.field?{field:e.field}:{},...e.role?{role:e.role}:{},...e.rows?{rows:e.rows}:{},...void 0!==e.count?{count:e.count}:{}}}function sa(e,t){let r="fail"===e.status?"error":"warn"===e.status?"warning":"manual";return{id:e.id||`accessibility.${t+1}`,stage:"accessibility",severity:r,code:e.id,message:e.message,...e.fix?{fix:e.fix}:{},source:"auditAccessibility",critical:e.critical,principle:e.principle,heuristic:e.heuristic}}function la(e){return e.map((e,t)=>({finding:e,index:t})).sort((e,t)=>{let r=uu[e.finding.severity]-uu[t.finding.severity];if(0!==r)return r;let a=!0===e.finding.critical;if(a!==(!0===t.finding.critical))return a?-1:1;let i=du[e.finding.stage]-du[t.finding.stage];return 0!==i?i:e.index-t.index}).map(({finding:e},t)=>({...e,rank:t+1}))}function ca(e,t){let r=[];e.component!==t&&r.push({id:"render.component-mismatch",stage:"render",severity:"error",code:"RENDER_COMPONENT_MISMATCH",message:"The render evidence names a different chart component.",source:"renderChartWithEvidence"});for(let t of ia({contract:e.artifactContract,transfer:e.artifactTransfer,binding:e.artifactBinding}))r.push({id:`render.${t.id}`,stage:"render",severity:"fail"===t.status?"error":"manual",code:t.id.toUpperCase().replace(/[.-]/g,"_"),message:t.message,source:"artifactAttachmentIssues"});e.empty&&r.push({id:"render.empty-scene",stage:"render",severity:"error",code:"EMPTY_SCENE",message:"The renderer produced no data marks.",fix:"Check the data shape, accessors, scales, and filters against the rendered evidence.",source:"renderChartWithEvidence"});let a=/* @__PURE__ */new Set;for(let t of aa(e))a.add(t.code),r.push({id:`render.${t.code.toLowerCase()}`,stage:"render",severity:t.severity,code:t.code,message:t.message,...t.fix?{fix:t.fix}:{},source:"capability.semanticViability"});for(let t of e.warnings)a.has(t)||r.push({id:`render.${t.toLowerCase()}`,stage:"render",severity:"warning",code:t,message:`The renderer reported ${na(t).toLowerCase()}.`,fix:"Inspect the render evidence and resolve the warning before relying on the chart.",source:"renderChartWithEvidence"});return r}function ua(e,t){let r=e.filter(e=>"manual"!==e.severity),a=r.slice(0,t).map(e=>({id:`chart-evaluation-${e.id}`,level:"error"===e.severity?"error":"warning",title:`${e.stage}: ${na(e.code)}`,message:e.fix?`${e.message} ${e.fix}`:e.message,source:"Semiotic chart evaluation",dismissible:!0}));return r.length>t&&a.push({id:"chart-evaluation-overflow",level:"warning",title:"Additional chart evaluation findings",message:r.length-t+" additional finding(s) are available in the ranked evaluation result.",source:"Semiotic chart evaluation",dismissible:!0}),a}function da(e){let t=e.ok?"PASS":"ISSUES FOUND",r=[`${e.component}: ${t}`,`${e.summary.errors} error(s) · ${e.summary.warnings} warning(s) · ${e.summary.manual} manual check(s)`];for(let t of e.findings)r.push(`${t.rank}. [${t.stage}/${t.code}] ${t.message}`),t.fix&&r.push(` Fix: ${t.fix}`);return r.join("\n")}function ha(e,t={},r,a={}){let i=void 0===r?t:{...t,data:r},n=Ue(e,i),o=er(e,i,r,a.dataAudit),s=Pr(e,i).diagnoses.filter(e=>"data"!==e.domain&&"VALIDATION"!==e.code),l=ea(e,i,{inChartContainer:a.inChartContainer,describe:a.describe,navigable:a.navigable}),c=[];for(let[e,t]of n.errors.entries())c.push({id:`validation.${e+1}`,stage:"deception",severity:"error",code:"VALIDATION",message:t,fix:"Correct the component name, required props, prop types, and data shape.",source:"validateProps"});o.diagnoses.forEach((e,t)=>{c.push(oa(e,"data",t))}),s.forEach((e,t)=>{c.push(oa(e,"deception",t))}),l.findings.filter(e=>"pass"!==e.status&&"not-applicable"!==e.status).forEach((e,t)=>{c.push(sa(e,t))});let u,d=c.some(e=>"error"===e.severity&&"accessibility"!==e.stage);if(a.render&&n.valid&&!d)try{u=a.render(e,i).evidence,c.push(...ca(u,e))}catch{c.push({id:"render.failed",stage:"render",severity:"error",code:"RENDER_FAILED",message:"The injected renderer failed before producing render evidence.",fix:"Check the chart configuration and renderer-specific requirements.",source:"renderChartWithEvidence"})}let h=la(c),p=h.filter(e=>"error"===e.severity).length,f=h.filter(e=>"warning"===e.severity).length,m=h.filter(e=>"manual"===e.severity).length,g=ua(h,Math.max(0,Math.floor(a.notificationMax??8)));return{component:e,validation:n,data:o,deception:s,accessibility:l,...u?{evidence:u}:{},ok:0===p,summary:{errors:p,warnings:f,manual:m,findings:h.length,notifications:g.length},findings:h,notifications:g}}function pa(e,t=8){return ua(e,Math.max(0,Math.floor(t)))}function fa(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function ma(e){return"string"==typeof e&&e.trim().length>0}function ga(e){let t=fa(e.capability)?e.capability:null,r=fa(e.recipe)?e.recipe:null,a=[e.mobileSemantics,e.mobileVisualization,e.mobile,t?.mobile,r?.mobile];for(let e of a)if(fa(e))return e;return null}function ya(e,t){return e.includes("CustomChart")||e.includes("Custom")||null!=t.recipeId||null!=t.mobileSemantics}function ba(e){return Array.isArray(e)&&e.length>=2&&"number"==typeof e[0]&&"number"==typeof e[1]&&Number.isFinite(e[0])&&Number.isFinite(e[1])?[e[0],e[1]]:null}function va(e){return ba(e.size)||ba(fa(e.frameProps)?e.frameProps.size:void 0)||("number"==typeof e.width&&"number"==typeof e.height?[e.width,e.height]:null)}function wa(e){let t=ga(e);return!0===e.responsive||!0===e.mobile||!0===t?.responsive||!0===t?.supportsResponsiveLayout||Array.isArray(t?.breakpoints)||"number"==typeof t?.minViewportWidth||"responsive"===t?.strategy||"small-multiples"===t?.strategy||"summary-cards"===t?.strategy||null!=e.mobileLayout||null!=e.responsiveRules||"mobile-readable"===e.density}function Aa(e){let t=ga(e),r=fa(e.mobileInteraction)?e.mobileInteraction:null;return null!=e.controls||null!=e.mobileControls||!0===e.alternativeControls||null!=e.selection||null!=e.onClick||null!=e.onSelect||!0===e.mobileInteraction||!0===r?.tapToSelect||!0===r?.tapToLockTooltip||Array.isArray(t?.interaction?.alternatives)&&t.interaction.alternatives.length>0||"tap"===t?.interaction?.primary||"button"===t?.interaction?.primary||ma(t?.interaction?.hoverFallback)}function $a(e,t){let r=ga(e),a=(fa(e.mobileInteraction)?e.mobileInteraction:null)?.standardControls,i=Array.isArray(r?.interaction?.alternatives)&&r.interaction.alternatives.length>0;return!(null==e.controls&&null==e.mobileControls&&!0!==e.alternativeControls&&!i&&!0!==a&&"all"!==a)||t.every(e=>"brush"===e?Array.isArray(a)?a.includes("brush"):"brush"===a:"pan/zoom"===e?Array.isArray(a)?a.includes("zoom"):"zoom"===a:"legend filtering"===e&&(Array.isArray(a)?a.includes("legend"):"legend"===a))}function xa(e){let t=fa(e.frameProps)?e.frameProps:{};return(!0===e.enableHover||null!=e.tooltipContent||null!=e.tooltip||null!=t.tooltipContent||!0===t.enableHover)&&!Aa(e)}function Ca(e){let t=[e.data,e.points,e.lines,e.nodes,e.edges,e.areas,fa(e.frameProps)?e.frameProps.data:void 0],r=0;for(let e of t)Array.isArray(e)&&(r+=e.length);return r}function Sa(e){let t=[e.tickValues,e.xTickValues,e.yTickValues,e.rTickValues,e.oTickValues],r=0;for(let e of t)Array.isArray(e)&&(r+=e.length);return r>0?r:null}function ka(e,t){let r=pu[e];if(!r)return null;let a=r.includes("hoverRadius")?30:null;for(let e of r){let r=t[e];"number"==typeof r&&Number.isFinite(r)&&r>0&&(a=null==a?r:Math.max(a,r))}return null==a?null:2*a}function Ra(e,t){e.push({...t,status:"pass"})}function Pa(e,t){e.push({...t,status:"warn"})}function Na(e,t){e.push({...t,status:"manual"})}function Ea(e,t={},r={}){let a=r.viewportWidth??390,i=r.targetSize??44,n=va(t),o=re(t,{width:a,height:n?.[1]}),s=[],l=va(t=o.props),c=ga(t),u=ya(e,t),d=wa(t),h=!0===r.inChartContainer,p=ma(t.title)||ma(t.summary)||ma(t.description)||!0===c?.summary||ma(c?.summary);if(o.matches.length>0&&Ra(s,{id:"layout.responsive-rule-applied",category:"layout",impact:"medium",message:`${o.matches.length} responsive rule(s) applied for the ${a}px mobile audit.`}),l){let[t,r]=l;t>a&&!d?Pa(s,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:`Chart size is ${t}px wide against a ${a}px mobile viewport with no responsive/mobile transform hint.`,fix:"Use responsive sizing, responsiveRules/mobileLayout, or an explicit mobile variant that preserves the task instead of clipping the desktop chart."}):Ra(s,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:"No fixed desktop-width overflow risk is visible from the config."}),"number"==typeof c?.minViewportWidth&&c.minViewportWidth>a&&Pa(s,{id:"layout.mobile-min-width",category:"layout",impact:"high",message:`The declared mobile contract supports ${c.minViewportWidth}px minimum, wider than the audited ${a}px viewport.`,fix:"Add a narrower breakpoint, summary-card fallback, or explicit horizontal-scroll affordance with a non-visual equivalent."});let i=t/Math.max(1,r);a<=430&&i>2.4&&"BigNumber"!==e&&Pa(s,{id:"layout.wide-aspect-ratio",category:"layout",impact:"medium",message:`Chart aspect ratio is ${i.toFixed(1)}:1, which tends to compress phone charts vertically.`,fix:"Prefer stacked sections, small multiples, cards plus a sparkline, or a taller mobile-specific chart ratio."}),r<160&&"BigNumber"!==e&&Pa(s,{id:"layout.too-short-for-reading",category:"layout",impact:"medium",message:`Chart height is ${r}px; most phone charts need enough vertical room for marks plus readable labels.`,fix:"Reserve more vertical space, remove nonessential axes, or switch to a card/sparkline pattern with external labels."})}else Na(s,{id:"layout.unknown-size",category:"layout",impact:"medium",message:"No explicit size is available to audit. This may be responsive, but static mobile overflow cannot be checked.",fix:"Audit rendered widths at 320, 360, 390, and 430px, or pass size/responsiveRules metadata into the config."});let f=Ca(t);f>0&&(f>("number"==typeof c?.maxMarks?c.maxMarks:hu.has(e)?1.25*a:$c.has(e)?Math.max(8,Math.floor(a/34)):a)?Pa(s,{id:"density.mark-budget",category:"density",impact:hu.has(e)?"medium":"high",message:`${f} data item(s) exceed the rough mobile density budget for ${e} at ${a}px.`,fix:"Aggregate, filter, facet into small multiples, switch to a summary-card plus detail view, or use progressive disclosure."}):Ra(s,{id:"density.mark-budget",category:"density",impact:"medium",message:`${f} data item(s) are within the rough mobile density budget for this component.`}));let m=Sa(t),g=!1!==t.showAxes&&!1!==t.axis;if(g&&null!=m){let e=Math.max(3,Math.floor(a/58));m>e&&Pa(s,{id:"density.explicit-tick-count",category:"density",impact:"medium",message:`${m} explicit tick(s) exceed a phone-friendly budget of about ${e} at ${a}px.`,fix:"Use adaptive ticks, fewer tickValues, direct labels, or move exact values into a tap-accessible detail panel."})}else g&&(hu.has(e)||$c.has(e))&&Na(s,{id:"density.axis-label-collision",category:"density",impact:"medium",message:"Axes are enabled, but label collision depends on rendered tick text and cannot be checked statically.",fix:"Verify tick labels at phone widths or provide explicit mobile tick density."});xa(t)?Pa(s,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"The chart exposes tooltip/hover detail without an obvious tap, selection, or control alternative.",fix:"Enable tap-to-select, a persistent details panel, visible segment buttons, or another non-hover path for the same information."}):Ra(s,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"No hover-only detail path is visible from the config."});let y=ka(e,t),b=fa(t.mobileInteraction)?t.mobileInteraction:null,v="number"==typeof b?.targetSize?b.targetSize:!0===t.mobileInteraction?44:"number"==typeof c?.minimumHitTarget?c.minimumHitTarget:"number"==typeof c?.interaction?.targetSize?c.interaction.targetSize:null,w=y??v;null!=w&&(w<24?Pa(s,{id:"interaction.target-size-minimum",category:"interaction",impact:"high",message:`Small interactive marks expose an estimated ${w}px pointer target, below WCAG's 24px minimum.`,fix:"Increase mark radius/hoverRadius, add tap snapping to nearest datum, or provide larger external controls."}):w<i?Pa(s,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${w}px, above 24px but below the ${i}px comfortable phone target.`,fix:"Use hoverRadius/tapRadius near 44px while keeping the visible mark small if needed."}):Ra(s,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${w}px, meeting the configured ${i}px target.`}));let A=[];(null!=t.brush||null!=t.onBrush)&&A.push("brush"),!0===t.zoomable&&A.push("pan/zoom"),("isolate"===t.legendInteraction||"highlight"===t.legendInteraction)&&A.push("legend filtering"),A.length>0&&!$a(t,A)&&Pa(s,{id:"interaction.complex-gesture-alternative",category:"interaction",impact:"high",message:`Mobile-hostile complex interaction detected: ${A.join(", ")} without standard control alternatives.`,fix:"Pair gestures with buttons, range inputs, chips, or a details panel that works with touch and keyboard."});let $=!1!==t.showLegend&&!1!==t.legend&&(!0===t.showLegend||!0===t.legend||null!=t.colorBy||null!=t.groupBy||null!=t.lineBy||null!=t.areaBy||null!=t.stackBy),x=!0===t.directLabel||!0===t.showLabels||"direct"===t.labelStrategy||"direct-end"===t.labelStrategy||"direct"===c?.labels?.strategy||"inline"===c?.labels?.strategy||"external"===c?.labels?.strategy;$&&!x&&a<=430&&Pa(s,{id:"semantics.legend-over-direct-labels",category:"semantics",impact:"medium",message:"The chart appears to rely on a legend instead of direct labels at phone width.",fix:"Prefer direct end labels, inline labels, or a compact chip selector so readers do not bounce between plot and legend."});let C=Array.isArray(t.annotations)?t.annotations.filter(e=>fa(e)):[],S="number"==typeof c?.maxAnnotations?c.maxAnnotations:3;if(C.length>S&&a<=430&&Pa(s,{id:"annotation.mobile-density",category:"annotation",impact:"medium",message:`${C.length} annotation(s) compete for phone plot space.`,fix:"Assign annotation priority, collapse secondary notes into a callout list, or provide shorter mobileText."}),C.length>0){let e=C.filter(e=>!ma(e.mobileText)&&!ma(e.shortText)&&!ma(e.label));e.length>0&&Na(s,{id:"annotation.mobile-copy",category:"annotation",impact:"low",message:`${e.length} annotation(s) lack explicit short/mobile copy.`,fix:"Add mobileText or shortText for notes that need to survive narrow layouts."})}!d&&"BigNumber"!==e&&Na(s,{id:"layout.no-responsive-transform",category:"layout",impact:"low",message:"No explicit responsive transformation hint is present.",fix:"Declare responsiveRules/mobileLayout or a density/label strategy so the mobile version is a designed transformation, not an accidental resize."}),u&&(c?(Ra(s,{id:"semantics.custom-mobile-contract",category:"semantics",impact:"medium",message:"Custom chart/recipe provides a mobileSemantics/mobile contract, so the audit can inspect its authored phone behavior."}),!1===c.custom?.dataBearingSceneNodes?Pa(s,{id:"semantics.custom-data-bearing-scene",category:"semantics",impact:"medium",message:"Custom mobile contract says emitted scene nodes are not data-bearing.",fix:"Preserve datum references, semantic roles, or accessible-table fields so intelligence, navigation, and tap details can recover the chart's meaning."}):!0!==c.custom?.dataBearingSceneNodes&&Na(s,{id:"semantics.custom-data-bearing-scene",category:"semantics",impact:"low",message:"Custom chart mobile contract does not state whether scene nodes are data-bearing.",fix:"Set mobile.custom.dataBearingSceneNodes and mobile.custom.navigationGranularity for custom layouts and interoperability adapters."})):Na(s,{id:"semantics.custom-mobile-contract",category:"semantics",impact:"medium",message:"Custom chart layout is opaque to static mobile analysis because no mobileSemantics/mobile contract is present.",fix:"Declare mobileSemantics with strategy, breakpoints, mark budgets, touch target size, interaction alternatives, and custom scene semantics."})),!p&&!h&&Pa(s,{id:"semantics.no-mobile-summary",category:"semantics",impact:"medium",message:"No title, summary, description, or ChartContainer context is visible from the config.",fix:"Add title/summary text or wrap in ChartContainer so the small-screen reader gets the task before the chart."});let k=s.filter(e=>"warn"===e.status),R={highRisk:k.filter(e=>"high"===e.impact).length,warnings:k.length,manual:s.filter(e=>"manual"===e.status).length,passes:s.filter(e=>"pass"===e.status).length};return{component:e,viewportWidth:a,ok:0===R.highRisk,summary:R,findings:s,reference:"Mobile visualization audit: informed by MobileVisFixer, mobile exploratory interaction research, small-multiple mobile studies, responsive visualization grammars, constraint-based breakpoints, and WCAG 2.2 input modalities."}}function Ta(e){let t=[],r=e.summary,a=e.ok?`no high-risk mobile blockers at ${e.viewportWidth}px`:`${r.highRisk} high-risk mobile issue(s) at ${e.viewportWidth}px`;t.push(`${e.ok?"PASS":"WARN"} ${e.component}: mobile visualization audit`),t.push(` ${a} - ${r.warnings} warning(s) - ${r.manual} manual check(s)`);for(let r of mu){let a=e.findings.filter(e=>e.category===r&&"not-applicable"!==e.status);if(0!==a.length){t.push(""),t.push(` ${r.toUpperCase()}`);for(let e of a)t.push(` ${fu[e.status]} [${e.impact}] ${e.id}: ${e.message}`),e.fix&&("warn"===e.status||"manual"===e.status)&&t.push(` -> ${e.fix}`)}}return t.push(""),t.push(` Ref: ${e.reference}`),t.join("\n")}function Ia(){return["Static audit only: rendered label collision, CSS-resolved type size, and actual touch behavior still require viewport testing.","Use multiple widths, usually 320, 360, 390, 430, and 768 CSS pixels.","A mobile pass means no high-risk static warnings, not that the chart is perceptually or ergonomically optimal."]}function Ma(e,t){if("function"==typeof e)return t=>+e(t);let r=e||t;return e=>+e[r]}function Oa(e,t){if("function"==typeof e)return e;let r=e||t;return e=>e[r]}function Fa(){let e=globalThis;return e[gu]??(e[gu]={intents:/* @__PURE__ */new Map}),e[gu]}function ja(e,t){return bu.has(e)||vu.has(e)||"SwimlaneChart"===e||"GaugeChart"===e?{measure:t.valueAccessor,measureFallback:"value",dimension:t.categoryAccessor??t.stepAccessor,dimensionFallback:"category"}:{measure:t.yAccessor??t.valueAccessor,measureFallback:"y",dimension:t.xAccessor,dimensionFallback:"x"}}function La(e){for(let t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){let r=e[t];if("string"==typeof r&&r)return r}}function za(e,t){return null==e?"—":e instanceof Date?e.toISOString().slice(0,10):"number"==typeof e?t(e):String(e)}function Ba(e,t={}){let r=!0===t.showRetractedAnnotations,a=!0===t.showSupersededAnnotations,i=/* @__PURE__ */new Set;for(let t of e){let e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&i.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!r)return!1;let t=e?.provenance?.stableId;return!(t&&i.has(t)&&!a)})}function Da(e){return"string"==typeof e?e:e.id??e.name}function _a(e){return e.layoutConfig&&"object"==typeof e.layoutConfig?e.layoutConfig:{}}function Ua(e){return Array.isArray(e.data)?e.data:Array.isArray(e.nodes)?e.nodes:Array.isArray(e.points)?e.points:Array.isArray(e.areas)?e.areas:[]}function Ga(e,t,r){return r??Gr(t.recipe)??Gr(t.recipeId)??Dr(e)}function Ha(e,t,r=[]){let a=e.accessor?t[e.accessor]:void 0;if("string"==typeof a&&a)return a;if(e.field)return e.field;let i=r.find(e=>e&&"object"==typeof e);if(!i)return;let n=Object.entries(i).filter(([e,t])=>!e.startsWith("_")&&null!=t);return"quantitative"===e.semanticType?n.find(([,e])=>"number"==typeof e)?.[0]:"identifier"===e.semanticType?["id","key","name"].find(e=>e in i):n.find(([,e])=>"string"==typeof e)?.[0]}function Va(e,t){return e.dataRoles.find(e=>e.role===t)}function qa(e,t){return e.dataRoles.find(e=>t.includes(e.semanticType))}function Wa(e,t,r,a,i,n={}){let o={...n};if(t)for(let[e,r]of Object.entries(t))o[e]=r;for(let e of r.dataRoles){let r=Ha(e,a,i),n=t&&r?t[r]:r;void 0!==n&&(o[e.role]=n)}return e.replace(/\{([^}]+)\}/g,(e,t)=>{let r=o[t];return null==r?`{${t}}`:String(r)})}function Ya(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Ka(e){try{return{number:new Intl.NumberFormat(e,{maximumFractionDigits:2}),percent:new Intl.NumberFormat(e,{style:"percent",maximumFractionDigits:1})}}catch{return{number:new Intl.NumberFormat("en",{maximumFractionDigits:2}),percent:new Intl.NumberFormat("en",{style:"percent",maximumFractionDigits:1})}}}function Ja(e,t,r,a){let i=qa(e,["nominal","ordinal"]),n=qa(e,["quantitative"]),o=i?Ha(i,r,t):void 0,s=n?Ha(n,r,t):void 0,l=i?.role??o??"category",c=n?.role??s??"value",u=e.encodings??[],d=u.length?u.slice(0,3).map(e=>e.meaning.replace(/\.$/,"")).join("; "):`${l} and ${c} are mapped through the recipe's declared visual semantics`,{number:h,percent:p}=Ka(a),f=/* @__PURE__ */new Map;if(o&&s)for(let e of t){let t=String(e[o]??"Uncategorized"),r=Number(e[s]);Number.isFinite(r)&&f.set(t,(f.get(t)??0)+r)}let m=[...f].sort((e,t)=>t[1]-e[1]),g=m.reduce((e,[,t])=>e+t,0),y=m[0],b=m[1],v=g>0?((y?.[1]??0)+(b?.[1]??0))/g:0,w=e.intents.map(e=>({id:Da(e),strength:"string"==typeof e?void 0:e.strength})).sort((e,t)=>"primary"===e.strength?-1:"primary"===t.strength?1:0)[0]?.id,A=e.audience?.primary??e.audienceFit?.find(e=>"strong"===e.fit)?.audience;return{l1:`A ${e.name.toLowerCase()} encodes ${l} and ${c}. ${Ya(d)}.`,l2:m.length>0?`${m.length} categories total ${h.format(g)}. ${y[0]} accounts for ${h.format(y[1])}${g>0?` (${p.format(y[1]/g)})`:""}${b?`, followed by ${b[0]} at ${h.format(b[1])}`:""}.`:`${t.length} data ${1===t.length?"item is":"items are"} represented.`,l3:m.length>=2?v>=.5?`Most of the total is concentrated in ${y[0]} and ${b[0]}, which together account for ${p.format(v)}.`:`The total is distributed across ${m.length} categories without the first two forming a majority.`:y?`${y[0]} is the only represented category.`:"No quantitative pattern can be derived from the available data.",l4:`The chart is intended for ${w??"explanation"}${A?` with a ${A} audience`:""}: ${e.designContract.whyCustom}`}}function Xa(e,t,r={}){let a=Ua(t),i=_a(t),n=r.locale??"en",o=("function"==typeof e.description?e.description({data:a,config:i,locale:n}):void 0)?.levels??Ja(e,a,i,n),s=r.levels??["l1","l2","l3","l4"],l={};for(let e of s)o[e]&&(l[e]=o[e]);let c=["l1","l2","l3","l4"].map(e=>l[e]).filter(e=>!!e).join(" "),u=r.includeCaveats?[...e.reception?.risks??[],...e.caveats??[],...(e.designContract.misuse??[]).map(e=>`Misuse: ${e}`)]:void 0;return{text:c,levels:l,...u?.length?{caveats:u}:{}}}function Za(e){let t=Math.max(2,Math.round(e.bins)),r=Math.max(1,Math.round(e.pegRows??t-1)),a=Math.max(1,Math.round(e.count??Math.max(64,4*t))),i=mt(Number.isFinite(e.branchProbability)?e.branchProbability??.5:.5,0,1),n=Ge(e.seed??1),o=e.idPrefix??"mechanical";return Array.from({length:a},(e,t)=>{let a=0;for(let e=0;e<r;e+=1)n()<i&&(a+=1);let s=r/2;return{id:`${o}-${t}`,value:a,mechanical:!0,pegRows:r,branchProbability:i,pathRights:a,side:a<s?"left":a>s?"right":"center"}})}function Qa(e){let{windowSize:t,watermark:r,watermarkAtArrivalAccessor:a}=e;if(!(Number.isFinite(t)&&t>0))throw new RangeError("EventDrop windows.size must be a finite positive number");let{rows:i}=wt(e.data,"event"),n=i.flatMap((t,r)=>{let a=ft(pt(t,r,e.timeAccessor));return null==a?[]:[{datum:t,index:r,eventTime:a,arrivalTime:ft(pt(t,r,e.arrivalAccessor))??a,watermarkAtArrival:0,late:!1}]}),o="function"==typeof r?null:ft(r?.value),s="function"==typeof r?t:ft(r?.delay)??t,l=-1/0,c=-1/0;for(let e of n.slice().sort((e,t)=>e.arrivalTime-t.arrivalTime||e.index-t.index)){l=Math.max(l,e.eventTime);let i="function"==typeof r?ft(r(l)):l-s;c=o??Math.max(c,i??l-t);let n=a?ft(pt(e.datum,e.index,a)):null;e.watermarkAtArrival=n??c;let u=(Math.floor(e.eventTime/t)+1)*t;e.late=u<=e.watermarkAtArrival}return{events:n,watermarkValue:n.length?c:o??-s}}function ei(e,t){let r="mechanical"===(t.simulationMode??t.mode)&&("GaltonBoardChart"===e||"UnitPileChart"===e);if(!Array.isArray(t.data)&&!r)return null;let a=Array.isArray(t.data)?t.data:[],i=Math.max(2,Math.round(ft(t.bins)??21)),n=Math.max(1,Math.round(ft(t.pegRows)??i-1));if(r&&(a="GaltonBoardChart"===e?Za({bins:i,count:t.mechanicalCount,pegRows:n,branchProbability:t.branchProbability,seed:t.seed}):bt({count:t.mechanicalCount,categories:t.mechanicalCategories,unitValue:t.unitValue,seed:t.seed})),a=wt(a,"UnitPileChart"===e?"pile":"GaltonBoardChart"===e?"galton":"EventDropChart"===e?"event":"collision-swarm").rows,"UnitPileChart"===e){let e=/* @__PURE__ */new Map,i=t.valueAccessor??(r?"value":void 0);return a.forEach((r,a)=>{let n=String(pt(r,a,t.categoryAccessor??"category")??"unknown"),o=i?ft(pt(r,a,i)):1;e.set(n,(e.get(n)??0)+Math.max(0,o??0))}),{generated:r,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("GaltonBoardChart"===e){let e=a.map((e,r)=>ft(pt(e,r,t.valueAccessor??"value"))).filter(e=>null!=e),o=r?[0,n]:yt(t.valueExtent),s=o?.[0]??(e.length?Math.min(...e):0),l=o?.[1]??(e.length?Math.max(...e):1),c=s===l?1:l-s,u=Array.from({length:i},(e,t)=>({label:String(t+1),value:0}));for(let t of e)u[Math.max(0,Math.min(i-1,Math.floor((t-s)/c*i)))].value+=1;return{generated:r,rows:u}}if("CollisionSwarmChart"===e){let e=/* @__PURE__ */new Map;return a.forEach((r,a)=>{if(null==ft(pt(r,a,t.xAccessor??"x")))return;let i=t.groupAccessor?String(pt(r,a,t.groupAccessor)??"All"):"All";e.set(i,(e.get(i)??0)+1)}),{generated:r,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("EventDropChart"===e){let e=ft(t.windows?.size??10);if(null==e||e<=0)return null;let{events:i}=Qa({data:a,timeAccessor:t.timeAccessor??"time",arrivalAccessor:t.arrivalAccessor??"arrivalTime",windowSize:e,watermark:t.watermark,watermarkAtArrivalAccessor:t.watermarkAtArrivalAccessor}),n=i.map(e=>e.eventTime),o=n.length?Math.min(...n):0,s=n.length?Math.max(...n):o+e,l=Math.min(ft(t.timeExtent?.[0])??o,o),c=Math.max(ft(t.timeExtent?.[1])??s,s),u=Math.floor(l/e)*e,d=Math.max(1,Math.ceil((c-u+e)/e)),h=Array.from({length:d},(t,r)=>({label:`${u+r*e}-${u+(r+1)*e}`,value:0,secondary:0,secondaryLabel:"late"}));for(let t of i){let r=h[Math.max(0,Math.min(d-1,Math.floor((t.eventTime-u)/e)))];t.late?r.secondary+=1:r.value+=1}return{generated:r,rows:h}}return null}function ti(e){let t="number"==typeof e?e:"string"==typeof e?Number(e):NaN;return Number.isFinite(t)?t:void 0}function ri(e,t){let r=e.physics&&"object"==typeof e.physics?e.physics:null,a=e.settledProjection&&"object"==typeof e.settledProjection?e.settledProjection:null,i=[e.settledProjectionRows,e.projectionRows,a?.rows,r?.settledProjectionRows,r?.projectionRows,r?.settledProjection&&"object"==typeof r.settledProjection?r.settledProjection.rows:void 0].find(e=>Array.isArray(e));return Array.isArray(i)?i.map((e,r)=>{if(!e||"object"!=typeof e)return null;let a=e,i=ti(a.count??a.value??a.total??a.bodies??a.events);if(null==i)return null;let n=a.label??a.id??a.name??`container ${r+1}`,o=ti(a.secondary??a.secondaryCount),s=ti(a.observed??a.observedCount);return{label:za(n,t),count:i,...null!=o?{secondary:o}:{},..."string"==typeof a.secondaryLabel&&a.secondaryLabel?{secondaryLabel:a.secondaryLabel}:{},...null!=s?{observed:s}:{}}}).filter(e=>null!=e):null}function ai(e){return"EventDropChart"===e?"time window":"GaltonBoardChart"===e?"bin":"CollisionSwarmChart"===e?"group lane":"PacketFlowChart"===e?"flow node":"CrucibleChart"===e?"result group":"container"}function ii(e){return"EventDropChart"===e?"event":"GaltonBoardChart"===e?"sample":"CollisionSwarmChart"===e?"point":"PacketFlowChart"===e?"packet":"CrucibleChart"===e?"settled item":"UnitPileChart"===e?"unit":"body"}function ni(e,t){return"EventDropChart"===e?"An event-drop physics chart that collapses moving events into a settled projection by event-time window.":"GaltonBoardChart"===e?"A Galton board chart that collapses falling samples into a settled histogram projection.":"UnitPileChart"===e?"A physics pile chart that collapses moving bodies into a settled bar-style projection by container.":"CollisionSwarmChart"===e?"A collision swarm chart that separates overlapping points while preserving their quantitative axis position.":"PacketFlowChart"===e?"A physical flow chart that keeps authored routes visible while packet bodies show throughput and proximity events.":"CrucibleChart"===e?"A crucible physics chart that replays authored phases and events into declared products and outlets; the settled ledger, not collisions, determines the result.":`A ${t} whose accessible reading is the settled projection rather than individual trajectories.`}function oi(e,t){if(!(t>0))return"0%";let r=e/t*100;return`${r>=10?Math.round(r):Math.round(10*r)/10}%`}function si(e,t,r,a,i,n,o=null){let s=ai(e),l=o&&"EventDropChart"===e?"accepted event":ii(e),c=o?o.generated?"The generated sample projection":"The source projection":"The settled projection";if(i.has("l1")&&(a.l1=ni(e,t)),!i.has("l2")&&!i.has("l3"))return;if(!r||0===r.length)return void(i.has("l2")&&(a.l2=o?"No valid source records are available.":"No settled projection is loaded yet."));let u=r.reduce((e,t)=>e+t.count,0),d=r.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),h=d[0]??r.slice().sort((e,t)=>t.count-e.count)[0];if(!h)return;let p=r.reduce((e,t)=>e+(t.secondary??0),0),f=r.find(e=>e.secondaryLabel)?.secondaryLabel??"secondary";if(i.has("l2"))if(o&&"EventDropChart"===e)a.l2=`${c} classifies ${n(u+p)} ${li(u+p,"event")} across ${r.length} ${li(r.length,s)}: ${n(u)} accepted and ${n(p)} late.`;else if(0===d.length)a.l2=`${c} contains ${n(u)} ${li(u,l)} across ${r.length} ${li(r.length,s)}; no ${li(2,s)} are non-empty yet.`;else{let e=p>0?` ${n(p)} ${li(p,l)} ${1===p?"is":"are"} marked ${f}.`:"";a.l2=`${c} contains ${n(u)} ${li(u,l)} across ${r.length} ${li(r.length,s)}; ${d.length} ${li(d.length,s)} ${1===d.length?"is":"are"} non-empty. The largest ${s} is ${h.label} with ${n(h.count)} ${li(h.count,l)}.${e}`}if(i.has("l3")&&u>0&&d.length>0){let e=d.find(e=>e!==h),t=oi(h.count,u);a.l3=e?`${c} is most concentrated in ${h.label}, which holds ${n(h.count)} ${li(h.count,l)} (${t}); ${e.label} follows with ${n(e.count)} ${li(e.count,l)}.`:`${c} is concentrated in ${h.label}, which holds all ${n(h.count)} ${li(h.count,l)}.`}}function li(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:`${t}s`}function ci(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()}function ui(e){return Au[e]||`${ci(e)} chart`}function di(e){let t=/* @__PURE__ */new Set,r=e=>{let a=Su[e];if(a)return a;if(t.has(e))return;let i=Fa().intents.get(e);if(!i?.composes?.length)return;t.add(e);let n=[...i.composes].sort((e,t)=>{let r=e=>{let t=Ru.indexOf(e);return t<0?Ru.length:t};return(i.weights?.[t]??1)-(i.weights?.[e]??1)||r(e)-r(t)});for(let a of n){let i=r(a);if(i)return t.delete(e),i}t.delete(e)};return r(e)}function hi(e){let t,r=0;for(let[a,i]of Object.entries(e))if("number"==typeof i&&i>0){if(i>r){t=a,r=i;continue}if(i===r&&void 0!==t){let e=Ru.indexOf(a),r=Ru.indexOf(t);-1!==e&&(-1===r||e<r)&&(t=a)}}return t}function pi(e){return"BumpChart"===e?"ranking":vu.has(e)||"StackedAreaChart"===e?"apportioning":Cu.has(e)?"relating":bu.has(e)?"comparing":wu.has(e)?"characterizing":yu.has(e)?"tracking":$u.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}function fi(e){if(e){if("fits"in e||"buildProps"in e){let t=e,r={};for(let[e,a]of Object.entries(t.intentScores))"number"==typeof a&&Number.isFinite(a)&&(r[e]=a);return{family:t.family,intentScores:Object.keys(r).length?r:void 0}}return e}}function mi(e,t){let r=fi(t);if(r?.act)return r.act;if(r?.intentScores){let e=hi(r.intentScores);if(e&&Su[e]&&(r.intentScores[e]??0)>=3)return Su[e]}return r?.family?ku[r.family]:pi(e)}function gi(e){let t=e.annotations;return!!Array.isArray(t)&&t.some(e=>{if(!e||"object"!=typeof e)return!1;let t=e;if("string"!=typeof t.type||!Nu.has(t.type))return!1;let r=t.provenance;return!(!r||"object"!=typeof r)&&(Eu.has(r.authorKind)||Tu.has(r.source)||Iu.has(r.basis))})}function yi(e="en"){let t,r;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),r=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch{t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),r=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?Math.abs(e)>=1e4?t.format(e):r.format(e):String(e)}function bi(e,t,r,a){let i=0,n=0,o=1/0,s=-1/0,l=null,c=null,u=0,d=0,h=null,p=null,f=NaN,m=NaN;for(let r of e){let e=t(r);Number.isFinite(e)&&(0===i&&(f=e,h=r),m=e,p=r,e<o&&(o=e,l=r,u=i),e>s&&(s=e,c=r,d=i),i++,n+=e)}return 0===i?null:{count:i,min:o,max:s,mean:n/i,minLabel:za(null!=l?r(l):null,a),maxLabel:za(null!=c?r(c):null,a),first:f,last:m,firstLabel:za(null!=h?r(h):null,a),lastLabel:za(null!=p?r(p):null,a),minIndex:u,maxIndex:d}}function vi(e){return e.length<=1?e[0]??"":2===e.length?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`}function wi(e){let t=e.provenance&&"object"==typeof e.provenance?e.provenance:null,r=t?.authorKind??t?.source??t?.basis;return"watcher"===r?"a watcher-flagged ":"agent"===r||"ai"===r||"llm-inference"===r?"an AI-suggested ":""}function Ai(e){let t="string"==typeof e.type?e.type:"annotation",r=Mu[t]||"an annotation",a=wi(e),i=a?a+r.replace(/^an? /,""):r,n="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return n?`${i} labeled "${n}"`:i}function $i(e){let t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;let r=Ba(t.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return;let a=r.map(Ai),i=a.slice(0,5),n=a.length-i.length,o=vi(i)+(n>0?`, and ${n} more`:""),s=r.length;return`The author has marked ${1===s?"one feature":`${s} features`} on this chart: ${o}.`}function xi(e,t,r={}){let a=void 0!==r.levels,i=new Set(r.levels??["l1","l2","l3"]);!a&&(r.capability||gi(t))&&i.add("l4");let n=Ga(e,t,r.recipe);if(n){let e=["l1","l2","l3","l4"].filter(e=>i.has(e));!a&&!e.includes("l4")&&e.push("l4");let o=Xa(n,t,{levels:e,locale:r.locale,audience:r.audience,includeCaveats:r.includeCaveats}),s=$i(t);return{...o,text:s?`${s} ${o.text}`.trim():o.text,...s?{annotations:s}:{}}}let o=yi(r.locale??"en"),s=ui(e),l=Array.isArray(t.data)?t.data:null,c=La(t),u=xu.has(e)?ri(t,o):null,d=xu.has(e)&&null===u?ei(e,t):null,{measure:h,measureFallback:p,dimension:f,dimensionFallback:m}=ja(e,t),g="string"==typeof h&&h?h:p,y="string"==typeof f&&f?f:m,b={};if(xu.has(e)&&si(e,s,u??(d?ri({projectionRows:d.rows},o):null),b,i,o,d),i.has("l1")&&!xu.has(e))if("BumpChart"===e)b.l1=`A ${s} ranking ${c??"series"} by ${g} across ${y}.`;else if(yu.has(e)||bu.has(e))b.l1=`A ${s} of ${g} by ${y}`+(c?`, split by ${c}.`:".");else if(vu.has(e))b.l1=`A ${s} showing ${g} across ${y} categories.`;else if(wu.has(e))b.l1=`A ${s} of the distribution of ${g}`+(c?` by ${c}.`:".");else if($u.has(e)){let e=Array.isArray(t.nodes)?t.nodes.length:void 0,r=Array.isArray(t.edges)?t.edges.length:void 0,a=[null!=e?`${e} ${Ii(e,"node")}`:null,null!=r?`${r} ${Ii(r,"edge")}`:null].filter(Boolean);b.l1=`A ${s}${a.length?` with ${a.join(" and ")}`:""}.`}else if("BigNumber"===e){let e="string"==typeof t.label?t.label:g;b.l1=`A single value${e?` for ${e}`:""}.`}else b.l1=`A ${s}.`;let v=yu.has(e)||"BumpChart"===e||bu.has(e)||vu.has(e)||wu.has(e),w=null;if((i.has("l2")||i.has("l3")||i.has("l4"))&&v&&l&&l.length>0&&(w=bi(l,Ma(h,p),Oa(f,m),o)),i.has("l2")&&v&&(l&&0!==l.length?w&&(vu.has(e)?b.l2=`${w.count} segments totaling ${o(Ci(w))}. Largest is ${w.maxLabel} at ${o(w.max)}; smallest is ${w.minLabel} at ${o(w.min)}.`:b.l2=`${g} ranges from ${o(w.min)} (${w.minLabel}) to ${o(w.max)} (${w.maxLabel}), with a mean of ${o(w.mean)} across ${w.count} points.`):b.l2="No data is loaded yet."),i.has("l3")&&w&&!c&&yu.has(e)?b.l3=Si(w,g,o):i.has("l3")&&w&&!c&&bu.has(e)&&(b.l3=`The highest ${y} is ${w.maxLabel} and the lowest is ${w.minLabel}.`),i.has("l4")){let a=gi(t)?"alerting":mi(e,r.capability);if(a){let i=c?null:w;b.l4=ki(a,e,t,i,g,y,o,r.audience)}}let A=["l1","l2","l3","l4"].filter(e=>i.has(e)&&b[e]).map(e=>b[e]).join(" "),$=$i(t);return{text:$?`${$} ${A}`.trim():A,levels:b,...$?{annotations:$}:{}}}function Ci(e){return e.mean*e.count}function Si(e,t,r){let{first:a,last:i,min:n,max:o,maxLabel:s,minLabel:l,firstLabel:c,lastLabel:u,minIndex:d,maxIndex:h,count:p}=e,f=o-n,m=i-a;if(0===f)return`${Ti(t)} is constant at ${r(a)} across the series.`;if(f/(Math.abs(e.mean)||1)<.04)return`${Ti(t)} ends roughly where it started (${r(a)} at ${c} to ${r(i)} at ${u}), ranging between ${r(n)} and ${r(o)}.`;let g=h>0&&h<p-1,y=d>0&&d<p-1,b=(o-Math.max(a,i))/f,v=(Math.min(a,i)-n)/f;return g&&b>.15?`Overall ${t} climbs to a peak of ${r(o)} (${s}), then falls to ${r(i)} (${u}).`:y&&v>.15?`Overall ${t} drops to a low of ${r(n)} (${l}), then recovers to ${r(i)} (${u}).`:Math.abs(m)/f<.05?`${Ti(t)} ends roughly where it started (${r(a)} at ${c} to ${r(i)} at ${u}), ranging between ${r(n)} and ${r(o)}.`:m>0?h===p-1?`Overall ${t} rises from ${r(a)} (${c}) to a peak of ${r(i)} (${u}).`:`Overall ${t} rises from ${r(a)} (${c}) to ${r(i)} (${u}), after peaking at ${r(o)} (${s}).`:d===p-1?`Overall ${t} falls from ${r(a)} (${c}) to a low of ${r(i)} (${u}).`:`Overall ${t} falls from ${r(a)} (${c}) to ${r(i)} (${u}), after dipping to ${r(n)} (${l}).`}function ki(e,t,r,a,i,n,o,s){let l,c,u=Pu[e],d=/^[aeiou]/i.test(u)?"an":"a";switch(e){case"locating":l="This is a map",c="read values by location";break;case"presenting":l="This is a single-value display",c=`read ${"string"==typeof r.label&&r.label?r.label:i} as the headline number`;break;case"tracing":l=`This is ${d} ${u} chart`,c="follow the movement between states";break;case"nesting":l=`This is ${d} ${u} chart`,c="read it for nested structure and how children sum into their parents";break;case"relating":l=`This is ${d} ${u} chart`,c=`read it for whether ${n} and ${i} move together`;break;default:l=`This is ${d} ${u} chart`,c=Ri(e,a,i,n,o,t)}return`${l}; ${c}.${Ei(t,s)}`}function Ri(e,t,r,a,i,n){if(!t)switch(e){case"alerting":return"watch for points that break from the rest";case"tracking":return`read it for the overall direction of ${r}`;case"comparing":return`compare ${r} across ${a}`;case"ranking":return`read it top to bottom by ${r}`;case"apportioning":return`read each ${a}'s share of the whole`;case"characterizing":return`read it for the spread and shape of ${r}`;default:return"read the highlighted features"}switch(e){case"alerting":return Pi(t,i,n);case"tracking":return`read it for the trajectory of ${r}, which ${Ni(t)} from ${i(t.first)} (${t.firstLabel}) to ${i(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${r} across ${a}; ${t.maxLabel} leads at ${i(t.max)}`;case"ranking":return`read it top to bottom by ${r}; ${t.maxLabel} ranks highest at ${i(t.max)}`;case"apportioning":{let e=t.mean*t.count,r=e>0?Math.round(t.max/e*100):null;return`read each ${a}'s share of the ${i(e)} total; ${t.maxLabel} is the largest at ${i(t.max)}${null!=r?` (${r}%)`:""}`}case"characterizing":return`read it for the spread of ${r}, from ${i(t.min)} to ${i(t.max)}`;default:return"read the highlighted features"}}function Pi(e,t,r){if(bu.has(r)||vu.has(r))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;let{first:a,last:i,min:n,max:o,minLabel:s,maxLabel:l,lastLabel:c,minIndex:u,maxIndex:d,count:h}=e,p=o-n;if(p>0){let e=d>0&&d<h-1,r=u>0&&u<h-1,f=(o-Math.max(a,i))/p,m=(Math.min(a,i)-n)/p;if(e&&f>.15)return`the peak of ${t(o)} at ${l} is the point to investigate`;if(r&&m>.15)return`the dip to ${t(n)} at ${s} is the point to investigate`;if(i>=o)return`the climb to ${t(i)} at ${c} warrants a closer look`;if(i<=n)return`the drop to ${t(i)} at ${c} warrants a closer look`}return`the extremes — ${l} (${t(o)}) and ${s} (${t(n)}) — are the points to check`}function Ni(e){let t=e.max-e.min,r=e.last-e.first;return 0===t||Math.abs(r)/t<.05?"holds roughly steady":r>0?"rises":"falls"}function Ei(e,t){if(!t)return"";let r=t.familiarity?.[e];return"number"==typeof r&&r<=2?` This ${ui(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`:""}function Ti(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function Ii(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:`${t}s`}function Mi(e){return String(e??"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Oi(e){return!!e&&"object"==typeof e}function Fi(e,t,r,a){let i=qa(t,["nominal","ordinal"]),n=t.dataRoles.filter(e=>"quantitative"===e.semanticType),o=i?Ha(i,r,a):void 0,s=[];o&&null!=e[o]&&s.push(String(e[o]));for(let t of n){let i=Ha(t,r,a);i&&null!=e[i]&&s.push(`${t.role}: ${String(e[i])}`)}return s.length>0?s.join(", "):"Data item"}function ji(e,t,r={}){let a=Ua(t),i=_a(t),n=Math.max(1,r.maxLeaves??200),o=r.locale??"en";if("function"==typeof e.navigation)return e.navigation({data:a,config:i,locale:o});let s=Oi(e.navigation)?e.navigation:void 0,l=(s?.groupByRole?Va(e,s.groupByRole):void 0)??(s?.groupBy?.[0]?Va(e,s.groupBy[0])??e.dataRoles.find(e=>e.field===s.groupBy?.[0]):void 0)??qa(e,["nominal","ordinal"]),c=l?Ha(l,i,a):void 0,u=(s?.idRole?Va(e,s.idRole):void 0)??qa(e,["identifier"]),d=u?Ha(u,i,a):void 0,h={id:"root",role:"chart",label:s?.summaryTemplate?Wa(s.summaryTemplate,void 0,e,i,a,{count:a.length}):`${e.name}: ${a.length} ${1===a.length?"item":"items"} represented.`,level:1,children:[]},p=0,f=(t,r,n)=>{let o=d?t[d]:void 0,l=s?.itemLabelTemplate?Wa(s.itemLabelTemplate,t,e,i,a,{count:a.length}):Fi(t,e,i,a);return{id:`datum-${Mi(o??r)}`,role:"datum",label:l,level:n,datum:t}};if(c){let e=/* @__PURE__ */new Map;for(let t of a){let r=String(t[c]??"Uncategorized"),a=e.get(r);a?a.push(t):e.set(r,[t])}h.children=[...e].map(([e,t],r)=>{let a=Math.max(0,n-p),i=t.slice(0,a);p+=i.length;let o=i.map((e,t)=>f(e,1e5*r+t,3));return i.length<t.length&&o.push({id:`more-${Mi(e)}`,role:"datum",label:`…and ${t.length-i.length} more items`,level:3}),{id:`group-${Mi(e)}`,role:"series",label:`${e}: ${t.length} ${1===t.length?"item":"items"}.`,level:2,children:o}})}else{let e=a.slice(0,n);h.children=e.map((e,t)=>f(e,t,2)),e.length<a.length&&h.children.push({id:"more",role:"datum",label:`…and ${a.length-e.length} more items`,level:2})}return h}function Li(e,t,r){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:r]}function zi(e,t="—"){if(null==e||""===e)return t;if("object"==typeof e){let r=e;return zi(r.id??r.name??r.label,t)}return String(e)}function Bi(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function Di(e){return zi(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function _i(e,t){let r=Li(e,t,"children");return Array.isArray(r)?r:[]}function Ui(e,t,r){return`${e} ${1===e?t:r}`}function Gi(e,t){return 0===e.numericLeaves?"":e.numericLeaves===e.leaves?`, leaf total ${t(e.leafTotal)}`:`, known leaf total ${t(e.leafTotal)} across ${Ui(e.numericLeaves,"valued leaf","valued leaves")}`}function Hi(e){return"TreeDiagram"===e?"tree":"Treemap"===e?"treemap":"CirclePack"===e?"circle-packing":"orbit"}function Vi(e,t,r,a){let i=t.data&&"object"==typeof t.data?t.data:null,n=t.childrenAccessor??"children",o=t.valueAccessor??"value",s=t.nodeLabel??t.nodeIdAccessor,l=/* @__PURE__ */new WeakMap,c=/* @__PURE__ */new WeakSet,u=e=>{let t=l.get(e);if(t)return t;if(c.has(e))return{descendants:0,depth:0,leaves:0,numericLeaves:0,leafTotal:0};c.add(e);let r,a=_i(e,n);if(0===a.length){let t=Bi(Li(e,o,"value"));r={descendants:0,depth:1,leaves:1,numericLeaves:null==t?0:1,leafTotal:t??0}}else r=a.reduce((e,t)=>{let r=u(t);return{descendants:e.descendants+1+r.descendants,depth:Math.max(e.depth,r.depth+1),leaves:e.leaves+r.leaves,numericLeaves:e.numericLeaves+r.numericLeaves,leafTotal:e.leafTotal+r.leafTotal}},{descendants:0,depth:1,leaves:0,numericLeaves:0,leafTotal:0});return c.delete(e),l.set(e,r),r},d=0,h=(e,t,i,l)=>{let c=zi(Li(e,s,"name"),`item ${i}`);if(l.has(e))return{id:`hierarchy-${Di(i)}-cycle`,role:"datum",level:t,label:`Repeated hierarchy reference to ${c}; branch omitted.`};let p=_i(e,n),f=u(e);if(0===p.length){if(d>=r)return null;d+=1;let n=Bi(Li(e,o,"value"));return{id:`hierarchy-${Di(i)}-${Di(c)}`,role:"datum",level:t,label:`${c}${null==n?"":`: ${a(n)}`}.`,...null==n?{}:{value:n},datum:e}}let m=new Set(l);m.add(e);let g=[],y=0;for(let[e,a]of p.entries()){if(d>=r){y+=u(a).leaves;continue}let n=h(a,t+1,`${i}-${e}`,m);n&&g.push(n)}return y>0&&g.push({id:`hierarchy-${Di(i)}-more`,role:"datum",level:t+1,label:`${Ui(y,"more leaf","more leaves")} in ${c} not shown; navigation is capped at ${r}.`}),{id:`hierarchy-${Di(i)}-${Di(c)}`,role:"series",level:t,label:`${c}: ${Ui(p.length,"direct child","direct children")}, ${Ui(f.descendants,"total descendant","total descendants")}, ${Ui(f.leaves,"leaf","leaves")}${Gi(f,a)}.`,datum:e,children:g}},p=i?u(i):null,f={id:"root",role:"chart",level:1,label:i?`A ${Hi(e)} chart with ${Ui(p.leaves,"leaf","leaves")} and ${Ui(p.descendants,"total descendant","total descendants")} across ${Ui(p.depth,"hierarchy level","hierarchy levels")}${Gi(p,a)}.`:"A hierarchy chart with no hierarchy data loaded.",children:[]};if(i){let e=h(i,2,"root",/* @__PURE__ */new Set);if(e){let t=zi(Li(i,s,"name"),"");f.children="series"===e.role&&""===t?e.children:[e]}}return f}function qi(e,t,r){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:r]}function Wi(e,t="—"){if(null==e||""===e)return t;if("object"==typeof e){let r=e;return Wi(r.id??r.name??r.label,t)}return String(e)}function Yi(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function Ki(e){return Wi(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Ji(e){let t=[];return(e.linkedHover||e.selection||e.linkedBrush)&&t.push("Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&t.push("Hover or focus a mark for its details."),t.length>0?` ${t.join(" ")}`:""}function Xi(e){if(Array.isArray(e))return e;if(!e||"object"!=typeof e)return[];let t=e;return Array.isArray(t.features)?t.features:"Feature"===t.type?[t]:[]}function Zi(e,t,r){let a=qi(e,t,r);if(void 0!==a)return a;let i=e.properties;return i&&"object"==typeof i?qi(i,t,r):void 0}function Qi(e,t,r){return Wi(Zi(e,t,"id")??Zi(e,"name","name")??Zi(e,"NAME","NAME")??Zi(e,"label","label"),r)}function en(e){let t=0,r=1/0,a=-1/0,i=0;for(let n of e)null!=n.value&&(t+=1,r=Math.min(r,n.value),a=Math.max(a,n.value),i+=n.value);return 0===t?null:{count:t,min:r,max:a,total:i,average:i/t}}function tn(e,t){let r=en(e);return r?`range ${t(r.min)} to ${t(r.max)}, average ${t(r.average)}, total ${t(r.total)}`:"no numeric values"}function rn(e){let t=e.filter(e=>null!=e.value),r=e.filter(e=>null==e.value),a=[],i=en(t);if(i)if(i.min===i.max)a.push({id:"equal",label:"Equal values",rows:t});else{let e=i.min+(i.max-i.min)/3,r=i.min+2*(i.max-i.min)/3,n=t.filter(e=>e.value>=r),o=t.filter(t=>t.value>=e&&t.value<r),s=t.filter(t=>t.value<e);n.length>0&&a.push({id:"highest",label:"Highest values",rows:n}),o.length>0&&a.push({id:"middle",label:"Middle values",rows:o}),s.length>0&&a.push({id:"lowest",label:"Lowest values",rows:s})}return r.length>0&&a.push({id:"missing",label:"No numeric value",rows:r}),a}function an(e,t,r){let a,i=e.filter(e=>null!=e.value).sort((e,t)=>t.value-e.value||e.index-t.index),n=/* @__PURE__ */new Map,o=0;for(let[e,t]of i.entries())a!==t.value&&(o=e+1,a=t.value),n.set(t.index,o);let s=0;return rn(e).map(e=>{let a=Math.max(0,t-s),o=e.rows.slice(0,a);s+=o.length;let l=o.map(e=>{let t=n.get(e.index),a=null==t||i.length<2?"":`, rank ${t} of ${i.length}`;return{id:`geo-${Ki(e.label)}-${e.index}`,role:"datum",level:3,label:null==e.value?`${e.label}: no numeric value.`:`${e.label}: ${r(e.value)}${a}.`,...null==e.value?{}:{value:e.value},datum:e.datum}}),c=e.rows.length-o.length;return c>0&&l.push({id:`geo-${e.id}-more`,role:"datum",level:3,label:`${c} more ${1===c?"region":"regions"} in ${e.label.toLowerCase()} not shown; navigation is capped at ${t}.`}),{id:`regions-${e.id}`,role:"series",level:2,label:`${e.label}: ${e.rows.length} ${1===e.rows.length?"region":"regions"}, ${tn(e.rows,r)}.`,children:l}})}function nn(e,t,r,a){let i=Xi(t.areas),n="FlowMap"===e&&Array.isArray(t.nodes)?t.nodes:Array.isArray(t.points)?t.points:[],o=Array.isArray(t.flows)?t.flows:[],s=Array.isArray(t.lines)?t.lines:[],l=t.valueAccessor??t.sizeBy??t.costAccessor??"value",c=t.pointIdAccessor??t.nodeIdAccessor??"id",u=("ChoroplethMap"===e?i:n).map((r,a)=>({datum:r,index:a,label:Qi(r,"ChoroplethMap"===e?t.idAccessor:c,`${"ChoroplethMap"===e?"region":"location"} ${a+1}`),value:Yi(Zi(r,l,"value"))})),d=u.filter(e=>null!=e.value),h={id:"root",role:"chart",level:1,label:`${"ChoroplethMap"===e?`A choropleth map with ${i.length} regions.${d.length>0?` Values are available for ${d.length} of ${i.length} regions; ${tn(d,a)}.`:" No regions have numeric values."}`:"FlowMap"===e?`A flow map with ${o.length} flows and ${n.length} locations.`:"DistanceCartogram"===e?`A distance cartogram with ${n.length} locations and ${s.length} routes.`:`A proportional-symbol map with ${n.length} locations.`}${Ji(t)}`,children:[]};if("ChoroplethMap"===e)h.children=an(u,r,a);else if(u.length>0){let e=u.slice(0,r).map(e=>({id:`geo-${Ki(e.label)}-${e.index}`,role:"datum",level:3,label:`${e.label}${null==e.value?"":`: ${a(e.value)}`}.`,...null==e.value?{}:{value:e.value},datum:e.datum}));u.length>r&&e.push({id:"geo-more",role:"datum",level:3,label:`…and ${u.length-r} more locations.`}),h.children?.push({id:"locations",role:"series",level:2,label:`Locations: ${u.length} marks.`,children:e})}let p="FlowMap"===e?o:s;if(p.length>0){let e=p.slice(0,r).map((e,t)=>{let r=Wi(e.source,"unknown"),i=Wi(e.target,"unknown"),n=Yi(qi(e,l,"value"));return{id:`route-${Ki(r)}-${Ki(i)}-${t}`,role:"datum",level:3,label:`${r} to ${i}${null==n?"":`: ${a(n)}`}.`,...null==n?{}:{value:n},datum:e}});h.children?.push({id:"routes",role:"series",level:2,label:`Routes: ${p.length} ${1===p.length?"route":"routes"}.`,children:e})}return h}function on(e,t={},r={}){return!!Ga(e,t,r.recipe)||Ou.has(e)||Fu.has(e)||ju.has(e)||yu.has(e)||bu.has(e)||vu.has(e)||wu.has(e)}function sn(e,t,r){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:r]}function ln(e,t="—"){if(null==e||""===e)return t;if("object"==typeof e){let r=e;return ln(r.id??r.name??r.label,t)}return String(e)}function cn(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function un(e){return ln(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function dn(e,t){let r=[];return(e.linkedHover||e.selection||e.linkedBrush)&&r.push("network"===t?"Use linked highlighting to trace related marks.":"Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&r.push("Hover or focus a mark for its details."),r.length>0?` ${r.join(" ")}`:""}function hn(e,t){t&&e.children?.push(t)}function pn(e,t,r,a){let i=Array.isArray(t.nodes)?t.nodes:[],n=Array.isArray(t.edges)?t.edges:Array.isArray(t.flows)?t.flows:[],o=t.nodeIdAccessor??t.nodeIDAccessor,s=t.sourceAccessor??"source",l=t.targetAccessor??"target",c=t.valueAccessor??"value",u=e=>ln(sn(e,o,"id"),"unknown"),d=(e,t)=>ln(sn(e,t,""),"unknown"),h=/* @__PURE__ */new Set;for(let e of n)h.add(d(e,s)),h.add(d(e,l));let p=i.length>0?i:[...h].map(e=>({id:e})),f=/* @__PURE__ */new Map;for(let e of p)f.set(u(e),{links:0,value:0});for(let e of n){let t=d(e,s),r=d(e,l),a=cn(sn(e,c,"value"))??0;for(let e of[t,r]){let t=f.get(e)??{links:0,value:0};t.links+=1,t.value+=a,f.set(e,t)}}let m={id:"root",role:"chart",level:1,label:`A ${"SankeyDiagram"===e||"ProcessSankey"===e?"flow diagram":"ChordDiagram"===e?"chord diagram":"network graph"} with ${p.length} nodes and ${n.length} links.${dn(t,"network")}`,children:[]},g=0,y=/* @__PURE__ */new Map,b=t.colorBy??"group";for(let e of p){let t=ln(sn(e,b,"group"),"Ungrouped"),r=y.get(t);r?r.push(e):y.set(t,[e])}let v=[...y].map(([e,t],i)=>{let n=[];for(let[e,o]of t.entries()){if(g>=r)break;g+=1;let t=u(o),s=f.get(t)??{links:0,value:0},l=s.value>0?`, ${a(s.value)} total flow`:"";n.push({id:`node-${i}-${e}-${un(t)}`,role:"datum",level:3,label:`${t}: ${s.links} ${1===s.links?"link":"links"}${l}.`,value:s.value>0?s.value:void 0,datum:o})}return{id:`nodes-${i}-${un(e)}`,role:"series",level:2,label:`${e}: ${t.length} ${1===t.length?"node":"nodes"}.`,children:n}});v.length>0&&m.children?.push(...v);let w=n.slice(0,r).map((e,t)=>{let r=d(e,s),i=d(e,l),n=cn(sn(e,c,"value"));return{id:`link-${un(r)}-${un(i)}-${t}`,role:"datum",level:3,label:`${r} to ${i}${null==n?"":`: ${a(n)}`}.`,value:n,datum:e}});return n.length>r&&w.push({id:"links-more",role:"datum",level:3,label:`…and ${n.length-r} more links.`,value:void 0}),w.length>0&&m.children?.push({id:"links",role:"series",level:2,label:`Links: ${n.length} ${1===n.length?"connection":"connections"}.`,children:w}),m}function fn(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function mn(e,t){let r=Array.isArray(e.annotations)?e.annotations:null;if(!r)return null;let a=Ba(r.filter(e=>!!e&&"object"==typeof e));if(0===a.length)return null;let i=0,n=a.slice(0,t).map(e=>{let t=e.lifecycle?.status,r=t&&"accepted"!==t?` (${t})`:"";return{id:"annotation-"+i++,role:"annotation",level:3,label:`${fn(Ai(e))}${r}.`,datum:e}});a.length>t&&n.push({id:"annotation-"+i++,role:"annotation",level:3,label:`…and ${a.length-t} more annotations.`});let o=a.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===o?"one marked feature":`${o} marked features`}.`,children:n}}function gn(e,t,r={}){let a=r.locale??"en",i=Math.max(1,r.maxLeaves??200),n=yi(a),o=Ga(e,t,r.recipe);if(o)return ji(o,t,{maxLeaves:i,locale:a});let s={id:"root",role:"chart",label:xi(e,t,{locale:a}).text||"Chart.",level:1,children:[]},l=mn(t,i);if(Ou.has(e)){let r=pn(e,t,i,n);return hn(r,l),r}if(Fu.has(e)){let r=Vi(e,t,i,n);return hn(r,l),r}if(ju.has(e)){let r=nn(e,t,i,n);return hn(r,l),r}let c=Array.isArray(t.data)?t.data:null,u=on(e,t,r);if(!c||0===c.length||!u)return l&&(s.children=[l]),s;let{measure:d,measureFallback:h,dimension:p,dimensionFallback:f}=ja(e,t),m=Ma(d,h),g=Oa(p,f),y="string"==typeof d&&d?d:h,b="string"==typeof p&&p?p:f,v=La(t),w=0,A=e=>`${e}-${w++}`,$=(e,t)=>{let r=m(e),a=za(g(e),n);return{id:A("datum"),role:"datum",level:t,label:`${a}: ${Number.isFinite(r)?n(r):"—"}`,value:Number.isFinite(r)?r:void 0,datum:e}},x=(e,t)=>{let r=e.slice(0,i).map(e=>$(e,t));return e.length>i&&r.push({id:A("more"),role:"datum",level:t,label:`…and ${e.length-i} more points`}),r},C=[];if(yu.has(e)||bu.has(e)){let t=1/0,r=-1/0,a=1/0,i=-1/0,o=[],s=!0;for(let e of c){let n=m(e);Number.isFinite(n)&&(n<t&&(t=n),n>r&&(r=n));let l=g(e);o.push(l),"number"==typeof l&&Number.isFinite(l)?(l<a&&(a=l),l>i&&(i=l)):s=!1}let l=/* @__PURE__ */new Set,u=[];for(let e of o){let t=String(e);l.has(t)||(l.add(t),u.push(e))}let d=s?`${n(a)} to ${n(i)}`:`${za(u[0],n)} to ${za(u[u.length-1],n)} (${bu.has(e)?`${u.length} categories`:`${c.length} points`})`;C.push({id:A("axis"),role:"axis",level:2,label:`${bu.has(e)?"Category axis":"X axis"}: ${b}, ${d}.`}),r>=t&&C.push({id:A("axis"),role:"axis",level:2,label:`Value axis: ${y}, ${n(t)} to ${n(r)}.`})}if(v){let r=Oa(v,v),i=/* @__PURE__ */new Map;for(let e of c){let t=String(r(e)??"—"),a=i.get(t);a?a.push(e):i.set(t,[e])}let n=[];for(let[r,o]of i){let i=xi(e,{...t,data:o},{levels:["l2","l3"],locale:a}).text;n.push({id:A("series"),role:"series",level:2,label:`Series ${r}: ${i}`,children:x(o,3)})}s.children=[...C,...n]}else s.children=[...C,...x(c,2)];return l&&s.children.push(l),s}function yn(e,t){let r=[],a=e=>{if(r.push(e),e.children&&e.children.length>0&&t.has(e.id))for(let t of e.children)a(t)};return a(e),r}function bn(e){let t=1;if(e.children)for(let r of e.children)t+=bn(r);return t}function vn(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function wn(e){return vn(e)?e:void 0}function An(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:void 0}function $n(e){let t=An(e);return null==t?void 0:Math.max(0,Math.floor(t))}function xn(...e){return e.map(wn).find(Boolean)}function Cn(...e){return e.find(Array.isArray)}function Sn(e){let t={};for(let[r,a]of Object.entries(e))void 0!==a&&(t[r]=a);return t}function kn(e,t,r){return e["string"==typeof t&&t?t:r]}function Rn(e){return e instanceof Date?e.toISOString():"number"==typeof e?Number.isInteger(e)?String(e):String(Math.round(1e3*e)/1e3):String(e??"—")}function Pn(e,t,r){let a=[];if("GaugeChart"===e){"number"==typeof t.value&&Number.isFinite(t.value)&&a.push(`Current value is ${Rn(t.value)}.`);let e="number"==typeof t.min&&Number.isFinite(t.min)?t.min:0,r="number"==typeof t.max&&Number.isFinite(t.max)?t.max:100;a.push(`The gauge scale runs from ${Rn(e)} to ${Rn(r)}.`)}if("SankeyDiagram"===e||"ProcessSankey"===e){let i=Array.isArray(t.edges)?t.edges:[];if("ProcessSankey"===e&&Array.isArray(t.domain)&&2===t.domain.length&&a.push(`The ProcessSankey time domain runs from ${Rn(t.domain[0])} to ${Rn(t.domain[1])}.`),i.length>0){a.push(`${i.length} source flow${1===i.length?"":"s"} are supplied.`);for(let n of i.slice(0,r)){let r=kn(n,t.sourceAccessor,"source"),i=kn(n,t.targetAccessor,"target"),o=kn(n,t.valueAccessor,"value"),s="ProcessSankey"===e&&(null!=n.startTime||null!=n.endTime);a.push(s?`${Rn(r)} to ${Rn(i)} has value ${Rn(o)} over ${Rn(n.startTime)}–${Rn(n.endTime)}.`:`${Rn(r)} to ${Rn(i)} has value ${Rn(o)}.`)}}}if("Treemap"===e||"CirclePack"===e||"TreeDiagram"===e||"OrbitDiagram"===e){let e=wn(t.data),i="string"==typeof t.childrenAccessor&&t.childrenAccessor?t.childrenAccessor:"children",n="string"==typeof t.valueAccessor&&t.valueAccessor?t.valueAccessor:"value",o="string"==typeof t.nodeIdAccessor&&t.nodeIdAccessor?t.nodeIdAccessor:"string"==typeof t.nodeIDAccessor&&t.nodeIDAccessor?t.nodeIDAccessor:"name",s=[],l=e=>{let t=Array.isArray(e[i])?e[i]:[];if(0!==t.length)for(let e of t){let t=wn(e);t&&l(t)}else s.push(e)};if(e&&l(e),s.length>0){a.push(`${s.length} hierarchy leaves are supplied.`);for(let e of s.slice(0,r))a.push(`${Rn(e[o])} has value ${Rn(e[n])}.`)}}if(Lu.has(e)&&Array.isArray(t.data)){let r=t.data;a.push(`${r.length} observed source row${1===r.length?"":"s"} are supplied.`);let i="CollisionSwarmChart"===e?t.xAccessor:t.valueAccessor,n="CollisionSwarmChart"===e?"x":"value",o=r.map(e=>An(kn(e,i,n))).filter(e=>null!=e);o.length>0&&a.push(`Observed ${"string"==typeof i?i:n} ranges from ${Rn(Math.min(...o))} to ${Rn(Math.max(...o))}.`)}if(0!==a.length)return{source:"chart-props",statements:a,text:`Exact chart-prop facts: ${a.join(" ")}`}}function Nn(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:`${t}s`}function En(e){return Number.isInteger(e)?String(e):String(Math.round(1e3*e)/1e3)}function Tn(e,t,r,a){let i=wn(e.settledProjection),n=wn(t?.settledProjection);return Cn(r?.projectionRows,r?.aggregates,e.settledProjectionRows,e.projectionRows,i?.rows,t?.settledProjectionRows,t?.projectionRows,n?.rows,a?.binCounts)}function In(e){if(!e||0===e.length)return;let t=e.map((e,t)=>{let r=wn(e);if(!r)return;let a=An(r.count??r.value??r.total??r.bodies??r.events);if(null==a)return;let i=String(r.label??r.id??r.name??`container ${t+1}`),n=null==r.id?void 0:String(r.id),o=An(r.secondary??r.secondaryCount),s=An(r.observed??r.observedCount);return Sn({id:n,label:i,count:a,secondary:o,secondaryLabel:"string"==typeof r.secondaryLabel?r.secondaryLabel:void 0,observed:s})}).filter(e=>null!=e);if(0===t.length)return;let r=t.reduce((e,t)=>e+t.count,0),a=t.filter(e=>e.count>0).length,i=t.slice().sort((e,t)=>t.count-e.count)[0];return{rows:t,totalCount:r,populatedCount:a,...i?{leader:i}:{}}}function Mn(e,t){let r=e?.map((e,t)=>{let r=wn(e);if(!r)return;let a=An(r.count)??0,i=An(r.total),n={label:String(r.label??r.id??`sediment ${t+1}`),count:a};return null!=r.id&&(n.id=String(r.id)),null!=i&&(n.total=i),n}).filter(e=>null!=e),a=$n(t?.bins)??r?.length??0,i=An(t?.count)??r?.reduce((e,t)=>e+t.count,0)??0,n=An(t?.total)??r?.reduce((e,t)=>e+(t.total??0),0),o=r?.slice().sort((e,t)=>t.count-e.count)[0];if(0!==a||0!==i||n)return{bins:a,count:i,...null!=n&&n>0?{total:n}:{},...o?{leader:o}:{}}}function On(e){let t=wn(e);return!!t&&(vn(t.world)||"simulationState"in t||"liveBodyOrder"in t)}function Fn(e){if(e)return e.filter(e=>!0===wn(e)?.sleeping).length}function jn(e,t,r){let a=e?.filter(e=>!0===wn(e)?.sensor).length,i=wn(t?.observation),n=wn(i?.sensors),o=Cn(r?.activeSensors);return Math.max(a??0,n?Object.keys(n).length:0,o?.length??0)||void 0}function Ln(e){let t=[],r=e.simulation,a=[r.state??(r.settled?"settled":void 0),null!=r.liveBodies?`${r.liveBodies} live ${Nn(r.liveBodies,"body")}`:void 0,null!=r.sleepingBodies?`${r.sleepingBodies} sleeping`:void 0,null!=r.queued?`${r.queued} queued`:void 0,null!=r.seed?`seed ${En(r.seed)}`:void 0,r.gravity?`gravity (${En(r.gravity.x)}, ${En(r.gravity.y)})`:void 0,null!=r.fixedDt?`fixed step ${En(r.fixedDt)}s`:void 0,null!=r.timeScale?`${En(r.timeScale)}x time`:void 0].filter(Boolean);a.length>0&&t.push(`Physics simulation: ${a.join("; ")}.`);let i=e.geometry;if(i){let e=[null!=i.colliders?`${i.colliders} ${Nn(i.colliders,"collider")}`:void 0,null!=i.sensors?`${i.sensors} ${Nn(i.sensors,"sensor")}`:void 0,null!=i.springs?`${i.springs} ${Nn(i.springs,"spring")}`:void 0,null!=i.activeSensorPairs?`${i.activeSensorPairs} active sensor ${Nn(i.activeSensorPairs,"pair")}`:void 0].filter(Boolean);e.length>0&&t.push(`Physics geometry: ${e.join("; ")}.`)}let n=e.aggregates;if(n){let e=n.leader,r=e?` Largest is ${e.label} with ${En(e.count)}.`:"";t.push(`Physics aggregates: ${En(n.totalCount)} settled ${Nn(n.totalCount,"body")} across ${n.rows.length} ${Nn(n.rows.length,"container")}; ${n.populatedCount} populated.${r}`)}let o=e.sediment;if(o){let e=null!=o.total?`, value total ${En(o.total)}`:"",r=o.leader?`; largest sediment bin is ${o.leader.label} with ${En(o.leader.count)}`:"";t.push(`Physics sediment: ${o.count} retained ${Nn(o.count,"body")} in ${o.bins} ${Nn(o.bins,"bin")}${e}${r}.`)}return t.join(" ")}function zn(e,t,r){if(!1===r)return;let a=vn(r)?r:void 0,i=wn(t.physics),n=xn(a?.snapshot,i?.snapshot,t.physicsSnapshot,On(t.snapshot)?t.snapshot:void 0),o=xn(a?.evidence,i?.evidence,t.physicsEvidence,t.settledEvidence),s=xn(a?.config,i?.config,n?.config,t.config),l=xn(wn(n?.world),wn(i?.world)),c=xn(wn(s?.kernel),wn(l?.options)),u=Cn(l?.bodies),d=Cn(l?.colliders,s?.colliders),h=Cn(n?.queue,i?.queue),p=Cn(n?.liveBodyOrder),f=Cn(l?.springs),m=Cn(n?.activeSensorPairs),g=In(Tn(t,i,a,o)),y=Mn(Cn(a?.sediment,i?.sediment,n?.sediment),xn(a?.sedimentTotals,i?.sedimentTotals)),b=p?.length??u?.length??$n(o?.bodyCount),v=Fn(u)??$n(o?.sleepingCount),w=h?.length,A="string"==typeof n?.simulationState?n.simulationState:void 0,$="boolean"==typeof o?.settled?o.settled:A?"settled"===A:null!=b||null!=v||null!=w?null!=b&&v===b&&0===(w??0):void 0,x=wn(c?.gravity),C=An(x?.x),S=An(x?.y),k=Sn({state:A,settled:$,elapsedSeconds:An(n?.elapsedSeconds),paused:"boolean"==typeof n?.paused?n.paused:void 0,visible:"boolean"==typeof n?.visible?n.visible:void 0,seed:An(c?.seed),gravity:null!=C&&null!=S?{x:C,y:S}:void 0,fixedDt:An(s?.fixedDt??c?.fixedDt),timeScale:An(s?.timeScale),maxSubsteps:$n(s?.maxSubsteps),liveBodies:b,sleepingBodies:v,queued:w,bodyLimit:An(s?.bodyLimit),eviction:"string"==typeof s?.eviction?s.eviction:void 0}),R=Sn({colliders:d?.length,sensors:jn(d,s,l),springs:f?.length,activeSensorPairs:m?.length}),P=Object.keys(R).length>0,N=Lu.has(e);if(!(Object.keys(k).length>0||P||g||y)||!N&&null==r)return;let E={simulation:k,...P?{geometry:R}:{},...g?{aggregates:g}:{},...y?{sediment:y}:{}},T=Ln(E);return{...E,text:T}}function Bn(e){if(!e)return{};if("fits"in e||"buildProps"in e)return{family:e.family};let t=e;return{family:t.family,intentScores:t.intentScores}}function Dn(e,t,r={}){let a,{capability:i,audience:n,locale:o}=r,s=r.levels??["l1","l2","l3"],l=!1!==r.includeStructure,c=mi(e,i),u=xi(e,t,{levels:c?[...s,"l4"]:s,locale:o,capability:i,audience:n}),{l4:d,...h}=u.levels,p=["l1","l2","l3"].map(e=>u.levels[e]).filter(Boolean).join(" "),f={levels:h,text:u.annotations?`${u.annotations} ${p}`.trim():p,...u.annotations?{annotations:u.annotations}:{}};if(c&&d){let e=Bn(i);a={act:c,sentence:d,family:e.family,intentScores:e.intentScores}}let m=l?gn(e,t,{maxLeaves:r.maxLeaves,locale:o}):void 0,g=zn(e,t,r.physics),y=Pn(e,t,Math.max(1,r.maxLeaves??200)),b=[f.text,a?.sentence,g?.text,y?.text].filter(Boolean).join(" ");return{component:e,description:f,intent:a,structure:m,physics:g,facts:y,text:b}}function _n(e,t=30){return Math.max((e??4)+5,12,t)}function Un(e,t){return t?.length&&Object.defineProperty(e,zu,{configurable:!0,enumerable:!1,value:t}),e}function Gn(e){return e?.[zu]}function Hn(e){let t=e;return Gn(!0===t?.__semioticHoverData?t.data:e)}function Vn(e,t){return Object.defineProperty(e,"__semioticSelectionCoverage",{configurable:!0,enumerable:!1,value:t}),e}function qn(e){if(null==e||"string"==typeof e&&""===e.trim())return NaN;if(e instanceof Date)return e.getTime();if("string"==typeof e){let t=Ct(e);if(Number.isFinite(t))return t}return Number(e)}function Wn(e){return t=>"number"!=typeof t.binStart||"number"!=typeof t.binEnd?t:Vn(Un({...t},Gn(t)),{ranges:{[e]:[t.binStart,t.binEnd]},toNumber:qn})}function Yn(e,t){return Bu.has(e)&&!("reading"===e&&"string"==typeof t)}function Kn(e){let t=[...Uu],r=Array.from((new TextEncoder).encode(e)),a=8*r.length;for(r.push(128);r.length%64!=56;)r.push(0);let i=Math.floor(a/4294967296),n=a>>>0;r.push(i>>>24&255,i>>>16&255,i>>>8&255,255&i,n>>>24&255,n>>>16&255,n>>>8&255,255&n);let o=[];for(let e=0;e<r.length;e+=4)o.push((r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0);for(let e=0;e<o.length;e+=16){let r=[...o.slice(e,e+16)];for(let e=16;e<64;e+=1){let t=Du(r[e-15],7)^Du(r[e-15],18)^r[e-15]>>>3,a=Du(r[e-2],17)^Du(r[e-2],19)^r[e-2]>>>10;r[e]=r[e-16]+t+r[e-7]+a>>>0}let[a,i,n,s,l,c,u,d]=t;for(let e=0;e<64;e+=1){let t=d+(Du(l,6)^Du(l,11)^Du(l,25))+(l&c^~l&u)+Gu[e]+r[e]>>>0,o=a&i^a&n^i&n;d=u,u=c,c=l,l=s+t>>>0,s=n,n=i,i=a,a=t+((Du(a,2)^Du(a,13)^Du(a,22))+o>>>0)>>>0}let h=[a,i,n,s,l,c,u,d];for(let e=0;e<8;e+=1)t[e]=t[e]+h[e]>>>0}return t.map(e=>e.toString(16).padStart(8,"0")).join("")}function Jn(e,t){return`${e}[Symbol(${t.description??""})]`}function Xn(e,t){if(!/^(0|[1-9][0-9]*)$/.test(e))return!1;let r=Number(e);return Number.isSafeInteger(r)&&r>=0&&r<t}function Zn(e,t){return"number"==typeof t?`${e}[${t}]`:e?`${e}.${t}`:t}function Qn(e){return e.sort((e,t)=>{let r=JSON.stringify(e),a=JSON.stringify(t);return r<a?-1:r>a?1:0})}function eo(e,t,r){if(null===e)return null;if(e instanceof Date){let a=e.getTime();return Number.isFinite(a)?{$type:"date",value:e.toISOString()}:void r.excluded.push(t)}switch(typeof e){case"string":case"boolean":return e;case"number":return Number.isNaN(e)?{$type:"number",value:"NaN"}:e===1/0?{$type:"number",value:"Infinity"}:e===-1/0?{$type:"number",value:"-Infinity"}:Object.is(e,-0)?{$type:"number",value:"-0"}:e;case"bigint":return{$type:"bigint",value:e.toString()};case"undefined":case"function":case"symbol":return void r.excluded.push(t);case"object":{let a=e;if(r.ancestors.has(a))return void r.excluded.push(t);r.ancestors.add(a);try{if(Array.isArray(e)){for(let a of Reflect.ownKeys(e))"length"===a||"string"==typeof a&&Xn(a,e.length)||r.excluded.push("symbol"==typeof a?Jn(t,a):Zn(t,a));return Array.from({length:e.length},(a,i)=>{let n=Zn(t,i),o=Object.getOwnPropertyDescriptor(e,String(i));if(!o||!("value"in o)||!o.enumerable)return r.excluded.push(n),null;let s=eo(o.value,n,r);return void 0===s?null:s})}let a={},i=Object.getPrototypeOf(e);if(i!==Object.prototype&&null!==i)return void r.excluded.push(t);let n=[];for(let a of Reflect.ownKeys(e)){if("symbol"==typeof a){r.excluded.push(Jn(t,a));continue}let i=Object.getOwnPropertyDescriptor(e,a);i&&"value"in i&&i.enumerable?n.push(a):r.excluded.push(Zn(t,a))}for(let i of n.sort()){let n=Object.getOwnPropertyDescriptor(e,i),o=eo(n&&"value"in n?n.value:void 0,Zn(t,i),r);void 0!==o&&Object.defineProperty(a,i,{value:o,enumerable:!0,configurable:!0,writable:!0})}return a}finally{r.ancestors.delete(a)}}default:return void r.excluded.push(t)}}function to(e,t=/* @__PURE__ */new Set){if(null===e)return["null"];if(e instanceof Date)return Number.isFinite(e.getTime())?["date",e.toISOString()]:["excluded"];switch(typeof e){case"string":return["string",e];case"boolean":return["boolean",e];case"number":return["number",Number.isNaN(e)?"NaN":e===1/0?"Infinity":e===-1/0?"-Infinity":Object.is(e,-0)?"-0":String(e)];case"bigint":return["bigint",e.toString()];case"undefined":case"function":case"symbol":return["excluded"];case"object":if(t.has(e))return["excluded"];t.add(e);try{let r=r=>{let a="symbol"==typeof r?["symbol-key",r.description??""]:["string-key",r],i=Object.getOwnPropertyDescriptor(e,r);return i?"value"in i?[a,"data",!!i.enumerable,to(i.value,t)]:[a,"accessor",!!i.enumerable,!!i.get,!!i.set]:[a,"missing"]};if(Array.isArray(e))return["array",Array.from({length:e.length},(t,a)=>{let i=String(a);return Object.prototype.hasOwnProperty.call(e,i)?r(i):["hole"]}),Qn(Reflect.ownKeys(e).filter(t=>"length"!==t&&!("string"==typeof t&&Xn(t,e.length))).map(r))];let a=Object.getPrototypeOf(e);return[a!==Object.prototype&&null!==a?"non-json-object":"object",Qn(Reflect.ownKeys(e).map(r))]}finally{t.delete(e)}default:return["excluded"]}}function ro(e){let t={excluded:[],ancestors:/* @__PURE__ */new Set},r=eo(e,"$",t)??null;return{value:r,text:JSON.stringify(r),excludedPaths:t.excluded}}function ao(e){let t=ro(e),r=Kn(JSON.stringify(["semiotic-value-fingerprint","v2",to(e)]));return{...t,algorithm:"sha256",digest:r,fingerprint:`sha256:${r}`}}function io(e,t,r,a){ho(e,Object.keys(t),r,a);for(let[i,n]of Object.entries(t))n.values?(n.required||void 0!==e[i])&&fo(e,i,r,n.values,a):n.required?po(e,i,r,a):vo(e,i,r,a)}function no(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function oo(e,t,r,a){void 0!==e[t]&&("number"!=typeof e[t]||!Number.isFinite(e[t]))&&a.push({path:`${r}.${t}`,message:"Expected a finite number."})}function so(e,t,r,a){void 0!==e[t]&&"boolean"!=typeof e[t]&&a.push({path:`${r}.${t}`,message:"Expected a boolean."})}function lo(e){return null===e||"string"==typeof e||"boolean"==typeof e||("number"==typeof e?Number.isFinite(e):Array.isArray(e)?e.every(lo):no(e)&&Object.values(e).every(lo))}function co(e,t,r,a){void 0!==e[t]&&(!no(e[t])||!lo(e[t]))&&a.push({path:`${r}.${t}`,message:"Expected a JSON object."})}function uo(e){return e.every(lo)}function ho(e,t,r,a){let i=new Set(t);for(let t of Object.keys(e))i.has(t)||a.push({path:`${r}.${t}`,message:"Unexpected property."})}function po(e,t,r,a){("string"!=typeof e[t]||!e[t])&&a.push({path:`${r}.${t}`,message:"Expected a non-empty string."})}function fo(e,t,r,a,i){("string"!=typeof e[t]||!a.includes(e[t]))&&i.push({path:`${r}.${t}`,message:`Expected one of: ${a.join(", ")}.`})}function mo(e,t,r,a){let i=e[t];if(void 0!==i)return no(i)?i:void a.push({path:`${r}.${t}`,message:"Expected an object."})}function go(e,t,r,a){let i=e[t];if(void 0!==i)return Array.isArray(i)?i:void a.push({path:`${r}.${t}`,message:"Expected an array."})}function yo(e,t,r){e?.some(e=>"string"!=typeof e||!e)&&r.push({path:t,message:"Expected non-empty string values."})}function bo(e,t,r,a,i){void 0!==e[t]&&fo(e,t,r,a,i)}function vo(e,t,r,a){void 0!==e[t]&&"string"!=typeof e[t]&&a.push({path:`${r}.${t}`,message:"Expected a string."})}function wo(e,t,r){no(e)?(ho(e,["id","name","kind"],t,r),po(e,"kind",t,r),vo(e,"id",t,r),vo(e,"name",t,r)):r.push({path:t,message:"Expected an actor object."})}function Ao(e,t){let r=mo(e,"reception","$",t);if(!r)return;ho(r,["channels","audience","strengths","risks","scaffolds","description","dataFallback","manualChecks"],"$.reception",t);let a=go(r,"channels","$.reception",t);a||t.push({path:"$.reception.channels",message:"Expected a reception-channel array."}),a?.forEach((e,r)=>{let a=`$.reception.channels[${r}]`;no(e)?(ho(e,["channel","disclosure","navigation","interactionInstructions","rawData","tokenBudget","privacyNotes"],a,t),fo(e,"channel",a,["visual","screen-reader","sonified","agent","print","low-bandwidth"],t),bo(e,"disclosure",a,["summary","standard","detailed"],t),bo(e,"rawData",a,["deny","bounded","allow"],t),so(e,"navigation",a,t),so(e,"interactionInstructions",a,t),oo(e,"tokenBudget",a,t),yo(go(e,"privacyNotes",a,t),`${a}.privacyNotes`,t)):t.push({path:a,message:"Expected a channel object."})});for(let e of["strengths","risks","scaffolds","manualChecks"])yo(go(r,e,"$.reception",t),`$.reception.${e}`,t);vo(r,"audience","$.reception",t),vo(r,"description","$.reception",t),so(r,"dataFallback","$.reception",t)}function $o(e,t){let r=mo(e,"form","$",t);r&&(ho(r,["chartFamily","whyThisForm","rejectedAlternatives","risks","misuse"],"$.form",t),vo(r,"chartFamily","$.form",t),vo(r,"whyThisForm","$.form",t),yo(go(r,"risks","$.form",t),"$.form.risks",t),yo(go(r,"misuse","$.form",t),"$.form.misuse",t),go(r,"rejectedAlternatives","$.form",t)?.forEach((e,r)=>{let a=`$.form.rejectedAlternatives[${r}]`;no(e)?(ho(e,["representation","reason"],a,t),po(e,"representation",a,t),po(e,"reason",a,t)):t.push({path:a,message:"Expected an alternative object."})}))}function xo(e,t){let r=mo(e,"contestability","$",t);r&&(ho(r,["sourceRequestsAllowed","alternativeViews","challenges","corrections","editorialExceptions"],"$.contestability",t),so(r,"sourceRequestsAllowed","$.contestability",t),go(r,"challenges","$.contestability",t)?.forEach((e,r)=>{let a=`$.contestability.challenges[${r}]`;if(no(e)){ho(e,["id","claimId","status","reason","raisedBy","raisedAt","counterclaimId","resolution"],a,t),po(e,"id",a,t),po(e,"claimId",a,t),po(e,"reason",a,t),fo(e,"status",a,["open","accepted","declined","resolved"],t),void 0!==e.raisedBy&&wo(e.raisedBy,`${a}.raisedBy`,t);for(let r of["raisedAt","counterclaimId","resolution"])vo(e,r,a,t)}else t.push({path:a,message:"Expected a challenge object."})}),go(r,"corrections","$.contestability",t)?.forEach((e,r)=>{let a=`$.contestability.corrections[${r}]`;if(!no(e))return void t.push({path:a,message:"Expected a correction object."});ho(e,["id","affectedClaimIds","replacementClaimIds","reason","createdAt","createdBy"],a,t),po(e,"id",a,t),po(e,"reason",a,t);let i=go(e,"affectedClaimIds",a,t);i||t.push({path:`${a}.affectedClaimIds`,message:"Expected an affected-claim array."}),yo(i,`${a}.affectedClaimIds`,t),yo(go(e,"replacementClaimIds",a,t),`${a}.replacementClaimIds`,t),vo(e,"createdAt",a,t),void 0!==e.createdBy&&wo(e.createdBy,`${a}.createdBy`,t)}),go(r,"alternativeViews","$.contestability",t)?.forEach((e,r)=>{let a=`$.contestability.alternativeViews[${r}]`;no(e)?(ho(e,["id","label","rationale"],a,t),po(e,"id",a,t),po(e,"label",a,t),vo(e,"rationale",a,t)):t.push({path:a,message:"Expected an alternative-view object."})}),go(r,"editorialExceptions","$.contestability",t)?.forEach((e,r)=>{let a=`$.contestability.editorialExceptions[${r}]`;no(e)?(ho(e,["ruleId","rationale","owner","reviewAt"],a,t),po(e,"ruleId",a,t),po(e,"rationale",a,t),vo(e,"owner",a,t),vo(e,"reviewAt",a,t)):t.push({path:a,message:"Expected an editorial-exception object."})}))}function Co(e,t){let r=mo(e,"accountability","$",t);r&&(ho(r,["authors","generatedBy","dataSources","codeRef","reviews","actions"],"$.accountability",t),go(r,"authors","$.accountability",t)?.forEach((e,r)=>wo(e,`$.accountability.authors[${r}]`,t)),yo(go(r,"dataSources","$.accountability",t),"$.accountability.dataSources",t),vo(r,"generatedBy","$.accountability",t),vo(r,"codeRef","$.accountability",t),go(r,"reviews","$.accountability",t)?.forEach((e,r)=>{let a=`$.accountability.reviews[${r}]`;if(no(e)){ho(e,["id","status","reviewer","reviewedAt","rationale","policyId"],a,t),po(e,"id",a,t),fo(e,"status",a,["pending","approved","changes-requested","rejected"],t),void 0!==e.reviewer&&wo(e.reviewer,`${a}.reviewer`,t);for(let r of["reviewedAt","rationale","policyId"])vo(e,r,a,t)}else t.push({path:a,message:"Expected a review object."})}),go(r,"actions","$.accountability",t)?.forEach((e,r)=>{let a=`$.accountability.actions[${r}]`;if(!no(e))return void t.push({path:a,message:"Expected an action object."});ho(e,["id","action","actor","actedAt","claimIds","artifactId","artifactRevision","policyId","status","invalidatedByClaimId"],a,t),po(e,"id",a,t),po(e,"action",a,t);let i=go(e,"claimIds",a,t);i||t.push({path:`${a}.claimIds`,message:"Expected a claim identifier array."}),yo(i,`${a}.claimIds`,t),void 0!==e.actor&&wo(e.actor,`${a}.actor`,t);for(let r of["actedAt","artifactId","artifactRevision","policyId","invalidatedByClaimId"])vo(e,r,a,t);bo(e,"status",a,["proposed","taken","reversed","invalidated"],t)}))}function So(e,t){let r=mo(e,"inheritance","$",t);if(r){ho(r,["requiredPaths","prohibitedExports","privacy","rawDataDefault","preservation","sourceArtifactIds"],"$.inheritance",t);for(let e of["requiredPaths","prohibitedExports","sourceArtifactIds"])yo(go(r,e,"$.inheritance",t),`$.inheritance.${e}`,t);bo(r,"privacy","$.inheritance",["public","restricted","confidential","unknown"],t),bo(r,"rawDataDefault","$.inheritance",["exclude","bounded","include"],t),bo(r,"preservation","$.inheritance",["full-fidelity","claim-evidence-preserved","visual-only","lossy","unknown"],t)}}function ko(e,t){Ao(e,t),$o(e,t),xo(e,t),Co(e,t),So(e,t)}function Ro(e){for(let t of Object.values(e))Object.freeze(t.suppliedBy),Object.freeze(t);return Object.freeze(e)}function Po(e,t){if(void 0===e||no(e)){if(no(e))for(let[r,a]of Object.entries(e)){let e=`$.fieldStatus.${r}`;if(!no(a)||"string"!=typeof a.status){t.push({path:e,message:"Expected a field state with a status."});continue}ho(a,["status","reason","suppliedBy","derived","reviewedBy"],e,t),["known","unknown","manual","not-applicable"].includes(a.status)||t.push({path:`${e}.status`,message:"Expected one of: known, unknown, manual, not-applicable."}),void 0!==a.suppliedBy&&("string"!=typeof a.suppliedBy||!["author","system","model-proposal","import"].includes(a.suppliedBy))&&t.push({path:`${e}.suppliedBy`,message:"Expected one of: author, system, model-proposal, import."}),vo(a,"reason",e,t),vo(a,"reviewedBy",e,t),so(a,"derived",e,t);let i=Object.prototype.hasOwnProperty.call(Hu,r)?Hu[r]:void 0,n="model-proposal"===a.suppliedBy,o=n&&!0===i?.modelMayPropose&&"known"!==a.status;i&&"known"===a.status&&"string"!=typeof a.suppliedBy&&t.push({path:`${e}.suppliedBy`,message:`Known field "${r}" must identify an allowed supplier.`}),i&&"string"==typeof a.suppliedBy&&!o&&!i.suppliedBy.includes(a.suppliedBy)&&t.push({path:`${e}.suppliedBy`,message:`Field "${r}" cannot be supplied by ${a.suppliedBy}.`}),i&&!0===a.derived&&!i.derivable&&t.push({path:`${e}.derived`,message:`Field "${r}" cannot be marked as derived.`}),i&&n&&(!i.modelMayPropose||"known"===a.status)&&t.push({path:`${e}.suppliedBy`,message:"known"===a.status?`A model proposal cannot finalize field "${r}" as known.`:`Field "${r}" does not accept model proposals.`}),"required"===i?.humanReview&&"known"===a.status&&("string"!=typeof a.reviewedBy||!a.reviewedBy.trim())&&t.push({path:`${e}.reviewedBy`,message:`Known field "${r}" requires an attributable human review.`})}}else t.push({path:"$.fieldStatus",message:"Expected a field-state object."})}function No(e,t){let r="$.time";ho(e,[...Wu,...Object.keys(Yu),"sources"],r,t);for(let a of Wu)vo(e,a,r,t);for(let[a,i]of Object.entries(Yu)){let n=mo(e,a,r,t);n&&io(n,i,`${r}.${a}`,t)}go(e,"sources",r,t)?.forEach((e,a)=>{let i=`${r}.sources[${a}]`;no(e)?io(e,Ku,i,t):t.push({path:i,message:"Expected a source object."})})}function Eo(e){try{return To(e)}catch{return{valid:!1,errors:[{path:"$",message:"Artifact contract could not be inspected safely."}],warnings:[]}}}function To(e){let t=[],r=[];if(!no(e))return{valid:!1,errors:[{path:"$",message:"Expected an object."}],warnings:r};let a=zr(e);if(a.length>0)return{valid:!1,errors:a.map(e=>({path:e,message:"Expected a JSON-compatible value that survives serialization unchanged."})),warnings:r};if(ho(e,["contractVersion","artifact","purpose","claims","evidence","time","reception","form","contestability","accountability","inheritance","fieldStatus","extensions"],"$",t),"0.1"!==e.contractVersion&&t.push({path:"$.contractVersion",message:"Expected contract version 0.1."}),no(e.artifact)){ho(e.artifact,["id","kind","component","title","createdAt","configFingerprint","dataFingerprint","revision"],"$.artifact",t),po(e.artifact,"id","$.artifact",t),fo(e.artifact,"kind","$.artifact",["chart","dashboard","story","alert","agent-answer"],t);for(let r of["component","title","createdAt","configFingerprint","dataFingerprint","revision"])vo(e.artifact,r,"$.artifact",t)}else t.push({path:"$.artifact",message:"Expected an artifact identity object."});if(no(e.purpose))if(Array.isArray(e.purpose.intents)){ho(e.purpose,["intents","communicativeAct","decisionContext","stakes","allowedUses","prohibitedUses"],"$.purpose",t),e.purpose.intents.forEach((e,r)=>{(!no(e)||"string"!=typeof e.id||!e.id)&&t.push({path:`$.purpose.intents[${r}].id`,message:"Expected a non-empty intent identifier."}),no(e)&&ho(e,["id","strength","source","rationale"],`$.purpose.intents[${r}]`,t),no(e)&&void 0!==e.strength&&fo(e,"strength",`$.purpose.intents[${r}]`,["primary","secondary"],t),no(e)&&(bo(e,"source",`$.purpose.intents[${r}]`,["author","derived","model-proposal","import"],t),vo(e,"rationale",`$.purpose.intents[${r}]`,t))});for(let r of["allowedUses","prohibitedUses"])yo(go(e.purpose,r,"$.purpose",t),`$.purpose.${r}`,t);bo(e.purpose,"stakes","$.purpose",["exploratory","informational","operational","high"],t),vo(e.purpose,"communicativeAct","$.purpose",t),vo(e.purpose,"decisionContext","$.purpose",t)}else t.push({path:"$.purpose.intents",message:"Expected an intent array."});else t.push({path:"$.purpose",message:"Expected a purpose object."});Array.isArray(e.claims)?e.claims.forEach((e,r)=>{if(!no(e))return void t.push({path:`$.claims[${r}]`,message:"Expected a claim object."});ho(e,["id","text","kind","status","evidenceIds","scope","uncertainty","asOf","supersedes","authoredBy","review","tags"],`$.claims[${r}]`,t),po(e,"id",`$.claims[${r}]`,t),fo(e,"kind",`$.claims[${r}]`,["description","observation","aggregation","inference","forecast","simulation","alert","recommendation","normative"],t),fo(e,"status",`$.claims[${r}]`,["supported","provisional","disputed","superseded","retracted","unsupported","unknown"],t),Array.isArray(e.evidenceIds)?e.evidenceIds.some(e=>"string"!=typeof e||!e)&&t.push({path:`$.claims[${r}].evidenceIds`,message:"Expected non-empty string evidence identifiers."}):t.push({path:`$.claims[${r}].evidenceIds`,message:"Expected an evidence identifier array."}),yo(go(e,"supersedes",`$.claims[${r}]`,t),`$.claims[${r}].supersedes`,t),vo(e,"text",`$.claims[${r}]`,t),vo(e,"asOf",`$.claims[${r}]`,t),co(e,"scope",`$.claims[${r}]`,t),yo(go(e,"tags",`$.claims[${r}]`,t),`$.claims[${r}].tags`,t),void 0!==e.authoredBy&&wo(e.authoredBy,`$.claims[${r}].authoredBy`,t);let a=mo(e,"review",`$.claims[${r}]`,t);a&&(ho(a,["status","reviewer","reviewedAt","rationale"],`$.claims[${r}].review`,t),fo(a,"status",`$.claims[${r}].review`,["proposed","reviewed","approved","rejected"],t),void 0!==a.reviewer&&wo(a.reviewer,`$.claims[${r}].review.reviewer`,t),vo(a,"reviewedAt",`$.claims[${r}].review`,t),vo(a,"rationale",`$.claims[${r}].review`,t));let i=mo(e,"uncertainty",`$.claims[${r}]`,t);if(i){ho(i,["kind","lower","upper","confidence","unit","description"],`$.claims[${r}].uncertainty`,t),fo(i,"kind",`$.claims[${r}].uncertainty`,["interval","distribution","qualitative","unknown"],t);for(let e of["lower","upper","confidence"])oo(i,e,`$.claims[${r}].uncertainty`,t);vo(i,"unit",`$.claims[${r}].uncertainty`,t),vo(i,"description",`$.claims[${r}].uncertainty`,t)}}):t.push({path:"$.claims",message:"Expected a claim array."}),Array.isArray(e.evidence)?e.evidence.forEach((e,r)=>{if(!no(e))return void t.push({path:`$.evidence[${r}]`,message:"Expected an evidence object."});ho(e,["id","role","label","source","fingerprint","dataVersion","observedAt","scope","sample","transformation","generatedClaimId","relationship"],`$.evidence[${r}]`,t),po(e,"id",`$.evidence[${r}]`,t),fo(e,"role",`$.evidence[${r}]`,["source-data","external-source","transformation","statistical-test","model-output","human-observation","policy-rule","quality-check"],t);for(let a of["label","fingerprint","dataVersion","observedAt","generatedClaimId"])vo(e,a,`$.evidence[${r}]`,t);co(e,"scope",`$.evidence[${r}]`,t);let a=mo(e,"source",`$.evidence[${r}]`,t);if(a){ho(a,["name","uri","version","retrievedAt","publisher"],`$.evidence[${r}].source`,t);for(let e of["name","uri","version","retrievedAt","publisher"])vo(a,e,`$.evidence[${r}].source`,t)}let i=mo(e,"transformation",`$.evidence[${r}]`,t);if(i){ho(i,["id","kind","description","inputEvidenceIds","parameters","assumptions","implementation","performedAt","performedBy"],`$.evidence[${r}].transformation`,t),po(i,"id",`$.evidence[${r}].transformation`,t),fo(i,"kind",`$.evidence[${r}].transformation`,["aggregation","filter","normalization","binning","join","smoothing","forecasting","simulation","other"],t);let e=go(i,"inputEvidenceIds",`$.evidence[${r}].transformation`,t);e?yo(e,`$.evidence[${r}].transformation.inputEvidenceIds`,t):t.push({path:`$.evidence[${r}].transformation.inputEvidenceIds`,message:"Expected an evidence identifier array."}),yo(go(i,"assumptions",`$.evidence[${r}].transformation`,t),`$.evidence[${r}].transformation.assumptions`,t),vo(i,"description",`$.evidence[${r}].transformation`,t),vo(i,"implementation",`$.evidence[${r}].transformation`,t),vo(i,"performedAt",`$.evidence[${r}].transformation`,t),co(i,"parameters",`$.evidence[${r}].transformation`,t),void 0!==i.performedBy&&wo(i.performedBy,`$.evidence[${r}].transformation.performedBy`,t)}let n=mo(e,"sample",`$.evidence[${r}]`,t);if(n){ho(n,["rowCount","fields","values","truncated"],`$.evidence[${r}].sample`,t),yo(go(n,"fields",`$.evidence[${r}].sample`,t),`$.evidence[${r}].sample.fields`,t);let e=go(n,"values",`$.evidence[${r}].sample`,t);e&&!uo(e)&&t.push({path:`$.evidence[${r}].sample.values`,message:"Expected JSON values."}),oo(n,"rowCount",`$.evidence[${r}].sample`,t),so(n,"truncated",`$.evidence[${r}].sample`,t)}bo(e,"relationship",`$.evidence[${r}]`,["descriptive","correlational","causal","unknown"],t)}):t.push({path:"$.evidence",message:"Expected an evidence array."}),Po(e.fieldStatus,t);let i=mo(e,"time","$",t);return i&&No(i,t),ko(e,t),co(e,"extensions","$",t),Array.isArray(e.claims)&&0===e.claims.length&&r.push({path:"$.claims",message:"The contract declares no claims."}),Array.isArray(e.evidence)&&0===e.evidence.length&&r.push({path:"$.evidence",message:"The contract declares no evidence."}),{valid:0===t.length,errors:t,warnings:r}}function Io(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Mo(e,t){if(!t||!Io(e)||!Array.isArray(e.evidence))return[];let r=[];return e.evidence.forEach((e,t)=>{Io(e)&&Object.prototype.hasOwnProperty.call(e,"sample")&&(delete e.sample,r.push(`$.evidence[${t}].sample`))}),r}function Oo(e,t={}){try{return Fo(e,t)}catch{let t=zr(e);return{transfer:{status:"invalid",omittedPaths:t.length?t:["$"],warnings:["Artifact contract could not be inspected safely."]}}}}function Fo(e,t){if(!Io(e))return{transfer:{status:"invalid",omittedPaths:["artifactContract"],warnings:["Artifact contract must be a JSON object."]}};let r=ro(e),a=[.../* @__PURE__ */new Set([...r.excludedPaths,...zr(e)])].sort(),i=r.value,n=Mo(i,t.excludeEvidenceSamples),o=n.length?["Bounded evidence samples were excluded by the transfer policy."]:[],s=i?.contractVersion;if("string"!=typeof s||!s)return{contract:i,transfer:{status:"invalid",omittedPaths:[...a,...n],warnings:["Artifact contract is missing a string contractVersion.",...o]}};if("0.1"!==s)return{contract:i,transfer:{status:a.length>0?"invalid":"unsupported-version",omittedPaths:[...a,...n],warnings:[`Contract version ${s} is not interpreted by this runtime.`,...a.length>0?[`Non-JSON values could not be preserved at: ${a.join(", ")}.`]:[],...o]}};let l=Eo(i),c=[...l.errors.map(({path:e,message:t})=>`${e}: ${t}`),...l.warnings.map(({path:e,message:t})=>`${e}: ${t}`),...a.length?[`Non-JSON values could not be preserved at: ${a.join(", ")}.`]:[],...o];return{contract:i,transfer:{status:!l.valid||a.length>0?"invalid":n.length>0?"excluded":"preserved",omittedPaths:[...a,...n],warnings:c}}}function jo(e){let t=Oo(e);if(!t.contract||"preserved"!==t.transfer.status)throw new TypeError(t.transfer.warnings.join(" ")||"Artifact contract could not be serialized without loss.");return t}function Lo(e){let t=Object.entries(e).filter(([e,t])=>Yn(e,t)&&void 0!==t);if(0!==t.length)return 1===t.length&&"data"===t[0][0]?t[0][1]:Object.fromEntries(t)}function zo(e,t=[]){if(void 0===e)return;let r=t.filter(e=>!!e.transformation).map(({id:e,transformation:t})=>({evidenceId:e,transformation:t})).sort(({evidenceId:e},{evidenceId:t})=>e<t?-1:e>t?1:0);return ao(r.length>0?{data:e,transformations:r}:e).fingerprint}function Bo(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!Yn(e,t)&&"recipeId"!==e))}function Do(e,t,r,a=Lo(t)){let i=Bo(t),n=0===zr(i).length?ao(i).fingerprint:void 0,o=void 0!==a&&0===zr(a).length?zo(a,e.evidence):void 0,s="ChartRecipe"===r&&"string"==typeof t.recipeId?t.recipeId:r,l=[],c=[];return void 0!==s&&(void 0===e.artifact.component?c.push("artifact.component"):e.artifact.component!==s&&l.push("artifact.component")),void 0===e.artifact.configFingerprint||void 0===n?c.push("artifact.configFingerprint"):e.artifact.configFingerprint!==n&&l.push("artifact.configFingerprint"),void 0!==e.artifact.dataFingerprint&&o?e.artifact.dataFingerprint!==o&&l.push("artifact.dataFingerprint"):c.push("artifact.dataFingerprint"),{status:l.length>0?"mismatch":c.length>0?"unknown":"match",mismatchPaths:l,unknownPaths:c}}function _o(e,t,r){let a=Do(e,t,r);return{mismatchPaths:[...a.mismatchPaths,...void 0!==r&&a.unknownPaths.includes("artifact.component")?["artifact.component"]:[]]}}function Uo(e,t){return[.../* @__PURE__ */new Set([...Object.keys(e),...Object.keys(t)])].filter(r=>{if(Object.prototype.hasOwnProperty.call(e,r)!==Object.prototype.hasOwnProperty.call(t,r))return!0;let a=ao(e[r]),i=ao(t[r]);return a.excludedPaths.length>0||a.fingerprint!==i.fingerprint}).map(e=>`props.${e}`).sort()}function Go(e){if(e.startsWith("props."))return e.slice(6).split(/[.[\]]/,1)[0]}function Ho(e,t){let r=t.map(Go).filter(e=>void 0!==e);return"artifact.dataFingerprint"===e?r.some(e=>Bu.has(e)):"artifact.configFingerprint"===e&&r.some(e=>!Bu.has(e))}function Vo(e){if(!e||"object"!=typeof e)return!1;let t=e,r=t.serializedDataFingerprint;return"string"==typeof t.status&&Ju.has(t.status)&&Array.isArray(t.omittedPaths)&&t.omittedPaths.every(e=>"string"==typeof e)&&Array.isArray(t.warnings)&&t.warnings.every(e=>"string"==typeof e)&&(void 0===t.serializedConfigFingerprint||"string"==typeof t.serializedConfigFingerprint)&&(null==r||"string"==typeof r)&&(void 0===t.transferFingerprint||"string"==typeof t.transferFingerprint)}function qo(e,t,r,a){return ao({component:t,version:a.version,createdAt:a.createdAt,...void 0!==a.recipeId?{recipeId:a.recipeId}:{},...void 0!==a.portable?{portable:a.portable}:{},...void 0!==a.manifest?{manifest:a.manifest}:{},...void 0!==a.reason?{reason:a.reason}:{},...void 0!==a.warnings?{warnings:a.warnings}:{},...void 0!==a.selections?{selections:a.selections}:{},artifactContract:r,status:e.status,omittedPaths:e.omittedPaths,warnings:e.warnings,...void 0!==e.serializedConfigFingerprint?{serializedConfigFingerprint:e.serializedConfigFingerprint}:{},...Object.prototype.hasOwnProperty.call(e,"serializedDataFingerprint")?{serializedDataFingerprint:e.serializedDataFingerprint}:{}}).fingerprint}function Wo(e,t,r,a,i){let n=Lo(r),o={...e,serializedConfigFingerprint:ao(Bo(r)).fingerprint,serializedDataFingerprint:void 0===n?null:ao(n).fingerprint};return{...o,transferFingerprint:qo(o,t,a,i)}}function Yo(e,t){let r=[],a=ao(Bo(t.props)).fingerprint,i=Lo(t.props),n=void 0===i?null:ao(i).fingerprint;return void 0!==e.transferFingerprint&&e.transferFingerprint!==qo(e,t.component,t.artifactContract,t)&&r.push("artifactTransfer.transferFingerprint"),void 0!==e.serializedConfigFingerprint&&e.serializedConfigFingerprint!==a&&r.push("artifactTransfer.serializedConfigFingerprint"),Object.prototype.hasOwnProperty.call(e,"serializedDataFingerprint")&&e.serializedDataFingerprint!==n&&r.push("artifactTransfer.serializedDataFingerprint"),r}function Ko(e,t){if("artifactContract"===t||"$.artifactContract"===t)return void 0!==e.artifactContract;let r,a;if("props"===t||t.startsWith("props.")?(r=e,a=t):(r=e.artifactContract,a=t.startsWith("$.")?t.slice(2):t),"$"===a||""===a)return void 0!==r;let i=[...a.matchAll(/(?:^|\.)([^.[\]]+)|\[(\d+)\]/g)].map(e=>e[1]??Number(e[2]));if(0===i.length)return!1;for(let e of i){if(null===r||"object"!=typeof r||!Object.prototype.hasOwnProperty.call(r,e))return!1;r=r[e]}return!0}function Jo(e,t,r,a,i){if(!t)return{};let n=jo(t),o=i.recipeId??e,s=_o(t,r,o),l=Uo(r,a),c=_o(t,a,o);return s.mismatchPaths.length>0?{artifactContract:n.contract,artifactTransfer:Wo({status:"invalid",omittedPaths:s.mismatchPaths,warnings:["The artifact contract fingerprints do not match the supplied chart props or data."]},e,a,n.contract,i)}:l.length>0?{artifactContract:n.contract,artifactTransfer:Wo({status:"excluded",omittedPaths:l,warnings:["Chart props or data were excluded from the serialized configuration."]},e,a,n.contract,i)}:c.mismatchPaths.length>0?{artifactContract:n.contract,artifactTransfer:Wo({status:"invalid",omittedPaths:c.mismatchPaths,warnings:["Serialized chart props or data differ from the values bound to the artifact contract."]},e,a,n.contract,i)}:{artifactContract:n.contract,artifactTransfer:Wo(n.transfer,e,a,n.contract,i)}}function Xo(e){if(!e.artifactContract){if(!e.artifactTransfer)return{};if(Vo(e.artifactTransfer)&&"excluded"===e.artifactTransfer.status&&e.artifactTransfer.omittedPaths.includes("artifactContract")){let t=e.artifactTransfer.omittedPaths.filter(t=>"artifactContract"!==t&&Ko(e,t));return 0===t.length?{artifactTransfer:Xu(e.artifactTransfer)}:{artifactTransfer:{status:"invalid",omittedPaths:[...e.artifactTransfer.omittedPaths],warnings:[`The declared omitted path is still present: ${t.join(", ")}.`]}}}return{artifactTransfer:{status:"invalid",omittedPaths:["artifactContract"],warnings:["An artifact transfer report cannot claim preservation without an artifact contract."]}}}let t=Oo(e.artifactContract),r=e.artifactTransfer,a=t.transfer,i=(()=>{if(!r)return{status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...a.omittedPaths,"artifactTransfer"])],warnings:[...a.warnings,"The artifact contract has no transfer report, so its transport history cannot be verified."]};if(!Vo(r))return{status:"invalid",omittedPaths:a.omittedPaths,warnings:[...a.warnings,"The declared artifact transfer report is malformed."]};let t="excluded"===r.status||"unsupported-version"===r.status?r.omittedPaths.filter(t=>Ko(e,t)):[];return t.length>0?{status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...r.omittedPaths,...a.omittedPaths])],warnings:[...a.warnings,`The declared omitted path is still present: ${t.join(", ")}.`]}:"preserved"===r.status&&r.omittedPaths.length>0||"excluded"===r.status&&0===r.omittedPaths.length?{status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...r.omittedPaths,...a.omittedPaths])],warnings:[...a.warnings,"The declared artifact transfer status contradicts its omitted paths."]}:r.status===a.status||"preserved"===a.status&&("excluded"===r.status||"invalid"===r.status)&&r.omittedPaths.length>0?Xu(r):{status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...r.omittedPaths,...a.omittedPaths])],warnings:[.../* @__PURE__ */new Set([...r.warnings,...a.warnings,`Declared artifact transfer status ${r.status} does not match the restored contract status ${a.status}.`])]}})();if(r&&Vo(r)){let t=Yo(r,e),a="invalid"!==r.status,n=[...a&&void 0===r.serializedConfigFingerprint?["artifactTransfer.serializedConfigFingerprint"]:[],...a&&!Object.prototype.hasOwnProperty.call(r,"serializedDataFingerprint")?["artifactTransfer.serializedDataFingerprint"]:[],...a&&void 0===r.transferFingerprint?["artifactTransfer.transferFingerprint"]:[]];(t.length>0||n.length>0)&&(i={status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...i.omittedPaths,...t,...n])],warnings:[.../* @__PURE__ */new Set([...i.warnings,t.length>0?"The serialized chart payload no longer matches its transfer fingerprints.":"The declared chart transfer cannot be verified without serialized transfer fingerprints."])]})}if("preserved"===t.transfer.status&&"0.1"===t.contract?.contractVersion){let r=_o(t.contract,e.props,e.recipeId??e.component).mismatchPaths.filter(e=>!Ho(e,i.omittedPaths));r.length>0&&(i={status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...i.omittedPaths,...r])],warnings:[.../* @__PURE__ */new Set([...i.warnings,"Restored chart props or data do not match the artifact contract fingerprints."])]})}return{...t.contract?{artifactContract:t.contract}:{},artifactTransfer:i}}function Zo(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0})}function Qo(e,t){return!(!Yn(e,t)||"areas"===e&&"string"==typeof t)}function es(e,t,r){if(r?.selections&&zr(r.selections).length>0)throw new TypeError("Serialized selection state must contain only values that survive JSON serialization unchanged.");let a=Dr(e)??Gr(t.recipe)??Gr(t.recipeId);if(a)return rs(a,t,r);if(!Te(e))throw new Error(`Unknown component "${e}". Known components: ${Xl.join(", ")}`);let i=!1!==r?.includeData,n={};for(let[e,r]of Object.entries(t))if(null!=r&&!Qu.has(e)&&(i||!Qo(e,r))&&"function"!=typeof r&&!(zr(r).length>0))try{Zo(n,e,ed(r))}catch{}let o=/* @__PURE__ */(new Date).toISOString(),s={version:Zu,createdAt:o,...r?.selections?{selections:r.selections}:{}};return{component:e,props:n,version:Zu,createdAt:o,...Jo(e,r?.artifactContract,t,n,s),...r?.selections?{selections:r.selections}:{}}}function ts(e,t,r){let a={};for(let[i,n]of Object.entries(e))if(null!=n&&!Qu.has(i)&&"recipeId"!==i&&(t||!Qo(i,n))){if("function"==typeof n){if(r)throw new Error(`Portable recipe prop "${i}" is not JSON-safe.`);continue}if(zr(n).length>0){if(r)throw new Error(`Portable recipe prop "${i}" is not JSON-safe.`);continue}Zo(a,i,ed(n))}return a}function rs(e,t,r){let a=!1!==r?.includeData,i=zr(e);if("portable"===e.portability&&i.length>0)throw new Error(`Portable recipe "${e.id}" has non-JSON definition values at: ${i.join(", ")}.`);let n=ts(t,a,"portable"===e.portability),o=e.intents.map(Da).filter(e=>!!e),s=e.layout&&"object"==typeof e.layout&&"string"==typeof e.layout.id?e.layout.id:void 0,l=s?Ur(s):void 0,c=e.layout&&"object"==typeof e.layout&&"string"==typeof e.layout.version&&e.layout.version?{version:e.layout.version,...e.layout.fingerprint?{fingerprint:e.layout.fingerprint}:{}}:void 0;if(l&&c&&(l.version!==c.version||l.fingerprint!==c.fingerprint))throw new Error(`Recipe layout "${s}" registry identity does not match its portable declaration.`);let u=l??c;if("portable"===e.portability&&s&&!u)throw new Error(`Portable recipe layout "${s}" must be registered with an explicit version identity.`);let d={name:e.name,intents:o,...e.audience?.primary?{audience:[e.audience.primary]}:{},frameFamily:e.frameFamily,...e.version?{recipeVersion:e.version}:{},...0===i.length?{definitionFingerprint:ao(e).fingerprint}:{},...s?{layoutId:s}:{},...u?{layoutVersion:u.version}:{},...u?.fingerprint?{layoutFingerprint:u.fingerprint}:{}},h=/* @__PURE__ */(new Date).toISOString();if("portable"===e.portability){if(zr(n).length>0)throw new Error(`Portable recipe "${e.id}" contains non-JSON-safe props or layoutConfig.`);let a={version:Zu,createdAt:h,recipeId:e.id,portable:!0,manifest:d,...r?.selections?{selections:r.selections}:{}};return{component:"ChartRecipe",recipeId:e.id,portable:!0,props:n,manifest:d,version:Zu,createdAt:h,...Jo("ChartRecipe",r?.artifactContract,t,n,a),...r?.selections?{selections:r.selections}:{}}}let p="Recipe contains or may depend on non-serializable local layout callbacks.",f=["This config is inspectable but cannot be rendered remotely by CLI or MCP."],m={version:Zu,createdAt:h,recipeId:e.id,portable:!1,manifest:d,reason:p,warnings:f,...r?.selections?{selections:r.selections}:{}};return{component:"ChartRecipe",recipeId:e.id,portable:!1,reason:p,warnings:f,props:n,manifest:d,version:Zu,createdAt:h,...Jo("ChartRecipe",r?.artifactContract,t,n,m),...r?.selections?{selections:r.selections}:{}}}function as(e){try{if(!e||"object"!=typeof e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}catch{return!1}}function is(e){if(!as(e))throw new Error("Invalid chart config: expected a plain object");let t=zr(e);if(t.length>0)throw new TypeError(`Chart config contains values that cannot survive JSON serialization at: ${t.join(", ")}.`);if(e.version!==Zu)throw new Error(`Unsupported chart config version ${String(e.version)}; expected ${Zu}.`);if("string"!=typeof e.component||!e.component.trim())throw new Error("Invalid chart config: missing component");if(!as(e.props))throw new Error("Invalid chart config: props must be a plain object");if("string"!=typeof e.createdAt||!Number.isFinite(Date.parse(e.createdAt)))throw new Error("Invalid chart config: createdAt must be a valid timestamp");if(void 0!==e.recipeId&&("string"!=typeof e.recipeId||!e.recipeId.trim()))throw new Error("Invalid chart config: recipeId must be a non-empty string");if(void 0!==e.portable&&"boolean"!=typeof e.portable)throw new Error("Invalid chart config: portable must be a boolean");if(void 0!==e.selections&&!as(e.selections))throw new Error("Invalid chart config: selections must be a plain object");if(void 0!==e.manifest){if(!as(e.manifest))throw new Error("Invalid chart config: manifest must be a plain object");if("string"!=typeof e.manifest.name||!e.manifest.name.trim()||"string"!=typeof e.manifest.frameFamily||!e.manifest.frameFamily.trim()||!Array.isArray(e.manifest.intents)||e.manifest.intents.some(e=>"string"!=typeof e||!e.trim())||void 0!==e.manifest.audience&&(!Array.isArray(e.manifest.audience)||e.manifest.audience.some(e=>"string"!=typeof e||!e.trim()))||void 0!==e.manifest.recipeVersion&&("string"!=typeof e.manifest.recipeVersion||!e.manifest.recipeVersion.trim())||void 0!==e.manifest.definitionFingerprint&&("string"!=typeof e.manifest.definitionFingerprint||!e.manifest.definitionFingerprint.trim())||void 0!==e.manifest.layoutId&&("string"!=typeof e.manifest.layoutId||!e.manifest.layoutId.trim())||void 0!==e.manifest.layoutVersion&&("string"!=typeof e.manifest.layoutVersion||!e.manifest.layoutVersion.trim())||void 0!==e.manifest.layoutFingerprint&&("string"!=typeof e.manifest.layoutFingerprint||!e.manifest.layoutFingerprint.trim())||void 0!==e.manifest.layoutVersion&&void 0===e.manifest.layoutId||void 0!==e.manifest.layoutFingerprint&&void 0===e.manifest.layoutVersion)throw new Error("Invalid chart config: malformed recipe manifest")}}function ns(e){if(is(e),"ChartRecipe"===e.component||"LocalChartRecipe"===e.component){if(!e.recipeId)throw new Error("Invalid chart recipe config: missing recipeId");let t=Dr(e.recipeId);if(!t)throw new Error(`Unknown chart recipe "${e.recipeId}". Register it before deserializing this config.`);if(e.manifest?.definitionFingerprint&&e.manifest.definitionFingerprint!==ao(t).fingerprint)throw new Error(`Chart recipe "${e.recipeId}" no longer matches the serialized definition.`);if(void 0!==e.manifest?.recipeVersion&&e.manifest.recipeVersion!==t.version)throw new Error(`Chart recipe "${e.recipeId}" version does not match the serialized config.`);if(e.manifest?.layoutVersion){let r=e.manifest.layoutId,a=r?_r(r):void 0,i=r?Ur(r):void 0,n=t.layout&&"object"==typeof t.layout&&t.layout.id===r&&t.layout.version?{version:t.layout.version,fingerprint:t.layout.fingerprint}:void 0,o=a?i:i??n;if(!o||o.version!==e.manifest.layoutVersion||o.fingerprint!==e.manifest.layoutFingerprint)throw new Error(`Chart recipe "${e.recipeId}" layout implementation no longer matches the serialized config.`)}if("LocalChartRecipe"!==e.component&&!1!==e.portable&&"portable"!==t.portability)throw new Error(`Chart recipe "${e.recipeId}" is registered as local, not portable.`);return{componentName:"ChartRecipe",props:{...ed(e.props),recipeId:e.recipeId},...Xo(e)}}if(!Te(e.component))throw new Error(`Unknown component "${e.component}". This config may require a newer version of semiotic.`);return{componentName:e.component,props:ed(e.props),...Xo(e)}}function os(e,t={}){is(e);let r=JSON.stringify(e),a=`sc=${btoa(unescape(encodeURIComponent(r))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}`;if(void 0!==t.maxLength&&a.length>Math.max(0,Math.floor(t.maxLength)))throw new RangeError(`Serialized chart config is ${a.length} characters; the declared URL limit is ${t.maxLength}. Use a file or sidecar export instead.`);return a}function ss(e){let t=new URLSearchParams(e.includes("?")?e.split("?")[1]:e).get("sc");if(!t)throw new Error("No chart config found in URL (missing 'sc' parameter)");let r=t.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(escape(atob(r))),i=JSON.parse(a);return is(i),i}async function ls(e,t="json"){let r="jsx"===t?cs(e):JSON.stringify(e,null,2);if(!(typeof navigator<"u"&&navigator.clipboard))throw new Error("Clipboard API not available. copyConfig requires a browser environment.");await navigator.clipboard.writeText(r)}function cs(e){is(e);let{props:t}=e,r="LocalChartRecipe"===e.component?"ChartRecipe":e.component;if("ChartRecipe"!==r&&!Te(r))throw new Error(`Cannot project unknown component "${r}" to JSX.`);let a=[`<${r}`];e.recipeId&&a.push(` recipeId={${ds(e.recipeId)}}`);for(let[e,r]of Object.entries(t)){if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(e)){let t={};Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),a.push(` {...${ds(t)}}`);continue}if("string"==typeof r)a.push(us(r)?` ${e}="${r}"`:` ${e}={${ds(r)}}`);else if("boolean"==typeof r&&!0===r)a.push(` ${e}`);else if("boolean"==typeof r&&!1===r)a.push(` ${e}={false}`);else if("number"==typeof r)a.push(` ${e}={${r}}`);else{let t=ds(r);t.length<80?a.push(` ${e}={${t}}`):a.push(` ${e}={${ds(r,2)}}`)}}return a.push("/>"),a.join("\n")}function us(e){return!/["&<>{}\r\n\u2028\u2029]/.test(e)}function ds(e,t){return JSON.stringify(e,null,t).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function hs(e){let t=[...e.artifactContract?["artifactContract"]:[],...e.artifactTransfer?["artifactTransfer"]:[],...e.selections?["selections"]:[]];return{jsx:cs(e),omittedPaths:t,warnings:t.length?["JSX represents the chart props only. Preserve the reported top-level fields as a separate artifact packet."]:[]}}function ps(e){let t=/* @__PURE__ */Object.create(null);for(let[r,a]of e){let e=[];for(let[,t]of a.clauses){let r=/* @__PURE__ */Object.create(null);for(let[e,a]of Object.entries(t.fields))"point"===a.type?r[e]={type:"point",values:Array.from(a.values)}:r[e]={type:"interval",range:a.range};e.push({clientId:t.clientId,type:t.type,fields:r})}t[r]={name:a.name,resolution:a.resolution,clauses:e}}return t}function fs(e){let t=/* @__PURE__ */new Map;for(let[r,a]of Object.entries(e)){let e=/* @__PURE__ */new Map;for(let t of a.clauses){let r=/* @__PURE__ */Object.create(null);for(let[e,a]of Object.entries(t.fields))"point"===a.type?r[e]={type:"point",values:new Set(a.values)}:r[e]={type:"interval",range:a.range};e.set(t.clientId,{clientId:t.clientId,type:t.type,fields:r})}t.set(r,{name:a.name,resolution:a.resolution,clauses:e})}return t}async function ms(e,t){let{format:r="png",filename:a="chart",scale:i=2,background:n="white"}=t||{},o=e.querySelector('svg[role="img"]')||e.querySelector("svg");if(!o)throw new Error("No SVG element found in the container");let s=o.cloneNode(!0),l=o.getBoundingClientRect();if(s.getAttribute("width")||s.setAttribute("width",String(l.width)),s.getAttribute("height")||s.setAttribute("height",String(l.height)),s.getAttribute("xmlns")||s.setAttribute("xmlns","http://www.w3.org/2000/svg"),gs(o,s),"svg"===r){let e=(new XMLSerializer).serializeToString(s);ys(new Blob([e],{type:"image/svg+xml;charset=utf-8"}),`${a}.svg`)}else{let t=l.width*i,r=l.height*i,o=document.createElement("canvas");o.width=t,o.height=r;let c=o.getContext("2d");c.fillStyle=n,c.fillRect(0,0,t,r),c.scale(i,i);let u=e.querySelector("canvas");u&&c.drawImage(u,0,0,l.width,l.height);let d=(new XMLSerializer).serializeToString(s),h=new Blob([d],{type:"image/svg+xml;charset=utf-8"}),p=URL.createObjectURL(h),f=new Image;f.width=l.width,f.height=l.height,await new Promise((e,t)=>{f.onload=()=>{c.drawImage(f,0,0),o.toBlob(r=>{r?(ys(r,`${a}.png`),e()):t(new Error("Failed to create PNG blob"))},"image/png"),URL.revokeObjectURL(p)},f.onerror=()=>{URL.revokeObjectURL(p),t(new Error("Failed to load SVG image"))},f.src=p})}}function gs(e,t){let r=e.children,a=t.children,i=window.getComputedStyle(e),n=["fill","stroke","stroke-width","stroke-dasharray","opacity","fill-opacity","stroke-opacity","font-family","font-size","font-weight","text-anchor","dominant-baseline"];for(let e of n){let r=i.getPropertyValue(e);r&&"none"!==r&&""!==r&&t.style?.setProperty(e,r)}for(let e=0;e<Math.min(r.length,a.length);e++)gs(r[e],a[e])}function ys(e,t){let r=URL.createObjectURL(e),a=document.createElement("a");a.href=r,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(r)}function bs(e){let t={};if(null==e||"object"!=typeof e)return t;for(let[r,a]of Object.entries(e))r.startsWith("_")||null==a||""===a||("number"==typeof a?Number.isFinite(a)&&(t[r]=a):"string"==typeof a?t[r]=a:"boolean"==typeof a?t[r]=String(a):a instanceof Date&&(t[r]=a.toISOString().slice(0,10)));return t}function vs(e){return e&&"object"==typeof e?e:{}}function ws(e){return vs(e.accessibility).tableFields??e.accessibleDatum??e.datum}function As(e){let t=/* @__PURE__ */new Set;if(!e.some(e=>e&&("point"===e.type||"symbol"===e.type||"glyph"===e.type)))return t;for(let r of e)if(r&&["line","area","boxplot","violin"].includes(String(r.type))&&Array.isArray(r.datum))for(let e of r.datum)t.add(e);return t}function $s(e){let t=[];if(!Array.isArray(e))return t;let r=As(e);for(let a of e)if(a&&"object"==typeof a&&null!==a.datum)try{switch(a.type){case"point":case"symbol":case"glyph":if(r.has(a.datum))break;t.push({label:"Point",values:bs(ws(a))});break;case"line":case"area":{let e=ws(a),r=Array.isArray(e)?e:null!=e&&"object"==typeof e?[e]:[],i="line"===a.type?"Line point":"Area point";for(let e of r)t.push({label:i,values:bs(e)});break}case"boxplot":case"violin":{let e=ws(a),r="boxplot"===a.type?"Boxplot":"Distribution",i="string"==typeof a.category?{category:a.category}:{};if(Array.isArray(e)){t.push({label:r,values:{...i,...bs(a.stats)}});for(let a of e)t.push({label:`${r} observation`,values:{...i,...bs(a)}})}else t.push({label:r,values:{...i,...bs(e)}});break}case"rect":{let e=ws(a),r=null!=e&&"object"==typeof e?e:{},i=r.category??a.group??"",n=r.value??r.__aggregateValue??r.total,o=bs(r);null==o.category&&""!==i&&(o.category=String(i)),null==o.value&&null!=n&&(o.value="number"==typeof n||"string"==typeof n?n:String(n)),t.push({label:"Bar",values:o});break}case"heatcell":{let e=bs(ws(a));null==e.value&&"number"==typeof a.value&&Number.isFinite(a.value)&&(e.value=a.value),t.push({label:"Cell",values:e});break}case"wedge":{let e=ws(a),r=bs(e);if(null==r.category){let t=vs(e),a=t.category??t.label;null!=a&&(r.category=String(a))}t.push({label:"Wedge",values:r});break}case"circle":t.push({label:"Node",values:bs(ws(a))});break;case"arc":t.push({label:"Arc",values:bs(ws(a))});break;case"candlestick":t.push({label:"Candlestick",values:bs(ws(a))});break;case"connector":case"trapezoid":case"bezier":case"ribbon":case"curved":t.push({label:"Connection",values:bs(ws(a))});break;case"geoarea":{let e=vs(ws(a)),r=bs(e);if(null==r.name){let t=vs(e.properties).name??e.name;null!=t&&(r.name=String(t))}t.push({label:"Region",values:r});break}}}catch{}return t}function xs(e){if(Array.isArray(e))return e;if(!e||"object"!=typeof e)return[];let t=e;return[...t.nodes??t.sceneNodes??[],...t.sceneEdges??[]]}function Cs(e){let t=e.pointId??e.id??e._transitionKey;return null==t||""===t?void 0:String(t)}function Ss(e){return e.accessibility?.tableFields??e.accessibleDatum??e.datum??null}function ks(e){return"number"==typeof e&&Number.isFinite(e)}function Rs(e){if(ks(e.x)&&ks(e.y)&&ks(e.w)&&ks(e.h))return{x0:e.x,y0:e.y,x1:e.x+e.w,y1:e.y+e.h};if(ks(e.x)&&ks(e.y)&&ks(e.r))return{x0:e.x-e.r,y0:e.y-e.r,x1:e.x+e.r,y1:e.y+e.r};if(ks(e.cx)&&ks(e.cy)&&ks(e.r))return{x0:e.cx-e.r,y0:e.cy-e.r,x1:e.cx+e.r,y1:e.cy+e.r};if(ks(e.cx)&&ks(e.cy)&&ks(e.outerR))return{x0:e.cx-e.outerR,y0:e.cy-e.outerR,x1:e.cx+e.outerR,y1:e.cy+e.outerR};let t=[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat().filter(e=>Array.isArray(e)&&ks(e[0])&&ks(e[1]));return t.length>0?{x0:Math.min(...t.map(e=>e[0])),y0:Math.min(...t.map(e=>e[1])),x1:Math.max(...t.map(e=>e[0])),y1:Math.max(...t.map(e=>e[1]))}:null}function Ps(e){return[...[e.x,e.y,e.w,e.h,e.r,e.cx,e.cy,e.innerR,e.outerR,e.x1,e.x2,e.y1,e.y2,e.openY,e.closeY,e.highY,e.lowY,e.bodyWidth].filter(e=>void 0!==e),...[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat(2)]}function Ns(e,t){let r=Math.max(0,Math.min(e.x1,t.x1)-Math.max(e.x0,t.x0))*Math.max(0,Math.min(e.y1,t.y1)-Math.max(e.y0,t.y0)),a=Math.max(0,e.x1-e.x0)*Math.max(0,e.y1-e.y0),i=Math.max(0,t.x1-t.x0)*Math.max(0,t.y1-t.y0),n=Math.min(a,i);return n>0?r/n:0}function Es(e,t,r,a,i){if(e===t)return!0;let n=r.dataRoles.map(e=>Ha(e,a,i)).filter(e=>!!e).filter(r=>null!=e[r]&&null!=t[r]);return n.length>0&&n.every(r=>String(e[r])===String(t[r]))}function Ts(e,t,r,a,i,n="warn",o){return{id:e,category:t,status:r?"pass":n,message:r?a:i,...o?{evidence:o}:{}}}function Is(e){let{recipe:t}=e,r=xs(e.scene),a=e.layoutConfig??_a({layoutConfig:e.layoutConfig}),i=e.dimensions.plot??{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},n=i.x??0,o=i.y??0,s=[],l=r.filter(e=>null!=Ss(e)),c=r.filter(e=>!("string"!=typeof e.pathD||!/NaN|Infinity|undefined/.test(e.pathD))||Ps(e).some(e=>"number"!=typeof e||!Number.isFinite(e)));s.push(Ts("geometry.finite","geometry",0===c.length,"All emitted geometry is finite.",`${c.length} marks contain non-finite geometry.`,"fail",{count:c.length}));let u=r.map(Rs),d=u.filter(e=>e&&(e.x1<=e.x0||e.y1<=e.y0)).length;s.push(Ts("geometry.nonzero-area","geometry",0===d,"All bounded marks have positive area.",`${d} marks have zero or negative area.`,"warn",{count:d}));let h=u.filter(e=>e&&(e.x0<n||e.y0<o||e.x1>n+i.width||e.y1>o+i.height)).length;s.push(Ts("geometry.bounds","geometry",0===h,"All bounded marks stay inside the plot.",`${h} marks extend outside the plot bounds.`,"warn",{count:h}));let p=t.audit?.minimumHitTargetSize??t.accessibility.minimumHitTarget??24,m=u.filter(e=>!!e&&(e.x1-e.x0<p||e.y1-e.y0<p)).length;s.push(Ts("interaction.target-size","interaction",0===m,`All bounded targets meet the declared ${p}px minimum.`,`${m} targets are smaller than ${p}px in at least one dimension.`,"warn",{count:m,minimumTarget:p}));let g=l.map(Cs),y=g.filter(e=>!e).length,b=/* @__PURE__ */new Set,v=g.filter(e=>!(!e||!b.has(e)&&(b.add(e),1)));s.push(Ts("identity.stable-ids","identity",0===y,"Every data-bearing mark exposes a stable id.",`${y} data-bearing marks have no pointId, id, or transition key.`,t.audit?.requireStableIds?"fail":"warn",{missing:y})),s.push(Ts("identity.unique-ids","identity",0===v.length,"Stable mark ids are unique.",`${v.length} duplicate stable ids were observed.`,"fail",{duplicates:[...new Set(v)].slice(0,10)}));let w=g.filter(e=>e&&/^(datum|mark|node|point|rect)-?\d+$/.test(e)).length;w>0&&s.push({id:"identity.index-pattern",category:"identity",status:"warn",message:`${w} ids look index-derived and may change when data is reordered.`,remediation:"Derive ids from a declared identifier role or stable domain key."});let A=/* @__PURE__ */new Set,$=0,x=e.inputData;for(let e of l){let r=Ss(e),i=Array.isArray(r)?r:[r],n=!1;for(let e of i)if(e&&"object"==typeof e)for(let r=0;r<x.length;r+=1)Es(e,x[r],t,a,x)&&(A.add(r),n=!0);n||($+=1)}let C=Math.max(0,x.length-A.size);s.push(Ts("coverage.input-data","coverage",0===C,"Every input datum is represented by the observed scene.",`${C} input data items have no matching scene mark.`,t.audit?.requireDatumCoverage?"fail":"warn",{represented:A.size,input:x.length})),s.push(Ts("coverage.scene-data","coverage",0===$,"Every data-bearing scene mark maps back to input data.",`${$} scene marks do not map back to an input datum.`,"warn",{count:$})),!t.encodings?.some(e=>"count"===e.channel)&&l.length>A.size&&A.size>0&&s.push({id:"coverage.duplicate-references",category:"coverage",status:"warn",message:"Input data is referenced by multiple marks, but multiplicity is not declared as an encoding.",remediation:"Declare count/repetition semantics or preserve a one-to-one datum-to-mark mapping."});let S=l.filter(e=>!1===e.interactive).length;s.push(Ts("interaction.hit-targets","interaction",0===S&&l.length>0,"Every observed data-bearing scene node participates in hit testing.",0===l.length?"No data-bearing scene nodes were emitted for interaction.":`${S} data-bearing marks explicitly disable interaction.`,"fail"));let k=(e.annotations??[]).map(e=>e.pointId).filter(e=>null!=e).map(String),R=k.filter(e=>!b.has(e));s.push(Ts("coverage.annotation-anchors","coverage",0===R.length,k.length?"All pointId annotation anchors resolve to observed scene nodes.":"No pointId annotations require scene resolution.",`${R.length} annotations point to missing scene ids.`,"fail",{unresolved:R}));let P=(e.chart?.selectedIds??[]).filter(e=>!b.has(e));e.chart?.selectedIds&&s.push(Ts("interaction.selection-reachability","interaction",0===P.length,"Selected/highlighted states resolve to observed marks.",`${P.length} selected ids are not reachable in the scene.`,"fail",{missing:P}));let N=$s(r),E=(t.accessibility.tableFields??t.accessibility.tableRoles?.map(e=>({role:e,label:e}))??[]).map(e=>{if(e.field)return e.field;let r=e.role?t.dataRoles.find(t=>t.role===e.role):void 0;return r?Ha(r,a,x):void 0}).filter(e=>!!e),T=new Set(N.flatMap(e=>Object.keys(e.values))),I=E.filter(e=>!T.has(e));s.push(Ts("accessibility.table-fields","accessibility",0===I.length,E.length?"The accessible table preserves all recipe-declared fields.":"The recipe declares no explicit accessible table field projection.",`The accessible table loses declared fields: ${I.join(", ")}.`,"fail",{expectedFields:E,observedFields:[...T]})),new Set(x.flatMap(e=>Object.entries(e).filter(([,e])=>["string","number","boolean"].includes(typeof e)).map(([e])=>e))).size>2&&T.size<=2&&[...T].every(e=>"category"===e||"value"===e)&&s.push({id:"accessibility.generic-table-loss",category:"accessibility",status:"warn",message:"The table exposes only generic category/value fields although richer input data exists.",remediation:"Emit accessibleDatum or accessibility.tableFields on scene nodes."});let M=(t.encodings?.filter(e=>"color"===e.channel)??[]).filter(e=>!e.redundantWith||0===e.redundantWith.length);s.push(Ts("accessibility.color-only","accessibility",0===M.length,"Every declared color encoding names a redundant cue.",`${M.length} color encodings have no declared redundant cue.`,"warn"));let O=e.chart;if(O){for(let[e,r]of[["title",t.accessibility.requiresTitle],["summary",t.accessibility.requiresSummary],["description","required"===t.accessibility.description]])r&&s.push(Ts(`accessibility.${e}`,"accessibility","string"==typeof O[e]&&O[e].trim().length>0,`A chart ${e} is present.`,`The recipe requires a chart ${e}, but none was supplied.`,"fail"));(t.accessibility.requiresAccessibleTable||"required"===t.accessibility.accessibleTable||t.accessibility.fallbackTable)&&s.push(Ts("accessibility.fallback-table","accessibility",!1!==O.accessibleTable,"The accessible fallback table is enabled.","The recipe requires a fallback table, but accessibleTable is disabled.","fail")),O.navigationTree&&s.push(Ts("accessibility.navigation-depth","accessibility",(O.navigationTree.children?.length??0)>0,"The navigation tree exposes structure below the root.","The navigation tree is root-only.","fail"))}let F=e.theme?.background??"#ffffff",j=r.filter(e=>{let t=e.style?.fill??e.fill;if("string"!=typeof t||!t.startsWith("#")||!F.startsWith("#"))return!1;let r=f(t,F);return null!=r&&r<3}).length;s.push(Ts("visual.contrast","visual",0===j,"All statically checkable mark fills meet 3:1 contrast.",`${j} marks have fill contrast below 3:1.`,"warn",{background:F}));let L=0,z=u.filter(e=>!!e).slice(0,500);for(let e=0;e<z.length;e+=1)for(let t=e+1;t<z.length;t+=1)Ns(z[e],z[t])>=.8&&(L+=1);L>z.length&&s.push({id:"visual.overlap-density",category:"visual",status:"warn",message:`${L} near-total mark overlaps suggest occlusion or excessive density.`,remediation:"Aggregate, jitter, layer explicitly, or declare overlap as intentional."});let B=[["manual-at.screen-reader","Verify real screen-reader behavior with the target browser/AT combinations."],["manual-at.cognitive-load","Assess cognitive load and whether the custom metaphor is understood."],["manual-at.keyboard-order","Verify that keyboard order is meaningful, not merely mechanically available."],["manual-at.animation","Verify that animation is not distracting and reduced-motion behavior is sufficient."],["manual-at.reception","Test whether the memorable form is received as intended by the target audience."],["manual-at.overlay-occlusion","Inspect labels, overlays, annotations, and important marks for clipping or occlusion."],["manual-at.observation","Exercise hover, focus, selection, and observation emission in the rendered chart."]].map(([e,t])=>({id:e,category:"manual-at",status:"manual",message:t})),D={dataRoles:t.dataRoles.map(e=>e.role),intents:t.intents.map(Da).filter(e=>!!e),accessibilityExpectations:[...t.accessibility.requirements??[],...t.accessibility.tableFields?.map(e=>`table field: ${e.label}`)??[]],fallbackDeclared:!0===t.accessibility.fallbackTable||"required"===t.accessibility.accessibleTable||!0===t.accessibility.requiresAccessibleTable,designContractDeclared:!!t.designContract?.whyCustom},_=[...s,...B],U=s.filter(e=>"fail"===e.status).length;return{recipeId:t.id,ok:0===U,summary:{marks:r.length,passes:_.filter(e=>"pass"===e.status).length,warnings:_.filter(e=>"warn"===e.status).length,failures:U,manual:_.filter(e=>"manual"===e.status).length},declaredSemantics:D,observedSceneEvidence:s,manualATChecks:B}}function Ms(e){switch(e){case"sum":case"mean":case"count":case"min":case"max":return e;case"average":return"mean";default:return}}function Os(e){let t="value",r=0;for(;e.has(t);)t="value_"+ ++r;return t}function Fs(e,t,r){if(!Array.isArray(e))throw new TypeError("aggregate data must be an array of rows");if(t.some(e=>"string"!=typeof e||0===e.length))throw new TypeError("groupBy must contain nonempty field names");let a=[...new Set(t)],i=new Set(a);for(let e of r){if(Ms(e.operation)!==e.operation||!e.operation)throw new TypeError("Unsupported aggregate operation");if("string"!=typeof e.outputField||!e.outputField||i.has(e.outputField))throw new TypeError("outputField must be a nonempty field distinct from groupBy and other aggregate outputs");if("count"!==e.operation&&("string"!=typeof e.field||!e.field))throw new TypeError("A value field is required for this aggregate");i.add(e.outputField)}let n={},o=[];for(let t=0;t<e.length;t++){let i=e[t];if(!i||"object"!=typeof i||Array.isArray(i))throw new TypeError(`aggregate data row ${t} must be an object`);let s=n;for(let e of a){let t=i[e],r=t instanceof Date?s.dates??(s.dates=/* @__PURE__ */new Map):s.values??(s.values=/* @__PURE__ */new Map),a=t instanceof Date?t.getTime():t,n=r.get(a);n||(n={},r.set(a,n)),s=n}s.group||(s.group={keys:Object.fromEntries(a.map(e=>[e,i[e]])),count:0,measures:r.map(()=>({total:0,count:0}))},o.push(s.group));let l=s.group;l.count++;for(let e=0;e<r.length;e++){let t=r[e];if("count"===t.operation)continue;let a=It(i[t.field]);if(void 0===a||!Number.isFinite(a))continue;let n=l.measures[e];"min"===t.operation||"max"===t.operation?(!n.count||("min"===t.operation?a<n.total:a>n.total))&&(n.total=a):n.total+=a,n.count++}}return o.map(e=>Object.fromEntries([...Object.entries(e.keys),...r.map((t,r)=>{let a=e.measures[r],i="count"===t.operation?e.count:a.count?"mean"===t.operation?a.total/a.count:a.total:null;return[t.outputField,i]})]))}function js(e){let t=e.encoding??{},r=[];if(Object.values(t).some(e=>void 0!==e.aggregate)&&void 0!==e.data?.values){let t=e.data.values;(!Array.isArray(t)||t.some(e=>!e||"object"!=typeof e||Array.isArray(e)))&&r.push({code:"INVALID_AGGREGATE_DATA",severity:"error",path:"/data/values",message:"Aggregation requires data.values to be an array of row objects."})}for(let[a,i]of Object.entries(t)){if(void 0===i.aggregate)continue;let n,o=Ms(i.aggregate),s="UNSUPPORTED_AGGREGATE";o?(t.x?.bin||t.y?.bin)&&"count"!==o?n=`Binned aggregate "${i.aggregate}" on ${a} is not supported; Histogram counts source rows.`:"count"===o||i.field?e.data?.values||(s="INVALID_AGGREGATE",n=`aggregate: "${i.aggregate}" on ${a} requires inline data.values; accessors remain unchanged.`):(s="INVALID_AGGREGATE",n=`aggregate: "${i.aggregate}" on ${a} requires an encoded value field.`):n=`Unsupported aggregate "${i.aggregate}" on ${a}; data was not aggregated.`,n&&r.push({code:s,severity:"error",path:`/encoding/${a}/aggregate`,message:n})}return r}function Ls(e,t){let r=e.encoding??{},a=e.data?.values,i=js(e);if(t.push(...i.map(({message:e})=>e)),!a||i.length||r.x?.bin||r.y?.bin)return{data:a,encoding:r};let n=new Set(Object.values(r).filter(e=>void 0===e.aggregate&&e.field).map(e=>e.field)),o=new Set(n),s=[],l={...r};for(let[e,t]of Object.entries(r)){let r=Ms(t.aggregate);if(!r)continue;let a=Os(o);o.add(a),s.push({field:t.field,operation:r,outputField:a}),l[e]={...t,field:a,aggregate:void 0}}return s.length?{data:Fs(a,[...n],s),encoding:l}:{data:a,encoding:r}}function zs(e){if(!e)return{type:"",markProps:{}};if("string"==typeof e)return{type:e,markProps:{}};let{type:t,...r}=e;return{type:t,markProps:r}}function Bs(e){if(e)return"string"==typeof e?e:e.text}function Ds(e){return"nominal"===e||"ordinal"===e}function _s(e){return"quantitative"===e||"temporal"===e}function Us(e){return e.usermeta?.idid}function Gs(e){return"annotation-layer"===e.usermeta?.idid?.role}function Hs(e){if(!Us(e)||!Array.isArray(e.layer))return e;let t=e.layer.filter(e=>!Gs(e));if(1!==t.length)return e;let{layer:r,...a}=e,{usermeta:i,...n}=t[0];return{...a,...n}}function Vs(e){e=Hs(e);let t=[],{type:r,markProps:a}=zs(e.mark),{data:i,encoding:n}=Ls(e,t),o=n.x,s=n.y,l=n.color,c=n.size,u=n.theta,d=n.opacity;!i&&e.data?.url&&t.push("data.url is not supported — only inline data.values can be translated. Provide data manually."),e.transform&&e.transform.length>0&&t.push("Vega-Lite transforms are not supported. Pre-transform your data before passing to fromVegaLite()."),e.layer&&t.push('Layered specs ("layer") are not supported. Only single-mark specs can be translated.'),(e.hconcat||e.vconcat||e.concat)&&t.push('Concatenated views ("hconcat"/"vconcat"/"concat") are not supported. Translate each sub-spec individually.'),(e.facet||n.facet||n.row||n.column)&&t.push("Faceted views are not supported. Use Semiotic's LinkedCharts or render multiple charts manually."),e.repeat&&t.push('Repeated views ("repeat") are not supported. Translate each field combination individually.'),(e.params||e.selection)&&t.push("Selections/params are not supported. Use Semiotic's LinkedCharts and selection props for interactivity.");let h={};e.width&&(h.width=e.width),e.height&&(h.height=e.height);let p,f=Bs(e.title);if(f&&(h.title=f),l?.field&&(h.colorBy=l.field,l.scale?.scheme)){let e=td[l.scale.scheme];e&&(h.colorScheme=e)}if(void 0!==d?.value&&(h.pointOpacity=d.value),o?.bin||s?.bin){let e="Histogram";i&&(h.data=i),o?.bin?(h.valueAccessor=o.field,o.axis?.title&&(h.valueLabel=o.axis.title)):s?.bin&&(h.valueAccessor=s.field,s.axis?.title&&(h.valueLabel=s.axis.title)),l?.field&&(h.categoryAccessor=l.field);let r=o?.bin||s?.bin,a="object"==typeof r?r.maxbins:void 0;return a&&(h.bins=a),Ys(e,h,t)}switch(r){case"bar":p=qs(o,s,l,h,i);break;case"line":if(p="LineChart",Ws(o,s,h),l?.field&&(h.lineBy=l.field),a.interpolate){let e=rd[a.interpolate];e&&(h.curve=e)}!0===a.point&&(h.showPoints=!0),i&&(h.data=i);break;case"area":if(l?.field?(p="StackedAreaChart",h.areaBy=l.field):p="AreaChart",Ws(o,s,h),a.interpolate){let e=rd[a.interpolate];e&&(h.curve=e)}void 0!==a.opacity&&(h.areaOpacity=a.opacity),i&&(h.data=i);break;case"point":case"circle":case"square":c?.field?(p="BubbleChart",h.sizeBy=c.field,c.scale?.range&&(h.sizeRange=c.scale.range)):p="Scatterplot",Ws(o,s,h),i&&(h.data=i);break;case"rect":p="Heatmap",o?.field&&(h.xAccessor=o.field),s?.field&&(h.yAccessor=s.field),l?.field&&(h.valueAccessor=l.field,delete h.colorBy),o?.axis?.title&&(h.xLabel=o.axis.title),s?.axis?.title&&(h.yLabel=s.axis.title),i&&(h.data=i);break;case"arc":a.innerRadius&&a.innerRadius>0?(p="DonutChart",h.innerRadius=a.innerRadius):p="PieChart",u?.field?h.valueAccessor=u.field:s?.field&&(h.valueAccessor=s.field),l?.field&&(h.categoryAccessor=l.field),o?.field&&!u?.field&&(h.categoryAccessor=o.field),i&&(h.data=i);break;case"tick":p="DotPlot",Ds(o?.type)?(h.categoryAccessor=o.field,s?.field&&(h.valueAccessor=s.field),o?.axis?.title&&(h.categoryLabel=o.axis.title),s?.axis?.title&&(h.valueLabel=s.axis.title)):Ds(s?.type)?(h.categoryAccessor=s.field,o?.field&&(h.valueAccessor=o.field),h.orientation="horizontal",s?.axis?.title&&(h.categoryLabel=s.axis.title),o?.axis?.title&&(h.valueLabel=o.axis.title)):(o?.field&&(h.categoryAccessor=o.field),s?.field&&(h.valueAccessor=s.field)),i&&(h.data=i);break;default:t.push(`Unsupported mark type "${r}". Defaulting to Scatterplot.`),p="Scatterplot",Ws(o,s,h),i&&(h.data=i)}return Ys(p,h,t)}function qs(e,t,r,a,i){let n;return r?.field&&!1!==e?.stack&&!1!==t?.stack&&null!==e?.stack&&null!==t?.stack?(n="StackedBarChart",a.stackBy=r.field):n="BarChart",Ds(e?.type)&&_s(t?.type)?(a.categoryAccessor=e.field,a.valueAccessor=t.field,e?.axis?.title&&(a.categoryLabel=e.axis.title),t?.axis?.title&&(a.valueLabel=t.axis.title)):_s(e?.type)&&Ds(t?.type)?(a.categoryAccessor=t.field,a.valueAccessor=e.field,a.orientation="horizontal",t?.axis?.title&&(a.categoryLabel=t.axis.title),e?.axis?.title&&(a.valueLabel=e.axis.title)):(e?.field&&(a.categoryAccessor=e.field),t?.field&&(a.valueAccessor=t.field),e?.axis?.title&&(a.categoryLabel=e.axis.title),t?.axis?.title&&(a.valueLabel=t.axis.title)),i&&(a.data=i),n}function Ws(e,t,r){e?.field&&(r.xAccessor=e.field),t?.field&&(r.yAccessor=t.field),e?.axis?.title&&(r.xLabel=e.axis.title),t?.axis?.title&&(r.yLabel=t.axis.title)}function Ys(e,t,r){let a={component:e,props:t,version:"1",createdAt:/* @__PURE__ */(new Date).toISOString()};if(r.length>0){a.warnings=r;for(let e of r)console.warn(`[semiotic/fromVegaLite] ${e}`)}return a}function Ks(e){if(!Number.isFinite(e))return String(e);let t=Number.isInteger(e)?e:Number(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():String(t)}function Js(e){return Array.isArray(e)?e[0]:e}function Xs(e){let t=!0===e?.__semioticHoverData,r=e&&("node"===e.type||"edge"===e.type||void 0!==e.nodeOrEdge||void 0!==e.allSeries||void 0!==e.stats||void 0!==e.__chartType),a=t||e&&void 0!==e.data&&"number"==typeof e.x&&"number"==typeof e.y&&r,i=Js(a?e.data??{}:e);if(!i||(("node"===e?.nodeOrEdge&&"number"==typeof i?.x0&&"number"==typeof i?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof i?.sankeyWidth)&&i.data&&"object"==typeof i.data&&(i=i.data),!i))return null;if(a&&(void 0!==e.allSeries||void 0!==e.xValue)){let t=Un({...i},Gn(i));void 0!==e.allSeries&&void 0===t.allSeries&&(t.allSeries=e.allSeries),void 0!==e.xValue&&void 0===t.xValue&&(t.xValue=e.xValue),i=t}return i}function Zs(e){return e.getHours()||e.getMinutes()||e.getSeconds()||e.getMilliseconds()?e.toLocaleString():e.toLocaleDateString()}function Qs(e,t){for(let r of t){let t=e.find(e=>e.lower===r);if(t)return t}}function el(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};let r=t.maxEntries??6,a=!1!==t.skipPositional,i=[];for(let[t,r]of Object.entries(e)){if(t.startsWith("_")||"data"===t)continue;let e=t.toLowerCase();if(a&&ld.has(e)||null==r)continue;let n=typeof r;"string"!==n&&"number"!==n&&"boolean"!==n&&!(r instanceof Date)||i.push({key:t,lower:e,value:r})}if(0===i.length)return{entries:[]};let n=i.findIndex(e=>nd.includes(e.lower)),o=n>=0;n<0&&(n=i.findIndex(e=>"id"===e.lower)),n<0&&(n=i.findIndex(e=>"string"==typeof e.value));let s=n>=0?i[n]:void 0,l=i.filter((e,t)=>t!==n&&(!o||"id"!==e.lower)),c=Qs(l,od),u=Qs(l,sd),d=[];c&&d.push({key:c.key,value:c.value}),u&&d.push({key:u.key,value:u.value});for(let e of l){if(d.length>=r)break;od.includes(e.lower)||sd.includes(e.lower)||d.push({key:e.key,value:e.value})}return{titleKey:s?.key,title:s?.value,entries:d}}function tl(e){return null!=e&&"boolean"!=typeof e&&("string"==typeof e?e.trim().length>0:Array.isArray(e)?e.some(tl):!cd.isValidElement(e)||e.type!==cd.Fragment||tl(e.props.children))}function rl(){let e=globalThis;return e[hd]??(e[hd]=cd.createContext(void 0))}function al(e){return e.ownsChrome=!0,e}function il(e){if("string"!=typeof e)return null!=e;let t=e.trim().toLowerCase();return!(!t||"transparent"===t||/^rgba\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t)||/^hsla\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t))}function nl(e){if("function"==typeof e)return!0===e.ownsChrome;if(!cd.isValidElement(e))return!1;let t=e.type;if("string"!=typeof t&&t&&!0===t.ownsChrome)return!0;let r=e.props,a=r["data-semiotic-tooltip-chrome"];if(null!=a&&!1!==a&&"false"!==a)return!0;let i=r.style;return!(!i||"object"!=typeof i||!il(i.background)&&!il(i.backgroundColor))}function ol(e,t){return"function"==typeof t?t(e):e[t]}function sl(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e)return Number.isFinite(e)?Ks(e):String(e);if(e instanceof Date)return Zs(e);if("object"==typeof e&&null!==e){let t=e;if(void 0!==t.id)return String(t.id);if(void 0!==t.name)return String(t.name);try{return JSON.stringify(e)}catch{return Array.isArray(e)?`[Array(${e.length})]`:"[Object]"}}return String(e)}function ll(e,t,r){let a="string"==typeof t?t:t.accessor||t.key||"";return{label:"string"==typeof t?t:t.label,value:sl(ol(e,a),"string"==typeof t?r:t.format||r)}}function cl(e={}){let{fields:t,chrome:r,title:a,format:i,style:n={},className:o=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let s,l=[];if(a){let t=ol(e,a);s=sl(t,i)}if(t&&t.length>0)l.push(...t.map(t=>ll(e,t,i)));else if(!a){let t=["value","y","name","id","label"];for(let r of t)if(void 0!==e[r]){s=sl(e[r],i);break}if(!s){let t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(s=sl(e[t[0]],i))}}/* */
2
+ return gd(fd,{chrome:r,className:o,style:n,children:[s&&/* @__PURE__ */md("div",{style:{fontWeight:l.length>0?"bold":"normal"},children:s}),l.map((e,t)=>/* @__PURE__ */gd("div",{style:{marginTop:0===t&&s?"4px":0},children:[e.label&&/* @__PURE__ */gd("span",{children:[e.label,": "]}),e.value]},t))]})}}function ul(e={}){let{fields:t=[],chrome:r,title:a,format:i,style:n={},className:o="",showLabels:s=!0,separator:l=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;let c=[];if(a){let t=ol(e,a);c.push({value:sl(t,i)})}if(t&&Array.isArray(t)&&t.length>0)for(let r of t){let t=ll(e,r,i);c.push({...t,label:s?t.label:void 0})}else{let t=el(e,{skipPositional:!1});null!=t.title&&c.push({label:void 0,value:sl(t.title,i),bold:!0}),t.entries.forEach(e=>{c.push({label:s?e.key:void 0,value:sl(e.value,i)})})}return Array.isArray(c)&&0!==c.length?/* @__PURE__ */md(fd,{chrome:r,className:`semiotic-tooltip-multiline ${o}`.trim(),style:n,children:c.map((e,t)=>/* @__PURE__ */gd("div",{style:{marginBottom:t<c.length-1?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&/* @__PURE__ */gd("strong",{children:[e.label,l]}),e.value]},t))}):null}}function dl(e){return"multi"===e||hl(e)}function hl(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"mode"in e&&"multi"===e.mode}function pl(e){let{tooltip:t,defaultTooltipContent:r,multiDefaultContent:a=ml(),customFunctionContext:i="datum"}=e,n=t;if(!1===t)return{tooltipContent:()=>null};if(dl(n)){let e=hl(n)&&"function"==typeof n.content?gl(void 0===n.chrome?n.content:{content:n.content,chrome:n.chrome}):void 0,t=hl(n)?n.chrome:void 0;return{tooltipContent:e||(void 0===t?a:e=>{let r=a(e);return tl(r)?/* @__PURE__ */md(pd,{chrome:t,children:r}):null}),tooltipMode:"multi"}}return"hover"===i&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:gl(n)||r}}function fl(e){let{tooltip:t,defaultTooltipContent:r,customFunctionContext:a="datum"}=e;return!1===t?{tooltipContent:()=>null}:"hover"===a&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:gl(t)||r}}function ml({xFormat:e,yFormat:t}={}){function r(e,t){if(t)try{let r=t(e);if(null!=r)return r}catch{}return sl(e)}return a=>{let i=a.allSeries;if(!i||0===i.length){let e=a.data?.value??a.data?.y;/* */
3
+ return md(fd,{children:/* @__PURE__ */md("div",{children:r(e,t)})})}let n=a.xValue??a.data?.time??a.data?.x;/* */
4
+ return gd(fd,{children:[null!=n&&/* @__PURE__ */md("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:r(n,e)}),i.map((e,a)=>/* @__PURE__ */gd("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[
5
+ /* @__PURE__ */md("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:e.color,flexShrink:0}}),
6
+ /* @__PURE__ */md("span",{style:{flex:1,fontSize:"0.85em"},children:e.group}),
7
+ /* @__PURE__ */md("span",{style:{fontWeight:500,fontSize:"0.85em"},children:r(e.value,t&&(r=>t(r,e.group)))})]},a))]})}}function gl(e){if(!0!==e){if("function"==typeof e||"object"==typeof e&&null!==e&&"content"in e&&"function"==typeof e.content&&!hl(e)){let t="function"==typeof e?e:e.content,r="function"==typeof e?void 0:e.chrome,a=e=>{let a=Xs(e);if(!a)return null;let i=t(a);return tl(i)?void 0===r&&(nl(t)||nl(i))?i:/* @__PURE__ */md(fd,{chrome:r,children:i}):null};return void 0===r&&nl(t)?al(a):a}if(!1===e||void 0===e)return!1;if(hl(e)){if("function"==typeof e.content)return!yd&&"production"!==process.env.NODE_ENV&&(yd=!0,console.warn('[semiotic] tooltip={{ mode: "multi", content }} reached a chart without multi-series hover. content receives one datum and no allSeries.')),gl(void 0===e.chrome?e.content:{content:e.content,chrome:e.chrome});"production"!==process.env.NODE_ENV&&console.warn('[semiotic] tooltip={{ mode: "multi" }} reached normalizeTooltip without a chart that wires tooltipMode. Use a line/area-family chart with multi support, or pass frameProps.tooltipMode: "multi" to StreamXYFrame.');let t=ul({chrome:e.chrome});return gl(e=>t(e))}if("object"==typeof e&&null!==e&&("fields"in e||"title"in e||"chrome"in e)){let t=cl(e);return gl(e=>t(e))}if("multi"===e){"production"!==process.env.NODE_ENV&&console.warn('[semiotic] tooltip="multi" reached normalizeTooltip on a single-tooltip chart. Rendering multi-field content as a backward-compatible fallback.');let e=ul();return gl(t=>e(t))}return cl()}}function yl(e){let t=1/0,r=-1/0;for(let a of e)a<t&&(t=a),a>r&&(r=a);return[t,r]}function bl(e=240){let t=e*Math.PI/180,r=360-e,a=180+r/2,i=a*Math.PI/180;return{sweepRad:t,gapDeg:r,startAngleDeg:a,startAngleRad:i,offsetRad:-Math.PI/2+i}}function vl(e,t,r,a,i){let n=r-t||1;return i+(Math.max(t,Math.min(r,e))-t)/n*a}function wl(e=240){let{sweepRad:t,offsetRad:r}=bl(e),a=[[Math.cos(r),Math.sin(r)],[Math.cos(r+t),Math.sin(r+t)],[0,0]];for(let e=0;e<2*Math.PI;e+=Math.PI/2)((e-r)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<=t+.001&&a.push([Math.cos(e),Math.sin(e)]);let i=a.map(e=>e[0]),n=a.map(e=>e[1]),[o,s]=yl(i),[l,c]=yl(n);return{minX:o,maxX:s,minY:l,maxY:c,width:s-o,height:c-l,cx:(o+s)/2,cy:(l+c)/2}}var Al=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],$l={mode:"light",colors:{primary:"#00a2ce",secondary:"#6c757d",categorical:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],sequential:"blues",diverging:"RdBu",background:"transparent",surface:"#ffffff",text:"#333",textSecondary:"#666",grid:"#e0e0e0",border:"#ccc",selection:"#00a2ce",selectionOpacity:.15,success:"#2ca02c",danger:"#d62728",warning:"#f0ad4e",error:"#b4181b",info:"#00a2ce"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},xl={mode:"dark",colors:{primary:"#4fc3f7",secondary:"#90a4ae",categorical:["#4fc3f7","#ffb74d","#81c784","#ef5350","#ba68c8","#a1887f","#f06292","#90a4ae","#dce775","#4dd0e1"],sequential:"blues",diverging:"RdBu",background:"#1a1a2e",surface:"#252540",text:"#e0e0e0",textSecondary:"#aaa",grid:"#333",border:"#555",selection:"#4fc3f7",selectionOpacity:.15,success:"#81c784",danger:"#ef5350",warning:"#ffb74d",error:"#d84848",info:"#4fc3f7"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},Cl={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:Al,sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#000000",textSecondary:"#333333",grid:"#999999",border:"#000000",focus:"#0000cc",selection:"#0000cc",selectionOpacity:.1,success:"#006400",danger:"#cc0000",warning:"#b15a00",error:"#8b0000",info:"#0000cc"},typography:{fontFamily:"system-ui, sans-serif",titleSize:18,labelSize:14,tickSize:12},tooltip:{background:"#000000",text:"#ffffff",borderRadius:"4px",fontSize:"14px",shadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},borderRadius:"4px"},Sl=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"],kl={danger:"#da1e28",warning:"#f1c21b",success:"#24a148",info:"#0043ce"},Rl={light:$l,dark:xl,"high-contrast":Cl,pastels:{mode:"light",colors:{primary:"#c9a0dc",secondary:"#b8a8c8",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#fdf6f0",surface:"#fff5ee",text:"#4a3728",textSecondary:"#7a644a",grid:"#e8d5c4",border:"#e8d5c4",focus:"#8a5fae",annotation:"#8a5fae",success:"#9ad4a3",danger:"#e8869a",warning:"#f0c888",error:"#c86070",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#fff5ee",text:"#4a3728",borderRadius:"8px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"10px"},"pastels-dark":{mode:"dark",colors:{primary:"#c9a0dc",secondary:"#a899c0",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#1a1525",surface:"#251e35",text:"#e8ddf0",textSecondary:"#a899c0",grid:"#3d3455",border:"#3d3455",focus:"#c9a0dc",annotation:"#c9a0dc",success:"#88d4ab",danger:"#f0a0c0",warning:"#f0c888",error:"#e87690",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#251e35",text:"#e8ddf0",borderRadius:"8px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"10px"},"bi-tool":{mode:"light",colors:{primary:"#2563eb",secondary:"#6b7280",categorical:["#2563eb","#0d9488","#ea580c","#6b7280"],sequential:"blues",background:"#f5f6f8",surface:"#ffffff",text:"#2c3e50",textSecondary:"#64717f",grid:"#d8dce3",border:"#d8dce3",focus:"#2563eb",annotation:"#2563eb",success:"#10b981",danger:"#ef4444",warning:"#f59e0b",error:"#dc2626",info:"#2563eb"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2c3e50",borderRadius:"6px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"8px"},"bi-tool-dark":{mode:"dark",colors:{primary:"#3b82f6",secondary:"#9ca3af",categorical:["#3b82f6","#14b8a6","#f97316","#9ca3af"],sequential:"blues",background:"#111827",surface:"#1f2937",text:"#f3f4f6",textSecondary:"#9ca3af",grid:"#374151",border:"#374151",focus:"#3b82f6",annotation:"#3b82f6",success:"#34d399",danger:"#f87171",warning:"#fbbf24",error:"#ef4444",info:"#60a5fa"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f2937",text:"#f3f4f6",borderRadius:"6px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"8px"},italian:{mode:"light",colors:{primary:"#cc0000",secondary:"#666666",categorical:["#cc0000","#333333","#c8a415","#4682b4"],sequential:"reds",background:"#fafafa",surface:"#ffffff",text:"#1a1a1a",textSecondary:"#666666",grid:"#e0e0e0",border:"#e0e0e0",focus:"#cc0000",annotation:"#cc0000",success:"#556b2f",danger:"#cc0000",warning:"#c8a415",error:"#8b0000",info:"#4682b4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#1a1a1a",borderRadius:"2px",shadow:"0 2px 4px rgba(0, 0, 0, 0.15)"},borderRadius:"2px"},"italian-dark":{mode:"dark",colors:{primary:"#ff3333",secondary:"#aaaaaa",categorical:["#ff3333","#aaaaaa","#d4a843","#6aa4d4"],sequential:"reds",background:"#0a0a0a",surface:"#1a1a1a",text:"#f5f5f5",textSecondary:"#aaaaaa",grid:"#333333",border:"#333333",focus:"#ff3333",annotation:"#ff3333",success:"#7a8b5a",danger:"#ff3333",warning:"#d4a843",error:"#cc0000",info:"#6aa4d4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1a1a1a",text:"#f5f5f5",borderRadius:"2px",shadow:"0 2px 8px rgba(0, 0, 0, 0.5)"},borderRadius:"2px"},tufte:{mode:"light",colors:{primary:"#8b0000",secondary:"#555555",categorical:["#8b4513","#556b2f","#4a5568","#800020"],sequential:"oranges",background:"#fffff8",surface:"#fffff8",text:"#111111",textSecondary:"#555555",grid:"#e0ddd0",border:"#e0ddd0",focus:"#8b0000",annotation:"#8b0000",success:"#556b2f",danger:"#8b0000",warning:"#b88700",error:"#6b0000",info:"#4a5568"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#fffff8",text:"#111111",borderRadius:"2px",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},borderRadius:"0px"},"tufte-dark":{mode:"dark",colors:{primary:"#c05050",secondary:"#a09880",categorical:["#c08050","#7a8b5a","#8090a0","#a05060"],sequential:"oranges",background:"#1c1b18",surface:"#262520",text:"#e8e4d8",textSecondary:"#a09880",grid:"#3d3c35",border:"#3d3c35",focus:"#c05050",annotation:"#d06a6a",success:"#7a8b5a",danger:"#c05050",warning:"#c8a060",error:"#a04040",info:"#8090a0"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262520",text:"#e8e4d8",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.4)"},borderRadius:"0px"},journalist:{mode:"light",colors:{primary:"#e45050",secondary:"#666666",categorical:["#3a86c8","#e45050","#d4a843","#888888"],sequential:"blues",background:"#ffffff",surface:"#f8f8f8",text:"#222222",textSecondary:"#666666",grid:"#d4d4d4",border:"#d4d4d4",focus:"#e45050",annotation:"#c63b3b",success:"#2d7a3d",danger:"#c8303a",warning:"#d4a843",error:"#a02028",info:"#3a86c8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:18,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#f8f8f8",text:"#222222",borderRadius:"4px",shadow:"0 2px 6px rgba(0, 0, 0, 0.12)"},borderRadius:"4px"},"journalist-dark":{mode:"dark",colors:{primary:"#ff6b6b",secondary:"#a0a0a0",categorical:["#5a9fd8","#ff6b6b","#e0c060","#aaaaaa"],sequential:"blues",background:"#141414",surface:"#1e1e1e",text:"#ededed",textSecondary:"#a0a0a0",grid:"#383838",border:"#383838",focus:"#ff6b6b",annotation:"#ff6b6b",success:"#6fba78",danger:"#ff6b6b",warning:"#e0c060",error:"#d04040",info:"#5a9fd8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1e1e1e",text:"#ededed",borderRadius:"4px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"4px"},playful:{mode:"light",colors:{primary:"#8b5cf6",secondary:"#7c5a9e",categorical:["#8b5cf6","#ec4899","#06b6d4","#84cc16"],sequential:"viridis",background:"#fdf8ff",surface:"#ffffff",text:"#2d1b4e",textSecondary:"#7c5a9e",grid:"#e8d0f8",border:"#e8d0f8",focus:"#8b5cf6",annotation:"#7a47e8",success:"#10d870",danger:"#ff4b6e",warning:"#ffaa33",error:"#e11d48",info:"#06b6d4"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2d1b4e",borderRadius:"12px",shadow:"0 4px 12px rgba(139, 92, 246, 0.15)"},borderRadius:"12px"},"playful-dark":{mode:"dark",colors:{primary:"#a78bfa",secondary:"#b8a0d8",categorical:["#a78bfa","#f472b6","#22d3ee","#a3e635"],sequential:"viridis",background:"#150a28",surface:"#1f1138",text:"#f0e8ff",textSecondary:"#b8a0d8",grid:"#3a2560",border:"#3a2560",focus:"#a78bfa",annotation:"#a78bfa",success:"#4ade80",danger:"#fb7185",warning:"#fbbf24",error:"#f43f5e",info:"#22d3ee"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f1138",text:"#f0e8ff",borderRadius:"12px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"12px"},carbon:{mode:"light",colors:{primary:"#0f62fe",secondary:"#525252",categorical:["#6929c4","#1192e8","#005d5d","#9f1853"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#161616",textSecondary:"#525252",grid:"#e0e0e0",border:"#e0e0e0",focus:"#0f62fe",annotation:"#0f62fe",success:"#24a148",danger:"#da1e28",warning:"#f1c21b",error:"#a2191f",info:"#0043ce"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#161616",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.2)"},borderRadius:"0px"},"carbon-dark":{mode:"dark",colors:{primary:"#4589ff",secondary:"#a8a8a8",categorical:["#a56eff","#33b1ff","#08bdba","#ff7eb6"],sequential:"blues",diverging:"RdBu",background:"#161616",surface:"#262626",text:"#f4f4f4",textSecondary:"#a8a8a8",grid:"#393939",border:"#393939",focus:"#4589ff",annotation:"#4589ff",success:"#42be65",danger:"#fa4d56",warning:"#f1c21b",error:"#da1e28",info:"#4589ff"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262626",text:"#f4f4f4",borderRadius:"2px",shadow:"0 4px 12px rgba(0, 0, 0, 0.5)"},borderRadius:"0px"}},Pl=Object.freeze({"mark-scaffold-hierarchy":3,"palette-authorship":1,"palette-economy":1,"typographic-hierarchy":1,"theme-coherence":2,"editorial-emphasis":1}),Nl=Object.freeze({hierarchyRatio:2,scaffoldContrastMin:1.1,scaffoldContrastMax:2,titleScaleRatio:1.25,categoricalColorMax:7,emphasisRatioMin:.05,emphasisRatioMax:.35}),El=Object.freeze({name:"Semiotic balanced",weights:Pl,thresholds:Nl,minimumScore:70}),Tl=Object.freeze({name:"Aesthetics off",weights:/* @__PURE__ */Object.freeze(
8
8
  /* @__PURE__ */Object.fromEntries(
9
- /* @__PURE__ */ /* @__PURE__ */Object.keys(bl).map(e=>[e,0]))),minimumScore:0}),$l=[["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"]],xl=/* @__PURE__ */new Set(["category10","tableau10"]),Sl=/* @__PURE__ */new Set(["DonutChart","PieChart","SwimlaneChart"]),Cl={"mark-scaffold-hierarchy":"Mark–scaffold hierarchy","palette-authorship":"Palette authorship","palette-economy":"Palette economy","typographic-hierarchy":"Typographic hierarchy","theme-coherence":"Theme coherence","editorial-emphasis":"Editorial emphasis"};import*as kl from"react";var Rl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Pl={year:!0,date:!0},Nl=[[1e3,"K"],[1e6,"M"],[1e9,"B"]],El=null;import{jsx as Il,jsxs as Tl}from"react/jsx-runtime";var Ml=["MotifBraidChart","DependencyForestChart","FlowCircuitChart","BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","GaugeChart","FunnelChart","RadarChart","SwimlaneChart","LikertChart","LineChart","BumpChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","BubbleChart","Heatmap","QuadrantChart","MultiAxisLineChart","WaterfallChart","CandlestickChart","ConnectedScatterplot","ScatterplotMatrix","MinimapChart","ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram","TreeDiagram","Treemap","CirclePack","OrbitDiagram","ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram","RealtimeLineChart","RealtimeHistogram","TemporalHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","GauntletChart","CrucibleChart","ProcessFlowChart","PacketFlowChart","ChainReactionChart","BigNumber"],Ol=/* @__PURE__ */new Set(Ml),Fl={title:["BigNumber"],description:[],summary:[]},jl=["string","number",["number","object"],["boolean","object"],"boolean",["array","object"],["string","function"],["string","array","object"],["boolean","function","object","string"],"array","object",["boolean","string"],"function",["string","object"],["boolean","string","function","object"],["boolean","string","object"],["boolean","string","function"],["number","function"],["boolean","object","string","number"],["object","string","number","function"],["boolean","array"],["object","array"],["object","function"],["string","boolean"],["number","string","function"],["number","string"],["boolean","string","number","object"],["string","array"],["array","string"],["string","object","function"],["boolean","number","array"],["number","null"],["array","function"],["string","number","array","object","function"]],zl=[["primary","context","sparkline","mobile"],["highlight","isolate","none"],["right","left","top","bottom"],["nice","exact"],["primary","secondary"],["linear","log","time"],["linear","log","symlog"],["sliding","growing"],["left","right"],["organize","required-paths"],["vertical","horizontal"],["horizontal","vertical"],["linear","monotoneX","monotoneY","step","stepAfter","stepBefore","basis","cardinal","catmullRom"],["break","interpolate","zero"],["descending","ascending"],["smooth","linear"],["start","end","both","auto"],["series"],["zero","wiggle","silhouette","diverging"],["key","input","insideOut","asc","desc"],["blues","reds","greens","viridis","oranges","purples","greys","plasma","inferno","magma","cividis","turbo","custom"],["count","sum","mean"],["histogram","density","label"],["crossfilter","intersect"],["auto","worker","sync"],["source","target","gradient"],["justify","left","right","center"],["value","temporal"],["off","reuse"],["insertion","crossing-min","inside-out","crossing-min+inside-out"],["stack","hug"],["temporal","max"],["auto"],["raw","scene"],["source","target","both"],["full","half"],["source","target"],["tree","cluster","partition","treemap","circlepack"],["vertical","horizontal","radial"],["line","curve"],["leaf","parent","all"],["locked","decay","alternate"],["geo","line"],["basic","offset","arc"],["butt","round","square"],["straight","fractional"],["radial","strip"],["up","down"],["primary","context","sparkline","mobile","sample","mechanical"],["sample","mechanical"],["route","net"],["outcome","hold-last"],["replay","snapshot"],["horizontal"],["allAbsorbed","none"],["circle","halo","faceted","pill","diamond","square"],["auto","normalized","pixels"],["path","none"],["snapshot","replay","mechanical"],["none","blocker-amplification"],["domino-ball"],["vertical"],["settle"],["number","currency","percent","compact","duration"],["higher-is-better","lower-is-better","neutral"],["auto","positive","negative","neutral"],["tile","presentation","inline","thumbnail"],["start","center","end"]],Bl={common:{mode:[0,0],width:1,height:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,enableHover:4,showLegend:4,legendInteraction:[0,1],legendPosition:[0,2],legend:5,showGrid:4,colorBy:6,colorScheme:7,tooltip:8,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,maxDevicePixelRatio:1,axisExtent:[0,3],animate:3,loading:4,loadingContent:3,emptyContent:3,hoverHighlight:11,chartId:0,emphasis:[0,4],responsiveWidth:4,responsiveHeight:4,color:0,stroke:0,strokeWidth:1,opacity:1,onObservation:12,frameProps:10,onClick:12},network:{styleRules:9,perspective:13},xyAxis:{showAxes:4,xLabel:0,yLabel:0,xFormat:12,yFormat:12,xScaleType:[0,5],yScaleType:[0,6]},ordinalAxis:{categoryLabel:0,valueLabel:0,showCategoryTicks:4,valueFormat:12,categoryFormat:12,dataIdAccessor:6},realtime:{data:9,mode:[0,0],size:9,responsiveWidth:4,responsiveHeight:4,width:1,height:1,maxDevicePixelRatio:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,showLegend:4,legendPosition:[0,2],legendInteraction:[0,1],timeAccessor:6,valueAccessor:6,windowSize:1,windowMode:[0,7],capacity:1,capacityMode:[0,7],arrowOfTime:[0,8],timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,cursor:0,enableHover:3,tooltip:14,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,decay:10,pulse:10,staleness:10,linkedHover:15,selection:10,loading:4,loadingContent:3,emptyContent:3,chartId:0,emphasis:[0,4],pointIdAccessor:6,onObservation:12},realtimeStatic:{data:9,mode:[0,0],size:9,responsiveWidth:4,responsiveHeight:4,width:1,height:1,maxDevicePixelRatio:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,showLegend:4,legendPosition:[0,2],legendInteraction:[0,1],timeAccessor:6,valueAccessor:6,arrowOfTime:[0,8],timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,cursor:0,enableHover:3,tooltip:14,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,decay:10,pulse:10,staleness:10,linkedHover:15,selection:10,loading:4,loadingContent:3,emptyContent:3,chartId:0,emphasis:[0,4],pointIdAccessor:6,onObservation:12},physics:{data:9,mode:[0,0],size:9,width:1,height:1,maxDevicePixelRatio:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,emphasis:[0,4],responsiveWidth:4,responsiveHeight:4,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,colorBy:6,color:0,stroke:0,strokeWidth:1,opacity:1,seed:1,ballRadius:1,hoverRadius:1,paused:4,tooltip:14,annotations:9,autoPlaceAnnotations:3,background:0,legend:5,legendPosition:[0,2],legendLayout:10,selection:10,linkedHover:15,onSimulationStateChange:12,loading:4,loadingContent:3,emptyContent:3,frameProps:10}},Ll=[[["atlas"],"none",[],[],{width:1,height:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,onObservation:12,annotations:9,frameProps:10,atlas:10,colorScheme:7,linkedHover:15,selection:10,onClick:12}],[["forest"],"none",[],[],{width:1,height:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,onObservation:12,annotations:9,frameProps:10,linkedHover:15,linkedSelection:10,onSelectNode:12,forest:10,reading:[0,9],selection:10,collapsedNodeIds:9,highlightedEdgeIds:9,colors:10}],[["circuit","edition","reading"],"none",[],[],{width:1,height:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,onObservation:12,annotations:9,frameProps:10,linkedHover:15,linkedSelection:10,onSelectNode:12,circuit:10,edition:10,reading:10,selection:10,colors:10,particleBudget:1,placementSeed:1,reducedMotion:4,highlightedEdgeIds:9,layoutSelection:10}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sort:16,barPadding:1,roundedTop:17,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,brush:4,linkedBrush:13,onBrush:12,regression:15}],[["data","stackBy"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,stackBy:6,categoryAccessor:6,valueAccessor:6,orientation:[0,10],normalize:4,sort:16,barPadding:1,roundedTop:17,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,showLegend:4,brush:4,linkedBrush:13,onBrush:12}],[["data","groupBy"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,groupBy:6,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sort:16,barPadding:1,roundedTop:17,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,showLegend:4,brush:4,linkedBrush:13,onBrush:12}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sizeBy:6,sizeRange:9,symbolBy:6,symbolMap:10,pointRadius:1,pointOpacity:1,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:13}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],showOutliers:4,outlierRadius:1,categoryPadding:1,valueExtent:9,styleRules:9}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,bins:1,relative:4,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:13}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],bins:1,curve:0,showIQR:4,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:13}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,orientation:[0,10],categoryAccessor:6,valueAccessor:6,bins:1,amplitude:1,categoryPadding:1,valueExtent:9,styleRules:9}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sort:16,dotRadius:1,categoryPadding:1,valueExtent:9,styleRules:9,showGrid:4,regression:15}],[["data"],"array",["categoryAccessor","valueAccessor"],["common"],{data:9,categoryAccessor:6,valueAccessor:6,styleRules:9,startAngle:1,valueFormat:12,cornerRadius:1,showCategoryTicks:4,dataIdAccessor:6}],[["data"],"array",["categoryAccessor","valueAccessor"],["common"],{data:9,categoryAccessor:6,valueAccessor:6,styleRules:9,innerRadius:1,centerContent:18,valueFormat:12,startAngle:1,cornerRadius:1,showCategoryTicks:4,dataIdAccessor:6}],[["value"],"none",[],["common"],{value:1,min:1,max:1,thresholds:9,gradientFill:10,arcWidth:1,cornerRadius:1,sweep:1,fillZones:4,showNeedle:4,needleColor:0,color:0,valueFormat:12,centerContent:19,centerLabel:0,showScaleLabels:4,backgroundColor:0,styleRules:9}],[["data"],"array",["stepAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,stepAccessor:6,valueAccessor:6,categoryAccessor:6,orientation:[0,11],connectorOpacity:1,showLabels:4,showAxes:4,showCategoryTicks:4,responsiveWidth:4,legendPosition:[0,2],styleRules:9}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,seriesAccessor:6,pointRadius:1,valueExtent:9,styleRules:9}],[["subcategoryAccessor"],"array",["categoryAccessor","subcategoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,subcategoryAccessor:6,valueAccessor:6,orientation:[0,11],barPadding:1,roundedTop:17,valueExtent:9,trackFill:13,gradientFill:3,brush:4,onBrush:12,linkedBrush:13,showCategoryTicks:4,rTickValues:9,tickLabelEdgeAlign:4,responsiveWidth:4,legendPosition:[0,2],styleRules:9}],[[],"array",["categoryAccessor","valueAccessor","levelAccessor","countAccessor"],["common","ordinalAxis"],{data:9,levels:9,categoryAccessor:6,valueAccessor:6,levelAccessor:6,countAccessor:6,orientation:[0,10],barPadding:1,valueExtent:9,styleRules:9}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{frameProps:10,styleRules:9,data:9,xAccessor:6,yAccessor:6,lineBy:6,lineDataAccessor:0,curve:[0,12],lineWidth:1,showPoints:4,pointRadius:1,pointIdAccessor:6,fillArea:20,areaOpacity:1,lineGradient:10,directLabel:3,gapStrategy:[0,13],forecast:10,anomaly:10,band:21,xExtent:9,yExtent:9,brush:4,linkedBrush:13,onBrush:12}],[["data"],"array",["xAccessor","yAccessor"],["common"],{data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,lineBy:6,rankDirection:[0,14],ribbon:4,curve:[0,15],ribbonSizeRange:9,samplesPerSegment:1,lineWidth:1,highlightTop:1,neutralColor:0,ribbonOpacity:1,lineOpacity:1,showPoints:4,pointRadius:1,showLabels:[11,16],labelPriorityAccessor:0,maxLabels:1,showAxes:4,styleRules:9,labelStyle:22,legend:5,legendInteraction:[0,1],legendPosition:[0,2],hoverHighlight:[11,17]}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,areaBy:6,lineDataAccessor:0,curve:[0,12],y0Accessor:6,gradientFill:3,semanticGradient:21,semanticLine:4,lineGradient:10,areaOpacity:1,showLine:4,lineWidth:1,showPoints:4,pointRadius:1,pointIdAccessor:6,forecast:10,anomaly:10,band:21,xExtent:9,yExtent:9}],[[],"array",["xAccessor","seriesAAccessor","seriesBAccessor"],["common","xyAxis"],{data:9,xAccessor:6,seriesAAccessor:6,seriesBAccessor:6,seriesALabel:0,seriesBLabel:0,seriesAColor:0,seriesBColor:0,showLines:4,lineWidth:1,showPoints:4,pointRadius:1,curve:[0,12],areaOpacity:1,gradientFill:3,xExtent:9,yExtent:9,pointIdAccessor:6,windowSize:1,styleRules:9}],[["data","areaBy"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,areaBy:6,lineDataAccessor:0,curve:[0,12],areaOpacity:1,showLine:4,lineWidth:1,showPoints:4,pointRadius:1,normalize:4,baseline:[0,18],stackOrder:[0,19],pointIdAccessor:6,xExtent:9,yExtent:9}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,sizeBy:6,sizeRange:9,symbolBy:6,symbolMap:10,pointRadius:1,pointOpacity:1,pointIdAccessor:6,pulse:10,decay:10,staleness:10,marginalGraphics:22,xExtent:9,yExtent:9,regression:15,forecast:10,anomaly:10,brush:4,linkedBrush:13,onBrush:12}],[["data","sizeBy"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,sizeBy:6,xAccessor:6,yAccessor:6,sizeRange:9,bubbleOpacity:1,bubbleStrokeWidth:1,bubbleStrokeColor:0,pointIdAccessor:6,pulse:10,decay:10,staleness:10,marginalGraphics:22,xExtent:9,yExtent:9,regression:15,brush:4,linkedBrush:13,onBrush:12}],[["data"],"array",["xAccessor","yAccessor","valueAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,valueAccessor:6,colorScheme:[0,20],customColorScale:12,showValues:4,valueFormat:12,cellBorderColor:0,cellBorderWidth:1,pointIdAccessor:6,xExtent:9,yExtent:9,legendPosition:[0,2],heatmapAggregation:[0,21],heatmapXBins:1,heatmapYBins:1}],[[],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,xCenter:1,yCenter:1,quadrants:10,centerlineStyle:10,showQuadrantLabels:4,quadrantLabelSize:1,sizeBy:6,sizeRange:9,pointRadius:1,pointOpacity:1,pointIdAccessor:6}],[["series"],"array",["xAccessor"],["common","xyAxis"],{data:9,xAccessor:6,series:9,colorScheme:7,pointIdAccessor:6,curve:0,lineWidth:1,styleRules:9}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{data:9,xAccessor:6,yAccessor:6,positiveColor:0,negativeColor:0,connectorStroke:0,connectorWidth:1,gap:1,styleRules:9,xExtent:9,yExtent:9,pointIdAccessor:6}],[[],"array",["xAccessor","highAccessor","lowAccessor"],["common","xyAxis"],{data:9,xAccessor:6,highAccessor:6,lowAccessor:6,openAccessor:6,closeAccessor:6,candlestickStyle:10,styleRules:9,pointIdAccessor:6,xExtent:9,yExtent:9,mode:[0,0]}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,orderAccessor:6,orderLabel:0,pointRadius:1,pointIdAccessor:6,pulse:10,decay:10,staleness:10,xExtent:9,yExtent:9,regression:15,forecast:10,anomaly:10}],[["data","fields"],"array",[],["common"],{frameProps:10,data:9,fields:9,fieldLabels:10,cellSize:1,cellGap:1,pointRadius:1,pointOpacity:1,diagonal:[0,22],histogramBins:1,brushMode:[23,23],hoverMode:4,unselectedOpacity:1,idAccessor:6,styleRules:9}],[["data"],"array",[],["common"],{data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,showAxes:4,lineBy:6,lineDataAccessor:0,curve:[0,12],lineWidth:1,styleRules:9,fillArea:4,areaOpacity:1,showPoints:4,pointRadius:1,minimap:10,renderBefore:4,onBrush:12,onBrushEnd:12,brushExtent:9,yExtent:9}],[["nodes","edges"],"network",["nodeIdAccessor","sourceAccessor","targetAccessor"],["common","network"],{nodes:9,edges:9,nodeIdAccessor:6,nodeIDAccessor:6,sourceAccessor:6,targetAccessor:6,nodeLabel:6,nodeSize:24,nodeSizeRange:9,edgeWidth:24,edgeColor:0,edgeOpacity:1,nodeStroke:0,nodeStrokeWidth:1,iterations:1,forceStrength:1,layoutExecution:[0,24],layoutLoadingContent:3,onLayoutStateChange:12,showLabels:4}],[["edges"],"network",["sourceAccessor","targetAccessor"],["common","network"],{edges:9,nodes:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,edgeColorBy:[6,25],orientation:[0,10],nodeAlign:[0,26],nodePaddingRatio:1,nodeWidth:1,nodeLabel:6,showLabels:4,edgeOpacity:1,edgeSort:12}],[["domain"],"network",["sourceAccessor","targetAccessor"],["common","network"],{edges:9,nodes:9,domain:9,axisTicks:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,nodeLabel:6,startTimeAccessor:6,endTimeAccessor:6,systemInTimeAccessor:6,systemOutTimeAccessor:6,xExtentAccessor:6,groupBy:6,edgeIdAccessor:6,orientation:[0,11],legendPosition:[0,2],pairing:[0,27],packing:[0,28],laneOrder:[0,29],maxValueScale:1,lanePlacement:[0,30],nodeSizing:[0,31],showLabels:[11,32],labelPriorityAccessor:0,maxLabels:1,selectionDatum:[0,33],groupPadding:1,ribbonLane:[0,34],ribbonMinRun:25,lifetimeMode:[0,35],showLaneRails:4,showQualityReadout:4,edgeOpacity:1,layoutExecution:[0,24],layoutWorkerThreshold:1,layoutLoadingContent:26,onLayoutStateChange:12,timeFormat:12,valueFormat:12,showParticles:4,particleStyle:10}],[["edges"],"network",["sourceAccessor","targetAccessor"],["common","network"],{edges:9,nodes:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,edgeColorBy:[6,36],padAngle:1,groupWidth:1,sortGroups:12,nodeLabel:6,showLabels:4,edgeOpacity:1}],[["data"],"object",[],["common","network"],{data:10,layout:[0,37],orientation:[0,38],childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,edgeStyle:[0,39],nodeLabel:6,showLabels:4,nodeSize:1}],[["data"],"object",[],["common","network"],{data:10,childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,showLabels:4,labelMode:[0,40],padding:1,paddingTop:1,nodeLabel:6,nodeStyle:12}],[["data"],"object",[],["common","network"],{data:10,childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,showLabels:4,nodeLabel:6,circleOpacity:1,padding:1}],[["data"],"object",[],["common","network"],{data:10,childrenAccessor:6,nodeIdAccessor:6,colorByDepth:4,orbitMode:27,orbitSize:17,speed:1,eccentricity:17,showRings:4,nodeRadius:17,showLabels:4,animated:4,revolution:12,revolutionStyle:[0,41],foregroundGraphics:10}],[["areas","valueAccessor"],"array",["valueAccessor"],["common"],{styleRules:9,areas:28,valueAccessor:6,colorScheme:27,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1,areaOpacity:1}],[["points","sizeBy"],"array",["xAccessor","yAccessor"],["common"],{styleRules:9,points:9,xAccessor:6,yAccessor:6,sizeBy:6,sizeRange:9,areas:28,pointIdAccessor:6,areaStyle:10,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],[["flows"],"array",[],["common"],{flows:9,nodes:9,nodeIdAccessor:0,xAccessor:6,yAccessor:6,valueAccessor:6,lineIdAccessor:6,lineType:[0,42],flowStyle:[0,43],areas:28,areaStyle:10,edgeColorBy:6,styleRules:9,edgeOpacity:1,edgeWidthRange:9,pointRadius:1,edgeLinecap:[0,44],showParticles:4,particleStyle:10,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],[["points","center","costAccessor"],"array",[],["common"],{styleRules:9,points:9,lines:9,xAccessor:6,yAccessor:6,nodeIdAccessor:0,center:0,costAccessor:6,strength:1,lineMode:[0,45],transition:1,pointRadius:1,showRings:30,showRingLabels:4,ringStyle:10,showNorth:4,costLabel:0,cartogramLayout:[0,46],projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],[[],"realtime",[],["realtime"],{tooltip:14,styleRules:9,stroke:0,strokeWidth:1,strokeDasharray:0,opacity:1,seriesAccessor:6,aggregate:10,eventTime:10,transition:10}],[["binSize"],"realtime",[],["realtime"],{tooltip:14,showTimeAxis:4,showGrid:4,hoverHighlight:4,showValueAxis:4,axes:9,styleRules:9,valueBands:9,binSize:1,direction:[0,47],categoryAccessor:6,colors:10,fill:0,stroke:0,strokeWidth:1,opacity:1,gap:1,legend:5,brush:15,onBrush:12,linkedBrush:13,transition:10}],[["data","binSize"],"array",["timeAccessor","valueAccessor","categoryAccessor"],["realtimeStatic"],{showTimeAxis:4,showGrid:4,hoverHighlight:4,showValueAxis:4,axes:9,styleRules:9,valueBands:9,data:9,binSize:1,capacity:1,capacityMode:[0,7],size:9,width:1,height:1,margin:2,className:0,timeAccessor:6,valueAccessor:6,direction:[0,47],categoryAccessor:6,colors:10,timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,enableHover:3,tooltip:14,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,fill:0,stroke:0,strokeWidth:1,opacity:1,gap:1,legend:5,transition:10,linkedHover:15,linkedBrush:13,brush:15,onBrush:12}],[[],"realtime",[],["realtime"],{styleRules:9,categoryAccessor:6,colors:10,radius:1,fill:0,opacity:1,stroke:0,strokeWidth:1,pointStyle:12,yScaleType:[0,6],transition:10}],[[],"realtime",[],["realtime"],{styleRules:9,positiveColor:0,negativeColor:0,connectorStroke:0,connectorWidth:1,gap:1,stroke:0,strokeWidth:1,opacity:1,transition:10}],[[],"realtime",[],["realtime"],{styleRules:9,heatmapXBins:1,heatmapYBins:1,aggregation:[0,21],categoryAccessor:6,colorScheme:[0,20],customColorScale:12}],[[],"array",["valueAccessor"],["physics"],{styleRules:9,valueAccessor:6,valueExtent:9,bins:1,mode:[0,48],simulationMode:[0,49],pegRows:1,mechanicalCount:1,branchProbability:1,referenceLines:21,rerunMS:31,showProjection:4}],[["data"],"array",["timeAccessor","arrivalAccessor","watermarkAtArrivalAccessor"],["physics"],{styleRules:9,timeAccessor:6,arrivalAccessor:6,watermarkAtArrivalAccessor:6,windows:10,watermark:22,timeExtent:9,timeScale:1,rerunMS:31,showProjection:4}],[[],"array",["categoryAccessor","valueAccessor"],["physics"],{styleRules:9,categoryAccessor:6,valueAccessor:6,mode:[0,48],simulationMode:[0,49],mechanicalCount:1,mechanicalCategories:9,unitValue:1,showProjection:4,sediment:4,rerunMS:31}],[[],"array",["xAccessor","groupAccessor","radiusAccessor"],["physics"],{styleRules:9,xAccessor:6,groupAccessor:6,radiusAccessor:6,pointRadius:1,xExtent:9,collisionIterations:1,settle:4,rerunMS:31,showProjection:4}],[["negativeProperties"],"array",["idAccessor","positiveAccessor","negativeAccessor","metricsAccessor","startTimeAccessor"],["physics"],{idAccessor:6,labelAccessor:6,positiveAccessor:6,negativeAccessor:6,metricsAccessor:6,initialViability:6,positiveProperties:9,negativeProperties:9,gates:9,events:32,bodyGroups:32,crashOffset:1,initialSpawnPacing:10,startTimeAccessor:6,onCapacityChange:12,crashDetection:4,rerunMS:31,showChrome:4,showProjection:4,showTethers:4,coreForceMode:[0,50],terminalBehavior:[0,51]}],[["data","phases"],"array",["idAccessor","labelAccessor","categoryAccessor","amountAccessor","metricsAccessor","initialStateAccessor"],["physics"],{description:0,summary:0,phases:9,products:9,events:9,outlets:9,idAccessor:6,labelAccessor:6,categoryAccessor:6,amountAccessor:6,metricsAccessor:6,initialStateAccessor:6,metrics:10,amountLabel:0,conservation:3,projection:10,playback:[0,52],snapshotAt:2,controls:3,paused:4,playbackRate:1,rerunMS:31,seed:25,bodyRadius:1,radiusRange:9,colorBy:6,showBonds:4,showChrome:4,showProjection:4,initialSpawnPacing:10,loading:4,loadingContent:3,emptyContent:3,onStateChange:12,onCrucibleObservation:12,onDiagnostic:12,onConservation:12,onClick:12}],[["stages"],"array",["idAccessor","stageAccessor","groupBy","workAccessor","radiusAccessor"],["physics"],{stages:9,stageAccessor:6,idAccessor:6,groupBy:6,groupLabelAccessor:6,workAccessor:6,styleRules:9,radiusAccessor:6,ballRadius:1,route:[0,53],groupCompletion:[0,54],groupAnchorAlong:1,showProjection:4,showChrome:4,chromeOptions:10,settle:4,gravityX:1,gravityY:1,springStiffness:1,springDamping:1,rerunMS:31,initialSpawnPacing:10,liveCapacity:4,bodyLimit:1,bodyMark:[0,55],seed:1}],[[],"network",["nodeIdAccessor","nodeXAccessor","nodeYAccessor","sourceAccessor","targetAccessor","throughputAccessor","pathAccessor"],["common"],{size:9,background:0,legendLayout:10,nodes:9,links:9,edges:9,data:9,nodeIdAccessor:6,nodeXAccessor:6,nodeYAccessor:6,sourceAccessor:6,targetAccessor:6,throughputAccessor:6,pathAccessor:6,styleRules:9,coordinateMode:[0,56],particleRate:1,maxParticles:1,particleRadius:1,flowSpeed:1,pathConstraint:[0,57],reducedMotion:4,showStaticFlow:4,showNodeLabels:4,showSensors:4,paused:4,rerunMS:31,seed:1}],[["data","taskIDAccessor","labelAccessor","laneAccessor","dependencyAccessor"],"array",["taskIDAccessor","labelAccessor","laneAccessor","dependencyAccessor","startAccessor","endAccessor","progressAccessor","statusAccessor","completionTimeAccessor","blockerAccessor","milestoneAccessor"],["physics"],{taskIDAccessor:6,labelAccessor:6,laneAccessor:6,dependencyAccessor:6,startAccessor:6,endAccessor:6,progressAccessor:6,statusAccessor:6,completionTimeAccessor:6,blockerAccessor:6,milestoneAccessor:6,mode:[0,58],insight:[0,59],currentTime:2,controls:20,mechanism:[0,60],orientation:[0,61],reducedMotion:[0,62],enableHover:4,seed:1,selectedTaskIDs:9,onSelectionChange:12,onObservation:12}],[[],"none",[],[],{width:25,height:25,className:0,chartId:0,description:0,summary:0,loading:4,loadingContent:3,emptyContent:3,value:1,label:0,caption:0,format:[6,63],locale:0,currency:0,precision:1,prefix:0,suffix:0,unit:0,comparison:10,target:10,delta:1,deltaFormat:[6,63],showDeltaPercent:4,direction:[0,64],sentiment:[0,65],thresholds:9,chartSlot:33,chartSize:1,windowSize:1,mode:[0,66],align:[0,67],padding:2,emphasis:[0,4],color:0,background:0,borderColor:0,borderRadius:25,animate:3,stalenessThreshold:1,staleLabel:0,headerSlot:33,valueSlot:33,deltaSlot:33,trendSlot:33,footerSlot:33,onClick:12,onObservation:12}]],_l=/* @__PURE__ */we(),Dl=["orient","visible","label","ticks","tickCount","extent","tickFormat","baseline","jaggedBase","tickValues","gridStyle","axisStyle","grid","includeMax","autoRotate","landmarkTicks","tickAnchor"],Ul=e=>Dl.includes(e),Vl=/* @__PURE__ */new Set(["start","center","end","left","right"]),Gl={swatchSize:{minimum:1,label:"a positive number"},labelGap:{minimum:0,label:"a non-negative number"},itemGap:{minimum:0,label:"a non-negative number"},rowHeight:{minimum:1,label:"a positive number"},maxWidth:{minimum:1,label:"a positive number"},edgeGutter:{minimum:0,label:"a non-negative number"},sideGutter:{minimum:0,label:"a non-negative number"},axisGutter:{minimum:0,label:"a non-negative number"}};import{interpolateLab as Hl}from"d3-interpolate";var ql=/* @__PURE__ */new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),Wl=/* @__PURE__ */new Set(["ForceDirectedGraph","SankeyDiagram","ChordDiagram"]),Yl=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","AreaChart","StackedAreaChart"]),Kl=/* @__PURE__ */new Set(["LineChart","AreaChart","StackedAreaChart"]),Jl=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","FunnelChart"]),Xl=/* @__PURE__ */new Set(["LineChart","AreaChart","StackedAreaChart","ConnectedScatterplot"]),Zl=/* @__PURE__ */new Set(["PieChart","DonutChart"]),Ql={PieChart:"valueAccessor",DonutChart:"valueAccessor",FunnelChart:"valueAccessor"},ec=/* @__PURE__ */new Set(
10
- /* @__PURE__ */Object.keys(Ql)),tc={StackedBarChart:"valueAccessor",StackedAreaChart:"yAccessor"},rc=/* @__PURE__ */new Set(["BigNumber"]),ac=/* @__PURE__ */new Set(["LineChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","ConnectedScatterplot","BubbleChart","QuadrantChart","MultiAxisLineChart","CandlestickChart","Heatmap","MinimapChart"]),ic=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","DotPlot","RidgelinePlot","FunnelChart","LikertChart","SwimlaneChart"]),nc=/* @__PURE__ */new Set(["StreamPhysicsFrame","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),oc=/* @__PURE__ */new Set(["OrbitDiagram",...nc]),sc=/* @__PURE__ */new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart"]),lc=/* @__PURE__ */new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),cc=/* @__PURE__ */new Set(["RealtimeLineChart","RealtimeHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","ProcessSankey"]),uc=/* @__PURE__ */new Set(["MultiAxisLineChart"]),dc=/* @__PURE__ */new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),hc={Scatterplot:"pointRadius",BubbleChart:"pointRadius",ConnectedScatterplot:"pointRadius",QuadrantChart:"pointRadius",SwarmPlot:"pointRadius",DotPlot:"dotRadius"},pc=["label","callout","callout-circle","callout-rect"],fc=/* @__PURE__ */new Set(["label","callout","callout-circle","callout-rect","text","widget"]),mc=/* @__PURE__ */new Set(pc),gc=["type","id","stableId","provenance","lifecycle","status","emphasis","rank","priority","x","y","x0","x1","y0","y1","dx","dy","nx","ny","px","py","coordinates","points","pointId","nodeId","category","field","value","threshold","anchor","position","label","title","text","note","content","shortText","mobileText","wrap","labelPosition","labelBackground","labelColor","textAnchor","dominantBaseline","fontSize","fontWeight","fontStyle","fontFamily","letterSpacing","titleFontWeight","color","fill","fillOpacity","opacity","stroke","strokeWidth","strokeDasharray","strokeColor","width","height","radius","radiusPadding","padding","layer","style","className","connector","disable","subject","bracketType","endCap","showBand","filter","method","steps","trainEnd","bandwidth","order","upperAccessor","lowerAccessor","confidenceAccessor","bandColor","bandOpacity","uncertaintyOpacity","anomalyColor","anomalyRadius","anomalyStyle","cohesion","depth","defensive","gradient"],yc=/* @__PURE__ */new Set(gc),bc=["xExtent","yExtent","rExtent"],vc=/^(\d{4})-(\d{1,2})(?:-(\d{1,2}))?$/,wc=[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date-like",domain:!0},{role:"y",accessor:"yAccessor",defaultAccessor:"y",domain:!0}],Ac={fields:wc},$c=[{...wc[0],nestedDataAccessorProp:"lineDataAccessor",defaultNestedDataAccessor:"coordinates"},{...wc[1],nestedDataAccessorProp:"lineDataAccessor",defaultNestedDataAccessor:"coordinates",allowMissing:!0}],xc={fields:$c},Sc={role:"value",accessor:"valueAccessor",defaultAccessor:"value"},Cc={...Sc,domain:!0},kc={fields:[{...Sc,requirements:["finite","non-negative"]}],aggregates:[{kind:"positive-total",role:"value"}]},Rc={fields:[Sc],aggregates:[{kind:"normalized-total",role:"value",groupAccessor:"categoryAccessor",defaultGroupAccessor:"category",whenProp:"normalize"}]},Pc={fields:$c,aggregates:[{kind:"normalized-total",role:"y",groupAccessor:"xAccessor",defaultGroupAccessor:"x",whenProp:"normalize"}]},Nc={fields:[...wc,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},Ec={fields:[...wc,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},Ic={fields:[Sc]},Tc={fields:[{...Sc,dataProp:"edges",requirements:["finite","non-negative"],missingValue:1}]},Mc={LineChart:xc,AreaChart:xc,BumpChart:xc,Scatterplot:Ec,ConnectedScatterplot:Ac,QuadrantChart:Ec,MinimapChart:xc,BubbleChart:Nc,StackedAreaChart:Pc,DifferenceChart:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date",domain:!0},{role:"value",accessor:"seriesAAccessor",defaultAccessor:"a"},{role:"value",accessor:"seriesBAccessor",defaultAccessor:"b"}]},WaterfallChart:{fields:[{role:"y",accessor:"yAccessor",defaultAccessor:"y"}]},CandlestickChart:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date-like",domain:!0},{role:"high",accessor:"highAccessor",defaultAccessor:"high",requirements:["finite"]},{role:"low",accessor:"lowAccessor",defaultAccessor:"low",requirements:["finite"]},{role:"open",accessor:"openAccessor",whenProps:["openAccessor","closeAccessor"],requirements:["finite"]},{role:"close",accessor:"closeAccessor",whenProps:["openAccessor","closeAccessor"],requirements:["finite"]}]},Heatmap:Ic,BarChart:{fields:[Sc]},GroupedBarChart:{fields:[Sc]},StackedBarChart:Rc,DotPlot:{fields:[Cc]},Histogram:{fields:[Cc]},BoxPlot:{fields:[Cc]},SwarmPlot:{fields:[Cc,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},ViolinPlot:{fields:[Cc]},RidgelinePlot:{fields:[Cc]},PieChart:kc,DonutChart:kc,FunnelChart:kc,SankeyDiagram:Tc,ChordDiagram:Tc,ProportionalSymbolMap:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"lon",dataProp:"points",requirements:["finite"]},{role:"y",accessor:"yAccessor",defaultAccessor:"lat",dataProp:"points",requirements:["finite"]},{role:"size",accessor:"sizeBy",dataProp:"points",requirements:["finite","non-negative"]}]}},Oc=/* @__PURE__ */Symbol.for("semiotic.numericContractRegistry"),Fc={xAccessor:"x",yAccessor:"y",valueAccessor:"value",sizeBy:"size",sizeAccessor:"size",radiusAccessor:"size",countAccessor:"count",amountAccessor:"value",highAccessor:"high",lowAccessor:"low",openAccessor:"open",closeAccessor:"close",lowerAccessor:"lower",upperAccessor:"upper",positiveAccessor:"value",negativeAccessor:"value",progressAccessor:"value",confidenceAccessor:"value",costAccessor:"value",throughputAccessor:"value"},jc=/* @__PURE__ */new Set(["category10","tableau10","set3","blues","reds","greens","oranges","purples","greys","viridis","plasma","inferno","magma","cividis","turbo"]),zc=["xAccessor","yAccessor","timeAccessor","valueAccessor","categoryAccessor","colorBy","sizeBy","lineBy","areaBy","stackBy","groupBy","orderAccessor","y0Accessor","sourceAccessor","targetAccessor","nodeIdAccessor","nodeIDAccessor","childrenAccessor","costAccessor"],Bc=["title","description","summary"],Lc=/* @__PURE__ */new Set(["XYCustomChart","OrdinalCustomChart","NetworkCustomChart","GeoCustomChart","PhysicsCustomChart"]),_c=/* @__PURE__ */new Set([...Lc,"XYFrame","OrdinalFrame","NetworkFrame","GeoFrame"]),Dc=/* @__PURE__ */new Set(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#f0e442","#000000"]),Uc=/* @__PURE__ */Symbol.for("semiotic.chartRecipeRegistry"),Vc={pass:"✓",fail:"✗",warn:"⚠",manual:"○","not-applicable":"·"},Gc=["perceivable","operable","understandable","robust","compromising","assistive","flexible"],Hc={code:"SEMANTIC_DEGENERATE",severity:"error",message:"Marks painted, but the capability reported a semantically degenerate encoding.",fix:"Choose fields that support the chart's intended encoding."},qc={error:0,warning:1,manual:2},Wc={data:0,deception:1,accessibility:2,render:3},Yc=/* @__PURE__ */new Set([...ac,"RealtimeLineChart","RealtimeHeatmap"]),Kc=/* @__PURE__ */Object.fromEntries(
11
- /* @__PURE__ */ /* @__PURE__ */Object.entries(hc).map(([e,t])=>[e,[t,"hoverRadius"]])),Jc={pass:"PASS",warn:"WARN",manual:"MANUAL","not-applicable":"N/A"},Xc=["layout","density","interaction","annotation","semantics"],Zc=/* @__PURE__ */Symbol.for("semiotic.intentRegistry"),Qc=/* @__PURE__ */new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),eu=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),tu=/* @__PURE__ */new Set(["PieChart","DonutChart","FunnelChart"]),ru=/* @__PURE__ */new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]),au={LineChart:"line chart",AreaChart:"area chart",StackedAreaChart:"stacked area chart",DifferenceChart:"difference chart",Scatterplot:"scatter plot",BubbleChart:"bubble chart",ConnectedScatterplot:"connected scatter plot",QuadrantChart:"quadrant chart",MultiAxisLineChart:"dual-axis line chart",CandlestickChart:"candlestick chart",BumpChart:"bump chart",Heatmap:"heatmap",MinimapChart:"line chart",BarChart:"bar chart",StackedBarChart:"stacked bar chart",GroupedBarChart:"grouped bar chart",DotPlot:"dot plot",Histogram:"histogram",BoxPlot:"box plot",ViolinPlot:"violin plot",RidgelinePlot:"ridgeline plot",SwarmPlot:"swarm plot",PieChart:"pie chart",DonutChart:"donut chart",FunnelChart:"funnel chart",GaugeChart:"gauge",LikertChart:"Likert chart",SwimlaneChart:"swimlane chart",ForceDirectedGraph:"network graph",SankeyDiagram:"Sankey diagram",ProcessSankey:"temporal Sankey diagram",ChordDiagram:"chord diagram",TreeDiagram:"tree diagram",Treemap:"treemap",CirclePack:"circle-packing chart",OrbitDiagram:"orbit diagram",ChoroplethMap:"choropleth map",ProportionalSymbolMap:"proportional-symbol map",FlowMap:"flow map",DistanceCartogram:"distance cartogram",BigNumber:"single value",StreamPhysicsFrame:"physics stream frame",EventDropChart:"event-drop physics chart",GaltonBoardChart:"Galton board chart",UnitPileChart:"physics pile chart",CollisionSwarmChart:"collision swarm chart",PacketFlowChart:"physical flow chart",ProcessFlowChart:"process flow physics chart",CrucibleChart:"crucible physics chart",PhysicsCustomChart:"custom physics chart"},iu=/* @__PURE__ */new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),nu=/* @__PURE__ */new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),ou=/* @__PURE__ */new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),su={"outlier-detection":"alerting","change-detection":"alerting",trend:"tracking","composition-over-time":"apportioning","compare-series":"comparing","compare-categories":"comparing",rank:"ranking","part-to-whole":"apportioning",distribution:"characterizing",correlation:"relating",flow:"tracing",hierarchy:"nesting",geo:"locating"},lu={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},cu=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],uu={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"},du=/* @__PURE__ */new Set(["y-threshold","x-threshold","band","x-band","callout","label"]),hu=/* @__PURE__ */new Set(["system","agent","watcher"]),pu=/* @__PURE__ */new Set(["ai","agent","system","computed","dbt","great-expectations"]),fu=/* @__PURE__ */new Set(["rule","statistical-test","llm-inference","computed"]),mu={"y-threshold":"a threshold line","x-threshold":"a threshold line",band:"a highlighted band","x-band":"a highlighted band",label:"a label",callout:"a callout","callout-circle":"a callout","callout-rect":"a callout",text:"a text note",bracket:"a bracket",enclose:"an enclosure","rect-enclose":"an enclosure",highlight:"a highlight",widget:"a widget",trend:"a trend line",envelope:"an envelope","anomaly-band":"an anomaly band",forecast:"a forecast","category-highlight":"a category highlight"},gu=/* @__PURE__ */new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),yu=/* @__PURE__ */new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),bu=/* @__PURE__ */new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),vu=/* @__PURE__ */new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),wu="__semioticSelectionData",Au=/* @__PURE__ */new Set(["data","nodes","edges","points","areas","lines","flows","atlas","forest","circuit","edition","reading"]),$u=(e,t)=>(e>>>t|e<<32-t)>>>0,xu=e=>Math.floor(4294967296*(e-Math.floor(e)))>>>0,[Su,Cu]=/* @__PURE__ */(()=>{let e=[],t=[];for(let r=2;t.length<64;r+=1){let a=!0;for(let e=2;e*e<=r;e+=1)if(r%e===0){a=!1;break}a&&(e.length<8&&e.push(xu(Math.sqrt(r))),t.push(xu(Math.cbrt(r))))}return[e,t]})(),ku=/* @__PURE__ */vo({"artifact.id":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.createdAt":{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"never"},"artifact.configFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.dataFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"purpose.intents":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.communicativeAct":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.stakes":{suppliedBy:["author","import"],derivable:!1,modelMayPropose:!0,humanReview:"required"},claims:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"claims.status":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},evidence:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.source":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.fingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},time:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"time.completeness":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},reception:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},form:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},contestability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"required"},accountability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"policy-dependent"},inheritance:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"}}),Ru=["fresh","stale","unknown"],Pu=["partial","provisional","settled","unknown"],Nu=["observedAt","ingestedAt","processedAt","publishedAt","snapshotAt"],Eu={eventTime:{field:{},value:{},timezone:{},granularity:{}},presentation:{state:{values:["live","historical","mixed"]},label:{}},freshness:{status:{required:!0,values:Ru},checkedAt:{},heartbeatAt:{},expiresAt:{},basis:{}},watermark:{value:{required:!0},policy:{},allowedLateness:{}},window:{start:{required:!0},end:{required:!0},status:{required:!0,values:["open","provisional","settled","reopened","corrected"]}},completeness:{status:{required:!0,values:Pu},basis:{}},revision:{status:{required:!0,values:["original","backfilled","corrected","superseded"]},previousArtifactId:{},correctionId:{},reason:{}},snapshot:{id:{},format:{values:["iceberg","delta","other"]},schemaVersion:{},catalogRef:{}}},Iu={id:{required:!0},kind:{required:!0,values:["stream","processing-job","quality-check","snapshot","publication"]},label:{},observedAt:{},version:{},timezone:{},granularity:{},freshness:{values:Ru},completeness:{values:Pu}},Tu=/* @__PURE__ */new Set(["preserved","unsupported-version","invalid","excluded"]),Mu="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e)),Ou="1",Fu=/* @__PURE__ */new Set(["tooltip","onObservation","xFormat","yFormat","valueFormat","svgAnnotationRules","tooltipContent","onHover","tickFormatTime","tickFormatValue","edgeSort","sortGroups","centerContent","frameProps","controls","oFormat","rFormat","oSort","pieceStyle","summaryStyle","nodeStyle","edgeStyle","customHoverBehavior","customClickBehavior","customDoubleClickBehavior","onBrush","onTopologyChange","backgroundGraphics","foregroundGraphics","interactiveGraphics","legend","recipe","layout"]),ju="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e)),zu={category10:"category10",category20:"category20",category20b:"category20",category20c:"category20",accent:"accent",dark2:"dark2",paired:"paired",pastel1:"pastel1",pastel2:"pastel2",set1:"set1",set2:"set2",set3:"set3",tableau10:"category10",tableau20:"category20"},Bu={linear:"linear","monotone-x":"monotoneX","monotone-y":"monotoneY",monotone:"monotoneX",step:"step","step-after":"stepAfter","step-before":"stepBefore",basis:"basis",cardinal:"cardinal","catmull-rom":"catmullRom"},Lu=class{constructor(e){if(this._capacity=e,this.head=0,this._size=0,e<1)throw new Error("RingBuffer capacity must be at least 1");this.buffer=new Array(e)}push(e){let t;return this._size===this._capacity?t=this.buffer[this.head]:this._size++,this.buffer[this.head]=e,this.head=(this.head+1)%this._capacity,t}pushMany(e){let t=[];for(let r of e){let e=this.push(r);void 0!==e&&t.push(e)}return t}get(e){if(e<0||e>=this._size)return;let t=(this.head-this._size+e+this._capacity)%this._capacity;return this.buffer[t]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let e=0;return{next:()=>e>=this._size?{done:!0,value:void 0}:{done:!1,value:this.get(e++)}}}forEach(e){let t=(this.head-this._size+this._capacity)%this._capacity;for(let r=0;r<this._size;r++)e(this.buffer[(t+r)%this._capacity],r)}toArray(){let e=new Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let r=0;r<this._size;r++)e[r]=this.buffer[(t+r)%this._capacity];return e}resize(e){if(e<1)throw new Error("RingBuffer capacity must be at least 1");let t=this.toArray(),r=0,a=[];t.length>e&&(r=t.length-e,a=t.slice(0,r)),this._capacity=e,this.buffer=new Array(e),this.head=0,this._size=0;for(let e=r;e<t.length;e++)this.push(t[e]);return a}update(e,t){let r=[],a=(this.head-this._size+this._capacity)%this._capacity;for(let i=0;i<this._size;i++){let n=(a+i)%this._capacity,o=this.buffer[n];if(e(o)){let e;e="object"!=typeof o||null===o?o:Array.isArray(o)?[...o]:{...o},r.push(e),this.buffer[n]=t(o)}}return r}remove(e){let t=[],r=[];if(this.forEach(a=>{e(a)?r.push(a):t.push(a)}),0===r.length)return r;this.buffer=new Array(this._capacity),this.head=0,this._size=0;for(let e of t)this.push(e);return r}clear(){this.buffer=new Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}},_u=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(e){Number.isFinite(e)&&(e<this._min&&(this._min=e),e>this._max&&(this._max=e))}evict(e){(e===this._min||e===this._max)&&(this._dirty=!0)}recalculate(e,t){this._min=1/0,this._max=-1/0;for(let r of e){let e=t?t(r):r;Number.isFinite(e)&&(e<this._min&&(this._min=e),e>this._max&&(this._max=e))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}},Du=["name","label","title"],Uu=["type","kind","category","group","class","status","role","shape"],Vu=["value","amount","total","count","weight","score"],Gu=/* @__PURE__ */new Set(["x","y","z","x0","x1","y0","y1","r","cx","cy","radius","layer","row","rowindex","col","column","depth","index","order","sankeywidth","coincidentpoints","sourcelinks","targetlinks","parent","children","fx","fy","vx","vy"]);import*as Hu from"react";import{jsx as qu}from"react/jsx-runtime";var Wu={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, white)",padding:"8px 12px",borderRadius:"var(--semiotic-tooltip-radius, 6px)",fontSize:"var(--semiotic-tooltip-font-size, 14px)",fontFamily:"var(--semiotic-font-family, inherit)",lineHeight:"1.5",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.15))",pointerEvents:"none",maxWidth:"300px",wordWrap:"break-word"},Yu=/* @__PURE__ */Ys(function({chrome:e="default",className:t="",style:r,children:a,...i}){let n="default"===e?{...Wu,...r}:r;/* @__PURE__ */
12
- return qu("div",{...i,"data-semiotic-tooltip-chrome":!0,className:`semiotic-tooltip ${t}`.trim(),style:n,children:a})});import{jsx as Ku,jsxs as Ju}from"react/jsx-runtime";var Xu=!1;export{Al as AESTHETICS_OFF_PROFILE,gl as CARBON_ALERT,ml as CARBON_CATEGORICAL_14,dl as COLOR_BLIND_SAFE_CATEGORICAL,pl as DARK_THEME,wl as DEFAULT_AESTHETIC_PROFILE,vl as DEFAULT_AESTHETIC_THRESHOLDS,bl as DEFAULT_AESTHETIC_WEIGHTS,fl as HIGH_CONTRAST_THEME,_u as IncrementalExtent,hl as LIGHT_THEME,el as MultiLineTooltip,nl as MultiPointTooltip,Lu as RingBuffer,yl as THEME_PRESETS,Qs as Tooltip,Yu as TooltipRoot,Dr as accessibilityCaveats,Y as adaptiveTimeTicks,_r as auditAccessibility,_t as auditData,$a as auditMobileVisualization,Ss as auditObservedScene,A as auditVisualHierarchy,ln as buildNavigationTree,Tn as buildReaderGrounding,ai as communicativeActForIntent,d as composeStyleRules,ul as computeArcBoundingBox,ts as configToJSX,is as configToJSXWithReport,es as copyConfig,un as countNodes,ie as createHatchPattern,X as darkenColor,mi as describeChart,os as deserializeSelections,fr as diagnoseConfig,L as evaluateAesthetics,Zr as evaluateChart,ss as exportChart,cn as flattenVisible,Ur as formatAccessibilityAudit,xt as formatDataAudit,Xr as formatEvaluateChart,xa as formatMobileVisualizationAudit,Xo as fromConfig,Qo as fromURL,zs as fromVegaLite,Mn as getHitRadius,jn as getSourceRows,Js as hasOwnTooltipChrome,Ws as hasTooltipContent,le as hatchFillId,se as hatchFillKey,Ln as histogramBinSelectionDatum,oe as isHatchFill,tl as isMultiTooltip,Z as lightenColor,o as makeNodeRuleContext,i as makeRuleValueResolver,h as makeStyleRuleStyleFn,n as makeXYRuleContext,Ys as markTooltipChrome,l as matchesThreshold,Sa as mobileVisualizationCaveats,ol as normalizeTooltip,$t as profileNumericFields,si as resolveCommunicativeAct,al as resolveMultiCapableTooltip,J as resolveResponsiveDimension,na as resolveResponsiveRules,u as resolveStyleRules,e as resolveThemePreset,il as resolveTooltipContent,aa as responsiveRuleMatches,c as ruleMatches,ns as serializeSelections,K as smartTickFormat,ll as sweepToAngles,r as themeToCSS,t as themeToCSSVariables,a as themeToTokens,qo as toConfig,Ct as toDataAuditNotifications,Qr as toEvaluateChartNotifications,Zo as toURL,Ee as unwrapDatum,Pe as validateProps,cl as valueToAngle};
9
+ /* @__PURE__ */ /* @__PURE__ */Object.keys(Pl).map(e=>[e,0]))),minimumScore:0}),Il=[["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"]],Ml=/* @__PURE__ */new Set(["category10","tableau10"]),Ol=/* @__PURE__ */new Set(["DonutChart","PieChart","SwimlaneChart"]),Fl={"mark-scaffold-hierarchy":"Mark–scaffold hierarchy","palette-authorship":"Palette authorship","palette-economy":"Palette economy","typographic-hierarchy":"Typographic hierarchy","theme-coherence":"Theme coherence","editorial-emphasis":"Editorial emphasis"};import*as jl from"react";var Ll=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],zl={year:!0,date:!0},Bl=[[1e3,"K"],[1e6,"M"],[1e9,"B"]],Dl={enabled:!0,tapToSelect:!0,tapToLockTooltip:!0,clearSelection:"backgroundTap",targetSize:44,snap:"nearestDatum",brushHandleSize:44,standardControls:!1,enabled:!1,tapToSelect:!1,tapToLockTooltip:!1},_l={primary:{width:600,height:400,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:void 0,showLabels:void 0,marginDefaults:{top:50,bottom:60,left:70,right:40}},context:{width:400,height:250,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:10,bottom:10,left:10,right:10}},sparkline:{width:120,height:24,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:2,bottom:2,left:0,right:0}},mobile:{width:390,height:300,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:!1,showLabels:!0,marginDefaults:{top:28,bottom:42,left:44,right:16}}},Ul={tile:{width:280,height:184},presentation:{width:540,height:320},inline:{width:void 0,height:void 0},thumbnail:{width:96,height:56}},Gl=150,Hl=4,Vl=40,ql={MultiAxisLineChart:{width:800,height:400},PieChart:{width:400,height:400},DonutChart:{width:400,height:400},GaugeChart:{width:300,height:250},ForceDirectedGraph:{width:600,height:600},SankeyDiagram:{width:800,height:600},ChordDiagram:{width:600,height:600},TreeDiagram:{width:600,height:600},Treemap:{width:600,height:600},CirclePack:{width:600,height:600},OrbitDiagram:{width:600,height:600},GaltonBoardChart:{width:700,height:420},UnitPileChart:{width:700,height:380},CollisionSwarmChart:{width:700,height:360},EventDropChart:{width:760,height:360},PacketFlowChart:{width:760,height:420},ProcessFlowChart:{width:900,height:420},PhysicsCustomChart:{width:700,height:380},GauntletChart:{width:900,height:520},CrucibleChart:{width:900,height:520},ChainReactionChart:{width:920,height:620},DependencyForestChart:{width:920,height:440},FlowCircuitChart:{width:980,height:860},LineChart:void 0,AreaChart:void 0,StackedAreaChart:void 0,DifferenceChart:void 0,BumpChart:void 0,Scatterplot:void 0,BubbleChart:void 0,Heatmap:void 0,QuadrantChart:void 0,WaterfallChart:void 0,CandlestickChart:void 0,ConnectedScatterplot:void 0,MinimapChart:void 0,ScatterplotMatrix:void 0,BarChart:void 0,StackedBarChart:void 0,GroupedBarChart:void 0,SwarmPlot:void 0,BoxPlot:void 0,Histogram:void 0,ViolinPlot:void 0,RidgelinePlot:void 0,DotPlot:void 0,FunnelChart:void 0,RadarChart:void 0,SwimlaneChart:void 0,LikertChart:void 0,ProcessSankey:void 0,ChoroplethMap:void 0,ProportionalSymbolMap:void 0,FlowMap:void 0,DistanceCartogram:void 0,RealtimeLineChart:void 0,RealtimeHistogram:void 0,TemporalHistogram:void 0,RealtimeTemporalHistogram:void 0,RealtimeSwarmChart:void 0,RealtimeWaterfallChart:void 0,RealtimeHeatmap:void 0,XYCustomChart:void 0,OrdinalCustomChart:void 0,NetworkCustomChart:void 0,GeoCustomChart:void 0,MotifBraidChart:void 0,Sparkline:void 0},Wl=e=>Math.max(6,Math.round(2*e/3)),Yl=null;import{jsx as Kl,jsxs as Jl}from"react/jsx-runtime";var Xl=["MotifBraidChart","DependencyForestChart","FlowCircuitChart","BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","GaugeChart","FunnelChart","RadarChart","SwimlaneChart","LikertChart","LineChart","BumpChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","BubbleChart","Heatmap","QuadrantChart","MultiAxisLineChart","WaterfallChart","CandlestickChart","ConnectedScatterplot","ScatterplotMatrix","MinimapChart","ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram","TreeDiagram","Treemap","CirclePack","OrbitDiagram","ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram","RealtimeLineChart","RealtimeHistogram","TemporalHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","GauntletChart","CrucibleChart","ProcessFlowChart","PacketFlowChart","ChainReactionChart","BigNumber"],Zl=/* @__PURE__ */new Set(Xl),Ql={title:["BigNumber"],description:[],summary:[]},ec=["string","number",["number","object"],["boolean","object"],"boolean",["array","object"],["string","function"],["string","array","object"],["boolean","function","object","string"],"array","object",["boolean","string"],"function",["string","object"],["boolean","string","function","object"],["boolean","string","object"],["boolean","string","function"],["number","function"],["boolean","object","string","number"],["object","string","number","function"],["boolean","array"],["object","array"],["object","function"],["string","boolean"],["number","string","function"],["number","string"],["boolean","string","number","object"],["string","array"],["array","string"],["string","object","function"],["boolean","number","array"],["number","null"],["array","function"],["string","number","array","object","function"]],tc=[["primary","context","sparkline","mobile"],["highlight","isolate","none"],["right","left","top","bottom"],["nice","exact"],["primary","secondary"],["linear","log","time"],["linear","log","symlog"],["sliding","growing"],["left","right"],["organize","required-paths"],["vertical","horizontal"],["horizontal","vertical"],["linear","monotoneX","monotoneY","step","stepAfter","stepBefore","basis","cardinal","catmullRom"],["break","interpolate","zero"],["descending","ascending"],["smooth","linear"],["start","end","both","auto"],["series"],["zero","wiggle","silhouette","diverging"],["key","input","insideOut","asc","desc"],["blues","reds","greens","viridis","oranges","purples","greys","plasma","inferno","magma","cividis","turbo","custom"],["count","sum","mean"],["histogram","density","label"],["crossfilter","intersect"],["auto","worker","sync"],["source","target","gradient"],["justify","left","right","center"],["value","temporal"],["off","reuse"],["insertion","crossing-min","inside-out","crossing-min+inside-out"],["stack","hug"],["temporal","max"],["auto"],["raw","scene"],["source","target","both"],["full","half"],["source","target"],["tree","cluster","partition","treemap","circlepack"],["vertical","horizontal","radial"],["line","curve"],["leaf","parent","all"],["locked","decay","alternate"],["geo","line"],["basic","offset","arc"],["butt","round","square"],["straight","fractional"],["radial","strip"],["start","center"],["up","down"],["primary","context","sparkline","mobile","sample","mechanical"],["sample","mechanical"],["route","net"],["outcome","hold-last"],["replay","snapshot"],["horizontal"],["allAbsorbed","none"],["circle","halo","faceted","pill","diamond","square"],["auto","normalized","pixels"],["path","none"],["snapshot","replay","mechanical"],["none","blocker-amplification"],["domino-ball"],["vertical"],["settle"],["number","currency","percent","compact","duration"],["higher-is-better","lower-is-better","neutral"],["auto","positive","negative","neutral"],["tile","presentation","inline","thumbnail"],["start","center","end"]],rc={common:{mode:[0,0],width:1,height:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,enableHover:4,showLegend:4,legendInteraction:[0,1],legendPosition:[0,2],legend:5,showGrid:4,colorBy:6,colorScheme:7,tooltip:8,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,maxDevicePixelRatio:1,axisExtent:[0,3],animate:3,loading:4,loadingContent:3,emptyContent:3,hoverHighlight:11,chartId:0,emphasis:[0,4],responsiveWidth:4,responsiveHeight:4,color:0,stroke:0,strokeWidth:1,opacity:1,onObservation:12,frameProps:10,onClick:12},network:{styleRules:9,perspective:13},xyAxis:{showAxes:4,xLabel:0,yLabel:0,xFormat:12,yFormat:12,xScaleType:[0,5],yScaleType:[0,6]},ordinalAxis:{categoryLabel:0,valueLabel:0,showCategoryTicks:4,valueFormat:12,categoryFormat:12,dataIdAccessor:6},realtime:{data:9,mode:[0,0],size:9,responsiveWidth:4,responsiveHeight:4,width:1,height:1,maxDevicePixelRatio:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,showLegend:4,legendPosition:[0,2],legendInteraction:[0,1],timeAccessor:6,valueAccessor:6,windowSize:1,windowMode:[0,7],capacity:1,capacityMode:[0,7],arrowOfTime:[0,8],timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,cursor:0,enableHover:3,tooltip:14,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,decay:10,pulse:10,staleness:10,linkedHover:15,selection:10,loading:4,loadingContent:3,emptyContent:3,chartId:0,emphasis:[0,4],pointIdAccessor:6,onObservation:12},realtimeStatic:{data:9,mode:[0,0],size:9,responsiveWidth:4,responsiveHeight:4,width:1,height:1,maxDevicePixelRatio:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,showLegend:4,legendPosition:[0,2],legendInteraction:[0,1],timeAccessor:6,valueAccessor:6,arrowOfTime:[0,8],timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,cursor:0,enableHover:3,tooltip:14,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,decay:10,pulse:10,staleness:10,linkedHover:15,selection:10,loading:4,loadingContent:3,emptyContent:3,chartId:0,emphasis:[0,4],pointIdAccessor:6,onObservation:12},physics:{data:9,mode:[0,0],size:9,width:1,height:1,maxDevicePixelRatio:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,emphasis:[0,4],responsiveWidth:4,responsiveHeight:4,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,colorBy:6,color:0,stroke:0,strokeWidth:1,opacity:1,seed:1,ballRadius:1,hoverRadius:1,paused:4,tooltip:14,annotations:9,autoPlaceAnnotations:3,background:0,legend:5,legendPosition:[0,2],legendLayout:10,selection:10,linkedHover:15,onSimulationStateChange:12,loading:4,loadingContent:3,emptyContent:3,frameProps:10}},ac=[[["atlas"],"none",[],[],{width:1,height:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,onObservation:12,annotations:9,frameProps:10,perspective:13,atlas:10,colorScheme:7,linkedHover:15,selection:10,onClick:12}],[["forest"],"none",[],[],{width:1,height:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,onObservation:12,annotations:9,frameProps:10,perspective:13,linkedHover:15,linkedSelection:10,onSelectNode:12,forest:10,reading:[0,9],selection:10,collapsedNodeIds:9,highlightedEdgeIds:9,colors:10}],[["circuit","edition","reading"],"none",[],[],{width:1,height:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,onObservation:12,annotations:9,frameProps:10,perspective:13,linkedHover:15,linkedSelection:10,onSelectNode:12,networkFrameProps:10,circuit:10,edition:10,reading:10,selection:10,colors:10,particleBudget:1,placementSeed:1,reducedMotion:4,highlightedEdgeIds:9,layoutSelection:10}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sort:16,barPadding:1,roundedTop:17,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,brush:4,linkedBrush:13,onBrush:12,regression:15}],[["data","stackBy"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,stackBy:6,categoryAccessor:6,valueAccessor:6,orientation:[0,10],normalize:4,sort:16,barPadding:1,roundedTop:17,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,showLegend:4,brush:4,linkedBrush:13,onBrush:12}],[["data","groupBy"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,groupBy:6,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sort:16,barPadding:1,roundedTop:17,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,showLegend:4,brush:4,linkedBrush:13,onBrush:12}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sizeBy:6,sizeRange:9,symbolBy:6,symbolMap:10,pointRadius:1,pointOpacity:1,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:13}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],showOutliers:4,outlierRadius:1,categoryPadding:1,valueExtent:9,styleRules:9}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,bins:1,relative:4,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:13}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],bins:1,curve:0,showIQR:4,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:13}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,orientation:[0,10],categoryAccessor:6,valueAccessor:6,bins:1,amplitude:1,categoryPadding:1,valueExtent:9,styleRules:9}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sort:16,dotRadius:1,categoryPadding:1,valueExtent:9,styleRules:9,showGrid:4,regression:15}],[["data"],"array",["categoryAccessor","valueAccessor"],["common"],{data:9,categoryAccessor:6,valueAccessor:6,styleRules:9,startAngle:1,valueFormat:12,cornerRadius:1,showCategoryTicks:4,dataIdAccessor:6}],[["data"],"array",["categoryAccessor","valueAccessor"],["common"],{data:9,categoryAccessor:6,valueAccessor:6,styleRules:9,innerRadius:1,centerContent:18,valueFormat:12,startAngle:1,cornerRadius:1,showCategoryTicks:4,dataIdAccessor:6}],[["value"],"none",[],["common"],{value:1,min:1,max:1,thresholds:9,gradientFill:10,arcWidth:1,cornerRadius:1,sweep:1,fillZones:4,showNeedle:4,needleColor:0,color:0,valueFormat:12,centerContent:19,centerLabel:0,showScaleLabels:4,backgroundColor:0,styleRules:9}],[["data"],"array",["stepAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,stepAccessor:6,valueAccessor:6,categoryAccessor:6,orientation:[0,11],connectorOpacity:1,showLabels:4,showAxes:4,showCategoryTicks:4,responsiveWidth:4,legendPosition:[0,2],styleRules:9}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,seriesAccessor:6,pointRadius:1,valueExtent:9,styleRules:9}],[["subcategoryAccessor"],"array",["categoryAccessor","subcategoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,subcategoryAccessor:6,valueAccessor:6,orientation:[0,11],barPadding:1,roundedTop:17,valueExtent:9,trackFill:13,gradientFill:3,brush:4,onBrush:12,linkedBrush:13,showCategoryTicks:4,rTickValues:9,tickLabelEdgeAlign:4,responsiveWidth:4,legendPosition:[0,2],styleRules:9}],[[],"array",["categoryAccessor","valueAccessor","levelAccessor","countAccessor"],["common","ordinalAxis"],{data:9,levels:9,categoryAccessor:6,valueAccessor:6,levelAccessor:6,countAccessor:6,orientation:[0,10],barPadding:1,valueExtent:9,styleRules:9}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{frameProps:10,styleRules:9,data:9,xAccessor:6,yAccessor:6,lineBy:6,lineDataAccessor:0,curve:[0,12],lineWidth:1,showPoints:4,pointRadius:1,pointIdAccessor:6,fillArea:20,areaOpacity:1,lineGradient:10,directLabel:3,gapStrategy:[0,13],forecast:10,anomaly:10,band:21,xExtent:9,yExtent:9,brush:4,linkedBrush:13,onBrush:12}],[["data"],"array",["xAccessor","yAccessor"],["common"],{data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,lineBy:6,rankDirection:[0,14],ribbon:4,curve:[0,15],ribbonSizeRange:9,samplesPerSegment:1,lineWidth:1,highlightTop:1,neutralColor:0,ribbonOpacity:1,lineOpacity:1,showPoints:4,pointRadius:1,showLabels:[11,16],labelPriorityAccessor:0,maxLabels:1,showAxes:4,styleRules:9,labelStyle:22,legend:5,legendInteraction:[0,1],legendPosition:[0,2],hoverHighlight:[11,17]}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,areaBy:6,lineDataAccessor:0,curve:[0,12],y0Accessor:6,gradientFill:3,semanticGradient:21,semanticLine:4,lineGradient:10,areaOpacity:1,showLine:4,lineWidth:1,showPoints:4,pointRadius:1,pointIdAccessor:6,forecast:10,anomaly:10,band:21,xExtent:9,yExtent:9}],[[],"array",["xAccessor","seriesAAccessor","seriesBAccessor"],["common","xyAxis"],{data:9,xAccessor:6,seriesAAccessor:6,seriesBAccessor:6,seriesALabel:0,seriesBLabel:0,seriesAColor:0,seriesBColor:0,showLines:4,lineWidth:1,showPoints:4,pointRadius:1,curve:[0,12],areaOpacity:1,gradientFill:3,xExtent:9,yExtent:9,pointIdAccessor:6,windowSize:1,styleRules:9}],[["data","areaBy"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,areaBy:6,lineDataAccessor:0,curve:[0,12],areaOpacity:1,showLine:4,lineWidth:1,showPoints:4,pointRadius:1,normalize:4,baseline:[0,18],stackOrder:[0,19],pointIdAccessor:6,xExtent:9,yExtent:9}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,sizeBy:6,sizeRange:9,symbolBy:6,symbolMap:10,pointRadius:1,pointOpacity:1,pointIdAccessor:6,pulse:10,decay:10,staleness:10,marginalGraphics:22,xExtent:9,yExtent:9,regression:15,forecast:10,anomaly:10,brush:4,linkedBrush:13,onBrush:12}],[["data","sizeBy"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,sizeBy:6,xAccessor:6,yAccessor:6,sizeRange:9,bubbleOpacity:1,bubbleStrokeWidth:1,bubbleStrokeColor:0,pointIdAccessor:6,pulse:10,decay:10,staleness:10,marginalGraphics:22,xExtent:9,yExtent:9,regression:15,brush:4,linkedBrush:13,onBrush:12}],[["data"],"array",["xAccessor","yAccessor","valueAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,valueAccessor:6,colorScheme:[0,20],customColorScale:12,showValues:4,valueFormat:12,cellBorderColor:0,cellBorderWidth:1,pointIdAccessor:6,xExtent:9,yExtent:9,legendPosition:[0,2],heatmapAggregation:[0,21],heatmapXBins:1,heatmapYBins:1}],[[],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,xCenter:1,yCenter:1,quadrants:10,centerlineStyle:10,showQuadrantLabels:4,quadrantLabelSize:1,sizeBy:6,sizeRange:9,pointRadius:1,pointOpacity:1,pointIdAccessor:6}],[["series"],"array",["xAccessor"],["common","xyAxis"],{data:9,xAccessor:6,series:9,colorScheme:7,pointIdAccessor:6,curve:0,lineWidth:1,styleRules:9}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{data:9,xAccessor:6,yAccessor:6,positiveColor:0,negativeColor:0,connectorStroke:0,connectorWidth:1,gap:1,styleRules:9,xExtent:9,yExtent:9,pointIdAccessor:6}],[[],"array",["xAccessor","highAccessor","lowAccessor"],["common","xyAxis"],{data:9,xAccessor:6,highAccessor:6,lowAccessor:6,openAccessor:6,closeAccessor:6,candlestickStyle:10,styleRules:9,pointIdAccessor:6,xExtent:9,yExtent:9,mode:[0,0]}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,orderAccessor:6,orderLabel:0,pointRadius:1,pointIdAccessor:6,pulse:10,decay:10,staleness:10,xExtent:9,yExtent:9,regression:15,forecast:10,anomaly:10}],[["data","fields"],"array",[],["common"],{frameProps:10,data:9,fields:9,fieldLabels:10,cellSize:1,cellGap:1,pointRadius:1,pointOpacity:1,diagonal:[0,22],histogramBins:1,brushMode:[23,23],hoverMode:4,unselectedOpacity:1,idAccessor:6,styleRules:9}],[["data"],"array",[],["common"],{data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,showAxes:4,lineBy:6,lineDataAccessor:0,curve:[0,12],lineWidth:1,styleRules:9,fillArea:4,areaOpacity:1,showPoints:4,pointRadius:1,minimap:10,renderBefore:4,onBrush:12,onBrushEnd:12,brushExtent:9,yExtent:9}],[["nodes","edges"],"network",["nodeIdAccessor","sourceAccessor","targetAccessor"],["common","network"],{nodes:9,edges:9,nodeIdAccessor:6,nodeIDAccessor:6,sourceAccessor:6,targetAccessor:6,nodeLabel:6,nodeSize:24,nodeSizeRange:9,edgeWidth:24,edgeColor:0,edgeOpacity:1,nodeStroke:0,nodeStrokeWidth:1,iterations:1,forceStrength:1,layoutExecution:[0,24],layoutLoadingContent:3,onLayoutStateChange:12,showLabels:4}],[["edges"],"network",["sourceAccessor","targetAccessor"],["common","network"],{edges:9,nodes:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,edgeColorBy:[6,25],orientation:[0,10],nodeAlign:[0,26],nodePaddingRatio:1,nodeWidth:1,nodeLabel:6,showLabels:4,edgeOpacity:1,edgeSort:12}],[["domain"],"network",["sourceAccessor","targetAccessor"],["common","network"],{edges:9,nodes:9,domain:9,axisTicks:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,nodeLabel:6,startTimeAccessor:6,endTimeAccessor:6,systemInTimeAccessor:6,systemOutTimeAccessor:6,xExtentAccessor:6,groupBy:6,edgeIdAccessor:6,orientation:[0,11],legendPosition:[0,2],pairing:[0,27],packing:[0,28],laneOrder:[0,29],maxValueScale:1,lanePlacement:[0,30],nodeSizing:[0,31],showLabels:[11,32],labelPriorityAccessor:0,maxLabels:1,selectionDatum:[0,33],groupPadding:1,ribbonLane:[0,34],ribbonMinRun:25,lifetimeMode:[0,35],showLaneRails:4,showQualityReadout:4,edgeOpacity:1,layoutExecution:[0,24],layoutWorkerThreshold:1,layoutLoadingContent:26,onLayoutStateChange:12,timeFormat:12,valueFormat:12,showParticles:4,particleStyle:10}],[["edges"],"network",["sourceAccessor","targetAccessor"],["common","network"],{edges:9,nodes:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,edgeColorBy:[6,36],padAngle:1,groupWidth:1,sortGroups:12,nodeLabel:6,showLabels:4,edgeOpacity:1}],[["data"],"object",[],["common","network"],{data:10,layout:[0,37],orientation:[0,38],childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,edgeStyle:[0,39],nodeLabel:6,showLabels:4,nodeSize:1}],[["data"],"object",[],["common","network"],{data:10,childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,showLabels:4,labelMode:[0,40],padding:1,paddingTop:1,nodeLabel:6,nodeStyle:12}],[["data"],"object",[],["common","network"],{data:10,childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,showLabels:4,nodeLabel:6,circleOpacity:1,padding:1}],[["data"],"object",[],["common","network"],{data:10,childrenAccessor:6,nodeIdAccessor:6,colorByDepth:4,orbitMode:27,orbitSize:17,speed:1,eccentricity:17,showRings:4,nodeRadius:17,showLabels:4,animated:4,revolution:12,revolutionStyle:[0,41],foregroundGraphics:10}],[["areas","valueAccessor"],"array",["valueAccessor"],["common"],{styleRules:9,areas:28,valueAccessor:6,colorScheme:27,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1,areaOpacity:1}],[["points","sizeBy"],"array",["xAccessor","yAccessor"],["common"],{styleRules:9,points:9,xAccessor:6,yAccessor:6,sizeBy:6,sizeRange:9,areas:28,pointIdAccessor:6,areaStyle:10,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],[["flows"],"array",[],["common"],{flows:9,nodes:9,nodeIdAccessor:0,xAccessor:6,yAccessor:6,valueAccessor:6,lineIdAccessor:6,lineType:[0,42],flowStyle:[0,43],areas:28,areaStyle:10,edgeColorBy:6,styleRules:9,edgeOpacity:1,edgeWidthRange:9,pointRadius:1,edgeLinecap:[0,44],showParticles:4,particleStyle:10,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],[["points","center","costAccessor"],"array",[],["common"],{styleRules:9,points:9,lines:9,xAccessor:6,yAccessor:6,nodeIdAccessor:0,center:0,costAccessor:6,strength:1,lineMode:[0,45],transition:1,pointRadius:1,showRings:30,showRingLabels:4,ringStyle:10,showNorth:4,costLabel:0,cartogramLayout:[0,46],projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],[[],"realtime",[],["realtime"],{tooltip:14,styleRules:9,stroke:0,strokeWidth:1,strokeDasharray:0,opacity:1,seriesAccessor:6,aggregate:10,eventTime:10,transition:10}],[["binSize"],"realtime",[],["realtime"],{tooltip:14,showTimeAxis:4,showGrid:4,hoverHighlight:4,showValueAxis:4,axes:9,styleRules:9,valueBands:9,binSize:1,binAlign:[0,47],direction:[0,48],categoryAccessor:6,colors:10,fill:0,stroke:0,strokeWidth:1,opacity:1,gap:1,legend:5,brush:15,onBrush:12,linkedBrush:13,transition:10}],[["data","binSize"],"array",["timeAccessor","valueAccessor","categoryAccessor"],["realtimeStatic"],{showTimeAxis:4,showGrid:4,hoverHighlight:4,showValueAxis:4,axes:9,styleRules:9,valueBands:9,data:9,binSize:1,capacity:1,capacityMode:[0,7],size:9,width:1,height:1,margin:2,className:0,timeAccessor:6,valueAccessor:6,binAlign:[0,47],direction:[0,48],categoryAccessor:6,colors:10,timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,enableHover:3,tooltip:14,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,fill:0,stroke:0,strokeWidth:1,opacity:1,gap:1,legend:5,transition:10,linkedHover:15,linkedBrush:13,brush:15,onBrush:12}],[[],"realtime",[],["realtime"],{styleRules:9,categoryAccessor:6,colors:10,radius:1,fill:0,opacity:1,stroke:0,strokeWidth:1,pointStyle:12,yScaleType:[0,6],transition:10}],[[],"realtime",[],["realtime"],{styleRules:9,positiveColor:0,negativeColor:0,connectorStroke:0,connectorWidth:1,gap:1,stroke:0,strokeWidth:1,opacity:1,transition:10}],[[],"realtime",[],["realtime"],{styleRules:9,heatmapXBins:1,heatmapYBins:1,aggregation:[0,21],categoryAccessor:6,colorScheme:[0,20],customColorScale:12}],[[],"array",["valueAccessor"],["physics"],{styleRules:9,valueAccessor:6,valueExtent:9,bins:1,mode:[0,49],simulationMode:[0,50],pegRows:1,mechanicalCount:1,branchProbability:1,referenceLines:21,rerunMS:31,showProjection:4}],[["data"],"array",["timeAccessor","arrivalAccessor","watermarkAtArrivalAccessor"],["physics"],{styleRules:9,timeAccessor:6,arrivalAccessor:6,watermarkAtArrivalAccessor:6,windows:10,watermark:22,timeExtent:9,timeScale:1,rerunMS:31,showProjection:4}],[[],"array",["categoryAccessor","valueAccessor"],["physics"],{styleRules:9,categoryAccessor:6,valueAccessor:6,mode:[0,49],simulationMode:[0,50],mechanicalCount:1,mechanicalCategories:9,unitValue:1,showProjection:4,sediment:4,rerunMS:31}],[[],"array",["xAccessor","groupAccessor","radiusAccessor"],["physics"],{styleRules:9,xAccessor:6,groupAccessor:6,radiusAccessor:6,pointRadius:1,xExtent:9,collisionIterations:1,settle:4,rerunMS:31,showProjection:4}],[["negativeProperties"],"array",["idAccessor","positiveAccessor","negativeAccessor","metricsAccessor","startTimeAccessor"],["physics"],{idAccessor:6,labelAccessor:6,positiveAccessor:6,negativeAccessor:6,metricsAccessor:6,initialViability:6,positiveProperties:9,negativeProperties:9,gates:9,events:32,bodyGroups:32,crashOffset:1,initialSpawnPacing:10,startTimeAccessor:6,onCapacityChange:12,crashDetection:4,rerunMS:31,showChrome:4,showProjection:4,showTethers:4,coreForceMode:[0,51],terminalBehavior:[0,52]}],[["data","phases"],"array",["idAccessor","labelAccessor","categoryAccessor","amountAccessor","metricsAccessor","initialStateAccessor"],["physics"],{description:0,summary:0,phases:9,products:9,events:9,outlets:9,idAccessor:6,labelAccessor:6,categoryAccessor:6,amountAccessor:6,metricsAccessor:6,initialStateAccessor:6,metrics:10,amountLabel:0,conservation:3,projection:10,playback:[0,53],snapshotAt:2,controls:3,paused:4,playbackRate:1,rerunMS:31,seed:25,bodyRadius:1,radiusRange:9,colorBy:6,showBonds:4,showChrome:4,showProjection:4,initialSpawnPacing:10,loading:4,loadingContent:3,emptyContent:3,onStateChange:12,onCrucibleObservation:12,onDiagnostic:12,onConservation:12,onClick:12}],[["stages"],"array",["idAccessor","stageAccessor","groupBy","workAccessor","radiusAccessor"],["physics"],{stages:9,stageAccessor:6,idAccessor:6,groupBy:6,groupLabelAccessor:6,workAccessor:6,styleRules:9,radiusAccessor:6,ballRadius:1,route:[0,54],groupCompletion:[0,55],groupAnchorAlong:1,showProjection:4,showChrome:4,chromeOptions:10,settle:4,gravityX:1,gravityY:1,springStiffness:1,springDamping:1,rerunMS:31,initialSpawnPacing:10,liveCapacity:4,bodyLimit:1,bodyMark:[0,56],seed:1}],[[],"network",["nodeIdAccessor","nodeXAccessor","nodeYAccessor","sourceAccessor","targetAccessor","throughputAccessor","pathAccessor"],["common"],{size:9,background:0,legendLayout:10,nodes:9,links:9,edges:9,data:9,nodeIdAccessor:6,nodeXAccessor:6,nodeYAccessor:6,sourceAccessor:6,targetAccessor:6,throughputAccessor:6,pathAccessor:6,styleRules:9,coordinateMode:[0,57],particleRate:1,maxParticles:1,particleRadius:1,flowSpeed:1,pathConstraint:[0,58],reducedMotion:4,showStaticFlow:4,showNodeLabels:4,showSensors:4,paused:4,rerunMS:31,seed:1}],[["data","taskIDAccessor","labelAccessor","laneAccessor","dependencyAccessor"],"array",["taskIDAccessor","labelAccessor","laneAccessor","dependencyAccessor","startAccessor","endAccessor","progressAccessor","statusAccessor","completionTimeAccessor","blockerAccessor","milestoneAccessor"],["physics"],{taskIDAccessor:6,labelAccessor:6,laneAccessor:6,dependencyAccessor:6,startAccessor:6,endAccessor:6,progressAccessor:6,statusAccessor:6,completionTimeAccessor:6,blockerAccessor:6,milestoneAccessor:6,mode:[0,59],insight:[0,60],currentTime:2,controls:20,mechanism:[0,61],orientation:[0,62],reducedMotion:[0,63],enableHover:4,seed:1,selectedTaskIDs:9,onSelectionChange:12,onObservation:12}],[[],"none",[],[],{width:25,height:25,className:0,chartId:0,description:0,summary:0,loading:4,loadingContent:3,emptyContent:3,value:1,label:0,caption:0,format:[6,64],locale:0,currency:0,precision:1,prefix:0,suffix:0,unit:0,comparison:10,target:10,delta:1,deltaFormat:[6,64],showDeltaPercent:4,direction:[0,65],sentiment:[0,66],thresholds:9,chartSlot:33,chartSize:1,windowSize:1,mode:[0,67],align:[0,68],padding:2,emphasis:[0,4],color:0,background:0,borderColor:0,borderRadius:25,animate:3,stalenessThreshold:1,staleLabel:0,headerSlot:33,valueSlot:33,deltaSlot:33,trendSlot:33,footerSlot:33,onClick:12,onObservation:12}]],ic=/* @__PURE__ */Oe(),nc=["orient","visible","label","ticks","tickCount","extent","tickFormat","baseline","jaggedBase","tickValues","gridStyle","axisStyle","grid","includeMax","autoRotate","landmarkTicks","tickAnchor"],oc=e=>nc.includes(e),sc=/* @__PURE__ */new Set(["start","center","end","left","right"]),lc={swatchSize:{minimum:1,label:"a positive number"},labelGap:{minimum:0,label:"a non-negative number"},itemGap:{minimum:0,label:"a non-negative number"},rowHeight:{minimum:1,label:"a positive number"},maxWidth:{minimum:1,label:"a positive number"},edgeGutter:{minimum:0,label:"a non-negative number"},sideGutter:{minimum:0,label:"a non-negative number"},axisGutter:{minimum:0,label:"a non-negative number"}};import{interpolateLab as cc}from"d3-interpolate";var uc=/* @__PURE__ */new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),dc=/* @__PURE__ */new Set(["ForceDirectedGraph","SankeyDiagram","ChordDiagram"]),hc=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","AreaChart","StackedAreaChart"]),pc=/* @__PURE__ */new Set(["LineChart","AreaChart","StackedAreaChart"]),fc=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","FunnelChart"]),mc=/* @__PURE__ */new Set(["LineChart","AreaChart","StackedAreaChart","ConnectedScatterplot"]),gc=/* @__PURE__ */new Set(["PieChart","DonutChart"]),yc={PieChart:"valueAccessor",DonutChart:"valueAccessor",FunnelChart:"valueAccessor"},bc=/* @__PURE__ */new Set(
10
+ /* @__PURE__ */Object.keys(yc)),vc={StackedBarChart:"valueAccessor",StackedAreaChart:"yAccessor"},wc=/* @__PURE__ */new Set(["BigNumber"]),Ac=/* @__PURE__ */new Set(["LineChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","ConnectedScatterplot","BubbleChart","QuadrantChart","MultiAxisLineChart","CandlestickChart","Heatmap","MinimapChart"]),$c=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","DotPlot","RidgelinePlot","FunnelChart","LikertChart","SwimlaneChart"]),xc=/* @__PURE__ */new Set(["StreamPhysicsFrame","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),Cc=/* @__PURE__ */new Set(["OrbitDiagram",...xc]),Sc=/* @__PURE__ */new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart"]),kc=/* @__PURE__ */new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),Rc=/* @__PURE__ */new Set(["RealtimeLineChart","RealtimeHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","ProcessSankey"]),Pc=/* @__PURE__ */new Set(["MultiAxisLineChart"]),Nc=/* @__PURE__ */new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),Ec={Scatterplot:"pointRadius",BubbleChart:"pointRadius",ConnectedScatterplot:"pointRadius",QuadrantChart:"pointRadius",SwarmPlot:"pointRadius",DotPlot:"dotRadius"},Tc=["label","callout","callout-circle","callout-rect"],Ic=/* @__PURE__ */new Set(["label","callout","callout-circle","callout-rect","text","widget"]),Mc=/* @__PURE__ */new Set(Tc),Oc=["type","id","stableId","provenance","lifecycle","status","emphasis","rank","priority","x","y","x0","x1","y0","y1","dx","dy","nx","ny","px","py","coordinates","points","pointId","nodeId","category","field","value","threshold","anchor","position","label","title","text","note","content","shortText","mobileText","wrap","labelPosition","labelBackground","labelColor","textAnchor","dominantBaseline","fontSize","fontWeight","fontStyle","fontFamily","letterSpacing","titleFontWeight","color","fill","fillOpacity","opacity","stroke","strokeWidth","strokeDasharray","strokeColor","width","height","radius","radiusPadding","padding","layer","style","className","connector","disable","subject","bracketType","endCap","showBand","filter","method","steps","trainEnd","bandwidth","order","upperAccessor","lowerAccessor","confidenceAccessor","bandColor","bandOpacity","uncertaintyOpacity","anomalyColor","anomalyRadius","anomalyStyle","cohesion","depth","defensive","gradient"],Fc=/* @__PURE__ */new Set(Oc),jc=["xExtent","yExtent","rExtent"],Lc=/^(\d{4})-(\d{1,2})(?:-(\d{1,2}))?$/,zc=[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date-like",domain:!0},{role:"y",accessor:"yAccessor",defaultAccessor:"y",domain:!0}],Bc={fields:zc},Dc=[{...zc[0],nestedDataAccessorProp:"lineDataAccessor",defaultNestedDataAccessor:"coordinates"},{...zc[1],nestedDataAccessorProp:"lineDataAccessor",defaultNestedDataAccessor:"coordinates",allowMissing:!0}],_c={fields:Dc},Uc={role:"value",accessor:"valueAccessor",defaultAccessor:"value"},Gc={...Uc,domain:!0},Hc={fields:[{...Uc,requirements:["finite","non-negative"]}],aggregates:[{kind:"positive-total",role:"value"}]},Vc={fields:[Uc],aggregates:[{kind:"normalized-total",role:"value",groupAccessor:"categoryAccessor",defaultGroupAccessor:"category",whenProp:"normalize"}]},qc={fields:Dc,aggregates:[{kind:"normalized-total",role:"y",groupAccessor:"xAccessor",defaultGroupAccessor:"x",whenProp:"normalize"}]},Wc={fields:[...zc,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},Yc={fields:[...zc,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},Kc={fields:[Uc]},Jc={fields:[{...Uc,dataProp:"edges",requirements:["finite","non-negative"],missingValue:1}]},Xc={LineChart:_c,AreaChart:_c,BumpChart:_c,Scatterplot:Yc,ConnectedScatterplot:Bc,QuadrantChart:Yc,MinimapChart:_c,BubbleChart:Wc,StackedAreaChart:qc,DifferenceChart:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date",domain:!0},{role:"value",accessor:"seriesAAccessor",defaultAccessor:"a"},{role:"value",accessor:"seriesBAccessor",defaultAccessor:"b"}]},WaterfallChart:{fields:[{role:"y",accessor:"yAccessor",defaultAccessor:"y"}]},CandlestickChart:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date-like",domain:!0},{role:"high",accessor:"highAccessor",defaultAccessor:"high",requirements:["finite"]},{role:"low",accessor:"lowAccessor",defaultAccessor:"low",requirements:["finite"]},{role:"open",accessor:"openAccessor",whenProps:["openAccessor","closeAccessor"],requirements:["finite"]},{role:"close",accessor:"closeAccessor",whenProps:["openAccessor","closeAccessor"],requirements:["finite"]}]},Heatmap:Kc,BarChart:{fields:[Uc]},GroupedBarChart:{fields:[Uc]},StackedBarChart:Vc,DotPlot:{fields:[Gc]},Histogram:{fields:[Gc]},BoxPlot:{fields:[Gc]},SwarmPlot:{fields:[Gc,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},ViolinPlot:{fields:[Gc]},RidgelinePlot:{fields:[Gc]},PieChart:Hc,DonutChart:Hc,FunnelChart:Hc,SankeyDiagram:Jc,ChordDiagram:Jc,ProportionalSymbolMap:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"lon",dataProp:"points",requirements:["finite"]},{role:"y",accessor:"yAccessor",defaultAccessor:"lat",dataProp:"points",requirements:["finite"]},{role:"size",accessor:"sizeBy",dataProp:"points",requirements:["finite","non-negative"]}]}},Zc=/* @__PURE__ */Symbol.for("semiotic.numericContractRegistry"),Qc={xAccessor:"x",yAccessor:"y",valueAccessor:"value",sizeBy:"size",sizeAccessor:"size",radiusAccessor:"size",countAccessor:"count",amountAccessor:"value",highAccessor:"high",lowAccessor:"low",openAccessor:"open",closeAccessor:"close",lowerAccessor:"lower",upperAccessor:"upper",positiveAccessor:"value",negativeAccessor:"value",progressAccessor:"value",confidenceAccessor:"value",costAccessor:"value",throughputAccessor:"value"},eu=/* @__PURE__ */new Set(["category10","tableau10","set3","blues","reds","greens","oranges","purples","greys","viridis","plasma","inferno","magma","cividis","turbo"]),tu=["xAccessor","yAccessor","timeAccessor","valueAccessor","categoryAccessor","colorBy","sizeBy","lineBy","areaBy","stackBy","groupBy","orderAccessor","y0Accessor","sourceAccessor","targetAccessor","nodeIdAccessor","nodeIDAccessor","childrenAccessor","costAccessor"],ru=["title","description","summary"],au=/* @__PURE__ */new Set(["XYCustomChart","OrdinalCustomChart","NetworkCustomChart","GeoCustomChart","PhysicsCustomChart"]),iu=/* @__PURE__ */new Set([...au,"XYFrame","OrdinalFrame","NetworkFrame","GeoFrame"]),nu=/* @__PURE__ */new Set(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#f0e442","#000000"]),ou=/* @__PURE__ */Symbol.for("semiotic.chartRecipeRegistry"),su={pass:"✓",fail:"✗",warn:"⚠",manual:"○","not-applicable":"·"},lu=["perceivable","operable","understandable","robust","compromising","assistive","flexible"],cu={code:"SEMANTIC_DEGENERATE",severity:"error",message:"Marks painted, but the capability reported a semantically degenerate encoding.",fix:"Choose fields that support the chart's intended encoding."},uu={error:0,warning:1,manual:2},du={data:0,deception:1,accessibility:2,render:3},hu=/* @__PURE__ */new Set([...Ac,"RealtimeLineChart","RealtimeHeatmap"]),pu=/* @__PURE__ */Object.fromEntries(
11
+ /* @__PURE__ */ /* @__PURE__ */Object.entries(Ec).map(([e,t])=>[e,[t,"hoverRadius"]])),fu={pass:"PASS",warn:"WARN",manual:"MANUAL","not-applicable":"N/A"},mu=["layout","density","interaction","annotation","semantics"],gu=/* @__PURE__ */Symbol.for("semiotic.intentRegistry"),yu=/* @__PURE__ */new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),bu=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),vu=/* @__PURE__ */new Set(["PieChart","DonutChart","FunnelChart"]),wu=/* @__PURE__ */new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]),Au={LineChart:"line chart",AreaChart:"area chart",StackedAreaChart:"stacked area chart",DifferenceChart:"difference chart",Scatterplot:"scatter plot",BubbleChart:"bubble chart",ConnectedScatterplot:"connected scatter plot",QuadrantChart:"quadrant chart",MultiAxisLineChart:"dual-axis line chart",CandlestickChart:"candlestick chart",BumpChart:"bump chart",Heatmap:"heatmap",MinimapChart:"line chart",BarChart:"bar chart",StackedBarChart:"stacked bar chart",GroupedBarChart:"grouped bar chart",DotPlot:"dot plot",Histogram:"histogram",BoxPlot:"box plot",ViolinPlot:"violin plot",RidgelinePlot:"ridgeline plot",SwarmPlot:"swarm plot",PieChart:"pie chart",DonutChart:"donut chart",FunnelChart:"funnel chart",GaugeChart:"gauge",LikertChart:"Likert chart",SwimlaneChart:"swimlane chart",ForceDirectedGraph:"network graph",SankeyDiagram:"Sankey diagram",ProcessSankey:"temporal Sankey diagram",ChordDiagram:"chord diagram",TreeDiagram:"tree diagram",Treemap:"treemap",CirclePack:"circle-packing chart",OrbitDiagram:"orbit diagram",ChoroplethMap:"choropleth map",ProportionalSymbolMap:"proportional-symbol map",FlowMap:"flow map",DistanceCartogram:"distance cartogram",BigNumber:"single value",StreamPhysicsFrame:"physics stream frame",EventDropChart:"event-drop physics chart",GaltonBoardChart:"Galton board chart",UnitPileChart:"physics pile chart",CollisionSwarmChart:"collision swarm chart",PacketFlowChart:"physical flow chart",ProcessFlowChart:"process flow physics chart",CrucibleChart:"crucible physics chart",PhysicsCustomChart:"custom physics chart"},$u=/* @__PURE__ */new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),xu=/* @__PURE__ */new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),Cu=/* @__PURE__ */new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),Su={"outlier-detection":"alerting","change-detection":"alerting",trend:"tracking","composition-over-time":"apportioning","compare-series":"comparing","compare-categories":"comparing",rank:"ranking","part-to-whole":"apportioning",distribution:"characterizing",correlation:"relating",flow:"tracing",hierarchy:"nesting",geo:"locating"},ku={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},Ru=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],Pu={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"},Nu=/* @__PURE__ */new Set(["y-threshold","x-threshold","band","x-band","callout","label"]),Eu=/* @__PURE__ */new Set(["system","agent","watcher"]),Tu=/* @__PURE__ */new Set(["ai","agent","system","computed","dbt","great-expectations"]),Iu=/* @__PURE__ */new Set(["rule","statistical-test","llm-inference","computed"]),Mu={"y-threshold":"a threshold line","x-threshold":"a threshold line",band:"a highlighted band","x-band":"a highlighted band",label:"a label",callout:"a callout","callout-circle":"a callout","callout-rect":"a callout",text:"a text note",bracket:"a bracket",enclose:"an enclosure","rect-enclose":"an enclosure",highlight:"a highlight",widget:"a widget",trend:"a trend line",envelope:"an envelope","anomaly-band":"an anomaly band",forecast:"a forecast","category-highlight":"a category highlight"},Ou=/* @__PURE__ */new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),Fu=/* @__PURE__ */new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),ju=/* @__PURE__ */new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),Lu=/* @__PURE__ */new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),zu="__semioticSelectionData",Bu=/* @__PURE__ */new Set(["data","nodes","edges","points","areas","lines","flows","atlas","forest","circuit","edition","reading"]),Du=(e,t)=>(e>>>t|e<<32-t)>>>0,_u=e=>Math.floor(4294967296*(e-Math.floor(e)))>>>0,[Uu,Gu]=/* @__PURE__ */(()=>{let e=[],t=[];for(let r=2;t.length<64;r+=1){let a=!0;for(let e=2;e*e<=r;e+=1)if(r%e===0){a=!1;break}a&&(e.length<8&&e.push(_u(Math.sqrt(r))),t.push(_u(Math.cbrt(r))))}return[e,t]})(),Hu=/* @__PURE__ */Ro({"artifact.id":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.createdAt":{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"never"},"artifact.configFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.dataFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"purpose.intents":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.communicativeAct":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.stakes":{suppliedBy:["author","import"],derivable:!1,modelMayPropose:!0,humanReview:"required"},claims:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"claims.status":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},evidence:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.source":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.fingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},time:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"time.completeness":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},reception:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},form:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},contestability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"required"},accountability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"policy-dependent"},inheritance:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"}}),Vu=["fresh","stale","unknown"],qu=["partial","provisional","settled","unknown"],Wu=["observedAt","ingestedAt","processedAt","publishedAt","snapshotAt"],Yu={eventTime:{field:{},value:{},timezone:{},granularity:{}},presentation:{state:{values:["live","historical","mixed"]},label:{}},freshness:{status:{required:!0,values:Vu},checkedAt:{},heartbeatAt:{},expiresAt:{},basis:{}},watermark:{value:{required:!0},policy:{},allowedLateness:{}},window:{start:{required:!0},end:{required:!0},status:{required:!0,values:["open","provisional","settled","reopened","corrected"]}},completeness:{status:{required:!0,values:qu},basis:{}},revision:{status:{required:!0,values:["original","backfilled","corrected","superseded"]},previousArtifactId:{},correctionId:{},reason:{}},snapshot:{id:{},format:{values:["iceberg","delta","other"]},schemaVersion:{},catalogRef:{}}},Ku={id:{required:!0},kind:{required:!0,values:["stream","processing-job","quality-check","snapshot","publication"]},label:{},observedAt:{},version:{},timezone:{},granularity:{},freshness:{values:Vu},completeness:{values:qu}},Ju=/* @__PURE__ */new Set(["preserved","unsupported-version","invalid","excluded"]),Xu="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e)),Zu="1",Qu=/* @__PURE__ */new Set(["tooltip","onObservation","xFormat","yFormat","valueFormat","svgAnnotationRules","tooltipContent","onHover","tickFormatTime","tickFormatValue","edgeSort","sortGroups","centerContent","frameProps","controls","oFormat","rFormat","oSort","pieceStyle","summaryStyle","nodeStyle","edgeStyle","customHoverBehavior","customClickBehavior","customDoubleClickBehavior","onBrush","onTopologyChange","backgroundGraphics","foregroundGraphics","interactiveGraphics","legend","recipe","layout"]),ed="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e)),td={category10:"category10",category20:"category20",category20b:"category20",category20c:"category20",accent:"accent",dark2:"dark2",paired:"paired",pastel1:"pastel1",pastel2:"pastel2",set1:"set1",set2:"set2",set3:"set3",tableau10:"category10",tableau20:"category20"},rd={linear:"linear","monotone-x":"monotoneX","monotone-y":"monotoneY",monotone:"monotoneX",step:"step","step-after":"stepAfter","step-before":"stepBefore",basis:"basis",cardinal:"cardinal","catmull-rom":"catmullRom"},ad=class{constructor(e){if(this._capacity=e,this.head=0,this._size=0,e<1)throw new Error("RingBuffer capacity must be at least 1");this.buffer=new Array(e)}push(e){let t;return this._size===this._capacity?t=this.buffer[this.head]:this._size++,this.buffer[this.head]=e,this.head=(this.head+1)%this._capacity,t}pushMany(e){let t=[];for(let r of e){let e=this.push(r);void 0!==e&&t.push(e)}return t}get(e){if(e<0||e>=this._size)return;let t=(this.head-this._size+e+this._capacity)%this._capacity;return this.buffer[t]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let e=0;return{next:()=>e>=this._size?{done:!0,value:void 0}:{done:!1,value:this.get(e++)}}}forEach(e){let t=(this.head-this._size+this._capacity)%this._capacity;for(let r=0;r<this._size;r++)e(this.buffer[(t+r)%this._capacity],r)}toArray(){let e=new Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let r=0;r<this._size;r++)e[r]=this.buffer[(t+r)%this._capacity];return e}resize(e){if(e<1)throw new Error("RingBuffer capacity must be at least 1");let t=this.toArray(),r=0,a=[];t.length>e&&(r=t.length-e,a=t.slice(0,r)),this._capacity=e,this.buffer=new Array(e),this.head=0,this._size=0;for(let e=r;e<t.length;e++)this.push(t[e]);return a}update(e,t){let r=[],a=(this.head-this._size+this._capacity)%this._capacity;for(let i=0;i<this._size;i++){let n=(a+i)%this._capacity,o=this.buffer[n];if(e(o)){let e;e="object"!=typeof o||null===o?o:Array.isArray(o)?[...o]:{...o},r.push(e),this.buffer[n]=t(o)}}return r}remove(e){let t=[],r=[];if(this.forEach(a=>{e(a)?r.push(a):t.push(a)}),0===r.length)return r;this.buffer=new Array(this._capacity),this.head=0,this._size=0;for(let e of t)this.push(e);return r}clear(){this.buffer=new Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}},id=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(e){Number.isFinite(e)&&(e<this._min&&(this._min=e),e>this._max&&(this._max=e))}evict(e){(e===this._min||e===this._max)&&(this._dirty=!0)}recalculate(e,t){this._min=1/0,this._max=-1/0;for(let r of e){let e=t?t(r):r;Number.isFinite(e)&&(e<this._min&&(this._min=e),e>this._max&&(this._max=e))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}},nd=["name","label","title"],od=["type","kind","category","group","class","status","role","shape"],sd=["value","amount","total","count","weight","score"],ld=/* @__PURE__ */new Set(["x","y","z","x0","x1","y0","y1","r","cx","cy","radius","layer","row","rowindex","col","column","depth","index","order","sankeywidth","coincidentpoints","sourcelinks","targetlinks","parent","children","fx","fy","vx","vy"]);import*as cd from"react";import{jsx as ud}from"react/jsx-runtime";var dd={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, white)",padding:"8px 12px",borderRadius:"var(--semiotic-tooltip-radius, 6px)",fontSize:"var(--semiotic-tooltip-font-size, 14px)",fontFamily:"var(--semiotic-font-family, inherit)",lineHeight:"1.5",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.15))",pointerEvents:"none",maxWidth:"300px",wordWrap:"break-word"},hd=/* @__PURE__ */Symbol.for("semiotic.tooltipChromeContext"),pd=/* @__PURE__ */al(function({chrome:e,children:t}){let r=rl();/* */
12
+ return ud(r.Provider,{value:e,children:t})}),fd=/* @__PURE__ */al(function({chrome:e,className:t="",style:r,children:a,...i}){let n=cd.useContext(rl()),o="default"===(e??n??"default")?{...dd,...r}:r;/* */
13
+ return ud("div",{...i,"data-semiotic-tooltip-chrome":!0,className:`semiotic-tooltip ${t}`.trim(),style:o,children:a})});import{jsx as md,jsxs as gd}from"react/jsx-runtime";var yd=!1;export{Tl as AESTHETICS_OFF_PROFILE,kl as CARBON_ALERT,Sl as CARBON_CATEGORICAL_14,Al as COLOR_BLIND_SAFE_CATEGORICAL,xl as DARK_THEME,El as DEFAULT_AESTHETIC_PROFILE,Nl as DEFAULT_AESTHETIC_THRESHOLDS,Pl as DEFAULT_AESTHETIC_WEIGHTS,Cl as HIGH_CONTRAST_THEME,id as IncrementalExtent,$l as LIGHT_THEME,ul as MultiLineTooltip,ml as MultiPointTooltip,ad as RingBuffer,Rl as THEME_PRESETS,cl as Tooltip,fd as TooltipRoot,ta as accessibilityCaveats,Y as adaptiveTimeTicks,ea as auditAccessibility,er as auditData,Ea as auditMobileVisualization,Is as auditObservedScene,A as auditVisualHierarchy,gn as buildNavigationTree,Dn as buildReaderGrounding,di as communicativeActForIntent,d as composeStyleRules,wl as computeArcBoundingBox,cs as configToJSX,hs as configToJSXWithReport,ls as copyConfig,bn as countNodes,be as createHatchPattern,de as darkenColor,xi as describeChart,fs as deserializeSelections,Pr as diagnoseConfig,B as evaluateAesthetics,ha as evaluateChart,ms as exportChart,yn as flattenVisible,ra as formatAccessibilityAudit,Lt as formatDataAudit,da as formatEvaluateChart,Ta as formatMobileVisualizationAudit,ns as fromConfig,ss as fromURL,Vs as fromVegaLite,_n as getHitRadius,Hn as getSourceRows,nl as hasOwnTooltipChrome,tl as hasTooltipContent,$e as hatchFillId,Ae as hatchFillKey,Wn as histogramBinSelectionDatum,we as isHatchFill,dl as isMultiTooltip,he as lightenColor,o as makeNodeRuleContext,i as makeRuleValueResolver,h as makeStyleRuleStyleFn,n as makeXYRuleContext,al as markTooltipChrome,l as matchesThreshold,Ia as mobileVisualizationCaveats,gl as normalizeTooltip,jt as profileNumericFields,ue as resolveChartSize,mi as resolveCommunicativeAct,pl as resolveMultiCapableTooltip,J as resolveResponsiveDimension,re as resolveResponsiveRules,u as resolveStyleRules,e as resolveThemePreset,fl as resolveTooltipContent,ee as responsiveRuleMatches,c as ruleMatches,ps as serializeSelections,K as smartTickFormat,bl as sweepToAngles,r as themeToCSS,t as themeToCSSVariables,a as themeToTokens,es as toConfig,Bt as toDataAuditNotifications,pa as toEvaluateChartNotifications,os as toURL,He as unwrapDatum,Ue as validateProps,vl as valueToAngle};