/*! 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.securitySolution_bundle_jsonpfunction=window.securitySolution_bundle_jsonpfunction||[]).push([[47],{1650:function(e,t,n){"use strict";n.r(t),n.d(t,"PinnedTabContentComponent",(function(){return B})),n.d(t,"default",(function(){return R}));var i=n(40),o=n(42),a=n(2),l=n.n(a),d=n(41),s=n.n(d),r=n(103),u=n(130),m=n.n(u),c=n(111),p=n(660),h=n(190),g=n(1493),b=n(1505),y=n(312),E=n(1429),P=n(110),f=n(133),w=n(116),C=n(178),v=n(148),I=n(118),F=n(690),O=n(722),j=n(1117),x=n(17),S=n(652);const N=s()(i.EuiFlyoutBody).withConfig({displayName:"StyledEuiFlyoutBody",componentId:"sc-hth66x-0"})(["overflow-y:hidden;flex:1;.euiFlyoutBody__overflow{overflow:hidden;mask-image:none;}.euiFlyoutBody__overflowContent{padding:0;height:100%;display:flex;}"]),_=s()(i.EuiFlyoutFooter).withConfig({displayName:"StyledEuiFlyoutFooter",componentId:"sc-hth66x-1"})(["background:none;padding:0;&.euiFlyoutFooter{","}"],(({theme:e})=>`padding: ${e.eui.euiSizeS} 0 0 0;`)),D=s.a.div.withConfig({displayName:"ExitFullScreenContainer",componentId:"sc-hth66x-2"})(["width:180px;"]),T=s()(i.EuiFlexGroup).withConfig({displayName:"FullWidthFlexGroup",componentId:"sc-hth66x-3"})(["margin:0;width:100%;overflow:hidden;"]),M=s()(i.EuiFlexItem).withConfig({displayName:"ScrollableFlexItem",componentId:"sc-hth66x-4"})(["overflow:hidden;"]),V=s.a.div.withConfig({displayName:"VerticalRule",componentId:"sc-hth66x-5"})(["width:2px;height:100%;background:",";"],(({theme:e})=>e.eui.euiColorLightShade));V.displayName="VerticalRule";const k=[],B=({columns:e,timelineId:t,itemsPerPage:n,itemsPerPageOptions:i,pinnedEventIds:d,onEventClosed:s,renderCellValue:r,rowRenderers:u,showExpandedDetails:m,sort:c})=>{const{browserFields:f,dataViewId:B,loading:R,runtimeMappings:$,selectedPatterns:L}=Object(w.d)(P.SourcererScopeName.timeline),{setTimelineFullScreen:A,timelineFullScreen:G}=Object(C.c)(),z=Object(x.b)().isEnterprise()?6:5,J=Object(a.useMemo)((()=>{if(Object(o.isEmpty)(d))return"";const e=Object.entries(d).reduce(((e,[t,n])=>n?{...e,bool:{...e.bool,should:[...e.bool.should,{match_phrase:{_id:t}}]}}:e),{bool:{should:[],minimum_should_match:1}});try{return JSON.stringify(e)}catch{return""}}),[d]),K=Object(a.useMemo)((()=>[...(Object(o.isEmpty)(e)?h.b:e).map((e=>e.id)),...y.h]),[e]),Q=Object(a.useMemo)((()=>c.map((({columnId:e,columnType:t,esTypes:n,sortDirection:i})=>({field:e,type:t,direction:i,esTypes:null!=n?n:[]})))),[c]),[W,{events:q,totalCount:H,pageInfo:U,loadPage:X,updatedAt:Y,refetch:Z}]=Object(p.a)({endDate:"",id:`pinned-${t}`,indexNames:L,dataViewId:B,fields:K,limit:n,filterQuery:J,runtimeMappings:$,skip:""===J,startDate:"",sort:Q,timerangeKind:void 0}),ee=Object(a.useCallback)((()=>{s({tabType:I.d.pinned,id:t})}),[t,s]),te=Object(a.useMemo)((()=>Object(j.a)(z).map((e=>({...e,headerCellRender:S.a})))),[z]);return l.a.createElement(l.a.Fragment,null,l.a.createElement(T,{"data-test-subj":`${I.d.pinned}-tab`},l.a.createElement(M,{grow:2},G&&null!=A&&l.a.createElement(D,null,l.a.createElement(O.b,{fullScreen:G,setFullScreen:A})),l.a.createElement(E.a,null,l.a.createElement(N,{"data-test-subj":`${I.d.pinned}-tab-flyout-body`,className:"timeline-flyout-body"},l.a.createElement(g.a,{activePage:U.activePage,browserFields:f,data:q,id:t,refetch:Z,renderCellValue:r,rowRenderers:u,sort:c,tabType:I.d.pinned,totalPages:Object(v.h)({itemsCount:H,itemsPerPage:n}),leadingControlColumns:te,trailingControlColumns:k})),l.a.createElement(_,{"data-test-subj":`${I.d.pinned}-tab-flyout-footer`,className:"timeline-flyout-footer"},l.a.createElement(b.a,{activePage:U.activePage,"data-test-subj":"timeline-footer",updatedAt:Y,height:b.b,id:t,isLive:!1,isLoading:W||R,itemsCount:q.length,itemsPerPage:n,itemsPerPageOptions:i,onChangePage:X,totalCount:H})))),m&&l.a.createElement(l.a.Fragment,null,l.a.createElement(V,null),l.a.createElement(M,{grow:1},l.a.createElement(F.a,{browserFields:f,handleOnPanelClosed:ee,runtimeMappings:$,tabType:I.d.pinned,scopeId:t})))))},R=Object(r.connect)((()=>{const e=c.b.getTimelineByIdSelector();return(t,{timelineId:n})=>{var i,o;const a=null!==(i=e(t,n))&&void 0!==i?i:f.b,{columns:l,expandedDetail:d,itemsPerPage:s,itemsPerPageOptions:r,pinnedEventIds:u,sort:m}=a;return{columns:l,timelineId:n,itemsPerPage:s,itemsPerPageOptions:r,pinnedEventIds:u,showExpandedDetails:!!d[I.d.pinned]&&!(null===(o=d[I.d.pinned])||void 0===o||!o.panelView),sort:m}}}),((e,{timelineId:t})=>({onEventClosed:t=>{e(c.a.toggleDetailPanel(t))}})))(l.a.memo(B,((e,t)=>e.itemsPerPage===t.itemsPerPage&&e.onEventClosed===t.onEventClosed&&e.showExpandedDetails===t.showExpandedDetails&&e.timelineId===t.timelineId&&m()(e.columns,t.columns)&&m()(e.itemsPerPageOptions,t.itemsPerPageOptions)&&m()(e.pinnedEventIds,t.pinnedEventIds)&&m()(e.sort,t.sort))))}}]);