semiotic 3.8.2 → 3.8.4

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 (195) hide show
  1. package/CLAUDE.md +9 -9
  2. package/README.md +42 -40
  3. package/ai/examples.md +1 -1
  4. package/ai/schema.json +2726 -300
  5. package/ai/surface-manifest.json +1 -1
  6. package/ai/system-prompt.md +1 -1
  7. package/dist/chunk-chunk-2JGJ5GUG.module.min.js +0 -1
  8. package/dist/chunk-chunk-3ILKBVVQ.module.min.js +1 -0
  9. package/dist/{chunk-chunk-NO4MCQVD.module.min.js → chunk-chunk-5RKXZQ2P.module.min.js} +1 -1
  10. package/dist/{chunk-chunk-CYIML3AV.module.min.js → chunk-chunk-6TPGFL7M.module.min.js} +1 -1
  11. package/dist/{chunk-chunk-VVCA3DB7.module.min.js → chunk-chunk-7ALTGHK6.module.min.js} +1 -1
  12. package/dist/chunk-chunk-7KZJUTKP.module.min.js +2 -0
  13. package/dist/chunk-chunk-7RYBCTK5.module.min.js +1 -0
  14. package/dist/chunk-chunk-ACLDBMRH.module.min.js +2 -0
  15. package/dist/chunk-chunk-ANYDWOZF.module.min.js +1 -0
  16. package/dist/{chunk-chunk-ZLKRTF5N.module.min.js → chunk-chunk-AQPQN2HH.module.min.js} +1 -1
  17. package/dist/chunk-chunk-ASKSE5F5.module.min.js +1 -0
  18. package/dist/chunk-chunk-AVBI6GDT.module.min.js +1 -0
  19. package/dist/chunk-chunk-B3DRZPBK.module.min.js +2 -0
  20. package/dist/chunk-chunk-BFHUYEOS.module.min.js +2 -0
  21. package/dist/chunk-chunk-C4YA6TDR.module.min.js +1 -0
  22. package/dist/chunk-chunk-C57LR3YG.module.min.js +1 -0
  23. package/dist/chunk-chunk-EMO5NUGE.module.min.js +1 -0
  24. package/dist/chunk-chunk-F5V4UIE6.module.min.js +2 -0
  25. package/dist/chunk-chunk-F7WFPD4O.module.min.js +2 -0
  26. package/dist/chunk-chunk-FBGHXL72.module.min.js +2 -0
  27. package/dist/chunk-chunk-FP44FHFO.module.min.js +2 -0
  28. package/dist/chunk-chunk-HKXUAEPJ.module.min.js +2 -0
  29. package/dist/chunk-chunk-ICEXPNDC.module.min.js +2 -0
  30. package/dist/chunk-chunk-IY7RYD4S.module.min.js +1 -0
  31. package/dist/{chunk-chunk-7LHMKRKE.module.min.js → chunk-chunk-JDXT6ORT.module.min.js} +1 -1
  32. package/dist/chunk-chunk-JMVEIZXP.module.min.js +1 -0
  33. package/dist/chunk-chunk-KHCOJMGK.module.min.js +1 -0
  34. package/dist/chunk-chunk-KQ546MKE.module.min.js +2 -0
  35. package/dist/chunk-chunk-LQBSXO7K.module.min.js +2 -0
  36. package/dist/chunk-chunk-LRIFN2HK.module.min.js +1 -0
  37. package/dist/chunk-chunk-MFHF4J2Z.module.min.js +1 -0
  38. package/dist/chunk-chunk-N6VKKF3A.module.min.js +2 -0
  39. package/dist/chunk-chunk-NEVE562N.module.min.js +1 -0
  40. package/dist/chunk-chunk-NKZ75IM5.module.min.js +2 -0
  41. package/dist/chunk-chunk-PLIDPQNG.module.min.js +2 -0
  42. package/dist/{chunk-chunk-FYY2ACNJ.module.min.js → chunk-chunk-PRDGLMJT.module.min.js} +1 -1
  43. package/dist/chunk-chunk-QGZGZI4X.module.min.js +1 -0
  44. package/dist/chunk-chunk-RP7WTID5.module.min.js +1 -0
  45. package/dist/chunk-chunk-S7KLNUO6.module.min.js +1 -0
  46. package/dist/chunk-chunk-SR4ZXOWR.module.min.js +2 -0
  47. package/dist/chunk-chunk-ZOAQDIJO.module.min.js +1 -0
  48. package/dist/chunk-minimapBrushOverlay-JU57U7NM.module.min.js +2 -0
  49. package/dist/chunk-scatterplotMatrixBrushOverlay-SDIZSN66.module.min.js +2 -0
  50. package/dist/chunk-statisticalOverlays-QGDLRUHX.module.min.js +1 -0
  51. package/dist/chunk-statisticalOverlays-T77OKLDY.module.min.js +1 -0
  52. package/dist/components/ChartContainer.d.ts +2 -2
  53. package/dist/components/ai/chartCapabilityTypes.d.ts +5 -0
  54. package/dist/components/charts/custom/XYCustomChart.d.ts +3 -0
  55. package/dist/components/charts/geo/ChoroplethMap.d.ts +2 -0
  56. package/dist/components/charts/geo/DistanceCartogram.d.ts +7 -3
  57. package/dist/components/charts/geo/FlowMap.d.ts +4 -0
  58. package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +3 -1
  59. package/dist/components/charts/physics/CollisionSwarmChart.d.ts +6 -1
  60. package/dist/components/charts/physics/GaltonBoardChart.d.ts +6 -1
  61. package/dist/components/charts/physics/gauntletChartProps.d.ts +7 -1
  62. package/dist/components/charts/physics/gauntletChrome.d.ts +2 -1
  63. package/dist/components/charts/physics/gauntletPhysics.d.ts +19 -4
  64. package/dist/components/charts/physics/gauntletRuntime.d.ts +3 -0
  65. package/dist/components/charts/physics/physicsHocUtils.d.ts +12 -0
  66. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +5 -6
  67. package/dist/components/charts/realtime/temporalHistogramConfig.d.ts +11 -0
  68. package/dist/components/charts/shared/areaSeriesData.d.ts +15 -0
  69. package/dist/components/charts/shared/chartMode.d.ts +75 -0
  70. package/dist/components/charts/shared/chartSpecCore.d.ts +2 -2
  71. package/dist/components/charts/shared/colorUtils.d.ts +8 -0
  72. package/dist/components/charts/shared/geoStyleDefaults.d.ts +3 -0
  73. package/dist/components/charts/shared/hatchPattern.d.ts +8 -3
  74. package/dist/components/charts/shared/hooks.d.ts +13 -80
  75. package/dist/components/charts/shared/lineSeriesSsr.d.ts +55 -0
  76. package/dist/components/charts/shared/types.d.ts +2 -2
  77. package/dist/components/charts/shared/useChartSetup.d.ts +3 -0
  78. package/dist/components/charts/shared/useCustomChartSetup.d.ts +3 -0
  79. package/dist/components/charts/shared/useXYLineStyle.d.ts +3 -2
  80. package/dist/components/charts/shared/validateProps.d.ts +1 -1
  81. package/dist/components/charts/shared/xyLineStyle.d.ts +21 -0
  82. package/dist/components/charts/xy/AreaChart.d.ts +10 -0
  83. package/dist/components/charts/xy/LineChart.d.ts +3 -0
  84. package/dist/components/charts/xy/minimapBrushOverlay.d.ts +17 -0
  85. package/dist/components/charts/xy/minimapBrushOverlayLazy.d.ts +4 -0
  86. package/dist/components/charts/xy/scatterplotMatrixBrushOverlay.d.ts +8 -0
  87. package/dist/components/charts/xy/scatterplotMatrixBrushOverlayLazy.d.ts +3 -0
  88. package/dist/components/legendLayout.d.ts +31 -0
  89. package/dist/components/realtime/types.d.ts +5 -0
  90. package/dist/components/recipes/gridObservatory.d.ts +176 -0
  91. package/dist/components/recipes/recipeChrome.d.ts +24 -0
  92. package/dist/components/recipes/sequenceLayout.d.ts +139 -0
  93. package/dist/components/semiotic-recipes-core.d.ts +6 -2
  94. package/dist/components/server/serverChartConfigShared.d.ts +29 -0
  95. package/dist/components/server/serverChartConfigs.d.ts +2 -13
  96. package/dist/components/server/serverChartConfigsXY.d.ts +3 -0
  97. package/dist/components/server/serverGaugeOverlay.d.ts +28 -0
  98. package/dist/components/server/staticAnnotations.d.ts +3 -1
  99. package/dist/components/server/staticLegend.d.ts +7 -1
  100. package/dist/components/server/staticSVGChrome.d.ts +57 -0
  101. package/dist/components/stream/GeoPipelineStore.d.ts +2 -0
  102. package/dist/components/stream/GeoSVGOverlay.d.ts +2 -0
  103. package/dist/components/stream/SceneToSVG.d.ts +10 -8
  104. package/dist/components/stream/SceneToSVGGeo.d.ts +10 -0
  105. package/dist/components/stream/SceneToSVGNetwork.d.ts +12 -0
  106. package/dist/components/stream/SceneToSVGOrdinal.d.ts +12 -0
  107. package/dist/components/stream/canvasBackground.d.ts +7 -0
  108. package/dist/components/stream/networkFramePaint.d.ts +2 -0
  109. package/dist/components/stream/networkTypes.d.ts +2 -4
  110. package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +18 -2
  111. package/dist/components/stream/physics/physicsBodyCanvas.d.ts +7 -0
  112. package/dist/components/stream/physics/physicsPipelineEviction.d.ts +15 -0
  113. package/dist/components/stream/physics/physicsPipelineObservations.d.ts +1 -1
  114. package/dist/components/stream/physics/physicsPipelineQuiescence.d.ts +20 -0
  115. package/dist/components/stream/renderBackend.d.ts +14 -0
  116. package/dist/components/stream/sceneToSVGShared.d.ts +80 -0
  117. package/dist/components/stream/types.d.ts +4 -0
  118. package/dist/components/stream/useHydration.d.ts +7 -1
  119. package/dist/components/stream/xySceneBuilders/candlestickScene.d.ts +1 -1
  120. package/dist/components/types/legendTypes.d.ts +16 -3
  121. package/dist/forceLayoutWorker.js +1 -1
  122. package/dist/geo.min.js +1 -1
  123. package/dist/geo.module.min.js +1 -1
  124. package/dist/network.min.js +1 -1
  125. package/dist/network.module.min.js +1 -1
  126. package/dist/ordinal.min.js +1 -1
  127. package/dist/ordinal.module.min.js +1 -1
  128. package/dist/physics.min.js +1 -1
  129. package/dist/physics.module.min.js +1 -1
  130. package/dist/physicsWorker.js +1 -1
  131. package/dist/realtime.min.js +1 -1
  132. package/dist/realtime.module.min.js +1 -1
  133. package/dist/rough.min.js +1 -1
  134. package/dist/rough.module.min.js +1 -1
  135. package/dist/semiotic-ai-core.min.js +1 -1
  136. package/dist/semiotic-ai-core.module.min.js +1 -1
  137. package/dist/semiotic-ai.min.js +1 -1
  138. package/dist/semiotic-ai.module.min.js +1 -1
  139. package/dist/semiotic-experimental.min.js +1 -1
  140. package/dist/semiotic-experimental.module.min.js +1 -1
  141. package/dist/semiotic-realtime-core.min.js +1 -1
  142. package/dist/semiotic-realtime-core.module.min.js +1 -1
  143. package/dist/semiotic-recipes-core.d.ts +6 -2
  144. package/dist/semiotic-recipes-core.min.js +1 -1
  145. package/dist/semiotic-recipes-core.module.min.js +1 -1
  146. package/dist/semiotic-recipes.min.js +1 -1
  147. package/dist/semiotic-recipes.module.min.js +1 -1
  148. package/dist/semiotic-server-edge.min.js +1 -1
  149. package/dist/semiotic-server-edge.module.min.js +1 -1
  150. package/dist/semiotic-server-node.min.js +1 -1
  151. package/dist/semiotic-server-node.module.min.js +1 -1
  152. package/dist/semiotic-utils-core.min.js +1 -1
  153. package/dist/semiotic-utils-core.module.min.js +1 -1
  154. package/dist/semiotic-utils.min.js +1 -1
  155. package/dist/semiotic-utils.module.min.js +1 -1
  156. package/dist/semiotic-value.module.min.js +1 -1
  157. package/dist/semiotic.min.js +1 -1
  158. package/dist/semiotic.module.min.js +1 -1
  159. package/dist/server.min.js +1 -1
  160. package/dist/server.module.min.js +1 -1
  161. package/dist/xy.min.js +1 -1
  162. package/dist/xy.module.min.js +1 -1
  163. package/package.json +3 -2
  164. package/dist/chunk-chunk-255KDHW5.module.min.js +0 -1
  165. package/dist/chunk-chunk-27HVVXS6.module.min.js +0 -1
  166. package/dist/chunk-chunk-2UN3ANRN.module.min.js +0 -2
  167. package/dist/chunk-chunk-2VUEY5TH.module.min.js +0 -1
  168. package/dist/chunk-chunk-2WVCH4PL.module.min.js +0 -1
  169. package/dist/chunk-chunk-5WEFWNUW.module.min.js +0 -2
  170. package/dist/chunk-chunk-6F6GEAQU.module.min.js +0 -1
  171. package/dist/chunk-chunk-BHYTYMY2.module.min.js +0 -2
  172. package/dist/chunk-chunk-C6EJ4IOD.module.min.js +0 -2
  173. package/dist/chunk-chunk-CP3EN6KZ.module.min.js +0 -1
  174. package/dist/chunk-chunk-DNY43POY.module.min.js +0 -1
  175. package/dist/chunk-chunk-E7MIQX7D.module.min.js +0 -2
  176. package/dist/chunk-chunk-ES4DCG3L.module.min.js +0 -1
  177. package/dist/chunk-chunk-FAKO3RGQ.module.min.js +0 -2
  178. package/dist/chunk-chunk-H4PPRW6N.module.min.js +0 -1
  179. package/dist/chunk-chunk-IFYPMWKY.module.min.js +0 -1
  180. package/dist/chunk-chunk-J3ELI22J.module.min.js +0 -1
  181. package/dist/chunk-chunk-L6D3I3V7.module.min.js +0 -2
  182. package/dist/chunk-chunk-M337NY6L.module.min.js +0 -1
  183. package/dist/chunk-chunk-ODUZEEBH.module.min.js +0 -2
  184. package/dist/chunk-chunk-P6UBCMSQ.module.min.js +0 -2
  185. package/dist/chunk-chunk-QRIBHZYW.module.min.js +0 -1
  186. package/dist/chunk-chunk-RH5TSQPH.module.min.js +0 -1
  187. package/dist/chunk-chunk-STZFFTAN.module.min.js +0 -2
  188. package/dist/chunk-chunk-T27ZEV6A.module.min.js +0 -1
  189. package/dist/chunk-chunk-U3AGQ5EF.module.min.js +0 -2
  190. package/dist/chunk-chunk-W3DB2MN4.module.min.js +0 -2
  191. package/dist/chunk-chunk-WDIN4LRC.module.min.js +0 -1
  192. package/dist/chunk-chunk-XOYX77KF.module.min.js +0 -2
  193. package/dist/chunk-chunk-Z5KXAVQD.module.min.js +0 -2
  194. package/dist/chunk-chunk-ZCNBUZPL.module.min.js +0 -2
  195. package/dist/chunk-chunk-ZTNVDWAK.module.min.js +0 -2
@@ -1 +1 @@
1
- import{annotationBudget as e,annotationDensity as t,isNoteAnnotation as n}from"./chunk-chunk-U66USBWU.module.min.js";import{symbol as i,symbolCircle as o,symbolCross as s,symbolDiamond as r,symbolSquare as a,symbolStar as c,symbolTriangle as f,symbolWye as d}from"d3-shape";var l={circle:o,square:a,triangle:f,diamond:r,star:c,cross:s,wye:d},u=["circle","triangle","diamond","star","square","chevron","cross","wye"];function h(e,t,n){if(n)return n;const s=e??"circle";return"chevron"===s?function(e){const t=1.5*b(e),n=.92*t;return`M0,${-t}L${n},${(.78*t).toFixed(3)}L0,${(.28*t).toFixed(3)}L${-n},${(.78*t).toFixed(3)}Z`}(t):i(l[s]??o,Math.max(1,t))()??""}function b(e){return Math.sqrt(Math.max(1,e)/Math.PI)}var y=new Map;function p(e,t,n){if(!n&&"circle"===(e??"circle"))return b(t);const i=n?"p:"+n:`${e}:${Math.round(t)}`,o=y.get(i);if(null!=o)return o;const s=(n??h(e,t)).match(/-?\d*\.?\d+(?:e-?\d+)?/gi);let r=0;if(s)for(let e=0;s.length>e+1;e+=2){const t=+s[e],n=+s[e+1],i=Math.sqrt(t*t+n*n);i>r&&(r=i)}return r>0||(r=b(t)),y.size>512&&y.clear(),y.set(i,r),r}var m=[40,40],x=[.5,.5];function g(e,t){const[n,i]=e.viewBox??m,[o,s]=e.anchor??x,r=i>0?i:1,a=Math.max(0,t)/r,c=(n>0?n:r)*a,f=r*a;return{width:c,height:f,scale:a,offsetX:-o*c,offsetY:-s*f}}function v(e,t){const n=g(e,t),i=[[n.offsetX,n.offsetY],[n.offsetX+n.width,n.offsetY],[n.offsetX,n.offsetY+n.height],[n.offsetX+n.width,n.offsetY+n.height]];let o=0;for(const[e,t]of i){const n=Math.sqrt(e*e+t*t);n>o&&(o=n)}return o}function w(e,t,n,i){if("none"!==e)return"color"===e||null==e?t??i:"accent"===e?n:e}var M=null;function k(e){if("undefined"==typeof Path2D)return null;M||(M=new Map);const t=M.get(e);if(t)return t;const n=new Path2D(e);return M.size>1024&&M.clear(),M.set(e,n),n}function I(e,t,n=0,i="horizontal"){const[o,s]=e.viewBox??m,r=Math.min(1,Math.max(0,n)),a=Math.min(1,Math.max(0,t));return a>r?r>0||1>a?"vertical"===i?{x:0,y:s*(1-a),width:o,height:s*(a-r)}:{x:o*r,y:0,width:o*(a-r),height:s}:null:{x:0,y:0,width:0,height:0}}function A(e,t){const n=g(e,t);return{centerDx:n.offsetX+n.width/2,centerDy:n.offsetY+n.height/2,halfWidth:n.width/2,halfHeight:n.height/2,radius:Math.hypot(n.width,n.height)/2}}function S(e,t,n,i,o,s=e=>e){for(const r of t.parts){const t=k(r.d);if(!t)continue;const a=r.opacity??1,c=e.globalAlpha;1!==a&&(e.globalAlpha=c*a);const f=o?"none"===r.fill?void 0:o:w(r.fill,n,i);f&&(e.fillStyle=s(f),e.fill(t));const d=o?r.stroke&&"none"!==r.stroke?o:void 0:w(r.stroke??"none",n,i);d&&(e.strokeStyle=s(d),e.lineWidth=r.strokeWidth??1,e.lineCap=r.strokeLinecap??"butt",e.lineJoin=r.strokeLinejoin??"miter",e.stroke(t)),1!==a&&(e.globalAlpha=c)}}function V(e,t){const n=t.scales?.x??t.scales?.time;return n?null!=e.x?n(e.x):t.xAccessor&&null!=e[t.xAccessor]?n(e[t.xAccessor]):null:null}function $(e,t){const n=t.scales?.y??t.scales?.value;return n?null!=e.y?n(e.y):t.yAccessor&&null!=e[t.yAccessor]?n(e[t.yAccessor]):null:null}function T(e){return null==e?null:e+""}function N(e,t,n){return t.stickyPositionCache?.set(e,n),n}function P(e,t,n){const i=e.anchor||e.lifecycle?.anchor||"fixed";if("latest"===i){if(null!=e.pointId&&n.pointNodes&&n.pointNodes.length>0)for(let i=n.pointNodes.length-1;i>=0;i--){const o=n.pointNodes[i];if(o.pointId===e.pointId)return N(t,n,{x:o.x,y:o.y})}const i=function(e){const t=e.data;if(!t||0===t.length)return null;const n=t[t.length-1],i=e.scales?.x??e.scales?.time,o=e.scales?.y??e.scales?.value;if(!i||!o)return null;const s=n[e.xAccessor||"x"],r=n[e.yAccessor||"y"];return null==s||null==r?null:{x:i(s),y:o(r)}}(n);return i?N(t,n,i):null}if("semantic"===i){const i=function(e,t,n){const i=function(e){return T(e.provenance?.stableId??e.stableId)}(e);if(!i)return null;const o=n.pointNodes?.find(e=>T(e.pointId)===i);if(o)return N(t,n,{x:o.x,y:o.y});const s=n.data?.find(e=>function(e){return T(e.stableId??e.id??e.provenance?.stableId)}(e)===i);if(!s)return null;const r=V(s,n),a=$(s,n);return null==r||null==a?null:N(t,n,{x:r,y:a})}(e,t,n);if(i)return i}let o=null,s=null;if(null!=e.pointId&&n.pointNodes){const t=n.pointNodes.find(t=>t.pointId===e.pointId);t&&(o=t.x,s=t.y)}if(null!=o&&null!=s||(o=V(e,n),s=$(e,n)),null!=o&&null!=s)return N(t,n,{x:o,y:s});if("sticky"===i){const e=n.stickyPositionCache?.get(t);if(e)return e}return null}function W(e,t,n,i=50){return!(-i>e||e>(n.width||0)+i||-i>t||t>(n.height||0)+i)}var j=32,C=6,D=4,F=8,z=72;var L={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"};function X(e){if(!Y(e))return e;const t=("string"==typeof e.mobileText?e.mobileText:void 0)??("string"==typeof e.shortText?e.shortText:void 0);return!t||"string"!=typeof e.label&&null!=e.label?e:{...e,label:t}}function Y(e){return n(e)}function q(e,t){if(!e)return[];const n=Math.max(1,Math.floor(t/7)),i=e.split(/\s+/).filter(Boolean),o=[];let s="";for(const e of i)s&&s.length+e.length+1>n?(o.push(s),s=e):s=s?`${s} ${e}`:e;return s&&o.push(s),o}function B(e,t,n,i,o){const s=e+n,r=t+i;return Math.abs(n)>Math.abs(i)?{x:0>n?s-o.width-4:s+4,y:0>i?r-o.height:r,width:o.width,height:o.height}:{x:0>n?s-o.width:s,y:0>i?r-o.height-4:r+4,width:o.width,height:o.height}}function O(e,t){return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}function R(e,t){return Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))}function U(e,t,n,i,o,s,r,a){const c=O(e,r);let f=.4*Math.hypot(t.dx,t.dy)+80*function(e,t,n,i){const o=Math.max(0,i-e.x),s=Math.max(0,i-e.y);return(o+Math.max(0,e.x+e.width-(t-i)))*e.height+(s+Math.max(0,e.y+e.height-(n-i)))*e.width}(c,o,s,a);for(const e of n)f+=12*R(c,e);for(const e of i)f+=4*R(c,e);return f}function G(n){const{annotations:i,context:o,defaultOffset:s=j,notePadding:r=C,markPadding:a=D,edgePadding:c=F,preserveManualOffsets:f=!0,routeLongConnectors:d=!0,connectorThreshold:l=z,density:u,progressiveDisclosure:h=!1,redundantCues:b=!1,responsive:y,mobile:p,cohesion:m,audience:x}=n,g=o.width||0,v=o.height||0,w="object"==typeof p?p:{},M=w.breakpoint??480,k=!!p&&M>=g,I=k&&!1!==w.preferShortText?i.map(X):i,A=k&&!u?{maxAnnotations:w.maxAnnotations??("callout-list"===w.strategy?1:2),minVisible:w.minVisible??1}:u,S=h||k&&(!1!==w.progressiveDisclosure||"callout-list"===w.strategy),V=k&&!y?w.responsive??{minWidth:M}:y,$=k&&!m?w.cohesion:m;if(0===I.length||0>=g||0>=v)return I.slice();const T=[],N=function(e,t){return(e.pointNodes||[]).map(e=>{const n=Math.max(1,e.r||1)+t;return{x:e.x-n,y:e.y-n,width:2*n,height:2*n}})}(o,a);let W=!1;const R=I.map((e,t)=>{if(!Y(e))return e;const n=function(e,t,n){if("widget"===e.type&&"number"==typeof e.px&&"number"==typeof e.py)return{x:e.px,y:e.py};const i=e.pointId??e.nodeId;if(null!=i&&n.pointNodes){const e=n.pointNodes.find(e=>e.pointId===i);if(e)return{x:e.x,y:e.y}}const o=e.coordinates,s=n.scales?.geoProjection;if(Array.isArray(o)&&o.length>=2&&s){const e=o[0],t=o[1];if("number"==typeof e&&"number"==typeof t){const n=s([e,t]);if(n&&"number"==typeof n[0]&&"number"==typeof n[1])return{x:n[0],y:n[1]}}}return n.scales||"number"!=typeof e.x||"number"!=typeof e.y?P(e,t,n):{x:e.x,y:e.y}}(e,t,o);if(!n)return e;const i=function(e){if("widget"===e.type)return{width:"number"==typeof e.width?e.width:32,height:"number"==typeof e.height?e.height:32};const t="number"==typeof e.wrap?e.wrap:120,n=[...q("string"==typeof e.title?e.title:void 0,t),...q("string"==typeof e.label?e.label:void 0,t)],i=n.reduce((e,t)=>Math.max(e,t.length),0);return{width:Math.max(24,Math.min(t,7*i)+10),height:Math.max(18,16*n.length+6)}}(e);if(f&&("number"==typeof(a=e).dx||"number"==typeof a.dy)){const t=function(e){return"text"===e.type||"widget"===e.type?{dx:0,dy:0}:{dx:30,dy:-30}}(e);return T.push(O(B(n.x,n.y,"number"==typeof e.dx?e.dx:t.dx,"number"==typeof e.dy?e.dy:t.dy,i),r)),e}var a;let u=null,h=1/0;for(const e of function(e){const t=1.6*e;return[{dx:e,dy:-e},{dx:-e,dy:-e},{dx:e,dy:e},{dx:-e,dy:e},{dx:e,dy:0},{dx:-e,dy:0},{dx:0,dy:-e},{dx:0,dy:e},{dx:t,dy:-t},{dx:-t,dy:-t},{dx:t,dy:t},{dx:-t,dy:t}]}(s)){const t=U(B(n.x,n.y,e.dx,e.dy,i),e,T,N,g,v,r,c);h>t&&(u=e,h=t)}if(!u)return e;const b=O(B(n.x,n.y,u.dx,u.dy,i),r);T.push(b);const y=Math.hypot(u.dx,u.dy),p=d&&y>=l&&"text"!==e.type&&"widget"!==e.type?{...e.connector||{end:"arrow"},type:"curve"}:e.connector;return W=!0,{...e,dx:u.dx,dy:u.dy,...p?{connector:p}:{}}}),G=W?R:I.slice();let _=G;if(b){let e=!1;const t=G.map(t=>{const n=function(e){return"text"!==e.type||"string"!=typeof e.color||8>Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0)?e:{...e,_redundantConnector:!0}}(t);return n!==t&&(e=!0),n});_=e?t:G}{let e=!1;const t=_.map(t=>{if(!0!==t?.defensive)return t;const n=function(e){const t=e?.provenance;if(!t||"object"!=typeof t)return e;const n="string"==typeof t.source?L[t.source]??t.source:null,i="number"==typeof t.confidence&&Number.isFinite(t.confidence)?Math.round(100*Math.max(0,Math.min(1,t.confidence)))+"%":null;if(!n&&!i)return e;if(null!=e.label&&"string"!=typeof e.label)return e;const o=[n,i].filter(Boolean).join(" · "),s="string"==typeof e.label?e.label:"";return s.includes(`(${o})`)?e:{...e,label:s?`${s} (${o})`:`(${o})`}}(t);return n!==t&&(e=!0),n});_=e?t:_}const H=new Set;if(A){const n="object"==typeof A?A:{},i=function(e){if(!e)return 1;const t=function(e){const t=e?.familiarity;if(!t)return 3;const n=Object.values(t).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0===n.length?3:n.reduce((e,t)=>e+t,0)/n.length}(e);return t>2?4>t?1:.6:1.5}(x),o=1===i?n:{...n,maxAnnotations:Math.max(0,Math.round((n.maxAnnotations??e(g,v,n))*i))},{deferred:s}=t({annotations:_,width:g,height:v,...o});for(const e of s)H.add(e)}if(V&&("object"==typeof V&&"number"==typeof V.minWidth?V.minWidth:480)>=g)for(const e of _)Y(e)&&"secondary"===e.emphasis&&H.add(e);if(H.size>0)for(const e of _)!0===e?.defensive&&H.delete(e);let J;return J=0===H.size?_:S?_.map(e=>H.has(e)?{...e,_annotationDeferred:!0}:e):_.filter(e=>!H.has(e)),$?function(e,t){let n=!1;const i=e.map(e=>Y(e)?"blended"===e.cohesion||"layer"===e.cohesion?e:(n=!0,{...e,cohesion:t}):e);return n?i:e}(J,$):J}var _={data:"data",domain:"domain",layout:"layout","scene-geometry":"sceneGeometry","scene-style":"sceneStyle","data-paint":"dataPaint","interaction-paint":"interactionPaint",overlay:"overlay",accessibility:"accessibility",evidence:"evidence"};function H(e,t){const n={...e};for(const e of t)n[_[e]]++;return n}function J(e,t,n){const i=new Set(t);return{changeSet:{...e,...e.keys?{keys:[...e.keys]}:{}},changed:i,revisions:H(n,i)}}var Z=class{constructor(){this.revisions={data:0,domain:0,layout:0,sceneGeometry:0,sceneStyle:0,dataPaint:0,interactionPaint:0,overlay:0,accessibility:0,evidence:0},this.latest=J({kind:"initialize"},[],this.revisions),this.listeners=new Set}get last(){return this.latest}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}record(e,t){const n=J(e,t,this.revisions);this.revisions=n.revisions,this.latest=n;for(const e of[...this.listeners])e();return n}};function E(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}function K(e,t,n){const i=e=>e.toString(16).padStart(2,"0");return`#${i(e)}${i(t)}${i(n)}`}function Q(e){const t=e.map(E),n=t.length-1;return e=>{if(0>=e){const[e,n,i]=t[0];return K(e,n,i)}if(e>=1){const[e,i,o]=t[n];return K(e,i,o)}const i=e*n,o=Math.floor(i),s=i-o,[r,a,c]=t[o],[f,d,l]=t[o+1];return K(Math.round(r+(f-r)*s),Math.round(a+(d-a)*s),Math.round(c+(l-c)*s))}}var ee=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],te=["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],ne=["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],ie=Q(["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]),oe=Q(["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]),se=Q(["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]),re=Q(["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]),ae=Q(["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]),ce=Q(["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]),fe=Q(["#440154","#482878","#3e4989","#31688e","#26828e","#1f9e89","#35b779","#6ece58","#b5de2b","#fde725"]),de=Q(["#0d0887","#41049d","#6a00a8","#8f0da4","#b12a90","#cb4679","#e16462","#f1844b","#fca636","#fcce25","#f0f921"]),le=Q(["#000004","#160b39","#420a68","#6a176e","#932667","#bc3754","#dd513a","#f3771a","#fca50a","#f6d746","#fcffa4"]),ue=Q(["#000004","#140e36","#3b0f70","#641a80","#8c2981","#b73779","#de4968","#f7705c","#fe9f6d","#fecf92","#fcfdbf"]),he=Q(["#00224e","#123570","#3b496c","#575d6d","#707173","#8a8678","#a59c74","#c3b369","#e1cc55","#fee838","#ffea46"]),be=Q(["#23171b","#4a58dd","#3f9ee9","#46c7af","#7eed5a","#cdf134","#fbb91f","#f56918","#c52f06","#7a0403"]),ye={blues:ie,reds:oe,greens:se,viridis:fe,oranges:re,purples:ae,greys:ce,plasma:de,inferno:le,magma:ue,cividis:he,turbo:be};function pe(e){return e&&ye[e]||ie}Q(["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]),Q(["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]),Q(["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]),Q(["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]),Q(["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]),Q(["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]),Q(["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]);var me=()=>"undefined"!=typeof performance?performance.now():Date.now();function xe(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}}function ge(e,t){const n=e();return Number.isFinite(n)?n:t}var ve=class{constructor(e={}){this.randomSource=Math.random,this.subscribers=new Set,this.now=()=>this.advance(),this.random=()=>this.randomSource(),this.clock=e.clock??me,this.lastWallTime=ge(this.clock,0),this.logicalTime=this.lastWallTime,this.pausedValue=!0===e.paused,this.visibleValue=!1!==e.visible,this.setRandomSource(e.random,e.seed)}get isActive(){return!this.pausedValue&&this.visibleValue}get paused(){return this.pausedValue}get seed(){return this.seedValue}get visible(){return this.visibleValue}configure(e){this.setClock(e.clock),this.setRandomSource(e.random,e.seed)}setPaused(e){this.pausedValue!==e&&(this.advance(),this.pausedValue=e,this.emit())}setVisible(e){this.visibleValue!==e&&(this.advance(),this.visibleValue=e,this.emit())}snapshot(){return{now:this.now(),paused:this.pausedValue,seed:this.seedValue,visible:this.visibleValue}}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}advance(){const e=ge(this.clock,this.lastWallTime),t=Math.max(0,e-this.lastWallTime);return this.lastWallTime=e,this.isActive&&(this.logicalTime+=t),this.logicalTime}emit(){for(const e of this.subscribers)e()}setClock(e){const t=e??me;t!==this.clock&&(this.advance(),this.clock=t,this.lastWallTime=ge(t,this.lastWallTime))}setRandomSource(e,t){const n=function(e){return"number"==typeof e&&Number.isFinite(e)?Math.trunc(e):void 0}(t);e===this.randomInput&&n===this.seedValue||(this.randomInput=e,this.seedValue=n,this.randomSource=e??(void 0===n?Math.random:xe(n)))}};export{ee as schemeCategory10,te as schemeTableau10,ne as schemeSet3,fe as interpolateViridis,ye as SEQUENTIAL_INTERPOLATORS,pe as getSequentialInterpolator,u as SYMBOL_SEQUENCE,h as symbolPathString,b as symbolRadius,p as symbolExtent,Z as UpdateResultTracker,m as DEFAULT_GLYPH_VIEWBOX,x as DEFAULT_GLYPH_ANCHOR,g as glyphPlacement,v as glyphExtent,w as resolveGlyphPaint,I as glyphFractionClipRect,A as glyphHitGeometry,S as drawGlyphParts,V as resolveX,$ as resolveY,P as resolveAnchoredPosition,W as isInBounds,G as annotationLayout,xe as createSeededFrameRandom,ve as FrameRuntime};
1
+ import{annotationBudget as e,annotationDensity as t,isNoteAnnotation as n}from"./chunk-chunk-U66USBWU.module.min.js";import{symbol as i,symbolCircle as o,symbolCross as s,symbolDiamond as r,symbolSquare as a,symbolStar as c,symbolTriangle as f,symbolWye as d}from"d3-shape";var l={circle:o,square:a,triangle:f,diamond:r,star:c,cross:s,wye:d},u=["circle","triangle","diamond","star","square","chevron","cross","wye"];function h(e,t,n){if(n)return n;const s=e??"circle";return"chevron"===s?function(e){const t=1.5*b(e),n=.92*t;return`M0,${-t}L${n},${(.78*t).toFixed(3)}L0,${(.28*t).toFixed(3)}L${-n},${(.78*t).toFixed(3)}Z`}(t):i(l[s]??o,Math.max(1,t))()??""}function b(e){return Math.sqrt(Math.max(1,e)/Math.PI)}var y=new Map;function p(e,t,n){if(!n&&"circle"===(e??"circle"))return b(t);const i=n?"p:"+n:`${e}:${Math.round(t)}`,o=y.get(i);if(null!=o)return o;const s=(n??h(e,t)).match(/-?\d*\.?\d+(?:e-?\d+)?/gi);let r=0;if(s)for(let e=0;s.length>e+1;e+=2){const t=+s[e],n=+s[e+1],i=Math.sqrt(t*t+n*n);i>r&&(r=i)}return r>0||(r=b(t)),y.size>512&&y.clear(),y.set(i,r),r}var m=[40,40],x=[.5,.5];function g(e,t){const[n,i]=e.viewBox??m,[o,s]=e.anchor??x,r=i>0?i:1,a=Math.max(0,t)/r,c=(n>0?n:r)*a,f=r*a;return{width:c,height:f,scale:a,offsetX:-o*c,offsetY:-s*f}}function v(e,t){const n=g(e,t),i=[[n.offsetX,n.offsetY],[n.offsetX+n.width,n.offsetY],[n.offsetX,n.offsetY+n.height],[n.offsetX+n.width,n.offsetY+n.height]];let o=0;for(const[e,t]of i){const n=Math.sqrt(e*e+t*t);n>o&&(o=n)}return o}function w(e,t,n,i){if("none"!==e)return"color"===e||null==e?t??i:"accent"===e?n:e}var M=null;function k(e){if("undefined"==typeof Path2D)return null;M||(M=new Map);const t=M.get(e);if(t)return t;const n=new Path2D(e);return M.size>1024&&M.clear(),M.set(e,n),n}function I(e,t,n=0,i="horizontal"){const[o,s]=e.viewBox??m,r=Math.min(1,Math.max(0,n)),a=Math.min(1,Math.max(0,t));return a>r?r>0||1>a?"vertical"===i?{x:0,y:s*(1-a),width:o,height:s*(a-r)}:{x:o*r,y:0,width:o*(a-r),height:s}:null:{x:0,y:0,width:0,height:0}}function A(e,t){const n=g(e,t);return{centerDx:n.offsetX+n.width/2,centerDy:n.offsetY+n.height/2,halfWidth:n.width/2,halfHeight:n.height/2,radius:Math.hypot(n.width,n.height)/2}}function S(e,t,n,i,o,s=e=>e){for(const r of t.parts){const t=k(r.d);if(!t)continue;const a=r.opacity??1,c=e.globalAlpha;1!==a&&(e.globalAlpha=c*a);const f=o?"none"===r.fill?void 0:o:w(r.fill,n,i);f&&(e.fillStyle=s(f),e.fill(t));const d=o?r.stroke&&"none"!==r.stroke?o:void 0:w(r.stroke??"none",n,i);d&&(e.strokeStyle=s(d),e.lineWidth=r.strokeWidth??1,e.lineCap=r.strokeLinecap??"butt",e.lineJoin=r.strokeLinejoin??"miter",e.stroke(t)),1!==a&&(e.globalAlpha=c)}}function V(e,t){const n=t.scales?.x??t.scales?.time;return n?null!=e.x?n(e.x):t.xAccessor&&null!=e[t.xAccessor]?n(e[t.xAccessor]):null:null}function $(e,t){const n=t.scales?.y??t.scales?.value;return n?null!=e.y?n(e.y):t.yAccessor&&null!=e[t.yAccessor]?n(e[t.yAccessor]):null:null}function T(e){return null==e?null:e+""}function N(e,t,n){return t.stickyPositionCache?.set(e,n),n}function P(e,t,n){const i=e.anchor||e.lifecycle?.anchor||"fixed";if("latest"===i){if(null!=e.pointId&&n.pointNodes&&n.pointNodes.length>0)for(let i=n.pointNodes.length-1;i>=0;i--){const o=n.pointNodes[i];if(o.pointId===e.pointId)return N(t,n,{x:o.x,y:o.y})}const i=function(e){const t=e.data;if(!t||0===t.length)return null;const n=t[t.length-1],i=e.scales?.x??e.scales?.time,o=e.scales?.y??e.scales?.value;if(!i||!o)return null;const s=n[e.xAccessor||"x"],r=n[e.yAccessor||"y"];return null==s||null==r?null:{x:i(s),y:o(r)}}(n);return i?N(t,n,i):null}if("semantic"===i){const i=function(e,t,n){const i=function(e){return T(e.provenance?.stableId??e.stableId)}(e);if(!i)return null;const o=n.pointNodes?.find(e=>T(e.pointId)===i);if(o)return N(t,n,{x:o.x,y:o.y});const s=n.data?.find(e=>function(e){return T(e.stableId??e.id??e.provenance?.stableId)}(e)===i);if(!s)return null;const r=V(s,n),a=$(s,n);return null==r||null==a?null:N(t,n,{x:r,y:a})}(e,t,n);if(i)return i}let o=null,s=null;if(null!=e.pointId&&n.pointNodes){const t=n.pointNodes.find(t=>t.pointId===e.pointId);t&&(o=t.x,s=t.y)}if(null!=o&&null!=s||(o=V(e,n),s=$(e,n)),null!=o&&null!=s)return N(t,n,{x:o,y:s});if("sticky"===i){const e=n.stickyPositionCache?.get(t);if(e)return e}return null}function W(e,t,n,i=50){return!(-i>e||e>(n.width||0)+i||-i>t||t>(n.height||0)+i)}var j=32,C=6,D=4,F=8,z=72;var L={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"};function X(e){if(!Y(e))return e;const t=("string"==typeof e.mobileText?e.mobileText:void 0)??("string"==typeof e.shortText?e.shortText:void 0);return!t||"string"!=typeof e.label&&null!=e.label?e:{...e,label:t}}function Y(e){return n(e)}function q(e,t){if(!e)return[];const n=Math.max(1,Math.floor(t/7)),i=e.split(/\s+/).filter(Boolean),o=[];let s="";for(const e of i)s&&s.length+e.length+1>n?(o.push(s),s=e):s=s?`${s} ${e}`:e;return s&&o.push(s),o}function B(e,t,n,i,o){const s=e+n,r=t+i;return Math.abs(n)>Math.abs(i)?{x:0>n?s-o.width-4:s+4,y:0>i?r-o.height:r,width:o.width,height:o.height}:{x:0>n?s-o.width:s,y:0>i?r-o.height-4:r+4,width:o.width,height:o.height}}function O(e,t){return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}function R(e,t){return Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))}function U(e,t,n,i,o,s,r,a){const c=O(e,r);let f=.4*Math.hypot(t.dx,t.dy)+80*function(e,t,n,i){const o=Math.max(0,i-e.x),s=Math.max(0,i-e.y);return(o+Math.max(0,e.x+e.width-(t-i)))*e.height+(s+Math.max(0,e.y+e.height-(n-i)))*e.width}(c,o,s,a);for(const e of n)f+=12*R(c,e);for(const e of i)f+=4*R(c,e);return f}function G(n){const{annotations:i,context:o,defaultOffset:s=j,notePadding:r=C,markPadding:a=D,edgePadding:c=F,preserveManualOffsets:f=!0,routeLongConnectors:d=!0,connectorThreshold:l=z,density:u,progressiveDisclosure:h=!1,redundantCues:b=!1,responsive:y,mobile:p,cohesion:m,audience:x}=n,g=o.width||0,v=o.height||0,w="object"==typeof p?p:{},M=w.breakpoint??480,k=!!p&&M>=g,I=k&&!1!==w.preferShortText?i.map(X):i,A=k&&!u?{maxAnnotations:w.maxAnnotations??("callout-list"===w.strategy?1:2),minVisible:w.minVisible??1}:u,S=h||k&&(!1!==w.progressiveDisclosure||"callout-list"===w.strategy),V=k&&!y?w.responsive??{minWidth:M}:y,$=k&&!m?w.cohesion:m;if(0===I.length||0>=g||0>=v)return I.slice();const T=[],N=function(e,t){return(e.pointNodes||[]).map(e=>{const n=Math.max(1,e.r||1)+t;return{x:e.x-n,y:e.y-n,width:2*n,height:2*n}})}(o,a);let W=!1;const R=I.map((e,t)=>{if(!Y(e))return e;const n=function(e,t,n){if("widget"===e.type&&"number"==typeof e.px&&"number"==typeof e.py)return{x:e.px,y:e.py};const i=e.pointId??e.nodeId;if(null!=i&&n.pointNodes){const e=n.pointNodes.find(e=>e.pointId===i);if(e)return{x:e.x,y:e.y}}const o=e.coordinates,s=n.scales?.geoProjection;if(Array.isArray(o)&&o.length>=2&&s){const e=o[0],t=o[1];if("number"==typeof e&&"number"==typeof t){const n=s([e,t]);if(n&&"number"==typeof n[0]&&"number"==typeof n[1])return{x:n[0],y:n[1]}}}return n.scales||"number"!=typeof e.x||"number"!=typeof e.y?P(e,t,n):{x:e.x,y:e.y}}(e,t,o);if(!n)return e;const i=function(e){if("widget"===e.type)return{width:"number"==typeof e.width?e.width:32,height:"number"==typeof e.height?e.height:32};const t="number"==typeof e.wrap?e.wrap:120,n=[...q("string"==typeof e.title?e.title:void 0,t),...q("string"==typeof e.label?e.label:void 0,t)],i=n.reduce((e,t)=>Math.max(e,t.length),0);return{width:Math.max(24,Math.min(t,7*i)+10),height:Math.max(18,16*n.length+6)}}(e);if(f&&("number"==typeof(a=e).dx||"number"==typeof a.dy)){const t=function(e){return"text"===e.type||"widget"===e.type?{dx:0,dy:0}:{dx:30,dy:-30}}(e);return T.push(O(B(n.x,n.y,"number"==typeof e.dx?e.dx:t.dx,"number"==typeof e.dy?e.dy:t.dy,i),r)),e}var a;let u=null,h=1/0;for(const e of function(e){const t=1.6*e;return[{dx:e,dy:-e},{dx:-e,dy:-e},{dx:e,dy:e},{dx:-e,dy:e},{dx:e,dy:0},{dx:-e,dy:0},{dx:0,dy:-e},{dx:0,dy:e},{dx:t,dy:-t},{dx:-t,dy:-t},{dx:t,dy:t},{dx:-t,dy:t}]}(s)){const t=U(B(n.x,n.y,e.dx,e.dy,i),e,T,N,g,v,r,c);h>t&&(u=e,h=t)}if(!u)return e;const b=O(B(n.x,n.y,u.dx,u.dy,i),r);T.push(b);const y=Math.hypot(u.dx,u.dy),p=d&&y>=l&&"text"!==e.type&&"widget"!==e.type?{...e.connector||{end:"arrow"},type:"curve"}:e.connector;return W=!0,{...e,dx:u.dx,dy:u.dy,...p?{connector:p}:{}}}),G=W?R:I.slice();let _=G;if(b){let e=!1;const t=G.map(t=>{const n=function(e){return"text"!==e.type||"string"!=typeof e.color||8>Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0)?e:{...e,_redundantConnector:!0}}(t);return n!==t&&(e=!0),n});_=e?t:G}{let e=!1;const t=_.map(t=>{if(!0!==t?.defensive)return t;const n=function(e){const t=e?.provenance;if(!t||"object"!=typeof t)return e;const n="string"==typeof t.source?L[t.source]??t.source:null,i="number"==typeof t.confidence&&Number.isFinite(t.confidence)?Math.round(100*Math.max(0,Math.min(1,t.confidence)))+"%":null;if(!n&&!i)return e;if(null!=e.label&&"string"!=typeof e.label)return e;const o=[n,i].filter(Boolean).join(" · "),s="string"==typeof e.label?e.label:"";return s.includes(`(${o})`)?e:{...e,label:s?`${s} (${o})`:`(${o})`}}(t);return n!==t&&(e=!0),n});_=e?t:_}const H=new Set;if(A){const n="object"==typeof A?A:{},i=function(e){if(!e)return 1;const t=function(e){const t=e?.familiarity;if(!t)return 3;const n=Object.values(t).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0===n.length?3:n.reduce((e,t)=>e+t,0)/n.length}(e);return t>2?4>t?1:.6:1.5}(x),o=1===i?n:{...n,maxAnnotations:Math.max(0,Math.round((n.maxAnnotations??e(g,v,n))*i))},{deferred:s}=t({annotations:_,width:g,height:v,...o});for(const e of s)H.add(e)}if(V&&("object"==typeof V&&"number"==typeof V.minWidth?V.minWidth:480)>=g)for(const e of _)Y(e)&&"secondary"===e.emphasis&&H.add(e);if(H.size>0)for(const e of _)!0===e?.defensive&&H.delete(e);let J;return J=0===H.size?_:S?_.map(e=>H.has(e)?{...e,_annotationDeferred:!0}:e):_.filter(e=>!H.has(e)),$?function(e,t){let n=!1;const i=e.map(e=>Y(e)?"blended"===e.cohesion||"layer"===e.cohesion?e:(n=!0,{...e,cohesion:t}):e);return n?i:e}(J,$):J}var _={data:"data",domain:"domain",layout:"layout","scene-geometry":"sceneGeometry","scene-style":"sceneStyle","data-paint":"dataPaint","interaction-paint":"interactionPaint",overlay:"overlay",accessibility:"accessibility",evidence:"evidence"};function H(e,t){const n={...e};for(const e of t)n[_[e]]++;return n}function J(e,t,n){const i=new Set(t);return{changeSet:{...e,...e.keys?{keys:[...e.keys]}:{}},changed:i,revisions:H(n,i)}}var Z=class{constructor(){this.revisions={data:0,domain:0,layout:0,sceneGeometry:0,sceneStyle:0,dataPaint:0,interactionPaint:0,overlay:0,accessibility:0,evidence:0},this.latest=J({kind:"initialize"},[],this.revisions),this.listeners=new Set}get last(){return this.latest}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}record(e,t){const n=J(e,t,this.revisions);this.revisions=n.revisions,this.latest=n;for(const e of[...this.listeners])e();return n}};function E(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}function K(e,t,n){const i=e=>e.toString(16).padStart(2,"0");return`#${i(e)}${i(t)}${i(n)}`}function Q(e){const t=e.map(E),n=t.length-1;return e=>{if(0>=e){const[e,n,i]=t[0];return K(e,n,i)}if(e>=1){const[e,i,o]=t[n];return K(e,i,o)}const i=e*n,o=Math.floor(i),s=i-o,[r,a,c]=t[o],[f,d,l]=t[o+1];return K(Math.round(r+(f-r)*s),Math.round(a+(d-a)*s),Math.round(c+(l-c)*s))}}var ee=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],te=["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],ne=["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],ie=Q(["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]),oe=Q(["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]),se=Q(["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]),re=Q(["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]),ae=Q(["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]),ce=Q(["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]),fe=Q(["#440154","#482878","#3e4989","#31688e","#26828e","#1f9e89","#35b779","#6ece58","#b5de2b","#fde725"]),de=Q(["#0d0887","#41049d","#6a00a8","#8f0da4","#b12a90","#cb4679","#e16462","#f1844b","#fca636","#fcce25","#f0f921"]),le=Q(["#000004","#160b39","#420a68","#6a176e","#932667","#bc3754","#dd513a","#f3771a","#fca50a","#f6d746","#fcffa4"]),ue=Q(["#000004","#140e36","#3b0f70","#641a80","#8c2981","#b73779","#de4968","#f7705c","#fe9f6d","#fecf92","#fcfdbf"]),he=Q(["#00224e","#123570","#3b496c","#575d6d","#707173","#8a8678","#a59c74","#c3b369","#e1cc55","#fee838","#ffea46"]),be=Q(["#23171b","#4a58dd","#3f9ee9","#46c7af","#7eed5a","#cdf134","#fbb91f","#f56918","#c52f06","#7a0403"]),ye={blues:ie,reds:oe,greens:se,viridis:fe,oranges:re,purples:ae,greys:ce,plasma:de,inferno:le,magma:ue,cividis:he,turbo:be};function pe(e){return e&&ye[e]||ie}var me=Q(["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]),xe=Q(["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]),ge=Q(["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]),ve=Q(["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]),we=Q(["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]),Me=Q(["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]),ke=Q(["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]),Ie=()=>"undefined"!=typeof performance?performance.now():Date.now();function Ae(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}}function Se(e,t){const n=e();return Number.isFinite(n)?n:t}var Ve=class{constructor(e={}){this.randomSource=Math.random,this.subscribers=new Set,this.now=()=>this.advance(),this.random=()=>this.randomSource(),this.clock=e.clock??Ie,this.lastWallTime=Se(this.clock,0),this.logicalTime=this.lastWallTime,this.pausedValue=!0===e.paused,this.visibleValue=!1!==e.visible,this.setRandomSource(e.random,e.seed)}get isActive(){return!this.pausedValue&&this.visibleValue}get paused(){return this.pausedValue}get seed(){return this.seedValue}get visible(){return this.visibleValue}configure(e){this.setClock(e.clock),this.setRandomSource(e.random,e.seed)}setPaused(e){this.pausedValue!==e&&(this.advance(),this.pausedValue=e,this.emit())}setVisible(e){this.visibleValue!==e&&(this.advance(),this.visibleValue=e,this.emit())}snapshot(){return{now:this.now(),paused:this.pausedValue,seed:this.seedValue,visible:this.visibleValue}}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}advance(){const e=Se(this.clock,this.lastWallTime),t=Math.max(0,e-this.lastWallTime);return this.lastWallTime=e,this.isActive&&(this.logicalTime+=t),this.logicalTime}emit(){for(const e of this.subscribers)e()}setClock(e){const t=e??Ie;t!==this.clock&&(this.advance(),this.clock=t,this.lastWallTime=Se(t,this.lastWallTime))}setRandomSource(e,t){const n=function(e){return"number"==typeof e&&Number.isFinite(e)?Math.trunc(e):void 0}(t);e===this.randomInput&&n===this.seedValue||(this.randomInput=e,this.seedValue=n,this.randomSource=e??(void 0===n?Math.random:Ae(n)))}};export{ee as schemeCategory10,te as schemeTableau10,ne as schemeSet3,fe as interpolateViridis,ye as SEQUENTIAL_INTERPOLATORS,pe as getSequentialInterpolator,me as interpolateRdBu,xe as interpolatePiYG,ge as interpolatePRGn,ve as interpolateBrBG,we as interpolateRdYlBu,Me as interpolateRdYlGn,ke as interpolateSpectral,u as SYMBOL_SEQUENCE,h as symbolPathString,b as symbolRadius,p as symbolExtent,Z as UpdateResultTracker,m as DEFAULT_GLYPH_VIEWBOX,x as DEFAULT_GLYPH_ANCHOR,g as glyphPlacement,v as glyphExtent,w as resolveGlyphPaint,I as glyphFractionClipRect,A as glyphHitGeometry,S as drawGlyphParts,V as resolveX,$ as resolveY,P as resolveAnchoredPosition,W as isInBounds,G as annotationLayout,Ae as createSeededFrameRandom,Ve as FrameRuntime};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{buildColorStopGradient as t,resolveCSSColor as e,resolveCanvasFill as l,resolveCurveFactory as n}from"./chunk-chunk-ODUZEEBH.module.min.js";import{line as o}from"d3-shape";function i(t,e,l){let n=l;for(const l of e)"lesser"===l.thresholdType?l.value>t&&(n=l.color):t>l.value&&(n=l.color);return n}function s(t,e,l,n,o,i){if(2>e.length)return;const s=[0];for(let t=1;e.length>t;t++){const l=e[t][0]-e[t-1][0],n=e[t][1]-e[t-1][1];s.push(s[t-1]+Math.sqrt(l*l+n*n))}const a=s[s.length-1];if(0===a)return;const h=Math.min(.2*a,40);t.strokeStyle=l,t.lineWidth=n,t.lineCap=i;for(let l=0;e.length-1>l;l++){const n=(s[l]+s[l+1])/2;let i=o;h>n&&(i*=n/h),h>a-n&&(i*=(a-n)/h),t.globalAlpha=Math.max(0,i),t.beginPath(),t.moveTo(e[l][0],e[l][1]),t.lineTo(e[l+1][0],e[l+1][1]),t.stroke()}}var a=(a,h,r,p)=>{const c=h.filter(t=>"line"===t.type);for(const h of c){if(2>h.path.length)continue;const r=h._introClipFraction;void 0!==r&&1>r&&(a.save(),a.beginPath(),a.rect(0,0,p.width*r,p.height),a.clip());const c=h.style.stroke||"#007bff",f=e(a,c)||c,u=h.style.strokeWidth||2,y=h.colorThresholds,g=h.rawValues;if(a.setLineDash(h.style.strokeDasharray?h.style.strokeDasharray.split(/[\s,]+/).map(Number):[]),null!=h.style.opacity&&(a.globalAlpha=h.style.opacity),a.lineWidth=u,a.lineCap=h.style.strokeLinecap||"butt",h.style._edgeFade){s(a,h.path,f,u,h.style.opacity??1,h.style.strokeLinecap||"butt"),a.globalAlpha=1,a.setLineDash([]),a.lineCap="butt";continue}const k=n(h.curve),b=y&&y.length>0&&g&&g.length===h.path.length,d=h._decayOpacities;if(d&&d.length===h.path.length&&!b){a.strokeStyle=f;const t=h.style.opacity??1;for(let e=0;h.path.length-1>e;e++)a.globalAlpha=.5*(d[e]+d[e+1])*t,a.beginPath(),a.moveTo(h.path[e][0],h.path[e][1]),a.lineTo(h.path[e+1][0],h.path[e+1][1]),a.stroke()}else if(b){let t=function(t,e,l){a.beginPath(),a.strokeStyle=t,a.moveTo(e,l),r=!0},e=function(){r&&(a.stroke(),r=!1)},l=null,n=null,o=null,s=null,r=!1;for(let r=0;h.path.length>r;r++){const[p,c]=h.path[r],u=g[r],k=i(u,y,f);if(null!==l&&null!==s&&null!==o){if(k===s)a.lineTo(p,c);else{const s=[];for(const t of y){const e=t.value;(o>e||e>u)&&(e>o||u>e)||o===e||u===e||s.push({t:(e-o)/(u-o)})}s.sort((t,e)=>t.t-e.t);for(const h of s){const s=l+(p-l)*h.t,r=n+(c-n)*h.t,g=i(o+(u-o)*Math.min(h.t+1e-4,1),y,f);a.lineTo(s,r),e(),t(g,s,r)}a.lineTo(p,c)}l=p,n=c,o=u,s=k}else t(k,p,c),l=p,n=c,o=u,s=k}e()}else{a.beginPath();const e=h.strokeGradient&&h.path.length>=2?t(a,h.strokeGradient,h.path[0][0],0,h.path[h.path.length-1][0],0):null;if(a.strokeStyle=e||f,k)o().x(t=>t[0]).y(t=>t[1]).curve(k).context(a)(h.path);else{const[t,e]=h.path[0];a.moveTo(t,e);for(let t=1;h.path.length>t;t++)a.lineTo(h.path[t][0],h.path[t][1])}a.stroke()}if(h.style.fill&&h.style.fillOpacity&&h.style.fillOpacity>0){if(a.beginPath(),a.globalAlpha=h.style.fillOpacity,a.fillStyle=l(a,h.style.fill,h.style.fill),k&&!b)o().x(t=>t[0]).y(t=>t[1]).curve(k).context(a)(h.path);else{const[t,e]=h.path[0];a.moveTo(t,e);for(let t=1;h.path.length>t;t++)a.lineTo(h.path[t][0],h.path[t][1])}const t=h.path[0][0];a.lineTo(h.path[h.path.length-1][0],p.height),a.lineTo(t,p.height),a.closePath(),a.fill()}void 0!==r&&1>r&&a.restore(),a.globalAlpha=1,a.setLineDash([]),a.lineCap="butt"}};function h(t){if(!t)return null;if("heatcell"===t.type)return t.fill||null;if("candlestick"===t.type)return t.isUp?t.upColor:t.downColor;const{style:e}=t;if(!e)return null;const l="string"==typeof e.fill?e.fill:null;return"line"===t.type||"area"===t.type?e.stroke||l||null:l||e.stroke||null}export{a as lineCanvasRenderer,h as resolveNodeColor};
2
+ import{buildColorStopGradient as t,resolveCSSColor as e,resolveCanvasFill as l,resolveCurveFactory as n}from"./chunk-chunk-BFHUYEOS.module.min.js";import{line as o}from"d3-shape";function i(t,e,l){let n=l;for(const l of e)"lesser"===l.thresholdType?l.value>t&&(n=l.color):t>l.value&&(n=l.color);return n}function s(t,e,l,n,o,i){if(2>e.length)return;const s=[0];for(let t=1;e.length>t;t++){const l=e[t][0]-e[t-1][0],n=e[t][1]-e[t-1][1];s.push(s[t-1]+Math.sqrt(l*l+n*n))}const a=s[s.length-1];if(0===a)return;const h=Math.min(.2*a,40);t.strokeStyle=l,t.lineWidth=n,t.lineCap=i;for(let l=0;e.length-1>l;l++){const n=(s[l]+s[l+1])/2;let i=o;h>n&&(i*=n/h),h>a-n&&(i*=(a-n)/h),t.globalAlpha=Math.max(0,i),t.beginPath(),t.moveTo(e[l][0],e[l][1]),t.lineTo(e[l+1][0],e[l+1][1]),t.stroke()}}var a=(a,h,r,p)=>{const c=h.filter(t=>"line"===t.type);for(const h of c){if(2>h.path.length)continue;const r=h._introClipFraction;void 0!==r&&1>r&&(a.save(),a.beginPath(),a.rect(0,0,p.width*r,p.height),a.clip());const c=h.style.stroke||"#007bff",f=e(a,c)||c,u=h.style.strokeWidth||2,y=h.colorThresholds,g=h.rawValues;if(a.setLineDash(h.style.strokeDasharray?h.style.strokeDasharray.split(/[\s,]+/).map(Number):[]),null!=h.style.opacity&&(a.globalAlpha=h.style.opacity),a.lineWidth=u,a.lineCap=h.style.strokeLinecap||"butt",h.style._edgeFade){s(a,h.path,f,u,h.style.opacity??1,h.style.strokeLinecap||"butt"),a.globalAlpha=1,a.setLineDash([]),a.lineCap="butt";continue}const k=n(h.curve),b=y&&y.length>0&&g&&g.length===h.path.length,d=h._decayOpacities;if(d&&d.length===h.path.length&&!b){a.strokeStyle=f;const t=h.style.opacity??1;for(let e=0;h.path.length-1>e;e++)a.globalAlpha=.5*(d[e]+d[e+1])*t,a.beginPath(),a.moveTo(h.path[e][0],h.path[e][1]),a.lineTo(h.path[e+1][0],h.path[e+1][1]),a.stroke()}else if(b){let t=function(t,e,l){a.beginPath(),a.strokeStyle=t,a.moveTo(e,l),r=!0},e=function(){r&&(a.stroke(),r=!1)},l=null,n=null,o=null,s=null,r=!1;for(let r=0;h.path.length>r;r++){const[p,c]=h.path[r],u=g[r],k=i(u,y,f);if(null!==l&&null!==s&&null!==o){if(k===s)a.lineTo(p,c);else{const s=[];for(const t of y){const e=t.value;(o>e||e>u)&&(e>o||u>e)||o===e||u===e||s.push({t:(e-o)/(u-o)})}s.sort((t,e)=>t.t-e.t);for(const h of s){const s=l+(p-l)*h.t,r=n+(c-n)*h.t,g=i(o+(u-o)*Math.min(h.t+1e-4,1),y,f);a.lineTo(s,r),e(),t(g,s,r)}a.lineTo(p,c)}l=p,n=c,o=u,s=k}else t(k,p,c),l=p,n=c,o=u,s=k}e()}else{a.beginPath();const e=h.strokeGradient&&h.path.length>=2?t(a,h.strokeGradient,h.path[0][0],0,h.path[h.path.length-1][0],0):null;if(a.strokeStyle=e||f,k)o().x(t=>t[0]).y(t=>t[1]).curve(k).context(a)(h.path);else{const[t,e]=h.path[0];a.moveTo(t,e);for(let t=1;h.path.length>t;t++)a.lineTo(h.path[t][0],h.path[t][1])}a.stroke()}if(h.style.fill&&h.style.fillOpacity&&h.style.fillOpacity>0){if(a.beginPath(),a.globalAlpha=h.style.fillOpacity,a.fillStyle=l(a,h.style.fill,h.style.fill),k&&!b)o().x(t=>t[0]).y(t=>t[1]).curve(k).context(a)(h.path);else{const[t,e]=h.path[0];a.moveTo(t,e);for(let t=1;h.path.length>t;t++)a.lineTo(h.path[t][0],h.path[t][1])}const t=h.path[0][0];a.lineTo(h.path[h.path.length-1][0],p.height),a.lineTo(t,p.height),a.closePath(),a.fill()}void 0!==r&&1>r&&a.restore(),a.globalAlpha=1,a.setLineDash([]),a.lineCap="butt"}};function h(t){if(!t)return null;if("heatcell"===t.type)return t.fill||null;if("candlestick"===t.type)return t.isUp?t.upColor:t.downColor;const{style:e}=t;if(!e)return null;const l="string"==typeof e.fill?e.fill:null;return"line"===t.type||"area"===t.type?e.stroke||l||null:l||e.stroke||null}export{a as lineCanvasRenderer,h as resolveNodeColor};
@@ -1 +1 @@
1
- var t=class{constructor(t){if(this._capacity=t,this.head=0,this._size=0,1>t)throw Error("RingBuffer capacity must be at least 1");this.buffer=Array(t)}push(t){let i;return this._size===this._capacity?i=this.buffer[this.head]:this._size++,this.buffer[this.head]=t,this.head=(this.head+1)%this._capacity,i}pushMany(t){const i=[];for(const s of t){const t=this.push(s);void 0!==t&&i.push(t)}return i}get(t){if(t>=0&&this._size>t)return this.buffer[(this.head-this._size+t+this._capacity)%this._capacity]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let t=0;return{next:()=>this._size>t?{done:!1,value:this.get(t++)}:{done:!0,value:void 0}}}forEach(t){const i=(this.head-this._size+this._capacity)%this._capacity;for(let s=0;this._size>s;s++)t(this.buffer[(i+s)%this._capacity],s)}toArray(){const t=Array(this._size),i=(this.head-this._size+this._capacity)%this._capacity;for(let s=0;this._size>s;s++)t[s]=this.buffer[(i+s)%this._capacity];return t}resize(t){if(1>t)throw Error("RingBuffer capacity must be at least 1");const i=this.toArray();let s=0,h=[];i.length>t&&(s=i.length-t,h=i.slice(0,s)),this._capacity=t,this.buffer=Array(t),this.head=0,this._size=0;for(let t=s;i.length>t;t++)this.push(i[t]);return h}update(t,i){const s=[],h=(this.head-this._size+this._capacity)%this._capacity;for(let e=0;this._size>e;e++){const r=(h+e)%this._capacity,a=this.buffer[r];if(t(a)){let t;t="object"!=typeof a||null===a?a:Array.isArray(a)?[...a]:{...a},s.push(t),this.buffer[r]=i(a)}}return s}remove(t){const i=[],s=[];if(this.forEach(h=>{t(h)?s.push(h):i.push(h)}),0===s.length)return s;this.buffer=Array(this._capacity),this.head=0,this._size=0;for(const t of i)this.push(t);return s}clear(){this.buffer=Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}},i=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(t){Number.isFinite(t)&&(this._min>t&&(this._min=t),t>this._max&&(this._max=t))}evict(t){t!==this._min&&t!==this._max||(this._dirty=!0)}recalculate(t,i){this._min=1/0,this._max=-1/0;for(const s of t){const t=i?i(s):s;Number.isFinite(t)&&(this._min>t&&(this._min=t),t>this._max&&(this._max=t))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}};export{t as RingBuffer,i as IncrementalExtent};
1
+ var t=class{constructor(t){if(this._capacity=t,this.head=0,this._size=0,1>t)throw Error("RingBuffer capacity must be at least 1");this.buffer=Array(t)}push(t){let i;return this._size===this._capacity?i=this.buffer[this.head]:this._size++,this.buffer[this.head]=t,this.head=(this.head+1)%this._capacity,i}pushMany(t){const i=[];for(const s of t){const t=this.push(s);void 0!==t&&i.push(t)}return i}get(t){if(t>=0&&this._size>t)return this.buffer[(this.head-this._size+t+this._capacity)%this._capacity]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let t=0;return{next:()=>this._size>t?{done:!1,value:this.get(t++)}:{done:!0,value:void 0}}}forEach(t){const i=(this.head-this._size+this._capacity)%this._capacity;for(let s=0;this._size>s;s++)t(this.buffer[(i+s)%this._capacity],s)}toArray(){const t=Array(this._size),i=(this.head-this._size+this._capacity)%this._capacity;for(let s=0;this._size>s;s++)t[s]=this.buffer[(i+s)%this._capacity];return t}resize(t){if(1>t)throw Error("RingBuffer capacity must be at least 1");const i=this.toArray();let s=0,e=[];i.length>t&&(s=i.length-t,e=i.slice(0,s)),this._capacity=t,this.buffer=Array(t),this.head=0,this._size=0;for(let t=s;i.length>t;t++)this.push(i[t]);return e}update(t,i){const s=[],e=(this.head-this._size+this._capacity)%this._capacity;for(let h=0;this._size>h;h++){const r=(e+h)%this._capacity,a=this.buffer[r];if(t(a)){let t;t="object"!=typeof a||null===a?a:Array.isArray(a)?[...a]:{...a},s.push(t),this.buffer[r]=i(a)}}return s}remove(t){const i=[],s=[];if(this.forEach(e=>{t(e)?s.push(e):i.push(e)}),0===s.length)return s;this.buffer=Array(this._capacity),this.head=0,this._size=0;for(const t of i)this.push(t);return s}clear(){this.buffer=Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}},i=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(t){Number.isFinite(t)&&(this._min>t&&(this._min=t),t>this._max&&(this._max=t))}evict(t){t!==this._min&&t!==this._max||(this._dirty=!0)}recalculate(t,i){this._min=1/0,this._max=-1/0;for(const s of t){const t=i?i(s):s;Number.isFinite(t)&&(this._min>t&&(this._min=t),t>this._max&&(this._max=t))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}};function s(t,i,s){return s.x>t||t>s.x+s.w||s.y>i||i>s.y+s.h?{hit:!1,cx:0,cy:0}:{hit:!0,cx:s.x+s.w/2,cy:s.y+s.h/2}}function e(t,i=30){return Math.max((t??4)+5,12,i)}function h(t){return t instanceof Date?t:"number"==typeof t&&t>1e9?new Date(t):null}function r(t,i){const s=h(t);if(!s)return!1;const e=h(i);return!e||s.getFullYear()!==e.getFullYear()||s.getMonth()!==e.getMonth()}function a(t){let i=t%(2*Math.PI);return 0>i&&(i+=2*Math.PI),i}export{t as RingBuffer,i as IncrementalExtent,s as hitTestRect,e as getHitRadius,r as isTimeLandmark,a as normalizeAngle};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{buildRegressionAnnotation as e}from"./chunk-chunk-YCQYG6J5.module.min.js";import{validateArrayData as t}from"./chunk-chunk-JCG72SGW.module.min.js";import{mergeShapeStyle as o,normalizePartialMargin as n,useChartSetup as i,useCustomChartSetup as r,useFrameImperativeHandle as a,useResolvedSelection as s}from"./chunk-chunk-PLIDPQNG.module.min.js";import{StreamXYFrame_default as l}from"./chunk-chunk-B3DRZPBK.module.min.js";import{accessorName as c,bandTooltipFields as h,buildBaseMetadataProps as d,buildCustomBehaviorProps as m,buildDefaultTooltip as u,buildTooltipProps as p}from"./chunk-chunk-F7WFPD4O.module.min.js";import{makeXYRuleContext as f,resolveStyleRules as y}from"./chunk-chunk-EMO5NUGE.module.min.js";import{COLOR_SCHEMES as g,DEFAULT_COLOR as b,DEFAULT_COLORS as v,DEFAULT_SELECTION_OPACITY as x,LinkedCharts as A,MultiPointTooltip as w,composeLegendConfigs as k,defaultTooltipStyle as S,filterSparseArray as C,getColor as L,getCrosshairProps as H,getSequentialInterpolator as B,getSize as I,interpolateViridis as F,normalizeLinkedBrush as R,normalizeTooltip as _,resolveMobileInteraction as N,useBrushSelection as P,useChartLegendAndMargin as W,useChartMode as D,useChartSelection as M,useColorScale as E,useLegendInteraction as O,useSelection as T,useSelectionSelector as G,useThemeCategorical as z,useThemeSequential as j,wrapStyleWithSelection as $}from"./chunk-chunk-BFHUYEOS.module.min.js";import{getMax as Q,getMinMax as V}from"./chunk-chunk-JJ2OOIET.module.min.js";import{ChartError as X,SafeRender as Y,renderEmptyState as q,renderLoadingState as J,warnMissingField as K}from"./chunk-chunk-ACLDBMRH.module.min.js";import*as U from"react";import{useMemo as Z,useCallback as ee,forwardRef as te,useRef as oe}from"react";import{useMemo as ne}from"react";function ie(e){const{colorBy:t,colorScale:n,color:i,pointRadius:r=5,radiusFn:a,fillOpacity:s=1,fallbackFill:l,baseStyleExtras:c,stroke:h,strokeWidth:d,opacity:m,effectiveSelectionHook:u,resolvedSelection:p,colorDatumAccessor:f,styleRules:g,ruleContext:v}=e,x=ne(()=>e=>{const o="function"==typeof c?c(e):c,h=o?{...o}:{};if(void 0===h.fillOpacity&&(h.fillOpacity=s),void 0===h.fill)if(t){if(n){const o=f?f(e):e;h.fill=L(o,t,n)}}else h.fill=l?l(e):i||b;return void 0===h.r&&(h.r=a?a(e):r),g&&g.length>0&&Object.assign(h,y(e,g,v?v(e):{value:void 0})),h},[t,n,i,r,a,s,l,c,f,g,v]),A=ne(()=>o(x,{stroke:h,strokeWidth:d,opacity:m}),[x,h,d,m]);return ne(()=>$(A,u??null,p),[A,u,p])}import{useCallback as re,useMemo as ae,useRef as se,useState as le}from"react";function ce(e){const{accessor:t,data:o,isPushMode:n}=e,i=se(null),[r,a]=le(0),s=re(e=>{if(!n||!t)return;let o=!1;for(const n of e){const e="function"==typeof t?t(n):n[t];if(null==e)continue;const r="number"==typeof e?e:Number(e);Number.isFinite(r)&&(i.current?(i.current[0]>r&&(i.current[0]=r,o=!0),r>i.current[1]&&(i.current[1]=r,o=!0)):(i.current=[r,r],o=!0))}o&&a(e=>e+1)},[n,t]),l=re(()=>{n&&(i.current=null,a(e=>e+1))},[n]);return{domain:ae(()=>{if(n)return i.current??void 0;if(!t||0===o.length)return;const e="function"==typeof t?t:e=>e[t];let r=1/0,a=-1/0;for(const t of o){const o=e(t);if(null==o)continue;const n="number"==typeof o?o:Number(o);Number.isFinite(n)&&(r>n&&(r=n),n>a&&(a=n))}return Number.isFinite(r)&&Number.isFinite(a)?[r,a]:void 0},[o,t,n,r]),trackPushed:s,reset:l}}import{useEffect as he,useMemo as de,useRef as me,useState as ue}from"react";var pe="__forecastSegment",fe=null;async function ye(){return fe||(fe=await import("./chunk-statisticalOverlays-6MVAK5RW.module.min.js")),fe}var ge="__semiotic_resolvedX",be="__semiotic_resolvedY";function ve(e){const{data:t,xAccessor:o,yAccessor:n,forecast:i,anomaly:r,groupBy:a}=e,s="string"==typeof o?o:ge,l="string"==typeof n?n:be,c=de(()=>{if(!i&&!r)return t;const e="function"==typeof o,a="function"==typeof n;return e||a?t.map(t=>{const i={...t};return e&&(i[ge]=o(t)),a&&(i[be]=n(t)),i}):t},[t,i,r,o,n]),[h,d]=ue(null),[m,u]=ue([]),p=me(i),f=me(r);return he(()=>{if(!i&&!r)return void((p.current||f.current)&&(d(null),u([]),p.current=i,f.current=r));let e=!1;const t=i!==p.current||r!==f.current;if(p.current=i,f.current=r,t&&(d(null),u([])),i){const t=a&&"string"==typeof a&&"object"==typeof i?{...i,_groupBy:a}:i;(async function(...e){return(await ye()).buildForecast(...e)})(c,s,l,t,r).then(t=>{e||(d(t),u(t.annotations))}).catch(()=>{e||(d(null),u([]))})}else r&&async function(...e){return(await ye()).buildAnomalyAnnotations(...e)}(r).then(t=>{e||(d(null),u(t))}).catch(()=>{e||u([])});return()=>{e=!0}},[c,i,r,s,l,a]),{effectiveData:h?h.processedData:t,statisticalAnnotations:m,hasForecast:!!h,xAccessorKey:s,yAccessorKey:l}}import{jsx as xe}from"react/jsx-runtime";var Ae=te(function(o,n){const r=oe(null),s=D(o.mode,{width:o.width,height:o.height,showGrid:o.showGrid,enableHover:o.enableHover,showLegend:o.showLegend,title:o.title,xLabel:o.xLabel,yLabel:o.yLabel,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,responsiveRules:o.responsiveRules}),{data:h,margin:y,className:g,xFormat:b,yFormat:v,xAccessor:x="x",yAccessor:A="y",xScaleType:w,yScaleType:k,colorBy:S,colorScheme:L,styleRules:H,sizeBy:B,sizeRange:F=[3,15],symbolBy:_,symbolMap:N,pointRadius:W=5,pointOpacity:M=.8,tooltip:E,marginalGraphics:O,pointIdAccessor:T,annotations:G,regression:z,forecast:j,anomaly:$,xExtent:Q,yExtent:V,frameProps:q={},selection:J,linkedHover:te,linkedBrush:ne,onObservation:re,onClick:ae,hoverHighlight:se,chartId:le,loading:he,loadingContent:de,emptyContent:me,legendInteraction:ue,legendPosition:pe,color:fe,stroke:ye,strokeWidth:ge,opacity:be}=o,{width:Ae,height:we,enableHover:ke,showGrid:Se,showLegend:Ce,title:Le,description:He,summary:Be,accessibleTable:Ie,xLabel:Fe,yLabel:Re}=s,_e=Z(()=>C(h),[h]),Ne=void 0===h,{domain:Pe,trackPushed:We,reset:De}=ce({accessor:B,data:_e,isPushMode:Ne}),Me=ee(e=>{We([e]),r.current?.push(e)},[We]),Ee=ee(e=>{We(e),r.current?.pushMany(e)},[We]);a(n,{variant:"xy",frameRef:r,overrides:{push:Me,pushMany:Ee,clear:()=>{De(),r.current?.clear()}}});const Oe=i({data:_e,rawData:h,colorBy:S,colorScheme:L,legendInteraction:ue,legendPosition:pe,selection:J,linkedHover:te,fallbackFields:S?["string"==typeof S?S:""]:[],unwrapData:!1,onObservation:re,onClick:ae,hoverHighlight:se,mobileInteraction:s.mobileInteraction,mobileSemantics:s.mobileSemantics,chartType:"Scatterplot",chartId:le,showLegend:Ce,userMargin:y,marginDefaults:s.marginDefaults,loading:he,loadingContent:de,emptyContent:me,width:Ae,height:we}),Te=R(ne),Ge=P({name:Te?.name||"__unused_brush__",xField:Te?.xField||("string"==typeof x?x:void 0),yField:Te?.yField||("string"==typeof A?A:void 0)}),ze=Te?"xyBrush"===Ge.brushInteraction.brush?"xy":"xBrush"===Ge.brushInteraction.brush?"x":"y":void 0,je=U.useRef(Ge.brushInteraction);je.current=Ge.brushInteraction;const $e=ee(e=>{const t=je.current;t.end(e?"xyBrush"===t.brush?[[e.x[0],e.y[0]],[e.x[1],e.y[1]]]:"xBrush"===t.brush?e.x:e.y:null)},[]);K("Scatterplot",_e,"xAccessor",x),K("Scatterplot",_e,"yAccessor",A);const Qe=Z(()=>B?Pe??[0,1]:void 0,[B,Pe]),Ve=Z(()=>B?e=>I(e,B,F,Qe):void 0,[B,F,Qe]),Xe=Z(()=>f(x,A),[x,A]),Ye=ie({colorBy:S,colorScale:Oe.colorScale,color:fe,pointRadius:W,fillOpacity:M,radiusFn:Ve,stroke:ye,strokeWidth:ge,opacity:be,styleRules:H,ruleContext:Xe,effectiveSelectionHook:Oe.effectiveSelectionHook,resolvedSelection:Oe.resolvedSelection}),qe=Z(()=>u([{label:Fe||c(x),accessor:x,role:"x",format:b},{label:Re||c(A),accessor:A,role:"y",format:v},...S?[{label:c(S),accessor:S,role:"color"}]:[],...B?[{label:c(B),accessor:B,role:"size"}]:[]]),[x,A,Fe,Re,S,B,b,v]),{effectiveData:Je,statisticalAnnotations:Ke}=ve({data:_e,xAccessor:x,yAccessor:A,forecast:j,anomaly:$}),Ue=Z(()=>{const t=e(z);return t||0!==Ke.length?[...t?[t]:[],...G||[],...Ke]:G},[z,G,Ke]);if(Oe.earlyReturn)return Oe.earlyReturn;const Ze=t({componentName:"Scatterplot",data:h,accessors:{xAccessor:x,yAccessor:A}});if(Ze)return xe(X,{componentName:"Scatterplot",message:Ze,width:Ae,height:we});const et={chartType:"scatter",...null!=h&&{data:Je},xAccessor:x,yAccessor:A,xScaleType:w,yScaleType:k,colorAccessor:S||void 0,sizeAccessor:B||void 0,..._&&{symbolAccessor:_},...N&&{symbolMap:N},sizeRange:F,pointStyle:Ye,colorScheme:L,size:[Ae,we],responsiveWidth:o.responsiveWidth,responsiveHeight:o.responsiveHeight,margin:Oe.margin,showAxes:s.showAxes,xLabel:Fe,yLabel:Re,xFormat:b,yFormat:v,enableHover:ke,showGrid:Se,...Oe.legendBehaviorProps,...d({title:Le,description:He,summary:Be,accessibleTable:Ie,className:g,animate:o.animate,axisExtent:o.axisExtent,autoPlaceAnnotations:o.autoPlaceAnnotations}),...p({tooltip:E,defaultTooltipContent:qe}),...m({linkedHover:te,selection:J,onObservation:re,onClick:ae,hoverHighlight:se,mobileInteraction:Oe.mobileInteraction,customHoverBehavior:Oe.customHoverBehavior,customClickBehavior:Oe.customClickBehavior}),...O&&{marginalGraphics:O},...T&&{pointIdAccessor:T},...Ue&&Ue.length>0&&{annotations:Ue},...Q&&{xExtent:Q},...V&&{yExtent:V},...Te&&{brush:{dimension:ze},onBrush:$e},...Oe.crosshairProps,...q};return xe(Y,{componentName:"Scatterplot",width:Ae,height:we,children:xe(l,{ref:r,...et})})});Ae.displayName="Scatterplot";import{useMemo as we,forwardRef as ke,useRef as Se}from"react";import{Fragment as Ce,jsx as Le}from"react/jsx-runtime";function He(e,t){return F(1===t?.5:e/(t-1))}var Be=ke(function(o,n){const r=Se(null);a(n,{variant:"xy",frameRef:r});const s=D(o.mode,{width:o.width,height:o.height,showGrid:o.showGrid,enableHover:o.enableHover,title:o.title,xLabel:o.xLabel,yLabel:o.yLabel,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,responsiveRules:o.responsiveRules}),{data:h,margin:y,className:g,xFormat:b,yFormat:v,xAccessor:A="x",yAccessor:w="y",orderAccessor:k,orderLabel:S,styleRules:C,pointRadius:L=4,tooltip:H,pointIdAccessor:B,annotations:I,regression:F,forecast:R,anomaly:_,xExtent:N,yExtent:P,frameProps:W={},selection:M,linkedHover:E,onObservation:O,onClick:T,hoverHighlight:G,chartId:z,loading:j,loadingContent:$,emptyContent:Q,legendInteraction:V,stroke:q,strokeWidth:J,opacity:U}=o,{width:Z,height:ee,enableHover:te,showGrid:oe,title:ne,description:re,summary:ae,accessibleTable:se,xLabel:le,yLabel:ce}=s,{safeData:he,orderMap:de}=we(()=>{const e=h||[],t="function"==typeof A?A:e=>e[A],o="function"==typeof w?w:e=>e[w];let n=e;if(k&&e.length>0){const t="function"==typeof k?k:e=>e[k];n=[...e].sort((e,o)=>{const n=t(e),i=t(o);return(n instanceof Date?n.getTime():+n)-(i instanceof Date?i.getTime():+i)})}const i=new WeakMap;let r=0;for(const e of n){const n=t(e),i=o(e);null!=n&&null!=i&&isFinite(n)&&isFinite(i)&&r++}let a=0;for(const e of n){const n=t(e),s=o(e);null!=n&&null!=s&&isFinite(n)&&isFinite(s)&&i.set(e,{idx:a++,total:r})}return{safeData:n,orderMap:i}},[h,k,A,w]);K("ConnectedScatterplot",he,"xAccessor",A),K("ConnectedScatterplot",he,"yAccessor",w);const me=i({data:he,rawData:h,colorBy:void 0,colorScheme:void 0,legendInteraction:V,selection:M,linkedHover:E,fallbackFields:[],unwrapData:!1,onObservation:O,onClick:T,hoverHighlight:G,mobileInteraction:s.mobileInteraction,mobileSemantics:s.mobileSemantics,chartType:"ConnectedScatterplot",chartId:z,showLegend:void 0,userMargin:y,marginDefaults:s.marginDefaults,loading:j,loadingContent:$,emptyContent:Q,width:Z,height:ee}),ue=me.resolvedSelection?.unselectedOpacity??x,pe=we(()=>(e,t)=>{const o=t.filter(e=>"point"===e.type);if(2>o.length)return;const n=me.effectiveSelectionHook?.isActive,i=me.effectiveSelectionHook?.predicate,r=100>o.length,a=o.length;e.lineCap="round";for(let t=0;a-1>t;t++){const s=o[t],l=o[t+1],c=He(t,a),h=!n||!i||i(s.datum??s)||i(l.datum??l),d=n?h?1:ue:1;r&&(e.beginPath(),e.moveTo(s.x,s.y),e.lineTo(l.x,l.y),e.strokeStyle="white",e.lineWidth=L+2,e.globalAlpha=.5*d,e.stroke()),e.beginPath(),e.moveTo(s.x,s.y),e.lineTo(l.x,l.y),e.strokeStyle=c,e.lineWidth=L,e.globalAlpha=d,e.stroke()}e.globalAlpha=1},[L,me.effectiveSelectionHook,ue]),fe=we(()=>[pe],[pe]),ye=we(()=>(e,t,o)=>{const n=e.filter(e=>"point"===e.type);if(2>n.length)return null;const i=n.length,r=100>i,a=[];for(let e=0;i-1>e;e++){const t=n[e],o=n[e+1],s=He(e,i),l=Math.min("number"==typeof t.style?.opacity?t.style.opacity:1,"number"==typeof o.style?.opacity?o.style.opacity:1);r&&a.push(Le("line",{x1:t.x,y1:t.y,x2:o.x,y2:o.y,stroke:"white",strokeWidth:L+2,strokeLinecap:"round",opacity:.5*l},"halo-"+e)),a.push(Le("line",{x1:t.x,y1:t.y,x2:o.x,y2:o.y,stroke:s,strokeWidth:L,strokeLinecap:"round",opacity:l},"seg-"+e))}return Le(Ce,{children:a})},[L]),ge=we(()=>[ye],[ye]),be=ie({colorScale:void 0,baseStyleExtras:we(()=>e=>{const t=de.get(e),o=t?.idx??0,n=t?.total??1;return{fill:n>0?He(o,n):"#6366f1",stroke:"white",strokeWidth:1,r:L,fillOpacity:1}},[L,de]),stroke:q,strokeWidth:J,opacity:U,styleRules:C,ruleContext:we(()=>f(A,w),[A,w]),effectiveSelectionHook:me.effectiveSelectionHook,resolvedSelection:me.resolvedSelection}),xe=S||("string"==typeof k?k:"Order"),Ae=we(()=>u([{label:le||c(A),accessor:A,role:"x",format:b},{label:ce||c(w),accessor:w,role:"y",format:v},...k?[{label:xe,accessor:k,role:"group"}]:[]]),[A,w,le,ce,k,xe,b,v]),ke=t({componentName:"ConnectedScatterplot",data:h,accessors:{xAccessor:A,yAccessor:w}}),{effectiveData:Be,statisticalAnnotations:Ie}=ve({data:he,xAccessor:A,yAccessor:w,forecast:R,anomaly:_});if(me.earlyReturn)return me.earlyReturn;const Fe=e(F),Re=Fe||Ie.length>0?[...Fe?[Fe]:[],...I||[],...Ie]:I,_e={chartType:"scatter",...null!=h&&{data:Be},xAccessor:A,yAccessor:w,pointStyle:be,size:[Z,ee],responsiveWidth:o.responsiveWidth,responsiveHeight:o.responsiveHeight,margin:me.margin,showAxes:s.showAxes,xLabel:le,yLabel:ce,xFormat:b,yFormat:v,enableHover:te,showGrid:oe,...d({title:ne,description:re,summary:ae,accessibleTable:se,className:g,animate:o.animate,axisExtent:o.axisExtent,autoPlaceAnnotations:o.autoPlaceAnnotations}),...p({tooltip:H,defaultTooltipContent:Ae}),...m({linkedHover:E,selection:M,onObservation:O,onClick:T,hoverHighlight:G,mobileInteraction:me.mobileInteraction,customHoverBehavior:me.customHoverBehavior,customClickBehavior:me.customClickBehavior}),...B&&{pointIdAccessor:B},canvasPreRenderers:fe,svgPreRenderers:ge,...Re&&Re.length>0&&{annotations:Re},...N&&{xExtent:N},...P&&{yExtent:P},...me.crosshairProps,...W};return ke?Le(X,{componentName:"ConnectedScatterplot",message:ke,width:Z,height:ee}):Le(Y,{componentName:"ConnectedScatterplot",width:Z,height:ee,children:Le(l,{ref:r,..._e})})});Be.displayName="ConnectedScatterplot";import{useMemo as Ie,useCallback as Fe,useState as Re,useEffect as _e,forwardRef as Ne,useRef as Pe}from"react";import{useMemo as We}from"react";function De(e){const{lineWidth:t=2,colorBy:n,colorScale:i,color:r,resolveStroke:a,fillArea:s,areaOpacity:l=.3,stroke:c,strokeWidth:h,opacity:d,effectiveSelectionHook:m,resolvedSelection:u,styleRules:p,ruleContext:f}=e,g=We(()=>function(e){const{lineWidth:t=2,colorBy:o,colorScale:n,color:i,resolveStroke:r,fillArea:a,areaOpacity:s=.3,styleRules:l,ruleContext:c}=e;return(e,h)=>{const d={strokeWidth:t},m=!0===a||Array.isArray(a)&&null!=h&&a.includes(h);let u;return r?u=r(e,h):o?n&&(u=L(e,o,n)):u=i||b,void 0!==u&&(d.stroke=u,m&&(d.fill=u,d.fillOpacity=s)),l?.length&&Object.assign(d,y(e,l,c?c(e,h):{value:void 0,category:h})),d}}({lineWidth:t,colorBy:n,colorScale:i,color:r,resolveStroke:a,fillArea:s,areaOpacity:l,styleRules:p,ruleContext:f}),[t,n,i,r,a,s,l,p,f]),v=We(()=>o(g,{stroke:c,strokeWidth:h,opacity:d}),[g,c,h,d]);return We(()=>$(v,m??null,u),[v,m,u])}import{jsx as Me}from"react/jsx-runtime";var Ee="__lineObjectSeries",Oe=Ne(function(e,o){const n=Pe(null);a(o,{variant:"xy",frameRef:n});const r=D(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:s,margin:d,className:p,xFormat:y,yFormat:g,axisExtent:v,xAccessor:x="x",yAccessor:A="y",lineBy:S,lineDataAccessor:H="coordinates",colorBy:B,colorScheme:I,styleRules:F,curve:R="linear",showPoints:N=!1,pointRadius:P=3,fillArea:W=!1,areaOpacity:M=.3,lineWidth:E=2,lineGradient:O,tooltip:T,pointIdAccessor:G,annotations:z,directLabel:j,gapStrategy:$="break",anomaly:Q,forecast:V,band:q,xExtent:J,yExtent:U,frameProps:Z={},selection:ee,linkedHover:te,onObservation:oe,onClick:ne,hoverHighlight:ie,hoverRadius:re,chartId:ae,loading:se,loadingContent:le,emptyContent:ce,legendInteraction:he,legendPosition:de,legend:me,xScaleType:ue,yScaleType:fe,color:ge,stroke:be,strokeWidth:xe,opacity:Ae}=e,{legend:we,...ke}=Z,Se=Ie(()=>k(we,me),[we,me]),{width:Ce,height:Le,enableHover:He,showGrid:Be,showLegend:Ne,title:We,description:Oe,summary:Te,accessibleTable:Ge,xLabel:ze,yLabel:je}=r,$e=Ie(()=>C(s),[s]),Qe=Array.isArray($e[0]?.[H])?$e[0][H]:$e;K("LineChart",Qe,"xAccessor",x),K("LineChart",Qe,"yAccessor",A);const{effectiveData:Ve,statisticalAnnotations:Xe}=ve({data:$e,xAccessor:x,yAccessor:A,forecast:V,anomaly:Q,groupBy:S}),Ye="__compoundGroup",qe=!(!V||!S),Je=qe?Ye:V?pe:S,Ke=Ie(()=>{if(!qe)return Ve;const e="function"==typeof S?S:e=>e[S];return Ve.map(t=>{const o={...t};return o[Ye]=`${e(t)}__${t[pe]||"observed"}`,o})},[Ve,qe,S]),Ue=qe?Ke:Ve,Ze=B||S,et=Ie(()=>{if(!V)return;const e=V.upperBounds,t=V.lowerBounds;if(!e&&!t)return;const o="function"==typeof e?e:"string"==typeof e?t=>t[e]:null,n="function"==typeof t?t:"string"==typeof t?e=>e[t]:null;let i=1/0,r=-1/0;const a=Ve;for(const e of a){const t="function"==typeof A?A(e):+e[A];if(isFinite(t)&&(i>t&&(i=t),t>r&&(r=t)),o){const t=o(e);null!=t&&isFinite(t)&&(t>r&&(r=t),i>t&&(i=t))}if(n){const t=n(e);null!=t&&isFinite(t)&&(i>t&&(i=t),t>r&&(r=t))}}return isFinite(i)&&isFinite(r)?[i,r]:void 0},[V,Ve,A]),tt=Fe(e=>{const t="function"==typeof x?x(e):e[x],o="function"==typeof A?A(e):e[A];return null==t||null==o||Number.isNaN(t)||Number.isNaN(o)},[x,A]),ot=void 0!==Ue[0]?.[H],nt=ot?Ee:Je,it=Ie(()=>{if(ot)return Ue.map((e,t)=>{const o="function"==typeof S?S(e):"string"==typeof S?e[S]:void 0,n=null==o?"line-"+t:o+"",i=Array.isArray(e[H])?e[H]:[];return{...e,[Ee]:n,[H]:i.map(t=>({...t,[Ee]:n,parentLine:e,..."string"==typeof S&&void 0!==e[S]?{[S]:e[S]}:{}}))}});if(Je){const e=Ue.reduce((e,t)=>{const o="function"==typeof Je?Je(t):t[Je];if(!e[o]){const n={[H]:[]};"string"==typeof Je&&(n[Je]=o),qe&&(n[pe]=t[pe],"string"==typeof S&&(n[S]=t[S])),e[o]=n}return e[o][H].push(t),e},{});return Object.values(e)}return[{[H]:Ue}]},[ot,Je,H,Ue,S,qe]),{gapProcessedLineData:rt,hasGaps:at}=Ie(()=>{if("interpolate"===$){let e=!1;const t=[];for(const o of it){const n=(o[H]||[]).filter(t=>!tt(t)||(e=!0,!1));n.length>0&&t.push({...o,[H]:n})}return{gapProcessedLineData:t,hasGaps:e}}if("break"===$){let e=!1;const t=[];for(const o of it){const n=o[H]||[];let i=[],r=0;const a=nt&&"string"==typeof nt?o[nt]:void 0;for(const s of n)if(tt(s))e=!0,i.length>0&&(t.push({...o,[H]:i}),i=[],r++);else{const e=null!=a?`${a}__seg${r}`:"__seg"+r;i.push({...s,_gapSegment:e})}i.length>0&&t.push({...o,[H]:i})}return{gapProcessedLineData:t,hasGaps:e}}if("zero"===$){let e=!1;const t="string"==typeof A?A:"y",o=[];for(const n of it){const i=n[H]||[],r=[];for(const o of i)tt(o)?(e=!0,r.push({...o,[t]:0})):r.push(o);o.push({...n,[H]:r})}return{gapProcessedLineData:o,hasGaps:e}}return{gapProcessedLineData:it,hasGaps:!1}},[it,$,H,tt,nt,A]),st="object"==typeof j?j:{},lt=st.position||"end",ct=st.fontSize||11,ht=Ie(()=>{if(!j||!Ze)return[];const e="function"==typeof Ze?Ze:e=>e[Ze],t=new Set;for(const o of rt){const n=o[H]||[];if(0===n.length)continue;const i=e("end"===lt?n[n.length-1]:n[0])??e(o);if(null==i)continue;const r=i+"";""!==r&&t.add(r)}return Array.from(t)},[j,Ze,rt,H,lt]),dt=Ie(()=>{if(!j)return r.marginDefaults;const e=ht.reduce((e,t)=>Math.max(e,t.length*(.6*ct)),0)+10,t="end"===lt?"right":"left";return{...r.marginDefaults,[t]:Math.max(r.marginDefaults[t]||0,e)}},[j,ht,ct,lt,r.marginDefaults]),mt=i({data:Ve,rawData:s,colorBy:Ze,colorScheme:I,legendInteraction:he,legendPosition:de,selection:ee,linkedHover:te,fallbackFields:Ze?["string"==typeof Ze?Ze:""]:[],unwrapData:!1,onObservation:oe,onClick:ne,hoverHighlight:ie,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"LineChart",chartId:ae,showLegend:(!j||void 0!==Ne)&&Ne,legend:Se,userMargin:d,marginDefaults:dt,loading:se,loadingContent:le,emptyContent:ce,width:Ce,height:Le}),ut=mt.colorScale,pt=mt.effectiveSelectionHook,ft=mt.resolvedSelection,yt=mt.customHoverBehavior,gt=mt.customClickBehavior,bt=mt.crosshairProps,vt=Ie(()=>{if(Ze)return ot?e=>{const t=e.parentLine||e;return"function"==typeof Ze?Ze(t):t[Ze]}:Ze},[Ze,ot]),xt=Ie(()=>f(x,A),[x,A]),At=De({lineWidth:E,colorBy:vt,colorScale:ut,color:ge,fillArea:W,areaOpacity:M,stroke:be,strokeWidth:xe,opacity:Ae,effectiveSelectionHook:pt,resolvedSelection:ft,styleRules:F,ruleContext:xt}),[wt,kt]=Re(null);_e(()=>{if(!V)return void kt(null);let e=!1;return async function(...e){return(await ye()).createSegmentLineStyle(...e)}(At,V).then(t=>{e||kt(()=>t)}).catch(()=>{e||kt(null)}),()=>{e=!0}},[At,V]);const St=wt||At,Ct=Ie(()=>{if(N)return e=>{const t={r:P,fillOpacity:1};return Ze?ut&&(t.fill=L(e.parentLine||e,Ze,ut)):t.fill=ge||b,t}},[N,P,Ze,ut,ge]),Lt=Array.isArray(W)?"mixed":W?"area":"line",Ht=Ie(()=>{if(!j||!Ze)return[];const e="function"==typeof x?x:e=>e[x],t="function"==typeof A?A:e=>e[A],o="function"==typeof Ze?Ze:e=>e[Ze],n=new Map;for(const e of rt){const t=e[H]||[];if(0===t.length)continue;const i="end"===lt?t[t.length-1]:t[0],r=o(i)??o(e);if(null==r)continue;const a=r+"";""===a||n.has(a)||n.set(a,i)}const i=Array.from(n.entries()).map(([o,n])=>({type:"text",label:o,["string"==typeof x?x:"x"]:e(n),["string"==typeof A?A:"y"]:t(n),dx:"end"===lt?6:-6,dy:0,color:ut?ut(o):b,fontSize:ct}));i.sort((e,t)=>{const o="string"==typeof A?A:"y";return e[o]-t[o]});for(let e=1;i.length>e;e++){const t="string"==typeof A?A:"y",o=i[e-1],n=i[e];ct+2>Math.abs(n[t]+n.dy-(o[t]+o.dy))&&(n.dy+=ct+2)}return i},[j,Ze,ut,rt,H,x,A,lt,ct]),Bt=mt.margin,It=S||B,Ft=Ie(()=>u([{label:ze||c(x),accessor:x,role:"x",format:y},{label:je||c(A),accessor:A,role:"y",format:g},...It?[{label:c(It),accessor:It,role:"group"}]:[],...h(q,g)]),[x,A,ze,je,It,y,g,q]),Rt=t({componentName:"LineChart",data:ot?Ve[0]?.[H]||[]:s,accessors:{xAccessor:x,yAccessor:A}}),_t=Ie(()=>ot||nt||at?rt.flatMap(e=>{const t=e[H]||[];return nt&&"string"==typeof nt?t.map(t=>({...t,[nt]:t[nt]??e[nt]})):t}):Ue,[rt,H,ot,nt,Ue,at]),Nt={chartType:Lt,...Array.isArray(W)&&{areaGroups:W},...O&&{lineGradient:O},...null!=s&&{data:_t},xAccessor:x,yAccessor:A,xScaleType:ue,yScaleType:fe,...J&&{xExtent:J},...!U||null==U[0]&&null==U[1]?et?{yExtent:et}:{}:{yExtent:U},groupAccessor:"break"===$&&at?"_gapSegment":nt||void 0,...q&&{band:q},curve:R,lineStyle:St,...N&&{pointStyle:Ct},size:[Ce,Le],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Bt,showAxes:r.showAxes,xLabel:ze,yLabel:je,xFormat:y,yFormat:g,...void 0!==v&&{axisExtent:v},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},enableHover:He,showGrid:Be,...mt.legendBehaviorProps,...We&&{title:We},...Oe&&{description:Oe},...Te&&{summary:Te},...void 0!==Ge&&{accessibleTable:Ge},...p&&{className:p},...null!=e.animate&&{animate:e.animate},tooltipContent:!1===T?()=>null:"multi"===T?w():_(T)||Ft,..."multi"===T&&{tooltipMode:"multi"},...m({linkedHover:te,selection:ee,onObservation:oe,onClick:ne,hoverRadius:re,hoverHighlight:ie,mobileInteraction:mt.mobileInteraction,customHoverBehavior:yt,customClickBehavior:gt}),...G&&{pointIdAccessor:G},...(z?.length||Xe.length||Ht.length)&&{annotations:[...z||[],...Xe,...Ht]},...bt,...ke};return mt.earlyReturn?mt.earlyReturn:Rt?Me(X,{componentName:"LineChart",message:Rt,width:Ce,height:Le}):Me(Y,{componentName:"LineChart",width:Ce,height:Le,children:Me(l,{ref:n,...Nt})})});Oe.displayName="LineChart";import{useMemo as Te,forwardRef as Ge,useRef as ze}from"react";import{useMemo as je}from"react";function $e(e){const{safeData:t,data:n,areaBy:i,lineDataAccessor:r,colorBy:a,colorScale:s,color:l,stroke:d,strokeWidth:m,opacity:p,effectiveSelectionHook:f,resolvedSelection:g,areaOpacity:v,showLine:x,lineWidth:A,showPoints:w,pointRadius:k,xAccessor:S,yAccessor:C,xLabel:H,yLabel:B,xFormat:I,yFormat:F,groupField:R,styleRules:_,ruleContext:N}=e,P=je(()=>function({data:e,safeData:t,areaBy:o,lineDataAccessor:n}){if(null==e)return[];const i=void 0!==t[0]?.[n];if(!i&&!o)return t;let r;if(i)r=t;else{const e=t.reduce((e,t)=>{const i="function"==typeof o?o(t):t[o],r=i+"";if(!e[r]){const t={[n]:[]};"string"==typeof o&&(t[o]=i),e[r]=t}return e[r][n].push(t),e},{});r=Object.values(e)}return r.flatMap(e=>{const t=Array.isArray(e[n])?e[n]:[];return"string"==typeof o?t.map(t=>({...t,[o]:t[o]??e[o]})):t})}({data:n,safeData:t,areaBy:i,lineDataAccessor:r}),[n,t,i,r]),W=je(()=>e=>{const t={};if(a){if(s){const o=L(e,a,s);t.fill=o,x?(t.stroke=o,t.strokeWidth=A):t.stroke="none"}}else{const e=l||b;t.fill=e,x?(t.stroke=e,t.strokeWidth=A):t.stroke="none"}return t.fillOpacity=v,_&&_.length>0&&Object.assign(t,y(e,_,N?N(e):{value:void 0})),t},[a,s,l,v,x,A,_,N]),D=je(()=>o(W,{stroke:d,strokeWidth:m,opacity:p}),[W,d,m,p]);return{flattenedData:P,lineStyle:je(()=>$(D,f??null,g),[D,f,g]),pointStyle:je(()=>{if(w)return e=>{const t={r:k,fillOpacity:1};return a?s&&(t.fill=L(e.parentLine||e,a,s)):t.fill=l||b,t}},[w,k,a,s,l]),defaultTooltipContent:je(()=>u([{label:H||c(S),accessor:S,role:"x",format:I},{label:B||c(C),accessor:C,role:"y",format:F},...R?[{label:c(R),accessor:R,role:"group"}]:[],...h(e.band,F)]),[S,C,H,B,R,I,F,e.band])}}import{jsx as Qe}from"react/jsx-runtime";function Ve(e,t){if(null==t)return e;const o=e.trim(),n=o.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);if(n){const e=n[1],o=3===e.length?e.split("").map(e=>e+e).join(""):e;return`rgba(${parseInt(o.slice(0,2),16)}, ${parseInt(o.slice(2,4),16)}, ${parseInt(o.slice(4,6),16)}, ${t})`}if(o.startsWith("rgba(")){const e=o.lastIndexOf(","),n=o.lastIndexOf(")");if(-1!==e&&n>e)return`${o.slice(0,e+1)} ${t})`}return o.startsWith("rgb(")?o.replace(/^rgb\(/,"rgba(").replace(/\)$/,`, ${t})`):e}var Xe=Ge(function(e,o){const n=ze(null);a(o,{variant:"xy",frameRef:n});const r=D(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:s,margin:c,className:h,xFormat:u,yFormat:y,xAccessor:g="x",yAccessor:b="y",areaBy:v,y0Accessor:x,gradientFill:A=!1,semanticGradient:k,lineDataAccessor:S="coordinates",colorBy:L,colorScheme:H,styleRules:B,curve:I="monotoneX",areaOpacity:F=.7,lineGradient:R,showLine:_=!0,lineWidth:N=2,showPoints:P=!1,pointRadius:W=3,tooltip:M,annotations:E,forecast:O,anomaly:T,band:G,xExtent:z,yExtent:j,frameProps:$={},selection:Q,linkedHover:V,onObservation:q,onClick:J,hoverHighlight:U,chartId:Z,loading:ee,loadingContent:te,emptyContent:oe,legendInteraction:ne,legendPosition:ie,color:re,stroke:ae,strokeWidth:se,opacity:le}=e,{width:ce,height:he,enableHover:de,showGrid:me,showLegend:ue,title:pe,description:fe,summary:ye,accessibleTable:ge,xLabel:be,yLabel:xe}=r,Ae=Te(()=>C(s),[s]),we=L||v,ke=Te(()=>{return k&&k.length>0?{colorStops:(e=k,e.filter(e=>Number.isFinite(e.at)).map(e=>({offset:1-Math.max(0,Math.min(100,e.at))/100,color:Ve(e.color,e.opacity)})).sort((e,t)=>e.offset-t.offset))}:A;var e},[k,A]);K("AreaChart",Ae,"xAccessor",g),K("AreaChart",Ae,"yAccessor",b);const Se=i({data:Ae,rawData:s,colorBy:we,colorScheme:H,legendInteraction:ne,legendPosition:ie,selection:Q,linkedHover:V,fallbackFields:we?["string"==typeof we?we:""]:[],unwrapData:!1,onObservation:q,onClick:J,hoverHighlight:U,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"AreaChart",chartId:Z,showLegend:ue,userMargin:c,marginDefaults:r.marginDefaults,loading:ee,loadingContent:te,emptyContent:oe,width:ce,height:he}),{effectiveData:Ce,statisticalAnnotations:Le}=ve({data:Ae,xAccessor:g,yAccessor:b,forecast:O,anomaly:T,groupBy:v}),He=Te(()=>f(g,b),[g,b]),{flattenedData:Be,lineStyle:Ie,pointStyle:Fe,defaultTooltipContent:Re}=$e({safeData:Ce,data:s,areaBy:v,lineDataAccessor:S,colorBy:we,colorScale:Se.colorScale,color:re,stroke:ae,strokeWidth:se,opacity:le,effectiveSelectionHook:Se.effectiveSelectionHook,resolvedSelection:Se.resolvedSelection,areaOpacity:F,showLine:_,lineWidth:N,showPoints:P,pointRadius:W,xAccessor:g,yAccessor:b,xLabel:be,yLabel:xe,xFormat:u,yFormat:y,groupField:v||L,band:G,styleRules:B,ruleContext:He}),_e=t({componentName:"AreaChart",data:s,accessors:{xAccessor:g,yAccessor:b}}),Ne={chartType:"area",...null!=s&&{data:Be},xAccessor:g,yAccessor:b,groupAccessor:v||void 0,...x&&{y0Accessor:x},...G&&{band:G},...ke&&{gradientFill:ke},...R&&{lineGradient:R},curve:I,lineStyle:Ie,...P&&Fe&&{pointStyle:Fe},size:[ce,he],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Se.margin,showAxes:r.showAxes,xLabel:be,yLabel:xe,xFormat:u,yFormat:y,enableHover:de,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:me,...Se.legendBehaviorProps,...d({title:pe,description:fe,summary:ye,accessibleTable:ge,className:h,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),..."multi"===M?{tooltipContent:w(),tooltipMode:"multi"}:p({tooltip:M,defaultTooltipContent:Re}),...m({linkedHover:V,selection:Q,onObservation:q,onClick:J,hoverHighlight:U,mobileInteraction:Se.mobileInteraction,customHoverBehavior:Se.customHoverBehavior,customClickBehavior:Se.customClickBehavior}),...(E&&E.length>0||Le.length>0)&&{annotations:[...E||[],...Le]},...z&&{xExtent:z},...j&&{yExtent:j},...Se.crosshairProps,...$};return Se.earlyReturn?Se.earlyReturn:_e?Qe(X,{componentName:"AreaChart",message:_e,width:ce,height:he}):Qe(Y,{componentName:"AreaChart",width:ce,height:he,children:Qe(l,{ref:n,...Ne})})});Xe.displayName="AreaChart";import{useMemo as Ye,forwardRef as qe,useRef as Je,useState as Ke,useImperativeHandle as Ue,useCallback as Ze}from"react";import{jsx as et,jsxs as tt}from"react/jsx-runtime";function ot(e){if(null==e)return NaN;if("number"==typeof e)return e;if(e instanceof Date)return e.getTime();if("string"==typeof e){if(""===e.trim())return NaN;const t=+e;return Number.isFinite(t)?t:NaN}return NaN}var nt=qe(function(e,t){const o=Je(null),n=D(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:r,margin:a,className:s,xFormat:c,yFormat:h,xAccessor:u="x",seriesAAccessor:p="a",seriesBAccessor:f="b",seriesALabel:y="A",seriesBLabel:g="B",seriesAColor:b="var(--semiotic-danger, #dc2626)",seriesBColor:v="var(--semiotic-info, #2563eb)",showLines:x=!0,lineWidth:A=1.5,showPoints:w=!1,pointRadius:k=3,curve:L="linear",areaOpacity:H=.6,gradientFill:B,tooltip:I,annotations:F,xExtent:R,yExtent:N,frameProps:P={},selection:W,linkedHover:M,onObservation:E,onClick:O,hoverHighlight:T,chartId:G,loading:z,loadingContent:j,emptyContent:$,legendInteraction:Q,legendPosition:V,pointIdAccessor:X,windowSize:q}=e,{width:J,height:K,enableHover:U,showGrid:Z,showLegend:ee,title:te,description:oe,summary:ne,accessibleTable:ie,xLabel:re,yLabel:ae}=n,se=Ye(()=>"function"==typeof u?e=>ot(u(e)):e=>ot(e[u]),[u]),le=Ye(()=>"function"==typeof p?e=>ot(p(e)):e=>ot(e[p]),[p]),ce=Ye(()=>"function"==typeof f?e=>ot(f(e)):e=>ot(e[f]),[f]),[he,de]=Ke([]),me=Je([]),ue=null==r,pe=Ye(()=>C(ue?he:r),[ue,he,r]),fe=Ye(()=>function(e,t,o,n){if(!e.length)return[];const i=e.filter(e=>Number.isFinite(t(e))).sort((e,o)=>t(e)-t(o)),r=[];let a=0,s=null,l=null,c=[];const h=(e,t)=>e>t?"A":t>e?"B":null,d=e=>`seg-${a}-${e}`,m=e=>r.push(e),u=(e,t)=>{m({__x:e.x,__y:e.y,__y0:e.y,__diffSegment:d(t),__diffWinner:t,__valA:e.y,__valB:e.y,__sourceDatum:e.datum})};for(let e=0;i.length>e;e++){const r=i[e],p=t(r),f=o(r),y=n(r);if(!Number.isFinite(p)||!Number.isFinite(f)||!Number.isFinite(y))continue;const g=h(f,y);if(null!==g)if(null!=s){if(l&&l.w!==g){let e,t;if(c.length>0)e=c[0].x,t=c[0].y;else{const o=f-l.a-(y-l.b);if(0!==o){const n=Math.max(0,Math.min(1,(l.b-l.a)/o));e=l.x+n*(p-l.x),t=l.a+n*(f-l.a)}else e=l.x,t=l.a}m({__x:e,__y:t,__y0:t,__diffSegment:d(s),__diffWinner:s,__valA:t,__valB:t}),a++,s=g,m({__x:e,__y:t,__y0:t,__diffSegment:d(s),__diffWinner:s,__valA:t,__valB:t});for(let e=1;c.length>e;e++)u(c[e],s)}else for(const e of c)u(e,s);c=[],m({__x:p,__y:y>f?y:f,__y0:y>f?f:y,__diffSegment:d(s),__diffWinner:s,__valA:f,__valB:y,__sourceDatum:r}),l={x:p,a:f,b:y,w:g}}else{s=g;for(const e of c)u(e,s);c=[],m({__x:p,__y:y>f?y:f,__y0:y>f?f:y,__diffSegment:d(s),__diffWinner:s,__valA:f,__valB:y,__sourceDatum:r}),l={x:p,a:f,b:y,w:g}}else c.push({x:p,y:f,datum:r})}for(const e of c)u(e,s??"A");return r}(pe,se,le,ce),[pe,se,le,ce]),ye=Ye(()=>x?function(e,t,o,n){if(!e.length)return[];const i=e.filter(e=>Number.isFinite(t(e))).sort((e,o)=>t(e)-t(o)),r=[];for(const e of i){const i=t(e),a=o(e),s=n(e);Number.isFinite(a)&&r.push({__x:i,__y:a,__diffSegment:"line-A"}),Number.isFinite(s)&&r.push({__x:i,__y:s,__diffSegment:"line-B"})}return r}(pe,se,le,ce):[],[x,pe,se,le,ce]),ge=Ye(()=>[...fe,...ye],[fe,ye]),be=Ye(()=>{const e=new Set;for(const t of fe)e.add(t.__diffSegment);return Array.from(e)},[fe]);Ue(t,()=>{const e=e=>{const t=q&&e.length>q?e.slice(e.length-q):e;me.current=t,de(t)},t=X?"function"==typeof X?X:e=>e[X]:null;return{push:t=>e([...me.current,t]),pushMany:t=>e([...me.current,...t]),remove:o=>{if(!t)return[];const n=Array.isArray(o)?o:[o],i=[],r=[];for(const e of me.current)n.includes(t(e))?i.push(e):r.push(e);return e(r),i},update:(o,n)=>{if(!t)return[];const i=Array.isArray(o)?o:[o],r=[],a=me.current.map(e=>{if(i.includes(t(e))){const t=n(e);return r.push(t),t}return e});return e(a),r},clear:()=>e([]),getData:()=>ue?me.current:pe,getScales:()=>o.current?.getScales()??null}},[ue,pe,X,q]);const ve=i({data:pe,rawData:r,colorBy:"__diffWinner",colorScheme:[b,v],legendInteraction:Q,legendPosition:V,selection:W,linkedHover:M,fallbackFields:["__diffWinner"],unwrapData:!1,onObservation:E,onClick:O,hoverHighlight:T,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"DifferenceChart",chartId:G,showLegend:ee,userMargin:a,marginDefaults:n.marginDefaults,loading:z,loadingContent:j,emptyContent:$,width:J,height:K}),xe=Ye(()=>{if(!1!==ee)return{legendGroups:[{label:"",type:"fill",styleFn:e=>({fill:e.color||"currentColor"}),items:[{label:y,color:b},{label:g,color:v}]}]}},[ee,y,g,b,v]),Ae=Ze(e=>{const t=e.__diffSegment;return{fill:"A"==(t?.endsWith("-A")?"A":"B")?b:v,stroke:"none",fillOpacity:H}},[b,v,H]),we=Ze(e=>({stroke:"A"==("line-A"===e.__diffSegment?"A":"B")?b:v,strokeWidth:A,fill:"none"}),[b,v,A]),ke=Ze(e=>({fill:"A"==("line-A"===e.__diffSegment?"A":"B")?b:v,r:k}),[b,v,k]),Se=Ze(e=>{const t=e.data,o=e.allSeries,n=e.xValue??t?.__x;let i=t?.__valA,r=t?.__valB;if(o&&o.length>0){const e=o.find(e=>"line-A"===e.group),t=o.find(e=>"line-B"===e.group);null!=e?.value&&Number.isFinite(e.value)&&(i=e.value),null!=t?.value&&Number.isFinite(t.value)&&(r=t.value)}if(null!=n&&(null==i||null==r)){const e=pe.find(e=>se(e)===n);e&&(null==i&&(i=le(e)),null==r&&(r=ce(e)))}const a=e=>null!=e&&Number.isFinite(e)?""+Math.round(100*e)/100:"—",s=c&&null!=n?c(n):null!=n?n+"":"";return tt("div",{className:"semiotic-tooltip",style:S,children:[s&&et("div",{style:{fontWeight:600,marginBottom:4},children:s}),tt("div",{style:{display:"flex",alignItems:"center",gap:6},children:[et("span",{style:{width:10,height:10,background:b,display:"inline-block",borderRadius:2}}),tt("span",{children:[y,": ",a(i)]})]}),tt("div",{style:{display:"flex",alignItems:"center",gap:6},children:[et("span",{style:{width:10,height:10,background:v,display:"inline-block",borderRadius:2}}),tt("span",{children:[g,": ",a(r)]})]}),null!=i&&null!=r&&Number.isFinite(i)&&Number.isFinite(r)&&tt("div",{style:{marginTop:4,opacity:.7},children:["Δ = ",a(i-r)]})]})},[pe,se,le,ce,c,b,v,y,g]),Ce="multi"===I,Le=Ye(()=>!1===I?()=>null:Ce?Se:_(I)||Se,[I,Ce,Se]);if(ve.earlyReturn)return ve.earlyReturn;const He={chartType:"mixed",data:ge,xAccessor:"__x",yAccessor:"__y",y0Accessor:"__y0",groupAccessor:"__diffSegment",areaGroups:be,curve:L,areaStyle:Ae,lineStyle:we,...w&&{pointStyle:ke},size:[J,K],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ve.margin,showAxes:n.showAxes,xLabel:re,yLabel:ae,xFormat:c,yFormat:h,enableHover:U,showGrid:Z,...B&&{gradientFill:!0===B?{topOpacity:.85,bottomOpacity:.15}:B},...xe&&{legend:xe,legendPosition:ve.legendPosition},...d({title:te,description:oe,summary:ne,accessibleTable:ie,className:s,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),tooltipContent:Le,...Ce&&{tooltipMode:"multi"},...m({linkedHover:M,selection:W,onObservation:E,onClick:O,hoverHighlight:T,mobileInteraction:ve.mobileInteraction,customHoverBehavior:ve.customHoverBehavior,customClickBehavior:ve.customClickBehavior}),...F&&F.length>0&&{annotations:F},...R&&{xExtent:R},...N&&{yExtent:N},...ve.crosshairProps,...P};return et(Y,{componentName:"DifferenceChart",width:J,height:K,children:et(l,{ref:o,...He})})});"function"==typeof nt&&(nt.displayName="DifferenceChart");import{useMemo as it,forwardRef as rt,useRef as at}from"react";import{jsx as st}from"react/jsx-runtime";var lt=rt(function(e,o){const n=at(null),r=D(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:s,margin:c,className:h,xFormat:u,yFormat:y,xAccessor:g="x",yAccessor:b="y",areaBy:v,lineDataAccessor:x="coordinates",colorBy:A,colorScheme:k,styleRules:S,curve:L="monotoneX",areaOpacity:H=.7,showLine:B=!0,lineWidth:I=2,showPoints:F=!1,pointRadius:R=3,normalize:_=!1,baseline:N="zero",stackOrder:P,tooltip:W,annotations:M,xExtent:E,yExtent:O,frameProps:T={},selection:G,linkedHover:z,onObservation:j,onClick:$,hoverHighlight:Q,chartId:V,loading:q,loadingContent:J,emptyContent:K,legendInteraction:U,legendPosition:Z,color:ee,stroke:te,strokeWidth:oe,opacity:ne}=e,{width:ie,height:re,enableHover:ae,showGrid:se,showLegend:le,title:ce,description:he,summary:de,accessibleTable:me,xLabel:ue,yLabel:pe}=r,fe=it(()=>C(s),[s]),ye=A||v;a(o,{variant:"xy",frameRef:n});const ge=i({data:fe,rawData:s,colorBy:ye,colorScheme:k,legendInteraction:U,legendPosition:Z,selection:G,linkedHover:z,fallbackFields:ye?["string"==typeof ye?ye:""]:[],unwrapData:!1,onObservation:j,onClick:$,hoverHighlight:Q,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"StackedAreaChart",chartId:V,showLegend:le,userMargin:c,marginDefaults:r.marginDefaults,loading:q,loadingContent:J,emptyContent:K,width:ie,height:re}),be=it(()=>f(g,b),[g,b]),{flattenedData:ve,lineStyle:xe,pointStyle:Ae,defaultTooltipContent:we}=$e({safeData:fe,data:s,areaBy:v,lineDataAccessor:x,colorBy:ye,colorScale:ge.colorScale,color:ee,stroke:te,strokeWidth:oe,opacity:ne,effectiveSelectionHook:ge.effectiveSelectionHook,resolvedSelection:ge.resolvedSelection,areaOpacity:H,showLine:B,lineWidth:I,showPoints:F,pointRadius:R,xAccessor:g,yAccessor:b,xLabel:ue,yLabel:pe,xFormat:u,yFormat:y,groupField:v||A,styleRules:S,ruleContext:be}),ke=t({componentName:"StackedAreaChart",data:s,accessors:{xAccessor:g,yAccessor:b}}),Se={chartType:"stackedarea",...null!=s&&{data:ve},xAccessor:g,yAccessor:b,groupAccessor:v||void 0,curve:L,normalize:_,baseline:_?"zero":N,stackOrder:P,lineStyle:xe,...F&&Ae&&{pointStyle:Ae},size:[ie,re],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ge.margin,showAxes:r.showAxes,xLabel:ue,yLabel:pe,xFormat:u,yFormat:y,enableHover:ae,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:se,...ge.legendBehaviorProps,...d({title:ce,description:he,summary:de,accessibleTable:me,className:h,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),..."multi"===W?{tooltipContent:w(),tooltipMode:"multi"}:p({tooltip:W,defaultTooltipContent:we}),...m({linkedHover:z,selection:G,onObservation:j,onClick:$,hoverHighlight:Q,mobileInteraction:ge.mobileInteraction,customHoverBehavior:ge.customHoverBehavior,customClickBehavior:ge.customClickBehavior}),...M&&M.length>0&&{annotations:M},...E&&{xExtent:E},...O&&{yExtent:O},...ge.crosshairProps,...T};return ge.earlyReturn?ge.earlyReturn:ke?st(X,{componentName:"StackedAreaChart",message:ke,width:ie,height:re}):st(Y,{componentName:"StackedAreaChart",width:ie,height:re,children:st(l,{ref:n,...Se})})});lt.displayName="StackedAreaChart";import{useMemo as ct,forwardRef as ht,useRef as dt}from"react";import{scaleSequential as mt}from"d3-scale";import{jsx as ut}from"react/jsx-runtime";var pt=ht(function(e,o){const n=dt(null);a(o,{variant:"xy",frameRef:n});const i=D(e.mode,{width:e.width,height:e.height,showGrid:void 0,enableHover:e.enableHover,showLegend:void 0,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:r,margin:h,className:f,xAccessor:y="x",yAccessor:g="y",valueAccessor:b="value",xFormat:v,yFormat:x,colorScheme:A,customColorScale:w,showValues:k=!1,valueFormat:S,cellBorderColor:L="#fff",cellBorderWidth:I=1,tooltip:F,annotations:R,xExtent:_,yExtent:N,frameProps:P={},selection:E,linkedHover:T,onObservation:G,onClick:z,hoverHighlight:$,chartId:Q,loading:K,loadingContent:U,emptyContent:Z,showLegend:ee,legendPosition:te,legendInteraction:oe}=e,{width:ne,height:ie,enableHover:re,title:ae,description:se,summary:le,accessibleTable:ce,xLabel:he,yLabel:de}=i,me=J(K,ne,ie,U),ue=me?null:q(r,ne,ie,Z),pe=ct(()=>C(r),[r]),fe=j(),ye=A??fe??"blues",ge=ee??!1,be=te??"right",{margin:ve}=W({data:pe,colorBy:ge?"value":void 0,colorScale:void 0,showLegend:ge,legendPosition:be,userMargin:h,defaults:i.marginDefaults}),{customHoverBehavior:xe,customClickBehavior:Ae,crosshairSourceId:we}=M({selection:E,linkedHover:T,fallbackFields:[],onObservation:G,onClick:z,chartType:"Heatmap",chartId:Q,hoverHighlight:$,colorByField:void 0,mobileInteraction:i.mobileInteraction});s(E);const ke=H(T,we);O(oe,void 0,[]);const Se=ct(()=>"function"==typeof b?e=>b(e):e=>e[b],[b]),Ce=ct(()=>{const e=pe.map(Se);return V(e)},[pe,Se]),Le=ct(()=>{if("custom"===ye&&w)return w;const e=B(ye);return mt(e).domain(Ce)},[ye,w,Ce]),He=ct(()=>{const e=Number.isFinite(I)?Math.max(0,I):1;return()=>({stroke:L,strokeWidth:e})},[L,I]),Be=ct(()=>u([{label:he||c(y),accessor:y,role:"x",format:v},{label:de||c(g),accessor:g,role:"y",format:x},{label:c(b),accessor:b,role:"value",format:S}]),[y,g,he,de,b,v,x,S]),Ie=t({componentName:"Heatmap",data:r,accessors:{xAccessor:y,yAccessor:g,valueAccessor:b}}),Fe=ct(()=>{if(ge)return{gradient:{colorFn:e=>Le(e),domain:Ce,label:"string"==typeof b?b:"value",format:S}}},[ge,Le,Ce,b,S]),Re={chartType:"heatmap",...null!=r&&{data:pe},xAccessor:y,yAccessor:g,valueAccessor:b,colorScheme:"custom"!==ye?ye:void 0,areaStyle:He,showValues:k,heatmapValueFormat:S,size:[ne,ie],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ve,showAxes:i.showAxes,xLabel:he,yLabel:de,xFormat:v,yFormat:x,enableHover:re,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...Fe&&{legend:Fe,legendPosition:be},...d({title:ae,description:se,summary:le,accessibleTable:ce,className:f,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...p({tooltip:F,defaultTooltipContent:Be}),...m({linkedHover:T,selection:E,onObservation:G,onClick:z,hoverHighlight:$,mobileInteraction:i.mobileInteraction,customHoverBehavior:xe,customClickBehavior:Ae}),...R&&R.length>0&&{annotations:R},..._&&{xExtent:_},...N&&{yExtent:N},...ke,...P};return me||ue||(Ie?ut(X,{componentName:"Heatmap",message:Ie,width:ne,height:ie}):ut(Y,{componentName:"Heatmap",width:ne,height:ie,children:ut(l,{ref:n,...Re})}))});pt.displayName="Heatmap";import{useMemo as ft,useCallback as yt,forwardRef as gt,useRef as bt}from"react";import{jsx as vt}from"react/jsx-runtime";var xt=gt(function(o,n){const r=bt(null),s=D(o.mode,{width:o.width,height:o.height,showGrid:o.showGrid,enableHover:o.enableHover,showLegend:o.showLegend,title:o.title,xLabel:o.xLabel,yLabel:o.yLabel,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,responsiveRules:o.responsiveRules}),{data:h,margin:y,className:g,xFormat:b,yFormat:v,xAccessor:x="x",yAccessor:A="y",sizeBy:w,sizeRange:k=[5,40],colorBy:S,colorScheme:L,styleRules:H,bubbleOpacity:B=.6,bubbleStrokeWidth:F=1,bubbleStrokeColor:_="white",tooltip:N,marginalGraphics:W,pointIdAccessor:M,annotations:E,regression:O,xExtent:T,yExtent:G,frameProps:z={},selection:j,linkedHover:$,linkedBrush:Q,onObservation:V,onClick:q,hoverHighlight:J,chartId:K,loading:U,loadingContent:Z,emptyContent:ee,legendInteraction:te,legendPosition:oe,color:ne,stroke:re,strokeWidth:ae,opacity:se}=o,{width:le,height:he,enableHover:de,showGrid:me,showLegend:ue,title:pe,description:fe,summary:ye,accessibleTable:ge,xLabel:be,yLabel:ve}=s,xe=ft(()=>C(h),[h]),Ae=void 0===h,we=i({data:xe,rawData:h,colorBy:S,colorScheme:L,legendInteraction:te,legendPosition:oe,selection:j,linkedHover:$,fallbackFields:S?["string"==typeof S?S:""]:[],unwrapData:!1,onObservation:V,onClick:q,hoverHighlight:J,mobileInteraction:s.mobileInteraction,mobileSemantics:s.mobileSemantics,chartType:"BubbleChart",chartId:K,showLegend:ue,userMargin:y,marginDefaults:s.marginDefaults,loading:U,loadingContent:Z,emptyContent:ee,width:le,height:he}),{domain:ke,trackPushed:Se,reset:Ce}=ce({accessor:w,data:xe,isPushMode:Ae}),Le=yt(e=>{Se([e]),r.current?.push(e)},[Se]),He=yt(e=>{Se(e),r.current?.pushMany(e)},[Se]);a(n,{variant:"xy",frameRef:r,overrides:{push:Le,pushMany:He,clear:()=>{Ce(),r.current?.clear()}}});const Be=R(Q),Ie=(P({name:Be?.name||"__unused_brush__",xField:Be?.xField||("string"==typeof x?x:void 0),yField:Be?.yField||("string"==typeof A?A:void 0)}),ft(()=>({stroke:_,strokeWidth:F}),[_,F])),Fe=ft(()=>ke??[0,1],[ke]),Re=yt(e=>I(e,w,k,Fe),[w,k,Fe]),_e=ft(()=>f(x,A),[x,A]),Ne=ie({colorBy:S,colorScale:we.colorScale,color:ne,fillOpacity:B,radiusFn:Re,baseStyleExtras:Ie,stroke:re,strokeWidth:ae,opacity:se,styleRules:H,ruleContext:_e,effectiveSelectionHook:we.effectiveSelectionHook,resolvedSelection:we.resolvedSelection}),Pe=ft(()=>u([{label:be||c(x),accessor:x,role:"x",format:b},{label:ve||c(A),accessor:A,role:"y",format:v},{label:c(w),accessor:w,role:"size"},...S?[{label:c(S),accessor:S,role:"color"}]:[]]),[x,A,be,ve,w,S,b,v]);if(we.earlyReturn)return we.earlyReturn;const We=t({componentName:"BubbleChart",data:h,accessors:{xAccessor:x,yAccessor:A},requiredProps:{sizeBy:w}});if(We)return vt(X,{componentName:"BubbleChart",message:We,width:le,height:he});const De=e(O),Me=De?[De,...E||[]]:E,Ee={chartType:"bubble",...null!=h&&{data:xe},xAccessor:x,yAccessor:A,colorAccessor:S||void 0,sizeAccessor:w,sizeRange:k,pointStyle:Ne,colorScheme:L,size:[le,he],responsiveWidth:o.responsiveWidth,responsiveHeight:o.responsiveHeight,margin:we.margin,showAxes:s.showAxes,xLabel:be,yLabel:ve,xFormat:b,yFormat:v,enableHover:de,showGrid:me,...we.legendBehaviorProps,...d({title:pe,description:fe,summary:ye,accessibleTable:ge,className:g,animate:o.animate,axisExtent:o.axisExtent,autoPlaceAnnotations:o.autoPlaceAnnotations}),...p({tooltip:N,defaultTooltipContent:Pe}),...m({linkedHover:$,selection:j,onObservation:V,onClick:q,hoverHighlight:J,mobileInteraction:we.mobileInteraction,customHoverBehavior:we.customHoverBehavior,customClickBehavior:we.customClickBehavior}),...W&&{marginalGraphics:W},...M&&{pointIdAccessor:M},...Me&&Me.length>0&&{annotations:Me},...T&&{xExtent:T},...G&&{yExtent:G},...we.crosshairProps,...z};return vt(Y,{componentName:"BubbleChart",width:le,height:he,children:vt(l,{ref:r,...Ee})})});xt.displayName="BubbleChart";import*as At from"react";import{useMemo as wt,useCallback as kt,useState as St,useRef as Ct}from"react";import*as Lt from"react";import{jsx as Ht}from"react/jsx-runtime";var Bt=null,It=null;function Ft(e){const[t,o]=Lt.useState(()=>Bt);return Lt.useEffect(()=>{if(t)return;let e=!1;return(Bt?Promise.resolve(Bt):(It||(It=import("./chunk-scatterplotMatrixBrushOverlay-SDIZSN66.module.min.js").then(e=>Bt=e.ScatterplotMatrixBrushOverlay).catch(e=>{throw It=null,e})),It)).then(t=>{e||o(()=>t)}).catch(()=>{}),()=>{e=!0}},[t]),t?Ht(t,{...e}):null}import{jsx as Rt,jsxs as _t}from"react/jsx-runtime";var Nt="__splomIdx",Pt={top:4,bottom:4,left:4,right:4};function Wt({data:e,xField:t,yField:o,cellSize:n,pointRadius:i,pointOpacity:r,colorBy:a,colorScale:s,brushSelectionName:c,hoverSelectionName:h,unselectedOpacity:d,mobileInteraction:u,mode:p,onPointHover:f,onPointClick:y}){const g=Ct(null),v=T({name:c,clientId:`splom-${t}-${o}`,fields:[t,o]}),x=P({name:c,xField:t,yField:o}),A=T({name:h,clientId:"splom-hover-source",fields:[Nt]}),w=A.selectPoints,k=kt(e=>{e?x.brushInteraction.during(e):x.brushInteraction.end(null)},[x.brushInteraction]),S=kt(e=>{if(!e)return void f?.(null);const t=e.data,o=t?.[Nt];void 0!==o&&(w({[Nt]:[o]}),f?.(t,e.x+Pt.left,e.y+Pt.top))},[w,f]),C=kt(e=>{if(!e)return void y?.(null);const t=e.data;t&&y?.(t,e.x+Pt.left,e.y+Pt.top)},[y]),H=kt(e=>{const t={opacity:r,r:i};return t.fill=a?L(e,a,s):b,"hover"===p?A.isActive&&A.predicate(e)?(t.opacity=1,t.r=2.5*i,t.stroke="#333",t.strokeWidth=1.5):A.isActive&&(t.opacity=.6*r):v.isActive&&!v.predicate(e)&&(t.opacity=d),t},[r,i,a,p,s,A,v,d]);return _t("div",{style:{position:"relative",width:n,height:n},children:[Rt(l,{ref:g,chartType:"scatter",data:e,size:[n,n],xAccessor:t,yAccessor:o,pointStyle:H,margin:Pt,showAxes:!1,enableHover:"hover"===p,...m({forceHoverBehavior:"hover"===p,forceClickBehavior:!!y,mobileInteraction:u,customHoverBehavior:S,customClickBehavior:C}),tooltipContent:"hover"===p?()=>null:void 0}),"brush"===p&&Rt(Ft,{frameRef:g,cellSize:n,onBrush:k})]})}function Dt({data:e,field:t,label:o,cellSize:n,bins:i,colorBy:r,colorScale:a,brushSelectionName:s,hoverSelectionName:l,mode:c}){const h=T({name:s,clientId:"splom-diag-"+t,fields:[t]}),d=T({name:l,clientId:`splom-diag-${t}-hover`,fields:[Nt]}),m="hover"===c?d:h,u=m.isActive,p=m.predicate,f=wt(()=>{const o="string"==typeof r?r:null,a=[],s=new Set;for(const n of e){const e=n[t];if(null==e||isNaN(e)||a.push(Number(e)),o){const e=n[o];null!=e&&s.add(e+"")}}if(0===a.length)return{bars:[],selectedBars:[],categoryBars:[],selectedCategoryBars:[],max:0,categories:[]};const[l,c]=V(a),h=(c-l)/i||1,d=Array.from(s),m=new Map(d.map((e,t)=>[e,t])),f=Array(i).fill(0),y=Array(i).fill(0),g=Array.from({length:i},()=>Array(d.length).fill(0)),b=Array.from({length:i},()=>Array(d.length).fill(0));for(const n of e){const e=n[t];if(null==e||isNaN(e))continue;const r=Math.min(Math.floor((e-l)/h),i-1);if(f[r]++,u&&!p(n)||y[r]++,o){const e=m.get(n[o]+"");void 0!==e&&(g[r][e]++,u&&!p(n)||b[r][e]++)}}const v=Q(f,1),x=g.map((e,t)=>{let o=0;return e.map((e,r)=>{const a=e/v*(n-24),s={x:t/i*n,w:n/i-1,h:a,y0:o,category:d[r]};return o+=a,s})}),A=b.map((e,t)=>{let o=0;return e.map((e,r)=>{const a=e/v*(n-24),s={x:t/i*n,w:n/i-1,h:a,y0:o,category:d[r]};return o+=a,s})});return{bars:f.map((e,t)=>({x:t/i*n,w:n/i-1,h:e/v*(n-24),count:e})),selectedBars:y.map((e,t)=>({x:t/i*n,w:n/i-1,h:e/v*(n-24),count:e})),categoryBars:x,selectedCategoryBars:A,max:v,categories:d}},[e,t,i,n,u,p,r]);return _t("svg",{width:n,height:n,style:{overflow:"hidden"},children:[Rt("text",{x:n/2,y:14,textAnchor:"middle",fontSize:11,fontWeight:"bold",fill:"#333",children:o}),f.categories.length>0?f.categoryBars.map((e,t)=>e.map((e,o)=>Rt("rect",{x:e.x,y:n-e.y0-e.h,width:Math.max(e.w,1),height:e.h,fill:a?a(e.category):b,opacity:u?.3:.6},`bg-${t}-${o}`))):f.bars.map((e,t)=>Rt("rect",{x:e.x,y:n-e.h,width:Math.max(e.w,1),height:e.h,fill:b,opacity:u?.3:.6},"bg-"+t)),u&&(f.categories.length>0?f.selectedCategoryBars.map((e,t)=>e.map((e,o)=>Rt("rect",{x:e.x,y:n-e.y0-e.h,width:Math.max(e.w,1),height:e.h,fill:a?a(e.category):b,opacity:.7},`sel-${t}-${o}`))):f.selectedBars.map((e,t)=>Rt("rect",{x:e.x,y:n-e.h,width:Math.max(e.w,1),height:e.h,fill:b,opacity:.7},"sel-"+t)))]})}function Mt({label:e,cellSize:t}){return Rt("svg",{width:t,height:t,children:Rt("text",{x:t/2,y:t/2,textAnchor:"middle",dominantBaseline:"middle",fontSize:12,fontWeight:"bold",fill:"#333",children:e})})}function Et(e){const{data:t,fields:o,fieldLabels:n={},colorBy:i,colorScheme:r,cellSize:a=150,cellGap:s=4,pointRadius:l=2,pointOpacity:c=.5,diagonal:h="histogram",histogramBins:d=20,brushMode:m="crossfilter",hoverMode:u=!0,unselectedOpacity:p=.1,showGrid:f=!1,tooltip:y,showLegend:g,idAccessor:v,width:x,className:A,onObservation:w,onClick:k,chartId:S}=e,C="splom",L="splom-hover",H=N(e.mobileInteraction,{mode:e.mode,width:x??o.length*a,mobileSemantics:e.mobileSemantics}),B=u?"hover":m?"brush":"hover",I=G(e=>e.clearSelection),[F,R]=St(null),_=kt(()=>{I(L),R(null)},[I,L]),P=wt(()=>(t||[]).map((e,t)=>void 0!==e[Nt]?e:{...e,[Nt]:t}),[t]),W=E(P,i,r),D=kt((e,t,o,n)=>[40+e*(a+s)+(o??0),t*(a+s)+(n??0)],[40,a,s]),M=void 0!==g?g:!!i,O=wt(()=>{if(!M||!i)return null;const e="string"==typeof i?i:null;return e?Array.from(new Set(P.map(t=>t[e]).filter(e=>null!=e))).map(e=>({label:e+"",color:W?W(e+""):b})):null},[M,i,P,W]),T=wt(()=>({display:"grid",gridTemplateColumns:"40px "+o.map(()=>a+"px").join(" "),gridTemplateRows:o.map(()=>a+"px").join(" ")+" 40px",gap:s+"px",width:"fit-content"}),[o,a,s,40]);return _t("div",{className:A,style:{position:"relative"},children:[O&&Rt("div",{style:{display:"flex",gap:12,marginBottom:8,flexWrap:"wrap"},children:O.map(e=>_t("div",{style:{display:"flex",alignItems:"center",gap:4},children:[Rt("span",{style:{display:"inline-block",width:10,height:10,borderRadius:"50%",backgroundColor:e.color}}),Rt("span",{style:{fontSize:11},children:e.label})]},e.label))}),_t("div",{style:T,onMouseLeave:"hover"===B?_:void 0,children:[o.map((e,t)=>_t(At.Fragment,{children:[Rt("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",writingMode:"vertical-rl",transform:"rotate(180deg)",fontSize:11,fontWeight:"bold",color:"#333"},children:n[e]||e}),o.map((o,r)=>t===r?"label"===h?Rt(Mt,{label:n[e]||e,cellSize:a},"diag-"+e):Rt(Dt,{data:P,field:e,label:n[e]||e,cellSize:a,bins:d,colorBy:i,colorScale:W,brushSelectionName:C,hoverSelectionName:L,unselectedOpacity:p,mode:B},"diag-"+e):Rt(Wt,{data:P,xField:o,yField:e,fieldLabels:n,cellSize:a,pointRadius:l,pointOpacity:c,colorBy:i,colorScale:W,brushSelectionName:C,hoverSelectionName:L,unselectedOpacity:p,showGrid:f,tooltip:y,mobileInteraction:H,mode:B,onPointHover:"hover"===B?(n,i,a)=>{if(n){if(R({datum:n,xField:o,yField:e,colIndex:r,rowIndex:t,px:i??0,py:a??0}),w){const[e,o]=D(r,t,i,a);w({type:"hover",datum:n,x:e,y:o,timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:S})}}else R(null),w&&w({type:"hover-end",timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:S})}:void 0,onPointClick:k||w?(e,o,n)=>{if(!e)return;const[i,a]=D(r,t,o,n);k&&k(e,{x:i,y:a}),w&&w({type:"click",datum:e,x:i,y:a,timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:S})}:void 0},`cell-${e}-${o}`))]},"row-"+e)),Rt("div",{})," ",o.map(e=>Rt("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,fontWeight:"bold",color:"#333"},children:n[e]||e},"col-label-"+e))]}),F&&"hover"===B&&(()=>{const e=F.datum,t=n[F.xField]||F.xField,o=n[F.yField]||F.yField,r=i?"function"==typeof i?i(e):e[i]:null,l=v?"function"==typeof v?v(e):e[v]:"Row "+e[Nt];return _t("div",{style:{position:"absolute",left:40+F.colIndex*(a+s)+F.px,top:F.rowIndex*(a+s)+F.py-8,transform:"translate(-50%, -100%)",color:"#333",background:"rgba(255,255,255,0.95)",border:"1px solid #ddd",borderRadius:3,padding:"4px 8px",fontSize:11,lineHeight:1.4,whiteSpace:"nowrap",pointerEvents:"none",zIndex:10},children:[Rt("div",{style:{fontWeight:"bold",marginBottom:2},children:l+""}),_t("div",{children:[t,": ",null!=e[F.xField]?Number(e[F.xField]).toFixed(1):"–"]}),_t("div",{children:[o,": ",null!=e[F.yField]?Number(e[F.yField]).toFixed(1):"–"]}),null!=r&&_t("div",{style:{opacity:.8},children:["string"==typeof i?i:"group",": ",r+""]})]})})()]})}function Ot(e){const{brushMode:t="crossfilter",hoverMode:o=!0}=e,n={};return!o&&t&&(n.splom={resolution:t}),o&&(n["splom-hover"]={resolution:"union"}),Rt(A,{selections:n,children:Rt(Et,{...e})})}Ot.displayName="ScatterplotMatrix";import{useState as Tt,useRef as Gt,useEffect as zt,useMemo as jt,useCallback as $t}from"react";import*as Qt from"react";import{jsx as Vt}from"react/jsx-runtime";var Xt=null,Yt=null;function qt(e){const[t,o]=Qt.useState(()=>Xt);return Qt.useEffect(()=>{if(t)return;let e=!1;return(Xt?Promise.resolve(Xt):(Yt||(Yt=import("./chunk-minimapBrushOverlay-JU57U7NM.module.min.js").then(e=>Xt=e.MinimapBrushOverlay).catch(e=>{throw Yt=null,e})),Yt)).then(t=>{e||o(()=>t)}).catch(()=>{}),()=>{e=!0}},[t]),t?Vt(t,{...e}):null}import{jsx as Jt,jsxs as Kt}from"react/jsx-runtime";function Ut(e){const{data:o,width:n=600,height:i=400,margin:r,className:a,title:s,description:h,summary:d,xLabel:m,yLabel:p,xFormat:f,yFormat:y,xAccessor:g="x",yAccessor:v="y",lineBy:x,lineDataAccessor:A="coordinates",colorBy:w,colorScheme:k,curve:S="linear",lineWidth:H=2,fillArea:B=!1,areaOpacity:I=.3,showPoints:F=!1,pointRadius:R=3,enableHover:N=!0,showGrid:P=!1,showLegend:D,legendPosition:M,tooltip:O,minimap:T={},renderBefore:G=!1,onBrush:z,brushExtent:j,yExtent:$,frameProps:Q={},loading:V,loadingContent:K,emptyContent:U}=e,Z=J(V,n,i,K),ee=Z?null:q(o,n,i,U),te=jt(()=>C(o),[o]),[oe,ne]=Tt(null),ie=j??oe,re=$t(e=>{j||ne(e),z?.(e)},[j,z]),ae=Gt(null),[se,le]=Tt(null);zt(()=>{let e=0,t=!1;const o=()=>{if(t)return;const n=ae.current?.getScales?.();n?le(n):e=requestAnimationFrame(o)};return e=requestAnimationFrame(o),()=>{t=!0,e&&cancelAnimationFrame(e)}},[o]);const ce=void 0!==te[0]?.[A],he=jt(()=>{if(ce)return te;if(x){const e=te.reduce((e,t)=>{const o="function"==typeof x?x(t):t[x];if(!e[o]){const t={[A]:[]};"string"==typeof x&&(t[x]=o),e[o]=t}return e[o][A].push(t),e},{});return Object.values(e)}return[{[A]:te}]},[te,x,A,ce]),de=jt(()=>ce||x?he.flatMap(e=>{const t=e[A]||[];return x&&"string"==typeof x?t.map(t=>({...t,[x]:e[x]})):t}):te,[he,A,ce,x,te]),me=E(te,w,k),ue=De({lineWidth:H,colorBy:w,colorScale:me,fillArea:B,areaOpacity:I}),pe=jt(()=>{if(T.lineStyle)return T.lineStyle},[T.lineStyle]),fe=De({lineWidth:1,colorBy:w,colorScale:me}),ye=pe??fe,ge=jt(()=>{if(F)return e=>{const t={r:R,fillOpacity:1};return t.fill=w?L(e.parentLine||e,w,me):b,t}},[F,R,w,me]),{legend:be,margin:ve,legendPosition:xe}=W({data:he,colorBy:w,colorScale:me,showLegend:D,legendPosition:M,userMargin:r}),Ae=T.height||60,we=jt(()=>({top:T.margin?.top??0,bottom:T.margin?.bottom??20,left:T.margin?.left??ve.left,right:T.margin?.right??ve.right}),[T.margin,ve]),ke=T.brushDirection||"x",Se=jt(()=>u([{label:m||c(g),accessor:g,role:"x",format:f},{label:p||c(v),accessor:v,role:"y",format:y}]),[g,v,m,p,f,y]),Ce=t({componentName:"MinimapChart",data:o,accessors:{xAccessor:g,yAccessor:v}});if(Ce)return Jt(X,{componentName:"MinimapChart",message:Ce,width:n,height:i});const Le=B?"area":"line",He={chartType:Le,data:de,xAccessor:g,yAccessor:v,groupAccessor:x||void 0,curve:S,lineStyle:ue,...F&&{pointStyle:ge},size:[n,i],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ve,showAxes:!0,xLabel:m,yLabel:p,xFormat:f,yFormat:y,enableHover:N,showGrid:P,...be&&{legend:be,legendPosition:xe},...s&&{title:s},...h&&{description:h},...d&&{summary:d},tooltipContent:!1===O?()=>null:_(O)||Se,...ie&&{xExtent:ie},...$&&{yExtent:$},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...Q},Be={chartType:Le,data:de,xAccessor:g,yAccessor:v,groupAccessor:x||void 0,curve:S,lineStyle:ye,size:[n,Ae+we.top+we.bottom],margin:we,showAxes:T.showAxes??!1,background:T.background,enableHover:!1,...$&&{yExtent:$}},Ie=Kt("div",{style:{position:"relative",width:n,overflow:"hidden"},children:[Jt(l,{ref:ae,...Be}),Jt(qt,{width:n-we.left-we.right,height:Ae,margin:we,scales:se,brushDirection:ke,extent:ie,onBrush:re})]},"minimap"),Fe=Jt("div",{style:{overflow:"hidden"},children:Jt(l,{...He})},"main");return Z||ee||Jt(Y,{componentName:"MinimapChart",width:n,height:i,children:Kt("div",{className:"minimap-chart"+(a?" "+a:""),children:[G?Ie:Fe,G?Fe:Ie]})})}Ut.displayName="MinimapChart";import{useMemo as Zt,forwardRef as eo,useRef as to}from"react";var oo={topLeft:{label:"Low / High",color:"#E9C46A",opacity:.08},topRight:{label:"High / High",color:"#2A9D8F",opacity:.08},bottomLeft:{label:"Low / Low",color:"#E76F51",opacity:.08},bottomRight:{label:"High / Low",color:"#86BBD8",opacity:.08}};import{Fragment as no,jsx as io,jsxs as ro}from"react/jsx-runtime";function ao(e,t){return{label:t?.label??e.label,color:t?.color??e.color,opacity:t?.opacity??e.opacity}}var so=eo(function(e,o){const n=to(null);a(o,{variant:"xy",frameRef:n});const r=D(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:s,margin:h,className:d,xFormat:p,yFormat:y,xAccessor:g="x",yAccessor:v="y",xCenter:x,yCenter:A,quadrants:w,centerlineStyle:k={},showQuadrantLabels:S=!0,quadrantLabelSize:L=12,colorBy:H,colorScheme:B,styleRules:F,sizeBy:R,sizeRange:N=[3,15],pointRadius:P=5,pointOpacity:W=.8,tooltip:M,pointIdAccessor:E,annotations:O,frameProps:T={},selection:G,linkedHover:z,onObservation:j,onClick:$,hoverHighlight:Q,chartId:q,loading:J,loadingContent:U,emptyContent:Z,legendInteraction:ee,legendPosition:te,color:oe,stroke:ne,strokeWidth:re,opacity:ae}=e,{width:se,height:le,enableHover:ce,showGrid:he,showLegend:de,title:me,description:ue,summary:pe,accessibleTable:fe,xLabel:ye,yLabel:ge}=r,be=Zt(()=>({topLeft:ao(oo.topLeft,w?.topLeft),topRight:ao(oo.topRight,w?.topRight),bottomLeft:ao(oo.bottomLeft,w?.bottomLeft),bottomRight:ao(oo.bottomRight,w?.bottomRight)}),[w]),ve=Zt(()=>C(s),[s]),xe=i({data:ve,rawData:s,colorBy:H,colorScheme:B,legendInteraction:ee,legendPosition:te,selection:G,linkedHover:z,fallbackFields:"string"==typeof H?[H]:[],unwrapData:!1,onObservation:j,onClick:$,hoverHighlight:Q,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"QuadrantChart",chartId:q,showLegend:de,userMargin:h,marginDefaults:r.marginDefaults,loading:J,loadingContent:U,emptyContent:Z,width:se,height:le});K("QuadrantChart",ve,"xAccessor",g),K("QuadrantChart",ve,"yAccessor",v);const Ae=Zt(()=>{if(!ve.length)return;const e="function"==typeof g?g:e=>+e[g],t="function"==typeof v?v:e=>+e[v];let o=1/0,n=-1/0,i=1/0,r=-1/0;for(const a of ve){const s=e(a),l=t(a);isFinite(s)&&(o>s&&(o=s),s>n&&(n=s)),isFinite(l)&&(i>l&&(i=l),l>r&&(r=l))}if(null!=x&&isFinite(x)&&(o>x&&(o=x),x>n&&(n=x)),null!=A&&isFinite(A)&&(i>A&&(i=A),A>r&&(r=A)),o===1/0)return;const a=.1*(n-o)||1,s=.1*(r-i)||1;return{xExtent:[o-a,n+a],yExtent:[i-s,r+s]}},[ve,g,v,x,A]),we=Zt(()=>{if(!R||0===ve.length)return;const e=ve.map(e=>"function"==typeof R?R(e):e[R]).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0!==e.length?V(e):void 0},[ve,R]),ke=Zt(()=>"function"==typeof g?g:e=>+e[g],[g]),Se=Zt(()=>"function"==typeof v?v:e=>+e[v],[v]),Ce=Zt(()=>e=>{const t=ke(e),o=Se(e),n=null!=x?t>=x:void 0,i=null!=A?o>=A:void 0;return void 0===i||void 0===n?oe||b:i&&n?be.topRight.color:i&&!n?be.topLeft.color:!i&&n?be.bottomRight.color:be.bottomLeft.color},[ke,Se,x,A,be,oe]),Le=Zt(()=>R?e=>I(e,R,N,we):void 0,[R,N,we]),He=Zt(()=>f(g,v),[g,v]),Be=ie({colorBy:H,colorScale:xe.colorScale,color:oe,pointRadius:P,fillOpacity:W,radiusFn:Le,fallbackFill:Ce,stroke:ne,strokeWidth:re,opacity:ae,styleRules:F,ruleContext:He,effectiveSelectionHook:xe.effectiveSelectionHook,resolvedSelection:xe.resolvedSelection}),Ie=Zt(()=>{if(!ve.length)return;const e=new Set;"string"==typeof g&&e.add(g),"string"==typeof v&&e.add(v),"string"==typeof H&&e.add(H),"string"==typeof R&&e.add(R);const t=ve[0];for(const o of Object.keys(t))if(!o.startsWith("_")&&!e.has(o)&&"string"==typeof t[o])return o},[ve,g,v,H,R]),Fe=Zt(()=>u([...Ie?[{label:Ie,accessor:Ie,role:"title"}]:[],{label:ye||c(g),accessor:g,role:"x",format:p},{label:ge||c(v),accessor:v,role:"y",format:y},...H?[{label:c(H),accessor:H,role:"color"}]:[],...R?[{label:c(R),accessor:R,role:"size"}]:[]]),[Ie,g,v,ye,ge,H,R,p,y]),Re=t({componentName:"QuadrantChart",data:s,accessors:{xAccessor:g,yAccessor:v}}),_e=Zt(()=>{const e={stroke:k.stroke||"#999",strokeWidth:k.strokeWidth??1,dashArray:k.strokeDasharray||[]};return[(t,o,n,i)=>{if(!n?.x||!n?.y)return;const r=i.width,a=i.height,s=null!=x?n.x(x):r/2,l=null!=A?n.y(A):a/2;if(null!=x&&!isFinite(s))return;if(null!=A&&!isFinite(l))return;const c=Math.max(0,Math.min(r,s)),h=Math.max(0,Math.min(a,l)),d=[{config:be.topLeft,x:0,y:0,w:c,h:h},{config:be.topRight,x:c,y:0,w:r-c,h:h},{config:be.bottomLeft,x:0,y:h,w:c,h:a-h},{config:be.bottomRight,x:c,y:h,w:r-c,h:a-h}];for(const e of d)e.w>0&&e.h>0&&(t.fillStyle=e.config.color,t.globalAlpha=e.config.opacity??.08,t.fillRect(e.x,e.y,e.w,e.h));t.globalAlpha=1,t.strokeStyle=e.stroke,t.lineWidth=e.strokeWidth,e.dashArray.length>0&&t.setLineDash(e.dashArray),t.beginPath(),t.moveTo(c,0),t.lineTo(c,a),t.stroke(),t.beginPath(),t.moveTo(0,h),t.lineTo(r,h),t.stroke(),t.setLineDash([])}]},[x,A,be,k]),Ne=Zt(()=>S?[..._e,(e,t,o,n)=>{if(!o?.x||!o?.y)return;const i=n.width,r=n.height,a=null!=x?o.x(x):i/2,s=null!=A?o.y(A):r/2;(null==x||isFinite(a))&&(null==A||isFinite(s))&&(e.font=`600 ${L}px sans-serif`,e.globalAlpha=.5,e.fillStyle=be.topLeft.color,e.textAlign="left",e.textBaseline="top",e.fillText(be.topLeft.label,8,8),e.fillStyle=be.topRight.color,e.textAlign="right",e.textBaseline="top",e.fillText(be.topRight.label,i-8,8),e.fillStyle=be.bottomLeft.color,e.textAlign="left",e.textBaseline="bottom",e.fillText(be.bottomLeft.label,8,r-8),e.fillStyle=be.bottomRight.color,e.textAlign="right",e.textBaseline="bottom",e.fillText(be.bottomRight.label,i-8,r-8),e.globalAlpha=1)}]:_e,[_e,S,L,be,x,A]),Pe=Zt(()=>{const e=T.canvasPreRenderers||[];return[...Ne,...e]},[Ne,T.canvasPreRenderers]),We=Zt(()=>{const e={stroke:k.stroke||"#999",strokeWidth:k.strokeWidth??1,dashArray:k.strokeDasharray?Array.isArray(k.strokeDasharray)?k.strokeDasharray.join(","):k.strokeDasharray:void 0};return[(t,o,n)=>{if(!o?.x||!o?.y)return null;const i=n.width,r=n.height,a=null!=x?o.x(x):i/2,s=null!=A?o.y(A):r/2;if(null!=x&&!isFinite(a))return null;if(null!=A&&!isFinite(s))return null;const l=Math.max(0,Math.min(i,a)),c=Math.max(0,Math.min(r,s));return ro(no,{children:[[{config:be.topLeft,x:0,y:0,w:l,h:c},{config:be.topRight,x:l,y:0,w:i-l,h:c},{config:be.bottomLeft,x:0,y:c,w:l,h:r-c},{config:be.bottomRight,x:l,y:c,w:i-l,h:r-c}].map((e,t)=>e.w>0&&e.h>0?io("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:e.config.color,opacity:e.config.opacity??.08},"qf-"+t):null),io("line",{x1:l,y1:0,x2:l,y2:r,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.dashArray}),io("line",{x1:0,y1:c,x2:i,y2:c,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.dashArray}),S&&ro(no,{children:[io("text",{x:8,y:8+L,fill:be.topLeft.color,fontWeight:600,fontSize:L,opacity:.5,children:be.topLeft.label}),io("text",{x:i-8,y:8+L,fill:be.topRight.color,fontWeight:600,fontSize:L,opacity:.5,textAnchor:"end",children:be.topRight.label}),io("text",{x:8,y:r-8,fill:be.bottomLeft.color,fontWeight:600,fontSize:L,opacity:.5,children:be.bottomLeft.label}),io("text",{x:i-8,y:r-8,fill:be.bottomRight.color,fontWeight:600,fontSize:L,opacity:.5,textAnchor:"end",children:be.bottomRight.label})]})]})}]},[x,A,be,k,S,L]);if(xe.earlyReturn)return xe.earlyReturn;const De={chartType:"scatter",...null!=s&&{data:ve},xAccessor:g,yAccessor:v,colorAccessor:H||void 0,sizeAccessor:R||void 0,sizeRange:N,pointStyle:Be,colorScheme:B,size:[se,le],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:xe.margin,showAxes:r.showAxes,xLabel:ye,yLabel:ge,xFormat:p,yFormat:y,enableHover:ce,showGrid:he,...Ae&&{xExtent:Ae.xExtent,yExtent:Ae.yExtent},...xe.legendBehaviorProps,...me&&{title:me},...ue&&{description:ue},...pe&&{summary:pe},...void 0!==fe&&{accessibleTable:fe},...d&&{className:d},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:!1===M?()=>null:!0===M||void 0===M?Fe:_(M)||Fe,...m({linkedHover:z,selection:G,onObservation:j,onClick:$,hoverHighlight:Q,mobileInteraction:xe.mobileInteraction,customHoverBehavior:xe.customHoverBehavior,customClickBehavior:xe.customClickBehavior}),...E&&{pointIdAccessor:E},...O&&O.length>0&&{annotations:O},canvasPreRenderers:Pe,...xe.crosshairProps,...T,...Pe.length>0&&{canvasPreRenderers:Pe},svgPreRenderers:We};return Re?io(X,{componentName:"QuadrantChart",message:Re,width:se,height:le}):io(Y,{componentName:"QuadrantChart",width:se,height:le,children:io(l,{ref:n,...De})})});so.displayName="QuadrantChart";import*as lo from"react";import{useMemo as co,useCallback as ho,forwardRef as mo,useRef as uo,useImperativeHandle as po}from"react";import{jsx as fo}from"react/jsx-runtime";var yo="__ma_unitized",go="__ma_series";function bo(e,t){const o=t[1]-t[0];return 0===o?.5:(e-t[0])/o}function vo(e,t){return t[0]+e*(t[1]-t[0])}var xo=mo(function(e,o){const n=uo(null),r=uo([]),a=uo(e.series);a.current=e.series,po(o,()=>{const e=()=>(a.current??[]).filter(e=>null!=e&&"object"==typeof e);return{push:t=>{if(!n.current)return;const o=e(),i=t;for(let e=0;o.length>e&&2>e;e++){const t=o[e],a=t.extent||r.current[e];if(!a)continue;const s=("function"==typeof t.yAccessor?t.yAccessor:e=>e[t.yAccessor])(i);null!=s&&isFinite(s)&&n.current.push({...i,[yo]:bo(s,a),[go]:t.label||"Series "+(e+1)})}},pushMany:t=>{if(!n.current)return;const o=e(),i=[];for(const e of t)for(let t=0;o.length>t&&2>t;t++){const n=o[t],a=n.extent||r.current[t];if(!a)continue;const s=("function"==typeof n.yAccessor?n.yAccessor:e=>e[n.yAccessor])(e);null!=s&&isFinite(s)&&i.push({...e,[yo]:bo(s,a),[go]:n.label||"Series "+(t+1)})}n.current.pushMany(i)},remove:e=>n.current?.remove(e)??[],update:(e,t)=>n.current?.update(e,t)??[],clear:()=>n.current?.clear(),getData:()=>n.current?.getData()??[],getScales:()=>n.current?.getScales()??null}},[]);const s=D(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:800,height:400}),{data:c,margin:h,className:d,xFormat:u,xAccessor:p="x",series:f,colorScheme:y,curve:b="monotoneX",lineWidth:x=2,tooltip:A,annotations:w,frameProps:k={},selection:S,linkedHover:L,onObservation:H,onClick:B,hoverHighlight:I,chartId:F,loading:R,loadingContent:N,emptyContent:P,legendInteraction:W,legendPosition:M,stroke:E,strokeWidth:O,opacity:T}=e,{width:G,height:j,enableHover:$,showGrid:Q,showLegend:V=!0,title:K,description:U,summary:Z,accessibleTable:ee,xLabel:te}=s,oe=co(()=>C(c),[c]),ne=co(()=>C(f),[f]),ie=ne,re=2===ne.length;"undefined"==typeof process||"production"===process.env?.NODE_ENV||re||console.warn(`[MultiAxisLineChart] Expected exactly 2 series for dual-axis mode, got ${ne.length}. Rendering as a standard multi-line chart.`);const ae=J(R,G,j,N),se=ae?null:q(c,G,j,P),le=z(),ce=co(()=>{let e;if(Array.isArray(y))e=y;else if(le&&le.length>0)e=le;else{const t=g[y];e=Array.isArray(t)?t:v}return ie.map((t,o)=>t.color||e[o%e.length])},[ie,y,le]),he=co(()=>ne.map((e,t)=>e.label||"Series "+(t+1)),[ne]),{unitizedData:de,extents:me}=co(()=>{if(0===oe.length){const e=ne.map(e=>e.extent||null).filter(Boolean);return e.length===ne.length&&(r.current=e),{unitizedData:[],extents:e.length===ne.length?e:[]}}const e=ne.map(e=>e.extent||function(e,t){let o=1/0,n=-1/0;const i="function"==typeof t?t:e=>e[t];for(const t of e){const e=i(t);null!=e&&isFinite(e)&&(o>e&&(o=e),e>n&&(n=e))}if(!isFinite(o)||!isFinite(n))return[0,1];if(o===n){const e=0===o?1:.1*Math.abs(o);return[o-e,n+e]}return[o,n]}(oe,e.yAccessor));if(r.current=e,!re){const t=[];for(const e of oe)for(let o=0;ne.length>o;o++){const n=ne[o],i=("function"==typeof n.yAccessor?n.yAccessor:e=>e[n.yAccessor])(e);null!=i&&t.push({...e,[yo]:i,[go]:he[o]})}return{unitizedData:t,extents:e}}const t=[];for(const o of oe)for(let n=0;2>n;n++){const i=ne[n],r=("function"==typeof i.yAccessor?i.yAccessor:e=>e[i.yAccessor])(o);null!=r&&t.push({...o,[yo]:bo(r,e[n]),[go]:he[n]})}return{unitizedData:t,extents:e}},[oe,ne,re,he]),ue=co(()=>{if(re&&me.length>=2)return[{orient:"left",label:he[0],tickFormat:ne[0].format||(e=>{const t=vo(e,me[0]);return Number.isInteger(t)?t+"":t.toFixed(1)})},{orient:"right",label:he[1],tickFormat:ne[1].format||(e=>{const t=vo(e,me[1]);return Number.isInteger(t)?t+"":t.toFixed(1)})},{orient:"bottom"}]},[re,me,ne,he]),pe=co(()=>de.length>0?de:he.map(e=>({[go]:e})),[de,he]),fe=i({data:pe,rawData:c,colorBy:go,colorScheme:ce,legendInteraction:W,legendPosition:M,selection:S,linkedHover:L,fallbackFields:[go],unwrapData:!1,onObservation:H,onClick:B,hoverHighlight:I,mobileInteraction:s.mobileInteraction,mobileSemantics:s.mobileSemantics,chartType:"MultiAxisLineChart",chartId:F,showLegend:V,userMargin:h,marginDefaults:re?{...s.marginDefaults,left:70,right:70}:s.marginDefaults,loading:R,loadingContent:N,emptyContent:P,width:G,height:j}),ye=co(()=>{const e=new Map;return he.forEach((t,o)=>e.set(t,ce[o])),e},[he,ce]),ge=De({lineWidth:x,resolveStroke:ho(e=>ye.get(e[go])||ce[0],[ye,ce]),stroke:E,strokeWidth:O,opacity:T,effectiveSelectionHook:fe.effectiveSelectionHook,resolvedSelection:fe.resolvedSelection}),be=co(()=>{if(!1===A)return()=>null;return _(A)||(e=>{const t=e.data||e,o=t[go],n=he.indexOf(o),i=t[yo],r=re&&n>=0&&me[n]?vo(i,me[n]):i,a=n>=0&&ne[n]?.format?ne[n].format:e=>Number.isInteger(e)?e+"":e.toFixed(2),s="function"==typeof p?p(t):t[p];return lo.createElement("div",{style:{padding:"6px 10px",fontFamily:"var(--semiotic-font-family, sans-serif)",fontSize:"var(--semiotic-tooltip-font-size, 13px)"}},lo.createElement("div",{style:{fontWeight:600,marginBottom:4,color:ce[n]||"inherit"}},o),lo.createElement("div",null,`${"string"==typeof p?p:"x"}: ${s}`),lo.createElement("div",null,`${o}: ${a(r)}`))})},[A,he,ce,me,re,ne,p]);if(fe.earlyReturn)return fe.earlyReturn;const ve=t({componentName:"MultiAxisLineChart",data:c,accessors:{xAccessor:p}}),xe=re?[0,1]:void 0,Ae={chartType:"line",...null!=c&&{data:de},xAccessor:p,yAccessor:yo,groupAccessor:go,lineStyle:ge,colorScheme:ce,size:[G,j],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:fe.margin,showAxes:s.showAxes,...ue&&{axes:ue},xLabel:te,...re?{}:{yLabel:he[0]},xFormat:u,...re&&xe&&{yExtent:xe},enableHover:$,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:Q,curve:b,...fe.legendBehaviorProps,...K&&{title:K},...U&&{description:U},...Z&&{summary:Z},...void 0!==ee&&{accessibleTable:ee},...d&&{className:d},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:be,...w&&{annotations:w},...m({linkedHover:L,selection:S,onObservation:H,onClick:B,hoverHighlight:I,mobileInteraction:fe.mobileInteraction,customHoverBehavior:fe.customHoverBehavior,customClickBehavior:fe.customClickBehavior}),...fe.crosshairProps,...k};return ae||se||(ve?fo(X,{componentName:"MultiAxisLineChart",message:ve,width:G,height:j}):fo(Y,{componentName:"MultiAxisLineChart",width:G,height:j,children:fo(l,{ref:n,...Ae})}))});xo.displayName="MultiAxisLineChart";import{useMemo as Ao,forwardRef as wo,useRef as ko}from"react";import{jsx as So}from"react/jsx-runtime";var Co=wo(function(e,o){const i=ko(null);a(o,{variant:"xy",frameRef:i});const r=D(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:s,margin:h,className:f,xFormat:y,yFormat:g,xAccessor:b="x",highAccessor:v="high",lowAccessor:x="low",openAccessor:A,closeAccessor:w,candlestickStyle:k,tooltip:S,annotations:L,xExtent:B,yExtent:I,frameProps:F={},selection:R,linkedHover:_,onObservation:N,onClick:P,chartId:W,loading:E,loadingContent:O,emptyContent:T}=e,{width:G,height:z,enableHover:j,showGrid:$,title:Q,description:V,summary:U,accessibleTable:Z,xLabel:ee,yLabel:te}=r,oe=J(E,G,z,O),ne=oe?null:q(s,G,z,T),ie=Ao(()=>C(s),[s]),re=null==A||null==w;K("CandlestickChart",ie,"xAccessor",b),K("CandlestickChart",ie,"highAccessor",v),K("CandlestickChart",ie,"lowAccessor",x),re||(K("CandlestickChart",ie,"openAccessor",A),K("CandlestickChart",ie,"closeAccessor",w));const{customHoverBehavior:ae,customClickBehavior:se,crosshairSourceId:le}=M({selection:R,linkedHover:_,onObservation:N,onClick:P,chartType:"CandlestickChart",chartId:W,mobileInteraction:r.mobileInteraction}),ce=H(_,le),he=Ao(()=>{const e=r.marginDefaults,t="sparkline"===r.mode?{...e,top:0,bottom:0}:e;return null==h?t:{...t,...n(h)}},[h,r.marginDefaults,r.mode]),de=Ao(()=>{const e=[{label:ee||c(b),accessor:b,role:"x",format:y}];return re?(e.push({label:"High",accessor:v,role:"y",format:g}),e.push({label:"Low",accessor:x,format:g})):(e.push({label:"Open",accessor:A,format:g}),e.push({label:"High",accessor:v,format:g}),e.push({label:"Low",accessor:x,format:g}),e.push({label:"Close",accessor:w,format:g})),u(e)},[b,ee,y,g,v,x,A,w,re]),me=t({componentName:"CandlestickChart",data:s,accessors:{xAccessor:b,highAccessor:v,lowAccessor:x,...!re&&{openAccessor:A,closeAccessor:w}}}),ue={chartType:"candlestick",...null!=s&&{data:ie},xAccessor:b,yAccessor:v,highAccessor:v,lowAccessor:x,...!re&&{openAccessor:A,closeAccessor:w},...k&&{candlestickStyle:k},scalePadding:Math.max(2,Math.min(12,Math.round(G/40))),extentPadding:G>200?.1:.02,size:[G,z],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:he,showAxes:r.showAxes,xLabel:ee,yLabel:te,xFormat:y,yFormat:g,enableHover:j,showGrid:$,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...d({title:Q,description:V,summary:U,accessibleTable:Z,className:f,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...p({tooltip:S,defaultTooltipContent:de}),...m({linkedHover:_,selection:R,onObservation:N,onClick:P,mobileInteraction:r.mobileInteraction,customHoverBehavior:ae,customClickBehavior:se}),...L&&L.length>0&&{annotations:L},...B&&{xExtent:B},...I&&{yExtent:I},...ce,...F};return oe||ne||(me?So(X,{componentName:"CandlestickChart",message:me,width:G,height:z}):So(Y,{componentName:"CandlestickChart",width:G,height:z,children:So(l,{ref:i,...ue})}))});Co.displayName="CandlestickChart";import{forwardRef as Lo,useMemo as Ho}from"react";import{jsx as Bo}from"react/jsx-runtime";var Io=Lo(function(e,t){const{data:o,layout:n,layoutConfig:i,onLayoutError:a,xExtent:s,yExtent:c,showAxes:h=!1,margin:u,className:p,annotations:f,onObservation:y,onClick:g,selection:b,linkedHover:v,chartId:x,loading:A,loadingContent:w,emptyContent:S,colorBy:C,colorScheme:L,legend:H,frameProps:B={}}=e,{legend:I,...F}=B,R=Ho(()=>k(I,H),[I,H]),{frameRef:_,resolved:N,safeData:P,setup:W,earlyReturn:D}=r({imperativeRef:t,imperativeVariant:"xy",chartTypeLabel:"XYCustomChart",unwrapData:!1,data:o,colorBy:C,colorScheme:L,legend:R,selection:b,linkedHover:v,onObservation:y,onClick:g,chartId:x,loading:A,loadingContent:w,emptyContent:S,margin:u,width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules,xLabel:e.xLabel,yLabel:e.yLabel}),M=W.effectiveSelectionHook,E=Ho(()=>M?.isActive?{isActive:!0,predicate:M.predicate}:null,[M?.isActive,M?.predicate]);if(D)return D;const{width:O,height:T,enableHover:G,showGrid:z,title:j,description:$,summary:Q,accessibleTable:V,xLabel:X,yLabel:q}=N,J={chartType:"custom",...null!=o&&{data:P},customLayout:n,layoutConfig:i,onLayoutError:a,...E&&{layoutSelection:E},xExtent:s,yExtent:c,colorAccessor:C,colorScheme:L,size:[O,T],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:W.margin,showAxes:h,xLabel:X,yLabel:q,enableHover:G,showGrid:z,...W.legendBehaviorProps,...d({title:j,description:$,summary:Q,accessibleTable:V,className:p,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...null!=e.tooltip&&{tooltipContent:e.tooltip},...m({linkedHover:v,selection:b,onObservation:y,onClick:g,hoverHighlight:!1,mobileInteraction:W.mobileInteraction,customHoverBehavior:W.customHoverBehavior,customClickBehavior:W.customClickBehavior}),...f&&f.length>0&&{annotations:f},...W.crosshairProps,...F};return Bo(Y,{componentName:"XYCustomChart",width:O,height:T,children:Bo(l,{ref:_,...J})})});Io.displayName="XYCustomChart";export{Ae as Scatterplot,Be as ConnectedScatterplot,Oe as LineChart,Xe as AreaChart,nt as DifferenceChart,lt as StackedAreaChart,pt as Heatmap,xt as BubbleChart,Ot as ScatterplotMatrix,Ut as MinimapChart,oo as DEFAULT_QUADRANTS,so as QuadrantChart,xo as MultiAxisLineChart,Co as CandlestickChart,Io as XYCustomChart};
@@ -0,0 +1 @@
1
+ import{contrastRatio as e,fieldForRole as t,recipeConfig as i,recipeIntentId as a}from"./chunk-chunk-KHCOJMGK.module.min.js";import{extractAllRows as n,resolveResponsiveRules as r}from"./chunk-chunk-JMVEIZXP.module.min.js";import*as s from"react";function o(e){if(null==e)return"";if("number"!=typeof e)return e+"";if(!isFinite(e))return e+"";if(0===e)return"0";const t=parseFloat(e.toPrecision(12)),i=Math.abs(t);return 1e9>i?1e6>i?1e4>i?Number.isInteger(t)?t+"":parseFloat(t.toPrecision(6))+"":parseFloat((t/1e3).toPrecision(3))+"K":parseFloat((t/1e6).toPrecision(3))+"M":parseFloat((t/1e9).toPrecision(3))+"B"}var l=864e5;function c(e){return 10>e?"0"+e:e+""}var u=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function d(e){let t,i=e;return(a,n,r)=>{const s=a instanceof Date?a:new Date(a);e||!r||2>r.length||r===t||(t=r,i=function(e){if(2>e.length)return"days";const t=[];for(let i=1;e.length>i;i++)t.push(e[i]-e[i-1]);t.sort((e,t)=>e-t);const i=t[Math.floor(t.length/2)];return 12e4>i?"seconds":72e5>i?"minutes":2*l>i?"hours":60*l>i?"days":400*l>i?"months":"years"}(r));const o=i||"days";return null!=n&&0!==n&&r&&0!==r.length?function(e,t,i){const a=e.getUTCFullYear()!==t.getUTCFullYear(),n=a||e.getUTCMonth()!==t.getUTCMonth(),r=n||e.getUTCDate()!==t.getUTCDate(),s=r||e.getUTCHours()!==t.getUTCHours(),o=s||e.getUTCMinutes()!==t.getUTCMinutes(),l=u[e.getUTCMonth()],d=e.getUTCDate(),m=e.getUTCFullYear(),h=c(e.getUTCHours()),p=c(e.getUTCMinutes()),g=c(e.getUTCSeconds());switch(i){case"seconds":return a?`${l} ${d}, ${m} ${h}:${p}:${g}`:r?`${l} ${d} ${h}:${p}:${g}`:s?`${h}:${p}:${g}`:o?`${p}:${g}`:":"+g;case"minutes":return a?`${l} ${d}, ${m} ${h}:${p}`:r?`${l} ${d} ${h}:${p}`:s?`${h}:${p}`:":"+p;case"hours":return a?`${l} ${d}, ${m} ${h}:00`:n?`${l} ${d} ${h}:${p}`:r?`${l} ${d} ${h}:00`:h+":00";case"days":return a?`${l} ${d}, ${m}`:n?`${l} ${d}`:""+d;case"months":return a?`${l} ${m}`:""+l;case"years":return""+m}}(s,new Date(r[n-1]),o):function(e,t){const i=u[e.getUTCMonth()],a=e.getUTCDate(),n=e.getUTCFullYear(),r=c(e.getUTCHours()),s=c(e.getUTCMinutes()),o=c(e.getUTCSeconds());switch(t){case"seconds":return`${i} ${a}, ${n} ${r}:${s}:${o}`;case"minutes":case"hours":return`${i} ${a}, ${n} ${r}:${s}`;case"days":return`${i} ${a}, ${n}`;case"months":return`${i} ${n}`;case"years":return""+n}}(s,o)}}var m=new Set(["LineChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","ConnectedScatterplot","BubbleChart","QuadrantChart","MultiAxisLineChart","CandlestickChart","Heatmap","MinimapChart","RealtimeLineChart","RealtimeHeatmap"]),h=new Set(["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","DotPlot","RidgelinePlot","FunnelChart","LikertChart","SwimlaneChart"]),p={Scatterplot:["pointRadius","hoverRadius"],BubbleChart:["pointRadius","hoverRadius"],ConnectedScatterplot:["pointRadius","hoverRadius"],QuadrantChart:["pointRadius","hoverRadius"],SwarmPlot:["pointRadius","hoverRadius"],DotPlot:["dotRadius","hoverRadius"]};function g(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function y(e){return"string"==typeof e&&e.trim().length>0}function b(e){const t=g(e.capability)?e.capability:null,i=g(e.recipe)?e.recipe:null,a=[e.mobileSemantics,e.mobileVisualization,e.mobile,t?.mobile,i?.mobile];for(const e of a)if(g(e))return e;return null}function f(e){return Array.isArray(e)&&e.length>=2&&"number"==typeof e[0]&&"number"==typeof e[1]&&Number.isFinite(e[0])&&Number.isFinite(e[1])?[e[0],e[1]]:null}function v(e){return f(e.size)||f(g(e.frameProps)?e.frameProps.size:void 0)||("number"==typeof e.width&&"number"==typeof e.height?[e.width,e.height]:null)}function x(e,t){e.push({...t,status:"pass"})}function w(e,t){e.push({...t,status:"warn"})}function k(e,t){e.push({...t,status:"manual"})}function $(e,t={},i={}){const a=i.viewportWidth??390,n=i.targetSize??44,s=v(t),o=r(t,{width:a,height:s?.[1]}),l=[],c=v(t=o.props),u=b(t),d=function(e,t){return e.includes("CustomChart")||e.includes("Custom")||null!=t.recipeId||null!=t.mobileSemantics}(e,t),f=function(e){const t=b(e);return!0===e.responsive||!0===e.mobile||!0===t?.responsive||!0===t?.supportsResponsiveLayout||Array.isArray(t?.breakpoints)||"number"==typeof t?.minViewportWidth||"responsive"===t?.strategy||"small-multiples"===t?.strategy||"summary-cards"===t?.strategy||null!=e.mobileLayout||null!=e.responsiveRules||"mobile-readable"===e.density}(t),$=!0===i.inChartContainer,C=y(t.title)||y(t.summary)||y(t.description)||!0===u?.summary||y(u?.summary);if(o.matches.length>0&&x(l,{id:"layout.responsive-rule-applied",category:"layout",impact:"medium",message:`${o.matches.length} responsive rule(s) applied for the ${a}px mobile audit.`}),c){const[t,i]=c;t>a&&!f?w(l,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:`Chart size is ${t}px wide against a ${a}px mobile viewport with no responsive/mobile transform hint.`,fix:"Use responsive sizing, responsiveRules/mobileLayout, or an explicit mobile variant that preserves the task instead of clipping the desktop chart."}):x(l,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:"No fixed desktop-width overflow risk is visible from the config."}),"number"==typeof u?.minViewportWidth&&u.minViewportWidth>a&&w(l,{id:"layout.mobile-min-width",category:"layout",impact:"high",message:`The declared mobile contract supports ${u.minViewportWidth}px minimum, wider than the audited ${a}px viewport.`,fix:"Add a narrower breakpoint, summary-card fallback, or explicit horizontal-scroll affordance with a non-visual equivalent."});const n=t/Math.max(1,i);430>=a&&n>2.4&&"BigNumber"!==e&&w(l,{id:"layout.wide-aspect-ratio",category:"layout",impact:"medium",message:`Chart aspect ratio is ${n.toFixed(1)}:1, which tends to compress phone charts vertically.`,fix:"Prefer stacked sections, small multiples, cards plus a sparkline, or a taller mobile-specific chart ratio."}),160>i&&"BigNumber"!==e&&w(l,{id:"layout.too-short-for-reading",category:"layout",impact:"medium",message:`Chart height is ${i}px; most phone charts need enough vertical room for marks plus readable labels.`,fix:"Reserve more vertical space, remove nonessential axes, or switch to a card/sparkline pattern with external labels."})}else k(l,{id:"layout.unknown-size",category:"layout",impact:"medium",message:"No explicit size is available to audit. This may be responsive, but static mobile overflow cannot be checked.",fix:"Audit rendered widths at 320, 360, 390, and 430px, or pass size/responsiveRules metadata into the config."});const A=function(e){const t=[e.data,e.points,e.lines,e.nodes,e.edges,e.areas,g(e.frameProps)?e.frameProps.data:void 0];let i=0;for(const e of t)Array.isArray(e)&&(i+=e.length);return i}(t);A>0&&(A>("number"==typeof u?.maxMarks?u.maxMarks:m.has(e)?1.25*a:h.has(e)?Math.max(8,Math.floor(a/34)):a)?w(l,{id:"density.mark-budget",category:"density",impact:m.has(e)?"medium":"high",message:`${A} data item(s) exceed the rough mobile density budget for ${e} at ${a}px.`,fix:"Aggregate, filter, facet into small multiples, switch to a summary-card plus detail view, or use progressive disclosure."}):x(l,{id:"density.mark-budget",category:"density",impact:"medium",message:A+" data item(s) are within the rough mobile density budget for this component."}));const T=function(e){const t=[e.tickValues,e.xTickValues,e.yTickValues,e.rTickValues,e.oTickValues];let i=0;for(const e of t)Array.isArray(e)&&(i+=e.length);return i>0?i:null}(t),S=!1!==t.showAxes&&!1!==t.axis;if(S&&null!=T){const e=Math.max(3,Math.floor(a/58));T>e&&w(l,{id:"density.explicit-tick-count",category:"density",impact:"medium",message:`${T} explicit tick(s) exceed a phone-friendly budget of about ${e} at ${a}px.`,fix:"Use adaptive ticks, fewer tickValues, direct labels, or move exact values into a tap-accessible detail panel."})}else S&&(m.has(e)||h.has(e))&&k(l,{id:"density.axis-label-collision",category:"density",impact:"medium",message:"Axes are enabled, but label collision depends on rendered tick text and cannot be checked statically.",fix:"Verify tick labels at phone widths or provide explicit mobile tick density."});!function(e){const t=g(e.frameProps)?e.frameProps:{};return(!0===e.enableHover||null!=e.tooltipContent||null!=e.tooltip||null!=t.tooltipContent||!0===t.enableHover)&&!function(e){const t=b(e),i=g(e.mobileInteraction)?e.mobileInteraction:null;return null!=e.controls||null!=e.mobileControls||!0===e.alternativeControls||null!=e.selection||null!=e.onClick||null!=e.onSelect||!0===e.mobileInteraction||!0===i?.tapToSelect||!0===i?.tapToLockTooltip||Array.isArray(t?.interaction?.alternatives)&&t.interaction.alternatives.length>0||"tap"===t?.interaction?.primary||"button"===t?.interaction?.primary||y(t?.interaction?.hoverFallback)}(e)}(t)?x(l,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"No hover-only detail path is visible from the config."}):w(l,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"The chart exposes tooltip/hover detail without an obvious tap, selection, or control alternative.",fix:"Enable tap-to-select, a persistent details panel, visible segment buttons, or another non-hover path for the same information."});const R=function(e,t){const i=p[e];if(!i)return null;let a=i.includes("hoverRadius")?30:null;for(const e of i){const i=t[e];"number"==typeof i&&Number.isFinite(i)&&i>0&&(a=null==a?i:Math.max(a,i))}return null==a?null:2*a}(e,t),M=g(t.mobileInteraction)?t.mobileInteraction:null,z=R??("number"==typeof M?.targetSize?M.targetSize:!0===t.mobileInteraction?44:"number"==typeof u?.minimumHitTarget?u.minimumHitTarget:"number"==typeof u?.interaction?.targetSize?u.interaction.targetSize:null);null!=z&&(24>z?w(l,{id:"interaction.target-size-minimum",category:"interaction",impact:"high",message:`Small interactive marks expose an estimated ${z}px pointer target, below WCAG's 24px minimum.`,fix:"Increase mark radius/hoverRadius, add tap snapping to nearest datum, or provide larger external controls."}):n>z?w(l,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${z}px, above 24px but below the ${n}px comfortable phone target.`,fix:"Use hoverRadius/tapRadius near 44px while keeping the visible mark small if needed."}):x(l,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${z}px, meeting the configured ${n}px target.`}));const U=[];null==t.brush&&null==t.onBrush||U.push("brush"),!0===t.zoomable&&U.push("pan/zoom"),"isolate"!==t.legendInteraction&&"highlight"!==t.legendInteraction||U.push("legend filtering"),U.length>0&&!function(e,t){const i=b(e),a=g(e.mobileInteraction)?e.mobileInteraction:null,n=a?.standardControls;return!!(null!=e.controls||null!=e.mobileControls||!0===e.alternativeControls||Array.isArray(i?.interaction?.alternatives)&&i.interaction.alternatives.length>0)||!0===n||"all"===n||t.every(e=>"brush"===e?Array.isArray(n)?n.includes("brush"):"brush"===n:"pan/zoom"===e?Array.isArray(n)?n.includes("zoom"):"zoom"===n:"legend filtering"===e&&(Array.isArray(n)?n.includes("legend"):"legend"===n))}(t,U)&&w(l,{id:"interaction.complex-gesture-alternative",category:"interaction",impact:"high",message:`Mobile-hostile complex interaction detected: ${U.join(", ")} without standard control alternatives.`,fix:"Pair gestures with buttons, range inputs, chips, or a details panel that works with touch and keyboard."}),!1===t.showLegend||!1===t.legend||!0!==t.showLegend&&!0!==t.legend&&null==t.colorBy&&null==t.groupBy&&null==t.lineBy&&null==t.areaBy&&null==t.stackBy||!0===t.directLabel||!0===t.showLabels||"direct"===t.labelStrategy||"direct-end"===t.labelStrategy||"direct"===u?.labels?.strategy||"inline"===u?.labels?.strategy||"external"===u?.labels?.strategy||a>430||w(l,{id:"semantics.legend-over-direct-labels",category:"semantics",impact:"medium",message:"The chart appears to rely on a legend instead of direct labels at phone width.",fix:"Prefer direct end labels, inline labels, or a compact chip selector so readers do not bounce between plot and legend."});const P=Array.isArray(t.annotations)?t.annotations.filter(e=>g(e)):[];if(P.length>("number"==typeof u?.maxAnnotations?u.maxAnnotations:3)&&430>=a&&w(l,{id:"annotation.mobile-density",category:"annotation",impact:"medium",message:P.length+" annotation(s) compete for phone plot space.",fix:"Assign annotation priority, collapse secondary notes into a callout list, or provide shorter mobileText."}),P.length>0){const e=P.filter(e=>!y(e.mobileText)&&!y(e.shortText)&&!y(e.label));e.length>0&&k(l,{id:"annotation.mobile-copy",category:"annotation",impact:"low",message:e.length+" annotation(s) lack explicit short/mobile copy.",fix:"Add mobileText or shortText for notes that need to survive narrow layouts."})}f||"BigNumber"===e||k(l,{id:"layout.no-responsive-transform",category:"layout",impact:"low",message:"No explicit responsive transformation hint is present.",fix:"Declare responsiveRules/mobileLayout or a density/label strategy so the mobile version is a designed transformation, not an accidental resize."}),d&&(u?(x(l,{id:"semantics.custom-mobile-contract",category:"semantics",impact:"medium",message:"Custom chart/recipe provides a mobileSemantics/mobile contract, so the audit can inspect its authored phone behavior."}),!1===u.custom?.dataBearingSceneNodes?w(l,{id:"semantics.custom-data-bearing-scene",category:"semantics",impact:"medium",message:"Custom mobile contract says emitted scene nodes are not data-bearing.",fix:"Preserve datum references, semantic roles, or accessible-table fields so intelligence, navigation, and tap details can recover the chart's meaning."}):!0!==u.custom?.dataBearingSceneNodes&&k(l,{id:"semantics.custom-data-bearing-scene",category:"semantics",impact:"low",message:"Custom chart mobile contract does not state whether scene nodes are data-bearing.",fix:"Set mobile.custom.dataBearingSceneNodes and mobile.custom.navigationGranularity for custom layouts and interoperability adapters."})):k(l,{id:"semantics.custom-mobile-contract",category:"semantics",impact:"medium",message:"Custom chart layout is opaque to static mobile analysis because no mobileSemantics/mobile contract is present.",fix:"Declare mobileSemantics with strategy, breakpoints, mark budgets, touch target size, interaction alternatives, and custom scene semantics."})),C||$||w(l,{id:"semantics.no-mobile-summary",category:"semantics",impact:"medium",message:"No title, summary, description, or ChartContainer context is visible from the config.",fix:"Add title/summary text or wrap in ChartContainer so the small-screen reader gets the task before the chart."});const I=l.filter(e=>"warn"===e.status),N={highRisk:I.filter(e=>"high"===e.impact).length,warnings:I.length,manual:l.filter(e=>"manual"===e.status).length,passes:l.filter(e=>"pass"===e.status).length};return{component:e,viewportWidth:a,ok:0===N.highRisk,summary:N,findings:l,reference:"Mobile visualization audit: informed by MobileVisFixer, mobile exploratory interaction research, small-multiple mobile studies, responsive visualization grammars, constraint-based breakpoints, and WCAG 2.2 input modalities."}}var C={pass:"PASS",warn:"WARN",manual:"MANUAL","not-applicable":"N/A"},A=["layout","density","interaction","annotation","semantics"];function T(e){const t=[],i=e.summary,a=e.ok?`no high-risk mobile blockers at ${e.viewportWidth}px`:`${i.highRisk} high-risk mobile issue(s) at ${e.viewportWidth}px`;t.push(`${e.ok?"PASS":"WARN"} ${e.component}: mobile visualization audit`),t.push(` ${a} - ${i.warnings} warning(s) - ${i.manual} manual check(s)`);for(const i of A){const a=e.findings.filter(e=>e.category===i&&"not-applicable"!==e.status);if(0!==a.length){t.push(""),t.push(" "+i.toUpperCase());for(const e of a)t.push(` ${C[e.status]} [${e.impact}] ${e.id}: ${e.message}`),!e.fix||"warn"!==e.status&&"manual"!==e.status||t.push(" -> "+e.fix)}}return t.push(""),t.push(" Ref: "+e.reference),t.join("\n")}function S(){return["Static audit only: rendered label collision, CSS-resolved type size, and actual touch behavior still require viewport testing.","Use multiple widths, usually 320, 360, 390, 430, and 768 CSS pixels.","A mobile pass means no high-risk static warnings, not that the chart is perceptually or ergonomically optimal."]}function R(e){const t={};for(const[i,a]of e){const e=[];for(const[,t]of a.clauses){const i={};for(const[e,a]of Object.entries(t.fields))i[e]="point"===a.type?{type:"point",values:Array.from(a.values)}:{type:"interval",range:a.range};e.push({clientId:t.clientId,type:t.type,fields:i})}t[i]={name:a.name,resolution:a.resolution,clauses:e}}return t}function M(e){const t=new Map;for(const[i,a]of Object.entries(e)){const e=new Map;for(const t of a.clauses){const i={};for(const[e,a]of Object.entries(t.fields))i[e]="point"===a.type?{type:"point",values:new Set(a.values)}:{type:"interval",range:a.range};e.set(t.clientId,{clientId:t.clientId,type:t.type,fields:i})}t.set(i,{name:a.name,resolution:a.resolution,clauses:e})}return t}async function z(e,t){const{format:i="png",filename:a="chart",scale:n=2,background:r="white"}=t||{},s=e.querySelector("svg");if(!s)throw Error("No SVG element found in the container");const o=s.cloneNode(!0),l=s.getBoundingClientRect();if(o.getAttribute("width")||o.setAttribute("width",l.width+""),o.getAttribute("height")||o.setAttribute("height",l.height+""),o.getAttribute("xmlns")||o.setAttribute("xmlns","http://www.w3.org/2000/svg"),U(s,o),"svg"===i){const e=(new XMLSerializer).serializeToString(o);P(new Blob([e],{type:"image/svg+xml;charset=utf-8"}),a+".svg")}else{const t=l.width*n,i=l.height*n,s=document.createElement("canvas");s.width=t,s.height=i;const c=s.getContext("2d");c.fillStyle=r,c.fillRect(0,0,t,i),c.scale(n,n);const u=e.querySelector("canvas");u&&c.drawImage(u,0,0,l.width,l.height);const d=(new XMLSerializer).serializeToString(o),m=new Blob([d],{type:"image/svg+xml;charset=utf-8"}),h=URL.createObjectURL(m),p=new Image;p.width=l.width,p.height=l.height,await new Promise((e,t)=>{p.onload=()=>{c.drawImage(p,0,0),s.toBlob(i=>{i?(P(i,a+".png"),e()):t(Error("Failed to create PNG blob"))},"image/png"),URL.revokeObjectURL(h)},p.onerror=()=>{URL.revokeObjectURL(h),t(Error("Failed to load SVG image"))},p.src=h})}}function U(e,t){const i=e.children,a=t.children,n=window.getComputedStyle(e),r=["fill","stroke","stroke-width","stroke-dasharray","opacity","fill-opacity","stroke-opacity","font-family","font-size","font-weight","text-anchor","dominant-baseline"];for(const e of r){const i=n.getPropertyValue(e);i&&"none"!==i&&""!==i&&t.style?.setProperty(e,i)}for(let e=0;Math.min(i.length,a.length)>e;e++)U(i[e],a[e])}function P(e,t){const i=URL.createObjectURL(e),a=document.createElement("a");a.href=i,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}function I(e){const t=e.pointId??e.id??e._transitionKey;return null==t||""===t?void 0:t+""}function N(e){return e.accessibility?.tableFields??e.accessibleDatum??e.datum??null}function F(e){return"number"==typeof e&&Number.isFinite(e)}function L(e){if(F(e.x)&&F(e.y)&&F(e.w)&&F(e.h))return{x0:e.x,y0:e.y,x1:e.x+e.w,y1:e.y+e.h};if(F(e.x)&&F(e.y)&&F(e.r))return{x0:e.x-e.r,y0:e.y-e.r,x1:e.x+e.r,y1:e.y+e.r};if(F(e.cx)&&F(e.cy)&&F(e.r))return{x0:e.cx-e.r,y0:e.cy-e.r,x1:e.cx+e.r,y1:e.cy+e.r};if(F(e.cx)&&F(e.cy)&&F(e.outerR))return{x0:e.cx-e.outerR,y0:e.cy-e.outerR,x1:e.cx+e.outerR,y1:e.cy+e.outerR};const t=[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat().filter(e=>Array.isArray(e)&&F(e[0])&&F(e[1]));return t.length>0?{x0:Math.min(...t.map(e=>e[0])),y0:Math.min(...t.map(e=>e[1])),x1:Math.max(...t.map(e=>e[0])),y1:Math.max(...t.map(e=>e[1]))}:null}function B(e,t){const i=Math.max(0,Math.min(e.x1,t.x1)-Math.max(e.x0,t.x0))*Math.max(0,Math.min(e.y1,t.y1)-Math.max(e.y0,t.y0)),a=Math.min(Math.max(0,e.x1-e.x0)*Math.max(0,e.y1-e.y0),Math.max(0,t.x1-t.x0)*Math.max(0,t.y1-t.y0));return a>0?i/a:0}function D(e,i,a,n,r){if(e===i)return!0;const s=a.dataRoles.map(e=>t(e,n,r)).filter(e=>!!e).filter(t=>null!=e[t]&&null!=i[t]);return s.length>0&&s.every(t=>e[t]+""==i[t]+"")}function V(e,t,i,a,n,r="warn",s){return{id:e,category:t,status:i?"pass":r,message:i?a:n,...s?{evidence:s}:{}}}function j(r){const{recipe:s}=r,o=function(e){return Array.isArray(e)?e:e&&"object"==typeof e?[...e.nodes??e.sceneNodes??[],...e.sceneEdges??[]]:[]}(r.scene),l=r.layoutConfig??i({layoutConfig:r.layoutConfig}),c=r.dimensions.plot??{x:0,y:0,width:r.dimensions.width,height:r.dimensions.height},u=c.x??0,d=c.y??0,m=[],h=o.filter(e=>null!=N(e)),p=o.filter(e=>!("string"!=typeof e.pathD||!/NaN|Infinity|undefined/.test(e.pathD))||function(e){return[...[e.x,e.y,e.w,e.h,e.r,e.cx,e.cy,e.innerR,e.outerR,e.x1,e.x2,e.y1,e.y2,e.openY,e.closeY,e.highY,e.lowY,e.bodyWidth].filter(e=>void 0!==e),...[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat(2)]}(e).some(e=>"number"!=typeof e||!Number.isFinite(e)));m.push(V("geometry.finite","geometry",0===p.length,"All emitted geometry is finite.",p.length+" marks contain non-finite geometry.","fail",{count:p.length}));const g=o.map(L),y=g.filter(e=>e&&(e.x0>=e.x1||e.y0>=e.y1)).length;m.push(V("geometry.nonzero-area","geometry",0===y,"All bounded marks have positive area.",y+" marks have zero or negative area.","warn",{count:y}));const b=g.filter(e=>e&&(u>e.x0||d>e.y0||e.x1>u+c.width||e.y1>d+c.height)).length;m.push(V("geometry.bounds","geometry",0===b,"All bounded marks stay inside the plot.",b+" marks extend outside the plot bounds.","warn",{count:b}));const f=s.audit?.minimumHitTargetSize??s.accessibility.minimumHitTarget??24,v=g.filter(e=>!!e&&(f>e.x1-e.x0||f>e.y1-e.y0)).length;m.push(V("interaction.target-size","interaction",0===v,`All bounded targets meet the declared ${f}px minimum.`,`${v} targets are smaller than ${f}px in at least one dimension.`,"warn",{count:v,minimumTarget:f}));const x=h.map(I),w=x.filter(e=>!e).length,k=new Set,$=x.filter(e=>!(!e||!k.has(e)&&(k.add(e),1)));m.push(V("identity.stable-ids","identity",0===w,"Every data-bearing mark exposes a stable id.",w+" data-bearing marks have no pointId, id, or transition key.",s.audit?.requireStableIds?"fail":"warn",{missing:w})),m.push(V("identity.unique-ids","identity",0===$.length,"Stable mark ids are unique.",$.length+" duplicate stable ids were observed.","fail",{duplicates:[...new Set($)].slice(0,10)}));const C=x.filter(e=>e&&/^(datum|mark|node|point|rect)-?\d+$/.test(e)).length;C>0&&m.push({id:"identity.index-pattern",category:"identity",status:"warn",message:C+" ids look index-derived and may change when data is reordered.",remediation:"Derive ids from a declared identifier role or stable domain key."});const A=new Set;let T=0;const S=r.inputData;for(const e of h){const t=N(e),i=Array.isArray(t)?t:[t];let a=!1;for(const e of i)if(e&&"object"==typeof e)for(let t=0;S.length>t;t+=1)D(e,S[t],s,l,S)&&(A.add(t),a=!0);a||(T+=1)}const R=Math.max(0,S.length-A.size);m.push(V("coverage.input-data","coverage",0===R,"Every input datum is represented by the observed scene.",R+" input data items have no matching scene mark.",s.audit?.requireDatumCoverage?"fail":"warn",{represented:A.size,input:S.length})),m.push(V("coverage.scene-data","coverage",0===T,"Every data-bearing scene mark maps back to input data.",T+" scene marks do not map back to an input datum.","warn",{count:T}));const M=s.encodings?.some(e=>"count"===e.channel);!M&&h.length>A.size&&A.size>0&&m.push({id:"coverage.duplicate-references",category:"coverage",status:"warn",message:"Input data is referenced by multiple marks, but multiplicity is not declared as an encoding.",remediation:"Declare count/repetition semantics or preserve a one-to-one datum-to-mark mapping."});const z=h.filter(e=>!1===e.interactive).length;m.push(V("interaction.hit-targets","interaction",0===z&&h.length>0,"Every observed data-bearing scene node participates in hit testing.",0===h.length?"No data-bearing scene nodes were emitted for interaction.":z+" data-bearing marks explicitly disable interaction.","fail"));const U=(r.annotations??[]).map(e=>e.pointId).filter(e=>null!=e).map(String),P=U.filter(e=>!k.has(e));m.push(V("coverage.annotation-anchors","coverage",0===P.length,U.length?"All pointId annotation anchors resolve to observed scene nodes.":"No pointId annotations require scene resolution.",P.length+" annotations point to missing scene ids.","fail",{unresolved:P}));const F=(r.chart?.selectedIds??[]).filter(e=>!k.has(e));r.chart?.selectedIds&&m.push(V("interaction.selection-reachability","interaction",0===F.length,"Selected/highlighted states resolve to observed marks.",F.length+" selected ids are not reachable in the scene.","fail",{missing:F}));const j=n(o),q=(s.accessibility.tableFields??s.accessibility.tableRoles?.map(e=>({role:e,label:e}))??[]).map(e=>{if(e.field)return e.field;const i=e.role?s.dataRoles.find(t=>t.role===e.role):void 0;return i?t(i,l,S):void 0}).filter(e=>!!e),E=new Set(j.flatMap(e=>Object.keys(e.values))),W=q.filter(e=>!E.has(e));m.push(V("accessibility.table-fields","accessibility",0===W.length,q.length?"The accessible table preserves all recipe-declared fields.":"The recipe declares no explicit accessible table field projection.",`The accessible table loses declared fields: ${W.join(", ")}.`,"fail",{expectedFields:q,observedFields:[...E]})),new Set(S.flatMap(e=>Object.entries(e).filter(([,e])=>["string","number","boolean"].includes(typeof e)).map(([e])=>e))).size>2&&2>=E.size&&[...E].every(e=>"category"===e||"value"===e)&&m.push({id:"accessibility.generic-table-loss",category:"accessibility",status:"warn",message:"The table exposes only generic category/value fields although richer input data exists.",remediation:"Emit accessibleDatum or accessibility.tableFields on scene nodes."});const H=(s.encodings?.filter(e=>"color"===e.channel)??[]).filter(e=>!e.redundantWith||0===e.redundantWith.length);m.push(V("accessibility.color-only","accessibility",0===H.length,"Every declared color encoding names a redundant cue.",H.length+" color encodings have no declared redundant cue.","warn"));const O=r.chart;if(O){for(const[e,t]of[["title",s.accessibility.requiresTitle],["summary",s.accessibility.requiresSummary],["description","required"===s.accessibility.description]])t&&m.push(V("accessibility."+e,"accessibility","string"==typeof O[e]&&O[e].trim().length>0,`A chart ${e} is present.`,`The recipe requires a chart ${e}, but none was supplied.`,"fail"));(s.accessibility.requiresAccessibleTable||"required"===s.accessibility.accessibleTable||s.accessibility.fallbackTable)&&m.push(V("accessibility.fallback-table","accessibility",!1!==O.accessibleTable,"The accessible fallback table is enabled.","The recipe requires a fallback table, but accessibleTable is disabled.","fail")),O.navigationTree&&m.push(V("accessibility.navigation-depth","accessibility",(O.navigationTree.children?.length??0)>0,"The navigation tree exposes structure below the root.","The navigation tree is root-only.","fail"))}const G=r.theme?.background??"#ffffff",Y=o.filter(t=>{const i=t.style?.fill??t.fill;if("string"!=typeof i||!i.startsWith("#")||!G.startsWith("#"))return!1;const a=e(i,G);return null!=a&&3>a}).length;m.push(V("visual.contrast","visual",0===Y,"All statically checkable mark fills meet 3:1 contrast.",Y+" marks have fill contrast below 3:1.","warn",{background:G}));let J=0;const K=g.filter(e=>!!e).slice(0,500);for(let e=0;K.length>e;e+=1)for(let t=e+1;K.length>t;t+=1).8>B(K[e],K[t])||(J+=1);J>K.length&&m.push({id:"visual.overlap-density",category:"visual",status:"warn",message:J+" near-total mark overlaps suggest occlusion or excessive density.",remediation:"Aggregate, jitter, layer explicitly, or declare overlap as intentional."});const X=[["manual-at.screen-reader","Verify real screen-reader behavior with the target browser/AT combinations."],["manual-at.cognitive-load","Assess cognitive load and whether the custom metaphor is understood."],["manual-at.keyboard-order","Verify that keyboard order is meaningful, not merely mechanically available."],["manual-at.animation","Verify that animation is not distracting and reduced-motion behavior is sufficient."],["manual-at.reception","Test whether the memorable form is received as intended by the target audience."],["manual-at.overlay-occlusion","Inspect labels, overlays, annotations, and important marks for clipping or occlusion."],["manual-at.observation","Exercise hover, focus, selection, and observation emission in the rendered chart."]].map(([e,t])=>({id:e,category:"manual-at",status:"manual",message:t})),Q={dataRoles:s.dataRoles.map(e=>e.role),intents:s.intents.map(a).filter(e=>!!e),accessibilityExpectations:[...s.accessibility.requirements??[],...s.accessibility.tableFields?.map(e=>"table field: "+e.label)??[]],fallbackDeclared:!0===s.accessibility.fallbackTable||"required"===s.accessibility.accessibleTable||!0===s.accessibility.requiresAccessibleTable,designContractDeclared:!!s.designContract?.whyCustom},Z=[...m,...X],_=m.filter(e=>"fail"===e.status).length;return{recipeId:s.id,ok:0===_,summary:{marks:o.length,passes:Z.filter(e=>"pass"===e.status).length,warnings:Z.filter(e=>"warn"===e.status).length,failures:_,manual:Z.filter(e=>"manual"===e.status).length},declaredSemantics:Q,observedSceneEvidence:m,manualATChecks:X}}export{o as smartTickFormat,d as adaptiveTimeTicks,$ as auditMobileVisualization,T as formatMobileVisualizationAudit,S as mobileVisualizationCaveats,R as serializeSelections,M as deserializeSelections,z as exportChart,j as auditObservedScene};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import*as e from"react";import{jsx as r,jsxs as t}from"react/jsx-runtime";function n({componentName:e,message:n,diagnosticHint:i,width:o,height:a}){return r("div",{role:"alert",style:{width:o,height:Math.max(a,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:t("div",{style:{textAlign:"center",maxWidth:400},children:[r("div",{style:{fontSize:13,fontWeight:600,color:"rgba(128, 128, 128, 0.7)",marginBottom:6,fontFamily:"monospace"},children:e}),r("div",{style:{fontSize:14,color:"rgba(128, 128, 128, 0.9)",lineHeight:1.5},children:n}),i&&r("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:i})]})})}import{jsx as i}from"react/jsx-runtime";var o=class extends e.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,r){this.props.onError?.(e,r)}render(){if(this.state.error){const{fallback:e}=this.props,r=this.state.error;return"function"==typeof e?e(r):void 0!==e?e:i(n,{componentName:"ChartErrorBoundary",message:r.message||"An unexpected error occurred while rendering this chart.",width:600,height:400})}return this.props.children}};import{useEffect as a,useLayoutEffect as s,useRef as d,useState as c,useSyncExternalStore as l}from"react";var h="undefined"!=typeof window?s:a;function u(){const[e,r]=c(!1);return h(()=>{r(!0)},[]),e}var f=()=>()=>{},m=()=>!1,g=()=>!0;function p(){const e=l(f,m,g);return d(e).current}function b(e){const{hydrated:r,wasHydratingFromSSR:t,storeRef:n,dirtyRef:i,renderFnRef:o,cancelRender:s,cleanup:c}=e;h(()=>{const e=n.current;r&&t&&e?.cancelIntroAnimation?.(),!t&&e?.sceneNodes&&e.sceneNodes.length>0&&e?.markStylePaintPending?e.markStylePaintPending():i.current=!0,s?.(),o.current()},[r,t]);const l=d(c);l.current=c,a(()=>()=>l.current?.(),[])}import{jsx as y}from"react/jsx-runtime";var x="undefined"!=typeof process&&"production"!==process.env?.NODE_ENV;function v({componentName:e,width:r,height:t,children:i}){return y(o,{fallback:i=>y(n,{componentName:e,message:i.message,width:r,height:t}),children:i})}var w={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"},S={background:"var(--semiotic-border, #e0e0e0)",borderRadius:2};function j(e,r,t,n){return!1===n||null==e||Array.isArray(e)&&e.length>0?null:Array.isArray(e)?y("div",{style:{...w,width:r,height:t},children:n||"No data available"}):null}function A(e,r,t,n){if(!e)return null;if(!1===n)return null;if(null!=n)return y("div",{style:{width:r,height:t,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},children:n});const i=Math.min(5,Math.floor(t/40)),o=Math.max(8,Math.floor(t/(3*i))),a=Math.max(6,Math.floor(t/(2.5*i))),s=Math.floor((t-(i*(o+a)-a))/2);return y("div",{style:{width:r,height:t,position:"relative",overflow:"hidden",border:"1px solid var(--semiotic-border, #e0e0e0)",borderRadius:4,boxSizing:"border-box"},children:Array.from({length:i},(e,t)=>y("div",{className:"semiotic-loading-bar",style:{...S,position:"absolute",top:s+t*(o+a),left:Math.floor(.1*r),width:30+(37*t+13)%50+"%",height:o,opacity:.5+t%2*.2}},t))})}function N(e,r,t,n){if(!x)return;if(!r||0===r.length)return;if("string"!=typeof n)return;const i=r[0];if(!i||"object"!=typeof i)return;if(n in i)return;const o=Object.keys(i).join(", ");console.warn(`[semiotic] ${e}: ${t} "${n}" not found in data. Available keys: ${o}`)}export{u as useHydration,p as useWasHydratingFromSSR,b as useHydrationLifecycle,n as ChartError,o as ChartErrorBoundary,v as SafeRender,j as renderEmptyState,A as renderLoadingState,N as warnMissingField};
@@ -0,0 +1 @@
1
+ import{getMinMax as t}from"./chunk-chunk-JJ2OOIET.module.min.js";function a(t=240){const a=360-t,n=180+a/2,h=n*Math.PI/180;return{sweepRad:t*Math.PI/180,gapDeg:a,startAngleDeg:n,startAngleRad:h,offsetRad:-Math.PI/2+h}}function n(t,a,n,h,s){const e=n-a||1;return s+(Math.max(a,Math.min(n,t))-a)/e*h}function h(n=240){const{sweepRad:h,offsetRad:s}=a(n),e=[[Math.cos(s),Math.sin(s)],[Math.cos(s+h),Math.sin(s+h)],[0,0]];for(let t=0;2*Math.PI>t;t+=Math.PI/2)((t-s)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)>h+.001||e.push([Math.cos(t),Math.sin(t)]);const o=e.map(t=>t[0]),M=e.map(t=>t[1]),[c,i]=t(o),[m,r]=t(M);return{minX:c,maxX:i,minY:m,maxY:r,width:i-c,height:r-m,cx:(c+i)/2,cy:(m+r)/2}}export{a as sweepToAngles,n as valueToAngle,h as computeArcBoundingBox};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{renderRectPulse as t}from"./chunk-chunk-FAKO3RGQ.module.min.js";import{buildLinearFillGradient as e,clampCornerRadii as n,filterSparseArray as s,hasAnyCornerRadius as i,resolveCSSColor as o,resolveCanvasFill as r,symbolPathString as l}from"./chunk-chunk-ODUZEEBH.module.min.js";var h=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(t){Number.isFinite(t)&&(this._min>t&&(this._min=t),t>this._max&&(this._max=t))}evict(t){t!==this._min&&t!==this._max||(this._dirty=!0)}recalculate(t,e){this._min=1/0,this._max=-1/0;for(const n of t){const t=e?e(n):n;Number.isFinite(t)&&(this._min>t&&(this._min=t),t>this._max&&(this._max=t))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}},u=class{constructor(t,e){this.lastBoundedData=null,this.chunkTimer=0,this.pushBuffer=[],this.flushScheduled=!1,this.callback=t,this.chunkThreshold=e?.chunkThreshold??5e3,this.chunkSize=e?.chunkSize??5e3}updateChunkOptions(t){null!=t.chunkThreshold&&(this.chunkThreshold=t.chunkThreshold),null!=t.chunkSize&&(this.chunkSize=t.chunkSize)}clearLastData(){this.lastBoundedData=null,this.pushBuffer=[],this.flushScheduled=!1,this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=0)}setBoundedData(t){if(t=s(t),this.lastBoundedData===t)return;if(this.lastBoundedData=t,this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=0),this.chunkThreshold>=t.length)return void this.callback({inserts:t,bounded:!0});this.callback({inserts:t.slice(0,this.chunkSize),bounded:!0,totalSize:t.length});let e=this.chunkSize;const n=()=>{if(e>=t.length)return void(this.chunkTimer=0);if(t!==this.lastBoundedData)return void(this.chunkTimer=0);const s=Math.min(e+this.chunkSize,t.length);this.callback({inserts:t.slice(e,s),bounded:!1}),e=s,this.chunkTimer=t.length>e?requestAnimationFrame(n):0};this.chunkTimer=requestAnimationFrame(n)}setReplacementData(t){if(t=s(t),this.lastBoundedData=t,this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=0),this.pushBuffer=[],this.flushScheduled=!1,this.chunkThreshold>=t.length)return void this.callback({inserts:t,bounded:!0,preserveCategoryOrder:!0});this.callback({inserts:t.slice(0,this.chunkSize),bounded:!0,preserveCategoryOrder:!0,totalSize:t.length});let e=this.chunkSize;const n=()=>{if(e>=t.length)return void(this.chunkTimer=0);if(t!==this.lastBoundedData)return void(this.chunkTimer=0);const s=Math.min(e+this.chunkSize,t.length);this.callback({inserts:t.slice(e,s),bounded:!1}),e=s,this.chunkTimer=t.length>e?requestAnimationFrame(n):0};this.chunkTimer=requestAnimationFrame(n)}flushPushBuffer(){if(this.flushScheduled=!1,0===this.pushBuffer.length)return;const t=this.pushBuffer;this.pushBuffer=[],this.callback({inserts:t,bounded:!1})}scheduleFlush(){this.flushScheduled||(this.flushScheduled=!0,queueMicrotask(()=>this.flushPushBuffer()))}push(t){null!=t&&"object"==typeof t&&(this.pushBuffer.push(t),this.scheduleFlush())}pushMany(t){if(0===t.length)return;let e=0;for(let n=0;t.length>n;n++){const s=t[n];null!=s&&"object"==typeof s&&(this.pushBuffer.push(s),e++)}0!==e&&this.scheduleFlush()}flush(){this.flushPushBuffer()}clear(){this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=0),this.lastBoundedData=null,this.pushBuffer=[],this.flushScheduled=!1}};function c(t,e){return t===e}function a(t,e){if("function"==typeof t)return e=>+t(e);const n=t||e;return t=>+t[n]}function f(t,e){if("function"==typeof t)return t;const n=t||e;return t=>t[n]}function y(t,e){return"function"==typeof t?t:t?e=>e[t]+"":e?t=>t[e]+"":void 0}function d(t,e,n,s){return"function"==typeof t?t({size:e,margin:n,scales:s}):t}function m(t,e,n,s){return"string"==typeof t?{key:t,fn:null}:"function"==typeof t?{key:n,fn:t}:"string"==typeof e?{key:e,fn:null}:"function"==typeof e?{key:s,fn:e}:{key:void 0,fn:null}}function p(t,e,n){return s=>{if(!s||!n||!t.fn&&!e.fn)return s;let i=!1;const o=s.map(n=>{const s=t.fn&&t.key&&!(t.key in n),o=e.fn&&e.key&&!(e.key in n);if(!s&&!o)return n;i=!0;const r={...n};return s&&(r[t.key]=t.fn(n)),o&&(r[e.key]=e.fn(n)),r});return i?o:s}}function k(t){return new Set(Array.isArray(t)?t:[t])}function g(t,e,n){return"exact"===n?function(t,e){const n=t.domain(),s=n[0],i=n[n.length-1],o=s instanceof Date,r=s instanceof Date?s.getTime():s,l=i instanceof Date?i.getTime():i;if(2>e||r===l)return o?[new Date(r),new Date(l)]:[r,l];const h=(l-r)/(e-1),u=Array(e);for(let t=0;e>t;t++){const n=t===e-1?l:r+t*h;u[t]=o?new Date(n):n}return u}(t,e):t.ticks(e)}var T=new Map;function x(t){try{if(t.path)return new Path2D(t.path);const e=`${t.symbolType??"circle"}:${Math.round(t.size)}`;let n=T.get(e);return n||(n=new Path2D(l(t.symbolType,t.size)),T.size>256&&T.clear(),T.set(e,n)),n}catch{return null}}var b=(t,e)=>{const n=t.globalAlpha;for(const s of e){if("symbol"!==s.type)continue;const e=s;if(0>=e.size)continue;const i=x(e);if(!i)continue;t.save(),t.translate(e.x,e.y),e.rotation&&t.rotate(e.rotation);const o=(e.style.opacity??1)*(e._decayOpacity??1);e.style.fill&&(t.globalAlpha=n*o*(e.style.fillOpacity??1),t.fillStyle=r(t,e.style.fill,"#4e79a7"),t.fill(i)),e.style.stroke&&"none"!==e.style.stroke&&(t.globalAlpha=n*o,t.strokeStyle=r(t,e.style.stroke,e.style.stroke),t.lineWidth=e.style.strokeWidth??1,t.stroke(i)),t.restore()}t.globalAlpha=n};function w(t,e){const{x:s,y:i,w:o,h:r}=e,{tl:l,tr:h,br:u,bl:c}=n(e);t.beginPath(),t.moveTo(s+l,i),t.lineTo(s+o-h,i),h>0&&t.arcTo(s+o,i,s+o,i+h,h),t.lineTo(s+o,i+r-u),u>0&&t.arcTo(s+o,i+r,s+o-u,i+r,u),t.lineTo(s+c,i+r),c>0&&t.arcTo(s,i+r,s,i+r-c,c),t.lineTo(s,i+l),l>0&&t.arcTo(s,i,s+l,i,l),t.closePath()}function v(t){switch(t.roundedEdge){case"bottom":return{x0:t.x,y0:t.y+t.h,x1:t.x,y1:t.y};case"right":return{x0:t.x+t.w,y0:t.y,x1:t.x,y1:t.y};case"left":return{x0:t.x,y0:t.y,x1:t.x+t.w,y1:t.y};default:return{x0:t.x,y0:t.y,x1:t.x,y1:t.y+t.h}}}var S=(n,s,l,h)=>{const u=s.filter(t=>"rect"===t.type);for(const s of u){if(null!=s.style.opacity&&(n.globalAlpha=s.style.opacity),s.style.icon)F(n,s);else if(s.cornerRadii&&i(s.cornerRadii)){const t=r(n,s.style.fill,o(n,"var(--semiotic-primary, #007bff)")),i=v(s),l=s.fillGradient&&"string"==typeof t?e(n,s.fillGradient,t,i.x0,i.y0,i.x1,i.y1):null;n.fillStyle=l||t,w(n,s),n.fill(),s.style.stroke&&"none"!==s.style.stroke&&(n.strokeStyle=o(n,s.style.stroke)||s.style.stroke,n.lineWidth=s.style.strokeWidth||1,n.stroke())}else if(s.roundedTop&&s.roundedTop>0){const t=r(n,s.style.fill,o(n,"var(--semiotic-primary, #007bff)")),i=v(s),l=s.fillGradient&&"string"==typeof t?e(n,s.fillGradient,t,i.x0,i.y0,i.x1,i.y1):null;n.fillStyle=l||t;const h=Math.min(s.roundedTop,s.w/2,s.h/2);n.beginPath();const{x:u,y:c,w:a,h:f}=s;switch(s.roundedEdge){case"right":n.moveTo(u,c),n.lineTo(u+a-h,c),n.arcTo(u+a,c,u+a,c+h,h),n.lineTo(u+a,c+f-h),n.arcTo(u+a,c+f,u+a-h,c+f,h),n.lineTo(u,c+f);break;case"left":n.moveTo(u+a,c),n.lineTo(u+h,c),n.arcTo(u,c,u,c+h,h),n.lineTo(u,c+f-h),n.arcTo(u,c+f,u+h,c+f,h),n.lineTo(u+a,c+f);break;case"bottom":n.moveTo(u,c),n.lineTo(u+a,c),n.lineTo(u+a,c+f-h),n.arcTo(u+a,c+f,u+a-h,c+f,h),n.lineTo(u+h,c+f),n.arcTo(u,c+f,u,c+f-h,h);break;default:n.moveTo(u,c+f),n.lineTo(u,c+h),n.arcTo(u,c,u+h,c,h),n.lineTo(u+a-h,c),n.arcTo(u+a,c,u+a,c+h,h),n.lineTo(u+a,c+f)}n.closePath(),n.fill(),s.style.stroke&&"none"!==s.style.stroke&&(n.strokeStyle=o(n,s.style.stroke)||s.style.stroke,n.lineWidth=s.style.strokeWidth||1,n.stroke())}else{const t=r(n,s.style.fill,o(n,"var(--semiotic-primary, #007bff)")),i=v(s),l=s.fillGradient&&"string"==typeof t?e(n,s.fillGradient,t,i.x0,i.y0,i.x1,i.y1):null;n.fillStyle=l||t,n.fillRect(s.x,s.y,s.w,s.h),s.style.stroke&&"none"!==s.style.stroke&&(n.strokeStyle=o(n,s.style.stroke)||s.style.stroke,n.lineWidth=s.style.strokeWidth||1,n.strokeRect(s.x,s.y,s.w,s.h))}t(n,s),n.globalAlpha=1}};function F(t,e){const n=e.style.icon,s=e.style.iconPadding||2,i=Math.min(e.w,e.h)-s;if(0>=i)return;const o=e.h>e.w;if(t.save(),t.beginPath(),t.rect(e.x,e.y,e.w,e.h),t.clip(),o){const o=i+s,r=e.x+(e.w-i)/2;for(let s=e.y+e.h-i;s>=e.y-i;s-=o)t.drawImage(n,r,s,i,i)}else{const o=i+s,r=e.y+(e.h-i)/2;for(let s=e.x;e.x+e.w>s;s+=o)t.drawImage(n,s,r,i,i)}t.restore()}function _(t,e,n,s,i,o){const r=[];for(const i of t){const t=n(i),o=s(i);Number.isFinite(t)&&Number.isFinite(o)&&r.push({px:e.x(t),py:e.y(o),rawY:o,d:i})}r.sort((t,e)=>t.px-e.px);const l=Array(r.length),h=Array(r.length),u=Array(r.length);for(let t=0;r.length>t;t++){const e=r[t];l[t]=[e.px,e.py],h[t]=e.rawY,u[t]=e.d}return{type:"line",path:l,rawValues:h,style:i,datum:u,group:o}}function A(t,e,n,s,i,o,r,l){const h=[];for(const o of t){const t=n(o),r=s(o);if(!Number.isFinite(t)||!Number.isFinite(r))continue;const u=e.x(t),c=l?l(o):i;h.push({px:u,topY:e.y(r),botY:e.y(c)})}h.sort((t,e)=>t.px-e.px);const u=Array(h.length),c=Array(h.length);for(let t=0;h.length>t;t++){const e=h[t];u[t]=[e.px,e.topY],c[t]=[e.px,e.botY]}return{type:"area",topPath:u,bottomPath:c,style:o,datum:t,group:r}}function B(t,e,n,s){const i=new Map;if("silhouette"===s)for(const s of t){let t=0;for(const i of e)t+=n(i,s)||0;i.set(s,-t/2)}else if("wiggle"===s){t.length>0&&i.set(t[0],0);for(let s=1;t.length>s;s++){const o=t[s-1],r=t[s];let l=0,h=0,u=0;for(const t of e){const e=n(t,r)||0;l+=(2*u+e)*(e-(n(t,o)||0)),h+=e,u+=e}const c=i.get(o)??0;i.set(r,c-(h>0?l/(2*h):0))}if(t.length>0){let s=0;for(const o of t){let t=0;for(const s of e)t+=n(s,o)||0;s+=(i.get(o)??0)+t/2}const o=s/t.length;for(const e of t)i.set(e,(i.get(e)??0)-o)}}else for(const e of t)i.set(e,0);return i}function z(t,e,n){let s=0,i=0;for(const o of t){let t=0,r=0;for(const s of e){const e=n(s,o)||0;0>e?r+=e:t+=e}s>r&&(s=r),t>i&&(i=t)}return[s,i]}function D(t,e,n,s,i,o,r,l="zero"){const h=new Set;for(const e of t)for(const t of e.data){const e=n(t);Number.isFinite(e)&&h.add(e)}const u=Array.from(h).sort((t,e)=>t-e),c=new Map;for(const e of t){const t=new Map;for(const i of e.data){const e=n(i),o=s(i);Number.isFinite(e)&&Number.isFinite(o)&&t.set(e,(t.get(e)||0)+o)}c.set(e.key,t)}let a;if(o){a=new Map;for(const e of u){let n=0;for(const s of t)n+=c.get(s.key)?.get(e)||0;a.set(e,n||1)}}const f=B(u,t.map(t=>t.key),(t,e)=>c.get(t)?.get(e)||0,l),y="diverging"===l&&!o,d=[],m=new Map,p=new Map,k=new Map,g=new Map;for(const t of u)p.set(t,f.get(t)??0),k.set(t,0),g.set(t,0);for(const n of t){const t=c.get(n.key),s=new Map;let l=[],h=[];const f=()=>{if(l.length>=2){const t={type:"area",topPath:l,bottomPath:h,style:i(n.key,n.data[0]),datum:n.data,group:n.key};r&&(t.curve=r),d.push(t)}l=[],h=[]};for(const n of u){const i=t.has(n);let r,u,c=i?t.get(n):0;if(o&&i&&(c/=a.get(n)),!i||!Number.isFinite(c)||0===c){f();continue}y?c>0?(r=k.get(n),u=r+c,k.set(n,u)):(r=g.get(n),u=r+c,g.set(n,u)):(r=p.get(n),u=r+c,p.set(n,u));const d=e.x(n);h.push([d,e.y(r)]),l.push([d,e.y(u)]),s.set(n,u)}f(),m.set(n.key,s)}return{nodes:d,stackedTops:m}}function M(t,e,n,s,i,o,r){const l=n(t),h=s(t);if(!Number.isFinite(l)||!Number.isFinite(h))return null;const u={type:"point",x:e.x(l),y:e.y(h),r:i,style:o,datum:t};return void 0!==r&&(u.pointId=r),u}function P(t,e,n,s,i,o,r,l){const h=n(t),u=s(t);if(!Number.isFinite(h)||!Number.isFinite(u))return null;const c={type:"symbol",x:e.x(h),y:e.y(u),size:i,symbolType:o,style:r,datum:t};return void 0!==l&&(c.pointId=l),c}function N(t,e,n,s,i,o,r){return{type:"rect",x:t,y:e,w:n,h:s,style:i,datum:o,group:r}}function W(t,e,n,s,i,o,r){const l={type:"heatcell",x:t,y:e,w:n,h:s,fill:i,datum:o};return r?.showValues&&(l.showValues=!0,l.value=r.value,r.valueFormat&&(l.valueFormat=r.valueFormat)),l}export{u as DataSourceAdapter,h as IncrementalExtent,c as accessorsEquivalent,a as resolveAccessor,f as resolveRawAccessor,y as resolveStringAccessor,k as toIdSet,_ as buildLineNode,A as buildAreaNode,B as computeStackOffsets,z as computeDivergingStackExtent,D as buildStackedAreaNodes,M as buildPointNode,P as buildSymbolNode,N as buildRectNode,W as buildHeatcellNode,g as ticksForMode,d as resolveFrameGraphics,m as resolveAnnotationAccessor,p as buildEnrichAnnotationData,b as symbolCanvasRenderer,S as barCanvasRenderer};
2
+ import{renderRectPulse as t}from"./chunk-chunk-F7WFPD4O.module.min.js";import{buildLinearFillGradient as e,clampCornerRadii as n,filterSparseArray as s,hasAnyCornerRadius as i,resolveCSSColor as o,resolveCanvasFill as r,symbolPathString as l}from"./chunk-chunk-BFHUYEOS.module.min.js";var h=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(t){Number.isFinite(t)&&(this._min>t&&(this._min=t),t>this._max&&(this._max=t))}evict(t){t!==this._min&&t!==this._max||(this._dirty=!0)}recalculate(t,e){this._min=1/0,this._max=-1/0;for(const n of t){const t=e?e(n):n;Number.isFinite(t)&&(this._min>t&&(this._min=t),t>this._max&&(this._max=t))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}},u=class{constructor(t,e){this.lastBoundedData=null,this.chunkTimer=0,this.pushBuffer=[],this.flushScheduled=!1,this.callback=t,this.chunkThreshold=e?.chunkThreshold??5e3,this.chunkSize=e?.chunkSize??5e3}updateChunkOptions(t){null!=t.chunkThreshold&&(this.chunkThreshold=t.chunkThreshold),null!=t.chunkSize&&(this.chunkSize=t.chunkSize)}clearLastData(){this.lastBoundedData=null,this.pushBuffer=[],this.flushScheduled=!1,this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=0)}setBoundedData(t){if(t=s(t),this.lastBoundedData===t)return;if(this.lastBoundedData=t,this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=0),this.chunkThreshold>=t.length)return void this.callback({inserts:t,bounded:!0});this.callback({inserts:t.slice(0,this.chunkSize),bounded:!0,totalSize:t.length});let e=this.chunkSize;const n=()=>{if(e>=t.length)return void(this.chunkTimer=0);if(t!==this.lastBoundedData)return void(this.chunkTimer=0);const s=Math.min(e+this.chunkSize,t.length);this.callback({inserts:t.slice(e,s),bounded:!1}),e=s,this.chunkTimer=t.length>e?requestAnimationFrame(n):0};this.chunkTimer=requestAnimationFrame(n)}setReplacementData(t){if(t=s(t),this.lastBoundedData=t,this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=0),this.pushBuffer=[],this.flushScheduled=!1,this.chunkThreshold>=t.length)return void this.callback({inserts:t,bounded:!0,preserveCategoryOrder:!0});this.callback({inserts:t.slice(0,this.chunkSize),bounded:!0,preserveCategoryOrder:!0,totalSize:t.length});let e=this.chunkSize;const n=()=>{if(e>=t.length)return void(this.chunkTimer=0);if(t!==this.lastBoundedData)return void(this.chunkTimer=0);const s=Math.min(e+this.chunkSize,t.length);this.callback({inserts:t.slice(e,s),bounded:!1}),e=s,this.chunkTimer=t.length>e?requestAnimationFrame(n):0};this.chunkTimer=requestAnimationFrame(n)}flushPushBuffer(){if(this.flushScheduled=!1,0===this.pushBuffer.length)return;const t=this.pushBuffer;this.pushBuffer=[],this.callback({inserts:t,bounded:!1})}scheduleFlush(){this.flushScheduled||(this.flushScheduled=!0,queueMicrotask(()=>this.flushPushBuffer()))}push(t){null!=t&&"object"==typeof t&&(this.pushBuffer.push(t),this.scheduleFlush())}pushMany(t){if(0===t.length)return;let e=0;for(let n=0;t.length>n;n++){const s=t[n];null!=s&&"object"==typeof s&&(this.pushBuffer.push(s),e++)}0!==e&&this.scheduleFlush()}flush(){this.flushPushBuffer()}clear(){this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=0),this.lastBoundedData=null,this.pushBuffer=[],this.flushScheduled=!1}};function c(t,e){return t===e}function a(t,e){if("function"==typeof t)return e=>+t(e);const n=t||e;return t=>+t[n]}function f(t,e){if("function"==typeof t)return t;const n=t||e;return t=>t[n]}function y(t,e){return"function"==typeof t?t:t?e=>e[t]+"":e?t=>t[e]+"":void 0}function d(t,e,n,s){return"function"==typeof t?t({size:e,margin:n,scales:s}):t}function m(t,e,n,s){return"string"==typeof t?{key:t,fn:null}:"function"==typeof t?{key:n,fn:t}:"string"==typeof e?{key:e,fn:null}:"function"==typeof e?{key:s,fn:e}:{key:void 0,fn:null}}function p(t,e,n){return s=>{if(!s||!n||!t.fn&&!e.fn)return s;let i=!1;const o=s.map(n=>{const s=t.fn&&t.key&&!(t.key in n),o=e.fn&&e.key&&!(e.key in n);if(!s&&!o)return n;i=!0;const r={...n};return s&&(r[t.key]=t.fn(n)),o&&(r[e.key]=e.fn(n)),r});return i?o:s}}function k(t){return new Set(Array.isArray(t)?t:[t])}function g(t,e,n){return"exact"===n?function(t,e){const n=t.domain(),s=n[0],i=n[n.length-1],o=s instanceof Date,r=s instanceof Date?s.getTime():s,l=i instanceof Date?i.getTime():i;if(2>e||r===l)return o?[new Date(r),new Date(l)]:[r,l];const h=(l-r)/(e-1),u=Array(e);for(let t=0;e>t;t++){const n=t===e-1?l:r+t*h;u[t]=o?new Date(n):n}return u}(t,e):t.ticks(e)}var T=new Map;function x(t){try{if(t.path)return new Path2D(t.path);const e=`${t.symbolType??"circle"}:${Math.round(t.size)}`;let n=T.get(e);return n||(n=new Path2D(l(t.symbolType,t.size)),T.size>256&&T.clear(),T.set(e,n)),n}catch{return null}}var b=(t,e)=>{const n=t.globalAlpha;for(const s of e){if("symbol"!==s.type)continue;const e=s;if(0>=e.size)continue;const i=x(e);if(!i)continue;t.save(),t.translate(e.x,e.y),e.rotation&&t.rotate(e.rotation);const o=(e.style.opacity??1)*(e._decayOpacity??1);e.style.fill&&(t.globalAlpha=n*o*(e.style.fillOpacity??1),t.fillStyle=r(t,e.style.fill,"#4e79a7"),t.fill(i)),e.style.stroke&&"none"!==e.style.stroke&&(t.globalAlpha=n*o,t.strokeStyle=r(t,e.style.stroke,e.style.stroke),t.lineWidth=e.style.strokeWidth??1,t.stroke(i)),t.restore()}t.globalAlpha=n};function w(t,e){const{x:s,y:i,w:o,h:r}=e,{tl:l,tr:h,br:u,bl:c}=n(e);t.beginPath(),t.moveTo(s+l,i),t.lineTo(s+o-h,i),h>0&&t.arcTo(s+o,i,s+o,i+h,h),t.lineTo(s+o,i+r-u),u>0&&t.arcTo(s+o,i+r,s+o-u,i+r,u),t.lineTo(s+c,i+r),c>0&&t.arcTo(s,i+r,s,i+r-c,c),t.lineTo(s,i+l),l>0&&t.arcTo(s,i,s+l,i,l),t.closePath()}function v(t){switch(t.roundedEdge){case"bottom":return{x0:t.x,y0:t.y+t.h,x1:t.x,y1:t.y};case"right":return{x0:t.x+t.w,y0:t.y,x1:t.x,y1:t.y};case"left":return{x0:t.x,y0:t.y,x1:t.x+t.w,y1:t.y};default:return{x0:t.x,y0:t.y,x1:t.x,y1:t.y+t.h}}}var F=(n,s,l,h)=>{const u=s.filter(t=>"rect"===t.type);for(const s of u){if(null!=s.style.opacity&&(n.globalAlpha=s.style.opacity),s.style.icon)S(n,s);else if(s.cornerRadii&&i(s.cornerRadii)){const t=r(n,s.style.fill,o(n,"var(--semiotic-primary, #007bff)")),i=v(s),l=s.fillGradient&&"string"==typeof t?e(n,s.fillGradient,t,i.x0,i.y0,i.x1,i.y1):null;n.fillStyle=l||t,w(n,s),n.fill(),s.style.stroke&&"none"!==s.style.stroke&&(n.strokeStyle=o(n,s.style.stroke)||s.style.stroke,n.lineWidth=s.style.strokeWidth||1,n.stroke())}else if(s.roundedTop&&s.roundedTop>0){const t=r(n,s.style.fill,o(n,"var(--semiotic-primary, #007bff)")),i=v(s),l=s.fillGradient&&"string"==typeof t?e(n,s.fillGradient,t,i.x0,i.y0,i.x1,i.y1):null;n.fillStyle=l||t;const h=Math.min(s.roundedTop,s.w/2,s.h/2);n.beginPath();const{x:u,y:c,w:a,h:f}=s;switch(s.roundedEdge){case"right":n.moveTo(u,c),n.lineTo(u+a-h,c),n.arcTo(u+a,c,u+a,c+h,h),n.lineTo(u+a,c+f-h),n.arcTo(u+a,c+f,u+a-h,c+f,h),n.lineTo(u,c+f);break;case"left":n.moveTo(u+a,c),n.lineTo(u+h,c),n.arcTo(u,c,u,c+h,h),n.lineTo(u,c+f-h),n.arcTo(u,c+f,u+h,c+f,h),n.lineTo(u+a,c+f);break;case"bottom":n.moveTo(u,c),n.lineTo(u+a,c),n.lineTo(u+a,c+f-h),n.arcTo(u+a,c+f,u+a-h,c+f,h),n.lineTo(u+h,c+f),n.arcTo(u,c+f,u,c+f-h,h);break;default:n.moveTo(u,c+f),n.lineTo(u,c+h),n.arcTo(u,c,u+h,c,h),n.lineTo(u+a-h,c),n.arcTo(u+a,c,u+a,c+h,h),n.lineTo(u+a,c+f)}n.closePath(),n.fill(),s.style.stroke&&"none"!==s.style.stroke&&(n.strokeStyle=o(n,s.style.stroke)||s.style.stroke,n.lineWidth=s.style.strokeWidth||1,n.stroke())}else{const t=r(n,s.style.fill,o(n,"var(--semiotic-primary, #007bff)")),i=v(s),l=s.fillGradient&&"string"==typeof t?e(n,s.fillGradient,t,i.x0,i.y0,i.x1,i.y1):null;n.fillStyle=l||t,n.fillRect(s.x,s.y,s.w,s.h),s.style.stroke&&"none"!==s.style.stroke&&(n.strokeStyle=o(n,s.style.stroke)||s.style.stroke,n.lineWidth=s.style.strokeWidth||1,n.strokeRect(s.x,s.y,s.w,s.h))}t(n,s),n.globalAlpha=1}};function S(t,e){const n=e.style.icon,s=e.style.iconPadding||2,i=Math.min(e.w,e.h)-s;if(0>=i)return;const o=e.h>e.w;if(t.save(),t.beginPath(),t.rect(e.x,e.y,e.w,e.h),t.clip(),o){const o=i+s,r=e.x+(e.w-i)/2;for(let s=e.y+e.h-i;s>=e.y-i;s-=o)t.drawImage(n,r,s,i,i)}else{const o=i+s,r=e.y+(e.h-i)/2;for(let s=e.x;e.x+e.w>s;s+=o)t.drawImage(n,s,r,i,i)}t.restore()}function _(t,e,n,s,i,o){const r=[];for(const i of t){const t=n(i),o=s(i);Number.isFinite(t)&&Number.isFinite(o)&&r.push({px:e.x(t),py:e.y(o),rawY:o,d:i})}r.sort((t,e)=>t.px-e.px);const l=Array(r.length),h=Array(r.length),u=Array(r.length);for(let t=0;r.length>t;t++){const e=r[t];l[t]=[e.px,e.py],h[t]=e.rawY,u[t]=e.d}return{type:"line",path:l,rawValues:h,style:i,datum:u,group:o}}function A(t,e,n,s,i,o,r,l){const h=[];for(const o of t){const t=n(o),r=s(o);if(!Number.isFinite(t)||!Number.isFinite(r))continue;const u=e.x(t),c=l?l(o):i;h.push({px:u,topY:e.y(r),botY:e.y(c)})}h.sort((t,e)=>t.px-e.px);const u=Array(h.length),c=Array(h.length);for(let t=0;h.length>t;t++){const e=h[t];u[t]=[e.px,e.topY],c[t]=[e.px,e.botY]}return{type:"area",topPath:u,bottomPath:c,style:o,datum:t,group:r}}function B(t,e,n,s){const i=new Map;if("silhouette"===s)for(const s of t){let t=0;for(const i of e)t+=n(i,s)||0;i.set(s,-t/2)}else if("wiggle"===s){t.length>0&&i.set(t[0],0);for(let s=1;t.length>s;s++){const o=t[s-1],r=t[s];let l=0,h=0,u=0;for(const t of e){const e=n(t,r)||0;l+=(2*u+e)*(e-(n(t,o)||0)),h+=e,u+=e}const c=i.get(o)??0;i.set(r,c-(h>0?l/(2*h):0))}if(t.length>0){let s=0;for(const o of t){let t=0;for(const s of e)t+=n(s,o)||0;s+=(i.get(o)??0)+t/2}const o=s/t.length;for(const e of t)i.set(e,(i.get(e)??0)-o)}}else for(const e of t)i.set(e,0);return i}function z(t,e,n){let s=0,i=0;for(const o of t){let t=0,r=0;for(const s of e){const e=n(s,o)||0;0>e?r+=e:t+=e}s>r&&(s=r),t>i&&(i=t)}return[s,i]}function D(t,e,n,s,i,o,r,l="zero"){const h=new Set;for(const e of t)for(const t of e.data){const e=n(t);Number.isFinite(e)&&h.add(e)}const u=Array.from(h).sort((t,e)=>t-e),c=new Map;for(const e of t){const t=new Map;for(const i of e.data){const e=n(i),o=s(i);Number.isFinite(e)&&Number.isFinite(o)&&t.set(e,(t.get(e)||0)+o)}c.set(e.key,t)}let a;if(o){a=new Map;for(const e of u){let n=0;for(const s of t)n+=c.get(s.key)?.get(e)||0;a.set(e,n||1)}}const f=B(u,t.map(t=>t.key),(t,e)=>c.get(t)?.get(e)||0,l),y="diverging"===l&&!o,d=[],m=new Map,p=new Map,k=new Map,g=new Map;for(const t of u)p.set(t,f.get(t)??0),k.set(t,0),g.set(t,0);for(const n of t){const t=c.get(n.key),s=new Map;let l=[],h=[];const f=()=>{if(l.length>=2){const t={type:"area",topPath:l,bottomPath:h,style:i(n.key,n.data[0]),datum:n.data,group:n.key};r&&(t.curve=r),d.push(t)}l=[],h=[]};for(const n of u){const i=t.has(n);let r,u,c=i?t.get(n):0;if(o&&i&&(c/=a.get(n)),!i||!Number.isFinite(c)||0===c){f();continue}y?c>0?(r=k.get(n),u=r+c,k.set(n,u)):(r=g.get(n),u=r+c,g.set(n,u)):(r=p.get(n),u=r+c,p.set(n,u));const d=e.x(n);h.push([d,e.y(r)]),l.push([d,e.y(u)]),s.set(n,u)}f(),m.set(n.key,s)}return{nodes:d,stackedTops:m}}function M(t,e,n,s,i,o,r){const l=n(t),h=s(t);if(!Number.isFinite(l)||!Number.isFinite(h))return null;const u={type:"point",x:e.x(l),y:e.y(h),r:i,style:o,datum:t};return void 0!==r&&(u.pointId=r),u}function P(t,e,n,s,i,o,r,l){const h=n(t),u=s(t);if(!Number.isFinite(h)||!Number.isFinite(u))return null;const c={type:"symbol",x:e.x(h),y:e.y(u),size:i,symbolType:o,style:r,datum:t};return void 0!==l&&(c.pointId=l),c}function N(t,e,n,s,i,o,r){return{type:"rect",x:t,y:e,w:n,h:s,style:i,datum:o,group:r}}function W(t,e,n,s,i,o,r){const l={type:"heatcell",x:t,y:e,w:n,h:s,fill:i,datum:o};return r?.showValues&&(l.showValues=!0,l.value=r.value,r.valueFormat&&(l.valueFormat=r.valueFormat)),l}export{u as DataSourceAdapter,h as IncrementalExtent,c as accessorsEquivalent,a as resolveAccessor,f as resolveRawAccessor,y as resolveStringAccessor,k as toIdSet,_ as buildLineNode,A as buildAreaNode,B as computeStackOffsets,z as computeDivergingStackExtent,D as buildStackedAreaNodes,M as buildPointNode,P as buildSymbolNode,N as buildRectNode,W as buildHeatcellNode,g as ticksForMode,d as resolveFrameGraphics,m as resolveAnnotationAccessor,p as buildEnrichAnnotationData,b as symbolCanvasRenderer,F as barCanvasRenderer};