/*! 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. */!function(e){function t(t){for(var r,i,o=t[0],a=t[1],s=0,c=[];s[e,null])))),type:a.keyof(Object.fromEntries(Object.values(u).map((e=>[e,null])))),stack:a.boolean}),d=a.type({from:a.string,to:a.string,interval:a.string}),p=a.intersection([s.e,a.partial({rate:a.boolean,color:a.keyof(Object.fromEntries(Object.values(i.a).map((e=>[e,null])))),label:a.string})]),f=a.type({aggregation:s.d,metrics:a.array(p)}),g=a.partial({limit:a.number,groupBy:a.union([a.string,a.array(a.string)]),filterQuery:a.string,source:a.string,forceInterval:a.boolean,dropLastBucket:a.boolean}),m=a.intersection([f,g]),y=a.type({chartOptions:l,currentTimerange:d,options:m}),h=a.type({name:o.e}),b=a.partial({isDefault:a.boolean,isStatic:a.boolean}),v=a.intersection([y,h,b]),_=a.exact(a.intersection([h,b])),w=a.exact(a.intersection([a.type({id:a.string,attributes:v}),a.partial({updatedAt:o.d,version:a.string})])),x=a.exact(a.intersection([a.type({id:a.string,attributes:_}),a.partial({updatedAt:o.d,version:a.string})]));n.i18n.translate("xpack.infra.savedView.defaultViewNameHosts",{defaultMessage:"Default view"}),i.a.color0,i.a.color1,i.a.color2,u.line,c.fromZero;class FetchMetricsExplorerViewError extends Error{constructor(e,t){super(e),this.cause=t,Object.setPrototypeOf(this,new.target.prototype),this.name="FetchMetricsExplorerViewError"}}class UpsertMetricsExplorerViewError extends Error{constructor(e,t){super(e),this.cause=t,Object.setPrototypeOf(this,new.target.prototype),this.name="UpsertMetricsExplorerViewError"}}class DeleteMetricsExplorerViewError extends Error{constructor(e,t){super(e),this.cause=t,Object.setPrototypeOf(this,new.target.prototype),this.name="DeleteMetricsExplorerViewError"}}},function(e,t,r){"use strict";r.d(t,"b",(function(){return FetchInventoryViewError})),r.d(t,"c",(function(){return UpsertInventoryViewError})),r.d(t,"a",(function(){return DeleteInventoryViewError})),r.d(t,"d",(function(){return p})),r.d(t,"e",(function(){return f})),r.d(t,"f",(function(){return y})),r.d(t,"g",(function(){return b})),r.d(t,"h",(function(){return v})),r(1).i18n.translate("xpack.infra.savedView.defaultViewNameHosts",{defaultMessage:"Default view"});class FetchInventoryViewError extends Error{constructor(e,t){super(e),this.cause=t,Object.setPrototypeOf(this,new.target.prototype),this.name="FetchInventoryViewError"}}class UpsertInventoryViewError extends Error{constructor(e,t){super(e),this.cause=t,Object.setPrototypeOf(this,new.target.prototype),this.name="UpsertInventoryViewError"}}class DeleteInventoryViewError extends Error{constructor(e,t){super(e),this.cause=t,Object.setPrototypeOf(this,new.target.prototype),this.name="DeleteInventoryViewError"}}var n=r(12),i=r(0),o=r(30),a=r(20);const s=i.keyof({status:null,temperature:null,cool:null,warm:null,positive:null,negative:null}),u=i.type({palette:s,steps:Object(n.c)(2,18),reverseColors:i.boolean}),c=i.type({by:i.keyof({name:null,value:null}),direction:i.keyof({asc:null,desc:null})}),l=i.keyof({table:null,map:null}),d=i.type({min:Object(n.c)(0,1),max:Object(n.c)(0,1)}),p=i.type({kind:i.literal("kuery"),expression:i.string}),f=i.intersection([i.type({accountId:i.string,autoBounds:i.boolean,boundsOverride:d,customMetrics:i.array(o.d),customOptions:i.array(i.type({text:i.string,field:i.string})),groupBy:o.e,metric:o.f,nodeType:a.c,region:i.string,sort:c,view:l}),i.partial({legend:u,source:i.string,timelineOpen:i.boolean})]),g=i.type({name:n.e}),m=i.partial({isDefault:i.boolean,isStatic:i.boolean}),y=i.intersection([f,g,m,i.type({autoReload:i.boolean,filterQuery:p}),i.partial({time:i.number})]),h=i.exact(i.intersection([g,m])),b=i.exact(i.intersection([i.type({id:i.string,attributes:y}),i.partial({updatedAt:n.d,version:i.string})])),v=i.exact(i.intersection([i.type({id:i.string,attributes:h}),i.partial({updatedAt:n.d,version:i.string})]))},function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return l})),r.d(t,"d",(function(){return d})),r.d(t,"e",(function(){return p})),r.d(t,"i",(function(){return f})),r.d(t,"j",(function(){return g})),r.d(t,"m",(function(){return m})),r.d(t,"k",(function(){return y})),r.d(t,"l",(function(){return h})),r.d(t,"n",(function(){return b})),r.d(t,"q",(function(){return E})),r.d(t,"r",(function(){return T})),r.d(t,"w",(function(){return S})),r.d(t,"A",(function(){return R})),r.d(t,"C",(function(){return M})),r.d(t,"D",(function(){return D})),r.d(t,"F",(function(){return I})),r.d(t,"I",(function(){return j})),r.d(t,"L",(function(){return L})),r.d(t,"O",(function(){return C})),r.d(t,"R",(function(){return v})),r.d(t,"S",(function(){return _})),r.d(t,"bb",(function(){return w})),r.d(t,"cb",(function(){return A})),r.d(t,"db",(function(){return x})),r.d(t,"fb",(function(){return O})),r.d(t,"gb",(function(){return k})),r.d(t,"mb",(function(){return s})),r.d(t,"ob",(function(){return n})),r.d(t,"pb",(function(){return u})),r.d(t,"o",(function(){return N})),r.d(t,"p",(function(){return U})),r.d(t,"s",(function(){return q})),r.d(t,"t",(function(){return B})),r.d(t,"u",(function(){return H})),r.d(t,"v",(function(){return W})),r.d(t,"x",(function(){return Q})),r.d(t,"y",(function(){return z})),r.d(t,"z",(function(){return K})),r.d(t,"B",(function(){return G})),r.d(t,"E",(function(){return Y})),r.d(t,"G",(function(){return J})),r.d(t,"H",(function(){return Z})),r.d(t,"J",(function(){return X})),r.d(t,"K",(function(){return ee})),r.d(t,"M",(function(){return te})),r.d(t,"N",(function(){return re})),r.d(t,"P",(function(){return ne})),r.d(t,"Q",(function(){return ie})),r.d(t,"V",(function(){return de})),r.d(t,"W",(function(){return le})),r.d(t,"X",(function(){return se})),r.d(t,"Y",(function(){return ce})),r.d(t,"Z",(function(){return ue})),r.d(t,"ab",(function(){return pe})),r.d(t,"eb",(function(){return fe})),r.d(t,"hb",(function(){return ge})),r.d(t,"jb",(function(){return F})),r.d(t,"kb",(function(){return $})),r.d(t,"lb",(function(){return P})),r.d(t,"nb",(function(){return V})),r.d(t,"f",(function(){return me})),r.d(t,"g",(function(){return ye})),r.d(t,"c",(function(){return he})),r.d(t,"h",(function(){return be})),r.d(t,"ib",(function(){return ve})),r.d(t,"T",(function(){return _e})),r.d(t,"U",(function(){return we}));const n="@timestamp",i="kibana",o=`${i}.alert`,a=`${o}.rule`,s=`${i}.space_ids`,u=`${i}.version`,c=`${o}.action_group`,l=`${o}.case_ids`,d=`${o}.duration.us`,p=`${o}.end`,f=`${o}.flapping`,g=`${o}.flapping_history`,m=`${o}.maintenance_window_ids`,y=`${o}.instance.id`,h=`${o}.last_detected`,b=`${o}.reason`,v=`${o}.start`,_=`${o}.status`,w=`${o}.time_range`,x=`${o}.uuid`,O=`${o}.workflow_status`,k=`${o}.workflow_tags`,E=`${a}.category`,T=`${a}.consumer`,S=`${a}.execution.uuid`,R=`${a}.name`,M=`${a}.parameters`,D=`${a}.producer`,I=`${a}.revision`,j=`${a}.tags`,L=`${a}.rule_type_id`,A=`${o}.url`,C=`${a}.uuid`,F="ecs.version",$="event.action",P="event.kind",V="tags",N=`${o}.risk_score`,U=`${a}.author`,q=`${a}.created_at`,B=`${a}.created_by`,H=`${a}.description`,W=`${a}.enabled`,Q=`${a}.from`,z=`${a}.interval`,K=`${a}.license`,G=`${a}.note`,Y=`${a}.references`,J=`${a}.rule_id`,Z=`${a}.rule_name_override`,X=`${a}.to`,ee=`${a}.type`,te=`${a}.updated_at`,re=`${a}.updated_by`,ne=`${a}.version`,ie=`${o}.severity`,oe=`${o}.suppression`,ae=`${oe}.terms`,se=`${ae}.field`,ue=`${ae}.value`,ce=`${oe}.start`,le=`${oe}.end`,de=`${oe}.docs_count`,pe=`${o}.system_status`,fe=`${o}.workflow_reason`,ge=`${o}.workflow_user`,me=`${o}.evaluation.threshold`,ye=`${o}.evaluation.value`,he=`${o}.context`,be=`${o}.evaluation.values`,ve={APM:"apm",LOGS:"logs",INFRASTRUCTURE:"infrastructure",OBSERVABILITY:"observability",SLO:"slo",SIEM:"siem",UPTIME:"uptime"},_e=(Object.values(ve).map((e=>e)),"active"),we="recovered"},function(e,t,r){"use strict";r.d(t,"d",(function(){return a})),r.d(t,"e",(function(){return s})),r.d(t,"a",(function(){return u})),r.d(t,"c",(function(){return l})),r.d(t,"b",(function(){return f}));var n=r(0),i=(r(7),r(5));const o=e=>""===e;n.brand(n.string,(e=>{return!o(t=e)&&!t.includes(" ")&&!t.split(",").some(o);var t}),"IndexPattern"),new n.Type("JSON",n.any.is,((e,t)=>i.either.chain(n.string.validate(e,t),(r=>{try{return n.success(JSON.parse(r))}catch(r){return n.failure(e,t)}}))),(e=>JSON.stringify(e)));const a=new n.Type("isoToEpochRt",n.number.is,((e,t)=>i.either.chain(n.string.validate(e,t),(r=>{const i=new Date(r).getTime();return isNaN(i)?n.failure(e,t):n.success(i)}))),(e=>new Date(e).toISOString())),s=(new n.Type("ToNumber",n.number.is,((e,t)=>{const r=Number(e);return isNaN(r)?n.failure(e,t):n.success(r)}),n.identity),new n.Type("ToBoolean",n.boolean.is,(e=>{let t;return t="string"==typeof e?"true"===e:!!e,n.success(t)}),n.identity),n.brand(n.string,(e=>e.length>0),"NonEmptyString")),u=e=>n[void 0].pipe(new n.Type("BooleanFromString",n.literal(e).is,((t,r)=>n.success(e)),(()=>{})));var c=r(16);const l=(e,t)=>new n.Type("InRange",(r=>"number"==typeof r&&r>=e&&r<=t),((r,i)=>"number"==typeof r&&r>=e&&r<=t?n.success(r):n.failure(r,i)),n.identity);var d=r(37),p=r.n(d);const f=n.brand(n.string,(e=>p()(e,!0).isValid()),"Date");var g=r(17),m=r.n(g);new n.Type("datemath",n.string.is,((e,t)=>Object(c.pipe)(n.string.validate(e,t),Object(i.chain)((e=>(e=>{const t=m.a.parse(e);return!(!t||!t.isValid())})(e)?n.success(e):n.failure(e,t))))),String),r(24)},function(e,t,r){"use strict";r.d(t,"d",(function(){return s})),r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return l})),r.d(t,"c",(function(){return d})),r.d(t,"e",(function(){return f})),r.d(t,"f",(function(){return y})),r.d(t,"o",(function(){return _})),r.d(t,"n",(function(){return w})),r.d(t,"i",(function(){return x})),r.d(t,"m",(function(){return M})),r.d(t,"k",(function(){return D})),r.d(t,"l",(function(){return I})),r.d(t,"h",(function(){return j})),r.d(t,"g",(function(){return L})),r.d(t,"j",(function(){return B}));var n=r(1),i=r(0),o=r(8);const a=i.type({_shards:i.type({total:i.number,successful:i.number,skipped:i.number,failed:i.number}),timed_out:i.boolean,took:i.number}),s="logs.alert.document.count";let u;i.keyof({count:null,ratio:null}),function(e){e.GT="more than",e.GT_OR_EQ="more than or equals",e.LT="less than",e.LT_OR_EQ="less than or equals",e.EQ="equals",e.NOT_EQ="does not equal",e.MATCH="matches",e.NOT_MATCH="does not match",e.MATCH_PHRASE="matches phrase",e.NOT_MATCH_PHRASE="does not match phrase"}(u||(u={}));const c=i.keyof({[u.GT]:null,[u.GT_OR_EQ]:null,[u.LT]:null,[u.LT_OR_EQ]:null,[u.EQ]:null,[u.NOT_EQ]:null,[u.MATCH]:null,[u.NOT_MATCH]:null,[u.MATCH_PHRASE]:null,[u.NOT_MATCH_PHRASE]:null}),l={[u.GT]:n.i18n.translate("xpack.infra.logs.alerting.comparator.gt",{defaultMessage:"more than"}),[u.GT_OR_EQ]:n.i18n.translate("xpack.infra.logs.alerting.comparator.gtOrEq",{defaultMessage:"more than or equals"}),[u.LT]:n.i18n.translate("xpack.infra.logs.alerting.comparator.lt",{defaultMessage:"less than"}),[u.LT_OR_EQ]:n.i18n.translate("xpack.infra.logs.alerting.comparator.ltOrEq",{defaultMessage:"less than or equals"}),[u.EQ]:n.i18n.translate("xpack.infra.logs.alerting.comparator.eq",{defaultMessage:"is"}),[u.NOT_EQ]:n.i18n.translate("xpack.infra.logs.alerting.comparator.notEq",{defaultMessage:"is not"}),[`${u.EQ}:number`]:n.i18n.translate("xpack.infra.logs.alerting.comparator.eqNumber",{defaultMessage:"equals"}),[`${u.NOT_EQ}:number`]:n.i18n.translate("xpack.infra.logs.alerting.comparator.notEqNumber",{defaultMessage:"does not equal"}),[u.MATCH]:n.i18n.translate("xpack.infra.logs.alerting.comparator.match",{defaultMessage:"matches"}),[u.NOT_MATCH]:n.i18n.translate("xpack.infra.logs.alerting.comparator.notMatch",{defaultMessage:"does not match"}),[u.MATCH_PHRASE]:n.i18n.translate("xpack.infra.logs.alerting.comparator.matchPhrase",{defaultMessage:"matches phrase"}),[u.NOT_MATCH_PHRASE]:n.i18n.translate("xpack.infra.logs.alerting.comparator.notMatchPhrase",{defaultMessage:"does not match phrase"})},d={[u.GT]:">",[u.GT_OR_EQ]:"≥",[u.LT]:"<",[u.LT_OR_EQ]:"≤",[u.EQ]:"=",[u.NOT_EQ]:"≠",[`${u.EQ}:number`]:"=",[`${u.NOT_EQ}:number`]:"≠",[u.MATCH]:n.i18n.translate("xpack.infra.logs.alerting.comparator.symbol.match",{defaultMessage:"matches"}),[u.NOT_MATCH]:n.i18n.translate("xpack.infra.logs.alerting.comparator.symbol.notMatch",{defaultMessage:"does not match"}),[u.MATCH_PHRASE]:n.i18n.translate("xpack.infra.logs.alerting.comparator.symbol.matchPhrase",{defaultMessage:"matches phrase"}),[u.NOT_MATCH_PHRASE]:n.i18n.translate("xpack.infra.logs.alerting.comparator.symbol.notMatchPhrase",{defaultMessage:"does not match phrase"})};let p;!function(e){e[e.OK=0]="OK",e[e.ALERT=1]="ALERT",e[e.NO_DATA=2]="NO_DATA",e[e.ERROR=3]="ERROR"}(p||(p={}));const f=i.type({comparator:c,value:i.number}),g=i.type({field:i.string,comparator:c,value:i.union([i.string,i.number])}),m=i.partial(g.props),y=i.array(g),h=i.array(m),b=i.tuple([y,y]),v=i.tuple([h,h]),_=(i.union([h,v]),i.union([i.literal("s"),i.literal("m"),i.literal("h"),i.literal("d")])),w=i.number,x=i.array(i.string),O=i.type({count:f,timeUnit:_,timeSize:w,logView:o.persistedLogViewReferenceRT}),k=(i.partial(O.props),i.partial({groupBy:x})),E=i.intersection([i.type({criteria:y,...O.props}),i.partial({...k.props})]),T=i.intersection([i.type({criteria:h,...O.props}),i.partial({...k.props})]),S=i.intersection([i.type({criteria:b,...O.props}),i.partial({...k.props})]),R=i.intersection([i.type({criteria:v,...O.props}),i.partial({...k.props})]),M=i.union([E,S]),D=(i.union([T,R]),e=>!!(e.length>0&&Array.isArray(e[0]))),I=e=>D(e.criteria),j=e=>e[0],L=e=>e[1],A=i.type({key:i.number,doc_count:i.number}),C=i.type({hits:i.type({hits:i.array(i.type({fields:i.record(i.string,i.array(i.unknown))}))})}),F=i.partial({histogramBuckets:i.type({buckets:i.array(A)})}),$=i.partial({additionalContext:C}),P=i.type({total:i.type({value:i.number})}),V=i.type({key:i.record(i.string,i.string),doc_count:i.number}),N=i.partial({after_key:i.record(i.string,i.string)}),U=(i.intersection([a,i.intersection([i.type({hits:P}),i.partial({aggregations:i.intersection([F,$])})])]),i.intersection([a,i.type({aggregations:i.type({groups:i.intersection([i.type({buckets:i.array(i.type({...V.props,filtered_results:i.intersection([i.type({doc_count:i.number}),F,$])}))}),N])}),hits:P})])),q=i.intersection([a,i.type({aggregations:i.type({groups:i.intersection([i.type({buckets:i.array(i.intersection([V,F,$]))}),N])}),hits:P})]),B=(i.union([U,q]),(e,t)=>e===u.GT||"number"==typeof t&&e===u.GT_OR_EQ&&t>0)},function(e,t,r){"use strict";r.d(t,"e",(function(){return i})),r.d(t,"d",(function(){return o})),r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return u})),r.d(t,"f",(function(){return l})),r.d(t,"c",(function(){return d}));var n=r(0);const i="metrics.alert.threshold",o="metrics.alert.inventory.threshold";let a,s,u,c;!function(e){e.MetricThreshold="metrics.alert.threshold",e.InventoryThreshold="metrics.alert.inventory.threshold",e.Anomaly="metrics.alert.anomaly"}(a||(a={})),function(e){e.GT=">",e.LT="<",e.GT_OR_EQ=">=",e.LT_OR_EQ="<=",e.BETWEEN="between",e.OUTSIDE_RANGE="outside"}(s||(s={})),function(e){e.COUNT="count",e.AVERAGE="avg",e.SUM="sum",e.MIN="min",e.MAX="max",e.RATE="rate",e.CARDINALITY="cardinality",e.P95="p95",e.P99="p99",e.CUSTOM="custom"}(u||(u={})),function(e){e[e.OK=0]="OK",e[e.ALERT=1]="ALERT",e[e.WARNING=2]="WARNING",e[e.NO_DATA=3]="NO_DATA",e[e.ERROR=4]="ERROR"}(c||(c={})),n.union([n.literal("hosts"),n.literal("k8s")]),n.union([n.literal("memory_usage"),n.literal("network_in"),n.literal("network_out")]),n.type({fieldName:n.string,fieldValue:n.string});const l=Symbol("QUERY_INVALID"),d="/app/metrics/explorer"},function(e,t,r){"use strict";r.d(t,"p",(function(){return n})),r.d(t,"o",(function(){return o})),r.d(t,"a",(function(){return s})),r.d(t,"m",(function(){return u})),r.d(t,"h",(function(){return c})),r.d(t,"j",(function(){return l})),r.d(t,"x",(function(){return f})),r.d(t,"y",(function(){return y})),r.d(t,"w",(function(){return h})),r.d(t,"t",(function(){return b})),r.d(t,"u",(function(){return x})),r.d(t,"e",(function(){return O})),r.d(t,"c",(function(){return k.a})),r.d(t,"d",(function(){return k.b})),r.d(t,"z",(function(){return k.i})),r.d(t,"l",(function(){return k.g})),r.d(t,"k",(function(){return k.f})),r.d(t,"i",(function(){return k.e})),r.d(t,"q",(function(){return k.h})),r.d(t,"f",(function(){return k.c})),r.d(t,"g",(function(){return k.d})),r.d(t,"s",(function(){return M})),r.d(t,"r",(function(){return D})),r.d(t,"n",(function(){return I})),r.d(t,"b",(function(){return j})),r.d(t,"v",(function(){return L}));const n=e=>["started","starting","finished","stopped","failed"].includes(e),i=["kibana_sample_data_logs*"],o=e=>i.includes(e);var a=r(0);const s={critical:"rgb(228, 72, 72)",major:"rgb(229, 113, 0)",minor:"rgb(255, 221, 0)",warning:"rgb(125, 180, 226)"},u=e=>e>=75?"critical":e>=50?"major":e>=25?"minor":e>=3?"warning":void 0,c=e=>Math.round(10*e)/10,l=e=>""!==e?e:"unknown",d=a.keyof({asc:null,desc:null}),p=e=>a.type({field:e,direction:d}),f=a.tuple([a.union([a.string,a.number]),a.union([a.string,a.number])]),g=a.type({searchBefore:f}),m=a.type({searchAfter:f}),y=a.intersection([a.type({pageSize:a.number}),a.partial({cursor:a.union([g,m])})]),h=(a.keyof({"log-entry-rate":null}),["log-entry-rate"]),b=(a.keyof({"log-entry-categories-count":null}),["log-entry-categories-count"]),v=a.type({name:a.string,maximumAnomalyScore:a.number}),_=a.type({startTime:a.number,bucketDuration:a.number,logEntryCount:a.number}),w=a.type({histogramId:a.string,buckets:a.array(_)}),x=a.type({categoryId:a.number,datasets:a.array(v),histograms:a.array(w),logEntryCount:a.number,maximumAnomalyScore:a.number,regularExpression:a.string}),O=p(a.keyof({maximumAnomalyScore:null,logEntryCount:null}));var k=r(59);const E=a.keyof({logRate:null,logCategory:null}),T=a.type({id:a.string,anomalyScore:a.number,dataset:a.string,typical:a.number,actual:a.number,type:E,duration:a.number,startTime:a.number,jobId:a.string}),S=T,R=a.intersection([T,a.type({categoryId:a.string,categoryRegex:a.string,categoryTerms:a.string})]),M=a.union([S,R]),D=a.array(a.string),I=e=>"logCategory"===e.type,j=p(a.keyof({anomalyScore:null,dataset:null,startTime:null})),L=a.type({id:a.string,dataset:a.string,message:a.string,timestamp:a.number,tiebreaker:a.number})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pipeable=t.pipe=void 0;var n=r(24);t.pipe=n.pipe;t.pipeable=function(e){var t={};return function(e){return"function"==typeof e.map}(e)&&(t.map=function(t){return function(r){return e.map(r,t)}}),function(e){return"function"==typeof e.contramap}(e)&&(t.contramap=function(t){return function(r){return e.contramap(r,t)}}),function(e){return"function"==typeof e.mapWithIndex}(e)&&(t.mapWithIndex=function(t){return function(r){return e.mapWithIndex(r,t)}}),function(e){return"function"==typeof e.ap}(e)&&(t.ap=function(t){return function(r){return e.ap(r,t)}},t.apFirst=function(t){return function(r){return e.ap(e.map(r,(function(e){return function(){return e}})),t)}},t.apSecond=function(t){return function(r){return e.ap(e.map(r,(function(){return function(e){return e}})),t)}}),function(e){return"function"==typeof e.chain}(e)&&(t.chain=function(t){return function(r){return e.chain(r,t)}},t.chainFirst=function(t){return function(r){return e.chain(r,(function(r){return e.map(t(r),(function(){return r}))}))}},t.flatten=function(t){return e.chain(t,n.identity)}),function(e){return"function"==typeof e.bimap}(e)&&(t.bimap=function(t,r){return function(n){return e.bimap(n,t,r)}},t.mapLeft=function(t){return function(r){return e.mapLeft(r,t)}}),function(e){return"function"==typeof e.extend}(e)&&(t.extend=function(t){return function(r){return e.extend(r,t)}},t.duplicate=function(t){return e.extend(t,n.identity)}),function(e){return"function"==typeof e.reduce}(e)&&(t.reduce=function(t,r){return function(n){return e.reduce(n,t,r)}},t.foldMap=function(t){var r=e.foldMap(t);return function(e){return function(t){return r(t,e)}}},t.reduceRight=function(t,r){return function(n){return e.reduceRight(n,t,r)}}),function(e){return"function"==typeof e.reduceWithIndex}(e)&&(t.reduceWithIndex=function(t,r){return function(n){return e.reduceWithIndex(n,t,r)}},t.foldMapWithIndex=function(t){var r=e.foldMapWithIndex(t);return function(e){return function(t){return r(t,e)}}},t.reduceRightWithIndex=function(t,r){return function(n){return e.reduceRightWithIndex(n,t,r)}}),function(e){return"function"==typeof e.alt}(e)&&(t.alt=function(t){return function(r){return e.alt(r,t)}}),function(e){return"function"==typeof e.compact}(e)&&(t.compact=e.compact,t.separate=e.separate),function(e){return"function"==typeof e.filter}(e)&&(t.filter=function(t){return function(r){return e.filter(r,t)}},t.filterMap=function(t){return function(r){return e.filterMap(r,t)}},t.partition=function(t){return function(r){return e.partition(r,t)}},t.partitionMap=function(t){return function(r){return e.partitionMap(r,t)}}),function(e){return"function"==typeof e.filterWithIndex}(e)&&(t.filterWithIndex=function(t){return function(r){return e.filterWithIndex(r,t)}},t.filterMapWithIndex=function(t){return function(r){return e.filterMapWithIndex(r,t)}},t.partitionWithIndex=function(t){return function(r){return e.partitionWithIndex(r,t)}},t.partitionMapWithIndex=function(t){return function(r){return e.partitionMapWithIndex(r,t)}}),function(e){return"function"==typeof e.promap}(e)&&(t.promap=function(t,r){return function(n){return e.promap(n,t,r)}}),function(e){return"function"==typeof e.compose}(e)&&(t.compose=function(t){return function(r){return e.compose(r,t)}}),function(e){return"function"==typeof e.throwError}(e)&&(t.fromOption=function(t){return function(r){return"None"===r._tag?e.throwError(t()):e.of(r.value)}},t.fromEither=function(t){return"Left"===t._tag?e.throwError(t.left):e.of(t.right)},t.fromPredicate=function(t,r){return function(n){return t(n)?e.of(n):e.throwError(r(n))}},t.filterOrElse=function(t,r){return function(n){return e.chain(n,(function(n){return t(n)?e.of(n):e.throwError(r(n))}))}}),t}},function(e,t){e.exports=__kbnSharedDeps__.KbnDatemath},function(e,t,r){"use strict";r.d(t,"c",(function(){return u})),r.d(t,"a",(function(){return c})),r.d(t,"d",(function(){return l})),r.d(t,"b",(function(){return d}));var n=r(5),i=r(24),o=r(16),a=r(0);const s=([e,...t])=>{if(void 0===e)return[];if(e.type instanceof a.IntersectionType){const[,...e]=t;return s(e)}if(e.type instanceof a.UnionType){const[,...r]=t;return[e.key,...s(r)]}return[e.key,...s(t)]},u=e=>`Failed to validate: \n${e.map((e=>` ${(e=>{var t;return null!==(t=e.message)&&void 0!==t?t:`in ${s(e.context).join("/")}: ${JSON.stringify(e.value)} does not match expected type ${(({context:e})=>{var t,r,n;return null!==(t=null===(r=e[e.length-1])||void 0===r||null===(n=r.type)||void 0===n?void 0:n.name)&&void 0!==t?t:"unknown"})(e)}`})(e)}`)).join("\n")}`,c=e=>new Error(e),l=e=>t=>{throw e(u(t))},d=(e,t=c)=>r=>Object(o.pipe)(e.decode(r),Object(n.fold)(l(t),i.identity))},function(e,t){e.exports=__kbnSharedDeps__.Rxjs},function(e,t,r){"use strict";r.d(t,"c",(function(){return i})),r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return a})),r.d(t,"d",(function(){return M})),r.d(t,"e",(function(){return D})),r.d(t,"f",(function(){return I}));var n=r(0);const i=n.keyof({host:null,pod:null,container:null,awsEC2:null,awsS3:null,awsSQS:null,awsRDS:null}),o=n.keyof({line:null,area:null,bar:null}),a=(n.keyof({abbreviatedNumber:null,bits:null,bytes:null,number:null,percent:null,highPrecision:null}),n.keyof({hostSystemOverview:null,hostCpuUsage:null,hostFilesystem:null,hostK8sOverview:null,hostK8sCpuCap:null,hostK8sDiskCap:null,hostK8sMemoryCap:null,hostK8sPodCap:null,hostLoad:null,hostMemoryUsage:null,hostNetworkTraffic:null,hostDockerOverview:null,hostDockerInfo:null,hostDockerTop5ByCpu:null,hostDockerTop5ByMemory:null,podOverview:null,podCpuUsage:null,podMemoryUsage:null,podLogUsage:null,podNetworkTraffic:null,containerOverview:null,containerCpuKernel:null,containerCpuUsage:null,containerDiskIOOps:null,containerDiskIOBytes:null,containerMemory:null,containerNetworkTraffic:null,containerK8sOverview:null,containerK8sCpuUsage:null,containerK8sMemoryUsage:null,nginxHits:null,nginxRequestRate:null,nginxActiveConnections:null,nginxRequestsPerConnection:null,awsOverview:null,awsCpuUtilization:null,awsNetworkBytes:null,awsNetworkPackets:null,awsDiskioBytes:null,awsDiskioOps:null,awsEC2CpuUtilization:null,awsEC2NetworkTraffic:null,awsEC2DiskIOBytes:null,awsS3TotalRequests:null,awsS3NumberOfObjects:null,awsS3BucketSize:null,awsS3DownloadBytes:null,awsS3UploadBytes:null,awsRDSCpuTotal:null,awsRDSConnections:null,awsRDSQueriesExecuted:null,awsRDSActiveTransactions:null,awsRDSLatency:null,awsSQSMessagesVisible:null,awsSQSMessagesDelayed:null,awsSQSMessagesSent:null,awsSQSMessagesEmpty:null,awsSQSOldestMessage:null,custom:null})),s=n.keyof({avg:null,max:null,min:null,calculation:null,cardinality:null,series_agg:null,positive_only:null,derivative:null,count:null,sum:null,cumulative_sum:null}),u=n.type({id:n.string,type:n.literal("count")}),c=n.intersection([n.type({id:n.string,type:s}),n.partial({field:n.string})]),l=n.type({field:n.string,id:n.string,name:n.string}),d=n.type({id:n.string,script:n.string,type:n.literal("calculation"),variables:n.array(l)}),p=n.type({id:n.string,field:n.string,unit:n.string,type:n.literal("derivative")}),f=n.type({id:n.string,function:n.string,type:n.literal("series_agg")}),g=n.type({id:n.string,value:n.number}),m=n.intersection([n.type({id:n.string,type:n.literal("percentile"),percentiles:n.array(g)}),n.partial({field:n.string})]),y=n.union([u,c,d,p,m,f]),h=n.intersection([n.type({id:n.string,metrics:n.array(y),split_mode:n.string}),n.partial({terms_field:n.string,terms_size:n.number,terms_order_by:n.string,filter:n.type({query:n.string,language:n.keyof({lucene:null,kuery:null})})})]),b=(n.intersection([n.type({id:a,requires:n.array(n.string),index_pattern:n.union([n.string,n.array(n.string)]),interval:n.string,time_field:n.string,type:n.string,series:n.array(h)}),n.partial({filter:n.string,map_field_to:n.string,id_type:n.keyof({cloud:null,node:null}),drop_last_bucket:n.boolean})]),n.record(n.string,n.union([n[void 0],n.type({field:n.string})]))),v=n.type({percentiles:n.type({field:n.string,percents:n.array(n.number)})}),_=n.type({cardinality:n.partial({field:n.string})}),w=n.type({bucket_script:n.intersection([n.type({buckets_path:n.record(n.string,n.string),script:n.type({source:n.string,lang:n.keyof({painless:null,expression:null})})}),n.partial({gap_policy:n.keyof({skip:null,insert_zeros:null})})])}),x=n.type({cumulative_sum:n.type({buckets_path:n.string})}),O=n.type({derivative:n.type({buckets_path:n.string,gap_policy:n.keyof({skip:null,insert_zeros:null}),unit:n.string})}),k=n.type({sum_bucket:n.type({buckets_path:n.string})}),E=n.type({top_metrics:n.intersection([n.type({metrics:n.union([n.array(n.type({field:n.string})),n.type({field:n.string})])}),n.partial({size:n.number,sort:n.record(n.string,n.union([n.literal("desc"),n.literal("asc")]))})])}),T=n.type({filter:n.type({exists:n.type({field:n.string})}),aggs:n.type({period:n.type({max:n.type({field:n.string})})})}),S=n.recursion("SnapshotModelRT",(()=>n.type({terms:n.type({field:n.string}),aggregations:M}))),R=n.union([b,v,w,x,O,k,S,_,E,T]),M=n.record(n.string,R),D={count:null,cpu:null,diskLatency:null,diskSpaceUsage:null,load:null,memory:null,memoryFree:null,memoryTotal:null,normalizedLoad1m:null,tx:null,rx:null,logRate:null,diskIOReadBytes:null,diskIOWriteBytes:null,s3TotalRequests:null,s3NumberOfObjects:null,s3BucketSize:null,s3DownloadBytes:null,s3UploadBytes:null,rdsConnections:null,rdsQueriesExecuted:null,rdsActiveTransactions:null,rdsLatency:null,sqsMessagesVisible:null,sqsMessagesDelayed:null,sqsMessagesSent:null,sqsMessagesEmpty:null,sqsOldestMessage:null,custom:null},I=n.keyof(D)},function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"c",(function(){return u})),r.d(t,"a",(function(){return c}));var n=r(2),i=r.n(n),o=r(23);const a=(e,t,r)=>Object(o.createKibanaReactContext)({...e,...t,...r}),s=o.useKibana,u=(e,t,r)=>{const{Provider:i}=Object(n.useMemo)((()=>a(e,t,r)),[e,r,t]);return i},c=(e,t)=>i.a.lazy((()=>Promise.all([t(),e.getStartServices()]).then((([{default:e},[t,r,n]])=>{const{Provider:o}=a(t,r,n);return{default:t=>i.a.createElement(o,null,i.a.createElement(e,t))}}))))},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>Number(e).toLocaleString("en",{maximumFractionDigits:1})},function(e,t,r){r.r(t);var n=__kbnBundles__.get("plugin/kibanaReact/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t,r){"use strict";function n(e){return e}function i(e){throw new Error("Called `absurd` function which should be uncallable")}Object.defineProperty(t,"__esModule",{value:!0}),t.bindTo_=t.bind_=t.hole=t.pipe=t.untupled=t.tupled=t.absurd=t.decrement=t.increment=t.tuple=t.flow=t.flip=t.constVoid=t.constUndefined=t.constNull=t.constFalse=t.constTrue=t.constant=t.not=t.unsafeCoerce=t.identity=void 0,t.identity=n,t.unsafeCoerce=n,t.not=function(e){return function(t){return!e(t)}},t.constant=function(e){return function(){return e}},t.constTrue=function(){return!0},t.constFalse=function(){return!1},t.constNull=function(){return null},t.constUndefined=function(){},t.constVoid=function(){},t.flip=function(e){return function(t,r){return e(r,t)}},t.flow=function(e,t,r,n,i,o,a,s,u){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return r(t(e.apply(this,arguments)))};case 4:return function(){return n(r(t(e.apply(this,arguments))))};case 5:return function(){return i(n(r(t(e.apply(this,arguments)))))};case 6:return function(){return o(i(n(r(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(i(n(r(t(e.apply(this,arguments)))))))};case 8:return function(){return s(a(o(i(n(r(t(e.apply(this,arguments))))))))};case 9:return function(){return u(s(a(o(i(n(r(t(e.apply(this,arguments)))))))))}}},t.tuple=function(){for(var e=[],t=0;tu[e]);var u},function(e,t){e.exports=__kbnSharedDeps__.KbnRison},function(e,t,r){"use strict";r.d(t,"h",(function(){return n})),r.d(t,"g",(function(){return i})),r.d(t,"d",(function(){return o})),r.d(t,"j",(function(){return a})),r.d(t,"f",(function(){return s})),r.d(t,"c",(function(){return u})),r.d(t,"a",(function(){return c})),r.d(t,"i",(function(){return l})),r.d(t,"b",(function(){return d})),r.d(t,"e",(function(){return p}));const n="metrics-*,metricbeat-*",i="metrics",o="logs",a="@timestamp",s="message",u="host.name",c="container.id",l="kubernetes.pod.uid",d="discover",p="logs-ui"},function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return a})),r.d(t,"d",(function(){return u})),r.d(t,"e",(function(){return g})),r.d(t,"c",(function(){return b})),r.d(t,"f",(function(){return E}));var n=r(0),i=r(7);const o=["avg","max","min","cardinality","rate","count","sum","p95","p99","custom"],a=["custom","rate","p95","p99"],s=o.reduce(((e,t)=>({...e,[t]:null})),{}),u=n.keyof(s),c=Object(i.xor)(o,a).reduce(((e,t)=>({...e,[t]:null})),{}),l=n.keyof(c),d=n.type({aggregation:u}),p=n.intersection([n.type({name:n.string,aggregation:l}),n.partial({field:n.string,filter:n.string})]),f=n.partial({field:n.union([n.string,n[void 0]]),custom_metrics:n.array(p),equation:n.string}),g=n.intersection([d,f]),m=n.intersection([n.type({from:n.number,to:n.number,interval:n.string}),n.partial({timeFieldName:n.string})]),y=n.type({timerange:m,indexPattern:n.string,metrics:n.array(g)}),h=n.union([n.string,n.null,n[void 0]]),b=n.record(n.string,n.union([n.string,n.null])),v=n.partial({groupBy:n.union([h,n.array(h)]),afterKey:n.union([n.string,n.null,n[void 0],b]),limit:n.union([n.number,n.null,n[void 0]]),filterQuery:n.union([n.string,n.null,n[void 0]]),forceInterval:n.boolean,dropLastBucket:n.boolean}),_=(n.intersection([y,v]),n.type({total:n.number,afterKey:n.union([n.string,n.null,b])})),w=n.keyof({date:null,number:null,string:null}),x=n.type({name:n.string,type:w}),O=n.intersection([n.type({timestamp:n.number}),n.record(n.string,n.union([n.string,n.number,n.null,n[void 0],n.array(n.object)]))]),k=n.intersection([n.type({id:n.string,columns:n.array(x),rows:n.array(O)}),n.partial({keys:n.array(n.string)})]),E=n.type({series:n.array(k),pageInfo:_})},function(e,t,r){r.r(t);var n=__kbnBundles__.get("plugin/kibanaReact/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t,r){"use strict";r.d(t,"g",(function(){return p})),r.d(t,"a",(function(){return f})),r.d(t,"e",(function(){return g})),r.d(t,"b",(function(){return y})),r.d(t,"c",(function(){return b})),r.d(t,"d",(function(){return v})),r.d(t,"f",(function(){return _}));var n=r(12),i=r(0),o=r(20),a=r(42);const s=i.intersection([i.type({value:i.string,label:i.string}),i.partial({ip:i.union([i.string,i.null]),os:i.union([i.string,i.null]),cloudProvider:i.union([i.string,i.null])})]),u=i.partial({value:i.union([i.number,i.null]),avg:i.union([i.number,i.null]),max:i.union([i.number,i.null]),timeseries:a.a}),c=i.type({name:i.union([o.f,i.string])}),l=i.intersection([c,u]),d=i.type({metrics:i.array(l),path:i.array(s),name:i.string}),p=i.intersection([i.type({nodes:i.array(d)}),i.partial({interval:i.string})]),f=i.intersection([i.type({interval:i.string,to:i.number,from:i.number}),i.partial({lookbackSize:i.number,ignoreLookback:i.boolean,forceInterval:i.boolean})]),g=i.array(i.partial({label:i.union([i.string,i.null]),field:i.union([i.string,i.null])})),m=i.type({type:o.f}),y=["avg","max","min","rate"],h=y.reduce(((e,t)=>({...e,[t]:null})),{}),b=i.keyof(h),v=i.intersection([i.type({type:i.literal("custom"),field:i.string,aggregation:b,id:i.string}),i.partial({label:i.string})]),_=i.union([m,v]);i.intersection([i.type({timerange:f,metrics:i.array(_),groupBy:i.union([g,i.null]),nodeType:o.c,sourceId:i.string,includeTimeseries:i.union([i.boolean,Object(n.a)(!0)])}),i.partial({accountId:i.string,region:i.string,filterQuery:i.union([i.string,i.null]),overrideCompositeSize:i.number,dropPartialBuckets:i.boolean})])},function(e,t,r){r.r(t);var n=__kbnBundles__.get("entry/core/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t){e.exports=__kbnSharedDeps__.ReactDom},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0);const i=n.partial({params:n.record(n.string,n.any)}),o=n.intersection([i,n.partial({lang:n.string,options:n.record(n.string,n.string)}),n.type({source:n.string})]),a=n.intersection([i,n.type({id:n.string})]),s=n.union([o,n.string,a]),u=n.keyof({boolean:null,date:null,double:null,geo_point:null,ip:null,keyword:null,long:null}),c=n.intersection([n.partial({format:n.string,script:s}),n.type({type:u})])},function(e,t,r){"use strict";r.d(t,"c",(function(){return u})),r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return l})),r.d(t,"d",(function(){return d}));var n=r(17),i=r.n(n),o=r(5),a=r(16),s=r(0);function u(e){const t=i.a.parse(e);return!(!t||!t.isValid())}const c=new s.Type("datemath",s.string.is,((e,t)=>Object(a.pipe)(s.string.validate(e,t),Object(o.chain)((e=>u(e)?s.success(e):s.failure(e,t))))),String);function l(e,t="down",r){const n=i.a.parse(e,{roundUp:"up"===t,forceNow:r});return n&&n.isValid()?n.valueOf():null}function d(e){var t,r;return{from:null===(t=i.a.parse(e.from))||void 0===t?void 0:t.toISOString(),to:null===(r=i.a.parse(e.to,{roundUp:!0}))||void 0===r?void 0:r.toISOString()}}},function(e,t){e.exports=__kbnSharedDeps__.ElasticEui},function(e,t,r){r.r(t);var n=__kbnBundles__.get("plugin/observabilityShared/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t){e.exports=__kbnSharedDeps__.Moment},function(e,t,r){r.r(t);var n=__kbnBundles__.get("plugin/logsShared/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t,r){"use strict";r.d(t,"d",(function(){return a})),r.d(t,"e",(function(){return u})),r.d(t,"a",(function(){return l})),r.d(t,"f",(function(){return d})),r.d(t,"c",(function(){return p})),r.d(t,"b",(function(){return f}));var n=r(1),i=r(0);const o=i.keyof({gt:null,gte:null,lt:null,lte:null,eq:null}),a={status:n.i18n.translate("xpack.infra.legendControls.palettes.status",{defaultMessage:"Status"}),temperature:n.i18n.translate("xpack.infra.legendControls.palettes.temperature",{defaultMessage:"Temperature"}),cool:n.i18n.translate("xpack.infra.legendControls.palettes.cool",{defaultMessage:"Cool"}),warm:n.i18n.translate("xpack.infra.legendControls.palettes.warm",{defaultMessage:"Warm"}),positive:n.i18n.translate("xpack.infra.legendControls.palettes.positive",{defaultMessage:"Positive"}),negative:n.i18n.translate("xpack.infra.legendControls.palettes.negative",{defaultMessage:"Negative"})},s=i.intersection([i.type({value:i.number,operator:o,color:i.string}),i.partial({label:i.string})]),u=i.type({type:i.literal("step"),rules:i.array(s)}),c=i.type({value:i.number,color:i.string}),l=i.type({type:i.literal("gradient"),rules:i.array(c)}),d=i.type({type:i.literal("steppedGradient"),rules:i.array(c)});let p,f;i.union([u,l,d]),function(e){e.gt="gt",e.gte="gte",e.lt="lt",e.lte="lte",e.eq="eq"}(p||(p={})),function(e){e.number="number",e.abbreviatedNumber="abbreviatedNumber",e.bytes="bytes",e.bits="bits",e.percent="percent"}(f||(f={}))},function(e,t){e.exports=__kbnSharedDeps__.KbnEsQuery},function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return c}));var n=r(22);let i;!function(e){e.bytesDecimal="bytesDecimal",e.bitsDecimal="bitsDecimal",e.abbreviatedNumber="abbreviatedNumber"}(i||(i={}));const o={[i.bytesDecimal]:["B","kB","MB","GB","TB","PB","EB","ZB","YB"],[i.bitsDecimal]:["bit","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],[i.abbreviatedNumber]:["","K","M","B","T"]},a={[i.bytesDecimal]:1e3,[i.bitsDecimal]:1e3,[i.abbreviatedNumber]:1e3},s=e=>t=>{const r=o[e],s=a[e],u=e===i.bitsDecimal?8*t:t,c=Math.min(Math.floor(Math.log(Math.abs(u))/Math.log(s)),r.length-1);return c<0?`${Object(n.a)(u)} ${r[0]}`:`${Object(n.a)(u/Math.pow(s,c))} ${r[c]}`},u={number:n.a,abbreviatedNumber:s(i.abbreviatedNumber),bytes:s(i.bytesDecimal),bits:s(i.bitsDecimal),percent:e=>`${Object(n.a)(100*e)}%`,highPrecision:e=>Number(e).toLocaleString("en",{maximumFractionDigits:5})},c=(e,t="{{value}}")=>r=>{if(null==r)return"";const n=(0,u[e])(Number(r));return t.replace(/{{value}}/g,n)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return g}));var n=r(12),i=r(0),o=r(20),a=r(28);const s=i.intersection([i.type({from:i.number,to:i.number,interval:i.string}),i.partial({timeFieldName:i.string})]),u=i.union([i.string,i.null,i[void 0]]),c=i.type({id:i.string,aggregations:o.d}),l=(i.intersection([i.type({timerange:s,indexPattern:i.string,metrics:i.array(c),includeTimeseries:i.union([i.boolean,Object(n.a)(!0)])}),i.partial({groupBy:i.array(u),modules:i.array(i.string),afterKey:i.union([i.null,a.c]),limit:i.union([i.number,i.null]),filters:i.array(i.UnknownRecord),dropPartialBuckets:i.boolean,alignDataToEnd:i.boolean})]),i.intersection([i.type({afterKey:i.union([i.null,a.c,i[void 0]])}),i.partial({interval:i.number})])),d=i.keyof({date:null,number:null,string:null}),p=i.type({name:i.string,type:d}),f=i.intersection([i.type({timestamp:i.number}),i.record(i.string,i.union([i.string,i.number,i.null,i[void 0],i.array(i.object)]))]),g=i.intersection([i.type({id:i.string,columns:i.array(p),rows:i.array(f)}),i.partial({keys:i.array(i.string)})]),m=i.intersection([g,i.partial({metricsets:i.array(i.string)})]);i.type({series:i.array(m),info:l})},function(e,t){e.exports=__kbnSharedDeps__.RxjsOperators},function(e,t,r){"use strict";const n=r(69),i=r(70),o=r(71);function a(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function s(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function u(e,t){return t.decode?i(e):e}function c(e){return Array.isArray(e)?e.sort():"object"==typeof e?c(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 p(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 f(e,t){a((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 i="string"==typeof r&&r.split("").indexOf(e.arrayFormatSeparator)>-1?r.split(e.arrayFormatSeparator).map((t=>u(t,e))):null===r?r:u(r,e);n[t]=i};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 i of e.split("&")){let[e,a]=o(t.decode?i.replace(/\+/g," "):i,"=");a=void 0===a?null:["comma","separator"].includes(t.arrayFormat)?a:u(a,t),r(u(e,t),a,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]=p(r[e],t);else n[e]=p(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]=c(r):e[t]=r,e}),Object.create(null))}t.extract=d,t.parse=f,t.stringify=(e,t)=>{if(!e)return"";a((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 i=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[s(t,e),"[",i,"]"].join("")]:[...r,[s(t,e),"[",s(i,e),"]=",s(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[s(t,e),"[]"].join("")]:[...r,[s(t,e),"[]=",s(n,e)].join("")];case"comma":case"separator":return t=>(r,n)=>null==n||0===n.length?r:0===r.length?[[s(t,e),"=",s(n,e)].join("")]:[[r,s(n,e)].join(e.arrayFormatSeparator)];default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,s(t,e)]:[...r,[s(t,e),"=",s(n,e)].join("")]}}(t),i={};for(const t of Object.keys(e))r(t)||(i[t]=e[t]);const o=Object.keys(i);return!1!==t.sort&&o.sort(t.sort),o.map((r=>{const i=e[r];return void 0===i?"":null===i?s(r,t):Array.isArray(i)?i.reduce(n(r),[]).join("&"):s(r,t)+"="+s(i,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,n]=o(e,"#");return Object.assign({url:r.split("?")[0]||"",query:f(d(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:u(n,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0},r);const n=l(e.url).split("?")[0]||"",i=t.extract(e.url),o=t.parse(i,{sort:!1}),a=Object.assign(o,e.query);let u=t.stringify(a,r);u&&(u=`?${u}`);let c=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(c=`#${s(e.fragmentIdentifier,r)}`),`${n}${u}${c}`}},function(e,t){e.exports=__kbnSharedDeps__.Uuid},function(e,t,r){"use strict";r.d(t,"d",(function(){return s})),r.d(t,"n",(function(){return c})),r.d(t,"o",(function(){return l})),r.d(t,"e",(function(){return d})),r.d(t,"p",(function(){return p})),r.d(t,"q",(function(){return f})),r.d(t,"a",(function(){return g})),r.d(t,"h",(function(){return y})),r.d(t,"i",(function(){return b})),r.d(t,"f",(function(){return v})),r.d(t,"r",(function(){return _})),r.d(t,"s",(function(){return x})),r.d(t,"g",(function(){return O})),r.d(t,"t",(function(){return k})),r.d(t,"u",(function(){return E})),r.d(t,"c",(function(){return T})),r.d(t,"m",(function(){return S})),r.d(t,"l",(function(){return R})),r.d(t,"b",(function(){return M})),r.d(t,"j",(function(){return D})),r.d(t,"k",(function(){return I}));var n=r(0),i=r(8),o=r(4),a=r(15);const s="/api/infra/log_analysis/results/log_entry_categories",u=n.type({id:n.string,timeRange:o.d,bucketCount:n.number}),c=n.type({data:n.intersection([n.type({categoryCount:n.number,logView:i.persistedLogViewReferenceRT,timeRange:o.d,histograms:n.array(u),sort:a.e}),n.partial({datasets:n.array(n.string)})])}),l=n.intersection([n.type({data:n.type({categories:n.array(a.u)})}),n.partial({timing:o.c})]),d=(n.union([l,o.a,o.b]),"/api/infra/log_analysis/results/log_entry_category_datasets"),p=n.type({data:n.type({logView:i.persistedLogViewReferenceRT,timeRange:o.d})}),f=n.intersection([n.type({data:n.type({datasets:n.array(n.string)})}),n.partial({timing:o.c})]),g=(n.union([f,o.a,o.b]),"/api/infra/log_analysis/results/latest_log_entry_category_datasets_stats"),m=n.keyof({ok:null,warn:null}),y=n.type({data:n.type({jobIds:n.array(n.string),timeRange:o.d,includeCategorizerStatuses:n.array(m)})}),h=n.type({categorization_status:m,categorized_doc_count:n.number,dataset:n.string,dead_category_count:n.number,failed_category_count:n.number,frequent_category_count:n.number,job_id:n.string,log_time:n.number,rare_category_count:n.number,total_category_count:n.number}),b=n.intersection([n.type({data:n.type({datasetStats:n.array(h)})}),n.partial({timing:o.c})]),v="/api/infra/log_analysis/results/log_entry_category_examples",_=n.type({data:n.type({categoryId:n.number,exampleCount:n.number,logView:i.persistedLogViewReferenceRT,timeRange:o.d})}),w=n.type({id:n.string,dataset:n.string,message:n.string,timestamp:n.number,tiebreaker:n.number,context:i.logEntryContextRT}),x=n.intersection([n.type({data:n.type({examples:n.array(w)})}),n.partial({timing:o.c})]),O=(n.union([x,o.a,o.b]),"/api/infra/log_analysis/results/log_entry_examples"),k=n.type({data:n.intersection([n.type({dataset:n.string,exampleCount:n.number,logView:i.persistedLogViewReferenceRT,timeRange:o.d}),n.partial({categoryId:n.string})])}),E=n.intersection([n.type({data:n.type({examples:n.array(a.v)})}),n.partial({timing:o.c})]),T=(n.union([E,o.a,o.b]),"/api/infra/log_analysis/results/log_entry_anomalies"),S=n.intersection([n.type({data:n.intersection([n.type({anomalies:n.array(a.s),hasMoreEntries:n.boolean}),n.partial({paginationCursors:n.type({previousPageCursor:a.x,nextPageCursor:a.x})})])}),n.partial({timing:o.c})]),R=n.type({data:n.intersection([n.type({logView:i.persistedLogViewReferenceRT,timeRange:o.d}),n.partial({pagination:a.y,sort:a.b,datasets:a.r})])}),M="/api/infra/log_analysis/results/log_entry_anomalies_datasets",D=n.type({data:n.type({logView:i.persistedLogViewReferenceRT,timeRange:o.d})}),I=n.intersection([n.type({data:n.type({datasets:n.array(n.string)})}),n.partial({timing:o.c})]);n.union([I,o.a,o.b])},function(e,t,r){"use strict";r.d(t,"c",(function(){return s})),r.d(t,"d",(function(){return c})),r.d(t,"b",(function(){return l})),r.d(t,"a",(function(){return p}));var n=r(0),i=r(5),o=r(10);const a="/api/infra/inventory_views",s=e=>[a,e].filter(Boolean).join("/"),u=new n.Type("InventoryViewId",n.string.is,((e,t)=>i.either.chain(n.string.validate(e,t),(r=>"0"===r?n.failure(e,t,`The inventory view with id ${r} is not configurable.`):n.success(r)))),String),c=(n.type({inventoryViewId:u}),n.partial({sourceId:n.string}),n.type({data:o.g})),l=(n.type({inventoryViewId:n.string}),n.type({data:n.array(o.h)})),d=n.exact(n.intersection([o.f,n.partial({isDefault:n[void 0],isStatic:n[void 0]})])),p=n.type({attributes:d}),f=n.exact(n.intersection([o.f,n.partial({isDefault:n[void 0],isStatic:n[void 0]})]));n.type({attributes:f})},function(e,t,r){"use strict";r.d(t,"c",(function(){return s})),r.d(t,"d",(function(){return c})),r.d(t,"b",(function(){return l})),r.d(t,"a",(function(){return p}));var n=r(0),i=r(5),o=r(9);const a="/api/infra/metrics_explorer_views",s=e=>[a,e].filter(Boolean).join("/"),u=new n.Type("MetricsExplorerViewId",n.string.is,((e,t)=>i.either.chain(n.string.validate(e,t),(r=>"0"===r?n.failure(e,t,`The metrics explorer view with id ${r} is not configurable.`):n.success(r)))),String),c=(n.type({metricsExplorerViewId:u}),n.partial({sourceId:n.string}),n.type({data:o.j})),l=(n.type({metricsExplorerViewId:n.string}),n.type({data:n.array(o.k)})),d=n.intersection([o.i,n.partial({isDefault:n[void 0],isStatic:n[void 0]})]),p=n.type({attributes:d}),f=n.intersection([o.i,n.partial({isDefault:n[void 0],isStatic:n[void 0]})]);n.type({attributes:f})},function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"c",(function(){return o})),r.d(t,"d",(function(){return s})),r.d(t,"b",(function(){return c})),r.d(t,"f",(function(){return d})),r.d(t,"e",(function(){return p})),r.d(t,"g",(function(){return f}));var n=r(0);const i="/api/infra/log_analysis/validation/log_entry_datasets",o=n.type({data:n.type({indices:n.array(n.string),timestampField:n.string,startTime:n.number,endTime:n.number,runtimeMappings:n.UnknownRecord})}),a=n.strict({indexName:n.string,datasets:n.array(n.string)}),s=n.type({data:n.type({datasets:n.array(a)})});var u=r(33);const c="/api/infra/log_analysis/validation/log_entry_rate_indices",l=n.type({name:n.string,validTypes:n.array(n.string)}),d=n.type({data:n.type({fields:n.array(l),indices:n.array(n.string),runtimeMappings:n.record(n.string,u.a)})}),p=n.union([n.type({error:n.literal("INDEX_NOT_FOUND"),index:n.string}),n.type({error:n.literal("FIELD_NOT_FOUND"),index:n.string,field:n.string}),n.type({error:n.literal("FIELD_NOT_VALID"),index:n.string,field:n.string})]),f=n.type({data:n.type({errors:n.array(p)})})},function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"d",(function(){return l})),r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return p}));var n=r(0),i=r(8),o=r(13);const a="/api/infra/log_alerts/chart_preview_data",s=n.type({timestamp:n.number,value:n.number}),u=n.type({id:n.string,points:n.array(s)}),c=n.array(u),l=n.type({data:n.type({series:c})}),d=n.intersection([n.type({criteria:n.union([o.f,n.array(o.f)]),count:n.intersection([n.type({comparator:o.e.props.comparator}),n.partial({value:o.e.props.value})]),timeUnit:o.o,timeSize:o.n}),n.partial({groupBy:o.i})]),p=n.type({data:n.type({logView:i.persistedLogViewReferenceRT,alertParams:d,buckets:n.number,executionTimeRange:n.union([n[void 0],n.type({gte:n.number,lte:n.number})])})})},function(e,t,r){r.r(t);var n=__kbnBundles__.get("plugin/observability/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t,r){r.r(t);var n=__kbnBundles__.get("plugin/embeddable/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t,r){"use strict";r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return g}));var n=r(2),i=r.n(n),o=r(29),a=r(23),s=r(54),u=r(36),c=r(21),l=r(60),d=r(56),p=r(61);const f=({children:e,triggersActionsUI:t,observabilityAIAssistant:r,setHeaderActionMenu:n,appName:a,storage:c,theme$:f})=>{const g=Object(p.a)();return i.a.createElement(d.b,{triggersActionsUI:t},i.a.createElement(o.EuiThemeProvider,{darkMode:g},i.a.createElement(m,{appName:a,storage:c},i.a.createElement(s.ObservabilityAIAssistantProvider,{value:r},i.a.createElement(l.b,{setHeaderActionMenu:n,theme$:f},i.a.createElement(u.NavigationWarningPromptProvider,null,e))))))},g=({children:e,core:t,pluginStart:r,plugins:n,theme$:o})=>{const s=Object(c.c)(t,n,r);return i.a.createElement(s,{services:{...t,...n,...r}},i.a.createElement(t.i18n.Context,null,i.a.createElement(a.KibanaThemeProvider,{theme$:o},e)))},m=({appName:e,children:t,storage:r})=>i.a.createElement(a.KibanaContextProvider,{services:{appName:e,storage:r}},t)},function(e,t,r){r.r(t);var n=__kbnBundles__.get("plugin/observabilityAIAssistant/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t,r){"use strict";var n=r(13);r.d(t,"a",(function(){return n.a})),r.d(t,"b",(function(){return n.b})),r.d(t,"c",(function(){return n.c})),r.d(t,"d",(function(){return n.d})),r.d(t,"e",(function(){return n.k})),r.d(t,"f",(function(){return n.l})),r.d(t,"g",(function(){return n.m}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return o}));var n=r(2);const i=n.createContext({triggersActionsUI:null}),o=e=>n.createElement(i.Provider,{value:{triggersActionsUI:e.triggersActionsUI}},e.children)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(66),i=r(2),o=n.__importDefault(r(72));t.default=function(e,t){var r=i.useState(t),n=r[0],a=r[1];return o.default((function(){var t=e.subscribe(a);return function(){return t.unsubscribe()}}),[e]),n}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);const i=n.type({startTime:n.number,endTime:n.number})},function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return o})),r.d(t,"i",(function(){return a})),r.d(t,"g",(function(){return s})),r.d(t,"f",(function(){return u})),r.d(t,"e",(function(){return c})),r.d(t,"h",(function(){return p})),r.d(t,"c",(function(){return f})),r.d(t,"d",(function(){return g}));var n=r(0);const i=9e5,o="message",a="event.dataset",s=(e,t)=>`kibana-logs-ui-${e}-${t}-`,u=(e,t,r)=>`${s(e,t)}${r}`,c=(e,t,r)=>`datafeed-${u(e,t,r)}`,l=n.union([n.strict({type:n.literal("includeAll")}),n.strict({type:n.literal("includeSome"),datasets:n.array(n.string)})]),d=n.partial({indexPattern:n.string,timestampField:n.string,bucketSpan:n.number,datasetFilter:l}),p=n.partial({job_revision:n.number,logs_source_config:d}),f=(e,t)=>"includeAll"===e.type&&"includeAll"===t.type?{type:"includeAll"}:{type:"includeSome",datasets:[...new Set([..."includeSome"===e.type?e.datasets:[],..."includeSome"===t.type?t.datasets:[]])]},g=(e,t)=>{if("includeAll"===e.type)return e;{const r=e.datasets.filter(t);return r.length>0?{type:"includeSome",datasets:r}:{type:"includeAll"}}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return a}));var n=r(2),i=r.n(n);const o=i.a.createContext({}),a=({setHeaderActionMenu:e,theme$:t,children:r})=>i.a.createElement(o.Provider,{value:{setHeaderActionMenu:e,theme$:t}},r)},function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(57),i=r.n(n),o=r(19),a=r(21);const s={darkMode:!1},u=()=>{var e,t;const{services:r}=Object(a.b)(),{darkMode:n}=i()(null!==(e=null===(t=r.theme)||void 0===t?void 0:t.theme$)&&void 0!==e?e:Object(o.of)(s),s);return n}},function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return d}));var n=r(1),i=r(0),o=r(7),a=r(13);const s=i.type({field:i.array(i.string),comparator:i.array(i.string),value:i.array(i.string)}),u=i.record(i.string,s),c=i.recursion("AlertingError",(()=>i.record(i.string,i.union([i.string,i.array(i.string),c])))),l=i.type({threshold:i.type({value:i.array(i.string)}),criteria:i.record(i.string,u),timeWindowSize:i.array(i.string),timeSizeUnit:i.array(i.string)});function d({count:e,criteria:t,timeSize:r}){const i={errors:{}},s={threshold:{value:[]},criteria:{},timeSizeUnit:[],timeWindowSize:[]};if(i.errors=s,Object(o.isNumber)(null==e?void 0:e.value)||Object(o.isFinite)(null==e?void 0:e.value)||s.threshold.value.push(n.i18n.translate("xpack.infra.logs.alertFlyout.error.thresholdRequired",{defaultMessage:"Numeric threshold value is Required."})),r||s.timeWindowSize.push(n.i18n.translate("xpack.infra.logs.alertFlyout.error.timeSizeRequired",{defaultMessage:"Time size is Required."})),t&&t.length>0){const e=e=>{const t={};return e.forEach(((e,r)=>{t[r]={field:[],comparator:[],value:[]},e.field||t[r].field.push(n.i18n.translate("xpack.infra.logs.alertFlyout.error.criterionFieldRequired",{defaultMessage:"Field is required."})),e.comparator||t[r].comparator.push(n.i18n.translate("xpack.infra.logs.alertFlyout.error.criterionComparatorRequired",{defaultMessage:"Comparator is required."})),void 0!==e.value&&null!==e.value||t[r].value.push(n.i18n.translate("xpack.infra.logs.alertFlyout.error.criterionValueRequired",{defaultMessage:"Value is required."}))})),t};if(Object(a.k)(t)){const r=e(Object(a.h)(t));s.criteria[0]=r;const n=e(Object(a.g)(t));s.criteria[1]=n}else{const r=e(t);s.criteria[0]=r}}return i}},function(e,t,r){"use strict";r.d(t,"b",(function(){return p})),r.d(t,"a",(function(){return y}));var n=r(1),i=r(55),o=r(21),a=r(11);const s=e=>({fields:t})=>{var r;const n=null!==(r=t[a.n])&&void 0!==r?r:"",i=t[a.R],o=null!=i?new Date(i).valueOf():void 0,s=e.getRedirectUrl({time:o});return{reason:n,link:u(s)}},u=e=>{const t=e.indexOf("/app/");return e.substring(t)};var c=r(62);const l=n.i18n.translate("xpack.infra.logs.alerting.threshold.defaultActionMessage",{defaultMessage:"\\{\\{context.reason\\}\\}\n\n\\{\\{rule.name\\}\\} is active.\n\n\\{\\{^context.isRatio\\}\\}\\{\\{#context.group\\}\\}\\{\\{context.group\\}\\} - \\{\\{/context.group\\}\\}\\{\\{context.matchingDocuments\\}\\} log entries have matched the following conditions: \\{\\{context.conditions\\}\\}\\{\\{/context.isRatio\\}\\}\n\\{\\{#context.isRatio\\}\\}\\{\\{#context.group\\}\\}\\{\\{context.group\\}\\} - \\{\\{/context.group\\}\\} Ratio of the count of log entries matching \\{\\{context.numeratorConditions\\}\\} to the count of log entries matching \\{\\{context.denominatorConditions\\}\\} was \\{\\{context.ratio\\}\\}\\{\\{/context.isRatio\\}\\}\n\n[View alert details](\\{\\{context.alertDetailsUrl\\}\\})\n"}),d=n.i18n.translate("xpack.infra.logs.alerting.threshold.defaultRecoveryMessage",{defaultMessage:"\\{\\{rule.name\\}\\} has recovered.\n\n[View alert details](\\{\\{context.alertDetailsUrl\\}\\})\n"});function p(e,t){const a=Object(o.a)(e,(()=>Promise.all([r.e(8),r.e(18)]).then(r.bind(null,550)))),u=Object(o.a)(e,(()=>Promise.all([r.e(6),r.e(10),r.e(19)]).then(r.bind(null,548))));return{id:i.d,description:n.i18n.translate("xpack.infra.logs.alertFlyout.alertDescription",{defaultMessage:"Alert when the log aggregation exceeds the threshold."}),iconClass:"bell",documentationUrl:e=>`${e.links.observability.logsThreshold}`,alertDetailsAppSection:u,ruleParamsExpression:a,validate:c.b,defaultActionMessage:l,defaultRecoveryMessage:d,requiresAppContext:!1,format:s(t)}}var f=r(2),g=r.n(f);const m=g.a.lazy((()=>r.e(20).then(r.bind(null,556)))),y=()=>g.a.createElement(g.a.Suspense,{fallback:g.a.createElement("div",null)},g.a.createElement(m,null))},function(e,t,r){r.r(t);var n=__kbnBundles__.get("plugin/observabilityShared/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t){e.exports=__kbnSharedDeps_npm__},function(e,t){e.exports=__kbnSharedDeps__.TsLib},function(e,t,r){r(68),__kbnBundles__.define("plugin/infra/public",r,74)},function(e,t,r){r.p=window.__kbnPublicPath__.infra},function(e,t,r){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))},function(e,t,r){"use strict";var n="%[a-f0-9]{2}",i=new RegExp("("+n+")|([^%]+?)","gi"),o=new RegExp("("+n+")+","gi");function a(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([],a(r),a(n))}function s(e){try{return decodeURIComponent(e)}catch(n){for(var t=e.match(i)||[],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)]}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),i="undefined"!=typeof window?n.useLayoutEffect:n.useEffect;t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tailRec=void 0,t.tailRec=function(e,t){for(var r=t(e);"Left"===r._tag;)r=t(r.left);return r.right}},function(e,t,r){"use strict";r.r(t),r.d(t,"plugin",(function(){return be})),r.d(t,"FORMATTERS",(function(){return ye.a})),r.d(t,"InfraFormatterType",(function(){return he.b}));var n=r(3),i=r.n(n),o=r(31),a=r(1),s=r(51),u=r(64),c=r(19),l=r(43),d=r(27),p=r(2),f=r.n(p),g=r(14);function m({criteria:e,filterQuery:t}){const r={errors:{}},n={};return r.errors=n,t===g.f&&(n.filterQuery=[a.i18n.translate("xpack.infra.metrics.alertFlyout.error.invalidFilterQuery",{defaultMessage:"Filter query is invalid."})]),e&&e.length?(e.forEach(((e,t)=>{var r;const i=t.toString();n[i]=n[i]||{timeSizeUnit:[],timeWindowSize:[],critical:{threshold0:[],threshold1:[]},warning:{threshold0:[],threshold1:[]},metric:[]},e.threshold&&e.threshold.length||n[i].critical.threshold0.push(a.i18n.translate("xpack.infra.metrics.alertFlyout.error.thresholdRequired",{defaultMessage:"Threshold is required."})),e.warningThreshold&&!e.warningThreshold.length&&n[i].warning.threshold0.push(a.i18n.translate("xpack.infra.metrics.alertFlyout.error.thresholdRequired",{defaultMessage:"Threshold is required."}));for(const t of[{comparator:e.comparator,threshold:e.threshold,type:"critical"},{comparator:e.warningComparator,threshold:e.warningThreshold,type:"warning"}]){const{comparator:e,threshold:r,type:o}=t;r&&r.length&&![...r].every(y)&&[...r].forEach(((e,t)=>{if(!y(e)){const e=0===t?"threshold0":"threshold1";n[i][o][e].push(a.i18n.translate("xpack.infra.metrics.alertFlyout.error.thresholdTypeRequired",{defaultMessage:"Thresholds must contain a valid number."}))}})),e===g.b.BETWEEN&&(!r||r.length<2)&&n[i][o].threshold1.push(a.i18n.translate("xpack.infra.metrics.alertFlyout.error.thresholdRequired",{defaultMessage:"Threshold is required."}))}e.timeSize||n[i].timeWindowSize.push(a.i18n.translate("xpack.infra.metrics.alertFlyout.error.timeRequred",{defaultMessage:"Time size is Required."})),e.metric||n[i].metric.push(a.i18n.translate("xpack.infra.metrics.alertFlyout.error.metricRequired",{defaultMessage:"Metric is required."})),"custom"!==e.metric||null!==(r=e.customMetric)&&void 0!==r&&r.field||n[i].metric.push(a.i18n.translate("xpack.infra.metrics.alertFlyout.error.customMetricFieldRequired",{defaultMessage:"Field is required."}))})),r):r}const y=e=>"number"==typeof e;var h=r(11),b=r(26),v=r(44);const _=(e,t="")=>Object.entries(e).reduce(((e,[r,n])=>{const i=t.length?`${t}.${r}`:r;return"object"==typeof n&&null!=n?Array.isArray(n)&&n.length>0?Object.assign(e,_(n[0],i)):Object.assign(e,_(n,i)):(e[i]=Array.isArray(n)?n:[n],e)}),{}),w=e=>{let t=e;e[h.C]&&(t={...e,..._(e[h.C],h.C)});const r=`${h.C}.nodeType`;let n="/app/metrics/link-to/inventory?";if(t[r]){const e={nodeType:t[r][0],timestamp:Date.parse(t[h.ob]),customMetric:""},i=t[`${h.C}.criteria.metric`][0];if("custom"===i){const r=t[`${h.C}.criteria.customMetric.id`][0],n=t[`${h.C}.criteria.customMetric.aggregation`][0],i=t[`${h.C}.criteria.customMetric.field`][0],o=Object(b.encode)({id:r,type:"custom",field:i,aggregation:n});e.customMetric=o,e.metric=o}else e.metric=Object(b.encode)({type:i});n+=Object(v.stringify)(e)}return n},x=({fields:e})=>{var t;return{reason:null!==(t=e[h.n])&&void 0!==t?t:"-",link:w(e)}},O=a.i18n.translate("xpack.infra.metrics.alerting.inventory.threshold.defaultActionMessage",{defaultMessage:"\\{\\{context.reason\\}\\}\n\n\\{\\{rule.name\\}\\} is active with the following conditions:\n\n- Affected: \\{\\{context.group\\}\\}\n- Metric: \\{\\{context.metric\\}\\}\n- Observed value: \\{\\{context.value\\}\\}\n- Threshold: \\{\\{context.threshold\\}\\}\n\n[View alert details](\\{\\{context.alertDetailsUrl\\}\\})\n"}),k=a.i18n.translate("xpack.infra.metrics.alerting.inventory.threshold.defaultRecoveryMessage",{defaultMessage:"\\{\\{rule.name\\}\\} has recovered.\n\n- Affected: \\{\\{context.group\\}\\}\n- Metric: \\{\\{context.metric\\}\\}\n- Threshold: \\{\\{context.threshold\\}\\}\n\n[View alert details](\\{\\{context.alertDetailsUrl\\}\\})\n"});var E=r(63),T=r(40),S=r(7);const R=/[^A-Z|+|\-|\s|\d+|\.|\(|\)|\/|\*|>|<|=|\?|\:|&|\!|\|]+/g,M=e=>e.aggType===g.a.CUSTOM;function D({criteria:e,filterQuery:t}){const r={errors:{}},n={};return r.errors=n,t===g.f&&(n.filterQuery=[a.i18n.translate("xpack.infra.metrics.alertFlyout.error.invalidFilterQuery",{defaultMessage:"Filter query is invalid."})]),e&&e.length?(e.forEach(((e,t)=>{const r=t.toString();n[r]=n[r]||{aggField:[],timeSizeUnit:[],timeWindowSize:[],critical:{threshold0:[],threshold1:[]},warning:{threshold0:[],threshold1:[]},metric:[],filterQuery:[],customMetrics:{}},e.aggType||n[r].aggField.push(a.i18n.translate("xpack.infra.metrics.alertFlyout.error.aggregationRequired",{defaultMessage:"Aggregation is required."})),e.threshold&&e.threshold.length||n[r].critical.threshold0.push(a.i18n.translate("xpack.infra.metrics.alertFlyout.error.thresholdRequired",{defaultMessage:"Threshold is required."})),e.warningThreshold&&!e.warningThreshold.length&&n[r].warning.threshold0.push(a.i18n.translate("xpack.infra.metrics.alertFlyout.error.thresholdRequired",{defaultMessage:"Threshold is required."}));for(const t of[{comparator:e.comparator,threshold:e.threshold,type:"critical"},{comparator:e.warningComparator,threshold:e.warningThreshold,type:"warning"}]){const{comparator:e,threshold:i,type:o}=t;i&&i.length&&![...i].every(I)&&[...i].forEach(((e,t)=>{if(!I(e)){const e=0===t?"threshold0":"threshold1";n[r][o][e].push(a.i18n.translate("xpack.infra.metrics.alertFlyout.error.thresholdTypeRequired",{defaultMessage:"Thresholds must contain a valid number."}))}})),e===g.b.BETWEEN&&(!i||i.length<2)&&n[r][o].threshold1.push(a.i18n.translate("xpack.infra.metrics.alertFlyout.error.thresholdRequired",{defaultMessage:"Threshold is required."}))}e.timeSize||n[r].timeWindowSize.push(a.i18n.translate("xpack.infra.metrics.alertFlyout.error.timeRequred",{defaultMessage:"Time size is Required."})),"count"===e.aggType||"custom"===e.aggType||e.metric||n[r].metric.push(a.i18n.translate("xpack.infra.metrics.alertFlyout.error.metricRequired",{defaultMessage:"Metric is required."})),M(e)&&(!e.customMetrics||e.customMetrics&&e.customMetrics.length<1?n[r].customMetricsError=a.i18n.translate("xpack.infra.metrics.alertFlyout.error.customMetricsError",{defaultMessage:"You must define at least 1 custom metric"}):e.customMetrics.forEach((e=>{const t={};if(e.aggType||(t.aggType=a.i18n.translate("xpack.infra.metrics.alertFlyout.error.customMetrics.aggTypeRequired",{defaultMessage:"Aggregation is required"})),"count"===e.aggType||e.field||(t.field=a.i18n.translate("xpack.infra.metrics.alertFlyout.error.customMetrics.fieldRequired",{defaultMessage:"Field is required"})),"count"===e.aggType&&e.filter)try{Object(T.fromKueryExpression)(e.filter)}catch(e){t.filter=e.message}Object(S.isEmpty)(t)||(n[r].customMetrics[e.name]=t)})),e.equation&&e.equation.match(R)&&(n[r].equation=a.i18n.translate("xpack.infra.metrics.alertFlyout.error.equation.invalidCharacters",{defaultMessage:"The equation field only supports the following characters: A-Z, +, -, /, *, (, ), ?, !, &, :, |, >, <, ="})))})),r):r}const I=e=>"number"==typeof e,j=({fields:e})=>{var t;return{reason:null!==(t=e[h.n])&&void 0!==t?t:"-",link:g.c}},L=a.i18n.translate("xpack.infra.metrics.alerting.metric.threshold.defaultActionMessage",{defaultMessage:"\\{\\{context.reason\\}\\}\n\n\\{\\{rule.name\\}\\} is active with the following conditions:\n\n- Affected: \\{\\{context.group\\}\\}\n- Metric: \\{\\{context.metric\\}\\}\n- Observed value: \\{\\{context.value\\}\\}\n- Threshold: \\{\\{context.threshold\\}\\}\n\n[View alert details](\\{\\{context.alertDetailsUrl\\}\\})\n"}),A=a.i18n.translate("xpack.infra.metrics.alerting.metric.threshold.defaultRecoveryMessage",{defaultMessage:"\\{\\{rule.name\\}\\} has recovered.\n\n- Affected: \\{\\{context.group\\}\\}\n- Metric: \\{\\{context.metric\\}\\}\n- Threshold: \\{\\{context.threshold\\}\\}\n\n[View alert details](\\{\\{context.alertDetailsUrl\\}\\})\n"}),C=Object(p.lazy)((()=>Promise.all([r.e(0),r.e(1),r.e(5),r.e(23)]).then(r.bind(null,553))));function F(e){return({timerange:t,filterClauseDsl:r,sourceId:n})=>{const[i,o,a]=e();return f.a.createElement(p.Suspense,{fallback:null},f.a.createElement(C,{core:i,plugins:o,pluginStart:a,theme$:i.theme.theme$,sourceId:n||"default",timerange:t,filterClauseDsl:r}))}}const $=Object(p.lazy)((()=>Promise.all([r.e(0),r.e(1),r.e(5),r.e(24)]).then(r.bind(null,554))));function P(e){return({timerange:t,filterClauseDsl:r,sourceId:n})=>{const[i,o,a]=e();return f.a.createElement(p.Suspense,{fallback:null},f.a.createElement($,{core:i,plugins:o,pluginStart:a,theme$:i.theme.theme$,sourceId:n||"default",timerange:t,filterClauseDsl:r}))}}const V=Object(p.lazy)((()=>Promise.all([r.e(0),r.e(1),r.e(5),r.e(25)]).then(r.bind(null,555))));function N(e){return({timerange:t,filterClauseDsl:r,sourceId:n})=>{const[i,o,a]=e();return f.a.createElement(p.Suspense,{fallback:null},f.a.createElement(V,{core:i,plugins:o,pluginStart:a,theme$:i.theme.theme$,sourceId:n||"default",timerange:t,filterClauseDsl:r}))}}var U=r(32),q=r.n(U),B=r(52),H=r(29),W=r(38),Q=r(53),z=r(34);const K="LOG_STREAM_EMBEDDABLE";class log_stream_embeddable_LogStreamEmbeddable extends B.Embeddable{constructor(e,t,r,n,o){var a;super(n,{},o),i()(this,"type",K),i()(this,"node",void 0),i()(this,"subscription",void 0),i()(this,"isDarkMode",!1),this.core=e,this.pluginDeps=t,this.pluginStart=r,this.subscription=new c.Subscription,this.subscription.add(null===(a=e.theme)||void 0===a?void 0:a.theme$.subscribe((e=>this.isDarkMode=e.darkMode))),this.subscription.add(this.getInput$().subscribe((()=>this.renderComponent())))}render(e){this.node&&q.a.unmountComponentAtNode(this.node),this.node=e,this.renderComponent()}destroy(){super.destroy(),this.subscription.unsubscribe(),this.node&&q.a.unmountComponentAtNode(this.node)}async reload(){}renderComponent(){if(!this.node)return;const e=Object(z.b)(this.input.timeRange.from),t=Object(z.b)(this.input.timeRange.to,"up");e&&t&&q.a.render(f.a.createElement(Q.b,{core:this.core,plugins:this.pluginDeps,pluginStart:this.pluginStart,theme$:this.core.theme.theme$},f.a.createElement(H.EuiThemeProvider,{darkMode:this.isDarkMode},f.a.createElement("div",{style:{width:"100%"}},f.a.createElement(W.LogStream,{logView:{type:"log-view-reference",logViewId:"default"},startTimestamp:e,endTimestamp:t,height:"100%",query:this.input.query,filters:this.input.filters})))),this.node)}}class log_stream_embeddable_factory_LogStreamEmbeddableFactoryDefinition{constructor(e){i()(this,"type",K),this.getStartServices=e}async isEditable(){const[{application:e}]=await this.getStartServices();return e.capabilities.logs.save}async create(e,t){const[r,n,i]=await this.getStartServices();return new log_stream_embeddable_LogStreamEmbeddable(r,n,i,e,t)}getDisplayName(){return a.i18n.translate("xpack.infra.logStreamEmbeddable.displayName",{defaultMessage:"Log stream"})}getDescription(){return a.i18n.translate("xpack.infra.logStreamEmbeddable.description",{defaultMessage:"Add a table of live streaming logs."})}getIconType(){return"logsApp"}async getExplicitInput(){return{title:a.i18n.translate("xpack.infra.logStreamEmbeddable.title",{defaultMessage:"Log stream"})}}}const G="LOGS_LOCATOR";class logs_locator_LogsLocatorDefinition{constructor(e){i()(this,"id",G),i()(this,"getLocation",(async e=>{const{createSearchString:t}=await Promise.all([r.e(0),r.e(3)]).then(r.bind(null,542));return{app:"logs",path:`/stream?${t(e)}`,state:{}}})),this.deps=e}}class discover_logs_locator_DiscoverLogsLocatorDefinition{constructor(e){i()(this,"id",G),i()(this,"getLocation",(async e=>{const{getLocationToDiscover:t}=await Promise.all([r.e(0),r.e(3)]).then(r.bind(null,542));return t({core:this.deps.core,...e})})),this.deps=e}}const Y="NODE_LOGS_LOCATOR";class node_logs_locator_NodeLogsLocatorDefinition{constructor(e){i()(this,"id",Y),i()(this,"getLocation",(async e=>{const{createNodeLogsQuery:t,createSearchString:n}=await Promise.all([r.e(0),r.e(3)]).then(r.bind(null,542)),i=t(e);return{app:"logs",path:`/stream?${n({...e,filter:i})}`,state:{}}})),this.deps=e}}class discover_node_logs_locator_DiscoverNodeLogsLocatorDefinition{constructor(e){i()(this,"id",Y),i()(this,"getLocation",(async e=>{const{createNodeLogsQuery:t,getLocationToDiscover:n}=await Promise.all([r.e(0),r.e(3)]).then(r.bind(null,542)),{timeRange:i,logView:o}=e,a=t(e);return n({core:this.deps.core,timeRange:i,filter:a,logView:o})})),this.deps=e}}const J=e=>async()=>{const[t]=await e(),{http:r}=t,n=await r.get("/api/metrics/source/default/hasData");return{hasData:n.hasData,indices:n.configuration.metricAlias}},Z=e=>async({absoluteTime:t,intervalString:r})=>{const[n]=await e(),{http:i}=n,o=async(e={})=>{const{start:n,end:a}=t,s={sourceId:"default",bucketSize:r,size:5,timerange:{from:n,to:a},...e};return{appLink:`/app/metrics/inventory?waffleTime=(currentTime:${a},isAutoReloading:!f)`,series:(await i.post("/api/metrics/overview/top",{body:JSON.stringify(s)})).series,sort:async(e,t)=>o({sort:e,sortDirection:t})}};return await o()};var X=r(6),ee=r(10),te=r(18);class inventory_views_client_InventoryViewsClient{constructor(e){this.http=e}async findInventoryViews(){const e=await this.http.get(Object(X.o)()).catch((e=>{throw new ee.b(`Failed to fetch inventory views: ${e}`)})),{data:t}=Object(te.b)(X.m,(e=>new ee.b(`Failed to decode inventory views: ${e}"`)))(e);return t}async getInventoryView(e){const t=await this.http.get(Object(X.o)(e)).catch((t=>{throw new ee.b(`Failed to fetch inventory view "${e}": ${t}`)})),{data:r}=Object(te.b)(X.H,(t=>new ee.b(`Failed to decode inventory view "${e}": ${t}"`)))(t);return r}async createInventoryView(e){const t=await this.http.post(Object(X.o)(),{body:JSON.stringify(X.k.encode({attributes:e}))}).catch((e=>{var t,r;throw new ee.c(`Failed to create new inventory view: ${null!==(t=null===(r=e.body)||void 0===r?void 0:r.message)&&void 0!==t?t:e.message}`)})),{data:r}=Object(te.b)(X.H,(e=>new ee.c(`Failed to decode newly written inventory view: ${e}"`)))(t);return r}async updateInventoryView(e,t){const r=await this.http.put(Object(X.o)(e),{body:JSON.stringify(X.k.encode({attributes:t}))}).catch((t=>{var r,n;throw new ee.c(`Failed to update inventory view "${e}": ${null!==(r=null===(n=t.body)||void 0===n?void 0:n.message)&&void 0!==r?r:t.message}`)})),{data:n}=Object(te.b)(X.H,(t=>new ee.c(`Failed to decode updated inventory view "${e}": ${t}"`)))(r);return n}deleteInventoryView(e){return this.http.delete(Object(X.o)(e)).then((()=>null)).catch((t=>{throw new ee.a(`Failed to delete inventory view "${e}": ${t}`)}))}}class inventory_views_service_InventoryViewsService{setup(){}start({http:e}){return{client:new inventory_views_client_InventoryViewsClient(e)}}}var re=r(9);class metrics_explorer_views_client_MetricsExplorerViewsClient{constructor(e){this.http=e}async findMetricsExplorerViews(){const e=await this.http.get(Object(X.G)()).catch((e=>{throw new re.b(`Failed to fetch metrics explorer views: ${e}`)})),{data:t}=Object(te.b)(X.n,(e=>new re.b(`Failed to decode metrics explorer views: ${e}"`)))(e);return t}async getMetricsExplorerView(e){const t=await this.http.get(Object(X.G)(e)).catch((t=>{throw new re.b(`Failed to fetch metrics explorer view "${e}": ${t}`)})),{data:r}=Object(te.b)(X.I,(t=>new re.b(`Failed to decode metrics explorer view "${e}": ${t}"`)))(t);return r}async createMetricsExplorerView(e){const t=await this.http.post(Object(X.G)(),{body:JSON.stringify(X.l.encode({attributes:e}))}).catch((e=>{var t,r;throw new re.e(`Failed to create new metrics explorer view: ${null!==(t=null===(r=e.body)||void 0===r?void 0:r.message)&&void 0!==t?t:e.message}`)})),{data:r}=Object(te.b)(X.I,(e=>new re.e(`Failed to decode newly written metrics explorer view: ${e}"`)))(t);return r}async updateMetricsExplorerView(e,t){const r=await this.http.put(Object(X.G)(e),{body:JSON.stringify(X.l.encode({attributes:t}))}).catch((t=>{var r,n;throw new re.e(`Failed to update metrics explorer view "${e}": ${null!==(r=null===(n=t.body)||void 0===n?void 0:n.message)&&void 0!==r?r:t.message}`)})),{data:n}=Object(te.b)(X.I,(t=>new re.e(`Failed to decode updated metrics explorer view "${e}": ${t}"`)))(r);return n}deleteMetricsExplorerView(e){return this.http.delete(Object(X.G)(e)).then((()=>null)).catch((t=>{throw new re.a(`Failed to delete metrics explorer view "${e}": ${t}`)}))}}class metrics_explorer_views_service_MetricsExplorerViewsService{setup(){}start({http:e}){return{client:new metrics_explorer_views_client_MetricsExplorerViewsClient(e)}}}let ne;!function(e){e.HOSTS_VIEW_QUERY_SUBMITTED="Hosts View Query Submitted",e.HOSTS_ENTRY_CLICKED="Host Entry Clicked",e.HOST_FLYOUT_FILTER_REMOVED="Host Flyout Filter Removed",e.HOST_FLYOUT_FILTER_ADDED="Host Flyout Filter Added",e.HOST_VIEW_TOTAL_HOST_COUNT_RETRIEVED="Host View Total Host Count Retrieved",e.ASSET_DETAILS_FLYOUT_VIEWED="Asset Details Flyout Viewed"}(ne||(ne={}));class telemetry_client_TelemetryClient{constructor(e){i()(this,"reportHostEntryClicked",(({hostname:e,cloud_provider:t})=>{this.analytics.reportEvent(ne.HOSTS_ENTRY_CLICKED,{hostname:e,cloud_provider:null!=t?t:"unknown"})})),i()(this,"reportHostFlyoutFilterRemoved",(({field_name:e})=>{this.analytics.reportEvent(ne.HOST_FLYOUT_FILTER_REMOVED,{field_name:e})})),i()(this,"reportHostFlyoutFilterAdded",(({field_name:e})=>{this.analytics.reportEvent(ne.HOST_FLYOUT_FILTER_ADDED,{field_name:e})})),i()(this,"reportHostsViewQuerySubmitted",(e=>{this.analytics.reportEvent(ne.HOSTS_VIEW_QUERY_SUBMITTED,e)})),i()(this,"reportAssetDetailsFlyoutViewed",(e=>{this.analytics.reportEvent(ne.ASSET_DETAILS_FLYOUT_VIEWED,e)})),this.analytics=e}reportHostsViewTotalHostCountRetrieved(e){this.analytics.reportEvent(ne.HOST_VIEW_TOTAL_HOST_COUNT_RETRIEVED,e)}}const ie={eventType:ne.HOSTS_VIEW_QUERY_SUBMITTED,schema:{control_filter_fields:{type:"array",items:{type:"text",_meta:{description:"Selected host control filter.",optional:!1}}},filter_fields:{type:"array",items:{type:"text",_meta:{description:"Applied host search filter.",optional:!1}}},interval:{type:"text",_meta:{description:"Time interval for the performed search.",optional:!1}},with_query:{type:"boolean",_meta:{description:"KQL query search for hosts",optional:!1}},limit:{type:"integer",_meta:{description:"Selected host limit",optional:!1}}}},oe={eventType:ne.HOSTS_ENTRY_CLICKED,schema:{hostname:{type:"keyword",_meta:{description:"Hostname for the clicked host.",optional:!1}},cloud_provider:{type:"keyword",_meta:{description:"Cloud provider for the clicked host.",optional:!0}}}},ae={eventType:ne.HOST_FLYOUT_FILTER_REMOVED,schema:{field_name:{type:"keyword",_meta:{description:"Removed filter field name for the selected host.",optional:!1}}}},se={eventType:ne.HOST_FLYOUT_FILTER_ADDED,schema:{field_name:{type:"keyword",_meta:{description:"Added filter field name for the selected host.",optional:!1}}}},ue={eventType:ne.HOST_VIEW_TOTAL_HOST_COUNT_RETRIEVED,schema:{total:{type:"integer",_meta:{description:"Total number of hosts retrieved.",optional:!1}}}},ce=[{eventType:ne.ASSET_DETAILS_FLYOUT_VIEWED,schema:{componentName:{type:"keyword",_meta:{description:"Hostname for the clicked host.",optional:!1}},assetType:{type:"keyword",_meta:{description:"Cloud provider for the clicked host.",optional:!1}},tabId:{type:"keyword",_meta:{description:"Cloud provider for the clicked host.",optional:!0}}}},ie,oe,ae,se,ue];class telemetry_service_TelemetryService{constructor(e=null){this.analytics=e}setup({analytics:e}){this.analytics=e,ce.forEach((t=>e.registerEventType(t)))}start(){if(!this.analytics)throw new Error("The TelemetryService.setup() method has not been invoked, be sure to call it during the plugin setup.");return new telemetry_client_TelemetryClient(this.analytics)}}var le=r(8);function de(e){return async t=>{const[,{data:r,logsShared:n}]=await e(),i=await n.logViews.client.getResolvedLogView(le.DEFAULT_LOG_VIEW),{stats:o,series:a}=await async function(e,t,r){return new Promise(((n,i)=>{let o;r.search.search({params:{index:e.index,body:{size:0,query:pe(0,t),aggs:fe(0,t)}}}).subscribe((e=>o=e.rawResponse),(e=>i(e)),(()=>{var e;null!==(e=o)&&void 0!==e&&e.aggregations?n(function(e){const t={},r={};return e.stats.buckets.forEach((e=>{const n=e.key;t[e.key]={type:"number",label:n,value:e.doc_count},e.series.buckets.forEach((e=>{r[n]=r[n]||{label:n,coordinates:[]},r[n].coordinates.push({x:e.key,y:e.doc_count})}))})),{stats:t,series:r}}(o.aggregations)):n({stats:{},series:{}})}))}))}({index:i.indices},t,r),s=(t.absoluteTime.end-t.absoluteTime.start)/6e4;return{appLink:`/app/logs/stream?logPosition=(end:${Object(b.encode)(t.relativeTime.end)},start:${Object(b.encode)(t.relativeTime.start)})`,stats:ge(o,s),series:me(a)}}}function pe(e,t){return{range:{[d.j]:{gt:new Date(t.absoluteTime.start).toISOString(),lte:new Date(t.absoluteTime.end).toISOString(),format:"strict_date_optional_time"}}}}function fe(e,t){return{stats:{terms:{field:"event.dataset",size:4,missing:"unknown"},aggs:{series:{date_histogram:{field:d.j,fixed_interval:t.intervalString}}}}}}function ge(e,t){return Object.keys(e).reduce(((r,n)=>(r[n]={...e[n],value:e[n].value/t},r)),{})}function me(e){const t=Object.keys(e),r=t.flatMap((t=>e[t].coordinates.map((e=>e.x)))),[n,i]=[...new Set(r)].sort(),o=(i-n)/6e4;return t.reduce(((t,r)=>(t[r]={...e[r],coordinates:e[r].coordinates.map((e=>e.y?{...e,y:e.y/o}:e))},t)),{})}class plugin_Plugin{constructor(e){i()(this,"config",void 0),i()(this,"inventoryViews",void 0),i()(this,"metricsExplorerViews",void 0),i()(this,"telemetry",void 0),i()(this,"locators",void 0),i()(this,"appTarget",void 0),i()(this,"kibanaVersion",void 0),i()(this,"appUpdater$",new c.BehaviorSubject((()=>({})))),this.config=e.config.get(),this.inventoryViews=new inventory_views_service_InventoryViewsService,this.metricsExplorerViews=new metrics_explorer_views_service_MetricsExplorerViewsService,this.telemetry=new telemetry_service_TelemetryService,this.appTarget=this.config.logs.app_target,this.kibanaVersion=e.env.packageInfo.version}setup(e,t){var n,i,y,h,b;t.home&&((h=t.home).featureCatalogue.register({id:"metrics",title:a.i18n.translate("xpack.infra.registerFeatures.infraOpsTitle",{defaultMessage:"Metrics"}),description:a.i18n.translate("xpack.infra.registerFeatures.infraOpsDescription",{defaultMessage:"Explore infrastructure metrics and logs for common servers, containers, and services."}),icon:"metricsApp",path:"/app/metrics",showOnHomePage:!1,category:"data"}),h.featureCatalogue.register({id:"logs",title:a.i18n.translate("xpack.infra.registerFeatures.logsTitle",{defaultMessage:"Logs"}),description:a.i18n.translate("xpack.infra.registerFeatures.logsDescription",{defaultMessage:"Stream logs in real time or scroll through historical views in a console-like experience."}),icon:"logsApp",path:"/app/logs",showOnHomePage:!1,category:"data"})),t.uiActions.registerTrigger({id:u.ObservabilityTriggerId.LogEntryContextMenu}),t.observability.observabilityRuleTypeRegistry.register({id:g.d,description:a.i18n.translate("xpack.infra.metrics.inventory.alertFlyout.alertDescription",{defaultMessage:"Alert when the inventory exceeds a defined threshold."}),iconClass:"bell",documentationUrl:e=>`${e.links.observability.infrastructureThreshold}`,ruleParamsExpression:f.a.lazy((()=>Promise.all([r.e(0),r.e(2),r.e(4),r.e(15)]).then(r.bind(null,551)))),validate:m,defaultActionMessage:O,defaultRecoveryMessage:k,requiresAppContext:!1,format:x}),t.observability.observabilityRuleTypeRegistry.register({id:g.e,description:a.i18n.translate("xpack.infra.metrics.alertFlyout.alertDescription",{defaultMessage:"Alert when the metrics aggregation exceeds the threshold."}),iconClass:"bell",documentationUrl:e=>`${e.links.observability.metricsThreshold}`,ruleParamsExpression:Object(p.lazy)((()=>Promise.all([r.e(2),r.e(4),r.e(9),r.e(17)]).then(r.bind(null,549)))),validate:D,defaultActionMessage:L,defaultRecoveryMessage:A,requiresAppContext:!1,format:j,alertDetailsAppSection:Object(p.lazy)((()=>Promise.all([r.e(6),r.e(10),r.e(9),r.e(14)]).then(r.bind(null,552))))}),t.observability.dashboard.register({appName:"infra_logs",hasData:(b=e.getStartServices,async()=>{const[,{logsShared:e}]=await b(),t=await e.logViews.client.getResolvedLogView(le.DEFAULT_LOG_VIEW);return{hasData:"available"===(await e.logViews.client.getResolvedLogViewStatus(t)).index,indices:t.indices}}),fetchData:de(e.getStartServices)}),t.observability.dashboard.register({appName:"infra_metrics",hasData:J(e.getStartServices),fetchData:Z(e.getStartServices)}),t.logsShared.logViews.setLogViewsStaticConfig({messageFields:null===(n=this.config.sources)||void 0===n||null===(i=n.default)||void 0===i||null===(y=i.fields)||void 0===y?void 0:y.message});const v=Object(c.combineLatest)([Object(c.from)(e.getStartServices()),e.uiSettings.get$(s.enableInfrastructureHostsView)]),_=[{label:"Inventory",app:"metrics",path:"/inventory"},{label:"Metrics Explorer",app:"metrics",path:"/explorer"},{label:"Hosts",isBetaFeature:!0,app:"metrics",path:"/hosts"}];t.observabilityShared.navigation.registerSections(v.pipe(Object(l.map)((([[{application:{capabilities:e}}]])=>[...e.logs.show?[{label:"Logs",sortKey:200,entries:[{label:"Stream",app:"logs",path:"/stream"},{label:"Anomalies",app:"logs",path:"/anomalies"},{label:"Categories",app:"logs",path:"/log-categories"}]}]:[],...e.infrastructure.show?[{label:"Infrastructure",sortKey:300,entries:_}]:[]])))),t.embeddable.registerEmbeddableFactory(K,new log_stream_embeddable_factory_LogStreamEmbeddableFactoryDefinition(e.getStartServices));let w=t.share.url.locators.create(new logs_locator_LogsLocatorDefinition({core:e})),T=t.share.url.locators.create(new node_logs_locator_NodeLogsLocatorDefinition({core:e}));this.appTarget===d.b&&(w=t.share.url.locators.create(new discover_logs_locator_DiscoverLogsLocatorDefinition({core:e})),T=t.share.url.locators.create(new discover_node_logs_locator_DiscoverNodeLogsLocatorDefinition({core:e})),e.application.register({id:"logs-to-discover",title:"",navLinkStatus:o.AppNavLinkStatus.hidden,appRoute:"/app/logs",mount:async t=>{const[n,,i]=await e.getStartServices(),{renderApp:o}=await r.e(22).then(r.bind(null,540));return o(n,i,t)}})),t.observability.observabilityRuleTypeRegistry.register(Object(E.b)(e,w)),this.appTarget===d.e&&e.application.register({id:"logs",title:a.i18n.translate("xpack.infra.logs.pluginTitle",{defaultMessage:"Logs"}),euiIconType:"logoObservability",order:8100,appRoute:"/app/logs",deepLinks:[{id:"stream",title:a.i18n.translate("xpack.infra.logs.index.streamTabTitle",{defaultMessage:"Stream"}),path:"/stream"},{id:"anomalies",title:a.i18n.translate("xpack.infra.logs.index.anomaliesTabTitle",{defaultMessage:"Anomalies"}),path:"/anomalies"},{id:"log-categories",title:a.i18n.translate("xpack.infra.logs.index.logCategoriesBetaBadgeTitle",{defaultMessage:"Categories"}),path:"/log-categories"},{id:"settings",title:a.i18n.translate("xpack.infra.logs.index.settingsTabTitle",{defaultMessage:"Settings"}),path:"/settings"}],category:o.DEFAULT_APP_CATEGORIES.observability,mount:async t=>{const[n,i,o]=await e.getStartServices(),{renderApp:a}=await Promise.all([r.e(0),r.e(1),r.e(2),r.e(7),r.e(12)]).then(r.bind(null,547));return a(n,i,o,t)}});const S=[{id:"inventory",title:a.i18n.translate("xpack.infra.homePage.inventoryTabTitle",{defaultMessage:"Inventory"}),path:"/inventory"},{id:"metrics-hosts",title:a.i18n.translate("xpack.infra.homePage.metricsHostsTabTitle",{defaultMessage:"Hosts"}),path:"/hosts"},{id:"metrics-explorer",title:a.i18n.translate("xpack.infra.homePage.metricsExplorerTabTitle",{defaultMessage:"Metrics Explorer"}),path:"/explorer"},{id:"settings",title:a.i18n.translate("xpack.infra.homePage.settingsTabTitle",{defaultMessage:"Settings"}),path:"/settings"}];return e.application.register({id:"metrics",title:a.i18n.translate("xpack.infra.metrics.pluginTitle",{defaultMessage:"Infrastructure"}),euiIconType:"logoObservability",order:8200,appRoute:"/app/metrics",category:o.DEFAULT_APP_CATEGORIES.observability,updater$:this.appUpdater$,deepLinks:S,mount:async t=>{const[n,i,o]=await e.getStartServices(),{renderApp:a}=await Promise.all([r.e(0),r.e(1),r.e(2),r.e(6),r.e(4),r.e(7),r.e(13)]).then(r.bind(null,546));return a(n,{...i,kibanaVersion:this.kibanaVersion},o,t)}}),v.subscribe((([e])=>{this.appUpdater$.next((()=>({deepLinks:S})))})),e.application.register({id:"infra",appRoute:"/app/infra",title:"infra",navLinkStatus:3,mount:async e=>{const{renderApp:t}=await r.e(16).then(r.bind(null,541));return t(e)}}),this.telemetry.setup({analytics:e.analytics}),this.locators={logsLocator:w,nodeLogsLocator:T},{locators:this.locators}}start(e,t){const r=()=>[e,t,n],n={inventoryViews:this.inventoryViews.start({http:e.http}),metricsExplorerViews:this.metricsExplorerViews.start({http:e.http}),telemetry:this.telemetry.start(),locators:this.locators,ContainerMetricsTable:F(r),HostMetricsTable:P(r),PodMetricsTable:N(r)};return n}stop(){}}var ye=r(41),he=r(39);const be=e=>new plugin_Plugin(e)},function(e,t){e.exports=__kbnSharedDeps__.KbnI18nReact},function(e,t){e.exports=__kbnSharedDeps__.EmotionReact},function(e,t){e.exports=__kbnSharedDeps__.StyledComponents},function(e,t){e.exports=__kbnSharedDeps__.ElasticCharts},function(e,t){e.exports=__kbnSharedDeps__.ReactRouterDom},function(e,t){e.exports=__kbnSharedDeps__.Classnames},function(e,t,r){r.r(t);var n=__kbnBundles__.get("plugin/kibanaUtils/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t,r){r.r(t);var n=__kbnBundles__.get("plugin/ml/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t,r){r.r(t);var n=__kbnBundles__.get("plugin/data/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t){e.exports=__kbnSharedDeps__.ElasticNumeral},function(e,t){e.exports=__kbnSharedDeps__.ReactQuery},function(e,t,r){r.r(t);var n=__kbnBundles__.get("plugin/kibanaUtils/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t){e.exports=__kbnSharedDeps__.ReactRouterDomV5Compat},function(e,t,r){r.r(t);var n=__kbnBundles__.get("plugin/triggersActionsUi/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t){e.exports=__kbnSharedDeps__.MomentTimezone},function(e,t){e.exports=__kbnSharedDeps__.SaferLodashSet},function(e,t){e.exports=__kbnSharedDeps__.EmotionCache},function(e,t){e.exports=__kbnSharedDeps__.LodashFp},function(e,t,r){r.r(t);var n=__kbnBundles__.get("plugin/data/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t,r){r.r(t);var n=__kbnBundles__.get("plugin/licenseManagement/common/constants");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t){e.exports=__kbnSharedDeps__.ElasticEuiChartsTheme},function(e,t){e.exports=__kbnSharedDeps__.ElasticEuiLibServices},function(e,t,r){r.r(t);var n=__kbnBundles__.get("plugin/unifiedSearch/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t,r){r.r(t);var n=__kbnBundles__.get("plugin/controls/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t){e.exports=__kbnSharedDeps__.ReactQueryDevtools},function(e,t){e.exports=__kbnSharedDeps__.History},function(e,t,r){r.r(t);var n=__kbnBundles__.get("plugin/aiops/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t,r){r.r(t);var n=__kbnBundles__.get("plugin/charts/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t){e.exports=__kbnSharedDeps__.KbnUiTheme}]);