semiotic 3.12.0 → 3.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/README.md +50 -46
  2. package/ai/artifact-surface-inventory.json +1 -1
  3. package/ai/behaviorContracts.cjs +1 -1
  4. package/ai/dist/diagnose-operation.js +3 -3
  5. package/ai/dist/mcp-server.js +1 -1
  6. package/ai/reference.md +15 -3
  7. package/ai/schema.json +908 -96
  8. package/ai/surface-manifest.json +1 -1
  9. package/ai/task-packets/compare-category-totals.json +5 -5
  10. package/ai/task-packets/compare-category-totals.md +2 -2
  11. package/ai/task-packets/correct-published-chart.json +5 -5
  12. package/ai/task-packets/correct-published-chart.md +2 -2
  13. package/ai/task-packets/index.json +6 -6
  14. package/ai/task-packets/update-live-chart.json +5 -5
  15. package/ai/task-packets/update-live-chart.md +2 -2
  16. package/dist/c-27DCB5T6.min.js +7 -7
  17. package/dist/c-2CKIGFD2.min.js +1 -1
  18. package/dist/c-3FATLOH4.min.js +1 -0
  19. package/dist/{c-STVM6CBI.min.js → c-4SCJKAWZ.min.js} +200 -200
  20. package/dist/c-5FUOKMH6.min.js +7 -0
  21. package/dist/c-AAIPWVQ5.min.js +6 -6
  22. package/dist/{c-2RG4WOVX.min.js → c-ALLF3Y77.min.js} +1 -1
  23. package/dist/{c-QMKQVCCZ.min.js → c-C5GXUHUO.min.js} +6 -6
  24. package/dist/c-C67QDKTU.min.js +34 -0
  25. package/dist/c-F76M77YC.min.js +1 -0
  26. package/dist/c-FEVXPKQH.min.js +1 -1
  27. package/dist/c-G42WVQO2.min.js +1 -0
  28. package/dist/c-G5A3YWTN.min.js +66 -0
  29. package/dist/c-H4HVKBU3.min.js +1 -0
  30. package/dist/c-HU3ASFKT.min.js +1 -0
  31. package/dist/c-I4FYCVJB.min.js +391 -0
  32. package/dist/{c-5L7JGWQW.min.js → c-IATPZOL7.min.js} +28 -28
  33. package/dist/c-IE5EBBP6.min.js +110 -0
  34. package/dist/c-IGONIKZL.min.js +1 -0
  35. package/dist/c-IKPM53JH.min.js +1 -0
  36. package/dist/c-IU4QZ7Y5.min.js +1 -1
  37. package/dist/{c-2ACLVPKF.min.js → c-K5VE57OI.min.js} +1 -1
  38. package/dist/c-KWJIBJ4R.min.js +1 -0
  39. package/dist/c-LIMFU6RD.min.js +1 -0
  40. package/dist/c-M4T43G76.min.js +1 -0
  41. package/dist/c-M7QUZZCE.min.js +1 -1
  42. package/dist/c-NVSINXE5.min.js +1 -0
  43. package/dist/{c-FAF6EV4E.min.js → c-NWRYV6ZF.min.js} +1 -1
  44. package/dist/c-O5GU2R5W.min.js +1 -0
  45. package/dist/c-OC7GNXGZ.min.js +1 -0
  46. package/dist/c-OV5F3DQP.min.js +1 -0
  47. package/dist/{c-5TAXHW7I.min.js → c-PJ5CAYAW.min.js} +1 -1
  48. package/dist/c-Q5LZRQGD.min.js +1 -0
  49. package/dist/c-QP3PXK3N.min.js +1 -0
  50. package/dist/c-SGZ7ZD2I.min.js +51 -0
  51. package/dist/c-SSKV5JPW.min.js +1 -1
  52. package/dist/c-THWTHWXU.min.js +37 -0
  53. package/dist/c-TRMNDRC4.min.js +41 -0
  54. package/dist/c-UP656CST.min.js +1 -1
  55. package/dist/c-USYOK5OX.min.js +1 -0
  56. package/dist/c-VI753KBO.min.js +1 -0
  57. package/dist/{c-TT4CTEBR.min.js → c-VLAAAFST.min.js} +1 -1
  58. package/dist/c-VSOQPII4.min.js +5 -5
  59. package/dist/c-WGDM4ZRP.min.js +26 -0
  60. package/dist/c-XCV7VUU3.min.js +87 -0
  61. package/dist/c-XGDZPYBI.min.js +1 -0
  62. package/dist/c-XI6CLZII.min.js +1 -0
  63. package/dist/{c-L4Q2YMXO.min.js → c-XLC7PKM7.min.js} +1 -1
  64. package/dist/{c-3YAGKCPU.min.js → c-YEB6Z35F.min.js} +1 -1
  65. package/dist/c-YWZBFG63.min.js +1 -0
  66. package/dist/c-ZMYO3NZU.min.js +2 -0
  67. package/dist/c-ZO36H5VH.min.js +48 -0
  68. package/dist/components/LinkedCharts.d.ts +6 -1
  69. package/dist/components/Tooltip/Tooltip.d.ts +11 -1
  70. package/dist/components/Tooltip/tooltipChrome.d.ts +8 -2
  71. package/dist/components/bundling/semioticVite.d.ts +24 -0
  72. package/dist/components/charts/physics/cruciblePhysics.d.ts +2 -2
  73. package/dist/components/charts/physics/gauntletPhysics.d.ts +2 -6
  74. package/dist/components/charts/physics/physicsHocUtils.d.ts +8 -1
  75. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +2 -0
  76. package/dist/components/charts/shared/chartSize.d.ts +58 -0
  77. package/dist/components/charts/shared/chartSizeDefaults.d.ts +189 -0
  78. package/dist/components/charts/shared/chartSizeDefaultsAtlas.d.ts +9 -0
  79. package/dist/components/charts/shared/chartSizeDefaultsNetwork.d.ts +29 -0
  80. package/dist/components/charts/shared/chartSizeDefaultsOrdinal.d.ts +13 -0
  81. package/dist/components/charts/shared/chartSizeDefaultsPhysics.d.ts +41 -0
  82. package/dist/components/charts/shared/chartSizeDefaultsValue.d.ts +19 -0
  83. package/dist/components/charts/shared/chartSizeDefaultsXY.d.ts +10 -0
  84. package/dist/components/charts/shared/networkPerspectiveWireSchema.d.ts +3 -0
  85. package/dist/components/charts/shared/useChartSetup.d.ts +3 -0
  86. package/dist/components/charts/shared/useCustomChartSetup.d.ts +4 -0
  87. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +2 -0
  88. package/dist/components/charts/shared/withChartWrapper.d.ts +6 -2
  89. package/dist/components/charts/value/BigNumber.d.ts +0 -8
  90. package/dist/components/charts/xy/minimapLayout.d.ts +10 -0
  91. package/dist/components/realtime/BinAccumulator.d.ts +5 -2
  92. package/dist/components/recipes/atlas/dependencyForestChartProps.d.ts +4 -4
  93. package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +177 -1
  94. package/dist/components/recipes/atlas/flowCircuitLayout.d.ts +3 -0
  95. package/dist/components/recipes/atlas/motifBraidChartProps.d.ts +2 -0
  96. package/dist/components/recipes/atlas/resolution/BoundaryLoomChart.d.ts +3 -0
  97. package/dist/components/recipes/atlas/resolution/ComponentCutaway.d.ts +16 -0
  98. package/dist/components/recipes/atlas/resolution/ResolutionAtlasChart.d.ts +3 -0
  99. package/dist/components/recipes/atlas/resolution/ResolutionGlyphs.d.ts +15 -0
  100. package/dist/components/recipes/atlas/resolution/ResolutionReader.d.ts +5 -0
  101. package/dist/components/recipes/atlas/resolution/appearance.d.ts +58 -0
  102. package/dist/components/recipes/atlas/resolution/boundaryLoomLayout.d.ts +4 -0
  103. package/dist/components/recipes/atlas/resolution/chartProps.d.ts +75 -0
  104. package/dist/components/recipes/atlas/resolution/componentCutawayLayout.d.ts +12 -0
  105. package/dist/components/recipes/atlas/resolution/cutawayContext.d.ts +23 -0
  106. package/dist/components/recipes/atlas/resolution/cutawayGraph.d.ts +4 -0
  107. package/dist/components/recipes/atlas/resolution/cycles.d.ts +7 -0
  108. package/dist/components/recipes/atlas/resolution/evidence.d.ts +43 -0
  109. package/dist/components/recipes/atlas/resolution/glyphs.d.ts +40 -0
  110. package/dist/components/recipes/atlas/resolution/identity.d.ts +4 -0
  111. package/dist/components/recipes/atlas/resolution/indexGraph.d.ts +32 -0
  112. package/dist/components/recipes/atlas/resolution/ownership.d.ts +25 -0
  113. package/dist/components/recipes/atlas/resolution/plan.d.ts +12 -0
  114. package/dist/components/recipes/atlas/resolution/ports.d.ts +44 -0
  115. package/dist/components/recipes/atlas/resolution/prepare.d.ts +4 -0
  116. package/dist/components/recipes/atlas/resolution/project.d.ts +70 -0
  117. package/dist/components/recipes/atlas/resolution/queries.d.ts +23 -0
  118. package/dist/components/recipes/atlas/resolution/resolutionAtlasLayout.d.ts +9 -0
  119. package/dist/components/recipes/atlas/resolution/rules.d.ts +14 -0
  120. package/dist/components/recipes/atlas/resolution/scene.d.ts +52 -0
  121. package/dist/components/recipes/atlas/resolution/selection.d.ts +3 -0
  122. package/dist/components/recipes/atlas/resolution/sets.d.ts +10 -0
  123. package/dist/components/recipes/atlas/resolution/types.d.ts +401 -0
  124. package/dist/components/recipes/atlas/resolution/validate.d.ts +4 -0
  125. package/dist/components/recipes/atlas/resolution/witnesses.d.ts +18 -0
  126. package/dist/components/recipes/atlas/resolution/worker.d.ts +34 -0
  127. package/dist/components/recipes/lineageDag.d.ts +4 -0
  128. package/dist/components/recipes/recipeUtils.d.ts +2 -0
  129. package/dist/components/recipes/transitDiagram.d.ts +2 -61
  130. package/dist/components/recipes/transitDiagramTypes.d.ts +65 -0
  131. package/dist/components/semiotic-ai.d.ts +2 -0
  132. package/dist/components/semiotic-experimental-network-resolution-react.d.ts +12 -0
  133. package/dist/components/semiotic-experimental-network-resolution.d.ts +13 -0
  134. package/dist/components/semiotic-geo.d.ts +1 -1
  135. package/dist/components/semiotic-network-perspective-core.d.ts +6 -0
  136. package/dist/components/semiotic-network.d.ts +1 -1
  137. package/dist/components/semiotic-ordinal.d.ts +1 -1
  138. package/dist/components/semiotic-physics.d.ts +1 -1
  139. package/dist/components/semiotic-realtime-core.d.ts +1 -1
  140. package/dist/components/semiotic-realtime-react.d.ts +2 -0
  141. package/dist/components/semiotic-utils-core.d.ts +3 -1
  142. package/dist/components/semiotic-vite.d.ts +2 -0
  143. package/dist/components/semiotic-xy.d.ts +3 -1
  144. package/dist/components/semiotic.d.ts +3 -1
  145. package/dist/components/server/renderToStaticSVG.d.ts +2 -1
  146. package/dist/components/server/serverChartConfigShared.d.ts +2 -0
  147. package/dist/components/store/LinkedCrosshairStore.d.ts +43 -11
  148. package/dist/components/store/themeCore.d.ts +2 -0
  149. package/dist/components/stream/frameKeyboardNavigation.d.ts +3 -1
  150. package/dist/components/stream/hoverUtils.d.ts +5 -0
  151. package/dist/components/stream/networkCustomLayout.d.ts +3 -0
  152. package/dist/components/stream/networkPerspective.d.ts +2 -0
  153. package/dist/components/stream/networkPerspectiveFit.d.ts +12 -1
  154. package/dist/components/stream/networkPerspectiveSolid.d.ts +1 -1
  155. package/dist/components/stream/networkSceneTypes.d.ts +4 -0
  156. package/dist/components/stream/networkTypes.d.ts +2 -0
  157. package/dist/components/stream/pipelineConfig.d.ts +2 -0
  158. package/dist/components/stream/pipelineDomainResolution.d.ts +4 -1
  159. package/dist/components/stream/types.d.ts +2 -0
  160. package/dist/components/stream/useFrame.d.ts +2 -0
  161. package/dist/components/stream/xySceneBuilders/types.d.ts +2 -0
  162. package/dist/controls.module.min.js +31 -31
  163. package/dist/geo.min.js +150 -150
  164. package/dist/geo.module.min.js +31 -31
  165. package/dist/network.module.min.js +1 -1
  166. package/dist/ordinal.module.min.js +1 -1
  167. package/dist/physics.module.min.js +1 -1
  168. package/dist/rough.module.min.js +1 -1
  169. package/dist/semiotic-ai-core.min.js +1 -1
  170. package/dist/semiotic-ai-core.module.min.js +1 -1
  171. package/dist/semiotic-ai.d.ts +2 -0
  172. package/dist/semiotic-ai.module.min.js +13 -13
  173. package/dist/semiotic-artifact-react.module.min.js +4 -4
  174. package/dist/semiotic-artifact.min.js +1 -1
  175. package/dist/semiotic-artifact.module.min.js +1 -1
  176. package/dist/semiotic-atlas-selection.module.min.js +1 -1
  177. package/dist/semiotic-atlas.module.min.js +10 -12
  178. package/dist/semiotic-client-cjs-shared.min.js +1078 -925
  179. package/dist/semiotic-client-glyph.module.min.js +2 -2
  180. package/dist/semiotic-client-shared.module.min.js +1 -1
  181. package/dist/semiotic-experimental-auxiliary.module.min.js +8 -9
  182. package/dist/semiotic-experimental-network-resolution-react.d.ts +12 -0
  183. package/dist/semiotic-experimental-network-resolution-react.min.js +2 -0
  184. package/dist/semiotic-experimental-network-resolution-react.module.min.js +89 -0
  185. package/dist/semiotic-experimental-network-resolution.d.ts +13 -0
  186. package/dist/semiotic-experimental-network-resolution.min.js +2 -0
  187. package/dist/semiotic-experimental-network-resolution.module.min.js +2 -0
  188. package/dist/semiotic-experimental-node-auxiliary.module.min.js +9 -10
  189. package/dist/semiotic-geo.d.ts +1 -1
  190. package/dist/semiotic-line.module.min.js +1 -1
  191. package/dist/semiotic-network-perspective-core.d.ts +6 -0
  192. package/dist/semiotic-network-perspective-core.min.js +1 -0
  193. package/dist/semiotic-network-perspective-core.module.min.js +1 -0
  194. package/dist/semiotic-network-perspective.module.min.js +1 -1
  195. package/dist/semiotic-network-placement.min.js +4 -0
  196. package/dist/semiotic-network-placement.module.min.js +4 -0
  197. package/dist/semiotic-network-zoom.module.min.js +1 -1
  198. package/dist/semiotic-network.d.ts +1 -1
  199. package/dist/semiotic-ordinal.d.ts +1 -1
  200. package/dist/semiotic-physics.d.ts +1 -1
  201. package/dist/semiotic-realtime-core.d.ts +1 -1
  202. package/dist/semiotic-realtime-core.module.min.js +1 -1
  203. package/dist/semiotic-realtime-react.d.ts +2 -0
  204. package/dist/semiotic-realtime-react.module.min.js +1 -1
  205. package/dist/semiotic-recipes-core-cjs-base.min.js +101 -106
  206. package/dist/semiotic-recipes-core.module.min.js +75 -76
  207. package/dist/semiotic-server-edge-node.module.min.js +391 -392
  208. package/dist/semiotic-server-edge.min.js +387 -388
  209. package/dist/semiotic-server-edge.module.min.js +371 -371
  210. package/dist/semiotic-server-node.min.js +387 -388
  211. package/dist/semiotic-server-node.module.min.js +1 -1
  212. package/dist/semiotic-utils-core.d.ts +3 -1
  213. package/dist/semiotic-utils-core.min.js +12 -11
  214. package/dist/semiotic-utils-core.module.min.js +12 -11
  215. package/dist/semiotic-value.module.min.js +4 -4
  216. package/dist/semiotic-vite.d.ts +2 -0
  217. package/dist/semiotic-vite.min.js +1 -0
  218. package/dist/semiotic-vite.module.min.js +1 -0
  219. package/dist/semiotic-xy.d.ts +3 -1
  220. package/dist/semiotic.d.ts +3 -1
  221. package/dist/semiotic.module.min.js +12 -12
  222. package/dist/server.min.js +387 -388
  223. package/dist/server.module.min.js +1 -1
  224. package/dist/xy.module.min.js +1 -1
  225. package/package.json +42 -13
  226. package/dist/c-2AB65V3L.min.js +0 -1
  227. package/dist/c-2U5JMOPN.min.js +0 -88
  228. package/dist/c-3DCTIRW4.min.js +0 -1
  229. package/dist/c-3OKFRTYM.min.js +0 -1
  230. package/dist/c-3VZHOPFW.min.js +0 -1
  231. package/dist/c-4ZSQIBC7.min.js +0 -1
  232. package/dist/c-5M4RUS7V.min.js +0 -34
  233. package/dist/c-6O5WWP7F.min.js +0 -1
  234. package/dist/c-73TOIYIW.min.js +0 -48
  235. package/dist/c-AE4M7BWH.min.js +0 -1
  236. package/dist/c-AEIK2NFW.min.js +0 -30
  237. package/dist/c-AFQSEIZ4.min.js +0 -4
  238. package/dist/c-BBX7DVVB.min.js +0 -51
  239. package/dist/c-CNYFCSG4.min.js +0 -5
  240. package/dist/c-E6QH2WYE.min.js +0 -1
  241. package/dist/c-GOMQWQJR.min.js +0 -1
  242. package/dist/c-GTYG4PDT.min.js +0 -1
  243. package/dist/c-H23GIKTK.min.js +0 -1
  244. package/dist/c-HQLUUSRJ.min.js +0 -1
  245. package/dist/c-HXUOFDSD.min.js +0 -64
  246. package/dist/c-L3LKYOLK.min.js +0 -1
  247. package/dist/c-MIKDFGKH.min.js +0 -1
  248. package/dist/c-OYSPTIAG.min.js +0 -1
  249. package/dist/c-PWPJNYQP.min.js +0 -1
  250. package/dist/c-QZ5SWKHC.min.js +0 -392
  251. package/dist/c-RXJH4IRX.min.js +0 -41
  252. package/dist/c-SN2D6QMH.min.js +0 -1
  253. package/dist/c-U5YGK6HL.min.js +0 -1
  254. package/dist/c-VIN5ASK2.min.js +0 -37
  255. package/dist/c-XZ3GASUJ.min.js +0 -1
  256. package/dist/c-ZLZZTH4I.min.js +0 -118
@@ -0,0 +1,7 @@
1
+ function e(e){if(!e?.colors)return;let t=e.colors;return{primary:t.primary,secondary:t.secondary||t.primary,surface:t.surface||t.background,success:t.success,danger:t.danger,warning:t.warning,error:t.error,info:t.info,text:t.text,textSecondary:t.textSecondary,border:t.border,grid:t.grid}}function t(e){if(!e.accessibility)return e;let t=e;if(e.accessibility.colorBlindSafe&&(t={...t,colors:{...t.colors,categorical:B}}),e.accessibility.highContrast){let e="dark"===t.mode;t={...t,colors:{...t.colors,text:e?"#ffffff":"#000000",textSecondary:e?"#cccccc":"#333333",grid:e?"#666666":"#999999",border:e?"#888888":"#000000"}}}return t}function r(e,r){if("light"===r)return T;if("dark"===r)return A;if("high-contrast"===r)return P;if("string"==typeof r)return typeof console<"u"&&console.warn(`[ThemeStore] Unknown theme preset "${r}". Keeping current theme.`),e;let o=e=>r.aesthetics?{...e,...r.aesthetics,weights:{...e?.weights,...r.aesthetics.weights},thresholds:{...e?.thresholds,...r.aesthetics.thresholds},rationales:{...e?.rationales,...r.aesthetics.rationales}}:e;if(r.mode&&"auto"!==r.mode){let e="dark"===r.mode?A:T;return t({...e,...r,colors:{...e.colors,...r.colors||{}},typography:{...e.typography,...r.typography||{}},aesthetics:o(e.aesthetics)})}return t({...e,...r,colors:{...e.colors,...r.colors||{}},typography:{...e.typography,...r.typography||{}},aesthetics:o(e.aesthetics)})}function o(e){let t=null,r=()=>(t||(t=I(null)),t),o=a(e);return[function({children:t,initialState:o}){let i=H(o),n=D(()=>a(e,i.current),[]),s=r();/* */
2
+ return U(s.Provider,{value:n,children:t})},(e,t)=>{let a=r(),i=L(a)??o,n=H(e);n.current=e;let s=H({hasValue:!1,value:void 0}),c=$(()=>{let e=n.current(i.getState()),r=s.current;return r.hasValue&&t&&t(r.value,e)?r.value:(s.current={hasValue:!0,value:e},e)},[i,t]),l=$(()=>n.current(i.getState()),[i]);return W(i.subscribe,c,l)}]}function a(e,t){let r=/* @__PURE__ */new Set,o={...e(function(e){let t=e(o);if(i(t)){o={...o,...t};for(let e of r)e()}}),...t??{}};return{getState:()=>o,subscribe:function(e){return r.add(e),()=>{r.delete(e)}}}}function i(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function n(e){return null!=e&&"boolean"!=typeof e&&("string"==typeof e?e.trim().length>0:Array.isArray(e)?e.some(n):!K.isValidElement(e)||e.type!==K.Fragment||n(e.props.children))}function s(){let e=globalThis;return e[X]??(e[X]=K.createContext(void 0))}function c(){return K.useContext(s())}function l(e){return e.ownsChrome=!0,e}function f(e){if("string"!=typeof e)return null!=e;let t=e.trim().toLowerCase();return!(!t||"transparent"===t||/^rgba\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t)||/^hsla\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t))}function d(e){if("function"==typeof e)return!0===e.ownsChrome;if(!K.isValidElement(e))return!1;let t=e.type;if("string"!=typeof t&&t&&!0===t.ownsChrome)return!0;let r=e.props,o=r["data-semiotic-tooltip-chrome"];if(null!=o&&!1!==o&&"false"!==o)return!0;let a=r.style;return!(!a||"object"!=typeof a||!f(a.background)&&!f(a.backgroundColor))}function u(e,t){return"function"==typeof e?.addEventListener?(e.addEventListener("change",t),()=>e.removeEventListener("change",t)):(e?.addListener?.(t),()=>e?.removeListener?.(t))}function p(e){return!(typeof window>"u"||!window.matchMedia)&&window.matchMedia(e).matches}function g(){let[e,t]=_(()=>p("(prefers-reduced-motion: reduce)"));return ee(()=>{if(typeof window>"u"||!window.matchMedia)return;let e=window.matchMedia("(prefers-reduced-motion: reduce)");return t(e.matches),u(e,e=>t(e.matches))},[]),e}function b(){let[e,t]=_(()=>p("(forced-colors: active)"));return ee(()=>{if(typeof window>"u"||!window.matchMedia)return;let e=window.matchMedia("(forced-colors: active)");return t(e.matches),u(e,e=>t(e.matches))},[]),e}function y(e,t,r){let o=0,a=e.length;for(;o<a;){let r=o+a>>>1;e[r]<t?o=r+1:a=r}return o<e.length&&e[o]<r}function m(e){let t=[];for(let[r,o]of Object.entries(e.fields))if("point"===o.type){let e;for(let t of o.values)t instanceof Date&&Number.isFinite(t.getTime())&&(e??(e=/* @__PURE__ */new Set),e.add(t.getTime()));let a=/* @__PURE__ */new Map,i=e=>{let t=a.get(e);if(!t){let r=[];for(let t of o.values){let o=e(t);Number.isFinite(o)&&r.push(o)}t=Float64Array.from(r).sort(),a.set(e,t)}return t};t.push((t,a)=>{if(a&&Object.prototype.hasOwnProperty.call(a.ranges,r)){let[e,t]=a.ranges[r];return y(i(a.toNumber??te),e,t)}let n=t[r];return n instanceof Date?e?.has(n.getTime())??!1:o.values.has(n)})}else{let[e,a]=o.range;t.push(t=>{let o=t[r],i=o instanceof Date?o.getTime():o;return"number"==typeof i&&Number.isFinite(i)&&i>=e&&i<=a})}return(e,r)=>t.every(t=>t(e,r))}function h(e,t){let r=[];for(let[o,a]of e.clauses)"crossfilter"===e.resolution&&o===t||r.push(m(a));if(0===r.length)return()=>!0;let o="union"!==e.resolution?(e,t)=>r.every(r=>r(e,t)):(e,t)=>r.some(r=>r(e,t));return e=>{let t=E(e);return o(e,t)||(j(e)?.some(e=>o(e,t))??!1)}}function x(e,t){let r=e.get(t);return r||(r={name:t,resolution:"union",clauses:/* @__PURE__ */new Map},e.set(t,r)),r}function S(e,t){if(e.type!==t.type)return!1;if("interval"===e.type&&"interval"===t.type)return e.range[0]===t.range[0]&&e.range[1]===t.range[1];if("point"===e.type&&"point"===t.type){if(e.values.size!==t.values.size)return!1;for(let r of e.values)if(!t.values.has(r))return!1;return!0}return!1}function w(e,t){if(e.clientId!==t.clientId||e.type!==t.type)return!1;let r=Object.entries(e.fields);if(r.length!==k(t.fields))return!1;for(let[e,o]of r){let r=t.fields[e];if(!r||!S(o,r))return!1}return!0}function k(e){let t=0;for(let r in e)t++;return t}function v(e){return Object.prototype.hasOwnProperty.call(ne,e)?ne[e]:void 0}function z(e){let t={"--semiotic-bg":e.colors.background,"--semiotic-text":e.colors.text,"--semiotic-text-secondary":e.colors.textSecondary,"--semiotic-grid":e.colors.grid,"--semiotic-border":e.colors.border,"--semiotic-cell-border":e.colors.cellBorder||e.colors.border,"--semiotic-primary":e.colors.primary,"--semiotic-font-family":e.typography.fontFamily,"--semiotic-secondary":e.colors.secondary||e.colors.primary,"--semiotic-surface":e.colors.surface||e.colors.background};e.colors.categorical.forEach((e,r)=>{t[`--semiotic-category-${r+1}`]=e}),e.colors.focus&&(t["--semiotic-focus"]=e.colors.focus),e.colors.selection&&(t["--semiotic-selection-color"]=e.colors.selection),null!=e.colors.selectionOpacity&&(t["--semiotic-selection-opacity"]=String(e.colors.selectionOpacity)),e.colors.diverging&&(t["--semiotic-diverging"]=e.colors.diverging),e.colors.annotation&&(t["--semiotic-annotation-color"]=e.colors.annotation),e.colors.success&&(t["--semiotic-success"]=e.colors.success),e.colors.danger&&(t["--semiotic-danger"]=e.colors.danger),e.colors.warning&&(t["--semiotic-warning"]=e.colors.warning),e.colors.error&&(t["--semiotic-error"]=e.colors.error),e.colors.info&&(t["--semiotic-info"]=e.colors.info),e.tooltip?.background&&(t["--semiotic-tooltip-bg"]=e.tooltip.background),e.tooltip?.text&&(t["--semiotic-tooltip-text"]=e.tooltip.text),e.tooltip?.borderRadius&&(t["--semiotic-tooltip-radius"]=e.tooltip.borderRadius),e.tooltip?.fontSize&&(t["--semiotic-tooltip-font-size"]=e.tooltip.fontSize),e.tooltip?.shadow&&(t["--semiotic-tooltip-shadow"]=e.tooltip.shadow),e.borderRadius&&(t["--semiotic-border-radius"]=e.borderRadius);let r=e.typography.legendSize??e.typography.labelSize;null!=r&&(t["--semiotic-legend-font-size"]=`${r}px`),null!=e.typography.legendFontFamily&&(t["--semiotic-legend-font-family"]=e.typography.legendFontFamily),null!=e.typography.legendFontWeight&&(t["--semiotic-legend-font-weight"]=String(e.typography.legendFontWeight));let o=e.typography.titleFontSize??e.typography.titleSize;return null!=o&&(t["--semiotic-title-font-size"]=`${o}px`),null!=e.typography.titleFontFamily&&(t["--semiotic-title-font-family"]=e.typography.titleFontFamily),null!=e.typography.titleFontWeight&&(t["--semiotic-title-font-weight"]=String(e.typography.titleFontWeight)),null!=e.typography.tickFontFamily&&(t["--semiotic-tick-font-family"]=e.typography.tickFontFamily),null!=e.typography.tickSize&&(t["--semiotic-tick-font-size"]=`${e.typography.tickSize}px`),null!=e.typography.labelSize&&(t["--semiotic-axis-label-font-size"]=`${e.typography.labelSize}px`),t}function F(e){return"string"!=typeof e?e:"light"===e?"light":"dark"===e?"dark":"high-contrast"===e?"high-contrast":v(e)||(typeof console<"u"&&console.warn(`[ThemeProvider] Unknown theme preset "${e}". Falling back to light theme.`),"light")}function R(e){return void 0!==e?r(T,F(e)):typeof window>"u"||!window.matchMedia||!window.matchMedia("(forced-colors: active)").matches?T:P}function M(e,t){e(t===T?"light":t===A?"dark":t===P?"high-contrast":t)}function C({theme:e}){let t=le(e=>e.setTheme),r=le(e=>e.theme),o=se.useRef(r);o.current=r;let a=se.useRef(null);se.useEffect(()=>{if(void 0!==e||typeof window>"u"||!window.matchMedia)return;let r=window.matchMedia("(forced-colors: active)");return r.matches&&(a.current=o.current===P?T:o.current,t("high-contrast")),u(r,e=>{e.matches?(a.current=o.current===P?a.current??T:o.current,t("high-contrast")):(M(t,a.current??T),a.current=null)})},[e,t]);let i=se.useRef(!1);return pe(()=>{i.current?void 0!==e&&t(F(e)):i.current=!0},[e,t]),null}function N({children:e}){let t=le(e=>e.theme),r={position:"relative",colorScheme:"auto"===t.mode?"light dark":t.mode,...z(t)},o=se.useContext(ue),a={};return o&&(a["data-semiotic-theme"]=o),a["data-semiotic-theme-mode"]=t.mode,/* @__PURE__ */fe(Y,{chrome:t.tooltip?.chrome,children:/* @__PURE__ */fe("div",{style:r,...a,children:e})})}function q({theme:e,children:t}){let r="string"==typeof e&&v(e)?e:void 0,o=se.useMemo(()=>R(e),[e]);/* */
3
+ return fe(ce,{initialState:{theme:o},children:/* @__PURE__ */de(ue.Provider,{value:r,children:[
4
+ /* @__PURE__ */fe(C,{theme:e}),
5
+ /* @__PURE__ */fe(N,{children:t})]})})}function O(){return le(e=>e.theme)}import{b as j,h as E}from"./c-ODSUDNB4.min.js";var B=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],T={mode:"light",colors:{primary:"#00a2ce",secondary:"#6c757d",categorical:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],sequential:"blues",diverging:"RdBu",background:"transparent",surface:"#ffffff",text:"#333",textSecondary:"#666",grid:"#e0e0e0",border:"#ccc",selection:"#00a2ce",selectionOpacity:.15,success:"#2ca02c",danger:"#d62728",warning:"#f0ad4e",error:"#b4181b",info:"#00a2ce"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},A={mode:"dark",colors:{primary:"#4fc3f7",secondary:"#90a4ae",categorical:["#4fc3f7","#ffb74d","#81c784","#ef5350","#ba68c8","#a1887f","#f06292","#90a4ae","#dce775","#4dd0e1"],sequential:"blues",diverging:"RdBu",background:"#1a1a2e",surface:"#252540",text:"#e0e0e0",textSecondary:"#aaa",grid:"#333",border:"#555",selection:"#4fc3f7",selectionOpacity:.15,success:"#81c784",danger:"#ef5350",warning:"#ffb74d",error:"#d84848",info:"#4fc3f7"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},P={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:B,sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#000000",textSecondary:"#333333",grid:"#999999",border:"#000000",focus:"#0000cc",selection:"#0000cc",selectionOpacity:.1,success:"#006400",danger:"#cc0000",warning:"#b15a00",error:"#8b0000",info:"#0000cc"},typography:{fontFamily:"system-ui, sans-serif",titleSize:18,labelSize:14,tickSize:12},tooltip:{background:"#000000",text:"#ffffff",borderRadius:"4px",fontSize:"14px",shadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},borderRadius:"4px"};import{createContext as I,useCallback as $,useContext as L,useMemo as D,useRef as H,useSyncExternalStore as W}from"react";import{jsx as U}from"react/jsx-runtime";var[V,G]=/* @__PURE__ */o(e=>({observations:[],maxObservations:100,version:0,pushObservation(t){e(e=>{let r=e.observations;return r.push(t),r.length>e.maxObservations&&r.shift(),{version:e.version+1}})},clearObservations(){e(()=>({observations:[],version:0}))}}));import*as K from"react";import{jsx as J}from"react/jsx-runtime";var Q={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, white)",padding:"8px 12px",borderRadius:"var(--semiotic-tooltip-radius, 6px)",fontSize:"var(--semiotic-tooltip-font-size, 14px)",fontFamily:"var(--semiotic-font-family, inherit)",lineHeight:"1.5",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.15))",pointerEvents:"none",maxWidth:"300px",wordWrap:"break-word"},X=/* @__PURE__ */Symbol.for("semiotic.tooltipChromeContext"),Y=/* @__PURE__ */l(function({chrome:e,children:t}){let r=s();/* */
6
+ return J(r.Provider,{value:e,children:t})}),Z=/* @__PURE__ */l(function({chrome:e,className:t="",style:r,children:o,...a}){let i=c(),n="default"===(e??i??"default")?{...Q,...r}:r;/* */
7
+ return J("div",{...a,"data-semiotic-tooltip-chrome":!0,className:`semiotic-tooltip ${t}`.trim(),style:n,children:o})});import{useState as _,useEffect as ee}from"react";var te=e=>e instanceof Date?e.getTime():"number"==typeof e?e:NaN,[re,oe]=/* @__PURE__ */o(e=>({selections:/* @__PURE__ */new Map,setClause(t,r){e(e=>{let o=e.selections.get(t)?.clauses.get(r.clientId);if(o&&w(o,r))return{};let a=new Map(e.selections),i=x(a,t),n=new Map(i.clauses);return n.set(r.clientId,r),a.set(t,{...i,clauses:n}),{selections:a}})},clearClause(t,r){e(e=>{let o=e.selections.get(t);if(!o||!o.clauses.has(r))return{};let a=new Map(e.selections),i=new Map(o.clauses);return i.delete(r),a.set(t,{...o,clauses:i}),{selections:a}})},setResolution(t,r){e(e=>{if(e.selections.get(t)?.resolution===r)return{};let o=new Map(e.selections),a=x(o,t);return o.set(t,{...a,resolution:r}),{selections:o}})},clearSelection(t){e(e=>{let r=e.selections.get(t);if(!r||0===r.clauses.size)return{};let o=new Map(e.selections);return o.set(t,{...r,clauses:/* @__PURE__ */new Map}),{selections:o}})}})),ae=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"],ie={danger:"#da1e28",warning:"#f1c21b",success:"#24a148",info:"#0043ce"},ne={light:T,dark:A,"high-contrast":P,pastels:{mode:"light",colors:{primary:"#c9a0dc",secondary:"#b8a8c8",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#fdf6f0",surface:"#fff5ee",text:"#4a3728",textSecondary:"#7a644a",grid:"#e8d5c4",border:"#e8d5c4",focus:"#8a5fae",annotation:"#8a5fae",success:"#9ad4a3",danger:"#e8869a",warning:"#f0c888",error:"#c86070",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#fff5ee",text:"#4a3728",borderRadius:"8px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"10px"},"pastels-dark":{mode:"dark",colors:{primary:"#c9a0dc",secondary:"#a899c0",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#1a1525",surface:"#251e35",text:"#e8ddf0",textSecondary:"#a899c0",grid:"#3d3455",border:"#3d3455",focus:"#c9a0dc",annotation:"#c9a0dc",success:"#88d4ab",danger:"#f0a0c0",warning:"#f0c888",error:"#e87690",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#251e35",text:"#e8ddf0",borderRadius:"8px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"10px"},"bi-tool":{mode:"light",colors:{primary:"#2563eb",secondary:"#6b7280",categorical:["#2563eb","#0d9488","#ea580c","#6b7280"],sequential:"blues",background:"#f5f6f8",surface:"#ffffff",text:"#2c3e50",textSecondary:"#64717f",grid:"#d8dce3",border:"#d8dce3",focus:"#2563eb",annotation:"#2563eb",success:"#10b981",danger:"#ef4444",warning:"#f59e0b",error:"#dc2626",info:"#2563eb"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2c3e50",borderRadius:"6px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"8px"},"bi-tool-dark":{mode:"dark",colors:{primary:"#3b82f6",secondary:"#9ca3af",categorical:["#3b82f6","#14b8a6","#f97316","#9ca3af"],sequential:"blues",background:"#111827",surface:"#1f2937",text:"#f3f4f6",textSecondary:"#9ca3af",grid:"#374151",border:"#374151",focus:"#3b82f6",annotation:"#3b82f6",success:"#34d399",danger:"#f87171",warning:"#fbbf24",error:"#ef4444",info:"#60a5fa"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f2937",text:"#f3f4f6",borderRadius:"6px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"8px"},italian:{mode:"light",colors:{primary:"#cc0000",secondary:"#666666",categorical:["#cc0000","#333333","#c8a415","#4682b4"],sequential:"reds",background:"#fafafa",surface:"#ffffff",text:"#1a1a1a",textSecondary:"#666666",grid:"#e0e0e0",border:"#e0e0e0",focus:"#cc0000",annotation:"#cc0000",success:"#556b2f",danger:"#cc0000",warning:"#c8a415",error:"#8b0000",info:"#4682b4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#1a1a1a",borderRadius:"2px",shadow:"0 2px 4px rgba(0, 0, 0, 0.15)"},borderRadius:"2px"},"italian-dark":{mode:"dark",colors:{primary:"#ff3333",secondary:"#aaaaaa",categorical:["#ff3333","#aaaaaa","#d4a843","#6aa4d4"],sequential:"reds",background:"#0a0a0a",surface:"#1a1a1a",text:"#f5f5f5",textSecondary:"#aaaaaa",grid:"#333333",border:"#333333",focus:"#ff3333",annotation:"#ff3333",success:"#7a8b5a",danger:"#ff3333",warning:"#d4a843",error:"#cc0000",info:"#6aa4d4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1a1a1a",text:"#f5f5f5",borderRadius:"2px",shadow:"0 2px 8px rgba(0, 0, 0, 0.5)"},borderRadius:"2px"},tufte:{mode:"light",colors:{primary:"#8b0000",secondary:"#555555",categorical:["#8b4513","#556b2f","#4a5568","#800020"],sequential:"oranges",background:"#fffff8",surface:"#fffff8",text:"#111111",textSecondary:"#555555",grid:"#e0ddd0",border:"#e0ddd0",focus:"#8b0000",annotation:"#8b0000",success:"#556b2f",danger:"#8b0000",warning:"#b88700",error:"#6b0000",info:"#4a5568"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#fffff8",text:"#111111",borderRadius:"2px",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},borderRadius:"0px"},"tufte-dark":{mode:"dark",colors:{primary:"#c05050",secondary:"#a09880",categorical:["#c08050","#7a8b5a","#8090a0","#a05060"],sequential:"oranges",background:"#1c1b18",surface:"#262520",text:"#e8e4d8",textSecondary:"#a09880",grid:"#3d3c35",border:"#3d3c35",focus:"#c05050",annotation:"#d06a6a",success:"#7a8b5a",danger:"#c05050",warning:"#c8a060",error:"#a04040",info:"#8090a0"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262520",text:"#e8e4d8",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.4)"},borderRadius:"0px"},journalist:{mode:"light",colors:{primary:"#e45050",secondary:"#666666",categorical:["#3a86c8","#e45050","#d4a843","#888888"],sequential:"blues",background:"#ffffff",surface:"#f8f8f8",text:"#222222",textSecondary:"#666666",grid:"#d4d4d4",border:"#d4d4d4",focus:"#e45050",annotation:"#c63b3b",success:"#2d7a3d",danger:"#c8303a",warning:"#d4a843",error:"#a02028",info:"#3a86c8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:18,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#f8f8f8",text:"#222222",borderRadius:"4px",shadow:"0 2px 6px rgba(0, 0, 0, 0.12)"},borderRadius:"4px"},"journalist-dark":{mode:"dark",colors:{primary:"#ff6b6b",secondary:"#a0a0a0",categorical:["#5a9fd8","#ff6b6b","#e0c060","#aaaaaa"],sequential:"blues",background:"#141414",surface:"#1e1e1e",text:"#ededed",textSecondary:"#a0a0a0",grid:"#383838",border:"#383838",focus:"#ff6b6b",annotation:"#ff6b6b",success:"#6fba78",danger:"#ff6b6b",warning:"#e0c060",error:"#d04040",info:"#5a9fd8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1e1e1e",text:"#ededed",borderRadius:"4px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"4px"},playful:{mode:"light",colors:{primary:"#8b5cf6",secondary:"#7c5a9e",categorical:["#8b5cf6","#ec4899","#06b6d4","#84cc16"],sequential:"viridis",background:"#fdf8ff",surface:"#ffffff",text:"#2d1b4e",textSecondary:"#7c5a9e",grid:"#e8d0f8",border:"#e8d0f8",focus:"#8b5cf6",annotation:"#7a47e8",success:"#10d870",danger:"#ff4b6e",warning:"#ffaa33",error:"#e11d48",info:"#06b6d4"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2d1b4e",borderRadius:"12px",shadow:"0 4px 12px rgba(139, 92, 246, 0.15)"},borderRadius:"12px"},"playful-dark":{mode:"dark",colors:{primary:"#a78bfa",secondary:"#b8a0d8",categorical:["#a78bfa","#f472b6","#22d3ee","#a3e635"],sequential:"viridis",background:"#150a28",surface:"#1f1138",text:"#f0e8ff",textSecondary:"#b8a0d8",grid:"#3a2560",border:"#3a2560",focus:"#a78bfa",annotation:"#a78bfa",success:"#4ade80",danger:"#fb7185",warning:"#fbbf24",error:"#f43f5e",info:"#22d3ee"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f1138",text:"#f0e8ff",borderRadius:"12px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"12px"},carbon:{mode:"light",colors:{primary:"#0f62fe",secondary:"#525252",categorical:["#6929c4","#1192e8","#005d5d","#9f1853"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#161616",textSecondary:"#525252",grid:"#e0e0e0",border:"#e0e0e0",focus:"#0f62fe",annotation:"#0f62fe",success:"#24a148",danger:"#da1e28",warning:"#f1c21b",error:"#a2191f",info:"#0043ce"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#161616",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.2)"},borderRadius:"0px"},"carbon-dark":{mode:"dark",colors:{primary:"#4589ff",secondary:"#a8a8a8",categorical:["#a56eff","#33b1ff","#08bdba","#ff7eb6"],sequential:"blues",diverging:"RdBu",background:"#161616",surface:"#262626",text:"#f4f4f4",textSecondary:"#a8a8a8",grid:"#393939",border:"#393939",focus:"#4589ff",annotation:"#4589ff",success:"#42be65",danger:"#fa4d56",warning:"#f1c21b",error:"#da1e28",info:"#4589ff"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262626",text:"#f4f4f4",borderRadius:"2px",shadow:"0 4px 12px rgba(0, 0, 0, 0.5)"},borderRadius:"0px"}};import*as se from"react";var[ce,le]=/* @__PURE__ */o(e=>({theme:T,setTheme(t){e(e=>({theme:r(e.theme,t)}))}}));import{jsx as fe,jsxs as de}from"react/jsx-runtime";var ue=/* @__PURE__ */se.createContext(void 0),pe=typeof window>"u"?se.useEffect:se.useLayoutEffect;export{B as a,T as b,A as c,P as d,e,o as f,i as g,le as h,V as i,G as j,n as k,Q as l,c as m,Y as n,Z as o,l as p,d as q,u as r,g as s,b as t,h as u,re as v,oe as w,ae as x,ie as y,ne as z,v as A,z as B,q as C,O as D};
@@ -1,6 +1,6 @@
1
- import{m as e,n as t,o as n,p as a}from"./c-K2Z4F22S.min.js";var l=e=>{if(null==e)return"";let t=Math.round(100*e)/100;return Number.isNaN(t)?"":String(t)};function r(e){return null==e||""===e?"—":"number"==typeof e?Number.isNaN(e)?"—":l(e):"boolean"==typeof e?e?"true":"false":"object"==typeof e?"—":String(e)}function i(e){let t=/* @__PURE__ */new Map;for(let n of e??[])for(let[e,a]of Object.entries(n?.values??{})){if(null==a||""===a)continue;let n=t.get(e);if(n||(n={count:0,min:1/0,max:-1/0,sum:0,strings:/* @__PURE__ */new Set},t.set(e,n)),"number"==typeof a){if(!Number.isFinite(a))continue;n.count++,n.sum+=a,a<n.min&&(n.min=a),a>n.max&&(n.max=a)}else"object"!=typeof a&&"function"!=typeof a&&n.strings.add(String(a))}return Array.from(t,([e,t])=>{if(t.count)return{name:e,count:t.count,numeric:!0,min:t.min,max:t.max,mean:t.sum/t.count};let n=Array.from(t.strings);return{name:e,count:n.length,numeric:!1,uniqueValues:n.slice(0,5)}}).filter(e=>e.count>0)}function s(e,t){let n=[`${e} data points.`];for(let e of t)if(e.numeric)n.push(`${e.name}: ${l(e.min)} to ${l(e.max)}, mean ${l(e.mean)}.`);else{let t=e.uniqueValues,a=t.length<=3?t.join(", "):`${t.slice(0,3).join(", ")}… (${e.count} unique)`;n.push(`${e.name}: ${a}.`)}return n.join(" ")}import{jsx as o,jsxs as u}from"react/jsx-runtime";function m({rows:l,label:i,caption:s,typeLabel:m,labelRows:c=!1,className:f="semiotic-accessible-data-table-table",style:b,extraColumns:d=[]}){let p=Array.from(new Set(l.flatMap(e=>Object.keys(e.values))));/* @__PURE__ */
2
- return u("table",{className:f,role:"table","aria-label":i,style:b??e,children:[
3
- /* @__PURE__ */o("caption",{className:"semiotic-accessible-data-table-caption",style:a,children:s}),
4
- /* @__PURE__ */o("thead",{children:/* @__PURE__ */o("tr",{children:[m,...p,...d.map(e=>e.label)].map((e,n)=>/* @__PURE__ */o("th",{style:t,children:e},n))})}),
5
- /* @__PURE__ */o("tbody",{children:l.map((e,t)=>/* @__PURE__ */u("tr",{tabIndex:-1,"aria-label":c?e.label:void 0,children:[
6
- /* @__PURE__ */o("td",{style:n,children:e.label}),p.map(t=>/* @__PURE__ */o("td",{style:n,children:r(e.values[t])},t)),d.map((e,a)=>/* @__PURE__ */o("td",{style:n,children:r(e.values[t])},a))]},t))})]})}export{l as a,i as b,s as c,m as d};
1
+ function e(e){return null==e||""===e?"—":"number"==typeof e?Number.isNaN(e)?"—":o(e):"boolean"==typeof e?e?"true":"false":"object"==typeof e?"—":String(e)}function t(e){let t=/* @__PURE__ */new Map;for(let n of e??[])for(let[e,a]of Object.entries(n?.values??{})){if(null==a||""===a)continue;let n=t.get(e);if(n||(n={count:0,min:1/0,max:-1/0,sum:0,strings:/* @__PURE__ */new Set},t.set(e,n)),"number"==typeof a){if(!Number.isFinite(a))continue;n.count++,n.sum+=a,a<n.min&&(n.min=a),a>n.max&&(n.max=a)}else"object"!=typeof a&&"function"!=typeof a&&n.strings.add(String(a))}return Array.from(t,([e,t])=>{if(t.count)return{name:e,count:t.count,numeric:!0,min:t.min,max:t.max,mean:t.sum/t.count};let n=Array.from(t.strings);return{name:e,count:n.length,numeric:!1,uniqueValues:n.slice(0,5)}}).filter(e=>e.count>0)}function n(e,t){let n=[`${e} data points.`];for(let e of t)if(e.numeric)n.push(`${e.name}: ${o(e.min)} to ${o(e.max)}, mean ${o(e.mean)}.`);else{let t=e.uniqueValues,a=t.length<=3?t.join(", "):`${t.slice(0,3).join(", ")}… (${e.count} unique)`;n.push(`${e.name}: ${a}.`)}return n.join(" ")}function a({rows:t,label:n,caption:a,typeLabel:o,labelRows:c=!1,className:f="semiotic-accessible-data-table-table",style:b,extraColumns:d=[]}){let p=Array.from(new Set(t.flatMap(e=>Object.keys(e.values))));/* */
2
+ return m("table",{className:f,role:"table","aria-label":n,style:b??l,children:[
3
+ /* @__PURE__ */u("caption",{className:"semiotic-accessible-data-table-caption",style:s,children:a}),
4
+ /* @__PURE__ */u("thead",{children:/* @__PURE__ */u("tr",{children:[o,...p,...d.map(e=>e.label)].map((e,t)=>/* @__PURE__ */u("th",{style:r,children:e},t))})}),
5
+ /* @__PURE__ */u("tbody",{children:t.map((t,n)=>/* @__PURE__ */m("tr",{tabIndex:-1,"aria-label":c?t.label:void 0,children:[
6
+ /* @__PURE__ */u("td",{style:i,children:t.label}),p.map(n=>/* @__PURE__ */u("td",{style:i,children:e(t.values[n])},n)),d.map((t,a)=>/* @__PURE__ */u("td",{style:i,children:e(t.values[n])},a))]},n))})]})}import{m as l,n as r,o as i,p as s}from"./c-K2Z4F22S.min.js";var o=e=>{if(null==e)return"";let t=Math.round(100*e)/100;return Number.isNaN(t)?"":String(t)};import{jsx as u,jsxs as m}from"react/jsx-runtime";export{o as a,t as b,n as c,a as d};
@@ -1 +1 @@
1
- function e(e,r,u){let o=n(e),i=n(r),f=n(u);return e=>{let n="string"==typeof e.agg&&"number"==typeof e.count&&"number"==typeof e.xCenter&&"number"==typeof e.yCenter;return{value:n?t(e.value):f(e),x:n?t(e.xCenter):o(e),y:n?t(e.yCenter):i(e)}}}function t(e){return"number"==typeof e&&Number.isFinite(e)?e:void 0}import{Lb as n}from"./c-2U5JMOPN.min.js";export{e as a};
1
+ function e(e,r,u){let o=n(e),i=n(r),f=n(u);return e=>{let n="string"==typeof e.agg&&"number"==typeof e.count&&"number"==typeof e.xCenter&&"number"==typeof e.yCenter;return{value:n?t(e.value):f(e),x:n?t(e.xCenter):o(e),y:n?t(e.yCenter):i(e)}}}function t(e){return"number"==typeof e&&Number.isFinite(e)?e:void 0}import{Ib as n}from"./c-XCV7VUU3.min.js";export{e as a};
@@ -1,9 +1,9 @@
1
- function e(e,t={}){let r=!0===t.showRetractedAnnotations,a=!0===t.showSupersededAnnotations,n=/* @__PURE__ */new Set;for(let t of e){let e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&n.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!r)return!1;let t=e?.provenance?.stableId;return!(t&&n.has(t)&&!a)})}function t(e){return"string"==typeof e?e:"value"}function r(e){return null==e?"–":"number"==typeof e?me(e):e instanceof Date?xe(e):String(e)}function a(e,t){if(!t)return r(e);try{return t(e)??r(e)}catch{return r(e)}}function n(e,t){return"function"==typeof t?t(e):e[t]}function l(e,t){if(!e)return[];let r=Array.isArray(e)?e:[e],a=[];return r.forEach((e,r)=>{let n="string"==typeof e?.y0Accessor?e.y0Accessor:"low",l="string"==typeof e?.y1Accessor?e.y1Accessor:"high";a.push({label:n,accessor:e=>e.bands?.[r]?.y0??(0===r?e.band?.y0:void 0),format:t}),a.push({label:l,accessor:e=>e.bands?.[r]?.y1??(0===r?e.band?.y1:void 0),format:t})}),a}function o(e){let t=e.find(e=>"title"===e.role),r=e.filter(e=>"title"!==e.role);return e=>{let l=e.data;if(!l)return null;let o=t?a(n(l,t.accessor),t.format):null;/* @__PURE__ */
2
- return De("div",{className:"semiotic-tooltip",style:ge,children:[null!=o&&/* @__PURE__ */Ie("div",{style:{fontWeight:"bold",marginBottom:r.length>0?4:0},children:o}),r.map((e,t)=>{let r=a("y"===e.role&&null!=l.__aggregateValue?l.__aggregateValue:n(l,e.accessor),e.format);/* @__PURE__ */
1
+ function e(e,t={}){let r=!0===t.showRetractedAnnotations,a=!0===t.showSupersededAnnotations,n=/* @__PURE__ */new Set;for(let t of e){let e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&n.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!r)return!1;let t=e?.provenance?.stableId;return!(t&&n.has(t)&&!a)})}function t(e){return"string"==typeof e?e:"value"}function r(e){return null==e?"–":"number"==typeof e?ge(e):e instanceof Date?me(e):String(e)}function a(e,t){if(!t)return r(e);try{return t(e)??r(e)}catch{return r(e)}}function n(e,t){return"function"==typeof t?t(e):e[t]}function l(e,t){if(!e)return[];let r=Array.isArray(e)?e:[e],a=[];return r.forEach((e,r)=>{let n="string"==typeof e?.y0Accessor?e.y0Accessor:"low",l="string"==typeof e?.y1Accessor?e.y1Accessor:"high";a.push({label:n,accessor:e=>e.bands?.[r]?.y0??(0===r?e.band?.y0:void 0),format:t}),a.push({label:l,accessor:e=>e.bands?.[r]?.y1??(0===r?e.band?.y1:void 0),format:t})}),a}function o(e){let t=e.find(e=>"title"===e.role),r=e.filter(e=>"title"!==e.role);return e=>{let l=e.data;if(!l)return null;let o=t?a(n(l,t.accessor),t.format):null;/* */
2
+ return De("div",{className:"semiotic-tooltip",style:_e,children:[null!=o&&/* @__PURE__ */Ie("div",{style:{fontWeight:"bold",marginBottom:r.length>0?4:0},children:o}),r.map((e,t)=>{let r=a("y"===e.role&&null!=l.__aggregateValue?l.__aggregateValue:n(l,e.accessor),e.format);/* */
3
3
  return De("div",{style:t>0?{marginTop:2}:void 0,children:[
4
4
  /* @__PURE__ */De("span",{style:{opacity:.7},children:[e.label,": "]}),
5
- /* @__PURE__ */Ie("span",{children:r})]},t)})]})}}function i({categoryAccessor:e,valueAccessor:l,groupAccessor:o,groupLabel:i,pieData:s=!1,valueFormat:u}){return c=>{let d=s?c.data?.[0]||c.data||c:c.data||c,f=n(d,e),h=n(d,l),p=o?n(d,o):void 0;/* @__PURE__ */
6
- return De("div",{className:"semiotic-tooltip",style:ge,children:[
5
+ /* @__PURE__ */Ie("span",{children:r})]},t)})]})}}function i({categoryAccessor:e,valueAccessor:l,groupAccessor:o,groupLabel:i,pieData:s=!1,valueFormat:u}){return c=>{let d=s?c.data?.[0]||c.data||c:c.data||c,f=n(d,e),h=n(d,l),p=o?n(d,o):void 0;/* */
6
+ return De("div",{className:"semiotic-tooltip",style:_e,children:[
7
7
  /* @__PURE__ */Ie("div",{style:{fontWeight:"bold"},children:r(f)}),
8
- /* @__PURE__ */Ie("div",{style:{marginTop:4},children:a(h,u)}),null!=p&&/* @__PURE__ */De("div",{style:{marginTop:2,opacity:.8},children:[i||t(o),": ",r(p)]})]})}}function s(...e){let t=e.filter(e=>null!=e);return 0===t.length?null:1===t.length?t[0]:Re.createElement(Re.Fragment,null,...t)}function u(e,t,r,a){Ee(()=>{e.current?.updateConfig(t),r.current=!0,a()},[t,a,e,r])}function c(e,t,r,a){let n=Pe(null);Ee(()=>{let l=e.current;if(!l)return;let o=t??null;n.current!==o&&(n.current=o,l.setLayoutSelection(o),l.hasCustomRestyle?l.restyleScene(o):r.current=!0,a())},[t,a,e,r])}function d(e,t){let r=e?.state??(e?.settling?"settling":void 0);if("live"===r)return $e;if("stopped"===r||"failed"===r||"stale"===r)return{alpha:e?.dimOpacity??.5,band:"stale",isStale:!0};if("settling"===r)return{alpha:.85,band:"aging",isStale:!1};if(!(e&&t>0))return $e;let a=null!=e.threshold&&e.threshold>0?e.threshold:5e3,n=e.graded;if(n){let e="object"==typeof n?n:{},r=ve(t,a,e.thresholds);return{alpha:{...Be,...e.opacities??{}}[r],band:r,isStale:"fresh"!==r}}return t>a?{alpha:e.dimOpacity??.5,band:"stale",isStale:!0}:$e}function f(e,t,r,a,n,l,o){let i=Le("fresh");Ce(()=>{if(!e)return void(i.current="fresh");let s=setInterval(()=>{let s=t.current;if(!s||0===s.lastIngestTime)return;let u=d(e,n()-s.lastIngestTime);(u.band!==i.current||u.isStale!==l)&&(i.current=u.band,u.isStale!==l&&o(u.isStale),r.current=!0,a())},1e3);return()=>clearInterval(s)},[e,l,a,n,t,o,r])}function h(e,t,r){return t||(r?"settling":e?"stale":"live")}function p({isStale:e,position:t,state:r,settling:a}){let n=h(e,r,a),l=je[n]??je.live,o=Object.hasOwn(je,n)?n.toUpperCase():"LIVE";/* @__PURE__ */
9
- return Oe("div",{className:"stream-staleness-badge",style:{position:"absolute",..."top-left"===t?{top:4,left:4}:"bottom-left"===t?{bottom:4,left:4}:"bottom-right"===t?{bottom:4,right:4}:{top:4,right:4},padding:"2px 8px",borderRadius:4,fontSize:11,fontWeight:600,pointerEvents:"none",zIndex:3,background:l,color:"white"},children:o})}function y(e){let{background:t,hasBackgroundGraphics:r=!1,themeBackground:a=""}=e;return"transparent"===t?null:r?t||null:t||(a&&"transparent"!==a?a:"")||null}function g(e){let{background:t,hasBackgroundGraphics:r=!1,themeBackground:a=""}=e;return"transparent"===t||r?null:t||(a&&"transparent"!==a?a:"")||null}function m(e,t){let{background:r,hasBackgroundGraphics:a=!1,themeBackground:n="",x:l=0,y:o=0,width:i,height:s}=t,u=g({background:r,hasBackgroundGraphics:a,themeBackground:n});if(!u)return!1;let c=Se(e,u);return!(!c||"transparent"===c.trim().toLowerCase()||(e.fillStyle=c,e.fillRect(l,o,i,s),0))}function x(e,t,r,a){return"function"==typeof e?e({size:t,margin:r,scales:a}):e}function b({foregroundGraphics:e,backgroundGraphics:t,size:r,margin:a,scales:n,background:l,themeBackgroundColor:o,resolveScaleAwareGraphics:i=!0}){let s=`var(--semiotic-bg, ${o})`;return{resolvedForeground:i||"function"!=typeof e?x(e,r,a,n):null,resolvedBackground:i||"function"!=typeof t?x(t,r,a,n):null,themeBackground:s,surfaceBackground:y({background:l,hasBackgroundGraphics:!!t,themeBackground:s})}}function v(e,t){if(!t)return[];let r=/* @__PURE__ */new Set,a=[];for(let n of e){if(!n||"object"!=typeof n)continue;let e="function"==typeof t?t(n):n[t],l=String(e);r.has(l)||(r.add(l),a.push(l))}return a}function w(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function k(e,t,r,a){let n=We({accessor:t,onChange:r,readData:a}),l=We([]);n.current={accessor:t,onChange:r,readData:a};let o=ze(()=>{let{accessor:t,onChange:r,readData:a}=n.current;if(!r||!t)return;let o=v(e.current?a(e.current):[],t);w(o,l.current)||(l.current=o,r(o))},[e]);return Te(()=>{l.current=[],o()},[t,o,r]),o}function M(e){if(!e||"object"!=typeof e)return!1;let t=e;return"string"==typeof t.id&&"function"==typeof t.cacheKey&&"function"==typeof t.drawCanvas&&"function"==typeof t.renderStaticSVG}function A(e,t){let r="function"==typeof e?e(t.datum??null,t):e;return M(r)?r:void 0}function S(e,t){if("production"===process.env.NODE_ENV)return;let r=`${e}:${t}`;Ge.has(r)||(Ge.add(r),console.warn(`[Semiotic] Render backend "${e}" does not support scene node "${t}"; using the built-in renderer.`))}function _(e){let{context:t,nodes:r,renderMode:a,pixelRatio:n,paintBuiltIn:l}=e;if(!a||"sketchy"===a)return void l(r);let o=[],i=()=>{o.length&&(l(o),o=[])};for(let e of r){let r,s=A(a,e);if(s){i(),t.save();try{r=s.drawCanvas({context:t,node:e,style:e.style??{},pixelRatio:n})}finally{t.restore()}r||(S(s.id,e.type??"unknown"),l([e]))}else o.push(e)}i()}function I(e){let{node:t,index:r,renderMode:a,fallback:n}=e,l=A(a,t);if(!l)return{element:n(),renderedByBackend:!1};let o=l.renderStaticSVG({node:t,style:t.style??{},key:`${l.id}-${r}`});return null!=o?{element:Me(o,t,`${l.id}-${r}-cursor`),renderedByBackend:!0}:(S(l.id,t.type??"unknown"),{element:n(),renderedByBackend:!1})}function D(e){return I(e).element}function R(e){let t=[];return e.nodes.forEach((r,a)=>{let n=I({node:r,index:a,renderMode:e.renderMode,fallback:()=>e.fallback(r,a)});null!==n.element&&void 0!==n.element&&!1!==n.element&&t.push({node:r,index:a,...n})}),t}function E(e){let t=/* @__PURE__ */new Map;for(let r of e){let e=r.group??"_default",a=t.get(e);a||(a=[],t.set(e,a)),a.push(r)}for(let e of t.values()){e.sort((e,t)=>e.x-t.x||e.y-t.y);for(let t=0;t<e.length;t++)e[t]._groupIndex=t}let r=Array.from(t.keys()).sort((e,r)=>{let a=t.get(e),n=t.get(r);return(a.length>0?a[0].y:0)-(n.length>0?n[0].y:0)}),a=Array.from(t.values()).flat();a.sort((e,t)=>e.x-t.x||e.y-t.y);let n=/* @__PURE__ */new Map;for(let e=0;e<a.length;e++){a[e]._flatIndex=e;let t=a[e].datum?.id;null!=t&&n.set(String(t),e)}return{flat:a,groups:r,byGroup:t,idToIdx:n}}function P(e,t){if(0===e.flat.length)return{flatIndex:-1,group:"_default",indexInGroup:-1};let r=Math.max(0,Math.min(t,e.flat.length-1)),a=e.flat[r];return{flatIndex:r,group:a.group??"_default",indexInGroup:a._groupIndex??0}}function B(e,t,r){let{group:a,indexInGroup:n}=t,l=r.byGroup.get(a);switch(e){case"ArrowRight":return n<l.length-1?l[n+1]._flatIndex:t.flatIndex;case"ArrowLeft":return n>0?l[n-1]._flatIndex:t.flatIndex;case"ArrowDown":{let e=r.groups.indexOf(a);return e<r.groups.length-1?$(r,r.groups[e+1],l[n]):t.flatIndex}case"ArrowUp":{let e=r.groups.indexOf(a);return e>0?$(r,r.groups[e-1],l[n]):t.flatIndex}case"PageDown":{let e=Math.max(1,Math.floor(.1*r.flat.length));return Math.min(t.flatIndex+e,r.flat.length-1)}case"PageUp":{let e=Math.max(1,Math.floor(.1*r.flat.length));return Math.max(t.flatIndex-e,0)}case"Home":return 0;case"End":return r.flat.length-1;case"Escape":return-1;default:return null}}function $(e,t,r){let a=e.byGroup.get(t),n=0,l=Math.abs(a[0].x-r.x);for(let e=1;e<a.length;e++){let t=Math.abs(a[e].x-r.x);t<l&&(l=t,n=e)}return a[n]._flatIndex}function C(e){let t=[];for(let r of e)switch(r.type){case"point":if(!1===r.interactive)break;t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle",group:"_default"});break;case"symbol":if(r.size<=0)break;t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle",group:"_default"});break;case"glyph":{if(r.size<=0||null==r.datum)break;let e=_e(r.glyph,r.size);t.push({x:r.x+e.centerDx,y:r.y+e.centerDy,datum:r.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight,group:"_default"});break}case"line":{let e=r,a=Array.isArray(e.datum)?e.datum:[],n=e.group??"_default";for(let r=0;r<e.path.length&&r<a.length;r++)t.push({x:e.path[r][0],y:e.path[r][1],datum:a[r],shape:"circle",group:n});break}case"area":{if(!1===r.interactive)break;let e=r,a=Array.isArray(e.datum)?e.datum:[],n=e.group??"_default";for(let r=0;r<e.topPath.length&&r<a.length;r++)t.push({x:e.topPath[r][0],y:e.topPath[r][1],datum:a[r],shape:"circle",group:n});break}case"rect":t.push({x:r.x+r.w/2,y:r.y+r.h/2,datum:r.datum,shape:"rect",w:r.w,h:r.h,group:r.group??"_default"});break;case"candlestick":{if(null==r.datum)break;let e=r.isRange?r.highY:Math.min(r.openY,r.closeY),a=r.isRange?r.lowY:Math.max(r.openY,r.closeY);t.push({x:r.x,y:(e+a)/2,datum:Ae(r.datum),shape:"rect",w:r.bodyWidth,h:Math.abs(a-e),group:"_default"});break}case"heatcell":t.push({x:r.x+r.w/2,y:r.y+r.h/2,datum:r.datum,shape:"rect",w:r.w,h:r.h,group:"_default"})}return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function L(e){let t=[];for(let r of e)if("rect"===r.type&&null!=r.x){if(null==r.datum)continue;let e=r.datum?.category??"";t.push({x:r.x+r.w/2,y:r.y+r.h/2,datum:r.datum,shape:"rect",w:r.w,h:r.h,semanticKey:void 0!==r.datum.__aggregateValue?JSON.stringify([e,r.group??e]):void 0,group:r.group??e})}else if("point"===r.type){if(!1===r.interactive)continue;t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle",group:"_default"})}else if("symbol"===r.type){if(r.size<=0)continue;t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle",group:"_default"})}else if("glyph"===r.type){if(r.size<=0||null==r.datum)continue;let e=_e(r.glyph,r.size);t.push({x:r.x+e.centerDx,y:r.y+e.centerDy,datum:r.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight,group:"_default"})}else if("boxplot"===r.type){if(null==r.datum)continue;let e="vertical"===r.projection;t.push({x:e?r.x:(r.q1Pos+r.q3Pos)/2,y:e?(r.q1Pos+r.q3Pos)/2:r.y,datum:Ae(r.datum),shape:"rect",w:e?r.columnWidth:Math.abs(r.q3Pos-r.q1Pos),h:e?Math.abs(r.q3Pos-r.q1Pos):r.columnWidth,stats:r.stats,category:r.category,group:"_default"})}else if("violin"===r.type&&r.bounds){if(null==r.datum)continue;let{x:e,y:a,width:n,height:l}=r.bounds;t.push({x:e+n/2,y:a+l/2,datum:Ae(r.datum),shape:"rect",w:n,h:l,stats:r.stats,category:r.category,group:"_default"})}else if("trapezoid"===r.type){if(null==r.datum||r.points.length<3)continue;t.push({x:r.points.reduce((e,t)=>e+t[0],0)/r.points.length,y:r.points.reduce((e,t)=>e+t[1],0)/r.points.length,datum:Ae(r.datum),shape:"path",pathData:`M${r.points.map(e=>e.join(",")).join("L")}Z`,category:r.category,group:"_default"})}else if("connector"===r.type){if(null==r.datum||(r.style.strokeWidth??1)<=0||"none"===r.style.stroke||r.x1===r.x2&&r.y1===r.y2)continue;t.push({x:(r.x1+r.x2)/2,y:(r.y1+r.y2)/2,datum:Ae(r.datum),shape:"path",pathData:`M${r.x1},${r.y1}L${r.x2},${r.y2}`,category:r.group,group:r.group??"_default"})}else if("wedge"===r.type&&null!=r.cx){if(null===r.datum)continue;let e=((r.startAngle||0)+(r.endAngle||0))/2,a=((r.innerRadius||0)+(r.outerRadius||50))/2;t.push({x:r.cx+Math.cos(e)*a,y:r.cy+Math.sin(e)*a,datum:r.datum,shape:"wedge",group:"_default"})}return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function O(e){let t=[];for(let r of e)if(r.datum)if("circle"===r.type&&null!=r.cx){if(r.r<=0)continue;t.push({x:r.cx,y:r.cy,datum:r.datum,shape:"circle",group:r.datum.id??"_default"})}else if("rect"===r.type&&null!=r.x){if(r.w<=0||r.h<=0)continue;t.push({x:r.x+r.w/2,y:r.y+r.h/2,datum:r.datum,shape:"rect",w:r.w,h:r.h,group:r.datum.id??"_default"})}else if("arc"===r.type&&null!=r.cx)t.push({x:r.cx,y:r.cy,datum:r.datum,shape:"circle",group:r.datum.id??"_default"});else if("symbol"===r.type&&null!=r.cx){if(r.size<=0)continue;t.push({x:r.cx,y:r.cy,datum:r.datum,shape:"circle",group:r.datum.id??"_default"})}else if("glyph"===r.type&&null!=r.cx){if(r.size<=0)continue;let e=_e(r.glyph,r.size);t.push({x:r.cx+e.centerDx,y:r.cy+e.centerDy,datum:r.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight,group:r.datum.id??"_default"})}return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function j(e,t,r,a,n){let l=r.flat[t.flatIndex];if(!l)return B(e,t,r);let o=l.datum?.id;switch(e){case"ArrowRight":case"ArrowLeft":case"ArrowDown":case"ArrowUp":{let a=z(r,l,"ArrowRight"===e?"right":"ArrowLeft"===e?"left":"ArrowDown"===e?"down":"up")??t.flatIndex;return a!==t.flatIndex&&(n.current=-1),a}case"Enter":{if(null==o)return t.flatIndex;let e=W(o,a);if(0===e.length)return t.flatIndex;let l=(n.current+1)%e.length,i=r.idToIdx.get(e[l])??-1;return i>=0?(n.current=-1,i):t.flatIndex}default:{let a=B(e,t,r);return null!==a&&a!==t.flatIndex&&(n.current=-1),a}}}function z(e,t,r){let a=null,n=1/0;for(let l=0;l<e.flat.length;l++){let o=e.flat[l];if(o===t)continue;let i=o.x-t.x,s=o.y-t.y,u=!1;switch(r){case"right":u=i>0&&Math.abs(i)>=Math.abs(s);break;case"left":u=i<0&&Math.abs(i)>=Math.abs(s);break;case"down":u=s>0&&Math.abs(s)>=Math.abs(i);break;case"up":u=s<0&&Math.abs(s)>=Math.abs(i)}if(!u)continue;let c=i*i+s*s;c<n&&(n=c,a=l)}return a}function T(e){return"object"==typeof e&&null!==e&&"id"in e?e.id:e}function W(e,t){let r=String(e),a=[];for(let e of t){let t=e.datum??e,n=T(t.source),l=T(t.target),o=null!=n,i=null!=l;o&&String(n)===r&&i?a.push(String(l)):i&&String(l)===r&&o&&a.push(String(n))}return a}function G(e){let t=[];for(let r of e)if("point"===r.type&&null!=r.x&&!1!==r.interactive)t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle"});else if("glyph"===r.type){if(r.size<=0||null==r.datum)continue;let e=_e(r.glyph,r.size);t.push({x:r.x+e.centerDx,y:r.y+e.centerDy,datum:r.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight})}else if("line"===r.type){if(null==r.datum||r.path.length<2)continue;let e=r.path.slice(1).map((e,t)=>Math.hypot(e[0]-r.path[t][0],e[1]-r.path[t][1])),a=e.reduce((e,t)=>e+t,0)/2;if(!Number.isFinite(a)||a<=0)continue;for(let n=0;n<e.length;n++){let l=e[n];if(l>0&&a<=l){let e=r.path[n],o=r.path[n+1],i=a/l;t.push({x:e[0]+(o[0]-e[0])*i,y:e[1]+(o[1]-e[1])*i,datum:Ae(r.datum),shape:"path",pathData:`M${r.path.map(e=>e.join(",")).join("L")}`});break}a-=l}}else"geoarea"===r.type&&r.centroid&&!1!==r.interactive&&t.push({x:r.centroid[0],y:r.centroid[1],datum:r.datum,shape:"geoarea",pathData:r.pathData});return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function N(e,t,r){switch(e){case"ArrowRight":case"ArrowDown":return t<r-1?t+1:t;case"ArrowLeft":case"ArrowUp":return t>0?t-1:t;case"PageDown":{let e=Math.max(1,Math.floor(.1*r));return Math.min(t+e,r-1)}case"PageUp":{let e=Math.max(1,Math.floor(.1*r));return Math.max(t-e,0)}case"Home":return 0;case"End":return r-1;case"Escape":return-1;default:return null}}function H(e){return{data:e.datum||{},...e.stats&&{stats:e.stats},...null!=e.category&&{category:e.category},x:e.x,y:e.y,__semioticHoverData:!0}}function U(e,t,r){let a=e.current;a.inside=!0,a.clientX=t.clientX,a.clientY=t.clientY,a.pointerType=t.pointerType??r}function q(e,t,r,a,n,l){return U(e,t,l),!(!r&&!a||!r&&"touch"===e.current.pointerType&&(we(n),1))}function V(e){let{title:t,description:r,summary:a,accessibleTable:n,className:l,animate:o,maxDevicePixelRatio:i,axisExtent:s,autoPlaceAnnotations:u}=e,c={};return t&&(c.title=t),r&&(c.description=r),a&&(c.summary=a),void 0!==n&&(c.accessibleTable=n),l&&(c.className=l),null!=o&&(c.animate=o),void 0!==i&&(c.maxDevicePixelRatio=i),void 0!==s&&(c.axisExtent=s),void 0!==u&&(c.autoPlaceAnnotations=u),c}function Y(e){let{linkedHover:t,selection:r,onObservation:a,onClick:n,hoverRadius:l,hoverHighlight:o,forceHoverBehavior:i,forceClickBehavior:s,mobileInteraction:u,customHoverBehavior:c,customClickBehavior:d,linkedHoverInClickPredicate:f=!0}=e,h={};a&&(h.annotationObservationCallback=a);let p=u?.enabled?Math.max(l??30,Math.ceil((u.targetSize||44)/2),24):l;(i||t||a||n||o)&&(h.customHoverBehavior=c);let y=f?a||n||t:a||n,g=u?.enabled&&(u.tapToSelect||u.tapToLockTooltip)&&(t||o||r);return d&&(s||y||g)&&(h.customClickBehavior=d),null!=p&&(h.hoverRadius=p),h}function F(e){let{tooltip:t,defaultTooltipContent:r}=e;return{tooltipContent:!1===t?()=>null:be(t)||r}}function J(e){return void 0!==e.stroke||void 0!==e.strokeWidth||void 0!==e.opacity}function K(e,t){if(!J(t))return e??((...e)=>({}));let r={};return void 0!==t.stroke&&(r.stroke=t.stroke),void 0!==t.strokeWidth&&(r.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(r.opacity=t.opacity),e?(...t)=>({...e(...t)||{},...r}):(...e)=>({...r})}function Z(e,t,r){if(r<=1)return 1;let a=r-1;return ke({age:a-t,extent:a,type:e.type,halfLife:e.halfLife??r/2,threshold:e.stepThreshold??.5*r,minOpacity:e.minOpacity??.1})}function Q(e){let t=/* @__PURE__ */new Map;for(let r=0;r<e.length;r++)t.set(e[r],r);return t}function X(e,t,r,a=Q(r)){let n=r.length;if(!(n<=1))for(let r of t){if("line"===r.type){let t=Array.isArray(r.datum)?r.datum:[];if(t.length<2)continue;let l=new Array(t.length),o=!1;for(let r=0;r<t.length;r++){let i=a.get(t[r]);null!=i?(l[r]=Z(e,i,n),l[r]<1&&(o=!0)):l[r]=1}o&&(r._decayOpacities=l);continue}if("area"===r.type){let t=Array.isArray(r.datum)?r.datum:[],l=r.topPath?r.topPath.length:t.length;if(l<2)continue;if(t.length===l){let o=new Array(l),i=!1;for(let r=0;r<t.length;r++){let l=a.get(t[r]);null!=l?(o[r]=Z(e,l,n),o[r]<1&&(i=!0)):o[r]=1}i&&(r._decayOpacities=o)}else{let o=1;for(let r of t){let t=a.get(r);if(null!=t){let r=Z(e,t,n);r<o&&(o=r)}}if(o<1){let e=new Array(l);e.fill(o),r._decayOpacities=e}}continue}let t=a.get(r.datum);if(null==t)continue;let l=Z(e,t,n);if("candlestick"===r.type)r._decayOpacity=l;else{let e=r.style?.opacity??1;r.style={...r.style,opacity:e*l}}}}function ee(e){if("production"===process.env.NODE_ENV)return;let{label:t,nodes:r,overlays:a,warned:n}=e;te(a)&&0===r.length&&re(n,"overlay-only",`[semiotic] ${t} returned overlays but no data-bearing scene nodes. Overlays do not participate in hover, selection, transitions, SSR evidence, or accessibility tables. Emit at least one scene node with a datum, or mark the overlay-only chart as intentionally decorative.`),r.length>0&&r.every(e=>null==e.datum)&&re(n,"null-datums",`[semiotic] ${t} returned scene nodes, but every scene-node datum is null. Hover, callbacks, selection, and tooltip helpers need data-bearing nodes. Attach a user-facing datum to each interactive node, or set interactive overlays outside the chart.`)}function te(e){return null!=e&&!1!==e&&""!==e&&(!Array.isArray(e)||e.some(te))}function re(e,t,r){e.has(t)||(e.add(t),console.warn(r))}function ae(e){if(e instanceof Error)return{name:e.name||"Error",message:e.message||"Custom layout threw."};if("string"==typeof e)return{name:"Error",message:e};if(null==e)return{name:"Error",message:"Custom layout threw a nullish value."};try{return{name:"Error",message:String(e)}}catch{return{name:"Error",message:"Custom layout threw a non-stringifiable value."}}}function ne(e,t,r,a){let n=ae(t),l="network"===e?"customNetworkLayout":"customLayout";return{code:"CUSTOM_LAYOUT_ERROR",severity:"error",phase:"layout",component:e,source:l,message:`Semiotic ${e} ${l} failed: ${n.message}`,error:n,recovery:r?"preserved-last-good-scene":"empty-scene",preservedLastGoodScene:r,affectedRevision:a}}function le(e){try{return{kind:"success",result:e.run()}}catch(t){let r=e.hasPreviousResult,a=ne(e.family,t,r,e.revision);"production"!==process.env.NODE_ENV&&console.error(`[semiotic] ${e.logLabel} threw:`,t);try{e.onLayoutError?.(a)}catch(e){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",e)}return{kind:"failure",diagnostic:a,preservedLastGoodScene:r}}}function oe(e,t,r,a,n,l){let o=n-r,i=l-a,s=o*o+i*i;if(0===s)return Math.sqrt((e-r)**2+(t-a)**2);let u=((e-r)*o+(t-a)*i)/s;u=Math.max(0,Math.min(1,u));let c=r+u*o,d=a+u*i;return Math.sqrt((e-c)**2+(t-d)**2)}function ie(e,t,r){return e>=r.x&&e<=r.x+r.w&&t>=r.y&&t<=r.y+r.h?{hit:!0,cx:r.x+r.w/2,cy:r.y+r.h/2}:{hit:!1,cx:0,cy:0}}function se(e,t=30){return Math.max((e??4)+5,12,t)}function ue(e){return e instanceof Date?e:"number"==typeof e&&e>1e9?new Date(e):null}function ce(e,t){let r=ue(e);if(!r)return!1;let a=ue(t);return!a||r.getFullYear()!==a.getFullYear()||r.getMonth()!==a.getMonth()}function de(e){let t=e%(2*Math.PI);return t<0&&(t+=2*Math.PI),t}function fe(e,t,r,a,n,l=e=>e.x,o=e=>e.y,i=e=>e.r,s){let u=Math.max(a,n+5,12),c=t-u,d=t+u,f=r-u,h=r+u,p=null,y=1/0;return e.visit((e,n,u,g,m)=>{if(n>d||g<c||u>h||m<f)return!0;let x=e;if(!x.length){let e=x;do{let n=e.data,u=l(n)-t,c=o(n)-r,d=Math.sqrt(u*u+c*c);d<=se(i(n),a)&&(d<y||d===y&&null!==p&&s?.(n,p))&&(p=n,y=d),e=e.next}while(e)}return!1}),p?{node:p,distance:y}:null}function he(e,t){return"string"==typeof e&&e.length>0?e:t}function pe(e,t,r){return"string"==typeof t&&t.length>0?t:"string"==typeof e&&e.length>0?`${e} (${r.familyPhrase})`:r.fallback}function ye(e){let t=String(e).replace(/[^a-zA-Z0-9_-]/g,"_"),r=/^[A-Za-z_]/.test(t)?t:`c${t}`,a=`${r}-semiotic-title`,n=`${r}-semiotic-desc`;return{titleId:a,descId:n,labelledBy:`${a} ${n}`}}import{Aa as ge,Ma as me,Na as xe,Wa as be,d as ve,da as we,h as ke,ha as Me}from"./c-2U5JMOPN.min.js";import{b as Ae}from"./c-4ZSQIBC7.min.js";import{c as Se}from"./c-SSKV5JPW.min.js";import{i as _e}from"./c-RBWJFQDC.min.js";import{jsx as Ie,jsxs as De}from"react/jsx-runtime";import*as Re from"react";import{useEffect as Ee,useRef as Pe}from"react";var Be={fresh:1,aging:.7,stale:.45,expired:.25},$e={alpha:1,band:"fresh",isStale:!1};import{useEffect as Ce,useRef as Le}from"react";import{jsx as Oe}from"react/jsx-runtime";var je={live:"#28a745",stale:"#dc3545",stopped:"#6c757d",failed:"#842029",settling:"#fd7e14"};import{useCallback as ze,useEffect as Te,useRef as We}from"react";var Ge=/* @__PURE__ */new Set,Ne=/* @__PURE__ */new WeakMap,He=class{getLastUpdateResult(){return this.updateResults.last}getUpdateSnapshot(){return this.updateResults.last}subscribeUpdateResult(e){return this.updateResults.subscribe(e)}setLayoutSelection(e){this.config.layoutSelection=e}markStylePaintPending(){Ne.set(this,!0)}consumeStylePaintPending(){let e=!0===Ne.get(this);return Ne.delete(this),e}};export{Z as a,Q as b,X as c,ee as d,le as e,He as f,s as g,u as h,c as i,oe as j,ie as k,se as l,ce as m,de as n,fe as o,d as p,f as q,p as r,e as s,he as t,pe as u,ye as v,g as w,m as x,x as y,b as z,v as A,k as B,_ as C,D,R as E,t as F,r as G,l as H,o as I,i as J,E as K,P as L,B as M,C as N,L as O,O as P,j as Q,G as R,N as S,H as T,q as U,V,Y as W,F as X,K as Y};
8
+ /* @__PURE__ */Ie("div",{style:{marginTop:4},children:a(h,u)}),null!=p&&/* @__PURE__ */De("div",{style:{marginTop:2,opacity:.8},children:[i||t(o),": ",r(p)]})]})}}function s(...e){let t=e.filter(e=>null!=e);return 0===t.length?null:1===t.length?t[0]:Ee.createElement(Ee.Fragment,null,...t)}function u(e,t,r,a){Re(()=>{e.current?.updateConfig(t),r.current=!0,a()},[t,a,e,r])}function c(e,t,r,a){let n=Pe(null);Re(()=>{let l=e.current;if(!l)return;let o=t??null;n.current!==o&&(n.current=o,l.setLayoutSelection(o),l.hasCustomRestyle?l.restyleScene(o):r.current=!0,a())},[t,a,e,r])}function d(e,t){let r=e?.state??(e?.settling?"settling":void 0);if("live"===r)return $e;if("stopped"===r||"failed"===r||"stale"===r)return{alpha:e?.dimOpacity??.5,band:"stale",isStale:!0};if("settling"===r)return{alpha:.85,band:"aging",isStale:!1};if(!(e&&t>0))return $e;let a=null!=e.threshold&&e.threshold>0?e.threshold:5e3,n=e.graded;if(n){let e="object"==typeof n?n:{},r=be(t,a,e.thresholds);return{alpha:{...Be,...e.opacities??{}}[r],band:r,isStale:"fresh"!==r}}return t>a?{alpha:e.dimOpacity??.5,band:"stale",isStale:!0}:$e}function f(e,t,r,a,n,l,o){let i=Le("fresh");Ce(()=>{if(!e)return void(i.current="fresh");let s=setInterval(()=>{let s=t.current;if(!s||0===s.lastIngestTime)return;let u=d(e,n()-s.lastIngestTime);(u.band!==i.current||u.isStale!==l)&&(i.current=u.band,u.isStale!==l&&o(u.isStale),r.current=!0,a())},1e3);return()=>clearInterval(s)},[e,l,a,n,t,o,r])}function h(e,t,r){return t||(r?"settling":e?"stale":"live")}function p({isStale:e,position:t,state:r,settling:a}){let n=h(e,r,a),l=je[n]??je.live,o=Object.hasOwn(je,n)?n.toUpperCase():"LIVE";/* */
9
+ return Oe("div",{className:"stream-staleness-badge",style:{position:"absolute",..."top-left"===t?{top:4,left:4}:"bottom-left"===t?{bottom:4,left:4}:"bottom-right"===t?{bottom:4,right:4}:{top:4,right:4},padding:"2px 8px",borderRadius:4,fontSize:11,fontWeight:600,pointerEvents:"none",zIndex:3,background:l,color:"white"},children:o})}function y(e){let{background:t,hasBackgroundGraphics:r=!1,themeBackground:a=""}=e;return"transparent"===t?null:r?t||null:t||(a&&"transparent"!==a?a:"")||null}function g(e){let{background:t,hasBackgroundGraphics:r=!1,themeBackground:a=""}=e;return"transparent"===t||r?null:t||(a&&"transparent"!==a?a:"")||null}function m(e,t){let{background:r,hasBackgroundGraphics:a=!1,themeBackground:n="",x:l=0,y:o=0,width:i,height:s}=t,u=g({background:r,hasBackgroundGraphics:a,themeBackground:n});if(!u)return!1;let c=Se(e,u);return!(!c||"transparent"===c.trim().toLowerCase()||(e.fillStyle=c,e.fillRect(l,o,i,s),0))}function x(e,t,r,a){return"function"==typeof e?e({size:t,margin:r,scales:a}):e}function b({foregroundGraphics:e,backgroundGraphics:t,size:r,margin:a,scales:n,background:l,themeBackgroundColor:o,resolveScaleAwareGraphics:i=!0}){let s=`var(--semiotic-bg, ${o})`;return{resolvedForeground:i||"function"!=typeof e?x(e,r,a,n):null,resolvedBackground:i||"function"!=typeof t?x(t,r,a,n):null,themeBackground:s,surfaceBackground:y({background:l,hasBackgroundGraphics:!!t,themeBackground:s})}}function v(e,t){if(!t)return[];let r=/* @__PURE__ */new Set,a=[];for(let n of e){if(!n||"object"!=typeof n)continue;let e="function"==typeof t?t(n):n[t],l=String(e);r.has(l)||(r.add(l),a.push(l))}return a}function w(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function k(e,t,r,a){let n=Ge({accessor:t,onChange:r,readData:a}),l=Ge([]);n.current={accessor:t,onChange:r,readData:a};let o=ze(()=>{let{accessor:t,onChange:r,readData:a}=n.current;if(!r||!t)return;let o=v(e.current?a(e.current):[],t);w(o,l.current)||(l.current=o,r(o))},[e]);return Te(()=>{l.current=[],o()},[t,o,r]),o}function M(e){if(!e||"object"!=typeof e)return!1;let t=e;return"string"==typeof t.id&&"function"==typeof t.cacheKey&&"function"==typeof t.drawCanvas&&"function"==typeof t.renderStaticSVG}function S(e,t){let r="function"==typeof e?e(t.datum??null,t):e;return M(r)?r:void 0}function A(e,t){if("production"===process.env.NODE_ENV)return;let r=`${e}:${t}`;Ne.has(r)||(Ne.add(r),console.warn(`[Semiotic] Render backend "${e}" does not support scene node "${t}"; using the built-in renderer.`))}function _(e){let{context:t,nodes:r,renderMode:a,pixelRatio:n,paintBuiltIn:l}=e;if(!a||"sketchy"===a)return void l(r);let o=[],i=()=>{o.length&&(l(o),o=[])};for(let e of r){let r,s=S(a,e);if(s){i(),t.save();try{r=s.drawCanvas({context:t,node:e,style:e.style??{},pixelRatio:n})}finally{t.restore()}r||(A(s.id,e.type??"unknown"),l([e]))}else o.push(e)}i()}function I(e){let{node:t,index:r,renderMode:a,fallback:n}=e,l=S(a,t);if(!l)return{element:n(),renderedByBackend:!1};let o=l.renderStaticSVG({node:t,style:t.style??{},key:`${l.id}-${r}`});return null!=o?{element:ke(o,t,`${l.id}-${r}-cursor`),renderedByBackend:!0}:(A(l.id,t.type??"unknown"),{element:n(),renderedByBackend:!1})}function D(e){return I(e).element}function E(e){let t=[];return e.nodes.forEach((r,a)=>{let n=I({node:r,index:a,renderMode:e.renderMode,fallback:()=>e.fallback(r,a)});null!==n.element&&void 0!==n.element&&!1!==n.element&&t.push({node:r,index:a,...n})}),t}function R(e){let t=/* @__PURE__ */new Map;for(let r of e){let e=r.group??"_default",a=t.get(e);a||(a=[],t.set(e,a)),a.push(r)}for(let e of t.values()){e.sort((e,t)=>e.x-t.x||e.y-t.y);for(let t=0;t<e.length;t++)e[t]._groupIndex=t}let r=Array.from(t.keys()).sort((e,r)=>{let a=t.get(e),n=t.get(r);return(a.length>0?a[0].y:0)-(n.length>0?n[0].y:0)}),a=Array.from(t.values()).flat();a.sort((e,t)=>e.x-t.x||e.y-t.y);let n=/* @__PURE__ */new Map;for(let e=0;e<a.length;e++){a[e]._flatIndex=e;let t=a[e].datum?.id;null!=t&&n.set(String(t),e)}return{flat:a,groups:r,byGroup:t,idToIdx:n}}function P(e,t){if(0===e.flat.length)return{flatIndex:-1,group:"_default",indexInGroup:-1};let r=Math.max(0,Math.min(t,e.flat.length-1)),a=e.flat[r];return{flatIndex:r,group:a.group??"_default",indexInGroup:a._groupIndex??0}}function B(e,t,r){let{group:a,indexInGroup:n}=t,l=r.byGroup.get(a);switch(e){case"ArrowRight":return n<l.length-1?l[n+1]._flatIndex:t.flatIndex;case"ArrowLeft":return n>0?l[n-1]._flatIndex:t.flatIndex;case"ArrowDown":{let e=r.groups.indexOf(a);return e<r.groups.length-1?$(r,r.groups[e+1],l[n]):t.flatIndex}case"ArrowUp":{let e=r.groups.indexOf(a);return e>0?$(r,r.groups[e-1],l[n]):t.flatIndex}case"PageDown":{let e=Math.max(1,Math.floor(.1*r.flat.length));return Math.min(t.flatIndex+e,r.flat.length-1)}case"PageUp":{let e=Math.max(1,Math.floor(.1*r.flat.length));return Math.max(t.flatIndex-e,0)}case"Home":return 0;case"End":return r.flat.length-1;case"Escape":return-1;default:return null}}function $(e,t,r){let a=e.byGroup.get(t),n=0,l=Math.abs(a[0].x-r.x);for(let e=1;e<a.length;e++){let t=Math.abs(a[e].x-r.x);t<l&&(l=t,n=e)}return a[n]._flatIndex}function C(e){let t=[];for(let r of e)switch(r.type){case"point":if(!1===r.interactive)break;t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle",group:"_default"});break;case"symbol":if(r.size<=0)break;t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle",group:"_default"});break;case"glyph":{if(r.size<=0||null==r.datum)break;let e=Ae(r.glyph,r.size);t.push({x:r.x+e.centerDx,y:r.y+e.centerDy,datum:r.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight,group:"_default"});break}case"line":{let e=r,a=Array.isArray(e.datum)?e.datum:[],n=e.group??"_default";for(let r=0;r<e.path.length&&r<a.length;r++)t.push({x:e.path[r][0],y:e.path[r][1],datum:a[r],shape:"circle",group:n});break}case"area":{if(!1===r.interactive)break;let e=r,a=Array.isArray(e.datum)?e.datum:[],n=e.group??"_default";for(let r=0;r<e.topPath.length&&r<a.length;r++)t.push({x:e.topPath[r][0],y:e.topPath[r][1],datum:a[r],shape:"circle",group:n});break}case"rect":t.push({x:r.x+r.w/2,y:r.y+r.h/2,datum:r.datum,shape:"rect",w:r.w,h:r.h,group:r.group??"_default"});break;case"candlestick":{if(null==r.datum)break;let e=r.isRange?r.highY:Math.min(r.openY,r.closeY),a=r.isRange?r.lowY:Math.max(r.openY,r.closeY);t.push({x:r.x,y:(e+a)/2,datum:Me(r.datum),shape:"rect",w:r.bodyWidth,h:Math.abs(a-e),group:"_default"});break}case"heatcell":t.push({x:r.x+r.w/2,y:r.y+r.h/2,datum:r.datum,shape:"rect",w:r.w,h:r.h,group:"_default"})}return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function L(e){let t=[];for(let r of e)if("rect"===r.type&&null!=r.x){if(null==r.datum)continue;let e=r.datum?.category??"";t.push({x:r.x+r.w/2,y:r.y+r.h/2,datum:r.datum,shape:"rect",w:r.w,h:r.h,semanticKey:void 0!==r.datum.__aggregateValue?JSON.stringify([e,r.group??e]):void 0,group:r.group??e})}else if("point"===r.type){if(!1===r.interactive)continue;t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle",group:"_default"})}else if("symbol"===r.type){if(r.size<=0)continue;t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle",group:"_default"})}else if("glyph"===r.type){if(r.size<=0||null==r.datum)continue;let e=Ae(r.glyph,r.size);t.push({x:r.x+e.centerDx,y:r.y+e.centerDy,datum:r.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight,group:"_default"})}else if("boxplot"===r.type){if(null==r.datum)continue;let e="vertical"===r.projection;t.push({x:e?r.x:(r.q1Pos+r.q3Pos)/2,y:e?(r.q1Pos+r.q3Pos)/2:r.y,datum:Me(r.datum),shape:"rect",w:e?r.columnWidth:Math.abs(r.q3Pos-r.q1Pos),h:e?Math.abs(r.q3Pos-r.q1Pos):r.columnWidth,stats:r.stats,category:r.category,group:"_default"})}else if("violin"===r.type&&r.bounds){if(null==r.datum)continue;let{x:e,y:a,width:n,height:l}=r.bounds;t.push({x:e+n/2,y:a+l/2,datum:Me(r.datum),shape:"rect",w:n,h:l,stats:r.stats,category:r.category,group:"_default"})}else if("trapezoid"===r.type){if(null==r.datum||r.points.length<3)continue;t.push({x:r.points.reduce((e,t)=>e+t[0],0)/r.points.length,y:r.points.reduce((e,t)=>e+t[1],0)/r.points.length,datum:Me(r.datum),shape:"path",pathData:`M${r.points.map(e=>e.join(",")).join("L")}Z`,category:r.category,group:"_default"})}else if("connector"===r.type){if(null==r.datum||(r.style.strokeWidth??1)<=0||"none"===r.style.stroke||r.x1===r.x2&&r.y1===r.y2)continue;t.push({x:(r.x1+r.x2)/2,y:(r.y1+r.y2)/2,datum:Me(r.datum),shape:"path",pathData:`M${r.x1},${r.y1}L${r.x2},${r.y2}`,category:r.group,group:r.group??"_default"})}else if("wedge"===r.type&&null!=r.cx){if(null===r.datum)continue;let e=((r.startAngle||0)+(r.endAngle||0))/2,a=((r.innerRadius||0)+(r.outerRadius||50))/2;t.push({x:r.cx+Math.cos(e)*a,y:r.cy+Math.sin(e)*a,datum:r.datum,shape:"wedge",group:"_default"})}return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function O(e){let t=[];for(let r of e)if(r.datum)if("circle"===r.type&&null!=r.cx){if(r.r<=0)continue;t.push({x:r.cx,y:r.cy,datum:r.datum,shape:"circle",group:r.datum.id??"_default"})}else if("rect"===r.type&&null!=r.x){if(r.w<=0||r.h<=0)continue;t.push({x:r.x+r.w/2,y:r.y+r.h/2,datum:r.datum,shape:"rect",w:r.w,h:r.h,group:r.datum.id??"_default"})}else if("arc"===r.type&&null!=r.cx)t.push({x:r.cx,y:r.cy,datum:r.datum,shape:"circle",group:r.datum.id??"_default"});else if("symbol"===r.type&&null!=r.cx){if(r.size<=0)continue;t.push({x:r.cx,y:r.cy,datum:r.datum,shape:"circle",group:r.datum.id??"_default"})}else if("glyph"===r.type&&null!=r.cx){if(r.size<=0)continue;let e=Ae(r.glyph,r.size);t.push({x:r.cx+e.centerDx,y:r.cy+e.centerDy,datum:r.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight,group:r.datum.id??"_default"})}return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function j(e,t,r,a,n){let l=r.flat[t.flatIndex];if(!l)return B(e,t,r);let o=l.datum?.id;switch(e){case"ArrowRight":case"ArrowLeft":case"ArrowDown":case"ArrowUp":{let a=z(r,l,"ArrowRight"===e?"right":"ArrowLeft"===e?"left":"ArrowDown"===e?"down":"up")??t.flatIndex;return a!==t.flatIndex&&(n.current=-1),a}case"Enter":{if(null==o)return t.flatIndex;let e=G(o,a);if(0===e.length)return t.flatIndex;let l=(n.current+1)%e.length,i=r.idToIdx.get(e[l])??-1;return i>=0?(n.current=-1,i):t.flatIndex}default:{let a=B(e,t,r);return null!==a&&a!==t.flatIndex&&(n.current=-1),a}}}function z(e,t,r){let a=null,n=1/0;for(let l=0;l<e.flat.length;l++){let o=e.flat[l];if(o===t)continue;let i=o.x-t.x,s=o.y-t.y,u=!1;switch(r){case"right":u=i>0&&Math.abs(i)>=Math.abs(s);break;case"left":u=i<0&&Math.abs(i)>=Math.abs(s);break;case"down":u=s>0&&Math.abs(s)>=Math.abs(i);break;case"up":u=s<0&&Math.abs(s)>=Math.abs(i)}if(!u)continue;let c=i*i+s*s;c<n&&(n=c,a=l)}return a}function T(e){return"object"==typeof e&&null!==e&&"id"in e?e.id:e}function G(e,t){let r=String(e),a=[];for(let e of t){let t=e.datum??e,n=T(t.source),l=T(t.target),o=null!=n,i=null!=l;o&&String(n)===r&&i?a.push(String(l)):i&&String(l)===r&&o&&a.push(String(n))}return a}function N(e){let t=[];for(let r of e)if("point"===r.type&&null!=r.x&&!1!==r.interactive)t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle"});else if("glyph"===r.type){if(r.size<=0||null==r.datum)continue;let e=Ae(r.glyph,r.size);t.push({x:r.x+e.centerDx,y:r.y+e.centerDy,datum:r.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight})}else if("line"===r.type){if(null==r.datum||r.path.length<2)continue;let e=r.path.slice(1).map((e,t)=>Math.hypot(e[0]-r.path[t][0],e[1]-r.path[t][1])),a=e.reduce((e,t)=>e+t,0)/2;if(!Number.isFinite(a)||a<=0)continue;for(let n=0;n<e.length;n++){let l=e[n];if(l>0&&a<=l){let e=r.path[n],o=r.path[n+1],i=a/l;t.push({x:e[0]+(o[0]-e[0])*i,y:e[1]+(o[1]-e[1])*i,datum:Me(r.datum),shape:"path",pathData:`M${r.path.map(e=>e.join(",")).join("L")}`});break}a-=l}}else"geoarea"===r.type&&r.centroid&&!1!==r.interactive&&t.push({x:r.centroid[0],y:r.centroid[1],datum:r.datum,shape:"geoarea",pathData:r.pathData});return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function W(e,t,r){switch(e){case"ArrowRight":case"ArrowDown":return t<r-1?t+1:t;case"ArrowLeft":case"ArrowUp":return t>0?t-1:t;case"PageDown":{let e=Math.max(1,Math.floor(.1*r));return Math.min(t+e,r-1)}case"PageUp":{let e=Math.max(1,Math.floor(.1*r));return Math.max(t-e,0)}case"Home":return 0;case"End":return r-1;case"Escape":return-1;default:return null}}function H(e){return{data:e.datum||{},...e.stats&&{stats:e.stats},...null!=e.category&&{category:e.category},x:e.x,y:e.y,__semioticHoverData:!0}}function U(e,t,r){let a=e.current;a.inside=!0,a.clientX=t.clientX,a.clientY=t.clientY,a.pointerType=t.pointerType??r}function V(e,t,r,a,n,l){return U(e,t,l),!(!r&&!a||!r&&"touch"===e.current.pointerType&&(ve(n),1))}function q(e){let{title:t,description:r,summary:a,accessibleTable:n,className:l,animate:o,maxDevicePixelRatio:i,axisExtent:s,autoPlaceAnnotations:u}=e,c={};return t&&(c.title=t),r&&(c.description=r),a&&(c.summary=a),void 0!==n&&(c.accessibleTable=n),l&&(c.className=l),null!=o&&(c.animate=o),void 0!==i&&(c.maxDevicePixelRatio=i),void 0!==s&&(c.axisExtent=s),void 0!==u&&(c.autoPlaceAnnotations=u),c}function Y(e){let{linkedHover:t,selection:r,onObservation:a,onClick:n,hoverRadius:l,hoverHighlight:o,forceHoverBehavior:i,forceClickBehavior:s,mobileInteraction:u,customHoverBehavior:c,customClickBehavior:d,linkedHoverInClickPredicate:f=!0}=e,h={};a&&(h.annotationObservationCallback=a);let p=u?.enabled?Math.max(l??30,Math.ceil((u.targetSize||44)/2),24):l;(i||t||a||n||o)&&(h.customHoverBehavior=c);let y=f?a||n||t:a||n,g=u?.enabled&&(u.tapToSelect||u.tapToLockTooltip)&&(t||o||r);return d&&(s||y||g)&&(h.customClickBehavior=d),null!=p&&(h.hoverRadius=p),h}function F(e){let{tooltip:t,defaultTooltipContent:r}=e;return{tooltipContent:!1===t?()=>null:xe(t)||r}}function J(e){return void 0!==e.stroke||void 0!==e.strokeWidth||void 0!==e.opacity}function K(e,t){if(!J(t))return e??((...e)=>({}));let r={};return void 0!==t.stroke&&(r.stroke=t.stroke),void 0!==t.strokeWidth&&(r.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(r.opacity=t.opacity),e?(...t)=>({...e(...t)||{},...r}):(...e)=>({...r})}function X(e,t,r){if(r<=1)return 1;let a=r-1;return we({age:a-t,extent:a,type:e.type,halfLife:e.halfLife??r/2,threshold:e.stepThreshold??.5*r,minOpacity:e.minOpacity??.1})}function Z(e){let t=/* @__PURE__ */new Map;for(let r=0;r<e.length;r++)t.set(e[r],r);return t}function Q(e,t,r,a=Z(r)){let n=r.length;if(!(n<=1))for(let r of t){if("line"===r.type){let t=Array.isArray(r.datum)?r.datum:[];if(t.length<2)continue;let l=new Array(t.length),o=!1;for(let r=0;r<t.length;r++){let i=a.get(t[r]);null!=i?(l[r]=X(e,i,n),l[r]<1&&(o=!0)):l[r]=1}o&&(r._decayOpacities=l);continue}if("area"===r.type){let t=Array.isArray(r.datum)?r.datum:[],l=r.topPath?r.topPath.length:t.length;if(l<2)continue;if(t.length===l){let o=new Array(l),i=!1;for(let r=0;r<t.length;r++){let l=a.get(t[r]);null!=l?(o[r]=X(e,l,n),o[r]<1&&(i=!0)):o[r]=1}i&&(r._decayOpacities=o)}else{let o=1;for(let r of t){let t=a.get(r);if(null!=t){let r=X(e,t,n);r<o&&(o=r)}}if(o<1){let e=new Array(l);e.fill(o),r._decayOpacities=e}}continue}let t=a.get(r.datum);if(null==t)continue;let l=X(e,t,n);if("candlestick"===r.type)r._decayOpacity=l;else{let e=r.style?.opacity??1;r.style={...r.style,opacity:e*l}}}}function ee(e){if("production"===process.env.NODE_ENV)return;let{label:t,nodes:r,overlays:a,warned:n}=e;te(a)&&0===r.length&&re(n,"overlay-only",`[semiotic] ${t} returned overlays but no data-bearing scene nodes. Overlays do not participate in hover, selection, transitions, SSR evidence, or accessibility tables. Emit at least one scene node with a datum, or mark the overlay-only chart as intentionally decorative.`),r.length>0&&r.every(e=>null==e.datum)&&re(n,"null-datums",`[semiotic] ${t} returned scene nodes, but every scene-node datum is null. Hover, callbacks, selection, and tooltip helpers need data-bearing nodes. Attach a user-facing datum to each interactive node, or set interactive overlays outside the chart.`)}function te(e){return null!=e&&!1!==e&&""!==e&&(!Array.isArray(e)||e.some(te))}function re(e,t,r){e.has(t)||(e.add(t),console.warn(r))}function ae(e){if(e instanceof Error)return{name:e.name||"Error",message:e.message||"Custom layout threw."};if("string"==typeof e)return{name:"Error",message:e};if(null==e)return{name:"Error",message:"Custom layout threw a nullish value."};try{return{name:"Error",message:String(e)}}catch{return{name:"Error",message:"Custom layout threw a non-stringifiable value."}}}function ne(e,t,r,a){let n=ae(t),l="network"===e?"customNetworkLayout":"customLayout";return{code:"CUSTOM_LAYOUT_ERROR",severity:"error",phase:"layout",component:e,source:l,message:`Semiotic ${e} ${l} failed: ${n.message}`,error:n,recovery:r?"preserved-last-good-scene":"empty-scene",preservedLastGoodScene:r,affectedRevision:a}}function le(e){try{return{kind:"success",result:e.run()}}catch(t){let r=e.hasPreviousResult,a=ne(e.family,t,r,e.revision);"production"!==process.env.NODE_ENV&&console.error(`[semiotic] ${e.logLabel} threw:`,t);try{e.onLayoutError?.(a)}catch(e){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",e)}return{kind:"failure",diagnostic:a,preservedLastGoodScene:r}}}function oe(e,t,r,a,n,l){let o=n-r,i=l-a,s=o*o+i*i;if(0===s)return Math.sqrt((e-r)**2+(t-a)**2);let u=((e-r)*o+(t-a)*i)/s;u=Math.max(0,Math.min(1,u));let c=r+u*o,d=a+u*i;return Math.sqrt((e-c)**2+(t-d)**2)}function ie(e,t,r){return e>=r.x&&e<=r.x+r.w&&t>=r.y&&t<=r.y+r.h?{hit:!0,cx:r.x+r.w/2,cy:r.y+r.h/2}:{hit:!1,cx:0,cy:0}}function se(e,t=30){return Math.max((e??4)+5,12,t)}function ue(e){return e instanceof Date?e:"number"==typeof e&&e>1e9?new Date(e):null}function ce(e,t){let r=ue(e);if(!r)return!1;let a=ue(t);return!a||r.getFullYear()!==a.getFullYear()||r.getMonth()!==a.getMonth()}function de(e){let t=e%(2*Math.PI);return t<0&&(t+=2*Math.PI),t}function fe(e,t,r,a,n,l=e=>e.x,o=e=>e.y,i=e=>e.r,s){let u=Math.max(a,n+5,12),c=t-u,d=t+u,f=r-u,h=r+u,p=null,y=1/0;return e.visit((e,n,u,g,m)=>{if(n>d||g<c||u>h||m<f)return!0;let x=e;if(!x.length){let e=x;do{let n=e.data,u=l(n)-t,c=o(n)-r,d=Math.sqrt(u*u+c*c);d<=se(i(n),a)&&(d<y||d===y&&null!==p&&s?.(n,p))&&(p=n,y=d),e=e.next}while(e)}return!1}),p?{node:p,distance:y}:null}function he(e,t){return"string"==typeof e&&e.length>0?e:t}function pe(e,t,r){return"string"==typeof t&&t.length>0?t:"string"==typeof e&&e.length>0?`${e} (${r.familyPhrase})`:r.fallback}function ye(e){let t=String(e).replace(/[^a-zA-Z0-9_-]/g,"_"),r=/^[A-Za-z_]/.test(t)?t:`c${t}`,a=`${r}-semiotic-title`,n=`${r}-semiotic-desc`;return{titleId:a,descId:n,labelledBy:`${a} ${n}`}}import{Ia as ge,Ja as me,Sa as xe,d as be,ea as ve,h as we,ia as ke}from"./c-XCV7VUU3.min.js";import{b as Me}from"./c-NVSINXE5.min.js";import{c as Se}from"./c-SSKV5JPW.min.js";import{i as Ae}from"./c-RBWJFQDC.min.js";import{l as _e}from"./c-5FUOKMH6.min.js";import{jsx as Ie,jsxs as De}from"react/jsx-runtime";import*as Ee from"react";import{useEffect as Re,useRef as Pe}from"react";var Be={fresh:1,aging:.7,stale:.45,expired:.25},$e={alpha:1,band:"fresh",isStale:!1};import{useEffect as Ce,useRef as Le}from"react";import{jsx as Oe}from"react/jsx-runtime";var je={live:"#28a745",stale:"#dc3545",stopped:"#6c757d",failed:"#842029",settling:"#fd7e14"};import{useCallback as ze,useEffect as Te,useRef as Ge}from"react";var Ne=/* @__PURE__ */new Set,We=/* @__PURE__ */new WeakMap,He=class{getLastUpdateResult(){return this.updateResults.last}getUpdateSnapshot(){return this.updateResults.last}subscribeUpdateResult(e){return this.updateResults.subscribe(e)}setLayoutSelection(e){this.config.layoutSelection=e}markStylePaintPending(){We.set(this,!0)}consumeStylePaintPending(){let e=!0===We.get(this);return We.delete(this),e}};export{X as a,Z as b,Q as c,ee as d,le as e,He as f,s as g,u as h,c as i,oe as j,ie as k,se as l,ce as m,de as n,fe as o,d as p,f as q,p as r,e as s,he as t,pe as u,ye as v,g as w,m as x,x as y,b as z,v as A,k as B,_ as C,D,E,t as F,r as G,l as H,o as I,i as J,R as K,P as L,B as M,C as N,L as O,O as P,j as Q,N as R,W as S,H as T,V as U,q as V,Y as W,F as X,K as Y};
@@ -0,0 +1,34 @@
1
+ import{b as e}from"./c-QP3PXK3N.min.js";import{b as t}from"./c-XI6CLZII.min.js";import{a as i}from"./c-7FKPPCGN.min.js";import{b as r}from"./c-ONL3ELK2.min.js";import{a as n,b as a,d as o,e as s,h as l,i as c,j as u,k as h,n as d}from"./c-VI753KBO.min.js";import{a as p}from"./c-BKL6GCDN.min.js";import{a as f,b as g}from"./c-BYJJ7EMG.min.js";import{a as m}from"./c-3DHY6CIP.min.js";import{B as y,C as v,D as b,G as w,U as R,V as P,W as x,a as S,d as k,e as C,f as L,g as A,h as j,i as D,j as M,l as T,o as B,q as I,r as _,s as E,t as N,u as F,v as O,x as z,y as W,z as H}from"./c-C5GXUHUO.min.js";import{d as G}from"./c-3KOWSG3J.min.js";import{c as q}from"./c-IU4QZ7Y5.min.js";import{a as $,b as Z}from"./c-RDM36RTX.min.js";import{A as U,Aa as X,Ca as Y,Da as Q,E as K,Ea as V,Fa as J,G as ee,Ga as te,Ha as ie,J as re,K as ne,Ka as ae,Q as oe,Sa as se,Ta as le,U as ce,W as ue,Xa as he,Y as de,_a as pe,b as fe,ca as ge,da as me,ea as ye,ga as ve,ha as be,ia as we,ja as Re,k as Pe,ka as xe,l as Se,m as ke,ma as Ce,na as Le,o as Ae,ta as je,va as De,xa as Me,za as Te}from"./c-XCV7VUU3.min.js";import{a as Be}from"./c-NVSINXE5.min.js";import{p as Ie}from"./c-ZOE7TAR3.min.js";import{c as _e,i as Ee,k as Ne,r as Fe}from"./c-SSKV5JPW.min.js";import{i as Oe}from"./c-RBWJFQDC.min.js";import{e as ze,k as We,l as He,p as Ge,q as qe}from"./c-5FUOKMH6.min.js";import{a as $e,b as Ze,c as Ue,d as Xe}from"./c-ESCEKIUO.min.js";import{c as Ye}from"./c-3PFVJFBK.min.js";import{forwardRef as Qe,memo as Ke,useCallback as Ve,useEffect as Je,useMemo as et,useRef as tt,useState as it}from"react";import{geoPath as rt}from"d3-geo";import{quadtree as nt}from"d3-quadtree";import{geoMercator as at,geoEqualEarth as ot,geoAlbersUsa as st,geoOrthographic as lt,geoNaturalEarth1 as ct,geoEquirectangular as ut}from"d3-geo";var ht={mercator:at,equalEarth:ot,albersUsa:st,orthographic:lt,naturalEarth:ct,equirectangular:ut};function dt(e){if(!e)return ot();if("string"==typeof e){let t=ht[e];return t?t():("production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Unknown projection "${e}", falling back to equalEarth`),ot())}if("object"==typeof e&&"type"in e){let t=ht[e.type],i=t?t():ot();return e.rotate&&"rotate"in i&&i.rotate(e.rotate),e.center&&"center"in i&&i.center(e.center),i}return e}function pt(e,t){return e?"function"==typeof e?e:t=>t[e]:e=>e[t]}function ft(e){return e?"function"==typeof e?e:t=>t[e]:e=>e.coordinates||e.data||[]}function gt(e,t,i){return e?"function"==typeof e?{...i,...e(t)}:{...i,...e}:{...i}}function mt(e){return{fill:e.themeSemantic?.surface||"#e0e0e0",stroke:e.themeSemantic?.border||"#999",strokeWidth:.5,fillOpacity:1}}function yt(e){return{fill:e.themeSemantic?.primary||"#4e79a7",r:4,fillOpacity:.8}}function vt(e){return{stroke:e.themeSemantic?.primary||"#4e79a7",strokeWidth:1.5,fill:"none"}}function bt(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 wt(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 Rt(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 Pt(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]]}import{scaleLinear as xt}from"d3-scale";function St(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=Ye(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?Ct(n,u,c,d,i):kt(n,u,c,d,o,i),f=e.filter(e=>"line"===e.type);if(f.length>0){let e=/* @__PURE__ */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}function kt(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=xt().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"}}function Ct(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=xt().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"}}var Lt=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],At=["scene-style","data-paint","accessibility","evidence"],jt=(e,t)=>({retainedData:e,invalidations:t}),Dt=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Mt=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Tt=["scene-geometry","data-paint","accessibility","evidence"],Bt=["scene-style","data-paint","accessibility","evidence"],It=["scene-geometry","scene-style","data-paint","accessibility","evidence"],_t=["overlay","accessibility","evidence"],Et=[],Nt={xAccessor:/* @__PURE__ */jt("rebuild",Dt),yAccessor:/* @__PURE__ */jt("rebuild",Dt),lineDataAccessor:/* @__PURE__ */jt("rebuild",Dt),pointIdAccessor:/* @__PURE__ */jt("rebuild",Tt),lineIdAccessor:/* @__PURE__ */jt("rebuild",Tt),windowSize:/* @__PURE__ */jt("rebuild",Dt),projection:/* @__PURE__ */jt("preserve",Mt),projectionExtent:/* @__PURE__ */jt("preserve",Mt),fitPadding:/* @__PURE__ */jt("preserve",Mt),lineType:/* @__PURE__ */jt("preserve",Mt),flowStyle:/* @__PURE__ */jt("preserve",Mt),graticule:/* @__PURE__ */jt("preserve",Mt),projectionTransform:/* @__PURE__ */jt("preserve",Mt),customLayout:/* @__PURE__ */jt("preserve",Mt),layoutConfig:/* @__PURE__ */jt("preserve",Mt),layoutMargin:/* @__PURE__ */jt("preserve",Mt),areaStyle:/* @__PURE__ */jt("preserve",Bt),pointStyle:/* @__PURE__ */jt("preserve",It),lineStyle:/* @__PURE__ */jt("preserve",Bt),colorScheme:/* @__PURE__ */jt("preserve",Bt),themeCategorical:/* @__PURE__ */jt("preserve",Bt),themeDiverging:/* @__PURE__ */jt("preserve",Bt),themeSemantic:/* @__PURE__ */jt("preserve",Bt),themeSequential:/* @__PURE__ */jt("preserve",Bt),decay:/* @__PURE__ */jt("preserve",Bt),pulse:/* @__PURE__ */jt("preserve",Bt),layoutSelection:/* @__PURE__ */jt("preserve",Bt),annotations:/* @__PURE__ */jt("preserve",_t),autoPlaceAnnotations:/* @__PURE__ */jt("preserve",_t),clock:/* @__PURE__ */jt("preserve",Et),transition:/* @__PURE__ */jt("preserve",Et),introAnimation:/* @__PURE__ */jt("preserve",Et),onLayoutError:/* @__PURE__ */jt("preserve",Et)},Ft=/* @__PURE__ */jt("preserve",Mt);function Ot(e){let t="preserve",i=/* @__PURE__ */new Set;for(let r of e){let e=Nt[r]??Ft;"rebuild"===e.retainedData&&(t="rebuild");for(let t of e.invalidations)i.add(t)}return{retainedData:t,invalidations:i}}var zt=class{constructor(){this.tracker=new Se}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}},Lt)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},At):this.recordNoop("restyle")}recordConfig(e,t={}){let i=Ot(e),r=new Set(i.invalidations);return t.retainedDataChanged&&r.add("data"),this.tracker.record({kind:"config",keys:e},r)}};import{geoDistance as Wt,geoGraticule as Ht,geoInterpolate as Gt}from"d3-geo";function qt({config:e,projection:t,path:i,areas:r,points:n,lines:a,layout:o}){let s=pt(e.xAccessor,"lon"),l=pt(e.yAccessor,"lat"),c=[],u=mt(e),h=vt(e),d=yt(e);if(e.graticule){let t=!0===e.graticule?{}:e.graticule,r=Ht();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:gt(e.areaStyle,t,u),datum:t,interactive:!0})}let p=ft(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=Wt(r,a)||0,s=Math.max(2,Math.ceil(o/(Math.PI/180))),l=Gt(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=gt(e.lineStyle,i,h),u="number"==typeof a.strokeWidth?a.strokeWidth:1;2===r.length&&n.length>=2&&"arc"===e.flowStyle?n=wt(n[0],n[n.length-1]):2===r.length&&n.length>=2&&"offset"===e.flowStyle&&(n="geo"===e.lineType?Rt(n,u):Pt(n[0],n[n.length-1],0,0,u));let d=bt(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 of n){let r=s(i),n=l(i);if(null!=m&&Wt([r,n],b)>m)continue;let a=t([r,n]);if(!a)continue;let o=e.pointStyle?e.pointStyle(i):{...d},u={type:"point",x:a[0],y:a[1],r:o.r||4,style:o,datum:i,pointId:f?String(f(i)):void 0};c.push(u)}return c}function $t(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 Zt=class extends L{constructor(e){var t;super(),this.updateResults=new zt,this.scene=[],this.scales=null,this.version=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutDiagnosticsWarned=/* @__PURE__ */new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */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=(t=e,{...t,fitPadding:$t(t.fitPadding)})}currentTime(){return this.config.clock?.()??Xe()}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="fitPadding"in(a=e)?{...a,fitPadding:$t(a.fitPadding)}:a,i=this.config,r=this.getConfiguredWindowSize(),n=Object.keys(t).filter(e=>t[e]!==i[e]);var a;this.config={...this.config,...t};let o=this.getConfiguredWindowSize(),s=this.streaming&&o!==r;s&&(this.resizeStreamingWindow(o),this.version++),"customLayout"in t&&!t.customLayout&&(this.lastCustomLayoutFailure=null),this.updateResults.recordConfig(n,{retainedDataChanged:s})}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();l(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)l(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)));c(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=/* @__PURE__ */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)}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=dt(t.projection),this.geoPath=rt(this.projection),this.fitProjection(e),this.geoPath=rt(this.projection);let c=this.projection;this.scales={projection:c,geoPath:this.geoPath,projectedPoint:(e,t)=>c([e,t]),invertedPoint:(e,t)=>c.invert?c.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;let u=this.buildSceneNodes(e);if(this._customLayoutFailedThisBuild)!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.projection=i,this.geoPath=r,this.scales=n,this.baseScale=a,this.baseTranslate=o,this.baseRotation=s):(this.scene=[],this.rebuildQuadtree());else{if(this.scene=u,this.rebuildQuadtree(),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=pt(i.xAccessor,"lon"),a=pt(i.yAccessor,"lat"),o=this.getPoints();if(o.length>0){let e=o.map(e=>[n(e),a(e)]);r.push({type:"Feature",properties:{},geometry:{type:"MultiPoint",coordinates:e}})}let s=ft(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)}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=rt(i),this.scales={projection:i,geoPath:this.geoPath,projectedPoint:(e,t)=>i([e,t]),invertedPoint:(e,t)=>i.invert?i.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;let l=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(i.scale(a),i.translate(o),this.currentZoom=s,this.geoPath=r,this.scales=n):(this.scene=[],this.rebuildQuadtree()):(this.scene=l,this.rebuildQuadtree(),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=rt(i),this.scales={projection:i,geoPath:this.geoPath,projectedPoint:(e,t)=>i([e,t]),invertedPoint:(e,t)=>i.invert?i.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;let l=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(i.scale(a),i.translate(o),this.currentZoom=s,this.geoPath=r,this.scales=n):(this.scene=[],this.rebuildQuadtree()):(this.scene=l,this.rebuildQuadtree(),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=rt(i),this.scales={projection:i,geoPath:this.geoPath,projectedPoint:(e,t)=>i([e,t]),invertedPoint:(e,t)=>i.invert?i.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;let o=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(i.rotate(a),this.geoPath=r,this.scales=n):(this.scene=[],this.rebuildQuadtree()):(this.scene=o,this.rebuildQuadtree(),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=nt().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=C({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=/* @__PURE__ */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=/* @__PURE__ */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 k({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=/* @__PURE__ */new WeakMap,qt({config:t,projection:i,path:r,areas:this.areas,points:this.getPoints(),lines:this.lineData,layout:e})}applyCartogramTransform(e,t){let i=St(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);for(let r=0;r<i.length;r++){let n=S(e,r,t);i[r]._decayOpacity=n,i[r].style={...i[r].style,opacity:n}}}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=t.color||"rgba(255,255,255,0.6)",s=t.glowRadius??4,l=!1;for(let c=0;c<i.length&&c<r.length;c++){let u=a(t,r[c],e);l=o(i[c],u,n,s)||l}return l}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(e)}hasActivePulsesAt(e){return!!this.config.pulse&&s(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=/* @__PURE__ */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=Ze(e,this.activeTransition),i=$e(t),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=Ue(t,e._targetX,i),e.y=Ue(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}};import{useCallback as Ut,useImperativeHandle as Xt}from"react";import{select as Yt}from"d3-selection";import{zoomIdentity as Qt}from"d3-zoom";function Kt(e,{storeRef:t,dirtyRef:i,scheduleRender:r,zoomTransformRef:n,containerRef:a,zoomBehaviorRef:o}){let s=Ut(e=>{null==e||"object"!=typeof e||(t.current?.pushPoint(e),i.current=!0,r())},[t,i,r]),l=Ut(e=>{let n=fe(e);0!==n.length&&(t.current?.pushMany(n),i.current=!0,r())},[t,i,r]),c=Ut(e=>{null==e||"object"!=typeof e||(t.current?.pushLine(e),i.current=!0,r())},[t,i,r]),u=Ut(e=>{let n=fe(e);0!==n.length&&(t.current?.pushManyLines(n),i.current=!0,r())},[t,i,r]),h=Ut(()=>{t.current?.clear(),i.current=!0,r()},[t,i,r]);Xt(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&&Yt(e).call(o.current.transform,Qt)},getData:()=>t.current?.getPoints()??[]}),[s,l,c,u,h,r,t,i,n,a,o])}function Vt(e,t,i,r,n,a,o=0,s=r){if(a){let e=B(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<=T(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=Oe(n.glyph,n.size),a=n.x+e.centerDx-t,o=n.y+e.centerDy-i,s=Math.sqrt(a*a+o*o);s<=T(e.radius,r)&&s<c&&(l=n,c=s)}if(l)return{node:l,distance:c};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}}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=M(t,i,f,g,m,y);v<=a&&v<h&&(u=e,h=v)}}return u?{node:u,distance:h}:null}import{useMemo as Jt,useRef as ei,useId as ti}from"react";import{jsx as ii,jsxs as ri}from"react/jsx-runtime";function ni(e){let{width:t,height:i,totalWidth:r,totalHeight:n,margin:a,showAxes:o,title:s,description:l,idPrefix:c,legend:u,legendHoverBehavior:h,legendClickBehavior:d,legendHighlightedCategory:p,legendIsolatedCategories:f,legendPosition:g,legendLayout:m,foregroundGraphics:y,annotations:v,onAnnotationActivate:b,onObservation:w,chartId:R,chartType:P,autoPlaceAnnotations:x,svgAnnotationRules:S,pointNodes:k,geoProjection:C}=e,L=K({onAnnotationActivate:b,onObservation:w,chartId:R,chartType:P}),A=ei([v?.length??0,/* @__PURE__ */new Map]),j=v?.length??0;A.current[0]!==j&&(A.current=[j,/* @__PURE__ */new Map]);let D=Jt(()=>{if(!v||0===v.length)return null;let e=E(v),r=C?e.map(e=>{if(!Array.isArray(e.coordinates)||e.coordinates.length<2)return e;let t=C(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:k,stickyPositionCache:A.current[1]},a=x?oe({annotations:r,context:n,..."object"==typeof x?x:{}}):r;return re(a,ne("xy",L),S,n)},[v,x,S,t,i,k,L,C]),M=o||s||l||u||y||D&&D.length>0,T=ti(),{titleId:B,descId:I,labelledBy:_}=O(c||R||T);return M?/* @__PURE__ */ri("svg",{role:"img","aria-labelledby":_,width:r,height:n,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[
2
+ /* @__PURE__ */ii("title",{id:B,children:N(s,"Geographic chart")}),
3
+ /* @__PURE__ */ii("desc",{id:I,children:F(s,l,{familyPhrase:"geographic data visualization",fallback:"geographic data visualization"})}),
4
+ /* @__PURE__ */ri("g",{transform:"translate("+a.left+","+a.top+")",children:[D,y]}),
5
+ /* @__PURE__ */ii(ce,{title:s,totalWidth:r,marginTop:a.top}),U({legend:u,totalWidth:r,totalHeight:n,margin:a,legendPosition:g,title:s,legendLayout:m,legendHoverBehavior:h,legendClickBehavior:d,legendHighlightedCategory:p,legendIsolatedCategories:f})]}):null}import*as ai from"react";import{jsx as oi,jsxs as si}from"react/jsx-runtime";function li(e,t){return we(ci(e,t),e,`geo-cursor-${t}`)}function ci(e,t){switch(e.type){case"geoarea":{let i=e;if(!i.pathData)return null;let r=Ee(i.style.fill)?Ne(i.style.fill,`geoarea-${t}-hatch`):void 0;/* */
6
+ return si(ai.Fragment,{children:[r&&/* @__PURE__ */oi("defs",{children:r}),
7
+ /* @__PURE__ */oi("path",{d:i.pathData,fill:r?`url(#geoarea-${t}-hatch)`:ue(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=Ee(i.style.fill)?Ne(i.style.fill,`geopoint-${t}-hatch`):void 0;/* */
8
+ return si(ai.Fragment,{children:[r&&/* @__PURE__ */oi("defs",{children:r}),
9
+ /* @__PURE__ */oi("circle",{cx:i.x,cy:i.y,r:i.r,fill:r?`url(#geopoint-${t}-hatch)`:ue(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");/* */
10
+ return oi("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 de(i,i.x,i.y,`geo-glyph-${i.pointId??t}`)}default:return null}}import{zoom as ui,zoomIdentity as hi}from"d3-zoom";import{select as di}from"d3-selection";function pi(e,t,i,r){let n=t.filter(e=>"geoarea"===e.type);for(let t of n){if(!t.pathData)continue;t._cachedPath2D||(t._cachedPath2D=new Path2D(t.pathData));let i=t._cachedPath2D,r=Fe(e,t.style.fill)||"#e0e0e0";"none"!==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=_e(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([])}}function fi(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}}function gi([e,t,i]){let r=1<<i;return[e-Math.floor(e/r)*r,t,i]}function mi(e,t,i,r,n){return"function"==typeof e?e(t,i,r,n):e.replace("{z}",String(t)).replace("{x}",String(i)).replace("{y}",String(r)).replace("{r}",n>1?"@2x":"")}var yi=/* @__PURE__ */new WeakMap,vi=1;function bi(e){if("string"==typeof e)return`template:${e}`;let t=e,i=yi.get(t);return null==i&&(i=vi++,yi.set(t,i)),`provider:${i}`}function wi(e){return Number.isFinite(e)?Math.max(1,Math.floor(e)):256}var Ri=class{constructor(e=256){this.cache=/* @__PURE__ */new Map,this.limit=wi(e)}setLimit(e){this.limit=wi(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()}};function Pi(e,t){let{tileURL:i,projection:r,width:n,height:a,tileCache:o,onTileLoad:s,maxDevicePixelRatio:l}=t,c=r.scale(),u=r.translate(),h=fi({size:[n,a],scale:2*c*Math.PI,translate:u}),d=J(l,[n,a]),p=bi(i),f=!0;for(let t of h.tiles){let[r,n,a]=gi(t),l=mi(i,a,r,n,d),c=`${p}|dpr:${d}|${a}/${r}/${n}|${l}`,u=o.get(c);if(!u){let e=new Image;e.crossOrigin="anonymous";let t={img:e,loaded:!1,failed:!1,key:c,lastUsed:performance.now()};o.set(c,t),e.onload=()=>{t.loaded=!0,s?.()},e.onerror=()=>{t.loaded=!0,t.failed=!0,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)}return f}var xi=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=Si(o),l=ki(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 Si(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 ki(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 Ci(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=Oe(e.glyph,e.size);t.push({pointId:e.pointId,x:e.x+r.centerDx,y:e.y+r.centerDy,r:r.radius})}return t}import{jsx as Li,jsxs as Ai}from"react/jsx-runtime";var ji=/* @__PURE__ */Ge(function({data:e}){if(!e)return null;if(e.properties){let t=e.properties.name||e.properties.NAME||e.properties.id||"Feature";/* */
11
+ return Li("div",{className:"semiotic-tooltip",style:He,children:/* @__PURE__ */Li("div",{style:{fontWeight:600},children:t})})}let t=null!=e.data?e.data:e;if(!t||"object"!=typeof t)return null;let i=ae(t),r=null!=i.title?String(i.title):null;return null==r&&0===i.entries.length?null:/* @__PURE__ */Ai("div",{className:"semiotic-tooltip",style:He,children:[null!=r&&/* @__PURE__ */Li("div",{style:{fontWeight:600,marginBottom:i.entries.length?2:0},children:r}),i.entries.map(e=>/* @__PURE__ */Ai("div",{children:[
12
+ /* @__PURE__ */Ai("span",{style:{opacity:.7},children:[e.key,": "]}),
13
+ /* @__PURE__ */Li("span",{style:{fontWeight:600},children:w(e.value)})]},e.key))]})}),Di={top:10,right:10,bottom:10,left:10},Mi=null;function Ti(){if(null!==Mi)return Mi;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 Mi=e||t||i}function Bi(){return Ti()?12:30}var Ii={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 _i(e){return"string"==typeof e?e:"object"==typeof e&&e&&"type"in e?e.type:null}function Ei(e){return e?e.getContext("2d"):null}function Ni(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=Ei(e.hitCanvasRef.current);if(!r)return{kind:"unavailable"};let n=Vt(e.scene,t,i,Be(30,e.pointer.pointerType),r,e.pointQuadtree,e.maxPointRadius,Be(6,e.pointer.pointerType));if(!n)return{kind:"miss"};let{node:a}=n,o=a.datum,s=Array.isArray(o)?null:o?.properties?o:o?.data||o,l="point"===a.type?a.x:"geoarea"===a.type?a.centroid[0]:t,c="point"===a.type?a.y:"geoarea"===a.type?a.centroid[1]:i;return{kind:"hit",node:a,hover:{...s,...s?.properties||{},data:s,properties:s?.properties,__semioticHoverData:!0,x:l,y:c}}}import*as Fi from"react";import{useSyncExternalStore as Oi}from"react";function zi(e){let t=/* @__PURE__ */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()}}}}function Wi({graphics:e,size:t,margin:i,readScales:r,tracker:n}){return Oi(n.subscribe,n.getSnapshot,n.getSnapshot),Fi.createElement(Fi.Fragment,null,W(e,t,i,r()))}function Hi({tracker:e,readScales:t,...i}){let r=r=>"function"==typeof r?Fi.createElement(Wi,{graphics:r,size:i.size,margin:i.margin,readScales:t,tracker:e}):r;return{...H({...i,resolveScaleAwareGraphics:!1}),resolvedForeground:r(i.foregroundGraphics),resolvedBackground:r(i.backgroundGraphics)}}import{jsx as Gi,jsxs as qi}from"react/jsx-runtime";var $i=/* @__PURE__ */he(/* @__PURE__ */Ke(
14
+ /* @__PURE__ */Qe(function(e,t){let{projection:n,projectionExtent:a,fitPadding:o,projectionTransform:s,areas:l,points:c,lines:w,customLayout:P,layoutConfig:x,layoutSelection:S,onLayoutError:k,xAccessor:C,yAccessor:L,lineDataAccessor:M,pointIdAccessor:T,lineIdAccessor:B,lineType:E="geo",flowStyle:N="basic",graticule:F,zoomable:O,zoomExtent:W,onZoom:H,dragRotate:G,showParticles:$,particleStyle:Z,tileURL:U,tileAttribution:K,tileCacheSize:re,size:ne,width:ae,height:oe,responsiveWidth:se,responsiveHeight:ce,margin:ue,className:he,background:de,maxDevicePixelRatio:pe,runtimeMode:we,windowSize:Se=500,renderMode:Ie,areaStyle:_e,pointStyle:Ee,lineStyle:Ne,colorScheme:Fe,enableHover:Oe=!0,hoverAnnotation:He,tooltipContent:Ge,allowTooltipOverflow:$e=!1,customClickBehavior:Ze,customHoverBehavior:Ue,onObservation:Xe,annotationObservationCallback:Ye,chartId:Qe,annotations:Ke,onAnnotationActivate:rt,autoPlaceAnnotations:nt,svgAnnotationRules:at,decay:ot,pulse:st,transition:lt,animate:ct,staleness:ut,frameScheduler:ht,clock:dt,random:pt,seed:ft,paused:gt=!1,suspendWhenHidden:mt=!0,backgroundGraphics:yt,foregroundGraphics:vt,title:bt,legend:wt,legendPosition:Rt,legendLayout:Pt,legendHoverBehavior:xt,legendClickBehavior:St,legendHighlightedCategory:kt,legendIsolatedCategories:Ct,legendCategoryAccessor:Lt,onCategoriesChange:At,showAxes:jt,accessibleTable:Dt=!0,description:Mt,summary:Tt}=e,{customHoverBehavior:Bt,customClickBehavior:It,hasClickBehavior:_t}=h({customHoverBehavior:Ue,customClickBehavior:Ze,onObservation:Xe,chartId:Qe,chartType:"StreamGeoFrame"}),Et=ne||[ae||600,oe||400],Nt=tt(!0),Ft=Y({sizeProp:Et,responsiveWidth:se,responsiveHeight:ce,userMargin:ue,marginDefault:Di,title:bt,legend:wt,legendPosition:Rt,legendLayout:Pt,legendMarginReserved:e.__legendMarginReservedFor===wt,animate:ct,transitionProp:lt,frameScheduler:ht,clock:dt,random:pt,seed:ft,paused:gt,suspendWhenHidden:mt,themeDirtyRef:Nt}),{reducedMotionRef:Ot,responsiveRef:zt,size:Wt,margin:Ht,adjustedWidth:Gt,adjustedHeight:qt,transition:$t,introEnabled:Ut,tableId:Xt,frameRuntime:Yt,rafRef:Qt,renderFnRef:Jt,scheduleRender:ei,currentTheme:ti}=Ft,ii=Re(),ri=xe(),ai=et(()=>Array.isArray(l)?fe(l):l,[l]),oi=et(()=>fe(c),[c]),si=et(()=>fe(w),[w]),ci=G??"orthographic"===_i(n),fi=et(()=>({projection:n,projectionExtent:a,fitPadding:o,xAccessor:C,yAccessor:L,lineDataAccessor:M,lineType:E,flowStyle:N,areaStyle:_e,pointStyle:Ee,lineStyle:Ne,colorScheme:Fe,themeSemantic:ze(ti),themeSequential:ti?.colors?.sequential,themeDiverging:ti?.colors?.diverging,themeCategorical:ti?.colors?.categorical,graticule:F,projectionTransform:s,windowSize:Se,clock:Yt.now,decay:ot,pulse:st,transition:$t,introAnimation:Ut,annotations:Ke,pointIdAccessor:T,lineIdAccessor:B,customLayout:P,layoutConfig:x,onLayoutError:k,layoutMargin:Ht}),[n,a,o,C,L,M,E,N,_e,Ee,Ne,Fe,ti,F,s,Se,Yt.now,ot,st,$t,Ut,Ke,T,B,P,x,k,Ht]),gi=Ce(fi),mi=tt(null);mi.current||(mi.current=new Zt(gi));let yi=mi.current,vi=tt(null),bi=vi.current??(vi.current=zi(yi.scales)),wi=Pe||!ii&&ri;wi&&(ai||c||w)&&(ai&&yi.setAreas(ai),c&&yi.setPoints(oi),w&&yi.setLines(si),yi.computeScene({width:Gt,height:qt}),yi.cancelIntroAnimation());let{resolvedForeground:Si,resolvedBackground:ki,themeBackground:Li,surfaceBackground:Ai}=Hi({foregroundGraphics:vt,backgroundGraphics:yt,size:Wt,margin:Ht,scales:yi.scales,background:de,themeBackgroundColor:ti.colors.background,tracker:bi,readScales:()=>yi.scales}),Mi=tt(null),Fi=tt(null),Oi=tt(null);U&&!Oi.current&&(Oi.current=new Ri(re??256)),Oi.current?.setLimit(re??256);let Wi=tt(Ke),$i=tt(null),Zi=tt(hi),Ui=tt(!1),Xi=tt(null),Yi=Ve(e=>{Xi.current=e,zt&&"object"==typeof zt&&(zt.current=e)},[zt]),Qi=tt(null),Ki=tt(null),Vi=tt(null),Ji=tt(0);if($&&!Vi.current){let e=Z?.maxPerLine??Bi();Vi.current=new xi(50*e)}let er=tt(null),tr=tt(!1),ir=tt(null),rr=tt(!1),nr=tt(!1),ar=ke("StreamGeoFrame"),or=tt(void 0),[sr,lr]=it(null),[,cr]=it(0),ur=tt(0),[hr,dr]=it(!1),pr=y(mi,Lt,At,e=>e.getPoints());j(mi,gi,Nt,ei),D(mi,S,Nt,ei),Je(()=>{let e=mi.current;e&&(ai&&e.setAreas(ai),c&&e.setPoints(oi),w&&e.setLines(si),Nt.current=!0,ei())},[ai,c,oi,w,si,ei]),Kt(t,{storeRef:mi,dirtyRef:Nt,scheduleRender:ei,zoomTransformRef:Zi,containerRef:Xi,zoomBehaviorRef:$i});let{hoverHandlerRef:fr,onPointerMove:gr,onPointerLeave:mr,flushPointerMove:yr,pointerStateRef:vr}=Ft,{canvasRef:br,interactionCanvasRef:wr,resolutionDirtyRef:Rr}=te(Ft,{hydrated:ii,wasHydratingFromSSR:ri,storeRef:mi,dirtyRef:Nt,cleanup:()=>Oi.current?.clear(),maxDevicePixelRatio:pe,canvasPaintDependencies:[Gt,qt,de,yt,Ie,U,re,ei]});Je(()=>{fr.current=e=>{let t=br.current;if(!t)return;let i=mi.current;if(!i||!i.scene.length)return void ye(t);let r=Ni({pointer:e,canvasRect:t.getBoundingClientRect(),margin:Ht,width:Gt,height:qt,scene:i.scene,pointQuadtree:i.quadtree,maxPointRadius:i.maxPointRadius,hitCanvasRef:Fi});ye(t,"hit"===r.kind?ge(r.node):void 0),Oe&&!1!==He&&("hit"===r.kind?(er.current=r.hover,ir.current=r.node,lr(r.hover),Bt?.(r.hover),ei()):("outside"===r.kind||"miss"===r.kind&&er.current)&&(er.current=null,ir.current=null,lr(null),Bt?.(null),ei()))}},[Oe,He,Gt,qt,Ht,Bt,ei,fr,br]),Ft.hoverLeaveRef.current=()=>{ye(br.current),Oe&&!1!==He&&(er.current=null,ir.current=null,lr(null),Bt?.(null),ei())},be(br);let Pr=Ve(e=>{if(ee(e.target)||!It)return;yr();let t=mi.current;if(!t||!t.scene.length)return void It(null);let i=e.currentTarget.getBoundingClientRect(),r=e.clientX-i.left-Ht.left,n=e.clientY-i.top-Ht.top;if(r<0||r>Gt||n<0||n>qt)return void It(null);Fi.current||(typeof OffscreenCanvas<"u"?Fi.current=new OffscreenCanvas(1,1):Fi.current=document.createElement("canvas"));let a=Ei(Fi.current);if(!a)return void It(null);let o=Be(30,or.current),s=Be(6,or.current),l=Vt(t.scene,r,n,o,a,t.quadtree,t.maxPointRadius,s);if(l){let e=l.node.datum,t=Array.isArray(e)?null:e?.properties?e:e?.data||e,i=t?.properties?{...t,...t.properties}:t;return void It({...i,data:t,properties:t?.properties,__semioticHoverData:!0,x:r,y:n,time:r,value:n},{type:"activate",inputType:le(or.current)})}It(null)},[qt,Gt,It,Ht,yr]),{kbFocusIndexRef:xr,focusedNavPointRef:Sr,onKeyDown:kr,refreshKeyboardFocus:Cr}=d({clearPointerHover:mr,storeRef:mi,hoverRef:er,hoveredNodeRef:ir,setHoverPoint:lr,customHoverBehavior:Bt,customClickBehavior:It,scheduleRender:ei}),Lr=Ve(e=>{R(vr,e,Oe&&!1!==He,tr.current,br.current)&&(or.current=e.pointerType,xr.current=-1,Sr.current=null,gr(e))},[br,Oe,He,Sr,xr,gr,vr]),Ar=Ve(e=>{or.current=e.pointerType},[]);Jt.current=()=>{if(Qt.current=null,bi.sync(mi.current?.scales??null),!Yt.isActive)return;let e=br.current,t=mi.current;if(!e||!t)return;let n=Yt.now(),a=!1,o=Ki.current,s=!1;if(o){Ki.current=null;let e={width:Gt,height:qt};t.applyRotation(o,e),s=!0}let l=null!=t.activeTransition,c=t.advanceTransition(Ot.current?n+1e6:n),h=!Ot.current&&c,d=ar.current.beforeCompute(t.getLastUpdateResult(),h),y=!1;if(Nt.current&&!c){let e={width:Gt,height:qt},i=t.hasProjection(),r=ci&&i?t.getRotation():null;t.computeScene(e);let n=Zi.current,a=1!==n.k||0!==n.x||0!==n.y;ci&&r?a?(t.setRotation(r),t.applyZoomScale(n.k,e)):t.applyRotation(r,e):a&&t.applyZoomTransform(n,e),Cr(),Nt.current=!1,y=!0,pr()}bi.sync(t.scales),ar.current.afterCompute(d,y,!1);let b=J(pe,Wt),w=wr.current;w&&Q(w,Wt,b);let R=$&&!Ot.current&&!!Vi.current,P=t.consumeStylePaintPending();var x;(y||s||P)&&(tr.current=me(t.scene),tr.current||ye(e)),tr.current&&(l||y||s||P)&&(x={canvas:e,pointer:vr.current,store:t,margin:Ht,width:Gt,height:qt,hitCanvasRef:Fi,geometryMoved:l||y||s},ve(x.canvas,x.pointer,e=>{let t=Ni({pointer:e,canvasRect:x.canvas.getBoundingClientRect(),margin:x.margin,width:x.width,height:x.height,scene:x.store.scene,pointQuadtree:x.geometryMoved?null:x.store.quadtree,maxPointRadius:x.store.maxPointRadius,hitCanvasRef:x.hitCanvasRef});return"hit"===t.kind?ge(t.node):void 0}));let S=u(t,n,y,nr),k=Rr.current,C=f({dirtyOrRebuilt:y,transitioning:l,continuous:R,liveEncoding:S.changed,forced:s||P||k});if(Rr.current=!1,U&&Oi.current){let e=Mi.current;if(e&&t.scales?.projection){let i=V(e,Wt,Ht,b);i&&(i.clearRect(-Ht.left,-Ht.top,Wt[0],Wt[1]),i.save(),i.beginPath(),i.rect(0,0,Gt,qt),i.clip(),Pi(i,{tileURL:U,projection:t.scales.projection,width:Gt,height:qt,tileCache:Oi.current,maxDevicePixelRatio:pe,onTileLoad:()=>ei()}),i.restore())}}if(C){let i=V(e,Wt,Ht,b);if(!i)return;i.clearRect(-Ht.left,-Ht.top,Wt[0],Wt[1]),U||z(i,{background:de,themeBackground:Li,hasBackgroundGraphics:!!yt,x:-Ht.left,y:-Ht.top,width:Wt[0],height:Wt[1]}),i.save(),i.beginPath(),i.rect(0,0,Gt,qt),i.clip();let o=t.scene,s=t.scales,l={width:Gt,height:qt};if(v({context:i,nodes:o,renderMode:Ie,pixelRatio:b,paintBuiltIn:e=>{pi(i,e),r(i,e,s,l),p(i,e,s,l),m(i,e,s,l)}}),R&&Vi.current){let e=Vi.current,t=o.filter(e=>"line"===e.type);if(t.length>0){let r=Z||{},o=.3*(r.speedMultiplier??1),s=r.maxPerLine??Bi(),l=r.spawnRate??(Ti()?.06:.15),c=r.radius??2,u=r.opacity??.7,h=n/1e3,d=Ji.current>0?Math.min(h-Ji.current,.1):.016;Ji.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++)Yt.random()<l&&e.countForLine(i)<s&&e.spawn(i,Yt.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",je(t.scene,"Geographic chart"));let L=ir.current,A=!(!L||"geoarea"!==L.type&&"point"!==L.type),j=g(A,rr.current),D=wr.current;if(D&&j){let e=V(D,Wt,Ht,b);if(e){if(e.clearRect(-Ht.left,-Ht.top,Wt[0],Wt[1]),L&&"geoarea"===L.type){let t=new Path2D(L.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(L&&"point"===L.type){let t=L,r=("object"==typeof He?He:void 0)?.pointColor||i(L);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()}}rr.current=A}let M=Ke!==Wi.current;M&&(Wi.current=Ke),(y||M||l&&Ke&&Ke.length>0)&&(y||M||l&&!c||n-ur.current>=33)&&(cr(e=>e+1),ur.current=n),(h||null!=t.activeTransition||S.pending||a)&&ei()},I(ut,mi,Nt,ei,Yt.now,hr,dr),Je(()=>{if("production"!==process.env.NODE_ENV&&U){let e=_i(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.`)}},[U,n]),Je(()=>{let e=Xi.current;if(!O||!e)return $i.current&&e&&(di(e).on(".zoom",null),$i.current=null),void(e&&di(e).on("mousedown.rotate",null).on("touchstart.rotate",null));let[t,i]=W||[1,8],r={width:Gt,height:qt};if(ci){let n=Zi.current.k,a=e=>{n=Math.max(t,Math.min(i,e)),Zi.current=hi.scale(n);let a=mi.current;a&&(a.applyZoomScale(n,r),Nt.current=!1,ei(),a.scales?.projection&&H?.({projection:a.scales.projection,zoom:a.currentZoom}))};$i.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=mi.current;if(!r)return;let n=r.getRotation();Qi.current={x:t.clientX,y:t.clientY,rotation:[...n]},e.setPointerCapture(t.pointerId),t.preventDefault()},u=e=>{let t=Qi.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]];Ki.current=n,ei()},h=t=>{if(!Qi.current)return;Qi.current=null,e.releasePointerCapture(t.pointerId);let i=Ki.current;if(i){Ki.current=null;let e=mi.current;e&&(e.applyRotation(i,r),ei())}let n=mi.current;n?.scales?.projection&&H?.({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),$i.current=null}}let n=ui().scaleExtent([t,i]).extent([[0,0],[Wt[0],Wt[1]]]).translateExtent([[-1/0,-1/0],[1/0,1/0]]).on("zoom",e=>{let t=e.transform;Zi.current=t,Ui.current=!0;let i=mi.current;i&&(i.applyZoomTransform(t,r),Nt.current=!1,ei())}).on("end",e=>{Zi.current=e.transform,Ui.current=!1;let t=mi.current;t?.scales?.projection&&H?.({projection:t.scales.projection,zoom:t.currentZoom})});return $i.current=n,di(e).call(n),()=>{di(e).on(".zoom",null)}},[O,W,ci,Wt,Gt,qt,Ht,H,ei]);let jr=Oe&&!1!==He,Dr=jr&&sr?Ge?Ge(sr):/* @__PURE__ */Gi(ji,{data:sr}):null,Mr=We(Dr)?/* @__PURE__ */Gi(X,{contentOwnsChrome:qe(Ge),x:sr.x,y:sr.y,containerWidth:Gt,containerHeight:qt,margin:Ht,className:"stream-frame-tooltip",zIndex:10,children:Dr}):null;if(wi){let e=yi.scene;/* */
15
+ return qi("div",{ref:Yi,className:"stream-geo-frame"+(he?` ${he}`:""),role:Dt?"group":"img","aria-label":Mt||("string"==typeof bt?bt:"Geographic chart"),style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:se?"100%":Wt[0],height:ce?"100%":Wt[1]},children:[
16
+ /* @__PURE__ */Gi(De,{accessibleTable:Dt,scene:e,chartType:"Geographic chart",tableId:Xt,chartTitle:"string"==typeof bt?bt:void 0}),
17
+ /* @__PURE__ */Gi(Me,{summary:Tt}),
18
+ /* @__PURE__ */qi("svg",{xmlns:"http://www.w3.org/2000/svg",width:Wt[0],height:Wt[1],style:{position:"absolute",left:0,top:0},children:[Ai?/* @__PURE__ */Gi("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:Wt[0],height:Wt[1],fill:Ai}):null,
19
+ /* @__PURE__ */Gi("g",{transform:`translate(${Ht.left},${Ht.top})`,children:ki}),
20
+ /* @__PURE__ */Gi("g",{transform:`translate(${Ht.left},${Ht.top})`,children:e.map((e,t)=>b({node:e,index:t,renderMode:Ie,fallback:()=>li(e,t)}))})]}),
21
+ /* @__PURE__ */Gi(ni,{width:Gt,height:qt,totalWidth:Wt[0],totalHeight:Wt[1],margin:Ht,showAxes:!1,title:bt,description:Mt,legend:wt,legendPosition:Rt,legendLayout:Pt,legendHoverBehavior:xt,legendClickBehavior:St,legendHighlightedCategory:kt,legendIsolatedCategories:Ct,foregroundGraphics:A(Si,q(mi.current?.customLayoutOverlays,S??null)),annotations:Ke,onAnnotationActivate:rt,onObservation:Ye??Xe,chartId:Qe,chartType:"StreamGeoFrame",autoPlaceAnnotations:nt,svgAnnotationRules:at,pointNodes:Ci(e),geoProjection:mi.current?.scales?.projectedPoint})]})}/* */
22
+ return qi("div",{ref:Yi,className:"stream-geo-frame"+(he?` ${he}`:""),role:"group","aria-label":Mt||("string"==typeof bt?bt:"Geographic chart"),tabIndex:0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:se?"100%":Wt[0],height:ce?"100%":Wt[1],overflow:$e?"visible":"hidden",...O?{touchAction:"none"}:{}},onKeyDown:kr,children:["production"!==process.env.NODE_ENV&&mi.current&&/* @__PURE__ */Gi(Ae,{store:mi.current,diagnostics:ar.current}),
23
+ /* @__PURE__ */Gi(De,{accessibleTable:Dt,sceneRevision:mi.current?.getUpdateSnapshot().revisions.accessibility,scene:mi.current?.scene??[],chartType:"Geographic chart",tableId:Xt,chartTitle:"string"==typeof bt?bt:void 0}),
24
+ /* @__PURE__ */Gi(Me,{summary:Tt}),
25
+ /* @__PURE__ */Gi(Le,{active:xr.current>=0,hoverPoint:sr}),
26
+ /* @__PURE__ */qi("div",{role:"img","aria-label":Mt||("string"==typeof bt?bt:"Geographic chart"),style:{position:"relative",width:"100%",height:"100%"},onPointerMove:Lr,onPointerLeave:mr,onPointerDown:jr||_t?Ar:void 0,onClick:_t?Pr:void 0,children:[
27
+ /* @__PURE__ */Gi(ie,{size:Wt,margin:Ht,backdropFill:Ai??void 0,children:ki}),U&&/* @__PURE__ */Gi("canvas",{ref:Mi,style:{position:"absolute",left:0,top:0,width:Wt[0],height:Wt[1],pointerEvents:"none"}}),
28
+ /* @__PURE__ */Gi("canvas",{ref:br,"aria-label":je(mi.current?.scene??[],"Geographic chart"),style:{position:"absolute",left:0,top:0,width:Wt[0],height:Wt[1]}}),
29
+ /* @__PURE__ */Gi("canvas",{ref:wr,style:{position:"absolute",left:0,top:0,width:Wt[0],height:Wt[1],pointerEvents:"none"}}),
30
+ /* @__PURE__ */Gi(ni,{width:Gt,height:qt,totalWidth:Wt[0],totalHeight:Wt[1],margin:Ht,showAxes:jt,title:bt,description:Mt,legend:wt,legendPosition:Rt,legendLayout:Pt,legendHoverBehavior:xt,legendClickBehavior:St,legendHighlightedCategory:kt,legendIsolatedCategories:Ct,foregroundGraphics:A(Si,q(mi.current?.customLayoutOverlays,S??null)),annotations:Ke,onAnnotationActivate:rt,onObservation:Ye??Xe,chartId:Qe,chartType:"StreamGeoFrame",autoPlaceAnnotations:nt,svgAnnotationRules:at,pointNodes:Ci(mi.current?.scene),geoProjection:mi.current?.scales?.projectedPoint}),ut?.showBadge&&/* @__PURE__ */Gi(_,{isStale:hr,position:ut.badgePosition,state:ut.state,settling:ut.settling}),O&&/* @__PURE__ */qi("div",{className:"stream-geo-zoom-controls",style:{position:"absolute",bottom:Ht.bottom+8,left:Ht.left+8,display:"flex",flexDirection:"column",gap:2,zIndex:2},children:[
31
+ /* @__PURE__ */Gi("button",{type:"button","aria-label":"Zoom in",onClick:e=>{e.stopPropagation();let t=Xi.current,i=$i.current;t&&i?.scaleBy&&i.scaleBy(di(t),1.5)},style:Ii,children:"+"}),
32
+ /* @__PURE__ */Gi("button",{type:"button","aria-label":"Zoom out",onClick:e=>{e.stopPropagation();let t=Xi.current,i=$i.current;t&&i?.scaleBy&&i.scaleBy(di(t),1/1.5)},style:Ii,children:"−"})]}),K&&/* @__PURE__ */Gi("div",{className:"stream-geo-tile-attribution",style:{position:"absolute",bottom:Ht.bottom+2,right:Ht.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}),
33
+ /* @__PURE__ */Gi(Te,{active:xr.current>=0,hoverPoint:sr,margin:Ht,size:Wt,shape:Sr.current?.shape,width:Sr.current?.w,height:Sr.current?.h,pathData:Sr.current?.pathData}),Mr]})]})})),"StreamGeoFrame");import{forwardRef as Zi,useMemo as Ui}from"react";import{jsx as Xi}from"react/jsx-runtime";var Yi=/* @__PURE__ */he(/* @__PURE__ */Zi(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:S,chartId:k,loading:C,loadingContent:L,emptyContent:A,className:j,frameProps:D={}}=i,{frameRef:M,resolved:T,normalizedMargin:B}=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}),I=Ui(()=>fe(n),[n]),_=Ui(()=>fe(a),[a]),E=Ui(()=>fe(o),[o]),N=Ui(()=>[...I,...E,..._],[I,E,_]),F=t({responsive:i,data:N,rawData:void 0!==n||void 0!==o||void 0!==a?N:void 0,colorBy:f,colorScheme:g,legendInteraction:void 0,selection:b,linkedHover:w,fallbackFields:"string"==typeof f?[f]:[],unwrapData:!1,onObservation:R,onClick:S,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"GeoCustomChart",chartId:k,showLegend:!1,userMargin:B,marginDefaults:T.marginDefaults,loading:C,loadingContent:L,emptyContent:A,width:T.width,height:T.height,hasTitle:!!T.title}),O=F.effectiveSelectionHook,z=Ui(()=>O?.isActive?{isActive:!0,predicate:O.predicate}:null,[O?.isActive,O?.predicate]);if(F.earlyReturn)return F.earlyReturn;let{width:W,height:H,enableHover:G,title:q,description:$,summary:Z,accessibleTable:U}=T,X=se(m),Y={projection:u,...null!=n&&{points:I},...null!=a&&{areas:_},...null!=o&&{lines:E},xAccessor:h,yAccessor:d,...null!=p&&{lineDataAccessor:p},customLayout:s,layoutConfig:l,onLayoutError:c,layoutSelection:z,colorBy:f,colorScheme:g,size:[W,H],responsiveWidth:i.responsiveWidth,responsiveHeight:i.responsiveHeight,margin:F.margin,enableHover:G,...P({title:q,description:$,summary:Z,accessibleTable:U,className:j,animate:i.animate,maxDevicePixelRatio:i.maxDevicePixelRatio,autoPlaceAnnotations:i.autoPlaceAnnotations}),...!1===m?{tooltipContent:()=>null}:X?{tooltipContent:X}:{},...x({linkedHover:w,selection:b,onObservation:R,onClick:S,hoverHighlight:!1,mobileInteraction:F.mobileInteraction,customHoverBehavior:F.customHoverBehavior,customClickBehavior:F.customClickBehavior,linkedHoverInClickPredicate:!1}),...y&&y.length>0&&{annotations:y},...D};/* */
34
+ return Xi(pe,{componentName:"GeoCustomChart",width:W,height:H,children:/* @__PURE__ */Xi($i,{ref:M,...Y})})}),"GeoCustomChart");export{$i as a,Yi as b};
@@ -0,0 +1 @@
1
+ import{a as e,b as t,c as o,d as i}from"./c-UZJAWWAI.min.js";import{g as r,j as a}from"./c-VLAAAFST.min.js";import{a as l}from"./c-KMRWORMM.min.js";import{a as n}from"./c-4IH2UPBL.min.js";import{f as s,g as c,h as f,i as u}from"./c-BSLJZUTD.min.js";import{a as g}from"./c-BKL6GCDN.min.js";import{a as m}from"./c-UF4BWPDR.min.js";import{b as h,c as y}from"./c-U5XVLSHN.min.js";import{c as p,d}from"./c-NVSINXE5.min.js";import{c as b,d as v,s as S}from"./c-ZOE7TAR3.min.js";import{c as w}from"./c-RBWJFQDC.min.js";import{a as M,b as N,f as x}from"./c-ODSUDNB4.min.js";var k={chartType:"stackedarea",buildScene:(e,t)=>a(e,t),canvasRenderers:[l,g]};function C(e,t){let o=[],i="bubble"===e.config.chartType?10:5,r=e.config.sizeRange||[3,15],a=null;if(e.getSize&&!e.config.pointStyle){let o=t.map(t=>e.getSize(t)).filter(e=>null!=e&&!Number.isNaN(e));if(o.length>0){let e=1/0,t=-1/0;for(let i of o)i<e&&(e=i),i>t&&(t=i);a=o=>e===t?(r[0]+r[1])/2:r[0]+(o-e)/(t-e)*(r[1]-r[0])}}let l=e.getColor?e.resolveColorMap(t):null,n=e.config.themeSemantic?.primary||"#4e79a7",f=e.getSymbol,u=f?w(f,e.config.symbolMap):null;for(let r of t){let t=e.config.pointStyle?e.config.pointStyle(r):{fill:n,opacity:.8},f=t.r||i;if(a&&e.getSize){let t=e.getSize(r);null!=t&&!Number.isNaN(t)&&(f=a(t))}if(l&&e.getColor&&!t.fill){let o=e.getColor(r);o&&l.has(o)&&(t={...t,fill:l.get(o)})}let g=e.getPointId?String(e.getPointId(r)):void 0;if(u){let i=u(r),a=c(r,e.scales,e.getX,e.getY,Math.PI*f*f,i,t,g);a&&o.push(a)}else{let i=s(r,e.scales,e.getX,e.getY,f,t,g);i&&o.push(i)}}return o}var A=[g,m],T={chartType:"scatter",buildScene:(e,t)=>C(e,t),canvasRenderers:A},F={chartType:"bubble",buildScene:(e,t)=>C(e,t),canvasRenderers:A},R=/* @__PURE__ */new Map;function W(e,t,o){return t===o?Math.floor(128):Math.min(Math.floor(255*(e-t)/(o-t)+.5),255)}function j(e){let t=Object.prototype.hasOwnProperty.call(b,e)?e:"blues",o=R.get(t);if(o)return o;o=new Array(256);let i=v(t);for(let e=0;e<256;e++)o[e]=i(e/255);return R.set(t,o),o}function z(e,t,o){let i=o.config.areaStyle?.(t);return i&&("string"==typeof i.fill&&(e.fill=i.fill),e.style=i),e}function P(e,t,o){if(e.config.heatmapAggregation)return X(e,t,o);if(0===t.length)return[];let i=h(e.config.valueAccessor,"value"),r=y(e.config.xAccessor,"x"),a=y(e.config.yAccessor,"y"),l=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,s=new Array(t.length),c=new Array(t.length);for(let e=0;e<t.length;e++){let o=t[e],i=r(o),f=a(o);s[e]=i,c[e]=f,l.has(i)||l.set(i,l.size),n.has(f)||n.set(f,n.size)}let f=l.size,g=n.size;if(0===f||0===g)return[];let m=Array.from(l.keys()),p=Array.from(n.keys()),d=m.every(e=>"number"==typeof e&&!isNaN(e)),b=p.every(e=>"number"==typeof e&&!isNaN(e)),v=4096;if(d&&b&&f*g>v&&t.length>v){let i=/* @__PURE__ */new Set;for(let r=0;r<t.length;r++){let a=l.get(s[r]),u=n.get(c[r]);if(void 0!==a&&void 0!==u&&(i.add(u*f+a),i.size>v))return X({...e,config:{...e.config,heatmapAggregation:e.config.valueAccessor?"mean":"count"}},t,o)}}if(d){m.sort((e,t)=>Number(e)-Number(t)),l.clear();for(let e=0;e<m.length;e++)l.set(m[e],e)}if(b){p.sort((e,t)=>Number(e)-Number(t)),n.clear();for(let e=0;e<p.length;e++)n.set(p[e],e)}let S=new Float64Array(t.length),w=new Float64Array(t.length),M=new Array(t.length),N=/* @__PURE__ */new Map,x=0;for(let e=0;e<t.length;e++){let o=t[e],r=l.get(s[e]),a=n.get(c[e]);if(void 0===r||void 0===a)continue;let u,g=i(o),m=a*f+r,h=N.get(m);void 0!==h?u=h:(u=x++,N.set(m,u)),S[u]=m,w[u]=g,M[u]=o}let k=1/0,C=-1/0;for(let e=0;e<x;e++){let t=w[e];isFinite(t)&&(t<k&&(k=t),t>C&&(C=t))}if(!isFinite(k)||!isFinite(C))return[];let A="string"==typeof e.config.colorScheme?e.config.colorScheme:e.config.themeSequential||"blues",T=e.config.heatmapColorScale,F=T?void 0:j(A),R=o.width/f,P=o.height/g,B=e.config.showValues,V=e.config.heatmapValueFormat,Y=[];for(let t=0;t<x;t++){let o=w[t];if(!isFinite(o))continue;let i=S[t],r=i%f,a=(i-r)/f,l=W(o,k,C),n=T?T(o):F[l],s=B?{value:o,showValues:!0,valueFormat:V}:{value:o},c=M[t];Y.push(z(u(r*R,(g-1-a)*P,R,P,n,c,s),c,e))}return Y}function X(e,t,o){let i=Math.max(1,Math.floor(e.config.heatmapXBins??20)),r=Math.max(1,Math.floor(e.config.heatmapYBins??20)),a=e.config.heatmapAggregation??"count",l=h(e.config.valueAccessor,"value");if(!e.scales||0===t.length)return[];let[n,s]=e.scales.x.domain(),[c,f]=e.scales.y.domain(),g=(s-n||1)/i,m=(f-c||1)/r,y=i*r;if(y>1e6)return[];let p=new Int32Array(y),d=new Float64Array(y),b=e.config.trackHoverRows||x(e.config.areaStyle)?/* @__PURE__ */new Map:void 0;for(let o=0;o<t.length;o++){let a=t[o],s=e.getX(a),f=e.getY(a);if(!isFinite(s)||!isFinite(f))continue;let u=Math.min(Math.floor((s-n)/g),i-1),h=Math.min(Math.floor((f-c)/m),r-1);if(u<0||h<0)continue;let y=h*i+u;p[y]++;let v=l(a);if(d[y]+=isFinite(v)?v:0,b){let e=b.get(y);e||(e=[],b.set(y,e)),e.push(a)}}let v=1/0,S=-1/0;for(let e=0;e<y;e++){if(0===p[e])continue;let t;switch(a){case"sum":t=d[e];break;case"mean":t=d[e]/p[e];break;default:t=p[e]}t<v&&(v=t),t>S&&(S=t)}if(!isFinite(v))return[];let w=e.config.heatmapColorScale,N="string"==typeof e.config.colorScheme?e.config.colorScheme:e.config.themeSequential||"blues",k=w?void 0:j(N),C=o.width/i,A=o.height/r,T=e.config.showValues,F=e.config.heatmapValueFormat,R=[];for(let t=0;t<r;t++){let o=t*i;for(let l=0;l<i;l++){let i,s=o+l;if(0===p[s])continue;switch(a){case"sum":i=d[s];break;case"mean":i=d[s]/p[s];break;default:i=p[s]}let f=W(i,v,S),h=w?w(i):k[f],y=T?{value:i,showValues:!0,valueFormat:F}:{value:i},N=n+(l+.5)*g,x=c+(t+.5)*m,j=M({xi:l,yi:t,value:i,count:p[s],sum:d[s],xCenter:N,yCenter:x,agg:a},b?.get(s));R.push(z(u(l*C,(r-1-t)*A,C,A,h,j,y),j,e))}}return R}var B={chartType:"heatmap",buildScene:(e,t,o)=>P(e,t,o),canvasRenderers:[e]};function V(e){if(!Array.isArray(e))return;let t=e.filter(e=>!!e&&("string"==typeof e.fill||"object"==typeof e.fill&&null!==e.fill)),o=t.filter(e=>"number"==typeof e.upTo&&Number.isFinite(e.upTo)).map(e=>({upTo:e.upTo,fill:e.fill})).sort((e,t)=>e.upTo-t.upTo),i=t.find(e=>"number"!=typeof e.upTo||!Number.isFinite(e.upTo)),r=i?[...o,{upTo:1/0,fill:i.fill}]:o;return r.length>0?r:void 0}function Y(e,t,o,i){let r=Math.min(t,o),a=Math.max(t,o);if(!(a>r))return[];let l=[],n=-1/0;for(let t of e){let e=Math.max(n,r),o=Math.min(t.upTo,a);if(o>e&&l.push({from:e,to:o,fill:t.fill}),n=t.upTo,n>=a)break}return n<a&&l.push({from:Math.max(n,r),to:a,fill:i}),l}function I(e,t){if(!e.config.binSize)return{nodes:[],binBoundaries:[]};let o=r(t,e.getX,e.getY,e.config.binSize,e.getCategory,!!e.config.trackHoverRows||x(e.config.areaStyle),e.config.binAlign);if(0===o.size)return{nodes:[],binBoundaries:[]};let i=null;if(e.getCategory){let t=/* @__PURE__ */new Set;for(let e of o.values())for(let o of e.categories.keys())t.add(o);let r=e.config.barColors?Object.keys(e.config.barColors):[],a=new Set(r),l=Array.from(t).filter(e=>!a.has(e)).sort(),n=r.filter(e=>t.has(e)),s=n.join("\0")+""+l.join("\0");e.barCategoryCache&&e.barCategoryCache.key===s?i=e.barCategoryCache.order:(i=[...n,...l],e.barCategoryCache={key:s,order:i})}let a=[],l=e.scales,[n,s]=l.x.domain(),c=e.config.barStyle,u=e.config.themeSemantic?.primary,g=c?.gap,m="number"==typeof g&&g>=0?g:1,h={};c?.stroke&&(h.stroke=c.stroke),"number"==typeof c?.strokeWidth&&(h.strokeWidth=c.strokeWidth),"number"==typeof c?.opacity&&(h.opacity=c.opacity),c?.cursor&&(h.cursor=c.cursor);let y=V(c?.valueBands);for(let t of o.values()){let o=Math.max(t.start,n),r=Math.min(t.end,s);if(o>=r)continue;let g=l.x(o),p=l.x(r),d=Math.abs(p-g),b=d>m+1?m:0,v=Math.min(g,p)+b/2,w=Math.max(d-b,1);if(!(w<=0))if(i&&t.categories.size>0){let o=M(i.flatMap(e=>{let o=t.categories.get(e)||0;return 0===o?[]:[M({category:e,value:o},t.categoryRows?.get(e))]}),t.rows),r=0;for(let{category:i,value:n}of o){let s=l.y(r),g=l.y(r+n),m=Math.min(s,g),y=Math.abs(s-g),p=(e.config.barColors?S(e.config.barColors,i):void 0)??c?.fill??u??"#4e79a7",d=M({binStart:t.start,binEnd:t.end,total:t.total,category:i,categoryValue:n,categories:o},t.categoryRows?.get(i)),b=e.config.areaStyle?.(d)??{};a.push(f(v,m,w,y,{fill:p,...h,...b},d,i)),r+=n}}else{let o=l.y(0),i=l.y(t.total),r=Math.min(o,i),n=Math.abs(o-i),s=c?.fill||u||"#007bff",g=M({binStart:t.start,binEnd:t.end,total:t.total},t.rows),m=e.config.areaStyle?.(g)??{},p=f(v,r,w,n,{fill:s,...h,...m},g);if(y){let e=p.style.fill,o="string"==typeof e||"object"==typeof e&&null!==e&&"hatch"===e.type?e:void 0,i=Y(y,0,t.total,o);i.length>0&&(p.fillBands=i.map(e=>({y0:l.y(e.from),y1:l.y(e.to),fill:e.fill??s})))}a.push(p)}}let p=/* @__PURE__ */new Set;for(let e of o.values())p.add(e.start),p.add(e.end);return{nodes:a,binBoundaries:Array.from(p).sort((e,t)=>e-t)}}function O(e,t){let o,i,r=[];for(let a of e){if("rect"!==a.type)continue;let e=a.datum;if("number"==typeof e?.binStart&&"number"==typeof e.binEnd&&!(t<e.binStart||t>=e.binEnd)){if(!i){o=a.x+a.w/2;let{binStart:t,binEnd:r,total:l,categories:n}=e;i=n?M({binStart:t,binEnd:r,total:l,categories:n},N(n)):e}r.push({datum:e,group:e.category??"",value:e.categoryValue??e.total,color:"string"==typeof a.style.fill?a.style.fill:void 0})}}return i&&void 0!==o?{series:r,datum:i,xPx:o}:null}var E={chartType:"bar",buildScene:(e,t)=>I(e,t),canvasRenderers:[n],multiHover:(e,t,o,i)=>{let r=t.scales?.x.invert;if("function"!=typeof r)return e;let a=r(o),l=a instanceof Date?a.getTime():Number(a),n=Number.isFinite(l)?O(t.scene,l):null;if(!n)return e;let s=d(n.datum,r(n.xPx)),c=i.hasHit?{...e,xValue:s,xPx:n.xPx}:p(n.datum,e.x,e.y,{xValue:s,xPx:n.xPx});return c.allSeries=n.series.map(e=>({group:e.group,value:e.value,color:e.color||i.fallbackColor,datum:e.datum})),c}};function H(e,t){let o=[],i=e.config.swarmStyle||{},r=i.radius??3,a=i.fill??e.config.themeSemantic?.primary??"#007bff",l=i.opacity??.7,n=i.stroke,s=i.strokeWidth,c=i.cursor;for(let i of t){let t=e.getX(i),f=e.getY(i);if(null==f||Number.isNaN(f))continue;let u=e.scales.x(t),g=e.scales.y(f),m=a;if(e.getCategory){let t=String(e.getCategory(i));m=(e.config.barColors?S(e.config.barColors,t):void 0)??m}let{r:h,...y}=e.config.pointStyle?.(i)??{},p={type:"point",x:u,y:g,r:h??r,style:{fill:m,opacity:l,stroke:n,strokeWidth:s,cursor:c,...y},datum:i};e.getPointId&&(p.pointId=String(e.getPointId(i))),o.push(p)}return o}var D={chartType:"swarm",buildScene:(e,t)=>H(e,t),canvasRenderers:[o]};function L(e,t,o){let i=[],r=e.scales,a=e.config.waterfallStyle,l=t.filter(t=>{let o=e.getY(t),i=e.getX(t);return null!=o&&!Number.isNaN(o)&&null!=i&&isFinite(i)});if(0===l.length)return i;let n=a?.positiveColor??e.config.themeSemantic?.success??"#28a745",s=a?.negativeColor??e.config.themeSemantic?.danger??"#dc3545",c=a?.gap??1,u=a?.stroke,g=a?.strokeWidth,m=a?.opacity,h=0;for(let t=0;t<l.length;t++){let y=l[t],p=e.getX(y),d=e.getY(y),b=h+d,v=r.x(p),S=t>0?r.x(e.getX(l[t-1])):void 0,w=t<l.length-1?r.x(e.getX(l[t+1])):void 0,M=null!=S?(S+v)/2:null!=w?v-(w-v)/2:v-o.width/20,N=null!=w?(v+w)/2:null!=S?v+(v-S)/2:v+o.width/20,x=Math.min(M,N)+c/2,k=Math.max(M,N)-c/2-x;if(k<=0){h=b;continue}let C=r.y(h),A=r.y(b),T=Math.min(C,A),F=Math.abs(C-A),R=d>=0?n:s,W={...y,baseline:h,cumEnd:b,delta:d,_connectorStroke:a?.connectorStroke,_connectorWidth:a?.connectorWidth},j={fill:R,stroke:u,strokeWidth:g,opacity:m,cursor:a?.cursor,...e.config.areaStyle?.(W)};i.push(f(x,T,k,F,j,W)),h=b}return i}var U={chartType:"waterfall",buildScene:(e,t,o)=>L(e,t,o),canvasRenderers:[i]};function J(e,t,o){if(!e.getHigh||!e.getLow||!e.scales)return[];let i=e.config.candlestickRangeMode??!1;if(!(i||e.getOpen&&e.getClose))return[];let r=[],a=e.config.candlestickStyle||{},l=a.rangeColor||"#6366f1",n=i?l:a.upColor||"#28a745",s=i?l:a.downColor||"#dc3545",c=i?l:a.wickColor||"#333",f=a.wickWidth||(i?2:1),u=a.bodyWidth??0;if(null==a.bodyWidth){let o=t.map(t=>e.getX(t)).filter(e=>null!=e&&!Number.isNaN(e)).sort((e,t)=>e-t);if(o.length>1){let t=1/0,i=e.scales.x(o[0]);for(let r=1;r<o.length;r++){let a=e.scales.x(o[r]),l=Math.abs(a-i);l>0&&l<t&&(t=l),i=a}u=t!==1/0?Math.max(2,Math.min(.6*t,20)):6}else u=6}for(let l of t){let t=e.getX(l);if(null==t||Number.isNaN(t))continue;let g=e.getHigh(l),m=e.getLow(l);if(null==g||Number.isNaN(g)||null==m||Number.isNaN(m))continue;let h=i?g:e.getOpen(l),y=i?m:e.getClose(l);if(!i&&(null==h||Number.isNaN(h)||null==y||Number.isNaN(y)))continue;let p=y>=h,d=e.config.pointStyle?.(l)??{},b="string"==typeof d.fill?d.fill:void 0,v="string"==typeof d.stroke?d.stroke:void 0,S="number"==typeof d.strokeWidth?d.strokeWidth:void 0,w="number"==typeof d.opacity?d.opacity:"number"==typeof d.fillOpacity?d.fillOpacity:void 0,M={type:"candlestick",x:e.scales.x(t),openY:e.scales.y(h),closeY:e.scales.y(y),highY:e.scales.y(g),lowY:e.scales.y(m),bodyWidth:u,upColor:b&&p?b:n,downColor:b&&!p?b:s,wickColor:v??(i&&b?b:c),wickWidth:S??f,isUp:p,style:{cursor:a.cursor,...d,...void 0!==w&&{opacity:w}},datum:l};i&&(M.isRange=!0,M.dotRadius=Math.max(2,Math.min(u/2,.12*o.height))),r.push(M)}return r}var Z={chartType:"candlestick",buildScene:(e,t,o)=>J(e,t,o),canvasRenderers:[t]};export{k as a,T as b,F as c,B as d,E as e,D as f,U as g,Z as h};
@@ -1,2 +1,2 @@
1
- function e(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function t(t,n){return e(t,n)?t[n]:void 0}function n(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0})}function r(){/* @__PURE__ */
1
+ function e(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function t(t,n){return e(t,n)?t[n]:void 0}function n(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0})}function r(){/* */
2
2
  return Object.create(null)}function o(e,t){return e.slice(0,t+1).map(e=>e.replaceAll("%","%25").replaceAll(">","%3E")).join(">")}function i(e,n,r){return n.has(e)?"node":t(r.nodeIdsBySection,e)?"section":"global"}function s(e,t,o){let s=[],u=new Set(t.nodes.map(e=>e.id)),a=/* @__PURE__ */new Set;for(let n of t.measureValues){let t=e.measures[n.measureId];if(!t)continue;let r=i(n.subjectId,u,o);s.push({measureId:n.measureId,subjectId:n.subjectId,subjectKind:r,value:n.value,status:n.status,unitKind:t.unitKind,countUnit:t.countUnit,timeDenominator:t.timeDenominator}),"section"===r&&a.add(`${n.measureId}\0${n.subjectId}`)}let c=r();for(let e of t.nodes)n(c,e.id,e);let d=r(),l=r();for(let e of s){if("node"!==e.subjectKind)continue;let t=c[e.subjectId];if(!t?.sectionId)continue;let n=`${e.measureId}\0${t.sectionId}`;a.has(n)||(d[n]=(d[n]??0)+e.value,"exact"!==e.status?l[n]=e.status:l[n]||(l[n]="exact"))}for(let[t,n]of Object.entries(d)){let r=t.split("\0"),o=r[0],i=r[1],u=e.measures[o];u&&s.push({measureId:o,subjectId:i,subjectKind:"section",value:n,status:l[t]??"exact",unitKind:u.unitKind,countUnit:u.countUnit,timeDenominator:u.timeDenominator})}return{entries:s}}function u(e,t,n){return e.entries.find(e=>e.measureId===t&&e.subjectId===n)}function a(e,t=[],n){let r=void 0===n?void 0:new Set("string"==typeof n?[n]:n),o=t.filter(e=>!e.missingPrehistory&&void 0!==e.partition&&r?.has(e.partition)),i=new Set(o.map(e=>e.id)),s=new Set(o.map(e=>e.entityId)),u=/* @__PURE__ */new Map,a=0;for(let t of e){if(void 0!==n&&"string"==typeof t.roles.occurrence&&!i.has(t.roles.occurrence))continue;let e=Object.entries(t.entityWeights);0===e.length&&void 0===n&&(a+=t.entityCount);for(let[t,r]of e)(void 0===n||s.has(t))&&u.set(t,r)}return[...u.values()].reduce((e,t)=>e+t,a)}function c(e){let t=e.spec.comparison;if(!t)return;let n=t.partitions.map(n=>{let r=u(e.ledger,t.denominatorMeasureId,n)?.value??0,o={};return o["repeated-state-episode"]=a(e.motifs.matches.filter(e=>"repeated-state-episode"===e.template),e.source.occurrences,n),{partition:n,assigned:r,motifUsers:o,outcomes:{purchases:u(e.ledger,"purchases",n)?.value??0}}});return{partitions:[...t.partitions],denominatorMeasureId:t.denominatorMeasureId,referencePartition:t.referencePartition,rows:n}}function d(e,t){let n=e.spec.comparison?.denominatorMeasureId??e.spec.motifs.denominatorRef??"assigned";return u(e.ledger,n,t)?.value}function l(e,t,n){return 0===n||1e4*e%n!=0?Math.round((t-e)/Math.max(n,1)*1e4):1e4*(t-e)/n}function f(e,t){return t.length>0&&e.some((n,r)=>t.every((t,n)=>e[r+n]===t))}function m(e){let t=[];for(let n of e.occurrences??[]){if(n.missingPrehistory)continue;let e=n.nodePath;for(let r=0;r<e.length-1;r++)t.push({from:e[r],to:e[r+1],via:r>0?e[r-1]:void 0,occurrenceIds:[n.id]})}return{hops:t,graphAdjacency:e.edges.map(e=>({source:e.source,target:e.target,edgeId:e.id}))}}function p(e,t){for(let n=0;n<t.length-1;n++)if(!e.edges.some(e=>e.source===t[n]&&e.target===t[n+1]))return!1;return t.length>0}function h(e,t){return!(t.length<2)&&(e.occurrences??[]).some(e=>!e.missingPrehistory&&f(e.nodePath,t))}function g(e,t,n){let r=/* @__PURE__ */new Set;for(let o of e.occurrences??[]){if(o.missingPrehistory)continue;let e=o.nodePath;for(let o=0;o<e.length-1;o++)e[o]===t&&(null!=n&&(0===o||e[o-1]!==n)||r.add(e[o+1]))}return[...r]}export{a,t as b,n as c,r as d,o as e,s as f,u as g,c as h,d as i,l as j,f as k,m as l,p as m,h as n,g as o};
@@ -0,0 +1 @@
1
+ import{a as i,b as m}from"./c-PJ5CAYAW.min.js";export{m as default,i as registerNetworkPerspective};