summaryrefslogtreecommitdiffstats
path: root/web/gui/v2/2376.9257ccae3f66af1cac88.chunk.js
blob: d808aedb12fa5467d81b1ba8dc0b39bc9343ca54 (plain)
1
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a60e8cd0-020a-4d19-b225-711746c757f0",e._sentryDebugIdIdentifier="sentry-dbid-a60e8cd0-020a-4d19-b225-711746c757f0")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"0c0a7a41a0e7ecb4870dbce38dbd7d5e0913bb7f"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[2376],{52629:function(e,t,n){n.d(t,{Z:function(){return At}});var r=n(67294),o=n(37518),a=n(96929),i=n(36560),c=n(63346),l=n(29439),u=(n(92222),n(88553)),s=n(91268),d=n(97945),m=n(74059),f=n(74662),p=n(4822),g=n(71181),h=n(59978),v=n(20046),b=n(4942),y=n(87462),E=(n(69826),n(41539),n(47941),n(82526),n(57327),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(92432)),w=n(46667),x=n(53030),O=n(89149),k=n(15861),C=n(64687),I=n.n(C),Z=n(4480),j=n(83338),S=n(8018);function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){(0,b.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var T=(0,Z.CG)({key:"roomSettings",get:function(e){var t=e.id,n=e.key;return function(e){var r=(0,e.get)((0,j.Z)(t));return n?r[n]:r}},set:function(e){var t=e.id,n=e.key;return function(e,r){(0,e.set)((0,j.Z)(t),(function(e){return n?N(N({},e),{},(0,b.Z)({},n,r)):r}))}}}),D=function(e,t){return(0,Z.sJ)(T({id:e,key:t}))},M=function(e,t){var n=D(e,t),r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.key,r=t.shouldPersist,o=void 0===r||r,a=(0,Z.Zl)(T({id:e,key:n})),i=(0,S.O9)(e);return(0,Z._8)((function(t){var r=t.snapshot;return function(){var t=(0,k.Z)(I().mark((function t(c){var l;return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a(c),o){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,r.getPromise(T({id:e}));case 5:return l=t.sent,t.prev=6,t.next=9,i({settings:N(N({},l),n?(0,b.Z)({},n,c):c)});case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(6),a(n?l[n]:l);case 14:case"end":return t.stop()}}),t,null,[[6,11]])})));return function(e){return t.apply(this,arguments)}}()}),[e,n,i])}(e,{key:t});return[n,r]},B=n(45987),F=(n(21249),n(57640),n(9924),n(16645)),A=n(7693),_=n(92903),L=n(5429),R=n(29495),V=n(40970),z=n(89479),K=function(){},G=function(e){var t=e.roomId,n=e.id,a=e.onRemove,i=void 0===a?K:a,c=(0,o.tE)(t,"name"),u=(0,R.xQ)(t,n,"title"),s=(0,R.c0)(t),d=(0,w.Z)(),m=(0,l.Z)(d,4),f=m[0],p=m[2],g=m[3],v=function(){var e=(0,k.Z)(I().mark((function e(){return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s(n);case 2:i();case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return r.createElement(r.Fragment,null,r.createElement(h.Button,{danger:!0,flavour:"hollow",onClick:p,label:"Delete metric","data-testid":"remove-metric"}),f&&r.createElement(h.ConfirmationDialog,{"data-ga":"remove-metric-dialog","data-testid":"removeMetricDialog",handleConfirm:v,handleDecline:g,message:r.createElement(r.Fragment,null,"You are about to remove ",r.createElement("strong",null,u)," metric.",r.createElement("br",null),"Are you sure you want to continue?"),title:"Remove metric from ".concat(c)}))},H=["title","help","link","disclaimer","children"],U=function(e){var t=e.link,n=e.children;return r.createElement(h.Flex,{as:"a",target:"_blank",href:t,gap:1,alignItems:"end"},r.createElement(h.TextNano,{textDecoration:"undeline"},n),r.createElement(h.Icon,{color:"text",name:"question",width:"16px",height:"16px"}))},W=function(e){var t=e.title,n=e.help,o=e.link,a=e.disclaimer,i=e.children,c=(0,B.Z)(e,H);return r.createElement(h.Flex,(0,y.Z)({gap:1,column:!0},c),r.createElement(h.Flex,{justifyContent:"between",alignItems:"baseline"},r.createElement(h.Text,{as:"label",margin:[0]},t),n&&r.createElement(U,{link:o},n)),i,a&&r.createElement(h.TextSmall,null,a))},q=n(93433),Q=n(26398),J=n(62200),X={value:"all",label:"All"},Y=function(e){var t=e.dimensions,n=e.units;return{dimensions:t?[X].concat((0,q.Z)(t.map((function(e){return{value:e.id,label:e.name}})))):[X],units:n}},$=["spaceId","roomId","id","onClose"];function ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function te(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(n),!0).forEach((function(t){(0,b.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ee(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ne=function(e){var t=e.isNew;return r.createElement(h.Flex,{as:"span",gap:1},"Manage room",r.createElement(h.TextBig,{color:"textLite"},"/"),r.createElement(h.TextBig,{color:"textLite"},t?"Add":"Edit"," Metric"))},re=function(e){var t=e.spaceId,n=e.roomId,o=e.id,a=e.onClose,i=(0,B.Z)(e,$),c="new"===o,u=(0,R.jN)(n,o),s=(0,R.Y6)(n,{shouldPersist:!1}),d=(0,R.xQ)(n,o),m=(0,r.useRef)(d),f=d.title,g=d.context,v=d.dimensions,b=void 0===v?[]:v,E=function(){s(o,m.current),a()};(0,r.useEffect)((function(){c&&u()}),[]);var w=(0,p.TA)({extraKey:"nodesView"}),x=(0,V.Z)(n,w,{spaceId:t});if(x)throw x;var O=(0,z.jg)(n),k=(0,r.useMemo)((function(){return O.map((function(e){return{value:e,label:e}}))}),[O]),C=(0,z.hH)(n),I=(0,r.useMemo)((function(){return g&&{value:g,label:g}}),[g]),Z=(0,L.Z)((function(){return{enabled:!!g,fetch:function(){return function(e,t,n){return Q.Z.get("".concat(J.li,"/spaces/").concat(e,"/rooms/").concat(t,"/contexts/").concat(encodeURIComponent(n)),{transform:Y})}(t,n,g)},initialValue:{dimensions:[],units:""}}}),[t,n,g]),j=(0,l.Z)(Z,2),S=j[0],P=S.dimensions,N=S.units,T=j[1],D=(0,r.useCallback)((function(e){var t=e.value;s(o,"context",t),s(o,"dimensions",[]),s(o,"title",t)}),[o]),M=(0,r.useMemo)((function(){return P?1===P.length||b.length===P.length-1||0===b.length?[X]:b.map((function(e){return{value:e.id,label:e.name}})):[X]}),[b,P]),K=(0,r.useCallback)((function(e){var t=e.filter((function(e){return e.value!==X.value})),n=(0===e.length||t.length!==e.length&&0!==b.length||t.length===P.length-1?[]:t).map((function(e){return{id:e.value,name:e.label}}));s(o,"dimensions",n)}),[o,b,P]),H=(0,R.VP)(n),U=(0,r.useCallback)((function(){return H(te(te({},d),{},{id:o,enableAllDimensions:0===b.length,unit:N})).then(a)}),[d]),q=(0,r.useCallback)((function(e){var t=e.target.value;t.length<=30&&s(o,"title",t)}),[o]),ee=!f||!g||T||!C;return r.createElement(F.u6,(0,y.Z)({right:!0,closeOnEsc:!0,closeOnOverlayClick:!0,onClose:E},i),r.createElement(A.x,{onClose:E,title:r.createElement(ne,{isNew:c})},r.createElement(h.Button,{label:"Save",onClick:U,disabled:ee})),r.createElement(_.B,null,c?"Add a new metric (column)":"Edit metric"),r.createElement(F.TZ,null,r.createElement(h.Flex,{gap:6,column:!0},r.createElement(W,{title:"Context",help:"What is a context?",link:"https://learn.netdata.cloud/docs/data-collection/chart-dimensions-contexts-and-families#context","data-testid":"manageMetrics-context"},r.createElement(h.Select,{options:k,value:I,onChange:D,isLoading:!C,"data-testid":"manageMetrics-contextSelect"})),r.createElement(W,{title:"Metric Title","data-testid":"manageMetrics-title"},r.createElement(h.TextInput,{name:"title",placeholder:"Type name",value:f,onChange:q,metaShrinked:!0})),r.createElement(W,{title:"Dimensions",help:"What is a dimension?",link:"https://learn.netdata.cloud/docs/data-collection/chart-dimensions-contexts-and-families#dimension",disclaimer:M[0]===X&&"The returned value is the sum of all selected dimensions.","data-testid":"manageMetrics-dimensions"},r.createElement(h.Select,{isMulti:!0,options:P,value:M,onChange:K,isLoading:T,isDisabled:!I,"data-testid":"manageMetrics-dimensionSelect"})),!c&&r.createElement(h.Flex,{justifyContent:"end"},r.createElement(G,{roomId:n,id:o,onRemove:a})))))},oe=n(71893),ae=(0,oe.default)(h.Checkbox).withConfig({displayName:"styled__Checkbox",componentId:"sc-1czrg41-0"})(["color:",";font-size:12px;margin-left:",";width:100%;> span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:",";}"],(0,h.getColor)("text"),(0,h.getSizeBy)(0),(0,h.getSizeBy)(25)),ie=(0,oe.default)(h.Flex).attrs({height:"1px",margin:[4,0]}).withConfig({displayName:"styled__Divider",componentId:"sc-1czrg41-1"})(["background-color:rgba(0,0,0,0.12);"]),ce=(0,oe.default)(h.ListItem).withConfig({displayName:"styled__ListItem",componentId:"sc-1czrg41-2"})(["align-items:center;display:flex;flex-direction:row;font-size:",";justify-content:space-between;padding-left:",";"],(0,h.getSizeBy)(3),(0,h.getSizeBy)(0)),le=(0,oe.default)(h.Drop).attrs({align:{top:"bottom",right:"right"},animation:!0,background:"dropdown",column:!0,margin:[.5,0,0],overflow:{vertical:"auto"},padding:[4],round:1,width:70}).withConfig({displayName:"styled__MetricsDropdown",componentId:"sc-1czrg41-3"})(["box-sizing:content-box;"]),ue=(0,oe.default)(h.Button).attrs({neutral:!0,flavour:"borderless",small:!0}).withConfig({displayName:"styled__OptionButton",componentId:"sc-1czrg41-4"})(["&&&{font-size:14px;font-weight:normal;justify-content:flex-start;padding-left:",";}"],(0,h.getSizeBy)(2)),se=(0,oe.default)(h.Button).withConfig({displayName:"styled__PencilButton",componentId:"sc-1czrg41-5"})(["> svg.button-icon{width:",";height:",";opacity:0;}"],(0,h.getSizeBy)(4),(0,h.getSizeBy)(4)),de=(0,oe.default)(h.Button).withConfig({displayName:"styled__MetricsButton",componentId:"sc-1czrg41-6"})(["&&&{width:100%;}"]),me=function(e){var t=e.isOpen,n=e.onClose,o=e.onEdit,a=e.roomId,i=e.targetRef,c=(0,R.dh)(a),u=(0,l.Z)(c,2),s=u[0],d=u[1];if(!i.current||!t)return null;var m=function(e){o(e),n()};return r.createElement(le,{close:n,"data-testid":"metricsMenu",onClickOutside:n,onEsc:n,target:i.current},s.map((function(e){return r.createElement(ce,{"data-testid":"metricsMenu-metric-".concat(e.title),key:e.id},r.createElement(ae,{checked:!e.hidden,"data-testid":"metricsMenu-metricCheckbox",label:e.title,onChange:function(){return d(e.id,"hidden",!e.hidden)}}),r.createElement(se,{"data-testid":"metricsMenu-editMetric",flavour:"borderless",icon:"pencilSolid",neutral:!0,onClick:function(){return m(e.id)}}))})),s.length>0&&r.createElement(ie,{"data-testid":"metricsMenu-divider"}),r.createElement(ce,{"data-testid":"metricsMenu-addMetricItem"},r.createElement(de,{"data-testid":"metricsMenu-addMetricButton",label:"Add new metric",icon:"plus",onClick:function(){return m("new")},small:!0})))},fe=function(e){var t=e.spaceId,n=e.roomId,o=(0,w.Z)(),a=(0,l.Z)(o,4),i=a[0],c=a[2],u=a[3],s=(0,r.useState)(null),d=(0,l.Z)(s,2),m=d[0],f=d[1],p=(0,r.useRef)();return r.createElement(r.Fragment,null,r.createElement(h.Button,{"data-ga":"metric-setting::click-metric-setting::hm-nodes","data-testid":"metricSettings-button",flavour:"hollow",icon:"gear",neutral:!0,onClick:c,ref:p,label:"Metrics",small:!0}),r.createElement(me,{isOpen:i,onClose:u,onEdit:f,roomId:n,targetRef:p}),m&&r.createElement(re,{"data-testid":"metricsManagement",spaceId:t,roomId:n,id:m,onClose:function(){return f(null)}}))},pe=n(38671),ge=n(39979);function he(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?he(Object(n),!0).forEach((function(t){(0,b.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):he(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var be=function(){return(0,E.L)("grouping","click-grouping","hm-nodes")},ye=(0,ge.Z)(x.Z),Ee=[{icon:"node",label:"Node status",value:"nodeStatus","data-ga":"grouping::click-grouping-node-status::hm-nodes"},{icon:"alarm_bell",label:"Alert status",value:"alertStatus","data-ga":"grouping::click-grouping-status::hm-nodes"}],we={Option:function(e){var t=e.innerProps,n=e.data,o=e.isSelected;return r.createElement(ue,(0,y.Z)({},n,t,{active:o}))}},xe={control:function(e){return ve(ve({},e),{},{height:32,minHeight:32,width:160})},indicatorSeparator:function(){return{display:"none"}},dropdownIndicator:function(e){return ve(ve({},e),{},{height:20,minHeight:20,paddingRight:4,paddingTop:0,paddingBottom:0})},valueContainer:function(e){return ve(ve({},e),{},{paddingTop:0,paddingBottom:0})}},Oe=function(){var e=(0,m.th)(),t=(0,o.UL)(),n=(0,w.Z)(),a=(0,l.Z)(n,4),i=a[0],c=a[2],u=a[3],s=(0,pe.Z)().onIntegrationsClick,d=M(t,"groupMode"),f=(0,l.Z)(d,2),p=f[0],g=f[1],v=(0,r.useMemo)((function(){return Ee.find((function(e){return e.value===p}))||Ee[0]}),[p]),b=(0,r.useCallback)((function(e){var t=e.value;return g(t)}),[g]);return r.createElement(h.Flex,{alignItems:"center","data-testid":"agentsHead-actions",flexWrap:!1,gap:3},r.createElement(h.Select,{components:we,label:"Group by",onChange:b,onMenuOpen:be,options:Ee,styles:xe,value:v}),r.createElement(fe,{roomId:t,spaceId:e}),r.createElement(h.Button,{icon:"integrations",flavour:"hollow",onClick:s,small:!0},"Integrations"),i&&r.createElement(O.Z,{onClose:u}),r.createElement(ye,{"data-ga":"add-nodes::click-add-nodes::hm-nodes","data-testid":"agentsHead-addNode",icon:"nodes_hollow",label:"Add Nodes",onClick:c,small:!0}))},ke=function(){return r.createElement(h.Flex,{width:"100%",justifyContent:"between",background:"mainBackground",padding:[0,2]},r.createElement(v.Z,null),r.createElement(h.Box,{padding:[2,0],sx:{marginLeft:"auto"}},r.createElement(Oe,null)))},Ce=(n(2707),n(66992),n(70189),n(78783),n(88921),n(96248),n(13599),n(11477),n(64362),n(15389),n(90401),n(45164),n(91238),n(54837),n(87485),n(56767),n(76651),n(61437),n(35285),n(39865),n(33948),n(85827),n(25387),n(72608),n(39612)),Ie=n(88866);function Ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(n),!0).forEach((function(t){(0,b.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ze(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Se,Pe=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getGrouping,o=n.extraKey,a={},i=function(e,t){var n=t.getNode,r=t.getGrouping,o=t.nodeMenus,a={};return e.forEach((function(e){var t=n(e);if(t){var a=r(t),i=a.name,c=a.priority,l=a.icon;o[e]=je(je({},t),{},{groupId:i,subMenuId:e,priority:c,groupIcon:l})}})),(0,q.Z)(e).sort((function(e,t){var n,r,a,i;return(null===(n=o[e])||void 0===n?void 0:n.priority)-(null===(r=o[t])||void 0===r?void 0:r.priority)||((null===(a=o[e])||void 0===a?void 0:a.name)||"").localeCompare((null===(i=o[t])||void 0===i?void 0:i.name)||"",void 0,{sensitivity:"accent"})})).forEach((function(e){var t=o[e];if(t){var n="".concat(t.groupId,"|").concat(t.subMenuId);a[t.groupId]||(a[t.groupId]=new Set),n&&a[t.groupId].add(t.id)}})),{menuGroups:a}}(e,{getNode:t,getGrouping:r,nodeMenus:a}),c=i.menuGroups,l={},u=Object.keys(c).reduce((function(e,t){var n=(0,q.Z)(c[t]),r=a[n[0]];return e[t]={level:0,name:r.groupId,id:t,subMenuIds:n,link:"".concat((0,Ce.Z)("menu_".concat(t))),size:24,forceVisibility:!0,icon:r.groupIcon,extraKey:o},n.forEach((function(e){var n,r,i,c,u=a[e];l[e]=je(je({},u),{},{level:1,id:e,menuGroupId:t,link:"".concat((0,Ce.Z)("menu_".concat(t,"_submenu_").concat(e))),size:24,forceVisibility:!0,icon:(null===(n=Ie._[null===(r=u.os)||void 0===r?void 0:r.nm])||void 0===n?void 0:n.iconName)||(null===(i=Ie.V[null===(c=u.os)||void 0===c?void 0:c.id])||void 0===i?void 0:i.iconName)||"os",extraKey:o})})),e}),{}),s=Object.keys(c),d=s.reduce((function(e,t){1;var n=je(je({},u[t]),{},{sticky:!0});return[].concat((0,q.Z)(e),[n],(0,q.Z)(u[t].subMenuIds.reduce((function(e,t){1;var n=l[t];return[].concat((0,q.Z)(e),[n])}),[])))}),[]);return a=null,{stickyIds:{},allElements:d,menuGroupIds:s,menuGroupById:u,subMenuById:l}},Ne=n(62340),Te=n(22965),De={alertStatus:(Se={},(0,b.Z)(Se,Ne.Z.critical,1),(0,b.Z)(Se,Ne.Z.warning,2),(0,b.Z)(Se,Ne.Z.clear,3),(0,b.Z)(Se,Ne.Z.unreachable,4),Se),nodeStatus:{Live:1,Stale:2,Offline:3}},Me={nodeStatus:function(e){return(0,Te.Q5)(e.state)},alertStatus:function(e){return(0,Te.hC)(e)}},Be=n(15394),Fe=n(53499),Ae=n(69743),_e=n(56102),Le=n(11835),Re=["id"],Ve=function(e){var t=e.id,n=(0,B.Z)(e,Re);return r.createElement(Ae.d,(0,y.Z)({id:t},n),r.createElement(_e.Y,{id:t}),r.createElement(Le.f,{id:t}))},ze=(0,r.memo)(Ve),Ke=n(3322),Ge=n(24093),He=n(33335),Ue=n(6585),We=n(97279),qe=(0,oe.default)(h.Button).attrs({flavour:"hollow",neutral:!0,tiny:!0}).withConfig({displayName:"styled__ActionButton",componentId:"sc-31e37b-0"})(["&&&{border-color:",";&:hover{background-color:",";}.button-icon{"," fill:",";}}"],(0,h.getColor)("nodeBadgeBorder"),(0,h.getColor)("nodeBadgeBackground"),(function(e){var t=e.iconSize;return t&&"\n      height: ".concat(t,";\n      width: ").concat(t,";\n      ")}),(0,h.getColor)("textDescription")),Qe=(0,oe.default)(qe).attrs({icon:"trashcan",iconSize:"15px"}).withConfig({displayName:"styled__ObsoleteButton",componentId:"sc-31e37b-1"})([""]),Je=(0,oe.default)(qe).attrs({icon:"removeNode"}).withConfig({displayName:"styled__RemoveButton",componentId:"sc-31e37b-2"})([""]),Xe=(0,oe.default)(h.Box).attrs({background:"placeholder",height:4,width:.25}).withConfig({displayName:"styled__InfoSeparator",componentId:"sc-31e37b-3"})([""]),Ye=(0,oe.default)(h.Flex).withConfig({displayName:"styled__NodeActions",componentId:"sc-31e37b-4"})(["display:none;"]),$e=(0,oe.default)(h.Flex).attrs({alignItems:"center",gap:1}).withConfig({displayName:"styled__NodeNameContainer",componentId:"sc-31e37b-5"})(["&:hover{h5{color:#00ab44;text-decoration:underline;text-decoration-color:#00ab44;}svg{fill:#00ab44;}}"]),et=(0,oe.default)(h.H5).attrs((function(e){var t=e.isLive;return{cursor:t?"pointer":"auto",color:t?"text":"textDescription"}})).withConfig({displayName:"styled__NodeName",componentId:"sc-31e37b-6"})([""]),tt=["connectivity","id","name"],nt=function(e){var t=e.connectivity,n=e.id,a=e.name,i=(0,B.Z)(e,tt),c=(0,He.gI)("node:Delete"),u=!(0,o.Hm)().untouchable,s=(0,w.Z)(),d=(0,l.Z)(s,4),m=d[0],f=d[2],p=d[3],g=(0,w.Z)(),h=(0,l.Z)(g,4),v=h[0],b=h[2],E=h[3];return r.createElement(Ye,(0,y.Z)({alignSelf:"end",gap:1,"data-testid":"node-actions"},i),u&&r.createElement(r.Fragment,null,r.createElement(Ge.Z,{badge:"actionRemove","data-testid":"remove-node-action"},r.createElement(Je,{"data-ga":"nodes-table-row::click-remove-node::nodes-view",onClick:b})),v&&r.createElement(We.ZP,{ids:[n],name:a,onClose:E})),c&&"Offline"===t&&r.createElement(r.Fragment,null,r.createElement(Ge.Z,{badge:"actionObsolete","data-testid":"obsolete-node-action"},r.createElement(Qe,{"data-ga":"nodes-table-row::click-obsolete-node::nodes-view",onClick:f})),m&&r.createElement(Ue.ZP,{ids:[n],name:a,onClose:p})))},rt=n(56001),ot=["instanceType","name","providerType"],at=function(e){var t=e.instanceType,n=e.name,o=e.providerType,a=(0,B.Z)(e,ot);return r.createElement(Ge.Z,(0,y.Z)({badge:"cloudInfo","data-testid":"node-cloud-info",nodeName:n},a),r.createElement(h.Flex,{alignItems:"center",gap:1},r.createElement(h.Icon,{color:"textDescription","data-testid":"node-cloud-info-icon",name:"ipNetworking",width:"18px",height:"18px"}),r.createElement(h.TextSmall,{color:"textDescription","data-testid":"node-cloud-info-text"},(0,Te.MC)(o)," \u2022 ",(0,Te.MC)(t))))},it=["connectivity","name"],ct=function(e){var t=e.connectivity,n=e.name,o=(0,B.Z)(e,it);return r.createElement(Ge.Z,(0,y.Z)({badge:"connectivity",connectivityState:t,"data-testid":"node-connectivity",nodeName:n},o),r.createElement(h.Icon,{name:"connectivityStatus".concat(t),width:"18px",height:"18px"}))},lt=["onClick"],ut=function(e){var t=e.onClick,n=(0,B.Z)(e,lt);return r.createElement(Ge.Z,(0,y.Z)({badge:"info","data-testid":"node-info-cta"},n),r.createElement(h.Icon,{color:"textDescription",cursor:"pointer",height:"18px",width:"18px",name:"information",onClick:t}))},st=["name"],dt=function(e){var t=e.name,n=(0,B.Z)(e,st);return r.createElement(Ge.Z,(0,y.Z)({badge:"k8s","data-testid":"node-kubernetes",nodeName:t},n),r.createElement(h.Flex,{alignItems:"center",gap:1},r.createElement(h.Icon,{color:"textDescription","data-testid":"node-kubernetes-icon",name:"serviceKubernetes",width:"18px",height:"18px"}),r.createElement(h.TextSmall,{color:"textDescription","data-testid":"node-kubernetes-text"},"k8s")))},mt=["kernelName","kernelVersion","name"],ft=function(e){var t=e.kernelName,n=e.kernelVersion,o=e.name,a=(0,B.Z)(e,mt);return r.createElement(Ge.Z,(0,y.Z)({badge:"kernel","data-testid":"node-kernel",nodeName:o},a),r.createElement(h.TextSmall,{color:"textDescription"},(0,Te.cB)(t,n)))},pt=n(72132),gt=n(79655),ht=["id","state","isLive","name"],vt=function(e){var t=e.isLive,n=e.name;return r.createElement(r.Fragment,null,r.createElement(et,{"data-testid":"node-name-text",isLive:t},n),r.createElement(h.Icon,{color:"placeholder","data-testid":"node-name-icon",name:"goToNode",width:"18px",height:"18px"}))},bt=function(e){var t=e.id,n=e.state,o=e.isLive,a=e.name,i=(0,B.Z)(e,ht),c=(0,d.m3)(t);return"stale"===n||o?r.createElement(gt.rU,(0,y.Z)({"data-testid":"node-name-link",to:c},i),r.createElement($e,{"data-testid":"node-name-container"},r.createElement(vt,{isLive:o,name:a}))):r.createElement(vt,{isLive:o,name:a})},yt=["architecture","cpuFrequency","cpus","diskSpace","memory","name","os","osName"],Et=function(e){var t,n,o=e.architecture,a=e.cpuFrequency,i=e.cpus,c=e.diskSpace,l=e.memory,u=e.name,s=e.os,d=e.osName,m=(0,B.Z)(e,yt);return r.createElement(Ge.Z,(0,y.Z)({badge:"systemInfo","data-testid":"node-system-info",nodeName:u},m),r.createElement(h.Flex,{alignItems:"center",gap:1},r.createElement(h.Icon,{color:"textDescription","data-testid":"node-system-info-icon",name:(null===(t=Ie._[d])||void 0===t?void 0:t.iconName)||(null===(n=Ie.V[s])||void 0===n?void 0:n.iconName)||"os",width:"16px",height:"16px"}),r.createElement(h.TextSmall,{color:"textDescription","data-testid":"node-system-info-text"},(0,Te.MC)(d)," \u2022 ",(0,Te.ys)(a)," \u2022"," ",(0,Te.MC)(i,1===i?"Core":"Cores")," \u2022 ",(0,Te.MC)(o)," ","\u2022 ",(0,Te.MC)((0,Te.yo)(l),"RAM")," \u2022"," ",(0,Te.MC)((0,Te.yo)(c),"HD"))))},wt=["container","name","virtualization"],xt=function(e){var t=e.container,n=e.name,o=e.virtualization,a=(0,B.Z)(e,wt),i=(0,Te.jo)(t,o);return r.createElement(Ge.Z,(0,y.Z)({badge:"type","data-testid":"node-type",nodeName:n,nodeType:i.label},a),r.createElement(h.Flex,{alignItems:"center",gap:1},r.createElement(h.Icon,{color:"textDescription","data-testid":"node-type-icon",name:i.icon,height:i.iconSize,width:i.iconSize}),r.createElement(h.TextSmall,{color:"textDescription","data-testid":"node-type-text"},i.label)))},Ot=n(83925),kt=n(9058),Ct=(n(31672),n(59461),n(74916),n(4723),function(e,t){return e&&e.getRoot().getChildren().find((function(e){return e.match({id:"nodes-".concat(t)})}))}),It=n(16978),Zt=function(e){var t=e.id,n=e.roomId,o=e.nodeId,a=e.context,i=e.dimensions,c=(0,kt.e)(),l=(0,r.useMemo)((function(){var e=Ct(c,n),r=[t,o,a].join("-");if(!e)return null;var l=e.getNode({id:r});return l?(l.updateAttribute("selectedDimensions",i.map((function(e){return e.name}))),l):(l=c.makeChart({attributes:{id:r,nodesScope:[o],contextScope:[a],pixelsPerPoint:20,selectedDimensions:i.map((function(e){return e.name}))}}),e.appendChild(l),l)}),[a,t,o,n,c]);return l?r.createElement(It.Z,{chart:l,hasHeader:!1,hasFooter:!1,hasFilters:!1}):null},jt=(0,r.memo)(Zt),St=n(38626),Pt=function(e){var t=e.id,n=e.context,a=e.nodeId,i=e.isLive,c=e.hidden,l=e.title,u=e.dimensions,s=(0,o.UL)();return c||!i?null:r.createElement(h.Flex,{column:!0,"data-testid":"metrics-chart-".concat(n),flex:"grow",basis:"174px"},r.createElement(St.Z,{text:l||n,maxLength:19,TextComponent:h.TextSmall,color:"textDescription",margin:[1,0,1,2],as:"div"}),r.createElement(jt,{id:t,context:n,nodeId:a,roomId:s,dimensions:u}))},Nt=function(e){var t,n,a=e.id,i=e.name,c=e.hw,l=e.os,u=e.capabilities,s=e.container,d=e.updateSeverity,m=e.labels,f=e.isLive,g=e.state,v=e.version,b=e.extraKey,E=(0,o.UL)(),w=null===(t=u.funcs)||void 0===t?void 0:t.enabled,x=null===(n=u.ml)||void 0===n?void 0:n.enabled,O=(0,Te.Q5)(g),k=m||{},C=k._cloud_instance_type,I=k._cloud_provider_type,Z="true"===(null===m||void 0===m?void 0:m._is_k8s_node),j=!(0,Te.O2)(C)||!(0,Te.O2)(I),S=(0,p.Sf)("sidebarTab",{flavour:"val",extraKey:b}),P=(0,p.Sf)("sidebarOpen",{flavour:"bool"}),N=(0,p.Sf)("sidebarNodeId",{flavour:"val",extraKey:b}),T=(0,r.useCallback)((function(e){P(!0),S(e),N(a)}),[a]),D=(0,r.useCallback)((function(){return T("alerts")}),[T]),M=(0,r.useCallback)((function(){return T("info")}),[T]),B=(0,Ke.Eq)(),F=(0,R.uA)(E);return r.createElement(h.Flex,{"data-testid":"nodeRow-".concat(i),"data-submenuid":a,padding:[1],column:!0,gap:1,round:!0},r.createElement(h.Flex,{alignItems:"center","data-testid":"nodeRow-basic-info",gap:2,height:{min:6}},r.createElement(ct,{connectivity:O,"data-testid":"nodeRow-connectivity-".concat(O.toLowerCase()),name:i}),r.createElement(Xe,{"data-testid":"nodeRow-separator"}),r.createElement(bt,{"data-testid":"nodeRow-name",id:a,name:i,isLive:f,state:g}),r.createElement(Xe,{"data-testid":"nodeRow-separator"}),r.createElement(ut,{onClick:M,"data-testid":"nodeRow-more-info-cta"}),r.createElement(Xe,{"data-testid":"nodeRow-separator"}),r.createElement(rt.Z,{id:a,isLive:f,"data-testid":"nodeRow-alerts",name:i,onClick:D}),r.createElement(Xe,{"data-testid":"nodeRow-separator"}),r.createElement(pt.Z,{badge:"ml","data-testid":"nodeRow-machine-learning-status",enabled:x,name:i},r.createElement(h.Icon,{name:"anomaliesLens",size:"small",color:"text"})),r.createElement(Xe,{"data-testid":"nodeRow-separator"}),r.createElement(pt.Z,{badge:"fn","data-testid":"nodeRow-fn-status",enabled:w,name:i,onClick:function(){return B(a)}},r.createElement(h.Icon,{name:"functions",size:"small",color:"text"})),d&&r.createElement(r.Fragment,null,r.createElement(Xe,{"data-testid":"nodeRow-separator"}),r.createElement(Ot.Z,{name:i,os:l.id,container:s,warningLevel:d,labels:m,version:v,text:d,"data-testid":"nodeRow-needs-update"})),r.createElement(nt,{"data-testid":"nodeRow-node-actions",id:a,name:i,connectivity:O})),r.createElement(h.Flex,{alignItems:"center","data-testid":"nodeRow-detailed-info",gap:2},r.createElement(Et,{architecture:c.architecture,cpuFrequency:c.cpuFrequency,cpus:c.cpus,"data-testid":"nodeRow-system-info",diskSpace:c.diskSpace,memory:c.memory,name:i,osName:l.nm,os:l.id}),r.createElement(Xe,{"data-testid":"nodeRow-separator"}),!(null===l||void 0===l||!l.kernel)&&r.createElement(ft,{"data-testid":"nodeRow-kernel",kernelName:l.kernel.nm,kernelVersion:l.kernel.v,name:i}),r.createElement(Xe,{"data-testid":"nodeRow-separator"}),Z&&r.createElement(r.Fragment,null,r.createElement(dt,{"data-testid":"nodeRow-kubernetes",name:i}),r.createElement(Xe,{"data-testid":"nodeRow-separator"})),r.createElement(xt,{container:c.container,"data-testid":"nodeRow-type",name:i,virtualization:c.virtualization}),j&&r.createElement(r.Fragment,null,r.createElement(Xe,{"data-testid":"nodeRow-separator"}),r.createElement(at,{"data-testid":"nodeRow-cloud-info",instanceType:C,name:i,providerType:I}))),!(null===F||void 0===F||!F.length)&&r.createElement(h.Flex,{"data-testid":"nodeRow-charts",gap:1},F.map((function(e){return r.createElement(Pt,(0,y.Z)({key:e.id},e,{nodeId:a,isLive:f}))}))))},Tt=function(e){switch(e.level){case 0:return ze;case 1:return Nt;default:return null}},Dt=["onChartNameChange","initialChartName","dashboardOptions","linkToGo","contextToGo"],Mt=function(e){var t=e.onChartNameChange,n=e.initialChartName,o=e.dashboardOptions,a=e.linkToGo,i=e.contextToGo,c=(0,B.Z)(e,Dt),l=(0,Be.Z)({onChartNameChange:t,initialChartName:n,linkToGo:a,contextToGo:i}),u=l.setActiveMenuGroupId,s=l.setActiveSubMenuId;return r.createElement(f.v,c,r.createElement(Fe.Z,{onActiveMenuGroupId:u,onActiveSubMenuId:s,getComponent:Tt,dashboardOptions:o,initialChartName:n,checkVisibility:function(){return!0}}))},Bt=["config"],Ft=function(){var e=(0,m.th)(),t=(0,o.UL)(),n=function(){var e=(0,o.UL)(),t=D(e,"groupMode")||"nodeStatus",n=Me[t]||Me.nodeStatus;return(0,r.useCallback)((function(e){var r,o=n(e);return{name:o,priority:Me[t]?null===De||void 0===De||null===(r=De[t])||void 0===r?void 0:r[o]:De.nodeStatus,icon:"nodeStatus"===t?"connectivityStatus".concat(o):null}}),[t])}(),a=(0,p.H7)({extraKey:"nodesView"}),i=(0,d.wU)(),c=(0,u.Z)(),h=(0,l.Z)(c,2),v=h[0],b=h[1].width;!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.host,a=n.width,i=(0,kt.e)(),c=(0,r.useRef)();(0,r.useMemo)((function(){if(i){var n=Ct(i,e);n&&n.destroy(),n=i.makeContainer({attributes:{host:o,enabledXAxis:!1,id:"nodes-".concat(e),hasToolbox:!1,height:"75px",groupingMethod:"average",groupBy:["dimension"],aggregationMethod:"avg",legend:!1,axisLabelFontSize:7,yAxisLabelWidth:20,hasYlabel:!1,nodesScope:t,width:a}}),c.current=n,i.appendChild(n)}}),[e]),(0,r.useMemo)((function(){c.current&&(c.current.setAttribute("width",a),c.current.getNodes().forEach((function(e){return e.updateAttribute("width",a)})))}),[c.current,a]),(0,r.useLayoutEffect)((function(){return function(){return c.current&&c.current.destroy()}}),[])}(t,a,{host:(0,m.Q6)()?"".concat(window.envSettings.agentApiUrl,"/api/v2"):"".concat(window.envSettings.apiUrl,"/api/v3/spaces/").concat(e,"/rooms/").concat(t),width:b});var y=(0,p.I0)("nodeIdToGo",{key:t,extraKey:"nodesView",flavour:"val"}),E=(0,l.Z)(y,2),w=E[0],x=E[1];return r.createElement(f.Z,{getObject:i,ids:a,getMenu:Pe,getGrouping:n,deps:[n],extraKey:"nodesView"},r.createElement(s.Z,{ref:v,position:"relative",sidebar:r.createElement(g.ZP,{hiddenTabs:Bt,nodeIds:a,title:"Nodes",initialChartName:w,flavour:"nodesView",loaded:!0,hasSearch:!1})},r.createElement(ke,null),r.createElement(Mt,{initialChartName:w,onChartNameChange:x})))},At=function(){var e=(0,o.UL)(),t=(0,a.zN)();return(0,a.X7)(e,"loaded")&&!t.length?r.createElement(c.ZP,{feature:"NodesView",mode:"NoNodesView"},r.createElement(i.Z,null)):r.createElement(c.ZP,{feature:"NodesView"},r.createElement(Ft,null))}},36560:function(e,t,n){n.d(t,{H:function(){return F},Z:function(){return A}});var r=n(87462),o=n(29439),a=n(67294),i=n(59978),c=n(46667),l=n(37518),u=n(86242),s=n(28350),d=n(36459),m=(n(19601),n(21249),n(57640),n(9924),n(71893)),f=n(94666),p=n(31203),g=n(52428),h=(0,m.default)(i.Flex).withConfig({displayName:"adminsList__RowFlex",componentId:"sc-1pb9ob2-0"})(["&:hover{background:",";}"],(0,i.getColor)("elementBackground")),v=(0,m.default)(i.Icon).withConfig({displayName:"adminsList__StyledIcon",componentId:"sc-1pb9ob2-1"})(["cursor:pointer;"]),b=function(e){var t=Object.assign({},((0,d.Z)(e),e)),n=(0,f.nP)();return a.createElement(i.Flex,(0,r.Z)({column:!0,border:{side:"top",color:"borderSecondary"},flex:"grow",padding:[1,0],height:{max:50},overflow:"auto"},t),n.map((function(e){return a.createElement(h,{flex:{grow:0,shrink:0},key:e.id,padding:[0,4],justifyContent:"between",height:10,alignItems:"center"},a.createElement(i.Flex,{key:e.id,gap:2,alignItems:"center"},a.createElement(p.Z,{src:e.avatarURL,title:e.name}),a.createElement(i.Text,null,e.name),a.createElement(i.Text,{color:"textLite"},e.email)),a.createElement(v,{onClick:(0,g.J)(e.email,{text:"Admin email address copied to your clipboard."}),size:"small",name:"copy",color:"primary"}))})))},y=(0,m.default)(i.Icon).withConfig({displayName:"styled__StyledWarningIcon",componentId:"sc-q96c2w-0"})(["border-radius:50%;overflow:hidden;background:",";"],(0,i.getColor)(["neutral","white"])),E=(0,m.default)(i.Icon).withConfig({displayName:"styled__StyledCheckmarkIcon",componentId:"sc-q96c2w-1"})(["border-radius:50%;overflow:hidden;background:",";padding:6px;width:24px;height:24px;"],(0,i.getColor)("elementBackground")),w=(0,m.default)(i.Icon).withConfig({displayName:"styled__StyledIcon",componentId:"sc-q96c2w-2"})(["transform:",";"],(function(e){return e.closed?"none":"rotate(180deg)"})),x=n(45987),O=n(91008),k=["gaPrefix"],C=function(e){var t=e.gaPrefix,n=void 0===t?"onboarding":t,o=(0,x.Z)(e,k);return a.createElement(i.Flex,(0,r.Z)({column:!0,gap:1,color:"textDescription"},o),a.createElement(i.Text,null,"Need help?"),a.createElement(i.Text,null,"Use our"," ",a.createElement(O.Z,{href:"https://community.netdata.cloud/",target:"_blank","data-ga":"".concat(n,"::click-forums::allpages")},"forums")," ","or public"," ",a.createElement(O.Z,{href:"https://discord.gg/mPZ6WZKKG2",target:"_blank","data-ga":"".concat(n,"::click-discord::allpages")},"discord channel")))},I=n(72911),Z=n(91268),j=n(33335),S=n(46189),P=n(89250),N=n(92432),T=S.Z.demoSlug,D=(0,m.default)(i.Button).withConfig({displayName:"headerButtons__StyledButton",componentId:"sc-11mwk9m-0"})(["&&{padding:2px 16px;font-size:12px;height:auto;width:auto;min-width:96px;}"]),M=function(){var e=(0,P.s0)();return a.createElement(i.Flex,{gap:4},a.createElement(O.Z,{href:"https://learn.netdata.cloud/docs/architecture/deployment-strategies",rel:"noopener noreferrer",target:"_blank"},"Possible Deployment Strategies"),!window.envSettings.onprem&&a.createElement(D,{"data-ga":"no-nodes-view::click-demo::no-nodes-header",flavour:"default",onClick:function(t){e("/spaces/".concat(T)),(0,N.L)("no-nodes-view","click-demo","no-nodes-header"),t.preventDefault()},label:"Live Demo"}))},B=n(8741),F=function(){return a.createElement(a.Fragment,null,a.createElement(i.Flex,{column:!0,"data-testid":"noNodesView-memberSection",gap:1},a.createElement(i.Flex,{alignItems:"center","data-testid":"noNodesView-memberHeader",gap:4,height:10,padding:[0,3]},a.createElement(E,{"data-testid":"noNodesView-memberHeaderIcon",name:"checkmark_s",color:"textLite"}),a.createElement(i.Flex,{justifyContent:"between",flex:!0},a.createElement(i.H3,{color:"textDescription","data-testid":"noNodesView-memberHeaderText"},"You are a member and only space admins can connect new nodes"),a.createElement(M,null))),a.createElement(i.Flex,{"data-testid":"noNodesView-memberDescription",padding:[0,0,2,13]},a.createElement(i.Text,{color:"textDescription","data-testid":"noNodesView-memberDescriptionText"},"Please contact anyone from the list in order to do so"))),a.createElement(i.Flex,{"data-testid":"noNodesView-memberAdminsListSection",padding:[0,0,0,12]},a.createElement(b,{"data-testid":"noNodesView-memberAdminsList"})))},A=function(e){var t=e.videoId,n=(0,l.UL)(),d=(0,u.Z)(n),m=(0,o.Z)(d,2),f=m[0],p=m[1],g=p.onAddNodes,h=p.selectedNodes,v=f.claimedNodeIds.length>0,b=(0,c.Z)(!0),x=(0,o.Z)(b,2),O=x[0],k=x[1],S=(0,j.gI)("node:Create");return a.createElement(Z.Z,{column:!1,"data-testid":"noNodesViewPage",gap:12,padding:[6],margin:[0,0,8],overflow:"auto"},a.createElement(i.Flex,{column:!0,"data-testid":"noNodesView-cmdSection",flex:{grow:0,shrink:1},width:"100%",gap:2},a.createElement(i.Flex,{"data-testid":"noNodesView-warningBanner",alignItems:"center",background:"warningBackground",gap:4,height:{min:10},padding:[0,3],round:!0},a.createElement(y,{"data-testid":"noNodesView-warningBannerIcon",name:"exclamation",color:"warning"}),a.createElement(i.Text,{color:"bright","data-testid":"noNodesView-warningBannerText"},"You have no nodes.")),S&&a.createElement(a.Fragment,null,a.createElement(i.Flex,{alignItems:"center","data-testid":"noNodesView-adminSection",justifyContent:"between",onClick:v?k:null,cursor:v?"pointer":null},a.createElement(i.Flex,{alignItems:"center","data-testid":"noNodesView-adminHeader",gap:4,height:10,padding:[0,3]},a.createElement(E,{"data-testid":"noNodesView-adminHeaderIcon",name:"checkmark_s",color:"textLite"}),a.createElement(i.H3,{"data-testid":"noNodesView-adminHeaderText",color:"textDescription"},"Connect new nodes")),a.createElement(i.Flex,{gap:4,alignItems:"center"},a.createElement(M,null),v&&a.createElement(w,{closed:!O,"data-testid":"noNodesView-adminClaimedNodesIcon",name:"chevron_down",color:"textLite"}))),a.createElement(i.Collapsible,{"data-testid":"noNodesView-adminClaimNodesContainer",open:O},a.createElement(i.Flex,{"data-testid":"noNodesView-adminClaimNodes",padding:[0,0,0,12]},a.createElement(B.Z,{rooms:[n]})))),!S&&a.createElement(F,null),v&&a.createElement(a.Fragment,null,a.createElement(i.Flex,{alignItems:"center","data-testid":"noNodesView-availableNodesHeader",gap:4,height:10,padding:[0,3]},a.createElement(E,{"data-testid":"noNodesView-availableNodesHeaderIcon",name:"checkmark_s",color:"textLite"}),a.createElement(i.H3,{color:"textDescription","data-testid":"noNodesView-availableNodesHeaderText"},"Add already available nodes")),a.createElement(i.Flex,{height:"100%","data-testid":"noNodesView-availableNodesContainer",padding:[0,0,0,12]},a.createElement(s.Z,(0,r.Z)({"data-testid":"noNodesView-availableNodesList"},f,{onAddNodes:g,canAddNodes:!!h.length,padding:[2,0,8]}))))),t&&a.createElement(i.Flex,{column:!0,"data-testid":"noNodesView-videoSection",flex:{shrink:0,grow:0}},a.createElement(I.Z,{"data-testid":"noNodesView-onboardingVideo",height:296,width:520,videoId:t}),a.createElement(C,{"data-testid":"noNodesView-needHelp",padding:[8,0]})))}},2077:function(e,t,n){n.d(t,{mt:function(){return C},yp:function(){return k},VG:function(){return x},d5:function(){return I},$g:function(){return O}});n(82526),n(57327),n(88449),n(59849),n(38880),n(49337),n(33321),n(69070);var r=n(29439),o=n(4942),a=(n(92222),n(85827),n(41539),n(25387),n(2490),n(72608),n(47941),n(15581),n(34514),n(54747),n(82772),n(26699),n(32023),n(61874),n(9653),n(67294)),i=n(4480),c=n(4822),l=n(18761),u={byContext:{},loaded:!1,loading:!1,method:null,options:null,group:"average",totalDimensionsCount:0},s=(0,i.xu)({key:"weights",default:u});function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=(0,i.CG)({key:"weightsState",get:function(e){return function(t){return(0,t.get)(s(e))}},set:function(e){return function(t,n){return(0,t.set)(s(e),n)}},cachePolicy_UNSTABLE:{eviction:"most-recent"}}),p={ci:"context",ni:"node",ii:"instance",di:"dimension"},g=function(e,t){return function(n){return(0,o.Z)({},p[e.name],t[e.dictionary][n])}},h={ni:g,ii:function(e,t){return function(n,r,a){return(0,o.Z)({},p[e.name],t[e.dictionary][n]?"".concat(t[e.dictionary][n],"@").concat(t.nodes[r[a.ni]]):null)}},ci:g,di:g,row_type:function(e){return function(t){return{type:e.value[t]}}},weight:function(){return function(e){return{weight:e}}},timeframe:function(e){return function(t){return{highlight:e.labels.reduce((function(e,n,r){return m(m({},e),{},(0,o.Z)({},n,t[r]))}),{})}}},"baseline timeframe":function(e){return function(t){return{baseline:e.labels.reduce((function(e,n,r){return m(m({},e),{},(0,o.Z)({},n,t[r]))}),{})}}}},v={contexts:"ci",nodes:"ni",instances:"ii",dimensions:"di"},b={contexts:"id",nodes:"nodeId",instances:"id",dimensions:"id"},y=function(e,t){return null===e||e>t?t:e},E=function(e,t){return null===e||e<t?t:e},w=function(e){e.flavour;var t=e.data,n=e.aggregation,r=e.options,o={},a=0;if(t.v_schema){var i,c=(null===(i=t.v_schema)||void 0===i?void 0:i.items)||[];o=t.result.reduce((function(e,t){var r=t.id,o=t.v;return e[r]=c.reduce((function(e,t,r){var a=t.name,i=t.labels.indexOf(n);return e[a]=o[r][i],e}),{}),e}),{})}else{var l=function(e){var t=Object.keys(e.dictionaries).reduce((function(t,n){t[n]||(t[n]={});var r=b[n];return e.dictionaries[n].forEach((function(e){return t[n][e[v[n]]]="nodeId"===r?e.nd||e.mg:e[r]})),t}),{}),n={},r=e.schema.items.reduce((function(e,r,o){var a=(h[r.name]||h.default)(r,t);return e.push(a),n[r.name]=o,e}),[]);return function(e){return e.reduce((function(t,o,a){return m(m({},t),r[a](o,e,n))}),{})}}(t);o=t.result.reduce((function(e,t){var n=l(t),o=n.dimension,i=n.node,c=n.context,u=n.instance,s=n.type,d=n.weight,m=n.highlight,f=n.baseline;if("node"===s)return e;var p,g,h=(p=e,g=c,function(e,t,n,r,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:y;n&&(n&&"undefined"===typeof p[g][t][n]&&(p[g][t][n]={}),"undefined"===typeof p[g][t][n][e]&&(p[g][t][n][e]=null),r&&(p[g][t][n][e]=a(p[g][t][n][e],o)))});e[c]||(e[c]={dimensions:{},instances:{},nodes:{},weight:null});var v=!!r&&r.includes("anomaly-bit");h("weight","dimensions",o,"dimension"===s,d,v?E:y),h("weight","instances",u,"instance"===s,d,v?E:y),h("weight","nodes",i,"node"===s,d,v?E:y);var b=m?100*m.anomaly_count/m.count:0;h("arHighlight","dimensions",o,"dimension"===s,b,E),h("arHighlight","instances",u,"instance"===s,b,E),h("arHighlight","nodes",i,"node"===s,b,E);var w=f?100*(f.anomaly_count-m.anomaly_count)/(f.count-m.count)===0?1:f.count-m.count:0;h("arBaseline","dimensions",o,"dimension"===s,w,E),h("arBaseline","instances",u,"instance"===s,w,E),h("arBaseline","nodes",i,"node"===s,w,E);var x=w?b/w:0;return h("score","dimensions",o,"dimension"===s,x,E),h("score","instances",u,"instance"===s,x,E),h("score","nodes",i,"node"===s,x,E),"context"===s?e[c].weight=null===e[c].weight||e[c].weight>d?d:e[c].weight:"dimension"===s&&(a+=1),e}),{})}return{byContext:o,totalDimensionsCount:a}},x=function(e,t,n){var r=(0,a.useRef)();return[(0,i._8)((function(o){var a=o.set;return function(o){var i=o.flavour,c=o.highlightAfter,s=o.highlightBefore,d=o.baselineAfter,p=o.baselineBefore,g=o.method,h=o.options,v=o.group,b=o.context,y=o.nodeIds,E=o.aggregation,x=o.groupBy;return a(f(e),m(m({},u),{},{loading:!0})),r.current&&r.current.cancel(),r.current=(0,l.B3)(t,n,{highlightAfter:c,highlightBefore:s,baselineAfter:d,baselineBefore:p,method:g,options:h,group:v,context:b,nodeIds:y,aggregation:E,groupBy:x}),r.current.then((function(t){var n=t.data,r=w({flavour:i,data:n,aggregation:E,options:h}),o=r.byContext,c=r.totalDimensionsCount;a(f(e),{loading:!1,loaded:!0,byContext:o,options:h,totalDimensionsCount:c,method:g,group:v,groupBy:x,error:null})})).catch((function(t){var n;if(!t.isCancel)throw a(f(e),m(m({},u),{},{error:(null===t||void 0===t||null===(n=t.response)||void 0===n?void 0:n.data)||t})),t}))}}),[e]),(0,i._8)((function(t){var n=t.reset;return function(){r.current&&r.current.cancel(),n(f(e))}}),[e])]},O=function(e){return(0,i.sJ)(f(e))},k=function(e){return(0,i.rb)(f(e))},C=.01,I=function(e,t,n){var o=x(e,t,n),i=(0,r.Z)(o,2),l=i[0],u=i[1],s=O(e),d=s.loaded,f=s.loading,p=s.byContext,g=s.totalDimensionsCount,h=s.options,v=s.groupBy,b=function(){var e=(0,c.by)("threshold");return e?Number.parseFloat(e):C}(),y=(0,a.useMemo)((function(){var e=0,t=null===h||void 0===h?void 0:h.includes("raw"),n=(v||[]).length?p:Object.keys(p).reduce((function(n,r){var o=Object.keys(p[r].dimensions).reduce((function(e,n){return!t&&p[r].dimensions[n].weight>b||(e[n]=p[r].dimensions[n]),e}),{}),a=Object.keys(o).length;return e+=a,a?(n[r]=m(m({},p[r]),{},{dimensions:o}),n):n}),{});return[n,Object.keys(n),e]}),[d,b]),E=(0,r.Z)(y,3),w=E[0],k=E[1],I=E[2];return{threshold:b,metadata:w,contexts:k,dimensionsCount:I,totalDimensionsCount:g,loaded:d,loading:f,getWeights:l,resetWeights:u}}},89479:function(e,t,n){n.d(t,{W2:function(){return f},Q7:function(){return O},PP:function(){return x},dA:function(){return E},Ni:function(){return Z},pT:function(){return j},MS:function(){return I},If:function(){return S},jg:function(){return b},QX:function(){return y},Uq:function(){return g},hH:function(){return p},Cd:function(){return k},qU:function(){return h},z3:function(){return C},w4:function(){return v}});n(82526),n(57327),n(88449),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(4942),o=n(93433),a=(n(66992),n(41539),n(70189),n(78783),n(88921),n(96248),n(13599),n(11477),n(64362),n(15389),n(90401),n(45164),n(91238),n(54837),n(87485),n(56767),n(76651),n(61437),n(35285),n(39865),n(33948),n(92222),n(47941),n(85827),n(25387),n(2490),n(72608),n(64211),n(41874),n(67294)),i=n(4480),c=n(37394),l=n(37518),u=n(41331),s={ids:(0,i.xu)({key:"roomChartIds",default:[]}),updatedAt:(0,i.xu)({key:"roomChartsUpdatedAt",default:""}),loaded:(0,i.xu)({key:"roomChartsLoaded",default:!1}),error:(0,i.xu)({key:"roomChartsError",default:null}),versions:(0,i.xu)({key:"versions",default:{}}),fetchedFor:(0,i.xu)({key:"fetchedFor",default:[]})};function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=(0,i.CG)({key:"roomChartState",get:function(e){var t=e.id,n=e.key;return function(e){return(0,e.get)(s[n](t))}},set:function(e){var t=e.id,n=e.key;return function(e,r){(0,e.set)(s[n](t),r)}}}),p=function(e){return!!(0,i.sJ)(f({id:e,key:"loaded"}))},g=function(e){return(0,i.sJ)(f({id:e,key:"fetchedFor"}))},h=function(e){return(0,i.sJ)(f({id:e,key:"versions"}))},v=function(e){var t=(0,i.Zl)(f({id:e,key:"versions"}));return(0,a.useCallback)((function(e){return t((function(t){return e="function"===typeof e?e(t):e,(0,u.ZP)(t,e,{omit:["contextsSoftHash"]})?t:e}))}),[])},b=function(e){return(0,i.sJ)(f({id:e,key:"ids"}))},y=function(e,t){return(0,i.sJ)(f({id:e,key:t}))},E=(0,i.CG)({key:"roomChartsState/ids",get:function(e){var t=e.roomId;return function(e){return(0,e.get)(s.ids(t))}},set:function(e){var t=e.roomId,n=e.merge,r=void 0===n||n;return function(e,n){(0,e.set)(s.ids(t),(function(e){var t=r?(0,o.Z)(new Set([].concat((0,o.Z)(n),(0,o.Z)(e)))):n;return r&&(0,u.ZP)(t,e)?e:t}))}}}),w=(0,i.xu)({key:"roomsChartBatchState",default:{}}),x=(0,i.CG)({key:"roomChartsState",get:function(e){var t=e.id,n=e.key;return function(e){var r=(0,e.get)(w(t))||c.a;return n?r[n]:r}},set:function(e){var t=e.id,n=e.key;return function(e,o){var a=e.set;"function"!==typeof o?Object.keys(o).length<1||a(w(t),(function(e){return m(m({},e),{},(0,r.Z)({},n,o))})):a(w(t),(function(e){return m(m({},e),{},(0,r.Z)({},n,o(e[n])))}))}}}),O=(0,i.CG)({key:"roomChartsState/initialize",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.id,n=e.merge,r=void 0===n||n,o=e.nodeIds;return function(e,n){var a=e.set,i=n.values,l=n.merge;a(f({id:t,key:"fetchedFor"}),o),a(w(t),(function(e){var t=Object.keys(i).reduce((function(t,n){var o=i[n].id;return t[o]=m(m(m(m({},c.a),(r||l)&&e[o]),i[n]),{},{loaded:!0}),t}),r?m({},e):{});return r&&(0,u.ZP)(t,e,{omit:["lastEntry","firstEntry","family"]})?e:t}))}}}),k=function(e,t){return(0,i.sJ)(x({id:e,key:t}))},C=function(e){return(0,i._8)((function(t){var n=t.set;return function(t){return n(w(e),t)}}),[])},I=function(e,t){return(0,i._8)((function(n){var r=n.snapshot;return function(n){return m(m({},r.getLoadable(x({id:e,key:n})).contents),(null===t||void 0===t?void 0:t[n])||{})}}),[e,t])},Z=function(e){var t,n,r,o=(0,l.UL)(),a=(0,i.sJ)(w(o));return(null===(t=a[e])||void 0===t?void 0:t.visible)&&!(null!==(n=a[e])&&void 0!==n&&n.filteredOut)&&!(null!==(r=a[e])&&void 0!==r&&r.hidden)},j=function(e){var t=(0,l.UL)(),n=(0,i.sJ)(w(t));return e.some((function(e){var t,r,o;return(null===(t=n[e])||void 0===t?void 0:t.visible)&&!(null!==(r=n[e])&&void 0!==r&&r.filteredOut)&&!(null!==(o=n[e])&&void 0!==o&&o.hidden)}))},S=function(){var e=(0,l.UL)(),t=(0,i.sJ)(w(e));return(0,a.useCallback)((function(e){return e.some((function(e){var n,r,o;return(null===(n=t[e])||void 0===n?void 0:n.visible)&&!(null!==(r=t[e])&&void 0!==r&&r.filteredOut)&&!(null!==(o=t[e])&&void 0!==o&&o.hidden)}))}),[e,t])},P=(0,i.xu)({key:"instancesByContextAtom",default:{}}),N=(0,i.CG)({key:"roomChartInstancesState",get:function(e){var t=e.id,n=e.context;return function(e){var r=(0,e.get)(P(t));return n?r[n]:r}},set:function(e){var t=e.id,n=e.context;return function(e,o){var a=e.set;"function"!==typeof o?Object.keys(o).length<1||a(P(t),(function(e){return m(m({},e),{},(0,r.Z)({},n,o))})):a(P(t),(function(e){return m(m({},e),{},(0,r.Z)({},n,o(e[n])))}))}}});(0,i.CG)({key:"roomChartInstances/initialize",set:function(e){return function(t,n){(0,t.set)(P(e),(function(e){return m(m({},e),n)}))}}}),(0,i.CG)({key:"roomChartsInstancesState",get:function(e){var t=e.id,n=e.contexts,r=void 0===n?[]:n;return function(e){var n=(0,e.get)(N({id:t}));return r.reduce((function(e,t){return n[t]&&(e[t]=n[t]),e}),{})}}})},20046:function(e,t,n){n.d(t,{Z:function(){return y}});var r=n(29439),o=(n(92222),n(21249),n(57640),n(9924),n(57327),n(41539),n(88449),n(2490),n(59849),n(67294)),a=n(93433),i=(n(26699),n(32023),n(59978)),c=n(27856),l=n(82351),u=function(e){var t=e.message,n=e.children,u=e.warningMessage,s=(0,o.useRef)(),d=(0,o.useRef)([]),m=(0,i.useNavigationArrows)(s,d,n,!0),f=(0,r.Z)(m,3),p=f[0],g=f[1],h=f[2];(0,o.useEffect)((function(){if(s.current){var e=s.current,t=(0,c.D)(300,(function(){h()}));return t(),e.addEventListener("scroll",h),window.addEventListener("resize",t),function(){e.removeEventListener("scroll",h),window.removeEventListener("resize",t)}}}),[n]);var v=(0,o.useCallback)((function(e){e&&(d.current.includes(e)||(d.current=[].concat((0,a.Z)(d.current),[e])),n.length<d.current.length&&(d.current=d.current.filter((function(t){return t.getAttribute("data-testid")===e.getAttribute("data-testid")}))))}),[n]),b=(0,o.useMemo)((function(){return o.Children.map(n,(function(e,t){var n="tab-".concat(t);return o.cloneElement(e,{key:n,ref:v})}))}),[n]);return o.createElement(i.Flex,{"data-testid":"selected-nodes-container",alignItems:"center",width:"100%"},o.createElement(i.Flex,{alignItems:"center"},o.createElement(i.TextSmall,{whiteSpace:"nowrap","data-testid":"selected-nodes-container-message",color:"primary"},t,":"),u&&o.createElement(i.Flex,{padding:[0,1,0],margin:[0,0,1],justifyContent:"center"},o.createElement(l.Z,{plain:!0,content:u,align:"bottom"},o.createElement(i.Icon,{width:"16px",height:"16px","data-testid":"selected-nodes-container-warning-icon",color:"warningText",name:"warning_triangle_hollow"})))),p&&o.createElement(i.Flex,{"data-testid":"selected-nodes-arrowLeft",cursor:"pointer",onClick:function(e){e.preventDefault();var t=s.current;t.scrollTo({left:t.scrollLeft-200,behavior:"smooth"})},padding:[2]},o.createElement(i.Icon,{name:"navLeft",color:"text",width:8,height:8})),o.createElement(i.Flex,{ref:s,overflow:"hidden",padding:[1],gap:1},b),g&&o.createElement(i.Flex,{"data-testid":"selected-nodes-arrowRight",cursor:"pointer",onClick:function(e){e.preventDefault();var t=s.current;t.scrollTo({left:t.scrollLeft+200,behavior:"smooth"})},padding:[2]},o.createElement(i.Icon,{name:"navRight",color:"text",width:8,height:8})))},s=(0,o.memo)(u),d=n(91008),m=function(e){var t=e.onClose,n=e.id;return o.createElement(i.Box,{"data-testid":"selected-node-item-remove-button-".concat(n),sx:{marginLeft:"auto"},as:i.Icon,name:"close_circle",onClick:t,cursor:"pointer",width:3,height:3,color:"border",position:"absolute",right:"2px"})},f=(0,o.forwardRef)((function(e,t){var n=e.tooltipText,r=e.onClose,a=e.id,c=e.showToolTip,l=e.onClickAnchor,u=e.displayText,s=e.isAnchorDisabled;return o.createElement(i.Flex,{width:"100%",ref:t,"data-testid":"selected-node-item-".concat(a)},o.createElement(i.Pill,{background:"nodeBadgeBackground",padding:[0],borderColor:"nodeBadgeBackground"},o.createElement(i.Flex,{position:"relative",width:{max:"300px"},gap:2,alignItems:"center",padding:[1,4,1,2]},o.createElement(d.Z,{Component:i.TextSmall,showToolTip:c,content:n,align:"bottom",isBasic:!0,disabled:s,onClick:l,cursor:"pointer",color:"text",hoverColor:"primary",visitedColor:"accent",disabledColor:"textLite"},u),o.createElement(m,{onClose:r,id:a}))))})),p=n(64637),g=n(4822),h=n(97945),v=n(82902),b=(0,o.forwardRef)((function(e,t){var n=e.onRemove,r=e.nodeId,a=(0,h.iy)(r,"name"),i=(0,h.iy)(r,"isOffline"),c=(0,p.a)(a,30),l=(0,h.WR)(r);return o.createElement(f,{onClose:n,id:r,displayText:c,tooltipText:a,showToolTip:c!==a,isAnchorDisabled:i,onClickAnchor:l,ref:t})})),y=(0,o.memo)((function(){var e=(0,g.wT)(),t=(0,r.Z)(e,2),n=t[0],a=t[1],c=(0,g.H7)(),l=(0,h.Mm)(c);if(!((null===n||void 0===n?void 0:n.length)>0))return o.createElement("div",null);var u=l.length!==c.length?"Some of the nodes you have selected are unreachable, therefore their metrics are not included in the charts.":"";return o.createElement(i.Flex,{width:"100%",overflow:"hidden"},o.createElement(s,{warningMessage:u,message:"You have selected ".concat(c.length," ").concat((0,v.V6)(c.length))},c.map((function(e){return o.createElement(b,{key:e,onRemove:function(){return a(n.filter((function(t){return t!==e})))},nodeId:e})}))))}))},4571:function(e,t,n){n.d(t,{Z:function(){return St}});n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(87462),o=n(4942),a=n(67294),i=n(89250),c=n(74662),l=n(36560),u=n(29439),s=n(2077),d=n(5441),m=n(25517),f=n(4822),p=n(91268),g=n(43969),h=n(78266),v=n(59978),b=n(37518),y=n(72911),E=n(8741),w=n(62200),x=n(91008),O=n(33335),k=n(41898),C=function(){var e=(0,b.UL)(),t=(0,O.gI)("node:Create");return a.createElement(p.Z,{column:!1,"data-testid":"noNodesViewPage",gap:12,padding:[6]},a.createElement(v.Flex,{column:!0,gap:5,flex:{shrink:0,grow:0},"data-testid":"noKubernetesView-videoSection"},a.createElement(y.Z,{"data-testid":"noNodesView-onboardingVideo",height:350,width:850,videoId:w.mX[0]}),a.createElement(y.Z,{"data-testid":"noNodesView-onboardingVideo",height:350,width:850,videoId:w.mX[1]})),a.createElement(v.Flex,{column:!0,gap:4},a.createElement(v.Box,{border:{side:"bottom",color:"borderSecondary"}},a.createElement(v.Box,{margin:[0,0,2,0]},a.createElement(x.Z,{href:"https://learn.netdata.cloud/guides/monitor/kubernetes-k8s-netdata",target:"_blank",rel:"noopener noreferrer","data-ga":"k8s-tab::click-link-guides::kubernetes-overview-and-visualizations"},a.createElement(v.TextBig,{color:"primary"},"Kubernetes monitoring with Netdata: Overview and visualizations"))),a.createElement(v.Box,{margin:[0,0,2,0]},a.createElement(x.Z,{href:"https://learn.netdata.cloud/docs/cloud/visualize/kubernetes",target:"_blank",rel:"noopener noreferrer","data-ga":"k8s-tab::click-link-guides::kubernetes-visualizations"},a.createElement(v.TextBig,{color:"primary"},"Kubernetes visualizations")))),a.createElement(v.Flex,{column:!0,gap:4},t?a.createElement(E.Z,{integrationId:k.O_,rooms:[e]}):a.createElement(l.H,null))))},I=n(45987),Z=(n(26699),n(32023),n(92222),n(39714),n(71893)),j=n(48286),S=n(92432),P=n(82351),N=n(97945),T=n(74059),D=(n(69826),Z.default.div.withConfig({displayName:"selections__Separator",componentId:"sc-1cc7y18-0"})(["width:1px;height:",";background:",";"],(0,v.getSizeBy)(2.5),(0,v.getColor)("borderSecondary"))),M=[{label:"Volume",value:"volume"},{label:"KS2",value:"ks2"}],B=[{label:"Average",value:"average"},{label:"Median",value:"median"},{label:"Min",value:"min"},{label:"Max",value:"max"},{label:"Stddev",value:"stddev"}],F=[{label:"Metrics",value:""},{label:"Anomaly Rate",value:"anomaly-bit"}],A=function(){return a.createElement(v.Flex,{column:!0,gap:1,alignItems:"center",width:"220px"},a.createElement(v.TextMicro,{color:"white"},"Choose the algorithm you want to be used to identify correlations across metrics:"),a.createElement(v.TextMicro,null,a.createElement(v.TextMicro,{color:"white",strong:!0},"KS2:")," ","A statistical test comparing the distribution of the highlighted window to the baseline."),a.createElement(v.TextMicro,null,a.createElement(v.TextMicro,{color:"white",strong:!0},"Volume:")," ","Percentage change in averages between highlighted window and baseline."))},_=function(){return a.createElement(v.Flex,{column:!0,gap:1,alignItems:"center",width:"220px"},a.createElement(v.TextMicro,{color:"white"},"What aggregation function do you want to apply when aggregating multiple datapoints for metric correlations."))},L=function(){return a.createElement(v.Flex,{column:!0,gap:1,alignItems:"center",width:"220px"},a.createElement(v.TextMicro,{color:"white"},"Do you want to find correlations over the metric values or the anomaly rates of each metric."))},R=function(e){var t=e.runGetWeights,n=e.nodeIds,r=e.flavour,i=(0,s.$g)({nodeIds:n,flavour:r}),c=i.method,l=i.options,u=i.group,d=null!==l&&void 0!==l&&l.includes(F[1].value)?F[1].value:"",m=(0,a.useCallback)((function(e){return function(n){var r=n.value;r="options"!==e?r:r?[r]:[];var a=(0,o.Z)({method:c,options:[l],group:u},e,r);t(a)}}),[c,l,u]),f=(0,a.useMemo)((function(){return{method:M.find((function(e){return e.value===c})),group:B.find((function(e){return e.value===u})),option:F.find((function(e){return e.value===d}))}}),[c,u,d]);return u?a.createElement(v.Flex,{gap:2},a.createElement(v.Flex,{gap:1,alignItems:"center"},a.createElement(v.TextSmall,{color:"textLite"},"Method:"),a.createElement(v.Select,{options:M,value:f.method,onChange:m("method")}),a.createElement(P.Z,{isBasic:!0,plain:!0,content:A,align:"bottom"},a.createElement(v.Icon,{name:"information",color:"textDescription",size:"small"}))),a.createElement(D,null),a.createElement(v.Flex,{gap:1,alignItems:"center"},a.createElement(v.TextSmall,{color:"textLite"},"Aggregation:"),a.createElement(v.Select,{options:B,value:f.group,onChange:m("group")}),a.createElement(P.Z,{isBasic:!0,plain:!0,content:_,align:"bottom"},a.createElement(v.Icon,{name:"information",color:"textDescription",size:"small"}))),a.createElement(D,null),a.createElement(v.Flex,{gap:1,alignItems:"center"},a.createElement(v.TextSmall,{color:"textLite"},"Data:"),a.createElement(v.Select,{options:F,value:f.option,onChange:m("options")}),a.createElement(P.Z,{isBasic:!0,plain:!0,content:L,align:"bottom"},a.createElement(v.Icon,{name:"information",color:"textDescription",size:"small"}))),a.createElement(D,null)):null},V=n(89405),z=function(e){var t=e.highlightAfter,n=e.highlightBefore,r=e.baseline,o=(0,V.rA)(),i=o.localeDateString,c=o.localeTimeString,l=new Date(t),u=new Date(n),s=new Date(r),d=new Date(t),m=Math.round((n-t)/1e3),p=Math.round((t-r)/1e3),g=(0,f.TQ)("highlight");return a.createElement(v.Flex,{gap:4,alignItems:"center"},a.createElement(v.Flex,{gap:2},a.createElement(v.Flex,{column:!0,gap:1},a.createElement(v.TextSmall,{color:"textLite"},"Selected area:"),a.createElement(v.TextSmall,{color:"textLite"},"Reference baseline:")),a.createElement(v.Flex,{column:!0,gap:1},a.createElement(v.TextSmall,{"data-testid":"metricCorrelation-selectedArea"},i(l,{long:!1}),","," ",c(l),"\xa0->\xa0",i(u,{long:!1}),","," ",c(u)),a.createElement(v.TextSmall,{"data-testid":"metricCorrelation-referenceBaseline"},i(s,{long:!1}),","," ",c(s),"\xa0->\xa0",i(d,{long:!1}),","," ",c(d))),a.createElement(v.Flex,{column:!0,gap:1},a.createElement(v.TextSmall,{color:"textLite"},"Duration:"),a.createElement(v.TextSmall,{color:"textLite"},"Duration:")),a.createElement(v.Flex,{column:!0,gap:1},a.createElement(v.TextSmall,{"data-testid":"metricCorrelation-selecteArea-duration"},m,"\xa0secs"),a.createElement(v.TextSmall,{"data-testid":"metricCorrelation-referenceBaseline-duration"},p,"\xa0secs"))),a.createElement(P.Z,{content:"Clear selection",align:"bottom",isBasic:!0},a.createElement(v.Button,{neutral:!0,flavour:"borderless",icon:"trashcan",onClick:function(){g({after:null,before:null})},"data-ga":"metric-correlation::click-delete::charts-view","data-testid":"metricCorrelation-delete"})))},K=n(39979),G=n(63346);function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var U=(0,K.Z)(v.Button),W=(0,Z.default)(v.Button).withConfig({displayName:"correlation__LogoButton",componentId:"sc-15d72m3-0"})(["&&{pointer-events:none;}"]),q=(0,Z.default)(v.Button).withConfig({displayName:"correlation__CloseButton",componentId:"sc-15d72m3-1"})(["position:absolute !important;top:-3px;right:-3px;"]),Q=(0,K.Z)(q),J=(0,Z.default)(v.Button).attrs({padding:[0],margin:[0,0,0,1.5],width:"auto"}).withConfig({displayName:"correlation__StyledButton",componentId:"sc-15d72m3-2"})(["height:16px !important;> span{margin:0 !important;}"]),X=function(e){var t=e.flavour,n=(0,T.th)(),r=(0,b.UL)(),i=(0,N.pG)(),c=(0,a.useMemo)((function(){return i?[i]:[]}),[i]),l=(0,f.TA)({extraKey:t,defaultValue:c}),d="singleNode"===t?c:l,m=(0,a.useState)(!1),p=(0,u.Z)(m,2),g=p[0],h=p[1],y=(0,a.useState)(),E=(0,u.Z)(y,2),w=E[0],x=E[1],O=(0,s.d5)({nodeIds:d,flavour:t},n,r),k=O.threshold,C=O.totalDimensionsCount,I=O.dimensionsCount,Z=O.loaded,D=O.loading,M=O.getWeights,B=O.resetWeights,F=(0,s.$g)({nodeIds:d,flavour:t}),A=F.method,_=F.options,L=F.group,V=(0,f.by)("highlight"),K=V.after,q=V.before,X=K-4*(q-K),Y=!!K;(0,a.useEffect)((function(){if(Z){var e="default-result";if(L){var t=null!==_&&void 0!==_&&_.includes("anomaly-bit")?"anomaly-bit":"metrics";e="default-result-".concat(A,"-").concat(L,"-").concat(t)}return(0,S.L)("metrics-correlation",e,"charts-view",I.toString())}}),[Z]),(0,j.Z)((function(){K&&h(!0)}),[K]);var $=(0,f.TQ)("correlation"),ee=(0,f.TQ)("threshold"),te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};h(!1),x(),M(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({highlightAfter:K,highlightBefore:q,baselineAfter:X,baselineBefore:K,method:A,options:_,group:L,nodeIds:d},e)).then((function(){return ee(s.mt)}))},ne=!Y||D;return(0,j.Z)((function(){Z&&g&&Y&&te()}),[Z,Y,g]),a.createElement(v.Flex,{round:2,background:"elementBackground",padding:[2,6,2,2],alignItems:"center",justifyContent:"between",flex:!0,"data-testid":"correlation",position:"relative",height:{min:"64px"},gap:2},Y?Z?a.createElement(G.Xe,{feature:"MetricCorrelations",totalDimensionsCount:C,dimensionsCount:I},a.createElement(v.Flex,{"data-testid":"metricCorrelation-resultsContainer",column:!0,width:"100%"},a.createElement(v.Flex,{justifyContent:"between",alignItems:"center",gap:1},a.createElement(v.Flex,{alignItems:"center",gap:1},a.createElement(v.Icon,{name:"correlation",color:"primary",width:"16px",height:"16px"}),a.createElement(v.TextSmall,null,"Analysed"," ",a.createElement(v.TextSmall,{color:"primary","data-testid":"metricCorrelation-resultsAnalyzed"},C)," ","and found"," ",a.createElement(v.TextSmall,{color:"primary","data-testid":"metricCorrelation-resultsFound"},I)," ","correlated metrics."),a.createElement(P.Z,{content:"Clear results"},a.createElement(J,{flavour:"borderless",neutral:!0,disabled:D||!Z&&!Y,onClick:function(){ee(s.mt),B(),(0,S.L)("metrics-correlation","click-delete","charts-view","".concat(Z?"finish":"start"))},"data-testid":"metricCorrelation-clear",small:!0,icon:"reload"}))),a.createElement(R,{runGetWeights:te,nodeIds:d,flavour:t})),a.createElement(v.Flex,{width:"100%"},a.createElement(v.Flex,{alignItems:"center",gap:3,margin:[0,2,0,5],width:"100%"},a.createElement(v.TextNano,{whiteSpace:"nowrap",color:"textDescription"},"Show less"),a.createElement(v.InputRange,{"data-testid":"metricCorrelation-resultsSlider",min:0,max:1,onChange:function(e){return ee(e.target.value.toString())},onClick:function(){return(0,S.L)("metric-correlation","click-slider","charts-view")},step:.01,value:k}),a.createElement(v.TextNano,{whiteSpace:"nowrap",color:"textDescription"},"Show more")),a.createElement(a.Fragment,null,a.createElement(P.Z,{content:"Give us your feedback! Was it useful?",align:"bottom",enterDelay:200,showArrow:!0,activateOn:"hover"},a.createElement(v.Flex,null,a.createElement(v.Button,{flavour:"+"===w?"hollow":"borderless",disabled:w,icon:"thumb_up",onClick:function(){return x("+")},"data-ga":"metric-correlation::click-thumbs-up::charts-view","data-testid":"metricCorrelation-thumbsUp",small:!0}),a.createElement(v.Button,{flavour:"-"===w?"hollow":"borderless",disabled:w,icon:"thumb_down",onClick:function(){return x("-")},"data-ga":"metric-correlation::click-thumbs-down::charts-view","data-testid":"metricCorrelation-thumbsDown",small:!0}))))))):a.createElement(v.Flex,{alignItems:"center","data-testid":"correlationView-timePeriod-container",gap:4},a.createElement(W,{icon:"logo_s",isLoading:D}),D?a.createElement(v.H5,{"data-testid":"metricCorrelation-loadingCalculation"},"Calculating metric correlations..."):a.createElement(z,{highlightAfter:K,highlightBefore:q,baseline:X})):a.createElement(v.Flex,{alignItems:"center",gap:1},a.createElement(v.Icon,{name:"correlation",color:"primary"}),a.createElement(v.Text,null,"Select a timeframe on any chart and find correlated metrics. Visit documentation"),a.createElement("a",{href:"https://learn.netdata.cloud/docs/cloud/insights/metric-correlations",target:"_blank",rel:"noreferrer"},a.createElement(v.Icon,{name:"nav_arrow_goto",color:"primary",width:"12px",height:"12px"}))),a.createElement(v.Flex,{alignItems:"center"},(!Z||D)&&a.createElement(P.Z,{content:ne?"Select an area of interest on any chart":"Click to find correlated metrics for the selected area",align:"bottom",enterDelay:200,showArrow:!0,activateOn:"hover"},a.createElement(U,{label:D?"Loading...":"Find correlations",isLoading:!1,onClick:te,disabled:ne,flavour:"hollow","data-ga":"metric-correlation::click-find-correlation::charts-view","data-testid":"metricCorrelation-find",small:!0,margin:[0,2,0,0],feature:"MetricCorrelations"})),a.createElement(P.Z,{content:"Close",align:"bottom"},a.createElement(Q,{neutral:!0,flavour:"borderless",onClick:function(){$(!1),ee(s.mt),B(),(0,S.L)("metrics-correlation","click-close","charts-view","".concat(Z?"finish":"start"))},"data-ga":"metric-correlation::click-close::charts-view","data-testid":"metricCorrelation-close",icon:"x",feature:"MetricCorrelations"}))))},Y=(0,K.Z)(v.Button),$=function(){var e=(0,f.TQ)("correlation");return a.createElement(P.Z,{content:function(){return a.createElement(v.Box,null,a.createElement("strong",null,"Troubleshoot with Metric Correlations"),a.createElement("br",null),a.createElement("br",null),"Metric correlations will help you identify potential root causes for an observed issue.",a.createElement("br",null),"It will automatically analyse all available metrics for irregular behavior for the same timeframe.")},align:"bottom",activateOn:"hover",isBasic:!0},a.createElement(Y,{width:"118px",flavour:"hollow",label:"Metric Correlations",onClick:function(){e(!0)},"data-ga":"metrics-correlation::click-metric-correlations::charts-view","data-testid":"run-correlation",small:!0,feature:"MetricCorrelations",isStart:!0}))},ee=n(20046),te=n(94829),ne=n(88866),re=n(24093),oe=n(77796),ae=n(12008),ie=n(22965),ce=Z.default.div.withConfig({displayName:"styled__Separator",componentId:"sc-1fhfk7c-0"})(["background:",";height:20px;width:1px;"],(0,v.getColor)("border")),le=n(83925);function ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ue(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ue(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var de=function(e){var t,n,r=e.flavour,o=(0,N.pG)(),i=(0,oe.ev)(o),c=(0,ae.n_)(i),l=c.critical,u=c.warning,s=(0,f.Sf)("sidebarTab",{flavour:"val",extraKey:r}),d=(0,f.Sf)("sidebarOpen",{flavour:"bool"}),m=(0,a.useCallback)((function(e){d(!0),s(e)}),[]),p=(0,N.iy)(o),g=p.hw,h=void 0===g?{}:g,b=p.cpus,y=p.isLive,E=p.name,w=p.os,x=void 0===w?{}:w,O=p.state,k=p.updateSeverity,C=p.labels,I=p.version,Z={dataTestId:"singleNode",isLive:y},j=(0,ie.kR)(se({count:l,type:"critical"},Z)),S=(0,ie.kR)(se({count:u,type:"warning"},Z)),P=(0,ie.Q5)(O),T=(0,ie.jo)(h.container,h.virtualization),D=(0,te.Z)("(min-width: 1760px)");return a.createElement(v.Flex,{alignItems:"center",background:"panelBg",border:{side:"all",color:"border"},"data-testid":"singleNode-badges-container",flex:!1,gap:1,padding:[1,2],round:1},a.createElement(v.TextSmall,{"data-testid":"singleNode-".concat(E),strong:!0},E),a.createElement(re.Z,{badge:"info","data-testid":"singleNode-nodeInfo-cta"},a.createElement(v.IconButton,{flavour:"borderless",cursor:"pointer",onClick:function(){return m("info")},icon:"information",iconColor:"nodeBadgeColor",tiny:!0,width:"18px",height:"18px"})),a.createElement(ce,{"data-testid":"singleNode-separator"}),a.createElement(re.Z,{badge:"alerts",nodeName:E},a.createElement(v.AlertMasterCard,{onClick:j.text||S.text?function(){return m("alerts")}:null,pillLeft:j,pillRight:S})),k&&a.createElement(le.Z,{"data-testid":"singleNode-update-cta",name:E,os:x.id,container:h.container,warningLevel:k,labels:C,version:I,text:k}),a.createElement(ce,{"data-testid":"singleNode-separator"}),a.createElement(re.Z,{badge:"connectivity",connectivityState:P,"data-testid":"singleNode-connectivityStateInfo",nodeName:E},a.createElement(v.Pill,{background:"nodeBadgeBackground",borderColor:"border",color:"nodeBadgeColor",flavour:"neutral",hollow:!0},P)),a.createElement(re.Z,{badge:"type","data-testid":"singleNode-nodeTypeInfo",nodeName:E,nodeType:T.label},a.createElement(v.Pill,{background:"nodeBadgeBackground",borderColor:"border",color:"nodeBadgeColor",flavour:"neutral",hollow:!0,icon:T.icon,iconSize:T.iconSize},T.label)),D&&a.createElement(re.Z,{badge:"systemInfo","data-testid":"singleNode-systemInfo",nodeName:E},a.createElement(v.Pill,{background:"nodeBadgeBackground",borderColor:"border",color:"nodeBadgeColor",flavour:"neutral",hollow:!0,normal:!0,icon:(null===(t=ne._[x.nm])||void 0===t?void 0:t.iconName)||(null===(n=ne.V[x.id])||void 0===n?void 0:n.iconName)||"os"},(0,ie.ys)(h.cpuFrequency)," (",b," ",1===h.cpus?"Core":"Cores",") -"," ",(0,ie.yo)(h.memory)," RAM - ",(0,ie.yo)(h.diskSpace))))},me=n(38671),fe=function(){var e=(0,me.Z)().onIntegrationsClick;return a.createElement(a.Fragment,null,a.createElement(v.Button,{icon:"integrations",flavour:"hollow",onClick:e,small:!0,label:"Integrations","data-ga":"integrations::click-integrations::charts-view","data-testid":"btn-show-integrations"}))},pe=["flavour"],ge={singleNode:de,default:ee.Z},he=(0,a.memo)((function(e){var t=e.flavour,n=(0,I.Z)(e,pe),o=(0,f.by)("correlation"),i=ge[t]||ge.default;return a.createElement(v.Flex,{alignItems:!o&&"center",background:"mainBackground",column:o,"data-testid":"overview-header",gap:2,justifyContent:o?"start":"between",padding:[2,2,2,4],width:"100%"},o?a.createElement(X,{flavour:t}):a.createElement(a.Fragment,null,a.createElement(i,(0,r.Z)({},n,{flavour:t})),a.createElement(v.Flex,{gap:2},a.createElement(fe,null),a.createElement($,null))))})),ve=n(15394),be=n(53499),ye=n(22962),Ee=n(61152),we=n(69743),xe=n(56102),Oe=n(11835),ke=(n(31672),n(59461),n(74916),n(4723),n(21249),n(57640),n(9924),n(69968)),Ce=n(88553),Ie=(n(48564),n(79424),n(71824)),Ze=n(17638),je=n(85993),Se=n(62525),Pe=n(41481),Ne=n(16978),Te=n(9058),De=n(64504),Me=n(89479),Be=function(e){return function(t){return"overview-page::".concat(e.getAttribute("id"),"::").concat(t)}},Fe=["chartId"],Ae=["id","ids"];function _e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Le(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_e(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Re=(0,Ie.wJ)((function(e){var t=e.id,n=e.menuChartAttributes,r=(0,b.UL)(),o=(0,Te.e)(),i=(0,De.u)(),c=(0,a.useMemo)((function(){var e,a="head-".concat(t),c=i.getChildren().find((function(e){return e.match({id:a})}));if(!c){var l=Le({contextScope:[(e=n).chartId]},(0,I.Z)(e,Fe));c=o.makeChart({attributes:Le(Le({},l),{},{roomId:r,id:a}),makeTrack:Be}),i.appendChild(c)}return c}),[r,t,i]);return(0,Me.Ni)(n.chartId)?a.createElement(Ne.Z,{chart:c,"data-track":c.track("container")}):null})),Ve=function(e,t){return e.layout||console.warn(t,"has no layout set, default values will be used."),Le(Le({x:0,y:0,w:3,h:5,i:e.id,chartId:e.chartId},e.layout),{},{minW:1,minH:1,static:!1})},ze={lg:12,md:12,sm:12,xs:12,xxs:1},Ke={lg:40,md:30,sm:30,xs:30,xxs:30},Ge=function(e){var t=e.id,n=e.ids,o=(0,I.Z)(e,Ae),i=(0,Ie.mQ)(n,Ve),c=(0,Pe.J1)().filteredChartsCount,l=(0,Ie.MS)(t),s=(0,a.useMemo)((function(){return{lg:i.filter((function(e){if(!e)return!1;var t=l(e.chartId);return t.visible&&!t.filteredOut&&!t.hidden}))}}),[n,i,c]),d=(0,a.useState)("lg"),m=(0,u.Z)(d,2),f=m[0],p=m[1],g=(0,Ce.Z)(),h=(0,u.Z)(g,2),v=h[0],b=h[1].width,y=(0,a.useMemo)((function(){return s.lg.map((function(e){var t=e.i;return a.createElement("div",{key:t},a.createElement(Re,{key:t,id:t}))}))}),[s]);return n.length?a.createElement(Ze.n,(0,r.Z)({width:"100%",margin:[2,0,0]},o,{ref:v}),a.createElement(ke.Responsive,{layouts:s,rowHeight:Ke[f],cols:ze,margin:[4,4],measureBeforeMount:!0,style:{minWidth:"100%",minHeight:"166px"},width:b||1e3,compactType:"horizontal",onBreakpointChange:p,useCSSTransforms:!1,isDraggable:!1,isResizable:!1},y)):null},He=(0,je.Lj)(Ge,(function(e){return{ids:e.headIds}})),Ue=(0,Se.Ji)(Ge,(function(e){return{ids:e.headIds}})),We=["id","isActiveSticky"],qe=function(e){var t=e.id,n=e.isActiveSticky,o=(0,I.Z)(e,We);return a.createElement(we.d,(0,r.Z)({id:t},o),a.createElement(xe.Y,{id:t,tiny:n,hasTooltip:n}),!n&&a.createElement(Oe.f,{id:t,isActiveSticky:n}),!n&&a.createElement(He,{id:t,tiny:n}))},Qe=(0,a.memo)(qe),Je=n(18039),Xe=n(87267),Ye=["id"],$e=["height"];function et(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?et(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):et(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var nt=[],rt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{selectedDimensions:e.dimensions?Object.keys(e.dimensions):nt,selectedInstances:e.instances?Object.keys(e.instances):nt,selectedNodes:e.nodes?Object.keys(e.nodes):nt,weight:e.weight}},ot=function(e){var t=e.id,n=(0,I.Z)(e,Ye),o=(0,b.UL)(),i=(0,De.u)(),c=(0,Ie.nI)(t),l=c.height,u=void 0===l?0:l,s=(0,I.Z)(c,$e),d=(0,Te.e)(),m=(0,Xe.Z)(),f=m.sendLog,p=m.isReady,g=(0,a.useMemo)((function(){var e=i.getNode({id:t});return e||(e=d.makeChart({attributes:tt({contextScope:[t],height:(0,Je.C)(i,t,u+360),id:t,roomId:o},s),makeTrack:Be}),i.appendChild(e),e)}),[i,o,t]);(0,a.useEffect)((function(){g&&p&&"function"===typeof f&&g.updateAttribute("logOptions",{sendLog:f,payload:{feature:"Overview"}})}),[g,f,p]);var h=(0,Ie.Q8)(t,rt),v=h.weight,y=h.selectedDimensions,E=h.selectedInstances,w=h.selectedNodes;return(0,a.useEffect)((function(){g&&v&&(g.updateAttributes({selectedDimensions:y,selectedInstances:E,selectedNodes:w}),g.trigger("fetch"))}),[o,t,v,y.length,E.length,w.length]),a.createElement(Ne.Z,(0,r.Z)({margin:[0,0,2],chart:g,"data-chartid":t,"data-track":g.track("container")},n))},at=a.memo(ot,(function(e,t){return e.id===t.id})),it=["id","subMenuId"],ct=function(e){var t=e.id,n=e.subMenuId,o=(0,I.Z)(e,it);return a.createElement(at,(0,r.Z)({id:t,role:"graphics-object","aria-roledescription":"chart","data-submenuid":n},o))},lt=(0,a.memo)(ct),ut=n(14048),st=n(12664),dt=function(e){var t=e.id,n=e.isActiveSticky;return a.createElement(ut.D,{gap:0,id:t},a.createElement(st.o,{id:t,margin:[1,0,0],hasTooltip:n}),!n&&a.createElement(Ue,{id:t}))},mt=(0,a.memo)(dt),ft=function(e){var t=e.id,n=(0,b.UL)(),r=(0,Te.e)(),o=(0,Ie.MS)(),i=(0,je.nk)(t).subMenuChartIds,c=(0,De.u)(),l=(0,a.useMemo)((function(){var e=(0,u.Z)(i,1)[0],a=(o(e),c.getChildren().find((function(e){return e.match({id:t})})));if(a)return a;var l=i.map((function(e){return{value:e,label:o(e).context}}));return a=r.makeChart({attributes:{id:t,contextScope:[e],roomId:n,composite:!0,chartLibrary:"groupBoxes",groupBy:["label"],groupByLabel:["k8s_namespace","k8s_pod_name"],aggregationMethod:"avg",eliminateZeroDimensions:!1,contextItems:l},makeTrack:Be}),c.appendChild(a),a}),[t,c]);return a.createElement(Ne.Z,{margin:[0,0,2],chart:l,"data-chartid":t,"data-track":l.track("container")})},pt=["id"],gt=function(e){var t=e.id,n=(0,I.Z)(e,pt);return a.createElement(we.d,{id:t,padding:[6,0,0]},a.createElement(xe.Y,{id:t}),a.createElement(Oe.f,{id:t,padding:[2,0,0]}),a.createElement(ft,(0,r.Z)({id:t},n)))},ht={k8s:(0,a.memo)(gt)},vt=function(e){if(ht[e.flavour])return ht[e.flavour];switch(e.level){case 0:return Qe;case 1:return mt;case 2:return lt;default:return null}},bt=function(e){var t=e.onChartNameChange,n=e.initialChartName,r=e.dashboardOptions,o=e.linkToGo,i=e.contextToGo,l=(0,Ee.Z)("addToDashboardModal"),s=(0,u.Z)(l,4),d=s[0],m=s[3],f=(0,ve.Z)({onChartNameChange:t,initialChartName:n,linkToGo:o,contextToGo:i}),p=f.setActiveMenuGroupId,g=f.setActiveSubMenuId;return a.createElement(c.v,null,a.createElement(be.Z,{onActiveMenuGroupId:p,onActiveSubMenuId:g,getComponent:vt,dashboardOptions:r,initialChartName:n}),d&&a.createElement(ye.Z,{onClose:m}))},yt=n(71181);function Et(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var wt=(0,a.memo)((function(){var e=(0,ae.O0)(),t=(0,u.Z)(e,2),n=t[0],r=t[1],i=(0,Te.e)(),c=!!n&&!!i&&i.getNode({id:n.context}),l=function(){if(r(null),null!==n&&void 0!==n&&n.context&&c){var e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Et(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Et(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},c.getAttribute("overlays"));delete e.alert,c.updateAttribute("overlays",e),history.replaceState({},"")}};(0,a.useEffect)((function(){return l}),[]);var s=(0,b.UL)(),d=(0,Me.Cd)((null===n||void 0===n?void 0:n.context)&&s,null===n||void 0===n?void 0:n.context);if(!n||null===d||void 0===d||!d.loaded)return null;var m=d.firstEntry;return a.createElement(v.Layer,{backdrop:!1,position:"top",margin:[26,0,0],padding:[26,0,0]},a.createElement(v.Flex,{background:["neutral","black"],padding:[1,2],gap:2},a.createElement(v.TextSmall,{color:["neutral","porcelain"]},"Showing alert in ",a.createElement(v.TextSmall,{color:"bright"},n.instance)," on"," ",a.createElement(v.TextSmall,{color:"bright"},new Date(1e3*n.lastStatusChange).toLocaleString()),!m&&" doesn't exist on the node anymore",!!m&&m>n.lastStatusChange&&" exceeds agent data retention settings"),a.createElement(v.Flex,{flex:!1},a.createElement(v.Icon,{name:"x",color:"bright",onClick:l,size:"small"}))))})),xt=wt;function Ot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ot(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ot(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ct={NoChartsView:g.Z,NoNodesView:l.Z,sidebar:{title:"Filters",hiddenTabs:["info"],Component:yt.ZP,props:{}},dashboardOptions:{},loadingMessage:"Loading charts...",Header:he},It={overview:kt(kt({},Ct),{},{sidebar:kt(kt({},Ct.sidebar),{},{title:"Overview"}),feature:"Overview"}),k8s:kt(kt({},Ct),{},{NoChartsView:C,NoNodesView:C,sidebar:kt(kt({},Ct.sidebar),{},{title:"Kubernetes"}),loadingMessage:"Loading k8s charts...",feature:"Kubernetes"}),singleNode:kt(kt({},Ct),{},{sidebar:kt(kt({},Ct.sidebar),{},{title:"Single Node",hiddenTabs:["filters"],props:{showCollapsed:!0}}),feature:"SingleNode"})},Zt=function(){return function(){var e=(0,d.E)(),t=(0,s.yp)({nodeIds:e,flavour:"rhs"}),n=(0,m.$B)(),r=(0,u.Z)(n,2),o=r[0],i=r[1],c=(0,f.by)(),l=c.after,p=c.before;(0,a.useEffect)((function(){t()}),[o,i,l,p])}(),null},jt=(0,a.memo)((function(e){var t=e.flavour,n=void 0===t?"overview":t,o=e.invalidationKey,l=e.nodeIds,u=e.loaded,s=e.getChart,d=e.chartIds,m=e.areChartsIdsEmpty,f=e.showNoChartsView,v=e.showNoNodesView,b=e.initializing,y=e.chartName,E=e.setChartName,w=e.chartsLoaded,x=e.widthRef,O=e.queryableNodeIds,k=e.nodesKey,C=It[n],I=C.dashboardOptions,Z=C.NoChartsView,j=C.NoNodesView,S=C.sidebar,P=C.loadingMessage,N=C.Header,T=C.feature,D=void 0===T?"Overview":T,M=(0,i.TH)().state;return v?a.createElement(G.ZP,{feature:D,mode:"NoNodesView"},a.createElement(j,null)):b?a.createElement(h.Z,{title:"Please wait while charts are being initialized.",body:"Thank you for your patience!"}):u?f?a.createElement(G.ZP,{feature:D,mode:"NoChartsView"},a.createElement(N,{flavour:n}),a.createElement(Z,null)):a.createElement(G.ZP,{feature:D},a.createElement(c.Z,{key:o,getObject:s,ids:d,linkToGo:null===M||void 0===M?void 0:M.chartName,extraKey:n,deps:[k]},a.createElement(Zt,null),a.createElement(xt,null),a.createElement(p.Z,{ref:x,sidebar:a.createElement(S.Component,(0,r.Z)({nodeIds:O||l,title:S.title,initialChartName:y,hiddenTabs:S.hiddenTabs,flavour:n,loaded:w},S.props))},a.createElement(N,{flavour:n}),w?m?a.createElement(g.Z,null):a.createElement(bt,{dashboardOptions:I,initialChartName:y,onChartNameChange:E,linkToGo:null===M||void 0===M?void 0:M.chartName,contextToGo:null===M||void 0===M?void 0:M.contextToGo}):a.createElement(h.Z,{title:P})))):a.createElement(h.Z,{title:P})})),St=jt},30569:function(e,t,n){n.d(t,{Z:function(){return p}});var r=n(87462),o=n(67294),a=n(97945),i=n(7335),c=n(74059),l=n(54227),u=n(29439),s=(n(92222),n(89250)),d=n(37518),m=n(4822),f=function(e){var t=(0,d.A3)(),n=(0,s.s0)(),r=(0,m.I0)("alert_id"),a=(0,u.Z)(r,2),i=a[0],c=a[1];(0,o.useEffect)((function(){i&&(c(),n("".concat(t,"/alerts/").concat(i,":::").concat(e)))}),[i,e])},p=function(e){return function(t){var n=(0,c.th)(),u=(0,a.pG)();f(u);var s=(0,a.iy)(u,"isLive"),d=(0,a.iy)(u,"name");(0,l.bV)({title:d,id:u,destination:u});var m=(0,a.TQ)(u,n),p=(0,i.DH)();(0,o.useEffect)((function(){if(s&&"hasValue"===m.state){var e=m.contents;null!==e&&void 0!==e&&e.uid&&d&&p(e.uid,null,d)}}),[m,s,d]);var g=(0,o.useMemo)((function(){return[u]}),[u]);return o.createElement(e,(0,r.Z)({flavour:"singleNode",nodeIds:g},t))}}},71181:function(e,t,n){n.d(t,{Xc:function(){return _e},ZP:function(){return Ge}});n(82526),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(87462),o=n(29439),a=n(45987),i=n(4942),c=(n(57327),n(41539),n(88449),n(2490),n(59849),n(47941),n(26699),n(32023),n(34553),n(21249),n(57640),n(9924),n(67294)),l=n(48286),u=n(71893),s=n(59978),d=n(4822),m=n(96703),f=n(20777),p=n(96008),g=n(97945),h=n(46038),v=n(21872),b=n(22965),y=function(e){var t=e.node.labels||{},n=t._cloud_instance_region,r=t._cloud_instance_type,o=t._cloud_provider_type;return(0,b.O2)(n)&&(0,b.O2)(r)&&(0,b.O2)(o)?null:c.createElement(h.Z,{name:"Cloud Instance Info"},c.createElement(v.Z,{iconName:"ipNetworking",name:"Cloud provider",size:"small",testId:"sidebar-nodeInfoContent-cloudProvider"},(0,b.MC)(o)),c.createElement(v.Z,{iconName:"universe",name:"Cloud region",size:"small",testId:"sidebar-nodeInfoContent-cloudRegion"},(0,b.MC)(n)),c.createElement(v.Z,{iconName:"disk",name:"Instance type",size:"small",testId:"sidebar-nodeInfoContent-instanceType"},(0,b.MC)(r)))},E=n(83925),w=n(11389),x=function(e){var t=e.node,n=(0,b.Q5)(t.state);return c.createElement(h.Z,{link:"https://learn.netdata.cloud/docs/agent/aclk",name:"Connection"},c.createElement(v.Z,{size:"small",name:"Status",iconName:"integrations",testId:"sidebar-connectionGroup-connectionStatus"},c.createElement(w.Z,{rawState:n})),c.createElement(v.Z,{size:"small",name:"Netdata Agent",iconName:"netdata",testId:"sidebar-connectionGroup-agentVersion"},t.version),t.updateSeverity&&c.createElement(v.Z,{size:"small",name:"Update Status",iconName:"update",testId:"sidebar-connectionGroup-agentVersion"},c.createElement(E.Z,{name:t.name,os:t.os.id,container:t.hw.container,warningLevel:t.updateSeverity,labels:t.labels||{},version:t.version,text:t.updateSeverity})))},O=n(18339),k=function(e){var t;return(null===(t=O.D[e])||void 0===t?void 0:t.iconName)||"services"},C=function(e){var t,n=e.node;return null!==(t=n.services)&&void 0!==t&&t.length?c.createElement(h.Z,{link:"https://learn.netdata.cloud/docs/agent/collectors/collectors#service-and-application-collectors",name:"Services"},n.services.map((function(e){return c.createElement(v.Z,{size:"small",key:e,iconName:k(e),name:e,testId:"sidebar-ServicesGroup-service-".concat(e)})}))):null},I=(n(23157),function(e){var t=e.node,n=(void 0===t?{}:t).labels,r=void 0===n?{}:n,o=Object.keys(r).filter((function(e){return!e.startsWith("_")}));return c.createElement(h.Z,{link:"https://learn.netdata.cloud/guides/using-host-labels",name:"Host labels",isEnabled:o.length>0,noDataLabel:"No Data"},o.length>0&&o.map((function(e){return c.createElement(v.Z,{size:"small",key:e,name:e,testId:"sidebar-hostLabelsGroup-label"},r[e])})))}),Z=(n(38862),n(52428)),j=function(e){var t=e.node;return c.createElement(h.Z,{name:"Files"},c.createElement(s.Flex,{gap:1,padding:[0,1],alignItems:"center"},c.createElement(s.Box,{sx:{fontWeight:"500",letterSpacing:"1px"},as:s.Text,color:"textLite"},"{;}"),c.createElement(s.TextSmall,null,"View node info in"),c.createElement(s.Flex,{cursor:"pointer",gap:1,onClick:(0,Z.J)(JSON.stringify(t),{text:"JSON copied to clipboard"})},c.createElement(s.TextSmall,{color:"primary"},"json"),c.createElement(s.Icon,{color:"primary",size:"small",name:"copy"}))))},S=(0,c.memo)(j),P=function(e){var t,n=e.nodeIds,r=e.flavour,o=(0,d.tk)("sidebarNodeId",{defaultValue:n[0],flavour:"val",extraKey:r}),a=(0,g.iy)(o),i=(0,b.jo)(a.container,a.virtualization);return a.id?c.createElement(s.Flex,{column:!0,gap:1,overflow:{horizontal:"hidden",vertical:"auto"},padding:[2,1,2,0],width:"100%"},c.createElement(s.TextBig,{strong:!0},"Info"),c.createElement(s.Flex,{column:!0,padding:[2,0,3],border:{side:"bottom",color:"borderSecondary"}},false,c.createElement(s.TextSmall,{"data-testid":"sidebar-nodeInfoContent-hostname",strong:!0},"Hostname: ",a.name)),c.createElement(x,{node:a}),c.createElement(y,{node:a}),c.createElement(h.Z,{name:"System info"},c.createElement(v.Z,{size:"small",name:"Type",iconName:"virtualization",testId:"sidebar-nodeInfoContent-type"},c.createElement(s.Pill,{hollow:!0,icon:i.icon,iconSize:i.iconSize,flavour:"neutral"},i.label)),c.createElement(v.Z,{size:"small",name:"O/S version",iconName:"database",testId:"sidebar-nodeInfoContent-osVersions"},(0,b.cB)(a.os.nm,a.os.v,", ")),c.createElement(v.Z,{iconName:"viewSingleNode",name:"Architecture",size:"small",testId:"sidebar-nodeInfoContent-architecture"},(0,b.MC)(a.hw.architecture)),!(null===(t=a.os)||void 0===t||!t.kernel)&&c.createElement(v.Z,{size:"small",name:"Kernel",iconName:"metrics_explorer",testId:"sidebar-nodeInfoContent-kernel"},(0,b.cB)(a.os.kernel.nm,a.os.kernel.v,", ")),c.createElement(v.Z,{size:"small",name:"CPU",iconName:"cpu",testId:"sidebar-nodeInfoContent-cpu"},(0,b.ys)(a.hw.cpuFrequency)," (",(0,b.MC)(a.hw.cpus,1===a.hw.cpus?"Core":"Cores"),")"),c.createElement(v.Z,{size:"small",name:"Memory",iconName:"ram",testId:"sidebar-nodeInfoContent-ram"},(0,b.MC)((0,b.yo)(a.hw.memory),"RAM")),c.createElement(v.Z,{size:"small",name:"Hard disk size",iconName:"disk",testId:"sidebar-nodeInfoContent-disk"},(0,b.yo)(a.hw.diskSpace))),c.createElement(I,{node:a}),c.createElement(C,{node:a}),c.createElement(S,{node:a})):c.createElement(s.Text,null,"Select a node to see its' info")},N=n(82351),T=n(93433),D=(n(2707),n(77796)),M=n(12008),B=n(91008),F=(n(92222),n(89250)),A=n(12599),_=n(89405),L=n(50358),R=(0,u.default)(s.Flex).withConfig({displayName:"alert__AlertContainer",componentId:"sc-ndxwzg-0"})(["transition:opacity 0.3s ease-in-out;&:hover{& ","{opacity:0.7;}}"],s.Text),V={overview:"overview",k8s:"kubernetes",singleNode:"nodes/:nodeId"},z=function(e){var t=e.alert,n=e.onAlertClick,r=e.flavour,o=t.value,a=t.instance,i=t.lastStatusChange,l=t.id,u=t.status,d=t.units,m=t.name,f=t.summary,p=t.nodeId,h=(0,g.iy)(p,"name"),v=(0,_.rA)(),b=v.localeTimeString,y=v.localeDateString,E=(0,c.useMemo)((function(){var e=new Date(1e3*i);return isNaN(e.valueOf())?"":"".concat(y(e,{long:!1})," ").concat(b(e,{secs:!1}))}),[i,b,y]),w=(0,c.useCallback)((function(){n({alertId:l})}),[]),x=(0,F.UO)(),O=(0,F.s0)();return c.createElement(R,{column:!0,padding:[4,0],gap:1,border:{color:"border",side:"bottom"},"data-testid":"alertItem","data-test-name":"alertItem-".concat(m)},c.createElement(s.Flex,{column:!0},c.createElement(N.Z,{plain:!0,content:f,isBasic:!0},c.createElement(s.Text,{strong:!0,"data-testid":"alertItem-alertName"},m)),c.createElement(s.TextSmall,{wordBreak:"break-all","data-testid":"alertItem-chartId"},a," @ ",h)),c.createElement(s.Flex,{alignItems:"center",justifyContent:"between"},c.createElement(L.Z,{loaded:!0,status:u,units:d,value:o,flex:!1,"data-testid":"alertItem-alertValuePill"}),c.createElement(s.TextMicro,{color:"textLite","data-testid":"alertItem-alertDate"},E)),c.createElement(s.Flex,{gap:1},!!V[r]&&c.createElement(c.Fragment,null,c.createElement(B.Z,{Component:s.TextMicro,onClick:function(){O((0,A.Gn)("/spaces/:spaceSlug/rooms/:roomSlug/".concat(V[r]),x),{replace:!0,state:{alertId:l}})}},"Plot on chart"),c.createElement(s.TextMicro,{color:"textLite"},"\u2022")),c.createElement(B.Z,{Component:s.TextMicro,onClick:w},"Show info")))},K=n(61294),G=function(e,t){return e.status===t.status?0:"critical"===e.status?-1:1},H={nodesView:!0},U=function(e){var t=e.nodeIds,n=e.flavour,r=(0,d.D0)("sidebarNodeId",{flavour:"val",extraKey:n}),a=(0,o.Z)(r,2),i=a[0],l=a[1],u=(0,g.iy)(i),m=(0,D.rw)(i?[i]:t),f=(0,M.ER)(m),p=(0,c.useMemo)((function(){return(0,T.Z)(f).sort(G)}),[f]),h=(0,K.Z)(),v=(0,o.Z)(h,4),b=v[0],y=v[1],E=v[3],w=f.length?"(".concat(f.length,")"):"";return c.createElement(s.Flex,{width:"100%",column:!0,overflow:"hidden",padding:[2,0]},c.createElement(s.Flex,{column:!0,gap:5},c.createElement(s.Flex,{column:!0},c.createElement(N.Z,{content:"Currently Active alerts",align:"bottom"},c.createElement(s.TextBig,{strong:!0,"data-testid":"nodeAlertsView-activeAlerts-header"},"Alerts ",w)),!!H[n]&&c.createElement(s.TextMicro,null,"Showing ",u.id?c.createElement(s.TextMicro,{strong:!0},u.name):"room"," alerts"," ",!!u.id&&c.createElement(c.Fragment,null," ","-"," ",c.createElement(B.Z,{Component:s.TextMicro,onClick:function(){return l("")}},"Show all")))),!f.length&&c.createElement(s.Flex,{column:!0,gap:8,padding:[0,5],"data-testid":"nodesAlertsView-blankSlate",alignItems:"center"},c.createElement(s.Icon,{name:"checkmark",width:"90px",height:"90px"}),c.createElement(s.H4,{textAlign:"center"},1!==t.length?"No":"This node has no"," active alerts, you are all good!"))),c.createElement(s.Flex,{column:!0,overflow:{vertical:"auto"}},p.map((function(e){return c.createElement(z,{key:e.id,alert:e,onAlertClick:y,flavour:n})}))),b&&E)},W=(n(74916),n(15306),n(30181)),q=n(15394),Q=n(92432),J=n(6609),X=n(89479),Y=(n(85827),n(25387),n(72608),n(85993)),$=n(45335),ee=n(46189),te=n(46667),ne=n(74059),re=n(37518),oe=ee.Z.demoSlug,ae=ee.Z.demoFavourites,ie=(0,u.default)(s.Icon).attrs({size:"small",name:"chevron_left",color:"textLite"}).withConfig({displayName:"favourites__StyledChevron",componentId:"sc-mwcyj8-0"})(["transition:transform 0.2s ease-in-out;"]),ce={showChildren:!1},le=function(e){var t,n=e.onMenuGroupClick,r=e.onSubMenuClick,a=e.initialChartName,i=e.flavour,l=(0,ne.uk)(),u=(0,re.vf)(),d=oe===l&&ae[u]||[],m=(0,Y.UG)((t=d,function(e){return t.reduce((function(t,n){return e[n]?[].concat((0,T.Z)(t),[n]):t}),[])})),f=(0,q.Z)({onMenuGroupClick:n,onSubMenuClick:r}),p=f.onMenuGroupClick,g=f.onSubMenuClick,h=(0,te.Z)(!0),v=(0,o.Z)(h,2),b=v[0],y=v[1],E=(0,$.sm)();return(0,c.useEffect)((function(){E&&!a&&m.length&&n(m[0])}),[E,a]),m.length?c.createElement(s.Flex,{column:!0,gap:1,border:{side:"bottom",color:"borderSecondary"},padding:[0,0,2]},c.createElement(s.Flex,{onClick:y,cursor:"pointer",alignItems:"center",justifyContent:"between"},c.createElement(s.Flex,{gap:1,alignItems:"center"},c.createElement("i",{className:"fa-regular fa-star"}),c.createElement(s.Text,{strong:!0,color:"textFocus"},"Favourites")),c.createElement(ie,{rotate:b?1:3,alignSelf:"end"})),c.createElement(s.Collapsible,{open:b,padding:[0,0,0,2]},c.createElement(W.v,{menuGroupIds:m,onMenuGroupClick:p,onSubMenuClick:g,menuGroupProps:ce,extraKey:i}))):null},ue={nodesView:function(){return!0},default:X.pT},se=function(e){return(0,Q.L)("metric-sidebar","click-".concat(me(e)),"mn-overview")},de=function(e){var t=me(e);(0,Q.L)("metric-sidebar","click-".concat(t),"mn-overview",t)},me=function(e){return e.startsWith("Kubernetes")?"k8s":e.replace(/[^\w]/g,"-").toLowerCase()},fe=function(e){var t=e.initialChartName,n=e.loaded,r=e.hasSearch,o=void 0===r||r,a=e.flavour,i=(0,q.Z)({onMenuGroupClick:se,onSubMenuClick:de,loaded:n}),l=i.onMenuGroupClick,u=i.onSubMenuClick,d=ue[a]||ue.default;return c.createElement(c.Fragment,null,o&&c.createElement(s.Flex,{column:!0,position:"sticky",top:"0",gap:1},c.createElement(s.Text,{strong:!0},"Sections and Charts"),c.createElement(J.Z,null)),n&&c.createElement(c.Fragment,null,c.createElement(le,{onMenuGroupClick:l,onSubMenuClick:u,initialChartName:t,useItemsAreVisible:d,flavour:a}),c.createElement(W._,{position:"relative",onMenuGroupClick:l,onSubMenuClick:u,width:"100%",useItemsAreVisible:d,extraKey:a})))},pe=n(97193),ge=n(8144),he=["roomId","flavour"],ve=function(e){var t=e.roomId,n=e.flavour,o=(0,a.Z)(e,he),i=function(e){return(0,c.useMemo)((function(){return{Live:{head:{label:"Live nodes",textColor:"textLite",iconName:"connectivityStatusLive",hasAlerts:!0},node:{textColor:"text",showAlerts:!0}},Stale:{head:{label:"Stale nodes",textColor:"textLite",iconName:"connectivityStatusStale",hasAlerts:!0},node:{textColor:"text",showAlerts:!0}},Offline:{head:{label:"Offline nodes",textColor:"textLite",iconName:"connectivityStatusOffline",disabled:!0},node:{textColor:"textLite",disabled:!0}}}}),[e])}(n);return"singleNode"===n?null:c.createElement(ge.Z,(0,r.Z)({title:"Nodes",testIdPrefix:"nodes",baseKey:t,extraKey:n,param:"selectedIds"},o),c.createElement(pe.Z,{baseKey:t,extraKey:n,statusProps:i,background:"mainBackground",itemProps:{padding:[1,1,1,.5],maxLength:24},searchMargin:[0,0,2],height:{max:"300px"}}))},be=(n(69720),n(597)),ye=n(80239),Ee=n(46742);function we(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var xe=function(e){var t=e.extraKey,n=e.param,r=e.paramKey,a=(0,be.K)({extraKey:t,omit:[n],keepAll:!0}),l=(0,d.tk)(n,{extraKey:t,flavour:"arr"});return(0,c.useMemo)((function(){return Object.entries(a.reduce((function(e,t){return e[t[r]]=(e[t[r]]||0)+(t.hidden?0:1),e}),function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?we(Object(n),!0).forEach((function(t){(0,i.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):we(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},ye.VP[n]||{}))).map((function(e){var t=(0,o.Z)(e,2);return{id:t[0],count:t[1]}}))}),[a.filter((function(e){return e.hidden})).length,l])},Oe=function(e){return e.id},ke=function(e){var t=e.baseKey,n=e.param,r=e.paramKey,o=e.extraKey,a=e.testIdPrefix,i=e.title,l=xe({param:n,extraKey:o,paramKey:r});return l.length?c.createElement(ge.Z,{title:i,testIdPrefix:a,baseKey:t,extraKey:o,param:n},c.createElement(Ee.ZP,{param:n,baseKey:t,extraKey:o,testIdPrefix:a,collection:l,getValue:Oe,getLabel:Oe})):null},Ce=(n(86535),n(99244),n(74326),n(82499),n(64211),n(41874),n(66992),n(70189),n(78783),n(88921),n(96248),n(13599),n(11477),n(64362),n(15389),n(90401),n(45164),n(91238),n(54837),n(87485),n(56767),n(76651),n(61437),n(35285),n(39865),n(33948),n(91966)),Ie=n.n(Ce),Ze=["baseKey","extraKey","param","testIdPrefix","itemsProps","itemProps"];function je(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?je(Object(n),!0).forEach((function(t){(0,i.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):je(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Pe=function(e){var t=e.baseKey,n=e.extraKey,i=e.param,u=e.testIdPrefix,m=e.itemsProps,f=e.itemProps,p=(0,a.Z)(e,Ze),g=function(e){var t=e.extraKey,n=e.param,r=(0,be.K)({extraKey:t,omit:[n],keepAll:!0}),a=(0,d.tk)(n,{extraKey:t,flavour:"arr"});return(0,c.useMemo)((function(){return Object.entries(r.reduce((function(e,t){var n=t.type,r=t.component,o=t.hidden;return e[n]=e[n]||{count:0,children:{}},e[n].count=(e[n].count||0)+(o?0:1),e[n].children[r]=(e[n].children[r]||0)+(o?0:1),e}),{})).reduce((function(e,t){var n=(0,o.Z)(t,2),r=n[0],a=n[1],i=a.count,c=a.children;return e.push({id:r,count:i,children:Object.entries(c).map((function(e){var t=(0,o.Z)(e,2),n=t[0],a=t[1];return{value:"".concat(r,"|").concat(n),label:n,count:a,level:1}}))}),e}),[])}),[r.filter((function(e){return e.hidden})).length,a])}({param:i,extraKey:n}),h=(0,d.I0)(i,{defaultValue:[],key:t,extraKey:n,flavour:"arr"}),v=(0,o.Z)(h,2),b=v[0],y=v[1];(0,l.Z)((function(){g.length&&b.length&&y((function(e){return e.filter((function(e){return g.some((function(t){return t.children.some((function(t){return t.value===e}))}))}))}))}),[g.length,y]);var E=(0,c.useCallback)((function(e){var t=e.value,n=e.checked;y((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(t)?n?(0,T.Z)(new Set([].concat((0,T.Z)(e),(0,T.Z)(t)))):Ie()(e,t):n?[].concat((0,T.Z)(e),[t]):e.filter((function(e){return e!==t}))}))}),[y]),w=(0,c.useMemo)((function(){return function(e){var t=e.options,n=e.selected,r=e.itemsProps;if(!t.length)return[];var o=t.flatMap((function(e){return e.children.map((function(e){return e.value}))})),a=o.length===n.length,i=!a&&!!n.length;return[Se(Se({},r.head),{},{label:"Select all",value:o,selected:a,indeterminate:i})].concat((0,T.Z)(t.flatMap((function(e){var t=e.id,o=e.children,a=e.count,i=n.length&&!o.some((function(e){return!n.includes(e.value)})),c=!i&&n.length&&o.some((function(e){return n.includes(e.value)}));return o.reduce((function(e,t){var o=n.includes(t.value);return[].concat((0,T.Z)(e),[Se(Se(Se({},r.row),t),{},{selected:o})])}),[Se(Se({},r.head),{},{label:t,value:o.map((function(e){return e.value})),selected:i,indeterminate:c,count:a})])}))))}({options:g,selected:b,itemsProps:m})}),[b,y,g]);return g.length?c.createElement(ge.Z,{title:"Alert type & component",testIdPrefix:u,baseKey:t,extraKey:n,param:i},c.createElement(s.MenuDropdown,(0,r.Z)({hideShadow:!0,height:{max:"300px"},width:{max:"600px"},background:"mainBackground",overflow:"auto",padding:[0,0,3],"data-testid":"".concat(u,'-filter-selections"'),searchMargin:[0,0,2],items:w,onItemClick:E,value:b,"data-value":b.join(",")||"all-selected",hasSearch:g.length>5,itemProps:Se({testIdPrefix:u},f)},p))):null};Pe.defaultProps=Ee.ZP.defaultProps;var Ne=Pe,Te=["flavour"],De=(0,c.memo)((function(e){var t=e.flavour,n=(0,a.Z)(e,Te),o=(0,re.UL)();return c.createElement(s.Flex,(0,r.Z)({column:!0,overflow:{vertical:"auto"},padding:[0,0,30]},n),"alerts"===t&&c.createElement(c.Fragment,null,c.createElement(ke,{title:"Alert status",testIdPrefix:"alert-status",baseKey:o,extraKey:t,param:"alertStatuses",paramKey:"status"}),c.createElement(ke,{title:"Alert class",testIdPrefix:"alert-class",baseKey:o,extraKey:t,param:"alertClasses",paramKey:"class"}),c.createElement(Ne,{testIdPrefix:"alert-type-component",baseKey:o,extraKey:t,param:"alertTypeComponents"}),c.createElement(ke,{title:"Alert role",testIdPrefix:"alert-role",baseKey:o,extraKey:t,param:"alertRoles",paramKey:"recipient"})),c.createElement(ve,{roomId:o,flavour:t}))})),Me=["tabs","hiddenTabs","title","nodeIds"],Be=["iconName","Content","dataTestId","color","label"];function Fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fe(Object(n),!0).forEach((function(t){(0,i.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _e={color:{active:"success",notActive:"textLite"},minWidth:"auto"},Le={chartIndexing:Ae(Ae({},_e),{},{iconName:"charts_view",Content:fe,dataTestId:"nodeInfo-chartIndexing",label:"Charts"}),filters:Ae(Ae({},_e),{},{iconName:"filterList",Content:De,dataTestId:"nodeInfo-filters",label:"Filters"}),alerts:Ae(Ae({},_e),{},{iconName:"alarm_bell",Content:U,dataTestId:"nodeInfo-alertsTab",label:"Alerts"}),info:Ae(Ae({},_e),{},{iconName:"information",dataTestId:"nodeInfo-alertsTab",Content:P,label:"Info"})},Re=[],Ve=(0,u.default)(s.Tabs).withConfig({displayName:"sidebar__StyledTabs",componentId:"sc-1d5ify6-0"})(["overflow:hidden;height:100%;"]),ze=function(e){e.flavour;var t=e.children;return c.createElement(c.Fragment,null,t)},Ke=function(e){var t=e.isActive,n=e.color,r=e.name,o=e.label;return c.createElement(N.Z,{plain:!0,content:o},c.createElement(s.Icon,{name:r,color:t?n.active:n.notActive,height:"18px",width:"18px"}))},Ge=function(e){var t=e.tabs,n=void 0===t?Le:t,i=e.hiddenTabs,u=void 0===i?Re:i,g=e.title,h=e.nodeIds,v=void 0===h?Re:h,b=(0,a.Z)(e,Me),y=(0,d.D0)("sidebarTab",{defaultValue:"",flavour:"val",extraKey:b.flavour}),E=(0,o.Z)(y,2),w=E[0],x=E[1],O=(0,c.useMemo)((function(){return Object.keys(n).filter((function(e){return!u.includes(e)}))}),[u]),k=(0,c.useMemo)((function(){var e=O.findIndex((function(e){return e===w}));return-1===e?0:e}),[w]),C=(0,d.D0)("sidebarOpen",{defaultValue:!0,flavour:"bool"}),I=(0,o.Z)(C,2),Z=I[0],j=I[1],S=(0,c.useCallback)((function(e){x(O[e]),j()}),[O]);return(0,l.Z)((function(){j(!0)}),[k]),c.createElement(m.ZP,{collapsedComponent:c.createElement(f.Z,{onClickTab:S,availableTabs:n,tabsToShow:O}),isOpen:Z,header:c.createElement(p.Z,{isOpen:Z,onToggle:function(){return j(!Z)},title:g})},c.createElement(s.Flex,{"data-testid":"sidebar-tabs",column:!0,overflow:"hidden",height:"100%"},c.createElement(Ve,{selected:k,onChange:S,noDefaultBorder:!0,TabsHeader:(0,c.useMemo)((function(){return function(e){return c.createElement(ze,(0,r.Z)({flavour:b.flavour},e))}}),[b.flavour])},O.map((function(e,t){var o=n[e],i=o.iconName,l=o.Content,u=o.dataTestId,d=o.color,m=o.label,f=(0,a.Z)(o,Be);return c.createElement(s.Tab,(0,r.Z)({style:{display:1===O.length?"none":"inherit"},"data-testid":u,maxWidth:"100%",key:i,small:!0,label:c.createElement(Ke,{isActive:w===t,name:i,color:d,label:m})},f),c.createElement(s.Flex,{column:!0,overflow:"hidden",height:"100%",position:"relative",gap:3,padding:[1,2]},c.createElement(l,(0,r.Z)({nodeIds:v},b))))})))))}},64504:function(e,t,n){n.d(t,{B:function(){return c},u:function(){return i}});n(69826),n(41539),n(31672),n(2490),n(59461),n(74916),n(4723);var r=n(4480),o=n(9058),a=(0,r.cn)({key:"currentChartsContainerKey",default:null}),i=function(){var e=(0,o.e)(),t=(0,r.sJ)(a);return e&&e.getRoot().getChildren().find((function(e){return e.match({id:t})}))},c=function(){return(0,r.Zl)(a)}},77901:function(e,t,n){n.d(t,{Z:function(){return _}});n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(4942),o=n(29439),a=(n(26699),n(32023),n(92222),n(47941),n(67294)),i=n(88553),c=n(37176),l=n(44536),u=n(89250),s=n(74059),d=n(37518),m=n(96929),f=n(89479),p=n(40970),g=n(97945),h=n(2077),v=n(41481),b=n(42448),y=n(4822),E=n(12008),w=n(39840),x=n(39612);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(69826),n(31672),n(59461),n(74916),n(4723);var C=n(24298),I=n(96415),Z=n(70873),j=n(43460),S=n(84817),P=n(9058),N=n(48286),T=n(18039),D=n(64504);function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var F={default:{shouldHide:function(){return!1}},k8s:{shouldHide:function(e){return!e.context.includes("k8s")}}},A=[],_=function(e){return(0,a.memo)((function(t){var n=t.flavour,r=void 0===n?"overview":n,O=t.nodeIds,M=void 0===O?A:O,_=(0,s.th)(),L=(0,d.UL)(),R=(0,y.TA)({extraKey:r,defaultValue:M});R=M.length?M:R;var V=(0,m.fD)(),z=(0,f.hH)(L),K=(0,u.TH)().state,G=(0,f.Cd)(L),H=(0,g.Mm)(R),U=(0,p.Z)(L,H,{spaceId:_}),W=(0,h.d5)({nodeIds:R,flavour:r},_,L),q=W.contexts,Q=W.metadata,J=W.loaded,X=W.dimensionsCount,Y=function(){var e=(0,u.TH)().state,t=((void 0===e?{}:e)||{}).alertId,n=void 0===t?null:t,r=(0,E.O0)(),i=(0,o.Z)(r,2),c=i[0],l=i[1],s=n||(null===c||void 0===c?void 0:c.id),d=(0,E.E5)(s);(0,E.yx)(d.id),(0,a.useEffect)((function(){(d.fullyLoaded||d.id)&&l(k(k({},d),{},{formattedLastStatusChangeValue:(0,w.m9)(d.lastStatusChangeValue,d.units),linkToGo:"chart_".concat((0,x.Z)(d.context))}))}),[d.id,d.fullyLoaded]);var m=null!==c&&void 0!==c&&c.id?"chart_".concat((0,x.Z)(c.context)):null;return[d.id,m]}(),$=(0,o.Z)(Y,2)[1],ee=M?M.join():r,te=(0,s.Q6)(),ne=(0,i.Z)(),re=(0,o.Z)(ne,2),oe=re[0],ae=re[1].width;!function(e,t,n){var r=n.width,i=n.host;if(!i)throw"No host provided";var c=(0,P.e)(),l=(0,a.useRef)(),s=(0,f.QX)(e,"error"),d=(0,y.I0)(),m=(0,o.Z)(d,2),p=m[0].correlation,g=m[1],h=(0,u.TH)(),v=h.state,b=h.pathname,E=(0,D.B)(),w=(0,f.qU)(e),x=(0,f.w4)(e);(0,a.useLayoutEffect)((function(){if(e&&c&&!s){var n=c.getRoot().getChildren().find((function(e){return e.match({id:b})}));if(!n)return n=c.makeContainer({attributes:{id:b,roomId:e,host:i,navigation:p?"highlight":"pan",overlays:{proceeded:{type:"proceeded"}},composite:!0,nodesScope:t,hasCorrelation:!0,versions:w,width:r,toolboxElements:[j.default,I.default,Z.default,S.Z]}}),c.appendChild(n),E(b),l.current=n,(0,C.unregister)((0,T.M)(c,n),c.on("correlation",(function(e,t){t&&g({correlation:!0})})),n.onAttributeChange("versions",x));E(b)}}),[e,s,b]),(0,a.useMemo)((function(){l.current&&(l.current.setAttribute("width",r),l.current.getNodes().forEach((function(e){return e.updateAttribute("width",r)})))}),[l.current,r]),(0,N.Z)((function(){l.current&&l.current.getNodes().forEach((function(e){e.updateAttribute("nodesScope",t),e.getAttribute("active")&&"chart"===e.type&&e.fetch()}))}),[l.current,t]),(0,a.useEffect)((function(){l.current&&l.current.getApplicableNodes({syncHighlight:!0}).forEach((function(e){e.updateAttribute("navigation",p?"highlight":"pan")}))}),[l.current,p]),(0,a.useEffect)((function(){return function(){return l.current&&l.current.destroy()}}),[]),(0,a.useEffect)((function(){if(l.current&&v&&v.context){var e=v.context,t=v.chartId,n=v.nodeId,r=l.current.getNode({id:e});r&&r.updateAttributes({selectedInstances:["".concat(t,"@").concat(n)],selectedNodes:[n]});var o=t&&n&&l.current.on("chartLoaded",(function(r){var a=r.getAttribute("id");e===a&&(r.updateAttributes({selectedInstances:["".concat(t,"@").concat(n)],selectedNodes:[n]}),o())}));return function(){return v&&(0,C.unregister)(o)}}}),[l.current,v])}(L,R,{host:te?"".concat(window.envSettings.agentApiUrl,"/api/v2"):"".concat(window.envSettings.apiUrl,"/api/v3/spaces/").concat(_,"/rooms/").concat(L),width:ae});var ie=(0,f.jg)(L),ce=J?Q:G,le=F[r]||F.default,ue=(0,f.Uq)(L),se=(0,c.Z)(ue),de=(0,v.Np)(J?q:ie,G,L,B(B({},le),{},{force:J||ue!==se,cacheKey:"".concat(r,"-").concat(X,"-").concat(ee)})),me=(0,f.MS)(L,Q),fe=(0,l.Z)(U),pe=de<1,ge=(0,y.I0)("chartName",{key:L,extraKey:ee,flavour:"val"}),he=(0,o.Z)(ge,2),ve=he[0],be=he[1];(0,a.useEffect)((function(){L&&be($||(null===K||void 0===K?void 0:K.chartName)||ve)}),[L,$]);var ye=(0,D.u)(),Ee=Object.keys(ce).length<1&&z||R.length&&!H.length,we=(0,y.H7)({extraKey:r});if(M=M.length?M:we,!Ee&&!1!==fe&&U&&"No data for this period"!==U&&!Object.keys(ce).length)throw U;return a.createElement(e,{nodeIds:M,loaded:!!L&&V&&ye,getChart:me,areChartsIdsEmpty:pe,showNoNodesView:V&&!M.length,showNoChartsView:Ee,initializing:U&&(0,b.V)(U),chartName:ve,setChartName:be,chartsLoaded:z&&!!ae,invalidationKey:L,flavour:r,chartIds:J?q:ie,widthRef:oe,queryableNodeIds:H,nodesKey:ee})}))}},72869:function(e,t,n){n.d(t,{Z:function(){return Me}});var r={};n.r(r),n.d(r,{OSTableSchema:function(){return L},agentTableSchema:function(){return R},dashboardsTableSchema:function(){return _},dockerTableSchema:function(){return A},machinesTableSchema:function(){return F}});var o=n(87462),a=n(45987),i=n(29439),c=n(4942),l=(n(41539),n(64211),n(2490),n(41874),n(47941),n(85827),n(25387),n(72608),n(21249),n(57640),n(9924),n(82526),n(41817),n(57327),n(88449),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(67294)),u=n(59978),s=n(18997),d=n(41331),m=n(37518),f=n(25819),p=n(74059),g=n(78266),h=n(93433),v=(n(92222),n(91008)),b=n(92432),y=n(89250),E=n(39840),w=n(65351),x=n(85287),O=(0,l.memo)((function(e){var t=e.count,n=e.testId;return l.createElement(u.TextHuge,{strong:!0,color:"textDescription",alignSelf:"center","data-testid":n,overflow:"hidden"},isNaN(t)?"-":(0,x.d)(t))})),k=(n(26833),n(2707),n(18446)),C=n.n(k),I=n(71893),Z=n(85651),j={metrics:(0,I.css)(["tbody tr{&:nth-child(odd){background:",";}&:nth-child(even){background:",";}}thead tr{background:",";}"],(0,Z.getColor)("nodeBadgeBackground"),(0,Z.getColor)("panelBg"),(0,Z.getColor)("panelBg")),progressBar:(0,I.css)(["tr{background:",";}"],(0,Z.getColor)("panelBg"))},S=(0,I.default)(u.Table).attrs({coloredSortedColumn:!1}).withConfig({displayName:"styled__StyledTable",componentId:"sc-1kpag36-0"})(["&&{width:100%;height:auto;align-self:start;th,td{padding:4px 8px;min-width:auto;height:32px;width:auto;}","}"],(function(e){var t=e.layout;return j[t]||j.metrics})),P=(0,I.default)(u.Icon).withConfig({displayName:"styled__StyledIcon",componentId:"sc-1kpag36-1"})(["float:right;cursor:pointer;"]),N=[{id:"value",desc:!1}],T=function(e){var t=e.columns,n=e.data,r=e.layout,o=void 0===r?"metrics":r,a=e.sortBy,i=void 0===a?N:a;return null!==n&&void 0!==n&&n.length?l.createElement(S,{layout:o,data:n,dataColumns:t,sortBy:i,enableSorting:!0}):l.createElement(u.Flex,{width:"100%"},l.createElement(u.TextSmall,{color:"textLite",alignSelf:"center",margin:[0,"auto"]},"No data"))},D=n(44109),M=n(38626),B={name:function(e){return function(e,t){var n=t.maxLength;return{id:"name",accessorKey:"name",header:e,cell:function(e){var t=e.getValue;return n?l.createElement(M.Z,{maxLength:n,text:t(),TextComponent:u.TextSmall}):l.createElement(u.TextSmall,null,t())}}}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})},value:{id:"value",header:"#",accessorKey:"value",cell:function(e){var t=e.getValue;return l.createElement(u.TextSmall,{strong:!0},t())}},goToDashboard:{id:"goToDashboard",accessorKey:"value",header:"",cell:function(e){var t=e.cell,n=e.getValue,r=t.row.original.path,o=(0,y.s0)(),a=(0,l.useCallback)((function(){(0,b.L)("total-cust-dashboard","click-cust-dasbhoard","hm-page",n()),o("".concat(r,"/").concat(n()))}),[r,n()]);return l.createElement(P,{name:"goToNode",width:"14px",height:"14px",color:"textDescription",onClick:a})}},progressBar:function(e){return{id:"value",accessorKey:"value",header:e.header,cell:function(e){var t=e.cell,n=e.getValue,r=t.row.original,o=r.name,a=r.total,i=r.color,c=a?n()/a:0,s=(0,D.e)(c);return l.createElement(u.Flex,{column:!0,margin:[1,0,0,0]},o?l.createElement(u.Flex,{justifyContent:"between"},l.createElement(u.TextSmall,null,o),l.createElement(u.TextSmall,{strong:!0},n())):null,l.createElement(u.ProgressBar,{color:i,width:s}))}}}},F=[B.name("VM"),B.value],A=[B.name("Containers"),B.value],_=[B.name("Latest Updated",{maxLength:24}),B.goToDashboard],L=[B.progressBar({header:"OS",dataEntry:"nodesByOS"})],R=[B.progressBar({header:"Agent Version",dataEntry:"nodesByAgentVersion"})],V=(0,l.memo)((function(e){var t=e.data,n=e.schemaKey,o=e.testId,a=Object.values(t).reduce((function(e,t){return e+t}),0),i=Object.keys(t).map((function(e){return{name:e,value:t[e],total:a}})).sort((function(e,t){return t.value-e.value}));return l.createElement(u.Flex,{padding:[0,4],height:"100%","data-testid":"".concat(o,"-table-container"),overflow:"hidden"},l.createElement(T,{columns:r[n],data:i,layout:"progressBar"}))}),(function(e,t){return C()(e,t)}));function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function K(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var G=[{id:"name",desc:!1}],H=function(e){var t=e.count,n=e.data,r=(0,p.uk)(),o=(0,m.vf)(),a=function(e){var t=e.data,n=void 0===t?[]:t,r=e.path;return null===n||void 0===n?void 0:n.map((function(e){return K(K({},e),{},{value:e.slug,path:r})}))}({data:n,path:"/spaces/".concat(r,"/rooms/").concat(o,"/dashboards")});return l.createElement(u.Flex,{column:!0,alignItems:"center","data-testid":"totalDashboards-table-container",margin:[0,4],gap:2,overflow:"hidden"},l.createElement(O,{count:t,testId:"total-dashboards-value"}),l.createElement(T,{columns:_,data:a,sortBy:G}))},U=(0,l.memo)(H,(function(e,t){return C()(e,t)})),W=n(9446),q=(0,I.default)(u.TextSmall).withConfig({displayName:"pieChartLabels__StyledText",componentId:"sc-15uxiq-0"})(["display:flex;align-items:center;cursor:",";&:hover{opacity:",";}"],(function(e){return e.onClick?"pointer":"auto"}),(function(e){return e.onClick?"0.7":"1"})),Q=(0,l.memo)((function(e){var t=e.title,n=e.value,r=e.color,o=e.onClick,a=void 0===o?null:o;return l.createElement(u.Flex,{alignItems:"center",justifyContent:"between",width:"100%",gap:4,flex:{grow:1,shrink:0}},l.createElement(u.Flex,{gap:1},l.createElement(u.Flex,{width:"4px",height:"16px",background:r}),l.createElement(q,{whiteSpace:"nowrap",onClick:a},t,a&&l.createElement(u.Icon,{color:"textLite",margin:[0,0,0,1],name:"nav_arrow_goto",height:"10px",width:"10px"}))),l.createElement(u.Text,{strong:!0},null!==n&&void 0!==n?n:"-"))})),J=function(e){var t=e.data;return l.createElement(u.Flex,{column:!0,alignItems:"start",justifyContent:"center",gap:5},t.map((function(e,t){var n=e.title,r=e.value,o=e.color,a=e.onClick;return l.createElement(Q,{key:"".concat(n,"-").concat(r,"-").concat(t),title:n,value:r,color:o,onClick:a})})))};function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var $=function(e){var t=e.data,n=e.theme;return t.map((function(e){return Y(Y({},e),{},{color:(0,u.getColor)(e.color)({theme:n})})}))},ee=function(e){var t=e.chartData,n=void 0===t?[]:t,r=e.lineWidth,o=void 0===r?15:r,a=e.animate,i=void 0===a||a,c=e.label,s=e.hasData,d=(0,l.useContext)(I.ThemeContext);return l.createElement(u.Flex,{gap:4,margin:[0,4],height:{min:"100px",max:"130px"},alignItems:"center"},l.createElement(J,{data:n}),l.createElement(u.Flex,{height:"100px",flex:{grow:1,shrink:1}},s?l.createElement(W.PieChart,{label:function(){return c},labelStyle:{fontSize:"24px",fontWeight:400,fontFamily:"IBM Plex Sans",lineHeight:" 32px",fill:(0,u.getColor)("textDescription")({theme:d})},labelPosition:0,data:$({data:n,theme:d}),lineWidth:o,animate:i}):l.createElement(u.Icon,{color:"border",name:"pie_chart_skeleton",width:"100px",height:"100px",alignSelf:"center"})))},te=function(e){return Object.keys(e).reduce((function(t,n){return[].concat((0,h.Z)(t),[{name:n,value:e[n]}])}),[]).sort((function(e,t){return t.value-e.value}))},ne=function(e){var t=e.data,n=t.vm,r=t.docker,o=t.chartData,a=t.hasData,i=te(n),c=te(r);return l.createElement(u.Flex,{justifyContent:"around","data-testid":"nodesByMachine-tables-container",overflow:"hidden"},l.createElement(u.Flex,{flex:{grow:1,shrink:0},basis:"200px"},l.createElement(ee,{chartData:o,hasData:a})),l.createElement(u.Flex,{gap:2,flex:{grow:1,shrink:0},basis:"50%",padding:[0,4,0,2]},l.createElement(T,{columns:F,data:i}),l.createElement(T,{columns:A,data:c})))},re=(0,l.memo)(ne,(function(e,t){return C()(e,t)})),oe=n(82351);function ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ae(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ce=(0,I.default)(u.Text).withConfig({displayName:"nodesByDataReplication__StyledValue",componentId:"sc-19v6tvl-0"})(["line-height:17px;"]),le=function(e){var t=e.parent,n=e.child,r=t+n,o=(0,D.e)(t/r);return l.createElement(u.Flex,{column:!0,gap:1},l.createElement(u.Flex,{justifyContent:"between","data-testid":"nodesByDataReplication-parent-child"},l.createElement(me,{name:"Parents",value:t,background:["blue","aquamarine"]}),l.createElement(me,{name:"Children",value:n,background:["purple","lilac"]})),l.createElement(u.ProgressBar,{background:["purple","lilac"],color:["blue","aquamarine"],width:o}))},ue={r_1:{label:"1",color:["blue","indigo"]},r_2:{label:"2",color:["green","limeGreen"]},"r_*":{label:">2",color:["yellow","seaBuckthorn"]}},se=function(){return l.createElement(u.Flex,{column:!0,gap:1,alignItems:"center",width:"220px","data-testid":"nodesByDataReplication-information-text",overflow:"hidden"},l.createElement(u.TextMicro,{color:"white"},l.createElement(u.TextMicro,{color:"white",strong:!0},"Replication factor 1:")," ","The node's data are only on the node itself. Lose the node, lose the data!"),l.createElement(u.TextMicro,{color:"white"},l.createElement(u.TextMicro,{color:"white",strong:!0},"Replication factor 2:")," ","The node's metrics are replicated to one parent. The parent can trigger alerts for the child."),l.createElement(u.TextMicro,{color:"white"},l.createElement(u.TextMicro,{color:"white",strong:!0},"Replication factor ",">2",":")," ","Same as 2, but with the metrics replicated to more than one parent. Each parent in the hierarchy can trigger alerts for its children."),l.createElement(u.TextMicro,{color:"white",margin:[2,0]},"Aim to have most of your nodes with at least a factor of 2 and your critical ones with ",">2","."))},de=function(e){var t=(0,l.useMemo)((function(){var t=Object.keys(ue).reduce((function(t,n,r){var o,a=e[n]||0;return[].concat((0,h.Z)(t),[ie(ie({key:n},ue[n]),{},{value:a,sumValue:((null===(o=t[r-1])||void 0===o?void 0:o.sumValue)||0)+a})])}),[]);return[t,t[t.length-1].sumValue]}),[e]),n=(0,i.Z)(t,2),r=n[0],o=n[1];return l.createElement(u.Flex,{column:!0,margin:[6,0,0]},l.createElement(u.Flex,{margin:[0,0,2],gap:1},l.createElement(u.TextSmall,null,"Replication factor"),l.createElement(oe.Z,{isBasic:!0,plain:!0,content:se,align:"bottom"},l.createElement(u.Icon,{name:"information",color:"textDescription",size:"small"}))),l.createElement(u.Flex,{justifyContent:"between",margin:[0,0,1],"data-testid":"nodesByDataReplication-replications"},r.map((function(e){return l.createElement(me,{key:e.key,name:e.label,value:e.value,background:e.color})}))),l.createElement(u.ProgressBar,{background:"nodeBadgeBackground",value:r.map((function(e){return{width:(0,D.e)(e.value/o),color:e.color}}))}))},me=function(e){var t=e.name,n=e.value,r=void 0===n?"-":n,o=e.background,a=void 0===o?"text":o;return l.createElement(u.Flex,{alignItems:"center"},l.createElement(u.Flex,{width:"4px",height:"16px",background:a,round:3,margin:[0,1,0,0]}),l.createElement(u.TextSmall,{color:"textDescription",margin:[0,3,0,0]},t),l.createElement(ce,{color:"textDescription",strong:!0},r))},fe=function(e){var t=e.parentChild,n=e.replication;return l.createElement(u.Flex,{column:!0,margin:[4,4,1],"data-testid":"nodesByDataReplication-container"},l.createElement(le,t),l.createElement(de,n))},pe={dataReplication:function(){return(0,b.L)("nodes-data-replication","click-link-stream-replication","hm-page")}},ge=function(){var e=(0,m.A3)(),t=(0,y.s0)(),n=(0,E.yi)(),r=(0,w.Z)("manageWarRoom").handleOpenModal,o=(0,l.useCallback)((function(){return r("users")}),[]);return{claimedNodes:{props:{title:"Nodes",description:"Number of nodes claimed to Netdata in current room",basis:"calc(100%/12)",flex:{grow:"1",shrink:"0"},onClick:function(){return t("".concat(e,"/nodes"))},testId:"claimedNodes"},Component:O,selector:function(e){var t=e.nodes;return t?{count:t.offline+t.online+t.stale,updatedAt:t.updatedAt}:{count:"-"}}},nodesByStatus:{props:{title:"Nodes by status",description:"Breakdown of the nodes by their status in regards to Netdata",tooltip:l.createElement(u.Flex,{column:!0,width:{max:"200px"},gap:2},l.createElement(u.TextMicro,{color:"white"},l.createElement(u.TextMicro,{color:"white",strong:!0},"Live:")," ","Node is actual collecting and streaming metrics to Netdata"),l.createElement(u.TextMicro,{color:"white"},l.createElement(u.TextMicro,{color:"white",strong:!0},"Stale:")," ","Node is currently offline and not streaming metrics to Netdata. It can show historical data from a parent node"),l.createElement(u.TextMicro,{color:"white"},l.createElement(u.TextMicro,{color:"white",strong:!0},"Offline:")," ","Node is currently offline, not streaming metrics to Netdata and not available in any parent nodes"),l.createElement(u.TextMicro,{color:"white"},l.createElement(u.TextMicro,{color:"white",strong:!0},"Unseen:")," ","Nodes have never been connected to Netdata, they are claimed but no successful connection was established")),basis:"calc(100%/6)",flex:{grow:"2",shrink:"0"},testId:"nodesByStatus"},Component:ee,selector:function(n){var r=n.nodes,o=function(e){var t;return null!==(t=null===r||void 0===r?void 0:r[e])&&void 0!==t?t:"-"},a=function(){return t("".concat(e,"/nodes"))};return{chartData:[{title:"Live",value:o("online"),color:"live",onClick:a},{title:"Stale",value:o("stale"),color:"stale",onClick:a},{title:"Offline",value:o("offline"),color:"offline",onClick:a},{title:"Unseen",value:o("unseen"),color:"unseen",onClick:a}],hasData:!!r&&!r.error,updatedAt:null===r||void 0===r?void 0:r.updatedAt}}},nodesByML:{props:{title:"Nodes by ML",description:"Breakdown of the nodes in regards to our ML features",basis:"calc(100%/6)",flex:{grow:"2",shrink:"0"},onClick:function(){return t("".concat(e,"/anomalies"))},testId:"nodesByML"},Component:ee,selector:function(e){var t,n,r,o,a,i,c=e.nodes;return{chartData:[{title:"Enabled",value:null!==(t=null===c||void 0===c||null===(n=c.ml)||void 0===n?void 0:n.enabled)&&void 0!==t?t:"-",color:["blue","aquamarine"]},{title:"Disabled",value:null!==(r=null===c||void 0===c||null===(o=c.ml)||void 0===o?void 0:o.disabled)&&void 0!==r?r:"-",color:["yellow","yellow100"]},{title:"Not Capable",value:null!==(a=null===c||void 0===c||null===(i=c.ml)||void 0===i?void 0:i.notCapable)&&void 0!==a?a:"-",color:"placeholder"}],hasData:!!c&&!c.error,updatedAt:null===c||void 0===c?void 0:c.updatedAt}}},nodesByMachine:{props:{title:"Nodes over type of machine/technology",description:"Breakdown of the machines/technology where Netdata is running on",basis:"550px",flex:{grow:"5",shrink:"0"},testId:"nodesByMachine"},Component:re,selector:function(e){var t,n,r,o,a,i,c,l,u,s,d,m=e.nodes;return{data:{vm:null!==(t=null===m||void 0===m?void 0:m.vmTechnology)&&void 0!==t?t:{},docker:null!==(n=null===m||void 0===m?void 0:m.containerRuntime)&&void 0!==n?n:{},chartData:[{title:"Bare Metal",value:null!==(r=null===m||void 0===m||null===(o=m.type)||void 0===o?void 0:o.bareMetal)&&void 0!==r?r:"-",color:["blue","indigo"]},{title:"VM",value:null!==(a=null===m||void 0===m||null===(i=m.type)||void 0===i?void 0:i.virtualMachine)&&void 0!==a?a:"-",color:["blue","cyan"]},{title:"Container",value:null!==(c=null===m||void 0===m||null===(l=m.type)||void 0===l?void 0:l.container)&&void 0!==c?c:"-",color:["purple","lilac"]}].concat((0,h.Z)(null!==m&&void 0!==m&&null!==(u=m.type)&&void 0!==u&&u.unknown?[{title:"Unknown",value:null!==(s=null===m||void 0===m||null===(d=m.type)||void 0===d?void 0:d.unknown)&&void 0!==s?s:"-",color:"placeholder"}]:[])),hasData:!!m&&!m.error},updatedAt:null===m||void 0===m?void 0:m.updatedAt}}},nodesByDataReplication:{props:{title:"Nodes by data replication",description:l.createElement(l.Fragment,null,"Summary of your"," ",l.createElement(v.Z,{Component:u.TextMicro,href:"https://learn.netdata.cloud/docs/metrics-storage-management/enable-streaming",target:"_blank",onClick:pe.dataReplication},"streaming and replication")," ","status across your nodes"),basis:"calc(100%/6)",flex:{grow:"1",shrink:"0"},minWidth:"250px",testId:"nodesByDataReplication"},Component:fe,selector:function(e){var t=e.nodes;return t&&!t.error?{parentChild:{parent:t.parent,child:t.child},replication:t.replicationFactor,updatedAt:t.updatedAt}:{parentChild:{},replication:{}}}},nodesByOS:{props:{title:"Nodes by O/S version",description:"Breakdown of the nodes in regards to the O/S version they are running",basis:"430px",flex:{grow:"5",shrink:"0"},schemaKey:"OSTableSchema",dataGa:"node-os-version",testId:"nodesByOS"},Component:V,selector:function(e){var t=e.nodes;return t&&!t.error?{data:t.osVersion,updatedAt:t.updatedAt}:{data:{}}}},nodesByAgentVersion:{props:{title:"Nodes by Agent version",description:"Breakdown of the nodes in regards to the Agent version running on them",basis:"430px",flex:{grow:"5",shrink:"0"},schemaKey:"agentTableSchema",dataGa:"node-agent-version",testId:"nodesByAgentVersion"},Component:V,selector:function(e){var t=e.nodes;return t&&!t.error?{data:t.agentVersion,updatedAt:t.updatedAt}:{data:{}}}},activeAlerts:{props:{title:"Active Alerts",description:"Breakdown of the active alerts by status across all live nodes",basis:"calc(100%/6)",flex:{grow:"0",shrink:"0"},testId:"activeAlerts"},Component:ee,selector:function(e){var t=e.alarms;return t&&!t.error?{chartData:[{title:"Critical",value:t.critical,color:"errorText",onClick:function(){return n("critical")}},{title:"Warning",value:t.warning,color:"warningText",onClick:function(){return n("warning")}}],label:t.critical+t.warning,hasData:!!t&&!t.error&&t.critical+t.warning,updatedAt:t.updatedAt}:{chartData:[{title:"Critical",value:"-",color:"errorText",onClick:function(){return n("critical")}},{title:"Warning",value:"-",color:"warningText",onClick:function(){return n("warning")}}],hasData:!!t&&!t.error}}},usersByRole:{props:{title:"Users by role",description:"Breakdown of the users by their role",basis:"calc(100%/6)",flex:{grow:"0",shrink:"0"},onClick:function(){return o()},testId:"usersByRole"},Component:ee,selector:function(e){var t=e.spaceroom;return t&&!t.error?{chartData:[{title:"admin",value:t.admin,color:["green","green140"]},{title:"user",value:t.user,color:["purple","lilac"]}],label:t.admin+t.user,hasData:!!t&&!t.error,updatedAt:t.updatedAt}:{chartData:[{title:"admin",value:"-",color:["green","green140"]},{title:"user",value:"-",color:["purple","lilac"]}],hasData:!!t&&!t.error}}},totalDashboards:{props:{title:"Total Dashboards",description:"Number of the currently available custom dashboards in room",basis:"calc(100%/6)",flex:{grow:"0",shrink:"0"},testId:"totalDashboards"},Component:U,selector:function(e){var t=e.dashboards;return t&&!t.error?{count:t.dashboards,data:t.lastUpdated,updatedAt:t.updatedAt}:{count:"-",data:[]}}}}},he=function(e){var t=e.title,n=e.description,r=e.tooltip;return l.createElement(u.Flex,{column:!0,margin:[4,4,3],height:{min:12}},l.createElement(u.Flex,{gap:1,alignItems:"center"},l.createElement(u.Text,{color:"text","data-testid":"metrics-header-title"},t),r&&l.createElement(oe.Z,{isBasic:!0,plain:!0,content:r,align:"bottom"},l.createElement(u.Icon,{name:"information",color:"textDescription",size:"small"}))),l.createElement(u.TextMicro,{color:"textDescription","data-testid":"metrics-header-description"},n))},ve=(0,l.memo)(he),be=n(43337),ye=n(20709),Ee=function(e){var t=e.updatedAt,n=(0,l.useState)(),r=(0,i.Z)(n,2)[1],o=function(e){if(!e)return"";var t=new Date(e);return t.getTime()?(0,ye.Z)(t,new Date):""}(t);return(0,be.Z)((function(){return r(Math.random())}),6e4),l.createElement(u.Flex,{justifyContent:"end",margin:[2,4]},l.createElement(u.TextFemto,{color:"textLite","data-testid":"metrics-footer-last-updated"},"Last updated: ",o||"-"))},we=n(4822),xe=n(96929),Oe=n(36560),ke=n(20046),Ce=n(63346),Ie=["basis","title","flex","description","tooltip","minWidth","onClick","testId"];function Ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ze(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Se=function(e,t){var n=(0,p.th)(),r=(0,m.UL)(),o=(0,we.H7)();(0,s.Z)((function(){return{enabled:!!(n&&r&&o.length&&null!==e&&void 0!==e&&e.length),fetch:function(){return(0,f.mP)(n,r,e,o)},onReceive:function(e){var n=e.data;return t((function(e){var t=je(je(je({},e),n),{},{charts:je(je({},e.charts),n.charts)});return function(e,t){return e===t||!Object.keys(e).some((function(n){return!(0,d.ZP)(e[n],t[n],{omit:["updatedAt","latency"]})}))}(t,e)?e:t}))},onFail:function(t){return e.reduce((function(e,n){var r=n.name;return je(je({},e),{},(0,c.Z)({},r,{error:t}))}),{})},pollingOptions:{pollingInterval:588e3}}}),[n,r,o.length,e])},Pe=[{name:"charts",projections:"points"}],Ne=[{name:"charts",projections:"retention"}],Te=[{name:"charts",projections:"metrics"}],De=[{name:"nodes"},{name:"spaceroom"},{name:"alarms"},{name:"dashboards"}],Me=function(){var e=(0,l.useState)({}),t=(0,i.Z)(e,2),n=t[0],r=t[1];Se(Pe,r),Se(Ne,r),Se(Te,r),Se(De,r);var c=(0,xe.zN)(),s=(0,xe.fD)(),d=ge();return s?s&&!c.length?l.createElement(Ce.ZP,{feature:"Home",mode:"NoNodesView"},l.createElement(Oe.Z,null)):l.createElement(Ce.ZP,{feature:"Home"},l.createElement(u.Flex,{alignItems:"center",background:"mainBackground","data-testid":"home-header",gap:2,justifyContent:"between",padding:[2,4],width:"100%"},l.createElement(ke.Z,null)),l.createElement(u.Flex,{flexWrap:!0,overflow:"auto",padding:[0,0,4,4],"data-testid":"roomHome-layout-container"},Object.keys(d).map((function(e){var t=d[e],r=t.props,i=r.basis,c=r.title,s=r.flex,m=r.description,f=r.tooltip,p=r.minWidth,g=void 0===p?"250px":p,h=r.onClick,v=void 0===h?null:h,b=r.testId,y=(0,a.Z)(r,Ie),E=t.Component,w=(0,t.selector)(n);return l.createElement(u.Flex,{key:e,column:!0,basis:i,flex:s,height:"280px",width:{min:g},margin:[4,4,0,0],background:"panelBg",justifyContent:"between",round:!0,"data-testid":"metrics-container-".concat(b),onClick:v,cursor:v?"pointer":"auto"},l.createElement(ve,(0,o.Z)({title:c,description:m,tooltip:f},w)),l.createElement(E,(0,o.Z)({testId:e},y,w)),l.createElement(Ee,w))})))):l.createElement(g.Z,{title:"Loading room stats..."})}},37497:function(e,t,n){n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(4942),o=n(15861),a=n(64687),i=n.n(a),c=n(4480),l=n(67294),u=n(37518),s=n(25819);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.Z=function(e,t){var n=(0,c._8)((function(n){var r=n.snapshot,a=n.set;return(0,o.Z)(i().mark((function n(){return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,r.getPromise((0,u.n2)({id:t,key:"fullyLoaded"}));case 2:if(!n.sent){n.next=5;break}return n.abrupt("return");case 5:(0,s.fv)(e,t).then((function(t){var n=t.data;return a((0,u.ZB)(n.id),m(m({},n),{},{spaceId:e,fullyLoaded:!0,loaded:!0}))}));case 6:case"end":return n.stop()}}),n)})))}),[e,t]);(0,l.useEffect)((function(){e&&t&&n()}),[e,t])}},60464:function(e,t,n){var r=n(93433),o=n(4942),a=(n(21249),n(57640),n(9924),n(41539),n(15581),n(2490),n(34514),n(54747),n(85827),n(25387),n(72608),n(92222),n(47941),n(82526),n(57327),n(88449),n(59849),n(38880),n(49337),n(33321),n(69070),n(4480)),i=n(18997),c=n(12008),l=n(48450),u=n(77796),s=n(99322),d=n(16634);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.Z=function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).polling,o=void 0===n||n,m=(0,a._8)((function(e){var n=e.set;return function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).data,o=void 0===e?[]:e;n((0,s.e)({id:t,key:"ids"}),o.map((function(e){return e.id}))),n((0,s.e)({id:t,key:"loaded"}),!0),n((0,s.e)({id:t,key:"updatedAt"}),(new Date).toISOString()),n((0,s.e)({id:t,key:"error"}),null),o.forEach((function(e){n((0,c.fp)({id:e.id}),(function(t){return f(f({},t),{},{loaded:!0},e)}))}));var a=o.reduce((function(e,t){var n=t.id,o=t.nodeId;return e[o]=[].concat((0,r.Z)(e[o]||[]),[n]),e}),{});n(u.in,a)}}),[e,t]),p=(0,a._8)((function(e){var n=e.set;return function(e){n((0,s.e)({id:t,key:"error"}),(0,d.Z)(e))}}));(0,i.Z)((function(){return{enabled:!!e&&!!t,polling:o,fetch:function(){return(0,l.sr)(e,t)},onFail:p,onReceive:m,force:!0}}),[e,t])}},40970:function(e,t,n){n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(4942),o=n(29439),a=(n(47941),n(92222),n(67294)),i=n(44536),c=n(68035),l=n(89479),u=n(4822),s=n(25819),d=n(42448);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.Z=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.spaceId,m=n.autorun,p=void 0!==m&&m,g=(0,a.useState)(null),h=(0,o.Z)(g,2),v=h[0],b=h[1],y=(0,u.by)(),E=y.after,w=y.before,x=(0,a.useRef)();x.current={after:E<0?E:Math.floor(E/1e3),before:E<0?0:Math.ceil(w/1e3)};var O=function(e){if(e&&null!==e&&void 0!==e&&e.response){var t=e.response.data.errorMsgKey;b(t)}else b(e)},k=(0,a.useMemo)((function(){return(0,d.V)(v)?5e3:65e3}),[v]),C=(0,a.useRef)(),I=(0,l.w4)(e),Z=function(e){var t=e.results,n=e.versions;I((function(e){return f(f({},e),n)})),b((!t||!Object.keys(t).length)&&"No data for this period")},j=(0,l.qU)(e).contextsHardHash,S=(0,i.Z)(j);return(0,c.Z)((function(){return{cache:!1,key:"spaces.".concat(r,".rooms.").concat(e,".charts"),polling:!1,autorun:p||Boolean(r&&e),fetch:function(){return(0,s.Mn)(r,e,t,f({},x.current))},association:{getIds:function(){return(0,l.dA)({roomId:e,merge:C.current===t})},getError:function(){return(0,l.W2)({id:e,key:"error"})},getLoaded:function(){return(0,l.W2)({id:e,key:"loaded"})},getUpdatedAt:function(){return(0,l.W2)({id:e,key:"updatedAt"})}},getResource:function(t){return(0,l.PP)({id:e,key:t})},getResourcesInitializer:function(){var n=(0,l.Q7)({id:e,merge:C.current===t,nodeIds:t});return C.current=t,n},getResourceInitialState:function(e){return f({fullyLoaded:!0},e)},onFail:O,pollingOptions:{pollingInterval:k},onReceive:Z,after:E,nodeIds:t,force:!0}}),[r,e,t,k,!!S&&!!j&&S!==j,E,w]),v}},29748:function(e,t,n){var r=n(4942),o=(n(2707),n(41539),n(15581),n(2490),n(34514),n(54747),n(21249),n(57640),n(9924),n(47941),n(82526),n(57327),n(88449),n(59849),n(38880),n(49337),n(33321),n(69070),n(4480)),a=n(47133),i=n(18997),c=n(74059),l=n(37518),u=n(25819),s=n(5934);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.Z=function(){var e=(0,c.th)(),t=(0,l.UL)(),n=(0,o._8)((function(e){var n=e.set;return function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).data,r=(void 0===e?{}:e).results;if(n((0,s.oq)({id:t,key:"loaded"}),!0),null!==r&&void 0!==r&&r.length){var o=r.sort((function(e,t){return e.name.localeCompare(t.name,void 0,{sensitivity:"accent"})}));o.forEach((function(e){return n((0,a.lz)(e.id),(function(t){return m(m({},t),{},{loaded:!0},e)}))}));var i=o.map((function(e){return e.id}));n((0,s.oq)({id:t,key:"ids"}),i)}}}));(0,i.Z)((function(){return{enabled:!!e&&!!t,fetch:function(){return(0,u.j2)(e,t)},onReceive:n}}),[e,t])}},39904:function(e,t,n){n(92222);var r=n(68035),o=n(274),a=n(34912),i=n(44197),c=n(1229),l=n(33335);t.Z=function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).polling,u=void 0===n||n,s=(0,l.gI)("room:ReadUsers");(0,r.Z)((function(){return{key:"spaces.".concat(e,".rooms.").concat(t,".members"),autorun:!!e&&!!t&&s,fetch:function(){return(0,o.fQ)(e,t)},polling:u,association:{getError:function(){return(0,c.Ci)({id:t,key:"error"})},getIds:function(){return(0,c.Ci)({id:t,key:"ids"})},getLoaded:function(){return(0,c.Ci)({id:t,key:"loaded"})},getUpdatedAt:function(){return(0,c.Ci)({id:t,key:"updatedAt"})}},sort:function(e,t){return e.name.localeCompare(t.name,void 0,{sensitivity:"accent"})},getResource:function(e){return(0,a.mX)({id:e})},getResourcesInitializer:function(){return a.Bb},getResourceInitialState:function(){return i.E},pollingOptions:{pollingInterval:18e4}}}),[e,t])}},29516:function(e,t,n){var r=n(18997),o=n(4480),a=n(48450),i=n(45781),c=n(95383),l=n(33335);t.Z=function(e){var t=(0,o._8)((function(t){var n=t.set;return function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).data.results;n((0,i.e)({id:e}),t)}})),n=(0,o._8)((function(t){var n=t.set;return function(t){return n((0,i.e)({id:e,key:"error"}),t)}})),u=(0,c.y3)(e,"loaded"),s=(0,l.gI)("alert:ReadAll");(0,r.Z)((function(){return{enabled:s&&!!e&&u,fetch:function(){return(0,a.Kp)(e)},onFail:n,onReceive:t,pollingOptions:{pollingInterval:15e4}}}),[e,!!u])}},29983:function(e,t,n){var r=n(4480),o=n(68035),a=n(274),i=n(34912),c=n(94666),l=n(1229),u=n(33335);t.Z=function(e){var t=(0,r._8)((function(t){var n=t.set;return function(t){var r=t.results;return n((0,c.J9)(e),r)}})),n=(0,u.gI)("user:ReadAll");(0,o.Z)((function(){return{key:"spaces.".concat(e,".members"),autorun:!!e&&n,fetch:function(){return(0,a.Q5)(e)},association:{getError:function(){return(0,l.Ci)({id:e,key:"error"})},getIds:function(){return(0,c.WA)({id:e,key:"ids"})},getLoaded:function(){return(0,c.WA)({id:e,key:"loaded"})},getUpdatedAt:function(){return(0,c.WA)({id:e,key:"updatedAt"})}},sort:function(e,t){return e.name.localeCompare(t.name,void 0,{sensitivity:"accent"})},getResource:function(e){return(0,i.mX)({id:e})},getResourcesInitializer:function(){return i.Bb},onReceive:t,pollingOptions:{pollingInterval:315e3}}}),[e])}},37682:function(e,t,n){var r=n(67294),o=n(6557),a=n.n(o),i=n(18446),c=n.n(i),l=n(44682);t.Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a(),n=(0,r.useRef)();return(0,l.Sz)(e,(function(e){var r=t(e);return c()(n.current,r)||(n.current=r),n.current}))}},69063:function(e,t,n){n(92222),n(74916),n(77601);var r=n(67294),o=n(89250),a=n(9058),i=n(24298),c=n(74059),l=n(37518);t.Z=function(){var e=(0,a.e)(),t=function(){var e=(0,c.uk)(),t=(0,l.vf)();return"/spaces/".concat(e,"/rooms/").concat(t,"/overview")}(),n=(0,o.s0)();(0,r.useEffect)((function(){if(e)return(0,i.unregister)(e.on("goToLink",(function(e,r){var o,a=location.pathname;return e&&e.getParent().getAttribute("roomId")&&(a=e.getParent().getId(),a=/^\/spaces/.test(a)?a:t),n(a,r?{state:{chartName:r},replace:!0}:{state:{contextToGo:null===e||void 0===e||null===(o=e.getAttribute("contextScope"))||void 0===o?void 0:o[0]},replace:!0})})))}),[e,t])}},9449:function(e,t,n){var r=n(67294),o=n(44682);t.Z=function(e){var t=(0,r.useRef)();return(0,o.Sz)(e,(function(e){return t.current=e,!1})),t}},18997:function(e,t,n){var r=n(29439),o=(n(41539),n(88674),n(17727),n(67294)),a=n(50308),i=n.n(a),c=n(9058),l=n(46189),u=n(29283),s=n(13477);t.Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,c.e)(),a=(0,o.useMemo)((function(){return n?n.getRoot():null}),[n]),d=(0,o.useMemo)(e,t),m=(0,o.useRef)(!0),f=(0,o.useRef)({timeoutId:null,promise:null}),p=(0,u.Z)(),g=(0,r.Z)(p,2)[1],h=(0,o.useCallback)((function(e){m.current=!1;var t=d.fetch,n=d.onStart,r=void 0===n?i():n,o=d.onFail,c=void 0===o?i():o,u=d.onPollingFail,s=void 0===u?i():u,p=d.onReceive,h=void 0===p?i():p,v=d.onSettle,b=void 0===v?i():v,y=d.onBlurMode,E=void 0===y?i():y,w=d.polling,x=void 0===w||w,O=d.pollingOptions;r(e),f.current={timeoutId:null,promise:null};var k=function(){return f.current.promise=t(e),f.current.promise.then(h).catch((function(e){if(!e.isCancel)throw e})),f.current.promise},C=function e(){f.current.timeoutId=setTimeout((function(){if(null!==O&&void 0!==O&&O.shouldPause&&a&&(a.getAttribute("hovering")||a.getAttribute("paused"))||!g.current&&(!a||!a.getAttribute("autofetchOnWindowBlur")))return E(),e();k().then((function(){return!m.current&&x&&e()})).catch((function(t){t.isCancel||s(t),!m.current&&!t.isCancel&&x&&e()}))}),(null===O||void 0===O?void 0:O.pollingInterval)||l.Z.pollingInterval)};return k().then((function(){return!m.current&&x&&C()})).catch((function(e){e.isCancel||c(e),m.current||!x||e.isCancel||C()})).finally(b),function(){var e,t;m.current=!0,null===(e=f.current.promise)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),clearTimeout(f.current.timeoutId)}}),t),v=(0,s.Iy)("isAnonymous");return(0,o.useEffect)((function(){var e=d.enabled,t=void 0===e||e,n=d.force,r=void 0!==n&&n,o=d.skip;if((!v||r)&&!(void 0!==o&&o))return t?h():void 0}),[h]),h.clearRef=f,h}},3975:function(e,t,n){n.d(t,{QF:function(){return l},vq:function(){return u}});var r=n(67294),o=n(89250),a=n(37518),i=n(74059),c=function(e,t,n){var o=t();(0,r.useLayoutEffect)((function(){o!==e&&n(e)}),[o,e])},l=function(){var e=(0,o.UO)().roomSlug,t=(0,a.TF)();return c(e,a.vf,t),e},u=function(){var e=(0,o.UO)().spaceSlug,t=(0,i.$v)();return c(e,i.uk,t),e};t.ZP=function(){return[u(),l()]}}}]);