semiotic 3.8.8 → 3.8.9

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 (104) hide show
  1. package/CLAUDE.md +5 -4
  2. package/README.md +44 -44
  3. package/ai/schema.json +263 -1
  4. package/ai/surface-manifest.json +1 -1
  5. package/ai/system-prompt.md +1 -1
  6. package/dist/chunk-chunk-2X3FJCME.module.min.js +1 -0
  7. package/dist/{chunk-chunk-UEZ6SHW5.module.min.js → chunk-chunk-2ZHHWZQM.module.min.js} +1 -1
  8. package/dist/chunk-chunk-5ZON5NMV.module.min.js +2 -0
  9. package/dist/{chunk-chunk-L6FFYGYS.module.min.js → chunk-chunk-6S3YGYW7.module.min.js} +1 -1
  10. package/dist/chunk-chunk-7C5EDZ3Z.module.min.js +2 -0
  11. package/dist/chunk-chunk-A3I4HBD5.module.min.js +1 -0
  12. package/dist/{chunk-chunk-4MLLQUGW.module.min.js → chunk-chunk-AFQHURLO.module.min.js} +1 -1
  13. package/dist/{chunk-chunk-OG3TTJGJ.module.min.js → chunk-chunk-DDB4TLQG.module.min.js} +1 -1
  14. package/dist/{chunk-chunk-W5HWGQMD.module.min.js → chunk-chunk-DTH3SUOU.module.min.js} +1 -1
  15. package/dist/{chunk-chunk-H5IFO6CU.module.min.js → chunk-chunk-DVCWU7MT.module.min.js} +1 -1
  16. package/dist/{chunk-chunk-JRHXQGEV.module.min.js → chunk-chunk-FSIHAW6L.module.min.js} +1 -1
  17. package/dist/{chunk-chunk-BWV55BZK.module.min.js → chunk-chunk-G2RGVEYY.module.min.js} +1 -1
  18. package/dist/chunk-chunk-HAJVODLO.module.min.js +2 -0
  19. package/dist/{chunk-chunk-BZNOAHJV.module.min.js → chunk-chunk-HIV7AW2V.module.min.js} +1 -1
  20. package/dist/{chunk-chunk-LJDH3WV3.module.min.js → chunk-chunk-JZAMMSQQ.module.min.js} +1 -1
  21. package/dist/{chunk-chunk-VUWYT7DY.module.min.js → chunk-chunk-MXMRXSCI.module.min.js} +1 -1
  22. package/dist/chunk-chunk-MXVBXFKW.module.min.js +2 -0
  23. package/dist/{chunk-chunk-7LE56WAE.module.min.js → chunk-chunk-OFAP623Y.module.min.js} +1 -1
  24. package/dist/{chunk-chunk-SFLUSZ73.module.min.js → chunk-chunk-OHLRAEQZ.module.min.js} +1 -1
  25. package/dist/{chunk-chunk-CD6PVVS3.module.min.js → chunk-chunk-PRNXOCYZ.module.min.js} +1 -1
  26. package/dist/chunk-chunk-RLKZVJMQ.module.min.js +2 -0
  27. package/dist/chunk-chunk-SK2TQMG4.module.min.js +2 -0
  28. package/dist/chunk-chunk-SKLYXNYW.module.min.js +2 -0
  29. package/dist/{chunk-chunk-57RBPDBQ.module.min.js → chunk-chunk-U4NZCU5T.module.min.js} +1 -1
  30. package/dist/{chunk-chunk-QQJNG23C.module.min.js → chunk-chunk-VKL6DI43.module.min.js} +1 -1
  31. package/dist/chunk-chunk-W62673ZE.module.min.js +1 -0
  32. package/dist/{chunk-chunk-WSDJFBKX.module.min.js → chunk-chunk-XCC25CZZ.module.min.js} +1 -1
  33. package/dist/{chunk-chunk-AF53TBSN.module.min.js → chunk-chunk-XECNOUZY.module.min.js} +1 -1
  34. package/dist/{chunk-chunk-FC3NZWYR.module.min.js → chunk-chunk-XYZDTYAF.module.min.js} +1 -1
  35. package/dist/components/Tooltip/Tooltip.d.ts +54 -1
  36. package/dist/components/charts/physics/chainReactionTypes.d.ts +1 -0
  37. package/dist/components/charts/physics/physicsHocUtils.d.ts +1 -1
  38. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +2 -0
  39. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +2 -0
  40. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +2 -0
  41. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +2 -0
  42. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +2 -0
  43. package/dist/components/charts/shared/formatUtils.d.ts +40 -9
  44. package/dist/components/charts/shared/streamPropsHelpers.d.ts +1 -0
  45. package/dist/components/charts/shared/types.d.ts +8 -1
  46. package/dist/components/semiotic-utils-core.d.ts +1 -0
  47. package/dist/components/semiotic.d.ts +4 -3
  48. package/dist/components/stream/GeoTileRenderer.d.ts +1 -0
  49. package/dist/components/stream/canvasSetup.d.ts +15 -4
  50. package/dist/components/stream/geoTypes.d.ts +2 -0
  51. package/dist/components/stream/networkFramePaint.d.ts +8 -0
  52. package/dist/components/stream/networkTypes.d.ts +2 -0
  53. package/dist/components/stream/ordinalTypes.d.ts +2 -0
  54. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +2 -0
  55. package/dist/components/stream/pipelineConfig.d.ts +2 -0
  56. package/dist/components/stream/pipelineDomainResolution.d.ts +1 -1
  57. package/dist/components/stream/types.d.ts +8 -1
  58. package/dist/components/stream/useCanvasFrameHost.d.ts +9 -0
  59. package/dist/components/stream/xyFrameAxisTypes.d.ts +5 -0
  60. package/dist/geo.min.js +1 -1
  61. package/dist/geo.module.min.js +1 -1
  62. package/dist/network.min.js +1 -1
  63. package/dist/network.module.min.js +1 -1
  64. package/dist/ordinal.min.js +1 -1
  65. package/dist/ordinal.module.min.js +1 -1
  66. package/dist/physics.min.js +1 -1
  67. package/dist/physics.module.min.js +1 -1
  68. package/dist/realtime.min.js +1 -1
  69. package/dist/realtime.module.min.js +1 -1
  70. package/dist/semiotic-ai-core.min.js +1 -1
  71. package/dist/semiotic-ai-core.module.min.js +1 -1
  72. package/dist/semiotic-ai.min.js +1 -1
  73. package/dist/semiotic-ai.module.min.js +1 -1
  74. package/dist/semiotic-experimental.min.js +1 -1
  75. package/dist/semiotic-experimental.module.min.js +1 -1
  76. package/dist/semiotic-realtime-core.min.js +1 -1
  77. package/dist/semiotic-realtime-core.module.min.js +1 -1
  78. package/dist/semiotic-server-edge.min.js +1 -1
  79. package/dist/semiotic-server-edge.module.min.js +1 -1
  80. package/dist/semiotic-server-node.min.js +1 -1
  81. package/dist/semiotic-server-node.module.min.js +1 -1
  82. package/dist/semiotic-utils-core.d.ts +1 -0
  83. package/dist/semiotic-utils-core.min.js +1 -1
  84. package/dist/semiotic-utils-core.module.min.js +1 -1
  85. package/dist/semiotic-utils.min.js +1 -1
  86. package/dist/semiotic-utils.module.min.js +1 -1
  87. package/dist/semiotic.d.ts +4 -3
  88. package/dist/semiotic.min.js +1 -1
  89. package/dist/semiotic.module.min.js +1 -1
  90. package/dist/server.min.js +1 -1
  91. package/dist/server.module.min.js +1 -1
  92. package/dist/xy.min.js +1 -1
  93. package/dist/xy.module.min.js +1 -1
  94. package/package.json +1 -1
  95. package/dist/chunk-chunk-3GCILWPB.module.min.js +0 -2
  96. package/dist/chunk-chunk-46KRGJQP.module.min.js +0 -1
  97. package/dist/chunk-chunk-7T25U75Z.module.min.js +0 -2
  98. package/dist/chunk-chunk-BTZYH2IE.module.min.js +0 -1
  99. package/dist/chunk-chunk-FRGBMTZR.module.min.js +0 -1
  100. package/dist/chunk-chunk-HCNDE26Q.module.min.js +0 -2
  101. package/dist/chunk-chunk-JJ4BSUYL.module.min.js +0 -2
  102. package/dist/chunk-chunk-N3Q33XCB.module.min.js +0 -2
  103. package/dist/chunk-chunk-RGJ6TKAH.module.min.js +0 -2
  104. package/dist/chunk-chunk-WGROBM3I.module.min.js +0 -2
@@ -1 +1 @@
1
- import{canUseForceWorker as e,createFrameForceWorkerRequest as t,runForceLayoutWorker as o,shouldUseForceWorker as n}from"./chunk-chunk-FJ76HWQZ.module.min.js";import{ANNOTATION_DISCLOSURE_REVEAL_CSS as s,AriaLiveTooltip as r,CanvasFrameBackground as i,DEFAULT_COLORS as a,FlippingTooltip as c,FocusRing as l,NetworkAccessibleDataTable as d,SceneRevisionDiagnosticsObserver as u,ScreenReaderSummary as h,SkipToTableLink as g,StalenessBadge as p,StreamXYFrame_default as y,TITLE_BASELINE as m,attachUpdateResultStore as f,buildCustomBehaviorProps as v,buildNavGraph as b,buildResolveColor as _,compileMotionEncoding as w,composeOverlays as x,computeDecayOpacity as k,computeEasing as A,computeNetworkAriaLabel as S,computeRawProgress as C,createCustomLayoutFailureDiagnostic as R,createDefaultAnnotationRules as N,deriveMotionVector as T,emitClickObservations as E,emitHoverObservations as I,extractNetworkNavPoints as P,filterSparseArray as M,findHitPointInQuadtree as D,formatVal as z,getDevicePixelRatio as L,getLayoutPlugin as H,isInteractiveKeyboardTarget as W,isServerEnvironment as B,lerp as F,needsDataCanvasPaint as O,networkGlyphRenderer as Y,networkLabelToSVG as j,networkSceneEdgeToSVG as X,networkSceneNodeToSVG as $,networkSymbolRenderer as V,nextNetworkIndex as G,normalizeLinkedBrush as Q,now as q,observationInputType as K,opacityFromAge as U,paintCanvasBackground as Z,paintNetworkFill as J,paintNetworkStroke as ee,paintSceneWithBackend as te,prepareCanvas as oe,renderAnnotationPass as ne,renderCirclePulse as se,renderEmptyState as re,renderLegendFromConfig as ie,renderLoadingState as ae,renderRectPulse as ce,renderSceneWithBackend as le,resolveCanvasFill as de,resolveCustomLayoutPalette as ue,resolveDownwardHistogramExtent as he,resolveMotionAccessor as ge,resolveMotionVector as pe,resolvePosition as ye,runSceneBuild as me,useBrushSelection as fe,useChartLegendAndMargin as ve,useChartMode as be,useChartSelection as _e,useConfigSync as we,useFrame as xe,useFrameCanvasHost as ke,useHydration as Ae,useLayoutSelectionSync as Se,useSceneRevisionDiagnostics as Ce,useStableShallow as Re,useStalenessCheck as Ne,useWasHydratingFromSSR as Te,warnCustomLayoutDiagnostics as Ee}from"./chunk-chunk-BTZYH2IE.module.min.js";import"./chunk-chunk-OZK46A5U.module.min.js";import{IncrementalExtent as Ie,RingBuffer as Pe,annotationActivationProps as Me,buildHoverData as De,defaultTooltipStyle as ze,getHitRadius as Le,hitTestRect as He,isAnnotationActivationTarget as We,normalizeAngle as Be,smartTooltipEntries as Fe,useAnnotationActivationOptions as Oe}from"./chunk-chunk-L6FFYGYS.module.min.js";import{CustomLayoutSelectionProvider as Ye,UpdateResultTracker as je,annotationLayout as Xe,glyphHitGeometry as $e,schemeCategory10 as Ve,symbolRadius as Ge,wrapWithCustomLayoutSelection as Qe}from"./chunk-chunk-LSJUXBMF.module.min.js";import"./chunk-chunk-U66USBWU.module.min.js";import{DEFAULT_LIFECYCLE_THRESHOLDS as qe,bandFromAge as Ke,filterAnnotationsByStatus as Ue}from"./chunk-chunk-5VVNW5AZ.module.min.js";import"./chunk-chunk-NWIGA3UK.module.min.js";import"./chunk-chunk-JJ2OOIET.module.min.js";import{resolveCSSColor as Ze}from"./chunk-chunk-IY7RYD4S.module.min.js";import"./chunk-chunk-J3QOW4OE.module.min.js";import{resolveThemeSemanticColors as Je}from"./chunk-chunk-HADHLMY5.module.min.js";import*as et from"react";import{useRef as tt,useState as ot,useEffect as nt,useMemo as st,useCallback as rt,useImperativeHandle as it,forwardRef as at,memo as ct}from"react";var lt={weightChange:.1,newEdge:.5,newNode:1,threshold:3,transitionDuration:500},dt={radius:3,opacity:.7,speedMultiplier:1,maxPerEdge:50,spawnRate:.1},ut=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 n=this.particles[o];return n.active=!0,n.t=0,n.offset=t()-.5,n.edgeIndex=e,n.x=0,n.y=0,n}step(e,t,o,n){for(let s=0;this.capacity>s;s++){const r=this.particles[s];if(!r.active)continue;const i=o[r.edgeIndex];i&&i.bezier?(r.t+=e*t*(n?n[r.edgeIndex]??1:1)*(i.bezier.circular?.3:1),1>r.t?ht(i.bezier,r.t,r.offset,r):(r.active=!1,this._freeIndices.push(s))):(r.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 ht(e,t,o,n){if(e.circular&&e.segments)return void function(e,t,o,n,s){const r=e.length,i=t*r,a=Math.min(Math.floor(i),r-1),c=i-a,[l,d,u,h]=e[a];gt(l,d,u,h,c,s);const g=h.x-l.x,p=h.y-l.y,y=Math.sqrt(g*g+p*p);if(y>.001){const e=g/y;s.x+=-p/y*o*n*2,s.y+=e*o*n*2}}(e.segments,t,o,e.halfWidth,n);if(!e.points)return n.x=0,void(n.y=0);const[s,r,i,a]=e.points;gt(s,r,i,a,t,n);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;n.x+=-l/d*o*e.halfWidth*2,n.y+=t*o*e.halfWidth*2}}function gt(e,t,o,n,s,r){const i=1-s,a=i*i,c=a*i,l=s*s,d=l*s;r.x=c*e.x+3*a*s*t.x+3*i*l*o.x+d*n.x,r.y=c*e.y+3*a*s*t.y+3*i*l*o.y+d*n.y}import{quadtree as pt}from"d3-quadtree";function yt(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 mt(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(!ft(e))return!1;return!0}return ft(t.points)}function ft(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 vt}from"d3-interpolate";var bt="rgba(34, 197, 94, 0.7)",_t=2e3,wt=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],xt=["scene-style","data-paint","accessibility","evidence"],kt=(e,t)=>({retainedData:e,invalidations:t}),At=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],St=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ct=["scene-geometry","data-paint","overlay","accessibility","evidence"],Rt=["scene-style","data-paint","accessibility","evidence"],Nt=["scene-geometry","data-paint","overlay","accessibility","evidence"],Tt=[],Et={chartType:kt("rebuild",At),nodeIDAccessor:kt("rebuild",At),sourceAccessor:kt("rebuild",At),targetAccessor:kt("rebuild",At),valueAccessor:kt("rebuild",At),edgeIdAccessor:kt("rebuild",At),childrenAccessor:kt("rebuild",At),hierarchySum:kt("rebuild",At),orientation:kt("preserve",St),nodeAlign:kt("preserve",St),nodePaddingRatio:kt("preserve",St),nodeWidth:kt("preserve",St),edgeSort:kt("preserve",St),iterations:kt("preserve",St),forceStrength:kt("preserve",St),padAngle:kt("preserve",St),groupWidth:kt("preserve",St),sortGroups:kt("preserve",St),treeOrientation:kt("preserve",St),edgeType:kt("preserve",St),padding:kt("preserve",St),paddingTop:kt("preserve",St),orbitMode:kt("preserve",St),orbitSize:kt("preserve",St),orbitSpeed:kt("preserve",St),orbitRevolution:kt("preserve",St),orbitRevolutionStyle:kt("preserve",St),orbitEccentricity:kt("preserve",St),orbitShowRings:kt("preserve",St),orbitAnimated:kt("preserve",St),customNetworkLayout:kt("preserve",St),layoutConfig:kt("preserve",St),nodeSize:kt("preserve",Ct),nodeSizeRange:kt("preserve",Ct),colorByDepth:kt("preserve",Ct),nodeLabel:kt("preserve",Nt),showLabels:kt("preserve",Nt),labelMode:kt("preserve",Nt),nodeStyle:kt("preserve",Rt),edgeStyle:kt("preserve",Rt),colorBy:kt("preserve",Rt),colorScheme:kt("preserve",Rt),themeCategorical:kt("preserve",Rt),themeSemantic:kt("preserve",Rt),edgeColorBy:kt("preserve",Rt),edgeOpacity:kt("preserve",Rt),showParticles:kt("preserve",Rt),particleStyle:kt("preserve",Rt),decay:kt("preserve",Rt),pulse:kt("preserve",Rt),thresholds:kt("preserve",Rt),staleness:kt("preserve",Rt),layoutSelection:kt("preserve",Rt),clock:kt("preserve",Tt),random:kt("preserve",Tt),seed:kt("preserve",Tt),tensionConfig:kt("preserve",Tt),transition:kt("preserve",Tt),introAnimation:kt("preserve",Tt),onLayoutError:kt("preserve",Tt),__skipForceSimulation:kt("preserve",Tt),__hierarchyRoot:kt("preserve",Tt),__orbitState:kt("preserve",Tt),__previousPositions:kt("preserve",Tt)},It=kt("preserve",St),Pt=class{constructor(){this.tracker=new je}get last(){return this.tracker.last}subscribe(e){return this.tracker.subscribe(e)}recordData(e,t){return this.tracker.record({kind:e,...void 0===t?{}:{count:t}},wt)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},xt):this.recordNoop("restyle")}recordConfig(e){const t=function(e){let t="preserve";const o=new Set;for(const n of e){const e=Et[n]??It;"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)}},Mt=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.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 Pt,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={...lt,...e.tensionConfig},e.showParticles&&("sankey"===e.chartType||e.customNetworkLayout)&&(this.particlePool=new ut(2e3))}currentTime(){return this.config.clock?.()??q()}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 n=[...new Set([...Object.keys(t),...Object.keys(o)])].filter(e=>t[e]!==o[e]);this.config=o,this.tensionConfig={...lt,...o.tensionConfig},!o.showParticles||"sankey"!==o.chartType&&!o.customNetworkLayout||this.particlePool||(this.particlePool=new ut(2e3)),this.updateResults.recordConfig(n)}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,n){const{nodeIDAccessor:s="id",sourceAccessor:r="source",targetAccessor:i="target",valueAccessor:a="value"}=this.config,c="function"==typeof s?s:e=>e[s],l="function"==typeof r?r:e=>e[r],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,{...yt(e),data:t})}for(let e=0;t.length>e;e++){const o=t[e],n=l(o)+"",s=d(o)+"",r=u(o),i=null==r?NaN:Number(r),a=Number.isFinite(i)?i:1;this.nodes.has(n)||this.nodes.set(n,{...yt(n),data:o}),this.nodes.has(s)||this.nodes.set(s,{...yt(s),data:o});const c=`${n}\0${s}\0${e}`,h={source:n,target:s,value:a,y0:0,y1:0,sankeyWidth:0,data:o,_edgeKey:c};o&&"object"==typeof o&&mt(o.bezier)&&(h.bezier=o.bezier),this.edges.set(c,h)}n?.deferLayout||this.runLayout(o),this.updateResults.recordData("replace",e.length+t.length)}ingestBoundedWithResult(e,t,o,n){return this.ingestBounded(e,t,o,n),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:n}=e,s=0===this.nodes.size;let r=!1;const i=this.currentTime();this.lastIngestTime=i,this._decaySortedNodes=null,this._networkDecayCache=null,this.nodes.has(t)||(this.nodes.set(t,yt(t)),this.nodeTimestamps.set(t,i),this.tension+=this.tensionConfig.newNode,r=!0),this.nodes.has(o)||(this.nodes.set(o,yt(o)),this.nodeTimestamps.set(o,i),this.tension+=this.tensionConfig.newNode,r=!0);const a=this.edgeKey(t,o),c=this.edges.get(a);let l=!1;c?(c.value+=n,this.edgeTimestamps.set(a,i),this.tension+=this.tensionConfig.weightChange,l=!0):(this.edges.set(a,{source:t,target:o,value:n,y0:0,y1:0,sankeyWidth:0}),this.edgeTimestamps.set(a,i),this.tension+=this.tensionConfig.newEdge,r=!0);const d=s||r||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=H(this.config.chartType);if(!t)return;let o=Array.from(this.nodes.values());const n=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,n,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;n.length>e;e++){const t=n[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 r=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 r&&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:n,baseStyles:s,selection:r}){const i=!(!o&&!n);if(o)for(const t of e){const e=s.get(t)??t.style,n=o(t,r);t.style=n?{...e,...n}:e}if(n)for(const e of t){const t=s.get(e)??e.style,o=n(e,r);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:n,edges:s,previousResult:r,revision:i}){const a=ue(e.colorScheme,e.themeCategorical,Ve),c={nodes:n,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:_(a,e.colorScheme),config:e.layoutConfig??{},selection:e.layoutSelection??null};try{return{kind:"success",result:t(c)}}catch(t){const o=null!==r,n=R("network",t,o,i);"production"!==process.env.NODE_ENV&&console.error("[semiotic] customNetworkLayout threw:",t);try{e.onLayoutError?.(n)}catch(e){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",e)}return{kind:"failure",diagnostic:n,preservedLastGoodScene:o}}}({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=[],this.customLayoutOverlays=null,this.customLayoutHtmlMarks=[],this.lastCustomLayoutResult=null,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??[],this.customLayoutOverlays=o.overlays??null,this.customLayoutHtmlMarks=o.htmlMarks??[],this.lastCustomLayoutResult=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 Ee({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,this.customLayoutOverlays=null,this.customLayoutHtmlMarks=[],this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null;const t=H(this.config.chartType);if(!t)return void this._sceneNodesRevision++;const o=t.hierarchical?Array.from(this.nodes.values()):this.nodesArray,n=t.hierarchical?Array.from(this.edges.values()):this.edgesArray,{sceneNodes:s,sceneEdges:r,labels:i}=t.buildScene(o,n,this.config,e);this.sceneNodes=s,this.sceneEdges=r,this.labels=i,this._sceneNodesRevision++}rebuildNodeQuadtree(){let t=0,o=0;for(const e of this.sceneNodes)"circle"===e.type&&(t++,e.r>o&&(o=e.r));if(this._maxNodeRadius=o,e.QUADTREE_THRESHOLD>=t)return void(this._nodeQuadtree=null);const n=Array(t);let s=0;for(const e of this.sceneNodes)"circle"===e.type&&(n[s++]=e);this._nodeQuadtree=pt().x(e=>e.cx).y(e=>e.cy).addAll(n)}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=H(this.config.chartType);return!!e?.supportsAnimation&&!1!==this.config.orbitAnimated}tickAnimation(e,t){const o=H(this.config.chartType);if(!o?.tick)return!1;const n=o.hierarchical?Array.from(this.nodes.values()):this.nodesArray,s=o.hierarchical?Array.from(this.edges.values()):this.edgesArray;return o.tick(n,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=C(e,this.transition),o=A(t);for(const e of this.nodes.values())void 0===e._targetX0||void 0===e._prevX0||0===e._prevX0&&0===e._prevX1||(e.x0=F(e._prevX0,e._targetX0,o),e.x1=F(e._prevX1,e._targetX1,o),e.y0=F(e._prevY0,e._targetY0,o),e.y1=F(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=F(e._prevY0,e._targetY0,o),e.y1=F(e._prevY1,e._targetY1,o),e.sankeyWidth=F(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 n="string"==typeof e.source?t.get(e.source):e.source,s="string"==typeof e.target?t.get(e.target):e.target;!n||!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))),n=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-n,y:o.targetY},{x:o.targetX-.66*n,y:o.targetY},{x:o.targetX-.33*n,y:o.targetY},{x:o.targetX,y:o.targetY}]],halfWidth:t}}let n;n="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;n.length-1>e;e++){const t=n[e],o=n[e+1],r=o.x-t.x,i=o.y-t.y;s.push([t,{x:t.x+r/3,y:t.y+i/3},{x:t.x+2*r/3,y:t.y+2*i/3},o])}return{circular:!0,segments:s,halfWidth:t}}(e):function(e,t,o,n=.5){const s=(e.sankeyWidth||1)/2;if("down"===e.direction){const r=t.x1,i=o.x0,a=vt(r,i);return{circular:!1,points:[{x:e.y0,y:r},{x:e.y0,y:a(n)},{x:e.y1,y:a(1-n)},{x:e.y1,y:i}],halfWidth:s}}const r=t.x1,i=o.x0,a=vt(r,i);return{circular:!1,points:[{x:r,y:e.y0},{x:a(n),y:e.y0},{x:a(1-n),y:e.y1},{x:i,y:e.y1}],halfWidth:s}}(e,n,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,n=t.color??"rgba(255,255,255,0.6)",s=t.glowRadius??4,{now:r}=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=r-a;o>c&&(t._pulseIntensity=1-c/o,t._pulseColor=n,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=r-c;o>l&&(t._pulseIntensity=1-l/o,t._pulseColor=n)}}({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 n=e.cache.ageMap;for(const s of e.sceneNodes){const e=s.id;if(!e)continue;const r=n.get(e);if(void 0===r)continue;const i=k(t,r,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===bt&&(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>=_t)return;const o=1-t/_t;for(const t of e.sceneNodes){const n=t.id;n&&e.addedNodes.has(n)&&(t._pulseIntensity=Math.max(t._pulseIntensity??0,o),t._pulseColor=bt,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&&_t>o-t}(this.addedNodes,this.lastTopologyChangeTime)}applyThresholds(e){!function(e){const t=e.thresholds;if(!t)return;const o=t.warningColor??"#f59e0b",n=t.criticalColor??"#ef4444",s=!1!==t.pulse;for(const r of e.sceneNodes){const i=r.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=n,l&&(r.style={...r.style,fill:l},s&&(r._pulseIntensity=.6+.4*Math.sin(e.now/300),r._pulseColor=l,r._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 n=o.data?{...o.data}:{};return o.data=t(o.data??{}),this.layoutVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",1),n}updateEdge(e,t,o){const n=this.config.valueAccessor,s="function"==typeof n?n:n?e=>e[n]:e=>e.value,r=[];for(const[,n]of this.edges)if(("string"==typeof n.source?n.source:n.source.id)===e&&("string"==typeof n.target?n.target:n.target.id)===t){r.push(n.data?{...n.data}:{}),n.data=o(n.data??{});const e=s(n.data);null!=e&&(n.value=Number(e))}return r.length>0?(this.layoutVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",r.length)):this.updateResults.recordNoop("update"),r}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 n="function"==typeof t?t:e=>e?.[t];for(const[t,s]of this.edges)s.data&&n(s.data)===e&&o.push(t)}else for(const[n,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(n);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=[],this.customLayoutOverlays=null,this.customLayoutHtmlMarks=[],this.lastCustomLayoutResult=null,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")}};Mt.QUADTREE_THRESHOLD=500;var Dt=Mt;f(Dt);import*as zt from"react";import{Fragment as Lt,jsx as Ht,jsxs as Wt}from"react/jsx-runtime";function Bt(e){const{width:t,height:o,totalWidth:n,totalHeight:r,margin:i,labels:a,title:c,legend:l,legendHoverBehavior:d,legendClickBehavior:u,legendHighlightedCategory:h,legendIsolatedCategories:g,legendPosition:p="right",legendLayout:y,foregroundGraphics:f,sceneNodes:v,annotations:b,onAnnotationActivate:_,onObservation:w,chartId:x,chartType:k,autoPlaceAnnotations:A,svgAnnotationRules:S}=e,C=Oe({onAnnotationActivate:_,onObservation:w,chartId:x,chartType:k}),R=zt.useMemo(()=>{const e=(v||[]).flatMap(e=>{const t=function(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 n=$e(e.glyph,e.size);return{x:t+n.centerDx,y:o+n.centerDy,r:Math.max(1,n.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,Ge(e.size)):Math.max(1,e.w??0,e.h??0)/2}}(e),o=function(e){const t=e.id??e.datum?.id??e.datum?.data?.id??e.datum?.data?.name;return null==t?void 0:t+""}(e);return t?[{pointId:o,...t}]:[]});return{scales:null,width:t,height:o,frameType:"network",pointNodes:e,sceneNodes:v}},[o,v,t]),T=zt.useMemo(()=>{if(!b)return b;const e=Ue(b);return A?Xe({annotations:e,context:R,..."object"==typeof A?A:{}}):e},[b,A,R]),E=zt.useMemo(()=>N("network"),[]),I=T?ne(T.filter(e=>"widget"!==e.type),E,S,R):null,P=!0===T?.some(e=>"widget"===e.type&&!0===e._annotationDeferred);return Wt(Lt,{children:[P&&Ht("style",{children:s},"annotation-widget-disclosure-style"),Wt("svg",{role:"img",width:n,height:r,style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[Ht("title",{children:"string"==typeof c?c:"Network Chart"}),Ht("desc",{children:"string"==typeof c?c+" (network data visualization)":"Network data visualization"}),Wt("g",{transform:`translate(${i.left},${i.top})`,children:[a.map((e,t)=>Ht("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)),I,f]}),c&&"string"==typeof c?Ht("text",{x:n/2,y:m,textAnchor:"middle",fontWeight:600,fill:"currentColor",fontSize:14,className:"semiotic-chart-title",style:{fontSize:"var(--semiotic-title-font-size, 14px)"},children:c}):c?Ht("foreignObject",{x:0,y:0,width:n,height:i.top,children:c}):null,ie({legend:l,totalWidth:n,totalHeight:r,margin:i,legendPosition:p,title:c,legendLayout:y,legendHoverBehavior:d,legendClickBehavior:u,legendHighlightedCategory:h,legendIsolatedCategories:g})]}),T?.filter(e=>"widget"===e.type&&e.nodeId&&v).map((e,t)=>{const o=!0===e._annotationDeferred,n=v.find(t=>t.id===e.nodeId||t.datum?.id===e.nodeId||t.datum?.data?.id===e.nodeId||t.datum?.data?.name===e.nodeId);if(!n)return null;const s=i.left+(n.cx??(null!=n.x&&null!=n.w?n.x+n.w/2:n.x??0)),r=i.top+(n.cy??(null!=n.y&&null!=n.h?n.y+n.h/2:n.y??0)),a=e.dx??0,c=e.dy??-16,l=e.width??32,d=e.height??32,u=e.content??Ht("span",{style:{fontSize:18,cursor:"default"},children:"ℹ️"});return Ht("div",{...Me(e,C),className:o?"annotation-deferred":void 0,"data-annotation-disclosure":o?"deferred":void 0,style:{position:"absolute",left:s+a-l/2,top:r+c-d/2,width:l,height:d,display:"flex",alignItems:"center",justifyContent:"center",zIndex:5},children:u},"widget-"+t)})]})}Bt.displayName="NetworkSVGOverlay";import*as Ft from"react";import{jsx as Ot}from"react/jsx-runtime";var Yt={position:"absolute",top:0,left:0,pointerEvents:"none"};function jt({marks:e,margin:t,selection:o=null,overscan:n=400}){const s=Ft.useRef(null),r=function(e,t,o){const[n,s]=Ft.useState(null);return Ft.useLayoutEffect(()=>{const e=t.current,o=function(e){let t=e?.parentElement??null;for(;t;){const{overflow:e,overflowX:o,overflowY:n}=window.getComputedStyle(t);if(/(auto|scroll|overlay)/.test(`${e} ${n} ${o}`))return t;t=t.parentElement}return null}(e);if(!e||!o)return void s(null);let n=0;const r=()=>{n=0;const t=o.getBoundingClientRect(),r=e.getBoundingClientRect();s(0!==t.width&&0!==t.height?{scroll:{left:t.left,top:t.top,right:t.right,bottom:t.bottom},originX:r.left,originY:r.top}:null)},i=()=>{0===n&&(n=window.requestAnimationFrame(r))};r(),o.addEventListener("scroll",i,{passive:!0});const a=new ResizeObserver(i);return a.observe(o),()=>{0!==n&&window.cancelAnimationFrame(n),o.removeEventListener("scroll",i),a.disconnect()}},[t,e,o]),Ft.useMemo(()=>{if(!e||!n)return e;const{scroll:t,originX:s,originY:r}=n,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=r+e.y;return!(i>t+e.width||t>a||c>o+e.height||o>l)})},[e,n,o])}(e,s,n);if(!e||0===e.length)return null;const i=Ot("div",{className:"semiotic-network-html-marks",ref:s,style:{...Yt,transform:`translate(${t.left}px, ${t.top}px)`},children:(r??e).map(e=>Ot("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?Ot(Ye,{value:o,children:i}):i}import{jsx as Xt,jsxs as $t}from"react/jsx-runtime";function Vt({props:e,store:t,responsiveRef:o,size:n,margin:s,adjustedWidth:r,adjustedHeight:i,resolvedBackground:a,resolvedForeground:c}){const{chartType:l,nodes:d,edges:u,data:g,className:p,description:y,title:m,responsiveWidth:f,responsiveHeight:v,summary:b,background:_,renderMode:w,legend:k,legendPosition:A,legendLayout:S,legendHoverBehavior:C,legendClickBehavior:R,legendHighlightedCategory:N,legendIsolatedCategories:T,layoutSelection:E,annotations:I,onAnnotationActivate:P,annotationObservationCallback:D,onObservation:z,chartId:L,autoPlaceAnnotations:H,svgAnnotationRules:W}=e;if(t){const e=["tree","cluster","treemap","circlepack","partition","orbit"].includes(l),o=e?g||(Array.isArray(u)?void 0:u):void 0;if(e&&o)t.ingestHierarchy(o,[r,i]),t.buildScene([r,i]);else{const e=M(d),o=Array.isArray(u)?M(u):[];(e.length>0||o.length>0)&&(t.ingestBounded(e,o,[r,i]),t.buildScene([r,i]))}}const B=t?.sceneNodes??[],F=t?.sceneEdges??[],O=t?.labels??[];return $t("div",{ref:o,className:"stream-network-frame"+(p?" "+p:""),role:"img","aria-label":y||("string"==typeof m?m:"Network chart"),style:{position:"relative",width:f?"100%":n[0],height:v?"100%":n[1]},children:[Xt(h,{summary:b}),$t("svg",{xmlns:"http://www.w3.org/2000/svg",width:n[0],height:n[1],style:{position:"absolute",left:0,top:0},children:[a&&Xt("g",{transform:`translate(${s.left},${s.top})`,children:a}),$t("g",{transform:`translate(${s.left},${s.top})`,children:[_&&Xt("rect",{x:0,y:0,width:r,height:i,fill:_}),F.map((e,t)=>le({node:e,index:t,renderMode:w,fallback:()=>X(e,t)})).filter(Boolean),B.map((e,t)=>le({node:e,index:t,renderMode:w,fallback:()=>$(e,t)})).filter(Boolean),O.map((e,t)=>j(e,t)).filter(Boolean)]})]}),Xt(Bt,{width:r,height:i,totalWidth:n[0],totalHeight:n[1],margin:s,labels:O,sceneNodes:B,title:m,legend:k,legendPosition:A,legendLayout:S,legendHoverBehavior:C,legendClickBehavior:R,legendHighlightedCategory:N,legendIsolatedCategories:T,foregroundGraphics:x(c,Qe(t?.customLayoutOverlays,E??null)),annotations:I,onAnnotationActivate:P,onObservation:D??z,chartId:L,chartType:"StreamNetworkFrame",autoPlaceAnnotations:H,svgAnnotationRules:W,annotationFrame:0}),Xt(jt,{marks:t?.customLayoutHtmlMarks,margin:s,selection:E??null})]})}import{jsx as Gt,jsxs as Qt}from"react/jsx-runtime";var qt=/^(value|amount|total|count|weight|score)$/i;function Kt({data:e}){if("edge"===e.nodeOrEdge){const t=e.data;return t?Qt("div",{className:"semiotic-tooltip",style:ze,children:[Qt("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&&Qt("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 n=o;for(;n;){const o=n.data?.name??n.data?.id??t.id;null!=o&&e.unshift(o+""),n=n.parent}e.length>1&&e.shift();const s=e.length-1;return Qt("div",{className:"semiotic-tooltip",style:ze,children:[Gt("div",{children:e.map((e,t)=>Qt("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 n=(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),r=Fe(t.data??t),i=null!=r.title?r.title+"":t.id,a=r.entries.some(e=>qt.test(e.key));return Qt("div",{className:"semiotic-tooltip",style:ze,children:[Gt("div",{style:{fontWeight:600},children:i}),r.entries.map(e=>Qt("div",{style:{marginTop:4,opacity:.8},children:[e.key,": ",z(e.value)]},e.key)),!a&&null!=t.value&&t.value>0&&Qt("div",{style:{marginTop:4,opacity:.8},children:["Total:"," ","number"==typeof t.value?t.value.toLocaleString():t.value+""]}),n>0&&Qt("div",{style:{marginTop:4,opacity:.8},children:["Connections: ",n,s!==n&&` (weighted: ${s.toLocaleString()})`]})]})}function Ut(e){return e._cachedPath2D&&e._cachedPath2DSource===e.pathD||(e._cachedPath2D=new Path2D(e.pathD),e._cachedPath2DSource=e.pathD),e._cachedPath2D}function Zt(e,t){if(!t.pathD)return;e.save();const o=Ut(t);if(t.style.fill&&"none"!==t.style.fill){const n=t._gradient;if(n){const o=e.createLinearGradient(n.x0,n.y0??0,n.x1,n.y1??0),s=t.style.fillOpacity??t.style.opacity??.5,r="string"==typeof t.style.fill?t.style.fill:"#999",i=Ze(e,r)||r;o.addColorStop(0,1===n.from?i:"transparent"),o.addColorStop(1,1===n.to?i:"transparent"),e.fillStyle=o,e.globalAlpha=s}else e.fillStyle=de(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=Ze(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 Jt(e,t){e.save();const o=t.style.stroke||"#999";e.strokeStyle=Ze(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 eo(e,t){if(!t.pathD)return;e.save();const o=Ut(t);t.style.fill&&"none"!==t.style.fill&&(e.fillStyle=de(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=Ze(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 to(e,t){if(!t.pathD)return;e.save();const o=Ut(t),n=t.style.stroke||"#999";e.strokeStyle=Ze(e,n)||n,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=de(e,t.style.fill,"#007bff"),e.globalAlpha=t.style.fillOpacity??.1,e.fill(o)),e.restore()}function oo(e,t,o,n=30){switch(e.type){case"circle":return function(e,t,o,n=30){const s=t-e.cx,r=o-e.cy,i=Math.sqrt(s*s+r*r);return i>Le(e.r,n)?null:{type:"node",datum:e.datum,x:e.cx,y:e.cy,distance:i}}(e,t,o,n);case"rect":return function(e,t,o){const n=He(t,o,e);return n.hit?{type:"node",datum:e.datum,x:n.cx,y:n.cy,distance:0}:null}(e,t,o);case"arc":return function(e,t,o){const n=t-e.cx,s=o-e.cy,r=Math.sqrt(n*n+s*s);if(e.innerR-2>r||r>e.outerR+2)return null;const i=Be(Math.atan2(s,n)),a=Be(e.startAngle),c=Be(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,n=30){const s=t-e.cx,r=o-e.cy,i=Math.sqrt(s*s+r*r);return i>Le(Ge(e.size),n)?null:{type:"node",datum:e.datum,x:e.cx,y:e.cy,distance:i}}(e,t,o,n);case"glyph":return function(e,t,o,n=30){if(null==e.datum)return null;const s=$e(e.glyph,e.size),r=e.cx+s.centerDx,i=e.cy+s.centerDy,a=t-r,c=o-i,l=Math.sqrt(a*a+c*c);return l>Le(s.radius,n)?null:{type:"node",datum:e.datum,x:r,y:i,distance:l}}(e,t,o,n);default:return null}}Kt.ownsChrome=!0;var no=null,so=null;function ro(){return so||((no=document.createElement("canvas")).width=1,no.height=1,so=no.getContext("2d")),so}function io(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 ao(e,t,o){switch(e.type){case"bezier":return function(e,t,o){if(!e.pathD)return null;const n=io(e),s=ro();if(!n||!s)return null;try{if(s.isPointInPath(n,t,o))return{type:"edge",datum:e.datum,x:t,y:o,distance:0};const r=s.lineWidth;s.lineWidth=10;const i=s.isPointInStroke(n,t,o);if(s.lineWidth=r,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 n=e.x2-e.x1,s=e.y2-e.y1,r=n*n+s*s;if(0===r)return null;let i=((t-e.x1)*n+(o-e.y1)*s)/r;i=Math.max(0,Math.min(1,i));const a=e.x1+i*n,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 n=io(e),s=ro();if(!n||!s)return null;try{if(s.isPointInPath(n,t,o))return{type:"edge",datum:e.datum,x:t,y:o,distance:0};const r=s.lineWidth;s.lineWidth=10;const i=s.isPointInStroke(n,t,o);if(s.lineWidth=r,i)return{type:"edge",datum:e.datum,x:t,y:o,distance:4}}catch{}return null}(e,t,o);default:return null}}function co(e){const{clientX:t,clientY:o,canvasRect:n,margin:s,adjustedWidth:r,adjustedHeight:i,sceneNodes:a,sceneEdges:c,nodeQuadtree:l,maxNodeRadius:d,hitRadius:u=30}=e,h=t-n.left-s.left,g=o-n.top-s.top;if(0>h||h>r||0>g||g>i)return{kind:"miss-outside"};const p=function(e,t,o,n,s=30,r,i=0){let a=null,c=s,l=1/0;if(r){const e=D(r,o,n,s,i,e=>e.cx,e=>e.cy,e=>e.r);e&&(a={type:"node",datum:e.node.datum,x:e.node.cx,y:e.node.cy,distance:e.distance},c=e.distance)}for(const t of e){if(r&&"circle"===t.type)continue;const e=oo(t,o,n,s);if(e)if("rect"===t.type){const o=t.w*t.h;l>o&&(a=e,l=o)}else c>e.distance&&(a=e,c=e.distance)}if(a)return a;for(const e of t){if(!1===e.interactive)continue;const t=ao(e,o,n);t&&c>t.distance&&(a=t,c=t.distance)}return a}(a,c,h,g,u,l,d);return p?{kind:"hit",hover:De(p.datum||{},p.x,p.y,{nodeOrEdge:p.type})}:{kind:"miss"}}import{useCallback as lo}from"react";var uo="StreamNetworkFrame";import{jsx as ho,jsxs as go}from"react/jsx-runtime";var po={top:20,right:80,bottom:20,left:80},yo={top:40,right:40,bottom:40,left:40},mo=new Set(["chord","force","circlepack","orbit"]),fo=[800,600],vo=ct(at(function(s,y){const{chartType:m,nodes:f,edges:v,data:_,initialEdges:w,nodeIDAccessor:k="id",sourceAccessor:A="source",targetAccessor:C="target",valueAccessor:R="value",edgeIdAccessor:N,childrenAccessor:T,hierarchySum:D,orientation:z="horizontal",nodeAlign:H="justify",nodePaddingRatio:F=.05,nodeWidth:j=15,iterations:X=300,forceStrength:$=.1,layoutExecution:Q="auto",layoutLoadingContent:q,onLayoutStateChange:U,padAngle:ne=.01,groupWidth:re=20,sortGroups:ie,edgeSort:le,treeOrientation:de="vertical",edgeType:ue="curve",padding:he,paddingTop:ge,tensionConfig:pe,showParticles:fe=!1,particleStyle:ve,renderMode:be,nodeStyle:_e,edgeStyle:Ee,colorBy:Ie,colorScheme:Pe="category10",edgeColorBy:Me="source",edgeOpacity:ze=.5,colorByDepth:Le=!1,nodeSize:He=8,nodeSizeRange:Be=[5,20],nodeLabel:Fe,showLabels:Oe=!0,labelMode:Ye,size:je=fo,responsiveWidth:Xe,responsiveHeight:$e,margin:Ve,className:Ge,background:qe,enableHover:Ke=!0,tooltipContent:Ue,customHoverBehavior:at,customClickBehavior:ct,onObservation:ut,annotationObservationCallback:ht,chartId:gt,onTopologyChange:pt,annotations:yt,onAnnotationActivate:mt,autoPlaceAnnotations:ft,svgAnnotationRules:vt,legend:bt,legendPosition:_t,legendLayout:wt,legendHoverBehavior:xt,legendClickBehavior:kt,legendHighlightedCategory:At,legendIsolatedCategories:St,title:Ct,foregroundGraphics:Rt,backgroundGraphics:Nt,decay:Tt,pulse:Et,transition:It,animate:Pt,staleness:Mt,frameScheduler:zt,clock:Lt,random:Ht,seed:Wt,paused:Ft=!1,suspendWhenHidden:Ot=!0,thresholds:Yt,accessibleTable:Xt=!0,description:$t,summary:Gt,orbitMode:Qt,orbitSize:qt,orbitSpeed:Ut,orbitRevolution:oo,orbitRevolutionStyle:no,orbitEccentricity:so,orbitShowRings:ro,orbitAnimated:io,customNetworkLayout:ao,onLayoutError:vo,layoutConfig:bo,layoutSelection:_o}=s,wo=mo.has(m)?yo:po,xo=tt(!0),ko=xe({sizeProp:je,responsiveWidth:Xe,responsiveHeight:$e,userMargin:Ve,marginDefault:wo,title:Ct,legend:bt,legendPosition:_t,foregroundGraphics:Rt,backgroundGraphics:Nt,animate:Pt,transitionProp:It,frameScheduler:zt,clock:Lt,random:Ht,seed:Wt,paused:Ft,suspendWhenHidden:Ot,themeDirtyRef:xo}),{reducedMotionRef:Ao,responsiveRef:So,size:Co,margin:Ro,adjustedWidth:No,adjustedHeight:To,resolvedForeground:Eo,resolvedBackground:Io,transition:Po,introEnabled:Mo,tableId:Do,rafRef:zo,renderFnRef:Lo,scheduleRender:Ho,frameRuntime:Wo,currentTheme:Bo}=ko,Fo=Ae(),Oo=Te(),Yo=st(()=>M(f),[f]),jo=st(()=>Array.isArray(v)?M(v):v,[v]),Xo=st(()=>({...lt,...pe}),[pe]),$o=st(()=>({...dt,...ve}),[ve]),Vo=st(()=>{return{chartType:(e={chartType:m,clock:Wo.now,random:Ht,seed:Wt,nodeIDAccessor:k,sourceAccessor:A,targetAccessor:C,valueAccessor:R,edgeIdAccessor:N,childrenAccessor:T,hierarchySum:D,orientation:z,nodeAlign:H,nodePaddingRatio:F,nodeWidth:j,iterations:X,forceStrength:$,padAngle:ne,groupWidth:re,sortGroups:ie,edgeSort:le,treeOrientation:de,edgeType:ue,padding:he,paddingTop:ge,tensionConfig:Xo,showParticles:fe,particleStyle:$o,nodeStyle:_e,edgeStyle:Ee,nodeLabel:Fe,showLabels:Oe,labelMode:Ye,colorBy:Ie,colorScheme:Pe,edgeColorBy:Me,edgeOpacity:ze,colorByDepth:Le,nodeSize:He,nodeSizeRange:Be,decay:Tt,pulse:Et,transition:Po,introAnimation:Mo,staleness:Mt,thresholds:Yt,orbitMode:Qt,orbitSize:qt,orbitSpeed:Ut,orbitRevolution:oo,orbitRevolutionStyle:no,orbitEccentricity:so,orbitShowRings:ro,orbitAnimated:io,customNetworkLayout:ao,onLayoutError:vo,layoutConfig:bo,currentTheme:Bo}).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:Je(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},[m,Wo.now,Ht,Wt,k,A,C,R,N,T,D,z,H,F,j,X,$,ne,re,ie,le,de,ue,he,ge,Xo,fe,$o,_e,Ee,Fe,Oe,Ye,Ie,Pe,Me,ze,Le,He,Be,Tt,Et,Po,Mo,Mt,Yt,Qt,qt,Ut,oo,no,so,ro,io,ao,vo,bo,Bo]),Go=Re(Vo),Qo=Re({chartType:(qo={chartType:m,nodeIDAccessor:k,sourceAccessor:A,targetAccessor:C,valueAccessor:R,edgeIdAccessor:N,childrenAccessor:T,hierarchySum:D,orientation:z,nodeAlign:H,nodePaddingRatio:F,nodeWidth:j,iterations:X,forceStrength:$,padAngle:ne,groupWidth:re,sortGroups:ie,edgeSort:le,treeOrientation:de,edgeType:ue,padding:he,paddingTop:ge,random:Ht,seed:Wt,tensionConfig:Xo,customNetworkLayout:ao,orbitMode:Qt,orbitSize:qt,orbitEccentricity:so}).chartType,nodeIDAccessor:qo.nodeIDAccessor,sourceAccessor:qo.sourceAccessor,targetAccessor:qo.targetAccessor,valueAccessor:qo.valueAccessor,edgeIdAccessor:qo.edgeIdAccessor,childrenAccessor:qo.childrenAccessor,hierarchySum:qo.hierarchySum,orientation:qo.orientation,nodeAlign:qo.nodeAlign,nodePaddingRatio:qo.nodePaddingRatio,nodeWidth:qo.nodeWidth,iterations:qo.iterations,forceStrength:qo.forceStrength,padAngle:qo.padAngle,groupWidth:qo.groupWidth,sortGroups:qo.sortGroups,edgeSort:qo.edgeSort,treeOrientation:qo.treeOrientation,edgeType:qo.edgeType,padding:qo.padding,paddingTop:qo.paddingTop,random:qo.random,seed:qo.seed,tensionConfig:qo.tensionConfig,customNetworkLayout:qo.customNetworkLayout,orbitMode:qo.orbitMode,orbitSize:qo.orbitSize,orbitEccentricity:qo.orbitEccentricity});var qo;const Ko=tt(0),Uo=tt(0),Zo=tt(!1),Jo=tt(null);Jo.current||(Jo.current=new Dt(Go));const en=Ce("StreamNetworkFrame"),tn=rt((e,t,o=!1)=>me(en.current,e,()=>e.buildScene(t),o),[en]),[on,nn]=ot(null),[sn,rn]=ot(0),[an,cn]=ot(0),[ln,dn]=ot(!1),[un,hn]=ot(!1),gn=tt(0),pn=tt(null),yn=tt(!1),mn=tt(U);mn.current=U;const fn=tt(Go);fn.current=Go;const vn=tt(null),bn=tt(new Map),_n=tt(0),wn=rt(e=>function(e){const{node:t,colorBy:o,colorScheme:n,nodeColorMap:s,colorIndexRef:r}=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(n)?n:a;s.set(e+"",t[r.current++%t.length])}return s.get(e+"")}}if(s.has(t.id))return s.get(t.id);const i=Array.isArray(n)?n:a,c=o?i[r.current++%i.length]:i[0];return s.set(t.id,c),c}({node:e,colorBy:Ie,colorScheme:Pe,nodeColorMap:bn.current,colorIndexRef:_n}),[Ie,Pe]),xn=rt(e=>{_n.current=function(e){const{sceneNodes:t,nodes:o,nodeColorMap:n,colorScheme:s}=e;for(const e of t)e.id&&"string"==typeof e.style?.fill&&n.set(e.id,e.style.fill);const r=Array.isArray(s)?s:a,i=Array.from(o);for(let e=0;i.length>e;e++){const t=i[e];n.has(t.id)||n.set(t.id,r[e%r.length])}return i.length}({sceneNodes:e.sceneNodes,nodes:e.nodes.values(),nodeColorMap:bn.current,colorScheme:Pe})},[Pe]),kn=rt((e,t)=>{tn(e,t),xn(e),xo.current=!1,e.markStylePaintPending()},[tn,xn]),An=rt(()=>{Jo.current?.markStylePaintPending()},[]),Sn=(Cn=Bo,Cn?.colors?.border||Cn?.colors?.secondary||Cn?.colors?.primary||"#999");var Cn;const Rn=rt(e=>function(e,t){return e?"object"==typeof e?e:t?.get(e)??null:null}(e,Jo.current?.nodes),[]),Nn=rt(e=>function(e){const{edge:t,edgeColorBy:o,getNodeColor:n,resolveEndpoint:s,fallback:r}=e;if("function"==typeof o)return o(t);const i=s(t.source),a=s(t.target);return"target"===o&&a?n(a):i?n(i):r}({edge:e,edgeColorBy:Me,getNodeColor:wn,resolveEndpoint:Rn,fallback:Sn}),[Me,wn,Sn,Rn]),Tn=rt(e=>function(e){const{edge:t,particleStyleColor:o,particleColorBy:n,hasExplicitParticleColorBy:s,getEdgeColor:r,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 r(t);const l=n,d=a(t.source),u=a(t.target);return"target"===l&&u?i(u):d?i(d):c}({edge:e,particleStyleColor:$o.color,particleColorBy:$o.colorBy,hasExplicitParticleColorBy:!!ve?.colorBy,getEdgeColor:Nn,getNodeColor:wn,resolveEndpoint:Rn,fallback:Sn}),[ve?.colorBy,$o.color,$o.colorBy,wn,Nn,Sn,Rn]),En=function(e,t,o,n,s){return("sankey"===e||t)&&o||n||s}(m,!!ao,fe,!!Et,Jo.current?.isAnimating??!1);we(Jo,Go,xo,Ho),Se(Jo,_o,xo,Ho),nt(()=>{const e=Jo.current;e&&(kn(e,[No,To]),rn(e=>e+1),Ho())},[Bo,No,To,kn,Ho]);const In=rt(()=>{const e=Jo.current;if(e&&(e.runLayout([No,To]),kn(e,[No,To]),rn(e.layoutVersion),pt)){const{nodes:t,edges:o}=e.getLayoutData();pt(t,o)}},[No,To,kn,pt]),Pn=tt(!1),Mn=rt((e=!1)=>!(!e&&!Pn.current||(Pn.current=!1,In(),0)),[In]),Dn=rt(()=>Mn(!1),[Mn]),zn=rt(e=>{const t=Jo.current;if(!t)return!1;let o=!1,n=Pn.current;for(const s of e)null!=s&&"object"==typeof s&&(o=!0,t.ingestEdge(s)&&(n=!0));const s=Mn(n);return o||s},[Mn]),Ln=rt(e=>{if(null==e||"object"!=typeof e)return;const t=Jo.current;t&&(t.ingestEdge(e)&&(Pn.current=!0),Wo.isActive?Ho():Dn())},[Dn,Wo,Ho]),Hn=rt(e=>{zn(e)&&Ho()},[zn,Ho]);nt(()=>Wo.subscribe(()=>{Wo.isActive||Dn()}),[Dn,Wo]);const Wn=rt(()=>{Pn.current=!1,Jo.current?.clear(),bn.current.clear(),_n.current=0,rn(Jo.current?.layoutVersion??0),nn(null),vn.current=null,xo.current=!0,Ho()},[Ho]),Bn=rt(()=>{const e=Jo.current;e&&(e.tension+=999,Mn(!0),Ho())},[Mn,Ho]);it(y,()=>({push:Ln,pushMany:Hn,removeNode:e=>{const t=Jo.current?.removeNode(e)??!1;if(t){const t=vn.current?.data?"function"==typeof k?k(vn.current.data):vn.current.data[k]:void 0;vn.current&&"node"===vn.current.nodeOrEdge&&t===e&&(vn.current=null,nn(null)),bn.current.delete(e)}return Mn(t)&&(xo.current=!0,Ho()),t},removeEdge:(e,t)=>{const o=Jo.current?.removeEdge(e,t)??!1;if(o&&vn.current&&"edge"===vn.current.nodeOrEdge){const o=vn.current.data;let n;n=void 0!==t?("object"==typeof o?.source?o.source.id:o?.source)===e&&("object"==typeof o?.target?o.target.id:o?.target)===t:!N||!o||("function"==typeof N?N:e=>e?.[N])(o)===e,n&&(vn.current=null,nn(null))}return Mn(o)&&(xo.current=!0,Ho()),o},updateNode:(e,t)=>{const o=Jo.current?.updateNode(e,t)??null;return Mn(null!==o)&&(xo.current=!0,Ho()),o},updateEdge:(e,t,o)=>{const n=Jo.current?.updateEdge(e,t,o)??[];return Mn(n.length>0)&&(xo.current=!0,Ho()),n},clear:Wn,getTopology:()=>(Dn(),Jo.current?.getLayoutData()??{nodes:[],edges:[]}),getCustomLayout:()=>(Dn(),Jo.current?.lastCustomLayoutResult??null),getLayoutFailure:()=>(Dn(),Jo.current?.lastCustomLayoutFailure??null),getTopologyDiff:()=>{Dn();const e=Jo.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:Bn,getTension:()=>(Dn(),Jo.current?.tension??0)}),[Ln,Hn,Wn,Bn,Dn,Mn,k,Ho,N]);const Fn=["tree","cluster","treemap","circlepack","partition","orbit"].includes(m),On=Fn?_||(Array.isArray(v)?void 0:v):void 0;nt(()=>{const s=Jo.current;if(!s)return;const r=++gn.current;if(pn.current?.abort(),pn.current=null,Fn&&On)Pn.current=!1,s.ingestHierarchy(On,[No,To]),kn(s,[No,To]),rn(s.layoutVersion),hn(!1),mn.current?.("ready"),Ho();else{const i=Yo,a=Array.isArray(jo)?jo:[];if(null==f&&null==v||(Pn.current=!1),0===i.length&&0===a.length)return null==f&&null==v||0>=s.nodes.size&&0>=s.edges.size||Wn(),hn(!1),void mn.current?.("ready");const c=[No,To],l="force"===m&&!ao&&e()&&!Ht&&n(Q,i.length,a.length,X);if(l&&Oo&&!yn.current&&s.sceneNodes.length>0)return yn.current=!0,hn(!1),mn.current?.("ready"),xo.current=!0,void Ho();if(l){const e=new AbortController;pn.current=e;const n=s._lastPositionSnapshot;s.ingestBounded(i,a,c,{deferLayout:!0});const l=s.getLayoutData(),d=t(l.nodes,l.edges,fn.current,c,n);return hn(!0),mn.current?.("pending"),o(d,e.signal).then(({positions:e})=>{r===gn.current&&(s.applyForceLayoutPositions(e,c),kn(s,c),hn(!1),mn.current?.("ready"),rn(s.layoutVersion),Ho())}).catch(e=>{"AbortError"!==e.name&&r===gn.current&&(s.runLayout(c),kn(s,c),hn(!1),mn.current?.("error"),rn(s.layoutVersion),Ho())}),()=>e.abort()}s.ingestBounded(i,a,c),kn(s,c),rn(s.layoutVersion),hn(!1),mn.current?.("ready"),Ho()}},[Yo,jo,f,v,_,On,Fn,No,To,Qo,Q,X,Oo,m,ao,Ht,Ho,Wn,kn]);const Yn=et.useRef(!1);nt(()=>{Yn.current||w&&w.length>0&&(Yn.current=!0,Hn(w))},[w,Hn]);const{customHoverBehavior:jn,customClickBehavior:Xn}=function({customHoverBehavior:e,customClickBehavior:t,onObservation:o,chartId:n}){return{customHoverBehavior:lo((t,s)=>{e?.(t,s),I({onObservation:o,datum:t?t.data||t:null,x:t?.x,y:t?.y,chartType:uo,chartId:n,context:s})},[e,o,n]),customClickBehavior:lo((e,s)=>{t?.(e,s),E({onObservation:o,datum:e?e.data||e:null,x:e?.x,y:e?.y,chartType:uo,chartId:n,context:s})},[t,o,n])}}({customHoverBehavior:at,customClickBehavior:ct,onObservation:ut,chartId:gt}),{hoverHandlerRef:$n,hoverLeaveRef:Vn,onPointerMove:Gn,onPointerLeave:Qn}=ko,qn=()=>!ao||(Jo.current?.hasCustomRestyle??!1);$n.current=e=>{if(!Ke)return;const t=qn(),o=ns.current;if(!o)return;const n=Jo.current;if(!n)return;const s=co({clientX:e.clientX,clientY:e.clientY,canvasRect:o.getBoundingClientRect(),margin:Ro,adjustedWidth:No,adjustedHeight:To,sceneNodes:n.sceneNodes,sceneEdges:n.sceneEdges,nodeQuadtree:n.nodeQuadtree,maxNodeRadius:n.maxNodeRadius});"hit"===s.kind?(vn.current=s.hover,nn(s.hover),jn?.(s.hover),t&&Ho()):vn.current&&(vn.current=null,nn(null),jn?.(null),t&&Ho())},Vn.current=()=>{if(vn.current){const e=qn();vn.current=null,nn(null),jn?.(null),e&&Ho()}};const Kn=tt(()=>{});Kn.current=e=>{if(We(e.target))return;if(!ct&&!ut)return;const t=ns.current;if(!t)return;const o=Jo.current;if(!o)return;const n=co({clientX:e.clientX,clientY:e.clientY,canvasRect:t.getBoundingClientRect(),margin:Ro,adjustedWidth:No,adjustedHeight:To,sceneNodes:o.sceneNodes,sceneEdges:o.sceneEdges,nodeQuadtree:o.nodeQuadtree,maxNodeRadius:o.maxNodeRadius});"hit"===n.kind?Xn(n.hover,{type:"activate",inputType:K(e.nativeEvent.pointerType)}):"miss"===n.kind&&Xn(null)};const Un=rt(e=>Kn.current(e),[]),Zn=tt(-1),Jn=tt(null),es=tt(-1),ts=rt(e=>{if(W(e))return;const t=Jo.current;if(!t)return;const o=()=>{Zn.current=-1,Jn.current=null,es.current=-1,vn.current=null,nn(null),jn?.(null),Ho()},n=P(t.sceneNodes);if(0===n.length)return void(0>Zn.current||o());const s=b(n);let r=Zn.current;if(s.flat.length>r||(o(),r=-1)," "===e.key&&r>=0){e.preventDefault();const t=s.flat[r];return void Xn?.(De(t.datum||{},t.x,t.y,{nodeOrEdge:"node"}),{type:"activate",inputType:"keyboard"})}if(0>r){if("Escape"===e.key)return;if(!["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End","PageUp","PageDown","Enter"].includes(e.key))return;e.preventDefault(),Zn.current=0,es.current=-1;const t=s.flat[0];Jn.current={shape:t.shape,w:t.w,h:t.h};const o=De(t.datum||{},t.x,t.y,{nodeOrEdge:"node"});return vn.current=o,nn(o),jn?.(o,{type:"focus",inputType:"keyboard"}),void Ho()}const i=ye(s,r),a=G(e.key,i,s,t.sceneEdges??[],es);if(null===a)return;if(e.preventDefault(),0>a)return void o();Zn.current=a;const c=s.flat[a];Jn.current={shape:c.shape,w:c.w,h:c.h};const l={data:c.datum||{},x:c.x,y:c.y,__semioticHoverData:!0,nodeOrEdge:"node"};vn.current=l,nn(l),jn?.(l,{type:"focus",inputType:"keyboard"}),Ho()},[Xn,jn,Ho]),os=rt(e=>{Zn.current=-1,Jn.current=null,Gn(e)},[Gn]);Lo.current=()=>{if(zo.current=null,Dn(),!Wo.isActive)return;const e=ns.current;if(!e)return;const t=Jo.current;t&&function(e){const{canvas:t,store:o,sceneRevisionDiagnostics:n,size:s,margin:r,adjustedWidth:i,adjustedHeight:a,background:c,renderMode:l,hasBackgroundGraphics:d=!1,dirtyRef:u,lastFrameTimeRef:h,now:g,random:p,reducedMotion:y,showParticles:m,isContinuous:f,animate:v,decay:b,pulse:_,thresholds:w,staleness:x,particleStyle:k,getParticleColor:A,pendingAnnotationFrameRef:C,lastAnnotationFrameTimeRef:R,setAnnotationFrame:N,scheduleNextFrame:T,syncColorMap:E}=e,I=t.getContext("2d");if(!I)return;const P=h.current?Math.min((g-h.current)/1e3,.1):.016;h.current=g;const M=o.advanceTransition(y?g+1e6:g),D=!y&&M,z=!y&&o.tickAnimation([i,a],P),H=u.current,W=n?.beforeCompute(o.getLastUpdateResult(),D),B=M||H||z;B&&(o.buildScene([i,a]),H&&E?.()),W&&n?.afterCompute(W,B,!1);const F=m&&!y&&!!o.particlePool,j=!!b||!!_||!!w||!1!==v&&o.hasActiveTopologyDiff||o.hasActivePulses||o.hasActiveThresholds,X=o.consumeStylePaintPending(),$=O({dirtyOrRebuilt:H,transitioning:D,animationTicked:z,continuous:F||f,liveEncoding:j,forced:X}),G=!!x&&o.lastIngestTime>0&&g-o.lastIngestTime>(x?.threshold??5e3);if($){const e=L();if(!oe(t,s,r,e))return;if(I.clearRect(-r.left,-r.top,s[0],s[1]),Z(I,{background:c,hasBackgroundGraphics:d,width:i,height:a}),b&&o.applyDecay(),_&&o.applyPulse(g),w&&o.applyThresholds(g),!1!==v&&o.applyTopologyDiff(g),G&&(I.globalAlpha=x?.dimOpacity??.5),te({context:I,nodes:o.sceneEdges,renderMode:l,pixelRatio:e,paintBuiltIn:e=>function(e,t){for(const o of t)switch(o.type){case"bezier":Zt(e,o);break;case"line":Jt(e,o);break;case"ribbon":eo(e,o);break;case"curved":to(e,o)}}(I,e)}),te({context:I,nodes:o.sceneNodes,renderMode:l,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),J(e,t.style,"#007bff",()=>e.fillRect(t.x,t.y,t.w,t.h)),ee(e,t.style,()=>e.strokeRect(t.x,t.y,t.w,t.h)),ce(e,t),e.restore())}}(I,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),J(e,t.style,"#007bff",()=>e.fill()),ee(e,t.style,()=>e.stroke()),se(e,t),e.restore())}}(I,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(),J(e,t.style,"#007bff",()=>e.fill()),ee(e,t.style,()=>e.stroke()),e.restore()}}(I,t),V(I,t),Y(I,t)}}),F&&!G){const e=o.edgesArray;if(e.length>0){!function(e,t,o,n,s=Math.random){const r=n.spawnRate??.1,i=n.maxPerEdge??50;for(let n=0;t.length>n;n++){const a=t[n];if(!a.bezier)continue;if(e.countForEdge(n)>=i)continue;const c=a.value*r*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(n)<i;t++)e.spawn(n,s)}}(o.particlePool,e,P,k,p);const t=.5*(k.speedMultiplier??1);let n;if(k.proportionalSpeed){const t=e.reduce((e,t)=>Math.max(e,t.value||1),1);n=e.map(e=>.3+(e.value||1)/t*1.7)}o.particlePool.step(P,t,e,n),function(e,t,o,n,s){const r=n.radius??3;e.globalAlpha=n.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 n.color&&"inherit"!==n.color?n.color:s(c),e.fillStyle=Ze(e,l)||l,e.beginPath(),e.arc(a.x,a.y,r,0,2*Math.PI),e.fill()}e.globalAlpha=1}(I,o.particlePool,e,k,A)}}G&&(I.globalAlpha=1)}u.current=!1,(H||D||z)&&t.setAttribute("aria-label",S(o.sceneNodes?.length??0,o.sceneEdges?.length??0,"Network chart"));const Q=H||D||z||C.current;Q&&g-R.current>=33?(N(e=>e+1),R.current=g,C.current=!1):C.current=!!Q,(f||D||null!=o.transition||z||o.hasActivePulses||o.hasActiveThresholds||!1!==v&&o.hasActiveTopologyDiff||C.current)&&T()}({canvas:e,store:t,sceneRevisionDiagnostics:en.current,size:Co,margin:Ro,adjustedWidth:No,adjustedHeight:To,background:qe,renderMode:be,hasBackgroundGraphics:!!Nt,dirtyRef:xo,lastFrameTimeRef:Ko,now:Wo.now(),random:Wo.random,reducedMotion:!!Ao.current,showParticles:fe,isContinuous:En,animate:Pt,decay:Tt,pulse:Et,thresholds:Yt,staleness:Mt,particleStyle:$o,getParticleColor:Tn,pendingAnnotationFrameRef:Zo,lastAnnotationFrameTimeRef:Uo,setAnnotationFrame:cn,scheduleNextFrame:()=>{Ho()},syncColorMap:()=>xn(t)})};const{canvasRef:ns}=ke(ko,{hydrated:Fo,wasHydratingFromSSR:Oo,storeRef:Jo,dirtyRef:xo,skipInitialCanvasPaintInvalidation:!0,canvasPaintInvalidator:An,canvasPaintDependencies:[m,No,To,qe,Nt,be,Ho]});Ne(Mt,Jo,xo,Ho,ln,dn);const ss=Ke&&on?ho(c,{x:on.x,y:on.y,containerWidth:No,containerHeight:To,margin:Ro,className:"stream-network-tooltip",zIndex:2,children:Ue?Ue(on):ho(Kt,{data:on})}):null;if(B||!Fo&&Oo)return ho(Vt,{props:s,store:Jo.current,responsiveRef:So,size:Co,margin:Ro,adjustedWidth:No,adjustedHeight:To,resolvedBackground:Io,resolvedForeground:Eo});const rs=Jo.current;return go("div",{ref:So,className:"stream-network-frame"+(Ge?" "+Ge:""),role:"group","aria-label":$t||("string"==typeof Ct?Ct:"Network chart"),tabIndex:0,"aria-busy":un||void 0,style:{position:"relative",width:Xe?"100%":Co[0],height:$e?"100%":Co[1],overflow:"visible"},onKeyDown:ts,children:["production"!==process.env.NODE_ENV&&Jo.current&&ho(u,{store:Jo.current,diagnostics:en.current}),Xt&&ho(g,{tableId:Do}),Xt&&ho(d,{nodes:rs?.sceneNodes??[],edges:rs?.sceneEdges??[],chartType:"Network chart",tableId:Do,chartTitle:"string"==typeof Ct?Ct:void 0}),ho(h,{summary:Gt}),ho(r,{hoverPoint:on}),go("div",{role:"img","aria-label":$t||("string"==typeof Ct?Ct:"Network chart"),style:{position:"relative",width:"100%",height:"100%"},onMouseMove:Ke?os:void 0,onMouseLeave:Ke?Qn:void 0,onClick:ct||ut?Un:void 0,children:[un&&!1!==q&&ho("div",{style:{position:"absolute",inset:0,zIndex:3,background:"var(--semiotic-bg, #fff)"},children:ae(!0,Co[0],Co[1],q)}),ho(i,{size:Co,margin:Ro,overflowVisible:!0,children:Io}),ho("canvas",{ref:ns,"aria-label":S(rs?.sceneNodes?.length??0,rs?.sceneEdges?.length??0,"Network chart"),style:{position:"absolute",top:0,left:0}}),ho(Bt,{width:No,height:To,totalWidth:Co[0],totalHeight:Co[1],margin:Ro,labels:rs?.labels||[],sceneNodes:rs?.sceneNodes,title:Ct,legend:bt,legendPosition:_t,legendLayout:wt,legendHoverBehavior:xt,legendClickBehavior:kt,legendHighlightedCategory:At,legendIsolatedCategories:St,foregroundGraphics:x(Eo,Qe(Jo.current?.customLayoutOverlays,_o??null)),annotations:yt,onAnnotationActivate:mt,onObservation:ht??ut,chartId:gt,chartType:"StreamNetworkFrame",autoPlaceAnnotations:ft,svgAnnotationRules:vt,annotationFrame:an}),ho(jt,{marks:rs?.customLayoutHtmlMarks,margin:Ro,selection:_o??null}),ho(l,{active:Zn.current>=0,hoverPoint:on,margin:Ro,size:Co,shape:Jn.current?.shape,width:Jn.current?.w,height:Jn.current?.h}),ss,Mt?.showBadge&&ho(p,{isStale:ln,position:Mt.badgePosition})]})]})}));vo.displayName="StreamNetworkFrame";var bo=vo,_o=class e{constructor(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}push(e){if(!Number.isFinite(e))return;this._count+=1;const t=e-this._mean;this._mean+=t/this._count,this._m2+=t*(e-this._mean),this._min>e&&(this._min=e),e>this._max&&(this._max=e)}merge(e){if(0===e._count)return;if(0===this._count)return this._count=e._count,this._mean=e._mean,this._m2=e._m2,this._min=e._min,void(this._max=e._max);const t=this._count+e._count,o=e._mean-this._mean;this._mean+=o*e._count/t,this._m2+=e._m2+o*o*this._count*e._count/t,this._count=t,this._min>e._min&&(this._min=e._min),e._max>this._max&&(this._max=e._max)}clear(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}clone(){const t=new e;return t._count=this._count,t._mean=this._mean,t._m2=this._m2,t._min=this._min,t._max=this._max,t}get count(){return this._count}get mean(){return 0===this._count?0:this._mean}get sum(){return 0===this._count?0:this._mean*this._count}get variance(){return 2>this._count?0:this._m2/this._count}get stddev(){return Math.sqrt(this.variance)}get sampleVariance(){return 2>this._count?0:this._m2/(this._count-1)}get sampleStddev(){return Math.sqrt(this.sampleVariance)}get min(){return this._min}get max(){return this._max}},wo=class{constructor(e){this.windows=new Map,this.sessions=[],this.latest=-1/0,this.type=e.window??"tumbling",this.size=e.size;const t=e.hop??e.size;this.hop=t>0&&e.size>=t?t:e.size,this.gap=e.gap??e.size,this.retain=null!=e.retain&&e.retain>0?e.retain:1/0}push(e,t){Number.isFinite(e)&&Number.isFinite(t)&&(e>this.latest&&(this.latest=e),"session"===this.type?this.pushSession(e,t):this.pushFixed(e,t),this.prune())}pushFixed(e,t){if("tumbling"===this.type||this.hop>=this.size)return void this.bump(Math.floor(e/this.size)*this.size,t);const o=this.hop,n=Math.floor(e/o);for(let s=Math.floor((e-this.size)/o)+1;n>=s;s++)this.bump(s*o,t)}bump(e,t){let o=this.windows.get(e);o||(o=new _o,this.windows.set(e,o)),o.push(t)}pushSession(e,t){const o=this.gap,n=new _o;n.push(t);let s=e,r=e;const i=[],a={start:s,end:r,stats:n};for(const t of this.sessions)e-o>t.end||t.start>e+o?i.push(t):(a.stats.merge(t.stats),s>t.start&&(s=t.start),t.end>r&&(r=t.end));a.start=s,a.end=r,i.push(a),i.sort((e,t)=>e.start-t.start),this.sessions=i}prune(){if(this.retain===1/0)return;if("session"===this.type)return void(this.sessions.length>this.retain&&(this.sessions=this.sessions.slice(this.sessions.length-this.retain)));if(this.retain>=this.windows.size)return;const e=[...this.windows.keys()].sort((e,t)=>e-t),t=e.length-this.retain;for(let o=0;t>o;o++)this.windows.delete(e[o])}emit(){return"session"===this.type?this.emitSessions():this.emitFixed()}emitFixed(){const e=[];for(const[t,o]of this.windows){const n=t+this.size;e.push(this.row(t,n,o,n>this.latest))}return e.sort((e,t)=>e.start-t.start),e}emitSessions(){return this.sessions.map(e=>this.row(e.start,e.end,e.stats,this.gap>this.latest-e.end))}row(e,t,o,n){return{start:e,end:t,count:o.count,mean:o.mean,sum:o.sum,min:o.min,max:o.max,stddev:o.stddev,partial:n}}get windowCount(){return"session"===this.type?this.sessions.length:this.windows.size}get watermark(){return this.latest}clear(){this.windows.clear(),this.sessions=[],this.latest=-1/0}};function xo(e,t){switch(t){case"sum":return e.sum;case"min":return e.min;case"max":return e.max;case"count":return e.count;default:return e.mean}}function ko(e,t,o,n=1){if("none"===t)return null;if("minmax"===t)return[e.min,e.max];const s=xo(e,o),r=e.stddev*n;return[s-r,s+r]}var Ao={ms:1,s:1e3,m:6e4,h:36e5,d:864e5},So=/(\d+(?:\.\d+)?)(ms|s|m|h|d)/g;function Co(e){if("number"==typeof e)return Number.isFinite(e)&&e>0?e:null;if("string"!=typeof e)return null;const t=e.trim();if(""===t)return null;So.lastIndex=0;let o,n=0,s=0;for(;null!==(o=So.exec(t));){const e=parseFloat(o[1]),t=Ao[o[2]];if(null==t||!Number.isFinite(e))return null;n+=e*t,s+=o[0].length}return s!==t.length?null:n>0?n:null}var Ro=class{constructor(e){this.held=[],this._watermark=-1/0,this._lateCount=0,this.lateness=e.lateness>0?e.lateness:0,this.getTime=e.getTime,this.latePolicy=e.latePolicy??"drop"}push(e){const t=this.getTime(e);if(!Number.isFinite(t))return{released:[e],late:[]};const o=[];return this._watermark!==-1/0&&this._watermark-this.lateness>t?(this._lateCount+=1,o.push(e),"drop"===this.latePolicy?{released:[],late:o}:{released:[e],late:o}):(t>this._watermark&&(this._watermark=t),this.held.push(e),{released:this.drain(),late:o})}drain(){const e=this._watermark-this.lateness;if(0===this.held.length)return[];const t=[],o=[];for(const n of this.held)this.getTime(n)>e?o.push(n):t.push(n);return this.held=o,t.sort((e,t)=>this.getTime(e)-this.getTime(t)),t}flush(){const e=this.held;return this.held=[],e.sort((e,t)=>this.getTime(e)-this.getTime(t)),e}clear(){this.held=[],this._watermark=-1/0,this._lateCount=0}get watermark(){return this._watermark}get lateCount(){return this._lateCount}get heldCount(){return this.held.length}};import{useRef as No,useImperativeHandle as To,forwardRef as Eo,useCallback as Io,useState as Po,useEffect as Mo}from"react";import{jsx as Do,jsxs as zo}from"react/jsx-runtime";var Lo={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, #f3f4f6)",padding:"6px 10px",borderRadius:"var(--semiotic-tooltip-radius, 4px)",fontSize:"var(--semiotic-tooltip-font-size, 12px)",fontFamily:"var(--semiotic-tick-font-family, var(--semiotic-font-family, sans-serif))",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.25))",lineHeight:1.4,pointerEvents:"none",whiteSpace:"nowrap"},Ho={opacity:.7,marginRight:4};function Wo(e,t,o){if(null!=e)return"function"==typeof t?t(e):e["string"==typeof t?t:o]}function Bo(e){return null==e?"":"number"==typeof e?Number.isInteger(e)?e+"":e.toFixed(2):e instanceof Date?e.toLocaleString():e+""}function Fo(e={}){const{timeAccessor:t,valueAccessor:o,xLabel:n="x",yLabel:s="y"}=e;return e=>{const r=e?.data??null,i=Wo(r,t,"time"),a=Wo(r,o,"value");return zo("div",{className:"semiotic-tooltip",style:Lo,children:[zo("div",{children:[zo("span",{style:Ho,children:[n,":"]}),Bo(i)]}),zo("div",{children:[zo("span",{style:Ho,children:[s,":"]}),Bo(a)]})]})}}function Oo(e,t){return null!=e?e:Math.max(t?.length??0,200)}var Yo="time",jo="value",Xo="__aggLower",$o="__aggUpper",Vo="__aggPartial",Go="count",Qo="__aggStart",qo="__aggEnd";function Ko(e,t){const o=t.stat??"mean",n=t.band??"none",s=t.sigma??1;return e.emit().map(e=>{const t={[Yo]:(e.start+e.end)/2,[jo]:xo(e,o),[Go]:e.count,[Vo]:e.partial,[Qo]:e.start,[qo]:e.end},r=ko(e,n,o,s);return r&&(t[Xo]=r[0],t[$o]=r[1]),t})}import{jsx as Uo}from"react/jsx-runtime";function Zo(e,t,o){const n="function"==typeof t?t(e):e[t??o];if(null==n)return null;if(n instanceof Date)return n.getTime();const s=Number(n);return Number.isFinite(s)?s:null}var Jo=Eo(function(e,t){const o=be(e.mode,{width:e.size?.[0]??e.width,height:e.size?.[1]??e.height,enableHover:null!=e.enableHover?!!e.enableHover:void 0,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{size:n,margin:s,className:r,arrowOfTime:i="right",windowMode:a="sliding",windowSize:c,data:l,timeAccessor:d,valueAccessor:u,timeExtent:h,valueExtent:g,extentPadding:p,stroke:m="#007bff",strokeWidth:f=2,strokeDasharray:b,opacity:_,background:w,tooltipContent:x,tooltip:k,onHover:A,annotations:S,autoPlaceAnnotations:C,svgAnnotationRules:R,tickFormatTime:N,tickFormatValue:T,decay:E,pulse:I,staleness:P,transition:M,linkedHover:D,selection:z,onObservation:L,chartId:H,loading:W,loadingContent:B,emptyContent:F,emphasis:O,legendPosition:Y,aggregate:j,eventTime:X}=e,$=o.showAxes,V=o.enableHover,G=s??o.marginDefaults,Q=n??[o.width,o.height],q=x??k??Fo({timeAccessor:d,valueAccessor:u}),K=No(null),{customHoverBehavior:U}=_e({selection:z,linkedHover:D,unwrapData:!0,onObservation:L,chartType:"RealtimeLineChart",chartId:H}),Z=Io(e=>{A&&A(e),U(e)},[A,U]),J=null!=j,[ee,te]=Po([]),oe=No(null),ne=No(j);ne.current=j;const se=No(J);se.current=J;const ie=No(ee);ie.current=ee;const ce=No({timeAccessor:d,valueAccessor:u});ce.current={timeAccessor:d,valueAccessor:u},Mo(()=>{if(!J)return void(oe.current=null);const e=ne.current,t=function(e){const t=e.window??"tumbling",o=Co("session"===t?e.gap??e.size:e.size);if(null==o)return null;const n=null!=e.hop?Co(e.hop):void 0,s=null!=e.gap?Co(e.gap):void 0;return new wo({window:t,size:o,hop:n??void 0,gap:s??void 0,retain:e.retain})}(e);if(oe.current=t,t&&l){const{timeAccessor:e,valueAccessor:o}=ce.current;for(const n of l){const s=Zo(n,e,"time"),r=Zo(n,o,"value");null!=s&&null!=r&&t.push(s,r)}}te(t?Ko(t,e):[])},[J?[j.window??"tumbling",j.size,j.hop??"",j.gap??"",j.retain??""].join("|"):"",J,l]),Mo(()=>{J&&oe.current&&te(Ko(oe.current,ne.current))},[j?.stat,j?.band,j?.sigma]);const le=Io(e=>{const t=oe.current,o=ne.current;if(!t||!o)return;const{timeAccessor:n,valueAccessor:s}=ce.current;for(const o of e){const e=Zo(o,n,"time"),r=Zo(o,s,"value");null!=e&&null!=r&&t.push(e,r)}te(Ko(t,o))},[]),de=null!=X,ue=No(null),he=No(X);he.current=X;const ge=No(de);ge.current=de;const pe=No(L);pe.current=L;const ye=No(H);ye.current=H,Mo(()=>{ue.current=de?function(e){const t=Co(e.lateness);return null==t?null:new Ro({lateness:t,getTime:e=>Zo(e,ce.current.timeAccessor,"time")??NaN,latePolicy:e.latePolicy??"drop"})}(he.current):null},[de?`${X.lateness}|${X.latePolicy??"drop"}`:"",de]);const me=Io(e=>{0!==e.length&&(se.current?le(e):K.current?.pushMany(e))},[le]),fe=Io(e=>{const t=ue.current;if(!ge.current||!t)return void me(e);const o=[];for(const n of e){const e=t.push(n);if(e.released.length&&o.push(...e.released),e.late.length){const o=pe.current;if(o){const{timeAccessor:n}=ce.current,s=he.current?.latePolicy??"drop";for(const r of e.late)o({type:"late-data",datum:r,eventTime:Zo(r,n,"time")??NaN,watermark:t.watermark,policy:s,lateCount:t.lateCount,timestamp:Date.now(),chartType:"RealtimeLineChart",chartId:ye.current})}}}me(o)},[me]);To(t,()=>({push:e=>fe([e]),pushMany:e=>fe(e),remove:e=>se.current?[]:K.current?.remove(e)??[],update:(e,t)=>se.current?[]:K.current?.update(e,t)??[],clear:()=>{ue.current?.clear(),se.current?(oe.current?.clear(),te([])):K.current?.clear()},getData:()=>se.current?ie.current:K.current?.getData()??[],getScales:()=>K.current?.getScales()??null}),[fe]);const ve=ae(W,Q[0],Q[1],B),we=ve?null:re(J?void 0:l,Q[0],Q[1],F),xe={stroke:m,strokeWidth:f,strokeDasharray:b};null!=_&&(xe.opacity=_);const ke=Oo(c,l),Ae=J?ee:l,Se=J?Yo:d,Ce=J?jo:u,Re=J&&j&&"none"!==(j.band??"none")?{y0Accessor:Xo,y1Accessor:$o,perSeries:!1}:void 0;return ve||we||Uo(y,{ref:K,chartType:"line",runtimeMode:"streaming",size:Q,margin:G,className:O?`${r||""} semiotic-emphasis-${O}`.trim():r,arrowOfTime:i,windowMode:J?"growing":a,windowSize:J?Math.max(1,j?.retain??Math.max(ee.length,600)):ke,data:Ae,timeAccessor:Se,valueAccessor:Ce,xExtent:h,yExtent:g,extentPadding:p,band:Re,lineStyle:xe,showAxes:$,background:w,hoverAnnotation:V,tooltipContent:q,...v({linkedHover:D,selection:z,onObservation:L,forceHoverBehavior:!0,mobileInteraction:o.mobileInteraction,customHoverBehavior:Z}),annotations:S,autoPlaceAnnotations:C,svgAnnotationRules:R,tickFormatTime:N,tickFormatValue:T,decay:E,pulse:I,staleness:P,transition:M,pointIdAccessor:e.pointIdAccessor,legendPosition:Y})});Jo.displayName="RealtimeLineChart";import{useRef as en,useImperativeHandle as tn,forwardRef as on,useCallback as nn,useMemo as sn}from"react";import{jsx as rn}from"react/jsx-runtime";var an=on(function(e,t){const o=be(e.mode,{width:e.size?.[0]??e.width,height:e.size?.[1]??e.height,showAxes:e.showAxes,showLegend:e.showLegend,enableHover:null!=e.enableHover?!!e.enableHover:void 0,linkedHover:e.linkedHover,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{binSize:n,size:s,margin:r,className:i,arrowOfTime:a="right",windowMode:c="sliding",windowSize:l,data:d,timeAccessor:u,valueAccessor:h,direction:g="up",timeExtent:p,valueExtent:m,extentPadding:f,categoryAccessor:b,colors:_,fill:w,stroke:x,strokeWidth:k,opacity:A,gap:S,background:C,tooltipContent:R,tooltip:N,onHover:T,annotations:E,autoPlaceAnnotations:I,svgAnnotationRules:P,tickFormatTime:M,tickFormatValue:D,linkedHover:z,selection:L,decay:H,pulse:W,staleness:B,transition:F,onObservation:O,chartId:Y,loading:j,loadingContent:X,emptyContent:$,emphasis:V,legendPosition:G,legend:q,brush:K,onBrush:U,linkedBrush:Z}=e,J=o.showAxes,ee=o.enableHover,te=s??[o.width,o.height],oe=sn(()=>_?e=>_[e]??w??"#999":void 0,[_,w]),{legend:ne,margin:se,legendPosition:ie}=ve({data:d??[],colorBy:b,colorScale:oe,showLegend:o.showLegend,legendPosition:G,userMargin:r,defaults:o.marginDefaults,additionalLegend:q,chartWidth:te[0],axisChrome:{hasAxis:!1!==o.showAxes}}),ce=R??N??function(e={}){const{timeAccessor:t,valueAccessor:o}=e;return e=>{const n=e?.data??null;if(null==n?.binStart||null==n?.binEnd){const e=Wo(n,t,"time"),s=Wo(n,o,"value");return zo("div",{className:"semiotic-tooltip",style:Lo,children:[zo("div",{children:[Do("span",{style:Ho,children:"x:"}),Bo(e)]}),zo("div",{children:[Do("span",{style:Ho,children:"y:"}),Bo(s)]})]})}return zo("div",{className:"semiotic-tooltip",style:Lo,children:[zo("div",{children:[Do("span",{style:Ho,children:"range:"}),Bo(n.binStart),"–",Bo(n.binEnd)]}),null!=n.total&&zo("div",{children:[Do("span",{style:Ho,children:"count:"}),Bo(n.total)]}),null!=n.category&&zo("div",{children:[Do("span",{style:Ho,children:"category:"}),Bo(n.category)]})]})}}({timeAccessor:u,valueAccessor:h}),le=en(null),{customHoverBehavior:de}=_e({selection:L,linkedHover:z,unwrapData:!0,onObservation:O,chartType:"RealtimeHistogram",chartId:Y}),ue=nn(e=>{T&&T(e),de(e)},[T,de]),ge=!0===K?{dimension:"x",snap:"bin"}:"x"===K?{dimension:"x"}:"object"==typeof K?K:void 0,pe=Q(Z),ye="string"==typeof u?u:"time",me=fe({name:pe?.name||"__unused_hist_brush__",xField:pe?.xField||ye,...pe?.yField?{yField:pe.yField}:{}}),we=en(me.brushInteraction);we.current=me.brushInteraction;const xe=nn(e=>{if(U&&U(e),O&&O(e?{type:"brush",extent:e,timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:Y}:{type:"brush-end",timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:Y}),pe){const t=we.current;t.end(e?"xBrush"===t.brush?e.x:"yBrush"===t.brush?e.y:[[e.x[0],e.y[0]],[e.x[1],e.y[1]]]:null)}},[U,O,Y,pe]);tn(t,()=>({push:e=>le.current?.push(e),pushMany:e=>le.current?.pushMany(e),remove:e=>le.current?.remove(e)??[],update:(e,t)=>le.current?.update(e,t)??[],clear:()=>le.current?.clear(),getData:()=>le.current?.getData()??[],getScales:()=>le.current?.getScales()??null}),[]);const ke=ae(j,te[0],te[1],X),Ae=ke?null:re(d,te[0],te[1],$),Se={};null!=w&&(Se.fill=w),null!=x&&(Se.stroke=x),null!=k&&(Se.strokeWidth=k),null!=A&&(Se.opacity=A),null!=S&&(Se.gap=S);const Ce=V?`${i||""} semiotic-emphasis-${V}`.trim():i,Re=Oo(l,d),Ne=sn(()=>"down"!==g?m:he({data:d,valueAccessor:h,timeAccessor:u,binSize:n,valueExtent:m,extentPadding:f}),[g,d,h,u,n,m,f]);return ke||Ae||rn(y,{ref:le,chartType:"bar",runtimeMode:"streaming",size:te,margin:se,className:Ce,arrowOfTime:a,windowMode:c,windowSize:Re,data:d,timeAccessor:u,valueAccessor:h,xExtent:p,yExtent:Ne,extentPadding:f,binSize:n,categoryAccessor:b,barColors:_,barStyle:Se,showAxes:J,background:C,hoverAnnotation:ee,tooltipContent:ce,...v({linkedHover:z,selection:L,onObservation:O,forceHoverBehavior:!0,mobileInteraction:o.mobileInteraction,customHoverBehavior:ue}),annotations:E,autoPlaceAnnotations:I,svgAnnotationRules:P,tickFormatTime:M,tickFormatValue:D,decay:H,pulse:W,staleness:B,transition:F,pointIdAccessor:e.pointIdAccessor,legend:ne,legendPosition:ie,brush:ge||(Z?{dimension:"x"}:void 0),onBrush:ge||Z?xe:void 0})});function cn(e){return rn(an,{...e,windowMode:"growing"})}an.displayName="RealtimeHistogram",cn.displayName="TemporalHistogram";import{useRef as ln,useImperativeHandle as dn,forwardRef as un,useCallback as hn}from"react";import{jsx as gn}from"react/jsx-runtime";var pn=un(function(e,t){const o=be(e.mode,{width:e.size?.[0]??e.width,height:e.size?.[1]??e.height,enableHover:null!=e.enableHover?!!e.enableHover:void 0,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{size:n,margin:s,className:r,arrowOfTime:i="right",windowMode:a="sliding",windowSize:c,data:l,timeAccessor:d,valueAccessor:u,timeExtent:h,valueExtent:g,yScaleType:p,extentPadding:m,categoryAccessor:f,colors:b,radius:_,fill:w,opacity:x,stroke:k,strokeWidth:A,pointStyle:S,background:C,tooltipContent:R,tooltip:N,onHover:T,annotations:E,autoPlaceAnnotations:I,svgAnnotationRules:P,tickFormatTime:M,tickFormatValue:D,linkedHover:z,selection:L,onObservation:H,chartId:W,loading:B,loadingContent:F,emptyContent:O,emphasis:Y,legendPosition:j}=e,X=o.showAxes,$=o.enableHover,V=s??o.marginDefaults,G=n??[o.width,o.height],Q=R??N??Fo({timeAccessor:d,valueAccessor:u}),q=ln(null),{customHoverBehavior:K}=_e({selection:L,linkedHover:z,unwrapData:!0,onObservation:H,chartType:"RealtimeSwarmChart",chartId:W}),U=hn(e=>{T&&T(e),K(e)},[T,K]);dn(t,()=>({push:e=>q.current?.push(e),pushMany:e=>q.current?.pushMany(e),remove:e=>q.current?.remove(e)??[],update:(e,t)=>q.current?.update(e,t)??[],clear:()=>q.current?.clear(),getData:()=>q.current?.getData()??[],getScales:()=>q.current?.getScales()??null}),[]);const Z=ae(B,G[0],G[1],F),J=Z?null:re(l,G[0],G[1],O),ee={};null!=_&&(ee.radius=_),null!=w&&(ee.fill=w),null!=x&&(ee.opacity=x),null!=k&&(ee.stroke=k),null!=A&&(ee.strokeWidth=A);const te=S,oe=Y?`${r||""} semiotic-emphasis-${Y}`.trim():r,ne=Oo(c,l);return Z||J||gn(y,{ref:q,chartType:"swarm",runtimeMode:"streaming",size:G,margin:V,className:oe,arrowOfTime:i,windowMode:a,windowSize:ne,data:l,timeAccessor:d,valueAccessor:u,xExtent:h,yExtent:g,yScaleType:p,extentPadding:m,categoryAccessor:f,barColors:b,swarmStyle:ee,pointStyle:te,showAxes:X,background:C,hoverAnnotation:$,tooltipContent:Q,...v({linkedHover:z,selection:L,onObservation:H,forceHoverBehavior:!0,mobileInteraction:o.mobileInteraction,customHoverBehavior:U}),annotations:E,autoPlaceAnnotations:I,svgAnnotationRules:P,tickFormatTime:M,tickFormatValue:D,legendPosition:j,pointIdAccessor:e.pointIdAccessor})});pn.displayName="RealtimeSwarmChart";import{useRef as yn,useImperativeHandle as mn,forwardRef as fn,useCallback as vn}from"react";import{jsx as bn}from"react/jsx-runtime";var _n=fn(function(e,t){const o=be(e.mode,{width:e.size?.[0]??e.width,height:e.size?.[1]??e.height,enableHover:null!=e.enableHover?!!e.enableHover:void 0,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{size:n,margin:s,className:r,arrowOfTime:i="right",windowMode:a="sliding",windowSize:c,data:l,timeAccessor:d,valueAccessor:u,timeExtent:h,valueExtent:g,extentPadding:p,positiveColor:m,negativeColor:f,connectorStroke:b,connectorWidth:_,gap:w,stroke:x,strokeWidth:k,opacity:A,background:S,tooltipContent:C,tooltip:R,onHover:N,annotations:T,autoPlaceAnnotations:E,svgAnnotationRules:I,tickFormatTime:P,tickFormatValue:M,linkedHover:D,selection:z,onObservation:L,chartId:H,loading:W,loadingContent:B,emptyContent:F,emphasis:O,legendPosition:Y}=e,j=o.showAxes,X=o.enableHover,$=s??o.marginDefaults,V=n??[o.width,o.height],G=C??R??function(e={}){const{timeAccessor:t,valueAccessor:o}=e;return e=>{const n=e?.data??null,s=Wo(n,t,"time"),r=n?.delta??Wo(n,o,"value"),i=n?.cumEnd,a="number"==typeof r?0>r?Bo(r):"+"+Bo(r):Bo(r);return zo("div",{className:"semiotic-tooltip",style:Lo,children:[zo("div",{children:[Do("span",{style:Ho,children:"x:"}),Bo(s)]}),zo("div",{children:[Do("span",{style:Ho,children:"Δ:"}),a]}),null!=i&&zo("div",{children:[Do("span",{style:Ho,children:"total:"}),Bo(i)]})]})}}({timeAccessor:d,valueAccessor:u}),Q=yn(null),{customHoverBehavior:q}=_e({selection:z,linkedHover:D,unwrapData:!0,onObservation:L,chartType:"RealtimeWaterfallChart",chartId:H}),K=vn(e=>{N&&N(e),q(e)},[N,q]);mn(t,()=>({push:e=>Q.current?.push(e),pushMany:e=>Q.current?.pushMany(e),remove:e=>Q.current?.remove(e)??[],update:(e,t)=>Q.current?.update(e,t)??[],clear:()=>Q.current?.clear(),getData:()=>Q.current?.getData()??[],getScales:()=>Q.current?.getScales()??null}),[]);const U=ae(W,V[0],V[1],B),Z=U?null:re(l,V[0],V[1],F),J={};null!=m&&(J.positiveColor=m),null!=f&&(J.negativeColor=f),null!=b&&(J.connectorStroke=b),null!=_&&(J.connectorWidth=_),null!=w&&(J.gap=w),null!=x&&(J.stroke=x),null!=k&&(J.strokeWidth=k),null!=A&&(J.opacity=A);const ee=O?`${r||""} semiotic-emphasis-${O}`.trim():r,te=Oo(c,l);return U||Z||bn(y,{ref:Q,chartType:"waterfall",runtimeMode:"streaming",size:V,margin:$,className:ee,arrowOfTime:i,windowMode:a,windowSize:te,data:l,timeAccessor:d,valueAccessor:u,xExtent:h,yExtent:g,extentPadding:p,waterfallStyle:J,showAxes:j,background:S,hoverAnnotation:X,tooltipContent:G,...v({linkedHover:D,selection:z,onObservation:L,forceHoverBehavior:!0,mobileInteraction:o.mobileInteraction,customHoverBehavior:K}),annotations:T,autoPlaceAnnotations:E,svgAnnotationRules:I,tickFormatTime:P,tickFormatValue:M,legendPosition:Y,pointIdAccessor:e.pointIdAccessor})});_n.displayName="RealtimeWaterfallChart";import{useRef as wn,useImperativeHandle as xn,forwardRef as kn,useCallback as An}from"react";import{jsx as Sn}from"react/jsx-runtime";var Cn=kn(function(e,t){const o=be(e.mode,{width:e.size?.[0]??e.width,height:e.size?.[1]??e.height,enableHover:null!=e.enableHover?!!e.enableHover:void 0,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{size:n,margin:s,className:r,arrowOfTime:i="right",windowMode:a="sliding",windowSize:c,data:l,timeAccessor:d,valueAccessor:u,categoryAccessor:h,timeExtent:g,valueExtent:p,extentPadding:m,heatmapXBins:f=20,heatmapYBins:b=20,aggregation:_="count",background:w,tooltipContent:x,tooltip:k,onHover:A,annotations:S,autoPlaceAnnotations:C,svgAnnotationRules:R,tickFormatTime:N,tickFormatValue:T,decay:E,pulse:I,staleness:P,linkedHover:M,selection:D,onObservation:z,chartId:L,loading:H,loadingContent:W,emptyContent:B,emphasis:F,legendPosition:O}=e,Y=o.showAxes,j=o.enableHover,X=s??o.marginDefaults,$=n??[o.width,o.height],V=x??k??function(e={}){const{timeAccessor:t,valueAccessor:o,xLabel:n="x",yLabel:s="y"}=e;return e=>{const r=e?.data??null,i=r?.xCenter??Wo(r,t,"time"),a=r?.yCenter??Wo(r,o,"value"),c=r?.count,l=r?.sum,d=r?.value,u=r?.agg??"count";return zo("div",{className:"semiotic-tooltip",style:Lo,children:[zo("div",{children:[zo("span",{style:Ho,children:[n,":"]}),Bo(i)]}),zo("div",{children:[zo("span",{style:Ho,children:[s,":"]}),Bo(a)]}),null!=c&&zo("div",{children:[Do("span",{style:Ho,children:"count:"}),Bo(c)]}),"sum"===u&&null!=l&&zo("div",{children:[Do("span",{style:Ho,children:"sum:"}),Bo(l)]}),"mean"===u&&null!=d&&zo("div",{children:[Do("span",{style:Ho,children:"mean:"}),Bo(d)]})]})}}({timeAccessor:d,valueAccessor:u}),G=wn(null),{customHoverBehavior:Q}=_e({selection:D,linkedHover:M,unwrapData:!0,onObservation:z,chartType:"RealtimeHeatmap",chartId:L}),q=An(e=>{A&&A(e),Q(e)},[A,Q]);xn(t,()=>({push:e=>G.current?.push(e),pushMany:e=>G.current?.pushMany(e),remove:e=>G.current?.remove(e)??[],update:(e,t)=>G.current?.update(e,t)??[],clear:()=>G.current?.clear(),getData:()=>G.current?.getData()??[],getScales:()=>G.current?.getScales()??null}),[]);const K=ae(H,$[0],$[1],W),U=K?null:re(l,$[0],$[1],B),Z=F?`${r||""} semiotic-emphasis-${F}`.trim():r,J=Oo(c,l);return K||U||Sn(y,{ref:G,chartType:"heatmap",runtimeMode:"streaming",size:$,margin:X,className:Z,arrowOfTime:i,windowMode:a,windowSize:J,data:l,timeAccessor:d,valueAccessor:u,categoryAccessor:h,xExtent:g,yExtent:p,extentPadding:m,heatmapXBins:f,heatmapYBins:b,heatmapAggregation:_,showAxes:Y,background:w,hoverAnnotation:j,tooltipContent:V,...v({linkedHover:M,selection:D,onObservation:z,forceHoverBehavior:!0,mobileInteraction:o.mobileInteraction,customHoverBehavior:q}),annotations:S,autoPlaceAnnotations:C,svgAnnotationRules:R,tickFormatTime:N,tickFormatValue:T,decay:E,pulse:I,staleness:P,legendPosition:O,pointIdAccessor:e.pointIdAccessor})});Cn.displayName="RealtimeHeatmap";export{qe as DEFAULT_LIFECYCLE_THRESHOLDS,Ie as IncrementalExtent,Cn as RealtimeHeatmap,an as RealtimeHistogram,Jo as RealtimeLineChart,pn as RealtimeSwarmChart,_n as RealtimeWaterfallChart,Ro as ReorderBuffer,Pe as RingBuffer,_o as RunningStats,bo as StreamNetworkFrame,y as StreamXYFrame,cn as TemporalHistogram,wo as WindowAccumulator,ko as bandBounds,Ke as bandFromAge,w as compileMotionEncoding,T as deriveMotionVector,U as opacityFromAge,Co as parseWindowDuration,ge as resolveMotionAccessor,pe as resolveMotionVector,xo as statValue};
1
+ import{canUseForceWorker as e,createFrameForceWorkerRequest as t,runForceLayoutWorker as o,shouldUseForceWorker as n}from"./chunk-chunk-FJ76HWQZ.module.min.js";import{ANNOTATION_DISCLOSURE_REVEAL_CSS as s,AriaLiveTooltip as r,CanvasFrameBackground as i,DEFAULT_COLORS as a,FlippingTooltip as c,FocusRing as l,NetworkAccessibleDataTable as d,SceneRevisionDiagnosticsObserver as u,ScreenReaderSummary as h,SkipToTableLink as g,StalenessBadge as p,StreamXYFrame_default as y,TITLE_BASELINE as m,attachUpdateResultStore as f,buildCustomBehaviorProps as v,buildNavGraph as b,buildResolveColor as x,compileMotionEncoding as _,composeOverlays as w,computeDecayOpacity as A,computeEasing as k,computeNetworkAriaLabel as S,computeRawProgress as R,createCustomLayoutFailureDiagnostic as C,createDefaultAnnotationRules as N,deriveMotionVector as T,emitClickObservations as E,emitHoverObservations as P,extractNetworkNavPoints as I,filterSparseArray as D,findHitPointInQuadtree as M,formatVal as z,getDevicePixelRatio as L,getLayoutPlugin as H,isInteractiveKeyboardTarget as W,isServerEnvironment as B,lerp as F,needsDataCanvasPaint as O,networkGlyphRenderer as Y,networkLabelToSVG as j,networkSceneEdgeToSVG as X,networkSceneNodeToSVG as $,networkSymbolRenderer as V,nextNetworkIndex as G,normalizeLinkedBrush as Q,now as q,observationInputType as K,opacityFromAge as U,paintCanvasBackground as Z,paintNetworkFill as J,paintNetworkStroke as ee,paintSceneWithBackend as te,prepareCanvas as oe,renderAnnotationPass as ne,renderCirclePulse as se,renderEmptyState as re,renderLegendFromConfig as ie,renderLoadingState as ae,renderRectPulse as ce,renderSceneWithBackend as le,resolveCanvasFill as de,resolveCustomLayoutPalette as ue,resolveDownwardHistogramExtent as he,resolveMotionAccessor as ge,resolveMotionVector as pe,resolvePosition as ye,runSceneBuild as me,useBrushSelection as fe,useChartLegendAndMargin as ve,useChartMode as be,useChartSelection as xe,useConfigSync as _e,useFrame as we,useFrameCanvasHost as Ae,useHydration as ke,useLayoutSelectionSync as Se,useSceneRevisionDiagnostics as Re,useStableShallow as Ce,useStalenessCheck as Ne,useWasHydratingFromSSR as Te,warnCustomLayoutDiagnostics as Ee}from"./chunk-chunk-A3I4HBD5.module.min.js";import"./chunk-chunk-OZK46A5U.module.min.js";import{IncrementalExtent as Pe,RingBuffer as Ie,annotationActivationProps as De,buildHoverData as Me,defaultTooltipStyle as ze,getHitRadius as Le,hitTestRect as He,isAnnotationActivationTarget as We,normalizeAngle as Be,smartTooltipEntries as Fe,useAnnotationActivationOptions as Oe}from"./chunk-chunk-6S3YGYW7.module.min.js";import{CustomLayoutSelectionProvider as Ye,UpdateResultTracker as je,annotationLayout as Xe,glyphHitGeometry as $e,schemeCategory10 as Ve,symbolRadius as Ge,wrapWithCustomLayoutSelection as Qe}from"./chunk-chunk-LSJUXBMF.module.min.js";import"./chunk-chunk-U66USBWU.module.min.js";import{DEFAULT_LIFECYCLE_THRESHOLDS as qe,bandFromAge as Ke,filterAnnotationsByStatus as Ue}from"./chunk-chunk-5VVNW5AZ.module.min.js";import"./chunk-chunk-NWIGA3UK.module.min.js";import"./chunk-chunk-JJ2OOIET.module.min.js";import{resolveCSSColor as Ze}from"./chunk-chunk-IY7RYD4S.module.min.js";import"./chunk-chunk-J3QOW4OE.module.min.js";import{resolveThemeSemanticColors as Je}from"./chunk-chunk-HADHLMY5.module.min.js";import*as et from"react";import{useRef as tt,useState as ot,useEffect as nt,useMemo as st,useCallback as rt,useImperativeHandle as it,forwardRef as at,memo as ct}from"react";var lt={weightChange:.1,newEdge:.5,newNode:1,threshold:3,transitionDuration:500},dt={radius:3,opacity:.7,speedMultiplier:1,maxPerEdge:50,spawnRate:.1},ut=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 n=this.particles[o];return n.active=!0,n.t=0,n.offset=t()-.5,n.edgeIndex=e,n.x=0,n.y=0,n}step(e,t,o,n){for(let s=0;this.capacity>s;s++){const r=this.particles[s];if(!r.active)continue;const i=o[r.edgeIndex];i&&i.bezier?(r.t+=e*t*(n?n[r.edgeIndex]??1:1)*(i.bezier.circular?.3:1),1>r.t?ht(i.bezier,r.t,r.offset,r):(r.active=!1,this._freeIndices.push(s))):(r.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 ht(e,t,o,n){if(e.circular&&e.segments)return void function(e,t,o,n,s){const r=e.length,i=t*r,a=Math.min(Math.floor(i),r-1),c=i-a,[l,d,u,h]=e[a];gt(l,d,u,h,c,s);const g=h.x-l.x,p=h.y-l.y,y=Math.sqrt(g*g+p*p);if(y>.001){const e=g/y;s.x+=-p/y*o*n*2,s.y+=e*o*n*2}}(e.segments,t,o,e.halfWidth,n);if(!e.points)return n.x=0,void(n.y=0);const[s,r,i,a]=e.points;gt(s,r,i,a,t,n);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;n.x+=-l/d*o*e.halfWidth*2,n.y+=t*o*e.halfWidth*2}}function gt(e,t,o,n,s,r){const i=1-s,a=i*i,c=a*i,l=s*s,d=l*s;r.x=c*e.x+3*a*s*t.x+3*i*l*o.x+d*n.x,r.y=c*e.y+3*a*s*t.y+3*i*l*o.y+d*n.y}import{quadtree as pt}from"d3-quadtree";function yt(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 mt(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(!ft(e))return!1;return!0}return ft(t.points)}function ft(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 vt}from"d3-interpolate";var bt="rgba(34, 197, 94, 0.7)",xt=2e3,_t=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],wt=["scene-style","data-paint","accessibility","evidence"],At=(e,t)=>({retainedData:e,invalidations:t}),kt=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],St=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Rt=["scene-geometry","data-paint","overlay","accessibility","evidence"],Ct=["scene-style","data-paint","accessibility","evidence"],Nt=["scene-geometry","data-paint","overlay","accessibility","evidence"],Tt=[],Et={chartType:At("rebuild",kt),nodeIDAccessor:At("rebuild",kt),sourceAccessor:At("rebuild",kt),targetAccessor:At("rebuild",kt),valueAccessor:At("rebuild",kt),edgeIdAccessor:At("rebuild",kt),childrenAccessor:At("rebuild",kt),hierarchySum:At("rebuild",kt),orientation:At("preserve",St),nodeAlign:At("preserve",St),nodePaddingRatio:At("preserve",St),nodeWidth:At("preserve",St),edgeSort:At("preserve",St),iterations:At("preserve",St),forceStrength:At("preserve",St),padAngle:At("preserve",St),groupWidth:At("preserve",St),sortGroups:At("preserve",St),treeOrientation:At("preserve",St),edgeType:At("preserve",St),padding:At("preserve",St),paddingTop:At("preserve",St),orbitMode:At("preserve",St),orbitSize:At("preserve",St),orbitSpeed:At("preserve",St),orbitRevolution:At("preserve",St),orbitRevolutionStyle:At("preserve",St),orbitEccentricity:At("preserve",St),orbitShowRings:At("preserve",St),orbitAnimated:At("preserve",St),customNetworkLayout:At("preserve",St),layoutConfig:At("preserve",St),nodeSize:At("preserve",Rt),nodeSizeRange:At("preserve",Rt),colorByDepth:At("preserve",Rt),nodeLabel:At("preserve",Nt),showLabels:At("preserve",Nt),labelMode:At("preserve",Nt),nodeStyle:At("preserve",Ct),edgeStyle:At("preserve",Ct),colorBy:At("preserve",Ct),colorScheme:At("preserve",Ct),themeCategorical:At("preserve",Ct),themeSemantic:At("preserve",Ct),edgeColorBy:At("preserve",Ct),edgeOpacity:At("preserve",Ct),showParticles:At("preserve",Ct),particleStyle:At("preserve",Ct),decay:At("preserve",Ct),pulse:At("preserve",Ct),thresholds:At("preserve",Ct),staleness:At("preserve",Ct),layoutSelection:At("preserve",Ct),clock:At("preserve",Tt),random:At("preserve",Tt),seed:At("preserve",Tt),tensionConfig:At("preserve",Tt),transition:At("preserve",Tt),introAnimation:At("preserve",Tt),onLayoutError:At("preserve",Tt),__skipForceSimulation:At("preserve",Tt),__hierarchyRoot:At("preserve",Tt),__orbitState:At("preserve",Tt),__previousPositions:At("preserve",Tt)},Pt=At("preserve",St),It=class{constructor(){this.tracker=new je}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}},_t)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},wt):this.recordNoop("restyle")}recordConfig(e){const t=function(e){let t="preserve";const o=new Set;for(const n of e){const e=Et[n]??Pt;"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)}},Dt=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.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 It,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={...lt,...e.tensionConfig},e.showParticles&&("sankey"===e.chartType||e.customNetworkLayout)&&(this.particlePool=new ut(2e3))}currentTime(){return this.config.clock?.()??q()}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 n=[...new Set([...Object.keys(t),...Object.keys(o)])].filter(e=>t[e]!==o[e]);this.config=o,this.tensionConfig={...lt,...o.tensionConfig},!o.showParticles||"sankey"!==o.chartType&&!o.customNetworkLayout||this.particlePool||(this.particlePool=new ut(2e3)),this.updateResults.recordConfig(n)}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,n){const{nodeIDAccessor:s="id",sourceAccessor:r="source",targetAccessor:i="target",valueAccessor:a="value"}=this.config,c="function"==typeof s?s:e=>e[s],l="function"==typeof r?r:e=>e[r],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,{...yt(e),data:t})}for(let e=0;t.length>e;e++){const o=t[e],n=l(o)+"",s=d(o)+"",r=u(o),i=null==r?NaN:Number(r),a=Number.isFinite(i)?i:1;this.nodes.has(n)||this.nodes.set(n,{...yt(n),data:o}),this.nodes.has(s)||this.nodes.set(s,{...yt(s),data:o});const c=`${n}\0${s}\0${e}`,h={source:n,target:s,value:a,y0:0,y1:0,sankeyWidth:0,data:o,_edgeKey:c};o&&"object"==typeof o&&mt(o.bezier)&&(h.bezier=o.bezier),this.edges.set(c,h)}n?.deferLayout||this.runLayout(o),this.updateResults.recordData("replace",e.length+t.length)}ingestBoundedWithResult(e,t,o,n){return this.ingestBounded(e,t,o,n),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:n}=e,s=0===this.nodes.size;let r=!1;const i=this.currentTime();this.lastIngestTime=i,this._decaySortedNodes=null,this._networkDecayCache=null,this.nodes.has(t)||(this.nodes.set(t,yt(t)),this.nodeTimestamps.set(t,i),this.tension+=this.tensionConfig.newNode,r=!0),this.nodes.has(o)||(this.nodes.set(o,yt(o)),this.nodeTimestamps.set(o,i),this.tension+=this.tensionConfig.newNode,r=!0);const a=this.edgeKey(t,o),c=this.edges.get(a);let l=!1;c?(c.value+=n,this.edgeTimestamps.set(a,i),this.tension+=this.tensionConfig.weightChange,l=!0):(this.edges.set(a,{source:t,target:o,value:n,y0:0,y1:0,sankeyWidth:0}),this.edgeTimestamps.set(a,i),this.tension+=this.tensionConfig.newEdge,r=!0);const d=s||r||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=H(this.config.chartType);if(!t)return;let o=Array.from(this.nodes.values());const n=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,n,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;n.length>e;e++){const t=n[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 r=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 r&&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:n,baseStyles:s,selection:r}){const i=!(!o&&!n);if(o)for(const t of e){const e=s.get(t)??t.style,n=o(t,r);t.style=n?{...e,...n}:e}if(n)for(const e of t){const t=s.get(e)??e.style,o=n(e,r);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:n,edges:s,previousResult:r,revision:i}){const a=ue(e.colorScheme,e.themeCategorical,Ve),c={nodes:n,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:x(a,e.colorScheme),config:e.layoutConfig??{},selection:e.layoutSelection??null};try{return{kind:"success",result:t(c)}}catch(t){const o=null!==r,n=C("network",t,o,i);"production"!==process.env.NODE_ENV&&console.error("[semiotic] customNetworkLayout threw:",t);try{e.onLayoutError?.(n)}catch(e){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",e)}return{kind:"failure",diagnostic:n,preservedLastGoodScene:o}}}({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=[],this.customLayoutOverlays=null,this.customLayoutHtmlMarks=[],this.lastCustomLayoutResult=null,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??[],this.customLayoutOverlays=o.overlays??null,this.customLayoutHtmlMarks=o.htmlMarks??[],this.lastCustomLayoutResult=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 Ee({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,this.customLayoutOverlays=null,this.customLayoutHtmlMarks=[],this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null;const t=H(this.config.chartType);if(!t)return void this._sceneNodesRevision++;const o=t.hierarchical?Array.from(this.nodes.values()):this.nodesArray,n=t.hierarchical?Array.from(this.edges.values()):this.edgesArray,{sceneNodes:s,sceneEdges:r,labels:i}=t.buildScene(o,n,this.config,e);this.sceneNodes=s,this.sceneEdges=r,this.labels=i,this._sceneNodesRevision++}rebuildNodeQuadtree(){let t=0,o=0;for(const e of this.sceneNodes)"circle"===e.type&&(t++,e.r>o&&(o=e.r));if(this._maxNodeRadius=o,e.QUADTREE_THRESHOLD>=t)return void(this._nodeQuadtree=null);const n=Array(t);let s=0;for(const e of this.sceneNodes)"circle"===e.type&&(n[s++]=e);this._nodeQuadtree=pt().x(e=>e.cx).y(e=>e.cy).addAll(n)}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=H(this.config.chartType);return!!e?.supportsAnimation&&!1!==this.config.orbitAnimated}tickAnimation(e,t){const o=H(this.config.chartType);if(!o?.tick)return!1;const n=o.hierarchical?Array.from(this.nodes.values()):this.nodesArray,s=o.hierarchical?Array.from(this.edges.values()):this.edgesArray;return o.tick(n,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=R(e,this.transition),o=k(t);for(const e of this.nodes.values())void 0===e._targetX0||void 0===e._prevX0||0===e._prevX0&&0===e._prevX1||(e.x0=F(e._prevX0,e._targetX0,o),e.x1=F(e._prevX1,e._targetX1,o),e.y0=F(e._prevY0,e._targetY0,o),e.y1=F(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=F(e._prevY0,e._targetY0,o),e.y1=F(e._prevY1,e._targetY1,o),e.sankeyWidth=F(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 n="string"==typeof e.source?t.get(e.source):e.source,s="string"==typeof e.target?t.get(e.target):e.target;!n||!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))),n=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-n,y:o.targetY},{x:o.targetX-.66*n,y:o.targetY},{x:o.targetX-.33*n,y:o.targetY},{x:o.targetX,y:o.targetY}]],halfWidth:t}}let n;n="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;n.length-1>e;e++){const t=n[e],o=n[e+1],r=o.x-t.x,i=o.y-t.y;s.push([t,{x:t.x+r/3,y:t.y+i/3},{x:t.x+2*r/3,y:t.y+2*i/3},o])}return{circular:!0,segments:s,halfWidth:t}}(e):function(e,t,o,n=.5){const s=(e.sankeyWidth||1)/2;if("down"===e.direction){const r=t.x1,i=o.x0,a=vt(r,i);return{circular:!1,points:[{x:e.y0,y:r},{x:e.y0,y:a(n)},{x:e.y1,y:a(1-n)},{x:e.y1,y:i}],halfWidth:s}}const r=t.x1,i=o.x0,a=vt(r,i);return{circular:!1,points:[{x:r,y:e.y0},{x:a(n),y:e.y0},{x:a(1-n),y:e.y1},{x:i,y:e.y1}],halfWidth:s}}(e,n,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,n=t.color??"rgba(255,255,255,0.6)",s=t.glowRadius??4,{now:r}=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=r-a;o>c&&(t._pulseIntensity=1-c/o,t._pulseColor=n,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=r-c;o>l&&(t._pulseIntensity=1-l/o,t._pulseColor=n)}}({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 n=e.cache.ageMap;for(const s of e.sceneNodes){const e=s.id;if(!e)continue;const r=n.get(e);if(void 0===r)continue;const i=A(t,r,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===bt&&(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>=xt)return;const o=1-t/xt;for(const t of e.sceneNodes){const n=t.id;n&&e.addedNodes.has(n)&&(t._pulseIntensity=Math.max(t._pulseIntensity??0,o),t._pulseColor=bt,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&&xt>o-t}(this.addedNodes,this.lastTopologyChangeTime)}applyThresholds(e){!function(e){const t=e.thresholds;if(!t)return;const o=t.warningColor??"#f59e0b",n=t.criticalColor??"#ef4444",s=!1!==t.pulse;for(const r of e.sceneNodes){const i=r.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=n,l&&(r.style={...r.style,fill:l},s&&(r._pulseIntensity=.6+.4*Math.sin(e.now/300),r._pulseColor=l,r._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 n=o.data?{...o.data}:{};return o.data=t(o.data??{}),this.layoutVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",1),n}updateEdge(e,t,o){const n=this.config.valueAccessor,s="function"==typeof n?n:n?e=>e[n]:e=>e.value,r=[];for(const[,n]of this.edges)if(("string"==typeof n.source?n.source:n.source.id)===e&&("string"==typeof n.target?n.target:n.target.id)===t){r.push(n.data?{...n.data}:{}),n.data=o(n.data??{});const e=s(n.data);null!=e&&(n.value=Number(e))}return r.length>0?(this.layoutVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",r.length)):this.updateResults.recordNoop("update"),r}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 n="function"==typeof t?t:e=>e?.[t];for(const[t,s]of this.edges)s.data&&n(s.data)===e&&o.push(t)}else for(const[n,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(n);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=[],this.customLayoutOverlays=null,this.customLayoutHtmlMarks=[],this.lastCustomLayoutResult=null,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")}};Dt.QUADTREE_THRESHOLD=500;var Mt=Dt;f(Mt);import*as zt from"react";import{Fragment as Lt,jsx as Ht,jsxs as Wt}from"react/jsx-runtime";function Bt(e){const{width:t,height:o,totalWidth:n,totalHeight:r,margin:i,labels:a,title:c,legend:l,legendHoverBehavior:d,legendClickBehavior:u,legendHighlightedCategory:h,legendIsolatedCategories:g,legendPosition:p="right",legendLayout:y,foregroundGraphics:f,sceneNodes:v,annotations:b,onAnnotationActivate:x,onObservation:_,chartId:w,chartType:A,autoPlaceAnnotations:k,svgAnnotationRules:S}=e,R=Oe({onAnnotationActivate:x,onObservation:_,chartId:w,chartType:A}),C=zt.useMemo(()=>{const e=(v||[]).flatMap(e=>{const t=function(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 n=$e(e.glyph,e.size);return{x:t+n.centerDx,y:o+n.centerDy,r:Math.max(1,n.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,Ge(e.size)):Math.max(1,e.w??0,e.h??0)/2}}(e),o=function(e){const t=e.id??e.datum?.id??e.datum?.data?.id??e.datum?.data?.name;return null==t?void 0:t+""}(e);return t?[{pointId:o,...t}]:[]});return{scales:null,width:t,height:o,frameType:"network",pointNodes:e,sceneNodes:v}},[o,v,t]),T=zt.useMemo(()=>{if(!b)return b;const e=Ue(b);return k?Xe({annotations:e,context:C,..."object"==typeof k?k:{}}):e},[b,k,C]),E=zt.useMemo(()=>N("network"),[]),P=T?ne(T.filter(e=>"widget"!==e.type),E,S,C):null,I=!0===T?.some(e=>"widget"===e.type&&!0===e._annotationDeferred);return Wt(Lt,{children:[I&&Ht("style",{children:s},"annotation-widget-disclosure-style"),Wt("svg",{role:"img",width:n,height:r,style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[Ht("title",{children:"string"==typeof c?c:"Network Chart"}),Ht("desc",{children:"string"==typeof c?c+" (network data visualization)":"Network data visualization"}),Wt("g",{transform:`translate(${i.left},${i.top})`,children:[a.map((e,t)=>Ht("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)),P,f]}),c&&"string"==typeof c?Ht("text",{x:n/2,y:m,textAnchor:"middle",fontWeight:600,fill:"currentColor",fontSize:14,className:"semiotic-chart-title",style:{fontSize:"var(--semiotic-title-font-size, 14px)"},children:c}):c?Ht("foreignObject",{x:0,y:0,width:n,height:i.top,children:c}):null,ie({legend:l,totalWidth:n,totalHeight:r,margin:i,legendPosition:p,title:c,legendLayout:y,legendHoverBehavior:d,legendClickBehavior:u,legendHighlightedCategory:h,legendIsolatedCategories:g})]}),T?.filter(e=>"widget"===e.type&&e.nodeId&&v).map((e,t)=>{const o=!0===e._annotationDeferred,n=v.find(t=>t.id===e.nodeId||t.datum?.id===e.nodeId||t.datum?.data?.id===e.nodeId||t.datum?.data?.name===e.nodeId);if(!n)return null;const s=i.left+(n.cx??(null!=n.x&&null!=n.w?n.x+n.w/2:n.x??0)),r=i.top+(n.cy??(null!=n.y&&null!=n.h?n.y+n.h/2:n.y??0)),a=e.dx??0,c=e.dy??-16,l=e.width??32,d=e.height??32,u=e.content??Ht("span",{style:{fontSize:18,cursor:"default"},children:"ℹ️"});return Ht("div",{...De(e,R),className:o?"annotation-deferred":void 0,"data-annotation-disclosure":o?"deferred":void 0,style:{position:"absolute",left:s+a-l/2,top:r+c-d/2,width:l,height:d,display:"flex",alignItems:"center",justifyContent:"center",zIndex:5},children:u},"widget-"+t)})]})}Bt.displayName="NetworkSVGOverlay";import*as Ft from"react";import{jsx as Ot}from"react/jsx-runtime";var Yt={position:"absolute",top:0,left:0,pointerEvents:"none"};function jt({marks:e,margin:t,selection:o=null,overscan:n=400}){const s=Ft.useRef(null),r=function(e,t,o){const[n,s]=Ft.useState(null);return Ft.useLayoutEffect(()=>{const e=t.current,o=function(e){let t=e?.parentElement??null;for(;t;){const{overflow:e,overflowX:o,overflowY:n}=window.getComputedStyle(t);if(/(auto|scroll|overlay)/.test(`${e} ${n} ${o}`))return t;t=t.parentElement}return null}(e);if(!e||!o)return void s(null);let n=0;const r=()=>{n=0;const t=o.getBoundingClientRect(),r=e.getBoundingClientRect();s(0!==t.width&&0!==t.height?{scroll:{left:t.left,top:t.top,right:t.right,bottom:t.bottom},originX:r.left,originY:r.top}:null)},i=()=>{0===n&&(n=window.requestAnimationFrame(r))};r(),o.addEventListener("scroll",i,{passive:!0});const a=new ResizeObserver(i);return a.observe(o),()=>{0!==n&&window.cancelAnimationFrame(n),o.removeEventListener("scroll",i),a.disconnect()}},[t,e,o]),Ft.useMemo(()=>{if(!e||!n)return e;const{scroll:t,originX:s,originY:r}=n,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=r+e.y;return!(i>t+e.width||t>a||c>o+e.height||o>l)})},[e,n,o])}(e,s,n);if(!e||0===e.length)return null;const i=Ot("div",{className:"semiotic-network-html-marks",ref:s,style:{...Yt,transform:`translate(${t.left}px, ${t.top}px)`},children:(r??e).map(e=>Ot("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?Ot(Ye,{value:o,children:i}):i}import{jsx as Xt,jsxs as $t}from"react/jsx-runtime";function Vt({props:e,store:t,responsiveRef:o,size:n,margin:s,adjustedWidth:r,adjustedHeight:i,resolvedBackground:a,resolvedForeground:c}){const{chartType:l,nodes:d,edges:u,data:g,className:p,description:y,title:m,responsiveWidth:f,responsiveHeight:v,summary:b,background:x,renderMode:_,legend:A,legendPosition:k,legendLayout:S,legendHoverBehavior:R,legendClickBehavior:C,legendHighlightedCategory:N,legendIsolatedCategories:T,layoutSelection:E,annotations:P,onAnnotationActivate:I,annotationObservationCallback:M,onObservation:z,chartId:L,autoPlaceAnnotations:H,svgAnnotationRules:W}=e;if(t){const e=["tree","cluster","treemap","circlepack","partition","orbit"].includes(l),o=e?g||(Array.isArray(u)?void 0:u):void 0;if(e&&o)t.ingestHierarchy(o,[r,i]),t.buildScene([r,i]);else{const e=D(d),o=Array.isArray(u)?D(u):[];(e.length>0||o.length>0)&&(t.ingestBounded(e,o,[r,i]),t.buildScene([r,i]))}}const B=t?.sceneNodes??[],F=t?.sceneEdges??[],O=t?.labels??[];return $t("div",{ref:o,className:"stream-network-frame"+(p?" "+p:""),role:"img","aria-label":y||("string"==typeof m?m:"Network chart"),style:{position:"relative",width:f?"100%":n[0],height:v?"100%":n[1]},children:[Xt(h,{summary:b}),$t("svg",{xmlns:"http://www.w3.org/2000/svg",width:n[0],height:n[1],style:{position:"absolute",left:0,top:0},children:[a&&Xt("g",{transform:`translate(${s.left},${s.top})`,children:a}),$t("g",{transform:`translate(${s.left},${s.top})`,children:[x&&Xt("rect",{x:0,y:0,width:r,height:i,fill:x}),F.map((e,t)=>le({node:e,index:t,renderMode:_,fallback:()=>X(e,t)})).filter(Boolean),B.map((e,t)=>le({node:e,index:t,renderMode:_,fallback:()=>$(e,t)})).filter(Boolean),O.map((e,t)=>j(e,t)).filter(Boolean)]})]}),Xt(Bt,{width:r,height:i,totalWidth:n[0],totalHeight:n[1],margin:s,labels:O,sceneNodes:B,title:m,legend:A,legendPosition:k,legendLayout:S,legendHoverBehavior:R,legendClickBehavior:C,legendHighlightedCategory:N,legendIsolatedCategories:T,foregroundGraphics:w(c,Qe(t?.customLayoutOverlays,E??null)),annotations:P,onAnnotationActivate:I,onObservation:M??z,chartId:L,chartType:"StreamNetworkFrame",autoPlaceAnnotations:H,svgAnnotationRules:W,annotationFrame:0}),Xt(jt,{marks:t?.customLayoutHtmlMarks,margin:s,selection:E??null})]})}import{jsx as Gt,jsxs as Qt}from"react/jsx-runtime";var qt=/^(value|amount|total|count|weight|score)$/i;function Kt({data:e}){if("edge"===e.nodeOrEdge){const t=e.data;return t?Qt("div",{className:"semiotic-tooltip",style:ze,children:[Qt("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&&Qt("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 n=o;for(;n;){const o=n.data?.name??n.data?.id??t.id;null!=o&&e.unshift(o+""),n=n.parent}e.length>1&&e.shift();const s=e.length-1;return Qt("div",{className:"semiotic-tooltip",style:ze,children:[Gt("div",{children:e.map((e,t)=>Qt("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 n=(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),r=Fe(t.data??t),i=null!=r.title?r.title+"":t.id,a=r.entries.some(e=>qt.test(e.key));return Qt("div",{className:"semiotic-tooltip",style:ze,children:[Gt("div",{style:{fontWeight:600},children:i}),r.entries.map(e=>Qt("div",{style:{marginTop:4,opacity:.8},children:[e.key,": ",z(e.value)]},e.key)),!a&&null!=t.value&&t.value>0&&Qt("div",{style:{marginTop:4,opacity:.8},children:["Total:"," ","number"==typeof t.value?t.value.toLocaleString():t.value+""]}),n>0&&Qt("div",{style:{marginTop:4,opacity:.8},children:["Connections: ",n,s!==n&&` (weighted: ${s.toLocaleString()})`]})]})}function Ut(e){return e._cachedPath2D&&e._cachedPath2DSource===e.pathD||(e._cachedPath2D=new Path2D(e.pathD),e._cachedPath2DSource=e.pathD),e._cachedPath2D}function Zt(e,t){if(!t.pathD)return;e.save();const o=Ut(t);if(t.style.fill&&"none"!==t.style.fill){const n=t._gradient;if(n){const o=e.createLinearGradient(n.x0,n.y0??0,n.x1,n.y1??0),s=t.style.fillOpacity??t.style.opacity??.5,r="string"==typeof t.style.fill?t.style.fill:"#999",i=Ze(e,r)||r;o.addColorStop(0,1===n.from?i:"transparent"),o.addColorStop(1,1===n.to?i:"transparent"),e.fillStyle=o,e.globalAlpha=s}else e.fillStyle=de(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=Ze(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 Jt(e,t){e.save();const o=t.style.stroke||"#999";e.strokeStyle=Ze(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 eo(e,t){if(!t.pathD)return;e.save();const o=Ut(t);t.style.fill&&"none"!==t.style.fill&&(e.fillStyle=de(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=Ze(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 to(e,t){if(!t.pathD)return;e.save();const o=Ut(t),n=t.style.stroke||"#999";e.strokeStyle=Ze(e,n)||n,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=de(e,t.style.fill,"#007bff"),e.globalAlpha=t.style.fillOpacity??.1,e.fill(o)),e.restore()}function oo(e,t,o,n=30){switch(e.type){case"circle":return function(e,t,o,n=30){const s=t-e.cx,r=o-e.cy,i=Math.sqrt(s*s+r*r);return i>Le(e.r,n)?null:{type:"node",datum:e.datum,x:e.cx,y:e.cy,distance:i}}(e,t,o,n);case"rect":return function(e,t,o){const n=He(t,o,e);return n.hit?{type:"node",datum:e.datum,x:n.cx,y:n.cy,distance:0}:null}(e,t,o);case"arc":return function(e,t,o){const n=t-e.cx,s=o-e.cy,r=Math.sqrt(n*n+s*s);if(e.innerR-2>r||r>e.outerR+2)return null;const i=Be(Math.atan2(s,n)),a=Be(e.startAngle),c=Be(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,n=30){const s=t-e.cx,r=o-e.cy,i=Math.sqrt(s*s+r*r);return i>Le(Ge(e.size),n)?null:{type:"node",datum:e.datum,x:e.cx,y:e.cy,distance:i}}(e,t,o,n);case"glyph":return function(e,t,o,n=30){if(null==e.datum)return null;const s=$e(e.glyph,e.size),r=e.cx+s.centerDx,i=e.cy+s.centerDy,a=t-r,c=o-i,l=Math.sqrt(a*a+c*c);return l>Le(s.radius,n)?null:{type:"node",datum:e.datum,x:r,y:i,distance:l}}(e,t,o,n);default:return null}}Kt.ownsChrome=!0;var no=null,so=null;function ro(){return so||((no=document.createElement("canvas")).width=1,no.height=1,so=no.getContext("2d")),so}function io(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 ao(e,t,o){switch(e.type){case"bezier":return function(e,t,o){if(!e.pathD)return null;const n=io(e),s=ro();if(!n||!s)return null;try{if(s.isPointInPath(n,t,o))return{type:"edge",datum:e.datum,x:t,y:o,distance:0};const r=s.lineWidth;s.lineWidth=10;const i=s.isPointInStroke(n,t,o);if(s.lineWidth=r,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 n=e.x2-e.x1,s=e.y2-e.y1,r=n*n+s*s;if(0===r)return null;let i=((t-e.x1)*n+(o-e.y1)*s)/r;i=Math.max(0,Math.min(1,i));const a=e.x1+i*n,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 n=io(e),s=ro();if(!n||!s)return null;try{if(s.isPointInPath(n,t,o))return{type:"edge",datum:e.datum,x:t,y:o,distance:0};const r=s.lineWidth;s.lineWidth=10;const i=s.isPointInStroke(n,t,o);if(s.lineWidth=r,i)return{type:"edge",datum:e.datum,x:t,y:o,distance:4}}catch{}return null}(e,t,o);default:return null}}function co(e){const{clientX:t,clientY:o,canvasRect:n,margin:s,adjustedWidth:r,adjustedHeight:i,sceneNodes:a,sceneEdges:c,nodeQuadtree:l,maxNodeRadius:d,hitRadius:u=30}=e,h=t-n.left-s.left,g=o-n.top-s.top;if(0>h||h>r||0>g||g>i)return{kind:"miss-outside"};const p=function(e,t,o,n,s=30,r,i=0){let a=null,c=s,l=1/0;if(r){const e=M(r,o,n,s,i,e=>e.cx,e=>e.cy,e=>e.r);e&&(a={type:"node",datum:e.node.datum,x:e.node.cx,y:e.node.cy,distance:e.distance},c=e.distance)}for(const t of e){if(r&&"circle"===t.type)continue;const e=oo(t,o,n,s);if(e)if("rect"===t.type){const o=t.w*t.h;l>o&&(a=e,l=o)}else c>e.distance&&(a=e,c=e.distance)}if(a)return a;for(const e of t){if(!1===e.interactive)continue;const t=ao(e,o,n);t&&c>t.distance&&(a=t,c=t.distance)}return a}(a,c,h,g,u,l,d);return p?{kind:"hit",hover:Me(p.datum||{},p.x,p.y,{nodeOrEdge:p.type})}:{kind:"miss"}}import{useCallback as lo}from"react";var uo="StreamNetworkFrame";import{jsx as ho,jsxs as go}from"react/jsx-runtime";var po={top:20,right:80,bottom:20,left:80},yo={top:40,right:40,bottom:40,left:40},mo=new Set(["chord","force","circlepack","orbit"]),fo=[800,600],vo=ct(at(function(s,y){const{chartType:m,nodes:f,edges:v,data:x,initialEdges:_,nodeIDAccessor:A="id",sourceAccessor:k="source",targetAccessor:R="target",valueAccessor:C="value",edgeIdAccessor:N,childrenAccessor:T,hierarchySum:M,orientation:z="horizontal",nodeAlign:H="justify",nodePaddingRatio:F=.05,nodeWidth:j=15,iterations:X=300,forceStrength:$=.1,layoutExecution:Q="auto",layoutLoadingContent:q,onLayoutStateChange:U,padAngle:ne=.01,groupWidth:re=20,sortGroups:ie,edgeSort:le,treeOrientation:de="vertical",edgeType:ue="curve",padding:he,paddingTop:ge,tensionConfig:pe,showParticles:fe=!1,particleStyle:ve,renderMode:be,nodeStyle:xe,edgeStyle:Ee,colorBy:Pe,colorScheme:Ie="category10",edgeColorBy:De="source",edgeOpacity:ze=.5,colorByDepth:Le=!1,nodeSize:He=8,nodeSizeRange:Be=[5,20],nodeLabel:Fe,showLabels:Oe=!0,labelMode:Ye,size:je=fo,responsiveWidth:Xe,responsiveHeight:$e,margin:Ve,className:Ge,background:qe,maxDevicePixelRatio:Ke,enableHover:Ue=!0,tooltipContent:at,customHoverBehavior:ct,customClickBehavior:ut,onObservation:ht,annotationObservationCallback:gt,chartId:pt,onTopologyChange:yt,annotations:mt,onAnnotationActivate:ft,autoPlaceAnnotations:vt,svgAnnotationRules:bt,legend:xt,legendPosition:_t,legendLayout:wt,legendHoverBehavior:At,legendClickBehavior:kt,legendHighlightedCategory:St,legendIsolatedCategories:Rt,title:Ct,foregroundGraphics:Nt,backgroundGraphics:Tt,decay:Et,pulse:Pt,transition:It,animate:Dt,staleness:zt,frameScheduler:Lt,clock:Ht,random:Wt,seed:Ft,paused:Ot=!1,suspendWhenHidden:Yt=!0,thresholds:Xt,accessibleTable:$t=!0,description:Gt,summary:Qt,orbitMode:qt,orbitSize:Ut,orbitSpeed:oo,orbitRevolution:no,orbitRevolutionStyle:so,orbitEccentricity:ro,orbitShowRings:io,orbitAnimated:ao,customNetworkLayout:vo,onLayoutError:bo,layoutConfig:xo,layoutSelection:_o}=s,wo=mo.has(m)?yo:po,Ao=tt(!0),ko=we({sizeProp:je,responsiveWidth:Xe,responsiveHeight:$e,userMargin:Ve,marginDefault:wo,title:Ct,legend:xt,legendPosition:_t,foregroundGraphics:Nt,backgroundGraphics:Tt,animate:Dt,transitionProp:It,frameScheduler:Lt,clock:Ht,random:Wt,seed:Ft,paused:Ot,suspendWhenHidden:Yt,themeDirtyRef:Ao}),{reducedMotionRef:So,responsiveRef:Ro,size:Co,margin:No,adjustedWidth:To,adjustedHeight:Eo,resolvedForeground:Po,resolvedBackground:Io,transition:Do,introEnabled:Mo,tableId:zo,rafRef:Lo,renderFnRef:Ho,scheduleRender:Wo,frameRuntime:Bo,currentTheme:Fo}=ko,Oo=ke(),Yo=Te(),jo=st(()=>D(f),[f]),Xo=st(()=>Array.isArray(v)?D(v):v,[v]),$o=st(()=>({...lt,...pe}),[pe]),Vo=st(()=>({...dt,...ve}),[ve]),Go=st(()=>{return{chartType:(e={chartType:m,clock:Bo.now,random:Wt,seed:Ft,nodeIDAccessor:A,sourceAccessor:k,targetAccessor:R,valueAccessor:C,edgeIdAccessor:N,childrenAccessor:T,hierarchySum:M,orientation:z,nodeAlign:H,nodePaddingRatio:F,nodeWidth:j,iterations:X,forceStrength:$,padAngle:ne,groupWidth:re,sortGroups:ie,edgeSort:le,treeOrientation:de,edgeType:ue,padding:he,paddingTop:ge,tensionConfig:$o,showParticles:fe,particleStyle:Vo,nodeStyle:xe,edgeStyle:Ee,nodeLabel:Fe,showLabels:Oe,labelMode:Ye,colorBy:Pe,colorScheme:Ie,edgeColorBy:De,edgeOpacity:ze,colorByDepth:Le,nodeSize:He,nodeSizeRange:Be,decay:Et,pulse:Pt,transition:Do,introAnimation:Mo,staleness:zt,thresholds:Xt,orbitMode:qt,orbitSize:Ut,orbitSpeed:oo,orbitRevolution:no,orbitRevolutionStyle:so,orbitEccentricity:ro,orbitShowRings:io,orbitAnimated:ao,customNetworkLayout:vo,onLayoutError:bo,layoutConfig:xo,currentTheme:Fo}).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:Je(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},[m,Bo.now,Wt,Ft,A,k,R,C,N,T,M,z,H,F,j,X,$,ne,re,ie,le,de,ue,he,ge,$o,fe,Vo,xe,Ee,Fe,Oe,Ye,Pe,Ie,De,ze,Le,He,Be,Et,Pt,Do,Mo,zt,Xt,qt,Ut,oo,no,so,ro,io,ao,vo,bo,xo,Fo]),Qo=Ce(Go),qo=Ce({chartType:(Ko={chartType:m,nodeIDAccessor:A,sourceAccessor:k,targetAccessor:R,valueAccessor:C,edgeIdAccessor:N,childrenAccessor:T,hierarchySum:M,orientation:z,nodeAlign:H,nodePaddingRatio:F,nodeWidth:j,iterations:X,forceStrength:$,padAngle:ne,groupWidth:re,sortGroups:ie,edgeSort:le,treeOrientation:de,edgeType:ue,padding:he,paddingTop:ge,random:Wt,seed:Ft,tensionConfig:$o,customNetworkLayout:vo,orbitMode:qt,orbitSize:Ut,orbitEccentricity:ro}).chartType,nodeIDAccessor:Ko.nodeIDAccessor,sourceAccessor:Ko.sourceAccessor,targetAccessor:Ko.targetAccessor,valueAccessor:Ko.valueAccessor,edgeIdAccessor:Ko.edgeIdAccessor,childrenAccessor:Ko.childrenAccessor,hierarchySum:Ko.hierarchySum,orientation:Ko.orientation,nodeAlign:Ko.nodeAlign,nodePaddingRatio:Ko.nodePaddingRatio,nodeWidth:Ko.nodeWidth,iterations:Ko.iterations,forceStrength:Ko.forceStrength,padAngle:Ko.padAngle,groupWidth:Ko.groupWidth,sortGroups:Ko.sortGroups,edgeSort:Ko.edgeSort,treeOrientation:Ko.treeOrientation,edgeType:Ko.edgeType,padding:Ko.padding,paddingTop:Ko.paddingTop,random:Ko.random,seed:Ko.seed,tensionConfig:Ko.tensionConfig,customNetworkLayout:Ko.customNetworkLayout,orbitMode:Ko.orbitMode,orbitSize:Ko.orbitSize,orbitEccentricity:Ko.orbitEccentricity});var Ko;const Uo=tt(0),Zo=tt(0),Jo=tt(!1),en=tt(null);en.current||(en.current=new Mt(Qo));const tn=Re("StreamNetworkFrame"),on=rt((e,t,o=!1)=>me(tn.current,e,()=>e.buildScene(t),o),[tn]),[nn,sn]=ot(null),[rn,an]=ot(0),[cn,ln]=ot(0),[dn,un]=ot(!1),[hn,gn]=ot(!1),pn=tt(0),yn=tt(null),mn=tt(!1),fn=tt(U);fn.current=U;const vn=tt(Qo);vn.current=Qo;const bn=tt(null),xn=tt(new Map),_n=tt(0),wn=rt(e=>function(e){const{node:t,colorBy:o,colorScheme:n,nodeColorMap:s,colorIndexRef:r}=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(n)?n:a;s.set(e+"",t[r.current++%t.length])}return s.get(e+"")}}if(s.has(t.id))return s.get(t.id);const i=Array.isArray(n)?n:a,c=o?i[r.current++%i.length]:i[0];return s.set(t.id,c),c}({node:e,colorBy:Pe,colorScheme:Ie,nodeColorMap:xn.current,colorIndexRef:_n}),[Pe,Ie]),An=rt(e=>{_n.current=function(e){const{sceneNodes:t,nodes:o,nodeColorMap:n,colorScheme:s}=e;for(const e of t)e.id&&"string"==typeof e.style?.fill&&n.set(e.id,e.style.fill);const r=Array.isArray(s)?s:a,i=Array.from(o);for(let e=0;i.length>e;e++){const t=i[e];n.has(t.id)||n.set(t.id,r[e%r.length])}return i.length}({sceneNodes:e.sceneNodes,nodes:e.nodes.values(),nodeColorMap:xn.current,colorScheme:Ie})},[Ie]),kn=rt((e,t)=>{on(e,t),An(e),Ao.current=!1,e.markStylePaintPending()},[on,An]),Sn=rt(()=>{en.current?.markStylePaintPending()},[]),Rn=(Cn=Fo,Cn?.colors?.border||Cn?.colors?.secondary||Cn?.colors?.primary||"#999");var Cn;const Nn=rt(e=>function(e,t){return e?"object"==typeof e?e:t?.get(e)??null:null}(e,en.current?.nodes),[]),Tn=rt(e=>function(e){const{edge:t,edgeColorBy:o,getNodeColor:n,resolveEndpoint:s,fallback:r}=e;if("function"==typeof o)return o(t);const i=s(t.source),a=s(t.target);return"target"===o&&a?n(a):i?n(i):r}({edge:e,edgeColorBy:De,getNodeColor:wn,resolveEndpoint:Nn,fallback:Rn}),[De,wn,Rn,Nn]),En=rt(e=>function(e){const{edge:t,particleStyleColor:o,particleColorBy:n,hasExplicitParticleColorBy:s,getEdgeColor:r,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 r(t);const l=n,d=a(t.source),u=a(t.target);return"target"===l&&u?i(u):d?i(d):c}({edge:e,particleStyleColor:Vo.color,particleColorBy:Vo.colorBy,hasExplicitParticleColorBy:!!ve?.colorBy,getEdgeColor:Tn,getNodeColor:wn,resolveEndpoint:Nn,fallback:Rn}),[ve?.colorBy,Vo.color,Vo.colorBy,wn,Tn,Rn,Nn]),Pn=function(e,t,o,n,s){return("sankey"===e||t)&&o||n||s}(m,!!vo,fe,!!Pt,en.current?.isAnimating??!1);_e(en,Qo,Ao,Wo),Se(en,_o,Ao,Wo),nt(()=>{const e=en.current;e&&(kn(e,[To,Eo]),an(e=>e+1),Wo())},[Fo,To,Eo,kn,Wo]);const In=rt(()=>{const e=en.current;if(e&&(e.runLayout([To,Eo]),kn(e,[To,Eo]),an(e.layoutVersion),yt)){const{nodes:t,edges:o}=e.getLayoutData();yt(t,o)}},[To,Eo,kn,yt]),Dn=tt(!1),Mn=rt((e=!1)=>!(!e&&!Dn.current||(Dn.current=!1,In(),0)),[In]),zn=rt(()=>Mn(!1),[Mn]),Ln=rt(e=>{const t=en.current;if(!t)return!1;let o=!1,n=Dn.current;for(const s of e)null!=s&&"object"==typeof s&&(o=!0,t.ingestEdge(s)&&(n=!0));const s=Mn(n);return o||s},[Mn]),Hn=rt(e=>{if(null==e||"object"!=typeof e)return;const t=en.current;t&&(t.ingestEdge(e)&&(Dn.current=!0),Bo.isActive?Wo():zn())},[zn,Bo,Wo]),Wn=rt(e=>{Ln(e)&&Wo()},[Ln,Wo]);nt(()=>Bo.subscribe(()=>{Bo.isActive||zn()}),[zn,Bo]);const Bn=rt(()=>{Dn.current=!1,en.current?.clear(),xn.current.clear(),_n.current=0,an(en.current?.layoutVersion??0),sn(null),bn.current=null,Ao.current=!0,Wo()},[Wo]),Fn=rt(()=>{const e=en.current;e&&(e.tension+=999,Mn(!0),Wo())},[Mn,Wo]);it(y,()=>({push:Hn,pushMany:Wn,removeNode:e=>{const t=en.current?.removeNode(e)??!1;if(t){const t=bn.current?.data?"function"==typeof A?A(bn.current.data):bn.current.data[A]:void 0;bn.current&&"node"===bn.current.nodeOrEdge&&t===e&&(bn.current=null,sn(null)),xn.current.delete(e)}return Mn(t)&&(Ao.current=!0,Wo()),t},removeEdge:(e,t)=>{const o=en.current?.removeEdge(e,t)??!1;if(o&&bn.current&&"edge"===bn.current.nodeOrEdge){const o=bn.current.data;let n;n=void 0!==t?("object"==typeof o?.source?o.source.id:o?.source)===e&&("object"==typeof o?.target?o.target.id:o?.target)===t:!N||!o||("function"==typeof N?N:e=>e?.[N])(o)===e,n&&(bn.current=null,sn(null))}return Mn(o)&&(Ao.current=!0,Wo()),o},updateNode:(e,t)=>{const o=en.current?.updateNode(e,t)??null;return Mn(null!==o)&&(Ao.current=!0,Wo()),o},updateEdge:(e,t,o)=>{const n=en.current?.updateEdge(e,t,o)??[];return Mn(n.length>0)&&(Ao.current=!0,Wo()),n},clear:Bn,getTopology:()=>(zn(),en.current?.getLayoutData()??{nodes:[],edges:[]}),getCustomLayout:()=>(zn(),en.current?.lastCustomLayoutResult??null),getLayoutFailure:()=>(zn(),en.current?.lastCustomLayoutFailure??null),getTopologyDiff:()=>{zn();const e=en.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:Fn,getTension:()=>(zn(),en.current?.tension??0)}),[Hn,Wn,Bn,Fn,zn,Mn,A,Wo,N]);const On=["tree","cluster","treemap","circlepack","partition","orbit"].includes(m),Yn=On?x||(Array.isArray(v)?void 0:v):void 0;nt(()=>{const s=en.current;if(!s)return;const r=++pn.current;if(yn.current?.abort(),yn.current=null,On&&Yn)Dn.current=!1,s.ingestHierarchy(Yn,[To,Eo]),kn(s,[To,Eo]),an(s.layoutVersion),gn(!1),fn.current?.("ready"),Wo();else{const i=jo,a=Array.isArray(Xo)?Xo:[];if(null==f&&null==v||(Dn.current=!1),0===i.length&&0===a.length)return null==f&&null==v||0>=s.nodes.size&&0>=s.edges.size||Bn(),gn(!1),void fn.current?.("ready");const c=[To,Eo],l="force"===m&&!vo&&e()&&!Wt&&n(Q,i.length,a.length,X);if(l&&Yo&&!mn.current&&s.sceneNodes.length>0)return mn.current=!0,gn(!1),fn.current?.("ready"),Ao.current=!0,void Wo();if(l){const e=new AbortController;yn.current=e;const n=s._lastPositionSnapshot;s.ingestBounded(i,a,c,{deferLayout:!0});const l=s.getLayoutData(),d=t(l.nodes,l.edges,vn.current,c,n);return gn(!0),fn.current?.("pending"),o(d,e.signal).then(({positions:e})=>{r===pn.current&&(s.applyForceLayoutPositions(e,c),kn(s,c),gn(!1),fn.current?.("ready"),an(s.layoutVersion),Wo())}).catch(e=>{"AbortError"!==e.name&&r===pn.current&&(s.runLayout(c),kn(s,c),gn(!1),fn.current?.("error"),an(s.layoutVersion),Wo())}),()=>e.abort()}s.ingestBounded(i,a,c),kn(s,c),an(s.layoutVersion),gn(!1),fn.current?.("ready"),Wo()}},[jo,Xo,f,v,x,Yn,On,To,Eo,qo,Q,X,Yo,m,vo,Wt,Wo,Bn,kn]);const jn=et.useRef(!1);nt(()=>{jn.current||_&&_.length>0&&(jn.current=!0,Wn(_))},[_,Wn]);const{customHoverBehavior:Xn,customClickBehavior:$n}=function({customHoverBehavior:e,customClickBehavior:t,onObservation:o,chartId:n}){return{customHoverBehavior:lo((t,s)=>{e?.(t,s),P({onObservation:o,datum:t?t.data||t:null,x:t?.x,y:t?.y,chartType:uo,chartId:n,context:s})},[e,o,n]),customClickBehavior:lo((e,s)=>{t?.(e,s),E({onObservation:o,datum:e?e.data||e:null,x:e?.x,y:e?.y,chartType:uo,chartId:n,context:s})},[t,o,n])}}({customHoverBehavior:ct,customClickBehavior:ut,onObservation:ht,chartId:pt}),{hoverHandlerRef:Vn,hoverLeaveRef:Gn,onPointerMove:Qn,onPointerLeave:qn}=ko,Kn=()=>!vo||(en.current?.hasCustomRestyle??!1);Vn.current=e=>{if(!Ue)return;const t=Kn(),o=ss.current;if(!o)return;const n=en.current;if(!n)return;const s=co({clientX:e.clientX,clientY:e.clientY,canvasRect:o.getBoundingClientRect(),margin:No,adjustedWidth:To,adjustedHeight:Eo,sceneNodes:n.sceneNodes,sceneEdges:n.sceneEdges,nodeQuadtree:n.nodeQuadtree,maxNodeRadius:n.maxNodeRadius});"hit"===s.kind?(bn.current=s.hover,sn(s.hover),Xn?.(s.hover),t&&Wo()):bn.current&&(bn.current=null,sn(null),Xn?.(null),t&&Wo())},Gn.current=()=>{if(bn.current){const e=Kn();bn.current=null,sn(null),Xn?.(null),e&&Wo()}};const Un=tt(()=>{});Un.current=e=>{if(We(e.target))return;if(!ut&&!ht)return;const t=ss.current;if(!t)return;const o=en.current;if(!o)return;const n=co({clientX:e.clientX,clientY:e.clientY,canvasRect:t.getBoundingClientRect(),margin:No,adjustedWidth:To,adjustedHeight:Eo,sceneNodes:o.sceneNodes,sceneEdges:o.sceneEdges,nodeQuadtree:o.nodeQuadtree,maxNodeRadius:o.maxNodeRadius});"hit"===n.kind?$n(n.hover,{type:"activate",inputType:K(e.nativeEvent.pointerType)}):"miss"===n.kind&&$n(null)};const Zn=rt(e=>Un.current(e),[]),Jn=tt(-1),es=tt(null),ts=tt(-1),os=rt(e=>{if(W(e))return;const t=en.current;if(!t)return;const o=()=>{Jn.current=-1,es.current=null,ts.current=-1,bn.current=null,sn(null),Xn?.(null),Wo()},n=I(t.sceneNodes);if(0===n.length)return void(0>Jn.current||o());const s=b(n);let r=Jn.current;if(s.flat.length>r||(o(),r=-1)," "===e.key&&r>=0){e.preventDefault();const t=s.flat[r];return void $n?.(Me(t.datum||{},t.x,t.y,{nodeOrEdge:"node"}),{type:"activate",inputType:"keyboard"})}if(0>r){if("Escape"===e.key)return;if(!["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End","PageUp","PageDown","Enter"].includes(e.key))return;e.preventDefault(),Jn.current=0,ts.current=-1;const t=s.flat[0];es.current={shape:t.shape,w:t.w,h:t.h};const o=Me(t.datum||{},t.x,t.y,{nodeOrEdge:"node"});return bn.current=o,sn(o),Xn?.(o,{type:"focus",inputType:"keyboard"}),void Wo()}const i=ye(s,r),a=G(e.key,i,s,t.sceneEdges??[],ts);if(null===a)return;if(e.preventDefault(),0>a)return void o();Jn.current=a;const c=s.flat[a];es.current={shape:c.shape,w:c.w,h:c.h};const l={data:c.datum||{},x:c.x,y:c.y,__semioticHoverData:!0,nodeOrEdge:"node"};bn.current=l,sn(l),Xn?.(l,{type:"focus",inputType:"keyboard"}),Wo()},[$n,Xn,Wo]),ns=rt(e=>{Jn.current=-1,es.current=null,Qn(e)},[Qn]);Ho.current=()=>{if(Lo.current=null,zn(),!Bo.isActive)return;const e=ss.current;if(!e)return;const t=en.current;t&&function(e){const{canvas:t,store:o,sceneRevisionDiagnostics:n,size:s,margin:r,adjustedWidth:i,adjustedHeight:a,background:c,maxDevicePixelRatio:l,renderMode:d,hasBackgroundGraphics:u=!1,dirtyRef:h,resolutionDirtyRef:g,lastFrameTimeRef:p,now:y,random:m,reducedMotion:f,showParticles:v,isContinuous:b,animate:x,decay:_,pulse:w,thresholds:A,staleness:k,particleStyle:R,getParticleColor:C,pendingAnnotationFrameRef:N,lastAnnotationFrameTimeRef:T,setAnnotationFrame:E,scheduleNextFrame:P,syncColorMap:I}=e,D=t.getContext("2d");if(!D)return;const M=p.current?Math.min((y-p.current)/1e3,.1):.016;p.current=y;const z=o.advanceTransition(f?y+1e6:y),H=!f&&z,W=!f&&o.tickAnimation([i,a],M),B=h.current,F=n?.beforeCompute(o.getLastUpdateResult(),H),j=z||B||W;j&&(o.buildScene([i,a]),B&&I?.()),F&&n?.afterCompute(F,j,!1);const X=v&&!f&&!!o.particlePool,$=!!_||!!w||!!A||!1!==x&&o.hasActiveTopologyDiff||o.hasActivePulses||o.hasActiveThresholds,G=o.consumeStylePaintPending(),Q=O({dirtyOrRebuilt:B,transitioning:H,animationTicked:W,continuous:X||b,liveEncoding:$,forced:G||!0===g?.current});g&&(g.current=!1);const q=!!k&&o.lastIngestTime>0&&y-o.lastIngestTime>(k?.threshold??5e3);if(Q){const e=L(l);if(!oe(t,s,r,e))return;if(D.clearRect(-r.left,-r.top,s[0],s[1]),Z(D,{background:c,hasBackgroundGraphics:u,width:i,height:a}),_&&o.applyDecay(),w&&o.applyPulse(y),A&&o.applyThresholds(y),!1!==x&&o.applyTopologyDiff(y),q&&(D.globalAlpha=k?.dimOpacity??.5),te({context:D,nodes:o.sceneEdges,renderMode:d,pixelRatio:e,paintBuiltIn:e=>function(e,t){for(const o of t)switch(o.type){case"bezier":Zt(e,o);break;case"line":Jt(e,o);break;case"ribbon":eo(e,o);break;case"curved":to(e,o)}}(D,e)}),te({context:D,nodes:o.sceneNodes,renderMode:d,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),J(e,t.style,"#007bff",()=>e.fillRect(t.x,t.y,t.w,t.h)),ee(e,t.style,()=>e.strokeRect(t.x,t.y,t.w,t.h)),ce(e,t),e.restore())}}(D,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),J(e,t.style,"#007bff",()=>e.fill()),ee(e,t.style,()=>e.stroke()),se(e,t),e.restore())}}(D,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(),J(e,t.style,"#007bff",()=>e.fill()),ee(e,t.style,()=>e.stroke()),e.restore()}}(D,t),V(D,t),Y(D,t)}}),X&&!q){const e=o.edgesArray;if(e.length>0){!function(e,t,o,n,s=Math.random){const r=n.spawnRate??.1,i=n.maxPerEdge??50;for(let n=0;t.length>n;n++){const a=t[n];if(!a.bezier)continue;if(e.countForEdge(n)>=i)continue;const c=a.value*r*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(n)<i;t++)e.spawn(n,s)}}(o.particlePool,e,M,R,m);const t=.5*(R.speedMultiplier??1);let n;if(R.proportionalSpeed){const t=e.reduce((e,t)=>Math.max(e,t.value||1),1);n=e.map(e=>.3+(e.value||1)/t*1.7)}o.particlePool.step(M,t,e,n),function(e,t,o,n,s){const r=n.radius??3;e.globalAlpha=n.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 n.color&&"inherit"!==n.color?n.color:s(c),e.fillStyle=Ze(e,l)||l,e.beginPath(),e.arc(a.x,a.y,r,0,2*Math.PI),e.fill()}e.globalAlpha=1}(D,o.particlePool,e,R,C)}}q&&(D.globalAlpha=1)}h.current=!1,(B||H||W)&&t.setAttribute("aria-label",S(o.sceneNodes?.length??0,o.sceneEdges?.length??0,"Network chart"));const K=B||H||W||N.current;K&&y-T.current>=33?(E(e=>e+1),T.current=y,N.current=!1):N.current=!!K,(b||H||null!=o.transition||W||o.hasActivePulses||o.hasActiveThresholds||!1!==x&&o.hasActiveTopologyDiff||N.current)&&P()}({canvas:e,store:t,sceneRevisionDiagnostics:tn.current,size:Co,margin:No,adjustedWidth:To,adjustedHeight:Eo,background:qe,maxDevicePixelRatio:Ke,renderMode:be,hasBackgroundGraphics:!!Tt,dirtyRef:Ao,resolutionDirtyRef:rs,lastFrameTimeRef:Uo,now:Bo.now(),random:Bo.random,reducedMotion:!!So.current,showParticles:fe,isContinuous:Pn,animate:Dt,decay:Et,pulse:Pt,thresholds:Xt,staleness:zt,particleStyle:Vo,getParticleColor:En,pendingAnnotationFrameRef:Jo,lastAnnotationFrameTimeRef:Zo,setAnnotationFrame:ln,scheduleNextFrame:()=>{Wo()},syncColorMap:()=>An(t)})};const{canvasRef:ss,resolutionDirtyRef:rs}=Ae(ko,{hydrated:Oo,wasHydratingFromSSR:Yo,storeRef:en,dirtyRef:Ao,skipInitialCanvasPaintInvalidation:!0,canvasPaintInvalidator:Sn,maxDevicePixelRatio:Ke,canvasPaintDependencies:[m,To,Eo,qe,Tt,be,Wo]});Ne(zt,en,Ao,Wo,dn,un);const is=Ue&&nn?ho(c,{x:nn.x,y:nn.y,containerWidth:To,containerHeight:Eo,margin:No,className:"stream-network-tooltip",zIndex:2,children:at?at(nn):ho(Kt,{data:nn})}):null;if(B||!Oo&&Yo)return ho(Vt,{props:s,store:en.current,responsiveRef:Ro,size:Co,margin:No,adjustedWidth:To,adjustedHeight:Eo,resolvedBackground:Io,resolvedForeground:Po});const as=en.current;return go("div",{ref:Ro,className:"stream-network-frame"+(Ge?" "+Ge:""),role:"group","aria-label":Gt||("string"==typeof Ct?Ct:"Network chart"),tabIndex:0,"aria-busy":hn||void 0,style:{position:"relative",width:Xe?"100%":Co[0],height:$e?"100%":Co[1],overflow:"visible"},onKeyDown:os,children:["production"!==process.env.NODE_ENV&&en.current&&ho(u,{store:en.current,diagnostics:tn.current}),$t&&ho(g,{tableId:zo}),$t&&ho(d,{nodes:as?.sceneNodes??[],edges:as?.sceneEdges??[],chartType:"Network chart",tableId:zo,chartTitle:"string"==typeof Ct?Ct:void 0}),ho(h,{summary:Qt}),ho(r,{hoverPoint:nn}),go("div",{role:"img","aria-label":Gt||("string"==typeof Ct?Ct:"Network chart"),style:{position:"relative",width:"100%",height:"100%"},onMouseMove:Ue?ns:void 0,onMouseLeave:Ue?qn:void 0,onClick:ut||ht?Zn:void 0,children:[hn&&!1!==q&&ho("div",{style:{position:"absolute",inset:0,zIndex:3,background:"var(--semiotic-bg, #fff)"},children:ae(!0,Co[0],Co[1],q)}),ho(i,{size:Co,margin:No,overflowVisible:!0,children:Io}),ho("canvas",{ref:ss,"aria-label":S(as?.sceneNodes?.length??0,as?.sceneEdges?.length??0,"Network chart"),style:{position:"absolute",top:0,left:0}}),ho(Bt,{width:To,height:Eo,totalWidth:Co[0],totalHeight:Co[1],margin:No,labels:as?.labels||[],sceneNodes:as?.sceneNodes,title:Ct,legend:xt,legendPosition:_t,legendLayout:wt,legendHoverBehavior:At,legendClickBehavior:kt,legendHighlightedCategory:St,legendIsolatedCategories:Rt,foregroundGraphics:w(Po,Qe(en.current?.customLayoutOverlays,_o??null)),annotations:mt,onAnnotationActivate:ft,onObservation:gt??ht,chartId:pt,chartType:"StreamNetworkFrame",autoPlaceAnnotations:vt,svgAnnotationRules:bt,annotationFrame:cn}),ho(jt,{marks:as?.customLayoutHtmlMarks,margin:No,selection:_o??null}),ho(l,{active:Jn.current>=0,hoverPoint:nn,margin:No,size:Co,shape:es.current?.shape,width:es.current?.w,height:es.current?.h}),is,zt?.showBadge&&ho(p,{isStale:dn,position:zt.badgePosition})]})]})}));vo.displayName="StreamNetworkFrame";var bo=vo,xo=class e{constructor(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}push(e){if(!Number.isFinite(e))return;this._count+=1;const t=e-this._mean;this._mean+=t/this._count,this._m2+=t*(e-this._mean),this._min>e&&(this._min=e),e>this._max&&(this._max=e)}merge(e){if(0===e._count)return;if(0===this._count)return this._count=e._count,this._mean=e._mean,this._m2=e._m2,this._min=e._min,void(this._max=e._max);const t=this._count+e._count,o=e._mean-this._mean;this._mean+=o*e._count/t,this._m2+=e._m2+o*o*this._count*e._count/t,this._count=t,this._min>e._min&&(this._min=e._min),e._max>this._max&&(this._max=e._max)}clear(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}clone(){const t=new e;return t._count=this._count,t._mean=this._mean,t._m2=this._m2,t._min=this._min,t._max=this._max,t}get count(){return this._count}get mean(){return 0===this._count?0:this._mean}get sum(){return 0===this._count?0:this._mean*this._count}get variance(){return 2>this._count?0:this._m2/this._count}get stddev(){return Math.sqrt(this.variance)}get sampleVariance(){return 2>this._count?0:this._m2/(this._count-1)}get sampleStddev(){return Math.sqrt(this.sampleVariance)}get min(){return this._min}get max(){return this._max}},_o=class{constructor(e){this.windows=new Map,this.sessions=[],this.latest=-1/0,this.type=e.window??"tumbling",this.size=e.size;const t=e.hop??e.size;this.hop=t>0&&e.size>=t?t:e.size,this.gap=e.gap??e.size,this.retain=null!=e.retain&&e.retain>0?e.retain:1/0}push(e,t){Number.isFinite(e)&&Number.isFinite(t)&&(e>this.latest&&(this.latest=e),"session"===this.type?this.pushSession(e,t):this.pushFixed(e,t),this.prune())}pushFixed(e,t){if("tumbling"===this.type||this.hop>=this.size)return void this.bump(Math.floor(e/this.size)*this.size,t);const o=this.hop,n=Math.floor(e/o);for(let s=Math.floor((e-this.size)/o)+1;n>=s;s++)this.bump(s*o,t)}bump(e,t){let o=this.windows.get(e);o||(o=new xo,this.windows.set(e,o)),o.push(t)}pushSession(e,t){const o=this.gap,n=new xo;n.push(t);let s=e,r=e;const i=[],a={start:s,end:r,stats:n};for(const t of this.sessions)e-o>t.end||t.start>e+o?i.push(t):(a.stats.merge(t.stats),s>t.start&&(s=t.start),t.end>r&&(r=t.end));a.start=s,a.end=r,i.push(a),i.sort((e,t)=>e.start-t.start),this.sessions=i}prune(){if(this.retain===1/0)return;if("session"===this.type)return void(this.sessions.length>this.retain&&(this.sessions=this.sessions.slice(this.sessions.length-this.retain)));if(this.retain>=this.windows.size)return;const e=[...this.windows.keys()].sort((e,t)=>e-t),t=e.length-this.retain;for(let o=0;t>o;o++)this.windows.delete(e[o])}emit(){return"session"===this.type?this.emitSessions():this.emitFixed()}emitFixed(){const e=[];for(const[t,o]of this.windows){const n=t+this.size;e.push(this.row(t,n,o,n>this.latest))}return e.sort((e,t)=>e.start-t.start),e}emitSessions(){return this.sessions.map(e=>this.row(e.start,e.end,e.stats,this.gap>this.latest-e.end))}row(e,t,o,n){return{start:e,end:t,count:o.count,mean:o.mean,sum:o.sum,min:o.min,max:o.max,stddev:o.stddev,partial:n}}get windowCount(){return"session"===this.type?this.sessions.length:this.windows.size}get watermark(){return this.latest}clear(){this.windows.clear(),this.sessions=[],this.latest=-1/0}};function wo(e,t){switch(t){case"sum":return e.sum;case"min":return e.min;case"max":return e.max;case"count":return e.count;default:return e.mean}}function Ao(e,t,o,n=1){if("none"===t)return null;if("minmax"===t)return[e.min,e.max];const s=wo(e,o),r=e.stddev*n;return[s-r,s+r]}var ko={ms:1,s:1e3,m:6e4,h:36e5,d:864e5},So=/(\d+(?:\.\d+)?)(ms|s|m|h|d)/g;function Ro(e){if("number"==typeof e)return Number.isFinite(e)&&e>0?e:null;if("string"!=typeof e)return null;const t=e.trim();if(""===t)return null;So.lastIndex=0;let o,n=0,s=0;for(;null!==(o=So.exec(t));){const e=parseFloat(o[1]),t=ko[o[2]];if(null==t||!Number.isFinite(e))return null;n+=e*t,s+=o[0].length}return s!==t.length?null:n>0?n:null}var Co=class{constructor(e){this.held=[],this._watermark=-1/0,this._lateCount=0,this.lateness=e.lateness>0?e.lateness:0,this.getTime=e.getTime,this.latePolicy=e.latePolicy??"drop"}push(e){const t=this.getTime(e);if(!Number.isFinite(t))return{released:[e],late:[]};const o=[];return this._watermark!==-1/0&&this._watermark-this.lateness>t?(this._lateCount+=1,o.push(e),"drop"===this.latePolicy?{released:[],late:o}:{released:[e],late:o}):(t>this._watermark&&(this._watermark=t),this.held.push(e),{released:this.drain(),late:o})}drain(){const e=this._watermark-this.lateness;if(0===this.held.length)return[];const t=[],o=[];for(const n of this.held)this.getTime(n)>e?o.push(n):t.push(n);return this.held=o,t.sort((e,t)=>this.getTime(e)-this.getTime(t)),t}flush(){const e=this.held;return this.held=[],e.sort((e,t)=>this.getTime(e)-this.getTime(t)),e}clear(){this.held=[],this._watermark=-1/0,this._lateCount=0}get watermark(){return this._watermark}get lateCount(){return this._lateCount}get heldCount(){return this.held.length}};import{useRef as No,useImperativeHandle as To,forwardRef as Eo,useCallback as Po,useState as Io,useEffect as Do}from"react";import{jsx as Mo,jsxs as zo}from"react/jsx-runtime";var Lo={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, #f3f4f6)",padding:"6px 10px",borderRadius:"var(--semiotic-tooltip-radius, 4px)",fontSize:"var(--semiotic-tooltip-font-size, 12px)",fontFamily:"var(--semiotic-tick-font-family, var(--semiotic-font-family, sans-serif))",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.25))",lineHeight:1.4,pointerEvents:"none",whiteSpace:"nowrap"},Ho={opacity:.7,marginRight:4};function Wo(e,t,o){if(null!=e)return"function"==typeof t?t(e):e["string"==typeof t?t:o]}function Bo(e){return null==e?"":"number"==typeof e?Number.isInteger(e)?e+"":e.toFixed(2):e instanceof Date?e.toLocaleString():e+""}function Fo(e={}){const{timeAccessor:t,valueAccessor:o,xLabel:n="x",yLabel:s="y"}=e;return e=>{const r=e?.data??null,i=Wo(r,t,"time"),a=Wo(r,o,"value");return zo("div",{className:"semiotic-tooltip",style:Lo,children:[zo("div",{children:[zo("span",{style:Ho,children:[n,":"]}),Bo(i)]}),zo("div",{children:[zo("span",{style:Ho,children:[s,":"]}),Bo(a)]})]})}}function Oo(e,t){return null!=e?e:Math.max(t?.length??0,200)}var Yo="time",jo="value",Xo="__aggLower",$o="__aggUpper",Vo="__aggPartial",Go="count",Qo="__aggStart",qo="__aggEnd";function Ko(e,t){const o=t.stat??"mean",n=t.band??"none",s=t.sigma??1;return e.emit().map(e=>{const t={[Yo]:(e.start+e.end)/2,[jo]:wo(e,o),[Go]:e.count,[Vo]:e.partial,[Qo]:e.start,[qo]:e.end},r=Ao(e,n,o,s);return r&&(t[Xo]=r[0],t[$o]=r[1]),t})}import{jsx as Uo}from"react/jsx-runtime";function Zo(e,t,o){const n="function"==typeof t?t(e):e[t??o];if(null==n)return null;if(n instanceof Date)return n.getTime();const s=Number(n);return Number.isFinite(s)?s:null}var Jo=Eo(function(e,t){const o=be(e.mode,{width:e.size?.[0]??e.width,height:e.size?.[1]??e.height,enableHover:null!=e.enableHover?!!e.enableHover:void 0,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{size:n,margin:s,className:r,arrowOfTime:i="right",windowMode:a="sliding",windowSize:c,data:l,timeAccessor:d,valueAccessor:u,timeExtent:h,valueExtent:g,extentPadding:p,stroke:m="#007bff",strokeWidth:f=2,strokeDasharray:b,opacity:x,background:_,tooltipContent:w,tooltip:A,onHover:k,annotations:S,autoPlaceAnnotations:R,svgAnnotationRules:C,tickFormatTime:N,tickFormatValue:T,decay:E,pulse:P,staleness:I,transition:D,linkedHover:M,selection:z,onObservation:L,chartId:H,loading:W,loadingContent:B,emptyContent:F,emphasis:O,legendPosition:Y,aggregate:j,eventTime:X}=e,$=o.showAxes,V=o.enableHover,G=s??o.marginDefaults,Q=n??[o.width,o.height],q=w??A??Fo({timeAccessor:d,valueAccessor:u}),K=No(null),{customHoverBehavior:U}=xe({selection:z,linkedHover:M,unwrapData:!0,onObservation:L,chartType:"RealtimeLineChart",chartId:H}),Z=Po(e=>{k&&k(e),U(e)},[k,U]),J=null!=j,[ee,te]=Io([]),oe=No(null),ne=No(j);ne.current=j;const se=No(J);se.current=J;const ie=No(ee);ie.current=ee;const ce=No({timeAccessor:d,valueAccessor:u});ce.current={timeAccessor:d,valueAccessor:u},Do(()=>{if(!J)return void(oe.current=null);const e=ne.current,t=function(e){const t=e.window??"tumbling",o=Ro("session"===t?e.gap??e.size:e.size);if(null==o)return null;const n=null!=e.hop?Ro(e.hop):void 0,s=null!=e.gap?Ro(e.gap):void 0;return new _o({window:t,size:o,hop:n??void 0,gap:s??void 0,retain:e.retain})}(e);if(oe.current=t,t&&l){const{timeAccessor:e,valueAccessor:o}=ce.current;for(const n of l){const s=Zo(n,e,"time"),r=Zo(n,o,"value");null!=s&&null!=r&&t.push(s,r)}}te(t?Ko(t,e):[])},[J?[j.window??"tumbling",j.size,j.hop??"",j.gap??"",j.retain??""].join("|"):"",J,l]),Do(()=>{J&&oe.current&&te(Ko(oe.current,ne.current))},[j?.stat,j?.band,j?.sigma]);const le=Po(e=>{const t=oe.current,o=ne.current;if(!t||!o)return;const{timeAccessor:n,valueAccessor:s}=ce.current;for(const o of e){const e=Zo(o,n,"time"),r=Zo(o,s,"value");null!=e&&null!=r&&t.push(e,r)}te(Ko(t,o))},[]),de=null!=X,ue=No(null),he=No(X);he.current=X;const ge=No(de);ge.current=de;const pe=No(L);pe.current=L;const ye=No(H);ye.current=H,Do(()=>{ue.current=de?function(e){const t=Ro(e.lateness);return null==t?null:new Co({lateness:t,getTime:e=>Zo(e,ce.current.timeAccessor,"time")??NaN,latePolicy:e.latePolicy??"drop"})}(he.current):null},[de?`${X.lateness}|${X.latePolicy??"drop"}`:"",de]);const me=Po(e=>{0!==e.length&&(se.current?le(e):K.current?.pushMany(e))},[le]),fe=Po(e=>{const t=ue.current;if(!ge.current||!t)return void me(e);const o=[];for(const n of e){const e=t.push(n);if(e.released.length&&o.push(...e.released),e.late.length){const o=pe.current;if(o){const{timeAccessor:n}=ce.current,s=he.current?.latePolicy??"drop";for(const r of e.late)o({type:"late-data",datum:r,eventTime:Zo(r,n,"time")??NaN,watermark:t.watermark,policy:s,lateCount:t.lateCount,timestamp:Date.now(),chartType:"RealtimeLineChart",chartId:ye.current})}}}me(o)},[me]);To(t,()=>({push:e=>fe([e]),pushMany:e=>fe(e),remove:e=>se.current?[]:K.current?.remove(e)??[],update:(e,t)=>se.current?[]:K.current?.update(e,t)??[],clear:()=>{ue.current?.clear(),se.current?(oe.current?.clear(),te([])):K.current?.clear()},getData:()=>se.current?ie.current:K.current?.getData()??[],getScales:()=>K.current?.getScales()??null}),[fe]);const ve=ae(W,Q[0],Q[1],B),_e=ve?null:re(J?void 0:l,Q[0],Q[1],F),we={stroke:m,strokeWidth:f,strokeDasharray:b};null!=x&&(we.opacity=x);const Ae=Oo(c,l),ke=J?ee:l,Se=J?Yo:d,Re=J?jo:u,Ce=J&&j&&"none"!==(j.band??"none")?{y0Accessor:Xo,y1Accessor:$o,perSeries:!1}:void 0;return ve||_e||Uo(y,{ref:K,chartType:"line",runtimeMode:"streaming",size:Q,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:G,className:O?`${r||""} semiotic-emphasis-${O}`.trim():r,arrowOfTime:i,windowMode:J?"growing":a,windowSize:J?Math.max(1,j?.retain??Math.max(ee.length,600)):Ae,data:ke,timeAccessor:Se,valueAccessor:Re,xExtent:h,yExtent:g,extentPadding:p,band:Ce,lineStyle:we,showAxes:$,background:_,hoverAnnotation:V,tooltipContent:q,...v({linkedHover:M,selection:z,onObservation:L,forceHoverBehavior:!0,mobileInteraction:o.mobileInteraction,customHoverBehavior:Z}),annotations:S,autoPlaceAnnotations:R,svgAnnotationRules:C,tickFormatTime:N,tickFormatValue:T,decay:E,pulse:P,staleness:I,transition:D,pointIdAccessor:e.pointIdAccessor,legendPosition:Y})});Jo.displayName="RealtimeLineChart";import{useRef as en,useImperativeHandle as tn,forwardRef as on,useCallback as nn,useMemo as sn}from"react";import{jsx as rn}from"react/jsx-runtime";var an=on(function(e,t){const o=be(e.mode,{width:e.size?.[0]??e.width,height:e.size?.[1]??e.height,showAxes:e.showAxes,showLegend:e.showLegend,enableHover:null!=e.enableHover?!!e.enableHover:void 0,linkedHover:e.linkedHover,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{binSize:n,size:s,margin:r,className:i,arrowOfTime:a="right",windowMode:c="sliding",windowSize:l,data:d,timeAccessor:u,valueAccessor:h,direction:g="up",timeExtent:p,valueExtent:m,extentPadding:f,categoryAccessor:b,colors:x,fill:_,stroke:w,strokeWidth:A,opacity:k,gap:S,background:R,tooltipContent:C,tooltip:N,onHover:T,annotations:E,autoPlaceAnnotations:P,svgAnnotationRules:I,tickFormatTime:D,tickFormatValue:M,linkedHover:z,selection:L,decay:H,pulse:W,staleness:B,transition:F,onObservation:O,chartId:Y,loading:j,loadingContent:X,emptyContent:$,emphasis:V,legendPosition:G,legend:q,brush:K,onBrush:U,linkedBrush:Z}=e,J=o.showAxes,ee=o.enableHover,te=s??[o.width,o.height],oe=sn(()=>x?e=>x[e]??_??"#999":void 0,[x,_]),{legend:ne,margin:se,legendPosition:ie}=ve({data:d??[],colorBy:b,colorScale:oe,showLegend:o.showLegend,legendPosition:G,userMargin:r,defaults:o.marginDefaults,additionalLegend:q,chartWidth:te[0],axisChrome:{hasAxis:!1!==o.showAxes}}),ce=C??N??function(e={}){const{timeAccessor:t,valueAccessor:o}=e;return e=>{const n=e?.data??null;if(null==n?.binStart||null==n?.binEnd){const e=Wo(n,t,"time"),s=Wo(n,o,"value");return zo("div",{className:"semiotic-tooltip",style:Lo,children:[zo("div",{children:[Mo("span",{style:Ho,children:"x:"}),Bo(e)]}),zo("div",{children:[Mo("span",{style:Ho,children:"y:"}),Bo(s)]})]})}return zo("div",{className:"semiotic-tooltip",style:Lo,children:[zo("div",{children:[Mo("span",{style:Ho,children:"range:"}),Bo(n.binStart),"–",Bo(n.binEnd)]}),null!=n.total&&zo("div",{children:[Mo("span",{style:Ho,children:"count:"}),Bo(n.total)]}),null!=n.category&&zo("div",{children:[Mo("span",{style:Ho,children:"category:"}),Bo(n.category)]})]})}}({timeAccessor:u,valueAccessor:h}),le=en(null),{customHoverBehavior:de}=xe({selection:L,linkedHover:z,unwrapData:!0,onObservation:O,chartType:"RealtimeHistogram",chartId:Y}),ue=nn(e=>{T&&T(e),de(e)},[T,de]),ge=!0===K?{dimension:"x",snap:"bin"}:"x"===K?{dimension:"x"}:"object"==typeof K?K:void 0,pe=Q(Z),ye="string"==typeof u?u:"time",me=fe({name:pe?.name||"__unused_hist_brush__",xField:pe?.xField||ye,...pe?.yField?{yField:pe.yField}:{}}),_e=en(me.brushInteraction);_e.current=me.brushInteraction;const we=nn(e=>{if(U&&U(e),O&&O(e?{type:"brush",extent:e,timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:Y}:{type:"brush-end",timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:Y}),pe){const t=_e.current;t.end(e?"xBrush"===t.brush?e.x:"yBrush"===t.brush?e.y:[[e.x[0],e.y[0]],[e.x[1],e.y[1]]]:null)}},[U,O,Y,pe]);tn(t,()=>({push:e=>le.current?.push(e),pushMany:e=>le.current?.pushMany(e),remove:e=>le.current?.remove(e)??[],update:(e,t)=>le.current?.update(e,t)??[],clear:()=>le.current?.clear(),getData:()=>le.current?.getData()??[],getScales:()=>le.current?.getScales()??null}),[]);const Ae=ae(j,te[0],te[1],X),ke=Ae?null:re(d,te[0],te[1],$),Se={};null!=_&&(Se.fill=_),null!=w&&(Se.stroke=w),null!=A&&(Se.strokeWidth=A),null!=k&&(Se.opacity=k),null!=S&&(Se.gap=S);const Re=V?`${i||""} semiotic-emphasis-${V}`.trim():i,Ce=Oo(l,d),Ne=sn(()=>"down"!==g?m:he({data:d,valueAccessor:h,timeAccessor:u,binSize:n,valueExtent:m,extentPadding:f}),[g,d,h,u,n,m,f]);return Ae||ke||rn(y,{ref:le,chartType:"bar",runtimeMode:"streaming",size:te,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:se,className:Re,arrowOfTime:a,windowMode:c,windowSize:Ce,data:d,timeAccessor:u,valueAccessor:h,xExtent:p,yExtent:Ne,extentPadding:f,binSize:n,categoryAccessor:b,barColors:x,barStyle:Se,showAxes:J,background:R,hoverAnnotation:ee,tooltipContent:ce,...v({linkedHover:z,selection:L,onObservation:O,forceHoverBehavior:!0,mobileInteraction:o.mobileInteraction,customHoverBehavior:ue}),annotations:E,autoPlaceAnnotations:P,svgAnnotationRules:I,tickFormatTime:D,tickFormatValue:M,decay:H,pulse:W,staleness:B,transition:F,pointIdAccessor:e.pointIdAccessor,legend:ne,legendPosition:ie,brush:ge||(Z?{dimension:"x"}:void 0),onBrush:ge||Z?we:void 0})});function cn(e){return rn(an,{...e,windowMode:"growing"})}an.displayName="RealtimeHistogram",cn.displayName="TemporalHistogram";import{useRef as ln,useImperativeHandle as dn,forwardRef as un,useCallback as hn}from"react";import{jsx as gn}from"react/jsx-runtime";var pn=un(function(e,t){const o=be(e.mode,{width:e.size?.[0]??e.width,height:e.size?.[1]??e.height,enableHover:null!=e.enableHover?!!e.enableHover:void 0,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{size:n,margin:s,className:r,arrowOfTime:i="right",windowMode:a="sliding",windowSize:c,data:l,timeAccessor:d,valueAccessor:u,timeExtent:h,valueExtent:g,yScaleType:p,extentPadding:m,categoryAccessor:f,colors:b,radius:x,fill:_,opacity:w,stroke:A,strokeWidth:k,pointStyle:S,background:R,tooltipContent:C,tooltip:N,onHover:T,annotations:E,autoPlaceAnnotations:P,svgAnnotationRules:I,tickFormatTime:D,tickFormatValue:M,linkedHover:z,selection:L,onObservation:H,chartId:W,loading:B,loadingContent:F,emptyContent:O,emphasis:Y,legendPosition:j}=e,X=o.showAxes,$=o.enableHover,V=s??o.marginDefaults,G=n??[o.width,o.height],Q=C??N??Fo({timeAccessor:d,valueAccessor:u}),q=ln(null),{customHoverBehavior:K}=xe({selection:L,linkedHover:z,unwrapData:!0,onObservation:H,chartType:"RealtimeSwarmChart",chartId:W}),U=hn(e=>{T&&T(e),K(e)},[T,K]);dn(t,()=>({push:e=>q.current?.push(e),pushMany:e=>q.current?.pushMany(e),remove:e=>q.current?.remove(e)??[],update:(e,t)=>q.current?.update(e,t)??[],clear:()=>q.current?.clear(),getData:()=>q.current?.getData()??[],getScales:()=>q.current?.getScales()??null}),[]);const Z=ae(B,G[0],G[1],F),J=Z?null:re(l,G[0],G[1],O),ee={};null!=x&&(ee.radius=x),null!=_&&(ee.fill=_),null!=w&&(ee.opacity=w),null!=A&&(ee.stroke=A),null!=k&&(ee.strokeWidth=k);const te=S,oe=Y?`${r||""} semiotic-emphasis-${Y}`.trim():r,ne=Oo(c,l);return Z||J||gn(y,{ref:q,chartType:"swarm",runtimeMode:"streaming",size:G,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:V,className:oe,arrowOfTime:i,windowMode:a,windowSize:ne,data:l,timeAccessor:d,valueAccessor:u,xExtent:h,yExtent:g,yScaleType:p,extentPadding:m,categoryAccessor:f,barColors:b,swarmStyle:ee,pointStyle:te,showAxes:X,background:R,hoverAnnotation:$,tooltipContent:Q,...v({linkedHover:z,selection:L,onObservation:H,forceHoverBehavior:!0,mobileInteraction:o.mobileInteraction,customHoverBehavior:U}),annotations:E,autoPlaceAnnotations:P,svgAnnotationRules:I,tickFormatTime:D,tickFormatValue:M,legendPosition:j,pointIdAccessor:e.pointIdAccessor})});pn.displayName="RealtimeSwarmChart";import{useRef as yn,useImperativeHandle as mn,forwardRef as fn,useCallback as vn}from"react";import{jsx as bn}from"react/jsx-runtime";var xn=fn(function(e,t){const o=be(e.mode,{width:e.size?.[0]??e.width,height:e.size?.[1]??e.height,enableHover:null!=e.enableHover?!!e.enableHover:void 0,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{size:n,margin:s,className:r,arrowOfTime:i="right",windowMode:a="sliding",windowSize:c,data:l,timeAccessor:d,valueAccessor:u,timeExtent:h,valueExtent:g,extentPadding:p,positiveColor:m,negativeColor:f,connectorStroke:b,connectorWidth:x,gap:_,stroke:w,strokeWidth:A,opacity:k,background:S,tooltipContent:R,tooltip:C,onHover:N,annotations:T,autoPlaceAnnotations:E,svgAnnotationRules:P,tickFormatTime:I,tickFormatValue:D,linkedHover:M,selection:z,onObservation:L,chartId:H,loading:W,loadingContent:B,emptyContent:F,emphasis:O,legendPosition:Y}=e,j=o.showAxes,X=o.enableHover,$=s??o.marginDefaults,V=n??[o.width,o.height],G=R??C??function(e={}){const{timeAccessor:t,valueAccessor:o}=e;return e=>{const n=e?.data??null,s=Wo(n,t,"time"),r=n?.delta??Wo(n,o,"value"),i=n?.cumEnd,a="number"==typeof r?0>r?Bo(r):"+"+Bo(r):Bo(r);return zo("div",{className:"semiotic-tooltip",style:Lo,children:[zo("div",{children:[Mo("span",{style:Ho,children:"x:"}),Bo(s)]}),zo("div",{children:[Mo("span",{style:Ho,children:"Δ:"}),a]}),null!=i&&zo("div",{children:[Mo("span",{style:Ho,children:"total:"}),Bo(i)]})]})}}({timeAccessor:d,valueAccessor:u}),Q=yn(null),{customHoverBehavior:q}=xe({selection:z,linkedHover:M,unwrapData:!0,onObservation:L,chartType:"RealtimeWaterfallChart",chartId:H}),K=vn(e=>{N&&N(e),q(e)},[N,q]);mn(t,()=>({push:e=>Q.current?.push(e),pushMany:e=>Q.current?.pushMany(e),remove:e=>Q.current?.remove(e)??[],update:(e,t)=>Q.current?.update(e,t)??[],clear:()=>Q.current?.clear(),getData:()=>Q.current?.getData()??[],getScales:()=>Q.current?.getScales()??null}),[]);const U=ae(W,V[0],V[1],B),Z=U?null:re(l,V[0],V[1],F),J={};null!=m&&(J.positiveColor=m),null!=f&&(J.negativeColor=f),null!=b&&(J.connectorStroke=b),null!=x&&(J.connectorWidth=x),null!=_&&(J.gap=_),null!=w&&(J.stroke=w),null!=A&&(J.strokeWidth=A),null!=k&&(J.opacity=k);const ee=O?`${r||""} semiotic-emphasis-${O}`.trim():r,te=Oo(c,l);return U||Z||bn(y,{ref:Q,chartType:"waterfall",runtimeMode:"streaming",size:V,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:$,className:ee,arrowOfTime:i,windowMode:a,windowSize:te,data:l,timeAccessor:d,valueAccessor:u,xExtent:h,yExtent:g,extentPadding:p,waterfallStyle:J,showAxes:j,background:S,hoverAnnotation:X,tooltipContent:G,...v({linkedHover:M,selection:z,onObservation:L,forceHoverBehavior:!0,mobileInteraction:o.mobileInteraction,customHoverBehavior:K}),annotations:T,autoPlaceAnnotations:E,svgAnnotationRules:P,tickFormatTime:I,tickFormatValue:D,legendPosition:Y,pointIdAccessor:e.pointIdAccessor})});xn.displayName="RealtimeWaterfallChart";import{useRef as _n,useImperativeHandle as wn,forwardRef as An,useCallback as kn}from"react";import{jsx as Sn}from"react/jsx-runtime";var Rn=An(function(e,t){const o=be(e.mode,{width:e.size?.[0]??e.width,height:e.size?.[1]??e.height,enableHover:null!=e.enableHover?!!e.enableHover:void 0,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{size:n,margin:s,className:r,arrowOfTime:i="right",windowMode:a="sliding",windowSize:c,data:l,timeAccessor:d,valueAccessor:u,categoryAccessor:h,timeExtent:g,valueExtent:p,extentPadding:m,heatmapXBins:f=20,heatmapYBins:b=20,aggregation:x="count",background:_,tooltipContent:w,tooltip:A,onHover:k,annotations:S,autoPlaceAnnotations:R,svgAnnotationRules:C,tickFormatTime:N,tickFormatValue:T,decay:E,pulse:P,staleness:I,linkedHover:D,selection:M,onObservation:z,chartId:L,loading:H,loadingContent:W,emptyContent:B,emphasis:F,legendPosition:O}=e,Y=o.showAxes,j=o.enableHover,X=s??o.marginDefaults,$=n??[o.width,o.height],V=w??A??function(e={}){const{timeAccessor:t,valueAccessor:o,xLabel:n="x",yLabel:s="y"}=e;return e=>{const r=e?.data??null,i=r?.xCenter??Wo(r,t,"time"),a=r?.yCenter??Wo(r,o,"value"),c=r?.count,l=r?.sum,d=r?.value,u=r?.agg??"count";return zo("div",{className:"semiotic-tooltip",style:Lo,children:[zo("div",{children:[zo("span",{style:Ho,children:[n,":"]}),Bo(i)]}),zo("div",{children:[zo("span",{style:Ho,children:[s,":"]}),Bo(a)]}),null!=c&&zo("div",{children:[Mo("span",{style:Ho,children:"count:"}),Bo(c)]}),"sum"===u&&null!=l&&zo("div",{children:[Mo("span",{style:Ho,children:"sum:"}),Bo(l)]}),"mean"===u&&null!=d&&zo("div",{children:[Mo("span",{style:Ho,children:"mean:"}),Bo(d)]})]})}}({timeAccessor:d,valueAccessor:u}),G=_n(null),{customHoverBehavior:Q}=xe({selection:M,linkedHover:D,unwrapData:!0,onObservation:z,chartType:"RealtimeHeatmap",chartId:L}),q=kn(e=>{k&&k(e),Q(e)},[k,Q]);wn(t,()=>({push:e=>G.current?.push(e),pushMany:e=>G.current?.pushMany(e),remove:e=>G.current?.remove(e)??[],update:(e,t)=>G.current?.update(e,t)??[],clear:()=>G.current?.clear(),getData:()=>G.current?.getData()??[],getScales:()=>G.current?.getScales()??null}),[]);const K=ae(H,$[0],$[1],W),U=K?null:re(l,$[0],$[1],B),Z=F?`${r||""} semiotic-emphasis-${F}`.trim():r,J=Oo(c,l);return K||U||Sn(y,{ref:G,chartType:"heatmap",runtimeMode:"streaming",size:$,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:X,className:Z,arrowOfTime:i,windowMode:a,windowSize:J,data:l,timeAccessor:d,valueAccessor:u,categoryAccessor:h,xExtent:g,yExtent:p,extentPadding:m,heatmapXBins:f,heatmapYBins:b,heatmapAggregation:x,showAxes:Y,background:_,hoverAnnotation:j,tooltipContent:V,...v({linkedHover:D,selection:M,onObservation:z,forceHoverBehavior:!0,mobileInteraction:o.mobileInteraction,customHoverBehavior:q}),annotations:S,autoPlaceAnnotations:R,svgAnnotationRules:C,tickFormatTime:N,tickFormatValue:T,decay:E,pulse:P,staleness:I,legendPosition:O,pointIdAccessor:e.pointIdAccessor})});Rn.displayName="RealtimeHeatmap";export{qe as DEFAULT_LIFECYCLE_THRESHOLDS,Pe as IncrementalExtent,Rn as RealtimeHeatmap,an as RealtimeHistogram,Jo as RealtimeLineChart,pn as RealtimeSwarmChart,xn as RealtimeWaterfallChart,Co as ReorderBuffer,Ie as RingBuffer,xo as RunningStats,bo as StreamNetworkFrame,y as StreamXYFrame,cn as TemporalHistogram,_o as WindowAccumulator,Ao as bandBounds,Ke as bandFromAge,_ as compileMotionEncoding,T as deriveMotionVector,U as opacityFromAge,Ro as parseWindowDuration,ge as resolveMotionAccessor,pe as resolveMotionVector,wo as statValue};