semiotic 3.9.1 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (566) hide show
  1. package/README.md +137 -58
  2. package/agent-skill/semiotic-charts/SKILL.md +27 -17
  3. package/ai/artifact-contract-reference.md +408 -0
  4. package/ai/artifact-surface-inventory.json +5586 -0
  5. package/ai/behaviorContracts.cjs +24 -2
  6. package/ai/cli.js +480 -56
  7. package/ai/componentMetadata.cjs +13 -3
  8. package/ai/dist/mcp-server.js +140 -36407
  9. package/ai/examples.md +110 -7
  10. package/ai/reference.md +82 -28
  11. package/ai/schema.json +7675 -1471
  12. package/ai/surface-manifest.json +60 -9
  13. package/ai/system-prompt.md +18 -3
  14. package/ai/task-packets/compare-category-totals.json +301 -0
  15. package/ai/task-packets/compare-category-totals.md +188 -0
  16. package/ai/task-packets/correct-published-chart.json +271 -0
  17. package/ai/task-packets/correct-published-chart.md +597 -0
  18. package/ai/task-packets/index.json +40 -0
  19. package/ai/task-packets/update-live-chart.json +289 -0
  20. package/ai/task-packets/update-live-chart.md +424 -0
  21. package/dist/c-2N7IU2NY.min.js +1 -0
  22. package/dist/c-2WK7YJLL.min.js +1 -0
  23. package/dist/c-33QOXEUG.min.js +1 -0
  24. package/dist/c-42PLDTX7.min.js +1 -0
  25. package/dist/c-447VIMRO.min.js +1 -0
  26. package/dist/c-4FN7Q6VQ.min.js +1 -0
  27. package/dist/c-553QUDKA.min.js +1 -0
  28. package/dist/c-55BAJ333.min.js +1 -0
  29. package/dist/c-7242NXSG.min.js +1 -0
  30. package/dist/c-7EGHJU2F.min.js +1 -0
  31. package/dist/c-7HP7MB2I.min.js +1 -0
  32. package/dist/c-7NBU5ZKS.min.js +1 -0
  33. package/dist/c-AFBSWT77.min.js +1 -0
  34. package/dist/c-AJ7EC32V.min.js +1 -0
  35. package/dist/c-AQADQNY7.min.js +1 -0
  36. package/dist/c-ATM475SA.min.js +1 -0
  37. package/dist/c-AVO3Q7T7.min.js +1 -0
  38. package/dist/c-AZKPVBOC.min.js +1 -0
  39. package/dist/c-BNFJMDHN.min.js +1 -0
  40. package/dist/c-BNG5ECK5.min.js +1 -0
  41. package/dist/c-BOHCQILI.min.js +1 -0
  42. package/dist/c-CCTGN5CK.min.js +1 -0
  43. package/dist/c-CPSPZH6A.min.js +1 -0
  44. package/dist/c-CPV4N35K.min.js +1 -0
  45. package/dist/c-D6HAAPTX.min.js +1 -0
  46. package/dist/c-DE5Q3U2X.min.js +1 -0
  47. package/dist/c-DK662R77.min.js +1 -0
  48. package/dist/c-DY2676CR.min.js +1 -0
  49. package/dist/c-E32M6XW5.min.js +1 -0
  50. package/dist/c-E4JDJH4I.min.js +1 -0
  51. package/dist/c-E7I2L7CU.min.js +1 -0
  52. package/dist/c-EBOQ7ER7.min.js +1 -0
  53. package/dist/c-ELDWAO2V.min.js +1 -0
  54. package/dist/c-EUBTECGM.min.js +1 -0
  55. package/dist/c-GNTXRXRN.min.js +1 -0
  56. package/dist/c-GSZRZRD6.min.js +1 -0
  57. package/dist/c-GWX7JGMF.min.js +1 -0
  58. package/dist/c-GXV3C3MO.min.js +1 -0
  59. package/dist/c-HHTK2R75.min.js +1 -0
  60. package/dist/c-HLLFJYTY.min.js +1 -0
  61. package/dist/c-HPOYKCCG.min.js +1 -0
  62. package/dist/c-HXDKPIKR.min.js +1 -0
  63. package/dist/c-I4QJ6YLM.min.js +1 -0
  64. package/dist/c-IDJV3CZK.min.js +1 -0
  65. package/dist/c-ITKX3RC5.min.js +1 -0
  66. package/dist/c-JG2JCQLP.min.js +1 -0
  67. package/dist/c-JLGRHXGZ.min.js +1 -0
  68. package/dist/c-JO2UGTCP.min.js +1 -0
  69. package/dist/c-JUKIWTBJ.min.js +1 -0
  70. package/dist/c-KCRJGUHP.min.js +1 -0
  71. package/dist/c-LMGSSD2E.min.js +1 -0
  72. package/dist/c-LYQMZMZQ.min.js +1 -0
  73. package/dist/c-LYVKDBQJ.min.js +1 -0
  74. package/dist/c-MVR3RWF3.min.js +1 -0
  75. package/dist/c-MXCP7GNZ.min.js +1 -0
  76. package/dist/c-NG7BLZTR.min.js +1 -0
  77. package/dist/c-NYZ2QNAM.min.js +1 -0
  78. package/dist/c-OO5QLMJC.min.js +1 -0
  79. package/dist/c-OOVX2JPQ.min.js +1 -0
  80. package/dist/c-ORLEBW72.min.js +1 -0
  81. package/dist/c-P65V6HLO.min.js +1 -0
  82. package/dist/c-PP6VY3QU.min.js +1 -0
  83. package/dist/c-PRIKOLTE.min.js +1 -0
  84. package/dist/c-PSNI6KAZ.min.js +1 -0
  85. package/dist/c-PYNW54D2.min.js +1 -0
  86. package/dist/c-QA3HMQJP.min.js +1 -0
  87. package/dist/c-QAVFOEUY.min.js +1 -0
  88. package/dist/c-ROEHCIGV.min.js +1 -0
  89. package/dist/c-S3AZX5PP.min.js +1 -0
  90. package/dist/c-T2V7O2LO.min.js +1 -0
  91. package/dist/c-TIXX5CAU.min.js +1 -0
  92. package/dist/c-TKG2NP7G.min.js +1 -0
  93. package/dist/c-VJTDST2R.min.js +1 -0
  94. package/dist/c-VXLOLYTO.min.js +1 -0
  95. package/dist/c-W4ZUKSEQ.min.js +1 -0
  96. package/dist/c-WH2O53VI.min.js +1 -0
  97. package/dist/c-WNGH47HF.min.js +1 -0
  98. package/dist/c-WUWXGQYA.min.js +1 -0
  99. package/dist/c-XDQKXPX4.min.js +1 -0
  100. package/dist/c-XSB27XPS.min.js +1 -0
  101. package/dist/c-YDECTEUW.min.js +1 -0
  102. package/dist/c-YF3YKVQI.min.js +1 -0
  103. package/dist/c-YLZIV3VS.min.js +1 -0
  104. package/dist/c-ZYPXQF7B.min.js +1 -0
  105. package/dist/components/Annotation.d.ts +3 -2
  106. package/dist/components/access/chartAccessCapabilities.generated.d.ts +14 -0
  107. package/dist/components/access/chartAccessContract.d.ts +90 -0
  108. package/dist/components/access/chartAccessContractFixtures.d.ts +11 -0
  109. package/dist/components/ai/aestheticProfileTypes.d.ts +35 -0
  110. package/dist/components/ai/annotationProvenance.d.ts +2 -7
  111. package/dist/components/ai/auditVisualHierarchy.d.ts +49 -0
  112. package/dist/components/ai/builtInChartRecipeLayouts.d.ts +2 -0
  113. package/dist/components/ai/builtInChartRecipePublic.d.ts +4 -0
  114. package/dist/components/ai/builtInChartRecipes.d.ts +26 -0
  115. package/dist/components/ai/chartCapabilities.d.ts +3 -1
  116. package/dist/components/ai/chartRecipeRegistry.d.ts +7 -1
  117. package/dist/components/ai/chartRecipes.d.ts +10 -0
  118. package/dist/components/ai/colorEvidence.d.ts +12 -0
  119. package/dist/components/ai/describePhysicsProjection.d.ts +18 -0
  120. package/dist/components/ai/describePhysicsSource.d.ts +13 -0
  121. package/dist/components/ai/evaluateAesthetics.d.ts +47 -0
  122. package/dist/components/ai/geoNavigation.d.ts +4 -0
  123. package/dist/components/ai/hierarchyNavigation.d.ts +4 -0
  124. package/dist/components/ai/navigationTree.d.ts +7 -1
  125. package/dist/components/ai/qualityFixtures.d.ts +8 -0
  126. package/dist/components/ai/suggestionPropContracts.d.ts +1 -1
  127. package/dist/components/ai/useNavigationSync.d.ts +3 -3
  128. package/dist/components/artifact/ArtifactInspector.d.ts +26 -0
  129. package/dist/components/artifact/ArtifactInspectorContextSections.d.ts +18 -0
  130. package/dist/components/artifact/artifactContractDiff.d.ts +8 -0
  131. package/dist/components/artifact/artifactInspectorSummary.d.ts +53 -0
  132. package/dist/components/artifact/artifactRevision.d.ts +54 -0
  133. package/dist/components/artifact/artifactTestFixtures.d.ts +17 -0
  134. package/dist/components/artifact/attachmentAudit.d.ts +13 -0
  135. package/dist/components/artifact/claimCorrections.d.ts +3 -0
  136. package/dist/components/artifact/claimGraph.d.ts +5 -0
  137. package/dist/components/artifact/claimLifecycle.d.ts +32 -0
  138. package/dist/components/artifact/claims.d.ts +24 -0
  139. package/dist/components/artifact/collection.d.ts +10 -0
  140. package/dist/components/artifact/collectionCorrectionScope.d.ts +4 -0
  141. package/dist/components/artifact/collectionImpact.d.ts +11 -0
  142. package/dist/components/artifact/collectionLineage.d.ts +3 -0
  143. package/dist/components/artifact/collectionOperations.d.ts +8 -0
  144. package/dist/components/artifact/collectionPolicy.d.ts +22 -0
  145. package/dist/components/artifact/collectionTypes.d.ts +117 -0
  146. package/dist/components/artifact/configurationRepair.d.ts +8 -0
  147. package/dist/components/artifact/contract.d.ts +30 -0
  148. package/dist/components/artifact/evaluateArtifact.d.ts +12 -0
  149. package/dist/components/artifact/evaluateArtifactTypes.d.ts +78 -0
  150. package/dist/components/artifact/evaluationPresentation.d.ts +9 -0
  151. package/dist/components/artifact/evidenceSample.d.ts +8 -0
  152. package/dist/components/artifact/exportPaths.d.ts +8 -0
  153. package/dist/components/artifact/fieldPolicies.d.ts +12 -0
  154. package/dist/components/artifact/fingerprint.d.ts +36 -0
  155. package/dist/components/artifact/grounding.d.ts +51 -0
  156. package/dist/components/artifact/groundingBudget.d.ts +38 -0
  157. package/dist/components/artifact/hostTransfer.d.ts +13 -0
  158. package/dist/components/artifact/identity.d.ts +19 -0
  159. package/dist/components/artifact/inheritance.d.ts +48 -0
  160. package/dist/components/artifact/inheritanceIntegrity.d.ts +3 -0
  161. package/dist/components/artifact/jsonCompatibility.d.ts +2 -0
  162. package/dist/components/artifact/obligations.d.ts +3 -0
  163. package/dist/components/artifact/policies.d.ts +45 -0
  164. package/dist/components/artifact/policyRelations.d.ts +3 -0
  165. package/dist/components/artifact/recordProjection.d.ts +7 -0
  166. package/dist/components/artifact/representation.d.ts +50 -0
  167. package/dist/components/artifact/serialization.d.ts +40 -0
  168. package/dist/components/artifact/temporal.d.ts +32 -0
  169. package/dist/components/artifact/temporalAdapters.d.ts +75 -0
  170. package/dist/components/artifact/temporalAuditHelpers.d.ts +12 -0
  171. package/dist/components/artifact/temporalPresentation.d.ts +8 -0
  172. package/dist/components/artifact/types.d.ts +341 -0
  173. package/dist/components/artifact/validation.d.ts +13 -0
  174. package/dist/components/artifact/validationFieldStatus.d.ts +7 -0
  175. package/dist/components/artifact/validationPrimitives.d.ts +24 -0
  176. package/dist/components/artifact/validationSurfaces.d.ts +7 -0
  177. package/dist/components/artifact/validationTemporal.d.ts +3 -0
  178. package/dist/components/charts/geo/FlowMap.d.ts +7 -0
  179. package/dist/components/charts/geo/flowMapLineStyle.d.ts +18 -0
  180. package/dist/components/charts/index.d.ts +4 -0
  181. package/dist/components/charts/network/ChordDiagram.d.ts +5 -1
  182. package/dist/components/charts/network/CirclePack.d.ts +8 -1
  183. package/dist/components/charts/network/OrbitDiagram.d.ts +9 -0
  184. package/dist/components/charts/network/TreeDiagram.d.ts +8 -1
  185. package/dist/components/charts/network/Treemap.d.ts +8 -1
  186. package/dist/components/charts/ordinal/BarChart.d.ts +6 -0
  187. package/dist/components/charts/ordinal/BoxPlot.d.ts +3 -0
  188. package/dist/components/charts/ordinal/DonutChart.d.ts +5 -0
  189. package/dist/components/charts/ordinal/DotPlot.d.ts +3 -0
  190. package/dist/components/charts/ordinal/FunnelChart.d.ts +5 -0
  191. package/dist/components/charts/ordinal/GaugeChart.d.ts +3 -0
  192. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +6 -0
  193. package/dist/components/charts/ordinal/Histogram.d.ts +3 -0
  194. package/dist/components/charts/ordinal/LikertChart.d.ts +3 -0
  195. package/dist/components/charts/ordinal/PieChart.d.ts +5 -0
  196. package/dist/components/charts/ordinal/RadarChart.capability.d.ts +2 -0
  197. package/dist/components/charts/ordinal/RadarChart.d.ts +77 -0
  198. package/dist/components/charts/ordinal/RidgelinePlot.d.ts +3 -0
  199. package/dist/components/charts/ordinal/StackedBarChart.d.ts +6 -0
  200. package/dist/components/charts/ordinal/SwarmPlot.d.ts +3 -0
  201. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +3 -0
  202. package/dist/components/charts/ordinal/ViolinPlot.d.ts +3 -0
  203. package/dist/components/charts/physics/CollisionSwarmChart.d.ts +1 -1
  204. package/dist/components/charts/physics/EventDropChart.d.ts +3 -1
  205. package/dist/components/charts/physics/GaltonBoardChart.d.ts +4 -2
  206. package/dist/components/charts/physics/GauntletChart.d.ts +1 -5
  207. package/dist/components/charts/physics/ProcessFlowChart.d.ts +6 -0
  208. package/dist/components/charts/physics/UnitPileChart.d.ts +2 -1
  209. package/dist/components/charts/physics/chainReactionTypes.d.ts +3 -0
  210. package/dist/components/charts/physics/collisionSwarmPacking.d.ts +14 -0
  211. package/dist/components/charts/physics/collisionSwarmPhysics.d.ts +1 -0
  212. package/dist/components/charts/physics/eventDropAdmission.d.ts +32 -0
  213. package/dist/components/charts/physics/eventDropPhysics.d.ts +22 -1
  214. package/dist/components/charts/physics/galtonBoardPhysics.d.ts +2 -9
  215. package/dist/components/charts/physics/gauntletPhysics.d.ts +1 -0
  216. package/dist/components/charts/physics/physicsChartReconcile.d.ts +4 -0
  217. package/dist/components/charts/physics/physicsChartUtils.d.ts +1 -1
  218. package/dist/components/charts/physics/physicsGaltonData.d.ts +10 -0
  219. package/dist/components/charts/physics/physicsHocHandle.d.ts +2 -0
  220. package/dist/components/charts/physics/physicsHocUtils.d.ts +7 -1
  221. package/dist/components/charts/physics/physicsPileData.d.ts +11 -0
  222. package/dist/components/charts/physics/physicsPilePhysics.d.ts +5 -12
  223. package/dist/components/charts/physics/physicsProjectionOverlays.d.ts +1 -1
  224. package/dist/components/charts/physics/physicsSourceRows.d.ts +8 -0
  225. package/dist/components/charts/physics/usePhysicsChartData.d.ts +19 -0
  226. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +14 -1
  227. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +25 -7
  228. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +18 -5
  229. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +11 -1
  230. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +11 -1
  231. package/dist/components/charts/realtime/aggregate.d.ts +12 -1
  232. package/dist/components/charts/realtime/realtimeAccessors.d.ts +4 -0
  233. package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +8 -5
  234. package/dist/components/charts/realtime/realtimeChartTypes.d.ts +7 -0
  235. package/dist/components/charts/realtime/realtimeStyleRules.d.ts +4 -0
  236. package/dist/components/charts/realtime/temporalHistogramConfig.d.ts +17 -11
  237. package/dist/components/charts/shared/GaugeReadout.d.ts +9 -0
  238. package/dist/components/charts/shared/ThresholdAnnotation.d.ts +18 -0
  239. package/dist/components/charts/shared/ThresholdEndCap.d.ts +7 -0
  240. package/dist/components/charts/shared/annotationStatusFilter.d.ts +18 -0
  241. package/dist/components/charts/shared/auditAccessibilityText.d.ts +4 -2
  242. package/dist/components/charts/shared/chartDefinitionPilot.d.ts +5 -4
  243. package/dist/components/charts/shared/chartSpecCore.d.ts +2 -2
  244. package/dist/components/charts/shared/heatmapStyleRules.d.ts +13 -0
  245. package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
  246. package/dist/components/charts/shared/networkUtils.d.ts +14 -0
  247. package/dist/components/charts/shared/numericTickFormatter.d.ts +2 -0
  248. package/dist/components/charts/shared/radialCenterContent.d.ts +10 -0
  249. package/dist/components/charts/shared/selectionUtils.d.ts +3 -1
  250. package/dist/components/charts/shared/tooltipUtils.d.ts +1 -1
  251. package/dist/components/charts/shared/types.d.ts +4 -2
  252. package/dist/components/charts/shared/useChartLegend.d.ts +6 -1
  253. package/dist/components/charts/shared/useLikertAggregation.d.ts +8 -2
  254. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +9 -5
  255. package/dist/components/charts/shared/useOrdinalPieceStyle.d.ts +1 -1
  256. package/dist/components/charts/shared/useXYBrush.d.ts +24 -0
  257. package/dist/components/charts/shared/useXYPointStyle.d.ts +2 -0
  258. package/dist/components/charts/xy/BubbleChart.d.ts +7 -0
  259. package/dist/components/charts/xy/CandlestickChart.d.ts +7 -0
  260. package/dist/components/charts/xy/DifferenceChart.d.ts +7 -0
  261. package/dist/components/charts/xy/Heatmap.d.ts +16 -0
  262. package/dist/components/charts/xy/LineChart.d.ts +9 -0
  263. package/dist/components/charts/xy/MinimapChart.d.ts +7 -0
  264. package/dist/components/charts/xy/MultiAxisLineChart.d.ts +7 -0
  265. package/dist/components/charts/xy/Scatterplot.d.ts +7 -0
  266. package/dist/components/charts/xy/ScatterplotMatrix.d.ts +6 -0
  267. package/dist/components/charts/xy/WaterfallChart.capability.d.ts +2 -0
  268. package/dist/components/charts/xy/WaterfallChart.d.ts +76 -0
  269. package/dist/components/charts/xy/differenceMarkStyle.d.ts +28 -0
  270. package/dist/components/charts/xy/multiAxisFields.d.ts +23 -0
  271. package/dist/components/charts/xy/scatterplotMatrixCells.d.ts +50 -0
  272. package/dist/components/evidence/chartEvidenceEnvelope.d.ts +154 -0
  273. package/dist/components/evidence/evidenceEnvelopeInput.d.ts +8 -0
  274. package/dist/components/evidence/evidenceEnvelopeValidation.d.ts +11 -0
  275. package/dist/components/evidence/evidenceGate.d.ts +30 -0
  276. package/dist/components/evidence/renderedSceneHash.d.ts +23 -0
  277. package/dist/components/evidence/stableJsonHash.d.ts +4 -0
  278. package/dist/components/export/chartConfig.d.ts +40 -5
  279. package/dist/components/export/chartConfigArtifact.d.ts +6 -0
  280. package/dist/components/legendLayout.d.ts +18 -0
  281. package/dist/components/legendStyles.d.ts +4 -0
  282. package/dist/components/realtime/BinAccumulator.d.ts +5 -1
  283. package/dist/components/realtime/types.d.ts +16 -7
  284. package/dist/components/recipes/adjacencyFlow.d.ts +12 -0
  285. package/dist/components/recipes/adjacencyFlowAggregation.d.ts +72 -0
  286. package/dist/components/recipes/adjacencyFlowGeometry.d.ts +79 -0
  287. package/dist/components/recipes/firstAvailableTrack.d.ts +17 -0
  288. package/dist/components/recipes/intervals.d.ts +1 -1
  289. package/dist/components/recipes/lineageDag.d.ts +17 -0
  290. package/dist/components/recipes/lineageDagHulls.d.ts +22 -0
  291. package/dist/components/recipes/transitDiagram.d.ts +75 -0
  292. package/dist/components/recipes/transitDiagramGeometry.d.ts +47 -0
  293. package/dist/components/semiotic-access.d.ts +9 -0
  294. package/dist/components/semiotic-ai-audits.d.ts +17 -0
  295. package/dist/components/semiotic-ai-core.d.ts +38 -18
  296. package/dist/components/semiotic-ai.d.ts +20 -20
  297. package/dist/components/semiotic-artifact-react.d.ts +10 -0
  298. package/dist/components/semiotic-artifact.d.ts +23 -0
  299. package/dist/components/semiotic-evidence.d.ts +10 -0
  300. package/dist/components/semiotic-experimental.d.ts +1 -1
  301. package/dist/components/semiotic-line.d.ts +9 -0
  302. package/dist/components/semiotic-network.d.ts +3 -0
  303. package/dist/components/semiotic-ordinal.d.ts +2 -0
  304. package/dist/components/semiotic-physics.d.ts +4 -4
  305. package/dist/components/semiotic-realtime-core.d.ts +3 -2
  306. package/dist/components/semiotic-recipes-core.d.ts +6 -0
  307. package/dist/components/semiotic-text.d.ts +2 -0
  308. package/dist/components/semiotic-themes-core.d.ts +3 -0
  309. package/dist/components/semiotic-utils-core.d.ts +19 -14
  310. package/dist/components/semiotic-xy.d.ts +3 -0
  311. package/dist/components/semiotic.d.ts +11 -5
  312. package/dist/components/server/renderDashboard.d.ts +37 -0
  313. package/dist/components/server/renderEvidence.d.ts +39 -0
  314. package/dist/components/server/renderToStaticSVG.d.ts +5 -30
  315. package/dist/components/server/serverChartConfigShared.d.ts +13 -0
  316. package/dist/components/server/serverChartConfigs.d.ts +9 -0
  317. package/dist/components/server/serverChartConfigsComposite.d.ts +4 -0
  318. package/dist/components/server/serverChartConfigsCustom.d.ts +2 -0
  319. package/dist/components/server/serverChartConfigsGeo.d.ts +1 -0
  320. package/dist/components/server/serverChartConfigsOrdinal.d.ts +3 -2
  321. package/dist/components/server/serverChartConfigsXY.d.ts +1 -0
  322. package/dist/components/server/serverChartConfigsXYExtra.d.ts +3 -0
  323. package/dist/components/server/serverCompositeChainReaction.d.ts +3 -0
  324. package/dist/components/server/serverOrdinalGauge.d.ts +3 -0
  325. package/dist/components/server/serverOrdinalLikert.d.ts +2 -0
  326. package/dist/components/server/staticSVGChrome.d.ts +1 -4
  327. package/dist/components/server/staticXYAxisTicks.d.ts +2 -38
  328. package/dist/components/server/staticXYGrid.d.ts +1 -1
  329. package/dist/components/server/svgSizing.d.ts +6 -0
  330. package/dist/components/shared/svgRoot.d.ts +17 -0
  331. package/dist/components/store/selectionProvenance.d.ts +14 -0
  332. package/dist/components/store/themeCore.d.ts +5 -1
  333. package/dist/components/stream/GeoPipelineStore.d.ts +1 -1
  334. package/dist/components/stream/GeoSVGOverlay.d.ts +4 -0
  335. package/dist/components/stream/MarginalGraphics.d.ts +3 -3
  336. package/dist/components/stream/MarginalGraphicsLazy.d.ts +22 -0
  337. package/dist/components/stream/NetworkPipelineStore.d.ts +2 -0
  338. package/dist/components/stream/NetworkSVGOverlay.d.ts +4 -0
  339. package/dist/components/stream/OrdinalPipelineStore.d.ts +1 -1
  340. package/dist/components/stream/OrdinalSVGOverlay.d.ts +4 -0
  341. package/dist/components/stream/PipelineStore.d.ts +1 -1
  342. package/dist/components/stream/SVGOverlay.d.ts +4 -0
  343. package/dist/components/stream/SceneToSVG.d.ts +4 -19
  344. package/dist/components/stream/SceneToSVGXY.d.ts +13 -0
  345. package/dist/components/stream/StreamGeoFrame.d.ts +1 -2
  346. package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -2
  347. package/dist/components/stream/XYGrid.d.ts +11 -0
  348. package/dist/components/stream/axisTickUtils.d.ts +0 -1
  349. package/dist/components/stream/canvasSetup.d.ts +8 -2
  350. package/dist/components/stream/customLayoutAttempt.d.ts +21 -0
  351. package/dist/components/stream/geoTypes.d.ts +1 -1
  352. package/dist/components/stream/hitTestUtils.d.ts +2 -0
  353. package/dist/components/stream/isServerEnvironment.d.ts +6 -0
  354. package/dist/components/stream/layouts/forceLayoutNodeSize.d.ts +12 -0
  355. package/dist/components/stream/layouts/forceLayoutPlugin.d.ts +2 -9
  356. package/dist/components/stream/layouts/forceLayoutWorkerClient.d.ts +2 -21
  357. package/dist/components/stream/layouts/forceLayoutWorkerPolicy.d.ts +21 -0
  358. package/dist/components/stream/layouts/index.d.ts +6 -12
  359. package/dist/components/stream/layouts/missingPlugin.d.ts +7 -0
  360. package/dist/components/stream/layouts/registerBuiltIn.d.ts +1 -0
  361. package/dist/components/stream/layouts/registry.d.ts +12 -0
  362. package/dist/components/stream/marginalConfig.d.ts +3 -0
  363. package/dist/components/stream/networkCustomLayout.d.ts +7 -0
  364. package/dist/components/stream/networkCustomLayoutOutput.d.ts +13 -0
  365. package/dist/components/stream/networkCustomLayoutRunner.d.ts +1 -1
  366. package/dist/components/stream/networkTypes.d.ts +5 -1
  367. package/dist/components/stream/ordinalTypes.d.ts +1 -1
  368. package/dist/components/stream/overlayAccessibleText.d.ts +18 -0
  369. package/dist/components/stream/physics/PhysicsControllers.d.ts +1 -1
  370. package/dist/components/stream/physics/PhysicsKernel.d.ts +9 -0
  371. package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +5 -4
  372. package/dist/components/stream/physics/PhysicsPipelineTypes.d.ts +9 -0
  373. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +4 -1
  374. package/dist/components/stream/physics/physicsCanvasCoordinates.d.ts +5 -0
  375. package/dist/components/stream/physics/physicsFixedPosition.d.ts +16 -0
  376. package/dist/components/stream/physics/physicsKernelCloning.d.ts +6 -0
  377. package/dist/components/stream/physics/physicsPipelineObservations.d.ts +2 -0
  378. package/dist/components/stream/physics/physicsPipelineSettle.d.ts +15 -9
  379. package/dist/components/stream/physics/physicsRegionRuntime.d.ts +8 -17
  380. package/dist/components/stream/physics/physicsSemanticUI.d.ts +9 -0
  381. package/dist/components/stream/pipelineConfig.d.ts +4 -0
  382. package/dist/components/stream/pipelineDomainResolution.d.ts +6 -0
  383. package/dist/components/stream/pipelineStoreUpdateResults.d.ts +1 -1
  384. package/dist/components/stream/renderers/pointCanvasRenderer.d.ts +4 -0
  385. package/dist/components/stream/renderers/resolveCSSColor.d.ts +4 -4
  386. package/dist/components/stream/resolveXYAxes.d.ts +13 -0
  387. package/dist/components/stream/sceneToSVGShared.d.ts +2 -1
  388. package/dist/components/stream/seriesGeometry.d.ts +13 -0
  389. package/dist/components/stream/streamEncodingTypes.d.ts +53 -0
  390. package/dist/components/stream/types.d.ts +12 -54
  391. package/dist/components/stream/useEnsureCustomXYRenderers.d.ts +18 -0
  392. package/dist/components/stream/useGeoFrameHandle.d.ts +16 -0
  393. package/dist/components/stream/useMarginalValues.d.ts +13 -0
  394. package/dist/components/stream/useOrdinalFrameHandle.d.ts +15 -0
  395. package/dist/components/stream/useXYFrameHandle.d.ts +15 -0
  396. package/dist/components/stream/xyAxisTicks.d.ts +25 -0
  397. package/dist/components/stream/xyCanvasRenderers.d.ts +4 -4
  398. package/dist/components/stream/xyDateTicks.d.ts +3 -2
  399. package/dist/components/stream/xyFrameAxisTypes.d.ts +2 -0
  400. package/dist/components/stream/xyPlugins/areaPlugin.d.ts +2 -0
  401. package/dist/components/stream/xyPlugins/barPlugin.d.ts +2 -0
  402. package/dist/components/stream/xyPlugins/candlestickPlugin.d.ts +2 -0
  403. package/dist/components/stream/xyPlugins/customPlugin.d.ts +6 -0
  404. package/dist/components/stream/xyPlugins/heatmapPlugin.d.ts +2 -0
  405. package/dist/components/stream/xyPlugins/lineFamily.d.ts +5 -0
  406. package/dist/components/stream/xyPlugins/linePlugin.d.ts +2 -0
  407. package/dist/components/stream/xyPlugins/missingPlugin.d.ts +7 -0
  408. package/dist/components/stream/xyPlugins/mixedPlugin.d.ts +2 -0
  409. package/dist/components/stream/xyPlugins/pointPlugin.d.ts +3 -0
  410. package/dist/components/stream/xyPlugins/registerBuiltIn.d.ts +1 -0
  411. package/dist/components/stream/xyPlugins/registry.d.ts +31 -0
  412. package/dist/components/stream/xyPlugins/stackedAreaPlugin.d.ts +2 -0
  413. package/dist/components/stream/xyPlugins/swarmPlugin.d.ts +2 -0
  414. package/dist/components/stream/xyPlugins/waterfallPlugin.d.ts +2 -0
  415. package/dist/components/stream/xySceneBuilders/ribbonScene.d.ts +1 -1
  416. package/dist/components/stream/xySceneBuilders/types.d.ts +1 -0
  417. package/dist/components/text/annotationTextLayout.d.ts +28 -0
  418. package/dist/components/text/pretextAnnotationLayout.d.ts +29 -0
  419. package/dist/components/text/usePretextAnnotations.d.ts +12 -0
  420. package/dist/controls.module.min.js +1 -1
  421. package/dist/forceLayoutWorker.js +1 -1
  422. package/dist/geo.min.js +1 -1
  423. package/dist/geo.module.min.js +1 -1
  424. package/dist/network.module.min.js +1 -1
  425. package/dist/ordinal.module.min.js +1 -1
  426. package/dist/physics-matter.min.js +1 -1
  427. package/dist/physics-matter.module.min.js +1 -1
  428. package/dist/physics-rapier.min.js +1 -1
  429. package/dist/physics-rapier.module.min.js +1 -1
  430. package/dist/physics.module.min.js +1 -1
  431. package/dist/physicsWorker.js +1 -1
  432. package/dist/processSankeyLayoutWorker.js +1 -1
  433. package/dist/rough.min.js +1 -1
  434. package/dist/rough.module.min.js +1 -1
  435. package/dist/semiotic-access.d.ts +9 -0
  436. package/dist/semiotic-access.min.js +2 -0
  437. package/dist/semiotic-access.module.min.js +2 -0
  438. package/dist/semiotic-ai-artifact-policy-constants.module.min.js +2 -0
  439. package/dist/semiotic-ai-core.d.ts +38 -18
  440. package/dist/semiotic-ai-core.min.js +1 -1
  441. package/dist/semiotic-ai-core.module.min.js +1 -1
  442. package/dist/semiotic-ai-hash-primitives.module.min.js +2 -0
  443. package/dist/semiotic-ai.d.ts +20 -20
  444. package/dist/semiotic-ai.module.min.js +1 -1
  445. package/dist/semiotic-artifact-react.d.ts +10 -0
  446. package/dist/semiotic-artifact-react.min.js +2 -0
  447. package/dist/semiotic-artifact-react.module.min.js +2 -0
  448. package/dist/semiotic-artifact.d.ts +23 -0
  449. package/dist/semiotic-artifact.min.js +1 -0
  450. package/dist/semiotic-artifact.module.min.js +1 -0
  451. package/dist/semiotic-client-cjs-shared.min.js +1 -1
  452. package/dist/semiotic-client-glyph.module.min.js +1 -1
  453. package/dist/semiotic-client-responsive.module.min.js +1 -1
  454. package/dist/semiotic-client-shared.module.min.js +1 -1
  455. package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +1 -1
  456. package/dist/semiotic-data.min.js +1 -1
  457. package/dist/semiotic-data.module.min.js +1 -1
  458. package/dist/semiotic-evidence.d.ts +10 -0
  459. package/dist/semiotic-evidence.min.js +1 -0
  460. package/dist/semiotic-evidence.module.min.js +1 -0
  461. package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
  462. package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -1
  463. package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
  464. package/dist/semiotic-experimental-vacp.min.js +1 -1
  465. package/dist/semiotic-experimental-vacp.module.min.js +1 -1
  466. package/dist/semiotic-experimental.d.ts +1 -1
  467. package/dist/semiotic-line.d.ts +9 -0
  468. package/dist/semiotic-line.min.js +2 -0
  469. package/dist/semiotic-line.module.min.js +2 -0
  470. package/dist/semiotic-network.d.ts +3 -0
  471. package/dist/semiotic-ordinal.d.ts +2 -0
  472. package/dist/semiotic-physics.d.ts +4 -4
  473. package/dist/semiotic-realtime-core.d.ts +3 -2
  474. package/dist/semiotic-realtime-core.module.min.js +1 -1
  475. package/dist/semiotic-realtime-react.module.min.js +1 -1
  476. package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
  477. package/dist/semiotic-recipes-core.d.ts +6 -0
  478. package/dist/semiotic-recipes-core.module.min.js +1 -1
  479. package/dist/semiotic-recipes-geo-cjs.min.js +1 -1
  480. package/dist/semiotic-recipes-react.min.js +1 -1
  481. package/dist/semiotic-server-edge-node.module.min.js +1 -1
  482. package/dist/semiotic-server-edge.min.js +1 -1
  483. package/dist/semiotic-server-edge.module.min.js +1 -1
  484. package/dist/semiotic-server-node.min.js +1 -1
  485. package/dist/semiotic-server-node.module.min.js +1 -1
  486. package/dist/semiotic-text.d.ts +2 -0
  487. package/dist/semiotic-text.min.js +2 -0
  488. package/dist/semiotic-text.module.min.js +2 -0
  489. package/dist/semiotic-themes-core.d.ts +3 -0
  490. package/dist/semiotic-themes-core.min.js +1 -1
  491. package/dist/semiotic-themes-core.module.min.js +1 -1
  492. package/dist/semiotic-themes.min.js +1 -1
  493. package/dist/semiotic-themes.module.min.js +1 -1
  494. package/dist/semiotic-utils-core.d.ts +19 -14
  495. package/dist/semiotic-utils-core.min.js +1 -1
  496. package/dist/semiotic-utils-core.module.min.js +1 -1
  497. package/dist/semiotic-value.module.min.js +1 -1
  498. package/dist/semiotic-xy.d.ts +3 -0
  499. package/dist/semiotic.d.ts +11 -5
  500. package/dist/semiotic.module.min.js +1 -1
  501. package/dist/server.min.js +1 -1
  502. package/dist/server.module.min.js +1 -1
  503. package/dist/xy.module.min.js +1 -1
  504. package/package.json +91 -71
  505. package/spec/README.md +8 -3
  506. package/spec/v0.1/artifact-contract.schema.json +2299 -0
  507. package/spec/v0.1/examples/artifact-contract-full.json +369 -0
  508. package/spec/v0.1/examples/artifact-contract-unknown-state.json +46 -0
  509. package/dist/c-3BLJEQNG.min.js +0 -1
  510. package/dist/c-3KZD6AXJ.min.js +0 -1
  511. package/dist/c-4TWEX5HG.min.js +0 -1
  512. package/dist/c-52TEGIUJ.min.js +0 -1
  513. package/dist/c-5YCIX3VZ.min.js +0 -1
  514. package/dist/c-6FEKTA3U.min.js +0 -1
  515. package/dist/c-6O5EVOPH.min.js +0 -1
  516. package/dist/c-74HEEZGK.min.js +0 -1
  517. package/dist/c-AKAF6JAD.min.js +0 -1
  518. package/dist/c-BBKITSXB.min.js +0 -1
  519. package/dist/c-BWNB6USU.min.js +0 -1
  520. package/dist/c-C25ENHIK.min.js +0 -1
  521. package/dist/c-CDR5AO3R.min.js +0 -1
  522. package/dist/c-COHXCW3Q.min.js +0 -1
  523. package/dist/c-DADXPJXV.min.js +0 -1
  524. package/dist/c-E3JFRRMI.min.js +0 -1
  525. package/dist/c-EBFPQHHO.min.js +0 -1
  526. package/dist/c-G36WS6LN.min.js +0 -1
  527. package/dist/c-GGISSW5E.min.js +0 -1
  528. package/dist/c-GIKRQI4X.min.js +0 -1
  529. package/dist/c-GPYOFETM.min.js +0 -1
  530. package/dist/c-IDUHYYSI.min.js +0 -1
  531. package/dist/c-IUHFPMHD.min.js +0 -1
  532. package/dist/c-J5G56TUH.min.js +0 -1
  533. package/dist/c-JAZ73J32.min.js +0 -1
  534. package/dist/c-KG3NXHAL.min.js +0 -1
  535. package/dist/c-KII3PLZE.min.js +0 -1
  536. package/dist/c-LIXGXMNS.min.js +0 -1
  537. package/dist/c-LVEY6D6B.min.js +0 -1
  538. package/dist/c-M4Y3BHFR.min.js +0 -1
  539. package/dist/c-MAIICR2Z.min.js +0 -1
  540. package/dist/c-MG5DM6VE.min.js +0 -1
  541. package/dist/c-MNF2S4AA.min.js +0 -1
  542. package/dist/c-MT3WBK7M.min.js +0 -1
  543. package/dist/c-NY3JWV2K.min.js +0 -1
  544. package/dist/c-O6U6K4CW.min.js +0 -1
  545. package/dist/c-OQ7M4AGV.min.js +0 -1
  546. package/dist/c-OXYMVK7Q.min.js +0 -1
  547. package/dist/c-PPWDL5ZI.min.js +0 -1
  548. package/dist/c-QHF5YON3.min.js +0 -1
  549. package/dist/c-RR3GO5SW.min.js +0 -1
  550. package/dist/c-RSVIHIQ4.min.js +0 -1
  551. package/dist/c-S2BXNNJN.min.js +0 -1
  552. package/dist/c-S6U5CGT5.min.js +0 -1
  553. package/dist/c-SLGMUBUL.min.js +0 -1
  554. package/dist/c-SUILCHWU.min.js +0 -1
  555. package/dist/c-TZW3JGJ5.min.js +0 -1
  556. package/dist/c-US5ZFT6E.min.js +0 -1
  557. package/dist/c-USFMFKIH.min.js +0 -1
  558. package/dist/c-UUKVD4WB.min.js +0 -1
  559. package/dist/c-VGW3VG3I.min.js +0 -1
  560. package/dist/c-W3CE4A4S.min.js +0 -1
  561. package/dist/c-WJCD5EUY.min.js +0 -1
  562. package/dist/c-X5UBGU2V.min.js +0 -1
  563. package/dist/c-YDAY2WFR.min.js +0 -1
  564. package/dist/c-ZOWWU34K.min.js +0 -1
  565. /package/dist/{c-N4G2L7ID.min.js → c-HYW2XA4Q.min.js} +0 -0
  566. /package/dist/{c-OCI56QF2.min.js → c-V4XMSLC3.min.js} +0 -0
@@ -0,0 +1 @@
1
+ function t(t,l,i,n,c){if(0>=l.size)return;let f=l.glyph;if(!f||!f.parts?.length)return;let s=a(f,l.size);if(0>=s.scale)return;let p=(l.style.opacity??1)*(l._decayOpacity??1);if(0>=p)return;let y=l=>{let e=r(t,l,l);return"string"==typeof e?e:l},h=l.color??("string"==typeof l.style.fill?l.style.fill:void 0);t.save(),t.translate(i,n),l.rotation&&t.rotate(l.rotation),t.translate(s.offsetX,s.offsetY),t.scale(s.scale,s.scale),t.globalAlpha=c*p*(l.style.fillOpacity??1);let g=o(f,l.fraction??1,l.fractionStart??0,l.fractionDirection??"horizontal");g&&l.ghostColor&&e(t,f,h,l.accent,l.ghostColor,y),g&&(t.beginPath(),t.rect(g.x,g.y,g.width,g.height),t.clip()),e(t,f,h,l.accent,void 0,y),t.restore()}function l(l,e){let o=l.globalAlpha;for(let a of e)"glyph"===a.type&&t(l,a,a.cx,a.cy,o);l.globalAlpha=o}import{drawGlyphParts as e,glyphFractionClipRect as o,glyphPlacement as a,resolveCanvasFill as r}from"./c-553QUDKA.min.js";var i=(l,e)=>{let o=l.globalAlpha;for(let a of e)"glyph"===a.type&&t(l,a,a.x,a.y,o);l.globalAlpha=o};export{i as glyphCanvasRenderer,l as networkGlyphRenderer};
@@ -0,0 +1 @@
1
+ function t(t,e){let[n,r]=t.viewBox??j,[i,l]=t.anchor??F,o=r>0?r:1,a=Math.max(0,e)/o,s=(n>0?n:o)*a,u=o*a;return{width:s,height:u,scale:a,offsetX:-i*s,offsetY:-l*u}}function e(e,n){let r=t(e,n),i=[[r.offsetX,r.offsetY],[r.offsetX+r.width,r.offsetY],[r.offsetX,r.offsetY+r.height],[r.offsetX+r.width,r.offsetY+r.height]],l=0;for(let[t,e]of i){let n=Math.sqrt(t*t+e*e);n>l&&(l=n)}return l}function n(t,e,n,r){if("none"!==t)return"color"===t||null==t?e??r:"accent"===t?n:t}function r(t){if(typeof Path2D>"u")return null;q||(q=new Map);let e=q.get(t);if(e)return e;let n=new Path2D(t);return q.size>1024&&q.clear(),q.set(t,n),n}function i(t,e,n=0,r="horizontal"){let[i,l]=t.viewBox??j,o=Math.min(1,Math.max(0,n)),a=Math.min(1,Math.max(0,e));return a>o?o>0||1>a?"vertical"===r?{x:0,y:l*(1-a),width:i,height:l*(a-o)}:{x:i*o,y:0,width:i*(a-o),height:l}:null:{x:0,y:0,width:0,height:0}}function l(e,n){let r=t(e,n);return{centerDx:r.offsetX+r.width/2,centerDy:r.offsetY+r.height/2,halfWidth:r.width/2,halfHeight:r.height/2,radius:Math.hypot(r.width,r.height)/2}}function o(t,e,i,l,o,a=t=>t){for(let s of e.parts){let e=r(s.d);if(!e)continue;let u=s.opacity??1,f=t.globalAlpha;1!==u&&(t.globalAlpha=f*u);let c=o?"none"===s.fill?void 0:o:n(s.fill,i,l);c&&(t.fillStyle=a(c),t.fill(e));let h=o?s.stroke&&"none"!==s.stroke?o:void 0:n(s.stroke??"none",i,l);h&&(t.strokeStyle=a(h),t.lineWidth=s.strokeWidth??1,t.lineCap=s.strokeLinecap??"butt",t.lineJoin=s.strokeLinejoin??"miter",t.stroke(e)),1!==u&&(t.globalAlpha=f)}}function a(t){return{type:"hatch",background:t.background,stroke:t.stroke,lineWidth:t.lineWidth,spacing:t.spacing,angle:t.angle}}function s(t={},e){let n,{background:r="transparent",stroke:i="#000",lineWidth:l=1.5,spacing:o=6,angle:s=45}=t,u={background:r,stroke:i,lineWidth:l,spacing:o,angle:s},f=Math.max(8,Math.ceil(2*o));try{n=function(t){return"u">typeof OffscreenCanvas?new OffscreenCanvas(t,t):(N||(N=document.createElement("canvas")),N.width=t,N.height=t,N)}(f)}catch{return a(u)}let c=n.getContext("2d");if(!c)return a(u);r&&"transparent"!==r?(c.fillStyle=r,c.fillRect(0,0,f,f)):c.clearRect(0,0,f,f),c.strokeStyle=i,c.lineWidth=l,c.lineCap="square";let h=s*Math.PI/180;if(45===s||-45===s){let t=s>0?1:-1;for(let e=-f;2*f>=e;e+=o)c.beginPath(),c.moveTo(e,0),c.lineTo(e+t*f,f),c.stroke()}else{c.save(),c.translate(f/2,f/2),c.rotate(h);let t=2*f;for(let e=-t;t>=e;e+=o)c.beginPath(),c.moveTo(-t,e),c.lineTo(t,e),c.stroke();c.restore()}return(e||c).createPattern(n,"repeat")}function u(t,e){!function(){if(z||typeof window>"u"||typeof document>"u")return;z=!0;let t=t=>{if(!t?.includes("--"))return"";let e=document.createElement("span").style;return e.cssText=t,Array.from(e).filter(t=>t.startsWith("--")).sort().map(t=>`${t}:${e.getPropertyValue(t)}!${e.getPropertyPriority(t)}`).join(";")},e=(e,n)=>{let r=e.target;if(!(r instanceof Element))return!1;if(r===n||r.contains(n))return!0;if(!n.contains(r))return!1;let i="CANVAS"===r.tagName;return!(!i&&!r.querySelector("canvas")||i&&"style"===e.attributeName&&t(e.oldValue)===t(r.getAttribute("style")))},n=t=>{let n=[];for(let r of B){let i=r.getElement();i&&(!t||t.some(t=>e(t,i)))&&n.push(r)}if(!t||0!==n.length){Y++;for(let t of n)t.listener()}};if("u">typeof MutationObserver&&document.documentElement&&(T=new MutationObserver(t=>{n(t)})).observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme","data-semiotic-theme","data-semiotic-theme-mode"],attributeOldValue:!0,subtree:!0}),"function"==typeof window.matchMedia)try{I=window.matchMedia("(prefers-color-scheme: dark)"),R=()=>n(),"function"==typeof I.addEventListener?I.addEventListener("change",R):"function"==typeof I.addListener&&I.addListener(R)}catch{}document.fonts&&"function"==typeof document.fonts.addEventListener&&(V=document.fonts).addEventListener("loadingdone",D=()=>n())}();let n={getElement:t,listener:e};return B.add(n),()=>{B.delete(n)&&0===B.size&&(T?.disconnect(),T=null,I&&R&&("function"==typeof I.removeEventListener?I.removeEventListener("change",R):"function"==typeof I.removeListener&&I.removeListener(R)),I=null,R=null,V&&D&&V.removeEventListener("loadingdone",D),V=null,D=null,z=!1)}}function f(t,e){if(!e)return e;let n=function(t){let e=t.trim();if(!e.startsWith("var(")||!e.endsWith(")"))return null;let n=e.slice(4,-1),r=n.indexOf(",");if(-1===r){let t=n.trim();return t.startsWith("--")?{name:t}:null}let i=n.slice(0,r).trim(),l=n.slice(r+1).trim();return i.startsWith("--")?{name:i,fallback:l||void 0}:null}(e);if(!n)return e;let r=()=>n.fallback?f(t,n.fallback):e,i=t.canvas;if(!i)return r();let l=X.get(i);(!l||l.version!==Y)&&(l={version:Y,map:new Map},X.set(i,l));let o=l.map.get(e);if(void 0!==o)return o;let a=getComputedStyle(i).getPropertyValue(n.name).trim()||r()||e;return l.map.set(e,a),a}function c(t){Y++}function h(){return Y}function d(t){return"object"==typeof t&&null!==t&&"hatch"===t.type}function p(t){return["hatch",t.background??"transparent",t.stroke??"#000",t.lineWidth??1.5,t.spacing??6,t.angle??45,t.lineOpacity??1].join("|")}function m(t,e){let n=2166136261,r=p(e);for(let t=0;r.length>t;t++)n^=r.charCodeAt(t),n=Math.imul(n,16777619);return`${t}-hatch-${(n>>>0).toString(36)}`}function y(t,e){let{background:n="transparent",stroke:r="#000",lineWidth:i=1.5,spacing:l=6,angle:o=45,lineOpacity:a=1}=t,s=Math.max(8,Math.ceil(2*l));return U("pattern",{id:e,width:s,height:s,patternUnits:"userSpaceOnUse",patternTransform:0!==o?`rotate(${o})`:void 0,children:[n&&"transparent"!==n&&G("rect",{width:s,height:s,fill:n}),G("line",{x1:0,y1:0,x2:0,y2:s,stroke:r,strokeWidth:i,strokeOpacity:a}),G("line",{x1:l,y1:0,x2:l,y2:s,stroke:r,strokeWidth:i,strokeOpacity:a})]},e)}function g(t,e,n="#4e79a7"){if(d(t)){let n=m(e,t);return{fill:`url(#${n})`,def:y(t,n)}}return t&&"string"==typeof t?{fill:t}:{fill:n}}function b(t,e,n,r){if(!t||"object"!=typeof t)return;let i=t;if(!Array.isArray(i.stops))return;let l=i.stops.flatMap(t=>{if(!t||"object"!=typeof t)return[];let{offset:e,color:n,opacity:i}=t;return"number"==typeof e&&Number.isFinite(e)?[{offset:Math.max(0,Math.min(1,e)),color:"string"==typeof n&&n?n:r,opacity:"number"==typeof i&&Number.isFinite(i)?Math.max(0,Math.min(1,i)):void 0}]:[]}).sort((t,e)=>t.offset-e.offset);if(!l.length)return;let o="horizontal"===i.direction?"horizontal":"vertical"===i.direction?"vertical":n,a=e+"-gradient";return{fill:`url(#${a})`,def:G("linearGradient",{id:a,x1:0,y1:0,x2:"horizontal"===o?"100%":0,y2:"vertical"===o?"100%":0,children:l.map((t,e)=>G("stop",{offset:100*t.offset+"%",stopColor:t.color,stopOpacity:t.opacity},`${t.offset}-${e}`))},a)}}function v(t,e,n){if(n)return n;let r=t??"circle";if("chevron"===r)return function(t){let e=1.5*k(t),n=.92*e;return`M0,${-e}L${n},${(.78*e).toFixed(3)}L0,${(.28*e).toFixed(3)}L${-n},${(.78*e).toFixed(3)}Z`}(e);let i=Object.prototype.hasOwnProperty.call(rt,r)?rt[r]:Z;return J(i,Math.max(1,e))()??""}function k(t){return Math.sqrt(Math.max(1,t)/Math.PI)}function w(t,e){let n=new Map,r=0;return i=>{let l=t(i)+"",o=e&&Object.prototype.hasOwnProperty.call(e,l)?e[l]:void 0;if(o&&it.has(o))return o;let a=n.get(l);return a||(a=lt[r%lt.length],r++,n.set(l,a)),a}}function M(t,e){let n=t.fillStyle,r="#010203";try{t.fillStyle=r,t.fillStyle=e}catch{return t.fillStyle=n,[78,121,167]}let i=t.fillStyle;if(t.fillStyle=n,"string"!=typeof i)return[78,121,167];if(i.toLowerCase()===r&&e.trim().toLowerCase()!==r)return[78,121,167];if(i.startsWith("#"))return[parseInt(i.slice(1,3),16),parseInt(i.slice(3,5),16),parseInt(i.slice(5,7),16)];let l=i.match(/(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return l?[+l[1],+l[2],+l[3]]:[78,121,167]}function x(t){switch(t){case"monotoneX":return ot;case"monotoneY":return at;case"cardinal":return st;case"catmullRom":return ut;case"step":return ft;case"stepBefore":return ct;case"stepAfter":return ht;case"basis":return dt;case"natural":return pt;default:return null}}function W(t,e,n){if(null==e)return n;if(d(e)){let r=function(t,e){let n=t.background??"transparent",r=t.stroke??"#000",i="transparent"===n||"none"===n?n:f(e,n)||n,l=f(e,r)||r||"#000",o="u">typeof window&&window.devicePixelRatio||1,a=`${p(t)}|${i}|${l}@${o}`,u=H.get(a);if(void 0!==u)return u;let c=s({background:i,stroke:l,lineWidth:t.lineWidth,spacing:t.spacing,angle:t.angle},e),h=d(c)?null:c;return H.set(a,h),h}(e,t);return r||e.background&&f(t,e.background)||n}return"string"!=typeof e?e:f(t,e)||n}function $(t,e,n){let r=W(t,e,n);if("string"==typeof r&&r.trim().startsWith("var(")){let e=f(t,n);return e&&!e.trim().startsWith("var(")?e:n}return r}function S(t,e){if(null==e)return;let n=W(t,e,"");return""===n?void 0:n}function L(t,e,n,r,i,l,o){let a=e.stops.filter(t=>Number.isFinite(t.offset)&&(null==t.opacity||Number.isFinite(t.opacity)));if(2>a.length)return null;let s=t.createLinearGradient(r,i,l,o);for(let e of a)s.addColorStop(Math.max(0,Math.min(1,e.offset)),O(t,e,n));return s}function O(t,e,n){let r=e.color??n,i=f(t,r)||r;if(null==e.opacity)return i;let l=Math.max(0,Math.min(1,e.opacity)),[o,a,s]=M(t,i);return`rgba(${o},${a},${s},${l})`}function E(t,e,n,r){e.fill&&(t.fillStyle=W(t,e.fill,n),void 0!==e.fillOpacity&&(t.globalAlpha=(e.opacity??1)*e.fillOpacity),r())}function P(t,e,n){!e.stroke||"none"===e.stroke||(t.strokeStyle=f(t,e.stroke)||e.stroke,t.lineWidth=e.strokeWidth??1,t.globalAlpha=(e.opacity??1)*(e.strokeOpacity??1),n())}function A(t){return(t.tl??0)>0||(t.tr??0)>0||(t.br??0)>0||(t.bl??0)>0}function C(t){let e=t.cornerRadii;if(!e)return{tl:0,tr:0,br:0,bl:0};let n=Math.min(t.w,t.h)/2,r=t=>Math.max(0,Math.min(t??0,n));return{tl:r(e.tl),tr:r(e.tr),br:r(e.br),bl:r(e.bl)}}var j=[40,40],F=[.5,.5],q=null,N=null,X=new WeakMap,Y=0,z=!1,T=null,I=null,R=null,V=null,D=null,B=new Set;import{jsx as G,jsxs as U}from"react/jsx-runtime";var H=new Map;import{symbol as J,symbolCircle as Z,symbolCross as K,symbolDiamond as Q,symbolSquare as _,symbolStar as tt,symbolTriangle as et,symbolWye as nt}from"d3-shape";var rt={circle:Z,square:_,triangle:et,diamond:Q,star:tt,cross:K,wye:nt},it=new Set(["circle","square","triangle","diamond","star","cross","wye","chevron"]),lt=["circle","triangle","diamond","star","square","chevron","cross","wye"];import{curveMonotoneX as ot,curveMonotoneY as at,curveCardinal as st,curveCatmullRom as ut,curveStep as ft,curveStepBefore as ct,curveStepAfter as ht,curveBasis as dt,curveNatural as pt}from"d3-shape";export{v as symbolPathString,k as symbolRadius,w as makeSymbolResolver,t as glyphPlacement,e as glyphExtent,n as resolveGlyphPaint,r as getGlyphPath2D,i as glyphFractionClipRect,l as glyphHitGeometry,o as drawGlyphParts,u as subscribeToCSSColorInvalidation,f as resolveCSSColor,c as clearCSSColorCache,h as getCSSColorCacheVersion,M as parseCanvasColor,s as createHatchPattern,d as isHatchFill,m as hatchFillId,y as hatchPatternDef,g as resolveSvgFill,b as resolveAnnotationGradient,x as resolveCurveFactory,W as resolveCanvasFill,$ as resolveCanvasPaint,S as coerceCanvasFill,L as buildLinearFillGradient,E as paintNetworkFill,P as paintNetworkStroke,A as hasAnyCornerRadius,C as clampCornerRadii};
@@ -0,0 +1 @@
1
+ function e(e){if(null==e)return;if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};let t={};return"number"==typeof e.top&&(t.top=e.top),"number"==typeof e.right&&(t.right=e.right),"number"==typeof e.bottom&&(t.bottom=e.bottom),"number"==typeof e.left&&(t.left=e.left),t}function t(t){let o=l(null);return i(t.imperativeRef,{variant:t.imperativeVariant,frameRef:o}),{frameRef:o,resolved:r(t.mode,{width:t.width,height:t.height,showGrid:t.showGrid,enableHover:t.enableHover,showLegend:t.showLegend,title:t.title,description:t.description,summary:t.summary,accessibleTable:t.accessibleTable,xLabel:t.xLabel,yLabel:t.yLabel,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules}),normalizedMargin:a(()=>e(t.margin),[t.margin])}}function o(e){let o=t(e),{resolved:i,normalizedMargin:r}=o,a=n({data:e.data??[],rawData:e.data,colorBy:e.colorBy,colorScheme:e.colorScheme,legendInteraction:e.legendInteraction,legendPosition:e.legendPosition,frameLegend:e.frameLegend,selection:e.selection,linkedHover:e.linkedHover,hoverHighlight:e.hoverHighlight,fallbackFields:"string"==typeof e.colorBy?[e.colorBy]:[],unwrapData:e.unwrapData,onObservation:e.onObservation,onClick:e.onClick,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,chartType:e.chartTypeLabel,chartId:e.chartId,showLegend:i.showLegend,legend:e.legend,userMargin:r,marginDefaults:i.marginDefaults,loading:e.loading,loadingContent:e.loadingContent,emptyContent:e.emptyContent,width:i.width,height:i.height});return{...o,safeData:a.data,setup:a,earlyReturn:a.earlyReturn}}import{useChartSetup as n,useFrameImperativeHandle as i}from"./c-KCRJGUHP.min.js";import{useChartMode as r}from"./c-LMGSSD2E.min.js";import{useMemo as a,useRef as l}from"react";export{e as normalizePartialMargin,t as useCustomChartScaffold,o as useCustomChartSetup};
@@ -0,0 +1 @@
1
+ function r({width:r,height:s,totalWidth:a,totalHeight:h,margin:m,scales:d,onBrush:f}){let p=e(null),v=e(null),b=e(f);b.current=f;let g=e(d);g.current=d;let M=e(!1),x=e(null),w="horizontal"===d?.projection,y=e(w);y.current=w;let j=t({label:"Ordinal value range brush",onAction:r=>{let t=g.current,e=v.current;if(!t||!e||!p.current)return;let n=l(p.current).select(".brush-g");if("clear"===r.type)return M.current=!0,n.call(e.move,null),M.current=!1,x.current=null,void b.current(null);if(("left"===r.direction||"right"===r.direction)!=!!y.current)return;let u=t.r.domain(),[c,i]=[Math.min(...u),Math.max(...u)],o=(i-c)/20,s=x.current?.r??[c+.4*(i-c),c+.6*(i-c)],a="left"===r.direction||"down"===r.direction?-1:1,[h,m]=s;if(r.resize)0>a?h=Math.max(c,h-o):m=Math.min(i,m+o);else{let r=m-h;h=Math.max(c,Math.min(i-r,h+a*o)),m=h+r}let d={r:[h,m]};M.current=!0,n.call(e.move,y.current?[t.r(h),t.r(m)]:[t.r(m),t.r(h)]),M.current=!1,x.current=d,b.current(d)}});return n(()=>{if(!p.current)return;let t=l(p.current).select(".brush-g"),e=w?u():c();return e.extent([[0,0],[r,s]]),e.on("brush end",r=>{if(M.current)return;let t=g.current;if(!t)return;if(!r.selection)return x.current=null,void b.current(null);let e,[n,l]=r.selection;e=y.current?[t.r.invert(n),t.r.invert(l)]:[t.r.invert(l),t.r.invert(n)];let u={r:e};x.current=u,b.current(u)}),t.call(e),v.current=e,t.select(".selection").attr("fill","steelblue").attr("fill-opacity",.15).attr("stroke","steelblue").attr("stroke-width",1),()=>{e.on("brush end",null),v.current=null}},[r,s,w]),n(()=>{if(!(d&&v.current&&x.current&&p.current))return;let r=x.current,t=l(p.current).select(".brush-g"),e=d.r(r.r[0]),n=d.r(r.r[1]);w?(M.current=!0,t.call(v.current.move,[e,n]),M.current=!1):(M.current=!0,t.call(v.current.move,[n,e]),M.current=!1)},[d,w]),o("svg",{ref:p,width:a,height:h,...j.svgProps,style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[i("title",{children:j.svgProps["aria-label"]}),i("desc",{id:j.descriptionId,children:j.description}),i("g",{className:"brush-g",transform:`translate(${m.left},${m.top})`,style:{pointerEvents:"all"}})]})}import{useBrushAccessibility as t}from"./c-LYQMZMZQ.min.js";import{useRef as e,useEffect as n}from"react";import{select as l}from"d3-selection";import{brushX as u,brushY as c}from"d3-brush";import{jsx as i,jsxs as o}from"react/jsx-runtime";export{r as OrdinalBrushOverlay};
@@ -0,0 +1 @@
1
+ function e(e,r,t,n){let[l,i]=[Math.min(...r),Math.max(...r)],u=(i-l)/20,[c,o]=e;if(n)0>t?c=Math.max(l,c-u):o=Math.min(i,o+u);else{let e=o-c;c=Math.max(l,Math.min(i-e,c+t*u)),o=c+e}return[c,o]}function r(e,r){let t=0,n=r.length-1;for(;n>t;){let l=t+n+1>>1;r[l]>e?n=l-1:t=l}return r[t]}function t(e,r){let t=0,n=r.length-1;for(;n>t;){let l=t+n>>1;e>r[l]?t=l+1:n=l}return r[t]}function n({width:n,height:d,totalWidth:m,totalHeight:y,margin:v,dimension:b,scales:g,onBrush:p,binSize:M,snap:w,binBoundaries:z,snapDuring:j,streaming:k}){let B=i(null),P=i(null),Q=i(p);Q.current=p;let Y=i(g);Y.current=g;let Z=c(()=>z?[...z].sort((e,r)=>e-r):void 0,[z]),$=i(Z);$.current=Z;let A=i(!1),C=i(null),D=l({label:"xy"===b?"Two-dimensional data range brush":b.toUpperCase()+" data range brush",onAction:r=>{let t=Y.current,n=P.current;if(!t||!n||!B.current)return;let l=o(B.current).select(".brush-g");if("clear"===r.type)return A.current=!0,l.call(n.move,null),A.current=!1,C.current=null,void Q.current(null);let i=t.x.domain(),u=t.y.domain(),c=C.current,s=c?.x??[i[0]+.4*(i[1]-i[0]),i[0]+.6*(i[1]-i[0])],a=c?.y??[u[0]+.4*(u[1]-u[0]),u[0]+.6*(u[1]-u[0])],f="left"===r.direction||"right"===r.direction,h="left"===r.direction||"down"===r.direction?-1:1;if(f&&"y"!==b&&(s=e(s,i,h,r.resize)),!f&&"x"!==b&&(a=e(a,u,h,r.resize)),f&&"y"===b||!f&&"x"===b)return;let x={x:s,y:a};A.current=!0,l.call(n.move,"x"===b?[t.x(s[0]),t.x(s[1])]:"y"===b?[t.y(a[1]),t.y(a[0])]:[[t.x(s[0]),t.y(a[1])],[t.x(s[1]),t.y(a[0])]]),A.current=!1,C.current=x,Q.current(x)}});return u(()=>{if(!B.current)return;let e=o(B.current).select(".brush-g"),l="x"===b?a():"y"===b?f():s();return l.extent([[0,0],[n,d]]),l.on("brush end",i=>{if(A.current)return;let u,c,o=Y.current;if(!o)return;if(!i.selection)return C.current=null,void Q.current(null);if("x"===b){let[e,r]=i.selection;u=[o.x.invert(e),o.x.invert(r)],c=[o.y.invert(d),o.y.invert(0)]}else if("y"===b){let[e,r]=i.selection;u=[o.x.invert(0),o.x.invert(n)],c=[o.y.invert(r),o.y.invert(e)]}else{let[[e,r],[t,n]]=i.selection;u=[o.x.invert(e),o.x.invert(t)],c=[o.y.invert(n),o.y.invert(r)]}if("bin"===w&&"y"!==b&&("end"===i.type||"brush"===i.type&&j)){let n=$.current;n&&n.length>0?u=function(e,n){return 0===n.length?e:[r(e[0],n),t(e[1],n)]}(u,n):M&&M>0&&(u=[Math.floor(u[0]/M)*M,Math.ceil(u[1]/M)*M]);let c=o.x(u[0]),s=o.x(u[1]);if(A.current=!0,"x"===b)e.call(l.move,[c,s]);else if("xy"===b){let r=i.selection;e.call(l.move,[[c,r[0][1]],[s,r[1][1]]])}A.current=!1}let s={x:u,y:c};C.current=s,Q.current(s)}),e.call(l),P.current=l,e.select(".selection").attr("fill","steelblue").attr("fill-opacity",.15).attr("stroke","steelblue").attr("stroke-width",1),()=>{l.on("brush end",null),P.current=null}},[n,d,b,w,M,j]),u(()=>{if(!(k&&g&&P.current&&C.current&&B.current&&"y"!==b))return;let e=C.current,r=g.x.domain()[0],n=o(B.current).select(".brush-g");if(r>=e.x[1])return A.current=!0,n.call(P.current.move,null),A.current=!1,C.current=null,void Q.current(null);let l=e.x[0],i=!1;if(r>e.x[0]){if(l=r,"bin"===w){let e=$.current;e&&e.length>0?l=t(r,e):M&&M>0&&(l=Math.ceil(r/M)*M)}if(l>=e.x[1])return A.current=!0,n.call(P.current.move,null),A.current=!1,C.current=null,void Q.current(null);i=!0}let u=g.x(l),c=g.x(e.x[1]);if(A.current=!0,"x"===b)n.call(P.current.move,[u,c]);else{let r=g.y(e.y[1]),t=g.y(e.y[0]);n.call(P.current.move,[[u,r],[c,t]])}if(A.current=!1,i){let r={x:[l,e.x[1]],y:e.y};C.current=r,Q.current(r)}},[g,k,b,w,M]),x("svg",{ref:B,width:m,height:y,...D.svgProps,style:{position:"absolute",top:0,left:0,pointerEvents:"all"},children:[h("title",{children:D.svgProps["aria-label"]}),h("desc",{id:D.descriptionId,children:D.description}),h("g",{className:"brush-g",transform:`translate(${v.left},${v.top})`})]})}import{useBrushAccessibility as l}from"./c-LYQMZMZQ.min.js";import{useRef as i,useEffect as u,useMemo as c}from"react";import{select as o}from"d3-selection";import{brush as s,brushX as a,brushY as f}from"d3-brush";import{jsx as h,jsxs as x}from"react/jsx-runtime";export{n as XYBrushOverlay};
@@ -0,0 +1 @@
1
+ import{customXYPlugin as m}from"./c-WNGH47HF.min.js";import"./c-CPSPZH6A.min.js";import"./c-NYZ2QNAM.min.js";import"./c-DK662R77.min.js";import"./c-OO5QLMJC.min.js";import"./c-HXDKPIKR.min.js";import"./c-4FN7Q6VQ.min.js";import"./c-W4ZUKSEQ.min.js";import"./c-553QUDKA.min.js";export{m as customXYPlugin};
@@ -0,0 +1 @@
1
+ function m(){H(F),H(s),H(c),H(G),H(t),H(i),H(n),H(o),H(f),H(p),H(r),H(j)}import{barXYPlugin as o,bubbleXYPlugin as i,candlestickXYPlugin as r,heatmapXYPlugin as n,scatterXYPlugin as t,stackedAreaXYPlugin as c,swarmXYPlugin as f,waterfallXYPlugin as p}from"./c-33QOXEUG.min.js";import{customXYPlugin as j}from"./c-WNGH47HF.min.js";import{areaXYPlugin as s,lineXYPlugin as F,mixedXYPlugin as G,registerXYPlugin as H}from"./c-ZYPXQF7B.min.js";export{m as registerBuiltInXYPlugins};
@@ -0,0 +1 @@
1
+ function e(){let e="string"==typeof import.meta.url&&import.meta.url?new URL("./forceLayoutWorker.js",import.meta.url):u("forceLayoutWorker.js");return new Worker(e,{type:"module",name:"semiotic-force-layout"})}function r(){c.resetForTest()}function t(e,r){return a()?c.get().request(e,r):Promise.reject(Error("Web Workers are unavailable"))}import{ModuleWorkerSession as o,createSharedWorkerSessionHolder as s,errorFromPayload as i,parseModuleWorkerErrorField as n}from"./c-GXV3C3MO.min.js";import{canUseForceWorker as a}from"./c-MVR3RWF3.min.js";import{commonJsWorkerModuleUrl as u}from"./c-VJTDST2R.min.js";var m=class{constructor(r=e()){this.session=new o({name:"Force layout",createWorker:()=>r,terminateOnAbort:!0,parseMessage:e=>{let r=e,{requestId:t,error:o}=n(r);return o?{requestId:t,ok:!1,error:i(o)}:{requestId:t,ok:!0,payload:{positions:r.positions??{}}}}})}get isDead(){return this.session.isDead}request(e,r){return this.session.request(e,r)}terminate(){this.session.terminate()}},c=s(()=>new m);export{e as createForceLayoutWorker,m as ForceLayoutWorkerSession,r as _resetSharedForceLayoutSessionForTest,t as runForceLayoutWorker};
@@ -0,0 +1 @@
1
+ function r(r,o){if(!o||!r?.component||!r.props)return[];let n="object"==typeof o?o:{};try{let o=t(r.component,r.props,void 0,{checkOutliers:n.checkOutliers});return e(o,{max:n.max,errorsOnly:n.errorsOnly})}catch{return[]}}import{auditData as t,toDataAuditNotifications as e}from"./c-PSNI6KAZ.min.js";import"./c-P65V6HLO.min.js";export{r as buildChartDataAuditNotifications};
@@ -0,0 +1 @@
1
+ function e({frameRef:e,cellSize:c,onBrush:f}){let h=t(null),m=c-u-a,b=c-i-o;return r(()=>{if(!h.current)return;let t=n(h.current).select(".brush-g"),r=l().extent([[0,0],[m,b]]).on("brush end",t=>{let r=e.current?.getScales();if(!r)return;if(!(l=t.selection)||!Array.isArray(l[0]))return void f(null);var l;let[[n,s],[i,o]]=t.selection,u=[[r.x.invert(n),r.y.invert(s)],[r.x.invert(i),r.y.invert(o)]];f(u)});return t.call(r),t.select(".selection").attr("fill","steelblue").attr("fill-opacity",.15).attr("stroke","steelblue").attr("stroke-width",1),()=>{r.on("brush end",null)}},[m,b,e,f]),s("svg",{ref:h,width:c,height:c,style:{position:"absolute",top:0,left:0},children:s("g",{className:"brush-g",transform:`translate(${u},${i})`})})}import{useRef as t,useEffect as r}from"react";import{brush as l}from"d3-brush";import{select as n}from"d3-selection";import{jsx as s}from"react/jsx-runtime";var i=4,o=4,u=4,a=4;export{e as ScatterplotMatrixBrushOverlay};
@@ -0,0 +1 @@
1
+ function t(t,r=.5){let a=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(t);if(!a)return t;let n=Math.round(parseInt(a[1],16)*(1-r)),e=Math.round(parseInt(a[2],16)*(1-r)),p=Math.round(parseInt(a[3],16)*(1-r));return`#${n.toString(16).padStart(2,"0")}${e.toString(16).padStart(2,"0")}${p.toString(16).padStart(2,"0")}`}function r(t,r=.5){let a=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(t);if(!a)return t;let n=Math.round(parseInt(a[1],16)+(255-parseInt(a[1],16))*r),e=Math.round(parseInt(a[2],16)+(255-parseInt(a[2],16))*r),p=Math.round(parseInt(a[3],16)+(255-parseInt(a[3],16))*r);return`#${n.toString(16).padStart(2,"0")}${e.toString(16).padStart(2,"0")}${p.toString(16).padStart(2,"0")}`}export{t as darkenColor,r as lightenColor};
@@ -0,0 +1 @@
1
+ function t(t,e=h){if(t)return!0===t?e:"stops"in t?Array.isArray(t.stops)?t:void 0:"colorStops"in t?Array.isArray(t.colorStops)?{stops:t.colorStops.map(({offset:t,color:e})=>({offset:t,color:e}))}:void 0:{stops:[{offset:0,opacity:t.topOpacity??e.stops[0]?.opacity??.8},{offset:1,opacity:t.bottomOpacity??e.stops.at(-1)?.opacity??.05}]}}function e(e){return e?t(e):void 0}function o(t){if(t)return Array.isArray(t)?{stops:t.map(({at:t,color:e,opacity:o})=>({offset:t/100,color:e,...null!=o&&{opacity:o}}))}:Array.isArray(t.stops)?t:void 0}function r(t){let e=t?.stops.filter(t=>"string"==typeof t.color&&Number.isFinite(t.offset)).map(({offset:t,color:e,opacity:o})=>({offset:Math.max(0,Math.min(1,t)),color:e,...Number.isFinite(o)&&{opacity:Math.max(0,Math.min(1,o))}})).sort((t,e)=>t.offset-e.offset);if(!e?.length)return;let o=e[0];return o.offset>0?[{...o,offset:0},...e]:e}function s(t){return{stops:t.stops.map(t=>({...t,offset:1-t.offset})).sort((t,e)=>t.offset-e.offset)}}function i(t,e,o,r,s,i){let{topPath:l,rawValues:a,datum:f}=c(t,e,o,r);return{type:"line",path:l,rawValues:a,style:s,datum:f,group:i}}function l(t,e,o,r,s,i,l,a){return{type:"area",...c(t,e,o,r,a??(()=>s)),style:i,group:l}}function a(t,e,o,r){let s=new Map;if("silhouette"===r)for(let r of t){let t=0;for(let s of e)t+=o(s,r)||0;s.set(r,-t/2)}else if("wiggle"===r){t.length>0&&s.set(t[0],0);for(let r=1;t.length>r;r++){let i=t[r-1],l=t[r],a=0,f=0,n=0;for(let t of e){let e=o(t,l)||0;a+=(2*n+e)*(e-(o(t,i)||0)),f+=e,n+=e}let u=s.get(i)??0;s.set(l,u-(f>0?a/(2*f):0))}if(t.length>0){let r=0;for(let i of t){let t=0;for(let r of e)t+=o(r,i)||0;r+=(s.get(i)??0)+t/2}let i=r/t.length;for(let e of t)s.set(e,(s.get(e)??0)-i)}}else for(let e of t)s.set(e,0);return s}function f(t,e,o){let r=0,s=0;for(let i of t){let t=0,l=0;for(let r of e){let e=o(r,i)||0;0>e?l+=e:t+=e}r>l&&(r=l),t>s&&(s=t)}return[r,s]}function n(t,e,o,r,s,i,l,f="zero"){let n=new Set,u=new Map;for(let e of t){let t=new Map;for(let s of e.data){let e=o(s),i=r(s);if(!Number.isFinite(e)||(n.add(e),!Number.isFinite(i)))continue;let l=t.get(e);l?(l.value+=i,l.sources?l.sources.push(s):l.sources=[l.datum,s]):t.set(e,{value:i,datum:s})}u.set(e.key,t)}let p,y=Array.from(n).sort((t,e)=>t-e);if(i){p=new Map;for(let e of y){let o=0;for(let r of t)o+=u.get(r.key)?.get(e)?.value||0;p.set(e,o||1)}}let m=a(y,t.map(t=>t.key),(t,e)=>u.get(t)?.get(e)?.value||0,f),c="diverging"===f&&!i,h=[],d=new Map,v=new Map,w=new Map,b=new Map;for(let t of y)v.set(t,m.get(t)??0),w.set(t,0),b.set(t,0);for(let o of t){let t=u.get(o.key),r=new Map,a=[],f=[],n=[],m=[],F=[],M=!1,N=()=>{if(0!==a.length){if(a.length>=2){let t=M?a.map((t,e)=>e).sort((t,e)=>a[t][0]-a[e][0]):void 0,e={type:"area",topPath:t?t.map(t=>a[t]):a,bottomPath:t?t.map(t=>f[t]):f,rawValues:t?t.map(t=>n[t]):n,style:s(o.key,g(o.data)),datum:t?t.map(t=>m[t]):m,accessibleDatum:t?t.map(t=>F[t]):F,group:o.key};l&&(e.curve=l),h.push(e)}a=[],f=[],n=[],m=[],F=[],M=!1}};for(let s of y){let l,u,y=t.get(s),g=void 0!==y,h=y?.value??0;if(i&&g&&(h/=p.get(s)),!g||!Number.isFinite(h)||0===h){N();continue}c?h>0?(l=w.get(s),u=l+h,w.set(s,u)):(l=b.get(s),u=l+h,b.set(s,u)):(l=v.get(s),u=l+h,v.set(s,u));let d=e.x(s),x=e.y(l),k=e.y(u);if(!Number.isFinite(d)||!Number.isFinite(x)||!Number.isFinite(k)){N();continue}let A=y.sources,V=y.value,_=A?{...A[0],__aggregateValue:V,__aggregateCount:A.length,__aggregateRows:A}:y.datum;a.length>0&&a[a.length-1][0]>d&&(M=!0),a.push([d,k]),f.push([d,x]),m.push(_),n.push(V),F.push(A?{x:s,value:V,group:o.key,observations:A.length}:_),r.set(s,u)}N(),d.set(o.key,r)}return{nodes:h,stackedTops:d}}function u(t,e,o,r,s,i,l){let a=o(t),f=r(t);if(!Number.isFinite(a)||!Number.isFinite(f))return null;let n={type:"point",x:e.x(a),y:e.y(f),r:s,style:i,datum:t};return void 0!==l&&(n.pointId=l),n}function p(t,e,o,r,s,i,l,a){let f=o(t),n=r(t);if(!Number.isFinite(f)||!Number.isFinite(n))return null;let u={type:"symbol",x:e.x(f),y:e.y(n),size:s,symbolType:i,style:l,datum:t};return void 0!==a&&(u.pointId=a),u}function y(t,e,o,r,s,i,l){return{type:"rect",x:t,y:e,w:o,h:r,style:s,datum:i,group:l}}function m(t,e,o,r,s,i,l){let a={type:"heatcell",x:t,y:e,w:o,h:r,fill:s,datum:i};return void 0!==l?.value&&(a.value=l.value),l?.showValues&&(a.showValues=!0,l.valueFormat&&(a.valueFormat=l.valueFormat)),a}import{buildSeriesGeometry as c}from"./c-TKG2NP7G.min.js";import{seriesSelectionDatum as g}from"./c-T2V7O2LO.min.js";var h={stops:[{offset:0,opacity:.8},{offset:1,opacity:.05}]};export{i as buildLineNode,l as buildAreaNode,a as computeStackOffsets,f as computeDivergingStackExtent,n as buildStackedAreaNodes,u as buildPointNode,p as buildSymbolNode,y as buildRectNode,m as buildHeatcellNode,t as normalizeGradient,e as normalizeColorGradient,o as normalizeSemanticGradient,r as semanticLineStopsForGradient,s as reverseGradient};
@@ -0,0 +1 @@
1
+ function e(e){let{accessor:t,data:o,isPushMode:i}=e,a=xt(null),[r,n]=vt(0),l=gt(e=>{if(!i||!t)return;let o=!1;for(let i of e){let e="function"==typeof t?t(i):i[t];if(null==e)continue;let r="number"==typeof e?e:Number(e);Number.isFinite(r)&&(a.current?(a.current[0]>r&&(a.current[0]=r,o=!0),r>a.current[1]&&(a.current[1]=r,o=!0)):(a.current=[r,r],o=!0))}o&&n(e=>e+1)},[i,t]),s=gt(()=>{i&&(a.current=null,n(e=>e+1))},[i]);return{domain:bt(()=>{if(i)return a.current??void 0;if(!t||0===o.length)return;let e="function"==typeof t?t:e=>e[t],r=1/0,n=-1/0;for(let t of o){let o=e(t);if(null==o)continue;let i="number"==typeof o?o:Number(o);Number.isFinite(i)&&(r>i&&(r=i),i>n&&(n=i))}return Number.isFinite(r)&&Number.isFinite(n)?[r,n]:void 0},[o,t,i,r]),trackPushed:l,reset:s}}function t(e,t){return rt(1===t?.5:e/(t-1))}function o(e){return e instanceof Date?"date:"+e.getTime():`${typeof e}:${e+""}`}function i(e,t,o){return"function"==typeof e?e(t,o):t[e]}function a(e,t={}){let a=t.xAccessor??"x",r=t.yAccessor??"y",n=t.lineBy??"series",l=t.rankDirection??"descending",s=[],c=new Map,h=new Map,m=[],d=new Map,u=1/0,p=-1/0;e.forEach((e,t)=>{let l=i(a,e,t),y=o(l),f=c.get(y);null==f&&(f=s.length,c.set(y,f),s.push(l),h.set(f,[]));let g=i(n,e,t)+"";d.has(g)||(d.set(g,m.length),m.push(g));let b=Number(i(r,e,t));Number.isFinite(b)&&(u=Math.min(u,b),p=Math.max(p,b),h.get(f)?.push({datum:e,inputIndex:t,series:g,value:b}))});let y=[],f=new Map,g=new Map;for(let e=0;s.length>e;e++){let t=h.get(e)??[];t.sort((e,t)=>("descending"===l?t.value-e.value:e.value-t.value)||(d.get(e.series)??0)-(d.get(t.series)??0)),t.forEach((t,o)=>{let i=o+1;y.push({datum:t.datum,xIndex:e,xValue:s[e],series:t.series,value:t.value,rank:i}),f.set(t.series,(f.get(t.series)??0)+i),g.set(t.series,(g.get(t.series)??0)+1)})}let b=m.length+1,x=[...m].sort((e,t)=>{let o=g.get(e)??0,i=g.get(t)??0;return((f.get(e)??0)+(s.length-o)*b)/Math.max(1,s.length)-((f.get(t)??0)+(s.length-i)*b)/Math.max(1,s.length)||(d.get(e)??0)-(d.get(t)??0)}),v=new Set(x.slice(0,null==t.highlightTop?x.length:Math.max(0,Math.floor(t.highlightTop))));return{data:y.map(e=>{let t=v.has(e.series);return{...e.datum,x:e.xIndex,y:e.rank,__bumpRaw:e.datum,__bumpSeries:e.series,__bumpColorGroup:t?e.series:"Other",__bumpValue:e.value,__bumpRank:e.rank,__bumpXValue:e.xValue,__bumpHighlighted:t}}),xValues:s,seriesOrder:m,overallOrder:x,valueExtent:u===1/0?[0,0]:[u,p]}}function r(e,t,o,i,a){let r=1-a;return r*r*r*e+3*r*r*a*t+3*r*a*a*o+a*a*a*i}function n(e,t,o,i,a){let r=1-a;return 3*r*r*(t-e)+6*r*a*(o-t)+3*a*a*(i-o)}function l(e,t,o,i,a){let l=[],s=(e.x+t.x)/2;for(let c=0;a>=c;c++){let h,m,d,u,p=c/a;"linear"===i?(h=e.x+(t.x-e.x)*p,m=e.y+(t.y-e.y)*p,d=t.x-e.x,u=t.y-e.y):(h=r(e.x,s,s,t.x,p),m=r(e.y,e.y,t.y,t.y,p),d=n(e.x,s,s,t.x,p),u=n(e.y,e.y,t.y,t.y,p)),l.push({x:h,y:m,dx:d,dy:u,radius:e.radius+(t.radius-e.radius)*p,datumIndex:.5>p?o:o+1})}return l}function s(e,t={}){let o=[],i=[],a=[];if(2>e.length)return{topPath:o,bottomPath:i,datumIndices:a};let r=t.curve??"smooth",n=Math.max(2,Math.floor(t.samplesPerSegment??12));for(let t=0;e.length-1>t;t++){let s=l(e[t],e[t+1],t,r,n);for(let e=0===t?0:1;s.length>e;e++){let t=s[e],r=Math.hypot(t.dx,t.dy)||1,n=-t.dy/r,l=t.dx/r,c=Math.max(0,t.radius);o.push([t.x+n*c,t.y+l*c]),i.push([t.x-n*c,t.y-l*c]),a.push(t.datumIndex)}}return{topPath:o,bottomPath:i,datumIndices:a}}function c({datum:e,x:t,y:o,side:i,color:a,highlighted:r,labelStyle:n}){let l=pe(),s=l.isActive&&!l.predicate(e),c="function"==typeof n?n(e.__bumpRaw):n;return Ot("text",{className:"semiotic-bump-label",x:t+("end"===i?8:-8),y:o,dy:"0.35em",textAnchor:"end"===i?"start":"end",fill:a,fillOpacity:s?.16:1,fontWeight:r?650:450,fontSize:12,style:{pointerEvents:"none",fontFamily:"var(--semiotic-font-family, sans-serif)",fontSize:"var(--semiotic-axis-label-font-size, 12px)",...c},children:e.__bumpSeries})}function h(e,t,o){let[i,a]=t,[r,n]=o;return a===i?(r+n)/2:r+(n-r)*Math.max(0,Math.min(1,(e-i)/(a-i)))}function m(e){let t=e.__bumpXValue instanceof Date?e.__bumpXValue.getTime():Number(e.__bumpXValue);return{value:e.__bumpValue,x:Number.isFinite(t)?t:void 0,y:e.__bumpValue,category:e.__bumpSeries}}function d(e){let t=e.config,o=new Map;for(let t of e.data){let e=o.get(t.__bumpSeries)??[];e.push(t),o.set(t.__bumpSeries,e)}let i=t.seriesOrder.filter(e=>o.has(e)).sort((e,i)=>(o.get(e)?.[0]?.__bumpHighlighted?1:0)-(o.get(i)?.[0]?.__bumpHighlighted?1:0)||t.seriesOrder.indexOf(e)-t.seriesOrder.indexOf(i)),a=[],r=[],n=[];for(let r of i){let i=(o.get(r)??[]).sort((e,t)=>e.x-t.x);if(2>i.length)continue;let l=i[0].__bumpHighlighted,c=(t.colorMap&&lt(t.colorMap,r))??e.resolveColor(i[0].__bumpSeries,i[0]),d=t.color??(l?c:t.neutralColor??e.theme.semantic.textSecondary??e.theme.semantic.border??c),u=i.map(o=>({x:e.scales.x(o.x),y:e.scales.y(o.y),radius:t.ribbon?h(o.__bumpValue,t.valueExtent,t.ribbonSizeRange)/2:Math.max(.5,t.lineWidth/2)})),p=s(u,{curve:t.curve,samplesPerSegment:t.samplesPerSegment}),y={fill:d,fillOpacity:1,opacity:l?t.ribbon?t.ribbonOpacity:t.lineOpacity:Math.min(t.ribbon?t.ribbonOpacity:t.lineOpacity,.58)};t.styleRules?.length&&Object.assign(y,je(i[0].__bumpRaw,t.styleRules,m(i[0]))),t.areaStyle&&Object.assign(y,t.areaStyle(i[0].__bumpRaw)??{}),void 0!==t.stroke&&(y.stroke=t.stroke),void 0!==t.strokeWidth&&(y.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(y.opacity=t.opacity),a.push({type:"area",topPath:p.topPath,bottomPath:p.bottomPath,style:y,datum:p.datumIndices.map(e=>i[e]),accessibleDatum:i.map(e=>e.__bumpRaw),accessibility:{label:r+" ranking trajectory",tableFields:i.map(e=>e.__bumpRaw)},group:r,interactive:!0}),t.showPoints&&i.forEach((e,o)=>{let i={fill:d,stroke:"none",opacity:l?1:.75};t.styleRules?.length&&Object.assign(i,je(e.__bumpRaw,t.styleRules,m(e))),t.pointStyle&&Object.assign(i,t.pointStyle(e.__bumpRaw)??{}),void 0!==t.stroke&&(i.stroke=t.stroke),void 0!==t.strokeWidth&&(i.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(i.opacity=t.opacity),a.push({type:"point",x:u[o].x,y:u[o].y,r:i.r??t.pointRadius,style:i,datum:e,accessibleDatum:e.__bumpRaw,accessibility:{label:`${r}, rank ${e.__bumpRank}, value ${e.__bumpValue}`},pointId:`${r}:${e.x}`})});let f=!0===t.showLabels?"end":t.showLabels,g=(e,o,i)=>{let a=null==t.labelPriorityAccessor?void 0:"function"==typeof t.labelPriorityAccessor?t.labelPriorityAccessor(e.__bumpRaw):Number(e.__bumpRaw[t.labelPriorityAccessor]);n.push({id:`${r}\0${i}`,datum:e,x:u[o].x,y:u[o].y,side:i,rank:e.__bumpRank,highlighted:l,priority:Number.isFinite(a)?a:void 0,color:"string"==typeof y.fill?y.fill:d})};("start"===f||"both"===f)&&g(i[0],0,"start"),("end"===f||"both"===f||"auto"===f)&&g(i.at(-1),i.length-1,"end")}let l=function(e,t,o,i){let a=Math.max(1,Math.floor(t/18)),r="auto"===o?Number.isFinite(i)&&(i??0)>=0?Math.min(a,Math.floor(i)):a:1/0,n=e.map((e,t)=>({candidate:e,index:t})).sort((e,t)=>(t.candidate.priority??0)-(e.candidate.priority??0)||Number(t.candidate.highlighted)-Number(e.candidate.highlighted)||e.candidate.rank-t.candidate.rank||e.index-t.index),l=[];for(let{candidate:e}of n){if(l.length>=r)break;l.some(t=>t.side===e.side&&14>Math.abs(t.y-e.y))||l.push(e)}return new Set(l.map(e=>e.id))}(n,e.dimensions.plot.height,"auto"!==(!0===t.showLabels?"end":t.showLabels)||"auto",t.maxLabels);for(let e of n)l.has(e.id)&&r.push(Ot(c,{datum:e.datum,x:e.x,y:e.y,side:e.side,color:e.color,highlighted:e.highlighted,labelStyle:t.labelStyle},e.id));return{nodes:a,overlays:r.length?Ot("g",{className:"semiotic-bump-labels",children:r}):void 0,restyle:(e,t)=>{let o=function(e){let t=Array.isArray(e.datum)?e.datum[0]:e.datum;return t&&"object"==typeof t&&"__bumpSeries"in t?t:void 0}(e);if(t?.isActive&&o&&!t.predicate(o))return{opacity:.14}}}}function u(e){let{safeData:t,data:o,areaBy:i,lineDataAccessor:a,colorBy:r,colorScale:n,color:l,stroke:s,strokeWidth:c,opacity:h,effectiveSelectionHook:m,resolvedSelection:d,areaOpacity:u,showLine:p,lineWidth:y,showPoints:f,pointRadius:g,xAccessor:b,yAccessor:x,xLabel:v,yLabel:A,xFormat:w,yFormat:S,groupField:k,styleRules:C,ruleContext:R}=e,L=Xt(()=>function({data:e,safeData:t,areaBy:o,lineDataAccessor:i}){if(null==e)return[];let a,r=void 0!==t[0]?.[i];if(!r&&!o)return t;if(r)a=t;else{let e=t.reduce((e,t)=>{let a="function"==typeof o?o(t):t[o],r=a+"";if(!e[r]){let t={[i]:[]};"string"==typeof o&&(t[o]=a),e[r]=t}return e[r][i].push(t),e},{});a=Object.values(e)}return a.flatMap(e=>{let t=Array.isArray(e[i])?e[i]:[];return"string"==typeof o?t.map(t=>({...t,[o]:t[o]??e[o]})):t})}({data:o,safeData:t,areaBy:i,lineDataAccessor:a}),[o,t,i,a]),_=Xt(()=>e=>{let t={};if(r){if(n){let o=ot(e,r,n);t.fill=o,p?(t.stroke=o,t.strokeWidth=y):t.stroke="none"}}else{let e=l||et;t.fill=e,p?(t.stroke=e,t.strokeWidth=y):t.stroke="none"}return t.fillOpacity=u,C&&C.length>0&&Object.assign(t,je(e,C,R?R(e):{value:void 0})),t},[r,n,l,u,p,y,C,R]),H=Xt(()=>ue(_,{stroke:s,strokeWidth:c,opacity:h}),[_,s,c,h]);return{flattenedData:L,lineStyle:Xt(()=>Ze(H,m??null,d),[H,m,d]),pointStyle:Xt(()=>{if(f)return e=>{let t={r:g,fillOpacity:1};return r?n&&(t.fill=ot(e.parentLine||e,r,n)):t.fill=l||et,t}},[f,g,r,n,l]),defaultTooltipContent:Xt(()=>me([{label:v||le(b),accessor:b,role:"x",format:w},{label:A||le(x),accessor:x,role:"y",format:S},...k?[{label:le(k),accessor:k,role:"group"}]:[],...se(e.band,S)]),[b,x,v,A,k,w,S,e.band])}}function p(e){if("A"===e.__diffWinner||"B"===e.__diffWinner)return e.__diffWinner;let t=(e.__diffSegment??"")+"";return"line-A"===t||t.endsWith("-A")?"A":"B"}function y(e,t){return Le(e,t,e=>{let t=Number(e.__x),o=Number(e.__y);return{value:Number.isFinite(o)?o:void 0,x:Number.isFinite(t)?t:void 0,y:Number.isFinite(o)?o:void 0,category:p(e)}},e=>e.__sourceDatum?{...e.__sourceDatum,...e}:e)}function f(e){if(null==e)return NaN;if("number"==typeof e)return e;if(e instanceof Date)return e.getTime();if("string"==typeof e){if(""===e.trim())return NaN;let t=+e;return Number.isFinite(t)?t:NaN}return NaN}function g(e){let[t,o]=_o.useState(()=>Io);return _o.useEffect(()=>{if(t)return;let e=!1;return(Io?Promise.resolve(Io):(Po||(Po=import("./c-AQADQNY7.min.js").then(e=>Io=e.ScatterplotMatrixBrushOverlay).catch(e=>{throw Po=null,e})),Po)).then(t=>{e||o(()=>t)}).catch(()=>{}),()=>{e=!0}},[t]),t?Ho(t,{...e}):null}function b({data:e,xField:t,yField:o,fieldLabels:i,cellSize:a,pointRadius:r,pointOpacity:n,styleRules:l,colorBy:s,colorScale:c,brushSelectionName:h,hoverSelectionName:m,unselectedOpacity:d,maxDevicePixelRatio:u,mobileInteraction:p,mode:y,onPointHover:f,onPointClick:b}){let x=Lo(null),v=qe({name:h,clientId:`splom-${t}-${o}`,fields:[t,o]}),A=ze({name:h,xField:t,yField:o}),w=qe({name:m,clientId:"splom-hover-source",fields:[Do]}),S=w.selectPoints,k=Ro(e=>{e?A.brushInteraction.during(e):A.brushInteraction.end(null)},[A.brushInteraction]),C=Ro(e=>{if(!e)return void f?.(null);let t=e.data,o=t?.[Do];void 0!==o&&(S({[Do]:[o]}),f?.(t,e.x+No.left,e.y+No.top))},[S,f]),R=Ro(e=>{if(!e)return void b?.(null);let t=e.data;t&&b?.(t,e.x+No.left,e.y+No.top)},[b]),L=Co(()=>De(t,o),[t,o]),_=Co(()=>Le(e=>({opacity:n,r:r,fill:s?ot(e,s,c):et}),l,L),[n,r,s,c,l,L]),H=Ro(e=>{let t={..._(e)};return"hover"===y?w.isActive&&w.predicate(e)?(t.opacity=1,t.r=2.5*r,t.stroke="#333",t.strokeWidth=1.5):w.isActive&&(t.opacity=.6*("number"==typeof t.opacity?t.opacity:n)):v.isActive&&!v.predicate(e)&&(t.opacity=d),t},[_,y,w,v,d,r,n]);return Fo("div",{style:{position:"relative",width:a,height:a},children:[Bo(q,{ref:x,chartType:"scatter",data:e,size:[a,a],xAccessor:t,yAccessor:o,pointStyle:H,margin:No,showAxes:!1,maxDevicePixelRatio:u,enableHover:"hover"===y,accessibleTable:!1,description:`${lt(i,t)??t} versus ${lt(i,o)??o} scatterplot`,...he({forceHoverBehavior:"hover"===y,forceClickBehavior:!!b,mobileInteraction:p,customHoverBehavior:C,customClickBehavior:R}),tooltipContent:"hover"===y?()=>null:void 0}),"brush"===y&&Bo(g,{frameRef:x,cellSize:a,onBrush:k})]})}function x({data:e,field:t,label:o,cellSize:i,bins:a,colorBy:r,colorScale:n,brushSelectionName:l,hoverSelectionName:s,mode:c}){let h=qe({name:l,clientId:"splom-diag-"+t,fields:[t]}),m=qe({name:s,clientId:`splom-diag-${t}-hover`,fields:[Do]}),d="hover"===c?m:h,u=d.isActive,p=d.predicate,y=Co(()=>{let o="string"==typeof r?r:null,n=[],l=new Set;for(let i of e){let e=i[t];if(null!=e&&!isNaN(e)&&n.push(Number(e)),o){let e=i[o];null!=e&&l.add(e+"")}}if(0===n.length)return{bars:[],selectedBars:[],categoryBars:[],selectedCategoryBars:[],max:0,categories:[]};let[s,c]=mt(n),h=(c-s)/a||1,m=Array.from(l),d=new Map(m.map((e,t)=>[e,t])),y=Array(a).fill(0),f=Array(a).fill(0),g=Array.from({length:a},()=>Array(m.length).fill(0)),b=Array.from({length:a},()=>Array(m.length).fill(0));for(let i of e){let e=i[t];if(null==e||isNaN(e))continue;let r=Math.min(Math.floor((e-s)/h),a-1);if(y[r]++,(!u||p(i))&&f[r]++,o){let e=d.get(i[o]+"");void 0!==e&&(g[r][e]++,(!u||p(i))&&b[r][e]++)}}let x=ht(y,1),v=g.map((e,t)=>{let o=0;return e.map((e,r)=>{let n=e/x*(i-24),l={x:t/a*i,w:i/a-1,h:n,y0:o,category:m[r]};return o+=n,l})}),A=b.map((e,t)=>{let o=0;return e.map((e,r)=>{let n=e/x*(i-24),l={x:t/a*i,w:i/a-1,h:n,y0:o,category:m[r]};return o+=n,l})});return{bars:y.map((e,t)=>({x:t/a*i,w:i/a-1,h:e/x*(i-24),count:e})),selectedBars:f.map((e,t)=>({x:t/a*i,w:i/a-1,h:e/x*(i-24),count:e})),categoryBars:v,selectedCategoryBars:A,max:x,categories:m}},[e,t,a,i,u,p,r]);return Fo("svg",{width:i,height:i,style:{overflow:"hidden"},children:[Bo("text",{x:i/2,y:14,textAnchor:"middle",fontSize:11,fontWeight:"bold",fill:"var(--semiotic-text, #333)",fontFamily:"var(--semiotic-font-family, sans-serif)",children:o}),y.categories.length>0?y.categoryBars.map((e,t)=>e.map((e,o)=>Bo("rect",{x:e.x,y:i-e.y0-e.h,width:Math.max(e.w,1),height:e.h,fill:n?n(e.category):et,opacity:u?.3:.6},`bg-${t}-${o}`))):y.bars.map((e,t)=>Bo("rect",{x:e.x,y:i-e.h,width:Math.max(e.w,1),height:e.h,fill:et,opacity:u?.3:.6},"bg-"+t)),u&&(y.categories.length>0?y.selectedCategoryBars.map((e,t)=>e.map((e,o)=>Bo("rect",{x:e.x,y:i-e.y0-e.h,width:Math.max(e.w,1),height:e.h,fill:n?n(e.category):et,opacity:.7},`sel-${t}-${o}`))):y.selectedBars.map((e,t)=>Bo("rect",{x:e.x,y:i-e.h,width:Math.max(e.w,1),height:e.h,fill:et,opacity:.7},"sel-"+t)))]})}function v({label:e,cellSize:t}){return Bo("svg",{width:t,height:t,children:Bo("text",{x:t/2,y:t/2,textAnchor:"middle",dominantBaseline:"middle",fontSize:12,fontWeight:"bold",fill:"var(--semiotic-text, #333)",fontFamily:"var(--semiotic-font-family, sans-serif)",children:e})})}function A(e){let{data:t,fields:o,fieldLabels:i={},colorBy:a,colorScheme:r,cellSize:n=150,cellGap:l=4,pointRadius:s=2,pointOpacity:c=.5,diagonal:h="histogram",histogramBins:m=20,brushMode:d="crossfilter",hoverMode:u=!0,unselectedOpacity:p=.1,showGrid:y=!1,maxDevicePixelRatio:f,tooltip:g,showLegend:A,idAccessor:w,styleRules:S,width:k,className:C,title:R,description:L,summary:_,accessibleTable:H=!0,onObservation:I,onClick:P,chartId:B}=e,F="splom",D="splom-hover",N=Oe(e.mobileInteraction,{mode:e.mode,width:k??o.length*n,mobileSemantics:e.mobileSemantics}),M=u?"hover":d?"brush":"hover",W=st(e=>e.clearSelection),[T,O]=ko(null),E=So(()=>{W(D),O(null)},[W,D]),j=wo(()=>(t||[]).map((e,t)=>void 0!==e[Do]?e:{...e,[Do]:t}),[t]),G=Qe(j,a,r),z=Ao.useId().replace(/:/g,"")+"-data-table",V=wo(()=>(t||[]).map(e=>({type:"point",datum:e})),[t]),X=wo(()=>Ne(g),[g]),$=40,Q=So((e,t,o,i)=>[$+l+e*(n+l)+(o??0),t*(n+l)+(i??0)],[$,n,l]),Y=void 0!==A?A:!!a,q=wo(()=>{if(!Y||!a)return null;let e="string"==typeof a?a:null;return e?Array.from(new Set(j.map(t=>t[e]).filter(e=>null!=e))).map(e=>({label:e+"",color:G?G(e+""):et})):null},[Y,a,j,G]),J=wo(()=>({display:"grid",gridTemplateColumns:"40px "+o.map(()=>n+"px").join(" "),gridTemplateRows:o.map(()=>n+"px").join(" ")+" 40px",gap:l+"px",width:"fit-content"}),[o,n,l,$]);return Wo("div",{className:C,style:{position:"relative",color:"var(--semiotic-text, #333)",fontFamily:"var(--semiotic-font-family, sans-serif)"},role:"group","aria-label":L||R||`Scatterplot matrix comparing ${o.length} fields`,children:[R&&Mo("div",{className:"semiotic-chart-title",style:{fontWeight:600,marginBottom:8},children:R}),H&&Mo(fe,{accessibleTable:H,children:Mo(ke,{tableId:z})}),Mo(Se,{summary:_}),q&&Mo("div",{style:{display:"flex",gap:12,marginBottom:8,flexWrap:"wrap"},children:q.map(e=>Wo("div",{style:{display:"flex",alignItems:"center",gap:4},children:[Mo("span",{style:{display:"inline-block",width:10,height:10,borderRadius:"50%",backgroundColor:e.color}}),Mo("span",{style:{fontSize:11},children:e.label})]},e.label))}),Wo("div",{style:{position:"relative",width:"fit-content"},children:[Wo("div",{style:J,onMouseLeave:"hover"===M?E:void 0,children:[o.map((e,t)=>Wo(Ao.Fragment,{children:[Mo("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",writingMode:"vertical-rl",transform:"rotate(180deg)",fontSize:11,fontWeight:"bold",color:"var(--semiotic-text, #333)"},children:lt(i,e)??e}),o.map((o,r)=>t===r?"label"===h?Mo(v,{label:lt(i,e)??e,cellSize:n},"diag-"+e):Mo(x,{data:j,field:e,label:lt(i,e)??e,cellSize:n,bins:m,colorBy:a,colorScale:G,brushSelectionName:F,hoverSelectionName:D,unselectedOpacity:p,mode:M},"diag-"+e):Mo(b,{data:j,xField:o,yField:e,fieldLabels:i,cellSize:n,pointRadius:s,pointOpacity:c,styleRules:S,colorBy:a,colorScale:G,brushSelectionName:F,hoverSelectionName:D,unselectedOpacity:p,showGrid:y,maxDevicePixelRatio:f,mobileInteraction:N,mode:M,onPointHover:"hover"===M?(i,a,n)=>{if(i){if(O({datum:i,xField:o,yField:e,colIndex:r,rowIndex:t,px:a??0,py:n??0}),I){let[e,o]=Q(r,t,a,n);I({type:"hover",datum:i,x:e,y:o,timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:B})}}else O(null),I&&I({type:"hover-end",timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:B})}:void 0,onPointClick:P||I?(e,o,i)=>{if(!e)return;let[a,n]=Q(r,t,o,i);P&&P(e,{x:a,y:n}),I&&I({type:"click",datum:e,x:a,y:n,timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:B})}:void 0},`cell-${e}-${o}`))]},"row-"+e)),Mo("div",{})," ",o.map(e=>Mo("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,fontWeight:"bold",color:"#333"},children:lt(i,e)??e},"col-label-"+e))]}),T&&"hover"===M&&!1!==g&&(()=>{let e=T.datum,t=lt(i,T.xField)??T.xField,r=lt(i,T.yField)??T.yField,s=a?"function"==typeof a?a(e):e[a]:null,c=w?"function"==typeof w?w(e):e[w]:"Row "+e[Do],h=$+l+T.colIndex*(n+l)+T.px,m=T.rowIndex*(n+l)+T.py,d={...e};delete d[Do];let u="function"==typeof X,p=u?X(d):null,y=Wo(Ce,{style:{color:"var(--semiotic-tooltip-text, #333)",background:"var(--semiotic-tooltip-bg, rgba(255,255,255,0.95))",border:"1px solid var(--semiotic-border, #ddd)",borderRadius:3,padding:"4px 8px",fontSize:11,lineHeight:1.4,whiteSpace:"nowrap",boxShadow:"none"},children:[Mo("div",{style:{fontWeight:"bold",marginBottom:2},children:c+""}),Wo("div",{children:[t,": ",null!=e[T.xField]?Number(e[T.xField]).toFixed(1):"–"]}),Wo("div",{children:[r,": ",null!=e[T.yField]?Number(e[T.yField]).toFixed(1):"–"]}),null!=s&&Wo("div",{style:{opacity:.8},children:["string"==typeof a?a:"group",": ",s+""]})]}),f=u?p:y;return f?Mo(xe,{x:h,y:m,containerWidth:$+o.length*n+o.length*l,containerHeight:o.length*n+$+o.length*l,margin:{top:0,right:0,bottom:0,left:0},className:"scatterplot-matrix-tooltip",zIndex:10,children:f}):null})()]}),H&&Mo(fe,{accessibleTable:H,children:Mo(ye,{scene:V,chartType:"scatterplot matrix",tableId:z,chartTitle:R})})]})}function w(e){let{brushMode:t="crossfilter",hoverMode:o=!0}=e,i={};return!o&&t&&(i.splom={resolution:t}),o&&(i["splom-hover"]={resolution:"union"}),Mo(ve,{selections:i,children:Mo(A,{...e})})}function S(e){let[t,o]=zo.useState(()=>Xo);return zo.useEffect(()=>{if(t)return;let e=!1;return(Xo?Promise.resolve(Xo):($o||($o=import("./c-HPOYKCCG.min.js").then(e=>Xo=e.MinimapBrushOverlay).catch(e=>{throw $o=null,e})),$o)).then(t=>{e||o(()=>t)}).catch(()=>{}),()=>{e=!0}},[t]),t?Vo(t,{...e}):null}function k(e){let{data:t,width:o=600,height:i=400,margin:a,className:r,title:n,description:l,summary:s,xLabel:c,yLabel:h,xFormat:m,yFormat:d,xAccessor:u="x",yAccessor:p="y",lineBy:y,lineDataAccessor:f="coordinates",colorBy:g,colorScheme:b,curve:x="linear",lineWidth:v=2,styleRules:A,fillArea:w=!1,areaOpacity:k=.3,showPoints:C=!1,pointRadius:R=3,enableHover:L=!0,showGrid:_=!1,showLegend:H,legendPosition:I,tooltip:B,minimap:F={},renderBefore:D=!1,onBrush:N,brushExtent:W,yExtent:T,frameProps:O={},loading:E,loadingContent:j,emptyContent:G}=e,z=We(E,o,i,j),V=z?null:Me(t,o,i,G),X=jo(()=>He(t),[t]),[$,Q]=To(null),Y=W??$,J=Go(e=>{W||Q(e),N?.(e)},[W,N]),K=Oo(null),[U,Z]=To(null);Eo(()=>{let e=0,t=!1,o=()=>{if(t)return;let i=K.current?.getScales?.();i?Z(i):e=requestAnimationFrame(o)};return e=requestAnimationFrame(o),()=>{t=!0,e&&cancelAnimationFrame(e)}},[t]);let ee=void 0!==X[0]?.[f],te=jo(()=>{if(ee)return X;if(y){let e=X.reduce((e,t)=>{let o="function"==typeof y?y(t):t[y];if(!e[o]){let t={[f]:[]};"string"==typeof y&&(t[y]=o),e[o]=t}return e[o][f].push(t),e},{});return Object.values(e)}return[{[f]:X}]},[X,y,f,ee]),oe=jo(()=>ee||y?te.flatMap(e=>{let t=e[f]||[];return y&&"string"==typeof y?t.map(t=>({...t,[y]:e[y]})):t}):X,[te,f,ee,y,X]),ie=Qe(X,g,b),ae=jo(()=>De(u,p),[u,p]),re=P({lineWidth:v,colorBy:g,colorScale:ie,fillArea:w,areaOpacity:k,styleRules:A,ruleContext:ae}),ne=jo(()=>{if(F.lineStyle)return F.lineStyle},[F.lineStyle]),se=P({lineWidth:1,colorBy:g,colorScale:ie,styleRules:A,ruleContext:ae}),ce=ne??se,he=jo(()=>C?Le(e=>{let t={r:R,fillOpacity:1};return t.fill=g?ot(e.parentLine||e,g,ie):et,t},A,ae,e=>e.parentLine||e):void 0,[C,R,g,ie,A,ae]),{legend:de,margin:ue,legendPosition:pe,legendMarginReserved:ye}=Ve({data:te,colorBy:g,colorScale:ie,showLegend:H,legendPosition:I,userMargin:a,chartWidth:o,chartHeight:i,frameLegend:O,hasTitle:!!n,axisChrome:Ge(O,{showAxes:!0,xLabel:c,yLabel:h})}),fe=F.height||60,be=jo(()=>({top:F.margin?.top??0,bottom:F.margin?.bottom??20,left:F.margin?.left??ue.left,right:F.margin?.right??ue.right}),[F.margin,ue]),xe=F.brushDirection||"x",ve=jo(()=>me([{label:c||le(u),accessor:u,role:"x",format:m},{label:h||le(p),accessor:p,role:"y",format:d}]),[u,p,c,h,m,d]),Ae=M({componentName:"MinimapChart",data:t,accessors:{xAccessor:u,yAccessor:p}});if(Ae)return Qo(ge,{componentName:"MinimapChart",message:Ae,width:o,height:i});let Se=w?"area":"line",ke={chartType:Se,data:oe,xAccessor:u,yAccessor:p,groupAccessor:y||void 0,curve:x,lineStyle:re,...C&&{pointStyle:he},size:[o,i],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:ue,showAxes:!0,xLabel:c,yLabel:h,xFormat:m,yFormat:d,enableHover:L,showGrid:_,...de&&{legend:de,legendPosition:pe},...ye&&{__legendMarginReservedFor:de},...n&&{title:n},...l&&{description:l},...s&&{summary:s},...void 0!==e.accessibleTable&&{accessibleTable:e.accessibleTable},...void 0!==e.animate&&{animate:e.animate},...void 0!==e.hoverRadius&&{hoverRadius:e.hoverRadius},...Ee({tooltip:B,defaultTooltipContent:ve}),...Y&&{xExtent:Y},...T&&{yExtent:T},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...O},Ce={chartType:Se,data:oe,xAccessor:u,yAccessor:p,groupAccessor:y||void 0,curve:x,lineStyle:ce,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},size:[o,fe+be.top+be.bottom],margin:be,showAxes:F.showAxes??!1,background:F.background,enableHover:!1,accessibleTable:!1,description:(l||n||"Chart")+" overview minimap",animate:!1,...T&&{yExtent:T}},Re=Yo("div",{style:{position:"relative",width:o,overflow:"hidden"},children:[Qo(q,{ref:K,...Ce}),Qo(S,{width:o-be.left-be.right,height:fe,margin:be,scales:U,brushDirection:xe,extent:Y,onBrush:J})]},"minimap"),_e=Qo("div",{style:{overflow:"hidden"},children:Qo(q,{...ke})},"main");return z||V||Qo(we,{componentName:"MinimapChart",width:o,height:i,children:Yo("div",{className:"minimap-chart"+(r?" "+r:""),role:"group","aria-label":l||n||"Chart with overview minimap",children:[D?Re:_e,D?_e:Re]})})}function C(e,t){return{label:t?.label??e.label,color:t?.color??e.color,opacity:t?.opacity??e.opacity}}function R(e,t){let o=t[1]-t[0];return 0===o?.5:(e-t[0])/o}function L(e,t){return t[0]+e*(t[1]-t[0])}import{MarginalGraphics as _}from"./c-VXLOLYTO.min.js";import{registerLineFamilyXYPlugins as H,useSeriesFeatures as I,useXYLineStyle as P,useXYPointStyle as B}from"./c-GSZRZRD6.min.js";import{buildRegressionAnnotation as F}from"./c-GNTXRXRN.min.js";import{normalizePartialMargin as D,useCustomChartSetup as N}from"./c-55BAJ333.min.js";import{validateArrayData as M}from"./c-D6HAAPTX.min.js";import{useChartSetup as W,useFrameImperativeHandle as T,useResolvedSelection as O}from"./c-KCRJGUHP.min.js";import{makeHeatmapRuleContext as E}from"./c-JO2UGTCP.min.js";import{bubbleXYPlugin as j,candlestickXYPlugin as G,heatmapXYPlugin as z,scatterXYPlugin as V,stackedAreaXYPlugin as X,waterfallXYPlugin as $}from"./c-33QOXEUG.min.js";import{customXYPlugin as Q}from"./c-WNGH47HF.min.js";import{DefaultTooltip as Y,StreamXYFrame_default as q,provideMarginalGraphics as J,useXYBrush as K}from"./c-MXCP7GNZ.min.js";import{areaXYPlugin as U,lineXYPlugin as Z,mixedXYPlugin as ee,registerXYPlugin as te}from"./c-ZYPXQF7B.min.js";import{normalizeColorGradient as oe,normalizeGradient as ie,normalizeSemanticGradient as ae,reverseGradient as re,semanticLineStopsForGradient as ne}from"./c-AVO3Q7T7.min.js";import{accessorName as le,bandTooltipFields as se,buildBaseMetadataProps as ce,buildCustomBehaviorProps as he,buildDefaultTooltip as me,buildTooltipProps as de,mergeShapeStyle as ue}from"./c-ITKX3RC5.min.js";import{useCustomLayoutSelection as pe}from"./c-YDECTEUW.min.js";import{AccessibleDataTable as ye,AccessibleTablePortal as fe,ChartError as ge,DEFAULT_SELECTION_OPACITY as be,FlippingTooltip as xe,LinkedCharts as ve,MultiPointTooltip as Ae,SafeRender as we,ScreenReaderSummary as Se,SkipToTableLink as ke,TooltipRoot as Ce,composeLegendConfigs as Re,composeStyleRules as Le,defaultTooltipStyle as _e,filterSparseArray as He,getCrosshairProps as Ie,isMultiTooltip as Pe,isMultiTooltipConfig as Be,makeRuleValueResolver as Fe,makeXYRuleContext as De,normalizeTooltip as Ne,renderEmptyState as Me,renderLoadingState as We,resolveDefaultFill as Te,resolveMobileInteraction as Oe,resolveMultiCapableTooltip as Ee,resolveStyleRules as je,resolveXYFramePropsAxisChrome as Ge,useBrushSelection as ze,useChartLegendAndMargin as Ve,useChartMode as Xe,useChartSelection as $e,useColorScale as Qe,useLegendInteraction as Ye,useSelection as qe,useThemeCategorical as Je,useThemeSequential as Ke,warnMissingField as Ue,wrapStyleWithSelection as Ze}from"./c-LMGSSD2E.min.js";import{DEFAULT_COLOR as et,DEFAULT_COLORS as tt,getColor as ot,getSequentialInterpolator as it,getSize as at,interpolateViridis as rt,resolveCategoricalPalette as nt,resolveExplicitColor as lt}from"./c-CPV4N35K.min.js";import{useSelectionSelector as st,useTheme as ct}from"./c-JUKIWTBJ.min.js";import{getMax as ht,getMinMax as mt}from"./c-QA3HMQJP.min.js";import{resolveCSSColor as dt}from"./c-553QUDKA.min.js";import{useMemo as ut,useCallback as pt,forwardRef as yt,useRef as ft}from"react";import{useCallback as gt,useMemo as bt,useRef as xt,useState as vt}from"react";import{jsx as At}from"react/jsx-runtime";J(_),te(V);var wt=yt(function(t,o){let i=ft(null),a=Xe(t.mode,{width:t.width,height:t.height,showGrid:t.showGrid,enableHover:t.enableHover,showLegend:t.showLegend,title:t.title,xLabel:t.xLabel,yLabel:t.yLabel,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules}),{data:r,margin:n,className:l,xFormat:s,yFormat:c,xAccessor:h="x",yAccessor:m="y",xScaleType:d,yScaleType:u,colorBy:p,colorScheme:y,styleRules:f,sizeBy:g,sizeRange:b=[3,15],symbolBy:x,symbolMap:v,pointRadius:A=5,pointOpacity:w=.8,tooltip:S,marginalGraphics:k,pointIdAccessor:C,annotations:R,regression:L,forecast:_,anomaly:H,xExtent:P,yExtent:D,frameProps:N={},selection:O,linkedHover:E,linkedBrush:j,brush:G,onBrush:z,onObservation:V,onClick:X,hoverHighlight:$,chartId:Q,loading:Y,loadingContent:J,emptyContent:U,legendInteraction:Z,legendPosition:ee,color:te,stroke:oe,strokeWidth:ie,opacity:ae}=t,{width:re,height:ne,enableHover:se,showGrid:ue,showLegend:pe,title:ye,description:fe,summary:be,accessibleTable:xe,xLabel:ve,yLabel:Ae}=a,Se=ut(()=>He(r),[r]),ke=void 0===r,{domain:Ce,trackPushed:Re,reset:Le}=e({accessor:g,data:Se,isPushMode:ke}),_e=pt(e=>{Re([e]),i.current?.push(e)},[Re]),Ie=pt(e=>{Re(e),i.current?.pushMany(e)},[Re]);T(o,{variant:"xy",frameRef:i,overrides:{push:_e,pushMany:Ie,clear:()=>{Le(),i.current?.clear()}}});let Pe=W({data:Se,rawData:r,colorBy:p,colorScheme:y,legendInteraction:Z,legendPosition:ee,frameLegend:N,selection:O,linkedHover:E,fallbackFields:p?["string"==typeof p?p:""]:[],unwrapData:!1,onObservation:V,onClick:X,hoverHighlight:$,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"Scatterplot",chartId:Q,showLegend:pe,userMargin:n,marginDefaults:a.marginDefaults,loading:Y,loadingContent:J,emptyContent:U,width:re,height:ne,hasTitle:!!ye,axisChrome:Ge(N,{showAxes:a.showAxes,xLabel:ve,yLabel:Ae})}),{brushStreamProps:Be}=K({brush:G,onBrush:z,linkedBrush:j,xAccessor:h,yAccessor:m,defaultDimension:"xy"});Ue("Scatterplot",Se,"xAccessor",h),Ue("Scatterplot",Se,"yAccessor",m);let Fe=ut(()=>g?Ce??[0,1]:void 0,[g,Ce]),Ne=ut(()=>g?e=>at(e,g,b,Fe):void 0,[g,b,Fe]),Me=ut(()=>De(h,m),[h,m]),We=B({colorBy:p,colorScale:Pe.colorScale,color:te,pointRadius:A,fillOpacity:w,radiusFn:Ne,stroke:oe,strokeWidth:ie,opacity:ae,styleRules:f,ruleContext:Me,effectiveSelectionHook:Pe.effectiveSelectionHook,resolvedSelection:Pe.resolvedSelection}),Te=ut(()=>me([{label:ve||le(h),accessor:h,role:"x",format:s},{label:Ae||le(m),accessor:m,role:"y",format:c},...p?[{label:le(p),accessor:p,role:"color"}]:[],...g?[{label:le(g),accessor:g,role:"size"}]:[]]),[h,m,ve,Ae,p,g,s,c]),{effectiveData:Oe,statisticalAnnotations:Ee}=I({data:Se,xAccessor:h,yAccessor:m,forecast:_,anomaly:H}),je=ut(()=>{let e=F(L);return e||0!==Ee.length?[...e?[e]:[],...R||[],...Ee]:R},[L,R,Ee]);if(Pe.earlyReturn)return Pe.earlyReturn;let ze=M({componentName:"Scatterplot",data:r,accessors:{xAccessor:h,yAccessor:m}});if(ze)return At(ge,{componentName:"Scatterplot",message:ze,width:re,height:ne});let Ve={chartType:"scatter",...null!=r&&{data:Oe},xAccessor:h,yAccessor:m,xScaleType:d,yScaleType:u,colorAccessor:p||void 0,sizeAccessor:g||void 0,...x&&{symbolAccessor:x},...v&&{symbolMap:v},sizeRange:b,pointStyle:We,colorScheme:y,size:[re,ne],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:Pe.margin,showAxes:a.showAxes,xLabel:ve,yLabel:Ae,xFormat:s,yFormat:c,enableHover:se,showGrid:ue,...Pe.legendBehaviorProps,...ce({title:ye,description:fe,summary:be,accessibleTable:xe,className:l,animate:t.animate,maxDevicePixelRatio:t.maxDevicePixelRatio,axisExtent:t.axisExtent,autoPlaceAnnotations:t.autoPlaceAnnotations}),...de({tooltip:S,defaultTooltipContent:Te}),...he({linkedHover:E,selection:O,onObservation:V,onClick:X,hoverHighlight:$,hoverRadius:t.hoverRadius,mobileInteraction:Pe.mobileInteraction,customHoverBehavior:Pe.customHoverBehavior,customClickBehavior:Pe.customClickBehavior}),...k&&{marginalGraphics:k},...C&&{pointIdAccessor:C},...je&&je.length>0&&{annotations:je},...P&&{xExtent:P},...D&&{yExtent:D},...Be,...Pe.crosshairProps,...N};return At(we,{componentName:"Scatterplot",width:re,height:ne,children:At(q,{ref:i,...Ve})})});wt.displayName="Scatterplot";import{useMemo as St,forwardRef as kt,useRef as Ct}from"react";import{Fragment as Rt,jsx as Lt}from"react/jsx-runtime";te(V);var _t=kt(function(e,o){let i=Ct(null);T(o,{variant:"xy",frameRef:i});let a=Xe(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:r,margin:n,className:l,xFormat:s,yFormat:c,xAccessor:h="x",yAccessor:m="y",orderAccessor:d,orderLabel:u,styleRules:p,pointRadius:y=4,tooltip:f,pointIdAccessor:g,annotations:b,regression:x,forecast:v,anomaly:A,xExtent:w,yExtent:S,frameProps:k={},selection:C,linkedHover:R,onObservation:L,onClick:_,hoverHighlight:H,chartId:P,loading:D,loadingContent:N,emptyContent:O,legendInteraction:E,stroke:j,strokeWidth:G,opacity:z}=e,{width:V,height:X,enableHover:$,showGrid:Q,title:Y,description:J,summary:K,accessibleTable:U,xLabel:Z,yLabel:ee}=a,{safeData:te,orderMap:oe}=St(()=>{let e=r||[],t="function"==typeof h?h:e=>e[h],o="function"==typeof m?m:e=>e[m],i=e;if(d&&e.length>0){let t="function"==typeof d?d:e=>e[d];i=[...e].sort((e,o)=>{let i=t(e),a=t(o);return(i instanceof Date?i.getTime():+i)-(a instanceof Date?a.getTime():+a)})}let a=new WeakMap,n=0;for(let e of i){let i=t(e),a=o(e);null!=i&&null!=a&&isFinite(i)&&isFinite(a)&&n++}let l=0;for(let e of i){let i=t(e),r=o(e);null!=i&&null!=r&&isFinite(i)&&isFinite(r)&&a.set(e,{idx:l++,total:n})}return{safeData:i,orderMap:a}},[r,d,h,m]);Ue("ConnectedScatterplot",te,"xAccessor",h),Ue("ConnectedScatterplot",te,"yAccessor",m);let ie=W({data:te,rawData:r,colorBy:void 0,colorScheme:void 0,legendInteraction:E,selection:C,linkedHover:R,fallbackFields:[],unwrapData:!1,onObservation:L,onClick:_,hoverHighlight:H,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"ConnectedScatterplot",chartId:P,showLegend:void 0,userMargin:n,marginDefaults:a.marginDefaults,loading:D,loadingContent:N,emptyContent:O,width:V,height:X,hasTitle:!!Y,axisChrome:Ge(k,{showAxes:a.showAxes,xLabel:Z,yLabel:ee})}),ae=ie.resolvedSelection?.unselectedOpacity??be,re=St(()=>(e,o)=>{let i=o.filter(e=>"point"===e.type);if(2>i.length)return;let a=ie.effectiveSelectionHook?.isActive,r=ie.effectiveSelectionHook?.predicate,n=100>i.length,l=i.length;e.lineCap="round";for(let o=0;l-1>o;o++){let s=i[o],c=i[o+1],h=t(o,l),m=!a||!r||r(s.datum??s)||r(c.datum??c),d=a?m?1:ae:1;n&&(e.beginPath(),e.moveTo(s.x,s.y),e.lineTo(c.x,c.y),e.strokeStyle="white",e.lineWidth=y+2,e.globalAlpha=.5*d,e.stroke()),e.beginPath(),e.moveTo(s.x,s.y),e.lineTo(c.x,c.y),e.strokeStyle=h,e.lineWidth=y,e.globalAlpha=d,e.stroke()}e.globalAlpha=1},[y,ie.effectiveSelectionHook,ae]),ne=St(()=>[re],[re]),se=St(()=>(e,o,i)=>{let a=e.filter(e=>"point"===e.type);if(2>a.length)return null;let r=a.length,n=100>r,l=[];for(let e=0;r-1>e;e++){let o=a[e],i=a[e+1],s=t(e,r),c=Math.min("number"==typeof o.style?.opacity?o.style.opacity:1,"number"==typeof i.style?.opacity?i.style.opacity:1);n&&l.push(Lt("line",{x1:o.x,y1:o.y,x2:i.x,y2:i.y,stroke:"white",strokeWidth:y+2,strokeLinecap:"round",opacity:.5*c},"halo-"+e)),l.push(Lt("line",{x1:o.x,y1:o.y,x2:i.x,y2:i.y,stroke:s,strokeWidth:y,strokeLinecap:"round",opacity:c},"seg-"+e))}return Lt(Rt,{children:l})},[y]),ue=St(()=>[se],[se]),pe=St(()=>e=>{let o=oe.get(e),i=o?.idx??0,a=o?.total??1;return{fill:a>0?t(i,a):"#6366f1",stroke:"white",strokeWidth:1,r:y,fillOpacity:1}},[y,oe]),ye=St(()=>De(h,m),[h,m]),fe=B({colorScale:void 0,baseStyleExtras:pe,stroke:j,strokeWidth:G,opacity:z,styleRules:p,ruleContext:ye,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection}),xe=u||("string"==typeof d?d:"Order"),ve=St(()=>me([{label:Z||le(h),accessor:h,role:"x",format:s},{label:ee||le(m),accessor:m,role:"y",format:c},...d?[{label:xe,accessor:d,role:"group"}]:[]]),[h,m,Z,ee,d,xe,s,c]),Ae=M({componentName:"ConnectedScatterplot",data:r,accessors:{xAccessor:h,yAccessor:m}}),{effectiveData:Se,statisticalAnnotations:ke}=I({data:te,xAccessor:h,yAccessor:m,forecast:v,anomaly:A});if(ie.earlyReturn)return ie.earlyReturn;let Ce=F(x),Re=Ce||ke.length>0?[...Ce?[Ce]:[],...b||[],...ke]:b,Le={chartType:"scatter",...null!=r&&{data:Se},xAccessor:h,yAccessor:m,pointStyle:fe,size:[V,X],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ie.margin,showAxes:a.showAxes,xLabel:Z,yLabel:ee,xFormat:s,yFormat:c,enableHover:$,showGrid:Q,...ce({title:Y,description:J,summary:K,accessibleTable:U,className:l,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...de({tooltip:f,defaultTooltipContent:ve}),...he({linkedHover:R,selection:C,onObservation:L,onClick:_,hoverHighlight:H,hoverRadius:e.hoverRadius,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...g&&{pointIdAccessor:g},canvasPreRenderers:ne,svgPreRenderers:ue,...Re&&Re.length>0&&{annotations:Re},...w&&{xExtent:w},...S&&{yExtent:S},...ie.crosshairProps,...k};return Ae?Lt(ge,{componentName:"ConnectedScatterplot",message:Ae,width:V,height:X}):Lt(we,{componentName:"ConnectedScatterplot",width:V,height:X,children:Lt(q,{ref:i,...Le})})});_t.displayName="ConnectedScatterplot";import{forwardRef as Ht,useMemo as It}from"react";import{jsx as Pt}from"react/jsx-runtime";te(Q);var Bt=Ht(function(e,t){let{data:o,layout:i,layoutConfig:a,onLayoutError:r,xExtent:n,yExtent:l,showAxes:s=!1,margin:c,className:h,annotations:m,onObservation:d,onClick:u,selection:p,linkedHover:y,hoverHighlight:f,chartId:g,loading:b,loadingContent:x,emptyContent:v,colorBy:A,colorScheme:w,legend:S,legendInteraction:k,legendPosition:C,frameProps:R={}}=e,{legend:L,..._}=R,H=It(()=>Re(L,S),[L,S]),{frameRef:I,resolved:P,safeData:B,setup:F,earlyReturn:D}=N({imperativeRef:t,imperativeVariant:"xy",chartTypeLabel:"XYCustomChart",unwrapData:!1,data:o,colorBy:A,colorScheme:w,legend:H,legendInteraction:k,legendPosition:C,frameLegend:_,selection:p,linkedHover:y,hoverHighlight:f,onObservation:d,onClick:u,chartId:g,loading:b,loadingContent:x,emptyContent:v,margin:c,width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules,xLabel:e.xLabel,yLabel:e.yLabel}),M=F.effectiveSelectionHook,W=It(()=>M?.isActive?{isActive:!0,predicate:M.predicate}:null,[M?.isActive,M?.predicate]),T=It(()=>Ee({tooltip:e.tooltip,defaultTooltipContent:e=>Pt(Y,{hover:e})}),[e.tooltip]);if(D)return D;let{width:O,height:E,enableHover:j,showGrid:G,title:z,description:V,summary:X,accessibleTable:$,xLabel:Q,yLabel:J}=P,K={chartType:"custom",...null!=o&&{data:B},customLayout:i,layoutConfig:a,onLayoutError:r,...W&&{layoutSelection:W},xExtent:n,yExtent:l,colorAccessor:A,colorScheme:w,size:[O,E],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:F.margin,showAxes:s,xLabel:Q,yLabel:J,enableHover:j,showGrid:G,...F.legendBehaviorProps,...ce({title:z,description:V,summary:X,accessibleTable:$,className:h,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...T,...he({linkedHover:y,selection:p,onObservation:d,onClick:u,hoverRadius:e.hoverRadius,hoverHighlight:f,mobileInteraction:F.mobileInteraction,customHoverBehavior:F.customHoverBehavior,customClickBehavior:F.customClickBehavior}),...m&&m.length>0&&{annotations:m},...F.crosshairProps,..._};return Pt(we,{componentName:"XYCustomChart",width:O,height:E,children:Pt(q,{ref:I,...K})})});Bt.displayName="XYCustomChart";import{forwardRef as Ft,useMemo as Dt}from"react";import{useCallback as Nt,useMemo as Mt}from"react";import{jsx as Wt,jsxs as Tt}from"react/jsx-runtime";import{jsx as Ot}from"react/jsx-runtime";import{jsx as Et}from"react/jsx-runtime";var jt=Ft(function(e,t){let i=Je(),r=ct(),{data:n,xAccessor:l,yAccessor:s,lineBy:c,rankDirection:h="descending",ribbon:m=!1,curve:u="smooth",ribbonSizeRange:p=[4,28],samplesPerSegment:y=12,lineWidth:f=3,highlightTop:g,neutralColor:b,styleRules:x,labelStyle:v,colorScheme:A,ribbonOpacity:w=.82,lineOpacity:S=.9,showPoints:k=!1,pointRadius:C=3,showLabels:R=!0,labelPriorityAccessor:L,maxLabels:_,showAxes:H=!0,showGrid:I=!0,showLegend:P=!1,enableHover:B=!0,hoverHighlight:F=!0,tooltip:D,frameProps:N={},xFormat:M,yFormat:W,onClick:T}=e,O=Dt(()=>a(n,{xAccessor:l,yAccessor:s,lineBy:c,rankDirection:h,highlightTop:g}),[n,l,s,c,h,g]),{axes:E,areaStyle:j,pointStyle:G,...z}=N,V=Dt(()=>function(e){let{seriesOrder:t,overallOrder:o,highlightTop:i,color:a,colorScheme:r,neutralColor:n,themeCategorical:l,themeNeutral:s}=e;if(null==i&&null==a)return r;let c=new Set(o.slice(0,null==i?o.length:Math.max(0,Math.floor(i)))),h=new Map,m={};for(let e of t)Object.defineProperty(m,e,{configurable:!0,enumerable:!0,writable:!0,value:a??(c.has(e)?Te(void 0,l,r,e,h):n??s??"#b8bec8")});return m}({seriesOrder:O.seriesOrder,overallOrder:O.overallOrder,highlightTop:g,color:e.color,colorScheme:A,neutralColor:b,themeCategorical:i,themeNeutral:r.colors.textSecondary}),[O.seriesOrder,O.overallOrder,g,e.color,A,b,i,r.colors.textSecondary]),X=Dt(()=>({ribbon:m,curve:u,samplesPerSegment:y,ribbonSizeRange:p,valueExtent:O.valueExtent,seriesOrder:O.seriesOrder,lineWidth:f,ribbonOpacity:w,lineOpacity:S,neutralColor:b,color:e.color,colorMap:V&&"object"==typeof V&&!Array.isArray(V)?V:void 0,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,styleRules:x,areaStyle:j,pointStyle:G,labelStyle:v,showPoints:k,pointRadius:C,showLabels:R,labelPriorityAccessor:L,maxLabels:_}),[m,u,y,p,O.valueExtent,O.seriesOrder,f,w,S,b,V,e.color,e.stroke,e.strokeWidth,e.opacity,x,j,G,v,k,C,R,L,_]),{tooltip:$,formatX:Q}=function({tooltip:e,xValues:t,xFormat:o,yFormat:i}){let a=Nt((e,i)=>{if(0===t.length)return"";let a=t[Math.max(0,Math.min(t.length-1,Math.round(Number(e))))];return o?o(a,i):(a instanceof Date?a.toLocaleDateString():a)+""},[o,t]),r=Nt(e=>i?i(e):e.toLocaleString(),[i]),n=Pe(e),l=Mt(()=>n?void 0:Ne(e),[n,e]),s=Nt(t=>{let o=t?.data??t;return o&&!1!==e?l?l({...t,data:o.__bumpRaw,__semioticHoverData:!0}):Tt(Ce,{children:[Wt("div",{style:{fontWeight:700},children:o.__bumpSeries}),Tt("div",{children:[a(o.x)," · Rank ",o.__bumpRank]}),Tt("div",{children:["Value: ",r(o.__bumpValue)]})]}):null},[r,a,l,e]),c=Nt(t=>{let o=(Array.isArray(t.allSeries)?t.allSeries:[]).map(e=>{let t=e.datum;return{...e,value:t?.__bumpValue??e.value,rank:t?.__bumpRank,datum:t?.__bumpRaw??e.datum}}),i=t?.data??t,n={...i?.__bumpRaw??{},xValue:i?.__bumpXValue??t.xValue,allSeries:o};if(Be(e)&&"function"==typeof e.content)return e.content(n);let l=t.xValue??i?.x;return Tt(Ce,{children:[null!=l&&Wt("div",{style:{fontWeight:700,marginBottom:4},children:a(l)}),o.map((e,t)=>Tt("div",{style:{display:"flex",alignItems:"center",gap:6},children:[Wt("span",{style:{width:8,height:8,borderRadius:"50%",background:e.color,flexShrink:0}}),Wt("span",{style:{flex:1},children:e.group}),Tt("span",{children:[null!=e.rank?`Rank ${e.rank} · `:"",r(e.value)]})]},`${e.group}-${t}`))]})},[r,a,e]);return{tooltip:Mt(()=>!1!==e&&(n?{mode:"multi",content:c}:s),[n,c,s,e]),formatX:a}}({tooltip:D,xValues:O.xValues,xFormat:M,yFormat:W}),Y=Dt(()=>{if(T)return(e,t)=>{T(e.__bumpRaw??e,t)}},[T]),q=Math.max(1,O.seriesOrder.length),J=O.xValues.map((e,t)=>t),K=Array.from({length:q},(e,t)=>t+1),U=E??[{orient:"left",tickValues:K,tickFormat:e=>e+"",label:e.yLabel??"Rank",baseline:!1},{orient:"bottom",tickValues:J,tickFormat:Q,label:e.xLabel,tickAnchor:"edges"}],Z=Dt(()=>function(e,t){if(!e?.length)return;let i=new Map(t.map((e,t)=>[o(e),t]));return e.map(e=>{let t={...e},a=a=>{if(!(a in e))return;let r=i.get(o(e[a]));void 0!==r&&(t[a]=r)};return a("x"),a("x0"),a("x1"),"string"==typeof e.type&&("x-threshold"===e.type||"x"===e.type)&&a("value"),t})}(e.annotations,O.xValues),[e.annotations,O.xValues]);return Et(Bt,{ref:t,data:O.data,layout:d,layoutConfig:X,xExtent:[0,Math.max(1,O.xValues.length-1)],yExtent:[q+.5,.5],showAxes:H,showGrid:I,showLegend:P,enableHover:B,hoverHighlight:F,colorBy:"__bumpSeries",colorScheme:V,tooltip:$,onClick:Y,hoverRadius:e.hoverRadius,width:e.width,height:e.height,responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,responsiveRules:e.responsiveRules,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,mode:e.mode,margin:e.margin??{top:20,right:R?110:24,bottom:48,left:48},className:e.className,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,selection:e.selection,linkedHover:e.linkedHover,legend:e.legend,legendInteraction:e.legendInteraction,legendPosition:e.legendPosition,onObservation:e.onObservation,chartId:e.chartId,loading:e.loading,loadingContent:e.loadingContent,emptyContent:e.emptyContent,animate:e.animate,autoPlaceAnnotations:e.autoPlaceAnnotations,annotations:Z,xLabel:e.xLabel,yLabel:e.yLabel??"Rank",frameProps:{axes:U,axisExtent:"exact",...z}})});jt.displayName="BumpChart";import{useMemo as Gt,forwardRef as zt,useRef as Vt}from"react";import{useMemo as Xt}from"react";import{jsx as $t}from"react/jsx-runtime";te(U);var Qt=zt(function(e,t){let o=Vt(null);T(t,{variant:"xy",frameRef:o});let i=Xe(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",yAccessor:h="y",areaBy:m,y0Accessor:d,gradientFill:p=!1,semanticGradient:y,semanticLine:f=!0,lineDataAccessor:g="coordinates",colorBy:b,colorScheme:x,styleRules:v,curve:A="monotoneX",areaOpacity:w=.7,lineGradient:S,showLine:k=!0,lineWidth:C=2,showPoints:R=!1,pointRadius:L=3,tooltip:_,annotations:H,forecast:P,anomaly:B,band:F,xExtent:D,yExtent:N,frameProps:O={},selection:E,linkedHover:j,onObservation:G,onClick:z,hoverHighlight:V,chartId:X,loading:$,loadingContent:Q,emptyContent:Y,legendInteraction:J,legendPosition:K,color:U,stroke:Z,strokeWidth:ee,opacity:te}=e,{width:le,height:se,enableHover:me,showGrid:de,showLegend:ue,title:pe,description:ye,summary:fe,accessibleTable:be,xLabel:xe,yLabel:ve}=i,Se=Gt(()=>He(a),[a]),ke=b||m,Ce=Gt(()=>ae(y),[y]),Re=Gt(()=>Ce?.stops.length?re(Ce):ie(p),[Ce,p]),Le=Gt(()=>oe(S),[S]),_e=Gt(()=>f?ne(Ce):void 0,[Ce,f]);Ue("AreaChart",Se,"xAccessor",c),Ue("AreaChart",Se,"yAccessor",h);let Ie=W({data:Se,rawData:a,colorBy:ke,colorScheme:x,legendInteraction:J,legendPosition:K,frameLegend:O,selection:E,linkedHover:j,fallbackFields:ke?["string"==typeof ke?ke:""]:[],unwrapData:!1,onObservation:G,onClick:z,hoverHighlight:V,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"AreaChart",chartId:X,showLegend:ue,userMargin:r,marginDefaults:i.marginDefaults,loading:$,loadingContent:Q,emptyContent:Y,width:le,height:se,hasTitle:!!pe,axisChrome:Ge(O,{showAxes:i.showAxes,xLabel:xe,yLabel:ve})}),{effectiveData:Pe,statisticalAnnotations:Be}=I({data:Se,xAccessor:c,yAccessor:h,forecast:P,anomaly:B,groupBy:m}),Fe=Gt(()=>De(c,h),[c,h]),{flattenedData:Ne,lineStyle:Me,pointStyle:We,defaultTooltipContent:Te}=u({safeData:Pe,data:a,areaBy:m,lineDataAccessor:g,colorBy:ke,colorScale:Ie.colorScale,color:U,stroke:Z,strokeWidth:ee,opacity:te,effectiveSelectionHook:Ie.effectiveSelectionHook,resolvedSelection:Ie.resolvedSelection,areaOpacity:w,showLine:k,lineWidth:C,showPoints:R,pointRadius:L,xAccessor:c,yAccessor:h,xLabel:xe,yLabel:ve,xFormat:l,yFormat:s,groupField:m||b,band:F,styleRules:v,ruleContext:Fe}),Oe=M({componentName:"AreaChart",data:a,accessors:{xAccessor:c,yAccessor:h}}),je={chartType:"area",...null!=a&&{data:Ne},xAccessor:c,yAccessor:h,groupAccessor:m||void 0,...d&&{y0Accessor:d},...F&&{band:F},...Re&&{gradientFill:Re},...Le&&{lineGradient:Le},..._e&&{semanticLineStops:_e},curve:A,lineStyle:Me,...R&&We&&{pointStyle:We},size:[le,se],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Ie.margin,showAxes:i.showAxes,xLabel:xe,yLabel:ve,xFormat:l,yFormat:s,enableHover:me,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:de,...Ie.legendBehaviorProps,...ce({title:pe,description:ye,summary:fe,accessibleTable:be,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ee({tooltip:_,defaultTooltipContent:Te,multiDefaultContent:Ae()}),...he({linkedHover:j,selection:E,onObservation:G,onClick:z,hoverHighlight:V,hoverRadius:e.hoverRadius,mobileInteraction:Ie.mobileInteraction,customHoverBehavior:Ie.customHoverBehavior,customClickBehavior:Ie.customClickBehavior}),...(H&&H.length>0||Be.length>0)&&{annotations:[...H||[],...Be]},...D&&{xExtent:D},...N&&{yExtent:N},...Ie.crosshairProps,...O};return Ie.earlyReturn?Ie.earlyReturn:Oe?$t(ge,{componentName:"AreaChart",message:Oe,width:le,height:se}):$t(we,{componentName:"AreaChart",width:le,height:se,children:$t(q,{ref:o,...je})})});Qt.displayName="AreaChart";import{useMemo as Yt,forwardRef as qt,useRef as Jt,useState as Kt,useImperativeHandle as Ut,useCallback as Zt}from"react";import{jsx as eo,jsxs as to}from"react/jsx-runtime";te(ee);var oo=qt(function(e,t){let o=Jt(null),i=Xe(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",seriesAAccessor:h="a",seriesBAccessor:m="b",seriesALabel:d="A",seriesBLabel:u="B",seriesAColor:g="var(--semiotic-danger, #dc2626)",seriesBColor:b="var(--semiotic-info, #2563eb)",showLines:x=!0,lineWidth:v=1.5,showPoints:A=!1,pointRadius:w=3,curve:S="linear",areaOpacity:k=.6,gradientFill:C,styleRules:R,tooltip:L,annotations:_,xExtent:H,yExtent:I,frameProps:P={},selection:B,linkedHover:F,onObservation:D,onClick:N,hoverHighlight:M,chartId:T,loading:O,loadingContent:E,emptyContent:j,legendInteraction:G,legendPosition:z,pointIdAccessor:V,windowSize:X}=e,{width:$,height:Q,enableHover:Y,showGrid:J,showLegend:K,title:U,description:Z,summary:ee,accessibleTable:te,xLabel:oe,yLabel:ae}=i,re=Yt(()=>"function"==typeof c?e=>f(c(e)):e=>f(e[c]),[c]),ne=Yt(()=>"function"==typeof h?e=>f(h(e)):e=>f(e[h]),[h]),le=Yt(()=>"function"==typeof m?e=>f(m(e)):e=>f(e[m]),[m]),[se,me]=Kt([]),de=Jt([]),ue=null==a,pe=Yt(()=>He(ue?se:a),[ue,se,a]),ye=Yt(()=>function(e,t,o,i){if(!e.length)return[];let a=e.filter(e=>Number.isFinite(t(e))).sort((e,o)=>t(e)-t(o)),r=[],n=0,l=null,s=null,c=[],h=(e,t)=>e>t?"A":t>e?"B":null,m=e=>`seg-${n}-${e}`,d=e=>r.push(e),u=(e,t)=>{d({__x:e.x,__y:e.y,__y0:e.y,__diffSegment:m(t),__diffWinner:t,__valA:e.y,__valB:e.y,__sourceDatum:e.datum})};for(let e=0;a.length>e;e++){let r=a[e],p=t(r),y=o(r),f=i(r);if(!Number.isFinite(p)||!Number.isFinite(y)||!Number.isFinite(f))continue;let g=h(y,f);if(null!==g){if(null==l){l=g;for(let e of c)u(e,l);c=[],d({__x:p,__y:f>y?f:y,__y0:f>y?y:f,__diffSegment:m(l),__diffWinner:l,__valA:y,__valB:f,__sourceDatum:r}),s={x:p,a:y,b:f,w:g};continue}if(s&&s.w!==g){let e,t;if(c.length>0)e=c[0].x,t=c[0].y;else{let o=y-s.a-(f-s.b);if(0!==o){let i=Math.max(0,Math.min(1,(s.b-s.a)/o));e=s.x+i*(p-s.x),t=s.a+i*(y-s.a)}else e=s.x,t=s.a}d({__x:e,__y:t,__y0:t,__diffSegment:m(l),__diffWinner:l,__valA:t,__valB:t}),n++,l=g,d({__x:e,__y:t,__y0:t,__diffSegment:m(l),__diffWinner:l,__valA:t,__valB:t});for(let e=1;c.length>e;e++)u(c[e],l)}else for(let e of c)u(e,l);c=[],d({__x:p,__y:f>y?f:y,__y0:f>y?y:f,__diffSegment:m(l),__diffWinner:l,__valA:y,__valB:f,__sourceDatum:r}),s={x:p,a:y,b:f,w:g}}else c.push({x:p,y:y,datum:r})}for(let e of c)u(e,l??"A");return r}(pe,re,ne,le),[pe,re,ne,le]),fe=Yt(()=>x?function(e,t,o,i){if(!e.length)return[];let a=e.filter(e=>Number.isFinite(t(e))).sort((e,o)=>t(e)-t(o)),r=[];for(let e of a){let a=t(e),n=o(e),l=i(e);Number.isFinite(n)&&r.push({__x:a,__y:n,__diffSegment:"line-A",__diffWinner:"A",__sourceDatum:e}),Number.isFinite(l)&&r.push({__x:a,__y:l,__diffSegment:"line-B",__diffWinner:"B",__sourceDatum:e})}return r}(pe,re,ne,le):[],[x,pe,re,ne,le]),ge=Yt(()=>[...ye,...fe],[ye,fe]),be=Yt(()=>{let e=new Set;for(let t of ye)e.add(t.__diffSegment);return Array.from(e)},[ye]);Ut(t,()=>{let e=e=>{let t=X&&e.length>X?e.slice(e.length-X):e;de.current=t,me(t)},t=V?"function"==typeof V?V:e=>e[V]:null;return{push:t=>e([...de.current,t]),pushMany:t=>e([...de.current,...t]),remove:o=>{if(!t)return[];let i=Array.isArray(o)?o:[o],a=[],r=[];for(let e of de.current)i.includes(t(e))?a.push(e):r.push(e);return e(r),a},update:(o,i)=>{if(!t)return[];let a=Array.isArray(o)?o:[o],r=[],n=de.current.map(e=>{if(a.includes(t(e))){let t=i(e);return r.push(t),t}return e});return e(n),r},clear:()=>e([]),getData:()=>ue?de.current:pe,getScales:()=>o.current?.getScales()??null}},[ue,pe,V,X]);let xe=Yt(()=>!1===K?void 0:{legendGroups:[{label:"",type:"fill",styleFn:e=>({fill:e.color||"currentColor"}),items:[{label:d,color:g},{label:u,color:b}]}]},[K,d,u,g,b]),ve=Object.hasOwn(P,"legend")?P:{...P,legend:xe},Ae=W({data:pe,rawData:a,colorBy:"__diffWinner",colorScheme:[g,b],legendInteraction:G,legendPosition:z,frameLegend:ve,selection:B,linkedHover:F,fallbackFields:["__diffWinner"],unwrapData:!1,onObservation:D,onClick:N,hoverHighlight:M,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"DifferenceChart",chartId:T,showLegend:K,userMargin:r,marginDefaults:i.marginDefaults,loading:O,loadingContent:E,emptyContent:j,width:$,height:Q,hasTitle:!!U,axisChrome:Ge(P,{showAxes:i.showAxes,xLabel:oe,yLabel:ae})}),Se=Yt(()=>function(e){let{seriesAColor:t,seriesBColor:o,areaOpacity:i,styleRules:a}=e;return y(e=>({fill:"A"===p(e)?t:o,stroke:"none",fillOpacity:i}),a)}({seriesAColor:g,seriesBColor:b,areaOpacity:k,styleRules:R}),[g,b,k,R]),ke=Yt(()=>function(e){let{seriesAColor:t,seriesBColor:o,lineWidth:i,styleRules:a}=e;return y(e=>({stroke:"A"===p(e)?t:o,strokeWidth:i,fill:"none"}),a)}({seriesAColor:g,seriesBColor:b,lineWidth:v,styleRules:R}),[g,b,v,R]),Ce=Yt(()=>function(e){let{seriesAColor:t,seriesBColor:o,pointRadius:i,styleRules:a}=e;return y(e=>({fill:"A"===p(e)?t:o,r:i}),a)}({seriesAColor:g,seriesBColor:b,pointRadius:w,styleRules:R}),[g,b,w,R]),[Re,Le,Ie]=Yt(()=>[Se,ke,Ce].map(e=>Ze(e,Ae.effectiveSelectionHook,Ae.resolvedSelection)),[Se,ke,Ce,Ae.effectiveSelectionHook,Ae.resolvedSelection]),Pe=Zt(e=>{let t=e.data,o=e.allSeries,i=e.xValue??t?.__x,a=t?.__valA,r=t?.__valB;if(o&&o.length>0){let e=o.find(e=>"line-A"===e.group),t=o.find(e=>"line-B"===e.group);null!=e?.value&&Number.isFinite(e.value)&&(a=e.value),null!=t?.value&&Number.isFinite(t.value)&&(r=t.value)}if(null!=i&&(null==a||null==r)){let e=pe.find(e=>re(e)===i);e&&(null==a&&(a=ne(e)),null==r&&(r=le(e)))}let n=e=>null!=e&&Number.isFinite(e)?""+Math.round(100*e)/100:"—",s=l&&null!=i?l(i):null!=i?i+"":"";return to("div",{className:"semiotic-tooltip",style:_e,children:[s&&eo("div",{style:{fontWeight:600,marginBottom:4},children:s}),to("div",{style:{display:"flex",alignItems:"center",gap:6},children:[eo("span",{style:{width:10,height:10,background:g,display:"inline-block",borderRadius:2}}),to("span",{children:[d,": ",n(a)]})]}),to("div",{style:{display:"flex",alignItems:"center",gap:6},children:[eo("span",{style:{width:10,height:10,background:b,display:"inline-block",borderRadius:2}}),to("span",{children:[u,": ",n(r)]})]}),null!=a&&null!=r&&Number.isFinite(a)&&Number.isFinite(r)&&to("div",{style:{marginTop:4,opacity:.7},children:["Δ = ",n(a-r)]})]})},[pe,re,ne,le,l,g,b,d,u]),{tooltipContent:Be,tooltipMode:Fe}=Yt(()=>Ee({tooltip:L,defaultTooltipContent:Pe,multiDefaultContent:Pe}),[L,Pe]),De=Yt(()=>ie(C,{stops:[{offset:0,opacity:.85},{offset:1,opacity:.15}]}),[C]);if(Ae.earlyReturn)return Ae.earlyReturn;let Ne={chartType:"mixed",data:ge,xAccessor:"__x",yAccessor:"__y",y0Accessor:"__y0",groupAccessor:"__diffSegment",areaGroups:be,curve:S,areaStyle:Re,lineStyle:Le,...A&&{pointStyle:Ie},size:[$,Q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Ae.margin,showAxes:i.showAxes,xLabel:oe,yLabel:ae,xFormat:l,yFormat:s,enableHover:Y,showGrid:J,...De&&{gradientFill:De},...Ae.legendBehaviorProps,...ce({title:U,description:Z,summary:ee,accessibleTable:te,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),tooltipContent:Be,..."multi"===Fe&&{tooltipMode:"multi"},...he({linkedHover:F,selection:B,onObservation:D,onClick:N,hoverHighlight:M,hoverRadius:e.hoverRadius,mobileInteraction:Ae.mobileInteraction,customHoverBehavior:Ae.customHoverBehavior,customClickBehavior:Ae.customClickBehavior}),..._&&_.length>0&&{annotations:_},...H&&{xExtent:H},...I&&{yExtent:I},...Ae.crosshairProps,...P};return eo(we,{componentName:"DifferenceChart",width:$,height:Q,children:eo(q,{ref:o,...Ne})})});"function"==typeof oo&&(oo.displayName="DifferenceChart");import{useMemo as io,forwardRef as ao,useRef as ro}from"react";import{jsx as no}from"react/jsx-runtime";te(X);var lo=ao(function(e,t){let o=ro(null),i=Xe(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",yAccessor:h="y",areaBy:m,lineDataAccessor:d="coordinates",colorBy:p,colorScheme:y,styleRules:f,curve:g="monotoneX",areaOpacity:b=.7,showLine:x=!0,lineWidth:v=2,showPoints:A=!1,pointRadius:w=3,normalize:S=!1,baseline:k="zero",stackOrder:C,tooltip:R,annotations:L,xExtent:_,yExtent:H,frameProps:I={},selection:P,linkedHover:B,onObservation:F,onClick:D,hoverHighlight:N,chartId:O,loading:E,loadingContent:j,emptyContent:G,legendInteraction:z,legendPosition:V,color:X,stroke:$,strokeWidth:Q,opacity:Y}=e,{width:J,height:K,enableHover:U,showGrid:Z,showLegend:ee,title:te,description:oe,summary:ie,accessibleTable:ae,xLabel:re,yLabel:ne}=i,le=io(()=>He(a),[a]),se=p||m;T(t,{variant:"xy",frameRef:o});let me=W({data:le,rawData:a,colorBy:se,colorScheme:y,legendInteraction:z,legendPosition:V,frameLegend:I,selection:P,linkedHover:B,fallbackFields:se?["string"==typeof se?se:""]:[],unwrapData:!1,onObservation:F,onClick:D,hoverHighlight:N,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"StackedAreaChart",chartId:O,showLegend:ee,userMargin:r,marginDefaults:i.marginDefaults,loading:E,loadingContent:j,emptyContent:G,width:J,height:K,hasTitle:!!te,axisChrome:Ge(I,{showAxes:i.showAxes,xLabel:re,yLabel:ne})}),de=io(()=>De(c,h),[c,h]),{flattenedData:ue,lineStyle:pe,pointStyle:ye,defaultTooltipContent:fe}=u({safeData:le,data:a,areaBy:m,lineDataAccessor:d,colorBy:se,colorScale:me.colorScale,color:X,stroke:$,strokeWidth:Q,opacity:Y,effectiveSelectionHook:me.effectiveSelectionHook,resolvedSelection:me.resolvedSelection,areaOpacity:b,showLine:x,lineWidth:v,showPoints:A,pointRadius:w,xAccessor:c,yAccessor:h,xLabel:re,yLabel:ne,xFormat:l,yFormat:s,groupField:m||p,styleRules:f,ruleContext:de}),be=M({componentName:"StackedAreaChart",data:a,accessors:{xAccessor:c,yAccessor:h}}),xe={chartType:"stackedarea",...null!=a&&{data:ue},xAccessor:c,yAccessor:h,groupAccessor:m||void 0,curve:g,normalize:S,baseline:S?"zero":k,stackOrder:C,lineStyle:pe,...A&&ye&&{pointStyle:ye},size:[J,K],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:me.margin,showAxes:i.showAxes,xLabel:re,yLabel:ne,xFormat:l,yFormat:s,enableHover:U,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:Z,...me.legendBehaviorProps,...ce({title:te,description:oe,summary:ie,accessibleTable:ae,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ee({tooltip:R,defaultTooltipContent:fe,multiDefaultContent:Ae()}),...he({linkedHover:B,selection:P,onObservation:F,onClick:D,hoverHighlight:N,hoverRadius:e.hoverRadius,mobileInteraction:me.mobileInteraction,customHoverBehavior:me.customHoverBehavior,customClickBehavior:me.customClickBehavior}),...L&&L.length>0&&{annotations:L},..._&&{xExtent:_},...H&&{yExtent:H},...me.crosshairProps,...I};return me.earlyReturn?me.earlyReturn:be?no(ge,{componentName:"StackedAreaChart",message:be,width:J,height:K}):no(we,{componentName:"StackedAreaChart",width:J,height:K,children:no(q,{ref:o,...xe})})});lo.displayName="StackedAreaChart";import{useMemo as so,forwardRef as co,useRef as ho}from"react";import{scaleSequential as mo}from"d3-scale";import{jsx as uo}from"react/jsx-runtime";te(z);var po=co(function(e,t){let o=ho(null);T(t,{variant:"xy",frameRef:o});let i=Xe(e.mode,{width:e.width,height:e.height,showGrid:void 0,enableHover:e.enableHover,showLegend:void 0,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:n,xAccessor:l="x",yAccessor:s="y",valueAccessor:c="value",xFormat:h,yFormat:m,colorScheme:d,customColorScale:u,showValues:p=!1,valueFormat:y,cellBorderColor:f="#fff",cellBorderWidth:g=1,tooltip:b,annotations:x,heatmapAggregation:v,heatmapXBins:A,heatmapYBins:w,styleRules:S,xExtent:k,yExtent:C,frameProps:R={},selection:L,linkedHover:_,onObservation:H,onClick:I,hoverHighlight:P,chartId:B,loading:F,loadingContent:D,emptyContent:N,showLegend:W,legendPosition:j,legend:G,legendInteraction:z}=e,{width:V,height:X,enableHover:$,title:Q,description:Y,summary:J,accessibleTable:K,xLabel:U,yLabel:Z}=i,ee=We(F,V,X,D),te=ee?null:Me(a,V,X,N),oe=so(()=>He(a),[a]),ie=Ke(),ae=("string"==typeof R.colorScheme?R.colorScheme:void 0)??d??ie??"blues",re="function"==typeof R.heatmapColorScale?R.heatmapColorScale:"custom"===ae&&"function"==typeof u?u:void 0,ne=W??!1,se=j??"right",{activeSelectionHook:ue,customHoverBehavior:pe,customClickBehavior:ye,crosshairSourceId:fe}=$e({selection:L,linkedHover:_,fallbackFields:[],onObservation:H,onClick:I,chartType:"Heatmap",chartId:B,hoverHighlight:P,colorByField:void 0,mobileInteraction:i.mobileInteraction}),be=O(L),xe=Ie(_,fe);Ye(z,void 0,[]);let ve=so(()=>"function"==typeof c?e=>c(e):e=>e[c],[c]),Ae=so(()=>{let e=oe.map(ve);return mt(e)},[oe,ve]),Se=so(()=>{if(re)return re;let e=it(ae);return mo(e).domain(Ae)},[ae,re,Ae]),ke=so(()=>{let e=Number.isFinite(g)?Math.max(0,g):1;return()=>({stroke:f,strokeWidth:e})},[f,g]),Ce=so(()=>E(l,s,c),[l,s,c]),Re=so(()=>Le(ke,S,Ce),[ke,S,Ce]),_e=so(()=>Ze(Re,ue,be),[ue,Re,be]),Pe=so(()=>me([{label:U||le(l),accessor:l,role:"x",format:h},{label:Z||le(s),accessor:s,role:"y",format:m},{label:le(c),accessor:c,role:"value",format:y}]),[l,s,U,Z,c,h,m,y]),Be=M({componentName:"Heatmap",data:a,accessors:{xAccessor:l,yAccessor:s,valueAccessor:c}}),Fe=so(()=>ne?{gradient:{colorFn:e=>Se(e),domain:Ae,label:"string"==typeof c?c:"value",format:y},legendDistance:G?.legendDistance}:void 0,[ne,Se,Ae,c,y,G?.legendDistance]),{margin:De,legend:Ne,legendPosition:Te,legendMarginReserved:Oe}=Ve({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:se,userMargin:r,defaults:i.marginDefaults,additionalLegend:Fe,chartWidth:V,chartHeight:X,legendLayout:R.legendLayout,frameLegend:R,hasTitle:!!Q,axisChrome:Ge(R,{showAxes:i.showAxes,xLabel:U,yLabel:Z})}),Ee={chartType:"heatmap",...null!=a&&{data:oe},xAccessor:l,yAccessor:s,valueAccessor:c,colorScheme:"custom"!==ae?ae:void 0,...re&&{heatmapColorScale:re},areaStyle:_e,showValues:p,heatmapValueFormat:y,size:[V,X],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:De,showAxes:i.showAxes,xLabel:U,yLabel:Z,xFormat:h,yFormat:m,enableHover:$,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...Ne&&{legend:Ne,legendPosition:Te},...Oe&&{__legendMarginReservedFor:Ne},...ce({title:Q,description:Y,summary:J,accessibleTable:K,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...de({tooltip:b,defaultTooltipContent:Pe}),...he({linkedHover:_,selection:L,onObservation:H,onClick:I,hoverHighlight:P,hoverRadius:e.hoverRadius,mobileInteraction:i.mobileInteraction,customHoverBehavior:pe,customClickBehavior:ye}),...x&&x.length>0&&{annotations:x},...v&&{heatmapAggregation:v},...null!=A&&{heatmapXBins:A},...null!=w&&{heatmapYBins:w},...k&&{xExtent:k},...C&&{yExtent:C},...xe,...R};return ee||te||(Be?uo(ge,{componentName:"Heatmap",message:Be,width:V,height:X}):uo(we,{componentName:"Heatmap",width:V,height:X,children:uo(q,{ref:o,...Ee})}))});po.displayName="Heatmap";import{useMemo as yo,useCallback as fo,forwardRef as go,useRef as bo}from"react";import{jsx as xo}from"react/jsx-runtime";J(_),te(j);var vo=go(function(t,o){let i=bo(null),a=Xe(t.mode,{width:t.width,height:t.height,showGrid:t.showGrid,enableHover:t.enableHover,showLegend:t.showLegend,title:t.title,xLabel:t.xLabel,yLabel:t.yLabel,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules}),{data:r,margin:n,className:l,xFormat:s,yFormat:c,xAccessor:h="x",yAccessor:m="y",sizeBy:d,sizeRange:u=[5,40],colorBy:p,colorScheme:y,styleRules:f,bubbleOpacity:g=.6,bubbleStrokeWidth:b=1,bubbleStrokeColor:x="white",tooltip:v,marginalGraphics:A,pointIdAccessor:w,annotations:S,regression:k,xExtent:C,yExtent:R,frameProps:L={},selection:_,linkedHover:H,linkedBrush:I,brush:P,onBrush:D,onObservation:N,onClick:O,hoverHighlight:E,chartId:j,loading:G,loadingContent:z,emptyContent:V,legendInteraction:X,legendPosition:$,color:Q,stroke:Y,strokeWidth:J,opacity:U}=t,{width:Z,height:ee,enableHover:te,showGrid:oe,showLegend:ie,title:ae,description:re,summary:ne,accessibleTable:se,xLabel:ue,yLabel:pe}=a,ye=yo(()=>He(r),[r]),fe=void 0===r,be=W({data:ye,rawData:r,colorBy:p,colorScheme:y,legendInteraction:X,legendPosition:$,frameLegend:L,selection:_,linkedHover:H,fallbackFields:p?["string"==typeof p?p:""]:[],unwrapData:!1,onObservation:N,onClick:O,hoverHighlight:E,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"BubbleChart",chartId:j,showLegend:ie,userMargin:n,marginDefaults:a.marginDefaults,loading:G,loadingContent:z,emptyContent:V,width:Z,height:ee,hasTitle:!!ae,axisChrome:Ge(L,{showAxes:a.showAxes,xLabel:ue,yLabel:pe})}),{domain:xe,trackPushed:ve,reset:Ae}=e({accessor:d,data:ye,isPushMode:fe}),Se=fo(e=>{ve([e]),i.current?.push(e)},[ve]),ke=fo(e=>{ve(e),i.current?.pushMany(e)},[ve]);T(o,{variant:"xy",frameRef:i,overrides:{push:Se,pushMany:ke,clear:()=>{Ae(),i.current?.clear()}}});let{brushStreamProps:Ce}=K({brush:P,onBrush:D,linkedBrush:I,xAccessor:h,yAccessor:m,defaultDimension:"xy"}),Re=yo(()=>({stroke:x,strokeWidth:b}),[x,b]),Le=yo(()=>xe??[0,1],[xe]),_e=fo(e=>at(e,d,u,Le),[d,u,Le]),Ie=yo(()=>De(h,m),[h,m]),Pe=B({colorBy:p,colorScale:be.colorScale,color:Q,fillOpacity:g,radiusFn:_e,baseStyleExtras:Re,stroke:Y,strokeWidth:J,opacity:U,styleRules:f,ruleContext:Ie,effectiveSelectionHook:be.effectiveSelectionHook,resolvedSelection:be.resolvedSelection}),Be=yo(()=>me([{label:ue||le(h),accessor:h,role:"x",format:s},{label:pe||le(m),accessor:m,role:"y",format:c},{label:le(d),accessor:d,role:"size"},...p?[{label:le(p),accessor:p,role:"color"}]:[]]),[h,m,ue,pe,d,p,s,c]);if(be.earlyReturn)return be.earlyReturn;let Fe=M({componentName:"BubbleChart",data:r,accessors:{xAccessor:h,yAccessor:m},requiredProps:{sizeBy:d}});if(Fe)return xo(ge,{componentName:"BubbleChart",message:Fe,width:Z,height:ee});let Ne=F(k),Me=Ne?[Ne,...S||[]]:S,We={chartType:"bubble",...null!=r&&{data:ye},xAccessor:h,yAccessor:m,colorAccessor:p||void 0,sizeAccessor:d,sizeRange:u,pointStyle:Pe,colorScheme:y,size:[Z,ee],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:be.margin,showAxes:a.showAxes,xLabel:ue,yLabel:pe,xFormat:s,yFormat:c,enableHover:te,showGrid:oe,...be.legendBehaviorProps,...ce({title:ae,description:re,summary:ne,accessibleTable:se,className:l,animate:t.animate,maxDevicePixelRatio:t.maxDevicePixelRatio,axisExtent:t.axisExtent,autoPlaceAnnotations:t.autoPlaceAnnotations}),...de({tooltip:v,defaultTooltipContent:Be}),...he({linkedHover:H,selection:_,onObservation:N,onClick:O,hoverHighlight:E,hoverRadius:t.hoverRadius,mobileInteraction:be.mobileInteraction,customHoverBehavior:be.customHoverBehavior,customClickBehavior:be.customClickBehavior}),...A&&{marginalGraphics:A},...w&&{pointIdAccessor:w},...Me&&Me.length>0&&{annotations:Me},...C&&{xExtent:C},...R&&{yExtent:R},...be.crosshairProps,...Ce,...L};return xo(we,{componentName:"BubbleChart",width:Z,height:ee,children:xo(q,{ref:i,...We})})});vo.displayName="BubbleChart";import*as Ao from"react";import{useMemo as wo,useCallback as So,useState as ko}from"react";import{useMemo as Co,useCallback as Ro,useRef as Lo}from"react";import*as _o from"react";import{jsx as Ho}from"react/jsx-runtime";var Io=null,Po=null;import{jsx as Bo,jsxs as Fo}from"react/jsx-runtime";te(V);var Do="__splomIdx",No={top:4,bottom:4,left:4,right:4};import{jsx as Mo,jsxs as Wo}from"react/jsx-runtime";w.displayName="ScatterplotMatrix";import{useState as To,useRef as Oo,useEffect as Eo,useMemo as jo,useCallback as Go}from"react";import*as zo from"react";import{jsx as Vo}from"react/jsx-runtime";var Xo=null,$o=null;import{jsx as Qo,jsxs as Yo}from"react/jsx-runtime";H(),k.displayName="MinimapChart";import{useMemo as qo,forwardRef as Jo,useRef as Ko}from"react";var Uo={topLeft:{label:"Low / High",color:"#E9C46A",opacity:.08},topRight:{label:"High / High",color:"#2A9D8F",opacity:.08},bottomLeft:{label:"Low / Low",color:"#E76F51",opacity:.08},bottomRight:{label:"High / Low",color:"#86BBD8",opacity:.08}};import{Fragment as Zo,jsx as ei,jsxs as ti}from"react/jsx-runtime";te(V);var oi=Jo(function(e,t){let o=Ko(null);T(t,{variant:"xy",frameRef:o});let i=Xe(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",yAccessor:h="y",xCenter:m,yCenter:d,quadrants:u,centerlineStyle:p={},showQuadrantLabels:y=!0,quadrantLabelSize:f=12,colorBy:g,colorScheme:b,styleRules:x,sizeBy:v,sizeRange:A=[3,15],pointRadius:w=5,pointOpacity:S=.8,tooltip:k,pointIdAccessor:R,annotations:L,frameProps:_={},selection:H,linkedHover:I,onObservation:P,onClick:F,hoverHighlight:D,chartId:N,loading:O,loadingContent:E,emptyContent:j,legendInteraction:G,legendPosition:z,color:V,stroke:X,strokeWidth:$,opacity:Q}=e,{width:Y,height:J,enableHover:K,showGrid:U,showLegend:Z,title:ee,description:te,summary:oe,accessibleTable:ie,xLabel:ae,yLabel:re}=i,ne=qo(()=>({topLeft:C(Uo.topLeft,u?.topLeft),topRight:C(Uo.topRight,u?.topRight),bottomLeft:C(Uo.bottomLeft,u?.bottomLeft),bottomRight:C(Uo.bottomRight,u?.bottomRight)}),[u]),se=qo(()=>He(a),[a]),ce=W({data:se,rawData:a,colorBy:g,colorScheme:b,legendInteraction:G,legendPosition:z,frameLegend:_,selection:H,linkedHover:I,fallbackFields:"string"==typeof g?[g]:[],unwrapData:!1,onObservation:P,onClick:F,hoverHighlight:D,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"QuadrantChart",chartId:N,showLegend:Z,userMargin:r,marginDefaults:i.marginDefaults,loading:O,loadingContent:E,emptyContent:j,width:Y,height:J,hasTitle:!!ee,axisChrome:Ge(_,{showAxes:i.showAxes,xLabel:ae,yLabel:re})});Ue("QuadrantChart",se,"xAccessor",c),Ue("QuadrantChart",se,"yAccessor",h);let de=qo(()=>{if(!se.length)return;let e="function"==typeof c?c:e=>+e[c],t="function"==typeof h?h:e=>+e[h],o=1/0,i=-1/0,a=1/0,r=-1/0;for(let n of se){let l=e(n),s=t(n);isFinite(l)&&(o>l&&(o=l),l>i&&(i=l)),isFinite(s)&&(a>s&&(a=s),s>r&&(r=s))}if(null!=m&&isFinite(m)&&(o>m&&(o=m),m>i&&(i=m)),null!=d&&isFinite(d)&&(a>d&&(a=d),d>r&&(r=d)),o===1/0)return;let n=.1*(i-o)||1,l=.1*(r-a)||1;return{xExtent:[o-n,i+n],yExtent:[a-l,r+l]}},[se,c,h,m,d]),ue=qo(()=>{if(!v||0===se.length)return;let e=se.map(e=>"function"==typeof v?v(e):e[v]).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0!==e.length?mt(e):void 0},[se,v]),pe=qo(()=>"function"==typeof c?c:e=>+e[c],[c]),ye=qo(()=>"function"==typeof h?h:e=>+e[h],[h]),fe=qo(()=>e=>{let t=pe(e),o=ye(e),i=null!=m?t>=m:void 0,a=null!=d?o>=d:void 0;return void 0===a||void 0===i?V||et:a&&i?ne.topRight.color:a&&!i?ne.topLeft.color:!a&&i?ne.bottomRight.color:ne.bottomLeft.color},[pe,ye,m,d,ne,V]),be=qo(()=>v?e=>at(e,v,A,ue):void 0,[v,A,ue]),xe=qo(()=>De(c,h),[c,h]),ve=B({colorBy:g,colorScale:ce.colorScale,color:V,pointRadius:w,fillOpacity:S,radiusFn:be,fallbackFill:fe,stroke:X,strokeWidth:$,opacity:Q,styleRules:x,ruleContext:xe,effectiveSelectionHook:ce.effectiveSelectionHook,resolvedSelection:ce.resolvedSelection}),Ae=qo(()=>{if(!se.length)return;let e=new Set;"string"==typeof c&&e.add(c),"string"==typeof h&&e.add(h),"string"==typeof g&&e.add(g),"string"==typeof v&&e.add(v);let t=se[0];for(let o of Object.keys(t))if(!o.startsWith("_")&&!e.has(o)&&"string"==typeof t[o])return o},[se,c,h,g,v]),Se=qo(()=>me([...Ae?[{label:Ae,accessor:Ae,role:"title"}]:[],{label:ae||le(c),accessor:c,role:"x",format:l},{label:re||le(h),accessor:h,role:"y",format:s},...g?[{label:le(g),accessor:g,role:"color"}]:[],...v?[{label:le(v),accessor:v,role:"size"}]:[]]),[Ae,c,h,ae,re,g,v,l,s]),ke=M({componentName:"QuadrantChart",data:a,accessors:{xAccessor:c,yAccessor:h}}),Ce=qo(()=>{let e={stroke:p.stroke||"#999",strokeWidth:p.strokeWidth??1,dashArray:p.strokeDasharray||[]};return[(t,o,i,a)=>{if(!i?.x||!i?.y)return;let r=a.width,n=a.height,l=null!=m?i.x(m):r/2,s=null!=d?i.y(d):n/2;if(null!=m&&!isFinite(l)||null!=d&&!isFinite(s))return;let c=Math.max(0,Math.min(r,l)),h=Math.max(0,Math.min(n,s)),u=[{config:ne.topLeft,x:0,y:0,w:c,h:h},{config:ne.topRight,x:c,y:0,w:r-c,h:h},{config:ne.bottomLeft,x:0,y:h,w:c,h:n-h},{config:ne.bottomRight,x:c,y:h,w:r-c,h:n-h}];for(let e of u)0>=e.w||0>=e.h||(t.fillStyle=e.config.color,t.globalAlpha=e.config.opacity??.08,t.fillRect(e.x,e.y,e.w,e.h));t.globalAlpha=1,t.strokeStyle=e.stroke,t.lineWidth=e.strokeWidth,e.dashArray.length>0&&t.setLineDash(e.dashArray),t.beginPath(),t.moveTo(c,0),t.lineTo(c,n),t.stroke(),t.beginPath(),t.moveTo(0,h),t.lineTo(r,h),t.stroke(),t.setLineDash([])}]},[m,d,ne,p]),Re=qo(()=>y?[...Ce,(e,t,o,i)=>{if(!o?.x||!o?.y)return;let a=i.width,r=i.height,n=null!=m?o.x(m):a/2,l=null!=d?o.y(d):r/2;if(null!=m&&!isFinite(n)||null!=d&&!isFinite(l))return;let s=dt(e,"var(--semiotic-font-family, sans-serif)")||"sans-serif";e.font=`600 ${f}px ${s}`,e.globalAlpha=.5,e.fillStyle=ne.topLeft.color,e.textAlign="left",e.textBaseline="top",e.fillText(ne.topLeft.label,8,8),e.fillStyle=ne.topRight.color,e.textAlign="right",e.textBaseline="top",e.fillText(ne.topRight.label,a-8,8),e.fillStyle=ne.bottomLeft.color,e.textAlign="left",e.textBaseline="bottom",e.fillText(ne.bottomLeft.label,8,r-8),e.fillStyle=ne.bottomRight.color,e.textAlign="right",e.textBaseline="bottom",e.fillText(ne.bottomRight.label,a-8,r-8),e.globalAlpha=1}]:Ce,[Ce,y,f,ne,m,d]),Le=qo(()=>{let e=_.canvasPreRenderers||[];return[...Re,...e]},[Re,_.canvasPreRenderers]),_e=qo(()=>{let e={stroke:p.stroke||"#999",strokeWidth:p.strokeWidth??1,dashArray:p.strokeDasharray?Array.isArray(p.strokeDasharray)?p.strokeDasharray.join(","):p.strokeDasharray:void 0};return[(t,o,i)=>{if(!o?.x||!o?.y)return null;let a=i.width,r=i.height,n=null!=m?o.x(m):a/2,l=null!=d?o.y(d):r/2;if(null!=m&&!isFinite(n)||null!=d&&!isFinite(l))return null;let s=Math.max(0,Math.min(a,n)),c=Math.max(0,Math.min(r,l));return ti(Zo,{children:[[{config:ne.topLeft,x:0,y:0,w:s,h:c},{config:ne.topRight,x:s,y:0,w:a-s,h:c},{config:ne.bottomLeft,x:0,y:c,w:s,h:r-c},{config:ne.bottomRight,x:s,y:c,w:a-s,h:r-c}].map((e,t)=>e.w>0&&e.h>0?ei("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:e.config.color,opacity:e.config.opacity??.08},"qf-"+t):null),ei("line",{x1:s,y1:0,x2:s,y2:r,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.dashArray}),ei("line",{x1:0,y1:c,x2:a,y2:c,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.dashArray}),y&&ti(Zo,{children:[ei("text",{x:8,y:8+f,fill:ne.topLeft.color,fontWeight:600,fontSize:f,opacity:.5,children:ne.topLeft.label}),ei("text",{x:a-8,y:8+f,fill:ne.topRight.color,fontWeight:600,fontSize:f,opacity:.5,textAnchor:"end",children:ne.topRight.label}),ei("text",{x:8,y:r-8,fill:ne.bottomLeft.color,fontWeight:600,fontSize:f,opacity:.5,children:ne.bottomLeft.label}),ei("text",{x:a-8,y:r-8,fill:ne.bottomRight.color,fontWeight:600,fontSize:f,opacity:.5,textAnchor:"end",children:ne.bottomRight.label})]})]})}]},[m,d,ne,p,y,f]);if(ce.earlyReturn)return ce.earlyReturn;let Ie={chartType:"scatter",...null!=a&&{data:se},xAccessor:c,yAccessor:h,colorAccessor:g||void 0,sizeAccessor:v||void 0,sizeRange:A,pointStyle:ve,colorScheme:b,size:[Y,J],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:ce.margin,showAxes:i.showAxes,xLabel:ae,yLabel:re,xFormat:l,yFormat:s,enableHover:K,showGrid:U,...de&&{xExtent:de.xExtent,yExtent:de.yExtent},...ce.legendBehaviorProps,...ee&&{title:ee},...te&&{description:te},...oe&&{summary:oe},...void 0!==ie&&{accessibleTable:ie},...n&&{className:n},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:!1===k?()=>null:!0===k||void 0===k?Se:Ne(k)||Se,...he({linkedHover:I,selection:H,onObservation:P,onClick:F,hoverHighlight:D,hoverRadius:e.hoverRadius,mobileInteraction:ce.mobileInteraction,customHoverBehavior:ce.customHoverBehavior,customClickBehavior:ce.customClickBehavior}),...R&&{pointIdAccessor:R},...L&&L.length>0&&{annotations:L},canvasPreRenderers:Le,...ce.crosshairProps,..._,...Le.length>0&&{canvasPreRenderers:Le},svgPreRenderers:_e};return ke?ei(ge,{componentName:"QuadrantChart",message:ke,width:Y,height:J}):ei(we,{componentName:"QuadrantChart",width:Y,height:J,children:ei(q,{ref:o,...Ie})})});oi.displayName="QuadrantChart";import*as ii from"react";import{useMemo as ai,useCallback as ri,forwardRef as ni,useRef as li,useImperativeHandle as si}from"react";var ci="__ma_unitized",hi="__ma_series";import{jsx as mi}from"react/jsx-runtime";te(Z);var di=ni(function(e,t){let o=li(null),i=li([]),a=li(e.series);a.current=e.series,si(t,()=>{let e=()=>(a.current??[]).filter(e=>null!=e&&"object"==typeof e);return{push:t=>{if(!o.current)return;let a=e(),r=t;for(let e=0;a.length>e&&2>e;e++){let t=a[e],n=t.extent||i.current[e];if(!n)continue;let l=("function"==typeof t.yAccessor?t.yAccessor:e=>e[t.yAccessor])(r);null==l||!isFinite(l)||o.current.push({...r,[ci]:R(l,n),[hi]:t.label||"Series "+(e+1)})}},pushMany:t=>{if(!o.current)return;let a=e(),r=[];for(let e of t)for(let t=0;a.length>t&&2>t;t++){let o=a[t],n=o.extent||i.current[t];if(!n)continue;let l=("function"==typeof o.yAccessor?o.yAccessor:e=>e[o.yAccessor])(e);null==l||!isFinite(l)||r.push({...e,[ci]:R(l,n),[hi]:o.label||"Series "+(t+1)})}o.current.pushMany(r)},remove:e=>o.current?.remove(e)??[],update:(e,t)=>o.current?.update(e,t)??[],clear:()=>o.current?.clear(),getData:()=>o.current?.getData()??[],getScales:()=>o.current?.getScales()??null}},[]);let r=Xe(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:800,height:400}),{data:n,margin:l,className:s,xFormat:c,xAccessor:h="x",series:m,colorScheme:d,curve:u="monotoneX",lineWidth:p=2,styleRules:y,tooltip:f,annotations:g,frameProps:b={},selection:x,linkedHover:v,onObservation:A,onClick:w,hoverHighlight:S,chartId:k,loading:C,loadingContent:_,emptyContent:H,legendInteraction:I,legendPosition:B,stroke:F,strokeWidth:D,opacity:N}=e,{width:T,height:O,enableHover:E,showGrid:j,showLegend:G=!0,title:z,description:V,summary:X,accessibleTable:$,xLabel:Q}=r,Y=ai(()=>He(n),[n]),J=ai(()=>He(m),[m]),K=J,U=2===J.length,Z=ai(()=>U?{...b.legendLayout,sideGutter:b.legendLayout?.sideGutter??70}:b.legendLayout,[b.legendLayout,U]);"u">typeof process&&"production"!==process.env?.NODE_ENV&&!U&&console.warn(`[MultiAxisLineChart] Expected exactly 2 series for dual-axis mode, got ${J.length}. Rendering as a standard multi-line chart.`);let ee=We(C,T,O,_),te=ee?null:Me(n,T,O,H),oe=Je(),ie=ai(()=>function(e,t,o){let i=nt(t,o,tt),a=t&&"object"==typeof t&&!Array.isArray(t)?t:null;return e.map((e,t)=>{if("string"==typeof e.color&&e.color.length>0)return e.color;let o=e.label||"Series "+(t+1),r=a?.[o];return"string"==typeof r&&r.length>0?r:i[t%i.length]})}(K,d,oe),[K,d,oe]),ae=ai(()=>J.map((e,t)=>e.label||"Series "+(t+1)),[J]),{unitizedData:re,extents:ne}=ai(()=>{if(0===Y.length){let e=J.map(e=>e.extent||null).filter(Boolean);return e.length===J.length&&(i.current=e),{unitizedData:[],extents:e.length===J.length?e:[]}}let e=J.map(e=>e.extent||function(e,t){let o=1/0,i=-1/0,a="function"==typeof t?t:e=>e[t];for(let t of e){let e=a(t);null!=e&&isFinite(e)&&(o>e&&(o=e),e>i&&(i=e))}if(!isFinite(o)||!isFinite(i))return[0,1];if(o===i){let e=0===o?1:.1*Math.abs(o);return[o-e,i+e]}return[o,i]}(Y,e.yAccessor));if(i.current=e,!U){let t=[];for(let e of Y)for(let o=0;J.length>o;o++){let i=J[o],a=("function"==typeof i.yAccessor?i.yAccessor:e=>e[i.yAccessor])(e);null!=a&&t.push({...e,[ci]:a,[hi]:ae[o]})}return{unitizedData:t,extents:e}}let t=[];for(let o of Y)for(let i=0;2>i;i++){let a=J[i],r=("function"==typeof a.yAccessor?a.yAccessor:e=>e[a.yAccessor])(o);null!=r&&t.push({...o,[ci]:R(r,e[i]),[hi]:ae[i]})}return{unitizedData:t,extents:e}},[Y,J,U,ae]),le=ai(()=>{if(!U||2>ne.length)return;let e=e=>t=>{let o=L(t,ne[e]),i=J[e]?.format;return"function"==typeof i?i(o):Number.isInteger(o)?o+"":o.toFixed(1)},t=e(0),o=e(1);return[{orient:"left",label:ae[0],tickFormat:t},{orient:"right",label:ae[1],tickFormat:o},{orient:"bottom"}]},[U,ne,J,ae]),se=ai(()=>re.length>0?re:ae.map(e=>({[hi]:e})),[re,ae]),ce=W({data:se,rawData:n,colorBy:hi,colorScheme:ie,legendInteraction:I,legendPosition:B,frameLegend:{...b,legendLayout:Z},selection:x,linkedHover:v,fallbackFields:[hi],unwrapData:!1,onObservation:A,onClick:w,hoverHighlight:S,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"MultiAxisLineChart",chartId:k,showLegend:G,legendLayout:Z,userMargin:l,marginDefaults:U?{...r.marginDefaults,left:70,right:70}:r.marginDefaults,loading:C,loadingContent:_,emptyContent:H,width:T,height:O,hasTitle:!!z,axisChrome:Ge(b,{showAxes:r.showAxes,xLabel:Q,yLabel:ae[0],yLabelRight:ae[1],axes:le})}),me=ai(()=>{let e=new Map;return ae.forEach((t,o)=>e.set(t,ie[o])),e},[ae,ie]),de=ri(e=>me.get(e[hi])||ie[0],[me,ie]),ue=ai(()=>function(e,t){let o=Fe(e),i=t.map((e,t)=>({label:e.label||"Series "+(t+1),readY:Fe(e.yAccessor)}));return(e,t)=>{let a=(e[hi]??t??"")+"",r=(i.find(e=>e.label===a)??i[0])?.readY(e);return{value:r,x:o(e),y:r,category:a||void 0}}}(h,J),[h,J]),pe=P({lineWidth:p,resolveStroke:de,stroke:F,strokeWidth:D,opacity:N,effectiveSelectionHook:ce.effectiveSelectionHook,resolvedSelection:ce.resolvedSelection,styleRules:y,ruleContext:ue}),ye=ai(()=>e=>{let t=e.data||e,o=t[hi],i=ae.indexOf(o),a=t[ci],r=U&&i>=0&&ne[i]?L(a,ne[i]):a,n=i>=0&&J[i]?.format?J[i].format:e=>Number.isInteger(e)?e+"":e.toFixed(2),l="function"==typeof h?h(t):t[h];return ii.createElement("div",{style:{padding:"6px 10px",fontFamily:"var(--semiotic-font-family, sans-serif)",fontSize:"var(--semiotic-tooltip-font-size, 13px)"}},ii.createElement("div",{style:{fontWeight:600,marginBottom:4,color:ie[i]||"inherit"}},o),ii.createElement("div",null,`${"string"==typeof h?h:"x"}: ${l}`),ii.createElement("div",null,`${o}: ${n(r)}`))},[ae,ie,ne,U,J,h]),fe=ri(e=>{let t=(Array.isArray(e.allSeries)?e.allSeries:[]).map(e=>{let t=ae.indexOf(e.group),o=U&&t>=0&&ne[t]?L(e.value,ne[t]):e.value,i=e.datum;return i&&(i={...i},delete i[ci],delete i[hi]),{...e,value:o,datum:i}}),o=e.data&&"object"==typeof e.data&&!Array.isArray(e.data)?{...e.data}:e.data;o&&"object"==typeof o&&!Array.isArray(o)&&(delete o[ci],delete o[hi]);let i={...e,data:o,allSeries:t};return delete i[ci],delete i[hi],i},[ne,U,ae]),be=ai(()=>Ae(),[]),xe=ri(e=>be(fe(e)),[be,fe]),ve=ai(()=>Be(f)&&"function"==typeof f.content?{mode:"multi",content:e=>f.content(fe(e))}:f,[fe,f]),Se=ai(()=>Ee({tooltip:ve,defaultTooltipContent:ye,multiDefaultContent:xe}),[ye,xe,ve]);if(ce.earlyReturn)return ce.earlyReturn;let ke=M({componentName:"MultiAxisLineChart",data:n,accessors:{xAccessor:h}}),Ce=U?[0,1]:void 0,Re={chartType:"line",...null!=n&&{data:re},xAccessor:h,yAccessor:ci,groupAccessor:hi,lineStyle:pe,colorScheme:ie,size:[T,O],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:ce.margin,showAxes:r.showAxes,...le&&{axes:le},xLabel:Q,...U?{}:{yLabel:ae[0]},xFormat:c,...U&&Ce&&{yExtent:Ce},enableHover:E,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:j,curve:u,...ce.legendBehaviorProps,...z&&{title:z},...V&&{description:V},...X&&{summary:X},...void 0!==$&&{accessibleTable:$},...s&&{className:s},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...Se,...g&&{annotations:g},...he({linkedHover:v,selection:x,onObservation:A,onClick:w,hoverHighlight:S,hoverRadius:e.hoverRadius,mobileInteraction:ce.mobileInteraction,customHoverBehavior:ce.customHoverBehavior,customClickBehavior:ce.customClickBehavior}),...ce.crosshairProps,...b,...Z&&{legendLayout:Z}};return ee||te||(ke?mi(ge,{componentName:"MultiAxisLineChart",message:ke,width:T,height:O}):mi(we,{componentName:"MultiAxisLineChart",width:T,height:O,children:mi(q,{ref:o,...Re})}))});di.displayName="MultiAxisLineChart";import{useMemo as ui,forwardRef as pi,useRef as yi}from"react";import{jsx as fi}from"react/jsx-runtime";te(G);var gi=pi(function(e,t){let o=yi(null);T(t,{variant:"xy",frameRef:o});let i=Xe(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",highAccessor:h="high",lowAccessor:m="low",openAccessor:d,closeAccessor:u,candlestickStyle:p,styleRules:y,tooltip:f,annotations:g,xExtent:b,yExtent:x,frameProps:v={},selection:A,linkedHover:w,onObservation:S,onClick:k,chartId:C,loading:R,loadingContent:L,emptyContent:_}=e,{width:H,height:I,enableHover:P,showGrid:B,title:F,description:N,summary:W,accessibleTable:E,xLabel:j,yLabel:G}=i,z=We(R,H,I,L),V=z?null:Me(a,H,I,_),X=ui(()=>He(a),[a]),$=null==d||null==u;Ue("CandlestickChart",X,"xAccessor",c),Ue("CandlestickChart",X,"highAccessor",h),Ue("CandlestickChart",X,"lowAccessor",m),$||(Ue("CandlestickChart",X,"openAccessor",d),Ue("CandlestickChart",X,"closeAccessor",u));let{activeSelectionHook:Q,customHoverBehavior:Y,customClickBehavior:J,crosshairSourceId:K}=$e({selection:A,linkedHover:w,onObservation:S,onClick:k,chartType:"CandlestickChart",chartId:C,mobileInteraction:i.mobileInteraction}),U=O(A),Z=ui(()=>De(c,$?h:u),[c,h,u,$]),ee=ui(()=>Ze(Le(void 0,y,Z),Q,U),[y,Z,Q,U]),te=Ie(w,K),oe=ui(()=>{let e=i.marginDefaults,t="sparkline"===i.mode?{...e,top:0,bottom:0}:e;return null==r?t:{...t,...D(r)}},[r,i.marginDefaults,i.mode]),ie=ui(()=>{let e=[{label:j||le(c),accessor:c,role:"x",format:l}];return $?(e.push({label:"High",accessor:h,role:"y",format:s}),e.push({label:"Low",accessor:m,format:s})):(e.push({label:"Open",accessor:d,format:s}),e.push({label:"High",accessor:h,format:s}),e.push({label:"Low",accessor:m,format:s}),e.push({label:"Close",accessor:u,format:s})),me(e)},[c,j,l,s,h,m,d,u,$]),ae=M({componentName:"CandlestickChart",data:a,accessors:{xAccessor:c,highAccessor:h,lowAccessor:m,...!$&&{openAccessor:d,closeAccessor:u}}}),re=Math.max(2,Math.min(12,Math.round(H/40))),ne=H>200?.1:.02,se={chartType:"candlestick",...null!=a&&{data:X},xAccessor:c,yAccessor:h,highAccessor:h,lowAccessor:m,...!$&&{openAccessor:d,closeAccessor:u},...p&&{candlestickStyle:p},...(Q||y?.length)&&{pointStyle:ee},scalePadding:re,extentPadding:ne,size:[H,I],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:oe,showAxes:i.showAxes,xLabel:j,yLabel:G,xFormat:l,yFormat:s,enableHover:P,showGrid:B,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...ce({title:F,description:N,summary:W,accessibleTable:E,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...de({tooltip:f,defaultTooltipContent:ie}),...he({linkedHover:w,selection:A,onObservation:S,onClick:k,hoverRadius:e.hoverRadius,mobileInteraction:i.mobileInteraction,customHoverBehavior:Y,customClickBehavior:J}),...g&&g.length>0&&{annotations:g},...b&&{xExtent:b},...x&&{yExtent:x},...te,...v};return z||V||(ae?fi(ge,{componentName:"CandlestickChart",message:ae,width:H,height:I}):fi(we,{componentName:"CandlestickChart",width:H,height:I,children:fi(q,{ref:o,...se})}))});gi.displayName="CandlestickChart";import{useMemo as bi,forwardRef as xi,useRef as vi}from"react";import{jsx as Ai}from"react/jsx-runtime";te($);var wi=xi(function(e,t){let o=vi(null);T(t,{variant:"xy",frameRef:o});let i=Xe(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",yAccessor:h="y",pointIdAccessor:m,xScaleType:d,positiveColor:u,negativeColor:p,connectorStroke:y,connectorWidth:f,gap:g,styleRules:b,tooltip:x,annotations:v,xExtent:A,yExtent:w,frameProps:S={},selection:k,linkedHover:C,onObservation:R,onClick:L,hoverHighlight:_,chartId:H,loading:I,loadingContent:P,emptyContent:B,legendInteraction:F,legendPosition:D}=e,{areaStyle:N,...O}=S,{width:E,height:j,enableHover:G,showGrid:z,showLegend:V,title:X,description:$,summary:Q,accessibleTable:Y,xLabel:J,yLabel:K}=i,U=bi(()=>He(a),[a]),Z=vi({next:0,indexOf:new WeakMap,idOf:new Map,labels:new Map}),{plotData:ee,plotXAccessor:te,plotXFormat:oe,usesIndex:ie}=bi(()=>{let e="function"==typeof c?c:e=>e[c],t=m?"function"==typeof m?m:e=>e[m]:void 0,o=e=>"number"==typeof e&&Number.isFinite(e)||e instanceof Date,i=(e,t)=>{let o=e??t;return l?l(o):o+""};if(null!=a&&!U.some((t,i)=>!o(e(t,i))))return{plotData:U,plotXAccessor:c,plotXFormat:l,usesIndex:!1};if(null!=a){let t=U.map((t,o)=>e(t,o));return{plotData:U.map((e,t)=>({...e,__waterfallX:t})),plotXAccessor:"__waterfallX",plotXFormat:e=>i(t[Number(e)],e),usesIndex:!0}}let r=Z.current,n=(e,t,o,i)=>{e&&"object"==typeof e&&(r.indexOf.set(e,t),!Object.isFrozen(e)&&!Object.isSealed(e)&&(e.__waterfallX=t)),o&&r.idOf.set(o,t),r.labels.set(t,i)};return{plotData:U,plotXAccessor:(i,a)=>{let l=e(i,a);if(o(l))return l;let s=t?(t(i,a)??"")+"":"",c=i&&"object"==typeof i?i.__waterfallX:void 0,h="number"==typeof c&&Number.isFinite(c)?c:(i&&"object"==typeof i?r.indexOf.get(i):void 0)??(s?r.idOf.get(s):void 0);if("number"==typeof h)return n(i,h,s,l),h;let m="number"==typeof a?a:r.next;return r.next=Math.max(r.next,m+1),n(i,m,s,l),m},plotXFormat:e=>i(r.labels.get(Number(e)),e),usesIndex:!0}},[a,U,c,l,m]),ae=bi(()=>{if(ie&&null!=a)return[{orient:"bottom",tickValues:ee.map((e,t)=>t)}]},[a,ee,ie]),re=W({data:ee,rawData:a,colorBy:void 0,colorScheme:void 0,legendInteraction:F,legendPosition:D,frameLegend:S,selection:k,linkedHover:C,fallbackFields:["string"==typeof c?c:"x"],unwrapData:!1,onObservation:R,onClick:L,hoverHighlight:_,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"WaterfallChart",chartId:H,showLegend:V,userMargin:r,marginDefaults:i.marginDefaults,loading:I,loadingContent:P,emptyContent:B,width:E,height:j,hasTitle:!!X,axisChrome:Ge(S,{showAxes:i.showAxes,xLabel:J,yLabel:K,axes:S.axes??ae})}),ne=bi(()=>({positiveColor:u,negativeColor:p,connectorStroke:y,connectorWidth:f,gap:g,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity}),[u,p,y,f,g,e.stroke,e.strokeWidth,e.opacity]),se=bi(()=>De(c,h),[c,h]),ue=bi(()=>Le(void 0,b,se),[b,se]),pe=bi(()=>Ze(e=>{let t=ue(e);if(!N)return t;let o="function"==typeof N?N(e):N;return o?{...t,...o}:t},re.effectiveSelectionHook,re.resolvedSelection),[ue,N,re.effectiveSelectionHook,re.resolvedSelection]),ye=bi(()=>me([{label:J||le(c),accessor:c,role:"x",format:l},{label:K||"Change",accessor:h,role:"y",format:s}]),[c,h,J,K,l,s]);if(re.earlyReturn)return re.earlyReturn;let fe=M({componentName:"WaterfallChart",data:a,accessors:{xAccessor:c,yAccessor:h}});if(fe)return Ai(ge,{componentName:"WaterfallChart",message:fe,width:E,height:j});let be={chartType:"waterfall",...null!=a&&{data:ee},xAccessor:te,yAccessor:h,xScaleType:null!=a&&ie?"linear":d,waterfallStyle:ne,areaStyle:pe,size:[E,j],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:re.margin,showAxes:i.showAxes,xLabel:J,yLabel:K,xFormat:oe,yFormat:s,enableHover:G,showGrid:z,...ae&&{axes:ae},...re.legendBehaviorProps,...ce({title:X,description:$,summary:Q,accessibleTable:Y,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...de({tooltip:x,defaultTooltipContent:ye}),...he({linkedHover:C,selection:k,onObservation:R,onClick:L,hoverHighlight:_,hoverRadius:e.hoverRadius,mobileInteraction:re.mobileInteraction,customHoverBehavior:re.customHoverBehavior,customClickBehavior:re.customClickBehavior}),...m&&{pointIdAccessor:m},...v&&v.length>0&&{annotations:v},...A&&{xExtent:A},...w&&{yExtent:w},...O};return Ai(we,{componentName:"WaterfallChart",width:E,height:j,children:Ai(q,{ref:o,...be})})});wi.displayName="WaterfallChart";export{wt as Scatterplot,_t as ConnectedScatterplot,Bt as XYCustomChart,o as bumpXIdentity,a as rankBumpData,jt as BumpChart,Qt as AreaChart,oo as DifferenceChart,lo as StackedAreaChart,po as Heatmap,vo as BubbleChart,w as ScatterplotMatrix,k as MinimapChart,Uo as DEFAULT_QUADRANTS,oi as QuadrantChart,di as MultiAxisLineChart,gi as CandlestickChart,wi as WaterfallChart};
@@ -0,0 +1 @@
1
+ function e(e,t,r,o){let n=t.uncertaintyOpacity,l=t.confidenceAccessor;if(!n&&!l)return;let a="object"==typeof n?n:{},i=a.min??.15,s=a.max??1;if(l){let t="function"==typeof l?l:e=>e[l];for(let r of e){let e=t(r);null!=e&&Number.isFinite(e)&&(r[h]=i+Math.max(0,Math.min(1,e))*(s-i))}return}let f=e.map(e=>{let t=r(e),n=o(e);return null!=t&&null!=n&&Number.isFinite(t)&&Number.isFinite(n)?Math.abs(t-n):NaN}),p=f.filter(e=>Number.isFinite(e));if(0===p.length)return;let[c,y]=u(p),d=y-c;e.forEach((e,t)=>{let r=f[t];Number.isFinite(r)&&(e[h]=s-(d>0?(r-c)/d:0)*(s-i))})}function t(e,t){return"function"==typeof t?t(e):!!e[t]}function r(e){return[{type:"anomaly-band",threshold:e.threshold??2,showBand:!1!==e.showBand,fill:e.bandColor||"#6366f1",fillOpacity:e.bandOpacity??.1,anomalyColor:e.anomalyColor||"#ef4444",anomalyRadius:e.anomalyRadius??6,label:e.label}]}function o(r,o,n,l,a){return(u=l).isTraining||u.isForecast||u.isAnomaly||u.upperBounds||u.lowerBounds?function(r,o,n,l,a){let{isTraining:i,isForecast:s,isAnomaly:f,upperBounds:p,lowerBounds:u,color:h="#6366f1",bandOpacity:y=.15,anomalyColor:d="#ef4444",anomalyRadius:m=6,label:b}=l,g=r.map(e=>{let r="observed";return s&&t(e,s)?r="forecast":i&&t(e,i)&&(r="training"),{...e,[c]:r}}),_=l._groupBy,k=[];if(_){let e=new Map;for(let t of g){let r=t[_]??"__default";e.has(r)||e.set(r,[]),e.get(r).push(t)}let t=[];for(let[,r]of e)for(let e=0;r.length-1>e;e++)r[e][c]!==r[e+1][c]&&(t.push({...r[e+1],[c]:r[e][c]}),t.push({...r[e],[c]:r[e+1][c]}));k.push(...g,...t)}else for(let e=0;g.length>e;e++)k.push(g[e]),g.length-1>e&&g[e][c]!==g[e+1][c]&&(k.push({...g[e+1],[c]:g[e][c]}),k.push({...g[e],[c]:g[e+1][c]}));if(l.trainUnderline){let e=[];for(let t of k)"training"===t[c]&&e.push({...t,[c]:"training-base"});k.unshift(...e)}let O=[];if(p&&u){let e="string"==typeof p?p:"__envUpper",t="string"==typeof u?u:"__envLower";if("function"==typeof p||"function"==typeof u)for(let r of k)"function"==typeof p&&(r[e]=p(r)),"function"==typeof u&&(r[t]=u(r));O.push({type:"envelope",upperAccessor:e,lowerAccessor:t,fill:h,fillOpacity:y,label:b})}if(l.uncertaintyOpacity||l.confidenceAccessor){let t=p?"function"==typeof p?p:e=>e[p]:()=>{},r=u?"function"==typeof u?u:e=>e[u]:()=>{};e(k.filter(e=>"forecast"===e[c]),l,t,r)}if(f){let e=l.anomalyStyle,r={type:"highlight",filter:e=>t(e,f)};e?(r.style=e,r.r=m):"function"==typeof d?(r.style=e=>{let t=d(e);return{stroke:t,strokeWidth:1.5,fill:t,fillOpacity:.7}},r.r=m):(r.color=d,r.r=m,r.style={stroke:d,strokeWidth:1.5,fill:d,fillOpacity:.7}),O.push(r)}return a&&O.push({type:"anomaly-band",threshold:a.threshold??2,showBand:!1!==a.showBand,fill:a.bandColor||"#6366f1",fillOpacity:a.bandOpacity??.1,anomalyColor:a.anomalyColor||"#ef4444",anomalyRadius:a.anomalyRadius??6,label:a.label}),{processedData:k,annotations:O}}(r,0,0,l,a):function(t,r,o,n,l){let{trainEnd:a,steps:u=10,confidence:h=.95,color:y="#6366f1",bandOpacity:d=.15,label:m}=n;if(null==a)return{processedData:t,annotations:[]};let b=[],g=[];for(let e of t)e[r]>a?g.push({...e,[c]:"observed"}):b.push({...e,[c]:"training"});let _=b.map(e=>[e[r],e[o]]).filter(e=>null!=e[0]&&null!=e[1]&&isFinite(e[0])&&isFinite(e[1])).sort((e,t)=>e[0]-t[0]),k=[],O=[];if(_.length>=3){let l=_.length,a=s(_);if(a){let{se:s,meanX:b,ssX:g}=f(_,a),w=i(h),A=t.map(e=>e[r]).filter(e=>null!=e&&isFinite(e)),B=p(A),F=_.length>1?(_[l-1][0]-_[0][0])/(l-1):1;for(let e=1;u>=e;e++){let t=B+e*F,n=a(t),i=s*Math.sqrt(1+1/l+(g>0?(t-b)**2/g:0))*w;O.push({[r]:t,[o]:n,[c]:"forecast",__forecastUpper:n+i,__forecastLower:n-i})}e(O,n,e=>e.__forecastUpper,e=>e.__forecastLower),k.push({type:"envelope",upperAccessor:"__forecastUpper",lowerAccessor:"__forecastLower",fill:y,fillOpacity:d,label:m})}}k.push({type:"x-threshold",x:a,color:"#94a3b8",strokeWidth:1,strokeDasharray:"4,2",label:"Train / Forecast"}),l&&k.push({type:"anomaly-band",threshold:l.threshold??2,showBand:!1!==l.showBand,fill:l.bandColor||"#6366f1",fillOpacity:l.bandOpacity??.1,anomalyColor:l.anomalyColor||"#ef4444",anomalyRadius:l.anomalyRadius??6,label:l.label});let w=[];if(w.push(...b),b.length>0&&g.length>0&&w.push({...b[b.length-1],[c]:"observed"}),w.push(...g),O.length>0){let e=g.length>0?g[g.length-1]:b[b.length-1];e&&w.push({...e,[c]:"forecast"}),w.push(...O)}return{processedData:w,annotations:k}}(r,o,n,l,a);var u}function n(e,t){let r=t.trainDasharray??"8,4",o=t.forecastDasharray??"4,4",n=t.color||"#6366f1",i=t.trainOpacity,s=t.forecastOpacity,f=t.trainStroke,p=t.trainLinecap,u=t.trainUnderline;return t=>{let y=e(t),d=t[c];if("training"===d){let e=y.stroke;return"darken"===f?e=l(y.stroke||"#666",.5):f&&(e=f),{...y,stroke:e,strokeDasharray:r,...p&&{strokeLinecap:p},...null!=i&&{strokeOpacity:i}}}if("training-base"===d){let e=y.stroke||"#666";return"lighten"===u&&(e=a(e,.4)),{...y,stroke:e,strokeDasharray:void 0}}if("forecast"===d){let e=t[h]??s;return{...y,stroke:n,strokeDasharray:o,...null!=e&&{strokeOpacity:e}}}return y}}import{darkenColor as l,lightenColor as a}from"./c-ATM475SA.min.js";import{confidenceZScore as i,fitLinearForForecast as s,forecastIntervalStats as f}from"./c-ELDWAO2V.min.js";import{getMax as p,getMinMax as u}from"./c-QA3HMQJP.min.js";var c="__forecastSegment",h="__forecastOpacity";export{h as FORECAST_OPACITY_FIELD,c as SEGMENT_FIELD,r as buildAnomalyAnnotations,o as buildForecast,n as createSegmentLineStyle,l as darkenColor,a as lightenColor,e as stampForecastOpacity};
@@ -0,0 +1 @@
1
+ function e(e,t,r,i){let n=i.current,s=!0===e.lastCustomLayoutFailure?.preservedLastGoodScene,u=!s&&e.hasActivePulsesAt(t),o=!(r||s||!u&&!n)&&e.refreshPulse(t);return i.current=u,{changed:o,pending:u}}function t({customHoverBehavior:e,customClickBehavior:t,onObservation:r,chartId:i,chartType:n}){let s=!(!e&&!r),u=!(!t&&!r),o=C((t,s)=>{e?.(t,s),R({onObservation:r,datum:t?t.data||t:null,x:t?.x,y:t?.y,chartType:n,chartId:i,context:s})},[i,n,e,r]),a=C((e,s)=>{t?.(e,s),A({onObservation:r,datum:e?e.data||e:null,x:e?.x,y:e?.y,chartType:n,chartId:i,context:s})},[i,n,t,r]);return{customHoverBehavior:s?o:void 0,customClickBehavior:u?a:void 0,hasClickBehavior:u}}function r({storeRef:e,hoverRef:t,hoveredNodeRef:r,setHoverPoint:i,customHoverBehavior:n,customClickBehavior:s,scheduleRender:u,extractPoints:o,toHover:a}){let c=T(-1),l=T(null),h=T(null),f=P(f=>{if(x(f))return;let p=e.current;if(!p)return;let y,d=()=>{c.current=-1,l.current=null,t.current=null,r&&(r.current=null),i(null),n?.(null),u()};if(0===p.scene.length)return void(c.current>=0&&d());if(h.current?.version===p.version)y=h.current.graph;else{let e=o(p.scene);if(0===e.length)return void(c.current>=0&&d());y=v(e),h.current={version:p.version,graph:y}}let _=c.current;if(_>=y.flat.length&&(d(),_=-1),("Enter"===f.key||" "===f.key)&&_>=0)return f.preventDefault(),void s?.(a(y.flat[_],p),{type:"activate",inputType:"keyboard"});if(0>_){if("Escape"===f.key||!["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(f.key))return;f.preventDefault(),c.current=0;let e=y.flat[0];l.current=e;let r=a(e,p);return t.current=r,i(r),n?.(r,{type:"focus",inputType:"keyboard"}),void u()}let m=z(f.key,w(y,_),y);if(null===m)return;if(f.preventDefault(),0>m)return void d();c.current=m;let g=y.flat[m];l.current=g;let b=a(g,p);t.current=b,i(b),n?.(b,{type:"focus",inputType:"keyboard"}),u()},[s,n,o,t,r,u,i,e,a]);return{kbFocusIndexRef:c,focusedNavPointRef:l,onKeyDown:f}}function i(e){return r({...e,extractPoints:g,toHover:(e,t)=>b({...e,datum:d(e.datum,t.resolvedRibbons)})})}function n({chartType:e,oAccessor:t,rAccessor:i,...n}){return r({...n,extractPoints:m,toHover:r=>({...b(r),__oAccessor:"string"==typeof t?t:void 0,__rAccessor:"string"==typeof i?i:void 0,__chartType:e})})}function s(e){let t=e.datum;return{...t||{},...t?.properties||{},data:t,properties:t?.properties,x:e.x,y:e.y,__semioticHoverData:!0}}function u({storeRef:e,hoverRef:t,hoveredNodeRef:r,setHoverPoint:i,customHoverBehavior:n,customClickBehavior:u,scheduleRender:o}){let a=T(-1),c=T(null),l=P(l=>{if(x(l))return;let h=e.current;if(!h)return;let f=()=>{a.current=-1,c.current=null,t.current=null,r&&(r.current=null),i(null),n?.(null),o()};if(0===h.scene.length)return void(a.current>=0&&f());let p=_(h.scene);if(0===p.length)return void(a.current>=0&&f());let y=a.current;if(y>=p.length&&(f(),y=-1),("Enter"===l.key||" "===l.key)&&y>=0)return l.preventDefault(),void u?.(s(p[y]),{type:"activate",inputType:"keyboard"});let d=k(l.key,0>y?-1:y,p.length);if(null===d)return;if(l.preventDefault(),0>d)return void f();let v=0>y?0:d;a.current=v;let m=p[v];c.current=m;let g=s(m);t.current=g,i(g),n?.(g,{type:"focus",inputType:"keyboard"}),o()},[u,n,t,r,o,i,e]);return{kbFocusIndexRef:a,focusedNavPointRef:c,onKeyDown:l}}function o(e,t,r){let i=e.duration??500,n=r-t;return i>n?1-n/i:0}function a(e,t,r,i,n,s=("u">typeof performance?performance.now():Date.now())){let u=e.color??"rgba(255,255,255,0.6)",a=e.glowRadius??4,l=!1,h=n??(()=>{let e=new Map;for(let t=0;r.length>t;t++)e.set(r[t],t);return e})();for(let r of t){if("line"===r.type)continue;if("area"===r.type){let t=Array.isArray(r.datum)?r.datum:[r.datum],n=0,a=!1;for(let r of t){let t=h.get(r);if(null==t)continue;a=!0;let u=i.get(t);if(null==u)continue;let c=o(e,u,s);c>n&&(n=c)}a&&(l=c(r,n,u)||l);continue}let t=h.get(r.datum);if(null==t)continue;let n=i.get(t);l=c(r,null==n?0:o(e,n,s),u,a)||l}return l}function c(e,t,r,i){let n=!1;return t>0?(e._pulseIntensity!==t&&(e._pulseIntensity=t,n=!0),e._pulseColor!==r&&(e._pulseColor=r,n=!0),e._pulseGlowRadius!==i&&(e._pulseGlowRadius=i,n=!0),n):(0!==e._pulseIntensity&&(e._pulseIntensity=0,n=!0),void 0!==e._pulseColor&&(e._pulseColor=void 0,n=!0),void 0!==e._pulseGlowRadius&&(e._pulseGlowRadius=void 0,n=!0),n)}function l(e,t,r=("u">typeof performance?performance.now():Date.now())){if(!t||0===t.size)return!1;let i=e.duration??500,n=t.peek();return null!=n&&i>r-n}function h(e,t,r){e.capacity>=t||(e.resize(t),r&&t>r.capacity&&r.resize(t))}function f(e,t){let r=new D(e.capacity);return e.forEach(()=>r.push(t)),r}function p(e,t,r,i){let n=e.push(t);return r&&r.push(i),n}function y(e,t,r){if(!t||0===t.size)return;let i=new Set;if(e.forEach((e,t)=>{r(e)&&i.add(t)}),0===i.size)return;let n=t.toArray();t.clear();for(let e=0;n.length>e;e++)i.has(e)||t.push(n[e])}import{enrichDatumWithBand as d}from"./c-TKG2NP7G.min.js";import{buildNavGraph as v,extractGeoNavPoints as _,extractOrdinalNavPoints as m,extractXYNavPoints as g,navPointToHover as b,nextGraphIndex as z,nextIndex as k,resolvePosition as w}from"./c-ITKX3RC5.min.js";import{emitClickObservations as A,emitHoverObservations as R,isInteractiveKeyboardTarget as x}from"./c-LMGSSD2E.min.js";var D=class{constructor(e){if(this._capacity=e,this.head=0,this._size=0,1>e)throw Error("RingBuffer capacity must be at least 1");this.buffer=Array(e)}push(e){let t;return this._size===this._capacity?t=this.buffer[this.head]:this._size++,this.buffer[this.head]=e,this.head=(this.head+1)%this._capacity,t}pushMany(e){let t=[];for(let r of e){let e=this.push(r);void 0!==e&&t.push(e)}return t}get(e){if(e>=0&&this._size>e)return this.buffer[(this.head-this._size+e+this._capacity)%this._capacity]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let e=0;return{next:()=>this._size>e?{done:!1,value:this.get(e++)}:{done:!0,value:void 0}}}forEach(e){let t=(this.head-this._size+this._capacity)%this._capacity;for(let r=0;this._size>r;r++)e(this.buffer[(t+r)%this._capacity],r)}toArray(){let e=Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let r=0;this._size>r;r++)e[r]=this.buffer[(t+r)%this._capacity];return e}resize(e){if(1>e)throw Error("RingBuffer capacity must be at least 1");let t=this.toArray(),r=0,i=[];t.length>e&&(r=t.length-e,i=t.slice(0,r)),this._capacity=e,this.buffer=Array(e),this.head=0,this._size=0;for(let e=r;t.length>e;e++)this.push(t[e]);return i}update(e,t){let r=[],i=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;this._size>n;n++){let s=(i+n)%this._capacity,u=this.buffer[s];if(e(u)){let e;e="object"!=typeof u||null===u?u:Array.isArray(u)?[...u]:{...u},r.push(e),this.buffer[s]=t(u)}}return r}remove(e){let t=[],r=[];if(this.forEach(i=>{e(i)?r.push(i):t.push(i)}),0===r.length)return r;this.buffer=Array(this._capacity),this.head=0,this._size=0;for(let e of t)this.push(e);return r}clear(){this.buffer=Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}};import{useCallback as C}from"react";import{useCallback as P,useRef as T}from"react";export{D as RingBuffer,o as computePulseIntensity,a as applyPulse,c as setPulseState,l as hasActivePulses,h as ensureRingBufferCapacity,f as createTimestampBufferForData,p as pushWithTimestamp,y as compactTimestampBufferForRemoval,e as refreshIdlePulse,t as useSemanticFrameInteractions,i as useXYKeyboardNavigation,n as useOrdinalKeyboardNavigation,u as useGeoKeyboardNavigation};
@@ -0,0 +1 @@
1
+ function e(e){for(let o of Object.values(e))Object.freeze(o.suppliedBy),Object.freeze(o);return Object.freeze(e)}var o=e({"artifact.id":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.createdAt":{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"never"},"artifact.configFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.dataFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"purpose.intents":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.communicativeAct":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.stakes":{suppliedBy:["author","import"],derivable:!1,modelMayPropose:!0,humanReview:"required"},claims:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"claims.status":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},evidence:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.source":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.fingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},time:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"time.completeness":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},reception:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},form:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},contestability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"required"},accountability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"policy-dependent"},inheritance:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"}});export{o as ARTIFACT_FIELD_POLICIES};
@@ -0,0 +1 @@
1
+ function e(e,t){return e?"function"==typeof e?e:t=>t[e]:e=>e[t]}function t(e){return e?"function"==typeof e?e:t=>t[e]:e=>e.coordinates||e.data||[]}function i(e,t,i){return e?"function"==typeof e?{...i,...e(t)}:{...i,...e}:{...i}}function r(e,t){if(2>e.length)return[e];let i=.4*t,r=[],n=[e[0]];for(let t=1;e.length>t;t++){let o=e[t];Math.abs(o[0]-e[t-1][0])>i?(n.length>=2&&r.push(n),n=[o]):n.push(o)}return n.length>=2&&r.push(n),r}function n(e,t,i=24){let r=t[0]-e[0],n=t[1]-e[1],o=Math.sqrt(r*r+n*n);if(0===o)return[e,t];let a=-n/o,s=r/o,l=Math.min(.3*o,80),c=(e[0]+t[0])/2+a*l,u=(e[1]+t[1])/2+s*l,h=[];for(let r=0;i>=r;r++){let n=r/i,o=1-n;h.push([o*o*e[0]+2*o*n*c+n*n*t[0],o*o*e[1]+2*o*n*u+n*n*t[1]])}return h}function o(e,t){if(2>e.length)return e;let i=t/2+1,r=[];for(let t=0;e.length>t;t++){let n,o,a=e[t];0===t?(n=e[1][0]-a[0],o=e[1][1]-a[1]):t===e.length-1?(n=a[0]-e[t-1][0],o=a[1]-e[t-1][1]):(n=e[t+1][0]-e[t-1][0],o=e[t+1][1]-e[t-1][1]);let s=Math.sqrt(n*n+o*o)||1;r.push([a[0]+o/s*i,a[1]+-n/s*i])}return r}function a(e,t,i,r,n){let o=t[0]-e[0],a=t[1]-e[1],s=Math.sqrt(o*o+a*a);if(0===s)return[e,t];let l=a/s,c=-o/s,u=n/2+1;return[[e[0]+l*u,e[1]+c*u],[t[0]+l*u,t[1]+c*u]]}function s(e){if(null==e)return 0;if("number"==typeof e&&Number.isFinite(e)&&e>=0&&.5>e)return e;throw new RangeError(`[semiotic] fitPadding must be a finite fraction in [0, 0.5); received ${e+""}.`)}function l(e,t,i,r,n,o,a=0,s=r){if(o){let e=$(o,t,i,r,a);if(e&&!1!==e.node.interactive)return e}else{let n=null,o=1/0;for(let a of e){if("point"!==a.type||!1===a.interactive)continue;let e=a.x-t,s=a.y-i,l=Math.sqrt(e*e+s*s);X(a.r,r)>=l&&o>l&&(n=a,o=l)}if(n)return{node:n,distance:o}}let l=null,c=1/0;for(let n of e){if("glyph"!==n.type||null==n.datum)continue;let e=dt(n.glyph,n.size),o=n.x+e.centerDx-t,a=n.y+e.centerDy-i,s=Math.sqrt(o*o+a*a);X(e.radius,r)>=s&&c>s&&(l=n,c=s)}if(l)return{node:l,distance:c};for(let r=e.length-1;r>=0;r--){let o=e[r];if("geoarea"!==o.type)continue;let a=o;if(!1===a.interactive)continue;let[[s,l],[c,u]]=a.bounds;if(!(s>t||t>c||l>i||i>u)&&(a._cachedPath2D||(a._cachedPath2D=new Path2D(a.pathData)),n.isPointInPath(a._cachedPath2D,t,i)))return{node:a,distance:0}}let u=null,h=1/0;for(let r of e){if("line"!==r.type)continue;let e=r,{path:n}=e,o=Math.max((e.style.strokeWidth??2)+4,5,s),a=t-o,l=t+o,c=i-o,d=i+o;for(let r=0;n.length-1>r;r++){let s=n[r],p=n[r+1],f=s[0],m=s[1],g=p[0],y=p[1];if(a>f&&a>g||f>l&&g>l||c>m&&c>y||m>d&&y>d)continue;let v=te(t,i,f,m,g,y);o>=v&&h>v&&(u=e,h=v)}}return u?{node:u,distance:h}:null}function c(e){let{width:t,height:i,totalWidth:r,totalHeight:n,margin:o,showAxes:a,title:s,description:l,idPrefix:c,legend:u,legendHoverBehavior:h,legendClickBehavior:d,legendHighlightedCategory:p,legendIsolatedCategories:f,legendPosition:m,legendLayout:g,foregroundGraphics:y,annotations:v,onAnnotationActivate:b,onObservation:R,chartId:w,chartType:P,autoPlaceAnnotations:x,svgAnnotationRules:k,pointNodes:S,geoProjection:C}=e,L=et({onAnnotationActivate:b,onObservation:R,chartId:w,chartType:P}),A=ti([v?.length??0,new Map]),D=v?.length??0;A.current[0]!==D&&(A.current=[D,new Map]);let j=ei(()=>{if(!v||0===v.length)return null;let e=Q(v),r=C?e.map(e=>{if(!Array.isArray(e.coordinates)||2>e.coordinates.length)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:S,stickyPositionCache:A.current[1]},o=x?De({annotations:r,context:n,..."object"==typeof x?x:{}}):r;return $e(o,Be("xy",L),k,n)},[v,x,k,t,i,S,L,C]),M=a||s||l||u||y||j&&j.length>0,T=ii(),{titleId:B,descId:_,labelledBy:I}=K(c||w||T);return M?ni("svg",{role:"img","aria-labelledby":I,width:r,height:n,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[ri("title",{id:B,children:V(s,"Geographic chart")}),ri("desc",{id:_,children:Y(s,l,{familyPhrase:"geographic data visualization",fallback:"geographic data visualization"})}),ni("g",{transform:"translate("+o.left+","+o.top+")",children:[j,y]}),ri(xe,{title:s,totalWidth:r,marginTop:o.top}),Ue({legend:u,totalWidth:r,totalHeight:n,margin:o,legendPosition:m,title:s,legendLayout:g,legendHoverBehavior:h,legendClickBehavior:d,legendHighlightedCategory:p,legendIsolatedCategories:f})]}):null}function u([e,t,i]){let r=1<<i;return[e-Math.floor(e/r)*r,t,i]}function h(e,t,i,r,n){return"function"==typeof e?e(t,i,r,n):e.replace("{z}",t+"").replace("{x}",i+"").replace("{y}",r+"").replace("{r}",n>1?"@2x":"")}function d(e){return Number.isFinite(e)?Math.max(1,Math.floor(e)):256}function p(e){let t=0;for(let i=1;e.length>i;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 f(e,t){let i=0;for(let r=1;e.length>r;r++){let n=e[r][0]-e[r-1][0],o=e[r][1]-e[r-1][1],a=Math.sqrt(n*n+o*o);if(i+a>=t||r===e.length-1){let s=a>0?(t-i)/a:0,l=a>.001?a:1;return{x:e[r-1][0]+n*s,y:e[r-1][1]+o*s,nx:-o/l,ny:n/l}}i+=a}let r=e[e.length-1];return{x:r[0],y:r[1],nx:0,ny:0}}function m(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=dt(e.glyph,e.size);t.push({pointId:e.pointId,x:e.x+r.centerDx,y:e.y+r.centerDy,r:r.radius})}return t}function g({data:e}){if(!e)return null;if(e.properties)return mi("div",{className:"semiotic-tooltip",style:_e,children:mi("div",{style:{fontWeight:600},children:e.properties.name||e.properties.NAME||e.properties.id||"Feature"})});let t=null!=e.data?e.data:e;if(!t||"object"!=typeof t)return null;let i=Ve(t),r=null!=i.title?i.title+"":null;return null==r&&0===i.entries.length?null:gi("div",{className:"semiotic-tooltip",style:_e,children:[null!=r&&mi("div",{style:{fontWeight:600,marginBottom:i.entries.length?2:0},children:r}),i.entries.map(e=>gi("div",{children:[gi("span",{style:{opacity:.7},children:[e.key,": "]}),mi("span",{style:{fontWeight:600},children:U(e.value)})]},e.key))]})}function y(){if(null!==vi)return vi;if(typeof window>"u")return!1;let e="function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,t="u">typeof navigator&&"number"==typeof navigator.hardwareConcurrency&&4>=navigator.hardwareConcurrency,i="u">typeof navigator&&"number"==typeof navigator.deviceMemory&&4>=navigator.deviceMemory;return vi=e||t||i}function v(){return y()?12:30}function b(e){return"string"==typeof e?e:"object"==typeof e&&e&&"type"in e?e.type:null}function R(e){return e?e.getContext("2d"):null}function w(e){let t=e.pointer.clientX-e.canvasRect.left-e.margin.left,i=e.pointer.clientY-e.canvasRect.top-e.margin.top;if(0>t||t>e.width||0>i||i>e.height)return{kind:"outside"};e.hitCanvasRef.current||(e.hitCanvasRef.current="u">typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"));let r=R(e.hitCanvasRef.current);if(!r)return{kind:"unavailable"};let n=l(e.scene,t,i,Ne(30,e.pointer.pointerType),r,e.pointQuadtree,e.maxPointRadius,Ne(6,e.pointer.pointerType));if(!n)return{kind:"miss"};let{node:o}=n,a=o.datum,s=Array.isArray(a)?null:a?.properties?a:a?.data||a,c="point"===o.type?o.x:"geoarea"===o.type?o.centroid[0]:t,u="point"===o.type?o.y:"geoarea"===o.type?o.centroid[1]:i;return{kind:"hit",node:o,hover:{...s,...s?.properties||{},data:s,properties:s?.properties,__semioticHoverData:!0,x:c,y:u}}}function P({graphics:e,size:t,margin:i,readScales:r,tracker:n}){return wi(n.subscribe,n.getSnapshot,n.getSnapshot),Ri.createElement(Ri.Fragment,null,re(e,t,i,r()))}import{useCustomChartScaffold as x}from"./c-55BAJ333.min.js";import{useChartSetup as k}from"./c-KCRJGUHP.min.js";import{resolveNodeColor as S}from"./c-ORLEBW72.min.js";import{lineCanvasRenderer as C}from"./c-NYZ2QNAM.min.js";import{RingBuffer as L,compactTimestampBufferForRemoval as A,computePulseIntensity as D,hasActivePulses as j,pushWithTimestamp as M,refreshIdlePulse as T,setPulseState as B,useGeoKeyboardNavigation as _,useSemanticFrameInteractions as I}from"./c-BNG5ECK5.min.js";import{pointCanvasRenderer as E}from"./c-OO5QLMJC.min.js";import{needsDataCanvasPaint as N,needsInteractionCanvasPaint as F}from"./c-V4XMSLC3.min.js";import{glyphCanvasRenderer as O}from"./c-4FN7Q6VQ.min.js";import{StalenessBadge as z,attachUpdateResultStore as W,buildBaseMetadataProps as H,buildCustomBehaviorProps as G,composeOverlays as q,computeDecayOpacity as Z,filterAnnotationsByStatus as Q,findHitPointInQuadtree as $,formatVal as U,getHitRadius as X,overlayAccessibleDescription as Y,overlayAccessibleIds as K,overlayAccessibleTitle as V,paintCanvasBackground as J,paintSceneWithBackend as ee,pointToSegmentDistance as te,renderSceneWithBackend as ie,resolveFrameGraphics as re,resolveFrameLayers as ne,runCustomLayoutAttempt as oe,shouldHandleFramePointer as ae,useConfigSync as se,useLayoutSelectionSync as le,useLegendCategoryEmission as ce,useStableShallow as ue,useStalenessCheck as he,warnCustomLayoutDiagnostics as de}from"./c-ITKX3RC5.min.js";import{wrapWithCustomLayoutSelection as pe}from"./c-YDECTEUW.min.js";import{renderPathPulse as fe}from"./c-W4ZUKSEQ.min.js";import{buildResolveColor as me,resolveCustomLayoutPalette as ge}from"./c-EUBTECGM.min.js";import{AccessibleDataTable as ye,AccessibleTablePortal as ve,AriaLiveTooltip as be,CanvasFrameBackground as Re,FlippingTooltip as we,FocusRing as Pe,SVGChartTitle as xe,SafeRender as ke,SceneRevisionDiagnosticsObserver as Se,ScreenReaderSummary as Ce,SkipToTableLink as Le,UpdateResultTracker as Ae,annotationLayout as De,computeCanvasAriaLabel as je,computeEasing as Me,computeRawProgress as Te,createDefaultAnnotationRules as Be,defaultTooltipStyle as _e,filterSparseArray as Ie,getDevicePixelRatio as Ee,getPointerHitRadius as Ne,glyphNodeToSVG as Fe,isAnnotationActivationTarget as Oe,isServerEnvironment as ze,lerp as We,normalizeTooltip as He,now as Ge,observationInputType as qe,prepareCanvas as Ze,rehitCanvasMarkCursor as Qe,renderAnnotationPass as $e,renderLegendFromConfig as Ue,sceneHasAuthoredCursor as Xe,sceneMarkCursor as Ye,setCanvasMarkCursor as Ke,smartTooltipEntries as Ve,svgFill as Je,useAnnotationActivationOptions as et,useCanvasMarkCursorCleanup as tt,useFrame as it,useFrameCanvasHost as rt,useHydration as nt,useSceneRevisionDiagnostics as ot,useWasHydratingFromSSR as at,withSceneMarkCursor as st}from"./c-LMGSSD2E.min.js";import{STREAMING_PALETTE as lt}from"./c-CPV4N35K.min.js";import{resolveThemeSemanticColors as ct}from"./c-JUKIWTBJ.min.js";import{getMax as ut}from"./c-QA3HMQJP.min.js";import{coerceCanvasFill as ht,glyphHitGeometry as dt,hatchPatternDef as pt,isHatchFill as ft,resolveCSSColor as mt}from"./c-553QUDKA.min.js";import{forwardRef as gt,memo as yt,useCallback as vt,useEffect as bt,useMemo as Rt,useRef as wt,useState as Pt}from"react";import{geoPath as xt}from"d3-geo";import{quadtree as kt}from"d3-quadtree";import{geoMercator as St,geoEqualEarth as Ct,geoAlbersUsa as Lt,geoOrthographic as At,geoNaturalEarth1 as Dt,geoEquirectangular as jt}from"d3-geo";var Mt={mercator:St,equalEarth:Ct,albersUsa:Lt,orthographic:At,naturalEarth:Dt,equirectangular:jt};import{scaleLinear as Tt}from"d3-scale";var Bt=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],_t=["scene-style","data-paint","accessibility","evidence"],It=(e,t)=>({retainedData:e,invalidations:t}),Et=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Nt=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ft=["scene-geometry","data-paint","accessibility","evidence"],Ot=["scene-style","data-paint","accessibility","evidence"],zt=["overlay","accessibility","evidence"],Wt=[],Ht={xAccessor:It("rebuild",Et),yAccessor:It("rebuild",Et),lineDataAccessor:It("rebuild",Et),pointIdAccessor:It("rebuild",Ft),lineIdAccessor:It("rebuild",Ft),windowSize:It("rebuild",Et),projection:It("preserve",Nt),projectionExtent:It("preserve",Nt),fitPadding:It("preserve",Nt),lineType:It("preserve",Nt),flowStyle:It("preserve",Nt),graticule:It("preserve",Nt),projectionTransform:It("preserve",Nt),customLayout:It("preserve",Nt),layoutConfig:It("preserve",Nt),layoutMargin:It("preserve",Nt),areaStyle:It("preserve",Ot),pointStyle:It("preserve",["scene-geometry","scene-style","data-paint","accessibility","evidence"]),lineStyle:It("preserve",Ot),colorScheme:It("preserve",Ot),themeCategorical:It("preserve",Ot),themeDiverging:It("preserve",Ot),themeSemantic:It("preserve",Ot),themeSequential:It("preserve",Ot),decay:It("preserve",Ot),pulse:It("preserve",Ot),layoutSelection:It("preserve",Ot),annotations:It("preserve",zt),autoPlaceAnnotations:It("preserve",zt),clock:It("preserve",Wt),transition:It("preserve",Wt),introAnimation:It("preserve",Wt),onLayoutError:It("preserve",Wt)},Gt=It("preserve",Nt),qt=class{constructor(){this.tracker=new Ae}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}},Bt)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},_t):this.recordNoop("restyle")}recordConfig(e,t={}){let i=function(e){let t="preserve",i=new Set;for(let r of e){let e=Ht[r]??Gt;"rebuild"===e.retainedData&&(t="rebuild");for(let t of e.invalidations)i.add(t)}return{retainedData:t,invalidations:i}}(e),r=new Set(i.invalidations);return t.retainedDataChanged&&r.add("data"),this.tracker.record({kind:"config",keys:e},r)}};import{geoDistance as Zt,geoGraticule as Qt,geoInterpolate as $t}from"d3-geo";var Ut=class l{constructor(e){this.updateResults=new qt,this.scene=[],this.scales=null,this.version=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutDiagnosticsWarned=new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._customLayoutFailedThisBuild=!1,this._quadtree=null,this._maxPointRadius=0,this.projection=null,this.geoPath=null,this.baseScale=0,this.baseTranslate=[0,0],this.baseRotation=[0,0,0],this.currentZoom=1,this.cartogramLayout=null,this.areas=[],this.pointData=[],this.lineData=[],this.pointBuffer=null,this.streaming=!1,this.lastIngestTime=0,this.timestampBuffer=null,this.activeTransition=null,this.prevPositions=null,this._hasRenderedOnce=!1,this.config=function(e){return{...e,fitPadding:s(e.fitPadding)}}(e)}currentTime(){return this.config.clock?.()??Ge()}getConfiguredWindowSize(){let e=this.config.windowSize??500;if(!Number.isInteger(e)||1>e)throw 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),n=i.slice(-r.length),o=this.currentTime();this.pointBuffer=new L(e),this.timestampBuffer=new L(e),r.forEach((e,t)=>{this.pointBuffer.push(e),this.timestampBuffer.push(n[t]??o)})}this.retainNewestLines(e)}updateConfig(e){let t=function(e){return"fitPadding"in e?{...e,fitPadding:s(e.fitPadding)}:e}(e),i=this.config,r=this.getConfiguredWindowSize(),n=Object.keys(t).filter(e=>t[e]!==i[e]);this.config={...this.config,...t};let o=this.getConfiguredWindowSize(),a=this.streaming&&o!==r;a&&(this.resizeStreamingWindow(o),this.version++),"customLayout"in t&&!t.customLayout&&(this.lastCustomLayoutFailure=null),this.updateResults.recordConfig(n,{retainedDataChanged:a})}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()??[],n=i.slice(-t),o=r.slice(-n.length),a=this.currentTime();this.pointBuffer=new L(t),this.timestampBuffer=new L(t),n.forEach((e,t)=>{this.pointBuffer.push(e),this.timestampBuffer.push(o[t]??a)}),this.pointData=[],this.retainNewestLines(t),this.streaming=!0}pushPoint(e){this.pointBuffer||this.initStreaming();let t=this.currentTime();M(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)M(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 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(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 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(i(e)+"");A(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(i(t)+"")||(e.push(t),!1)),e.length>0?(this.version++,this.updateResults.recordData("remove",e.length)):this.updateResults.recordNoop("remove"),e}}clear(){this.areas=[],this.pointData=[],this.lineData=[],this.pointBuffer=null,this.timestampBuffer=null,this.streaming=!1,this.scene=[],this.scales=null,this._hasRenderedOnce=!1,this.activeTransition=null,this.prevPositions=null,this._quadtree=null,this._maxPointRadius=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._customLayoutFailedThisBuild=!1,this.version++,this.updateResults.recordData("clear")}restyleScene(e){let t=this._customRestyle;if(t){for(let i of this.scene){let r=this._baseStyles.get(i)??i.style,n=t(i,e);i.style=n?{...r,...n}:r}this.markStylePaintPending(),this.updateResults.recordRestyle(!0)}else this.updateResults.recordRestyle(!1)}computeScene(e){let{config:t}=this,i=this.projection,r=this.geoPath,n=this.scales,o=this.baseScale,a=[...this.baseTranslate],s=[...this.baseRotation],l=this.scene;this.projection=function(e){if(!e)return Ct();if("string"==typeof e){let t=Mt[e];return t?t():("production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Unknown projection "${e}", falling back to equalEarth`),Ct())}if("object"==typeof e&&"type"in e){let t=Mt[e.type],i=t?t():Ct();return e.rotate&&"rotate"in i&&i.rotate(e.rotate),e.center&&"center"in i&&i.center(e.center),i}return e}(t.projection),this.geoPath=xt(this.projection),this.fitProjection(e),this.geoPath=xt(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=o,this.baseTranslate=a,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(i){let r=this.projection,n=this.config,o=[...this.areas],a=e(n.xAccessor,"lon"),s=e(n.yAccessor,"lat"),l=this.getPoints();if(l.length>0){let e=l.map(e=>[a(e),s(e)]);o.push({type:"Feature",properties:{},geometry:{type:"MultiPoint",coordinates:e}})}let c=t(n.lineDataAccessor);for(let e of this.lineData){let t=c(e);if(t&&t.length>0){let e=t.map(e=>[a(e),s(e)]);o.push({type:"Feature",properties:{},geometry:{type:"LineString",coordinates:e}})}}if(0!==o.length){if(n.projectionExtent){let[[e,t],[o,a]]=n.projectionExtent;r.fitExtent([[0,0],[i.width,i.height]],{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[e,t],[e,a],[o,a],[o,t],[e,t]]]}})}else if(r.clipAngle&&(r.clipAngle()??0)>0){let e=n.fitPadding??0,t=Math.min(i.width,i.height);r.scale(t/2-t*e),r.translate([i.width/2,i.height/2])}else{let e=n.fitPadding??0,t=i.width*e,a=i.height*e;r.fitExtent([[t,a],[i.width-t,i.height-a]],{type:"FeatureCollection",features:o})}this.baseScale=r.scale(),this.baseTranslate=r.translate(),this.baseRotation=r.rotate?.()??[0,0,0]}}applyZoomTransform(e,t){let i=this.projection;if(!i)return;let r=this.geoPath,n=this.scales,o=i.scale(),a=[...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=xt(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(o),i.translate(a),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,o=i.scale(),a=[...i.translate()],s=this.currentZoom;i.scale(this.baseScale*e),i.translate(this.baseTranslate),this.currentZoom=e,this.geoPath=xt(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(o),i.translate(a),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,o=[...i.rotate()];i.rotate(e),this.geoPath=xt(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 a=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(i.rotate(o),this.geoPath=r,this.scales=n):(this.scene=[],this.rebuildQuadtree()):(this.scene=a,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,l.QUADTREE_THRESHOLD>=t)return void(this._quadtree=null);let i=Array(t),r=0;for(let e of this.scene)"point"===e.type&&!1!==e.interactive&&(i[r++]=e);this._quadtree=kt().x(e=>e.x).y(e=>e.y).addAll(i)}get quadtree(){return this._quadtree}get maxPointRadius(){return this._maxPointRadius}buildSceneNodes(s){this._customLayoutFailedThisBuild=!1;let{config:l}=this,c=this.projection,u=this.geoPath;if(l.customLayout&&this.scales){let e=l.layoutMargin??{top:0,right:0,bottom:0,left:0},t=ge(l.colorScheme,l.themeCategorical,lt),i={areas:this.areas.slice(),points:this.getPoints().slice(),lines:this.lineData.slice(),scales:this.scales,dimensions:{width:s.width,height:s.height,margin:e,plot:{x:0,y:0,width:s.width,height:s.height}},theme:{semantic:l.themeSemantic??{},categorical:[...t]},resolveColor:me(t,l.colorScheme),config:l.layoutConfig??{},selection:l.layoutSelection??null},r=oe({family:"geo",logLabel:"geo customLayout",revision:this.version,hasPreviousResult:null!==this.lastCustomLayoutResult,onLayoutError:l.onLayoutError,run:()=>l.customLayout(i)});if("failure"===r.kind)return this.lastCustomLayoutFailure=r.diagnostic,this._customLayoutFailedThisBuild=!0,r.preservedLastGoodScene?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,[]);let n=r.result,o=n.nodes??[];if(this.customLayoutOverlays=n.overlays??null,this.lastCustomLayoutResult=n,this.lastCustomLayoutFailure=null,this._customRestyle=n.restyle,this.hasCustomRestyle=!!n.restyle,this._baseStyles=new WeakMap,this.hasCustomRestyle){for(let e of o)this._baseStyles.set(e,e.style);this.restyleScene(l.layoutSelection??null)}return de({label:"geo customLayout",nodes:o,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),o}return this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,function({config:s,projection:l,path:c,areas:u,points:h,lines:d,layout:p}){let f=e(s.xAccessor,"lon"),m=e(s.yAccessor,"lat"),g=[],y=function(e){return{fill:e.themeSemantic?.surface||"#e0e0e0",stroke:e.themeSemantic?.border||"#999",strokeWidth:.5,fillOpacity:1}}(s),v=function(e){return{stroke:e.themeSemantic?.primary||"#4e79a7",strokeWidth:1.5,fill:"none"}}(s),b=function(e){return{fill:e.themeSemantic?.primary||"#4e79a7",r:4,fillOpacity:.8}}(s);if(s.graticule){let e=!0===s.graticule?{}:s.graticule,t=Qt();e.step&&t.step(e.step);let i=c(t())||"";i&&g.push({type:"geoarea",pathData:i,centroid:[p.width/2,p.height/2],bounds:[[0,0],[p.width,p.height]],screenArea:0,style:{fill:"none",stroke:e.stroke||"#e0e0e0",strokeWidth:e.strokeWidth??.5,strokeDasharray:e.strokeDasharray||"2,2"},datum:null,interactive:!1})}for(let e of u){let t=c(e);if(!t)continue;let r=c.centroid(e),n=c.bounds(e),o=c.area(e);g.push({type:"geoarea",pathData:t,centroid:r,bounds:n,screenArea:o,style:i(s.areaStyle,e,y),datum:e,interactive:!0})}let R=t(s.lineDataAccessor);for(let e of d){let t=R(e);if(!t||2>t.length)continue;let c=[];if("geo"===s.lineType){let e=Array(t.length);for(let i=0;t.length>i;i++)e[i]=[f(t[i]),m(t[i])];for(let t=0;e.length-1>t;t++){let i=e[t],r=e[t+1],n=Zt(i,r)||0,o=Math.max(2,Math.ceil(n/(Math.PI/180))),a=$t(i,r);for(let e=0;o>=e;e++){if(t>0&&0===e)continue;let i=l(a(e/o));null!=i&&c.push(i)}}}else for(let e=0;t.length>e;e++){let i=t[e],r=l([f(i),m(i)]);null!=r&&c.push(r)}if(2>c.length)continue;let u=i(s.lineStyle,e,v),h="number"==typeof u.strokeWidth?u.strokeWidth:1;2!==t.length||2>c.length||"arc"!==s.flowStyle?2===t.length&&c.length>=2&&"offset"===s.flowStyle&&(c="geo"===s.lineType?o(c,h):a(c[0],c[c.length-1],0,0,h)):c=n(c[0],c[c.length-1]);let d=r(c,p.width);if(d.length>1)for(let t of d)2>t.length||g.push({type:"line",path:t,style:{...u,_edgeFade:!0},datum:e});else g.push({type:"line",path:2>c.length&&d[0]||c,style:u,datum:e})}let w=s.pointIdAccessor?"function"==typeof s.pointIdAccessor?s.pointIdAccessor:e=>e[s.pointIdAccessor]:null,P=l.clipAngle?l.clipAngle()??0:0,x=P>0?P*Math.PI/180:null,k=l.rotate?l.rotate():[0,0,0],S="function"==typeof l.center?l.center():[0,0],C=[(S[0]??0)-k[0],(S[1]??0)-k[1]];for(let e of h){let t=f(e),i=m(e);if(null!=x&&Zt([t,i],C)>x)continue;let r=l([t,i]);if(!r)continue;let n=s.pointStyle?s.pointStyle(e):{...b},o={type:"point",x:r[0],y:r[1],r:n.r||4,style:n,datum:e,pointId:w?w(e)+"":void 0};g.push(o)}return g}({config:l,projection:c,path:u,areas:this.areas,points:this.getPoints(),lines:this.lineData,layout:s})}applyCartogramTransform(e,t){let i=function(e,t,i,r){let n=e.filter(e=>"point"===e.type);if(2>n.length)return null;let o=t.strength??1,a=Number.isFinite(o)?Math.max(0,Math.min(1,o)):1,s="strip"===t.layout?"strip":"radial";if("radial"===s&&0===a)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&&l(e.datum)+""==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=ut(h,1);r>0&&"production"!==process.env.NODE_ENV&&console.warn("GeoFrame: Distance cartogram does not support area rendering. Areas will be ignored. Remove areas or set projectionTransform to null to render them.");for(let t=e.length-1;t>=0;t--){let i=e[t];"geoarea"===i.type&&i.interactive&&e.splice(t,1)}let p="strip"===s?function(e,t,i,r,n){let o=Math.max(3,Math.min(8,.35*n.height)),a=Math.max(1,n.width-2*o),s=n.height/2,l=Tt().domain([0,r]).range([0,a]);t.x=o,t.y=s;let c=[];for(let n of e){if(n===t)continue;if(!n.datum){n.x=o,n.y=s;continue}let e=Number(i(n.datum)),a=o+(isFinite(e)&&e>=0&&r>0?l(e):0);n.x=a,n.y=s,c.push({node:n,x:a})}c.sort((e,t)=>e.x-t.x);let u=Math.max(0,Math.min(n.height/2-1,6)),h=0;for(;c.length>h;){let e=h+1;for(;c.length>e&&3>Math.abs(c[e].x-c[h].x);)e++;let t=e-h;if(t>1&&u>0)for(let e=0;t>e;e++)c[h+e].node.y=s+(e-(t-1)/2)*Math.min(2.5,2*u/Math.max(1,t-1));h=e}return{cx:o,cy:s,maxCost:r,availableRadius:a,layout:"strip"}}(n,u,c,d,i):function(e,t,i,r,n,o){let a=t.x,s=t.y,l=o.width/2,c=o.height/2,u=Math.min(o.width,o.height)/2,h=Tt().domain([0,r]).range([0,u]);for(let o of e){if(o===t||!o.datum)continue;let e=o.x,u=o.y,d=Math.atan2(u-s,e-a),p=Math.hypot(e-a,u-s),f=Number(i(o.datum)),m=isFinite(f)&&f>=0?r>0?h(f):0:p,g=l+Math.cos(d)*m,y=c+Math.sin(d)*m;o.x=e+(g-e)*n,o.y=u+(y-u)*n}return t.x=a+(l-a)*n,t.y=s+(c-s)*n,{cx:t.x,cy:t.y,maxCost:r,availableRadius:u,layout:"radial"}}(n,u,c,d,a,i),f=e.filter(e=>"line"===e.type);if(f.length>0){let e=new Map;for(let t of n)null!=t.pointId&&e.set(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 o=e.get(r+""),a=e.get(n+"");if(o&&a)if("fractional"===t.lineMode&&i.path.length>2){let e=i.path[0],t=i.path[i.path.length-1],r=[o[0]-e[0],o[1]-e[1]],n=[a[0]-t[0],a[1]-t[1]],s=[0];for(let e=1;i.path.length>e;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 o=l>0?s[t]/l:t/(i.path.length-1);return[e[0]+r[0]*(1-o)+n[0]*o,e[1]+r[1]*(1-o)+n[1]*o]})}else i.path=[o,a]}}}return p}(this.scene,e,t,this.areas.length);i&&(this.cartogramLayout=i)}applyDecay(){let e=this.config.decay;if(!e||!this.pointBuffer)return;let t=this.pointBuffer.size;if(0===t)return;let i=this.scene.filter(e=>"point"===e.type);for(let r=0;i.length>r;r++){let n=Z(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)",o=t.glowRadius??4,a=!1;for(let s=0;i.length>s&&r.length>s;s++){let l=D(t,r[s],e);a=B(i[s],l,n,o)||a}return a}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(e)}hasActivePulsesAt(e){return!!this.config.pulse&&j(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}startTransition(e){let t=this.config.transition?.duration??300;if(0>=t)return;let i=new Map;for(let t of e)"point"===t.type&&t.pointId&&i.set(t.pointId,[t.x,t.y]);let r=this.scene.filter(e=>"point"===e.type),n=!1;for(let e of r)if(e.pointId){let t=i.get(e.pointId);t&&(e._targetX=e.x,e._targetY=e.y,e.x=t[0],e.y=t[1],(Math.abs(t[0]-e._targetX)>.5||Math.abs(t[1]-e._targetY)>.5)&&(n=!0))}for(let e of r)e.pointId&&!i.has(e.pointId)&&(e._targetOpacity=e.style?.opacity??e.style?.fillOpacity??1,e.style={...e.style,opacity:0},n=!0);n&&(this.activeTransition={startTime:this.currentTime(),duration:t})}cancelIntroAnimation(){this.activeTransition=null;for(let e of this.scene)"point"===e.type&&(null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity},e._targetOpacity=void 0),null!=e._targetX&&(e.x=e._targetX,e.y=e._targetY,e._targetX=void 0,e._targetY=void 0))}advanceTransition(e){if(!this.activeTransition)return!1;let t=Te(e,this.activeTransition),i=Me(t),r=this.scene.filter(e=>"point"===e.type);for(let e of r){if(null!=e._targetX&&null!=e._targetY){let t=e.y;e.x=We(e.x,e._targetX,i),e.y=We(t,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}};Ut.QUADTREE_THRESHOLD=500;var Xt=Ut;W(Xt);import{useCallback as Yt,useImperativeHandle as Kt}from"react";import{select as Vt}from"d3-selection";import{zoomIdentity as Jt}from"d3-zoom";import{useMemo as ei,useRef as ti,useId as ii}from"react";import{jsx as ri,jsxs as ni}from"react/jsx-runtime";import*as oi from"react";import{jsx as ai,jsxs as si}from"react/jsx-runtime";import{zoom as li,zoomIdentity as ci}from"d3-zoom";import{select as ui}from"d3-selection";var hi=new WeakMap,di=1,pi=class{constructor(e=256){this.cache=new Map,this.limit=d(e)}setLimit(e){this.limit=d(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)t>r.lastUsed&&(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()}},fi=class{constructor(e){this.capacity=e,this.particles=Array(e);for(let t=0;e>t;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;this.capacity>i;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;this.capacity>n;n++){let o=this.particles[n];if(!o.active)continue;let a=i[o.lineIndex];if(!a||2>a.length){o.active=!1;continue}if(o.t+=e*t,o.t>=1){o.active=!1;continue}let s=p(a),l=f(a,o.t*s),c=(r[o.lineIndex]||2)/2;o.x=l.x+l.nx*o.offset*c*2,o.y=l.y+l.ny*o.offset*c*2}}countForLine(e){let t=0;for(let i=0;this.capacity>i;i++)this.particles[i].active&&this.particles[i].lineIndex===e&&t++;return t}clear(){for(let e=0;this.capacity>e;e++)this.particles[e].active=!1}};import{jsx as mi,jsxs as gi}from"react/jsx-runtime";g.ownsChrome=!0;var yi={top:10,right:10,bottom:10,left:10},vi=null,bi={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)"};import*as Ri from"react";import{useSyncExternalStore as wi}from"react";import{jsx as Pi,jsxs as xi}from"react/jsx-runtime";var ki=yt(gt(function(e,t){let{projection:i,projectionExtent:r,fitPadding:n,projectionTransform:o,areas:a,points:s,lines:d,customLayout:p,layoutConfig:f,layoutSelection:x,onLayoutError:k,xAccessor:L,yAccessor:A,lineDataAccessor:D,pointIdAccessor:j,lineIdAccessor:M,lineType:B="geo",flowStyle:W="basic",graticule:H,zoomable:G,zoomExtent:Z,onZoom:Q,dragRotate:$,showParticles:U,particleStyle:X,tileURL:Y,tileAttribution:K,tileCacheSize:V,size:te,width:re,height:oe,responsiveWidth:de,responsiveHeight:me,margin:ge,className:xe,background:ke,maxDevicePixelRatio:Ae,windowSize:De=500,renderMode:Me,areaStyle:Te,pointStyle:Be,lineStyle:_e,colorScheme:We,enableHover:He=!0,hoverAnnotation:Ge,tooltipContent:$e,allowTooltipOverflow:Ue=!1,customClickBehavior:Ve,customHoverBehavior:et,onObservation:lt,annotationObservationCallback:ut,chartId:dt,annotations:gt,onAnnotationActivate:yt,autoPlaceAnnotations:xt,svgAnnotationRules:kt,decay:St,pulse:Ct,transition:Lt,animate:At,staleness:Dt,frameScheduler:jt,clock:Mt,random:Tt,seed:Bt,paused:_t=!1,suspendWhenHidden:It=!0,backgroundGraphics:Et,foregroundGraphics:Nt,title:Ft,legend:Ot,legendPosition:zt,legendLayout:Wt,legendHoverBehavior:Ht,legendClickBehavior:Gt,legendHighlightedCategory:qt,legendIsolatedCategories:Zt,legendCategoryAccessor:Qt,onCategoriesChange:$t,showAxes:Ut,accessibleTable:ei=!0,description:ti,summary:ii}=e,{customHoverBehavior:ri,customClickBehavior:ni,hasClickBehavior:mi}=I({customHoverBehavior:et,customClickBehavior:Ve,onObservation:lt,chartId:dt,chartType:"StreamGeoFrame"}),gi=te||[re||600,oe||400],vi=wt(!0),wi=it({sizeProp:gi,responsiveWidth:de,responsiveHeight:me,userMargin:ge,marginDefault:yi,title:Ft,legend:Ot,legendPosition:zt,legendLayout:Wt,legendMarginReserved:e.__legendMarginReservedFor===Ot,animate:At,transitionProp:Lt,frameScheduler:jt,clock:Mt,random:Tt,seed:Bt,paused:_t,suspendWhenHidden:It,themeDirtyRef:vi}),{reducedMotionRef:ki,responsiveRef:Si,size:Ci,margin:Li,adjustedWidth:Ai,adjustedHeight:Di,transition:ji,introEnabled:Mi,tableId:Ti,frameRuntime:Bi,rafRef:_i,renderFnRef:Ii,scheduleRender:Ei,currentTheme:Ni}=wi,Fi=nt(),Oi=at(),zi=Rt(()=>Array.isArray(a)?Ie(a):a,[a]),Wi=Rt(()=>Ie(s),[s]),Hi=Rt(()=>Ie(d),[d]),Gi=$??"orthographic"===b(i),qi=Rt(()=>({projection:i,projectionExtent:r,fitPadding:n,xAccessor:L,yAccessor:A,lineDataAccessor:D,lineType:B,flowStyle:W,areaStyle:Te,pointStyle:Be,lineStyle:_e,colorScheme:We,themeSemantic:ct(Ni),themeSequential:Ni?.colors?.sequential,themeDiverging:Ni?.colors?.diverging,themeCategorical:Ni?.colors?.categorical,graticule:H,projectionTransform:o,windowSize:De,clock:Bi.now,decay:St,pulse:Ct,transition:ji,introAnimation:Mi,annotations:gt,pointIdAccessor:j,lineIdAccessor:M,customLayout:p,layoutConfig:f,onLayoutError:k,layoutMargin:Li}),[i,r,n,L,A,D,B,W,Te,Be,_e,We,Ni,H,o,De,Bi.now,St,Ct,ji,Mi,gt,j,M,p,f,k,Li]),Zi=ue(qi),Qi=wt(null);Qi.current||(Qi.current=new Xt(Zi));let $i=Qi.current,Ui=wt(null),Xi=Ui.current??(Ui.current=function(e){let t=new Set,i=0,r=e;return{subscribe:e=>(t.add(e),()=>t.delete(e)),getSnapshot:()=>i,sync(e){if(e!==r){r=e,i+=1;for(let e of t)e()}}}}($i.scales)),Yi=ze||!Fi&&Oi;Yi&&(zi||s||d)&&(zi&&$i.setAreas(zi),s&&$i.setPoints(Wi),d&&$i.setLines(Hi),$i.computeScene({width:Ai,height:Di}));let{resolvedForeground:Ki,resolvedBackground:Vi,themeBackground:Ji,surfaceBackground:er}=function({tracker:e,readScales:t,...i}){let r=r=>"function"==typeof r?Ri.createElement(P,{graphics:r,size:i.size,margin:i.margin,readScales:t,tracker:e}):r;return{...ne({...i,resolveScaleAwareGraphics:!1}),resolvedForeground:r(i.foregroundGraphics),resolvedBackground:r(i.backgroundGraphics)}}({foregroundGraphics:Nt,backgroundGraphics:Et,size:Ci,margin:Li,scales:$i.scales,background:ke,themeBackgroundColor:Ni.colors.background,tracker:Xi,readScales:()=>$i.scales}),tr=wt(null),ir=wt(null),rr=wt(null);Y&&!rr.current&&(rr.current=new pi(V??256)),rr.current?.setLimit(V??256);let nr=wt(gt),or=wt(null),ar=wt(ci),sr=wt(!1),lr=wt(null),cr=vt(e=>{lr.current=e,Si&&"object"==typeof Si&&(Si.current=e)},[Si]),ur=wt(null),hr=wt(null),dr=wt(null),pr=wt(0);if(U&&!dr.current){let e=X?.maxPerLine??v();dr.current=new fi(50*e)}let fr=wt(null),mr=wt(!1),gr=wt(null),yr=wt(!1),vr=wt(!1),br=ot("StreamGeoFrame"),Rr=wt(void 0),[wr,Pr]=Pt(null),[,xr]=Pt(0),kr=wt(0),[Sr,Cr]=Pt(!1),Lr=ce(Qi,Qt,$t,e=>e.getPoints());se(Qi,Zi,vi,Ei),le(Qi,x,vi,Ei),bt(()=>{let e=Qi.current;e&&(zi&&e.setAreas(zi),s&&e.setPoints(Wi),d&&e.setLines(Hi),vi.current=!0,Ei())},[zi,s,Wi,d,Hi,Ei]),function(e,{storeRef:t,dirtyRef:i,scheduleRender:r,zoomTransformRef:n,containerRef:o,zoomBehaviorRef:a}){let s=Yt(e=>{null==e||"object"!=typeof e||(t.current?.pushPoint(e),i.current=!0,r())},[t,i,r]),l=Yt(e=>{let n=Ie(e);0!==n.length&&(t.current?.pushMany(n),i.current=!0,r())},[t,i,r]),c=Yt(e=>{null==e||"object"!=typeof e||(t.current?.pushLine(e),i.current=!0,r())},[t,i,r]),u=Yt(e=>{let n=Ie(e);0!==n.length&&(t.current?.pushManyLines(n),i.current=!0,r())},[t,i,r]),h=Yt(()=>{t.current?.clear(),i.current=!0,r()},[t,i,r]);Kt(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=o.current;e&&a.current&&Vt(e).call(a.current.transform,Jt)},getData:()=>t.current?.getPoints()??[]}),[s,l,c,u,h,r,t,i,n,o,a])}(t,{storeRef:Qi,dirtyRef:vi,scheduleRender:Ei,zoomTransformRef:ar,containerRef:lr,zoomBehaviorRef:or});let{hoverHandlerRef:Ar,onPointerMove:Dr,onPointerLeave:jr,pointerStateRef:Mr}=wi,{canvasRef:Tr,interactionCanvasRef:Br,resolutionDirtyRef:_r}=rt(wi,{hydrated:Fi,wasHydratingFromSSR:Oi,storeRef:Qi,dirtyRef:vi,cleanup:()=>rr.current?.clear(),maxDevicePixelRatio:Ae,canvasPaintDependencies:[Ai,Di,ke,Et,Me,Y,V,Ei]});bt(()=>{Ar.current=e=>{let t=Tr.current;if(!t)return;let i=Qi.current;if(!i||!i.scene.length)return void Ke(t);let r=w({pointer:e,canvasRect:t.getBoundingClientRect(),margin:Li,width:Ai,height:Di,scene:i.scene,pointQuadtree:i.quadtree,maxPointRadius:i.maxPointRadius,hitCanvasRef:ir});Ke(t,"hit"===r.kind?Ye(r.node):void 0),He&&!1!==Ge&&("hit"===r.kind?(fr.current=r.hover,gr.current=r.node,Pr(r.hover),ri?.(r.hover),Ei()):("outside"===r.kind||"miss"===r.kind&&fr.current)&&(fr.current=null,gr.current=null,Pr(null),ri?.(null),Ei()))}},[He,Ge,Ai,Di,Li,ri,Ei,Ar,Tr]),wi.hoverLeaveRef.current=()=>{Ke(Tr.current),He&&!1!==Ge&&(fr.current=null,gr.current=null,Pr(null),ri?.(null),Ei())},tt(Tr);let Ir=vt(e=>{if(Oe(e.target)||!ni)return;let t=Qi.current;if(!t||!t.scene.length)return void ni(null);let i=e.currentTarget.getBoundingClientRect(),r=e.clientX-i.left-Li.left,n=e.clientY-i.top-Li.top;if(0>r||r>Ai||0>n||n>Di)return void ni(null);ir.current||(ir.current="u">typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"));let o=R(ir.current);if(!o)return void ni(null);let a=Ne(30,Rr.current),s=Ne(6,Rr.current),c=l(t.scene,r,n,a,o,t.quadtree,t.maxPointRadius,s);if(c){let e=c.node.datum,t=Array.isArray(e)?null:e?.properties?e:e?.data||e,i=t?.properties?{...t,...t.properties}:t;return void ni({...i,data:t,properties:t?.properties,__semioticHoverData:!0,x:r,y:n,time:r,value:n},{type:"activate",inputType:qe(Rr.current)})}ni(null)},[Di,Ai,ni,Li]),{kbFocusIndexRef:Er,focusedNavPointRef:Nr,onKeyDown:Fr}=_({storeRef:Qi,hoverRef:fr,hoveredNodeRef:gr,setHoverPoint:Pr,customHoverBehavior:ri,customClickBehavior:ni,scheduleRender:Ei}),Or=vt(e=>{ae(Mr,e,He&&!1!==Ge,mr.current,Tr.current)&&(Rr.current=e.pointerType,Er.current=-1,Nr.current=null,Dr(e))},[Tr,He,Ge,Nr,Er,Dr,Mr]),zr=vt(e=>{Rr.current=e.pointerType},[]);Ii.current=()=>{if(_i.current=null,Xi.sync(Qi.current?.scales??null),!Bi.isActive)return;let e=Tr.current,t=Qi.current;if(!e||!t)return;let i=Bi.now(),r=!1,n=hr.current,o=!1;n&&(hr.current=null,t.applyRotation(n,{width:Ai,height:Di}),o=!0);let a=null!=t.activeTransition,s=t.advanceTransition(ki.current?i+1e6:i),l=!ki.current&&s,c=br.current.beforeCompute(t.getLastUpdateResult(),l),d=!1;if(vi.current&&!s){let e={width:Ai,height:Di},i=t.hasProjection(),r=Gi&&i?t.getRotation():null;t.computeScene(e);let n=ar.current,o=1!==n.k||0!==n.x||0!==n.y;Gi&&r?o?(t.setRotation(r),t.applyZoomScale(n.k,e)):t.applyRotation(r,e):o&&t.applyZoomTransform(n,e),vi.current=!1,d=!0,Lr()}Xi.sync(t.scales),br.current.afterCompute(c,d,!1);let p=Ee(Ae,Ci),f=U&&!ki.current&&!!dr.current,m=t.consumeStylePaintPending();var g;(d||o||m)&&(mr.current=Xe(t.scene),mr.current||Ke(e)),mr.current&&(a||d||o||m)&&Qe((g={canvas:e,pointer:Mr.current,store:t,margin:Li,width:Ai,height:Di,hitCanvasRef:ir,geometryMoved:a||d||o}).canvas,g.pointer,e=>{let t=w({pointer:e,canvasRect:g.canvas.getBoundingClientRect(),margin:g.margin,width:g.width,height:g.height,scene:g.store.scene,pointQuadtree:g.geometryMoved?null:g.store.quadtree,maxPointRadius:g.store.maxPointRadius,hitCanvasRef:g.hitCanvasRef});return"hit"===t.kind?Ye(t.node):void 0});let b=T(t,i,d,vr),R=N({dirtyOrRebuilt:d,transitioning:a,continuous:f,liveEncoding:b.changed,forced:o||m||_r.current});if(_r.current=!1,Y&&rr.current){let e=tr.current;if(e&&t.scales?.projection){let i=Ze(e,Ci,Li,p);i&&(i.clearRect(-Li.left,-Li.top,Ci[0],Ci[1]),i.save(),i.beginPath(),i.rect(0,0,Ai,Di),i.clip(),function(e,t){let{tileURL:i,projection:r,width:n,height:o,tileCache:a,onTileLoad:s,maxDevicePixelRatio:l}=t,c=r.scale(),d=r.translate(),p=function(e){let{size:t,scale:i,translate:r,clampX:n=!0,clampY:o=!0}=e,a=Math.max(Math.log(i)/Math.LN2-8,0),s=Math.round(a),l=1<<s,c=Math.pow(2,a-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(o?0:-1/0,Math.floor((0-h)/c)),m=Math.min(o?l:1/0,Math.ceil((t[1]-h)/c)),g=[];for(let e=f;m>e;++e)for(let t=d;p>t;++t)g.push([t,e,s]);return{tiles:g,translate:[u/c,h/c],scale:c}}({size:[n,o],scale:2*c*Math.PI,translate:d}),f=Ee(l,[n,o]),m=function(e){if("string"==typeof e)return"template:"+e;let t=e,i=hi.get(t);return null==i&&(i=di++,hi.set(t,i)),"provider:"+i}(i),g=!0;for(let t of p.tiles){let[r,n,o]=u(t),l=h(i,o,r,n,f),c=`${m}|dpr:${f}|${o}/${r}/${n}|${l}`,d=a.get(c);if(!d){let e=new Image;e.crossOrigin="anonymous";let t={img:e,loaded:!1,failed:!1,key:c,lastUsed:performance.now()};a.set(c,t),e.onload=()=>{t.loaded=!0,s?.()},e.onerror=()=>{t.loaded=!0,t.failed=!0,s?.()},e.src=l,d=t}if(!d.loaded){g=!1;continue}if(d.failed)continue;let y=p.scale;e.drawImage(d.img,(t[0]+p.translate[0])*y-.5,(t[1]+p.translate[1])*y-.5,y+1,y+1)}}(i,{tileURL:Y,projection:t.scales.projection,width:Ai,height:Di,tileCache:rr.current,maxDevicePixelRatio:Ae,onTileLoad:()=>Ei()}),i.restore())}}if(R){let n=Ze(e,Ci,Li,p);if(!n)return;n.clearRect(-Li.left,-Li.top,Ci[0],Ci[1]),Y||J(n,{background:ke,themeBackground:Ji,hasBackgroundGraphics:!!Et,x:-Li.left,y:-Li.top,width:Ci[0],height:Ci[1]}),n.save(),n.beginPath(),n.rect(0,0,Ai,Di),n.clip();let o=t.scene,a=t.scales,s={width:Ai,height:Di};if(ee({context:n,nodes:o,renderMode:Me,pixelRatio:p,paintBuiltIn:e=>{(function(e,t){let i=t.filter(e=>"geoarea"===e.type);for(let t of i){if(!t.pathData)continue;t._cachedPath2D||(t._cachedPath2D=new Path2D(t.pathData));let i=t._cachedPath2D,r=ht(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=mt(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)}fe(e,t,i),e.globalAlpha=1,e.setLineDash([])}})(n,e),C(n,e,a,s),E(n,e,a,s),O(n,e,a,s)}}),f&&dr.current){let e=dr.current,t=o.filter(e=>"line"===e.type);if(t.length>0){let o=X||{},a=.3*(o.speedMultiplier??1),s=o.maxPerLine??v(),l=o.spawnRate??(y()?.06:.15),c=o.radius??2,u=o.opacity??.7,h=i/1e3,d=pr.current>0?Math.min(h-pr.current,.1):.016;pr.current=h;let p=t.map(e=>e.path),f=t.map(e=>e.style.strokeWidth??2);for(let i=0;t.length>i;i++)Bi.random()<l&&e.countForLine(i)<s&&e.spawn(i,Bi.random);e.step(d,a,p,f),n.globalAlpha=u;for(let i=0;e.particles.length>i;i++){let r=e.particles[i];if(!r.active)continue;let a=t[r.lineIndex],s="function"==typeof o.color?o.color(a?.datum??{}):"source"!==o.color&&o.color?o.color:a?.style.stroke||"#fff";n.beginPath(),n.arc(r.x,r.y,c,0,2*Math.PI),n.fillStyle=s,n.fill()}n.globalAlpha=1,r=!0}}n.restore()}(d||a&&!s)&&e.setAttribute("aria-label",je(t.scene,"Geographic chart"));let P=gr.current,x=!(!P||"geoarea"!==P.type&&"point"!==P.type),k=F(x,yr.current),L=Br.current;if(L&&k){let e=Ze(L,Ci,Li,p);if(e){if(e.clearRect(-Li.left,-Li.top,Ci[0],Ci[1]),P&&"geoarea"===P.type){let t=new Path2D(P.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(P&&"point"===P.type){let t=P,i=("object"==typeof Ge?Ge:void 0)?.pointColor||S(P);e.beginPath(),e.arc(t.x,t.y,t.r+3,0,2*Math.PI),i?(e.save(),e.globalAlpha=.4,e.fillStyle=i,e.fill(),e.restore()):(e.fillStyle="rgba(255, 255, 255, 0.4)",e.fill()),e.strokeStyle=i||"rgba(0, 0, 0, 0.5)",e.lineWidth=2,e.stroke()}}yr.current=x}let A=gt!==nr.current;A&&(nr.current=gt),(d||A||a&&gt&&gt.length>0)&&(d||A||a&&!s||i-kr.current>=33)&&(xr(e=>e+1),kr.current=i),(l||null!=t.activeTransition||b.pending||r)&&Ei()},he(Dt,Qi,vi,Ei,Bi.now,Sr,Cr),bt(()=>{if("production"!==process.env.NODE_ENV&&Y){let e=b(i);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.`)}},[Y,i]),bt(()=>{let e=lr.current;if(!G||!e)return or.current&&e&&(ui(e).on(".zoom",null),or.current=null),void(e&&ui(e).on("mousedown.rotate",null).on("touchstart.rotate",null));let[t,i]=Z||[1,8],r={width:Ai,height:Di};if(Gi){let n=ar.current.k,o=e=>{n=Math.max(t,Math.min(i,e)),ar.current=ci.scale(n);let o=Qi.current;o&&(o.applyZoomScale(n,r),vi.current=!1,Ei(),o.scales?.projection&&Q?.({projection:o.scales.projection,zoom:o.currentZoom}))};or.current={scaleBy:(e,t)=>o(n*t),transform:(e,t)=>o(t?.k??1)};let a=e=>{e.preventDefault(),o(n*(0>e.deltaY?1.1:1/1.1))},s=e=>{let t=e.target;t&&(t.closest("button")||t.closest(".stream-geo-zoom-controls"))||(e.preventDefault(),o(1.5*n))};e.addEventListener("wheel",a,{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=Qi.current;if(!r)return;let n=r.getRotation();ur.current={x:t.clientX,y:t.clientY,rotation:[...n]},e.setPointerCapture(t.pointerId),t.preventDefault()},u=e=>{let t=ur.current;t&&(hr.current=[t.rotation[0]+(e.clientX-t.x)*l,Math.max(-90,Math.min(90,t.rotation[1]-(e.clientY-t.y)*l)),t.rotation[2]],Ei())},h=t=>{if(!ur.current)return;ur.current=null,e.releasePointerCapture(t.pointerId);let i=hr.current;if(i){hr.current=null;let e=Qi.current;e&&(e.applyRotation(i,r),Ei())}let n=Qi.current;n?.scales?.projection&&Q?.({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",a),e.removeEventListener("dblclick",s),e.removeEventListener("pointerdown",c),e.removeEventListener("pointermove",u),e.removeEventListener("pointerup",h),e.removeEventListener("pointercancel",h),or.current=null}}let n=li().scaleExtent([t,i]).extent([[0,0],[Ci[0],Ci[1]]]).translateExtent([[-1/0,-1/0],[1/0,1/0]]).on("zoom",e=>{let t=e.transform;ar.current=t,sr.current=!0;let i=Qi.current;i&&(i.applyZoomTransform(t,r),vi.current=!1,Ei())}).on("end",e=>{ar.current=e.transform,sr.current=!1;let t=Qi.current;t?.scales?.projection&&Q?.({projection:t.scales.projection,zoom:t.currentZoom})});return or.current=n,ui(e).call(n),()=>{ui(e).on(".zoom",null)}},[G,Z,Gi,Ci,Ai,Di,Li,Q,Ei]);let Wr=He&&!1!==Ge,Hr=Wr&&wr?$e?$e(wr):Pi(g,{data:wr}):null,Gr=Hr?Pi(we,{x:wr.x,y:wr.y,containerWidth:Ai,containerHeight:Di,margin:Li,className:"stream-frame-tooltip",zIndex:10,children:Hr}):null;if(Yi){let e=$i.scene;return xi("div",{ref:cr,className:"stream-geo-frame"+(xe?" "+xe:""),role:"img","aria-label":ti||("string"==typeof Ft?Ft:"Geographic chart"),style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:de?"100%":Ci[0],height:me?"100%":Ci[1]},children:[Pi(Ce,{summary:ii}),xi("svg",{xmlns:"http://www.w3.org/2000/svg",width:Ci[0],height:Ci[1],style:{position:"absolute",left:0,top:0},children:[er?Pi("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:Ci[0],height:Ci[1],fill:er}):null,Pi("g",{transform:`translate(${Li.left},${Li.top})`,children:Vi}),Pi("g",{transform:`translate(${Li.left},${Li.top})`,children:e.map((e,t)=>ie({node:e,index:t,renderMode:Me,fallback:()=>function(e,t){return st(function(e,t){switch(e.type){case"geoarea":{let i=e;if(!i.pathData)return null;let r=ft(i.style.fill)?pt(i.style.fill,`geoarea-${t}-hatch`):void 0;return si(oi.Fragment,{children:[r&&ai("defs",{children:r}),ai("path",{d:i.pathData,fill:r?`url(#geoarea-${t}-hatch)`:Je(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._decayOpacity??1})]},"geoarea-"+t)}case"point":{let i=e,r=ft(i.style.fill)?pt(i.style.fill,`geopoint-${t}-hatch`):void 0;return si(oi.Fragment,{children:[r&&ai("defs",{children:r}),ai("circle",{cx:i.x,cy:i.y,r:i.r,fill:r?`url(#geopoint-${t}-hatch)`:Je(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(2>i.path.length)return null;let r="M"+i.path.map(e=>`${e[0]},${e[1]}`).join("L");return ai("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":return Fe(e,e.x,e.y,"geo-glyph-"+(e.pointId??t));default:return null}}(e,t),e,"geo-cursor-"+t)}(e,t)}))})]}),Pi(c,{width:Ai,height:Di,totalWidth:Ci[0],totalHeight:Ci[1],margin:Li,showAxes:!1,title:Ft,description:ti,legend:Ot,legendPosition:zt,legendLayout:Wt,legendHoverBehavior:Ht,legendClickBehavior:Gt,legendHighlightedCategory:qt,legendIsolatedCategories:Zt,foregroundGraphics:q(Ki,pe(Qi.current?.customLayoutOverlays,x??null)),annotations:gt,onAnnotationActivate:yt,onObservation:ut??lt,chartId:dt,chartType:"StreamGeoFrame",autoPlaceAnnotations:xt,svgAnnotationRules:kt,pointNodes:m(e),geoProjection:Qi.current?.scales?.projectedPoint})]})}return xi("div",{ref:cr,className:"stream-geo-frame"+(xe?" "+xe:""),role:"group","aria-label":ti||("string"==typeof Ft?Ft:"Geographic chart"),tabIndex:0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:de?"100%":Ci[0],height:me?"100%":Ci[1],overflow:Ue?"visible":"hidden",...G?{touchAction:"none"}:{}},onKeyDown:Fr,children:["production"!==process.env.NODE_ENV&&Qi.current&&Pi(Se,{store:Qi.current,diagnostics:br.current}),ei&&xi(ve,{accessibleTable:ei,children:[Pi(Le,{tableId:Ti}),Pi(ye,{scene:Qi.current?.scene??[],chartType:"Geographic chart",tableId:Ti,chartTitle:"string"==typeof Ft?Ft:void 0})]}),Pi(Ce,{summary:ii}),Pi(be,{hoverPoint:wr}),xi("div",{role:"img","aria-label":ti||("string"==typeof Ft?Ft:"Geographic chart"),style:{position:"relative",width:"100%",height:"100%"},onPointerMove:Or,onPointerLeave:jr,onPointerDown:Wr||mi?zr:void 0,onClick:mi?Ir:void 0,children:[Pi(Re,{size:Ci,margin:Li,backdropFill:er??void 0,children:Vi}),Y&&Pi("canvas",{ref:tr,style:{position:"absolute",left:0,top:0,pointerEvents:"none"}}),Pi("canvas",{ref:Tr,"aria-label":je(Qi.current?.scene??[],"Geographic chart"),style:{position:"absolute",left:0,top:0}}),Pi("canvas",{ref:Br,style:{position:"absolute",left:0,top:0,pointerEvents:"none"}}),Pi(c,{width:Ai,height:Di,totalWidth:Ci[0],totalHeight:Ci[1],margin:Li,showAxes:Ut,title:Ft,description:ti,legend:Ot,legendPosition:zt,legendLayout:Wt,legendHoverBehavior:Ht,legendClickBehavior:Gt,legendHighlightedCategory:qt,legendIsolatedCategories:Zt,foregroundGraphics:q(Ki,pe(Qi.current?.customLayoutOverlays,x??null)),annotations:gt,onAnnotationActivate:yt,onObservation:ut??lt,chartId:dt,chartType:"StreamGeoFrame",autoPlaceAnnotations:xt,svgAnnotationRules:kt,pointNodes:m(Qi.current?.scene),geoProjection:Qi.current?.scales?.projectedPoint}),Dt?.showBadge&&Pi(z,{isStale:Sr,position:Dt.badgePosition}),G&&xi("div",{className:"stream-geo-zoom-controls",style:{position:"absolute",bottom:Li.bottom+8,left:Li.left+8,display:"flex",flexDirection:"column",gap:2,zIndex:2},children:[Pi("button",{type:"button","aria-label":"Zoom in",onClick:e=>{e.stopPropagation();let t=lr.current,i=or.current;t&&i?.scaleBy&&i.scaleBy(ui(t),1.5)},style:bi,children:"+"}),Pi("button",{type:"button","aria-label":"Zoom out",onClick:e=>{e.stopPropagation();let t=lr.current,i=or.current;t&&i?.scaleBy&&i.scaleBy(ui(t),1/1.5)},style:bi,children:"−"})]}),K&&Pi("div",{className:"stream-geo-tile-attribution",style:{position:"absolute",bottom:Li.bottom+2,right:Li.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}),Pi(Pe,{active:Er.current>=0,hoverPoint:wr,margin:Li,size:Ci,shape:Nr.current?.shape,width:Nr.current?.w,height:Nr.current?.h,pathData:Nr.current?.pathData}),Gr]})]})}));ki.displayName="StreamGeoFrame";var Si=ki;import{forwardRef as Ci,useMemo as Li}from"react";import{jsx as Ai}from"react/jsx-runtime";var Di=Ci(function(e,t){let{points:i,areas:r,lines:n,layout:o,layoutConfig:a,onLayoutError:s,projection:l="equirectangular",xAccessor:c="lon",yAccessor:u="lat",lineDataAccessor:h,colorBy:d,colorScheme:p,tooltip:f,annotations:m,margin:g,selection:y,linkedHover:v,onObservation:b,onClick:R,chartId:w,loading:P,loadingContent:S,emptyContent:C,className:L,frameProps:A={}}=e,{frameRef:D,resolved:j,normalizedMargin:M}=x({imperativeRef:t,imperativeVariant:"geo-points",margin:g,width:e.width,height:e.height,enableHover:e.enableHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),T=Li(()=>Ie(i),[i]),B=Li(()=>Ie(r),[r]),_=Li(()=>Ie(n),[n]),I=Li(()=>[...T,..._,...B],[T,_,B]),E=k({data:I,rawData:void 0!==i||void 0!==n||void 0!==r?I:void 0,colorBy:d,colorScheme:p,legendInteraction:void 0,selection:y,linkedHover:v,fallbackFields:"string"==typeof d?[d]:[],unwrapData:!1,onObservation:b,onClick:R,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,chartType:"GeoCustomChart",chartId:w,showLegend:!1,userMargin:M,marginDefaults:j.marginDefaults,loading:P,loadingContent:S,emptyContent:C,width:j.width,height:j.height,hasTitle:!!j.title}),N=E.effectiveSelectionHook,F=Li(()=>N?.isActive?{isActive:!0,predicate:N.predicate}:null,[N?.isActive,N?.predicate]);if(E.earlyReturn)return E.earlyReturn;let{width:O,height:z,enableHover:W,title:q,description:Z,summary:Q,accessibleTable:$}=j,U=He(f),X={projection:l,...null!=i&&{points:T},...null!=r&&{areas:B},...null!=n&&{lines:_},xAccessor:c,yAccessor:u,...null!=h&&{lineDataAccessor:h},customLayout:o,layoutConfig:a,onLayoutError:s,layoutSelection:F,colorBy:d,colorScheme:p,size:[O,z],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:E.margin,enableHover:W,...H({title:q,description:Z,summary:Q,accessibleTable:$,className:L,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,autoPlaceAnnotations:e.autoPlaceAnnotations}),...!1===f?{tooltipContent:()=>null}:U?{tooltipContent:U}:{},...G({linkedHover:v,selection:y,onObservation:b,onClick:R,hoverHighlight:!1,mobileInteraction:E.mobileInteraction,customHoverBehavior:E.customHoverBehavior,customClickBehavior:E.customClickBehavior,linkedHoverInClickPredicate:!1}),...m&&m.length>0&&{annotations:m},...A};return Ai(ke,{componentName:"GeoCustomChart",width:O,height:z,children:Ai(Si,{ref:D,...X})})});Di.displayName="GeoCustomChart";export{Si as StreamGeoFrame_default,Di as GeoCustomChart};
@@ -0,0 +1 @@
1
+ function t(t,e){let o=r(e.curve);if(!o||2>e.topPath.length||2>e.bottomPath.length){t.beginPath(),t.moveTo(e.topPath[0][0],e.topPath[0][1]);for(let o=1;e.topPath.length>o;o++)t.lineTo(e.topPath[o][0],e.topPath[o][1]);for(let o=e.bottomPath.length-1;o>=0;o--)t.lineTo(e.bottomPath[o][0],e.bottomPath[o][1]);t.closePath()}else{let l=s().x(t=>t[0]).y0((t,o)=>e.bottomPath[o][1]).y1(t=>t[1]).curve(o).context(t);t.beginPath(),l(e.topPath)}}function e(t,e){let o=r(e.curve);if(t.beginPath(),o)n().x(t=>t[0]).y(t=>t[1]).curve(o).context(t)(e.topPath);else{t.moveTo(e.topPath[0][0],e.topPath[0][1]);for(let o=1;e.topPath.length>o;o++)t.lineTo(e.topPath[o][0],e.topPath[o][1])}}import{buildThresholdLineSegments as o}from"./c-NYZ2QNAM.min.js";import{renderPathPulse as l}from"./c-W4ZUKSEQ.min.js";import{buildLinearFillGradient as a,resolveCSSColor as h,resolveCanvasFill as i,resolveCurveFactory as r}from"./c-553QUDKA.min.js";import{area as s,line as n}from"d3-shape";var p=(r,s,n,p)=>{let P=s.filter(t=>"area"===t.type);for(let s of P){if(2>s.topPath.length)continue;let n=!1;s.clipRect&&(r.save(),r.beginPath(),r.rect(s.clipRect.x,s.clipRect.y,s.clipRect.width,s.clipRect.height),r.clip(),n=!0);let P=s._introClipFraction;void 0!==P&&1>P&&(r.save(),r.beginPath(),r.rect(0,0,p.width*P,p.height),r.clip());let f=i(r,s.style.fill,"#4e79a7"),c=s._decayOpacities,g=!(!s.colorThresholds?.length||!s.rawValues||s.rawValues.length!==s.topPath.length),y=!!s.strokeColorBands?.length;if(c&&c.length===s.topPath.length&&!g&&!y){let t=s.style.fillOpacity??.7;r.fillStyle=f;for(let e=0;s.topPath.length-1>e;e++)r.globalAlpha=.5*(c[e]+c[e+1])*t,r.beginPath(),r.moveTo(s.topPath[e][0],s.topPath[e][1]),r.lineTo(s.topPath[e+1][0],s.topPath[e+1][1]),r.lineTo(s.bottomPath[e+1][0],s.bottomPath[e+1][1]),r.lineTo(s.bottomPath[e][0],s.bottomPath[e][1]),r.closePath(),r.fill();let e=s.style.strokeWidth??2;if(s.style.stroke&&"none"!==s.style.stroke&&e>0){r.strokeStyle=h(r,s.style.stroke)||s.style.stroke,r.lineWidth=e,r.setLineDash([]);for(let t=0;s.topPath.length-1>t;t++)r.globalAlpha=.5*(c[t]+c[t+1]),r.beginPath(),r.moveTo(s.topPath[t][0],s.topPath[t][1]),r.lineTo(s.topPath[t+1][0],s.topPath[t+1][1]),r.stroke()}r.globalAlpha=1;continue}let m=s.style.opacity??1;if(t(r,s),s.fillGradient&&s.fillGradient.stops.length>=2&&s.fillGradient){let t=1/0;for(let e of s.topPath)t>e[1]&&(t=e[1]);let e=-1/0;for(let t of s.bottomPath)t[1]>e&&(e=t[1]);let o=a(r,s.fillGradient,"string"==typeof f?f:"#4e79a7",0,t,0,e);r.fillStyle=o||f,r.globalAlpha=m}else r.globalAlpha=(s.style.fillOpacity??.7)*m,r.fillStyle=f;r.fill(),s._pulseIntensity&&s._pulseIntensity>0&&(t(r,s),l(r,s));let b=s.style.strokeWidth??2;if(s.style.stroke&&"none"!==s.style.stroke&&b>0){r.globalAlpha=m;let t=h(r,s.style.stroke)||s.style.stroke,l=g||y||!s.strokeGradient||2>s.topPath.length?null:a(r,s.strokeGradient,t,s.topPath[0][0],0,s.topPath[s.topPath.length-1][0],0);if(r.lineWidth=b,r.setLineDash([]),y){let o=1/0,l=-1/0;for(let[t]of s.topPath)o=Math.min(o,t),l=Math.max(l,t);let a=r.lineWidth;for(let i of s.strokeColorBands){r.save(),r.beginPath(),r.rect(o-a,i.y,l-o+2*a,i.height),r.clip();let n=i.color??t;r.strokeStyle=h(r,n)||n,r.globalAlpha=m*(i.opacity??1),e(r,s),r.stroke(),r.restore()}}else if(g){let e=o(s.topPath,s.rawValues,s.colorThresholds,t);for(let t of e){r.beginPath(),r.strokeStyle=h(r,t.color)||t.color,r.moveTo(t.path[0][0],t.path[0][1]);for(let e=1;t.path.length>e;e++)r.lineTo(t.path[e][0],t.path[e][1]);r.stroke()}}else r.strokeStyle=l||t,e(r,s),r.stroke()}void 0!==P&&1>P&&r.restore(),n&&r.restore(),r.globalAlpha=1}};export{p as areaCanvasRenderer};