/*! 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.aiops_bundle_jsonpfunction=window.aiops_bundle_jsonpfunction||[]).push([[0],{114:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o="undefined"!=typeof window?n.useLayoutEffect:n.useEffect;t.default=o},115:function(e,t,r){"use strict";const n=r(116),o=r(117),a=r(118);function s(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function i(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function c(e,t){return t.decode?o(e):e}function u(e){return Array.isArray(e)?e.sort():"object"==typeof e?u(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function l(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function d(e){const t=(e=l(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function f(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function p(e,t){s((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return(e,r,n)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"comma":case"separator":return(t,r,n)=>{const o="string"==typeof r&&r.split("").indexOf(e.arrayFormatSeparator)>-1?r.split(e.arrayFormatSeparator).map((t=>c(t,e))):null===r?r:c(r,e);n[t]=o};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),n=Object.create(null);if("string"!=typeof e)return n;if(!(e=e.trim().replace(/^[?#&]/,"")))return n;for(const o of e.split("&")){let[e,s]=a(t.decode?o.replace(/\+/g," "):o,"=");s=void 0===s?null:["comma","separator"].includes(t.arrayFormat)?s:c(s,t),r(c(e,t),s,n)}for(const e of Object.keys(n)){const r=n[e];if("object"==typeof r&&null!==r)for(const e of Object.keys(r))r[e]=f(r[e],t);else n[e]=f(r,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce(((e,t)=>{const r=n[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=u(r):e[t]=r,e}),Object.create(null))}t.extract=d,t.parse=p,t.stringify=(e,t)=>{if(!e)return"";s((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const r=r=>t.skipNull&&null==e[r]||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{const o=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[i(t,e),"[",o,"]"].join("")]:[...r,[i(t,e),"[",i(o,e),"]=",i(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[i(t,e),"[]"].join("")]:[...r,[i(t,e),"[]=",i(n,e)].join("")];case"comma":case"separator":return t=>(r,n)=>null==n||0===n.length?r:0===r.length?[[i(t,e),"=",i(n,e)].join("")]:[[r,i(n,e)].join(e.arrayFormatSeparator)];default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,i(t,e)]:[...r,[i(t,e),"=",i(n,e)].join("")]}}(t),o={};for(const t of Object.keys(e))r(t)||(o[t]=e[t]);const a=Object.keys(o);return!1!==t.sort&&a.sort(t.sort),a.map((r=>{const o=e[r];return void 0===o?"":null===o?i(r,t):Array.isArray(o)?o.reduce(n(r),[]).join("&"):i(r,t)+"="+i(o,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,n]=a(e,"#");return Object.assign({url:r.split("?")[0]||"",query:p(d(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:c(n,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0},r);const n=l(e.url).split("?")[0]||"",o=t.extract(e.url),a=t.parse(o,{sort:!1}),s=Object.assign(a,e.query);let c=t.stringify(s,r);c&&(c=`?${c}`);let u=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(u=`#${i(e.fragmentIdentifier,r)}`),`${n}${c}${u}`}},116:function(e,t,r){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))},117:function(e,t,r){"use strict";var n="%[a-f0-9]{2}",o=new RegExp("("+n+")|([^%]+?)","gi"),a=new RegExp("("+n+")+","gi");function s(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],s(r),s(n))}function i(e){try{return decodeURIComponent(e)}catch(n){for(var t=e.match(o)||[],r=1;r{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},38:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return a}));var n=r(1);const o=Object(n.createContext)(void 0),a=()=>{const e=Object(n.useContext)(o);if(void 0===e)throw new Error("useAiopsAppContext was used outside of its Provider");return e}},39:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=(e,t=[])=>"object"==typeof e&&null!==e&&Object.keys(e).length>0&&(0===t.length||t.every((t=>({}.hasOwnProperty.call(e,t)))))},40:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"c",(function(){return u})),r.d(t,"b",(function(){return l}));var n=r(1),o=r(2),a=r(13),s=r(38),i=r(0);const c=Object(n.createContext)({get dataView(){throw new Error("DataSourceContext is not implemented")},savedSearch:null});function u(){return Object(n.useContext)(c)}const l=({dataViewId:e,savedSearchId:t,children:r,onChange:u})=>{const[l,d]=Object(n.useState)(),[f,p]=Object(n.useState)(),{data:{dataViews:b}}=Object(s.b)(),m=Object(n.useCallback)((async()=>{const t={savedSearch:null,dataView:null};e&&(t.dataView=await b.get(e));const{savedSearch:r,dataView:n}=t;return{dataView:n,savedSearch:r}}),[e,b]);return Object(n.useEffect)((()=>{m().then((e=>{p(void 0),d(e),u&&u({dataViews:[e.dataView]})})).catch((e=>{p(e)}))}),[m,u,e]),l&&null!=l&&l.dataView||f?f?Object(i.jsx)(o.EuiEmptyPrompt,{iconType:"error",color:"danger",title:Object(i.jsx)("h2",null,Object(i.jsx)(a.FormattedMessage,{id:"xpack.aiops.dataSourceContext.errorTitle",defaultMessage:"Unable to fetch data view or saved search"})),body:Object(i.jsx)("p",null,f.message)}):Object(i.jsx)(c.Provider,{value:l},r):null}},41:function(e,t,r){e.exports=r(15)(1465)},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"g",(function(){return m})),r.d(t,"f",(function(){return h})),r.d(t,"b",(function(){return E})),r.d(t,"d",(function(){return T})),r.d(t,"e",(function(){return b})),r.d(t,"c",(function(){return I}));var n=r(1),o=r.n(n),a=r(0);const s=Object(n.createContext)(void 0),i=()=>{const e=Object(n.useContext)(s);if(void 0===e)throw new Error("datePickerContext was used outside of its Provider");return e},c=e=>{const{children:t,...r}=e;return Object(a.jsx)(s.Provider,{value:r},t)};var u=r(58),l=r.n(u),d=r(3),f=r(19),p=r(12);const b=new d.Subject,m=(e={})=>{const{timeRangeSelector:t,autoRefreshSelector:r}=e,{data:{query:{timefilter:{timefilter:o}}}}=i();return Object(n.useEffect)((()=>{!0!==t||o.isTimeRangeSelectorEnabled()?!1===t&&o.isTimeRangeSelectorEnabled()&&o.disableTimeRangeSelector():o.enableTimeRangeSelector(),!0!==r||o.isAutoRefreshSelectorEnabled()?!1===r&&o.isAutoRefreshSelectorEnabled()&&o.disableAutoRefreshSelector():o.enableAutoRefreshSelector()}),[t,r,o]),o},h=(e=!1)=>{const t=m(),r=Object(n.useMemo)((()=>e?t.getAbsoluteTime.bind(t):t.getTime.bind(t)),[e,t]),o=Object(n.useMemo)((()=>t.getTimeUpdate$().pipe(Object(f.map)(r),Object(f.distinctUntilChanged)(p.isEqual))),[t,r]);return l()(o,r())};var g=r(2),j=r(11),O=r(13),y=r(44),S=r(74);const v=5e3;function x(e){b.next({lastRefresh:Date.now(),...e?{timeRange:e}:{}})}const E=e=>{var t,r,s;const{isAutoRefreshOnly:c,isLoading:u=!1,showRefresh:b,width:E,flexGroup:_=!0}=e,{data:k,notifications:{toasts:R},uiSettings:w,uiSettingsKeys:I,theme:T,i18n:C}=i(),M=Object(g.useIsWithinMaxBreakpoint)("l"),{timefilter:F,history:U}=k.query.timefilter,[A,P]=Object(y.c)("_g"),D=(B=U,function(){var e,t;return null!==(e=null===(t=B.get())||void 0===t?void 0:t.map((({from:e,to:t})=>({start:e,end:t}))))&&void 0!==e?e:[]});var B;const N=(()=>{const e=m(),t=Object(n.useMemo)((()=>e.getRefreshIntervalUpdate$().pipe(Object(f.map)(e.getRefreshInterval))),[e]);return l()(t,e.getRefreshInterval())})(),L=h();Object(n.useEffect)((function(){void 0!==(null==A?void 0:A.time)&&F.setTime({from:A.time.from,to:A.time.to})}),[null==A||null===(t=A.time)||void 0===t?void 0:t.from,null==A||null===(r=A.time)||void 0===r?void 0:r.to,null==A||null===(s=A.time)||void 0===s?void 0:s.ts]),Object(n.useEffect)((function(){var e,t;void 0!==(null==A?void 0:A.refreshInterval)&&F.setRefreshInterval({pause:!(null==A||null===(e=A.refreshInterval)||void 0===e||!e.pause),value:null==A||null===(t=A.refreshInterval)||void 0===t?void 0:t.value})}),[null==A?void 0:A.refreshInterval]);const $=Object(n.useCallback)(Object(p.debounce)((e=>{P("refreshInterval",e,!0)}),200),[P]),[z,G]=Object(n.useState)(D()),[V,q]=Object(n.useState)(F.isAutoRefreshSelectorEnabled()),[H,X]=Object(n.useState)(F.isTimeRangeSelectorEnabled()),K=N;Object(n.useEffect)((function(){const e=!(null==A||!A.refreshInterval);K.valueJ.map((({from:e,to:t,display:r})=>({start:e,end:t,label:r})))),[J]);Object(n.useEffect)((()=>{const e=new d.Subscription,t=F.getEnabledUpdated$();return void 0!==t&&e.add(t.subscribe((e=>{q(F.isAutoRefreshSelectorEnabled()),X(F.isTimeRangeSelectorEnabled())}))),function(){e.unsubscribe()}}),[]);const Y=Object(n.useCallback)((({start:e,end:t})=>{G(D()),P("time",{from:e,to:t,..."now"===e||"now"===t?{ts:Date.now()}:{}})}),[P]),Z=Object(a.jsx)(o.a.Fragment,null,Object(a.jsx)(g.EuiFlexItem,null,Object(a.jsx)(g.EuiSuperDatePicker,{isLoading:u,start:L.from,end:L.to,isPaused:K.pause,isAutoRefreshOnly:!H||c,refreshInterval:K.value||v,onTimeChange:Y,onRefresh:x,onRefreshChange:function({isPaused:e,refreshInterval:t}){!1===e&&t<=0&&$({pause:e,value:5e3}),$({pause:e,value:t})},recentlyUsedRanges:z,dateFormat:W,commonlyUsedRanges:Q,updateButtonProps:{iconOnly:M,fill:!1},width:E})),!0!==b&&H?null:Object(a.jsx)(g.EuiFlexItem,{grow:!1},Object(a.jsx)(g.EuiButton,{fill:!1,color:"primary",iconType:"refresh",onClick:()=>x(),"data-test-subj":"mlDatePickerRefreshPageButton"+(u?" loading":" loaded"),isLoading:u},Object(a.jsx)(O.FormattedMessage,{id:"xpack.ml.datePicker.pageRefreshButton",defaultMessage:"Refresh"})))),ee=_?Object(a.jsx)(g.EuiFlexGroup,{gutterSize:"s",alignItems:"center"},Z):Z;return V||H?ee:null};var _=r(14),k=r.n(_),R=(r(20),r(39)),w=r(46);const I={EXCLUDE:"exclude-frozen",INCLUDE:"include-frozen"},T=e=>{const{frozenDataPreference:t,setFrozenDataPreference:r,timefilter:o,dataView:s,query:c,disabled:u,callback:l,apiPath:d}=e,{http:f,notifications:{toasts:p}}=i(),b=Object(n.useCallback)((async()=>{try{const e=await async function(e,t,r,n,o,a,s="/internal/file_upload/time_field_range"){try{const i=t.getRuntimeMappings(),c=await async function(e){const{http:t,path:r,...n}=e;return await t.fetch({path:r,method:"POST",body:JSON.stringify(n),version:"1"})}({index:t.getIndexPattern(),timeFieldName:t.timeFieldName,query:a?Object(w.b)(o):o,...Object(R.a)(i)?{runtimeMappings:i}:{},http:n,path:s});if(c.start.epoch&&c.end.epoch)return e.setTime({from:k()(c.start.epoch).toISOString(),to:k()(c.end.epoch).toISOString()}),c;if("number"==typeof c.start&&"number"==typeof c.end)return e.setTime({from:k()(c.start).toISOString(),to:k()(c.end).toISOString()}),{success:!0,start:{epoch:c.start,string:k()(c.start).toISOString()},end:{epoch:c.end,string:k()(c.end).toISOString()}};r.addWarning({title:j.i18n.translate("xpack.ml.datePicker.fullTimeRangeSelector.noResults",{defaultMessage:"No results match your search criteria"})})}catch(e){r.addDanger(j.i18n.translate("xpack.ml.datePicker.fullTimeRangeSelector.errorSettingTimeRangeNotification",{defaultMessage:"An error occurred setting the time range."}))}}(o,s,p,f,c,t===I.EXCLUDE,d);"function"==typeof l&&void 0!==e&&l(e)}catch(e){p.addDanger(j.i18n.translate("xpack.ml.datePicker.fullTimeRangeSelector.errorSettingTimeRangeNotification",{defaultMessage:"An error occurred setting the time range."}))}}),[l,s,t,f,c,o,p,d]),[m,h]=Object(n.useState)(!1),y=Object(n.useCallback)((e=>{r(e),S()}),[r]),S=()=>{h(!1)},v=Object(n.useMemo)((()=>[{id:I.EXCLUDE,label:j.i18n.translate("xpack.ml.datePicker.fullTimeRangeSelector.useFullDataExcludingFrozenMenuLabel",{defaultMessage:"Exclude frozen data tier"})},{id:I.INCLUDE,label:j.i18n.translate("xpack.ml.datePicker.fullTimeRangeSelector.useFullDataIncludingFrozenMenuLabel",{defaultMessage:"Include frozen data tier"})}]),[]),x=Object(n.useMemo)((()=>Object(a.jsx)(g.EuiPanel,null,Object(a.jsx)(g.EuiRadioGroup,{options:v,idSelected:t,onChange:y,compressed:!0}))),[v,t,y]),E=Object(n.useMemo)((()=>t===I.EXCLUDE?Object(a.jsx)(O.FormattedMessage,{id:"xpack.ml.datePicker.fullTimeRangeSelector.useFullDataExcludingFrozenButtonTooltip",defaultMessage:"Use full range of data excluding frozen data tier."}):Object(a.jsx)(O.FormattedMessage,{id:"xpack.ml.datePicker.fullTimeRangeSelector.useFullDataIncludingFrozenButtonTooltip",defaultMessage:"Use full range of data including frozen data tier, which might have slower search results."})),[t]);return Object(a.jsx)(g.EuiFlexGroup,{responsive:!1,gutterSize:"xs"},Object(a.jsx)(g.EuiToolTip,{content:E},Object(a.jsx)(g.EuiButton,{isDisabled:u,onClick:()=>b(),"data-test-subj":"mlDatePickerButtonUseFullData"},Object(a.jsx)(O.FormattedMessage,{id:"xpack.ml.datePicker.fullTimeRangeSelector.useFullDataButtonLabel",defaultMessage:"Use full data"}))),Object(a.jsx)(g.EuiFlexItem,{grow:!1},Object(a.jsx)(g.EuiPopover,{id:"mlFullTimeRangeSelectorOption",button:Object(a.jsx)(g.EuiButtonIcon,{display:"base",size:"m",iconType:"boxesVertical","aria-label":j.i18n.translate("xpack.ml.datePicker.fullTimeRangeSelector.moreOptionsButtonAriaLabel",{defaultMessage:"More options"}),onClick:()=>{h(!m)}}),isOpen:m,closePopover:S,panelPaddingSize:"none",anchorPosition:"downRight"},x)))}},44:function(e,t,r){"use strict";r.d(t,"b",(function(){return v})),r.d(t,"c",(function(){return S})),r.d(t,"a",(function(){return y}));var n=r(41),o=r.n(n),a=r(115),s=r(1),i=r(28),c=r(12);function u(e,t,r){const n=t.split(".");let o=e;for(let e=0;e"object"==typeof t?u(t,n.slice(e+1,n.length).join(".")):t));break}}return void 0===o?r:o}var l=r(26),d=r(3),f=r(19),p=r(39),b=r(0);const m=new Set(["_a","_g"]);function h(e){return m.has(e)}function g(e){const t={},r=Object(a.parse)(e,{sort:!1});try{Object.keys(r).forEach((e=>{h(e)?t[e]=Object(l.decode)(r[e]):t[e]=r[e]}))}catch(e){console.error("Could not read url state",e)}return t}const j=Object(s.createContext)({searchString:"",setUrlState:()=>{}}),{Provider:O}=j,y=({children:e})=>{const t=Object(i.useHistory)(),{search:r}=Object(i.useLocation)(),n=Object(s.useRef)(r);Object(s.useEffect)((()=>{n.current=r}),[r]);const o=Object(s.useCallback)(((e,r,o,s)=>{const i=n.current,d=g(i),f=Object(a.parse)(i,{sort:!1});if(Object.prototype.hasOwnProperty.call(d,e)||(d[e]={}),"string"==typeof r){if(Object(c.isEqual)(u(d,`${e}.${r}`),o))return i;d[e][r]=o}else{const t=r;Object.keys(t).forEach((r=>{d[e][r]=t[r]}))}try{const e=Object(a.stringify)(f,{sort:!1,encode:!1});if(Object.keys(d).forEach((e=>{h(e)?f[e]=Object(l.encode)(d[e]):f[e]=d[e]})),e!==Object(a.stringify)(f,{sort:!1,encode:!1})){const e=Object(a.stringify)(f,{sort:!1});n.current=e,s?t.replace({search:e}):t.push({search:e})}}catch(e){console.error("Could not save url state",e)}}),[]);return Object(b.jsx)(O,{value:{searchString:r,setUrlState:o}},e)},S=e=>{const{searchString:t,setUrlState:r}=Object(s.useContext)(j);return[Object(s.useMemo)((()=>{const r=g(t);if("object"==typeof r)return r[e]}),[t]),Object(s.useCallback)(((t,n,o)=>{r(e,t,n,o)}),[e,r])]};class url_state_PageUrlStateService{constructor(){o()(this,"_pageUrlState$",new d.BehaviorSubject(null)),o()(this,"_pageUrlStateCallback",null)}getPageUrlState$(){return this._pageUrlState$.pipe(Object(f.distinctUntilChanged)(c.isEqual))}getPageUrlState(){return this._pageUrlState$.getValue()}updateUrlState(e,t){if(!this._pageUrlStateCallback)throw new Error("Callback has not been initialized.");this._pageUrlStateCallback(e,t)}setCurrentState(e){this._pageUrlState$.next(e)}setUpdateCallback(e){this._pageUrlStateCallback=e}}const v=(e,t)=>{const[r,n]=S("_a"),o=null==r?void 0:r[e],a=Object(s.useRef)();Object(s.useEffect)((()=>{a.current=n}),[n]);const i=Object(s.useRef)(),u=Object(s.useMemo)((()=>{const e={...null!=t?t:{},...null!=o?o:{}};if(Object(c.isEqual)(e,i.current))return i.current;if(Object(p.a)(i.current))for(const t in e)Object(c.isEqual)(e[t],i.current[t])&&(e[t]=i.current[t]);return i.current=e,e}),[o]),l=Object(s.useCallback)(((t,r)=>{if(null==a||!a.current)throw new Error("Callback for URL state update has not been initialized.");a.current(e,{...u,...t},r)}),[e,u]),d=Object(s.useMemo)((()=>new url_state_PageUrlStateService),[]);return Object(s.useEffect)((function(){d.setCurrentState(u),d.setUpdateCallback(l)}),[d,l,u]),Object(s.useMemo)((()=>[u,l,d]),[u,l,d])}},46:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return s})),r.d(t,"a",(function(){return i})),r.d(t,"d",(function(){return u}));var n=r(12),o=r(39);const a=e=>{const t={term:{_tier:{value:"data_frozen"}}};if(!e)return{bool:{must_not:[t]}};const r=Object(n.cloneDeep)(e);return delete r.match_all,Object(o.a)(r.bool)?Array.isArray(r.bool.must_not)?r.bool.must_not.push(t):(Object(o.a)(r.bool.must_not)&&(r.bool.must_not=[r.bool.must_not,t]),void 0===r.bool.must_not&&(r.bool.must_not=[t])):r.bool={must_not:[t]},r};function s(e,t,r,n){const o=[];return e&&t&&r&&o.push({range:{[e]:{gte:t,lte:r,format:"epoch_millis"}}}),n&&"object"==typeof n&&o.push(n),o}const i={KUERY:"kuery",LUCENE:"lucene"},c={bool:{must:[{match_all:{}}]}};function u(){return Object(n.cloneDeep)(c)}},53:function(e,t,r){e.exports=r(15)(1466)},58:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(25),o=r(1),a=n.__importDefault(r(114));t.default=function(e,t){var r=o.useState(t),n=r[0],s=r[1];return a.default((function(){var t=e.subscribe(s);return function(){return t.unsubscribe()}}),[e]),n}},74:function(e,t,r){"use strict";r.d(t,"a",(function(){return _}));var n=r(1),o=r(23),a=r.n(o),s=r(53),i=r.n(s),c=r(58),u=r.n(c),l=r(29),d=r.n(l),f=r(2);let p;!function(e){e.preboot="preboot",e.standard="standard"}(p||(p={}));const b="eui-global",m="eui-utilities",h={darkMode:!1};var g=r(0);const j=d()({key:"css",container:document.querySelector('meta[name="emotion"]')}),O=d()({key:b,container:document.querySelector(`meta[name="${b}"]`)}),y=d()({key:m,container:document.querySelector(`meta[name="${m}"]`)});j.compat=!0,O.compat=!0,y.compat=!0;const S={default:j,global:O,utility:y},v=({theme:{theme$:e},globalStyles:t,colorMode:r,children:o})=>{const a=u()(e,h),s=Object(n.useMemo)((()=>(e=>e.darkMode?f.COLOR_MODES_STANDARD.dark:f.COLOR_MODES_STANDARD.light)(a)),[a]),i=r||s,c=!1!==t&&void 0;return Object(g.jsx)(f.EuiProvider,{cache:S,colorMode:i,globalStyles:c,utilityClasses:c},o)},x=({children:e,i18n:t,...r})=>Object(g.jsx)(v,r,Object(g.jsx)(t.Context,null,e)),E=({children:e,...t})=>Object(g.jsx)(x,i()({globalStyles:!1},t),Object(g.jsx)(f.EuiErrorBoundary,null,e)),_=(e,t)=>r=>(a.a.render(Object(g.jsx)(E,t,e),r),()=>a.a.unmountComponentAtNode(r));r(41),r(11);class mount_point_portal_MountPointPortalErrorBoundary extends n.Component{constructor(...e){super(...e),definePropertyfrom_dll_reference_kbnSharedDeps_npm_default()(this,"state",{error:void 0})}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(){}render(){return this.state.error?Object(g.jsx)("p",null,external_kbnSharedDeps_KbnI18n_.i18n.translate("reactPackages.mountPointPortal.errorMessage",{defaultMessage:"Error rendering portal content"})):this.props.children}}},78:function(e,t,r){"use strict";r.d(t,"a",(function(){return v}));var n=r(1),o=r(16),a=r(27),s=r(12),i=r(14),c=r.n(i),u=r(20),l=r.n(u);const d=new RegExp("^([0-9]*)\\s*("+l.a.units.join("|")+")$"),f=["ms","s","m","h"],p=["ms","s","m","h","d"],{duration:b}=c.a,m=l.a.unitsDesc,h=m.indexOf("w"),g=function(){const e=[[b(500,"ms"),b(100,"ms")],[b(5,"second"),b(1,"second")],[b(10,"second"),b(5,"second")],[b(15,"second"),b(10,"second")],[b(30,"second"),b(15,"second")],[b(1,"minute"),b(30,"second")],[b(5,"minute"),b(1,"minute")],[b(10,"minute"),b(5,"minute")],[b(15,"minute"),b(10,"minute")],[b(30,"minute"),b(10,"minute")],[b(1,"hour"),b(30,"minute")],[b(2,"hour"),b(1,"hour")],[b(4,"hour"),b(2,"hour")],[b(6,"hour"),b(4,"hour")],[b(8,"hour"),b(6,"hour")],[b(12,"hour"),b(8,"hour")],[b(24,"hour"),b(12,"hour")],[b(2,"d"),b(1,"d")],[b(4,"d"),b(2,"d")],[b(1,"week"),b(4,"d")],[b(1,"month"),b(1,"week")],[b(1,"year"),b(1,"month")],[1/0,b(1,"year")]].slice(0).reverse();function t(e,t,r){return function(n,o){const a=function(n,o){const a=o/n;let s;for(let n=0;nr){if(e===1/0)return t;const n=e.asMilliseconds(),o=t.asMilliseconds();return Math.abs(n-r)<=Math.abs(o)?e:t}}),!0),lessThan:t(e,(function(e,t,r){if(t=1&&Math.floor(n)===n){if(t<=h)continue;return{value:n,unit:r,expression:n+r}}}const t=e.as("ms");return{value:t,unit:"ms",expression:t+"ms"}}(e);e.esValue=r.value,e.esUnit=r.unit,e.expression=r.expression,e.overflow=t>e&&c.a.duration(e-t);const n=c.a.normalizeUnits(r.unit);return 1===r.value?e.description=n:e.description=`${r.value} ${n}s`,e}function y(e){return e&&"isValid"in e&&e.isValid()}j.prototype.setBarTarget=function(e){this.barTarget=e},j.prototype.setMaxBars=function(e){this.maxBars=e},j.prototype.setBounds=function(e){if(!e)return this.clearBounds();let t;t=Object(s.isPlainObject)(e)?[e.min,e.max]:Array.isArray(e)?e:[];const r=Object(s.sortBy)(t.map(Object(s.ary)(c.a,1)),Number);if(2!==r.length||!r.every(y))throw this.clearBounds(),new Error("invalid bounds set: "+e);if(this._lb=r.shift(),this._ub=r.pop(),this.getDuration().asSeconds()<0)throw new TypeError("Intervals must be positive")},j.prototype.clearBounds=function(){this._lb=this._ub=null},j.prototype.hasBounds=function(){return y(this._ub)&&y(this._lb)},j.prototype.getBounds=function(){if(this.hasBounds())return{min:this._lb,max:this._ub}},j.prototype.getDuration=function(){if(this.hasBounds())return c.a.duration(this._ub-this._lb,"ms")},j.prototype.setInterval=function(e){this.originalInterval=e;let t=e;if(t&&"auto"!==t){if(Object(s.isString)(t)&&(e=t,t=function(e,t=!1){const r=String(e).trim().match(d);if(!Array.isArray(r)||r.length<3)return null;try{const e=parseInt(r[1],10),n=r[2];return isNaN(e)||e<1&&-1===f.indexOf(n)||!0===t&&-1===p.indexOf(n)?null:Object(i.duration)(e,n)}catch(e){return null}}(t),0==+t&&(t=null)),!c.a.isDuration(t))throw new TypeError('"'+e+'" is not a valid interval.');this._i=t}else this._i="auto"},j.prototype.getInterval=function(){const e=this,t=e.getDuration();return O(function(r){if(!e.hasBounds())return r;const n=e.maxBars;let o;return t/r>n?(o=g.lessThan(n,t),+o==+r?r:(O(r,t),Object(s.assign)(o,{preScaled:r,scale:r/o,scaled:!0}))):r}(function(){const r=e._i;return c.a.isDuration(r)?r:g.near(e.barTarget,t)}()),t)},j.prototype.getIntervalToNearestMultiple=function(e){const t=this.getInterval(),r=t.asSeconds(),n=r%e;if(0===n)return t;let o=n>e/2?r+e-n:r-n;o=0===o?e:o;const a=c.a.duration(o,"seconds");O(a,this.getDuration());const s=t.preScaled;return void 0!==s&&s=0;r--){const n=t[r];if(!n[0]||e>=c.a.duration(n[0]))return n[1]}return this._timeBucketsConfig.dateFormat},j.prototype.getScaledDateFormatter=function(){return new(this._fieldFormats.getType(a.FIELD_FORMAT_IDS.DATE))({pattern:this.getScaledDateFormat()},this._timeBucketsConfig)};var S=r(38);const v=()=>{const{uiSettings:e}=Object(S.b)();return Object(n.useMemo)((()=>new j({[o.UI_SETTINGS.HISTOGRAM_MAX_BARS]:e.get(o.UI_SETTINGS.HISTOGRAM_MAX_BARS),[o.UI_SETTINGS.HISTOGRAM_BAR_TARGET]:e.get(o.UI_SETTINGS.HISTOGRAM_BAR_TARGET),dateFormat:e.get("dateFormat"),"dateFormat:scaled":e.get("dateFormat:scaled")})),[e])}}}]);