semiotic 3.8.3 → 3.8.5

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 (215) hide show
  1. package/CLAUDE.md +13 -10
  2. package/README.md +52 -45
  3. package/ai/componentMetadata.cjs +1 -1
  4. package/ai/dist/mcp-server.js +4 -2
  5. package/ai/examples.md +168 -1
  6. package/ai/schema.json +3756 -327
  7. package/ai/surface-manifest.json +6 -4
  8. package/ai/system-prompt.md +1 -1
  9. package/dist/chunk-chartContainerDataAudit-74TLKIP6.module.min.js +2 -0
  10. package/dist/chunk-chunk-2JGJ5GUG.module.min.js +0 -1
  11. package/dist/chunk-chunk-4AANPFOX.module.min.js +2 -0
  12. package/dist/{chunk-chunk-JNCHKRIR.module.min.js → chunk-chunk-5I3UZV4Q.module.min.js} +1 -1
  13. package/dist/chunk-chunk-74CCPVXB.module.min.js +1 -0
  14. package/dist/{chunk-chunk-VVCA3DB7.module.min.js → chunk-chunk-7ALTGHK6.module.min.js} +1 -1
  15. package/dist/chunk-chunk-ACLDBMRH.module.min.js +2 -0
  16. package/dist/chunk-chunk-AVBI6GDT.module.min.js +1 -0
  17. package/dist/{chunk-chunk-XQYVEKEJ.module.min.js → chunk-chunk-BANTPINB.module.min.js} +1 -1
  18. package/dist/chunk-chunk-C4YA6TDR.module.min.js +1 -0
  19. package/dist/chunk-chunk-C57LR3YG.module.min.js +1 -0
  20. package/dist/chunk-chunk-CKMD5NV3.module.min.js +2 -0
  21. package/dist/chunk-chunk-CO5KQMGH.module.min.js +1 -0
  22. package/dist/chunk-chunk-CWQ5YIHX.module.min.js +2 -0
  23. package/dist/chunk-chunk-E6TXX6MI.module.min.js +1 -0
  24. package/dist/{chunk-chunk-7FW6EGLP.module.min.js → chunk-chunk-I36PJ4OC.module.min.js} +1 -1
  25. package/dist/chunk-chunk-IY7RYD4S.module.min.js +1 -0
  26. package/dist/chunk-chunk-K3DMEW22.module.min.js +1 -0
  27. package/dist/chunk-chunk-KT2VAZMZ.module.min.js +1 -0
  28. package/dist/{chunk-chunk-AZJUDQRM.module.min.js → chunk-chunk-L6EA5V3G.module.min.js} +1 -1
  29. package/dist/{chunk-chunk-SANERMIZ.module.min.js → chunk-chunk-LJLS6DY7.module.min.js} +1 -1
  30. package/dist/chunk-chunk-LJPCLYSC.module.min.js +2 -0
  31. package/dist/chunk-chunk-LRIFN2HK.module.min.js +1 -0
  32. package/dist/chunk-chunk-N5DDKCCF.module.min.js +1 -0
  33. package/dist/chunk-chunk-NEVE562N.module.min.js +1 -0
  34. package/dist/chunk-chunk-NLO44TOS.module.min.js +2 -0
  35. package/dist/{chunk-chunk-FYY2ACNJ.module.min.js → chunk-chunk-PRDGLMJT.module.min.js} +1 -1
  36. package/dist/chunk-chunk-PZJ2SBLL.module.min.js +2 -0
  37. package/dist/chunk-chunk-QUJ6TTLY.module.min.js +1 -0
  38. package/dist/chunk-chunk-RBIDBUT4.module.min.js +2 -0
  39. package/dist/chunk-chunk-RFLAG356.module.min.js +1 -0
  40. package/dist/chunk-chunk-RPU4IZAV.module.min.js +2 -0
  41. package/dist/chunk-chunk-SKMBCFIL.module.min.js +2 -0
  42. package/dist/chunk-chunk-TAE7W424.module.min.js +2 -0
  43. package/dist/{chunk-chunk-OQTLSTGI.module.min.js → chunk-chunk-TMWIZL3K.module.min.js} +1 -1
  44. package/dist/chunk-chunk-TUBMTZMU.module.min.js +2 -0
  45. package/dist/chunk-chunk-UFFEXJQY.module.min.js +1 -0
  46. package/dist/chunk-chunk-XSCHTS4D.module.min.js +2 -0
  47. package/dist/chunk-chunk-XXWSHGPL.module.min.js +2 -0
  48. package/dist/chunk-chunk-ZOAQDIJO.module.min.js +1 -0
  49. package/dist/chunk-chunk-ZXIXAPRE.module.min.js +2 -0
  50. package/dist/chunk-minimapBrushOverlay-JU57U7NM.module.min.js +2 -0
  51. package/dist/chunk-scatterplotMatrixBrushOverlay-SDIZSN66.module.min.js +2 -0
  52. package/dist/chunk-statisticalOverlays-QGDLRUHX.module.min.js +1 -0
  53. package/dist/chunk-statisticalOverlays-T77OKLDY.module.min.js +1 -0
  54. package/dist/components/ChartContainer.d.ts +12 -2
  55. package/dist/components/ai/chartCapabilities.d.ts +2 -1
  56. package/dist/components/ai/chartCapabilityTypes.d.ts +19 -0
  57. package/dist/components/chartContainerDataAudit.d.ts +10 -0
  58. package/dist/components/charts/geo/ChoroplethMap.d.ts +2 -0
  59. package/dist/components/charts/geo/DistanceCartogram.d.ts +35 -5
  60. package/dist/components/charts/geo/FlowMap.d.ts +4 -0
  61. package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +3 -1
  62. package/dist/components/charts/index.d.ts +1 -0
  63. package/dist/components/charts/network/ForceDirectedGraph.d.ts +36 -1
  64. package/dist/components/charts/physics/CollisionSwarmChart.d.ts +6 -1
  65. package/dist/components/charts/physics/CrucibleChart.capability.d.ts +8 -0
  66. package/dist/components/charts/physics/CrucibleChart.d.ts +63 -0
  67. package/dist/components/charts/physics/GaltonBoardChart.d.ts +6 -1
  68. package/dist/components/charts/physics/crucibleBodyRenderers.d.ts +27 -0
  69. package/dist/components/charts/physics/crucibleChartProps.d.ts +90 -0
  70. package/dist/components/charts/physics/crucibleChrome.d.ts +47 -0
  71. package/dist/components/charts/physics/crucibleController.d.ts +59 -0
  72. package/dist/components/charts/physics/crucibleEffects.d.ts +30 -0
  73. package/dist/components/charts/physics/cruciblePhysics.d.ts +54 -0
  74. package/dist/components/charts/physics/crucibleProgram.d.ts +38 -0
  75. package/dist/components/charts/physics/crucibleTypes.d.ts +415 -0
  76. package/dist/components/charts/physics/gauntletChartProps.d.ts +7 -1
  77. package/dist/components/charts/physics/gauntletChrome.d.ts +2 -1
  78. package/dist/components/charts/physics/gauntletPhysics.d.ts +19 -4
  79. package/dist/components/charts/physics/gauntletRuntime.d.ts +3 -0
  80. package/dist/components/charts/physics/physicsHocUtils.d.ts +12 -0
  81. package/dist/components/charts/shared/chartMode.d.ts +8 -0
  82. package/dist/components/charts/shared/chartSpecCore.d.ts +10 -2
  83. package/dist/components/charts/shared/crucibleWireSchema.d.ts +5 -0
  84. package/dist/components/charts/shared/diagnoseTypes.d.ts +10 -0
  85. package/dist/components/charts/shared/hatchPattern.d.ts +8 -3
  86. package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
  87. package/dist/components/charts/shared/lineSeriesSsr.d.ts +55 -0
  88. package/dist/components/charts/shared/types.d.ts +2 -2
  89. package/dist/components/charts/shared/validateProps.d.ts +1 -1
  90. package/dist/components/charts/xy/AreaChart.d.ts +10 -0
  91. package/dist/components/charts/xy/minimapBrushOverlay.d.ts +17 -0
  92. package/dist/components/charts/xy/minimapBrushOverlayLazy.d.ts +4 -0
  93. package/dist/components/charts/xy/scatterplotMatrixBrushOverlay.d.ts +8 -0
  94. package/dist/components/charts/xy/scatterplotMatrixBrushOverlayLazy.d.ts +3 -0
  95. package/dist/components/data/auditData.d.ts +51 -0
  96. package/dist/components/data/dataAuditPresentation.d.ts +18 -0
  97. package/dist/components/data/dataAuditSources.d.ts +9 -0
  98. package/dist/components/data/numericContracts.d.ts +59 -0
  99. package/dist/components/data/numericFieldProfiler.d.ts +23 -0
  100. package/dist/components/realtime/types.d.ts +5 -0
  101. package/dist/components/recipes/gridObservatory.d.ts +176 -0
  102. package/dist/components/recipes/netEnsembleLayout.d.ts +167 -0
  103. package/dist/components/recipes/netEnsembleOverlays.d.ts +20 -0
  104. package/dist/components/recipes/recipeChrome.d.ts +24 -0
  105. package/dist/components/recipes/sequenceLayout.d.ts +139 -0
  106. package/dist/components/recipes/wordTrails.d.ts +156 -0
  107. package/dist/components/recipes/wordTrailsProgressiveReveal.d.ts +42 -0
  108. package/dist/components/semiotic-ai-core.d.ts +3 -0
  109. package/dist/components/semiotic-ai-data-audit.d.ts +4 -0
  110. package/dist/components/semiotic-ai.d.ts +7 -5
  111. package/dist/components/semiotic-physics.d.ts +1 -0
  112. package/dist/components/semiotic-recipes-core.d.ts +10 -2
  113. package/dist/components/semiotic-utils-core.d.ts +3 -0
  114. package/dist/components/semiotic.d.ts +1 -1
  115. package/dist/components/server/renderEvidence.d.ts +27 -0
  116. package/dist/components/server/serverChartConfigs.d.ts +1 -0
  117. package/dist/components/server/serverChartConfigsPhysics.d.ts +9 -0
  118. package/dist/components/server/staticAnnotations.d.ts +15 -1
  119. package/dist/components/stream/GeoPipelineStore.d.ts +1 -0
  120. package/dist/components/stream/GeoSVGOverlay.d.ts +7 -0
  121. package/dist/components/stream/SceneToSVG.d.ts +6 -6
  122. package/dist/components/stream/SceneToSVGOrdinal.d.ts +12 -0
  123. package/dist/components/stream/geoCartogram.d.ts +7 -0
  124. package/dist/components/stream/geoTypes.d.ts +17 -2
  125. package/dist/components/stream/networkFrameHandleTypes.d.ts +4 -0
  126. package/dist/components/stream/networkFramePaint.d.ts +2 -0
  127. package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +18 -2
  128. package/dist/components/stream/physics/PhysicsSettledSVG.d.ts +8 -0
  129. package/dist/components/stream/physics/physicsBodyCanvas.d.ts +7 -0
  130. package/dist/components/stream/physics/physicsPipelineEviction.d.ts +15 -0
  131. package/dist/components/stream/physics/physicsPipelineObservations.d.ts +1 -1
  132. package/dist/components/stream/physics/physicsPipelineQuiescence.d.ts +20 -0
  133. package/dist/components/stream/sceneToSVGShared.d.ts +30 -1
  134. package/dist/components/stream/types.d.ts +4 -0
  135. package/dist/components/stream/useHydration.d.ts +7 -1
  136. package/dist/components/stream/xySceneBuilders/candlestickScene.d.ts +1 -1
  137. package/dist/components/useChartContainerDataAudit.d.ts +7 -0
  138. package/dist/forceLayoutWorker.js +1 -1
  139. package/dist/geo.min.js +1 -1
  140. package/dist/geo.module.min.js +1 -1
  141. package/dist/network.min.js +1 -1
  142. package/dist/network.module.min.js +1 -1
  143. package/dist/ordinal.min.js +1 -1
  144. package/dist/ordinal.module.min.js +1 -1
  145. package/dist/physics.min.js +1 -1
  146. package/dist/physics.module.min.js +1 -1
  147. package/dist/physicsWorker.js +1 -1
  148. package/dist/realtime.min.js +1 -1
  149. package/dist/realtime.module.min.js +1 -1
  150. package/dist/rough.min.js +1 -1
  151. package/dist/rough.module.min.js +1 -1
  152. package/dist/semiotic-ai-core.d.ts +3 -0
  153. package/dist/semiotic-ai-core.min.js +1 -1
  154. package/dist/semiotic-ai-core.module.min.js +1 -1
  155. package/dist/semiotic-ai.d.ts +7 -5
  156. package/dist/semiotic-ai.min.js +1 -1
  157. package/dist/semiotic-ai.module.min.js +1 -1
  158. package/dist/semiotic-experimental.min.js +1 -1
  159. package/dist/semiotic-experimental.module.min.js +1 -1
  160. package/dist/semiotic-physics.d.ts +1 -0
  161. package/dist/semiotic-realtime-core.min.js +1 -1
  162. package/dist/semiotic-realtime-core.module.min.js +1 -1
  163. package/dist/semiotic-recipes-core.d.ts +10 -2
  164. package/dist/semiotic-recipes-core.min.js +1 -1
  165. package/dist/semiotic-recipes-core.module.min.js +1 -1
  166. package/dist/semiotic-recipes.min.js +1 -1
  167. package/dist/semiotic-recipes.module.min.js +1 -1
  168. package/dist/semiotic-server-edge.min.js +1 -1
  169. package/dist/semiotic-server-edge.module.min.js +1 -1
  170. package/dist/semiotic-server-node.min.js +1 -1
  171. package/dist/semiotic-server-node.module.min.js +1 -1
  172. package/dist/semiotic-utils-core.d.ts +3 -0
  173. package/dist/semiotic-utils-core.min.js +1 -1
  174. package/dist/semiotic-utils-core.module.min.js +1 -1
  175. package/dist/semiotic-utils.min.js +1 -1
  176. package/dist/semiotic-utils.module.min.js +1 -1
  177. package/dist/semiotic-value.module.min.js +1 -1
  178. package/dist/semiotic.d.ts +1 -1
  179. package/dist/semiotic.min.js +1 -1
  180. package/dist/semiotic.module.min.js +1 -1
  181. package/dist/server.min.js +1 -1
  182. package/dist/server.module.min.js +1 -1
  183. package/dist/xy.min.js +1 -1
  184. package/dist/xy.module.min.js +1 -1
  185. package/package.json +4 -3
  186. package/dist/chunk-chunk-255KDHW5.module.min.js +0 -1
  187. package/dist/chunk-chunk-2CCFBTQC.module.min.js +0 -2
  188. package/dist/chunk-chunk-2RXP3FS3.module.min.js +0 -1
  189. package/dist/chunk-chunk-2WVCH4PL.module.min.js +0 -1
  190. package/dist/chunk-chunk-4TMZXLCR.module.min.js +0 -1
  191. package/dist/chunk-chunk-5APBQXZA.module.min.js +0 -1
  192. package/dist/chunk-chunk-6HSGDMTA.module.min.js +0 -2
  193. package/dist/chunk-chunk-7OEOSCBP.module.min.js +0 -1
  194. package/dist/chunk-chunk-A63CTACR.module.min.js +0 -2
  195. package/dist/chunk-chunk-B6V35LMY.module.min.js +0 -2
  196. package/dist/chunk-chunk-BOSVL645.module.min.js +0 -2
  197. package/dist/chunk-chunk-CP3EN6KZ.module.min.js +0 -1
  198. package/dist/chunk-chunk-F25UA5HT.module.min.js +0 -1
  199. package/dist/chunk-chunk-FRIO6MCV.module.min.js +0 -1
  200. package/dist/chunk-chunk-GWSWSPXN.module.min.js +0 -1
  201. package/dist/chunk-chunk-I6C3KR5H.module.min.js +0 -2
  202. package/dist/chunk-chunk-IP2UE74X.module.min.js +0 -1
  203. package/dist/chunk-chunk-J3ELI22J.module.min.js +0 -1
  204. package/dist/chunk-chunk-J5RL6GXU.module.min.js +0 -2
  205. package/dist/chunk-chunk-L3H6DQCR.module.min.js +0 -2
  206. package/dist/chunk-chunk-M337NY6L.module.min.js +0 -1
  207. package/dist/chunk-chunk-M7VYYHCE.module.min.js +0 -2
  208. package/dist/chunk-chunk-MC35ILYP.module.min.js +0 -2
  209. package/dist/chunk-chunk-N72SWNBV.module.min.js +0 -1
  210. package/dist/chunk-chunk-OBQRFTIL.module.min.js +0 -2
  211. package/dist/chunk-chunk-QRIBHZYW.module.min.js +0 -1
  212. package/dist/chunk-chunk-SA3D43RA.module.min.js +0 -2
  213. package/dist/chunk-chunk-UHSZEB74.module.min.js +0 -1
  214. package/dist/chunk-chunk-Y6AXCRVO.module.min.js +0 -1
  215. package/dist/chunk-chunk-ZCNBUZPL.module.min.js +0 -2
@@ -1 +0,0 @@
1
- import{hatchPatternDef as e,isHatchFill as t,resolveHatchCanvasPattern as n,resolveResponsiveRules as r,useObservationSelector as o}from"./chunk-chunk-2WVCH4PL.module.min.js";import{SEQUENTIAL_INTERPOLATORS as i,glyphFractionClipRect as s,glyphPlacement as l,resolveGlyphPaint as a,schemeCategory10 as c,schemeSet3 as d,schemeTableau10 as u,symbolPathString as h}from"./chunk-chunk-5RKXZQ2P.module.min.js";import{resolveCSSColor as f}from"./chunk-chunk-QRIBHZYW.module.min.js";import{createStore as y}from"./chunk-chunk-DSNGDNJY.module.min.js";var p=Object.freeze([]);function m(e){if(!e)return p;let t=!1;for(let n=0;e.length>n;n++){const r=e[n];if(null==r||"object"!=typeof r){t=!0;break}}if(!t)return e;const n=[];for(const t of e)null!=t&&"object"==typeof t&&n.push(t);return n}var g=/^\d{4}-\d{1,2}$/;function x(e){const t=e.trim();if(!t||!Number.isNaN(Number(t)))return NaN;const n=g.test(t)?t+"-01":t;if(n===t&&10>t.length)return NaN;const r=Date.parse(n);return Number.isFinite(r)?r:NaN}function b(e){return e instanceof Date?e.getTime():"string"==typeof e?x(e):+e}function k(e,t){if(!e||!t)return{data:e,failed:!1};let n=!1,r=!1;const o=e.map(e=>{const o=e[t];if("string"!=typeof o)return e;const i=x(o);return n=!0,Number.isFinite(i)?{...e,[t]:i}:(r=!0,{...e,[t]:NaN})});return{data:n?o:e,failed:r}}var $=22;function v(e){return"string"==typeof e&&e.length>0}function w(e,t,n=!1){const r=n?t?58:34:t?36:0;return r>e.top?{...e,top:r}:e}function M(e,t){return w(e,v(t))}import*as A from"react";import{arc as S,area as W,line as L}from"d3-shape";import{curveMonotoneX as I,curveMonotoneY as C,curveCardinal as N,curveCatmullRom as P,curveStep as O,curveStepBefore as j,curveStepAfter as F,curveBasis as R,curveNatural as z}from"d3-shape";function T(e){switch(e){case"monotoneX":return I;case"monotoneY":return C;case"cardinal":return N;case"catmullRom":return P;case"step":return O;case"stepBefore":return j;case"stepAfter":return F;case"basis":return R;case"natural":return z;default:return null}}function G(e,r,o){if(null==r)return o;if(t(r)){return n(r,e)||r.background&&f(e,r.background)||o}return"string"!=typeof r?r:f(e,r)||o}function B(e,t){if(null==t)return;const n=G(e,t,"");return""===n?void 0:n}function D(e,t,n,r,o,i,s){if("colorStops"in t){const n=t.colorStops.filter(e=>Number.isFinite(e.offset)).map(e=>({offset:Math.max(0,Math.min(1,e.offset)),color:e.color}));if(2>n.length)return null;const l=e.createLinearGradient(r,o,i,s);for(const e of n)l.addColorStop(e.offset,e.color);return l}const{topOpacity:l,bottomOpacity:a}=t;if(!Number.isFinite(l)||!Number.isFinite(a))return null;const c=Math.max(0,Math.min(1,l)),d=Math.max(0,Math.min(1,a)),u=e.createLinearGradient(r,o,i,s),[h,f,y]=function(e,t){const n=e.fillStyle,r="#010203";try{e.fillStyle=r,e.fillStyle=t}catch{return e.fillStyle=n,[78,121,167]}const o=e.fillStyle;if(e.fillStyle=n,"string"!=typeof o)return[78,121,167];if(o.toLowerCase()===r&&t.trim().toLowerCase()!==r)return[78,121,167];if(o.startsWith("#"))return[parseInt(o.slice(1,3),16),parseInt(o.slice(3,5),16),parseInt(o.slice(5,7),16)];const i=o.match(/(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return i?[+i[1],+i[2],+i[3]]:[78,121,167]}(e,n);return u.addColorStop(0,`rgba(${h},${f},${y},${c})`),u.addColorStop(1,`rgba(${h},${f},${y},${d})`),u}function E(e,t,n,r,o,i){const s=t.colorStops.filter(e=>Number.isFinite(e.offset)).map(e=>({offset:Math.max(0,Math.min(1,e.offset)),color:e.color}));if(2>s.length)return null;const l=e.createLinearGradient(n,r,o,i);for(const e of s)l.addColorStop(e.offset,e.color);return l}function H(e){return(e.tl??0)>0||(e.tr??0)>0||(e.br??0)>0||(e.bl??0)>0}function q(e){const t=e.cornerRadii;if(!t)return{tl:0,tr:0,br:0,bl:0};const n=Math.min(e.w,e.h)/2,r=e=>Math.max(0,Math.min(e??0,n));return{tl:r(t.tl),tr:r(t.tr),br:r(t.br),bl:r(t.bl)}}var _=(e,t)=>({x:e*Math.cos(t),y:e*Math.sin(t)});function Y(e){const{innerRadius:t,outerRadius:n,startAngle:r,endAngle:o}=e,i=0>=t;if(0>=(e.cornerRadius??0)||!e.roundStart&&!e.roundEnd){if(i){const e=_(n,r),t=_(n,o);return`M0,0 L${e.x},${e.y} A${n},${n} 0 ${o-r>Math.PI?1:0} 1 ${t.x},${t.y} Z`}const e=_(n,r),s=_(n,o),l=_(t,o),a=_(t,r),c=o-r>Math.PI?1:0;return`M${e.x},${e.y} A${n},${n} 0 ${c} 1 ${s.x},${s.y} L${l.x},${l.y} A${t},${t} 0 ${c} 0 ${a.x},${a.y} Z`}const s=Math.max(0,Math.min(e.cornerRadius??0,(n-t)/2));if(0===s)return Y({...e,cornerRadius:0,roundStart:!1,roundEnd:!1});const l=Math.asin(Math.min(1,s/Math.max(1e-9,n-s))),a=i?0:Math.asin(Math.min(1,s/Math.max(1e-9,t+s))),c=o-r,d=e.roundStart&&e.roundEnd?c/2:c,u=!!e.roundStart&&d>l,h=!!e.roundEnd&&d>l;if(!u&&!h)return Y({...e,cornerRadius:0,roundStart:!1,roundEnd:!1});const f=r+(u?l:0),y=o-(h?l:0),p=r+(u?a:0),m=o-(h?a:0),g=_(n,f),x=_(n,y),b=(n-s)*Math.cos(l),k=_(b,r),$=_(b,o),v=i?null:_(t,m),w=i?null:_(t,p),M=i?0:(t+s)*Math.cos(a),A=i?null:_(M,r),S=i?null:_(M,o),W=y-f>Math.PI?1:0,L=i?0:m-p>Math.PI?1:0;let I="";if(u)I+=`M${k.x},${k.y}`,I+=` A${s},${s} 0 0 1 ${g.x},${g.y}`;else{const e=_(n,r);I+=`M${e.x},${e.y}`}if(h)I+=` A${n},${n} 0 ${W} 1 ${x.x},${x.y}`,I+=` A${s},${s} 0 0 1 ${$.x},${$.y}`;else{const e=_(n,o);I+=` A${n},${n} 0 ${W} 1 ${e.x},${e.y}`}if(i)I+=" L0,0";else{if(h)I+=` L${S.x},${S.y}`,I+=` A${s},${s} 0 0 1 ${v.x},${v.y}`;else{const e=_(t,o);I+=` L${e.x},${e.y}`}if(u)I+=` A${t},${t} 0 ${L} 0 ${w.x},${w.y}`,I+=` A${s},${s} 0 0 1 ${A.x},${A.y}`;else{const e=_(t,r);I+=` A${t},${t} 0 ${L} 0 ${e.x},${e.y}`}}return I+=" Z",I}import{jsx as V,jsxs as Z}from"react/jsx-runtime";var U={innerRadius:0,outerRadius:0,startAngle:0,endAngle:0};function X(e,n="#4e79a7"){return t(e)?e.background&&"transparent"!==e.background?e.background:n:e&&"string"==typeof e?e:n}function K(e){const t=e.replace(/[^A-Za-z0-9_-]/g,"_");return!t||/^\d/.test(t)?"s_"+t:t}function Q(e,t,n,r){const o=e.glyph;if(!o?.parts?.length||0>=e.size)return null;const i=l(o,e.size);if(0>=i.scale)return null;const c=`translate(${t},${n})${e.rotation?` rotate(${180*e.rotation/Math.PI})`:""} translate(${i.offsetX},${i.offsetY}) scale(${i.scale})`,d=e.color??("string"==typeof e.style.fill?e.style.fill:void 0),u=s(o,e.fraction??1,e.fractionStart??0,e.fractionDirection??"horizontal"),h=u?K(r+"-clip"):void 0,f=(e.style.opacity??1)*(e._decayOpacity??1)*(e.style.fillOpacity??1),y=t=>o.parts.map((n,r)=>{const o=t?"none"===n.fill?void 0:t:a(n.fill,d,e.accent),i=t?n.stroke&&"none"!==n.stroke?t:void 0:a(n.stroke??"none",d,e.accent);return o||i?V("path",{d:n.d,fill:o??"none",stroke:i,strokeWidth:i?n.strokeWidth??1:void 0,strokeLinecap:n.strokeLinecap,strokeLinejoin:n.strokeLinejoin,opacity:n.opacity},r):null});return Z("g",{transform:c,opacity:1===f?void 0:f,children:[u&&h&&V("clipPath",{id:h,children:V("rect",{x:u.x,y:u.y,width:u.width,height:u.height})}),u&&e.ghostColor?V("g",{children:y(e.ghostColor)}):null,u&&h?V("g",{clipPath:`url(#${h})`,children:y()}):y()]},r)}import*as J from"react";import{arc as ee}from"d3-shape";import{jsx as te,jsxs as ne}from"react/jsx-runtime";function re(n,r){switch(n.type){case"circle":{const o=n,i=t(o.style.fill)?e(o.style.fill,`net-circle-${r}-hatch`):void 0;return ne(J.Fragment,{children:[i&&te("defs",{children:i}),te("circle",{cx:o.cx,cy:o.cy,r:o.r,fill:i?`url(#net-circle-${r}-hatch)`:X(o.style.fill),stroke:o.style.stroke,strokeWidth:o.style.strokeWidth,opacity:o.style.opacity})]},"net-circle-"+r)}case"rect":{const o=n,i=t(o.style.fill)?e(o.style.fill,`net-rect-${r}-hatch`):void 0;return ne(J.Fragment,{children:[i&&te("defs",{children:i}),te("rect",{x:o.x,y:o.y,width:o.w,height:o.h,fill:i?`url(#net-rect-${r}-hatch)`:X(o.style.fill),stroke:o.style.stroke,strokeWidth:o.style.strokeWidth,opacity:o.style.opacity})]},"net-rect-"+r)}case"arc":{const o=n,i=ee().innerRadius(o.innerR).outerRadius(o.outerR).startAngle(o.startAngle+Math.PI/2).endAngle(o.endAngle+Math.PI/2)(U)||"",s=t(o.style.fill)?e(o.style.fill,`net-arc-${r}-hatch`):void 0;return ne(J.Fragment,{children:[s&&te("defs",{children:s}),te("path",{d:i,transform:`translate(${o.cx},${o.cy})`,fill:s?`url(#net-arc-${r}-hatch)`:X(o.style.fill),stroke:o.style.stroke,strokeWidth:o.style.strokeWidth,opacity:o.style.opacity})]},"net-arc-"+r)}case"symbol":{const e=n,t=h(e.symbolType,e.size,e.path);return te("path",{d:t,transform:e.rotation?`translate(${e.cx},${e.cy}) rotate(${180*e.rotation/Math.PI})`:`translate(${e.cx},${e.cy})`,fill:e.style.fill?X(e.style.fill):"none",stroke:e.style.stroke,strokeWidth:e.style.strokeWidth,opacity:e.style.opacity},"net-symbol-"+r)}case"glyph":return Q(n,n.cx,n.cy,"net-glyph-"+(n.id??r));default:return null}}function oe(e,t){switch(e.type){case"line":return te("line",{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.style.stroke||"#999",strokeWidth:e.style.strokeWidth||1,opacity:e.style.opacity},"net-edge-"+t);case"bezier":{const n=e;return te("path",{d:n.pathD,fill:X(n.style.fill,"#999"),fillOpacity:n.style.fillOpacity,stroke:n.style.stroke||"none",strokeWidth:n.style.strokeWidth,opacity:n.style.opacity},"net-edge-"+t)}case"ribbon":{const n=e;return te("path",{d:n.pathD,fill:X(n.style.fill,"#999"),fillOpacity:n.style.fillOpacity,stroke:n.style.stroke||"none",strokeWidth:n.style.strokeWidth,opacity:n.style.opacity},"net-edge-"+t)}case"curved":{const n=e;return te("path",{d:n.pathD,fill:X(n.style.fill,"none"),stroke:n.style.stroke||"#999",strokeWidth:n.style.strokeWidth||1,opacity:n.style.opacity},"net-edge-"+t)}default:return null}}function ie(e,t){return te("text",{x:e.x,y:e.y,textAnchor:e.anchor||"middle",dominantBaseline:e.baseline||"auto",fontSize:e.fontSize||11,fontWeight:e.fontWeight,fill:e.fill||"var(--semiotic-text, #333)",stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:e.paintOrder,children:e.text},"net-label-"+t)}import*as se from"react";import{jsx as le,jsxs as ae}from"react/jsx-runtime";function ce(n,r){switch(n.type){case"geoarea":{const o=n;if(!o.pathData)return null;const i=t(o.style.fill)?e(o.style.fill,`geoarea-${r}-hatch`):void 0;return ae(se.Fragment,{children:[i&&le("defs",{children:i}),le("path",{d:o.pathData,fill:i?`url(#geoarea-${r}-hatch)`:X(o.style.fill,"#e0e0e0"),fillOpacity:o.style.fillOpacity??1,stroke:o.style.stroke||"none",strokeWidth:o.style.strokeWidth||.5,strokeDasharray:o.style.strokeDasharray,opacity:o._decayOpacity??1})]},"geoarea-"+r)}case"point":{const o=n,i=t(o.style.fill)?e(o.style.fill,`geopoint-${r}-hatch`):void 0;return ae(se.Fragment,{children:[i&&le("defs",{children:i}),le("circle",{cx:o.x,cy:o.y,r:o.r,fill:i?`url(#geopoint-${r}-hatch)`:X(o.style.fill),fillOpacity:o.style.fillOpacity??.8,stroke:o.style.stroke,strokeWidth:o.style.strokeWidth,opacity:o._decayOpacity??o.style.opacity??1})]},"point-"+r)}case"line":{const e=n;if(2>e.path.length)return null;const t="M"+e.path.map(e=>`${e[0]},${e[1]}`).join("L");return le("path",{d:t,fill:"none",stroke:e.style.stroke||"#4e79a7",strokeWidth:e.style.strokeWidth||1.5,strokeDasharray:e.style.strokeDasharray,opacity:e.style.opacity??1},"line-"+r)}case"glyph":return Q(n,n.x,n.y,"geo-glyph-"+(n.pointId??r));default:return null}}import{jsx as de,jsxs as ue}from"react/jsx-runtime";function he(e,t,n){const r=h(e.symbolType,e.size,e.path);return de("path",{d:r,transform:e.rotation?`translate(${e.x},${e.y}) rotate(${180*e.rotation/Math.PI})`:`translate(${e.x},${e.y})`,fill:e.style.fill?X(e.style.fill):"none",fillOpacity:e.style.fillOpacity,opacity:e.style.opacity,stroke:e.style.stroke,strokeWidth:e.style.strokeWidth},`${n??""}symbol-${t}`)}function fe(e){const t=e.filter(e=>Number.isFinite(e.offset)).map(e=>({offset:Math.max(0,Math.min(1,e.offset)),color:e.color}));return 2>t.length?null:t.map((e,t)=>de("stop",{offset:e.offset,stopColor:e.color},t))}function ye(e,t,n){if(!e||2>t.length)return null;const r=fe(e.colorStops);return r?de("linearGradient",{id:n,gradientUnits:"userSpaceOnUse",x1:t[0][0],y1:0,x2:t[t.length-1][0],y2:0,children:r}):null}function pe(n,r,o){switch(n.type){case"line":{const e=n;if(0===e.path.length)return null;const t=T(e.curve),i=t?L().x(([e])=>e).y(([,e])=>e).curve(t)(e.path)??"":"M"+e.path.map(([e,t])=>`${e},${t}`).join("L"),s=K(`${o?o+"-":""}line-${r}-stroke-gradient`),l=ye(e.strokeGradient,e.path,s);return ue(A.Fragment,{children:[l&&de("defs",{children:l}),de("path",{d:i,fill:"none",stroke:l?`url(#${s})`:e.style.stroke||"#4e79a7",strokeWidth:e.style.strokeWidth||2,strokeDasharray:e.style.strokeDasharray,opacity:e.style.opacity})]},"line-"+r)}case"area":{const i=n;if(0===i.topPath.length)return null;const s=T(i.curve),l=!s||2>i.topPath.length||2>i.bottomPath.length?`M${i.topPath.map(([e,t])=>`${e},${t}`).join("L")}L${[...i.bottomPath].reverse().map(([e,t])=>`${e},${t}`).join("L")}Z`:W().x(([e])=>e).y0((e,t)=>i.bottomPath[t][1]).y1(([,e])=>e).curve(s)(i.topPath)??"",a=`${o?o+"-":""}area-${r}-hatch`,c=t(i.style.fill)?e(i.style.fill,a):void 0,d=K(`${o?o+"-":""}area-${r}-gradient`),u=function(e,t){const n=e.fillGradient;if(!n||"object"!=typeof n)return null;let r=1/0;for(const[,t]of e.topPath)r=Math.min(r,t);let o=-1/0;for(const[,t]of e.bottomPath)o=Math.max(o,t);if(!Number.isFinite(r)||!Number.isFinite(o))return null;const i=[];if("colorStops"in n){const e=fe(n.colorStops);if(!e)return null;i.push(...e)}else{if(!Number.isFinite(n.topOpacity)||!Number.isFinite(n.bottomOpacity))return null;i.push(de("stop",{offset:0,stopColor:X(e.style.fill),stopOpacity:Math.max(0,Math.min(1,n.topOpacity))},"0")),i.push(de("stop",{offset:1,stopColor:X(e.style.fill),stopOpacity:Math.max(0,Math.min(1,n.bottomOpacity))},"1"))}return de("linearGradient",{id:t,gradientUnits:"userSpaceOnUse",x1:0,y1:r,x2:0,y2:o,children:i})}(i,d),h=u?`url(#${d})`:c?`url(#${a})`:X(i.style.fill),f=u?void 0:i.style.fillOpacity??i.style.opacity??.7,y=s?L().x(([e])=>e).y(([,e])=>e).curve(s)(i.topPath)??"":"M"+i.topPath.map(([e,t])=>`${e},${t}`).join("L"),p=K(`${o?o+"-":""}area-${r}-stroke-gradient`),m=ye(i.strokeGradient,i.topPath,p),g=i.style.stroke&&"none"!==i.style.stroke?de("path",{d:y,fill:"none",stroke:m?`url(#${p})`:X(i.style.stroke),strokeWidth:i.style.strokeWidth||2,opacity:i.style.opacity}):null;if(i.clipRect){const e=`${o?o+"-":""}area-clip-${r}`;return ue("g",{children:[ue("defs",{children:[u,!u&&c,m,de("clipPath",{id:e,children:de("rect",{x:i.clipRect.x,y:i.clipRect.y,width:i.clipRect.width,height:i.clipRect.height})})]}),ue("g",{clipPath:`url(#${e})`,children:[de("path",{d:l,fill:h,fillOpacity:f,opacity:u?i.style.opacity:void 0,stroke:"none"}),g]})]},"area-"+r)}return ue(A.Fragment,{children:[(u||c||m)&&ue("defs",{children:[u,!u&&c,m]}),de("path",{d:l,fill:h,fillOpacity:f,opacity:u?i.style.opacity:void 0,stroke:"none"}),g]},"area-"+r)}case"point":{const i=n,s=`${o?o+"-":""}point-${r}-hatch`,l=t(i.style.fill)?e(i.style.fill,s):void 0;return ue(A.Fragment,{children:[l&&de("defs",{children:l}),de("circle",{cx:i.x,cy:i.y,r:i.r,fill:l?`url(#${s})`:X(i.style.fill),opacity:i.style.opacity??i.style.fillOpacity??.8,stroke:i.style.stroke,strokeWidth:i.style.strokeWidth})]},"point-"+r)}case"symbol":return he(n,r);case"glyph":return Q(n,n.x,n.y,`${o??""}glyph-${n.pointId??r}`);case"rect":{const i=n,s=`${o?o+"-":""}xyrect-${r}-hatch`,l=t(i.style.fill)?e(i.style.fill,s):void 0;return ue(A.Fragment,{children:[l&&de("defs",{children:l}),de("rect",{x:i.x,y:i.y,width:i.w,height:i.h,fill:l?`url(#${s})`:X(i.style.fill),opacity:i.style.opacity,stroke:i.style.stroke,strokeWidth:i.style.strokeWidth})]},"rect-"+r)}case"heatcell":{const e=n;if(e.showValues&&null!=e.value&&e.w>=20&&e.h>=20){const t=e.valueFormat?e.valueFormat(e.value):Number.isInteger(e.value)?e.value+"":100>Math.abs(e.value)?1>Math.abs(e.value)?e.value.toPrecision(3):e.value.toFixed(1):e.value.toFixed(0),[n,o,i]=function(e){if(e.startsWith("#")){let t=e.slice(1);if(3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6===t.length)return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}const t=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return t?[+t[1],+t[2],+t[3]]:[128,128,128]}(e.fill),s=.299*n+.587*o+.114*i>128?"#000":"#fff",l=Math.max(10,Math.min(16,.3*Math.min(e.w,e.h)));return ue("g",{children:[de("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:e.fill}),de("text",{x:e.x+e.w/2,y:e.y+e.h/2,textAnchor:"middle",dominantBaseline:"middle",fill:s,fontSize:l+"px",children:t})]},"heatcell-"+r)}return de("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:e.fill},"heatcell-"+r)}case"candlestick":{const e=n,t=Math.min(e.openY,e.closeY),o=Math.max(Math.abs(e.openY-e.closeY),1),i=e.isUp?e.upColor:e.downColor;return ue("g",{children:[de("line",{x1:e.x,y1:e.highY,x2:e.x,y2:e.lowY,stroke:e.wickColor,strokeWidth:e.wickWidth}),de("rect",{x:e.x-e.bodyWidth/2,y:t,width:e.bodyWidth,height:o,fill:i,stroke:i,strokeWidth:1})]},"candle-"+r)}default:return null}}function me(e){return 1e6>e?1e4>e?1e3>e?e+"":(e/1e3).toFixed(1)+"K":(e/1e3).toFixed(0)+"K":(e/1e6).toFixed(1)+"M"}function ge(e,t){const n=e.datum;if(!n)return null;const r=[],o=n.__funnelStepLabel,i=Number(n.__funnelStepLabelX),s=Number(n.__funnelStepLabelY),l=Number(n.__funnelRowWidth);"string"!=typeof o||!Number.isFinite(i)||!Number.isFinite(s)||Number.isFinite(l)&&8.4*o.length+16>l||r.push(de("text",{x:i,y:s+3,textAnchor:"middle",dominantBaseline:"hanging",fontSize:14,fontWeight:"bold",fill:"#fff",stroke:"rgba(0,0,0,0.6)",strokeWidth:3,paintOrder:"stroke",children:o},t+"-funnel-step"));const a=Number(n.__funnelValue),c=Number(n.__funnelValueLabelX),d=Number(n.__funnelValueLabelY),u=Number(n.__funnelBarW);if(Number.isFinite(a)&&0!==a&&Number.isFinite(c)&&Number.isFinite(d)&&u>=60){const e=Number(n.__funnelPercent);let o=!0!==n.__funnelIsFirstStep&&Number.isFinite(e)?`${me(a)} (${.05>Math.abs(e-Math.round(e))?Math.round(e):e.toFixed(1)}%)`:me(a);7.8*o.length+16>u&&(o=me(a)),7.8*o.length+16>u||r.push(de("text",{x:c,y:d+22,textAnchor:"middle",dominantBaseline:"hanging",fontSize:13,fontWeight:"bold",fill:"#fff",stroke:"rgba(0,0,0,0.5)",strokeWidth:3,paintOrder:"stroke",children:o},t+"-funnel-value"))}return r.length?de("g",{children:r},t+"-funnel-labels"):null}function xe(n,r,o){const i=("category"in n?n.category:void 0)||("group"in n?n.group:void 0)||"",s=e=>`ord-${n.type}-${i}-${r}-${e}`,l=`ord-${n.type}-${i}-${r}`;switch(n.type){case"rect":{const r=n,o=K(l)+"-grad",i=function(e,t){const n=e.fillGradient;if(!n||"object"!=typeof n)return null;let r=e.x,o=e.y,i=e.x,s=e.y+e.h;"bottom"===e.roundedEdge?(o=e.y+e.h,s=e.y):"right"===e.roundedEdge?(r=e.x+e.w,o=e.y,i=e.x,s=e.y):"left"===e.roundedEdge&&(r=e.x,o=e.y,i=e.x+e.w,s=e.y);const l=[];if("colorStops"in n){const e=fe(n.colorStops);if(!e)return null;l.push(...e)}else{const t=X(e.style.fill);l.push(de("stop",{offset:0,stopColor:t,stopOpacity:n.topOpacity},"0")),l.push(de("stop",{offset:1,stopColor:t,stopOpacity:n.bottomOpacity},"1"))}return de("linearGradient",{id:t,gradientUnits:"userSpaceOnUse",x1:r,y1:o,x2:i,y2:s,children:l})}(r,o);let s,a;if(i)a=`url(#${o})`;else if(t(r.style.fill)){const t=K(l)+"-hatch";s=e(r.style.fill,t),a=`url(#${t})`}else a=X(r.style.fill);const c=i||s?ue("defs",{children:[i,s]}):null;if(r.cornerRadii&&H(r.cornerRadii)){const e=function(e){const{x:t,y:n,w:r,h:o}=e,{tl:i,tr:s,br:l,bl:a}=q(e);let c=`M${t+i},${n}`;return c+=` L${t+r-s},${n}`,s>0&&(c+=` A${s},${s} 0 0 1 ${t+r},${n+s}`),c+=` L${t+r},${n+o-l}`,l>0&&(c+=` A${l},${l} 0 0 1 ${t+r-l},${n+o}`),c+=` L${t+a},${n+o}`,a>0&&(c+=` A${a},${a} 0 0 1 ${t},${n+o-a}`),c+=` L${t},${n+i}`,i>0&&(c+=` A${i},${i} 0 0 1 ${t+i},${n}`),c+=" Z",c}(r);return ue(A.Fragment,{children:[c,de("path",{d:e,fill:a,opacity:r.style.opacity,stroke:r.style.stroke,strokeWidth:r.style.strokeWidth})]},l)}if(r.roundedTop&&r.roundedTop>0){const e=Math.min(r.roundedTop,r.w/2,r.h/2),{x:t,y:n,w:o,h:i}=r;let s;switch(r.roundedEdge){case"right":s=`M${t},${n} L${t+o-e},${n} A${e},${e} 0 0 1 ${t+o},${n+e} L${t+o},${n+i-e} A${e},${e} 0 0 1 ${t+o-e},${n+i} L${t},${n+i} Z`;break;case"left":s=`M${t+o},${n} L${t+e},${n} A${e},${e} 0 0 0 ${t},${n+e} L${t},${n+i-e} A${e},${e} 0 0 0 ${t+e},${n+i} L${t+o},${n+i} Z`;break;case"bottom":s=`M${t},${n} L${t+o},${n} L${t+o},${n+i-e} A${e},${e} 0 0 1 ${t+o-e},${n+i} L${t+e},${n+i} A${e},${e} 0 0 1 ${t},${n+i-e} Z`;break;default:s=`M${t},${n+i} L${t},${n+e} A${e},${e} 0 0 1 ${t+e},${n} L${t+o-e},${n} A${e},${e} 0 0 1 ${t+o},${n+e} L${t+o},${n+i} Z`}return ue(A.Fragment,{children:[c,de("path",{d:s,fill:a,opacity:r.style.opacity,stroke:r.style.stroke,strokeWidth:r.style.strokeWidth})]},l)}return ue(A.Fragment,{children:[c,de("rect",{x:r.x,y:r.y,width:r.w,height:r.h,fill:a,opacity:r.style.opacity,stroke:r.style.stroke,strokeWidth:r.style.strokeWidth}),ge(r,l)]},l)}case"point":{const e=n;return de("circle",{cx:e.x,cy:e.y,r:e.r,fill:X(e.style.fill),opacity:e.style.opacity??e.style.fillOpacity??.8,stroke:e.style.stroke,strokeWidth:e.style.strokeWidth},l)}case"symbol":return he(n,r,o);case"glyph":return Q(n,n.x,n.y,`${o??""}ord-glyph-${n.pointId??r}`);case"wedge":{const e=n;if(e._gradientBand&&e._gradientBand.colors.length>0){const t=K(`${o?o+"-":""}gauge-grad-${e.category||l}-${r}`),{clipPath:n,slices:i}=function(e){const t=Y({innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,cornerRadius:e.cornerRadius,roundStart:e.roundStart,roundEnd:e.roundEnd}),n=[],r=e.colors;if(r.length>0){const t=(e.endAngle-e.startAngle)/r.length;for(let o=0;r.length>o;o++)n.push({d:Y({innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle+o*t,endAngle:e.endAngle}),color:r[o]})}return{clipPath:t,slices:n}}({innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,cornerRadius:e.cornerRadius,roundStart:e.roundedEnds?.start??!0,roundEnd:e.roundedEnds?.end??!0,colors:e._gradientBand.colors});return ue("g",{transform:`translate(${e.cx},${e.cy})`,opacity:e.style.opacity,fillOpacity:e.style.fillOpacity,children:[de("defs",{children:de("clipPath",{id:t,children:de("path",{d:n})})}),de("g",{clipPath:`url(#${t})`,children:i.map((e,t)=>de("path",{d:e.d,fill:X(e.color)},t))}),e.style.stroke&&"none"!==e.style.stroke&&de("path",{d:n,fill:"none",stroke:e.style.stroke,strokeWidth:e.style.strokeWidth})]},l)}let t;if(e.roundedEnds)t=Y({innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,cornerRadius:e.cornerRadius,roundStart:e.roundedEnds.start,roundEnd:e.roundedEnds.end});else{const n=S().innerRadius(e.innerRadius).outerRadius(e.outerRadius).startAngle(e.startAngle+Math.PI/2).endAngle(e.endAngle+Math.PI/2);e.cornerRadius&&n.cornerRadius(e.cornerRadius),t=n(U)||""}return de("path",{d:t,transform:`translate(${e.cx},${e.cy})`,fill:X(e.style.fill),stroke:e.style.stroke,strokeWidth:e.style.strokeWidth,opacity:e.style.opacity},l)}case"boxplot":{const e=n,t=e.columnWidth/2;return ue("g","vertical"===e.projection?{children:[de("line",{x1:e.x,y1:e.minPos,x2:e.x,y2:e.maxPos,stroke:e.style.stroke||"#333",strokeWidth:1}),de("rect",{x:e.x-t,y:Math.min(e.q1Pos,e.q3Pos),width:e.columnWidth,height:Math.abs(e.q3Pos-e.q1Pos),fill:X(e.style.fill),fillOpacity:e.style.fillOpacity??.6,stroke:e.style.stroke||"#333",strokeWidth:1}),de("line",{x1:e.x-t,y1:e.medianPos,x2:e.x+t,y2:e.medianPos,stroke:e.style.stroke||"#333",strokeWidth:2}),de("line",{x1:e.x-.5*t,y1:e.minPos,x2:e.x+.5*t,y2:e.minPos,stroke:e.style.stroke||"#333",strokeWidth:1}),de("line",{x1:e.x-.5*t,y1:e.maxPos,x2:e.x+.5*t,y2:e.maxPos,stroke:e.style.stroke||"#333",strokeWidth:1})]}:{children:[de("line",{x1:e.minPos,y1:e.y,x2:e.maxPos,y2:e.y,stroke:e.style.stroke||"#333",strokeWidth:1}),de("rect",{x:Math.min(e.q1Pos,e.q3Pos),y:e.y-t,width:Math.abs(e.q3Pos-e.q1Pos),height:e.columnWidth,fill:X(e.style.fill),fillOpacity:e.style.fillOpacity??.6,stroke:e.style.stroke||"#333",strokeWidth:1}),de("line",{x1:e.medianPos,y1:e.y-t,x2:e.medianPos,y2:e.y+t,stroke:e.style.stroke||"#333",strokeWidth:2}),de("line",{x1:e.minPos,y1:e.y-.5*t,x2:e.minPos,y2:e.y+.5*t,stroke:e.style.stroke||"#333",strokeWidth:1}),de("line",{x1:e.maxPos,y1:e.y-.5*t,x2:e.maxPos,y2:e.y+.5*t,stroke:e.style.stroke||"#333",strokeWidth:1})]},l)}case"violin":{const e=n,t=[de("path",{d:e.pathString,transform:e.translateX||e.translateY?`translate(${e.translateX},${e.translateY})`:void 0,fill:X(e.style.fill),fillOpacity:e.style.fillOpacity??.6,stroke:e.style.stroke||"#333",strokeWidth:e.style.strokeWidth||1},s("path"))];if(e.iqrLine&&e.bounds){const n=e.bounds,r=n.x+n.width/2,o=n.y+n.height/2;e.iqrLine.isVertical?t.push(de("line",{x1:r,y1:e.iqrLine.q1Pos,x2:r,y2:e.iqrLine.q3Pos,stroke:e.style.stroke||"#333",strokeWidth:2},s("iqr")),de("circle",{cx:r,cy:e.iqrLine.medianPos,r:3,fill:"white",stroke:e.style.stroke||"#333",strokeWidth:1},s("med"))):t.push(de("line",{x1:e.iqrLine.q1Pos,y1:o,x2:e.iqrLine.q3Pos,y2:o,stroke:e.style.stroke||"#333",strokeWidth:2},s("iqr")),de("circle",{cx:e.iqrLine.medianPos,cy:o,r:3,fill:"white",stroke:e.style.stroke||"#333",strokeWidth:1},s("med")))}return de("g",{children:t},l)}case"connector":return de("line",{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,stroke:n.style.stroke||"#999",strokeWidth:n.style.strokeWidth||1,opacity:n.style.opacity??.5},l);case"trapezoid":{const e=n,t=e.points.map(e=>`${e[0]},${e[1]}`).join(" ");return de("polygon",{points:t,fill:X(e.style.fill,"#999"),opacity:e.style.opacity,stroke:e.style.stroke,strokeWidth:e.style.strokeWidth},l)}default:return null}}var be="undefined"==typeof window||"undefined"==typeof document;function ke(e){return"touch"===e?"touch":"pointer"}function $e(e){const t=e.target;return t instanceof Element&&t!==e.currentTarget&&null!=t.closest("button, a[href], input, select, textarea, summary, [contenteditable='true'], [role='button'], [role='link'], [role='checkbox'], [role='radio'], [role='switch']")}function ve(e){const{onObservation:t,datum:n,x:r=0,y:o=0,chartType:i,chartId:s,context:l,timestamp:a=Date.now()}=e;t&&(n?(t({type:"hover",datum:n,x:r,y:o,timestamp:a,chartType:i,chartId:s}),"focus"===l?.type&&t({type:"focus",datum:n,inputType:"touch"===l.inputType?"pointer":l.inputType,timestamp:a,chartType:i,chartId:s})):t({type:"hover-end",timestamp:a,chartType:i,chartId:s}))}function we(e){const{onObservation:t,datum:n,x:r=0,y:o=0,chartType:i,chartId:s,context:l,timestamp:a=Date.now()}=e;t&&(n?(t({type:"click",datum:n,x:r,y:o,timestamp:a,chartType:i,chartId:s}),"activate"===l?.type&&t({type:"activate",datum:n,inputType:l.inputType,timestamp:a,chartType:i,chartId:s})):t({type:"click-end",timestamp:a,chartType:i,chartId:s}))}import{useId as Me,useMemo as Ae,useCallback as Se}from"react";function We(e){const t=[];for(const[n,r]of Object.entries(e.fields))if("point"===r.type)t.push(e=>r.values.has(e[n]));else{const[e,o]=r.range;t.push(t=>{const r=t[n];return r>=e&&o>=r})}return e=>t.every(t=>t(e))}function Le(e,t){let n=e.get(t);return n||(n={name:t,resolution:"union",clauses:new Map},e.set(t,n)),n}function Ie(e,t){if(e.type!==t.type)return!1;if("interval"===e.type&&"interval"===t.type)return e.range[0]===t.range[0]&&e.range[1]===t.range[1];if("point"===e.type&&"point"===t.type){if(e.values.size!==t.values.size)return!1;for(const n of e.values)if(!t.values.has(n))return!1;return!0}return!1}var[Ce,Ne]=y(e=>({selections:new Map,setClause(t,n){e(e=>{const r=e.selections.get(t),o=r?.clauses.get(n.clientId);if(o&&function(e,t){if(e.clientId!==t.clientId||e.type!==t.type)return!1;const n=Object.entries(e.fields);if(n.length!==function(e){let t=0;for(const n in e)t++;return t}(t.fields))return!1;for(const[e,r]of n){const n=t.fields[e];if(!n||!Ie(r,n))return!1}return!0}(o,n))return{};const i=new Map(e.selections),s=Le(i,t),l=new Map(s.clauses);return l.set(n.clientId,n),i.set(t,{...s,clauses:l}),{selections:i}})},clearClause(t,n){e(e=>{const r=e.selections.get(t);if(!r||!r.clauses.has(n))return{};const o=new Map(e.selections),i=new Map(r.clauses);return i.delete(n),o.set(t,{...r,clauses:i}),{selections:o}})},setResolution(t,n){e(e=>{const r=e.selections.get(t);if(r?.resolution===n)return{};const o=new Map(e.selections),i=Le(o,t);return o.set(t,{...i,resolution:n}),{selections:o}})},clearSelection(t){e(e=>{const n=e.selections.get(t);if(!n||0===n.clauses.size)return{};const r=new Map(e.selections);return r.set(t,{...n,clauses:new Map}),{selections:r}})}}));import{useSyncExternalStore as Pe}from"react";var Oe={positions:new Map},je=new Set;function Fe(){for(const e of je)e()}function Re(e,t){const n=Oe.positions.get(e);if(n?.locked)return;if(!n||n.sourceId!==t)return;const r=new Map(Oe.positions);r.delete(e),Oe={positions:r},Fe()}function ze(e,t){const n=Oe.positions.get(e);if(!n?.locked)return;if(t&&n.sourceId!==t)return;const r=new Map(Oe.positions);r.delete(e),Oe={positions:r},Fe()}function Te(){return Oe}function Ge(e){return je.add(e),()=>je.delete(e)}var Be={positions:new Map};function De(){return()=>{}}function Ee(){return Be}function He(e){const t=Pe(e?Ge:De,e?Te:Ee,e?Te:Ee);return e?t.positions.get(e)??null:null}function qe(e){const t=Me(),n=e.clientId||t,{name:r}=e,o=Ne(e=>e.selections.get(r)),i=Ne(e=>e.setClause),s=Ne(e=>e.clearClause),l=Ae(()=>!!o&&o.clauses.size>0,[o]);return{predicate:Ae(()=>o&&0!==o.clauses.size?function(e,t){const n=[];for(const[r,o]of e.clauses)"crossfilter"===e.resolution&&r===t||n.push(We(o));return 0===n.length?()=>!0:"intersect"===e.resolution?e=>n.every(t=>t(e)):e=>n.some(t=>t(e))}(o,n):()=>!0,[o,n]),isActive:l,selectPoints:Se(e=>{const t={};let o=!1;for(const[n,r]of Object.entries(e))t[n]={type:"point",values:new Set(r)},o=!0;o&&i(r,{clientId:n,type:"point",fields:t})},[n,r,i]),selectInterval:Se(e=>{const t={};let o=!1;for(const[n,r]of Object.entries(e))t[n]={type:"interval",range:r},o=!0;o&&i(r,{clientId:n,type:"interval",fields:t})},[n,r,i]),clear:Se(()=>{s(r,n)},[s,r,n]),clientId:n}}function _e(e){return 2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function Ye(e){const{name:t,xField:n,yField:r}=e,{predicate:o,isActive:i,selectInterval:s,clear:l}=qe({name:t,fields:[n,r].filter(Boolean)}),a=n&&r?"xyBrush":n?"xBrush":"yBrush",c=Se(e=>{if(!e)return void l();const t={};"xyBrush"===a&&function(e){return 2===e.length&&Array.isArray(e[0])&&2===e[0].length&&Array.isArray(e[1])&&2===e[1].length}(e)?(n&&(t[n]=[Math.min(e[0][0],e[1][0]),Math.max(e[0][0],e[1][0])]),r&&(t[r]=[Math.min(e[0][1],e[1][1]),Math.max(e[0][1],e[1][1])])):"xBrush"===a&&_e(e)?n&&(t[n]=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]):"yBrush"===a&&_e(e)&&r&&(t[r]=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]),Ve(t)&&s(t)},[a,n,r,s,l]);return{brushInteraction:Ae(()=>({brush:a,during:c,end:c}),[a,c]),predicate:o,isActive:i,clear:l}}function Ve(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function Ze(e){return e?"string"==typeof e?{name:e}:e:null}var Ue={enabled:!0,tapToSelect:!0,tapToLockTooltip:!0,clearSelection:"backgroundTap",targetSize:44,snap:"nearestDatum",brushHandleSize:44,standardControls:!1,enabled:!1,tapToSelect:!1,tapToLockTooltip:!1};function Xe(e,t={}){const n=t.mobileSemantics?.interaction,r="number"==typeof n?.targetSize?n.targetSize:"number"==typeof t.mobileSemantics?.minimumHitTarget?t.mobileSemantics.minimumHitTarget:void 0,o="mobile"===t.mode||"number"==typeof t.width&&480>=t.width,i=!!n||void 0!==r,s=e&&"object"==typeof e?e:void 0;if(!1===e||!1===s?.enabled||void 0===e&&!o&&!i)return Ue;const l=s??{};return{enabled:!0,tapToSelect:l.tapToSelect??!0,tapToLockTooltip:l.tapToLockTooltip??!0,clearSelection:l.clearSelection??"backgroundTap",targetSize:l.targetSize??r??44,snap:l.snap??"nearestDatum",brushHandleSize:l.brushHandleSize??44,standardControls:l.standardControls??!1}}var Ke={primary:{width:600,height:400,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:void 0,showLabels:void 0,marginDefaults:{top:50,bottom:60,left:70,right:40}},context:{width:400,height:250,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:10,bottom:10,left:10,right:10}},sparkline:{width:120,height:24,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:2,bottom:2,left:0,right:0}},mobile:{width:390,height:300,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:!1,showLabels:!0,marginDefaults:{top:28,bottom:42,left:44,right:16}}};function Qe(e){return"string"==typeof e&&Object.prototype.hasOwnProperty.call(Ke,e)}function Je(e,t,n){const o=Ke[e||"primary"],i=e&&"primary"!==e||!n?.width?o.width:n.width,s=e&&"primary"!==e||!n?.height?o.height:n.height,l={...t,mode:e},a=r(l,{width:t.width??i,height:t.height??s}).props,c=a.mode||e,d=Ke[c||"primary"],u="context"===c||"sparkline"===c,h=c&&"primary"!==c||!n?.width?d.width:n.width;return{width:a.width??h,height:a.height??(c&&"primary"!==c||!n?.height?d.height:n.height),showAxes:a.showAxes??d.showAxes,showGrid:a.showGrid??d.showGrid,enableHover:a.enableHover??(!!a.linkedHover||d.enableHover),showLegend:a.showLegend??d.showLegend,showLabels:a.showLabels??d.showLabels,title:u?void 0:a.title,description:a.description,summary:a.summary,accessibleTable:a.accessibleTable,xLabel:u?void 0:a.xLabel,yLabel:u?void 0:a.yLabel,categoryLabel:u?void 0:a.categoryLabel,valueLabel:u?void 0:a.valueLabel,marginDefaults:et(d.marginDefaults,a.showCategoryTicks,a.orientation),compactMode:u,mobileInteraction:Xe(a.mobileInteraction,{mode:c,width:a.width??h,mobileSemantics:a.mobileSemantics}),mobileSemantics:a.mobileSemantics}}function et(e,t,n){if(!1!==t)return e;const r={...e};return"horizontal"===n?r.left=Math.min(r.left,15):r.bottom=Math.min(r.bottom,15),r}import{useMemo as tt,useCallback as nt,useState as rt,useId as ot,useEffect as it,useRef as st}from"react";import{scaleOrdinal as lt}from"d3-scale";var at={category10:c,tableau10:u,set3:d,...i},ct=c,dt="#007bff";function ut(e,t,n=ct){if(e&&"object"==typeof e&&!Array.isArray(e)){const t=Object.values(e).filter(e=>"string"==typeof e&&e.length>0);if(t.length>0)return t}if(Array.isArray(e)&&e.length>0)return e;if("string"==typeof e){const t=at[e];if(Array.isArray(t)&&t.length>0)return t}return t&&t.length>0?t:n}var ht=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7","#9c755f","#bab0ac"],ft=new Set(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","transparent","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]);function yt(e,t,n){if("function"==typeof t){const r=t(e);return n&&r&&"string"==typeof r&&!function(e){const t=e.toLowerCase();return t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")||ft.has(t)}(r)?n(r):r}const r=e?.[t]+"";return n?n(r):ct[Math.abs(function(e){let t=0;for(let n=0;e.length>n;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return Math.abs(t)}(r))%ct.length]}function pt(e,t){if(null==t||!Object.prototype.hasOwnProperty.call(e,t))return;const n=e[t];return"string"==typeof n&&n.length>0?n:void 0}function mt(e,t,n="category10"){if(n&&"object"==typeof n&&!Array.isArray(n)){const e=n;return t=>pt(e,t)??"#999"}const r=Array.from(new Set(e.map(e=>e?.[t]).filter(e=>null!=e).map(e=>e+""))),o=r.every(e=>!isNaN(Number(e)));if(Array.isArray(n))return lt().domain(r).range(n).unknown("#999");const i=at[n]||at.category10;if(o&&"function"==typeof i){let e=-1/0;for(const t of r){const n=Number(t);n>e&&(e=n)}return t=>i(Number(t)/e)}{const e=Array.isArray(i)?i:ct;return lt().domain(r).range(e).unknown("#999")}}function gt(e,t,n=[3,20],r){let o;if(o="function"==typeof t?t(e):e?.[t],!r)return o;const[i,s]=r,[l,a]=n;if(s===i)return(l+a)/2;let c=(o-i)/(s-i);return 0>c?c=0:c>1&&(c=1),l+c*(a-l)}import{createContext as xt,useContext as bt,useEffect as kt,useId as $t,useLayoutEffect as vt,useMemo as wt,useRef as Mt,useState as At,useCallback as St}from"react";import*as Wt from"react";var Lt=22;function It(e){const t=Math.max(1,e?.swatchSize??16),n=Math.max(t,e?.rowHeight??22);return{swatchSize:t,labelGap:Math.max(0,e?.labelGap??6),itemGap:Math.max(0,e?.itemGap??10),rowHeight:n,align:"left"===e?.align?"start":"right"===e?.align?"end":e?.align??"start",maxWidth:e?.maxWidth}}function Ct(e,t){let n=24;return e.map(({hasLabel:e,itemCount:r})=>{n+=5;const o=n;let i;n+=8,e&&(n+=16,i=n,n+=8);const s=n;return n+=r*t+8,{lineY:o,labelY:i,itemsY:s,endY:n}})}import{jsx as Nt,jsxs as Pt}from"react/jsx-runtime";var Ot={fill:(e,t)=>Nt("rect",{style:e,width:t,height:t}),line:(e,t)=>Nt("line",{style:e,x1:0,y1:0,x2:t,y2:t})};function jt(e,t,n,r,o){let i;return i="function"==typeof n?n(e):(0,Ot[n])(r(e,t),o),i}function Ft({swatchSize:e}){return Nt("path",{d:`M${.25*e},${.55*e} L${.45*e},${.75*e} L${.8*e},${.3*e}`,fill:"none",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})}function Rt(e,t,n){return n&&n.size>0?n.has(e.label)?1:.3:null!=t?e.label===t?1:.3:1}var zt=(e,t,n,r,o,i,s,l,a,c,d)=>{const{type:u="fill",styleFn:h,items:f}=e,y=[];let p=0;const m=!(!t&&!n),g="isolate"===c||void 0===c&&null!=o,{swatchSize:x,labelGap:b,rowHeight:k}=d;return f.forEach((e,c)=>{const d=jt(e,c,u,h,x),$=Rt(e,r,o),v=o&&o.size>0&&o.has(e.label);y.push(Pt("g",{transform:`translate(0,${p})`,onClick:t?()=>t(e):void 0,onMouseEnter:n?()=>n(e):void 0,onMouseLeave:n?()=>n(null):void 0,tabIndex:m?l===i&&c===s?0:-1:void 0,role:m?"option":void 0,"aria-selected":m&&g?v||!1:void 0,"aria-current":m&&!g&&null!=r&&e.label===r||void 0,"aria-label":e.label,onKeyDown:m?n=>{if("Enter"!==n.key&&" "!==n.key||(n.preventDefault(),t&&t(e)),"ArrowDown"===n.key||"ArrowUp"===n.key){n.preventDefault();const e=(c+("ArrowDown"===n.key?1:-1)+f.length)%f.length;a(l,e);const t=n.currentTarget.parentElement?.children[e];t instanceof SVGElement&&t.focus()}}:void 0,onFocus:m?t=>{a(l,c),n&&n(e);const r=t.currentTarget.querySelector(".semiotic-legend-focus-ring");r&&r.setAttribute("visibility","visible")}:void 0,onBlur:m?e=>{n&&n(null);const t=e.currentTarget.querySelector(".semiotic-legend-focus-ring");t&&t.setAttribute("visibility","hidden")}:void 0,style:{cursor:m?"pointer":"default",opacity:$,transition:"opacity 150ms ease",pointerEvents:"all",outline:"none"},children:[m&&Nt("rect",{className:"semiotic-legend-focus-ring",x:-2,y:-2,width:x+b+2+7*e.label.length,height:x+4,fill:"none",stroke:"var(--semiotic-focus, #005fcc)",strokeWidth:2,rx:3,visibility:"hidden"}),d,v&&Nt(Ft,{swatchSize:x}),Nt("text",{y:x/2,x:x+b,dominantBaseline:"central",style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:e.label})]},"legend-item-"+c)),p+=k}),y};function Tt({config:e,orientation:t="vertical",width:n=100}){const{colorFn:r,domain:o,label:i,format:s}=e,l=s||(e=>Math.round(100*e)/100+""),a="grad-legend-"+Wt.useId();if("horizontal"===t){const e=12,t=Math.min(n,200),s=Math.max(0,(n-t)/2),c=[];for(let e=0;64>=e;e++){const t=e/64;c.push(Nt("stop",{offset:100*t+"%",stopColor:r(o[0]+t*(o[1]-o[0]))},e))}return Pt("g",{"aria-label":i||"Gradient legend",children:[Nt("defs",{children:Nt("linearGradient",{id:a,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:c})}),i&&Nt("text",{x:s+t/2,y:-4,textAnchor:"middle",fontSize:11,fill:"var(--semiotic-text, #333)",children:i}),Nt("rect",{x:s,y:0,width:t,height:e,fill:`url(#${a})`,rx:2}),Nt("text",{x:s,y:e+12,textAnchor:"start",fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:l(o[0])}),Nt("text",{x:s+t,y:e+12,textAnchor:"end",fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:l(o[1])})]})}const c=[];for(let e=0;64>=e;e++){const t=e/64;c.push(Nt("stop",{offset:100*t+"%",stopColor:r(o[1]-t*(o[1]-o[0]))},e))}return Pt("g",{"aria-label":i||"Gradient legend",children:[i&&Nt("text",{x:7,y:-6,textAnchor:"middle",fontSize:11,fill:"var(--semiotic-text, #333)",children:i}),Nt("defs",{children:Nt("linearGradient",{id:a,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:c})}),Nt("rect",{x:0,y:0,width:14,height:100,fill:`url(#${a})`,rx:2}),Nt("text",{x:19,y:10,fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:l(o[1])}),Nt("text",{x:19,y:100,fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:l(o[0])})]})}function Gt(e){const{legendGroups:t,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:o,isolatedCategories:i,legendInteraction:s,title:l="Legend",width:a=100,height:c=20,orientation:d="vertical",legendLayout:u}=e,h=It(u),[f,y]=Wt.useState(0),[p,m]=Wt.useState(0),g=Wt.useCallback((e,t)=>{y(e),m(t)},[]),x="vertical"===d?(({legendGroups:e,width:t,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:o,isolatedCategories:i,focusedGroupIndex:s,focusedItemIndex:l,onFocusedIndexChange:a,legendInteraction:c,metrics:d})=>{const u=[],h=Ct(e.map(e=>({hasLabel:!!e.label,itemCount:e.items.length})),d.rowHeight);return e.forEach((e,f)=>{const y=h[f];u.push(Nt("line",{stroke:"gray",x1:0,y1:y.lineY,x2:t,y2:y.lineY},"legend-top-line legend-symbol-"+f)),e.label&&null!=y.labelY&&u.push(Nt("text",{y:y.labelY,className:"legend-group-label",style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:e.label},"legend-text-"+f)),u.push(Nt("g",{className:"legend-item",transform:`translate(0,${y.itemsY})`,children:zt(e,n,r,o,i,s,l,f,a,c,d)},"legend-group-"+f))}),u})({legendGroups:t||[],width:a,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:o,isolatedCategories:i,focusedGroupIndex:f,focusedItemIndex:p,onFocusedIndexChange:g,legendInteraction:s,metrics:h}):(({legendGroups:e,height:t,width:n,customClickBehavior:r,customHoverBehavior:o,highlightedCategory:i,isolatedCategories:s,focusedGroupIndex:l,focusedItemIndex:a,onFocusedIndexChange:c,legendInteraction:d,metrics:u})=>{let h=0;const f=[];e.forEach((e,t)=>{let y=0;e.label&&(y+=16);const p=((e,t,n,r,o,i,s,l,a,c,d,u)=>{const{type:h="fill",styleFn:f,items:y}=e,p=[],{swatchSize:m,labelGap:g,itemGap:x,rowHeight:b,align:k}=d,$=!(!t&&!n),v="isolate"===c||void 0===c&&null!=o,w=y.map(e=>m+g+7*e.label.length),M=[];let A=0,S=0;w.forEach((e,t)=>{const n=0===S?e:S+x+e;u&&u>0&&S>0&&n>u?(M.push({start:A,end:t,width:S}),A=t,S=e):S=n}),y.length>0&&M.push({start:A,end:y.length,width:S}),M.forEach((e,c)=>{let d="center"===k?Math.max(0,((u??e.width)-e.width)/2):"end"===k?Math.max(0,(u??e.width)-e.width):0;for(let u=e.start;e.end>u;u++){const e=y[u],k=jt(e,u,h,f,m),M=Rt(e,r,o),A=o&&o.size>0&&o.has(e.label);p.push(Pt("g",{transform:`translate(${d},${c*b})`,onClick:t?()=>t(e):void 0,onMouseEnter:n?()=>n(e):void 0,onMouseLeave:n?()=>n(null):void 0,tabIndex:$?l===i&&u===s?0:-1:void 0,role:$?"option":void 0,"aria-selected":$&&v?A||!1:void 0,"aria-current":$&&!v&&null!=r&&e.label===r||void 0,"aria-label":e.label,onKeyDown:$?n=>{if("Enter"!==n.key&&" "!==n.key||(n.preventDefault(),t&&t(e)),"ArrowRight"===n.key||"ArrowLeft"===n.key){n.preventDefault();const e=(u+("ArrowRight"===n.key?1:-1)+y.length)%y.length;a(l,e);const t=n.currentTarget.parentElement?.children[e];t instanceof SVGElement&&t.focus()}}:void 0,onFocus:$?t=>{a(l,u),n&&n(e);const r=t.currentTarget.querySelector(".semiotic-legend-focus-ring");r&&r.setAttribute("visibility","visible")}:void 0,onBlur:$?e=>{n&&n(null);const t=e.currentTarget.querySelector(".semiotic-legend-focus-ring");t&&t.setAttribute("visibility","hidden")}:void 0,style:{cursor:$?"pointer":"default",opacity:M,transition:"opacity 150ms ease",pointerEvents:"all",outline:"none"},children:[$&&Nt("rect",{className:"semiotic-legend-focus-ring",x:-2,y:-2,width:m+g+2+7*e.label.length,height:m+4,fill:"none",stroke:"var(--semiotic-focus, #005fcc)",strokeWidth:2,rx:3,visibility:"hidden"}),k,A&&Nt(Ft,{swatchSize:m}),Nt("text",{y:m/2,x:m+g,dominantBaseline:"central",style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:e.label})]},"legend-item-"+u)),d+=w[u]+x}});const W=Math.max(0,...M.map(e=>e.width)),L=M.length;return{items:p,offset:W,totalRows:L,totalHeight:L*b}})(e,r,o,i,s,l,a,t,c,d,u,u.maxWidth??n);y+=p.offset+5,f.push({label:e.label,...p,offset:y,totalRows:p.totalRows,totalHeight:p.totalHeight}),h+=y+12});const y=u.maxWidth??n;let p=h>y?0:"center"===u.align?Math.max(0,(y-h)/2):"end"===u.align?Math.max(0,y-h):0;const m=[];return f.forEach((n,r)=>{const o=e[r];o.label&&(m.push(Nt("text",{transform:`translate(${p},0) rotate(90)`,textAnchor:"start",className:"legend-group-label",style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:o.label},"legend-text-"+r)),p+=16),m.push(Nt("g",{className:"legend-item",transform:`translate(${p},0)`,children:n.items},"legend-group-"+r)),p+=n.offset+5,e[r+1]&&m.push(Nt("line",{stroke:"gray",x1:p,y1:-8,x2:p,y2:(n.totalHeight||t)+0+8},"legend-top-line legend-symbol-"+r)),p+=12}),Nt("g",{children:m})})({legendGroups:t||[],title:l,height:c,width:a,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:o,isolatedCategories:i,focusedGroupIndex:f,focusedItemIndex:p,onFocusedIndexChange:g,legendInteraction:s,metrics:h}),b=!(!n&&!r);return Pt("g",{role:b?"listbox":void 0,"aria-multiselectable":!(!b||"isolate"!==s&&(void 0!==s||null==i))||void 0,"aria-label":"Chart legend",style:{fontFamily:"var(--semiotic-font-family, sans-serif)"},children:[void 0!==l&&""!==l&&"vertical"===d&&Nt("text",{className:"legend-title",y:16,x:a/2,textAnchor:"middle",style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:l}),x]})}import{useRef as Bt,useState as Dt,useEffect as Et}from"react";function Ht(e,t,n){const r=Bt(null),[o,i]=Dt(null);return Et(()=>{if(!t&&!n)return;const e=r.current;if(!e)return;const o=new ResizeObserver(e=>{for(const t of e){const{width:e,height:n}=t.contentRect;i(t=>t&&t.w===e&&t.h===n?t:{w:e,h:n})}});return o.observe(e),()=>o.disconnect()},[t,n]),[r,[t&&o?o.w:e[0],n&&o?o.h:e[1]]]}import{jsx as qt,jsxs as _t}from"react/jsx-runtime";var Yt=xt(!1);xt(!1);var Vt=xt(null),Zt="undefined"==typeof window?kt:vt;function Ut(...e){let t;for(const n of e)n&&(t=Xt(t)&&Xt(n)?{legendGroups:[...t.legendGroups,...n.legendGroups]}:n);return t}function Xt(e){return"object"==typeof e&&null!==e&&"legendGroups"in e&&Array.isArray(e.legendGroups)}function Kt(e){return"object"==typeof e&&null!==e&&"gradient"in e}function Qt(e,t,n){const r=e.xValue??t?.[n];if(null==r)return null;const o=Number(r);return Number.isFinite(o)?o:null}function Jt(e){let t=e.data||e.datum||e;return Array.isArray(t)&&(t=t[0]),null!=e.xValue&&t&&"object"==typeof t&&!Array.isArray(t)&&null==t.xValue?{...t,xValue:e.xValue}:t||{}}var en=[];function tn(e,t,n,r,o){if(e)return e;if(n&&"object"==typeof n&&!Array.isArray(n)){const e=pt(n,r);if(e)return e}let i;if(Array.isArray(n))i=n;else if(t&&t.length>0)i=t;else if("string"==typeof n){const e=at[n];Array.isArray(e)&&(i=e)}return i&&0!==i.length?null!=r?(o.has(r)||o.set(r,o.size),i[o.get(r)%i.length]):i[0]:dt}function nn({selection:e,linkedHover:t,fallbackFields:n=en,unwrapData:r=!1,onObservation:i,chartType:s,chartId:l,onClick:a,hoverHighlight:c,colorByField:d,mobileInteraction:u}){const h=ot(),f=tt(()=>function(e,t){return e?!0===e?{name:"hover",fields:t||[]}:"string"==typeof e?{name:e,fields:t||[]}:{name:e.name||"hover",fields:e.fields||t||[],mode:e.mode,xField:e.xField,seriesField:e.seriesField}:null}(t,n),[t,n]),y=tt(()=>"series"===f?.mode?[f.seriesField||d||n[0]].filter(e=>!!e):f?.fields||n,[f,d,n]),p=qe({name:e?.name||"__unused__",fields:y}),m=function(e){const t=e.name||"hover",{fields:n}=e,{predicate:r,isActive:o,selectPoints:i,clear:s}=qe({name:t,fields:n});return{onHover:Se(e=>{if(!e)return void s();const t={};for(const r of n){const n=e[r];void 0!==n&&(t[r]=[n])}Ve(t)&&i(t)},[n,i,s]),predicate:r,isActive:o}}({name:f?.name||"hover",fields:y}),g=o(e=>e.pushObservation),x=nt(e=>{i?.(e),g?.(e)},[i,g]),b=e?{isActive:p.isActive,predicate:p.predicate}:null,[k,$]=rt(null),v=st(!1),w=d||n[0],M=tt(()=>{if(!c||null==k||!w)return null;const e=k,t=w;return{isActive:!0,predicate:n=>("string"==typeof n[t]?n[t]:(n[t]??"")+"")===e}},[c,k,w]),A=nt((e,n)=>{const r=!e&&v.current&&!!u?.enabled&&u.tapToLockTooltip;if(t)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"x-position"===f?.mode&&f.xField){const n=Qt(e,t,f.xField);null!=n&&function(e,t,n){const r=Oe.positions.get(e);r?.locked||r&&r.xValue===t&&r.sourceId===n||(Oe={positions:new Map(Oe.positions).set(e,{xValue:t,sourceId:n})},Fe())}(f.name||"hover",n,h)}"x-position"!==f?.mode&&m.onHover(t)}else"x-position"!==f?.mode||r||Re(f.name||"hover",h),"x-position"===f?.mode||r||m.onHover(null);if(c&&w)if(e){let t=e.data||e.datum||e;Array.isArray(t)&&(t=t[0]);const n=t?.[w];$(null!=n?n+"":null)}else r||$(null);(i||g)&&ve({onObservation:x,datum:e?Jt(e):null,x:e?.x,y:e?.y,chartType:s||"unknown",chartId:l,context:n})},[t,m,f,h,i,s,l,g,x,c,w,u]),S=nt((n=!0)=>{v.current=!1,t&&"x-position"!==f?.mode&&m.onHover(null),e&&u?.tapToSelect&&p.clear(),n&&c&&$(null),"x-position"===f?.mode&&(ze(f.name||"hover",h),Re(f.name||"hover",h))},[t,f,m,e,u,p,c,h]),W=nt((n,r)=>{const o=!!u?.enabled&&(u.tapToLockTooltip||u.tapToSelect),d=!!u?.enabled&&"backgroundTap"===u.clearSelection;if("x-position"===f?.mode&&f.xField&&n){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]);const t=Qt(n,e,f.xField);null!=t&&function(e,t,n){const r=Oe.positions.get(e);if(r?.locked){const t=new Map(Oe.positions);return t.delete(e),Oe={positions:t},Fe(),!1}Oe={positions:new Map(Oe.positions).set(e,{xValue:t,sourceId:n,locked:!0})},Fe()}(f.name||"hover",t,h)}if(o)if(n){v.current=!0;const r=Jt(n);if(t&&"x-position"!==f?.mode&&m.onHover(r),e&&u?.tapToSelect&&y.length>0){const e={};for(const t of y){const n=r[t];void 0!==n&&(e[t]=[n])}(function(e){if(!e)return!1;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1})(e)&&p.selectPoints(e)}if(c&&w){const e=r?.[w];$(null!=e?e+"":null)}}else d&&S();if(n||d){if(n&&a){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]),a(e,{x:n.x??0,y:n.y??0})}(i||g)&&we({onObservation:x,datum:n?Jt(n):null,x:n?.x,y:n?.y,chartType:s||"unknown",chartId:l,context:r})}},[a,i,g,x,s,l,f,h,u,t,m,e,p,y,c,w,S]);return it(()=>{if(!u?.enabled||"undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&v.current&&S()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[u?.enabled,S]),it(()=>()=>{v.current&&S(!1)},[S]),it(()=>{if("x-position"!==f?.mode)return;const e=f.name||"hover";return()=>{ze(e,h),Re(e,h)}},[f?.mode,f?.name,h]),{activeSelectionHook:b,hoverSelectionHook:M,customHoverBehavior:A,customClickBehavior:W,crosshairSourceId:h}}function rn({data:e,colorBy:t,colorScale:n,showLegend:r,legendPosition:o="right",userMargin:i,defaults:s={top:50,bottom:60,left:70,right:40},categories:l,additionalLegend:a}){const c=bt(Yt),d=null!==bt(Vt),u=void 0!==r?r:!c&&!!t,h=!!t&&(u||d),f=tt(()=>{if(!h)return[];if(void 0!==l)return l;const n=new Set;for(const r of e){const e="function"==typeof t?t(r):r[t];null!=e&&n.add(e+"")}return Array.from(n)},[l,t,e,h]);!function(e){const t=bt(Vt),n=$t(),r=function(e){const t=new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}(e),o=Mt([]);(function(e,t){if(e.length!==t.length)return!1;for(let n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0})(o.current,r)||(o.current=r);const i=o.current;Zt(()=>{if(t)return()=>t.unregisterCategories(n)},[t,n]),Zt(()=>{t&&t.registerCategories(n,i)},[t,n,i])}(d&&t?f:[]);const y=tt(()=>{if(!u||!t)return;const r=function({data:e,colorBy:t,colorScale:n,getColor:r,strokeColor:o,strokeWidth:i,categories:s}){return{legendGroups:[{styleFn:e=>{const t=e.color||"#333",n={fill:t,stroke:t};return void 0!==o&&(n.stroke=o),void 0!==i&&(n.strokeWidth=i),n},type:"fill",items:(s&&s.length>0?s:Array.from(new Set(e.map(e=>"function"==typeof t?t(e):e[t])))).map((o,i)=>{const s=e.find("function"==typeof t?e=>t(e)===o:e=>e[t]===o),l=s?r(s,t,n):n?n(o):ht[i%ht.length];return{label:o+"",color:l}}),label:""}]}}({data:e,colorBy:t,colorScale:n,getColor:yt,categories:f});return 0!==r.legendGroups.reduce((e,t)=>e+t.items.length,0)?r:void 0},[u,t,e,n,f]),p=tt(()=>Ut(y,a),[y,a]),m=tt(()=>{const e="number"==typeof i?{top:i,bottom:i,left:i,right:i}:i??{},t=t=>{const n=e[t];return"number"==typeof n?n:s[t]},n={top:t("top"),right:t("right"),bottom:t("bottom"),left:t("left")},r=t=>"number"==typeof e[t];return p&&("right"===o&&!r("right")&&110>n.right?n.right=110:"left"===o&&!r("left")&&110>n.left?n.left=110:"top"===o&&!r("top")&&50>n.top?n.top=50:"bottom"===o&&!r("bottom")&&80>n.bottom&&(n.bottom=80)),n},[s,i,p,o]);return{legend:p,margin:m,legendPosition:o}}function on(e,t,n){return Je(e,t,n)}function sn(e,t="ease-out-cubic"){return"linear"===t?e:1-Math.pow(1-e,3)}function ln(e,t){return Math.min((e-t.startTime)/t.duration,1)}function an(e,t,n){return e+(t-e)*n}function cn(){return"undefined"!=typeof performance?performance.now():Date.now()}function dn(e,t){if(!1===e)return{transition:void 0,introEnabled:!1};const n="undefined"!=typeof window&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;return{transition:e?!0===e?{duration:300}:{duration:e.duration??300,easing:"linear"===e.easing?"linear":"ease-out"}:t,introEnabled:!(n||!e||!0!==e&&!1===e.intro)}}import{jsx as un}from"react/jsx-runtime";var hn={secondary:0,primary:3},fn=".annotation-deferred{opacity:0;pointer-events:none;transition:opacity .12s ease}.stream-xy-frame:hover .annotation-deferred,.stream-ordinal-frame:hover .annotation-deferred,.stream-network-frame:hover .annotation-deferred,.stream-geo-frame:hover .annotation-deferred,.stream-xy-frame:focus-within .annotation-deferred,.stream-ordinal-frame:focus-within .annotation-deferred,.stream-network-frame:focus-within .annotation-deferred,.stream-geo-frame:focus-within .annotation-deferred{opacity:1;pointer-events:auto}@media (prefers-reduced-motion:reduce){.annotation-deferred{transition:none}}";function yn(e){return!0===e?._annotationDeferred}function pn(e){return"blended"===e?.cohesion||"layer"===e?.cohesion?e.cohesion:null}function mn(e){const t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}function gn(e){return Math.max(.72,.95-.06*e)}function xn(e){const t=e.map((e,t)=>{return{p:e,i:t,emphasis:(n=e.annotation,"primary"===n?.emphasis||"secondary"===n?.emphasis?n.emphasis:null),confidence:mn(e.annotation),readingOrder:null,rank:1};var n}),n=t.some(e=>null!=e.emphasis||null!=e.confidence),r=e.some(e=>yn(e.annotation)),o=e.some(e=>null!=pn(e.annotation)),i=e.some(e=>"layer"===pn(e.annotation));if(!n&&!r&&!o)return e.map(e=>e.node);const s=t.filter(e=>null==e.emphasis&&null!=e.confidence).slice().sort((e,t)=>(t.confidence??0)-(e.confidence??0)||e.i-t.i);s.forEach((e,t)=>{e.readingOrder=t,e.rank=2-t/Math.max(1,s.length)});for(const e of t)e.emphasis&&(e.rank=hn[e.emphasis]);const l=t.sort((e,t)=>e.rank-t.rank||e.i-t.i).map(e=>{const{p:t,i:n,emphasis:r,readingOrder:o}=e,i=yn(t.annotation);let s=t.node;if("primary"===r||"secondary"===r||null!=o){const e=null==r&&null!=o;s=un("g",{className:e?"annotation-emphasis annotation-emphasis--inferred":"annotation-emphasis annotation-emphasis--"+r,..."secondary"===r?{opacity:.6,fontSize:"0.88em"}:{},...e?{opacity:gn(o),"data-annotation-reading-order":o}:{},children:t.node},"annotation-emphasis-"+n)}const l=pn(t.annotation);return l&&(s=un("g",{className:"annotation-cohesion--"+l,children:s},"annotation-cohesion-"+n)),i&&(s=un("g",{className:"annotation-deferred","data-annotation-disclosure":"deferred",children:s},"annotation-deferred-"+n)),s});return r&&l.unshift(un("style",{children:fn},"annotation-disclosure-style")),i&&l.unshift(un("style",{children:".annotation-cohesion--layer text,.annotation-cohesion--layer tspan{fill:var(--semiotic-annotation-color,var(--semiotic-text-secondary,#666));font-style:italic}"},"annotation-cohesion-style")),l}function bn(e,t,n){return ut(e,t,n)}function kn(e,t){const n=t&&"object"==typeof t&&!Array.isArray(t)?t:void 0;return 0===e.length?e=>n&&pt(n,e)||"#4e79a7":t=>{if(n){const e=pt(n,t);if(e)return e}let r=0;for(let e=0;t.length>e;e++)r=31*r+t.charCodeAt(e)|0;return e[Math.abs(r)%e.length]??"#4e79a7"}}import{jsx as $n,jsxs as vn}from"react/jsx-runtime";function wn(e,t=120,n=8){if(!e)return[];const r=Math.max(1,Math.floor(t/n)),o=e.split(/\s+/),i=[];let s="";for(const e of o)s&&s.length+1+e.length>r?(i.push(s),s=e):s=s?`${s} ${e}`:e;return s&&i.push(s),i}function Mn(e,t,n,r){return"curly"===e?r?`M0,0 C${.6*n},0 ${.4*n},${t/2} ${n},${t/2} C${.4*n},${t/2} ${.6*n},${t} 0,${t}`:`M0,0 C0,${.6*n} ${t/2},${.4*n} ${t/2},${n} C${t/2},${.4*n} ${t},${.6*n} ${t},0`:r?`M0,0 L${n},0 L${n},${t} L0,${t}`:`M0,0 L0,${n} L${t},${n} L${t},0`}function An(e,t,n,r){if(!e)return $n("g",{className:"annotation-note"});const{label:o,title:i,orientation:s,align:l,wrap:a=120,noWrap:c}=e;if(!o&&!i)return $n("g",{className:"annotation-note"});let d=s;d||(d=Math.abs(t)>Math.abs(n)?"leftRight":"topBottom");let u=l;u&&"dynamic"!==u||(u="topBottom"===d?0>t?"right":"left":0>n?"bottom":"top");let h="start";"topBottom"===d?"right"===u?h="end":"middle"===u&&(h="middle"):h=0>t?"end":"start";const f=16,y=i?c?[i]:wn(i,a):[],p=o?c?[o]:wn(o,a):[],m="leftRight"===d?"end"===h?-4:4:0;let g=0;const x=[],b=r||"var(--semiotic-annotation-color, var(--semiotic-text, #333))";e.useHTML||e.html?x.push($n("foreignObject",{className:"annotation-note-html",x:"end"===h?m-a:"middle"===h?m-a/2:m,y:-16,width:a,height:Math.max(f,(y.length+p.length)*f+(i&&o?2:0))+f,style:{overflow:"visible"},children:vn("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{color:b,fontSize:"12px",lineHeight:"16px",overflow:"visible",textAlign:"end"===h?"right":"middle"===h?"center":"left",whiteSpace:c?"nowrap":"normal",wordBreak:"break-word"},children:[i&&$n("div",{className:"annotation-note-title",style:{fontWeight:"bold"},children:i}),o&&$n("div",{className:"annotation-note-label",children:o})]})},"annotation-note-html")):(y.length>0&&(x.push($n("text",{className:"annotation-note-title",fill:b,textAnchor:h,fontWeight:"bold",children:y.map((e,t)=>$n("tspan",{x:m,dy:0===t?0:f,children:e},t))},"annotation-note-title")),g=y.length*f),p.length>0&&x.push($n("text",{className:"annotation-note-label",fill:b,textAnchor:h,y:g,children:p.map((e,t)=>$n("tspan",{x:m,dy:0===t?0:f,children:e},t))},"annotation-note-label")));let k=null;if((i||o)&&(0!==t||0!==n))if("topBottom"===d){const e=Math.min(a,120);let t=0,n=e;"end"===h?(t=-e,n=0):"middle"===h&&(t=-e/2,n=e/2),k=$n("line",{className:"note-line",x1:t,x2:n,y1:0,y2:0,stroke:r||"var(--semiotic-text-secondary, currentColor)"})}else{const e=(y.length+p.length)*f+(p.length>0?f:0);let t=0,n=e;"bottom"===u?(t=-e,n=0):"middle"===u&&(t=-e/2,n=e/2),k=$n("line",{className:"note-line",x1:0,x2:0,y1:t,y2:n,stroke:r||"var(--semiotic-text-secondary, currentColor)"})}const $=Math.max(0,y.length+p.length-1)*f;let v=0;return"topBottom"===d?v=0>n?-($+2):18:"leftRight"===d&&(v="middle"===u?-($+f+(p.length>0&&y.length>0?2:0))/2+8:"bottom"===u||0>n?-($+2):18),vn("g",{className:"annotation-note",transform:`translate(${t},${n})`,children:[$n("g",{className:"annotation-note-content",transform:0!==v?`translate(0,${v})`:void 0,children:x}),k]})}function Sn(e,t,n,r,o){const i=[];switch(e){case"callout-circle":{const e=(t?.radius||0)+(t?.radiusPadding||0);e>0&&i.push($n("circle",{r:e,fill:"none",stroke:n||"var(--semiotic-text-secondary, currentColor)"},"subject-circle"));break}case"callout-rect":{const e=t?.width||0,r=t?.height||0;(e>0||r>0)&&i.push($n("rect",{width:e,height:r,fill:"none",stroke:n||"var(--semiotic-text-secondary, currentColor)"},"subject-rect"));break}case"callout-custom":t?.custom&&i.push(...Array.isArray(t.custom)?t.custom:[t.custom]);break;case"xy-threshold":{const e=r||0,s=o||0;if(void 0!==t?.x){const r=(t.x||0)-e;i.push($n("line",{x1:r,y1:(t.y1||0)-s,x2:r,y2:(t.y2||0)-s,stroke:n||"var(--semiotic-text-secondary, currentColor)",strokeDasharray:"5,5"},"threshold-line"))}else if(void 0!==t?.y){const r=(t.y||0)-s;i.push($n("line",{x1:(t.x1||0)-e,y1:r,x2:(t.x2||0)-e,y2:r,stroke:n||"var(--semiotic-text-secondary, currentColor)",strokeDasharray:"5,5"},"threshold-line"))}else void 0!==t?.x1||void 0!==t?.x2?i.push($n("line",{x1:(t.x1||0)-e,y1:0,x2:(t.x2||0)-e,y2:0,stroke:n||"var(--semiotic-text-secondary, currentColor)",strokeDasharray:"5,5"},"threshold-line")):void 0===t?.y1&&void 0===t?.y2||i.push($n("line",{x1:0,y1:(t.y1||0)-s,x2:0,y2:(t.y2||0)-s,stroke:n||"var(--semiotic-text-secondary, currentColor)",strokeDasharray:"5,5"},"threshold-line"));break}case"bracket":{const e=t?.type||"curly",r=t?.width??t?.height;void 0!==r&&i.push($n("path",{d:Mn(e,r,t?.depth||30,void 0===t?.width),fill:"none",stroke:n||"var(--semiotic-text-secondary, currentColor)"},"bracket-path"));break}}return $n("g",{className:"annotation-subject",children:i})}function Wn(e,t,n,r,o,i){const s=[];let l=0,a=0;if("callout-circle"!==o&&"label"!==o||!i?.radius){if("callout-rect"===o&&i){const n=i.width||0,r=i.height||0;if(n>0||r>0){const o=n/2,i=r/2,s=e-o,c=t-i;if(0!==s||0!==c){const e=Math.abs(s),t=Math.abs(c),d=n/2,u=r/2,h=e*u>t*d?d/e:u/t;l=o+s*h,a=i+c*h}}}else if("bracket"===o&&i){const e=i.width,t=i.height,n=i.depth||30;void 0!==e?(l=e/2,a=n):void 0!==t&&(l=n,a=t/2)}}else{const n=(i.radius||0)+(i.radiusPadding||0);if(n>0&&(0!==e||0!==t)){const r=Math.atan2(t,e);l=Math.cos(r)*n,a=Math.sin(r)*n}}const c=Math.sqrt((e-l)**2+(t-a)**2);if(c>.5){const o=r||"var(--semiotic-text-secondary, currentColor)",i="curve"===n?.type;let d=Math.atan2(t-a,e-l);if(i){const r=(l+e)/2,i=(a+t)/2,u=-(t-a)/c,h=(e-l)/c,f=(n?.curve??.25)*c,y=r+u*f,p=i+h*f;s.push($n("path",{className:"connector-curve",d:`M${l},${a}Q${y},${p} ${e},${t}`,fill:"none",stroke:o},"connector-line")),d=Math.atan2(p-a,y-l)}else s.push($n("line",{x1:l,y1:a,x2:e,y2:t,stroke:o},"connector-line"));if("arrow"===n?.end){const e=10,t=16/180*Math.PI;s.push($n("path",{d:`M${l},${a}L${l+e*Math.cos(d+t)},${a+e*Math.sin(d+t)}L${l+e*Math.cos(d-t)},${a+e*Math.sin(d-t)}Z`,fill:o,stroke:"none"},"connector-arrow"))}}return $n("g",{className:"annotation-connector",children:s})}function Ln(e){const{x:t=0,y:n=0,dx:r,dy:o,nx:i,ny:s,note:l,connector:a,subject:c,type:d,color:u,className:h,disable:f,opacity:y,strokeDasharray:p,events:m={},"data-testid":g}=e,x=Array.isArray(t)?t[0]??0:t,b=Array.isArray(n)?n[0]??0:n,k=new Set(Array.isArray(f)?f:[]);let $=r||0,v=o||0;null!=i&&($=i-x),null!=s&&(v=s-b);const w="string"==typeof d?d:"label";if("bracket"===w&&c&&0===$&&0===v)if(void 0!==c.width){$=c.width/2;const e=c.depth||30;v=e+(0>e?-5:5)}else if(void 0!==c.height){const e=c.depth||30;$=e+(0>e?-5:5),v=c.height/2}return vn("g",{className:("annotation "+(h||"")).trim(),transform:`translate(${x},${b})`,"data-testid":g,...null!=y&&{opacity:y},...p&&{strokeDasharray:p},...m,children:[!k.has("connector")&&Wn($,v,a,u,w,c),!k.has("subject")&&Sn(w,c,u,x,b),!k.has("note")&&An(l,$,v,u)]})}function In(e){const{noteData:t}=e,{screenCoordinates:n}=t,r="string"==typeof t.type?t.type:"label",o=t.eventListeners||t.events||{};if(t.coordinates&&n){const e=t.nx||n[0][0]+(t.dx??0),o=t.ny||n[0][1]+(t.dy??0),i=n.map((n,i)=>{const s=Object.assign({},t,{note:0===i?t.note:{label:""},x:n[0],y:n[1],nx:e,ny:o});return $n(Ln,{"data-testid":"semiotic-annotation",...s,type:r},"multi-annotation-"+i)});return $n("g",{children:i})}const i=t.note||{title:"none",label:t.label},s=`${i.label}-${i.title}-${t.i}`;return $n(Ln,{"data-testid":"semiotic-annotation",events:o,...t,type:r},s)}import{jsx as Cn,jsxs as Nn}from"react/jsx-runtime";var Pn="var(--semiotic-bg, #ffffff)";function On(e){const{x:t,y:n,text:r,fill:o,fontSize:i=12,fontWeight:s,fontFamily:l,textAnchor:a="start",dominantBaseline:c,background:d,className:u}=e,h=function(e){return void 0===e||!0===e||"halo"===e?{type:"halo"}:!1===e||"none"===e?null:"box"===e?{type:"box"}:{type:e.type??"halo",...e}}(d),f=e=>Cn("text",{x:t,y:n,textAnchor:a,dominantBaseline:c,fill:o,fontSize:i,fontWeight:s,fontFamily:l,className:u,...e?{stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:"stroke"}:{},children:r});if(!h)return f();if("halo"===h.type)return f({stroke:h.fill??Pn,strokeWidth:h.haloWidth??3});const y=h.padding??{x:6,y:3},p="number"==typeof y?y:y.x,m="number"==typeof y?y:y.y,g=function(e,t){return(e+"").length*t*.6}(r,i),x=i+2*m;let b,k;return b="middle"===a?t-g/2-p:"end"===a?t-g-p:t-p,k="middle"===c||"central"===c?n-x/2:"hanging"===c||"text-before-edge"===c?n-m:n-.8*i-m,Nn("g",{className:u,children:[Cn("rect",{x:b,y:k,width:g+2*p,height:x,rx:h.radius??3,ry:h.radius??3,fill:h.fill??Pn,fillOpacity:h.opacity??.85,stroke:h.stroke,strokeWidth:h.strokeWidth}),f()]})}export{m as filterSparseArray,x as parseDateLikeString,b as coerceDateLikeValue,k as coerceTemporalStringRows,ct as DEFAULT_COLORS,dt as DEFAULT_COLOR,ut as resolveCategoricalPalette,ht as STREAMING_PALETTE,yt as getColor,pt as resolveExplicitColor,mt as createColorScale,gt as getSize,sn as computeEasing,ln as computeRawProgress,an as lerp,cn as now,dn as resolveAnimateConfig,T as resolveCurveFactory,G as resolveCanvasFill,B as coerceCanvasFill,D as buildLinearFillGradient,E as buildColorStopGradient,Lt as DEFAULT_LEGEND_ROW_HEIGHT,It as resolveLegendMetrics,Ct as layoutVerticalLegendGroups,Tt as GradientLegend,Gt as Legend,Ut as composeLegendConfigs,Xt as isLegendConfig,Kt as isGradientLegendConfig,In as SemioticAnnotation,fn as ANNOTATION_DISCLOSURE_REVEAL_CSS,xn as applyAnnotationEmphasis,On as AnnotationLabel,ze as unlockCrosshair,He as useCrosshairPosition,$ as TITLE_BASELINE,v as hasTextTitle,w as reserveFrameChromeMargin,M as reserveTitleMargin,H as hasAnyCornerRadius,q as clampCornerRadii,re as networkSceneNodeToSVG,oe as networkSceneEdgeToSVG,ie as networkLabelToSVG,ce as geoSceneNodeToSVG,pe as xySceneNodeToSVG,xe as ordinalSceneNodeToSVG,be as isServerEnvironment,Ht as useResponsiveSize,ke as observationInputType,$e as isInteractiveKeyboardTarget,ve as emitHoverObservations,we as emitClickObservations,bn as resolveCustomLayoutPalette,kn as buildResolveColor,Ye as useBrushSelection,Ze as normalizeLinkedBrush,Qe as isChartMode,Je as resolveChartMode,tn as resolveDefaultFill,nn as useChartSelection,rn as useChartLegendAndMargin,on as useChartMode};
@@ -1 +0,0 @@
1
- import{annotationActivationProps as e,defaultTooltipStyle as t,extractAllRows as n}from"./chunk-chunk-255KDHW5.module.min.js";import{AnnotationLabel as r,GradientLegend as o,Legend as i,SemioticAnnotation as a,applyAnnotationEmphasis as l,isGradientLegendConfig as s,isLegendConfig as c,reserveFrameChromeMargin as u,resolveAnimateConfig as d,useResponsiveSize as h}from"./chunk-chunk-F25UA5HT.module.min.js";import{useReducedMotion as f}from"./chunk-chunk-XEVJDUTH.module.min.js";import{resolveSvgFill as m}from"./chunk-chunk-2WVCH4PL.module.min.js";import{FrameRuntime as p,isInBounds as y,resolveAnchoredPosition as g,resolveX as b,resolveY as x}from"./chunk-chunk-5RKXZQ2P.module.min.js";import{getMinMax as v}from"./chunk-chunk-JJ2OOIET.module.min.js";import{clearCSSColorCache as w}from"./chunk-chunk-QRIBHZYW.module.min.js";import{useThemeSelector as k}from"./chunk-chunk-DSNGDNJY.module.min.js";import{memo as M,useEffect as j,useRef as R}from"react";var S={sceneGeometry:0,layout:0,domain:0};function $(e){const{domain:t,layout:n,sceneGeometry:r}=e.revisions;return{domain:t,layout:n,sceneGeometry:r}}function D(e,t){return{sceneGeometry:Math.max(e.sceneGeometry,t.sceneGeometry),layout:Math.max(e.layout,t.layout),domain:Math.max(e.domain,t.domain)}}var C="production"!==process.env.NODE_ENV,z={revisions:S,signature:"",sawSignals:!1,wasUnconsumed:!1,warnUnconsumed:!1},A=class{constructor(e="scene host"){this.hostName=e,this.lastConsumed=S,this.lastObserved=S,this.lastDuplicateWarning="",this.lastUnconsumedWarning=""}observeUpdateResult(e){C&&(this.lastObserved=D(this.lastObserved,$(e)))}beforeCompute(e,t){if(!C)return z;const n=D($(e),this.lastObserved),r=function(e){return`${e.sceneGeometry}|${e.layout}|${e.domain}`}(n),o=!((i=n).sceneGeometry===(a=this.lastConsumed).sceneGeometry&&i.layout===a.layout&&i.domain===a.domain);var i,a;return{revisions:n,signature:r,sawSignals:e.changed.has("scene-geometry")||e.changed.has("layout")||e.changed.has("domain"),wasUnconsumed:o,warnUnconsumed:!t&&o&&this.lastUnconsumedWarning!==r}}afterCompute(e,t,n){if(C){if(t&&e.wasUnconsumed&&(this.lastConsumed=e.revisions),e.warnUnconsumed&&!t)return console.warn(`[semiotic] ${this.hostName} observed scene-affecting revisions without a scene rebuild: ${e.signature}.`),void(this.lastUnconsumedWarning=e.signature);t&&e.sawSignals&&!e.wasUnconsumed&&!n&&this.lastDuplicateWarning!==e.signature?(console.warn(`[semiotic] ${this.hostName} performed scene rebuild with unchanged scene revisions: ${e.signature}.`),this.lastDuplicateWarning=e.signature):t&&!e.sawSignals&&(this.lastDuplicateWarning="")}}};function N(e){return R(new A(e))}function W(e,t,n,r=!1,o=!1){const i=e.beforeCompute(t.getLastUpdateResult(),r);n(),e.afterCompute(i,!0,o)}var F=M(function({store:e,diagnostics:t}){return j(()=>{const n=()=>t.observeUpdateResult(e.getUpdateSnapshot());return n(),e.subscribeUpdateResult(n)},[t,e]),null});import{useEffect as O,useLayoutEffect as I,useRef as B,useState as E,useSyncExternalStore as T}from"react";var H="undefined"!=typeof window?I:O;function U(){const[e,t]=E(!1);return H(()=>{t(!0)},[]),e}var P=()=>()=>{},L=()=>!1,q=()=>!0;function G(){const e=T(P,L,q);return B(e).current}import{jsx as V}from"react/jsx-runtime";var X={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0};function Y({hoverPoint:e}){let t="";if(e){const n=e.data||e;t="object"==typeof n?"Data point: "+Object.entries(n).filter(([,e])=>"object"!=typeof e&&"function"!=typeof e).map(([e,t])=>`${e}: ${t}`).join(", "):"Data point: "+n}return V("div",{"aria-live":"polite","aria-atomic":"true",style:X,children:t})}import*as J from"react";import*as Z from"react";import{jsx as K}from"react/jsx-runtime";var Q=Z.createContext(null);function _(){return Z.useContext(Q)}import{jsx as ee,jsxs as te}from"react/jsx-runtime";function ne(e,t){if(!e||0===e.length)return t+", empty";const n={};for(const t of e){if(null===t?.datum)continue;const e=t.type+"";n[e]=(n[e]||0)+1}if(0===Object.keys(n).length)return t+", empty";const r=[],o={point:"points",line:"lines",area:"areas",rect:"bars",heatcell:"cells",circle:"nodes",candlestick:"candlesticks",wedge:"wedges",arc:"arcs",geoarea:"regions"},i=["point","line","area","rect","heatcell","circle","candlestick","wedge","arc","geoarea"],a=Object.keys(n).sort((e,t)=>{const n=i.indexOf(e),r=i.indexOf(t);return(-1===n?999:n)-(-1===r?999:r)});for(const e of a)r.push(`${n[e]} ${o[e]||e}`);return`${t}, ${r.join(", ")}`}function re(e,t,n){const r=[];return e>0&&r.push(e+" nodes"),t>0&&r.push(t+" edges"),0===r.length?n+", empty":`${n}, ${r.join(", ")}`}var oe=e=>{if(null==e)return"";const t=Math.round(100*e)/100;return Number.isNaN(t)?"":t+""},ie="semiotic-accessible-data-table",ae=ie+" semiotic-accessible-data-table-hidden",le=ie+" semiotic-accessible-data-table-visible",se=le+" semiotic-accessible-data-table-network",ce={position:"absolute",top:0,left:0,right:0,zIndex:"var(--semiotic-data-table-z-index, var(--semiotic-overlay-z-index, 20))",padding:"14px 16px 12px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",fontFamily:"var(--semiotic-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif)",fontSize:13,lineHeight:1.5,color:"var(--semiotic-data-table-text, var(--semiotic-text, #333))",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",borderRadius:"var(--semiotic-border-radius, 0px) var(--semiotic-border-radius, 0px) 0 0"},ue={marginBottom:8,paddingRight:28,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:12,letterSpacing:"0.01em"},de={position:"absolute",top:10,right:10,width:22,height:22,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",cursor:"pointer",color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:13,lineHeight:1,padding:0,borderRadius:"var(--semiotic-border-radius, 4px)"},he={width:"100%",borderCollapse:"collapse",fontSize:12,marginTop:4,fontVariantNumeric:"tabular-nums"},fe={textAlign:"left",padding:"5px 10px",borderBottom:"2px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",fontWeight:600,fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))"},me={padding:"4px 10px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))"},pe={textAlign:"left",fontSize:11,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",marginBottom:4,fontStyle:"italic"},ye={marginTop:8,padding:"4px 10px",fontSize:12,cursor:"pointer",border:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",borderRadius:"var(--semiotic-border-radius, 4px)",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",color:"var(--semiotic-data-table-text, var(--semiotic-text, #333))",fontFamily:"inherit"};function ge({scene:e,chartType:t,tableId:r,chartTitle:o}){const[i,a]=J.useState(!1),[l,s]=J.useState(5),c=_(),u=c?.visible??!1,d=i||u,h=J.useRef(null),f=o?"Data summary for "+o:r?`Data summary for ${t} ${r}`:"Data summary for "+t;J.useEffect(()=>{d||s(5)},[d]);const m=J.useCallback(e=>{e.target===e.currentTarget&&(i||u||a(!0))},[i,u]),p=J.useCallback(e=>{u||h.current?.contains(e.relatedTarget)||a(!1)},[u]);if(!e||0===e.length)return r?ee("span",{id:r,tabIndex:-1,style:X}):null;if(!d)return ee("div",{id:r,className:ae,tabIndex:-1,onFocus:m,style:X,role:"region","aria-label":f,children:te("button",{type:"button",onClick:()=>a(!0),children:["View data summary (",e.length," elements)"]})});const y=n(e),g=function(e){if(!e||0===e.length)return[];const t=new Set;for(const n of e)if(n&&n.values)for(const e of Object.keys(n.values))t.add(e);const n=[];for(const r of t){const t=[],o=new Set;for(const n of e){if(!n||!n.values)continue;const e=n.values[r];null!=e&&""!==e&&("number"==typeof e&&!Number.isNaN(e)&&Number.isFinite(e)?t.push(e):"number"==typeof e||"object"!=typeof e&&"function"!=typeof e&&o.add(e+""))}if(t.length>0){let e=t[0],o=t[0],i=0;for(const n of t)e>n&&(e=n),n>o&&(o=n),i+=n;n.push({name:r,count:t.length,numeric:!0,min:e,max:o,mean:i/t.length})}else if(o.size>0){const e=Array.from(o);n.push({name:r,count:e.length,numeric:!1,uniqueValues:e.slice(0,5)})}}return n}(y),b=function(e,t){const n=[e+" data points."];for(const e of t)if(e.numeric)n.push(`${e.name}: ${oe(e.min)} to ${oe(e.max)}, mean ${oe(e.mean)}.`);else{const t=e.uniqueValues,r=t.length>3?`${t.slice(0,3).join(", ")}… (${e.count} unique)`:t.join(", ");n.push(`${e.name}: ${r}.`)}return n.join(" ")}(y.length,g),x=Math.min(l,y.length),v=y.slice(0,x),w=y.length-x,k=new Set;for(const e of v)for(const t of Object.keys(e.values))k.add(t);const M=Array.from(k);return te("div",{ref:h,id:r,className:le,tabIndex:-1,onBlur:p,style:ce,role:"region","aria-label":f,children:[ee("button",{type:"button",className:"semiotic-accessible-data-table-close",onClick:()=>{u&&c&&c.setVisible(!1),a(!1)},"aria-label":"Close data summary",style:de,children:"×"}),ee("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:ue,children:b}),te("table",{className:"semiotic-accessible-data-table-table",role:"table","aria-label":"Sample data for "+t,style:he,children:[ee("caption",{className:"semiotic-accessible-data-table-caption",style:pe,children:w>0?`First ${x} of ${y.length} data points`:`All ${y.length} data points`}),ee("thead",{children:te("tr",{children:[ee("th",{style:fe,children:"type"}),M.map(e=>ee("th",{style:fe,children:e},e))]})}),ee("tbody",{children:v.map((e,t)=>te("tr",{children:[ee("td",{style:me,children:e.label}),M.map(t=>{return ee("td",{style:me,children:(n=e.values[t],null==n||""===n?"—":"number"==typeof n?Number.isNaN(n)?"—":oe(n):"boolean"==typeof n?n?"true":"false":"object"==typeof n?"—":n+"")},t);var n})]},t))})]}),w>0&&te("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:()=>s(e=>e+25),style:ye,children:["Show ",Math.min(25,w)," more"," ",1===w?"row":"rows"," (",w," remaining)"]})]})}function be({nodes:e,edges:t,chartType:n,tableId:r,chartTitle:o}){const[i,a]=J.useState(!1),[l,s]=J.useState(5),c=_(),u=c?.visible??!1,d=i||u,h=o?"Data summary for "+o:r?`Data summary for ${n} ${r}`:"Data summary for "+n,f=J.useRef(null);J.useEffect(()=>{d||s(5)},[d]);const m=J.useCallback(e=>{e.target===e.currentTarget&&(i||u||a(!0))},[i,u]),p=J.useCallback(e=>{u||f.current?.contains(e.relatedTarget)||a(!1)},[u]);if(!e||0===e.length)return r?ee("span",{id:r,tabIndex:-1,style:X}):null;if(!d)return ee("div",{id:r,className:ae,tabIndex:-1,onFocus:m,style:X,role:"region","aria-label":h,children:te("button",{type:"button",onClick:()=>a(!0),children:["View data summary (",e.length," nodes, ",t.length," edges)"]})});const y=Array.isArray(e)?e:[],g=Array.isArray(t)?t:[],b=new Map,x=new Map,v=new Map,w=new Map;for(const e of g){if(!e||"object"!=typeof e)continue;const t=e.datum??{source:e.source,target:e.target},n="object"==typeof t.source?t.source?.id:t.source,r="object"==typeof t.target?t.target?.id:t.target,o="number"==typeof t.value&&Number.isFinite(t.value)?t.value:0;if(null!=n&&""!==n){const e=n+"";x.set(e,(x.get(e)??0)+1),w.set(e,(w.get(e)??0)+o)}if(null!=r&&""!==r){const e=r+"";b.set(e,(b.get(e)??0)+1),v.set(e,(v.get(e)??0)+o)}}const k=[];for(let e=0;y.length>e;e++){const t=y[e];if(!t||"object"!=typeof t)continue;const n=t.datum?.id??t.id,r=null!=n?n+"":"node-"+e,o=b.get(r)??0,i=x.get(r)??0,a=v.get(r)??0,l=w.get(r)??0;k.push({id:r,degree:o+i,inDeg:o,outDeg:i,wDegree:a+l,wInDeg:a,wOutDeg:l})}k.sort((e,t)=>t.degree-e.degree);let M=0,j=0;if(k.length>0){let e=0;for(const t of k)e+=t.degree,t.degree>j&&(j=t.degree);M=e/k.length}const R=g.some(e=>{const t=e?.datum??{source:e?.source,target:e?.target};return"number"==typeof t?.value&&Number.isFinite(t.value)}),S=[`${k.length} nodes, ${g.length} edges.`];k.length>0&&S.push(`Mean degree: ${oe(M)}, max degree: ${j}.`);const $=Math.min(l,k.length),D=k.slice(0,$),C=k.length-$;return te("div",{ref:f,id:r,className:se,tabIndex:-1,onBlur:p,style:ce,role:"region","aria-label":h,children:[ee("button",{type:"button",className:"semiotic-accessible-data-table-close",onClick:()=>{u&&c&&c.setVisible(!1),a(!1)},"aria-label":"Close data summary",style:de,children:"×"}),ee("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:ue,children:S.join(" ")}),te("table",{className:"semiotic-accessible-data-table-table",role:"table","aria-label":"Node degree summary for "+n,style:he,children:[ee("caption",{className:"semiotic-accessible-data-table-caption",style:pe,children:C>0?`Top ${$} of ${k.length} nodes by degree`:`All ${k.length} nodes by degree`}),ee("thead",{children:te("tr",{children:[ee("th",{style:fe,children:"id"}),ee("th",{style:fe,children:"degree"}),ee("th",{style:fe,children:"in"}),ee("th",{style:fe,children:"out"}),R&&ee("th",{style:fe,children:"w. degree"}),R&&ee("th",{style:fe,children:"w. in"}),R&&ee("th",{style:fe,children:"w. out"})]})}),ee("tbody",{children:D.map((e,t)=>te("tr",{children:[ee("td",{style:me,children:e.id}),ee("td",{style:me,children:e.degree}),ee("td",{style:me,children:e.inDeg}),ee("td",{style:me,children:e.outDeg}),R&&ee("td",{style:me,children:oe(e.wDegree)}),R&&ee("td",{style:me,children:oe(e.wInDeg)}),R&&ee("td",{style:me,children:oe(e.wOutDeg)})]},t))})]}),C>0&&te("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:()=>s(e=>e+25),style:ye,children:["Show ",Math.min(25,C)," more"," ",1===C?"node":"nodes"," (",C," remaining)"]})]})}function xe({summary:e}){return e?ee("div",{role:"note",style:X,children:e}):null}function ve({tableId:e}){return ee("a",{href:"#"+e,style:X,onClick:t=>{t.preventDefault();const n=document.getElementById(e);n&&requestAnimationFrame(()=>n.focus())},onFocus:e=>{Object.assign(e.currentTarget.style,{position:"absolute",width:"auto",height:"auto",overflow:"visible",clip:"auto",whiteSpace:"normal",padding:"4px 8px",background:"var(--semiotic-bg, #fff)",color:"var(--semiotic-text, #000)",border:"2px solid var(--semiotic-focus, #005fcc)",borderRadius:"4px",zIndex:"10",fontSize:"12px",top:"4px",left:"4px"})},onBlur:e=>{const t=e.currentTarget;t.removeAttribute("style"),Object.assign(t.style,X)},children:"Skip to data table"})}import{jsx as we}from"react/jsx-runtime";var ke="var(--semiotic-focus, #005fcc)";function Me({active:e,hoverPoint:t,margin:n,size:r,shape:o="circle",width:i,height:a,pathData:l}){if(!e||!t)return null;const s=t.x+n.left,c=t.y+n.top;let u;if("geoarea"!==o&&"path"!==o||!l)if("rect"===o&&null!=i&&null!=a){const e=Math.max(i,4),t=Math.max(a,4);u=we("rect",{x:s-e/2-3,y:c-t/2-3,width:e+6,height:t+6,rx:3,fill:"none",stroke:ke,strokeWidth:2,strokeDasharray:"4,2"})}else u=we("circle","wedge"===o?{cx:s,cy:c,r:12,fill:"none",stroke:ke,strokeWidth:2.5,strokeDasharray:"6,3"}:{cx:s,cy:c,r:8,fill:"none",stroke:ke,strokeWidth:2,strokeDasharray:"4,2"});else u=we("g",{transform:`translate(${n.left},${n.top})`,children:we("path",{d:l,fill:"none",stroke:ke,strokeWidth:2.5,strokeDasharray:"6,3"})});return we("svg",{style:{position:"absolute",left:0,top:0,width:r[0],height:r[1],pointerEvents:"none",zIndex:2},"aria-hidden":"true",children:u})}import*as je from"react";import{jsx as Re}from"react/jsx-runtime";function Se({x:e,y:n,containerWidth:r,containerHeight:o,margin:i,children:a,className:l="stream-frame-tooltip",zIndex:s=1}){const c=Number.isFinite(e)&&Number.isFinite(n),u=je.useRef(null),[d,h]=je.useState(null);je.useLayoutEffect(()=>{const e=u.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect();Number.isFinite(t.width)&&Number.isFinite(t.height)&&h(e=>e&&.5>Math.abs(e.width-t.width)&&.5>Math.abs(e.height-t.height)?e:{width:t.width,height:t.height})};if(t(),"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[l,r,o,c]);let f;f=d?`translate(${d.width+12>r-e?"calc(-100% - 12px)":"12px"}, ${d.height+12>o-n?"calc(-100% - 4px)":"4px"})`:`translate(${e>.7*r?"calc(-100% - 12px)":"12px"}, ${.3*o>n?"4px":"calc(-100% - 4px)"})`;const m=function(e){if(!je.isValidElement(e))return!1;const t=e.type;if("string"!=typeof t&&t&&!0===t.ownsChrome)return!0;const n=e.props;if(!0===n["data-semiotic-tooltip-chrome"])return!0;if("true"===n["data-semiotic-tooltip-chrome"])return!0;const r=n.style;if(r&&"object"==typeof r){if(null!=r.background&&""!==r.background&&"transparent"!==r.background)return!0;if(null!=r.backgroundColor&&""!==r.backgroundColor&&"transparent"!==r.backgroundColor)return!0}return!1}(a),p=m?null:t;return c?Re("div",{ref:u,className:m?l:(l+" semiotic-tooltip").trim(),style:{...p||{},position:"absolute",left:i.left+e,top:i.top+n,transform:f,pointerEvents:"none",zIndex:s,width:"max-content"},children:a}):null}import*as $e from"react";import{useCallback as De,useEffect as Ce,useLayoutEffect as ze,useMemo as Ae,useRef as Ne}from"react";var We="undefined"==typeof window?Ce:ze,Fe={requestAnimationFrame:e=>("undefined"==typeof window?globalThis:window).requestAnimationFrame(e),cancelAnimationFrame:e=>("undefined"==typeof window?globalThis:window).cancelAnimationFrame(e)};function Oe(e,t,n){return"function"==typeof e?e({size:t,margin:n}):e}function Ie(e){const t=f(),n=Ne(t);n.current=t;const[r,o]=h(e.sizeProp,e.responsiveWidth,e.responsiveHeight),i=!!e.title,a=!!e.legend&&"top"===e.legendPosition,l=Ae(()=>u({...e.marginDefault,...e.userMargin},i,a),[e.marginDefault,e.userMargin,i,a]),s=o[0]-l.left-l.right,c=o[1]-l.top-l.bottom,m=Oe(e.foregroundGraphics,o,l),y=Oe(e.backgroundGraphics,o,l),g=k(e=>e.theme),{transition:b,introEnabled:x}=d(e.animate,e.transitionProp),v="semiotic-table-"+$e.useId(),M=Ne(null);if(!M.current){const t=!e.suspendWhenHidden||"undefined"==typeof document||!document.hidden;M.current=new p({clock:e.clock,random:e.random,seed:e.seed,paused:e.paused,visible:t})}const j=M.current;j.configure({clock:e.clock,random:e.random,seed:e.seed});const R=Ne(null),S=Ne(e.frameScheduler??Fe);S.current=e.frameScheduler??Fe;const $=Ne(null),D=Ne(!1),C=Ne(()=>{}),z=De(()=>{if(null!==R.current||D.current)return;const e=S.current;let t=!1,n=!1;const r=e.requestAnimationFrame(()=>{t=!0;const e=!n;e&&(D.current=!0),R.current=null,$.current=null;try{C.current()}finally{e&&(D.current=!1)}});n=!0,t||(R.current=r,$.current=e)},[]),A=De(()=>{null!==R.current&&(($.current??S.current).cancelAnimationFrame(R.current),R.current=null,$.current=null)},[]);We(()=>{j.setPaused(!0===e.paused)},[j,e.paused]),Ce(()=>{if(!e.suspendWhenHidden||"undefined"==typeof document)return void j.setVisible(!0);const t=()=>j.setVisible(!document.hidden);return t(),document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[j,e.suspendWhenHidden]),Ce(()=>()=>{A()},[A]);const N=Ne(()=>{}),W=Ne(()=>{}),F=Ne(null),O=Ne(null),I=Ne(null),B=De(()=>{const e=F.current;F.current=null,e&&N.current(e)},[]),E=De(e=>{if(F.current={clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType},null===O.current){const e=S.current;let t=!1;const n=e.requestAnimationFrame(()=>{t=!0,O.current=null,I.current=null,B()});t||(O.current=n,I.current=e)}},[B]),T=De(()=>{F.current=null,null!==O.current&&((I.current??S.current).cancelAnimationFrame(O.current),O.current=null,I.current=null),W.current()},[]);Ce(()=>()=>{F.current=null,null!==O.current&&((I.current??S.current).cancelAnimationFrame(O.current),O.current=null,I.current=null)},[]);const H=e.themeDirtyRef;return We(()=>{H&&(w(),H.current=!0,z())},[g,z,H]),{reducedMotion:t,reducedMotionRef:n,responsiveRef:r,size:o,margin:l,adjustedWidth:s,adjustedHeight:c,resolvedForeground:m,resolvedBackground:y,currentTheme:g,transition:b,introEnabled:x,tableId:v,frameRuntime:j,rafRef:R,renderFnRef:C,scheduleRender:z,cancelRender:A,hoverHandlerRef:N,hoverLeaveRef:W,onPointerMove:E,onPointerLeave:T}}import{useEffect as Be,useRef as Ee}from"react";import{jsx as Te}from"react/jsx-runtime";function He(e,t){return function(e){const{cancelRender:t,dirtyRef:n,frameRuntime:r,manageFrameRuntime:o,scheduleRender:i}=e,a=Ee(null),l=Ee(null),s=Ee(!1);return function(e){const{hydrated:t,wasHydratingFromSSR:n,storeRef:r,dirtyRef:o,renderFnRef:i,cancelRender:a,cleanup:l}=e;H(()=>{t&&n&&r.current?.cancelIntroAnimation?.(),o.current=!0,a?.(),i.current()},[t,n]);const s=B(l);s.current=l,O(()=>()=>s.current?.(),[])}({hydrated:e.hydrated,wasHydratingFromSSR:e.wasHydratingFromSSR,storeRef:e.storeRef,dirtyRef:e.dirtyRef,renderFnRef:e.renderFnRef,cancelRender:e.cancelRender,cleanup:e.cleanup}),Be(()=>{if(!1!==o)return r.subscribe(()=>{r.isActive?(n.current=!0,i()):t()})},[t,n,r,o,i]),Be(()=>{!s.current&&(s.current=!0,e.skipInitialCanvasPaintInvalidation)||(e.dirtyRef.current=!0,e.scheduleRender())},e.canvasPaintDependencies),{canvasRef:a,interactionCanvasRef:l}}({...t,renderFnRef:e.renderFnRef,scheduleRender:e.scheduleRender,cancelRender:e.cancelRender,frameRuntime:e.frameRuntime})}function Ue({children:e,size:t,margin:n,overflowVisible:r=!1}){return e?Te("svg",{style:{position:"absolute",left:0,top:0,width:t[0],height:t[1],pointerEvents:"none",overflow:r?"visible":void 0},children:Te("g",{transform:`translate(${n.left},${n.top})`,children:e})}):null}function Pe(e,t,n,r){const o=e.getContext("2d");if(!o)return null;const i=Math.round(t[0]*r),a=Math.round(t[1]*r),l=i/t[0],s=a/t[1],c=t[0]+"px",u=t[1]+"px";return e.style.width!==c&&(e.style.width=c),e.style.height!==u&&(e.style.height=u),e.width===i&&e.height===a||(e.width=i,e.height=a),o.setTransform(l,0,0,s,0,0),o.translate(n.left,n.top),o}function Le(){if("undefined"==typeof window)return 1;const e=window.devicePixelRatio||1,t=function(){if("undefined"==typeof window)return!1;const e="function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,t=768>Math.min(window.innerWidth||1/0,window.innerHeight||1/0);return e||t}()?2:3;return Math.max(1,Math.min(e,t))}import*as qe from"react";import{jsx as Ge,jsxs as Ve}from"react/jsx-runtime";function Xe({componentName:e,message:t,diagnosticHint:n,width:r,height:o}){return Ge("div",{role:"alert",style:{width:r,height:Math.max(o,120),display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed rgba(128, 128, 128, 0.4)",borderRadius:8,background:"rgba(128, 128, 128, 0.04)",padding:24,boxSizing:"border-box"},children:Ve("div",{style:{textAlign:"center",maxWidth:400},children:[Ge("div",{style:{fontSize:13,fontWeight:600,color:"rgba(128, 128, 128, 0.7)",marginBottom:6,fontFamily:"monospace"},children:e}),Ge("div",{style:{fontSize:14,color:"rgba(128, 128, 128, 0.9)",lineHeight:1.5},children:t}),n&&Ge("div",{"data-testid":"semiotic-diagnostic-hint",style:{marginTop:10,padding:"8px 12px",background:"rgba(128, 128, 128, 0.06)",borderRadius:4,fontSize:12,color:"rgba(128, 128, 128, 0.8)",fontFamily:"monospace",textAlign:"left",whiteSpace:"pre-wrap",lineHeight:1.6},children:n})]})})}import{jsx as Ye}from"react/jsx-runtime";var Je=class extends qe.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError?.(e,t)}render(){if(this.state.error){const{fallback:e}=this.props,t=this.state.error;return"function"==typeof e?e(t):void 0!==e?e:Ye(Xe,{componentName:"ChartErrorBoundary",message:t.message||"An unexpected error occurred while rendering this chart.",width:600,height:400})}return this.props.children}};import{jsx as Ze}from"react/jsx-runtime";function Ke({componentName:e,width:t,height:n,children:r}){return Ze(Je,{fallback:r=>Ze(Xe,{componentName:e,message:r.message,width:t,height:n}),children:r})}"undefined"!=typeof process&&process;var Qe={display:"flex",alignItems:"center",justifyContent:"center",color:"var(--semiotic-text-secondary, #666)",fontSize:13,fontFamily:"inherit",border:"1px dashed var(--semiotic-border, #ddd)",borderRadius:4,boxSizing:"border-box"},_e={background:"var(--semiotic-border, #e0e0e0)",borderRadius:2};function et(e,t,n,r){return!1===r||null==e||Array.isArray(e)&&e.length>0?null:Array.isArray(e)?Ze("div",{style:{...Qe,width:t,height:n},children:r||"No data available"}):null}function tt(e,t,n,r){if(!e)return null;if(!1===r)return null;if(null!=r)return Ze("div",{style:{width:t,height:n,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},children:r});const o=Math.min(5,Math.floor(n/40)),i=Math.max(8,Math.floor(n/(3*o))),a=Math.max(6,Math.floor(n/(2.5*o))),l=Math.floor((n-(o*(i+a)-a))/2);return Ze("div",{style:{width:t,height:n,position:"relative",overflow:"hidden",border:"1px solid var(--semiotic-border, #e0e0e0)",borderRadius:4,boxSizing:"border-box"},children:Array.from({length:o},(e,n)=>Ze("div",{className:"semiotic-loading-bar",style:{..._e,position:"absolute",top:l+n*(i+a),left:Math.floor(.1*t),width:30+(37*n+13)%50+"%",height:i,opacity:.5+n%2*.2}},n))})}import{jsx as nt}from"react/jsx-runtime";function rt(e){const{legend:t,totalWidth:n,totalHeight:r,margin:a,legendPosition:l="right",legendLayout:u,title:d,legendHoverBehavior:h,legendClickBehavior:f,legendHighlightedCategory:m,legendIsolatedCategories:p,legendInteraction:y}=e;if(!t)return null;const g="top"===l||"bottom"===l,b=!!d,x=Math.max(0,n-a.left-a.right),v=Math.max(1,g?u?.maxWidth??x:100);let w,k;return"left"===l?(w=Math.max(4,a.left-v-10),k=a.top):"top"===l?(w=a.left,k=b?32:8):"bottom"===l?(w=a.left,k=r-a.bottom+38):(w=n-a.right+10,k=a.top),nt("g",{transform:`translate(${w}, ${k})`,children:s(t)?nt(o,{config:t.gradient,orientation:g?"horizontal":"vertical",width:v}):c(t)?nt(i,{legendGroups:t.legendGroups,title:"",width:v,orientation:g?"horizontal":"vertical",legendLayout:u,customHoverBehavior:h,customClickBehavior:f,highlightedCategory:m,isolatedCategories:p,legendInteraction:y}):t})}import*as ot from"react";import{packEnclose as it}from"d3-hierarchy";import{area as at,curveLinear as lt,curveMonotoneX as st,curveMonotoneY as ct,curveStep as ut,curveStepAfter as dt,curveStepBefore as ht,curveBasis as ft,curveCardinal as mt,curveCatmullRom as pt}from"d3-shape";function yt(e){return Math.round(100*e)/100}function gt(e,t=2){const n=[],r=[],o=t+1;for(let t=0;o>t;t++){let i=0;for(const[n,r]of e)null!==r&&(i+=n**t*r);n.push(i);const a=[];for(let n=0;o>n;n++){let r=0;for(const[o,i]of e)null!==i&&(r+=o**(t+n));a.push(r)}r.push(a)}r.push(n);const i=function(e,t){const n=e,r=e.length-1,o=[t];for(let e=0;r>e;e++){let t=e;for(let o=e+1;r>o;o++)Math.abs(n[e][o])>Math.abs(n[e][t])&&(t=o);for(let o=e;r+1>o;o++){const r=n[o][e];n[o][e]=n[o][t],n[o][t]=r}for(let t=e+1;r>t;t++)for(let o=r;o>=e;o--)n[o][t]-=n[o][e]*n[e][t]/n[e][e]}for(let e=r-1;e>=0;e--){let t=0;for(let i=e+1;r>i;i++)t+=n[i][e]*o[i];o[e]=(n[r][e]-t)/n[e][e]}return o}(r,o).map(yt);return{points:e.map(([e])=>[yt(e),yt(i.reduce((t,n,r)=>t+n*e**r,0))]),equation:[...i].reverse()}}import{jsx as bt,jsxs as xt}from"react/jsx-runtime";var vt={linear:lt,monotoneX:st,monotoneY:ct,step:ut,stepAfter:dt,stepBefore:ht,basis:ft,cardinal:mt,catmullRom:pt};function wt(e,t,n,r){const o=[];return e.forEach((e,i)=>{let a;if(n){const o=n(e,i,r);a=null!=o?o:t(e,i,r)}else a=t(e,i,r);a&&o.push({node:a,annotation:e})}),l(o)}function kt(t,n={}){return function(t,o,i){switch(t.type){case"label":case"callout":case"callout-circle":case"callout-rect":{const e=g(t,o,i);if(!e)return null;const{x:n,y:r}=e;if(!y(n,r,i))return null;const l="callout"===t.type?"callout-circle":t.type,s="callout-circle"===l?{radius:t.radius??12,radiusPadding:t.radiusPadding}:"callout-rect"===l?{width:t.width,height:t.height}:void 0;return bt(a,{noteData:{x:n,y:r,dx:t.dx??30,dy:t.dy??-30,note:{label:t.label,title:t.title,wrap:t.wrap||120},type:l,...s?{subject:s}:{},connector:t.connector||{end:"arrow"},color:t.color,disable:t.disable,opacity:t.opacity,strokeDasharray:t.strokeDasharray,className:t.className}},"ann-"+o)}case"x-threshold":{const e=b(null!=t.value?{...t,x:t.value}:t,i);if(null==e)return null;const n=t.color||"#f97316",a=t.labelPosition||"top";let l;l="bottom"===a?(i.height||0)-4:"center"===a?(i.height||0)/2:16;const s=e>.6*(i.width||0),c=s?e-4:e+4,u=s?"end":"start";return xt("g",{opacity:t.opacity,children:[bt("line",{x1:e,y1:0,x2:e,y2:i.height||0,stroke:n,strokeWidth:t.strokeWidth||1.5,strokeDasharray:t.strokeDasharray||"6,3"}),t.label&&bt(r,{x:c,y:l,text:t.label,textAnchor:u,fill:n,fontSize:12,fontWeight:"bold",background:t.labelBackground??"halo"})]},"ann-"+o)}case"y-threshold":{const e=x(null!=t.value?{...t,y:t.value}:t,i);if(null==e)return null;const n=t.color||"#f97316",a=t.labelPosition||"right";let l,s;"left"===a?(l=4,s="start"):"center"===a?(l=(i.width||0)/2,s="middle"):(l=(i.width||0)-4,s="end");const u=20>(c=e)?Math.min((i.height||0)-4,c+16):c-4;return xt("g",{opacity:t.opacity,children:[bt("line",{x1:0,y1:e,x2:i.width||0,y2:e,stroke:n,strokeWidth:t.strokeWidth||1.5,strokeDasharray:t.strokeDasharray||"6,3"}),t.label&&bt(r,{x:l,y:u,text:t.label,textAnchor:s,fill:n,fontSize:12,fontWeight:"bold",background:t.labelBackground??"halo"})]},"ann-"+o)}case"enclose":{const e=(t.coordinates||[]).map(e=>({x:b({...e,type:"point"},i),y:x({...e,type:"point"},i),r:1})).filter(e=>null!=e.x&&null!=e.y);if(2>e.length)return null;const n=it(e),a=t.padding||10;return xt("g",{children:[bt("circle",{cx:n.x,cy:n.y,r:n.r+a,fill:t.fill||"none",fillOpacity:t.fillOpacity||.1,stroke:t.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),t.label&&bt(r,{x:n.x,y:n.y-n.r-a-4,textAnchor:"middle",fill:t.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:t.label,background:t.labelBackground??"none"})]},"ann-"+o)}case"rect-enclose":{const e=(t.coordinates||[]).map(e=>({x:b({...e,type:"point"},i),y:x({...e,type:"point"},i)})).filter(e=>null!=e.x&&null!=e.y);if(2>e.length)return null;const n=t.padding||10,a=e.map(e=>e.x),l=e.map(e=>e.y),[s,c]=v(a),[u,d]=v(l),h=s-n,f=c+n,m=u-n;return xt("g",{children:[bt("rect",{x:h,y:m,width:f-h,height:d+n-m,fill:t.fill||"none",fillOpacity:t.fillOpacity||.1,stroke:t.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),t.label&&bt(r,{x:(h+f)/2,y:m-4,textAnchor:"middle",fill:t.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:t.label,background:t.labelBackground??"none"})]},"ann-"+o)}case"highlight":{const e=i.data||[],n="function"==typeof t.filter?e.filter(t.filter):t.field&&null!=t.value?e.filter(e=>e[t.field]===t.value):[],r={stroke:t.color||"#f97316",strokeWidth:2,fill:"none"};return bt("g",{children:n.map((e,n)=>{const o=b(e,i),a=x(e,i);if(null==o||null==a)return null;const l="function"==typeof t.r?t.r(e):t.r||6,s="function"==typeof t.style?t.style(e):t.style||r;return bt("circle",{cx:o,cy:a,r:l,...s},"hl-"+n)})},"ann-"+o)}case"bracket":{const e=b(t,i),n=x(t,i);return bt(a,{noteData:{x:e??0,y:n??0,dx:t.dx||0,dy:t.dy||0,note:{label:t.label,title:t.title,wrap:t.wrap||120},type:"bracket",subject:{type:t.bracketType||"curly",width:t.width,height:t.height,depth:t.depth||30},color:t.color}},"ann-"+o)}case"trend":{const e=i.data||[];if(2>e.length)return null;const n=i.xAccessor||"x",r=i.yAccessor||"y",a="ordinal"===i.frameType,l="horizontal"===i.projection,s=a?n:null,c=a?r:null;let u;const d=[],h=new Map;if(a&&s&&c){for(const t of e){const e=t[s];if(null==e)continue;const n=e+"";h.has(n)||(h.set(n,d.length),d.push(n))}u=e.map(e=>{const t=e[s],n=e[c];if(null==t||null==n)return null;const r=h.get(t+"");return null!=r?[r,+n]:null}).filter(e=>null!==e)}else u=e.map(e=>[e[n],e[r]]).filter(e=>null!=e[0]&&null!=e[1]);if(2>u.length)return null;const f=i.scales?.x??i.scales?.time,m=i.scales?.y??i.scales?.value;if(!f||!m)return null;const p=e=>t=>{const n=Math.max(0,Math.floor(t)),r=Math.min(d.length-1,n+1),o=t-n,i=e(d[n]);return i+(e(d[r])-i)*o},y=f,g=m;let b;if(a)if(l){const e=p(g);b=(t,n)=>[y(n),e(t)]}else{const e=p(y);b=(t,n)=>[e(t),g(n)]}else b=(e,t)=>[y(e),g(t)];const x=t.method||"linear";let v;if("loess"===x)v=function(e,t=.3){const n=e.length;if(2>n)return e.slice();const r=e.slice().sort((e,t)=>e[0]-t[0]),o=r.map(e=>e[0]),i=r.map(e=>e[1]),a=Math.max(2,Math.ceil(t*n)),l=[];for(let e=0;n>e;e++){const t=o[e],r=o.map(e=>Math.abs(e-t)),s=r.slice().sort((e,t)=>e-t)[Math.min(a-1,n-1)]||1,c=[];for(let e=0;n>e;e++){const t=0===s?0:r[e]/s;c[e]=1>t?Math.pow(1-Math.pow(t,3),3):0}let u=0,d=0,h=0,f=0,m=0;for(let e=0;n>e;e++){const t=c[e];0!==t&&(u+=t,d+=t*o[e],h+=t*i[e],f+=t*o[e]*o[e],m+=t*o[e]*i[e])}if(0===u){l.push([t,i[e]]);continue}const p=u*f-d*d;if(1e-12>Math.abs(p))l.push([t,h/u]);else{const e=(u*m-d*h)/p;l.push([t,(h-e*d)/u+e*t])}}return l}(u,t.bandwidth??.3);else{const e="polynomial"===x?gt(u,t.order||2):function(e){const t=[0,0,0,0];let n=0;for(const[r,o]of e)null!==o&&(n++,t[0]+=r,t[1]+=o,t[2]+=r*r,t[3]+=r*o);const r=n*t[2]-t[0]*t[0],o=0===r?0:yt((n*t[3]-t[0]*t[1])/r),i=yt(t[1]/n-o*t[0]/n);return{points:e.map(([e])=>[yt(e),yt(o*e+i)]),equation:[o,i]}}(u);v=e.points}const w=v.map(([e,t])=>{const[n,r]=b(e,t);return`${n},${r}`}).join(" "),k=t.color||"#6366f1",M=v[v.length-1],[j,R]=b(M[0],M[1]);return xt("g",{children:[bt("polyline",{points:w,fill:"none",stroke:k,strokeWidth:t.strokeWidth||2,strokeDasharray:t.strokeDasharray||"6,3"}),t.label&&bt("text",{x:j+4,y:R-4,fill:k,fontSize:11,children:t.label})]},"ann-"+o)}case"band":{const e=i.scales?.y??i.scales?.value,n=e?.(t.y0)??0,a=e?.(t.y1)??(i.height||0),c=m(t.fill,"ann-"+o,"var(--semiotic-primary, #6366f1)");return xt("g",{opacity:t.opacity,children:[c.def&&bt("defs",{children:c.def}),bt("rect",{x:0,y:Math.min(n,a),width:i.width||0,height:Math.abs(a-n),fill:c.fill,fillOpacity:t.fillOpacity||.1}),t.label&&bt(r,{x:(i.width||0)-4,y:(l=n,s=a,Math.max(Math.min(l,s),0)+16),textAnchor:"end",fill:t.color||"var(--semiotic-primary, #6366f1)",fontSize:11,fontWeight:"bold",text:t.label,background:t.labelBackground??"halo"})]},"ann-"+o)}case"x-band":{const e=i.scales?.x??i.scales?.time,n=null!=t.x0&&e?e(t.x0):null,a=null!=t.x1&&e?e(t.x1):null;if(null==n||null==a)return null;const l=m(t.fill||t.color,"ann-"+o,"var(--semiotic-primary, #6366f1)");return xt("g",{opacity:t.opacity,children:[l.def&&bt("defs",{children:l.def}),bt("rect",{x:Math.min(n,a),y:0,width:Math.abs(a-n),height:i.height||0,fill:l.fill,fillOpacity:t.fillOpacity??.1}),t.label&&bt(r,{x:Math.min(n,a)+4,y:16,textAnchor:"start",fill:t.color||"var(--semiotic-primary, #6366f1)",fontSize:11,fontWeight:"bold",text:t.label,background:t.labelBackground??"halo"})]},"ann-"+o)}case"envelope":{const e=i.data||[];if(2>e.length)return null;const n=i.xAccessor||"x",r=i.scales?.x??i.scales?.time,a=i.scales?.y??i.scales?.value;if(!r||!a)return null;const l=t.upperAccessor||"upperBounds",s=t.lowerAccessor||"lowerBounds",c=t.filter,u=e.filter(e=>null!=e[l]&&null!=e[s]&&!(c&&!c(e))).sort((e,t)=>e[n]-t[n]);if(2>u.length)return null;const d=vt[i.curve||"linear"]||lt,h=at().x(e=>r(e[n])).y0(e=>a(e[s])).y1(e=>a(e[l])).curve(d)(u);if(!h)return null;const f=t.fill||"#6366f1";return xt("g",{children:[bt("path",{d:h,fill:f,fillOpacity:t.fillOpacity??.15,stroke:"none"}),t.label&&u.length>0&&bt("text",{x:r(u[u.length-1][n])+4,y:a(u[u.length-1][l])-4,fill:f,fontSize:11,children:t.label})]},"ann-"+o)}case"anomaly-band":{const e=i.data||[];if(2>e.length)return null;const n=i.yAccessor||"y",r=i.scales?.x??i.scales?.time,a=i.scales?.y??i.scales?.value;if(!r||!a)return null;const l=e.map(e=>e[n]).filter(e=>null!=e&&isFinite(e));if(2>l.length)return null;const s=l.reduce((e,t)=>e+t,0)/l.length,c=l.reduce((e,t)=>e+(t-s)**2,0)/l.length,u=Math.sqrt(c),d=t.threshold??2,h=s-d*u,f=!1!==t.showBand,m=t.fill||"#6366f1",p=t.fillOpacity??.1,y=t.anomalyColor||"#ef4444",g=t.anomalyRadius??6,v=a(s+d*u),w=a(h),k=e.filter(e=>{const t=e[n];return null!=t&&Math.abs(t-s)>d*u});return xt("g",{children:[f&&bt("rect",{x:0,y:Math.min(v,w),width:i.width||0,height:Math.abs(w-v),fill:m,fillOpacity:p}),k.map((e,t)=>{const n=b(e,i),r=x(e,i);return null==n||null==r?null:bt("circle",{cx:n,cy:r,r:g,fill:y,fillOpacity:.7,stroke:y,strokeWidth:1.5},"anomaly-"+t)}),t.label&&bt("text",{x:(i.width||0)-4,y:Math.min(v,w)-4,textAnchor:"end",fill:m,fontSize:11,children:t.label})]},"ann-"+o)}case"forecast":{const e=i.data||[];if(3>e.length)return null;const n=i.xAccessor||"x",r=i.yAccessor||"y",a=i.scales?.x??i.scales?.time,l=i.scales?.y??i.scales?.value;if(!a||!l)return null;const s=e.map(e=>[e[n],e[r]]).filter(e=>null!=e[0]&&null!=e[1]&&isFinite(e[0])&&isFinite(e[1])).sort((e,t)=>e[0]-t[0]);if(3>s.length)return null;let c;if("polynomial"===(t.method||"linear")){const e=gt(s,t.order||2).equation;c=t=>e.reduce((e,n,r)=>e+n*Math.pow(t,r),0)}else{const e=s.length;let t=0,n=0,r=0,o=0;for(const[e,i]of s)t+=e,n+=i,r+=e*e,o+=e*i;const i=e*r-t*t;if(1e-12>Math.abs(i))return null;const a=(e*o-t*n)/i,l=(n-a*t)/e;c=e=>l+a*e}const u=s.length,d=s.map(([e,t])=>t-c(e)),h=d.reduce((e,t)=>e+t*t,0),f=Math.sqrt(h/Math.max(u-2,1)),m=s.reduce((e,t)=>e+t[0],0)/u,p=s.reduce((e,t)=>e+(t[0]-m)**2,0),y=t.confidence??.95,g=.99>y?.95>y?.9>y?1:1.645:1.96:2.576,b=t.steps??5,x=s[u-1][0],v=(x-s[0][0])/Math.max(u-1,1),w=[];for(let e=1;b>=e;e++)w.push(x+e*v);const k=[];for(const e of w){const t=c(e),n=f*Math.sqrt(1+1/u+(p>0?(e-m)**2/p:0))*g;k.push({x:e,yCenter:t,yUpper:t+n,yLower:t-n})}const M=`M${k.map(e=>`${a(e.x)},${l(e.yUpper)}`).join(" L")} L${k.slice().reverse().map(e=>`${a(e.x)},${l(e.yLower)}`).join(" L")} Z`,j=k.map(e=>`${a(e.x)},${l(e.yCenter)}`).join(" "),R=`${a(x)},${l(c(x))}`,S=t.strokeColor||"#6366f1";return xt("g",{children:[bt("path",{d:M,fill:t.fill||"#6366f1",fillOpacity:t.fillOpacity??.15,stroke:"none"}),bt("polyline",{points:`${R} ${j}`,fill:"none",stroke:S,strokeWidth:t.strokeWidth??2,strokeDasharray:t.strokeDasharray??"6,3"}),t.label&&k.length>0&&bt("text",{x:a(k[k.length-1].x)+4,y:l(k[k.length-1].yCenter)-4,fill:S,fontSize:11,children:t.label})]},"ann-"+o)}case"widget":{let r,a;if(null!=t.px&&null!=t.py)r=t.px,a=t.py;else{const e=g(t,o,i);if(!e)return null;r=e.x,a=e.y}if(!y(r,a,i))return null;const l=t.dx??0,s=t.dy??0,c=t.width??32,u=t.height??32,d=t.content??bt("span",{style:{fontSize:18,cursor:"default"},title:t.label||"Info",children:"ℹ️"});return bt("foreignObject",{x:r+l-c/2,y:a+s-u/2,width:c,height:u,style:{overflow:"visible",pointerEvents:"auto"},children:bt("div",{...e(t,n),style:{width:c,height:u,display:"flex",alignItems:"center",justifyContent:"center"},children:d})},"ann-"+o)}case"text":{const e=g(t,o,i);if(!e)return null;const{x:n,y:r}=e,a=n+(t.dx||0),l=r+(t.dy||0),s=t.color||"var(--semiotic-text, #333)",c=bt("text",{x:a,y:l,fill:s,fontSize:t.fontSize||11,opacity:t.opacity,strokeDasharray:t.strokeDasharray,dominantBaseline:"middle",style:{fontFamily:"inherit"},children:t.label});return!0!==t._redundantConnector?ot.cloneElement(c,{key:"ann-text-"+o}):xt("g",{opacity:t.opacity,strokeDasharray:t.strokeDasharray,children:[bt("line",{x1:n,y1:r,x2:a,y2:l,stroke:s,strokeWidth:1,strokeOpacity:.5,style:{pointerEvents:"none"}}),ot.cloneElement(c,{opacity:void 0,strokeDasharray:void 0})]},"ann-text-"+o)}case"category-highlight":{const e=t.category;if(null==e)return null;const n=e=>"function"==typeof e&&"function"==typeof e.bandwidth,a=i.scales?.o,l=i.scales?.x,s=i.scales?.y,c=n(a)?a:n(l)?l:n(s)?s:null;if(!c)return null;const u=c(e+"");if(null==u)return null;const d=c.bandwidth(),h=t.color||"var(--semiotic-primary, #4589ff)",f=t.opacity??.15,m=t.label;return xt("g",(i.projection?"vertical"===i.projection:c===l)?{children:[bt("rect",{x:u,y:0,width:d,height:i.height||0,fill:h,fillOpacity:f}),m&&bt(r,{x:u+d/2,y:16,textAnchor:"middle",fill:h,fontSize:12,fontWeight:"bold",text:m,background:t.labelBackground??"none"})]}:{children:[bt("rect",{x:0,y:u,width:i.width||0,height:d,fill:h,fillOpacity:f}),m&&bt(r,{x:12,y:u+d/2,dominantBaseline:"middle",fill:h,fontSize:12,fontWeight:"bold",text:m,background:t.labelBackground??"none"})]},"ann-"+o)}default:return null}var l,s,c}}export{N as useSceneRevisionDiagnostics,W as runSceneBuild,F as SceneRevisionDiagnosticsObserver,rt as renderLegendFromConfig,wt as renderAnnotationPass,kt as createDefaultAnnotationRules,U as useHydration,G as useWasHydratingFromSSR,_ as useDataSummary,Y as AriaLiveTooltip,ne as computeCanvasAriaLabel,re as computeNetworkAriaLabel,ge as AccessibleDataTable,be as NetworkAccessibleDataTable,xe as ScreenReaderSummary,ve as SkipToTableLink,Me as FocusRing,Se as FlippingTooltip,Ie as useFrame,He as useFrameCanvasHost,Ue as CanvasFrameBackground,Pe as prepareCanvas,Le as getDevicePixelRatio,Ke as SafeRender,et as renderEmptyState,tt as renderLoadingState};