/*! 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([[14],{1053:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"e",(function(){return c})),n.d(t,"f",(function(){return l})),n.d(t,"d",(function(){return d})),n.d(t,"c",(function(){return p})),n.d(t,"b",(function(){return u}));var a=n(45),r=n(139),i=n(173);const o=e=>e.artifacts.location,s=e=>{var t;return null===(t=e.location)||void 0===t?void 0:t.pathname},c=Object(r.createSelector)(s,(e=>null!==Object(a.matchPath)(null!=e?e:"",{path:i.n,exact:!0}))),l=Object(r.createSelector)(s,(e=>null!==Object(a.matchPath)(null!=e?e:"",{path:i.q,exact:!0}))),d=Object(r.createSelector)(s,(e=>null!==Object(a.matchPath)(null!=e?e:"",{path:i.m,exact:!0}))),p=Object(r.createSelector)(s,(e=>null!==Object(a.matchPath)(null!=e?e:"",{path:i.o,exact:!0}))),u=Object(r.createSelector)(s,(e=>null!==Object(a.matchPath)(null!=e?e:"",{path:i.l,exact:!0})))},1054:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(2),r=n(45);const i=(e,t)=>{const n=Object(r.useHistory)();return Object(a.useCallback)((a=>{try{t&&t(a)}catch(e){throw a.preventDefault(),e}a.defaultPrevented||0===a.button&&(a.currentTarget instanceof HTMLAnchorElement&&""!==a.currentTarget.target&&"_self"!==a.currentTarget.target||a.metaKey||a.altKey||a.ctrlKey||a.shiftKey||(a.preventDefault(),Array.isArray(e)?n.push(...e):n.push(e)))}),[n,t,e])}},1064:function(e,t,n){"use strict";n.d(t,"i",(function(){return a})),n.d(t,"h",(function(){return r})),n.d(t,"g",(function(){return i})),n.d(t,"f",(function(){return o})),n.d(t,"e",(function(){return s})),n.d(t,"d",(function(){return c})),n.d(t,"c",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return p}));const a=e=>"UninitialisedResourceState"===e.type,r=e=>"LoadingResourceState"===e.type,i=e=>"LoadedResourceState"===e.type,o=e=>"FailedResourceState"===e.type,s=()=>({type:"UninitialisedResourceState"}),c=e=>({type:"LoadingResourceState",previousState:e}),l=e=>({type:"LoadedResourceState",data:e}),d=(e,t)=>({type:"FailedResourceState",error:e,lastLoadedState:t}),p=e=>{switch(e.type){case"LoadedResourceState":case"FailedResourceState":return e;case"UninitialisedResourceState":case"LoadingResourceState":return s()}}},1133:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(8);const r=e=>{const{id:t,revision:n,created_by:r,created_at:i,updated_by:o,updated_at:s,...c}=e,l=Object(a.cloneDeep)(c),d=l.inputs[0].config.policy.value;return[d.windows.popup.malware,d.mac.popup.malware].forEach((e=>e.message.trim())),l}},1427:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return s}));var a=n(2),r=n.n(a),i=n(46);class SecuritySolutionQueryClient extends i.QueryClient{constructor(e={}){var t,n,a;super({...e,defaultOptions:{...null!==(t=e.defaultOptions)&&void 0!==t?t:{},queries:{refetchIntervalInBackground:!1,refetchOnWindowFocus:!1,refetchOnMount:!0,keepPreviousData:!0,...null!==(n=null==e||null===(a=e.defaultOptions)||void 0===a?void 0:a.queries)&&void 0!==n?n:{}}}})}}const o=new SecuritySolutionQueryClient,s=Object(a.memo)((({queryClient:e,children:t})=>{const n=Object(a.useMemo)((()=>e||o),[e]);return r.a.createElement(i.QueryClientProvider,{client:n},t)}));s.displayName="ReactQueryClientProvider"},1432:function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return g})),n.d(t,"a",(function(){return p}));var a=n(936),r=n(960),i=n(504),o=n(1133);const s=e=>{const t={coreStart:e};return e=>n=>async s=>{n(s),(async({coreStart:e},{dispatch:t,getState:n},s)=>{const c=e.http,l=n();if("userChangedUrl"===s.type&&Object(r.f)(l)&&Object(r.d)(l)){const e=Object(r.i)(l);let n;try{n=(await Object(i.e)(c,e)).item,""===n.inputs[0].config.policy.value.windows.popup.malware.message&&(n.inputs[0].config.policy.value.windows.popup.malware.message=a.a,n.inputs[0].config.policy.value.mac.popup.malware.message=a.a,n.inputs[0].config.policy.value.linux.popup.malware.message=a.a),""===n.inputs[0].config.policy.value.windows.popup.ransomware.message&&(n.inputs[0].config.policy.value.windows.popup.ransomware.message=a.a),""===n.inputs[0].config.policy.value.windows.popup.memory_protection.message&&(n.inputs[0].config.policy.value.windows.popup.memory_protection.message=a.b),""===n.inputs[0].config.policy.value.mac.popup.memory_protection.message&&(n.inputs[0].config.policy.value.mac.popup.memory_protection.message=a.b),""===n.inputs[0].config.policy.value.linux.popup.memory_protection.message&&(n.inputs[0].config.policy.value.linux.popup.memory_protection.message=a.b),""===n.inputs[0].config.policy.value.windows.popup.behavior_protection.message&&(n.inputs[0].config.policy.value.windows.popup.behavior_protection.message=a.b),""===n.inputs[0].config.policy.value.mac.popup.behavior_protection.message&&(n.inputs[0].config.policy.value.mac.popup.behavior_protection.message=a.b),""===n.inputs[0].config.policy.value.linux.popup.behavior_protection.message&&(n.inputs[0].config.policy.value.linux.popup.behavior_protection.message=a.b)}catch(e){return void t({type:"serverFailedToReturnPolicyDetailsData",payload:e.body||e})}if(t({type:"serverReturnedPolicyDetailsData",payload:{policyItem:n}}),n.policy_id){const{results:e}=await Object(i.d)(c,n.policy_id);t({type:"serverReturnedPolicyDetailsAgentSummaryData",payload:{agentStatusSummary:e}})}}else if("userClickedPolicyDetailsSaveButton"===s.type){const{id:e}=Object(r.g)(l),n=Object(r.h)(l);let a;try{a=await Object(i.f)(c,e,n).catch((t=>t.response&&409===t.response.status?Object(i.e)(c,e).then((t=>{const a=t.item;return a.inputs[0].config.policy=n.inputs[0].config.policy,Object(i.f)(c,e,Object(o.a)(a))})):Promise.reject(t)))}catch(e){return void t({type:"serverReturnedPolicyDetailsUpdateFailure",payload:{success:!1,error:e.body||e}})}t({type:"serverReturnedUpdatedPolicyDetailsData",payload:{policyItem:a.item,updateStatus:{success:!0}}})}})(t,e,s)}};var c=n(933),l=n(245),d=n(173);const p=()=>({policyItem:void 0,isLoading:!1,agentStatusSummary:{error:0,events:0,offline:0,online:0,total:0,other:0,all:0,active:0},artifacts:{location:{page:d.b,pageSize:d.c,show:void 0,filter:""}}}),u=(e,t)=>({...e,inputs:e.inputs.map((e=>({...e,config:e.config&&{...e.config,policy:{...e.config.policy,value:t}}})))}),f=(e=p(),t)=>{if("serverReturnedPolicyDetailsData"===t.type||"serverReturnedUpdatedPolicyDetailsData"===t.type)return{...e,...t.payload,isLoading:!1};if("serverFailedToReturnPolicyDetailsData"===t.type)return{...e,isLoading:!1,apiError:t.payload};if("serverReturnedPolicyDetailsAgentSummaryData"===t.type)return{...e,...t.payload};if("serverReturnedPolicyDetailsUpdateFailure"===t.type)return{...e,isLoading:!1,updateStatus:t.payload};if("userClickedPolicyDetailsSaveButton"===t.type)return{...e,isLoading:!0,updateApiError:void 0};if("licenseChanged"===t.type)return{...e,license:t.payload};if("userChangedUrl"===t.type){const n={...e,location:t.payload,artifacts:{...e.artifacts,location:Object(l.b)(Object(c.parse)(t.payload.search.slice(1)))}},a=Object(r.d)(n),i=Object(r.d)(e),o=Object(r.e)(n);return a?i?n:{...n,isLoading:!0}:{...p(),location:t.payload,license:o}}if("userChangedPolicyConfig"===t.type){if(!e.policyItem)return e;const n={...e,policyItem:{...e.policyItem}},a={...Object(r.c)(e)};return n.policyItem.inputs[0].config.policy.value=a,Object.entries(t.payload.policyConfig).forEach((([e,t])=>{a[e]={...a[e],...t}})),n}if("userChangedAntivirusRegistration"===t.type){if(e.policyItem){const n=Object(r.c)(e);return{...e,policyItem:u(e.policyItem,{...n,windows:{...n.windows,antivirus_registration:{enabled:t.payload.enabled}}})}}return e}if("userChangedCredentialHardening"===t.type){if(e.policyItem){const n=Object(r.c)(e);return{...e,policyItem:u(e.policyItem,{...n,windows:{...n.windows,attack_surface_reduction:{credential_hardening:{enabled:t.payload.enabled}}}})}}return e}return e},g=(e=p(),t)=>[f].reduce(((e,n)=>n(e,t)),e)},1442:function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return p}));var a=n(2),r=n.n(a),i=n(40),o=n(1447),s=n(1054),c=n(102);let l;!function(e){e.overview="details",e.activityLog="activity_log"}(l||(l={}));const d=Object(a.memo)((({tab:e,isSelected:t})=>{const{getAppUrl:n}=Object(c.c)(),a=Object(s.a)(e.route);return r.a.createElement(i.EuiTab,{href:n({path:e.route}),onClick:a,isSelected:t,key:e.id,"data-test-subj":`endpoint-details-flyout-tab-${e.id}`},e.name)}));d.displayName="EndpointDetailsTab";const p=Object(a.memo)((({hostname:e,isHostInfoLoading:t,show:n,tabs:s})=>{const c=Object(a.useMemo)((()=>s.find((e=>e.id===n))),[s,n]),l=s.map((e=>r.a.createElement(d,{key:e.id,tab:e,isSelected:e.id===(null==c?void 0:c.id)})));return r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{hostname:e,isHostInfoLoading:t,hasBorder:!0},r.a.createElement(i.EuiTabs,{bottomBorder:!1,style:{marginBottom:"-25px"}},l)),r.a.createElement(i.EuiFlyoutBody,{"data-test-subj":`endpoint${"details"===(null==c?void 0:c.id)?"Details":"ActivityLog"}FlyoutBody`},null==c?void 0:c.content))}));p.displayName="EndpointDetailsFlyoutTabs"},1447:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var a=n(2),r=n.n(a),i=n(40),o=n(5),s=n(245),c=n(1054),l=n(884),d=n(527),p=n(323);const u=Object(a.memo)((({endpointId:e})=>{var t;const{getAppUrl:n}=Object(p.a)(),{show:u,...f}=Object(l.b)(d.uiQueryParams),g=Object(a.useMemo)((()=>Object(s.d)({name:"endpointDetails",...f,selected_endpoint:e})),[f,e]),y=Object(c.a)(g),m=Object(a.useMemo)((()=>({title:o.i18n.translate("xpack.securitySolution.endpoint.policyResponse.backLinkTitle",{defaultMessage:"Endpoint details"}),href:n({path:g}),onClick:y})),[y,n,g]);return r.a.createElement("div",null,r.a.createElement(i.EuiButtonEmpty,{flush:"both","data-test-subj":"flyoutSubHeaderBackButton",iconType:"arrowLeft",size:"xs",href:null!==(t=null==m?void 0:m.href)&&void 0!==t?t:"",onClick:null==m?void 0:m.onClick},null==m?void 0:m.title))}));u.displayName="BackToEndpointDetailsFlyoutSubHeader";const f=Object(a.memo)((({children:e,endpointId:t,hasBorder:n=!1,hostname:a,isHostInfoLoading:o})=>r.a.createElement(i.EuiFlyoutHeader,{hasBorder:n},t&&r.a.createElement(u,{endpointId:t}),o?r.a.createElement(i.EuiSkeletonText,{lines:1}):r.a.createElement(i.EuiToolTip,{content:a,anchorClassName:"eui-textTruncate"},r.a.createElement(i.EuiTitle,{size:"s"},r.a.createElement("h2",{style:{overflow:"hidden",textOverflow:"ellipsis"},"data-test-subj":"endpointDetailsFlyoutTitle"},a))),e)));f.displayName="EndpointDetailsFlyoutHeader"},1479:function(e,t,n){"use strict";function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,i){t=t||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(t);var c=1e3;i&&"number"==typeof i.maxKeys&&(c=i.maxKeys);var l=e.length;c>0&&l>c&&(l=c);for(var d=0;d=0?(p=y.substr(0,m),u=y.substr(m+1)):(p=y,u=""),f=decodeURIComponent(p),g=decodeURIComponent(u),a(o,f)?r(o[f])?o[f].push(g):o[f]=[o[f],g]:o[f]=g}return o};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},1480:function(e,t,n){"use strict";var a=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?i(o(e),(function(o){var s=encodeURIComponent(a(o))+n;return r(e[o])?i(e[o],(function(e){return s+encodeURIComponent(a(e))})).join(t):s+encodeURIComponent(a(e[o]))})).join(t):s?encodeURIComponent(a(s))+n+encodeURIComponent(a(e)):""};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function i(e,t){if(e.map)return e.map(t);for(var n=[],a=0;a{const t=Object(i.useDispatch)();return Object(a.useEffect)((()=>{var e;const n=null===(e=o.a.getLicenseInformation$())||void 0===e?void 0:e.subscribe((e=>{t({type:"licenseChanged",payload:e})}));return()=>null==n?void 0:n.unsubscribe()}),[t]),r.a.createElement(r.a.Fragment,null,e)}));s.displayName="CurrentLicense"},1498:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var a=n(666),r=n(1432),i=n(173),o=n(527),s=n(215),c=n(1064);const l=()=>({hosts:[],pageSize:10,pageIndex:0,total:0,sortDirection:s.h,sortField:s.i,loading:!1,error:void 0,location:void 0,policyItems:[],selectedPolicyId:void 0,policyItemsLoading:!1,endpointPackageInfo:Object(c.e)(),nonExistingPolicies:{},agentPolicies:{},endpointsExist:!0,patterns:[],patternsError:void 0,isAutoRefreshEnabled:!0,autoRefreshInterval:i.a,agentsWithEndpointsTotal:0,agentsWithEndpointsTotalError:void 0,endpointsTotal:0,endpointsTotalError:void 0,isolationRequestState:Object(c.e)(),endpointPendingActions:Object(c.c)(new Map),metadataTransformStats:Object(c.e)()}),d=a.combineReducers,p=(i.v,Object(r.a)(),i.t,l(),d({[i.v]:r.c,[i.t]:(e=l(),t)=>{if("serverReturnedEndpointList"===t.type){const{data:n,total:a,page:r,pageSize:i,sortDirection:o,sortField:s}=t.payload;return{...e,hosts:n,total:a,pageIndex:r,pageSize:i,sortField:s,sortDirection:o,loading:!1,error:void 0}}if("serverFailedToReturnEndpointList"===t.type)return{...e,error:t.payload,loading:!1};if("serverReturnedEndpointNonExistingPolicies"===t.type)return{...e,nonExistingPolicies:{...e.nonExistingPolicies,...t.payload}};if("serverReturnedEndpointAgentPolicies"===t.type)return{...e,agentPolicies:{...e.agentPolicies,...t.payload}};if("serverReturnedMetadataPatterns"===t.type)return{...e,patterns:t.payload,patternsError:void 0};if("serverFailedToReturnMetadataPatterns"===t.type)return{...e,patternsError:t.payload};if("endpointPendingActionsStateChanged"===t.type)return((e,t)=>Object(o.isOnEndpointPage)(e)?{...e,endpointPendingActions:t.payload}:e)(e,t);if("serverReturnedPoliciesForOnboarding"===t.type)return{...e,policyItems:t.payload.policyItems,policyItemsLoading:!1};if("serverFailedToReturnPoliciesForOnboarding"===t.type)return{...e,error:t.payload,policyItemsLoading:!1};if("userSelectedEndpointPolicy"===t.type)return{...e,selectedPolicyId:t.payload.selectedPolicyId};if("serverCancelledEndpointListLoading"===t.type)return{...e,loading:!1};if("serverCancelledPolicyItemsLoading"===t.type)return{...e,policyItemsLoading:!1};if("endpointPackageInfoStateChanged"===t.type)return((e,t)=>({...e,endpointPackageInfo:t.payload}))(e,t);if("serverReturnedEndpointExistValue"===t.type)return{...e,endpointsExist:t.payload};if("serverReturnedAgenstWithEndpointsTotal"===t.type)return{...e,agentsWithEndpointsTotal:t.payload,agentsWithEndpointsTotalError:void 0};if("serverFailedToReturnAgenstWithEndpointsTotal"===t.type)return{...e,agentsWithEndpointsTotalError:t.payload};if("serverReturnedEndpointsTotal"===t.type)return{...e,endpointsTotal:t.payload,endpointsTotalError:void 0};if("serverFailedToReturnEndpointsTotal"===t.type)return{...e,endpointsTotalError:t.payload};var n,a;if("userUpdatedEndpointListRefreshOptions"===t.type)return{...e,isAutoRefreshEnabled:null!==(n=t.payload.isAutoRefreshEnabled)&&void 0!==n?n:e.isAutoRefreshEnabled,autoRefreshInterval:null!==(a=t.payload.autoRefreshInterval)&&void 0!==a?a:e.autoRefreshInterval};if("endpointIsolationRequestStateChange"===t.type)return((e,t)=>({...e,isolationRequestState:t.payload}))(e,t);if("userChangedUrl"===t.type){const n={...e,location:t.payload},a=Object(o.isOnEndpointPage)(n)&&!Object(o.hasSelectedEndpoint)(n),r=Object(o.isOnEndpointPage)(e)&&!Object(o.hasSelectedEndpoint)(e),i=Object(o.isOnEndpointPage)(n)&&Object(o.hasSelectedEndpoint)(n),s=Object(o.isOnEndpointPage)(e)&&Object(o.hasSelectedEndpoint)(e),l={location:t.payload,error:void 0};if("isolate"===Object(o.uiQueryParams)(n).show||Object(c.i)(Object(o.getCurrentIsolationRequestState)(n))||(l.isolationRequestState=Object(c.e)()),a){if(!r)return{...e,...l,loading:!0,policyItemsLoading:!0}}else if(i)return s||r?{...e,...l,detailsLoading:!0}:{...e,...l,loading:!0,policyItemsLoading:!0};return{...e,...l,endpointsExist:!0}}return"metadataTransformStatsChanged"===t.type?((e,t)=>({...e,metadataTransformStats:t.payload}))(e,t):e}}))},1502:function(e,t,n){"use strict";n.d(t,"a",(function(){return S}));var a=n(122),r=n(173),i=n(1432),o=n(3),s=n(489),c=n.n(s),l=n(215),d=n(759),p=n(1384),u=n(934),f=n(1064),g=n(504),y=n(527);const m=console.error,h=(e,t)=>{async function n(e){var n;const a=null!==(n=Object(y.endpointPackageVersion)(e))&&void 0!==n?n:"",r=a.includes("-")?a.substring(0,a.indexOf("-")):a,i=c()(r,"1.2.0")?l.u:l.A,s=t.data.search.search({indices:[i],onlyCheckIfIndicesExist:!1},{strategy:l.k});return[{title:i,fields:(await Object(o.firstValueFrom)(s)).indexFields}]}return t=>a=>async r=>{a(r);const{getState:i,dispatch:o}=t;return await async function(e,t,n){if(Object(y.getIsEndpointPackageInfoUninitialized)(e)){t({type:"endpointPackageInfoStateChanged",payload:Object(f.d)(Object(f.a)(Object(y.endpointPackageInfo)(e)))});try{const e=await Object(g.c)(n.http);t({type:"endpointPackageInfoStateChanged",payload:Object(f.c)(e)})}catch(e){m(e),t({type:"endpointPackageInfoStateChanged",payload:Object(f.b)(e)})}}}(i(),o,e),"userChangedUrl"!==r.type&&"appRequestedEndpointList"!==r.type||!Object(y.isOnEndpointPage)(i())||await async function({store:e,coreStart:t,fetchIndexPatterns:n}){const{getState:a,dispatch:r}=e,{page_index:i,page_size:o,sort_field:s,sort_direction:c}=Object(y.uiQueryParams)(a());let d;try{const n=Object(y.searchBarQuery)(a());d=await t.http.get(l.q,{version:"2023-10-31",query:{page:i,pageSize:o,kuery:n.query,sortField:s,sortDirection:c}}),r({type:"serverReturnedEndpointList",payload:d}),O(e),async function({store:e,hosts:t,http:n}){const{getState:a,dispatch:r}=e;try{const e=await E(n,t,Object(y.nonExistingPolicies)(a()));void 0!==(null==e?void 0:e.packagePolicy)&&r({type:"serverReturnedEndpointNonExistingPolicies",payload:e.packagePolicy}),void 0!==(null==e?void 0:e.agentPolicy)&&r({type:"serverReturnedEndpointAgentPolicies",payload:e.agentPolicy})}catch(e){m(e)}}({http:t.http,hosts:d.data,store:e})}catch(e){r({type:"serverFailedToReturnEndpointList",payload:e})}if(0===Object(y.patterns)(a()).length)try{const e=await n(a());void 0!==e&&r({type:"serverReturnedMetadataPatterns",payload:e})}catch(e){r({type:"serverFailedToReturnMetadataPatterns",payload:e})}if(d&&0===d.data.length){const e=t.http;if(await b(e))return;r({type:"serverReturnedEndpointExistValue",payload:!1});try{r({type:"serverReturnedPoliciesForOnboarding",payload:{policyItems:(await Object(u.a)(e,{query:{perPage:50,page:1}})).items}})}catch(e){var p;r({type:"serverFailedToReturnPoliciesForOnboarding",payload:null!==(p=e.body)&&void 0!==p?p:e})}}else r({type:"serverCancelledPolicyItemsLoading"}),r({type:"serverReturnedEndpointExistValue",payload:!0})}({coreStart:e,store:t,fetchIndexPatterns:n}),"endpointIsolationRequest"===r.type?v(t,r):"loadMetadataTransformStats"===r.type?async function(e,t){const{getState:n,dispatch:a}=t;if(!e||!n||!a)return;const r=n();if(!Object(y.isMetadataTransformStatsLoading)(r)){a({type:"metadataTransformStatsChanged",payload:Object(f.d)(Object(f.a)(Object(y.getMetadataTransformStats)(r)))});try{const t=await e.get(l.t,{version:"2023-10-31"});a({type:"metadataTransformStatsChanged",payload:Object(f.c)(t.transforms)})}catch(e){a({type:"metadataTransformStatsChanged",payload:Object(f.b)(e)})}}}(e.http,t):void 0}},E=async(e,t,n)=>{if(0===t.length)return;const a=[...new Set(t.reduce(((e,t)=>{const a=t.metadata.Endpoint.policy.applied.id;return n[a]||e.push(a),e}),[]))];if(0===a.length)return;const r=(await Object(g.b)(e,a)).items.reduce(((e,t)=>(e.packagePolicy[t.id]=!0,e.agentPolicy[t.id]=t.policy_id,e)),{packagePolicy:{},agentPolicy:{}}),i=a.reduce(((e,t)=>r.packagePolicy[t]?(e.agentPolicy[t]=r.agentPolicy[t],e):(e.packagePolicy[t]=!0,e)),{packagePolicy:{},agentPolicy:{}});return 0!==Object.keys(i.packagePolicy).length||0!==Object.keys(i.agentPolicy).length?i:void 0},b=async e=>{try{return await(async e=>{try{return(await e.get(l.q,{version:"2023-10-31",query:{page:0,pageSize:1}})).total}catch(e){m("error while trying to check for total endpoints"),m(e)}return 0})(e)>0}catch(e){m("error while trying to check if endpoints exist"),m(e)}return!1},v=async({getState:e,dispatch:t},n)=>{const a=e();if(!Object(y.getIsIsolationRequestPending)(a)){t({type:"endpointIsolationRequestStateChange",payload:Object(f.d)(Object(f.a)(Object(y.getCurrentIsolationRequestState)(a)))});try{let e;e="unisolate"===n.payload.type?await Object(d.b)(n.payload.data):await Object(d.a)(n.payload.data),t({type:"endpointIsolationRequestStateChange",payload:Object(f.c)(e)})}catch(e){var r;t({type:"endpointIsolationRequestStateChange",payload:Object(f.b)(null!==(r=e.body)&&void 0!==r?r:e)})}}},O=async({getState:e,dispatch:t})=>{const n=e(),a=Object(y.listData)(n),r=new Set;for(const e of a)r.add(e.metadata.elastic.agent.id);if(0!==r.size)try{const{data:e}=await Object(p.a)(Array.from(r)),n=new Map;for(const t of e)n.set(t.agent_id,t.pending_actions);t({type:"endpointPendingActionsStateChanged",payload:Object(f.c)(n)})}catch(e){m(e)}},I=e=>t=>t[r.u][e],S=(e,t)=>[Object(a.f)(I(r.v),Object(i.b)(e,t)),Object(a.f)(I(r.t),h(e,t))]},157:function(e,t,n){const a=n(325),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=n(326),{safeRe:o,t:s}=n(310),c=n(451),{compareIdentifiers:l}=n(559);class SemVer{constructor(e,t){if(t=c(t),e instanceof SemVer){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>r)throw new TypeError(`version is longer than ${r} characters`);a("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?o[s.LOOSE]:o[s.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let a=[t,e];!1===n&&(a=[t]),0===l(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=SemVer},1671:function(e,t,n){"use strict";n.r(t),n.d(t,"withSecurityContext",(function(){return v}));var a=n(2),r=n.n(a),i=n(666),o=n(1498),s=n(179),c=n(29),l=n(1502);const d=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||i.compose;var p=n(103),u=n(24),f=n(535),g=n(1059),y=n(1427),m=n(1070),h=n(1486),E=n(102);const b=Object(a.memo)((({store:e,depsStart:t,queryClient:n,upsellingService:a,children:i})=>{const o=Object(E.j)().services,{application:{capabilities:s}}=o;return r.a.createElement(p.Provider,{store:e},r.a.createElement(y.a,{queryClient:n},r.a.createElement(m.a.Provider,{value:t},r.a.createElement(g.b,{kibanaCapabilities:s},r.a.createElement(u.b,{core:o},r.a.createElement(h.a,null,r.a.createElement(f.a,{upsellingService:a},i)))))))}));b.displayName="RenderContextProviders";const v=({coreStart:e,depsStart:t,services:{upsellingService:n},WrappedComponent:p})=>{let u;return Object(a.memo)((a=>(u||(u=(({coreStart:e,depsStart:t,reducersObject:n={management:o.a,app:s.b},preloadedState:a={management:void 0,app:{enableExperimental:c.a.get()}},additionalMiddleware:r=[]})=>Object(i.createStore)(Object(i.combineReducers)(n),a,d(Object(i.applyMiddleware)(...Object(l.a)(e,t),...r))))({coreStart:e,depsStart:t})),r.a.createElement(b,{store:u,depsStart:t,upsellingService:n},r.a.createElement(p,a)))))}},192:function(e,t,n){const a=n(157);e.exports=(e,t,n)=>new a(e,n).compare(new a(t,n))},245:function(e,t,n){"use strict";n.d(t,"e",(function(){return g})),n.d(t,"d",(function(){return y})),n.d(t,"h",(function(){return m})),n.d(t,"j",(function(){return h})),n.d(t,"n",(function(){return E})),n.d(t,"l",(function(){return b})),n.d(t,"a",(function(){return j})),n.d(t,"o",(function(){return w})),n.d(t,"b",(function(){return _})),n.d(t,"k",(function(){return L})),n.d(t,"f",(function(){return P})),n.d(t,"g",(function(){return N})),n.d(t,"m",(function(){return A})),n.d(t,"c",(function(){return $})),n.d(t,"i",(function(){return T}));var a=n(42),r=n(933),i=n.n(r),o=n(45),s=n(195),c=n(720),l=n(1035),d=n(173);const p=(e,t)=>void 0===e||e===t||0===e,u=(e,t={})=>`${e}${Object(s.a)(i.a.stringify(((e={})=>({...p(e.page,1)?{}:{page:e.page},...p(e.pageSize,d.c)?{}:{pageSize:e.pageSize},...p(e.show,void 0)?{}:{show:e.show},...p(e.itemId,void 0)?{}:{itemId:e.itemId},...p(e.filter,"")?"":{filter:e.filter},...p(e.includedPolicies,"")?"":{includedPolicies:e.includedPolicies}}))(t)))}`,f=e=>i.a.stringify(e),g=(e,t)=>{const{name:n,...r}=e,i=f(r),c=`${i&&!Object(a.isEmpty)(t)?"&":""}${null!=t?t:""}`;return"endpointList"===n?`${Object(o.generatePath)(d.h,{tabName:l.a.endpoints})}${Object(s.a)(`${i?`${i}${c}`:c}`)}`:`${Object(s.a)(`${i?`${i}${c}`:c}`)}`},y=(e,t)=>{const{name:n,show:r,...i}=e,c={...i};switch(e.name){case"endpointDetails":c.show="details";break;case"endpointIsolate":c.show="isolate";break;case"endpointUnIsolate":c.show="unisolate";break;case"endpointPolicyResponse":c.show="policy_response";break;case"endpointActivityLog":c.show="activity_log"}const p=f(c),u=`${p&&!Object(a.isEmpty)(t)?"&":""}${null!=t?t:""}`;return`${Object(o.generatePath)(d.h,{tabName:l.a.endpoints})}${Object(s.a)(`${p?`${p}${u}`:u}`)}`},m=e=>`${Object(o.generatePath)(d.k,{tabName:l.a.policies})}${Object(s.a)(e)}`,h=(e,t)=>`${Object(o.generatePath)(d.n,{tabName:l.a.policies,policyId:e})}${Object(s.a)(t)}`,E=(e,t)=>`${Object(o.generatePath)(d.q,{tabName:l.a.policies,policyId:e})}${Object(s.a)(t)}`,b=(e,t)=>`${Object(o.generatePath)(d.m,{tabName:l.a.policies,policyId:e})}${Object(s.a)(i.a.stringify(v(t)))}`,v=e=>e?{...p(e.page,d.b+1)?{}:{page:e.page},...p(e.pageSize,d.c)?{}:{pageSize:e.pageSize},...p(e.show,void 0)?{}:{show:e.show},...p(e.filter,"")?"":{filter:e.filter}}:{},O=(e,t)=>{const n=e[t];return Array.isArray(n)?n[n.length-1]:n},I=e=>{const t=Number(O(e,"page_index"));return!Number.isFinite(t)||t<0?d.b:t},S=e=>{const t=Number(O(e,"page_size"));return d.f.includes(t)?t:d.c},R=e=>O(e,"filter")||"",j=e=>({page_index:I(e),page_size:S(e),filter:R(e)}),w=e=>{const t=Object(o.generatePath)(d.s,{tabName:l.a.trustedApps});return u(t,e)},_=e=>{const t=O(e,"show"),n=Object(c.a)(e);return{page:n.page,pageSize:n.pageSize,filter:e.filter,show:t&&"list"===t?t:void 0}},L=(e,t)=>`${Object(o.generatePath)(d.q,{tabName:l.a.policies,policyId:e})}${Object(s.a)(i.a.stringify(v(t)))}`,P=e=>{const t=Object(o.generatePath)(d.i,{tabName:l.a.eventFilters});return u(t,e)},N=e=>{const t=Object(o.generatePath)(d.j,{tabName:l.a.hostIsolationExceptions});return u(t,e)},A=(e,t)=>`${Object(o.generatePath)(d.o,{tabName:l.a.policies,policyId:e})}${Object(s.a)(i.a.stringify(v(t)))}`,$=e=>{const t=Object(o.generatePath)(d.g,{tabName:l.a.blocklist});return u(t,e)},T=(e,t)=>`${Object(o.generatePath)(d.l,{tabName:l.a.policies,policyId:e})}${Object(s.a)(i.a.stringify(v(t)))}`},310:function(e,t,n){const{MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=n(326),o=n(325),s=(t=e.exports={}).re=[],c=t.safeRe=[],l=t.src=[],d=t.t={};let p=0;const u="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[u,r]],g=(e,t,n)=>{const a=(e=>{for(const[t,n]of f)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),r=p++;o(e,r,t),d[e]=r,l[r]=t,s[r]=new RegExp(t,n?"g":void 0),c[r]=new RegExp(a,n?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${u}*`),g("MAINVERSION",`(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${l[d.NUMERICIDENTIFIER]}|${l[d.NONNUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${l[d.NUMERICIDENTIFIERLOOSE]}|${l[d.NONNUMERICIDENTIFIER]})`),g("PRERELEASE",`(?:-(${l[d.PRERELEASEIDENTIFIER]}(?:\\.${l[d.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${l[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[d.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${u}+`),g("BUILD",`(?:\\+(${l[d.BUILDIDENTIFIER]}(?:\\.${l[d.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${l[d.MAINVERSION]}${l[d.PRERELEASE]}?${l[d.BUILD]}?`),g("FULL",`^${l[d.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${l[d.MAINVERSIONLOOSE]}${l[d.PRERELEASELOOSE]}?${l[d.BUILD]}?`),g("LOOSE",`^${l[d.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${l[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${l[d.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:${l[d.PRERELEASE]})?${l[d.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:${l[d.PRERELEASELOOSE]})?${l[d.BUILD]}?)?)?`),g("XRANGE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAINLOOSE]}$`),g("COERCE",`(^|[^\\d])(\\d{1,${a}})(?:\\.(\\d{1,${a}}))?(?:\\.(\\d{1,${a}}))?(?:$|[^\\d])`),g("COERCERTL",l[d.COERCE],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${l[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${l[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${l[d.LONECARET]}${l[d.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${l[d.LONECARET]}${l[d.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${l[d.GTLT]}\\s*(${l[d.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]}|${l[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${l[d.XRANGEPLAIN]})\\s+-\\s+(${l[d.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${l[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[d.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},325:function(e,t,n){(function(t){const n="object"==typeof t&&Object({IS_KIBANA_DISTRIBUTABLE:"true"})&&Object({IS_KIBANA_DISTRIBUTABLE:"true"}).NODE_DEBUG&&/\bsemver\b/i.test(Object({IS_KIBANA_DISTRIBUTABLE:"true"}).NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=n}).call(this,n(404))},326:function(e,t){const n=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},396:function(e,t,n){const a=n(192);e.exports=(e,t,n)=>a(e,t,n)<=0},451:function(e,t){const n=Object.freeze({loose:!0}),a=Object.freeze({});e.exports=e=>e?"object"!=typeof e?n:e:a},489:function(e,t,n){const a=n(192);e.exports=(e,t,n)=>a(e,t,n)>=0},504:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"e",(function(){return s})),n.d(t,"b",(function(){return c})),n.d(t,"f",(function(){return l})),n.d(t,"d",(function(){return d})),n.d(t,"c",(function(){return p}));var a=n(65);const r="/api/fleet",i=`${r}/package_policies`,o=`${r}/agent_status`,s=(e,t,n)=>e.get(`${i}/${t}`,n),c=(e,t,n)=>e.post(`${i}/_bulk_get`,{...n,body:JSON.stringify({ids:t,ignoreMissing:!0})}),l=(e,t,n,a={})=>e.put(`${i}/${t}`,{...a,body:JSON.stringify(n)}),d=(e,t,n={})=>e.get(o,{...n,query:{policyId:t}}),p=async e=>{const t=a.epmRouteService.getInfoPath("endpoint"),n=(await e.get(t)).item;if(!n)throw new Error("Endpoint package was not found.");return n}},527:function(e,t,n){"use strict";n.r(t),n.d(t,"listData",(function(){return u})),n.d(t,"pageIndex",(function(){return f})),n.d(t,"pageSize",(function(){return g})),n.d(t,"sortField",(function(){return y})),n.d(t,"sortDirection",(function(){return m})),n.d(t,"totalHits",(function(){return h})),n.d(t,"listLoading",(function(){return E})),n.d(t,"listError",(function(){return b})),n.d(t,"policyItems",(function(){return v})),n.d(t,"policyItemsLoading",(function(){return O})),n.d(t,"selectedPolicyId",(function(){return I})),n.d(t,"endpointPackageInfo",(function(){return S})),n.d(t,"getIsEndpointPackageInfoUninitialized",(function(){return R})),n.d(t,"isAutoRefreshEnabled",(function(){return j})),n.d(t,"autoRefreshInterval",(function(){return w})),n.d(t,"endpointPackageVersion",(function(){return _})),n.d(t,"patterns",(function(){return L})),n.d(t,"patternsError",(function(){return P})),n.d(t,"isOnEndpointPage",(function(){return N})),n.d(t,"uiQueryParams",(function(){return A})),n.d(t,"hasSelectedEndpoint",(function(){return $})),n.d(t,"showView",(function(){return T})),n.d(t,"nonExistingPolicies",(function(){return D})),n.d(t,"agentPolicies",(function(){return k})),n.d(t,"endpointsExist",(function(){return C})),n.d(t,"searchBarQuery",(function(){return F})),n.d(t,"getCurrentIsolationRequestState",(function(){return x})),n.d(t,"getIsIsolationRequestPending",(function(){return M})),n.d(t,"getWasIsolationRequestSuccessful",(function(){return U})),n.d(t,"getIsolationRequestError",(function(){return G})),n.d(t,"getIsOnEndpointDetailsActivityLog",(function(){return q})),n.d(t,"getEndpointPendingActionsState",(function(){return B})),n.d(t,"getMetadataTransformStats",(function(){return V})),n.d(t,"metadataTransformStats",(function(){return X})),n.d(t,"isMetadataTransformStatsLoading",(function(){return H})),n.d(t,"getEndpointPendingActionsCallback",(function(){return z}));var a=n(933),r=n.n(a),i=n(139),o=n(45),s=n(56),c=n(245),l=n(173),d=n(1064),p=n(1442);const u=e=>e.hosts,f=e=>e.pageIndex,g=e=>e.pageSize,y=e=>e.sortField,m=e=>e.sortDirection,h=e=>e.total,E=e=>e.loading,b=e=>e.error,v=e=>e.policyItems,O=e=>e.policyItemsLoading,I=e=>e.selectedPolicyId,S=e=>e.endpointPackageInfo,R=Object(i.createSelector)(S,(e=>Object(d.i)(e))),j=e=>e.isAutoRefreshEnabled,w=e=>e.autoRefreshInterval,_=Object(i.createSelector)(S,(e=>Object(d.g)(e)?e.data.version:void 0)),L=e=>e.patterns,P=e=>e.patternsError,N=e=>{var t,n;return null!==Object(o.matchPath)(null!==(t=null===(n=e.location)||void 0===n?void 0:n.pathname)&&void 0!==t?t:"",{path:l.h,exact:!0})},A=Object(i.createSelector)((e=>e.location),(e=>{const t={page_index:String(l.b),page_size:String(l.c)};if(e){const n=r.a.parse(e.search.slice(1)),a=Object(c.a)(n),i=["selected_endpoint","show","admin_query","sort_field","sort_direction"],o=["policy_response","details","isolate","unisolate","activity_log"];for(const e of i){const a="string"==typeof n[e]?n[e]:Array.isArray(n[e])?n[e][n[e].length-1]:void 0;void 0!==a&&("show"===e?o.includes(a)&&(t[e]=a):"sort_direction"===e?["asc","desc"].includes(a)&&(t[e]=a):t[e]=a)}t.page_size=String(a.page_size),t.page_index=String(a.page_index)}return t})),$=Object(i.createSelector)(A,(({selected_endpoint:e})=>void 0!==e)),T=Object(i.createSelector)(A,(e=>{var t;return null!==(t=e.show)&&void 0!==t?t:"details"})),D=e=>e.nonExistingPolicies,k=e=>e.agentPolicies,C=e=>e.endpointsExist,F=Object(i.createSelector)(A,(({admin_query:e})=>{const t={query:"",language:"kuery"};if(e){const n=Object(s.decode)(e);n&&"string"==typeof n.query&&(t.query=n.query),!n||"string"!=typeof n.language||"kuery"!==n.language&&"lucene"!==n.language||(t.language=n.language)}return t})),x=e=>e.isolationRequestState,M=Object(i.createSelector)(x,(e=>Object(d.h)(e))),U=Object(i.createSelector)(x,(e=>Object(d.g)(e))),G=Object(i.createSelector)(x,(e=>{if(Object(d.f)(e))return e.error})),q=Object(i.createSelector)(A,(e=>e.show===p.b.activityLog)),B=e=>e.endpointPendingActions,V=e=>e.metadataTransformStats,X=e=>Object(d.g)(e.metadataTransformStats)?e.metadataTransformStats.data:[],H=e=>Object(d.h)(e.metadataTransformStats),z=Object(i.createSelector)(B,(e=>t=>{let n={};var a;return Object(d.g)(e)&&(n=null!==(a=e.data.get(t))&&void 0!==a?a:{}),n}))},535:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return s}));var a=n(2),r=n.n(a);const i=r.a.createContext(null),o=Object(a.memo)((({upsellingService:e,children:t})=>r.a.createElement(i.Provider,{value:e},t)));o.displayName="UpsellingProvider";const s=()=>{const e=Object(a.useContext)(i);if(!e)throw new Error("UpsellingProviderContext not found");return e}},559:function(e,t){const n=/^[0-9]+$/,a=(e,t)=>{const a=n.test(e),r=n.test(t);return a&&r&&(e=+e,t=+t),e===t?0:a&&!r?-1:r&&!a?1:ea(t,e)}},884:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return E}));var a=n(103),r=n(173);function i(e){return Object(a.useSelector)((function(t){return e(t[r.u][r.t])}))}var o=n(2),s=n.n(o),c=n(44),l=n(81),d=n(126),p=n(693),u=n(4),f=n(245),g=n(527),y=n(323),m=n(228),h=n(932);const E=(e,t)=>{const{getAppUrl:n}=Object(y.a)(),a=i(g.agentPolicies),r=i(g.uiQueryParams),E=Object(p.d)(),{canAccessResponseConsole:b,canIsolateHost:v,canUnIsolateHost:O,canAccessEndpointActionsLogManagement:I,canAccessFleet:S}=Object(d.a)().endpointPrivileges;return Object(o.useMemo)((()=>{if(!e)return[];const i=Object(m.b)(e),o=e.agent.id,d=e.Endpoint.policy.applied.id,p=e.host.hostname,g=e.elastic.agent.id,y=Object(h.a)({osName:e.host.os.name,version:e.agent.version,capabilities:e.Endpoint.capabilities}),{show:R,selected_endpoint:j,...w}=r,_=Object(f.d)({name:"endpointActivityLog",...w,selected_endpoint:o}),L=Object(f.d)({name:"endpointIsolate",...w,selected_endpoint:o}),P=Object(f.d)({name:"endpointUnIsolate",...w,selected_endpoint:o}),N=[];return i&&O?N.push({"data-test-subj":"unIsolateLink",icon:"lockOpen",key:"unIsolateHost",navigateAppId:u.l,navigateOptions:{path:P},href:n({path:P}),children:s.a.createElement(c.FormattedMessage,{id:"xpack.securitySolution.endpoint.actions.unIsolateHost",defaultMessage:"Release host"})}):y&&v&&N.push({"data-test-subj":"isolateLink",icon:"lock",key:"isolateHost",navigateAppId:u.l,navigateOptions:{path:L},href:n({path:L}),children:s.a.createElement(c.FormattedMessage,{id:"xpack.securitySolution.endpoint.actions.isolateHost",defaultMessage:"Isolate host"})}),[...N,...b?[{"data-test-subj":"console",icon:"console",key:"consoleLink",onClick:t=>{t.preventDefault(),E(e)},children:s.a.createElement(c.FormattedMessage,{id:"xpack.securitySolution.endpoint.actions.console",defaultMessage:"Respond"})}]:[],...null!=t&&t.isEndpointList&&I?[{"data-test-subj":"actionsLink",icon:"logoSecurity",key:"actionsLogLink",navigateAppId:u.l,navigateOptions:{path:_},href:n({path:_}),children:s.a.createElement(c.FormattedMessage,{id:"xpack.securitySolution.endpoint.actions.responseActionsHistory",defaultMessage:"View response actions history"})}]:[],{"data-test-subj":"hostLink",icon:"logoSecurity",key:"hostDetailsLink",navigateAppId:u.l,navigateOptions:{path:`/hosts/${p}`},href:n({path:`/hosts/${p}`}),children:s.a.createElement(c.FormattedMessage,{id:"xpack.securitySolution.endpoint.actions.hostDetails",defaultMessage:"View host details"})},...S?[{icon:"gear",key:"agentConfigLink","data-test-subj":"agentPolicyLink",navigateAppId:"fleet",navigateOptions:{path:`${l.pagePathGetters.policy_details({policyId:a[d]})[1]}`},href:`${n({appId:"fleet"})}${l.pagePathGetters.policy_details({policyId:a[d]})[1]}`,disabled:void 0===a[d],children:s.a.createElement(c.FormattedMessage,{id:"xpack.securitySolution.endpoint.actions.agentPolicy",defaultMessage:"View agent policy"})},{icon:"gear",key:"agentDetailsLink","data-test-subj":"agentDetailsLink",navigateAppId:"fleet",navigateOptions:{path:`${l.pagePathGetters.agent_details({agentId:g})[1]}`},href:`${n({appId:"fleet"})}${l.pagePathGetters.agent_details({agentId:g})[1]}`,children:s.a.createElement(c.FormattedMessage,{id:"xpack.securitySolution.endpoint.actions.agentDetails",defaultMessage:"View agent details"})},{icon:"gear",key:"agentPolicyReassignLink","data-test-subj":"agentPolicyReassignLink",navigateAppId:"fleet",navigateOptions:{path:`${l.pagePathGetters.agent_details({agentId:g})[1]}?openReassignFlyout=true`,state:{onDoneNavigateTo:[u.l,{path:Object(f.e)({name:"endpointList"})}]}},href:`${n({appId:"fleet"})}${l.pagePathGetters.agent_details({agentId:g})[1]}?openReassignFlyout=true`,children:s.a.createElement(c.FormattedMessage,{id:"xpack.securitySolution.endpoint.actions.agentPolicyReassign",defaultMessage:"Reassign agent policy"})}]:[]]}),[r,b,I,e,a,n,E,null==t?void 0:t.isEndpointList,v,O,S])}},932:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(396),r=n.n(a);const i={macos:!0,windows:!0};function o(e){return e.includes("-")?e.substring(0,e.indexOf("-")):e}const s=({osName:e,version:t,capabilities:n})=>!(!t||!(({currentVersion:e,minVersionRequired:t="7.14.0"})=>{try{const n=o(e);return r()(t,n)}catch(n){return window&&window.console&&window.console.warn(`SecuritySolution: isVersionSupported(): Unable to determine if current version [${e}] meets minimum version [${t}]. Error: ${n.message}`),!1}})({currentVersion:t}))&&(function(e){const t=o(e);return r()("7.15.0",t)}(t)?function(e=[]){return e.includes("isolation")}(n):function(e){return(({currentOs:e,supportedOss:t=i})=>!!t[e])({currentOs:e.toLowerCase()})}(e))},933:function(e,t,n){"use strict";t.decode=t.parse=n(1479),t.encode=t.stringify=n(1480)},934:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(65),r=n(504);const i=(e,t={})=>{var n;return e.get(r.a,{...t,query:{...t.query,kuery:`${null!=t&&null!==(n=t.query)&&void 0!==n&&n.kuery?`${t.query.kuery} and `:""}${a.PACKAGE_POLICY_SAVED_OBJECT_TYPE}.package.name: endpoint`}})}},936:function(e,t,n){"use strict";n.d(t,"c",(function(){return r})),n.d(t,"e",(function(){return i})),n.d(t,"d",(function(){return o})),n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return c}));var a=n(185);const r=(e="",t=!1,n="",r="",i="",o=!1)=>({meta:{license:e,license_uuid:n,cluster_uuid:r,cluster_name:i,cloud:t,serverless:o},global_manifest_version:"latest",windows:{events:{credential_access:!0,dll_and_driver_load:!0,dns:!0,file:!0,network:!0,process:!0,registry:!0,security:!0},malware:{mode:a.f.prevent,blocklist:!0},ransomware:{mode:a.f.prevent,supported:!0},memory_protection:{mode:a.f.prevent,supported:!0},behavior_protection:{mode:a.f.prevent,reputation_service:t,supported:!0},popup:{malware:{message:"",enabled:!0},ransomware:{message:"",enabled:!0},memory_protection:{message:"",enabled:!0},behavior_protection:{message:"",enabled:!0}},logging:{file:"info"},antivirus_registration:{enabled:!1},attack_surface_reduction:{credential_hardening:{enabled:!0}}},mac:{events:{process:!0,file:!0,network:!0},malware:{mode:a.f.prevent,blocklist:!0},behavior_protection:{mode:a.f.prevent,reputation_service:t,supported:!0},memory_protection:{mode:a.f.prevent,supported:!0},popup:{malware:{message:"",enabled:!0},behavior_protection:{message:"",enabled:!0},memory_protection:{message:"",enabled:!0}},logging:{file:"info"},advanced:{capture_env_vars:"DYLD_INSERT_LIBRARIES,DYLD_FRAMEWORK_PATH,DYLD_LIBRARY_PATH,LD_PRELOAD"}},linux:{events:{process:!0,file:!0,network:!0,session_data:!1,tty_io:!1},malware:{mode:a.f.prevent,blocklist:!0},behavior_protection:{mode:a.f.prevent,reputation_service:t,supported:!0},memory_protection:{mode:a.f.prevent,supported:!0},popup:{malware:{message:"",enabled:!0},behavior_protection:{message:"",enabled:!0},memory_protection:{message:"",enabled:!0}},logging:{file:"info"},advanced:{capture_env_vars:"LD_PRELOAD,LD_LIBRARY_PATH"}}}),i=(e=r())=>{const t={rollback:{self_healing:{enabled:!1}}};return{...e,windows:{...e.windows,advanced:void 0===e.windows.advanced?void 0:{...e.windows.advanced,alerts:void 0===e.windows.advanced.alerts?{...t}:{...e.windows.advanced.alerts,...t}},ransomware:{mode:a.f.off,supported:!1},memory_protection:{mode:a.f.off,supported:!1},behavior_protection:{mode:a.f.off,reputation_service:!1,supported:!1},attack_surface_reduction:{credential_hardening:{enabled:!1}},popup:{...e.windows.popup,malware:{message:"",enabled:!0},ransomware:{message:"",enabled:!1},memory_protection:{message:"",enabled:!1},behavior_protection:{message:"",enabled:!1}}},mac:{...e.mac,behavior_protection:{mode:a.f.off,reputation_service:!1,supported:!1},memory_protection:{mode:a.f.off,supported:!1},popup:{...e.mac.popup,malware:{message:"",enabled:!0},memory_protection:{message:"",enabled:!1},behavior_protection:{message:"",enabled:!1}}},linux:{...e.linux,behavior_protection:{mode:a.f.off,reputation_service:!1,supported:!1},memory_protection:{mode:a.f.off,supported:!1},popup:{...e.linux.popup,malware:{message:"",enabled:!0},memory_protection:{message:"",enabled:!1},behavior_protection:{message:"",enabled:!1}}}}},o=(e=r())=>({...e,windows:{...e.windows,ransomware:{...e.windows.ransomware,supported:!0},memory_protection:{...e.windows.memory_protection,supported:!0},behavior_protection:{...e.windows.behavior_protection,supported:!0}},mac:{...e.mac,behavior_protection:{...e.windows.behavior_protection,supported:!0},memory_protection:{...e.mac.memory_protection,supported:!0}},linux:{...e.linux,behavior_protection:{...e.windows.behavior_protection,supported:!0},memory_protection:{...e.linux.memory_protection,supported:!0}}}),s="Elastic Security {action} {filename}",c="Elastic Security {action} {rule}"},960:function(e,t,n){"use strict";n.d(t,"g",(function(){return d})),n.d(t,"h",(function(){return u})),n.d(t,"f",(function(){return f})),n.d(t,"d",(function(){return g})),n.d(t,"e",(function(){return y})),n.d(t,"i",(function(){return m})),n.d(t,"c",(function(){return E})),n.d(t,"b",(function(){return I})),n.d(t,"a",(function(){return S}));var a=n(45),r=n(139),i=n(28),o=n(936),s=n(173),c=n(1133),l=n(1053);const d=e=>e.policyItem,p=Object(r.createSelector)(d,(e=>e.license),((e,t)=>{if(e){const n=((e,t)=>Object(i.b)(t,"platinum")?Object(o.d)(e):Object(o.e)(e))(e.inputs[0].config.policy.value,t);return{...e,inputs:[{...e.inputs[0],config:{...e.inputs[0].config,policy:{...e.inputs[0].config.policy,value:n}}}]}}return e})),u=Object(r.createSelector)(p,(e=>{if(e)return Object(c.a)(e)})),f=e=>!e.policyItem&&!e.apiError,g=e=>Object(l.e)(e)||Object(l.f)(e)||Object(l.d)(e)||Object(l.c)(e)||Object(l.b)(e),y=e=>e.license,m=Object(r.createSelector)((e=>e.location),(e=>{var t,n,r,i;return null!==(t=null===(n=Object(a.matchPath)(null!==(i=null==e?void 0:e.pathname)&&void 0!==i?i:"",{path:[s.n,s.q,s.m,s.o,s.l],exact:!0}))||void 0===n||null===(r=n.params)||void 0===r?void 0:r.policyId)&&void 0!==t?t:""})),h=Object(o.c)(),E=Object(r.createSelector)(p,(e=>{var t,n,a,r;return null!==(t=null==e||null===(n=e.inputs[0])||void 0===n||null===(a=n.config)||void 0===a||null===(r=a.policy)||void 0===r?void 0:r.value)&&void 0!==t?t:h})),b=Object(r.createSelector)(E,(e=>null==e?void 0:e.windows)),v=Object(r.createSelector)(E,(e=>null==e?void 0:e.mac)),O=Object(r.createSelector)(E,(e=>null==e?void 0:e.linux)),I=(Object(r.createSelector)(b,v,O,((e,t,n)=>({windows:{advanced:e.advanced,events:e.events,malware:e.malware,ransomware:e.ransomware,memory_protection:e.memory_protection,behavior_protection:e.behavior_protection,popup:e.popup,antivirus_registration:e.antivirus_registration,attack_surface_reduction:e.attack_surface_reduction},mac:{advanced:t.advanced,events:t.events,malware:t.malware,behavior_protection:t.behavior_protection,memory_protection:t.memory_protection,popup:t.popup},linux:{advanced:n.advanced,events:n.events,malware:n.malware,behavior_protection:n.behavior_protection,memory_protection:n.memory_protection,popup:n.popup}}))),e=>e.apiError),S=e=>e.agentStatusSummary}}]);