"use strict";(self.webpackChunkgrafana_lokiexplore_app=self.webpackChunkgrafana_lokiexplore_app||[]).push([[955],{3929:(t,e,i)=>{i.d(e,{c:()=>W});var s,o=i(62540),r=i(85959),n=i(48398),h=function(){return h=Object.assign||function(t){for(var e,i=1,s=arguments.length;i{i.d(e,{w:()=>a});var s=i(85959);const o="undefined"!=typeof document?s.useLayoutEffect:()=>{};var r;const n=null!==(r=s.useInsertionEffect)&&void 0!==r?r:o;function h(t){const e=(0,s.useRef)(null);return n(()=>{e.current=t},[t]),(0,s.useCallback)((...t)=>{const i=e.current;return null==i?void 0:i(...t)},[])}function a(t){const{ref:e,box:i,onResize:o}=t;let r=h(o);(0,s.useEffect)(()=>{let t=null==e?void 0:e.current;if(t){if(void 0===window.ResizeObserver)return window.addEventListener("resize",r,!1),()=>{window.removeEventListener("resize",r,!1)};{const e=new window.ResizeObserver(t=>{t.length&&r()});return e.observe(t,{box:i}),()=>{t&&e.unobserve(t)}}}},[e,i])}},97228:(t,e,i)=>{i.d(e,{F:()=>a,P:()=>n});var s=i(85959),o=i(62540),r=(0,s.createContext)(void 0),n=({children:t,enabled:e=!0,horizontal:i=!0,onSync:n,proportional:h=!0,vertical:a=!0})=>{const p=(0,s.useRef)({}),l=(0,s.useCallback)((t,e)=>!!p.current[e]&&p.current[e].find(e=>e===t),[]),u=(0,s.useCallback)((t,e)=>{const{clientHeight:s,clientWidth:o,scrollHeight:r,scrollLeft:n,scrollTop:p,scrollWidth:l}=t,u=r-s,d=l-o,c=e.scrollHeight-s,f=e.scrollWidth-o;a&&u>0&&(e.scrollTop=h?c*p/u:p),i&&d>0&&(e.scrollLeft=h?f*n/d:n)},[h,a,i]),d=(0,s.useCallback)(t=>{t.onscroll=null},[]),c=(0,s.useCallback)((t,i)=>{t.onscroll=()=>{e&&(window.requestAnimationFrame(()=>{i.forEach(e=>{p.current[e]?.forEach(e=>{t!==e&&(d(e),u(t,e),window.requestAnimationFrame(()=>{const t=Object.keys(p.current).filter(t=>p.current[t].includes(e));c(e,t)}))})})}),n&&n(t))}},[n,d,u,e]),f=(0,s.useCallback)((t,e)=>{e.forEach(e=>{p.current[e]||(p.current[e]=[]),l(t,e)||(p.current[e].length>0&&u(p.current[e][0],t),p.current[e].push(t))}),c(t,e)},[l,u,c]),g=(0,s.useCallback)((t,e)=>{e.forEach(e=>{if(l(t,e)){d(t);const i=p.current[e].indexOf(t);-1!==i&&p.current[e].splice(i,1)}})},[l,d]);return(0,o.jsx)(r.Provider,{value:{registerPane:f,unregisterPane:g},children:s.Children.only(t)})},h=t=>Array.isArray(t)?t:[t],a=({attachTo:t,children:e,enabled:i=!0,group:o="default",innerRef:n})=>{const a=(()=>{const t=(0,s.useContext)(r);if(!t)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return t})(),p=(0,s.useRef)(null),l=(0,s.useRef)(null),u=(0,s.useCallback)(()=>{l.current=t?"function"==typeof t?null:t.current:p.current},[t]);return(0,s.useEffect)(()=>(u(),i&&l.current&&a.registerPane(l.current,h(o)),()=>{i&&l.current&&a.unregisterPane(l.current,h(o))}),[a,i,o,t,u]),t?e:(0,s.cloneElement)(e,{ref:t=>{p.current=t,"function"==typeof n?n(t):n&&t&&(n.current=t)}})}}}]); //# sourceMappingURL=955.js.map?_cache=a33e9e6b7ad763d553e9