semiotic 3.8.6 → 3.8.8

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 (302) hide show
  1. package/CLAUDE.md +34 -8
  2. package/README.md +93 -56
  3. package/ai/behaviorContracts.cjs +86 -1
  4. package/ai/componentMetadata.cjs +4 -9
  5. package/ai/dist/mcp-server.js +125 -12
  6. package/ai/examples.md +154 -7
  7. package/ai/schema.json +1742 -156
  8. package/ai/surface-manifest.json +12 -10
  9. package/ai/system-prompt.md +9 -3
  10. package/dist/{chunk-chartContainerDataAudit-FEOD5GTQ.module.min.js → chunk-chartContainerDataAudit-IQ3NBN3Q.module.min.js} +1 -1
  11. package/dist/chunk-chunk-2B3AIKUZ.module.min.js +2 -0
  12. package/dist/chunk-chunk-2NVFEB7P.module.min.js +2 -0
  13. package/dist/chunk-chunk-3GCILWPB.module.min.js +2 -0
  14. package/dist/chunk-chunk-46KRGJQP.module.min.js +1 -0
  15. package/dist/{chunk-chunk-G7WFWHAD.module.min.js → chunk-chunk-4ITOQRXM.module.min.js} +1 -1
  16. package/dist/chunk-chunk-4MLLQUGW.module.min.js +2 -0
  17. package/dist/chunk-chunk-57RBPDBQ.module.min.js +2 -0
  18. package/dist/chunk-chunk-5VVNW5AZ.module.min.js +1 -0
  19. package/dist/chunk-chunk-66PCWJUG.module.min.js +1 -0
  20. package/dist/chunk-chunk-6V5VQVCT.module.min.js +2 -0
  21. package/dist/chunk-chunk-7LE56WAE.module.min.js +2 -0
  22. package/dist/chunk-chunk-7T25U75Z.module.min.js +2 -0
  23. package/dist/chunk-chunk-AF53TBSN.module.min.js +2 -0
  24. package/dist/chunk-chunk-BTZYH2IE.module.min.js +1 -0
  25. package/dist/chunk-chunk-BWV55BZK.module.min.js +2 -0
  26. package/dist/chunk-chunk-BZNOAHJV.module.min.js +2 -0
  27. package/dist/chunk-chunk-CD6PVVS3.module.min.js +2 -0
  28. package/dist/chunk-chunk-DTSNLGRK.module.min.js +2 -0
  29. package/dist/chunk-chunk-FC3NZWYR.module.min.js +2 -0
  30. package/dist/chunk-chunk-FEPXDKJP.module.min.js +1 -0
  31. package/dist/chunk-chunk-FJ76HWQZ.module.min.js +1 -0
  32. package/dist/chunk-chunk-FQPKOAIH.module.min.js +2 -0
  33. package/dist/chunk-chunk-FRGBMTZR.module.min.js +1 -0
  34. package/dist/chunk-chunk-G75OPF5N.module.min.js +2 -0
  35. package/dist/chunk-chunk-H5IFO6CU.module.min.js +2 -0
  36. package/dist/chunk-chunk-HADHLMY5.module.min.js +1 -0
  37. package/dist/chunk-chunk-HBFA4NN6.module.min.js +1 -0
  38. package/dist/chunk-chunk-HCNDE26Q.module.min.js +2 -0
  39. package/dist/chunk-chunk-J5QD4RAM.module.min.js +2 -0
  40. package/dist/chunk-chunk-JJ4BSUYL.module.min.js +2 -0
  41. package/dist/chunk-chunk-JRHXQGEV.module.min.js +2 -0
  42. package/dist/chunk-chunk-L6FFYGYS.module.min.js +1 -0
  43. package/dist/chunk-chunk-LJDH3WV3.module.min.js +2 -0
  44. package/dist/chunk-chunk-LSJUXBMF.module.min.js +1 -0
  45. package/dist/chunk-chunk-N3Q33XCB.module.min.js +2 -0
  46. package/dist/chunk-chunk-NWIGA3UK.module.min.js +1 -0
  47. package/dist/chunk-chunk-OG3TTJGJ.module.min.js +2 -0
  48. package/dist/{chunk-chunk-XEVJDUTH.module.min.js → chunk-chunk-OZK46A5U.module.min.js} +1 -1
  49. package/dist/chunk-chunk-PMR47KRY.module.min.js +2 -0
  50. package/dist/chunk-chunk-QQJNG23C.module.min.js +2 -0
  51. package/dist/chunk-chunk-RGJ6TKAH.module.min.js +2 -0
  52. package/dist/{chunk-chunk-RA7JCG7D.module.min.js → chunk-chunk-SFLUSZ73.module.min.js} +1 -1
  53. package/dist/chunk-chunk-SV4XAZ3Q.module.min.js +1 -0
  54. package/dist/chunk-chunk-TCMHJWFJ.module.min.js +1 -0
  55. package/dist/chunk-chunk-TSCFL235.module.min.js +1 -0
  56. package/dist/{chunk-chunk-XP3OHHFX.module.min.js → chunk-chunk-UEZ6SHW5.module.min.js} +1 -1
  57. package/dist/chunk-chunk-UOQRPGPK.module.min.js +2 -0
  58. package/dist/chunk-chunk-VUWYT7DY.module.min.js +2 -0
  59. package/dist/{chunk-chunk-GFTVACTO.module.min.js → chunk-chunk-W5HWGQMD.module.min.js} +1 -1
  60. package/dist/chunk-chunk-WFHZHWT7.module.min.js +1 -0
  61. package/dist/chunk-chunk-WGROBM3I.module.min.js +2 -0
  62. package/dist/chunk-chunk-WSDJFBKX.module.min.js +2 -0
  63. package/dist/chunk-statisticalOverlays-HMYYSGPE.module.min.js +2 -0
  64. package/dist/components/ai/SemioticVACPBridge.d.ts +22 -0
  65. package/dist/components/ai/chartCapabilities.d.ts +4 -3
  66. package/dist/components/ai/conversationArc.d.ts +2 -176
  67. package/dist/components/ai/conversationArcTypes.d.ts +202 -0
  68. package/dist/components/ai/readerGrounding.d.ts +12 -0
  69. package/dist/components/ai/vacpAdapter.d.ts +13 -0
  70. package/dist/components/ai/vacpAdapterActions.d.ts +2 -0
  71. package/dist/components/ai/vacpAdapterModel.d.ts +7 -0
  72. package/dist/components/ai/vacpAdapterRuntime.d.ts +26 -0
  73. package/dist/components/ai/vacpAdapterState.d.ts +3 -0
  74. package/dist/components/ai/vacpAdapterTypes.d.ts +169 -0
  75. package/dist/components/ai/vacpTypes.d.ts +160 -0
  76. package/dist/components/charts/index.d.ts +6 -6
  77. package/dist/components/charts/network/ProcessSankey.d.ts +105 -74
  78. package/dist/components/charts/network/processSankey/accessors.d.ts +7 -0
  79. package/dist/components/charts/network/processSankey/algorithm.d.ts +14 -193
  80. package/dist/components/charts/network/processSankey/axisChrome.d.ts +31 -0
  81. package/dist/components/charts/network/processSankey/bandPaths.d.ts +45 -0
  82. package/dist/components/charts/network/processSankey/buildScenes.d.ts +41 -3
  83. package/dist/components/charts/network/processSankey/fixtures.d.ts +17 -0
  84. package/dist/components/charts/network/processSankey/frameMargins.d.ts +11 -0
  85. package/dist/components/charts/network/processSankey/groupBonding.d.ts +13 -0
  86. package/dist/components/charts/network/processSankey/inventoryAtTime.d.ts +41 -0
  87. package/dist/components/charts/network/processSankey/labelPlacement.d.ts +34 -0
  88. package/dist/components/charts/network/processSankey/layoutGeometry.d.ts +47 -0
  89. package/dist/components/charts/network/processSankey/layoutOrchestrator.d.ts +44 -0
  90. package/dist/components/charts/network/processSankey/layoutQualityProduct.d.ts +27 -0
  91. package/dist/components/charts/network/processSankey/massSimulation.d.ts +16 -0
  92. package/dist/components/charts/network/processSankey/ordering.d.ts +55 -0
  93. package/dist/components/charts/network/processSankey/orderingBond.d.ts +33 -0
  94. package/dist/components/charts/network/processSankey/orientation.d.ts +5 -0
  95. package/dist/components/charts/network/processSankey/packing.d.ts +8 -0
  96. package/dist/components/charts/network/processSankey/packingCache.d.ts +23 -0
  97. package/dist/components/charts/network/processSankey/processSankeyLayoutAsync.d.ts +27 -0
  98. package/dist/components/charts/network/processSankey/processSankeyLayoutWorkerClient.d.ts +72 -0
  99. package/dist/components/charts/network/processSankey/processSankeyTooltip.d.ts +26 -0
  100. package/dist/components/charts/network/processSankey/processSankeyTypes.d.ts +163 -0
  101. package/dist/components/charts/network/processSankey/ribbonInputs.d.ts +26 -2
  102. package/dist/components/charts/network/processSankey/ribbonRunway.d.ts +45 -0
  103. package/dist/components/charts/network/processSankey/streamingLayout.d.ts +23 -0
  104. package/dist/components/charts/network/processSankey/time.d.ts +11 -0
  105. package/dist/components/charts/network/processSankey/useProcessSankeyPush.d.ts +29 -0
  106. package/dist/components/charts/network/processSankey/useProcessSankeyScenes.d.ts +26 -0
  107. package/dist/components/charts/network/processSankey/validation.d.ts +33 -0
  108. package/dist/components/charts/physics/ChainReactionChart.capability.d.ts +9 -0
  109. package/dist/components/charts/physics/ChainReactionChart.d.ts +29 -0
  110. package/dist/components/charts/physics/CollisionSwarmChart.d.ts +1 -1
  111. package/dist/components/charts/physics/EventDropChart.d.ts +7 -2
  112. package/dist/components/charts/physics/GaltonBoardChart.d.ts +1 -1
  113. package/dist/components/charts/physics/{PhysicsPileChart.capability.d.ts → PacketFlowChart.capability.d.ts} +1 -1
  114. package/dist/components/charts/physics/{PhysicalFlowChart.d.ts → PacketFlowChart.d.ts} +22 -6
  115. package/dist/components/charts/physics/PhysicsCustomChart.d.ts +1 -1
  116. package/dist/components/charts/physics/ProcessFlowChart.d.ts +7 -4
  117. package/dist/components/charts/physics/{PhysicalFlowChart.capability.d.ts → UnitPileChart.capability.d.ts} +1 -1
  118. package/dist/components/charts/physics/{PhysicsPileChart.d.ts → UnitPileChart.d.ts} +19 -6
  119. package/dist/components/charts/physics/crucibleChartProps.d.ts +1 -1
  120. package/dist/components/charts/physics/crucibleChartUtils.d.ts +9 -0
  121. package/dist/components/charts/physics/gauntletChartProps.d.ts +6 -1
  122. package/dist/components/charts/physics/gauntletTerminal.d.ts +61 -0
  123. package/dist/components/charts/physics/packetFlowSemantics.d.ts +6 -0
  124. package/dist/components/charts/physics/physicsHocUtils.d.ts +45 -2
  125. package/dist/components/charts/shared/auditAccessibilityStyles.d.ts +9 -0
  126. package/dist/components/charts/shared/chartFamilySets.d.ts +1 -0
  127. package/dist/components/charts/shared/formatUtils.d.ts +12 -1
  128. package/dist/components/charts/shared/hatchFill.d.ts +2 -0
  129. package/dist/components/charts/shared/hooks.d.ts +1 -1
  130. package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
  131. package/dist/components/charts/shared/leastSquaresRegression.d.ts +31 -0
  132. package/dist/components/charts/shared/styleRules.d.ts +5 -1
  133. package/dist/components/charts/shared/useChartLegend.d.ts +14 -1
  134. package/dist/components/charts/shared/useChartSetup.d.ts +8 -1
  135. package/dist/components/charts/shared/validateProps.d.ts +2 -2
  136. package/dist/components/charts/shared/withChartWrapper.d.ts +0 -6
  137. package/dist/components/data/numericFieldProfiler.d.ts +2 -0
  138. package/dist/components/data/portability/capabilityBinding.d.ts +41 -0
  139. package/dist/components/data/portability/index.d.ts +2 -0
  140. package/dist/components/legendLayout.d.ts +56 -0
  141. package/dist/components/recipes/geographicDotGrid.d.ts +82 -0
  142. package/dist/components/recipes/geographicGrid.d.ts +100 -0
  143. package/dist/components/recipes/layout1d.d.ts +68 -0
  144. package/dist/components/recipes/physics.d.ts +2 -0
  145. package/dist/components/recipes/physicsStageGeography.d.ts +137 -0
  146. package/dist/components/semiotic-ai.d.ts +4 -3
  147. package/dist/components/semiotic-experimental-vacp.d.ts +11 -0
  148. package/dist/components/semiotic-experimental.d.ts +6 -3
  149. package/dist/components/semiotic-geo.d.ts +4 -0
  150. package/dist/components/semiotic-network.d.ts +2 -2
  151. package/dist/components/semiotic-physics.d.ts +9 -6
  152. package/dist/components/semiotic-recipes-core.d.ts +8 -1
  153. package/dist/components/semiotic.d.ts +2 -0
  154. package/dist/components/server/renderEvidence.d.ts +1 -1
  155. package/dist/components/server/renderToStaticSVG.d.ts +2 -1
  156. package/dist/components/server/serverChartConfigHeatmap.d.ts +6 -0
  157. package/dist/components/server/serverChartConfigNetworkStyles.d.ts +12 -0
  158. package/dist/components/server/serverChartConfigShared.d.ts +16 -0
  159. package/dist/components/server/serverChartConfigs.d.ts +2 -2
  160. package/dist/components/server/serverChartConfigsPhysics.d.ts +2 -2
  161. package/dist/components/server/serverChartConfigsXY.d.ts +0 -1
  162. package/dist/components/server/staticLegend.d.ts +6 -0
  163. package/dist/components/server/staticSVGChrome.d.ts +12 -3
  164. package/dist/components/server/staticValue.d.ts +8 -0
  165. package/dist/components/store/createStore.d.ts +2 -0
  166. package/dist/components/stream/OrdinalPipelineStore.d.ts +3 -0
  167. package/dist/components/stream/PipelineStore.d.ts +5 -0
  168. package/dist/components/stream/accessorUtils.d.ts +21 -0
  169. package/dist/components/stream/frameKeyboardNavigation.d.ts +3 -2
  170. package/dist/components/stream/geoPipelineConfig.d.ts +10 -0
  171. package/dist/components/stream/layouts/forceLayoutWorkerClient.d.ts +3 -8
  172. package/dist/components/stream/layouts/index.d.ts +1 -1
  173. package/dist/components/stream/legendRenderer.d.ts +8 -0
  174. package/dist/components/stream/moduleWorkerSession.d.ts +67 -0
  175. package/dist/components/stream/networkTypes.d.ts +2 -0
  176. package/dist/components/stream/ordinalSceneBuilders/sceneBuilderMap.d.ts +2 -1
  177. package/dist/components/stream/physics/PhysicsEvidence.d.ts +37 -0
  178. package/dist/components/stream/physics/PhysicsKernel.d.ts +9 -0
  179. package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +9 -0
  180. package/dist/components/stream/physics/PhysicsSettledScene.d.ts +5 -0
  181. package/dist/components/stream/physics/physicsFramePipelineConfig.d.ts +19 -0
  182. package/dist/components/stream/physics/physicsPipelineSettle.d.ts +52 -0
  183. package/dist/components/stream/physics/physicsRegionRuntime.d.ts +23 -0
  184. package/dist/components/stream/pipelineIntroCancellation.d.ts +6 -0
  185. package/dist/components/stream/pipelineTransitions.d.ts +15 -1
  186. package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +16 -4
  187. package/dist/components/stream/renderers/symbolCanvasRenderer.d.ts +4 -0
  188. package/dist/components/stream/symbolPath.d.ts +8 -0
  189. package/dist/components/stream/types.d.ts +4 -0
  190. package/dist/components/stream/useCanvasFrameHost.d.ts +6 -0
  191. package/dist/components/stream/useSemanticFrameInteractions.d.ts +12 -3
  192. package/dist/components/stream/xyFrameAxisTypes.d.ts +4 -0
  193. package/dist/components/types/legendTypes.d.ts +17 -1
  194. package/dist/controls.min.js +1 -1
  195. package/dist/controls.module.min.js +1 -1
  196. package/dist/forceLayoutWorker.js +1 -1
  197. package/dist/geo.min.js +1 -1
  198. package/dist/geo.module.min.js +1 -1
  199. package/dist/network.min.js +1 -1
  200. package/dist/network.module.min.js +1 -1
  201. package/dist/ordinal.min.js +1 -1
  202. package/dist/ordinal.module.min.js +1 -1
  203. package/dist/physics.min.js +1 -1
  204. package/dist/physics.module.min.js +1 -1
  205. package/dist/physicsWorker.js +1 -1
  206. package/dist/processSankeyLayoutWorker.js +1 -0
  207. package/dist/realtime.min.js +1 -1
  208. package/dist/realtime.module.min.js +1 -1
  209. package/dist/semiotic-ai-core.min.js +1 -1
  210. package/dist/semiotic-ai-core.module.min.js +1 -1
  211. package/dist/semiotic-ai.d.ts +4 -3
  212. package/dist/semiotic-ai.min.js +1 -1
  213. package/dist/semiotic-ai.module.min.js +1 -1
  214. package/dist/semiotic-data.module.min.js +1 -1
  215. package/dist/semiotic-experimental-vacp.d.ts +11 -0
  216. package/dist/semiotic-experimental-vacp.min.js +1 -0
  217. package/dist/semiotic-experimental-vacp.module.min.js +1 -0
  218. package/dist/semiotic-experimental.d.ts +6 -3
  219. package/dist/semiotic-experimental.min.js +2 -1
  220. package/dist/semiotic-experimental.module.min.js +2 -1
  221. package/dist/semiotic-geo.d.ts +4 -0
  222. package/dist/semiotic-network.d.ts +2 -2
  223. package/dist/semiotic-physics.d.ts +9 -6
  224. package/dist/semiotic-realtime-core.min.js +1 -1
  225. package/dist/semiotic-realtime-core.module.min.js +1 -1
  226. package/dist/semiotic-recipes-core.d.ts +8 -1
  227. package/dist/semiotic-recipes-core.min.js +1 -1
  228. package/dist/semiotic-recipes-core.module.min.js +1 -1
  229. package/dist/semiotic-recipes.min.js +1 -1
  230. package/dist/semiotic-recipes.module.min.js +1 -1
  231. package/dist/semiotic-server-edge.min.js +1 -1
  232. package/dist/semiotic-server-edge.module.min.js +1 -1
  233. package/dist/semiotic-server-node.min.js +1 -1
  234. package/dist/semiotic-server-node.module.min.js +1 -1
  235. package/dist/semiotic-themes-core.module.min.js +1 -1
  236. package/dist/semiotic-themes-react.module.min.js +1 -1
  237. package/dist/semiotic-themes.module.min.js +1 -1
  238. package/dist/semiotic-utils-core.min.js +1 -1
  239. package/dist/semiotic-utils-core.module.min.js +1 -1
  240. package/dist/semiotic-utils-react.module.min.js +1 -1
  241. package/dist/semiotic-utils.min.js +1 -1
  242. package/dist/semiotic-utils.module.min.js +1 -1
  243. package/dist/semiotic-value.min.js +1 -1
  244. package/dist/semiotic-value.module.min.js +1 -1
  245. package/dist/semiotic.d.ts +2 -0
  246. package/dist/semiotic.min.js +1 -1
  247. package/dist/semiotic.module.min.js +1 -1
  248. package/dist/server.min.js +1 -1
  249. package/dist/server.module.min.js +1 -1
  250. package/dist/xy.min.js +1 -1
  251. package/dist/xy.module.min.js +1 -1
  252. package/package.json +21 -4
  253. package/spec/README.md +94 -2
  254. package/spec/bindings/README.md +14 -3
  255. package/spec/v0.1/examples/annotation-provenance-reviewed-revision.json +27 -0
  256. package/spec/v0.1/examples/annotation-provenance-watcher-threshold.json +21 -0
  257. package/spec/v0.1/examples/audience-profile-executive-review.json +24 -0
  258. package/spec/v0.1/examples/audience-profile-incident-operators.json +42 -0
  259. package/spec/v0.1/examples/chart-capability-bar-comparison.json +48 -0
  260. package/spec/v0.1/examples/chart-capability-service-flow.json +54 -0
  261. package/dist/chunk-chunk-2CHN2TA3.module.min.js +0 -1
  262. package/dist/chunk-chunk-3NGIKFD6.module.min.js +0 -1
  263. package/dist/chunk-chunk-3SHB24AG.module.min.js +0 -1
  264. package/dist/chunk-chunk-4MMOOYTX.module.min.js +0 -2
  265. package/dist/chunk-chunk-5RKXZQ2P.module.min.js +0 -1
  266. package/dist/chunk-chunk-75OTQSXS.module.min.js +0 -1
  267. package/dist/chunk-chunk-7ALTGHK6.module.min.js +0 -1
  268. package/dist/chunk-chunk-A5GRQUOF.module.min.js +0 -1
  269. package/dist/chunk-chunk-AAF5LZAU.module.min.js +0 -2
  270. package/dist/chunk-chunk-ARZGA4LJ.module.min.js +0 -2
  271. package/dist/chunk-chunk-C4YA6TDR.module.min.js +0 -1
  272. package/dist/chunk-chunk-CAFLML4L.module.min.js +0 -2
  273. package/dist/chunk-chunk-CO5KQMGH.module.min.js +0 -1
  274. package/dist/chunk-chunk-DSNGDNJY.module.min.js +0 -1
  275. package/dist/chunk-chunk-FHBN7OEB.module.min.js +0 -2
  276. package/dist/chunk-chunk-GMQ5AYTD.module.min.js +0 -1
  277. package/dist/chunk-chunk-IP2UE74X.module.min.js +0 -1
  278. package/dist/chunk-chunk-ITDWLZXV.module.min.js +0 -2
  279. package/dist/chunk-chunk-JCG72SGW.module.min.js +0 -2
  280. package/dist/chunk-chunk-LPSPATPC.module.min.js +0 -1
  281. package/dist/chunk-chunk-OM6NWS4H.module.min.js +0 -2
  282. package/dist/chunk-chunk-PRDGLMJT.module.min.js +0 -2
  283. package/dist/chunk-chunk-PX5YQGDP.module.min.js +0 -2
  284. package/dist/chunk-chunk-Q2BS46W2.module.min.js +0 -2
  285. package/dist/chunk-chunk-QSQVBIJA.module.min.js +0 -1
  286. package/dist/chunk-chunk-RCF52Z42.module.min.js +0 -2
  287. package/dist/chunk-chunk-RNUHEXZA.module.min.js +0 -2
  288. package/dist/chunk-chunk-ROZWKEUG.module.min.js +0 -1
  289. package/dist/chunk-chunk-SMVD3EQJ.module.min.js +0 -2
  290. package/dist/chunk-chunk-T2FKJD4O.module.min.js +0 -2
  291. package/dist/chunk-chunk-UDREYOLV.module.min.js +0 -1
  292. package/dist/chunk-chunk-VOWE3SAP.module.min.js +0 -2
  293. package/dist/chunk-chunk-VQPNBUSW.module.min.js +0 -2
  294. package/dist/chunk-chunk-WAWCIHFJ.module.min.js +0 -1
  295. package/dist/chunk-chunk-WCX6U47H.module.min.js +0 -2
  296. package/dist/chunk-chunk-WYARAXHR.module.min.js +0 -2
  297. package/dist/chunk-chunk-XV3KGYTR.module.min.js +0 -2
  298. package/dist/chunk-chunk-YC2IVEPX.module.min.js +0 -1
  299. package/dist/chunk-chunk-ZOAQDIJO.module.min.js +0 -1
  300. package/dist/chunk-chunk-ZXIXAPRE.module.min.js +0 -2
  301. package/dist/chunk-statisticalOverlays-6MVAK5RW.module.min.js +0 -2
  302. package/dist/components/stream/renderers/networkSymbolRenderer.d.ts +0 -2
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{buildNavGraph as t,extractGeoNavPoints as e,extractOrdinalNavPoints as r,extractXYNavPoints as n,navPointToHover as i,nextGraphIndex as s,nextIndex as o,renderCirclePulse as c,resolvePosition as u}from"./chunk-chunk-H5IFO6CU.module.min.js";import{emitClickObservations as a,emitHoverObservations as l,isInteractiveKeyboardTarget as f,resolveCanvasFill as h}from"./chunk-chunk-HCNDE26Q.module.min.js";var p=class{constructor(t){if(this._capacity=t,this.head=0,this._size=0,1>t)throw Error("RingBuffer capacity must be at least 1");this.buffer=Array(t)}push(t){let e;return this._size===this._capacity?e=this.buffer[this.head]:this._size++,this.buffer[this.head]=t,this.head=(this.head+1)%this._capacity,e}pushMany(t){const e=[];for(const r of t){const t=this.push(r);void 0!==t&&e.push(t)}return e}get(t){if(t>=0&&this._size>t)return this.buffer[(this.head-this._size+t+this._capacity)%this._capacity]}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 t=0;return{next:()=>this._size>t?{done:!1,value:this.get(t++)}:{done:!0,value:void 0}}}forEach(t){const e=(this.head-this._size+this._capacity)%this._capacity;for(let r=0;this._size>r;r++)t(this.buffer[(e+r)%this._capacity],r)}toArray(){const t=Array(this._size),e=(this.head-this._size+this._capacity)%this._capacity;for(let r=0;this._size>r;r++)t[r]=this.buffer[(e+r)%this._capacity];return t}resize(t){if(1>t)throw Error("RingBuffer capacity must be at least 1");const e=this.toArray();let r=0,n=[];e.length>t&&(r=e.length-t,n=e.slice(0,r)),this._capacity=t,this.buffer=Array(t),this.head=0,this._size=0;for(let t=r;e.length>t;t++)this.push(e[t]);return n}update(t,e){const r=[],n=(this.head-this._size+this._capacity)%this._capacity;for(let i=0;this._size>i;i++){const s=(n+i)%this._capacity,o=this.buffer[s];if(t(o)){let t;t="object"!=typeof o||null===o?o:Array.isArray(o)?[...o]:{...o},r.push(t),this.buffer[s]=e(o)}}return r}remove(t){const e=[],r=[];if(this.forEach(n=>{t(n)?r.push(n):e.push(n)}),0===r.length)return r;this.buffer=Array(this._capacity),this.head=0,this._size=0;for(const t of e)this.push(t);return r}clear(){this.buffer=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}};function y(t,e,r,n){return"function"==typeof e.style?e.style(n||{},r):e.style&&"object"==typeof e.style?e.style:t.resolveBoundsStyle(r,n)}function d(t,e,r,n){if(!t.scales)return null;const i=[],s=[];for(const r of e){const e=t.getX(r);if(!Number.isFinite(e))continue;const o=n.getTop(r),c=n.getBottom(r);if(!Number.isFinite(o)||!Number.isFinite(c))continue;const u=t.scales.x(e),a=t.scales.y(o),l=t.scales.y(c);Number.isFinite(u)&&Number.isFinite(a)&&Number.isFinite(l)&&(i.push([u,a]),s.push([u,l]))}return 2>i.length?null:{type:"area",topPath:i,bottomPath:s,...t.config.curve&&"linear"!==t.config.curve&&{curve:t.config.curve},style:y(t,n,r,e[0]),datum:e,group:r,interactive:n.interactive}}function v(t){const e=[],r=[];if(!t)return{perSeries:e,aggregate:r};for(const n of t)n.perSeries?e.push(n):r.push(n);return{perSeries:e,aggregate:r}}function _(t,e,r){const n=[];for(const i of r){const r=d(t,e,"__ribbon_aggregate",i);r&&n.push(r)}return n}function g(t,e,r,n){const i=[];for(const s of n){const n=d(t,e,r,s);n&&i.push(n)}return i}function m(t,e){if(!t)return{};if(!e||0===e.length)return t;const r=[];for(const n of e){if("band"!==n.kind)continue;const e=n.getTop(t),i=n.getBottom(t);Number.isFinite(i)&&Number.isFinite(e)&&r.push({y0:i,y1:e})}return 0===r.length?t:{...t,band:r[0],bands:r}}function b(t,e,r,n){const i=n.current,s=!0===t.lastCustomLayoutFailure?.preservedLastGoodScene,o=!s&&t.hasActivePulsesAt(e),c=!(r||s||!o&&!i)&&t.refreshPulse(e);return n.current=o,{changed:c,pending:o}}import{useCallback as k,useRef as z}from"react";function A(t,e,r,n){const i=z({accessor:e,onChange:r,readData:n}),s=z([]);return i.current={accessor:e,onChange:r,readData:n},k(()=>{const{accessor:e,onChange:r,readData:n}=i.current;if(!r||!e)return;const o=function(t,e){if(!e)return[];const r=new Set,n=[];for(const i of t){if(!i||"object"!=typeof i)continue;const t="function"==typeof e?e(i):i[e];if(null==t)continue;const s=t+"";r.has(s)||(r.add(s),n.push(s))}return n}(t.current?n(t.current):[],e);(function(t,e){if(t.length!==e.length)return!1;for(let r=0;t.length>r;r++)if(t[r]!==e[r])return!1;return!0})(o,s.current)||(s.current=o,r(o))},[t])}var w=(t,e,r,n)=>{const i=e.filter(t=>"point"===t.type);if(0!==i.length){t.save();try{const e=t.globalAlpha;for(const r of i)t.beginPath(),t.arc(r.x,r.y,r.r,0,2*Math.PI),t.globalAlpha=e*(r.style.opacity??r.style.fillOpacity??1),t.fillStyle=h(t,r.style.fill,"#4e79a7"),t.fill(),r.style.stroke&&"none"!==r.style.stroke&&(t.strokeStyle=h(t,r.style.stroke,r.style.stroke),t.lineWidth=r.style.strokeWidth||1,t.stroke()),c(t,r)}finally{t.restore()}}};import{useCallback as R}from"react";function x({customHoverBehavior:t,customClickBehavior:e,onObservation:r,chartId:n,chartType:i}){const s=!(!t&&!r),o=!(!e&&!r),c=R((e,s)=>{t?.(e,s),l({onObservation:r,datum:e?e.data||e:null,x:e?.x,y:e?.y,chartType:i,chartId:n,context:s})},[n,i,t,r]),u=R((t,s)=>{e?.(t,s),a({onObservation:r,datum:t?t.data||t:null,x:t?.x,y:t?.y,chartType:i,chartId:n,context:s})},[n,i,e,r]);return{customHoverBehavior:s?c:void 0,customClickBehavior:o?u:void 0,hasClickBehavior:o}}import{useCallback as C,useRef as D}from"react";function P({storeRef:e,hoverRef:r,hoveredNodeRef:n,setHoverPoint:i,customHoverBehavior:o,customClickBehavior:c,scheduleRender:a,extractPoints:l,toHover:h}){const p=D(-1),y=D(null),d=D(null),v=C(v=>{if(f(v))return;const _=e.current;if(!_)return;const g=()=>{p.current=-1,y.current=null,r.current=null,n&&(n.current=null),i(null),o?.(null),a()};if(0===_.scene.length)return void(0>p.current||g());let m;if(d.current?.version===_.version)m=d.current.graph;else{const e=l(_.scene);if(0===e.length)return void(0>p.current||g());m=t(e),d.current={version:_.version,graph:m}}let b=p.current;if(m.flat.length>b||(g(),b=-1),("Enter"===v.key||" "===v.key)&&b>=0)return v.preventDefault(),void c?.(h(m.flat[b],_),{type:"activate",inputType:"keyboard"});if(0>b){if("Escape"===v.key)return;if(!["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(v.key))return;v.preventDefault(),p.current=0;const t=m.flat[0];y.current=t;const e=h(t,_);return r.current=e,i(e),o?.(e,{type:"focus",inputType:"keyboard"}),void a()}const k=s(v.key,u(m,b),m);if(null===k)return;if(v.preventDefault(),0>k)return void g();p.current=k;const z=m.flat[k];y.current=z;const A=h(z,_);r.current=A,i(A),o?.(A,{type:"focus",inputType:"keyboard"}),a()},[c,o,l,r,n,a,i,e,h]);return{kbFocusIndexRef:p,focusedNavPointRef:y,onKeyDown:v}}function B(t){return P({...t,extractPoints:n,toHover:(t,e)=>i({...t,datum:m(t.datum,e.resolvedRibbons)})})}function H({chartType:t,oAccessor:e,rAccessor:n,...s}){return P({...s,extractPoints:r,toHover:r=>({...i(r),__oAccessor:"string"==typeof e?e:void 0,__rAccessor:"string"==typeof n?n:void 0,__chartType:t})})}function N(t){const e=t.datum;return{...e||{},...e?.properties||{},data:e,properties:e?.properties,x:t.x,y:t.y,__semioticHoverData:!0}}function F({storeRef:t,hoverRef:r,hoveredNodeRef:n,setHoverPoint:i,customHoverBehavior:s,customClickBehavior:c,scheduleRender:u}){const a=D(-1),l=D(null),h=C(h=>{if(f(h))return;const p=t.current;if(!p)return;const y=()=>{a.current=-1,l.current=null,r.current=null,n&&(n.current=null),i(null),s?.(null),u()};if(0===p.scene.length)return void(0>a.current||y());const d=e(p.scene);if(0===d.length)return void(0>a.current||y());let v=a.current;if(d.length>v||(y(),v=-1),("Enter"===h.key||" "===h.key)&&v>=0)return h.preventDefault(),void c?.(N(d[v]),{type:"activate",inputType:"keyboard"});const _=o(h.key,0>v?-1:v,d.length);if(null===_)return;if(h.preventDefault(),0>_)return void y();const g=0>v?0:_;a.current=g;const m=d[g];l.current=m;const b=N(m);r.current=b,i(b),s?.(b,{type:"focus",inputType:"keyboard"}),u()},[c,s,r,n,u,i,t]);return{kbFocusIndexRef:a,focusedNavPointRef:l,onKeyDown:h}}function T(t,e,r){const n=t.duration??500,i=r-e;return n>i?1-i/n:0}function E(t,e,r,n,i,s=("undefined"!=typeof performance?performance.now():Date.now())){const o=t.color??"rgba(255,255,255,0.6)",c=t.glowRadius??4;let u=!1;const a=i??(()=>{const t=new Map;for(let e=0;r.length>e;e++)t.set(r[e],e);return t})();for(const r of e){if("line"===r.type)continue;if("area"===r.type){const e=Array.isArray(r.datum)?r.datum:[r.datum];let i=0,c=!1;for(const r of e){const e=a.get(r);if(null==e)continue;c=!0;const o=n.get(e);if(null==o)continue;const u=T(t,o,s);u>i&&(i=u)}c&&(u=I(r,i,o)||u);continue}const e=a.get(r.datum);if(null==e)continue;const i=n.get(e);u=I(r,null==i?0:T(t,i,s),o,c)||u}return u}function I(t,e,r,n){let i=!1;return e>0?(t._pulseIntensity!==e&&(t._pulseIntensity=e,i=!0),t._pulseColor!==r&&(t._pulseColor=r,i=!0),t._pulseGlowRadius!==n&&(t._pulseGlowRadius=n,i=!0),i):(0!==t._pulseIntensity&&(t._pulseIntensity=0,i=!0),void 0!==t._pulseColor&&(t._pulseColor=void 0,i=!0),void 0!==t._pulseGlowRadius&&(t._pulseGlowRadius=void 0,i=!0),i)}function S(t,e,r=("undefined"!=typeof performance?performance.now():Date.now())){if(!e||0===e.size)return!1;const n=t.duration??500,i=e.peek();return null!=i&&n>r-i}function O(t,e,r){e>t.capacity&&(t.resize(e),r&&e>r.capacity&&r.resize(e))}function j(t,e){const r=new p(t.capacity);return t.forEach(()=>r.push(e)),r}function G(t,e,r,n){const i=t.push(e);return r&&r.push(n),i}function L(t,e,r){if(!e||0===e.size)return;const n=new Set;if(t.forEach((t,e)=>{r(t)&&n.add(e)}),0===n.size)return;const i=e.toArray();e.clear();for(let t=0;i.length>t;t++)n.has(t)||e.push(i[t])}export{p as RingBuffer,T as computePulseIntensity,E as applyPulse,I as setPulseState,S as hasActivePulses,v as partitionRibbons,_ as buildAggregateRibbons,g as buildPerSeriesRibbons,m as enrichDatumWithBand,O as ensureRingBufferCapacity,j as createTimestampBufferForData,G as pushWithTimestamp,L as compactTimestampBufferForRemoval,b as refreshIdlePulse,A as useLegendCategoryEmission,w as pointCanvasRenderer,x as useSemanticFrameInteractions,B as useXYKeyboardNavigation,H as useOrdinalKeyboardNavigation,F as useGeoKeyboardNavigation};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{StreamXYFrame_default as e}from"./chunk-chunk-JRHXQGEV.module.min.js";import{buildCustomBehaviorProps as t}from"./chunk-chunk-H5IFO6CU.module.min.js";import{normalizeLinkedBrush as n,useBrushSelection as i,useChartLegendAndMargin as s,useChartMode as o,useChartSelection as r}from"./chunk-chunk-HCNDE26Q.module.min.js";import{renderEmptyState as a,renderLoadingState as l}from"./chunk-chunk-ACLDBMRH.module.min.js";var c=class e{constructor(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}push(e){if(!Number.isFinite(e))return;this._count+=1;const t=e-this._mean;this._mean+=t/this._count,this._m2+=t*(e-this._mean),this._min>e&&(this._min=e),e>this._max&&(this._max=e)}merge(e){if(0===e._count)return;if(0===this._count)return this._count=e._count,this._mean=e._mean,this._m2=e._m2,this._min=e._min,void(this._max=e._max);const t=this._count+e._count,n=e._mean-this._mean;this._mean+=n*e._count/t,this._m2+=e._m2+n*n*this._count*e._count/t,this._count=t,this._min>e._min&&(this._min=e._min),e._max>this._max&&(this._max=e._max)}clear(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}clone(){const t=new e;return t._count=this._count,t._mean=this._mean,t._m2=this._m2,t._min=this._min,t._max=this._max,t}get count(){return this._count}get mean(){return 0===this._count?0:this._mean}get sum(){return 0===this._count?0:this._mean*this._count}get variance(){return 2>this._count?0:this._m2/this._count}get stddev(){return Math.sqrt(this.variance)}get sampleVariance(){return 2>this._count?0:this._m2/(this._count-1)}get sampleStddev(){return Math.sqrt(this.sampleVariance)}get min(){return this._min}get max(){return this._max}},u=class{constructor(e){this.windows=new Map,this.sessions=[],this.latest=-1/0,this.type=e.window??"tumbling",this.size=e.size;const t=e.hop??e.size;this.hop=t>0&&e.size>=t?t:e.size,this.gap=e.gap??e.size,this.retain=null!=e.retain&&e.retain>0?e.retain:1/0}push(e,t){Number.isFinite(e)&&Number.isFinite(t)&&(e>this.latest&&(this.latest=e),"session"===this.type?this.pushSession(e,t):this.pushFixed(e,t),this.prune())}pushFixed(e,t){if("tumbling"===this.type||this.hop>=this.size)return void this.bump(Math.floor(e/this.size)*this.size,t);const n=this.hop,i=Math.floor(e/n);for(let s=Math.floor((e-this.size)/n)+1;i>=s;s++)this.bump(s*n,t)}bump(e,t){let n=this.windows.get(e);n||(n=new c,this.windows.set(e,n)),n.push(t)}pushSession(e,t){const n=this.gap,i=new c;i.push(t);let s=e,o=e;const r=[],a={start:s,end:o,stats:i};for(const t of this.sessions)e-n>t.end||t.start>e+n?r.push(t):(a.stats.merge(t.stats),s>t.start&&(s=t.start),t.end>o&&(o=t.end));a.start=s,a.end=o,r.push(a),r.sort((e,t)=>e.start-t.start),this.sessions=r}prune(){if(this.retain===1/0)return;if("session"===this.type)return void(this.sessions.length>this.retain&&(this.sessions=this.sessions.slice(this.sessions.length-this.retain)));if(this.retain>=this.windows.size)return;const e=[...this.windows.keys()].sort((e,t)=>e-t),t=e.length-this.retain;for(let n=0;t>n;n++)this.windows.delete(e[n])}emit(){return"session"===this.type?this.emitSessions():this.emitFixed()}emitFixed(){const e=[];for(const[t,n]of this.windows){const i=t+this.size;e.push(this.row(t,i,n,i>this.latest))}return e.sort((e,t)=>e.start-t.start),e}emitSessions(){return this.sessions.map(e=>this.row(e.start,e.end,e.stats,this.gap>this.latest-e.end))}row(e,t,n,i){return{start:e,end:t,count:n.count,mean:n.mean,sum:n.sum,min:n.min,max:n.max,stddev:n.stddev,partial:i}}get windowCount(){return"session"===this.type?this.sessions.length:this.windows.size}get watermark(){return this.latest}clear(){this.windows.clear(),this.sessions=[],this.latest=-1/0}};function m(e,t){switch(t){case"sum":return e.sum;case"min":return e.min;case"max":return e.max;case"count":return e.count;default:return e.mean}}function h(e,t,n,i=1){if("none"===t)return null;if("minmax"===t)return[e.min,e.max];const s=m(e,n),o=e.stddev*i;return[s-o,s+o]}var d={ms:1,s:1e3,m:6e4,h:36e5,d:864e5},p=/(\d+(?:\.\d+)?)(ms|s|m|h|d)/g;function g(e){if("number"==typeof e)return Number.isFinite(e)&&e>0?e:null;if("string"!=typeof e)return null;const t=e.trim();if(""===t)return null;p.lastIndex=0;let n,i=0,s=0;for(;null!==(n=p.exec(t));){const e=parseFloat(n[1]),t=d[n[2]];if(null==t||!Number.isFinite(e))return null;i+=e*t,s+=n[0].length}return s!==t.length?null:i>0?i:null}var v=class{constructor(e){this.held=[],this._watermark=-1/0,this._lateCount=0,this.lateness=e.lateness>0?e.lateness:0,this.getTime=e.getTime,this.latePolicy=e.latePolicy??"drop"}push(e){const t=this.getTime(e);if(!Number.isFinite(t))return{released:[e],late:[]};const n=[];return this._watermark!==-1/0&&this._watermark-this.lateness>t?(this._lateCount+=1,n.push(e),"drop"===this.latePolicy?{released:[],late:n}:{released:[e],late:n}):(t>this._watermark&&(this._watermark=t),this.held.push(e),{released:this.drain(),late:n})}drain(){const e=this._watermark-this.lateness;if(0===this.held.length)return[];const t=[],n=[];for(const i of this.held)this.getTime(i)>e?n.push(i):t.push(i);return this.held=n,t.sort((e,t)=>this.getTime(e)-this.getTime(t)),t}flush(){const e=this.held;return this.held=[],e.sort((e,t)=>this.getTime(e)-this.getTime(t)),e}clear(){this.held=[],this._watermark=-1/0,this._lateCount=0}get watermark(){return this._watermark}get lateCount(){return this._lateCount}get heldCount(){return this.held.length}};import{useRef as f,useImperativeHandle as w,forwardRef as y,useCallback as b,useState as x,useEffect as A}from"react";import{jsx as _,jsxs as k}from"react/jsx-runtime";var H={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, #f3f4f6)",padding:"6px 10px",borderRadius:"var(--semiotic-tooltip-radius, 4px)",fontSize:"var(--semiotic-tooltip-font-size, 12px)",fontFamily:"var(--semiotic-tick-font-family, var(--semiotic-font-family, sans-serif))",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.25))",lineHeight:1.4,pointerEvents:"none",whiteSpace:"nowrap"},S={opacity:.7,marginRight:4};function z(e,t,n){if(null!=e)return"function"==typeof t?t(e):e["string"==typeof t?t:n]}function C(e){return null==e?"":"number"==typeof e?Number.isInteger(e)?e+"":e.toFixed(2):e instanceof Date?e.toLocaleString():e+""}function I(e={}){const{timeAccessor:t,valueAccessor:n,xLabel:i="x",yLabel:s="y"}=e;return e=>{const o=e?.data??null,r=z(o,t,"time"),a=z(o,n,"value");return k("div",{className:"semiotic-tooltip",style:H,children:[k("div",{children:[k("span",{style:S,children:[i,":"]}),C(r)]}),k("div",{children:[k("span",{style:S,children:[s,":"]}),C(a)]})]})}}function T(e,t){return null!=e?e:Math.max(t?.length??0,200)}var R="time",P="value",F="__aggLower",M="__aggUpper",N="__aggPartial",D="count",E="__aggStart",B="__aggEnd";function O(e,t){const n=t.stat??"mean",i=t.band??"none",s=t.sigma??1;return e.emit().map(e=>{const t={[R]:(e.start+e.end)/2,[P]:m(e,n),[D]:e.count,[N]:e.partial,[E]:e.start,[B]:e.end},o=h(e,i,n,s);return o&&(t[F]=o[0],t[M]=o[1]),t})}import{jsx as j}from"react/jsx-runtime";function L(e,t,n){const i="function"==typeof t?t(e):e[t??n];if(null==i)return null;if(i instanceof Date)return i.getTime();const s=Number(i);return Number.isFinite(s)?s:null}var V=y(function(n,i){const s=o(n.mode,{width:n.size?.[0]??n.width,height:n.size?.[1]??n.height,enableHover:null!=n.enableHover?!!n.enableHover:void 0,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,responsiveRules:n.responsiveRules}),{size:c,margin:m,className:h,arrowOfTime:d="right",windowMode:p="sliding",windowSize:y,data:_,timeAccessor:k,valueAccessor:H,timeExtent:S,valueExtent:z,extentPadding:C,stroke:N="#007bff",strokeWidth:D=2,strokeDasharray:E,opacity:B,background:V,tooltipContent:W,tooltip:$,onHover:X,annotations:q,autoPlaceAnnotations:Q,svgAnnotationRules:U,tickFormatTime:Y,tickFormatValue:G,decay:J,pulse:K,staleness:Z,transition:ee,linkedHover:te,selection:ne,onObservation:ie,chartId:se,loading:oe,loadingContent:re,emptyContent:ae,emphasis:le,legendPosition:ce,aggregate:ue,eventTime:me}=n,he=s.showAxes,de=s.enableHover,pe=m??s.marginDefaults,ge=c??[s.width,s.height],ve=W??$??I({timeAccessor:k,valueAccessor:H}),fe=f(null),{customHoverBehavior:we}=r({selection:ne,linkedHover:te,unwrapData:!0,onObservation:ie,chartType:"RealtimeLineChart",chartId:se}),ye=b(e=>{X&&X(e),we(e)},[X,we]),be=null!=ue,[xe,Ae]=x([]),_e=f(null),ke=f(ue);ke.current=ue;const He=f(be);He.current=be;const Se=f(xe);Se.current=xe;const ze=f({timeAccessor:k,valueAccessor:H});ze.current={timeAccessor:k,valueAccessor:H},A(()=>{if(!be)return void(_e.current=null);const e=ke.current,t=function(e){const t=e.window??"tumbling",n=g("session"===t?e.gap??e.size:e.size);if(null==n)return null;const i=null!=e.hop?g(e.hop):void 0,s=null!=e.gap?g(e.gap):void 0;return new u({window:t,size:n,hop:i??void 0,gap:s??void 0,retain:e.retain})}(e);if(_e.current=t,t&&_){const{timeAccessor:e,valueAccessor:n}=ze.current;for(const i of _){const s=L(i,e,"time"),o=L(i,n,"value");null!=s&&null!=o&&t.push(s,o)}}Ae(t?O(t,e):[])},[be?[ue.window??"tumbling",ue.size,ue.hop??"",ue.gap??"",ue.retain??""].join("|"):"",be,_]),A(()=>{be&&_e.current&&Ae(O(_e.current,ke.current))},[ue?.stat,ue?.band,ue?.sigma]);const Ce=b(e=>{const t=_e.current,n=ke.current;if(!t||!n)return;const{timeAccessor:i,valueAccessor:s}=ze.current;for(const n of e){const e=L(n,i,"time"),o=L(n,s,"value");null!=e&&null!=o&&t.push(e,o)}Ae(O(t,n))},[]),Ie=null!=me,Te=f(null),Re=f(me);Re.current=me;const Pe=f(Ie);Pe.current=Ie;const Fe=f(ie);Fe.current=ie;const Me=f(se);Me.current=se,A(()=>{Te.current=Ie?function(e){const t=g(e.lateness);return null==t?null:new v({lateness:t,getTime:e=>L(e,ze.current.timeAccessor,"time")??NaN,latePolicy:e.latePolicy??"drop"})}(Re.current):null},[Ie?`${me.lateness}|${me.latePolicy??"drop"}`:"",Ie]);const Ne=b(e=>{0!==e.length&&(He.current?Ce(e):fe.current?.pushMany(e))},[Ce]),De=b(e=>{const t=Te.current;if(!Pe.current||!t)return void Ne(e);const n=[];for(const i of e){const e=t.push(i);if(e.released.length&&n.push(...e.released),e.late.length){const n=Fe.current;if(n){const{timeAccessor:i}=ze.current,s=Re.current?.latePolicy??"drop";for(const o of e.late)n({type:"late-data",datum:o,eventTime:L(o,i,"time")??NaN,watermark:t.watermark,policy:s,lateCount:t.lateCount,timestamp:Date.now(),chartType:"RealtimeLineChart",chartId:Me.current})}}}Ne(n)},[Ne]);w(i,()=>({push:e=>De([e]),pushMany:e=>De(e),remove:e=>He.current?[]:fe.current?.remove(e)??[],update:(e,t)=>He.current?[]:fe.current?.update(e,t)??[],clear:()=>{Te.current?.clear(),He.current?(_e.current?.clear(),Ae([])):fe.current?.clear()},getData:()=>He.current?Se.current:fe.current?.getData()??[],getScales:()=>fe.current?.getScales()??null}),[De]);const Ee=l(oe,ge[0],ge[1],re),Be=Ee?null:a(be?void 0:_,ge[0],ge[1],ae),Oe={stroke:N,strokeWidth:D,strokeDasharray:E};null!=B&&(Oe.opacity=B);const je=T(y,_),Le=be?xe:_,Ve=be?R:k,We=be?P:H,$e=be&&ue&&"none"!==(ue.band??"none")?{y0Accessor:F,y1Accessor:M,perSeries:!1}:void 0;return Ee||Be||j(e,{ref:fe,chartType:"line",runtimeMode:"streaming",size:ge,margin:pe,className:le?`${h||""} semiotic-emphasis-${le}`.trim():h,arrowOfTime:d,windowMode:be?"growing":p,windowSize:be?Math.max(1,ue?.retain??Math.max(xe.length,600)):je,data:Le,timeAccessor:Ve,valueAccessor:We,xExtent:S,yExtent:z,extentPadding:C,band:$e,lineStyle:Oe,showAxes:he,background:V,hoverAnnotation:de,tooltipContent:ve,...t({linkedHover:te,selection:ne,onObservation:ie,forceHoverBehavior:!0,mobileInteraction:s.mobileInteraction,customHoverBehavior:ye}),annotations:q,autoPlaceAnnotations:Q,svgAnnotationRules:U,tickFormatTime:Y,tickFormatValue:G,decay:J,pulse:K,staleness:Z,transition:ee,pointIdAccessor:n.pointIdAccessor,legendPosition:ce})});V.displayName="RealtimeLineChart";import{useRef as W,useImperativeHandle as $,forwardRef as X,useCallback as q,useMemo as Q}from"react";function U(e,t,n){const i="function"==typeof t?t(e):e[t??n];if(null==i)return null;if(i instanceof Date)return i.getTime();if("string"==typeof i&&""===i.trim())return null;const s=Number(i);return Number.isFinite(s)?s:null}import{jsx as Y}from"react/jsx-runtime";var G=X(function(c,u){const m=o(c.mode,{width:c.size?.[0]??c.width,height:c.size?.[1]??c.height,showAxes:c.showAxes,showLegend:c.showLegend,enableHover:null!=c.enableHover?!!c.enableHover:void 0,linkedHover:c.linkedHover,mobileInteraction:c.mobileInteraction,mobileSemantics:c.mobileSemantics,responsiveRules:c.responsiveRules}),{binSize:h,size:d,margin:p,className:g,arrowOfTime:v="right",windowMode:f="sliding",windowSize:w,data:y,timeAccessor:b,valueAccessor:x,direction:A="up",timeExtent:I,valueExtent:R,extentPadding:P,categoryAccessor:F,colors:M,fill:N,stroke:D,strokeWidth:E,opacity:B,gap:O,background:j,tooltipContent:L,tooltip:V,onHover:X,annotations:G,autoPlaceAnnotations:J,svgAnnotationRules:K,tickFormatTime:Z,tickFormatValue:ee,linkedHover:te,selection:ne,decay:ie,pulse:se,staleness:oe,transition:re,onObservation:ae,chartId:le,loading:ce,loadingContent:ue,emptyContent:me,emphasis:he,legendPosition:de,legend:pe,brush:ge,onBrush:ve,linkedBrush:fe}=c,we=m.showAxes,ye=m.enableHover,be=d??[m.width,m.height],xe=Q(()=>M?e=>M[e]??N??"#999":void 0,[M,N]),{legend:Ae,margin:_e,legendPosition:ke}=s({data:y??[],colorBy:F,colorScale:xe,showLegend:m.showLegend,legendPosition:de,userMargin:p,defaults:m.marginDefaults,additionalLegend:pe,chartWidth:be[0],axisChrome:{hasAxis:!1!==m.showAxes}}),He=L??V??function(e={}){const{timeAccessor:t,valueAccessor:n}=e;return e=>{const i=e?.data??null;if(null==i?.binStart||null==i?.binEnd){const e=z(i,t,"time"),s=z(i,n,"value");return k("div",{className:"semiotic-tooltip",style:H,children:[k("div",{children:[_("span",{style:S,children:"x:"}),C(e)]}),k("div",{children:[_("span",{style:S,children:"y:"}),C(s)]})]})}return k("div",{className:"semiotic-tooltip",style:H,children:[k("div",{children:[_("span",{style:S,children:"range:"}),C(i.binStart),"–",C(i.binEnd)]}),null!=i.total&&k("div",{children:[_("span",{style:S,children:"count:"}),C(i.total)]}),null!=i.category&&k("div",{children:[_("span",{style:S,children:"category:"}),C(i.category)]})]})}}({timeAccessor:b,valueAccessor:x}),Se=W(null),{customHoverBehavior:ze}=r({selection:ne,linkedHover:te,unwrapData:!0,onObservation:ae,chartType:"RealtimeHistogram",chartId:le}),Ce=q(e=>{X&&X(e),ze(e)},[X,ze]),Ie=!0===ge?{dimension:"x",snap:"bin"}:"x"===ge?{dimension:"x"}:"object"==typeof ge?ge:void 0,Te=n(fe),Re="string"==typeof b?b:"time",Pe=i({name:Te?.name||"__unused_hist_brush__",xField:Te?.xField||Re,...Te?.yField?{yField:Te.yField}:{}}),Fe=W(Pe.brushInteraction);Fe.current=Pe.brushInteraction;const Me=q(e=>{if(ve&&ve(e),ae&&ae(e?{type:"brush",extent:e,timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:le}:{type:"brush-end",timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:le}),Te){const t=Fe.current;t.end(e?"xBrush"===t.brush?e.x:"yBrush"===t.brush?e.y:[[e.x[0],e.y[0]],[e.x[1],e.y[1]]]:null)}},[ve,ae,le,Te]);$(u,()=>({push:e=>Se.current?.push(e),pushMany:e=>Se.current?.pushMany(e),remove:e=>Se.current?.remove(e)??[],update:(e,t)=>Se.current?.update(e,t)??[],clear:()=>Se.current?.clear(),getData:()=>Se.current?.getData()??[],getScales:()=>Se.current?.getScales()??null}),[]);const Ne=l(ce,be[0],be[1],ue),De=Ne?null:a(y,be[0],be[1],me),Ee={};null!=N&&(Ee.fill=N),null!=D&&(Ee.stroke=D),null!=E&&(Ee.strokeWidth=E),null!=B&&(Ee.opacity=B),null!=O&&(Ee.gap=O);const Be=he?`${g||""} semiotic-emphasis-${he}`.trim():g,Oe=T(w,y),je=Q(()=>"down"!==A?R:function({data:e,valueAccessor:t,timeAccessor:n,binSize:i,valueExtent:s,extentPadding:o}){if(s)return[s[1],s[0]];if(!e||0===e.length)return;const r=new Map;for(const s of e){const e=U(s,n,"time"),o=U(s,t,"value");if(null==e||null==o)continue;const a=Math.floor(e/i)*i;r.set(a,(r.get(a)??0)+o)}let a=0;for(const e of r.values())a=Math.max(a,e);return[a>0?a+a*(o??.1):1,0]}({data:y,valueAccessor:x,timeAccessor:b,binSize:h,valueExtent:R,extentPadding:P}),[A,y,x,b,h,R,P]);return Ne||De||Y(e,{ref:Se,chartType:"bar",runtimeMode:"streaming",size:be,margin:_e,className:Be,arrowOfTime:v,windowMode:f,windowSize:Oe,data:y,timeAccessor:b,valueAccessor:x,xExtent:I,yExtent:je,extentPadding:P,binSize:h,categoryAccessor:F,barColors:M,barStyle:Ee,showAxes:we,background:j,hoverAnnotation:ye,tooltipContent:He,...t({linkedHover:te,selection:ne,onObservation:ae,forceHoverBehavior:!0,mobileInteraction:m.mobileInteraction,customHoverBehavior:Ce}),annotations:G,autoPlaceAnnotations:J,svgAnnotationRules:K,tickFormatTime:Z,tickFormatValue:ee,decay:ie,pulse:se,staleness:oe,transition:re,pointIdAccessor:c.pointIdAccessor,legend:Ae,legendPosition:ke,brush:Ie||(fe?{dimension:"x"}:void 0),onBrush:Ie||fe?Me:void 0})});function J(e){return Y(G,{...e,windowMode:"growing"})}G.displayName="RealtimeHistogram",J.displayName="TemporalHistogram";var K=G;import{useRef as Z,useImperativeHandle as ee,forwardRef as te,useCallback as ne}from"react";import{jsx as ie}from"react/jsx-runtime";var se=te(function(n,i){const s=o(n.mode,{width:n.size?.[0]??n.width,height:n.size?.[1]??n.height,enableHover:null!=n.enableHover?!!n.enableHover:void 0,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,responsiveRules:n.responsiveRules}),{size:c,margin:u,className:m,arrowOfTime:h="right",windowMode:d="sliding",windowSize:p,data:g,timeAccessor:v,valueAccessor:f,timeExtent:w,valueExtent:y,yScaleType:b,extentPadding:x,categoryAccessor:A,colors:_,radius:k,fill:H,opacity:S,stroke:z,strokeWidth:C,pointStyle:R,background:P,tooltipContent:F,tooltip:M,onHover:N,annotations:D,autoPlaceAnnotations:E,svgAnnotationRules:B,tickFormatTime:O,tickFormatValue:j,linkedHover:L,selection:V,onObservation:W,chartId:$,loading:X,loadingContent:q,emptyContent:Q,emphasis:U,legendPosition:Y}=n,G=s.showAxes,J=s.enableHover,K=u??s.marginDefaults,te=c??[s.width,s.height],se=F??M??I({timeAccessor:v,valueAccessor:f}),oe=Z(null),{customHoverBehavior:re}=r({selection:V,linkedHover:L,unwrapData:!0,onObservation:W,chartType:"RealtimeSwarmChart",chartId:$}),ae=ne(e=>{N&&N(e),re(e)},[N,re]);ee(i,()=>({push:e=>oe.current?.push(e),pushMany:e=>oe.current?.pushMany(e),remove:e=>oe.current?.remove(e)??[],update:(e,t)=>oe.current?.update(e,t)??[],clear:()=>oe.current?.clear(),getData:()=>oe.current?.getData()??[],getScales:()=>oe.current?.getScales()??null}),[]);const le=l(X,te[0],te[1],q),ce=le?null:a(g,te[0],te[1],Q),ue={};null!=k&&(ue.radius=k),null!=H&&(ue.fill=H),null!=S&&(ue.opacity=S),null!=z&&(ue.stroke=z),null!=C&&(ue.strokeWidth=C);const me=R,he=U?`${m||""} semiotic-emphasis-${U}`.trim():m,de=T(p,g);return le||ce||ie(e,{ref:oe,chartType:"swarm",runtimeMode:"streaming",size:te,margin:K,className:he,arrowOfTime:h,windowMode:d,windowSize:de,data:g,timeAccessor:v,valueAccessor:f,xExtent:w,yExtent:y,yScaleType:b,extentPadding:x,categoryAccessor:A,barColors:_,swarmStyle:ue,pointStyle:me,showAxes:G,background:P,hoverAnnotation:J,tooltipContent:se,...t({linkedHover:L,selection:V,onObservation:W,forceHoverBehavior:!0,mobileInteraction:s.mobileInteraction,customHoverBehavior:ae}),annotations:D,autoPlaceAnnotations:E,svgAnnotationRules:B,tickFormatTime:O,tickFormatValue:j,legendPosition:Y,pointIdAccessor:n.pointIdAccessor})});se.displayName="RealtimeSwarmChart";import{useRef as oe,useImperativeHandle as re,forwardRef as ae,useCallback as le}from"react";import{jsx as ce}from"react/jsx-runtime";var ue=ae(function(n,i){const s=o(n.mode,{width:n.size?.[0]??n.width,height:n.size?.[1]??n.height,enableHover:null!=n.enableHover?!!n.enableHover:void 0,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,responsiveRules:n.responsiveRules}),{size:c,margin:u,className:m,arrowOfTime:h="right",windowMode:d="sliding",windowSize:p,data:g,timeAccessor:v,valueAccessor:f,timeExtent:w,valueExtent:y,extentPadding:b,positiveColor:x,negativeColor:A,connectorStroke:I,connectorWidth:R,gap:P,stroke:F,strokeWidth:M,opacity:N,background:D,tooltipContent:E,tooltip:B,onHover:O,annotations:j,autoPlaceAnnotations:L,svgAnnotationRules:V,tickFormatTime:W,tickFormatValue:$,linkedHover:X,selection:q,onObservation:Q,chartId:U,loading:Y,loadingContent:G,emptyContent:J,emphasis:K,legendPosition:Z}=n,ee=s.showAxes,te=s.enableHover,ne=u??s.marginDefaults,ie=c??[s.width,s.height],se=E??B??function(e={}){const{timeAccessor:t,valueAccessor:n}=e;return e=>{const i=e?.data??null,s=z(i,t,"time"),o=i?.delta??z(i,n,"value"),r=i?.cumEnd,a="number"==typeof o?0>o?C(o):"+"+C(o):C(o);return k("div",{className:"semiotic-tooltip",style:H,children:[k("div",{children:[_("span",{style:S,children:"x:"}),C(s)]}),k("div",{children:[_("span",{style:S,children:"Δ:"}),a]}),null!=r&&k("div",{children:[_("span",{style:S,children:"total:"}),C(r)]})]})}}({timeAccessor:v,valueAccessor:f}),ae=oe(null),{customHoverBehavior:ue}=r({selection:q,linkedHover:X,unwrapData:!0,onObservation:Q,chartType:"RealtimeWaterfallChart",chartId:U}),me=le(e=>{O&&O(e),ue(e)},[O,ue]);re(i,()=>({push:e=>ae.current?.push(e),pushMany:e=>ae.current?.pushMany(e),remove:e=>ae.current?.remove(e)??[],update:(e,t)=>ae.current?.update(e,t)??[],clear:()=>ae.current?.clear(),getData:()=>ae.current?.getData()??[],getScales:()=>ae.current?.getScales()??null}),[]);const he=l(Y,ie[0],ie[1],G),de=he?null:a(g,ie[0],ie[1],J),pe={};null!=x&&(pe.positiveColor=x),null!=A&&(pe.negativeColor=A),null!=I&&(pe.connectorStroke=I),null!=R&&(pe.connectorWidth=R),null!=P&&(pe.gap=P),null!=F&&(pe.stroke=F),null!=M&&(pe.strokeWidth=M),null!=N&&(pe.opacity=N);const ge=K?`${m||""} semiotic-emphasis-${K}`.trim():m,ve=T(p,g);return he||de||ce(e,{ref:ae,chartType:"waterfall",runtimeMode:"streaming",size:ie,margin:ne,className:ge,arrowOfTime:h,windowMode:d,windowSize:ve,data:g,timeAccessor:v,valueAccessor:f,xExtent:w,yExtent:y,extentPadding:b,waterfallStyle:pe,showAxes:ee,background:D,hoverAnnotation:te,tooltipContent:se,...t({linkedHover:X,selection:q,onObservation:Q,forceHoverBehavior:!0,mobileInteraction:s.mobileInteraction,customHoverBehavior:me}),annotations:j,autoPlaceAnnotations:L,svgAnnotationRules:V,tickFormatTime:W,tickFormatValue:$,legendPosition:Z,pointIdAccessor:n.pointIdAccessor})});ue.displayName="RealtimeWaterfallChart";import{useRef as me,useImperativeHandle as he,forwardRef as de,useCallback as pe}from"react";import{jsx as ge}from"react/jsx-runtime";var ve=de(function(n,i){const s=o(n.mode,{width:n.size?.[0]??n.width,height:n.size?.[1]??n.height,enableHover:null!=n.enableHover?!!n.enableHover:void 0,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,responsiveRules:n.responsiveRules}),{size:c,margin:u,className:m,arrowOfTime:h="right",windowMode:d="sliding",windowSize:p,data:g,timeAccessor:v,valueAccessor:f,categoryAccessor:w,timeExtent:y,valueExtent:b,extentPadding:x,heatmapXBins:A=20,heatmapYBins:I=20,aggregation:R="count",background:P,tooltipContent:F,tooltip:M,onHover:N,annotations:D,autoPlaceAnnotations:E,svgAnnotationRules:B,tickFormatTime:O,tickFormatValue:j,decay:L,pulse:V,staleness:W,linkedHover:$,selection:X,onObservation:q,chartId:Q,loading:U,loadingContent:Y,emptyContent:G,emphasis:J,legendPosition:K}=n,Z=s.showAxes,ee=s.enableHover,te=u??s.marginDefaults,ne=c??[s.width,s.height],ie=F??M??function(e={}){const{timeAccessor:t,valueAccessor:n,xLabel:i="x",yLabel:s="y"}=e;return e=>{const o=e?.data??null,r=o?.xCenter??z(o,t,"time"),a=o?.yCenter??z(o,n,"value"),l=o?.count,c=o?.sum,u=o?.value,m=o?.agg??"count";return k("div",{className:"semiotic-tooltip",style:H,children:[k("div",{children:[k("span",{style:S,children:[i,":"]}),C(r)]}),k("div",{children:[k("span",{style:S,children:[s,":"]}),C(a)]}),null!=l&&k("div",{children:[_("span",{style:S,children:"count:"}),C(l)]}),"sum"===m&&null!=c&&k("div",{children:[_("span",{style:S,children:"sum:"}),C(c)]}),"mean"===m&&null!=u&&k("div",{children:[_("span",{style:S,children:"mean:"}),C(u)]})]})}}({timeAccessor:v,valueAccessor:f}),se=me(null),{customHoverBehavior:oe}=r({selection:X,linkedHover:$,unwrapData:!0,onObservation:q,chartType:"RealtimeHeatmap",chartId:Q}),re=pe(e=>{N&&N(e),oe(e)},[N,oe]);he(i,()=>({push:e=>se.current?.push(e),pushMany:e=>se.current?.pushMany(e),remove:e=>se.current?.remove(e)??[],update:(e,t)=>se.current?.update(e,t)??[],clear:()=>se.current?.clear(),getData:()=>se.current?.getData()??[],getScales:()=>se.current?.getScales()??null}),[]);const ae=l(U,ne[0],ne[1],Y),le=ae?null:a(g,ne[0],ne[1],G),ce=J?`${m||""} semiotic-emphasis-${J}`.trim():m,ue=T(p,g);return ae||le||ge(e,{ref:se,chartType:"heatmap",runtimeMode:"streaming",size:ne,margin:te,className:ce,arrowOfTime:h,windowMode:d,windowSize:ue,data:g,timeAccessor:v,valueAccessor:f,categoryAccessor:w,xExtent:y,yExtent:b,extentPadding:x,heatmapXBins:A,heatmapYBins:I,heatmapAggregation:R,showAxes:Z,background:P,hoverAnnotation:ee,tooltipContent:ie,...t({linkedHover:$,selection:X,onObservation:q,forceHoverBehavior:!0,mobileInteraction:s.mobileInteraction,customHoverBehavior:re}),annotations:D,autoPlaceAnnotations:E,svgAnnotationRules:B,tickFormatTime:O,tickFormatValue:j,decay:L,pulse:V,staleness:W,legendPosition:K,pointIdAccessor:n.pointIdAccessor})});ve.displayName="RealtimeHeatmap";export{c as RunningStats,u as WindowAccumulator,m as statValue,h as bandBounds,g as parseWindowDuration,v as ReorderBuffer,V as RealtimeLineChart,G as RealtimeHistogram,J as TemporalHistogram,K as RealtimeTemporalHistogram,se as RealtimeSwarmChart,ue as RealtimeWaterfallChart,ve as RealtimeHeatmap};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{resolveCategoricalPalette as t,resolveExplicitColor as r}from"./chunk-chunk-PX5YQGDP.module.min.js";function e(r,e,n){return t(r,e,n)}function n(t,e){const n=e&&"object"==typeof e&&!Array.isArray(e)?e:void 0;return 0===t.length?t=>n&&r(n,t)||"#4e79a7":e=>{if(n){const t=r(n,e);if(t)return t}let o=0;for(let t=0;e.length>t;t++)o=31*o+e.charCodeAt(t)|0;return t[Math.abs(o)%t.length]??"#4e79a7"}}export{e as resolveCustomLayoutPalette,n as buildResolveColor};
2
+ import{resolveCategoricalPalette as t,resolveExplicitColor as r}from"./chunk-chunk-HCNDE26Q.module.min.js";function e(r,e,n){return t(r,e,n)}function n(t,e){const n=e&&"object"==typeof e&&!Array.isArray(e)?e:void 0;return 0===t.length?t=>n&&r(n,t)||"#4e79a7":e=>{if(n){const t=r(n,e);if(t)return t}let o=0;for(let t=0;e.length>t;t++)o=31*o+e.charCodeAt(t)|0;return t[Math.abs(o)%t.length]??"#4e79a7"}}export{e as resolveCustomLayoutPalette,n as buildResolveColor};
@@ -1 +1,2 @@
1
+ "use client";
1
2
  function e(e){if("undefined"!=typeof __filename){const r=__filename.replace(/\\/g,"/"),n=r.startsWith("/")?r:"/"+r;return new URL("./"+e,"file:"+n)}throw Error("Cannot resolve module worker asset: "+e)}export{e as commonJsWorkerModuleUrl};
@@ -0,0 +1 @@
1
+ import{filterAnnotationsByStatus as e}from"./chunk-chunk-5VVNW5AZ.module.min.js";import{resolveAccessor as t,resolveRawAccessor as n}from"./chunk-chunk-NWIGA3UK.module.min.js";var r=new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),o=new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),a=new Set(["PieChart","DonutChart","FunnelChart"]),i=new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]);function s(e,t){return o.has(e)||a.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 l(e){for(const t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){const n=e[t];if("string"==typeof n&&n)return n}}function c(e,t){return null==e?"—":e instanceof Date?e.toISOString().slice(0,10):"number"==typeof e?t(e):e+""}function u(e,t=new Set){if(null===e)return!0;const n=typeof e;if("string"===n||"boolean"===n)return!0;if("number"===n)return Number.isFinite(e);if("object"!==n)return!1;if(t.has(e))return!1;t.add(e);const r=Array.isArray(e)?e.every(e=>u(e,t)):Object.entries(e).every(([,e])=>u(e,t));return t.delete(e),r}var h=Symbol.for("semiotic.chartRecipeRegistry");function d(e){return function(){const e=globalThis;return e[h]||(e[h]={recipes:new Map,capabilities:new Map,layouts:new Map}),e[h]}().recipes.get(e)}function p(e){return"string"==typeof e?d(e):e&&"object"==typeof e&&"string"==typeof e.id?e:void 0}function f(e){return"string"==typeof e?e:e.id??e.name}function m(e){return e.layoutConfig&&"object"==typeof e.layoutConfig?e.layoutConfig:{}}function g(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 y(e,t,n){return n??p(t.recipe)??p(t.recipeId)??d(e)}function $(e,t,n=[]){const r=e.accessor?t[e.accessor]:void 0;if("string"==typeof r&&r)return r;if(e.field)return e.field;const o=n.find(e=>e&&"object"==typeof e);if(!o)return;const a=Object.entries(o).filter(([e,t])=>!e.startsWith("_")&&null!=t);return"quantitative"===e.semanticType?a.find(([,e])=>"number"==typeof e)?.[0]:"identifier"===e.semanticType?["id","key","name"].find(e=>e in o):a.find(([,e])=>"string"==typeof e)?.[0]}function b(e,t){return e.dataRoles.find(e=>e.role===t)}function v(e,t){return e.dataRoles.find(e=>t.includes(e.semanticType))}function C(e,t,n,r,o,a={}){const i={...a};if(t)for(const[e,n]of Object.entries(t))i[e]=n;for(const e of n.dataRoles){const n=$(e,r,o),a=t&&n?t[n]:n;void 0!==a&&(i[e.role]=a)}return e.replace(/\{([^}]+)\}/g,(e,t)=>{const n=i[t];return null==n?`{${t}}`:n+""})}var w={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",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"},S=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),x=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]);function k(e){return w[e]||e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()+" chart"}function A(e){const t="number"==typeof e?e:"string"==typeof e?Number(e):NaN;return Number.isFinite(t)?t:void 0}var P=new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),j={"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"},F={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},L=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],D={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"};function B(e){return j[e]}function N(e,t){const n=function(e){if(e){if("fits"in e||"buildProps"in e){const t=e,n={};for(const[e,r]of Object.entries(t.intentScores))"number"==typeof r&&Number.isFinite(r)&&(n[e]=r);return{family:t.family,intentScores:Object.keys(n).length?n:void 0}}return e}}(t);if(n?.act)return n.act;if(n?.intentScores){const e=function(e){let t,n=0;for(const[r,o]of Object.entries(e))if("number"==typeof o&&o>0)if(o>n)t=r,n=o;else if(o===n&&void 0!==t){const e=L.indexOf(r),n=L.indexOf(t);-1===e||-1!==n&&e>=n||(t=r)}return t}(n.intentScores);if(e&&j[e]&&(n.intentScores[e]??0)>=3)return j[e]}return n?.family?F[n.family]:function(e){return a.has(e)||"StackedAreaChart"===e?"apportioning":P.has(e)?"relating":o.has(e)?"comparing":i.has(e)?"characterizing":r.has(e)?"tracking":S.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}(e)}var I=new Set(["y-threshold","x-threshold","band","x-band","callout","label"]),M=new Set(["system","agent","watcher"]),T=new Set(["ai","agent","system","computed","dbt","great-expectations"]),O=new Set(["rule","statistical-test","llm-inference","computed"]);function R(e){const t=e.annotations;return!!Array.isArray(t)&&t.some(e=>{if(!e||"object"!=typeof e)return!1;const t=e;if("string"!=typeof t.type||!I.has(t.type))return!1;const n=t.provenance;return!(!n||"object"!=typeof n)&&(M.has(n.authorKind)||T.has(n.source)||O.has(n.basis))})}function G(e="en"){let t,n;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),n=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch{t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),n=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?1e4>Math.abs(e)?n.format(e):t.format(e):e+""}var E={"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"};function U(e){const t=E["string"==typeof e.type?e.type:"annotation"]||"an annotation",n=function(e){const t=e.provenance&&"object"==typeof e.provenance?e.provenance:null,n=t?.authorKind??t?.source??t?.basis;return"watcher"===n?"a watcher-flagged ":"agent"===n||"ai"===n||"llm-inference"===n?"an AI-suggested ":""}(e),r=n?n+t.replace(/^an? /,""):t,o="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return o?`${r} labeled "${o}"`:r}function q(t){const n=Array.isArray(t.annotations)?t.annotations:null;if(!n||0===n.length)return;const r=e(n.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return;const o=r.map(U),a=o.slice(0,5),i=o.length-a.length,s=function(e){return e.length>1?2===e.length?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`:e[0]??""}(a)+(i>0?`, and ${i} more`:""),l=r.length;return`The author has marked ${1===l?"one feature":l+" features"} on this chart: ${s}.`}function z(e,u,h={}){const d=void 0!==h.levels,p=new Set(h.levels??["l1","l2","l3"]);d||!h.capability&&!R(u)||p.add("l4");const b=y(e,u,h.recipe);if(b){const e=["l1","l2","l3","l4"].filter(e=>p.has(e));d||e.includes("l4")||e.push("l4");const t=function(e,t,n={}){const r=g(t),o=m(t),a=n.locale??"en",i="function"==typeof e.description?e.description({data:r,config:o,locale:a}):void 0,s=i?.levels??function(e,t,n,r){const o=v(e,["nominal","ordinal"]),a=v(e,["quantitative"]),i=o?$(o,n,t):void 0,s=a?$(a,n,t):void 0,l=o?.role??i??"category",c=a?.role??s??"value",u=e.encodings??[],h=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:d,percent:p}=function(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})}}}(r),m=new Map;if(i&&s)for(const e of t){const t=(e[i]??"Uncategorized")+"",n=Number(e[s]);Number.isFinite(n)&&m.set(t,(m.get(t)??0)+n)}const g=[...m].sort((e,t)=>t[1]-e[1]),y=g.reduce((e,[,t])=>e+t,0),b=g[0],C=g[1],w=y>0?((b?.[1]??0)+(C?.[1]??0))/y:0,S=e.intents.map(e=>({id:f(e),strength:"string"==typeof e?void 0:e.strength})).sort((e,t)=>"primary"===e.strength?-1:"primary"===t.strength?1:0)[0]?.id,x=e.audience?.primary??e.audienceFit?.find(e=>"strong"===e.fit)?.audience;return{l1:`A ${e.name.toLowerCase()} encodes ${l} and ${c}. ${k=h,k?k.charAt(0).toUpperCase()+k.slice(1):k}.`,l2:g.length>0?`${g.length} categories total ${d.format(y)}. ${b[0]} accounts for ${d.format(b[1])}${y>0?` (${p.format(b[1]/y)})`:""}${C?`, followed by ${C[0]} at ${d.format(C[1])}`:""}.`:`${t.length} data ${1===t.length?"item is":"items are"} represented.`,l3:2>g.length?b?b[0]+" is the only represented category.":"No quantitative pattern can be derived from the available data.":.5>w?`The total is distributed across ${g.length} categories without the first two forming a majority.`:`Most of the total is concentrated in ${b[0]} and ${C[0]}, which together account for ${p.format(w)}.`,l4:`The chart is intended for ${S??"explanation"}${x?` with a ${x} audience`:""}: ${e.designContract.whyCustom}`};var k}(e,r,o,a),l=n.levels??["l1","l2","l3","l4"],c={};for(const e of l)s[e]&&(c[e]=s[e]);const u=["l1","l2","l3","l4"].map(e=>c[e]).filter(e=>!!e).join(" "),h=n.includeCaveats?[...e.reception?.risks??[],...e.caveats??[],...(e.designContract.misuse??[]).map(e=>"Misuse: "+e)]:void 0;return{text:u,levels:c,...h?.length?{caveats:h}:{}}}(b,u,{levels:e,locale:h.locale,audience:h.audience,includeCaveats:h.includeCaveats}),n=q(u);return{...t,text:n?`${n} ${t.text}`.trim():t.text,...n?{annotations:n}:{}}}const C=G(h.locale??"en"),w=k(e),P=Array.isArray(u.data)?u.data:null,j=l(u),F=x.has(e)?function(e,t){const n=e.physics&&"object"==typeof e.physics?e.physics:null,r=e.settledProjection&&"object"==typeof e.settledProjection?e.settledProjection:null,o=[e.settledProjectionRows,e.projectionRows,r?.rows,n?.settledProjectionRows,n?.projectionRows,n?.settledProjection&&"object"==typeof n.settledProjection?n.settledProjection.rows:void 0].find(e=>Array.isArray(e));return Array.isArray(o)?o.map((e,n)=>{if(!e||"object"!=typeof e)return null;const r=e,o=A(r.count??r.value??r.total??r.bodies??r.events);if(null==o)return null;const a=r.label??r.id??r.name??"container "+(n+1),i=A(r.secondary??r.secondaryCount),s=A(r.observed??r.observedCount);return{label:c(a,t),count:o,...null!=i?{secondary:i}:{},..."string"==typeof r.secondaryLabel&&r.secondaryLabel?{secondaryLabel:r.secondaryLabel}:{},...null!=s?{observed:s}:{}}}).filter(e=>null!=e):null}(u,C):null,{measure:L,measureFallback:B,dimension:I,dimensionFallback:M}=s(e,u),T="string"==typeof L&&L?L:B,O="string"==typeof I&&I?I:M,E={};if(x.has(e)&&function(e,t,n,r,o,a){const i=function(e){return"EventDropChart"===e?"time window":"GaltonBoardChart"===e?"bin":"CollisionSwarmChart"===e?"group lane":"PacketFlowChart"===e?"flow node":"CrucibleChart"===e?"result group":"container"}(e),s=function(e){return"EventDropChart"===e?"event":"GaltonBoardChart"===e?"sample":"CollisionSwarmChart"===e?"point":"PacketFlowChart"===e?"packet":"CrucibleChart"===e?"settled item":"body"}(e);if(o.has("l1")&&(r.l1=function(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.`}(e,t)),!o.has("l2")&&!o.has("l3"))return;if(!n||0===n.length)return void(o.has("l2")&&(r.l2="No settled projection is loaded yet."));const l=n.reduce((e,t)=>e+t.count,0),c=n.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),u=c[0]??n.slice().sort((e,t)=>t.count-e.count)[0];if(!u)return;const h=n.reduce((e,t)=>e+(t.secondary??0),0),d=n.find(e=>e.secondaryLabel)?.secondaryLabel??"secondary";if(o.has("l2"))if(0===c.length)r.l2=`The settled projection contains ${a(l)} ${J(l,s)} across ${n.length} ${J(n.length,i)}; no ${J(2,i)} are non-empty yet.`;else{const e=h>0?` ${a(h)} ${J(h,s)} ${1===h?"is":"are"} marked ${d}.`:"";r.l2=`The settled projection contains ${a(l)} ${J(l,s)} across ${n.length} ${J(n.length,i)}; ${c.length} ${J(c.length,i)} ${1===c.length?"is":"are"} non-empty. The largest ${i} is ${u.label} with ${a(u.count)} ${J(u.count,s)}.${e}`}if(o.has("l3")&&l>0&&c.length>0){const e=c.find(e=>e!==u),t=function(e,t){if(0>=t)return"0%";const n=e/t*100;return(10>n?Math.round(10*n)/10:Math.round(n))+"%"}(u.count,l);r.l3=e?`The settled projection is most concentrated in ${u.label}, which holds ${a(u.count)} ${J(u.count,s)} (${t}); ${e.label} follows with ${a(e.count)} ${J(e.count,s)}.`:`The settled projection is concentrated in ${u.label}, which holds all ${a(u.count)} ${J(u.count,s)}.`}}(e,w,F,E,p,C),p.has("l1")&&!x.has(e))if(r.has(e)||o.has(e))E.l1=`A ${w} of ${T} by ${O}`+(j?`, split by ${j}.`:".");else if(a.has(e))E.l1=`A ${w} showing ${T} across ${O} categories.`;else if(i.has(e))E.l1=`A ${w} of the distribution of ${T}`+(j?` by ${j}.`:".");else if(S.has(e)){const e=Array.isArray(u.nodes)?u.nodes.length:void 0,t=Array.isArray(u.edges)?u.edges.length:void 0,n=[null!=e?`${e} ${J(e,"node")}`:null,null!=t?`${t} ${J(t,"edge")}`:null].filter(Boolean);E.l1=`A ${w}${n.length?" with "+n.join(" and "):""}.`}else if("BigNumber"===e){const e="string"==typeof u.label?u.label:T;E.l1=`A single value${e?" for "+e:""}.`}else E.l1=`A ${w}.`;const U=r.has(e)||o.has(e)||a.has(e)||i.has(e);let z=null;if((p.has("l2")||p.has("l3")||p.has("l4"))&&U&&P&&P.length>0&&(z=function(e,t,n,r){let o=0,a=0,i=1/0,s=-1/0,l=null,u=null,h=0,d=0,p=null,f=null,m=NaN,g=NaN;for(const n of e){const e=t(n);Number.isFinite(e)&&(0===o&&(m=e,p=n),g=e,f=n,i>e&&(i=e,l=n,h=o),e>s&&(s=e,u=n,d=o),o++,a+=e)}return 0===o?null:{count:o,min:i,max:s,mean:a/o,minLabel:c(null!=l?n(l):null,r),maxLabel:c(null!=u?n(u):null,r),first:m,last:g,firstLabel:c(null!=p?n(p):null,r),lastLabel:c(null!=f?n(f):null,r),minIndex:h,maxIndex:d}}(P,t(L,B),n(I,M),C)),p.has("l2")&&U&&(P&&0!==P.length?z&&(E.l2=a.has(e)?`${z.count} segments totaling ${C(function(e){return e.mean*e.count}(z))}. Largest is ${z.maxLabel} at ${C(z.max)}; smallest is ${z.minLabel} at ${C(z.min)}.`:`${T} ranges from ${C(z.min)} (${z.minLabel}) to ${C(z.max)} (${z.maxLabel}), with a mean of ${C(z.mean)} across ${z.count} points.`):E.l2="No data is loaded yet."),p.has("l3")&&z&&!j&&r.has(e)?E.l3=function(e,t,n){const{first:r,last:o,min:a,max:i,maxLabel:s,minLabel:l,firstLabel:c,lastLabel:u,minIndex:h,maxIndex:d,count:p}=e,f=i-a,m=o-r;if(0===f)return`${H(t)} is constant at ${n(r)} across the series.`;if(.04>f/(Math.abs(e.mean)||1))return`${H(t)} ends roughly where it started (${n(r)} at ${c} to ${n(o)} at ${u}), ranging between ${n(a)} and ${n(i)}.`;const g=d>0&&p-1>d,y=h>0&&p-1>h,$=(i-Math.max(r,o))/f,b=(Math.min(r,o)-a)/f;return g&&$>.15?`Overall ${t} climbs to a peak of ${n(i)} (${s}), then falls to ${n(o)} (${u}).`:y&&b>.15?`Overall ${t} drops to a low of ${n(a)} (${l}), then recovers to ${n(o)} (${u}).`:.05>Math.abs(m)/f?`${H(t)} ends roughly where it started (${n(r)} at ${c} to ${n(o)} at ${u}), ranging between ${n(a)} and ${n(i)}.`:m>0?d===p-1?`Overall ${t} rises from ${n(r)} (${c}) to a peak of ${n(o)} (${u}).`:`Overall ${t} rises from ${n(r)} (${c}) to ${n(o)} (${u}), after peaking at ${n(i)} (${s}).`:h===p-1?`Overall ${t} falls from ${n(r)} (${c}) to a low of ${n(o)} (${u}).`:`Overall ${t} falls from ${n(r)} (${c}) to ${n(o)} (${u}), after dipping to ${n(a)} (${l}).`}(z,T,C):p.has("l3")&&z&&!j&&o.has(e)&&(E.l3=`The highest ${O} is ${z.maxLabel} and the lowest is ${z.minLabel}.`),p.has("l4")){const t=R(u)?"alerting":N(e,h.capability);t&&(E.l4=function(e,t,n,r,i,s,l,c){const u=D[e],h=/^[aeiou]/i.test(u)?"an":"a";let d,p;switch(e){case"locating":d="This is a map",p="read values by location";break;case"presenting":d="This is a single-value display",p=`read ${"string"==typeof n.label&&n.label?n.label:i} as the headline number`;break;case"tracing":d=`This is ${h} ${u} chart`,p="follow the movement between states";break;case"nesting":d=`This is ${h} ${u} chart`,p="read it for nested structure and how children sum into their parents";break;case"relating":d=`This is ${h} ${u} chart`,p=`read it for whether ${s} and ${i} move together`;break;default:d=`This is ${h} ${u} chart`,p=function(e,t,n,r,i,s){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 "+n;case"comparing":return`compare ${n} across ${r}`;case"ranking":return"read it top to bottom by "+n;case"apportioning":return`read each ${r}'s share of the whole`;case"characterizing":return"read it for the spread and shape of "+n;default:return"read the highlighted features"}switch(e){case"alerting":return function(e,t,n){if(o.has(n)||a.has(n))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;const{first:r,last:i,min:s,max:l,minLabel:c,maxLabel:u,lastLabel:h,minIndex:d,maxIndex:p,count:f}=e,m=l-s;if(m>0){const e=p>0&&f-1>p,n=d>0&&f-1>d,o=(l-Math.max(r,i))/m,a=(Math.min(r,i)-s)/m;if(e&&o>.15)return`the peak of ${t(l)} at ${u} is the point to investigate`;if(n&&a>.15)return`the dip to ${t(s)} at ${c} is the point to investigate`;if(i>=l)return`the climb to ${t(i)} at ${h} warrants a closer look`;if(s>=i)return`the drop to ${t(i)} at ${h} warrants a closer look`}return`the extremes — ${u} (${t(l)}) and ${c} (${t(s)}) — are the points to check`}(t,i,s);case"tracking":return`read it for the trajectory of ${n}, which ${function(e){const t=e.max-e.min,n=e.last-e.first;return 0===t||.05>Math.abs(n)/t?"holds roughly steady":n>0?"rises":"falls"}(t)} from ${i(t.first)} (${t.firstLabel}) to ${i(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${n} across ${r}; ${t.maxLabel} leads at ${i(t.max)}`;case"ranking":return`read it top to bottom by ${n}; ${t.maxLabel} ranks highest at ${i(t.max)}`;case"apportioning":{const e=t.mean*t.count,n=e>0?Math.round(t.max/e*100):null;return`read each ${r}'s share of the ${i(e)} total; ${t.maxLabel} is the largest at ${i(t.max)}${null!=n?` (${n}%)`:""}`}case"characterizing":return`read it for the spread of ${n}, from ${i(t.min)} to ${i(t.max)}`;default:return"read the highlighted features"}}(e,r,i,s,l,t)}return`${d}; ${p}.${function(e,t){if(!t)return"";const n=t.familiarity?.[e];return"number"!=typeof n||n>2?"":` This ${k(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`}(t,c)}`}(t,e,u,j?null:z,T,O,C,h.audience))}const V=["l1","l2","l3","l4"].filter(e=>p.has(e)&&E[e]).map(e=>E[e]).join(" "),K=q(u);return{text:K?`${K} ${V}`.trim():V,levels:E,...K?{annotations:K}:{}}}function H(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function J(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function V(e){return((e??"unknown")+"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function K(u,h,d={}){const p=d.locale??"en",f=Math.max(1,d.maxLeaves??200),w=G(p),S=y(u,h,d.recipe);if(S)return function(e,t,n={}){const r=g(t),o=m(t),a=Math.max(1,n.maxLeaves??200);if("function"==typeof e.navigation)return e.navigation({data:r,config:o,locale:n.locale??"en"});const i=(s=e.navigation)&&"object"==typeof s?e.navigation:void 0;var s;const l=(i?.groupByRole?b(e,i.groupByRole):void 0)??(i?.groupBy?.[0]?b(e,i.groupBy[0])??e.dataRoles.find(e=>e.field===i.groupBy?.[0]):void 0)??v(e,["nominal","ordinal"]),c=l?$(l,o,r):void 0,u=(i?.idRole?b(e,i.idRole):void 0)??v(e,["identifier"]),h=u?$(u,o,r):void 0,d={id:"root",role:"chart",label:i?.summaryTemplate?C(i.summaryTemplate,void 0,e,o,r,{count:r.length}):`${e.name}: ${r.length} ${1===r.length?"item":"items"} represented.`,level:1,children:[]};let p=0;const f=(t,n,a)=>{const s=h?t[h]:void 0,l=i?.itemLabelTemplate?C(i.itemLabelTemplate,t,e,o,r,{count:r.length}):function(e,t,n,r){const o=v(t,["nominal","ordinal"]),a=t.dataRoles.filter(e=>"quantitative"===e.semanticType),i=o?$(o,n,r):void 0,s=[];i&&null!=e[i]&&s.push(e[i]+"");for(const t of a){const o=$(t,n,r);o&&null!=e[o]&&s.push(`${t.role}: ${e[o]+""}`)}return s.length>0?s.join(", "):"Data item"}(t,e,o,r);return{id:"datum-"+V(s??n),role:"datum",label:l,level:a,datum:t}};if(c){const e=new Map;for(const t of r){const n=(t[c]??"Uncategorized")+"",r=e.get(n);r?r.push(t):e.set(n,[t])}d.children=[...e].map(([e,t],n)=>{const r=t.slice(0,Math.max(0,a-p));p+=r.length;const o=r.map((e,t)=>f(e,1e5*n+t,3));return t.length>r.length&&o.push({id:"more-"+V(e),role:"datum",label:`…and ${t.length-r.length} more items`,level:3}),{id:"group-"+V(e),role:"series",label:`${e}: ${t.length} ${1===t.length?"item":"items"}.`,level:2,children:o}})}else{const e=r.slice(0,a);d.children=e.map((e,t)=>f(e,t,2)),r.length>e.length&&d.children.push({id:"more",role:"datum",label:`…and ${r.length-e.length} more items`,level:2})}return d}(S,h,{maxLeaves:f,locale:p});const x={id:"root",role:"chart",label:z(u,h,{locale:p}).text||"Chart.",level:1,children:[]},k=function(t,n){const r=Array.isArray(t.annotations)?t.annotations:null;if(!r)return null;const o=e(r.filter(e=>!!e&&"object"==typeof e));if(0===o.length)return null;let a=0;const i=o.slice(0,n).map(e=>{const t=e.lifecycle?.status,n=t&&"accepted"!==t?` (${t})`:"";return{id:"annotation-"+a++,role:"annotation",level:3,label:`${r=U(e),r?r.charAt(0).toUpperCase()+r.slice(1):r}${n}.`,datum:e};var r});o.length>n&&i.push({id:"annotation-"+a++,role:"annotation",level:3,label:`…and ${o.length-n} more annotations.`});const s=o.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===s?"one marked feature":s+" marked features"}.`,children:i}}(h,f),A=Array.isArray(h.data)?h.data:null,P=r.has(u)||o.has(u)||a.has(u)||i.has(u);if(!A||0===A.length||!P)return k&&(x.children=[k]),x;const{measure:j,measureFallback:F,dimension:L,dimensionFallback:D}=s(u,h),B=t(j,F),N=n(L,D),I="string"==typeof j&&j?j:F,M="string"==typeof L&&L?L:D,T=l(h);let O=0;const R=e=>`${e}-${O++}`,E=(e,t)=>{const n=e.slice(0,f).map(e=>((e,t)=>{const n=B(e),r=c(N(e),w);return{id:R("datum"),role:"datum",level:t,label:`${r}: ${Number.isFinite(n)?w(n):"—"}`,value:Number.isFinite(n)?n:void 0,datum:e}})(e,t));return e.length>f&&n.push({id:R("more"),role:"datum",level:t,label:`…and ${e.length-f} more points`}),n},q=[];if(r.has(u)||o.has(u)){let e=1/0,t=-1/0,n=1/0,r=-1/0;const a=[];let i=!0;for(const o of A){const s=B(o);Number.isFinite(s)&&(e>s&&(e=s),s>t&&(t=s));const l=N(o);a.push(l),"number"==typeof l&&Number.isFinite(l)?(n>l&&(n=l),l>r&&(r=l)):i=!1}const s=new Set,l=[];for(const e of a){const t=e+"";s.has(t)||(s.add(t),l.push(e))}const h=i?`${w(n)} to ${w(r)}`:`${c(l[0],w)} to ${c(l[l.length-1],w)} (${o.has(u)?l.length+" categories":A.length+" points"})`;q.push({id:R("axis"),role:"axis",level:2,label:`${o.has(u)?"Category axis":"X axis"}: ${M}, ${h}.`}),e>t||q.push({id:R("axis"),role:"axis",level:2,label:`Value axis: ${I}, ${w(e)} to ${w(t)}.`})}if(T){const e=n(T,T),t=new Map;for(const n of A){const r=(e(n)??"—")+"",o=t.get(r);o?o.push(n):t.set(r,[n])}const r=[];for(const[e,n]of t){const t=z(u,{...h,data:n},{levels:["l2","l3"],locale:p}).text;r.push({id:R("series"),role:"series",level:2,label:`Series ${e}: ${t}`,children:E(n,3)})}x.children=[...q,...r]}else x.children=[...q,...E(A,2)];return k&&x.children.push(k),x}function Q(e,t){const n=[],r=e=>{if(n.push(e),e.children&&e.children.length>0&&t.has(e.id))for(const t of e.children)r(t)};return r(e),n}function W(e){let t=1;if(e.children)for(const n of e.children)t+=W(n);return t}var _=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]);function Z(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function X(e){return Z(e)?e:void 0}function Y(e){const t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:void 0}function ee(e){const t=Y(e);return null==t?void 0:Math.max(0,Math.floor(t))}function te(...e){return e.map(X).find(Boolean)}function ne(...e){return e.find(Array.isArray)}function re(e){const t={};for(const[n,r]of Object.entries(e))void 0!==r&&(t[n]=r);return t}function oe(e,t,n){return e["string"==typeof t&&t?t:n]}function ae(e){return e instanceof Date?e.toISOString():"number"==typeof e?Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+"":(e??"—")+""}function ie(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function se(e){return Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+""}function le(e,t,n){const r=e?.filter(e=>!0===X(e)?.sensor).length,o=X(t?.observation),a=X(o?.sensors),i=ne(n?.activeSensors);return Math.max(r??0,a?Object.keys(a).length:0,i?.length??0)||void 0}function ce(e,t,n={}){const{capability:r,audience:o,locale:a}=n,i=n.levels??["l1","l2","l3"],s=!1!==n.includeStructure,l=N(e,r),c=z(e,t,{levels:l?[...i,"l4"]:i,locale:a,capability:r,audience:o}),{l4:u,...h}=c.levels,d=["l1","l2","l3"].map(e=>c.levels[e]).filter(Boolean).join(" "),p={levels:h,text:c.annotations?`${c.annotations} ${d}`.trim():d,...c.annotations?{annotations:c.annotations}:{}};let f;if(l&&u){const e=(m=r)?"fits"in m||"buildProps"in m?{family:m.family}:{family:m.family,intentScores:m.intentScores}:{};f={act:l,sentence:u,family:e.family,intentScores:e.intentScores}}var m;const g=s?K(e,t,{maxLeaves:n.maxLeaves,locale:a}):void 0,y=function(e,t,n){if(!1===n)return;const r=Z(n)?n:void 0,o=X(t.physics),a=te(r?.snapshot,o?.snapshot,t.physicsSnapshot,function(e){const t=X(e);return!!t&&(Z(t.world)||"simulationState"in t||"liveBodyOrder"in t)}(t.snapshot)?t.snapshot:void 0),i=te(r?.evidence,o?.evidence,t.physicsEvidence,t.settledEvidence),s=te(r?.config,o?.config,a?.config,t.config),l=te(X(a?.world),X(o?.world)),c=te(X(s?.kernel),X(l?.options)),u=ne(l?.bodies),h=ne(l?.colliders,s?.colliders),d=ne(a?.queue,o?.queue),p=ne(a?.liveBodyOrder),f=ne(l?.springs),m=ne(a?.activeSensorPairs),g=function(e){if(!e||0===e.length)return;const t=e.map((e,t)=>{const n=X(e);if(!n)return;const r=Y(n.count??n.value??n.total??n.bodies??n.events);if(null==r)return;const o=(n.label??n.id??n.name??"container "+(t+1))+"",a=null==n.id?void 0:n.id+"",i=Y(n.secondary??n.secondaryCount),s=Y(n.observed??n.observedCount);return re({id:a,label:o,count:r,secondary:i,secondaryLabel:"string"==typeof n.secondaryLabel?n.secondaryLabel:void 0,observed:s})}).filter(e=>null!=e);if(0===t.length)return;const n=t.reduce((e,t)=>e+t.count,0),r=t.filter(e=>e.count>0).length,o=t.slice().sort((e,t)=>t.count-e.count)[0];return{rows:t,totalCount:n,populatedCount:r,...o?{leader:o}:{}}}(function(e,t,n,r){const o=X(e.settledProjection),a=X(t?.settledProjection);return ne(n?.projectionRows,n?.aggregates,e.settledProjectionRows,e.projectionRows,o?.rows,t?.settledProjectionRows,t?.projectionRows,a?.rows,r?.binCounts)}(t,o,r,i)),y=function(e,t){const n=e?.map((e,t)=>{const n=X(e);if(!n)return;const r=Y(n.count)??0,o=Y(n.total),a={label:(n.label??n.id??"sediment "+(t+1))+"",count:r};return null!=n.id&&(a.id=n.id+""),null!=o&&(a.total=o),a}).filter(e=>null!=e),r=ee(t?.bins)??n?.length??0,o=Y(t?.count)??n?.reduce((e,t)=>e+t.count,0)??0,a=Y(t?.total)??n?.reduce((e,t)=>e+(t.total??0),0),i=n?.slice().sort((e,t)=>t.count-e.count)[0];if(0!==r||0!==o||a)return{bins:r,count:o,...null!=a&&a>0?{total:a}:{},...i?{leader:i}:{}}}(ne(r?.sediment,o?.sediment,a?.sediment),te(r?.sedimentTotals,o?.sedimentTotals)),$=p?.length??u?.length??ee(i?.bodyCount),b=function(e){if(e)return e.filter(e=>!0===X(e)?.sleeping).length}(u)??ee(i?.sleepingCount),v=d?.length,C="string"==typeof a?.simulationState?a.simulationState:void 0,w="boolean"==typeof i?.settled?i.settled:C?"settled"===C:null!=$||null!=b||null!=v?null!=$&&b===$&&0===(v??0):void 0,S=X(c?.gravity),x=Y(S?.x),k=Y(S?.y),A=re({state:C,settled:w,elapsedSeconds:Y(a?.elapsedSeconds),paused:"boolean"==typeof a?.paused?a.paused:void 0,visible:"boolean"==typeof a?.visible?a.visible:void 0,seed:Y(c?.seed),gravity:null!=x&&null!=k?{x:x,y:k}:void 0,fixedDt:Y(s?.fixedDt??c?.fixedDt),timeScale:Y(s?.timeScale),maxSubsteps:ee(s?.maxSubsteps),liveBodies:$,sleepingBodies:b,queued:v,bodyLimit:Y(s?.bodyLimit),eviction:"string"==typeof s?.eviction?s.eviction:void 0}),P=re({colliders:h?.length,sensors:le(h,s,l),springs:f?.length,activeSensorPairs:m?.length}),j=Object.keys(P).length>0,F=_.has(e);if(!(Object.keys(A).length>0||j||g||y)||!F&&null==n)return;const L={simulation:A,...j?{geometry:P}:{},...g?{aggregates:g}:{},...y?{sediment:y}:{}},D=function(e){const t=[],n=e.simulation,r=[n.state??(n.settled?"settled":void 0),null!=n.liveBodies?`${n.liveBodies} live ${ie(n.liveBodies,"body")}`:void 0,null!=n.sleepingBodies?n.sleepingBodies+" sleeping":void 0,null!=n.queued?n.queued+" queued":void 0,null!=n.seed?"seed "+se(n.seed):void 0,n.gravity?`gravity (${se(n.gravity.x)}, ${se(n.gravity.y)})`:void 0,null!=n.fixedDt?`fixed step ${se(n.fixedDt)}s`:void 0,null!=n.timeScale?se(n.timeScale)+"x time":void 0].filter(Boolean);r.length>0&&t.push(`Physics simulation: ${r.join("; ")}.`);const o=e.geometry;if(o){const e=[null!=o.colliders?`${o.colliders} ${ie(o.colliders,"collider")}`:void 0,null!=o.sensors?`${o.sensors} ${ie(o.sensors,"sensor")}`:void 0,null!=o.springs?`${o.springs} ${ie(o.springs,"spring")}`:void 0,null!=o.activeSensorPairs?`${o.activeSensorPairs} active sensor ${ie(o.activeSensorPairs,"pair")}`:void 0].filter(Boolean);e.length>0&&t.push(`Physics geometry: ${e.join("; ")}.`)}const a=e.aggregates;if(a){const e=a.leader,n=e?` Largest is ${e.label} with ${se(e.count)}.`:"";t.push(`Physics aggregates: ${se(a.totalCount)} settled ${ie(a.totalCount,"body")} across ${a.rows.length} ${ie(a.rows.length,"container")}; ${a.populatedCount} populated.${n}`)}const i=e.sediment;if(i){const e=null!=i.total?", value total "+se(i.total):"",n=i.leader?`; largest sediment bin is ${i.leader.label} with ${se(i.leader.count)}`:"";t.push(`Physics sediment: ${i.count} retained ${ie(i.count,"body")} in ${i.bins} ${ie(i.bins,"bin")}${e}${n}.`)}return t.join(" ")}(L);return{...L,text:D}}(e,t,n.physics),$=function(e,t,n){const r=[];if("GaugeChart"===e){"number"==typeof t.value&&Number.isFinite(t.value)&&r.push(`Current value is ${ae(t.value)}.`);const e="number"==typeof t.min&&Number.isFinite(t.min)?t.min:0,n="number"==typeof t.max&&Number.isFinite(t.max)?t.max:100;r.push(`The gauge scale runs from ${ae(e)} to ${ae(n)}.`)}if("SankeyDiagram"===e||"ProcessSankey"===e){const o=Array.isArray(t.edges)?t.edges:[];if("ProcessSankey"===e&&Array.isArray(t.domain)&&2===t.domain.length&&r.push(`The ProcessSankey time domain runs from ${ae(t.domain[0])} to ${ae(t.domain[1])}.`),o.length>0){r.push(`${o.length} source flow${1===o.length?"":"s"} are supplied.`);for(const a of o.slice(0,n)){const n=oe(a,t.sourceAccessor,"source"),o=oe(a,t.targetAccessor,"target"),i=oe(a,t.valueAccessor,"value");r.push("ProcessSankey"!==e||null==a.startTime&&null==a.endTime?`${ae(n)} to ${ae(o)} has value ${ae(i)}.`:`${ae(n)} to ${ae(o)} has value ${ae(i)} over ${ae(a.startTime)}–${ae(a.endTime)}.`)}}}if("Treemap"===e||"CirclePack"===e||"TreeDiagram"===e||"OrbitDiagram"===e){const e=X(t.data),o="string"==typeof t.childrenAccessor&&t.childrenAccessor?t.childrenAccessor:"children",a="string"==typeof t.valueAccessor&&t.valueAccessor?t.valueAccessor:"value",i="string"==typeof t.nodeIdAccessor&&t.nodeIdAccessor?t.nodeIdAccessor:"string"==typeof t.nodeIDAccessor&&t.nodeIDAccessor?t.nodeIDAccessor:"name",s=[],l=e=>{const t=Array.isArray(e[o])?e[o]:[];if(0!==t.length)for(const e of t){const t=X(e);t&&l(t)}else s.push(e)};if(e&&l(e),s.length>0){r.push(s.length+" hierarchy leaves are supplied.");for(const e of s.slice(0,n))r.push(`${ae(e[i])} has value ${ae(e[a])}.`)}}if(_.has(e)&&Array.isArray(t.data)){const n=t.data;r.push(`${n.length} observed source row${1===n.length?"":"s"} are supplied.`);const o="CollisionSwarmChart"===e?t.xAccessor:t.valueAccessor,a="CollisionSwarmChart"===e?"x":"value",i=n.map(e=>Y(oe(e,o,a))).filter(e=>null!=e);i.length>0&&r.push(`Observed ${"string"==typeof o?o:a} ranges from ${ae(Math.min(...i))} to ${ae(Math.max(...i))}.`)}if(0!==r.length)return{source:"chart-props",statements:r,text:"Exact chart-prop facts: "+r.join(" ")}}(e,t,Math.max(1,n.maxLeaves??200)),b=[p.text,f?.sentence,y?.text,$?.text].filter(Boolean).join(" ");return{component:e,description:p,intent:f,structure:g,physics:y,facts:$,text:b}}var ue=["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","GaugeChart","FunnelChart","SwimlaneChart","LikertChart","LineChart","BumpChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","BubbleChart","Heatmap","QuadrantChart","MultiAxisLineChart","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"],he=new Set(ue);function de(e){return he.has(e)}var pe=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","legend","recipe","layout"]),fe=new Set(["data","nodes","edges","points","areas","lines","flows"]);function me(e){if(null==e)return e;if("function"==typeof e)return;if("object"!=typeof e)return e;if(e.$$typeof)return;if(Array.isArray(e))return e.map(me).filter(e=>void 0!==e);if(e instanceof Date)return e;const t={};for(const[n,r]of Object.entries(e)){if("function"==typeof r)continue;if(r&&"object"==typeof r&&r.$$typeof)continue;const e=me(r);void 0!==e&&(t[n]=e)}return t}function ge(e,t){return!!fe.has(e)&&("areas"!==e||"string"!=typeof t)}var ye="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e));function $e(e,t,n){const r=d(e)??p(t.recipe)??p(t.recipeId);if(r)return function(e,t,n){const r=function(e,t,n){const r={};for(const[o,a]of Object.entries(e))if(null!=a&&!pe.has(o)&&"recipeId"!==o&&(t||!ge(o,a)))if("function"==typeof a||a?.$$typeof){if(n)throw Error(`Portable recipe prop "${o}" is not JSON-safe.`)}else if(u(a))r[o]=ye(a);else if(n)throw Error(`Portable recipe prop "${o}" is not JSON-safe.`);return r}(t,!1!==n?.includeData,"portable"===e.portability),o=e.intents.map(f).filter(e=>!!e),a={name:e.name,intents:o,...e.audience?.primary?{audience:[e.audience.primary]}:{},frameFamily:e.frameFamily};if("portable"===e.portability){if(!u(r))throw Error(`Portable recipe "${e.id}" contains non-JSON-safe props or layoutConfig.`);return{component:"ChartRecipe",recipeId:e.id,portable:!0,props:r,manifest:a,version:"1",createdAt:(new Date).toISOString(),...n?.selections?{selections:n.selections}:{}}}return{component:"ChartRecipe",recipeId:e.id,portable:!1,reason:"Recipe contains or may depend on non-serializable local layout callbacks.",warnings:["This config is inspectable but cannot be rendered remotely by CLI or MCP."],props:r,manifest:a,version:"1",createdAt:(new Date).toISOString(),...n?.selections?{selections:n.selections}:{}}}(r,t,n);if(!de(e))throw Error(`Unknown component "${e}". Known components: ${ue.join(", ")}`);const o=!1!==n?.includeData,a={};for(const[e,n]of Object.entries(t))if(null!=n&&!pe.has(e)&&(o||!ge(e,n))&&"function"!=typeof n&&!n?.$$typeof)try{a[e]=ye(me(n))}catch{}return{component:e,props:a,version:"1",createdAt:(new Date).toISOString(),...n?.selections?{selections:n.selections}:{}}}function be(e){if(!e.component||!e.props)throw Error("Invalid chart config: missing component or props");if("ChartRecipe"===e.component||"LocalChartRecipe"===e.component){if(!e.recipeId)throw Error("Invalid chart recipe config: missing recipeId");const t=d(e.recipeId);if(!t)throw Error(`Unknown chart recipe "${e.recipeId}". Register it before deserializing this config.`);if("LocalChartRecipe"!==e.component&&!1!==e.portable&&"portable"!==t.portability)throw Error(`Chart recipe "${e.recipeId}" is registered as local, not portable.`);return{componentName:"ChartRecipe",props:{...ye(e.props),recipeId:e.recipeId}}}if(!de(e.component))throw Error(`Unknown component "${e.component}". This config may require a newer version of semiotic.`);return{componentName:e.component,props:ye(e.props)}}function ve(e){const t=JSON.stringify(e);return"sc="+btoa(unescape(encodeURIComponent(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Ce(e){const t=new URLSearchParams(e.includes("?")?e.split("?")[1]:e).get("sc");if(!t)throw Error("No chart config found in URL (missing 'sc' parameter)");const n=t.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(escape(atob(n)));return JSON.parse(r)}async function we(e,t="json"){const n="jsx"===t?Se(e):JSON.stringify(e,null,2);if("undefined"==typeof navigator||!navigator.clipboard)throw Error("Clipboard API not available. copyConfig requires a browser environment.");await navigator.clipboard.writeText(n)}function Se(e){const{props:t}=e,n=["<"+("LocalChartRecipe"===e.component?"ChartRecipe":e.component)];e.recipeId&&n.push(` recipeId="${e.recipeId}"`);for(const[e,r]of Object.entries(t))if("string"==typeof r)n.push(` ${e}="${r}"`);else if("boolean"==typeof r&&!0===r)n.push(" "+e);else if("boolean"==typeof r&&!1===r)n.push(` ${e}={false}`);else if("number"==typeof r)n.push(` ${e}={${r}}`);else{const t=JSON.stringify(r);n.push(80>t.length?` ${e}={${t}}`:` ${e}={${JSON.stringify(r,null,2)}}`)}return n.push("/>"),n.join("\n")}export{d as getChartRecipe,f as recipeIntentId,m as recipeConfig,$ as fieldForRole,B as communicativeActForIntent,N as resolveCommunicativeAct,z as describeChart,K as buildNavigationTree,Q as flattenVisible,W as countNodes,ce as buildReaderGrounding,$e as toConfig,be as fromConfig,ve as toURL,Ce as fromURL,we as copyConfig,Se as configToJSX};
@@ -0,0 +1 @@
1
+ import{getMinMax as e}from"./chunk-chunk-JJ2OOIET.module.min.js";function t(t,a){const{field:i,bins:r=10}=a,s=t.map(e=>Number(e[i])).filter(e=>!isNaN(e));if(0===s.length)return[];const[n,l]=e(s),c=a.domain?a.domain[0]:n,u=a.domain?a.domain[1]:l;if(c===u)return[{category:`${c}-${u}`,value:s.length}];const d=(u-c)/r,f=Array(r).fill(0);for(const e of s){let t=Math.floor((e-c)/d);t===r&&(t=r-1),t>=0&&r>t&&f[t]++}return f.map((e,t)=>{const a=c+t*d,i=a+d;return{category:`${o(a)}-${o(i)}`,value:e}})}function a(t,a){const{groupBy:i,value:r,agg:o="sum"}=a,s=new Map;for(const e of t){const t=e[i]+"";s.has(t)||s.set(t,[]),s.get(t).push(Number(e[r]))}const n=[];for(const[t,a]of s){let r;switch(o){case"count":r=a.length;break;case"mean":r=a.reduce((e,t)=>e+t,0)/a.length;break;case"min":r=e(a)[0];break;case"max":r=e(a)[1];break;default:r=a.reduce((e,t)=>e+t,0)}n.push({[i]:t,value:r})}return n}function i(e,t){const{key:a,fields:i}=t,r=new Map;for(const t of e){const e=t[a]+"";if(r.has(e)||r.set(e,[]),i){const a={};for(const e of i)e in t&&(a[e]=t[e]);r.get(e).push(a)}else r.get(e).push({...t})}const o=[];for(const[e,t]of r)o.push({id:e,coordinates:t});return o}function r(e,t){const{columns:a,nameField:i="name",valueField:r="value"}=t,o=new Set(a),s=[];for(const t of e){const e={};for(const a of Object.keys(t))o.has(a)||(e[a]=t[a]);for(const o of a)s.push({...e,[i]:o,[r]:t[o]})}return s}function o(e){return Math.round(1e3*e)/1e3+""}function s(e){return"nominal"===e||"ordinal"===e}function n(e){return"quantitative"===e||"temporal"===e}var l={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"},c={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"},u={sum:"sum",mean:"mean",average:"mean",count:"count",min:"min",max:"max",median:"mean"};function d(e){e=function(e){if(!function(e){return e.usermeta?.idid}(e)||!Array.isArray(e.layer))return e;const t=e.layer.filter(e=>!function(e){return"annotation-layer"===e.usermeta?.idid?.role}(e));if(1!==t.length)return e;const{layer:a,...i}=e,{usermeta:r,...o}=t[0];return{...i,...o}}(e);const t=[],{type:i,markProps:r}=function(e){if(!e)return{type:"",markProps:{}};if("string"==typeof e)return{type:e,markProps:{}};const{type:t,...a}=e;return{type:t,markProps:a}}(e.mark),o=e.encoding||{},d=o.x,y=o.y,m=o.color,g=o.size,h=o.theta,v=o.opacity;let b;e.data?.values?b=e.data.values: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||o.facet||o.row||o.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.");const x={};e.width&&(x.width=e.width),e.height&&(x.height=e.height);const k=function(e){if(e)return"string"==typeof e?e:e.text}(e.title);if(k&&(x.title=k),m?.field&&(x.colorBy=m.field,m.scale?.scheme)){const e=l[m.scale.scheme];e&&(x.colorScheme=e)}void 0!==v?.value&&(x.pointOpacity=v.value);const A=d?.aggregate,L=y?.aggregate;if(b&&(A||L)){const e=L?y:d,t=L?d:y,i=u[e.aggregate];if(i&&t?.field&&e.field)b=a(b,{groupBy:t.field,value:e.field,agg:i});else if(("count"===i||"count"===e.aggregate)&&t?.field&&b){const e=new Map;for(const a of b){const i=a[t.field]+"";e.set(i,(e.get(i)||0)+1)}b=Array.from(e,([e,a])=>({[t.field]:e,value:a}))}}if(d?.bin||y?.bin){const e="Histogram";b&&(x.data=b),d?.bin?(x.valueAccessor=d.field,y?.field&&(x.categoryAccessor=y.field),d.axis?.title&&(x.valueLabel=d.axis.title)):y?.bin&&(x.valueAccessor=y.field,d?.field&&(x.categoryAccessor=d.field),y.axis?.title&&(x.valueLabel=y.axis.title));const a=d?.bin||y?.bin,i="object"==typeof a?a.maxbins:void 0;return i&&(x.bins=i),p(e,x,t)}let w;switch(i){case"bar":w=function(e,t,a,i,r,o,l){let c;return a?.field&&!1!==e?.stack&&!1!==t?.stack&&null!==e?.stack&&null!==t?.stack?(c="StackedBarChart",i.stackBy=a.field):c="BarChart",s(e?.type)&&n(t?.type)?(i.categoryAccessor=e.field,i.valueAccessor=l?"value":t.field,e?.axis?.title&&(i.categoryLabel=e.axis.title),t?.axis?.title&&(i.valueLabel=t.axis.title)):n(e?.type)&&s(t?.type)?(i.categoryAccessor=t.field,i.valueAccessor=o?"value":e.field,i.orientation="horizontal",t?.axis?.title&&(i.categoryLabel=t.axis.title),e?.axis?.title&&(i.valueLabel=e.axis.title)):(e?.field&&(i.categoryAccessor=e.field),t?.field&&(i.valueAccessor=l?"value":t.field),e?.axis?.title&&(i.categoryLabel=e.axis.title),t?.axis?.title&&(i.valueLabel=t.axis.title)),r&&(i.data=r),c}(d,y,m,x,b,A,L);break;case"line":if(w="LineChart",f(d,y,x,A,L),m?.field&&(x.lineBy=m.field),r.interpolate){const e=c[r.interpolate];e&&(x.curve=e)}!0===r.point&&(x.showPoints=!0),b&&(x.data=b);break;case"area":if(m?.field?(w="StackedAreaChart",x.areaBy=m.field):w="AreaChart",f(d,y,x,A,L),r.interpolate){const e=c[r.interpolate];e&&(x.curve=e)}void 0!==r.opacity&&(x.areaOpacity=r.opacity),b&&(x.data=b);break;case"point":case"circle":case"square":g?.field?(w="BubbleChart",x.sizeBy=g.field,g.scale?.range&&(x.sizeRange=g.scale.range)):w="Scatterplot",f(d,y,x,A,L),b&&(x.data=b);break;case"rect":w="Heatmap",d?.field&&(x.xAccessor=d.field),y?.field&&(x.yAccessor=y.field),m?.field&&(x.valueAccessor=m.field,delete x.colorBy),d?.axis?.title&&(x.xLabel=d.axis.title),y?.axis?.title&&(x.yLabel=y.axis.title),b&&(x.data=b);break;case"arc":r.innerRadius&&r.innerRadius>0?(w="DonutChart",x.innerRadius=r.innerRadius):w="PieChart",h?.field?x.valueAccessor=h.field:y?.field&&(x.valueAccessor=L?"value":y.field),m?.field&&(x.categoryAccessor=m.field),d?.field&&!h?.field&&(x.categoryAccessor=d.field),b&&(x.data=b);break;case"tick":w="DotPlot",s(d?.type)?(x.categoryAccessor=d.field,y?.field&&(x.valueAccessor=L?"value":y.field),d?.axis?.title&&(x.categoryLabel=d.axis.title),y?.axis?.title&&(x.valueLabel=y.axis.title)):s(y?.type)?(x.categoryAccessor=y.field,d?.field&&(x.valueAccessor=A?"value":d.field),x.orientation="horizontal",y?.axis?.title&&(x.categoryLabel=y.axis.title),d?.axis?.title&&(x.valueLabel=d.axis.title)):(d?.field&&(x.categoryAccessor=d.field),y?.field&&(x.valueAccessor=L?"value":y.field)),b&&(x.data=b);break;default:t.push(`Unsupported mark type "${i}". Defaulting to Scatterplot.`),w="Scatterplot",f(d,y,x,A,L),b&&(x.data=b)}return p(w,x,t)}function f(e,t,a,i,r){e?.field&&(a.xAccessor=i?"value":e.field),t?.field&&(a.yAccessor=r?"value":t.field),e?.axis?.title&&(a.xLabel=e.axis.title),t?.axis?.title&&(a.yLabel=t.axis.title)}function p(e,t,a){const i={component:e,props:t,version:"1",createdAt:(new Date).toISOString()};if(a.length>0){i.warnings=a;for(const e of a)console.warn("[semiotic/fromVegaLite] "+e)}return i}export{t as bin,a as rollup,i as groupBy,r as pivot,d as fromVegaLite};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{forceLayout as n}from"./chunk-chunk-T2FKJD4O.module.min.js";import{canUseForceWorker as t,runForceLayoutWorker as e,shouldUseForceWorker as o}from"./chunk-chunk-ARZGA4LJ.module.min.js";import{useWasHydratingFromSSR as r}from"./chunk-chunk-ACLDBMRH.module.min.js";import{useEffect as i,useMemo as s,useRef as u,useState as a}from"react";var d=new WeakMap;function l(n){const t=[];for(const e of Object.keys(n).sort()){const o=n[e];if(void 0!==o){if("function"==typeof o)return null;t.push(`${e}:${o+""}`)}}return t.join("|")}function c(n,t,e){return null==e?null:d.get(n)?.get(t)?.get(e)??null}function p(n,t,e,o){if(null==e)return;let r=d.get(n);r||(r=new WeakMap,d.set(n,r));let i=r.get(t);if(i||(i=new Map,r.set(t,i)),!i.has(e)&&i.size>=16){const n=i.keys().next().value;void 0!==n&&i.delete(n)}i.set(e,o)}function f(d,f,m={}){const h=r(),{seed:g,iterations:k,repulsion:y,linkDistance:w,linkStrength:R,centerStrength:b,damping:j,nodeRadius:v,nodePadding:A,inset:x,execution:D,workerThreshold:E}=m,M=s(()=>({seed:g,iterations:k,repulsion:y,linkDistance:w,linkStrength:R,centerStrength:b,damping:j,nodeRadius:v,nodePadding:A,inset:x,execution:D,workerThreshold:E}),[g,k,y,w,R,b,j,v,A,x,D,E]),O=u(h),[S,T]=a(()=>{if("undefined"==typeof window||h){const t=n(d,f,M);return p(d,f,l(M),t),{positions:t,status:"ready",error:null}}const t=c(d,f,l(M));return t?{positions:t,status:"ready",error:null}:{positions:null,status:"pending",error:null}});return i(()=>{if(O.current)return void(O.current=!1);const r=l(M),i=c(d,f,r);if(i)return void T(n=>"ready"===n.status&&n.positions===i?n:{positions:i,status:"ready",error:null});const s=new AbortController;return T(n=>({positions:n.positions,status:"pending",error:null})),async function(r,i,s={}){const{execution:u="auto",signal:a,workerThreshold:d,nodeRadius:l,...c}=s,p=c.iterations??260;if(!t()||!o(u,r.length,i.length,p,d))return n(r,i,{...c,nodeRadius:l});const f={kind:"normalized",nodes:r.map(n=>({...n})),edges:i.map(n=>({...n})),options:c,nodeRadii:"function"==typeof l?Object.fromEntries(r.map(n=>[n.id,l(n)])):null==l?void 0:Object.fromEntries(r.map(n=>[n.id,l]))};try{return(await e(f,a)).positions}catch(t){if("AbortError"===t?.name)throw t;return n(r,i,{...c,nodeRadius:l})}}(d,f,{...M,signal:s.signal}).then(n=>{p(d,f,r,n),T({positions:n,status:"ready",error:null})}).catch(n=>{"AbortError"!==n.name&&T(t=>({positions:t.positions,status:"error",error:n}))}),()=>s.abort()},[d,f,M]),S}export{f as useForceLayout};
2
+ import{forceLayout as n}from"./chunk-chunk-G75OPF5N.module.min.js";import{canUseForceWorker as t,runForceLayoutWorker as e,shouldUseForceWorker as o}from"./chunk-chunk-7LE56WAE.module.min.js";import{useWasHydratingFromSSR as r}from"./chunk-chunk-ACLDBMRH.module.min.js";import{useEffect as i,useMemo as s,useRef as u,useState as a}from"react";var d=new WeakMap;function l(n){const t=[];for(const e of Object.keys(n).sort()){const o=n[e];if(void 0!==o){if("function"==typeof o)return null;t.push(`${e}:${o+""}`)}}return t.join("|")}function c(n,t,e){return null==e?null:d.get(n)?.get(t)?.get(e)??null}function p(n,t,e,o){if(null==e)return;let r=d.get(n);r||(r=new WeakMap,d.set(n,r));let i=r.get(t);if(i||(i=new Map,r.set(t,i)),!i.has(e)&&i.size>=16){const n=i.keys().next().value;void 0!==n&&i.delete(n)}i.set(e,o)}function f(d,f,m={}){const h=r(),{seed:g,iterations:k,repulsion:y,linkDistance:w,linkStrength:b,centerStrength:j,damping:v,nodeRadius:R,nodePadding:E,inset:x,execution:A,workerThreshold:M}=m,O=s(()=>({seed:g,iterations:k,repulsion:y,linkDistance:w,linkStrength:b,centerStrength:j,damping:v,nodeRadius:R,nodePadding:E,inset:x,execution:A,workerThreshold:M}),[g,k,y,w,b,j,v,R,E,x,A,M]),S=u(h),[D,P]=a(()=>{if("undefined"==typeof window||h){const t=n(d,f,O);return p(d,f,l(O),t),{positions:t,status:"ready",error:null}}const t=c(d,f,l(O));return t?{positions:t,status:"ready",error:null}:{positions:null,status:"pending",error:null}});return i(()=>{if(S.current)return void(S.current=!1);const r=l(O),i=c(d,f,r);if(i)return void P(n=>"ready"===n.status&&n.positions===i?n:{positions:i,status:"ready",error:null});const s=new AbortController;return P(n=>({positions:n.positions,status:"pending",error:null})),async function(r,i,s={}){const{execution:u="auto",signal:a,workerThreshold:d,nodeRadius:l,...c}=s,p=c.iterations??260;if(!t()||!o(u,r.length,i.length,p,d))return n(r,i,{...c,nodeRadius:l});const f={kind:"normalized",nodes:r.map(n=>({...n})),edges:i.map(n=>({...n})),options:c,nodeRadii:"function"==typeof l?Object.fromEntries(r.map(n=>[n.id,l(n)])):null==l?void 0:Object.fromEntries(r.map(n=>[n.id,l]))};try{return(await e(f,a)).positions}catch(t){if("AbortError"===t?.name)throw t;return n(r,i,{...c,nodeRadius:l})}}(d,f,{...O,signal:s.signal}).then(n=>{p(d,f,r,n),P({positions:n,status:"ready",error:null})}).catch(n=>{"AbortError"!==n.name&&P(t=>({positions:t.positions,status:"error",error:n}))}),()=>s.abort()},[d,f,O]),D}export{f as useForceLayout};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import*as e from"react";import{jsx as t,jsxs as n}from"react/jsx-runtime";function a(e,t,n=0){const a=Math.min(t[0],t[1]),i=Math.max(t[0],t[1]),o=Math.max(a,Math.min(i,e[0])),r=Math.max(a,Math.min(i,e[1])),l=o>r?[r,o]:[o,r];if(l[1]-l[0]>=n)return l;const s=(l[0]+l[1])/2,d=n/2;return[Math.max(a,Math.min(i-n,s-d)),Math.min(i,Math.max(a+n,s+d))]}function i(e,t,n,i=1,o=i){const r="in"===n?i:-i;return a([e[0]+r,e[1]-r],t,o)}function o(t){const{domain:n,initialValue:o=n,step:r=1,minSpan:l=r,label:s,formatValue:d,onChange:u}=t,[c,m]=e.useState(()=>a(o,n,l)),h=a(c,n,l),b=e.useCallback(e=>{const t=a(e,n,l);m(t),u?.(t)},[n,l,u]),g=e.useMemo(()=>({label:s,domain:n,value:h,step:r,formatValue:d,onChange:b,onClear:()=>b(n)}),[n,d,s,b,r,h]),p=e.useMemo(()=>({onZoomIn:()=>b(i(h,n,"in",r,l)),onZoomOut:()=>b(i(h,n,"out",r,l)),onReset:()=>b(n)}),[n,l,b,r,h]);return{value:h,setValue:b,xExtent:h,brush:g,zoom:p}}var r={display:"grid",gap:8,padding:"10px 12px",border:"1px solid var(--semiotic-border, #d8dee4)",borderRadius:12,background:"var(--semiotic-surface, var(--semiotic-bg, rgba(255,255,255,0.92)))"},l={fontSize:11,fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--semiotic-text-secondary, #57606a)"};function s(e,t){return{minWidth:e,minHeight:e,padding:"0 12px",borderRadius:999,border:"1px solid var(--semiotic-border, #d8dee4)",background:t?"var(--semiotic-primary, #0969da)":"var(--semiotic-bg, #fff)",color:t?"var(--semiotic-bg, #fff)":"var(--semiotic-text, #24292f)",fontSize:13,fontWeight:650,touchAction:"manipulation"}}function d(e){return"function"==typeof e}function u({brush:e,targetSize:a}){const i=e?.value,o=e?.domain,u=!!i&&!!o,c=!0===e?.disabled,m=e?.formatValue??(e=>e),h=!!e?.onChange&&u&&!c,b=o?.[0]??0,g=o?.[1]??1,p=i?.[0]??b,y=i?.[1]??g,f=e?.step??((g-b)/100||1);return n("section",{style:r,"aria-label":"Brush controls",children:[t("div",{style:l,children:e?.label??"Filter range"}),u?n("div",{style:{display:"grid",gap:8},children:[n("label",{style:{display:"grid",gap:4,fontSize:12},children:[n("span",{children:["Start: ",m(p)]}),t("input",{type:"range",min:b,max:g,step:f,value:p,disabled:!h,style:{minHeight:a},onChange:t=>{const n=Number(t.currentTarget.value);e?.onChange?.([Math.min(n,y),y])}})]}),n("label",{style:{display:"grid",gap:4,fontSize:12},children:[n("span",{children:["End: ",m(y)]}),t("input",{type:"range",min:b,max:g,step:f,value:y,disabled:!h,style:{minHeight:a},onChange:t=>{const n=Number(t.currentTarget.value);e?.onChange?.([p,Math.max(n,p)])}})]})]}):t("div",{style:{fontSize:12,color:"var(--semiotic-text-secondary, #57606a)"},children:"Provide a brush domain and value to expose range inputs beside the drag gesture."}),t("button",{type:"button",disabled:c||!d(e?.onClear),onClick:e?.onClear,style:s(a),children:"Clear range"})]})}function c({zoom:e,targetSize:a}){const i=!0===e?.disabled;return n("section",{style:r,"aria-label":"Zoom controls",children:[t("div",{style:l,children:e?.label??"Zoom"}),n("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[t("button",{type:"button","aria-label":"Zoom out",disabled:i||!d(e?.onZoomOut),onClick:e?.onZoomOut,style:s(a),children:"-"}),t("button",{type:"button","aria-label":"Reset zoom",disabled:i||!d(e?.onReset),onClick:e?.onReset,style:s(a),children:"Reset"}),t("button",{type:"button","aria-label":"Zoom in",disabled:i||!d(e?.onZoomIn),onClick:e?.onZoomIn,style:s(a),children:"+"})]})]})}function m({legend:e,targetSize:a}){const i=!0===e?.disabled,o=e?.items??[];return n("section",{style:r,"aria-label":"Legend controls",children:[t("div",{style:l,children:e?.label??"Series"}),o.length>0&&t("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:o.map(o=>{const r=!1!==o.active;return n("button",{type:"button",disabled:i||o.disabled||!e?.onToggle,onClick:()=>e?.onToggle?.(o.id,!r),style:s(a,r),"aria-pressed":r,children:[o.color&&t("span",{"aria-hidden":"true",style:{display:"inline-block",width:9,height:9,marginRight:6,borderRadius:999,background:o.color}}),o.label??o.id]},o.id)})}),n("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[t("button",{type:"button",disabled:i||!d(e?.onShowAll),onClick:e?.onShowAll,style:s(a),children:"Show all"}),t("button",{type:"button",disabled:i||!d(e?.onHideAll),onClick:e?.onHideAll,style:s(a),children:"Hide all"})]})]})}function h({controls:e,targetSize:a=44,compact:i=!1,className:o,style:r,ariaLabel:l="Mobile chart controls",brush:s,zoom:d,legend:h}){const b=function(e,t){if(!1===e)return[];if(!0===e||"all"===e)return["brush","zoom","legend"];if(Array.isArray(e))return e;if(e)return[e];const n=[];return t.brush&&n.push("brush"),t.zoom&&n.push("zoom"),t.legend&&n.push("legend"),n}(e,{brush:s,zoom:d,legend:h});return 0===b.length?null:n("div",{className:o,role:"group","aria-label":l,style:{display:"grid",gridTemplateColumns:i?"1fr":"repeat(auto-fit, minmax(180px, 1fr))",gap:10,...r},children:[b.includes("brush")&&t(u,{brush:s,targetSize:a}),b.includes("zoom")&&t(c,{zoom:d,targetSize:a}),b.includes("legend")&&t(m,{legend:h,targetSize:a})]})}export{a as clampMobileRange,i as zoomMobileRange,o as useMobileRangeControls,h as MobileStandardControls};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{STREAMING_PALETTE as e,createColorScale as t,distinctCategories as r,filterSparseArray as o,getCrosshairProps as n,resolveMobileInteraction as a,useCategoryColors as i,useChartLegendAndMargin as l,useChartMode as c,useChartSelection as u,useColorScale as s,useLegendInteraction as g,useThemeCategorical as d}from"./chunk-chunk-HCNDE26Q.module.min.js";import{useThemeSelector as h}from"./chunk-chunk-PMR47KRY.module.min.js";import{renderEmptyState as m,renderLoadingState as p}from"./chunk-chunk-ACLDBMRH.module.min.js";import{useMemo as y}from"react";function f(e){const t=h(e=>e.theme.colors.selectionOpacity);return y(()=>{if(void 0!==e||void 0!==t)return{name:e?.name??"",...e,unselectedOpacity:e?.unselectedOpacity??t}},[e,t])}import{useCallback as v,useMemo as L,useState as b}from"react";function k(c){const{data:h,rawData:y,colorBy:k,colorScheme:C,legendInteraction:H,legendPosition:S,selection:w,linkedHover:D,fallbackFields:M,unwrapData:I=!1,onObservation:B,chartType:R,chartId:P,showLegend:F,legend:A,legendLayout:T,userMargin:x,marginDefaults:O,onClick:W,hoverHighlight:j,mobileInteraction:N,mobileSemantics:z,loading:G,loadingContent:_,emptyContent:E,width:K,height:Q,hasTitle:V,axisChrome:Y}=c,q=void 0===y,J=L(()=>o(h),[h]),[U,X]=b([]),Z=v(e=>{X(t=>t.length===e.length&&t.every((t,r)=>t===e[r])?t:e)},[]),$="string"==typeof k?k:void 0,ee=L(()=>a(N,{width:K,mobileSemantics:z}),[N,K,z]),{activeSelectionHook:te,hoverSelectionHook:re,customHoverBehavior:oe,customClickBehavior:ne,crosshairSourceId:ae}=u({selection:w,linkedHover:D,fallbackFields:M,unwrapData:I,onObservation:B,chartType:R,chartId:P,onClick:W,hoverHighlight:j,colorByField:$,mobileInteraction:ee}),ie=n(D,ae),le=s(J,k,C),ce=L(()=>r(J,k),[J,k]),ue=L(()=>q&&U.length>0?U:ce,[q,U,ce]),se=g(H,k,ue),ge=L(()=>re||(se.legendSelectionHook?se.legendSelectionHook:te),[re,se.legendSelectionHook,te]),de=f(w),he=d(),me=i(),pe=L(()=>{if(le)return le;if(!k||0===ue.length)return;const r=Array.isArray(C)&&C.length>0||"string"==typeof C&&C.length>0?C:he&&he.length>0?he:e,o="__streamCat",n=ue.map(e=>({[o]:e})),a=t(n,o,r);return e=>me?.[e]||a(e)||"#999"},[le,k,ue,C,he,me]),{legend:ye,margin:fe,legendPosition:ve}=l({data:J,colorBy:k,colorScale:pe,showLegend:F,legendPosition:S,userMargin:x,defaults:O,categories:ue,additionalLegend:A,chartWidth:K,legendLayout:T,hasTitle:V,axisChrome:Y}),Le=L(()=>{const e={};return ye&&(e.legend=ye,e.legendPosition=ve,T&&(e.legendLayout=T)),H&&"none"!==H&&(e.legendHoverBehavior=se.onLegendHover,e.legendClickBehavior=se.onLegendClick,e.legendHighlightedCategory=se.highlightedCategory,e.legendIsolatedCategories=se.isolatedCategories),q&&k&&(e.legendCategoryAccessor=k,e.onCategoriesChange=Z),e},[ye,ve,T,H,se.onLegendHover,se.onLegendClick,se.highlightedCategory,se.isolatedCategories,q,k,Z]),be=Array.isArray(y)?o(y):y,ke=p(G,K,Q,_),Ce=ke?null:m(be,K,Q,E);return{data:J,colorScale:le,allCategories:ue,legendState:se,effectiveSelectionHook:ge,activeSelectionHook:te,customHoverBehavior:oe,customClickBehavior:ne,mobileInteraction:ee,legend:ye,margin:fe,legendPosition:ve,earlyReturn:ke||Ce||null,legendBehaviorProps:Le,crosshairProps:ie,resolvedSelection:de}}import{useImperativeHandle as C,useRef as H}from"react";function S(e,t){const{variant:r,frameRef:o,overrides:n}=t,a=H(n);a.current=n,C(e,()=>{const e=function(e,t){if("xy"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.remove(t)??[],update:(t,r)=>e.current?.update(t,r)??[],replace:t=>e.current?.replace?.(t),clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getScales:()=>e.current?.getScales()??null,getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("network"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>{const r=Array.isArray(t)?t:[t],o=e.current?.getTopology()?.nodes??[],n=[];for(const t of r){const r=o.find(e=>e.id===t);r&&n.push({...r.data??{},id:t}),e.current?.removeNode(t)}return n},update:(t,r)=>(Array.isArray(t)?t:[t]).flatMap(t=>{const o=e.current?.updateNode(t,r);return o?[{...o,id:t}]:[]}),clear:()=>e.current?.clear(),getData:()=>e.current?.getTopology()?.nodes?.map(e=>e.data)??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("geo-points"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.removePoint(t)??[],update:(t,r)=>{const o=e.current?.removePoint(t)??[];for(const t of o)e.current?.push(r(t));return o},clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}const r=t;return{push:e=>r.current?.pushLine(e),pushMany:e=>r.current?.pushManyLines(e),remove:e=>r.current?.removeLine(e)??[],update:(e,t)=>{const o=r.current?.removeLine(e)??[];for(const e of o)r.current?.pushLine(t(e));return o},clear:()=>r.current?.clear(),getData:()=>r.current?.getLines()??[],getCustomLayout:()=>r.current?.getCustomLayout?.()??null,getLayoutFailure:()=>r.current?.getLayoutFailure?.()??null}}(r,o);return new Proxy(e,{get(e,t,r){if("string"==typeof t){const e=a.current?.[t];if("function"==typeof e)return e}return Reflect.get(e,t,r)},has:(e,t)=>!("string"!=typeof t||!a.current||!(t in a.current))||Reflect.has(e,t)})},[])}function w(e,t){if(!function(e){return void 0!==e.stroke||void 0!==e.strokeWidth||void 0!==e.opacity}(t))return e??((...e)=>({}));const r={};return void 0!==t.stroke&&(r.stroke=t.stroke),void 0!==t.strokeWidth&&(r.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(r.opacity=t.opacity),e?(...t)=>({...e(...t)||{},...r}):(...e)=>({...r})}function D(e){if(null==e)return;if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};const t={};return"number"==typeof e.top&&(t.top=e.top),"number"==typeof e.right&&(t.right=e.right),"number"==typeof e.bottom&&(t.bottom=e.bottom),"number"==typeof e.left&&(t.left=e.left),t}import{useMemo as M,useRef as I}from"react";function B(e){const t=I(null);return S(e.imperativeRef,{variant:e.imperativeVariant,frameRef:t}),{frameRef:t,resolved:c(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),normalizedMargin:M(()=>D(e.margin),[e.margin])}}function R(e){const t=B(e),{resolved:r,normalizedMargin:o}=t,n=k({data:e.data??[],rawData:e.data,colorBy:e.colorBy,colorScheme:e.colorScheme,legendInteraction:e.legendInteraction,legendPosition:e.legendPosition,selection:e.selection,linkedHover:e.linkedHover,hoverHighlight:e.hoverHighlight,fallbackFields:"string"==typeof e.colorBy?[e.colorBy]:[],unwrapData:e.unwrapData,onObservation:e.onObservation,onClick:e.onClick,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,chartType:e.chartTypeLabel,chartId:e.chartId,showLegend:r.showLegend,legend:e.legend,userMargin:o,marginDefaults:r.marginDefaults,loading:e.loading,loadingContent:e.loadingContent,emptyContent:e.emptyContent,width:r.width,height:r.height});return{...t,safeData:n.data,setup:n,earlyReturn:n.earlyReturn}}export{f as useResolvedSelection,k as useChartSetup,S as useFrameImperativeHandle,w as mergeShapeStyle,D as normalizePartialMargin,B as useCustomChartScaffold,R as useCustomChartSetup};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{resolveCSSColor as n}from"./chunk-chunk-PX5YQGDP.module.min.js";function r(n){const{background:r,hasBackgroundGraphics:t=!1,themeBackground:c=""}=n;return"transparent"===r||t?null:r||(c&&"transparent"!==c?c:"")||null}function t(t,c){const{background:o,hasBackgroundGraphics:u=!1,themeBackground:i="",x:a=0,y:e=0,width:d,height:h}=c,s=r({background:o,hasBackgroundGraphics:u,themeBackground:i});if(!s)return!1;const g=n(t,s);return!!g&&(t.fillStyle=g,t.fillRect(a,e,d,h),!0)}function c(n){return!!(n.dirtyOrRebuilt||n.transitioning||n.animationTicked||n.continuous||n.liveEncoding||n.forced)}function o(n,r){return n||r}export{r as resolveCanvasBackground,t as paintCanvasBackground,c as needsDataCanvasPaint,o as needsInteractionCanvasPaint};
2
+ import{resolveCSSColor as n}from"./chunk-chunk-HCNDE26Q.module.min.js";function r(n){const{background:r,hasBackgroundGraphics:t=!1,themeBackground:c=""}=n;return"transparent"===r||t?null:r||(c&&"transparent"!==c?c:"")||null}function t(t,c){const{background:o,hasBackgroundGraphics:u=!1,themeBackground:i="",x:a=0,y:e=0,width:d,height:h}=c,s=r({background:o,hasBackgroundGraphics:u,themeBackground:i});if(!s)return!1;const g=n(t,s);return!!g&&(t.fillStyle=g,t.fillRect(a,e,d,h),!0)}function c(n){return!!(n.dirtyOrRebuilt||n.transitioning||n.animationTicked||n.continuous||n.liveEncoding||n.forced)}function o(n,r){return n||r}export{r as resolveCanvasBackground,t as paintCanvasBackground,c as needsDataCanvasPaint,o as needsInteractionCanvasPaint};