semiotic 3.8.8 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (501) hide show
  1. package/README.md +82 -66
  2. package/agent-skill/semiotic-charts/SKILL.md +11 -2
  3. package/ai/behaviorContracts.cjs +33 -3
  4. package/ai/cli.js +53 -2
  5. package/ai/componentMetadata.cjs +15 -0
  6. package/ai/dist/mcp-server.js +1530 -611
  7. package/ai/examples.md +48 -42
  8. package/{CLAUDE.md → ai/reference.md} +46 -24
  9. package/ai/schema.json +10704 -825
  10. package/ai/surface-manifest.json +643 -2
  11. package/ai/system-prompt.md +83 -130
  12. package/dist/c-3BLJEQNG.min.js +1 -0
  13. package/dist/c-3KZD6AXJ.min.js +1 -0
  14. package/dist/c-4TWEX5HG.min.js +1 -0
  15. package/dist/c-52TEGIUJ.min.js +1 -0
  16. package/dist/c-5YCIX3VZ.min.js +1 -0
  17. package/dist/c-6FEKTA3U.min.js +1 -0
  18. package/dist/c-6O5EVOPH.min.js +1 -0
  19. package/dist/c-74HEEZGK.min.js +1 -0
  20. package/dist/c-AKAF6JAD.min.js +1 -0
  21. package/dist/c-BBKITSXB.min.js +1 -0
  22. package/dist/c-BWNB6USU.min.js +1 -0
  23. package/dist/c-C25ENHIK.min.js +1 -0
  24. package/dist/c-CDR5AO3R.min.js +1 -0
  25. package/dist/c-COHXCW3Q.min.js +1 -0
  26. package/dist/{chunk-scatterplotMatrixBrushOverlay-SDIZSN66.module.min.js → c-DADXPJXV.min.js} +0 -1
  27. package/dist/c-E3JFRRMI.min.js +1 -0
  28. package/dist/c-EBFPQHHO.min.js +1 -0
  29. package/dist/c-G36WS6LN.min.js +1 -0
  30. package/dist/c-GIKRQI4X.min.js +1 -0
  31. package/dist/c-GPYOFETM.min.js +1 -0
  32. package/dist/c-IDUHYYSI.min.js +1 -0
  33. package/dist/{chunk-chunk-FQPKOAIH.module.min.js → c-IUHFPMHD.min.js} +0 -1
  34. package/dist/c-J5G56TUH.min.js +1 -0
  35. package/dist/c-JAZ73J32.min.js +1 -0
  36. package/dist/c-KG3NXHAL.min.js +1 -0
  37. package/dist/c-KII3PLZE.min.js +1 -0
  38. package/dist/c-LIXGXMNS.min.js +1 -0
  39. package/dist/c-LVEY6D6B.min.js +1 -0
  40. package/dist/c-M4Y3BHFR.min.js +1 -0
  41. package/dist/c-MAIICR2Z.min.js +1 -0
  42. package/dist/c-MG5DM6VE.min.js +1 -0
  43. package/dist/{chunk-minimapBrushOverlay-JU57U7NM.module.min.js → c-MNF2S4AA.min.js} +0 -1
  44. package/dist/c-MT3WBK7M.min.js +1 -0
  45. package/dist/c-NY3JWV2K.min.js +1 -0
  46. package/dist/c-O6U6K4CW.min.js +1 -0
  47. package/dist/c-OCI56QF2.min.js +1 -0
  48. package/dist/c-OQ7M4AGV.min.js +1 -0
  49. package/dist/c-OXYMVK7Q.min.js +1 -0
  50. package/dist/c-PPWDL5ZI.min.js +1 -0
  51. package/dist/c-QHF5YON3.min.js +1 -0
  52. package/dist/c-RR3GO5SW.min.js +1 -0
  53. package/dist/{chunk-chunk-J5QD4RAM.module.min.js → c-RSVIHIQ4.min.js} +0 -1
  54. package/dist/{chunk-chunk-EMO5NUGE.module.min.js → c-S2BXNNJN.min.js} +0 -1
  55. package/dist/{chunk-chunk-YCQYG6J5.module.min.js → c-SLGMUBUL.min.js} +0 -1
  56. package/dist/c-SUILCHWU.min.js +1 -0
  57. package/dist/c-TZW3JGJ5.min.js +1 -0
  58. package/dist/c-US5ZFT6E.min.js +1 -0
  59. package/dist/{chunk-chunk-RZH7VZYS.module.min.js → c-USFMFKIH.min.js} +0 -1
  60. package/dist/c-UUKVD4WB.min.js +1 -0
  61. package/dist/{chunk-chunk-SV4XAZ3Q.module.min.js → c-VGW3VG3I.min.js} +0 -1
  62. package/dist/c-W3CE4A4S.min.js +1 -0
  63. package/dist/{chunk-chunk-2NVFEB7P.module.min.js → c-WJCD5EUY.min.js} +0 -1
  64. package/dist/{chunk-chunk-2JGJ5GUG.module.min.js → c-X5UBGU2V.min.js} +0 -1
  65. package/dist/c-YDAY2WFR.min.js +1 -0
  66. package/dist/c-ZOWWU34K.min.js +1 -0
  67. package/dist/components/AccessibleNavTree.d.ts +1 -1
  68. package/dist/components/CategoryColors.d.ts +1 -1
  69. package/dist/components/GradientLegend.d.ts +14 -0
  70. package/dist/components/Legend.d.ts +2 -7
  71. package/dist/components/LinkedCharts.d.ts +1 -1
  72. package/dist/components/MobileAnnotationCalloutList.d.ts +1 -1
  73. package/dist/components/ObservationReadout.d.ts +45 -0
  74. package/dist/components/ThemeProvider.d.ts +4 -4
  75. package/dist/components/Tooltip/FlippingTooltip.d.ts +5 -7
  76. package/dist/components/Tooltip/Tooltip.d.ts +83 -5
  77. package/dist/components/Tooltip/tooltipChrome.d.ts +43 -0
  78. package/dist/components/ai/chartCapabilityTypes.d.ts +86 -2
  79. package/dist/components/ai/chartClinic.d.ts +2 -0
  80. package/dist/components/ai/deriveProfileFields.d.ts +40 -0
  81. package/dist/components/ai/evaluateChart.d.ts +85 -0
  82. package/dist/components/ai/fieldPolicy.d.ts +7 -0
  83. package/dist/components/ai/fieldRoles.d.ts +24 -0
  84. package/dist/components/ai/generativeChart.d.ts +18 -2
  85. package/dist/components/ai/inferIntent.d.ts +26 -2
  86. package/dist/components/ai/intents.d.ts +35 -0
  87. package/dist/components/ai/navigationTree.d.ts +2 -2
  88. package/dist/components/ai/observedSceneAudit.d.ts +2 -1
  89. package/dist/components/ai/profileData.d.ts +11 -0
  90. package/dist/components/ai/repairChartConfig.d.ts +2 -3
  91. package/dist/components/ai/semanticEvidence.d.ts +4 -0
  92. package/dist/components/ai/semanticViability.d.ts +11 -0
  93. package/dist/components/ai/semanticViabilityRegistry.d.ts +5 -0
  94. package/dist/components/ai/streamingTypes.d.ts +4 -0
  95. package/dist/components/ai/suggestCharts.d.ts +5 -6
  96. package/dist/components/ai/suggestDashboard.d.ts +2 -3
  97. package/dist/components/ai/suggestStreamCharts.d.ts +1 -1
  98. package/dist/components/ai/suggestStretchCharts.d.ts +2 -3
  99. package/dist/components/ai/suggestionPropContracts.d.ts +20 -0
  100. package/dist/components/ai/variantDiscovery.d.ts +3 -1
  101. package/dist/components/charts/custom/NetworkCustomChart.d.ts +3 -0
  102. package/dist/components/charts/custom/OrdinalCustomChart.d.ts +3 -0
  103. package/dist/components/charts/custom/XYCustomChart.d.ts +1 -1
  104. package/dist/components/charts/geo/ChoroplethMap.d.ts +3 -1
  105. package/dist/components/charts/geo/DistanceCartogram.d.ts +2 -7
  106. package/dist/components/charts/geo/cartogramOverlay.d.ts +28 -0
  107. package/dist/components/charts/index.d.ts +4 -3
  108. package/dist/components/charts/network/ProcessSankey.d.ts +2 -136
  109. package/dist/components/charts/network/ProcessSankeyProps.d.ts +139 -0
  110. package/dist/components/charts/network/Treemap.d.ts +2 -1
  111. package/dist/components/charts/network/processSankey/boundaryHubOrdering.d.ts +23 -0
  112. package/dist/components/charts/network/processSankey/layoutGeometry.d.ts +2 -0
  113. package/dist/components/charts/network/processSankey/ordering.d.ts +3 -41
  114. package/dist/components/charts/network/processSankey/orderingTypes.d.ts +32 -0
  115. package/dist/components/charts/network/processSankey/packing.d.ts +1 -1
  116. package/dist/components/charts/network/processSankey/packingCache.d.ts +1 -1
  117. package/dist/components/charts/network/processSankey/packingOptimization.d.ts +72 -0
  118. package/dist/components/charts/ordinal/BarChart.d.ts +4 -3
  119. package/dist/components/charts/ordinal/FunnelChart.d.ts +2 -0
  120. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +3 -2
  121. package/dist/components/charts/ordinal/StackedBarChart.d.ts +4 -3
  122. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +2 -2
  123. package/dist/components/charts/physics/GaltonBoardChart.d.ts +2 -9
  124. package/dist/components/charts/physics/GauntletChart.d.ts +10 -41
  125. package/dist/components/charts/physics/ProcessFlowChart.d.ts +1 -1
  126. package/dist/components/charts/physics/chainReactionAccessibleTable.d.ts +9 -0
  127. package/dist/components/charts/physics/chainReactionRuntime.d.ts +2 -1
  128. package/dist/components/charts/physics/chainReactionTypes.d.ts +6 -1
  129. package/dist/components/charts/physics/crucibleBodyRenderers.d.ts +2 -2
  130. package/dist/components/charts/physics/crucibleClone.d.ts +6 -0
  131. package/dist/components/charts/physics/crucibleEffects.d.ts +1 -2
  132. package/dist/components/charts/physics/crucibleRecord.d.ts +7 -0
  133. package/dist/components/charts/physics/gauntletChrome.d.ts +4 -4
  134. package/dist/components/charts/physics/gauntletPhysics.d.ts +1 -0
  135. package/dist/components/charts/physics/gauntletPublic.d.ts +4 -0
  136. package/dist/components/charts/physics/packetFlowOverlay.d.ts +7 -0
  137. package/dist/components/charts/physics/physicsChartLayout.d.ts +8 -0
  138. package/dist/components/charts/physics/physicsChartShared.d.ts +3 -1
  139. package/dist/components/charts/physics/physicsChartUtils.d.ts +1 -1
  140. package/dist/components/charts/physics/physicsHocUtils.d.ts +26 -13
  141. package/dist/components/charts/physics/physicsProjectionOverlays.d.ts +24 -0
  142. package/dist/components/charts/physics/processFlowOverlays.d.ts +9 -0
  143. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +17 -12
  144. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +12 -7
  145. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +37 -14
  146. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +23 -14
  147. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +22 -13
  148. package/dist/components/charts/realtime/aggregate.d.ts +4 -1
  149. package/dist/components/charts/realtime/eventTime.d.ts +4 -0
  150. package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +27 -0
  151. package/dist/components/charts/realtime/realtimeChartTypes.d.ts +30 -0
  152. package/dist/components/charts/realtime/useRealtimeCategoryColors.d.ts +30 -0
  153. package/dist/components/charts/shared/FrameTextAnnotationSVG.d.ts +10 -0
  154. package/dist/components/charts/shared/annotationActivation.d.ts +3 -7
  155. package/dist/components/charts/shared/annotationBandFill.d.ts +6 -0
  156. package/dist/components/charts/shared/annotationDispatch.d.ts +31 -0
  157. package/dist/components/charts/shared/annotationIdentity.d.ts +8 -0
  158. package/dist/components/charts/shared/annotationRules.d.ts +1 -15
  159. package/dist/components/charts/shared/boundedCategoryRegistry.d.ts +8 -0
  160. package/dist/components/charts/shared/chainReactionChartSpec.d.ts +3 -0
  161. package/dist/components/charts/shared/chartMode.d.ts +3 -2
  162. package/dist/components/charts/shared/chartSpecCore.d.ts +1 -0
  163. package/dist/components/charts/shared/formatUtils.d.ts +40 -9
  164. package/dist/components/charts/shared/frameTextAnnotation.d.ts +63 -0
  165. package/dist/components/charts/shared/gradient.d.ts +16 -0
  166. package/dist/components/charts/shared/hatchFill.d.ts +15 -0
  167. package/dist/components/charts/shared/hooks.d.ts +4 -4
  168. package/dist/components/charts/shared/legendUtils.d.ts +1 -0
  169. package/dist/components/charts/shared/streamPropsHelpers.d.ts +3 -1
  170. package/dist/components/charts/shared/styleRules.d.ts +9 -2
  171. package/dist/components/charts/shared/styleRulesWireSchema.d.ts +353 -0
  172. package/dist/components/charts/shared/types.d.ts +26 -10
  173. package/dist/components/charts/shared/useChartLegend.d.ts +43 -9
  174. package/dist/components/charts/shared/useChartSetup.d.ts +3 -1
  175. package/dist/components/charts/shared/useCustomChartSetup.d.ts +5 -2
  176. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +5 -1
  177. package/dist/components/charts/shared/useOrdinalBrush.d.ts +3 -3
  178. package/dist/components/charts/shared/useStreamingLegend.d.ts +6 -1
  179. package/dist/components/charts/value/types.d.ts +1 -1
  180. package/dist/components/charts/xy/BubbleChart.d.ts +1 -1
  181. package/dist/components/charts/xy/BumpChart.capability.d.ts +14 -1
  182. package/dist/components/charts/xy/BumpChart.d.ts +13 -73
  183. package/dist/components/charts/xy/BumpChart.semanticViability.d.ts +5 -0
  184. package/dist/components/charts/xy/CandlestickChart.d.ts +2 -2
  185. package/dist/components/charts/xy/LineChart.d.ts +2 -2
  186. package/dist/components/charts/xy/Scatterplot.d.ts +1 -1
  187. package/dist/components/charts/xy/bumpData.d.ts +44 -0
  188. package/dist/components/charts/xy/bumpIdentity.d.ts +2 -0
  189. package/dist/components/charts/xy/bumpLayout.d.ts +45 -0
  190. package/dist/components/charts/xy/bumpTooltip.d.ts +20 -0
  191. package/dist/components/legendLayout.d.ts +131 -4
  192. package/dist/components/realtime/ReorderBuffer.d.ts +2 -0
  193. package/dist/components/realtime/types.d.ts +10 -1
  194. package/dist/components/recipes/balanceSnapshotsToFlows.d.ts +42 -0
  195. package/dist/components/recipes/directedReachability.d.ts +14 -0
  196. package/dist/components/recipes/gofishDisplayListFixtures.generated.d.ts +6 -6
  197. package/dist/components/recipes/gridObservatory.d.ts +1 -1
  198. package/dist/components/recipes/networkAnalysis.d.ts +1 -18
  199. package/dist/components/recipes/physics.d.ts +7 -4
  200. package/dist/components/recipes/processPhysics.d.ts +0 -1
  201. package/dist/components/recipes/waffle.d.ts +7 -4
  202. package/dist/components/semiotic-ai-core.d.ts +13 -4
  203. package/dist/components/semiotic-ai-observations.d.ts +3 -0
  204. package/dist/components/semiotic-ai.d.ts +16 -9
  205. package/dist/components/semiotic-client-shared.d.ts +10 -0
  206. package/dist/components/semiotic-experimental.d.ts +1 -1
  207. package/dist/components/semiotic-geo.d.ts +4 -1
  208. package/dist/components/semiotic-network.d.ts +7 -4
  209. package/dist/components/semiotic-ordinal.d.ts +4 -1
  210. package/dist/components/semiotic-physics.d.ts +11 -4
  211. package/dist/components/semiotic-realtime-core.d.ts +11 -4
  212. package/dist/components/semiotic-realtime-react.d.ts +4 -3
  213. package/dist/components/semiotic-realtime.d.ts +3 -1
  214. package/dist/components/semiotic-recipes-core.d.ts +7 -5
  215. package/dist/components/semiotic-server-edge.d.ts +3 -2
  216. package/dist/components/semiotic-server.d.ts +3 -2
  217. package/dist/components/semiotic-themes-core.d.ts +5 -48
  218. package/dist/components/semiotic-utils-core.d.ts +11 -5
  219. package/dist/components/semiotic-utils-react.d.ts +2 -0
  220. package/dist/components/semiotic-xy.d.ts +4 -1
  221. package/dist/components/semiotic.d.ts +68 -25
  222. package/dist/components/server/animatedGif.d.ts +1 -1
  223. package/dist/components/server/renderEvidence.d.ts +25 -2
  224. package/dist/components/server/renderToStaticSVG.d.ts +15 -7
  225. package/dist/components/server/serverChartConfigShared.d.ts +8 -1
  226. package/dist/components/server/serverChartConfigs.d.ts +1 -0
  227. package/dist/components/server/serverChartConfigsNetwork.d.ts +3 -3
  228. package/dist/components/server/serverChartConfigsNetworkChord.d.ts +2 -0
  229. package/dist/components/server/serverChartConfigsNetworkForce.d.ts +2 -0
  230. package/dist/components/server/serverChartConfigsNetworkHierarchy.d.ts +3 -0
  231. package/dist/components/server/serverChartConfigsXY.d.ts +3 -3
  232. package/dist/components/server/serverChartConfigsXYBubble.d.ts +5 -0
  233. package/dist/components/server/serverChartConfigsXYBump.d.ts +7 -0
  234. package/dist/components/server/serverChartConfigsXYScatter.d.ts +5 -0
  235. package/dist/components/server/staticAnnotationFallbacks.d.ts +10 -0
  236. package/dist/components/server/staticAnnotations.d.ts +28 -1
  237. package/dist/components/server/staticAxisTickLabel.d.ts +13 -0
  238. package/dist/components/server/staticLegend.d.ts +1 -1
  239. package/dist/components/server/staticLegendMargin.d.ts +41 -0
  240. package/dist/components/server/staticOrdinal.d.ts +8 -2
  241. package/dist/components/server/staticPhysics.d.ts +13 -1
  242. package/dist/components/server/staticPhysicsChrome.d.ts +20 -0
  243. package/dist/components/server/staticRawLegend.d.ts +15 -0
  244. package/dist/components/server/staticSVGChrome.d.ts +16 -55
  245. package/dist/components/server/staticXYAxes.d.ts +27 -0
  246. package/dist/components/server/staticXYAxisTicks.d.ts +39 -0
  247. package/dist/components/server/staticXYGrid.d.ts +11 -0
  248. package/dist/components/server/themeResolver.d.ts +5 -1
  249. package/dist/components/store/ThemeStore.d.ts +2 -98
  250. package/dist/components/store/designTokens.d.ts +1 -1
  251. package/dist/components/store/themeCSSVariables.d.ts +10 -0
  252. package/dist/components/store/themeCore.d.ts +91 -0
  253. package/dist/components/store/themePresets.d.ts +81 -0
  254. package/dist/components/store/themeSerialization.d.ts +2 -1
  255. package/dist/components/stream/AccessibleDataTable.d.ts +12 -14
  256. package/dist/components/stream/AccessibleTablePortalImpl.d.ts +6 -0
  257. package/dist/components/stream/GeoTileRenderer.d.ts +3 -0
  258. package/dist/components/stream/NetworkCanvasHitTester.d.ts +3 -1
  259. package/dist/components/stream/NetworkSSRFrame.d.ts +2 -1
  260. package/dist/components/stream/NetworkSVGOverlay.d.ts +3 -31
  261. package/dist/components/stream/OrdinalCanvasHitTester.d.ts +2 -0
  262. package/dist/components/stream/SVGChartTitle.d.ts +9 -0
  263. package/dist/components/stream/SVGOverlay.d.ts +1 -21
  264. package/dist/components/stream/SVGUnderlay.d.ts +24 -0
  265. package/dist/components/stream/SceneToSVG.d.ts +1 -1
  266. package/dist/components/stream/StreamGeoFrame.d.ts +1 -1
  267. package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -1
  268. package/dist/components/stream/StreamXYFrame.d.ts +1 -1
  269. package/dist/components/stream/accessibleDataRows.d.ts +11 -0
  270. package/dist/components/stream/accessibleDataTableModel.d.ts +40 -0
  271. package/dist/components/stream/accessibleTableTypes.d.ts +11 -0
  272. package/dist/components/stream/axisTickUtils.d.ts +19 -0
  273. package/dist/components/stream/canvasBackground.d.ts +10 -0
  274. package/dist/components/stream/canvasSetup.d.ts +24 -4
  275. package/dist/components/stream/frameCursorInteraction.d.ts +25 -0
  276. package/dist/components/stream/frameDefaultMargins.d.ts +37 -0
  277. package/dist/components/stream/frameGraphics.d.ts +18 -0
  278. package/dist/components/stream/frameGraphicsSubscription.d.ts +26 -0
  279. package/dist/components/stream/frameLegendOptions.d.ts +18 -0
  280. package/dist/components/stream/geoFrameCursorInteraction.d.ts +9 -0
  281. package/dist/components/stream/geoFrameHelpers.d.ts +29 -1
  282. package/dist/components/stream/geoTypes.d.ts +12 -11
  283. package/dist/components/stream/hitTarget.d.ts +61 -2
  284. package/dist/components/stream/moduleWorkerSession.d.ts +6 -0
  285. package/dist/components/stream/networkAnnotationAnchors.d.ts +37 -0
  286. package/dist/components/stream/networkCustomLayout.d.ts +2 -2
  287. package/dist/components/stream/networkFrameCursorInteraction.d.ts +12 -0
  288. package/dist/components/stream/networkFrameInteraction.d.ts +2 -0
  289. package/dist/components/stream/networkFramePaint.d.ts +15 -0
  290. package/dist/components/stream/networkPipelineConfig.d.ts +1 -1
  291. package/dist/components/stream/networkTypes.d.ts +32 -32
  292. package/dist/components/stream/normalizeXYData.d.ts +7 -0
  293. package/dist/components/stream/ordinalFrameCursorInteraction.d.ts +7 -0
  294. package/dist/components/stream/ordinalFrameInteraction.d.ts +29 -0
  295. package/dist/components/stream/ordinalSceneSVG.d.ts +10 -0
  296. package/dist/components/stream/ordinalTypes.d.ts +12 -4
  297. package/dist/components/stream/physics/PhysicsBodySpatialIndex.d.ts +9 -1
  298. package/dist/components/stream/physics/PhysicsCanvasTheme.d.ts +25 -0
  299. package/dist/components/stream/physics/PhysicsControllers.d.ts +0 -3
  300. package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +4 -1
  301. package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +3 -24
  302. package/dist/components/stream/physics/PhysicsSettledSVG.d.ts +9 -21
  303. package/dist/components/stream/physics/PhysicsSettledSVGElement.d.ts +37 -0
  304. package/dist/components/stream/physics/PhysicsSettledScene.d.ts +7 -3
  305. package/dist/components/stream/physics/StreamPhysicsFrame.d.ts +1 -1
  306. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +25 -4
  307. package/dist/components/stream/physics/physicsAnnotationContext.d.ts +19 -0
  308. package/dist/components/stream/physics/physicsBodyCanvas.d.ts +4 -0
  309. package/dist/components/stream/physics/physicsSettledChrome.d.ts +7 -0
  310. package/dist/components/stream/physics/usePhysicsCanvasPointer.d.ts +32 -0
  311. package/dist/components/stream/physics/usePhysicsSemanticNavigation.d.ts +36 -0
  312. package/dist/components/stream/pipelineConfig.d.ts +8 -17
  313. package/dist/components/stream/pipelineDomainResolution.d.ts +2 -2
  314. package/dist/components/stream/renderBackend.d.ts +2 -0
  315. package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +13 -2
  316. package/dist/components/stream/renderers/resolveCSSColor.d.ts +7 -0
  317. package/dist/components/stream/responsiveSize.d.ts +17 -0
  318. package/dist/components/stream/sceneCursor.d.ts +41 -0
  319. package/dist/components/stream/sceneRevisionDiagnostics.d.ts +1 -1
  320. package/dist/components/stream/svgOverlayUtils.d.ts +22 -1
  321. package/dist/components/stream/types.d.ts +33 -13
  322. package/dist/components/stream/useCanvasFrameHost.d.ts +12 -1
  323. package/dist/components/stream/useFrame.d.ts +24 -1
  324. package/dist/components/stream/useResponsiveSize.d.ts +6 -1
  325. package/dist/components/stream/useStalenessCheck.d.ts +1 -1
  326. package/dist/components/stream/xyFrameAxisTypes.d.ts +20 -4
  327. package/dist/components/stream/xyFrameCursorInteraction.d.ts +6 -0
  328. package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +1 -1
  329. package/dist/components/stream/xySceneBuilders/types.d.ts +6 -26
  330. package/dist/components/types/legendTypes.d.ts +6 -0
  331. package/dist/components/types/marginType.d.ts +7 -8
  332. package/dist/controls.min.js +1 -1
  333. package/dist/controls.module.min.js +1 -1
  334. package/dist/forceLayoutWorker.js +1 -1
  335. package/dist/geo.min.js +1 -1
  336. package/dist/geo.module.min.js +1 -1
  337. package/dist/network.min.js +1 -1
  338. package/dist/network.module.min.js +1 -1
  339. package/dist/ordinal.min.js +1 -1
  340. package/dist/ordinal.module.min.js +1 -1
  341. package/dist/physics-matter.module.min.js +1 -1
  342. package/dist/physics-rapier.module.min.js +1 -1
  343. package/dist/physics.min.js +1 -1
  344. package/dist/physics.module.min.js +1 -1
  345. package/dist/physicsWorker.js +1 -1
  346. package/dist/processSankeyLayoutWorker.js +1 -1
  347. package/dist/realtime.min.js +1 -1
  348. package/dist/realtime.module.min.js +1 -1
  349. package/dist/rough.min.js +1 -1
  350. package/dist/rough.module.min.js +1 -1
  351. package/dist/semiotic-ai-core.d.ts +13 -4
  352. package/dist/semiotic-ai-core.min.js +1 -1
  353. package/dist/semiotic-ai-core.module.min.js +1 -1
  354. package/dist/semiotic-ai.d.ts +16 -9
  355. package/dist/semiotic-ai.min.js +1 -1
  356. package/dist/semiotic-ai.module.min.js +1 -1
  357. package/dist/semiotic-client-cjs-shared.min.js +1 -0
  358. package/dist/semiotic-client-glyph.module.min.js +2 -0
  359. package/dist/semiotic-client-responsive.module.min.js +2 -0
  360. package/dist/semiotic-client-shared.module.min.js +2 -0
  361. package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +2 -0
  362. package/dist/semiotic-data.min.js +1 -1
  363. package/dist/semiotic-data.module.min.js +1 -1
  364. package/dist/semiotic-experimental-auxiliary.module.min.js +2 -0
  365. package/dist/semiotic-experimental-node-auxiliary.module.min.js +2 -0
  366. package/dist/semiotic-experimental-node.module.min.js +2 -0
  367. package/dist/semiotic-experimental-react-shared.module.min.js +2 -0
  368. package/dist/semiotic-experimental-vacp.min.js +1 -1
  369. package/dist/semiotic-experimental-vacp.module.min.js +1 -1
  370. package/dist/semiotic-experimental.d.ts +1 -1
  371. package/dist/semiotic-experimental.min.js +1 -1
  372. package/dist/semiotic-experimental.module.min.js +1 -1
  373. package/dist/semiotic-geo.d.ts +4 -1
  374. package/dist/semiotic-network.d.ts +7 -4
  375. package/dist/semiotic-ordinal.d.ts +4 -1
  376. package/dist/semiotic-physics.d.ts +11 -4
  377. package/dist/semiotic-realtime-core.d.ts +11 -4
  378. package/dist/semiotic-realtime-core.min.js +2 -1
  379. package/dist/semiotic-realtime-core.module.min.js +2 -1
  380. package/dist/semiotic-realtime-react.d.ts +4 -3
  381. package/dist/semiotic-realtime-react.min.js +1 -1
  382. package/dist/semiotic-realtime-react.module.min.js +1 -1
  383. package/dist/semiotic-realtime.d.ts +3 -1
  384. package/dist/semiotic-recipes-core-cjs-base.min.js +1 -0
  385. package/dist/semiotic-recipes-core.d.ts +7 -5
  386. package/dist/semiotic-recipes-core.min.js +9 -1
  387. package/dist/semiotic-recipes-core.module.min.js +1 -1
  388. package/dist/semiotic-recipes-geo-cjs.min.js +1 -0
  389. package/dist/semiotic-recipes-react.min.js +1 -1
  390. package/dist/semiotic-recipes-react.module.min.js +1 -1
  391. package/dist/semiotic-recipes.min.js +7 -1
  392. package/dist/semiotic-recipes.module.min.js +2 -1
  393. package/dist/semiotic-server-edge-node.module.min.js +1 -0
  394. package/dist/semiotic-server-edge.d.ts +3 -2
  395. package/dist/semiotic-server-edge.min.js +1 -1
  396. package/dist/semiotic-server-edge.module.min.js +1 -1
  397. package/dist/semiotic-server-node.min.js +1 -1
  398. package/dist/semiotic-server-node.module.min.js +1 -1
  399. package/dist/semiotic-server.d.ts +3 -2
  400. package/dist/semiotic-themes-core.d.ts +5 -48
  401. package/dist/semiotic-themes-core.min.js +1 -1
  402. package/dist/semiotic-themes-core.module.min.js +1 -1
  403. package/dist/semiotic-themes-react.min.js +1 -1
  404. package/dist/semiotic-themes-react.module.min.js +1 -1
  405. package/dist/semiotic-themes.min.js +1 -1
  406. package/dist/semiotic-themes.module.min.js +1 -1
  407. package/dist/semiotic-utils-core.d.ts +11 -5
  408. package/dist/semiotic-utils-core.min.js +1 -1
  409. package/dist/semiotic-utils-core.module.min.js +1 -1
  410. package/dist/semiotic-utils-react.d.ts +2 -0
  411. package/dist/semiotic-utils-react.min.js +1 -1
  412. package/dist/semiotic-utils-react.module.min.js +1 -1
  413. package/dist/semiotic-utils.min.js +2 -1
  414. package/dist/semiotic-utils.module.min.js +2 -1
  415. package/dist/semiotic-value.min.js +1 -1
  416. package/dist/semiotic-value.module.min.js +1 -1
  417. package/dist/semiotic-xy.d.ts +4 -1
  418. package/dist/semiotic.d.ts +68 -25
  419. package/dist/semiotic.min.js +1 -1
  420. package/dist/semiotic.module.min.js +1 -1
  421. package/dist/server.min.js +1 -1
  422. package/dist/server.module.min.js +1 -1
  423. package/dist/xy.min.js +1 -1
  424. package/dist/xy.module.min.js +1 -1
  425. package/package.json +53 -19
  426. package/dist/__tests__/scenarios/mcpProtocolTypes.d.ts +0 -20
  427. package/dist/chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js +0 -2
  428. package/dist/chunk-XYBrushOverlay-ECZJJLAJ.module.min.js +0 -1
  429. package/dist/chunk-XYBrushOverlay-EP2SV3UI.module.min.js +0 -2
  430. package/dist/chunk-chartContainerDataAudit-IQ3NBN3Q.module.min.js +0 -2
  431. package/dist/chunk-chunk-2B3AIKUZ.module.min.js +0 -2
  432. package/dist/chunk-chunk-2CXCXRB4.module.min.js +0 -1
  433. package/dist/chunk-chunk-3GCILWPB.module.min.js +0 -2
  434. package/dist/chunk-chunk-46KRGJQP.module.min.js +0 -1
  435. package/dist/chunk-chunk-4ITOQRXM.module.min.js +0 -2
  436. package/dist/chunk-chunk-4MLLQUGW.module.min.js +0 -2
  437. package/dist/chunk-chunk-57RBPDBQ.module.min.js +0 -2
  438. package/dist/chunk-chunk-5UKL5W76.module.min.js +0 -2
  439. package/dist/chunk-chunk-5VVNW5AZ.module.min.js +0 -1
  440. package/dist/chunk-chunk-66PCWJUG.module.min.js +0 -1
  441. package/dist/chunk-chunk-6V5VQVCT.module.min.js +0 -2
  442. package/dist/chunk-chunk-7LE56WAE.module.min.js +0 -2
  443. package/dist/chunk-chunk-7T25U75Z.module.min.js +0 -2
  444. package/dist/chunk-chunk-ACLDBMRH.module.min.js +0 -2
  445. package/dist/chunk-chunk-AF53TBSN.module.min.js +0 -2
  446. package/dist/chunk-chunk-BTZYH2IE.module.min.js +0 -1
  447. package/dist/chunk-chunk-BWV55BZK.module.min.js +0 -2
  448. package/dist/chunk-chunk-BZNOAHJV.module.min.js +0 -2
  449. package/dist/chunk-chunk-CD6PVVS3.module.min.js +0 -2
  450. package/dist/chunk-chunk-DTSNLGRK.module.min.js +0 -2
  451. package/dist/chunk-chunk-FC3NZWYR.module.min.js +0 -2
  452. package/dist/chunk-chunk-FEPXDKJP.module.min.js +0 -1
  453. package/dist/chunk-chunk-FJ76HWQZ.module.min.js +0 -1
  454. package/dist/chunk-chunk-FRGBMTZR.module.min.js +0 -1
  455. package/dist/chunk-chunk-G75OPF5N.module.min.js +0 -2
  456. package/dist/chunk-chunk-H5IFO6CU.module.min.js +0 -2
  457. package/dist/chunk-chunk-HADHLMY5.module.min.js +0 -1
  458. package/dist/chunk-chunk-HBFA4NN6.module.min.js +0 -1
  459. package/dist/chunk-chunk-HCNDE26Q.module.min.js +0 -2
  460. package/dist/chunk-chunk-IY7RYD4S.module.min.js +0 -1
  461. package/dist/chunk-chunk-J3QOW4OE.module.min.js +0 -0
  462. package/dist/chunk-chunk-J3XWETBJ.module.min.js +0 -2
  463. package/dist/chunk-chunk-JJ4BSUYL.module.min.js +0 -2
  464. package/dist/chunk-chunk-JRHXQGEV.module.min.js +0 -2
  465. package/dist/chunk-chunk-KTWEBFMX.module.min.js +0 -2
  466. package/dist/chunk-chunk-L6FFYGYS.module.min.js +0 -1
  467. package/dist/chunk-chunk-LJDH3WV3.module.min.js +0 -2
  468. package/dist/chunk-chunk-LSJUXBMF.module.min.js +0 -1
  469. package/dist/chunk-chunk-N3Q33XCB.module.min.js +0 -2
  470. package/dist/chunk-chunk-NWIGA3UK.module.min.js +0 -1
  471. package/dist/chunk-chunk-OG3TTJGJ.module.min.js +0 -2
  472. package/dist/chunk-chunk-OZK46A5U.module.min.js +0 -1
  473. package/dist/chunk-chunk-PMR47KRY.module.min.js +0 -2
  474. package/dist/chunk-chunk-Q2YADC2V.module.min.js +0 -2
  475. package/dist/chunk-chunk-QQJNG23C.module.min.js +0 -2
  476. package/dist/chunk-chunk-RGJ6TKAH.module.min.js +0 -2
  477. package/dist/chunk-chunk-ROP4HI7H.module.min.js +0 -2
  478. package/dist/chunk-chunk-SFLUSZ73.module.min.js +0 -2
  479. package/dist/chunk-chunk-TCMHJWFJ.module.min.js +0 -1
  480. package/dist/chunk-chunk-TSCFL235.module.min.js +0 -1
  481. package/dist/chunk-chunk-U66USBWU.module.min.js +0 -1
  482. package/dist/chunk-chunk-UEZ6SHW5.module.min.js +0 -2
  483. package/dist/chunk-chunk-UOQRPGPK.module.min.js +0 -2
  484. package/dist/chunk-chunk-VUWYT7DY.module.min.js +0 -2
  485. package/dist/chunk-chunk-W5HWGQMD.module.min.js +0 -2
  486. package/dist/chunk-chunk-WFHZHWT7.module.min.js +0 -1
  487. package/dist/chunk-chunk-WGROBM3I.module.min.js +0 -2
  488. package/dist/chunk-chunk-WSDJFBKX.module.min.js +0 -2
  489. package/dist/chunk-chunk-YHNZCPOZ.module.min.js +0 -2
  490. package/dist/chunk-chunk-YWZB3KPI.module.min.js +0 -2
  491. package/dist/chunk-statisticalOverlays-HMYYSGPE.module.min.js +0 -2
  492. package/dist/components/stream/test-utils/frameScheduler.d.ts +0 -12
  493. package/dist/components/stream/test-utils/revisionConsumption.d.ts +0 -13
  494. package/dist/test-utils/canvasMock.d.ts +0 -86
  495. package/dist/test-utils/capturedFrameProps.d.ts +0 -67
  496. package/dist/test-utils/frameMock.d.ts +0 -81
  497. package/dist/test-utils/ordinalFixtures.d.ts +0 -48
  498. /package/dist/{chunk-chunk-JJ2OOIET.module.min.js → c-GGISSW5E.min.js} +0 -0
  499. /package/dist/{chunk-chunk-SIRIJ3DY.module.min.js → c-N4G2L7ID.min.js} +0 -0
  500. /package/dist/{chunk-chunk-CA3YDW6F.module.min.js → c-S6U5CGT5.min.js} +0 -0
  501. /package/dist/components/recipes/{mobileAnnotationStrategy.d.ts → mobileAnnotationBehavior.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ import{buildRegressionAnnotation as e}from"./c-SLGMUBUL.min.js";import{validateArrayData as t}from"./c-RSVIHIQ4.min.js";import{useStreamingLegend as o}from"./c-M4Y3BHFR.min.js";import{DataSourceAdapter as i,IncrementalExtent as n,barCanvasRenderer as r,buildEnrichAnnotationData as a,buildRectNode as s,normalizeColorGradient as l,normalizeGradient as c,ordinalFrameLegendOptions as h,resolveAnnotationAccessor as d,snapOrdinalIntroTargets as u,ticksForMode as m,toIdSet as g}from"./c-C25ENHIK.min.js";import{AXIS_FRAME_DEFAULT_MARGIN as p,accessorsEquivalent as f,resolveAccessor as y,resolveStringAccessor as v,symbolCanvasRenderer as b}from"./c-RR3GO5SW.min.js";import{mergeShapeStyle as x,useChartSetup as w,useCustomChartSetup as A,useFrameImperativeHandle as S,useResolvedSelection as k}from"./c-3KZD6AXJ.min.js";import{RingBuffer as C,compactTimestampBufferForRemoval as _,computePulseIntensity as R,createTimestampBufferForData as P,ensureRingBufferCapacity as L,hasActivePulses as M,pointCanvasRenderer as I,pushWithTimestamp as T,refreshIdlePulse as H,setPulseState as B,useLegendCategoryEmission as O,useOrdinalKeyboardNavigation as D,useSemanticFrameInteractions as F}from"./c-MG5DM6VE.min.js";import{StalenessBadge as E,attachUpdateResultStore as N,buildBaseMetadataProps as j,buildCustomBehaviorProps as W,buildDatumIndexMap as z,buildOrdinalTooltip as $,buildTooltipProps as G,composeOverlays as V,computeDecayOpacity as q,createCustomLayoutFailureDiagnostic as X,filterAnnotationsByStatus as Y,findHitPointInQuadtree as Q,getHitRadius as K,glyphCanvasRenderer as Z,hitTestRect as U,normalizeAngle as J,paintSceneWithBackend as ee,renderPathPulse as te,renderSceneListWithBackend as oe,resolveFrameGraphics as ie,shouldHandleFramePointer as ne,useConfigSync as re,useLayoutSelectionSync as ae,useStableShallow as se,useStalenessCheck as le,warnCustomLayoutDiagnostics as ce}from"./c-GPYOFETM.min.js";import{wrapWithCustomLayoutSelection as he}from"./c-G36WS6LN.min.js";import{makeRuleValueResolver as de,resolveStyleRules as ue}from"./c-S2BXNNJN.min.js";import{buildResolveColor as me,resolveCustomLayoutPalette as ge}from"./c-J5G56TUH.min.js";import{AccessibleDataTable as pe,AccessibleTablePortal as fe,AriaLiveTooltip as ye,CanvasFrameBackground as ve,ChartError as be,FlippingTooltip as xe,FocusRing as we,STREAMING_PALETTE as Ae,SVGChartTitle as Se,SafeRender as ke,SceneRevisionDiagnosticsObserver as Ce,ScreenReaderSummary as _e,SkipToTableLink as Re,UpdateResultTracker as Pe,annotationLayout as Le,annularSectorPath as Me,buildGaugeGradientGeometry as Ie,buildHoverData as Te,coerceCanvasFill as He,computeCanvasAriaLabel as Be,computeEasing as Oe,computeRawProgress as De,createDefaultAnnotationRules as Fe,createHatchPattern as Ee,defaultTooltipStyle as Ne,filterSparseArray as je,getColor as We,getDevicePixelRatio as ze,getSize as $e,glyphHitGeometry as Ge,hatchPatternDef as Ve,interpolateBrBG as qe,interpolatePRGn as Xe,interpolatePiYG as Ye,interpolateRdBu as Qe,interpolateRdYlBu as Ke,interpolateRdYlGn as Ze,interpolateSpectral as Ue,isAnnotationActivationTarget as Je,isHatchFill as et,isServerEnvironment as tt,lerp as ot,makeSymbolResolver as it,normalizeLinkedBrush as nt,normalizeTooltip as rt,now as at,observationInputType as st,ordinalSceneNodeToSVG as lt,parseCanvasColor as ct,rehitCanvasMarkCursor as ht,renderAnnotationPass as dt,renderEmptyState as ut,renderLegendFromConfig as mt,renderLoadingState as gt,resolveCSSColor as pt,resolveCanvasFill as ft,resolveDefaultFill as yt,resolveExplicitColor as vt,resolveLegendSideGutter as bt,resolveOrdinalAxisChrome as xt,safeSvgId as wt,sceneMarkCursor as At,setCanvasMarkCursor as St,smartTooltipEntries as kt,svgFill as Ct,symbolRadius as _t,syncCanvasMarkCursor as Rt,useAnnotationActivationOptions as Pt,useBrushSelection as Lt,useCanvasMarkCursorCleanup as Mt,useChartMode as It,useChartSelection as Tt,useFrame as Ht,useFrameCanvasHost as Bt,useHydration as Ot,useSceneRevisionDiagnostics as Dt,useSortedData as Ft,useThemeCategorical as Et,useThemeDiverging as Nt,useWasHydratingFromSSR as jt,warnMissingField as Wt,withSceneMarkCursor as zt,wrapStyleWithSelection as $t}from"./c-GIKRQI4X.min.js";import{resolveThemeSemanticColors as Gt}from"./c-YDAY2WFR.min.js";import{getMax as Vt,getMinMax as qt}from"./c-WJCD5EUY.min.js";import{forwardRef as Xt,memo as Yt,useCallback as Qt,useEffect as Kt,useImperativeHandle as Zt,useMemo as Ut,useRef as Jt,useState as eo}from"react";import{scaleBand as to,scaleLinear as oo}from"d3-scale";var io=class{constructor(){this.colorSchemeMap=new Map,this.colorSchemeIndex=0}resetColors(){this.colorSchemeMap.clear(),this.colorSchemeIndex=0}resolvePieceStyle(e,t,o){if(t&&"function"==typeof e.pieceStyle){const i=e.pieceStyle(t,o);return i&&!i.fill&&o?{...i,fill:this.getColorFromScheme(e,o)}:i}return e.pieceStyle&&"object"==typeof e.pieceStyle?e.pieceStyle:e.barColors&&o?{fill:vt(e.barColors,o)??"#007bff"}:{fill:o?this.getColorFromScheme(e,o):"#007bff"}}resolveSummaryStyle(e,t,o){return t&&"function"==typeof e.summaryStyle?e.summaryStyle(t,o):e.summaryStyle&&"object"==typeof e.summaryStyle?e.summaryStyle:{fill:"#007bff",fillOpacity:.6,stroke:"#007bff",strokeWidth:1}}getColorFromScheme(e,t){const o=this.colorSchemeMap.get(t);if(o)return o;const i=Array.isArray(e.colorScheme)?e.colorScheme:e.themeCategorical||Ae,n=i[this.colorSchemeIndex%i.length];return this.colorSchemeIndex++,this.colorSchemeMap.set(t,n),n}};function no(e,t,o){const i="function"==typeof e?e(o?t.w:t.h):e;return"number"==typeof i&&Number.isFinite(i)?Math.max(0,i):0}function ro(e){const t=e.getSymbol;return t?it(t,e.config.symbolMap):null}function ao(e,t,o,i,n,r,a){e.push(t?{type:"symbol",x:i,y:n,size:Math.PI*r*r,symbolType:t(o),style:a,datum:o}:{type:"point",x:i,y:n,r:r,style:a,datum:o})}function so(e,t){const{columns:o,config:i,resolvePieceStyle:n}=e,r=[],a=Math.min(t.width,t.height)/2-4,s="donut"===i.chartType?i.innerRadius||60:0,l=-Math.PI/2+(i.startAngle||0)*Math.PI/180,c=null!=i.sweepAngle?i.sweepAngle*Math.PI/180:2*Math.PI,h=null!=i.sweepAngle&&360>i.sweepAngle,d=Object.values(o),u=d.some(e=>{const t=e.pieceData[0];return t&&("number"==typeof t._pct||"number"==typeof t._pctStart||null!=t._roundedEnds)}),m=h&&!u&&d.length>1&&(i.cornerRadius??0)>0;for(let e=0;d.length>e;e++){const t=d[e],o=t.pieceData[0],h="number"==typeof o?._pctStart?o._pctStart:t.pctStart,u=l+h*c,g=l+(h+("number"==typeof o?._pct?o._pct:t.pct))*c,p=n(t.pieceData[0],t.name),f=0===e,y=e===d.length-1,v={type:"wedge",cx:0,cy:0,innerRadius:s,outerRadius:a,startAngle:u,endAngle:g,...i.cornerRadius&&{cornerRadius:i.cornerRadius},style:p,datum:o?._nonInteractive?null:t.pieceData,category:t.name};o?._roundedEnds?v.roundedEnds=o._roundedEnds:m&&(v.roundedEnds={start:f,end:y}),o?._gradientBand&&(v._gradientBand=o._gradientBand),r.push(v)}return r}import{quantile as lo}from"d3-array";function co(e){const t=e.length,o=e[0],i=e[t-1];return{n:t,min:o,q1:lo(e,.25)??o,median:lo(e,.5)??(o+i)/2,q3:lo(e,.75)??i,max:i,mean:e.reduce((e,t)=>e+t,0)/t}}import{scaleLinear as ho}from"d3-scale";var uo={bar:function(e,t){const{scales:o,columns:i,config:n,getR:r,getStack:a,resolvePieceStyle:l}=e,{r:c,projection:h}=o,d=[],u="vertical"===h,m="horizontal"===h,g=n.normalize,p=[];if(a){const e=new Set;for(const t of Object.values(i))for(const o of t.pieceData){const t=a(o);e.has(t)||(e.add(t),p.push(t))}}else p.push("_default");for(const e of Object.values(i)){const t=new Map;for(const o of e.pieceData){const e=a?a(o):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});const i=t.get(e);i.total+=r(o),i.pieces.push(o)}let o=0;if(g)for(const e of t.values())o+=Math.abs(e.total);let i=0,n=0;for(const r of p){const h=t.get(r);if(!h)continue;let p=h.total;g&&o>0&&(p/=o);const f=l(h.pieces[0],a?r:e.name),y={...h.pieces[0],__aggregateValue:h.total,__pieceCount:h.pieces.length,category:e.name};if(u){const t=c(0>p?n:i+p),o=0>p?c(n+p)-c(n):c(i)-c(i+p);d.push(s(e.x,t,e.width,Math.abs(o),f,y,r)),0>p?n+=p:i+=p}else if(m){const t=c(0>p?n+p:i),o=0>p?c(n)-c(n+p):c(i+p)-c(i);d.push(s(t,e.x,Math.abs(o),e.width,f,y,r)),0>p?n+=p:i+=p}}}const f="vertical"===h;for(const e of d){if("rect"!==e.type)continue;const t=e.datum?.__aggregateValue??0;e.roundedEdge=f?0>t?"bottom":"top":0>t?"left":"right",n.gradientFill&&(e.fillGradient=n.gradientFill)}if(void 0!==n.roundedTop){const e=new Map;for(const t of d){if("rect"!==t.type)continue;const o=t.datum?.category||"";e.has(o)||e.set(o,[]),e.get(o).push(t)}for(const t of e.values()){if(0===t.length)continue;const e=t.filter(e=>(e.datum?.__aggregateValue??0)>=0),o=t.filter(e=>0>(e.datum?.__aggregateValue??0));if(e.length>0){const t=e.reduce(f?(e,t)=>t.y>e.y?e:t:(e,t)=>e.x+e.w>t.x+t.w?e:t),o=no(n.roundedTop,t,f);o>0&&(t.roundedTop=o)}if(o.length>0){const e=o.reduce(f?(e,t)=>e.y+e.h>t.y+t.h?e:t:(e,t)=>t.x>e.x?e:t),t=no(n.roundedTop,e,f);t>0&&(e.roundedTop=t)}}}return d},clusterbar:function(e,t){const{scales:o,columns:i,config:n,getR:r,getGroup:a,resolvePieceStyle:l}=e,{r:c,projection:h}=o,d=[],u="vertical"===h,m=[],g=new Set;for(const e of Object.values(i))for(const t of e.pieceData){const e=a?a(t):"_default";g.has(e)||(g.add(e),m.push(e))}const p=m.length||1;for(const e of Object.values(i)){const t=e.width/p,o=.2*t,i=t-o,n=new Map;for(const t of e.pieceData){const e=a?a(t):"_default";n.has(e)||n.set(e,[]),n.get(e).push(t)}for(let a=0;m.length>a;a++){const h=n.get(m[a])||[];for(const n of h){const h=r(n),g=l(n,m[a]);if(u){const r=e.x+a*t+o/2,l=c(0),u=c(h);d.push(s(r,Math.min(l,u),i,Math.abs(l-u),g,n,m[a]))}else{const r=e.x+a*t+o/2,l=c(0),u=c(h);d.push(s(Math.min(l,u),r,Math.abs(u-l),i,g,n,m[a]))}}}}for(const e of d){if("rect"!==e.type)continue;if(null==e.datum)continue;const t=r(e.datum),o=no(n.roundedTop,e,u);o>0&&(e.roundedTop=o),e.roundedEdge=u?0>t?"bottom":"top":0>t?"left":"right",n.gradientFill&&(e.fillGradient=n.gradientFill)}return d},point:function(e,t){const{scales:o,columns:i,getR:n,multiScales:r,resolvePieceStyle:a}=e,{r:s,projection:l}=o,c=[],h="vertical"===l,d="radial"===l,u=r.length>0,m=ro(e),g=2*Math.PI,p=-Math.PI/2;for(const e of Object.values(i))for(const t of e.pieceData){const o=t.__rIndex??0,i=t.__rValue??n(t),l=u&&r[o]||s,f=a(t,e.name),y=f.r||5;let v,b;if(d){const t=p+(e.pctStart+e.pct/2)*g,o=l(i);v=Math.cos(t)*o,b=Math.sin(t)*o}else h?(v=e.middle,b=l(i)):(v=l(i),b=e.middle);ao(c,m,t,v,b,y,f)}return c},swarm:function(e,t){const{scales:o,columns:i,getR:n,resolvePieceStyle:r}=e,{r:a,projection:s}=o,l=[],c="vertical"===s,h=ro(e);for(const e of Object.values(i)){const t=e.width/2;for(let o=0;e.pieceData.length>o;o++){const i=e.pieceData[o],s=n(i),d=r(i,e.name),u=d.r||4,m=(7919*o%100/100-.5)*t*.8;ao(l,h,i,c?e.middle+m:a(s),c?a(s):e.middle+m,u,d)}}return l},pie:so,donut:so,boxplot:function(e,t){const{scales:o,columns:i,config:n,getR:r,resolveSummaryStyle:a}=e,{r:s,projection:l}=o,c=[],h="vertical"===l,d=!1!==n.showOutliers;for(const t of Object.values(i)){const o=t.pieceData.map(e=>r(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(0===o.length)continue;const i=o[0],n=o[o.length-1],l=lo(o,.25)??i,u=lo(o,.5)??(i+n)/2,m=lo(o,.75)??n,g=m-l,p=l-1.5*g,f=m+1.5*g,y=o.find(e=>e>=p)??i,v=[...o].reverse().find(e=>f>=e)??n,b=a(t.pieceData[0],t.name),x=[];if(d)for(const e of t.pieceData){const o=r(e);if(p>o||o>f){const i=h?t.middle:s(o),n=h?s(o):t.middle;x.push({px:i,py:n,value:o,datum:e})}}if(c.push({type:"boxplot",x:h?t.middle:0,y:h?0:t.middle,projection:h?"vertical":"horizontal",columnWidth:.6*t.width,minPos:s(y),q1Pos:s(l),medianPos:s(u),q3Pos:s(m),maxPos:s(v),stats:{n:o.length,min:y,q1:l,median:u,q3:m,max:v,mean:o.reduce((e,t)=>e+t,0)/o.length},style:b,datum:t.pieceData,category:t.name,outliers:x}),d)for(const t of x)c.push({type:"point",x:t.px,y:t.py,r:3,style:{fill:b.fill||e.config.themeSemantic?.secondary||"#999",opacity:.6,cursor:b.cursor},datum:t.datum})}return c},violin:function(e,t){const{scales:o,columns:i,config:n,getR:r,resolveSummaryStyle:a}=e,{r:s,projection:l}=o,c=[],h="vertical"===l,d=n.bins||20,u=!1!==n.showIQR;for(const e of Object.values(i)){const t=e.pieceData.map(e=>r(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(2>t.length)continue;const o=t[0],i=t[t.length-1],n=(i-o)/d||1,l=Array(d).fill(0);for(const e of t)l[Math.min(Math.floor((e-o)/n),d-1)]++;const m=Vt(l,1),g=e.width/2*.9;let p;if(h){p=`M ${e.middle} ${s(o)}`;for(let t=0;d>t;t++){const i=s(o+(t+.5)*n);p+=` L ${e.middle+l[t]/m*g} ${i}`}p+=` L ${e.middle} ${s(i)}`;for(let t=d-1;t>=0;t--){const i=s(o+(t+.5)*n);p+=` L ${e.middle-l[t]/m*g} ${i}`}p+=" Z"}else{p=`M ${s(o)} ${e.middle}`;for(let t=0;d>t;t++)p+=` L ${s(o+(t+.5)*n)} ${e.middle-l[t]/m*g}`;p+=` L ${s(i)} ${e.middle}`;for(let t=d-1;t>=0;t--)p+=` L ${s(o+(t+.5)*n)} ${e.middle+l[t]/m*g}`;p+=" Z"}const f=a(e.pieceData[0],e.name);let y;if(u&&t.length>=4){const n=lo(t,.25)??o,r=lo(t,.5)??(o+i)/2,a=lo(t,.75)??i;y={q1Pos:s(n),medianPos:s(r),q3Pos:s(a),centerPos:e.middle,isVertical:h}}const v=h?{x:e.x,y:Math.min(s(i),s(o)),width:e.width,height:Math.abs(s(i)-s(o))}:{x:Math.min(s(o),s(i)),y:e.x,width:Math.abs(s(i)-s(o)),height:e.width};c.push({type:"violin",pathString:p,translateX:0,translateY:0,bounds:v,iqrLine:y,stats:co(t),style:f,datum:e.pieceData,category:e.name})}return c},histogram:function(e,t){const{scales:o,columns:i,config:n,getR:r,resolveSummaryStyle:a}=e,{r:l}=o,c=[],h=n.bins||25,d=n.normalize,u=l.domain?.(),m=u?+u[0]:void 0,g=u?+u[1]:void 0;for(const e of Object.values(i)){const t=e.pieceData.map(e=>r(e)).filter(e=>null!=e&&!isNaN(e));if(0===t.length)continue;const[o,i]=qt(t),n=null!=m&&isFinite(m)?m:o,u=null!=g&&isFinite(g)?g:i,p=(u-n)/h||1,f=Array(h).fill(0);for(const e of t)n>e||e>u||f[Math.min(Math.floor((e-n)/p),h-1)]++;const y=t.length,v=Vt(f,1),b=a(e.pieceData[0],e.name);for(let t=0;h>t;t++){if(0===f[t])continue;const o=(d?f[t]/y:f[t]/v)*e.width*.9,i=l(n+t*p),r=l(n+(t+1)*p);c.push(s(Math.min(i,r),e.x+e.width-o,Math.abs(r-i),o,b,{bin:t,count:f[t],range:[n+t*p,n+(t+1)*p],category:e.name},e.name))}}return c},ridgeline:function(e,t){const{scales:o,columns:i,config:n,getR:r,resolveSummaryStyle:a}=e,{r:s,projection:l}=o,c=[],h=n.bins||20,d="horizontal"===l,u=n.amplitude||1.5;for(const e of Object.values(i)){const t=e.pieceData.map(e=>r(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(2>t.length)continue;const o=t[0],i=t[t.length-1],n=(i-o)/h||1,l=Array(h).fill(0);for(const e of t)o>e||e>i||l[Math.min(Math.floor((e-o)/n),h-1)]++;const m=Vt(l,1),g=a(e.pieceData[0],e.name),p=e.width*u;let f;if(d){const t=e.x+e.width;f=`M ${s(o)} ${t}`;for(let e=0;h>e;e++)f+=` L ${s(o+(e+.5)*n)} ${t-l[e]/m*p}`;f+=` L ${s(i)} ${t} Z`}else{const t=e.x;f=`M ${t} ${s(o)}`;for(let e=0;h>e;e++){const i=s(o+(e+.5)*n);f+=` L ${t+l[e]/m*p} ${i}`}f+=` L ${t} ${s(i)} Z`}const y=d?{x:Math.min(s(o),s(i)),y:e.x,width:Math.abs(s(i)-s(o)),height:e.width}:{x:e.x,y:Math.min(s(i),s(o)),width:e.width,height:Math.abs(s(i)-s(o))};c.push({type:"violin",pathString:f,translateX:0,translateY:0,bounds:y,stats:co(t),style:{...g,fillOpacity:g.fillOpacity??.5},datum:e.pieceData,category:e.name})}return c},timeline:function(e,t){const{scales:o,columns:i,getRawRange:n,resolvePieceStyle:r}=e,{r:a,projection:l}=o,c=[],h="horizontal"===l;for(const e of Object.values(i))for(const t of e.pieceData){const o=n(t);if(!o)continue;const[i,l]=o,d=r(t,e.name);if(h){const o=a(Math.min(i,l)),n=a(Math.max(i,l));c.push(s(o,e.x,n-o,e.width,d,t,e.name))}else{const o=a(Math.max(i,l)),n=a(Math.min(i,l));c.push(s(e.x,o,e.width,n-o,d,t,e.name))}}return c},funnel:function(e,t){const{columns:o,getR:i,getStack:n,resolvePieceStyle:r}=e,a=[],l=t.width/2,c=!1!==e.config.showLabels,h=e.scales.o.domain().map(e=>o[e]).filter(Boolean);if(0===h.length)return a;const d=[],u=new Set;for(const e of h)for(const t of e.pieceData){const e=n?n(t):"_default";u.has(e)||(u.add(e),d.push(e))}const m=d.length>1&&"_default"!==d[0],g=[];let p=0;for(const e of h){const t=new Map;let o=0;for(const r of e.pieceData){const e=n?n(r):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});const a=t.get(e),s=i(r);a.total+=s,a.pieces.push(r),o+=s}g.push({col:e,groups:t,stepTotal:o}),m||o>p&&(p=o)}if(m)for(const e of g){let t=0,o=0;for(let i=0;d.length>i;i++){const n=e.groups.get(d[i]);n&&(i%2==0?t+=n.total:o+=n.total)}const i=Math.max(t,o);i>p&&(p=i)}if(0===p)return a;const f=new Map;for(const e of d){const t=g[0].groups.get(e);f.set(e,t?.total??0)}const y=g[0].stepTotal,v=m?.95*l:.9*t.width,b=ho().domain([0,p]).range([0,v]),x=e.config.connectorOpacity??.3;let w=new Map;for(let t=0;g.length>t;t++){const o=g[t],i=o.col,n=0===t,h=i.width,u=.55*h,p=i.x+(h-u)/2,v=new Map;if(m){let e=0;for(const t of d){const i=o.groups.get(t);i&&(e+=b(i.total))}let t=l,h=l;for(let m=0;d.length>m;m++){const g=d[m],y=o.groups.get(g);if(!y)continue;const x=b(y.total),w=m%2==0,A=w?t:h-x;w?t+=x:h-=x;const S=r(y.pieces[0],g),k=f.get(g)??y.total,C={...y.pieces[0],__funnelValue:y.total,__funnelPercent:k>0?y.total/k*100:0,__funnelStep:i.name,__funnelIsFirstStep:n,__aggregateValue:y.total,__pieceCount:y.pieces.length,category:g};c&&(0===m&&(C.__funnelStepLabel=i.name,C.__funnelStepLabelX=l,C.__funnelStepLabelY=p,C.__funnelRowWidth=e),C.__funnelValueLabelX=A+x/2,C.__funnelValueLabelY=p,C.__funnelBarW=x),a.push(s(A,p,x,u,S,C,g)),v.set(g,{x:A,y:p,w:x,h:u})}}else{const e=o.stepTotal,t=b(e),h=l-t/2,m=d[0],g="_default"!==m,f=o.groups.get(m)?.pieces[0]??i.pieceData[0],x=g?m:i.name,w=r(f,x),A=y>0?e/y*100:0,S={...f,__funnelValue:e,__funnelPercent:A,__funnelStep:i.name,__funnelIsFirstStep:n,category:g?m:i.name};c&&(S.__funnelStepLabel=i.name,S.__funnelStepLabelX=l,S.__funnelStepLabelY=p,S.__funnelRowWidth=t,S.__funnelValueLabelX=l,S.__funnelValueLabelY=p,S.__funnelBarW=t),a.push(s(h,p,t,u,w,S,x)),v.set(m,{x:h,y:p,w:t,h:u})}if(t>0&&w.size>0){const t=m?d:[d[0]];for(const n of t){const t=w.get(n),s=v.get(n);if(!t||!s)continue;const l=(()=>{const e=o.groups.get(n);return r(e?e.pieces[0]:i.pieceData[0],"_default"===n?i.name:n)})(),c={type:"trapezoid",points:[[t.x,t.y+t.h],[t.x+t.w,t.y+t.h],[s.x+s.w,s.y],[s.x,s.y]],style:{fill:l.fill||e.config.themeSemantic?.secondary||"#999",opacity:x,cursor:l.cursor},datum:o.groups.get(n)?.pieces[0]??i.pieceData[0],category:"_default"===n?i.name:n};a.push(c)}}w=v}return a},"bar-funnel":function(e,t){const{columns:o,getR:i,getStack:n,resolvePieceStyle:r,scales:a}=e,l=[],c=a.o.domain().map(e=>o[e]).filter(Boolean);if(0===c.length)return l;const h=[],d=new Set;for(const e of c)for(const t of e.pieceData){const e=n?n(t):"_default";d.has(e)||(d.add(e),h.push(e))}const u=h.length>1&&"_default"!==h[0],m=[];for(const e of c){const t=new Map;let o=0;for(const r of e.pieceData){const e=n?n(r):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});const a=t.get(e),s=i(r);a.total+=s,a.pieces.push(r),o+=s}m.push({col:e,groups:t,stepTotal:o})}const g=new Map;for(const e of h){const t=m[0]?.groups.get(e);g.set(e,t?.total??0)}const p=a.r,f=u?h.length:1,y=u?.15:0;for(let e=0;m.length>e;e++){const t=m[e],o=t.col,i=0===e,n=e>0?m[e-1]:null,a=o.width/f,c=a*y,d=a-c;for(let e=0;h.length>e;e++){const m=h[e],f=t.groups.get(m);if(!f)continue;const y=f.total,v=g.get(m)??y,b=v>0?y/v*100:0,x=n?.groups.get(m),w=i?0:Math.max(0,(x?.total??y)-y),A=o.x+e*a+c/2,S=p(y),k=p(0)-S,C=r(f.pieces[0],u?m:o.name),_={...f.pieces[0],__barFunnelValue:y,__barFunnelPercent:b,__barFunnelIsFirstStep:i,__barFunnelIsDropoff:!1,__barFunnelStep:o.name,__barFunnelDropoffValue:w,__barFunnelCategory:"_default"===m?void 0:m,category:u?m:o.name,__barFunnelLabelX:A+d/2,__barFunnelLabelY:p(y+w)};if(l.push(s(A,S,d,k,C,_,u?m:o.name)),w>0){const e=p(y+w),t=S-e,i={...C},n={...f.pieces[0],__barFunnelValue:w,__barFunnelPercent:v>0?w/v*100:0,__barFunnelIsFirstStep:!1,__barFunnelIsDropoff:!0,__barFunnelStep:o.name,__barFunnelCategory:"_default"===m?void 0:m,category:u?m:o.name};l.push(s(A,e,d,t,i,n,u?m:o.name))}}}return l},swimlane:function(e,t){const{scales:o,columns:i,getR:n,getStack:r,resolvePieceStyle:a}=e,{r:l,projection:c}=o,h=[],d="horizontal"===c,u=e.config.gradientFill,m=d?"left":"bottom",g=new Map,p=t=>{const o=g.get(t);if(void 0!==o)return o;const i="function"==typeof e.config.roundedTop?e.config.roundedTop(t.width):e.config.roundedTop,n="number"==typeof i&&Number.isFinite(i)?Math.max(0,i):0;return g.set(t,n),n},f=e.config.trackFill;if(f){const e="string"==typeof f?f:f.color,t="string"==typeof f?1:f.opacity??1,[o,n]=l.range(),r=Math.min(o,n),a=Math.abs(n-o);for(const o of Object.values(i)){const i={fill:e,opacity:t},n=d?s(r,o.x,a,o.width,i,null,"__track__"):s(o.x,r,o.width,a,i,null,"__track__"),l=p(o);l>0&&(n.cornerRadii={tl:l,tr:l,br:l,bl:l}),h.push(n)}}for(const e of Object.values(i)){let t=0;const o=h.length,i=p(e);for(const o of e.pieceData){const i=Math.abs(n(o));if(0===i)continue;const c=r?r(o):e.name,g=a(o,c);let p;if(d){const n=l(t),r=l(t+i);p=s(n,e.x,r-n,e.width,g,o,c)}else{const n=l(t+i),r=l(t);p=s(e.x,n,e.width,r-n,g,o,c)}u&&(p.fillGradient=u,p.roundedEdge=m),h.push(p),t+=i}if(i>0&&h.length>o){const e=h.slice(o),t=e[0],n=e[e.length-1];1===e.length?t.cornerRadii={tl:i,tr:i,br:i,bl:i}:d?(t.cornerRadii={tl:i,bl:i},n.cornerRadii={tr:i,br:i}):(t.cornerRadii={bl:i,br:i},n.cornerRadii={tl:i,tr:i})}}return h}},mo=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],go=["scene-style","data-paint","accessibility","evidence"],po=(e,t)=>({retainedData:e,invalidations:t}),fo=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],yo=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],vo=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],bo=["scene-geometry","data-paint","accessibility","evidence"],xo=["scene-style","data-paint","accessibility","evidence"],wo=[],Ao={chartType:po("rebuild",fo),runtimeMode:po("rebuild",fo),categoryAccessor:po("rebuild",fo),valueAccessor:po("rebuild",fo),oAccessor:po("rebuild",fo),rAccessor:po("rebuild",fo),stackBy:po("rebuild",fo),groupBy:po("rebuild",fo),timeAccessor:po("rebuild",fo),accessorRevision:po("rebuild",fo),colorAccessor:po("rebuild",xo),symbolAccessor:po("rebuild",bo),connectorAccessor:po("rebuild",bo),dataIdAccessor:po("rebuild",bo),projection:po("preserve",yo),extentPadding:po("preserve",yo),axisExtent:po("preserve",yo),rExtent:po("preserve",yo),oExtent:po("preserve",yo),multiAxis:po("preserve",yo),normalize:po("preserve",yo),bins:po("preserve",yo),oSort:po("preserve",vo),barPadding:po("preserve",vo),roundedTop:po("preserve",vo),baselinePadding:po("preserve",vo),innerRadius:po("preserve",vo),cornerRadius:po("preserve",vo),startAngle:po("preserve",vo),sweepAngle:po("preserve",vo),trackFill:po("preserve",vo),showOutliers:po("preserve",vo),showIQR:po("preserve",vo),amplitude:po("preserve",vo),connectorOpacity:po("preserve",vo),showLabels:po("preserve",vo),dynamicColumnWidth:po("rebuild",vo),customLayout:po("preserve",vo),layoutConfig:po("preserve",vo),layoutMargin:po("preserve",vo),symbolMap:po("preserve",bo),pieceStyle:po("preserve",xo),summaryStyle:po("preserve",xo),connectorStyle:po("preserve",xo),gradientFill:po("preserve",xo),colorScheme:po("preserve",xo),themeCategorical:po("preserve",xo),themeSemantic:po("preserve",xo),themeSequential:po("preserve",xo),themeDiverging:po("preserve",xo),barColors:po("preserve",xo),decay:po("preserve",xo),pulse:po("preserve",xo),staleness:po("preserve",xo),layoutSelection:po("preserve",xo),windowSize:po("preserve",wo),windowMode:po("preserve",wo),clock:po("preserve",wo),transition:po("preserve",wo),introAnimation:po("preserve",wo),onLayoutError:po("preserve",wo)},So=po("preserve",vo),ko=class{constructor(){this.tracker=new Pe}get last(){return this.tracker.last}subscribe(e){return this.tracker.subscribe(e)}recordData(e,t){return this.tracker.record({kind:e,...void 0===t?{}:{count:t}},mo)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},go):this.recordNoop("restyle")}recordConfig(e){const t=function(e){let t="preserve";const o=new Set;for(const i of e){const e=Ao[i]??So;"rebuild"===e.retainedData&&(t="rebuild");for(const t of e.invalidations)o.add(t)}return{retainedData:t,invalidations:o}}(e);return this.tracker.record({kind:"config",keys:e},t.invalidations)}};import{quadtree as Co}from"d3-quadtree";var _o=class{constructor(e){this.rExtent=new n,this.rExtents=[],this.windowSizeWarned=!1,this.updateResults=new ko,this.rAccessors=[],this.categories=new Set,this._hasStreamingData=!1,this.styleResolver=new io,this.timestampBuffer=null,this.activeTransition=null,this.prevPositionMap=new Map,this.exitNodes=[],this.lastIngestTime=0,this.scales=null,this.multiScales=[],this.scene=[],this.columns={},this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutFailedThisBuild=!1,this._customLayoutDiagnosticsWarned=new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.version=0,this._dataVersion=0,this._bufferArrayCache=null,this._pointQuadtree=null,this._maxPointRadius=0,this._datumIndexCache=null,this._categoryIndexCache=null,this._hasRenderedOnce=!1,this.config=e,this.buffer=new C(e.windowSize),this.getO=v(e.categoryAccessor||e.oAccessor,"category");const t=e.valueAccessor||e.rAccessor;Array.isArray(t)?(this.rAccessors=t.map(e=>y(e,"value")),this.getR=this.rAccessors[0],this.rExtents=t.map(()=>new n)):(this.getR=y(t,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent]),this.getStack=v(e.stackBy),this.getGroup=v(e.groupBy),this.getColor=v(e.colorAccessor),this.getSymbol=v(e.symbolAccessor),this.getConnector=v(e.connectorAccessor),this.getDataId=v(e.dataIdAccessor),e.pulse&&(this.timestampBuffer=new C(e.windowSize))}syncPulseTimestampBuffer(){var e,t,o,i;this.timestampBuffer=(e=!!this.config.pulse,t=this.buffer,o=this.timestampBuffer,i=this.currentTime(),e?null!=o&&o.capacity===t.capacity&&o.size===t.size?o:P(t,i):null)}currentTime(){return this.config.clock?.()??at()}ingest(e){const t=this.currentTime();if(this.lastIngestTime=t,this._dataVersion++,e.bounded){this.buffer.clear(),this.rExtent.clear();for(const e of this.rExtents)e.clear();e.preserveCategoryOrder?this._hasStreamingData=!0:this.categories.clear(),this.timestampBuffer&&this.timestampBuffer.clear(),L(this.buffer,e.totalSize||e.inserts.length,this.timestampBuffer);for(const o of e.inserts)T(this.buffer,o,this.timestampBuffer,t),this.categories.add(this.getO(o)),this.pushValueExtent(o)}else{this._hasStreamingData=!0;for(const o of e.inserts){const e=T(this.buffer,o,this.timestampBuffer,t);this.categories.add(this.getO(o)),this.pushValueExtent(o),null!=e&&this.evictValueExtent(e)}}return this.updateResults.recordData(e.bounded?"replace":"ingest",e.inserts.length),!0}ingestWithResult(e){return this.ingest(e),this.updateResults.last}pushValueExtent(e){if("timeline"===this.config.chartType){const t=this.getRawRange(e);t&&(this.rExtent.push(t[0]),this.rExtent.push(t[1]))}else if(this.rAccessors.length>1){for(let t=0;this.rAccessors.length>t;t++)this.rExtents[t].push(this.rAccessors[t](e));this.rExtent.push(this.getR(e))}else this.rExtent.push(this.getR(e))}evictValueExtent(e){if("timeline"===this.config.chartType){const t=this.getRawRange(e);t&&(this.rExtent.evict(t[0]),this.rExtent.evict(t[1]))}else if(this.rAccessors.length>1){for(let t=0;this.rAccessors.length>t;t++)this.rExtents[t].evict(this.rAccessors[t](e));this.rExtent.evict(this.getR(e))}else this.rExtent.evict(this.getR(e))}getRawRange(e){const t=this.config.valueAccessor||this.config.rAccessor;if(!t)return null;const o="function"==typeof t?t(e):e[t];return Array.isArray(o)&&o.length>=2?[+o[0],+o[1]]:null}computeScene(e){const{config:t,buffer:o}=this,i=this.scales,n=this.multiScales,r=this.columns;if(0===o.size)return this.scales=null,this.multiScales=[],this.scene=[],this.columns={},this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,void this.version++;this.rExtent.dirty&&this.rExtent.recalculate(o,this.getR);const a=this.getBufferArray(),s=t.projection||"vertical",l=t.oExtent||this.resolveCategories(a),c=this.computeValueDomain(a,l),h="horizontal"===s,d="radial"===s,u=Math.min(.9,Math.max(0,null!=t.barPadding?t.barPadding/("vertical"===s?e.width:e.height):.1));let m,g;if(d){m=to().domain(l).range([0,1]).padding(0);const o=Math.min(e.width,e.height)/2,i=t.innerRadius||0;g=oo().domain(c).range([i,o])}else h?(m=to().domain(l).range([0,e.height]).padding(u),g=oo().domain(c).range([0,e.width])):(m=to().domain(l).range([0,e.width]).padding(u),g=oo().domain(c).range([e.height,0]));this.scales={o:m,r:g,projection:s},this.multiScales=this.rAccessors.length>1&&t.multiAxis?this.rAccessors.map((i,n)=>{const r=this.rExtents[n];r.dirty&&r.recalculate(o,i);let[a,s]=r.extent;a===1/0&&(a=0,s=1);const l=s-a,c=l>0?l*(t.extentPadding??.05):1;return a-=c,s+=c,a>0&&(a=0),h?oo().domain([a,s]).range([0,e.width]):oo().domain([a,s]).range([e.height,0])}):[];let p=a;this.rAccessors.length>1&&(p=a.flatMap(e=>this.rAccessors.map((t,o)=>({...e,__rIndex:o,__rValue:t(e),__rName:this.resolveRAccessorName(o)})))),this.columns=this.buildColumns(p,l,m,s,e),this._customLayoutFailedThisBuild=!1;const f=this.buildSceneNodes(p,e);this._customLayoutFailedThisBuild?!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.scales=i,this.multiScales=n,this.columns=r):(this.scene=[],this.rebuildPointQuadtree()):(this.config.transition&&this.scene.length>0&&this.snapshotPositions(),this.scene=f,this.rebuildPointQuadtree(),this.config.decay&&this.applyDecay(this.scene,a),this.config.pulse&&this.applyPulse(this.scene,a),this.config.transition&&!this._hasRenderedOnce&&this.scene.length>0&&(this.config.introAnimation&&this.synthesizeIntroPositions(),this._hasRenderedOnce=!0),this.config.transition&&this.prevPositionMap.size>0&&this.startTransition(),this.version++)}resolveRAccessorName(e){const t=this.config.valueAccessor||this.config.rAccessor,o=Array.isArray(t)?t[e]:t;return"string"==typeof o?o:"value"+e}resolveCategories(e){const t=this.config.oSort,o="streaming"===this.config.runtimeMode||this._hasStreamingData,i="auto"===t?void 0:t;let n=null;if(o){n=new Set;for(const t of e)n.add(this.getO(t))}const r=n?Array.from(this.categories).filter(e=>n.has(e)):Array.from(this.categories);if(o&&void 0===i){const e=Math.max(50,3*n.size);if(this.categories.size>e){let t=this.categories.size-e;for(const e of this.categories){if(0>=t)break;n.has(e)||(this.categories.delete(e),t--)}}return r}if(!1===i)return r;if("function"==typeof i)return r.sort(i);const a=new Map;for(const t of e){const e=this.getO(t);a.set(e,(a.get(e)||0)+Math.abs(this.getR(t)))}return r.sort("asc"===i?(e,t)=>(a.get(e)||0)-(a.get(t)||0):(e,t)=>(a.get(t)||0)-(a.get(e)||0))}computeValueDomain(e,t){return function(e){const{data:t,chartType:o,projection:i,normalize:n,rExtent:r,extentPadding:a=.05,baselinePadding:s,axisExtent:l,getO:c,getR:h,getStack:d,rawRExtent:u}=e,m=a;if("radial"===i&&("pie"===o||"donut"===o))return[0,1];let g=0,p=0;if("bar"===o&&d&&n)g=0,p=1;else if("bar"===o&&d){const e=new Map,o=new Map;for(const i of t){const t=c(i),n=h(i);0>n?o.set(t,(o.get(t)||0)+n):e.set(t,(e.get(t)||0)+n)}for(const t of e.values())t>p&&(p=t);for(const e of o.values())g>e&&(g=e)}else if("bar"===o){const e=new Map;for(const o of t){const t=c(o),i=h(o);e.set(t,(e.get(t)||0)+i)}for(const t of e.values())t>p&&(p=t),g>t&&(g=t)}else if("swimlane"===o){const e=new Map;for(const o of t){const t=c(o),i=Math.abs(h(o));e.set(t,(e.get(t)||0)+i)}for(const t of e.values())t>p&&(p=t)}else if("clusterbar"===o||"bar-funnel"===o)for(const e of t){const t=h(e);t>p&&(p=t),g>t&&(g=t)}else{const e=u[0],t=u[1];e!==1/0&&(g=e),t!==-1/0&&(p=t)}r&&(null!=r[0]&&(g=r[0]),null!=r[1]&&(p=r[1]));const f="bar"===o||"clusterbar"===o||"bar-funnel"===o||"swimlane"===o;if(f&&null==r?.[0]&&null==r?.[1]&&(g>0&&(g=0),0>p&&(p=0)),"bar-funnel"!==o&&"exact"!==l){const e=p-g,t=e>0?e*m:1,i=f&&!s&&0===g,n=f&&!s&&0===p||"swimlane"===o;null!=r?.[0]||i||(g-=t),null!=r?.[1]||n||(p+=t)}return[g,p]}({data:e,chartType:this.config.chartType,projection:this.config.projection,normalize:this.config.normalize,rExtent:this.config.rExtent,extentPadding:this.config.extentPadding,baselinePadding:this.config.baselinePadding,axisExtent:this.config.axisExtent,getO:this.getO,getR:this.getR,getStack:this.getStack,rawRExtent:this.rExtent.extent})}buildColumns(e,t,o,i,n){return function(e){const{data:t,oExtent:o,oScale:i,projection:n,layout:r,dynamicColumnWidth:a,getO:s,getR:l}=e,c=Object.create(null),h=new Map;for(const e of t){const t=s(e);h.has(t)||h.set(t,[]),h.get(t).push(e)}let d=0;if("radial"===n)for(const e of t)d+=Math.abs(l(e));let u=null;if(a&&"radial"!==n){u=new Map;let e=0;for(const t of o){const o=h.get(t)||[];let i;i="string"==typeof a?o.reduce((e,t)=>e+(Number(t[a])||0),0):a(o),u.set(t,i),e+=i}const t=("horizontal"===n?r.height:r.width)-i.padding()*i.step()*o.length;if(e>0)for(const[o,i]of u)u.set(o,i/e*t)}let m=0,g=0;for(const e of o){const t=h.get(e)||[],o=t.reduce((e,t)=>e+Math.abs(l(t)),0),n=d>0?o/d:0;let r,a;u?(r=g,a=u.get(e)||i.bandwidth(),g+=a+i.padding()*i.step()):(r=i(e)??0,a=i.bandwidth()),c[e]={name:e,x:r,y:0,width:a,middle:r+a/2,padding:i.padding()*i.step(),pieceData:t,pct:n,pctStart:m},m+=n}return c}({data:e,oExtent:t,oScale:o,projection:i,layout:n,dynamicColumnWidth:this.config.dynamicColumnWidth,getO:this.getO,getR:this.getR})}getSceneContext(){return{scales:this.scales,columns:this.columns,config:this.config,getR:this.getR,getStack:this.getStack,getGroup:this.getGroup,getColor:this.getColor,getSymbol:this.getSymbol,getConnector:this.getConnector,getO:this.getO,multiScales:this.multiScales,rAccessors:this.rAccessors,resolvePieceStyle:(e,t)=>this.styleResolver.resolvePieceStyle(this.config,e,t),resolveSummaryStyle:(e,t)=>this.styleResolver.resolveSummaryStyle(this.config,e,t),getRawRange:e=>this.getRawRange(e)}}buildSceneNodes(e,t){if(!this.scales)return[];if(this.config.customLayout){const o=this.buildLayoutContext(e,t);let i;try{i=this.config.customLayout(o)}catch(e){const t=null!==this.lastCustomLayoutResult,o=X("ordinal",e,t,this.version);this.lastCustomLayoutFailure=o,this._customLayoutFailedThisBuild=!0,"production"!==process.env.NODE_ENV&&console.error("[semiotic] ordinal customLayout threw:",e);try{this.config.onLayoutError?.(o)}catch(e){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",e)}return t?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,[])}this.customLayoutOverlays=i.overlays??null,this.lastCustomLayoutResult=i,this.lastCustomLayoutFailure=null;const n=i.nodes??[];if(this._customRestyle=i.restyle,this.hasCustomRestyle=!!i.restyle,this.hasCustomRestyle){this._baseStyles=new WeakMap;for(const e of n)e.style&&this._baseStyles.set(e,e.style);this.applyCustomRestyle(n,this.config.layoutSelection??null)}return ce({label:"ordinal customLayout",nodes:n,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),n}this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1;const o=this.getSceneContext(),i=uo[this.config.chartType];let n=i?i(o,t):[];if(this.getConnector&&this.scales){const e=function(e,t){const{scales:o,config:i,getConnector:n,getO:r}=e;if(!n||!o)return[];const a=[],{projection:s}=o,l=new Map;for(const e of t){if("point"!==e.type&&"rect"!==e.type)continue;const t=e.datum;if(!t)continue;const o=n(t);if(!o)continue;let i,a;"point"===e.type?(i=e.x,a=e.y):(i=e.x+e.w/2,a=e.y+("vertical"===s?0:e.h/2)),l.has(o)||l.set(o,[]),l.get(o).push({x:i,y:a,datum:t,category:r(t)})}const c=o.o.domain(),h=i.connectorStyle;for(const[t,o]of l)if(o.length>=2){o.sort((e,t)=>c.indexOf(e.category)-c.indexOf(t.category));for(let i=0;o.length-1>i;i++){const n=o[i],r=o[i+1],s="function"==typeof h?h(n.datum):h||{stroke:e.config.themeSemantic?.border||e.config.themeSemantic?.secondary||"#999",strokeWidth:1,opacity:.5};a.push({type:"connector",x1:n.x,y1:n.y,x2:r.x,y2:r.y,style:s,datum:n.datum,group:t})}}return a}(o,n);n=[...e,...n]}return n}buildLayoutContext(e,t){const o=this.config,i=o.layoutMargin??{top:0,right:0,bottom:0,left:0},n=ge(o.colorScheme,o.themeCategorical,Ae),r=this.scales;return{data:e,scales:{o:r.o,r:r.r,projection:r.projection},dimensions:{width:t.width,height:t.height,margin:i,plot:"radial"===r.projection?{x:-t.width/2,y:-t.height/2,width:t.width,height:t.height}:{x:0,y:0,width:t.width,height:t.height}},theme:{semantic:o.themeSemantic??{},categorical:[...n]},resolveColor:me(n,o.colorScheme),config:o.layoutConfig??{},selection:o.layoutSelection??null}}computeDecayOpacity(e,t){const o=this.config.decay;return o&&t>1?q(o,e,t):1}getDatumIndexMap(e){if(this._datumIndexCache&&this._datumIndexCache.version===this._dataVersion)return this._datumIndexCache.map;const t=z(e);return this._datumIndexCache={version:this._dataVersion,map:t},t}getCategoryIndexMap(e){if(this._categoryIndexCache&&this._categoryIndexCache.version===this._dataVersion)return this._categoryIndexCache.map;const t=function(e,t){const o="function"==typeof t,i=o?null:t||"category",n=new Map;for(let r=0;e.length>r;r++){const a=e[r],s=o?t(a):a[i],l=n.get(s);l?l.push(r):n.set(s,[r])}return n}(e,this.config.categoryAccessor||this.config.oAccessor);return this._categoryIndexCache={version:this._dataVersion,map:t},t}rebuildPointQuadtree(){const e=function(e){let t=0,o=0;for(const i of e)"point"===i.type&&!1!==i.interactive&&(t++,i.r>o&&(o=i.r));if(500>=t)return{quadtree:null,maxRadius:o};const i=Array(t);let n=0;for(const t of e)"point"===t.type&&!1!==t.interactive&&(i[n++]=t);return{maxRadius:o,quadtree:Co().x(e=>e.x).y(e=>e.y).addAll(i)}}(this.scene);this._pointQuadtree=e.quadtree,this._maxPointRadius=e.maxRadius}get pointQuadtree(){return this._pointQuadtree}get maxPointRadius(){return this._maxPointRadius}applyDecay(e,t){if(!this.config.decay)return;const o=t.length;if(1>=o)return;const i=this.getDatumIndexMap(t);for(const t of e){if("connector"===t.type||"violin"===t.type||"boxplot"===t.type||"wedge"===t.type)continue;if(!t.datum)continue;const e=i.get(t.datum);if(null==e)continue;const n=this.computeDecayOpacity(e,o);t.style={...t.style,opacity:(t.style?.opacity??1)*n}}}applyPulse(e,t,o=this.currentTime()){return!(!this.config.pulse||!this.timestampBuffer)&&function(e,t,o,i,n,r){const a=e.color??"rgba(255,255,255,0.6)",s=e.glowRadius??4;let l=!1;for(const c of t){if("connector"===c.type||"violin"===c.type||"boxplot"===c.type)continue;if("wedge"===c.type){const t=c.category;if(!t)continue;let i=0;for(const a of n(t)??[]){const t=o.get(a);null!=t&&(i=Math.max(i,R(e,t,r)))}l=B(c,i,a)||l;continue}if(null==c.datum)continue;const t=i.get(c.datum);if(null==t)continue;const h=o.get(t),d=null==h?0:R(e,h,r);l=B(c,d,a,s)||l}return l}(this.config.pulse,e,this.timestampBuffer,this.getDatumIndexMap(t),e=>this.getCategoryIndexMap(t).get(e),o)}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(this.scene,this.getBufferArray(),e)}hasActivePulsesAt(e){return!!this.config.pulse&&M(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}synthesizeIntroPositions(){this.prevPositionMap.clear();const e=new Map,t=this.scales?.r(0)??0,o="horizontal"!==this.scales?.projection;let i;for(let n=0;this.scene.length>n;n++){const r=this.scene[n],a=this.getNodeKey(r,e);a&&("rect"===r.type?this.prevPositionMap.set(a,o?{x:r.x,y:t,w:r.w,h:0,opacity:r.style.opacity??1}:{x:t,y:r.y,w:0,h:r.h,opacity:r.style.opacity??1}):"point"===r.type?this.prevPositionMap.set(a,{x:r.x,y:r.y,r:0,opacity:0}):"wedge"===r.type&&(void 0===i&&(i=r.startAngle),this.prevPositionMap.set(a,{x:r.cx,y:r.cy,startAngle:i,endAngle:i,innerRadius:r.innerRadius,outerRadius:r.outerRadius,opacity:0})))}}getNodeKey(e,t){if("point"===e.type){const o=`p:${e.datum?this.getO(e.datum):""}:${e.datum?this.getR(e.datum):0}`,i=t.get(o)||0;return t.set(o,i+1),`${o}:${i}`}if("rect"===e.type){const o=e.datum?null!=e.datum.category&&""!==e.datum.category?e.datum.category+"":(this.getO(e.datum)??"")+"":"",i=`r:${e.group||""}:${o}`,n=t.get(i)||0;return t.set(i,n+1),0===n?i:`${i}:${n}`}return"wedge"===e.type?"w:"+(e.category??""):null}snapshotPositions(){this.prevPositionMap.clear();const e=new Map;for(let t=0;this.scene.length>t;t++){const o=this.scene[t],i=this.getNodeKey(o,e);i&&("point"===o.type?this.prevPositionMap.set(i,{x:o.x,y:o.y,r:o.r,opacity:o.style.opacity??o.style.fillOpacity}):"rect"===o.type?this.prevPositionMap.set(i,{x:o.x,y:o.y,w:o.w,h:o.h,opacity:o.style.opacity??o.style.fillOpacity}):"wedge"===o.type&&this.prevPositionMap.set(i,{x:o.cx,y:o.cy,startAngle:o.startAngle,endAngle:o.endAngle,innerRadius:o.innerRadius,outerRadius:o.outerRadius,opacity:o.style.opacity??1}))}}startTransition(){if(!this.config.transition||0===this.prevPositionMap.size)return;const e=this.config.transition.duration??300;if(this.exitNodes.length>0){const e=new Set(this.exitNodes);this.scene=this.scene.filter(t=>!e.has(t)),this.exitNodes=[]}let t=!1;const o=new Set,i=new Map;for(let e=0;this.scene.length>e;e++){const n=this.scene[e],r=this.getNodeKey(n,i);if(!r)continue;n._transitionKey=r;const a=this.prevPositionMap.get(r);if("point"===n.type)a?(o.add(r),n._targetOpacity=n.style.opacity??n.style.fillOpacity??1,(a.x!==n.x||a.y!==n.y||void 0!==a.r&&a.r!==n.r)&&(n._targetX=n.x,n._targetY=n.y,n._targetR=n.r,n.x=a.x,n.y=a.y,void 0!==a.r&&(n.r=a.r),t=!0)):(n._targetOpacity=n.style.opacity??n.style.fillOpacity??1,n._targetR=n.r,n.r=0,n.style={...n.style,opacity:0},t=!0);else if("rect"===n.type)a?(o.add(r),n._targetOpacity=n.style.opacity??n.style.fillOpacity??1,a.x===n.x&&a.y===n.y&&a.w===n.w&&a.h===n.h||(n._targetX=n.x,n._targetY=n.y,n._targetW=n.w,n._targetH=n.h,n.x=a.x,n.y=a.y,n.w=a.w??n.w,n.h=a.h??n.h,t=!0)):(n._targetOpacity=n.style.opacity??n.style.fillOpacity??1,n.style={...n.style,opacity:0},t=!0);else if("wedge"===n.type)if(a)o.add(r),n._targetOpacity=n.style.opacity??n.style.fillOpacity??1,a.startAngle===n.startAngle&&a.endAngle===n.endAngle||(n._targetStartAngle=n.startAngle,n._targetEndAngle=n.endAngle,n.startAngle=a.startAngle,n.endAngle=a.endAngle,t=!0);else{n._targetOpacity=n.style.opacity??n.style.fillOpacity??1,n._targetStartAngle=n.startAngle,n._targetEndAngle=n.endAngle;const e=n.startAngle;n.startAngle=e,n.endAngle=e,n.style={...n.style,opacity:0},this.prevPositionMap.set(r,{x:n.cx,y:n.cy,startAngle:e,endAngle:e,innerRadius:n.innerRadius,outerRadius:n.outerRadius,opacity:0}),t=!0}}this.exitNodes=[];for(const[e,i]of this.prevPositionMap)if(!o.has(e)){if(e.startsWith("p:"))this.exitNodes.push({type:"point",x:i.x,y:i.y,r:i.r??3,style:{opacity:i.opacity??1},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("r:"))this.exitNodes.push({type:"rect",x:i.x,y:i.y,w:i.w??0,h:i.h??0,style:{opacity:i.opacity??1,fill:"#999"},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("w:")){const t=((i.startAngle??0)+(i.endAngle??0))/2,o={type:"wedge",cx:i.x,cy:i.y,innerRadius:i.innerRadius??0,outerRadius:i.outerRadius??100,startAngle:i.startAngle??0,endAngle:i.endAngle??0,style:{opacity:i.opacity??1},datum:null,category:e.slice(2),_targetStartAngle:t,_targetEndAngle:t,_targetOpacity:0,_transitionKey:e};this.exitNodes.push(o)}t=!0}this.exitNodes.length>0&&(this.scene=[...this.scene,...this.exitNodes]),t&&(this.activeTransition={startTime:this.currentTime(),duration:e})}advanceTransition(e){if(!this.activeTransition)return!1;const t=De(e,this.activeTransition),o=Oe(t,"linear"===this.config.transition?.easing?"linear":"ease-out-cubic");for(const e of this.scene){const t=e._transitionKey;if(t)if("point"===e.type){if(void 0!==e._targetOpacity){const i=this.prevPositionMap.get(t);e.style.opacity=ot(i?i.opacity??1:0,e._targetOpacity,o)}const i=this.prevPositionMap.get(t);void 0!==e._targetX&&i&&(e.x=ot(i.x,e._targetX,o),e.y=ot(i.y,e._targetY,o)),void 0!==e._targetR&&void 0!==i?.r&&(e.r=ot(i.r,e._targetR,o))}else if("rect"===e.type){if(void 0!==e._targetOpacity){const i=this.prevPositionMap.get(t);e.style.opacity=ot(i?i.opacity??1:0,e._targetOpacity,o)}if(void 0===e._targetX)continue;const i=this.prevPositionMap.get(t);if(!i)continue;e.x=ot(i.x,e._targetX,o),e.y=ot(i.y,e._targetY,o),void 0!==i.w&&(e.w=ot(i.w,e._targetW,o),e.h=ot(i.h,e._targetH,o))}else if("wedge"===e.type){if(void 0!==e._targetOpacity){const i=this.prevPositionMap.get(t);e.style={...e.style,opacity:ot(i?i.opacity??1:0,e._targetOpacity,o)}}if(void 0!==e._targetStartAngle&&void 0!==e._targetEndAngle){const i=this.prevPositionMap.get(t);i&&void 0!==i.startAngle&&(e.startAngle=ot(i.startAngle,e._targetStartAngle,o),e.endAngle=ot(i.endAngle,e._targetEndAngle,o))}}}if(t>=1){for(const e of this.scene)if(void 0!==e._targetOpacity&&(e.style={...e.style||{},opacity:0===e._targetOpacity?0:e._targetOpacity},e._targetOpacity=void 0),"point"===e.type){if(void 0===e._targetX&&void 0===e._targetR)continue;void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY),void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0}else if("rect"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0}else"wedge"===e.type&&void 0!==e._targetStartAngle&&(e.startAngle=e._targetStartAngle,e.endAngle=e._targetEndAngle,e._targetStartAngle=void 0,e._targetEndAngle=void 0);if(this.exitNodes.length>0){const e=new Set(this.exitNodes);this.scene=this.scene.filter(t=>!e.has(t)),this.exitNodes=[]}return this.activeTransition=null,!1}return!0}cancelIntroAnimation(){this.prevPositionMap.clear(),this.activeTransition=null,u(this.scene),this.exitNodes=[]}getBufferArray(){return this._bufferArrayCache?.version!==this._dataVersion&&(this._bufferArrayCache={version:this._dataVersion,data:this.buffer.toArray()}),this._bufferArrayCache.data}getData(){return this.buffer.toArray()}remove(e){if(!this.getDataId)throw Error("remove() requires dataIdAccessor to be configured");this.config.transition&&this.scene.length>0&&this.snapshotPositions();const t=g(e),o=this.getDataId,i=e=>t.has(o(e));_(this.buffer,this.timestampBuffer,i);const n=this.buffer.remove(i);if(0===n.length)return this.updateResults.recordNoop("remove"),n;for(const e of n)this.evictValueExtent(e);return this.categories.clear(),this.buffer.forEach(e=>this.categories.add(this.getO(e))),this._dataVersion++,this.version++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",n.length),n}update(e,t){if(!this.getDataId)throw Error("update() requires dataIdAccessor to be configured");const o=g(e),i=this.getDataId,n=new Set;this.buffer.forEach((e,t)=>{o.has(i(e))&&n.add(t)});const r=this.buffer.update(e=>o.has(i(e)),t);if(0===r.length)return this.updateResults.recordNoop("update"),r;for(const e of r)this.evictValueExtent(e);return this.categories.clear(),this.buffer.forEach((e,t)=>{this.categories.add(this.getO(e)),n.has(t)&&this.pushValueExtent(e)}),this._dataVersion++,this.version++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",r.length),r}clear(){this.buffer.clear(),this.rExtent.clear(),this.categories.clear(),this._hasStreamingData=!1,this._hasRenderedOnce=!1,this.timestampBuffer&&this.timestampBuffer.clear(),this.prevPositionMap.clear(),this.exitNodes=[],this.activeTransition=null,this.lastIngestTime=0,this.scales=null,this.scene=[],this.columns={},this.multiScales=[],this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._pointQuadtree=null,this._maxPointRadius=0,this.styleResolver.resetColors(),this._dataVersion++,this.version++,this.updateResults.recordData("clear")}get size(){return this.buffer.size}getOAccessor(){return this.getO}getRAccessor(){return this.getR}applyCustomRestyle(e,t){const o=this._customRestyle;if(o)for(const i of e){const e=this._baseStyles.get(i)??i.style??{},n=o(i,t);i.style=n?{...e,...n}:e}}restyleScene(e){this._customRestyle?(this.applyCustomRestyle(this.scene,e),this.markStylePaintPending(),this.updateResults.recordRestyle(!0)):this.updateResults.recordRestyle(!1)}rebuildAccessorDerivedState(){this.categories.clear(),this.rExtent.clear();for(const e of this.rExtents)e.clear();this._categoryIndexCache=null,this.buffer.forEach(e=>{this.categories.add(this.getO(e)),this.pushValueExtent(e)})}updateConfig(e){const t={...this.config},o=Object.keys(e).filter(o=>e[o]!==t[o]);"production"!==process.env.NODE_ENV&&!this.windowSizeWarned&&"windowSize"in e&&e.windowSize!==t.windowSize&&(this.windowSizeWarned=!0,console.warn(`[Semiotic] windowSize changed after mount (${t.windowSize} → ${e.windowSize}) but it is a mount-only setting — the ring buffer keeps its original capacity. Remount the chart (e.g. via a React key) to apply a new windowSize.`)),("colorScheme"in e&&e.colorScheme!==t.colorScheme||"themeCategorical"in e&&e.themeCategorical!==t.themeCategorical||"colorAccessor"in e&&!f(e.colorAccessor,t.colorAccessor))&&this.styleResolver.resetColors(),("categoryAccessor"in e&&!f(e.categoryAccessor,t.categoryAccessor)||"oAccessor"in e&&!f(e.oAccessor,t.oAccessor))&&(this._categoryIndexCache=null),Object.assign(this.config,e),"pulse"in e&&this.syncPulseTimestampBuffer();let i=!1;("categoryAccessor"in e||"oAccessor"in e)&&(f(this.config.categoryAccessor||this.config.oAccessor,t.categoryAccessor||t.oAccessor)||(this.getO=v(this.config.categoryAccessor||this.config.oAccessor,"category"),i=!0));let r=!1;if("valueAccessor"in e||"rAccessor"in e){const e=this.config.valueAccessor||this.config.rAccessor,o=t.valueAccessor||t.rAccessor,i=Array.isArray(e)?e:[e],a=Array.isArray(o)?o:[o];if(r=i.length!==a.length||i.some((e,t)=>!f(e,a[t])),r){const e=this.config.valueAccessor||this.config.rAccessor;Array.isArray(e)?(this.rAccessors=e.map(e=>y(e,"value")),this.getR=this.rAccessors[0],this.rExtents=e.map(()=>new n)):(this.getR=y(e,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent])}}"stackBy"in e&&!f(e.stackBy,t.stackBy)&&(this.getStack=null!=this.config.stackBy?v(this.config.stackBy):void 0),"groupBy"in e&&!f(e.groupBy,t.groupBy)&&(this.getGroup=null!=this.config.groupBy?v(this.config.groupBy):void 0),"colorAccessor"in e&&!f(e.colorAccessor,t.colorAccessor)&&(this.getColor=null!=this.config.colorAccessor?v(this.config.colorAccessor):void 0),"symbolAccessor"in e&&!f(e.symbolAccessor,t.symbolAccessor)&&(this.getSymbol=null!=this.config.symbolAccessor?v(this.config.symbolAccessor):void 0),"connectorAccessor"in e&&!f(e.connectorAccessor,t.connectorAccessor)&&(this.getConnector=null!=this.config.connectorAccessor?v(this.config.connectorAccessor):void 0),(i||r||"accessorRevision"in e&&e.accessorRevision!==t.accessorRevision)&&this.rebuildAccessorDerivedState(),this.updateResults.recordConfig(o)}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}};function Ro(e,t,o){const i=U(t,o,e);return i.hit?{datum:e.datum,x:i.cx,y:e.y,distance:0,category:e.group}:null}function Po(e,t,o,i=30){const n=t-e.x,r=o-e.y,a=Math.sqrt(n*n+r*r);return a>K(e.r,i)?null:{datum:e.datum,x:e.x,y:e.y,distance:a}}function Lo(e,t,o,i=30){const n=t-e.x,r=o-e.y,a=Math.sqrt(n*n+r*r);return a>K(_t(e.size),i)?null:{datum:e.datum,x:e.x,y:e.y,distance:a}}function Mo(e,t,o,i=30){if(null==e.datum)return null;const n=Ge(e.glyph,e.size),r=e.x+n.centerDx,a=e.y+n.centerDy,s=t-r,l=o-a,c=Math.sqrt(s*s+l*l);return c>K(n.radius,i)?null:{datum:e.datum,x:r,y:a,distance:c}}function Io(e,t,o){const i=t-e.cx,n=o-e.cy,r=Math.sqrt(i*i+n*n);if(e.innerRadius>r||r>e.outerRadius)return null;const a=J(Math.atan2(n,i)),s=J(e.startAngle),l=J(e.endAngle);if(!(s>l?a>=s||l>=a:a>=s&&l>=a))return null;const c=(e.startAngle+e.endAngle)/2,h=(e.innerRadius+e.outerRadius)/2;return{datum:e.datum,x:e.cx+Math.cos(c)*h,y:e.cy+Math.sin(c)*h,distance:0,category:e.category}}function To(e,t,o){const i=e.columnWidth/2;if("vertical"===e.projection){if(!(e.x-i>t||t>e.x+i||Math.min(e.minPos,e.maxPos)>o||o>Math.max(e.minPos,e.maxPos)))return{datum:e.datum,x:e.x,y:e.medianPos,distance:0,category:e.category,stats:e.stats}}else{const n=e.y-i,r=e.y+i;if(!(Math.min(e.minPos,e.maxPos)>t||t>Math.max(e.minPos,e.maxPos)||n>o||o>r))return{datum:e.datum,x:e.medianPos,y:e.y,distance:0,category:e.category,stats:e.stats}}return null}function Ho(e,t,o){if(!e.bounds)return null;const{x:i,y:n,width:r,height:a}=e.bounds;return i>t||t>i+r||n>o||o>n+a?null:{datum:e.datum,x:i+r/2,y:n+a/2,distance:0,category:e.category,stats:e.stats}}function Bo(e,t,o,i){const n=e.style.strokeWidth??1;if(0>=n||"none"===e.style.stroke)return null;const r=Fo(t,o,e.x1,e.y1,e.x2,e.y2);return r?r.distance>Math.max(i,n/2)?null:{datum:e.datum,x:r.x,y:r.y,distance:r.distance,category:e.group}:null}function Oo(e,t,o){if(3>e.points.length)return null;const i=Eo(e.points,t,o),n=No(e.points,t,o),r=e.style.strokeWidth??1;if(!(n||e.style.stroke&&"none"!==e.style.stroke&&r>0&&r/2>=i))return null;const a=Do(e.points);return{datum:e.datum,x:a.x,y:a.y,distance:n?0:i,category:e.category}}function Do(e){const t=e.reduce((e,t)=>({x:e.x+t[0],y:e.y+t[1]}),{x:0,y:0});return{x:t.x/e.length,y:t.y/e.length}}function Fo(e,t,o,i,n,r){const a=n-o,s=r-i,l=a*a+s*s;if(0===l)return null;const c=Math.max(0,Math.min(1,((e-o)*a+(t-i)*s)/l)),h=o+c*a,d=i+c*s;return{x:h,y:d,distance:Math.hypot(e-h,t-d)}}function Eo(e,t,o){let i=1/0;for(let n=0;e.length>n;n++){const r=e[n],a=e[(n+1)%e.length],s=Fo(t,o,r[0],r[1],a[0],a[1]);s&&i>s.distance&&(i=s.distance)}return i}function No(e,t,o){if(Eo(e,t,o)<=16*Number.EPSILON)return!0;let i=!1;for(let n=0,r=e.length-1;e.length>n;r=n++){const[a,s]=e[n],[l,c]=e[r];s>o!=c>o&&(l-a)*(o-s)/(c-s)+a>t&&(i=!i)}return i}function jo(e){const t=e.pointer.clientX-e.canvasRect.left-e.margin.left,o=e.pointer.clientY-e.canvasRect.top-e.margin.top;if(0>t||t>e.width||0>o||o>e.height)return{kind:"outside"};if(0===e.scene.length)return{kind:"miss"};const i="radial"===e.projection,n=function(e,t,o,i=30,n,r=0){let a=null,s=null;if(n){const e=Q(n,t,o,i,r);e&&!1!==e.node.interactive&&(a={node:e.node,datum:e.node.datum,x:e.node.x,y:e.node.y,distance:e.distance})}for(const r of e){let e=null;switch(r.type){case"rect":if(null==r.datum)break;e=Ro(r,t,o);break;case"point":if(!1===r.interactive)break;if(n)break;e=Po(r,t,o,i);break;case"symbol":e=Lo(r,t,o,i);break;case"glyph":e=Mo(r,t,o,i);break;case"wedge":if(null===r.datum)break;e=Io(r,t,o);break;case"boxplot":e=To(r,t,o);break;case"violin":e=Ho(r,t,o);break;case"connector":e=Bo(r,t,o,i);break;case"trapezoid":e=Oo(r,t,o)}e&&(e.node=r,"connector"===r.type?s&&e.distance>=s.distance||(s=e):a&&e.distance>=a.distance||(a=e))}return a??s??function(e,t,o){const i=new Map;for(const t of e){if("connector"!==t.type)continue;const e=t.group||"_default",o=i.get(e);o?o.push(t):i.set(e,[t])}for(const e of i.values()){const i=e[0];if(2>e.length||!i.style.fill||"none"===i.style.fill)continue;const n=[[i.x1,i.y1],...e.map(e=>[e.x2,e.y2])];if(!No(n,t,o))continue;const r=Do(n);return{node:i,datum:i.datum,x:r.x,y:r.y,distance:0,category:i.group}}return null}(e,t,o)}(e.scene,i?t-e.width/2:t,i?o-e.height/2:o,e.hoverRadius,e.pointQuadtree,e.maxPointRadius);return n?{kind:"hit",hit:n}:{kind:"miss"}}function Wo(e,t){return Te(e.datum||{},e.x,e.y,{...e.stats&&{stats:e.stats},...e.category&&{category:e.category},__oAccessor:"string"==typeof t.oAccessor?t.oAccessor:void 0,__rAccessor:"string"==typeof t.rAccessor?t.rAccessor:void 0,__chartType:t.chartType})}N(_o);import{useMemo as zo,useRef as $o}from"react";import{Fragment as Go,jsx as Vo,jsxs as qo}from"react/jsx-runtime";function Xo(e){const{width:t,height:o,totalWidth:i,totalHeight:n,margin:r,scales:a,showAxes:s,showGrid:l,rFormat:c}=e,{rTickValues:h,axisExtent:d}=e,u="radial"===a?.projection,g="horizontal"===a?.projection,p=zo(()=>!a||u?[]:(h||m(a.r,5,d)).map(e=>({value:e,pixel:a.r(e),label:(c||Yo)(e)})),[a,c,u,h,d]),f=l&&a&&!u,y=s&&a&&!u;return f||y?Vo("svg",{width:i,height:n,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:qo("g",{transform:`translate(${r.left},${r.top})`,children:[f&&Vo("g",{className:"ordinal-grid",children:p.map((e,i)=>Vo("line",{x1:g?e.pixel:0,y1:g?0:e.pixel,x2:g?e.pixel:t,y2:g?o:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1},"grid-"+i))}),y&&Vo(Go,{children:qo(Go,g?{children:[Vo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),Vo("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]}:{children:[Vo("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),Vo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]})})]})}):null}function Yo(e){return Math.round(100*e)/100+""}function Qo(e){const{width:t,height:o,totalWidth:i,totalHeight:n,margin:r,scales:a,showAxes:s,showCategoryTicks:l,oLabel:c,rLabel:h,oFormat:d,rFormat:u,showGrid:g,title:p,legend:f,legendHoverBehavior:y,legendClickBehavior:v,legendHighlightedCategory:b,legendIsolatedCategories:x,legendPosition:w="right",legendLayout:A,foregroundGraphics:S,annotations:k,onAnnotationActivate:C,onObservation:_,chartId:R,chartType:P,autoPlaceAnnotations:L,svgAnnotationRules:M,xAccessor:I,yAccessor:T,annotationData:H,underlayRendered:B,canvasObscuresUnderlay:O=!0,children:D}=e,F=Pt({onAnnotationActivate:C,onObservation:_,chartId:R,chartType:P}),E="radial"===a?.projection,N="horizontal"===a?.projection,j=!1!==l,W=!B||O,z=xt({showAxes:s,projection:E?"radial":N?"horizontal":"vertical",hasCategoryLabel:!!c,hasValueLabel:!!h}),$=bt(A,z.leftAxis),G=f&&"left"===w&&$>0?$:r.left,V=zo(()=>{if(!s||!j||!a||E)return[];const e=a.o.bandwidth(),t=a.o.domain().map((t,o)=>({value:t,pixel:(a.o(t)??0)+e/2,label:d?d(t,o):t}));if(2>=t.length)return t;const o=Math.abs(t[1].pixel-t[0].pixel)||e,i=t.map(e=>{return t=e.label,N?"string"==typeof t||"number"==typeof t?16:24:"string"==typeof t||"number"==typeof t?6.5*(t+"").length:60;var t}),n=N?0:6;if(i.every((e,t)=>0===t||o>=(i[t-1]+e)/2+n))return t;const r=Math.max(...i)+n,l=Math.max(1,Math.ceil(r/o));return 1===l?t:t.filter((e,t)=>t%l===0)},[s,j,a,d,E,N]),q=e.rTickValues,X=e.tickLabelEdgeAlign,Q=e.axisExtent,K=zo(()=>s&&a&&!E?(q||m(a.r,5,Q)).map(e=>({value:e,pixel:a.r(e),label:(u||Yo)(e)})):[],[s,a,u,E,q,Q]),Z=$o(new Map),U=$o(k?.length??0),J=k?.length??0;U.current!==J&&(U.current=J,Z.current=new Map);const ee=zo(()=>{if(!k||0===k.length)return null;const e=Y(k),i=Fe("ordinal",F),n="horizontal"===a?.projection,r=a?.o?e=>(a.o(e)??0)+a.o.bandwidth()/2:null,s={scales:a?{x:n?a.r:r||a.r,y:n&&r||a.r,time:a.r,value:a.r,o:a.o}:null,timeAxis:"x",xAccessor:I,yAccessor:T,width:t,height:o,data:H,frameType:"ordinal",projection:n?"horizontal":"vertical",stickyPositionCache:Z.current},l=L?Le({annotations:e,context:s,..."object"==typeof L?L:{}}):e;return dt(l,i,M,s)},[k,L,M,t,o,a,I,T,H,F]);return s||p||f||S||ee&&ee.length>0||g||D?qo("svg",{role:"img",width:i,height:n,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[Vo("title",{children:"string"==typeof p?p:"Ordinal Chart"}),Vo("desc",{children:"string"==typeof p?p+" (ordinal data visualization)":"Ordinal data visualization"}),qo("g",{transform:`translate(${r.left},${r.top})`,children:[g&&a&&!E&&W&&Vo("g",{className:"ordinal-grid",children:K.map((e,i)=>Vo("line",{x1:N?e.pixel:0,y1:N?0:e.pixel,x2:N?e.pixel:t,y2:N?o:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1},"grid-"+i))}),s&&a&&!E&&(()=>{const e={fontSize:"var(--semiotic-tick-font-size, 12px)"},i={fontSize:"var(--semiotic-axis-label-font-size, 12px)"};return Vo("g",{className:"ordinal-axes",children:qo(Go,N?{children:[qo("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[W&&Vo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),V.map((t,o)=>qo("g",{transform:`translate(0,${t.pixel})`,children:[Vo("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?Vo("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):Vo("foreignObject",{x:-68,y:-12,width:60,height:24,style:{overflow:"visible"},children:Vo("div",{style:{textAlign:"right",userSelect:"none",...e},children:t.label})})]},"cat-"+o)),c&&Vo("text",{x:15-G,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-G}, ${o/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:c})]}),qo("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[W&&Vo("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),W&&a?.r&&(()=>{const e=a.r(0);return e>1&&t-1>e?Vo("line",{x1:e,y1:0,x2:e,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1,strokeDasharray:"4,4"}):null})(),K.map((t,i)=>{const n=X?0===i?"start":i===K.length-1?"end":"middle":"middle";return qo("g",{transform:`translate(${t.pixel},${o})`,children:[Vo("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),Vo("text",{y:18,textAnchor:n,fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},"val-"+i)}),h&&Vo("text",{x:t/2,y:o+40,textAnchor:"middle",fill:"var(--semiotic-text, #333)",fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]})]}:{children:[qo("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[W&&(()=>{const e=a?.r?a.r(0):o,i=0>e||e>o?o:e;return Vo("line",{x1:0,y1:i,x2:t,y2:i,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})})(),V.map((t,i)=>qo("g",{transform:`translate(${t.pixel},${o})`,children:[Vo("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?Vo("text",{y:18,textAnchor:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):Vo("foreignObject",{x:-30,y:6,width:60,height:24,style:{overflow:"visible"},children:Vo("div",{style:{textAlign:"center",userSelect:"none",...e},children:t.label})})]},"cat-"+i)),c&&Vo("text",{x:t/2,y:o+40,textAnchor:"middle",fill:"var(--semiotic-text, #333)",fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:c})]}),qo("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[W&&Vo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),K.map((t,o)=>qo("g",{transform:`translate(0,${t.pixel})`,children:[Vo("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),Vo("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},"val-"+o)),h&&Vo("text",{x:15-G,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-G}, ${o/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]})]})})})(),ee,S,D]}),Vo(Se,{title:p,totalWidth:i,marginTop:r.top}),mt({legend:f,totalWidth:i,totalHeight:n,margin:r,legendPosition:w,title:p,legendLayout:A,axisChrome:z,legendHoverBehavior:y,legendClickBehavior:v,legendHighlightedCategory:b,legendIsolatedCategories:x})]}):null}import*as Ko from"react";import{jsx as Zo}from"react/jsx-runtime";var Uo=null,Jo=null;function ei(e){const[t,o]=Ko.useState(()=>Uo);return Ko.useEffect(()=>{if(t)return;let e=!1;return(Uo?Promise.resolve(Uo):(Jo||(Jo=import("./c-52TEGIUJ.min.js").then(e=>Uo=e.OrdinalBrushOverlay).catch(e=>{throw Jo=null,e})),Jo)).then(t=>{e||o(()=>t)}),()=>{e=!0}},[t]),t?Zo(t,{...e}):null}import{arc as ti}from"d3-shape";function oi(e,t){const o=t._gradientBand.colors;if(0===o.length)return;const{clipPath:i,slices:n}=Ie({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,cornerRadius:t.cornerRadius,roundStart:t.roundedEnds?.start??!0,roundEnd:t.roundedEnds?.end??!0,colors:o}),r=new Path2D(i);e.save(),e.translate(t.cx,t.cy),e.clip(r);for(const t of n)e.fillStyle=pt(e,t.color)||t.color||"#007bff",e.fill(new Path2D(t.d));e.restore();const a=t.style.strokeWidth??1;t.style.stroke&&"none"!==t.style.stroke&&a>0&&(e.save(),e.translate(t.cx,t.cy),e.strokeStyle=pt(e,t.style.stroke)||t.style.stroke,e.lineWidth=a,e.stroke(r),e.restore())}function ii(e,t){e.beginPath(),t.innerRadius>0?(e.arc(t.cx,t.cy,t.outerRadius,t.startAngle,t.endAngle),e.arc(t.cx,t.cy,t.innerRadius,t.endAngle,t.startAngle,!0)):(e.moveTo(t.cx,t.cy),e.arc(t.cx,t.cy,t.outerRadius,t.startAngle,t.endAngle)),e.closePath()}function ni(e,t){const o={innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle+Math.PI/2,endAngle:t.endAngle+Math.PI/2},i=ti().cornerRadius(t.cornerRadius)(o);if(!i)return;e.save(),e.translate(t.cx,t.cy);const n=new Path2D(i);e.fill(n);const r=t.style.strokeWidth??1;t.style.stroke&&"none"!==t.style.stroke&&r>0&&(e.lineWidth=r,e.stroke(n)),e.restore()}var ri=(e,t,o,i)=>{const n=t.filter(e=>"wedge"===e.type);for(const t of n){const o=t.style.strokeWidth??1,i=t.style.stroke,n=!(!i||"none"===i||0>=o);if(e.globalAlpha=(t.style.fillOpacity??1)*(t.style.opacity??1),t._gradientBand&&t._gradientBand.colors.length>0)oi(e,t),t._pulseIntensity&&t._pulseIntensity>0&&(ii(e,t),te(e,t)),e.globalAlpha=1;else{if(e.fillStyle=ft(e,t.style.fill,"#007bff"),t.roundedEnds){n&&(e.strokeStyle=pt(e,i)||i,e.lineWidth=o);const r=Me({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,cornerRadius:t.cornerRadius,roundStart:t.roundedEnds.start,roundEnd:t.roundedEnds.end});e.save(),e.translate(t.cx,t.cy);const a=new Path2D(r);e.fill(a),n&&e.stroke(a),e.restore()}else t.cornerRadius?(n&&(e.strokeStyle=pt(e,i)||i,e.lineWidth=o),ni(e,t)):(ii(e,t),e.fill(),n&&(e.strokeStyle=pt(e,i)||i,e.lineWidth=o,e.stroke()));t._pulseIntensity&&t._pulseIntensity>0&&(ii(e,t),te(e,t)),e.globalAlpha=1}}},ai=(e,t,o,i)=>{const n=t.filter(e=>"boxplot"===e.type);for(const t of n){const o=t.columnWidth/2,i="vertical"===t.projection,n=pt(e,"var(--semiotic-primary, #007bff)"),r=pt(e,"var(--semiotic-text, #333)"),a=ft(e,t.style.fill,n),s=t.style.stroke,l="string"==typeof s?pt(e,s)||s:r,c=t.style.strokeWidth??1,h=c>0&&!("string"==typeof s&&"none"===s.trim().toLowerCase()),d=t.style.fillOpacity??t.style.opacity??.6;if(e.save(),h&&(e.strokeStyle=l,e.lineWidth=c,e.beginPath(),i?(e.moveTo(t.x,t.minPos),e.lineTo(t.x,t.maxPos)):(e.moveTo(t.minPos,t.y),e.lineTo(t.maxPos,t.y)),e.stroke(),e.beginPath(),i?(e.moveTo(t.x-.4*o,t.minPos),e.lineTo(t.x+.4*o,t.minPos),e.moveTo(t.x-.4*o,t.maxPos),e.lineTo(t.x+.4*o,t.maxPos)):(e.moveTo(t.minPos,t.y-.4*o),e.lineTo(t.minPos,t.y+.4*o),e.moveTo(t.maxPos,t.y-.4*o),e.lineTo(t.maxPos,t.y+.4*o)),e.stroke()),e.globalAlpha=d,e.fillStyle=a,i){const i=Math.min(t.q1Pos,t.q3Pos),n=Math.abs(t.q3Pos-t.q1Pos);e.fillRect(t.x-o,i,t.columnWidth,n),e.globalAlpha=1,h&&e.strokeRect(t.x-o,i,t.columnWidth,n)}else{const i=Math.min(t.q1Pos,t.q3Pos),n=Math.abs(t.q3Pos-t.q1Pos);e.fillRect(i,t.y-o,n,t.columnWidth),e.globalAlpha=1,h&&e.strokeRect(i,t.y-o,n,t.columnWidth)}h&&(e.strokeStyle=l,e.lineWidth=2*c,e.beginPath(),i?(e.moveTo(t.x-o,t.medianPos),e.lineTo(t.x+o,t.medianPos)):(e.moveTo(t.medianPos,t.y-o),e.lineTo(t.medianPos,t.y+o)),e.stroke()),e.restore()}},si=(e,t,o,i)=>{const n=t.filter(e=>"violin"===e.type);for(const t of n){e.save(),(t.translateX||t.translateY)&&e.translate(t.translateX,t.translateY);const o=new Path2D(t.pathString);e.globalAlpha=t.style.fillOpacity??t.style.opacity??.6,e.fillStyle=ft(e,t.style.fill,"#007bff"),e.fill(o),e.globalAlpha=1;const i=t.style.strokeWidth??1;if(t.style.stroke&&"none"!==t.style.stroke&&i>0&&(e.strokeStyle=pt(e,t.style.stroke)||t.style.stroke,e.lineWidth=i,e.stroke(o)),t.iqrLine){e.strokeStyle="#333",e.lineWidth=2,e.globalAlpha=.8;const o=t.iqrLine.centerPos,i=!1!==t.iqrLine.isVertical;e.beginPath(),i?(e.moveTo(o,t.iqrLine.q1Pos),e.lineTo(o,t.iqrLine.q3Pos)):(e.moveTo(t.iqrLine.q1Pos,o),e.lineTo(t.iqrLine.q3Pos,o)),e.stroke(),e.beginPath(),i?e.arc(o,t.iqrLine.medianPos,3,0,2*Math.PI):e.arc(t.iqrLine.medianPos,o,3,0,2*Math.PI),e.fillStyle="#fff",e.fill(),e.strokeStyle="#333",e.lineWidth=1,e.stroke(),e.globalAlpha=1}e.restore()}},li=(e,t,o,i)=>{const n=t.filter(e=>"connector"===e.type);if(0===n.length)return;const r=new Map;for(const e of n){const t=e.group||"_default";r.has(t)||r.set(t,[]),r.get(t).push(e)}for(const[,t]of r){if(0===t.length)continue;const o=t[0].style;if(o.fill&&"none"!==o.fill){e.beginPath(),e.moveTo(t[0].x1,t[0].y1);for(const o of t)e.lineTo(o.x2,o.y2);e.closePath(),e.globalAlpha=o.fillOpacity??o.opacity??.3,e.fillStyle=He(e,o.fill)??"#999",e.fill(),e.globalAlpha=1}for(const o of t){const t=o.style.strokeWidth??1;t>0&&"none"!==o.style.stroke&&(e.beginPath(),e.moveTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.strokeStyle=pt(e,o.style.stroke)||ft(e,o.style.fill,"")||pt(e,"var(--semiotic-border, #999)"),e.lineWidth=t,e.globalAlpha=o.style.opacity??.5,e.stroke(),e.globalAlpha=1)}}},ci=(e,t,o,i)=>{const n=t.filter(e=>"trapezoid"===e.type);for(const t of n){const o=t.points;if(4>o.length)continue;e.globalAlpha=t.style?.opacity??1,e.beginPath(),e.moveTo(o[0][0],o[0][1]);for(let t=1;o.length>t;t++)e.lineTo(o[t][0],o[t][1]);e.closePath(),e.fillStyle=He(e,t.style?.fill)||"#999",e.fill();const i=t.style?.strokeWidth??1;t.style?.stroke&&"none"!==t.style.stroke&&i>0&&(e.strokeStyle=pt(e,t.style.stroke)||t.style.stroke,e.lineWidth=i,e.stroke()),e.globalAlpha=1}};function hi(e){return 1e6>e?1e4>e?1e3>e?e+"":(e/1e3).toFixed(1)+"K":(e/1e3).toFixed(0)+"K":(e/1e6).toFixed(1)+"M"}function di(e){return.05>Math.abs(e-Math.round(e))?Math.round(e)+"%":e.toFixed(1)+"%"}var ui=new Map;function mi(e,t){const o=`${e}@${"undefined"!=typeof window&&window.devicePixelRatio||1}`,i=ui.get(o);if(void 0!==i)return i;const n=Ee({background:e,stroke:"rgba(255,255,255,0.5)",lineWidth:1.5,spacing:6,angle:45},t),r=et(n)?null:n;return ui.set(o,r),r}function gi(e,t,o,i,n,r){e.moveTo(t+r,o),e.lineTo(t+i-r,o),e.quadraticCurveTo(t+i,o,t+i,o+r),e.lineTo(t+i,o+n-r),e.quadraticCurveTo(t+i,o+n,t+i-r,o+n),e.lineTo(t+r,o+n),e.quadraticCurveTo(t,o+n,t,o+n-r),e.lineTo(t,o+r),e.quadraticCurveTo(t,o,t+r,o),e.closePath()}function pi(e){return 1e6>e?1e4>e?1e3>e?Math.round(e)+"":(e/1e3).toFixed(1)+"K":(e/1e3).toFixed(0)+"K":(e/1e6).toFixed(1)+"M"}function fi(e){return.05>Math.abs(e-Math.round(e))?Math.round(e)+"%":e.toFixed(1)+"%"}function yi(e){return"rect"===e.type||"point"===e.type||"symbol"===e.type||"glyph"===e.type}function vi(e){return(t,o,i,n)=>{e(t,o.filter(yi),{x:i.r,y:i.r},n)}}var bi=vi(r),xi=vi(I),wi=vi(b),Ai=vi(Z),Si=e=>[li,...e],ki={bar:Si([bi]),clusterbar:Si([bi]),point:Si([xi,wi]),swarm:Si([xi,wi]),pie:[ri],donut:[ri],boxplot:Si([ai,xi]),violin:Si([si]),histogram:Si([bi]),ridgeline:Si([si]),timeline:Si([bi]),funnel:[bi,ci,(e,t,o,i)=>{const n=t.filter(e=>"rect"===e.type&&null!=e.datum);if(0!==n.length&&n.some(e=>null!=e.datum?.__funnelStepLabel||null!=e.datum?.__funnelValueLabelX)){e.textBaseline="top",e.lineJoin="round",e.textAlign="center",e.font="bold 14px sans-serif";for(const t of n){const o=t.datum;if(!o)continue;if(!o.__funnelStepLabel)continue;const i=o.__funnelStepLabel;if(e.measureText(i).width+16>(o.__funnelRowWidth??o.__funnelBarW??0))continue;const n=o.__funnelStepLabelX,r=o.__funnelStepLabelY+3;e.strokeStyle="rgba(0,0,0,0.6)",e.lineWidth=3,e.strokeText(i,n,r),e.fillStyle="#fff",e.fillText(i,n,r)}e.font="bold 13px sans-serif";for(const t of n){const o=t.datum;if(!o)continue;if(null==o.__funnelValueLabelX)continue;const i=o.__funnelBarW??0;if(60>i)continue;const n=o.__funnelValue;if(null==n||0===n)continue;const r=o.__funnelPercent,a=!0===o.__funnelIsFirstStep;let s;if(s=a?hi(n):null!=r?`${hi(n)} (${di(r)})`:hi(n),e.measureText(s).width+16>i){if(a||null==r)continue;if(s=hi(n),e.measureText(s).width+16>i)continue}const l=o.__funnelValueLabelX,c=(o.__funnelValueLabelY??t.y)+14+5;e.textAlign="center",e.strokeStyle="rgba(0,0,0,0.5)",e.lineWidth=3,e.strokeText(s,l,c),e.fillStyle="#fff",e.fillText(s,l,c)}e.lineWidth=1,e.lineJoin="miter"}}],"bar-funnel":[bi,(e,t,o,i)=>{const n=t.filter(e=>"rect"===e.type&&!0===e.datum?.__barFunnelIsDropoff);for(const t of n){const o=("string"==typeof t.style.fill?t.style.fill:null)||pt(e,"var(--semiotic-border, #999)"),i=mi(o,e);e.globalAlpha=t.style.opacity??1,e.beginPath(),e.rect(t.x,t.y,t.w,t.h),i?e.fillStyle=i:(e.fillStyle=o,e.globalAlpha=.4*(t.style.opacity??1)),e.fill(),e.globalAlpha=1}},(e,t,o,i)=>{const n=t.filter(e=>"rect"===e.type&&!0!==e.datum?.__barFunnelIsDropoff&&null!=e.datum?.__barFunnelLabelX);if(0===n.length)return;const r=function(e,t){const[o,i,n]=ct(e,t);return(.2126*o+.7152*i+.0722*n)/255>.6}(e,pt(e,"var(--semiotic-text, #333)")),a=r?"#1f2937":"#ffffff",s=r?"rgba(255,255,255,0.18)":"rgba(0,0,0,0.12)",l=r?"#f3f4f6":"#1a1a1a",c=l;for(const t of n){const o=t.datum;if(!o)continue;const i=o.__barFunnelValue;if(null==i)continue;if(25>t.w)continue;const n=o.__barFunnelPercent,r=!(!0===o.__barFunnelIsFirstStep)&&null!=n,h=r?fi(n):"",d=pi(i);e.font="bold 13px sans-serif";const u=r?e.measureText(h).width:0;e.font="11px sans-serif";const m=e.measureText(d).width,g=Math.max(u,m)+12,p=r?32:17,f=o.__barFunnelLabelX,y=f-g/2,v=o.__barFunnelLabelY-p-4;e.save(),e.shadowColor="rgba(0,0,0,0.15)",e.shadowBlur=4,e.shadowOffsetY=1,e.fillStyle=a,e.beginPath(),gi(e,y,v,g,p,4),e.fill(),e.restore(),e.strokeStyle=s,e.lineWidth=.5,e.beginPath(),gi(e,y,v,g,p,4),e.stroke(),e.textAlign="center",e.textBaseline="top",r?(e.font="bold 13px sans-serif",e.fillStyle=l,e.fillText(h,f,v+3),e.font="11px sans-serif",e.fillStyle=c,e.fillText(d,f,v+3+13+2)):(e.font="bold 11px sans-serif",e.fillStyle=l,e.fillText(d,f,v+3))}e.lineWidth=1}],swimlane:Si([bi]),custom:Si([bi,xi,wi,Ai,ri,ai,si,ci])};import*as Ci from"react";import{jsx as _i,jsxs as Ri}from"react/jsx-runtime";function Pi(e){return"connector"===e.node.type}function Li(e,t,o,i){if(2>e.length)return null;const n=e[0].node,r=n.style.fill;if(!r||"none"===r)return null;const a=wt(`${t?t+"-":""}connector-${o}-${i}-hatch`),s=et(r)?Ve(r,a):null,l=[`${n.x1},${n.y1}`,...e.map(({node:e})=>`${e.x2},${e.y2}`)].join(" "),c=Ri(Ci.Fragment,{children:[s&&_i("defs",{children:s}),_i("polygon",{points:l,fill:s?`url(#${a})`:Ct(r,"#999"),opacity:n.style.fillOpacity??n.style.opacity??.3,"data-semiotic-connector-fill":n.group||"_default"})]});return zt(c,n,`ordinal-connector-fill-${o}-${i}`)}function Mi(e,t,o){const i=new Map;for(const t of e){if(!Pi(t))continue;const e=t.node.group||"_default",o=i.get(e);o?o.push(t):i.set(e,[t])}if(0===i.size)return;const n=Array.from(i.values()).map((e,i)=>Ri("g",{children:[Li(e,t,o,i),e.map(e=>e.element)]},`ordinal-connectors-${o}-${i}`)),r=e[0],a=Pi(r)?null:r.element;for(const e of i.values())for(const t of e)t.element=null;r.element=Ri(Ci.Fragment,{children:[n,a]},"ordinal-connector-run-"+o)}function Ii(e){const t=oe({nodes:e.nodes,renderMode:e.renderMode,fallback:(t,o)=>lt(t,o,e.idPrefix)});let o=0;for(let i=0;t.length>i;){if(t[i].renderedByBackend){i++;continue}let n=i+1;for(;t.length>n&&!t[n].renderedByBackend;)n++;Mi(t.slice(i,n),e.idPrefix,o++),i=n}return t}import{jsx as Ti,jsxs as Hi}from"react/jsx-runtime";function Bi(e){const t=kt(e,{skipPositional:!1});return null==t.title&&0===t.entries.length?null:Hi("div",{className:"semiotic-tooltip",style:Ne,children:[null!=t.title&&Ti("div",{style:{fontWeight:"bold"},children:t.title+""}),t.entries.map(e=>Hi("div",{children:[Hi("span",{style:{opacity:.7},children:[e.key,":"]})," ","number"==typeof e.value?e.value.toLocaleString():e.value+""]},e.key))]})}function Oi({hover:e}){const t=e.data||{},o=e.stats,i=e.category;if(Array.isArray(t)){const e=i||t[0]?.category||"";if(o)return Hi("div",{className:"semiotic-tooltip",style:Ne,children:[e&&Ti("div",{style:{fontWeight:"bold"},children:e+""}),Hi("div",{children:["n = ",o.n]}),Hi("div",{children:["Min: ",o.min.toLocaleString()]}),Hi("div",{children:["Q1: ",o.q1.toLocaleString()]}),Hi("div",{children:["Median: ",o.median.toLocaleString()]}),Hi("div",{children:["Q3: ",o.q3.toLocaleString()]}),Hi("div",{children:["Max: ",o.max.toLocaleString()]}),Hi("div",{style:{opacity:.8},children:["Mean: ",o.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});const n=t.length;return Hi("div",{className:"semiotic-tooltip",style:Ne,children:[e&&Ti("div",{style:{fontWeight:"bold"},children:e+""}),Hi("div",{children:[n," items"]})]})}if(null!=t.bin&&null!=t.count){const e=t.range||[];return Hi("div",{className:"semiotic-tooltip",style:Ne,children:[t.category&&Ti("div",{style:{fontWeight:"bold"},children:t.category+""}),Hi("div",{children:["Count: ",t.count]}),2===e.length&&Hi("div",{style:{opacity:.8},children:[Number(e[0]).toFixed(1)," – ",Number(e[1]).toFixed(1)]})]})}const n=e.__oAccessor,r=e.__rAccessor,a=e.__chartType;if("swarm"===a||"point"===a)return Bi(t);const s=(n&&null!=t[n]?t[n]:null)||t.category||t.name||t.group||t.__rName||"",l=t.__aggregateValue??(r&&null!=t[r]?t[r]:null)??t.value??t.__rValue??t.pct??"";return s||""!==l?Hi("div",{className:"semiotic-tooltip",style:Ne,children:[s&&Ti("div",{style:{fontWeight:"bold"},children:s+""}),""!==l&&Ti("div",{children:"number"==typeof l?l.toLocaleString():l+""})]}):Bi(t)}Oi.ownsChrome=!0;import{jsx as Di,jsxs as Fi}from"react/jsx-runtime";var Ei=p,Ni=Yt(Xt(function(e,t){const{chartType:o,runtimeMode:n,data:r,oAccessor:s="category",rAccessor:l="value",colorAccessor:u,symbolAccessor:m,symbolMap:g,stackBy:p,groupBy:f,multiAxis:y,timeAccessor:v,valueAccessor:b,categoryAccessor:x,accessorRevision:w,projection:A="vertical",size:S=[600,400],responsiveWidth:k,responsiveHeight:C,margin:_,maxDevicePixelRatio:R,barPadding:P,roundedTop:L,gradientFill:M,trackFill:I,baselinePadding:T,innerRadius:B,cornerRadius:N,normalize:j,startAngle:W,sweepAngle:z,dynamicColumnWidth:$,bins:G,showOutliers:q,showIQR:X,amplitude:Y,connectorOpacity:Q,showLabels:K,connectorAccessor:Z,connectorStyle:U,dataIdAccessor:J,rExtent:te,oExtent:oe,extentPadding:ce=.05,oSort:de,windowMode:ue="sliding",windowSize:me=200,pieceStyle:ge,summaryStyle:be,renderMode:Ae,colorScheme:Se,barColors:ke,showAxes:Pe=!0,showCategoryTicks:Le,categoryLabel:Me,valueLabel:Ie,categoryFormat:Te,valueFormat:He,oLabel:Oe,rLabel:De,oFormat:Fe,rFormat:Ee,rTickValues:Ne,tickLabelEdgeAlign:We,axisExtent:$e,enableHover:Ge=!0,hoverRadius:Ve=30,hoverAnnotation:qe,tooltipContent:Xe,customHoverBehavior:Ye,customClickBehavior:Qe,onObservation:Ke,annotationObservationCallback:Ze,chartId:Ue,annotations:et,onAnnotationActivate:ot,autoPlaceAnnotations:it,svgAnnotationRules:nt,showGrid:rt=!1,legend:at,legendHoverBehavior:lt,legendClickBehavior:ct,legendHighlightedCategory:dt,legendIsolatedCategories:ut,legendPosition:mt,legendLayout:gt,legendCategoryAccessor:pt,onCategoriesChange:ft,backgroundGraphics:yt,foregroundGraphics:vt,title:bt,className:xt,background:wt,centerContent:kt,decay:Ct,pulse:_t,transition:Pt,animate:Lt,staleness:It,frameScheduler:Tt,clock:Ft,random:Et,seed:Nt,paused:Wt=!1,suspendWhenHidden:zt=!0,brush:$t,onBrush:Vt,accessibleTable:qt=!0,description:Xt,summary:Yt,customLayout:to,onLayoutError:oo,layoutConfig:io,layoutSelection:no}=e,{customHoverBehavior:ro,customClickBehavior:ao,hasClickBehavior:so}=F({customHoverBehavior:Ye,customClickBehavior:Qe,onObservation:Ke,chartId:Ue,chartType:"StreamOrdinalFrame"}),lo=x??s,co=b??l,ho=Me??Oe,uo=Ie??De,mo=Te??Fe,go=He??Ee,po=Jt(!0),fo=Ht({sizeProp:S,responsiveWidth:k,responsiveHeight:C,userMargin:_,marginDefault:Ei,title:bt,legend:at,legendPosition:mt,...h(e,at),animate:Lt,transitionProp:Pt,frameScheduler:Tt,clock:Ft,random:Et,seed:Nt,paused:Wt,suspendWhenHidden:zt,themeDirtyRef:po}),{reducedMotionRef:yo,responsiveRef:vo,size:bo,margin:xo,adjustedWidth:wo,adjustedHeight:Ao,currentTheme:So,transition:ko,introEnabled:Co,tableId:Ro,rafRef:Po,renderFnRef:Lo,scheduleRender:Mo,frameRuntime:Io}=fo,To=Ot(),Ho=jt(),Bo=Ut(()=>je(r),[r]),Oo=Jt(null),Do=Jt(!1),[Fo,Eo]=eo(null),[No,zo]=eo(null),$o=ie(vt,bo,xo,No),Go=ie(yt,bo,xo,No),Vo=yt||"transparent"===wt?null:Di("rect",{className:"semiotic-canvas-background","data-semiotic-layer":"canvas-background",x:-xo.left,y:-xo.top,width:bo[0],height:bo[1],fill:wt||"var(--semiotic-bg, transparent)"}),qo=yt&&wt&&"transparent"!==wt?Di("rect",{className:"semiotic-canvas-background semiotic-canvas-background--combined","data-semiotic-layer":"canvas-background",x:-xo.left,y:-xo.top,width:bo[0],height:bo[1],fill:wt}):null,[Yo,Ko]=eo(0),Zo=Jt(0),[Uo,Jo]=eo(!1),ti=Jt({w:-1,h:-1}),oi=Jt(!1),ii=Dt("StreamOrdinalFrame"),ni=Ge||qe,ri="streaming"===n,ai=Ut(()=>({chartType:o,runtimeMode:ri?"streaming":"bounded",windowSize:me,windowMode:ue,extentPadding:ce,projection:A,oAccessor:ri?void 0:lo,rAccessor:ri?void 0:co,accessorRevision:w,colorAccessor:u,symbolAccessor:m,symbolMap:g,stackBy:p,groupBy:f,multiAxis:y,timeAccessor:ri?v:void 0,valueAccessor:ri?b||("string"==typeof co||"function"==typeof co?co:void 0):void 0,categoryAccessor:ri?lo:void 0,rExtent:te,oExtent:oe,axisExtent:$e,barPadding:P,roundedTop:L,gradientFill:c(M),trackFill:I,baselinePadding:T,innerRadius:B,cornerRadius:N,normalize:j,startAngle:W,sweepAngle:z,dynamicColumnWidth:$,bins:G,showOutliers:q,showIQR:X,amplitude:Y,connectorOpacity:Q,showLabels:K,connectorAccessor:Z,connectorStyle:U,dataIdAccessor:J,oSort:de,pieceStyle:ge,summaryStyle:be,colorScheme:Se,themeCategorical:So?.colors?.categorical,themeSemantic:Gt(So),themeSequential:So?.colors?.sequential,themeDiverging:So?.colors?.diverging,barColors:ke,decay:Ct,pulse:_t,transition:ko,introAnimation:Co,staleness:It,clock:Io.now,customLayout:to,onLayoutError:oo,layoutConfig:io,layoutMargin:xo}),[o,ri,me,ue,ce,A,lo,co,w,u,m,g,p,f,y,v,b,te,oe,$e,P,L,M,I,T,B,N,j,W,z,$,G,q,X,Y,Q,K,Z,U,J,de,ge,be,Se,So,ke,Ct,_t,ko,Co,It,Io.now,to,oo,io,xo]),si=se(ai),li=Jt(null);li.current||(li.current=new _o(si));const ci=O(li,pt,ft,e=>e.getData());re(li,si,po,Mo),ae(li,no,po,Mo);const hi=Jt(null);hi.current||(hi.current=new i(e=>{const t=li.current;t&&t.ingest(e)&&(po.current=!0,Mo())}));const di=Qt(e=>{hi.current?.push(e)},[]),ui=Qt(e=>{hi.current?.pushMany(e)},[]),mi=Qt(()=>{hi.current?.clear(),li.current?.clear(),po.current=!0,Mo()},[Mo]),gi=Qt(e=>{hi.current?.clearLastData(),hi.current?.setReplacementData(e)},[]);Zt(t,()=>({push:di,pushMany:ui,replace:gi,remove:e=>{hi.current?.flush();const t=li.current?.remove(e)??[];if(t.length>0){const e=Oo.current?.data;!!Oo.current&&t.some(Array.isArray(e)?t=>e.includes(t):t=>t===e)&&(Oo.current=null,Eo(null)),po.current=!0,Mo()}return t},update:(e,t)=>{hi.current?.flush();const o=li.current?.update(e,t)??[];return o.length>0&&(po.current=!0,Mo()),o},clear:mi,getData:()=>(hi.current?.flush(),li.current?.getData()??[]),getScales:()=>li.current?.scales??null,getCustomLayout:()=>li.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>li.current?.lastCustomLayoutFailure??null}),[di,ui,gi,mi,Mo]),Kt(()=>{r&&hi.current?.setBoundedData(Bo)},[r,Bo]);const{canvasRef:pi,resolutionDirtyRef:fi}=Bt(fo,{storeRef:li,dirtyRef:po,hydrated:To,wasHydratingFromSSR:Ho,cleanup:()=>hi.current?.clear(),maxDevicePixelRatio:R,canvasPaintDependencies:[o,wo,Ao,Pe,wt,yt,Ae,Mo]}),{hoverHandlerRef:yi,hoverLeaveRef:vi,onPointerMove:bi,onPointerLeave:xi,pointerStateRef:wi}=fo;yi.current=e=>{const t=pi.current;if(!t)return;const i=li.current;if(!i)return void St(t);const n=jo({pointer:e,canvasRect:t.getBoundingClientRect(),margin:{left:xo.left,top:xo.top},width:wo,height:Ao,projection:A,hoverRadius:Ve,scene:i.scene,pointQuadtree:i.pointQuadtree,maxPointRadius:i.maxPointRadius});if(St(t,"hit"===n.kind?At(n.hit.node):void 0),!ni)return;if("hit"!==n.kind)return void(Oo.current&&(Oo.current=null,Eo(null),ro&&ro(null),Mo()));const r=Wo(n.hit,{oAccessor:lo,rAccessor:co,chartType:o});Oo.current=r,Eo(r),ro?.(r),Mo()},vi.current=()=>{St(pi.current),Oo.current&&(Oo.current=null,Eo(null),ro?.(null),Mo())},Mt(pi);const Ai=Qt(e=>{if(Je(e.target))return;if(!ao)return;const t=pi.current;if(!t)return ao(null),void Mo();const i=li.current;if(!i)return ao(null),void Mo();const n=jo({pointer:e,canvasRect:t.getBoundingClientRect(),margin:{left:xo.left,top:xo.top},width:wo,height:Ao,projection:A,hoverRadius:Ve,scene:i.scene,pointQuadtree:i.pointQuadtree,maxPointRadius:i.maxPointRadius});if("hit"!==n.kind)return ao(null),void Mo();ao(Wo(n.hit,{oAccessor:lo,rAccessor:co,chartType:o}),{type:"activate",inputType:st(e.nativeEvent.pointerType)}),Mo()},[ao,pi,xo.left,xo.top,wo,Ao,A,Ve,lo,co,o,Mo]),{kbFocusIndexRef:Si,focusedNavPointRef:Ci,onKeyDown:_i}=D({storeRef:li,hoverRef:Oo,setHoverPoint:Eo,customHoverBehavior:ro,customClickBehavior:ao,scheduleRender:Mo,chartType:o,oAccessor:lo,rAccessor:co}),Ri=Qt(e=>{ne(wi,e,!!ni,Do.current,pi.current,"mouse")&&(Si.current=-1,Ci.current=null,bi(e))},[pi,ni,Ci,Si,bi,wi]);Lo.current=()=>{if(Po.current=null,!Io.isActive)return;const e=pi.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const i=li.current;if(!i)return;const n=Io.now(),r=null!=i.activeTransition,a=i.advanceTransition(yo.current?n+1e6:n),s=!yo.current&&a,l=ti.current.w!==wo||ti.current.h!==Ao,c=po.current,h=i.consumeStylePaintPending();let d=!1;const u=ii.current.beforeCompute(i.getLastUpdateResult(),s);var m;!c&&!l||s&&!l||(i.computeScene({width:wo,height:Ao}),ti.current={w:wo,h:Ao},d=!0,ci()),(d||h)&&(Do.current=Rt(e,i.scene)),Do.current&&(r||d||h)&&ht((m={canvas:e,pointer:wi.current,store:i,margin:{left:xo.left,top:xo.top},width:wo,height:Ao,projection:A,hoverRadius:Ve,geometryMoved:r||d}).canvas,m.pointer,e=>{const t=jo({pointer:e,canvasRect:m.canvas.getBoundingClientRect(),margin:m.margin,width:m.width,height:m.height,projection:m.projection,hoverRadius:m.hoverRadius,scene:m.store.scene,pointQuadtree:m.geometryMoved?null:m.store.pointQuadtree,maxPointRadius:m.store.maxPointRadius});return"hit"===t.kind?At(t.hit.node):void 0}),ii.current.afterCompute(u,d,l),po.current=c&&s&&!d,fi.current=!1;const g=H(i,n,d,oi);(d||s)&&e.setAttribute("aria-label",Be(i.scene,o+" chart"));const p=ze(R),f=bo[0]*p,y=bo[1]*p;e.width===f&&e.height===y||(e.width=f,e.height=y,e.style.width=bo[0]+"px",e.style.height=bo[1]+"px"),t.setTransform(p,0,0,p,0,0),t.clearRect(0,0,bo[0],bo[1]);const v=It&&i.lastIngestTime>0&&n-i.lastIngestTime>(It?.threshold??5e3);v&&(t.globalAlpha=It?.dimOpacity??.5);const b="radial"===A;t.save(),t.beginPath(),t.rect(xo.left,xo.top,wo,Ao),t.clip(),b?(t.save(),t.translate(xo.left+wo/2,xo.top+Ao/2)):t.translate(xo.left,xo.top);const x=to?ki.custom:ki[o]||[],w={width:wo,height:Ao},S=i.scales;S&&ee({context:t,nodes:i.scene,renderMode:Ae,pixelRatio:p,paintBuiltIn:e=>{for(const o of x)o(t,e,S,w)}}),b&&t.restore(),t.restore(),v&&(t.globalAlpha=1),d&&i.scales?(zo(i.scales),Ko(e=>e+1),Zo.current=n):s&&i.scales&&n-Zo.current>=33&&(Ko(e=>e+1),Zo.current=n),It?.showBadge&&Jo(!!v),(s||null!=i.activeTransition||g.pending)&&Mo()},le(It,li,po,Mo,Io.now,Uo,Jo);const Pi=ni&&Fo?Xe?Xe(Fo):Di(Oi,{hover:Fo}):null,Li="radial"===A,Mi=Pi?Di(xe,{x:Fo?Li?Fo.x+wo/2:Fo.x:0,y:Fo?Li?Fo.y+Ao/2:Fo.y:0,containerWidth:wo,containerHeight:Ao,margin:xo,className:"stream-ordinal-tooltip",children:Pi}):null,Ti="horizontal"===A?lo:co,Hi=d("horizontal"===A?co:lo,void 0,"__semiotic_resolvedO",""),Bi=d(Ti,void 0,"__semiotic_resolvedR",""),Ni=Hi.key,ji=Bi.key,Wi=a(Hi,Bi,et&&et.length>0||!1);if(tt||!To&&Ho){const e=li.current;e&&r&&(e.ingest({inserts:Bo,bounded:!0}),e.computeScene({width:wo,height:Ao}));const t=e?.scene??[],o=e?.scales??null,i=ie(vt,bo,xo,o),n=ie(yt,bo,xo,o),a="radial"===A,s=a?xo.left+wo/2:xo.left,l=a?xo.top+Ao/2:xo.top;return Fi("div",{ref:vo,className:"stream-ordinal-frame"+(xt?" "+xt:""),role:"img","aria-label":Xt||("string"==typeof bt?bt:"Ordinal chart"),style:{position:"relative",width:k?"100%":bo[0],height:C?"100%":bo[1]},children:[Di(_e,{summary:Yt}),Fi("svg",{xmlns:"http://www.w3.org/2000/svg",width:bo[0],height:bo[1],style:{position:"absolute",left:0,top:0},children:[Fi("g",{transform:`translate(${xo.left},${xo.top})`,children:[wt&&Di("rect",{x:0,y:0,width:wo,height:Ao,fill:wt}),n]}),Di("g",{transform:`translate(${s},${l})`,children:Ii({nodes:t,renderMode:Ae,idPrefix:Ro}).map(e=>e.element)})]}),Di(Qo,{width:wo,height:Ao,totalWidth:bo[0],totalHeight:bo[1],margin:xo,scales:o,showAxes:Pe,showCategoryTicks:Le,oLabel:ho,rLabel:uo,oFormat:mo,rFormat:go,rTickValues:Ne,tickLabelEdgeAlign:We,axisExtent:$e,showGrid:rt,title:bt,legend:at,legendHoverBehavior:lt,legendClickBehavior:ct,legendHighlightedCategory:dt,legendIsolatedCategories:ut,legendPosition:mt,legendLayout:gt,foregroundGraphics:V(i,he(li.current?.customLayoutOverlays,no??null)),annotations:et,onAnnotationActivate:ot,onObservation:Ze??Ke,chartId:Ue,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:it,svgAnnotationRules:nt,annotationFrame:0,xAccessor:Ni,yAccessor:ji,annotationData:Wi(e?.getData())}),kt&&"radial"===A&&Di("div",{style:{position:"absolute",left:xo.left+wo/2,top:xo.top+Ao/2,transform:"translate(-50%, -50%)",pointerEvents:"none",textAlign:"center"},children:kt})]})}return Fi("div",{ref:vo,className:"stream-ordinal-frame"+(xt?" "+xt:""),role:"group","aria-label":Xt||("string"==typeof bt?bt:"Ordinal chart"),tabIndex:0,style:{position:"relative",width:k?"100%":bo[0],height:C?"100%":bo[1],overflow:"visible"},onKeyDown:_i,children:["production"!==process.env.NODE_ENV&&li.current&&Di(Ce,{store:li.current,diagnostics:ii.current}),qt&&Fi(fe,{accessibleTable:qt,children:[Di(Re,{tableId:Ro}),Di(pe,{scene:li.current?.scene??[],chartType:o+" chart",tableId:Ro,chartTitle:"string"==typeof bt?bt:void 0})]}),Di(_e,{summary:Yt}),Di(ye,{hoverPoint:Fo}),Fi("div",{role:"img","aria-label":Xt||("string"==typeof bt?bt:"Ordinal chart"),style:{position:"relative",width:"100%",height:"100%"},onMouseMove:Ri,onMouseLeave:xi,onClick:so?Ai:void 0,children:[Fi(ve,{size:bo,margin:xo,children:[qo,Vo,Go]}),Di(Xo,{width:wo,height:Ao,totalWidth:bo[0],totalHeight:bo[1],margin:xo,scales:No,showAxes:Pe,showGrid:rt,rFormat:go,rTickValues:Ne,axisExtent:$e}),Di("canvas",{ref:pi,"aria-label":Be(li.current?.scene??[],o+" chart"),style:{position:"absolute",top:0,left:0,width:bo[0],height:bo[1]}}),Di(Qo,{width:wo,height:Ao,totalWidth:bo[0],totalHeight:bo[1],margin:xo,scales:No,showAxes:Pe,showCategoryTicks:Le,oLabel:ho,rLabel:uo,oFormat:mo,rFormat:go,rTickValues:Ne,axisExtent:$e,showGrid:rt,title:bt,legend:at,legendHoverBehavior:lt,legendClickBehavior:ct,legendHighlightedCategory:dt,legendIsolatedCategories:ut,legendPosition:mt,legendLayout:gt,foregroundGraphics:V($o,he(li.current?.customLayoutOverlays,no??null)),annotations:et,onAnnotationActivate:ot,onObservation:Ze??Ke,chartId:Ue,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:it,svgAnnotationRules:nt,annotationFrame:Yo,xAccessor:Ni,yAccessor:ji,annotationData:Wi(li.current?.getData()),underlayRendered:!0,canvasObscuresUnderlay:!1}),($t||Vt)&&"radial"!==A&&Di(ei,{width:wo,height:Ao,totalWidth:bo[0],totalHeight:bo[1],margin:xo,scales:No,onBrush:Vt||(()=>{})}),kt&&"radial"===A&&Di("div",{style:{position:"absolute",left:xo.left+wo/2,top:xo.top+Ao/2,transform:"translate(-50%, -50%)",pointerEvents:"none",textAlign:"center"},children:kt}),It?.showBadge&&Di(E,{isStale:Uo,position:It.badgePosition}),Di(we,{active:Si.current>=0,hoverPoint:Fo,margin:xo,size:bo,shape:Ci.current?.shape,width:Ci.current?.w,height:Ci.current?.h}),Mi]})]})}));Ni.displayName="StreamOrdinalFrame";var ji=Ni;import{useMemo as Wi,forwardRef as zi,useRef as $i}from"react";import{useImperativeHandle as Gi}from"react";function Vi({ref:e,frameRef:t,setup:o}){return Gi(e,()=>({push:e=>t.current?.push(e),pushMany:e=>t.current?.pushMany(e),remove:e=>t.current?.remove(e)??[],update:(e,o)=>t.current?.update(e,o)??[],replace:e=>t.current?.replace(e),clear:()=>t.current?.clear(),getData:()=>t.current?.getData()??[],getScales:()=>t.current?.getScales()??null}),[t]),{effectiveLegendProps:o.legendBehaviorProps,effectiveMargin:o.margin}}import{useMemo as qi}from"react";function Xi(e){const{colorBy:t,colorScale:o,color:i,themeCategorical:n,colorScheme:r,categoryIndexMap:a,userPieceStyle:s,stroke:l,strokeWidth:c,opacity:h,effectiveSelectionHook:d,resolvedSelection:u,cycleByCategory:m=!1,baseStyleExtras:g,linkStrokeToFill:p=!1,styleRules:f,resolveRuleValue:y}=e,v=qi(()=>(e,s)=>{const l="function"==typeof g?g(e,s):g,c=l?{...l}:{};if(void 0===c.fill)if(t){if(!o)return c;c.fill=We(e,t,o)}else c.fill=yt(i,n,r,m?s:void 0,a);if(f&&f.length>0){const t=ue(e,f,{value:y?y(e):void 0,category:s});Object.assign(c,t)}return p&&void 0===c.stroke&&void 0!==c.fill&&(c.stroke=c.fill),c},[t,o,i,n,r,a,m,g,p,f,y]),b=qi(()=>x(s?"function"==typeof s?(e,t)=>({...v(e,t),...s(e,t)||{}}):(e,t)=>({...v(e,t),...s}):v,{stroke:l,strokeWidth:c,opacity:h}),[v,s,l,c,h]);return qi(()=>$t(b,d??null,u),[b,d,u])}import{jsx as Yi}from"react/jsx-runtime";var Qi=zi(function(o,i){const n=It(o.mode,{width:o.width,height:o.height,showGrid:o.showGrid,enableHover:o.enableHover,showLegend:o.showLegend,title:o.title,description:o.description,accessibleTable:o.accessibleTable,summary:o.summary,categoryLabel:o.categoryLabel,valueLabel:o.valueLabel,showCategoryTicks:o.showCategoryTicks,orientation:o.orientation,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,responsiveRules:o.responsiveRules}),r=$i(null),{data:a,margin:s,className:l,categoryAccessor:h="category",valueAccessor:d="value",orientation:u="vertical",valueFormat:m,colorBy:g,colorScheme:p,sort:f=!1,barPadding:y=40,roundedTop:v,gradientFill:b=!1,styleRules:x,baselinePadding:A=!1,tooltip:S,annotations:k,regression:C,valueExtent:_,frameProps:R={},selection:P,linkedHover:L,onObservation:M,onClick:I,hoverHighlight:T,chartId:H,loading:B,loadingContent:O,emptyContent:D,legendInteraction:F,legendPosition:E,color:N,stroke:z,strokeWidth:V,opacity:q,showCategoryTicks:X,categoryFormat:Y,dataIdAccessor:Q}=o,{width:K,height:Z,enableHover:U,showGrid:J,showLegend:ee,title:te,description:oe,summary:ie,accessibleTable:ne,categoryLabel:re,valueLabel:ae}=n,se=Wi(()=>je(a),[a]),le=w({data:se,rawData:a,colorBy:g,colorScheme:p,legendInteraction:F,legendPosition:E,frameLegend:R,selection:P,linkedHover:L,fallbackFields:g?["string"==typeof g?g:""]:[],unwrapData:!0,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"BarChart",chartId:H,showLegend:ee,userMargin:s,marginDefaults:n.marginDefaults,loading:B,loadingContent:O,emptyContent:D,width:K,height:Z,hasTitle:!!te,axisChrome:xt({showAxes:n.showAxes,projection:"horizontal"===u?"horizontal":"vertical",hasCategoryLabel:!!re,hasValueLabel:!!ae})}),{effectiveLegendProps:ce,effectiveMargin:he}=Vi({ref:i,frameRef:r,setup:le});Wt("BarChart",se,"categoryAccessor",h),Wt("BarChart",se,"valueAccessor",d);const ue=Ft(se,f,d),me=Et(),ge=Wi(()=>new Map,[]),pe=Wi(()=>de(d),[d]),fe=Xi({colorBy:g,colorScale:le.colorScale,color:N,themeCategorical:me,colorScheme:p,categoryIndexMap:ge,userPieceStyle:R?.pieceStyle,stroke:z,strokeWidth:V,opacity:q,styleRules:x,resolveRuleValue:pe,effectiveSelectionHook:le.effectiveSelectionHook,resolvedSelection:le.resolvedSelection}),ye=Wi(()=>$({categoryAccessor:h,valueAccessor:d,groupAccessor:g&&g!==h?g:void 0,groupLabel:"string"==typeof g?g:"group",valueFormat:m}),[h,d,g,m]),ve=Wi(()=>c(b),[b]);if(le.earlyReturn)return le.earlyReturn;const xe=t({componentName:"BarChart",data:a,accessors:{categoryAccessor:h,valueAccessor:d}});if(xe)return Yi(be,{componentName:"BarChart",message:xe,width:K,height:Z});const we=e(C),Ae=we?[we,...k||[]]:k,Se={chartType:"bar",...null!=a&&{data:ue},oAccessor:h,rAccessor:d,projection:"horizontal"===u?"horizontal":"vertical",pieceStyle:fe,size:[K,Z],responsiveWidth:o.responsiveWidth,responsiveHeight:o.responsiveHeight,margin:he,barPadding:y,...null!=v&&{roundedTop:v},...ve&&{gradientFill:ve},...Q&&{dataIdAccessor:Q},baselinePadding:A,enableHover:U,showAxes:n.showAxes,oLabel:re,rLabel:ae,rFormat:m,...Y&&{oFormat:Y},showGrid:J,showCategoryTicks:X,oSort:f,...ce,...j({title:te,description:oe,summary:ie,accessibleTable:ne,className:l,animate:o.animate,maxDevicePixelRatio:o.maxDevicePixelRatio,axisExtent:o.axisExtent,autoPlaceAnnotations:o.autoPlaceAnnotations}),...G({tooltip:S,defaultTooltipContent:ye}),...W({linkedHover:L,selection:P,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:le.mobileInteraction,customHoverBehavior:le.customHoverBehavior,customClickBehavior:le.customClickBehavior}),...Ae&&Ae.length>0&&{annotations:Ae},..._&&{rExtent:_},...Object.fromEntries(Object.entries(R).filter(([e])=>"pieceStyle"!==e))};return Yi(ke,{componentName:"BarChart",width:K,height:Z,children:Yi(ji,{ref:r,...Se})})});Qi.displayName="BarChart";import{useMemo as Ki,forwardRef as Zi,useRef as Ui}from"react";import{jsx as Ji}from"react/jsx-runtime";var en=Zi(function(e,o){const i=It(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=Ui(null),{data:r,margin:a,className:s,categoryAccessor:l="category",stackBy:h,valueAccessor:d="value",orientation:u="vertical",valueFormat:m,colorBy:g,colorScheme:p,normalize:f=!1,sort:y=!1,barPadding:v=40,roundedTop:b,gradientFill:x,styleRules:A,baselinePadding:S=!1,tooltip:k,annotations:C,valueExtent:_,frameProps:R={},selection:P,linkedHover:L,onObservation:M,onClick:I,hoverHighlight:T,chartId:H,loading:B,loadingContent:O,emptyContent:D,legendInteraction:F,legendPosition:E,color:N,stroke:z,strokeWidth:V,opacity:q,categoryFormat:X}=e,{width:Y,height:Q,enableHover:K,showGrid:Z,showLegend:U,title:J,description:ee,summary:te,accessibleTable:oe,categoryLabel:ie,valueLabel:ne}=i,re=Ki(()=>je(r),[r]),ae=g||h,se=w({data:re,rawData:r,colorBy:ae,colorScheme:p,legendInteraction:F,legendPosition:E,frameLegend:R,selection:P,linkedHover:L,fallbackFields:ae?["string"==typeof ae?ae:""]:[],unwrapData:!0,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"StackedBarChart",chartId:H,showLegend:U,userMargin:a,marginDefaults:i.marginDefaults,loading:B,loadingContent:O,emptyContent:D,width:Y,height:Q,hasTitle:!!J,axisChrome:xt({showAxes:i.showAxes,projection:"horizontal"===u?"horizontal":"vertical",hasCategoryLabel:!!ie,hasValueLabel:!!ne})}),le=Et(),ce=Ki(()=>new Map,[]),he=Ki(()=>de(d),[d]),ue=Xi({colorBy:ae,colorScale:se.colorScale,color:N,themeCategorical:le,colorScheme:p,categoryIndexMap:ce,userPieceStyle:R?.pieceStyle,stroke:z,strokeWidth:V,opacity:q,styleRules:A,resolveRuleValue:he,effectiveSelectionHook:se.effectiveSelectionHook,resolvedSelection:se.resolvedSelection}),me=Ki(()=>$({categoryAccessor:h,valueAccessor:d,groupAccessor:l,valueFormat:m}),[h,l,d,m]),ge=t({componentName:"StackedBarChart",data:r,accessors:{categoryAccessor:l,valueAccessor:d},requiredProps:{stackBy:h}}),{effectiveLegendProps:pe,effectiveMargin:fe}=Vi({ref:o,frameRef:n,setup:se}),ye=Ki(()=>c(x),[x]);if(se.earlyReturn)return se.earlyReturn;const ve={chartType:"bar",...null!=r&&{data:re},oAccessor:l,rAccessor:d,stackBy:h,normalize:f,oSort:y,projection:"horizontal"===u?"horizontal":"vertical",pieceStyle:ue,size:[Y,Q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:fe,barPadding:v,...null!=b&&{roundedTop:b},...ye&&{gradientFill:ye},baselinePadding:S,enableHover:K,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:ie,rLabel:ne,rFormat:m,...X&&{oFormat:X},showGrid:Z,...pe,...j({title:J,description:ee,summary:te,accessibleTable:oe,className:s,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...G({tooltip:k,defaultTooltipContent:me}),...W({linkedHover:L,selection:P,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:se.mobileInteraction,customHoverBehavior:se.customHoverBehavior,customClickBehavior:se.customClickBehavior}),...C&&C.length>0&&{annotations:C},..._&&{rExtent:_},...Object.fromEntries(Object.entries(R).filter(([e])=>"pieceStyle"!==e))};return ge?Ji(be,{componentName:"StackedBarChart",message:ge,width:Y,height:Q}):Ji(ke,{componentName:"StackedBarChart",width:Y,height:Q,children:Ji(ji,{ref:n,...ve})})});en.displayName="StackedBarChart";import*as tn from"react";import{useMemo as on,useCallback as nn,forwardRef as rn,useRef as an,useImperativeHandle as sn}from"react";import{useMemo as ln,useCallback as cn,useRef as hn}from"react";var dn={RdBu:Qe,PiYG:Ye,PRGn:Xe,BrBG:qe,RdYlBu:Ke,RdYlGn:Ze,Spectral:Ue},un="__likert_neutral_neg",mn="__likert_neutral_pos";function gn(e,t){if("function"==typeof e)return e;const o=e||t;return e=>e[o]}function pn(e,t,o,i,n,r){const a=new Map,s=new Set(t);for(const l of e){const e=o(l);a.has(e)||a.set(e,new Map);const c=a.get(e);if(i){const e=i(l);if(null==e||!Number.isFinite(e))continue;if(!Number.isInteger(e)){"production"!==process.env.NODE_ENV&&console.warn("[LikertChart] Ignoring non-integer Likert score:",e);continue}const o=e-1;if(0>o||o>=t.length)continue;const n=t[o];c.set(n,(c.get(n)||0)+1)}else if(n&&r){const e=n(l),t=r(l);if(!s.has(e))continue;c.set(e,(c.get(e)||0)+(Number.isFinite(t)?t:0))}}const l=[];for(const[e,o]of a){let i=0;for(const e of t)i+=o.get(e)||0;if(0!==i)for(let n=0;t.length>n;n++){const r=t[n],a=o.get(r)||0;l.push({__likertCategory:e,__likertLevel:r,__likertLevelLabel:r,__likertCount:a,__likertPct:a/i*100,__likertLevelIndex:n})}}return l}function fn(e,t){const o=t.length,i=o%2!=0,n=Math.floor(o/2),r=[];for(const t of e){const e=t.__likertLevelIndex;if(i&&e===n){const e=t.__likertPct/2;r.push({...t,__likertLevel:un,__likertPct:-e}),r.push({...t,__likertLevel:mn,__likertPct:e})}else r.push(n>e?{...t,__likertPct:-t.__likertPct}:t)}return r}function yn(e,t){const o=t.length,i=o%2!=0,n=Math.floor(o/2),r=new Map;for(const t of e){const e=r.get(t.__likertCategory)||[];e.push(t),r.set(t.__likertCategory,e)}const a=[];for(const[,e]of r){const t=new Map;let r,s;for(const o of e)o.__likertLevel===un?r=o:o.__likertLevel===mn?s=o:t.set(o.__likertLevelIndex,o);i&&r&&a.push(r);for(let e=n-1;e>=0;e--){const o=t.get(e);o&&a.push(o)}i&&s&&a.push(s);for(let e=i?n+1:n;o>e;e++){const o=t.get(e);o&&a.push(o)}}return a}var vn=["Very Low","Low","Neutral","High","Very High"];import{jsx as bn}from"react/jsx-runtime";var xn=new Map,wn=rn(function(e,i){const n=It(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),r=an(null),{data:a,margin:s,className:l,categoryAccessor:c="question",valueAccessor:h,levelAccessor:d,countAccessor:u="count",levels:m=vn,orientation:g="horizontal",colorScheme:p,barPadding:f=20,tooltip:y,annotations:v,valueExtent:b,frameProps:x={},selection:A,linkedHover:S,onObservation:k,onClick:C,hoverHighlight:_,chartId:R,valueFormat:P,loading:L,loadingContent:M,emptyContent:I,legendInteraction:T,legendPosition:H,categoryFormat:B,stroke:O,strokeWidth:D,opacity:F}=e,{width:E,height:N,enableHover:j,showGrid:z,showLegend:$,title:G,description:V,summary:q,accessibleTable:X,categoryLabel:Y,valueLabel:Q}=n,K="horizontal"===g,Z=void 0===a,U=!d,J=Nt(),ee=on(()=>p&&Array.isArray(p)&&p.length>=m.length?p:function(e,t){if(0>=e)return[];if(t&&Object.prototype.hasOwnProperty.call(dn,t)){const o=dn[t];if(1===e)return[o(.5)];const i=[];for(let t=0;e>t;t++)i.push(o(t/(e-1)));return i}const o=["#da1e28","#ff8389","#ffb3b8"],i=["#a6c8ff","#4589ff","#0043ce"],n="#a8a8a8";if(1===e)return[n];const r=e%2!=0,a=Math.floor(e/2),s=[];for(let e=0;a>e;e++)s.push(o[Math.min(Math.floor(e*o.length/a),o.length-1)]);r&&s.push(n);for(let e=0;a>e;e++)s.push(i[Math.min(Math.floor(e*i.length/a),i.length-1)]);return s}(m.length,J),[p,m.length,J]),te=on(()=>{const e=new Map;for(let t=0;m.length>t;t++)e.set(m[t],ee[t]||"#888");return e},[m,ee]),oe=on(()=>{if(!1!==$)return{legendGroups:[{styleFn:e=>({fill:te.get(e.label)||"#888"}),items:m.map(e=>({label:e})),label:""}]}},[$,m,te]),ie=on(()=>Object.hasOwn(x,"legend")?x:{...x,legend:oe},[x,oe]),{processedData:ne,reAggregate:re,accumulatorRef:ae}=function({data:e,levels:t,categoryAccessor:o,valueAccessor:i,levelAccessor:n,countAccessor:r,isDiverging:a,frameRef:s}){const l=!n,c=ln(()=>gn(o,"question"),[o]),h=ln(()=>l?gn(i,"score"):null,[l,i]),d=ln(()=>l?null:gn(n,"level"),[l,n]),u=ln(()=>l?null:gn(r,"count"),[l,r]),m=hn([]);return{processedData:ln(()=>{const o=e||[];if(0===o.length)return[];let i=pn(o,t,c,h,d,u);return a&&(i=fn(i,t),i=yn(i,t)),i},[e,t,c,h,d,u,a]),reAggregate:cn(e=>{let o=pn(e,t,c,h,d,u);a&&(o=fn(o,t),o=yn(o,t)),s.current?.replace(o)},[t,c,h,d,u,a,s]),accumulatorRef:m}}({data:a,levels:m,categoryAccessor:c,valueAccessor:h,levelAccessor:d,countAccessor:u,isDiverging:K,frameRef:r}),se="__likertLevelLabel",le=o({isPushMode:Z,colorBy:se,colorScheme:ee,showLegend:$,legendPosition:H}),{wrapPush:ce,wrapPushMany:he}=le,de=nn(e=>ce(e=>{ae.current.push(e),re(ae.current)})(e),[ce,re,ae]),ue=nn(e=>he(e=>{ae.current.push(...e),re(ae.current)})(e),[he,re,ae]);sn(i,()=>({push:de,pushMany:ue,remove:e=>r.current?.remove(e)??[],update:(e,t)=>r.current?.update(e,t)??[],replace:e=>r.current?.replace(e),clear:()=>{ae.current=[],le.resetCategories(),r.current?.clear()},getData:()=>r.current?.getData()??[],getScales:()=>r.current?.getScales()??null}),[de,ue,ae,le]);const me=w({data:ne,rawData:a,colorBy:se,colorScheme:ee,legendInteraction:T,legendPosition:H,frameLegend:ie,selection:A,linkedHover:S,fallbackFields:["__likertLevelLabel"],unwrapData:!0,onObservation:k,onClick:C,hoverHighlight:_,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"LikertChart",chartId:R,showLegend:$,userMargin:s,marginDefaults:n.marginDefaults,loading:L,loadingContent:M,emptyContent:I,width:E,height:N,hasTitle:!!G,axisChrome:{hasAxis:!1!==n.showAxes,hasAxisLabel:K?!!Q:!!Y}}),ge=on(()=>{const e=m.length;return e%2!=0&&te.get(m[Math.floor(e/2)])||"#888"},[m,te]),pe=Xi({colorBy:void 0,colorScale:void 0,color:void 0,themeCategorical:void 0,colorScheme:void 0,categoryIndexMap:xn,userPieceStyle:x?.pieceStyle,stroke:O,strokeWidth:D,opacity:F,effectiveSelectionHook:me.effectiveSelectionHook,resolvedSelection:me.resolvedSelection,baseStyleExtras:e=>{const t=e.__likertLevelLabel||e.data?.__likertLevelLabel,o=e.__likertLevel||e.data?.__likertLevel;if(o===un||o===mn)return{fill:ge};const i=t||o;return i&&te.has(i)?{fill:te.get(i)}:{fill:"#888"}}}),fe=on(()=>{const e=m.length;return e%2!=0?m[Math.floor(e/2)]:""},[m]),ye=on(()=>e=>{const t=e.data||e,o=t.__likertLevel||"Unknown",i=o===un||o===mn?fe:o,n=t.__likertCategory||"",r=Math.abs(t.__likertPct||0),a=o===un||o===mn?2*r:r,s=t.__likertCount||0;return tn.createElement("div",{className:"semiotic-tooltip",style:Ne},tn.createElement("div",{style:{fontWeight:"bold"}},n),tn.createElement("div",{style:{marginTop:4}},`${i}: ${a.toFixed(1)}% (n=${s})`))},[fe]),ve=on(()=>{if(!m||2>m.length)return"LikertChart requires `levels` with at least 2 entries.";if(h&&d)return"LikertChart: provide either `valueAccessor` (raw responses) or `levelAccessor` + `countAccessor` (pre-aggregated), not both.";if(d&&!u)return"LikertChart: pre-aggregated mode requires both `levelAccessor` and `countAccessor`.";if(void 0!==a&&0===a.length)return null;const e={categoryAccessor:c};return U?h&&(e.valueAccessor=h):(d&&(e.levelAccessor=d),u&&(e.countAccessor=u)),t({componentName:"LikertChart",data:a,accessors:e,requiredProps:{levels:m}})},[a,c,h,d,u,m,U]),xe=me.legendBehaviorProps,we=on(()=>{const e={...me.margin};if(Z&&me.legend){const t=me.legendPosition;"bottom"===t&&80>e.bottom?e.bottom=80:"top"===t&&50>e.top?e.top=50:"right"===t&&110>e.right?e.right=110:"left"===t&&110>e.left&&(e.left=110)}else if(le.streamingMarginAdjust)for(const[t,o]of Object.entries(le.streamingMarginAdjust))o>e[t]&&(e[t]=o);return K&&100>e.left&&(e.left=100),e},[me.margin,me.legend,me.legendPosition,le.streamingMarginAdjust,K,Z]),Ae=on(()=>P||(K?e=>Math.abs(Number(e)).toFixed(0)+"%":e=>Number(e).toFixed(0)+"%"),[K,P]);if(me.earlyReturn)return me.earlyReturn;const Se={chartType:"bar",...null!=a&&{data:ne},oAccessor:"__likertCategory",rAccessor:"__likertPct",stackBy:"__likertLevel",normalize:!1,projection:K?"horizontal":"vertical",pieceStyle:pe,size:[E,N],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:we,barPadding:f,enableHover:j,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:n.showAxes,oLabel:Y,rLabel:Q||(K?void 0:"Percentage"),rFormat:Ae,...B&&{oFormat:B},showGrid:z,...xe,...G&&{title:G},...V&&{description:V},...q&&{summary:q},...void 0!==X&&{accessibleTable:X},...l&&{className:l},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:!1===y?()=>null:!0===y?ye:rt(y)||ye,...W({linkedHover:S,selection:A,onObservation:k,onClick:C,hoverHighlight:_,mobileInteraction:me.mobileInteraction,customHoverBehavior:me.customHoverBehavior,customClickBehavior:me.customClickBehavior}),...v&&v.length>0&&{annotations:v},...b&&{rExtent:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};return ve?bn(be,{componentName:"LikertChart",message:ve,width:E,height:N}):bn(ke,{componentName:"LikertChart",width:E,height:N,children:bn(ji,{ref:r,...Se})})});wn.displayName="LikertChart";import{useMemo as An,forwardRef as Sn,useRef as kn}from"react";import{useCallback as Cn,useMemo as _n,useRef as Rn}from"react";function Pn({brushProp:e,onBrushProp:t,linkedBrush:o,valueAccessor:i}){const n=_n(()=>nt("string"==typeof o?o:o?{name:o.name,xField:o.rField}:void 0),[o]),r="string"==typeof i?i:"value",a=Lt({name:n?.name||"__unused_ordinal_brush__",xField:n?.xField||r}),s=Rn(a.brushInteraction);s.current=a.brushInteraction;const l=Cn(e=>{if(n){s.current.end(e?e.r:null)}t?.(e)},[t,n]),c=!!(e||o||t);return{hasBrush:c,handleBrush:l,brushStreamProps:c?{brush:{dimension:"r"},onBrush:l}:{}}}import{jsx as Ln}from"react/jsx-runtime";var Mn=Sn(function(e,o){const i=It(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=kn(null);S(o,{variant:"xy",frameRef:n});const{data:r,margin:a,className:s,categoryAccessor:l="category",valueAccessor:c="value",orientation:h="vertical",valueFormat:d,colorBy:u,colorScheme:m,sizeBy:g,sizeRange:p=[3,8],symbolBy:f,symbolMap:y,pointRadius:v=4,pointOpacity:b=.7,categoryPadding:x=20,tooltip:A,annotations:k,valueExtent:C,brush:_,onBrush:R,linkedBrush:P,frameProps:L={},selection:M,linkedHover:I,onObservation:T,onClick:H,hoverHighlight:B,chartId:O,loading:D,loadingContent:F,emptyContent:E,legendInteraction:N,legendPosition:z,color:V,stroke:q,strokeWidth:X,opacity:Y,showCategoryTicks:Q,categoryFormat:K}=e,{width:Z,height:U,enableHover:J,showGrid:ee,showLegend:te,title:oe,description:ie,summary:ne,accessibleTable:re,categoryLabel:ae,valueLabel:se}=i,le=An(()=>je(r),[r]),ce=w({data:le,rawData:r,colorBy:u,colorScheme:m,legendInteraction:N,legendPosition:z,frameLegend:L,selection:M,linkedHover:I,fallbackFields:u?["string"==typeof u?u:""]:["string"==typeof l?l:""],unwrapData:!0,onObservation:T,onClick:H,hoverHighlight:B,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"SwarmPlot",chartId:O,showLegend:te,userMargin:a,marginDefaults:i.marginDefaults,loading:D,loadingContent:F,emptyContent:E,width:Z,height:U,hasTitle:!!oe,axisChrome:xt({showAxes:i.showAxes,projection:"horizontal"===h?"horizontal":"vertical",hasCategoryLabel:!!ae,hasValueLabel:!!se})}),he=Pn({brushProp:_,onBrushProp:R,linkedBrush:P,valueAccessor:c}),de=An(()=>{if(!g)return;const e=le.map(e=>"function"==typeof g?g(e):e[g]);return qt(e)},[le,g]),ue=Et(),me=An(()=>new Map,[]),ge=Xi({colorBy:u,colorScale:ce.colorScale,color:V,themeCategorical:ue,colorScheme:m,categoryIndexMap:me,userPieceStyle:L?.pieceStyle,stroke:q,strokeWidth:X,opacity:Y,effectiveSelectionHook:ce.effectiveSelectionHook,resolvedSelection:ce.resolvedSelection,baseStyleExtras:e=>({fillOpacity:b,r:g?$e(e,g,p,de):v})}),pe=An(()=>$({categoryAccessor:l,valueAccessor:c,groupAccessor:u||void 0,valueFormat:d}),[l,c,u,d]);if(ce.earlyReturn)return ce.earlyReturn;const fe=t({componentName:"SwarmPlot",data:r,accessors:{categoryAccessor:l,valueAccessor:c}});if(fe)return Ln(be,{componentName:"SwarmPlot",message:fe,width:Z,height:U});const ye={chartType:"swarm",...null!=r&&{data:le},oAccessor:l,rAccessor:c,...f&&{symbolAccessor:f},...y&&{symbolMap:y},projection:"horizontal"===h?"horizontal":"vertical",pieceStyle:ge,size:[Z,U],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ce.margin,barPadding:x,enableHover:J,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:ae,rLabel:se,rFormat:d,...K&&{oFormat:K},showGrid:ee,showCategoryTicks:Q,...ce.legendBehaviorProps,...j({title:oe,description:ie,summary:ne,accessibleTable:re,className:s,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...G({tooltip:A,defaultTooltipContent:pe}),...W({linkedHover:I,selection:M,onObservation:T,onClick:H,hoverHighlight:B,mobileInteraction:ce.mobileInteraction,customHoverBehavior:ce.customHoverBehavior,customClickBehavior:ce.customClickBehavior}),...k&&k.length>0&&{annotations:k},...C&&{rExtent:C},...he.brushStreamProps,...Object.fromEntries(Object.entries(L).filter(([e])=>"pieceStyle"!==e))};return Ln(ke,{componentName:"SwarmPlot",width:Z,height:U,children:Ln(ji,{ref:n,...ye})})});Mn.displayName="SwarmPlot";import{useMemo as In,forwardRef as Tn,useRef as Hn}from"react";import{jsx as Bn,jsxs as On}from"react/jsx-runtime";function Dn(e){return t=>{const o=t.category||t.data&&t.data[0]?.category||"",i=t.stats||(t.data||t).stats;if(i&&null!=i.median)return On("div",{className:"semiotic-tooltip",style:Ne,children:[o&&Bn("div",{style:{fontWeight:"bold"},children:o+""}),null!=i.n&&On("div",{children:["n = ",i.n]}),null!=i.min&&On("div",{children:["Min: ",i.min.toLocaleString()]}),null!=i.q1&&On("div",{children:["Q1: ",i.q1.toLocaleString()]}),On("div",{children:["Median: ",i.median.toLocaleString()]}),null!=i.q3&&On("div",{children:["Q3: ",i.q3.toLocaleString()]}),null!=i.max&&On("div",{children:["Max: ",i.max.toLocaleString()]}),null!=i.mean&&On("div",{style:{opacity:.8},children:["Mean: ",i.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});if(e?.valueAccessor){const i=e.valueAccessor,n=(Array.isArray(t.data)?t.data:[]).map(e=>Number("function"==typeof i?i(e):e[i])).filter(e=>Number.isFinite(e)).sort((e,t)=>e-t),r=n.length,a=r>0?r%2!=0?n[Math.floor(r/2)]:(n[r/2-1]+n[r/2])/2:null;return On("div",{className:"semiotic-tooltip",style:Ne,children:[o&&Bn("div",{style:{fontWeight:"bold"},children:o+""}),r>0&&On("div",{children:["n = ",r]}),null!=a&&On("div",{children:["Median: ",a.toLocaleString()]})]})}return Bn("div",{className:"semiotic-tooltip",style:Ne,children:Bn("div",{style:{fontWeight:"bold"},children:o+""})})}}import{jsx as Fn}from"react/jsx-runtime";var En=Tn(function(e,o){const i=It(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=Hn(null);S(o,{variant:"xy",frameRef:n});const{data:r,margin:a,className:s,categoryAccessor:l="category",valueAccessor:c="value",orientation:h="vertical",valueFormat:d,colorBy:u,colorScheme:m,showOutliers:g=!0,outlierRadius:p=3,categoryPadding:f=20,tooltip:y,annotations:v,valueExtent:b,frameProps:x={},selection:A,linkedHover:k,onObservation:C,onClick:_,hoverHighlight:R,chartId:P,loading:L,loadingContent:M,emptyContent:I,legendInteraction:T,legendPosition:H,color:B,stroke:O,strokeWidth:D,opacity:F,showCategoryTicks:E,categoryFormat:N}=e,{width:z,height:$,enableHover:V,showGrid:q,showLegend:X,title:Y,description:Q,summary:K,accessibleTable:Z,categoryLabel:U,valueLabel:J}=i,ee=In(()=>je(r),[r]),te=w({data:ee,rawData:r,colorBy:u,colorScheme:m,legendInteraction:T,legendPosition:H,frameLegend:x,selection:A,linkedHover:k,fallbackFields:u?["string"==typeof u?u:""]:["string"==typeof l?l:""],unwrapData:!0,onObservation:C,onClick:_,hoverHighlight:R,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"BoxPlot",chartId:P,showLegend:X,userMargin:a,marginDefaults:i.marginDefaults,loading:L,loadingContent:M,emptyContent:I,width:z,height:$,hasTitle:!!Y,axisChrome:xt({showAxes:i.showAxes,projection:"horizontal"===h?"horizontal":"vertical",hasCategoryLabel:!!U,hasValueLabel:!!J})}),oe=Et(),ie=In(()=>new Map,[]),ne=Xi({colorBy:u,colorScale:te.colorScale,color:B,themeCategorical:oe,colorScheme:m,categoryIndexMap:ie,userPieceStyle:void 0,stroke:O,strokeWidth:D,opacity:F,effectiveSelectionHook:te.effectiveSelectionHook,resolvedSelection:te.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0}),re=In(()=>Dn(),[]);if(te.earlyReturn)return te.earlyReturn;const ae=t({componentName:"BoxPlot",data:r,accessors:{categoryAccessor:l,valueAccessor:c}});if(ae)return Fn(be,{componentName:"BoxPlot",message:ae,width:z,height:$});const se={chartType:"boxplot",...null!=r&&{data:ee},oAccessor:l,rAccessor:c,projection:"horizontal"===h?"horizontal":"vertical",summaryStyle:ne,showOutliers:g,size:[z,$],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:te.margin,barPadding:f,enableHover:V,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:U,rLabel:J,rFormat:d,...N&&{oFormat:N},showGrid:q,showCategoryTicks:E,...te.legendBehaviorProps,...j({title:Y,description:Q,summary:K,accessibleTable:Z,className:s,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...G({tooltip:y,defaultTooltipContent:re}),...W({linkedHover:k,selection:A,onObservation:C,onClick:_,hoverHighlight:R,mobileInteraction:te.mobileInteraction,customHoverBehavior:te.customHoverBehavior,customClickBehavior:te.customClickBehavior}),...v&&v.length>0&&{annotations:v},...b&&{rExtent:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};return Fn(ke,{componentName:"BoxPlot",width:z,height:$,children:Fn(ji,{ref:n,...se})})});En.displayName="BoxPlot";import{useMemo as Nn,forwardRef as jn,useRef as Wn}from"react";import{jsx as zn,jsxs as $n}from"react/jsx-runtime";var Gn=e=>{const t=e?.category;return null==t?"All":t+""},Vn=jn(function(e,o){const i=It(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:"horizontal",mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=Wn(null);S(o,{variant:"xy",frameRef:n});const{data:r,margin:a,className:s,categoryAccessor:l=Gn,valueAccessor:c="value",bins:h=25,relative:d=!1,valueFormat:u,colorBy:m,colorScheme:g,categoryPadding:p=("sparkline"===i.mode?0:20),tooltip:f,annotations:y,valueExtent:v,brush:b,onBrush:x,linkedBrush:A,frameProps:k={},selection:C,linkedHover:_,onObservation:R,onClick:P,hoverHighlight:L,chartId:M,loading:I,loadingContent:T,emptyContent:H,legendInteraction:B,legendPosition:O,color:D,stroke:F,strokeWidth:E,opacity:N,showCategoryTicks:z,categoryFormat:$}=e,{width:V,height:q,enableHover:X,showGrid:Y,showLegend:Q,title:K,description:Z,summary:U,accessibleTable:J,categoryLabel:ee,valueLabel:te}=i,oe=Nn(()=>je(r),[r]),ie=w({data:oe,rawData:r,colorBy:m,colorScheme:g,legendInteraction:B,legendPosition:O,frameLegend:k,selection:C,linkedHover:_,fallbackFields:m?["string"==typeof m?m:""]:["string"==typeof l?l:""],unwrapData:!0,onObservation:R,onClick:P,hoverHighlight:L,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"Histogram",chartId:M,showLegend:Q,userMargin:a,marginDefaults:i.marginDefaults,loading:I,loadingContent:T,emptyContent:H,width:V,height:q,hasTitle:!!K,axisChrome:xt({showAxes:i.showAxes,projection:"horizontal",hasCategoryLabel:!!ee,hasValueLabel:!!te})}),ne=Pn({brushProp:b,onBrushProp:x,linkedBrush:A,valueAccessor:c}),re=Nn(()=>{if(0===oe.length)return;const e="function"==typeof c?c:e=>e[c];let t=1/0,o=-1/0;for(const i of oe){const n=e(i);null!=n&&isFinite(n)&&(t>n&&(t=n),n>o&&(o=n))}return t>o?void 0:[t,o]},[oe,c]),ae=Et(),se=Nn(()=>new Map,[]),le=Xi({colorBy:m,colorScale:ie.colorScale,color:D,themeCategorical:ae,colorScheme:g,categoryIndexMap:se,userPieceStyle:void 0,stroke:F,strokeWidth:E,opacity:N,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0}),ce=Nn(()=>e=>{const t=e.data||e,o=t.category||e.category||"",i=t.count,n=t.range;return $n("div",{className:"semiotic-tooltip",style:Ne,children:[o&&zn("div",{style:{fontWeight:"bold"},children:o+""}),null!=i&&$n("div",{children:["Count: ",i]}),n&&2===n.length&&$n("div",{style:{opacity:.8},children:[Number(n[0]).toFixed(1)," – ",Number(n[1]).toFixed(1)]})]})},[]);if(ie.earlyReturn)return ie.earlyReturn;const he=t({componentName:"Histogram",data:r,accessors:{categoryAccessor:l,valueAccessor:c}});if(he)return zn(be,{componentName:"Histogram",message:he,width:V,height:q});const de={chartType:"histogram",...null!=r&&{data:oe},oAccessor:l,rAccessor:c,projection:"horizontal",summaryStyle:le,bins:h,normalize:d,...v?{rExtent:v}:re&&{rExtent:re},size:[V,q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ie.margin,barPadding:p,enableHover:X,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:ee,rLabel:te,rFormat:u,...$&&{oFormat:$},showGrid:Y,showCategoryTicks:z,...ie.legendBehaviorProps,...j({title:K,description:Z,summary:U,accessibleTable:J,className:s,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...G({tooltip:f,defaultTooltipContent:ce}),...W({linkedHover:_,selection:C,onObservation:R,onClick:P,hoverHighlight:L,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...y&&y.length>0&&{annotations:y},...ne.brushStreamProps,...Object.fromEntries(Object.entries(k).filter(([e])=>"pieceStyle"!==e))};return zn(ke,{componentName:"Histogram",width:V,height:q,children:zn(ji,{ref:n,...de})})});Vn.displayName="Histogram";import{useMemo as qn,forwardRef as Xn,useRef as Yn}from"react";import{jsx as Qn}from"react/jsx-runtime";var Kn=Xn(function(e,o){const i=It(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=Yn(null);S(o,{variant:"xy",frameRef:n});const{data:r,margin:a,className:s,categoryAccessor:l="category",valueAccessor:c="value",orientation:h="vertical",bins:d=25,curve:u="catmullRom",showIQR:m=!0,valueFormat:g,colorBy:p,colorScheme:f,categoryPadding:y=20,tooltip:v,annotations:b,valueExtent:x,brush:A,onBrush:k,linkedBrush:C,frameProps:_={},selection:R,linkedHover:P,onObservation:L,onClick:M,hoverHighlight:I,chartId:T,loading:H,loadingContent:B,emptyContent:O,legendInteraction:D,legendPosition:F,color:E,stroke:N,strokeWidth:z,opacity:$,showCategoryTicks:V,categoryFormat:q}=e,{width:X,height:Y,enableHover:Q,showGrid:K,showLegend:Z,title:U,description:J,summary:ee,accessibleTable:te,categoryLabel:oe,valueLabel:ie}=i,ne=qn(()=>je(r),[r]),re=w({data:ne,rawData:r,colorBy:p,colorScheme:f,legendInteraction:D,legendPosition:F,frameLegend:_,selection:R,linkedHover:P,fallbackFields:p?["string"==typeof p?p:""]:["string"==typeof l?l:""],unwrapData:!0,onObservation:L,onClick:M,hoverHighlight:I,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"ViolinPlot",chartId:T,showLegend:Z,userMargin:a,marginDefaults:i.marginDefaults,loading:H,loadingContent:B,emptyContent:O,width:X,height:Y,hasTitle:!!U,axisChrome:xt({showAxes:i.showAxes,projection:"horizontal"===h?"horizontal":"vertical",hasCategoryLabel:!!oe,hasValueLabel:!!ie})}),ae=Pn({brushProp:A,onBrushProp:k,linkedBrush:C,valueAccessor:c}),se=Et(),le=qn(()=>new Map,[]),ce=Xi({colorBy:p,colorScale:re.colorScale,color:E,themeCategorical:se,colorScheme:f,categoryIndexMap:le,userPieceStyle:void 0,stroke:N,strokeWidth:z,opacity:$,effectiveSelectionHook:re.effectiveSelectionHook,resolvedSelection:re.resolvedSelection,baseStyleExtras:{fillOpacity:.6},linkStrokeToFill:!0}),he=qn(()=>Dn({valueAccessor:c}),[c]);if(re.earlyReturn)return re.earlyReturn;const de=t({componentName:"ViolinPlot",data:r,accessors:{categoryAccessor:l,valueAccessor:c}});if(de)return Qn(be,{componentName:"ViolinPlot",message:de,width:X,height:Y});const ue={chartType:"violin",...null!=r&&{data:ne},oAccessor:l,rAccessor:c,projection:"horizontal"===h?"horizontal":"vertical",summaryStyle:ce,bins:d,showIQR:m,size:[X,Y],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:re.margin,barPadding:y,enableHover:Q,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:oe,rLabel:ie,rFormat:g,...q&&{oFormat:q},showGrid:K,showCategoryTicks:V,...re.legendBehaviorProps,...j({title:U,description:J,summary:ee,accessibleTable:te,className:s,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...G({tooltip:v,defaultTooltipContent:he}),...W({linkedHover:P,selection:R,onObservation:L,onClick:M,hoverHighlight:I,mobileInteraction:re.mobileInteraction,customHoverBehavior:re.customHoverBehavior,customClickBehavior:re.customClickBehavior}),...b&&b.length>0&&{annotations:b},...x&&{rExtent:x},...ae.brushStreamProps,...Object.fromEntries(Object.entries(_).filter(([e])=>"pieceStyle"!==e))};return Qn(ke,{componentName:"ViolinPlot",width:X,height:Y,children:Qn(ji,{ref:n,...ue})})});Kn.displayName="ViolinPlot";import{useMemo as Zn,forwardRef as Un,useRef as Jn}from"react";import{jsx as er}from"react/jsx-runtime";var tr=Un(function(e,o){const i=It(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=Jn(null);S(o,{variant:"xy",frameRef:n});const{data:r,margin:a,className:s,categoryAccessor:l="category",valueAccessor:c="value",orientation:h="horizontal",bins:d=20,amplitude:u=1.5,valueFormat:m,colorBy:g,colorScheme:p,categoryPadding:f=5,tooltip:y,annotations:v,valueExtent:b,frameProps:x={},selection:A,linkedHover:k,onObservation:C,onClick:_,hoverHighlight:R,chartId:P,loading:L,loadingContent:M,emptyContent:I,legendInteraction:T,legendPosition:H,color:B,stroke:O,strokeWidth:D,opacity:F,showCategoryTicks:E,categoryFormat:N}=e,{width:z,height:$,enableHover:V,showGrid:q,showLegend:X,title:Y,description:Q,summary:K,accessibleTable:Z,categoryLabel:U,valueLabel:J}=i,ee=Zn(()=>je(r),[r]),te=w({data:ee,rawData:r,colorBy:g,colorScheme:p,legendInteraction:T,legendPosition:H,frameLegend:x,selection:A,linkedHover:k,fallbackFields:g?["string"==typeof g?g:""]:["string"==typeof l?l:""],unwrapData:!0,onObservation:C,onClick:_,hoverHighlight:R,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"RidgelinePlot",chartId:P,showLegend:X,userMargin:a,marginDefaults:i.marginDefaults,loading:L,loadingContent:M,emptyContent:I,width:z,height:$,hasTitle:!!Y,axisChrome:xt({showAxes:i.showAxes,projection:"horizontal"===h?"horizontal":"vertical",hasCategoryLabel:!!U,hasValueLabel:!!J})}),oe=Et(),ie=Zn(()=>new Map,[]),ne=Xi({colorBy:g,colorScale:te.colorScale,color:B,themeCategorical:oe,colorScheme:p,categoryIndexMap:ie,userPieceStyle:void 0,stroke:O,strokeWidth:D,opacity:F,effectiveSelectionHook:te.effectiveSelectionHook,resolvedSelection:te.resolvedSelection,baseStyleExtras:{fillOpacity:.5},linkStrokeToFill:!0}),re=Zn(()=>Dn(),[]);if(te.earlyReturn)return te.earlyReturn;const ae=t({componentName:"RidgelinePlot",data:r,accessors:{categoryAccessor:l,valueAccessor:c}});if(ae)return er(be,{componentName:"RidgelinePlot",message:ae,width:z,height:$});const se={chartType:"ridgeline",...null!=r&&{data:ee},oAccessor:l,rAccessor:c,projection:"horizontal"===h?"horizontal":"vertical",summaryStyle:ne,bins:d,size:[z,$],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:te.margin,barPadding:f,enableHover:V,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:U,rLabel:J,rFormat:m,...N&&{oFormat:N},showGrid:q,showCategoryTicks:E,oSort:!1,amplitude:u,...te.legendBehaviorProps,...j({title:Y,description:Q,summary:K,accessibleTable:Z,className:s,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...G({tooltip:y,defaultTooltipContent:re}),...W({linkedHover:k,selection:A,onObservation:C,onClick:_,hoverHighlight:R,mobileInteraction:te.mobileInteraction,customHoverBehavior:te.customHoverBehavior,customClickBehavior:te.customClickBehavior}),...v&&v.length>0&&{annotations:v},...b&&{rExtent:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};return er(ke,{componentName:"RidgelinePlot",width:z,height:$,children:er(ji,{ref:n,...se})})});tr.displayName="RidgelinePlot";import{useMemo as or,forwardRef as ir,useRef as nr}from"react";import{jsx as rr}from"react/jsx-runtime";var ar=ir(function(o,i){const n=It(o.mode,{width:o.width,height:o.height,showGrid:o.showGrid??!0,enableHover:o.enableHover,showLegend:o.showLegend,title:o.title,description:o.description,accessibleTable:o.accessibleTable,summary:o.summary,categoryLabel:o.categoryLabel,valueLabel:o.valueLabel,showCategoryTicks:o.showCategoryTicks,orientation:o.orientation,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,responsiveRules:o.responsiveRules}),r=nr(null);S(i,{variant:"xy",frameRef:r});const{data:a,margin:s,className:l,categoryAccessor:c="category",valueAccessor:h="value",orientation:d="horizontal",valueFormat:u,colorBy:m,colorScheme:g,sort:p="auto",dotRadius:f=5,categoryPadding:y=10,tooltip:v,annotations:b,regression:x,valueExtent:A,frameProps:k={},selection:C,linkedHover:_,onObservation:R,onClick:P,hoverHighlight:L,chartId:M,loading:I,loadingContent:T,emptyContent:H,legendInteraction:B,legendPosition:O,color:D,stroke:F,strokeWidth:E,opacity:N,categoryFormat:z}=o,{width:V,height:q,enableHover:X,showGrid:Y,showLegend:Q,title:K,description:Z,summary:U,accessibleTable:J,categoryLabel:ee,valueLabel:te}=n,oe=or(()=>je(a),[a]),ie=w({data:oe,rawData:a,colorBy:m,colorScheme:g,legendInteraction:B,legendPosition:O,frameLegend:k,selection:C,linkedHover:_,fallbackFields:m?["string"==typeof m?m:""]:["string"==typeof c?c:""],unwrapData:!0,onObservation:R,onClick:P,hoverHighlight:L,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"DotPlot",chartId:M,showLegend:Q,userMargin:s,marginDefaults:n.marginDefaults,loading:I,loadingContent:T,emptyContent:H,width:V,height:q,hasTitle:!!K,axisChrome:xt({showAxes:n.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!!ee,hasValueLabel:!!te})}),ne=Ft(oe,p,h),re=Et(),ae=or(()=>new Map,[]),se=Xi({colorBy:m,colorScale:ie.colorScale,color:D,themeCategorical:re,colorScheme:g,categoryIndexMap:ae,userPieceStyle:k?.pieceStyle,stroke:F,strokeWidth:E,opacity:N,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection,baseStyleExtras:{r:f,fillOpacity:.8}}),le=or(()=>$({categoryAccessor:c,valueAccessor:h,valueFormat:u}),[c,h,u]);if(ie.earlyReturn)return ie.earlyReturn;const ce=t({componentName:"DotPlot",data:a,accessors:{categoryAccessor:c,valueAccessor:h}});if(ce)return rr(be,{componentName:"DotPlot",message:ce,width:V,height:q});const he=e(x),de=he?[he,...b||[]]:b,ue={chartType:"point",...null!=a&&{data:ne},oAccessor:c,rAccessor:h,projection:"horizontal"===d?"horizontal":"vertical",pieceStyle:se,size:[V,q],responsiveWidth:o.responsiveWidth,responsiveHeight:o.responsiveHeight,margin:ie.margin,barPadding:y,enableHover:X,...o.dataIdAccessor&&{dataIdAccessor:o.dataIdAccessor},showAxes:n.showAxes,oLabel:ee,rLabel:te,rFormat:u,...z&&{oFormat:z},showGrid:Y,oSort:p,...ie.legendBehaviorProps,...j({title:K,description:Z,summary:U,accessibleTable:J,className:l,animate:o.animate,maxDevicePixelRatio:o.maxDevicePixelRatio,axisExtent:o.axisExtent,autoPlaceAnnotations:o.autoPlaceAnnotations}),...G({tooltip:v,defaultTooltipContent:le}),...W({linkedHover:_,selection:C,onObservation:R,onClick:P,hoverHighlight:L,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...de&&de.length>0&&{annotations:de},...A&&{rExtent:A},...Object.fromEntries(Object.entries(k).filter(([e])=>"pieceStyle"!==e))};return rr(ke,{componentName:"DotPlot",width:V,height:q,children:rr(ji,{ref:r,...ue})})});ar.displayName="DotPlot";import{useMemo as sr,forwardRef as lr,useRef as cr}from"react";import{jsx as hr}from"react/jsx-runtime";var dr=lr(function(e,o){const i=It(e.mode,{width:e.width??400,height:e.height??400,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,showCategoryTicks:e.showCategoryTicks,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=cr(null),{data:r,margin:a,className:s,categoryAccessor:l="category",valueAccessor:c="value",colorBy:h,colorScheme:d,startAngle:u=0,cornerRadius:m,tooltip:g,annotations:p,frameProps:f={},selection:y,linkedHover:v,onObservation:b,onClick:x,hoverHighlight:A,chartId:S,loading:k,loadingContent:C,emptyContent:_,legendInteraction:R,legendPosition:P,color:L,stroke:M,strokeWidth:I,opacity:T}=e,{width:H,height:B,enableHover:O,showLegend:D,title:F,description:E,summary:N,accessibleTable:z}=i,V=sr(()=>je(r),[r]),q=h||l,X=w({data:V,rawData:r,colorBy:q,colorScheme:d,legendInteraction:R,legendPosition:P,frameLegend:f,selection:y,linkedHover:v,fallbackFields:q?["string"==typeof q?q:""]:[],unwrapData:!0,onObservation:b,onClick:x,hoverHighlight:A,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"PieChart",chartId:S,showLegend:D,userMargin:a,marginDefaults:i.marginDefaults,loading:k,loadingContent:C,emptyContent:_,width:H,height:B,hasTitle:!!F,axisChrome:{hasAxis:!1}}),Y=Et(),Q=sr(()=>new Map,[]),K=Xi({colorBy:q,colorScale:X.colorScale,color:L,themeCategorical:Y,colorScheme:d,categoryIndexMap:Q,userPieceStyle:f?.pieceStyle,stroke:M,strokeWidth:I,opacity:T,effectiveSelectionHook:X.effectiveSelectionHook,resolvedSelection:X.resolvedSelection,cycleByCategory:!0}),Z=sr(()=>$({categoryAccessor:l,valueAccessor:c,groupAccessor:h&&h!==l?h:void 0,groupLabel:"string"==typeof h?h:"group",pieData:!0}),[l,c,h]),U=t({componentName:"PieChart",data:r,accessors:{categoryAccessor:l,valueAccessor:c}}),{effectiveLegendProps:J,effectiveMargin:ee}=Vi({ref:o,frameRef:n,setup:X});if(X.earlyReturn)return X.earlyReturn;const te={chartType:"pie",...null!=r&&{data:V},oAccessor:l,rAccessor:c,projection:"radial",pieceStyle:K,startAngle:u,...null!=m&&{cornerRadius:m},size:[H,B],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ee,enableHover:O,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...J,...j({title:F,description:E,summary:N,accessibleTable:z,className:s,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...G({tooltip:g,defaultTooltipContent:Z}),...W({linkedHover:v,selection:y,onObservation:b,onClick:x,hoverHighlight:A,mobileInteraction:X.mobileInteraction,customHoverBehavior:X.customHoverBehavior,customClickBehavior:X.customClickBehavior}),...p&&p.length>0&&{annotations:p},...Object.fromEntries(Object.entries(f).filter(([e])=>"pieceStyle"!==e))};return U?hr(be,{componentName:"PieChart",message:U,width:H,height:B}):hr(ke,{componentName:"PieChart",width:H,height:B,children:hr(ji,{ref:n,...te})})});dr.displayName="PieChart";import{useMemo as ur,forwardRef as mr,useRef as gr}from"react";import{jsx as pr}from"react/jsx-runtime";var fr=mr(function(e,o){const i=It(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,linkedHover:e.linkedHover,showCategoryTicks:e.showCategoryTicks,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:400,height:400}),n=gr(null),{data:r,margin:a,className:s,categoryAccessor:l="category",valueAccessor:c="value",innerRadius:h,centerContent:d,colorBy:u,colorScheme:m,startAngle:g=0,cornerRadius:p,tooltip:f,annotations:y,frameProps:v={},selection:b,linkedHover:x,onObservation:A,onClick:S,hoverHighlight:k,chartId:C,loading:_,loadingContent:R,emptyContent:P,legendInteraction:L,legendPosition:M,color:I,stroke:T,strokeWidth:H,opacity:B}=e,{width:O,height:D,enableHover:F,showLegend:E,title:N,description:z,summary:V,accessibleTable:q}=i,X=ur(()=>je(r),[r]),Y=u||l,Q=w({data:X,rawData:r,colorBy:Y,colorScheme:m,legendInteraction:L,legendPosition:M,frameLegend:v,selection:b,linkedHover:x,fallbackFields:Y?["string"==typeof Y?Y:""]:[],unwrapData:!0,onObservation:A,onClick:S,hoverHighlight:k,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"DonutChart",chartId:C,showLegend:E,userMargin:a,marginDefaults:i.marginDefaults,loading:_,loadingContent:R,emptyContent:P,width:O,height:D,hasTitle:!!N,axisChrome:{hasAxis:!1}}),K=h??Math.max(2,.15*Math.min(O,D)),Z=Et(),U=ur(()=>new Map,[]),J=Xi({colorBy:Y,colorScale:Q.colorScale,color:I,themeCategorical:Z,colorScheme:m,categoryIndexMap:U,userPieceStyle:v?.pieceStyle,stroke:T,strokeWidth:H,opacity:B,effectiveSelectionHook:Q.effectiveSelectionHook,resolvedSelection:Q.resolvedSelection,cycleByCategory:!0}),ee=ur(()=>$({categoryAccessor:l,valueAccessor:c,groupAccessor:u&&u!==l?u:void 0,groupLabel:"string"==typeof u?u:"group",pieData:!0}),[l,c,u]),te=t({componentName:"DonutChart",data:r,accessors:{categoryAccessor:l,valueAccessor:c}}),{effectiveLegendProps:oe,effectiveMargin:ie}=Vi({ref:o,frameRef:n,setup:Q});if(Q.earlyReturn)return Q.earlyReturn;const ne={chartType:"donut",...null!=r&&{data:X},oAccessor:l,rAccessor:c,projection:"radial",pieceStyle:J,innerRadius:K,startAngle:g,...null!=p&&{cornerRadius:p},centerContent:d,size:[O,D],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ie,enableHover:F,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...oe,...j({title:N,description:z,summary:V,accessibleTable:q,className:s,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...G({tooltip:f,defaultTooltipContent:ee}),...W({linkedHover:x,selection:b,onObservation:A,onClick:S,hoverHighlight:k,mobileInteraction:Q.mobileInteraction,customHoverBehavior:Q.customHoverBehavior,customClickBehavior:Q.customClickBehavior}),...y&&y.length>0&&{annotations:y},...Object.fromEntries(Object.entries(v).filter(([e])=>"pieceStyle"!==e))};return te?pr(be,{componentName:"DonutChart",message:te,width:O,height:D}):pr(ke,{componentName:"DonutChart",width:O,height:D,children:pr(ji,{ref:n,...ne})})});fr.displayName="DonutChart";import{useMemo as yr,forwardRef as vr,useRef as br}from"react";function xr(e=240){const t=360-e,o=180+t/2,i=o*Math.PI/180;return{sweepRad:e*Math.PI/180,gapDeg:t,startAngleDeg:o,startAngleRad:i,offsetRad:-Math.PI/2+i}}function wr(e){return Math.max(0,Math.min(1,e))}function Ar(e){const t=e.trim();if(t.startsWith("#")){let e=t.slice(1);if(3===e.length&&(e=e.split("").map(e=>e+e).join("")),6===e.length&&/^[0-9a-f]{6}$/i.test(e))return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}const o=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);if(o){const e=[Number(o[1]),Number(o[2]),Number(o[3])];if(e.every(Number.isFinite))return e}return null}function Sr(e,t,o){const i=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0");return`#${i(e)}${i(t)}${i(o)}`}function kr(e,t,o){const i=e.filter(e=>Number.isFinite(e.offset)).map(e=>({offset:wr(e.offset),color:e.color??o,opacity:null==e.opacity?1:wr(e.opacity)})).sort((e,t)=>e.offset-t.offset);if(0===i.length)return"#999999";const n=e=>{if(1===e.opacity)return e.color;const t=Ar(e.color);return t?`rgba(${t[0]},${t[1]},${t[2]},${e.opacity})`:e.color};if(1===i.length)return n(i[0]);const r=wr(t);if(i[0].offset>=r)return n(i[0]);if(r>=i[i.length-1].offset)return n(i[i.length-1]);for(let e=0;i.length-1>e;e++){const t=i[e],o=i[e+1];if(t.offset>r||r>o.offset)continue;const a=o.offset-t.offset,s=a>0?(r-t.offset)/a:0,l=Ar(t.color),c=Ar(o.color);if(!l||!c)return n(.5>s?t:o);const[h,d,u]=l,[m,g,p]=c,f=h+(m-h)*s,y=d+(g-d)*s,v=u+(p-u)*s,b=t.opacity+(o.opacity-t.opacity)*s;return 1===b?Sr(f,y,v):`rgba(${Math.round(f)},${Math.round(y)},${Math.round(v)},${b})`}return n(i[i.length-1])}function Cr(e,t,o){return null==o?`${e}-${t}`:`${e}-${t}-${o}`}import{jsx as _r,jsxs as Rr}from"react/jsx-runtime";var Pr=vr(function(e,t){const o=It(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLegend:!1,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:300,height:250}),i=br(null),n="context"===o.mode,{compactMode:r}=o,{value:a,min:s=0,max:c=100,thresholds:h,gradientFill:d,color:u,backgroundColor:m="var(--semiotic-grid, #e0e0e0)",arcWidth:g=.3,cornerRadius:p,showNeedle:f=!0,needleColor:y="var(--semiotic-text, #333)",centerContent:v,valueFormat:b,showScaleLabels:w=!r,sweep:A=240,fillZones:S=!0,tooltip:C,annotations:_,frameProps:R={},className:P,stroke:L,strokeWidth:M,opacity:I}=e,{width:T,height:H,title:B,description:O,summary:D,accessibleTable:F}=o,E=l(d),N=Math.max(s,Math.min(c,a)),j=c-s||1,z=(N-s)/j,{gaugeData:$,pieceStyle:G,gaugeAnnotations:V}=yr(()=>function(e){const{min:t,max:o,value:i,thresholds:n,fillColor:r,backgroundColor:a,fillZones:s,showScaleLabels:l,gradientFill:c,gradientSteps:h=240}=e,d=o-t||1,u=(Math.max(t,Math.min(o,i))-t)/d;let m=n&&n.length>0?[...n].sort((e,t)=>e.value-t.value):[{value:o,color:r||"#007bff"}];m=m.map(e=>({...e,value:Math.max(t,Math.min(o,e.value))})),o>m[m.length-1].value&&m.push({value:o,color:m[m.length-1].color});const g=!!c&&c.stops.length>=2,p=[],f=new Map,y=[];if(g){const e=s?u:1,t=Cr("bg",0);if(p.push({category:t,value:1,_zone:"Track",_isFill:!1,_pctStart:0,_pct:1,_roundedEnds:{start:!0,end:!0},_nonInteractive:!0}),f.set(t,{fill:a,opacity:.4}),e>0){const t=Math.max(1,Math.floor(h)),o=Math.max(1,Math.min(t,Math.round(e*t))),i=[];for(let t=0;o>t;t++)i.push(kr(c.stops,e*(t+.5)/o,r||m[0]?.color||"#007bff"));const n=Cr("fill",0);p.push({category:n,value:e,_zone:"Gradient",_isFill:!0,_pctStart:0,_pct:e,_roundedEnds:{start:!0,end:!0},_nonInteractive:!0,_gradientBand:{colors:i}}),f.set(n,{fill:i[0]||a})}}else{let e=t;for(let o=0;m.length>o;o++){const i=m[o],n=(i.value-e)/d,r=(e-t)/d,l=(i.value-t)/d,c=Math.max(0,(s?Math.min(u,l):l)-r),h=s?Math.max(0,n-c):0;if(c>0){const e=Cr("fill",o);p.push({category:e,value:c,_zone:i.label||"Zone "+(o+1),_isFill:!0}),f.set(e,{fill:i.color})}if(h>0){const e=Cr("bg",o);p.push({category:e,value:h,_zone:i.label||"Zone "+(o+1),_isFill:!1}),f.set(e,{fill:a,opacity:.4})}e=i.value}}if(l&&n&&n.length>0)for(const e of n)e.value>t&&o>e.value&&y.push({type:"gauge-label",value:e.value,label:e.label||e.value+""});return{gaugeData:p,pieceStyle:(e,t)=>f.get(t||e.category)||{fill:a},gaugeAnnotations:y}}({min:s,max:c,value:a,thresholds:h,fillColor:u,backgroundColor:m,fillZones:S,showScaleLabels:w,gradientFill:E}),[a,s,c,h,u,m,w,S,E]),q=yr(()=>x(G,{stroke:L,strokeWidth:M,opacity:I}),[G,L,M,I]),{activeSelectionHook:X,customHoverBehavior:Y,customClickBehavior:Q}=Tt({selection:e.selection,linkedHover:e.linkedHover,fallbackFields:["category"],onObservation:e.onObservation,chartType:"GaugeChart",chartId:e.chartId,onClick:e.onClick,hoverHighlight:e.hoverHighlight,colorByField:"category",mobileInteraction:o.mobileInteraction}),K=k(e.selection),Z=yr(()=>$t(q,X,K),[q,X,K]),{sweepRad:U,startAngleDeg:J}=xr(A),ee=function(e=240){const{sweepRad:t,offsetRad:o}=xr(e),i=[[Math.cos(o),Math.sin(o)],[Math.cos(o+t),Math.sin(o+t)],[0,0]];for(let e=0;2*Math.PI>e;e+=Math.PI/2)((e-o)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)>t+.001||i.push([Math.cos(e),Math.sin(e)]);const n=i.map(e=>e[0]),r=i.map(e=>e[1]),[a,s]=qt(n),[l,c]=qt(r);return{minX:a,maxX:s,minY:l,maxY:c,width:s-a,height:c-l,cx:(a+s)/2,cy:(l+c)/2}}(A),te=Math.min(10,Math.max(1,Math.min(T,H)/12)),oe=ee.cx,ie=ee.cy,ne=Math.max(4,Math.min((T-2*te)/ee.width,(H-2*te)/ee.height)-2),re=Math.max(0,Math.min(ne-1.5,ne*(1-g))),ae=T/2-oe*ne,se=H/2-ie*ne,le=2*(ne+4),ce=yr(()=>{if(r&&null==v)return null;if(null!=v)return"function"==typeof v?v(N,s,c):v;const e=b?b(N):Math.round(N)+"";return Rr("div",{style:{textAlign:"center",lineHeight:1.2},children:[_r("div",{style:{fontSize:Math.max(16,.3*ne),fontWeight:700,color:"var(--semiotic-text, #333)"},children:e}),w&&Rr("div",{style:{fontSize:11,color:"var(--semiotic-text-secondary, #666)"},children:[s," – ",c]})]})},[v,N,s,c,b,w,ne,r]),he=yr(()=>n&&null==v?{type:"gauge-value",text:b?b(N):Math.round(N)+""}:null,[n,v,N,b]),de=yr(()=>{if(!f)return null;const e=-Math.PI/2+J*Math.PI/180+z*U,t=re>20?re-8:ne-1;return{type:"gauge-needle",tipX:Math.cos(e)*t,tipY:Math.sin(e)*t,color:y}},[f,J,z,U,re,ne,y]),ue=yr(()=>(e,t,o)=>{if("gauge-needle"===e.type){const i=(o.width||T)/2,n=(o.height||H)/2,r=Math.max(1,ne-re),a=Math.max(1,Math.min(2.5,.4*r)),s=Math.max(1,Math.min(5,.6*r));return Rr("g",{transform:`translate(${i},${n})`,children:[_r("line",{x1:0,y1:0,x2:e.tipX,y2:e.tipY,stroke:e.color,strokeWidth:a,strokeLinecap:"round"}),_r("circle",{cx:0,cy:0,r:s,fill:e.color})]},"gauge-needle-"+t)}if("gauge-label"===e.type){const i=-Math.PI/2+J*Math.PI/180+(e.value-s)/j*U,n=(o.width||T)/2,r=(o.height||H)/2,a=re-1,l=ne+1,c=Math.cos(i)*a,h=Math.sin(i)*a,d=Math.cos(i)*l,u=Math.sin(i)*l,m=ne+10,g=Math.cos(i)*m,p=Math.sin(i)*m,f=((i+Math.PI/2)/(2*Math.PI)*12+12)%12;let y,v;return f>=11||1>f?(y="middle",v="auto"):f>=1&&5>f?(y="start",v="middle"):f>=5&&7>f?(y="middle",v="hanging"):(y="end",v="middle"),Rr("g",{transform:`translate(${n},${r})`,children:[_r("line",{x1:c,y1:h,x2:d,y2:u,stroke:"var(--semiotic-border, #ccc)",strokeWidth:2,strokeLinecap:"round"}),_r("text",{x:g,y:p,textAnchor:y,dominantBaseline:v,fill:"var(--semiotic-text-secondary, #666)",fontSize:10,style:{userSelect:"none",fontSize:"var(--semiotic-gauge-label-font-size, 10px)"},children:e.label})]},"gauge-label-"+t)}return"gauge-value"===e.type?_r("text",{x:(o.width||T)/2,y:(o.height||H)/2-.2*re,textAnchor:"middle",dominantBaseline:"middle",fontSize:Math.max(12,Math.min(22,.28*ne)),fontWeight:700,fill:"var(--semiotic-text, #333)",style:{userSelect:"none"},children:e.text},"gauge-value-"+t):null},[T,H,s,j,J,U,re,ne]),me=yr(()=>{const e=[...V,..._||[]];return de&&e.push(de),he&&e.push(he),e},[V,_,de,he]),ge=yr(()=>e=>{const t=e?.data?.[0]||e?.data||e,o=t?._zone||"",i=t?._isFill;return Rr("div",{className:"semiotic-tooltip",style:{padding:"6px 10px",background:"var(--semiotic-tooltip-bg, white)",borderRadius:"var(--semiotic-tooltip-radius, 6px)",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0,0,0,0.15))"},children:[_r("div",{style:{fontWeight:600},children:o}),_r("div",{style:{fontSize:"0.85em",color:"var(--semiotic-text-secondary, #666)"},children:i?"Current: "+Math.round(N):"Remaining"})]})},[N]),pe=gt(e.loading,T,H,e.loadingContent),fe=pe?null:ut(Number.isFinite(a)?[{value:a}]:[],T,H,e.emptyContent);if(pe)return pe;if(fe)return fe;if(0===$.length)return _r(be,{componentName:"GaugeChart",message:"No data to display",width:T,height:H});const ye={chartType:"donut",data:$,oAccessor:"category",rAccessor:"value",oSort:!1,projection:"radial",pieceStyle:Z,innerRadius:re,startAngle:J,sweepAngle:A,...null!=p&&{cornerRadius:p},centerContent:ce,size:[T,H],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:{top:se-le/2,bottom:H-se-le/2,left:ae-le/2,right:T-ae-le/2},enableHover:o.enableHover,showAxes:!1,showCategoryTicks:!1,tooltipContent:!1===C?()=>null:rt(C)||ge,...W({linkedHover:e.linkedHover,selection:e.selection,onObservation:e.onObservation,onClick:e.onClick,hoverRadius:e.hoverRadius,hoverHighlight:e.hoverHighlight,mobileInteraction:o.mobileInteraction,customHoverBehavior:Y,customClickBehavior:Q}),svgAnnotationRules:ue,...me.length>0&&{annotations:me},...B&&{title:B},...O&&{description:O},...D&&{summary:D},...void 0!==F&&{accessibleTable:F},...P&&{className:P},...null!=e.animate&&{animate:e.animate},...R};return _r(ke,{componentName:"GaugeChart",width:T,height:H,children:_r(ji,{ref:i,...ye})})});Pr.displayName="GaugeChart";import{useMemo as Lr,forwardRef as Mr,useRef as Ir}from"react";import{jsx as Tr}from"react/jsx-runtime";var Hr=Mr(function(e,o){const i=It(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=Ir(null),{data:r,margin:a,className:s,categoryAccessor:l="category",groupBy:h,valueAccessor:d="value",orientation:u="vertical",valueFormat:m,colorBy:g,colorScheme:p,sort:f=!1,barPadding:y=60,roundedTop:v,gradientFill:b,styleRules:x,baselinePadding:A=!1,tooltip:S,annotations:k,valueExtent:C,frameProps:_={},selection:R,linkedHover:P,onObservation:L,onClick:M,hoverHighlight:I,chartId:T,loading:H,loadingContent:B,emptyContent:O,legendInteraction:D,legendPosition:F,color:E,stroke:N,strokeWidth:z,opacity:V,categoryFormat:q}=e,{width:X,height:Y,enableHover:Q,showGrid:K,showLegend:Z,title:U,description:J,summary:ee,accessibleTable:te,categoryLabel:oe,valueLabel:ie}=i,ne=Lr(()=>je(r),[r]),re=g||h,ae=w({data:ne,rawData:r,colorBy:re,colorScheme:p,legendInteraction:D,legendPosition:F,frameLegend:_,selection:R,linkedHover:P,fallbackFields:re?["string"==typeof re?re:""]:[],unwrapData:!0,onObservation:L,onClick:M,hoverHighlight:I,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"GroupedBarChart",chartId:T,showLegend:Z,userMargin:a,marginDefaults:i.marginDefaults,loading:H,loadingContent:B,emptyContent:O,width:X,height:Y,hasTitle:!!U,axisChrome:xt({showAxes:i.showAxes,projection:"horizontal"===u?"horizontal":"vertical",hasCategoryLabel:!!oe,hasValueLabel:!!ie})}),se=Et(),le=Lr(()=>new Map,[]),ce=Lr(()=>de(d),[d]),he=Xi({colorBy:re,colorScale:ae.colorScale,color:E,themeCategorical:se,colorScheme:p,categoryIndexMap:le,userPieceStyle:_.pieceStyle,stroke:N,strokeWidth:z,opacity:V,styleRules:x,resolveRuleValue:ce,effectiveSelectionHook:ae.effectiveSelectionHook,resolvedSelection:ae.resolvedSelection}),ue=Lr(()=>$({categoryAccessor:h,valueAccessor:d,groupAccessor:l,valueFormat:m}),[h,l,d,m]),me=t({componentName:"GroupedBarChart",data:r,accessors:{categoryAccessor:l,valueAccessor:d},requiredProps:{groupBy:h}}),{effectiveLegendProps:ge,effectiveMargin:pe}=Vi({ref:o,frameRef:n,setup:ae}),fe=Lr(()=>c(b),[b]);if(ae.earlyReturn)return ae.earlyReturn;const ye={chartType:"clusterbar",...null!=r&&{data:ne},oAccessor:l,rAccessor:d,groupBy:h,oSort:f,projection:"horizontal"===u?"horizontal":"vertical",pieceStyle:he,size:[X,Y],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:pe,barPadding:y,...null!=v&&{roundedTop:v},...fe&&{gradientFill:fe},baselinePadding:A,enableHover:Q,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:oe,rLabel:ie,rFormat:m,...q&&{oFormat:q},showGrid:K,...ge,...j({title:U,description:J,summary:ee,accessibleTable:te,className:s,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...G({tooltip:S,defaultTooltipContent:ue}),...W({linkedHover:P,selection:R,onObservation:L,onClick:M,hoverHighlight:I,mobileInteraction:ae.mobileInteraction,customHoverBehavior:ae.customHoverBehavior,customClickBehavior:ae.customClickBehavior}),...k&&k.length>0&&{annotations:k},...C&&{rExtent:C},...Object.fromEntries(Object.entries(_).filter(([e])=>"pieceStyle"!==e))};return me?Tr(be,{componentName:"GroupedBarChart",message:me,width:X,height:Y}):Tr(ke,{componentName:"GroupedBarChart",width:X,height:Y,children:Tr(ji,{ref:n,...ye})})});Hr.displayName="GroupedBarChart";import{useMemo as Br,forwardRef as Or,useRef as Dr}from"react";import{jsx as Fr,jsxs as Er}from"react/jsx-runtime";var Nr=Or(function(e,o){const i=It(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:!1,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,showCategoryTicks:!1,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=Dr(null);S(o,{variant:"xy",frameRef:n});const{data:r,margin:a,className:s,stepAccessor:l="step",valueAccessor:c="value",categoryAccessor:h,colorBy:d,colorScheme:u,orientation:m="horizontal",connectorOpacity:g=.3,showLabels:p=!0,tooltip:f,annotations:y,frameProps:v={},selection:b,linkedHover:x,onObservation:A,onClick:k,hoverHighlight:C,chartId:_,loading:R,loadingContent:P,emptyContent:L,legendInteraction:M,legendPosition:I,color:T,stroke:H,strokeWidth:B,opacity:O,categoryFormat:D}=e,F="vertical"===m,{width:E,height:N,enableHover:j,showLegend:z,title:$,description:G,summary:V,accessibleTable:q}=i,X=F?{top:$?60:40,right:20,bottom:60,left:60}:{top:$?40:10,right:10,bottom:10,left:10},Y=Br(()=>je(r),[r]),Q=d||h,K=!Q,Z=w({data:Y,rawData:r,colorBy:Q,colorScheme:u,legendInteraction:M,legendPosition:I,frameLegend:v,selection:b,linkedHover:x,fallbackFields:Q?["string"==typeof Q?Q:""]:[],unwrapData:!0,onObservation:A,onClick:k,hoverHighlight:C,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"FunnelChart",chartId:_,showLegend:z,userMargin:a,marginDefaults:X,loading:R,loadingContent:P,emptyContent:L,width:E,height:N,hasTitle:!!$,axisChrome:xt({showAxes:F&&i.showAxes,projection:F?"vertical":"horizontal",hasCategoryLabel:!1,hasValueLabel:!1})});Wt("FunnelChart",Y,"stepAccessor",l),Wt("FunnelChart",Y,"valueAccessor",c);const U=Et(),J=Br(()=>new Map,[]),ee=Br(()=>{if(K)return T||(U?.[0]?U[0]:Array.isArray(u)&&u[0]?u[0]:"#4e79a7")},[K,T,U,u]),te=Xi({colorBy:ee?void 0:Q,colorScale:Z.colorScale,color:ee??T,themeCategorical:U,colorScheme:u,categoryIndexMap:J,userPieceStyle:v?.pieceStyle,stroke:H,strokeWidth:B,opacity:O,effectiveSelectionHook:Z.effectiveSelectionHook,resolvedSelection:Z.resolvedSelection}),oe=Br(()=>e=>{const t=e?.data||e,o=t?.__funnelStep||t?.__barFunnelStep||t?.step||"",i=t?.__funnelValue??t?.__barFunnelValue??t?.value??"",n=t?.__funnelPercent??t?.__barFunnelPercent,r=t?.__funnelIsFirstStep??t?.__barFunnelIsFirstStep,a=t?.__barFunnelIsDropoff,s=t?.__barFunnelCategory??t?.category,l=null==n||r?"":` (${.05>Math.abs(n-Math.round(n))?Math.round(n)+"%":n.toFixed(1)+"%"})`;return Er("div",{className:"semiotic-tooltip",style:Ne,children:[o&&Fr("div",{style:{fontWeight:"bold"},children:o+""}),s&&s!==o&&Fr("div",{style:{marginTop:2,opacity:.8},children:s+""}),a&&Fr("div",{style:{marginTop:2,fontStyle:"italic",opacity:.7},children:"Dropoff"}),Er("div",{style:{marginTop:4},children:[i+"",l]})]})},[]);if(Z.earlyReturn)return Z.earlyReturn;const ie=t({componentName:"FunnelChart",data:r,accessors:{stepAccessor:l,valueAccessor:c}});if(ie)return Fr(be,{componentName:"FunnelChart",message:ie,width:E,height:N});const ne={chartType:F?"bar-funnel":"funnel",...null!=r&&{data:Y},oAccessor:l,rAccessor:c,...h&&{stackBy:h},projection:F?"vertical":"horizontal",barPadding:F?40:0,pieceStyle:te,size:[E,N],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Z.margin,enableHover:j,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:F&&i.showAxes,showCategoryTicks:F&&i.showAxes,...D&&{oFormat:D},showGrid:F,...!F&&{connectorOpacity:g},showLabels:p,...Z.legendBehaviorProps,...$&&{title:$},...G&&{description:G},...V&&{summary:V},...void 0!==q&&{accessibleTable:q},...s&&{className:s},...null!=e.animate&&{animate:e.animate},tooltipContent:!1===f?()=>null:!0===f||null==f?oe:rt(f)||oe,...W({linkedHover:x,selection:b,onObservation:A,onClick:k,hoverHighlight:C,mobileInteraction:Z.mobileInteraction,customHoverBehavior:Z.customHoverBehavior,customClickBehavior:Z.customClickBehavior}),...y&&y.length>0&&{annotations:y},...Object.fromEntries(Object.entries(v).filter(([e])=>"pieceStyle"!==e))};return Fr(ke,{componentName:"FunnelChart",width:E,height:N,children:Fr(ji,{ref:n,...ne})})});Nr.displayName="FunnelChart";import{useMemo as jr,forwardRef as Wr,useRef as zr}from"react";import{jsx as $r}from"react/jsx-runtime";var Gr=Wr(function(e,o){const i=It(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=zr(null),{data:r,margin:a,className:s,categoryAccessor:l="category",subcategoryAccessor:h,valueAccessor:d="value",orientation:u="horizontal",valueFormat:m,colorBy:g,colorScheme:p,barPadding:f,tooltip:y,annotations:v,brush:b,onBrush:x,linkedBrush:A,frameProps:S={},selection:k,linkedHover:C,onObservation:_,onClick:R,hoverHighlight:P,chartId:L,loading:M,loadingContent:I,emptyContent:T,legendInteraction:H,legendPosition:B,color:O,stroke:D,strokeWidth:F,opacity:E,categoryFormat:N,rTickValues:z,tickLabelEdgeAlign:V,showCategoryTicks:q,gradientFill:X,trackFill:Y,roundedTop:Q,valueExtent:K}=e,{width:Z,height:U,enableHover:J,showGrid:ee,showLegend:te,title:oe,description:ie,summary:ne,accessibleTable:re,categoryLabel:ae,valueLabel:se}=i,le=jr(()=>je(r),[r]),ce=g||h,he=jr(()=>{if(null!=f)return f;if("sparkline"!==i.mode)return 40;const e=new Set(le.map(e=>"function"==typeof l?l(e):e[l])),t=Math.max(1,e.size);return t>1?Math.max(0,Math.min(1,(("horizontal"===u?U:Z)-2*t)/(t-1))):1},[f,i.mode,le,l,u,Z,U]),de=w({data:le,rawData:r,colorBy:ce,colorScheme:p,legendInteraction:H,legendPosition:B,frameLegend:S,selection:k,linkedHover:C,fallbackFields:ce?["string"==typeof ce?ce:""]:[],unwrapData:!0,onObservation:_,onClick:R,hoverHighlight:P,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"SwimlaneChart",chartId:L,showLegend:te,userMargin:a,marginDefaults:i.marginDefaults,loading:M,loadingContent:I,emptyContent:T,width:Z,height:U,hasTitle:!!oe,axisChrome:xt({showAxes:i.showAxes,projection:"horizontal"===u?"horizontal":"vertical",hasCategoryLabel:!1!==q&&!!ae,hasValueLabel:!!se})}),ue=Pn({brushProp:b,onBrushProp:x,linkedBrush:A,valueAccessor:d}),me=Et(),ge=jr(()=>new Map,[]),pe=Xi({colorBy:ce,colorScale:de.colorScale,color:O,themeCategorical:me,colorScheme:p,categoryIndexMap:ge,userPieceStyle:S?.pieceStyle,stroke:D,strokeWidth:F,opacity:E,effectiveSelectionHook:de.effectiveSelectionHook,resolvedSelection:de.resolvedSelection,cycleByCategory:!0}),fe=jr(()=>$({categoryAccessor:h,valueAccessor:d,groupAccessor:l,valueFormat:m}),[h,l,d,m]),ye=t({componentName:"SwimlaneChart",data:r,accessors:{categoryAccessor:l,valueAccessor:d,subcategoryAccessor:h},requiredProps:{subcategoryAccessor:h}}),{effectiveLegendProps:ve,effectiveMargin:xe}=Vi({ref:o,frameRef:n,setup:de}),we=jr(()=>c(X),[X]);if(de.earlyReturn)return de.earlyReturn;const Ae={chartType:"swimlane",...null!=r&&{data:le},oAccessor:l,rAccessor:d,stackBy:h,projection:"horizontal"===u?"horizontal":"vertical",pieceStyle:pe,size:[Z,U],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:xe,barPadding:he,enableHover:J,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:!1===q?void 0:ae,rLabel:se,rFormat:m,...z&&{rTickValues:z},...null!=V&&{tickLabelEdgeAlign:V},...N&&{oFormat:N},...void 0!==q&&{showCategoryTicks:q},showGrid:ee,...ve,...j({title:oe,description:ie,summary:ne,accessibleTable:re,className:s,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...G({tooltip:y,defaultTooltipContent:fe}),...W({linkedHover:C,selection:k,onObservation:_,onClick:R,hoverHighlight:P,mobileInteraction:de.mobileInteraction,customHoverBehavior:de.customHoverBehavior,customClickBehavior:de.customClickBehavior}),...v&&v.length>0&&{annotations:v},...we&&{gradientFill:we},...null!=Y&&{trackFill:Y},...null!=Q&&{roundedTop:Q},...K&&{rExtent:K},...ue.brushStreamProps,...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return ye?$r(be,{componentName:"SwimlaneChart",message:ye,width:Z,height:U}):$r(ke,{componentName:"SwimlaneChart",width:Z,height:U,children:$r(ji,{ref:n,...Ae})})});Gr.displayName="SwimlaneChart";import{forwardRef as Vr,useMemo as qr}from"react";import{jsx as Xr}from"react/jsx-runtime";var Yr=Vr(function(e,t){const{data:o,layout:i,layoutConfig:n,onLayoutError:r,categoryAccessor:a="category",valueAccessor:s="value",oExtent:l,rExtent:c,projection:h="vertical",margin:d,className:u,colorBy:m,colorScheme:g,tooltip:p,showAxes:f=!1,annotations:y,onObservation:v,onClick:b,selection:x,linkedHover:w,chartId:S,loading:k,loadingContent:C,emptyContent:_,frameProps:R={}}=e,{frameRef:P,resolved:L,safeData:M,setup:I,earlyReturn:T}=A({imperativeRef:t,imperativeVariant:"xy",chartTypeLabel:"OrdinalCustomChart",unwrapData:!0,data:o,colorBy:m,colorScheme:g,frameLegend:R,selection:x,linkedHover:w,onObservation:v,onClick:b,chartId:S,loading:k,loadingContent:C,emptyContent:_,margin:d,width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),H=I.effectiveSelectionHook,B=qr(()=>H?.isActive?{isActive:!0,predicate:H.predicate}:null,[H?.isActive,H?.predicate]),O=qr(()=>rt(p),[p]);if(T)return T;const{width:D,height:F,enableHover:E,showGrid:N,title:z,description:$,summary:G,accessibleTable:V}=L,q={chartType:"custom",...null!=o&&{data:M},customLayout:i,layoutConfig:n,onLayoutError:r,...B&&{layoutSelection:B},oAccessor:a,rAccessor:s,oExtent:l,rExtent:c,projection:h,colorAccessor:m,colorScheme:g,size:[D,F],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:I.margin,enableHover:E,showAxes:f,showGrid:N,annotations:y,...j({title:z,description:$,summary:G,accessibleTable:V,className:u,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...!1===p?{tooltipContent:()=>null}:O?{tooltipContent:O}:{},...I.legendBehaviorProps,...W({linkedHover:w,selection:x,onObservation:v,onClick:b,hoverHighlight:!1,mobileInteraction:I.mobileInteraction,customHoverBehavior:I.customHoverBehavior,customClickBehavior:I.customClickBehavior}),...R};return Xr(ke,{componentName:"OrdinalCustomChart",width:D,height:F,children:Xr(ji,{ref:P,...q})})});Yr.displayName="OrdinalCustomChart";export{ji as StreamOrdinalFrame_default,Qi as BarChart,en as StackedBarChart,wn as LikertChart,Mn as SwarmPlot,En as BoxPlot,Vn as Histogram,Kn as ViolinPlot,tr as RidgelinePlot,ar as DotPlot,dr as PieChart,fr as DonutChart,Pr as GaugeChart,Hr as GroupedBarChart,Nr as FunnelChart,Gr as SwimlaneChart,Yr as OrdinalCustomChart};
@@ -0,0 +1 @@
1
+ import{mulberry32 as t}from"./c-SUILCHWU.min.js";import{forceCenter as e,forceCollide as n,forceLink as o,forceManyBody as i,forceSimulation as r,forceX as a,forceY as s}from"d3-force";function u(u,c,l={}){const d=l.iterations??260,m=l.repulsion??5200,h=l.linkDistance??165,f=l.linkStrength??.045,g=l.centerStrength??.018,p=l.damping??.84,y=l.nodeRadius??12,k=l.nodePadding??3,b=l.inset??.06,M=t(l.seed??1),v=new Map;for(const t of u)v.set(t.id,0);for(const t of c)v.set(t.source,(v.get(t.source)??0)+1),v.set(t.target,(v.get(t.target)??0)+1);const x=500,w=u.map(t=>({id:t.id,data:t,x:200+600*M(),y:200+600*M()})),T=new Set(u.map(t=>t.id)),S=c.filter(t=>T.has(t.source)&&T.has(t.target)).map(t=>({source:t.source,target:t.target}));if(d>0){const t=r(w).randomSource(M).alphaDecay(1-Math.pow(.001,1/d)).velocityDecay(Math.max(0,Math.min(1,1-p))).force("charge",i().strength(t=>{const e=v.get(t.id)??0;return 2.5*-Math.sqrt(m)*Math.sqrt(e+1)})).force("collide",n(t=>(t=>"function"==typeof y?y(t.data):y)(t)+k).strength(.9).iterations(2)).force("center",e(x,x).strength(.8)).force("x",a(x).strength(g)).force("y",s(x).strength(g));S.length>0&&t.force("link",o(S).id(t=>t.id).distance(h).strength(t=>{const e="string"==typeof t.target?t.target:t.target.id,n=Math.max(1,Math.min(v.get("string"==typeof t.source?t.source:t.source.id)??1,v.get(e)??1));return f/.045/n})),t.stop();for(let e=0;d>e;e+=1)t.tick()}let E=1/0,A=1/0,z=-1/0,N=-1/0;for(const t of w){const e=t.x??x,n=t.y??x;E>e&&(E=e),A>n&&(A=n),e>z&&(z=e),n>N&&(N=n)}const I=z-E,_=N-A,O={};for(const t of w)Object.defineProperty(O,t.id,{value:{x:0===I?.5:b+((t.x??x)-E)/I*(1-2*b),y:0===_?.5:b+((t.y??x)-A)/_*(1-2*b)},enumerable:!0,configurable:!0,writable:!0});return O}import{interpolateLab as c}from"d3-interpolate";function l(t){return"function"==typeof t?t:e=>e[t]}function d(t,e,n){const o=t?.data,i=o?o[e]:void 0;if(null!=i)return i;const r=t?.[e];return null==r?n:r}function m(t){return null==t?null:t.data??t.datum??t}function h(t,e){const n=new Map;for(const o of t){const t=e(o),i=n.get(t);i?i.push(o):n.set(t,[o])}return n}function f(t){const e=Object.create(null);return t((t,n)=>{e[t]=n}),e}function g(t,e){if(!e)return!0;const n=Array.isArray(e)?e:[e],o=t;for(const t of n)if(null!=t.value&&o[t.field]+""!=t.value+"")return!1;return!0}function p(t,e={}){const n=e.baseOpacity??1;return e.highlight||e.predicate?!g(t,e.highlight)||e.predicate&&!e.predicate(t)?e.dimOpacity??.16:Math.min(1,n+(e.brighten??0)):n}function y(t){return t.join("|")}var k=class{constructor(t=12){this.maxSize=t,this.store=new Map}get(t){return this.store.get(t)}set(t,e){this.maxSize>this.store.size||this.store.clear(),this.store.set(t,e)}getOrCompute(t,e){const n=this.store.get(t);if(void 0!==n)return n;const o=e();return this.set(t,o),o}clear(){this.store.clear()}get size(){return this.store.size}};function b(t,e=.72){const n=c(t,"#ffffff"),o=c(t,"#000000"),i=c(t,t)(0);return t=>{const r=0>t?0:t>1?1:t;return.5===r?i:.5>r?n(2*(.5-r)*e):o(2*(r-.5)*e)}}function M(t,e,n=.72){return b(t,n)(e)}function v(t){return f(e=>{for(const[n,o]of Object.entries(t))e(n,o)})}function x(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"item"}function w(t,e,n){return Math.max(e,Math.min(n,t))}function T(t){const e=Number(t);return Number.isFinite(e)?Math.max(0,e):0}function S(t){if(0===t.length)return 0;let e=0;for(const n of t)e+=n;return e/t.length}function E(t,e){const n=w(e,0,1),o=t.trim().replace(/^#/,""),i=3===o.length?o.split("").map(t=>t+t).join(""):o;return/^[0-9a-fA-F]{6}$/.test(i)?`rgba(${parseInt(i.slice(0,2),16)}, ${parseInt(i.slice(2,4),16)}, ${parseInt(i.slice(4,6),16)}, ${n})`:t}var A=1e-6;function z(t){return Number.isFinite(t)?Math.max(0,t):0}function N(t,e){const n=Number(e.unit),o=z(t),i=e.maxUnits??1/0,r=e.minFraction??0;if(0>=n||0>=i||0>=o)return{units:[],unit:n>0?n:0,total:o,shown:0,overflow:o>0&&!(i>0)};const a=Math.ceil(o/n-A),s=Math.min(i,a),u=a>i,c=[];for(let t=0;s>t;t+=1){const e=t*n;let i=Math.min(1,Math.max(0,(Math.min(o,e+n)-e)/n));A>1-i&&(i=1),c.push({index:t,fraction:i,start:e,end:e+i*n,value:i*n})}const l=c[c.length-1];l&&r>l.fraction&&1>l.fraction&&c.pop();const d=c.reduce((t,e)=>t+e.value,0);return{units:c,unit:n,total:o,shown:d,overflow:u}}function I(t,e,n){const o=N(t,n),i=Math.max(z(e),o.total);if(o.total>=i)return{...o,rangeUnits:[],rangeTotal:o.total};const r=N(i,{unit:n.unit,maxUnits:n.maxUnits}),a=r.unit>0?o.total/r.unit:0,s=Math.floor(a+A);let u=Math.min(1,Math.max(0,a-s));A>u&&(u=0);const c=[];for(const t of r.units)s>t.index||(t.index===s&&u>0?t.fraction-u>A&&c.push({...t,startFraction:u,start:t.index*r.unit+u*r.unit,value:(t.fraction-u)*r.unit}):c.push({...t,startFraction:0}));return{...o,overflow:o.overflow||r.overflow,rangeUnits:c,rangeTotal:i}}function _(t){return t?t.map(Number).filter(Number.isFinite):[]}function O(t){if("fixed-denominator"===t.countStrategy)return 1/0;const e=t.maxTokens??1/0;return e>0?Math.floor(e):0}function U(t){const e=t.unitValue??t.unit,n=t.icon??t.token;return{...t,...null!=e&&{unitValue:e},...null!=n&&{icon:n}}}function V(t){if(t.samples)return _(t.samples);if(!t.data||!t.valueAccessor)return[];const e=t.valueAccessor;return t.data.map(t=>"function"==typeof e?e(t):Number(t[e])).filter(Number.isFinite)}function q(t,e,n,o={}){return{index:e,tokenType:t.tokenType,tokenSemantics:t.tokenSemantics,countStrategy:t.countStrategy,fraction:1,startFraction:0,value:n,start:e,end:e+n,unitValue:t.unitValue,unitMeaning:t.unitMeaning,...o}}function C(e,n){const o=U(n),i=function(t){return"number"==typeof t?{value:t}:Array.isArray(t)?{samples:_(t),data:t}:t}(e);let r,a,s,u,c,l,d,m=0,h=!1;if("unitized"===o.countStrategy){c=o.unitValue??1;const t={unit:c,maxUnits:o.maxTokens,minFraction:o.minFraction},e=null==i.rangeValue?N(T(i.value),t):I(T(i.value),T(i.rangeValue),t);r=e.units.map(t=>q(o,t.index,t.value,{fraction:t.fraction,start:t.start,end:t.end,unitValue:e.unit})),a=e.total,m=e.shown,h=e.overflow,null!=i.rangeValue&&(l=e.rangeTotal,d=e.rangeUnits.map(t=>q(o,t.index,t.value,{fraction:t.fraction,startFraction:t.startFraction,start:t.start,end:t.end,unitValue:e.unit,range:"scenario"})))}else if("fixed-denominator"===o.countStrategy){u=Math.floor(T(i.denominator??o.denominator)),s=T(i.numerator??o.numerator??i.value);const t=Math.min(u,Math.max(0,Math.round(s)));r=Array.from({length:u},(e,n)=>q(o,n,1,{highlighted:t>n,start:n,end:n+1})),a=u,m=r.length,h=!1}else if("quantile"===o.countStrategy){const t=V(i).sort((t,e)=>t-e),e=Math.max(0,Math.floor(o.tokenCount??50)),n=t.length>0?Math.min(e,O(o)):0;r=Array.from({length:n},(e,i)=>{const r=(i+.5)/n,a=function(t,e){const n=t.length;if(0===n)return 0;if(1===n)return t[0];const o=(n-1)*Math.min(1,Math.max(0,e)),i=Math.floor(o),r=o-i;return t[i]*(1-r)+t[Math.ceil(o)]*r}(t,r);return q(o,i,a,{sample:a,quantile:r,start:a,end:a})}),a=t.length,m=r.length,h=t.length>0&&e>r.length}else if("sample"===o.countStrategy||"posterior-sample"===o.countStrategy||"random-sample"===o.countStrategy){const e=V(i),n=Math.min(e.length,Math.max(0,Math.floor(o.tokenCount??e.length))),s=Math.min(n,O(o));r=("random-sample"===o.countStrategy?function(e,n=1){const o=Array.from({length:e},(t,e)=>e),i=t(Math.floor(n)||1);for(let t=o.length-1;t>0;t-=1){const e=Math.floor(i()*(t+1)),n=o[t];o[t]=o[e],o[e]=n}return o}(e.length,o.seed).slice(0,s):Array.from({length:s},(t,n)=>Math.floor(n/Math.max(1,s-1)*(e.length-1)))).map((t,n)=>{const i=e[t];return q(o,n,i,{sample:i,start:i,end:i})}),a=e.length,m=r.length,h=n>r.length}else{const t=i.data;if(t&&null==i.value)r=t.map((t,e)=>q(o,e,1,{datum:t})),a=t.length;else{const t=N(T(i.value),{unit:1,maxUnits:o.maxTokens,minFraction:o.minFraction});r=t.units.map(t=>q(o,t.index,t.value,{fraction:t.fraction,start:t.start,end:t.end,unitValue:1})),a=t.total,m=t.shown,h=t.overflow}if(t&&null==i.value){const t=function(t,e){const n=O(e);return t.length>n?{tokens:t.slice(0,n),overflow:!0}:{tokens:t,overflow:!1}}(r,o);r=t.tokens,m=r.length,h=t.overflow}}return{tokens:r,encoding:o,total:a,shown:m,overflow:h,numerator:s,denominator:u,unitValue:c,rangeTotal:l,rangeTokens:d,diagnostics:R(o,{visibleTokens:r.length+(d?.length??0)})}}function F(t,e={}){const n=Array.isArray(t)?t:t.tokens,o=n.length;if(0===o)return[];const i=e.flow??"row",r=e.cellWidth??16,a=e.cellHeight??r,s=e.gutter??2,u=e.anchor??[.5,.5],c=Math.max(1,Math.floor(e.columns??Math.ceil(e.rows?o/e.rows:Math.sqrt(o)))),l=Math.max(1,Math.floor(e.rows??Math.ceil(o/c))),d="row"===i?Math.max(l,Math.ceil(o/c)):l,m="column"===i?Math.max(c,Math.ceil(o/l)):c,h=e.x??0,f=e.y??0;return n.map((t,n)=>{let o,g;return"column"===i?(g=Math.floor(n/l),o=n%l):(o=Math.floor(n/c),g=n%c),"left"===e.columnDirection&&(g=m-1-g),"up"===e.rowDirection&&(o=d-1-o),{...t,row:o,column:g,x:h+g*(r+s)+u[0]*r,y:f+o*(a+s)+u[1]*a}})}function R(t,e={}){const n=[],o=t.tokenSemantics,i=t.countStrategy,r=e.maxRecommendedTokens??("fixed-denominator"!==i||T(t.denominator)>100?80:100);return o||n.push({code:"TOKEN_SEMANTICS_UNCLEAR",severity:"warning",message:"Every tokenized encoding should state what one token represents."}),i||n.push({code:"MISSING_COUNT_STRATEGY",severity:"warning",message:"Every tokenized encoding should state how token counts are produced."}),"icon"!==t.tokenType&&"glyph"!==t.tokenType||"icon-only"!==t.labelPolicy&&"token-only"!==t.labelPolicy||n.push({code:"ICON_ONLY_LABELS",severity:"warning",message:"Icons should supplement text labels, not replace them."}),null!=e.visibleTokens&&e.visibleTokens>r&&n.push({code:"TOO_MANY_VISIBLE_TOKENS",severity:"warning",message:`This encoding renders ${e.visibleTokens} visible tokens. Consider unitizing, sampling, or a hybrid bar/token view.`}),"decorative"!==o||"icon"!==t.tokenType&&"glyph"!==t.tokenType||n.push({code:"DECORATIVE_PICTOGRAPHS",severity:"warning",message:"Decorative pictographs can harm recall and speed when they do not clarify the data."}),"unitized-measure"===o&&i&&"unitized"!==i&&n.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Unitized measures should use the unitized count strategy so each token has a stable value."}),"risk-case"===o&&i&&"fixed-denominator"!==i&&n.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Risk cases are usually clearest as a fixed-denominator natural frequency."}),"possible-outcome"!==o&&"posterior-sample"!==o&&"hypothetical-case"!==o||!i||"quantile"===i||"sample"===i||"posterior-sample"===i||"random-sample"===i||n.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Outcome/sample tokens should come from quantiles or samples, not from a unitized magnitude."}),"unitized-measure"===o&&"unitized"===i&&null==t.unitValue&&null==t.unit&&n.push({code:"MISSING_UNIT_VALUE",severity:"warning",message:"Unitized measures should set unitValue so each token has a declared value."}),"unitized-measure"!==o||"unitized"!==i||t.unitMeaning||n.push({code:"MISSING_UNIT_MEANING",severity:"info",message:"Add unitMeaning so readers know what one full token represents."}),n}function P(t){return"measure"===t?"precise-comparison":"estimate probability"===t?"probability-estimation":"understand risk"===t?"risk-communication":"remember"===t?"memory":"decide"===t?"support-decision":t}function G(t){const e=P(t);return"precise-comparison"===e?["compare-categories","rank"]:"probability-estimation"===e?["distribution"]:"risk-communication"===e?["part-to-whole","distribution"]:"frequency-reasoning"===e?["distribution","compare-categories"]:"memory"===e||"editorial-engagement"===e?["compare-categories"]:"public-explanation"===e||"support-decision"===e?["distribution","compare-categories"]:["compare-categories"]}function L(t){const e=P(t.taskIntent),n="small"===(o=t.availableSpace)?25:"large"===o?100:50;var o;if("precise-comparison"===e)return{recommendedEncoding:"bar-or-line",rationale:"Use continuous position/length encodings when precise magnitude comparison is the primary task.",warnings:[],alternatives:["hybrid-bar-token","unitized-measure"]};if("probability-estimation"===e){const t={tokenType:"dot",tokenSemantics:"possible-outcome",countStrategy:"quantile",tokenCount:n,layout:"dotplot",labelPolicy:"text-plus-token"};return{recommendedEncoding:"quantile-dotplot",tokenEncoding:t,rationale:"This task asks readers to estimate probability from a distribution. Quantile tokens turn probability mass into countable possible outcomes.",warnings:R(t),alternatives:["cdf-with-threshold","density-with-threshold"]}}if("risk-communication"===e){const e={tokenType:t.concreteEntity?"icon":"dot",icon:t.concreteEntity,tokenSemantics:"risk-case",countStrategy:"fixed-denominator",denominator:100,layout:"waffle",labelPolicy:"text-plus-token"};return{recommendedEncoding:"fixed-denominator-icon-array",tokenEncoding:e,rationale:"Risk is often clearer as natural frequency: highlighted cases out of a fixed denominator.",warnings:R(e,{visibleTokens:100,maxRecommendedTokens:100}),alternatives:["labeled-percent","bar-with-risk-threshold"]}}if("memory"===e||"editorial-engagement"===e){const e={tokenType:t.concreteEntity?"glyph":"icon",icon:t.concreteEntity,tokenSemantics:"unitized-measure",countStrategy:"unitized",unitValue:1,layout:"grid",labelPolicy:"text-plus-token",unitMeaning:t.concreteEntity?"one token represents a unit of "+t.concreteEntity:"one token represents one unit"};return{recommendedEncoding:"semantic-isotype",tokenEncoding:e,rationale:"Semantic tokens are useful when the chart needs to make a topic concrete and memorable.",warnings:R(e),alternatives:["labeled-bar","hybrid-bar-token"]}}if("frequency-reasoning"===e||"public-explanation"===e||"support-decision"===e){const e={tokenType:t.concreteEntity?"icon":"dot",icon:t.concreteEntity,tokenSemantics:"distribution"===t.dataType?"possible-outcome":"unitized-measure",countStrategy:"distribution"===t.dataType?"quantile":"unitized",unitValue:"distribution"===t.dataType?void 0:1,tokenCount:n,layout:"distribution"===t.dataType?"dotplot":"bar-segment",labelPolicy:"text-plus-token",unitMeaning:"distribution"===t.dataType?void 0:"one token represents one unit interval"};return{recommendedEncoding:"hybrid-continuous-token",tokenEncoding:e,rationale:"A hybrid view preserves measurement while adding countable tokens for explanation and decisions.",warnings:R(e),alternatives:["bar-or-line","quantile-dotplot","fixed-denominator-icon-array"]}}return{recommendedEncoding:"bar-or-line",rationale:"Use continuous encodings unless the task needs frequency, risk, memory, or outcome reasoning.",warnings:[],alternatives:["unitized-measure","quantile-dotplot","fixed-denominator-icon-array"]}}export{u as forceLayout,l as resolveAccessor,d as readField,m as unwrapDatum,h as groupBy,f as createSafeDatum,g as matchesHighlight,p as dimFor,y as signatureKey,k as LayoutCache,b as makeShade,M as shade,v as datumFromFields,x as stableGlyphId,w as clamp,T as nonNegativeFinite,S as mean,E as withAlpha,N as unitize,I as unitizeRange,U as normalizeTokenEncoding,C as generateTokens,F as layoutTokenGrid,R as diagnoseTokenEncoding,G as tokenTaskIntentToCapabilityIntents,L as suggestTokenEncoding};
@@ -0,0 +1 @@
1
+ import{useBrushAccessibility as r}from"./c-USFMFKIH.min.js";import{useRef as t,useEffect as e,useMemo as n}from"react";import{select as c}from"d3-selection";import{brush as i,brushX as l,brushY as u}from"d3-brush";import{jsx as o,jsxs as s}from"react/jsx-runtime";function a(r,t,e,n){const[c,i]=[Math.min(...t),Math.max(...t)],l=(i-c)/20;let[u,o]=r;if(n)0>e?u=Math.max(c,u-l):o=Math.min(i,o+l);else{const r=o-u;u=Math.max(c,Math.min(i-r,u+e*l)),o=u+r}return[u,o]}function f(r,t){let e=0,n=t.length-1;for(;n>e;){const c=e+n+1>>1;t[c]>r?n=c-1:e=c}return t[e]}function h(r,t){let e=0,n=t.length-1;for(;n>e;){const c=e+n>>1;r>t[c]?e=c+1:n=c}return t[e]}function x({width:x,height:d,totalWidth:m,totalHeight:y,margin:v,dimension:b,scales:g,onBrush:p,binSize:M,snap:w,binBoundaries:z,snapDuring:j,streaming:k}){const B=t(null),F=t(null),H=t(p);H.current=p;const I=t(g);I.current=g;const P=n(()=>z?[...z].sort((r,t)=>r-t):void 0,[z]),S=t(P);S.current=P;const U=t(!1),$=t(null),A=r({label:"xy"===b?"Two-dimensional data range brush":b.toUpperCase()+" data range brush",onAction:r=>{const t=I.current,e=F.current;if(!t||!e||!B.current)return;const n=c(B.current).select(".brush-g");if("clear"===r.type)return U.current=!0,n.call(e.move,null),U.current=!1,$.current=null,void H.current(null);const i=t.x.domain(),l=t.y.domain(),u=$.current;let o=u?.x??[i[0]+.4*(i[1]-i[0]),i[0]+.6*(i[1]-i[0])],s=u?.y??[l[0]+.4*(l[1]-l[0]),l[0]+.6*(l[1]-l[0])];const f="left"===r.direction||"right"===r.direction,h="left"===r.direction||"down"===r.direction?-1:1;if(f&&"y"!==b&&(o=a(o,i,h,r.resize)),f||"x"===b||(s=a(s,l,h,r.resize)),f&&"y"===b||!f&&"x"===b)return;const x={x:o,y:s};U.current=!0,n.call(e.move,"x"===b?[t.x(o[0]),t.x(o[1])]:"y"===b?[t.y(s[1]),t.y(s[0])]:[[t.x(o[0]),t.y(s[1])],[t.x(o[1]),t.y(s[0])]]),U.current=!1,$.current=x,H.current(x)}});return e(()=>{if(!B.current)return;const r=c(B.current).select(".brush-g"),t="x"===b?l():"y"===b?u():i();return t.extent([[0,0],[x,d]]),t.on("brush end",e=>{if(U.current)return;const n=I.current;if(!n)return;if(!e.selection)return $.current=null,void H.current(null);let c,i;if("x"===b){const[r,t]=e.selection;c=[n.x.invert(r),n.x.invert(t)],i=[n.y.invert(d),n.y.invert(0)]}else if("y"===b){const[r,t]=e.selection;c=[n.x.invert(0),n.x.invert(x)],i=[n.y.invert(t),n.y.invert(r)]}else{const[[r,t],[l,u]]=e.selection;c=[n.x.invert(r),n.x.invert(l)],i=[n.y.invert(u),n.y.invert(t)]}if("bin"===w&&"y"!==b&&("end"===e.type||"brush"===e.type&&j)){const i=S.current;i&&i.length>0?c=function(r,t){return 0===t.length?r:[f(r[0],t),h(r[1],t)]}(c,i):M&&M>0&&(c=[Math.floor(c[0]/M)*M,Math.ceil(c[1]/M)*M]);const l=n.x(c[0]),u=n.x(c[1]);if(U.current=!0,"x"===b)r.call(t.move,[l,u]);else if("xy"===b){const n=e.selection;r.call(t.move,[[l,n[0][1]],[u,n[1][1]]])}U.current=!1}const l={x:c,y:i};$.current=l,H.current(l)}),r.call(t),F.current=t,r.select(".selection").attr("fill","steelblue").attr("fill-opacity",.15).attr("stroke","steelblue").attr("stroke-width",1),()=>{t.on("brush end",null),F.current=null}},[x,d,b,w,M,j]),e(()=>{if(!(k&&g&&F.current&&$.current))return;if(!B.current)return;if("y"===b)return;const r=$.current,t=g.x.domain()[0],e=c(B.current).select(".brush-g");if(t>=r.x[1])return U.current=!0,e.call(F.current.move,null),U.current=!1,$.current=null,void H.current(null);let n=r.x[0],i=!1;if(t>r.x[0]){if(n=t,"bin"===w){const r=S.current;r&&r.length>0?n=h(t,r):M&&M>0&&(n=Math.ceil(t/M)*M)}if(n>=r.x[1])return U.current=!0,e.call(F.current.move,null),U.current=!1,$.current=null,void H.current(null);i=!0}const l=g.x(n),u=g.x(r.x[1]);if(U.current=!0,"x"===b)e.call(F.current.move,[l,u]);else{const t=g.y(r.y[1]),n=g.y(r.y[0]);e.call(F.current.move,[[l,t],[u,n]])}if(U.current=!1,i){const t={x:[n,r.x[1]],y:r.y};$.current=t,H.current(t)}},[g,k,b,w,M]),s("svg",{ref:B,width:m,height:y,...A.svgProps,style:{position:"absolute",top:0,left:0,pointerEvents:"all"},children:[o("title",{children:A.svgProps["aria-label"]}),o("desc",{id:A.descriptionId,children:A.description}),o("g",{className:"brush-g",transform:`translate(${v.left},${v.top})`})]})}export{x as XYBrushOverlay};