/*! 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([[5],{1046:function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var i=n(104),r=n.n(i),s=n(2),a=n.n(s),o=n(40),c=n(488),u=n(4);const p=Object(s.memo)((({appId:t=u.l,deepLinkId:e,appPath:n,appState:i,onClick:s,asButton:p,children:d,...l})=>{const f=Object(c.a)(t,{deepLinkId:e,path:n,state:i,onClick:s});return a.a.createElement(a.a.Fragment,null,p&&!0===p?a.a.createElement(o.EuiButton,r()({},l,{onClick:f}),d):a.a.createElement(o.EuiLink,r()({},l,{onClick:f}),d))}))},1390:function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return a}));var i=n(42);const r=(t,e)=>t?`(${e.map((e=>`exception-list-agnostic.attributes.${e}:(*${t.trim().replace(/([\)\(\<\>\}\{\"\:\\])/gm,"\\$&").replace(/\s/gm,"*")}*)`)).join(" OR ")})`:"",s=t=>"global"===t?'exception-list-agnostic.attributes.tags:"policy:all"':"unassigned"===t?"(not exception-list-agnostic.attributes.tags:*)":`exception-list-agnostic.attributes.tags:"policy:${t}"`,a=({policies:t=[],excludedPolicies:e=[],kuery:n})=>{if(0===(null==t?void 0:t.length)&&0===(null==e?void 0:e.length))return n||void 0;const r=((t,e=[])=>{if(Object(i.isEmpty)(t)&&Object(i.isEmpty)(e))return"";const n=t.map(s).join(" OR "),r=e.map((t=>`not ${s(t)}`)).join(" AND "),a=[];return n&&a.push(n),r&&a.push(r),`(${a.join(" AND ")})`})(t,e);return`(${r})${n?` AND (${n})`:""}`}},1479:function(t,e,n){"use strict";function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,n,s){e=e||"&",n=n||"=";var a={};if("string"!=typeof t||0===t.length)return a;var o=/\+/g;t=t.split(e);var c=1e3;s&&"number"==typeof s.maxKeys&&(c=s.maxKeys);var u=t.length;c>0&&u>c&&(u=c);for(var p=0;p=0?(d=h.substr(0,b),l=h.substr(b+1)):(d=h,l=""),f=decodeURIComponent(d),g=decodeURIComponent(l),i(a,f)?r(a[f])?a[f].push(g):a[f]=[a[f],g]:a[f]=g}return a};var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},1480:function(t,e,n){"use strict";var i=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,n,o){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?s(a(t),(function(a){var o=encodeURIComponent(i(a))+n;return r(t[a])?s(t[a],(function(t){return o+encodeURIComponent(i(t))})).join(e):o+encodeURIComponent(i(t[a]))})).join(e):o?encodeURIComponent(i(o))+n+encodeURIComponent(i(t)):""};var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function s(t,e){if(t.map)return t.map(e);for(var n=[],i=0;inew Promise(((s,a)=>{if("function"!=typeof e)throw new TypeError("Mapper function is required");if(!Number.isSafeInteger(n)&&n!==1/0||!(n>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${n}\` (${typeof n})`);const o=[],c=[],u=t[Symbol.iterator]();let p=!1,d=!1,l=0,f=0;const g=()=>{if(p)return;const t=u.next(),n=f;if(f++,t.done)return d=!0,void(0===l&&(r||0===c.length?s(o):a(new i(c))));l++,(async()=>{try{const i=await t.value;o[n]=await e(i,n),l--,g()}catch(t){r?(p=!0,a(t)):(c.push(t),l--,g())}})()};for(let t=0;tt instanceof Error?t:null!==t&&"object"==typeof t?Object.assign(new Error(t.message),t):new Error(t)))).map((t=>"string"==typeof t.stack?r(t.stack).replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""):String(t))).join("\n");e="\n"+i(e,4),super(e),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:t})}*[Symbol.iterator](){for(const t of this._errors)yield t}}t.exports=AggregateError},1611:function(t,e,n){"use strict";t.exports=(t,e=1,n)=>{if(n={indent:" ",includeEmptyLines:!1,...n},"string"!=typeof t)throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if("number"!=typeof e)throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if("string"!=typeof n.indent)throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n.indent}\``);if(0===e)return t;const i=n.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return t.replace(i,n.indent.repeat(e))}},1612:function(t,e,n){"use strict";const i=n(1613),r=/\s+at.*(?:\(|\s)(.*)\)?/,s=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,a=void 0===i.homedir?"":i.homedir();t.exports=(t,e)=>(e=Object.assign({pretty:!1},e),t.replace(/\\/g,"/").split("\n").filter((t=>{const e=t.match(r);if(null===e||!e[1])return!0;const n=e[1];return!n.includes(".app/Contents/Resources/electron.asar")&&!n.includes(".app/Contents/Resources/default_app.asar")&&!s.test(n)})).filter((t=>""!==t.trim())).map((t=>e.pretty?t.replace(r,((t,e)=>t.replace(e,e.replace(a,"~")))):t)).join("\n"))},1613:function(t,e){},226:function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"d",(function(){return s})),n.d(e,"a",(function(){return a})),n.d(e,"c",(function(){return o}));var i=n(163);const r="policy:",s=`${r}all`,a=i.a,o=["name","description","entries.value","entries.entries.value","item_id"]},245:function(t,e,n){"use strict";n.d(e,"e",(function(){return g})),n.d(e,"d",(function(){return h})),n.d(e,"h",(function(){return b})),n.d(e,"j",(function(){return y})),n.d(e,"n",(function(){return m})),n.d(e,"l",(function(){return j})),n.d(e,"a",(function(){return $})),n.d(e,"o",(function(){return I})),n.d(e,"b",(function(){return _})),n.d(e,"k",(function(){return L})),n.d(e,"f",(function(){return A})),n.d(e,"g",(function(){return C})),n.d(e,"m",(function(){return P})),n.d(e,"c",(function(){return T})),n.d(e,"i",(function(){return N}));var i=n(42),r=n(933),s=n.n(r),a=n(45),o=n(195),c=n(720),u=n(1035),p=n(173);const d=(t,e)=>void 0===t||t===e||0===t,l=(t,e={})=>`${t}${Object(o.a)(s.a.stringify(((t={})=>({...d(t.page,1)?{}:{page:t.page},...d(t.pageSize,p.c)?{}:{pageSize:t.pageSize},...d(t.show,void 0)?{}:{show:t.show},...d(t.itemId,void 0)?{}:{itemId:t.itemId},...d(t.filter,"")?"":{filter:t.filter},...d(t.includedPolicies,"")?"":{includedPolicies:t.includedPolicies}}))(e)))}`,f=t=>s.a.stringify(t),g=(t,e)=>{const{name:n,...r}=t,s=f(r),c=`${s&&!Object(i.isEmpty)(e)?"&":""}${null!=e?e:""}`;return"endpointList"===n?`${Object(a.generatePath)(p.h,{tabName:u.a.endpoints})}${Object(o.a)(`${s?`${s}${c}`:c}`)}`:`${Object(o.a)(`${s?`${s}${c}`:c}`)}`},h=(t,e)=>{const{name:n,show:r,...s}=t,c={...s};switch(t.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 d=f(c),l=`${d&&!Object(i.isEmpty)(e)?"&":""}${null!=e?e:""}`;return`${Object(a.generatePath)(p.h,{tabName:u.a.endpoints})}${Object(o.a)(`${d?`${d}${l}`:l}`)}`},b=t=>`${Object(a.generatePath)(p.k,{tabName:u.a.policies})}${Object(o.a)(t)}`,y=(t,e)=>`${Object(a.generatePath)(p.n,{tabName:u.a.policies,policyId:t})}${Object(o.a)(e)}`,m=(t,e)=>`${Object(a.generatePath)(p.q,{tabName:u.a.policies,policyId:t})}${Object(o.a)(e)}`,j=(t,e)=>`${Object(a.generatePath)(p.m,{tabName:u.a.policies,policyId:t})}${Object(o.a)(s.a.stringify(w(e)))}`,w=t=>t?{...d(t.page,p.b+1)?{}:{page:t.page},...d(t.pageSize,p.c)?{}:{pageSize:t.pageSize},...d(t.show,void 0)?{}:{show:t.show},...d(t.filter,"")?"":{filter:t.filter}}:{},O=(t,e)=>{const n=t[e];return Array.isArray(n)?n[n.length-1]:n},E=t=>{const e=Number(O(t,"page_index"));return!Number.isFinite(e)||e<0?p.b:e},v=t=>{const e=Number(O(t,"page_size"));return p.f.includes(e)?e:p.c},x=t=>O(t,"filter")||"",$=t=>({page_index:E(t),page_size:v(t),filter:x(t)}),I=t=>{const e=Object(a.generatePath)(p.s,{tabName:u.a.trustedApps});return l(e,t)},_=t=>{const e=O(t,"show"),n=Object(c.a)(t);return{page:n.page,pageSize:n.pageSize,filter:t.filter,show:e&&"list"===e?e:void 0}},L=(t,e)=>`${Object(a.generatePath)(p.q,{tabName:u.a.policies,policyId:t})}${Object(o.a)(s.a.stringify(w(e)))}`,A=t=>{const e=Object(a.generatePath)(p.i,{tabName:u.a.eventFilters});return l(e,t)},C=t=>{const e=Object(a.generatePath)(p.j,{tabName:u.a.hostIsolationExceptions});return l(e,t)},P=(t,e)=>`${Object(a.generatePath)(p.o,{tabName:u.a.policies,policyId:t})}${Object(o.a)(s.a.stringify(w(e)))}`,T=t=>{const e=Object(a.generatePath)(p.g,{tabName:u.a.blocklist});return l(e,t)},N=(t,e)=>`${Object(a.generatePath)(p.l,{tabName:u.a.policies,policyId:t})}${Object(o.a)(s.a.stringify(w(e)))}`},381:function(t,e,n){"use strict";n.d(e,"e",(function(){return u})),n.d(e,"d",(function(){return p})),n.d(e,"b",(function(){return l})),n.d(e,"g",(function(){return g})),n.d(e,"c",(function(){return b})),n.d(e,"f",(function(){return m})),n.d(e,"a",(function(){return E}));var i=n(46),r=n(2),s=n(173),a=n(1390),o=n(226);const c=Object.freeze({});function u(t,e=c,n=o.c,u,p=[]){const{filter:d="",page:l=s.b+1,perPage:f=s.c,policies:g=[],excludedPolicies:h=[]}=e,b=Object(r.useMemo)((()=>Object(a.a)({kuery:Object(a.b)(d,n),policies:g,excludedPolicies:h})),[d,n,g,h]);return Object(i.useQuery)([...p,"list",t,b,l,f],(async()=>await t.find({filter:b,perPage:f,page:l,sortField:s.d,sortOrder:s.e})),u)}function p(t,e,n,r){return Object(i.useQuery)(["get",t,e,n],(()=>t.get(e,n)),r)}const d=Object.freeze({});function l(t,e=d){return Object(i.useMutation)((e=>t.create(e)),e)}const f=Object.freeze({});function g(t,e=f){return Object(i.useMutation)((e=>t.update(e)),e)}const h=Object.freeze({});function b(t,e=h){return Object(i.useMutation)((({itemId:e,id:n})=>t.delete(e,n)),e)}const y=Object.freeze({});function m(t,e=y,n=o.c,r){const{filter:s="",policies:c=[]}=e;return Object(i.useQuery)(["summary",t,s,c],(()=>t.summary(Object(a.a)({policies:c,kuery:Object(a.b)(s,n)}))),r)}var j=n(1534),w=n.n(j);const O=Object.freeze({});function E(t,e=O,n={concurrency:5}){return Object(i.useMutation)((e=>w()(e,(e=>t.update(e)),n)),e)}Object.freeze({})},488:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(2),r=n(102);const s=(t,e)=>{const{services:n}=Object(r.j)(),{path:s,state:a,onClick:o,deepLinkId:c,openInNewTab:u}=e||{};return Object(i.useCallback)((e=>{try{o&&o(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0===e.button&&(e.currentTarget instanceof HTMLAnchorElement&&""!==e.currentTarget.target&&"_self"!==e.currentTarget.target||e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||(e.preventDefault(),n.application.navigateToApp(t,{deepLinkId:c,path:s,state:a,openInNewTab:u})))}),[t,c,o,s,n.application,a,u])}},574:function(t,e,n){"use strict";n.d(e,"a",(function(){return EventFiltersApiClient}));var i=n(163),r=n(214),s=n(215),a=n(706),o=n(733),c=n(575);function u(t){return Object(r.a)(t)}class EventFiltersApiClient extends o.a{constructor(t){super(t,i.f,c.b,void 0,u)}static getInstance(t){return super.getInstance(t,i.f,c.b,void 0,u)}async getSuggestions(t){return await this.getHttp().post(Object(a.a)(s.v,{suggestion_type:"eventFilters"}),{version:"2023-10-31",body:JSON.stringify(t)})}}},575:function(t,e,n){"use strict";n.d(e,"c",(function(){return s})),n.d(e,"b",(function(){return a})),n.d(e,"d",(function(){return o}));var i=n(120),r=n(163);n.d(e,"a",(function(){return r.f}));const s=i.b.ENDPOINT_EVENTS,a={name:r.g,namespace_type:"agnostic",description:r.e,list_id:r.f,type:s},o=["name","description","entries.value","entries.entries.value","comments.comment","item_id"]},733:function(t,e,n){"use strict";n.d(e,"a",(function(){return ExceptionsListApiClient}));var i=n(0),r=n.n(i),s=n(163),a=n(173);class ExceptionsListApiClient{constructor(t,e,n,i,s){r()(this,"ensureListExists",void 0),this.http=t,this.listId=e,this.listDefinition=n,this.readTransform=i,this.writeTransform=s,this.ensureListExists=this.createExceptionList()}async createExceptionList(){return ExceptionsListApiClient.wasListCreated.has(this.listId)||ExceptionsListApiClient.wasListCreated.set(this.listId,new Promise(((t,e)=>{(async()=>{try{await this.http.post(s.v,{body:JSON.stringify({...this.listDefinition,list_id:this.listId})}),t()}catch(t){ExceptionsListApiClient.wasListCreated.delete(this.listId),e(t)}})()}))),ExceptionsListApiClient.wasListCreated.get(this.listId)}checkIfIsUsingTheRightInstance(t){if(t!==this.listId)throw new Error(`The list id you are using is not valid, expected [${this.listId}] list id but received [${t}] list id`)}isHttp(t){return this.http===t}getHttp(){return this.http}static getInstance(t,e,n,i,r){var s;ExceptionsListApiClient.instance.has(e)&&null!==(s=ExceptionsListApiClient.instance.get(e))&&void 0!==s&&s.isHttp(t)||ExceptionsListApiClient.instance.set(e,new ExceptionsListApiClient(t,e,n,i,r));return ExceptionsListApiClient.instance.get(e)||new ExceptionsListApiClient(t,e,n,i,r)}static cleanExceptionsBeforeUpdate(t){var e;const n={...t};return["created_at","created_by","list_id","tie_breaker_id","updated_at","updated_by","meta"].forEach((t=>{delete n[t]})),n.comments=null===(e=n.comments)||void 0===e?void 0:e.map((t=>({comment:t.comment,id:t.id}))),n}async find({perPage:t=a.c,page:e=a.b+1,sortField:n,sortOrder:i,filter:r}={}){await this.ensureListExists;const o=await this.http.get(`${s.q}/_find`,{query:{page:e,per_page:t,sort_field:n,sort_order:i,list_id:[this.listId],namespace_type:["agnostic"],filter:r}});return this.readTransform&&(o.data=o.data.map(this.readTransform)),o}async get(t,e){if(!t&&!e)throw TypeError("either `itemId` or `id` argument must be set");await this.ensureListExists;let n=await this.http.get(s.q,{query:{id:e,item_id:t,namespace_type:"agnostic"}});return this.readTransform&&(n=this.readTransform(n)),n}async create(t){await this.ensureListExists,this.checkIfIsUsingTheRightInstance(t.list_id),delete t.meta;let e=t;return this.writeTransform&&(e=this.writeTransform(t)),this.http.post(s.q,{body:JSON.stringify(e)})}async update(t){await this.ensureListExists;let e=t;return this.writeTransform&&(e=this.writeTransform(t)),this.http.put(s.q,{body:JSON.stringify(ExceptionsListApiClient.cleanExceptionsBeforeUpdate(e))})}async delete(t,e){if(!t&&!e)throw TypeError("either `itemId` or `id` argument must be set");return await this.ensureListExists,this.http.delete(s.q,{query:{id:e,item_id:t,namespace_type:"agnostic"}})}async summary(t){return await this.ensureListExists,this.http.get(`${s.t}/summary`,{query:{filter:t,list_id:this.listId,namespace_type:"agnostic"}})}async hasData(){return(await this.find({perPage:1,page:1})).total>0}}r()(ExceptionsListApiClient,"instance",new Map),r()(ExceptionsListApiClient,"wasListCreated",new Map)},933:function(t,e,n){"use strict";e.decode=e.parse=n(1479),e.encode=e.stringify=n(1480)}}]);