(window.discover_bundle_jsonpfunction=window.discover_bundle_jsonpfunction||[]).push([[14],{300:function(e,t,n){"use strict";n.r(t);var i=n(12),a=n.n(i),s=n(6),l=n.n(s),c=n(13),d=n(11),o=n(2),u=n(87);const r=(e,t)=>Object(c.clamp)(t/e*100,0,100),x=(e,t,n)=>e===u.a.Vertical?n:t;var b={name:"13udsys",styles:"height:100%"},P={name:"m66md0",styles:"position:absolute;top:0;left:0;width:100%;height:100%;z-index:3"},j={name:"17jf8u5",styles:"z-index:4"},z={name:"1v771ry",styles:"z-index:3"};const f=({className:e,direction:t,container:n,fixedPanelSize:i,minFixedPanelSize:a,minFlexPanelSize:u,panelSizes:f,fixedPanel:m,flexPanel:S,resizeButtonClassName:O,"data-test-subj":h="resizableLayout",onFixedPanelSizeChange:g,setPanelSizes:F})=>{const p=Object(d.useGeneratedHtmlId)({prefix:"fixedPanel"}),{height:C,width:v}=Object(d.useResizeObserver)(n),w=x(t,v,C),[y,E]=Object(s.useState)(!1),N=Object(s.useCallback)((()=>E(!0)),[]),R=Object(s.useCallback)((()=>E(!1)),[]),$=z,k=j,B=P,I=Object(s.useCallback)((({[p]:e})=>{const t=((e,t)=>Math.round(e*(t/100)))(w,e),n=r(w,t);F({fixedPanelSizePct:Object(c.round)(n,4),flexPanelSizePct:Object(c.round)(100-n,4)}),null==g||g(t)}),[p,w,F,g]);Object(s.useEffect)((()=>{if(!w)return;let e,t;if(w<u+i){const n=w-u;n<a?(e=r(w,a),t=r(w,u)):(e=r(w,n),t=100-e)}else e=r(w,i),t=100-e;const n={fixedPanelSizePct:Object(c.round)(e,4),flexPanelSizePct:Object(c.round)(t,4)};Object(c.isEqual)(f,n)||F(n)}),[w,i,a,u,f,F]);const _=Object(s.useCallback)((e=>{"pointer"===e&&N()}),[N]),q=Object(s.useCallback)((()=>{if(y){if(document.activeElement instanceof HTMLElement){const e=document.activeElement;setTimeout((()=>{e.blur()}))}R()}}),[R,y]);return f.fixedPanelSizePct||f.flexPanelSizePct?Object(o.jsx)(d.EuiResizableContainer,{className:e,direction:t,onPanelWidthChange:I,onResizeStart:_,onResizeEnd:q,"data-test-subj":`${h}ResizableContainer`,css:b},((e,t)=>Object(o.jsx)(l.a.Fragment,null,Object(o.jsx)(e,{id:p,minSize:`${a}px`,size:f.fixedPanelSizePct,paddingSize:"none","data-test-subj":`${h}ResizablePanelFixed`},m),Object(o.jsx)(t,{className:O,css:y?k:$,"data-test-subj":`${h}ResizableButton`}),Object(o.jsx)(e,{minSize:`${u}px`,size:f.flexPanelSizePct,paddingSize:"none","data-test-subj":`${h}ResizablePanelFlex`},S),y?Object(o.jsx)("div",{css:B}):Object(o.jsx)(l.a.Fragment,null)))):null};var m={name:"13udsys",styles:"height:100%"},S={name:"1qmr6ab",styles:"overflow:auto"};const O=({className:e,direction:t,hideFixedPanel:n,fixedPanel:i,flexPanel:a})=>{const s=S;return Object(o.jsx)(d.EuiFlexGroup,{className:e,direction:t===u.a.Vertical?"column":"row",alignItems:"stretch",gutterSize:"none",responsive:!1,css:m},!n&&Object(o.jsx)(d.EuiFlexItem,{grow:!1},i),Object(o.jsx)(d.EuiFlexItem,{css:s},a))},h=[u.b.Single,u.b.Static];t.default=({className:e,mode:t,direction:n,container:i,fixedPanelSize:l,minFixedPanelSize:d,minFlexPanelSize:b,fixedPanel:P,flexPanel:j,resizeButtonClassName:z,"data-test-subj":m,onFixedPanelSizeChange:S})=>{const g={className:e,fixedPanel:P,flexPanel:j},[F,p]=Object(s.useState)((()=>{if(!i)return{fixedPanelSizePct:0,flexPanelSizePct:0};const{width:e,height:t}=i.getBoundingClientRect(),a=x(n,e,t);if(!a)return{fixedPanelSizePct:0,flexPanelSizePct:0};const s=r(a,l),d=100-s;return{fixedPanelSizePct:Object(c.round)(s,4),flexPanelSizePct:Object(c.round)(d,4)}}));return h.includes(t)?Object(o.jsx)(O,a()({direction:n,hideFixedPanel:t===u.b.Single},g)):Object(o.jsx)(f,a()({direction:n,container:i,fixedPanelSize:l,minFixedPanelSize:d,minFlexPanelSize:b,panelSizes:F,resizeButtonClassName:z,"data-test-subj":m,onFixedPanelSizeChange:S,setPanelSizes:p},g))}}}]);