semiotic 3.13.1 → 3.13.3

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 (276) hide show
  1. package/README.md +48 -48
  2. package/ai/artifact-surface-inventory.json +1 -1
  3. package/ai/dist/mcp-server.js +4 -4
  4. package/ai/reference.md +23 -12
  5. package/ai/schema.json +258 -96
  6. package/ai/surface-manifest.json +1 -1
  7. package/ai/task-packets/compare-category-totals.json +5 -5
  8. package/ai/task-packets/compare-category-totals.md +2 -2
  9. package/ai/task-packets/correct-published-chart.json +5 -5
  10. package/ai/task-packets/correct-published-chart.md +2 -2
  11. package/ai/task-packets/index.json +6 -6
  12. package/ai/task-packets/update-live-chart.json +5 -5
  13. package/ai/task-packets/update-live-chart.md +2 -2
  14. package/dist/c-2YFVDRU4.min.js +1 -0
  15. package/dist/c-4OVDIXAR.min.js +1 -0
  16. package/dist/c-57IIWW46.min.js +1 -0
  17. package/dist/c-5HTUQRJT.min.js +1 -0
  18. package/dist/c-5NAU4JAY.min.js +1 -0
  19. package/dist/c-62UTMRQE.min.js +1 -0
  20. package/dist/c-6QV6F3U7.min.js +1 -0
  21. package/dist/c-73ORHEHO.min.js +1 -0
  22. package/dist/c-7S46KBYD.min.js +2 -0
  23. package/dist/c-AJSS332Z.min.js +2 -0
  24. package/dist/{c-ZWJDTDEV.min.js → c-AMQAAW7G.min.js} +1 -1
  25. package/dist/c-B3X2IJRQ.min.js +1 -0
  26. package/dist/c-BLLDBVFK.min.js +38 -0
  27. package/dist/c-BQWX6NBX.min.js +1 -0
  28. package/dist/c-C7TT4J7K.min.js +1 -0
  29. package/dist/c-CJ5GA7DM.min.js +1 -0
  30. package/dist/c-D7YDFHLY.min.js +1 -0
  31. package/dist/c-DHNROAXY.min.js +1 -0
  32. package/dist/c-DMDFJQU4.min.js +1 -0
  33. package/dist/{c-RAIBDXDV.min.js → c-FRVHZIGR.min.js} +1 -1
  34. package/dist/{c-I54V24WG.min.js → c-HAZCVHI7.min.js} +1 -1
  35. package/dist/c-HN5U72U7.min.js +1 -0
  36. package/dist/c-JA5F7ITS.min.js +1 -0
  37. package/dist/{c-VZNIIKL6.min.js → c-JDI7HKEM.min.js} +1 -1
  38. package/dist/{c-ISHYKYII.min.js → c-JVZRD4GL.min.js} +1 -1
  39. package/dist/{c-HGWITEJI.min.js → c-KJGJEOSV.min.js} +1 -1
  40. package/dist/c-LDGV6TDQ.min.js +1 -0
  41. package/dist/c-LW3GP7RY.min.js +1 -0
  42. package/dist/c-M2TPZE7P.min.js +1 -0
  43. package/dist/{c-XOGN3524.min.js → c-NBBYSAQY.min.js} +2 -2
  44. package/dist/c-OA6RJZ7S.min.js +1 -0
  45. package/dist/c-OBBSIOYU.min.js +1 -0
  46. package/dist/c-OMTJIC3P.min.js +1 -0
  47. package/dist/{c-SQQZPFVY.min.js → c-QPHM7AWW.min.js} +1 -1
  48. package/dist/{c-XZJWL7UL.min.js → c-QSEAAHEU.min.js} +1 -1
  49. package/dist/c-RQWI623R.min.js +1 -0
  50. package/dist/{c-62JIVHK5.min.js → c-RWFADOKS.min.js} +1 -1
  51. package/dist/c-TFESQSWE.min.js +1 -0
  52. package/dist/{c-SDGGMIYI.min.js → c-TJGC5JEM.min.js} +1 -1
  53. package/dist/{c-4P2EM44G.min.js → c-TOXWQRXS.min.js} +3 -3
  54. package/dist/c-TX53234M.min.js +1 -0
  55. package/dist/c-TZBEQ5UY.min.js +1 -0
  56. package/dist/c-UALVQIIJ.min.js +1 -0
  57. package/dist/c-VBDWHTC7.min.js +1 -0
  58. package/dist/c-VBIPDCE7.min.js +1 -0
  59. package/dist/c-WTNRBWZZ.min.js +51 -0
  60. package/dist/{c-3GIPT46Z.min.js → c-XG4LL2VI.min.js} +1 -1
  61. package/dist/c-XPNBS3W2.min.js +1 -0
  62. package/dist/c-XT3G3YWU.min.js +1 -0
  63. package/dist/c-YCBCZFOC.min.js +1 -0
  64. package/dist/c-ZBSL4Y32.min.js +1 -0
  65. package/dist/c-ZP6O6UHV.min.js +1 -0
  66. package/dist/c-ZVL7ULNH.min.js +1 -0
  67. package/dist/components/ChartErrorBoundary.d.ts +5 -1
  68. package/dist/components/ai/intentWeights.d.ts +22 -0
  69. package/dist/components/ai/streamSchema.d.ts +98 -0
  70. package/dist/components/ai/streamingTypes.d.ts +27 -4
  71. package/dist/components/ai/suggestCharts.d.ts +10 -2
  72. package/dist/components/ai/suggestStreamCharts.d.ts +60 -13
  73. package/dist/components/ai/suggestStreamDashboard.d.ts +9 -1
  74. package/dist/components/charts/network/processSankey/frameMargins.d.ts +1 -1
  75. package/dist/components/charts/network/processSankey/labelPlacement.d.ts +1 -1
  76. package/dist/components/charts/physics/physicsHocUtils.d.ts +1 -1
  77. package/dist/components/charts/realtime/RealtimeAccumulator.d.ts +7 -0
  78. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +9 -2
  79. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +13 -1
  80. package/dist/components/charts/realtime/RealtimeLineChart.types.d.ts +5 -1
  81. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +5 -1
  82. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +7 -1
  83. package/dist/components/charts/realtime/TemporalHistogram.capability.d.ts +5 -3
  84. package/dist/components/charts/realtime/aggregate.d.ts +11 -12
  85. package/dist/components/charts/realtime/defaultRealtimeTooltip.d.ts +9 -0
  86. package/dist/components/charts/realtime/eventTime.d.ts +7 -1
  87. package/dist/components/charts/realtime/useRealtimeLineIngestion.d.ts +13 -0
  88. package/dist/components/charts/shared/ChartError.d.ts +4 -6
  89. package/dist/components/charts/shared/GaugeReadout.d.ts +39 -4
  90. package/dist/components/charts/shared/axisExtent.d.ts +2 -1
  91. package/dist/components/charts/shared/chartMode.d.ts +2 -2
  92. package/dist/components/charts/shared/gaugeLayout.d.ts +69 -0
  93. package/dist/components/charts/shared/types.d.ts +4 -1
  94. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +3 -0
  95. package/dist/components/charts/shared/useStreamStatus.d.ts +2 -2
  96. package/dist/components/charts/shared/withChartErrorBoundary.d.ts +14 -0
  97. package/dist/components/charts/xy/Scatterplot.streamCapability.d.ts +2 -0
  98. package/dist/components/charts/xy/WaterfallChart.d.ts +2 -0
  99. package/dist/components/charts/xy/WaterfallIndex.d.ts +12 -0
  100. package/dist/components/charts/xy/lineGapStrategy.d.ts +15 -3
  101. package/dist/components/legendGeometry.d.ts +148 -0
  102. package/dist/components/legendLayout.d.ts +20 -38
  103. package/dist/components/realtime/ReorderBuffer.d.ts +14 -0
  104. package/dist/components/realtime/SlidingExtent.d.ts +18 -0
  105. package/dist/components/realtime/WindowAccumulator.d.ts +5 -1
  106. package/dist/components/realtime/renderers/types.d.ts +1 -0
  107. package/dist/components/realtime/renderers/waterfallRenderer.d.ts +1 -1
  108. package/dist/components/recipes/atlas/resolution/appearance.d.ts +1 -1
  109. package/dist/components/recipes/atlas/resolution/scene.d.ts +1 -1
  110. package/dist/components/recipes/compositional/edgeRouting.d.ts +9 -0
  111. package/dist/components/recipes/compositional/metrics.d.ts +2 -2
  112. package/dist/components/recipes/compositional/projection.d.ts +3 -1
  113. package/dist/components/recipes/compositional/routing.d.ts +3 -1
  114. package/dist/components/recipes/compositional/testFixtures.d.ts +4 -0
  115. package/dist/components/recipes/compositional/topology.d.ts +2 -0
  116. package/dist/components/recipes/compositional/types.d.ts +10 -1
  117. package/dist/components/recipes/compositional/useCompositionalInterfaces.d.ts +20 -0
  118. package/dist/components/semiotic-ai-core.d.ts +3 -2
  119. package/dist/components/semiotic-ai-stream.d.ts +3 -2
  120. package/dist/components/semiotic-network-zoom.d.ts +1 -1
  121. package/dist/components/semiotic-recipes-react.d.ts +2 -0
  122. package/dist/components/semiotic-utils-core.d.ts +2 -0
  123. package/dist/components/server/serverChartConfigHeatmap.d.ts +13 -0
  124. package/dist/components/server/staticLegend.d.ts +5 -0
  125. package/dist/components/server/staticLegendText.d.ts +13 -0
  126. package/dist/components/server/staticSVGChrome.d.ts +2 -2
  127. package/dist/components/store/ThemeStore.d.ts +4 -1
  128. package/dist/components/store/themeCore.d.ts +2 -0
  129. package/dist/components/stream/DataSourceAdapter.d.ts +15 -62
  130. package/dist/components/stream/FrameRuntime.d.ts +3 -0
  131. package/dist/components/stream/GeoPipelineStore.d.ts +2 -0
  132. package/dist/components/stream/IngestActivity.d.ts +9 -0
  133. package/dist/components/stream/NetworkPipelineStore.d.ts +3 -1
  134. package/dist/components/stream/OrdinalPipelineStore.d.ts +5 -2
  135. package/dist/components/stream/OrdinalSVGOverlay.d.ts +1 -1
  136. package/dist/components/stream/PipelineStore.d.ts +8 -3
  137. package/dist/components/stream/accessibleDataRows.d.ts +1 -0
  138. package/dist/components/stream/axisTickUtils.d.ts +25 -5
  139. package/dist/components/stream/frameDefaultMargins.d.ts +26 -4
  140. package/dist/components/stream/frameKeyboardNavigation.d.ts +8 -1
  141. package/dist/components/stream/geoTypes.d.ts +2 -0
  142. package/dist/components/stream/graphKeyboardNavigation.d.ts +4 -2
  143. package/dist/components/stream/hitTestUtils.d.ts +7 -0
  144. package/dist/components/stream/keyboardNav.d.ts +3 -1
  145. package/dist/components/stream/mediaQuery.d.ts +2 -0
  146. package/dist/components/stream/navigationGraph.d.ts +10 -3
  147. package/dist/components/stream/networkEdgeHitIndex.d.ts +6 -2
  148. package/dist/components/stream/networkFrameKeyboardNavigation.d.ts +2 -0
  149. package/dist/components/stream/networkNavGroups.d.ts +3 -0
  150. package/dist/components/stream/networkPipelineConfig.d.ts +1 -0
  151. package/dist/components/stream/networkSceneTypes.d.ts +10 -0
  152. package/dist/components/stream/networkSpatialNavigation.d.ts +3 -0
  153. package/dist/components/stream/networkTypes.d.ts +2 -0
  154. package/dist/components/stream/networkZoom/ZoomableNetworkCustomChart.d.ts +6 -4
  155. package/dist/components/stream/networkZoom/gestures.d.ts +5 -0
  156. package/dist/components/stream/networkZoom/types.d.ts +10 -0
  157. package/dist/components/stream/ordinalAxisTicks.d.ts +27 -0
  158. package/dist/components/stream/ordinalSceneBuilders/pieScene.d.ts +10 -0
  159. package/dist/components/stream/ordinalSceneBuilders/types.d.ts +2 -0
  160. package/dist/components/stream/ordinalTypes.d.ts +11 -2
  161. package/dist/components/stream/pipelineBufferUtils.d.ts +9 -0
  162. package/dist/components/stream/pipelineConfig.d.ts +7 -0
  163. package/dist/components/stream/pipelineDomainResolution.d.ts +3 -2
  164. package/dist/components/stream/pipelineTransitionTypes.d.ts +3 -5
  165. package/dist/components/stream/pipelineTransitionUtils.d.ts +4 -0
  166. package/dist/components/stream/pipelineTransitions.d.ts +1 -13
  167. package/dist/components/stream/renderers/networkArcRenderer.d.ts +1 -3
  168. package/dist/components/stream/renderers/networkCircleRenderer.d.ts +1 -3
  169. package/dist/components/stream/renderers/networkPrimitiveRenderer.d.ts +5 -0
  170. package/dist/components/stream/renderers/networkRectRenderer.d.ts +1 -3
  171. package/dist/components/stream/renderers/renderPulse.d.ts +8 -14
  172. package/dist/components/stream/roundScaleDomain.d.ts +9 -0
  173. package/dist/components/stream/sceneToSVGShared.d.ts +9 -0
  174. package/dist/components/stream/shallowEqual.d.ts +2 -0
  175. package/dist/components/stream/stalenessBands.d.ts +1 -1
  176. package/dist/components/stream/svgOverlayUtils.d.ts +12 -0
  177. package/dist/components/stream/types.d.ts +10 -2
  178. package/dist/components/stream/useFrame.d.ts +7 -4
  179. package/dist/components/stream/useMediaPreferences.d.ts +1 -4
  180. package/dist/components/stream/useOrdinalFrameHandle.d.ts +4 -14
  181. package/dist/components/stream/useStalenessCheck.d.ts +5 -3
  182. package/dist/components/stream/useStreamingDataHandle.d.ts +24 -0
  183. package/dist/components/stream/useXYFrameHandle.d.ts +4 -14
  184. package/dist/components/stream/xyDateTicks.d.ts +33 -4
  185. package/dist/components/stream/xyFrameAxisTypes.d.ts +2 -0
  186. package/dist/components/stream/xyPlugins/registry.d.ts +7 -0
  187. package/dist/components/stream/xySceneBuilders/heatmapScene.d.ts +11 -2
  188. package/dist/components/stream/xySceneBuilders/types.d.ts +4 -0
  189. package/dist/components/types/legendTypes.d.ts +12 -1
  190. package/dist/geo.min.js +155 -152
  191. package/dist/geo.module.min.js +1 -1
  192. package/dist/network.module.min.js +1 -1
  193. package/dist/ordinal.module.min.js +1 -1
  194. package/dist/physics.module.min.js +1 -1
  195. package/dist/processSankeyLayoutWorker.js +1 -1
  196. package/dist/semiotic-ai-core.d.ts +3 -2
  197. package/dist/semiotic-ai-core.min.js +5 -5
  198. package/dist/semiotic-ai-core.module.min.js +4 -4
  199. package/dist/semiotic-ai.module.min.js +2 -2
  200. package/dist/semiotic-artifact.min.js +6 -6
  201. package/dist/semiotic-artifact.module.min.js +5 -5
  202. package/dist/semiotic-atlas-selection.module.min.js +1 -1
  203. package/dist/semiotic-atlas.module.min.js +1 -1
  204. package/dist/semiotic-client-cjs-shared.min.js +1021 -1024
  205. package/dist/semiotic-client-compositional.module.min.js +1 -1
  206. package/dist/semiotic-client-shared.module.min.js +1 -1
  207. package/dist/semiotic-experimental-auxiliary.module.min.js +2 -2
  208. package/dist/semiotic-experimental-network-resolution-react.module.min.js +1 -1
  209. package/dist/semiotic-experimental-node-auxiliary.module.min.js +3 -3
  210. package/dist/semiotic-line.module.min.js +1 -1
  211. package/dist/semiotic-network-zoom.d.ts +1 -1
  212. package/dist/semiotic-network-zoom.min.js +7 -7
  213. package/dist/semiotic-network-zoom.module.min.js +1 -1
  214. package/dist/semiotic-realtime-core.module.min.js +1 -1
  215. package/dist/semiotic-realtime-react.module.min.js +1 -1
  216. package/dist/semiotic-recipes-core-cjs-base.min.js +101 -101
  217. package/dist/semiotic-recipes-core.module.min.js +1 -1
  218. package/dist/semiotic-recipes-react.d.ts +2 -0
  219. package/dist/semiotic-recipes-react.min.js +8 -8
  220. package/dist/semiotic-server-edge-node.module.min.js +3 -3
  221. package/dist/semiotic-server-edge.min.js +399 -397
  222. package/dist/semiotic-server-edge.module.min.js +3 -3
  223. package/dist/semiotic-server-node.min.js +399 -397
  224. package/dist/semiotic-themes-core.min.js +2 -2
  225. package/dist/semiotic-themes-core.module.min.js +1 -1
  226. package/dist/semiotic-themes.min.js +2 -2
  227. package/dist/semiotic-themes.module.min.js +1 -1
  228. package/dist/semiotic-utils-core.d.ts +2 -0
  229. package/dist/semiotic-utils-core.min.js +11 -11
  230. package/dist/semiotic-utils-core.module.min.js +3 -3
  231. package/dist/semiotic-value.module.min.js +1 -1
  232. package/dist/semiotic.module.min.js +1 -1
  233. package/dist/server.min.js +399 -397
  234. package/dist/server.module.min.js +3 -3
  235. package/dist/xy.module.min.js +1 -1
  236. package/package.json +11 -11
  237. package/dist/c-2M2OPWVA.min.js +0 -37
  238. package/dist/c-2N7IU2NY.min.js +0 -1
  239. package/dist/c-3UXQGCQT.min.js +0 -1
  240. package/dist/c-4RVDKSMQ.min.js +0 -1
  241. package/dist/c-4YPPVFZH.min.js +0 -1
  242. package/dist/c-6WJKNYIG.min.js +0 -1
  243. package/dist/c-7UN2WUMI.min.js +0 -1
  244. package/dist/c-AQUX6L2O.min.js +0 -1
  245. package/dist/c-BR5QDUCR.min.js +0 -1
  246. package/dist/c-C3YQVUB6.min.js +0 -1
  247. package/dist/c-COP4OISO.min.js +0 -1
  248. package/dist/c-ENRZPF5E.min.js +0 -1
  249. package/dist/c-FAOZZE77.min.js +0 -1
  250. package/dist/c-HBLICBM6.min.js +0 -1
  251. package/dist/c-I4BEWAKT.min.js +0 -1
  252. package/dist/c-IDCFMBA4.min.js +0 -2
  253. package/dist/c-KLJDKRD5.min.js +0 -1
  254. package/dist/c-LEICSI5V.min.js +0 -1
  255. package/dist/c-MOK4RWNO.min.js +0 -1
  256. package/dist/c-N2TVSOYL.min.js +0 -2
  257. package/dist/c-NHZ2E3CI.min.js +0 -1
  258. package/dist/c-OIJL2WZH.min.js +0 -1
  259. package/dist/c-OSLNYZ3Q.min.js +0 -51
  260. package/dist/c-OWRVBUSL.min.js +0 -1
  261. package/dist/c-QIVKWHDL.min.js +0 -1
  262. package/dist/c-QUAEYF34.min.js +0 -1
  263. package/dist/c-RDFFLRKC.min.js +0 -1
  264. package/dist/c-RTU5425Z.min.js +0 -1
  265. package/dist/c-SIQVOV6A.min.js +0 -1
  266. package/dist/c-SU6Z75M2.min.js +0 -1
  267. package/dist/c-SWVXFUDL.min.js +0 -1
  268. package/dist/c-TC47SNSI.min.js +0 -1
  269. package/dist/c-VLWWXOM5.min.js +0 -1
  270. package/dist/c-VNFIRKU5.min.js +0 -1
  271. package/dist/c-W5ATXREF.min.js +0 -1
  272. package/dist/c-WFX456JK.min.js +0 -5
  273. package/dist/c-WSWMQDFZ.min.js +0 -1
  274. package/dist/c-XORVM6C5.min.js +0 -1
  275. package/dist/c-YGTMWEEF.min.js +0 -1
  276. package/dist/c-ZDCTFRA6.min.js +0 -1
@@ -1,2 +0,0 @@
1
- import{b as e}from"./c-I54V24WG.min.js";import{b as t}from"./c-C3YQVUB6.min.js";import{a as i}from"./c-ORLEBW72.min.js";import{c as r}from"./c-4RVDKSMQ.min.js";import{a as n,h as a,i as o,b as s,d as l,e as c,k as u,n as h,j as d}from"./c-XORVM6C5.min.js";import{b as p}from"./c-COP4OISO.min.js";import{a as f,b as g}from"./c-V4XMSLC3.min.js";import{b as m}from"./c-HBLICBM6.min.js";import{f as y,e as v,d as b,a as w,s as R,v as P,t as S,u as x,G as k,o as A,l as C,j as L,y as D,z as M,B as j,h as T,i as B,O as I,x as _,C as E,q as N,D as O,g as F,r as W,Q as z,P as H}from"./c-W5ATXREF.min.js";import{d as G}from"./c-SWVXFUDL.min.js";import{c as q}from"./c-363Q2L4Z.min.js";import{a as $,b as Z}from"./c-O7SPJAUO.min.js";import{k as X,l as U,b as Y,E as V,Q,J as K,K as J,U as ee,A as te,ai as ie,Y as re,W as ne,aE as ae,aJ as oe,ag as se,ac as le,aX as ce,aB as ue,aj as he,ak as de,am as pe,m as fe,aF as ge,ae as me,ah as ye,G as ve,aT as be,aC as we,ad as Re,aD as Pe,at as Se,aS as xe,av as ke,ax as Ae,o as Ce,an as Le,aG as De,az as Me,aR as je,a$ as Te}from"./c-SU6Z75M2.min.js";import{a as Be}from"./c-SIQVOV6A.min.js";import{p as Ie}from"./c-WPL6PGP3.min.js";import{i as _e,k as Ee,p as Ne,s as Oe,c as Fe}from"./c-VZNIIKL6.min.js";import{i as We}from"./c-ELGOCAEY.min.js";import{y as ze,t as He,h as Ge,s as qe,z as $e}from"./c-TC47SNSI.min.js";import{d as Ze,b as Xe,a as Ue,c as Ye}from"./c-I4BEWAKT.min.js";import{c as Ve}from"./c-GRTKU3C7.min.js";import*as Qe from"react";import{useEffect as Ke,useLayoutEffect as Je,useCallback as et,useImperativeHandle as tt,useRef as it,useMemo as rt,useId as nt,useSyncExternalStore as at,memo as ot,forwardRef as st,useState as lt}from"react";import{geoPath as ct,geoEquirectangular as ut,geoNaturalEarth1 as ht,geoOrthographic as dt,geoAlbersUsa as pt,geoEqualEarth as ft,geoMercator as gt,geoGraticule as mt,geoDistance as yt,geoInterpolate as vt}from"d3-geo";import{quadtree as bt}from"d3-quadtree";import{scaleLinear as wt}from"d3-scale";import{select as Rt}from"d3-selection";import{zoomIdentity as Pt,zoom as St}from"d3-zoom";import{jsxs as xt,Fragment as kt,jsx as At}from"react/jsx-runtime";var Ct=X?Ke:Je,Lt=/*#__PURE__*/new WeakMap;function Dt(e,t){Lt.set(e,t)}function Mt(e,t){let i,r=new Map;return e.map(e=>{let n=Lt.get(e);if(void 0!==n)return n;if(!i){let e=new Map;i=e,t.forEach((t,i)=>{let r=e.get(t);r?r.push(i):e.set(t,[i])})}let a=r.get(e.datum)??0;return r.set(e.datum,a+1),i.get(e.datum)?.[a]??-1})}function jt(e){return{projection:e,geoPath:ct(e),projectedPoint:(t,i)=>e([t,i]),invertedPoint:(t,i)=>e.invert?.([t,i])??null}}var Tt={mercator:gt,equalEarth:ft,albersUsa:pt,orthographic:dt,naturalEarth:ht,equirectangular:ut};function Bt(e,t){return e?"function"==typeof e?e:t=>t[e]:e=>e[t]}function It(e){return e?"function"==typeof e?e:t=>t[e]:e=>e.coordinates||e.data||[]}function _t(e,t,i){return e?"function"==typeof e?{...i,...e(t)}:{...i,...e}:{...i}}function Et(e,t){if(e.length<2)return[e];let i=.4*t,r=[],n=[e[0]];for(let t=1;t<e.length;t++){let a=e[t-1],o=e[t];Math.abs(o[0]-a[0])>i?(n.length>=2&&r.push(n),n=[o]):n.push(o)}return n.length>=2&&r.push(n),r}function Nt(e,t,i=24){let r=t[0]-e[0],n=t[1]-e[1],a=Math.sqrt(r*r+n*n);if(0===a)return[e,t];let o=-n/a,s=r/a,l=Math.min(.3*a,80),c=(e[0]+t[0])/2+o*l,u=(e[1]+t[1])/2+s*l,h=[];for(let r=0;r<=i;r++){let n=r/i,a=1-n,o=a*a*e[0]+2*a*n*c+n*n*t[0],s=a*a*e[1]+2*a*n*u+n*n*t[1];h.push([o,s])}return h}function Ot(e,t){if(e.length<2)return e;let i=t/2+1,r=[];for(let t=0;t<e.length;t++){let n,a,o=e[t];0===t?(n=e[1][0]-o[0],a=e[1][1]-o[1]):t===e.length-1?(n=o[0]-e[t-1][0],a=o[1]-e[t-1][1]):(n=e[t+1][0]-e[t-1][0],a=e[t+1][1]-e[t-1][1]);let s=Math.sqrt(n*n+a*a)||1,l=a/s,c=-n/s;r.push([o[0]+l*i,o[1]+c*i])}return r}function Ft(e,t,i,r,n){let a=t[0]-e[0],o=t[1]-e[1],s=Math.sqrt(a*a+o*o);if(0===s)return[e,t];let l=o/s,c=-a/s,u=n/2+1;return[[e[0]+l*u,e[1]+c*u],[t[0]+l*u,t[1]+c*u]]}var Wt=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],zt=["scene-style","data-paint","accessibility","evidence"],Ht=(e,t)=>({retainedData:e,invalidations:t}),Gt=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],qt=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],$t=["scene-geometry","data-paint","accessibility","evidence"],Zt=["scene-style","data-paint","accessibility","evidence"],Xt=["scene-geometry","scene-style","data-paint","accessibility","evidence"],Ut=["overlay","accessibility","evidence"],Yt=[],Vt={xAccessor:/*#__PURE__*/Ht("rebuild",Gt),yAccessor:/*#__PURE__*/Ht("rebuild",Gt),lineDataAccessor:/*#__PURE__*/Ht("rebuild",Gt),pointIdAccessor:/*#__PURE__*/Ht("rebuild",$t),lineIdAccessor:/*#__PURE__*/Ht("rebuild",$t),windowSize:/*#__PURE__*/Ht("rebuild",Gt),projection:/*#__PURE__*/Ht("preserve",qt),projectionExtent:/*#__PURE__*/Ht("preserve",qt),fitPadding:/*#__PURE__*/Ht("preserve",qt),lineType:/*#__PURE__*/Ht("preserve",qt),flowStyle:/*#__PURE__*/Ht("preserve",qt),graticule:/*#__PURE__*/Ht("preserve",qt),projectionTransform:/*#__PURE__*/Ht("preserve",qt),customLayout:/*#__PURE__*/Ht("preserve",qt),layoutConfig:/*#__PURE__*/Ht("preserve",qt),layoutMargin:/*#__PURE__*/Ht("preserve",qt),areaStyle:/*#__PURE__*/Ht("preserve",Zt),pointStyle:/*#__PURE__*/Ht("preserve",Xt),lineStyle:/*#__PURE__*/Ht("preserve",Zt),colorScheme:/*#__PURE__*/Ht("preserve",Zt),themeCategorical:/*#__PURE__*/Ht("preserve",Zt),themeDiverging:/*#__PURE__*/Ht("preserve",Zt),themeSemantic:/*#__PURE__*/Ht("preserve",Zt),themeSequential:/*#__PURE__*/Ht("preserve",Zt),decay:/*#__PURE__*/Ht("preserve",Zt),pulse:/*#__PURE__*/Ht("preserve",Zt),layoutSelection:/*#__PURE__*/Ht("preserve",Zt),annotations:/*#__PURE__*/Ht("preserve",Ut),autoPlaceAnnotations:/*#__PURE__*/Ht("preserve",Ut),clock:/*#__PURE__*/Ht("preserve",Yt),transition:/*#__PURE__*/Ht("preserve",Yt),introAnimation:/*#__PURE__*/Ht("preserve",Yt),onLayoutError:/*#__PURE__*/Ht("preserve",Yt)},Qt=/*#__PURE__*/Ht("preserve",qt),Kt=class{constructor(){this.tracker=new U}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}},Wt)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},zt):this.recordNoop("restyle")}recordConfig(e,t={}){let i=function(e){let t="preserve",i=new Set;for(let r of e){let e=Object.prototype.hasOwnProperty.call(Vt,r)?Vt[r]:Qt;"rebuild"===e.retainedData&&(t="rebuild");for(let t of e.invalidations)i.add(t)}return{retainedData:t,invalidations:i}}(e),r=new Set(i.invalidations);return t.retainedDataChanged&&r.add("data"),this.tracker.record({kind:"config",keys:e},r)}};function Jt(e){if(null==e)return 0;if("number"==typeof e&&Number.isFinite(e)&&e>=0&&e<.5)return e;throw new RangeError(`[semiotic] fitPadding must be a finite fraction in [0, 0.5); received ${String(e)}.`)}var ei=class extends y{constructor(e){super(),this.updateResults=new Kt,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(e){return{...e,fitPadding:Jt(e.fitPadding)}}(e)}currentTime(){return this.config.clock?.()??Ze()}getConfiguredWindowSize(){let e=this.config.windowSize??500;if(!Number.isInteger(e)||e<1)throw new Error("GeoPipelineStore windowSize must be a positive integer");return e}retainNewestLines(e=this.getConfiguredWindowSize()){this.lineData.length>e&&(this.lineData=this.lineData.slice(-e))}resizeStreamingWindow(e){if(this.pointBuffer){let t=this.pointBuffer.toArray(),i=this.timestampBuffer?.toArray()??[],r=t.slice(-e),a=i.slice(-r.length),o=this.currentTime();this.pointBuffer=new n(e),this.timestampBuffer=new n(e),r.forEach((e,t)=>{this.pointBuffer.push(e),this.timestampBuffer.push(a[t]??o)})}this.retainNewestLines(e)}updateConfig(e){let t=function(e){return"fitPadding"in e?{...e,fitPadding:Jt(e.fitPadding)}:e}(e),i=this.config,r=this.getConfiguredWindowSize(),n=Object.keys(t).filter(e=>t[e]!==i[e]);this.config={...this.config,...t};let a=this.getConfiguredWindowSize(),o=this.streaming&&a!==r;o&&(this.resizeStreamingWindow(a),this.version++),"customLayout"in t&&!t.customLayout&&(this.lastCustomLayoutFailure=null),this.updateResults.recordConfig(n,{retainedDataChanged:o})}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}setAreas(e){this.areas=e,this.updateResults.recordData("replace",e.length)}setAreasWithResult(e){return this.setAreas(e),this.updateResults.last}setPoints(e){this.pointData=e.slice(),this.pointBuffer=null,this.timestampBuffer=null,this.streaming=!1,this.updateResults.recordData("replace",e.length)}setPointsWithResult(e){return this.setPoints(e),this.updateResults.last}setLines(e){this.lineData=e.slice(),this.streaming&&this.retainNewestLines(),this.updateResults.recordData("replace",e.length)}setLinesWithResult(e){return this.setLines(e),this.updateResults.last}initStreaming(e){void 0!==e&&e!==this.config.windowSize&&(this.config={...this.config,windowSize:e});let t=this.getConfiguredWindowSize(),i=this.pointBuffer?this.pointBuffer.toArray():this.pointData,r=this.timestampBuffer?.toArray()??[],a=i.slice(-t),o=r.slice(-a.length),s=this.currentTime();this.pointBuffer=new n(t),this.timestampBuffer=new n(t),a.forEach((e,t)=>{this.pointBuffer.push(e),this.timestampBuffer.push(o[t]??s)}),this.pointData=[],this.retainNewestLines(t),this.streaming=!0}pushPoint(e){this.pointBuffer||this.initStreaming();let t=this.currentTime();a(this.pointBuffer,e,this.timestampBuffer,t),this.lastIngestTime=t,this.updateResults.recordData("ingest",1)}pushPointWithResult(e){return this.pushPoint(e),this.updateResults.last}pushMany(e){this.pointBuffer||this.initStreaming();let t=this.currentTime();for(let i of e)a(this.pointBuffer,i,this.timestampBuffer,t);this.lastIngestTime=t,this.updateResults.recordData("ingest",e.length)}pushManyWithResult(e){return this.pushMany(e),this.updateResults.last}pushLine(e){null!=e&&"object"==typeof e?(this.streaming||this.initStreaming(),this.lineData.push(e),this.retainNewestLines(),this.version++,this.updateResults.recordData("ingest",1)):this.updateResults.recordNoop("ingest")}pushManyLines(e){if(!Array.isArray(e)||0===e.length)return void this.updateResults.recordNoop("ingest");let t=e.filter(e=>null!=e&&"object"==typeof e);if(0!==t.length){this.streaming||this.initStreaming();for(let e of t)this.lineData.push(e);this.retainNewestLines(),this.version++,this.updateResults.recordData("ingest",t.length)}else this.updateResults.recordNoop("ingest")}removeLine(e){let{lineIdAccessor:t}=this.config;if(!t)throw new Error("removeLine() requires lineIdAccessor to be configured");let i="function"==typeof t?t:e=>e[t],r=new Set(Array.isArray(e)?e:[e]),n=[];return this.lineData=this.lineData.filter(e=>!r.has(String(i(e)))||(n.push(e),!1)),n.length>0?(this.version++,this.updateResults.recordData("remove",n.length)):this.updateResults.recordNoop("remove"),n}getLines(){return this.lineData.slice()}removePoint(e){let{pointIdAccessor:t}=this.config;if(!t)throw new Error("removePoint() requires pointIdAccessor to be configured");let i="function"==typeof t?t:e=>e[t],r=new Set(Array.isArray(e)?e:[e]);if(this.streaming&&this.pointBuffer){let e=e=>r.has(String(i(e)));o(this.pointBuffer,this.timestampBuffer,e);let t=this.pointBuffer.remove(e);return t.length>0?(this.version++,this.updateResults.recordData("remove",t.length)):this.updateResults.recordNoop("remove"),t}{let e=[];return this.pointData=this.pointData.filter(t=>!r.has(String(i(t)))||(e.push(t),!1)),e.length>0?(this.version++,this.updateResults.recordData("remove",e.length)):this.updateResults.recordNoop("remove"),e}}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(e){let t=this._customRestyle;if(t){for(let i of this.scene){let r=this._baseStyles.get(i)??i.style,n=t(i,e);i.style=n?{...r,...n}:r}this.markStylePaintPending(),this.updateResults.recordRestyle(!0)}else this.updateResults.recordRestyle(!1)}rebuildProjectedScene(e,t){this._customLayoutFailedThisBuild=!1;let i=this.buildSceneNodes(e);return this._customLayoutFailedThisBuild?(this.lastCustomLayoutFailure?.preservedLastGoodScene?t():(this.scene=[],this.rebuildQuadtree()),!1):(this.scene=i,this.rebuildQuadtree(),!0)}computeScene(e){let{config:t}=this,i=this.projection,r=this.geoPath,n=this.scales,a=this.baseScale,o=[...this.baseTranslate],s=[...this.baseRotation],l=this.scene;this.projection=function(e){if(!e)return ft();if("string"==typeof e){let t=Tt[e];return t?t():("production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Unknown projection "${e}", falling back to equalEarth`),ft())}if("object"==typeof e&&"type"in e){let t=Tt[e.type],i=t?t():ft();return e.rotate&&"rotate"in i&&i.rotate(e.rotate),e.center&&"center"in i&&i.center(e.center),i}return e}(t.projection),this.geoPath=ct(this.projection),this.fitProjection(e),this.geoPath=ct(this.projection);let c=this.projection;if(this.scales=jt(c),this.geoPath=this.scales.geoPath,this.rebuildProjectedScene(e,()=>{this.projection=i,this.geoPath=r,this.scales=n,this.baseScale=a,this.baseTranslate=o,this.baseRotation=s})){if(t.projectionTransform&&this.applyCartogramTransform(t.projectionTransform,e),t.decay&&this.streaming&&this.applyDecay(),t.pulse&&this.streaming&&this.applyPulse(),t.transition&&!this._hasRenderedOnce&&this.scene.length>0&&t.introAnimation){let t=e.width/2,i=e.height/2,r=this.scene.filter(e=>"point"===e.type).map(e=>({...e,x:t,y:i}));r.length>0&&this.startTransition(r)}this._hasRenderedOnce=!0,t.transition&&l.length>0&&this.startTransition(l),this.version++}}fitProjection(e){let t=this.projection,i=this.config,r=[...this.areas],n=Bt(i.xAccessor,"lon"),a=Bt(i.yAccessor,"lat"),o=this.getPoints();if(o.length>0){let e=o.map(e=>[n(e),a(e)]).filter(e=>e.every(Number.isFinite));r.push({type:"Feature",properties:{},geometry:{type:"MultiPoint",coordinates:e}})}let s=It(i.lineDataAccessor);for(let e of this.lineData){let t=s(e);if(t&&t.length>0){let e=t.map(e=>[n(e),a(e)]);r.push({type:"Feature",properties:{},geometry:{type:"LineString",coordinates:e}})}}if(0!==r.length){if(i.projectionExtent){let[[r,n],[a,o]]=i.projectionExtent,s={type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[r,n],[r,o],[a,o],[a,n],[r,n]]]}};t.fitExtent([[0,0],[e.width,e.height]],s)}else if(t.clipAngle&&(t.clipAngle()??0)>0){let r=i.fitPadding??0,n=Math.min(e.width,e.height),a=n/2-n*r;t.scale(a),t.translate([e.width/2,e.height/2])}else{let n={type:"FeatureCollection",features:r},a=i.fitPadding??0,o=e.width*a,s=e.height*a;t.fitExtent([[o,s],[e.width-o,e.height-s]],n),function(e,t,i){if(Number.isFinite(e.scale())&&e.translate().every(Number.isFinite))return;e.scale(Math.max(1,Math.min(i.width,i.height)/(2*Math.PI))),e.translate([i.width/2,i.height/2]);let r=ct(e).bounds(t);if(!r.flat().every(Number.isFinite))return;let n=e.translate();e.translate([n[0]+i.width/2-(r[0][0]+r[1][0])/2,n[1]+i.height/2-(r[0][1]+r[1][1])/2])}(t,n,e)}this.baseScale=t.scale(),this.baseTranslate=t.translate(),this.baseRotation=t.rotate?.()??[0,0,0]}}applyZoomTransform(e,t){let i=this.projection;if(!i)return;let r=this.geoPath,n=this.scales,a=i.scale(),o=[...i.translate()],s=this.currentZoom;i.scale(this.baseScale*e.k),i.translate([this.baseTranslate[0]*e.k+e.x,this.baseTranslate[1]*e.k+e.y]),this.currentZoom=e.k,this.geoPath=ct(i),this.scales=jt(i),this.geoPath=this.scales.geoPath,this.rebuildProjectedScene(t,()=>{i.scale(a),i.translate(o),this.currentZoom=s,this.geoPath=r,this.scales=n})&&(this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}applyZoomScale(e,t){let i=this.projection;if(!i)return;let r=this.geoPath,n=this.scales,a=i.scale(),o=[...i.translate()],s=this.currentZoom;i.scale(this.baseScale*e),i.translate(this.baseTranslate),this.currentZoom=e,this.geoPath=ct(i),this.scales=jt(i),this.geoPath=this.scales.geoPath,this.rebuildProjectedScene(t,()=>{i.scale(a),i.translate(o),this.currentZoom=s,this.geoPath=r,this.scales=n})&&(this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}applyRotation(e,t){let i=this.projection;if(!i||!i.rotate)return;let r=this.geoPath,n=this.scales,a=[...i.rotate()];i.rotate(e),this.geoPath=ct(i),this.scales=jt(i),this.geoPath=this.scales.geoPath,this.rebuildProjectedScene(t,()=>{i.rotate(a),this.geoPath=r,this.scales=n})&&(this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}setRotation(e){let t=this.projection;!t||!t.rotate||t.rotate(e)}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,t=0;for(let i of this.scene)"point"===i.type&&!1!==i.interactive&&(t++,i.r>e&&(e=i.r));if(this._maxPointRadius=e,t<=500)return void(this._quadtree=null);let i=new Array(t),r=0;for(let e of this.scene)"point"===e.type&&!1!==e.interactive&&(i[r++]=e);this._quadtree=bt().x(e=>e.x).y(e=>e.y).addAll(i)}get quadtree(){return this._quadtree}get maxPointRadius(){return this._maxPointRadius}buildSceneNodes(e){this._customLayoutFailedThisBuild=!1;let{config:t}=this,i=this.projection,r=this.geoPath;if(t.customLayout&&this.scales){let i=t.layoutMargin??{top:0,right:0,bottom:0,left:0},r=$(t.colorScheme,t.themeCategorical,Ie),n={areas:this.areas.slice(),points:this.getPoints().slice(),lines:this.lineData.slice(),scales:this.scales,dimensions:{width:e.width,height:e.height,margin:i,plot:{x:0,y:0,width:e.width,height:e.height}},theme:{semantic:t.themeSemantic??{},categorical:[...r]},resolveColor:Z(r,t.colorScheme),config:t.layoutConfig??{},selection:t.layoutSelection??null},a=v({family:"geo",logLabel:"geo customLayout",revision:this.version,hasPreviousResult:null!==this.lastCustomLayoutResult,onLayoutError:t.onLayoutError,run:()=>t.customLayout(n)});if("failure"===a.kind)return this.lastCustomLayoutFailure=a.diagnostic,this._customLayoutFailedThisBuild=!0,a.preservedLastGoodScene?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,[]);let o=a.result,s=o.nodes??[];if(this.customLayoutOverlays=o.overlays??null,this.lastCustomLayoutResult=o,this.lastCustomLayoutFailure=null,this._customRestyle=o.restyle,this.hasCustomRestyle=!!o.restyle,this._baseStyles=new WeakMap,this.hasCustomRestyle)for(let e of s){this._baseStyles.set(e,e.style);let i=o.restyle?.(e,t.layoutSelection??null);i&&(e.style={...e.style,...i})}return b({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:e,projection:t,path:i,areas:r,points:n,lines:a,layout:o}){let s=Bt(e.xAccessor,"lon"),l=Bt(e.yAccessor,"lat"),c=[],u=function(e){return{fill:e.themeSemantic?.surface||"#e0e0e0",stroke:e.themeSemantic?.border||"#999",strokeWidth:.5,fillOpacity:1}}(e),h=function(e){return{stroke:e.themeSemantic?.primary||"#4e79a7",strokeWidth:1.5,fill:"none"}}(e),d=function(e){return{fill:e.themeSemantic?.primary||"#4e79a7",r:4,fillOpacity:.8}}(e);if(e.graticule){let t=!0===e.graticule?{}:e.graticule,r=mt();t.step&&r.step(t.step);let n=i(r())||"";n&&c.push({type:"geoarea",pathData:n,centroid:[o.width/2,o.height/2],bounds:[[0,0],[o.width,o.height]],screenArea:0,style:{fill:"none",stroke:t.stroke||"#e0e0e0",strokeWidth:t.strokeWidth??.5,strokeDasharray:t.strokeDasharray||"2,2"},datum:null,interactive:!1})}for(let t of r){let r=i(t);if(!r)continue;let n=i.centroid(t),a=i.bounds(t),o=i.area(t);c.push({type:"geoarea",pathData:r,centroid:n,bounds:a,screenArea:o,style:_t(e.areaStyle,t,u),datum:t,interactive:!0})}let p=It(e.lineDataAccessor);for(let i of a){let r=p(i);if(!r||r.length<2)continue;let n=[];if("geo"===e.lineType){let e=new Array(r.length);for(let t=0;t<r.length;t++)e[t]=[s(r[t]),l(r[t])];for(let i=0;i<e.length-1;i++){let r=e[i],a=e[i+1],o=yt(r,a)||0,s=Math.max(2,Math.ceil(o/(Math.PI/180))),l=vt(r,a);for(let e=0;e<=s;e++){if(i>0&&0===e)continue;let r=t(l(e/s));null!=r&&n.push(r)}}}else for(let e=0;e<r.length;e++){let i=r[e],a=t([s(i),l(i)]);null!=a&&n.push(a)}if(n.length<2)continue;let a=_t(e.lineStyle,i,h),u="number"==typeof a.strokeWidth?a.strokeWidth:1;2===r.length&&n.length>=2&&"arc"===e.flowStyle?n=Nt(n[0],n[n.length-1]):2===r.length&&n.length>=2&&"offset"===e.flowStyle&&(n="geo"===e.lineType?Ot(n,u):Ft(n[0],n[n.length-1],0,0,u));let d=Et(n,o.width);if(d.length<=1)c.push({type:"line",path:n.length>=2?n:d[0]||n,style:a,datum:i});else for(let e of d)e.length<2||c.push({type:"line",path:e,style:{...a,_edgeFade:!0},datum:i})}let f=e.pointIdAccessor?"function"==typeof e.pointIdAccessor?e.pointIdAccessor:t=>t[e.pointIdAccessor]:null,g=t.clipAngle?t.clipAngle()??0:0,m=g>0?g*Math.PI/180:null,y=t.rotate?t.rotate():[0,0,0],v="function"==typeof t.center?t.center():[0,0],b=[(v[0]??0)-y[0],(v[1]??0)-y[1]];for(let[i,r]of n.entries()){let n=s(r),a=l(r);if(!Number.isFinite(n)||!Number.isFinite(a)||null!=m&&yt([n,a],b)>m)continue;let o=t([n,a]);if(!o||!Number.isFinite(o[0])||!Number.isFinite(o[1]))continue;let u=e.pointStyle?e.pointStyle(r):{...d},h={type:"point",x:o[0],y:o[1],r:u.r||4,style:u,datum:r,pointId:f?String(f(r)):void 0};Dt(h,i),c.push(h)}return c}({config:t,projection:i,path:r,areas:this.areas,points:this.getPoints(),lines:this.lineData,layout:e})}applyCartogramTransform(e,t){let i=function(e,t,i,r){let n=e.filter(e=>"point"===e.type);if(n.length<2)return null;let a=t.strength??1,o=Number.isFinite(a)?Math.max(0,Math.min(1,a)):1,s="strip"===t.layout?"strip":"radial";if("radial"===s&&0===o)return null;let l=t.centerAccessor?"function"==typeof t.centerAccessor?t.centerAccessor:e=>e[t.centerAccessor]:e=>e.id,c="function"==typeof t.costAccessor?t.costAccessor:e=>e[t.costAccessor],u=n.find(e=>e.datum&&String(l(e.datum))===String(t.center));if(!u)return"production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Distance cartogram center "${t.center}" not found in point data`),null;let h=n.map(e=>e.datum?Number(c(e.datum)):NaN).filter(e=>isFinite(e)&&e>=0),d=Ve(h,1);r>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 t=e.length-1;t>=0;t--){let i=e[t];"geoarea"===i.type&&i.interactive&&e.splice(t,1)}let p="strip"===s?function(e,t,i,r,n){let a=Math.max(3,Math.min(8,.35*n.height)),o=Math.max(1,n.width-2*a),s=n.height/2,l=wt().domain([0,r]).range([0,o]);t.x=a,t.y=s;let c=[];for(let n of e){if(n===t)continue;if(!n.datum){n.x=a,n.y=s;continue}let e=Number(i(n.datum)),o=a+(isFinite(e)&&e>=0&&r>0?l(e):0);n.x=o,n.y=s,c.push({node:n,x:o})}c.sort((e,t)=>e.x-t.x);let u=Math.max(0,Math.min(n.height/2-1,6)),h=0;for(;h<c.length;){let e=h+1;for(;e<c.length&&Math.abs(c[e].x-c[h].x)<3;)e++;let t=e-h;if(t>1&&u>0)for(let e=0;e<t;e++){let i=e-(t-1)/2,r=Math.min(2.5,2*u/Math.max(1,t-1));c[h+e].node.y=s+i*r}h=e}return{cx:a,cy:s,maxCost:r,availableRadius:o,layout:"strip"}}(n,u,c,d,i):function(e,t,i,r,n,a){let o=t.x,s=t.y,l=a.width/2,c=a.height/2,u=Math.min(a.width,a.height)/2,h=wt().domain([0,r]).range([0,u]);for(let a of e){if(a===t||!a.datum)continue;let e=a.x,u=a.y,d=Math.atan2(u-s,e-o),p=Math.hypot(e-o,u-s),f=Number(i(a.datum)),g=isFinite(f)&&f>=0?r>0?h(f):0:p,m=l+Math.cos(d)*g,y=c+Math.sin(d)*g;a.x=e+(m-e)*n,a.y=u+(y-u)*n}return t.x=o+(l-o)*n,t.y=s+(c-s)*n,{cx:t.x,cy:t.y,maxCost:r,availableRadius:u,layout:"radial"}}(n,u,c,d,o,i),f=e.filter(e=>"line"===e.type);if(f.length>0){let e=new Map;for(let t of n)null!=t.pointId&&e.set(String(t.pointId),[t.x,t.y]);for(let i of f){let r=i.datum?.source,n=i.datum?.target;if(null!=r&&null!=n){let a=e.get(String(r)),o=e.get(String(n));if(a&&o)if("fractional"===t.lineMode&&i.path.length>2){let e=i.path[0],t=i.path[i.path.length-1],r=[a[0]-e[0],a[1]-e[1]],n=[o[0]-t[0],o[1]-t[1]],s=[0];for(let e=1;e<i.path.length;e++)s.push(s[e-1]+Math.hypot(i.path[e][0]-i.path[e-1][0],i.path[e][1]-i.path[e-1][1]));let l=s[s.length-1];i.path=i.path.map((e,t)=>{let a=l>0?s[t]/l:t/(i.path.length-1);return[e[0]+r[0]*(1-a)+n[0]*a,e[1]+r[1]*(1-a)+n[1]*a]})}else i.path=[a,o]}}}return p}(this.scene,e,t,this.areas.length);i&&(this.cartogramLayout=i)}applyDecay(){let e=this.config.decay;if(!e||!this.pointBuffer)return;let t=this.pointBuffer.size;if(0===t)return;let i=this.scene.filter(e=>"point"===e.type),r=Mt(i,this.getPoints());for(let n=0;n<i.length;n++){if(r[n]<0)continue;let a=w(e,r[n],t);i[n]._decayOpacity=a,i[n].style={...i[n].style,opacity:a}}}applyPulse(e=this.currentTime()){let t=this.config.pulse;if(!t||!this.timestampBuffer)return!1;let i=this.scene.filter(e=>"point"===e.type),r=this.timestampBuffer.toArray(),n=Mt(i,this.getPoints()),a=t.color||"rgba(255,255,255,0.6)",o=t.glowRadius??4,c=!1;for(let u=0;u<i.length;u++){let h=r[n[u]];if(void 0===h)continue;let d=s(t,h,e);c=l(i[u],d,a,o)||c}return c}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(e)}hasActivePulsesAt(e){return!!this.config.pulse&&c(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}startTransition(e){let t=this.config.transition?.duration??300;if(t<=0)return;let i=new Map;for(let t of e)"point"===t.type&&t.pointId&&i.set(t.pointId,[t.x,t.y]);let r=this.scene.filter(e=>"point"===e.type),n=!1;for(let e of r)if(e.pointId){let t=i.get(e.pointId);t&&(e._targetX=e.x,e._targetY=e.y,e.x=t[0],e.y=t[1],(Math.abs(t[0]-e._targetX)>.5||Math.abs(t[1]-e._targetY)>.5)&&(n=!0))}for(let e of r)e.pointId&&!i.has(e.pointId)&&(e._targetOpacity=e.style?.opacity??e.style?.fillOpacity??1,e.style={...e.style,opacity:0},n=!0);n&&(this.activeTransition={startTime:this.currentTime(),duration:t})}cancelIntroAnimation(){this.activeTransition=null;for(let e of this.scene)"point"===e.type&&(null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity},e._targetOpacity=void 0),null!=e._targetX&&(e.x=e._targetX,e.y=e._targetY,e._targetX=void 0,e._targetY=void 0))}advanceTransition(e){if(!this.activeTransition)return!1;let t=Xe(e,this.activeTransition),i=Ue(t,this.config.transition?.easing),r=this.scene.filter(e=>"point"===e.type);for(let e of r){if(null!=e._targetX&&null!=e._targetY){let t=e.x,r=e.y;e.x=Ye(t,e._targetX,i),e.y=Ye(r,e._targetY,i)}null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity*i})}if(t>=1){for(let e of r)null!=e._targetX&&(e.x=e._targetX,e.y=e._targetY,e._targetX=void 0,e._targetY=void 0),null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity},e._targetOpacity=void 0);return this.activeTransition=null,!1}return!0}};function ti(e){let{width:t,height:i,totalWidth:r,totalHeight:n,margin:a,showAxes:o,title:s,description:l,idPrefix:c,decorative:u=!1,legend:h,legendHoverBehavior:d,legendClickBehavior:p,legendHighlightedCategory:f,legendIsolatedCategories:g,legendPosition:m,legendLayout:y,foregroundGraphics:v,annotations:b,onAnnotationActivate:w,onObservation:k,chartId:A,chartType:C,autoPlaceAnnotations:L,svgAnnotationRules:D,pointNodes:M,geoProjection:j}=e,T=V({onAnnotationActivate:w,onObservation:k,chartId:A,chartType:C}),B=it([b?.length??0,new Map]),I=b?.length??0;B.current[0]!==I&&(B.current=[I,new Map]);let _=rt(()=>{if(!b||0===b.length)return null;let e=R(b),r=j?e.map(e=>{if(!Array.isArray(e.coordinates)||e.coordinates.length<2)return e;let t=j(Number(e.coordinates[0]),Number(e.coordinates[1]));return t?{...e,x:t[0],y:t[1]}:e}):e,n={scales:{x:e=>Number(e),y:e=>Number(e)},timeAxis:"x",width:t,height:i,frameType:"xy",pointNodes:M,stickyPositionCache:B.current[1]},a=L?Q({annotations:r,context:n,..."object"==typeof L?L:{}}):r;return K(a,J("xy",T),D,n)},[b,L,D,t,i,M,T,j]),E=o||s||l||h||v||_&&_.length>0,N=nt(),{titleId:O,descId:F,labelledBy:W}=P(c||A||N);return E?xt("svg",{"data-semiotic-overlay":"",role:u?"presentation":"img","aria-labelledby":u?void 0:W,width:r,height:n,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[!u&&xt(kt,{children:[At("title",{id:O,children:S(s,"Geographic chart")}),At("desc",{id:F,children:x(s,l,{familyPhrase:"geographic data visualization",fallback:"geographic data visualization"})})]}),xt("g",{transform:"translate("+a.left+","+a.top+")",children:[_,v]}),At(ee,{title:s,totalWidth:r,marginTop:a.top}),te({legend:h,totalWidth:r,totalHeight:n,margin:a,legendPosition:m,title:s,legendLayout:y,legendHoverBehavior:d,legendClickBehavior:p,legendHighlightedCategory:f,legendIsolatedCategories:g})]}):null}function ii([e,t,i]){let r=1<<i;return[e-Math.floor(e/r)*r,t,i]}function ri(e,t,i,r,n){return"function"==typeof e?e(t,i,r,n):e.replaceAll("{z}",String(t)).replaceAll("{x}",String(i)).replaceAll("{y}",String(r)).replaceAll("{r}",n>1?"@2x":"")}var ni=/*#__PURE__*/new WeakMap,ai=1;function oi(e){return Number.isFinite(e)?Math.max(1,Math.floor(e)):256}var si=class{constructor(e=256){this.cache=new Map,this.limit=oi(e)}setLimit(e){this.limit=oi(e),this.cache.size>this.limit&&this.evict()}get(e){let t=this.cache.get(e);return t&&(t.lastUsed=performance.now()),t}set(e,t){this.cache.set(e,t),this.cache.size>this.limit&&this.evict()}evict(){for(;this.cache.size>this.limit;){let e,t=1/0;for(let[i,r]of this.cache)r.lastUsed<t&&(t=r.lastUsed,e=i);if(!e)break;{let t=this.cache.get(e);t&&(t.img.onload=null,t.img.onerror=null,t.img.src=""),this.cache.delete(e)}}}clear(){for(let e of this.cache.values())e.img.onload=null,e.img.onerror=null,e.img.src="";this.cache.clear()}},li=class{constructor(e){this.capacity=e,this.particles=new Array(e);for(let t=0;t<e;t++)this.particles[t]={t:0,offset:0,lineIndex:0,active:!1,x:0,y:0}}spawn(e,t=Math.random){for(let i=0;i<this.capacity;i++){let r=this.particles[i];if(!r.active)return r.active=!0,r.t=0,r.offset=.6*(t()-.5),r.lineIndex=e,r.x=0,r.y=0,r}return null}step(e,t,i,r){for(let n=0;n<this.capacity;n++){let a=this.particles[n];if(!a.active)continue;let o=i[a.lineIndex];if(!o||o.length<2){a.active=!1;continue}if(a.t+=e*t,a.t>=1){a.active=!1;continue}let s=ci(o),l=ui(o,a.t*s),c=(r[a.lineIndex]||2)/2;a.x=l.x+l.nx*a.offset*c*2,a.y=l.y+l.ny*a.offset*c*2}}countForLine(e){let t=0;for(let i=0;i<this.capacity;i++)this.particles[i].active&&this.particles[i].lineIndex===e&&t++;return t}clear(){for(let e=0;e<this.capacity;e++)this.particles[e].active=!1}};function ci(e){let t=0;for(let i=1;i<e.length;i++){let r=e[i][0]-e[i-1][0],n=e[i][1]-e[i-1][1];t+=Math.sqrt(r*r+n*n)}return t}function ui(e,t){let i=0;for(let r=1;r<e.length;r++){let n=e[r][0]-e[r-1][0],a=e[r][1]-e[r-1][1],o=Math.sqrt(n*n+a*a);if(i+o>=t||r===e.length-1){let s=o>0?(t-i)/o:0,l=o>.001?o:1;return{x:e[r-1][0]+n*s,y:e[r-1][1]+a*s,nx:-a/l,ny:n/l}}i+=o}let r=e[e.length-1];return{x:r[0],y:r[1],nx:0,ny:0}}function hi(e){if(!e)return;let t=[];for(let i of e)if("point"===i.type)t.push(i);else if("glyph"===i.type){let e=i,r=We(e.glyph,e.size);t.push({pointId:e.pointId,x:e.x+r.centerDx,y:e.y+r.centerDy,r:r.radius})}return t}var di=/*#__PURE__*/ze(function({data:e}){if(!e)return null;if(e.properties){let t=e.properties.name||e.properties.NAME||e.properties.id||"Feature";return At("div",{className:"semiotic-tooltip",style:He,children:At("div",{style:{fontWeight:600},children:t})})}let t=null!=e.data?e.data:e;if(!t||"object"!=typeof t)return null;let i=oe(t),r=null!=i.title?String(i.title):null;return null==r&&0===i.entries.length?null:xt("div",{className:"semiotic-tooltip",style:He,children:[null!=r&&At("div",{style:{fontWeight:600,marginBottom:i.entries.length?2:0},children:r}),i.entries.map(e=>xt("div",{children:[xt("span",{style:{opacity:.7},children:[e.key,": "]}),At("span",{style:{fontWeight:600},children:k(e.value)})]},e.key))]})}),pi={top:10,right:10,bottom:10,left:10},fi=null;function gi(){if(null!==fi)return fi;if(typeof window>"u")return!1;let e="function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,t=typeof navigator<"u"&&"number"==typeof navigator.hardwareConcurrency&&navigator.hardwareConcurrency<=4,i=typeof navigator<"u"&&"number"==typeof navigator.deviceMemory&&navigator.deviceMemory<=4;return fi=e||t||i}function mi(){return gi()?12:30}var yi={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 vi(e){return"string"==typeof e?e:"object"==typeof e&&e&&"type"in e?e.type:null}function bi(e){let t=e.pointer.clientX-e.canvasRect.left-e.margin.left,i=e.pointer.clientY-e.canvasRect.top-e.margin.top;if(t<0||t>e.width||i<0||i>e.height)return{kind:"outside"};e.hitCanvasRef.current||(e.hitCanvasRef.current=typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas"));let r=(n=e.hitCanvasRef.current)?n.getContext("2d"):null;var n;if(!r)return{kind:"unavailable"};let a=function(e,t,i,r,n,a,o=0,s=r){if(a){let e=A(a,t,i,r,o);if(e&&!1!==e.node.interactive)return e}else{let n=null,a=1/0;for(let o of e){if("point"!==o.type||!1===o.interactive)continue;let e=o.x-t,s=o.y-i,l=Math.sqrt(e*e+s*s);l<=C(o.r,r)&&l<a&&(n=o,a=l)}if(n)return{node:n,distance:a}}let l=null,c=1/0;for(let n of e){if("glyph"!==n.type||null==n.datum)continue;let e=We(n.glyph,n.size),a=n.x+e.centerDx-t,o=n.y+e.centerDy-i,s=Math.sqrt(a*a+o*o);s<=C(e.radius,r)&&s<c&&(l=n,c=s)}if(l)return{node:l,distance:c};let u=null,h=1/0;for(let r of e){if("line"!==r.type)continue;let e=r,{path:n}=e,a=Math.max((e.style.strokeWidth??2)+4,5,s),o=t-a,l=t+a,c=i-a,d=i+a;for(let r=0;r<n.length-1;r++){let s=n[r],p=n[r+1],f=s[0],g=s[1],m=p[0],y=p[1];if(f<o&&m<o||f>l&&m>l||g<c&&y<c||g>d&&y>d)continue;let v=L(t,i,f,g,m,y);v<=a&&v<h&&(u=e,h=v)}}if(u)return{node:u,distance:h};for(let r=e.length-1;r>=0;r--){let a=e[r];if("geoarea"!==a.type)continue;let o=a;if(!1===o.interactive)continue;let[[s,l],[c,u]]=o.bounds;if(!(t<s||t>c||i<l||i>u)&&(o._cachedPath2D||(o._cachedPath2D=new Path2D(o.pathData)),n.isPointInPath(o._cachedPath2D,t,i)))return{node:o,distance:0}}return null}(e.scene,t,i,Be(30,e.pointer.pointerType),r,e.pointQuadtree,e.maxPointRadius,Be(6,e.pointer.pointerType));if(!a)return{kind:"miss"};let{node:o}=a,s=o.datum,l=Array.isArray(s)?null:s?.properties?s:s?.data||s,c="point"===o.type?o.x:"geoarea"===o.type?o.centroid[0]:t,u="point"===o.type?o.y:"geoarea"===o.type?o.centroid[1]:i;return{kind:"hit",node:o,hover:{...l,...l?.properties||{},data:l,properties:l?.properties,__semioticHoverData:!0,x:c,y:u}}}function wi({graphics:e,size:t,margin:i,readScales:r,tracker:n}){return at(n.subscribe,n.getSnapshot,n.getSnapshot),Qe.createElement(Qe.Fragment,null,D(e,t,i,r()))}var Ri=/*#__PURE__*/ce(/*#__PURE__*/ot(
2
- /*#__PURE__*/st(function(e,t){let{projection:n,projectionExtent:a,fitPadding:o,projectionTransform:s,areas:l,points:c,lines:y,customLayout:v,layoutConfig:b,layoutSelection:w,onLayoutError:R,xAccessor:P,yAccessor:S,lineDataAccessor:x,pointIdAccessor:k,lineIdAccessor:A,lineType:C="geo",flowStyle:L="basic",graticule:D,zoomable:z,zoomExtent:H,onZoom:$,dragRotate:Z,showParticles:U,particleStyle:V,tileURL:Q,tileAttribution:K,tileCacheSize:J,size:ee,width:te,height:oe,responsiveWidth:ce,responsiveHeight:je,margin:Te,className:Be,background:Ie,maxDevicePixelRatio:We,runtimeMode:ze,windowSize:He=500,renderMode:Ze,areaStyle:Xe,pointStyle:Ue,lineStyle:Ye,colorScheme:Ve,enableHover:Je=!0,hoverAnnotation:nt,tooltipContent:at,allowTooltipOverflow:ot=!1,customClickBehavior:st,customHoverBehavior:ct,onObservation:ut,annotationObservationCallback:ht,chartId:dt,annotations:pt,onAnnotationActivate:ft,autoPlaceAnnotations:gt,svgAnnotationRules:mt,decay:yt,pulse:vt,transition:bt,animate:wt,staleness:kt,frameScheduler:Lt,clock:Dt,random:Mt,seed:jt,paused:Tt=!1,suspendWhenHidden:Bt=!0,backgroundGraphics:It,foregroundGraphics:_t,title:Et,legend:Nt,legendPosition:Ot,legendLayout:Ft,legendHoverBehavior:Wt,legendClickBehavior:zt,legendHighlightedCategory:Ht,legendIsolatedCategories:Gt,legendCategoryAccessor:qt,onCategoriesChange:$t,showAxes:Zt,accessibleTable:Xt=!0,description:Ut,summary:Yt}=e,{customHoverBehavior:Vt,customClickBehavior:Qt,hasClickBehavior:Kt}=u({customHoverBehavior:ct,customClickBehavior:st,onObservation:ut,chartId:dt,chartType:"StreamGeoFrame"}),Jt=ee||[te||600,oe||400],oi=it(!0),ci=ue({sizeProp:Jt,responsiveWidth:ce,responsiveHeight:je,userMargin:Te,marginDefault:pi,title:Et,legend:Nt,legendPosition:Ot,legendLayout:Ft,legendMarginReserved:e.__legendMarginReservedFor===Nt,animate:wt,transitionProp:bt,frameScheduler:Lt,clock:Dt,random:Mt,seed:jt,paused:Tt,suspendWhenHidden:Bt,themeDirtyRef:oi}),{reducedMotionRef:ui,responsiveRef:fi,size:Ri,margin:Pi,adjustedWidth:Si,adjustedHeight:xi,transition:ki,introEnabled:Ai,tableId:Ci,frameRuntime:Li,rafRef:Di,renderFnRef:Mi,scheduleRender:ji,currentTheme:Ti}=ci,Bi=he(),Ii=de(),_i=rt(()=>Array.isArray(l)?Y(l):l,[l]),Ei=rt(()=>Y(c),[c]),Ni=rt(()=>Y(y),[y]),Oi=Z??"orthographic"===vi(n),Fi=rt(()=>({projection:n,projectionExtent:a,fitPadding:o,xAccessor:P,yAccessor:S,lineDataAccessor:x,lineType:C,flowStyle:L,areaStyle:Xe,pointStyle:Ue,lineStyle:Ye,colorScheme:Ve,themeSemantic:Ge(Ti),themeSequential:Ti?.colors?.sequential,themeDiverging:Ti?.colors?.diverging,themeCategorical:Ti?.colors?.categorical,graticule:D,projectionTransform:s,windowSize:He,clock:Li.now,decay:yt,pulse:vt,transition:ki,introAnimation:Ai,annotations:pt,pointIdAccessor:k,lineIdAccessor:A,customLayout:v,layoutConfig:b,onLayoutError:R,layoutMargin:Pi}),[n,a,o,P,S,x,C,L,Xe,Ue,Ye,Ve,Ti,D,s,He,Li.now,yt,vt,ki,Ai,pt,k,A,v,b,R,Pi]),Wi=pe(Fi),zi=it(null);zi.current||(zi.current=new ei(Wi));let Hi=X||!Bi&&Ii,Gi=rt(()=>{if(!Hi)return null;let e=new ei(Wi);return _i&&e.setAreas(_i),c&&e.setPoints(Ei),y&&e.setLines(Ni),e.computeScene({width:Si,height:xi}),e.cancelIntroAnimation(),e},[Hi,Wi,_i,c,Ei,y,Ni,Si,xi]);!function(e,t){Ct(()=>{t&&(e.current=t)},[e,t])}(zi,Gi);let qi=Gi??zi.current,$i=it(null),Zi=$i.current??($i.current=function(e){let t=new Set,i=0,r=e;return{subscribe:e=>(t.add(e),()=>t.delete(e)),getSnapshot:()=>i,sync(e){if(e!==r){r=e,i+=1;for(let e of t)e()}}}}(qi.scales)),{resolvedForeground:Xi,resolvedBackground:Ui,themeBackground:Yi,surfaceBackground:Vi}=function({tracker:e,readScales:t,...i}){let r=r=>"function"==typeof r?Qe.createElement(wi,{graphics:r,size:i.size,margin:i.margin,readScales:t,tracker:e}):r;return{...M({...i,resolveScaleAwareGraphics:!1}),resolvedForeground:r(i.foregroundGraphics),resolvedBackground:r(i.backgroundGraphics)}}({foregroundGraphics:_t,backgroundGraphics:It,size:Ri,margin:Pi,scales:qi.scales,background:Ie,themeBackgroundColor:Ti.colors.background,tracker:Zi,readScales:()=>qi.scales}),Qi=it(null),Ki=it(null),Ji=it(null);Q&&!Ji.current&&(Ji.current=new si(J??256)),Ji.current?.setLimit(J??256);let er=it(pt),tr=it(null),ir=it(Pt),rr=it(!1),nr=it(null),ar=et(e=>{nr.current=e,fi&&"object"==typeof fi&&(fi.current=e)},[fi]),or=it(null),sr=it(null),lr=it(null),cr=it(0);if(U&&!lr.current){let e=V?.maxPerLine??mi();lr.current=new li(50*e)}let ur=it(null),hr=it(!1),dr=it(null),pr=it(!1),fr=it(!1),gr=fe("StreamGeoFrame"),mr=it(void 0),[yr,vr]=lt(null),[,br]=lt(0),wr=it(0),[Rr,Pr]=lt(!1),Sr=j(zi,qt,$t,e=>e.getPoints());T(zi,Wi,oi,ji),B(zi,w,oi,ji),Ke(()=>{let e=zi.current;e&&(_i&&e.setAreas(_i),c&&e.setPoints(Ei),y&&e.setLines(Ni),oi.current=!0,ji())},[_i,c,Ei,y,Ni,ji]),function(e,{storeRef:t,dirtyRef:i,scheduleRender:r,zoomTransformRef:n,containerRef:a,zoomBehaviorRef:o}){let s=et(e=>{null==e||"object"!=typeof e||(t.current?.pushPoint(e),i.current=!0,r())},[t,i,r]),l=et(e=>{let n=Y(e);0!==n.length&&(t.current?.pushMany(n),i.current=!0,r())},[t,i,r]),c=et(e=>{null==e||"object"!=typeof e||(t.current?.pushLine(e),i.current=!0,r())},[t,i,r]),u=et(e=>{let n=Y(e);0!==n.length&&(t.current?.pushManyLines(n),i.current=!0,r())},[t,i,r]),h=et(()=>{t.current?.clear(),i.current=!0,r()},[t,i,r]);tt(e,()=>({push:s,pushMany:l,removePoint:e=>{let n=t.current?.removePoint(e)??[];return n.length>0&&(i.current=!0,r()),n},pushLine:c,pushManyLines:u,removeLine:e=>{let n=t.current?.removeLine(e)??[];return n.length>0&&(i.current=!0,r()),n},getLines:()=>t.current?.getLines()??[],clear:h,getProjection:()=>t.current?.scales?.projection??null,getGeoPath:()=>t.current?.scales?.geoPath??null,getCartogramLayout:()=>t.current?.cartogramLayout??null,getCustomLayout:()=>t.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>t.current?.lastCustomLayoutFailure??null,getZoom:()=>n.current.k,resetZoom:()=>{let e=a.current;e&&o.current&&Rt(e).call(o.current.transform,Pt)},getData:()=>t.current?.getPoints()??[]}),[s,l,c,u,h,r,t,i,n,a,o])}(t,{storeRef:zi,dirtyRef:oi,scheduleRender:ji,zoomTransformRef:ir,containerRef:nr,zoomBehaviorRef:tr});let{hoverHandlerRef:xr,onPointerMove:kr,onPointerLeave:Ar,flushPointerMove:Cr,pointerStateRef:Lr}=ci,{canvasRef:Dr,interactionCanvasRef:Mr,resolutionDirtyRef:jr}=ge(ci,{hydrated:Bi,wasHydratingFromSSR:Ii,storeRef:zi,dirtyRef:oi,cleanup:()=>Ji.current?.clear(),maxDevicePixelRatio:We,canvasPaintDependencies:[Si,xi,Ie,It,Ze,Q,J,ji]});Ke(()=>{xr.current=e=>{let t=Dr.current;if(!t)return;let i=zi.current;if(!i||!i.scene.length)return void me(t);let r=bi({pointer:e,canvasRect:t.getBoundingClientRect(),margin:Pi,width:Si,height:xi,scene:i.scene,pointQuadtree:i.quadtree,maxPointRadius:i.maxPointRadius,hitCanvasRef:Ki});me(t,"hit"===r.kind?le(r.node):void 0),Je&&!1!==nt&&("hit"===r.kind?(ur.current=r.hover,dr.current=r.node,vr(r.hover),Vt?.(r.hover),ji()):("outside"===r.kind||"miss"===r.kind&&ur.current)&&(ur.current=null,dr.current=null,vr(null),Vt?.(null),ji()))}},[Je,nt,Si,xi,Pi,Vt,ji,xr,Dr]),ci.hoverLeaveRef.current=()=>{me(Dr.current),Je&&!1!==nt&&(ur.current=null,dr.current=null,vr(null),Vt?.(null),ji())},ye(Dr);let Tr=et(e=>{if(ve(e.target)||!Qt)return;Cr();let t=zi.current;if(!t||!t.scene.length)return void Qt(null);let i=bi({pointer:{clientX:e.clientX,clientY:e.clientY,pointerType:mr.current},canvasRect:e.currentTarget.getBoundingClientRect(),margin:Pi,width:Si,height:xi,scene:t.scene,pointQuadtree:t.quadtree,maxPointRadius:t.maxPointRadius,hitCanvasRef:Ki});Qt("hit"===i.kind?i.hover:null,{type:"activate",inputType:be(mr.current)})},[xi,Si,Qt,Pi,Cr]),{kbFocusIndexRef:Br,focusedNavPointRef:Ir,onKeyDown:_r,refreshKeyboardFocus:Er}=h({clearPointerHover:Ar,storeRef:zi,hoverRef:ur,hoveredNodeRef:dr,setHoverPoint:vr,customHoverBehavior:Vt,customClickBehavior:Qt,scheduleRender:ji}),Nr=et(e=>{I(Lr,e,Je&&!1!==nt,hr.current,Dr.current)&&(mr.current=e.pointerType,Br.current=-1,Ir.current=null,kr(e))},[Dr,Je,nt,Ir,Br,kr,Lr]),Or=et(e=>{mr.current=e.pointerType},[]);Mi.current=()=>{if(Di.current=null,Zi.sync(zi.current?.scales??null),!Li.isActive)return;let e=Dr.current,t=zi.current;if(!e||!t)return;let n=Li.now(),a=!1,o=sr.current,s=!1;if(o){sr.current=null;let e={width:Si,height:xi};t.applyRotation(o,e),s=!0}let l=null!=t.activeTransition,c=t.advanceTransition(ui.current?n+1e6:n),u=!ui.current&&c,h=gr.current.beforeCompute(t.getLastUpdateResult(),u),y=!1;if(oi.current&&!c){let e={width:Si,height:xi},i=t.hasProjection(),r=Oi&&i?t.getRotation():null;t.computeScene(e);let n=ir.current,a=1!==n.k||0!==n.x||0!==n.y;Oi&&r?a?(t.setRotation(r),t.applyZoomScale(n.k,e)):t.applyRotation(r,e):a&&t.applyZoomTransform(n,e),Er(),oi.current=!1,y=!0,Sr()}Zi.sync(t.scales),gr.current.afterCompute(h,y,!1);let v=ae(We,Ri),b=Mr.current;b&&we(b,Ri,v);let w=U&&!ui.current&&!!lr.current,R=t.consumeStylePaintPending();var P;(y||s||R)&&(hr.current=Re(t.scene),hr.current||me(e)),hr.current&&(l||y||s||R)&&(P={canvas:e,pointer:Lr.current,store:t,margin:Pi,width:Si,height:xi,hitCanvasRef:Ki,geometryMoved:l||y||s},se(P.canvas,P.pointer,e=>{let t=bi({pointer:e,canvasRect:P.canvas.getBoundingClientRect(),margin:P.margin,width:P.width,height:P.height,scene:P.store.scene,pointQuadtree:P.geometryMoved?null:P.store.quadtree,maxPointRadius:P.store.maxPointRadius,hitCanvasRef:P.hitCanvasRef});return"hit"===t.kind?le(t.node):void 0}));let S=d(t,n,y,fr),x=jr.current,k=f({dirtyOrRebuilt:y,transitioning:l,continuous:w,liveEncoding:S.changed,forced:s||R||x});if(jr.current=!1,Q&&Ji.current){let e=Qi.current;if(e&&t.scales?.projection){let i=Pe(e,Ri,Pi,v);i&&(i.clearRect(-Pi.left,-Pi.top,Ri[0],Ri[1]),i.save(),i.beginPath(),i.rect(0,0,Si,xi),i.clip(),function(e,t){let{tileURL:i,projection:r,width:n,height:a,tileCache:o,onTileLoad:s,maxDevicePixelRatio:l}=t,c=r.scale(),u=r([0,0])??r.translate(),h=function(e){let{size:t,scale:i,translate:r,clampX:n=!0,clampY:a=!0}=e,o=Math.max(Math.log(i)/Math.LN2-8,0),s=Math.round(o),l=1<<s,c=Math.pow(2,o-s+8),u=r[0]-i/2,h=r[1]-i/2,d=Math.max(n?0:-1/0,Math.floor((0-u)/c)),p=Math.min(n?l:1/0,Math.ceil((t[0]-u)/c)),f=Math.max(a?0:-1/0,Math.floor((0-h)/c)),g=Math.min(a?l:1/0,Math.ceil((t[1]-h)/c)),m=[];for(let e=f;e<g;++e)for(let t=d;t<p;++t)m.push([t,e,s]);return{tiles:m,translate:[u/c,h/c],scale:c}}({size:[n,a],scale:2*c*Math.PI,translate:u,clampX:!1}),d=ae(l,[n,a]),p=function(e){if("string"==typeof e)return`template:${e}`;let t=e,i=ni.get(t);return null==i&&(i=ai++,ni.set(t,i)),`provider:${i}`}(i),f=!0;for(let t of h.tiles){let[r,n,a]=ii(t),l=ri(i,a,r,n,d),c=`${p}|dpr:${d}|${a}/${r}/${n}|${l}`,u=o.get(c);if(!u||u.failed&&(u.attempts??1)<3&&Date.now()>=(u.retryAt??1/0)){let e=new Image;e.crossOrigin="anonymous";let t={img:e,loaded:!1,failed:!1,key:c,lastUsed:performance.now(),attempts:(u?.attempts??0)+1};o.set(c,t),e.onload=()=>{t.loaded=!0,s?.()},e.onerror=()=>{t.loaded=!0,t.failed=!0,t.retryAt=Date.now()+1e3,s?.()},e.src=l,u=t}if(!u.loaded){f=!1;continue}if(u.failed)continue;let g=h.scale,m=h.translate[0],y=h.translate[1],v=(t[0]+m)*g,b=(t[1]+y)*g;e.drawImage(u.img,v-.5,b-.5,g+1,g+1)}}(i,{tileURL:Q,projection:t.scales.projection,width:Si,height:xi,tileCache:Ji.current,maxDevicePixelRatio:We,onTileLoad:()=>ji()}),i.restore())}}if(k){let i=Pe(e,Ri,Pi,v);if(!i)return;i.clearRect(-Pi.left,-Pi.top,Ri[0],Ri[1]),Q||_(i,{background:Ie,themeBackground:Yi,hasBackgroundGraphics:!!It,x:-Pi.left,y:-Pi.top,width:Ri[0],height:Ri[1]}),i.save(),i.beginPath(),i.rect(0,0,Si,xi),i.clip();let o=t.scene,s=(t.scales,{width:Si,height:xi});if(E({context:i,nodes:o,renderMode:Ze,pixelRatio:v,paintBuiltIn:e=>{(function(e,t){let i=t.filter(e=>"geoarea"===e.type);for(let t of i){if(!t.pathData)continue;t._cachedPath2D||(t._cachedPath2D=new Path2D(t.pathData));let i=t._cachedPath2D,r=Ne(t.style.fill)?void 0:Oe(e,t.style.fill)||"#e0e0e0";r&&!Ne(r)&&(e.fillStyle=r,e.globalAlpha=(t._decayOpacity??1)*(t.style.fillOpacity??1),e.fill(i));let n=t.style.strokeWidth??.5;if(t.style.stroke&&"none"!==t.style.stroke&&n>0){if(e.strokeStyle=Fe(e,t.style.stroke)||t.style.stroke,e.lineWidth=n,e.globalAlpha=t._decayOpacity??1,t.style.strokeDasharray){let i=t.style.strokeDasharray.split(",").map(Number);e.setLineDash(i)}else e.setLineDash([]);e.stroke(i)}G(e,t,i),e.globalAlpha=1,e.setLineDash([])}})(i,e),r(i,e.filter(e=>"line"===e.type),s),p(i,e.filter(e=>"point"===e.type)),m(i,e.filter(e=>"glyph"===e.type))}}),w&&lr.current){let e=lr.current,t=o.filter(e=>"line"===e.type);if(t.length>0){let r=V||{},o=.3*(r.speedMultiplier??1),s=r.maxPerLine??mi(),l=r.spawnRate??(gi()?.06:.15),c=r.radius??2,u=r.opacity??.7,h=n/1e3,d=cr.current>0?Math.min(h-cr.current,.1):.016;cr.current=h;let p=t.map(e=>e.path),f=t.map(e=>e.style.strokeWidth??2);for(let i=0;i<t.length;i++)Li.random()<l&&e.countForLine(i)<s&&e.spawn(i,Li.random);e.step(d,o,p,f),i.globalAlpha=u;for(let n=0;n<e.particles.length;n++){let a=e.particles[n];if(!a.active)continue;let o=t[a.lineIndex],s="function"==typeof r.color?r.color(o?.datum??{}):"source"!==r.color&&r.color?r.color:o?.style.stroke||"#fff";i.beginPath(),i.arc(a.x,a.y,c,0,2*Math.PI),i.fillStyle=s,i.fill()}i.globalAlpha=1,a=!0}}i.restore()}(y||l&&!c)&&e.setAttribute("aria-label",Se(t.scene,"Geographic chart"));let A=dr.current,C=!(!A||"geoarea"!==A.type&&"point"!==A.type),L=g(C,pr.current),D=Mr.current;if(D&&L){let e=Pe(D,Ri,Pi,v);if(e){if(e.clearRect(-Pi.left,-Pi.top,Ri[0],Ri[1]),A&&"geoarea"===A.type){let t=new Path2D(A.pathData);e.fillStyle="rgba(255, 255, 255, 0.3)",e.fill(t),e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineWidth=2,e.stroke(t)}if(A&&"point"===A.type){let t=A,r=("object"==typeof nt?nt:void 0)?.pointColor||i(A);e.beginPath(),e.arc(t.x,t.y,t.r+3,0,2*Math.PI),r?(e.save(),e.globalAlpha=.4,e.fillStyle=r,e.fill(),e.restore()):(e.fillStyle="rgba(255, 255, 255, 0.4)",e.fill()),e.strokeStyle=r||"rgba(0, 0, 0, 0.5)",e.lineWidth=2,e.stroke()}}pr.current=C}let M=pt!==er.current;M&&(er.current=pt),(y||M||l&&pt&&pt.length>0)&&(y||M||l&&!c||n-wr.current>=33)&&(br(e=>e+1),wr.current=n),(u||null!=t.activeTransition||S.pending||a)&&ji()},N(kt,zi,oi,ji,Li.now,Rr,Pr),Ke(()=>{if("production"!==process.env.NODE_ENV&&Q){let e=vi(n);e&&"mercator"!==e&&console.warn(`[StreamGeoFrame] tileURL is set but projection is "${e}". Raster tiles use Web Mercator and will not align with other projections.`)}},[Q,n]),Ke(()=>{let e=nr.current;if(!z||!e)return tr.current&&e&&(Rt(e).on(".zoom",null),tr.current=null),void(e&&Rt(e).on("mousedown.rotate",null).on("touchstart.rotate",null));let[t,i]=H||[1,8],r={width:Si,height:xi};if(Oi){let n=ir.current.k,a=e=>{n=Math.max(t,Math.min(i,e)),ir.current=Pt.scale(n);let a=zi.current;a&&(a.applyZoomScale(n,r),oi.current=!1,ji(),a.scales?.projection&&$?.({projection:a.scales.projection,zoom:a.currentZoom}))};tr.current={scaleBy:(e,t)=>a(n*t),transform:(e,t)=>a(t?.k??1)};let o=e=>{e.preventDefault();let t=e.deltaY<0?1.1:1/1.1;a(n*t)},s=e=>{let t=e.target;t&&(t.closest("button")||t.closest(".stream-geo-zoom-controls"))||(e.preventDefault(),a(1.5*n))};e.addEventListener("wheel",o,{passive:!1}),e.addEventListener("dblclick",s);let l=.4,c=t=>{if(0!==t.button)return;let i=t.target;if(i.closest("button")||i.closest(".stream-geo-zoom-controls"))return;let r=zi.current;if(!r)return;let n=r.getRotation();or.current={x:t.clientX,y:t.clientY,rotation:[...n]},e.setPointerCapture(t.pointerId),t.preventDefault()},u=e=>{let t=or.current;if(!t)return;let i=e.clientX-t.x,r=e.clientY-t.y,n=[t.rotation[0]+i*l,Math.max(-90,Math.min(90,t.rotation[1]-r*l)),t.rotation[2]];sr.current=n,ji()},h=t=>{if(!or.current)return;or.current=null,e.releasePointerCapture(t.pointerId);let i=sr.current;if(i){sr.current=null;let e=zi.current;e&&(e.applyRotation(i,r),ji())}let n=zi.current;n?.scales?.projection&&$?.({projection:n.scales.projection,zoom:n.currentZoom})};return e.addEventListener("pointerdown",c),e.addEventListener("pointermove",u),e.addEventListener("pointerup",h),e.addEventListener("pointercancel",h),()=>{e.removeEventListener("wheel",o),e.removeEventListener("dblclick",s),e.removeEventListener("pointerdown",c),e.removeEventListener("pointermove",u),e.removeEventListener("pointerup",h),e.removeEventListener("pointercancel",h),tr.current=null}}let n=St().scaleExtent([t,i]).extent([[0,0],[Ri[0],Ri[1]]]).translateExtent([[-1/0,-1/0],[1/0,1/0]]).on("zoom",e=>{let t=e.transform;ir.current=t,rr.current=!0;let i=zi.current;i&&(i.applyZoomTransform(t,r),oi.current=!1,ji())}).on("end",e=>{ir.current=e.transform,rr.current=!1;let t=zi.current;t?.scales?.projection&&$?.({projection:t.scales.projection,zoom:t.currentZoom})});return tr.current=n,Rt(e).call(n),()=>{Rt(e).on(".zoom",null)}},[z,H,Oi,Ri,Si,xi,Pi,$,ji]);let Fr=Je&&!1!==nt,Wr=Fr&&yr?at?at(yr):At(di,{data:yr}):null,zr=qe(Wr)?At(xe,{contentOwnsChrome:$e(at),x:yr.x,y:yr.y,containerWidth:Si,containerHeight:xi,margin:Pi,className:"stream-frame-tooltip",zIndex:10,children:Wr}):null;if(Hi){let e=qi.scene;return xt("div",{ref:ar,className:"stream-geo-frame"+(Be?` ${Be}`:""),role:"group","aria-label":Ut||("string"==typeof Et?Et:"Geographic chart"),style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:ce?"100%":Ri[0],height:je?"100%":Ri[1]},children:[At(ke,{accessibleTable:Xt,scene:e,chartType:"Geographic chart",tableId:Ci,chartTitle:"string"==typeof Et?Et:void 0}),At(Ae,{summary:Yt}),xt("div",{role:"img","aria-label":Ut||("string"==typeof Et?Et:"Geographic chart"),children:[xt("svg",{role:"presentation",xmlns:"http://www.w3.org/2000/svg",width:Ri[0],height:Ri[1],style:{position:"absolute",left:0,top:0},children:[Vi?At("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:Ri[0],height:Ri[1],fill:Vi}):null,At("g",{transform:`translate(${Pi.left},${Pi.top})`,children:Ui}),At("g",{transform:`translate(${Pi.left},${Pi.top})`,children:e.map((e,t)=>O({node:e,index:t,renderMode:Ze,fallback:()=>function(e,t){return ie(function(e,t){switch(e.type){case"geoarea":{let i=e;if(!i.pathData)return null;let r=_e(i.style.fill)?Ee(i.style.fill,`geoarea-${t}-hatch`):void 0;return xt(Qe.Fragment,{children:[r&&At("defs",{children:r}),At("path",{d:i.pathData,fill:r?`url(#geoarea-${t}-hatch)`:ne(i.style.fill,"#e0e0e0"),fillOpacity:i.style.fillOpacity??1,stroke:i.style.stroke||"none",strokeWidth:i.style.strokeWidth??.5,strokeDasharray:i.style.strokeDasharray,opacity:(i.style.opacity??1)*(i._decayOpacity??1)})]},`geoarea-${t}`)}case"point":{let i=e,r=_e(i.style.fill)?Ee(i.style.fill,`geopoint-${t}-hatch`):void 0;return xt(Qe.Fragment,{children:[r&&At("defs",{children:r}),At("circle",{cx:i.x,cy:i.y,r:i.r,fill:r?`url(#geopoint-${t}-hatch)`:ne(i.style.fill),fillOpacity:i.style.fillOpacity??.8,stroke:i.style.stroke,strokeWidth:i.style.strokeWidth,opacity:i._decayOpacity??i.style.opacity??1})]},`point-${t}`)}case"line":{let i=e;if(i.path.length<2)return null;let r="M"+i.path.map(e=>`${e[0]},${e[1]}`).join("L");return At("path",{d:r,fill:"none",stroke:i.style.stroke||"#4e79a7",strokeWidth:i.style.strokeWidth??1.5,strokeDasharray:i.style.strokeDasharray,opacity:i.style.opacity??1},`line-${t}`)}case"glyph":{let i=e;return re(i,i.x,i.y,`geo-glyph-${i.pointId??t}`)}default:return null}}(e,t),e,`geo-cursor-${t}`)}(e,t)}))})]}),At(ti,{decorative:!0,width:Si,height:xi,totalWidth:Ri[0],totalHeight:Ri[1],margin:Pi,showAxes:!1,title:Et,description:Ut,legend:Nt,legendPosition:Ot,legendLayout:Ft,legendHoverBehavior:Wt,legendClickBehavior:zt,legendHighlightedCategory:Ht,legendIsolatedCategories:Gt,foregroundGraphics:F(Xi,q(qi.customLayoutOverlays,w??null)),annotations:pt,onAnnotationActivate:ft,onObservation:ht??ut,chartId:dt,chartType:"StreamGeoFrame",autoPlaceAnnotations:gt,svgAnnotationRules:mt,pointNodes:hi(e),geoProjection:qi.scales?.projectedPoint})]})]})}return xt("div",{ref:ar,className:"stream-geo-frame"+(Be?` ${Be}`:""),role:"group","aria-label":Ut||("string"==typeof Et?Et:"Geographic chart"),tabIndex:0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:ce?"100%":Ri[0],height:je?"100%":Ri[1],overflow:ot?"visible":"hidden",...z?{touchAction:"none"}:{}},onKeyDown:_r,children:["production"!==process.env.NODE_ENV&&zi.current&&At(Ce,{store:zi.current,diagnostics:gr.current}),At(ke,{accessibleTable:Xt,sceneRevision:zi.current?.getUpdateSnapshot().revisions.accessibility,scene:zi.current?.scene??[],chartType:"Geographic chart",tableId:Ci,chartTitle:"string"==typeof Et?Et:void 0}),At(Ae,{summary:Yt}),At(Le,{active:Br.current>=0,hoverPoint:yr}),xt("div",{role:"img","aria-label":Ut||("string"==typeof Et?Et:"Geographic chart"),style:{position:"relative",width:"100%",height:"100%"},onPointerMove:Nr,onPointerLeave:Ar,onPointerDown:Fr||Kt?Or:void 0,onClick:Kt?Tr:void 0,children:[At(De,{size:Ri,margin:Pi,backdropFill:Vi??void 0,children:Ui}),Q&&At("canvas",{ref:Qi,style:{position:"absolute",left:0,top:0,width:Ri[0],height:Ri[1],pointerEvents:"none"}}),At("canvas",{"aria-hidden":"true",ref:Dr,"aria-label":Se(zi.current?.scene??[],"Geographic chart"),style:{position:"absolute",left:0,top:0,width:Ri[0],height:Ri[1]}}),At("canvas",{ref:Mr,style:{position:"absolute",left:0,top:0,width:Ri[0],height:Ri[1],pointerEvents:"none"}}),At(ti,{decorative:!0,width:Si,height:xi,totalWidth:Ri[0],totalHeight:Ri[1],margin:Pi,showAxes:Zt,title:Et,description:Ut,legend:Nt,legendPosition:Ot,legendLayout:Ft,legendHoverBehavior:Wt,legendClickBehavior:zt,legendHighlightedCategory:Ht,legendIsolatedCategories:Gt,foregroundGraphics:F(Xi,q(qi.customLayoutOverlays,w??null)),annotations:pt,onAnnotationActivate:ft,onObservation:ht??ut,chartId:dt,chartType:"StreamGeoFrame",autoPlaceAnnotations:gt,svgAnnotationRules:mt,pointNodes:hi(zi.current?.scene),geoProjection:qi.scales?.projectedPoint}),kt?.showBadge&&At(W,{isStale:Rr,position:kt.badgePosition,state:kt.state,settling:kt.settling}),At(Me,{active:Br.current>=0,hoverPoint:yr,margin:Pi,size:Ri,shape:Ir.current?.shape,width:Ir.current?.w,height:Ir.current?.h,pathData:Ir.current?.pathData}),zr]}),z&&xt("div",{className:"stream-geo-zoom-controls",style:{position:"absolute",bottom:Pi.bottom+8,left:Pi.left+8,display:"flex",flexDirection:"column",gap:2,zIndex:2},children:[At("button",{type:"button","aria-label":"Zoom in",onClick:e=>{e.stopPropagation();let t=nr.current,i=tr.current;t&&i?.scaleBy&&i.scaleBy(Rt(t),1.5)},style:yi,children:"+"}),At("button",{type:"button","aria-label":"Zoom out",onClick:e=>{e.stopPropagation();let t=nr.current,i=tr.current;t&&i?.scaleBy&&i.scaleBy(Rt(t),1/1.5)},style:yi,children:"−"})]}),K&&At("div",{className:"stream-geo-tile-attribution",style:{position:"absolute",bottom:Pi.bottom+2,right:Pi.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:K})]})})),"StreamGeoFrame"),Pi=Ri,Si=/*#__PURE__*/ce(/*#__PURE__*/st(function(i,r){let{points:n,areas:a,lines:o,layout:s,layoutConfig:l,onLayoutError:c,projection:u="equirectangular",xAccessor:h="lon",yAccessor:d="lat",lineDataAccessor:p,colorBy:f,colorScheme:g,tooltip:m,annotations:y,margin:v,selection:b,linkedHover:w,onObservation:R,onClick:P,chartId:S,loading:x,loadingContent:k,emptyContent:A,className:C,frameProps:L={}}=i,{frameRef:D,resolved:M,normalizedMargin:j}=e({responsive:i,imperativeRef:r,imperativeVariant:"geo-points",margin:v,width:i.width,height:i.height,enableHover:i.enableHover,title:i.title,description:i.description,summary:i.summary,accessibleTable:i.accessibleTable,mode:i.mode,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,responsiveRules:i.responsiveRules}),T=rt(()=>Y(n),[n]),B=rt(()=>Y(a),[a]),I=rt(()=>Y(o),[o]),_=rt(()=>[...T,...I,...B],[T,I,B]),E=t({responsive:i,data:_,rawData:void 0!==n||void 0!==o||void 0!==a?_:void 0,colorBy:f,colorScheme:g,legendInteraction:void 0,selection:b,linkedHover:w,fallbackFields:"string"==typeof f?[f]:[],unwrapData:!1,onObservation:R,onClick:P,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"GeoCustomChart",chartId:S,showLegend:!1,userMargin:j,marginDefaults:M.marginDefaults,loading:x,loadingContent:k,emptyContent:A,width:M.width,height:M.height,hasTitle:!!M.title}),N=E.effectiveSelectionHook,O=rt(()=>N?.isActive?{isActive:!0,predicate:N.predicate}:null,[N?.isActive,N?.predicate]);if(E.earlyReturn)return E.earlyReturn;let{width:F,height:W,enableHover:G,title:q,description:$,summary:Z,accessibleTable:X}=M,U=je(m),V={projection:u,...null!=n&&{points:T},...null!=a&&{areas:B},...null!=o&&{lines:I},xAccessor:h,yAccessor:d,...null!=p&&{lineDataAccessor:p},customLayout:s,layoutConfig:l,onLayoutError:c,layoutSelection:O,colorBy:f,colorScheme:g,size:[F,W],responsiveWidth:i.responsiveWidth,responsiveHeight:i.responsiveHeight,margin:E.margin,enableHover:G,...H({title:q,description:$,summary:Z,accessibleTable:X,className:C,animate:i.animate,maxDevicePixelRatio:i.maxDevicePixelRatio,autoPlaceAnnotations:i.autoPlaceAnnotations}),...!1===m?{tooltipContent:()=>null}:U?{tooltipContent:U}:{},...z({linkedHover:w,selection:b,onObservation:R,onClick:P,hoverHighlight:!1,mobileInteraction:E.mobileInteraction,customHoverBehavior:E.customHoverBehavior,customClickBehavior:E.customClickBehavior,linkedHoverInClickPredicate:!1}),...y&&y.length>0&&{annotations:y},...L};return At(Te,{componentName:"GeoCustomChart",width:F,height:W,children:At(Pi,{ref:D,...V})})}),"GeoCustomChart");export{Pi as a,Si as b};
@@ -1 +0,0 @@
1
- function e(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}}function t(e,t){let s=e();return Number.isFinite(s)?s:t}function s(e,t){return e?!0===e?{name:"hover",fields:t||[]}:"string"==typeof e?{name:e,fields:t||[]}:{name:e.name||"hover",fields:e.fields||t||[],mode:e.mode,xField:e.xField,seriesField:e.seriesField}:null}function i(e){return e?"string"==typeof e?{name:e}:e:null}function l(e,t,s,i){if(!t)return e;let l=(l,...a)=>{let r={...e(l,...a)};if(t.isActive)if(t.predicate(i?i(l):l))s?.selectedStyle&&Object.assign(r,s.selectedStyle);else{let e=s?.unselectedOpacity??.5;r.opacity=e,r.fillOpacity=e,r.strokeOpacity=e,s?.unselectedStyle&&Object.assign(r,s.unselectedStyle)}return r};return a(l,[l])}import{a}from"./c-5PCO2P5Q.min.js";var r=()=>typeof performance<"u"?performance.now():Date.now(),n=class{constructor(e={}){this.randomSource=Math.random,this.subscribers=new Set,this.now=()=>this.advance(),this.random=()=>this.randomSource(),this.clock=e.clock??r,this.lastWallTime=t(this.clock,0),this.logicalTime=this.lastWallTime,this.pausedValue=!0===e.paused,this.visibleValue=!1!==e.visible,this.setRandomSource(e.random,e.seed)}get isActive(){return!this.pausedValue&&this.visibleValue}get paused(){return this.pausedValue}get seed(){return this.seedValue}get visible(){return this.visibleValue}configure(e){this.setClock(e.clock),this.setRandomSource(e.random,e.seed)}setPaused(e){this.pausedValue!==e&&(this.advance(),this.pausedValue=e,this.emit())}setVisible(e){this.visibleValue!==e&&(this.advance(),this.visibleValue=e,this.emit())}snapshot(){return{now:this.now(),paused:this.pausedValue,seed:this.seedValue,visible:this.visibleValue}}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}advance(){let e=t(this.clock,this.lastWallTime),s=Math.max(0,e-this.lastWallTime);return this.lastWallTime=e,this.isActive&&(this.logicalTime+=s),this.logicalTime}emit(){for(let e of this.subscribers)e()}setClock(e){let s=e??r;s!==this.clock&&(this.advance(),this.clock=s,this.lastWallTime=t(s,this.lastWallTime))}setRandomSource(t,s){let i=function(e){return"number"==typeof e&&Number.isFinite(e)?Math.trunc(e):void 0}(s);t===this.randomInput&&i===this.seedValue||(this.randomInput=t,this.seedValue=i,this.randomSource=t??(void 0===i?Math.random:e(i)))}},u=.5;export{e as a,n as b,s as c,i as d,u as e,l as f};
@@ -1 +0,0 @@
1
- import{f as e,c as t,a as i,g as r,i as s,d as n,e as a,h as o}from"./c-ZWJDTDEV.min.js";import{a as l}from"./c-ORLEBW72.min.js";import{a as c}from"./c-4RVDKSMQ.min.js";import{b as u,a as h}from"./c-KQEOKGYV.min.js";import{a as d}from"./c-TDPGVYQW.min.js";import{a as f}from"./c-QAVFOEUY.min.js";import{d as p,f as g,e as y,h as m,k as x,c as v,i as b,j as k,b as A}from"./c-4YPPVFZH.min.js";import{c as w,j as S,i as C}from"./c-ZYMXDR42.min.js";import{c as M,a as P,g as R,f as T,h as D,e as L,i as E,k as $,l as F,j as N}from"./c-XORVM6C5.min.js";import{e as _}from"./c-5XCN6BMT.min.js";import{a as I}from"./c-FBV4S363.min.js";import{a as z,b as B}from"./c-L3WAZ53J.min.js";import{b as Y}from"./c-V4XMSLC3.min.js";import{a as O}from"./c-2N7IU2NY.min.js";import{b as W,d as V,c as j,a as X}from"./c-YLZIV3VS.min.js";import{f as H,e as G,d as U,a as q,b as J,c as K,o as Z,l as Q,j as ee,k as te,s as ie,v as re,t as se,u as ne,m as ae,y as oe,B as le,h as ce,i as ue,O as he,p as de,C as fe,q as pe,w as ge,D as ye,g as me,r as xe}from"./c-W5ATXREF.min.js";import{c as ve}from"./c-363Q2L4Z.min.js";import{k as be,l as ke,p as Ae,q as we,E as Se,u as Ce,t as Me,K as Pe,Q as Re,J as Te,S as De,R as Le,U as Ee,A as $e,Z as Fe,W as Ne,ai as _e,ab as Ie,Y as ze,aa as Be,X as Ye,ac as Oe,H as We,am as Ve,aJ as je,aS as Xe,ag as He,aX as Ge,aB as Ue,aj as qe,ak as Je,b as Ke,m as Ze,aF as Qe,ae as et,ah as tt,G as it,aT as rt,ad as st,aE as nt,aC as at,aD as ot,at as lt,az as ct,av as ut,ax as ht,o as dt,an as ft,aG as pt,bi as gt}from"./c-SU6Z75M2.min.js";import{d as yt}from"./c-KLJDKRD5.min.js";import{c as mt,a as xt,d as vt}from"./c-SIQVOV6A.min.js";import{s as bt,o as kt,p as At}from"./c-WPL6PGP3.min.js";import{o as wt,a as St,i as Ct,k as Mt,p as Pt,m as Rt,t as Tt,r as Dt,e as Lt}from"./c-VZNIIKL6.min.js";import{b as Et,i as $t}from"./c-ELGOCAEY.min.js";import{m as Ft,y as Nt,t as _t,s as It,z as zt,h as Bt}from"./c-TC47SNSI.min.js";import{f as Yt}from"./c-5PCO2P5Q.min.js";import{a as Ot,d as Wt,i as Vt,h as jt,f as Xt,j as Ht}from"./c-7BVQDXFU.min.js";import{d as Gt}from"./c-I4BEWAKT.min.js";import*as Ut from"react";import{useCallback as qt,useImperativeHandle as Jt,useRef as Kt,useState as Zt,useEffect as Qt,useMemo as ei,useId as ti,memo as ii,forwardRef as ri}from"react";import{jsx as si,jsxs as ni,Fragment as ai}from"react/jsx-runtime";import{scaleLog as oi,scaleSymlog as li,scaleUtc as ci,scaleTime as ui,scaleLinear as hi}from"d3-scale";import{quadtree as di}from"d3-quadtree";import{line as fi,area as pi}from"d3-shape";var gi=null,yi=null;function mi(e){let[t,i]=Ut.useState(()=>gi);return Ut.useEffect(()=>{if(t)return;let e=!1;return(gi?Promise.resolve(gi):(yi||(yi=import("./c-ONOWKUUZ.min.js").then(e=>gi=e.XYBrushOverlay).catch(e=>{throw yi=null,e})),yi)).then(t=>{e||i(()=>t)}),()=>{e=!0}},[t]),t?si(t,{...e}):null}var xi=null,vi=null;function bi(){return xi}function ki(){return xi?Promise.resolve(xi):(vi??(vi=import("./c-ZDCTFRA6.min.js").then(e=>xi=e.xyTransitionEngine).catch(e=>{throw vi=null,e})),vi)}var Ai=/*#__PURE__*/new Set;function wi(e,t){let i="function"==typeof e?e:i=>i[e||t];return e=>{let t=i(e);return null==t?Number.NaN:+t}}function Si(e){let t=[],i=["bar","swarm","waterfall"].includes(e.chartType)||"streaming"===e.runtimeMode,r=wi(i&&e.valueAccessor||e.yAccessor,i?"value":"y");if(e.boundsAccessor){let i=W(e.boundsAccessor,"bounds");t.push({kind:"bounds",getTop:e=>{let t=r(e);if(!Number.isFinite(t))return Number.NaN;let s=i(e);return Number.isFinite(s)&&0!==s?t+s:t},getBottom:e=>{let t=r(e);if(!Number.isFinite(t))return Number.NaN;let s=i(e);return Number.isFinite(s)&&0!==s?t-s:t},style:e.boundsStyle,perSeries:!0,interactive:!1})}if(e.band){let i=Array.isArray(e.band)?e.band:[e.band];for(let e of i)t.push({kind:"band",getTop:wi(e.y1Accessor,"y1"),getBottom:wi(e.y0Accessor,"y0"),style:e.style,perSeries:!1!==e.perSeries,interactive:!0===e.interactive})}return t}function Ci(e,t){return t?[t[0]??e[0],t[1]??e[1]]:e}function Mi(e){let{config:t,groups:i,getX:r,getY:s}=e,n="exact"===(t.yAxisExtent??t.axisExtent),a=n?"exact":"pad",o="log"===t.yScaleType?"log":"lin",l=t.normalize?`${e.bufferSize}:${e.ingestVersion}:norm:${t.stackOrder??"key"}:${a}:${o}`:`${e.bufferSize}:${e.ingestVersion}:${t.baseline??"zero"}:${t.stackOrder??"key"}:${a}:${o}`;if(e.stackExtentCache&&e.stackExtentCache.key===l)return{yDomain:e.stackExtentCache.yDomain,stackExtentCache:e.stackExtentCache};let c=new Map,u=new Set,h=new Map,d=new Map;for(let e of i){let t=new Map,i=0;for(let n of e.data){let e=r(n),a=s(n);if(!Number.isFinite(e)||!Number.isFinite(a))continue;t.set(e,(t.get(e)||0)+a),u.add(e),i+=a;let o=(h.get(e)||0)+a;h.set(e,o)}c.set(e.key,t),d.set(e.key,i)}let f,p=t.stackOrder??"key",g=(e,t)=>e<t?-1:e>t?1:0;if("input"===p)f=i.map(e=>e.key);else if("insideOut"===p){let e=[...i].map(e=>e.key).sort((e,t)=>{let i=(d.get(t)??0)-(d.get(e)??0);return 0!==i?i:g(e,t)}),t=[],r=[],s=0,n=0;for(let i of e)s<n?(t.push(i),s+=d.get(i)??0):(r.push(i),n+=d.get(i)??0);f=[...r.reverse(),...t]}else f="asc"===p?i.map(e=>e.key).sort((e,t)=>{let i=(d.get(e)??0)-(d.get(t)??0);return 0!==i?i:g(e,t)}):"desc"===p?i.map(e=>e.key).sort((e,t)=>{let i=(d.get(t)??0)-(d.get(e)??0);return 0!==i?i:g(e,t)}):i.map(e=>e.key).sort(g);if(t.normalize)for(let e of c.values())for(let[t,i]of e)e.set(t,i/(h.get(t)||1));let y,m=t.normalize?"zero":t.baseline,x="log"===t.yScaleType?[]:null,v=e=>{x&&(x.length>0&&x[x.length-1]===e||x.push(e))},b=e=>{let t={key:l,yDomain:e};return x&&(t.plottedY=x),{yDomain:e,stackExtentCache:t}};if("wiggle"===m||"silhouette"===m){let e=Array.from(u).sort((e,t)=>e-t),i=w(e,f,(e,t)=>c.get(e)?.get(t)||0,m),r=1/0,s=-1/0,a=e=>{v(e),e<r&&(r=e),e>s&&(s=e)};for(let t of e){let e=i.get(t)??0;a(e);for(let i of f){let r=c.get(i)?.get(t)||0;0!==r&&(e+=r,a(e))}}(!Number.isFinite(r)||!Number.isFinite(s))&&(r=0,s=0);let o=s-r,l=n?0:o>0?o*t.extentPadding:1;return b([r-l,s+l])}if("diverging"===m){let e=Array.from(u).sort((e,t)=>e-t),i=0,r=0,s=e=>{v(e),e<i&&(i=e),e>r&&(r=e)};for(let t of e){let e=0,i=0;for(let r of f){let n=c.get(r)?.get(t)||0;0!==n&&(n>0?(e+=n,s(e)):(i+=n,s(i)))}}let a=r-i,o=n?0:a>0?a*t.extentPadding:1;return b([i-o,r+o])}{let e=Array.from(u).sort((e,t)=>e-t),i=0,r=0;for(let t of e){let e=0;for(let s of f){let n=c.get(s)?.get(t)||0;0!==n&&(e+=n,v(e),e<i&&(i=e),e>r&&(r=e))}}let s=r-i,a=n?0:s>0?s*t.extentPadding:1;return y=t.normalize?[0,n?1:1+t.extentPadding]:[i<0?i-a:0,r+a],b(y)}}function Pi(e,t,i){let r=[],s=0;for(let n of e){let e=i(n),a=t(n);null==e||Number.isNaN(e)||null==a||!isFinite(a)||(s+=e,r.push(s))}return r}function Ri(e,t,i,r){if(e[0]!==1/0&&e[1]!==-1/0)return e;let s=i?.[0],n=i?.[1],a="number"==typeof s&&Number.isFinite(s),o="number"==typeof n&&Number.isFinite(n);return a||o?"log"===r&&a&&!o&&s>0?[s,10*s]:[a?s:o&&n>0?0:t[0],o?n:a&&s>0?0:t[1]]:t}function Ti(e,t,i){let r=e[0]<=e[1],s=r?e[0]:e[1],n=r?e[1]:e[0],a=s>0&&Number.isFinite(s),o=n>0&&Number.isFinite(n);if(a&&o)return e;let l=new Set;if(i)for(let e of i)null!=e&&e>0&&Number.isFinite(e)&&l.add(e);if(!t){if(o&&l.has(n)){let e=n/10;return r?[e,n]:[n,e]}return r?[1,10]:[10,1]}let c=a?s:t.min,u=o?n:t.max;return u>c||(o&&l.has(n)?c=u/10:u=10*c),r?[c,u]:[u,c]}function Di(e){let t=1/0,i=-1/0,r=!1;for(let s of e)if(Number.isFinite(s)){if(!(s>0)){r=!0;continue}s<t&&(t=s),s>i&&(i=s)}return{positive:Number.isFinite(t)?{min:t,max:i}:null,droppedNonPositive:r}}function Li(e,t,i){if("log"===e){let e=Ti(t,null);return e[0]===e[1]&&e[0]>0&&Number.isFinite(e[0])&&(e=[e[0],10*e[0]]),oi().domain(e).range(i).clamp(!0)}return"symlog"===e?li().domain(t).range(i):"time"===e||"utc"===e?("utc"===e?ci():ui()).domain([new Date(t[0]),new Date(t[1])]).range(i):hi().domain(t).range(i)}var Ei="_default";function $i(e,t){return e&&"object"==typeof e&&!Array.isArray(e)?bt(e,t):void 0}var Fi=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ni=["scene-style","data-paint","accessibility","evidence"],_i=(e,t)=>({retainedData:e,invalidations:t}),Ii=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],zi=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Bi=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Yi=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Oi=["scene-geometry","data-paint","accessibility","evidence"],Wi=["scene-style","data-paint","accessibility","evidence"],Vi=["overlay","accessibility","evidence"],ji=[],Xi={chartType:/*#__PURE__*/_i("rebuild",Ii),runtimeMode:/*#__PURE__*/_i("rebuild",Ii),xAccessor:/*#__PURE__*/_i("rebuild",Ii),yAccessor:/*#__PURE__*/_i("rebuild",Ii),timeAccessor:/*#__PURE__*/_i("rebuild",Ii),valueAccessor:/*#__PURE__*/_i("rebuild",Ii),y0Accessor:/*#__PURE__*/_i("rebuild",Ii),boundsAccessor:/*#__PURE__*/_i("rebuild",Ii),band:/*#__PURE__*/_i("rebuild",Ii),openAccessor:/*#__PURE__*/_i("rebuild",Ii),highAccessor:/*#__PURE__*/_i("rebuild",Ii),lowAccessor:/*#__PURE__*/_i("rebuild",Ii),closeAccessor:/*#__PURE__*/_i("rebuild",Ii),candlestickRangeMode:/*#__PURE__*/_i("rebuild",Ii),accessorRevision:/*#__PURE__*/_i("rebuild",Ii),groupAccessor:/*#__PURE__*/_i("rebuild",zi),categoryAccessor:/*#__PURE__*/_i("rebuild",zi),lineDataAccessor:/*#__PURE__*/_i("rebuild",zi),colorAccessor:/*#__PURE__*/_i("rebuild",Wi),sizeAccessor:/*#__PURE__*/_i("rebuild",Oi),symbolAccessor:/*#__PURE__*/_i("rebuild",Oi),pointIdAccessor:/*#__PURE__*/_i("rebuild",Oi),xScaleType:/*#__PURE__*/_i("preserve",Bi),yScaleType:/*#__PURE__*/_i("preserve",Bi),xExtent:/*#__PURE__*/_i("preserve",Bi),invertY:/*#__PURE__*/_i("preserve",Bi),yExtent:/*#__PURE__*/_i("preserve",Bi),extentPadding:/*#__PURE__*/_i("preserve",Bi),scalePadding:/*#__PURE__*/_i("preserve",Bi),axisExtent:/*#__PURE__*/_i("preserve",Bi),yAxisExtent:/*#__PURE__*/_i("preserve",Bi),binSize:/*#__PURE__*/_i("preserve",Bi),binAlign:/*#__PURE__*/_i("preserve",Bi),normalize:/*#__PURE__*/_i("preserve",Bi),heatmapAggregation:/*#__PURE__*/_i("preserve",Bi),heatmapXBins:/*#__PURE__*/_i("preserve",Bi),heatmapYBins:/*#__PURE__*/_i("preserve",Bi),arrowOfTime:/*#__PURE__*/_i("preserve",Yi),baseline:/*#__PURE__*/_i("preserve",Yi),stackOrder:/*#__PURE__*/_i("preserve",Yi),sizeRange:/*#__PURE__*/_i("preserve",Yi),curve:/*#__PURE__*/_i("preserve",Yi),areaGroups:/*#__PURE__*/_i("preserve",Yi),customLayout:/*#__PURE__*/_i("preserve",Yi),layoutConfig:/*#__PURE__*/_i("preserve",Yi),layoutMargin:/*#__PURE__*/_i("preserve",Yi),symbolMap:/*#__PURE__*/_i("preserve",Oi),showValues:/*#__PURE__*/_i("preserve",Oi),heatmapValueFormat:/*#__PURE__*/_i("preserve",Oi),trackHoverRows:/*#__PURE__*/_i("preserve",Oi),lineStyle:/*#__PURE__*/_i("preserve",Wi),pointStyle:/*#__PURE__*/_i("preserve",Wi),areaStyle:/*#__PURE__*/_i("preserve",Wi),barStyle:/*#__PURE__*/_i("preserve",Wi),swarmStyle:/*#__PURE__*/_i("preserve",Wi),waterfallStyle:/*#__PURE__*/_i("preserve",Wi),candlestickStyle:/*#__PURE__*/_i("preserve",Wi),boundsStyle:/*#__PURE__*/_i("preserve",Wi),gradientFill:/*#__PURE__*/_i("preserve",Wi),lineGradient:/*#__PURE__*/_i("preserve",Wi),semanticLineStops:/*#__PURE__*/_i("preserve",Wi),colorScheme:/*#__PURE__*/_i("preserve",Wi),themeCategorical:/*#__PURE__*/_i("preserve",Wi),themeSemantic:/*#__PURE__*/_i("preserve",Wi),themeSequential:/*#__PURE__*/_i("preserve",Wi),themeDiverging:/*#__PURE__*/_i("preserve",Wi),barColors:/*#__PURE__*/_i("preserve",Wi),decay:/*#__PURE__*/_i("preserve",Wi),pulse:/*#__PURE__*/_i("preserve",Wi),staleness:/*#__PURE__*/_i("preserve",Wi),layoutSelection:/*#__PURE__*/_i("preserve",Wi),annotations:/*#__PURE__*/_i("preserve",Vi),windowSize:/*#__PURE__*/_i("preserve",ji),windowMode:/*#__PURE__*/_i("preserve",ji),maxCapacity:/*#__PURE__*/_i("preserve",ji),clock:/*#__PURE__*/_i("preserve",ji),transition:/*#__PURE__*/_i("preserve",ji),introAnimation:/*#__PURE__*/_i("preserve",ji),onLayoutError:/*#__PURE__*/_i("preserve",ji)},Hi=/*#__PURE__*/_i("preserve",Yi),Gi=class{constructor(){this.tracker=new ke}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}},Fi)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},Ni):this.recordNoop("restyle")}recordConfig(e,t=!1){let i=function(e){let t="preserve",i=new Set;for(let r of e){let e=Object.prototype.hasOwnProperty.call(Xi,r)?Xi[r]:Hi;"rebuild"===e.retainedData&&(t="rebuild");for(let t of e.invalidations)i.add(t)}return{retainedData:t,invalidations:i}}(e);return this.tracker.record({kind:"config",keys:e},t?new Set([...i.invalidations,...Oi]):i.invalidations)}},Ui=class{constructor(){this.maxRadius=0,this.tree=null}get quadtree(){return this.tree}get maxPointRadius(){return this.maxRadius}clear(){this.tree=null,this.maxRadius=0}rebuild(e,t){if("scatter"!==e&&"bubble"!==e&&"custom"!==e)return void this.clear();let i=0,r=0;for(let e of t)"point"===e.type&&!1!==e.interactive&&(i++,e.r>r&&(r=e.r));if(this.maxRadius=r,i<=500)return void(this.tree=null);let s=new Array(i),n=0;for(let e of t)"point"===e.type&&!1!==e.interactive&&(s[n++]=e);this.tree=di().x(e=>e.x).y(e=>e.y).addAll(s)}},qi=class extends H{constructor(e){super(),this.xExtent=new p,this.yExtent=new p,this.growingCapacityWarned=!1,this.windowSizeWarned=!1,this.resolvedRibbons=[],this.timestampBuffer=null,this.activeTransition=null,this._hasRenderedOnce=!1,this.prevPositionMap=new Map,this.prevPathMap=new Map,this.exitNodes=[],this.lastIngestTime=0,this._colorMapCache=null,this._groupDataCache=null,this._groupColorMap=new Map,this._groupColorCounter=0,this._barCategoryCache=null,this._binBoundaries=[],this._stackExtentCache=null,this._ingestVersion=0,this._datumIndexCache=null,this._bufferArrayCache=null,this._bufferDirty=!0,this.needsFullRebuild=!0,this.lastLayout=null,this.updateResults=new Gi,this.scales=null,this.scene=[],this.version=0,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.xIsDate=!1,this.xTypeDetected=!1,this._warnedNonPositiveLogX=!1,this._warnedNonPositiveLogY=!1,this.spatialIndex=new Ui,this._lastBoundedInsertsRef=null,this.applyPulse=(e,t,i)=>!(!this.config.pulse||!this.timestampBuffer)&&M(this.config.pulse,e,t,this.timestampBuffer,this.getDatumIndexMap(t),i),this.config=e,this.buffer=new P(e.windowSize),this.growingCap=e.windowSize;let t=["bar","swarm","waterfall"].includes(e.chartType)||"streaming"===e.runtimeMode;if(this.resolveXAccessor(),this.getY=t?W(e.valueAccessor||e.yAccessor,"value"):W(e.yAccessor,"y"),this.getGroup=V(e.groupAccessor),this.getCategory=V(e.categoryAccessor),this.getSize=e.sizeAccessor?W(e.sizeAccessor,"size"):void 0,this.getColor=V(e.colorAccessor),this.getSymbol=V(e.symbolAccessor),this.getY0=e.y0Accessor?W(e.y0Accessor,"y0"):void 0,this.resolvedRibbons=Si(e),this.getPointId=V(e.pointIdAccessor),"candlestick"===e.chartType){let t=null!=e.openAccessor,i=null!=e.closeAccessor;this.getOpen=t?W(e.openAccessor,"open"):void 0,this.getHigh=W(e.highAccessor,"high"),this.getLow=W(e.lowAccessor,"low"),this.getClose=i?W(e.closeAccessor,"close"):void 0,this.config.candlestickRangeMode=!t&&!i}e.pulse&&(this.timestampBuffer=new P(e.windowSize))}currentTime(){return this.config.clock?.()??Gt()}resolveXAccessor(e=this.buffer){let t=["bar","swarm","waterfall"].includes(this.config.chartType)||"streaming"===this.config.runtimeMode,i=t&&this.config.timeAccessor||this.config.xAccessor,r=j(i,t?"time":"x");this.xIsDate=!1,this.xTypeDetected=!1;for(let t of e){let e=r(t);if(null==e||""===e)continue;let i=e instanceof Date&&Number.isFinite(e.getTime())||"string"==typeof e&&Number.isFinite(z(e));if(i||Number.isFinite(Number(e))){this.xIsDate=i,this.xTypeDetected=!0;break}}this.getX=this.xIsDate?e=>B(r(e)):e=>+r(e)}syncPulseTimestampBuffer(){this.config.pulse?null!=this.timestampBuffer&&this.timestampBuffer.capacity===this.buffer.capacity&&this.timestampBuffer.size===this.buffer.size||(this.timestampBuffer=R(this.buffer,this.currentTime())):this.timestampBuffer=null}pushDatumYExtent(e){if("candlestick"===this.config.chartType&&this.getHigh&&this.getLow)return this.yExtent.push(this.getHigh(e)),void this.yExtent.push(this.getLow(e));this.yExtent.push(this.getY(e)),this.getY0&&this.yExtent.push(this.getY0(e));for(let t of this.resolvedRibbons){let i=t.getTop(e),r=t.getBottom(e);Number.isFinite(i)&&this.yExtent.push(i),Number.isFinite(r)&&this.yExtent.push(r)}}evictDatumYExtent(e){if("candlestick"===this.config.chartType&&this.getHigh&&this.getLow)return this.yExtent.evict(this.getHigh(e)),void this.yExtent.evict(this.getLow(e));this.yExtent.evict(this.getY(e)),this.getY0&&this.yExtent.evict(this.getY0(e));for(let t of this.resolvedRibbons){let i=t.getTop(e),r=t.getBottom(e);Number.isFinite(i)&&this.yExtent.evict(i),Number.isFinite(r)&&this.yExtent.evict(r)}}rebuildYExtent(){this.yExtent.clear();for(let e of this.buffer)this.pushDatumYExtent(e)}rebuildExtents(){this.xExtent.clear(),this.yExtent.clear();for(let e of this.buffer)this.xExtent.push(this.getX(e)),this.pushDatumYExtent(e)}ingest(e){if(e.bounded&&this._lastBoundedInsertsRef===e.inserts)return this.updateResults.recordNoop("replace"),!1;let t=this.currentTime();if(this.lastIngestTime=t,this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,e.bounded){this._lastBoundedInsertsRef=e.inserts,this.buffer.clear(),this.xExtent.clear(),this.yExtent.clear(),this.timestampBuffer&&this.timestampBuffer.clear(),this.resolveXAccessor(e.inserts);let i=e.totalSize||e.inserts.length;T(this.buffer,i,this.timestampBuffer);for(let i of e.inserts)D(this.buffer,i,this.timestampBuffer,t),this.xExtent.push(this.getX(i)),this.pushDatumYExtent(i)}else{this.xTypeDetected||this.resolveXAccessor(e.inserts);for(let i of e.inserts){if("growing"===this.config.windowMode&&this.buffer.full){let e=this.config.maxCapacity??1e5;this.growingCap<e&&(this.growingCap=Math.min(2*this.growingCap,e),this.buffer.resize(this.growingCap),this.timestampBuffer&&this.timestampBuffer.resize(this.growingCap),"production"!==process.env.NODE_ENV&&!this.growingCapacityWarned&&this.growingCap>=5e4&&(this.growingCapacityWarned=!0,console.warn(`[Semiotic] Growing window buffer reached ${this.growingCap} points (cap ${e}). Large canvas scenes are expensive — prefer a sliding window, aggregation, or an explicit maxCapacity if this is intentional.`)))}let e=D(this.buffer,i,this.timestampBuffer,t);this.xExtent.push(this.getX(i)),this.pushDatumYExtent(i),null!=e&&(this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e))}}return this.updateResults.recordData(e.bounded?"replace":"ingest",e.inserts.length),!0}ingestWithResult(e){return this.ingest(e),this.updateResults.last}computeScene(e){let{config:r,buffer:s}=this,n=this.scales,a=this.lastLayout;if(!(e.width>0&&e.height>0&&Number.isFinite(e.width)&&Number.isFinite(e.height)))return void(this.needsFullRebuild=!0);if(!this.needsFullRebuild&&!r.customLayout&&!this.activeTransition&&"bar"!==r.chartType&&"waterfall"!==r.chartType&&"candlestick"!==r.chartType&&this.lastLayout&&this.lastLayout.width>0&&this.lastLayout.height>0&&this.scene.length>0&&this.scales&&(this.config.scalePadding??0)<=0&&(this.lastLayout.width!==e.width||this.lastLayout.height!==e.height))return this.scales=function(e,t,i,r){let s=r.width/i.width,n=r.height/i.height;for(let t of e)switch(t.type){case"line":for(let e of t.path)e[0]*=s,e[1]*=n;break;case"area":for(let e of t.topPath)e[0]*=s,e[1]*=n;for(let e of t.bottomPath)e[0]*=s,e[1]*=n;t.clipRect&&(t.clipRect={x:t.clipRect.x*s,y:t.clipRect.y*n,width:t.clipRect.width*s,height:t.clipRect.height*n}),t.strokeColorBands&&(t.strokeColorBands=t.strokeColorBands.map(e=>({...e,y:e.y*n,height:e.height*n})));break;case"point":case"symbol":case"glyph":t.x*=s,t.y*=n;break;case"rect":case"heatcell":t.x*=s,t.y*=n,t.w*=s,t.h*=n}return{x:t.x.copy().range(t.x.range().map(e=>e*s)),y:t.y.copy().range(t.y.range().map(e=>e*n))}}(this.scene,this.scales,this.lastLayout,e),this.lastLayout={width:e.width,height:e.height},this.spatialIndex.rebuild(r.chartType,this.scene),void this.version++;this.xExtent.dirty&&this.xExtent.recalculate(s,this.getX),this.yExtent.dirty&&this.rebuildYExtent();let o=this.getBufferArray(),l=this.xExtent.extent,c=this.yExtent.extent,u="waterfall"===r.chartType&&s.size>0?function(e,t,i,r,s){let n=Array.from(new Set(e.map(t).filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t);if(n.length<2)return Ci(i,r);let a=n[0],o=n[1],l=n[n.length-1],c=n[n.length-2];return Ci("log"===s&&a>0?[a/Math.sqrt(o/a),l*Math.sqrt(l/c)]:[a-(o-a)/2,l+(l-c)/2],r)}(o,this.getX,l,r.xExtent,r.xScaleType):Ci(l,r.xExtent);var h,d,f;"bar"===r.chartType&&r.binSize&&"center"===r.binAlign&&(h=l,d=r.binSize,f=r.xExtent,u=h.every(Number.isFinite)?Ci([i(h[0],d,"center"),i(h[1],d,"center")+d],f):Ci(h,f));let p=Ci(c,r.yExtent),g=!(!(m=r.yExtent)||null==m[0]||null==m[1]),y="exact"===(r.yAxisExtent??r.axisExtent);var m;if("stackedarea"===r.chartType&&!g&&s.size>0){let e=Mi({config:r,groups:this.groupData(o),getX:this.getX,getY:this.getY,bufferSize:s.size,ingestVersion:this._ingestVersion,stackExtentCache:this._stackExtentCache});p=e.yDomain,this._stackExtentCache=e.stackExtentCache}else"bar"===r.chartType&&r.binSize&&!g&&s.size>0?p=function(e,i,r,s,n,a,o,l="start"){let[c,u]=t(e,i,r,s,n,l);if(0===c&&0===u)return[0,0];let h=o?0:(u-c)*a;return[c<0?c-h:0,u+h]}(s,this.getX,this.getY,r.binSize,this.getCategory,r.extentPadding,y,r.binAlign):"waterfall"===r.chartType&&!g&&s.size>0?p=function(e,t,i,r,s){let n=0,a=0;for(let r of Pi(e,t,i))r<n&&(n=r),r>a&&(a=r);let o=a-n,l=s?0:o>0?o*r:1;return[Math.min(0,n-Math.abs(l)),Math.max(0,a+Math.abs(l))]}(s,this.getX,this.getY,r.extentPadding,y):!g&&p[0]!==1/0&&(p=function(e,t,i){if(!i.length)return e;let[r,s]=e;for(let e of t)for(let t of i){let i=t.getTop(e),n=t.getBottom(e);Number.isFinite(i)&&(i<r&&(r=i),i>s&&(s=i)),Number.isFinite(n)&&(n<r&&(r=n),n>s&&(s=n))}return[r,s]}(p,o,this.resolvedRibbons),p=function(e,t){let i=e[1]-e[0],r=t.exactMode?0:i>0?i*t.extentPadding:1,s=[null!=t.userMin?e[0]:e[0]-r,null!=t.userMax?e[1]:e[1]+r];if("log"===t.yScaleType&&s[0]<=0&&t.dataYDomain[0]>0&&!t.exactMode){let e=1+t.extentPadding;null==t.userMin&&(s[0]=t.dataYDomain[0]/e)}return s}(p,{exactMode:y,extentPadding:r.extentPadding,userMin:r.yExtent?.[0],userMax:r.yExtent?.[1],yScaleType:r.yScaleType,dataYDomain:c}));if(p=function(e,t,i){if(!t||i)return e;let r=t[0],s=t[1];return null==r&&null==s?e:[r??e[0],s??e[1]]}(p,r.yExtent,!!g),({xDomain:u,yDomain:p}=function(e,t,i,r){return{xDomain:Ri(e,"time"===i?[0,864e5]:[0,1],r?.x,i),yDomain:Ri(t,[0,1],r?.y,r?.yScaleType)}}(u,p,r.xScaleType,{x:r.xExtent,y:r.yExtent,yScaleType:r.yScaleType})),"log"===(r.xScaleType??(this.xIsDate?"utc":void 0))){let e=this.positiveAxisSamples(this.getX);u=Ti(u,e.positive,r.xExtent),this.warnDroppedLogSamples("x",e.droppedNonPositive)}if("log"===r.yScaleType){let e=Di(this.plottedAggregateY(s,o)||function(e){let t=[];if("candlestick"===e.chartType&&e.getHigh&&e.getLow){let i=e.getHigh,r=e.getLow,s=e.getOpen,n=e.getClose,a=null!=s&&null!=n;for(let o of e.data)t.push(i(o),r(o)),a&&t.push(s(o),n(o));return t}for(let i of e.data){t.push(e.getY(i)),e.getY0&&t.push(e.getY0(i));for(let r of e.ribbons){let e=r.getTop(i),s=r.getBottom(i);Number.isFinite(e)&&t.push(e),Number.isFinite(s)&&t.push(s)}}return t}({chartType:r.chartType,data:s,getY:this.getY,getY0:this.getY0,getHigh:this.getHigh,getLow:this.getLow,getOpen:this.getOpen,getClose:this.getClose,ribbons:this.resolvedRibbons}));p=Ti(p,e.positive,r.yExtent),this.warnDroppedLogSamples("y",e.droppedNonPositive)}this.scales=function(e){let{config:t,layout:i,xDomain:r}=e,s=t.xScaleType??(e.xIsDate?"utc":void 0),n=t.invertY?[e.yDomain[1],e.yDomain[0]]:e.yDomain,a="streaming"===t.runtimeMode,o=t.scalePadding||0,l=Math.max(0,Math.min(o,Math.min(i.width,i.height)/2-1));return a?{x:Li(s,r,"left"===t.arrowOfTime?[i.width-l,l]:[l,i.width-l]),y:Li(t.yScaleType,n,[i.height-l,l])}:{x:Li(s,r,[l,i.width-l]),y:Li(t.yScaleType,n,[i.height-l,l])}}({config:r,layout:e,xDomain:u,yDomain:p,xIsDate:this.xIsDate}),this._customLayoutFailedThisBuild=!1;let x=this.buildSceneNodes(e,o);if(this._customLayoutFailedThisBuild)return!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.scales=n,this.lastLayout=a):(this.scene=[],this.spatialIndex.rebuild(this.config.chartType,this.scene)),void(this.needsFullRebuild=!0);let v=this.config.transition?bi():null;v&&this.scene.length>0&&this.snapshotPositions(),this.scene=x,this.config.decay&&this.applyDecay(this.scene,o),this.config.pulse&&this.applyPulse(this.scene,o,this.currentTime()),this.config.transition&&!this._hasRenderedOnce&&this.scene.length>0&&(this.config.introAnimation&&v&&this.synthesizeIntroPositions(),this._hasRenderedOnce=!0),v&&(this.prevPositionMap.size>0||this.prevPathMap.size>0)&&this.startTransition(),this.spatialIndex.rebuild(this.config.chartType,this.scene),this.needsFullRebuild=!1,this.lastLayout={width:e.width,height:e.height},this.version++}get quadtree(){return this.spatialIndex.quadtree}get maxPointRadius(){return this.spatialIndex.maxPointRadius}buildSceneNodes(t,i){let{config:n,scales:a}=this;if(!a)return[];if(n.customLayout){let e=n.layoutMargin??{top:0,right:0,bottom:0,left:0},r={data:i,scales:a,dimensions:{width:t.width,height:t.height,margin:e,plot:{x:0,y:0,width:t.width,height:t.height}},theme:{semantic:n.themeSemantic??{},categorical:n.themeCategorical??At},resolveColor:(e,t)=>{let i=this.resolveGroupColor(e);if(i)return i;let r=this.resolveLineStyle(e,t);return r.stroke?r.stroke:"string"==typeof r.fill?r.fill:n.themeSemantic?.primary??"#4e79a7"},config:n.layoutConfig??{},selection:n.layoutSelection??null},s=G({family:"xy",logLabel:"customLayout",revision:this.version,hasPreviousResult:null!==this.lastCustomLayoutResult,onLayoutError:n.onLayoutError,run:()=>n.customLayout(r)});if("failure"===s.kind)return this.lastCustomLayoutFailure=s.diagnostic,this._customLayoutFailedThisBuild=!0,s.preservedLastGoodScene?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,[]);let o=s.result;this.customLayoutOverlays=o.overlays??null,this.lastCustomLayoutResult=o,this.lastCustomLayoutFailure=null;let l=o.nodes??[];if(this._customRestyle=o.restyle,this.hasCustomRestyle=!!o.restyle,this.hasCustomRestyle){this._baseStyles=new WeakMap;for(let e of l)e.style&&this._baseStyles.set(e,e.style);this.applyCustomRestyle(l,n.layoutSelection??null)}return U({label:"customLayout",nodes:l,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),l}if(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,0===i.length)return[];let o={scales:a,config:n,getX:this.getX,getY:this.getY,getY0:this.getY0,getSize:this.getSize,getColor:this.getColor,getSymbol:this.getSymbol,getGroup:this.getGroup,getCategory:this.getCategory,getPointId:this.getPointId,ribbons:this.resolvedRibbons,getOpen:this.getOpen,getHigh:this.getHigh,getLow:this.getLow,getClose:this.getClose,resolveLineStyle:(e,t)=>this.resolveLineStyle(e,t),resolveAreaStyle:(e,t)=>this.resolveAreaStyle(e,t),resolveBoundsStyle:(e,t)=>this.resolveBoundsStyle(e,t),resolveColorMap:e=>this.resolveColorMap(e),resolveGroupColor:e=>this.resolveGroupColor(e),groupData:e=>this.groupData(e),barCategoryCache:this._barCategoryCache},l=r(n.chartType);if(!l)return c=n.chartType,e(c)||be&&(Ai.has(c)||(Ai.add(c),console.warn(`[semiotic] StreamXYFrame: no XY plugin registered for "${c}" during SSR. Import a chart HOC, or call registerBuiltInXYPlugins() from "semiotic/xy" or "semiotic/realtime/core" before render.`))),[];var c;let u=s(l(o,i,t));return"bar"===n.chartType&&(this._barCategoryCache=o.barCategoryCache??null,this._binBoundaries=u.binBoundaries),u.nodes}resolveBoundsStyle(e,t){return function(e,t,i,r){let s=e.boundsStyle;if("function"==typeof s)return s(i||{},t);if(s&&"object"==typeof s)return s;let n=r(t,i);return{fill:n.stroke||e.themeSemantic?.primary||"#4e79a7",fillOpacity:.2,...null!=n.opacity&&{opacity:n.opacity},stroke:"none",cursor:n.cursor}}(this.config,e,t,(e,t)=>this.resolveLineStyle(e,t))}computeDecayOpacity(e,t){let i=this.config.decay;return!i||t<=1?1:q(i,e,t)}getDatumIndexMap(e){if(this._datumIndexCache&&this._datumIndexCache.version===this._ingestVersion)return this._datumIndexCache.map;let t=J(e);return this._datumIndexCache={version:this._ingestVersion,map:t},t}applyDecay(e,t){this.config.decay&&K(this.config.decay,e,t,this.getDatumIndexMap(t))}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(this.scene,this.getBufferArray(),e)}hasActivePulsesAt(e){return!!this.config.pulse&&L(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}get transitionContext(){return{runtimeMode:this.config.runtimeMode,getX:this.getX,getY:this.getY,getCategory:this.getCategory,getPointId:this.getPointId}}get hasRenderedOnce(){return this._hasRenderedOnce}snapshotPositions(){bi()?.snapshotPositions(this.transitionContext,this.scene,this.prevPositionMap,this.prevPathMap)}synthesizeIntroPositions(){this.prevPositionMap.clear(),this.prevPathMap.clear();let e=this.scales?.y(0)??0,t=bi();if(t)for(let i=0;i<this.scene.length;i++){let r=this.scene[i],s=t.getNodeIdentity(this.transitionContext,r,i);s&&("point"===r.type?this.prevPositionMap.set(s,{x:r.x,y:r.y,r:0,opacity:0}):"rect"===r.type?this.prevPositionMap.set(s,{x:r.x,y:e,w:r.w,h:0,opacity:r.style.opacity??1}):"heatcell"===r.type?this.prevPositionMap.set(s,{x:r.x,y:r.y,w:r.w,h:r.h,opacity:0}):"line"===r.type?(r._introClipFraction=0,this.prevPathMap.set(s,{path:r.path.map(e=>[e[0],e[1]]),pathIds:r.pathIds?.slice(),opacity:r.style.opacity})):"area"===r.type&&(r._introClipFraction=0,this.prevPathMap.set(s,{topPath:r.topPath.map(e=>[e[0],e[1]]),bottomPath:r.bottomPath.map(e=>[e[0],e[1]]),pathIds:r.pathIds?.slice(),opacity:r.style.opacity})))}}startTransition(){let e=bi();if(!this.config.transition||!e)return;let t=e.startTransition(this.transitionContext,this.config.transition,{scene:this.scene,exitNodes:this.exitNodes,activeTransition:this.activeTransition},this.prevPositionMap,this.prevPathMap,this.currentTime());this.scene=t.scene,this.exitNodes=t.exitNodes,this.activeTransition=t.activeTransition}advanceTransition(e){let t=bi();if(!this.activeTransition||!this.config.transition||!t)return!1;let i={scene:this.scene,exitNodes:this.exitNodes,activeTransition:this.activeTransition},r=t.advanceTransition(e,this.config.transition,i,this.prevPositionMap,this.prevPathMap);return this.scene=i.scene,this.exitNodes=i.exitNodes,this.activeTransition=i.activeTransition,r}cancelIntroAnimation(){this.prevPositionMap.clear(),this.prevPathMap.clear(),this.activeTransition=null,g(this.scene),this.exitNodes=[]}groupData(e){let{result:t,cache:i}=function(e,t,i,r){if(r&&r.version===i&&r.group===t&&r.data===e)return{result:r.result,cache:r};let s;if(t){let i=new Map;for(let r of e){let e=t(r);i.has(e)||i.set(e,[]),i.get(e).push(r)}s=Array.from(i.entries()).map(([e,t])=>({key:e,data:t}))}else s=[{key:Ei,data:e}];return{result:s,cache:{version:i,group:t,data:e,result:s}}}(e,this.getGroup,this._ingestVersion,this._groupDataCache);return this._groupDataCache=i,t}resolveColorMap(e){let{map:t,cache:i}=function(e,t,i,r,s){if(s&&s.version===r)return{map:s.map,cache:s};let n=new Set;if(t)for(let i of e){let e=t(i);e&&n.add(e)}let a=Array.from(n).sort(),o=a.join("\0");if(s&&s.key===o){let e={...s,version:r};return{map:e.map,cache:e}}let l=kt(i.colorScheme,i.themeCategorical,At),c=new Map;for(let e=0;e<a.length;e++)c.set(a[e],$i(i.colorScheme,a[e])??l[e%l.length]);return{map:c,cache:{key:o,map:c,version:r}}}(e,this.getColor,this.config,this._ingestVersion,this._colorMapCache);return this._colorMapCache=i,t}resolveLineStyle(e,t){return function(e,t,i,r){let s=e.lineStyle;if("function"==typeof s){let e=s(i||{},t);if(e&&!e.stroke&&t){let i=r(t);if(i)return{...e,stroke:i}}return e}let n=e.themeSemantic?.primary;return s&&"object"==typeof s?{stroke:s.stroke||n||"#007bff",strokeWidth:s.strokeWidth??2,strokeDasharray:s.strokeDasharray,fill:s.fill,fillOpacity:s.fillOpacity,opacity:s.opacity,cursor:s.cursor}:{stroke:r(t)||n||"#007bff",strokeWidth:2}}(this.config,e,t,e=>this.resolveGroupColor(e))}resolveAreaStyle(e,t){return function(e,t,i,r){if(e.areaStyle){let s=e.areaStyle(i||{});if(s&&!s.fill&&t){let e=r(t);if(e)return{...s,fill:e,stroke:s.stroke||e}}return s}let s=e.lineStyle;if("function"==typeof s){let e=s(i||{},t);if(e&&!e.fill&&t){let i=r(t);if(i)return{...e,fill:i,stroke:e.stroke||i}}return e}let n=e.themeSemantic?.primary;if(s&&"object"==typeof s)return{fill:s.fill||s.stroke||n||"#4e79a7",fillOpacity:s.fillOpacity??.7,stroke:s.stroke||n||"#4e79a7",strokeWidth:s.strokeWidth??2,cursor:s.cursor};let a=r(t)||n||"#4e79a7";return{fill:a,fillOpacity:.7,stroke:a,strokeWidth:2}}(this.config,e,t,e=>this.resolveGroupColor(e))}resolveGroupColor(e){let{color:t,groupColorCounter:i}=function(e){let{group:t,colorMapCache:i,groupColorMap:r,groupColorMapCap:s,config:n}=e,{groupColorCounter:a}=e,o=$i(n.colorScheme,t);if(o)return{color:o,groupColorCounter:a};if(i){let e=i.map.get(t);if(e)return{color:e,groupColorCounter:a}}let l=r.get(t);if(l)return{color:l,groupColorCounter:a};let c=kt(n.colorScheme,n.themeCategorical,At);if(0===c.length)return{color:null,groupColorCounter:a};let u=c[a%c.length];if(a++,r.set(t,u),r.size>s){let e=r.keys().next().value;void 0!==e&&r.delete(e)}return{color:u,groupColorCounter:a}}({group:e,colorMapCache:this._colorMapCache,groupColorMap:this._groupColorMap,groupColorCounter:this._groupColorCounter,groupColorMapCap:1e3,config:this.config});return this._groupColorCounter=i,t}getBufferArray(){return(this._bufferDirty||!this._bufferArrayCache)&&(this._bufferArrayCache=this.buffer.toArray(),this._bufferDirty=!1),this._bufferArrayCache}getData(){return this.getBufferArray()}remove(e){if(!this.getPointId)throw new Error("remove() requires pointIdAccessor to be configured");this.config.transition&&this.scene.length>0&&bi()&&this.snapshotPositions();let t=y(e),i=this.getPointId,r=e=>t.has(i(e));E(this.buffer,this.timestampBuffer,r);let s=this.buffer.remove(r);if(0===s.length)return this.updateResults.recordNoop("remove"),s;for(let e of s)this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e);return this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",s.length),s}update(e,t){if(!this.getPointId)throw new Error("update() requires pointIdAccessor to be configured");let i=y(e),r=this.getPointId,s=new Set;this.buffer.forEach((e,t)=>{i.has(r(e))&&s.add(t)});let n=this.buffer.update(e=>i.has(r(e)),t);if(0===n.length)return this.updateResults.recordNoop("update"),n;for(let e of n)this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e);return this.buffer.forEach((e,t)=>{s.has(t)&&(this.xExtent.push(this.getX(e)),this.pushDatumYExtent(e))}),this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",n.length),n}getBinBoundaries(){return this._binBoundaries}getExtents(){return this.xExtent.dirty&&this.xExtent.recalculate(this.buffer,this.getX),this.yExtent.dirty&&this.rebuildYExtent(),this.xExtent.min===1/0?null:{x:this.xExtent.extent,y:this.yExtent.extent}}positiveAxisSamples(e){let t=[];for(let i of this.buffer)t.push(e(i));return Di(t)}plottedAggregateY(e,t){let i=this.config;if("bar"===i.chartType&&i.binSize)return n(e,this.getX,this.getY,i.binSize,this.getCategory,i.binAlign,i.barColors?Object.keys(i.barColors):[]);if("stackedarea"===i.chartType&&e.size>0){let r=Mi({config:i,groups:this.groupData(t),getX:this.getX,getY:this.getY,bufferSize:e.size,ingestVersion:this._ingestVersion,stackExtentCache:this._stackExtentCache});return this._stackExtentCache=r.stackExtentCache,r.stackExtentCache.plottedY??null}return"waterfall"===i.chartType&&e.size>0?Pi(e,this.getX,this.getY):null}warnDroppedLogSamples(e,t){if(t){if("x"===e){if(this._warnedNonPositiveLogX)return;this._warnedNonPositiveLogX=!0}else{if(this._warnedNonPositiveLogY)return;this._warnedNonPositiveLogY=!0}console.warn(`Semiotic log ${e} scale clamped non-positive values to the positive domain edge.`)}}clear(){this.buffer.clear(),this.resolveXAccessor(),this.xExtent.clear(),this.yExtent.clear(),this._hasRenderedOnce=!1,this.timestampBuffer&&this.timestampBuffer.clear(),this.prevPositionMap.clear(),this.prevPathMap.clear(),this.exitNodes=[],this.activeTransition=null,this.lastIngestTime=0,this._lastBoundedInsertsRef=null,this.needsFullRebuild=!0,this._bufferDirty=!0,this._bufferArrayCache=null,this._datumIndexCache=null,this.lastLayout=null,this.scales=null,this.scene=[],this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.spatialIndex.clear(),this._colorMapCache=null,this._groupDataCache=null,this._groupColorMap=new Map,this._groupColorCounter=0,this._barCategoryCache=null,this._binBoundaries=[],this._stackExtentCache=null,this.version++,this.updateResults.recordData("clear")}get size(){return this.buffer.size}getBuffer(){return this.buffer}getXAccessor(){return this.getX}getYAccessor(){return this.getY}getCategoryAccessor(){return this.getCategory}applyCustomRestyle(e,t){let i=this._customRestyle;if(i)for(let r of e){let e=this._baseStyles.get(r)??r.style??{},s=i(r,t);r.style=s?{...e,...s}:e}}restyleScene(e){this._customRestyle?(this.applyCustomRestyle(this.scene,e),this.markStylePaintPending(),this.updateResults.recordRestyle(!0)):this.updateResults.recordRestyle(!1)}updateConfig(e){let t={...this.config},i=Object.keys(e).filter(i=>e[i]!==t[i]);"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||"themeCategorical"in e||"colorAccessor"in e)&&(this._colorMapCache=null,this._groupColorMap=new Map,this._groupColorCounter=0),("barColors"in e||"colorScheme"in e)&&(this._barCategoryCache=null),("normalize"in e||"extentPadding"in e||"xAccessor"in e||"yAccessor"in e||"timeAccessor"in e||"valueAccessor"in e||"boundsAccessor"in e||"band"in e||"y0Accessor"in e||"openAccessor"in e||"highAccessor"in e||"lowAccessor"in e||"closeAccessor"in e||"groupAccessor"in e||"categoryAccessor"in e||"chartType"in e||"runtimeMode"in e)&&(this._stackExtentCache=null);let r=!1,s=!1;Object.assign(this.config,e),"pulse"in e&&this.syncPulseTimestampBuffer();let n="chartType"in e&&e.chartType!==t.chartType||"runtimeMode"in e&&e.runtimeMode!==t.runtimeMode;if(n||"xAccessor"in e||"yAccessor"in e||"timeAccessor"in e||"valueAccessor"in e){let e=["bar","swarm","waterfall"].includes(this.config.chartType)||"streaming"===this.config.runtimeMode,i=e&&this.config.timeAccessor||this.config.xAccessor,a=e&&t.timeAccessor||t.xAccessor,o=e&&this.config.valueAccessor||this.config.yAccessor,l=e&&t.valueAccessor||t.yAccessor,c=n||!X(i,a),u=n||!X(o,l);(c||u)&&(c&&this.resolveXAccessor(),this.getY=e?W(this.config.valueAccessor||this.config.yAccessor,"value"):W(this.config.yAccessor,"y"),u&&this.resolvedRibbons.some(e=>"bounds"===e.kind)&&(this.resolvedRibbons=Si(this.config)),r=!0,s=!0)}if("groupAccessor"in e&&!X(e.groupAccessor,t.groupAccessor)&&(this.getGroup=null!=this.config.groupAccessor?V(this.config.groupAccessor):void 0,r=!0),"categoryAccessor"in e&&!X(e.categoryAccessor,t.categoryAccessor)&&(this.getCategory=null!=this.config.categoryAccessor?V(this.config.categoryAccessor):void 0,r=!0),"sizeAccessor"in e&&!X(e.sizeAccessor,t.sizeAccessor)&&(this.getSize=this.config.sizeAccessor?W(this.config.sizeAccessor,"size"):void 0,r=!0),"symbolAccessor"in e&&!X(e.symbolAccessor,t.symbolAccessor)&&(this.getSymbol=null!=this.config.symbolAccessor?V(this.config.symbolAccessor):void 0,r=!0),"colorAccessor"in e&&!X(e.colorAccessor,t.colorAccessor)&&(this.getColor=null!=this.config.colorAccessor?V(this.config.colorAccessor):void 0,r=!0),"y0Accessor"in e&&!X(e.y0Accessor,t.y0Accessor)&&(this.getY0=this.config.y0Accessor?W(this.config.y0Accessor,"y0"):void 0,r=!0,s=!0),("boundsAccessor"in e&&!X(e.boundsAccessor,t.boundsAccessor)||"band"in e&&e.band!==t.band||"boundsStyle"in e&&e.boundsStyle!==t.boundsStyle)&&(this.resolvedRibbons=Si(this.config),r=!0,s=!0),"pointIdAccessor"in e&&!X(e.pointIdAccessor,t.pointIdAccessor)&&(this.getPointId=null!=this.config.pointIdAccessor?V(this.config.pointIdAccessor):void 0,r=!0),"candlestick"===this.config.chartType&&(n||"openAccessor"in e&&!X(e.openAccessor,t.openAccessor)||"closeAccessor"in e&&!X(e.closeAccessor,t.closeAccessor)||"highAccessor"in e&&!X(e.highAccessor,t.highAccessor)||"lowAccessor"in e&&!X(e.lowAccessor,t.lowAccessor))){let e=null!=this.config.openAccessor,t=null!=this.config.closeAccessor;this.getOpen=e?W(this.config.openAccessor,"open"):void 0,this.getHigh=W(this.config.highAccessor,"high"),this.getLow=W(this.config.lowAccessor,"low"),this.getClose=t?W(this.config.closeAccessor,"close"):void 0,this.config.candlestickRangeMode=!e&&!t,r=!0,s=!0}if("accessorRevision"in e&&e.accessorRevision!==t.accessorRevision&&(this.resolveXAccessor(),r=!0,s=!0),!r){let i=Object.keys(e).filter(e=>!e.endsWith("Accessor")&&"timeAccessor"!==e&&"valueAccessor"!==e);for(let s of i)if(e[s]!==t[s]){r=!0;break}}r&&(s&&this.rebuildExtents(),this.needsFullRebuild=!0),this.updateResults.recordConfig(i,("bar"===this.config.chartType||"heatmap"===this.config.chartType)&&!this.config.trackHoverRows&&Yt(t.areaStyle)!==Yt(this.config.areaStyle))}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}},Ji=/*#__PURE__*/new WeakMap;function Ki(e,t){let i=wt(t);if(!i)return e;let r=Ji.get(e),s=r?.get(i);if(s)return s;let n=function(e,t,i=8){if(!t||e.length<2)return e.map(([e,t])=>[e,t]);let r=[],s=null,n={moveTo(e,t){s=[e,t],r.push([e,t])},lineTo(e,t){s=[e,t],r.push([e,t])},bezierCurveTo(e,t,n,a,o,l){if(!s)return s=[o,l],void r.push([o,l]);let[c,u]=s;for(let s=1;s<=i;s++){let h=s/i,d=1-h,f=d*d*d*c+3*d*d*h*e+3*d*h*h*n+h*h*h*o,p=d*d*d*u+3*d*d*h*t+3*d*h*h*a+h*h*h*l;r.push([f,p])}s=[o,l]},closePath(){},arc(){},rect(){},arcTo(){},quadraticCurveTo(e,t,i,n){s=[i,n],r.push([i,n])}};return fi().x(e=>e[0]).y(e=>e[1]).curve(t).context(n)(e),r}(e,i);return r||(r=new Map,Ji.set(e,r)),r.set(i,n),n}function Zi(e,t,i,r=30,s,n=0){let a=null;if(s){let e=Z(s,t,i,r,n);e&&!1!==e.node.interactive&&(a={node:e.node,datum:e.node.datum,x:e.node.x,y:e.node.y,distance:e.distance})}for(let n of e){let e=null;switch(n.type){case"point":if(!1===n.interactive||s)break;e=er(n,t,i,r);break;case"symbol":e=tr(n,t,i,r);break;case"glyph":e=ir(n,t,i,r);break;case"line":e=rr(n,t,i,r);break;case"rect":if(null==n.datum)break;e=sr(n,t,i);break;case"heatcell":e=nr(n,t,i);break;case"area":if(!1===n.interactive)break;e=or(n,t,i,r);break;case"candlestick":e=ar(n,t,i)}e&&(!a||e.distance<a.distance||0===e.distance&&0===a.distance&&"area"===n.type&&n._hitArea&&"area"===a.node.type&&a.node._hitArea)&&(a=e)}return a}function Qi(e,t,i){if(0===e.length)return null;let r=e[0][0],s=e[e.length-1][0];if(t<r||t>s)return null;let n=lr(e,t);if(n<0||Math.abs(e[n][0]-t)>i)return null;let a=n,o=n;n>0&&e[n][0]>=t?(a=n-1,o=n):n<e.length-1&&(a=n,o=n+1);let[l,c]=e[a],[u,h]=e[o];return u===l?c:c+Math.max(0,Math.min(1,(t-l)/(u-l)))*(h-c)}function er(e,t,i,r=30){let s=t-e.x,n=i-e.y,a=Math.sqrt(s*s+n*n);return a>Q(e.r,r)?null:{node:e,datum:e.datum,x:e.x,y:e.y,distance:a}}function tr(e,t,i,r=30){let s=t-e.x,n=i-e.y,a=Math.sqrt(s*s+n*n);return a>Q(Et(e.size),r)?null:{node:e,datum:e.datum,x:e.x,y:e.y,distance:a}}function ir(e,t,i,r=30){if(null==e.datum)return null;let s=$t(e.glyph,e.size),n=e.x+s.centerDx,a=e.y+s.centerDy,o=t-n,l=i-a,c=Math.sqrt(o*o+l*l);return c>Q(s.radius,r)?null:{node:e,datum:e.datum,x:n,y:a,distance:c}}function rr(e,t,i,r=30){if(0===e.path.length)return null;let s=lr(e.path,t);if(s<0)return null;let n,[a,o]=e.path[s];if(e.path.length>1){let r=1/0,a=Math.max(0,s-1),o=Math.min(e.path.length-2,s);for(let s=a;s<=o;s++){let[n,a]=e.path[s],[o,l]=e.path[s+1],c=ee(t,i,n,a,o,l);c<r&&(r=c)}n=r}else{let e=t-a,r=i-o;n=Math.sqrt(e*e+r*r)}let l=e.style,c=l.strokeWidth??l.lineWidth??1;return n>Math.max(5,c/2+2,r)?null:{node:e,datum:Array.isArray(e.datum)&&e.datum[s]?e.datum[s]:e.datum,x:a,y:o,distance:n}}function sr(e,t,i){let r=te(t,i,e);return r.hit?{node:e,datum:e.datum,x:r.cx,y:r.cy,distance:0}:null}function nr(e,t,i){let r=te(t,i,e);return r.hit?{node:e,datum:e.datum,x:r.cx,y:r.cy,distance:0}:null}function ar(e,t,i){let r=e.bodyWidth/2,s=Math.min(e.openY,e.closeY),n=Math.max(e.openY,e.closeY),a=Math.max(n-s,1);if(t>=e.x-r-3&&t<=e.x+r+3&&i>=e.highY-3&&i<=e.lowY+3){let r=s+a/2,n=t-e.x,o=i-r;return{node:e,datum:e.datum,x:e.x,y:r,distance:Math.sqrt(n*n+o*o)}}return null}function or(e,t,i,r){if(0===e.topPath.length||e.clipRect&&(t<e.clipRect.x||t>e.clipRect.x+e.clipRect.width||i<e.clipRect.y||i>e.clipRect.y+e.clipRect.height))return null;if(e._hitArea){let r=Qi(Ki(e.topPath,e.curve),t,1/0),s=Qi(Ki(e.bottomPath,e.curve),t,1/0);if(null!==r&&null!==s&&i>=Math.min(r,s)&&i<=Math.max(r,s)){let r=lr(e.topPath,t,e.bottomPath);return{node:e,datum:Array.isArray(e.datum)?e.datum[r]??e.datum:e.datum,x:t,y:i,distance:0}}}let s,n=Ki(e.topPath,e.curve),a=lr(n,t),o=lr(e.topPath,t);if(a<0||o<0)return null;if(n.length>1){let e=1/0,r=Math.max(0,a-1),o=Math.min(n.length-2,a);for(let s=r;s<=o;s++){let[r,a]=n[s],[o,l]=n[s+1];e=Math.min(e,ee(t,i,r,a,o,l))}s=e}else{let e=t-n[0][0],r=i-n[0][1];s=Math.sqrt(e*e+r*r)}if(s>r)return null;let[l,c]=e.topPath[o];return{node:e,datum:Array.isArray(e.datum)&&e.datum[o]?e.datum[o]:e.datum,x:l,y:c,distance:s}}function lr(e,t,i){if(0===e.length)return-1;let r=t=>i?(e[t][0]+i[t][0])/2:e[t][0],s=0,n=e.length-1;for(;s<n;){let e=s+n>>1;r(e)<t?s=e+1:n=e}if(s>0){let e=Math.abs(r(s)-t);if(Math.abs(r(s-1)-t)<=e)return s-1}return s}function cr(t,i,r,s){let{scene:n,scales:a}=i;if(0===n.length||!a)return t;let o=e(s.chartType)?.multiHover;if(o)return o(t,i,r,s);let l=function(e,t){let i=1/0,r=-1/0;for(let t of e){let e;if("line"===t.type){let i=t;i.path.length>=2&&(e=Ki(i.path,i.curve))}else if("area"===t.type){let i=t;!1!==i.interactive&&i.topPath.length>=2&&(e=Ki(i.topPath,i.curve))}if(!e||0===e.length)continue;let s=e[0][0],n=e[e.length-1][0];i=Math.min(i,s,n),r=Math.max(r,s,n)}return i>r?t:Math.min(r,Math.max(i,t))}(n,r),c=function(e,t,i=30){let r=[];for(let s of e)if("line"===s.type){let e=s;if(e.path.length<2)continue;let n=Qi(Ki(e.path,e.curve),t,i);if(null===n)continue;let a=lr(e.path,t),o=Array.isArray(e.datum)&&e.datum[a]?e.datum[a]:e.datum;r.push({node:s,datum:o,x:e.path[a][0],y:n,group:e.group,color:e.style.stroke})}else if("area"===s.type){let e=s;if(!1===e.interactive||e.topPath.length<2)continue;let n=Ki(e.topPath,e.curve),a=Ki(e.bottomPath,e.curve),o=Qi(n,t,i);if(null===o)continue;let l=Qi(a,t,i),c=lr(e.topPath,t),u=Array.isArray(e.datum)&&e.datum[c]?e.datum[c]:e.datum,h="string"==typeof e.style.stroke?e.style.stroke:"string"==typeof e.style.fill?e.style.fill:void 0;r.push({node:s,datum:u,x:e.topPath[c][0],y:o,y0:l??void 0,group:e.group,color:h})}return r}(n,l,s.maxXDistance);if(0===c.length)return t;let u,h=a.x?.invert,d="function"==typeof h?h(l):l;if(s.hasHit)u={...t,xValue:d,xPx:l};else{let e={xValue:d};"string"==typeof s.xAccessor&&(e[s.xAccessor]=d),u=mt(e,t.x,t.y,{xValue:d,xPx:l})}let f=a.y.invert;return u.allSeries=c.map(e=>{let t=f?f(e.y):e.y,r=null!=e.y0?f?f(e.y0):e.y0:void 0,n="stackedarea"===s.chartType&&null!=r?t-r:t;return{group:null==e.group||e.group===Ei?"":e.group,value:n,valuePx:e.y,color:e.color||s.fallbackColor,datum:_(e.datum,i.resolvedRibbons)}}),u}function ur(e,t,i="x",r="y"){let s="function"==typeof i?i:e=>e[i],n="function"==typeof r?r:e=>e[r],a="function"==typeof t.colorBy?t.colorBy:e=>e[t.colorBy],o=new Map;for(let i of e){let e=a(i)??(i.parentLine&&a(i.parentLine));if(null==e||""===String(e))continue;let r=String(e),n=o.get(r);(!n||("end"===t.position?Number(s(i))>Number(s(n)):Number(s(i))<Number(s(n))))&&o.set(r,i)}return[...o].map(([e,a])=>({type:"text",label:e,["string"==typeof i?i:"x"]:s(a),["string"==typeof r?r:"y"]:n(a),x:s(a),y:n(a),_directLabel:{id:e,position:t.position},color:t.color(e),fontSize:t.fontSize}))}function hr(e=[]){let t=e.filter(e=>e._directLabel);return t.length?` Series endpoints: ${t.map(e=>`${e.label}: x ${String(e.x)}, y ${String(e.y)}`).join("; ")}.`:""}var dr={status:"not-assessed",checked:0,unsupported:0,collisions:0,overflows:0,findings:[]};function fr(e,t,i){if("edges"===e){if(t)return"start";if(i)return"end"}return"middle"}function pr(e,t,i){if("edges"===e){if(t)return"hanging";if(i)return"auto"}return"middle"}function gr(e){if(0===e.length)return{min:null,max:null};let t=1/0,i=-1/0;for(let r of e)r.pixel<t&&(t=r.pixel),r.pixel>i&&(i=r.pixel);return{min:t,max:i}}function yr(e){if(e)return"object"==typeof e?e.strokeDasharray:"dashed"===e?"6,4":"dotted"===e?"2,4":e}function mr(e,t){return e&&"string"!=typeof e?{stroke:e.stroke??t.stroke,strokeWidth:e.strokeWidth??t.strokeWidth,...null!=e.strokeOpacity&&{strokeOpacity:e.strokeOpacity},...e.strokeDasharray&&{strokeDasharray:e.strokeDasharray}}:{...t,..."string"==typeof e&&{strokeDasharray:yr(e)}}}function xr(e,t,i){if("left"===e||"right"===e){let r="left"===e?i:0,s="left"===e?-1:1,n=Math.ceil(t/8),a=`M0,${r}`;for(let e=0;e<n;e++){let i=8*e+4,n=8*(e+1);a+=`L${Math.min(i,t)},${r+4*s}`,a+=`L${Math.min(n,t)},${r}`}return a}let r="bottom"===e?0:t,s="bottom"===e?1:-1,n=Math.ceil(i/8),a=`M${r},0`;for(let e=0;e<n;e++){let t=8*e+4,n=8*(e+1);a+=`L${r+4*s},${Math.min(t,i)}`,a+=`L${r},${Math.min(n,i)}`}return a}function vr({axes:e,xTicks:t,yTicks:i,width:r,height:s}){let{xAxis:n,yAxis:a}=Ae(e);return si("g",{className:"stream-grid",children:[n,a].map((e,n)=>{if(!1===e?.grid)return null;let a=0===n,o=mr(e?.gridStyle,{stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1});return(a?t:i).map((t,i)=>si("line",{x1:a?t.pixel:0,y1:a?0:t.pixel,x2:a?t.pixel:r,y2:a?s:t.pixel,...o,strokeDasharray:yr(e?.gridStyle)??o.strokeDasharray},`${n}-${i}`))})})}var br=null,kr=null;function Ar(e){br=e}function wr(e,t,i){let r="function"==typeof t?t:e=>e[t||"x"],s="function"==typeof i?i:e=>e[i||"y"],n=[],a=[];for(let t of e){let e=r(t),i=s(t);"number"==typeof e&&isFinite(e)&&n.push(e),"number"==typeof i&&isFinite(i)&&a.push(i)}return{xValues:n,yValues:a}}function Sr(e){let[t,i]=Ut.useState(()=>br);return Ut.useEffect(()=>{if(t)return;let e=!1;return(br?Promise.resolve(br):(kr||(kr=import("./c-XUJHKJQ6.min.js").then(e=>br=e.MarginalGraphics).catch(e=>{throw kr=null,e})),kr)).then(t=>{e||i(()=>t)}),()=>{e=!0}},[t]),t?si(t,{...e}):null}var Cr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Mr(e){let t=new Date(e instanceof Date?e.valueOf():e);return`${Cr[t.getUTCMonth()]} ${t.getUTCDate()}`}function Pr(e){let t=Math.abs(e[1]-e[0]);return t<864e5?e=>{let i=new Date(e instanceof Date?e.valueOf():e),r=`${String(i.getUTCHours()).padStart(2,"0")}:${String(i.getUTCMinutes()).padStart(2,"0")}`;return t<3e5&&(r+=`:${String(i.getUTCSeconds()).padStart(2,"0")}`),t<1e4&&(r+=`.${String(i.getUTCMilliseconds()).padStart(3,"0")}`),r}:t<3156e7?Mr:t<1578e8?e=>{let t=new Date(e instanceof Date?e.valueOf():e);return`${Cr[t.getUTCMonth()]} ${t.getUTCFullYear()}`}:e=>String(new Date(e instanceof Date?e.valueOf():e).getUTCFullYear())}function Rr(e){return e.dataValue??e.value}function Tr(e){return"string"==typeof e||"number"==typeof e?6.5*String(e).length:60}function Dr(e){let{scale:t,axis:i,size:r,horizontal:s=!1,axisExtent:n}=e,a=i?.extent??n,o=t.domain(),l=function(e){return e?.ticks??e?.tickCount??5}(i),c=Math.max(2,Math.floor(r/(s?70:30))),u="exact"===a?Math.max(2,l):Math.min(l,c),h=Ot(t),d=h&&i?.tickValues?i.tickValues.flatMap(e=>{let t=Wt(h,e);return null==t?[]:[{requested:e,index:t}]}):null,f=d?d.map(e=>e.requested):h?0===u?[]:h.map(e=>e.value):(i?.tickValues??m(t,u,a)).filter(e=>"string"!=typeof e),p=!d&&h?new Map(h.map(e=>[e.value,e.label])):null,g=e=>p?.get(Number(e))??e,y=f.map(e=>{let t=g(e);return t instanceof Date?t.valueOf():"number"==typeof t?t:Number(t)}),x=i?.tickFormat||e.format||(h?function(e){let t=e.map(e=>e.label);if(t.length>0&&t.every(e=>e instanceof Date)){let e=1/0,i=-1/0;for(let r=0;r<t.length;r++){let s=t[r].getTime();s<e&&(e=s),s>i&&(i=s)}let r=Pr([e,i]);return e=>e instanceof Date||"number"==typeof e&&Number.isFinite(e)?r(e):String(e)}if(t.every(e=>"number"==typeof e&&Number.isFinite(e))){let e=we(t);return t=>e("number"==typeof t?t:Number(t))}return e=>String(e)}(h):o[0]instanceof Date||f[0]instanceof Date?Pr([o[0].valueOf(),o[o.length-1].valueOf()]):we(y)),v=(e,t)=>{let i=g(e);return s?x(i,t,y):x(i)},b=f.flatMap((e,i)=>{let r;if(d)r=t(d[i].index);else{if("string"==typeof e)return[];r=t(e)}let s={value:e,pixel:r,label:v(e,i)};return h&&(s.dataValue=d?d[i].requested:h[i].label),[s]}),k=!d&&h?b.filter(e=>e.pixel>=0&&e.pixel<=r):b,A=22;if(s){let e=k.reduce((e,t)=>Math.max(e,Tr(t.label)),0);A=i?.autoRotate?Math.max(20,Math.min(e+8,55)):Math.max(55,e+8)}let w=s&&(i?.tickFormat||e.format)?e=>{let t=e.map(e=>{let t=g(e.value);return t instanceof Date?t.valueOf():Number(t)});return e.map((e,i)=>({...e,label:x(g(e.value),i,t)}))}:void 0,S=function(e,t){if(e.length<=2)return e;let i=[e[0]];for(let r=1;r<e.length-1;r++)Math.abs(e[r].pixel-i[i.length-1].pixel)>=t&&i.push(e[r]);let r=e[e.length-1];return Math.abs(r.pixel-i[i.length-1].pixel)>=t?i.push(r):i[i.length-1]=r,i}(k,A);if(w&&(S=w(S)),S.length>1&&(S=S.filter((e,t)=>0===t||!function(e,t){return!("string"!=typeof e&&"number"!=typeof e||"string"!=typeof t&&"number"!=typeof t||String(e)!==String(t))}(e.label,S[t-1].label))),i?.includeMax&&!h&&S.length>0&&"exact"!==a&&!i.tickValues){let e=o[o.length-1];if(null!=e){let i=t(e),r=Math.abs(i-S[S.length-1].pixel);if(r>1){let t=v(e,S.length);r<A&&S.length>1&&(S=S.slice(0,-1)),S=[...S,{value:e,pixel:i,label:t}]}}}return w?w(S):S}function Lr(e){let{width:t,height:i,totalWidth:r,totalHeight:s,margin:n,scales:a,showAxes:o,axes:l,showGrid:c,xFormat:u,yFormat:h,axisExtent:d}=e,f=ei(()=>{if(!a||!c)return[];let e=l?.find(e=>"bottom"===e.orient)??l?.find(e=>"top"===e.orient);return Dr({scale:a.x,axis:e,size:t,horizontal:!0,format:u,axisExtent:d})},[a,l,u,t,d,c]),p=ei(()=>{if(!a||!c)return[];let e=l?.find(e=>"left"===e.orient)??l?.find(e=>"right"===e.orient);return Dr({scale:a.y,axis:e,size:i,format:h,axisExtent:d})},[a,l,h,i,d,c]),g=c&&a,y=o&&a;if(!g&&!y)return null;let{xAxis:m,yAxis:x,xOrient:v,yOrient:b}=Ae(l),k="top"===v?0:i,A="right"===b?t:0,w=y&&!1!==m?.visible&&(!m||!1!==m.baseline),S=y&&!1!==x?.visible&&(!x||!1!==x.baseline),C=m?.jaggedBase||!1,M=x?.jaggedBase||!1,P=mr(m?.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),R=mr(x?.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1});return si("svg",{role:"presentation",width:r,height:s,style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:ni("g",{transform:`translate(${n.left},${n.top})`,children:[g&&si(vr,{axes:l,xTicks:f,yTicks:p,width:t,height:i}),w&&!C&&si("line",{x1:0,y1:k,x2:t,y2:k,...P}),y&&!1!==m?.visible&&C&&si("path",{d:xr(v,t,i),fill:"none",...P}),S&&!M&&si("line",{x1:A,y1:0,x2:A,y2:i,...R}),y&&!1!==x?.visible&&M&&si("path",{d:xr(b,t,i),fill:"none",...R})]})})}function Er(e){let{width:t,height:i,totalWidth:r,totalHeight:s,margin:n,scales:a,showAxes:o,axes:l,xLabel:c,yLabel:p,yLabelRight:g,xFormat:y,yFormat:m,axisExtent:x,showGrid:v,title:b,description:k,idPrefix:A,decorative:w=!1,directLabelDescriptionId:S,legend:C,legendHoverBehavior:M,legendClickBehavior:P,legendHighlightedCategory:R,legendIsolatedCategories:T,legendPosition:D="right",legendLayout:L,foregroundGraphics:E,marginalGraphics:$,xValues:F,yValues:N,annotations:_,onAnnotationActivate:I,onObservation:z,chartId:B,chartType:Y,autoPlaceAnnotations:O,svgAnnotationRules:W,annotationFrame:V,xAccessor:j,yAccessor:X,annotationData:H,pointNodes:G,curve:U,underlayRendered:q,canvasObscuresUnderlay:J=!0,linkedCrosshairName:K,linkedCrosshairSourceId:Z,children:Q}=e,ee=Se({onAnnotationActivate:I,onObservation:z,chartId:B,chartType:Y}),te=Ce({showAxes:o,xLabel:c,yLabel:p,yLabelRight:g,axes:l}),oe=Me(L,te.leftAxis),le=Me(L,te.rightAxis),ce=C&&"left"===D&&oe>0?oe:n.left,ue=C&&"right"===D&&le>0?le:n.right,he=ei(()=>{if(!o&&!v||!a)return[];let e=l?.find(e=>"bottom"===e.orient)??l?.find(e=>"top"===e.orient);return Dr({scale:a.x,axis:e,size:t,horizontal:!0,format:y,axisExtent:x})},[o,v,a,l,y,t,x]),de=ei(()=>!(!(l?.find(e=>"bottom"===e.orient)??l?.find(e=>"top"===e.orient))?.autoRotate||!function(e){for(let t=1;t<e.length;t++){let i=e[t-1],r=e[t];if(Math.abs(r.pixel-i.pixel)<(Tr(i.label)+Tr(r.label))/2+8)return!0}return!1}(he)),[l,he]),fe=ei(()=>{if(!o&&!v||!a)return[];let e=l?.find(e=>"left"===e.orient)??l?.find(e=>"right"===e.orient);return Dr({scale:a.y,axis:e,size:i,format:m,axisExtent:x})},[o,v,a,l,m,i,x]),pe=ei(()=>{if(!o||!a||!l?.some(e=>"left"===e.orient))return[];let e=l?.find(e=>"right"===e.orient);return e?Dr({scale:a.y,axis:e,size:i,format:m,axisExtent:x}):[]},[o,a,l,m,i,x]),ge=Kt(new Map),ye=Kt(_?.length??0),me=_?.length??0;ye.current!==me&&(ye.current=me,ge.current=new Map);let xe=Ft(e=>e.theme),ve=!!_?.some(e=>e._directLabel||e._directLabelRequest),be=function(e){let[t,i]=Zt();return Qt(()=>{if(!e)return;let t=!0,r=()=>{};return import("./c-3J55HZFJ.min.js").then(({browserLabelMeasurer:e})=>{if(!t)return;let s=()=>i(()=>e());s(),r=St(s)}),()=>{t=!1,r()}},[e]),e?t:void 0}(ve),ke=ei(()=>ve?function(e,t=[],i,r){return e.flatMap(e=>e._directLabelRequest?ur(t,e._directLabelRequest,i,r):[e])}(_||[],H,j,X):_,[ve,_,H,j,X]),we=ei(()=>function(e,t){let i=e.filter(e=>e._directLabel);if(!i.length)return{node:null};let r=i[0]._directLabel.position,s=t.measure??d,n=i.map(e=>({family:t.fontFamily||"sans-serif",version:t.fontVersion??0,weight:400,size:e.fontSize||11})),a=i.map((e,i)=>{let r=(e,t)=>{if(null==e||!t)return NaN;try{return t(Number(e))}catch{return NaN}};return{id:String(e._directLabel.id),anchor:{x:r(e.x,t.scales?.x),y:r(e.y,t.scales?.y)},measurement:s(String(e.label),n[i])}}),o=Math.max(0,(t.margin?.["end"===r?"right":"left"]??0)-10),l=u(a,{x:"end"===r?t.width+6:-o-6,y:0,width:o,height:t.height},r),c=l.dispositions.map((e,r)=>{if("omitted"===e.status)return null;let s=e.box,o=e.connector,c=i[r],u=ni("g",{"data-direct-label-id":e.id,children:[o&&si("line",{...o,stroke:c.color,strokeWidth:.75}),si("text",{x:s.x+(a[r].measurement.left??0),y:s.y+a[r].measurement.ascent,fontFamily:n[r].family,fontWeight:n[r].weight,fontSize:n[r].size,fill:c.color,textAnchor:"start",children:c.label})]},e.id),d=t.renderLabel?t.renderLabel({...c,dx:s.x+(a[r].measurement.left??0)-a[r].anchor.x,dy:s.y+a[r].measurement.ascent-a[r].anchor.y,fontFamily:n[r].family},r,u):u;if(!d){let t=l.evidence;t.rendered--,t.omitted++,t.omittedIds.length<20&&t.omittedIds.push(e.id),Math.abs(e.offset.y)>.01&&t.displaced--,t.displacedIds=t.displacedIds.filter(t=>t!==e.id);for(let i of["RENDER_FAILURE","LABEL_OMITTED"]){let r=t.findings.find(e=>e.code===i);r||(r={code:i,count:0,labelIds:[],remedy:h[i]},t.findings.push(r)),r.count++,r.labelIds.length<20&&r.labelIds.push(e.id)}}if(d!==u&&(l.evidence.status="incomplete",d)){let t=l.evidence.findings.find(e=>"UNSUPPORTED_GEOMETRY"===e.code);t||(t={code:"UNSUPPORTED_GEOMETRY",count:0,labelIds:[],remedy:h.UNSUPPORTED_GEOMETRY},l.evidence.findings.push(t)),t.count++,t.labelIds.length<20&&t.labelIds.push(e.id)}return d?si(Ut.Fragment,{children:d},e.id):null}),f=si("g",{role:"list","aria-label":"Series endpoints","data-direct-label-fallback":"accessible-series-list",children:i.map((e,t)=>si("g",{role:"listitem","aria-label":`${e.label}: x ${String(e.x)}, y ${String(e.y)}`,children:si("title",{children:`${e.label}: x ${String(e.x)}, y ${String(e.y)}`})},a[t].id))});return{evidence:l.evidence,node:ni("g",{className:"semiotic-direct-labels","data-label-layout":JSON.stringify(l.evidence),children:[c,f]},"direct-labels")}}(ke||[],{width:t,height:i,margin:n,scales:a,measure:be,fontFamily:xe.typography.fontFamily,...W?{renderLabel:(e,r,s)=>W(e,r,{width:t,height:i,scales:a?{...a,time:a.x,value:a.y}:null,frameType:"xy",xAccessor:j,yAccessor:X,data:H})??s}:{}}),[ke,t,i,n,a,be,xe,W,j,X,H]),Fe=ei(()=>{if(!_||0===_.length)return null;let e=ie(_).filter(e=>!e._directLabel&&!e._directLabelRequest),r=Pe("xy",ee,!0),s={scales:a?{x:a.x,y:a.y,time:a.x,value:a.y}:null,timeAxis:"x",xAccessor:j,yAccessor:X,width:t,height:i,data:H,frameType:"xy",pointNodes:G,curve:U,stickyPositionCache:ge.current},n=O?Re({annotations:e,context:s,..."object"==typeof O?O:{}}):e;return Te(n,r,W,s)},[_,O,W,t,i,j,X,H,a,G,U,ee]),Ne=De(K),{unlockCrosshair:_e,handlesEscape:Ie}=Le();Qt(()=>{if(Ie||!Ne?.locked||!K)return;let e=e=>{"Escape"===e.key&&_e(K)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[Ne?.locked,K,_e,Ie]);let ze=we.node||o||b||k||C||E||$||Fe&&Fe.length>0||v||Q||Ne,Be=ei(()=>({width:t,height:i,xTicks:he,yTicks:fe,yTicksRight:pe,labelMeasurer:be,axes:l}),[t,i,he,fe,pe,be,l]),Ye=function(e,t){let i=Kt(null),[r,s]=Zt(dr);return Qt(()=>{let t=i.current;if(!e||!t)return;let r=!0,n=()=>{};return import("./c-Q54EFOEN.min.js").then(({readAxisLabelAssessment:e})=>{if(!r)return;let i=()=>{let i=e(t);s(e=>JSON.stringify(e)===JSON.stringify(i)?e:i)};i(),n=St(i)}),()=>{r=!1,n()}},[e,t]),{ref:i,assessment:e?r:dr}}(ve&&!!be,Be),Oe=ti(),{titleId:We,descId:Ve,labelledBy:je}=re(A||B||Oe);return ze?ni("svg",{"data-semiotic-overlay":"",ref:Ye.ref,"data-axis-label-layout":ve?JSON.stringify(Ye.assessment):void 0,role:w?"presentation":"img","aria-labelledby":w?void 0:je,width:r,height:s,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[w&&S&&si("desc",{id:S,children:hr(ke)}),!w&&ni(ai,{children:[si("title",{id:We,children:se(b,"XY Chart")}),ni("desc",{id:Ve,children:[ne(b,k,{familyPhrase:"XY data visualization",fallback:"XY data visualization"}),hr(ke)]})]}),ni("g",{transform:`translate(${n.left},${n.top})`,children:[v&&a&&(!q||J)&&si(vr,{axes:l,xTicks:he,yTicks:fe,width:t,height:i}),o&&a&&(()=>{let{xAxis:e,yAxis:r,xOrient:s,yOrient:n,leftAxis:a}=Ae(l),o="top"===s?0:i,u="right"===n?t:0,h="top"===s?-1:1,d="right"===n?1:-1,f=!e||!1!==e.baseline,y=!r||!1!==r.baseline,m=e?.jaggedBase||!1,x=r?.jaggedBase||!1,v=e?.landmarkTicks,b=r?.landmarkTicks,k=mr(e?.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),A=mr(r?.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),w="var(--semiotic-text-secondary, var(--semiotic-text, #666))",S="var(--semiotic-text, #333)",C=de,M={fontSize:"var(--semiotic-tick-font-size, 12px)"},P={fontSize:"calc(var(--semiotic-tick-font-size, 12px) + 1px)"},R={fontSize:"var(--semiotic-axis-label-font-size, 12px)"},T=e?.tickAnchor,D=r?.tickAnchor,L=e?.label??c,E=r?.label??("right"===n?g??p:p),$="right"===n?t+ue-15:15-ce,F=gr(he),N=gr(fe);return ni("g",{className:"stream-axes",style:{fontFamily:"var(--semiotic-font-family, sans-serif)"},children:[!1!==e?.visible&&ni("g",{className:`semiotic-axis semiotic-axis-${s}`,"data-orient":s,children:[(!q||J)&&f&&!m&&si("line",{x1:0,y1:o,x2:t,y2:o,...k}),(!q||J)&&m&&si("path",{d:xr(s,t,i),fill:"none",...k}),he.map((e,t)=>{let i=!!v&&("function"==typeof v?v(Rr(e),t):ae(Rr(e),t>0?Rr(he[t-1]):void 0));return ni("g",{transform:`translate(${e.pixel},${o})`,children:[si("line",{y2:5*h,...k}),"string"==typeof e.label||"number"==typeof e.label?si("text",{y:h*(C?12:18),textAnchor:C?"end":fr(T,e.pixel===F.min,e.pixel===F.max),fontWeight:i?600:400,fill:w,fontSize:i?13:12,className:"semiotic-axis-tick",style:{userSelect:"none",...i?P:M},transform:C?"top"===s?"rotate(45)":"rotate(-45)":void 0,children:e.label}):si("foreignObject",{x:-30,y:"top"===s?-30:6,width:60,height:24,style:{overflow:"visible"},children:si("div",{style:{textAlign:"center",userSelect:"none",...M},children:e.label})})]},`xtick-${t}`)}),L&&si("text",{x:t/2,y:"top"===s?-(C?58:40):i+(C?58:40),textAnchor:"middle",fill:S,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...R},children:L})]}),!1!==r?.visible&&ni("g",{className:`semiotic-axis semiotic-axis-${n}`,"data-orient":n,children:[(!q||J)&&y&&!x&&si("line",{x1:u,y1:0,x2:u,y2:i,...A}),(!q||J)&&x&&si("path",{d:xr(n,t,i),fill:"none",...A}),fe.map((e,t)=>{let i=!!b&&("function"==typeof b?b(Rr(e),t):ae(Rr(e),t>0?Rr(fe[t-1]):void 0));return ni("g",{transform:`translate(${u},${e.pixel})`,children:[si("line",{x2:5*d,...A}),"string"==typeof e.label||"number"==typeof e.label?si("text",{x:8*d,textAnchor:"right"===n?"start":"end",dominantBaseline:pr(D,e.pixel===N.min,e.pixel===N.max),fontWeight:i?600:400,fill:w,fontSize:i?13:12,className:"semiotic-axis-tick",style:{userSelect:"none",...i?P:M},children:e.label}):si("foreignObject",{x:"right"===n?8:-68,y:-12,width:60,height:24,style:{overflow:"visible"},children:si("div",{style:{textAlign:"right"===n?"left":"right",userSelect:"none",...M},children:e.label})})]},`ytick-${t}`)}),E&&si("text",{x:$,y:i/2,textAnchor:"middle",fill:S,transform:`rotate(${"right"===n?90:-90}, ${$}, ${i/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...R},children:E})]}),(()=>{let e=l?.find(e=>"right"===e.orient);if(!a||!e||!1===e.visible||0===pe.length)return null;let r=!1!==e.baseline,s=e.landmarkTicks,n=e.label||g,o=e.tickAnchor,c=mr(e.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),u=gr(pe);return ni("g",{className:"semiotic-axis semiotic-axis-right","data-orient":"right",children:[r&&!e.jaggedBase&&si("line",{x1:t,y1:0,x2:t,y2:i,...c}),e.jaggedBase&&si("path",{d:xr("right",t,i),fill:"none",...c}),pe.map((e,i)=>{let r=!!s&&("function"==typeof s?s(Rr(e),i):ae(Rr(e),i>0?Rr(pe[i-1]):void 0));return ni("g",{transform:`translate(${t},${e.pixel})`,children:[si("line",{x2:5,...c}),"string"==typeof e.label||"number"==typeof e.label?si("text",{x:8,textAnchor:"start",dominantBaseline:pr(o,e.pixel===u.min,e.pixel===u.max),fontWeight:r?600:400,fill:w,fontSize:r?13:12,className:"semiotic-axis-tick",style:{userSelect:"none",...r?P:M},children:e.label}):si("foreignObject",{x:8,y:-12,width:60,height:24,style:{overflow:"visible"},children:si("div",{style:{textAlign:"left",userSelect:"none",...M},children:e.label})})]},`ytick-r-${i}`)}),n&&si("text",{x:t+ue-15,y:i/2,textAnchor:"middle",fill:S,transform:`rotate(90, ${t+ue-15}, ${i/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...R},children:n})]})})()]})})(),Fe,we.node,$&&a&&F&&N&&ni(ai,{children:[$.top&&si("g",{transform:"translate(0, 0)",children:si(Sr,{orient:"top",config:f($.top),values:F,scale:Vt(a.x),size:n.top,length:t})}),$.bottom&&si("g",{transform:`translate(0, ${i})`,children:si(Sr,{orient:"bottom",config:f($.bottom),values:F,scale:Vt(a.x),size:n.bottom,length:t})}),$.left&&si("g",{transform:"translate(0, 0)",children:si(Sr,{orient:"left",config:f($.left),values:N,scale:Vt(a.y),size:n.left,length:i})}),$.right&&si("g",{transform:`translate(${t}, 0)`,children:si(Sr,{orient:"right",config:f($.right),values:N,scale:Vt(a.y),size:n.right,length:i})})]}),E,Ne&&(Ne.locked||Ne.sourceId!==Z)&&a?.x&&(()=>{let e=jt(a.x,Ne.xValue);if(null==e||e<0||e>t)return null;let r=Ne.locked,s={x1:e,y1:0,x2:e,y2:i,strokeDasharray:r?"6,3":"4,4"};return ni("g",{pointerEvents:"none","aria-hidden":"true",children:[si("line",{...s,stroke:"var(--semiotic-surface, #fff)",strokeWidth:r?3.5:3}),si("line",{...s,"data-semiotic-crosshair":r?"locked":"hover",stroke:r?"var(--semiotic-text, #333)":"var(--semiotic-text-secondary, #666)",strokeWidth:r?1.5:1})]})})(),Q]}),si(Ee,{title:b,totalWidth:r,marginTop:n.top}),$e({legend:C,totalWidth:r,totalHeight:s,margin:n,legendPosition:D,title:b,legendLayout:L,axisChrome:te,legendHoverBehavior:M,legendClickBehavior:P,legendHighlightedCategory:R,legendIsolatedCategories:T})]}):null}function $r(e,t,i,r){if(!e||t.length<2)return null;let s=Fe(e.stops,r);return s?si("linearGradient",{id:i,gradientUnits:"userSpaceOnUse",x1:t[0][0],y1:0,x2:t[t.length-1][0],y2:0,children:s}):null}var Fr="var(--semiotic-primary, #6366f1)";function Nr(e){return"under"===e.layer&&("band"===e.type||"x-band"===e.type)}function _r(e,t,i,r){let s="band"===e.type,n=s?t.y:t.x;if("function"!=typeof n)return null;let a=s?e.y0:e.x0,o=s?e.y1:e.x1,l=Xt(n,a,0),c=Xt(n,o,1);if(null!=a&&null==l||null!=o&&null==c)return null;let u=l??0,h=c??(s?r:i);if(!Number.isFinite(u)||!Number.isFinite(h))return null;let d=s?r:i,f=Math.min(d,Math.max(0,Math.min(u,h))),p=Math.max(0,Math.min(d,Math.max(u,h))-f);return s?{x:0,y:f,width:i,height:p}:{x:f,y:0,width:p,height:r}}function Ir(e){return"band"===e.type?"vertical":"horizontal"}function zr(e){return(t,i,r,s)=>{let n=t.globalAlpha;for(let i of e){let e=_r(i,r,s.width,s.height);if(!e)continue;let a=i.fill??i.color,o="string"==typeof a&&a?a:Fr,l=Rt(i.gradient,Ir(i),o),c="horizontal"===l?.direction;t.globalAlpha=n*(i.opacity??1)*(i.fillOpacity??.1),t.fillStyle=l&&Tt(t,l,o,e.x,e.y,c?e.x+e.width:e.x,c?e.y:e.y+e.height)||Dt(t,a,Fr),t.fillRect(e.x,e.y,e.width,e.height)}t.globalAlpha=n}}function Br(e,t="under-band",i=Fr){return(r,s,n)=>e.map((e,r)=>{let a=_r(e,s,n.width,n.height);if(!a)return null;let o=We(e,`${t}-${r}`,Ir(e),i);return ni("g",{opacity:e.opacity,children:[o.def&&si("defs",{children:o.def}),si("rect",{...a,fill:o.fill,fillOpacity:e.fillOpacity??.1})]},`${t}-${r}`)})}var Yr={axisStroke:"#ccc",tickText:"#666",crosshair:"rgba(0, 0, 0, 0.25)",hoverFill:"rgba(255, 255, 255, 0.3)",hoverStroke:"rgba(0, 0, 0, 0.4)",pointRing:"white",primary:"#007bff",background:""};function Or(e,t){let i=e.trim();if(/^#[0-9a-f]{3}$/i.test(i)){let e=i[1],r=i[2],s=i[3];return`#${e}${e}${r}${r}${s}${s}${t}`}if(/^#[0-9a-f]{6}$/i.test(i))return`${i}${t}`;let r=i.match(/^rgb\s*\(\s*([^)]+?)\s*\)$/i);if(r){let e=parseInt(t,16)/255;return`rgba(${r[1]}, ${e.toFixed(3)})`}return i}function Wr(e){if(!e)return;let t=[];for(let i of e)if("point"===i.type)t.push(i);else if("symbol"===i.type)t.push({pointId:i.pointId,x:i.x,y:i.y,r:Et(i.size)});else if("glyph"===i.type){let e=$t(i.glyph,i.size);t.push({pointId:i.pointId,x:i.x+e.centerDx,y:i.y+e.centerDy,r:e.radius})}return t}function Vr(e){return null==e?"":"number"==typeof e?Number.isInteger(e)?String(e):e.toFixed(2):e instanceof Date?e.toLocaleString():String(e)}var jr=/*#__PURE__*/Nt(function({hover:e}){let t=e.data??{},i=t.__aggregateValue??t.y??t.value,r=t.x??t.time;if(void 0===i&&void 0===r){let e=je(t);if(null!=e.title||e.entries.length>0)return ni("div",{className:"semiotic-tooltip",style:_t,children:[null!=e.title&&si("div",{style:{fontWeight:600,marginBottom:e.entries.length?2:0},children:String(e.title)}),e.entries.map(e=>ni("div",{style:{opacity:.7,fontSize:11},children:[e.key,":"," ",si("span",{style:{fontWeight:600},children:Vr(e.value)})]},e.key))]})}return ni("div",{className:"semiotic-tooltip",style:_t,children:[si("div",{style:{fontWeight:600,marginBottom:2},children:Vr(i)}),si("div",{style:{opacity:.7,fontSize:11},children:Vr(r)})]})});function Xr({enabled:e,hoverPoint:t,tooltipContent:i,...r}){if(!e||!t)return null;let s=i?i(t):si(jr,{hover:t});return It(s)?si(Xe,{...r,contentOwnsChrome:zt(i),x:t.x,y:t.y,className:"stream-frame-tooltip",children:s}):null}function Hr(e,t){if(!t||0===e.length||!e.some(e=>null!=e&&"object"==typeof e&&Array.isArray(e[t])))return e;let i=[];for(let r of e){if(null==r||"object"!=typeof r)continue;let e=r[t];if(!Array.isArray(e))continue;let s=r.label??r.id??r.key;for(let t of e)null==t||"object"!=typeof t||i.push(null==s?t:{...t,_lineGroup:s})}return i}var Gr=O,Ur=Yr;function qr(e){if(e)return"x"===e.dimension?"pan-y":"y"===e.dimension?"pan-x":"none"}var Jr=/*#__PURE__*/Ge(/*#__PURE__*/ii(/*#__PURE__*/ri(function(t,i){let{chartType:r,runtimeMode:s,data:n,chunkThreshold:u,chunkSize:h,xAccessor:d,yAccessor:f,accessorRevision:p,colorAccessor:g,sizeAccessor:y,symbolAccessor:m,symbolMap:w,groupAccessor:M,lineDataAccessor:P,curve:R,normalize:T,baseline:D,stackOrder:L,binSize:E,binAlign:z,valueAccessor:B,arrowOfTime:O="right",windowMode:W,capacityMode:V,windowSize:j,capacity:X,timeAccessor:H,xExtent:G,yExtent:U,invertY:q,extentPadding:J=.1,scalePadding:K,sizeRange:Z,size:Q=[500,300],responsiveWidth:ee,responsiveHeight:te,margin:re,className:se,background:ne,maxDevicePixelRatio:ae,renderMode:ke,lineStyle:Ae,pointStyle:we,areaStyle:Se,barStyle:Ce,waterfallStyle:Me,swarmStyle:Pe,barColors:Re,colorScheme:Te,boundsAccessor:De,boundsStyle:Le,y0Accessor:Ee,band:$e,gradientFill:We,lineGradient:je,semanticLineStops:Xe,areaGroups:Ge,openAccessor:gt,highAccessor:yt,lowAccessor:bt,closeAccessor:kt,candlestickStyle:At,showAxes:Rt=!0,axes:Tt,xLabel:Dt,yLabel:Et,yLabelRight:$t,xFormat:Ft,yFormat:Nt,axisExtent:_t,tickFormatTime:It,tickFormatValue:zt,hoverAnnotation:Yt,tooltipContent:Wt,customHoverBehavior:Vt,customClickBehavior:jt,onObservation:Xt,annotationObservationCallback:Gt,chartId:ii,enableHover:ri,hoverRadius:ai=30,tooltipMode:oi,annotations:li,onAnnotationActivate:ci,autoPlaceAnnotations:ui,svgAnnotationRules:hi,showGrid:di,legend:gi,legendHoverBehavior:yi,legendClickBehavior:xi,legendHighlightedCategory:vi,legendIsolatedCategories:Ai,legendPosition:wi,legendLayout:Si,legendCategoryAccessor:Ci,onCategoriesChange:Mi,backgroundGraphics:Pi,foregroundGraphics:Ri,interactiveGraphics:Ti,interactiveGraphicsLabel:Di,canvasPreRenderers:Li,svgPreRenderers:Ei,title:$i,categoryAccessor:Fi,brush:Ni,onBrush:_i,decay:Ii,pulse:zi,transition:Bi,animate:Yi,staleness:Oi,frameScheduler:Wi,clock:Vi,random:ji,seed:Xi,paused:Hi=!1,suspendWhenHidden:Gi=!0,heatmapAggregation:Ui,heatmapXBins:Ji,heatmapYBins:Ki,showValues:Qi,heatmapValueFormat:er,heatmapColorScale:tr,onColorDomainChange:ir,marginalGraphics:rr,pointIdAccessor:sr,xScaleType:nr,yScaleType:ar,accessibleTable:or=!0,description:lr,summary:ur,linkedCrosshairName:hr,linkedCrosshairSourceId:dr,customLayout:fr,onLayoutError:pr,layoutConfig:gr,layoutSelection:yr}=t,{canvasPreRenderers:mr,svgPreRenderers:xr}=function(e,t,i){let r=`under-band-${Ut.useId().replace(/:/g,"")}`,s=Ve(Ut.useMemo(()=>Object.assign({},ie(e??[]).filter(Nr)),[e])),n=Ut.useMemo(()=>Object.values(s),[s]);return Ut.useMemo(()=>0===n.length?{canvasPreRenderers:t,svgPreRenderers:i}:{canvasPreRenderers:[zr(n),...t??[]],svgPreRenderers:[Br(n,r),...i??[]]},[n,t,i,r])}(li,Li,Ei),vr=W??V??"sliding",br=j??X??200,{customHoverBehavior:kr,customClickBehavior:Ar,hasClickBehavior:Sr}=$({customHoverBehavior:Vt,customClickBehavior:jt,onObservation:Xt,chartId:ii,chartType:"StreamXYFrame"}),Cr=ti().replace(/:/g,""),Mr=Kt(!1),Rr=Kt({w:-1,h:-1}),Tr=Kt(!1),Dr=Ue({sizeProp:Q,responsiveWidth:ee,responsiveHeight:te,userMargin:re,marginDefault:Gr,title:$i,legend:gi,legendPosition:wi,...x(t,gi),animate:Yi,transitionProp:Bi,frameScheduler:Wi,clock:Vi,random:ji,seed:Xi,paused:Hi,suspendWhenHidden:Gi,themeDirtyRef:Mr}),Fr=qe(),_r=Je(),{reducedMotionRef:Ir,responsiveRef:Vr,size:jr,currentTheme:Jr,transition:Kr,introEnabled:Zr,tableId:Qr,rafRef:es,renderFnRef:ts,scheduleRender:is,frameRuntime:rs}=Dr;Qt(()=>St(()=>{Mr.current=!0,is()}),[is]);let ss=Dr.margin;if(rr){let e={...Dr.margin};rr.top&&e.top<60&&(e.top=60),rr.bottom&&e.bottom<60&&(e.bottom=60),rr.left&&e.left<60&&(e.left=60),rr.right&&e.right<60&&(e.right=60),ss=e}let ns=Math.max(1,jr[0]-ss.left-ss.right),as=Math.max(1,jr[1]-ss.top-ss.bottom),os=(Tt?.find(e=>"left"===e.orient)??Tt?.find(e=>"right"===e.orient))?.extent??_t,ls=ei(()=>Ke(n),[n]),cs=Yt??ri,[us,hs]=Zt(0),ds=Kt(0),[fs,ps]=Zt(null),gs=oe(Ri,jr,ss,fs),ys=oe(Pi,jr,ss,fs),ms=Kt(null),xs=Kt(!1),vs=Kt(null),bs=Kt(void 0),[ks,As]=Zt(null),ws=Kt(Ur.primary),Ss=Kt(function(){let e=-1,t=Yr;return{resolve(i){if(!i)return Yr;let r=Lt();return r===e||(t=function(e){if(!e)return Yr;let t=getComputedStyle(e),i=t.getPropertyValue("--semiotic-border").trim(),r=t.getPropertyValue("--semiotic-text-secondary").trim(),s=t.getPropertyValue("--semiotic-bg").trim(),n=t.getPropertyValue("--semiotic-primary").trim(),a=r||t.getPropertyValue("--text-secondary").trim(),o=t.getPropertyValue("--text-primary").trim(),l=i||t.getPropertyValue("--surface-3").trim(),c=s||t.getPropertyValue("--surface-0").trim();return a||o||i||n?{axisStroke:l||Yr.axisStroke,tickText:a||Yr.tickText,crosshair:a?Or(a,"66"):Yr.crosshair,hoverFill:c?Or(c,"4D"):Yr.hoverFill,hoverStroke:a?Or(a,"99"):Yr.hoverStroke,pointRing:c||Yr.pointRing,primary:n||Yr.primary,background:c||Yr.background}:Yr}(i),e=r),t},invalidate(){e=-1}}}()),Cs=Kt(!1),Ms=Ze("StreamXYFrame"),[Ps,Rs]=Zt(!1),Ts="streaming"===s||["bar","swarm","waterfall"].includes(r),Ds=!!kr,Ls=ei(()=>({chartType:r,runtimeMode:Ts?"streaming":"bounded",windowSize:br,windowMode:vr,arrowOfTime:Ts?O:"right",extentPadding:J,scalePadding:K,axisExtent:_t,yAxisExtent:os,xAccessor:d,yAccessor:f,accessorRevision:p,timeAccessor:Ts?H:void 0,valueAccessor:B,colorAccessor:g,sizeAccessor:y,symbolAccessor:m,symbolMap:w,groupAccessor:M||(P?"_lineGroup":void 0),categoryAccessor:Fi,lineDataAccessor:P,xScaleType:nr,yScaleType:ar,xExtent:G,yExtent:U,invertY:q,sizeRange:Z,binSize:E,binAlign:z,normalize:T,baseline:D,stackOrder:L,boundsAccessor:De,boundsStyle:Le,y0Accessor:Ee,band:$e,gradientFill:C(We),areaGroups:Ge?new Set(Ge):void 0,lineGradient:S(je),semanticLineStops:Xe,openAccessor:gt,highAccessor:yt,lowAccessor:bt,closeAccessor:kt,candlestickStyle:At,lineStyle:Ae,trackHoverRows:Ds,pointStyle:we,areaStyle:Se,swarmStyle:Pe,waterfallStyle:Me,colorScheme:Te,barColors:Re,barStyle:Ce,annotations:li,decay:Ii,pulse:zi,transition:Kr,introAnimation:Zr,staleness:Oi,clock:rs.now,heatmapAggregation:Ui,heatmapXBins:Ji,heatmapYBins:Ki,showValues:Qi,heatmapValueFormat:er,heatmapColorScale:tr,pointIdAccessor:sr,curve:R,themeCategorical:Jr?.colors?.categorical,themeSemantic:Bt(Jr),themeSequential:Jr?.colors?.sequential,themeDiverging:Jr?.colors?.diverging,customLayout:fr,onLayoutError:pr,layoutConfig:gr,layoutMargin:ss}),[r,Ts,br,vr,O,J,K,_t,os,d,f,p,H,B,g,y,m,w,M,P,Fi,nr,ar,G,U,q,Z,E,z,T,D,L,De,Le,Ee,$e,We,Ge,je,Xe,gt,yt,bt,kt,At,Ae,Ds,we,Se,Pe,Me,Te,Re,Ce,li,Ii,zi,Kr,Zr,Oi,rs.now,Ui,Ji,Ki,Qi,er,tr,sr,R,Jr,fr,pr,gr,ss]),Es=Ve(Ls),$s=Kt(null);$s.current||($s.current=new qi(Es));let Fs=le($s,Ci,Mi,e=>e.getData()),Ns=Kt({onColorDomainChange:ir,chartType:r}),_s=Kt(void 0);Ns.current={onColorDomainChange:ir,chartType:r};let Is=qt(()=>{let{onColorDomainChange:e,chartType:t}=Ns.current;if(!e||"heatmap"!==t)return;let i=1/0,r=-1/0;for(let e of $s.current?.scene??[]){if("heatcell"!==e.type)continue;let t=Number(e.value??e.datum?.value);Number.isFinite(t)&&(t<i&&(i=t),t>r&&(r=t))}let s=Number.isFinite(i)&&Number.isFinite(r)?[i,r]:null,n=_s.current;null===n&&null===s||n&&s&&n[0]===s[0]&&n[1]===s[1]||(_s.current=s,e(s))},[]);(function(t,i,r,s,n){Qt(()=>{let o=i?"custom":t;return e(o)?.canvasRenderers.length||!i&&"custom"===o?void 0:I(i?()=>import("./c-VLWWXOM5.min.js").then(e=>{a(e.customXYPlugin)}):()=>import("./c-QUAEYF34.min.js").then(e=>{e.registerBuiltInXYPlugins()}),()=>{i?n.current?.markStylePaintPending():r.current=!0,s()},`StreamXYFrame painters for "${t}"`)},[t,i,r,s,n])})(r,fr,Mr,is,$s),ce($s,Es,Mr,is);let zs=function(e,t){let i=Kt(!1),r=Kt(!1);e||(r.current=!1),i.current=e&&!be&&!r.current&&!bi();let s=Kt(t);return s.current=t,Qt(()=>{if(!e||be||bi())return;let t=()=>{i.current=!1,s.current()};return I(ki,t,"XY transition engine",()=>{r.current=!0,t()})},[e]),i}(!!Kr,()=>{Mr.current=!0,is()});ue($s,yr,Mr,is);let Bs=Kt(null);Bs.current||(Bs.current=new v(e=>{let t=$s.current;t&&t.ingest(e)&&(Mr.current=!0,is())},{chunkThreshold:u,chunkSize:h})),Qt(()=>{Bs.current?.updateChunkOptions({chunkThreshold:u,chunkSize:h})},[u,h]),function(e,{storeRef:t,adapterRef:i,dirtyRef:r,scheduleRender:s,hoverRef:n,setHoverPoint:a}){let o=qt(e=>{i.current?.push(e)},[i]),l=qt(e=>{i.current?.pushMany(e)},[i]),c=qt(()=>{i.current?.clear(),t.current?.clear(),r.current=!0,s()},[i,t,r,s]);Jt(e,()=>({push:o,pushMany:l,remove:e=>{i.current?.flush();let o=t.current?.remove(e)??[];return o.length>0&&(n.current&&o.some(e=>e===n.current?.data)&&(n.current=null,a(null)),r.current=!0,s()),o},update:(e,n)=>{i.current?.flush();let a=t.current?.update(e,n)??[];return a.length>0&&(r.current=!0,s()),a},clear:c,getData:()=>(i.current?.flush(),t.current?.getData()??[]),getScales:()=>t.current?.scales??null,getExtents:()=>t.current?.getExtents()??null,getCustomLayout:()=>t.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>t.current?.lastCustomLayoutFailure??null}),[o,l,c,s,i,t,r,n,a])}(i,{storeRef:$s,adapterRef:Bs,dirtyRef:Mr,scheduleRender:is,hoverRef:ms,setHoverPoint:As}),Qt(()=>{n&&Bs.current?.setBoundedData(Hr(ls,P))},[n,ls,P]);let{marginalXValues:Ys,marginalYValues:Os,refreshMarginalValues:Ws}=function(e,t,i,r,s){let[n,a]=Zt([]),[o,l]=Zt([]),c=null!=t,u=c?[t.top,t.bottom,t.left,t.right].join("|"):"",h=qt((t=e.current?.getData()??[])=>{let i=wr(t,r,s);a(i.xValues),l(i.yValues)},[e,r,s]);return Qt(()=>{if(!c)return a([]),void l([]);h()},[i,c,u,h]),{marginalXValues:n,marginalYValues:o,refreshMarginalValues:h}}($s,rr,ls,d,f),{canvasRef:Vs,interactionCanvasRef:js,resolutionDirtyRef:Xs}=Qe(Dr,{storeRef:$s,dirtyRef:Mr,hydrated:Fr,wasHydratingFromSSR:_r,cleanup:()=>Bs.current?.clear(),maxDevicePixelRatio:ae,canvasPaintDependencies:[r,ns,as,Rt,ne,Pi,Ae,ke,mr,is]}),{hoverHandlerRef:Hs,hoverLeaveRef:Gs,onPointerMove:Us,onPointerLeave:qs,flushPointerMove:Js,pointerStateRef:Ks}=Dr;Hs.current=e=>{let t=Vs.current;if(!t)return;let i=t.getBoundingClientRect(),s=e.clientX-i.left-ss.left,n=e.clientY-i.top-ss.top;if(s<0||s>ns||n<0||n>as){if(et(t),!cs)return;return void(ms.current&&(ms.current=null,vs.current=null,As(null),kr?.(null),is()))}let a=$s.current;if(!a||0===a.scene.length)return void et(t);let o=xt(ai,e.pointerType),l=Zi(a.scene,s,n,o,a.quadtree,a.maxPointRadius);if(et(t,Oe(l?.node)),!cs)return;let c="multi"===oi,u=()=>{ms.current&&(ms.current=null,vs.current=null,As(null),kr&&kr(null),is())};if(!l&&!c)return void u();let h=c||!l?s:l.x,f=c||!l?n:l.y,p=l?.datum?_(l.datum,a.resolvedRibbons):{},g=a.scales?.x,y=g&&"function"==typeof g.invert?Ht(g,h):void 0,m="bar"===r?vt(p,y):y,x=mt(p,h,f,null!=m?{xValue:m,xPx:h}:void 0);c&&(x=cr(x,a,h,{chartType:r,xAccessor:d,fallbackColor:ws.current,maxXDistance:Math.max(o,ns),hasHit:!!l})),l||x.allSeries?.length?(ms.current=x,vs.current=l?.node??null,As(x),kr?.(x),is()):u()},Gs.current=()=>{et(Vs.current),ms.current&&(ms.current=null,vs.current=null,As(null),kr?.(null),is())},tt(Vs);let Zs=Kt(()=>{});Zs.current=e=>{if(it(e.target)||!Ar)return;Js();let t=Vs.current;if(!t)return;let i=t.getBoundingClientRect(),s=e.clientX-i.left-ss.left,n=e.clientY-i.top-ss.top;if(s<0||s>ns||n<0||n>as)return void Ar(null);let a=$s.current;if(!a||0===a.scene.length)return void Ar(null);let o=xt(ai,bs.current),l=Zi(a.scene,s,n,o,a.quadtree,a.maxPointRadius);if(!l)return void Ar(null);let c=l.datum||{},u=a.scales?.x,h=u&&"function"==typeof u.invert?Ht(u,l.x):void 0,d="bar"===r?vt(c,h):h;Ar(mt(c,l.x,l.y,null!=d?{xValue:d,xPx:l.x}:void 0),{type:"activate",inputType:rt(bs.current)})};let Qs=qt(e=>Zs.current(e),[]),{kbFocusIndexRef:en,focusedNavPointRef:tn,onKeyDown:rn,refreshKeyboardFocus:sn}=F({clearPointerHover:qs,storeRef:$s,hoverRef:ms,hoveredNodeRef:vs,setHoverPoint:As,customHoverBehavior:kr,customClickBehavior:Ar,scheduleRender:is,decorateHover:"multi"===oi||"bar"===r?(e,t)=>("bar"===r&&(e={...e,xValue:vt(e.data,t.scales?.x.invert?.(e.x)),xPx:e.x}),"multi"===oi?cr(e,t,e.x,{chartType:r,xAccessor:d,fallbackColor:ws.current,maxXDistance:ns,hasHit:!0}):e):void 0}),nn=qt(e=>{he(Ks,e,!!cs,xs.current,Vs.current)&&(bs.current=e.pointerType,en.current=-1,tn.current=null,Us(e))},[Vs,cs,tn,en,Us,Ks]),an=qt(e=>{he(Ks,e,!!cs,xs.current,Vs.current,"mouse")&&(bs.current="mouse",en.current=-1,tn.current=null,Us({clientX:e.clientX,clientY:e.clientY,pointerType:"mouse"}))},[Vs,cs,tn,en,Us,Ks]),on=qt(e=>{bs.current=e.pointerType},[]);ts.current=()=>{if(es.current=null,!rs.isActive)return;let e=Vs.current,t=js.current;if(!e||!t)return;let i=$s.current;if(!i||zs.current&&(!_r||-1!==Rr.current.w))return;let s=rs.now(),n=null!=i.activeTransition,a=i.advanceTransition(Ir.current?s+1e6:s),c=!Ir.current&&a,u=Rr.current.w!==ns||Rr.current.h!==as,h=Xs.current,d=Mr.current||n||u,f=n&&!a,p=i.consumeStylePaintPending(),g=!1,y=i.getLastUpdateResult(),m=Ms.current.beforeCompute(y,c);(Mr.current||u)&&(!c||u)&&(i.computeScene({width:ns,height:as}),sn(),Rr.current={w:ns,h:as},g=!0,Fs(),Is()),(g||p)&&(xs.current=st(i.scene),xs.current||et(e)),xs.current&&(n||g||p)&&function(e){let{canvas:t,pointer:i,store:r,margin:s,width:n,height:a}=e;He(t,i,i=>{let o=t.getBoundingClientRect(),l=i.clientX-o.left-s.left,c=i.clientY-o.top-s.top;if(l<0||l>n||c<0||c>a)return;let u=Zi(r.scene,l,c,xt(e.hoverRadius,i.pointerType),e.geometryMoved?null:r.quadtree,r.maxPointRadius);return Oe(u?.node)})}({canvas:e,pointer:Ks.current,store:i,margin:ss,width:ns,height:as,hoverRadius:ai,geometryMoved:n||g}),Ms.current.afterCompute(m,g,u);let x=N(i,s,g,Tr),v=nt(ae,jr),{resized:b}=at(e,jr,v);at(t,jr,v);let k=Ss.current.resolve(e);ws.current=k.primary;let A=i.lastIngestTime>0?s-i.lastIngestTime:0,w=de(Oi,A),S=Oi&&w.isStale;if(d||p||x.changed||h||b){let t=ot(e,jr,ss,v);if(t){t.clearRect(-ss.left,-ss.top,jr[0],jr[1]),Oi&&w.alpha<1&&(t.globalAlpha=w.alpha),t.save(),"function"==typeof t.rect&&(t.beginPath(),t.rect(0,0,ns,as),t.clip()),function(e,t,i,r,s){if(t&&r)for(let n of t)e.save(),n(e,i,r,s),e.restore()}(t,mr,i.scene,i.scales,{width:ns,height:as});let e=o(r,!!fr);fe({context:t,nodes:i.scene,renderMode:ke,pixelRatio:v,paintBuiltIn:r=>{if(e&&i.scales)for(let s of e)s(t,r,i.scales,{width:ns,height:as})}}),t.restore(),Oi&&w.alpha<1&&(t.globalAlpha=1)}}let C=!!(cs&&ms.current&&i.scales),M=!!(vs.current&&Array.isArray(Yt)&&Yt.some(e=>e&&"object"==typeof e&&"highlight"===e.type)),P=C||M;if(Y(P,Cs.current)){let e=ot(t,jr,ss,v);if(e){if(e.clearRect(-ss.left,-ss.top,jr[0],jr[1]),C&&ms.current){let t="object"==typeof cs?cs:{};!function(e,t,i,r,s,n,a){if(!1===s.crosshair)return;let o=t.allSeries,c=o&&o.length>0,u=t.xPx??t.x;e.save();let h="object"==typeof s.crosshair?s.crosshair:{};e.strokeStyle=h.stroke||a.crosshair;let d=h.strokeWidth??1;if(h.strokeDasharray?e.setLineDash(h.strokeDasharray.split(/[\s,]+/).map(Number)):e.setLineDash([4,4]),d>0&&(e.lineWidth=d,e.beginPath(),e.moveTo(c?u:t.x,0),e.lineTo(c?u:t.x,r),e.stroke(),c||(e.beginPath(),e.moveTo(0,t.y),e.lineTo(i,t.y),e.stroke())),e.restore(),c){e.lineWidth=2,e.strokeStyle=a.pointRing;for(let t of o)null!=t.valuePx&&(e.beginPath(),e.arc(u,t.valuePx,4,0,2*Math.PI),e.fillStyle=t.color||a.primary,e.fill(),e.stroke())}else{let i=s.pointColor||l(n)||a.primary;e.beginPath(),e.arc(t.x,t.y,4,0,2*Math.PI),e.fillStyle=i,e.fill(),e.strokeStyle=a.pointRing,e.lineWidth=2,e.stroke()}}(e,ms.current,ns,as,t,vs.current,k)}if(M&&vs.current&&Array.isArray(Yt)){let t=Yt.find(e=>e&&"object"==typeof e&&"highlight"===e.type);t&&function(e,t,i,r,s){if(!i)return;let n="group"in i?i.group:void 0;if(void 0!==n)for(let i of t){if("line"!==i.type||i.group!==n||i.path.length<2)continue;let t="function"==typeof r.style?i.datum?r.style(i.datum):{}:r.style||{};e.save(),e.beginPath(),e.moveTo(i.path[0][0],i.path[0][1]);for(let t=1;t<i.path.length;t++)e.lineTo(i.path[t][0],i.path[t][1]);e.strokeStyle=t.stroke||i.style.stroke||s.primary;let a=t.strokeWidth??(i.style.strokeWidth??2)+2;a<=0||(e.lineWidth=a,e.globalAlpha=t.opacity??1,e.stroke()),e.restore()}}(e,i.scene,vs.current,t,k)}}Cs.current=P}d&&e&&e.setAttribute("aria-label",lt(i.scene,r+" chart"));let R=Mr.current;Mr.current=R&&c&&!g,Xs.current=!1,R&&i.scales&&(fs!==i.scales&&ps(i.scales),rr&&Ws(i.getData())),(li&&li.length>0||fr)&&(g||n)&&(g||f||s-ds.current>=33)&&(hs(e=>e+1),ds.current=s),Oi?.showBadge&&Rs(!!S),(c||null!=i.activeTransition||x.pending)&&is()},pe(Oi,$s,Mr,is,rs.now,Ps,Rs);let ln=ei(()=>{if(!Ft&&!It&&$s.current?.xIsDate&&fs&&!Ot(fs.x))return Pr(fs.x.domain())},[Ft,It,fs]),cn=Ft||It||ln,un=tn.current,hn=si(ct,{active:en.current>=0,hoverPoint:ks,margin:ss,size:jr,shape:un?.shape,width:un?.w,height:un?.h}),dn=b(d,H,"__semiotic_resolvedX","__semiotic_resolvedTime"),fn=b(f,B,"__semiotic_resolvedY","__semiotic_resolvedValue"),pn=dn.key,gn=fn.key,yn=li&&li.length>0||!1,mn=k(dn,fn,yn),xn=li?.some(e=>e._directLabel||e._directLabelRequest)?`${Qr}-direct-labels`:void 0;if(be||!Fr&&_r){let e=$s.current;e&&n&&(e.ingest({inserts:Hr(ls,P),bounded:!0}),e.computeScene({width:ns,height:as}),e.cancelIntroAnimation());let t=e?.scene??[],i=e?.scales??null,s=oe(Ri,jr,ss,i),a=oe(Pi,jr,ss,i),o=ge({background:ne,hasBackgroundGraphics:!!Pi,themeBackground:Jr?.colors.background}),l=`${Cr}-plot-clip`,u=cn||(()=>{if(e?.xIsDate&&i&&!Ot(i.x))return Pr(i.x.domain())})(),h=lr||("string"==typeof $i?$i:"XY chart"),p=rr&&e?wr(e.getData(),d,f):{xValues:[],yValues:[]};return ni("div",{ref:Vr,className:"stream-xy-frame"+(se?` ${se}`:""),role:"group","aria-label":h,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:ee?"100%":jr[0],height:te?"100%":jr[1]},children:[si(ut,{accessibleTable:or,scene:t,chartType:r+" chart",tableId:Qr,chartTitle:"string"==typeof $i?$i:void 0}),si(ht,{summary:ur}),ni("div",{role:"img","aria-label":h,"aria-describedby":xn,children:[ni("svg",{role:"presentation",xmlns:"http://www.w3.org/2000/svg",width:jr[0],height:jr[1],style:{position:"absolute",left:0,top:0},children:[si("defs",{children:si("clipPath",{id:l,children:si("rect",{width:ns,height:as})})}),o&&si("rect",{x:0,y:0,width:jr[0],height:jr[1],fill:o}),si("g",{transform:`translate(${ss.left},${ss.top})`,children:a}),ni("g",{transform:`translate(${ss.left},${ss.top})`,clipPath:`url(#${l})`,children:[xr&&i&&xr.map((e,r)=>si(Ut.Fragment,{children:e(t,i,{width:ns,height:as})},`svgpre-${r}`)),t.map((e,t)=>ye({node:e,index:t,renderMode:ke,fallback:()=>function(e,t,i,r=30){let s=function(e,t,i,r=30){switch(e.type){case"line":{let r=e;if(0===r.path.length)return null;let s=wt(r.curve),n=s?fi().x(([e])=>e).y(([,e])=>e).curve(s)(r.path)??"":"M"+r.path.map(([e,t])=>`${e},${t}`).join("L"),a=Ye(`${i?`${i}-`:""}line-${t}-stroke-gradient`),o=Pt(r.style.stroke),l=o?null:$r(r.strokeGradient,r.path,a,r.style.stroke||"#4e79a7");return ni(Ut.Fragment,{children:[l&&si("defs",{children:l}),si("path",{d:n,fill:"none",stroke:l?`url(#${a})`:o?"none":r.style.stroke||"#4e79a7",strokeWidth:o?0:r.style.strokeWidth??2,strokeDasharray:r.style.strokeDasharray,opacity:r.style.opacity})]},`line-${t}`)}case"area":{let s=e;if(0===s.topPath.length)return null;let n=wt(s.curve),a=n&&s.topPath.length>=2&&s.bottomPath.length>=2?pi().x(([e])=>e).y0((e,t)=>s.bottomPath[t][1]).y1(([,e])=>e).curve(n)(s.topPath)??"":(()=>{let e=s.topPath.map(([e,t])=>`${e},${t}`).join("L"),t=[...s.bottomPath].reverse().map(([e,t])=>`${e},${t}`).join("L");return`M${e}L${t}Z`})(),o=`${i?`${i}-`:""}area-${t}-hatch`,l=Ct(s.style.fill)?Mt(s.style.fill,o):void 0,u=Ye(`${i?`${i}-`:""}area-${t}-gradient`),h=function(e,t){let i=e.fillGradient;if(!i||"object"!=typeof i)return null;let r=1/0,s=-1/0;if(e.fillGradientSpan)[r,s]=e.fillGradientSpan;else{for(let[,t]of e.topPath)r=Math.min(r,t);for(let[,t]of e.bottomPath)s=Math.max(s,t)}if(!Number.isFinite(r)||!Number.isFinite(s))return null;let n=Fe(i.stops,Ne(e.style.fill));return n?si("linearGradient",{id:t,gradientUnits:"userSpaceOnUse",x1:0,y1:r,x2:0,y2:s,children:n}):null}(s,u),d=h?`url(#${u})`:l?`url(#${o})`:Ne(s.style.fill),f=h?void 0:s.style.fillOpacity??.7,p=n?fi().x(([e])=>e).y(([,e])=>e).curve(n)(s.topPath)??"":"M"+s.topPath.map(([e,t])=>`${e},${t}`).join("L"),g=Oe(s),y=g&&r>=0?si("path",{d:p,fill:"none",stroke:"transparent",strokeWidth:Math.max(1,2*r),strokeLinecap:"round",pointerEvents:"stroke",style:{cursor:g},"data-semiotic-mark-cursor":g,"data-semiotic-cursor-hit-target":"area-top-path","aria-hidden":"true"},`area-${t}-cursor-target`):null,m=Ye(`${i?`${i}-`:""}area-${t}-stroke-gradient`),x=!(!s.colorThresholds?.length||!s.rawValues||s.rawValues.length!==s.topPath.length),v=!!s.strokeColorBands?.length,b=x||v?null:$r(s.strokeGradient,s.topPath,m,s.style.stroke||"#4e79a7"),k=s.style.strokeWidth??2,A=1/0,w=-1/0;for(let[e]of s.topPath)e<A&&(A=e),e>w&&(w=e);let S=v?s.strokeColorBands.map((e,r)=>Ye(`${i?`${i}-`:""}area-${t}-stroke-band-${r}`)):[],C=v?s.strokeColorBands.map((e,t)=>si("clipPath",{id:S[t],children:si("rect",{x:A-k,y:e.y,width:w-A+2*k,height:e.height})},S[t])):null,M=s.style.stroke&&"none"!==s.style.stroke?v?s.strokeColorBands.map((e,i)=>si("path",{d:p,fill:"none",stroke:e.color??Ne(s.style.stroke),strokeWidth:k,opacity:(s.style.opacity??1)*(e.opacity??1),clipPath:`url(#${S[i]})`},`area-${t}-stroke-band-${i}`)):x?c(s.topPath,s.rawValues,s.colorThresholds,Ne(s.style.stroke)).map((e,i)=>si("path",{d:"M"+e.path.map(([e,t])=>`${e},${t}`).join("L"),fill:"none",stroke:e.color,strokeWidth:k,opacity:s.style.opacity},`area-${t}-threshold-${i}`)):si("path",{d:p,fill:"none",stroke:b?`url(#${m})`:Ne(s.style.stroke),strokeWidth:k,opacity:s.style.opacity}):null;if(s.clipRect){let e=`${i?`${i}-`:""}area-clip-${t}`;return ni("g",{children:[ni("defs",{children:[h,!h&&l,b,C,si("clipPath",{id:e,children:si("rect",{x:s.clipRect.x,y:s.clipRect.y,width:s.clipRect.width,height:s.clipRect.height})})]}),ni("g",{clipPath:`url(#${e})`,children:[si("path",{d:a,fill:d,fillOpacity:f,opacity:s.style.opacity,stroke:"none"}),M,y]})]},`area-${t}`)}return ni(Ut.Fragment,{children:[(h||l||b||C)&&ni("defs",{children:[h,!h&&l,b,C]}),si("path",{d:a,fill:d,fillOpacity:f,opacity:s.style.opacity,stroke:"none"}),M,y]},`area-${t}`)}case"point":case"rect":return Ie(e,t,i);case"symbol":return Be(e,t);case"glyph":{let r=e;return ze(r,r.x,r.y,`${i??""}glyph-${r.pointId??t}`)}case"heatcell":{let i=e,r={x:i.x,y:i.y,width:i.w,height:i.h,fill:i.fill,stroke:i.style?.stroke,strokeWidth:i.style?.strokeWidth,...null!=i.style?.opacity&&{opacity:i.style.opacity}};if(i.showValues&&null!=i.value&&i.w>=20&&i.h>=20){let e=i.valueFormat?i.valueFormat(i.value):Number.isInteger(i.value)?String(i.value):Math.abs(i.value)>=100?i.value.toFixed(0):Math.abs(i.value)>=1?i.value.toFixed(1):i.value.toPrecision(3),[s,n,a]=function(e){if(e.startsWith("#")){let t=e.slice(1);if(3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6===t.length)return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}let t=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return t?[+t[1],+t[2],+t[3]]:[128,128,128]}(i.fill),o=.299*s+.587*n+.114*a>128?"#000":"#fff",l=Math.max(10,Math.min(16,.3*Math.min(i.w,i.h)));return ni("g",{children:[si("rect",{...r}),si("text",{className:"semiotic-heatmap-value",x:i.x+i.w/2,y:i.y+i.h/2,textAnchor:"middle",dominantBaseline:"middle",fill:o,fontSize:`${l}px`,fontFamily:"var(--semiotic-font-family, sans-serif)",children:e})]},`heatcell-${t}`)}return si("rect",{...r},`heatcell-${t}`)}case"candlestick":{let r=e,s=`${i?`${i}-`:""}candle-${t}-hatch`,n=Ct(r.style?.fill)?Mt(r.style.fill,s):void 0,a=n?`url(#${s})`:void 0,{fill:o,...l}=r.style??{};if(r.isRange){let e=r.dotRadius??Math.max(2,r.bodyWidth/2),i=a??r.wickColor;return ni(Ut.Fragment,{children:[n&&si("defs",{children:n}),ni("g",{style:l,children:[si("line",{x1:r.x,y1:r.highY,x2:r.x,y2:r.lowY,stroke:r.wickColor,strokeWidth:r.wickWidth,opacity:r.style?.opacity}),si("circle",{cx:r.x,cy:r.highY,r:e,fill:i,opacity:r.style?.opacity}),si("circle",{cx:r.x,cy:r.lowY,r:e,fill:i,opacity:r.style?.opacity})]})]},`candle-${t}`)}let c=Math.min(r.openY,r.closeY),u=Math.max(Math.abs(r.openY-r.closeY),1),h=r.isUp?r.upColor:r.downColor,d=a??h;return ni(Ut.Fragment,{children:[n&&si("defs",{children:n}),ni("g",{style:l,children:[si("line",{x1:r.x,y1:r.highY,x2:r.x,y2:r.lowY,stroke:r.wickColor,strokeWidth:r.wickWidth,opacity:r.style?.opacity}),si("rect",{x:r.x-r.bodyWidth/2,y:c,width:r.bodyWidth,height:u,fill:d,stroke:a?r.wickColor:h,strokeWidth:1,opacity:r.style?.opacity})]})]},`candle-${t}`)}default:return null}}(e,t,i,r);return"area"===e.type?s:_e(s,e,`xy-cursor-${t}`)}(e,t,Cr,ai)})).filter(Boolean)]})]}),si(Er,{decorative:!0,directLabelDescriptionId:xn,width:ns,height:as,totalWidth:jr[0],totalHeight:jr[1],margin:ss,scales:i,showAxes:Rt,axes:Tt,xLabel:Dt,yLabel:Et,yLabelRight:$t,xFormat:u,yFormat:Nt||zt,axisExtent:_t,showGrid:di,title:$i,description:lr,legend:gi,legendHoverBehavior:yi,legendClickBehavior:xi,legendHighlightedCategory:vi,legendIsolatedCategories:Ai,legendPosition:wi,legendLayout:Si,foregroundGraphics:me(s,ve($s.current?.customLayoutOverlays,yr??null)),marginalGraphics:rr,xValues:p.xValues,yValues:p.yValues,annotations:li,onAnnotationActivate:ci,onObservation:Gt??Xt,chartId:ii,chartType:"StreamXYFrame",autoPlaceAnnotations:ui,svgAnnotationRules:hi,annotationFrame:0,xAccessor:pn,yAccessor:gn,annotationData:mn($s.current?.getData()),pointNodes:Wr($s.current?.scene),curve:"string"==typeof R?R:void 0,linkedCrosshairName:hr,linkedCrosshairSourceId:dr})]})]})}return ni("div",{ref:Vr,className:"stream-xy-frame"+(se?` ${se}`:""),role:"group","aria-label":lr||("string"==typeof $i?$i:"XY chart"),tabIndex:0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:ee?"100%":jr[0],height:te?"100%":jr[1],overflow:"visible",touchAction:qr(Ni)},onKeyDown:rn,children:["production"!==process.env.NODE_ENV&&$s.current&&si(dt,{store:$s.current,diagnostics:Ms.current}),si(ut,{accessibleTable:or,sceneRevision:$s.current?.getUpdateSnapshot().revisions.accessibility,scene:$s.current?.scene??[],chartType:r+" chart",tableId:Qr,chartTitle:"string"==typeof $i?$i:void 0}),si(ht,{summary:ur}),si(ft,{active:en.current>=0,hoverPoint:ks}),ni("div",{role:"img","aria-label":lr||("string"==typeof $i?$i:"XY chart"),"aria-describedby":xn,style:{position:"relative",width:"100%",height:"100%"},onPointerMove:nn,onMouseMove:an,onPointerLeave:qs,onMouseLeave:qs,onPointerDown:cs||Sr?on:void 0,onClick:Sr?Qs:void 0,children:[si(pt,{size:jr,margin:ss,backdropFill:ge({background:ne,hasBackgroundGraphics:!!Pi,themeBackground:`var(--semiotic-bg, ${Jr.colors.background})`})??void 0,children:ys}),si(Lr,{width:ns,height:as,totalWidth:jr[0],totalHeight:jr[1],margin:ss,scales:fs,showAxes:Rt,axes:Tt,showGrid:di,xFormat:cn,yFormat:Nt||zt,axisExtent:_t}),si("canvas",{"aria-hidden":"true",ref:Vs,"aria-label":lt($s.current?.scene??[],r+" chart"),style:{position:"absolute",left:0,top:0,width:jr[0],height:jr[1]}}),si("canvas",{ref:js,style:{position:"absolute",left:0,top:0,width:jr[0],height:jr[1],pointerEvents:"none"}}),si(Er,{decorative:!0,directLabelDescriptionId:xn,width:ns,height:as,totalWidth:jr[0],totalHeight:jr[1],margin:ss,scales:fs,showAxes:Rt,axes:Tt,xLabel:Dt,yLabel:Et,yLabelRight:$t,xFormat:cn,yFormat:Nt||zt,axisExtent:_t,showGrid:di,title:$i,description:lr,legend:gi,legendHoverBehavior:yi,legendClickBehavior:xi,legendHighlightedCategory:vi,legendIsolatedCategories:Ai,legendPosition:wi,legendLayout:Si,foregroundGraphics:me(gs,ve($s.current?.customLayoutOverlays,yr??null)),marginalGraphics:rr,xValues:Ys,yValues:Os,annotations:li,onAnnotationActivate:ci,onObservation:Gt??Xt,chartId:ii,chartType:"StreamXYFrame",autoPlaceAnnotations:ui,svgAnnotationRules:hi,annotationFrame:us,xAccessor:pn,yAccessor:gn,annotationData:mn($s.current?.getData()),pointNodes:Wr($s.current?.scene),curve:"string"==typeof R?R:void 0,underlayRendered:!0,canvasObscuresUnderlay:!1,linkedCrosshairName:hr,linkedCrosshairSourceId:dr}),(Ni||_i)&&si(mi,{width:ns,height:as,totalWidth:jr[0],totalHeight:jr[1],margin:ss,dimension:Ni?.dimension??"xy",scales:fs,onBrush:_i??(()=>{}),binSize:E,snap:Ni?.snap,binBoundaries:Ni?.binBoundaries??("bar"===r?$s.current?.getBinBoundaries():void 0),snapDuring:Ni?.snapDuring,streaming:"streaming"===s}),Oi?.showBadge&&si(xe,{isStale:Ps,position:Oi.badgePosition,state:Oi.state,settling:Oi.settling}),hn,si(Xr,{enabled:!!cs,hoverPoint:ks,tooltipContent:Wt,containerWidth:ns,containerHeight:as,margin:ss})]}),si(A,{graphics:Ti,size:jr,margin:ss,scales:fs,label:Di})]})})),"StreamXYFrame"),Kr=Jr;function Zr({brush:e,onBrush:t,linkedBrush:i,xAccessor:r,yAccessor:s,defaultDimension:n="xy"}){let a=yt(i),o=!!e||!!a||!!t,l=a?.xField||("string"==typeof r?r:void 0),c=a?.yField||("string"==typeof s?s:void 0),u="y"!==n||a?.xField?l:void 0,h="x"!==n||a?.yField?c:void 0,d=gt({name:a?.name||"__unused_brush__",xField:u,yField:h}),f=a?"xyBrush"===d.brushInteraction.brush?"xy":"xBrush"===d.brushInteraction.brush?"x":"y":n,p=Kt(d.brushInteraction);p.current=d.brushInteraction;let g=qt(e=>{let i=p.current;if(!e)return a&&i.end(null),void t?.(null);a&&("xyBrush"===i.brush?i.end([[e.x[0],e.y[0]],[e.x[1],e.y[1]]]):"xBrush"===i.brush?i.end(e.x):i.end(e.y)),t?.(e)},[a,t]);return o?{brushStreamProps:{brush:{dimension:f},onBrush:g}}:{brushStreamProps:{}}}export{ur as a,Ar as b,Mr as c,Pr as d,jr as e,Kr as f,Zr as g};
@@ -1 +0,0 @@
1
- function e({isPushMode:e,colorBy:m,colorScheme:y,showLegend:h,legendPosition:p="right",trackCategoryDomain:b=!0,registerLinkedCategories:S=!0}){let[C,P]=c(0),A=r(null!=y),w=t(),v=o(),M=e&&!!m&&(b||v),j="function"==typeof m?f:m,k=d(()=>({lifecycle:{colorByDomainKey:j,isPushMode:e,shouldTrackCategoryDomain:M},categories:new Set,ordered:[]}),[j,e,M]),D=u(e=>{if(!m)return null;let r="function"==typeof m?m(e):e[m];return String(r)},[m]),L=u(e=>{if(!M)return;let r=!1;for(let t of e){if(!t||"object"!=typeof t)continue;let e=D(t);null!=e&&!k.categories.has(e)&&(k.categories.add(e),k.ordered.push(e),r=!0)}r&&P(e=>e+1)},[k,D,M]),B=u(e=>{if(!M)return;let r=Array.from(new Set(e.map(String))),t=k.ordered;t.length===r.length&&t.every((e,t)=>e===r[t])||(k.categories=new Set(r),k.ordered=r,P(e=>e+1))},[k,M]),_=u(e=>r=>{L([r]),e(r)},[L]),x=u(e=>r=>{L(r),e(r)},[L]),G=u(()=>{k.categories=new Set,k.ordered=[],P(e=>e+1)},[k]),K=d(()=>M?[...k.ordered]:[],[k,M,C]);a(S&&e&&m?K:[]);let T=d(()=>{if(!e||!m||!1===h)return;let r=k.ordered;if(0===r.length)return;let t=Array.isArray(y)&&y.length>0||"string"==typeof y&&y.length>0?y:w&&w.length>0?w:i,o="string"==typeof m?m:"__streamCat",a=r.map(e=>({[o]:e})),c=s(a,o,t),d=y&&"object"==typeof y&&!Array.isArray(y)?y:void 0;return n({data:a,colorBy:o,colorScale:e=>(A?g(A,e):void 0)??(d?g(d,e):void 0)??c(e)??"#999",getColor:l})},[e,m,h,y,A,w,C,k]),U=d(()=>{if(T)return"right"===p?{right:110}:"left"===p?{left:110}:"top"===p?{top:50}:"bottom"===p?{bottom:80}:{right:110}},[T,p]);return{wrapPush:_,wrapPushMany:x,resetCategories:G,categories:K,categoryDomainProps:M?{legendCategoryAccessor:m,onCategoriesChange:B}:{},streamingLegend:T,streamingMarginAdjust:U}}import{bc as r,bA as t,bt as o,bs as a,bv as n}from"./c-SU6Z75M2.min.js";import{p as i,t as s,r as l,s as g}from"./c-WPL6PGP3.min.js";import{useState as c,useMemo as d,useCallback as u}from"react";var f=/*#__PURE__*/Symbol("streaming-function-color-domain");export{e as a};