semiotic 3.8.5 → 3.8.7

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 (277) hide show
  1. package/CLAUDE.md +37 -10
  2. package/README.md +83 -56
  3. package/ai/behaviorContracts.cjs +88 -3
  4. package/ai/componentMetadata.cjs +5 -10
  5. package/ai/dist/mcp-server.js +99 -10
  6. package/ai/examples.md +198 -9
  7. package/ai/schema.json +2002 -165
  8. package/ai/surface-manifest.json +14 -10
  9. package/ai/system-prompt.md +9 -3
  10. package/dist/{chunk-chartContainerDataAudit-74TLKIP6.module.min.js → chunk-chartContainerDataAudit-JDSVSKGM.module.min.js} +1 -1
  11. package/dist/chunk-chunk-2JGJ5GUG.module.min.js +1 -0
  12. package/dist/chunk-chunk-2YAZHXL4.module.min.js +2 -0
  13. package/dist/chunk-chunk-3NGIKFD6.module.min.js +1 -0
  14. package/dist/{chunk-chunk-G7WFWHAD.module.min.js → chunk-chunk-4ITOQRXM.module.min.js} +1 -1
  15. package/dist/chunk-chunk-5SD6BHVW.module.min.js +2 -0
  16. package/dist/chunk-chunk-6V5VQVCT.module.min.js +2 -0
  17. package/dist/chunk-chunk-7TTBHSAG.module.min.js +2 -0
  18. package/dist/chunk-chunk-7ZDJSYKI.module.min.js +2 -0
  19. package/dist/chunk-chunk-BGHPD3RA.module.min.js +1 -0
  20. package/dist/chunk-chunk-BMRZ2SPU.module.min.js +2 -0
  21. package/dist/chunk-chunk-BNGBEY7N.module.min.js +2 -0
  22. package/dist/chunk-chunk-C7APLVQD.module.min.js +2 -0
  23. package/dist/chunk-chunk-DGWFBOGB.module.min.js +1 -0
  24. package/dist/chunk-chunk-DIVE2DRA.module.min.js +2 -0
  25. package/dist/chunk-chunk-FBUNUIPV.module.min.js +2 -0
  26. package/dist/chunk-chunk-FQPKOAIH.module.min.js +2 -0
  27. package/dist/chunk-chunk-FRO4TRXK.module.min.js +2 -0
  28. package/dist/chunk-chunk-G7QVPZUD.module.min.js +2 -0
  29. package/dist/chunk-chunk-GBPYV4FP.module.min.js +2 -0
  30. package/dist/chunk-chunk-GU2EJIDJ.module.min.js +2 -0
  31. package/dist/chunk-chunk-J5QD4RAM.module.min.js +2 -0
  32. package/dist/{chunk-chunk-LJLS6DY7.module.min.js → chunk-chunk-JWXLNZSM.module.min.js} +1 -1
  33. package/dist/chunk-chunk-KXAFCCDB.module.min.js +2 -0
  34. package/dist/chunk-chunk-LG7YKJAK.module.min.js +2 -0
  35. package/dist/{chunk-chunk-I36PJ4OC.module.min.js → chunk-chunk-LVHDZAT3.module.min.js} +1 -1
  36. package/dist/chunk-chunk-LWITSR2O.module.min.js +2 -0
  37. package/dist/chunk-chunk-MX35T6RX.module.min.js +2 -0
  38. package/dist/chunk-chunk-NH4MEAKP.module.min.js +2 -0
  39. package/dist/chunk-chunk-NJETWX42.module.min.js +2 -0
  40. package/dist/chunk-chunk-NW25WGLS.module.min.js +2 -0
  41. package/dist/{chunk-chunk-TMWIZL3K.module.min.js → chunk-chunk-OI7R7EJB.module.min.js} +1 -1
  42. package/dist/chunk-chunk-ONMLEXHR.module.min.js +2 -0
  43. package/dist/chunk-chunk-OY66GCE6.module.min.js +1 -0
  44. package/dist/chunk-chunk-PZFT457G.module.min.js +1 -0
  45. package/dist/chunk-chunk-Q3WW6JGR.module.min.js +1 -0
  46. package/dist/chunk-chunk-Q6XKQTOQ.module.min.js +1 -0
  47. package/dist/chunk-chunk-RJRM2E6P.module.min.js +1 -0
  48. package/dist/chunk-chunk-RPL7WYXI.module.min.js +1 -0
  49. package/dist/chunk-chunk-SV4XAZ3Q.module.min.js +1 -0
  50. package/dist/chunk-chunk-TSCFL235.module.min.js +1 -0
  51. package/dist/chunk-chunk-UOQRPGPK.module.min.js +2 -0
  52. package/dist/chunk-chunk-V3OAKG32.module.min.js +1 -0
  53. package/dist/chunk-chunk-WLOIUMWG.module.min.js +2 -0
  54. package/dist/chunk-chunk-XEGXX4F7.module.min.js +1 -0
  55. package/dist/chunk-chunk-XFRBLXYM.module.min.js +1 -0
  56. package/dist/chunk-chunk-Z2AJERX5.module.min.js +2 -0
  57. package/dist/chunk-chunk-ZXYDYAB7.module.min.js +2 -0
  58. package/dist/components/ai/SemioticVACPBridge.d.ts +22 -0
  59. package/dist/components/ai/chartCapabilities.d.ts +5 -3
  60. package/dist/components/ai/conversationArc.d.ts +2 -176
  61. package/dist/components/ai/conversationArcTypes.d.ts +202 -0
  62. package/dist/components/ai/readerGrounding.d.ts +12 -0
  63. package/dist/components/ai/vacpAdapter.d.ts +13 -0
  64. package/dist/components/ai/vacpAdapterActions.d.ts +2 -0
  65. package/dist/components/ai/vacpAdapterModel.d.ts +7 -0
  66. package/dist/components/ai/vacpAdapterRuntime.d.ts +26 -0
  67. package/dist/components/ai/vacpAdapterState.d.ts +3 -0
  68. package/dist/components/ai/vacpAdapterTypes.d.ts +169 -0
  69. package/dist/components/ai/vacpTypes.d.ts +160 -0
  70. package/dist/components/charts/custom/XYCustomChart.d.ts +3 -0
  71. package/dist/components/charts/geo/DistanceCartogram.d.ts +1 -1
  72. package/dist/components/charts/index.d.ts +7 -4
  73. package/dist/components/charts/ordinal/BarChart.d.ts +7 -14
  74. package/dist/components/charts/ordinal/GaugeChart.d.ts +3 -0
  75. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +3 -0
  76. package/dist/components/charts/ordinal/StackedBarChart.d.ts +3 -0
  77. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +4 -14
  78. package/dist/components/charts/physics/ChainReactionChart.capability.d.ts +9 -0
  79. package/dist/components/charts/physics/ChainReactionChart.d.ts +29 -0
  80. package/dist/components/charts/physics/CollisionSwarmChart.d.ts +1 -1
  81. package/dist/components/charts/physics/EventDropChart.d.ts +7 -2
  82. package/dist/components/charts/physics/GaltonBoardChart.d.ts +1 -1
  83. package/dist/components/charts/physics/{PhysicsPileChart.capability.d.ts → PacketFlowChart.capability.d.ts} +1 -1
  84. package/dist/components/charts/physics/{PhysicalFlowChart.d.ts → PacketFlowChart.d.ts} +22 -6
  85. package/dist/components/charts/physics/PhysicsCustomChart.d.ts +1 -1
  86. package/dist/components/charts/physics/ProcessFlowChart.d.ts +7 -4
  87. package/dist/components/charts/physics/{PhysicalFlowChart.capability.d.ts → UnitPileChart.capability.d.ts} +1 -1
  88. package/dist/components/charts/physics/{PhysicsPileChart.d.ts → UnitPileChart.d.ts} +19 -6
  89. package/dist/components/charts/physics/crucibleChartProps.d.ts +1 -1
  90. package/dist/components/charts/physics/crucibleChartUtils.d.ts +9 -0
  91. package/dist/components/charts/physics/gauntletChartProps.d.ts +6 -1
  92. package/dist/components/charts/physics/gauntletTerminal.d.ts +61 -0
  93. package/dist/components/charts/physics/packetFlowSemantics.d.ts +6 -0
  94. package/dist/components/charts/physics/physicsHocUtils.d.ts +45 -2
  95. package/dist/components/charts/shared/auditAccessibilityStyles.d.ts +9 -0
  96. package/dist/components/charts/shared/chartSpecCore.d.ts +2 -4
  97. package/dist/components/charts/shared/gaugeGradient.d.ts +4 -8
  98. package/dist/components/charts/shared/gradient.d.ts +35 -0
  99. package/dist/components/charts/shared/hatchFill.d.ts +3 -10
  100. package/dist/components/charts/shared/hooks.d.ts +2 -50
  101. package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
  102. package/dist/components/charts/shared/streamPropsHelpers.d.ts +1 -2
  103. package/dist/components/charts/shared/useChartLegend.d.ts +65 -0
  104. package/dist/components/charts/shared/useChartSetup.d.ts +12 -0
  105. package/dist/components/charts/shared/useCustomChartSetup.d.ts +6 -1
  106. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +1 -0
  107. package/dist/components/charts/shared/useStreamingLegend.d.ts +1 -1
  108. package/dist/components/charts/xy/AreaChart.d.ts +25 -42
  109. package/dist/components/charts/xy/BumpChart.capability.d.ts +11 -0
  110. package/dist/components/charts/xy/BumpChart.d.ts +161 -0
  111. package/dist/components/charts/xy/DifferenceChart.d.ts +3 -10
  112. package/dist/components/charts/xy/Heatmap.d.ts +3 -0
  113. package/dist/components/charts/xy/LineChart.d.ts +6 -8
  114. package/dist/components/data/portability/capabilityBinding.d.ts +41 -0
  115. package/dist/components/data/portability/index.d.ts +2 -0
  116. package/dist/components/geometry/bumpRibbonGeometry.d.ts +36 -0
  117. package/dist/components/legendLayout.d.ts +75 -1
  118. package/dist/components/recipes/geographicDotGrid.d.ts +82 -0
  119. package/dist/components/recipes/geographicGrid.d.ts +100 -0
  120. package/dist/components/recipes/physics.d.ts +2 -0
  121. package/dist/components/recipes/physicsStageGeography.d.ts +137 -0
  122. package/dist/components/semiotic-ai.d.ts +6 -4
  123. package/dist/components/semiotic-experimental-vacp.d.ts +11 -0
  124. package/dist/components/semiotic-experimental.d.ts +6 -3
  125. package/dist/components/semiotic-geo.d.ts +5 -0
  126. package/dist/components/semiotic-network.d.ts +1 -0
  127. package/dist/components/semiotic-ordinal.d.ts +2 -0
  128. package/dist/components/semiotic-physics.d.ts +10 -6
  129. package/dist/components/semiotic-realtime-core.d.ts +1 -0
  130. package/dist/components/semiotic-recipes-core.d.ts +6 -1
  131. package/dist/components/semiotic-server-edge.d.ts +1 -1
  132. package/dist/components/semiotic-server.d.ts +1 -1
  133. package/dist/components/semiotic-xy.d.ts +4 -0
  134. package/dist/components/semiotic.d.ts +4 -4
  135. package/dist/components/server/renderEvidence.d.ts +1 -1
  136. package/dist/components/server/renderToStaticSVG.d.ts +2 -1
  137. package/dist/components/server/serverChartConfigHeatmap.d.ts +6 -0
  138. package/dist/components/server/serverChartConfigNetworkStyles.d.ts +12 -0
  139. package/dist/components/server/serverChartConfigShared.d.ts +16 -0
  140. package/dist/components/server/serverChartConfigs.d.ts +3 -2
  141. package/dist/components/server/serverChartConfigsPhysics.d.ts +2 -2
  142. package/dist/components/server/serverChartConfigsXY.d.ts +1 -1
  143. package/dist/components/server/staticLegend.d.ts +10 -2
  144. package/dist/components/server/staticSVGChrome.d.ts +14 -6
  145. package/dist/components/server/staticValue.d.ts +8 -0
  146. package/dist/components/stream/GeoSVGOverlay.d.ts +4 -10
  147. package/dist/components/stream/NetworkSVGOverlay.d.ts +2 -6
  148. package/dist/components/stream/OrdinalSVGOverlay.d.ts +2 -6
  149. package/dist/components/stream/SVGOverlay.d.ts +2 -6
  150. package/dist/components/stream/StalenessBadge.d.ts +2 -6
  151. package/dist/components/stream/geoPipelineConfig.d.ts +10 -0
  152. package/dist/components/stream/geoTypes.d.ts +3 -6
  153. package/dist/components/stream/legendRenderer.d.ts +10 -6
  154. package/dist/components/stream/ordinalTypes.d.ts +7 -31
  155. package/dist/components/stream/physics/PhysicsEvidence.d.ts +37 -0
  156. package/dist/components/stream/physics/PhysicsKernel.d.ts +1 -0
  157. package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +9 -0
  158. package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +2 -6
  159. package/dist/components/stream/physics/PhysicsSettledScene.d.ts +5 -0
  160. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +2 -6
  161. package/dist/components/stream/physics/physicsFramePipelineConfig.d.ts +19 -0
  162. package/dist/components/stream/physics/physicsPipelineSettle.d.ts +52 -0
  163. package/dist/components/stream/physics/physicsRegionRuntime.d.ts +23 -0
  164. package/dist/components/stream/pipelineConfig.d.ts +7 -15
  165. package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +9 -69
  166. package/dist/components/stream/renderers/cornerRadii.d.ts +2 -9
  167. package/dist/components/stream/renderers/thresholdLineSegments.d.ts +12 -0
  168. package/dist/components/stream/sceneToSVGShared.d.ts +3 -5
  169. package/dist/components/stream/types.d.ts +34 -56
  170. package/dist/components/stream/xySceneBuilders/areaGradient.d.ts +4 -20
  171. package/dist/components/stream/xySceneBuilders/types.d.ts +6 -6
  172. package/dist/components/types/legendTypes.d.ts +31 -6
  173. package/dist/controls.min.js +1 -1
  174. package/dist/controls.module.min.js +1 -1
  175. package/dist/geo.min.js +1 -1
  176. package/dist/geo.module.min.js +1 -1
  177. package/dist/network.min.js +1 -1
  178. package/dist/network.module.min.js +1 -1
  179. package/dist/ordinal.min.js +1 -1
  180. package/dist/ordinal.module.min.js +1 -1
  181. package/dist/physics.min.js +1 -1
  182. package/dist/physics.module.min.js +1 -1
  183. package/dist/physicsWorker.js +1 -1
  184. package/dist/realtime.min.js +1 -1
  185. package/dist/realtime.module.min.js +1 -1
  186. package/dist/semiotic-ai-core.min.js +1 -1
  187. package/dist/semiotic-ai-core.module.min.js +1 -1
  188. package/dist/semiotic-ai.d.ts +6 -4
  189. package/dist/semiotic-ai.min.js +1 -1
  190. package/dist/semiotic-ai.module.min.js +1 -1
  191. package/dist/semiotic-data.module.min.js +1 -1
  192. package/dist/semiotic-experimental-vacp.d.ts +11 -0
  193. package/dist/semiotic-experimental-vacp.min.js +1 -0
  194. package/dist/semiotic-experimental-vacp.module.min.js +1 -0
  195. package/dist/semiotic-experimental.d.ts +6 -3
  196. package/dist/semiotic-experimental.min.js +2 -1
  197. package/dist/semiotic-experimental.module.min.js +2 -1
  198. package/dist/semiotic-geo.d.ts +5 -0
  199. package/dist/semiotic-network.d.ts +1 -0
  200. package/dist/semiotic-ordinal.d.ts +2 -0
  201. package/dist/semiotic-physics.d.ts +10 -6
  202. package/dist/semiotic-realtime-core.d.ts +1 -0
  203. package/dist/semiotic-realtime-core.min.js +1 -1
  204. package/dist/semiotic-realtime-core.module.min.js +1 -1
  205. package/dist/semiotic-recipes-core.d.ts +6 -1
  206. package/dist/semiotic-recipes-core.min.js +1 -1
  207. package/dist/semiotic-recipes-core.module.min.js +1 -1
  208. package/dist/semiotic-recipes.min.js +1 -1
  209. package/dist/semiotic-recipes.module.min.js +1 -1
  210. package/dist/semiotic-server-edge.d.ts +1 -1
  211. package/dist/semiotic-server-edge.min.js +1 -1
  212. package/dist/semiotic-server-edge.module.min.js +1 -1
  213. package/dist/semiotic-server-node.min.js +1 -1
  214. package/dist/semiotic-server-node.module.min.js +1 -1
  215. package/dist/semiotic-server.d.ts +1 -1
  216. package/dist/semiotic-utils-core.min.js +1 -1
  217. package/dist/semiotic-utils-core.module.min.js +1 -1
  218. package/dist/semiotic-utils.min.js +1 -1
  219. package/dist/semiotic-utils.module.min.js +1 -1
  220. package/dist/semiotic-xy.d.ts +4 -0
  221. package/dist/semiotic.d.ts +4 -4
  222. package/dist/semiotic.min.js +1 -1
  223. package/dist/semiotic.module.min.js +1 -1
  224. package/dist/server.min.js +1 -1
  225. package/dist/server.module.min.js +1 -1
  226. package/dist/xy.min.js +1 -1
  227. package/dist/xy.module.min.js +1 -1
  228. package/package.json +18 -2
  229. package/spec/README.md +94 -2
  230. package/spec/bindings/README.md +14 -3
  231. package/spec/v0.1/examples/annotation-provenance-reviewed-revision.json +27 -0
  232. package/spec/v0.1/examples/annotation-provenance-watcher-threshold.json +21 -0
  233. package/spec/v0.1/examples/audience-profile-executive-review.json +24 -0
  234. package/spec/v0.1/examples/audience-profile-incident-operators.json +42 -0
  235. package/spec/v0.1/examples/chart-capability-bar-comparison.json +48 -0
  236. package/spec/v0.1/examples/chart-capability-service-flow.json +54 -0
  237. package/dist/chunk-chunk-4AANPFOX.module.min.js +0 -2
  238. package/dist/chunk-chunk-5I3UZV4Q.module.min.js +0 -2
  239. package/dist/chunk-chunk-5RKXZQ2P.module.min.js +0 -1
  240. package/dist/chunk-chunk-74CCPVXB.module.min.js +0 -1
  241. package/dist/chunk-chunk-7ALTGHK6.module.min.js +0 -1
  242. package/dist/chunk-chunk-ANYDWOZF.module.min.js +0 -1
  243. package/dist/chunk-chunk-AVBI6GDT.module.min.js +0 -1
  244. package/dist/chunk-chunk-BANTPINB.module.min.js +0 -2
  245. package/dist/chunk-chunk-C4YA6TDR.module.min.js +0 -1
  246. package/dist/chunk-chunk-C57LR3YG.module.min.js +0 -1
  247. package/dist/chunk-chunk-CKMD5NV3.module.min.js +0 -2
  248. package/dist/chunk-chunk-CO5KQMGH.module.min.js +0 -1
  249. package/dist/chunk-chunk-CWQ5YIHX.module.min.js +0 -2
  250. package/dist/chunk-chunk-E6TXX6MI.module.min.js +0 -1
  251. package/dist/chunk-chunk-GMQ5AYTD.module.min.js +0 -1
  252. package/dist/chunk-chunk-JCG72SGW.module.min.js +0 -2
  253. package/dist/chunk-chunk-K3DMEW22.module.min.js +0 -1
  254. package/dist/chunk-chunk-KT2VAZMZ.module.min.js +0 -1
  255. package/dist/chunk-chunk-L6EA5V3G.module.min.js +0 -2
  256. package/dist/chunk-chunk-LJPCLYSC.module.min.js +0 -2
  257. package/dist/chunk-chunk-LRIFN2HK.module.min.js +0 -1
  258. package/dist/chunk-chunk-N5DDKCCF.module.min.js +0 -1
  259. package/dist/chunk-chunk-NEVE562N.module.min.js +0 -1
  260. package/dist/chunk-chunk-NLO44TOS.module.min.js +0 -2
  261. package/dist/chunk-chunk-PZJ2SBLL.module.min.js +0 -2
  262. package/dist/chunk-chunk-QSQVBIJA.module.min.js +0 -1
  263. package/dist/chunk-chunk-QUJ6TTLY.module.min.js +0 -1
  264. package/dist/chunk-chunk-RBIDBUT4.module.min.js +0 -2
  265. package/dist/chunk-chunk-RCF52Z42.module.min.js +0 -2
  266. package/dist/chunk-chunk-RFLAG356.module.min.js +0 -1
  267. package/dist/chunk-chunk-RPU4IZAV.module.min.js +0 -2
  268. package/dist/chunk-chunk-SKMBCFIL.module.min.js +0 -2
  269. package/dist/chunk-chunk-TAE7W424.module.min.js +0 -2
  270. package/dist/chunk-chunk-TUBMTZMU.module.min.js +0 -2
  271. package/dist/chunk-chunk-UFFEXJQY.module.min.js +0 -1
  272. package/dist/chunk-chunk-XSCHTS4D.module.min.js +0 -2
  273. package/dist/chunk-chunk-XXWSHGPL.module.min.js +0 -2
  274. package/dist/chunk-chunk-ZOAQDIJO.module.min.js +0 -1
  275. package/dist/chunk-chunk-ZXIXAPRE.module.min.js +0 -2
  276. package/dist/chunk-statisticalOverlays-QGDLRUHX.module.min.js +0 -1
  277. package/dist/chunk-statisticalOverlays-T77OKLDY.module.min.js +0 -1
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{buildRegressionAnnotation as e}from"./chunk-chunk-YCQYG6J5.module.min.js";import{mergeShapeStyle as t,useChartSetup as o,useCustomChartSetup as i,useFrameImperativeHandle as r}from"./chunk-chunk-FBUNUIPV.module.min.js";import{validateArrayData as n}from"./chunk-chunk-J5QD4RAM.module.min.js";import{DataSourceAdapter as s,IncrementalExtent as a,barCanvasRenderer as l,buildEnrichAnnotationData as c,buildRectNode as h,normalizeColorGradient as u,normalizeGradient as d,resolveAnnotationAccessor as m,resolveFrameGraphics as g,symbolCanvasRenderer as p,ticksForMode as f,toIdSet as y}from"./chunk-chunk-2YAZHXL4.module.min.js";import{RingBuffer as v,compactTimestampBufferForRemoval as b,computePulseIntensity as x,createTimestampBufferForData as w,ensureRingBufferCapacity as A,hasActivePulses as k,pointCanvasRenderer as S,pushWithTimestamp as _,refreshIdlePulse as C,setPulseState as P,useLegendCategoryEmission as R,useOrdinalKeyboardNavigation as M,useSemanticFrameInteractions as L}from"./chunk-chunk-ONMLEXHR.module.min.js";import{accessorsEquivalent as I,resolveAccessor as T,resolveStringAccessor as H}from"./chunk-chunk-NJETWX42.module.min.js";import{StalenessBadge as B,attachUpdateResultStore as F,buildBaseMetadataProps as O,buildCustomBehaviorProps as E,buildDatumIndexMap as N,buildOrdinalTooltip as D,buildTooltipProps as j,composeOverlays as W,computeDecayOpacity as z,createCustomLayoutFailureDiagnostic as G,findHitPointInQuadtree as V,getHitRadius as $,glyphCanvasRenderer as q,hitTestRect as X,normalizeAngle as Y,paintSceneWithBackend as Q,renderPathPulse as K,renderSceneWithBackend as Z,useConfigSync as J,useLayoutSelectionSync as U,useStableShallow as ee,useStalenessCheck as te,warnCustomLayoutDiagnostics as oe}from"./chunk-chunk-NH4MEAKP.module.min.js";import{wrapWithCustomLayoutSelection as ie}from"./chunk-chunk-5UKL5W76.module.min.js";import{filterAnnotationsByStatus as re}from"./chunk-chunk-BNGBEY7N.module.min.js";import{makeRuleValueResolver as ne,resolveStyleRules as se}from"./chunk-chunk-EMO5NUGE.module.min.js";import{buildResolveColor as ae,resolveCustomLayoutPalette as le}from"./chunk-chunk-JWXLNZSM.module.min.js";import{AccessibleDataTable as ce,AriaLiveTooltip as he,CanvasFrameBackground as ue,FlippingTooltip as de,FocusRing as me,STREAMING_PALETTE as ge,SYMBOL_SEQUENCE as pe,SceneRevisionDiagnosticsObserver as fe,ScreenReaderSummary as ye,SkipToTableLink as ve,TITLE_BASELINE as be,UpdateResultTracker as xe,annotationLayout as we,annularSectorPath as Ae,buildGaugeGradientGeometry as ke,buildHoverData as Se,coerceCanvasFill as _e,computeCanvasAriaLabel as Ce,computeEasing as Pe,computeRawProgress as Re,createColorScale as Me,createDefaultAnnotationRules as Le,createHatchPattern as Ie,createLegend as Te,defaultTooltipStyle as He,filterSparseArray as Be,getColor as Fe,getDevicePixelRatio as Oe,getSize as Ee,interpolateBrBG as Ne,interpolatePRGn as De,interpolatePiYG as je,interpolateRdBu as We,interpolateRdYlBu as ze,interpolateRdYlGn as Ge,interpolateSpectral as Ve,isAnnotationActivationTarget as $e,isHatchFill as qe,isServerEnvironment as Xe,lerp as Ye,normalizeLinkedBrush as Qe,normalizeTooltip as Ke,now as Ze,observationInputType as Je,ordinalSceneNodeToSVG as Ue,parseCanvasColor as et,renderAnnotationPass as tt,renderLegendFromConfig as ot,resolveCSSColor as it,resolveCanvasFill as rt,resolveDefaultFill as nt,resolveOrdinalAxisChrome as st,smartTooltipEntries as at,symbolRadius as lt,useAnnotationActivationOptions as ct,useBrushSelection as ht,useCategoryColors as ut,useChartMode as dt,useFrame as mt,useFrameCanvasHost as gt,useLinkedChartCategories as pt,useSceneRevisionDiagnostics as ft,useSortedData as yt,useThemeCategorical as vt,useThemeDiverging as bt,wrapStyleWithSelection as xt}from"./chunk-chunk-7ZDJSYKI.module.min.js";import{getMax as wt,getMinMax as At}from"./chunk-chunk-JJ2OOIET.module.min.js";import{resolveThemeSemanticColors as kt}from"./chunk-chunk-WCX6U47H.module.min.js";import{glyphHitGeometry as St}from"./chunk-chunk-KTWEBFMX.module.min.js";import{ChartError as _t,SafeRender as Ct,useHydration as Pt,useWasHydratingFromSSR as Rt,warnMissingField as Mt}from"./chunk-chunk-ACLDBMRH.module.min.js";import{useRef as Lt,useState as It,useEffect as Tt,useMemo as Ht,useCallback as Bt,useImperativeHandle as Ft,forwardRef as Ot,memo as Et}from"react";import{scaleBand as Nt,scaleLinear as Dt}from"d3-scale";var jt=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: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||ge,r=i[this.colorSchemeIndex%i.length];return this.colorSchemeIndex++,this.colorSchemeMap.set(t,r),r}};function Wt(e){const t=e.getSymbol;if(!t)return null;const o=e.config.symbolMap,i=new Map;let r=0;return e=>{const n=t(e)+"",s=o?.[n];if(s)return s;let a=i.get(n);return a||(a=pe[r%pe.length],r++,i.set(n,a)),a}}function zt(e,t,o,i,r,n,s){e.push(t?{type:"symbol",x:i,y:r,size:Math.PI*n*n,symbolType:t(o),style:s,datum:o}:{type:"point",x:i,y:r,r:n,style:s,datum:o})}function Gt(e,t){const{columns:o,config:i,resolvePieceStyle:r}=e,n=[],s=Math.min(t.width,t.height)/2-4,a="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,u=Object.values(o),d=u.some(e=>{const t=e.pieceData[0];return t&&("number"==typeof t._pct||"number"==typeof t._pctStart||null!=t._roundedEnds)}),m=h&&!d&&u.length>1&&(i.cornerRadius??0)>0;for(let e=0;u.length>e;e++){const t=u[e],o=t.pieceData[0],h="number"==typeof o?._pctStart?o._pctStart:t.pctStart,d=l+h*c,g=l+(h+("number"==typeof o?._pct?o._pct:t.pct))*c,p=r(t.pieceData[0],t.name),f=0===e,y=e===u.length-1,v={type:"wedge",cx:0,cy:0,innerRadius:a,outerRadius:s,startAngle:d,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),n.push(v)}return n}import{quantile as Vt}from"d3-array";function $t(e){const t=e.length,o=e[0],i=e[t-1];return{n:t,min:o,q1:Vt(e,.25)??o,median:Vt(e,.5)??(o+i)/2,q3:Vt(e,.75)??i,max:i,mean:e.reduce((e,t)=>e+t,0)/t}}import{scaleLinear as qt}from"d3-scale";var Xt={bar:function(e,t){const{scales:o,columns:i,config:r,getR:n,getStack:s,resolvePieceStyle:a}=e,{r:l,projection:c}=o,u=[],d="vertical"===c,m="horizontal"===c,g=r.normalize,p=[];if(s){const e=new Set;for(const t of Object.values(i))for(const o of t.pieceData){const t=s(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=s?s(o):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});const i=t.get(e);i.total+=n(o),i.pieces.push(o)}let o=0;if(g)for(const e of t.values())o+=Math.abs(e.total);let i=0,r=0;for(const n of p){const c=t.get(n);if(!c)continue;let p=c.total;g&&o>0&&(p/=o);const f=a(c.pieces[0],s?n:e.name),y={...c.pieces[0],__aggregateValue:c.total,__pieceCount:c.pieces.length,category:e.name};if(d){const t=l(0>p?r:i+p),o=0>p?l(r+p)-l(r):l(i)-l(i+p);u.push(h(e.x,t,e.width,Math.abs(o),f,y,n)),0>p?r+=p:i+=p}else if(m){const t=l(0>p?r+p:i),o=0>p?l(r)-l(r+p):l(i+p)-l(i);u.push(h(t,e.x,Math.abs(o),e.width,f,y,n)),0>p?r+=p:i+=p}}}const f="vertical"===c,y=r.roundedTop&&r.roundedTop>0?Math.max(0,r.roundedTop):0;for(const e of u){if("rect"!==e.type)continue;const t=e.datum?.__aggregateValue??0;e.roundedEdge=f?0>t?"bottom":"top":0>t?"left":"right",r.gradientFill&&(e.fillGradient=r.gradientFill)}if(y>0){const e=new Map;for(const t of u){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));e.length>0&&(e.reduce(f?(e,t)=>t.y>e.y?e:t:(e,t)=>e.x+e.w>t.x+t.w?e:t).roundedTop=y),o.length>0&&(o.reduce(f?(e,t)=>e.y+e.h>t.y+t.h?e:t:(e,t)=>t.x>e.x?e:t).roundedTop=y)}}return u},clusterbar:function(e,t){const{scales:o,columns:i,config:r,getR:n,getGroup:s,resolvePieceStyle:a}=e,{r:l,projection:c}=o,u=[],d="vertical"===c,m=[],g=new Set;for(const e of Object.values(i))for(const t of e.pieceData){const e=s?s(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,r=new Map;for(const t of e.pieceData){const e=s?s(t):"_default";r.has(e)||r.set(e,[]),r.get(e).push(t)}for(let s=0;m.length>s;s++){const c=r.get(m[s])||[];for(const r of c){const c=n(r),g=a(r,m[s]);if(d){const n=e.x+s*t+o/2,a=l(0),d=l(c);u.push(h(n,Math.min(a,d),i,Math.abs(a-d),g,r,m[s]))}else{const n=e.x+s*t+o/2,a=l(0),d=l(c);u.push(h(Math.min(a,d),n,Math.abs(d-a),i,g,r,m[s]))}}}}const f=r.roundedTop&&r.roundedTop>0?Math.max(0,r.roundedTop):0;for(const e of u){if("rect"!==e.type)continue;if(null==e.datum)continue;const t=n(e.datum);f>0&&(e.roundedTop=f),e.roundedEdge=d?0>t?"bottom":"top":0>t?"left":"right",r.gradientFill&&(e.fillGradient=r.gradientFill)}return u},point:function(e,t){const{scales:o,columns:i,getR:r,multiScales:n,resolvePieceStyle:s}=e,{r:a,projection:l}=o,c=[],h="vertical"===l,u="radial"===l,d=n.length>0,m=Wt(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??r(t),l=d&&n[o]||a,f=s(t,e.name),y=f.r||5;let v,b;if(u){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);zt(c,m,t,v,b,y,f)}return c},swarm:function(e,t){const{scales:o,columns:i,getR:r,resolvePieceStyle:n}=e,{r:s,projection:a}=o,l=[],c="vertical"===a,h=Wt(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],a=r(i),u=n(i,e.name),d=u.r||4,m=(7919*o%100/100-.5)*t*.8;zt(l,h,i,c?e.middle+m:s(a),c?s(a):e.middle+m,d,u)}}return l},pie:Gt,donut:Gt,boxplot:function(e,t){const{scales:o,columns:i,config:r,getR:n,resolveSummaryStyle:s}=e,{r:a,projection:l}=o,c=[],h="vertical"===l,u=!1!==r.showOutliers;for(const t of Object.values(i)){const o=t.pieceData.map(e=>n(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(0===o.length)continue;const i=o[0],r=o[o.length-1],l=Vt(o,.25)??i,d=Vt(o,.5)??(i+r)/2,m=Vt(o,.75)??r,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)??r,b=s(t.pieceData[0],t.name),x=[];if(u)for(const e of t.pieceData){const o=n(e);if(p>o||o>f){const i=h?t.middle:a(o),r=h?a(o):t.middle;x.push({px:i,py:r,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:a(y),q1Pos:a(l),medianPos:a(d),q3Pos:a(m),maxPos:a(v),stats:{n:o.length,min:y,q1:l,median:d,q3:m,max:v,mean:o.reduce((e,t)=>e+t,0)/o.length},style:b,datum:t.pieceData,category:t.name,outliers:x}),u)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},datum:t.datum})}return c},violin:function(e,t){const{scales:o,columns:i,config:r,getR:n,resolveSummaryStyle:s}=e,{r:a,projection:l}=o,c=[],h="vertical"===l,u=r.bins||20,d=!1!==r.showIQR;for(const e of Object.values(i)){const t=e.pieceData.map(e=>n(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],r=(i-o)/u||1,l=Array(u).fill(0);for(const e of t)l[Math.min(Math.floor((e-o)/r),u-1)]++;const m=wt(l,1),g=e.width/2*.9;let p;if(h){p=`M ${e.middle} ${a(o)}`;for(let t=0;u>t;t++){const i=a(o+(t+.5)*r);p+=` L ${e.middle+l[t]/m*g} ${i}`}p+=` L ${e.middle} ${a(i)}`;for(let t=u-1;t>=0;t--){const i=a(o+(t+.5)*r);p+=` L ${e.middle-l[t]/m*g} ${i}`}p+=" Z"}else{p=`M ${a(o)} ${e.middle}`;for(let t=0;u>t;t++)p+=` L ${a(o+(t+.5)*r)} ${e.middle-l[t]/m*g}`;p+=` L ${a(i)} ${e.middle}`;for(let t=u-1;t>=0;t--)p+=` L ${a(o+(t+.5)*r)} ${e.middle+l[t]/m*g}`;p+=" Z"}const f=s(e.pieceData[0],e.name);let y;if(d&&t.length>=4){const r=Vt(t,.25)??o,n=Vt(t,.5)??(o+i)/2,s=Vt(t,.75)??i;y={q1Pos:a(r),medianPos:a(n),q3Pos:a(s),centerPos:e.middle,isVertical:h}}const v=h?{x:e.x,y:Math.min(a(i),a(o)),width:e.width,height:Math.abs(a(i)-a(o))}:{x:Math.min(a(o),a(i)),y:e.x,width:Math.abs(a(i)-a(o)),height:e.width};c.push({type:"violin",pathString:p,translateX:0,translateY:0,bounds:v,iqrLine:y,stats:$t(t),style:f,datum:e.pieceData,category:e.name})}return c},histogram:function(e,t){const{scales:o,columns:i,config:r,getR:n,resolveSummaryStyle:s}=e,{r:a}=o,l=[],c=r.bins||25,u=r.normalize,d=a.domain?.(),m=d?+d[0]:void 0,g=d?+d[1]:void 0;for(const e of Object.values(i)){const t=e.pieceData.map(e=>n(e)).filter(e=>null!=e&&!isNaN(e));if(0===t.length)continue;const[o,i]=At(t),r=null!=m&&isFinite(m)?m:o,d=null!=g&&isFinite(g)?g:i,p=(d-r)/c||1,f=Array(c).fill(0);for(const e of t)r>e||e>d||f[Math.min(Math.floor((e-r)/p),c-1)]++;const y=t.length,v=wt(f,1),b=s(e.pieceData[0],e.name);for(let t=0;c>t;t++){if(0===f[t])continue;const o=(u?f[t]/y:f[t]/v)*e.width*.9,i=a(r+t*p),n=a(r+(t+1)*p);l.push(h(Math.min(i,n),e.x+e.width-o,Math.abs(n-i),o,b,{bin:t,count:f[t],range:[r+t*p,r+(t+1)*p],category:e.name},e.name))}}return l},ridgeline:function(e,t){const{scales:o,columns:i,config:r,getR:n,resolveSummaryStyle:s}=e,{r:a,projection:l}=o,c=[],h=r.bins||20,u="horizontal"===l,d=r.amplitude||1.5;for(const e of Object.values(i)){const t=e.pieceData.map(e=>n(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],r=(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)/r),h-1)]++;const m=wt(l,1),g=s(e.pieceData[0],e.name),p=e.width*d;let f;if(u){const t=e.x+e.width;f=`M ${a(o)} ${t}`;for(let e=0;h>e;e++)f+=` L ${a(o+(e+.5)*r)} ${t-l[e]/m*p}`;f+=` L ${a(i)} ${t} Z`}else{const t=e.x;f=`M ${t} ${a(o)}`;for(let e=0;h>e;e++){const i=a(o+(e+.5)*r);f+=` L ${t+l[e]/m*p} ${i}`}f+=` L ${t} ${a(i)} Z`}const y=u?{x:Math.min(a(o),a(i)),y:e.x,width:Math.abs(a(i)-a(o)),height:e.width}:{x:e.x,y:Math.min(a(i),a(o)),width:e.width,height:Math.abs(a(i)-a(o))};c.push({type:"violin",pathString:f,translateX:0,translateY:0,bounds:y,stats:$t(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:r,resolvePieceStyle:n}=e,{r:s,projection:a}=o,l=[],c="horizontal"===a;for(const e of Object.values(i))for(const t of e.pieceData){const o=r(t);if(!o)continue;const[i,a]=o,u=n(t,e.name);if(c){const o=s(Math.min(i,a)),r=s(Math.max(i,a));l.push(h(o,e.x,r-o,e.width,u,t,e.name))}else{const o=s(Math.max(i,a)),r=s(Math.min(i,a));l.push(h(e.x,o,e.width,r-o,u,t,e.name))}}return l},funnel:function(e,t){const{columns:o,getR:i,getStack:r,resolvePieceStyle:n}=e,s=[],a=t.width/2,l=!1!==e.config.showLabels,c=e.scales.o.domain().map(e=>o[e]).filter(Boolean);if(0===c.length)return s;const u=[],d=new Set;for(const e of c)for(const t of e.pieceData){const e=r?r(t):"_default";d.has(e)||(d.add(e),u.push(e))}const m=u.length>1&&"_default"!==u[0],g=[];let p=0;for(const e of c){const t=new Map;let o=0;for(const n of e.pieceData){const e=r?r(n):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});const s=t.get(e),a=i(n);s.total+=a,s.pieces.push(n),o+=a}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;u.length>i;i++){const r=e.groups.get(u[i]);r&&(i%2==0?t+=r.total:o+=r.total)}const i=Math.max(t,o);i>p&&(p=i)}if(0===p)return s;const f=new Map;for(const e of u){const t=g[0].groups.get(e);f.set(e,t?.total??0)}const y=g[0].stepTotal,v=m?.95*a:.9*t.width,b=qt().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,r=0===t,c=i.width,d=.55*c,p=i.x+(c-d)/2,v=new Map;if(m){let e=0;for(const t of u){const i=o.groups.get(t);i&&(e+=b(i.total))}let t=a,c=a;for(let m=0;u.length>m;m++){const g=u[m],y=o.groups.get(g);if(!y)continue;const x=b(y.total),w=m%2==0,A=w?t:c-x;w?t+=x:c-=x;const k=n(y.pieces[0],g),S=f.get(g)??y.total,_={...y.pieces[0],__funnelValue:y.total,__funnelPercent:S>0?y.total/S*100:0,__funnelStep:i.name,__funnelIsFirstStep:r,__aggregateValue:y.total,__pieceCount:y.pieces.length,category:g};l&&(0===m&&(_.__funnelStepLabel=i.name,_.__funnelStepLabelX=a,_.__funnelStepLabelY=p,_.__funnelRowWidth=e),_.__funnelValueLabelX=A+x/2,_.__funnelValueLabelY=p,_.__funnelBarW=x),s.push(h(A,p,x,d,k,_,g)),v.set(g,{x:A,y:p,w:x,h:d})}}else{const e=o.stepTotal,t=b(e),c=a-t/2,m=u[0],g="_default"!==m,f=o.groups.get(m)?.pieces[0]??i.pieceData[0],x=g?m:i.name,w=n(f,x),A=y>0?e/y*100:0,k={...f,__funnelValue:e,__funnelPercent:A,__funnelStep:i.name,__funnelIsFirstStep:r,category:g?m:i.name};l&&(k.__funnelStepLabel=i.name,k.__funnelStepLabelX=a,k.__funnelStepLabelY=p,k.__funnelRowWidth=t,k.__funnelValueLabelX=a,k.__funnelValueLabelY=p,k.__funnelBarW=t),s.push(h(c,p,t,d,w,k,x)),v.set(m,{x:c,y:p,w:t,h:d})}if(t>0&&w.size>0){const t=m?u:[u[0]];for(const r of t){const t=w.get(r),a=v.get(r);if(!t||!a)continue;const l=(()=>{const e=o.groups.get(r);return n(e?e.pieces[0]:i.pieceData[0],"_default"===r?i.name:r)})(),c={type:"trapezoid",points:[[t.x,t.y+t.h],[t.x+t.w,t.y+t.h],[a.x+a.w,a.y],[a.x,a.y]],style:{fill:l.fill||e.config.themeSemantic?.secondary||"#999",opacity:x},datum:o.groups.get(r)?.pieces[0]??i.pieceData[0],category:"_default"===r?i.name:r};s.push(c)}}w=v}return s},"bar-funnel":function(e,t){const{columns:o,getR:i,getStack:r,resolvePieceStyle:n,scales:s}=e,a=[],l=s.o.domain().map(e=>o[e]).filter(Boolean);if(0===l.length)return a;const c=[],u=new Set;for(const e of l)for(const t of e.pieceData){const e=r?r(t):"_default";u.has(e)||(u.add(e),c.push(e))}const d=c.length>1&&"_default"!==c[0],m=[];for(const e of l){const t=new Map;let o=0;for(const n of e.pieceData){const e=r?r(n):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});const s=t.get(e),a=i(n);s.total+=a,s.pieces.push(n),o+=a}m.push({col:e,groups:t,stepTotal:o})}const g=new Map;for(const e of c){const t=m[0]?.groups.get(e);g.set(e,t?.total??0)}const p=s.r,f=d?c.length:1,y=d?.15:0;for(let e=0;m.length>e;e++){const t=m[e],o=t.col,i=0===e,r=e>0?m[e-1]:null,s=o.width/f,l=s*y,u=s-l;for(let e=0;c.length>e;e++){const m=c[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=r?.groups.get(m),w=i?0:Math.max(0,(x?.total??y)-y),A=o.x+e*s+l/2,k=p(y),S=p(0)-k,_=n(f.pieces[0],d?m:o.name),C={...f.pieces[0],__barFunnelValue:y,__barFunnelPercent:b,__barFunnelIsFirstStep:i,__barFunnelIsDropoff:!1,__barFunnelStep:o.name,__barFunnelDropoffValue:w,__barFunnelCategory:"_default"===m?void 0:m,category:d?m:o.name,__barFunnelLabelX:A+u/2,__barFunnelLabelY:p(y+w)};if(a.push(h(A,k,u,S,_,C,d?m:o.name)),w>0){const e=p(y+w),t=k-e,i={..._},r={...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:d?m:o.name};a.push(h(A,e,u,t,i,r,d?m:o.name))}}}return a},swimlane:function(e,t){const{scales:o,columns:i,getR:r,getStack:n,resolvePieceStyle:s}=e,{r:a,projection:l}=o,c=[],u="horizontal"===l,d=e.config.gradientFill,m=u?"left":"bottom",g=e.config.trackFill;if(g){const e="string"==typeof g?g:g.color,t="string"==typeof g?1:g.opacity??1,[o,r]=a.range(),n=Math.min(o,r),s=Math.abs(r-o);for(const o of Object.values(i)){const i={fill:e,opacity:t},r=u?h(n,o.x,s,o.width,i,null,"__track__"):h(o.x,n,o.width,s,i,null,"__track__");c.push(r)}}const p=e.config.roundedTop&&e.config.roundedTop>0?Math.max(0,e.config.roundedTop):0;for(const e of Object.values(i)){let t=0;const o=c.length;for(const o of e.pieceData){const i=Math.abs(r(o));if(0===i)continue;const l=n?n(o):e.name,g=s(o,l);let p;if(u){const r=a(t),n=a(t+i);p=h(r,e.x,n-r,e.width,g,o,l)}else{const r=a(t+i),n=a(t);p=h(e.x,r,e.width,n-r,g,o,l)}d&&(p.fillGradient=d,p.roundedEdge=m),c.push(p),t+=i}if(p>0&&c.length>o){const e=c.slice(o),t=e[0],i=e[e.length-1];1===e.length?t.cornerRadii={tl:p,tr:p,br:p,bl:p}:u?(t.cornerRadii={tl:p,bl:p},i.cornerRadii={tr:p,br:p}):(t.cornerRadii={bl:p,br:p},i.cornerRadii={tl:p,tr:p})}}return c}},Yt=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Qt=["scene-style","data-paint","accessibility","evidence"],Kt=(e,t)=>({retainedData:e,invalidations:t}),Zt=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Jt=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ut=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],eo=["scene-geometry","data-paint","accessibility","evidence"],to=["scene-style","data-paint","accessibility","evidence"],oo=[],io={chartType:Kt("rebuild",Zt),runtimeMode:Kt("rebuild",Zt),categoryAccessor:Kt("rebuild",Zt),valueAccessor:Kt("rebuild",Zt),oAccessor:Kt("rebuild",Zt),rAccessor:Kt("rebuild",Zt),stackBy:Kt("rebuild",Zt),groupBy:Kt("rebuild",Zt),timeAccessor:Kt("rebuild",Zt),accessorRevision:Kt("rebuild",Zt),colorAccessor:Kt("rebuild",to),symbolAccessor:Kt("rebuild",eo),connectorAccessor:Kt("rebuild",eo),dataIdAccessor:Kt("rebuild",eo),projection:Kt("preserve",Jt),extentPadding:Kt("preserve",Jt),axisExtent:Kt("preserve",Jt),rExtent:Kt("preserve",Jt),oExtent:Kt("preserve",Jt),multiAxis:Kt("preserve",Jt),normalize:Kt("preserve",Jt),bins:Kt("preserve",Jt),oSort:Kt("preserve",Ut),barPadding:Kt("preserve",Ut),roundedTop:Kt("preserve",Ut),baselinePadding:Kt("preserve",Ut),innerRadius:Kt("preserve",Ut),cornerRadius:Kt("preserve",Ut),startAngle:Kt("preserve",Ut),sweepAngle:Kt("preserve",Ut),trackFill:Kt("preserve",Ut),showOutliers:Kt("preserve",Ut),showIQR:Kt("preserve",Ut),amplitude:Kt("preserve",Ut),connectorOpacity:Kt("preserve",Ut),showLabels:Kt("preserve",Ut),dynamicColumnWidth:Kt("rebuild",Ut),customLayout:Kt("preserve",Ut),layoutConfig:Kt("preserve",Ut),layoutMargin:Kt("preserve",Ut),symbolMap:Kt("preserve",eo),pieceStyle:Kt("preserve",to),summaryStyle:Kt("preserve",to),connectorStyle:Kt("preserve",to),gradientFill:Kt("preserve",to),colorScheme:Kt("preserve",to),themeCategorical:Kt("preserve",to),themeSemantic:Kt("preserve",to),themeSequential:Kt("preserve",to),themeDiverging:Kt("preserve",to),barColors:Kt("preserve",to),decay:Kt("preserve",to),pulse:Kt("preserve",to),staleness:Kt("preserve",to),layoutSelection:Kt("preserve",to),windowSize:Kt("preserve",oo),windowMode:Kt("preserve",oo),clock:Kt("preserve",oo),transition:Kt("preserve",oo),introAnimation:Kt("preserve",oo),onLayoutError:Kt("preserve",oo)},ro=Kt("preserve",Ut),no=class{constructor(){this.tracker=new xe}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}},Yt)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},Qt):this.recordNoop("restyle")}recordConfig(e){const t=function(e){let t="preserve";const o=new Set;for(const i of e){const e=io[i]??ro;"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 so}from"d3-quadtree";var ao=class{constructor(e){this.rExtent=new a,this.rExtents=[],this.windowSizeWarned=!1,this.updateResults=new no,this.rAccessors=[],this.categories=new Set,this._hasStreamingData=!1,this.styleResolver=new jt,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 v(e.windowSize),this.getO=H(e.categoryAccessor||e.oAccessor,"category");const t=e.valueAccessor||e.rAccessor;Array.isArray(t)?(this.rAccessors=t.map(e=>T(e,"value")),this.getR=this.rAccessors[0],this.rExtents=t.map(()=>new a)):(this.getR=T(t,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent]),this.getStack=H(e.stackBy),this.getGroup=H(e.groupBy),this.getColor=H(e.colorAccessor),this.getSymbol=H(e.symbolAccessor),this.getConnector=H(e.connectorAccessor),this.getDataId=H(e.dataIdAccessor),e.pulse&&(this.timestampBuffer=new v(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:w(t,i):null)}currentTime(){return this.config.clock?.()??Ze()}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(),A(this.buffer,e.totalSize||e.inserts.length,this.timestampBuffer);for(const o of e.inserts)_(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=_(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,r=this.multiScales,n=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 s=this.getBufferArray(),a=t.projection||"vertical",l=t.oExtent||this.resolveCategories(s),c=this.computeValueDomain(s,l),h="horizontal"===a,u="radial"===a,d=Math.min(.9,Math.max(0,null!=t.barPadding?t.barPadding/("vertical"===a?e.width:e.height):.1));let m,g;if(u){m=Nt().domain(l).range([0,1]).padding(0);const o=Math.min(e.width,e.height)/2,i=t.innerRadius||0;g=Dt().domain(c).range([i,o])}else h?(m=Nt().domain(l).range([0,e.height]).padding(d),g=Dt().domain(c).range([0,e.width])):(m=Nt().domain(l).range([0,e.width]).padding(d),g=Dt().domain(c).range([e.height,0]));this.scales={o:m,r:g,projection:a},this.multiScales=this.rAccessors.length>1&&t.multiAxis?this.rAccessors.map((i,r)=>{const n=this.rExtents[r];n.dirty&&n.recalculate(o,i);let[s,a]=n.extent;s===1/0&&(s=0,a=1);const l=a-s,c=l>0?l*(t.extentPadding??.05):1;return s-=c,a+=c,s>0&&(s=0),h?Dt().domain([s,a]).range([0,e.width]):Dt().domain([s,a]).range([e.height,0])}):[];let p=s;this.rAccessors.length>1&&(p=s.flatMap(e=>this.rAccessors.map((t,o)=>({...e,__rIndex:o,__rValue:t(e),__rName:this.resolveRAccessorName(o)})))),this.columns=this.buildColumns(p,l,m,a,e),this._customLayoutFailedThisBuild=!1;const f=this.buildSceneNodes(p,e);this._customLayoutFailedThisBuild?!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.scales=i,this.multiScales=r,this.columns=n):(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,s),this.config.pulse&&this.applyPulse(this.scene,s),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 r=null;if(o){r=new Set;for(const t of e)r.add(this.getO(t))}const n=r?Array.from(this.categories).filter(e=>r.has(e)):Array.from(this.categories);if(o&&void 0===i){const e=Math.max(50,3*r.size);if(this.categories.size>e){let t=this.categories.size-e;for(const e of this.categories){if(0>=t)break;r.has(e)||(this.categories.delete(e),t--)}}return n}if(!1===i)return n;if("function"==typeof i)return n.sort(i);const s=new Map;for(const t of e){const e=this.getO(t);s.set(e,(s.get(e)||0)+Math.abs(this.getR(t)))}return n.sort("asc"===i?(e,t)=>(s.get(e)||0)-(s.get(t)||0):(e,t)=>(s.get(t)||0)-(s.get(e)||0))}computeValueDomain(e,t){return function(e){const{data:t,chartType:o,projection:i,normalize:r,rExtent:n,extentPadding:s=.05,baselinePadding:a,axisExtent:l,getO:c,getR:h,getStack:u,rawRExtent:d}=e,m=s;if("radial"===i&&("pie"===o||"donut"===o))return[0,1];let g=0,p=0;if("bar"===o&&u&&r)g=0,p=1;else if("bar"===o&&u){const e=new Map,o=new Map;for(const i of t){const t=c(i),r=h(i);0>r?o.set(t,(o.get(t)||0)+r):e.set(t,(e.get(t)||0)+r)}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=d[0],t=d[1];e!==1/0&&(g=e),t!==-1/0&&(p=t)}n&&(null!=n[0]&&(g=n[0]),null!=n[1]&&(p=n[1]));const f="bar"===o||"clusterbar"===o||"bar-funnel"===o||"swimlane"===o;if(f&&null==n?.[0]&&null==n?.[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&&!a&&0===g,r=f&&!a&&0===p||"swimlane"===o;null!=n?.[0]||i||(g-=t),null!=n?.[1]||r||(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,r){return function(e){const{data:t,oExtent:o,oScale:i,projection:r,layout:n,dynamicColumnWidth:s,getO:a,getR:l}=e,c={},h=new Map;for(const e of t){const t=a(e);h.has(t)||h.set(t,[]),h.get(t).push(e)}let u=0;if("radial"===r)for(const e of t)u+=Math.abs(l(e));let d=null;if(s&&"radial"!==r){d=new Map;let e=0;for(const t of o){const o=h.get(t)||[];let i;i="string"==typeof s?o.reduce((e,t)=>e+(Number(t[s])||0),0):s(o),d.set(t,i),e+=i}const t=("horizontal"===r?n.height:n.width)-i.padding()*i.step()*o.length;if(e>0)for(const[o,i]of d)d.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),r=u>0?o/u:0;let n,s;d?(n=g,s=d.get(e)||i.bandwidth(),g+=s+i.padding()*i.step()):(n=i(e)??0,s=i.bandwidth()),c[e]={name:e,x:n,y:0,width:s,middle:n+s/2,padding:i.padding()*i.step(),pieceData:t,pct:r,pctStart:m},m+=r}return c}({data:e,oExtent:t,oScale:o,projection:i,layout:r,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=G("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 r=i.nodes??[];if(this._customRestyle=i.restyle,this.hasCustomRestyle=!!i.restyle,this.hasCustomRestyle){this._baseStyles=new WeakMap;for(const e of r)e.style&&this._baseStyles.set(e,e.style);this.applyCustomRestyle(r,this.config.layoutSelection??null)}return oe({label:"ordinal customLayout",nodes:r,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),r}this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1;const o=this.getSceneContext(),i=Xt[this.config.chartType];let r=i?i(o,t):[];if(this.getConnector&&this.scales){const e=function(e,t){const{scales:o,config:i,getConnector:r,getO:n}=e;if(!r||!o)return[];const s=[],{projection:a}=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=r(t);if(!o)continue;let i,s;"point"===e.type?(i=e.x,s=e.y):(i=e.x+e.w/2,s=e.y+("vertical"===a?0:e.h/2)),l.has(o)||l.set(o,[]),l.get(o).push({x:i,y:s,datum:t,category:n(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 r=o[i],n=o[i+1],a="function"==typeof h?h(r.datum):h||{stroke:e.config.themeSemantic?.border||e.config.themeSemantic?.secondary||"#999",strokeWidth:1,opacity:.5};s.push({type:"connector",x1:r.x,y1:r.y,x2:n.x,y2:n.y,style:a,datum:r.datum,group:t})}}return s}(o,r);r=[...e,...r]}return r}buildLayoutContext(e,t){const o=this.config,i=o.layoutMargin??{top:0,right:0,bottom:0,left:0},r=le(o.colorScheme,o.themeCategorical,ge),n=this.scales;return{data:e,scales:{o:n.o,r:n.r,projection:n.projection},dimensions:{width:t.width,height:t.height,margin:i,plot:"radial"===n.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:[...r]},resolveColor:ae(r,o.colorScheme),config:o.layoutConfig??{},selection:o.layoutSelection??null}}computeDecayOpacity(e,t){const o=this.config.decay;return o&&t>1?z(o,e,t):1}getDatumIndexMap(e){if(this._datumIndexCache&&this._datumIndexCache.version===this._dataVersion)return this._datumIndexCache.map;const t=N(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",r=new Map;for(let n=0;e.length>n;n++){const s=e[n],a=o?t(s):s[i],l=r.get(a);l?l.push(n):r.set(a,[n])}return r}(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&&(t++,i.r>o&&(o=i.r));if(500>=t)return{quadtree:null,maxRadius:o};const i=Array(t);let r=0;for(const t of e)"point"===t.type&&(i[r++]=t);return{maxRadius:o,quadtree:so().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 r=this.computeDecayOpacity(e,o);t.style={...t.style,opacity:(t.style?.opacity??1)*r}}}applyPulse(e,t,o=this.currentTime()){return!(!this.config.pulse||!this.timestampBuffer)&&function(e,t,o,i,r,n){const s=e.color??"rgba(255,255,255,0.6)",a=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 s of r(t)??[]){const t=o.get(s);null!=t&&(i=Math.max(i,x(e,t,n)))}l=P(c,i,s)||l;continue}if(null==c.datum)continue;const t=i.get(c.datum);if(null==t)continue;const h=o.get(t),u=null==h?0:x(e,h,n);l=P(c,u,s,a)||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&&k(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 r=0;this.scene.length>r;r++){const n=this.scene[r],s=this.getNodeKey(n,e);s&&("rect"===n.type?this.prevPositionMap.set(s,o?{x:n.x,y:t,w:n.w,h:0,opacity:n.style.opacity??1}:{x:t,y:n.y,w:0,h:n.h,opacity:n.style.opacity??1}):"point"===n.type?this.prevPositionMap.set(s,{x:n.x,y:n.y,r:0,opacity:0}):"wedge"===n.type&&(void 0===i&&(i=n.startAngle),this.prevPositionMap.set(s,{x:n.cx,y:n.cy,startAngle:i,endAngle:i,innerRadius:n.innerRadius,outerRadius:n.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}`}return"rect"===e.type?`r:${e.group||""}:${e.datum?.category??""}`:"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}):"rect"===o.type?this.prevPositionMap.set(i,{x:o.x,y:o.y,w:o.w,h:o.h,opacity:o.style.opacity}):"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 r=this.scene[e],n=this.getNodeKey(r,i);if(!n)continue;r._transitionKey=n;const s=this.prevPositionMap.get(n);if("point"===r.type)s?(o.add(n),r._targetOpacity=r.style.opacity??1,(s.x!==r.x||s.y!==r.y||void 0!==s.r&&s.r!==r.r)&&(r._targetX=r.x,r._targetY=r.y,r._targetR=r.r,r.x=s.x,r.y=s.y,void 0!==s.r&&(r.r=s.r),t=!0)):(r._targetOpacity=r.style.opacity??1,r._targetR=r.r,r.r=0,r.style={...r.style,opacity:0},t=!0);else if("rect"===r.type)s?(o.add(n),r._targetOpacity=r.style.opacity??1,s.x===r.x&&s.y===r.y&&s.w===r.w&&s.h===r.h||(r._targetX=r.x,r._targetY=r.y,r._targetW=r.w,r._targetH=r.h,r.x=s.x,r.y=s.y,r.w=s.w??r.w,r.h=s.h??r.h,t=!0)):(r._targetOpacity=r.style.opacity??1,r.style={...r.style,opacity:0},t=!0);else if("wedge"===r.type)if(s)o.add(n),r._targetOpacity=r.style.opacity??1,s.startAngle===r.startAngle&&s.endAngle===r.endAngle||(r._targetStartAngle=r.startAngle,r._targetEndAngle=r.endAngle,r.startAngle=s.startAngle,r.endAngle=s.endAngle,t=!0);else{r._targetOpacity=r.style.opacity??1,r._targetStartAngle=r.startAngle,r._targetEndAngle=r.endAngle;const e=r.startAngle;r.startAngle=e,r.endAngle=e,r.style={...r.style,opacity:0},this.prevPositionMap.set(n,{x:r.cx,y:r.cy,startAngle:e,endAngle:e,innerRadius:r.innerRadius,outerRadius:r.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=Re(e,this.activeTransition),o=Pe(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=Ye(i?i.opacity??1:0,e._targetOpacity,o)}const i=this.prevPositionMap.get(t);void 0!==e._targetX&&i&&(e.x=Ye(i.x,e._targetX,o),e.y=Ye(i.y,e._targetY,o)),void 0!==e._targetR&&void 0!==i?.r&&(e.r=Ye(i.r,e._targetR,o))}else if("rect"===e.type){if(void 0!==e._targetOpacity){const i=this.prevPositionMap.get(t);e.style.opacity=Ye(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=Ye(i.x,e._targetX,o),e.y=Ye(i.y,e._targetY,o),void 0!==i.w&&(e.w=Ye(i.w,e._targetW,o),e.h=Ye(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:Ye(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=Ye(i.startAngle,e._targetStartAngle,o),e.endAngle=Ye(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}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=y(e),o=this.getDataId,i=e=>t.has(o(e));b(this.buffer,this.timestampBuffer,i);const r=this.buffer.remove(i);if(0===r.length)return this.updateResults.recordNoop("remove"),r;for(const e of r)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",r.length),r}update(e,t){if(!this.getDataId)throw Error("update() requires dataIdAccessor to be configured");const o=y(e),i=this.getDataId,r=new Set;this.buffer.forEach((e,t)=>{o.has(i(e))&&r.add(t)});const n=this.buffer.update(e=>o.has(i(e)),t);if(0===n.length)return this.updateResults.recordNoop("update"),n;for(const e of n)this.evictValueExtent(e);return this.categories.clear(),this.buffer.forEach((e,t)=>{this.categories.add(this.getO(e)),r.has(t)&&this.pushValueExtent(e)}),this._dataVersion++,this.version++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",n.length),n}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??{},r=o(i,t);i.style=r?{...e,...r}:e}}restyleScene(e){this._customRestyle?(this.applyCustomRestyle(this.scene,e),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&&!I(e.colorAccessor,t.colorAccessor))&&this.styleResolver.resetColors(),("categoryAccessor"in e&&!I(e.categoryAccessor,t.categoryAccessor)||"oAccessor"in e&&!I(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)&&(I(this.config.categoryAccessor||this.config.oAccessor,t.categoryAccessor||t.oAccessor)||(this.getO=H(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],n=Array.isArray(o)?o:[o];if(r=i.length!==n.length||i.some((e,t)=>!I(e,n[t])),r){const e=this.config.valueAccessor||this.config.rAccessor;Array.isArray(e)?(this.rAccessors=e.map(e=>T(e,"value")),this.getR=this.rAccessors[0],this.rExtents=e.map(()=>new a)):(this.getR=T(e,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent])}}"stackBy"in e&&!I(e.stackBy,t.stackBy)&&(this.getStack=null!=this.config.stackBy?H(this.config.stackBy):void 0),"groupBy"in e&&!I(e.groupBy,t.groupBy)&&(this.getGroup=null!=this.config.groupBy?H(this.config.groupBy):void 0),"colorAccessor"in e&&!I(e.colorAccessor,t.colorAccessor)&&(this.getColor=null!=this.config.colorAccessor?H(this.config.colorAccessor):void 0),"symbolAccessor"in e&&!I(e.symbolAccessor,t.symbolAccessor)&&(this.getSymbol=null!=this.config.symbolAccessor?H(this.config.symbolAccessor):void 0),"connectorAccessor"in e&&!I(e.connectorAccessor,t.connectorAccessor)&&(this.getConnector=null!=this.config.connectorAccessor?H(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 lo(e,t,o,i=30,r,n=0){let s=null;if(r){const e=V(r,t,o,i,n);e&&(s={datum:e.node.datum,x:e.node.x,y:e.node.y,distance:e.distance})}for(const n of e){let e=null;switch(n.type){case"rect":if(null==n.datum)break;e=co(n,t,o);break;case"point":if(r)break;e=ho(n,t,o,i);break;case"symbol":e=uo(n,t,o,i);break;case"glyph":e=mo(n,t,o,i);break;case"wedge":if(null===n.datum)break;e=go(n,t,o);break;case"boxplot":e=po(n,t,o);break;case"violin":e=fo(n,t,o)}e&&i>e.distance&&(s&&e.distance>=s.distance||(s=e))}return s}function co(e,t,o){const i=X(t,o,e);return i.hit?{datum:e.datum,x:i.cx,y:e.y,distance:0,category:e.group}:null}function ho(e,t,o,i=30){const r=t-e.x,n=o-e.y,s=Math.sqrt(r*r+n*n);return s>$(e.r,i)?null:{datum:e.datum,x:e.x,y:e.y,distance:s}}function uo(e,t,o,i=30){const r=t-e.x,n=o-e.y,s=Math.sqrt(r*r+n*n);return s>$(lt(e.size),i)?null:{datum:e.datum,x:e.x,y:e.y,distance:s}}function mo(e,t,o,i=30){if(null==e.datum)return null;const r=St(e.glyph,e.size),n=e.x+r.centerDx,s=e.y+r.centerDy,a=t-n,l=o-s,c=Math.sqrt(a*a+l*l);return c>$(r.radius,i)?null:{datum:e.datum,x:n,y:s,distance:c}}function go(e,t,o){const i=t-e.cx,r=o-e.cy,n=Math.sqrt(i*i+r*r);if(e.innerRadius>n||n>e.outerRadius)return null;const s=Y(Math.atan2(r,i)),a=Y(e.startAngle),l=Y(e.endAngle);if(!(a>l?s>=a||l>=s:s>=a&&l>=s))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 po(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 r=e.y-i,n=e.y+i;if(!(Math.min(e.minPos,e.maxPos)>t||t>Math.max(e.minPos,e.maxPos)||r>o||o>n))return{datum:e.datum,x:e.medianPos,y:e.y,distance:0,category:e.category,stats:e.stats}}return null}function fo(e,t,o){if(!e.bounds)return null;const{x:i,y:r,width:n,height:s}=e.bounds;return i>t||t>i+n||r>o||o>r+s?null:{datum:e.datum,x:i+n/2,y:r+s/2,distance:0,category:e.category,stats:e.stats}}F(ao);import{useMemo as yo,useRef as vo}from"react";import{Fragment as bo,jsx as xo,jsxs as wo}from"react/jsx-runtime";function Ao(e){const{width:t,height:o,totalWidth:i,totalHeight:r,margin:n,scales:s,showAxes:a,showGrid:l,rFormat:c}=e,{rTickValues:h,axisExtent:u}=e,d="radial"===s?.projection,m="horizontal"===s?.projection,g=yo(()=>!s||d?[]:(h||f(s.r,5,u)).map(e=>({value:e,pixel:s.r(e),label:(c||ko)(e)})),[s,c,d,h,u]),p=l&&s&&!d,y=a&&s&&!d;return p||y?xo("svg",{width:i,height:r,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:wo("g",{transform:`translate(${n.left},${n.top})`,children:[p&&xo("g",{className:"ordinal-grid",children:g.map((e,i)=>xo("line",{x1:m?e.pixel:0,y1:m?0:e.pixel,x2:m?e.pixel:t,y2:m?o:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1},"grid-"+i))}),y&&xo(bo,{children:wo(bo,m?{children:[xo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),xo("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]}:{children:[xo("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),xo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]})})]})}):null}function ko(e){return Math.round(100*e)/100+""}function So(e){const{width:t,height:o,totalWidth:i,totalHeight:r,margin:n,scales:s,showAxes:a,showCategoryTicks:l,oLabel:c,rLabel:h,oFormat:u,rFormat:d,showGrid:m,title:g,legend:p,legendHoverBehavior:y,legendClickBehavior:v,legendHighlightedCategory:b,legendIsolatedCategories:x,legendPosition:w="right",legendLayout:A,foregroundGraphics:k,annotations:S,onAnnotationActivate:_,onObservation:C,chartId:P,chartType:R,autoPlaceAnnotations:M,svgAnnotationRules:L,xAccessor:I,yAccessor:T,annotationData:H,underlayRendered:B,canvasObscuresUnderlay:F=!0,children:O}=e,E=ct({onAnnotationActivate:_,onObservation:C,chartId:P,chartType:R}),N="radial"===s?.projection,D="horizontal"===s?.projection,j=!1!==l,W=!B||F,z=yo(()=>{if(!a||!j||!s||N)return[];const e=s.o.bandwidth(),t=s.o.domain().map((t,o)=>({value:t,pixel:(s.o(t)??0)+e/2,label:u?u(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,D?"string"==typeof t||"number"==typeof t?16:24:"string"==typeof t||"number"==typeof t?6.5*(t+"").length:60;var t}),r=D?0:6;if(i.every((e,t)=>0===t||o>=(i[t-1]+e)/2+r))return t;const n=Math.max(...i)+r,l=Math.max(1,Math.ceil(n/o));return 1===l?t:t.filter((e,t)=>t%l===0)},[a,j,s,u,N,D]),G=e.rTickValues,V=e.tickLabelEdgeAlign,$=e.axisExtent,q=yo(()=>a&&s&&!N?(G||f(s.r,5,$)).map(e=>({value:e,pixel:s.r(e),label:(d||ko)(e)})):[],[a,s,d,N,G,$]),X=vo(new Map),Y=vo(S?.length??0),Q=S?.length??0;Y.current!==Q&&(Y.current=Q,X.current=new Map);const K=yo(()=>{if(!S||0===S.length)return null;const e=re(S),i=Le("ordinal",E),r="horizontal"===s?.projection,n=s?.o?e=>(s.o(e)??0)+s.o.bandwidth()/2:null,a={scales:s?{x:r?s.r:n||s.r,y:r&&n||s.r,time:s.r,value:s.r,o:s.o}:null,timeAxis:"x",xAccessor:I,yAccessor:T,width:t,height:o,data:H,frameType:"ordinal",projection:r?"horizontal":"vertical",stickyPositionCache:X.current},l=M?we({annotations:e,context:a,..."object"==typeof M?M:{}}):e;return tt(l,i,L,a)},[S,M,L,t,o,s,I,T,H,E]);return a||g||p||k||K&&K.length>0||m||O?wo("svg",{role:"img",width:i,height:r,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[xo("title",{children:"string"==typeof g?g:"Ordinal Chart"}),xo("desc",{children:"string"==typeof g?g+" (ordinal data visualization)":"Ordinal data visualization"}),wo("g",{transform:`translate(${n.left},${n.top})`,children:[m&&s&&!N&&W&&xo("g",{className:"ordinal-grid",children:q.map((e,i)=>xo("line",{x1:D?e.pixel:0,y1:D?0:e.pixel,x2:D?e.pixel:t,y2:D?o:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1},"grid-"+i))}),a&&s&&!N&&(()=>{const e={fontSize:"var(--semiotic-tick-font-size, 12px)"},i={fontSize:"var(--semiotic-axis-label-font-size, 12px)"};return xo("g",{className:"ordinal-axes",children:wo(bo,D?{children:[wo("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[W&&xo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),z.map((t,o)=>wo("g",{transform:`translate(0,${t.pixel})`,children:[xo("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?xo("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fill:"var(--semiotic-text-secondary, #666)",className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):xo("foreignObject",{x:-68,y:-12,width:60,height:24,style:{overflow:"visible"},children:xo("div",{style:{textAlign:"right",userSelect:"none",...e},children:t.label})})]},"cat-"+o)),c&&xo("text",{x:15-n.left,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-n.left}, ${o/2})`,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:c})]}),wo("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[W&&xo("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),W&&s?.r&&(()=>{const e=s.r(0);return e>1&&t-1>e?xo("line",{x1:e,y1:0,x2:e,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1,strokeDasharray:"4,4"}):null})(),q.map((t,i)=>{const r=V?0===i?"start":i===q.length-1?"end":"middle":"middle";return wo("g",{transform:`translate(${t.pixel},${o})`,children:[xo("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),xo("text",{y:18,textAnchor:r,fill:"var(--semiotic-text-secondary, #666)",className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},"val-"+i)}),h&&xo("text",{x:t/2,y:o+40,textAnchor:"middle",fill:"var(--semiotic-text, #333)",className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]})]}:{children:[wo("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[W&&(()=>{const e=s?.r?s.r(0):o,i=0>e||e>o?o:e;return xo("line",{x1:0,y1:i,x2:t,y2:i,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})})(),z.map((t,i)=>wo("g",{transform:`translate(${t.pixel},${o})`,children:[xo("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?xo("text",{y:18,textAnchor:"middle",fill:"var(--semiotic-text-secondary, #666)",className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):xo("foreignObject",{x:-30,y:6,width:60,height:24,style:{overflow:"visible"},children:xo("div",{style:{textAlign:"center",userSelect:"none",...e},children:t.label})})]},"cat-"+i)),c&&xo("text",{x:t/2,y:o+40,textAnchor:"middle",fill:"var(--semiotic-text, #333)",className:"semiotic-axis-label",style:{userSelect:"none",...i},children:c})]}),wo("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[W&&xo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),q.map((t,o)=>wo("g",{transform:`translate(0,${t.pixel})`,children:[xo("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),xo("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fill:"var(--semiotic-text-secondary, #666)",className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},"val-"+o)),h&&xo("text",{x:15-n.left,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-n.left}, ${o/2})`,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]})]})})})(),K,k,O]}),g&&"string"==typeof g?xo("text",{x:i/2,y:be,textAnchor:"middle",fontWeight:"bold",fill:"var(--semiotic-text, #333)",className:"semiotic-chart-title",style:{userSelect:"none",fontSize:"var(--semiotic-title-font-size, 14px)"},children:g}):g?xo("foreignObject",{x:0,y:0,width:i,height:n.top,children:g}):null,ot({legend:p,totalWidth:i,totalHeight:r,margin:n,legendPosition:w,title:g,legendLayout:A,axisChrome:{hasAxis:!!a&&!N,hasAxisLabel:D?!!h:!!c},legendHoverBehavior:y,legendClickBehavior:v,legendHighlightedCategory:b,legendIsolatedCategories:x})]}):null}import*as _o from"react";import{jsx as Co}from"react/jsx-runtime";var Po=null,Ro=null;function Mo(e){const[t,o]=_o.useState(()=>Po);return _o.useEffect(()=>{if(t)return;let e=!1;return(Po?Promise.resolve(Po):(Ro||(Ro=import("./chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js").then(e=>Po=e.OrdinalBrushOverlay).catch(e=>{throw Ro=null,e})),Ro)).then(t=>{e||o(()=>t)}),()=>{e=!0}},[t]),t?Co(t,{...e}):null}import{arc as Lo}from"d3-shape";function Io(e,t){const o=t._gradientBand.colors;if(0===o.length)return;const{clipPath:i,slices:r}=ke({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}),n=new Path2D(i);e.save(),e.translate(t.cx,t.cy),e.clip(n);for(const t of r)e.fillStyle=it(e,t.color)||t.color||"#007bff",e.fill(new Path2D(t.d));e.restore(),t.style.stroke&&"none"!==t.style.stroke&&(e.save(),e.translate(t.cx,t.cy),e.strokeStyle=it(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.stroke(n),e.restore())}function To(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 Ho(e,t){const o={innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle+Math.PI/2,endAngle:t.endAngle+Math.PI/2},i=Lo().cornerRadius(t.cornerRadius)(o);if(!i)return;e.save(),e.translate(t.cx,t.cy);const r=new Path2D(i);e.fill(r),t.style.stroke&&"none"!==t.style.stroke&&e.stroke(r),e.restore()}var Bo=(e,t,o,i)=>{const r=t.filter(e=>"wedge"===e.type);for(const t of r)if(e.globalAlpha=(t.style.fillOpacity??1)*(t.style.opacity??1),t._gradientBand&&t._gradientBand.colors.length>0)Io(e,t),t._pulseIntensity&&t._pulseIntensity>0&&(To(e,t),K(e,t)),e.globalAlpha=1;else{if(e.fillStyle=rt(e,t.style.fill,"#007bff"),t.roundedEnds){t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=it(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1);const o=Ae({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 i=new Path2D(o);e.fill(i),t.style.stroke&&"none"!==t.style.stroke&&e.stroke(i),e.restore()}else t.cornerRadius?(t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=it(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1),Ho(e,t)):(To(e,t),e.fill(),t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=it(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.stroke()));t._pulseIntensity&&t._pulseIntensity>0&&(To(e,t),K(e,t)),e.globalAlpha=1}},Fo=(e,t,o,i)=>{const r=t.filter(e=>"boxplot"===e.type);for(const t of r){const o=t.columnWidth/2,i="vertical"===t.projection,r=it(e,"var(--semiotic-primary, #007bff)"),n=it(e,"var(--semiotic-text, #333)"),s=rt(e,t.style.fill,r),a=t.style.stroke,l="string"==typeof a?it(e,a)||a:n,c=t.style.strokeWidth||1,h=t.style.fillOpacity??t.style.opacity??.6;if(e.save(),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=h,e.fillStyle=s,i){const i=Math.min(t.q1Pos,t.q3Pos),r=Math.abs(t.q3Pos-t.q1Pos);e.fillRect(t.x-o,i,t.columnWidth,r),e.globalAlpha=1,e.strokeRect(t.x-o,i,t.columnWidth,r)}else{const i=Math.min(t.q1Pos,t.q3Pos),r=Math.abs(t.q3Pos-t.q1Pos);e.fillRect(i,t.y-o,r,t.columnWidth),e.globalAlpha=1,e.strokeRect(i,t.y-o,r,t.columnWidth)}e.strokeStyle="#fff",e.lineWidth=2,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()}},Oo=(e,t,o,i)=>{const r=t.filter(e=>"violin"===e.type);for(const t of r){e.save(),(t.translateX||t.translateY)&&e.translate(t.translateX,t.translateY);const o=new Path2D(t.pathString);if(e.globalAlpha=t.style.fillOpacity??t.style.opacity??.6,e.fillStyle=rt(e,t.style.fill,"#007bff"),e.fill(o),e.globalAlpha=1,t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=it(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,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()}},Eo=(e,t,o,i)=>{const r=t.filter(e=>"connector"===e.type);if(0===r.length)return;const n=new Map;for(const e of r){const t=e.group||"_default";n.has(t)||n.set(t,[]),n.get(t).push(e)}for(const[,t]of n){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=_e(e,o.fill)??"#999",e.fill(),e.globalAlpha=1}for(const o of t)e.beginPath(),e.moveTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.strokeStyle=it(e,o.style.stroke)||rt(e,o.style.fill,"")||it(e,"var(--semiotic-border, #999)"),e.lineWidth=o.style.strokeWidth||1,e.globalAlpha=o.style.opacity??.5,e.stroke(),e.globalAlpha=1}},No=(e,t,o,i)=>{const r=t.filter(e=>"trapezoid"===e.type);for(const t of r){const o=t.points;if(o.length>=4){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=_e(e,t.style?.fill)||"#999",e.fill(),t.style?.stroke&&(e.strokeStyle=it(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.stroke()),e.globalAlpha=1}}};function Do(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 jo(e){return.05>Math.abs(e-Math.round(e))?Math.round(e)+"%":e.toFixed(1)+"%"}var Wo=new Map;function zo(e,t){const o=`${e}@${"undefined"!=typeof window&&window.devicePixelRatio||1}`,i=Wo.get(o);if(void 0!==i)return i;const r=Ie({background:e,stroke:"rgba(255,255,255,0.5)",lineWidth:1.5,spacing:6,angle:45},t),n=qe(r)?null:r;return Wo.set(o,n),n}function Go(e,t,o,i,r,n){e.moveTo(t+n,o),e.lineTo(t+i-n,o),e.quadraticCurveTo(t+i,o,t+i,o+n),e.lineTo(t+i,o+r-n),e.quadraticCurveTo(t+i,o+r,t+i-n,o+r),e.lineTo(t+n,o+r),e.quadraticCurveTo(t,o+r,t,o+r-n),e.lineTo(t,o+n),e.quadraticCurveTo(t,o,t+n,o),e.closePath()}function Vo(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 $o(e){return.05>Math.abs(e-Math.round(e))?Math.round(e)+"%":e.toFixed(1)+"%"}function qo(e){return"rect"===e.type||"point"===e.type||"symbol"===e.type||"glyph"===e.type}function Xo(e){return(t,o,i,r)=>{e(t,o.filter(qo),{x:i.r,y:i.r},r)}}var Yo=Xo(l),Qo=Xo(S),Ko=Xo(p),Zo=Xo(q),Jo=e=>[Eo,...e],Uo={bar:Jo([Yo]),clusterbar:Jo([Yo]),point:Jo([Qo,Ko]),swarm:Jo([Qo,Ko]),pie:[Bo],donut:[Bo],boxplot:Jo([Fo,Qo]),violin:Jo([Oo]),histogram:Jo([Yo]),ridgeline:Jo([Oo]),timeline:Jo([Yo]),funnel:[Yo,No,(e,t,o,i)=>{const r=t.filter(e=>"rect"===e.type&&null!=e.datum);if(0!==r.length&&r.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 r){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 r=o.__funnelStepLabelX,n=o.__funnelStepLabelY+3;e.strokeStyle="rgba(0,0,0,0.6)",e.lineWidth=3,e.strokeText(i,r,n),e.fillStyle="#fff",e.fillText(i,r,n)}e.font="bold 13px sans-serif";for(const t of r){const o=t.datum;if(!o)continue;if(null==o.__funnelValueLabelX)continue;const i=o.__funnelBarW??0;if(60>i)continue;const r=o.__funnelValue;if(null==r||0===r)continue;const n=o.__funnelPercent,s=!0===o.__funnelIsFirstStep;let a;if(a=s?Do(r):null!=n?`${Do(r)} (${jo(n)})`:Do(r),e.measureText(a).width+16>i){if(s||null==n)continue;if(a=Do(r),e.measureText(a).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(a,l,c),e.fillStyle="#fff",e.fillText(a,l,c)}e.lineWidth=1,e.lineJoin="miter"}}],"bar-funnel":[Yo,(e,t,o,i)=>{const r=t.filter(e=>"rect"===e.type&&!0===e.datum?.__barFunnelIsDropoff);for(const t of r){const o=("string"==typeof t.style.fill?t.style.fill:null)||it(e,"var(--semiotic-border, #999)"),i=zo(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 r=t.filter(e=>"rect"===e.type&&!0!==e.datum?.__barFunnelIsDropoff&&null!=e.datum?.__barFunnelLabelX);if(0===r.length)return;const n=function(e,t){const[o,i,r]=et(e,t);return(.2126*o+.7152*i+.0722*r)/255>.6}(e,it(e,"var(--semiotic-text, #333)")),s=n?"#1f2937":"#ffffff",a=n?"rgba(255,255,255,0.18)":"rgba(0,0,0,0.12)",l=n?"#f3f4f6":"#1a1a1a",c=l;for(const t of r){const o=t.datum;if(!o)continue;const i=o.__barFunnelValue;if(null==i)continue;if(25>t.w)continue;const r=o.__barFunnelPercent,n=!(!0===o.__barFunnelIsFirstStep)&&null!=r,h=n?$o(r):"",u=Vo(i);e.font="bold 13px sans-serif";const d=n?e.measureText(h).width:0;e.font="11px sans-serif";const m=e.measureText(u).width,g=Math.max(d,m)+12,p=n?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=s,e.beginPath(),Go(e,y,v,g,p,4),e.fill(),e.restore(),e.strokeStyle=a,e.lineWidth=.5,e.beginPath(),Go(e,y,v,g,p,4),e.stroke(),e.textAlign="center",e.textBaseline="top",n?(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(u,f,v+3+13+2)):(e.font="bold 11px sans-serif",e.fillStyle=l,e.fillText(u,f,v+3))}e.lineWidth=1}],swimlane:Jo([Yo]),custom:Jo([Yo,Qo,Ko,Zo,Bo,Fo,Oo,No])};import{jsx as ei,jsxs as ti}from"react/jsx-runtime";function oi(e){const t=at(e,{skipPositional:!1});return null==t.title&&0===t.entries.length?null:ti("div",{className:"semiotic-tooltip",style:He,children:[null!=t.title&&ei("div",{style:{fontWeight:"bold"},children:t.title+""}),t.entries.map(e=>ti("div",{children:[ti("span",{style:{opacity:.7},children:[e.key,":"]})," ","number"==typeof e.value?e.value.toLocaleString():e.value+""]},e.key))]})}function ii({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 ti("div",{className:"semiotic-tooltip",style:He,children:[e&&ei("div",{style:{fontWeight:"bold"},children:e+""}),ti("div",{children:["n = ",o.n]}),ti("div",{children:["Min: ",o.min.toLocaleString()]}),ti("div",{children:["Q1: ",o.q1.toLocaleString()]}),ti("div",{children:["Median: ",o.median.toLocaleString()]}),ti("div",{children:["Q3: ",o.q3.toLocaleString()]}),ti("div",{children:["Max: ",o.max.toLocaleString()]}),ti("div",{style:{opacity:.8},children:["Mean: ",o.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});const r=t.length;return ti("div",{className:"semiotic-tooltip",style:He,children:[e&&ei("div",{style:{fontWeight:"bold"},children:e+""}),ti("div",{children:[r," items"]})]})}if(null!=t.bin&&null!=t.count){const e=t.range||[];return ti("div",{className:"semiotic-tooltip",style:He,children:[t.category&&ei("div",{style:{fontWeight:"bold"},children:t.category+""}),ti("div",{children:["Count: ",t.count]}),2===e.length&&ti("div",{style:{opacity:.8},children:[Number(e[0]).toFixed(1)," – ",Number(e[1]).toFixed(1)]})]})}const r=e.__oAccessor,n=e.__rAccessor,s=e.__chartType;if("swarm"===s||"point"===s)return oi(t);const a=(r&&null!=t[r]?t[r]:null)||t.category||t.name||t.group||t.__rName||"",l=t.__aggregateValue??(n&&null!=t[n]?t[n]:null)??t.value??t.__rValue??t.pct??"";return a||""!==l?ti("div",{className:"semiotic-tooltip",style:He,children:[a&&ei("div",{style:{fontWeight:"bold"},children:a+""}),""!==l&&ei("div",{children:"number"==typeof l?l.toLocaleString():l+""})]}):oi(t)}ii.ownsChrome=!0;import{jsx as ri,jsxs as ni}from"react/jsx-runtime";var si={top:50,right:40,bottom:60,left:70},ai=Et(Ot(function(e,t){const{chartType:o,runtimeMode:i,data:r,oAccessor:n="category",rAccessor:a="value",colorAccessor:l,symbolAccessor:h,symbolMap:u,stackBy:p,groupBy:f,multiAxis:y,timeAccessor:v,valueAccessor:b,categoryAccessor:x,accessorRevision:w,projection:A="vertical",size:k=[600,400],responsiveWidth:S,responsiveHeight:_,margin:P,barPadding:I,roundedTop:T,gradientFill:H,trackFill:F,baselinePadding:O,innerRadius:E,cornerRadius:N,normalize:D,startAngle:j,sweepAngle:z,dynamicColumnWidth:G,bins:V,showOutliers:$,showIQR:q,amplitude:X,connectorOpacity:Y,showLabels:K,connectorAccessor:oe,connectorStyle:re,dataIdAccessor:ne,rExtent:se,oExtent:ae,extentPadding:le=.05,oSort:ge,windowMode:pe="sliding",windowSize:be=200,pieceStyle:xe,summaryStyle:we,renderMode:Ae,colorScheme:ke,barColors:_e,showAxes:Pe=!0,showCategoryTicks:Re,categoryLabel:Me,valueLabel:Le,categoryFormat:Ie,valueFormat:Te,oLabel:He,rLabel:Fe,oFormat:Ee,rFormat:Ne,rTickValues:De,tickLabelEdgeAlign:je,axisExtent:We,enableHover:ze=!0,hoverAnnotation:Ge,tooltipContent:Ve,customHoverBehavior:qe,customClickBehavior:Ye,onObservation:Qe,annotationObservationCallback:Ke,chartId:Ze,annotations:et,onAnnotationActivate:tt,autoPlaceAnnotations:ot,svgAnnotationRules:it,showGrid:rt=!1,legend:nt,legendHoverBehavior:st,legendClickBehavior:at,legendHighlightedCategory:lt,legendIsolatedCategories:ct,legendPosition:ht,legendLayout:ut,legendCategoryAccessor:dt,onCategoriesChange:pt,backgroundGraphics:yt,foregroundGraphics:vt,title:bt,className:xt,background:wt,centerContent:At,decay:St,pulse:_t,transition:Ct,animate:Mt,staleness:Ot,frameScheduler:Et,clock:Nt,random:Dt,seed:jt,paused:Wt=!1,suspendWhenHidden:zt=!0,brush:Gt,onBrush:Vt,accessibleTable:$t=!0,description:qt,summary:Xt,customLayout:Yt,onLayoutError:Qt,layoutConfig:Kt,layoutSelection:Zt}=e,{customHoverBehavior:Jt,customClickBehavior:Ut,hasClickBehavior:eo}=L({customHoverBehavior:qe,customClickBehavior:Ye,onObservation:Qe,chartId:Ze,chartType:"StreamOrdinalFrame"}),to=x??n,oo=b??a,io=Lt(!0),ro=mt({sizeProp:k,responsiveWidth:S,responsiveHeight:_,userMargin:P,marginDefault:si,title:bt,legend:nt,legendPosition:ht,animate:Mt,transitionProp:Ct,frameScheduler:Et,clock:Nt,random:Dt,seed:jt,paused:Wt,suspendWhenHidden:zt,themeDirtyRef:io}),{reducedMotionRef:no,responsiveRef:so,size:co,margin:ho,adjustedWidth:uo,adjustedHeight:mo,currentTheme:go,transition:po,introEnabled:fo,tableId:yo,rafRef:vo,renderFnRef:bo,scheduleRender:xo,frameRuntime:wo}=ro,ko=Pt(),_o=Rt(),Co=Ht(()=>Be(r),[r]),Po=Me??He,Ro=Le??Fe,Lo=Ie??Ee,Io=Te??Ne,To=Lt(null),[Ho,Bo]=It(null),[Fo,Oo]=It(null),Eo=g(vt,co,ho,Fo),No=g(yt,co,ho,Fo),Do=yt||"transparent"===wt?null:ri("rect",{className:"semiotic-canvas-background","data-semiotic-layer":"canvas-background",x:-ho.left,y:-ho.top,width:co[0],height:co[1],fill:wt||"var(--semiotic-bg, transparent)"}),[jo,Wo]=It(0),zo=Lt(0),[Go,Vo]=It(!1),$o=Lt({w:-1,h:-1}),qo=Lt(!1),Xo=ft("StreamOrdinalFrame"),Yo=ze||Ge,Qo="streaming"===i,Ko=Ht(()=>({chartType:o,runtimeMode:Qo?"streaming":"bounded",windowSize:be,windowMode:pe,extentPadding:le,projection:A,oAccessor:Qo?void 0:to,rAccessor:Qo?void 0:oo,accessorRevision:w,colorAccessor:l,symbolAccessor:h,symbolMap:u,stackBy:p,groupBy:f,multiAxis:y,timeAccessor:Qo?v:void 0,valueAccessor:Qo?b||("string"==typeof oo||"function"==typeof oo?oo:void 0):void 0,categoryAccessor:Qo?to:void 0,rExtent:se,oExtent:ae,axisExtent:We,barPadding:I,roundedTop:T,gradientFill:d(H),trackFill:F,baselinePadding:O,innerRadius:E,cornerRadius:N,normalize:D,startAngle:j,sweepAngle:z,dynamicColumnWidth:G,bins:V,showOutliers:$,showIQR:q,amplitude:X,connectorOpacity:Y,showLabels:K,connectorAccessor:oe,connectorStyle:re,dataIdAccessor:ne,oSort:ge,pieceStyle:xe,summaryStyle:we,colorScheme:ke,themeCategorical:go?.colors?.categorical,themeSemantic:kt(go),themeSequential:go?.colors?.sequential,themeDiverging:go?.colors?.diverging,barColors:_e,decay:St,pulse:_t,transition:po,introAnimation:fo,staleness:Ot,clock:wo.now,customLayout:Yt,onLayoutError:Qt,layoutConfig:Kt,layoutMargin:ho}),[o,Qo,be,pe,le,A,to,oo,w,l,h,u,p,f,y,v,b,se,ae,We,I,T,H,F,O,E,N,D,j,z,G,V,$,q,X,Y,K,oe,re,ne,ge,xe,we,ke,go,_e,St,_t,po,fo,Ot,wo.now,Yt,Qt,Kt,ho]),Zo=ee(Ko),Jo=Lt(null);Jo.current||(Jo.current=new ao(Zo));const ei=R(Jo,dt,pt,e=>e.getData());J(Jo,Zo,io,xo),U(Jo,Zt,io,xo);const ti=Lt(null);ti.current||(ti.current=new s(e=>{const t=Jo.current;t&&t.ingest(e)&&(io.current=!0,xo())}));const oi=Bt(e=>{ti.current?.push(e)},[]),ai=Bt(e=>{ti.current?.pushMany(e)},[]),li=Bt(()=>{ti.current?.clear(),Jo.current?.clear(),io.current=!0,xo()},[xo]),ci=Bt(e=>{ti.current?.clearLastData(),ti.current?.setReplacementData(e)},[]);Ft(t,()=>({push:oi,pushMany:ai,replace:ci,remove:e=>{ti.current?.flush();const t=Jo.current?.remove(e)??[];if(t.length>0){const e=To.current?.data;!!To.current&&t.some(Array.isArray(e)?t=>e.includes(t):t=>t===e)&&(To.current=null,Bo(null)),io.current=!0,xo()}return t},update:(e,t)=>{ti.current?.flush();const o=Jo.current?.update(e,t)??[];return o.length>0&&(io.current=!0,xo()),o},clear:li,getData:()=>(ti.current?.flush(),Jo.current?.getData()??[]),getScales:()=>Jo.current?.scales??null,getCustomLayout:()=>Jo.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>Jo.current?.lastCustomLayoutFailure??null}),[oi,ai,ci,li,xo]),Tt(()=>{r&&ti.current?.setBoundedData(Co)},[r,Co]);const{canvasRef:hi}=gt(ro,{storeRef:Jo,dirtyRef:io,hydrated:ko,wasHydratingFromSSR:_o,cleanup:()=>ti.current?.clear(),canvasPaintDependencies:[o,uo,mo,Pe,wt,yt,Ae,xo]}),{hoverHandlerRef:ui,hoverLeaveRef:di,onPointerMove:mi,onPointerLeave:gi}=ro;ui.current=e=>{if(!Yo)return;const t=hi.current;if(!t)return;const i=t.getBoundingClientRect(),r=e.clientX-i.left-ho.left,n=e.clientY-i.top-ho.top;if(0>r||r>uo||0>n||n>mo)return void(To.current&&(To.current=null,Bo(null),Jt&&Jt(null),xo()));const s=Jo.current;if(!s||0===s.scene.length)return;const a="radial"===A,l=lo(s.scene,a?r-uo/2:r,a?n-mo/2:n,30,s.pointQuadtree,s.maxPointRadius);if(!l)return void(To.current&&(To.current=null,Bo(null),Jt&&Jt(null),xo()));const c=Se(l.datum||{},l.x,l.y,{...l.stats&&{stats:l.stats},...l.category&&{category:l.category},__oAccessor:"string"==typeof to?to:void 0,__rAccessor:"string"==typeof oo?oo:void 0,__chartType:o});To.current=c,Bo(c),Jt&&(Jt(c),io.current=!0),xo()},di.current=()=>{To.current&&(To.current=null,Bo(null),Jt&&(Jt(null),io.current=!0),xo())};const pi=Bt(e=>{if($e(e.target))return;if(!Ut)return;const t=hi.current;if(!t)return Ut(null),io.current=!0,void xo();const i=t.getBoundingClientRect(),r=e.clientX-i.left-ho.left,n=e.clientY-i.top-ho.top;if(0>r||r>uo||0>n||n>mo)return Ut(null),io.current=!0,void xo();const s=Jo.current;if(!s||0===s.scene.length)return Ut(null),io.current=!0,void xo();const a="radial"===A,l=lo(s.scene,a?r-uo/2:r,a?n-mo/2:n,30,s.pointQuadtree,s.maxPointRadius);if(!l)return Ut(null),io.current=!0,void xo();Ut(Se(l.datum||{},l.x,l.y,{...l.stats&&{stats:l.stats},...l.category&&{category:l.category},__oAccessor:"string"==typeof to?to:void 0,__rAccessor:"string"==typeof oo?oo:void 0,__chartType:o}),{type:"activate",inputType:Je(e.nativeEvent.pointerType)}),io.current=!0,xo()},[Ut,hi,ho.left,ho.top,uo,mo,A,to,oo,o,xo]),{kbFocusIndexRef:fi,focusedNavPointRef:yi,onKeyDown:vi}=M({storeRef:Jo,hoverRef:To,setHoverPoint:Bo,customHoverBehavior:Jt,customClickBehavior:Ut,scheduleRender:xo,chartType:o,oAccessor:to,rAccessor:oo}),bi=Bt(e=>{fi.current=-1,yi.current=null,mi(e)},[yi,fi,mi]);bo.current=()=>{if(vo.current=null,!wo.isActive)return;const e=hi.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const i=Jo.current;if(!i)return;const r=wo.now(),n=i.advanceTransition(no.current?r+1e6:r),s=!no.current&&n,a=$o.current.w!==uo||$o.current.h!==mo,l=io.current;let c=!1;const h=Xo.current.beforeCompute(i.getLastUpdateResult(),s);!l&&!a||s&&!a||(i.computeScene({width:uo,height:mo}),$o.current={w:uo,h:mo},c=!0,ei()),Xo.current.afterCompute(h,c,a),io.current=l&&s&&!c;const u=C(i,r,c,qo);(c||s)&&e.setAttribute("aria-label",Ce(i.scene,o+" chart"));const d=Oe(),m=co[0]*d,g=co[1]*d;e.width===m&&e.height===g||(e.width=m,e.height=g,e.style.width=co[0]+"px",e.style.height=co[1]+"px"),t.setTransform(d,0,0,d,0,0),t.clearRect(0,0,co[0],co[1]);const p=Ot&&i.lastIngestTime>0&&r-i.lastIngestTime>(Ot?.threshold??5e3);p&&(t.globalAlpha=Ot?.dimOpacity??.5);const f="radial"===A;t.save(),t.beginPath(),t.rect(ho.left,ho.top,uo,mo),t.clip(),f?(t.save(),t.translate(ho.left+uo/2,ho.top+mo/2)):t.translate(ho.left,ho.top);const y=Yt?Uo.custom:Uo[o]||[],v={width:uo,height:mo},b=i.scales;b&&Q({context:t,nodes:i.scene,renderMode:Ae,pixelRatio:d,paintBuiltIn:e=>{for(const o of y)o(t,e,b,v)}}),f&&t.restore(),t.restore(),p&&(t.globalAlpha=1),c&&i.scales?(Oo(i.scales),Wo(e=>e+1),zo.current=r):s&&i.scales&&r-zo.current>=33&&(Wo(e=>e+1),zo.current=r),Ot?.showBadge&&Vo(!!p),(s||null!=i.activeTransition||u.pending)&&xo()},te(Ot,Jo,io,xo,Go,Vo);const xi=Yo&&Ho?Ve?Ve(Ho):ri(ii,{hover:Ho}):null,wi="radial"===A,Ai=xi?ri(de,{x:Ho?wi?Ho.x+uo/2:Ho.x:0,y:Ho?wi?Ho.y+mo/2:Ho.y:0,containerWidth:uo,containerHeight:mo,margin:ho,className:"stream-ordinal-tooltip",children:xi}):null,ki="horizontal"===A?to:oo,Si=m("horizontal"===A?oo:to,void 0,"__semiotic_resolvedO",""),_i=m(ki,void 0,"__semiotic_resolvedR",""),Ci=Si.key,Pi=_i.key,Ri=c(Si,_i,et&&et.length>0||!1);if(Xe||!ko&&_o){const e=Jo.current;e&&r&&(e.ingest({inserts:Co,bounded:!0}),e.computeScene({width:uo,height:mo}));const t=e?.scene??[],o=e?.scales??null,i=g(vt,co,ho,o),n=g(yt,co,ho,o),s="radial"===A,a=s?ho.left+uo/2:ho.left,l=s?ho.top+mo/2:ho.top;return ni("div",{ref:so,className:"stream-ordinal-frame"+(xt?" "+xt:""),role:"img","aria-label":qt||("string"==typeof bt?bt:"Ordinal chart"),style:{position:"relative",width:S?"100%":co[0],height:_?"100%":co[1]},children:[ri(ye,{summary:Xt}),ni("svg",{xmlns:"http://www.w3.org/2000/svg",width:co[0],height:co[1],style:{position:"absolute",left:0,top:0},children:[n&&ri("g",{transform:`translate(${ho.left},${ho.top})`,children:n}),ni("g",{transform:`translate(${a},${l})`,children:[wt&&ri("rect",{x:0,y:0,width:uo,height:mo,fill:wt}),t.map((e,t)=>Z({node:e,index:t,renderMode:Ae,fallback:()=>Ue(e,t,yo)})).filter(Boolean)]})]}),ri(So,{width:uo,height:mo,totalWidth:co[0],totalHeight:co[1],margin:ho,scales:o,showAxes:Pe,showCategoryTicks:Re,oLabel:Po,rLabel:Ro,oFormat:Lo,rFormat:Io,rTickValues:De,tickLabelEdgeAlign:je,axisExtent:We,showGrid:rt,title:bt,legend:nt,legendHoverBehavior:st,legendClickBehavior:at,legendHighlightedCategory:lt,legendIsolatedCategories:ct,legendPosition:ht,legendLayout:ut,foregroundGraphics:W(i,ie(Jo.current?.customLayoutOverlays,Zt??null)),annotations:et,onAnnotationActivate:tt,onObservation:Ke??Qe,chartId:Ze,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:ot,svgAnnotationRules:it,annotationFrame:0,xAccessor:Ci,yAccessor:Pi,annotationData:Ri(e?.getData())}),At&&"radial"===A&&ri("div",{style:{position:"absolute",left:ho.left+uo/2,top:ho.top+mo/2,transform:"translate(-50%, -50%)",pointerEvents:"none",textAlign:"center"},children:At})]})}return ni("div",{ref:so,className:"stream-ordinal-frame"+(xt?" "+xt:""),role:"group","aria-label":qt||("string"==typeof bt?bt:"Ordinal chart"),tabIndex:0,style:{position:"relative",width:S?"100%":co[0],height:_?"100%":co[1],overflow:"visible"},onKeyDown:vi,children:["production"!==process.env.NODE_ENV&&Jo.current&&ri(fe,{store:Jo.current,diagnostics:Xo.current}),$t&&ri(ve,{tableId:yo}),$t&&ri(ce,{scene:Jo.current?.scene??[],chartType:o+" chart",tableId:yo,chartTitle:"string"==typeof bt?bt:void 0}),ri(ye,{summary:Xt}),ri(he,{hoverPoint:Ho}),ni("div",{role:"img","aria-label":qt||("string"==typeof bt?bt:"Ordinal chart"),style:{position:"relative",width:"100%",height:"100%"},onMouseMove:Yo?bi:void 0,onMouseLeave:Yo?gi:void 0,onClick:eo?pi:void 0,children:[ni(ue,{size:co,margin:ho,children:[Do,No]}),ri(Ao,{width:uo,height:mo,totalWidth:co[0],totalHeight:co[1],margin:ho,scales:Fo,showAxes:Pe,showGrid:rt,rFormat:Io,rTickValues:De,axisExtent:We}),ri("canvas",{ref:hi,"aria-label":Ce(Jo.current?.scene??[],o+" chart"),style:{position:"absolute",top:0,left:0,width:co[0],height:co[1]}}),ri(So,{width:uo,height:mo,totalWidth:co[0],totalHeight:co[1],margin:ho,scales:Fo,showAxes:Pe,showCategoryTicks:Re,oLabel:Po,rLabel:Ro,oFormat:Lo,rFormat:Io,rTickValues:De,axisExtent:We,showGrid:rt,title:bt,legend:nt,legendHoverBehavior:st,legendClickBehavior:at,legendHighlightedCategory:lt,legendIsolatedCategories:ct,legendPosition:ht,legendLayout:ut,foregroundGraphics:W(Eo,ie(Jo.current?.customLayoutOverlays,Zt??null)),annotations:et,onAnnotationActivate:tt,onObservation:Ke??Qe,chartId:Ze,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:ot,svgAnnotationRules:it,annotationFrame:jo,xAccessor:Ci,yAccessor:Pi,annotationData:Ri(Jo.current?.getData()),underlayRendered:!0,canvasObscuresUnderlay:!1}),(Gt||Vt)&&"radial"!==A&&ri(Mo,{width:uo,height:mo,totalWidth:co[0],totalHeight:co[1],margin:ho,scales:Fo,onBrush:Vt||(()=>{})}),At&&"radial"===A&&ri("div",{style:{position:"absolute",left:ho.left+uo/2,top:ho.top+mo/2,transform:"translate(-50%, -50%)",pointerEvents:"none",textAlign:"center"},children:At}),Ot?.showBadge&&ri(B,{isStale:Go,position:Ot.badgePosition}),ri(me,{active:fi.current>=0,hoverPoint:Ho,margin:ho,size:co,shape:yi.current?.shape,width:yi.current?.w,height:yi.current?.h}),Ai]})]})}));ai.displayName="StreamOrdinalFrame";var li=ai;import{forwardRef as ci,useMemo as hi}from"react";import{jsx as ui}from"react/jsx-runtime";var di=ci(function(e,t){const{data:o,layout:r,layoutConfig:n,onLayoutError:s,categoryAccessor:a="category",valueAccessor:l="value",oExtent:c,rExtent:h,projection:u="vertical",margin:d,className:m,colorBy:g,colorScheme:p,showAxes:f=!1,annotations:y,onObservation:v,onClick:b,selection:x,linkedHover:w,chartId:A,loading:k,loadingContent:S,emptyContent:_,frameProps:C={}}=e,{frameRef:P,resolved:R,safeData:M,setup:L,earlyReturn:I}=i({imperativeRef:t,imperativeVariant:"xy",chartTypeLabel:"OrdinalCustomChart",unwrapData:!0,data:o,colorBy:g,colorScheme:p,selection:x,linkedHover:w,onObservation:v,onClick:b,chartId:A,loading:k,loadingContent:S,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}),T=L.effectiveSelectionHook,H=hi(()=>T?.isActive?{isActive:!0,predicate:T.predicate}:null,[T?.isActive,T?.predicate]);if(I)return I;const{width:B,height:F,enableHover:N,showGrid:D,title:j,description:W,summary:z,accessibleTable:G}=R,V={chartType:"custom",...null!=o&&{data:M},customLayout:r,layoutConfig:n,onLayoutError:s,...H&&{layoutSelection:H},oAccessor:a,rAccessor:l,oExtent:c,rExtent:h,projection:u,colorAccessor:g,colorScheme:p,size:[B,F],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:L.margin,enableHover:N,showAxes:f,showGrid:D,annotations:y,...O({title:j,description:W,summary:z,accessibleTable:G,className:m,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...E({linkedHover:w,selection:x,onObservation:v,onClick:b,hoverHighlight:!1,mobileInteraction:L.mobileInteraction,customHoverBehavior:L.customHoverBehavior,customClickBehavior:L.customClickBehavior}),...C};return ui(Ct,{componentName:"OrdinalCustomChart",width:B,height:F,children:ui(li,{ref:P,...V})})});di.displayName="OrdinalCustomChart";import{useMemo as mi,forwardRef as gi,useRef as pi}from"react";import{useImperativeHandle as fi}from"react";function yi({ref:e,frameRef:t,setup:o}){return fi(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 vi}from"react";function bi(e){const{colorBy:o,colorScale:i,color:r,themeCategorical:n,colorScheme:s,categoryIndexMap:a,userPieceStyle:l,stroke:c,strokeWidth:h,opacity:u,effectiveSelectionHook:d,resolvedSelection:m,cycleByCategory:g=!1,baseStyleExtras:p,linkStrokeToFill:f=!1,styleRules:y,resolveRuleValue:v}=e,b=vi(()=>(e,t)=>{const l="function"==typeof p?p(e,t):p,c=l?{...l}:{};if(void 0===c.fill)if(o){if(!i)return c;c.fill=Fe(e,o,i)}else c.fill=nt(r,n,s,g?t:void 0,a);if(y&&y.length>0){const o=se(e,y,{value:v?v(e):void 0,category:t});Object.assign(c,o)}return f&&void 0===c.stroke&&void 0!==c.fill&&(c.stroke=c.fill),c},[o,i,r,n,s,a,g,p,f,y,v]),x=vi(()=>t(l?"function"==typeof l?(e,t)=>({...b(e,t),...l(e,t)||{}}):(e,t)=>({...b(e,t),...l}):b,{stroke:c,strokeWidth:h,opacity:u}),[b,l,c,h,u]);return vi(()=>xt(x,d??null,m),[x,d,m])}import{jsx as xi}from"react/jsx-runtime";var wi=gi(function(t,i){const r=dt(t.mode,{width:t.width,height:t.height,showGrid:t.showGrid,enableHover:t.enableHover,showLegend:t.showLegend,title:t.title,description:t.description,accessibleTable:t.accessibleTable,summary:t.summary,categoryLabel:t.categoryLabel,valueLabel:t.valueLabel,showCategoryTicks:t.showCategoryTicks,orientation:t.orientation,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules}),s=pi(null),{data:a,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:m="vertical",valueFormat:g,colorBy:p,colorScheme:f,sort:y=!1,barPadding:v=40,roundedTop:b,gradientFill:x=!1,styleRules:w,baselinePadding:A=!1,tooltip:k,annotations:S,regression:_,valueExtent:C,frameProps:P={},selection:R,linkedHover:M,onObservation:L,onClick:I,hoverHighlight:T,chartId:H,loading:B,loadingContent:F,emptyContent:N,legendInteraction:W,legendPosition:z,color:G,stroke:V,strokeWidth:$,opacity:q,showCategoryTicks:X,categoryFormat:Y,dataIdAccessor:Q}=t,{width:K,height:Z,enableHover:J,showGrid:U,showLegend:ee,title:te,description:oe,summary:ie,accessibleTable:re,categoryLabel:se,valueLabel:ae}=r,le=mi(()=>Be(a),[a]),ce=o({data:le,rawData:a,colorBy:p,colorScheme:f,legendInteraction:W,legendPosition:z,selection:R,linkedHover:M,fallbackFields:p?["string"==typeof p?p:""]:[],unwrapData:!0,onObservation:L,onClick:I,hoverHighlight:T,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"BarChart",chartId:H,showLegend:ee,userMargin:l,marginDefaults:r.marginDefaults,loading:B,loadingContent:F,emptyContent:N,width:K,height:Z,hasTitle:!!te,axisChrome:st({showAxes:r.showAxes,projection:"horizontal"===m?"horizontal":"vertical",hasCategoryLabel:!!se,hasValueLabel:!!ae})}),{effectiveLegendProps:he,effectiveMargin:ue}=yi({ref:i,frameRef:s,setup:ce});Mt("BarChart",le,"categoryAccessor",h),Mt("BarChart",le,"valueAccessor",u);const de=yt(le,y,u),me=vt(),ge=mi(()=>new Map,[]),pe=mi(()=>ne(u),[u]),fe=bi({colorBy:p,colorScale:ce.colorScale,color:G,themeCategorical:me,colorScheme:f,categoryIndexMap:ge,userPieceStyle:P?.pieceStyle,stroke:V,strokeWidth:$,opacity:q,styleRules:w,resolveRuleValue:pe,effectiveSelectionHook:ce.effectiveSelectionHook,resolvedSelection:ce.resolvedSelection}),ye=mi(()=>D({categoryAccessor:h,valueAccessor:u,groupAccessor:p&&p!==h?p:void 0,groupLabel:"string"==typeof p?p:"group",valueFormat:g}),[h,u,p,g]),ve=mi(()=>d(x),[x]);if(ce.earlyReturn)return ce.earlyReturn;const be=n({componentName:"BarChart",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(be)return xi(_t,{componentName:"BarChart",message:be,width:K,height:Z});const xe=e(_),we=xe?[xe,...S||[]]:S,Ae={chartType:"bar",...null!=a&&{data:de},oAccessor:h,rAccessor:u,projection:"horizontal"===m?"horizontal":"vertical",pieceStyle:fe,size:[K,Z],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:ue,barPadding:v,...null!=b&&{roundedTop:b},...ve&&{gradientFill:ve},...Q&&{dataIdAccessor:Q},baselinePadding:A,enableHover:J,showAxes:r.showAxes,oLabel:se,rLabel:ae,rFormat:g,...Y&&{oFormat:Y},showGrid:U,showCategoryTicks:X,oSort:y,...he,...O({title:te,description:oe,summary:ie,accessibleTable:re,className:c,animate:t.animate,axisExtent:t.axisExtent,autoPlaceAnnotations:t.autoPlaceAnnotations}),...j({tooltip:k,defaultTooltipContent:ye}),...E({linkedHover:M,selection:R,onObservation:L,onClick:I,hoverHighlight:T,mobileInteraction:ce.mobileInteraction,customHoverBehavior:ce.customHoverBehavior,customClickBehavior:ce.customClickBehavior}),...we&&we.length>0&&{annotations:we},...C&&{rExtent:C},...Object.fromEntries(Object.entries(P).filter(([e])=>"pieceStyle"!==e))};return xi(Ct,{componentName:"BarChart",width:K,height:Z,children:xi(li,{ref:s,...Ae})})});wi.displayName="BarChart";import{useMemo as Ai,forwardRef as ki,useRef as Si}from"react";import{jsx as _i}from"react/jsx-runtime";var Ci=ki(function(e,t){const i=dt(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=Si(null),{data:s,margin:a,className:l,categoryAccessor:c="category",stackBy:h,valueAccessor:u="value",orientation:m="vertical",valueFormat:g,colorBy:p,colorScheme:f,normalize:y=!1,sort:v=!1,barPadding:b=40,roundedTop:x,gradientFill:w,styleRules:A,baselinePadding:k=!1,tooltip:S,annotations:_,valueExtent:C,frameProps:P={},selection:R,linkedHover:M,onObservation:L,onClick:I,hoverHighlight:T,chartId:H,loading:B,loadingContent:F,emptyContent:N,legendInteraction:W,legendPosition:z,color:G,stroke:V,strokeWidth:$,opacity:q,categoryFormat:X}=e,{width:Y,height:Q,enableHover:K,showGrid:Z,showLegend:J,title:U,description:ee,summary:te,accessibleTable:oe,categoryLabel:ie,valueLabel:re}=i,se=Ai(()=>Be(s),[s]),ae=p||h,le=o({data:se,rawData:s,colorBy:ae,colorScheme:f,legendInteraction:W,legendPosition:z,selection:R,linkedHover:M,fallbackFields:ae?["string"==typeof ae?ae:""]:[],unwrapData:!0,onObservation:L,onClick:I,hoverHighlight:T,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"StackedBarChart",chartId:H,showLegend:J,userMargin:a,marginDefaults:i.marginDefaults,loading:B,loadingContent:F,emptyContent:N,width:Y,height:Q,hasTitle:!!U,axisChrome:st({showAxes:i.showAxes,projection:"horizontal"===m?"horizontal":"vertical",hasCategoryLabel:!!ie,hasValueLabel:!!re})}),ce=vt(),he=Ai(()=>new Map,[]),ue=Ai(()=>ne(u),[u]),de=bi({colorBy:ae,colorScale:le.colorScale,color:G,themeCategorical:ce,colorScheme:f,categoryIndexMap:he,userPieceStyle:P?.pieceStyle,stroke:V,strokeWidth:$,opacity:q,styleRules:A,resolveRuleValue:ue,effectiveSelectionHook:le.effectiveSelectionHook,resolvedSelection:le.resolvedSelection}),me=Ai(()=>D({categoryAccessor:h,valueAccessor:u,groupAccessor:c,valueFormat:g}),[h,c,u,g]),ge=n({componentName:"StackedBarChart",data:s,accessors:{categoryAccessor:c,valueAccessor:u},requiredProps:{stackBy:h}}),{effectiveLegendProps:pe,effectiveMargin:fe}=yi({ref:t,frameRef:r,setup:le}),ye=Ai(()=>d(w),[w]);if(le.earlyReturn)return le.earlyReturn;const ve={chartType:"bar",...null!=s&&{data:se},oAccessor:c,rAccessor:u,stackBy:h,normalize:y,oSort:v,projection:"horizontal"===m?"horizontal":"vertical",pieceStyle:de,size:[Y,Q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:fe,barPadding:b,...null!=x&&{roundedTop:x},...ye&&{gradientFill:ye},baselinePadding:k,enableHover:K,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:ie,rLabel:re,rFormat:g,...X&&{oFormat:X},showGrid:Z,...pe,...O({title:U,description:ee,summary:te,accessibleTable:oe,className:l,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...j({tooltip:S,defaultTooltipContent:me}),...E({linkedHover:M,selection:R,onObservation:L,onClick:I,hoverHighlight:T,mobileInteraction:le.mobileInteraction,customHoverBehavior:le.customHoverBehavior,customClickBehavior:le.customClickBehavior}),..._&&_.length>0&&{annotations:_},...C&&{rExtent:C},...Object.fromEntries(Object.entries(P).filter(([e])=>"pieceStyle"!==e))};return ge?_i(_t,{componentName:"StackedBarChart",message:ge,width:Y,height:Q}):_i(Ct,{componentName:"StackedBarChart",width:Y,height:Q,children:_i(li,{ref:r,...ve})})});Ci.displayName="StackedBarChart";import*as Pi from"react";import{useMemo as Ri,useCallback as Mi,forwardRef as Li,useRef as Ii,useImperativeHandle as Ti}from"react";import{useRef as Hi,useState as Bi,useCallback as Fi,useMemo as Oi}from"react";import{useMemo as Ei,useCallback as Ni,useRef as Di}from"react";var ji={RdBu:We,PiYG:je,PRGn:De,BrBG:Ne,RdYlBu:ze,RdYlGn:Ge,Spectral:Ve},Wi="__likert_neutral_neg",zi="__likert_neutral_pos";function Gi(e,t){if("function"==typeof e)return e;const o=e||t;return e=>e[o]}function Vi(e,t,o,i,r,n){const s=new Map,a=new Set(t);for(const l of e){const e=o(l);s.has(e)||s.set(e,new Map);const c=s.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 r=t[o];c.set(r,(c.get(r)||0)+1)}else if(r&&n){const e=r(l),t=n(l);if(!a.has(e))continue;c.set(e,(c.get(e)||0)+(Number.isFinite(t)?t:0))}}const l=[];for(const[e,o]of s){let i=0;for(const e of t)i+=o.get(e)||0;if(0!==i)for(let r=0;t.length>r;r++){const n=t[r],s=o.get(n)||0;l.push({__likertCategory:e,__likertLevel:n,__likertLevelLabel:n,__likertCount:s,__likertPct:s/i*100,__likertLevelIndex:r})}}return l}function $i(e,t){const o=t.length,i=o%2!=0,r=Math.floor(o/2),n=[];for(const t of e){const e=t.__likertLevelIndex;if(i&&e===r){const e=t.__likertPct/2;n.push({...t,__likertLevel:Wi,__likertPct:-e}),n.push({...t,__likertLevel:zi,__likertPct:e})}else n.push(r>e?{...t,__likertPct:-t.__likertPct}:t)}return n}function qi(e,t){const o=t.length,i=o%2!=0,r=Math.floor(o/2),n=new Map;for(const t of e){const e=n.get(t.__likertCategory)||[];e.push(t),n.set(t.__likertCategory,e)}const s=[];for(const[,e]of n){const t=new Map;let n,a;for(const o of e)o.__likertLevel===Wi?n=o:o.__likertLevel===zi?a=o:t.set(o.__likertLevelIndex,o);i&&n&&s.push(n);for(let e=r-1;e>=0;e--){const o=t.get(e);o&&s.push(o)}i&&a&&s.push(a);for(let e=i?r+1:r;o>e;e++){const o=t.get(e);o&&s.push(o)}}return s}var Xi=["Very Low","Low","Neutral","High","Very High"];import{jsx as Yi}from"react/jsx-runtime";var Qi=new Map,Ki=Li(function(e,t){const i=dt(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=Ii(null),{data:s,margin:a,className:l,categoryAccessor:c="question",valueAccessor:h,levelAccessor:u,countAccessor:d="count",levels:m=Xi,orientation:g="horizontal",colorScheme:p,barPadding:f=20,tooltip:y,annotations:v,valueExtent:b,frameProps:x={},selection:w,linkedHover:A,onObservation:k,onClick:S,hoverHighlight:_,chartId:C,valueFormat:P,loading:R,loadingContent:M,emptyContent:L,legendInteraction:I,legendPosition:T,categoryFormat:H,stroke:B,strokeWidth:F,opacity:O}=e,{width:N,height:D,enableHover:j,showGrid:W,showLegend:z,title:G,description:V,summary:$,accessibleTable:q,categoryLabel:X,valueLabel:Y}=i,Q="horizontal"===g,K=void 0===s,Z=!u,J=bt(),U=Ri(()=>p&&Array.isArray(p)&&p.length>=m.length?p:function(e,t){if(0>=e)return[];if(t){const o=ji[t];if(o){if(1===e)return[o(.5)];const t=[];for(let i=0;e>i;i++)t.push(o(i/(e-1)));return t}}const o=["#da1e28","#ff8389","#ffb3b8"],i=["#a6c8ff","#4589ff","#0043ce"],r="#a8a8a8";if(1===e)return[r];const n=e%2!=0,s=Math.floor(e/2),a=[];for(let e=0;s>e;e++)a.push(o[Math.min(Math.floor(e*o.length/s),o.length-1)]);n&&a.push(r);for(let e=0;s>e;e++)a.push(i[Math.min(Math.floor(e*i.length/s),i.length-1)]);return a}(m.length,J),[p,m.length,J]),ee=Ri(()=>{const e=new Map;for(let t=0;m.length>t;t++)e.set(m[t],U[t]||"#888");return e},[m,U]),{processedData:te,reAggregate:oe,accumulatorRef:ie}=function({data:e,levels:t,categoryAccessor:o,valueAccessor:i,levelAccessor:r,countAccessor:n,isDiverging:s,frameRef:a}){const l=!r,c=Ei(()=>Gi(o,"question"),[o]),h=Ei(()=>l?Gi(i,"score"):null,[l,i]),u=Ei(()=>l?null:Gi(r,"level"),[l,r]),d=Ei(()=>l?null:Gi(n,"count"),[l,n]),m=Di([]);return{processedData:Ei(()=>{const o=e||[];if(0===o.length)return[];let i=Vi(o,t,c,h,u,d);return s&&(i=$i(i,t),i=qi(i,t)),i},[e,t,c,h,u,d,s]),reAggregate:Ni(e=>{let o=Vi(e,t,c,h,u,d);s&&(o=$i(o,t),o=qi(o,t)),a.current?.replace(o)},[t,c,h,u,d,s,a]),accumulatorRef:m}}({data:s,levels:m,categoryAccessor:c,valueAccessor:h,levelAccessor:u,countAccessor:d,isDiverging:Q,frameRef:r}),re="__likertLevelLabel",ne=function({isPushMode:e,colorBy:t,colorScheme:o,showLegend:i,legendPosition:r="right"}){const n=Hi(new Set),s=Hi([]),[a,l]=Bi(0),c=ut(),h=vt(),u=Fi(e=>{if(!t)return null;const o="function"==typeof t?t(e):e[t];return null!=o?o+"":null},[t]),d=Fi(o=>{if(!e||!t)return;let i=!1;for(const e of o){if(!e||"object"!=typeof e)continue;const t=u(e);null==t||n.current.has(t)||(n.current.add(t),s.current.push(t),i=!0)}i&&l(e=>e+1)},[e,t,u]),m=Fi(o=>{if(!e||!t)return;const i=Array.from(new Set(o.map(String))),r=s.current;r.length===i.length&&r.every((e,t)=>e===i[t])||(n.current=new Set(i),s.current=i,l(e=>e+1))},[e,t]),g=Fi(e=>t=>{d([t]),e(t)},[d]),p=Fi(e=>t=>{d(t),e(t)},[d]),f=Fi(()=>{n.current=new Set,s.current=[],l(e=>e+1)},[]);pt(e&&t?s.current:[]);const y=Oi(()=>{if(!e||!t||!1===i)return;const r=s.current;if(0===r.length)return;const n=Array.isArray(o)&&o.length>0||"string"==typeof o&&o.length>0?o:h&&h.length>0?h:ge,a="string"==typeof t?t:"__streamCat",l=r.map(e=>({[a]:e})),u=Me(l,a,n);return Te({data:l,colorBy:a,colorScale:e=>c?.[e]||u(e)||"#999",getColor:Fe})},[e,t,i,o,c,h,a]),v=Oi(()=>{if(y)return"right"===r?{right:110}:"left"===r?{left:110}:"top"===r?{top:50}:"bottom"===r?{bottom:80}:{right:110}},[y,r]);return{wrapPush:g,wrapPushMany:p,resetCategories:f,categories:s.current,categoryDomainProps:e&&t?{legendCategoryAccessor:t,onCategoriesChange:m}:{},streamingLegend:y,streamingMarginAdjust:v}}({isPushMode:K,colorBy:re,colorScheme:U,showLegend:z,legendPosition:T}),{wrapPush:se,wrapPushMany:ae}=ne,le=Mi(e=>se(e=>{ie.current.push(e),oe(ie.current)})(e),[se,oe,ie]),ce=Mi(e=>ae(e=>{ie.current.push(...e),oe(ie.current)})(e),[ae,oe,ie]);Ti(t,()=>({push:le,pushMany:ce,remove:e=>r.current?.remove(e)??[],update:(e,t)=>r.current?.update(e,t)??[],replace:e=>r.current?.replace(e),clear:()=>{ie.current=[],ne.resetCategories(),r.current?.clear()},getData:()=>r.current?.getData()??[],getScales:()=>r.current?.getScales()??null}),[le,ce,ie,ne]);const he=o({data:te,rawData:s,colorBy:re,colorScheme:U,legendInteraction:I,legendPosition:T,selection:w,linkedHover:A,fallbackFields:["__likertLevelLabel"],unwrapData:!0,onObservation:k,onClick:S,hoverHighlight:_,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"LikertChart",chartId:C,showLegend:z,userMargin:a,marginDefaults:i.marginDefaults,loading:R,loadingContent:M,emptyContent:L,width:N,height:D,hasTitle:!!G,axisChrome:{hasAxis:!1!==i.showAxes,hasAxisLabel:Q?!!Y:!!X}}),ue=Ri(()=>{const e=m.length;return e%2!=0&&ee.get(m[Math.floor(e/2)])||"#888"},[m,ee]),de=bi({colorBy:void 0,colorScale:void 0,color:void 0,themeCategorical:void 0,colorScheme:void 0,categoryIndexMap:Qi,userPieceStyle:x?.pieceStyle,stroke:B,strokeWidth:F,opacity:O,effectiveSelectionHook:he.effectiveSelectionHook,resolvedSelection:he.resolvedSelection,baseStyleExtras:e=>{const t=e.__likertLevelLabel||e.data?.__likertLevelLabel,o=e.__likertLevel||e.data?.__likertLevel;if(o===Wi||o===zi)return{fill:ue};const i=t||o;return i&&ee.has(i)?{fill:ee.get(i)}:{fill:"#888"}}}),me=Ri(()=>{const e=m.length;return e%2!=0?m[Math.floor(e/2)]:""},[m]),pe=Ri(()=>e=>{const t=e.data||e,o=t.__likertLevel||"Unknown",i=o===Wi||o===zi?me:o,r=t.__likertCategory||"",n=Math.abs(t.__likertPct||0),s=o===Wi||o===zi?2*n:n,a=t.__likertCount||0;return Pi.createElement("div",{className:"semiotic-tooltip",style:He},Pi.createElement("div",{style:{fontWeight:"bold"}},r),Pi.createElement("div",{style:{marginTop:4}},`${i}: ${s.toFixed(1)}% (n=${a})`))},[me]),fe=Ri(()=>{if(!m||2>m.length)return"LikertChart requires `levels` with at least 2 entries.";if(h&&u)return"LikertChart: provide either `valueAccessor` (raw responses) or `levelAccessor` + `countAccessor` (pre-aggregated), not both.";if(u&&!d)return"LikertChart: pre-aggregated mode requires both `levelAccessor` and `countAccessor`.";if(void 0!==s&&0===s.length)return null;const e={categoryAccessor:c};return Z?h&&(e.valueAccessor=h):(u&&(e.levelAccessor=u),d&&(e.countAccessor=d)),n({componentName:"LikertChart",data:s,accessors:e,requiredProps:{levels:m}})},[s,c,h,u,d,m,Z]),ye=Ri(()=>[{styleFn:e=>({fill:ee.get(e.label)||"#888"}),items:m.map(e=>({label:e})),label:""}],[m,ee]),ve=Ri(()=>!1!==z?{...he.legendBehaviorProps,legend:{legendGroups:ye},legendPosition:T||he.legendPosition||"bottom"}:he.legendBehaviorProps,[he.legendBehaviorProps,he.legendPosition,T,z,ye]),be=Ri(()=>{const e={...he.margin};if(K&&!1!==z){const t=T||"bottom";"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(ne.streamingMarginAdjust)for(const[t,o]of Object.entries(ne.streamingMarginAdjust))o>e[t]&&(e[t]=o);return Q&&100>e.left&&(e.left=100),e},[he.margin,ne.streamingMarginAdjust,Q,K,z,T]),xe=Ri(()=>P||(Q?e=>Math.abs(Number(e)).toFixed(0)+"%":e=>Number(e).toFixed(0)+"%"),[Q,P]);if(he.earlyReturn)return he.earlyReturn;const we={chartType:"bar",...null!=s&&{data:te},oAccessor:"__likertCategory",rAccessor:"__likertPct",stackBy:"__likertLevel",normalize:!1,projection:Q?"horizontal":"vertical",pieceStyle:de,size:[N,D],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:be,barPadding:f,enableHover:j,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:X,rLabel:Y||(Q?void 0:"Percentage"),rFormat:xe,...H&&{oFormat:H},showGrid:W,...ve,...G&&{title:G},...V&&{description:V},...$&&{summary:$},...void 0!==q&&{accessibleTable:q},...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?pe:Ke(y)||pe,...E({linkedHover:A,selection:w,onObservation:k,onClick:S,hoverHighlight:_,mobileInteraction:he.mobileInteraction,customHoverBehavior:he.customHoverBehavior,customClickBehavior:he.customClickBehavior}),...v&&v.length>0&&{annotations:v},...b&&{rExtent:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};return fe?Yi(_t,{componentName:"LikertChart",message:fe,width:N,height:D}):Yi(Ct,{componentName:"LikertChart",width:N,height:D,children:Yi(li,{ref:r,...we})})});Ki.displayName="LikertChart";import{useMemo as Zi,forwardRef as Ji,useRef as Ui}from"react";import{useCallback as er,useRef as tr}from"react";function or({brushProp:e,onBrushProp:t,linkedBrush:o,valueAccessor:i}){const r=Qe("string"==typeof o?o:o?{name:o.name,xField:o.rField}:void 0),n="string"==typeof i?i:"value",s=ht({name:r?.name||"__unused_ordinal_brush__",xField:r?.xField||n}),a=tr(s.brushInteraction);a.current=s.brushInteraction;const l=er(e=>{if(r){a.current.end(e?e.r:null)}t?.(e)},[t,r]),c=!!(e||o||t);return{hasBrush:c,handleBrush:l,brushStreamProps:c?{brush:{dimension:"r"},onBrush:l}:{}}}import{jsx as ir}from"react/jsx-runtime";var rr=Ji(function(e,t){const i=dt(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}),s=Ui(null);r(t,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="vertical",valueFormat:m,colorBy:g,colorScheme:p,sizeBy:f,sizeRange:y=[3,8],symbolBy:v,symbolMap:b,pointRadius:x=4,pointOpacity:w=.7,categoryPadding:A=20,tooltip:k,annotations:S,valueExtent:_,brush:C,onBrush:P,linkedBrush:R,frameProps:M={},selection:L,linkedHover:I,onObservation:T,onClick:H,hoverHighlight:B,chartId:F,loading:N,loadingContent:W,emptyContent:z,legendInteraction:G,legendPosition:V,color:$,stroke:q,strokeWidth:X,opacity:Y,showCategoryTicks:Q,categoryFormat:K}=e,{width:Z,height:J,enableHover:U,showGrid:ee,showLegend:te,title:oe,description:ie,summary:re,accessibleTable:ne,categoryLabel:se,valueLabel:ae}=i,le=Zi(()=>Be(a),[a]),ce=o({data:le,rawData:a,colorBy:g,colorScheme:p,legendInteraction:G,legendPosition:V,selection:L,linkedHover:I,fallbackFields:g?["string"==typeof g?g:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:T,onClick:H,hoverHighlight:B,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"SwarmPlot",chartId:F,showLegend:te,userMargin:l,marginDefaults:i.marginDefaults,loading:N,loadingContent:W,emptyContent:z,width:Z,height:J,hasTitle:!!oe,axisChrome:st({showAxes:i.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!!se,hasValueLabel:!!ae})}),he=or({brushProp:C,onBrushProp:P,linkedBrush:R,valueAccessor:u}),ue=Zi(()=>{if(!f)return;const e=le.map(e=>"function"==typeof f?f(e):e[f]);return At(e)},[le,f]),de=vt(),me=Zi(()=>new Map,[]),ge=bi({colorBy:g,colorScale:ce.colorScale,color:$,themeCategorical:de,colorScheme:p,categoryIndexMap:me,userPieceStyle:M?.pieceStyle,stroke:q,strokeWidth:X,opacity:Y,effectiveSelectionHook:ce.effectiveSelectionHook,resolvedSelection:ce.resolvedSelection,baseStyleExtras:e=>({fillOpacity:w,r:f?Ee(e,f,y,ue):x})}),pe=Zi(()=>D({categoryAccessor:h,valueAccessor:u,groupAccessor:g||void 0,valueFormat:m}),[h,u,g,m]);if(ce.earlyReturn)return ce.earlyReturn;const fe=n({componentName:"SwarmPlot",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(fe)return ir(_t,{componentName:"SwarmPlot",message:fe,width:Z,height:J});const ye={chartType:"swarm",...null!=a&&{data:le},oAccessor:h,rAccessor:u,...v&&{symbolAccessor:v},...b&&{symbolMap:b},projection:"horizontal"===d?"horizontal":"vertical",pieceStyle:ge,size:[Z,J],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ce.margin,barPadding:A,enableHover:U,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:se,rLabel:ae,rFormat:m,...K&&{oFormat:K},showGrid:ee,showCategoryTicks:Q,...ce.legendBehaviorProps,...O({title:oe,description:ie,summary:re,accessibleTable:ne,className:c,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...j({tooltip:k,defaultTooltipContent:pe}),...E({linkedHover:I,selection:L,onObservation:T,onClick:H,hoverHighlight:B,mobileInteraction:ce.mobileInteraction,customHoverBehavior:ce.customHoverBehavior,customClickBehavior:ce.customClickBehavior}),...S&&S.length>0&&{annotations:S},..._&&{rExtent:_},...he.brushStreamProps,...Object.fromEntries(Object.entries(M).filter(([e])=>"pieceStyle"!==e))};return ir(Ct,{componentName:"SwarmPlot",width:Z,height:J,children:ir(li,{ref:s,...ye})})});rr.displayName="SwarmPlot";import{useMemo as nr,forwardRef as sr,useRef as ar}from"react";import{jsx as lr,jsxs as cr}from"react/jsx-runtime";function hr(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 cr("div",{className:"semiotic-tooltip",style:He,children:[o&&lr("div",{style:{fontWeight:"bold"},children:o+""}),null!=i.n&&cr("div",{children:["n = ",i.n]}),null!=i.min&&cr("div",{children:["Min: ",i.min.toLocaleString()]}),null!=i.q1&&cr("div",{children:["Q1: ",i.q1.toLocaleString()]}),cr("div",{children:["Median: ",i.median.toLocaleString()]}),null!=i.q3&&cr("div",{children:["Q3: ",i.q3.toLocaleString()]}),null!=i.max&&cr("div",{children:["Max: ",i.max.toLocaleString()]}),null!=i.mean&&cr("div",{style:{opacity:.8},children:["Mean: ",i.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});if(e?.valueAccessor){const i=e.valueAccessor,r=(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),n=r.length,s=n>0?n%2!=0?r[Math.floor(n/2)]:(r[n/2-1]+r[n/2])/2:null;return cr("div",{className:"semiotic-tooltip",style:He,children:[o&&lr("div",{style:{fontWeight:"bold"},children:o+""}),n>0&&cr("div",{children:["n = ",n]}),null!=s&&cr("div",{children:["Median: ",s.toLocaleString()]})]})}return lr("div",{className:"semiotic-tooltip",style:He,children:lr("div",{style:{fontWeight:"bold"},children:o+""})})}}import{jsx as ur}from"react/jsx-runtime";var dr=sr(function(e,t){const i=dt(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}),s=ar(null);r(t,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="vertical",valueFormat:m,colorBy:g,colorScheme:p,showOutliers:f=!0,outlierRadius:y=3,categoryPadding:v=20,tooltip:b,annotations:x,valueExtent:w,frameProps:A={},selection:k,linkedHover:S,onObservation:_,onClick:C,hoverHighlight:P,chartId:R,loading:M,loadingContent:L,emptyContent:I,legendInteraction:T,legendPosition:H,color:B,stroke:F,strokeWidth:N,opacity:D,showCategoryTicks:W,categoryFormat:z}=e,{width:G,height:V,enableHover:$,showGrid:q,showLegend:X,title:Y,description:Q,summary:K,accessibleTable:Z,categoryLabel:J,valueLabel:U}=i,ee=nr(()=>Be(a),[a]),te=o({data:ee,rawData:a,colorBy:g,colorScheme:p,legendInteraction:T,legendPosition:H,selection:k,linkedHover:S,fallbackFields:g?["string"==typeof g?g:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:_,onClick:C,hoverHighlight:P,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"BoxPlot",chartId:R,showLegend:X,userMargin:l,marginDefaults:i.marginDefaults,loading:M,loadingContent:L,emptyContent:I,width:G,height:V,hasTitle:!!Y,axisChrome:st({showAxes:i.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!!J,hasValueLabel:!!U})}),oe=vt(),ie=nr(()=>new Map,[]),re=bi({colorBy:g,colorScale:te.colorScale,color:B,themeCategorical:oe,colorScheme:p,categoryIndexMap:ie,userPieceStyle:void 0,stroke:F,strokeWidth:N,opacity:D,effectiveSelectionHook:te.effectiveSelectionHook,resolvedSelection:te.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0}),ne=nr(()=>hr(),[]);if(te.earlyReturn)return te.earlyReturn;const se=n({componentName:"BoxPlot",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(se)return ur(_t,{componentName:"BoxPlot",message:se,width:G,height:V});const ae={chartType:"boxplot",...null!=a&&{data:ee},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",summaryStyle:re,showOutliers:f,size:[G,V],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:te.margin,barPadding:v,enableHover:$,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:J,rLabel:U,rFormat:m,...z&&{oFormat:z},showGrid:q,showCategoryTicks:W,...te.legendBehaviorProps,...O({title:Y,description:Q,summary:K,accessibleTable:Z,className:c,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...j({tooltip:b,defaultTooltipContent:ne}),...E({linkedHover:S,selection:k,onObservation:_,onClick:C,hoverHighlight:P,mobileInteraction:te.mobileInteraction,customHoverBehavior:te.customHoverBehavior,customClickBehavior:te.customClickBehavior}),...x&&x.length>0&&{annotations:x},...w&&{rExtent:w},...Object.fromEntries(Object.entries(A).filter(([e])=>"pieceStyle"!==e))};return ur(Ct,{componentName:"BoxPlot",width:G,height:V,children:ur(li,{ref:s,...ae})})});dr.displayName="BoxPlot";import{useMemo as mr,forwardRef as gr,useRef as pr}from"react";import{jsx as fr,jsxs as yr}from"react/jsx-runtime";var vr=e=>{const t=e?.category;return null==t?"All":t+""},br=gr(function(e,t){const i=dt(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}),s=pr(null);r(t,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,categoryAccessor:h=vr,valueAccessor:u="value",bins:d=25,relative:m=!1,valueFormat:g,colorBy:p,colorScheme:f,categoryPadding:y=("sparkline"===i.mode?0:20),tooltip:v,annotations:b,valueExtent:x,brush:w,onBrush:A,linkedBrush:k,frameProps:S={},selection:_,linkedHover:C,onObservation:P,onClick:R,hoverHighlight:M,chartId:L,loading:I,loadingContent:T,emptyContent:H,legendInteraction:B,legendPosition:F,color:N,stroke:D,strokeWidth:W,opacity:z,showCategoryTicks:G,categoryFormat:V}=e,{width:$,height:q,enableHover:X,showGrid:Y,showLegend:Q,title:K,description:Z,summary:J,accessibleTable:U,categoryLabel:ee,valueLabel:te}=i,oe=mr(()=>Be(a),[a]),ie=o({data:oe,rawData:a,colorBy:p,colorScheme:f,legendInteraction:B,legendPosition:F,selection:_,linkedHover:C,fallbackFields:p?["string"==typeof p?p:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"Histogram",chartId:L,showLegend:Q,userMargin:l,marginDefaults:i.marginDefaults,loading:I,loadingContent:T,emptyContent:H,width:$,height:q,hasTitle:!!K,axisChrome:st({showAxes:i.showAxes,projection:"horizontal",hasCategoryLabel:!!ee,hasValueLabel:!!te})}),re=or({brushProp:w,onBrushProp:A,linkedBrush:k,valueAccessor:u}),ne=mr(()=>{if(0===oe.length)return;const e="function"==typeof u?u:e=>e[u];let t=1/0,o=-1/0;for(const i of oe){const r=e(i);null!=r&&isFinite(r)&&(t>r&&(t=r),r>o&&(o=r))}return t>o?void 0:[t,o]},[oe,u]),se=vt(),ae=mr(()=>new Map,[]),le=bi({colorBy:p,colorScale:ie.colorScale,color:N,themeCategorical:se,colorScheme:f,categoryIndexMap:ae,userPieceStyle:void 0,stroke:D,strokeWidth:W,opacity:z,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0}),ce=mr(()=>e=>{const t=e.data||e,o=t.category||e.category||"",i=t.count,r=t.range;return yr("div",{className:"semiotic-tooltip",style:He,children:[o&&fr("div",{style:{fontWeight:"bold"},children:o+""}),null!=i&&yr("div",{children:["Count: ",i]}),r&&2===r.length&&yr("div",{style:{opacity:.8},children:[Number(r[0]).toFixed(1)," – ",Number(r[1]).toFixed(1)]})]})},[]);if(ie.earlyReturn)return ie.earlyReturn;const he=n({componentName:"Histogram",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(he)return fr(_t,{componentName:"Histogram",message:he,width:$,height:q});const ue={chartType:"histogram",...null!=a&&{data:oe},oAccessor:h,rAccessor:u,projection:"horizontal",summaryStyle:le,bins:d,normalize:m,...x?{rExtent:x}:ne&&{rExtent:ne},size:[$,q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ie.margin,barPadding:y,enableHover:X,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:ee,rLabel:te,rFormat:g,...V&&{oFormat:V},showGrid:Y,showCategoryTicks:G,...ie.legendBehaviorProps,...O({title:K,description:Z,summary:J,accessibleTable:U,className:c,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...j({tooltip:v,defaultTooltipContent:ce}),...E({linkedHover:C,selection:_,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...b&&b.length>0&&{annotations:b},...re.brushStreamProps,...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return fr(Ct,{componentName:"Histogram",width:$,height:q,children:fr(li,{ref:s,...ue})})});br.displayName="Histogram";import{useMemo as xr,forwardRef as wr,useRef as Ar}from"react";import{jsx as kr}from"react/jsx-runtime";var Sr=wr(function(e,t){const i=dt(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}),s=Ar(null);r(t,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="vertical",bins:m=25,curve:g="catmullRom",showIQR:p=!0,valueFormat:f,colorBy:y,colorScheme:v,categoryPadding:b=20,tooltip:x,annotations:w,valueExtent:A,brush:k,onBrush:S,linkedBrush:_,frameProps:C={},selection:P,linkedHover:R,onObservation:M,onClick:L,hoverHighlight:I,chartId:T,loading:H,loadingContent:B,emptyContent:F,legendInteraction:N,legendPosition:D,color:W,stroke:z,strokeWidth:G,opacity:V,showCategoryTicks:$,categoryFormat:q}=e,{width:X,height:Y,enableHover:Q,showGrid:K,showLegend:Z,title:J,description:U,summary:ee,accessibleTable:te,categoryLabel:oe,valueLabel:ie}=i,re=xr(()=>Be(a),[a]),ne=o({data:re,rawData:a,colorBy:y,colorScheme:v,legendInteraction:N,legendPosition:D,selection:P,linkedHover:R,fallbackFields:y?["string"==typeof y?y:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:M,onClick:L,hoverHighlight:I,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"ViolinPlot",chartId:T,showLegend:Z,userMargin:l,marginDefaults:i.marginDefaults,loading:H,loadingContent:B,emptyContent:F,width:X,height:Y,hasTitle:!!J,axisChrome:st({showAxes:i.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!!oe,hasValueLabel:!!ie})}),se=or({brushProp:k,onBrushProp:S,linkedBrush:_,valueAccessor:u}),ae=vt(),le=xr(()=>new Map,[]),ce=bi({colorBy:y,colorScale:ne.colorScale,color:W,themeCategorical:ae,colorScheme:v,categoryIndexMap:le,userPieceStyle:void 0,stroke:z,strokeWidth:G,opacity:V,effectiveSelectionHook:ne.effectiveSelectionHook,resolvedSelection:ne.resolvedSelection,baseStyleExtras:{fillOpacity:.6},linkStrokeToFill:!0}),he=xr(()=>hr({valueAccessor:u}),[u]);if(ne.earlyReturn)return ne.earlyReturn;const ue=n({componentName:"ViolinPlot",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(ue)return kr(_t,{componentName:"ViolinPlot",message:ue,width:X,height:Y});const de={chartType:"violin",...null!=a&&{data:re},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",summaryStyle:ce,bins:m,showIQR:p,size:[X,Y],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ne.margin,barPadding:b,enableHover:Q,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:oe,rLabel:ie,rFormat:f,...q&&{oFormat:q},showGrid:K,showCategoryTicks:$,...ne.legendBehaviorProps,...O({title:J,description:U,summary:ee,accessibleTable:te,className:c,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...j({tooltip:x,defaultTooltipContent:he}),...E({linkedHover:R,selection:P,onObservation:M,onClick:L,hoverHighlight:I,mobileInteraction:ne.mobileInteraction,customHoverBehavior:ne.customHoverBehavior,customClickBehavior:ne.customClickBehavior}),...w&&w.length>0&&{annotations:w},...A&&{rExtent:A},...se.brushStreamProps,...Object.fromEntries(Object.entries(C).filter(([e])=>"pieceStyle"!==e))};return kr(Ct,{componentName:"ViolinPlot",width:X,height:Y,children:kr(li,{ref:s,...de})})});Sr.displayName="ViolinPlot";import{useMemo as _r,forwardRef as Cr,useRef as Pr}from"react";import{jsx as Rr}from"react/jsx-runtime";var Mr=Cr(function(e,t){const i=dt(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}),s=Pr(null);r(t,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="horizontal",bins:m=20,amplitude:g=1.5,valueFormat:p,colorBy:f,colorScheme:y,categoryPadding:v=5,tooltip:b,annotations:x,valueExtent:w,frameProps:A={},selection:k,linkedHover:S,onObservation:_,onClick:C,hoverHighlight:P,chartId:R,loading:M,loadingContent:L,emptyContent:I,legendInteraction:T,legendPosition:H,color:B,stroke:F,strokeWidth:N,opacity:D,showCategoryTicks:W,categoryFormat:z}=e,{width:G,height:V,enableHover:$,showGrid:q,showLegend:X,title:Y,description:Q,summary:K,accessibleTable:Z,categoryLabel:J,valueLabel:U}=i,ee=_r(()=>Be(a),[a]),te=o({data:ee,rawData:a,colorBy:f,colorScheme:y,legendInteraction:T,legendPosition:H,selection:k,linkedHover:S,fallbackFields:f?["string"==typeof f?f:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:_,onClick:C,hoverHighlight:P,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"RidgelinePlot",chartId:R,showLegend:X,userMargin:l,marginDefaults:i.marginDefaults,loading:M,loadingContent:L,emptyContent:I,width:G,height:V,hasTitle:!!Y,axisChrome:st({showAxes:i.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!!J,hasValueLabel:!!U})}),oe=vt(),ie=_r(()=>new Map,[]),re=bi({colorBy:f,colorScale:te.colorScale,color:B,themeCategorical:oe,colorScheme:y,categoryIndexMap:ie,userPieceStyle:void 0,stroke:F,strokeWidth:N,opacity:D,effectiveSelectionHook:te.effectiveSelectionHook,resolvedSelection:te.resolvedSelection,baseStyleExtras:{fillOpacity:.5},linkStrokeToFill:!0}),ne=_r(()=>hr(),[]);if(te.earlyReturn)return te.earlyReturn;const se=n({componentName:"RidgelinePlot",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(se)return Rr(_t,{componentName:"RidgelinePlot",message:se,width:G,height:V});const ae={chartType:"ridgeline",...null!=a&&{data:ee},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",summaryStyle:re,bins:m,size:[G,V],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:te.margin,barPadding:v,enableHover:$,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:J,rLabel:U,rFormat:p,...z&&{oFormat:z},showGrid:q,showCategoryTicks:W,oSort:!1,amplitude:g,...te.legendBehaviorProps,...O({title:Y,description:Q,summary:K,accessibleTable:Z,className:c,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...j({tooltip:b,defaultTooltipContent:ne}),...E({linkedHover:S,selection:k,onObservation:_,onClick:C,hoverHighlight:P,mobileInteraction:te.mobileInteraction,customHoverBehavior:te.customHoverBehavior,customClickBehavior:te.customClickBehavior}),...x&&x.length>0&&{annotations:x},...w&&{rExtent:w},...Object.fromEntries(Object.entries(A).filter(([e])=>"pieceStyle"!==e))};return Rr(Ct,{componentName:"RidgelinePlot",width:G,height:V,children:Rr(li,{ref:s,...ae})})});Mr.displayName="RidgelinePlot";import{useMemo as Lr,forwardRef as Ir,useRef as Tr}from"react";import{jsx as Hr,jsxs as Br}from"react/jsx-runtime";var Fr=Ir(function(e,t){const i=dt(e.mode,{width:e.width,height:e.height,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}),s=Tr(null);r(t,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,stepAccessor:h="step",valueAccessor:u="value",categoryAccessor:d,colorBy:m,colorScheme:g,orientation:p="horizontal",connectorOpacity:f=.3,showLabels:y=!0,tooltip:v,annotations:b,frameProps:x={},selection:w,linkedHover:A,onObservation:k,onClick:S,hoverHighlight:_,chartId:C,loading:P,loadingContent:R,emptyContent:M,legendInteraction:L,legendPosition:I,color:T,stroke:H,strokeWidth:B,opacity:F,categoryFormat:O}=e,N="vertical"===p,{width:D,height:j,enableHover:W,showLegend:z,title:G,description:V,summary:$,accessibleTable:q}=i,X=N?{top:G?60:40,right:20,bottom:60,left:60}:{top:G?40:10,right:10,bottom:10,left:10},Y=Lr(()=>Be(a),[a]),Q=m||d,K=!Q,Z=o({data:Y,rawData:a,colorBy:Q,colorScheme:g,legendInteraction:L,legendPosition:I,selection:w,linkedHover:A,fallbackFields:Q?["string"==typeof Q?Q:""]:[],unwrapData:!0,onObservation:k,onClick:S,hoverHighlight:_,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"FunnelChart",chartId:C,showLegend:z,userMargin:l,marginDefaults:X,loading:P,loadingContent:R,emptyContent:M,width:D,height:j,hasTitle:!!G,axisChrome:st({showAxes:N,projection:N?"vertical":"horizontal",hasCategoryLabel:!1,hasValueLabel:!1})});Mt("FunnelChart",Y,"stepAccessor",h),Mt("FunnelChart",Y,"valueAccessor",u);const J=vt(),U=Lr(()=>new Map,[]),ee=Lr(()=>{if(K)return T||(J?.[0]?J[0]:Array.isArray(g)&&g[0]?g[0]:"#4e79a7")},[K,T,J,g]),te=bi({colorBy:ee?void 0:Q,colorScale:Z.colorScale,color:ee??T,themeCategorical:J,colorScheme:g,categoryIndexMap:U,userPieceStyle:x?.pieceStyle,stroke:H,strokeWidth:B,opacity:F,effectiveSelectionHook:Z.effectiveSelectionHook,resolvedSelection:Z.resolvedSelection}),oe=Lr(()=>e=>{const t=e?.data||e,o=t?.__funnelStep||t?.__barFunnelStep||t?.step||"",i=t?.__funnelValue??t?.__barFunnelValue??t?.value??"",r=t?.__funnelPercent??t?.__barFunnelPercent,n=t?.__funnelIsFirstStep??t?.__barFunnelIsFirstStep,s=t?.__barFunnelIsDropoff,a=t?.__barFunnelCategory??t?.category,l=null==r||n?"":` (${.05>Math.abs(r-Math.round(r))?Math.round(r)+"%":r.toFixed(1)+"%"})`;return Br("div",{className:"semiotic-tooltip",style:He,children:[o&&Hr("div",{style:{fontWeight:"bold"},children:o+""}),a&&a!==o&&Hr("div",{style:{marginTop:2,opacity:.8},children:a+""}),s&&Hr("div",{style:{marginTop:2,fontStyle:"italic",opacity:.7},children:"Dropoff"}),Br("div",{style:{marginTop:4},children:[i+"",l]})]})},[]);if(Z.earlyReturn)return Z.earlyReturn;const ie=n({componentName:"FunnelChart",data:a,accessors:{stepAccessor:h,valueAccessor:u}});if(ie)return Hr(_t,{componentName:"FunnelChart",message:ie,width:D,height:j});const re={chartType:N?"bar-funnel":"funnel",...null!=a&&{data:Y},oAccessor:h,rAccessor:u,...d&&{stackBy:d},projection:N?"vertical":"horizontal",barPadding:N?40:0,pieceStyle:te,size:[D,j],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Z.margin,enableHover:W,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:N,showCategoryTicks:N,...O&&{oFormat:O},showGrid:N,...!N&&{connectorOpacity:f},showLabels:y,...Z.legendBehaviorProps,...G&&{title:G},...V&&{description:V},...$&&{summary:$},...void 0!==q&&{accessibleTable:q},...c&&{className:c},...null!=e.animate&&{animate:e.animate},tooltipContent:!1===v?()=>null:!0===v||null==v?oe:Ke(v)||oe,...E({linkedHover:A,selection:w,onObservation:k,onClick:S,hoverHighlight:_,mobileInteraction:Z.mobileInteraction,customHoverBehavior:Z.customHoverBehavior,customClickBehavior:Z.customClickBehavior}),...b&&b.length>0&&{annotations:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};return Hr(Ct,{componentName:"FunnelChart",width:D,height:j,children:Hr(li,{ref:s,...re})})});Fr.displayName="FunnelChart";import{useMemo as Or,forwardRef as Er,useRef as Nr}from"react";import{jsx as Dr}from"react/jsx-runtime";var jr=Er(function(t,i){const s=dt(t.mode,{width:t.width,height:t.height,showGrid:t.showGrid??!0,enableHover:t.enableHover,showLegend:t.showLegend,title:t.title,description:t.description,accessibleTable:t.accessibleTable,summary:t.summary,categoryLabel:t.categoryLabel,valueLabel:t.valueLabel,showCategoryTicks:t.showCategoryTicks,orientation:t.orientation,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules}),a=Nr(null);r(i,{variant:"xy",frameRef:a});const{data:l,margin:c,className:h,categoryAccessor:u="category",valueAccessor:d="value",orientation:m="horizontal",valueFormat:g,colorBy:p,colorScheme:f,sort:y="auto",dotRadius:v=5,categoryPadding:b=10,tooltip:x,annotations:w,regression:A,valueExtent:k,frameProps:S={},selection:_,linkedHover:C,onObservation:P,onClick:R,hoverHighlight:M,chartId:L,loading:I,loadingContent:T,emptyContent:H,legendInteraction:B,legendPosition:F,color:N,stroke:W,strokeWidth:z,opacity:G,categoryFormat:V}=t,{width:$,height:q,enableHover:X,showGrid:Y,showLegend:Q,title:K,description:Z,summary:J,accessibleTable:U,categoryLabel:ee,valueLabel:te}=s,oe=Or(()=>Be(l),[l]),ie=o({data:oe,rawData:l,colorBy:p,colorScheme:f,legendInteraction:B,legendPosition:F,selection:_,linkedHover:C,fallbackFields:p?["string"==typeof p?p:""]:["string"==typeof u?u:""],unwrapData:!0,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:s.mobileInteraction,mobileSemantics:s.mobileSemantics,chartType:"DotPlot",chartId:L,showLegend:Q,userMargin:c,marginDefaults:s.marginDefaults,loading:I,loadingContent:T,emptyContent:H,width:$,height:q,hasTitle:!!K,axisChrome:st({showAxes:s.showAxes,projection:"horizontal"===m?"horizontal":"vertical",hasCategoryLabel:!!ee,hasValueLabel:!!te})}),re=yt(oe,y,d),ne=vt(),se=Or(()=>new Map,[]),ae=bi({colorBy:p,colorScale:ie.colorScale,color:N,themeCategorical:ne,colorScheme:f,categoryIndexMap:se,userPieceStyle:S?.pieceStyle,stroke:W,strokeWidth:z,opacity:G,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection,baseStyleExtras:{r:v,fillOpacity:.8}}),le=Or(()=>D({categoryAccessor:u,valueAccessor:d,valueFormat:g}),[u,d,g]);if(ie.earlyReturn)return ie.earlyReturn;const ce=n({componentName:"DotPlot",data:l,accessors:{categoryAccessor:u,valueAccessor:d}});if(ce)return Dr(_t,{componentName:"DotPlot",message:ce,width:$,height:q});const he=e(A),ue=he?[he,...w||[]]:w,de={chartType:"point",...null!=l&&{data:re},oAccessor:u,rAccessor:d,projection:"horizontal"===m?"horizontal":"vertical",pieceStyle:ae,size:[$,q],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:ie.margin,barPadding:b,enableHover:X,...t.dataIdAccessor&&{dataIdAccessor:t.dataIdAccessor},showAxes:s.showAxes,oLabel:ee,rLabel:te,rFormat:g,...V&&{oFormat:V},showGrid:Y,oSort:y,...ie.legendBehaviorProps,...O({title:K,description:Z,summary:J,accessibleTable:U,className:h,animate:t.animate,axisExtent:t.axisExtent,autoPlaceAnnotations:t.autoPlaceAnnotations}),...j({tooltip:x,defaultTooltipContent:le}),...E({linkedHover:C,selection:_,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...ue&&ue.length>0&&{annotations:ue},...k&&{rExtent:k},...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return Dr(Ct,{componentName:"DotPlot",width:$,height:q,children:Dr(li,{ref:a,...de})})});jr.displayName="DotPlot";import{useMemo as Wr,forwardRef as zr,useRef as Gr}from"react";import{jsx as Vr}from"react/jsx-runtime";var $r=zr(function(e,t){const i=dt(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}),r=Gr(null),{data:s,margin:a,className:l,categoryAccessor:c="category",valueAccessor:h="value",colorBy:u,colorScheme:d,startAngle:m=0,cornerRadius:g,tooltip:p,annotations:f,frameProps:y={},selection:v,linkedHover:b,onObservation:x,onClick:w,hoverHighlight:A,chartId:k,loading:S,loadingContent:_,emptyContent:C,legendInteraction:P,legendPosition:R,color:M,stroke:L,strokeWidth:I,opacity:T}=e,{width:H,height:B,enableHover:F,showLegend:N,title:W,description:z,summary:G,accessibleTable:V}=i,$=Wr(()=>Be(s),[s]),q=u||c,X=o({data:$,rawData:s,colorBy:q,colorScheme:d,legendInteraction:P,legendPosition:R,selection:v,linkedHover:b,fallbackFields:q?["string"==typeof q?q:""]:[],unwrapData:!0,onObservation:x,onClick:w,hoverHighlight:A,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"PieChart",chartId:k,showLegend:N,userMargin:a,marginDefaults:i.marginDefaults,loading:S,loadingContent:_,emptyContent:C,width:H,height:B,hasTitle:!!W,axisChrome:{hasAxis:!1}}),Y=vt(),Q=Wr(()=>new Map,[]),K=bi({colorBy:q,colorScale:X.colorScale,color:M,themeCategorical:Y,colorScheme:d,categoryIndexMap:Q,userPieceStyle:y?.pieceStyle,stroke:L,strokeWidth:I,opacity:T,effectiveSelectionHook:X.effectiveSelectionHook,resolvedSelection:X.resolvedSelection,cycleByCategory:!0}),Z=Wr(()=>D({categoryAccessor:c,valueAccessor:h,groupAccessor:u&&u!==c?u:void 0,groupLabel:"string"==typeof u?u:"group",pieData:!0}),[c,h,u]),J=n({componentName:"PieChart",data:s,accessors:{categoryAccessor:c,valueAccessor:h}}),{effectiveLegendProps:U,effectiveMargin:ee}=yi({ref:t,frameRef:r,setup:X});if(X.earlyReturn)return X.earlyReturn;const te={chartType:"pie",...null!=s&&{data:$},oAccessor:c,rAccessor:h,projection:"radial",pieceStyle:K,startAngle:m,...null!=g&&{cornerRadius:g},size:[H,B],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ee,enableHover:F,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...U,...O({title:W,description:z,summary:G,accessibleTable:V,className:l,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...j({tooltip:p,defaultTooltipContent:Z}),...E({linkedHover:b,selection:v,onObservation:x,onClick:w,hoverHighlight:A,mobileInteraction:X.mobileInteraction,customHoverBehavior:X.customHoverBehavior,customClickBehavior:X.customClickBehavior}),...f&&f.length>0&&{annotations:f},...Object.fromEntries(Object.entries(y).filter(([e])=>"pieceStyle"!==e))};return J?Vr(_t,{componentName:"PieChart",message:J,width:H,height:B}):Vr(Ct,{componentName:"PieChart",width:H,height:B,children:Vr(li,{ref:r,...te})})});$r.displayName="PieChart";import{useMemo as qr,forwardRef as Xr,useRef as Yr}from"react";import{jsx as Qr}from"react/jsx-runtime";var Kr=Xr(function(e,t){const i=dt(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}),r=Yr(null),{data:s,margin:a,className:l,categoryAccessor:c="category",valueAccessor:h="value",innerRadius:u,centerContent:d,colorBy:m,colorScheme:g,startAngle:p=0,cornerRadius:f,tooltip:y,annotations:v,frameProps:b={},selection:x,linkedHover:w,onObservation:A,onClick:k,hoverHighlight:S,chartId:_,loading:C,loadingContent:P,emptyContent:R,legendInteraction:M,legendPosition:L,color:I,stroke:T,strokeWidth:H,opacity:B}=e,{width:F,height:N,enableHover:W,showLegend:z,title:G,description:V,summary:$,accessibleTable:q}=i,X=qr(()=>Be(s),[s]),Y=m||c,Q=o({data:X,rawData:s,colorBy:Y,colorScheme:g,legendInteraction:M,legendPosition:L,selection:x,linkedHover:w,fallbackFields:Y?["string"==typeof Y?Y:""]:[],unwrapData:!0,onObservation:A,onClick:k,hoverHighlight:S,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"DonutChart",chartId:_,showLegend:z,userMargin:a,marginDefaults:i.marginDefaults,loading:C,loadingContent:P,emptyContent:R,width:F,height:N,hasTitle:!!G,axisChrome:{hasAxis:!1}}),K=u??Math.max(2,.15*Math.min(F,N)),Z=vt(),J=qr(()=>new Map,[]),U=bi({colorBy:Y,colorScale:Q.colorScale,color:I,themeCategorical:Z,colorScheme:g,categoryIndexMap:J,userPieceStyle:b?.pieceStyle,stroke:T,strokeWidth:H,opacity:B,effectiveSelectionHook:Q.effectiveSelectionHook,resolvedSelection:Q.resolvedSelection,cycleByCategory:!0}),ee=qr(()=>D({categoryAccessor:c,valueAccessor:h,groupAccessor:m&&m!==c?m:void 0,groupLabel:"string"==typeof m?m:"group",pieData:!0}),[c,h,m]),te=n({componentName:"DonutChart",data:s,accessors:{categoryAccessor:c,valueAccessor:h}}),{effectiveLegendProps:oe,effectiveMargin:ie}=yi({ref:t,frameRef:r,setup:Q});if(Q.earlyReturn)return Q.earlyReturn;const re={chartType:"donut",...null!=s&&{data:X},oAccessor:c,rAccessor:h,projection:"radial",pieceStyle:U,innerRadius:K,startAngle:p,...null!=f&&{cornerRadius:f},centerContent:d,size:[F,N],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ie,enableHover:W,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...oe,...O({title:G,description:V,summary:$,accessibleTable:q,className:l,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...j({tooltip:y,defaultTooltipContent:ee}),...E({linkedHover:w,selection:x,onObservation:A,onClick:k,hoverHighlight:S,mobileInteraction:Q.mobileInteraction,customHoverBehavior:Q.customHoverBehavior,customClickBehavior:Q.customClickBehavior}),...v&&v.length>0&&{annotations:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e))};return te?Qr(_t,{componentName:"DonutChart",message:te,width:F,height:N}):Qr(Ct,{componentName:"DonutChart",width:F,height:N,children:Qr(li,{ref:r,...re})})});Kr.displayName="DonutChart";import{useMemo as Zr,forwardRef as Jr,useRef as Ur}from"react";function en(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 tn(e){return Math.max(0,Math.min(1,e))}function on(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 rn(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 nn(e,t,o){const i=e.filter(e=>Number.isFinite(e.offset)).map(e=>({offset:tn(e.offset),color:e.color??o,opacity:null==e.opacity?1:tn(e.opacity)})).sort((e,t)=>e.offset-t.offset);if(0===i.length)return"#999999";const r=e=>{if(1===e.opacity)return e.color;const t=on(e.color);return t?`rgba(${t[0]},${t[1]},${t[2]},${e.opacity})`:e.color};if(1===i.length)return r(i[0]);const n=tn(t);if(i[0].offset>=n)return r(i[0]);if(n>=i[i.length-1].offset)return r(i[i.length-1]);for(let e=0;i.length-1>e;e++){const t=i[e],o=i[e+1];if(t.offset>n||n>o.offset)continue;const s=o.offset-t.offset,a=s>0?(n-t.offset)/s:0,l=on(t.color),c=on(o.color);if(!l||!c)return r(.5>a?t:o);const[h,u,d]=l,[m,g,p]=c,f=h+(m-h)*a,y=u+(g-u)*a,v=d+(p-d)*a,b=t.opacity+(o.opacity-t.opacity)*a;return 1===b?rn(f,y,v):`rgba(${Math.round(f)},${Math.round(y)},${Math.round(v)},${b})`}return r(i[i.length-1])}function sn(e,t,o){return null==o?`${e}-${t}`:`${e}-${t}-${o}`}import{jsx as an,jsxs as ln}from"react/jsx-runtime";var cn=Jr(function(e,o){const i=dt(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}),r=Ur(null),n="context"===i.mode,{compactMode:s}=i,{value:a,min:l=0,max:c=100,thresholds:h,gradientFill:d,color:m,backgroundColor:g="var(--semiotic-grid, #e0e0e0)",arcWidth:p=.3,cornerRadius:f,showNeedle:y=!0,needleColor:v="var(--semiotic-text, #333)",centerContent:b,valueFormat:x,showScaleLabels:w=!s,sweep:A=240,fillZones:k=!0,tooltip:S,annotations:_,frameProps:C={},className:P,stroke:R,strokeWidth:M,opacity:L}=e,{width:I,height:T,title:H,description:B,summary:F,accessibleTable:O}=i,E=u(d),N=Math.max(l,Math.min(c,a)),D=c-l||1,j=(N-l)/D,{gaugeData:W,pieceStyle:z,gaugeAnnotations:G}=Zr(()=>function(e){const{min:t,max:o,value:i,thresholds:r,fillColor:n,backgroundColor:s,fillZones:a,showScaleLabels:l,gradientFill:c,gradientSteps:h=240}=e,u=o-t||1,d=(Math.max(t,Math.min(o,i))-t)/u;let m=r&&r.length>0?[...r].sort((e,t)=>e.value-t.value):[{value:o,color:n||"#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=a?d:1,t=sn("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:s,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(nn(c.stops,e*(t+.5)/o,n||m[0]?.color||"#007bff"));const r=sn("fill",0);p.push({category:r,value:e,_zone:"Gradient",_isFill:!0,_pctStart:0,_pct:e,_roundedEnds:{start:!0,end:!0},_nonInteractive:!0,_gradientBand:{colors:i}}),f.set(r,{fill:i[0]||s})}}else{let e=t;for(let o=0;m.length>o;o++){const i=m[o],r=(i.value-e)/u,n=(e-t)/u,l=(i.value-t)/u,c=Math.max(0,(a?Math.min(d,l):l)-n),h=a?Math.max(0,r-c):0;if(c>0){const e=sn("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=sn("bg",o);p.push({category:e,value:h,_zone:i.label||"Zone "+(o+1),_isFill:!1}),f.set(e,{fill:s,opacity:.4})}e=i.value}}if(l&&r&&r.length>0)for(const e of r)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:s},gaugeAnnotations:y}}({min:l,max:c,value:a,thresholds:h,fillColor:m,backgroundColor:g,fillZones:k,showScaleLabels:w,gradientFill:E}),[a,l,c,h,m,g,w,k,E]),V=Zr(()=>t(z,{stroke:R,strokeWidth:M,opacity:L}),[z,R,M,L]),{sweepRad:$,startAngleDeg:q}=en(A),X=function(e=240){const{sweepRad:t,offsetRad:o}=en(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 r=i.map(e=>e[0]),n=i.map(e=>e[1]),[s,a]=At(r),[l,c]=At(n);return{minX:s,maxX:a,minY:l,maxY:c,width:a-s,height:c-l,cx:(s+a)/2,cy:(l+c)/2}}(A),Y=Math.min(10,Math.max(1,Math.min(I,T)/12)),Q=X.cx,K=X.cy,Z=Math.max(4,Math.min((I-2*Y)/X.width,(T-2*Y)/X.height)-2),J=Math.max(0,Math.min(Z-1.5,Z*(1-p))),U=I/2-Q*Z,ee=T/2-K*Z,te=2*(Z+4),oe=Zr(()=>{if(s&&null==b)return null;if(null!=b)return"function"==typeof b?b(N,l,c):b;const e=x?x(N):Math.round(N)+"";return ln("div",{style:{textAlign:"center",lineHeight:1.2},children:[an("div",{style:{fontSize:Math.max(16,.3*Z),fontWeight:700,color:"var(--semiotic-text, #333)"},children:e}),w&&ln("div",{style:{fontSize:11,color:"var(--semiotic-text-secondary, #666)"},children:[l," – ",c]})]})},[b,N,l,c,x,w,Z,s]),ie=Zr(()=>n&&null==b?{type:"gauge-value",text:x?x(N):Math.round(N)+""}:null,[n,b,N,x]),re=Zr(()=>{if(!y)return null;const e=-Math.PI/2+q*Math.PI/180+j*$,t=J>20?J-8:Z-1;return{type:"gauge-needle",tipX:Math.cos(e)*t,tipY:Math.sin(e)*t,color:v}},[y,q,j,$,J,Z,v]),ne=Zr(()=>(e,t,o)=>{if("gauge-needle"===e.type){const i=(o.width||I)/2,r=(o.height||T)/2,n=Math.max(1,Z-J),s=Math.max(1,Math.min(2.5,.4*n)),a=Math.max(1,Math.min(5,.6*n));return ln("g",{transform:`translate(${i},${r})`,children:[an("line",{x1:0,y1:0,x2:e.tipX,y2:e.tipY,stroke:e.color,strokeWidth:s,strokeLinecap:"round"}),an("circle",{cx:0,cy:0,r:a,fill:e.color})]},"gauge-needle-"+t)}if("gauge-label"===e.type){const i=-Math.PI/2+q*Math.PI/180+(e.value-l)/D*$,r=(o.width||I)/2,n=(o.height||T)/2,s=J-1,a=Z+1,c=Math.cos(i)*s,h=Math.sin(i)*s,u=Math.cos(i)*a,d=Math.sin(i)*a,m=Z+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"),ln("g",{transform:`translate(${r},${n})`,children:[an("line",{x1:c,y1:h,x2:u,y2:d,stroke:"var(--semiotic-border, #ccc)",strokeWidth:2,strokeLinecap:"round"}),an("text",{x:g,y:p,textAnchor:y,dominantBaseline:v,fill:"var(--semiotic-text-secondary, #666)",style:{userSelect:"none",fontSize:"var(--semiotic-gauge-label-font-size, 10px)"},children:e.label})]},"gauge-label-"+t)}return"gauge-value"===e.type?an("text",{x:(o.width||I)/2,y:(o.height||T)/2-.2*J,textAnchor:"middle",dominantBaseline:"middle",fontSize:Math.max(12,Math.min(22,.28*Z)),fontWeight:700,fill:"var(--semiotic-text, #333)",style:{userSelect:"none"},children:e.text},"gauge-value-"+t):null},[I,T,l,D,q,$,J,Z]),se=Zr(()=>{const e=[...G,..._||[]];return re&&e.push(re),ie&&e.push(ie),e},[G,_,re,ie]),ae=Zr(()=>e=>{const t=e?.data?.[0]||e?.data||e,o=t?._zone||"",i=t?._isFill;return ln("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:[an("div",{style:{fontWeight:600},children:o}),an("div",{style:{fontSize:"0.85em",color:"var(--semiotic-text-secondary, #666)"},children:i?"Current: "+Math.round(N):"Remaining"})]})},[N]);if(0===W.length)return an(_t,{componentName:"GaugeChart",message:"No data to display",width:I,height:T});const le={chartType:"donut",data:W,oAccessor:"category",rAccessor:"value",oSort:!1,projection:"radial",pieceStyle:V,innerRadius:J,startAngle:q,sweepAngle:A,...null!=f&&{cornerRadius:f},centerContent:oe,size:[I,T],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:{top:ee-te/2,bottom:T-ee-te/2,left:U-te/2,right:I-U-te/2},enableHover:i.enableHover,showAxes:!1,showCategoryTicks:!1,tooltipContent:!1===S?()=>null:Ke(S)||ae,svgAnnotationRules:ne,...se.length>0&&{annotations:se},...H&&{title:H},...B&&{description:B},...F&&{summary:F},...void 0!==O&&{accessibleTable:O},...P&&{className:P},...null!=e.animate&&{animate:e.animate},...C};return an(Ct,{componentName:"GaugeChart",width:I,height:T,children:an(li,{ref:r,...le})})});cn.displayName="GaugeChart";import{useMemo as hn,forwardRef as un,useRef as dn}from"react";import{jsx as mn}from"react/jsx-runtime";var gn=un(function(e,t){const i=dt(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=dn(null),{data:s,margin:a,className:l,categoryAccessor:c="category",groupBy:h,valueAccessor:u="value",orientation:m="vertical",valueFormat:g,colorBy:p,colorScheme:f,sort:y=!1,barPadding:v=60,roundedTop:b,gradientFill:x,styleRules:w,baselinePadding:A=!1,tooltip:k,annotations:S,valueExtent:_,frameProps:C={},selection:P,linkedHover:R,onObservation:M,onClick:L,hoverHighlight:I,chartId:T,loading:H,loadingContent:B,emptyContent:F,legendInteraction:N,legendPosition:W,color:z,stroke:G,strokeWidth:V,opacity:$,categoryFormat:q}=e,{width:X,height:Y,enableHover:Q,showGrid:K,showLegend:Z,title:J,description:U,summary:ee,accessibleTable:te,categoryLabel:oe,valueLabel:ie}=i,re=hn(()=>Be(s),[s]),se=p||h,ae=o({data:re,rawData:s,colorBy:se,colorScheme:f,legendInteraction:N,legendPosition:W,selection:P,linkedHover:R,fallbackFields:se?["string"==typeof se?se:""]:[],unwrapData:!0,onObservation:M,onClick:L,hoverHighlight:I,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"GroupedBarChart",chartId:T,showLegend:Z,userMargin:a,marginDefaults:i.marginDefaults,loading:H,loadingContent:B,emptyContent:F,width:X,height:Y,hasTitle:!!J,axisChrome:st({showAxes:i.showAxes,projection:"horizontal"===m?"horizontal":"vertical",hasCategoryLabel:!!oe,hasValueLabel:!!ie})}),le=vt(),ce=hn(()=>new Map,[]),he=hn(()=>ne(u),[u]),ue=bi({colorBy:se,colorScale:ae.colorScale,color:z,themeCategorical:le,colorScheme:f,categoryIndexMap:ce,userPieceStyle:C.pieceStyle,stroke:G,strokeWidth:V,opacity:$,styleRules:w,resolveRuleValue:he,effectiveSelectionHook:ae.effectiveSelectionHook,resolvedSelection:ae.resolvedSelection}),de=hn(()=>D({categoryAccessor:h,valueAccessor:u,groupAccessor:c,valueFormat:g}),[h,c,u,g]),me=n({componentName:"GroupedBarChart",data:s,accessors:{categoryAccessor:c,valueAccessor:u},requiredProps:{groupBy:h}}),{effectiveLegendProps:ge,effectiveMargin:pe}=yi({ref:t,frameRef:r,setup:ae}),fe=hn(()=>d(x),[x]);if(ae.earlyReturn)return ae.earlyReturn;const ye={chartType:"clusterbar",...null!=s&&{data:re},oAccessor:c,rAccessor:u,groupBy:h,oSort:y,projection:"horizontal"===m?"horizontal":"vertical",pieceStyle:ue,size:[X,Y],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:pe,barPadding:v,...null!=b&&{roundedTop:b},...fe&&{gradientFill:fe},baselinePadding:A,enableHover:Q,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:oe,rLabel:ie,rFormat:g,...q&&{oFormat:q},showGrid:K,...ge,...O({title:J,description:U,summary:ee,accessibleTable:te,className:l,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...j({tooltip:k,defaultTooltipContent:de}),...E({linkedHover:R,selection:P,onObservation:M,onClick:L,hoverHighlight:I,mobileInteraction:ae.mobileInteraction,customHoverBehavior:ae.customHoverBehavior,customClickBehavior:ae.customClickBehavior}),...S&&S.length>0&&{annotations:S},..._&&{rExtent:_},...Object.fromEntries(Object.entries(C).filter(([e])=>"pieceStyle"!==e))};return me?mn(_t,{componentName:"GroupedBarChart",message:me,width:X,height:Y}):mn(Ct,{componentName:"GroupedBarChart",width:X,height:Y,children:mn(li,{ref:r,...ye})})});gn.displayName="GroupedBarChart";import{useMemo as pn,forwardRef as fn,useRef as yn}from"react";import{jsx as vn}from"react/jsx-runtime";var bn=fn(function(e,t){const i=dt(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=yn(null),{data:s,margin:a,className:l,categoryAccessor:c="category",subcategoryAccessor:h,valueAccessor:u="value",orientation:m="horizontal",valueFormat:g,colorBy:p,colorScheme:f,barPadding:y,tooltip:v,annotations:b,brush:x,onBrush:w,linkedBrush:A,frameProps:k={},selection:S,linkedHover:_,onObservation:C,onClick:P,hoverHighlight:R,chartId:M,loading:L,loadingContent:I,emptyContent:T,legendInteraction:H,legendPosition:B,color:F,stroke:N,strokeWidth:W,opacity:z,categoryFormat:G,rTickValues:V,tickLabelEdgeAlign:$,showCategoryTicks:q,gradientFill:X,trackFill:Y,roundedTop:Q,valueExtent:K}=e,{width:Z,height:J,enableHover:U,showGrid:ee,showLegend:te,title:oe,description:ie,summary:re,accessibleTable:ne,categoryLabel:se,valueLabel:ae}=i,le=pn(()=>Be(s),[s]),ce=p||h,he=pn(()=>{if(null!=y)return y;if("sparkline"!==i.mode)return 40;const e=new Set(le.map(e=>"function"==typeof c?c(e):e[c])),t=Math.max(1,e.size);return t>1?Math.max(0,Math.min(1,(("horizontal"===m?J:Z)-2*t)/(t-1))):1},[y,i.mode,le,c,m,Z,J]),ue=o({data:le,rawData:s,colorBy:ce,colorScheme:f,legendInteraction:H,legendPosition:B,selection:S,linkedHover:_,fallbackFields:ce?["string"==typeof ce?ce:""]:[],unwrapData:!0,onObservation:C,onClick:P,hoverHighlight:R,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"SwimlaneChart",chartId:M,showLegend:te,userMargin:a,marginDefaults:i.marginDefaults,loading:L,loadingContent:I,emptyContent:T,width:Z,height:J,hasTitle:!!oe,axisChrome:st({showAxes:i.showAxes,projection:"horizontal"===m?"horizontal":"vertical",hasCategoryLabel:!1!==q&&!!se,hasValueLabel:!!ae})}),de=or({brushProp:x,onBrushProp:w,linkedBrush:A,valueAccessor:u}),me=vt(),ge=pn(()=>new Map,[]),pe=bi({colorBy:ce,colorScale:ue.colorScale,color:F,themeCategorical:me,colorScheme:f,categoryIndexMap:ge,userPieceStyle:k?.pieceStyle,stroke:N,strokeWidth:W,opacity:z,effectiveSelectionHook:ue.effectiveSelectionHook,resolvedSelection:ue.resolvedSelection,cycleByCategory:!0}),fe=pn(()=>D({categoryAccessor:h,valueAccessor:u,groupAccessor:c,valueFormat:g}),[h,c,u,g]),ye=n({componentName:"SwimlaneChart",data:s,accessors:{categoryAccessor:c,valueAccessor:u,subcategoryAccessor:h},requiredProps:{subcategoryAccessor:h}}),{effectiveLegendProps:ve,effectiveMargin:be}=yi({ref:t,frameRef:r,setup:ue}),xe=pn(()=>d(X),[X]);if(ue.earlyReturn)return ue.earlyReturn;const we={chartType:"swimlane",...null!=s&&{data:le},oAccessor:c,rAccessor:u,stackBy:h,projection:"horizontal"===m?"horizontal":"vertical",pieceStyle:pe,size:[Z,J],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:be,barPadding:he,enableHover:U,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:!1===q?void 0:se,rLabel:ae,rFormat:g,...V&&{rTickValues:V},...null!=$&&{tickLabelEdgeAlign:$},...G&&{oFormat:G},...void 0!==q&&{showCategoryTicks:q},showGrid:ee,...ve,...O({title:oe,description:ie,summary:re,accessibleTable:ne,className:l,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...j({tooltip:v,defaultTooltipContent:fe}),...E({linkedHover:_,selection:S,onObservation:C,onClick:P,hoverHighlight:R,mobileInteraction:ue.mobileInteraction,customHoverBehavior:ue.customHoverBehavior,customClickBehavior:ue.customClickBehavior}),...b&&b.length>0&&{annotations:b},...xe&&{gradientFill:xe},...null!=Y&&{trackFill:Y},...null!=Q&&{roundedTop:Q},...K&&{rExtent:K},...de.brushStreamProps,...Object.fromEntries(Object.entries(k).filter(([e])=>"pieceStyle"!==e))};return ye?vn(_t,{componentName:"SwimlaneChart",message:ye,width:Z,height:J}):vn(Ct,{componentName:"SwimlaneChart",width:Z,height:J,children:vn(li,{ref:r,...we})})});bn.displayName="SwimlaneChart";export{li as StreamOrdinalFrame_default,di as OrdinalCustomChart,wi as BarChart,Ci as StackedBarChart,Ki as LikertChart,rr as SwarmPlot,dr as BoxPlot,br as Histogram,Sr as ViolinPlot,Mr as RidgelinePlot,Fr as FunnelChart,jr as DotPlot,$r as PieChart,Kr as DonutChart,cn as GaugeChart,gn as GroupedBarChart,bn as SwimlaneChart};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{bandFromAge as e}from"./chunk-chunk-7ZDJSYKI.module.min.js";function n(e,n){const t={...e};return n.provenance&&(t.provenance=n.provenance),n.lifecycle&&(t.lifecycle=n.lifecycle),t}function t(){return(new Date).toISOString()}function r(e,n={}){const r=e.provenance;return{...e,provenance:{...r,...n,createdAt:n.createdAt??r?.createdAt??t()}}}function c(e){if(null==e)return null;if("number"==typeof e)return e;if(e instanceof Date)return e.getTime();const n=Date.parse(e);return Number.isFinite(n)?n:null}function l(e){const n=c(e?.now);if(null!=n)return n;const t=e?.dataExtent;if(t)if(Array.isArray(t)){const e=c(t[t.length-1]);if(null!=e)return e}else if("max"in t){const e=c(t.max);if(null!=e)return e}return Date.now()}function o(n,t,r={}){const l=n?.lifecycle?.freshness,o=c(n?.provenance?.createdAt),s=function(e){if(null==e)return null;if("number"==typeof e)return e;const n=function(e){const n=/^P(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/.exec(e);return n?1e3*(3600*(24*parseInt(n[1]||"0",10)+parseInt(n[2]||"0",10))+60*parseInt(n[3]||"0",10)+parseInt(n[4]||"0",10)):0}(e);return n>0?n:null}(n?.lifecycle?.ttlHint);return null==o||null==s?l??"fresh":e(t-o,s,r)}function s(e,n={}){const t=l(n);return e.map(e=>{const r=o(e,t,n.thresholds);return{...e,lifecycle:{...e.lifecycle,freshness:r}}})}var a={fresh:null,aging:.55,stale:.35,expired:.2},u={fresh:null,aging:null,stale:"4 4",expired:"2 4"};function i(e,n,t){return e&&t in e?e[t]:n[t]}function f(e,n={}){const t=l(n),r=!0===n.showExpiredAnnotations,c=[];for(const l of e){const e=o(l,t,n.thresholds);if("expired"===e&&!r)continue;const s=i(n.opacity,a,e),f=i(n.strokeDasharray,u,e),p=n.labelSuffix?.[e],d={...l,lifecycle:{...l.lifecycle,freshness:e}};null!=s&&null==d.opacity&&(d.opacity=s),null!=f&&null==d.strokeDasharray&&(d.strokeDasharray=f),p&&"string"==typeof d.label&&(d.label=d.label+p);const y=l.lifecycle?.anchor;y&&null==d.anchor&&(d.anchor=y),c.push(d)}return c}var p={proposed:.7,accepted:null,disputed:.7,retracted:.25},d={proposed:"3 3",accepted:null,disputed:"2 3",retracted:"2 4"},y={proposed:" (proposed)",accepted:"",disputed:" (?)",retracted:""};function h(e,n,t){return e&&t in e?e[t]:n[t]}function b(e,n={}){const t=!0===n.showRetractedAnnotations,r=!0===n.showSupersededAnnotations,c=new Set;for(const n of e){const e=n?.lifecycle?.supersedes;e&&"retracted"!==n?.lifecycle?.status&&c.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!t)return!1;const n=e?.provenance?.stableId;return!(n&&c.has(n)&&!r)})}function m(e,n={}){const t=[];for(const r of b(e,n)){const e=r?.lifecycle?.status;if(!e){t.push(r);continue}const c=h(n.opacity,p,e),l=h(n.strokeDasharray,d,e),o=n.labelSuffix?.[e]??y[e],s={...r};null!=c&&(s.opacity=("number"==typeof s.opacity?s.opacity:1)*c),null!=l&&null==s.strokeDasharray&&(s.strokeDasharray=l),o&&"string"==typeof s.label&&(s.label=s.label+o),t.push(s)}return t}export{n as withProvenance,t as currentTimestamp,r as withCurrentProvenance,o as annotationFreshnessFor,s as computeAnnotationFreshness,f as applyAnnotationLifecycle,b as filterAnnotationsByStatus,m as applyAnnotationStatus};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{useChartSetup as t,useCustomChartScaffold as e}from"./chunk-chunk-FBUNUIPV.module.min.js";import{lineCanvasRenderer as n,resolveNodeColor as i}from"./chunk-chunk-MX35T6RX.module.min.js";import{RingBuffer as o,compactTimestampBufferForRemoval as r,computePulseIntensity as s,hasActivePulses as a,pointCanvasRenderer as c,pushWithTimestamp as l,refreshIdlePulse as u,setPulseState as h,useGeoKeyboardNavigation as d,useLegendCategoryEmission as p,useSemanticFrameInteractions as f}from"./chunk-chunk-ONMLEXHR.module.min.js";import{needsDataCanvasPaint as m,needsInteractionCanvasPaint as g,paintCanvasBackground as y}from"./chunk-chunk-OI7R7EJB.module.min.js";import{StalenessBadge as v,attachUpdateResultStore as b,buildBaseMetadataProps as w,buildCustomBehaviorProps as P,composeOverlays as x,computeDecayOpacity as R,createCustomLayoutFailureDiagnostic as L,findHitPointInQuadtree as S,formatVal as A,getHitRadius as k,glyphCanvasRenderer as C,paintSceneWithBackend as j,renderPathPulse as D,renderSceneWithBackend as M,useConfigSync as T,useLayoutSelectionSync as B,useStableShallow as _,useStalenessCheck as I,warnCustomLayoutDiagnostics as N}from"./chunk-chunk-NH4MEAKP.module.min.js";import{wrapWithCustomLayoutSelection as E}from"./chunk-chunk-5UKL5W76.module.min.js";import{filterAnnotationsByStatus as O}from"./chunk-chunk-BNGBEY7N.module.min.js";import{buildResolveColor as F,resolveCustomLayoutPalette as W}from"./chunk-chunk-JWXLNZSM.module.min.js";import{AccessibleDataTable as H,AriaLiveTooltip as z,CanvasFrameBackground as G,FlippingTooltip as q,FocusRing as Z,STREAMING_PALETTE as X,SceneRevisionDiagnosticsObserver as U,ScreenReaderSummary as Y,SkipToTableLink as Q,TITLE_BASELINE as $,UpdateResultTracker as V,annotationLayout as K,coerceCanvasFill as J,computeCanvasAriaLabel as tt,computeEasing as et,computeRawProgress as nt,createDefaultAnnotationRules as it,defaultTooltipStyle as ot,filterSparseArray as rt,geoSceneNodeToSVG as st,getDevicePixelRatio as at,getPointerHitRadius as ct,isAnnotationActivationTarget as lt,isServerEnvironment as ut,lerp as ht,normalizeTooltip as dt,now as pt,observationInputType as ft,prepareCanvas as mt,renderAnnotationPass as gt,renderLegendFromConfig as yt,resolveCSSColor as vt,smartTooltipEntries as bt,useAnnotationActivationOptions as wt,useFrame as Pt,useFrameCanvasHost as xt,useSceneRevisionDiagnostics as Rt}from"./chunk-chunk-7ZDJSYKI.module.min.js";import{getMax as Lt}from"./chunk-chunk-JJ2OOIET.module.min.js";import{resolveThemeSemanticColors as St}from"./chunk-chunk-WCX6U47H.module.min.js";import{glyphHitGeometry as At}from"./chunk-chunk-KTWEBFMX.module.min.js";import{SafeRender as kt,useHydration as Ct,useWasHydratingFromSSR as jt}from"./chunk-chunk-ACLDBMRH.module.min.js";import{useRef as Dt,useState as Mt,useEffect as Tt,useMemo as Bt,useCallback as _t,useImperativeHandle as It,forwardRef as Nt,memo as Et}from"react";import{geoPath as Ot}from"d3-geo";import{quadtree as Ft}from"d3-quadtree";import{geoMercator as Wt,geoEqualEarth as Ht,geoAlbersUsa as zt,geoOrthographic as Gt,geoNaturalEarth1 as qt,geoEquirectangular as Zt}from"d3-geo";var Xt={mercator:Wt,equalEarth:Ht,albersUsa:zt,orthographic:Gt,naturalEarth:qt,equirectangular:Zt};function Ut(t,e){return t?"function"==typeof t?t:e=>e[t]:t=>t[e]}function Yt(t){return t?"function"==typeof t?t:e=>e[t]:t=>t.coordinates||t.data||[]}function Qt(t,e,n){return t?"function"==typeof t?{...n,...t(e)}:{...n,...t}:{...n}}function $t(t,e){if(2>t.length)return[t];const n=.4*e,i=[];let o=[t[0]];for(let e=1;t.length>e;e++){const r=t[e];Math.abs(r[0]-t[e-1][0])>n?(2>o.length||i.push(o),o=[r]):o.push(r)}return 2>o.length||i.push(o),i}function Vt(t,e,n=24){const i=e[0]-t[0],o=e[1]-t[1],r=Math.sqrt(i*i+o*o);if(0===r)return[t,e];const s=-o/r,a=i/r,c=Math.min(.3*r,80),l=(t[0]+e[0])/2+s*c,u=(t[1]+e[1])/2+a*c,h=[];for(let i=0;n>=i;i++){const o=i/n,r=1-o;h.push([r*r*t[0]+2*r*o*l+o*o*e[0],r*r*t[1]+2*r*o*u+o*o*e[1]])}return h}function Kt(t,e){if(2>t.length)return t;const n=e/2+1,i=[];for(let e=0;t.length>e;e++){const o=t[e];let r,s;0===e?(r=t[1][0]-o[0],s=t[1][1]-o[1]):e===t.length-1?(r=o[0]-t[e-1][0],s=o[1]-t[e-1][1]):(r=t[e+1][0]-t[e-1][0],s=t[e+1][1]-t[e-1][1]);const a=Math.sqrt(r*r+s*s)||1;i.push([o[0]+s/a*n,o[1]+-r/a*n])}return i}function Jt(t,e,n,i,o){const r=e[0]-t[0],s=e[1]-t[1],a=Math.sqrt(r*r+s*s);if(0===a)return[t,e];const c=s/a,l=-r/a,u=o/2+1;return[[t[0]+c*u,t[1]+l*u],[e[0]+c*u,e[1]+l*u]]}import{scaleLinear as te}from"d3-scale";var ee=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],ne=["scene-style","data-paint","accessibility","evidence"],ie=(t,e)=>({retainedData:t,invalidations:e}),oe=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],re=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],se=["scene-geometry","data-paint","accessibility","evidence"],ae=["scene-style","data-paint","accessibility","evidence"],ce=["overlay","accessibility","evidence"],le=[],ue={xAccessor:ie("rebuild",oe),yAccessor:ie("rebuild",oe),lineDataAccessor:ie("rebuild",oe),pointIdAccessor:ie("rebuild",se),lineIdAccessor:ie("rebuild",se),windowSize:ie("rebuild",oe),projection:ie("preserve",re),projectionExtent:ie("preserve",re),fitPadding:ie("preserve",re),lineType:ie("preserve",re),flowStyle:ie("preserve",re),graticule:ie("preserve",re),projectionTransform:ie("preserve",re),customLayout:ie("preserve",re),layoutConfig:ie("preserve",re),layoutMargin:ie("preserve",re),areaStyle:ie("preserve",ae),pointStyle:ie("preserve",["scene-geometry","scene-style","data-paint","accessibility","evidence"]),lineStyle:ie("preserve",ae),colorScheme:ie("preserve",ae),themeCategorical:ie("preserve",ae),themeDiverging:ie("preserve",ae),themeSemantic:ie("preserve",ae),themeSequential:ie("preserve",ae),decay:ie("preserve",ae),pulse:ie("preserve",ae),layoutSelection:ie("preserve",ae),annotations:ie("preserve",ce),autoPlaceAnnotations:ie("preserve",ce),clock:ie("preserve",le),transition:ie("preserve",le),introAnimation:ie("preserve",le),onLayoutError:ie("preserve",le)},he=ie("preserve",re),de=class{constructor(){this.tracker=new V}get last(){return this.tracker.last}subscribe(t){return this.tracker.subscribe(t)}recordData(t,e){return this.tracker.record({kind:t,...void 0===e?{}:{count:e}},ee)}recordNoop(t){return this.tracker.record({kind:t,..."restyle"===t?{}:{count:0}},[])}recordRestyle(t){return t?this.tracker.record({kind:"restyle"},ne):this.recordNoop("restyle")}recordConfig(t,e={}){const n=function(t){let e="preserve";const n=new Set;for(const i of t){const t=ue[i]??he;"rebuild"===t.retainedData&&(e="rebuild");for(const e of t.invalidations)n.add(e)}return{retainedData:e,invalidations:n}}(t),i=new Set(n.invalidations);return e.retainedDataChanged&&i.add("data"),this.tracker.record({kind:"config",keys:t},i)}};import{geoDistance as pe,geoGraticule as fe,geoInterpolate as me}from"d3-geo";function ge(t){if(null==t)return 0;if("number"==typeof t&&Number.isFinite(t)&&t>=0&&.5>t)return t;throw new RangeError(`[semiotic] fitPadding must be a finite fraction in [0, 0.5); received ${t+""}.`)}var ye=class t{constructor(t){this.updateResults=new de,this.scene=[],this.scales=null,this.version=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutDiagnosticsWarned=new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._customLayoutFailedThisBuild=!1,this._quadtree=null,this._maxPointRadius=0,this.projection=null,this.geoPath=null,this.baseScale=0,this.baseTranslate=[0,0],this.baseRotation=[0,0,0],this.currentZoom=1,this.cartogramLayout=null,this.areas=[],this.pointData=[],this.lineData=[],this.pointBuffer=null,this.streaming=!1,this.lastIngestTime=0,this.timestampBuffer=null,this.activeTransition=null,this.prevPositions=null,this._hasRenderedOnce=!1,this.config=function(t){return{...t,fitPadding:ge(t.fitPadding)}}(t)}currentTime(){return this.config.clock?.()??pt()}getConfiguredWindowSize(){const t=this.config.windowSize??500;if(!Number.isInteger(t)||1>t)throw Error("GeoPipelineStore windowSize must be a positive integer");return t}retainNewestLines(t=this.getConfiguredWindowSize()){this.lineData.length>t&&(this.lineData=this.lineData.slice(-t))}resizeStreamingWindow(t){if(this.pointBuffer){const e=this.pointBuffer.toArray(),n=this.timestampBuffer?.toArray()??[],i=e.slice(-t),r=n.slice(-i.length),s=this.currentTime();this.pointBuffer=new o(t),this.timestampBuffer=new o(t),i.forEach((t,e)=>{this.pointBuffer.push(t),this.timestampBuffer.push(r[e]??s)})}this.retainNewestLines(t)}updateConfig(t){const e=function(t){return"fitPadding"in t?{...t,fitPadding:ge(t.fitPadding)}:t}(t),n=this.config,i=this.getConfiguredWindowSize(),o=Object.keys(e).filter(t=>e[t]!==n[t]);this.config={...this.config,...e};const r=this.getConfiguredWindowSize(),s=this.streaming&&r!==i;s&&(this.resizeStreamingWindow(r),this.version++),"customLayout"in e&&!e.customLayout&&(this.lastCustomLayoutFailure=null),this.updateResults.recordConfig(o,{retainedDataChanged:s})}updateConfigWithResult(t){return this.updateConfig(t),this.updateResults.last}setAreas(t){this.areas=t,this.updateResults.recordData("replace",t.length)}setAreasWithResult(t){return this.setAreas(t),this.updateResults.last}setPoints(t){this.pointData=t.slice(),this.pointBuffer=null,this.timestampBuffer=null,this.streaming=!1,this.updateResults.recordData("replace",t.length)}setPointsWithResult(t){return this.setPoints(t),this.updateResults.last}setLines(t){this.lineData=t.slice(),this.streaming&&this.retainNewestLines(),this.updateResults.recordData("replace",t.length)}setLinesWithResult(t){return this.setLines(t),this.updateResults.last}initStreaming(t){void 0!==t&&t!==this.config.windowSize&&(this.config={...this.config,windowSize:t});const e=this.getConfiguredWindowSize(),n=this.pointBuffer?this.pointBuffer.toArray():this.pointData,i=this.timestampBuffer?.toArray()??[],r=n.slice(-e),s=i.slice(-r.length),a=this.currentTime();this.pointBuffer=new o(e),this.timestampBuffer=new o(e),r.forEach((t,e)=>{this.pointBuffer.push(t),this.timestampBuffer.push(s[e]??a)}),this.pointData=[],this.retainNewestLines(e),this.streaming=!0}pushPoint(t){this.pointBuffer||this.initStreaming();const e=this.currentTime();l(this.pointBuffer,t,this.timestampBuffer,e),this.lastIngestTime=e,this.updateResults.recordData("ingest",1)}pushPointWithResult(t){return this.pushPoint(t),this.updateResults.last}pushMany(t){this.pointBuffer||this.initStreaming();const e=this.currentTime();for(const n of t)l(this.pointBuffer,n,this.timestampBuffer,e);this.lastIngestTime=e,this.updateResults.recordData("ingest",t.length)}pushManyWithResult(t){return this.pushMany(t),this.updateResults.last}pushLine(t){null!=t&&"object"==typeof t?(this.streaming||this.initStreaming(),this.lineData.push(t),this.retainNewestLines(),this.version++,this.updateResults.recordData("ingest",1)):this.updateResults.recordNoop("ingest")}pushManyLines(t){if(!Array.isArray(t)||0===t.length)return void this.updateResults.recordNoop("ingest");const e=t.filter(t=>null!=t&&"object"==typeof t);if(0!==e.length){this.streaming||this.initStreaming();for(const t of e)this.lineData.push(t);this.retainNewestLines(),this.version++,this.updateResults.recordData("ingest",e.length)}else this.updateResults.recordNoop("ingest")}removeLine(t){const{lineIdAccessor:e}=this.config;if(!e)throw Error("removeLine() requires lineIdAccessor to be configured");const n="function"==typeof e?e:t=>t[e],i=new Set(Array.isArray(t)?t:[t]),o=[];return this.lineData=this.lineData.filter(t=>!i.has(n(t)+"")||(o.push(t),!1)),o.length>0?(this.version++,this.updateResults.recordData("remove",o.length)):this.updateResults.recordNoop("remove"),o}getLines(){return this.lineData.slice()}removePoint(t){const{pointIdAccessor:e}=this.config;if(!e)throw Error("removePoint() requires pointIdAccessor to be configured");const n="function"==typeof e?e:t=>t[e],i=new Set(Array.isArray(t)?t:[t]);if(this.streaming&&this.pointBuffer){const t=t=>i.has(n(t)+"");r(this.pointBuffer,this.timestampBuffer,t);const e=this.pointBuffer.remove(t);return e.length>0?(this.version++,this.updateResults.recordData("remove",e.length)):this.updateResults.recordNoop("remove"),e}{const t=[];return this.pointData=this.pointData.filter(e=>!i.has(n(e)+"")||(t.push(e),!1)),t.length>0?(this.version++,this.updateResults.recordData("remove",t.length)):this.updateResults.recordNoop("remove"),t}}clear(){this.areas=[],this.pointData=[],this.lineData=[],this.pointBuffer=null,this.timestampBuffer=null,this.streaming=!1,this.scene=[],this.scales=null,this._hasRenderedOnce=!1,this.activeTransition=null,this.prevPositions=null,this._quadtree=null,this._maxPointRadius=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._customLayoutFailedThisBuild=!1,this.version++,this.updateResults.recordData("clear")}restyleScene(t){const e=this._customRestyle;if(e){for(const n of this.scene){const i=this._baseStyles.get(n)??n.style,o=e(n,t);n.style=o?{...i,...o}:i}this.markStylePaintPending(),this.updateResults.recordRestyle(!0)}else this.updateResults.recordRestyle(!1)}computeScene(t){const{config:e}=this,n=this.projection,i=this.geoPath,o=this.scales,r=this.baseScale,s=[...this.baseTranslate],a=[...this.baseRotation],c=this.scene;this.projection=function(t){if(!t)return Ht();if("string"==typeof t){const e=Xt[t];return e?e():("production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Unknown projection "${t}", falling back to equalEarth`),Ht())}if("object"==typeof t&&"type"in t){const e=Xt[t.type],n=e?e():Ht();return t.rotate&&"rotate"in n&&n.rotate(t.rotate),t.center&&"center"in n&&n.center(t.center),n}return t}(e.projection),this.geoPath=Ot(this.projection),this.fitProjection(t),this.geoPath=Ot(this.projection);const l=this.projection;this.scales={projection:l,geoPath:this.geoPath,projectedPoint:(t,e)=>l([t,e]),invertedPoint:(t,e)=>l.invert?l.invert([t,e]):null},this._customLayoutFailedThisBuild=!1;const u=this.buildSceneNodes(t);if(this._customLayoutFailedThisBuild)!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.projection=n,this.geoPath=i,this.scales=o,this.baseScale=r,this.baseTranslate=s,this.baseRotation=a):(this.scene=[],this.rebuildQuadtree());else{if(this.scene=u,this.rebuildQuadtree(),e.projectionTransform&&this.applyCartogramTransform(e.projectionTransform,t),e.decay&&this.streaming&&this.applyDecay(),e.pulse&&this.streaming&&this.applyPulse(),e.transition&&!this._hasRenderedOnce&&this.scene.length>0&&e.introAnimation){const e=t.width/2,n=t.height/2,i=this.scene.filter(t=>"point"===t.type).map(t=>({...t,x:e,y:n}));i.length>0&&this.startTransition(i)}this._hasRenderedOnce=!0,e.transition&&c.length>0&&this.startTransition(c),this.version++}}fitProjection(t){const e=this.projection,n=this.config,i=[...this.areas],o=Ut(n.xAccessor,"lon"),r=Ut(n.yAccessor,"lat"),s=this.getPoints();if(s.length>0){const t=s.map(t=>[o(t),r(t)]);i.push({type:"Feature",properties:{},geometry:{type:"MultiPoint",coordinates:t}})}const a=Yt(n.lineDataAccessor);for(const t of this.lineData){const e=a(t);if(e&&e.length>0){const t=e.map(t=>[o(t),r(t)]);i.push({type:"Feature",properties:{},geometry:{type:"LineString",coordinates:t}})}}if(0!==i.length){if(n.projectionExtent){const[[i,o],[r,s]]=n.projectionExtent;e.fitExtent([[0,0],[t.width,t.height]],{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[i,o],[i,s],[r,s],[r,o],[i,o]]]}})}else if(e.clipAngle&&(e.clipAngle()??0)>0){const i=n.fitPadding??0,o=Math.min(t.width,t.height);e.scale(o/2-o*i),e.translate([t.width/2,t.height/2])}else{const o=n.fitPadding??0,r=t.width*o,s=t.height*o;e.fitExtent([[r,s],[t.width-r,t.height-s]],{type:"FeatureCollection",features:i})}this.baseScale=e.scale(),this.baseTranslate=e.translate(),this.baseRotation=e.rotate?.()??[0,0,0]}}applyZoomTransform(t,e){const n=this.projection;if(!n)return;const i=this.geoPath,o=this.scales,r=n.scale(),s=[...n.translate()],a=this.currentZoom;n.scale(this.baseScale*t.k),n.translate([this.baseTranslate[0]*t.k+t.x,this.baseTranslate[1]*t.k+t.y]),this.currentZoom=t.k,this.geoPath=Ot(n),this.scales={projection:n,geoPath:this.geoPath,projectedPoint:(t,e)=>n([t,e]),invertedPoint:(t,e)=>n.invert?n.invert([t,e]):null},this._customLayoutFailedThisBuild=!1;const c=this.buildSceneNodes(e);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(n.scale(r),n.translate(s),this.currentZoom=a,this.geoPath=i,this.scales=o):(this.scene=[],this.rebuildQuadtree()):(this.scene=c,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,e),this.version++)}applyZoomScale(t,e){const n=this.projection;if(!n)return;const i=this.geoPath,o=this.scales,r=n.scale(),s=[...n.translate()],a=this.currentZoom;n.scale(this.baseScale*t),n.translate(this.baseTranslate),this.currentZoom=t,this.geoPath=Ot(n),this.scales={projection:n,geoPath:this.geoPath,projectedPoint:(t,e)=>n([t,e]),invertedPoint:(t,e)=>n.invert?n.invert([t,e]):null},this._customLayoutFailedThisBuild=!1;const c=this.buildSceneNodes(e);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(n.scale(r),n.translate(s),this.currentZoom=a,this.geoPath=i,this.scales=o):(this.scene=[],this.rebuildQuadtree()):(this.scene=c,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,e),this.version++)}applyRotation(t,e){const n=this.projection;if(!n||!n.rotate)return;const i=this.geoPath,o=this.scales,r=[...n.rotate()];n.rotate(t),this.geoPath=Ot(n),this.scales={projection:n,geoPath:this.geoPath,projectedPoint:(t,e)=>n([t,e]),invertedPoint:(t,e)=>n.invert?n.invert([t,e]):null},this._customLayoutFailedThisBuild=!1;const s=this.buildSceneNodes(e);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(n.rotate(r),this.geoPath=i,this.scales=o):(this.scene=[],this.rebuildQuadtree()):(this.scene=s,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,e),this.version++)}setRotation(t){const e=this.projection;e&&e.rotate&&e.rotate(t)}hasProjection(){return null!=this.projection}getRotation(){return this.projection?.rotate?.()??this.baseRotation}getBaseProjectionState(){return{scale:this.baseScale,translate:[...this.baseTranslate]}}getPoints(){return this.streaming&&this.pointBuffer?this.pointBuffer.toArray():this.pointData}rebuildQuadtree(){let e=0,n=0;for(const t of this.scene)"point"===t.type&&!1!==t.interactive&&(n++,t.r>e&&(e=t.r));if(this._maxPointRadius=e,t.QUADTREE_THRESHOLD>=n)return void(this._quadtree=null);const i=Array(n);let o=0;for(const t of this.scene)"point"===t.type&&!1!==t.interactive&&(i[o++]=t);this._quadtree=Ft().x(t=>t.x).y(t=>t.y).addAll(i)}get quadtree(){return this._quadtree}get maxPointRadius(){return this._maxPointRadius}buildSceneNodes(t){this._customLayoutFailedThisBuild=!1;const{config:e}=this,n=this.projection,i=this.geoPath;if(e.customLayout&&this.scales){const n=e.layoutMargin??{top:0,right:0,bottom:0,left:0},i=W(e.colorScheme,e.themeCategorical,X),o={areas:this.areas.slice(),points:this.getPoints().slice(),lines:this.lineData.slice(),scales:this.scales,dimensions:{width:t.width,height:t.height,margin:n,plot:{x:0,y:0,width:t.width,height:t.height}},theme:{semantic:e.themeSemantic??{},categorical:[...i]},resolveColor:F(i,e.colorScheme),config:e.layoutConfig??{},selection:e.layoutSelection??null};let r;try{r=e.customLayout(o)}catch(t){const n=null!==this.lastCustomLayoutResult,i=L("geo",t,n,this.version);this.lastCustomLayoutFailure=i,this._customLayoutFailedThisBuild=!0,"production"!==process.env.NODE_ENV&&console.error("[semiotic] geo customLayout threw:",t);try{e.onLayoutError?.(i)}catch(t){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",t)}return n?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,[])}const s=r.nodes??[];if(this.customLayoutOverlays=r.overlays??null,this.lastCustomLayoutResult=r,this.lastCustomLayoutFailure=null,this._customRestyle=r.restyle,this.hasCustomRestyle=!!r.restyle,this._baseStyles=new WeakMap,this.hasCustomRestyle){for(const t of s)this._baseStyles.set(t,t.style);this.restyleScene(e.layoutSelection??null)}return N({label:"geo customLayout",nodes:s,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),s}return this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,function({config:t,projection:e,path:n,areas:i,points:o,lines:r,layout:s}){const a=Ut(t.xAccessor,"lon"),c=Ut(t.yAccessor,"lat"),l=[],u=function(t){return{fill:t.themeSemantic?.surface||"#e0e0e0",stroke:t.themeSemantic?.border||"#999",strokeWidth:.5,fillOpacity:1}}(t),h=function(t){return{stroke:t.themeSemantic?.primary||"#4e79a7",strokeWidth:1.5,fill:"none"}}(t),d=function(t){return{fill:t.themeSemantic?.primary||"#4e79a7",r:4,fillOpacity:.8}}(t);if(t.graticule){const e=!0===t.graticule?{}:t.graticule,i=fe();e.step&&i.step(e.step);const o=n(i())||"";o&&l.push({type:"geoarea",pathData:o,centroid:[s.width/2,s.height/2],bounds:[[0,0],[s.width,s.height]],screenArea:0,style:{fill:"none",stroke:e.stroke||"#e0e0e0",strokeWidth:e.strokeWidth||.5,strokeDasharray:e.strokeDasharray||"2,2"},datum:null,interactive:!1})}for(const e of i){const i=n(e);if(!i)continue;const o=n.centroid(e),r=n.bounds(e),s=n.area(e);l.push({type:"geoarea",pathData:i,centroid:o,bounds:r,screenArea:s,style:Qt(t.areaStyle,e,u),datum:e,interactive:!0})}const p=Yt(t.lineDataAccessor);for(const n of r){const i=p(n);if(!i||2>i.length)continue;let o=[];if("geo"===t.lineType){const t=Array(i.length);for(let e=0;i.length>e;e++)t[e]=[a(i[e]),c(i[e])];for(let n=0;t.length-1>n;n++){const i=t[n],r=t[n+1],s=pe(i,r)||0,a=Math.max(2,Math.ceil(s/(Math.PI/180))),c=me(i,r);for(let t=0;a>=t;t++){if(n>0&&0===t)continue;const i=e(c(t/a));null!=i&&o.push(i)}}}else for(let t=0;i.length>t;t++){const n=i[t],r=e([a(n),c(n)]);null!=r&&o.push(r)}if(2>o.length)continue;const r=Qt(t.lineStyle,n,h),u="number"==typeof r.strokeWidth?r.strokeWidth:1;2!==i.length||2>o.length||"arc"!==t.flowStyle?2!==i.length||2>o.length||"offset"!==t.flowStyle||(o="geo"===t.lineType?Kt(o,u):Jt(o[0],o[o.length-1],0,0,u)):o=Vt(o[0],o[o.length-1]);const d=$t(o,s.width);if(d.length>1)for(const t of d)2>t.length||l.push({type:"line",path:t,style:{...r,_edgeFade:!0},datum:n});else l.push({type:"line",path:2>o.length&&d[0]||o,style:r,datum:n})}const f=t.pointIdAccessor?"function"==typeof t.pointIdAccessor?t.pointIdAccessor:e=>e[t.pointIdAccessor]:null,m=e.clipAngle?e.clipAngle()??0:0,g=m>0?m*Math.PI/180:null,y=e.rotate?e.rotate():[0,0,0],v="function"==typeof e.center?e.center():[0,0],b=[(v[0]??0)-y[0],(v[1]??0)-y[1]];for(const n of o){const i=a(n),o=c(n);if(null!=g&&pe([i,o],b)>g)continue;const r=e([i,o]);if(!r)continue;const s=t.pointStyle?t.pointStyle(n):{...d},u={type:"point",x:r[0],y:r[1],r:s.r||4,style:s,datum:n,pointId:f?f(n)+"":void 0};l.push(u)}return l}({config:e,projection:n,path:i,areas:this.areas,points:this.getPoints(),lines:this.lineData,layout:t})}applyCartogramTransform(t,e){const n=function(t,e,n,i){const o=t.filter(t=>"point"===t.type);if(2>o.length)return null;const r=e.strength??1,s=Number.isFinite(r)?Math.max(0,Math.min(1,r)):1,a="strip"===e.layout?"strip":"radial";if("radial"===a&&0===s)return null;const c=e.centerAccessor?"function"==typeof e.centerAccessor?e.centerAccessor:t=>t[e.centerAccessor]:t=>t.id,l="function"==typeof e.costAccessor?e.costAccessor:t=>t[e.costAccessor],u=o.find(t=>t.datum&&c(t.datum)+""==e.center+"");if(!u)return"production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Distance cartogram center "${e.center}" not found in point data`),null;const h=o.map(t=>t.datum?Number(l(t.datum)):NaN).filter(t=>isFinite(t)&&t>=0),d=Lt(h,1);i>0&&"production"!==process.env.NODE_ENV&&console.warn("GeoFrame: Distance cartogram does not support area rendering. Areas will be ignored. Remove areas or set projectionTransform to null to render them.");for(let e=t.length-1;e>=0;e--){const n=t[e];"geoarea"===n.type&&n.interactive&&t.splice(e,1)}const p="strip"===a?function(t,e,n,i,o){const r=Math.max(3,Math.min(8,.35*o.height)),s=Math.max(1,o.width-2*r),a=o.height/2,c=te().domain([0,i]).range([0,s]);e.x=r,e.y=a;const l=[];for(const o of t){if(o===e)continue;if(!o.datum){o.x=r,o.y=a;continue}const t=Number(n(o.datum)),s=r+(isFinite(t)&&t>=0&&i>0?c(t):0);o.x=s,o.y=a,l.push({node:o,x:s})}l.sort((t,e)=>t.x-e.x);const u=Math.max(0,Math.min(o.height/2-1,6));let h=0;for(;l.length>h;){let t=h+1;for(;l.length>t&&3>Math.abs(l[t].x-l[h].x);)t++;const e=t-h;if(e>1&&u>0)for(let t=0;e>t;t++)l[h+t].node.y=a+(t-(e-1)/2)*Math.min(2.5,2*u/Math.max(1,e-1));h=t}return{cx:r,cy:a,maxCost:i,availableRadius:s,layout:"strip"}}(o,u,l,d,n):function(t,e,n,i,o,r){const s=e.x,a=e.y,c=r.width/2,l=r.height/2,u=Math.min(r.width,r.height)/2,h=te().domain([0,i]).range([0,u]);for(const r of t){if(r===e)continue;if(!r.datum)continue;const t=r.x,u=r.y,d=Math.atan2(u-a,t-s),p=Math.hypot(t-s,u-a),f=Number(n(r.datum)),m=isFinite(f)&&f>=0?i>0?h(f):0:p,g=c+Math.cos(d)*m,y=l+Math.sin(d)*m;r.x=t+(g-t)*o,r.y=u+(y-u)*o}return e.x=s+(c-s)*o,e.y=a+(l-a)*o,{cx:e.x,cy:e.y,maxCost:i,availableRadius:u,layout:"radial"}}(o,u,l,d,s,n),f=t.filter(t=>"line"===t.type);if(f.length>0){const t=new Map;for(const e of o)null!=e.pointId&&t.set(e.pointId+"",[e.x,e.y]);for(const n of f){const i=n.datum?.source,o=n.datum?.target;if(null!=i&&null!=o){const r=t.get(i+""),s=t.get(o+"");if(r&&s)if("fractional"===e.lineMode&&n.path.length>2){const t=n.path[0],e=n.path[n.path.length-1],i=[r[0]-t[0],r[1]-t[1]],o=[s[0]-e[0],s[1]-e[1]],a=[0];for(let t=1;n.path.length>t;t++)a.push(a[t-1]+Math.hypot(n.path[t][0]-n.path[t-1][0],n.path[t][1]-n.path[t-1][1]));const c=a[a.length-1];n.path=n.path.map((t,e)=>{const r=c>0?a[e]/c:e/(n.path.length-1);return[t[0]+i[0]*(1-r)+o[0]*r,t[1]+i[1]*(1-r)+o[1]*r]})}else n.path=[r,s]}}}return p}(this.scene,t,e,this.areas.length);n&&(this.cartogramLayout=n)}applyDecay(){const t=this.config.decay;if(!t||!this.pointBuffer)return;const e=this.pointBuffer.size;if(0===e)return;const n=this.scene.filter(t=>"point"===t.type);for(let i=0;n.length>i;i++){const o=R(t,i,e);n[i]._decayOpacity=o,n[i].style={...n[i].style,opacity:o}}}applyPulse(t=this.currentTime()){const e=this.config.pulse;if(!e||!this.timestampBuffer)return!1;const n=this.scene.filter(t=>"point"===t.type),i=this.timestampBuffer.toArray(),o=e.color||"rgba(255,255,255,0.6)",r=e.glowRadius??4;let a=!1;for(let c=0;n.length>c&&i.length>c;c++){const l=s(e,i[c],t);a=h(n[c],l,o,r)||a}return a}refreshPulse(t){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(t)}hasActivePulsesAt(t){return!!this.config.pulse&&a(this.config.pulse,this.timestampBuffer,t)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}startTransition(t){const e=this.config.transition?.duration??300;if(0>=e)return;const n=new Map;for(const e of t)"point"===e.type&&e.pointId&&n.set(e.pointId,[e.x,e.y]);const i=this.scene.filter(t=>"point"===t.type);let o=!1;for(const t of i)if(t.pointId){const e=n.get(t.pointId);e&&(t._targetX=t.x,t._targetY=t.y,t.x=e[0],t.y=e[1],(Math.abs(e[0]-t._targetX)>.5||Math.abs(e[1]-t._targetY)>.5)&&(o=!0))}for(const t of i)t.pointId&&!n.has(t.pointId)&&(t._targetOpacity=t.style?.opacity??1,t.style={...t.style,opacity:0},o=!0);o&&(this.activeTransition={startTime:this.currentTime(),duration:e})}cancelIntroAnimation(){this.activeTransition=null}advanceTransition(t){if(!this.activeTransition)return!1;const e=nt(t,this.activeTransition),n=et(e),i=this.scene.filter(t=>"point"===t.type);for(const t of i){if(null!=t._targetX&&null!=t._targetY){const e=t.y;t.x=ht(t.x,t._targetX,n),t.y=ht(e,t._targetY,n)}null!=t._targetOpacity&&(t.style={...t.style,opacity:t._targetOpacity*n})}if(e>=1){for(const t of i)null!=t._targetX&&(t.x=t._targetX,t.y=t._targetY,t._targetX=void 0,t._targetY=void 0),null!=t._targetOpacity&&(t.style={...t.style,opacity:t._targetOpacity},t._targetOpacity=void 0);return this.activeTransition=null,!1}return!0}};ye.QUADTREE_THRESHOLD=500;var ve=ye;function be(t,e,n,i,o,r,s=0,a=i){if(r){const t=S(r,e,n,i,s);if(t)return t}else{let o=null,r=i;for(const s of t){if("point"!==s.type)continue;if(!1===s.interactive)continue;const t=s.x-e,a=s.y-n,c=Math.sqrt(t*t+a*a);k(s.r,i)>=c&&r>c&&(o=s,r=c)}if(o)return{node:o,distance:r}}let c=null,l=i;for(const o of t){if("glyph"!==o.type)continue;if(null==o.datum)continue;const t=At(o.glyph,o.size),r=o.x+t.centerDx-e,s=o.y+t.centerDy-n,a=Math.sqrt(r*r+s*s);k(t.radius,i)>=a&&l>a&&(c=o,l=a)}if(c)return{node:c,distance:l};for(let i=t.length-1;i>=0;i--){const r=t[i];if("geoarea"!==r.type)continue;const s=r;if(!1===s.interactive)continue;const[[a,c],[l,u]]=s.bounds;if(!(a>e||e>l||c>n||n>u)&&(s._cachedPath2D||(s._cachedPath2D=new Path2D(s.pathData)),o.isPointInPath(s._cachedPath2D,e,n)))return{node:s,distance:0}}let u=null,h=a;for(const i of t){if("line"!==i.type)continue;const t=i,{path:o}=t,r=Math.max((t.style.strokeWidth||2)+4,5,a);for(let i=0;o.length-1>i;i++){const[s,a]=o[i],[c,l]=o[i+1],d=we(e,n,s,a,c,l);r>=d&&h>d&&(u=t,h=d)}}return u?{node:u,distance:h}:null}function we(t,e,n,i,o,r){const s=o-n,a=r-i,c=s*s+a*a;if(0===c)return Math.sqrt((t-n)**2+(e-i)**2);let l=((t-n)*s+(e-i)*a)/c;return l=Math.max(0,Math.min(1,l)),Math.sqrt((t-(n+l*s))**2+(e-(i+l*a))**2)}b(ve);import{useMemo as Pe,useRef as xe}from"react";import{jsx as Re,jsxs as Le}from"react/jsx-runtime";function Se(t){const{width:e,height:n,totalWidth:i,totalHeight:o,margin:r,showAxes:s,title:a,legend:c,legendHoverBehavior:l,legendClickBehavior:u,legendHighlightedCategory:h,legendIsolatedCategories:d,legendPosition:p,legendLayout:f,foregroundGraphics:m,annotations:g,onAnnotationActivate:y,onObservation:v,chartId:b,chartType:w,autoPlaceAnnotations:P,svgAnnotationRules:x,pointNodes:R,geoProjection:L}=t,S=wt({onAnnotationActivate:y,onObservation:v,chartId:b,chartType:w}),A=xe([g?.length??0,new Map]),k=g?.length??0;A.current[0]!==k&&(A.current=[k,new Map]);const C=Pe(()=>{if(!g||0===g.length)return null;const t=O(g),i=L?t.map(t=>{if(!Array.isArray(t.coordinates)||2>t.coordinates.length)return t;const e=L(Number(t.coordinates[0]),Number(t.coordinates[1]));return e?{...t,x:e[0],y:e[1]}:t}):t,o={scales:{x:t=>Number(t),y:t=>Number(t)},timeAxis:"x",width:e,height:n,frameType:"xy",pointNodes:R,stickyPositionCache:A.current[1]},r=P?K({annotations:i,context:o,..."object"==typeof P?P:{}}):i;return gt(r,it("xy",S),x,o)},[g,P,x,e,n,R,S,L]);return s||a||c||m||C&&C.length>0?Le("svg",{role:"img",width:i,height:o,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[Re("title",{children:"string"==typeof a?a:"XY Chart"}),Re("desc",{children:"string"==typeof a?a+" (XY data visualization)":"XY data visualization"}),Le("g",{transform:"translate("+r.left+","+r.top+")",children:[C,m]}),a&&"string"==typeof a?Re("text",{x:i/2,y:$,textAnchor:"middle",fontWeight:"bold",fill:"var(--semiotic-text, #333)",className:"semiotic-chart-title",style:{userSelect:"none",fontSize:"var(--semiotic-title-font-size, 14px)"},children:a}):a?Re("foreignObject",{x:0,y:0,width:i,height:r.top,children:a}):null,yt({legend:c,totalWidth:i,totalHeight:o,margin:r,legendPosition:p,title:a,legendLayout:f,legendHoverBehavior:l,legendClickBehavior:u,legendHighlightedCategory:h,legendIsolatedCategories:d})]}):null}import{zoom as Ae,zoomIdentity as ke}from"d3-zoom";import{select as Ce}from"d3-selection";function je([t,e,n]){const i=1<<n;return[t-Math.floor(t/i)*i,e,n]}function De(t,e,n,i,o){return"function"==typeof t?t(e,n,i,o):t.replace("{z}",e+"").replace("{x}",n+"").replace("{y}",i+"").replace("{r}",o>1?"@2x":"")}var Me=class{constructor(t=256){this.cache=new Map,this.limit=t}get(t){const e=this.cache.get(t);return e&&(e.lastUsed=performance.now()),e}set(t,e){this.cache.set(t,e),this.cache.size>this.limit&&this.evict()}evict(){for(;this.cache.size>this.limit;){let t,e=1/0;for(const[n,i]of this.cache)e>i.lastUsed&&(e=i.lastUsed,t=n);if(!t)break;{const e=this.cache.get(t);e&&(e.img.onload=null,e.img.onerror=null,e.img.src=""),this.cache.delete(t)}}}clear(){for(const t of this.cache.values())t.img.onload=null,t.img.onerror=null,t.img.src="";this.cache.clear()}};var Te=class{constructor(t){this.capacity=t,this.particles=Array(t);for(let e=0;t>e;e++)this.particles[e]={t:0,offset:0,lineIndex:0,active:!1,x:0,y:0}}spawn(t,e=Math.random){for(let n=0;this.capacity>n;n++){const i=this.particles[n];if(!i.active)return i.active=!0,i.t=0,i.offset=.6*(e()-.5),i.lineIndex=t,i.x=0,i.y=0,i}return null}step(t,e,n,i){for(let o=0;this.capacity>o;o++){const r=this.particles[o];if(!r.active)continue;const s=n[r.lineIndex];if(!s||2>s.length){r.active=!1;continue}if(r.t+=t*e,r.t>=1){r.active=!1;continue}const a=Be(s),c=_e(s,r.t*a),l=(i[r.lineIndex]||2)/2;r.x=c.x+c.nx*r.offset*l*2,r.y=c.y+c.ny*r.offset*l*2}}countForLine(t){let e=0;for(let n=0;this.capacity>n;n++)this.particles[n].active&&this.particles[n].lineIndex===t&&e++;return e}clear(){for(let t=0;this.capacity>t;t++)this.particles[t].active=!1}};function Be(t){let e=0;for(let n=1;t.length>n;n++){const i=t[n][0]-t[n-1][0],o=t[n][1]-t[n-1][1];e+=Math.sqrt(i*i+o*o)}return e}function _e(t,e){let n=0;for(let i=1;t.length>i;i++){const o=t[i][0]-t[i-1][0],r=t[i][1]-t[i-1][1],s=Math.sqrt(o*o+r*r);if(n+s>=e||i===t.length-1){const a=s>0?(e-n)/s:0,c=s>.001?s:1;return{x:t[i-1][0]+o*a,y:t[i-1][1]+r*a,nx:-r/c,ny:o/c}}n+=s}const i=t[t.length-1];return{x:i[0],y:i[1],nx:0,ny:0}}function Ie(t){if(!t)return;const e=[];for(const n of t)if("point"===n.type)e.push(n);else if("glyph"===n.type){const t=n,i=At(t.glyph,t.size);e.push({pointId:t.pointId,x:t.x+i.centerDx,y:t.y+i.centerDy,r:i.radius})}return e}import{jsx as Ne,jsxs as Ee}from"react/jsx-runtime";function Oe({data:t}){if(!t)return null;if(t.properties)return Ne("div",{className:"semiotic-tooltip",style:ot,children:Ne("div",{style:{fontWeight:600},children:t.properties.name||t.properties.NAME||t.properties.id||"Feature"})});const e=null!=t.data?t.data:t;if(!e||"object"!=typeof e)return null;const n=bt(e),i=null!=n.title?n.title+"":null;return null==i&&0===n.entries.length?null:Ee("div",{className:"semiotic-tooltip",style:ot,children:[null!=i&&Ne("div",{style:{fontWeight:600,marginBottom:n.entries.length?2:0},children:i}),n.entries.map(t=>Ee("div",{children:[Ee("span",{style:{opacity:.7},children:[t.key,": "]}),Ne("span",{style:{fontWeight:600},children:A(t.value)})]},t.key))]})}Oe.ownsChrome=!0;var Fe={top:10,right:10,bottom:10,left:10},We=null;function He(){if(null!==We)return We;if("undefined"==typeof window)return!1;const t="function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,e="undefined"!=typeof navigator&&"number"==typeof navigator.hardwareConcurrency&&4>=navigator.hardwareConcurrency,n="undefined"!=typeof navigator&&"number"==typeof navigator.deviceMemory&&4>=navigator.deviceMemory;return We=t||e||n}function ze(){return He()?12:30}var Ge={width:28,height:28,border:"1px solid rgba(0,0,0,0.2)",borderRadius:4,background:"rgba(255,255,255,0.9)",color:"#333",fontSize:16,fontWeight:600,lineHeight:1,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0,boxShadow:"0 1px 3px rgba(0,0,0,0.1)"};function qe(t){return"string"==typeof t?t:"object"==typeof t&&t&&"type"in t?t.type:null}function Ze(t){return t?t.getContext("2d"):null}import{jsx as Xe,jsxs as Ue}from"react/jsx-runtime";var Ye=Et(Nt(function(t,e){const{projection:o,projectionExtent:r,fitPadding:s,projectionTransform:a,areas:l,points:h,lines:b,customLayout:w,layoutConfig:P,layoutSelection:R,onLayoutError:L,xAccessor:S,yAccessor:A,lineDataAccessor:k,pointIdAccessor:N,lineIdAccessor:O,lineType:F="geo",flowStyle:W="basic",graticule:X,zoomable:$,zoomExtent:V,onZoom:K,dragRotate:et,showParticles:nt,particleStyle:it,tileURL:ot,tileAttribution:ht,tileCacheSize:dt,size:pt,width:gt,height:yt,responsiveWidth:bt,responsiveHeight:wt,margin:Lt,className:At,background:kt,windowSize:Nt=500,renderMode:Et,areaStyle:Ot,pointStyle:Ft,lineStyle:Wt,colorScheme:Ht,enableHover:zt=!0,hoverAnnotation:Gt,tooltipContent:qt,allowTooltipOverflow:Zt=!1,customClickBehavior:Xt,customHoverBehavior:Ut,onObservation:Yt,annotationObservationCallback:Qt,chartId:$t,annotations:Vt,onAnnotationActivate:Kt,autoPlaceAnnotations:Jt,svgAnnotationRules:te,decay:ee,pulse:ne,transition:ie,animate:oe,staleness:re,frameScheduler:se,clock:ae,random:ce,seed:le,paused:ue=!1,suspendWhenHidden:he=!0,backgroundGraphics:de,foregroundGraphics:pe,title:fe,legend:me,legendPosition:ge,legendLayout:ye,legendHoverBehavior:we,legendClickBehavior:Pe,legendHighlightedCategory:xe,legendIsolatedCategories:Re,legendCategoryAccessor:Le,onCategoriesChange:Be,showAxes:_e,accessibleTable:Ne=!0,description:Ee,summary:We}=t,{customHoverBehavior:Ye,customClickBehavior:Qe,hasClickBehavior:$e}=f({customHoverBehavior:Ut,customClickBehavior:Xt,onObservation:Yt,chartId:$t,chartType:"StreamGeoFrame"}),Ve=pt||[gt||600,yt||400],Ke=Dt(!0),Je=Pt({sizeProp:Ve,responsiveWidth:bt,responsiveHeight:wt,userMargin:Lt,marginDefault:Fe,title:fe,legend:me,legendPosition:ge,foregroundGraphics:pe,backgroundGraphics:de,animate:oe,transitionProp:ie,frameScheduler:se,clock:ae,random:ce,seed:le,paused:ue,suspendWhenHidden:he,themeDirtyRef:Ke}),{reducedMotionRef:tn,responsiveRef:en,size:nn,margin:on,adjustedWidth:rn,adjustedHeight:sn,resolvedForeground:an,resolvedBackground:cn,transition:ln,introEnabled:un,tableId:hn,frameRuntime:dn,rafRef:pn,renderFnRef:fn,scheduleRender:mn,currentTheme:gn}=Je,yn=Ct(),vn=jt(),bn=Bt(()=>Array.isArray(l)?rt(l):l,[l]),wn=Bt(()=>rt(h),[h]),Pn=Bt(()=>rt(b),[b]),xn=Bt(()=>null!=et?et:"orthographic"===qe(o),[et,o]),Rn=Bt(()=>({projection:o,projectionExtent:r,fitPadding:s,xAccessor:S,yAccessor:A,lineDataAccessor:k,lineType:F,flowStyle:W,areaStyle:Ot,pointStyle:Ft,lineStyle:Wt,colorScheme:Ht,themeSemantic:St(gn),themeSequential:gn?.colors?.sequential,themeDiverging:gn?.colors?.diverging,themeCategorical:gn?.colors?.categorical,graticule:X,projectionTransform:a,windowSize:Nt,clock:dn.now,decay:ee,pulse:ne,transition:ln,introAnimation:un,annotations:Vt,pointIdAccessor:N,lineIdAccessor:O,customLayout:w,layoutConfig:P,onLayoutError:L,layoutMargin:on}),[o,r,s,S,A,k,F,W,Ot,Ft,Wt,Ht,gn,X,a,Nt,dn.now,ee,ne,ln,un,Vt,N,O,w,P,L,on]),Ln=_(Rn),Sn=Dt(null);Sn.current||(Sn.current=new ve(Ln));const An=Dt(null),kn=Dt(null),Cn=Dt(null);ot&&!Cn.current&&(Cn.current=new Me(dt||256));const jn=Dt(Vt),Dn=Dt(null),Mn=Dt(ke),Tn=Dt(!1),Bn=Dt(null),_n=_t(t=>{Bn.current=t,en&&"object"==typeof en&&(en.current=t)},[en]),In=Dt(null),Nn=Dt(null),En=Dt(null),On=Dt(0);if(nt&&!En.current){const t=it?.maxPerLine??ze();En.current=new Te(50*t)}const Fn=Dt(null),Wn=Dt(null),Hn=Dt(!1),zn=Dt(!1),Gn=Rt("StreamGeoFrame"),qn=Dt(void 0),[Zn,Xn]=Mt(null),[,Un]=Mt(0),Yn=Dt(0),[Qn,$n]=Mt(!1),Vn=p(Sn,Le,Be,t=>t.getPoints());T(Sn,Ln,Ke,mn),B(Sn,R,Ke,mn),Tt(()=>{const t=Sn.current;t&&(bn&&t.setAreas(bn),h&&t.setPoints(wn),b&&t.setLines(Pn),Ke.current=!0,mn())},[bn,h,wn,b,Pn,mn]);const Kn=_t(t=>{null!=t&&"object"==typeof t&&(Sn.current?.pushPoint(t),Ke.current=!0,mn())},[mn]),Jn=_t(t=>{const e=rt(t);0!==e.length&&(Sn.current?.pushMany(e),Ke.current=!0,mn())},[mn]),ti=_t(t=>{null!=t&&"object"==typeof t&&(Sn.current?.pushLine(t),Ke.current=!0,mn())},[mn]),ei=_t(t=>{const e=rt(t);0!==e.length&&(Sn.current?.pushManyLines(e),Ke.current=!0,mn())},[mn]),ni=_t(()=>{Sn.current?.clear(),Ke.current=!0,mn()},[mn]);It(e,()=>({push:Kn,pushMany:Jn,removePoint:t=>{const e=Sn.current?.removePoint(t)??[];return e.length>0&&(Ke.current=!0,mn()),e},pushLine:ti,pushManyLines:ei,removeLine:t=>{const e=Sn.current?.removeLine(t)??[];return e.length>0&&(Ke.current=!0,mn()),e},getLines:()=>Sn.current?.getLines()??[],clear:ni,getProjection:()=>Sn.current?.scales?.projection??null,getGeoPath:()=>Sn.current?.scales?.geoPath??null,getCartogramLayout:()=>Sn.current?.cartogramLayout??null,getCustomLayout:()=>Sn.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>Sn.current?.lastCustomLayoutFailure??null,getZoom:()=>Mn.current.k,resetZoom:()=>{const t=Bn.current;t&&Dn.current&&Ce(t).call(Dn.current.transform,ke)},getData:()=>Sn.current?.getPoints()??[]}),[Kn,Jn,ti,ei,ni,mn]);const{hoverHandlerRef:ii,onPointerMove:oi,onPointerLeave:ri}=Je,{canvasRef:si,interactionCanvasRef:ai}=xt(Je,{hydrated:yn,wasHydratingFromSSR:vn,storeRef:Sn,dirtyRef:Ke,cleanup:()=>Cn.current?.clear(),canvasPaintDependencies:[rn,sn,kt,de,Et,mn]});Tt(()=>{ii.current=t=>{if(!zt)return;const e=Sn.current;if(!e||!e.scene.length)return;const n=si.current;if(!n)return;const i=n.getBoundingClientRect(),o=t.clientX-i.left-on.left,r=t.clientY-i.top-on.top;if(0>o||o>rn||0>r||r>sn)return Fn.current=null,Wn.current=null,Xn(null),Ye?.(null),void mn();kn.current||(kn.current="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"));const s=Ze(kn.current);if(!s)return;const a=ct(30,t.pointerType),c=ct(6,t.pointerType),l=be(e.scene,o,r,a,s,e.quadtree,e.maxPointRadius,c);if(l){const t=l.node,e=t.datum,n=Array.isArray(e)?null:e?.properties?e:e?.data||e;let i,s;"point"===t.type?(i=t.x,s=t.y):"geoarea"===t.type?(i=t.centroid[0],s=t.centroid[1]):(i=o,s=r);const a={...n,...n?.properties||{},data:n,properties:n?.properties,__semioticHoverData:!0,x:i,y:s};Fn.current=a,Wn.current=t,Xn(a),Ye?.(a),mn()}else Fn.current&&(Fn.current=null,Wn.current=null,Xn(null),Ye?.(null),mn())}},[zt,rn,sn,on,Ye,mn,ii,si]),Je.hoverLeaveRef.current=()=>{Fn.current=null,Wn.current=null,Xn(null),Ye?.(null),mn()};const ci=_t(t=>{if(lt(t.target))return;if(!Qe)return;const e=Sn.current;if(!e||!e.scene.length)return void Qe(null);const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left-on.left,o=t.clientY-n.top-on.top;if(0>i||i>rn||0>o||o>sn)return void Qe(null);kn.current||(kn.current="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"));const r=Ze(kn.current);if(!r)return void Qe(null);const s=ct(30,qn.current),a=ct(6,qn.current),c=be(e.scene,i,o,s,r,e.quadtree,e.maxPointRadius,a);if(c){const t=c.node.datum,e=Array.isArray(t)?null:t?.properties?t:t?.data||t,n=e?.properties?{...e,...e.properties}:e;return void Qe({...n,data:e,properties:e?.properties,__semioticHoverData:!0,x:i,y:o,time:i,value:o},{type:"activate",inputType:ft(qn.current)})}Qe(null)},[sn,rn,Qe,on]),{kbFocusIndexRef:li,focusedNavPointRef:ui,onKeyDown:hi}=d({storeRef:Sn,hoverRef:Fn,hoveredNodeRef:Wn,setHoverPoint:Xn,customHoverBehavior:Ye,customClickBehavior:Qe,scheduleRender:mn}),di=_t(t=>{qn.current=t.pointerType,li.current=-1,ui.current=null,oi(t)},[ui,li,oi]),pi=_t(t=>{qn.current=t.pointerType},[]);fn.current=()=>{if(pn.current=null,!dn.isActive)return;const t=si.current,e=Sn.current;if(!t||!e)return;const o=dn.now();let r=!1;const s=Nn.current;let a=!1;s&&(Nn.current=null,e.applyRotation(s,{width:rn,height:sn}),a=!0);const l=e.advanceTransition(tn.current?o+1e6:o),h=!tn.current&&l,d=Gn.current.beforeCompute(e.getLastUpdateResult(),h);let p=!1;if(Ke.current&&!l){const n={width:rn,height:sn},i=e.hasProjection(),o=xn&&i?e.getRotation():null;e.computeScene(n);const r=Mn.current,s=1!==r.k||0!==r.x||0!==r.y;xn&&o?s?(e.setRotation(o),e.applyZoomScale(r.k,n)):e.applyRotation(o,n):s&&e.applyZoomTransform(r,n),Ke.current=!1,p=!0,t.setAttribute("aria-label",tt(e.scene,"Geographic chart")),Vn()}Gn.current.afterCompute(d,p,!1);const f=at(),v=nt&&!tn.current&&!!En.current,b=e.consumeStylePaintPending(),w=u(e,o,p,zn),P=m({dirtyOrRebuilt:p,transitioning:h,continuous:v,liveEncoding:w.changed,forced:a||b});if(ot&&Cn.current){const t=An.current;if(t&&e.scales?.projection){const n=mt(t,nn,on,f);if(n){n.clearRect(-on.left,-on.top,nn[0],nn[1]),n.save(),n.beginPath(),n.rect(0,0,rn,sn),n.clip();const t=function(t,e){const{tileURL:n,projection:i,width:o,height:r,tileCache:s,onTileLoad:a}=e,c=i.scale(),l=i.translate(),u=function(t){const{size:e,scale:n,translate:i,clampX:o=!0,clampY:r=!0}=t,s=Math.max(Math.log(n)/Math.LN2-8,0),a=Math.round(s),c=1<<a,l=Math.pow(2,s-a+8),u=i[0]-n/2,h=i[1]-n/2,d=Math.max(o?0:-1/0,Math.floor((0-u)/l)),p=Math.min(o?c:1/0,Math.ceil((e[0]-u)/l)),f=Math.max(r?0:-1/0,Math.floor((0-h)/l)),m=Math.min(r?c:1/0,Math.ceil((e[1]-h)/l)),g=[];for(let t=f;m>t;++t)for(let e=d;p>e;++e)g.push([e,t,a]);return{tiles:g,translate:[u/l,h/l],scale:l}}({size:[o,r],scale:2*c*Math.PI,translate:l}),h=at();let d=!0;for(const e of u.tiles){const[i,o,r]=je(e),c=`${r}/${i}/${o}`;let l=s.get(c);if(!l){const t=new Image;t.crossOrigin="anonymous";const e={img:t,loaded:!1,key:c,lastUsed:performance.now()};s.set(c,e),t.onload=()=>{e.loaded=!0,a?.()},t.onerror=()=>{e.loaded=!0},t.src=De(n,r,i,o,h),l=e}if(!l.loaded){d=!1;continue}const p=u.scale;t.drawImage(l.img,(e[0]+u.translate[0])*p-.5,(e[1]+u.translate[1])*p-.5,p+1,p+1)}return d}(n,{tileURL:ot,projection:e.scales.projection,width:rn,height:sn,tileCache:Cn.current,onTileLoad:()=>mn()});n.restore(),t||(r=!0)}}}if(P){const i=mt(t,nn,on,f);if(!i)return;i.clearRect(-on.left,-on.top,nn[0],nn[1]),ot||y(i,{background:kt,hasBackgroundGraphics:!!de,width:rn,height:sn}),i.save(),i.beginPath(),i.rect(0,0,rn,sn),i.clip();const s=e.scene,a=e.scales,l={width:rn,height:sn};if(j({context:i,nodes:s,renderMode:Et,pixelRatio:f,paintBuiltIn:t=>{!function(t,e){const n=e.filter(t=>"geoarea"===t.type);for(const e of n){if(!e.pathData)continue;e._cachedPath2D||(e._cachedPath2D=new Path2D(e.pathData));const n=e._cachedPath2D,i=J(t,e.style.fill)||"#e0e0e0";if("none"!==i&&(t.fillStyle=i,t.globalAlpha=(e._decayOpacity??1)*(e.style.fillOpacity??1),t.fill(n)),e.style.stroke&&"none"!==e.style.stroke){if(t.strokeStyle=vt(t,e.style.stroke)||e.style.stroke,t.lineWidth=e.style.strokeWidth||.5,t.globalAlpha=e._decayOpacity??1,e.style.strokeDasharray){const n=e.style.strokeDasharray.split(",").map(Number);t.setLineDash(n)}else t.setLineDash([]);t.stroke(n)}D(t,e,n),t.globalAlpha=1,t.setLineDash([])}}(i,t),n(i,t,a,l),c(i,t,a,l),C(i,t,a,l)}}),v&&En.current){const t=En.current,e=s.filter(t=>"line"===t.type);if(e.length>0){const n=it||{},s=.3*(n.speedMultiplier??1),a=n.maxPerLine??ze(),c=n.spawnRate??(He()?.06:.15),l=n.radius??2,u=n.opacity??.7,h=o/1e3,d=On.current>0?Math.min(h-On.current,.1):.016;On.current=h;const p=e.map(t=>t.path),f=e.map(t=>t.style.strokeWidth||2);for(let n=0;e.length>n;n++)dn.random()<c&&t.countForLine(n)<a&&t.spawn(n,dn.random);t.step(d,s,p,f),i.globalAlpha=u;for(let o=0;t.particles.length>o;o++){const r=t.particles[o];if(!r.active)continue;const s=e[r.lineIndex],a="function"==typeof n.color?n.color(s?.datum??{}):"source"!==n.color&&n.color?n.color:s?.style.stroke||"#fff";i.beginPath(),i.arc(r.x,r.y,l,0,2*Math.PI),i.fillStyle=a,i.fill()}i.globalAlpha=1,r=!0}}i.restore()}const x=Wn.current,R=!(!x||"geoarea"!==x.type&&"point"!==x.type),L=g(R,Hn.current),S=ai.current;if(S&&L){const t=mt(S,nn,on,f);if(t){if(t.clearRect(-on.left,-on.top,nn[0],nn[1]),x&&"geoarea"===x.type){const e=new Path2D(x.pathData);t.fillStyle="rgba(255, 255, 255, 0.3)",t.fill(e),t.strokeStyle="rgba(0, 0, 0, 0.5)",t.lineWidth=2,t.stroke(e)}if(x&&"point"===x.type){const e=x,n="object"==typeof Gt?Gt:void 0,o=n?.pointColor||i(x);t.beginPath(),t.arc(e.x,e.y,e.r+3,0,2*Math.PI),o?(t.save(),t.globalAlpha=.4,t.fillStyle=o,t.fill(),t.restore()):(t.fillStyle="rgba(255, 255, 255, 0.4)",t.fill()),t.strokeStyle=o||"rgba(0, 0, 0, 0.5)",t.lineWidth=2,t.stroke()}}Hn.current=R}const A=Vt!==jn.current;A&&(jn.current=Vt),(p||A||h&&Vt&&Vt.length>0)&&(p||A||o-Yn.current>=33)&&(Un(t=>t+1),Yn.current=o),(h||null!=e.activeTransition||w.pending||r)&&mn()},I(re,Sn,Ke,mn,Qn,$n),Tt(()=>{if("production"!==process.env.NODE_ENV&&ot){const t=qe(o);t&&"mercator"!==t&&console.warn(`[StreamGeoFrame] tileURL is set but projection is "${t}". Raster tiles use Web Mercator and will not align with other projections.`)}},[ot,o]),Tt(()=>{const t=Bn.current;if(!$||!t)return Dn.current&&t&&(Ce(t).on(".zoom",null),Dn.current=null),void(t&&Ce(t).on("mousedown.rotate",null).on("touchstart.rotate",null));const[e,n]=V||[1,8],i={width:rn,height:sn};if(xn){let o=Mn.current.k;const r=t=>{o=Math.max(e,Math.min(n,t)),Mn.current=ke.scale(o);const r=Sn.current;r&&(r.applyZoomScale(o,i),Ke.current=!1,mn(),r.scales?.projection&&K?.({projection:r.scales.projection,zoom:r.currentZoom}))};Dn.current={scaleBy:(t,e)=>r(o*e),transform:(t,e)=>r(e?.k??1)};const s=t=>{t.preventDefault(),r(o*(0>t.deltaY?1.1:1/1.1))},a=t=>{const e=t.target;e&&(e.closest("button")||e.closest(".stream-geo-zoom-controls"))||(t.preventDefault(),r(1.5*o))};t.addEventListener("wheel",s,{passive:!1}),t.addEventListener("dblclick",a);const c=.4,l=e=>{if(0!==e.button)return;const n=e.target;if(n.closest("button")||n.closest(".stream-geo-zoom-controls"))return;const i=Sn.current;if(!i)return;const o=i.getRotation();In.current={x:e.clientX,y:e.clientY,rotation:[...o]},t.setPointerCapture(e.pointerId),e.preventDefault()},u=t=>{const e=In.current;e&&(Nn.current=[e.rotation[0]+(t.clientX-e.x)*c,Math.max(-90,Math.min(90,e.rotation[1]-(t.clientY-e.y)*c)),e.rotation[2]],mn())},h=e=>{if(!In.current)return;In.current=null,t.releasePointerCapture(e.pointerId);const n=Nn.current;if(n){Nn.current=null;const t=Sn.current;t&&(t.applyRotation(n,i),mn())}const o=Sn.current;o?.scales?.projection&&K?.({projection:o.scales.projection,zoom:o.currentZoom})};return t.addEventListener("pointerdown",l),t.addEventListener("pointermove",u),t.addEventListener("pointerup",h),t.addEventListener("pointercancel",h),()=>{t.removeEventListener("wheel",s),t.removeEventListener("dblclick",a),t.removeEventListener("pointerdown",l),t.removeEventListener("pointermove",u),t.removeEventListener("pointerup",h),t.removeEventListener("pointercancel",h),Dn.current=null}}const o=Ae().scaleExtent([e,n]).extent([[0,0],[nn[0],nn[1]]]).translateExtent([[-1/0,-1/0],[1/0,1/0]]).on("zoom",t=>{const e=t.transform;Mn.current=e,Tn.current=!0;const n=Sn.current;n&&(n.applyZoomTransform(e,i),Ke.current=!1,mn())}).on("end",t=>{Mn.current=t.transform,Tn.current=!1;const e=Sn.current;e?.scales?.projection&&K?.({projection:e.scales.projection,zoom:e.currentZoom})});return Dn.current=o,Ce(t).call(o),()=>{Ce(t).on(".zoom",null)}},[$,V,xn,nn,rn,sn,on,K,mn]);const fi=zt&&!1!==Gt,mi=fi&&Zn?qt?qt(Zn):Xe(Oe,{data:Zn}):null,gi=mi?Xe(q,{x:Zn.x,y:Zn.y,containerWidth:rn,containerHeight:sn,margin:on,className:"stream-frame-tooltip",zIndex:10,children:mi}):null;if(ut||!yn&&vn){const t=Sn.current;t&&(bn||h||b)&&(bn&&t.setAreas(bn),h&&t.setPoints(wn),b&&t.setLines(Pn),t.computeScene({width:rn,height:sn}));const e=t?.scene??[];return Ue("div",{ref:_n,className:"stream-geo-frame"+(At?" "+At:""),role:"img","aria-label":Ee||("string"==typeof fe?fe:"Geographic chart"),style:{position:"relative",width:bt?"100%":nn[0],height:wt?"100%":nn[1]},children:[Xe(Y,{summary:We}),Ue("svg",{xmlns:"http://www.w3.org/2000/svg",width:nn[0],height:nn[1],style:{position:"absolute",left:0,top:0},children:[Xe("g",{transform:`translate(${on.left},${on.top})`,children:cn}),Ue("g",{transform:`translate(${on.left},${on.top})`,children:[kt&&Xe("rect",{x:0,y:0,width:rn,height:sn,fill:kt}),e.map((t,e)=>M({node:t,index:e,renderMode:Et,fallback:()=>st(t,e)}))]})]}),Xe(Se,{width:rn,height:sn,totalWidth:nn[0],totalHeight:nn[1],margin:on,showAxes:!1,title:fe,legend:me,legendPosition:ge,legendLayout:ye,legendHoverBehavior:we,legendClickBehavior:Pe,legendHighlightedCategory:xe,legendIsolatedCategories:Re,foregroundGraphics:x(an,E(Sn.current?.customLayoutOverlays,R??null)),annotations:Vt,onAnnotationActivate:Kt,onObservation:Qt??Yt,chartId:$t,chartType:"StreamGeoFrame",autoPlaceAnnotations:Jt,svgAnnotationRules:te,pointNodes:Ie(e),geoProjection:Sn.current?.scales?.projectedPoint})]})}return Ue("div",{ref:_n,className:"stream-geo-frame"+(At?" "+At:""),role:"group","aria-label":Ee||("string"==typeof fe?fe:"Geographic chart"),tabIndex:0,style:{position:"relative",width:bt?"100%":nn[0],height:wt?"100%":nn[1],overflow:Zt?"visible":"hidden",...$?{touchAction:"none"}:{}},onKeyDown:hi,children:["production"!==process.env.NODE_ENV&&Sn.current&&Xe(U,{store:Sn.current,diagnostics:Gn.current}),Ne&&Xe(Q,{tableId:hn}),Ne&&Xe(H,{scene:Sn.current?.scene??[],chartType:"Geographic chart",tableId:hn,chartTitle:"string"==typeof fe?fe:void 0}),Xe(Y,{summary:We}),Xe(z,{hoverPoint:Zn}),Ue("div",{role:"img","aria-label":Ee||("string"==typeof fe?fe:"Geographic chart"),style:{position:"relative",width:"100%",height:"100%"},onPointerMove:fi?di:void 0,onPointerLeave:fi?ri:void 0,onPointerDown:fi||$e?pi:void 0,onClick:$e?ci:void 0,children:[Xe(G,{size:nn,margin:on,children:cn}),ot&&Xe("canvas",{ref:An,style:{position:"absolute",left:0,top:0,pointerEvents:"none"}}),Xe("canvas",{ref:si,"aria-label":tt(Sn.current?.scene??[],"Geographic chart"),style:{position:"absolute",left:0,top:0}}),Xe("canvas",{ref:ai,style:{position:"absolute",left:0,top:0,pointerEvents:"none"}}),Xe(Se,{width:rn,height:sn,totalWidth:nn[0],totalHeight:nn[1],margin:on,showAxes:_e,title:fe,legend:me,legendPosition:ge,legendLayout:ye,legendHoverBehavior:we,legendClickBehavior:Pe,legendHighlightedCategory:xe,legendIsolatedCategories:Re,foregroundGraphics:x(an,E(Sn.current?.customLayoutOverlays,R??null)),annotations:Vt,onAnnotationActivate:Kt,onObservation:Qt??Yt,chartId:$t,chartType:"StreamGeoFrame",autoPlaceAnnotations:Jt,svgAnnotationRules:te,pointNodes:Ie(Sn.current?.scene),geoProjection:Sn.current?.scales?.projectedPoint}),re?.showBadge&&Xe(v,{isStale:Qn,position:re.badgePosition}),$&&Ue("div",{className:"stream-geo-zoom-controls",style:{position:"absolute",bottom:on.bottom+8,left:on.left+8,display:"flex",flexDirection:"column",gap:2,zIndex:2},children:[Xe("button",{type:"button","aria-label":"Zoom in",onClick:t=>{t.stopPropagation();const e=Bn.current,n=Dn.current;e&&n?.scaleBy&&n.scaleBy(Ce(e),1.5)},style:Ge,children:"+"}),Xe("button",{type:"button","aria-label":"Zoom out",onClick:t=>{t.stopPropagation();const e=Bn.current,n=Dn.current;e&&n?.scaleBy&&n.scaleBy(Ce(e),1/1.5)},style:Ge,children:"−"})]}),ht&&Xe("div",{className:"stream-geo-tile-attribution",style:{position:"absolute",bottom:on.bottom+2,right:on.right+4,fontSize:10,color:"rgba(0,0,0,0.6)",background:"rgba(255,255,255,0.7)",padding:"1px 4px",borderRadius:2,pointerEvents:"none",zIndex:2},children:ht}),Xe(Z,{active:li.current>=0,hoverPoint:Zn,margin:on,size:nn,shape:ui.current?.shape,width:ui.current?.w,height:ui.current?.h,pathData:ui.current?.pathData}),gi]})]})}));Ye.displayName="StreamGeoFrame";var Qe=Ye;import{forwardRef as $e,useMemo as Ve}from"react";import{jsx as Ke}from"react/jsx-runtime";var Je=$e(function(n,i){const{points:o,areas:r,lines:s,layout:a,layoutConfig:c,onLayoutError:l,projection:u="equirectangular",xAccessor:h="lon",yAccessor:d="lat",lineDataAccessor:p,colorBy:f,colorScheme:m,tooltip:g,annotations:y,margin:v,selection:b,linkedHover:x,onObservation:R,onClick:L,chartId:S,loading:A,loadingContent:k,emptyContent:C,className:j,frameProps:D={}}=n,{frameRef:M,resolved:T,normalizedMargin:B}=e({imperativeRef:i,imperativeVariant:"geo-points",margin:v,width:n.width,height:n.height,enableHover:n.enableHover,title:n.title,description:n.description,summary:n.summary,accessibleTable:n.accessibleTable,mode:n.mode,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,responsiveRules:n.responsiveRules}),_=Ve(()=>rt(o),[o]),I=Ve(()=>rt(r),[r]),N=Ve(()=>rt(s),[s]),E=Ve(()=>[..._,...N,...I],[_,N,I]),O=t({data:E,rawData:void 0!==o||void 0!==s||void 0!==r?E:void 0,colorBy:f,colorScheme:m,legendInteraction:void 0,selection:b,linkedHover:x,fallbackFields:"string"==typeof f?[f]:[],unwrapData:!1,onObservation:R,onClick:L,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"GeoCustomChart",chartId:S,showLegend:!1,userMargin:B,marginDefaults:T.marginDefaults,loading:A,loadingContent:k,emptyContent:C,width:T.width,height:T.height,hasTitle:!!T.title}),F=O.effectiveSelectionHook,W=Ve(()=>F?.isActive?{isActive:!0,predicate:F.predicate}:null,[F?.isActive,F?.predicate]);if(O.earlyReturn)return O.earlyReturn;const{width:H,height:z,enableHover:G,title:q,description:Z,summary:X,accessibleTable:U}=T,Y=dt(g),Q={projection:u,...null!=o&&{points:_},...null!=r&&{areas:I},...null!=s&&{lines:N},xAccessor:h,yAccessor:d,...null!=p&&{lineDataAccessor:p},customLayout:a,layoutConfig:c,onLayoutError:l,layoutSelection:W,colorBy:f,colorScheme:m,size:[H,z],responsiveWidth:n.responsiveWidth,responsiveHeight:n.responsiveHeight,margin:O.margin,enableHover:G,...w({title:q,description:Z,summary:X,accessibleTable:U,className:j,animate:n.animate,autoPlaceAnnotations:n.autoPlaceAnnotations}),...!1===g?{tooltipContent:()=>null}:Y?{tooltipContent:Y}:{},...P({linkedHover:x,selection:b,onObservation:R,onClick:L,hoverHighlight:!1,mobileInteraction:O.mobileInteraction,customHoverBehavior:O.customHoverBehavior,customClickBehavior:O.customClickBehavior,linkedHoverInClickPredicate:!1}),...y&&y.length>0&&{annotations:y},...D};return Ke(kt,{componentName:"GeoCustomChart",width:H,height:z,children:Ke(Qe,{ref:M,...Q})})});Je.displayName="GeoCustomChart";export{Qe as StreamGeoFrame_default,Je as GeoCustomChart};