/*! Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. * Licensed under the Elastic License 2.0; you may not use this file except in compliance with the Elastic License 2.0. */ (window.logsShared_bundle_jsonpfunction=window.logsShared_bundle_jsonpfunction||[]).push([[4],{107:function(t,e,r){"use strict";r.r(e),r.d(e,"LogColumnHeadersWrapper",(function(){return o}));var i=r(13),l=r(30),s=r(108);const o=i.euiStyled.div.attrs((t=>{var e;return{role:null!==(e=t.role)&&void 0!==e?e:"row"}}))` align-items: stretch; display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: flex-start; overflow: hidden; padding-right: ${s.a}px; border-bottom: ${t=>t.theme.eui.euiBorderThin}; box-shadow: 0 2px 2px -1px ${t=>Object(l.transparentize)(.3,t.theme.eui.euiColorLightShade)}; position: relative; z-index: 1; `;e.default=o},108:function(t,e,r){"use strict";r.d(e,"a",(function(){return c})),r.d(e,"b",(function(){return VerticalScrollPanel}));var i=r(33),l=r.n(i),s=r(38),o=r(8),n=r(1),h=r(13),d=r(2);const c=20;class VerticalScrollPanel extends n.PureComponent{constructor(...t){super(...t),l()(this,"scrollRef",n.createRef()),l()(this,"childRefs",new Map),l()(this,"childDimensions",new Map),l()(this,"nextScrollEventFromCenterTarget",!1),l()(this,"handleScroll",Object(o.throttle)((()=>{this.reportVisibleChildren(!this.nextScrollEventFromCenterTarget),this.nextScrollEventFromCenterTarget=!1}),250)),l()(this,"registerChild",((t,e)=>{null===e?this.childRefs.delete(t):this.childRefs.set(t,e)})),l()(this,"updateChildDimensions",(()=>{this.childDimensions=new Map(Object(o.sortBy)(Array.from(this.childRefs.entries()).reduce(((t,[e,r])=>{const i=r.getOffsetRect();return null!==i&&t.push([e,i]),t}),[]),"1.top"))})),l()(this,"getVisibleChildren",(()=>{if(null===this.scrollRef.current||this.childDimensions.size<=0)return;const{childDimensions:t,props:{height:e},scrollRef:{current:{scrollTop:r}}}=this;return a(Array.from(t.entries()),e,r)})),l()(this,"getScrollPosition",(()=>{if(null===this.scrollRef.current)return;const{props:{height:t},scrollRef:{current:{scrollHeight:e,scrollTop:r}}}=this;return{pagesAbove:r/t,pagesBelow:(e-r-t)/t}})),l()(this,"reportVisibleChildren",((t=!1)=>{const{onVisibleChildrenChange:e}=this.props,r=this.getVisibleChildren(),i=this.getScrollPosition();r&&i&&"function"==typeof e&&e({bottomChild:r.bottomChild,middleChild:r.middleChild,topChild:r.topChild,fromScroll:t,...i})})),l()(this,"centerTarget",((t,e)=>{const{props:{height:r},childDimensions:i,scrollRef:l}=this;if(null===l.current||!t||i.size<=0)return!1;const s=i.get(t);if(s){const t=void 0===e?s.height/2:e;this.nextScrollEventFromCenterTarget=!0;const i=l.current.scrollTop,o=s.top+t-r/2;return l.current.scrollTop=o,i!==o}return!1})),l()(this,"handleUpdatedChildren",((t,e)=>{this.updateChildDimensions();let r=!1;t&&(r=this.centerTarget(t,e)),r||this.reportVisibleChildren()}))}componentDidMount(){this.handleUpdatedChildren(this.props.target,void 0)}getSnapshotBeforeUpdate(t){if(0===t.height&&this.props.height>0||t.target!==this.props.target&&this.props.target)return{scrollOffset:void 0,scrollTarget:this.props.target};if(this.props.height>0){const t=this.getVisibleChildren();if(t)return{scrollOffset:t.middleChildOffset,scrollTarget:t.middleChild}}return{scrollOffset:void 0,scrollTarget:void 0}}componentDidUpdate(t,e,r){t.height===this.props.height&&t.target===this.props.target&&t.entriesCount===this.props.entriesCount||this.handleUpdatedChildren(r.scrollTarget,r.scrollOffset),t.isLocked&&!this.props.isLocked&&this.scrollRef.current&&(this.scrollRef.current.scrollTop=this.scrollRef.current.scrollHeight)}componentWillUnmount(){this.childRefs.clear()}render(){const{children:t,height:e,width:r,hideScrollbar:i,"data-test-subj":l}=this.props,s=i?c:0;return Object(d.jsx)(p,{"data-test-subj":l,style:{height:e,width:r+s},scrollbarOffset:s,onScroll:this.handleScroll,ref:this.scrollRef},"function"==typeof t?t(this.registerChild):null)}}l()(VerticalScrollPanel,"defaultProps",{hideScrollbar:!1});const p=h.euiStyled.div` overflow-x: hidden; overflow-y: scroll; position: relative; padding-right: ${t=>t.scrollbarOffset||0}px; & * { overflow-anchor: none; } `,a=(t,e,r)=>{const i=Math.min(f(t,r+e/2),t.length-1),l=Math.min(f(t,r,0,i),t.length-1),s=Math.min(f(t,r+e,i),t.length-1);return{bottomChild:t[s][0],bottomChildOffset:t[s][1].top-r-e,middleChild:t[i][0],middleChildOffset:r+e/2-t[i][1].top,topChild:t[l][0],topChildOffset:t[l][1].top-r}},f=Object(s.bisector)((([t,e])=>e.top+e.height)).left}}]);