semiotic 3.9.2 → 3.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (537) hide show
  1. package/README.md +97 -76
  2. package/agent-skill/semiotic-charts/SKILL.md +13 -7
  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 +3 -1
  8. package/ai/dist/mcp-server.js +68 -68
  9. package/ai/examples.md +68 -1
  10. package/ai/reference.md +105 -14
  11. package/ai/schema.json +6646 -18
  12. package/ai/surface-manifest.json +34 -6
  13. package/ai/system-prompt.md +2 -0
  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-2RL2QPZJ.min.js +1 -0
  23. package/dist/c-2WK7YJLL.min.js +1 -0
  24. package/dist/c-42PLDTX7.min.js +1 -0
  25. package/dist/c-45CQWZZ6.min.js +1 -0
  26. package/dist/c-4BRHKVKV.min.js +1 -0
  27. package/dist/c-7242NXSG.min.js +1 -0
  28. package/dist/c-7DVPSB5C.min.js +1 -0
  29. package/dist/c-7EGHJU2F.min.js +1 -0
  30. package/dist/c-A7OGOFSL.min.js +1 -0
  31. package/dist/c-AFBSWT77.min.js +1 -0
  32. package/dist/c-AH5HWZWS.min.js +1 -0
  33. package/dist/c-AJ7EC32V.min.js +1 -0
  34. package/dist/c-AQADQNY7.min.js +1 -0
  35. package/dist/c-ATM475SA.min.js +1 -0
  36. package/dist/c-AVO3Q7T7.min.js +1 -0
  37. package/dist/c-B7GW7IHJ.min.js +1 -0
  38. package/dist/c-BNFJMDHN.min.js +1 -0
  39. package/dist/c-BOHCQILI.min.js +1 -0
  40. package/dist/c-C3TZLTZK.min.js +1 -0
  41. package/dist/c-CGQAQWBV.min.js +1 -0
  42. package/dist/c-CPV4N35K.min.js +1 -0
  43. package/dist/c-D6HAAPTX.min.js +1 -0
  44. package/dist/c-DIPEYUOW.min.js +1 -0
  45. package/dist/c-E4JDJH4I.min.js +1 -0
  46. package/dist/c-E72OTUZU.min.js +1 -0
  47. package/dist/c-E7I2L7CU.min.js +1 -0
  48. package/dist/c-ELDWAO2V.min.js +1 -0
  49. package/dist/c-EUBTECGM.min.js +1 -0
  50. package/dist/c-EUMPMDCS.min.js +1 -0
  51. package/dist/c-EZZT2WAE.min.js +1 -0
  52. package/dist/c-FHBVFCQB.min.js +1 -0
  53. package/dist/c-G4HCO2IQ.min.js +1 -0
  54. package/dist/c-G5VIJEOK.min.js +1 -0
  55. package/dist/c-GHVOXAYH.min.js +1 -0
  56. package/dist/c-GNTXRXRN.min.js +1 -0
  57. package/dist/c-GXV3C3MO.min.js +1 -0
  58. package/dist/c-HHTK2R75.min.js +1 -0
  59. package/dist/c-HLLFJYTY.min.js +1 -0
  60. package/dist/c-HP4ZFM47.min.js +1 -0
  61. package/dist/c-HPOYKCCG.min.js +1 -0
  62. package/dist/c-HYDTS5OP.min.js +1 -0
  63. package/dist/c-I4QJ6YLM.min.js +1 -0
  64. package/dist/c-IK33LNZ6.min.js +1 -0
  65. package/dist/c-IK3PZHRY.min.js +1 -0
  66. package/dist/c-J6DVC236.min.js +1 -0
  67. package/dist/c-JIMJF6F6.min.js +1 -0
  68. package/dist/c-JUKIWTBJ.min.js +1 -0
  69. package/dist/c-KKPMHAZC.min.js +1 -0
  70. package/dist/c-L6WNDBHV.min.js +1 -0
  71. package/dist/c-LDEX5OFW.min.js +1 -0
  72. package/dist/c-LESEUVC5.min.js +1 -0
  73. package/dist/c-LYQMZMZQ.min.js +1 -0
  74. package/dist/c-MB6CV5NC.min.js +1 -0
  75. package/dist/c-MOKJOIPE.min.js +1 -0
  76. package/dist/c-MVR3RWF3.min.js +1 -0
  77. package/dist/c-N3FXLRNT.min.js +1 -0
  78. package/dist/c-N5NPTJVJ.min.js +1 -0
  79. package/dist/c-NHBL4J67.min.js +1 -0
  80. package/dist/c-ODG6TFSY.min.js +1 -0
  81. package/dist/c-ORLEBW72.min.js +1 -0
  82. package/dist/c-P65V6HLO.min.js +1 -0
  83. package/dist/c-PRIKOLTE.min.js +1 -0
  84. package/dist/c-PSKKFZNP.min.js +1 -0
  85. package/dist/c-PSNI6KAZ.min.js +1 -0
  86. package/dist/c-QA3HMQJP.min.js +1 -0
  87. package/dist/c-R2P4RR7Q.min.js +1 -0
  88. package/dist/c-RFC7UAG7.min.js +1 -0
  89. package/dist/c-S3AZX5PP.min.js +1 -0
  90. package/dist/c-SGAURYHG.min.js +1 -0
  91. package/dist/c-SJMWU6UX.min.js +1 -0
  92. package/dist/c-STIIGQOD.min.js +1 -0
  93. package/dist/c-T2ASIJVZ.min.js +1 -0
  94. package/dist/c-T2V7O2LO.min.js +1 -0
  95. package/dist/c-TKG2NP7G.min.js +1 -0
  96. package/dist/c-TX3THUTO.min.js +1 -0
  97. package/dist/c-TX7XJM3Z.min.js +1 -0
  98. package/dist/c-UC7SIU2W.min.js +1 -0
  99. package/dist/c-UMXSJIOV.min.js +1 -0
  100. package/dist/c-VJTDST2R.min.js +1 -0
  101. package/dist/c-VRSXMLYF.min.js +1 -0
  102. package/dist/c-VSLWSAN2.min.js +1 -0
  103. package/dist/c-VXLOLYTO.min.js +1 -0
  104. package/dist/c-W4ZUKSEQ.min.js +1 -0
  105. package/dist/c-WCBRPILW.min.js +1 -0
  106. package/dist/c-WGHT7OCY.min.js +1 -0
  107. package/dist/c-WUWXGQYA.min.js +1 -0
  108. package/dist/c-WWCW3APR.min.js +1 -0
  109. package/dist/{c-CKLIFCGN.min.js → c-XSB27XPS.min.js} +1 -1
  110. package/dist/c-Y6PYUMFU.min.js +1 -0
  111. package/dist/c-YDECTEUW.min.js +1 -0
  112. package/dist/c-YF3YKVQI.min.js +1 -0
  113. package/dist/c-YLZIV3VS.min.js +1 -0
  114. package/dist/c-ZIVPFTOC.min.js +1 -0
  115. package/dist/components/Annotation.d.ts +2 -1
  116. package/dist/components/ai/chartRecipeRegistry.d.ts +6 -1
  117. package/dist/components/ai/chartRecipes.d.ts +4 -0
  118. package/dist/components/ai/describePhysicsProjection.d.ts +18 -0
  119. package/dist/components/ai/describePhysicsSource.d.ts +13 -0
  120. package/dist/components/artifact/ArtifactInspector.d.ts +26 -0
  121. package/dist/components/artifact/ArtifactInspectorContextSections.d.ts +18 -0
  122. package/dist/components/artifact/artifactContractDiff.d.ts +8 -0
  123. package/dist/components/artifact/artifactInspectorSummary.d.ts +53 -0
  124. package/dist/components/artifact/artifactRevision.d.ts +54 -0
  125. package/dist/components/artifact/artifactTestFixtures.d.ts +17 -0
  126. package/dist/components/artifact/attachmentAudit.d.ts +13 -0
  127. package/dist/components/artifact/claimCorrections.d.ts +3 -0
  128. package/dist/components/artifact/claimGraph.d.ts +5 -0
  129. package/dist/components/artifact/claimLifecycle.d.ts +32 -0
  130. package/dist/components/artifact/claims.d.ts +24 -0
  131. package/dist/components/artifact/collection.d.ts +10 -0
  132. package/dist/components/artifact/collectionCorrectionScope.d.ts +4 -0
  133. package/dist/components/artifact/collectionImpact.d.ts +11 -0
  134. package/dist/components/artifact/collectionLineage.d.ts +3 -0
  135. package/dist/components/artifact/collectionOperations.d.ts +8 -0
  136. package/dist/components/artifact/collectionPolicy.d.ts +22 -0
  137. package/dist/components/artifact/collectionTypes.d.ts +117 -0
  138. package/dist/components/artifact/configurationRepair.d.ts +8 -0
  139. package/dist/components/artifact/contract.d.ts +30 -0
  140. package/dist/components/artifact/evaluateArtifact.d.ts +12 -0
  141. package/dist/components/artifact/evaluateArtifactTypes.d.ts +78 -0
  142. package/dist/components/artifact/evaluationPresentation.d.ts +9 -0
  143. package/dist/components/artifact/evidenceSample.d.ts +8 -0
  144. package/dist/components/artifact/exportPaths.d.ts +8 -0
  145. package/dist/components/artifact/fieldPolicies.d.ts +12 -0
  146. package/dist/components/artifact/fingerprint.d.ts +36 -0
  147. package/dist/components/artifact/grounding.d.ts +51 -0
  148. package/dist/components/artifact/groundingBudget.d.ts +38 -0
  149. package/dist/components/artifact/hostTransfer.d.ts +13 -0
  150. package/dist/components/artifact/identity.d.ts +19 -0
  151. package/dist/components/artifact/inheritance.d.ts +48 -0
  152. package/dist/components/artifact/inheritanceIntegrity.d.ts +3 -0
  153. package/dist/components/artifact/jsonCompatibility.d.ts +2 -0
  154. package/dist/components/artifact/obligations.d.ts +3 -0
  155. package/dist/components/artifact/policies.d.ts +45 -0
  156. package/dist/components/artifact/policyRelations.d.ts +3 -0
  157. package/dist/components/artifact/recordProjection.d.ts +7 -0
  158. package/dist/components/artifact/representation.d.ts +50 -0
  159. package/dist/components/artifact/serialization.d.ts +40 -0
  160. package/dist/components/artifact/temporal.d.ts +32 -0
  161. package/dist/components/artifact/temporalAdapters.d.ts +75 -0
  162. package/dist/components/artifact/temporalAuditHelpers.d.ts +12 -0
  163. package/dist/components/artifact/temporalPresentation.d.ts +8 -0
  164. package/dist/components/artifact/types.d.ts +341 -0
  165. package/dist/components/artifact/validation.d.ts +13 -0
  166. package/dist/components/artifact/validationFieldStatus.d.ts +7 -0
  167. package/dist/components/artifact/validationPrimitives.d.ts +24 -0
  168. package/dist/components/artifact/validationSurfaces.d.ts +7 -0
  169. package/dist/components/artifact/validationTemporal.d.ts +3 -0
  170. package/dist/components/charts/geo/FlowMap.d.ts +7 -0
  171. package/dist/components/charts/geo/flowMapLineStyle.d.ts +18 -0
  172. package/dist/components/charts/ordinal/DonutChart.d.ts +2 -0
  173. package/dist/components/charts/ordinal/FunnelChart.d.ts +2 -0
  174. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +6 -0
  175. package/dist/components/charts/ordinal/PieChart.d.ts +2 -0
  176. package/dist/components/charts/ordinal/RadarChart.d.ts +2 -0
  177. package/dist/components/charts/ordinal/StackedBarChart.d.ts +6 -0
  178. package/dist/components/charts/physics/CollisionSwarmChart.d.ts +1 -1
  179. package/dist/components/charts/physics/EventDropChart.d.ts +3 -1
  180. package/dist/components/charts/physics/GaltonBoardChart.d.ts +4 -2
  181. package/dist/components/charts/physics/ProcessFlowChart.d.ts +6 -0
  182. package/dist/components/charts/physics/UnitPileChart.d.ts +2 -1
  183. package/dist/components/charts/physics/collisionSwarmPacking.d.ts +14 -0
  184. package/dist/components/charts/physics/collisionSwarmPhysics.d.ts +1 -0
  185. package/dist/components/charts/physics/eventDropAdmission.d.ts +32 -0
  186. package/dist/components/charts/physics/eventDropPhysics.d.ts +22 -1
  187. package/dist/components/charts/physics/galtonBoardPhysics.d.ts +2 -9
  188. package/dist/components/charts/physics/physicsChartReconcile.d.ts +4 -0
  189. package/dist/components/charts/physics/physicsChartUtils.d.ts +1 -1
  190. package/dist/components/charts/physics/physicsGaltonData.d.ts +10 -0
  191. package/dist/components/charts/physics/physicsHocHandle.d.ts +2 -0
  192. package/dist/components/charts/physics/physicsPileData.d.ts +11 -0
  193. package/dist/components/charts/physics/physicsPilePhysics.d.ts +5 -12
  194. package/dist/components/charts/physics/physicsProjectionOverlays.d.ts +1 -1
  195. package/dist/components/charts/physics/physicsSourceRows.d.ts +8 -0
  196. package/dist/components/charts/physics/usePhysicsChartData.d.ts +19 -0
  197. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +4 -0
  198. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +14 -6
  199. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +4 -0
  200. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +4 -0
  201. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +4 -0
  202. package/dist/components/charts/realtime/realtimeAccessors.d.ts +4 -0
  203. package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +8 -7
  204. package/dist/components/charts/realtime/realtimeChartTypes.d.ts +7 -0
  205. package/dist/components/charts/realtime/temporalHistogramConfig.d.ts +17 -11
  206. package/dist/components/charts/shared/GaugeReadout.d.ts +9 -0
  207. package/dist/components/charts/shared/ThresholdAnnotation.d.ts +18 -0
  208. package/dist/components/charts/shared/ThresholdEndCap.d.ts +7 -0
  209. package/dist/components/charts/shared/auditAccessibilityText.d.ts +4 -2
  210. package/dist/components/charts/shared/chartDataProps.d.ts +3 -0
  211. package/dist/components/charts/shared/chartSpecAtlasSchemas.d.ts +5 -0
  212. package/dist/components/charts/shared/chartSpecCore.d.ts +4 -0
  213. package/dist/components/charts/shared/chartSpecsAtlas.d.ts +2 -0
  214. package/dist/components/charts/shared/hooks.d.ts +3 -1
  215. package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
  216. package/dist/components/charts/shared/numericTickFormatter.d.ts +2 -0
  217. package/dist/components/charts/shared/radialCenterContent.d.ts +10 -0
  218. package/dist/components/charts/shared/tooltipUtils.d.ts +1 -1
  219. package/dist/components/charts/shared/useChartLegend.d.ts +4 -0
  220. package/dist/components/charts/shared/useXYPointStyle.d.ts +2 -0
  221. package/dist/components/charts/xy/BubbleChart.d.ts +7 -0
  222. package/dist/components/charts/xy/CandlestickChart.d.ts +7 -0
  223. package/dist/components/charts/xy/DifferenceChart.d.ts +7 -0
  224. package/dist/components/charts/xy/MinimapChart.d.ts +7 -0
  225. package/dist/components/charts/xy/MultiAxisLineChart.d.ts +7 -0
  226. package/dist/components/charts/xy/ScatterplotMatrix.d.ts +6 -0
  227. package/dist/components/charts/xy/WaterfallChart.d.ts +8 -0
  228. package/dist/components/charts/xy/differenceMarkStyle.d.ts +28 -0
  229. package/dist/components/charts/xy/multiAxisFields.d.ts +23 -0
  230. package/dist/components/charts/xy/scatterplotMatrixCells.d.ts +50 -0
  231. package/dist/components/evidence/chartEvidenceEnvelope.d.ts +16 -8
  232. package/dist/components/evidence/evidenceEnvelopeInput.d.ts +8 -0
  233. package/dist/components/evidence/evidenceEnvelopeValidation.d.ts +11 -0
  234. package/dist/components/evidence/evidenceGate.d.ts +3 -1
  235. package/dist/components/evidence/renderedSceneHash.d.ts +23 -0
  236. package/dist/components/evidence/stableJsonHash.d.ts +4 -0
  237. package/dist/components/export/chartConfig.d.ts +40 -5
  238. package/dist/components/export/chartConfigArtifact.d.ts +6 -0
  239. package/dist/components/legendLayout.d.ts +18 -0
  240. package/dist/components/legendStyles.d.ts +4 -0
  241. package/dist/components/recipes/atlas/DependencyForestChart.d.ts +20 -0
  242. package/dist/components/recipes/atlas/DependencyMatrix.d.ts +7 -0
  243. package/dist/components/recipes/atlas/FlowCircuitChart.d.ts +20 -0
  244. package/dist/components/recipes/atlas/MotifBraidChart.d.ts +17 -0
  245. package/dist/components/recipes/atlas/atlasChartOptions.d.ts +11 -0
  246. package/dist/components/recipes/atlas/braid.d.ts +62 -0
  247. package/dist/components/recipes/atlas/capsules.d.ts +18 -0
  248. package/dist/components/recipes/atlas/compare.d.ts +4 -0
  249. package/dist/components/recipes/atlas/completeness.d.ts +2 -0
  250. package/dist/components/recipes/atlas/dependencyForest.d.ts +32 -0
  251. package/dist/components/recipes/atlas/dependencyForestChartProps.d.ts +58 -0
  252. package/dist/components/recipes/atlas/dependencyForestLayout.d.ts +17 -0
  253. package/dist/components/recipes/atlas/dependencyQueries.d.ts +20 -0
  254. package/dist/components/recipes/atlas/dependencyTypes.d.ts +21 -0
  255. package/dist/components/recipes/atlas/directedGraph.d.ts +9 -0
  256. package/dist/components/recipes/atlas/entityCounts.d.ts +3 -0
  257. package/dist/components/recipes/atlas/flowCircuit.d.ts +32 -0
  258. package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +72 -0
  259. package/dist/components/recipes/atlas/flowCircuitChrome.d.ts +18 -0
  260. package/dist/components/recipes/atlas/flowCircuitGeometry.d.ts +11 -0
  261. package/dist/components/recipes/atlas/flowCircuitLayout.d.ts +20 -0
  262. package/dist/components/recipes/atlas/flowCircuitSemantics.d.ts +26 -0
  263. package/dist/components/recipes/atlas/flowCircuitTape.d.ts +22 -0
  264. package/dist/components/recipes/atlas/flowCircuitTypes.d.ts +144 -0
  265. package/dist/components/recipes/atlas/forests.d.ts +11 -0
  266. package/dist/components/recipes/atlas/ids.d.ts +6 -0
  267. package/dist/components/recipes/atlas/index.d.ts +26 -0
  268. package/dist/components/recipes/atlas/ledger.d.ts +7 -0
  269. package/dist/components/recipes/atlas/motifBraidChartProps.d.ts +51 -0
  270. package/dist/components/recipes/atlas/motifBraidGeometry.d.ts +5 -0
  271. package/dist/components/recipes/atlas/motifBraidLayout.d.ts +11 -0
  272. package/dist/components/recipes/atlas/motifs.d.ts +3 -0
  273. package/dist/components/recipes/atlas/prefixForest.d.ts +9 -0
  274. package/dist/components/recipes/atlas/prepare.d.ts +14 -0
  275. package/dist/components/recipes/atlas/prepareAsync.d.ts +7 -0
  276. package/dist/components/recipes/atlas/profile.d.ts +19 -0
  277. package/dist/components/recipes/atlas/publish.d.ts +10 -0
  278. package/dist/components/recipes/atlas/queries.d.ts +34 -0
  279. package/dist/components/recipes/atlas/requiredPaths.d.ts +9 -0
  280. package/dist/components/recipes/atlas/rootedForest.d.ts +4 -0
  281. package/dist/components/recipes/atlas/sections.d.ts +3 -0
  282. package/dist/components/recipes/atlas/support.d.ts +7 -0
  283. package/dist/components/recipes/atlas/types.d.ts +278 -0
  284. package/dist/components/recipes/atlas/validate.d.ts +12 -0
  285. package/dist/components/recipes/firstAvailableTrack.d.ts +17 -0
  286. package/dist/components/recipes/intervals.d.ts +1 -1
  287. package/dist/components/semiotic-ai-core.d.ts +33 -22
  288. package/dist/components/semiotic-ai.d.ts +15 -3
  289. package/dist/components/semiotic-artifact-react.d.ts +10 -0
  290. package/dist/components/semiotic-artifact.d.ts +23 -0
  291. package/dist/components/semiotic-atlas-core.d.ts +20 -0
  292. package/dist/components/semiotic-atlas.d.ts +8 -0
  293. package/dist/components/semiotic-experimental.d.ts +1 -1
  294. package/dist/components/semiotic-physics.d.ts +4 -4
  295. package/dist/components/semiotic-recipes-core.d.ts +9 -0
  296. package/dist/components/semiotic-text.d.ts +2 -0
  297. package/dist/components/semiotic-utils-core.d.ts +18 -18
  298. package/dist/components/semiotic.d.ts +3 -3
  299. package/dist/components/server/renderEvidence.d.ts +12 -0
  300. package/dist/components/server/renderToStaticSVG.d.ts +3 -0
  301. package/dist/components/server/serverChartConfigs.d.ts +3 -0
  302. package/dist/components/server/serverChartConfigsAtlas.d.ts +4 -0
  303. package/dist/components/server/staticSVGChrome.d.ts +1 -4
  304. package/dist/components/server/staticXYAxisTicks.d.ts +2 -38
  305. package/dist/components/server/staticXYGrid.d.ts +1 -1
  306. package/dist/components/server/svgSizing.d.ts +6 -0
  307. package/dist/components/shared/svgRoot.d.ts +17 -0
  308. package/dist/components/store/selectionProvenance.d.ts +6 -0
  309. package/dist/components/stream/GeoSVGOverlay.d.ts +4 -0
  310. package/dist/components/stream/NetworkPipelineStore.d.ts +1 -0
  311. package/dist/components/stream/NetworkSVGOverlay.d.ts +4 -0
  312. package/dist/components/stream/OrdinalSVGOverlay.d.ts +4 -0
  313. package/dist/components/stream/SVGOverlay.d.ts +4 -0
  314. package/dist/components/stream/SceneToSVG.d.ts +4 -19
  315. package/dist/components/stream/SceneToSVGXY.d.ts +13 -0
  316. package/dist/components/stream/StreamGeoFrame.d.ts +1 -2
  317. package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -2
  318. package/dist/components/stream/XYGrid.d.ts +11 -0
  319. package/dist/components/stream/axisTickUtils.d.ts +0 -1
  320. package/dist/components/stream/canvasSetup.d.ts +1 -2
  321. package/dist/components/stream/fontLoading.d.ts +4 -0
  322. package/dist/components/stream/hitTestUtils.d.ts +2 -0
  323. package/dist/components/stream/networkCustomLayout.d.ts +8 -0
  324. package/dist/components/stream/networkCustomLayoutCache.d.ts +12 -0
  325. package/dist/components/stream/networkPipelineConfig.d.ts +0 -7
  326. package/dist/components/stream/overlayAccessibleText.d.ts +18 -0
  327. package/dist/components/stream/physics/PhysicsControllers.d.ts +1 -1
  328. package/dist/components/stream/physics/PhysicsKernel.d.ts +9 -0
  329. package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +5 -4
  330. package/dist/components/stream/physics/PhysicsPipelineTypes.d.ts +9 -0
  331. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +3 -0
  332. package/dist/components/stream/physics/physicsCanvasCoordinates.d.ts +5 -0
  333. package/dist/components/stream/physics/physicsFixedPosition.d.ts +16 -0
  334. package/dist/components/stream/physics/physicsKernelCloning.d.ts +6 -0
  335. package/dist/components/stream/physics/physicsPipelineObservations.d.ts +2 -0
  336. package/dist/components/stream/physics/physicsPipelineSettle.d.ts +15 -9
  337. package/dist/components/stream/physics/physicsRegionRuntime.d.ts +8 -17
  338. package/dist/components/stream/physics/physicsSemanticUI.d.ts +11 -0
  339. package/dist/components/stream/physics/usePhysicsCanvasPointer.d.ts +3 -1
  340. package/dist/components/stream/physics/usePhysicsSemanticNavigation.d.ts +2 -0
  341. package/dist/components/stream/pipelineConfig.d.ts +4 -0
  342. package/dist/components/stream/pipelineStoreUpdateResults.d.ts +1 -1
  343. package/dist/components/stream/resolveXYAxes.d.ts +13 -0
  344. package/dist/components/stream/sceneToSVGShared.d.ts +2 -1
  345. package/dist/components/stream/seriesGeometry.d.ts +13 -0
  346. package/dist/components/stream/shallowEqual.d.ts +2 -0
  347. package/dist/components/stream/streamEncodingTypes.d.ts +53 -0
  348. package/dist/components/stream/types.d.ts +4 -53
  349. package/dist/components/stream/useEnsureCustomXYRenderers.d.ts +4 -2
  350. package/dist/components/stream/useGeoFrameHandle.d.ts +16 -0
  351. package/dist/components/stream/useOrdinalFrameHandle.d.ts +15 -0
  352. package/dist/components/stream/useXYFrameHandle.d.ts +15 -0
  353. package/dist/components/stream/xyAxisTicks.d.ts +25 -0
  354. package/dist/components/stream/xyDateTicks.d.ts +3 -2
  355. package/dist/components/stream/xyFrameAxisTypes.d.ts +2 -0
  356. package/dist/components/stream/xySceneBuilders/ribbonScene.d.ts +1 -1
  357. package/dist/components/stream/xySceneBuilders/types.d.ts +1 -0
  358. package/dist/components/text/annotationTextLayout.d.ts +28 -0
  359. package/dist/components/text/pretextAnnotationLayout.d.ts +29 -0
  360. package/dist/components/text/usePretextAnnotations.d.ts +12 -0
  361. package/dist/controls.module.min.js +1 -1
  362. package/dist/geo.min.js +1 -1
  363. package/dist/geo.module.min.js +1 -1
  364. package/dist/network.module.min.js +1 -1
  365. package/dist/ordinal.module.min.js +1 -1
  366. package/dist/physics-matter.min.js +1 -1
  367. package/dist/physics-matter.module.min.js +1 -1
  368. package/dist/physics-rapier.min.js +1 -1
  369. package/dist/physics-rapier.module.min.js +1 -1
  370. package/dist/physics.module.min.js +1 -1
  371. package/dist/physicsWorker.js +1 -1
  372. package/dist/processSankeyLayoutWorker.js +1 -1
  373. package/dist/rough.min.js +1 -1
  374. package/dist/rough.module.min.js +1 -1
  375. package/dist/semiotic-access.module.min.js +1 -1
  376. package/dist/semiotic-ai-artifact-policy-constants.module.min.js +2 -0
  377. package/dist/semiotic-ai-core.d.ts +33 -22
  378. package/dist/semiotic-ai-core.min.js +1 -1
  379. package/dist/semiotic-ai-core.module.min.js +1 -1
  380. package/dist/semiotic-ai-hash-primitives.module.min.js +2 -0
  381. package/dist/semiotic-ai.d.ts +15 -3
  382. package/dist/semiotic-ai.module.min.js +1 -1
  383. package/dist/semiotic-artifact-react.d.ts +10 -0
  384. package/dist/semiotic-artifact-react.min.js +2 -0
  385. package/dist/semiotic-artifact-react.module.min.js +2 -0
  386. package/dist/semiotic-artifact.d.ts +23 -0
  387. package/dist/semiotic-artifact.min.js +1 -0
  388. package/dist/semiotic-artifact.module.min.js +1 -0
  389. package/dist/semiotic-atlas-core.d.ts +20 -0
  390. package/dist/semiotic-atlas-core.min.js +1 -0
  391. package/dist/semiotic-atlas-core.module.min.js +1 -0
  392. package/dist/semiotic-atlas-selection.module.min.js +2 -0
  393. package/dist/semiotic-atlas.d.ts +8 -0
  394. package/dist/semiotic-atlas.min.js +2 -0
  395. package/dist/semiotic-atlas.module.min.js +2 -0
  396. package/dist/semiotic-client-cjs-shared.min.js +1 -1
  397. package/dist/semiotic-client-glyph.module.min.js +1 -1
  398. package/dist/semiotic-client-responsive.module.min.js +1 -1
  399. package/dist/semiotic-client-shared.module.min.js +1 -1
  400. package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +1 -1
  401. package/dist/semiotic-data.min.js +1 -1
  402. package/dist/semiotic-data.module.min.js +1 -1
  403. package/dist/semiotic-evidence.min.js +1 -1
  404. package/dist/semiotic-evidence.module.min.js +1 -1
  405. package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
  406. package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -1
  407. package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
  408. package/dist/semiotic-experimental-vacp.min.js +1 -1
  409. package/dist/semiotic-experimental-vacp.module.min.js +1 -1
  410. package/dist/semiotic-experimental.d.ts +1 -1
  411. package/dist/semiotic-line.module.min.js +1 -1
  412. package/dist/semiotic-physics.d.ts +4 -4
  413. package/dist/semiotic-realtime-core.module.min.js +1 -1
  414. package/dist/semiotic-realtime-react.module.min.js +1 -1
  415. package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
  416. package/dist/semiotic-recipes-core.d.ts +9 -0
  417. package/dist/semiotic-recipes-core.module.min.js +1 -1
  418. package/dist/semiotic-recipes-geo-cjs.min.js +1 -1
  419. package/dist/semiotic-recipes-react.min.js +1 -1
  420. package/dist/semiotic-server-edge-node.module.min.js +1 -1
  421. package/dist/semiotic-server-edge.min.js +1 -1
  422. package/dist/semiotic-server-edge.module.min.js +1 -1
  423. package/dist/semiotic-server-node.min.js +1 -1
  424. package/dist/semiotic-server-node.module.min.js +1 -1
  425. package/dist/semiotic-text.d.ts +2 -0
  426. package/dist/semiotic-text.min.js +2 -0
  427. package/dist/semiotic-text.module.min.js +2 -0
  428. package/dist/semiotic-themes-core.min.js +1 -1
  429. package/dist/semiotic-themes-core.module.min.js +1 -1
  430. package/dist/semiotic-themes.min.js +1 -1
  431. package/dist/semiotic-themes.module.min.js +1 -1
  432. package/dist/semiotic-utils-core.d.ts +18 -18
  433. package/dist/semiotic-utils-core.min.js +1 -1
  434. package/dist/semiotic-utils-core.module.min.js +1 -1
  435. package/dist/semiotic-value.module.min.js +1 -1
  436. package/dist/semiotic.d.ts +3 -3
  437. package/dist/semiotic.module.min.js +1 -1
  438. package/dist/server.min.js +1 -1
  439. package/dist/server.module.min.js +1 -1
  440. package/dist/xy.module.min.js +1 -1
  441. package/package.json +70 -14
  442. package/spec/README.md +8 -3
  443. package/spec/v0.1/artifact-contract.schema.json +2299 -0
  444. package/spec/v0.1/examples/artifact-contract-full.json +369 -0
  445. package/spec/v0.1/examples/artifact-contract-unknown-state.json +46 -0
  446. package/dist/c-3BLJEQNG.min.js +0 -1
  447. package/dist/c-3SCUN5HI.min.js +0 -1
  448. package/dist/c-3VVKFA4M.min.js +0 -1
  449. package/dist/c-43TJZS3F.min.js +0 -1
  450. package/dist/c-4DTZPSUD.min.js +0 -1
  451. package/dist/c-4ES5367Y.min.js +0 -1
  452. package/dist/c-52TEGIUJ.min.js +0 -1
  453. package/dist/c-54IRWOGM.min.js +0 -1
  454. package/dist/c-5D2S4RMI.min.js +0 -1
  455. package/dist/c-5JWCTX3G.min.js +0 -1
  456. package/dist/c-6CMMSN6N.min.js +0 -1
  457. package/dist/c-6HRB2L7H.min.js +0 -1
  458. package/dist/c-6O5EVOPH.min.js +0 -1
  459. package/dist/c-7W4SV36A.min.js +0 -1
  460. package/dist/c-A4WRGZFX.min.js +0 -1
  461. package/dist/c-AG7WWVIH.min.js +0 -1
  462. package/dist/c-AH6J4MTN.min.js +0 -1
  463. package/dist/c-AKAF6JAD.min.js +0 -1
  464. package/dist/c-ALYR5LKK.min.js +0 -1
  465. package/dist/c-BBKITSXB.min.js +0 -1
  466. package/dist/c-BYDPC44I.min.js +0 -1
  467. package/dist/c-CFFIU2MW.min.js +0 -1
  468. package/dist/c-CGNHBHCE.min.js +0 -1
  469. package/dist/c-CJYSXIFV.min.js +0 -1
  470. package/dist/c-CZF7MV67.min.js +0 -1
  471. package/dist/c-D53OKBSY.min.js +0 -1
  472. package/dist/c-DADXPJXV.min.js +0 -1
  473. package/dist/c-DBQ2V7CH.min.js +0 -1
  474. package/dist/c-DPMVAUAW.min.js +0 -1
  475. package/dist/c-ECJCKLYY.min.js +0 -1
  476. package/dist/c-EGATGOWJ.min.js +0 -1
  477. package/dist/c-EGR6VYBW.min.js +0 -1
  478. package/dist/c-ESNR43AN.min.js +0 -1
  479. package/dist/c-F3LIKINL.min.js +0 -1
  480. package/dist/c-F5ZB5GJ6.min.js +0 -1
  481. package/dist/c-G36WS6LN.min.js +0 -1
  482. package/dist/c-G3VYMHKE.min.js +0 -1
  483. package/dist/c-GGISSW5E.min.js +0 -1
  484. package/dist/c-GR6MOEQC.min.js +0 -1
  485. package/dist/c-GSVCN34B.min.js +0 -1
  486. package/dist/c-GYOQCEFP.min.js +0 -1
  487. package/dist/c-H3DNMTCC.min.js +0 -1
  488. package/dist/c-I6J3FEZE.min.js +0 -1
  489. package/dist/c-IGH6MGJ5.min.js +0 -1
  490. package/dist/c-II2EEAJN.min.js +0 -1
  491. package/dist/c-IUHFPMHD.min.js +0 -1
  492. package/dist/c-J6M4JHRS.min.js +0 -1
  493. package/dist/c-JM3MGLQV.min.js +0 -1
  494. package/dist/c-KM3N7F7R.min.js +0 -1
  495. package/dist/c-LF5BZFNC.min.js +0 -1
  496. package/dist/c-LKBSGFQC.min.js +0 -1
  497. package/dist/c-MNF2S4AA.min.js +0 -1
  498. package/dist/c-MT3WBK7M.min.js +0 -1
  499. package/dist/c-NDJADPIF.min.js +0 -1
  500. package/dist/c-NVPQCIL5.min.js +0 -1
  501. package/dist/c-NY3JWV2K.min.js +0 -1
  502. package/dist/c-OFWJBEE5.min.js +0 -1
  503. package/dist/c-OYFHP5F5.min.js +0 -1
  504. package/dist/c-PGKQGGQ2.min.js +0 -1
  505. package/dist/c-PPWDL5ZI.min.js +0 -1
  506. package/dist/c-Q2IPZ3MU.min.js +0 -1
  507. package/dist/c-QKHMBE2E.min.js +0 -1
  508. package/dist/c-QMVM3AY6.min.js +0 -1
  509. package/dist/c-QSGWX53A.min.js +0 -1
  510. package/dist/c-RJKEKZOO.min.js +0 -1
  511. package/dist/c-RSVIHIQ4.min.js +0 -1
  512. package/dist/c-S6U5CGT5.min.js +0 -1
  513. package/dist/c-SFDIIU5G.min.js +0 -1
  514. package/dist/c-SLGMUBUL.min.js +0 -1
  515. package/dist/c-SRTBCRVE.min.js +0 -1
  516. package/dist/c-T6UAIKBH.min.js +0 -1
  517. package/dist/c-TMCTEVVW.min.js +0 -1
  518. package/dist/c-TMOSJLT3.min.js +0 -1
  519. package/dist/c-TZW3JGJ5.min.js +0 -1
  520. package/dist/c-U6ESPM7V.min.js +0 -1
  521. package/dist/c-UC5PTTFI.min.js +0 -1
  522. package/dist/c-USFMFKIH.min.js +0 -1
  523. package/dist/c-VGKUEZBC.min.js +0 -1
  524. package/dist/c-VGW3VG3I.min.js +0 -1
  525. package/dist/c-VN2HG5BS.min.js +0 -1
  526. package/dist/c-VPZDY5Q4.min.js +0 -1
  527. package/dist/c-VRXUB2F2.min.js +0 -1
  528. package/dist/c-VUBQNQJH.min.js +0 -1
  529. package/dist/c-VUH4PGZY.min.js +0 -1
  530. package/dist/c-W3CE4A4S.min.js +0 -1
  531. package/dist/c-X5UBGU2V.min.js +0 -1
  532. package/dist/c-XDRV7RKW.min.js +0 -1
  533. package/dist/c-YGZHURXZ.min.js +0 -1
  534. package/dist/c-YZVRZGX2.min.js +0 -1
  535. /package/dist/{c-N4G2L7ID.min.js → c-HYW2XA4Q.min.js} +0 -0
  536. /package/dist/{c-ENF72HU5.min.js → c-QAVFOEUY.min.js} +0 -0
  537. /package/dist/{c-OCI56QF2.min.js → c-V4XMSLC3.min.js} +0 -0
@@ -1 +0,0 @@
1
- import{bandFromAge as t,defaultTooltipStyle as e,normalizeTooltip as n,opacityFromAge as r,setCanvasMarkCursor as o,withSceneMarkCursor as a}from"./c-VN2HG5BS.min.js";import{glyphHitGeometry as c,resolveCSSColor as s}from"./c-QKHMBE2E.min.js";function i(t,e={}){const n=!0===e.showRetractedAnnotations,r=!0===e.showSupersededAnnotations,o=new Set;for(const e of t){const t=e?.lifecycle?.supersedes;t&&"retracted"!==e?.lifecycle?.status&&o.add(t)}return t.filter(t=>{if("retracted"===t?.lifecycle?.status&&!n)return!1;const e=t?.provenance?.stableId;return!(e&&o.has(e)&&!r)})}import{jsx as u,jsxs as l}from"react/jsx-runtime";function f(t){return"string"==typeof t?t:"value"}function d(t){return null==t?"–":"number"==typeof t?Math.abs(t)>9999?t.toLocaleString():t+"":t instanceof Date?t.toLocaleDateString():t+""}function h(t,e){if(!e)return d(t);try{const n=e(t);return null==n?d(t):n}catch{return d(t)}}function p(t,e){return"function"==typeof e?e(t):t[e]}function y(t,e){if(!t)return[];const n=[];return(Array.isArray(t)?t:[t]).forEach((t,r)=>{const o="string"==typeof t?.y0Accessor?t.y0Accessor:"low",a="string"==typeof t?.y1Accessor?t.y1Accessor:"high";n.push({label:o,accessor:t=>t.bands?.[r]?.y0??(0===r?t.band?.y0:void 0),format:e}),n.push({label:a,accessor:t=>t.bands?.[r]?.y1??(0===r?t.band?.y1:void 0),format:e})}),n}function g(t){const n=t.find(t=>"title"===t.role),r=t.filter(t=>"title"!==t.role);return t=>{const o=t.data;if(!o)return null;const a=n?h(p(o,n.accessor),n.format):null;return l("div",{className:"semiotic-tooltip",style:e,children:[null!=a&&u("div",{style:{fontWeight:"bold",marginBottom:r.length>0?4:0},children:a}),r.map((t,e)=>{const n=h(p(o,t.accessor),t.format);return l("div",{style:e>0?{marginTop:2}:void 0,children:[l("span",{style:{opacity:.7},children:[t.label,": "]}),u("span",{children:n})]},e)})]})}}function m({categoryAccessor:t,valueAccessor:n,groupAccessor:r,groupLabel:o,pieData:a=!1,valueFormat:c}){return s=>{const i=a?s.data?.[0]||s.data||s:s.data||s,y=p(i,t),g=p(i,n),m=r?p(i,r):void 0;return l("div",{className:"semiotic-tooltip",style:e,children:[u("div",{style:{fontWeight:"bold"},children:d(y)}),u("div",{style:{marginTop:4},children:h(g,c)}),null!=m&&l("div",{style:{marginTop:2,opacity:.8},children:[o||f(r),": ",d(m)]})]})}}import*as x from"react";function b(...t){const e=t.filter(t=>null!=t);return 0===e.length?null:1===e.length?e[0]:x.createElement(x.Fragment,null,...e)}import{useEffect as v,useRef as w}from"react";function k(t,e,n,r){v(()=>{t.current?.updateConfig(e),n.current=!0,r()},[e,r,t,n])}function A(t,e,n,r){const o=w(null);v(()=>{const a=t.current;if(!a)return;const c=e??null;o.current!==c&&(o.current=c,a.setLayoutSelection(c),a.hasCustomRestyle?a.restyleScene(c):n.current=!0,r())},[e,r,t,n])}var M={fresh:1,aging:.7,stale:.45,expired:.25},I={alpha:1,band:"fresh",isStale:!1};function S(e,n){if(!e||0>=n)return I;const r=null!=e.threshold&&e.threshold>0?e.threshold:5e3,o=e.graded;if(o){const e="object"==typeof o?o:{},a=t(n,r,e.thresholds);return{alpha:{...M,...e.opacities??{}}[a],band:a,isStale:"fresh"!==a}}return n>r?{alpha:e.dimOpacity??.5,band:"stale",isStale:!0}:I}import{useEffect as _,useRef as E}from"react";function O(t,e,n,r,o,a,c){const s=E("fresh");_(()=>{if(!t)return void(s.current="fresh");const i=setInterval(()=>{const i=e.current;if(!i||0===i.lastIngestTime)return;const u=S(t,o()-i.lastIngestTime);u.band===s.current&&u.isStale===a||(s.current=u.band,u.isStale!==a&&c(u.isStale),n.current=!0,r())},1e3);return()=>clearInterval(i)},[t,a,r,o,e,c,n])}import{jsx as D}from"react/jsx-runtime";function R({isStale:t,position:e}){return D("div",{className:"stream-staleness-badge",style:{position:"absolute",..."top-left"===e?{top:4,left:4}:"bottom-left"===e?{bottom:4,left:4}:"bottom-right"===e?{bottom:4,right:4}:{top:4,right:4},padding:"2px 8px",borderRadius:4,fontSize:11,fontWeight:600,pointerEvents:"none",zIndex:3,background:t?"#dc3545":"#28a745",color:"white"},children:t?"STALE":"LIVE"})}import{useRef as B}from"react";function L(t){const e=B(t);return function(t,e){if(Object.is(t,e))return!0;if(Array.isArray(t)&&Array.isArray(e))return j(t,e);if(!C(t)||!C(e))return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const r of n){if(!Object.prototype.hasOwnProperty.call(e,r))return!1;const n=t[r],o=e[r];if(!Object.is(n,o))if(Array.isArray(n)&&Array.isArray(o)){if(!j(n,o))return!1}else{if(!C(n)||!C(o))return!1;if(!P(n,o))return!1}}return!0}(e.current,t)||(e.current=t),e.current}function P(t,e){const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const r of n){if(!Object.prototype.hasOwnProperty.call(e,r))return!1;if(!Object.is(t[r],e[r]))return!1}return!0}function j(t,e){if(t.length!==e.length)return!1;for(let n=0;t.length>n;n++)if(!Object.is(t[n],e[n]))return!1;return!0}function C(t){if(null===t||"object"!=typeof t)return!1;if(Array.isArray(t))return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function T(t){const{background:e,hasBackgroundGraphics:n=!1,themeBackground:r=""}=t;return"transparent"===e?null:n?e||null:e||(r&&"transparent"!==r?r:"")||null}function G(t){const{background:e,hasBackgroundGraphics:n=!1,themeBackground:r=""}=t;return"transparent"===e||n?null:e||(r&&"transparent"!==r?r:"")||null}function z(t,e){const{background:n,hasBackgroundGraphics:r=!1,themeBackground:o="",x:a=0,y:c=0,width:i,height:u}=e,l=G({background:n,hasBackgroundGraphics:r,themeBackground:o});if(!l)return!1;const f=s(t,l);return!(!f||"transparent"===f.trim().toLowerCase()||(t.fillStyle=f,t.fillRect(a,c,i,u),0))}function H(t,e,n,r){return"function"==typeof t?t({size:e,margin:n,scales:r}):t}function N({foregroundGraphics:t,backgroundGraphics:e,size:n,margin:r,scales:o,background:a,themeBackgroundColor:c,resolveScaleAwareGraphics:s=!0}){const i=`var(--semiotic-bg, ${c})`;return{resolvedForeground:s||"function"!=typeof t?H(t,n,r,o):null,resolvedBackground:s||"function"!=typeof e?H(e,n,r,o):null,themeBackground:i,surfaceBackground:T({background:a,hasBackgroundGraphics:!!e,themeBackground:i})}}function $(t,e){if(!e)return[];const n=new Set,r=[];for(const o of t){if(!o||"object"!=typeof o)continue;const t=("function"==typeof e?e(o):o[e])+"";n.has(t)||(n.add(t),r.push(t))}return r}import{useCallback as W,useEffect as U,useRef as V}from"react";function F(t,e,n,r){const o=V({accessor:e,onChange:n,readData:r}),a=V([]);o.current={accessor:e,onChange:n,readData:r};const c=W(()=>{const{accessor:e,onChange:n,readData:r}=o.current;if(!n||!e)return;const c=$(t.current?r(t.current):[],e);(function(t,e){if(t.length!==e.length)return!1;for(let n=0;t.length>n;n++)if(t[n]!==e[n])return!1;return!0})(c,a.current)||(a.current=c,n(c))},[t]);return U(()=>{a.current=[],c()},[e,c,n]),c}var Y=new Set;function K(t,e){const n="function"==typeof t?t(e.datum??null,e):t;return(r=n)&&"object"==typeof r&&"string"==typeof r.id&&"function"==typeof r.cacheKey&&"function"==typeof r.drawCanvas&&"function"==typeof r.renderStaticSVG?n:void 0;var r}function X(t,e){if("undefined"!=typeof process&&"production"===process.env?.NODE_ENV)return;const n=`${t}:${e}`;Y.has(n)||(Y.add(n),console.warn(`[Semiotic] Render backend "${t}" does not support scene node "${e}"; using the built-in renderer.`))}function q(t){const{context:e,nodes:n,renderMode:r,pixelRatio:o,paintBuiltIn:a}=t;if(!r||"sketchy"===r)return void a(n);let c=[];const s=()=>{c.length&&(a(c),c=[])};for(const t of n){const n=K(r,t);if(!n){c.push(t);continue}let i;s(),e.save();try{i=n.drawCanvas({context:e,node:t,style:t.style??{},pixelRatio:o})}finally{e.restore()}i||(X(n.id,t.type??"unknown"),a([t]))}s()}function Q(t){const{node:e,index:n,renderMode:r,fallback:o}=t,c=K(r,e);if(!c)return{element:o(),renderedByBackend:!1};const s=c.renderStaticSVG({node:e,style:e.style??{},key:`${c.id}-${n}`});return null!=s?{element:a(s,e,`${c.id}-${n}-cursor`),renderedByBackend:!0}:(X(c.id,e.type??"unknown"),{element:o(),renderedByBackend:!1})}function J(t){return Q(t).element}function Z(t){const e=[];return t.nodes.forEach((n,r)=>{const o=Q({node:n,index:r,renderMode:t.renderMode,fallback:()=>t.fallback(n,r)});null!=o.element&&!1!==o.element&&e.push({node:n,index:r,...o})}),e}function tt(t){const e=new Map;for(const n of t){const t=n.group??"_default";let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}for(const t of e.values()){t.sort((t,e)=>t.x-e.x||t.y-e.y);for(let e=0;t.length>e;e++)t[e]._groupIndex=e}const n=Array.from(e.keys()).sort((t,n)=>{const r=e.get(t),o=e.get(n);return(r.length>0?r[0].y:0)-(o.length>0?o[0].y:0)}),r=Array.from(e.values()).flat();r.sort((t,e)=>t.x-e.x||t.y-e.y);const o=new Map;for(let t=0;r.length>t;t++){r[t]._flatIndex=t;const e=r[t].datum?.id;null!=e&&o.set(e+"",t)}return{flat:r,groups:n,byGroup:e,idToIdx:o}}function et(t,e){if(0===t.flat.length)return{flatIndex:-1,group:"_default",indexInGroup:-1};const n=Math.max(0,Math.min(e,t.flat.length-1)),r=t.flat[n];return{flatIndex:n,group:r.group??"_default",indexInGroup:r._groupIndex??0}}function nt(t,e,n){const{group:r,indexInGroup:o}=e,a=n.byGroup.get(r);switch(t){case"ArrowRight":return a.length-1>o?a[o+1]._flatIndex:e.flatIndex;case"ArrowLeft":return o>0?a[o-1]._flatIndex:e.flatIndex;case"ArrowDown":{const t=n.groups.indexOf(r);return n.groups.length-1>t?rt(n,n.groups[t+1],a[o]):e.flatIndex}case"ArrowUp":{const t=n.groups.indexOf(r);return t>0?rt(n,n.groups[t-1],a[o]):e.flatIndex}case"PageDown":return Math.min(e.flatIndex+Math.max(1,Math.floor(.1*n.flat.length)),n.flat.length-1);case"PageUp":return Math.max(e.flatIndex-Math.max(1,Math.floor(.1*n.flat.length)),0);case"Home":return 0;case"End":return n.flat.length-1;case"Escape":return-1;default:return null}}function rt(t,e,n){const r=t.byGroup.get(e);let o=0,a=Math.abs(r[0].x-n.x);for(let t=1;r.length>t;t++){const e=Math.abs(r[t].x-n.x);a>e&&(a=e,o=t)}return r[o]._flatIndex}function ot(t){const e=[];for(const n of t)switch(n.type){case"point":if(!1===n.interactive)break;e.push({x:n.x,y:n.y,datum:n.datum,shape:"circle",group:"_default"});break;case"symbol":if(0>=n.size)break;e.push({x:n.x,y:n.y,datum:n.datum,shape:"circle",group:"_default"});break;case"glyph":{if(0>=n.size||null==n.datum)break;const t=c(n.glyph,n.size);e.push({x:n.x+t.centerDx,y:n.y+t.centerDy,datum:n.datum,shape:"rect",w:2*t.halfWidth,h:2*t.halfHeight,group:"_default"});break}case"line":{const t=n,r=Array.isArray(t.datum)?t.datum:[],o=t.group??"_default";for(let n=0;t.path.length>n&&r.length>n;n++)e.push({x:t.path[n][0],y:t.path[n][1],datum:r[n],shape:"circle",group:o});break}case"area":{if(!1===n.interactive)break;const t=n,r=Array.isArray(t.datum)?t.datum:[],o=t.group??"_default";for(let n=0;t.topPath.length>n&&r.length>n;n++)e.push({x:t.topPath[n][0],y:t.topPath[n][1],datum:r[n],shape:"circle",group:o});break}case"rect":e.push({x:n.x+n.w/2,y:n.y+n.h/2,datum:n.datum,shape:"rect",w:n.w,h:n.h,group:n.group??"_default"});break;case"heatcell":e.push({x:n.x+n.w/2,y:n.y+n.h/2,datum:n.datum,shape:"rect",w:n.w,h:n.h,group:"_default"})}return e.sort((t,e)=>t.x-e.x||t.y-e.y),e}function at(t){const e=[];for(const n of t)if("rect"===n.type&&null!=n.x){if(null==n.datum)continue;e.push({x:n.x+n.w/2,y:n.y+n.h/2,datum:n.datum,shape:"rect",w:n.w,h:n.h,group:n.group??n.datum?.category??""})}else if("point"===n.type){if(!1===n.interactive)continue;e.push({x:n.x,y:n.y,datum:n.datum,shape:"circle",group:"_default"})}else if("symbol"===n.type){if(0>=n.size)continue;e.push({x:n.x,y:n.y,datum:n.datum,shape:"circle",group:"_default"})}else if("glyph"===n.type){if(0>=n.size||null==n.datum)continue;const t=c(n.glyph,n.size);e.push({x:n.x+t.centerDx,y:n.y+t.centerDy,datum:n.datum,shape:"rect",w:2*t.halfWidth,h:2*t.halfHeight,group:"_default"})}else if("wedge"===n.type&&null!=n.cx){if(null===n.datum)continue;const t=((n.startAngle||0)+(n.endAngle||0))/2,r=((n.innerRadius||0)+(n.outerRadius||50))/2;e.push({x:n.cx+Math.cos(t)*r,y:n.cy+Math.sin(t)*r,datum:n.datum,shape:"wedge",group:"_default"})}return e.sort((t,e)=>t.x-e.x||t.y-e.y),e}function ct(t){const e=[];for(const n of t)if(n.datum)if("circle"===n.type&&null!=n.cx){if(0>=n.r)continue;e.push({x:n.cx,y:n.cy,datum:n.datum,shape:"circle",group:n.datum.id??"_default"})}else if("rect"===n.type&&null!=n.x){if(0>=n.w||0>=n.h)continue;e.push({x:n.x+n.w/2,y:n.y+n.h/2,datum:n.datum,shape:"rect",w:n.w,h:n.h,group:n.datum.id??"_default"})}else if("arc"===n.type&&null!=n.cx)e.push({x:n.cx,y:n.cy,datum:n.datum,shape:"circle",group:n.datum.id??"_default"});else if("symbol"===n.type&&null!=n.cx){if(0>=n.size)continue;e.push({x:n.cx,y:n.cy,datum:n.datum,shape:"circle",group:n.datum.id??"_default"})}else if("glyph"===n.type&&null!=n.cx){if(0>=n.size)continue;const t=c(n.glyph,n.size);e.push({x:n.cx+t.centerDx,y:n.cy+t.centerDy,datum:n.datum,shape:"rect",w:2*t.halfWidth,h:2*t.halfHeight,group:n.datum.id??"_default"})}return e.sort((t,e)=>t.x-e.x||t.y-e.y),e}function st(t,e,n,r,o){const a=n.flat[e.flatIndex];if(!a)return nt(t,e,n);const c=a.datum?.id;switch(t){case"ArrowRight":case"ArrowLeft":case"ArrowDown":case"ArrowUp":{const r=function(t,e,n){let r=null,o=1/0;for(let a=0;t.flat.length>a;a++){const c=t.flat[a];if(c===e)continue;const s=c.x-e.x,i=c.y-e.y;let u=!1;switch(n){case"right":u=s>0&&Math.abs(s)>=Math.abs(i);break;case"left":u=0>s&&Math.abs(s)>=Math.abs(i);break;case"down":u=i>0&&Math.abs(i)>=Math.abs(s);break;case"up":u=0>i&&Math.abs(i)>=Math.abs(s)}if(!u)continue;const l=s*s+i*i;o>l&&(o=l,r=a)}return r}(n,a,"ArrowRight"===t?"right":"ArrowLeft"===t?"left":"ArrowDown"===t?"down":"up")??e.flatIndex;return r!==e.flatIndex&&(o.current=-1),r}case"Enter":{if(null==c)return e.flatIndex;const t=function(t,e){const n=t+"",r=[];for(const t of e){const e=t.datum??t,o=it(e.source),a=it(e.target),c=null!=o,s=null!=a;c&&o+""===n&&s?r.push(a+""):s&&a+""===n&&c&&r.push(o+"")}return r}(c,r);if(0===t.length)return e.flatIndex;const a=n.idToIdx.get(t[(o.current+1)%t.length])??-1;return 0>a?e.flatIndex:(o.current=-1,a)}default:{const r=nt(t,e,n);return null!==r&&r!==e.flatIndex&&(o.current=-1),r}}}function it(t){return"object"==typeof t&&null!==t&&"id"in t?t.id:t}function ut(t){const e=[];for(const n of t)if("point"===n.type&&null!=n.x&&!1!==n.interactive)e.push({x:n.x,y:n.y,datum:n.datum,shape:"circle"});else if("glyph"===n.type){if(0>=n.size||null==n.datum)continue;const t=c(n.glyph,n.size);e.push({x:n.x+t.centerDx,y:n.y+t.centerDy,datum:n.datum,shape:"rect",w:2*t.halfWidth,h:2*t.halfHeight})}else"geoarea"===n.type&&n.centroid&&!1!==n.interactive&&e.push({x:n.centroid[0],y:n.centroid[1],datum:n.datum,shape:"geoarea",pathData:n.pathData});return e.sort((t,e)=>t.x-e.x||t.y-e.y),e}function lt(t,e,n){switch(t){case"ArrowRight":case"ArrowDown":return n-1>e?e+1:e;case"ArrowLeft":case"ArrowUp":return e>0?e-1:e;case"PageDown":return Math.min(e+Math.max(1,Math.floor(.1*n)),n-1);case"PageUp":return Math.max(e-Math.max(1,Math.floor(.1*n)),0);case"Home":return 0;case"End":return n-1;case"Escape":return-1;default:return null}}function ft(t){return{data:t.datum||{},x:t.x,y:t.y,__semioticHoverData:!0}}function dt(t,e,n,r,a,c){return function(t,e,n){const r=t.current;r.inside=!0,r.clientX=e.clientX,r.clientY=e.clientY,r.pointerType=e.pointerType??n}(t,e,c),!(!n&&!r||!n&&"touch"===t.current.pointerType&&(o(a),1))}function ht(t){const{title:e,description:n,summary:r,accessibleTable:o,className:a,animate:c,maxDevicePixelRatio:s,axisExtent:i,autoPlaceAnnotations:u}=t,l={};return e&&(l.title=e),n&&(l.description=n),r&&(l.summary=r),void 0!==o&&(l.accessibleTable=o),a&&(l.className=a),null!=c&&(l.animate=c),void 0!==s&&(l.maxDevicePixelRatio=s),void 0!==i&&(l.axisExtent=i),void 0!==u&&(l.autoPlaceAnnotations=u),l}function pt(t){const{linkedHover:e,selection:n,onObservation:r,onClick:o,hoverRadius:a,hoverHighlight:c,forceHoverBehavior:s,forceClickBehavior:i,mobileInteraction:u,customHoverBehavior:l,customClickBehavior:f,linkedHoverInClickPredicate:d=!0}=t,h={};r&&(h.annotationObservationCallback=r);const p=u?.enabled?Math.max(a??30,Math.ceil((u.targetSize||44)/2),24):a;return(s||e||r||o||c)&&(h.customHoverBehavior=l),f&&(i||(d?r||o||e:r||o)||u?.enabled&&(u.tapToSelect||u.tapToLockTooltip)&&(e||c||n))&&(h.customClickBehavior=f),null!=p&&(h.hoverRadius=p),h}function yt(t){const{tooltip:e,defaultTooltipContent:r}=t;return{tooltipContent:!1===e?()=>null:n(e)||r}}function gt(t,e){if(!function(t){return void 0!==t.stroke||void 0!==t.strokeWidth||void 0!==t.opacity}(e))return t??((...t)=>({}));const n={};return void 0!==e.stroke&&(n.stroke=e.stroke),void 0!==e.strokeWidth&&(n.strokeWidth=e.strokeWidth),void 0!==e.opacity&&(n.opacity=e.opacity),t?(...e)=>({...t(...e)||{},...n}):(...t)=>({...n})}function mt(t,e,n){if(1>=n)return 1;const o=n-1;return r({age:o-e,extent:o,type:t.type,halfLife:t.halfLife??n/2,threshold:t.stepThreshold??.5*n,minOpacity:t.minOpacity??.1})}function xt(t){const e=new Map;for(let n=0;t.length>n;n++)e.set(t[n],n);return e}function bt(t,e,n,r=xt(n)){const o=n.length;if(o>1)for(const n of e){if("line"===n.type){const e=Array.isArray(n.datum)?n.datum:[];if(2>e.length)continue;const a=Array(e.length);let c=!1;for(let n=0;e.length>n;n++){const s=r.get(e[n]);null!=s?(a[n]=mt(t,s,o),1>a[n]&&(c=!0)):a[n]=1}c&&(n._decayOpacities=a);continue}if("area"===n.type){const e=Array.isArray(n.datum)?n.datum:[],a=n.topPath?n.topPath.length:e.length;if(2>a)continue;if(e.length===a){const c=Array(a);let s=!1;for(let n=0;e.length>n;n++){const a=r.get(e[n]);null!=a?(c[n]=mt(t,a,o),1>c[n]&&(s=!0)):c[n]=1}s&&(n._decayOpacities=c)}else{let c=1;for(const n of e){const e=r.get(n);if(null!=e){const n=mt(t,e,o);c>n&&(c=n)}}if(1>c){const t=Array(a);t.fill(c),n._decayOpacities=t}}continue}const e=r.get(n.datum);if(null==e)continue;const a=mt(t,e,o);"candlestick"===n.type?n._decayOpacity=a:n.style={...n.style,opacity:(n.style?.opacity??1)*a}}}function vt(t){if("production"===process.env.NODE_ENV)return;const{label:e,nodes:n,overlays:r,warned:o}=t;wt(r)&&0===n.length&&kt(o,"overlay-only",`[semiotic] ${e} returned overlays but no data-bearing scene nodes. Overlays do not participate in hover, selection, transitions, SSR evidence, or accessibility tables. Emit at least one scene node with a datum, or mark the overlay-only chart as intentionally decorative.`),n.length>0&&n.every(t=>null==t.datum)&&kt(o,"null-datums",`[semiotic] ${e} returned scene nodes, but every scene-node datum is null. Hover, callbacks, selection, and tooltip helpers need data-bearing nodes. Attach a user-facing datum to each interactive node, or set interactive overlays outside the chart.`)}function wt(t){return null!=t&&!1!==t&&""!==t&&(!Array.isArray(t)||t.some(wt))}function kt(t,e,n){t.has(e)||(t.add(e),console.warn(n))}function At(t){try{return{kind:"success",result:t.run()}}catch(e){const n=t.hasPreviousResult,r=function(t,e,n,r){const o=function(t){if(t instanceof Error)return{name:t.name||"Error",message:t.message||"Custom layout threw."};if("string"==typeof t)return{name:"Error",message:t};if(null==t)return{name:"Error",message:"Custom layout threw a nullish value."};try{return{name:"Error",message:t+""}}catch{return{name:"Error",message:"Custom layout threw a non-stringifiable value."}}}(e),a="network"===t?"customNetworkLayout":"customLayout";return{code:"CUSTOM_LAYOUT_ERROR",severity:"error",phase:"layout",component:t,source:a,message:`Semiotic ${t} ${a} failed: ${o.message}`,error:o,recovery:n?"preserved-last-good-scene":"empty-scene",preservedLastGoodScene:n,affectedRevision:r}}(t.family,e,n,t.revision);"production"!==process.env.NODE_ENV&&console.error(`[semiotic] ${t.logLabel} threw:`,e);try{t.onLayoutError?.(r)}catch(t){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",t)}return{kind:"failure",diagnostic:r,preservedLastGoodScene:n}}}var Mt=new WeakMap;function It(){return this.updateResults.last}function St(){return this.updateResults.last}function _t(t){return this.updateResults.subscribe(t)}function Et(t){this.config.layoutSelection=t}function Ot(){Mt.set(this,!0)}function Dt(){const t=!0===Mt.get(this);return Mt.delete(this),t}function Rt(t){Object.assign(t.prototype,{getLastUpdateResult:It,getUpdateSnapshot:St,subscribeUpdateResult:_t,setLayoutSelection:Et,markStylePaintPending:Ot,consumeStylePaintPending:Dt})}function Bt(t,e,n){return n.x>t||t>n.x+n.w||n.y>e||e>n.y+n.h?{hit:!1,cx:0,cy:0}:{hit:!0,cx:n.x+n.w/2,cy:n.y+n.h/2}}function Lt(t,e=30){return Math.max((t??4)+5,12,e)}function Pt(t){return t instanceof Date?t:"number"==typeof t&&t>1e9?new Date(t):null}function jt(t,e){const n=Pt(t);if(!n)return!1;const r=Pt(e);return!r||n.getFullYear()!==r.getFullYear()||n.getMonth()!==r.getMonth()}function Ct(t){let e=t%(2*Math.PI);return 0>e&&(e+=2*Math.PI),e}function Tt(t,e,n,r,o,a=t=>t.x,c=t=>t.y,s=t=>t.r){const i=Math.max(r,o+5,12),u=e-i,l=e+i,f=n-i,d=n+i;let h=null,p=1/0;return t.visit((t,o,i,y,g)=>{if(o>l||u>y||i>d||f>g)return!0;if(!t.length){let o=t;do{const t=o.data,i=a(t)-e,u=c(t)-n,l=Math.sqrt(i*i+u*u);Lt(s(t),r)>=l&&p>l&&(h=t,p=l),o=o.next}while(o)}return!1}),h?{node:h,distance:p}:null}export{mt as computeDecayOpacity,xt as buildDatumIndexMap,bt as applyDecay,vt as warnCustomLayoutDiagnostics,At as runCustomLayoutAttempt,Rt as attachUpdateResultStore,b as composeOverlays,k as useConfigSync,A as useLayoutSelectionSync,Bt as hitTestRect,Lt as getHitRadius,jt as isTimeLandmark,Ct as normalizeAngle,Tt as findHitPointInQuadtree,S as resolveStaleness,O as useStalenessCheck,R as StalenessBadge,i as filterAnnotationsByStatus,L as useStableShallow,G as resolveCanvasBackground,z as paintCanvasBackground,H as resolveFrameGraphics,N as resolveFrameLayers,$ as extractCategoryDomain,F as useLegendCategoryEmission,q as paintSceneWithBackend,J as renderSceneWithBackend,Z as renderSceneListWithBackend,f as accessorName,d as formatVal,y as bandTooltipFields,g as buildDefaultTooltip,m as buildOrdinalTooltip,tt as buildNavGraph,et as resolvePosition,nt as nextGraphIndex,ot as extractXYNavPoints,at as extractOrdinalNavPoints,ct as extractNetworkNavPoints,st as nextNetworkIndex,ut as extractGeoNavPoints,lt as nextIndex,ft as navPointToHover,dt as shouldHandleFramePointer,ht as buildBaseMetadataProps,pt as buildCustomBehaviorProps,yt as buildTooltipProps,gt as mergeShapeStyle};
@@ -1 +0,0 @@
1
- import{renderPathPulse as t}from"./c-UC5PTTFI.min.js";import{buildThresholdLineSegments as o}from"./c-QSGWX53A.min.js";import{buildLinearFillGradient as e,resolveCSSColor as l,resolveCanvasFill as a,resolveCurveFactory as h}from"./c-QKHMBE2E.min.js";import{area as s,line as n}from"d3-shape";function i(t,o){const e=h(o.curve);if(!e||2>o.topPath.length||2>o.bottomPath.length){t.beginPath(),t.moveTo(o.topPath[0][0],o.topPath[0][1]);for(let e=1;o.topPath.length>e;e++)t.lineTo(o.topPath[e][0],o.topPath[e][1]);for(let e=o.bottomPath.length-1;e>=0;e--)t.lineTo(o.bottomPath[e][0],o.bottomPath[e][1]);t.closePath()}else{const l=s().x(t=>t[0]).y0((t,e)=>o.bottomPath[e][1]).y1(t=>t[1]).curve(e).context(t);t.beginPath(),l(o.topPath)}}function r(t,o){const e=h(o.curve);if(t.beginPath(),e)n().x(t=>t[0]).y(t=>t[1]).curve(e).context(t)(o.topPath);else{t.moveTo(o.topPath[0][0],o.topPath[0][1]);for(let e=1;o.topPath.length>e;e++)t.lineTo(o.topPath[e][0],o.topPath[e][1])}}var p=(h,s,n,p)=>{const c=s.filter(t=>"area"===t.type);for(const s of c){if(2>s.topPath.length)continue;let n=!1;s.clipRect&&(h.save(),h.beginPath(),h.rect(s.clipRect.x,s.clipRect.y,s.clipRect.width,s.clipRect.height),h.clip(),n=!0);const c=s._introClipFraction;void 0!==c&&1>c&&(h.save(),h.beginPath(),h.rect(0,0,p.width*c,p.height),h.clip());const P=a(h,s.style.fill,"#4e79a7"),f=s._decayOpacities,g=!(!s.colorThresholds?.length||!s.rawValues||s.rawValues.length!==s.topPath.length),y=!!s.strokeColorBands?.length;if(f&&f.length===s.topPath.length&&!g&&!y){const t=s.style.fillOpacity??.7;h.fillStyle=P;for(let o=0;s.topPath.length-1>o;o++)h.globalAlpha=.5*(f[o]+f[o+1])*t,h.beginPath(),h.moveTo(s.topPath[o][0],s.topPath[o][1]),h.lineTo(s.topPath[o+1][0],s.topPath[o+1][1]),h.lineTo(s.bottomPath[o+1][0],s.bottomPath[o+1][1]),h.lineTo(s.bottomPath[o][0],s.bottomPath[o][1]),h.closePath(),h.fill();const o=s.style.strokeWidth??2;if(s.style.stroke&&"none"!==s.style.stroke&&o>0){h.strokeStyle=l(h,s.style.stroke)||s.style.stroke,h.lineWidth=o,h.setLineDash([]);for(let t=0;s.topPath.length-1>t;t++)h.globalAlpha=.5*(f[t]+f[t+1]),h.beginPath(),h.moveTo(s.topPath[t][0],s.topPath[t][1]),h.lineTo(s.topPath[t+1][0],s.topPath[t+1][1]),h.stroke()}h.globalAlpha=1;continue}const m=s.style.opacity??1;if(i(h,s),s.fillGradient&&s.fillGradient.stops.length>=2&&s.fillGradient){let t=1/0;for(const o of s.topPath)t>o[1]&&(t=o[1]);let o=-1/0;for(const t of s.bottomPath)t[1]>o&&(o=t[1]);const l=e(h,s.fillGradient,"string"==typeof P?P:"#4e79a7",0,t,0,o);h.fillStyle=l||P,h.globalAlpha=m}else h.globalAlpha=(s.style.fillOpacity??.7)*m,h.fillStyle=P;h.fill(),s._pulseIntensity&&s._pulseIntensity>0&&(i(h,s),t(h,s));const b=s.style.strokeWidth??2;if(s.style.stroke&&"none"!==s.style.stroke&&b>0){h.globalAlpha=m;const t=l(h,s.style.stroke)||s.style.stroke,a=g||y||!s.strokeGradient||2>s.topPath.length?null:e(h,s.strokeGradient,t,s.topPath[0][0],0,s.topPath[s.topPath.length-1][0],0);if(h.lineWidth=b,h.setLineDash([]),y){let o=1/0,e=-1/0;for(const[t]of s.topPath)o=Math.min(o,t),e=Math.max(e,t);const a=h.lineWidth;for(const n of s.strokeColorBands){h.save(),h.beginPath(),h.rect(o-a,n.y,e-o+2*a,n.height),h.clip();const i=n.color??t;h.strokeStyle=l(h,i)||i,h.globalAlpha=m*(n.opacity??1),r(h,s),h.stroke(),h.restore()}}else if(g){const e=o(s.topPath,s.rawValues,s.colorThresholds,t);for(const t of e){h.beginPath(),h.strokeStyle=l(h,t.color)||t.color,h.moveTo(t.path[0][0],t.path[0][1]);for(let o=1;t.path.length>o;o++)h.lineTo(t.path[o][0],t.path[o][1]);h.stroke()}}else h.strokeStyle=a||t,r(h,s),h.stroke()}void 0!==c&&1>c&&h.restore(),n&&h.restore(),h.globalAlpha=1}};export{p as areaCanvasRenderer};
@@ -1 +0,0 @@
1
- var t=[40,40],n=[.5,.5];function h(h,i){const[e,o]=h.viewBox??t,[a,r]=h.anchor??n,c=o>0?o:1,x=Math.max(0,i)/c,f=(e>0?e:c)*x,l=c*x;return{width:f,height:l,scale:x,offsetX:-a*f,offsetY:-r*l}}function i(t,n,h,i){if("none"!==t)return"color"===t||null==t?n??i:"accent"===t?h:t}function e(n,h,i=0,e="horizontal"){const[o,a]=n.viewBox??t,r=Math.min(1,Math.max(0,i)),c=Math.min(1,Math.max(0,h));return c>r?r>0||1>c?"vertical"===e?{x:0,y:a*(1-c),width:o,height:a*(c-r)}:{x:o*r,y:0,width:o*(c-r),height:a}:null:{x:0,y:0,width:0,height:0}}export{t as DEFAULT_GLYPH_VIEWBOX,h as glyphPlacement,i as resolveGlyphPaint,e as glyphFractionClipRect};
@@ -1 +0,0 @@
1
- import{canUseForceWorker as e,createFrameForceWorkerRequest as t,shouldUseForceWorker as o}from"./c-6HRB2L7H.min.js";import{needsDataCanvasPaint as r}from"./c-OCI56QF2.min.js";import{networkSymbolRenderer as s}from"./c-5JWCTX3G.min.js";import{networkGlyphRenderer as n}from"./c-54IRWOGM.min.js";import{networkFrameDefaultMargin as i}from"./c-GSVCN34B.min.js";import{StalenessBadge as a,attachUpdateResultStore as c,buildNavGraph as l,composeOverlays as d,computeDecayOpacity as u,extractNetworkNavPoints as h,filterAnnotationsByStatus as y,findHitPointInQuadtree as g,formatVal as p,getHitRadius as f,hitTestRect as m,nextNetworkIndex as v,normalizeAngle as b,paintCanvasBackground as _,paintSceneWithBackend as x,renderSceneWithBackend as k,resolveFrameLayers as S,resolvePosition as w,runCustomLayoutAttempt as A,shouldHandleFramePointer as R,useConfigSync as N,useLayoutSelectionSync as C,useLegendCategoryEmission as E,useStableShallow as T,useStalenessCheck as P,warnCustomLayoutDiagnostics as D}from"./c-AG7WWVIH.min.js";import{CustomLayoutSelectionProvider as I,wrapWithCustomLayoutSelection as L}from"./c-G36WS6LN.min.js";import{renderCirclePulse as M,renderRectPulse as W}from"./c-UC5PTTFI.min.js";import{networkLabelToSVG as B,networkSceneEdgeToSVG as z,networkSceneNodeToSVG as Y}from"./c-DBQ2V7CH.min.js";import{buildResolveColor as F,resolveCustomLayoutPalette as O}from"./c-VPZDY5Q4.min.js";import{ANNOTATION_DISCLOSURE_REVEAL_CSS as j,AccessibleTablePortal as X,AriaLiveTooltip as H,CanvasFrameBackground as G,FlippingTooltip as V,FocusRing as $,NetworkAccessibleDataTable as Q,SVGChartTitle as K,SceneRevisionDiagnosticsObserver as q,ScreenReaderSummary as U,SkipToTableLink as Z,UpdateResultTracker as J,annotationActivationProps as ee,annotationLayout as te,buildHoverData as oe,computeEasing as re,computeNetworkAriaLabel as se,computeRawProgress as ne,createDefaultAnnotationRules as ie,defaultTooltipStyle as ae,emitClickObservations as ce,emitHoverObservations as le,filterSparseArray as de,getDevicePixelRatio as ue,isAnnotationActivationTarget as he,isInteractiveKeyboardTarget as ye,isServerEnvironment as ge,lerp as pe,now as fe,observationInputType as me,prepareCanvas as ve,rehitCanvasMarkCursor as be,renderAnnotationPass as _e,renderLegendFromConfig as xe,renderLoadingState as ke,runSceneBuild as Se,sceneHasAuthoredCursor as we,sceneMarkCursor as Ae,setCanvasMarkCursor as Re,smartTooltipEntries as Ne,useAnnotationActivationOptions as Ce,useCanvasMarkCursorCleanup as Ee,useFrame as Te,useFrameCanvasHost as Pe,useHydration as De,useSceneRevisionDiagnostics as Ie,useWasHydratingFromSSR as Le}from"./c-VN2HG5BS.min.js";import{resolveThemeSemanticColors as Me}from"./c-VRXUB2F2.min.js";import{DEFAULT_COLORS as We,schemeCategory10 as Be}from"./c-EGR6VYBW.min.js";import{glyphHitGeometry as ze,paintNetworkFill as Ye,paintNetworkStroke as Fe,resolveCSSColor as Oe,resolveCanvasFill as je,symbolRadius as Xe}from"./c-QKHMBE2E.min.js";import*as He from"react";import{useRef as Ge,useState as Ve,useEffect as $e,useMemo as Qe,useCallback as Ke,useImperativeHandle as qe,forwardRef as Ue,memo as Ze}from"react";var Je={weightChange:.1,newEdge:.5,newNode:1,threshold:3,transitionDuration:500},et={radius:3,opacity:.7,speedMultiplier:1,maxPerEdge:50,spawnRate:.1},tt=class{constructor(e){this.capacity=e,this.particles=Array(e),this._freeIndices=Array(e);for(let t=0;e>t;t++)this.particles[t]={t:0,offset:0,edgeIndex:0,active:!1,x:0,y:0},this._freeIndices[t]=e-1-t}spawn(e,t=Math.random){const o=this._freeIndices.pop();if(void 0===o)return null;const r=this.particles[o];return r.active=!0,r.t=0,r.offset=t()-.5,r.edgeIndex=e,r.x=0,r.y=0,r}step(e,t,o,r){for(let s=0;this.capacity>s;s++){const n=this.particles[s];if(!n.active)continue;const i=o[n.edgeIndex];i&&i.bezier?(n.t+=e*t*(r?r[n.edgeIndex]??1:1)*(i.bezier.circular?.3:1),1>n.t?ot(i.bezier,n.t,n.offset,n):(n.active=!1,this._freeIndices.push(s))):(n.active=!1,this._freeIndices.push(s))}}countForEdge(e){let t=0;for(let o=0;this.capacity>o;o++)this.particles[o].active&&this.particles[o].edgeIndex===e&&t++;return t}clear(){for(let e=0;this.capacity>e;e++)this.particles[e].active=!1;this._freeIndices.length=0;for(let e=this.capacity-1;e>=0;e--)this._freeIndices.push(e)}resize(e){if(this.capacity>=e)return;const t=this.particles;this.particles=Array(e);for(let o=0;e>o;o++)t.length>o?this.particles[o]=t[o]:(this.particles[o]={t:0,offset:0,edgeIndex:0,active:!1,x:0,y:0},this._freeIndices.push(o));this.capacity=e}};function ot(e,t,o,r){if(e.circular&&e.segments)return void function(e,t,o,r,s){const n=e.length,i=t*n,a=Math.min(Math.floor(i),n-1),c=i-a,[l,d,u,h]=e[a];rt(l,d,u,h,c,s);const y=h.x-l.x,g=h.y-l.y,p=Math.sqrt(y*y+g*g);if(p>.001){const e=y/p;s.x+=-g/p*o*r*2,s.y+=e*o*r*2}}(e.segments,t,o,e.halfWidth,r);if(!e.points)return r.x=0,void(r.y=0);const[s,n,i,a]=e.points;rt(s,n,i,a,t,r);const c=a.x-s.x,l=a.y-s.y,d=Math.sqrt(c*c+l*l);if(d>.001){const t=c/d;r.x+=-l/d*o*e.halfWidth*2,r.y+=t*o*e.halfWidth*2}}function rt(e,t,o,r,s,n){const i=1-s,a=i*i,c=a*i,l=s*s,d=l*s;n.x=c*e.x+3*a*s*t.x+3*i*l*o.x+d*r.x,n.y=c*e.y+3*a*s*t.y+3*i*l*o.y+d*r.y}var st=Object.create(null);function nt(e,t){st[e]=t}function it(e){return st[e]}var at=!1;function ct(e){it(e)||"production"===process.env.NODE_ENV||at||(at=!0,console.warn(`[semiotic] StreamNetworkFrame: no layout plugin registered for "${e}". Import the matching chart HOC (which registers its plugin), or call registerBuiltInNetworkLayouts() from "semiotic/network".`))}import{quadtree as lt}from"d3-quadtree";function dt(e){return{id:e,x0:0,x1:0,y0:0,y1:0,x:0,y:0,width:0,height:0,value:0,createdByFrame:!0}}function ut(e){if(!e||"object"!=typeof e)return!1;const t=e;if("boolean"!=typeof t.circular)return!1;if("number"!=typeof t.halfWidth||!Number.isFinite(t.halfWidth))return!1;if(t.circular){if(!Array.isArray(t.segments)||0===t.segments.length)return!1;for(const e of t.segments)if(!ht(e))return!1;return!0}return ht(t.points)}function ht(e){if(!Array.isArray(e)||4!==e.length)return!1;for(const t of e){if(!t||"object"!=typeof t)return!1;const e=t;if("number"!=typeof e.x||!Number.isFinite(e.x))return!1;if("number"!=typeof e.y||!Number.isFinite(e.y))return!1}return!0}import{interpolateNumber as yt}from"d3-interpolate";var gt="rgba(34, 197, 94, 0.7)",pt=2e3,ft=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],mt=["scene-style","data-paint","accessibility","evidence"],vt=(e,t)=>({retainedData:e,invalidations:t}),bt=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],_t=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],xt=["scene-geometry","data-paint","overlay","accessibility","evidence"],kt=["scene-style","data-paint","accessibility","evidence"],St=["scene-geometry","data-paint","overlay","accessibility","evidence"],wt=[],At={chartType:vt("rebuild",bt),nodeIDAccessor:vt("rebuild",bt),sourceAccessor:vt("rebuild",bt),targetAccessor:vt("rebuild",bt),valueAccessor:vt("rebuild",bt),edgeIdAccessor:vt("rebuild",bt),childrenAccessor:vt("rebuild",bt),hierarchySum:vt("rebuild",bt),orientation:vt("preserve",_t),nodeAlign:vt("preserve",_t),nodePaddingRatio:vt("preserve",_t),nodeWidth:vt("preserve",_t),edgeSort:vt("preserve",_t),iterations:vt("preserve",_t),forceStrength:vt("preserve",_t),padAngle:vt("preserve",_t),groupWidth:vt("preserve",_t),sortGroups:vt("preserve",_t),treeOrientation:vt("preserve",_t),edgeType:vt("preserve",_t),padding:vt("preserve",_t),paddingTop:vt("preserve",_t),orbitMode:vt("preserve",_t),orbitSize:vt("preserve",_t),orbitSpeed:vt("preserve",_t),orbitRevolution:vt("preserve",_t),orbitRevolutionStyle:vt("preserve",_t),orbitEccentricity:vt("preserve",_t),orbitShowRings:vt("preserve",_t),orbitAnimated:vt("preserve",_t),customNetworkLayout:vt("preserve",_t),layoutConfig:vt("preserve",_t),nodeSize:vt("preserve",xt),nodeSizeRange:vt("preserve",xt),colorByDepth:vt("preserve",xt),nodeLabel:vt("preserve",St),showLabels:vt("preserve",St),labelMode:vt("preserve",St),nodeStyle:vt("preserve",kt),edgeStyle:vt("preserve",kt),colorBy:vt("preserve",kt),colorScheme:vt("preserve",kt),themeCategorical:vt("preserve",kt),themeSemantic:vt("preserve",kt),edgeColorBy:vt("preserve",kt),edgeOpacity:vt("preserve",kt),showParticles:vt("preserve",kt),particleStyle:vt("preserve",kt),decay:vt("preserve",kt),pulse:vt("preserve",kt),thresholds:vt("preserve",kt),staleness:vt("preserve",kt),layoutSelection:vt("preserve",kt),clock:vt("preserve",wt),random:vt("preserve",wt),seed:vt("preserve",wt),tensionConfig:vt("preserve",wt),transition:vt("preserve",wt),introAnimation:vt("preserve",wt),onLayoutError:vt("preserve",wt),__skipForceSimulation:vt("preserve",wt),__hierarchyRoot:vt("preserve",wt),__orbitState:vt("preserve",wt),__previousPositions:vt("preserve",wt)},Rt=vt("preserve",_t),Nt=class{constructor(){this.tracker=new J}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}},ft)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},mt):this.recordNoop("restyle")}recordConfig(e){const t=function(e){let t="preserve";const o=new Set;for(const r of e){const e=At[r]??Rt;"rebuild"===e.retainedData&&(t="rebuild");for(const t of e.invalidations)o.add(t)}return{retainedData:t,invalidations:o}}(e);return this.tracker.record({kind:"config",keys:e},t.invalidations)}};function Ct(e){e.customLayoutBackgrounds=null,e.customLayoutOverlays=null,e.customLayoutHtmlMarks=[],e.lastCustomLayoutResult=null}var Et=class e{constructor(e){this.nodes=new Map,this.edges=new Map,this.tension=0,this.layoutVersion=0,this.sceneNodes=[],this.sceneEdges=[],this.labels=[],this.customLayoutBackgrounds=null,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this.customLayoutHtmlMarks=[],this._customLayoutDiagnosticsWarned=new Set,this._customRestyle=void 0,this._customRestyleEdge=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._nodeQuadtree=null,this._maxNodeRadius=0,this._sceneNodesRevision=0,this._nodeQuadtreeRevision=-1,this._nodesArrCache=null,this._edgesArrCache=null,this._arrCacheVersion=-1,this.particlePool=null,this.updateResults=new Nt,this.transition=null,this._hasRenderedOnce=!1,this._boundedPrevSnapshot=null,this._boundedEdgeSnapshot=null,this.lastIngestTime=0,this.nodeTimestamps=new Map,this.edgeTimestamps=new Map,this._decaySortedNodes=null,this._decayAgeMap=null,this.addedNodes=new Set,this.removedNodes=new Set,this.addedEdges=new Set,this.removedEdges=new Set,this.lastTopologyChangeTime=0,this.previousNodeIds=new Set,this.previousEdgeKeys=new Set,this._networkDecayCache=null,this._lastPositionSnapshot=null,this.config=e,this.tensionConfig={...Je,...e.tensionConfig},e.showParticles&&("sankey"===e.chartType||e.customNetworkLayout)&&(this.particlePool=new tt(2e3))}currentTime(){return this.config.clock?.()??fe()}updateConfig(e){const t=this.config,o={...t,...e};t.__orbitState&&(o.__orbitState=t.__orbitState),t.__hierarchyRoot&&(o.__hierarchyRoot=t.__hierarchyRoot),void 0===e.layoutSelection&&null!=t.layoutSelection&&(o.layoutSelection=t.layoutSelection);const r=[...new Set([...Object.keys(t),...Object.keys(o)])].filter(e=>t[e]!==o[e]);this.config=o,this.tensionConfig={...Je,...o.tensionConfig},!o.showParticles||"sankey"!==o.chartType&&!o.customNetworkLayout||this.particlePool||(this.particlePool=new tt(2e3)),this.updateResults.recordConfig(r)}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}ingestHierarchy(e,t){this._boundedPrevSnapshot=new Map;for(const[e,t]of this.nodes)0===t.x0&&0===t.x1&&0===t.y0&&0===t.y1||this._boundedPrevSnapshot.set(e,{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1});this.nodes.clear(),this.edges.clear(),this._decaySortedNodes=null,this._networkDecayCache=null,this.config.__hierarchyRoot=e,this.runLayout(t),this._boundedPrevSnapshot=null,this.updateResults.recordData("replace",1)}ingestBounded(e,t,o,r){const{nodeIDAccessor:s="id",sourceAccessor:n="source",targetAccessor:i="target",valueAccessor:a="value"}=this.config,c="function"==typeof s?s:e=>e[s],l="function"==typeof n?n:e=>e[n],d="function"==typeof i?i:e=>e[i],u="function"==typeof a?a:e=>e[a]??1;this._boundedPrevSnapshot=new Map;for(const[e,t]of this.nodes)0===t.x0&&0===t.x1&&0===t.y0&&0===t.y1||this._boundedPrevSnapshot.set(e,{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1});this._boundedEdgeSnapshot=new Map;for(const[,e]of this.edges)e.sankeyWidth>0&&this._boundedEdgeSnapshot.set(`${"string"==typeof e.source?e.source:e.source.id}\0${"string"==typeof e.target?e.target:e.target.id}`,{y0:e.y0,y1:e.y1,sankeyWidth:e.sankeyWidth});this.nodes.clear(),this.edges.clear(),this._decaySortedNodes=null,this._networkDecayCache=null;for(const t of e){const e=c(t)+"";this.nodes.set(e,{...dt(e),data:t})}for(let e=0;t.length>e;e++){const o=t[e],r=l(o)+"",s=d(o)+"",n=u(o),i=null==n?NaN:Number(n),a=Number.isFinite(i)?i:1;this.nodes.has(r)||this.nodes.set(r,{...dt(r),data:o}),this.nodes.has(s)||this.nodes.set(s,{...dt(s),data:o});const c=`${r}\0${s}\0${e}`,h={source:r,target:s,value:a,y0:0,y1:0,sankeyWidth:0,data:o,_edgeKey:c};o&&"object"==typeof o&&ut(o.bezier)&&(h.bezier=o.bezier),this.edges.set(c,h)}r?.deferLayout||this.runLayout(o),this.updateResults.recordData("replace",e.length+t.length)}ingestBoundedWithResult(e,t,o,r){return this.ingestBounded(e,t,o,r),this.updateResults.last}applyForceLayoutPositions(e,t){for(const[t,o]of Object.entries(e)){const e=this.nodes.get(t);e&&(e.x=o.x,e.y=o.y)}this.config.__skipForceSimulation=!0;try{this.runLayout(t)}finally{this.config.__skipForceSimulation=void 0}}edgeKey(e,t){return`${e}\0${t}`}ingestEdge(e){const{source:t,target:o,value:r}=e,s=0===this.nodes.size;let n=!1;const i=this.currentTime();this.lastIngestTime=i,this._decaySortedNodes=null,this._networkDecayCache=null,this.nodes.has(t)||(this.nodes.set(t,dt(t)),this.nodeTimestamps.set(t,i),this.tension+=this.tensionConfig.newNode,n=!0),this.nodes.has(o)||(this.nodes.set(o,dt(o)),this.nodeTimestamps.set(o,i),this.tension+=this.tensionConfig.newNode,n=!0);const a=this.edgeKey(t,o),c=this.edges.get(a);let l=!1;c?(c.value+=r,this.edgeTimestamps.set(a,i),this.tension+=this.tensionConfig.weightChange,l=!0):(this.edges.set(a,{source:t,target:o,value:r,y0:0,y1:0,sankeyWidth:0}),this.edgeTimestamps.set(a,i),this.tension+=this.tensionConfig.newEdge,n=!0);const d=s||n||l||this.tension>=this.tensionConfig.threshold;return this.updateResults.recordData("ingest",1),d}ingestEdgeWithResult(e){return this.ingestEdge(e),this.updateResults.last}runLayout(e){if(this.config.customNetworkLayout)return this.recordTopologyDiff(),void this.layoutVersion++;const t=it(this.config.chartType);if(!t)return void ct(this.config.chartType);let o=Array.from(this.nodes.values());const r=Array.from(this.edges.values());if(0===o.length&&!t.hierarchical)return;if(this.prepareForRelayout(),t.supportsStreaming&&!t.hierarchical){const e=new Map;for(const t of o)void 0!==t._prevX0?e.set(t.id,{x:(t._prevX0??0)+((t._prevX1??0)-(t._prevX0??0))/2,y:(t._prevY0??0)+((t._prevY1??0)-(t._prevY0??0))/2}):0===t.x&&0===t.y||e.set(t.id,{x:t.x,y:t.y});if(this._lastPositionSnapshot)for(const[t,o]of this._lastPositionSnapshot)e.has(t)||e.set(t,o);this.config.__previousPositions=e.size>0?e:void 0}if(t.computeLayout(o,r,this.config,e),this.config.__previousPositions=void 0,t.hierarchical&&o.length>0){this.nodes.clear(),this.edges.clear(),this._decaySortedNodes=null,this._networkDecayCache=null;for(const e of o)this.nodes.set(e.id,e);for(let e=0;r.length>e;e++){const t=r[e],o=t._edgeKey||`${"string"==typeof t.source?t.source:t.source.id}\0${"string"==typeof t.target?t.target:t.target.id}\0${e}`;t._edgeKey=o,this.edges.set(o,t)}const e=this._boundedPrevSnapshot;if(e&&e.size>0)for(const t of this.nodes.values()){const o=e.get(t.id);o&&(t._prevX0=o.x0,t._prevX1=o.x1,t._prevY0=o.y0,t._prevY1=o.y1)}this._boundedPrevSnapshot=null,this._boundedEdgeSnapshot=null,o=Array.from(this.nodes.values())}this.finalizeLayout();const s=new Map;for(const e of this.nodes.values())0===e.x&&0===e.y||s.set(e.id,{x:e.x,y:e.y});this._lastPositionSnapshot=s,this.saveTargetPositions();const n=o.some(e=>void 0!==e._prevX0&&(0!==e._prevX0||0!==e._prevX1||0!==e._prevY0||0!==e._prevY1)),i=this.config.transition?.duration??this.tensionConfig.transitionDuration,a=["sankey","tree","treemap","circlepack","partition"].includes(this.config.chartType);if(!this._hasRenderedOnce&&this.config.introAnimation&&a&&o.length>0&&i>0){const t=e[0]/2,o=e[1]/2;for(const e of this.nodes.values())e._prevX0=t,e._prevX1=t,e._prevY0=o,e._prevY1=o;for(const e of this.edges.values())e._prevY0=o,e._prevY1=o,e._prevSankeyWidth=0,e._introFromZero=!0;this.restorePreviousPositions(),this.transition={startTime:this.currentTime(),duration:i}}else n&&i>0&&(this.restorePreviousPositions(),this.transition={startTime:this.currentTime(),duration:i});this._hasRenderedOnce=!0,this.recordTopologyDiff(),this.layoutVersion++}recordTopologyDiff(){const e=new Set(this.nodes.keys()),t=new Set(this.edges.keys());this.addedNodes=new Set,this.removedNodes=new Set,this.addedEdges=new Set,this.removedEdges=new Set;for(const t of e)this.previousNodeIds.has(t)||this.addedNodes.add(t);for(const t of this.previousNodeIds)e.has(t)||this.removedNodes.add(t);for(const e of t)this.previousEdgeKeys.has(e)||this.addedEdges.add(e);for(const e of this.previousEdgeKeys)t.has(e)||this.removedEdges.add(e);(this.addedNodes.size>0||this.removedNodes.size>0||this.addedEdges.size>0||this.removedEdges.size>0)&&(this.lastTopologyChangeTime=this.currentTime()),this.previousNodeIds=e,this.previousEdgeKeys=t}restyleScene(e){const t=function({nodes:e,edges:t,restyle:o,restyleEdge:r,baseStyles:s,selection:n}){const i=!(!o&&!r);if(o)for(const t of e){const e=s.get(t)??t.style,r=o(t,n);t.style=r?{...e,...r}:e}if(r)for(const e of t){const t=s.get(e)??e.style,o=r(e,n);e.style=o?{...t,...o}:t}return i}({nodes:this.sceneNodes,edges:this.sceneEdges,restyle:this._customRestyle,restyleEdge:this._customRestyleEdge,baseStyles:this._baseStyles,selection:e});this.markStylePaintPending(),this.updateResults.recordRestyle(t)}buildScene(e){if(this.config.customNetworkLayout){const t=function({config:e,customLayout:t,size:o,nodes:r,edges:s,previousResult:n,revision:i}){const a=O(e.colorScheme,e.themeCategorical,Be),c={nodes:r,edges:s,dimensions:{width:o[0],height:o[1],plot:{x:0,y:0,width:o[0],height:o[1]}},theme:{semantic:e.themeSemantic??{},categorical:[...a]},resolveColor:F(a,e.colorScheme),config:e.layoutConfig??{},selection:e.layoutSelection??null};return A({family:"network",logLabel:"customNetworkLayout",revision:i,hasPreviousResult:null!==n,onLayoutError:e.onLayoutError,run:()=>t(c)})}({config:this.config,customLayout:this.config.customNetworkLayout,size:e,nodes:Array.from(this.nodes.values()),edges:Array.from(this.edges.values()),previousResult:this.lastCustomLayoutResult,revision:this.layoutVersion});if("failure"===t.kind)return this.lastCustomLayoutFailure=t.diagnostic,void(t.preservedLastGoodScene||(this.sceneNodes=[],this.sceneEdges=[],this.labels=[],Ct(this),this._customRestyle=void 0,this._customRestyleEdge=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._sceneNodesRevision++));const o=t.result;return this.sceneNodes=o.sceneNodes??[],this.sceneEdges=o.sceneEdges??[],this.labels=o.labels??[],function(e,t){e.customLayoutBackgrounds=t.backgrounds??null,e.customLayoutOverlays=t.overlays??null,e.customLayoutHtmlMarks=t.htmlMarks??[],e.lastCustomLayoutResult=t}(this,o),this.lastCustomLayoutFailure=null,this._sceneNodesRevision++,this._customRestyle=o.restyle,this._customRestyleEdge=o.restyleEdge,this.hasCustomRestyle=!(!o.restyle&&!o.restyleEdge),this.hasCustomRestyle&&(this._baseStyles=function(e,t){const o=new WeakMap;for(const t of e)o.set(t,t.style);for(const e of t)o.set(e,e.style);return o}(this.sceneNodes,this.sceneEdges),this.restyleScene(this.config.layoutSelection??null)),void D({label:"customNetworkLayout",nodes:this.sceneNodes,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned})}this._customRestyle=void 0,this._customRestyleEdge=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,Ct(this),this.lastCustomLayoutFailure=null;const t=it(this.config.chartType);if(!t)return ct(this.config.chartType),void this._sceneNodesRevision++;const o=t.hierarchical?Array.from(this.nodes.values()):this.nodesArray,r=t.hierarchical?Array.from(this.edges.values()):this.edgesArray,{sceneNodes:s,sceneEdges:n,labels:i}=t.buildScene(o,r,this.config,e);this.sceneNodes=s,this.sceneEdges=n,this.labels=i,this._sceneNodesRevision++}rebuildNodeQuadtree(){let t=0,o=0;for(const e of this.sceneNodes)"circle"===e.type&&e.datum&&(t++,e.r>o&&(o=e.r));if(this._maxNodeRadius=o,e.QUADTREE_THRESHOLD>=t)return void(this._nodeQuadtree=null);const r=[];for(const e of this.sceneNodes)"circle"===e.type&&e.datum&&r.push(e);this._nodeQuadtree=lt().x(e=>e.cx).y(e=>e.cy).addAll(r)}get nodeQuadtree(){return this._nodeQuadtreeRevision!==this._sceneNodesRevision&&(this.rebuildNodeQuadtree(),this._nodeQuadtreeRevision=this._sceneNodesRevision),this._nodeQuadtree}get maxNodeRadius(){return this._maxNodeRadius}_ensureArrays(){this._arrCacheVersion===this.layoutVersion&&this._nodesArrCache&&this._edgesArrCache||(this._nodesArrCache=Array.from(this.nodes.values()),this._edgesArrCache=Array.from(this.edges.values()),this._arrCacheVersion=this.layoutVersion)}get nodesArray(){return this._ensureArrays(),this._nodesArrCache}get edgesArray(){return this._ensureArrays(),this._edgesArrCache}get isAnimating(){const e=it(this.config.chartType);return!!e?.supportsAnimation&&!1!==this.config.orbitAnimated}tickAnimation(e,t){const o=it(this.config.chartType);if(!o?.tick)return!1;const r=o.hierarchical?Array.from(this.nodes.values()):this.nodesArray,s=o.hierarchical?Array.from(this.edges.values()):this.edgesArray;return o.tick(r,s,this.config,e,t)}cancelIntroAnimation(){this.transition=null;for(const e of this.nodes.values())e._prevX0=void 0,e._prevX1=void 0,e._prevY0=void 0,e._prevY1=void 0;for(const e of this.edges.values())e._prevY0=void 0,e._prevY1=void 0,e._prevSankeyWidth=void 0,e._introFromZero=!1}advanceTransition(e){if(!this.transition)return!1;const t=ne(e,this.transition),o=re(t);for(const e of this.nodes.values())void 0===e._targetX0||void 0===e._prevX0||0===e._prevX0&&0===e._prevX1||(e.x0=pe(e._prevX0,e._targetX0,o),e.x1=pe(e._prevX1,e._targetX1,o),e.y0=pe(e._prevY0,e._targetY0,o),e.y1=pe(e._prevY1,e._targetY1,o));for(const e of this.edges.values())void 0!==e._targetY0&&void 0!==e._prevY0&&void 0!==e._prevSankeyWidth&&(e._prevSankeyWidth>0||e._introFromZero)&&(e.y0=pe(e._prevY0,e._targetY0,o),e.y1=pe(e._prevY1,e._targetY1,o),e.sankeyWidth=pe(e._prevSankeyWidth,e._targetSankeyWidth,o));return this.rebuildAllBeziers(),1>t||(this.snapToTargets(),this.transition=null,!1)}prepareForRelayout(){const e=this._boundedPrevSnapshot;for(const t of this.nodes.values()){const o=e?.get(t.id);o&&0===t.x0&&0===t.x1&&0===t.y0&&0===t.y1?(t._prevX0=o.x0,t._prevX1=o.x1,t._prevY0=o.y0,t._prevY1=o.y1):(t._prevX0=t.x0,t._prevX1=t.x1,t._prevY0=t.y0,t._prevY1=t.y1)}const t=this._boundedEdgeSnapshot;for(const e of this.edges.values()){if(t&&0===e.sankeyWidth){const o=t.get(`${"string"==typeof e.source?e.source:e.source.id}\0${"string"==typeof e.target?e.target:e.target.id}`);if(o){e._prevY0=o.y0,e._prevY1=o.y1,e._prevSankeyWidth=o.sankeyWidth;continue}}e._prevY0=e.y0,e._prevY1=e.y1,e._prevSankeyWidth=e.sankeyWidth}this.nodes.size>0&&(this._boundedPrevSnapshot=null,this._boundedEdgeSnapshot=null)}finalizeLayout(){const e="vertical"===this.config.orientation?"down":"right";for(const e of this.nodes.values())if(0!==e.x0||0!==e.x1||0!==e.y0||0!==e.y1)e.width=e.x1-e.x0,e.height=e.y1-e.y0,e.x=e.x0+e.width/2,e.y=e.y0+e.height/2;else{const t=5;e.x0=e.x-t,e.x1=e.x+t,e.y0=e.y-t,e.y1=e.y+t,e.width=2*t,e.height=2*t}for(const t of this.edges.values())t.direction=e,this.updateEdgeBezier(t);this.tension=0}saveTargetPositions(){for(const e of this.nodes.values())e._targetX0=e.x0,e._targetX1=e.x1,e._targetY0=e.y0,e._targetY1=e.y1;for(const e of this.edges.values())e._targetY0=e.y0,e._targetY1=e.y1,e._targetSankeyWidth=e.sankeyWidth}restorePreviousPositions(){for(const e of this.nodes.values())void 0===e._prevX0||0===e._prevX0&&0===e._prevX1||(e.x0=e._prevX0,e.x1=e._prevX1,e.y0=e._prevY0,e.y1=e._prevY1);for(const e of this.edges.values())void 0!==e._prevY0&&void 0!==e._prevSankeyWidth&&e._prevSankeyWidth>0&&(e.y0=e._prevY0,e.y1=e._prevY1,e.sankeyWidth=e._prevSankeyWidth);this.rebuildAllBeziers()}snapToTargets(){for(const e of this.nodes.values())void 0!==e._targetX0&&(e.x0=e._targetX0,e.x1=e._targetX1,e.y0=e._targetY0,e.y1=e._targetY1);for(const e of this.edges.values())void 0!==e._targetY0&&(e.y0=e._targetY0,e.y1=e._targetY1,e.sankeyWidth=e._targetSankeyWidth),e._introFromZero=void 0;this.rebuildAllBeziers()}updateEdgeBezier(e){!function(e,t,o=.5){const r="string"==typeof e.source?t.get(e.source):e.source,s="string"==typeof e.target?t.get(e.target):e.target;!r||!s||(e.bezier=e.circular&&e.circularPathData?function(e){const t=(e._circularWidth||e.sankeyWidth||1)/2,o=e.circularPathData;if(!o)throw Error("buildCircularBezier requires circularPathData");if(e._circularStub){const e=Math.max(15,Math.min(40,.33*(o.rightFullExtent-o.sourceX))),r=Math.max(15,Math.min(40,.33*(o.targetX-o.leftFullExtent)));return{circular:!0,segments:[[{x:o.sourceX,y:o.sourceY},{x:o.sourceX+.33*e,y:o.sourceY},{x:o.sourceX+.66*e,y:o.sourceY},{x:o.sourceX+e,y:o.sourceY}],[{x:o.targetX-r,y:o.targetY},{x:o.targetX-.66*r,y:o.targetY},{x:o.targetX-.33*r,y:o.targetY},{x:o.targetX,y:o.targetY}]],halfWidth:t}}let r;r="down"===e.direction?[{x:o.sourceY,y:o.sourceX},{x:o.sourceY,y:o.rightFullExtent},{x:o.verticalFullExtent,y:o.rightFullExtent},{x:o.verticalFullExtent,y:o.leftFullExtent},{x:o.targetY,y:o.leftFullExtent},{x:o.targetY,y:o.targetX}]:[{x:o.sourceX,y:o.sourceY},{x:o.rightFullExtent,y:o.sourceY},{x:o.rightFullExtent,y:o.verticalFullExtent},{x:o.leftFullExtent,y:o.verticalFullExtent},{x:o.leftFullExtent,y:o.targetY},{x:o.targetX,y:o.targetY}];const s=[];for(let e=0;r.length-1>e;e++){const t=r[e],o=r[e+1],n=o.x-t.x,i=o.y-t.y;s.push([t,{x:t.x+n/3,y:t.y+i/3},{x:t.x+2*n/3,y:t.y+2*i/3},o])}return{circular:!0,segments:s,halfWidth:t}}(e):function(e,t,o,r=.5){const s=(e.sankeyWidth||1)/2;if("down"===e.direction){const n=t.x1,i=o.x0,a=yt(n,i);return{circular:!1,points:[{x:e.y0,y:n},{x:e.y0,y:a(r)},{x:e.y1,y:a(1-r)},{x:e.y1,y:i}],halfWidth:s}}const n=t.x1,i=o.x0,a=yt(n,i);return{circular:!1,points:[{x:n,y:e.y0},{x:a(r),y:e.y0},{x:a(1-r),y:e.y1},{x:i,y:e.y1}],halfWidth:s}}(e,r,s,o))}(e,this.nodes,.5)}rebuildAllBeziers(){for(const e of this.nodes.values())e.width=e.x1-e.x0,e.height=e.y1-e.y0,e.x=e.x0+e.width/2,e.y=e.y0+e.height/2;for(const e of this.edges.values())this.updateEdgeBezier(e)}applyPulse(e){!function(e){const t=e.pulse;if(!t)return;const o=t.duration??500,r=t.color??"rgba(255,255,255,0.6)",s=t.glowRadius??4,{now:n}=e;for(const t of e.sceneNodes){const i=t.id;if(!i)continue;const a=e.nodeTimestamps.get(i);if(!a)continue;const c=n-a;o>c&&(t._pulseIntensity=1-c/o,t._pulseColor=r,t._pulseGlowRadius=s)}for(const t of e.sceneEdges){const s=t.datum;if(!s)continue;const i="object"==typeof s.source?s.source?.id:s.source,a="object"==typeof s.target?s.target?.id:s.target;if(!i||!a)continue;const c=e.edgeTimestamps.get(`${i}\0${a}`);if(!c)continue;const l=n-c;o>l&&(t._pulseIntensity=1-l/o,t._pulseColor=r)}}({sceneNodes:this.sceneNodes,sceneEdges:this.sceneEdges,nodeTimestamps:this.nodeTimestamps,edgeTimestamps:this.edgeTimestamps,pulse:this.config.pulse,now:e})}applyDecay(){this._networkDecayCache||(this._networkDecayCache={sortedNodes:null,ageMap:null}),this._decaySortedNodes||(this._networkDecayCache.sortedNodes=null,this._networkDecayCache.ageMap=null),function(e){const t=e.decay;if(!t)return;const o=e.nodeTimestamps.size;if(1>=o)return;if(!e.cache.sortedNodes){e.cache.sortedNodes=Array.from(e.nodeTimestamps.entries()).sort((e,t)=>e[1]-t[1]);const t=new Map;for(let o=0;e.cache.sortedNodes.length>o;o++)t.set(e.cache.sortedNodes[o][0],o);e.cache.ageMap=t}const r=e.cache.ageMap;for(const s of e.sceneNodes){const e=s.id;if(!e)continue;const n=r.get(e);if(void 0===n)continue;const i=u(t,n,o);s.style={...s.style,opacity:(s.style?.opacity??1)*i}}}({sceneNodes:this.sceneNodes,nodeTimestamps:this.nodeTimestamps,decay:this.config.decay,cache:this._networkDecayCache}),this._decaySortedNodes=this._networkDecayCache.sortedNodes,this._decayAgeMap=this._networkDecayCache.ageMap}applyTopologyDiff(e){!function(e){for(const t of e.sceneNodes)t._pulseColor===gt&&(t._pulseIntensity=0,t._pulseColor=void 0,t._pulseGlowRadius=void 0);if(0===e.addedNodes.size)return;const t=e.now-e.lastTopologyChangeTime;if(t>=pt)return;const o=1-t/pt;for(const t of e.sceneNodes){const r=t.id;r&&e.addedNodes.has(r)&&(t._pulseIntensity=Math.max(t._pulseIntensity??0,o),t._pulseColor=gt,t._pulseGlowRadius=8)}}({sceneNodes:this.sceneNodes,addedNodes:this.addedNodes,lastTopologyChangeTime:this.lastTopologyChangeTime,now:e})}get hasActiveTopologyDiff(){return function(e,t,o=("undefined"!=typeof performance?performance.now():Date.now())){return 0!==e.size&&pt>o-t}(this.addedNodes,this.lastTopologyChangeTime)}applyThresholds(e){!function(e){const t=e.thresholds;if(!t)return;const o=t.warningColor??"#f59e0b",r=t.criticalColor??"#ef4444",s=!1!==t.pulse;for(const n of e.sceneNodes){const i=n.id;if(!i)continue;const a=e.nodes.get(i);if(!a)continue;const c=t.metric(a);let l=null;void 0===t.critical||t.critical>c?void 0===t.warning||t.warning>c||(l=o):l=r,l&&(n.style={...n.style,fill:l},s&&(n._pulseIntensity=.6+.4*Math.sin(e.now/300),n._pulseColor=l,n._pulseGlowRadius=6))}}({sceneNodes:this.sceneNodes,nodes:this.nodes,thresholds:this.config.thresholds,now:e})}get hasActiveThresholds(){return function(e,t){if(!t)return!1;for(const o of e){const e=t.metric(o);if(void 0!==t.warning&&e>=t.warning||void 0!==t.critical&&e>=t.critical)return!0}return!1}(this.nodes.values(),this.config.thresholds)}get hasActivePulses(){return function(e){const t=e.pulse;if(!t||0===e.lastIngestTime)return!1;const o=e.now??("undefined"!=typeof performance?performance.now():Date.now());return(t.duration??500)>o-e.lastIngestTime}({pulse:this.config.pulse,lastIngestTime:this.lastIngestTime})}getLayoutData(){return{nodes:Array.from(this.nodes.values()),edges:Array.from(this.edges.values())}}updateNode(e,t){const o=this.nodes.get(e);if(!o)return this.updateResults.recordNoop("update"),null;const r=o.data?{...o.data}:{};return o.data=t(o.data??{}),this.layoutVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",1),r}updateEdge(e,t,o){const r=this.config.valueAccessor,s="function"==typeof r?r:r?e=>e[r]:e=>e.value,n=[];for(const[,r]of this.edges)if(("string"==typeof r.source?r.source:r.source.id)===e&&("string"==typeof r.target?r.target:r.target.id)===t){n.push(r.data?{...r.data}:{}),r.data=o(r.data??{});const e=s(r.data);null!=e&&(r.value=Number(e))}return n.length>0?(this.layoutVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",n.length)):this.updateResults.recordNoop("update"),n}removeNode(e){if(!this.nodes.has(e))return this.updateResults.recordNoop("remove"),!1;this.nodes.delete(e),this.nodeTimestamps.delete(e);for(const[t,o]of this.edges)("string"==typeof o.source?o.source:o.source.id)!==e&&("string"==typeof o.target?o.target:o.target.id)!==e||(this.edges.delete(t),this.edgeTimestamps.delete(t));return this.layoutVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",1),!0}removeEdge(e,t){const o=[];if(void 0===t){const t=this.config.edgeIdAccessor;if(!t)throw Error("removeEdge(edgeId) requires edgeIdAccessor to be configured. Use removeEdge(sourceId, targetId) instead.");const r="function"==typeof t?t:e=>e?.[t];for(const[t,s]of this.edges)s.data&&r(s.data)===e&&o.push(t)}else for(const[r,s]of this.edges)("string"==typeof s.source?s.source:s.source.id)===e&&("string"==typeof s.target?s.target:s.target.id)===t&&o.push(r);for(const e of o)this.edges.delete(e),this.edgeTimestamps.delete(e);return o.length>0?(this.layoutVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",o.length)):this.updateResults.recordNoop("remove"),o.length>0}clear(){this.nodes.clear(),this.edges.clear(),this._decaySortedNodes=null,this._networkDecayCache=null,this._decayAgeMap=null,this._nodeQuadtree=null,this._nodesArrCache=null,this._edgesArrCache=null,this._sceneNodesRevision++,this.tension=0,this.layoutVersion++,this.sceneNodes=[],this.sceneEdges=[],this.labels=[],Ct(this),this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this._customRestyleEdge=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.transition=null,this._hasRenderedOnce=!1,this.lastIngestTime=0,this._lastPositionSnapshot=null,this.nodeTimestamps.clear(),this.edgeTimestamps.clear(),this.previousNodeIds=new Set,this.previousEdgeKeys=new Set,this.addedNodes=new Set,this.removedNodes=new Set,this.addedEdges=new Set,this.removedEdges=new Set,this.lastTopologyChangeTime=0,this._boundedPrevSnapshot=null,this._boundedEdgeSnapshot=null,this.particlePool&&this.particlePool.clear(),this.updateResults.recordData("clear")}};Et.QUADTREE_THRESHOLD=500;var Tt=Et;c(Tt);import*as Pt from"react";function Dt(e){const t=e.id??e.datum?.id??e.datum?.data?.id??e.datum?.data?.name;return null==t?void 0:t+""}function It(e){if("glyph"===e.type&&e.glyph&&"number"==typeof e.size){const t=e.cx??e.x,o=e.cy??e.y;if("number"!=typeof t||"number"!=typeof o)return null;const r=ze(e.glyph,e.size);return{x:t+r.centerDx,y:o+r.centerDy,r:Math.max(1,r.radius)}}const t=e.cx??(null!=e.x&&null!=e.w?e.x+e.w/2:e.x),o=e.cy??(null!=e.y&&null!=e.h?e.y+e.h/2:e.y);return"number"!=typeof t||"number"!=typeof o?null:{x:t,y:o,r:"number"==typeof e.r?Math.max(1,e.r):"number"==typeof e.outerR?Math.max(1,e.outerR):"number"==typeof e.size?Math.max(1,Xe(e.size)):Math.max(1,e.w??0,e.h??0)/2}}import{Fragment as Lt,jsx as Mt,jsxs as Wt}from"react/jsx-runtime";function Bt(e){const{width:t,height:o,totalWidth:r,totalHeight:s,margin:n,labels:i,title:a,legend:c,legendHoverBehavior:l,legendClickBehavior:d,legendHighlightedCategory:u,legendIsolatedCategories:h,legendPosition:g="right",legendLayout:p,foregroundGraphics:f,sceneNodes:m,annotations:v,onAnnotationActivate:b,onObservation:_,chartId:x,chartType:k,autoPlaceAnnotations:S,svgAnnotationRules:w}=e,A=Ce({onAnnotationActivate:b,onObservation:_,chartId:x,chartType:k}),R=Pt.useMemo(()=>{const e=function(e){if(!e)return;const t=[];for(const o of e){const e=It(o);e&&t.push({pointId:Dt(o),...e})}return t}(m)??[];return{scales:null,width:t,height:o,frameType:"network",pointNodes:e,sceneNodes:m}},[o,m,t]),N=Pt.useMemo(()=>{if(!v)return v;const e=y(v);return S?te({annotations:e,context:R,..."object"==typeof S?S:{}}):e},[v,S,R]),C=Pt.useMemo(()=>ie("network"),[]),E=N?_e(N.filter(e=>"widget"!==e.type),C,w,R):null,T=!0===N?.some(e=>"widget"===e.type&&!0===e._annotationDeferred);return Wt(Lt,{children:[T&&Mt("style",{children:j},"annotation-widget-disclosure-style"),Wt("svg",{role:"img",width:r,height:s,style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[Mt("title",{children:"string"==typeof a?a:"Network Chart"}),Mt("desc",{children:"string"==typeof a?a+" (network data visualization)":"Network data visualization"}),Wt("g",{transform:`translate(${n.left},${n.top})`,children:[i.map((e,t)=>Mt("text",{x:e.x,y:e.y,textAnchor:e.anchor||"start",dominantBaseline:e.baseline||"middle",fontSize:e.fontSize||11,fontWeight:e.fontWeight,fill:e.fill||"var(--semiotic-text, #333)",stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:e.paintOrder,style:{pointerEvents:"none"},children:e.text},"label-"+t)),E,f]}),Mt(K,{title:a,totalWidth:r,marginTop:n.top}),xe({legend:c,totalWidth:r,totalHeight:s,margin:n,legendPosition:g,title:a,legendLayout:p,legendHoverBehavior:l,legendClickBehavior:d,legendHighlightedCategory:u,legendIsolatedCategories:h})]}),N?.filter(e=>"widget"===e.type&&e.nodeId&&m).map((e,t)=>{const o=!0===e._annotationDeferred,r=m.find(t=>t.id===e.nodeId||t.datum?.id===e.nodeId||t.datum?.data?.id===e.nodeId||t.datum?.data?.name===e.nodeId);if(!r)return null;const s=n.left+(r.cx??(null!=r.x&&null!=r.w?r.x+r.w/2:r.x??0)),i=n.top+(r.cy??(null!=r.y&&null!=r.h?r.y+r.h/2:r.y??0)),a=e.dx??0,c=e.dy??-16,l=e.width??32,d=e.height??32,u=e.content??Mt("span",{style:{fontSize:18,cursor:"default"},children:"ℹ️"});return Mt("div",{...ee(e,A),className:o?"annotation-deferred":void 0,"data-annotation-disclosure":o?"deferred":void 0,style:{position:"absolute",left:s+a-l/2,top:i+c-d/2,width:l,height:d,display:"flex",alignItems:"center",justifyContent:"center",zIndex:5},children:u},"widget-"+t)})]})}Bt.displayName="NetworkSVGOverlay";import*as zt from"react";import{jsx as Yt}from"react/jsx-runtime";var Ft={position:"absolute",top:0,left:0,pointerEvents:"none"};function Ot({marks:e,margin:t,selection:o=null,overscan:r=400}){const s=zt.useRef(null),n=function(e,t,o){const[r,s]=zt.useState(null);return zt.useLayoutEffect(()=>{const e=t.current,o=function(e){let t=e?.parentElement??null;for(;t;){const{overflow:e,overflowX:o,overflowY:r}=window.getComputedStyle(t);if(/(auto|scroll|overlay)/.test(`${e} ${r} ${o}`))return t;t=t.parentElement}return null}(e);if(!e||!o)return void s(null);let r=0;const n=()=>{r=0;const t=o.getBoundingClientRect(),n=e.getBoundingClientRect();s(0!==t.width&&0!==t.height?{scroll:{left:t.left,top:t.top,right:t.right,bottom:t.bottom},originX:n.left,originY:n.top}:null)},i=()=>{0===r&&(r=window.requestAnimationFrame(n))};n(),o.addEventListener("scroll",i,{passive:!0});const a=new ResizeObserver(i);return a.observe(o),()=>{0!==r&&window.cancelAnimationFrame(r),o.removeEventListener("scroll",i),a.disconnect()}},[t,e,o]),zt.useMemo(()=>{if(!e||!r)return e;const{scroll:t,originX:s,originY:n}=r,i=t.left-o,a=t.right+o,c=t.top-o,l=t.bottom+o;return e.filter(e=>{const t=s+e.x,o=n+e.y;return!(i>t+e.width||t>a||c>o+e.height||o>l)})},[e,r,o])}(e,s,r);if(!e||0===e.length)return null;const i=Yt("div",{className:"semiotic-network-html-marks",ref:s,style:{...Ft,transform:`translate(${t.left}px, ${t.top}px)`},children:(n??e).map(e=>Yt("div",{className:"semiotic-network-html-mark","data-mark-id":e.id,style:{position:"absolute",transform:`translate(${e.x}px, ${e.y}px)`,width:e.width,height:e.height,pointerEvents:"none"},children:e.content},e.id))});return null!=o?Yt(I,{value:o,children:i}):i}import{jsx as jt,jsxs as Xt}from"react/jsx-runtime";function Ht({props:e,store:t,responsiveRef:o,size:r,margin:s,adjustedWidth:n,adjustedHeight:i,surfaceBackground:a,resolvedBackground:c,resolvedForeground:l}){const{chartType:u,nodes:h,edges:y,data:g,className:p,description:f,title:m,responsiveWidth:v,responsiveHeight:b,summary:_,renderMode:x,legend:S,legendPosition:w,legendLayout:A,legendHoverBehavior:R,legendClickBehavior:N,legendHighlightedCategory:C,legendIsolatedCategories:E,layoutSelection:T,annotations:P,onAnnotationActivate:D,annotationObservationCallback:I,onObservation:M,chartId:W,autoPlaceAnnotations:F,svgAnnotationRules:O}=e;if(t){const e=["tree","cluster","treemap","circlepack","partition","orbit"].includes(u),o=e?g||(Array.isArray(y)?void 0:y):void 0;if(e&&o)t.ingestHierarchy(o,[n,i]),t.buildScene([n,i]);else{const e=de(h),o=Array.isArray(y)?de(y):[];(e.length>0||o.length>0)&&(t.ingestBounded(e,o,[n,i]),t.buildScene([n,i]))}}const j=t?.sceneNodes??[],X=t?.sceneEdges??[],H=t?.labels??[];return Xt("div",{ref:o,className:"stream-network-frame"+(p?" "+p:""),role:"img","aria-label":f||("string"==typeof m?m:"Network chart"),style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:v?"100%":r[0],height:b?"100%":r[1]},children:[jt(U,{summary:_}),Xt("svg",{xmlns:"http://www.w3.org/2000/svg",width:r[0],height:r[1],style:{position:"absolute",left:0,top:0},children:[a?jt("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:r[0],height:r[1],fill:a}):null,jt("g",{transform:`translate(${s.left},${s.top})`,children:d(c,t?.customLayoutBackgrounds)}),Xt("g",{transform:`translate(${s.left},${s.top})`,children:[X.map((e,t)=>k({node:e,index:t,renderMode:x,fallback:()=>z(e,t)})).filter(Boolean),j.map((e,t)=>k({node:e,index:t,renderMode:x,fallback:()=>Y(e,t)})).filter(Boolean),H.map((e,t)=>B(e,t)).filter(Boolean)]})]}),jt(Bt,{width:n,height:i,totalWidth:r[0],totalHeight:r[1],margin:s,labels:H,sceneNodes:j,title:m,legend:S,legendPosition:w,legendLayout:A,legendHoverBehavior:R,legendClickBehavior:N,legendHighlightedCategory:C,legendIsolatedCategories:E,foregroundGraphics:d(l,L(t?.customLayoutOverlays,T??null)),annotations:P,onAnnotationActivate:D,onObservation:I??M,chartId:W,chartType:"StreamNetworkFrame",autoPlaceAnnotations:F,svgAnnotationRules:O,annotationFrame:0}),jt(Ot,{marks:t?.customLayoutHtmlMarks,margin:s,selection:T??null})]})}import{jsx as Gt,jsxs as Vt}from"react/jsx-runtime";var $t=/^(value|amount|total|count|weight|score)$/i;function Qt({data:e}){if("edge"===e.nodeOrEdge){const t=e.data;return t?Vt("div",{className:"semiotic-tooltip",style:ae,children:[Vt("div",{style:{fontWeight:600},children:["object"==typeof t.source?t.source.id:t.source," → ","object"==typeof t.target?t.target.id:t.target]}),null!=t.value&&Vt("div",{style:{marginTop:4,opacity:.8},children:["Value:"," ","number"==typeof t.value?t.value.toLocaleString():t.value+""]})]}):null}const t=e.data;if(!t)return null;const o=t.__hierarchyNode;if(o){const e=[];let r=o;for(;r;){const o=r.data?.name??r.data?.id??t.id;null!=o&&e.unshift(o+""),r=r.parent}e.length>1&&e.shift();const s=e.length-1;return Vt("div",{className:"semiotic-tooltip",style:ae,children:[Gt("div",{children:e.map((e,t)=>Vt("span",{children:[t>0&&Gt("span",{style:{margin:"0 3px",opacity:.5},children:" → "}),t===s?Gt("strong",{children:e}):Gt("span",{style:{opacity:.7},children:e})]},t))}),null!=t.value&&t.value>0&&Gt("div",{style:{marginTop:4,opacity:.8},children:"number"==typeof t.value?t.value.toLocaleString():t.value+""})]})}const r=(t.sourceLinks?.length||0)+(t.targetLinks?.length||0),s=(t.sourceLinks||[]).reduce((e,t)=>e+(t.value||0),0)+(t.targetLinks||[]).reduce((e,t)=>e+(t.value||0),0),n=Ne(t.data??t),i=null!=n.title?n.title+"":t.id,a=n.entries.some(e=>$t.test(e.key));return Vt("div",{className:"semiotic-tooltip",style:ae,children:[Gt("div",{style:{fontWeight:600},children:i}),n.entries.map(e=>Vt("div",{style:{marginTop:4,opacity:.8},children:[e.key,": ",p(e.value)]},e.key)),!a&&null!=t.value&&t.value>0&&Vt("div",{style:{marginTop:4,opacity:.8},children:["Total:"," ","number"==typeof t.value?t.value.toLocaleString():t.value+""]}),r>0&&Vt("div",{style:{marginTop:4,opacity:.8},children:["Connections: ",r,s!==r&&` (weighted: ${s.toLocaleString()})`]})]})}function Kt(e){return e._cachedPath2D&&e._cachedPath2DSource===e.pathD||(e._cachedPath2D=new Path2D(e.pathD),e._cachedPath2DSource=e.pathD),e._cachedPath2D}function qt(e,t){if(!t.pathD)return;e.save();const o=Kt(t);if(t.style.fill&&"none"!==t.style.fill){const r=t._gradient;if(r){const o=e.createLinearGradient(r.x0,r.y0??0,r.x1,r.y1??0),s=t.style.fillOpacity??t.style.opacity??.5,n="string"==typeof t.style.fill?t.style.fill:"#999",i=Oe(e,n)||n;o.addColorStop(0,1===r.from?i:"transparent"),o.addColorStop(1,1===r.to?i:"transparent"),e.fillStyle=o,e.globalAlpha=s}else e.fillStyle=je(e,t.style.fill,"#007bff"),e.globalAlpha=t.style.fillOpacity??t.style.opacity??.5;e.fill(o)}t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=Oe(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth??.5,e.globalAlpha=.5*(t.style.opacity??1),e.stroke(o)),t._pulseIntensity&&t._pulseIntensity>0&&(e.fillStyle=t._pulseColor||"rgba(255,255,255,0.6)",e.globalAlpha=.2*t._pulseIntensity,e.fill(o)),e.restore()}function Ut(e,t){e.save();const o=t.style.stroke||"#999";e.strokeStyle=Oe(e,o)||o,e.lineWidth=t.style.strokeWidth??1,void 0!==t.style.opacity&&(e.globalAlpha=t.style.opacity),t.style.strokeDasharray&&e.setLineDash(t.style.strokeDasharray.split(/[\s,]+/).map(Number)),e.beginPath(),e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.stroke(),t._pulseIntensity&&t._pulseIntensity>0&&(e.setLineDash([]),e.strokeStyle=t._pulseColor||"rgba(255,255,255,0.6)",e.lineWidth=(t.style.strokeWidth??1)+3*t._pulseIntensity,e.globalAlpha=.4*t._pulseIntensity,e.beginPath(),e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.stroke()),e.restore()}function Zt(e,t){if(!t.pathD)return;e.save();const o=Kt(t);t.style.fill&&"none"!==t.style.fill&&(e.fillStyle=je(e,t.style.fill,"#007bff"),e.globalAlpha=t.style.fillOpacity??t.style.opacity??.5,e.fill(o)),t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=Oe(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth??.5,e.globalAlpha=.3*(t.style.opacity??1),e.stroke(o)),t._pulseIntensity&&t._pulseIntensity>0&&(e.fillStyle=t._pulseColor||"rgba(255,255,255,0.6)",e.globalAlpha=.25*t._pulseIntensity,e.fill(o)),e.restore()}function Jt(e,t){if(!t.pathD)return;e.save();const o=Kt(t),r=t.style.stroke||"#999";e.strokeStyle=Oe(e,r)||r,e.lineWidth=t.style.strokeWidth??1,void 0!==t.style.opacity&&(e.globalAlpha=t.style.opacity),e.stroke(o),t.style.fill&&"none"!==t.style.fill&&(e.fillStyle=je(e,t.style.fill,"#007bff"),e.globalAlpha=t.style.fillOpacity??.1,e.fill(o)),e.restore()}function eo(e,t,o,r=30){if(!e.datum)return null;switch(e.type){case"circle":return function(e,t,o,r=30){const s=t-e.cx,n=o-e.cy,i=Math.sqrt(s*s+n*n);return i>f(e.r,r)?null:{type:"node",datum:e.datum,x:e.cx,y:e.cy,distance:i}}(e,t,o,r);case"rect":return function(e,t,o){const r=m(t,o,e);return r.hit?{type:"node",datum:e.datum,x:r.cx,y:r.cy,distance:0}:null}(e,t,o);case"arc":return function(e,t,o){const r=t-e.cx,s=o-e.cy,n=Math.sqrt(r*r+s*s);if(e.innerR-2>n||n>e.outerR+2)return null;const i=b(Math.atan2(s,r)),a=b(e.startAngle),c=b(e.endAngle);if(a>c?i>=a||c>=i:i>=a&&c>=i){const t=(e.startAngle+e.endAngle)/2,o=(e.innerR+e.outerR)/2;return{type:"node",datum:e.datum,x:e.cx+o*Math.cos(t),y:e.cy+o*Math.sin(t),distance:0}}return null}(e,t,o);case"symbol":return function(e,t,o,r=30){const s=t-e.cx,n=o-e.cy,i=Math.sqrt(s*s+n*n);return i>f(Xe(e.size),r)?null:{type:"node",datum:e.datum,x:e.cx,y:e.cy,distance:i}}(e,t,o,r);case"glyph":return function(e,t,o,r=30){const s=ze(e.glyph,e.size),n=e.cx+s.centerDx,i=e.cy+s.centerDy,a=t-n,c=o-i,l=Math.sqrt(a*a+c*c);return l>f(s.radius,r)?null:{type:"node",datum:e.datum,x:n,y:i,distance:l}}(e,t,o,r);default:return null}}Qt.ownsChrome=!0;var to=null,oo=null;function ro(){return oo||((to=document.createElement("canvas")).width=1,to.height=1,oo=to.getContext("2d")),oo}function so(e){if(e._cachedPath2D&&e._cachedPath2DSource===e.pathD)return e._cachedPath2D;try{return e._cachedPath2D=new Path2D(e.pathD),e._cachedPath2DSource=e.pathD,e._cachedPath2D}catch{return null}}function no(e,t,o){switch(e.type){case"bezier":return function(e,t,o){if(!e.pathD)return null;const r=so(e),s=ro();if(!r||!s)return null;try{if(s.isPointInPath(r,t,o))return{type:"edge",datum:e.datum,x:t,y:o,distance:0};const n=s.lineWidth;s.lineWidth=10;const i=s.isPointInStroke(r,t,o);if(s.lineWidth=n,i)return{type:"edge",datum:e.datum,x:t,y:o,distance:4}}catch{}return null}(e,t,o);case"line":return function(e,t,o){const r=e.x2-e.x1,s=e.y2-e.y1,n=r*r+s*s;if(0===n)return null;let i=((t-e.x1)*r+(o-e.y1)*s)/n;i=Math.max(0,Math.min(1,i));const a=e.x1+i*r,c=e.y1+i*s,l=Math.sqrt((t-a)**2+(o-c)**2);return l>5?null:{type:"edge",datum:e.datum,x:a,y:c,distance:l}}(e,t,o);case"ribbon":case"curved":return function(e,t,o){if(!e.pathD)return null;const r=so(e),s=ro();if(!r||!s)return null;try{if(s.isPointInPath(r,t,o))return{type:"edge",datum:e.datum,x:t,y:o,distance:0};const n=s.lineWidth;s.lineWidth=10;const i=s.isPointInStroke(r,t,o);if(s.lineWidth=n,i)return{type:"edge",datum:e.datum,x:t,y:o,distance:4}}catch{}return null}(e,t,o);default:return null}}function io(e){const{clientX:t,clientY:o,canvasRect:r,margin:s,adjustedWidth:n,adjustedHeight:i,sceneNodes:a,sceneEdges:c,nodeQuadtree:l,maxNodeRadius:d,hitRadius:u=30,includeEdges:h=!0}=e,y=t-r.left-s.left,p=o-r.top-s.top;if(0>y||y>n||0>p||p>i)return{kind:"miss-outside"};const f=function(e,t,o,r,s=30,n,i=0,a=!0){let c=null,l=1/0,d=1/0;if(n){const e=g(n,o,r,s,i,e=>e.cx,e=>e.cy,e=>e.r);e&&(c={mark:e.node,type:"node",datum:e.node.datum,x:e.node.cx,y:e.node.cy,distance:e.distance},l=e.distance)}for(const t of e){if(n&&"circle"===t.type)continue;const e=eo(t,o,r,s);if(e)if(e.mark=t,"rect"===t.type){const o=t.w*t.h;d>o&&(c=e,d=o)}else l>e.distance&&(c=e,l=e.distance)}if(c)return c;if(!a)return null;for(const e of t){if(!1===e.interactive)continue;const t=no(e,o,r);t&&(t.mark=e),t&&l>t.distance&&(c=t,l=t.distance)}return c}(a,c,y,p,u,l,d,h);return f?{kind:"hit",hover:oe(f.datum||{},f.x,f.y,{nodeOrEdge:f.type}),mark:f.mark}:{kind:"miss"}}import{useCallback as ao}from"react";var co="StreamNetworkFrame";function lo(e,t,o){return e.nodes=we(t),e.edges=we(o),e.nodes||e.edges}import{jsx as uo,jsxs as ho}from"react/jsx-runtime";var yo=[800,600],go=Ze(Ue(function(c,u){const{chartType:y,nodes:g,edges:p,data:f,initialEdges:m,nodeIDAccessor:b="id",sourceAccessor:k="source",targetAccessor:A="target",valueAccessor:D="value",edgeIdAccessor:I,childrenAccessor:B,hierarchySum:z,orientation:Y="horizontal",nodeAlign:F="justify",nodePaddingRatio:O=.05,nodeWidth:j=15,iterations:K=300,forceStrength:J=.1,layoutExecution:ee="auto",layoutLoadingContent:te,onLayoutStateChange:re,padAngle:ne=.01,groupWidth:ie=20,sortGroups:ae,edgeSort:pe,treeOrientation:fe="vertical",edgeType:_e="curve",padding:xe,paddingTop:we,tensionConfig:Ne,showParticles:Ce=!1,particleStyle:Be,renderMode:ze,nodeStyle:je,edgeStyle:Xe,colorBy:Ue,colorScheme:Ze="category10",edgeColorBy:tt="source",edgeOpacity:ot=.5,colorByDepth:rt=!1,nodeSize:st=8,nodeSizeRange:nt=[5,20],nodeLabel:it,showLabels:at=!0,labelMode:ct,size:lt=yo,responsiveWidth:dt,responsiveHeight:ut,margin:ht,className:yt,background:gt,maxDevicePixelRatio:pt,enableHover:ft=!0,tooltipContent:mt,customHoverBehavior:vt,customClickBehavior:bt,onObservation:_t,annotationObservationCallback:xt,chartId:kt,onTopologyChange:St,annotations:wt,onAnnotationActivate:At,autoPlaceAnnotations:Rt,svgAnnotationRules:Nt,legend:Ct,legendPosition:Et,legendLayout:Pt,legendHoverBehavior:Dt,legendClickBehavior:It,legendHighlightedCategory:Lt,legendIsolatedCategories:Mt,legendCategoryAccessor:Wt,onCategoriesChange:zt,title:Yt,foregroundGraphics:Ft,backgroundGraphics:jt,decay:Xt,pulse:Gt,transition:Vt,animate:$t,staleness:Kt,frameScheduler:eo,clock:to,random:oo,seed:ro,paused:so=!1,suspendWhenHidden:no=!0,thresholds:go,accessibleTable:po=!0,description:fo,summary:mo,orbitMode:vo,orbitSize:bo,orbitSpeed:_o,orbitRevolution:xo,orbitRevolutionStyle:ko,orbitEccentricity:So,orbitShowRings:wo,orbitAnimated:Ao,customNetworkLayout:Ro,onLayoutError:No,layoutConfig:Co,layoutSelection:Eo}=c,To=i(y),Po=Ge(!0),Do=Te({sizeProp:lt,responsiveWidth:dt,responsiveHeight:ut,userMargin:ht,marginDefault:To,title:Yt,legend:Ct,legendPosition:Et,legendLayout:Pt,legendMarginReserved:c.__legendMarginReservedFor===Ct,animate:$t,transitionProp:Vt,frameScheduler:eo,clock:to,random:oo,seed:ro,paused:so,suspendWhenHidden:no,themeDirtyRef:Po}),{reducedMotionRef:Io,responsiveRef:Lo,size:Mo,margin:Wo,adjustedWidth:Bo,adjustedHeight:zo,transition:Yo,introEnabled:Fo,tableId:Oo,rafRef:jo,renderFnRef:Xo,scheduleRender:Ho,frameRuntime:Go,currentTheme:Vo}=Do,{resolvedForeground:$o,resolvedBackground:Qo,themeBackground:Ko,surfaceBackground:qo}=S({foregroundGraphics:Ft,backgroundGraphics:jt,size:Mo,margin:Wo,scales:null,background:gt,themeBackgroundColor:Vo.colors.background}),Uo=De(),Zo=Le(),Jo=Qe(()=>de(g),[g]),er=Qe(()=>Array.isArray(p)?de(p):p,[p]),tr=Qe(()=>({...Je,...Ne}),[Ne]),or=Qe(()=>({...et,...Be}),[Be]),rr=Qe(()=>{return{chartType:(e={chartType:y,clock:Go.now,random:oo,seed:ro,nodeIDAccessor:b,sourceAccessor:k,targetAccessor:A,valueAccessor:D,edgeIdAccessor:I,childrenAccessor:B,hierarchySum:z,orientation:Y,nodeAlign:F,nodePaddingRatio:O,nodeWidth:j,iterations:K,forceStrength:J,padAngle:ne,groupWidth:ie,sortGroups:ae,edgeSort:pe,treeOrientation:fe,edgeType:_e,padding:xe,paddingTop:we,tensionConfig:tr,showParticles:Ce,particleStyle:or,nodeStyle:je,edgeStyle:Xe,nodeLabel:it,showLabels:at,labelMode:ct,colorBy:Ue,colorScheme:Ze,edgeColorBy:tt,edgeOpacity:ot,colorByDepth:rt,nodeSize:st,nodeSizeRange:nt,decay:Xt,pulse:Gt,transition:Yo,introAnimation:Fo,staleness:Kt,thresholds:go,orbitMode:vo,orbitSize:bo,orbitSpeed:_o,orbitRevolution:xo,orbitRevolutionStyle:ko,orbitEccentricity:So,orbitShowRings:wo,orbitAnimated:Ao,customNetworkLayout:Ro,onLayoutError:No,layoutConfig:Co,currentTheme:Vo}).chartType,clock:e.clock,random:e.random,seed:e.seed,nodeIDAccessor:e.nodeIDAccessor,sourceAccessor:e.sourceAccessor,targetAccessor:e.targetAccessor,valueAccessor:e.valueAccessor,edgeIdAccessor:e.edgeIdAccessor,childrenAccessor:e.childrenAccessor,hierarchySum:e.hierarchySum,orientation:e.orientation,nodeAlign:e.nodeAlign,nodePaddingRatio:e.nodePaddingRatio,nodeWidth:e.nodeWidth,iterations:e.iterations,forceStrength:e.forceStrength,padAngle:e.padAngle,groupWidth:e.groupWidth,sortGroups:e.sortGroups,edgeSort:e.edgeSort,treeOrientation:e.treeOrientation,edgeType:e.edgeType,padding:e.padding,paddingTop:e.paddingTop,tensionConfig:e.tensionConfig,showParticles:e.showParticles,particleStyle:e.particleStyle,nodeStyle:e.nodeStyle,edgeStyle:e.edgeStyle,nodeLabel:e.nodeLabel,showLabels:e.showLabels,labelMode:e.labelMode,colorBy:e.colorBy,colorScheme:e.colorScheme,themeCategorical:e.currentTheme?.colors?.categorical,themeSemantic:Me(e.currentTheme),edgeColorBy:e.edgeColorBy,edgeOpacity:e.edgeOpacity,colorByDepth:e.colorByDepth,nodeSize:e.nodeSize,nodeSizeRange:e.nodeSizeRange,decay:e.decay,pulse:e.pulse,transition:e.transition,introAnimation:e.introAnimation,staleness:e.staleness,thresholds:e.thresholds,orbitMode:e.orbitMode,orbitSize:e.orbitSize,orbitSpeed:e.orbitSpeed,orbitRevolution:e.orbitRevolution,orbitRevolutionStyle:e.orbitRevolutionStyle,orbitEccentricity:e.orbitEccentricity,orbitShowRings:e.orbitShowRings,orbitAnimated:e.orbitAnimated,customNetworkLayout:e.customNetworkLayout,onLayoutError:e.onLayoutError,layoutConfig:e.layoutConfig};var e},[y,Go.now,oo,ro,b,k,A,D,I,B,z,Y,F,O,j,K,J,ne,ie,ae,pe,fe,_e,xe,we,tr,Ce,or,je,Xe,it,at,ct,Ue,Ze,tt,ot,rt,st,nt,Xt,Gt,Yo,Fo,Kt,go,vo,bo,_o,xo,ko,So,wo,Ao,Ro,No,Co,Vo]),sr=T(rr),nr=T({chartType:(ir={chartType:y,nodeIDAccessor:b,sourceAccessor:k,targetAccessor:A,valueAccessor:D,edgeIdAccessor:I,childrenAccessor:B,hierarchySum:z,orientation:Y,nodeAlign:F,nodePaddingRatio:O,nodeWidth:j,iterations:K,forceStrength:J,padAngle:ne,groupWidth:ie,sortGroups:ae,edgeSort:pe,treeOrientation:fe,edgeType:_e,padding:xe,paddingTop:we,random:oo,seed:ro,tensionConfig:tr,customNetworkLayout:Ro,orbitMode:vo,orbitSize:bo,orbitEccentricity:So}).chartType,nodeIDAccessor:ir.nodeIDAccessor,sourceAccessor:ir.sourceAccessor,targetAccessor:ir.targetAccessor,valueAccessor:ir.valueAccessor,edgeIdAccessor:ir.edgeIdAccessor,childrenAccessor:ir.childrenAccessor,hierarchySum:ir.hierarchySum,orientation:ir.orientation,nodeAlign:ir.nodeAlign,nodePaddingRatio:ir.nodePaddingRatio,nodeWidth:ir.nodeWidth,iterations:ir.iterations,forceStrength:ir.forceStrength,padAngle:ir.padAngle,groupWidth:ir.groupWidth,sortGroups:ir.sortGroups,edgeSort:ir.edgeSort,treeOrientation:ir.treeOrientation,edgeType:ir.edgeType,padding:ir.padding,paddingTop:ir.paddingTop,random:ir.random,seed:ir.seed,tensionConfig:ir.tensionConfig,customNetworkLayout:ir.customNetworkLayout,orbitMode:ir.orbitMode,orbitSize:ir.orbitSize,orbitEccentricity:ir.orbitEccentricity});var ir;const ar=Ge(0),cr=Ge(0),lr=Ge(!1),dr=Ge(null);dr.current||(dr.current=new Tt(sr));const ur=E(dr,Wt,zt,e=>Array.from(e.nodes.values()).map(e=>e.data?{id:e.id,...e.data}:e)),hr=Ie("StreamNetworkFrame"),yr=Ke((e,t,o=!1)=>Se(hr.current,e,()=>e.buildScene(t),o),[hr]),[gr,pr]=Ve(null),[fr,mr]=Ve(0),[vr,br]=Ve(0),[_r,xr]=Ve(!1),[kr,Sr]=Ve(!1),wr=Ge(0),Ar=Ge(null),Rr=Ge(!1),Nr=Ge(re);Nr.current=re;const Cr=Ge(sr);Cr.current=sr;const Er=Ge(null),Tr=Ge({nodes:!1,edges:!1}),Pr=Ge(new Map),Dr=Ge(0),Ir=Ke(e=>function(e){const{node:t,colorBy:o,colorScheme:r,nodeColorMap:s,colorIndexRef:n}=e;if("function"==typeof o)return o(t)+"";if("string"==typeof o&&t.data){const e=t.data[o];if(void 0!==e){if(!s.has(e+"")){const t=Array.isArray(r)?r:We;s.set(e+"",t[n.current++%t.length])}return s.get(e+"")}}if(s.has(t.id))return s.get(t.id);const i=Array.isArray(r)?r:We,a=o?i[n.current++%i.length]:i[0];return s.set(t.id,a),a}({node:e,colorBy:Ue,colorScheme:Ze,nodeColorMap:Pr.current,colorIndexRef:Dr}),[Ue,Ze]),Lr=Ke(e=>{Dr.current=function(e){const{sceneNodes:t,nodes:o,nodeColorMap:r,colorScheme:s}=e;for(const e of t)e.id&&"string"==typeof e.style?.fill&&r.set(e.id,e.style.fill);const n=Array.isArray(s)?s:We,i=Array.from(o);for(let e=0;i.length>e;e++){const t=i[e];r.has(t.id)||r.set(t.id,n[e%n.length])}return i.length}({sceneNodes:e.sceneNodes,nodes:e.nodes.values(),nodeColorMap:Pr.current,colorScheme:Ze})},[Ze]),Mr=Ke((e,t)=>{yr(e,t),ur(),Lr(e),lo(Tr.current,e.sceneNodes,e.sceneEdges),Po.current=!1,e.markStylePaintPending()},[yr,ur,Lr]),Wr=Ke(()=>{dr.current?.markStylePaintPending()},[]),{canvasRef:Br,resolutionDirtyRef:zr}=Pe(Do,{hydrated:Uo,wasHydratingFromSSR:Zo,storeRef:dr,dirtyRef:Po,skipInitialCanvasPaintInvalidation:!0,canvasPaintInvalidator:Wr,maxDevicePixelRatio:pt,canvasPaintDependencies:[y,Bo,zo,gt,jt,ze,Ho]}),Yr=(Fr=Vo,Fr?.colors?.border||Fr?.colors?.secondary||Fr?.colors?.primary||"#999");var Fr;const Or=Ke(e=>function(e,t){return e?"object"==typeof e?e:t?.get(e)??null:null}(e,dr.current?.nodes),[]),jr=Ke(e=>function(e){const{edge:t,edgeColorBy:o,getNodeColor:r,resolveEndpoint:s,fallback:n}=e;if("function"==typeof o)return o(t);const i=s(t.source),a=s(t.target);return"target"===o&&a?r(a):i?r(i):n}({edge:e,edgeColorBy:tt,getNodeColor:Ir,resolveEndpoint:Or,fallback:Yr}),[tt,Ir,Yr,Or]),Xr=Ke(e=>function(e){const{edge:t,particleStyleColor:o,particleColorBy:r,hasExplicitParticleColorBy:s,getEdgeColor:n,getNodeColor:i,resolveEndpoint:a,fallback:c}=e;if("function"==typeof o){const e=a(t.source);return e?o(t,e):c}if(!s)return n(t);const l=r,d=a(t.source),u=a(t.target);return"target"===l&&u?i(u):d?i(d):c}({edge:e,particleStyleColor:or.color,particleColorBy:or.colorBy,hasExplicitParticleColorBy:!!Be?.colorBy,getEdgeColor:jr,getNodeColor:Ir,resolveEndpoint:Or,fallback:Yr}),[Be?.colorBy,or.color,or.colorBy,Ir,jr,Yr,Or]),Hr=function(e,t,o,r,s){return("sankey"===e||t)&&o||r||s}(y,!!Ro,Ce,!!Gt,dr.current?.isAnimating??!1);N(dr,sr,Po,Ho),C(dr,Eo,Po,Ho),$e(()=>{const e=dr.current;e&&(Mr(e,[Bo,zo]),mr(e=>e+1),Ho())},[Vo,Bo,zo,Mr,Ho]);const Gr=Ke(()=>{const e=dr.current;if(e&&(e.runLayout([Bo,zo]),Mr(e,[Bo,zo]),mr(e.layoutVersion),St)){const{nodes:t,edges:o}=e.getLayoutData();St(t,o)}},[Bo,zo,Mr,St]),Vr=Ge(!1),$r=Ke((e=!1)=>!(!e&&!Vr.current||(Vr.current=!1,Gr(),0)),[Gr]),Qr=Ke(()=>$r(!1),[$r]),Kr=Ke(e=>{const t=dr.current;if(!t)return!1;let o=!1,r=Vr.current;for(const s of e)null!=s&&"object"==typeof s&&(o=!0,t.ingestEdge(s)&&(r=!0));const s=$r(r);return o||s},[$r]),qr=Ke(e=>{if(null==e||"object"!=typeof e)return;const t=dr.current;t&&(t.ingestEdge(e)&&(Vr.current=!0),Go.isActive?Ho():Qr())},[Qr,Go,Ho]),Ur=Ke(e=>{Kr(e)&&Ho()},[Kr,Ho]);$e(()=>Go.subscribe(()=>{Go.isActive||Qr()}),[Qr,Go]);const Zr=Ke(()=>{Vr.current=!1,dr.current?.clear(),ur(),Pr.current.clear(),Dr.current=0,mr(dr.current?.layoutVersion??0),pr(null),Er.current=null,Po.current=!0,Ho()},[ur,Ho]),Jr=Ke(()=>{const e=dr.current;e&&(e.tension+=999,$r(!0),Ho())},[$r,Ho]);qe(u,()=>({push:qr,pushMany:Ur,removeNode:e=>{const t=dr.current?.removeNode(e)??!1;if(t){const t=Er.current?.data?"function"==typeof b?b(Er.current.data):Er.current.data[b]:void 0;Er.current&&"node"===Er.current.nodeOrEdge&&t===e&&(Er.current=null,pr(null)),Pr.current.delete(e)}return $r(t)&&(Po.current=!0,Ho()),t},removeEdge:(e,t)=>{const o=dr.current?.removeEdge(e,t)??!1;if(o&&Er.current&&"edge"===Er.current.nodeOrEdge){const o=Er.current.data;let r;r=void 0!==t?("object"==typeof o?.source?o.source.id:o?.source)===e&&("object"==typeof o?.target?o.target.id:o?.target)===t:!I||!o||("function"==typeof I?I:e=>e?.[I])(o)===e,r&&(Er.current=null,pr(null))}return $r(o)&&(Po.current=!0,Ho()),o},updateNode:(e,t)=>{const o=dr.current?.updateNode(e,t)??null;return $r(null!==o)&&(Po.current=!0,Ho()),o},updateEdge:(e,t,o)=>{const r=dr.current?.updateEdge(e,t,o)??[];return $r(r.length>0)&&(Po.current=!0,Ho()),r},clear:Zr,getTopology:()=>(Qr(),dr.current?.getLayoutData()??{nodes:[],edges:[]}),getCustomLayout:()=>(Qr(),dr.current?.lastCustomLayoutResult??null),getLayoutFailure:()=>(Qr(),dr.current?.lastCustomLayoutFailure??null),getTopologyDiff:()=>{Qr();const e=dr.current;return e?{addedNodes:Array.from(e.addedNodes),removedNodes:Array.from(e.removedNodes),addedEdges:Array.from(e.addedEdges),removedEdges:Array.from(e.removedEdges)}:{addedNodes:[],removedNodes:[],addedEdges:[],removedEdges:[]}},relayout:Jr,getTension:()=>(Qr(),dr.current?.tension??0)}),[qr,Ur,Zr,Jr,Qr,$r,b,Ho,I]);const es=["tree","cluster","treemap","circlepack","partition","orbit"].includes(y),ts=es?f||(Array.isArray(p)?void 0:p):void 0;$e(()=>{const r=dr.current;if(!r)return;const s=++wr.current;if(Ar.current?.abort(),Ar.current=null,es&&ts)Vr.current=!1,r.ingestHierarchy(ts,[Bo,zo]),Mr(r,[Bo,zo]),mr(r.layoutVersion),Sr(!1),Nr.current?.("ready"),Ho();else{const n=Jo,i=Array.isArray(er)?er:[];if(null==g&&null==p||(Vr.current=!1),0===n.length&&0===i.length)return null==g&&null==p||0>=r.nodes.size&&0>=r.edges.size||Zr(),Sr(!1),void Nr.current?.("ready");const a=[Bo,zo],c="force"===y&&!Ro&&e()&&!oo&&o(ee,n.length,i.length,K);if(c&&Zo&&!Rr.current&&r.sceneNodes.length>0)return Rr.current=!0,Sr(!1),Nr.current?.("ready"),Po.current=!0,void Ho();if(c){const e=new AbortController;Ar.current=e;const o=r._lastPositionSnapshot;r.ingestBounded(n,i,a,{deferLayout:!0});const c=r.getLayoutData(),l=t(c.nodes,c.edges,Cr.current,a,o);return Sr(!0),Nr.current?.("pending"),import("./c-CKLIFCGN.min.js").then(({runForceLayoutWorker:t})=>t(l,e.signal)).then(({positions:e})=>{s===wr.current&&(r.applyForceLayoutPositions(e,a),Mr(r,a),Sr(!1),Nr.current?.("ready"),mr(r.layoutVersion),Ho())}).catch(e=>{"AbortError"!==e.name&&s===wr.current&&(r.runLayout(a),Mr(r,a),Sr(!1),Nr.current?.("error"),mr(r.layoutVersion),Ho())}),()=>e.abort()}r.ingestBounded(n,i,a),Mr(r,a),mr(r.layoutVersion),Sr(!1),Nr.current?.("ready"),Ho()}},[Jo,er,g,p,f,ts,es,Bo,zo,nr,ee,K,Zo,y,Ro,oo,Ho,Zr,Mr]);const os=He.useRef(!1);$e(()=>{os.current||m&&m.length>0&&(os.current=!0,Ur(m))},[m,Ur]);const{customHoverBehavior:rs,customClickBehavior:ss}=function({customHoverBehavior:e,customClickBehavior:t,onObservation:o,chartId:r}){return{customHoverBehavior:ao((t,s)=>{e?.(t,s),le({onObservation:o,datum:t?t.data||t:null,x:t?.x,y:t?.y,chartType:co,chartId:r,context:s})},[e,o,r]),customClickBehavior:ao((e,s)=>{t?.(e,s),ce({onObservation:o,datum:e?e.data||e:null,x:e?.x,y:e?.y,chartType:co,chartId:r,context:s})},[t,o,r])}}({customHoverBehavior:vt,customClickBehavior:bt,onObservation:_t,chartId:kt}),{hoverHandlerRef:ns,hoverLeaveRef:is,onPointerMove:as,onPointerLeave:cs,pointerStateRef:ls}=Do,ds=()=>!Ro||(dr.current?.hasCustomRestyle??!1);ns.current=e=>{const t=ds(),o=Br.current;if(!o)return;const r=dr.current;if(!r)return void Re(o);const s=io({clientX:e.clientX,clientY:e.clientY,canvasRect:o.getBoundingClientRect(),margin:Wo,adjustedWidth:Bo,adjustedHeight:zo,sceneNodes:r.sceneNodes,sceneEdges:r.sceneEdges,nodeQuadtree:r.nodeQuadtree,maxNodeRadius:r.maxNodeRadius,includeEdges:ft||Tr.current.edges});Re(o,"hit"===s.kind?Ae(s.mark):void 0),ft&&("hit"===s.kind?(Er.current=s.hover,pr(s.hover),rs?.(s.hover),t&&Ho()):Er.current&&(Er.current=null,pr(null),rs?.(null),t&&Ho()))},is.current=()=>{if(Re(Br.current),Er.current){const e=ds();Er.current=null,pr(null),rs?.(null),e&&Ho()}};const us=Ge(()=>{});us.current=e=>{if(he(e.target))return;if(!bt&&!_t)return;const t=Br.current;if(!t)return;const o=dr.current;if(!o)return;const r=io({clientX:e.clientX,clientY:e.clientY,canvasRect:t.getBoundingClientRect(),margin:Wo,adjustedWidth:Bo,adjustedHeight:zo,sceneNodes:o.sceneNodes,sceneEdges:o.sceneEdges,nodeQuadtree:o.nodeQuadtree,maxNodeRadius:o.maxNodeRadius});"hit"===r.kind?ss(r.hover,{type:"activate",inputType:me(e.nativeEvent.pointerType)}):"miss"===r.kind&&ss(null)};const hs=Ke(e=>us.current(e),[]),ys=Ge(-1),gs=Ge(null),ps=Ge(-1),fs=Ke(e=>{if(ye(e))return;const t=dr.current;if(!t)return;const o=()=>{ys.current=-1,gs.current=null,ps.current=-1,Er.current=null,pr(null),rs?.(null),Ho()},r=h(t.sceneNodes);if(0===r.length)return void(0>ys.current||o());const s=l(r);let n=ys.current;if(s.flat.length>n||(o(),n=-1)," "===e.key&&n>=0){e.preventDefault();const t=s.flat[n];return void ss?.(oe(t.datum||{},t.x,t.y,{nodeOrEdge:"node"}),{type:"activate",inputType:"keyboard"})}if(0>n){if("Escape"===e.key)return;if(!["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End","PageUp","PageDown","Enter"].includes(e.key))return;e.preventDefault(),ys.current=0,ps.current=-1;const t=s.flat[0];gs.current={shape:t.shape,w:t.w,h:t.h};const o=oe(t.datum||{},t.x,t.y,{nodeOrEdge:"node"});return Er.current=o,pr(o),rs?.(o,{type:"focus",inputType:"keyboard"}),void Ho()}const i=w(s,n),a=v(e.key,i,s,t.sceneEdges??[],ps);if(null===a)return;if(e.preventDefault(),0>a)return void o();ys.current=a;const c=s.flat[a];gs.current={shape:c.shape,w:c.w,h:c.h};const d={data:c.datum||{},x:c.x,y:c.y,__semioticHoverData:!0,nodeOrEdge:"node"};Er.current=d,pr(d),rs?.(d,{type:"focus",inputType:"keyboard"}),Ho()},[ss,rs,Ho]),ms=Ke(e=>{R(ls,e,ft,Tr.current.nodes||Tr.current.edges,Br.current,"mouse")&&(ys.current=-1,gs.current=null,as(e))},[Br,ft,as,ls]);Xo.current=()=>{if(jo.current=null,Qr(),!Go.isActive)return;const e=Br.current;if(!e)return;const t=dr.current;t&&function(e){const{canvas:t,store:o,sceneRevisionDiagnostics:i,size:a,margin:c,adjustedWidth:l,adjustedHeight:d,background:u,themeBackground:h,maxDevicePixelRatio:y,renderMode:g,hasBackgroundGraphics:p=!1,dirtyRef:f,resolutionDirtyRef:m,lastFrameTimeRef:v,now:b,random:k,reducedMotion:S,showParticles:w,isContinuous:A,animate:R,decay:N,pulse:C,thresholds:E,staleness:T,particleStyle:P,getParticleColor:D,pendingAnnotationFrameRef:I,lastAnnotationFrameTimeRef:L,setAnnotationFrame:B,scheduleNextFrame:z,syncColorMap:Y,onSceneOrStyleChange:F}=e,O=t.getContext("2d");if(!O)return;const j=v.current?Math.min((b-v.current)/1e3,.1):.016;v.current=b;const X=null!=o.transition,H=o.advanceTransition(S?b+1e6:b),G=!S&&H,V=X&&!H,$=!S&&o.tickAnimation([l,d],j),Q=f.current,K=i?.beforeCompute(o.getLastUpdateResult(),G),q=X||Q||$;q&&(o.buildScene([l,d]),Q&&Y?.()),K&&i?.afterCompute(K,q,!0);const U=w&&!S&&!!o.particlePool,Z=!!N||!!C||!!E||!1!==R&&o.hasActiveTopologyDiff||o.hasActivePulses||o.hasActiveThresholds,J=o.consumeStylePaintPending();(q||J)&&F?.({inventoryChanged:Q||J,geometryChanged:q});const ee=r({dirtyOrRebuilt:q,transitioning:G,animationTicked:$,continuous:U||A,liveEncoding:Z,forced:J||!0===m?.current});m&&(m.current=!1);const te=!!T&&o.lastIngestTime>0&&b-o.lastIngestTime>(T?.threshold??5e3);if(ee){const e=ue(y,a);if(!ve(t,a,c,e))return;if(O.clearRect(-c.left,-c.top,a[0],a[1]),_(O,{background:u,themeBackground:h,hasBackgroundGraphics:p,x:-c.left,y:-c.top,width:a[0],height:a[1]}),N&&o.applyDecay(),C&&o.applyPulse(b),E&&o.applyThresholds(b),!1!==R&&o.applyTopologyDiff(b),te&&(O.globalAlpha=T?.dimOpacity??.5),x({context:O,nodes:o.sceneEdges,renderMode:g,pixelRatio:e,paintBuiltIn:e=>function(e,t){for(const o of t)switch(o.type){case"bezier":qt(e,o);break;case"line":Ut(e,o);break;case"ribbon":Zt(e,o);break;case"curved":Jt(e,o)}}(O,e)}),x({context:O,nodes:o.sceneNodes,renderMode:g,pixelRatio:e,paintBuiltIn:e=>{const t=e;!function(e,t){for(const o of t){if("rect"!==o.type)continue;const t=o;t.w>0&&t.h>0&&(e.save(),void 0!==t.style.opacity&&(e.globalAlpha=t.style.opacity),Ye(e,t.style,"#007bff",()=>e.fillRect(t.x,t.y,t.w,t.h)),Fe(e,t.style,()=>e.strokeRect(t.x,t.y,t.w,t.h)),W(e,t),e.restore())}}(O,t),function(e,t){for(const o of t){if("circle"!==o.type)continue;const t=o;t.r>0&&(e.save(),void 0!==t.style.opacity&&(e.globalAlpha=t.style.opacity),e.beginPath(),e.arc(t.cx,t.cy,t.r,0,2*Math.PI),Ye(e,t.style,"#007bff",()=>e.fill()),Fe(e,t.style,()=>e.stroke()),M(e,t),e.restore())}}(O,t),function(e,t){for(const o of t){if("arc"!==o.type)continue;const t=o;e.save(),void 0!==t.style.opacity&&(e.globalAlpha=t.style.opacity),e.beginPath(),e.arc(t.cx,t.cy,t.outerR,t.startAngle,t.endAngle),e.arc(t.cx,t.cy,t.innerR,t.endAngle,t.startAngle,!0),e.closePath(),Ye(e,t.style,"#007bff",()=>e.fill()),Fe(e,t.style,()=>e.stroke()),e.restore()}}(O,t),s(O,t),n(O,t)}}),U&&!te){const e=o.edgesArray;if(e.length>0){!function(e,t,o,r,s=Math.random){const n=r.spawnRate??.1,i=r.maxPerEdge??50;for(let r=0;t.length>r;r++){const a=t[r];if(!a.bezier)continue;if(e.countForEdge(r)>=i)continue;const c=a.value*n*o*(a.bezier.circular?.3:1),l=Math.floor(c),d=c-l;let u=l;s()<d&&u++;for(let t=0;u>t&&e.countForEdge(r)<i;t++)e.spawn(r,s)}}(o.particlePool,e,j,P,k);const t=.5*(P.speedMultiplier??1);let r;if(P.proportionalSpeed){const t=e.reduce((e,t)=>Math.max(e,t.value||1),1);r=e.map(e=>.3+(e.value||1)/t*1.7)}o.particlePool.step(j,t,e,r),function(e,t,o,r,s){const n=r.radius??3;e.globalAlpha=r.opacity??.7;for(let i=0;t.particles.length>i;i++){const a=t.particles[i];if(!a.active)continue;const c=o[a.edgeIndex];if(!c)continue;let l;l="string"==typeof r.color&&"inherit"!==r.color?r.color:s(c),e.fillStyle=Oe(e,l)||l,e.beginPath(),e.arc(a.x,a.y,n,0,2*Math.PI),e.fill()}e.globalAlpha=1}(O,o.particlePool,e,P,D)}}te&&(O.globalAlpha=1)}f.current=!1,q&&t.setAttribute("aria-label",se(o.sceneNodes?.length??0,o.sceneEdges?.length??0,"Network chart"));const oe=q||I.current;!oe||!V&&33>b-L.current?I.current=!!oe:(B(e=>e+1),L.current=b,I.current=!1),(A||G||null!=o.transition||$||o.hasActivePulses||o.hasActiveThresholds||!1!==R&&o.hasActiveTopologyDiff||I.current)&&z()}({canvas:e,store:t,sceneRevisionDiagnostics:hr.current,size:Mo,margin:Wo,adjustedWidth:Bo,adjustedHeight:zo,background:gt,themeBackground:Ko,maxDevicePixelRatio:pt,renderMode:ze,hasBackgroundGraphics:!(!jt&&!t.customLayoutBackgrounds),dirtyRef:Po,resolutionDirtyRef:zr,lastFrameTimeRef:ar,now:Go.now(),random:Go.random,reducedMotion:!!Io.current,showParticles:Ce,isContinuous:Hr,animate:$t,decay:Xt,pulse:Gt,thresholds:go,staleness:Kt,particleStyle:or,getParticleColor:Xr,pendingAnnotationFrameRef:lr,lastAnnotationFrameTimeRef:cr,setAnnotationFrame:br,scheduleNextFrame:()=>{Ho()},syncColorMap:()=>Lr(t),onSceneOrStyleChange:({inventoryChanged:o,geometryChanged:r})=>{var s;o&&(lo(Tr.current,t.sceneNodes,t.sceneEdges)||Re(e)),(Tr.current.nodes||Tr.current.edges)&&(o||r)&&be((s={canvas:e,pointer:ls.current,store:t,margin:Wo,width:Bo,height:zo,geometryMoved:r,cursorInventory:Tr.current}).canvas,s.pointer,e=>{const t=io({clientX:e.clientX,clientY:e.clientY,canvasRect:s.canvas.getBoundingClientRect(),margin:s.margin,adjustedWidth:s.width,adjustedHeight:s.height,sceneNodes:s.store.sceneNodes,sceneEdges:s.store.sceneEdges,nodeQuadtree:s.geometryMoved?null:s.store.nodeQuadtree,maxNodeRadius:s.geometryMoved?0:s.store.maxNodeRadius,includeEdges:s.cursorInventory.edges});return"hit"===t.kind?Ae(t.mark):void 0})}})},Ee(Br),P(Kt,dr,Po,Ho,Go.now,_r,xr);const vs=ft&&gr?uo(V,{x:gr.x,y:gr.y,containerWidth:Bo,containerHeight:zo,margin:Wo,className:"stream-network-tooltip",zIndex:2,children:mt?mt(gr):uo(Qt,{data:gr})}):null;if(ge||!Uo&&Zo)return uo(Ht,{props:c,store:dr.current,responsiveRef:Lo,size:Mo,margin:Wo,adjustedWidth:Bo,adjustedHeight:zo,surfaceBackground:qo,resolvedBackground:Qo,resolvedForeground:$o});const bs=dr.current;return ho("div",{ref:Lo,className:"stream-network-frame"+(yt?" "+yt:""),role:"group","aria-label":fo||("string"==typeof Yt?Yt:"Network chart"),tabIndex:0,"aria-busy":kr||void 0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:dt?"100%":Mo[0],height:ut?"100%":Mo[1],overflow:"visible"},onKeyDown:fs,children:["production"!==process.env.NODE_ENV&&dr.current&&uo(q,{store:dr.current,diagnostics:hr.current}),po&&ho(X,{accessibleTable:po,children:[uo(Z,{tableId:Oo}),uo(Q,{nodes:bs?.sceneNodes??[],edges:bs?.sceneEdges??[],chartType:"Network chart",tableId:Oo,chartTitle:"string"==typeof Yt?Yt:void 0})]}),uo(U,{summary:mo}),uo(H,{hoverPoint:gr}),ho("div",{role:"img","aria-label":fo||("string"==typeof Yt?Yt:"Network chart"),style:{position:"relative",width:"100%",height:"100%"},onMouseMove:ms,onMouseLeave:cs,onClick:bt||_t?hs:void 0,children:[kr&&!1!==te&&uo("div",{style:{position:"absolute",inset:0,zIndex:3,background:"var(--semiotic-bg, #fff)"},children:ke(!0,Mo[0],Mo[1],te)}),uo(G,{size:Mo,margin:Wo,backdropFill:qo??void 0,overflowVisible:!0,children:d(Qo,bs?.customLayoutBackgrounds)}),uo("canvas",{ref:Br,"aria-label":se(bs?.sceneNodes?.length??0,bs?.sceneEdges?.length??0,"Network chart"),style:{position:"absolute",top:0,left:0}}),uo(Bt,{width:Bo,height:zo,totalWidth:Mo[0],totalHeight:Mo[1],margin:Wo,labels:bs?.labels||[],sceneNodes:bs?.sceneNodes,title:Yt,legend:Ct,legendPosition:Et,legendLayout:Pt,legendHoverBehavior:Dt,legendClickBehavior:It,legendHighlightedCategory:Lt,legendIsolatedCategories:Mt,foregroundGraphics:d($o,L(dr.current?.customLayoutOverlays,Eo??null)),annotations:wt,onAnnotationActivate:At,onObservation:xt??_t,chartId:kt,chartType:"StreamNetworkFrame",autoPlaceAnnotations:Rt,svgAnnotationRules:Nt,annotationFrame:vr}),uo(Ot,{marks:bs?.customLayoutHtmlMarks,margin:Wo,selection:Eo??null}),uo($,{active:ys.current>=0,hoverPoint:gr,margin:Wo,size:Mo,shape:gs.current?.shape,width:gs.current?.w,height:gs.current?.h}),vs,Kt?.showBadge&&uo(a,{isStale:_r,position:Kt.badgePosition})]})]})}));go.displayName="StreamNetworkFrame";var po=go;export{nt as registerLayoutPlugin,po as StreamNetworkFrame_default};
@@ -1 +0,0 @@
1
- import{parseDateLikeString as e}from"./c-W3CE4A4S.min.js";function o(e,o){const s={numbers:[],missing:0,nonFinite:0,nonNumeric:0,zero:0,negative:0,fractional:0};for(const n of e){const e=n?.[o];if(null==e||""===e){s.missing++;continue}let t;if("number"==typeof e)t=e;else if("string"==typeof e){const o=e.trim();if(""===o){s.missing++;continue}const n=Number(o);Number.isNaN(n)?/^[+-]?nan$/i.test(o)&&(t=n):t=n}void 0!==t?Number.isFinite(t)?(s.numbers.push(t),0===t&&s.zero++,0>t&&s.negative++,Number.isInteger(t)||s.fractional++):s.nonFinite++:s.nonNumeric++}return s}function s(e,o){if(0===e.length)return;const s=(e.length-1)*o,n=Math.floor(s),t=Math.ceil(s);if(n===t)return e[n];const r=s-n;return e[n]*(1-r)+e[t]*r}function n(e,n={}){if(!Array.isArray(e)||0===e.length)return{};const t=new Set;for(const o of e)if(o&&"object"==typeof o)for(const e of Object.keys(o))t.add(e);const r={};for(const i of t){const t=o(e,i);let a=1/0,c=-1/0;for(const e of t.numbers)a>e&&(a=e),e>c&&(c=e);const l=!1===n.quantiles?void 0:[...t.numbers].sort((e,o)=>e-o);r[i]={field:i,observedCount:e.length-t.missing,finiteCount:t.numbers.length,missingCount:t.missing,nonFiniteCount:t.nonFinite,nonNumericCount:t.nonNumeric,zeroCount:t.zero,negativeCount:t.negative,fractionalCount:t.fractional,...t.numbers.length>0?{min:a,...l?{q1:s(l,.25),median:s(l,.5),q3:s(l,.75)}:{},max:c}:{}}}return r}function t(e){const o=[`${e.component}: ${e.ok?"✓ numerically safe":"✗ numeric hazards found"}`,`${e.rowCount} rows · ${e.summary.fieldsChecked} numeric fields · ${e.summary.errors} errors · ${e.summary.warnings} warnings`];for(const s of e.diagnoses)o.push(`${"error"===s.severity?"ERROR":"WARN"} ${s.code}${s.field?` [${s.field}]`:""}: ${s.message}`),s.fix&&o.push(" Fix: "+s.fix);return o.join("\n")}function r(e){return e.code.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function i(e,o={}){const s=Number.isFinite(o.max)?Math.max(0,Math.floor(o.max)):6,n=e.diagnoses.map((e,o)=>({item:e,diagnosisIndex:o})).filter(({item:e})=>!o.errorsOnly||"error"===e.severity),t=n.slice(0,s).map(({item:e,diagnosisIndex:o})=>({id:`data-audit:${e.code}:${e.role??"chart"}:${e.field??"chart"}:${o}`,level:e.severity,title:e.field?`${r(e)} · ${e.field}`:r(e),message:e.fix?`${e.message} ${e.fix}`:e.message,source:"Semiotic data audit",dismissible:!0}));return n.length>s&&t.push({id:"data-audit:overflow:chart",level:n.slice(s).some(({item:e})=>"error"===e.severity)?"error":"warning",title:`${n.length-s} more numeric finding${n.length-s===1?"":"s"}`,message:"Run auditData() or diagnoseConfig() to inspect the complete report.",source:"Semiotic data audit",dismissible:!0}),t}function a(e,o){const s=e.nestedDataAccessorProp?o[e.nestedDataAccessorProp]:void 0;return"string"==typeof s?s:e.defaultNestedDataAccessor}function c(e,o,s){const n=e.dataProp??"data",t=o[n],r=s??(Array.isArray(t)?t:[]),i=a(e,o);if(!i)return{dataProp:n,rows:r};const c=[];let l=!1;for(const e of r){const o=e?.[i];if(Array.isArray(o)){l=!0;for(const e of o)e&&"object"==typeof e&&c.push(e)}}return{dataProp:n,rows:l?c:r}}var l=[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date-like",domain:!0},{role:"y",accessor:"yAccessor",defaultAccessor:"y",domain:!0}],u={fields:l},f=[{...l[0],nestedDataAccessorProp:"lineDataAccessor",defaultNestedDataAccessor:"coordinates"},{...l[1],nestedDataAccessorProp:"lineDataAccessor",defaultNestedDataAccessor:"coordinates",allowMissing:!0}],g={fields:f},d={role:"value",accessor:"valueAccessor",defaultAccessor:"value"},m={...d,domain:!0},h={fields:[{...d,requirements:["finite","non-negative"]}],aggregates:[{kind:"positive-total",role:"value"}]},p={fields:[d],aggregates:[{kind:"normalized-total",role:"value",groupAccessor:"categoryAccessor",defaultGroupAccessor:"category",whenProp:"normalize"}]},v={fields:f,aggregates:[{kind:"normalized-total",role:"y",groupAccessor:"xAccessor",defaultGroupAccessor:"x",whenProp:"normalize"}]},w={fields:[...l,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},y={fields:[...l,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},A={fields:[d]},b={fields:[{...d,dataProp:"edges",requirements:["finite","non-negative"],missingValue:1}]},$={LineChart:g,AreaChart:g,BumpChart:g,Scatterplot:y,ConnectedScatterplot:u,QuadrantChart:y,MinimapChart:g,BubbleChart:w,StackedAreaChart:v,DifferenceChart:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date",domain:!0},{role:"value",accessor:"seriesAAccessor",defaultAccessor:"a"},{role:"value",accessor:"seriesBAccessor",defaultAccessor:"b"}]},CandlestickChart:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date-like",domain:!0},{role:"high",accessor:"highAccessor",defaultAccessor:"high",requirements:["finite"]},{role:"low",accessor:"lowAccessor",defaultAccessor:"low",requirements:["finite"]},{role:"open",accessor:"openAccessor",whenProps:["openAccessor","closeAccessor"],requirements:["finite"]},{role:"close",accessor:"closeAccessor",whenProps:["openAccessor","closeAccessor"],requirements:["finite"]}]},Heatmap:A,BarChart:{fields:[d]},GroupedBarChart:{fields:[d]},StackedBarChart:p,DotPlot:{fields:[m]},Histogram:{fields:[m]},BoxPlot:{fields:[m]},SwarmPlot:{fields:[m,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},ViolinPlot:{fields:[m]},RidgelinePlot:{fields:[m]},PieChart:h,DonutChart:h,FunnelChart:h,SankeyDiagram:b,ChordDiagram:b,ProportionalSymbolMap:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"lon",dataProp:"points",requirements:["finite"]},{role:"y",accessor:"yAccessor",defaultAccessor:"lat",dataProp:"points",requirements:["finite"]},{role:"size",accessor:"sizeBy",dataProp:"points",requirements:["finite","non-negative"]}]}},R=Symbol.for("semiotic.numericContractRegistry");function N(){const e=globalThis;return e[R]??(e[R]={contracts:new Map}),e[R]}function x(e,o){o?N().contracts.set(e,o):N().contracts.delete(e)}function z(e){N().contracts.delete(e)}var E={xAccessor:"x",yAccessor:"y",valueAccessor:"value",sizeBy:"size",sizeAccessor:"size",radiusAccessor:"size",countAccessor:"count",amountAccessor:"value",highAccessor:"high",lowAccessor:"low",openAccessor:"open",closeAccessor:"close",lowerAccessor:"lower",upperAccessor:"upper",positiveAccessor:"value",negativeAccessor:"value",progressAccessor:"value",confidenceAccessor:"value",costAccessor:"value",throughputAccessor:"value"};function P(e,o,s){return"function"==typeof e?e(o,s):o[e]}function I(o,s){if("number"==typeof o)return Number.isFinite(o)?o:null;if(o instanceof Date){const e=o.getTime();return s&&Number.isFinite(e)?e:null}if("string"==typeof o){const n=o.trim(),t=Number(n);if(n&&Number.isFinite(t))return t;if("date-like"===s){const o=e(n);return Number.isFinite(o)?o:null}}return null}function C(e){return"number"==typeof e&&!Number.isFinite(e)}function _(e,o,s,n,t){const r={field:s,numbers:[],finiteRows:[],missingRows:[],nonFiniteRows:[],nonNumericRows:[],accessorErrorRows:[],zeroRows:[],negativeRows:[],fractionalRows:[]};for(let s=0;e.length>s;s++){let i;try{i=P(o,e[s],s)}catch{r.accessorErrorRows.push(s);continue}if(null==i||""===i){if(void 0!==t){r.numbers.push(t),r.finiteRows.push(s),0===t&&r.zeroRows.push(s),0>t&&r.negativeRows.push(s),Number.isInteger(t)||r.fractionalRows.push(s);continue}r.missingRows.push(s);continue}const a=I(i,n);null!=a?(r.numbers.push(a),r.finiteRows.push(s),0===a&&r.zeroRows.push(s),0>a&&r.negativeRows.push(s),Number.isInteger(a)||r.fractionalRows.push(s)):C(i)?r.nonFiniteRows.push(s):r.nonNumericRows.push(s)}return r}function S(e,o){const s=new Set(e.requirements??["finite"]);return s.add("finite"),("x"===e.role&&"log"===o.xScaleType||"y"===e.role&&"log"===o.yScaleType)&&s.add("positive"),[...s]}function M(e){return e.slice(0,5)}function O(e){return{domain:"data",...e}}function T(e,o){const n=[],{observation:t,contract:r,accessorLabel:i,requirements:a}=e,c={field:i,role:r.role},l=[...t.nonFiniteRows,...t.nonNumericRows,...t.accessorErrorRows].sort((e,o)=>e-o);if(0===t.numbers.length)return n.push(O({severity:"error",code:"DEGENERATE_EXTENT",message:`${r.accessor}="${i}" produces no finite numeric values; the chart cannot resolve its ${r.role} input.`,fix:`Ensure ${i} contains finite numbers${"x"===r.role?" (or valid dates for a time scale)":""}.`,...c,...l.length>0?{rows:M(l),count:l.length}:{}})),n;t.nonFiniteRows.length>0&&n.push(O({severity:"error",code:"NON_FINITE_VALUE",message:`${i} contains ${t.nonFiniteRows.length} NaN or infinite value${1===t.nonFiniteRows.length?"":"s"}; scale and layout math require finite numbers.`,fix:`Filter or replace NaN/Infinity in ${i} before rendering.`,...c,rows:M(t.nonFiniteRows),count:t.nonFiniteRows.length})),!r.allowMissing&&t.missingRows.length>0&&n.push(O({severity:"error",code:"MISSING_NUMERIC_VALUE",message:`${i} is missing for ${t.missingRows.length} row${1===t.missingRows.length?"":"s"}; the ${r.role} role requires an explicit numeric value.`,fix:`Fill or filter missing ${i} values before rendering.`,...c,rows:M(t.missingRows),count:t.missingRows.length}));const u=[...t.nonNumericRows,...t.accessorErrorRows].sort((e,o)=>e-o);if(u.length>0&&n.push(O({severity:"error",code:"NON_NUMERIC_VALUE",message:`${i} produces ${u.length} non-numeric value${1===u.length?"":"s"} for the ${r.role} role.`,fix:`Bind ${r.accessor} to a numeric field or return finite numbers from the accessor.`,...c,rows:M(u),count:u.length})),r.domain&&t.numbers.length>=2){const[e,o]=function(e){let o=1/0,s=-1/0;for(const n of e)o>n&&(o=n),n>s&&(s=n);return[o,s]}(t.numbers);e===o&&n.push(O({severity:"warning",code:"ZERO_SPAN_DOMAIN",message:`${i} is constant at ${e}; its ${r.role} scale has a zero-span data domain.`,fix:`Provide varying ${r.role} values, set an explicit extent around ${e}, or use a single-value display.`,...c,rows:M(t.finiteRows),count:t.finiteRows.length}))}if(a.includes("positive")){const o=t.numbers.map((e,o)=>({number:e,row:t.finiteRows[o]})).filter(({number:e})=>0>=e).map(({row:e})=>e);if(o.length>0){const s=e.logScale;n.push(O({severity:"error",code:s?"LOG_NON_POSITIVE":"NON_POSITIVE_VALUE",message:`${i} contains ${o.length} non-positive value${1===o.length?"":"s"}, which ${s?"cannot be represented on a log scale":"violate the positive-value contract"}.`,fix:s?"Remove or transform values ≤ 0, or use a linear/symlog scale.":"Provide values greater than zero.",...c,rows:M(o),count:o.length}))}}if(a.includes("non-negative")&&t.negativeRows.length>0&&n.push(O({severity:"error",code:"size"===r.role?"NEGATIVE_SIZE":"NEGATIVE_VALUE",message:`${i} contains ${t.negativeRows.length} negative ${r.role} value${1===t.negativeRows.length?"":"s"}; the chart maps this role to non-negative geometry.`,fix:"Use a non-negative measure, clamp intentionally, or encode sign with position/color instead.",...c,rows:M(t.negativeRows),count:t.negativeRows.length})),a.includes("integer")){const e=[...new Set([...t.negativeRows,...t.zeroRows,...t.fractionalRows])].sort((e,o)=>e-o);e.length>0&&n.push(O({severity:"error",code:"INVALID_COUNT",message:`${i} contains ${e.length} value${1===e.length?"":"s"} that are not positive integers.`,fix:"Counts must be integers ≥ 1; aggregate, round intentionally, or use a continuous-value encoding.",...c,rows:M(e),count:e.length}))}if(a.includes("unit-interval")){const e=t.numbers.map((e,o)=>({number:e,row:t.finiteRows[o]})).filter(({number:e})=>0>e||e>1).map(({row:e})=>e);e.length>0&&n.push(O({severity:"error",code:"OUTSIDE_UNIT_INTERVAL",message:`${i} contains ${e.length} value${1===e.length?"":"s"} outside [0, 1].`,fix:`Normalize ${i} to [0, 1] before using it as ${r.role}.`,...c,rows:M(e),count:e.length}))}if(o&&r.domain){const o=function(e){const o=e.observation.numbers.map((o,s)=>({value:o,row:e.observation.finiteRows[s]})).sort((e,o)=>e.value-o.value);if(8>o.length)return[];const n=o.map(e=>e.value),t=s(n,.25),r=s(n,.75),i=s(n,.5),a=r-t;if(a>0){const e=t-10*a,s=r+10*a;return o.filter(o=>e>o.value||o.value>s).map(e=>e.row)}const c=100*Math.max(1,Math.abs(i));return o.filter(e=>Math.abs(e.value-i)>c).map(e=>e.row)}(e);o.length>0&&n.push(O({severity:"warning",code:"OUTLIER_DOMINATED_DOMAIN",message:`${i} has ${o.length} extreme value${1===o.length?"":"s"} beyond the 10×IQR guardrail; the main distribution may collapse visually.`,fix:"Verify the extreme values, then consider a log scale, robust extent, inset, or explicit annotation rather than silently clipping them.",...c,rows:M(o),count:o.length}))}return n}function k(e,o,s){if(!e)return"__all__";try{return P(e,o,s)+""}catch{return"__accessor_error__"}}function D(e,o,s){if(e.whenProp&&!0!==s[e.whenProp])return[];const n=o.find(o=>o.contract.role===e.role);if(!n||0===n.observation.numbers.length)return[];const t=e.groupAccessor?s[e.groupAccessor]:void 0,r="string"==typeof t||"function"==typeof t?t:e.defaultGroupAccessor,i=new Map;for(let e=0;n.rows.length>e;e++){let o;try{o=P(n.accessor,n.rows[e],e)}catch{continue}const s=I(o,void 0);if(null==s)continue;const t=k(r,n.rows[e],e),a=i.get(t)??{sum:0,magnitude:0,positive:!1,negative:!1,rows:[],negativeRows:[]};a.sum+=s,a.magnitude+=Math.abs(s),a.positive||(a.positive=s>0),a.negative||(a.negative=0>s),a.rows.push(e),0>s&&a.negativeRows.push(e),i.set(t,a)}const a=[],c=[],l=[],u=[],f=[],g=[];for(const[o,s]of i)("positive-total"===e.kind&&0>=s.sum||"normalized-total"===e.kind&&Number.EPSILON*Math.max(1,s.magnitude)*10>=Math.abs(s.sum))&&(a.push(o),u.push(...s.rows)),"normalized-total"===e.kind&&s.positive&&s.negative&&(c.push(o),f.push(...s.rows)),"normalized-total"===e.kind&&s.negative&&(l.push(o),g.push(...s.negativeRows));const d=[];return a.length>0&&d.push(O({severity:"error",code:"normalized-total"===e.kind?"ZERO_NORMALIZED_TOTAL":"NON_POSITIVE_TOTAL",message:"normalized-total"===e.kind?`${a.length} normalization group${1===a.length?" has":"s have"} a zero total, so division would be undefined.`:"The part-to-whole total is not positive, so meaningful shares cannot be computed.",fix:"normalized-total"===e.kind?"Remove empty/zero-sum groups or disable normalization.":"Provide at least one positive value and ensure the total is greater than zero.",field:n.accessorLabel,role:e.role,rows:M([...new Set(u)].sort((e,o)=>e-o)),count:a.length})),l.length>0&&d.push(O({severity:"error",code:"NEGATIVE_NORMALIZED_VALUE",message:`${l.length} normalization group${1===l.length?" contains":"s contain"} negative contributions, so conventional percentage shares are not defined.`,fix:"Use non-negative contributions, a diverging stack, or disable normalization.",field:n.accessorLabel,role:e.role,rows:M([...new Set(g)].sort((e,o)=>e-o)),count:g.length})),c.length>0&&d.push(O({severity:"warning",code:"MIXED_SIGN_NORMALIZATION",message:`${c.length} normalization group${1===c.length?" mixes":"s mix"} positive and negative contributions; percentage shares may be unstable or misleading.`,fix:"Separate positive and negative contributions, use diverging stacks, or disable normalization.",field:n.accessorLabel,role:e.role,rows:M([...new Set(f)].sort((e,o)=>e-o)),count:c.length})),d}function L(e,o,s,n={}){const t=n.contracts??function(e){return N().contracts.get(e)??$[e]}(e)??function(e){const o=[];for(const[s,n]of Object.entries(E))"string"!=typeof e[s]&&"function"!=typeof e[s]||o.push({role:n,accessor:s,..."size"===n?{requirements:["finite","non-negative"]}:{},..."x"===n||"y"===n?{domain:!0}:{}});return o.length>0?{fields:o}:void 0}(o);if(!t)return{component:e,ok:!0,rowCount:s?.length??(Array.isArray(o.data)?o.data.length:0),summary:{fieldsChecked:0,errors:0,warnings:0},contracts:[],diagnoses:[]};const r=function(e,o,s){const n=[],t=new Set;for(const r of e.fields){if(r.whenProps?.some(e=>null==o[e]))continue;const e=o[r.accessor],i="string"==typeof e||"function"==typeof e?e:r.defaultAccessor;if("string"!=typeof i&&"function"!=typeof i)continue;const{dataProp:a,rows:l}=c(r,o,s);if(0===l.length)continue;const u="string"==typeof i?i:r.accessor+"()",f=`${a}:${r.role}:${u}`;if(t.has(f))continue;t.add(f);const g=r.temporalValues??("time"===r.role||"x"===r.role&&"time"===o.xScaleType?"date-like":void 0),d="x"===r.role&&"log"===o.xScaleType||"y"===r.role&&"log"===o.yScaleType,m=S(r,o);n.push({contract:r,accessor:i,accessorLabel:u,dataProp:a,rows:l,requirements:m,logScale:d,observation:_(l,i,u,g,r.missingValue)})}return n}(t,o,s),i=[],l=!1!==n.checkOutliers;for(const e of function(e,o,s){const n=new Set;for(const t of e.fields){const e=t.dataProp??"data",r=s??o[e];if(!Array.isArray(r))continue;if(0===r.length){n.add(e);continue}const i=a(t,o);if(!i)continue;const c=r.map(e=>e?.[i]).filter(Array.isArray);c.length>0&&c.every(e=>0===e.length)&&n.add(`${e}.${i}`)}return[...n]}(t,o,s))i.push(O({severity:"error",code:"EMPTY_DATA",message:e+" is an explicitly empty array; there are no numeric inputs to render.",fix:`Provide at least one valid row, render an intentional empty state, or omit ${e} when using the ref push API.`,count:0,rows:[]}));const u=new Set(r.filter(e=>e.contract.domain&&1===e.rows.length).map(e=>e.dataProp));for(const e of u)i.push(O({severity:"warning",code:"SINGLE_ROW_DOMAIN",message:e+" has one row; a quantitative scale cannot establish variation from a single observation.",fix:"Provide at least two observations or use a single-value display such as BigNumber.",count:1,rows:[0]}));for(const e of r)i.push(...T(e,l));for(const e of t.aggregates??[])i.push(...D(e,r,o));const f=i.filter(e=>"error"===e.severity).length,g=i.length-f;return{component:e,ok:0===f,rowCount:r.reduce((e,o)=>Math.max(e,o.rows.length),s?.length??(Array.isArray(o.data)?o.data.length:0)),summary:{fieldsChecked:r.length,errors:f,warnings:g},contracts:r.map(e=>({role:e.contract.role,accessor:e.accessorLabel,dataProp:e.dataProp,requirements:e.requirements,allowMissing:!0===e.contract.allowMissing,...void 0!==e.contract.missingValue?{missingValue:e.contract.missingValue}:{},domain:!0===e.contract.domain})),diagnoses:i}}export{$ as BUILT_IN_NUMERIC_CONTRACTS,x as registerNumericContracts,z as unregisterNumericContracts,n as profileNumericFields,t as formatDataAudit,i as toDataAuditNotifications,L as auditData};