import r from"@babel/runtime/helpers/slicedToArray";import{useContext as t,useState as o,useCallback as n,useMemo as e}from"react";import{throttle as i}from"lodash";import a from"../../SettingsContext.js";import s from"../../ChartsContext.js";import c from"./Tooltip.js";import u from"./CursorPositioner.css.js";import{jsx as f}from"react/jsx-runtime";var m=function(){var m=t(s).chartsRef,h=t(a),l=h.settings,p=h.horizontal,v=h.maxTracesCount,g=h.settingsKey,d=o([]),x=r(d,2),j=x[0],C=x[1],y=o(!1),M=r(y,2),T=M[0],b=M[1],z=n(i((function(r){return function(r){if(b(!0),m&&m.current&&l[g]){var t=[];l[g].forEach((function(o,n){var e=[],i=m.current.get(n);if(i&&i.current&&i.current.chart){var a=i.current.chart,s=a.pointer.normalize(r);a.series.forEach((function(r){var t=r.searchPoint(s,!0);t&&e.push(t)}))}t.push(e)})),C(t)}}(r)}),50,{leading:!0,trailing:!1}),[m]),E=e((function(){var r,t=(null==l||null===(r=l[g])||void 0===r?void 0:r.length)||1;return p?{right:"".concat(68*v+32,"px"),height:"".concat(116*t,"px")}:{right:0,height:0}}),[v,p,l]);return f("div",{className:u.container,style:E,onMouseMove:z,onMouseLeave:function(){b(!1)},children:T&&f(c,{points:j})})};export{m as default};
//# sourceMappingURL=CursorPositioner.js.map
