diff options
Diffstat (limited to '')
-rw-r--r-- | web/gui/v2/3283.88c006d10b31f8ed8088.chunk.js | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/web/gui/v2/3283.88c006d10b31f8ed8088.chunk.js b/web/gui/v2/3283.88c006d10b31f8ed8088.chunk.js deleted file mode 100644 index 1a5be2f61..000000000 --- a/web/gui/v2/3283.88c006d10b31f8ed8088.chunk.js +++ /dev/null @@ -1 +0,0 @@ -!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]="4acc1ab3-36e9-4176-90ad-6c93008df2d1",e._sentryDebugIdIdentifier="sentry-dbid-4acc1ab3-36e9-4176-90ad-6c93008df2d1")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"8b7b01b6c705cf50f8050ce0fb8fc6b58fe68567"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[3283],{32300:function(e,t,n){n.d(t,{Z:function(){return xt}});var r=n(67294),o=n(37518),a=n(96929),i=n(36560),c=n(63346),l=n(29439),d=(n(92222),n(24281)),s=n(91268),u=n(96104),m=n(97945),f=n(74059),p=n(74662),g=n(4822),h=n(6015),v=n(93416),b=n(4942),y=n(87462),w=(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)),E=n(46667),x=n(53030),O=n(89149),k=n(15861),C=n(64687),Z=n.n(C),I=n(4480),j=n(83338),S=n(8018);function N(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 P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){(0,b.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var D=(0,I.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?P(P({},e),{},(0,b.Z)({},n,r)):r}))}}}),T=function(e,t){return(0,I.sJ)(D({id:e,key:t}))},M=function(e,t){var n=T(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,I.Zl)(D({id:e,key:n})),i=(0,S.O9)(e);return(0,I._8)((function(t){var r=t.snapshot;return function(){var t=(0,k.Z)(Z().mark((function t(c){var l;return Z().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(D({id:e}));case 5:return l=t.sent,t.prev=6,t.next=9,i({settings:P(P({},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(84147),H=function(){},W=function(e){var t=e.roomId,n=e.id,a=e.onRemove,i=void 0===a?H:a,c=(0,o.tE)(t,"name"),d=(0,R.xQ)(t,n,"title"),s=(0,R.c0)(t),u=(0,E.Z)(),m=(0,l.Z)(u,4),f=m[0],p=m[2],g=m[3],h=function(){var e=(0,k.Z)(Z().mark((function e(){return Z().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(v.Button,{danger:!0,flavour:"hollow",onClick:p,label:"Delete metric","data-testid":"remove-metric"}),f&&r.createElement(v.ConfirmationDialog,{"data-ga":"remove-metric-dialog","data-testid":"removeMetricDialog",handleConfirm:h,handleDecline:g,message:r.createElement(r.Fragment,null,"You are about to remove ",r.createElement("strong",null,d)," metric.",r.createElement("br",null),"Are you sure you want to continue?"),title:"Remove metric from ".concat(c)}))},U=["title","help","link","disclaimer","children"],G=function(e){var t=e.link,n=e.children;return r.createElement(v.Flex,{as:"a",target:"_blank",href:t,gap:1,alignItems:"end"},r.createElement(v.TextNano,{textDecoration:"undeline"},n),r.createElement(v.Icon,{color:"text",name:"question",width:"16px",height:"16px"}))},K=function(e){var t=e.title,n=e.help,o=e.link,a=e.disclaimer,i=e.children,c=(0,B.Z)(e,U);return r.createElement(v.Flex,(0,y.Z)({gap:1,column:!0},c),r.createElement(v.Flex,{justifyContent:"between",alignItems:"baseline"},r.createElement(v.Text,{as:"label",margin:[0]},t),n&&r.createElement(G,{link:o},n)),i,a&&r.createElement(v.TextSmall,null,a))},q=n(93433),Q=n(26398),X=n(62200),Y={value:"all",label:"All"},J=function(e){var t=e.dimensions,n=e.units;return{dimensions:t?[Y].concat((0,q.Z)(t.map((function(e){return{value:e.id,label:e.name}})))):[Y],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(v.Flex,{as:"span",gap:1},"Manage room",r.createElement(v.TextBig,{color:"textLite"},"/"),r.createElement(v.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,d=(0,R.jN)(n,o),s=(0,R.Y6)(n,{shouldPersist:!1}),m=(0,R.xQ)(n,o),f=(0,r.useRef)(m),p=m.title,g=m.context,h=m.dimensions,b=void 0===h?[]:h,w=function(){s(o,f.current),a()};(0,r.useEffect)((function(){c&&d()}),[]);var E=(0,u.fX)({extraKey:"nodesView",merge:!1,scoped:!0}),x=(0,V.Z)(n,E,{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),Z=(0,r.useMemo)((function(){return g&&{value:g,label:g}}),[g]),I=(0,L.Z)((function(){return{enabled:!!g,fetch:function(){return function(e,t,n){return Q.Z.get("".concat(X.li,"/spaces/").concat(e,"/rooms/").concat(t,"/contexts/").concat(encodeURIComponent(n)),{transform:J})}(t,n,g)},initialValue:{dimensions:[],units:""}}}),[t,n,g]),j=(0,l.Z)(I,2),S=j[0],N=S.dimensions,P=S.units,D=j[1],T=(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 N?1===N.length||b.length===N.length-1||0===b.length?[Y]:b.map((function(e){return{value:e.id,label:e.name}})):[Y]}),[b,N]),H=(0,r.useCallback)((function(e){var t=e.filter((function(e){return e.value!==Y.value})),n=(0===e.length||t.length!==e.length&&0!==b.length||t.length===N.length-1?[]:t).map((function(e){return{id:e.value,name:e.label}}));s(o,"dimensions",n)}),[o,b,N]),U=(0,R.VP)(n),G=(0,r.useCallback)((function(){return U(te(te({},m),{},{id:o,enableAllDimensions:0===b.length,unit:P})).then(a)}),[m]),q=(0,r.useCallback)((function(e){var t=e.target.value;t.length<=30&&s(o,"title",t)}),[o]),ee=!p||!g||D||!C;return r.createElement(F.u6,(0,y.Z)({onClose:w},i),r.createElement(A.x,{onClose:w,title:r.createElement(ne,{isNew:c})},r.createElement(v.Button,{label:"Save",onClick:G,disabled:ee})),r.createElement(_.B,null,c?"Add a new metric (column)":"Edit metric"),r.createElement(F.TZ,null,r.createElement(v.Flex,{gap:6,column:!0},r.createElement(K,{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(v.Select,{options:k,value:Z,onChange:T,isLoading:!C,"data-testid":"manageMetrics-contextSelect"})),r.createElement(K,{title:"Metric Title","data-testid":"manageMetrics-title"},r.createElement(v.TextInput,{name:"title",placeholder:"Type name",value:p,onChange:q})),r.createElement(K,{title:"Dimensions",help:"What is a dimension?",link:"https://learn.netdata.cloud/docs/data-collection/chart-dimensions-contexts-and-families#dimension",disclaimer:M[0]===Y&&"The returned value is the sum of all selected dimensions.","data-testid":"manageMetrics-dimensions"},r.createElement(v.Select,{isMulti:!0,options:N,value:M,onChange:H,isLoading:D,isDisabled:!Z,"data-testid":"manageMetrics-dimensionSelect"})),!c&&r.createElement(v.Flex,{justifyContent:"end"},r.createElement(W,{roomId:n,id:o,onRemove:a})))))},oe=function(e){var t=e.isOpen,n=e.onClose,o=e.onEdit,a=e.roomId,i=e.targetRef,c=(0,R.dh)(a),d=(0,l.Z)(c,2),s=d[0],u=d[1];if(!i.current||!t)return null;var m=function(e){o(e),n()};return r.createElement(v.Drop,{align:{top:"bottom",right:"right"},animation:!0,background:"dropdown",column:!0,margin:[.5,0,0],overflow:{vertical:"auto"},padding:[3],round:!0,width:70,close:n,"data-testid":"metricsMenu",onClickOutside:n,onEsc:n,target:i.current},s.map((function(e){return r.createElement(v.Flex,{"data-testid":"metricsMenu-metric-".concat(e.title),key:e.id,justifyContent:"between",alignItems:"center",padding:[1,0]},r.createElement(v.Checkbox,{checked:!e.hidden,"data-testid":"metricsMenu-metricCheckbox",label:e.title,onChange:function(){return u(e.id,"hidden",!e.hidden)}}),r.createElement(v.IconButton,{"data-testid":"metricsMenu-editMetric",flavour:"borderless",icon:"pencilSolid",neutral:!0,padding:[0],onClick:function(){return m(e.id)},width:"10px",height:"10px"}))})),r.createElement(v.Button,{"data-testid":"metricsMenu-addMetricButton",label:"Add new metric",icon:"plus",onClick:function(){return m("new")},small:!0,alignSelf:"end"}))},ae=function(e){var t=e.spaceId,n=e.roomId,o=(0,E.Z)(),a=(0,l.Z)(o,4),i=a[0],c=a[2],d=a[3],s=(0,r.useState)(null),u=(0,l.Z)(s,2),m=u[0],f=u[1],p=(0,r.useRef)();return r.createElement(r.Fragment,null,r.createElement(v.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(oe,{isOpen:i,onClose:d,onEdit:f,roomId:n,targetRef:p}),m&&r.createElement(re,{"data-testid":"metricsManagement",spaceId:t,roomId:n,id:m,onClose:function(){return f(null)}}))},ie=n(71893),ce=((0,ie.default)(v.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,v.getColor)("text"),(0,v.getSizeBy)(0),(0,v.getSizeBy)(25)),(0,ie.default)(v.Flex).attrs({height:"1px",margin:[4,0]}).withConfig({displayName:"styled__Divider",componentId:"sc-1czrg41-1"})(["background-color:rgba(0,0,0,0.12);"]),(0,ie.default)(v.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,v.getSizeBy)(3),(0,v.getSizeBy)(0)),(0,ie.default)(v.Drop).attrs({align:{top:"bottom",right:"right"},animation:!0,background:"dropdown",column:!0,margin:[.5,0,0],overflow:{vertical:"auto"},padding:[3],round:1,width:70}).withConfig({displayName:"styled__MetricsDropdown",componentId:"sc-1czrg41-3"})([""]),(0,ie.default)(v.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,v.getSizeBy)(2))),le=((0,ie.default)(v.Button).withConfig({displayName:"styled__PencilButton",componentId:"sc-1czrg41-5"})(["> svg.button-icon{width:",";height:",";opacity:0;}"],(0,v.getSizeBy)(4),(0,v.getSizeBy)(4)),(0,ie.default)(v.Button).withConfig({displayName:"styled__MetricsButton",componentId:"sc-1czrg41-6"})(["&&&{width:100%;}"]),n(38671)),de=n(39979);function se(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 ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?se(Object(n),!0).forEach((function(t){(0,b.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):se(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var me=function(){return(0,w.L)("grouping","click-grouping","hm-nodes")},fe=(0,de.Z)(x.Z),pe=[{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"}],ge={Option:function(e){var t=e.innerProps,n=e.data,o=e.isSelected;return r.createElement(ce,(0,y.Z)({},n,t,{active:o}))}},he={control:function(e){return ue(ue({},e),{},{height:32,minHeight:32,width:160})},indicatorSeparator:function(){return{display:"none"}},dropdownIndicator:function(e){return ue(ue({},e),{},{height:20,minHeight:20,paddingRight:4,paddingTop:0,paddingBottom:0})},valueContainer:function(e){return ue(ue({},e),{},{paddingTop:0,paddingBottom:0})}},ve=function(){var e=(0,f.th)(),t=(0,o.UL)(),n=(0,E.Z)(),a=(0,l.Z)(n,4),i=a[0],c=a[2],d=a[3],s=(0,le.Z)().onIntegrationsClick,u=M(t,"groupMode"),m=(0,l.Z)(u,2),p=m[0],g=m[1],h=(0,r.useMemo)((function(){return pe.find((function(e){return e.value===p}))||pe[0]}),[p]),b=(0,r.useCallback)((function(e){var t=e.value;return g(t)}),[g]);return r.createElement(v.Flex,{alignItems:"center","data-testid":"agentsHead-actions",flexWrap:!1,gap:3},r.createElement(v.Select,{components:ge,label:"Group by",onChange:b,onMenuOpen:me,options:pe,styles:he,value:h}),r.createElement(ae,{roomId:t,spaceId:e}),r.createElement(v.Button,{icon:"integrations",flavour:"hollow",onClick:s,small:!0},"Integrations"),i&&r.createElement(O.Z,{onClose:d}),r.createElement(fe,{"data-ga":"add-nodes::click-add-nodes::hm-nodes","data-testid":"agentsHead-addNode",icon:"nodes_hollow",label:"Add Nodes",onClick:c,small:!0}))},be=function(){return r.createElement(v.Flex,{width:"100%",justifyContent:"end",background:"mainBackground",padding:[2]},r.createElement(ve,null))},ye=(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)),we=n(88866);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 xe(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 Oe,ke=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]=xe(xe({},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",ignorePunctuation:!0})})).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={},d=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,ye.Z)("menu_".concat(t))),size:24,forceVisibility:!0,icon:r.groupIcon,extraKey:o},n.forEach((function(e){var n,r,i,c,d=a[e];l[e]=xe(xe({},d),{},{level:1,id:e,menuGroupId:t,link:"".concat((0,ye.Z)("menu_".concat(t,"_submenu_").concat(e))),size:24,forceVisibility:!0,icon:(null===(n=we._[null===(r=d.os)||void 0===r?void 0:r.nm])||void 0===n?void 0:n.iconName)||(null===(i=we.V[null===(c=d.os)||void 0===c?void 0:c.id])||void 0===i?void 0:i.iconName)||"os",extraKey:o})})),e}),{}),s=Object.keys(c),u=s.reduce((function(e,t){1;var n=xe(xe({},d[t]),{},{sticky:!0});return[].concat((0,q.Z)(e),[n],(0,q.Z)(d[t].subMenuIds.reduce((function(e,t){1;var n=l[t];return[].concat((0,q.Z)(e),[n])}),[])))}),[]);return a=null,{stickyIds:{},allElements:u,menuGroupIds:s,menuGroupById:d,subMenuById:l}},Ce=n(62340),Ze=n(22965),Ie={alertStatus:(Oe={},(0,b.Z)(Oe,Ce.Z.critical,1),(0,b.Z)(Oe,Ce.Z.warning,2),(0,b.Z)(Oe,Ce.Z.clear,3),(0,b.Z)(Oe,Ce.Z.unreachable,4),Oe),nodeStatus:{Live:1,Stale:2,Offline:3}},je={nodeStatus:function(e){return(0,Ze.Q5)(e.state)},alertStatus:function(e){return(0,Ze.hC)(e)}},Se=n(15394),Ne=n(53499),Pe=n(69743),De=n(56102),Te=n(11835),Me=["id"],Be=function(e){var t=e.id,n=(0,B.Z)(e,Me);return r.createElement(Pe.d,(0,y.Z)({id:t},n),r.createElement(De.Y,{id:t}),r.createElement(Te.f,{id:t}))},Fe=(0,r.memo)(Be),Ae=n(3322),_e=n(24093),Le=n(33335),Re=n(6585),Ve=n(97279),ze=n(66917),He=["connectivity","id","name"],We=function(e){var t=e.connectivity,n=e.id,a=e.name,i=(0,B.Z)(e,He),c=(0,Le.gI)("node:Delete"),d=!(0,o.Hm)().untouchable,s=(0,E.Z)(),u=(0,l.Z)(s,4),m=u[0],f=u[2],p=u[3],g=(0,E.Z)(),h=(0,l.Z)(g,4),v=h[0],b=h[2],w=h[3];return r.createElement(ze.st,(0,y.Z)({alignSelf:"end",gap:1,"data-testid":"node-actions"},i),d&&r.createElement(r.Fragment,null,r.createElement(_e.Z,{badge:"actionRemove","data-testid":"remove-node-action"},r.createElement(ze.xZ,{"data-ga":"nodes-table-row::click-remove-node::nodes-view",onClick:b})),v&&r.createElement(Ve.ZP,{ids:[n],name:a,onClose:w})),c&&"Offline"===t&&r.createElement(r.Fragment,null,r.createElement(_e.Z,{badge:"actionObsolete","data-testid":"obsolete-node-action"},r.createElement(ze.dl,{"data-ga":"nodes-table-row::click-obsolete-node::nodes-view",onClick:f})),m&&r.createElement(Re.ZP,{ids:[n],name:a,onClose:p})))},Ue=n(56001),Ge=["instanceType","name","providerType"],Ke=function(e){var t=e.instanceType,n=e.name,o=e.providerType,a=(0,B.Z)(e,Ge);return r.createElement(_e.Z,(0,y.Z)({badge:"cloudInfo","data-testid":"node-cloud-info",nodeName:n},a),r.createElement(v.Flex,{alignItems:"center",gap:1},r.createElement(v.Icon,{color:"textDescription","data-testid":"node-cloud-info-icon",name:"ipNetworking",width:"18px",height:"18px"}),r.createElement(v.TextSmall,{color:"textDescription","data-testid":"node-cloud-info-text"},(0,Ze.MC)(o)," \u2022 ",(0,Ze.MC)(t))))},qe=["connectivity","name"],Qe=function(e){var t=e.connectivity,n=e.name,o=(0,B.Z)(e,qe);return r.createElement(_e.Z,(0,y.Z)({badge:"connectivity",connectivityState:t,"data-testid":"node-connectivity",nodeName:n},o),r.createElement(v.Icon,{name:"connectivityStatus".concat(t),width:"18px",height:"18px"}))},Xe=["onClick"],Ye=function(e){var t=e.onClick,n=(0,B.Z)(e,Xe);return r.createElement(_e.Z,(0,y.Z)({badge:"info","data-testid":"node-info-cta"},n),r.createElement(v.Icon,{color:"textDescription",cursor:"pointer",height:"18px",width:"18px",name:"information",onClick:t}))},Je=["name"],$e=function(e){var t=e.name,n=(0,B.Z)(e,Je);return r.createElement(_e.Z,(0,y.Z)({badge:"k8s","data-testid":"node-kubernetes",nodeName:t},n),r.createElement(v.Flex,{alignItems:"center",gap:1},r.createElement(v.Icon,{color:"textDescription","data-testid":"node-kubernetes-icon",name:"serviceKubernetes",width:"18px",height:"18px"}),r.createElement(v.TextSmall,{color:"textDescription","data-testid":"node-kubernetes-text"},"k8s")))},et=["kernelName","kernelVersion","name"],tt=function(e){var t=e.kernelName,n=e.kernelVersion,o=e.name,a=(0,B.Z)(e,et);return r.createElement(_e.Z,(0,y.Z)({badge:"kernel","data-testid":"node-kernel",nodeName:o},a),r.createElement(v.TextSmall,{color:"textDescription"},(0,Ze.cB)(t,n)))},nt=n(72132),rt=n(75691),ot=["architecture","cpuFrequency","cpus","diskSpace","memory","name","os","osName"],at=function(e){var t,n,o=e.architecture,a=e.cpuFrequency,i=e.cpus,c=e.diskSpace,l=e.memory,d=e.name,s=e.os,u=e.osName,m=(0,B.Z)(e,ot);return r.createElement(_e.Z,(0,y.Z)({badge:"systemInfo","data-testid":"node-system-info",nodeName:d},m),r.createElement(v.Flex,{alignItems:"center",gap:1},r.createElement(v.Icon,{color:"textDescription","data-testid":"node-system-info-icon",name:(null===(t=we._[u])||void 0===t?void 0:t.iconName)||(null===(n=we.V[s])||void 0===n?void 0:n.iconName)||"os",width:"16px",height:"16px"}),r.createElement(v.TextSmall,{color:"textDescription","data-testid":"node-system-info-text"},(0,Ze.MC)(u)," \u2022 ",(0,Ze.ys)(a)," \u2022"," ",(0,Ze.MC)(i,1===i?"Core":"Cores")," \u2022 ",(0,Ze.MC)(o)," ","\u2022 ",(0,Ze.MC)((0,Ze.yo)(l),"RAM")," \u2022"," ",(0,Ze.MC)((0,Ze.yo)(c),"HD"))))},it=["container","name","virtualization"],ct=function(e){var t=e.container,n=e.name,o=e.virtualization,a=(0,B.Z)(e,it),i=(0,Ze.jo)(t,o);return r.createElement(_e.Z,(0,y.Z)({badge:"type","data-testid":"node-type",nodeName:n,nodeType:i.label},a),r.createElement(v.Flex,{alignItems:"center",gap:1},r.createElement(v.Icon,{color:"textDescription","data-testid":"node-type-icon",name:i.icon,height:i.iconSize,width:i.iconSize}),r.createElement(v.TextSmall,{color:"textDescription","data-testid":"node-type-text"},i.label)))},lt=n(83925),dt=n(9058),st=(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)})}))}),ut=n(16978),mt=function(e){var t=e.id,n=e.roomId,o=e.nodeId,a=e.context,i=e.dimensions,c=(0,dt.e)(),l=(0,r.useMemo)((function(){var e=st(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(ut.Z,{chart:l,hasHeader:!1,hasFooter:!1,hasFilters:!1,height:100}):null},ft=(0,r.memo)(mt),pt=n(38626),gt=function(e){var t=e.id,n=e.context,a=e.nodeId,i=e.isLive,c=e.hidden,l=e.title,d=e.dimensions,s=(0,o.UL)();return c||!i?null:r.createElement(v.Flex,{column:!0,"data-testid":"metrics-chart-".concat(n),flex:"grow",basis:"174px"},r.createElement(pt.Z,{text:l||n,TextComponent:v.TextSmall,color:"textDescription",margin:[1,0,1,2],as:"div"}),r.createElement(ft,{id:t,context:n,nodeId:a,roomId:s,dimensions:d}))},ht=function(e){var t,n,a=e.id,i=e.name,c=e.hw,l=e.os,d=e.capabilities,s=e.container,u=e.updateSeverity,m=e.labels,f=e.isLive,p=e.state,h=e.version,b=e.extraKey,w=e.isPreferred,E=(0,o.UL)(),x=null===(t=d.funcs)||void 0===t?void 0:t.enabled,O=null===(n=d.ml)||void 0===n?void 0:n.enabled,k=(0,Ze.Q5)(p),C=m||{},Z=C._cloud_instance_type,I=C._cloud_provider_type,j="true"===(null===m||void 0===m?void 0:m._is_k8s_node),S=!(0,Ze.O2)(Z)||!(0,Ze.O2)(I),N=(0,g.Sf)("sidebarTab",{flavour:"val",extraKey:b}),P=(0,g.Sf)("sidebarOpen",{flavour:"bool"}),D=(0,g.Sf)("sidebarNodeId",{flavour:"val",extraKey:b}),T=(0,r.useCallback)((function(e){P(!0),N(e),D(a)}),[a]),M=(0,r.useCallback)((function(){return T("alerts")}),[T]),B=(0,r.useCallback)((function(){return T("info")}),[T]),F=(0,Ae.Eq)(),A=(0,R.uA)(E);return r.createElement(v.Flex,{"data-testid":"nodeRow-".concat(i),"data-submenuid":a,padding:[1],column:!0,gap:1,round:!0},r.createElement(v.Flex,{alignItems:"center","data-testid":"nodeRow-basic-info",gap:2,height:{min:6}},r.createElement(Qe,{connectivity:k,"data-testid":"nodeRow-connectivity-".concat(k.toLowerCase()),name:i}),r.createElement(ze.uh,{"data-testid":"nodeRow-separator"}),r.createElement(rt.Z,{"data-testid":"nodeRow-name",id:a,name:i,isLive:f,state:p,isPreferred:w}),r.createElement(ze.uh,{"data-testid":"nodeRow-separator"}),r.createElement(Ye,{onClick:B,"data-testid":"nodeRow-more-info-cta"}),r.createElement(ze.uh,{"data-testid":"nodeRow-separator"}),r.createElement(Ue.Z,{id:a,isLive:f,"data-testid":"nodeRow-alerts",name:i,onClick:M}),r.createElement(ze.uh,{"data-testid":"nodeRow-separator"}),r.createElement(nt.Z,{badge:"ml","data-testid":"nodeRow-machine-learning-status",enabled:O,name:i},r.createElement(v.Icon,{name:"anomaliesLens",size:"small",color:"text"})),r.createElement(ze.uh,{"data-testid":"nodeRow-separator"}),r.createElement(nt.Z,{badge:"fn","data-testid":"nodeRow-fn-status",enabled:x,name:i,onClick:function(){return F(a)}},r.createElement(v.Icon,{name:"functions",size:"small",color:"text"})),u&&r.createElement(r.Fragment,null,r.createElement(ze.uh,{"data-testid":"nodeRow-separator"}),r.createElement(lt.Z,{name:i,os:l.id,container:s,warningLevel:u,labels:m,version:h,text:u,"data-testid":"nodeRow-needs-update"})),r.createElement(We,{"data-testid":"nodeRow-node-actions",id:a,name:i,connectivity:k})),r.createElement(v.Flex,{alignItems:"center","data-testid":"nodeRow-detailed-info",gap:2},r.createElement(at,{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(ze.uh,{"data-testid":"nodeRow-separator"}),!(null===l||void 0===l||!l.kernel)&&r.createElement(tt,{"data-testid":"nodeRow-kernel",kernelName:l.kernel.nm,kernelVersion:l.kernel.v,name:i}),r.createElement(ze.uh,{"data-testid":"nodeRow-separator"}),j&&r.createElement(r.Fragment,null,r.createElement($e,{"data-testid":"nodeRow-kubernetes",name:i}),r.createElement(ze.uh,{"data-testid":"nodeRow-separator"})),r.createElement(ct,{container:c.container,"data-testid":"nodeRow-type",name:i,virtualization:c.virtualization}),S&&r.createElement(r.Fragment,null,r.createElement(ze.uh,{"data-testid":"nodeRow-separator"}),r.createElement(Ke,{"data-testid":"nodeRow-cloud-info",instanceType:Z,name:i,providerType:I}))),w&&!(null===A||void 0===A||!A.length)&&r.createElement(v.Flex,{"data-testid":"nodeRow-charts",gap:1},A.map((function(e){return r.createElement(gt,(0,y.Z)({key:e.id},e,{nodeId:a,isLive:f}))}))))},vt=function(e){switch(e.level){case 0:return Fe;case 1:return ht;default:return null}},bt=["onChartNameChange","initialChartName","dashboardOptions","linkToGo","contextToGo"],yt=function(e){var t=e.onChartNameChange,n=e.initialChartName,o=e.dashboardOptions,a=e.linkToGo,i=e.contextToGo,c=(0,B.Z)(e,bt),l=(0,Se.Z)({onChartNameChange:t,initialChartName:n,linkToGo:a,contextToGo:i}),d=l.setActiveMenuGroupId,s=l.setActiveSubMenuId;return r.createElement(p.v,c,r.createElement(Ne.Z,{onActiveMenuGroupId:d,onActiveSubMenuId:s,getComponent:vt,dashboardOptions:o,initialChartName:n,checkVisibility:function(){return!0}}))},wt=["config"],Et=function(){var e=(0,f.th)(),t=(0,o.UL)(),n=function(){var e=(0,o.UL)(),t=T(e,"groupMode")||"nodeStatus",n=je[t]||je.nodeStatus;return(0,r.useCallback)((function(e){var r,o=n(e);return{name:o,priority:je[t]?null===Ie||void 0===Ie||null===(r=Ie[t])||void 0===r?void 0:r[o]:Ie.nodeStatus,icon:"nodeStatus"===t?"connectivityStatus".concat(o):null}}),[t])}(),a=(0,u.fX)({extraKey:"nodesView",merge:!1,scoped:!0}),i=(0,m.wU)(),c=(0,d.Z)(),v=(0,l.Z)(c,2),b=v[0],y=v[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,dt.e)(),c=(0,r.useRef)();(0,r.useMemo)((function(){if(i){var n=st(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,containerWidth:a}}),c.current=n,i.appendChild(n)}}),[e]),(0,r.useMemo)((function(){c.current&&(c.current.setAttribute("containerWidth",a),c.current.getNodes().forEach((function(e){return e.updateAttribute("containerWidth",a)})))}),[c.current,a]),(0,r.useLayoutEffect)((function(){return function(){return c.current&&c.current.destroy()}}),[])}(t,a,{host:(0,f.Q6)()?"".concat(window.envSettings.agentApiUrl,"/api/v2"):"".concat(window.envSettings.apiUrl,"/api/v3/spaces/").concat(e,"/rooms/").concat(t),width:y});var w=(0,g.I0)("nodeIdToGo",{key:t,extraKey:"nodesView",flavour:"val"}),E=(0,l.Z)(w,2),x=E[0],O=E[1];return r.createElement(p.Z,{getObject:i,ids:a,getMenu:ke,getGrouping:n,deps:[n],extraKey:"nodesView"},r.createElement(s.Z,{ref:b,position:"relative",sidebar:r.createElement(h.ZP,{hiddenTabs:wt,nodeIds:a,title:"Nodes",initialChartName:x,flavour:"nodesView",loaded:!0,hasSearch:!1})},r.createElement(be,null),r.createElement(yt,{initialChartName:x,onChartNameChange:O})))},xt=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(Et,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(93416),c=n(46667),l=n(37518),d=n(86242),s=n(28350),u=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,u.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"])),w=(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")),E=(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")))},Z=n(72911),I=n(91268),j=n(33335),S=n(46189),N=n(89250),P=n(92432),D=S.Z.demoSlug,T=(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,N.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(T,{"data-ga":"no-nodes-view::click-demo::no-nodes-header",flavour:"default",onClick:function(t){e("/spaces/".concat(D)),(0,P.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(w,{"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)(),u=(0,d.Z)(n),m=(0,o.Z)(u,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(I.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,{"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(w,{"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(E,{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(w,{"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(Z.Z,{"data-testid":"noNodesView-onboardingVideo",height:296,width:520,videoId:t}),a.createElement(C,{"data-testid":"noNodesView-needHelp",padding:[8,0]})))}},4571:function(e,t,n){n.d(t,{Z:function(){return _t}});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),d=n(29439),s=n(2077),u=n(5441),m=n(25517),f=n(4822),p=n(91268),g=n(43969),h=n(78266),v=n(93416),b=n(37518),y=n(72911),w=n(8741),E=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:E.mX[0]}),a.createElement(y.Z,{"data-testid":"noNodesView-onboardingVideo",height:350,width:850,videoId:E.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(w.Z,{integrationId:k.O_,rooms:[e]}):a.createElement(l.H,null))))},Z=n(45987),I=(n(26699),n(32023),n(92222),n(39714),n(71893)),j=n(65565),S=n(92432),N=n(82351),P=n(97945),D=n(96104),T=n(74059),M=(n(69826),I.default.div.withConfig({displayName:"selections__Separator",componentId:"sc-1cc7y18-0"})(["width:1px;height:",";background:",";"],(0,v.getSizeBy)(2.5),(0,v.getColor)("borderSecondary"))),B=[{label:"Volume",value:"volume"},{label:"KS2",value:"ks2"}],F=[{label:"Average",value:"average"},{label:"Median",value:"median"},{label:"Min",value:"min"},{label:"Max",value:"max"},{label:"Stddev",value:"stddev"}],A=[{label:"Metrics",value:""},{label:"Anomaly Rate",value:"anomaly-bit"}],_=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."))},L=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."))},R=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."))},V=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,d=i.group,u=null!==l&&void 0!==l&&l.includes(A[1].value)?A[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:d},e,r);t(a)}}),[c,l,d]),f=(0,a.useMemo)((function(){return{method:B.find((function(e){return e.value===c})),group:F.find((function(e){return e.value===d})),option:A.find((function(e){return e.value===u}))}}),[c,d,u]);return d?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:B,value:f.method,onChange:m("method")}),a.createElement(N.Z,{isBasic:!0,plain:!0,content:_,align:"bottom"},a.createElement(v.Icon,{name:"information",color:"textDescription",size:"small"}))),a.createElement(M,null),a.createElement(v.Flex,{gap:1,alignItems:"center"},a.createElement(v.TextSmall,{color:"textLite"},"Aggregation:"),a.createElement(v.Select,{options:F,value:f.group,onChange:m("group")}),a.createElement(N.Z,{isBasic:!0,plain:!0,content:L,align:"bottom"},a.createElement(v.Icon,{name:"information",color:"textDescription",size:"small"}))),a.createElement(M,null),a.createElement(v.Flex,{gap:1,alignItems:"center"},a.createElement(v.TextSmall,{color:"textLite"},"Data:"),a.createElement(v.Select,{options:A,value:f.option,onChange:m("options")}),a.createElement(N.Z,{isBasic:!0,plain:!0,content:R,align:"bottom"},a.createElement(v.Icon,{name:"information",color:"textDescription",size:"small"}))),a.createElement(M,null)):null},z=n(89405),H=function(e){var t=e.highlightAfter,n=e.highlightBefore,r=e.baseline,o=(0,z.rA)(),i=o.localeDateString,c=o.localeTimeString,l=new Date(t),d=new Date(n),s=new Date(r),u=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(d,{long:!1}),","," ",c(d)),a.createElement(v.TextSmall,{"data-testid":"metricCorrelation-referenceBaseline"},i(s,{long:!1}),","," ",c(s),"\xa0->\xa0",i(u,{long:!1}),","," ",c(u))),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(N.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"})))},W=n(39979),U=n(63346);function G(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 K=(0,W.Z)(v.Button),q=(0,I.default)(v.Button).withConfig({displayName:"correlation__LogoButton",componentId:"sc-15d72m3-0"})(["&&{pointer-events:none;}"]),Q=(0,I.default)(v.Button).withConfig({displayName:"correlation__CloseButton",componentId:"sc-15d72m3-1"})(["position:absolute !important;top:-3px;right:-3px;"]),X=(0,W.Z)(Q),Y=(0,I.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;}"]),J=function(e){var t=e.flavour,n=(0,T.th)(),r=(0,b.UL)(),i=(0,P.pG)(),c=(0,a.useMemo)((function(){return i?[i]:[]}),[i]),l=(0,D.fX)({extraKey:"nodesView",merge:!1,scoped:!0}),u="singleNode"===t?c:l,m=(0,a.useState)(!1),p=(0,d.Z)(m,2),g=p[0],h=p[1],y=(0,a.useState)(),w=(0,d.Z)(y,2),E=w[0],x=w[1],O=(0,s.d5)({nodeIds:u,flavour:t},n,r),k=O.threshold,C=O.totalDimensionsCount,Z=O.dimensionsCount,I=O.loaded,M=O.loading,B=O.getWeights,F=O.resetWeights,A=(0,s.$g)({nodeIds:u,flavour:t}),_=A.method,L=A.options,R=A.group,z=(0,f.by)("highlight"),W=z.after,Q=z.before,J=W-4*(Q-W),$=!!W;(0,a.useEffect)((function(){if(I){var e="default-result";if(R){var t=null!==L&&void 0!==L&&L.includes("anomaly-bit")?"anomaly-bit":"metrics";e="default-result-".concat(_,"-").concat(R,"-").concat(t)}return(0,S.L)("metrics-correlation",e,"charts-view",Z.toString())}}),[I]),(0,j.Z)((function(){W&&h(!0)}),[W]);var ee=(0,f.TQ)("correlation"),te=(0,f.TQ)("threshold"),ne=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};h(!1),x(),B(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?G(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({highlightAfter:W,highlightBefore:Q,baselineAfter:J,baselineBefore:W,method:_,options:L,group:R,nodeIds:u},e)).then((function(){return te(s.mt)}))},re=!$||M;return(0,j.Z)((function(){I&&g&&$&&ne()}),[I,$,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},$?I?a.createElement(U.Xe,{feature:"MetricCorrelations",totalDimensionsCount:C,dimensionsCount:Z},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"},Z)," ","correlated metrics."),a.createElement(N.Z,{content:"Clear results"},a.createElement(Y,{flavour:"borderless",neutral:!0,disabled:M||!I&&!$,onClick:function(){te(s.mt),F(),(0,S.L)("metrics-correlation","click-delete","charts-view","".concat(I?"finish":"start"))},"data-testid":"metricCorrelation-clear",small:!0,icon:"reload"}))),a.createElement(V,{runGetWeights:ne,nodeIds:u,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 te(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(N.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:"+"===E?"hollow":"borderless",disabled:E,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:"-"===E?"hollow":"borderless",disabled:E,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(q,{icon:"logo_s",isLoading:M}),M?a.createElement(v.H5,{"data-testid":"metricCorrelation-loadingCalculation"},"Calculating metric correlations..."):a.createElement(H,{highlightAfter:W,highlightBefore:Q,baseline:J})):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"},(!I||M)&&a.createElement(N.Z,{content:re?"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(K,{label:M?"Loading...":"Find correlations",isLoading:!1,onClick:ne,disabled:re,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(N.Z,{content:"Close",align:"bottom"},a.createElement(X,{neutral:!0,flavour:"borderless",onClick:function(){ee(!1),te(s.mt),F(),(0,S.L)("metrics-correlation","click-close","charts-view","".concat(I?"finish":"start"))},"data-ga":"metric-correlation::click-close::charts-view","data-testid":"metricCorrelation-close",icon:"x",feature:"MetricCorrelations"}))))},$=(0,W.Z)(v.Button),ee=function(){var e=(0,f.TQ)("correlation");return a.createElement(N.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($,{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}))},te=n(14348),ne=n(88866),re=n(24093),oe=n(77796),ae=n(12008),ie=n(22965),ce=I.default.div.withConfig({displayName:"styled__Separator",componentId:"sc-1fhfk7c-0"})(["background:",";height:20px;width:1px;"],(0,v.getColor)("border")),le=n(83925);function de(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?de(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):de(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ue=function(e){var t,n,r=e.flavour,o=(0,P.pG)(),i=(0,oe.ev)(o),c=(0,ae.n_)(i),l=c.critical,d=c.warning,s=(0,f.Sf)("sidebarTab",{flavour:"val",extraKey:r}),u=(0,f.Sf)("sidebarOpen",{flavour:"bool"}),m=(0,a.useCallback)((function(e){u(!0),s(e)}),[]),p=(0,P.iy)(o),g=p.hw,h=void 0===g?{}:g,b=p.cpus,y=p.isLive,w=p.name,E=p.os,x=void 0===E?{}:E,O=p.state,k=p.updateSeverity,C=p.labels,Z=p.version,I={dataTestId:"singleNode",isLive:y},j=(0,ie.kR)(se({count:l,type:"critical"},I)),S=(0,ie.kR)(se({count:d,type:"warning"},I)),N=(0,ie.Q5)(O),D=(0,ie.jo)(h.container,h.virtualization),T=(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(w),strong:!0},w),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:w},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:w,os:x.id,container:h.container,warningLevel:k,labels:C,version:Z,text:k}),a.createElement(ce,{"data-testid":"singleNode-separator"}),a.createElement(re.Z,{badge:"connectivity",connectivityState:N,"data-testid":"singleNode-connectivityStateInfo",nodeName:w},a.createElement(v.Pill,{flavour:"neutral",hollow:!0},N)),a.createElement(re.Z,{badge:"type","data-testid":"singleNode-nodeTypeInfo",nodeName:w,nodeType:D.label},a.createElement(v.Pill,{flavour:"neutral",hollow:!0,icon:D.icon},D.label)),T&&a.createElement(re.Z,{badge:"systemInfo","data-testid":"singleNode-systemInfo",nodeName:w},a.createElement(v.Pill,{flavour:"neutral",hollow:!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=n(71371),ge=["flavour"],he={singleNode:ue,default:pe.Z},ve=(0,a.memo)((function(e){var t=e.flavour,n=(0,Z.Z)(e,ge),o=(0,f.by)("correlation"),i=he[t]||he.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(J,{flavour:t}):a.createElement(a.Fragment,null,!!i&&a.createElement(i,(0,r.Z)({},n,{flavour:t})),a.createElement(v.Flex,{gap:2},a.createElement(fe,null),a.createElement(ee,null))))})),be=n(15394),ye=n(53499),we=n(22962),Ee=n(61152),xe=n(69743),Oe=n(56102),ke=n(11835),Ce=(n(31672),n(59461),n(74916),n(4723),n(21249),n(57640),n(9924),n(69968)),Ze=(n(48564),n(79424),n(71824)),Ie=n(17638),je=n(85993),Se=n(62525),Ne=n(41481),Pe=n(16978),De=n(9058),Te=n(64504),Me=n(84147),Be=function(e){return function(t){return"overview-page::".concat(e.getAttribute("id"),"::").concat(t)}},Fe=["chartId"],Ae=["style","className","onMouseDown","onMouseUp","onTouchEnd","children","id","menuChartAttributes"],_e=["id","ids","containerWidth"];function Le(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 Re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Le(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ve=(0,a.forwardRef)((function(e,t){var n=e.style,r=e.className,o=e.onMouseDown,i=e.onMouseUp,c=e.onTouchEnd,l=(e.children,e.id),d=e.menuChartAttributes,s=((0,Z.Z)(e,Ae),(0,b.UL)()),u=(0,De.e)(),m=(0,Te.u)(),f=(0,a.useMemo)((function(){var e,t="head-".concat(l),n=m.getChildren().find((function(e){return e.match({id:t})}));if(!n){var r=Re({contextScope:[(e=d).chartId]},(0,Z.Z)(e,Fe));n=u.makeChart({attributes:Re(Re({},r),{},{roomId:s,id:t}),makeTrack:Be}),m.appendChild(n)}return n}),[s,l,m]);return(0,Me.Ni)(d.chartId)?a.createElement("div",{key:m.getId(),ref:t,style:n,className:r,onMouseDown:o,onMouseUp:i,onTouchEnd:c},a.createElement(Pe.Z,{chart:f,"data-track":f.track("container"),height:n.height,width:"100%"})):null})),ze=(0,Ze.wJ)(Ve),He=function(e,t){return e.layout||console.warn(t,"has no layout set, default values will be used."),Re(Re({x:0,y:0,w:3,h:5,i:e.id,chartId:e.chartId},e.layout),{},{minW:1,minH:1,static:!1})},We={lg:12,md:12,sm:12,xs:12,xxs:1},Ue={lg:40,md:30,sm:30,xs:30,xxs:30},Ge=function(e){var t=e.id,n=e.ids,o=e.containerWidth,i=(0,Z.Z)(e,_e),c=(0,Ze.mQ)(n,He),l=(0,Ne.J1)().filteredChartsCount,s=(0,Ze.MS)(t),u=(0,a.useMemo)((function(){return{lg:c.filter((function(e){if(!e)return!1;var t=s(e.chartId);return t.visible&&!t.filteredOut&&!t.hidden}))}}),[n,c,l]),m=(0,a.useState)("lg"),f=(0,d.Z)(m,2),p=f[0],g=f[1],h=(0,a.useMemo)((function(){return u.lg.map((function(e){var t=e.i;return a.createElement(ze,{key:t,id:t})}))}),[u]);return n.length?a.createElement(Ie.n,(0,r.Z)({width:"100%"},i),a.createElement(Ce.Responsive,{layouts:u,rowHeight:Ue[p],cols:We,margin:[4,4],style:{minWidth:"100%"},width:o-26,compactType:"horizontal",onBreakpointChange:g,useCSSTransforms:!1,isDraggable:!1,isResizable:!1},h)):null},Ke=(0,je.Lj)(Ge,(function(e){return{ids:e.headIds}})),qe=(0,Se.Ji)(Ge,(function(e){return{ids:e.headIds}})),Qe=["id","isActiveSticky","containerWidth"],Xe=function(e){var t=e.id,n=e.isActiveSticky,o=e.containerWidth,i=(0,Z.Z)(e,Qe);return a.createElement(xe.d,(0,r.Z)({id:t},i),a.createElement(Oe.Y,{id:t,tiny:n,hasTooltip:n}),!n&&a.createElement(ke.f,{id:t,isActiveSticky:n}),!n&&a.createElement(Ke,{id:t,tiny:n,containerWidth:o}))},Ye=(0,a.memo)(Xe),Je=n(93433),$e=n(61181),et=n(54005),tt=["style","className","onMouseDown","onMouseUp","onTouchEnd","children","id"];function nt(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 rt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nt(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ot=[],at=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{selectedDimensions:e.dimensions?Object.keys(e.dimensions):ot,selectedInstances:e.instances?Object.keys(e.instances):ot,selectedNodes:e.nodes?Object.keys(e.nodes):ot,weight:e.weight}},it=(0,a.forwardRef)((function(e,t){var n=e.style,o=e.className,i=e.onMouseDown,c=e.onMouseUp,l=e.onTouchEnd,d=e.children,s=e.id,u=(0,Z.Z)(e,tt),m=(0,b.UL)(),f=(0,Te.u)(),p=(0,Ze.nI)(s),g=(0,De.e)(),h=(0,et.Z)(),v=h.sendLog,y=h.isReady,w=(0,a.useMemo)((function(){var e=f.getNode({id:s});return e||(e=g.makeChart({attributes:rt(rt({contextScope:[s],id:s,roomId:m},p),{},{toolboxProps:{drag:{onMouseDown:i,onMouseUp:c,onTouchEnd:l,draggable:!0,onDragStart:function(e){var t=e.dataTransfer;t.setData("type","chart"),t.setData("id",s)}}}}),makeTrack:Be}),f.appendChild(e),e)}),[f,m,s]);(0,a.useEffect)((function(){w&&y&&"function"===typeof v&&w.updateAttribute("logOptions",{sendLog:v,payload:{feature:"Overview"}})}),[w,v,y]);var E=(0,Ze.Q8)(s,at),x=E.weight,O=E.selectedDimensions,k=E.selectedInstances,C=E.selectedNodes;return(0,a.useEffect)((function(){w&&x&&(w.updateAttributes({selectedDimensions:O,selectedInstances:k,selectedNodes:C}),w.trigger("fetch"))}),[m,s,x,O.length,k.length,C.length]),(0,a.useEffect)((function(){w.updateAttributes({height:n.height,width:n.width}),w.trigger("resize")}),[n.height,n.width]),a.createElement("div",{key:f.getId(),ref:t,style:n,className:o},a.createElement(Pe.Z,(0,r.Z)({chart:w,"data-chartid":s,"data-track":w.track("container"),height:n.height,width:"100%"},u)),d)})),ct=a.memo(it,(function(e,t){return e.id===t.id&&e.style===t.style})),lt=["id","subMenuId","containerWidth"];function dt(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 st(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dt(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ut=(0,I.default)(v.IconButton).attrs({icon:"resize_handler",padding:[0],position:"absolute",bottom:0,right:0,color:"textLite",hoverColor:"textDescription",size:"16px"}).withConfig({displayName:"chartSubMenu__ResizeButton",componentId:"sc-116adw2-0"})(["&&{cursor:ns-resize;}"]),mt=(0,I.default)(Ce.Responsive).withConfig({displayName:"chartSubMenu__GridLayout",componentId:"sc-116adw2-1"})([".react-grid-layout{position:relative;transition:height 200ms ease;}.react-grid-item{transition:all 200ms ease;transition-property:left,top;}.react-grid-item img{pointer-events:none;user-select:none;}.react-grid-item.cssTransforms{transition-property:transform;}.react-grid-item.resizing{z-index:1;will-change:width,height;}.react-grid-item.react-draggable-dragging{transition:none;z-index:3;will-change:transform;}.react-grid-item.dropping{visibility:hidden;}.react-grid-item.react-grid-placeholder{background:",";opacity:0.2;transition-duration:100ms;z-index:2;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;}"],(0,v.getColor)("accent")),ft=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.id,n=e.layout,r=void 0===n?{}:n;return(0,$e.G0)(t,r,st(st({x:0,y:0,w:12,h:9,i:t,chartId:t},r),{},{minW:12,maxW:12,minH:4,static:!1}))},pt={lg:12,md:12,sm:12,xs:12,xxs:1},gt={lg:40,md:30,sm:30,xs:30,xxs:30},ht=function(e){var t=e.id,n=e.subMenuId,i=e.containerWidth,c=(0,Z.Z)(e,lt),l=(0,Ze.nI)(t,ft),s=(0,a.useState)((function(){return{lg:[l]}})),u=(0,d.Z)(s,2),m=u[0],f=u[1],p=(0,a.useState)("lg"),g=(0,d.Z)(p,2),h=g[0],v=g[1],b=(0,a.useMemo)((function(){return m.lg.map((function(e){var t=e.i,o=e.chartId;return a.createElement(ct,(0,r.Z)({key:t,id:t,chartId:o,role:"graphics-object","aria-roledescription":"chart","data-submenuid":n,isDraggable:!1},c))}))}),[h,m]);return a.createElement(mt,{layouts:m,rowHeight:gt[h],cols:pt,margin:[4,4],width:i-26,onLayoutChange:function(e,t){return f(t)},compactType:"horizontal",onBreakpointChange:v,useCSSTransforms:!1,isDraggable:!1,isResizable:!0,isDroppable:!0,resizeHandle:a.createElement(ut,null),onDrop:function(e,t,n){n.dataTransfer&&("chart"===n.dataTransfer.getData("type")?f(st(st({},m),{},(0,o.Z)({},h,[].concat((0,Je.Z)(m[h]),[st({},ft({id:n.dataTransfer.getData("id")}))])))):n.preventDefault())},onResizeStop:$e.EG},b)},vt=(0,a.memo)(ht),bt=n(14048),yt=n(12664),wt=function(e){var t=e.id,n=e.isActiveSticky;return a.createElement(bt.D,{gap:0,id:t},a.createElement(yt.o,{id:t,margin:[1,0,0],hasTooltip:n}),!n&&a.createElement(qe,{id:t}))},Et=(0,a.memo)(wt),xt=function(e){var t=e.id,n=(0,b.UL)(),r=(0,De.e)(),o=(0,Ze.MS)(),i=(0,je.nk)(t).subMenuChartIds,c=(0,Te.u)(),l=(0,a.useMemo)((function(){var e=(0,d.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(Pe.Z,{key:c.getId(),margin:[0,0,2],chart:l,"data-chartid":t,"data-track":l.track("container")})},Ot=["id"],kt=function(e){var t=e.id,n=(0,Z.Z)(e,Ot);return a.createElement(xe.d,{id:t,padding:[6,0,0]},a.createElement(Oe.Y,{id:t}),a.createElement(ke.f,{id:t,padding:[2,0,0]}),a.createElement(xt,(0,r.Z)({id:t},n)))},Ct={k8s:(0,a.memo)(kt)},Zt=function(e){if(Ct[e.flavour])return Ct[e.flavour];switch(e.level){case 0:return Ye;case 1:return Et;case 2:return vt;default:return null}},It=function(e){var t=e.onChartNameChange,n=e.initialChartName,r=e.dashboardOptions,o=e.linkToGo,i=e.contextToGo,l=e.containerWidth,s=(0,Ee.Z)("addToDashboardModal"),u=(0,d.Z)(s,4),m=u[0],f=u[3],p=(0,be.Z)({onChartNameChange:t,initialChartName:n,linkToGo:o,contextToGo:i}),g=p.setActiveMenuGroupId,h=p.setActiveSubMenuId;return a.createElement(c.v,null,a.createElement(ye.Z,{onActiveMenuGroupId:g,onActiveSubMenuId:h,getComponent:Zt,dashboardOptions:r,initialChartName:n,containerWidth:l}),m&&a.createElement(we.Z,{onClose:f}))},jt=n(6015);function St(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 Nt=(0,a.memo)((function(){var e=(0,ae.O0)(),t=(0,d.Z)(e,2),n=t[0],r=t[1],i=(0,De.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?St(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):St(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)(),u=(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===u||void 0===u||!u.loaded)return null;var m=u.firstEntry;return a.createElement(v.Layer,{backdrop:!1,position:"top",margin:[26,0,0],padding:[26,0,0]},a.createElement(v.Flex,{background:"tooltip",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"}))))})),Pt=Nt;function Dt(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?Dt(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Mt={NoChartsView:g.Z,NoNodesView:l.Z,sidebar:{title:"Filters",hiddenTabs:["info"],Component:jt.ZP,props:{}},dashboardOptions:{},loadingMessage:"Loading charts...",Header:ve},Bt={overview:Tt(Tt({},Mt),{},{sidebar:Tt(Tt({},Mt.sidebar),{},{title:"Overview"}),feature:"Overview"}),k8s:Tt(Tt({},Mt),{},{NoChartsView:C,NoNodesView:C,sidebar:Tt(Tt({},Mt.sidebar),{},{title:"Kubernetes"}),loadingMessage:"Loading k8s charts...",feature:"Kubernetes"}),singleNode:Tt(Tt({},Mt),{},{sidebar:Tt(Tt({},Mt.sidebar),{},{title:"Single Node",hiddenTabs:["filters"],props:{showCollapsed:!0}}),feature:"SingleNode"})},Ft=function(){return function(){var e=(0,u.E)(),t=(0,s.yp)({nodeIds:e,flavour:"rhs"}),n=(0,m.$B)(),r=(0,d.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},At=(0,a.memo)((function(e){var t=e.flavour,n=void 0===t?"overview":t,o=e.invalidationKey,l=e.nodeIds,d=e.loaded,s=e.getChart,u=e.chartIds,m=e.areChartsIdsEmpty,f=e.showNoChartsView,g=e.showNoNodesView,v=e.initializing,b=e.chartName,y=e.setChartName,w=e.chartsLoaded,E=e.widthRef,x=e.containerWidth,O=e.nodesKey,k=e.blurred,C=e.blurProps,Z=void 0===C?{}:C,I=e.BlurredContent,j=e.noPreferredNodesError,S=Bt[n],N=S.dashboardOptions,P=S.NoChartsView,D=S.NoNodesView,T=S.sidebar,M=S.loadingMessage,B=S.Header,F=S.feature,A=void 0===F?"Overview":F,_=(0,i.TH)().state;return g?a.createElement(U.ZP,{feature:A,mode:"NoNodesView"},a.createElement(D,null)):v?a.createElement(h.Z,{title:"Please wait while charts are being initialized.",body:"Thank you for your patience!"}):d?a.createElement(U.ZP,{feature:A},a.createElement(c.Z,{key:o,getObject:s,ids:u,linkToGo:null===_||void 0===_?void 0:_.chartName,extraKey:n,deps:[O]},a.createElement(Ft,null),a.createElement(Pt,null),a.createElement(p.Z,{ref:E,sidebar:a.createElement(T.Component,(0,r.Z)({nodeIds:l,title:T.title,initialChartName:b,hiddenTabs:T.hiddenTabs,flavour:n,loaded:w},T.props)),blurred:k,blurProps:Z,BlurredContent:I},a.createElement(B,{flavour:n}),w||j?f||m?a.createElement(P,{noPreferredNodesError:j}):a.createElement(It,{dashboardOptions:N,initialChartName:b,onChartNameChange:y,linkToGo:null===_||void 0===_?void 0:_.chartName,contextToGo:null===_||void 0===_?void 0:_.contextToGo,containerWidth:x}):a.createElement(h.Z,{title:M})))):a.createElement(h.Z,{title:M})})),_t=At},57992:function(e,t,n){var r=n(87462),o=n(67294),a=n(97945),i=n(7335),c=n(74059),l=n(54227),d=n(82210);t.Z=function(e){return function(t){var n=(0,c.th)(),s=(0,a.pG)(),u=(0,a.iy)(s,"isLive"),m=(0,a.iy)(s,"name"),f=(0,a.iy)(s,"isPreferred");(0,l.bV)({title:m,id:s,destination:s});var p=(0,a.TQ)(s,n),g=(0,i.DH)();(0,o.useEffect)((function(){if(u&&"hasValue"===p.state){var e=p.contents;null!==e&&void 0!==e&&e.uid&&m&&g(e.uid,null,m)}}),[p,u,m]);var h=(0,o.useMemo)((function(){return[s]}),[s]);return o.createElement(e,(0,r.Z)({flavour:"singleNode",nodeIds:h,blurred:!f,blurProps:{value:"12px"},BlurredContent:d.Z},t))}}},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 W}});var r=n(87462),o=n(4942),a=n(29439),i=n(45987),c=(n(26699),n(32023),n(92222),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),n(67294)),l=n(24281),d=n(89250),s=n(39915),u=n(74059),m=n(37518),f=n(96929),p=n(84147),g=n(40970),h=n(96104),v=n(97945),b=n(2077),y=n(41481),w=n(42448),E=n(4822),x=n(12008),O=n(39840),k=n(39612);function C(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 Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var I=n(93433),j=(n(69826),n(31672),n(59461),n(74916),n(4723),n(24298)),S=n(96415),N=n(70873),P=n(43460),D=n(84817),T=n(91354),M=n(9058),B=n(65565),F=n(64504),A=n(14808),_=["flavour","nodeIds"];function L(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 R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?L(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var V={default:{shouldHide:function(){return!1}},k8s:{shouldHide:function(e){return!e.context.includes("k8s")}}},z=[],H="ErrNoPreferredNodeRequested",W=function(e){return(0,c.memo)((function(t){var n=t.flavour,o=void 0===n?"overview":n,C=t.nodeIds,L=void 0===C?z:C,W=(0,i.Z)(t,_),U=(0,u.th)(),G=(0,m.UL)(),K=(0,h.fX)({extraKey:o,merge:!1,scoped:!0});K=L.length?L:K;var q=(0,f.fD)(),Q=(0,p.hH)(G),X=(0,d.TH)().state,Y=(0,p.Cd)(G),J=(0,v.Mm)(K),$=(0,g.Z)(G,K,{spaceId:U}),ee=(0,b.d5)({nodeIds:K,flavour:o},U,G),te=ee.contexts,ne=ee.metadata,re=ee.loaded,oe=ee.dimensionsCount,ae=function(){var e=(0,d.TH)().state,t=((void 0===e?{}:e)||{}).alertId,n=void 0===t?null:t,r=(0,x.O0)(),o=(0,a.Z)(r,2),i=o[0],l=o[1],s=n||(null===i||void 0===i?void 0:i.id),u=(0,x.E5)(s);(0,x.yx)(u.id),(0,c.useEffect)((function(){(u.fullyLoaded||u.id)&&l(Z(Z({},u),{},{formattedLastStatusChangeValue:(0,O.m9)(u.lastStatusChangeValue,u.units),linkToGo:"chart_".concat((0,k.Z)(u.context))}))}),[u.id,u.fullyLoaded]);var m=null!==i&&void 0!==i&&i.id?"chart_".concat((0,k.Z)(i.context)):null;return[u.id,m]}(),ie=(0,a.Z)(ae,2)[1],ce=L?L.join():o,le=(0,u.Q6)(),de=(0,l.Z)(),se=(0,a.Z)(de,2),ue=se[0],me=se[1].width;!function(e,t,n){var r=n.width,o=n.host;if(!o)throw"No host provided";var i=(0,M.e)(),l=(0,c.useRef)(),s=(0,p.QX)(e,"error"),u=(0,E.I0)(),m=(0,a.Z)(u,2),f=m[0].correlation,g=m[1],h=(0,d.TH)(),v=h.state,b=h.pathname,y=(0,F.B)(),w=(0,p.qU)(e),x=(0,p.w4)(e);(0,c.useLayoutEffect)((function(){if(e&&i&&!s){var n=i.getRoot().getChildren().find((function(e){return e.match({id:b})}));if(!n)return n=i.makeContainer({attributes:{id:b,roomId:e,host:o,navigation:f?"highlight":"pan",overlays:{proceeded:{type:"proceeded"}},composite:!0,nodesScope:t,hasCorrelation:!0,versions:w,containerWidth:r,toolboxElements:[].concat((0,I.Z)(A.h2?[T.Z]:[]),[P.default,S.default,N.default,D.Z])}}),i.appendChild(n),y(b),l.current=n,(0,j.unregister)(i.on("correlation",(function(e,t){t&&g({correlation:!0})})),n.onAttributeChange("versions",x));y(b)}}),[e,s,b]),(0,c.useMemo)((function(){l.current&&(l.current.setAttribute("containerWidth",r),l.current.getNodes().forEach((function(e){return e.updateAttribute("containerWidth",r)})))}),[l.current,r]),(0,B.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,c.useEffect)((function(){l.current&&l.current.getApplicableNodes({syncHighlight:!0}).forEach((function(e){e.updateAttribute("navigation",f?"highlight":"pan")}))}),[l.current,f]),(0,c.useEffect)((function(){return function(){return l.current&&l.current.destroy()}}),[]),(0,c.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,j.unregister)(o)}}}),[l.current,v])}(G,K,{host:le?"".concat(window.envSettings.agentApiUrl,"/api/v2"):"".concat(window.envSettings.apiUrl,"/api/v3/spaces/").concat(U,"/rooms/").concat(G),width:me});var fe=(0,p.jg)(G),pe=(0,p.YZ)(G),ge=re?ne:Y,he=V[o]||V.default,ve=(0,p.Uq)(G),be=(0,s.Z)(ve),ye=(0,y.Np)(re?te:fe,Y,G,R(R({},he),{},{force:re||ve!==be,cacheKey:"".concat(o,"-").concat(oe,"-").concat(ce)})),we=(0,p.MS)(G,ne),Ee=(0,s.Z)($,!0),xe=ye<1,Oe=(0,E.I0)("chartName",{key:G,extraKey:ce,flavour:"val"}),ke=(0,a.Z)(Oe,2),Ce=ke[0],Ze=ke[1];(0,c.useEffect)((function(){G&&Ze(ie||(null===X||void 0===X?void 0:X.chartName)||Ce)}),[G,ie]);var Ie=(0,F.u)(),je=Object.keys(ge).length<1&&Q||K.length&&!J.length,Se=(0,f.zN)(),Ne=(null===pe||void 0===pe?void 0:pe.errorMsgKey)==H;if(!je&&!1!==Ee&&$&&"No data for this period"!==$&&$!==H&&!Object.keys(ge).length)throw $;var Pe=!!G&&q&&(!!Ie||Ne);return c.createElement(e,(0,r.Z)({nodeIds:J,loaded:Pe,getChart:we,areChartsIdsEmpty:xe,showNoNodesView:q&&!Se.length,showNoChartsView:je,initializing:$&&(0,w.V)($),chartName:Ce,setChartName:Ze,chartsLoaded:Q&&!!me,invalidationKey:G,flavour:o,chartIds:re?te:fe,widthRef:ue,containerWidth:me,nodesKey:ce,noPreferredNodesError:Ne},W))}))}},72869:function(e,t,n){n.d(t,{Z:function(){return Me}});var r={};n.r(r),n.d(r,{OSTableSchema:function(){return V},agentTableSchema:function(){return z},dashboardsTableSchema:function(){return R},dockerTableSchema:function(){return L},machinesTableSchema:function(){return _}});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)),d=n(93416),s=n(18997),u=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),w=n(39840),E=n(65351),x=n(85287),O=(0,l.memo)((function(e){var t=e.count,n=e.testId;return l.createElement(d.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),Z=n(71893),I=n(85651),j={metrics:(0,Z.css)(["tbody tr{&:nth-child(odd){background:",";}&:nth-child(even){background:",";}}thead tr{background:",";}"],(0,I.getColor)("nodeBadgeBackground"),(0,I.getColor)("panelBg"),(0,I.getColor)("panelBg")),progressBar:(0,Z.css)(["tr{background:",";}"],(0,I.getColor)("panelBg"))},S=(0,Z.default)(d.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})),N=(0,Z.default)(d.Icon).withConfig({displayName:"styled__StyledIcon",componentId:"sc-1kpag36-1"})(["float:right;cursor:pointer;"]),P=[{id:"value",desc:!1}],D=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?P:a;return null!==n&&void 0!==n&&n.length?l.createElement(S,{layout:o,data:n,dataColumns:t,sortBy:i,enableSorting:!0}):l.createElement(d.Flex,{width:"100%"},l.createElement(d.TextSmall,{color:"textLite",alignSelf:"center",margin:[0,"auto"]},"No data"))},T=n(44109),M=n(38626),B=n(32864),F=n(82351),A={name:function(e){return function(e){return{id:"name",accessorKey:"name",header:e,cell:function(e){var t=e.getValue;return l.createElement(M.Z,{text:t(),TextComponent:d.TextSmall})}}}(e)},value:{id:"value",header:"#",accessorKey:"value",cell:function(e){var t=e.getValue;return l.createElement(d.TextSmall,{strong:!0},t())}},goToDashboard:{id:"goToDashboard",accessorKey:"value",header:"",cell:function(e){var t=e.cell,n=e.getValue,r=t.row.original,o=r.name,a=r.path,i=r.state,c=(0,y.s0)(),s=(0,l.useCallback)((function(){(0,b.L)("total-cust-dashboard","click-cust-dasbhoard","hm-page",n()),c("".concat(a,"/").concat(n()))}),[a,n()]);return"notAvailable"==i?l.createElement(F.Z,{content:l.createElement(B.K,{name:o}),align:"bottom",isBasic:!0},l.createElement(d.Flex,{alignItems:"center"},l.createElement(d.Icon,{name:"padlock",height:"12px",color:"text"}))):l.createElement(N,{name:"goToNode",width:"14px",height:"14px",color:"textDescription",onClick:s})}},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,T.e)(c);return l.createElement(d.Flex,{column:!0,gap:1,flex:"grow"},o?l.createElement(d.Flex,{justifyContent:"between",gap:2},l.createElement(d.TextSmall,null,o),l.createElement(d.TextSmall,{strong:!0},n())):null,l.createElement(d.ProgressBar,{color:i,width:s}))}}}},_=[A.name("VM"),A.value],L=[A.name("Containers"),A.value],R=[A.name("Latest Updated"),A.goToDashboard],V=[A.progressBar({header:"OS",dataEntry:"nodesByOS"})],z=[A.progressBar({header:"Agent Version",dataEntry:"nodesByAgentVersion"})],H=(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(d.Flex,{padding:[0,4],height:"100%","data-testid":"".concat(o,"-table-container"),overflow:"hidden"},l.createElement(D,{columns:r[n],data:i,layout:"progressBar"}))}),(function(e,t){return C()(e,t)}));function W(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 U(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var G=[{id:"name",desc:!1}],K=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 U(U({},e),{},{value:e.slug,path:r})}))}({data:n,path:"/spaces/".concat(r,"/rooms/").concat(o,"/dashboards")});return l.createElement(d.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(D,{columns:R,data:a,sortBy:G}))},q=(0,l.memo)(K,(function(e,t){return C()(e,t)})),Q=n(9446),X=(0,Z.default)(d.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"})),Y=(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(d.Flex,{alignItems:"center",justifyContent:"between",width:"100%",gap:4,flex:{grow:1,shrink:0}},l.createElement(d.Flex,{gap:1},l.createElement(d.Flex,{width:"4px",height:"16px",background:r}),l.createElement(X,{whiteSpace:"nowrap",onClick:a},t,a&&l.createElement(d.Icon,{color:"textLite",margin:[0,0,0,1],name:"nav_arrow_goto",height:"10px",width:"10px"}))),l.createElement(d.Text,{strong:!0},null!==n&&void 0!==n?n:"-"))})),J=function(e){var t=e.data;return l.createElement(d.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(Y,{key:"".concat(n,"-").concat(r,"-").concat(t),title:n,value:r,color:o,onClick:a})})))};function $(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 ee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var te=function(e){var t=e.data,n=e.theme;return t.map((function(e){return ee(ee({},e),{},{color:(0,d.getColor)(e.color)({theme:n})})}))},ne=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,u=(0,l.useContext)(Z.ThemeContext);return l.createElement(d.Flex,{gap:4,margin:[0,4],height:{min:"100px",max:"130px"},alignItems:"center"},l.createElement(J,{data:n}),l.createElement(d.Flex,{height:"100px",flex:{grow:1,shrink:1}},s?l.createElement(Q.PieChart,{label:function(){return c},labelStyle:{fontSize:"24px",fontWeight:400,fontFamily:"IBM Plex Sans",lineHeight:" 32px",fill:(0,d.getColor)("textDescription")({theme:u})},labelPosition:0,data:te({data:n,theme:u}),lineWidth:o,animate:i}):l.createElement(d.Icon,{color:"border",name:"pie_chart_skeleton",width:"100px",height:"100px",alignSelf:"center"})))},re=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}))},oe=function(e){var t=e.data,n=t.vm,r=t.docker,o=t.chartData,a=t.hasData,i=re(n),c=re(r);return l.createElement(d.Flex,{justifyContent:"around","data-testid":"nodesByMachine-tables-container",overflow:"hidden"},l.createElement(d.Flex,{flex:{grow:1,shrink:0},basis:"200px"},l.createElement(ne,{chartData:o,hasData:a})),l.createElement(d.Flex,{gap:2,flex:{grow:1,shrink:0},basis:"50%",padding:[0,4,0,2]},l.createElement(D,{columns:_,data:i}),l.createElement(D,{columns:L,data:c})))},ae=(0,l.memo)(oe,(function(e,t){return C()(e,t)}));function ie(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 ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var le=(0,Z.default)(d.Text).withConfig({displayName:"nodesByDataReplication__StyledValue",componentId:"sc-19v6tvl-0"})(["line-height:17px;"]),de=function(e){var t=e.parent,n=e.child,r=t+n,o=(0,T.e)(t/r);return l.createElement(d.Flex,{column:!0,gap:1},l.createElement(d.Flex,{justifyContent:"between","data-testid":"nodesByDataReplication-parent-child"},l.createElement(fe,{name:"Parents",value:t,background:["blue","aquamarine"]}),l.createElement(fe,{name:"Children",value:n,background:["purple","lilac"]})),l.createElement(d.ProgressBar,{background:["purple","lilac"],color:["blue","aquamarine"],width:o}))},se={r_1:{label:"1",color:["blue","indigo"]},r_2:{label:"2",color:["green","limeGreen"]},"r_*":{label:">2",color:["yellow","seaBuckthorn"]}},ue=function(){return l.createElement(d.Flex,{column:!0,gap:1,alignItems:"center",width:"220px","data-testid":"nodesByDataReplication-information-text",overflow:"hidden"},l.createElement(d.TextMicro,{color:"white"},l.createElement(d.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(d.TextMicro,{color:"white"},l.createElement(d.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(d.TextMicro,{color:"white"},l.createElement(d.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(d.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","."))},me=function(e){var t=(0,l.useMemo)((function(){var t=Object.keys(se).reduce((function(t,n,r){var o,a=e[n]||0;return[].concat((0,h.Z)(t),[ce(ce({key:n},se[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(d.Flex,{column:!0,margin:[6,0,0]},l.createElement(d.Flex,{margin:[0,0,2],gap:1},l.createElement(d.TextSmall,null,"Replication factor"),l.createElement(F.Z,{isBasic:!0,plain:!0,content:ue,align:"bottom"},l.createElement(d.Icon,{name:"information",color:"textDescription",size:"small"}))),l.createElement(d.Flex,{justifyContent:"between",margin:[0,0,1],"data-testid":"nodesByDataReplication-replications"},r.map((function(e){return l.createElement(fe,{key:e.key,name:e.label,value:e.value,background:e.color})}))),l.createElement(d.ProgressBar,{background:"nodeBadgeBackground",value:r.map((function(e){return{width:(0,T.e)(e.value/o),color:e.color}}))}))},fe=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(d.Flex,{alignItems:"center"},l.createElement(d.Flex,{width:"4px",height:"16px",background:a,round:3,margin:[0,1,0,0]}),l.createElement(d.TextSmall,{color:"textDescription",margin:[0,3,0,0]},t),l.createElement(le,{color:"textDescription",strong:!0},r))},pe=function(e){var t=e.parentChild,n=e.replication;return l.createElement(d.Flex,{column:!0,margin:[4,4,1],"data-testid":"nodesByDataReplication-container"},l.createElement(de,t),l.createElement(me,n))},ge={dataReplication:function(){return(0,b.L)("nodes-data-replication","click-link-stream-replication","hm-page")}},he=function(){var e=(0,m.A3)(),t=(0,y.s0)(),n=(0,w.yi)(),r=(0,E.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(d.Flex,{column:!0,width:{max:"200px"},gap:2},l.createElement(d.TextMicro,{color:"bright"},l.createElement(d.TextMicro,{color:"bright",strong:!0},"Live:")," ","Node is actual collecting and streaming metrics to Netdata"),l.createElement(d.TextMicro,{color:"bright"},l.createElement(d.TextMicro,{color:"bright",strong:!0},"Stale:")," ","Node is currently offline and not streaming metrics to Netdata. It can show historical data from a parent node"),l.createElement(d.TextMicro,{color:"bright"},l.createElement(d.TextMicro,{color:"bright",strong:!0},"Offline:")," ","Node is currently offline, not streaming metrics to Netdata and not available in any parent nodes"),l.createElement(d.TextMicro,{color:"bright"},l.createElement(d.TextMicro,{color:"bright",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:ne,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:"placeholder",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:ne,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:"attention"},{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:"warning"},{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:ae,selector:function(e){var t,n,r,o,a,i,c,l,d,s,u,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:"attention"},{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!==(d=m.type)&&void 0!==d&&d.unknown?[{title:"Unknown",value:null!==(s=null===m||void 0===m||null===(u=m.type)||void 0===u?void 0:u.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:d.TextMicro,href:"https://learn.netdata.cloud/docs/metrics-storage-management/enable-streaming",target:"_blank",onClick:ge.dataReplication},"streaming and replication")," ","status across your nodes"),basis:"calc(100%/6)",flex:{grow:"1",shrink:"0"},minWidth:"250px",testId:"nodesByDataReplication"},Component:pe,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:H,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:H,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:ne,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:ne,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:q,selector:function(e){var t=e.dashboards;return t&&!t.error?{count:t.dashboards,data:t.lastUpdated,updatedAt:t.updatedAt}:{count:"-",data:[]}}}}},ve=function(e){var t=e.title,n=e.description,r=e.tooltip;return l.createElement(d.Flex,{column:!0,margin:[4,4,3],height:{min:12}},l.createElement(d.Flex,{gap:1,alignItems:"center"},l.createElement(d.Text,{color:"text","data-testid":"metrics-header-title"},t),r&&l.createElement(F.Z,{isBasic:!0,plain:!0,content:r,align:"bottom"},l.createElement(d.Icon,{name:"information",color:"textDescription",size:"small"}))),l.createElement(d.TextMicro,{color:"textDescription","data-testid":"metrics-header-description"},n))},be=(0,l.memo)(ve),ye=n(58504),we=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,we.Z)(t,new Date):""}(t);return(0,ye.Z)((function(){return r(Math.random())}),6e4),l.createElement(d.Flex,{justifyContent:"end",margin:[2,4]},l.createElement(d.TextFemto,{color:"textLite","data-testid":"metrics-footer-last-updated"},"Last updated: ",o||"-"))},xe=n(96104),Oe=n(96929),ke=n(36560),Ce=n(63346),Ze=["basis","title","flex","description","tooltip","minWidth","onClick","testId"];function Ie(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?Ie(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ie(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,xe.fX)({extraKey:"home",merge:!1,scoped:!0});(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,u.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,e])},Ne=[{name:"charts",projections:"points"}],Pe=[{name:"charts",projections:"retention"}],De=[{name:"charts",projections:"metrics"}],Te=[{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(Ne,r),Se(Pe,r),Se(De,r),Se(Te,r);var c=(0,Oe.zN)(),s=(0,Oe.fD)(),u=he();return s?s&&!c.length?l.createElement(Ce.ZP,{feature:"Home",mode:"NoNodesView"},l.createElement(ke.Z,null)):l.createElement(Ce.ZP,{feature:"Home"},l.createElement(d.Flex,{flexWrap:!0,overflow:"auto",padding:[0,0,4,4],"data-testid":"roomHome-layout-container"},Object.keys(u).map((function(e){var t=u[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,Ze),w=t.Component,E=(0,t.selector)(n);return l.createElement(d.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(be,(0,o.Z)({title:c,description:m,tooltip:f},E)),l.createElement(w,(0,o.Z)({testId:e},y,E)),l.createElement(Ee,E))})))):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),d=n(37518),s=n(25819);function u(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?u(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(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,d.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,d.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),d=n(77796),s=n(99322),u=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(d.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,u.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(39915),c=n(68035),l=n(65565),d=n(84147),s=n(4822),u=n(25819),m=n(42448);function f(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 p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(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,f=n.autorun,g=void 0!==f&&f,h=(0,a.useState)(null),v=(0,o.Z)(h,2),b=v[0],y=v[1],w=(0,s.by)(),E=w.after,x=w.before,O=(0,a.useRef)();O.current={after:E<0?E:Math.floor(E/1e3),before:E<0?0:Math.ceil(x/1e3)};var k=function(e){if(e&&null!==e&&void 0!==e&&e.response){var t=e.response.data.errorMsgKey;y(t)}else I((function(e){return p(p({},e),{},{contextsHardHash:"invalid"})})),y(e)},C=(0,a.useMemo)((function(){return(0,m.V)(b)?5e3:65e3}),[b]),Z=(0,a.useRef)(),I=(0,d.w4)(e,!0),j=function(e){var t=e.results,n=e.versions;I((function(e){return p(p({},e),{},{contextsHardHash:"invalid"},n)})),y((!t||!Object.keys(t).length)&&"No data for this period")},S=(0,d.qU)(e).contextsHardHash,N=(0,i.Z)(S,!0);return(0,l.Z)((function(){I((function(e){return p(p({},e),{},{contextsHardHash:"invalidating"})}))}),[t]),(0,c.Z)((function(){return{cache:!1,key:"spaces.".concat(r,".rooms.").concat(e,".charts"),polling:!1,autorun:g||Boolean(r&&e),fetch:function(){return(0,u.Mn)(r,e,t,p({},O.current))},association:{getIds:function(){return(0,d.dA)({roomId:e,merge:Z.current===t})},getError:function(){return(0,d.W2)({id:e,key:"error"})},getLoaded:function(){return(0,d.W2)({id:e,key:"loaded"})},getUpdatedAt:function(){return(0,d.W2)({id:e,key:"updatedAt"})}},getResource:function(t){return(0,d.PP)({id:e,key:t})},getResourcesInitializer:function(){var n=(0,d.Q7)({id:e,merge:Z.current===t,nodeIds:t});return Z.current=t,n},getResourceInitialState:function(e){return p({fullyLoaded:!0},e)},onFail:k,pollingOptions:{pollingInterval:C},onReceive:j,after:E,nodeIds:t,force:!0,skip:!N&&!!S||"invalidating"===N&&!!S}}),[r,e,C,S,E,x]),b}},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(67294)),a=n(4480),i=n(47133),c=n(18997),l=n(74059),d=n(37518),s=n(25819),u=n(5934);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(){var e=(0,l.th)(),t=(0,d.UL)(),n=(0,a._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,u.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",ignorePunctuation:!0})}));o.forEach((function(e){return n((0,i.lz)(e.id),(function(t){return f(f({},t),{},{loaded:!0},e)}))}));var a=o.map((function(e){return e.id}));n((0,u.oq)({id:t,key:"ids"}),a)}}})),r=(0,o.useCallback)((function(){(0,s.j2)(e,t).then(n).catch((function(){}))}),[e,t]);return(0,c.Z)((function(){return{enabled:!!e&&!!t,fetch:function(){return(0,s.j2)(e,t)},onReceive:n}}),[e,t]),r}},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,d=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:d,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",ignorePunctuation:!0})},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)}})),d=(0,c.y3)(e,"loaded"),s=(0,l.gI)("alert:ReadAll");(0,r.Z)((function(){return{enabled:s&&!!e&&d,fetch:function(){return(0,a.Kp)(e)},onFail:n,onReceive:t,pollingOptions:{pollingInterval:15e4}}}),[e,!!d])}},29983:function(e,t,n){var r=n(4480),o=n(68035),a=n(274),i=n(34912),c=n(94666),l=n(1229),d=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,d.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",ignorePunctuation:!0})},getResource:function(e){return(0,i.mX)({id:e})},getResourcesInitializer:function(){return i.Bb},onReceive:t,pollingOptions:{pollingInterval:315e3}}}),[e])}},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}},24281:function(e,t,n){var r=n(29439),o=n(67294),a={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};t.Z=function(){var e=(0,o.useState)(null),t=(0,r.Z)(e,2),n=t[0],i=t[1],c=(0,o.useState)(a),l=(0,r.Z)(c,2),d=l[0],s=l[1],u=(0,o.useMemo)((function(){return new window.ResizeObserver((function(e){if(e[0]){var t=e[0].contentRect,n=t.x,r=t.y,o=t.width,a=t.height,i=t.top,c=t.left,l=t.bottom,d=t.right;s({x:n,y:r,width:o,height:a,top:i,left:c,bottom:l,right:d})}}))}),[]);return(0,o.useLayoutEffect)((function(){if(n)return u.observe(n),function(){u.disconnect()}}),[n]),[i,d]}},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),d=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]),u=(0,o.useMemo)(e,t),m=(0,o.useRef)(!0),f=(0,o.useRef)({timeoutId:null,promise:null}),p=(0,d.Z)(),g=(0,r.Z)(p,2)[1],h=(0,o.useCallback)((function(e){m.current=!1;var t=u.fetch,n=u.onStart,r=void 0===n?i():n,o=u.onFail,c=void 0===o?i():o,d=u.onPollingFail,s=void 0===d?i():d,p=u.onReceive,h=void 0===p?i():p,v=u.onSettle,b=void 0===v?i():v,y=u.onBlurMode,w=void 0===y?i():y,E=u.polling,x=void 0===E||E,O=u.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 w(),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=u.enabled,t=void 0===e||e,n=u.force,r=void 0!==n&&n,o=u.skip;if((!v||r)&&!(void 0!==o&&o))return t?h():void 0}),[v,h]),h.clearRef=f,h}},3975:function(e,t,n){n.d(t,{QF:function(){return l},vq:function(){return d}});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},d=function(){var e=(0,o.UO)().spaceSlug,t=(0,i.$v)();return c(e,i.uk,t),e};t.ZP=function(){return[d(),l()]}}}]);
\ No newline at end of file |