File: //opt/netdata/usr/local/local/share/netdata/web/v3/7823.b0a2db55fa28d142b1eb.chunk.js
try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="414e1033-57b7-443c-8a88-be9c5a1fcea9",e._sentryDebugIdIdentifier="sentry-dbid-414e1033-57b7-443c-8a88-be9c5a1fcea9")}()}catch(e){}!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"429f5763d5247afc6c9cc40929cfac6204d0b42a"}}catch(e){}}(),(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[6026,7823],{549:(e,t,n)=>{n.d(t,{G:()=>_,A:()=>z});var r=n(33185),o=n(63766),i=n(78152),s=(n(98992),n(72577),n(81454),n(37550),n(96540)),l=n(6304),a=n(74891),c=n(83747),d=n(80590),u=n(94404),h=(n(54520),n(3949),n(4719)),x=n(55125),g=n(74848);const m=(0,s.memo)((e=>{let{matchType:t,value:n,sublabel:r,onRemove:i}=e;return(0,g.jsx)(o.Pill,{flavour:"neutral",hollow:!0,children:(0,g.jsxs)(o.Flex,{gap:1,alignItems:"center",children:[(0,g.jsxs)(o.Flex,{column:!0,gap:0,overflow:"hidden",flex:!0,children:[(0,g.jsxs)(o.TextSmall,{strong:!0,truncate:!0,children:[t,": ",n]}),r&&(0,g.jsx)(o.TextMicro,{color:"textLite",truncate:!0,children:r})]}),(0,g.jsx)(o.Icon,{name:"x",size:"small",onClick:i,cursor:"pointer",color:"textLite",_hover:{color:"text"}})]})})}));n(71517),n(11379),n(93777),n(14190),n(12359),n(86097),n(17273),n(27415),n(19929),n(37583),n(55122),n(20230),n(57268),n(79733);var p=n(19186),f=n(87083),j=n(24609),b=n(258),v=n(60602);const y=["labels","dimensions","instances"],w=(e,t,n)=>{const[r,o]=(0,s.useState)(""),i=(0,v.A)(r,300),[l,a]=(0,s.useState)(null),[c,d]=(0,s.useState)(!1),u=(0,p.ID)(),h=(0,j.vt)(),x=(0,f.w7)({extraKey:n,merge:!1,scoped:!0}),g=(0,s.useMemo)((()=>{if(e?.contexts)return e.contexts}),[e]);(0,s.useEffect)((()=>{if(!i.trim())return a(null),void d(!1);d(!0),(0,b.Xx)(u,i,{selectedNodes:x,scopeContexts:g,spaceId:h}).then((e=>{const t=e?.data?.contexts;if(!t)return void a(null);const n={},r={dimensions:new Map},o=new Map,i=new Map,s={dimensions:0,instances:0,labels:0},l=/^\.\.\.\s+(\d+)\s+(values?|instances?|dimensions?)\s+more$/i;Object.entries(t).forEach((e=>{let[t,n]=e;const a=n.title||t;n.dimensions&&n.dimensions.forEach((e=>{const n=e.match(l);n?s.dimensions+=parseInt(n[1],10):(r.dimensions.has(e)||r.dimensions.set(e,[]),r.dimensions.get(e).push({title:a,contextId:t}))})),n.instances&&n.instances.forEach((e=>{const n=e.match(l);if(n)return void(s.instances+=parseInt(n[1],10));const r=e.split("."),i=r[r.length-1];o.has(i)||o.set(i,{contextIds:[],contextToInstance:{},contexts:[]});const c=o.get(i);c.contextIds.push(t),c.contextToInstance[t]=e,c.contexts.push({title:a,contextId:t})})),n.labels&&Object.entries(n.labels).forEach((e=>{let[n,r]=e;if(Array.isArray(r)){i.has(n)||i.set(n,new Map);const e=i.get(n);r.forEach((n=>{const r=n.match(l);r?s.labels+=parseInt(r[1],10):(e.has(n)||e.set(n,[]),e.get(n).push({title:a,contextId:t}))}))}}))})),Object.entries(r).forEach((e=>{let[t,r]=e;(r.size>0||s[t]>0)&&(n[t]=[],r.forEach(((e,r)=>{const o=e.map((e=>e.contextId)),i=e.map((e=>e.title));let s;s=1===e.length?e[0].title:2===e.length?`${e[0].title}, ${e[1].title}`:`${e[0].title}, ${e[1].title} and ${e.length-2} more`,n[t].push({value:r,label:r,sublabel:s,contextIds:o,allContextTitles:i})})),n[t].sort(((e,t)=>e.label.localeCompare(t.label))),s[t]>0&&n[t].push({value:null,label:`+${s[t]} more`,sublabel:"Keep typing to narrow results",contextIds:[],isTruncationNotice:!0}))})),(o.size>0||s.instances>0)&&(n.instances=[],o.forEach(((e,t)=>{const{contextIds:r,contextToInstance:o,contexts:i}=e,s=i.map((e=>e.title));let l;l=1===i.length?i[0].title:2===i.length?`${i[0].title}, ${i[1].title}`:`${i[0].title}, ${i[1].title} and ${i.length-2} more`,n.instances.push({value:t,label:t,sublabel:l,contextIds:r,contextToInstance:o,allContextTitles:s})})),n.instances.sort(((e,t)=>e.label.localeCompare(t.label))),s.instances>0&&n.instances.push({value:null,label:`+${s.instances} more`,sublabel:"Keep typing to narrow results",contextIds:[],isTruncationNotice:!0})),i.size>0&&(n.labels=[],i.forEach(((e,t)=>{const r=[];e.forEach(((e,n)=>{const o=e.map((e=>e.contextId)),i=e.map((e=>e.title));let s;s=1===e.length?e[0].title:2===e.length?`${e[0].title}, ${e[1].title}`:`${e[0].title}, ${e[1].title} and ${e.length-2} more`,r.push({value:`${t}:${n}`,label:n,sublabel:s,contextIds:o,allContextTitles:i})})),r.sort(((e,t)=>e.label.localeCompare(t.label))),n.labels.push({labelKey:t,items:r})})),n.labels.sort(((e,t)=>e.labelKey?t.labelKey?e.labelKey.localeCompare(t.labelKey):-1:1)),s.labels>0&&n.labels.push({labelKey:null,items:[{value:null,label:`+${s.labels} more`,sublabel:"Keep typing to narrow results",contextIds:[],isTruncationNotice:!0}]})),a(n),d(!1)})).catch((e=>{console.error("Context search error:",e),a(null),d(!1)}))}),[i,u,h,x,g]);const m=(0,s.useCallback)(((n,r)=>{t({matchType:n,value:r.value,label:r.label,sublabel:r.sublabel,contextIds:r.contextIds,contextToInstance:r.contextToInstance,menuId:e?.id})}),[t,e?.id]);return{searchValue:r,setSearchValue:o,debouncedSearchValue:i,searchResults:l,isLoading:c,onSelectResult:m}},C=(0,s.memo)((e=>{let{children:t,...n}=e;const r=(0,s.useRef)(null);return(0,s.useEffect)((()=>{const e=r.current;if(!e)return;const t=()=>{const t=e.scrollLeft>0,n=e.scrollLeft+e.clientWidth<e.scrollWidth,r=[];t&&r.push("inset 10px 0 10px -10px rgba(0, 0, 0, 0.2)"),n&&r.push("inset -10px 0 10px -10px rgba(0, 0, 0, 0.2)"),e.style.boxShadow=r.join(", ")};return t(),e.addEventListener("scroll",t),()=>{e.removeEventListener("scroll",t)}}),[]),(0,g.jsx)(o.Flex,{ref:r,overflow:"auto",...n,children:t})}));var I=n(45087);const A=(0,s.memo)((e=>{let{parentIds:t,allFilters:n,onGoToParent:r}=e;const i=(0,s.useMemo)((()=>t?.find((e=>n[e]&&Object.keys(n[e]).length>0))||null),[t,n]),l=(0,h.b)(i);if(!i||!l)return null;const a=l.shortName||l.name||"parent section";return(0,g.jsx)(I.A,{content:`Go to ${a}`,align:"bottom",children:(0,g.jsx)(o.IconButton,{icon:"arrowUp",flavour:"borderless",onClick:()=>r(i),padding:[0],small:!0})})})),k=(0,s.memo)((e=>{let{menuId:t,parentIds:n,activeMenuId:r,onMenuChange:i}=e;const l=((e,t)=>{const n=(0,h.b)(e),r=(0,h.yy)(),o=(t||[]).map((e=>r[e])).filter(Boolean);return(0,s.useMemo)((()=>{const r=[];return o.forEach(((e,n)=>{r.push({label:e.shortName||e.name,value:t[t.length-1-n]})})),n&&r.push({label:n.shortName||n.name,value:e}),r}),[e,t,n,o])})(t,n);return(0,g.jsx)(o.Menu,{value:r,items:l,onChange:i,dropProps:{align:{top:"bottom",left:"left"}},dropdownProps:{width:"200px"},caret:!0,padding:[0],small:!0})})),S=(0,s.memo)((e=>{let{menuId:t,onClose:n,flavour:r,parentIds:i,onGoToParent:l}=e;const[a,d]=(0,s.useState)(t),u=(0,h.b)(a),p=(0,x.X)(),{filters:f,addFilter:j,removeFilter:b,clearFilters:v}=(0,x.w)(u?.contexts,a),{searchValue:S,setSearchValue:T,debouncedSearchValue:M,searchResults:F,isLoading:N,onSelectResult:L}=w(u,j,r),$=(e,t)=>f.some((n=>n.matchType===e&&n.value===t)),D=(e,t)=>{if($(e,t.value)){const n=f.find((n=>n.matchType===e&&n.value===t.value));b(n)}else L(e,t)};return(0,g.jsx)(o.Layer,{onClickOutside:n,onEsc:n,children:(0,g.jsxs)(o.Flex,{column:!0,background:"dropdown",border:!0,round:3,width:{base:"600px",max:"100%"},overflow:"hidden","data-testid":"context-search-modal",children:[(0,g.jsxs)(o.Flex,{padding:[2,3],border:{side:"bottom"},alignItems:"center",justifyContent:"between",children:[(0,g.jsxs)(o.Flex,{alignItems:"center",gap:.5,children:[(0,g.jsx)(o.TextSmall,{children:"Filter chart in"}),i?.length>0?(0,g.jsx)(k,{menuId:t,parentIds:i,activeMenuId:a,onMenuChange:d}):(0,g.jsx)(o.TextSmall,{children:u?.name||"this section"})]}),(0,g.jsxs)(o.Flex,{alignItems:"center",gap:2,children:[l&&(0,g.jsx)(A,{parentIds:i,allFilters:p,onGoToParent:l}),f.length>0&&(0,g.jsx)(o.Button,{label:"Clear All",flavour:"borderless",onClick:v,"data-testid":"context-search-clear-all",padding:[0],small:!0})]})]}),(0,g.jsx)(o.Flex,{padding:[3],column:!0,border:{side:"bottom"},children:(0,g.jsx)(o.TextInput,{value:S,onChange:e=>T(e.target.value),placeholder:"Search dimensions, labels...","data-testid":"context-search-input",autoFocus:!0,iconLeft:(0,g.jsx)(o.Icon,{name:N?"loading":"search",color:"textLite",size:"small"}),width:"100%"})}),(0,g.jsxs)(o.Flex,{column:!0,overflow:"auto",style:{opacity:N?.5:1,filter:N?"blur(2px)":"none",transition:"height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, filter 0.2s ease"},height:null===F?"152px":F&&Object.keys(F).length>0?"400px":"199px",children:[null===F&&(0,g.jsx)(o.Flex,{column:!0,gap:3,padding:[3],flex:!0,children:(0,g.jsxs)(o.Flex,{column:!0,gap:2,children:[(0,g.jsxs)(o.Flex,{alignItems:"center",gap:2,children:[(0,g.jsx)(o.Icon,{name:"search",size:"small",color:"textLite"}),(0,g.jsx)(o.TextSmall,{color:"textLite",children:"Search charts based on dimensions, instances and labels"})]}),(0,g.jsxs)(o.Flex,{alignItems:"center",gap:2,children:[(0,g.jsx)(o.Icon,{name:"filter",size:"small",color:"textLite"}),(0,g.jsxs)(o.TextSmall,{color:"textLite",children:["Results are scoped to ",u?.name||"this section"," charts"]})]})]})}),F&&Object.keys(F).length>0&&(0,g.jsx)(o.Flex,{column:!0,gap:3,padding:[2,0],flex:!0,children:y.map((e=>{const t=F[e];return t&&0!==t.length?(0,g.jsxs)(o.Flex,{column:!0,gap:1,children:[(0,g.jsx)(o.Flex,{padding:[1,3],alignItems:"center",position:"sticky",top:0,background:"dropdown",zIndex:1,children:(0,g.jsx)(o.TextSmall,{strong:!0,color:"textLite",children:e.charAt(0).toUpperCase()+e.slice(1)})}),"labels"===e?(0,g.jsx)(o.Flex,{column:!0,children:t.map(((t,n)=>(0,g.jsxs)(o.Flex,{column:!0,children:[t.labelKey&&(0,g.jsx)(o.Flex,{padding:[1,3],alignItems:"center",position:"sticky",top:"20px",background:"dropdown",zIndex:1,children:(0,g.jsx)(o.TextMicro,{strong:!0,color:"textLite",children:t.labelKey})}),t.items.map(((t,n)=>{const r=!t.isTruncationNotice&&$(e,t.value);return(0,g.jsx)(o.Flex,{padding:[2,3],cursor:t.isTruncationNotice?"default":"pointer",background:r?"neutralHighlight":void 0,_hover:t.isTruncationNotice?{}:{background:"secondaryHighlight"},onClick:t.isTruncationNotice?void 0:()=>D(e,t),opacity:t.isTruncationNotice?.7:1,children:(0,g.jsxs)(o.Flex,{gap:1,alignItems:"center",overflow:"hidden",flex:!0,children:[r&&(0,g.jsx)(o.Icon,{name:"check",size:"small",color:"primary"}),(0,g.jsxs)(o.Flex,{gap:.5,column:!0,overflow:"hidden",flex:!0,children:[(0,g.jsx)(o.TextSmall,{truncate:!0,children:t.label}),t.sublabel&&(0,g.jsx)(g.Fragment,{children:t.allContextTitles&&t.allContextTitles.length>2?(0,g.jsx)(I.A,{content:(0,g.jsxs)(c.A,{column:!0,gap:1,children:[(0,g.jsxs)(o.TextSmall,{strong:!0,children:["Found in ",t.allContextTitles.length," ","contexts:"]}),(0,g.jsx)(o.Flex,{flexWrap:!0,children:t.allContextTitles.map(((e,n)=>(0,g.jsxs)(o.TextSmall,{children:[e,n<t.allContextTitles.length-1?", ":""]},n)))})]}),plain:!0,children:(0,g.jsx)(o.TextMicro,{color:"textLite",children:t.sublabel})}):(0,g.jsx)(o.TextMicro,{color:"textLite",children:t.sublabel})})]})]})},`${e}-${t.value}-${n}`)}))]},n)))}):(0,g.jsx)(o.Flex,{column:!0,children:t.map(((t,n)=>{const r=!t.isTruncationNotice&&$(e,t.value);return(0,g.jsx)(o.Flex,{padding:[2,3],cursor:t.isTruncationNotice?"default":"pointer",background:r?"neutralHighlight":void 0,_hover:t.isTruncationNotice?{}:{background:"secondaryHighlight"},onClick:t.isTruncationNotice?void 0:()=>D(e,t),opacity:t.isTruncationNotice?.7:1,children:(0,g.jsxs)(o.Flex,{gap:1,alignItems:"center",overflow:"hidden",flex:!0,children:[r&&(0,g.jsx)(o.Icon,{name:"check",size:"small",color:"primary"}),(0,g.jsxs)(o.Flex,{gap:.5,column:!0,overflow:"hidden",flex:!0,children:[(0,g.jsx)(o.TextSmall,{truncate:!0,children:t.label}),t.sublabel&&(0,g.jsx)(g.Fragment,{children:t.allContextTitles&&t.allContextTitles.length>2?(0,g.jsx)(I.A,{content:(0,g.jsxs)(c.A,{column:!0,gap:1,children:[(0,g.jsxs)(o.TextSmall,{strong:!0,children:["Found in ",t.allContextTitles.length," contexts:"]}),(0,g.jsx)(o.Flex,{flexWrap:!0,children:t.allContextTitles.map(((e,n)=>(0,g.jsxs)(o.TextSmall,{children:[e,n<t.allContextTitles.length-1?", ":""]},n)))})]}),plain:!0,children:(0,g.jsx)(o.TextMicro,{color:"textLite",truncate:!0,children:t.sublabel})}):(0,g.jsx)(o.TextMicro,{color:"textLite",truncate:!0,children:t.sublabel})})]})]})},`${e}-${t.value}-${n}`)}))})]},e):null}))}),!N&&""!==M.trim()&&null!==F&&0===Object.keys(F).length&&(0,g.jsxs)(o.Flex,{padding:[6,3],justifyContent:"center",alignItems:"center",column:!0,gap:2,flex:!0,children:[(0,g.jsx)(o.Icon,{name:"search",size:"medium",color:"textLite"}),(0,g.jsx)(o.TextSmall,{color:"textLite",children:"No results found"}),(0,g.jsx)(o.TextMicro,{color:"textLite",children:"Try different search terms"})]}),f.length>0&&(0,g.jsxs)(o.Flex,{column:!0,gap:2,padding:[3,3,0],border:{side:"top"},position:"sticky",bottom:0,background:"dropdown",children:[(0,g.jsxs)(o.H5,{children:["Active Filters (",f.length,")"]}),(0,g.jsx)(C,{gap:2,padding:[0,0,3],children:f.map(((e,t)=>(0,g.jsx)(m,{matchType:e.matchType,value:e.label,sublabel:e.sublabel,onRemove:()=>b(e)},`${e.matchType}-${e.value}-${t}`)))})]})]})]})})}));var T=n(33962),M=n(49163),F=n(63928),N=n(95565),L=n(1444);const $=(0,d.A)((0,a.A)(o.Flex)),D=(0,u.A)((0,a.A)(o.IconButton)),B=(0,s.memo)((e=>{let{menuId:t,menuName:n,contexts:r}=e;const{filters:i}=(0,x.w)(r,t);return i&&0!==i.length?(0,g.jsxs)(o.Flex,{column:!0,children:[(0,g.jsxs)(o.TextMicro,{color:"textLite",children:["Filters in ",n," (",i.length,")"]}),(0,g.jsx)(o.Flex,{column:!0,children:i.map((e=>(0,g.jsxs)(o.TextSmall,{children:[e.matchType,": ",(0,g.jsx)(o.Text,{strong:!0,children:e.label})]},`${e.matchType}-${e.label}`)))})]}):null})),P=(0,s.memo)((e=>{let{parentIds:t}=e;return t&&0!==t.length?(0,g.jsx)(o.Flex,{column:!0,gap:1,children:t.map((e=>{const t=(0,h.b)(e);return t?(0,g.jsx)(B,{menuId:e,menuName:t.shortName||t.name||e,contexts:t.contexts},e):null}))}):null})),R=(0,s.memo)((e=>{let{menuId:t,menuName:n,flavour:r,parentIds:i}=e;const a=(0,h.b)(t),d=(0,x.X)(),u=(0,T.Ud)(),[m,,p,f]=(0,l.A)(),j=!!(d[t]&&Object.keys(d[t]).length>0),b=!(!i||!i.some((e=>d[e]&&Object.keys(d[e]).length>0))),v=(0,s.useCallback)((e=>{u(e),f()}),[u,f]),y=(0,s.useMemo)((()=>j||b?(0,g.jsxs)(c.A,{column:!0,gap:2,children:[(0,g.jsx)(B,{menuId:t,menuName:n,contexts:a?.contexts}),(0,g.jsx)(P,{parentIds:i})]}):`Search in ${n}`),[j,b,t,n,a?.contexts,i]);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)($,{position:"relative",tooltip:y,payload:{menuId:t},children:[(0,g.jsx)(o.IconButton,{icon:"filterList",onClick:p,flavour:"borderless",padding:[0],"data-testid":"context-search-button","data-active":j,"data-indeterminate":b,height:"16px",width:"16px"}),b&&(0,g.jsx)(o.Box,{position:"absolute",top:"2px",right:"2px",background:"accentAI",round:"50%",width:"6px",height:"6px"})]}),m&&(0,g.jsx)(S,{menuId:t,onClose:f,flavour:r,parentIds:i,onGoToParent:v})]})})),V={LocalDashboard:"Favourites can be saved when the agent is part of a Netdata cloud space.",DemoSpace:"Favourites cannot be saved on a demo space.",FreePlan:()=>(0,g.jsxs)(o.Flex,{column:!0,gap:1,children:[(0,g.jsx)(o.Text,{children:"Favourites can be saved only on a paid plan."}),(0,g.jsx)(N.A,{children:(0,g.jsx)(o.Text,{color:"primary",children:"Upgrade for no limitations!"})})]}),default:null},O=(0,s.memo)((e=>{let{menuId:t,menuName:n,flavour:r}=e;const[o,,i,a]=(0,l.A)(),c=(0,M._)({params:{type:["favourites"],path:[`/${r}`],entity:t}}),d=c.find((e=>{let{entity:n}=e;return n===t}))?.id,u=!!d,h=(0,F.yK)({onResolve:a}),x=(0,F.z2)(d,{onResolve:a}),{disabled:m,reason:p}=(0,L.A)(),f=(0,s.useCallback)((()=>{m||(i(),u?x():h({type:"favourites",entity:t,path:`/${r}`,value:{menuId:t,sortOrder:Date.now()}}))}),[m,u,x,h,t,r,i]),j=(0,s.useMemo)((()=>({tooltip:m&&p?V[p]||V.default:u?`Remove ${n} from your favourites`:`Add ${n} to your favourites`,disabled:o||m,..."FreePlan"===p?{tooltipProps:{align:"bottom",activateOn:"hover",isBasic:!0,allowHoverOnTooltip:!0}}:{}})),[u,o,n,m,p]);return(0,g.jsx)(D,{icon:u?"heart":"heart_hollow",onClick:f,disabled:o||m,flavour:"borderless",padding:[0],"data-testid":"toggle-favourite-button","data-active":u,payload:{menuId:t},height:"12px",width:"12px",...j})})),E=(0,r.default)(o.Flex).withConfig({displayName:"withMenuActions__StyledWrapper",componentId:"sc-vbh3xj-0"})(["&&& button[data-indeterminate],&&& button[data-active]{",' &[data-indeterminate="true"]{color:',";fill:",";svg,path{fill:",';}}&[data-active="true"]{color:',";fill:",";svg,path{fill:",";}}&:hover{color:",";fill:",";svg,path{fill:",';}}&[data-active="true"]:hover{color:',";fill:",";svg,path{fill:",";}}}"],(e=>`\n color: ${(0,o.getColor)(e.hasCharts?"textNoFocus":["transparent","full"])(e)};\n fill: ${(0,o.getColor)(e.hasCharts?"textNoFocus":["transparent","full"])(e)};\n\n svg,\n path {\n fill: ${(0,o.getColor)(e.hasCharts?"textNoFocus":["transparent","full"])(e)};\n }\n `),(0,o.getColor)("textLite"),(0,o.getColor)("textLite"),(0,o.getColor)("textLite"),(0,o.getColor)("primary"),(0,o.getColor)("primary"),(0,o.getColor)("primary"),(0,o.getColor)("text"),(0,o.getColor)("text"),(0,o.getColor)("text"),(0,o.getColor)("accent"),(0,o.getColor)("accent"),(0,o.getColor)("accent")),_=e=>{let{children:t,menuId:n,menuName:r,flavour:s,parentIds:l,hasCharts:a,hasFilters:c=i.af}=e;return(0,g.jsxs)(E,{alignItems:"center",justifyContent:"between",hasCharts:a,gap:1,children:[t,(0,g.jsxs)(o.Flex,{alignItems:"center",gap:1,children:[c&&(0,g.jsx)(R,{menuId:n,menuName:r,flavour:s,parentIds:l}),(0,g.jsx)(O,{menuId:n,menuName:r,flavour:s})]})]})},z=e=>t=>t.enableFavourites&&t.contexts?.length?(0,g.jsx)(_,{menuId:t._id,menuName:t.name,flavour:t.flavour,parentIds:t.parentIds,hasCharts:!!t.selfChartIds?.length,children:(0,g.jsx)(e,{...t})}):(0,g.jsx)(e,{...t})},4703:(e,t,n)=>{n.d(t,{A:()=>u});var r=n(33185),o=n(63766),i=n(74891),s=n(74848);const l=(0,i.A)(o.IconButton),a=(0,r.default)(l).attrs({icon:"x",neutral:!0,tooltip:"Skip, doesn't apply to me"}).withConfig({displayName:"taskItem__SkipButton",componentId:"sc-1mf27rk-0"})(["opacity:0;transition:opacity 0.2s;"]),c=(0,r.default)(o.Flex).attrs({gap:3,alignItems:"center",padding:[4],border:!0,round:1,cursor:"pointer"}).withConfig({displayName:"taskItem__ChecklistItem",componentId:"sc-1mf27rk-1"})(["background:",";transition:border-color 0.2s,background 0.2s;&:hover{border-color:",";background:",";","{opacity:1;}}"],(e=>{let{completed:t}=e;return(0,o.getColor)(t?"mainBackground":"panelBg")}),(0,o.getColor)("primary"),(0,o.getColor)("mainBackground"),a),d=(0,r.default)(o.Flex).attrs({width:"24px",height:"24px",alignItems:"center",justifyContent:"center",flex:!1}).withConfig({displayName:"taskItem__CheckIcon",componentId:"sc-1mf27rk-2"})(["",""],(e=>{let{completed:t}=e;return!t&&`\n border-radius: 50%;\n border: 2px solid ${(0,o.getColor)("borderSecondary")};\n `})),u=e=>{let{task:t,completed:n,onClick:r,onSkip:i,children:l}=e;return(0,s.jsxs)(c,{completed:n,onClick:r,children:[(0,s.jsx)(d,{completed:n,children:n&&(0,s.jsx)(o.Icon,{name:"check",color:"primary",width:"32px",height:"32px"})}),(0,s.jsxs)(o.Flex,{column:!0,gap:1,flex:!0,children:[(0,s.jsx)(o.Text,{strong:!0,color:n?"textLite":void 0,children:t.title}),(0,s.jsx)(o.TextSmall,{color:n?"textNoFocus":"textLite",children:l||t.description})]}),!n&&i&&(0,s.jsx)(a,{onClick:e=>{e.stopPropagation(),i?.()}})]})}},5020:(e,t,n)=>{n.d(t,{Oq:()=>o,Q:()=>i,bP:()=>s,ml:()=>r});const r=(e,t)=>e.on("sizeChanged",((e,n,r)=>{if(e.getParent()!==t)return;const o=e.getAttribute("id"),i=t.getAttribute("host"),s=`chart_height.${i}/${o}`;localStorage.setItem(s,n);const l=`chart_width.${i}/${o}`;localStorage.setItem(l,r)})),o=(e,t,n)=>{const r=`chart_height.${e.getAttribute("host")}/${t}`,o=localStorage.getItem(r);return o?/px/.test(o)?parseInt(o.replace("px",""),10):parseInt(o,10):n},i=e=>{e?.id&&localStorage.setItem(`chart_layout/${e.id}`,JSON.stringify(e))},s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=localStorage.getItem(`chart_layout/${e}`);try{let e=JSON.parse(r);return e?(e=(e=>{let{i:t,id:n=t,x:r,left:o=r,y:i,top:s=i,w:l,width:a=l,h:c,height:d=c,expanded:u=!1}=e;return{id:n,width:a,height:d,left:o,top:s,expanded:u}})(e),{...n,...t,...e}):{...n,...t}}catch{return{...n,...t}}}},9962:(e,t,n)=>{n.d(t,{I:()=>r});const r=e=>{let{error:t,testPrefix:n,onClick:r,flavour:o,value:i}=e;return{"data-testid":n?`${n}-${o}`:o,flavour:o,...r&&{onClick:r},text:t?"-":`${i}`}}},14963:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(96540),o=n(63766),i=n(50239),s=n(74848);const l=e=>{let{children:t,onClick:n,...l}=e;const a=(0,i.UH)(),c=(0,r.useCallback)((e=>{const{hash:t=""}=e.target;t.startsWith("#menu")&&(e.preventDefault(),a.goToLink(t.substr(1))),n&&n(e)}),[a]);return"string"===typeof t?(0,s.jsx)(o.TextSmall,{color:"textDescription",dangerouslySetInnerHTML:{__html:t},onClick:c,...l}):t||null}},17115:(e,t,n)=>{n.d(t,{Ay:()=>c,Ex:()=>a});var r=n(96540),o=n(24285),i=n(19186),s=n(31246);const l=()=>{const e=(0,o.xd)("onboardingFormData"),t=(0,i.XA)("memberCount")||0,n=(0,i.XA)("nodeCount")||0;return(0,r.useMemo)((()=>{const r=e?.usageType;return"Personal (homelab)"===r?s.JF.homelabber:"Work"===r?t>2||n>=50?s.JF.largeOrg:s.JF.smallOrg:s.JF.homelabber}),[e?.usageType,t,n])},a=()=>{const e=l(),t=(0,i.XA)("memberCount")||0;return e===s.JF.largeOrg&&t>10},c=l},17178:(e,t,n)=>{n.d(t,{A:()=>p});var r=n(96540),o=n(88934),i=n(19186),s=n(24609),l=n(93335),a=n(41716),c=n(93883),d=n(93912),u=n(74848);const h=()=>{const e=(0,a.s)("error"),t=(0,a.s)("updatedAt");return(0,u.jsx)(d.A,{title:"Alerts & Notifications",description:"View raised and configured alerts across your infrastructure.",children:(0,u.jsx)(c.A,{error:e,updatedAt:t})})};var x=n(99728),g=n(39175),m=n(77234);const p=()=>{const e=(0,i.r9)(),t=(0,o.RQ)("/spaces/:spaceSlug/rooms/:roomSlug/insights/report-preview/:reportId"),n=(0,x.JT)("dashboard:ReadAll"),a=(e=>{let{path:t,matchReportPreview:n}=e;return(0,r.useMemo)((()=>({[m.x.home]:{id:"home",title:"Home",icon:"room_home",path:`${t}/home`,exact:!0,dataGa:"view-picker::click-view-home::global-view",testId:"viewPicker-home",tooltip:{title:"Summary",description:"An overview of your infrastructure."}},[m.x.overview]:{id:"overview",title:"Metrics",icon:"room_overview",path:`${t}/overview`,exact:!0,dataGa:"view-picker::click-view-overview::global-view",testId:"viewPicker-overview",tooltip:{title:"Metrics Explorer",description:"All metrics from all nodes, containers, VMs, SNMP devices, applications, and synthetic checks, in one universal, aggregated, infrastructure-level dashboard."}},[m.x.nodes]:{id:"nodes",title:"Nodes",icon:"nodes_hollow",path:`${t}/nodes`,exact:!0,dataGa:"view-picker::click-view-nodes::global-view",testId:"viewPicker-nodes",tooltip:{title:"Nodes Explorer",description:"All your infrastructure nodes."}},...!window.envSettings.isAgent&&!window.envSettings.onprem&&{[m.x.k8s]:{id:"k8s",title:"K8s",icon:"serviceKubernetes",path:`${t}/kubernetes`,exact:!0,dataGa:"view-picker::click-view-kubernetes::global-view",testId:"viewPicker-kubernetes",tooltip:{title:"Kubernetes Explorer",description:"All Kubernetes clusters, pods, containers and workloads."}}},[m.x.top]:{id:"top",title:"Top",icon:"top",path:`${t}/top`,exact:!0,dataGa:"view-picker::click-view-fn::global-overview",testId:"viewPicker-fn",tooltip:{title:"Top Consumers",description:"Explore top consumers, including processes, containers, services, network connections, and more."}},[m.x.logs]:{id:"logs",title:"Logs",icon:"logs",path:`${t}/logs`,exact:!0,dataGa:"view-picker::click-view-logs::global-overview",testId:"viewPicker-logs",tooltip:{title:"Logs Explorer",description:"Search, filter, and analyze system and application logs."}},[m.x.dashboards]:{id:"dashboards",title:"Dashboards",icon:"dashboard",path:`${t}/dashboards`,exact:!0,dataGa:"view-picker::click-view-dashboard::global-view",testId:"viewPicker-customDashboards",tooltip:{title:"Custom Dashboards",description:"Create, and manage personalized dashboards tailored to your needs."},droppable:!0,droppableProps:{dropArea:!0,dropinDashboards:!0}},[m.x.dashboard]:{id:"dashboard",title:"Dashboard",icon:"dashboard",path:`${t}/dashboard`,exact:!0,dataGa:"view-picker::click-view-dashboard::global-view",testId:"viewPicker-customDashboard",tooltip:{title:"Custom Dashboard",description:"Edit a personalized dashboard tailored to your needs."},droppable:!0,droppableProps:{dropArea:!0,dashboardId:g.LA}},[m.x.alerts]:{id:"alerts",title:"Alerts",icon:"alarm",path:`${t}/alerts`,exact:!0,dataGa:"view-picker::click-view-alerts::global-view",testId:"viewPicker-alerts",tooltip:(0,u.jsx)(h,{}),children:(0,u.jsx)(l.W,{})},[m.x.ar]:{id:"ar",title:"Anomalies",icon:"anomaliesLens",path:`${t}/anomalies`,exact:!0,dataGa:"view-picker::click-view-anomalies::global-view",testId:"viewPicker-anomalies",tooltip:{title:"Anomaly Advisor",description:"Machine-learning powered root cause analysis, blast radius detection, and cascading effect tracing across nodes."}},[m.x.events]:{id:"events",title:"Events",icon:"feed",path:`${t}/events`,exact:!0,dataGa:"view-picker::click-view-feed::global-view",testId:"viewPicker-feed",tooltip:{title:"Activity Feed",description:"Alert transitions and notifications, node connections and disconnections, administrative events."}},[m.x.insights]:{id:"insights",title:"AI Insights",icon:"ai",path:`${t}/insights`,exact:!n,dataGa:"view-picker::click-view-insights::global-view",testId:"viewPicker-insights",tooltip:{title:"AI Insights and Reports",description:"Automatically investigate, troubleshoot and generate deep dive infrastructure analysis reports using Netdata AI."},iconColor:"primaryAI"}})),[t,n])})({path:e,matchReportPreview:t}),c=(0,s.dg)(),d=(0,i.GJ)();var p,f;return[(0,r.useMemo)((()=>[!c&&!d&&a.home,a.nodes,a.overview,a.top,a.logs,!c&&!window.envSettings.onprem&&a.k8s,!c&&n&&a.dashboards,c&&n&&a.dashboard,a.alerts,a.events,a.ar,a.insights].filter(Boolean)),[e,t,c]),(p=e,f=!c,(0,r.useMemo)((()=>({[`${p}/overview`]:!0,[`${p}/home`]:!0,[`${p}/nodes`]:!0,[`${p}/dashboards`]:!0,[`${p}/dashboard`]:!0,[`${p}/alerts`]:!0,[`${p}/anomalies`]:!0,[`${p}/top`]:!0,[`${p}/logs`]:!0,[`${p}/events`]:!0,[`${p}/insights`]:!0})),[p,f]))]}},27024:(e,t,n)=>{n.d(t,{A:()=>T});var r=n(96540),o=n(63766),i=n(31141),s=n(32788),l=n(29263),a=n(47410),c=n(16866),d=n(24609),u=n(19371),h=n(41579),x=n(19186),g=n(67294),m=n(5907),p=n(92726),f=n(62718),j=n(93536),b=n(38757),v=n(6304),y=n(50433),w=n(45706),C=n(28864),I=n(52795),A=n(74848);const k=(0,r.memo)((e=>{let{id:t,spaceId:n,roomId:i,chartId:s,name:l}=e;const[a,,c,h]=(0,v.A)(),{fullyLoaded:g,processing:f}=(0,p.fz)(t),j=(0,C.DH)(t,{onSuccess:()=>{(0,y.jE)(`Chart added to ${l}`),h()}}),b=a&&g,k=(0,d.ns)(n,"slug"),S=(0,x.wz)(i,"slug"),T=(0,m.nM)(t),M=(0,w.A)(a&&t,{spaceId:n,spaceSlug:k,roomId:i,roomSlug:S}),F=(0,u.eg)();(0,r.useEffect)((()=>{if(M||!b)return;const e=F.getNode({id:s}),t=(0,I.h)(e.getAttributes());T(t.contextScope,t,(()=>setTimeout(j,100)))}),[b,M]);const N=a&&(f||M);return(0,A.jsx)(o.Button,{icon:"plus",onClick:c,isLoading:N,disabled:N,alignSelf:"end"})})),S=e=>{let{spaceId:t,roomId:n,chartId:r}=e;return[{id:"name",accessorKey:"name",header:"Dashboards",cell:e=>{let{getValue:t}=e;return(0,A.jsxs)(o.Flex,{alignItems:"center",gap:3,children:[(0,A.jsx)(o.Icon,{name:"dashboards",size:"small",color:"text"}),(0,A.jsx)(o.Text,{children:t()})]})}},{id:"plusButton",accessorKey:"id",header:"",cell:e=>{let{getValue:o,row:i}=e;return(0,A.jsx)(k,{id:o(),spaceId:t,roomId:n,chartId:r,name:i.original.name})}}]},T=e=>{let{onClose:t}=e;(0,h.A)();const n=(0,x.ID)(),v=(0,x.XA)("name"),y=(0,d.vt)(),{params:w={},params:{chartId:C}}=(0,i.A)("addToDashboardModal"),I=(0,g.q)(),k=(0,p.Sf)(I),[T,M]=(0,r.useState)(""),[F,N]=(0,r.useState)(!1),L=T.length>0,$=(0,m.W6)(y,n,{onSuccess:t}),D=(0,u.eg)().getNode({id:C}),B=(0,r.useMemo)((()=>S({spaceId:y,roomId:n,chartId:C})),[y,n,C]),P=()=>{if(!D)return;const{aggregationMethod:e,selectedDimensions:t,groupBy:n,groupByLabel:r,groupingMethod:o,chartType:i,selectedLabels:s,nodesScope:l,selectedInstances:a,selectedNodes:c,contextScope:d}=D.getAttributes(),[u]=d;$(T,d,{...(0,j.L)(u),aggregationMethod:e,selectedDimensions:t,groupBy:n,groupByLabel:r,groupingMethod:o,chartType:i,selectedLabels:s,nodesScope:l,selectedInstances:a,selectedNodes:c})},R=(0,g.RQ)();return(0,A.jsxs)(s.GO,{onClose:t,children:[(0,A.jsx)(l.z,{onClose:t,title:"Add to Dashboard"}),(0,A.jsx)(a.U,{children:"Select Dashboard"}),(0,A.jsxs)(s.Yv,{gap:3,overflow:"hidden",height:"100%",children:[(0,A.jsxs)(o.H6,{children:["Add chart to one or more dashboards from the ",v]}),R?(0,A.jsx)(o.Table,{dataColumns:B,data:k}):(0,A.jsx)(f.UG,{rows:3}),(0,A.jsxs)(o.Flex,{column:!0,padding:[3,0],gap:1,children:[(0,A.jsxs)(o.H6,{children:["Create a new dashboard and add ",C," to it"]}),(0,A.jsx)(b.A,{value:T,label:"Name",onChange:e=>M(e.target.value),isValid:F,setIsValid:N,isDirty:L,instantFeedback:"all",onKeyDown:e=>e.keyCode===c.I7&&F&&P}),(0,A.jsx)(o.Button,{label:"Create & add",onClick:P,disabled:!D||!T})]})]})]})}},27496:(e,t,n)=>{n.d(t,{n:()=>s});var r=n(14963),o=n(4719),i=n(74848);const s=(0,o.aV)((e=>e.children?(0,i.jsx)(r.A,{as:"p",role:"document",...e}):null),(e=>{let{info:t}=e;return{children:t}}))},30571:(e,t,n)=>{n.r(t),n.d(t,{SettingsContainer:()=>Wc,default:()=>qc});var r=n(96540),o=n(39175),i=n(7960),s=n(19707),l=n(72060),a=n(55164),c=n(63474),d=n(62718),u=n(37617),h=n(1174),x=n(92318),g=n(99728),m=n(99094),p=(n(98992),n(54520),n(72577),n(81454),n(8872),n(25509),n(65223),n(60321),n(41927),n(11632),n(64377),n(66771),n(12516),n(68931),n(52514),n(35694),n(52774),n(49536),n(21926),n(94483),n(16215),n(30569)),f=n(88934),j=n(91539),b=n(24609),v=n(19186),y=n(18739),w=n(58247),C=n(16922),I=n(81685),A=n(22068),k=n(55048),S=n(63872),T=n(44245),M=n(77234),F=n(95428);const N=()=>document.querySelectorAll(`[data-testid='${F.Q}']`).length;var L=n(4204);const $=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),{refresh:n}=(0,y.JN)(),o=(0,g.JT)("insights:ReadReport"),[i,s]=(0,A.A)(),[l,a]=(0,k.A)(),[c,d]=(0,S.A)(),{pathname:u}=(0,f.zy)(),h=u.includes(M.x.insights)&&!u.includes(m.p9),[,,,x]=(0,I.W5)(),[,F]=(0,T.m0)({tabId:M.x.insights}),[$]=(0,I.ly)(),D=(0,p.yF)((0,r.useCallback)(((r,o,u)=>{let{data:g}=u;const p=g?.reports||[],f=i(),j=l(),b=p.filter((e=>{let{status:t,isScheduled:n}=e;return!n&&!m.bs.includes(t)})).map((e=>{let{id:t}=e;return t})),v=f.filter((e=>b.includes(e))),y=v.filter((e=>!j.includes(e))),{COMPLETED:w,FAILED:I}=function(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((t,n)=>{const r=e.find((e=>e.id===n));return r?{...t,[r.status]:[...t[r.status]||[],r.id]}:t}),{COMPLETED:[],FAILED:[]})}(y,p);if(y.length&&(w.length&&c({header:"New report",text:"A new report has been generated!"}),I.length&&(s(f.filter((e=>!I.includes(e)))),d({header:"Error",text:"Failed to generate report."})),a(Array.from(new Set([...j,...y.filter((e=>!I.includes(e)))]))),(w.length||I.length)&&(x(),n()),!h&&w.length+I.length>0)){const e=w.length>0?"success":"error";F({color:e})}o((0,C.Tj)({spaceId:e,roomId:t}),(e=>({...e,loaded:!0,reports:p.map((e=>({...e,isUnread:v.includes(e.id)})))})))}),[e,t,i,s,l,a,x,n,c,d,h,F])),B=(0,p.yF)((0,r.useCallback)(((n,r,o)=>{r((0,C.Tj)({spaceId:e,roomId:t}),(e=>({...e,loaded:!0,error:o?.response?.data||"Something went wrong"})))}),[e,t]));return(0,j.A)((()=>({enabled:!L.ei&&o&&!!e&&!!t,force:!0,polling:!!$.length,fetch:()=>(e=>{let{spaceId:t,roomId:n}=e;const r=(0,w.eF)({spaceId:t,roomId:n}),o=(0,w.XN)({spaceId:t,roomId:n});return Promise.all([r,o]).then((e=>{let[t,n]=e;const r=[...t?.data?.reports||[],...(n?.data||[]).map((e=>({...e,isScheduled:!0})))];return Promise.resolve({data:{reports:r}})}))})({spaceId:e,roomId:t}),onFail:B,onReceive:D,pollingOptions:{pollingInterval:h?5e3:15e3,checkPauseCondition:N}})),[e,t,h,o,$.length])};var D=n(83268),B=n(37479),P=n(60908),R=n(85660),V=n(88255),O=n(50271),E=n(24013),_=n(87083),z=n(49435),H=n(42790),K=n(34843),W=n(52035),G=n(84929);const q={filteredNodesIds:[],filteredNodesCount:0,nodesCount:0},U=(0,G.Iz)((()=>(0,W.eU)(q))),J=()=>{const e=(0,v.ID)();return(0,K.md)(U(e))},X=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView";const t=(0,v.ID)();return(0,H.rW)("tocSearch",{key:t,extraKey:e,defaultValue:"",flavour:"val"})},Y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;if(null===e)return 0;if("string"===typeof e){const n=t(e);return n>0?n:0}if(Array.isArray(e)){let n=0;for(const r of e){const e=Y(r,t);e>n&&(n=e)}return n}if("object"===typeof e){let n=0;for(const r in e){const o=Y(e[r],t);o>n&&(n=o)}return n}return 0},Z=["version","labels","hw","os","state","nodeStatus","health","replicationFactor","replication","technology"],Q=function(e,t){let{shouldHide:n=()=>!1,cacheKey:o,extraKey:i="nodesView"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=(0,E.Gt)(e),l=function(){const e=X(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView");return"string"!==typeof e?"":e.trim().toLowerCase()}(i),[a,c,d]=(0,r.useMemo)((()=>{let e=0,t=0;const r=s.filter((e=>!n(e)));t=r.length;const o=r.map((t=>{let n=0,r=0,o=0;if(l){const{name:e,...i}=t;r=t.name?(0,z.pe)(e,l):0,o=Y(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Z.reduce(((t,n)=>(void 0!==e[n]&&null!==e[n]&&(t[n]=e[n]),t)),{})}(i),(e=>(0,z.pe)(String(e),l,{scoreFactor:.6,minScore:.6})));n=("Live"===t.nodeStatus?100:"Stale"===t.nodeStatus?50:0)+10*r+o}const i=!!l&&!(r>.3||o>.3);return i||(e+=1),{id:t.id,searchScore:n,included:!i}})).filter((e=>e.included));return[o,t,e]}),[l,s,o]),u=(()=>{const e=(0,v.ID)();return(0,K.Xr)(U(e))})(),h=(0,r.useMemo)((()=>a.map((e=>{let{id:t}=e;return t}))),[a]),x=(0,r.useMemo)((()=>a.reduce(((e,t)=>{let{id:n,searchScore:r}=t;return r>0&&(e[n]=r),e}),{})),[a]);return(0,r.useEffect)((()=>{u({filteredNodeIds:h,filteredNodesCount:d,nodesCount:c})}),[h,c,d,t]),[h,x,c]};var ee=n(87733),te=n(18907),ne=n(76621),re=n(63766),oe=n(41514),ie=n(68531),se=n(74848);const le=e=>{let{extraKey:t}=e;const[n,o]=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView";const t=(0,v.ID)();return(0,H.N9)("tocSearch",{key:t,extraKey:e,defaultValue:"",flavour:"val"})}(t),[i,s]=(0,r.useState)(n||"");return(0,ie.A)((()=>{o(i),(0,oe.H)("toc-search","search-automatic-trigger","nodes-view",i)}),300,[i]),(0,r.useEffect)((()=>{n!==i&&s(n)}),[n]),(0,se.jsx)(re.TextInput,{iconLeft:(0,se.jsx)(re.Icon,{name:"search",color:i?"textFocus":"textLite",width:"14px",height:"14px"}),iconRight:!!i&&(0,se.jsx)(re.IconButton,{icon:"x",iconColor:i?"textFocus":"textLite",width:"14px",height:"14px",onClick:()=>{s(""),(0,oe.H)("toc-search","clear-search-button","nodes-view")},padding:[0],neutral:!0,"data-testid":"filterNodesInput-clearButton"}),value:i,onChange:e=>s(e.target.value),size:"small",placeholder:"Search nodes",name:"Search nodes","data-testid":"filterNodesInput",containerStyles:{width:"100%"}})};var ae=n(73700);const ce=(0,ae.s)(300,((e,t)=>(0,oe.H)("toc-search","search-results","nodes-view",e,`${t} -- nodes`))),de=()=>{const e=X(),{filteredNodesCount:t,nodesCount:n}=J();return(0,r.useEffect)((()=>{e&&ce(e,t)}),[e,t]),(0,se.jsx)(se.Fragment,{children:(0,se.jsxs)(re.TextMicro,{alignSelf:"end",color:"textLite",margin:[1,0,0],"data-testid":"numberOfNodesIndication",children:["Showing"," ",(0,se.jsx)(re.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfNodesIndication-filteredNodesCount",children:t})," ","of total"," ",(0,se.jsx)(re.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfNodesIndication-nodesCount",children:n})," ","nodes"]})})},ue=()=>{const{filteredNodesCount:e}=J();return e?null:(0,se.jsxs)(re.Flex,{width:"100%",gap:1,margin:[4,0,0],padding:[2],alignItems:"center","data-testid":"noResultsWereFound",children:[(0,se.jsx)(re.Icon,{name:"information",color:"textDescription"}),(0,se.jsx)(re.TextMicro,{strong:!0,color:"textDescription",children:"No results were found"})]})},he=e=>{let{extraKey:t}=e;return(0,se.jsxs)(re.Flex,{column:!0,alignItems:"center",children:[(0,se.jsx)(le,{extraKey:t}),(0,se.jsx)(de,{}),(0,se.jsx)(ue,{})]})};var xe=n(79748);const ge=()=>(0,se.jsxs)(re.Flex,{padding:[6],round:1,width:"600px",background:"modalInfoBackground",children:[(0,se.jsx)(re.Box,{margin:[0,4,0,0],children:(0,se.jsx)(re.Box,{as:re.Icon,width:10,height:10,name:"nodes_update"})}),(0,se.jsxs)(re.Flex,{column:!0,gap:2,children:[(0,se.jsx)(re.Text,{strong:!0,children:"Couldn't find the node you were looking for? "}),(0,se.jsxs)(re.Text,{color:"textDescription",children:["Netdata can be used to monitor all kinds of infrastructure, from tiny stand-alone IoT devices to complex hybrid setups combining on-premise and cloud infrastructure, mixing bare-metal servers, virtual machines and containers. Check our"," ",(0,se.jsx)(xe.A,{href:"https://learn.netdata.cloud/docs/deployment-guides",target:"_blank","data-ga":"node-area::click-link-collectors::nodes-view",children:"deployments guides"})," ","and start monitor your infrastructure."]})]})]}),me=e=>{let{children:t}=e;return(0,se.jsxs)(re.Flex,{column:!0,flex:!0,justifyContent:"center",alignItems:"center",alignSelf:"center",children:[(0,se.jsxs)(re.Flex,{column:!0,justifyContent:"center",alignItems:"center",width:"300px",margin:[0,0,6],children:[(0,se.jsx)(re.H3,{margin:[0,0,4],children:"No nodes to display"}),(0,se.jsx)(re.Text,{color:"textDescription",textAlign:"center",children:"Double-check your search or filters and dates and try again with different conditions."})]}),t,(0,se.jsx)(ge,{})]})};var pe=n(6304),fe=n(63589),je=n(89590),be=n(32788),ve=n(29263),ye=n(47410),we=n(32052),Ce=n(22871),Ie=n(25291),Ae=n(53749);const ke=()=>{},Se=e=>{let{roomId:t,id:n,onRemove:r=ke}=e;const o=(0,v.wz)(t,"name"),i=(0,Ce.e6)(t,n,"title"),s=(0,Ce.gV)(t),[l,,a,c]=(0,pe.A)();return(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(re.Button,{danger:!0,flavour:"hollow",onClick:a,label:"Delete metric","data-testid":"remove-metric"}),l&&(0,se.jsx)(re.ConfirmationDialog,{"data-ga":"remove-metric-dialog","data-testid":"removeMetricDialog",handleConfirm:async()=>{await s(n),r()},handleDecline:c,message:(0,se.jsxs)(se.Fragment,{children:["You are about to remove ",(0,se.jsx)("strong",{children:i})," metric.",(0,se.jsx)("br",{}),"Are you sure you want to continue?"]}),title:`Remove metric from ${o}`})]})},Te=e=>{let{link:t,children:n}=e;return(0,se.jsxs)(re.Flex,{as:"a",target:"_blank",href:t,gap:1,alignItems:"end",children:[(0,se.jsx)(re.TextNano,{textDecoration:"undeline",children:n}),(0,se.jsx)(re.Icon,{color:"text",name:"question",width:"16px",height:"16px"})]})},Me=e=>{let{title:t,help:n,link:r,disclaimer:o,children:i,...s}=e;return(0,se.jsxs)(re.Flex,{gap:1,column:!0,...s,children:[(0,se.jsxs)(re.Flex,{justifyContent:"between",alignItems:"baseline",children:[(0,se.jsx)(re.Text,{as:"label",margin:[0],children:t}),n&&(0,se.jsx)(Te,{link:r,children:n})]}),i,o&&(0,se.jsx)(re.TextSmall,{children:o})]})};var Fe=n(91130),Ne=n(16866);const Le=e=>{let{dimensions:t}=e;return{dimensions:t.map((e=>{let{name:t}=e;return{value:t,label:t}}))}},$e=e=>{let{isNew:t}=e;return(0,se.jsxs)(re.Flex,{as:"span",gap:1,children:["Manage room",(0,se.jsx)(re.TextBig,{color:"textLite",children:"/"}),(0,se.jsxs)(re.TextBig,{color:"textLite",children:[t?"Add":"Edit"," Metric"]})]})},De=[{value:"value",label:"Value"},{value:"progressBar",label:"Progress Bar"}],Be=[{value:"sum",label:"Sum"},{value:"avg",label:"Average"},{value:"min",label:"Minimum"},{value:"max",label:"Maximum"}],Pe=[{value:"left",label:"Left"},{value:"center",label:"Center"},{value:"right",label:"Right"}],Re=e=>{let{spaceId:t,roomId:n,id:o,onClose:i,tabId:s,...l}=e;const a="new"===o,c=(0,Ce.uB)(n,o),d=(0,Ce.e6)(n,o),[u,h]=(0,r.useState)(d),{title:x,context:g,dimensions:m=[],totalDimensions:p=[],calculateTotal:f=!1,columnFlavour:j="value",aggregation:b="sum",fractionDigits:v=1,hideUnits:y=!1,align:w="center"}=u;(0,r.useEffect)((()=>{a&&c()}),[]);const C=(0,_.w7)({extraKey:"nodesView",merge:!1,scoped:!0}),I=(0,Ie.A)(n,C,{spaceId:t});if(I)throw I;const A=(0,Ae.OL)(n),k=(0,r.useMemo)((()=>A.map((e=>({value:e,label:e})))),[A]),S=(0,Ae._0)(n),T=(0,r.useMemo)((()=>g&&{value:g,label:g}),[g]),[{dimensions:M},F]=(0,we.A)((()=>({enabled:!!g,fetch:()=>((e,t,n)=>Fe.A.get(`${Ne.P8}/spaces/${e}/rooms/${t}/contexts/${encodeURIComponent(n)}`,{transform:Le}))(t,n,g),initialValue:{dimensions:[]}})),[t,n,g]),N=(0,r.useCallback)((e=>{let{value:t}=e;h((e=>({...e,context:t,dimensions:[],title:t})))}),[]),L=(0,r.useMemo)((()=>M?0===m.length?[]:m.map((e=>({value:e,label:e}))):[]),[m,M]),$=(0,r.useMemo)((()=>M?0===p.length?[]:p.map((e=>({value:e,label:e}))):[]),[p,M]),D=(0,r.useCallback)((e=>{F||h((t=>({...t,dimensions:e.map((e=>{let{label:t}=e;return t}))})))}),[F]),B=(0,Ce.tQ)(n),P=(0,r.useCallback)((()=>B({...u,id:o,type:s}).then(i)),[u,o,s,i,B]),R=(0,r.useCallback)((e=>{let{target:{value:t}}=e;t.length<=30&&h((e=>({...e,title:t,header:t,headerString:t})))}),[]),V=(0,r.useCallback)((e=>{F||h((t=>({...t,totalDimensions:e.map((e=>{let{label:t}=e;return t}))})))}),[F]),O=(0,r.useCallback)((e=>{let{value:t}=e;h((e=>({...e,columnFlavour:t,calculateTotal:"value"!==t&&e.calculateTotal})))}),[]),E=(0,r.useCallback)((e=>{let{value:t}=e;h((e=>({...e,aggregation:t})))}),[]),z=(0,r.useCallback)((e=>{let{value:t}=e;h((e=>({...e,align:t})))}),[]),H=(0,r.useCallback)((e=>{let{target:{value:t}}=e;const n=parseInt(t,10);!isNaN(n)&&n>=0&&n<=3&&h((e=>({...e,fractionDigits:n})))}),[]),K=(0,r.useCallback)((e=>{let{target:{checked:t}}=e;h((e=>({...e,hideUnits:t})))}),[]),W=(0,r.useCallback)((e=>{let{target:{checked:t}}=e;h((e=>({...e,calculateTotal:t,totalDimensions:t?e.totalDimensions:[]})))}),[]),G=!x||!g;return(0,se.jsxs)(be.GO,{onClose:i,...l,children:[(0,se.jsx)(ve.z,{onClose:i,title:(0,se.jsx)($e,{isNew:a}),children:(0,se.jsx)(re.Button,{label:"Save",onClick:P,disabled:G})}),(0,se.jsx)(ye.U,{children:a?"Add a new metric (column)":"Edit metric"}),(0,se.jsx)(be.Yv,{children:(0,se.jsxs)(re.Flex,{gap:6,column:!0,children:[(0,se.jsx)(Me,{title:"Context",help:"What is a context?",link:"https://learn.netdata.cloud/docs/dashboards-and-charts/netdata-charts#contexts","data-testid":"manageMetrics-context",children:(0,se.jsx)(re.Select,{options:k,value:T,onChange:N,isLoading:!S,"data-testid":"manageMetrics-contextSelect"})}),(0,se.jsx)(Me,{title:"Metric Title","data-testid":"manageMetrics-title",children:(0,se.jsx)(re.TextInput,{name:"title",placeholder:"Type name",value:x,onChange:R})}),(0,se.jsx)(Me,{title:"Dimensions",help:"What is a dimension?",link:"https://learn.netdata.cloud/docs/dashboards-and-charts/netdata-charts#dimensions",disclaimer:"Dimensions to use for value calculation. Leave blank to use all available dimensions.","data-testid":"manageMetrics-dimensions",children:(0,se.jsx)(re.Select,{isMulti:!0,options:M,value:L,onChange:D,isLoading:F,isDisabled:!T,"data-testid":"manageMetrics-dimensionSelect"})}),(0,se.jsx)(Me,{title:"Display Type","data-testid":"manageMetrics-columnFlavour",children:(0,se.jsx)(re.Select,{options:De,value:{value:j,label:"value"===j?"Value":"Progress Bar"},onChange:O,"data-testid":"manageMetrics-columnFlavourSelect"})}),(0,se.jsx)(re.Toggle,{labelRight:"Calculate as percentage of total",checked:f,onChange:W,"data-testid":"manageMetrics-calculateTotalToggle",colored:!0}),f&&(0,se.jsx)(Me,{title:"Total Dimensions",disclaimer:"Dimensions to use for total calculation. Leave blank to use all available dimensions.","data-testid":"manageMetrics-totalDimensions",children:(0,se.jsx)(re.Select,{isMulti:!0,options:M,value:$,onChange:V,isLoading:F,isDisabled:!T,"data-testid":"manageMetrics-totalDimensionSelect"})}),(0,se.jsx)(Me,{title:"Aggregation","data-testid":"manageMetrics-aggregation",children:(0,se.jsx)(re.Select,{options:Be,value:(0,r.useMemo)((()=>Be.find((e=>e.value===(b||"sum")))),[b]),onChange:E,"data-testid":"manageMetrics-aggregationSelect"})}),(0,se.jsx)(Me,{title:"Decimal Places","data-testid":"manageMetrics-fractionDigits",children:(0,se.jsx)(re.TextInput,{type:"number",name:"fractionDigits",min:"0",max:"3",value:v,onChange:H})}),(0,se.jsx)(Me,{title:"Hide Units","data-testid":"manageMetrics-hideUnits",children:(0,se.jsx)(re.Toggle,{checked:y,onChange:K,"data-testid":"manageMetrics-hideUnitsToggle"})}),(0,se.jsx)(Me,{title:"Text Alignment","data-testid":"manageMetrics-align",children:(0,se.jsx)(re.Select,{options:Pe,value:{value:w,label:Pe.find((e=>e.value===w))?.label},onChange:z,"data-testid":"manageMetrics-alignSelect"})}),!a&&(0,se.jsx)(re.Flex,{justifyContent:"end",children:(0,se.jsx)(Se,{roomId:n,id:o,onRemove:i})})]})})]})};var Ve=n(49163),Oe=n(45087),Ee=n(43375),_e=n(43627),ze=n(74979);const He=e=>{let{metric:t,onToggle:n,onEdit:r,disabled:o}=e;const{attributes:i,listeners:s,setNodeRef:l,transform:a,transition:c}=(0,_e.gl)({id:t.id}),d={transform:ze.Ks.Transform.toString(a),transition:c};return(0,se.jsx)("div",{ref:l,style:d,...i,children:(0,se.jsxs)(re.Flex,{"data-testid":`metricsMenu-metric-${t.title}`,justifyContent:"between",alignItems:"center",padding:[1,0],children:[(0,se.jsxs)(re.Flex,{alignItems:"center",gap:1,children:[!o&&(0,se.jsx)(re.Icon,{name:"nav_dots",color:"textLite",cursor:"grab",size:"small",...s}),(0,se.jsx)(re.Checkbox,{checked:!t.hidden,"data-testid":"metricsMenu-metricCheckbox",label:t.title,onChange:n})]}),(0,se.jsx)(re.IconButton,{"data-testid":"metricsMenu-editMetric",flavour:"borderless",icon:"pencilSolid",padding:[0],onClick:r,width:"10px",height:"10px"})]})})},Ke=e=>{let{isOpen:t,onClose:n,onEdit:o,roomId:i,targetRef:s,tabId:l}=e;const[a,c]=(0,Ce.tY)(i),d=(0,r.useMemo)((()=>a.filter((e=>e.type===l))),[l,a]),[u,h]=(0,r.useState)(d.map((e=>e.id)));(0,r.useEffect)((()=>{h(d.map((e=>e.id)))}),[d]);const x=(0,Ee.FR)((0,Ee.MS)(Ee.AN),(0,Ee.MS)(Ee.uN,{coordinateGetter:_e.JR})),g=(0,Ce._E)(i,l),m=(0,r.useCallback)((e=>{const{active:t,over:n}=e;if(t?.id&&n?.id&&t.id!==n.id){const e=u.indexOf(t.id),r=u.indexOf(n.id),o=(0,_e.be)(u,e,r);h(o),g(o)}}),[u,g]),p=(0,Ve._)({roomId:i,params:{type:"roomMetrics",entity:"metrics",path:"/nodes"}})[0],f=(0,Ce.Ul)(i,l);if(!s.current||!t)return null;const j=e=>{o(e),n()};return(0,se.jsxs)(re.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:s.current,gap:1,children:[(0,se.jsx)(re.Button,{"data-testid":"metricsMenu-addMetricButton",label:"Add new metric",icon:"plus",onClick:()=>j("new"),small:!0,alignSelf:"end"}),(0,se.jsx)(Ee.Mp,{sensors:x,collisionDetection:Ee.fp,onDragEnd:m,children:(0,se.jsx)(_e.gB,{items:u,strategy:_e._G,children:(0,se.jsx)(re.Flex,{column:!0,children:u.map((e=>{const t=d.find((t=>t.id===e));return t?(0,se.jsx)(He,{metric:t,onToggle:()=>c(t.id,(e=>({...e,hidden:!e.hidden,type:l}))),onEdit:()=>j(t.id),disabled:!1},t.id):null}))})})}),p&&(0,se.jsx)(Oe.A,{content:"All metrics will be reset to defaults",children:(0,se.jsx)(re.Button,{padding:[0],"data-testid":"metricsMenu-resetButton",label:"Reset to default metrics",flavour:"borderless",onClick:f,small:!0,danger:!0,alignSelf:"end"})})]})},We=e=>{let{spaceId:t,roomId:n,tabId:o}=e;const[i,,s,l]=(0,pe.A)(),[a,c]=(0,r.useState)(null),d=(0,r.useRef)();return(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(re.Button,{"data-ga":"metric-setting::click-metric-setting::hm-nodes","data-testid":"metricSettings-button",flavour:"hollow",icon:"gear",neutral:!0,onClick:s,ref:d,label:"Metrics",small:!0}),(0,se.jsx)(Ke,{isOpen:i,onClose:l,onEdit:c,roomId:n,tabId:o,targetRef:d}),a&&(0,se.jsx)(Re,{"data-testid":"metricsManagement",spaceId:t,roomId:n,tabId:o,id:a,onClose:()=>c(null)})]})};var Ge=n(94404);const qe=()=>(0,oe.H)("grouping","click-grouping","hm-nodes"),Ue=(0,Ge.A)(fe.A),Je=[{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"}],Xe=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),[n,,o,i]=(0,pe.A)(),[s,l]=(0,O.TS)(t,"groupMode"),a=(0,r.useMemo)((()=>Je.find((e=>e.value===s))||Je[0]),[s]),c=(0,r.useCallback)((e=>{let{value:t}=e;return l(t)}),[l]);return(0,se.jsxs)(re.Flex,{alignItems:"center","data-testid":"agentsHead-actions",flexWrap:!1,gap:3,children:[(0,se.jsx)(re.Select,{label:"Group by",onChange:c,onMenuOpen:qe,options:Je,value:a}),(0,se.jsx)(We,{roomId:t,spaceId:e}),n&&(0,se.jsx)(je.A,{onClose:i}),(0,se.jsx)(Ue,{"data-ga":"add-nodes::click-add-nodes::hm-nodes","data-testid":"agentsHead-addNode",icon:"nodes_hollow",label:"Add Nodes",onClick:o,small:!0})]})},Ye=()=>(0,se.jsx)(re.Flex,{width:"100%",justifyContent:"end",background:"mainBackground",padding:[2],children:(0,se.jsx)(Xe,{})});n(3949);var Ze=n(85163),Qe=n(84535),et=n(78152);const tt="clear",nt="warning",rt="critical",ot="unreachable";var it=n(49181);const st={alertStatus:{[rt]:1,[nt]:2,[tt]:3,[ot]:4},nodeStatus:{Live:1,Stale:2,Offline:3}},lt={nodeStatus:e=>(0,it.GM)(e.state),alertStatus:e=>(0,it.vt)(e),vendor:e=>e.labels?.vendor||"Unknown",type:e=>e.labels?.type||"Unknown",location:e=>e.labels?.sysLocation||e.labels?.location||"Unknown","":()=>"Nodes"};var at=n(56876),ct=n(30863),dt=n(69001),ut=n(95836),ht=n(27496);const xt=e=>{let{id:t,...n}=e;return(0,se.jsxs)(dt.h,{id:t,...n,children:[(0,se.jsx)(ut.$,{id:t}),(0,se.jsx)(ht.n,{id:t})]})},gt=(0,r.memo)(xt);var mt=n(16373),pt=n(90901),ft=n(82103),jt=n(55759),bt=n(77186),vt=n(59400);const yt=e=>{let{connectivity:t,id:n,name:r,...o}=e;const i=(0,g.JT)("node:Delete"),s=!(0,v.XA)().untouchable,[l,,a,c]=(0,pe.A)(),[d,,u,h]=(0,pe.A)();return(0,se.jsxs)(vt.SS,{alignSelf:"end",gap:1,"data-testid":"node-actions",...o,children:[s&&(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(ft.A,{badge:"actionRemove","data-testid":"remove-node-action",children:(0,se.jsx)(vt.d0,{"data-ga":"nodes-table-row::click-remove-node::nodes-view",onClick:u})}),d&&(0,se.jsx)(bt.Ay,{ids:[n],name:r,onClose:h})]}),i&&"Offline"===t&&(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(ft.A,{badge:"actionObsolete","data-testid":"obsolete-node-action",children:(0,se.jsx)(vt.AS,{"data-ga":"nodes-table-row::click-obsolete-node::nodes-view",onClick:a})}),l&&(0,se.jsx)(jt.Ay,{ids:[n],name:r,onClose:c})]})]})};var wt=n(97336);const Ct=e=>{let{instanceType:t,name:n,providerType:r,...o}=e;return(0,se.jsx)(ft.A,{badge:"cloudInfo","data-testid":"node-cloud-info",nodeName:n,...o,children:(0,se.jsxs)(re.Flex,{alignItems:"center",gap:1,children:[(0,se.jsx)(re.Icon,{color:"textDescription","data-testid":"node-cloud-info-icon",name:"ipNetworking",width:"18px",height:"18px"}),(0,se.jsxs)(re.TextSmall,{color:"textDescription","data-testid":"node-cloud-info-text",children:[(0,it.ws)(r)," \u2022 ",(0,it.ws)(t)]})]})})},It=e=>{let{connectivity:t,name:n,...r}=e;return(0,se.jsx)(ft.A,{badge:"connectivity",connectivityState:t,"data-testid":"node-connectivity",nodeName:n,...r,children:(0,se.jsx)(re.Icon,{name:`connectivityStatus${t}`,width:"18px",height:"18px"})})},At=e=>{let{onClick:t,...n}=e;return(0,se.jsx)(ft.A,{badge:"info","data-testid":"node-info-cta",...n,children:(0,se.jsx)(re.Icon,{color:"textDescription",cursor:"pointer",height:"18px",width:"18px",name:"information",onClick:t})})},kt=e=>{let{name:t,...n}=e;return(0,se.jsx)(ft.A,{badge:"k8s","data-testid":"node-kubernetes",nodeName:t,...n,children:(0,se.jsxs)(re.Flex,{alignItems:"center",gap:1,children:[(0,se.jsx)(re.Icon,{color:"textDescription","data-testid":"node-kubernetes-icon",name:"serviceKubernetes",width:"18px",height:"18px"}),(0,se.jsx)(re.TextSmall,{color:"textDescription","data-testid":"node-kubernetes-text",children:"k8s"})]})})},St=e=>{let{kernelName:t,kernelVersion:n,name:r,...o}=e;return(0,se.jsx)(ft.A,{badge:"kernel","data-testid":"node-kernel",nodeName:r,...o,children:(0,se.jsx)(re.TextSmall,{color:"textDescription",children:(0,it.Ud)(t,n)})})};var Tt=n(52253),Mt=n(41708),Ft=n(92834);const Nt=e=>{let{architecture:t,cpuFrequency:n,cpus:r,diskSpace:o,memory:i,name:s,os:l,osName:a,timezone:c,...d}=e;return(0,se.jsx)(ft.A,{badge:"systemInfo","data-testid":"node-system-info",nodeName:s,...d,children:(0,se.jsxs)(re.Flex,{alignItems:"center",gap:1,children:[(0,se.jsx)(re.Icon,{color:"textDescription","data-testid":"node-system-info-icon",name:Qe.u[a]?.iconName||Qe.U[l]?.iconName||"os",width:"16px",height:"16px"}),(0,se.jsxs)(re.TextSmall,{color:"textDescription","data-testid":"node-system-info-text",children:[(0,it.ws)(a)," \u2022 ",(0,it.O)(n)," \u2022"," ",(0,it.ws)(r,1===r?"Core":"Cores")," \u2022"," ",(0,it.ws)(t)," \u2022"," ",(0,it.ws)((0,it.RI)(i),"RAM")," \u2022"," ",(0,it.ws)((0,it.RI)(o),"HD"),!!c&&(0,se.jsxs)(se.Fragment,{children:[" ","\u2022 ",(0,se.jsx)(Ft.A,{timezone:c})]})]})]})})},Lt=e=>{let{container:t,name:n,virtualization:r,...o}=e;const i=(0,it.Pg)(t,r);return(0,se.jsx)(ft.A,{badge:"type","data-testid":"node-type",nodeName:n,nodeType:i.label,...o,children:(0,se.jsxs)(re.Flex,{alignItems:"center",gap:1,children:[(0,se.jsx)(re.Icon,{color:"textDescription","data-testid":"node-type-icon",name:i.icon,height:i.iconSize,width:i.iconSize}),(0,se.jsx)(re.TextSmall,{color:"textDescription","data-testid":"node-type-text",children:i.label})]})})};var $t=n(71236);const Dt=e=>{let{health:t={}}=e;const{silencingState:n}=t.alerts||{},{state:r}=n||{};return"NONE"!=r?(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),(0,se.jsx)(re.Flex,{children:(0,se.jsx)($t.A,{flavour:"node",silencing:n})})]}):null};var Bt=n(74891);const Pt=(0,Bt.A)((0,Ge.A)(re.Button)),Rt=e=>{let{id:t}=e;const n=(0,f.Zp)(),o=(0,b.bq)(),i=(0,r.useCallback)((()=>{const e={nodeId:t};n(`/spaces/${o}/settings/notifications#notificationsActiveTab=1&silencingRulePrefill=${JSON.stringify(e)}`)}),[]);return(0,se.jsx)(Pt,{feature:"SilencingNode",payload:{nodeId:""},tooltip:"Create a new silencing rule for this node",flavour:"hollow",icon:"alarm_off",iconWidth:"12px",onClick:i})};var Vt=n(36504),Ot=n(92942),Et=n(19371),_t=n(63928);const zt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"servers";const n=(0,Ve._)({params:{type:["favourites"],path:[`/${e}/${t}`]}}),o=(0,r.useMemo)((()=>n.filter((e=>{let{value:t}=e;return t?.nodeId})).sort(((e,t)=>(e.value.sortOrder||0)-(t.value.sortOrder||0))).map((e=>{let{value:t}=e;return t.nodeId}))),[n]),i=(0,r.useMemo)((()=>n.reduce(((e,t)=>({...e,...t.value?.nodeId?{[t.value.nodeId]:t}:{}})),{})),[n]),s=(0,_t.xS)(),l=(0,r.useCallback)((async e=>{const t=e.map(((e,t)=>{const n=i[e];if(n)return s({...n,value:{...n.value,sortOrder:t}})}));await Promise.all(t.filter(Boolean))}),[i,s]);return{favoriteNodeIds:o,settingsByNodeId:i,handleOrderChange:l}},Ht=(e,t)=>e&&e.getRoot().getChildren().find((e=>e.match({id:`nodes-${t}`}))),Kt=(e,t)=>`table-metrics-${e}-${t}`,Wt=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"sum";const o=Ht(e,t);if(!o)return null;const i=Kt(n,r);return o.getNode({id:i})};var Gt=n(28657);const qt=e=>{let{id:t,roomId:n,nodeId:o,context:i,dimensions:s}=e;const l=(0,Et.eg)(),a=(0,r.useMemo)((()=>{const e=Ht(l,n),r=[t,o,i].join("-");if(!e)return null;let a=e.getNode({id:r});return a?(a.updateAttribute("selectedDimensions",s),a):(a=l.makeChart({attributes:{id:r,nodesScope:[o],contextScope:[i],pixelsPerPoint:20,selectedDimensions:s}}),e.appendChild(a),a)}),[i,t,o,n,l]);return a?(0,se.jsx)(Gt.A,{chart:a,hasHeader:!1,hasFooter:!1,hasFilters:!1,height:100}):null},Ut=(0,r.memo)(qt);var Jt=n(74518);const Xt=e=>{let{id:t,context:n,nodeId:r,isLive:o,hidden:i,title:s,dimensions:l}=e;const a=(0,v.ID)();return i||!o?null:(0,se.jsxs)(re.Flex,{column:!0,"data-testid":`metrics-chart-${n}`,flex:"grow",basis:"174px",children:[(0,se.jsx)(Jt.A,{text:s||n,TextComponent:re.TextSmall,color:"textDescription",margin:[1,0,1,2],as:"div"}),(0,se.jsx)(Ut,{id:t,context:n,nodeId:r,roomId:a,dimensions:l})]})};var Yt=n(91421),Zt=n(3319);const Qt=e=>{let{node:t,...n}=e;const[,o]=(0,Yt.PJ)(),{sendButtonClickedLog:i}=(0,Zt.A)(),s=t.capabilities?.dyncfg?.enabled,l=t.isLive&&s,a=l?"Configure this node":t.isLive?"Node cannot be configured":"Cannot configure a non live node",c=(0,r.useCallback)((()=>{l&&(o(!0,{nodeId:t.id}),i({feature:"DyncfgNode",description:"Configure node",nodeId:t?.id,nodeName:t?.name}))}),[l,t,o,i]),d=(0,r.useMemo)((()=>({name:"gear",size:"small",color:l?"text":"disabled",cursor:l?"pointer":"auto",onClick:c})),[l,c]);return(0,se.jsx)(ft.A,{content:a,children:(0,se.jsx)(re.Flex,{...n,children:(0,se.jsx)(re.Icon,{...d})})})};var en=n(51262);const tn=(nn=Qt,e=>(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),(0,se.jsx)(nn,{...e})]}));var nn;const rn=e=>{let{id:t,name:n,hw:o,os:i,ni:s,capabilities:l,container:a,updateSeverity:c,bugs:d,labels:u,isLive:h,state:x,version:g,extraKey:m,health:p,menuId:f,eligibility:j}=e;const y=(0,b.dg)(),w=(0,v.ID)(),C=l.funcs?.enabled,I=l.ml?.enabled,A=(0,it.GM)(x),{isNodeRestricted:k}=(0,en.A)(),{restricted:S}=k(t),{_cloud_instance_type:T,_cloud_provider_type:M,_timezone:F}=u||{},N="true"===u?._is_k8s_node,L=!(0,it.Po)(T)||!(0,it.Po)(M),$=(0,H.Fw)("sidebarTab",{flavour:"val",extraKey:m}),D=(0,H.Fw)("sidebarOpen",{flavour:"bool"}),B=(0,H.Fw)("sidebarNodeId",{flavour:"val",extraKey:m}),P=(0,r.useCallback)((e=>{D(!0),$(e),B(t)}),[t,B,D,$]),R=(0,r.useCallback)((()=>P("alerts")),[P]),V=(0,r.useCallback)((()=>P("info")),[P]),O=(0,mt.Id)(),E=(0,pt.I)(),_=(0,Ce.Vw)(w);return(0,se.jsxs)(re.Flex,{"data-testid":`nodeRow-${n}`,"data-menuid":f||t,padding:[1],column:!0,gap:1,round:!0,children:[(0,se.jsxs)(re.Flex,{alignItems:"center","data-testid":"nodeRow-basic-info",gap:2,height:{min:6},children:[(0,se.jsx)(It,{connectivity:A,"data-testid":`nodeRow-connectivity-${A.toLowerCase()}`,name:n}),(0,se.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),(0,se.jsx)(Mt.A,{"data-testid":"nodeRow-name",id:t,name:n,isLive:h,state:x,eligibility:j}),(0,se.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),(0,se.jsx)(At,{onClick:V,"data-testid":"nodeRow-more-info-cta"}),(0,se.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),(0,se.jsx)(wt.A,{id:t,isLive:h,"data-testid":"nodeRow-alerts",name:n,onClick:R}),(0,se.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),(0,se.jsx)(Tt.A,{badge:"ml","data-testid":"nodeRow-machine-learning-status",enabled:I,name:n,onClick:()=>E(t),children:(0,se.jsx)(re.Icon,{name:"anomaliesLens",size:"small",color:"text"})}),(0,se.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),(0,se.jsx)(Tt.A,{badge:"fn","data-testid":"nodeRow-fn-status",enabled:C,name:n,onClick:()=>O(t),children:(0,se.jsx)(re.Icon,{name:"functions",size:"small",color:"text"})}),c&&(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),(0,se.jsx)(Vt.A,{name:n,os:i.id,container:a,warningLevel:c,labels:u,version:g,text:c,"data-testid":"nodeRow-needs-update"})]}),!!(d||[]).length&&(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),(0,se.jsx)(Ot.A,{bugs:d,"data-testid":"nodeRow-bugs"})]}),(0,se.jsx)(tn,{node:{id:t,name:n,isLive:h,ni:s,capabilities:l}}),(0,se.jsx)(yt,{"data-testid":"nodeRow-node-actions",id:t,name:n,connectivity:A}),y?null:(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(Dt,{health:p}),(0,se.jsx)(Rt,{id:t})]})]}),(0,se.jsxs)(re.Flex,{alignItems:"center","data-testid":"nodeRow-detailed-info",gap:2,children:[(0,se.jsx)(Nt,{architecture:o.architecture,cpuFrequency:o.cpuFrequency,cpus:o.cpus,"data-testid":"nodeRow-system-info",diskSpace:o.diskSpace,memory:o.memory,name:n,osName:i.nm,os:i.id,timezone:F}),(0,se.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),!!i?.kernel&&(0,se.jsx)(St,{"data-testid":"nodeRow-kernel",kernelName:i.kernel.nm,kernelVersion:i.kernel.v,name:n}),(0,se.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),N&&(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(kt,{"data-testid":"nodeRow-kubernetes",name:n}),(0,se.jsx)(vt.K,{"data-testid":"nodeRow-separator"})]}),(0,se.jsx)(Lt,{container:o.container,"data-testid":"nodeRow-type",name:n,virtualization:o.virtualization}),L&&(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),(0,se.jsx)(Ct,{"data-testid":"nodeRow-cloud-info",instanceType:T,name:n,providerType:M})]})]}),!S&&!!_?.length&&(0,se.jsx)(re.Flex,{"data-testid":"nodeRow-charts",gap:1,children:_.map((e=>(0,se.jsx)(Xt,{...e,nodeId:t,isLive:h},e.id)))})]})},on=e=>{switch(e.level){case 0:return gt;case 1:return rn;default:return null}},sn=e=>{let{onChartNameChange:t,initialChartName:n,dashboardOptions:r,linkToGo:o,contextToGo:i,...s}=e;const{setActiveMenuId:l}=(0,at.A)({onChartNameChange:t,initialChartName:n,linkToGo:o,contextToGo:i});return(0,se.jsx)(te.H,{...s,children:(0,se.jsx)(ct.A,{flavour:"nodes",onActiveMenuId:l,getComponent:on,dashboardOptions:r,initialChartName:n,checkVisibility:()=>!0})})};var ln=n(69457),an=n(20871),cn=n(48106),dn=n(33185),un=n(24155);const hn=(0,dn.default)(re.Box).attrs((e=>({...e}))).withConfig({displayName:"loader__Grid",componentId:"sc-yd9b7n-0"})(["display:grid;grid-template-columns:1fr 6fr 1fr;gap:8px;"]),xn=()=>(0,se.jsxs)(re.Flex,{column:!0,gap:2,children:[(0,se.jsx)(un.A,{height:"38px"}),(0,se.jsx)(hn,{children:Array.from(Array(15).keys()).map((e=>(0,se.jsxs)(r.Fragment,{children:[(0,se.jsx)(un.A,{height:"32px"}),(0,se.jsx)(un.A,{height:"32px"}),(0,se.jsx)(un.A,{height:"32px"})]},e)))})]});var gn=n(9962),mn=(n(30670),n(36310)),pn=n(39483);const fn=e=>{let{children:t,contextName:n,dimensions:r,aggregationMethod:o="sum",fractionDigits:i,totalDimensions:s,calculateTotal:l}=e;const{chart:a,state:c}=(0,mn.useHeadlessChart)(),{contextGroups:d}=(0,pn.useTableMatrix)();if(!d)return t({data:null,loading:!c.loaded&&c.loading,error:c.error});if(c.empty)return t({data:null,loading:!c.loaded&&c.loading,error:"No data available"});const u=d[n];if(!u)return t({data:null,loading:!c.loaded&&c.loading,error:"Context not found"});const h=a.getPayload()?.data?.length-1||0;if(l){const e=r&&r.length>0?(Array.isArray(r)?r:[r]).map((e=>u[e]?.[0])).filter(Boolean):Object.values(u).flat().filter(Boolean),n=s&&s.length>0?s.map((e=>u[e]?.[0])).filter(Boolean):Object.values(u).flat().filter(Boolean);if(0===e.length||0===n.length)return t({data:null,loading:!c.loaded&&c.loading,error:"Required dimensions not found"});const o=e.reduce(((e,t)=>e+(a.getDimensionValue(t,h)||0)),0),l=n.reduce(((e,t)=>e+(a.getDimensionValue(t,h)||0)),0),d=l>0?o/l*100:0,x=e[0];return t({data:{value:o,convertedValue:a.getConvertedValue(o,{fractionDigits:i,dimensionId:x}),total:a.getConvertedValue(l,{fractionDigits:i,dimensionId:x}),percentage:d,units:a.getUnitSign({dimensionId:x}),dimensionId:x},loading:!c.loaded&&c.loading,error:null})}let x,g,m,p,f;if(!r||Array.isArray(r)&&0===r.length){if(p=Object.values(u).flat(),f=p[0],0===p.length)return t({data:null,loading:!c.loaded&&c.loading,error:"No dimensions found"});x=a.getAggregatedDimensionValue(p,h,{aggregationMethod:o}),g=a.getConvertedValue(x,{dimensionId:f,fractionDigits:i})}else if("string"===typeof r){if(p=u[r],f=p[0],!p?.length)return t({data:null,loading:!c.loaded&&c.loading,error:"Dimension not found"});x=a.getAggregatedDimensionValue(p,h,{aggregationMethod:o}),g=a.getConvertedValue(x,{dimensionId:f,fractionDigits:i}),m=a.selectDimensionColor(p[0])}else if(Array.isArray(r)){if(p=r.flatMap((e=>u[e])).filter(Boolean),f=p[0],0===p.length)return t({data:null,loading:!c.loaded&&c.loading,error:"No valid dimensions found"});x=a.getAggregatedDimensionValue(p,h,{aggregationMethod:o}),g=a.getConvertedValue(x,{dimensionId:f,fractionDigits:i})}return t({data:{value:parseFloat(x)||0,convertedValue:g||"0",dimensionId:f,units:f?a.getUnitSign({dimensionId:f}):"",...m&&{color:m}},loading:!c.loaded&&c.loading,error:null})},jn=e=>{let{nodeId:t,contextName:n,dimensions:o,aggregationMethod:i="sum",fractionDigits:s,totalDimensions:l,calculateTotal:a,children:c}=e;const d=(0,Et.eg)(),u=(0,v.ID)(),[h,x]=(0,r.useState)((()=>Wt(d,u,t,i)));return(0,r.useEffect)((()=>{if(h)return;const e=(e,n)=>{n.getId()!==Kt(t,i)&&n.getId()!==h?.getId()&&x(n)},n=()=>x(Wt(d,u,t,i));return d.on("nodeAdded",e),d.on("nodesContainerUpdated",n),n(),()=>{d.off("nodeAdded",e),d.off("nodesContainerUpdated",n)}}),[d,h]),h?(0,se.jsx)(mn.default,{chart:h,children:(0,se.jsx)(fn,{contextName:n,dimensions:o,aggregationMethod:i,fractionDigits:s,totalDimensions:l,calculateTotal:a,children:c})}):c({data:null,loading:!0,error:"Chart not found"})},bn=()=>(0,se.jsx)(un.A,{width:"80%",height:"8px"}),vn={value:e=>({id:e.columnId,header:(0,se.jsx)(re.Text,{strong:!0,children:e.header}),headerString:e.headerString,accessorKey:e.columnId,size:e.size,minSize:e.minSize,maxSize:e.maxSize,align:e.align,category:"Metrics",enableSorting:!1,...e.labelProps&&{labelProps:e.labelProps},cell:t=>{let{row:n}=t;const r=n.original,o=r.id||r.nd;return(0,se.jsx)(jn,{nodeId:o,contextName:e.context,dimensions:e.dimensions,aggregationMethod:e.aggregation||"sum",fractionDigits:e.fractionDigits,totalDimensions:e.totalDimensions,calculateTotal:e.calculateTotal,children:t=>{let{data:n,loading:r}=t;if(r)return(0,se.jsx)(re.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,se.jsx)(bn,{})});if(!n)return(0,se.jsx)(re.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,se.jsx)(re.Text,{children:"-"})});const o=n.convertedValue&&n.total;return(0,se.jsxs)(re.Flex,{alignItems:"end",justifyContent:"end",width:"100%",gap:.5,children:[(0,se.jsx)(re.Text,{textAlign:"right",children:o?(0,se.jsxs)(se.Fragment,{children:[n.convertedValue,"/",n.total]}):n.convertedValue}),!e.hideUnits&&n.units&&(0,se.jsx)(re.TextMicro,{color:"textLite",strong:!0,textAlign:"right",children:n.units})]})}})},renderString:t=>{const n=t.original[e.columnId];return(0,it.Po)(n)?"":`${n.convertedValue} ${e.hideUnits?"":n.units}`},sortingFn:(t,n)=>(t.original[e.columnId]?.value||0)-(n.original[e.columnId]?.value||0)}),progressBar:e=>({id:e.columnId,header:(0,se.jsx)(re.Text,{strong:!0,children:e.header}),headerString:e.headerString,accessorKey:e.columnId,size:e.size,minSize:e.minSize,maxSize:e.maxSize,align:e.align,category:"Metrics",enableSorting:!1,...e.labelProps&&{labelProps:e.labelProps},cell:t=>{let{row:n}=t;const r=n.original,o=r.id||r.nd;return(0,se.jsx)(jn,{nodeId:o,contextName:e.context,dimensions:e.dimensions,aggregationMethod:e.aggregation||"sum",fractionDigits:e.fractionDigits,totalDimensions:e.totalDimensions,calculateTotal:e.calculateTotal,children:t=>{let{data:n,loading:r}=t;if(r)return(0,se.jsx)(re.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,se.jsx)(bn,{})});if(!n)return(0,se.jsx)(re.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,se.jsx)(re.Text,{children:"-"})});const o="undefined"!==typeof n.convertedValue&&"undefined"!==typeof n.total,i=o?n.percentage:parseFloat(n.convertedValue)||0,s=Math.min(i,100);return(0,se.jsxs)(re.Flex,{column:!0,width:"100%",alignItems:o?"center":"end",gap:2,children:[(0,se.jsxs)(re.Flex,{alignItems:"end",justifyContent:o?"between":"end",width:"100%",children:[o&&(0,se.jsxs)(re.Flex,{alignItems:"end",gap:.5,children:[(0,se.jsxs)(re.Text,{children:[n.convertedValue,"/",n.total]}),!e.hideUnits&&n.units&&(0,se.jsx)(re.TextMicro,{color:"textLite",strong:!0,textAlign:"right",children:n.units})]}),(0,se.jsxs)(re.Flex,{alignItems:"end",children:[(0,se.jsx)(re.Text,{children:Math.round(i)}),(0,se.jsx)(re.TextMicro,{color:"textLite",strong:!0,children:"%"})]})]}),(0,se.jsx)(re.ProgressBar,{background:"panelBg",color:"textLite",height:.5,width:`${s}%`,containerWidth:"100%",border:"none",overflow:"hidden"})]})}})},renderString:t=>{const n=t.original[e.columnId];return(0,it.Po)(n)?"":`${n.convertedValue} / ${n.total} (${n.percentage.toFixed(1)}%)`},sortingFn:(t,n)=>(t.original[e.columnId]?.percentage||t.original[e.columnId]?.value||0)-(n.original[e.columnId]?.percentage||n.original[e.columnId]?.value||0)}),metadata:e=>({id:e.columnId,header:(0,se.jsx)(re.Text,{strong:!0,children:e.header}),headerString:e.headerString,accessorKey:e.accessorKey,size:e.size,minSize:e.minSize,maxSize:e.maxSize,align:e.align||"left",category:"Labels",cell:t=>{let{row:n}=t;const r=n.original,o=e.accessorKey.split(".");let i=r;for(const e of o)if(i=i?.[e],void 0===i)break;if(e.fallbackKeys)for(const s of e.fallbackKeys){if(!(0,it.Po)(i))break;const e=s.split(".");let t=r;for(const n of e)if(t=t?.[n],void 0===t)break;i=t}return(0,it.Po)(i)?(0,se.jsx)(re.Flex,{alignItems:"end",width:"100%",children:(0,se.jsx)(re.Text,{children:"-"})}):(0,se.jsx)(re.Flex,{alignItems:"center",width:"100%",children:(0,se.jsx)(re.Text,{children:i})})},renderString:t=>{const n=t.original,r=e.accessorKey.split(".");let o=n;for(const e of r)if(o=o?.[e],void 0===o)break;if(e.fallbackKeys)for(const i of e.fallbackKeys){if(!(0,it.Po)(o))break;const e=i.split(".");let t=n;for(const n of e)if(t=t?.[n],void 0===t)break;o=t}return(0,it.Po)(o)?"-":o},sortingFn:"basic"})};var yn=n(71341);const wn=e=>{let{osEntry:t}=e;if(!t)return(0,se.jsx)(re.Icon,{name:"os",width:"18px",height:"18px",color:"textDescription"});if(t.iconName)return(0,se.jsx)(re.Icon,{name:t.iconName,width:"18px",height:"18px",color:"textDescription",viewBox:"0 0 100 100"});if(t.logoFilename){const e=`${x.A.assetsBaseURL}/img/logos/os/${t.logoFilename}`;return(0,se.jsx)("img",{src:e,width:"18px",height:"18px",alt:t.title})}return(0,se.jsx)(re.Icon,{name:"os",width:"18px",height:"18px",color:"textDescription"})},Cn=e=>{let{headerText:t="Server"}=e;return{id:"server",header:(0,se.jsx)(re.Text,{strong:!0,children:t}),headerString:t,accessorKey:"name",size:200,minSize:60,maxSize:400,align:"center",category:"Device",enableHiding:!1,cell:e=>{let{row:t}=e;const n=t.original,r=(0,it.GM)(n.state),o=n.os?.nm||n.labels?.os_name,i=n.os?.id,s=n.labels?.vendor,l=Qe.u[o]||Qe.U[i]||Qe.u[s],a="Live"===r?yn.P.live.indicatorWrapperColor:"Stale"===r?yn.P.stale.indicatorWrapperColor:yn.P.offline.indicatorWrapperColor;return(0,se.jsxs)(re.Flex,{alignItems:"center",gap:2,width:"100%",children:[(0,se.jsx)(re.Flex,{width:2,height:2,round:"50%",background:a,flex:!1}),(0,se.jsx)(re.Flex,{width:5,height:5,flex:!1,alignItems:"center",justifyContent:"center",children:(0,se.jsx)(wn,{osEntry:l})}),(0,se.jsx)(Mt.A,{id:n.id||n.nd,name:n.nm||n.name,state:n.state,isLive:n.isLive})]})},renderString:e=>e.original.name||e.original.nm,sortingFn:"basic"}},In=e=>({id:"alerts",header:(0,se.jsx)(re.Text,{strong:!0,children:"Alerts"}),headerString:"Alerts",accessorFn:e=>{const{warning:t=0,critical:n=0}=e.health?.alerts||{};return 3*n+2*t},size:80,minSize:60,maxSize:400,align:"center",category:"Device",cell:t=>{let{row:n}=t;const o=n.original,{warning:i=0,critical:s=0}=o.health?.alerts||{},l=i+s>0,a=(0,H.Fw)("sidebarTab",{flavour:"val",extraKey:e}),c=(0,H.Fw)("sidebarOpen",{flavour:"bool"}),d=(0,H.Fw)("sidebarNodeId",{flavour:"val",extraKey:e}),u=(0,r.useCallback)((e=>{e.stopPropagation(),c(!0),a("alerts"),d(o.id)}),[o.id,d,c,a]),h=(0,gn.I)({flavour:s>0?"error":"disabledError",value:s||" "}),x=(0,gn.I)({flavour:i>0?"warning":"disabledWarning",value:i||" "});return(0,se.jsx)(re.Flex,{alignItems:"center",justifyContent:"center",opacity:l?1:.3,children:(0,se.jsx)(re.MasterCard,{"data-testid":"alertsMastercard",onClick:l?u:null,pillLeft:h,pillRight:x,size:"small",height:"20px"})})},renderString:e=>{const{warning:t=0,critical:n=0}=e.original.health?.alerts||{};return t+n},sortingFn:"basic"}),An=(e,t)=>{let{extraKey:n="nodesView",tabId:o="servers"}=t;return(0,r.useMemo)((()=>{const t="snmp"===o?"Device":"Server",r=(e=>e.map((e=>{const t=vn[e.columnFlavour];return t?t(e):(console.warn(`Unknown column flavour: ${e.columnFlavour}`),vn.value(e))})))(e)||[],i=r.reduce(((e,t)=>{const n=t.category||"Metrics";return e[n]||(e[n]=[]),e[n].push(t),e}),{});return[{id:"Server",isPlaceholder:!0,columns:[Cn({headerText:t}),In(n)],notFlex:!0},...Object.entries(i).map((e=>{let[t,n]=e;return{id:t,header:"",columns:n,notFlex:!0}}))]}),[e,n,o])};var kn=n(1444),Sn=n(95565);const Tn={LocalDashboard:"Favourites can be saved when the agent is part of a Netdata cloud space.",DemoSpace:"Favourites cannot be saved on a demo space.",FreePlan:()=>(0,se.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,se.jsx)(re.Text,{children:"Favourites can be saved only on a paid plan."}),(0,se.jsx)(Sn.A,{children:(0,se.jsx)(re.Text,{color:"primary",children:"Upgrade for no limitations!"})})]}),default:null},Mn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"servers";const[n,,o,i]=(0,pe.A)(),s=(0,_t.yK)({onResolve:i}),l=(0,_t.z2)(null,{onResolve:i}),{disabled:a,reason:c}=(0,kn.A)(),d=(0,r.useCallback)((async function(n,r){let{tabId:i=t,flavour:c=e}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!a&&n&&(o(),r?await l(r.id):await s({type:"favourites",entity:n,path:`/${c}/${i}`,value:{nodeId:n,sortOrder:Date.now()}}))}),[a,s,l,o,e,t]);return{isLoading:n,disabled:a,reason:Tn[c]||Tn.default,toggleFavorite:d}},Fn={[rt]:"error",[nt]:"warning",[tt]:"success",[ot]:"textLite"},Nn={Live:"live",Stale:"stale",Offline:"offline",critical:"live",warning:"live",clear:"live"},Ln={nodeStatus:!0,critical:!0,warning:!0,clear:!0},$n=e=>{let{rows:t,name:n,groupMode:r}=e;const o=Ln[r]||Ln[n],i=t.map((e=>e.original.id)),s=(0,E.BU)(i).length,l=(0,E.Ig)(i).length,a=(0,E.GE)(i).length;return(0,se.jsx)(Oe.A,{content:(0,se.jsxs)(re.Flex,{alignItems:"center",gap:4,background:"dropdown",round:!0,padding:[2,3],children:[(!o||Nn[n]===Nn.Live)&&(0,se.jsxs)(re.Flex,{alignItems:"center",gap:2,children:[(0,se.jsx)(re.Flex,{width:2,height:2,round:"50%",background:yn.P.live.indicatorWrapperColor}),(0,se.jsxs)(re.Text,{children:["Live: ",s]})]}),(!o||Nn[n]===Nn.Stale)&&(0,se.jsxs)(re.Flex,{alignItems:"center",gap:2,children:[(0,se.jsx)(re.Flex,{width:2,height:2,round:"50%",background:yn.P.stale.indicatorWrapperColor}),(0,se.jsxs)(re.Text,{children:["Stale: ",l]})]}),(!o||Nn[n]===Nn.Offline)&&(0,se.jsxs)(re.Flex,{alignItems:"center",gap:2,children:[(0,se.jsx)(re.Flex,{width:2,height:2,round:"50%",background:yn.P.offline.indicatorWrapperColor}),(0,se.jsxs)(re.Text,{children:["Offline: ",a]})]})]}),align:"right",children:(0,se.jsxs)(re.Text,{color:"textLite",children:["(",(!o||Nn[n]===Nn.Live)&&(0,se.jsx)(re.Text,{color:yn.P.live.statusTextColor,children:s}),!o&&"/",(!o||Nn[n]===Nn.Stale)&&(0,se.jsx)(re.Text,{color:yn.P.stale.statusTextColor,children:l}),!o&&"/",(!o||Nn[n]===Nn.Offline)&&(0,se.jsx)(re.Text,{color:yn.P.offline.statusTextColor,children:a}),")"]})})},Dn=e=>{let{row:t,name:n,groupMode:r,...o}=e;const i=t.getIsExpanded(),s=(l=n,yn.P[l?.toLowerCase?.()]?.statusTextColor||Fn[l]||"text");var l;return(0,se.jsx)(re.Flex,{height:"44px",alignItems:"center",flex:!0,width:"100%",background:"tableRowBg2",_hover:{background:"tableRowBg2Hover"},...o,children:(0,se.jsxs)(re.Flex,{position:"sticky",left:"0px",width:"auto",padding:[2,3],gap:2,children:[(0,se.jsx)(re.Icon,{name:"chevron_left",size:"small",color:"textLite",rotate:i?1:3}),(0,se.jsx)(re.Text,{color:s,strong:!0,children:n}),(0,se.jsx)($n,{rows:t.subRows,groupMode:r,name:n})]})})},Bn=e=>{let{tabId:t,flavour:n,onClickRow:r,columnPinning:o,columnVisibility:i,columnSizing:s,onColumnSizingChange:l,sortBy:a,onSortingChange:c,rowActions:d,columns:u}=e;const{favoriteNodeIds:h}=zt(n,t),[x,g]=(0,pe.A)(!0),m=(0,E.Gt)(h),p={getIsExpanded:()=>x,subRows:m.map((e=>({original:e})))};return m.length?(0,se.jsx)(se.Fragment,{children:(0,se.jsxs)("div",{children:[(0,se.jsx)(Dn,{row:p,name:"Favourites",onClick:g}),(0,se.jsx)(re.Collapsible,{open:x,children:(0,se.jsx)(re.Table,{data:m,dataColumns:u,rowActions:d,onClickRow:r,enableSorting:!0,sortBy:a,onSortingChange:c,enableColumnPinning:!0,enableResizing:!0,columnVisibility:i,columnSizing:s,onColumnSizingChange:l,background:"tableRowBg2",columnPinning:o})})]})}):null};var Pn=n(25293);const Rn={right:["actions"],left:["server"]},Vn={nodeStatus:{Live:!0},default:!0},On=e=>{let{id:t}=e;return t},En=(e=>t=>{let{nodeIdsLoaded:n,...r}=t;return(0,v.XA)("fullyLoaded")&&!!n?(0,se.jsx)(e,{...r}):(0,se.jsx)(xn,{})})((e=>{let{nodeIds:t,tabNodeIds:n,onChartNameChange:o,initialChartName:i,tabId:s="servers",flavour:l="nodesView"}=e;const a=(0,ln.qR)(),c=(0,v.ID)(),d=(0,O.Cq)(c,s),u=(0,O.A3)(c,s),h=(0,Ce.vh)(c,s),[x,m]=(0,H.r$)("expanded",{extraKey:`${l}-${s}-${d||"ungrouped"}`,flavour:"obj",defaultValue:Vn[d]||Vn.default}),[p,f]=(0,r.useState)(null),[j,y]=(0,r.useState)(null),w=(0,r.useCallback)(((e,t)=>{f({ids:[e],name:t})}),[]),C=(0,r.useCallback)(((e,t)=>{y({ids:[e],name:t})}),[]),I=An(h,{extraKey:l,tabId:s}),A=(0,r.useMemo)((()=>(e=>{const t={nodeStatus:{name:"Node status",columns:[]},alertStatus:{name:"Alerts",columns:[]}};return"snmp"===e?{...t,vendor:{name:"Vendor",columns:[]},type:{name:"Type",columns:[]},location:{name:"Location",columns:[]}}:t})(s)),[s]),k=(0,r.useMemo)((()=>h.reduce(((e,t)=>(t.hidden&&(e[t.columnId]=!1),e)),{})),[h]),[S,T]=(0,H.r$)("columnVisibility",{extraKey:`${l}-${s}`,flavour:"obj",defaultValue:k}),[M,F]=(0,H.r$)("columnSizing",{extraKey:`${l}-${s}`,flavour:"obj",defaultValue:{}}),[N,L]=(0,H.r$)("sortBy",{extraKey:`${l}-${s}`,flavour:"arrobj",defaultValue:[]}),$=(0,H.Fw)("sidebarTab",{flavour:"val",extraKey:l}),D=(0,H.Fw)("sidebarOpen",{flavour:"bool"}),B=(0,H.Fw)("sidebarNodeId",{flavour:"val",extraKey:l}),P=(0,r.useCallback)(((e,t)=>{D(!0),$(e),B(t)}),[B,D,$]),R=(0,r.useCallback)((e=>{let{data:t}=e;t.isGroup||P("info",t.id)}),[P]),V=((e,t)=>{let{flavour:n,onRemoveNode:o,onObsoleteNode:i,onClickNode:s}=t;const l=(0,g.JT)("node:Delete"),a=(0,v.XA)(),c=(0,b.dg)(),d=!a.untouchable,{isLoading:u,toggleFavorite:h,disabled:x,reason:m}=Mn(n,e),{settingsByNodeId:p}=zt(n,e),f=(0,r.useRef)(null);return f.current=t=>{const r=p[t];h(t,r,{flavour:n,tabId:e})},(0,r.useMemo)((()=>({...!c&&d&&{remove:{icon:"remove",tooltipText:"Remove node from room",handleAction:e=>o(e.id,e.name),confirmation:!0,confirmationText:e=>`Remove ${e.name} from room?`,isDisabled:()=>!1}},...!c&&!d&&{obsolete:{icon:"delete",tooltipText:"Delete node permanently",handleAction:e=>i(e.id,e.name),confirmation:!0,confirmationText:e=>`Delete ${e.name} permanently?`,isDisabled:e=>{const t=(0,it.GM)(e.state);return l&&"Offline"!==t}}},info:{handleAction:e=>s({data:e})},favorite:{icon:e=>p[e.id]?"heart_broken":"heart",tooltipText:e=>p[e.id]?"Remove from favorites":"Add to favorites",handleAction:e=>f.current(e.id),confirmation:!1,isVisible:()=>!0,isDisabled:u||x,iconColor:"textNoFocus",disabledTooltipText:m||"Saving..."}})),[l,c,d,o,i,u,x,p,s])})(s,{flavour:l,onRemoveNode:w,onObsoleteNode:C,onClickNode:R}),{setActiveMenuId:E}=(0,at.A)({onChartNameChange:o,initialChartName:i}),_=(0,r.useRef)(),z=(0,r.useRef)(),K=(0,r.useMemo)((()=>(_.current&&_.current.cancel(),_.current=(0,an.A)({elementQueryParam:"[data-id]",dataMenuId:"data-id"}),()=>_.current(z.current?.scrollElement,E))),[a.length,E]);(0,r.useLayoutEffect)((()=>{a.length&&K()}),[a.length,i]);const W=(0,r.useRef)(),G=(0,r.useMemo)((()=>({overscan:30,virtualRef:z,onScroll:K})),[K]),q=(0,r.useMemo)((()=>a.filter(Boolean)),[a]);(0,cn.A)(z.current,q);const U=(0,r.useMemo)((()=>e=>(0,se.jsx)(Dn,{groupMode:d,...e})),[d]);return(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(Bn,{tabId:s,flavour:l,onRemoveNode:w,onObsoleteNode:C,onClickRow:R,columnPinning:Rn,columnVisibility:S,columnSizing:M,onColumnSizingChange:F,sortBy:N,onSortingChange:L,rowActions:V,columns:I}),t.length?(0,se.jsx)(re.Table,{title:(0,se.jsx)(Pn.A,{extraKey:`${l}-${s}`,nodeIds:n,tabId:s}),data:q,dataColumns:I,rowActions:V,onClickRow:R,enableSorting:!0,sortBy:N,onSortingChange:L,enableColumnVisibility:!0,enableColumnPinning:!0,enableResizing:!0,columnPinning:Rn,columnVisibility:S,onColumnVisibilityChange:T,columnSizing:M,onColumnSizingChange:F,groupByColumns:A,grouping:d||"",onGroupByChange:u,getSubRows:e=>e.children,enableExpanding:!0,getRowId:On,expanded:x,onExpandedChange:m,GroupRow:U,virtualizeOptions:G,tableRef:W,background:"tableRowBg2"}):(0,se.jsx)(me,{children:(0,se.jsx)(Pn.A,{extraKey:`${l}-${s}`,nodeIds:n,tabId:s})}),p&&(0,se.jsx)(bt.Ay,{ids:p.ids,name:p.name,onClose:()=>f(null)}),j&&(0,se.jsx)(jt.Ay,{ids:j.ids,name:j.name,onClose:()=>y(null)})]})}));var _n=n(71581);const zn=(0,Ge.A)(fe.A),Hn=e=>{let{children:t,tabId:n,...r}=e;const[o,,i,s]=(0,pe.A)(),l=(0,b.vt)(),a=(0,v.ID)();return(0,se.jsxs)(re.Flex,{alignItems:"end",justifyContent:"between",width:"100%",background:"mainBackground",padding:[0,0,0,4],border:{side:"bottom",size:"1px",type:"solid",color:"borderSecondary"},...r,children:[t,(0,se.jsxs)(re.Flex,{alignItems:"center",padding:[2,3],gap:2,children:[o&&(0,se.jsx)(je.A,{onClose:s}),(0,se.jsx)(We,{spaceId:l,roomId:a,tabId:n}),(0,se.jsx)(zn,{"data-ga":"add-nodes::click-add-nodes::hm-nodes-table","data-testid":"nodesTable-addNode",icon:"nodes_hollow",label:"Add Nodes",onClick:i,small:!0,flavour:"hollow"})]})]})},Kn=e=>{let{allNodes:t,activeTabId:n,onTabChange:o,children:i}=e;const s=(0,_n.yT)(t),l=(0,r.useMemo)((()=>{const e=s.findIndex((e=>e.id===n));return e>=0?e:0}),[n,s]),a=(0,r.useCallback)((e=>{const t=s[e];t&&o&&o(t.id)}),[s,o]),c=(0,r.useMemo)((()=>e=>(0,se.jsx)(Hn,{...e,tabId:n})),[n]);return(0,se.jsx)(re.Tabs,{selected:l,onChange:a,height:"100%",padding:[4,4,2],TabsHeader:c,gap:4,children:s.map(((e,t)=>(0,se.jsx)(re.Tab,{label:(0,se.jsx)(re.Text,{color:t===l?"primary":"menuItem",children:e.label}),"data-testid":`nodes-tab-${e.id}`,padding:[2,4],maxWidth:"100%",green:!0,children:i},e.id)))})},Wn=e=>{let{tabId:t,filteredIds:n,totalCount:r}=e;const o=(0,_n.K3)(t),i=o?.label||"Nodes",s=(0,E.BU)(n).length,l=(0,E.Ig)(n).length,a=(0,E.GE)(n).length;return(0,se.jsxs)(re.Flex,{"data-testid":"nodes-view-stats-header",width:"100%",height:"44px",justifyContent:"between",alignItems:"center",background:"mainBackground",padding:[0,3],border:"border",round:!0,children:[(0,se.jsxs)(re.Text,{strong:!0,children:["Total ",i,": ",r]}),(0,se.jsxs)(re.Flex,{alignItems:"center",gap:4,children:[(0,se.jsxs)(re.Flex,{alignItems:"center",gap:2,children:[(0,se.jsx)(re.Flex,{width:2,height:2,round:"50%",background:yn.P.live.indicatorWrapperColor}),(0,se.jsxs)(re.Text,{children:["Live: ",s]})]}),(0,se.jsxs)(re.Flex,{alignItems:"center",gap:2,children:[(0,se.jsx)(re.Flex,{width:2,height:2,round:"50%",background:yn.P.stale.indicatorWrapperColor}),(0,se.jsxs)(re.Text,{children:["Stale: ",l]})]}),(0,se.jsxs)(re.Flex,{alignItems:"center",gap:2,children:[(0,se.jsx)(re.Flex,{width:2,height:2,round:"50%",background:yn.P.offline.indicatorWrapperColor}),(0,se.jsxs)(re.Text,{children:["Offline: ",a]})]})]})]})},Gn=["config"],qn=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),n=(0,D.nj)(),o=(0,E.dG)(),i=(e=>{const t=(0,v.ID)(),n=(0,O.Cq)(t,e),o=lt[n];return(0,r.useCallback)((e=>{const t=o?.(e);return{name:t,priority:st[n]?.[t],icon:"nodeStatus"===n?`connectivityStatus${t}`:null}}),[n,o])})(o),s=(0,O.Cq)(t,o),l=(0,E.TL)(),a=(0,_.w7)({extraKey:`nodesView-${o}`,merge:!1,scoped:!0}),c=(0,E.Gt)(),d=(0,_n.On)(o),u=(0,r.useMemo)((()=>c.reduce(((e,t)=>(d(t)||e.push(t.id),e)),[])),[d,c]),h=(0,E.Y7)(),[g,{width:m}]=(0,R.A)(),p=(0,ee.K)({spaceId:e,roomId:t}),[f,j,y]=Q(a,t,{shouldHide:et.f9?d:void 0,cacheKey:o,extraKey:`nodesView-${o}`});!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],{host:n,width:o,tabId:i="servers",flavour:s="nodesView"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const l=(0,Et.eg)(),a=(0,r.useMemo)((()=>{if(!l)return;let r=Ht(l,e);if(r)return r;o&&(r=l.makeContainer({attributes:{host:n,enabledXAxis:!1,id:`nodes-${e}`,height:"75px",groupingMethod:"average",groupBy:["dimension"],aggregationMethod:"avg",legend:!1,axisLabelFontSize:7,yAxisLabelWidth:20,hasYlabel:!1,nodesScope:t,containerWidth:o}}),l.appendChild(r))}),[e,i,o]),{favoriteNodeIds:c}=zt(s,i),d=(0,Ce.vh)(e,i);(0,r.useMemo)((()=>{if(!et.f9)return;if(!a||!t?.length&&!c?.length)return;const e=d.reduce(((e,t)=>{if(!t.context)return e;const n=t.aggregation||"sum";return e[n]||(e[n]=new Set),e[n].add(t.context),e}),{});[...t,...c].forEach((t=>{Object.entries(e).forEach((e=>{let[n,r]=e;const o=`table-metrics-${t}-${n}`;let i=a.getNode({id:o});if(i&&(s=new Set(i.getAttribute("contextScope")),c=r,s.size===c.size&&[...s].every((e=>c.has(e)))))return;var s,c;i?.destroy();const d=Array.from(r);0!==d.length&&(i=l.makeChart({attributes:{id:o,contextScope:d,nodesScope:[t],aggregationMethod:n,groupingMethod:"average",groupBy:["label","dimension","context","node"],groupByLabel:["device"],tableColumns:["context","dimension"],chartLibrary:"table",points:1}}),a.appendChild(i))}))})),l.trigger("nodesContainerUpdated")}),[a,t,c,n,l,i,o,d])}(t,f,{host:p,width:m,tabId:o,flavour:"nodesView"});const[w,C]=(0,H.N9)("nodeIdToGo",{key:t,extraKey:"nodesView",flavour:"val"}),I=(0,r.useCallback)((e=>{l(e)}),[l]),A=(0,r.useCallback)((function(e,t){return function(e,t){let{getGrouping:n,extraKey:r,searchScores:o,groupMode:i}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s={},l={};((e,t)=>{let{getNode:n,getGrouping:r,nodeMenus:o,menusById:i,searchScores:s}=t;e.forEach((e=>{const t=n(e);if(!t)return;const{name:i,priority:s,icon:l}=r(t);o[e]={...t,groupId:i,subMenuId:e,priority:s,groupIcon:l}})),[...e].sort(((e,t)=>{const n=s?.[e]||0,r=s?.[t]||0;if(r!==n)return r-n;const i=(o[e]?.priority||0)-(o[t]?.priority||0);if(0!==i)return i;const l=(o[e]?.groupId||"").localeCompare(o[t]?.groupId||"",void 0,{sensitivity:"accent",ignorePunctuation:!0});return 0!==l?l:(o[e]?.name||"").localeCompare(o[t]?.name||"",void 0,{sensitivity:"accent",ignorePunctuation:!0})})).forEach((e=>{const t=o[e];if(!t)return;const n=`${t.groupId}|${t.subMenuId}`;i[t.groupId]||(i[t.groupId]={byId:{},nodeIds:[]}),i[t.groupId].byId[n]||(i[t.groupId].byId[n]={byId:{},nodeIds:[]}),i[t.groupId].byId[n].nodeIds.push(t.id),i[t.groupId].nodeIds.push(t.id)}))})(e,{getNode:t,getGrouping:n,nodeMenus:s,menusById:l,searchScores:o});const a=Object.keys(l).reduce(((e,t)=>{const{nodeIds:n}=l[t],o=s[n[0]];return e[t]={level:0,name:o.groupId,id:t,childrenIds:n,link:`${(0,Ze.A)(`menu_${t}`)}`,size:24,forceVisibility:!0,icon:o.groupIcon,extraKey:r,styleProps:{important:!1,grouping:!0}},n.forEach((n=>{const o=s[n],i=Qe.u[o.os?.nm||o.labels?.os_name]||Qe.U[o.os?.id]||Qe.u[o.labels?.vendor];e[n]={...o,level:1,id:n,menuId:t,link:`${(0,Ze.A)(`menu_${t}_submenu_${n}`)}`,size:24,forceVisibility:!0,icon:i?.iconName||i?.logoFilename&&`${x.A.assetsBaseURL}/img/logos/os/${i.logoFilename}`||"os",extraKey:r}})),e}),{}),c=Object.keys(l);let d=-1;const u=c.reduce(((e,t)=>{if(d+=1,!et.f9){const n={...a[t],sticky:!0};return[...e,n,...a[t].childrenIds.reduce(((e,t)=>(d+=1,[...e,a[t]])),[])]}return i?[...e,{...a[t],isGroup:!0,children:a[t].childrenIds.reduce(((e,t)=>(d+=1,[...e,a[t]])),[])}]:[...e,...a[t].childrenIds.reduce(((e,t)=>(d+=1,[...e,a[t]])),[])]}),[]);return s=null,l=null,{stickyIds:{},allElements:u,menuIds:c,menuById:a}}(e,t,{...arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},searchScores:j})}),[j]);return(0,se.jsx)(te.A,{getObject:h,ids:f,getMenu:A,getGrouping:i,groupMode:s,deps:[i,j,o,s],extraKey:"nodesView",children:(0,se.jsx)(V.A,{ref:g,position:"relative",sidebar:(0,se.jsx)(ne.Ay,{hiddenTabs:Gn,nodeIds:u,title:"Nodes",initialChartName:w,viewFlavour:"nodesView",flavour:`nodesView-${o}`,loaded:!0,FilterInputContainer:he,extraKey:`nodesView-${o}`}),children:!!m&&(0,se.jsxs)(se.Fragment,{children:[!et.f9&&(0,se.jsx)(Ye,{}),!et.f9&&n&&!f.length&&a.length?(0,se.jsx)(me,{}):et.f9?(0,se.jsxs)(Kn,{allNodes:c,activeTabId:o,onTabChange:I,nodesCount:y,children:[(0,se.jsx)(Wn,{tabId:o,filteredIds:f,totalCount:y}),(0,se.jsx)(En,{nodeIdsLoaded:n,nodeIds:f,tabNodeIds:u,initialChartName:w,onChartNameChange:C,tabId:o,flavour:"nodesView"})]}):(0,se.jsx)(sn,{initialChartName:w,onChartNameChange:C})]})})})},Un=()=>{const e=(0,v.ID)(),t=(0,D.CK)();return(0,D.gr)(e,"loaded")&&!t.length?(0,se.jsx)(P.Ay,{feature:"NodesView",mode:"NoNodesView",children:(0,se.jsx)(B.A,{})}):(0,se.jsx)(P.Ay,{feature:"NodesView",children:(0,se.jsx)(qn,{})})},Jn=()=>{const e=(0,E.nl)(),t=(0,E.xY)(e,"name");return(0,T.ZB)({title:t,id:e,destination:e,tooltip:{title:t,description:"Monitor and analyze metrics, alerts, and performance for this specific node in your infrastructure."}}),null};var Xn=n(258);var Yn=n(98545),Zn=n(6196),Qn=n(1705),er=n(2626),tr=n(41716),nr=n(65448);const rr=function(e,t){let{polling:n=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=(0,p.yF)((0,r.useCallback)((function(e,n){let{data:r=[]}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n((0,tr.t)({id:t,key:"ids"}),r.map((e=>e.id))),n((0,tr.t)({id:t,key:"loaded"}),!0),n((0,tr.t)({id:t,key:"updatedAt"}),(new Date).toISOString()),n((0,tr.t)({id:t,key:"error"}),null),n(Zn.Ay,(e=>r.reduce(((e,t)=>(e[t.id]={...e[t.id],loaded:!0,...t},e)),e)));const o=r.reduce(((e,t)=>{let{id:n,nodeId:r}=t;return e[r]=[...e[r]||[],n],e}),{});n(er.l3,o)}),[e,t])),i=(0,p.yF)((0,r.useCallback)(((e,n,r)=>{n((0,tr.t)({id:t,key:"error"}),(0,nr.A)(r))}),[]));(0,j.A)((()=>({enabled:!!e&&!!t,polling:n,pollingOptions:{checkPauseCondition:N},fetch:()=>(0,Qn.l1)(e,t),onFail:i,onReceive:o,force:!0})),[e,t])},or=function(e,t){let{polling:n=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=(0,p.yF)((0,r.useCallback)((function(n,r){let{data:o=[]}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r((0,Zn.xz)({spaceId:e,roomId:t}),(e=>({...e,loaded:!0,value:o,updatedAt:(new Date).toISOString(),error:null})))}),[e,t])),i=(0,p.yF)((0,r.useCallback)(((n,r,o)=>{r((0,Zn.xz)({spaceId:e,roomId:t}),(e=>({...e,loaded:!0,error:(0,nr.A)(o)})))}),[]));(0,j.A)((()=>({enabled:!!e&&!!t,polling:n,pollingOptions:{checkPauseCondition:N},fetch:()=>(0,Qn.qM)(e,t),onFail:i,onReceive:o,force:!0})),[e,t])};var ir=n(6387),sr=n(65380);const lr=e=>t=>`histogram::${e.getAttribute("id")}::${t}`,ar=e=>{let{container:t,...n}=e;const o=(0,Et.eg)(),i=(0,r.useMemo)((()=>{if(!t)return null;let e=t.getNode({id:"dummy-chart"});return e||(e=o.makeChart({attributes:{id:"dummy-chart",chartLibrary:"dygraph",sparkline:!0,hasToolbox:!1,hasHoverPopover:!1,contextScope:["anomaly_detection.anomaly_rate"],aggregationMethod:"max",postAggregationMethod:"max",postgroupBy:["selected"],showPostAggregations:!0,groupingMethod:"max",expandable:!1,chartType:"stacked",colors:[["#DBE1E1","#353F3F"]],showAnomalies:!1,showAnnotations:!1,overlays:{latestTime:{type:"latestTime"}}},makeTrack:lr}),t.appendChild(e),e)}),[t]);return(0,r.useEffect)((()=>()=>i&&i.destroy()),[i]),(0,se.jsx)(re.Flex,{flex:!1,width:"100%",height:5,position:"sticky",bottom:"0",left:"0",right:"0",children:(0,se.jsx)(Gt.A,{"data-chartid":"dummy-chart",chart:i,overflow:"hidden",hasHeader:!1,hasFooter:!1,hasFilters:!1,tile:!1,...n,round:0})})};var cr=n(55093),dr=n(77148),ur=n(38773);const hr=()=>(0,se.jsxs)(re.Flex,{padding:[6],round:1,width:"600px",background:"modalInfoBackground",children:[(0,se.jsx)(re.Box,{margin:[0,4,0,0],children:(0,se.jsx)(re.Box,{as:re.Icon,width:10,height:10,name:"nodes_update"})}),(0,se.jsxs)(re.Flex,{column:!0,gap:2,children:[(0,se.jsx)(re.Text,{strong:!0,children:"Couldn't find the chart you were looking for? "}),(0,se.jsxs)(re.Text,{color:"textDescription",children:["Netdata has zero-configuration auto-detection for most applications and systems, this is achieved using collectors. If you miss some specific chart please check our"," ",(0,se.jsx)(xe.A,{href:"https://learn.netdata.cloud/docs/agent/collectors",target:"_blank","data-ga":"chart-area::click-link-collectors::charts-view",children:"list of collectors"})," ","to see if any additional step is needed."]})]})]}),xr=()=>(0,se.jsxs)(re.Flex,{width:"100%",column:!0,gap:6,margin:[8,0,0,0],children:[(0,se.jsx)(dr.A,{}),(0,se.jsxs)(re.Flex,{gap:1,alignItems:"center",justifyContent:"center",padding:[2],background:"successSemi",children:[(0,se.jsx)(Sn.A,{children:(0,se.jsx)(re.Text,{color:"primary",children:"Upgrade to Business for unlimited access"})}),(0,se.jsx)(re.Text,{children:"or"}),(0,se.jsx)(ur.A,{children:(0,se.jsx)(re.Text,{color:"primary",children:"review your Space active Nodes"})})]})]}),gr=e=>{let{noPreferredNodesError:t,children:n}=e;return(0,se.jsxs)(re.Flex,{column:!0,flex:!0,justifyContent:"center",alignItems:"center",alignSelf:"center",children:[(0,se.jsxs)(re.Flex,{column:!0,justifyContent:"center",alignItems:"center",width:"300px",margin:[0,0,6],children:[(0,se.jsx)(re.H3,{margin:[0,0,4],children:"No charts to display"}),(0,se.jsx)(re.Text,{color:"textDescription",textAlign:"center",children:"Double-check your search or filters and dates and try again with different conditions."})]}),(0,se.jsx)(hr,{}),t&&(0,se.jsx)(xr,{}),n]})};var mr=n(93997);const pr=()=>{const[e,t]=(0,mr.sK)(),n=(0,v.ID)(),o=(0,b.vt)(),i=(0,_.w7)(),s=(0,r.useCallback)((0,ae.s)(300,(e=>{const r=e.target.value;t(r),(0,oe.H)("toc-search","search-automatic-trigger","charts-view",r),r&&(0,Xn.Xx)(n,r,{selectedNodes:i,spaceId:o}).then((e=>{console.log("Context search results:",e)})).catch((e=>{console.error("Context search error:",e)}))})),[n,o,i]),[l,a,,,{resetValue:c}]=(0,re.useInputValue)({value:e,onChange:s}),d=(0,r.useCallback)((()=>{t(""),c(),(0,oe.H)("toc-search","clear-search-button","charts-view")}),[]);return(0,se.jsx)(re.TextInput,{value:l,onChange:a,size:"small",iconRight:l&&(0,se.jsx)(re.Icon,{name:"x",color:"textLite",cursor:"pointer",size:"small",onClick:d,"data-testid":"filterChartsInput-clearButton"}),placeholder:"Search charts",name:"Search charts","data-testid":"filterChartsInput",containerStyles:{width:"100%"}})};var fr=n(61841);const jr=(0,ae.s)(300,((e,t)=>(0,oe.H)("toc-search","search-results","charts-view",e,`${t} -- charts`))),br=()=>{const e=(0,f.Zp)(),[t]=(0,fr.Ay)(),n=(0,mr.Um)(),{filteredChartsCount:o,chartsCount:i}=(0,mr.Ad)();(0,r.useEffect)((()=>{n&&jr(n,o)}),[n,o]);const s=(0,r.useCallback)((n=>{n.preventDefault(),e(`/spaces/${t}/settings/configurations`,{replace:!0})}),[t,e]);return(0,se.jsxs)(re.Flex,{alignItems:"center",justifyContent:"between",width:"100%",children:[(0,se.jsxs)(re.TextMicro,{color:"textLite",margin:[1,0,0],"data-testid":"numberOfChartsIndication",children:["Showing"," ",(0,se.jsx)(re.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfChartsIndication-filteredChartsCount",children:o})," ","of total"," ",(0,se.jsx)(re.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfChartsIndication-chartsCount",children:i})," ","charts"]}),(0,se.jsx)(xe.A,{Component:re.TextMicro,margin:[1,0,0],"data-ga":`toc-search::click-link-collectors::${name}`,onClick:s,target:"_blank",rel:"noopener noreferrer",children:"Add more charts"})]})},vr=()=>{const{filteredChartsCount:e}=(0,mr.Ad)();return e||null===e?null:(0,se.jsxs)(re.Flex,{width:"100%",gap:1,margin:[4,0,0],padding:[2],alignItems:"center","data-testid":"noResultsWereFound",children:[(0,se.jsx)(re.Icon,{name:"information",color:"textDescription"}),(0,se.jsx)(re.TextMicro,{strong:!0,color:"textDescription",children:"No results were found"})]})};var yr=n(14512);const wr=()=>(0,se.jsxs)(re.Flex,{column:!0,alignItems:"center",children:[(0,se.jsx)(pr,{}),(0,se.jsx)(br,{}),(0,se.jsx)(yr.A,{}),(0,se.jsx)(vr,{})]}),Cr=e=>{let{width:t=443,height:n=249,videoId:r,...o}=e;return(0,se.jsx)(re.Flex,{...o,children:(0,se.jsx)(re.Box,{className:"video-responsive",children:(0,se.jsx)("iframe",{width:t,height:n,src:`https://www.youtube.com/embed/${r}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:"Embedded youtube"})})})};var Ir=n(58218),Ar=n(14815);const kr=()=>{const e=(0,v.ID)(),t=(0,g.JT)("node:Create");return(0,se.jsxs)(V.A,{column:!1,"data-testid":"noNodesViewPage",gap:12,padding:[6],children:[(0,se.jsxs)(re.Flex,{column:!0,gap:5,flex:{shrink:0,grow:0},"data-testid":"noKubernetesView-videoSection",children:[(0,se.jsx)(Cr,{"data-testid":"noNodesView-onboardingVideo",height:350,width:850,videoId:Ne.BX[0]}),(0,se.jsx)(Cr,{"data-testid":"noNodesView-onboardingVideo",height:350,width:850,videoId:Ne.BX[1]})]}),(0,se.jsxs)(re.Flex,{column:!0,gap:4,children:[(0,se.jsxs)(re.Box,{border:{side:"bottom",color:"borderSecondary"},children:[(0,se.jsx)(re.Box,{margin:[0,0,2,0],children:(0,se.jsx)(xe.A,{href:"https://learn.netdata.cloud/docs/netdata-agent/installation/kubernetes",target:"_blank",rel:"noopener noreferrer","data-ga":"k8s-tab::click-link-guides::kubernetes-overview-and-visualizations",children:(0,se.jsx)(re.TextBig,{color:"primary",children:"Kubernetes monitoring with Netdata: Overview and visualizations"})})}),(0,se.jsx)(re.Box,{margin:[0,0,2,0],children:(0,se.jsx)(xe.A,{href:"https://learn.netdata.cloud/docs/dashboards-and-charts/kubernetes-tab",target:"_blank",rel:"noopener noreferrer","data-ga":"k8s-tab::click-link-guides::kubernetes-visualizations",children:(0,se.jsx)(re.TextBig,{color:"primary",children:"Kubernetes visualizations"})})})]}),(0,se.jsx)(re.Flex,{column:!0,gap:4,children:t?(0,se.jsx)(Ir.A,{integrationId:Ar.v2,rooms:[e]}):(0,se.jsx)(B.S,{})})]})]})};var Sr=n(67012),Tr=n(77611);const Mr=dn.default.div.withConfig({displayName:"selections__Separator",componentId:"sc-1cc7y18-0"})(["width:1px;height:",";background:",";"],(0,re.getSizeBy)(2.5),(0,re.getColor)("borderSecondary")),Fr=[{label:"Volume",value:"volume"},{label:"KS2",value:"ks2"}],Nr=[{label:"Average",value:"average"},{label:"Median",value:"median"},{label:"Min",value:"min"},{label:"Max",value:"max"},{label:"Stddev",value:"stddev"}],Lr=[{label:"Metrics",value:""},{label:"Anomaly Rate",value:"anomaly-bit"}],$r=()=>(0,se.jsxs)(re.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:[(0,se.jsx)(re.TextMicro,{children:"Choose the algorithm you want to be used to identify correlations across metrics:"}),(0,se.jsxs)(re.TextMicro,{children:[(0,se.jsx)(re.TextMicro,{strong:!0,children:"KS2:"})," A statistical test comparing the distribution of the highlighted window to the baseline."]}),(0,se.jsxs)(re.TextMicro,{children:[(0,se.jsx)(re.TextMicro,{strong:!0,children:"Volume:"})," Percentage change in averages between highlighted window and baseline."]})]}),Dr=()=>(0,se.jsx)(re.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:(0,se.jsx)(re.TextMicro,{children:"What aggregation function do you want to apply when aggregating multiple datapoints for metric correlations."})}),Br=()=>(0,se.jsx)(re.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:(0,se.jsx)(re.TextMicro,{children:"Do you want to find correlations over the metric values or the anomaly rates of each metric."})}),Pr=e=>{let{runGetWeights:t,nodeIds:n,flavour:o}=e;const{method:i,options:s,group:l}=(0,Tr.G9)({nodeIds:n,flavour:o}),a=s?.includes(Lr[1].value)?Lr[1].value:"",c=(0,r.useCallback)((e=>n=>{let{value:r}=n;r="options"!==e?r:r?[r]:[];t({method:i,options:[s],group:l,[e]:r})}),[i,s,l]),d=(0,r.useMemo)((()=>({method:Fr.find((e=>e.value===i)),group:Nr.find((e=>e.value===l)),option:Lr.find((e=>e.value===a))})),[i,l,a]);return l?(0,se.jsxs)(re.Flex,{gap:2,children:[(0,se.jsxs)(re.Flex,{gap:1,alignItems:"center",children:[(0,se.jsx)(re.TextSmall,{color:"textLite",children:"Method:"}),(0,se.jsx)(re.Select,{options:Fr,value:d.method,onChange:c("method")}),(0,se.jsx)(Oe.A,{isBasic:!0,plain:!0,content:$r,align:"bottom",children:(0,se.jsx)(re.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,se.jsx)(Mr,{}),(0,se.jsxs)(re.Flex,{gap:1,alignItems:"center",children:[(0,se.jsx)(re.TextSmall,{color:"textLite",children:"Aggregation:"}),(0,se.jsx)(re.Select,{options:Nr,value:d.group,onChange:c("group")}),(0,se.jsx)(Oe.A,{isBasic:!0,plain:!0,content:Dr,align:"bottom",children:(0,se.jsx)(re.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,se.jsx)(Mr,{}),(0,se.jsxs)(re.Flex,{gap:1,alignItems:"center",children:[(0,se.jsx)(re.TextSmall,{color:"textLite",children:"Data:"}),(0,se.jsx)(re.Select,{options:Lr,value:d.option,onChange:c("options")}),(0,se.jsx)(Oe.A,{isBasic:!0,plain:!0,content:Br,align:"bottom",children:(0,se.jsx)(re.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,se.jsx)(Mr,{})]}):null};var Rr=n(64587);const Vr=e=>{let{highlightAfter:t,highlightBefore:n,baseline:r}=e;const{localeDateString:o,localeTimeString:i}=(0,Rr.$j)(),s=new Date(t),l=new Date(n),a=new Date(r),c=new Date(t),d=Math.round((n-t)/1e3),u=Math.round((t-r)/1e3),h=(0,H.rI)("highlight");return(0,se.jsxs)(re.Flex,{gap:4,alignItems:"center",children:[(0,se.jsxs)(re.Flex,{gap:2,children:[(0,se.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,se.jsx)(re.TextSmall,{color:"textLite",children:"Selected area:"}),(0,se.jsx)(re.TextSmall,{color:"textLite",children:"Reference baseline:"})]}),(0,se.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,se.jsxs)(re.TextSmall,{"data-testid":"metricCorrelation-selectedArea",children:[o(s,{long:!1}),","," ",i(s),"\xa0->\xa0",o(l,{long:!1}),","," ",i(l)]}),(0,se.jsxs)(re.TextSmall,{"data-testid":"metricCorrelation-referenceBaseline",children:[o(a,{long:!1}),","," ",i(a),"\xa0->\xa0",o(c,{long:!1}),","," ",i(c)]})]}),(0,se.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,se.jsx)(re.TextSmall,{color:"textLite",children:"Duration:"}),(0,se.jsx)(re.TextSmall,{color:"textLite",children:"Duration:"})]}),(0,se.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,se.jsxs)(re.TextSmall,{"data-testid":"metricCorrelation-selecteArea-duration",children:[d,"\xa0secs"]}),(0,se.jsxs)(re.TextSmall,{"data-testid":"metricCorrelation-referenceBaseline-duration",children:[u,"\xa0secs"]})]})]}),(0,se.jsx)(Oe.A,{content:"Clear selection",align:"bottom",isBasic:!0,children:(0,se.jsx)(re.Button,{neutral:!0,flavour:"borderless",icon:"trashcan",onClick:()=>{h({after:null,before:null})},"data-ga":"metric-correlation::click-delete::charts-view","data-testid":"metricCorrelation-delete"})})]})},Or=(0,Ge.A)(re.Button),Er=(0,dn.default)(re.Button).withConfig({displayName:"correlation__LogoButton",componentId:"sc-15d72m3-0"})(["&&{pointer-events:none;}"]),_r=(0,dn.default)(re.Button).withConfig({displayName:"correlation__CloseButton",componentId:"sc-15d72m3-1"})(["position:absolute !important;top:-3px;right:-3px;"]),zr=(0,Ge.A)(_r),Hr=(0,dn.default)(re.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;}"]),Kr=e=>{let{flavour:t}=e;const n=(0,b.vt)(),o=(0,v.ID)(),i=(0,E.nl)(),s=(0,r.useMemo)((()=>i?[i]:[]),[i]),l=(0,_.w7)({extraKey:"nodesView",merge:!1,scoped:!0}),a="singleNode"===t?s:l,[c,d]=(0,r.useState)(!1),[u,h]=(0,r.useState)(),{threshold:x,totalDimensionsCount:g,dimensionsCount:m,loaded:p,loading:f,getWeights:j,resetWeights:y}=(0,Tr.Yy)({nodeIds:a,flavour:t},n,o),{method:w,options:C,group:I}=(0,Tr.G9)({nodeIds:a,flavour:t}),{after:A,before:k}=(0,H.rW)("highlight"),S=A-4*(k-A),T=!!A;(0,r.useEffect)((()=>{if(p){let e="default-result";if(I){const t=C?.includes("anomaly-bit")?"anomaly-bit":"metrics";e=`default-result-${w}-${I}-${t}`}return(0,oe.H)("metrics-correlation",e,"charts-view",m.toString())}}),[p]),(0,Sr.A)((()=>{A&&d(!0)}),[A]);const M=(0,H.rI)("correlation"),F=(0,H.rI)("threshold"),N=(0,H.rI)("highlight"),L=(0,r.useCallback)((()=>{M(!1),N({after:null,before:null}),F(Tr.UG),y(),(0,oe.H)("metrics-correlation","click-close","charts-view",""+(p?"finish":"start"))}),[M,N,F,y,p]),$=(0,r.useCallback)((()=>{F(Tr.UG),y(),(0,oe.H)("metrics-correlation","click-delete","charts-view",""+(p?"finish":"start"))}),[F,y,p]),D=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d(!1),h(),j({highlightAfter:A,highlightBefore:k,baselineAfter:S,baselineBefore:A,method:w,options:C,group:I,nodeIds:a,...e}).then((()=>F(Tr.UG)))},B=!T||f;return(0,Sr.A)((()=>{p&&c&&T&&D()}),[p,T,c]),(0,r.useEffect)((()=>()=>y()),[]),(0,se.jsxs)(re.Flex,{round:2,background:"elementBackground",padding:[2,6,2,2],margin:[2,0],alignItems:"center",justifyContent:"between",flex:!0,"data-testid":"correlation",position:"relative",height:{min:"64px"},gap:2,children:[T?p?(0,se.jsx)(P._0,{feature:"MetricCorrelations",totalDimensionsCount:g,dimensionsCount:m,children:(0,se.jsxs)(re.Flex,{"data-testid":"metricCorrelation-resultsContainer",column:!0,width:"100%",children:[(0,se.jsxs)(re.Flex,{justifyContent:"between",alignItems:"center",gap:1,children:[(0,se.jsxs)(re.Flex,{alignItems:"center",gap:1,children:[(0,se.jsx)(re.Icon,{name:"correlation",color:"primary",width:"16px",height:"16px"}),(0,se.jsxs)(re.TextSmall,{children:["Analysed"," ",(0,se.jsx)(re.TextSmall,{color:"primary","data-testid":"metricCorrelation-resultsAnalyzed",children:g})," ","and found"," ",(0,se.jsx)(re.TextSmall,{color:"primary","data-testid":"metricCorrelation-resultsFound",children:m})," ","correlated metrics."]}),(0,se.jsx)(Oe.A,{content:"Clear results",children:(0,se.jsx)(Hr,{flavour:"borderless",neutral:!0,disabled:f||!p&&!T,onClick:$,"data-testid":"metricCorrelation-clear",small:!0,icon:"reload"})})]}),(0,se.jsx)(Pr,{runGetWeights:D,nodeIds:a,flavour:t})]}),(0,se.jsxs)(re.Flex,{width:"100%",children:[(0,se.jsxs)(re.Flex,{alignItems:"center",gap:3,margin:[0,2,0,5],width:"100%",children:[(0,se.jsx)(re.TextNano,{whiteSpace:"nowrap",color:"textDescription",children:"Show less"}),(0,se.jsx)(re.InputRange,{"data-testid":"metricCorrelation-resultsSlider",min:0,max:1,onChange:e=>F(e.target.value.toString()),onClick:()=>(0,oe.H)("metric-correlation","click-slider","charts-view"),step:.01,value:x}),(0,se.jsx)(re.TextNano,{whiteSpace:"nowrap",color:"textDescription",children:"Show more"})]}),(0,se.jsx)(se.Fragment,{children:(0,se.jsx)(Oe.A,{content:"Give us your feedback! Was it useful?",align:"bottom",enterDelay:200,showArrow:!0,activateOn:"hover",children:(0,se.jsxs)(re.Flex,{children:[(0,se.jsx)(re.Button,{flavour:"+"===u?"hollow":"borderless",disabled:u,icon:"thumb_up",onClick:()=>h("+"),"data-ga":"metric-correlation::click-thumbs-up::charts-view","data-testid":"metricCorrelation-thumbsUp",small:!0}),(0,se.jsx)(re.Button,{flavour:"-"===u?"hollow":"borderless",disabled:u,icon:"thumb_down",onClick:()=>h("-"),"data-ga":"metric-correlation::click-thumbs-down::charts-view","data-testid":"metricCorrelation-thumbsDown",small:!0})]})})})]})]})}):(0,se.jsxs)(re.Flex,{alignItems:"center","data-testid":"correlationView-timePeriod-container",gap:4,children:[(0,se.jsx)(Er,{icon:"logo_s",isLoading:f}),f?(0,se.jsx)(re.H5,{"data-testid":"metricCorrelation-loadingCalculation",children:"Calculating metric correlations..."}):(0,se.jsx)(Vr,{highlightAfter:A,highlightBefore:k,baseline:S})]}):(0,se.jsxs)(re.Flex,{alignItems:"center",gap:1,children:[(0,se.jsx)(re.Icon,{name:"correlation",color:"primary"}),(0,se.jsx)(re.Text,{children:"Select a timeframe on any chart and find correlated metrics. Visit documentation"}),(0,se.jsx)("a",{href:"https://learn.netdata.cloud/docs/cloud/insights/metric-correlations",target:"_blank",rel:"noreferrer",children:(0,se.jsx)(re.Icon,{name:"nav_arrow_goto",color:"primary",width:"12px",height:"12px"})})]}),(0,se.jsxs)(re.Flex,{alignItems:"center",children:[(!p||f)&&(0,se.jsx)(Oe.A,{content:B?"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",children:(0,se.jsx)(Or,{label:f?"Loading...":"Find correlations",isLoading:!1,onClick:D,disabled:B,flavour:"hollow","data-ga":"metric-correlation::click-find-correlation::charts-view","data-testid":"metricCorrelation-find",small:!0,margin:[0,2,0,0],feature:"MetricCorrelations"})}),(0,se.jsx)(Oe.A,{content:"Close",align:"bottom",children:(0,se.jsx)(zr,{neutral:!0,flavour:"borderless",onClick:L,"data-ga":"metric-correlation::click-close::charts-view","data-testid":"metricCorrelation-close",icon:"x",feature:"MetricCorrelations"})})]})]})},Wr=e=>{let{children:t}=e;return(0,se.jsxs)(re.Flex,{"data-testid":"selected-nodes-container",gap:1,alignItems:"center",width:"100%",children:[(0,se.jsx)(re.Flex,{alignItems:"center",children:(0,se.jsx)(re.TextSmall,{whiteSpace:"nowrap","data-testid":"selected-nodes-container-message",color:"primary",children:"Selected filters:"})}),(0,se.jsx)(re.Flex,{height:{max:50},overflow:{vertical:"auto"},padding:[1],gap:1,alignItems:"center",flexWrap:!0,children:t})]})},Gr=(0,r.memo)(Wr),qr=e=>{let{onRemove:t}=e;return(0,se.jsx)(re.Box,{"data-testid":"remove-button",as:re.Icon,name:"close_circle",onClick:t,cursor:"pointer",width:3,height:3,color:"textLite"})},Ur=e=>{let{removeFilter:t,group:n,id:r,value:o,isAnchorDisabled:i,onClick:s,ref:l}=e;const[a,c]=o.split("|"),d=c?`${a} > ${c}`:a;return(0,se.jsx)(re.Flex,{ref:l,"data-testid":`selected-node-item-${r}`,children:(0,se.jsx)(re.Pill,{flavour:"neutral",hollow:!0,children:(0,se.jsxs)(re.Flex,{position:"relative",gap:2,alignItems:"center",children:[s?(0,se.jsx)(xe.A,{Component:re.TextSmall,disabled:i,onClick:s,cursor:"pointer",color:"text",hoverColor:"primary",visitedColor:"accent",disabledColor:"textLite",children:d}):(0,se.jsx)(re.TextSmall,{children:d}),(0,se.jsx)(qr,{onRemove:()=>t({param:n,removedValue:r}),id:r})]})})})},Jr=(0,r.memo)(Ur),Xr={selectedNodeIds:"Node",nodeStatuses:"Status",nodeLabels:"Host label",nodeCapabilities:"Capability",nodeVersions:"Version"},Yr=e=>{let{group:t,subGroup:n,groupLabel:o,values:i,filtersByLabel:s={},hasUnion:l,union:a="AND",removeFilter:c,Component:d=Jr}=e;const u=o||Xr[t];if(!Array.isArray(i)||!i.length)return null;const h="nodeLabels"!==t||n?{}:s,x=Object.entries(h);return x.length?x.map(((e,n)=>{let[r,o]=e;return(0,se.jsx)(Yr,{group:t,subGroup:r,groupLabel:`${Xr[t]} ${r}`,values:o,hasUnion:n>0,removeFilter:c},n)})):(0,se.jsxs)(r.Fragment,{children:[l&&(0,se.jsx)(re.TextSmall,{strong:!0,children:a}),(0,se.jsxs)(re.Pill,{flavour:"neutral",hollow:!0,gap:1,TextComponent:re.Flex,textProps:{alignItems:"center",gap:1},flexWrap:!0,children:[(0,se.jsxs)(re.TextNano,{strong:!0,children:[u,":"]}),i.map(((e,o)=>(0,se.jsxs)(r.Fragment,{children:[o>0&&(0,se.jsx)(re.TextSmall,{strong:!0,children:"OR"}),(0,se.jsx)(d,{removeFilter:c,id:n?`${n}|${e}`:e,value:e,group:t})]},e)))]})]},"filter")},Zr=e=>{let{removeFilter:t,value:n,ref:r}=e;const o=(0,E.xY)(n,"name"),i=(0,E.xY)(n,"isOffline"),s=(0,E.d3)(n);return(0,se.jsx)(Jr,{ref:r,removeFilter:t,group:"selectedNodeIds",id:n,value:o,isAnchorDisabled:i,onClick:s})},Qr=(0,r.memo)((e=>{let{flavour:t}=e;const[[n,r=[]],o]=(0,_._e)({extraKey:t,merge:!1});if(!n.length&&!r.length)return(0,se.jsx)("div",{});const i=(0,_.Pt)(n);return(0,se.jsx)(re.Flex,{width:"100%",overflow:"hidden",padding:[2,0],children:(0,se.jsxs)(Gr,{children:[n.map(((e,t)=>{let[n,r]=e;return(0,se.jsx)(Yr,{group:n,values:r,filtersByLabel:i,hasUnion:t>0,removeFilter:o},n)})),(0,se.jsx)(Yr,{group:"selectedNodeIds",values:r,hasUnion:!!n.length&&!!r.length,union:"OR",removeFilter:o,Component:Zr})]})})}));var eo=n(88434);const to={overview:Qr,default:null},no=(0,r.memo)((e=>{let{flavour:t,...n}=e;const{showCorrelation:r}=(0,eo.A)(),o=to[t]||to.default;return(0,se.jsx)(re.Flex,{alignItems:!r&&"center",background:"mainBackground",column:r,"data-testid":"overview-header",gap:2,justifyContent:r?"start":"between",padding:[0,2,0,4],width:"100%",children:r?(0,se.jsx)(Kr,{flavour:t}):!!o&&(0,se.jsx)(o,{...n,flavour:t})})})),ro=no;var oo=n(27024),io=n(98591),so=n(47213);const lo=e=>{let{id:t,contexts:n,menuId:r,parentIds:o,...i}=e;const s=(0,Ae.bD)();return(0,so.q)(s)(n,r||t,o)?(0,se.jsx)(dt.h,{id:t,...i,children:(0,se.jsx)(ut.$,{id:t,hasTooltip:!0,flavour:i.extraKey,enableFavourites:!0,level:i.level,descendantIds:i.descendantIds,selfChartIds:i.selfChartIds})}):null},ao=(0,r.memo)(lo);var co=n(5020),uo=n(80744),ho=n(64156),xo=n(28973),go=n(1817),mo=n(2404),po=n.n(mo),fo=n(52795),jo=n(23565);const bo=(0,W.eU)(null),vo=()=>{const e=(0,Et.eg)(),t=(0,K.md)(bo);return e&&e.getRoot().getChildren().find((e=>e.match({id:t})))},yo=e=>t=>`overview-page::${e.getAttribute("id")}::${t}`;var wo=n(54251),Co=n(77679);const Io={},Ao=(e,t,n)=>{const o=(0,v.ID)(),[i,s]=(0,Co.w)(),l=i?s:o,a=(0,H.rW)("contextSearchFilters",{key:l,extraKey:"chartFilters",flavour:"obj",defaultValue:Io});return(0,r.useMemo)((()=>{const r=Array.isArray(e)?e:[e];if(!r.length||!r[0])return null;const o=t?[t,...n||[]]:[];if(0===o.length)return null;const i={dimensions:[],instances:[],labels:[]};o.forEach((e=>{const t=a[e];t&&r.forEach((e=>{const n=t[e];if(!n)return;(Array.isArray(n)?n:[n]).forEach((e=>{switch(e.matchType){case"dimensions":i.dimensions.includes(e.value)||i.dimensions.push(e.value);break;case"instances":e.instanceName&&(i.instances.includes(e.instanceName)||i.instances.push(e.instanceName));break;case"labels":i.labels.includes(e.value)||i.labels.push(e.value)}}))}))}));return i.dimensions.length>0||i.instances.length>0||i.labels.length>0?i:null}),[a,e,t,n])},ko=[],So=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{selectedDimensions:e.dimensions?Object.keys(e.dimensions):ko,selectedInstances:e.instances?Object.keys(e.instances):ko,selectedNodes:e.nodes?Object.keys(e.nodes):ko,weight:e.weight}},To=e=>{let{style:t,handleProps:n,attributes:o,listeners:i,dragging:s,dragOverlay:l,id:a,resizeHandle:c,onChangeHeight:d,onRemove:u,expanded:h,ref:x,menuId:g,subMenuId:m,parentIds:p,...f}=e;const j=(0,r.useRef)({}),b=(0,v.ID)(),y=vo(),{contextScope:w,...C}=(0,ln.aA)(a),I=(0,Et.eg)(),{sendLog:A,isReady:k}=(0,Zt.A)(),S=(0,jo.CS)({type:"chart",entity:w?w.join(","):a,path:"/"}),T=Ao(w,m||g,p),M=(0,r.useMemo)((()=>{if(!y)return null;let e=y.getNode({id:l?`dragOverlay-${a}`:a});const t=(0,fo.A)(S,!0);if(e)return j.current=(0,fo.A)({...e.getAttributes(),...e.getAttribute("pristine"),pristine:{}}),T&&!po()(e.getAttribute("prevMatches"),T)&&e.setAttributes({selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...T.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...T.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...T.labels||[]])),prevMatches:T}),e;e=I.makeChart({attributes:{id:l?`dragOverlay-${a}`:a,roomId:b,expandable:!0,...C,contextScope:w,expanded:h,toolboxProps:{drag:{...n,...i,...o}}},makeTrack:yo}),y.appendChild(e),j.current=(0,fo.A)(e.getAttributes());const r=e.getAttribute("chartLibrary");return e.setAttributes({...j.current,...t,...T&&!po()(e.getAttribute("prevMatches"),T)&&{selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...T.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...T.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...T.labels||[]])),prevMatches:T}}),(0,wo.A)(e,r,e.getAttribute("chartLibrary")),e}),[y,b,a,l]);(0,r.useLayoutEffect)((()=>{M&&k&&"function"===typeof A&&M.updateAttribute("logOptions",{sendLog:A,payload:{feature:"Overview"}})}),[M,A,k]);const{weight:F,selectedDimensions:N,selectedInstances:L,selectedNodes:$}=(0,ln.uy)(w.join("|"),So),D=(0,go.A)(S),B=(0,go.A)(T,!0),P=(0,go.A)(N.length),R=(0,go.A)(L.length),V=(0,go.A)($.length);return(0,Sr.A)((()=>{if(!M)return;const e=M.getAttribute("chartLibrary"),t={};if(!F||P===N.length&&R===L.length&&V===$.length?S&&!po()(D,S)&&Object.assign(t,{...j.current,...(0,fo.A)(S,!0)}):Object.assign(t,{selectedDimensions:N,selectedInstances:L,selectedNodes:$}),T&&!po()(B,T)){const e=M.getAttributes();Object.assign(t,{selectedDimensions:Array.from(new Set([...e.selectedDimensions||[],...t.selectedDimensions||[],...T.dimensions||[]])),selectedInstances:Array.from(new Set([...e.selectedInstances||[],...t.selectedInstances||[],...T.instances||[]])),selectedLabels:Array.from(new Set([...e.selectedLabels||[],...t.selectedLabels||[],...T.labels||[]])),prevMatches:T})}Object.keys(t).length>0&&(M.updateAttributes(t),(0,wo.A)(M,e,M.getAttribute("chartLibrary")),M.trigger("fetch"))}),[M,b,a,S,T,F,N.length,L.length,$.length]),(0,r.useLayoutEffect)((()=>{M&&t&&(M.updateAttributes({height:t.height,width:t.width}),M.trigger("resize"))}),[M,t.height,t.width]),(0,r.useLayoutEffect)((()=>{if(M)return(0,xo.unregister)(M.onAttributeChange("expanded",(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e===(arguments.length>1&&void 0!==arguments[1]&&arguments[1]))return;const{expandedHeight:t}=M.getAttributes();d(a,(e?1:-1)*t)})))}),[M]),(0,Sr.A)((()=>{M&&M.updateAttributes({toolboxProps:{drag:{...n,...i,...o,dragging:s}}})}),[M,s]),M?(0,se.jsxs)(re.Box,{ref:x,style:t,children:[(0,se.jsx)(Gt.A,{chart:M,"data-chartid":l?`dragOverlay-${a}`:a,"data-track":M.track("container"),height:t.height,width:"100%"}),c]},y&&y.getId()):null},Mo=(0,r.memo)(To,((e,t)=>e.id===t.id&&e.style===t.style)),Fo=function(){let{id:e,layout:t={},contextScope:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,co.bP)(e,t,{left:0,top:0,width:12,height:6,id:e,chartId:e,...t,minWidth:12,maxWidth:12,minHeight:4,static:!1,dashboardable:!0,contextScope:n})},No=e=>{let{id:t,menuId:n,subMenuId:o,parentIds:i,containerWidth:s,...l}=e;const a=(0,ln.aA)(t,Fo),c=(0,Ae.bD)(),d=(0,so.q)(c),[u,h]=(0,r.useState)((()=>[a])),x=(e,t)=>{(0,co.Q)(t),h(e)},g=(0,r.useRef)(1),m=(e,t)=>{const n=u.findIndex((t=>t.id===e));-1!==n&&(u[n]={...u[n],height:u[n].height+t/uo.NA,expanded:t>0},x([...u],u[n]),g.current+=1)},p=(0,ho.A)("(max-width: 767px)"),f=(0,r.useMemo)((()=>(g.current+=1,u.filter((e=>{if(!e)return!1;const t=e.contextScope||[e.chartId]||0;return d(t,o||n,i)})))),[u,d,o,n,i]),j=(0,r.useMemo)((()=>e=>{let{id:t,...r}=e;return(0,se.jsx)(Mo,{id:t,role:"graphics-object","aria-roledescription":"chart","data-menuid":o||n,menuId:n,subMenuId:o,onChangeHeight:m,parentIds:i,...r},t)}),[o,n,i]);return(0,se.jsx)(uo.Ay,{cacheId:g.current,rootId:t,containerId:t,onDragEnd:x,items:f,containerWidth:s-(p?16:26),"data-menuid":o||n,...l,Item:j,rearrangeable:!0})},Lo=(0,r.memo)(No);var $o=n(54025),Do=n(63996);const Bo=e=>{let{id:t,contexts:n,menuId:r,parentIds:o,extraKey:i,descendantIds:s,level:l,selfChartIds:a}=e;const c=(0,Ae.bD)();return(0,so.q)(c)(n,r||t,o)?(0,se.jsx)($o.t,{gap:0,id:t,testId:"chart-sub-menu-container-overview",children:(0,se.jsx)(Do.t,{id:t,margin:[1,0,0],hasTooltip:!0,flavour:i,enableFavourites:!0,level:l,descendantIds:s,selfChartIds:a})}):null},Po=(0,r.memo)(Bo);var Ro=n(4719);const Vo=e=>{let{id:t}=e;const n=(0,v.ID)(),o=(0,Et.eg)(),i=(0,ln.Vt)(),{chartIds:s}=(0,Ro.b)(t),l=vo(),a=(0,r.useMemo)((()=>{const[e]=s;let r=l.getChildren().find((e=>e.match({id:t})));if(r)return r;const a=s.map((e=>({value:e,label:i(e).context})));return r=o.makeChart({attributes:{id:`custom-k8s-map-${t}`,contextScope:[e],roomId:n,composite:!0,chartLibrary:"groupBoxes",groupBy:["label"],groupByLabel:["k8s_namespace","k8s_pod_name"],aggregationMethod:"avg",eliminateZeroDimensions:!1,contextItems:a,toolboxElements:[]},makeTrack:yo}),l.appendChild(r),r}),[t,l]);return(0,se.jsx)(Gt.A,{margin:[0,0,2],chart:a,"data-chartid":t,"data-track":a.track("container")},l.getId())},Oo=e=>{let{id:t,...n}=e;return(0,se.jsxs)(dt.h,{id:t,padding:[6,0,0],children:[(0,se.jsx)(ut.$,{id:t}),(0,se.jsx)(ht.n,{id:t,padding:[2,0,0]}),(0,se.jsx)(Vo,{id:t,...n})]})},Eo=(0,r.memo)(Oo);n(37550);const _o=[],zo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{selectedDimensions:e.dimensions?Object.keys(e.dimensions):_o,selectedInstances:e.instances?Object.keys(e.instances):_o,selectedNodes:e.nodes?Object.keys(e.nodes):_o,weight:e.weight}},Ho=(0,ln.BK)((e=>{let{style:t,id:n,menuChartAttributes:o,resizeHandle:i,handleProps:s,listeners:l,dragging:a,dragOverlay:c,onChangeHeight:d,expanded:u,ref:h,menuId:x,subMenuId:g,parentIds:m}=e;const p=(0,r.useRef)({}),f=(0,v.ID)(),j=(0,Et.eg)(),b=vo(),y=(0,jo.CS)({type:"chart",entity:n,path:"/"}),w=Ao(o.contextScope,g||x,m),C=(0,r.useMemo)((()=>{let e=b.getChildren().find((e=>e.match({id:c?`dragOverlay-${n}`:n})));const t=(0,fo.A)(y,!0);if(e)p.current=(0,fo.A)({...e.getAttributes(),...e.getAttribute("pristine")}),w&&!po()(e.getAttribute("prevMatches"),w)&&e.setAttributes({selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...w.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...w.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...w.labels||[]])),prevMatches:w});else{e=j.makeChart({attributes:{expandable:!0,...o,roomId:f,id:c?`dragOverlay-${n}`:n,isHead:!0,expanded:u},makeTrack:yo,toolboxProps:{drag:{...s,...l}}}),p.current=(0,fo.A)(e.getAttributes());const r=e.getAttribute("chartLibrary");e.setAttributes({...p.current,...t,...w&&po()(e.getAttribute("prevMatches"),w)&&{selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...w.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...w.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...w.labels||[]])),prevMatches:w}}),(0,wo.A)(e,r,e.getAttribute("chartLibrary")),b.appendChild(e)}return e}),[f,n,b]),{weight:I,selectedDimensions:A,selectedInstances:k,selectedNodes:S}=(0,ln.uy)(o.contextScope?.join("|"),zo),T=(0,go.A)(y),M=(0,go.A)(w,!0,po()),F=(0,go.A)(A.length),N=(0,go.A)(k.length),L=(0,go.A)(S.length);(0,Sr.A)((()=>{if(!C)return;const e={},t=C.getAttribute("chartLibrary");if(!I||F===A.length&&N===k.length&&L===S.length?y&&!po()(T,y)&&Object.assign(e,{...p.current,...(0,fo.A)(y,!0)}):Object.assign(e,{selectedDimensions:A,selectedInstances:k,selectedNodes:S}),w&&!po()(M,w)){const t=C.getAttributes();Object.assign(e,{selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...e.selectedDimensions||[],...w.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...e.selectedInstances||[],...w.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...e.selectedLabels||[],...w.labels||[]])),prevMatches:w})}Object.keys(e).length>0&&(C.updateAttributes(e),(0,wo.A)(C,t,C.getAttribute("chartLibrary")),C.trigger("fetch"))}),[C,f,n,y,w,I,A.length,k.length,S.length]),(0,r.useLayoutEffect)((()=>{C.updateAttributes({toolboxProps:{drag:{...s,...l,dragging:a}}})}),[C,a]),(0,r.useLayoutEffect)((()=>{if(C)return(0,xo.unregister)(C.onAttributeChange("expanded",(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e===(arguments.length>1&&void 0!==arguments[1]&&arguments[1]))return;const{expandedHeight:t}=C.getAttributes();d(n,(e?1:-1)*t)})))}),[C]),(0,Sr.A)((()=>{if(!C)return;const e=parseFloat(t.height);e&&!isNaN(e)&&(C.updateAttribute("height",e),C.trigger("resize"))}),[t.height]);return(0,Ae.Bu)(o.contextScope)?(0,se.jsxs)("div",{ref:h,style:t,children:[(0,se.jsx)(Gt.A,{chart:C,"data-track":C.track("container"),"data-chartid":c?`dragOverlay-${n}`:n,height:t.height,width:"100%"}),i]},b.getId()):null})),Ko=(e,t,n)=>(e.layout||console.warn(t,"has no layout set, default values will be used."),(0,co.bP)(t,e.layout,{left:n%2,top:4*parseInt(n/2),width:6,height:4,id:e.id,contextScope:e.contextScope,minWidth:1,minHeight:1,static:!1,dashboardable:!0})),Wo=(0,r.memo)((e=>{let{itemIds:t,containerWidth:n,id:o,subMenuId:i,menuId:s,parentIds:l}=e;const a=(0,ln.dd)(t,Ko),{filteredChartsCount:c}=(0,mr.Ad)(),d=(0,ho.A)("(max-width: 767px)"),u=(0,Ae.bD)(),h=(0,so.q)(u),[x,g]=(0,r.useState)((()=>a)),m=(e,t)=>{(0,co.Q)(t),g(e)},p=(0,r.useRef)(1),[f,j]=(0,r.useState)(!1),b=(0,r.useMemo)((()=>t.some((e=>null!==localStorage.getItem(`chart_layout/${e}`)))),[t]),v=(0,r.useCallback)((()=>{t.forEach((e=>{localStorage.removeItem(`chart_layout/${e}`)})),p.current+=1,g(a)}),[t,a]);(0,r.useEffect)((()=>{const e=()=>{p.current+=1,g(a)};return window.addEventListener("resetChartLayout",e),()=>window.removeEventListener("resetChartLayout",e)}),[a,d]);const y=(0,r.useMemo)((()=>(p.current+=1,x.filter((e=>!!e&&(!!e.contextScope&&h(e.contextScope,s,l)))))),[t,x,c,h,s,l]);return y.length?(0,se.jsxs)(re.Flex,{position:"relative",width:"100%",onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),children:[f&&b&&(0,se.jsx)(re.Flex,{position:"absolute",top:2,right:2,zIndex:10,background:"dropdown",round:1,padding:[1],border:!0,children:(0,se.jsx)(Oe.A,{content:"Reset all charts to default layout",align:"left",children:(0,se.jsx)(re.IconButton,{icon:"refresh",onClick:v,flavour:"borderless",padding:[1],"data-testid":"grid-reset-layout-button"})})}),(0,se.jsx)(uo.Ay,{cacheId:p.current,rootId:o,containerId:o,"data-chartid":o,"data-menuid":i||s,onDragEnd:m,items:y,containerWidth:n-(d?16:26),gridTracks:d?1:12,Item:Ho,rearrangeable:!0,itemProps:{onChangeHeight:(e,t)=>{const n=x.findIndex((t=>t.id===e));-1!==n&&(x[n]={...x[n],height:x[n].height+t/uo.NA,expanded:t>0},m([...x],x[n]),p.current+=1)},menuId:s,subMenuId:i,parentIds:l},compactType:"vertical"})]}):null}),((e,t)=>e.itemIds===t.itemIds&&e.containerWidth===t.containerWidth)),Go={k8s:Eo,root:ao,submenu:Po,chart:Lo,grid:Wo},qo=e=>{if(Go[e.flavour])return Go[e.flavour];switch(e.level){case 0:return ao;case 1:return Po;case 2:return Lo;default:return null}},Uo=e=>{let{flavour:t,onChartNameChange:n,initialChartName:r,dashboardOptions:o,linkToGo:i,contextToGo:s,containerWidth:l}=e;const[a,,,c]=(0,io.A)("addToDashboardModal"),{setActiveMenuId:d}=(0,at.A)({onChartNameChange:n,initialChartName:r,linkToGo:i,contextToGo:s}),u=(0,Ae.bD)(),h=(0,so.q)(u);return(0,se.jsxs)(te.H,{children:[(0,se.jsx)(ct.A,{flavour:t,onActiveMenuId:d,getComponent:qo,dashboardOptions:o,initialChartName:r,containerWidth:l,checkVisibility:h}),a&&(0,se.jsx)(oo.A,{onClose:c})]})};var Jo=n(19075);const Xo=(0,r.memo)((()=>{const[e,t]=(0,Jo.KB)(),n=(0,Et.eg)(),o=!!e&&!!n&&n.getNode({id:e.context}),i=()=>{if(t(null),!e?.context||!o)return;const n={...o.getAttribute("overlays")};delete n.alert,o.updateAttribute("overlays",n),history.replaceState({},"")};(0,r.useEffect)((()=>i),[]);const s=(0,v.ID)(),l=(0,Ae.R7)(e?.context&&s,e?.context);if(!e||!l?.loaded)return null;const{firstEntry:a}=l;return(0,se.jsx)(re.Layer,{backdrop:!1,position:"top",margin:[26,0,0],padding:[26,0,0],children:(0,se.jsxs)(re.Flex,{background:"tooltip",padding:[1,2],gap:2,children:[(0,se.jsxs)(re.TextSmall,{children:["Showing alert in ",(0,se.jsx)(re.TextSmall,{strong:!0,children:e.instance})," on"," ",(0,se.jsx)(re.TextSmall,{strong:!0,children:new Date(1e3*e.lastStatusChange).toLocaleString()}),!a&&" doesn't exist on the node anymore",!!a&&a>e.lastStatusChange&&" exceeds agent data retention settings"]}),(0,se.jsx)(re.Flex,{flex:!1,children:(0,se.jsx)(re.Icon,{name:"x",color:"tooltipText",onClick:i,size:"small"})})]})})})),Yo=Xo;var Zo=n(14070);const Qo={NoChartsView:gr,NoNodesView:B.A,sidebar:{title:"Filters",hiddenTabs:["info"],Component:ne.Ay,props:{}},dashboardOptions:{},loadingMessage:"Loading charts...",Header:ro},ei={overview:{...Qo,sidebar:{...Qo.sidebar,title:"Metrics"},feature:"Overview"},k8s:{...Qo,NoChartsView:kr,NoNodesView:kr,sidebar:{...Qo.sidebar,title:"Kubernetes"},loadingMessage:"Loading k8s charts...",feature:"Kubernetes"},singleNode:{...Qo,sidebar:{...Qo.sidebar,title:"Single Node",hiddenTabs:["filters"],props:{showCollapsed:!0}},feature:"SingleNode"}},ti=()=>((0,sr.A)(),null),ni=(0,r.memo)((e=>{let{flavour:t="overview",invalidationKey:n,nodeIds:r,loaded:o,getChart:i,chartIds:s,areChartsIdsEmpty:l,showNoChartsView:a,showNoNodesView:d,initializing:u,chartName:h,setChartName:x,chartsLoaded:g,widthRef:m,containerWidth:p,nodesKey:j,blurred:b,blurProps:v={},BlurredContent:y,noPreferredNodesError:w}=e;const{dashboardOptions:C,NoChartsView:I,NoNodesView:A,sidebar:k,Header:S,feature:T="Overview"}=ei[t],{state:M}=(0,f.zy)(),[F,,,N]=(0,Zo.A)(),L=vo();return d?(0,se.jsx)(P.Ay,{feature:T,mode:"NoNodesView",children:(0,se.jsx)(A,{})}):u?(0,se.jsx)(cr.A,{title:"Please wait while charts are being initialized.",body:"Thank you for your patience!"}):o?(0,se.jsx)(P.Ay,{feature:T,children:(0,se.jsxs)(te.A,{getObject:i,ids:s,linkToGo:M?.chartName,extraKey:t,deps:[j],children:[(0,se.jsx)(ti,{}),(0,se.jsx)(Yo,{}),(0,se.jsxs)(V.A,{ref:m,sidebar:(0,se.jsx)(k.Component,{nodeIds:r,title:k.title,initialChartName:h,hiddenTabs:k.hiddenTabs,flavour:t,loaded:g,FilterInputContainer:wr,...k.props}),blurred:b,blurProps:v,BlurredContent:y,children:[(0,se.jsx)(S,{flavour:t}),g||w?a||l?(0,se.jsx)(I,{noPreferredNodesError:w}):(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(Uo,{flavour:t,dashboardOptions:C,initialChartName:h,onChartNameChange:x,linkToGo:M?.chartName,contextToGo:M?.contextToGo,containerWidth:p}),F&&N]}):(0,se.jsx)(c.O2,{}),(0,se.jsx)(ar,{container:L})]})]},n)}):(0,se.jsx)(c.O2,{})})),ri=ni,oi=e=>t=>{const n=(0,E.nl)(),o=(0,r.useMemo)((()=>[n]),[n]);return(0,se.jsx)(e,{flavour:"singleNode",nodeIds:o,nodeId:n,...t},n)};var ii=n(64867),si=n(12407),li=n(17829);var ai=n(13752),ci=n(92815),di=n(72582),ui=n(82650),hi=n(78072),xi=n(95980),gi=n(91832),mi=n(6504),pi=n(22332),fi=n(12897),ji=n.n(fi),bi=n(55042),vi=n.n(bi),yi=new(ji())({id:"alarm_bell",use:"alarm_bell-usage",viewBox:"0 0 12 14",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 14" id="alarm_bell"><path d="M11.45 8.11A2.61 2.61 0 0 1 10 5.77V5c0-1.97-1.44-3.6-3.31-3.93 0-.02.01-.04.01-.07 0-.39-.31-.7-.7-.7s-.7.31-.7.7c0 .02.01.05.01.07C3.44 1.4 2 3.03 2 5v.76c0 1-.55 1.9-1.45 2.34L0 8.38v2.82c0 .99.81 1.8 1.8 1.8H5c0 .55.45 1 1 1s1-.45 1-1h3.2c.99 0 1.8-.81 1.8-1.8V8.38zM11 11.2c0 .44-.36.8-.8.8H1.8c-.44 0-.8-.36-.8-.8V10h5.5c.55 0 1-.45 1-1H1c1.23-.61 2-1.87 2-3.24V5c0-1.66 1.34-3 3-3s3 1.34 3 3v.76c0 1.37.77 2.62 2 3.24z" /></symbol>'});vi().add(yi);const wi=yi,Ci=(0,dn.default)(re.Icon).withConfig({displayName:"styled__StyledAlertDot",componentId:"sc-12w0ym-0"})(["position:absolute;top:0;right:-1px;width:6px;height:6px;"]);var Ii=n(96026);const Ai=(0,Bt.A)((e=>{let{alertName:t,close:n,tooltip:o,...i}=e;const[,s]=(0,Zo.A)(),{sendLog:l}=(0,Zt.A)(),a=(0,r.useCallback)((e=>{e.stopPropagation(),s({alertName:t}),l({feature:"MetricsChartManageAlerts",description:"Show alert",alertName:t}),n()}),[t,s,n,l]);return(0,se.jsx)(re.IconButton,{icon:"goToNode",iconColor:"textLite",onClick:a,neutral:!0,padding:[0],width:"16px",height:"16px",...i})})),ki=(0,Bt.A)((e=>{let{alertName:t,nodes:n,close:o,tooltip:i,...s}=e;const{goToEdit:l}=(0,Ii.q)({alertName:t,nodeIds:n}),{sendLog:a}=(0,Zt.A)(),c=(0,r.useCallback)((e=>{e.stopPropagation(),a({feature:"MetricsChartManageAlerts",description:"Edit alert",alertName:t}),l(),o()}),[n,o,l,a]);return(0,se.jsx)(re.IconButton,{icon:"pencilOutline",iconColor:"textLite",onClick:c,neutral:!0,padding:[0],width:"12px",height:"12px",...s})})),Si=e=>{let{item:{value:t,label:n,alerts:r={},nodes:o,onClick:i,...s},index:l,style:a,close:c,onItemClick:d,...u}=e;const{cl:h=0,cr:x=0,wr:g=0}=r,m={text:x,flavour:x?"error":"disabledError"},p={text:g,flavour:g?"warning":"disabledWarning"},f={text:h,flavour:h?"clear":"disabledClear"};return(0,se.jsxs)(re.MenuItemContainer,{"data-index":l,onClick:e=>{i&&i(e)},...s,...u,style:a,alignItems:"center",justifyContent:"between",gap:2,padding:[1,2],overflow:"hidden",cursor:"default",children:[(0,se.jsx)(re.Flex,{width:{max:"180px"},alignItems:"center",children:(0,se.jsx)(Jt.A,{text:n,TextComponent:re.Text})}),(0,se.jsxs)(re.Flex,{alignItems:"center",gap:1,children:[(0,se.jsx)(re.MasterCard,{pillLeft:m,pillRight:p,pillEnd:f}),(0,se.jsx)(Ai,{alertName:t,close:c,tooltip:"Show alert instances",tooltipProps:{align:"bottom"}}),(0,se.jsx)(ki,{alertName:t,nodes:o,close:c,disabled:!o.length,tooltip:o.length?"Edit this alert configuration":"This alert is no longer configured in any node",tooltipProps:{align:"bottom"}})]})]})};var Ti=n(39423);const Mi={events:{extraKey:"feedFilters",page:"events",alertNamesKey:"alert_names",period:{after:-n(71336).d_,before:0}},alerts:{extraKey:"alerts",page:"alerts",alertNamesKey:"alertNames"}},Fi=function(){let{flavour:e="events"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,v.ID)(),n=(0,f.Zp)(),[o,i]=(0,fr.Ay)(),s=(0,Jo.le)(),[,l]=(0,Jo.DV)(),a=(0,H.rI)(),{extraKey:c,page:d,alertNamesKey:u,period:h}=Mi[e]||Mi.events,x={defaultValue:[],key:t,extraKey:c,flavour:"arr",merge:!1},g=(0,H.rI)("alertContexts",x),m=(0,H.rI)(u,x),p=(0,H.rI)("chart_names",x),j=(0,r.useCallback)((e=>{let{name:t}=e;s(1),l({alertName:t,nodeId:null}),n(`/spaces/${o}/rooms/${i}/alerts`,{replace:!0})}),[n,o,i,s,l]),b=(0,r.useCallback)((e=>{let{context:t,name:r,instance:s}=e;h&&a((e=>({...e,...h}))),t&&g([t]),r&&m([r]),s&&p([s]),n(`/spaces/${o}/rooms/${i}/${d}`)}),[n,d,h,o,i,a,g,m,p]);return{goToAlerts:b,goToAlertConfigurations:j}},Ni=(0,Ge.A)((0,Bt.A)(re.Button)),Li=e=>{let{loaded:t,contexts:n=[],close:o,onAddAlertClick:i}=e;const s=(0,pi.useChart)().getId(),l=n?.[0],{setSelectedTab:a}=(0,Ti.A)(),[c,d]=(0,fr.Ay)(),{goToAlerts:u}=Fi({flavour:"alerts"}),h=(0,r.useMemo)((()=>l?`View the active alerts for ${l} context`:"View the active alerts for this context"),[l]),x=(0,r.useCallback)((()=>{l&&(a(0),o(),u({context:l}))}),[l,u,a,c,d,o]),g=(0,r.useCallback)((()=>{i(),o()}),[i,o]);return(0,se.jsxs)(re.Flex,{gap:2,padding:[2],border:{side:"top"},justifyContent:"center",children:[(0,se.jsx)(Ni,{feature:"MetricsChartManageAlerts",label:"Go to alerts",small:!0,flavour:"hollow",icon:"goToNode",onClick:x,tooltip:h,tooltipProps:{align:"bottom"},payload:{chartId:s},disabled:!l||!t}),(0,se.jsx)(Ni,{feature:"MetricsChartManageAlerts",label:"Add alert",small:!0,icon:"plus",onClick:g,tooltip:`Start adding a new alert on ${l} context`,tooltipProps:{align:"bottom"},payload:{chartId:s},disabled:!l||!t})]})};var $i=n(11520);const Di=e=>{let{disabled:t}=e;const n=(0,pi.useChart)(),o=(0,E.ss)(),{loaded:i,items:s,status:l}=(e=>{const[t,n]=(0,r.useState)(),[o,i]=(0,r.useState)([]),[s,l]=(0,r.useState)([]),[a,c]=(0,r.useState)(),d=(0,Jo.SU)();return(0,r.useEffect)((()=>{const t=()=>{const t=e.getAttribute("alerts"),r=Object.values(t||{}),o=Object.keys(e.getAttribute("nodes")||{});n(!0),i(r),l(o);for(let e=0;e<=r.length;e++){const{wr:t=0,cr:n=0}=r[e]||{};if(n>0){c("error");break}if(t>0){c("warning");break}}};return e&&e.on("successFetch",t),()=>{e&&e.off("successFetch",t)}}),[e,n,i,l,c]),{loaded:t,items:(0,r.useMemo)((()=>[...o.map((e=>{let{nm:t,cl:n,wr:r,cr:o}=e;const i=(d||[]).filter((e=>e.name===t)).map((e=>{let{nd:t}=e;return t}));return{value:t,label:t,alerts:{cl:n,wr:r,cr:o},nodes:i}}))]),[o,s]),status:a}})(n),a=n.getAttribute("contextScope"),[,c]=(0,$i.A)(),d=(0,r.useCallback)((()=>{const{selectedNodes:e,selectedInstances:t,labels:r,selectedLabels:o,contextScope:i}=n.getAttributes(),s=n.getUnitSign(),l=o.length?o:Object.entries(r).reduce(((e,t)=>{let[n,r]=t;return r.vl.forEach((t=>{let{id:r}=t;e.push(`${n}:${r}`)})),e}),[]);c({chart:i[0],viewUnits:s,...(t||[]).length?{instances:t}:{},...(e||[]).length?{nodes:e}:{},...l?{labels:l}:{}})}),[n,o,c]);return n?(0,se.jsx)(re.Menu,{dropProps:{align:{top:"bottom",right:"right"},"data-toolbox":n.getId()},dropdownProps:{width:"360px"},Item:Si,items:s,Footer:e=>{let{close:t}=e;return(0,se.jsx)(Li,{loaded:i,contexts:a,close:t,onAddAlertClick:d})},children:(0,se.jsxs)(re.Flex,{alignItems:"center",position:"relative",children:[l?(0,se.jsx)(Ci,{name:"dot",color:l}):null,(0,se.jsx)(mi.Button,{icon:(0,se.jsx)(mi.default,{svg:wi,size:"16px"}),title:"Manage alerts",disabled:t,"data-testid":"chartHeaderToolbox-manageAlerts"})]})}):null},Bi=(e,t,n)=>{let{width:o,host:i}=n;if(!i)throw"No host provided";const s=(0,Et.eg)(),l=(0,r.useRef)(),a=(0,Ae.aZ)(e,"error"),[{correlation:c},d]=(0,H.N9)(),{state:u,pathname:h}=(0,f.zy)(),x=(0,K.Xr)(bo),g=(0,Ae.jI)(e),m=(0,Ae.DQ)(e);(0,r.useLayoutEffect)((()=>{if(!e||!s||a)return;let n=s.getRoot().getChildren().find((e=>e.match({id:h})));if(!n)return n=s.makeContainer({attributes:{id:h,roomId:e,host:i,navigation:c?"highlight":"pan",overlays:{proceeded:{type:"proceeded"}},composite:!0,nodesScope:t,hasCorrelation:!0,versions:g,containerWidth:o,toolboxElements:[...et.Dm?[Di]:[],hi.default,di.default,ai.default,ci.default,ui.default,gi.A,xi.A]}}),s.appendChild(n),x(h),l.current=n,(0,xo.unregister)(s.on("correlation",((e,t)=>{if(!Array.isArray(t))return;const[n,r]=t;d((e=>({...e,highlight:{after:1e3*n,before:1e3*r},correlation:!0})))})),n.onAttributeChange("versions",m));x(h)}),[e,a,h,i]),(0,r.useMemo)((()=>{l.current&&(l.current.setAttribute("containerWidth",o),l.current.getNodes().forEach((e=>e.updateAttribute("containerWidth",o))))}),[l.current,o]),(0,Sr.A)((()=>{l.current&&l.current.setAttribute("host",i)}),[l.current,i]),(0,Sr.A)((()=>{l.current&&l.current.getNodes().forEach((e=>{e.updateAttribute("nodesScope",t);e.getAttribute("active")&&"chart"===e.type&&e.fetch()}))}),[l.current,t]),(0,r.useEffect)((()=>{l.current&&l.current.getApplicableNodes({syncHighlight:!0}).forEach((e=>{e.updateAttribute("navigation",c?"highlight":"pan")}))}),[l.current,c]),(0,r.useEffect)((()=>()=>l.current&&l.current.destroy()),[]),(0,r.useEffect)((()=>{if(!l.current)return;if(!u||!u.context)return;const{context:e,chartId:t,nodeId:n}=u,r=l.current.getNode({id:e});r&&r.updateAttributes({selectedInstances:[`${t}@${n}`],selectedNodes:[n]});const o=t&&n&&l.current.on("chartLoaded",(r=>{const i=r.getAttribute("id");e===i&&(r.updateAttributes({selectedInstances:[`${t}@${n}`],selectedNodes:[n]}),o())}));return()=>u&&(0,xo.unregister)(o)}),[l.current,u])};var Pi=n(43116);const Ri={default:{shouldHide:()=>!1},k8s:{shouldHide:e=>{let{context:t}=e;return!t.includes("k8s")}}},Vi=[],Oi="ErrNoPreferredNodeRequested",Ei=e=>(0,r.memo)((t=>{let{flavour:n="overview",nodeIds:o=Vi,nodeId:i,...s}=t;const l=(0,b.vt)(),a=(0,v.ID)(),c=(0,v.XA)("nodeId");i=i||c;let d=(0,_.w7)({extraKey:n,merge:!1,scoped:!0});d=o.length?o:d;const{isNodeRestricted:u,loaded:h}=(0,en.A)();d=(0,r.useMemo)((()=>d.filter((e=>!u(e).restricted))),[d,h]);const x=(0,D.nj)(),g=(0,Ae._0)(a),{state:m}=(0,f.zy)(),p=(0,Ae.R7)(a),j=(0,E.TG)(d),y=(0,Ie.A)(a,d,{spaceId:l}),{contexts:w,metadata:C,loaded:I,dimensionsCount:A}=(0,Tr.Yy)({nodeIds:d,flavour:n},l,a),[,k]=(()=>{const{state:e={}}=(0,f.zy)(),{alertId:t=null}=e||{},[n,o]=(0,Jo.KB)(),i=t||n?.id,s=(0,Jo.JL)(i);(0,Jo.yk)(s.id),(0,r.useEffect)((()=>{(s.fullyLoaded||s.id)&&o({...s,formattedLastStatusChangeValue:(0,li.m3)(s.lastStatusChangeValue,s.units),linkToGo:(0,Ze.A)(s.context)})}),[s.id,s.fullyLoaded]);const l=n?.id?(0,Ze.A)(n.context):null;return[s.id,l]})(),S=o?o.join():n,T=(0,ee.K)({spaceId:l,roomId:a}),[M,{width:F}]=(0,R.A)();Bi(a,d,{host:T,width:F});const N=(0,Ae.OL)(a),L=(0,Ae.rx)(a),$=I?C:p,B=Ri[n]||Ri.default,P=(0,Ae.bo)(a),V=(0,go.A)(P),O=(0,mr.rq)(N,p,a,{...B,shouldHide:I?e=>{let{context:t}=e;return!w.includes(t)}:B.shouldHide,force:I||P!==V,cacheKey:`${n}-${A}-${S}`}),z=(0,Ae.yO)(a,C),K=(0,go.A)(y,!0),W=O<1,[G,q]=(0,H.N9)("chartName",{key:a,extraKey:S,flavour:"val"});(0,r.useEffect)((()=>{a&&q(k||m?.chartName||G)}),[a,k]);const U=vo(),J=Object.keys($).length<1&&g||d.length&&!j.length,X=(0,D.CK)(),Y=L?.errorMsgKey==Oi;if(!J&&!1!==K&&y&&"No data for this period"!==y&&y!==Oi&&!Object.keys($).length)return(0,se.jsx)(Pi.A,{error:y});const Z=!!a&&x&&(!!U||Y),{restricted:Q}=u(i);return(0,se.jsx)(e,{nodeIds:j,loaded:Z,getChart:z,areChartsIdsEmpty:W,showNoNodesView:x&&!X.length,showNoChartsView:J,initializing:y&&(0,ii.O)(y),chartName:G,setChartName:q,chartsLoaded:g&&!!F,invalidationKey:a,flavour:n,chartIds:I?w:N,widthRef:M,containerWidth:F,nodesKey:S,noPreferredNodesError:Y,blurred:Q,blurProps:{value:"12px"},BlurredContent:()=>(0,se.jsx)(si.A,{flavour:c?"room":"node"}),...s})}));var _i=n(21785),zi=n(39870),Hi=n(7761);const Ki=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),n=(0,Hi.N3)();(0,j.A)((()=>({enabled:!(!e||!t),force:!0,fetch:()=>(0,Xn.hn)(e,t),onReceive:e=>{let{data:t}=e;return n({...zi.jf,loaded:!0,...t})},onFail:e=>n({...zi.jf,loaded:!0,error:e}),pollingOptions:{pollingInterval:588e3}})),[e,t])};var Wi=n(75669);const Gi=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),n=(0,_.w7)({extraKey:"home",merge:!1,scoped:!0}),r=(0,Hi.kf)();(0,j.A)((()=>({enabled:!(!e||!t),force:!0,fetch:()=>(0,Xn.TM)(e,t,n),onReceive:e=>{let{data:t}=e;return r({...zi.ul,loaded:!0,...t})},onFail:e=>r({...zi.ul,loaded:!0,error:e}),pollingOptions:{pollingInterval:588e3}})),[e,t])},qi=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),n=(0,_.w7)({extraKey:"home",merge:!1,scoped:!0}),r=(0,Hi.xs)();(0,j.A)((()=>({enabled:!(!e||!t),force:!0,fetch:()=>(0,Xn.jt)(e,t,n),onReceive:e=>{let{data:t}=e;return r({...zi.ve,loaded:!0,...t})},onFail:e=>r({...zi.ve,loaded:!0,error:e}),pollingOptions:{pollingInterval:588e3}})),[e,t,n])};var Ui=n(74290),Ji=n(56473),Xi=n(56523),Yi=n(24285),Zi=n(76571),Qi=n(97926),es=n(17115),ts=n(31246);const ns=()=>{const{milestones:e,settingsLoaded:t}=(0,Xi.A)(),{completed:n}=e,o=(0,Qi.A)(),i=(0,es.Ay)(),s=(0,g.Sk)(),l=(0,es.Ex)(),a=(0,Yi.xd)("isLoaded"),c=(0,Yi.xd)("onboardingFormData"),d=(0,b.vt)(),u=(0,b.ap)("loaded"),h=(0,Zi.t5)(d,"channels"),x=(0,Zi.t5)(d,"loaded"),m=Array.isArray(h)?h.length:0;return(0,r.useMemo)((()=>{if(!t||!x||!u||!a||!o)return[];if(!c?.usageType)return[];return Object.entries(o).filter((e=>{let[,t]=e;return t})).map((e=>{let[t]=e;return t})).filter((e=>n[e]?.completedAt&&!n[e]?.seenAt)).flatMap((e=>(ts.a7[e]||[]).map((t=>({...t,milestoneId:e}))))).filter((e=>{if(!e.segments.includes(i))return!1;if(e.permission&&!s[e.permission])return!1;if(e.requiresLargeTeam&&!l)return!1;if(void 0!==e.maxChannels&&m>e.maxChannels)return!1;const t=n[e.milestoneId]?.tasks?.[e.id];return!t})).slice(0,3).map((e=>e.channelAwareContent&&m>0?{...e,title:e.channelAwareContent.title,description:e.channelAwareContent.description}:e))}),[n,o,i,s,l,m,t,x,u,a,c])};var rs=n(81187),os=n(4703);const is=e=>{let{description:t}=e;return`${(0,Ji.PP)({extraKey:"runningAlerts"}).length} ${t}`},ss=e=>{let{onDismiss:t}=e;const{dismissOnboarding:n,resetOnboarding:o,markTaskCompleted:i}=(0,Xi.A)(),s=ns(),l=(0,rs.A)(),a=(0,r.useCallback)((e=>i(e.milestoneId,e.id)),[i]),c=(0,r.useCallback)((()=>{n(),t?.()}),[n,t]);return s.length?(0,se.jsx)(re.Flex,{column:!0,gap:4,children:(0,se.jsxs)(re.Flex,{column:!0,gap:4,background:"panelBg",border:!0,round:2,padding:[6],position:"relative",children:[(0,se.jsx)(re.IconButton,{icon:"x",neutral:!0,onClick:c,position:"absolute",top:"8px",right:"8px"}),(0,se.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,se.jsxs)(re.Flex,{gap:2,alignItems:"center",children:[(0,se.jsx)(re.Icon,{name:"checkmark_partial_s",color:"success"}),(0,se.jsx)(re.Text,{strong:!0,children:"Continue your journey"})]}),(0,se.jsx)(re.TextSmall,{color:"textLite",children:"Here's what you can explore next"})]}),(0,se.jsx)(re.Flex,{column:!0,gap:2,children:s.map((e=>(0,se.jsx)(os.A,{task:e,onClick:()=>l(e),onSkip:()=>a(e),children:e.dynamicDescription?(0,se.jsx)(r.Suspense,{fallback:e.description,children:(0,se.jsx)(is,{description:e.description})}):e.description},`${e.milestoneId}-${e.id}`)))}),!1]})}):null};var ls=n(56171);const as=[{id:"ai-insights",icon:"ai",background:"secondaryHighlightAI",text:"Ready to unlock AI-powered analysis? Netdata has collected enough data to generate Intelligent Insights. Try your first AI report for detailed recommendations and forecasts.",linkText:"Explore Insights.",route:"insights"}],cs=e=>{let{item:t,onNavigate:n}=e;return(0,se.jsxs)(re.Flex,{alignItems:"center",gap:2,width:"100%",children:[(0,se.jsx)(re.Icon,{name:t.icon,color:"main"}),(0,se.jsxs)(re.Text,{color:"main",children:[t.text," ",(0,se.jsx)(xe.A,{color:"main",onClick:n,style:{textDecoration:"underline"},children:t.linkText})]})]})},ds=()=>{const e=(0,f.Zp)(),t=(0,b.bq)(),n=(0,v.QW)(),{dismissedBanners:o,dismissBanner:i}=(0,Xi.A)(),s=(0,r.useMemo)((()=>as.find((e=>!o[e.id]))),[o]),l=(0,r.useCallback)((()=>{s&&i(s.id)}),[s,i]),a=(0,r.useCallback)((()=>{s?.route&&e(`/spaces/${t}/rooms/${n}/${s.route}`)}),[e,t,n,s]);return s?(0,se.jsx)(ls.A,{background:s.background,onClose:l,children:(0,se.jsx)(cs,{item:s,onNavigate:a})}):null};var us=n(58618),hs=n(42964),xs=n(82507);const gs={Live:"live",Stale:"stale",Offline:"offline",Unseen:"unseen"},ms=(0,dn.default)(re.Flex).withConfig({displayName:"nodeHero__Container",componentId:"sc-t1z79b-0"})(["position:relative;width:320px;height:320px;"]),ps=(0,dn.default)(re.Flex).withConfig({displayName:"nodeHero__ContentContainer",componentId:"sc-t1z79b-1"})(["position:absolute;inset:0;z-index:2;"]),fs=e=>{let{nodeId:t}=e;const n=(0,f.Zp)(),r=(0,E.xY)(t),{loaded:o,metricsCollected:i=0}=(0,Hi.P9)(),s=(0,b.bq)(),l=(0,v.QW)(),a=(0,it.GM)(r.state),c=gs[a]||"offline";return(0,se.jsxs)(ms,{children:[(0,se.jsx)(hs.A,{withOuties:!1}),(0,se.jsx)(xs.A,{withOuties:!1}),(0,se.jsxs)(ps,{column:!0,justifyContent:"center",alignItems:"center",gap:3,children:[(0,se.jsx)(re.TextBig,{color:"primary",children:r.nm}),(0,se.jsxs)(re.Flex,{gap:1,alignItems:"center",children:[(0,se.jsx)(re.Box,{width:"8px",height:"8px",round:"50%",background:c}),(0,se.jsx)(re.TextBig,{color:c,children:a})]})]}),(0,se.jsxs)(re.Flex,{column:!0,alignItems:"center",gap:2,position:"absolute",width:"100%",style:{bottom:"-60px"},children:[(0,se.jsxs)(re.TextBig,{children:[o?(0,us.$t)(i):"..."," metrics collected"]}),(0,se.jsx)(re.Button,{label:"View your metrics",icon:(0,se.jsx)(re.Icon,{name:"arrow_right"}),iconSide:"right",onClick:()=>{n(`/spaces/${s}/rooms/${l}/overview`)}})]})]})},js=(0,Bt.A)(re.Icon),bs=e=>{let{title:t,icon:n,iconColor:r,...o}=e;return(0,se.jsxs)(re.Flex,{alignItems:"center",gap:2,...o,children:[n&&(0,se.jsx)(re.Icon,{name:n,...r?{color:r}:{}}),(0,se.jsx)(re.TextBig,{children:t})]})},vs={ErrNoEligibleNodeRequested:"There are no eligible nodes.",default:"Something went wrong."},ys=e=>{let{titleProps:t,loading:n,error:r,children:o,...i}=e;const s={padding:[4],gap:4,background:"panelBg",...t?{column:!0}:{}},l=r?vs[r.errorMsgKey]||vs.default:null;return(0,se.jsxs)(re.Flex,{...s,...i,children:[t?(0,se.jsx)(bs,{...t}):null,n?(0,se.jsx)(re.Text,{textAlign:"center",children:"Loading..."}):r?null:(0,se.jsx)(se.Fragment,{children:o}),l?(0,se.jsx)(re.Flex,{width:"100%",justifyContent:"center",children:(0,se.jsx)(js,{name:"warning_triangle",size:"large",color:"text",tooltip:l})}):null]})},ws=e=>{let{title:t,value:n,loading:r}=e;return(0,se.jsxs)(ys,{column:!0,alignItems:"center",justifyContent:"center",gap:2,padding:[4],width:"180px",children:[(0,se.jsx)(re.TextSmall,{color:"textLite",children:t}),(0,se.jsx)(re.TextHuge,{strong:!0,children:r?"...":(0,us.$t)(n)})]})},Cs=()=>{const e=(0,v.ID)(),t=(0,Ae._0)(e),n=(0,Ae.R7)(e),r=Object.keys(n||{}).length;return(0,se.jsx)(ws,{title:"Charts Visualised",value:r,loading:!t})},Is=()=>(0,se.jsx)(re.Flex,{column:!0,gap:4,children:(0,se.jsx)(Cs,{})}),As=()=>{const e=(0,Ji.PP)({extraKey:"runningAlerts"});return(0,se.jsx)(ws,{title:"Running Alerts",value:e.length,loading:!1})},ks=()=>(0,se.jsx)(re.Flex,{column:!0,gap:4,children:(0,se.jsx)(r.Suspense,{fallback:(0,se.jsx)(ws,{title:"Running Alerts",value:"...",loading:!0}),children:(0,se.jsx)(As,{})})}),Ss=e=>{let{position:t}=e;return"left"===t?(0,se.jsx)(Is,{}):(0,se.jsx)(ks,{})},Ts=()=>((0,_i.A)(),Ki(),(0,Wi.A)(),Gi(),qi(),(0,Ui.A)(),null),Ms=e=>{let{nodeId:t}=e;return(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(Ts,{}),(0,se.jsx)(ds,{}),(0,se.jsxs)(V.A,{gap:4,padding:[4],overflow:"auto",children:[(0,se.jsxs)(re.Flex,{gap:4,justifyContent:"center",alignItems:"center",children:[(0,se.jsx)(Ss,{position:"left"}),(0,se.jsx)(fs,{nodeId:t}),(0,se.jsx)(Ss,{position:"right"})]}),et.OH&&(0,se.jsx)(ss,{})]})]})},Fs=e=>function(){let{title:t="",headerInfo:n,containerProps:r={},TitleComponent:o=re.TextBigger,...i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,se.jsxs)(re.Flex,{column:!0,gap:2,alignItems:"center",justifyContent:"center",...r,children:[t&&(0,se.jsxs)(re.Flex,{gap:2,alignItems:"center",children:[(0,se.jsx)(o,{children:t}),n]}),(0,se.jsx)(e,{...i})]})},Ns=Fs((e=>{let{number:t=0,NumberComponent:n=re.TextHuge}=e;return(0,se.jsx)(n,{strong:!0,children:t})})),Ls=e=>{const t=e.reduce(((e,t)=>{let{value:n}=t;return e+n}),0);return e.map((e=>({...e,width:`${Math.floor(e.value/t*100)}%`})))},$s=function(){let{data:e=[],testId:t="",numberIndicatorProps:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,se.jsxs)(re.Flex,{width:"100%",column:!0,gap:2,children:[(0,se.jsx)(re.Flex,{justifyContent:"around",children:e.map((e=>{let{label:t,value:r}=e;return(0,se.jsx)(Ns,{title:t,number:r,...n},`${t}-${r}`)}))}),(0,se.jsx)(re.ProgressBar,{background:"borderSecondary",border:"none",containerWidth:"100%","data-testid":t,height:2,value:Ls(e.filter((e=>{let{omit:t}=e;return!t})))})]})},Ds=Fs((e=>{let{nodesLoaded:t,total:n,count:o,live:i,offline:s,stale:l,unseen:a,...c}=e;const d=(0,r.useMemo)((()=>[...[{label:"Live",value:i,color:"success"},{label:"Offline",value:s,color:"offline"},{label:"Stale",value:l,color:"stale"}],...a?[{label:"Unseen",value:a,color:"unseen"}]:[]]),[i,s,l,a]);return(0,se.jsxs)(re.Flex,{width:"100%",column:!0,alignItems:"center",gap:4,children:[(0,se.jsxs)(re.Flex,{gap:2,alignItems:"baseline",children:[t?(0,se.jsx)(re.TextHuge,{strong:!0,...c,children:o}):(0,se.jsx)(re.Text,{children:"Loading..."}),t&&n!==o&&(0,se.jsxs)(re.Text,{children:["of ",n]})]}),(0,se.jsx)($s,{data:d,numberIndicatorProps:{TitleComponent:re.TextBig,NumberComponent:re.TextBigger}})]})})),Bs=e=>{const t=(0,D.nj)(),n=(0,D.CK)(),o=n.length,i=(0,_.eO)({keepAll:!1}),s=(0,r.useMemo)((()=>i.reduce(((e,t)=>{let{isLive:n,isOffline:r,isUnseen:o,state:i}=t;return{live:n?e.live+1:e.live,offline:r?e.offline+1:e.offline,stale:"stale"===i?e.stale+1:e.stale,unseen:o?e.unseen+1:e.unseen}}),{live:0,offline:0,stale:0,unseen:0})),[i]),l=(0,r.useMemo)((()=>{const e=i?.length||"-";return{nodesLoaded:t,total:o,count:e,title:t&&i&&o!==e?"Selected nodes":"Total nodes",...s}}),[t,n,i,o,s]);return(0,se.jsx)(Ds,{...l,...e})};var Ps=n(50916),Rs=n.n(Ps);function Vs(e){return e*Math.PI/180}function Os(e,t,n){return e>n?n:e<t?t:e}function Es(e,t){return t/100*e}function _s(e,t){return e+t/2}function zs(e,t){const n=Vs(e);return{dx:t*Math.cos(n),dy:t*Math.sin(n)}}function Hs(e){return"number"===typeof e}function Ks(e,t){return"function"===typeof e?e(t):e}function Ws({renderLabel:e,labelProps:t}){const n=e(t);if("string"===typeof n||"number"===typeof n){const{dataEntry:e,dataIndex:o,...i}=t;return r.createElement("text",{dominantBaseline:"central",...i},n)}return r.isValidElement(n)?n:null}function Gs({labelPosition:e,lineWidth:t,labelHorizontalShift:n}){const r=function(e){const t=1e14;return Math.round((e+Number.EPSILON)*t)/t}(n);if(0===r)return"middle";if(e>100)return r>0?"start":"end";return e<100-t?r>0?"end":"start":"middle"}function qs(e,t){const{label:n}=t;if(n)return function(e,t){return e.map(((e,n)=>{const r=Ks(t.segmentsShift,n)??0,o=Es(t.radius,t.labelPosition)+r,{dx:i,dy:s}=zs(_s(e.startAngle,e.degrees),o);return{x:t.center[0],y:t.center[1],dx:i,dy:s,textAnchor:Gs({labelPosition:t.labelPosition,lineWidth:t.lineWidth,labelHorizontalShift:i}),dataEntry:e,dataIndex:n,style:Ks(t.labelStyle,n)}}))}(e,t).map(((e,t)=>r.createElement(Ws,{key:`label-${e.dataEntry.key||t}`,renderLabel:n,labelProps:e})))}function Us({cx:e,cy:t,lengthAngle:n,lineWidth:o,radius:i,shift:s=0,reveal:l,rounded:a,startAngle:c,title:d,...u}){const h=i-o/2,{dx:x,dy:g}=zs(_s(c,n),s),m=function(e,t,n,r,o){const i=Os(r,-359.999,359.999);return Rs()(e,t,o,Vs(n),Vs(n+i)).map((e=>e.join(" "))).join(" ")}(e+x,t+g,c,n,h);let p,f;if(Hs(l)){const e=Vs(h)*n;p=Math.abs(e),f=p-Es(p,l)}return r.createElement("path",{d:m,fill:"none",strokeWidth:o,strokeDasharray:p,strokeDashoffset:f,strokeLinecap:a?"round":void 0,...u},d&&r.createElement("title",null,d))}function Js(e,t,n){let r=`stroke-dashoffset ${e}ms ${t}`;return n&&n.transition&&(r=`${r},${n.transition}`),{transition:r}}function Xs(e,t){return e&&(n=>{e(n,t)})}function Ys(e,t,n){const o=n??function({reveal:e,animate:t}){return t&&!Hs(e)?100:e}(t),{radius:i,center:[s,l]}=t,a=Es(i,t.lineWidth),c=e.map(((e,n)=>{const c=Ks(t.segmentsStyle,n);return r.createElement(Us,{cx:s,cy:l,key:e.key||n,lengthAngle:e.degrees,lineWidth:a,radius:i,rounded:t.rounded,reveal:o,shift:Ks(t.segmentsShift,n),startAngle:e.startAngle,title:e.title,style:Object.assign({},c,t.animate&&Js(t.animationDuration,t.animationEasing,c)),stroke:e.color,tabIndex:t.segmentsTabIndex,onBlur:Xs(t.onBlur,n),onClick:Xs(t.onClick,n),onFocus:Xs(t.onFocus,n),onKeyDown:Xs(t.onKeyDown,n),onMouseOver:Xs(t.onMouseOver,n),onMouseOut:Xs(t.onMouseOut,n)})}));return t.background&&c.unshift(r.createElement(Us,{cx:s,cy:l,key:"bg",lengthAngle:t.lengthAngle,lineWidth:a,radius:i,rounded:t.rounded,startAngle:t.startAngle,stroke:t.background})),c}const Zs={animationDuration:500,animationEasing:"ease-out",center:[50,50],data:[],labelPosition:50,lengthAngle:360,lineWidth:100,paddingAngle:0,radius:50,startAngle:0,viewBoxSize:[100,100]};function Qs(e){const t=function(e){const t=Object.assign({},Zs,e);let n;for(n in Zs)void 0===e[n]&&(t[n]=Zs[n]);return t}(e),[n,o]=(0,r.useState)(t.animate?0:null);(0,r.useEffect)((()=>{t.animate&&o(null)}),[]);const i=function({data:e,lengthAngle:t,totalValue:n,paddingAngle:r,startAngle:o}){const i=n||function(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].value;return t}(e),s=Os(t,-360,360),l=360===Math.abs(s)?e.length:e.length-1,a=Math.abs(r)*Math.sign(t),c=s-a*l;let d=0;const u=[];for(let h=0;h<e.length;h++){const t=e[h],n=0===i?0:t.value/i*100,r=Es(c,n),s=d+o;d=d+r+a,u.push(Object.assign({percentage:n,startAngle:s,degrees:r},t))}return u}(t);return r.createElement("svg",{viewBox:`0 0 ${t.viewBoxSize[0]} ${t.viewBoxSize[1]}`,width:"100%",height:"100%",className:t.className,style:t.style},Ys(i,t,n),qs(i,t),t.children)}const el=(0,dn.default)(re.TextSmall).withConfig({displayName:"pieChartLabels__StyledText",componentId:"sc-3919ls-0"})(["display:flex;align-items:center;cursor:",";&:hover{opacity:",";}"],(e=>{let{onClick:t}=e;return t?"pointer":"auto"}),(e=>{let{onClick:t}=e;return t?"0.7":"1"})),tl=(0,r.memo)((e=>{let{title:t,value:n,color:r,onClick:o=null}=e;return(0,se.jsxs)(re.Flex,{alignItems:"center",justifyContent:"between",width:"100%",gap:4,flex:{grow:1,shrink:0},children:[(0,se.jsxs)(re.Flex,{gap:1,children:[(0,se.jsx)(re.Flex,{width:"4px",height:"16px",background:r}),(0,se.jsxs)(el,{whiteSpace:"nowrap",onClick:o,children:[t,o&&(0,se.jsx)(re.Icon,{color:"textLite",margin:[0,0,0,1],name:"nav_arrow_goto",height:"10px",width:"10px"})]})]}),(0,se.jsx)(re.Text,{strong:!0,children:n??"-"})]})})),nl=e=>{let{data:t}=e;return(0,se.jsx)(re.Flex,{column:!0,alignItems:"start",justifyContent:"center",gap:5,children:t.map(((e,t)=>{let{title:n,value:r,color:o,onClick:i}=e;return(0,se.jsx)(tl,{title:n,value:r,color:o,onClick:i},`${n}-${r}-${t}`)}))})},rl=e=>{let{data:t,theme:n}=e;return t.map((e=>({...e,color:(0,re.getColor)(e.color)({theme:n})})))},ol=e=>{let{chartData:t=[],lineWidth:n=15,animate:o=!0,label:i,hasData:s}=e;const l=(0,r.useContext)(dn.ThemeContext);return(0,se.jsxs)(re.Flex,{gap:4,margin:[0,4],height:{min:"70px",max:"130px"},alignItems:"center",children:[(0,se.jsx)(re.Flex,{height:"70px",flex:{grow:1,shrink:1},children:s?(0,se.jsx)(Qs,{label:()=>i,labelStyle:{fontSize:"34px",fontWeight:700,lineHeight:"38px",fill:(0,re.getColor)("textDescription")({theme:l})},labelPosition:0,data:rl({data:t,theme:l}),lineWidth:n,animate:o}):(0,se.jsx)(re.Icon,{color:"border",name:"pie_chart_skeleton",width:"70px",height:"70px",alignSelf:"center"})}),(0,se.jsx)(nl,{data:t})]})},il=Fs((e=>(0,se.jsx)(re.Flex,{gap:2,justifyContent:"between",padding:[2,0,0,0],children:(0,se.jsx)(ol,{...e})}))),sl=e=>{const t=(0,Ji.QD)({extraKey:"alerts"}),{critical:n,warning:o}=(t||[]).reduce(((e,t)=>{let{status:n}=t;return{...e,[n]:e[n]+1}}),{critical:0,warning:0}),i=(0,li.x7)(),s=(0,r.useMemo)((()=>({chartData:[{title:"Critical",value:n,color:"errorText",onClick:()=>i("critical")},{title:"Warning",value:o,color:"warningText",onClick:()=>i("warning")}],hasData:!!t?.length,label:t?.length})),[n,o,i]);return(0,se.jsx)(il,{title:"Active alerts",...s,...e})},ll=()=>(0,se.jsxs)(re.Flex,{"data-testid":"home-nodes-overview-left-section",column:!0,gap:4,basis:"205px",children:[(0,se.jsx)(Bs,{}),(0,se.jsx)(dr.A,{}),(0,se.jsx)(sl,{})]});var al=n(63950),cl=n.n(al),dl=n(31522),ul=n(41395);const hl=e=>{let{label:t,color:n}=e;return(0,se.jsxs)(re.Flex,{height:"24px",gap:1,alignItems:"center",children:[(0,se.jsx)(re.Flex,{width:"12px",height:"12px",background:n}),(0,se.jsx)(re.Text,{children:(0,ul.Zr)(t)})]})},xl=e=>{let{colorBy:t}=e;const n=Object.entries(dl.Cc[t?.value]||{}),r=dl.Ug[t?.value]||{};return n.length?(0,se.jsx)(re.Flex,{"data-testid":"home-nodes-overview-main-section-header-colors-legend",gap:2,children:n.map((e=>{let[t,n]=e;return(0,se.jsx)(hl,{label:r[t]||t,color:n},t)}))}):null},gl=(0,Bt.A)(re.Icon),ml=e=>{let{nodes:t=[],groupBy:n,setGroupBy:o=cl(),colorBy:i,setColorBy:s=cl(),onAddNode:l}=e;const a=(0,r.useMemo)((()=>function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((e,t)=>{const{labels:n}=t||{};return Object.entries(n||{}).forEach((t=>{let[n,r]=t;e[n]?e[n]=Array.from(new Set([...e[n],r])):e[n]=[r]})),e}),{})}(t)),[t]),c=(0,r.useMemo)((()=>function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).map((e=>({label:`label:${e}`,value:`label:${e}`})))}(a).sort(((e,t)=>e.value.localeCompare(t.value,void 0,{sensitivity:"accent",ignorePunctuation:!0})))),[a]),d=(0,r.useMemo)((()=>[...dl.XJ,...c]),[c]);return(0,se.jsxs)(re.Flex,{"data-testid":"home-nodes-overview-main-section-header",alignItems:"end",justifyContent:"between",children:[(0,se.jsxs)(re.Flex,{gap:3,alignItems:"end",children:[(0,se.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,se.jsxs)(re.Flex,{alignItems:"center",gap:1,children:[(0,se.jsx)(re.Text,{color:"menuItem",children:"Group by"}),(0,se.jsx)(gl,{name:"information",color:"menuItem",tooltip:{title:"Group nodes",description:"Group nodes by attributes like status, OS, or custom host labels. You can select multiple for multi-level grouping."},tooltipProps:{align:"bottom"},noWrapper:!0})]}),(0,se.jsx)(re.Select,{isMulti:!0,options:d,value:n,onChange:o,...c?.length>0?{styles:{minWidth:"250px"}}:{}})]}),(0,se.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,se.jsx)(re.Text,{color:"menuItem",children:"Color by"}),(0,se.jsx)(re.Select,{options:dl.Hn,value:i,onChange:s})]}),(0,se.jsx)(xl,{colorBy:i})]}),(0,se.jsx)(fe.A,{flavour:"borderless",icon:"add_node",iconColor:"text",onClick:l})]})},pl=(0,dn.default)(re.Box).withConfig({displayName:"styled__PolygonContainer",componentId:"sc-9bx1cv-0"})(["width:22px;position:relative;aspect-ratio:1;background-color:",";cursor:",";opacity:",";clip-path:polygon( 93.56% 74.55%,50.52% 100%,6.96% 75.45%,6.44% 25.45%,49.48% 0%,93.04% 24.55%,93.56% 74.55% );"],(e=>{let{background:t}=e;return(0,re.getColor)(t||"offline")}),(e=>{let{onClick:t}=e;return t?"pointer":"default"}),(e=>{let{isDisabled:t}=e;return t?"0.5":"1"})),fl=(0,dn.default)(re.Box).withConfig({displayName:"styled__PolygonInner",componentId:"sc-9bx1cv-1"})(["width:18px;position:absolute;top:2px;left:2px;aspect-ratio:1;background-color:",";opacity:",";clip-path:polygon( 93.56% 74.55%,50.52% 100%,6.96% 75.45%,6.44% 25.45%,49.48% 0%,93.04% 24.55%,93.56% 74.55% );"],(e=>{let{background:t}=e;return(0,re.getColor)(t||"offline")}),(e=>{let{isDisabled:t}=e;return t?"0.5":"1"})),jl=(0,dn.default)(re.Icon).withConfig({displayName:"styled__AddNodeIcon",componentId:"sc-9bx1cv-2"})(["position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);"]),bl=(0,dn.default)(re.Box).withConfig({displayName:"styled__Groups",componentId:"sc-9bx1cv-3"})(["width:100%;display:grid;grid-template-columns:repeat(2,1fr);gap:16px;"]),vl=(0,dn.default)(re.Flex).withConfig({displayName:"styled__NodeContainer",componentId:"sc-9bx1cv-4"})(["opacity:",";"],(e=>{let{isActive:t}=e;return t?"1":".3"})),yl=(0,Bt.A)((e=>{let{children:t,innerProps:n={},containerProps:r={},...o}=e;return(0,se.jsx)(vl,{margin:[0,0,.5,0],...o,children:(0,se.jsx)(pl,{...r,children:(0,se.jsx)(fl,{...n,children:t})})})})),wl=e=>{let{type:t,onClick:n}=e;const o=(0,v.XA)(),i=(0,b.dg)(),s=(0,g.JT)("node:Create"),l=(0,r.useMemo)((()=>({background:"success",isDisabled:!s,...s?{onClick:()=>n({type:t})}:{}})),[s]),a=s?"Add node":i?"You are viewing your local node, connect to cloud and connect multiple nodes to view at once":`Only admin users can add nodes to ${o.name}`;return(0,se.jsx)(se.Fragment,{children:(0,se.jsx)(yl,{containerProps:l,innerProps:{background:"panelBg"},tooltip:a,isActive:!0,children:(0,se.jsx)(jl,{name:"plus",color:"success"})})})},Cl=yl;var Il=n(89284),Al=n(91100);const kl=e=>{let{architecture:t,cpuFrequency:n,cpus:r,diskSpace:o,memory:i,os:s,osName:l}=e;const a=[(0,it.O)(n),(0,it.ws)(r,1===r?"Core":"Cores"),(0,it.ws)(t),(0,it.ws)((0,it.RI)(i),"RAM"),(0,it.ws)((0,it.RI)(o),"HD")];return(0,se.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,se.jsxs)(re.Flex,{gap:1,children:[(0,se.jsx)(re.Icon,{"data-testid":"node-system-info-icon",name:Qe.u[l]?.iconName||Qe.U[s]?.iconName||"os",width:"16px",height:"16px",color:"text"}),(0,se.jsx)(re.Flex,{children:(0,it.ws)(l)})]}),a.map(((e,t)=>(0,se.jsxs)(re.Text,{children:["\u2022 ",e]},t)))]})};var Sl=n(23208);const Tl=e=>{let{isStable:t}=e;const n=t?{icon:"checkmark_s",color:"primary",borderColor:"primary"}:{icon:"warning_triangle",color:"stale",borderColor:"stale"};return(0,se.jsx)(re.Pill,{hollow:!0,...n,children:t?"Stable":"Unstable"})},Ml=function(){let{id:e,name:t,state:n,hw:o,os:i,isStable:s,setActiveNodes:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const a=(0,Hi.c8)(),{nodes:c}=a||{},d=c?.[e];return(0,r.useEffect)((()=>{if("function"===typeof l){const{children:t,parents:n}=d||{},r=d?[...[...n,...t].map((e=>{let{id:t}=e;return t}))||[],e]:[e];l({isHover:!0,nodes:r})}return()=>{"function"===typeof l&&l(dl.vd)}}),[e,d]),(0,se.jsxs)(re.Flex,{column:!0,gap:3,width:{min:40},background:"mainBackground",padding:[2,4],children:[(0,se.jsx)(re.TextBig,{strong:!0,children:t}),(0,se.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,se.jsx)(re.Text,{children:"Status"}),(0,se.jsx)(re.Flex,{children:(0,se.jsx)(Il.A,{state:n})})]}),(0,se.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,se.jsx)(re.Text,{children:"Connection"}),(0,se.jsx)(re.Flex,{children:(0,se.jsx)(Tl,{isStable:s})})]}),(0,se.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,se.jsx)(re.Text,{children:"Alerts"}),(0,se.jsx)(Al.A,{id:e})]}),(0,se.jsx)(dr.A,{color:"textLite"}),(0,se.jsx)(kl,{architecture:o.architecture,cpuFrequency:o.cpuFrequency,cpus:o.cpus,"data-testid":"nodeRow-system-info",diskSpace:o.diskSpace,memory:o.memory,name:t,osName:i.nm,os:i.id}),(0,se.jsx)(dr.A,{color:"textLite"}),(0,se.jsx)(Sl.A,{id:e})]})},Fl=function(){let{colorBy:e={},node:t={},isStable:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{value:o}=e,i=dl.AZ[o],s=(0,er.Xt)(t.id),{critical:l,warning:a}=(0,Jo.AO)(s),c=dl.Cc[o];let d=c[i?.(t)?.group?.toLowerCase()];if(o==dl.w9.stability.value){d=c[n?"stable":"unstable"]}return{borderColor:(0,r.useMemo)((()=>(e=>{let{critical:t,warning:n}=e;return t?"error":n?"warning":null})({critical:l,warning:a})||d),[d,l,a]),background:d}},Nl=e=>{let{colorBy:t,stability:n={},setActiveNodes:o,...i}=e;const{isStable:s}=n[i.id]||{},{borderColor:l,background:a}=Fl({colorBy:t,node:i,isStable:s}),[,c]=(0,Hi.A$)(),d=(0,r.useCallback)((()=>c(i.id)),[i.id,c]);return(0,se.jsx)(Cl,{containerProps:{background:l,onClick:d},innerProps:{background:a},tooltip:(0,se.jsx)(Ml,{isStable:s,setActiveNodes:o,...i}),...i})};var Ll=n(67462);const $l=e=>t=>{let{title:n,...o}=t;const i=(0,r.useMemo)((()=>"nolabel"===n?`${o.groupBy} (No value)`:`${o.groupBy}=${n}`),[n,o.groupBy]);return n?(0,se.jsxs)(re.Flex,{width:"100%",column:!0,gap:2,children:[(0,se.jsxs)(re.Flex,{justifyContent:"between",border:{side:"bottom",color:"border"},children:[(0,se.jsx)(re.Text,{strong:!0,color:"menuItem",children:i}),o.nodes?.length?(0,se.jsx)(re.Text,{color:"menuItem",children:`${o.nodes.length} ${(0,Ll.su)(o.nodes.length)}`}):null]}),(0,se.jsx)(e,{...o})]}):(0,se.jsx)(e,{...o})},Dl=(0,r.memo)((e=>{let{nodes:t=[],type:n,stability:o={},groupBy:i,colorBy:s,onAddNode:l,...a}=e;const[c,d]=(0,r.useState)(dl.vd),{isHover:u,nodes:h}=c,x=i?.canAddNodes;return(0,se.jsxs)(re.Flex,{flexWrap:!0,...a,children:[t.map((e=>(0,se.jsx)(Nl,{colorBy:s,stability:o,isActive:!u||h.includes(e.id),setActiveNodes:d,...e},e.id))),x?(0,se.jsx)(wl,{type:n,onClick:l}):null]})})),Bl=$l((e=>t=>{const{stability:n}=(0,Hi.SW)();return(0,se.jsx)(e,{stability:n,...t})})(Dl)),Pl=e=>t=>{const n=dl.AZ[e],r=(0,dl.Hl)(e);return t.reduce(((e,t)=>{const{group:o="unknown",type:i}=n(t);return e[o]?e[o].nodes=[...e[o].nodes,t]:e[o]={title:r(o)||"unknown",type:i,nodes:[t]},e}),{})},Rl={os:Pl("os"),version:Pl("version"),status:Pl("status"),technology:Pl("technology"),replication:Pl("replication"),cloudProvider:Pl("cloudProvider"),cloudRegion:Pl("cloudRegion"),instanceType:Pl("instanceType"),none:e=>({none:{nodes:e}})},Vl=e=>{let{value:t,nodes:n}=e;return t.startsWith("label:")?(r=t.replace(/^label:/,""),e=>{const t=function(){let e=arguments.length>1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((t,n)=>{const{labels:r}=n||{},o=r[e]||"nolabel";return o&&(t[o]?t[o]=[...t[o],n]:t[o]=[n]),t}),{})}(e,r);return Object.entries(t).reduce(((e,t)=>{let[n,r]=t;return{...e,[n]:{title:n,nodes:r}}}),{})})?.(n):Rl[t]?.(n);var r},Ol=()=>(0,se.jsx)(re.Flex,{children:(0,se.jsx)(re.TextBig,{color:"menuItem",children:"No nodes found"})}),El=e=>{let{nodes:t,groupBy:n,title:o,groupByValue:i,children:s}=e;const{value:l}=Array.isArray(n)&&n.length>0?n[0]:dl.nv,a=Vl({value:l,nodes:t}),c=(0,r.useMemo)((()=>Object.keys(a).length),[a]);return(0,se.jsxs)(re.Flex,{"data-testid":`nodes-group-${i}-${o}`,column:!0,gap:2,padding:[2,4],round:2,border:{side:"all",color:"border"},children:[(0,se.jsxs)(re.Flex,{alignItems:"center",justifyContent:"between",children:[(0,se.jsxs)(re.Text,{strong:!0,color:"menuItem",children:[i,": ",o]}),c>1?(0,se.jsxs)(re.Text,{color:"menuItem",children:[t.length," ",(0,Ll.su)(t.length)]}):null]}),s]},o)},_l=e=>{let{nodes:t,groupBy:n,colorBy:o,onAddNode:i}=e;const{value:s}=Array.isArray(n)&&n.length>0?n[0]:dl.nv,l=Vl({value:s,nodes:t}),a=(0,r.useMemo)((()=>Object.values(l)),[l]);if(!l)return(0,se.jsx)(Ol,{});if(!a.length)return(0,se.jsx)(Ol,{});if(n?.value===dl.nv.value){const{nodes:e}=a[0];return(0,se.jsx)(Bl,{nodes:e,groupBy:n,colorBy:o,onAddNode:i})}if(n.length>1)return(0,se.jsx)(re.Flex,{column:!0,gap:4,children:a.map((e=>{let{title:t,nodes:r}=e;return(0,se.jsx)(El,{groupBy:n.slice(1),nodes:r,title:t,groupByValue:s,children:(0,se.jsx)(_l,{nodes:r,groupBy:n.slice(1),colorBy:o,onAddNode:i})},t)}))});const c=1===a.length||n.length>1?re.Flex:bl;return(0,se.jsx)(c,{children:a.map(((e,t)=>{let{title:n,type:r,nodes:l}=e;return(0,se.jsx)(Bl,{title:n,type:r,nodes:l,groupBy:s,colorBy:o,onAddNode:i,margin:[0,0,2,0]},n||t)}))})},zl=_l,Hl=()=>(0,se.jsxs)(re.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,se.jsxs)(re.Flex,{gap:2,children:[(0,se.jsx)(un.A,{width:"22px",height:"22px",round:2}),(0,se.jsx)(un.A,{width:"22px",height:"22px",round:2}),(0,se.jsx)(un.A,{width:"22px",height:"22px",round:2}),(0,se.jsx)(un.A,{width:"22px",height:"22px",round:2}),(0,se.jsx)(un.A,{width:"22px",height:"22px",round:2}),(0,se.jsx)(un.A,{width:"22px",height:"22px",round:2})]}),(0,se.jsxs)(re.Flex,{gap:2,children:[(0,se.jsx)(un.A,{width:"22px",height:"22px",round:2}),(0,se.jsx)(un.A,{width:"22px",height:"22px",round:2}),(0,se.jsx)(un.A,{width:"22px",height:"22px",round:2}),(0,se.jsx)(un.A,{width:"22px",height:"22px",round:2}),(0,se.jsx)(un.A,{width:"22px",height:"22px",round:2}),(0,se.jsx)(un.A,{width:"22px",height:"22px",round:2})]})]}),Kl=()=>{const[e,t]=(0,r.useState)([]),[n,o]=(0,r.useState)(dl.jZ),[i,s]=(0,r.useState)(),l=(0,v.ID)(),a=(0,D.gr)(l,"loaded"),c=(0,_.eO)({keepAll:!1}),d=(0,r.useCallback)((e=>{s(e)}),[s]),u=(0,r.useCallback)((()=>s()),[s]);return(0,se.jsxs)(re.Flex,{"data-testid":"home-nodes-overview-main-section",column:!0,gap:4,basis:"calc(100% - 410px)",children:[(0,se.jsx)(ml,{nodes:c,groupBy:e,setGroupBy:t,colorBy:n,setColorBy:o,onAddNode:d}),(0,se.jsx)(re.Flex,{height:{max:150},overflow:{vertical:"auto"},children:a?(0,se.jsx)(zl,{nodes:c,groupBy:e,colorBy:n,onAddNode:d}):(0,se.jsx)(Hl,{})}),i&&(0,se.jsx)(je.A,{nodeType:i?.type,onClose:u})]})},Wl=()=>(0,se.jsxs)(re.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,se.jsxs)(re.Flex,{justifyContent:"between",children:[(0,se.jsx)(un.A,{width:"30%"}),(0,se.jsx)(un.A,{width:"30%"}),(0,se.jsx)(un.A,{width:"30%"})]}),(0,se.jsxs)(re.Flex,{justifyContent:"between",children:[(0,se.jsx)(un.A,{width:"30%"}),(0,se.jsx)(un.A,{width:"30%"}),(0,se.jsx)(un.A,{width:"30%"})]}),(0,se.jsx)(un.A,{})]}),Gl=()=>{const{loaded:e,totalChildren:t,totalParents:n,totalStandalone:o}=(0,Hi.c8)(),i=(0,r.useMemo)((()=>[{label:"Parents",value:n,color:["blue","indigo"]},{label:"Children",value:t,color:["purple","lilac"]},{label:"Standalone",value:o,color:["yellow","yellow120"]}]),[t,n]);return e?(0,se.jsx)($s,{numberIndicatorProps:{TitleComponent:re.Text},data:i}):(0,se.jsx)(Wl,{height:"58px"})},ql=()=>(0,se.jsxs)(re.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,se.jsxs)(re.Flex,{justifyContent:"between",children:[(0,se.jsx)(un.A,{width:"30%"}),(0,se.jsx)(un.A,{width:"30%"}),(0,se.jsx)(un.A,{width:"30%"})]}),(0,se.jsxs)(re.Flex,{justifyContent:"between",children:[(0,se.jsx)(un.A,{width:"30%"}),(0,se.jsx)(un.A,{width:"30%"}),(0,se.jsx)(un.A,{width:"30%"})]}),(0,se.jsx)(un.A,{})]}),Ul=()=>(0,se.jsxs)(re.Flex,{column:!0,gap:1,alignItems:"center",width:"220px","data-testid":"nodesByDataReplication-information-text",overflow:"hidden",children:[(0,se.jsxs)(re.TextMicro,{children:[(0,se.jsx)(re.TextMicro,{strong:!0,children:"None:"})," The node's data are only on the node itself. Lose the node, lose the data!"]}),(0,se.jsxs)(re.TextMicro,{children:[(0,se.jsx)(re.TextMicro,{strong:!0,children:"Single:"})," The node's metrics are replicated to one parent. The parent can trigger alerts for the child."]}),(0,se.jsxs)(re.TextMicro,{children:[(0,se.jsx)(re.TextMicro,{strong:!0,children:"Multi:"})," Same as dual replication, but with the metrics replicated to more than one parent. Each parent in the hierarchy can trigger alerts for its children."]}),(0,se.jsx)(re.TextMicro,{margin:[2,0],children:"Aim to have most of your nodes with at least a dual replication and your critical ones with a multiple one."})]}),Jl=()=>(0,se.jsx)(Oe.A,{isBasic:!0,plain:!0,content:Ul,align:"bottom",children:(0,se.jsx)(re.Icon,{name:"information",color:"textDescription",size:"small"})}),Xl=Fs((()=>{const e=(0,Hi.c8)(),{loaded:t,replicationFactor:n}=e||{},o=(0,r.useMemo)((()=>[{label:"None",value:n?.r_1||0,color:dl.q5.r_1},{label:"Single",value:n?.r_2||0,color:dl.q5.r_2},{label:"Multi",value:n?.["r_*"]||0,color:dl.q5["r_*"]}]),[n]);return t?(0,se.jsx)($s,{data:o}):(0,se.jsx)(ql,{})})),Yl=()=>(0,se.jsx)(Xl,{title:"Data Replication",headerInfo:(0,se.jsx)(Jl,{})}),Zl=()=>(0,se.jsxs)(re.Flex,{"data-testid":"home-nodes-overview-right-section",column:!0,gap:4,basis:"205px",children:[(0,se.jsx)(Gl,{}),(0,se.jsx)(dr.A,{}),(0,se.jsx)(Yl,{})]}),Ql=()=>(0,se.jsxs)(ys,{children:[(0,se.jsx)(ll,{}),(0,se.jsx)(dr.A,{vertical:!0}),(0,se.jsx)(Kl,{}),(0,se.jsx)(dr.A,{vertical:!0}),(0,se.jsx)(Zl,{})]});var ea=n(66118),ta=n(44731);ea.t1.register(ea.PP,ea.kc,ea.A6,ea.E8,ea.m_,ea.s$);const na={borderWidth:0,maxBarThickness:15,minBarLength:0},ra=function(){let{alertsStats:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.useContext)(dn.ThemeContext),{hosts:n}=e?.nodes||{},o={animation:!1,maintainAspectRatio:!1,plugins:{legend:{display:!1}},responsive:!0,scales:{x:{stacked:!0,grid:{color:(0,re.getColor)("borderSecondary")({theme:t})},afterSetDimensions:e=>{e.maxHeight=50},ticks:{precision:0,callback:(e,t)=>{let n=i.labels[t];if(!n)return;let r=0;for(;n?.length>20;)n=(0,ul.P3)(n,r),r+=1;return n}}},y:{stacked:!0,grid:{color:(0,re.getColor)("borderSecondary")({theme:t})},afterSetDimensions:e=>{e.maxWidth=50}}}},i=(0,r.useMemo)((()=>{if(!n)return{datasets:[],labels:[]};const[e,t]=Object.entries(n).sort(((e,t)=>t[1].total-e[1].total)).reduce(((e,t)=>{let[n,{critical:r,warning:o}]=t;return e[0].push(n),e[1].critical?e[1].critical=[...e[1].critical,r]:e[1].critical=[r],e[1].warning?e[1].warning=[...e[1].warning,o]:e[1].warning=[o],e}),[[],{}]);return{datasets:Object.entries(t).map((e=>{let[t,n]=e;return{...na,backgroundColor:"critical"===t?"#DB162F":"#FF9700",data:n,label:t}})),labels:e}}),[n]);return i.datasets?(0,se.jsx)(re.Flex,{width:"100%",height:40,children:(0,se.jsx)(ta.yP,{data:i,options:o})}):null},oa=e=>{let{alertsStats:t}=e;const{nodes:n}=t||{},{critical:o,warning:i,total:s}=n||{},l=(0,r.useMemo)((()=>[{label:"Warning",value:i,color:["yellow","yellow80"]},{label:"Critical",value:o,color:["red","red100"]},{label:"Total",value:s,color:["purple","lilacFocus"],omit:!0}]),[o,i,s]);return n?(0,se.jsx)($s,{data:l}):null},ia=[{id:"name",accessorKey:"name",header:"Alert name",fullWidth:!0,cell:e=>{let{getValue:t,row:n}=e;const o=t(),{goToAlerts:i}=Fi(),s=(0,r.useCallback)((e=>{e.preventDefault(),i({name:o,instance:n?.original?.chart})}),[i]);return(0,se.jsx)(Oe.A,{content:"Go to events tab. Timeframe will be set to the last 24 hours.",isBasic:!0,children:(0,se.jsx)(re.Box,{children:(0,se.jsx)(xe.A,{onClick:s,children:o})})})}},{id:"chart",name:"chart",fullWidth:!0,header:"Instance"},{id:"occurrences",name:"occurrences",header:"Occurrences"},{id:"duration",name:"duration",header:"Duration (seconds)"}],sa=function(){let{data:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.length?(0,se.jsx)(re.Flex,{height:{max:50},overflow:{vertical:"auto"},children:(0,se.jsx)(re.Table,{data:e,dataColumns:ia,sortBy:[{id:"occurrences",desc:!0}],enableResizing:!0})}):null},la={title:"Nodes with the most alerts in the last 24h"},aa=e=>{const t=(0,Hi.jg)();return t.loaded?(0,se.jsxs)(ys,{"data-testid":"home-alert-nodes",titleProps:la,...e,children:[(0,se.jsx)(ra,{alertsStats:t}),(0,se.jsx)(oa,{alertsStats:t}),(0,se.jsxs)(re.Flex,{column:!0,gap:4,children:[(0,se.jsx)(re.TextBig,{children:"Top alerts in the last 24 h"}),(0,se.jsx)(sa,{data:t?.alerts})]})]}):(0,se.jsx)(d.nl,{})},ca={title:"Metrics available",justifyContent:"center"},da=e=>{const{loaded:t,metricsCollected:n=0,error:r}=(0,Hi.P9)();return t?(0,se.jsx)(ys,{"data-testid":"home-metrics",titleProps:ca,error:r?.response?.data,...e,children:(0,se.jsx)(re.Flex,{width:"100%",justifyContent:"center",children:(0,se.jsx)(re.TextHuge,{strong:!0,children:(0,us.$t)(n)})})}):(0,se.jsx)(d.Tr,{title:"Metrics available",...e})},ua={title:"Charts visualized",justifyContent:"center"},ha=e=>{const t=(0,v.ID)(),n=(0,Ae._0)(t),r=(0,Ae.rx)(t),o=(0,Ae.R7)(t),i=Object.keys(o||{}).length;return n||r?(0,se.jsx)(ys,{"data-testid":"home-charts-data",titleProps:ua,error:r,...e,children:(0,se.jsx)(re.Flex,{width:"100%",justifyContent:"center",children:(0,se.jsx)(re.TextHuge,{strong:!0,children:(0,us.$t)(i)})})}):(0,se.jsx)(d.Tr,{...e})},xa={title:"Alerts configured",justifyContent:"center"},ga=e=>{const{loaded:t,value:n}=(0,Jo.oU)();return t?(0,se.jsx)(ys,{"data-testid":"home-alerts-data",titleProps:xa,...e,children:(0,se.jsx)(re.Flex,{width:"100%",justifyContent:"center",children:(0,se.jsx)(re.TextHuge,{strong:!0,children:(0,us.$t)(n?.length||0)})})}):(0,se.jsx)(d.Tr,{...e})};ea.t1.register(ea.PP,ea.kc,ea.A6,ea.E8,ea.m_,ea.s$);const ma=function(){let{dataRetention:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.useContext)(dn.ThemeContext),n={animation:!1,maintainAspectRatio:!1,plugins:{legend:{display:!1}},responsive:!0,scales:{x:{stacked:!0,grid:{color:(0,re.getColor)("borderSecondary")({theme:t})},afterSetDimensions:e=>{e.maxHeight=50},ticks:{precision:0,callback:(e,t)=>{let n=o.labels[t];if(!n)return;let r=0;for(;n?.length>20;)n=(0,ul.P3)(n,r),r+=1;return n}}},y:{stacked:!0,grid:{color:(0,re.getColor)("borderSecondary")({theme:t})},afterSetDimensions:e=>{e.maxWidth=50}}}},o=(0,r.useMemo)((()=>{if(!e?.length)return{datasets:[],labels:[]};const{values:t,labels:n}=e.reduce(((e,t)=>{let{label:n,value:r}=t;return e.labels.push(n),e.values.push(r),e}),{values:[],labels:[]});return{datasets:[{borderWidth:0,maxBarThickness:10,backgroundColor:"#0A81AB",minBarLength:0,data:t,label:"Nodes"}],labels:n}}),[e]);return o.datasets?(0,se.jsx)(re.Flex,{width:"100%",height:"100%",children:(0,se.jsx)(ta.yP,{data:o,options:n})}):null},pa={title:"Data retention per Nodes"},fa=e=>{const{dataRetention:t}=(0,Hi.P9)();return(0,se.jsx)(ys,{"data-testid":"home-data-retention",titleProps:pa,...e,children:(0,se.jsx)(ma,{dataRetention:t})})},ja=()=>((0,_i.A)(),Ki(),(0,Wi.A)(),Gi(),qi(),(0,Ui.A)(),null),ba=new Date("2025-12-01").getTime(),va=()=>{const e=(0,D.CK)(),t=(0,D.nj)(),n=(0,b.ap)("createdAt");if(!t)return(0,se.jsx)(d.WV,{});if(!e.length)return(0,se.jsx)(P.Ay,{feature:"Home",mode:"NoNodesView",children:(0,se.jsx)(B.A,{})});const r=new Date(n).getTime()>ba;return et.OH&&1===e.length&&r?(0,se.jsx)(P.Ay,{feature:"Home",mode:"SingleNodeHome",children:(0,se.jsx)(Ms,{nodeId:e[0]})}):(0,se.jsxs)(P.Ay,{feature:"Home",children:[(0,se.jsx)(ja,{}),(0,se.jsxs)(V.A,{gap:4,padding:[4],overflow:"auto",children:[et.OH&&(0,se.jsx)(ss,{}),(0,se.jsx)(Ql,{}),(0,se.jsxs)(re.Flex,{gap:4,children:[(0,se.jsx)(aa,{width:"60%"}),(0,se.jsxs)(re.Flex,{column:!0,gap:4,height:"100%",width:"calc(40% - 16px)",children:[(0,se.jsxs)(re.Flex,{gap:4,children:[(0,se.jsx)(da,{flex:{grow:"1",shrink:"0"}}),(0,se.jsx)(ha,{flex:{grow:"1",shrink:"0"}}),(0,se.jsx)(ga,{flex:{grow:"1",shrink:"0"}})]}),(0,se.jsx)(fa,{flex:"grow"})]})]})]})]})};var ya=n(7234),wa=n(89711);var Ca=n(84060),Ia=n(31035),Aa=n(2863),ka=n(49916);var Sa=n(46587);const Ta=()=>{const e=(0,b.vt)(),t=(0,E.nl)(),n=(0,o.ES)(e),r=(0,Sa.uW)("isAnonymous"),{value:i}=(0,E.BQ)(t),s=i?.agents?.[0]||{},l="windows"==(s.application?.os?.kernel||"").toLowerCase();return{hasAccess:!(n&&r&&l),reason:"windowsAgent"}};var Ma=n(14457),Fa=n(93933),Na=n(15524);const La=dn.default.div.withConfig({displayName:"styled__Separator",componentId:"sc-1fhfk7c-0"})(["background:",";height:20px;width:1px;"],(0,re.getColor)("border")),$a=e=>{let{flavour:t,...n}=e;const o=(0,E.nl)(),i=(0,er.Xt)(o),{critical:s,warning:l}=(0,Jo.AO)(i),a=(0,H.Fw)("sidebarTab",{flavour:"val",extraKey:t}),c=(0,H.Fw)("sidebarOpen",{flavour:"bool"}),d=(0,r.useCallback)((e=>{c(!0),a(e)}),[c,a]),{id:u,hw:h={},cpus:x,isLive:g,name:m,os:p={},state:f,updateSeverity:j,labels:b,version:v,health:y,capabilities:w}=(0,E.xY)(o),{silencingState:C}=y?.alerts||{},I={dataTestId:"singleNode",isLive:g},A=(0,it.t3)({count:s,type:"critical",...I}),k=(0,it.t3)({count:l,type:"warning",...I}),S=(0,it.GM)(f),T=(0,it.Pg)(h.container,h.virtualization),M=(0,ho.A)("(min-width: 1760px)"),F=(0,E.TC)();return(0,se.jsxs)(re.Flex,{alignItems:"center",background:"panelBg",border:{side:"all",color:"border"},"data-testid":"singleNode-badges-container",flex:!1,gap:1,padding:[1,2],round:1,...n,children:[(0,se.jsx)(re.TextSmall,{"data-testid":`singleNode-${m}`,strong:!0,children:m}),(0,se.jsx)(ft.A,{badge:"info","data-testid":"singleNode-nodeInfo-cta",children:(0,se.jsx)(re.IconButton,{flavour:"borderless",cursor:"pointer",onClick:()=>{F(u),d("info")},icon:"information",iconColor:"nodeBadgeColor",width:"18px",height:"18px"})}),(0,se.jsx)(La,{"data-testid":"singleNode-separator"}),(0,se.jsx)(ft.A,{badge:"alerts",nodeName:m,children:(0,se.jsx)(re.AlertMasterCard,{onClick:A.text||k.text?()=>F(u,{},"/alerts"):null,pillLeft:A,pillRight:k})}),(0,se.jsx)(La,{"data-testid":"singleNode-separator"}),(0,se.jsx)(Qt,{node:{id:u,name:m,isLive:g,capabilities:w},padding:[0,1]}),j&&(0,se.jsx)(Vt.A,{"data-testid":"singleNode-update-cta",name:m,os:p.id,container:h.container,warningLevel:j,labels:b,version:v,text:j}),(0,se.jsx)(La,{"data-testid":"singleNode-separator"}),(0,se.jsx)(ft.A,{badge:"connectivity",connectivityState:S,"data-testid":"singleNode-connectivityStateInfo",nodeName:m,children:(0,se.jsx)(re.Pill,{flavour:"neutral",hollow:!0,children:S})}),(0,se.jsx)(ft.A,{badge:"type","data-testid":"singleNode-nodeTypeInfo",nodeName:m,nodeType:T.label,children:(0,se.jsx)(re.Pill,{flavour:"neutral",hollow:!0,icon:T.icon,children:T.label})}),M&&(0,se.jsx)(ft.A,{badge:"systemInfo","data-testid":"singleNode-systemInfo",nodeName:m,children:(0,se.jsxs)(re.Pill,{flavour:"neutral",hollow:!0,icon:Qe.u[p.nm]?.iconName||Qe.U[p.id]?.iconName||"os",children:[(0,it.O)(h.cpuFrequency)," (",x," ",1===h.cpus?"Core":"Cores",") -"," ",(0,it.RI)(h.memory)," RAM - ",(0,it.RI)(h.diskSpace)]})}),(0,se.jsx)($t.A,{flavour:"node",silencing:C})]})},Da=()=>{const e=(0,E.aH)(),t=(e=>(0,r.useMemo)((()=>({overview:{id:"overview",title:"Metrics",icon:"room_overview",path:`${e}`,dataGa:"view-picker::click-view-overview::node-view",testId:"viewPicker-singleNode-overview",tooltip:{title:"Node Metrics",description:"View real-time and historical metrics for system resources, containers, VMs, and applications on this node"}},top:{id:"top",title:"Top",icon:"top",path:`${e}/top`,dataGa:"view-picker::click-view-fn::global-overview",testId:"viewPicker-singleNode-fn",tooltip:{title:"Node Top Consumers",description:"Monitor resource-heavy processes, containers, VMs, services, queries, and system components in real-time"}},logs:{id:"logs",title:"Logs",icon:"logs",path:`${e}/logs`,dataGa:"view-picker::click-view-logs::global-overview",testId:"viewPicker-singleNode-logs",tooltip:{title:"Node Logs",description:"Browse and search through system logs, application logs, and service logs from this node"}},alerts:{id:"alerts",title:"Alerts",icon:"alarm",path:`${e}/alerts`,dataGa:"view-picker::click-view-alerts::node-view",testId:"viewPicker-singleNode-alerts",tooltip:{title:"Node Alerts",description:"View active alerts, alert history, and alert configurations for this specific node"}},ar:{id:"ar",title:"Anomalies",icon:"anomaliesLens",path:`${e}/anomalies`,dataGa:"view-picker::click-view-anomalies::node-view",testId:"viewPicker-singleNode-anomalies",tooltip:{title:"Node Anomaly Advisor",description:"AI-powered anomaly detection showing unusual patterns and deviations in node metrics"}},events:{id:"events",title:"Events",icon:"feed",path:`${e}/events`,dataGa:"view-picker::click-view-feed::node-view",testId:"viewPicker-singleNode-feed",tooltip:{title:"Node Events",description:"Track configuration changes, deployments, restarts, and other significant events on this node"}}})),[e]))(e);return(0,r.useMemo)((()=>[t.overview,t.top,t.logs,t.alerts,t.ar,t.events].filter(Boolean)),[e])};var Ba=n(10444);const Pa=(0,dn.default)(re.Box).attrs((e=>({width:"6px",height:"6px",round:"50%",...e}))).withConfig({displayName:"withNotification__NotificationDot",componentId:"sc-ka7a4g-0"})([""]),Ra=e=>t=>{let{notificationBg:n,...r}=t;return n?(0,se.jsxs)(re.Flex,{position:"relative",gap:1,padding:[0,0,0,1.5],children:[(0,se.jsx)(Pa,{background:n,position:"absolute",top:-2,left:0}),(0,se.jsx)(e,{...r})]}):(0,se.jsx)(e,{...r})},Va=(0,dn.keyframes)(["0%{transform:translateY(-5px) scale(1);}25%{transform:translateY(-10px) scale(0.7);}50%{transform:translateY(-5px) scale(1);}75%{transform:translateY(0) scale(1.3);}100%{transform:translateY(-5px) scale(1);}"]),Oa=(0,dn.default)(re.Icon).attrs({name:"long_arrow_up",color:"successText"}).withConfig({displayName:"tabLink__DropHereIcon",componentId:"sc-1h4dha1-0"})(["animation:"," 1s ease-in infinite;"],Va),Ea=e=>{let{active:t,highlight:n,iconColor:r}=e;return r||(n||t?"primary":"textDescription")},_a=Ra(re.Icon),za=e=>{let{id:t,to:n,params:o,exact:i,icon:s,iconColor:l,title:a,fixed:c,dataGa:d,testId:u,children:h,type:x,tooltip:g,showBorderLeft:m,droppable:p,droppableProps:j={},ref:b,isDynamic:v,highlight:y,...w}=e;const{sendLog:C}=(0,Zt.A)(),{setNodeRef:I,active:A}=(0,Ee.zM)({id:`droppable-tab-${t}`,disabled:!p,data:j}),k=(0,f.RQ)(i?n:`${n}/*`),S=(0,f.Zp)(),M=(0,Ba.J)(),F=!!k,N="nodes"!==x||F,L=(0,r.useCallback)((()=>{if(F)return;const e=`${n}${o?`/${o}`:""}`;S(e),C({feature:"Navigation",description:"Single page navigation using static tabs",tab:t,path:e})}),[t,n,F,o,C]),$=p&&A&&A.data.current?.dashboardable,D=(0,r.useRef)(),[B]=(0,T.m0)({tabId:t}),P=(0,r.useCallback)((e=>{let{button:t}=e;v&&1===t&&"function"===typeof w.onRemove&&w.onRemove(w.index,F)}),[v,w.index,F,w.onRemove]);return(0,se.jsx)(Oe.A,{content:g||a,align:g?"bottom":"top",isBasic:"string"===typeof(g||a),...y?{color:"primary"}:{},children:(0,se.jsxs)(re.NavigationTab,{ref:(0,re.mergeRefs)(I,b,D),fixed:c,active:F,showBorderLeft:m,icon:(0,se.jsx)(_a,{name:s,size:"small",color:Ea({active:F,highlight:y,iconColor:l}),notificationBg:B?.color}),onActivate:L,"data-ga":d,"data-testid":u,"aria-selected":F,...$&&{rootProps:{background:"successSemi",cursor:"alias"}},onMouseUp:P,...w,children:[!M&&!!a&&(0,se.jsx)(re.Text,{alignSelf:"center",strong:y,color:Ea({active:F,highlight:y,iconColor:l}),whiteSpace:"nowrap",children:a}),D.current&&$&&(0,se.jsx)(re.Drop,{target:D.current,align:{top:"bottom"},stretch:!1,hideShadow:!0,zIndex:1,children:(0,se.jsx)(Oa,{})}),N&&h]})})},Ha={singleNode:"singleNode",logs:"logs",top:"fn",feed:"feed",anomalies:"anomalies",default:"singleNode",alerts:"alerts"},Ka=(0,r.memo)((()=>{const e=Da(),t=(0,f.RQ)("/spaces/:spaceSlug/rooms/:roomSlug/nodes/:nodeId/:path"),n=t&&Ha[t.params.path]||Ha.default;return(0,se.jsxs)(re.Flex,{justifyContent:"start",alignSelf:"start",alignItems:"end",width:"100%",height:"100%",overflow:"auto",background:"mainBackground",children:[(0,se.jsx)($a,{flavour:n,background:"mainBackground",border:void 0}),(0,se.jsx)(re.TabSeparator,{}),e.map(((e,t)=>{let{id:n,icon:r,title:o,path:i,...s}=e;return(0,se.jsx)(za,{exact:!0,fixed:!0,to:i,icon:r,title:o,id:n,rootProps:{background:"mainBackground"},showBorderLeft:0===t,...s},`${n}-${t}`)}))]})})),Wa=Ka;var Ga=n(47413),qa=n(17178),Ua=n(5722);const Ja=()=>{const{active:e}=(0,Ee.fF)(),t=(0,g.JT)("dashboard:Create"),n=(0,b.dg)();return t&&e&&!n?(0,se.jsx)(za,{to:"",id:"plus",icon:"plus",fixed:!0,droppable:!0,droppableProps:{dropArea:!0,dashboardId:"new"},testid:"roomDropdownMenu-roomOptions",disabled:!t||n}):null},Xa=e=>{let{title:t,path:n,children:o,index:i,ref:s,tooltip:l,type:a,id:c,...d}=e;const u=(0,Jo.JL)("alerts"===a?c:null,"name"),h=(0,Jo.JL)("alerts"===a?c:null,"instanceName"),x=(0,Jo.JL)("alerts"===a?c:null,"nodeId"),g=(0,E.xY)("alerts"===a?x:null,"name"),m=(0,E.xY)("nodes"===a?c:null,"name"),p=(0,r.useMemo)((()=>{if("alerts"===a){const e=[];return h&&e.push(`Instance: ${h}`),g&&e.push(`Node: ${g}`),{title:`Alert: ${u||t||"Unknown"}`,description:e.length>0?e.join(" \u2022 "):"View detailed information about this alert"}}return"nodes"===a?{title:`Node: ${m||t||"Unknown"}`,description:"View node metrics, logs, top consumers, anomalies, and more."}:"dashboards"===a?{title:`Dashboard: ${t||"Unknown"}`,description:"View custom dashboard"}:l}),[a,l,t,u,h,g,m]);return(0,se.jsx)(za,{ref:s,isDynamic:!0,showBorderLeft:0===i,to:n,title:t,tooltip:p,"data-testid":`navigation-dynamicTab-${t}`,index:i,type:a,id:c,...d,children:o})},Ya=e=>{let{staticPaths:t,...n}=e;const[r,o,i]=(0,Ga.A)(t),s=(0,Na.A)("horizontal");return(0,se.jsx)(re.BaseDraggableTabs,{onDragEnd:o,onTabClose:i,items:r,Item:Xa,...n,ref:s})},Za=()=>(0,se.jsx)(f.BV,{children:(0,se.jsx)(f.qh,{path:"/spaces/:spaceSlug/rooms/:roomSlug/nodes/:nodeId/*",element:(0,se.jsx)(Wa,{})})}),Qa=(0,r.memo)((()=>{const[e,t]=(0,qa.A)();return(0,Ua.A)()?(0,se.jsxs)(re.NavigationTabs,{subTabs:(0,se.jsx)(Za,{}),children:[e.map(((e,t)=>{let{id:n,icon:r,title:o,path:i,...s}=e;return(0,se.jsx)(za,{fixed:!0,to:i,icon:r,title:o,id:n,...s},`${n}-${t}`)})),(0,se.jsx)(re.TabSeparator,{}),(0,se.jsx)(Ya,{staticPaths:t}),(0,se.jsx)(Ja,{})]}):null})),ec=Qa,tc=()=>{const e=(0,Et.eg)(),t=`/spaces/${(0,b.bq)()}/rooms/${(0,v.QW)()}/overview`,n=(0,f.Zp)();(0,r.useEffect)((()=>{if(e)return(0,xo.unregister)(e.on("goToLink",((e,r)=>{let o=location.pathname;return e&&e.getParent().getAttribute("roomId")&&(o=e.getParent().getId(),o=/^\/spaces/.test(o)?o:t),n(o,r?{state:{chartName:r},replace:!0}:{state:{contextToGo:e?.getAttribute("contextScope")?.[0]},replace:!0})})))}),[e,t])},nc=()=>(tc(),null);var rc=n(73937),oc=n(21885),ic=n(65637),sc=n(55177),lc=n(73980),ac=n(45026);const cc=`dyncfg-edit-alet-warning-dismiss-${window.envSettings?.visitor}`,dc={lineHeight:1.6},uc=e=>{let{alertName:t,nodeIds:n=[]}=e;const i="true"===localStorage.getItem(cc),[s,,,l]=(0,pe.A)(!i),[a,c]=(0,r.useState)(),d=(0,E.xY)(n[0],"name"),u=n.length-1,h=u>0?` and ${u} other nodes`:"",x=(0,r.useCallback)((e=>{c(e)}),[c]),g=(0,r.useCallback)((()=>{a&&localStorage.setItem(cc,!0),l()}),[a,l]);return s?(0,se.jsx)(re.Modal,{backdropContainerProps:{zIndex:"60"},backdropProps:{backdropBlur:!0},children:(0,se.jsxs)(re.ModalContent,{children:[(0,se.jsx)(re.ModalHeader,{children:(0,se.jsx)(re.H4,{children:"Editing Alerts"})}),(0,se.jsx)(re.ModalBody,{children:(0,se.jsxs)(re.Flex,{column:!0,gap:2,width:{max:120},children:[(0,se.jsxs)(re.TextBig,{...dc,children:["You are about to edit the alert ",(0,se.jsx)(re.TextBig,{color:"primary",children:t}),d?(0,se.jsxs)(se.Fragment,{children:[" ","on node ",(0,se.jsx)(re.TextBig,{color:"primary",children:d}),h]}):null,"."]}),(0,se.jsx)(re.TextBig,{...dc,children:'Keep in mind that alerts in Netdata are templates that are applied to all instances of the same kind (e.g. editing a disk alert, means you are changing the alerts for all disks on that node). If you want to overwrite the rules for a single instance, do not change the current rules. Instead add a new rule and select "Apply to a specific instance" for that rule, matching the instance you want to overwrite.'}),o.Ay?(0,se.jsx)(re.TextBig,{...dc,children:'To apply an alert on all your currently connected nodes, edit it and select "Submit to Multiple Nodes".'}):(0,se.jsx)(re.TextBig,{...dc,children:'When having parents and you have connected both parents and children to Netdata Cloud, the alert needs to be altered on both Netdata parents and children, otherwise one of the two will be using the old version. To apply an alert on multiple nodes, edit it and select "Submit to Multiple Nodes".'})]})}),(0,se.jsxs)(re.ModalFooter,{justifyContent:"between",children:[(0,se.jsxs)(re.Flex,{gap:2,alignItems:"center",children:[(0,se.jsx)(re.Checkbox,{checked:a,onChange:x}),(0,se.jsx)(re.TextBig,{children:"Don't show this again"})]}),(0,se.jsx)(re.Button,{type:"button",flavour:"hollow",label:"OK",textTransform:"uppercase",onClick:g})]})]})}):null},hc=(0,r.memo)((()=>{const{node:e}=(0,rc.Z)(),{alertName:t,nodeIds:n,title:o}=(0,ac.A)(),{loaded:i,tree:s}=(0,ic.A)(n?{value:n?.[0]}:e),l=(0,r.useMemo)((()=>s?.[oc.$7]?.[o]||{}),[s,o]),a=(0,r.useMemo)((()=>!!Object.keys(l||{}).length),[l]);return i&&t?(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(lc.A,{flavour:"entity",title:o,entityProps:l,isOpen:a,isEditFromState:!0,renderChildren:e=>(0,se.jsx)(sc.A,{id:o,...l,...e})},JSON.stringify({loaded:i,alertName:t,alertItemExists:a})),l?(0,se.jsx)(uc,{alertName:t,nodeIds:n}):null]}):null})),xc=hc,gc=(0,r.memo)((()=>{const{node:e}=(0,rc.Z)(),{path:t}=(0,ic.A)(e),n=(0,Yt.sh)({node:e,path:t}),{entityProps:r,...o}=n||{};return n?(0,se.jsx)(lc.A,{id:n.template,flavour:"entity",title:`${n.template}:placeholder`,entityProps:{...r,...o},isNewItem:!0,formData:n.formData,renderChildren:e=>(0,se.jsx)(sc.A,{...r,...e,id:n.template,isNewItem:!0})}):null})),mc=gc,pc=(0,i.A)((()=>Promise.all([n.e(5638),n.e(3864),n.e(3457)]).then(n.bind(n,93457))),"ManageSpaceRoute"),fc=(0,i.A)((()=>n.e(2201).then(n.bind(n,52201))),"Trial"),jc=(0,i.A)((()=>n.e(5302).then(n.bind(n,5302))),"PreferredNodesModal"),bc=(0,i.A)((()=>Promise.resolve().then(n.bind(n,61314))),"JoinSpace"),vc=(0,i.A)((()=>n.e(7530).then(n.bind(n,17530))),"NoSpaceAccess"),yc=(0,i.A)((()=>n.e(6333).then(n.bind(n,96333))),"EmptyRoom"),wc=(0,i.A)((()=>n.e(1910).then(n.bind(n,11910))),"AlertView"),Cc=(0,i.A)((()=>n.e(7316).then(n.bind(n,74935))),"Anomalies"),Ic=(0,i.A)((()=>Promise.resolve().then(n.bind(n,19440))),"AlertsSmartboard"),Ac=(0,i.A)((()=>n.e(7214).then(n.bind(n,27214))),"DashboardsOverview"),kc=(0,i.A)((()=>Promise.all([n.e(180),n.e(4424),n.e(5297)]).then(n.bind(n,95297))),"DashboardView"),Sc=(0,i.A)((()=>Promise.all([n.e(5638),n.e(5388),n.e(7791)]).then(n.bind(n,47791))),"FunctionsView"),Tc=(0,i.A)((()=>Promise.all([n.e(687),n.e(3864),n.e(2439),n.e(4209)]).then(n.bind(n,24209))),"Insights"),Mc=(0,i.A)((()=>Promise.all([n.e(687),n.e(3864),n.e(2439),n.e(3808)]).then(n.bind(n,43808))),"InsightsReport"),Fc=(0,i.A)((()=>n.e(2792).then(n.bind(n,32792))),"Onboarding"),Nc=(0,i.A)((()=>Promise.all([n.e(3864),n.e(8791),n.e(9462),n.e(5187)]).then(n.bind(n,89462))),"Integrations"),Lc=(0,i.A)((()=>Promise.all([n.e(180),n.e(2003)]).then(n.bind(n,92003))),"DropInDashboard"),$c=(0,i.A)((()=>n.e(3185).then(n.bind(n,73185))),"Marketplace"),Dc=(0,i.A)((()=>n.e(3675).then(n.bind(n,33675))),"AlertConfigAiModal"),{demoSlug:Bc,demoDefaultRoomViews:Pc,defaultRoomView:Rc,onboardingView:Vc,integrationsView:Oc}=x.A,Ec=oi(Ei(ri)),_c=Ei(ri),zc=(0,r.memo)((()=>{const[e,t]=(0,fr.Ay)(),n=Bc===e?Pc[t]||Pc.default:o.Ay&&t===o.Iy?o.kG:Rc;return(0,se.jsxs)(r.Suspense,{fallback:(0,se.jsx)(d.zj,{}),children:[(0,se.jsx)(r.Suspense,{fallback:"",children:(0,se.jsx)(Lc,{})}),(0,se.jsx)(f.BV,{children:(0,se.jsx)(f.qh,{path:"nodes/:nodeId/*",element:(0,se.jsx)(Jn,{})})}),(0,se.jsxs)(f.BV,{children:[(0,se.jsx)(f.qh,{path:Vc,element:(0,se.jsx)(r.Suspense,{fallback:(0,se.jsx)(d.NP,{}),children:(0,se.jsx)(Fc,{})})}),(0,se.jsx)(f.qh,{path:Oc,element:(0,se.jsx)(r.Suspense,{fallback:(0,se.jsx)(d.H$,{}),children:(0,se.jsx)(Nc,{flavour:"settingsPage"})})}),(0,se.jsx)(f.qh,{path:"nodes/:nodeId",element:(0,se.jsx)(Ec,{})}),(0,se.jsx)(f.qh,{path:"nodes/:nodeId/alerts",element:(0,se.jsx)(Ic,{})}),(0,se.jsx)(f.qh,{path:"nodes/:nodeId/anomalies",element:(0,se.jsx)(r.Suspense,{fallback:(0,se.jsx)(d.Bm,{}),children:(0,se.jsx)(Cc,{})})}),(0,se.jsx)(f.qh,{path:"nodes/:nodeId/top",element:(0,se.jsx)(Sc,{flavour:"fn"},"fn")}),(0,se.jsx)(f.qh,{path:"nodes/:nodeId/logs",element:(0,se.jsx)(Sc,{flavour:"logs"},"logs")}),(0,se.jsx)(f.qh,{path:"nodes/:nodeId/events",element:(0,se.jsx)(Sc,{flavour:"feed"},"feed")}),(0,se.jsx)(f.qh,{path:"nodes",element:(0,se.jsx)(Un,{})}),(0,se.jsx)(f.qh,{path:"home",element:(0,se.jsx)(va,{})}),(0,se.jsx)(f.qh,{path:"overview",element:(0,se.jsx)(_c,{})}),(0,se.jsx)(f.qh,{path:"alerts/:alertId",element:(0,se.jsx)(r.Suspense,{fallback:(0,se.jsx)(d.xh,{}),children:(0,se.jsx)(wc,{})})}),(0,se.jsx)(f.qh,{path:"alerts",element:(0,se.jsx)(Ic,{})}),(0,se.jsx)(f.qh,{path:"alarms/:alertId",element:(0,se.jsx)(wc,{})}),(0,se.jsx)(f.qh,{path:"alarms",element:(0,se.jsx)(f.C5,{replace:!0,to:`/spaces/${e}/rooms/${t}/alerts`})}),(0,se.jsx)(f.qh,{path:"functions",element:(0,se.jsx)(f.C5,{replace:!0,to:`/spaces/${e}/rooms/${t}/top`})}),(0,se.jsx)(f.qh,{path:"dashboard",element:(0,se.jsx)(kc,{customDashboardId:o.LA})}),(0,se.jsx)(f.qh,{path:"dashboards/:dashboardSlug",element:(0,se.jsx)(r.Suspense,{fallback:(0,se.jsx)(c.O2,{}),children:(0,se.jsx)(kc,{})})}),(0,se.jsx)(f.qh,{path:"dashboards",element:(0,se.jsx)(Ac,{})}),(0,se.jsx)(f.qh,{path:"kubernetes",element:(0,se.jsx)(_c,{flavour:"k8s"})}),(0,se.jsx)(f.qh,{path:"anomalies",element:(0,se.jsx)(r.Suspense,{fallback:(0,se.jsx)(d.Bm,{}),children:(0,se.jsx)(Cc,{})})}),(0,se.jsx)(f.qh,{path:"top",element:(0,se.jsx)(Sc,{flavour:"fn"},"fn")}),(0,se.jsx)(f.qh,{path:"logs",element:(0,se.jsx)(Sc,{flavour:"logs"},"logs")}),(0,se.jsx)(f.qh,{path:"events",element:(0,se.jsx)(Sc,{flavour:"feed"},"feed")}),(0,se.jsx)(f.qh,{path:`${m.p9}/:reportId`,element:(0,se.jsx)(Mc,{})}),(0,se.jsx)(f.qh,{path:"insights/*",element:(0,se.jsx)(r.Suspense,{fallback:(0,se.jsx)(d.BJ,{}),children:(0,se.jsx)(Tc,{})})}),(0,se.jsx)(f.qh,{path:"/",element:(0,se.jsx)(f.C5,{replace:!0,to:`/spaces/${e}/rooms/${t}/${n}`})})]})]})})),Hc=()=>{const{isOnboardingPath:e,path:t}=(0,u.A)(),{isIntegrationsPath:n}=(0,Ma.Q)(),[i,l]=(0,Ma.A)(),a=(0,b.vt)(),c=(0,v.ID)(),h=(0,s.I)(),x=(0,D.gr)(c,"ids"),g=(0,D.gr)(c,"loaded"),m=(0,b.bE)(a,"isEmpty"),j=(0,r.useMemo)((()=>!0===g&&!x.length),[g,x]),y=(0,o.Az)(a);return((e,t)=>{const n=(0,p.yF)((0,r.useCallback)((async(n,r)=>{await n((0,v.LS)({id:t,key:"fullyLoaded"}))||(0,Xn.K8)(e,t).then((t=>{let{data:n}=t;return r((0,v.If)(n.id),{...n,spaceId:e,fullyLoaded:!0,loaded:!0})}))}),[e,t]));(0,r.useEffect)((()=>{e&&t&&n()}),[e,t])})(a,c),(0,Yn.A)({spaceId:a,id:c,pollingInterval:63e3}),rr(a,c),or(a,c),(0,ir.A)(a,c),function(e,t){let{types:n,entities:o,paths:i,names:s}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const l=(0,p.yF)(((r,l)=>{(0,wa.Uc)(e,t,{types:n,entities:o,paths:i,names:s}).then((n=>{let{data:r}=n;l((0,jo.Mg)({spaceId:e,roomId:t}),r),l((0,ya.w7)({spaceId:e,roomId:t}),!0),l((0,Ce.n_)({spaceId:e,roomId:t}))}))}));(0,r.useEffect)((()=>{e&&t&&l()}),[e,t,n,o,i,s])}(a,c),$(),(0,r.useEffect)((()=>{y||l||h||m(i)}),[y,i,h,l,m]),h?(0,se.jsx)(r.Suspense,{fallback:"",children:(0,se.jsx)($c,{subCallback:h})}):l?(0,se.jsx)(d.Qk,{}):y||!i||!t||e||n?!j||e||n?(0,se.jsx)(zc,{}):(0,se.jsx)(yc,{}):(0,se.jsx)(f.C5,{to:t,replace:!0})},Kc=(0,a.Xc)((0,r.memo)((()=>{const e=(0,g.JT)("space:Read"),t=(0,g.JT)("room:Read"),{hasAccess:n,reason:o}=Ta();return e?n?(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(ec,{}),(0,se.jsx)(r.Suspense,{fallback:(0,se.jsx)(d.Qk,{}),children:(0,se.jsxs)(f.BV,{children:[(0,se.jsx)(f.qh,{path:"spaces/:spaceSlug/join-space",element:(0,se.jsx)(bc,{})}),(0,se.jsx)(f.qh,{path:"spaces/:spaceSlug/no-rooms",element:(0,se.jsx)(vc,{reason:"noRooms"})}),(0,se.jsx)(f.qh,{path:"spaces/:spaceSlug/settings/*",element:(0,se.jsx)(Wc,{})}),(0,se.jsx)(f.qh,{path:"spaces/:spaceSlug/rooms/:roomSlug/*",element:t?(0,se.jsx)(Hc,{}):(0,se.jsx)(vc,{reason:"noRoomPermission"})})]})})]}):(0,se.jsx)(vc,{reason:o}):(0,se.jsx)(vc,{reason:"noSpacePermission"})}))),Wc=()=>((0,fr.KI)(),(0,se.jsx)(pc,{})),Gc=()=>{const e=(0,b.vt)();return(0,Ca.A)(e),(0,Ia.A)(e),(e=>{const t=(0,p.yF)((0,r.useCallback)((function(t,n){let{data:{results:r}}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n((0,Aa.S)({id:e}),r)}),[e])),n=(0,p.yF)((0,r.useCallback)(((t,n,r)=>{n((0,Aa.S)({id:e,key:"error"}),r)}),[e])),o=(0,ka.sC)(e,"loaded"),i=(0,g.JT)("alert:ReadAll");(0,j.A)((()=>({enabled:i&&!!e&&o,fetch:()=>(0,Qn.C2)(e),onFail:n,onReceive:t,pollingOptions:{pollingInterval:15e4}})),[e,!!o,i])})(e),null},qc=(0,a.Xc)((()=>{const e=(0,b.vt)();return(0,Fa.Ay)(),(0,r.useEffect)((()=>{const e=(0,l.A)(new URL(window.location.href).searchParams.get("join_callback"));e&&(window.location.href=e)}),[]),e?(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(Gc,{}),(0,se.jsx)(h.A,{permission:"space:Read",children:t=>t?(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(f.BV,{children:(0,se.jsx)(f.qh,{path:"/*",element:(0,se.jsx)(nc,{})})}),(0,se.jsx)(r.Suspense,{fallback:(0,se.jsx)(d.Qk,{}),children:(0,se.jsx)(Kc,{})})]}):(0,se.jsx)(vc,{reason:"noSpacePermission"},e)}),(0,se.jsx)(r.Suspense,{fallback:"",children:(0,se.jsx)(fc,{})}),(0,se.jsxs)(r.Suspense,{fallback:"",children:[(0,se.jsx)(jc,{}),(0,se.jsx)(mc,{}),(0,se.jsx)(xc,{}),(0,se.jsx)(Dc,{})]})]}):(0,se.jsx)(d.Qk,{})}))},30863:(e,t,n)=>{n.d(t,{A:()=>D});n(98992),n(54520),n(81454);var r=n(96540),o=n(63766),i=n(73700),s=n(69457),l=n(51220),a=n(53749),c=n(48106),d=n(20871);n(72577);let u=null;n(25509),n(65223),n(60321),n(41927),n(11632),n(64377),n(66771),n(12516),n(68931),n(52514),n(35694),n(52774),n(49536),n(21926),n(94483),n(16215);var h=n(57530),x=n(43375);n(8872);var g=n(33185),m=n(98131),p=n(33962),f=n(4719),j=n(56876),b=n(549),v=n(74848);const y=(0,r.memo)((e=>{let{id:t,name:n,icon:i,isLast:s}=e;const{onMenuClick:l}=(0,j.A)(),a=(0,r.useCallback)((()=>{l({id:t})}),[t,l]),c=(0,r.useMemo)((()=>({alignItems:"center",gap:1,...s?{}:{cursor:"pointer",onClick:a}})),[s,a]);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(o.Flex,{...c,children:[i?(0,v.jsx)(m.o,{icon:i,active:!0,containerProps:{width:"auto"}}):null,(0,v.jsx)(o.Text,{color:"primary",strong:!0,children:n})]}),s?null:(0,v.jsx)(o.Text,{color:"primary",strong:!0,children:">"})]})})),w=(0,r.memo)((e=>{let{menu:t}=e;const{id:n,shortName:i,name:s,icon:l,parentMenus:a}=t||{},c=(0,r.useMemo)((()=>[...a||[],{id:n,name:i||s,icon:l}]),[t]);return n?(0,v.jsx)(o.Flex,{alignItems:"center",gap:1,children:c.map(((e,t)=>(0,v.jsx)(y,{isLast:t===c.length-1,...e},e.id)))}):null})),C=(0,g.default)(o.Flex).attrs((e=>({position:"sticky",top:0,width:"100%",alignItems:"center",justifyContent:"between",padding:[2,1,2,2],zIndex:15,...e}))).withConfig({displayName:"headerAggregator__StyledContainer",componentId:"sc-10l70s7-0"})(["backdrop-filter:blur(5px);"]),I=["nodes"],A=e=>{let{flavour:t,tools:n=[],hasFilters:i}=e;const s=(0,p.W2)(),l=(0,f.b)(s),a=(0,r.useContext)(g.ThemeContext);return!I.includes(t)&&l?(0,v.jsxs)(C,{background:(0,o.getRgbColor)("mainBackground",.8)({theme:a}),children:[(0,v.jsx)(w,{menu:l}),(0,v.jsx)(b.G,{menuId:s,menuName:l.shortName||l.name,hasFilters:i,flavour:t,parentIds:l.parentIds,hasCharts:!0,children:n.map((e=>{let{Component:t,...n}=e;return t?(0,v.jsx)(t,{...n},n.id):null}))})]}):null},k=(0,r.memo)(A),S="8px 2px",T="1px 2px",M={root:T,submenu:T,default:S},F=[{flavour:"root",id:"System-0"}],N=(0,r.memo)((e=>{let{getComponent:t,element:n,index:o,...i}=e;const s=(0,r.useMemo)((()=>n&&t(n)),[n?.id,o]),l=(0,r.useMemo)((()=>!!F.find((e=>{let{id:t,flavour:r}=e;return t===n.id&&r===n.flavour}))),[n]);return!s||l?null:(0,v.jsx)(s,{...n,index:o,...i,isVisible:!0},n.id)})),L=(0,r.memo)((e=>{let{flavour:t,elements:n,onScroll:s,dashboardOptions:a,getComponent:d,stickyBg:g="mainBackground",stickyRef:m,nextStickyRef:p,stickyIndexes:f,tmpStickyRef:j,containerWidth:b,headerProps:y={},ref:w}=e;const C=(e=>{const t=(0,r.useRef)(),n=(0,r.useRef)(),o=(0,r.useRef)(0),i=(0,r.useRef)(0);return(0,r.useCallback)((r=>{if(t.current!==e.length&&(i.current=0),n.current&&(i.current<5||t.current!==e.length)){i.current=i.current+1,t.current=e.length;const s=e.findIndex((e=>e.id===n.current.id));if(-1===s)return;const{start:l}=r.getMeasurements()[s];return r.scrollToOffset(l+o.current),clearTimeout(u),void(u=setTimeout((()=>i.current=5),200))}t.current=e.length;const s=r.scrollOffset;let l=0;const a=r.getMeasurements().find((e=>(l+=e.size,l>s)));a&&(n.current=e[a.index],o.current=s-a.start)}),[e])})(n),I=(0,r.useRef)(),[A,T]=(0,r.useState)(0),F=((e,t,n)=>{let{stickyRef:o,nextStickyRef:i,tmpStickyRef:s}=n;const l=(0,r.useRef)(),{active:a}=(0,x.fF)(),c=(0,r.useRef)();return c.current=a,(0,r.useCallback)((e=>{if(c.current&&c.current.data.current.isResizer)return l.current;if(!t)return l.current=(0,h.vp)(e),l.current;i.current=Number(Object.keys(t).find((t=>e.startIndex<t))),o.current=Number(Object.keys(t).reverse().find((t=>e.startIndex>=t))),i.current-e.startIndex===1&&(o.current=NaN);let n=(0,h.vp)(e);return null!==s.current&&(n=[...n,s.current]),isNaN(o.current)?l.current=[...new Set(n)].sort(((e,t)=>e-t)):l.current=[...new Set([o.current,...n])].sort(((e,t)=>e-t)),l.current}),[e,t])})(n,f,{stickyRef:m,nextStickyRef:p,tmpStickyRef:j}),L=(0,l.Te)({count:n.length,getScrollElement:()=>w.current,overscan:2,enableSmoothScroll:!1,estimateSize:e=>n[e].size,onChange:C,rangeExtractor:F,scrollPaddingStart:0});I.current=L,(0,c.A)(L,n);const $=(0,r.useCallback)((0,i.n)(100,(function(){s(...arguments),w.current&&T(w.current.scrollTop)})),[s]);return(0,v.jsxs)("div",{ref:w,style:{minHeight:"100%",width:"100%",overflow:"auto"},onScroll:$,children:[(0,v.jsx)(k,{flavour:t,...y}),(0,v.jsxs)("div",{style:{minHeight:`${L.getTotalSize()}px`,width:"100%",position:"relative"},children:[A>0&&!isNaN(m.current)&&(0,v.jsx)(o.Box,{sx:{top:0,left:0,width:"100%",padding:S,position:"sticky",zIndex:10,boxShadow:"2px 6px 6px -7px rgba(0, 0, 0, 0.4)"},background:g,children:(0,v.jsx)(N,{...a,element:n[m.current],index:m.current,getComponent:d})},m.current),L.getVirtualItems().map((e=>{const t=M[n[e.index].flavour]||M.default;return(0,v.jsx)(o.Box,{ref:L.measureElement,sx:{top:0,left:0,width:"100%",padding:t,position:"absolute",transform:`translateY(${e.start}px)`},"data-index":e.index,children:(0,v.jsx)(N,{...a,element:n[e.index],index:e.index,getComponent:d,containerWidth:b})},e.key)}))]})]})}),((e,t)=>e.elements.length===t.elements.length&&e.containerWidth===t.containerWidth)),$=e=>{let{flavour:t,onActiveMenuId:n,getComponent:o,dashboardOptions:i,initialChartName:l,checkVisibility:c,...u}=e;const h=(0,a.bD)(),x=(0,s.qR)((e=>e.filter((e=>{const t=e.contexts||e.contextScope||e.chartIds||[e.id];return c?c(t,e.menuId||e.id,e.parentIds):h(t)})))),[{stickyRef:g,nextStickyRef:m,tmpStickyRef:p},f]=(e=>{const t=(0,s.Tg)(),n=(0,r.useRef)(null),o=(0,r.useMemo)((()=>e.reduce(((e,n,r)=>{let{id:o,sticky:i}=n;return t[o]&&"undefined"!==typeof i&&i&&(e[r]=!0),e}),{})),[e]),i=(0,r.useRef)(),l=(0,r.useRef)(),a=(0,r.useCallback)((e=>!!o[e]),[o]),c=(0,r.useCallback)((e=>i.current===e),[]);return[{stickyRef:i,nextStickyRef:l,isSticky:a,isActiveSticky:c,tmpStickyRef:n},o,t]})(x),j=(0,r.useRef)(),b=(0,r.useRef)(),y=(0,r.useMemo)((()=>(b.current&&b.current.cancel(),b.current=(0,d.A)({stickyRef:g}),()=>b.current(j.current,n))),[x.length,n]);return(0,r.useLayoutEffect)((()=>{x.length&&y()}),[x.length,l]),(0,v.jsx)(L,{flavour:t,elements:x,onScroll:y,dashboardOptions:i,getComponent:o,ref:j,stickyRef:g,nextStickyRef:m,stickyIndexes:f,tmpStickyRef:p,...u})},D=(0,r.memo)($)},31035:(e,t,n)=>{n.d(t,{$:()=>h,A:()=>x});var r=n(96540),o=n(30569),i=n(97940),s=n(24609),l=n(77389),a=n(63231),c=n(86706),d=n(82505),u=n(99728);const h=e=>`spaces.${e}.members`,x=e=>{const t=(0,s.vt)(),n=(0,o.yF)((0,r.useCallback)(((n,r,o)=>{let{results:i}=o;r((0,c.jX)({id:e,spaceId:t}),i)}),[e,t])),x=(0,u.JT)("user:ReadAll");(0,i.A)((()=>({key:h(e),autorun:!!e&&x,fetch:()=>(0,l.kE)(e),association:{getError:()=>(0,d.x2)({id:e,key:"error"}),getIds:()=>(0,c.kd)({id:e,key:"ids"}),getLoaded:()=>(0,c.kd)({id:e,key:"loaded"}),getUpdatedAt:()=>(0,c.kd)({id:e,key:"updatedAt"})},sort:(e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:"accent",ignorePunctuation:!0}),getResource:e=>(0,a.m)({id:e}),getResourcesInitializer:()=>a.WJ,onReceive:n,pollingOptions:{pollingInterval:315e3}})),[e,x])}},32755:(e,t)=>{var n="arrow-up-1-9",r=["sort-numeric-up"],o="f163",i="M450.7 38c8.3 6 13.3 15.7 13.3 26l0 96 16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-48 0-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-51.6-5.9 2c-16.8 5.6-34.9-3.5-40.5-20.2s3.5-34.9 20.2-40.5l48-16c9.8-3.3 20.5-1.6 28.8 4.4zM160 32c9 0 17.5 3.8 23.6 10.4l88 96c11.9 13 11.1 33.3-2 45.2s-33.3 11.1-45.2-2L192 146.3 192 448c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-301.7L95.6 181.6c-11.9 13-32.2 13.9-45.2 2s-13.9-32.2-2-45.2l88-96C142.5 35.8 151 32 160 32zM445.7 364.9A32 32 0 1 0 418.3 307a32 32 0 1 0 27.4 57.9zm-40.7 54.9C369.6 408.4 344 375.2 344 336c0-48.6 39.4-88 88-88s88 39.4 88 88c0 23.5-7.5 46.3-21.5 65.2L449.7 467c-10.5 14.2-30.6 17.2-44.8 6.7s-17.2-30.6-6.7-44.8l6.8-9.2z";t.mw={prefix:"fas",iconName:n,icon:[576,512,r,o,i]},t.ut=t.mw},41579:(e,t,n)=>{n.d(t,{A:()=>u});n(98992),n(3949),n(81454);var r=n(96540),o=n(30569),i=n(92726),s=n(91539),l=n(24609),a=n(19186),c=n(258),d=n(67294);const u=()=>{const e=(0,l.vt)(),t=(0,a.ID)(),n=(0,o.yF)((0,r.useCallback)((function(e,n){let{data:{results:r}={}}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(n((0,d.z_)({id:t,key:"loaded"}),!0),r?.length){const e=r.sort(((e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:"accent",ignorePunctuation:!0})));e.forEach((e=>n((0,i._d)(e.id),e)));const o=e.map((e=>{let{id:t}=e;return t}));n((0,d.z_)({id:t,key:"ids"}),o)}}),[])),u=(0,r.useCallback)((()=>{(0,c.SJ)(e,t).then(n).catch((()=>{}))}),[e,t]);return(0,s.A)((()=>({polling:!1,enabled:!!e&&!!t,fetch:()=>(0,c.SJ)(e,t),onReceive:n})),[e,t]),u}},42318:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(96540),o=n(61661),i=n(6988),s=n(32465);const l=()=>{const e=(0,o.AR)(),t=(0,s.A)(),[n,l]=(0,o.oE)(),a=(0,o.WB)(),c=(0,r.useMemo)((()=>(0,i.Cj)({searchTerm:n,integrations:e})),[n,e]),d=n?(0,i.M6)(c,t):a;return{integrations:(0,i.Fd)((0,i.xM)(d)),setSearchTerm:l}}},42964:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(74848);const o=e=>{let{isOnboarding:t,withOuties:n=!0}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("svg",{width:t?"120":"320",height:t?"120":"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute"},children:[(0,r.jsx)("g",{id:"node_inset_shadow",filter:"url(#inset_shadow)",children:(0,r.jsx)("path",{d:"M152.015 44.7406C156.958 41.8937 163.042 41.8937 167.985 44.7406L255.908 95.3794C260.867 98.2354 263.923 103.522 263.923 109.244V210.455C263.923 216.177 260.867 221.464 255.908 224.319L167.985 274.958C163.042 277.805 156.958 277.805 152.015 274.958L64.0916 224.319C59.1329 221.464 56.077 216.177 56.077 210.455V109.244C56.077 103.522 59.1329 98.2354 64.0916 95.3795L152.015 44.7406Z",fill:"rgba(0,0,0,.3)"})}),(0,r.jsx)("path",{id:"outtie_1",d:"M152.264 24.9838C157.053 22.2259 162.947 22.2259 167.736 24.9838L272.979 85.5983C277.783 88.365 280.744 93.4864 280.744 99.0299V220.192C280.744 225.735 277.783 230.856 272.979 233.623L167.736 294.238C162.947 296.996 157.053 296.996 152.264 294.238L47.0206 233.623C42.2169 230.856 39.2564 225.735 39.2564 220.192V99.0299C39.2564 93.4864 42.2169 88.365 47.0206 85.5983L152.264 24.9838Z",stroke:"#003314"}),n&&(0,r.jsx)("path",{id:"outtie_2",d:"M152.264 5.03243C157.053 2.2745 162.947 2.2745 167.736 5.03242L290.3 75.6226C295.104 78.3893 298.064 83.5108 298.064 89.0542V230.167C298.064 235.711 295.104 240.832 290.3 243.599L167.736 314.189C162.947 316.947 157.053 316.947 152.264 314.189L29.7001 243.599C24.8964 240.832 21.9359 235.711 21.9359 230.167V89.0542C21.9359 83.5107 24.8964 78.3893 29.7001 75.6226L152.264 5.03243Z",stroke:"#003314"}),(0,r.jsx)("defs",{children:(0,r.jsxs)("filter",{id:"inset_shadow",x:"56.0769",y:"42.6054",width:"207.846",height:"234.488",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,r.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,r.jsx)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),(0,r.jsx)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),(0,r.jsx)("feOffset",{}),(0,r.jsx)("feGaussianBlur",{stdDeviation:"15"}),(0,r.jsx)("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),(0,r.jsx)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0.2 0 0 0 0 0.0784314 0 0 0 1 0"}),(0,r.jsx)("feBlend",{mode:"normal",in2:"shape",result:"effect1_innerShadow_759_2378"})]})})]}),(0,r.jsxs)("svg",{width:t?"120":"320",height:t?"120":"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute"},children:[(0,r.jsx)("path",{id:"outtie_1_highlight",d:"M152.264 24.9838C157.053 22.2259 162.947 22.2259 167.736 24.9838L272.979 85.5983C277.783 88.365 280.744 93.4864 280.744 99.0299V220.192C280.744 225.735 277.783 230.856 272.979 233.623L167.736 294.238C162.947 296.996 157.053 296.996 152.264 294.238L47.0206 233.623C42.2169 230.856 39.2564 225.735 39.2564 220.192V99.0299C39.2564 93.4864 42.2169 88.365 47.0206 85.5983L152.264 24.9838Z",stroke:"#34ff84"}),n&&(0,r.jsx)("path",{id:"outtie_2_highlight",d:"M152.264 5.03243C157.053 2.2745 162.947 2.2745 167.736 5.03242L290.3 75.6226C295.104 78.3893 298.064 83.5108 298.064 89.0542V230.167C298.064 235.711 295.104 240.832 290.3 243.599L167.736 314.189C162.947 316.947 157.053 316.947 152.264 314.189L29.7001 243.599C24.8964 240.832 21.9359 235.711 21.9359 230.167V89.0542C21.9359 83.5107 24.8964 78.3893 29.7001 75.6226L152.264 5.03243Z",stroke:"#bbffd6"})]})]})}},47413:(e,t,n)=>{n.d(t,{A:()=>x});n(98992),n(81454);var r=n(96540),o=n(88934),i=n(1817),s=n(44245),l=n(93335),a=n(63766),c=n(19075),d=n(74848);const u={warning:"warning",critical:"error"},h=e=>{let{alertId:t}=e;const n=(0,c.JL)(t,"status");return u[n]?(0,d.jsx)(a.Flex,{alignSelf:"center",margin:[0,0,0,2],round:1,background:u[n],width:2,height:2}):null},x=e=>{const t=(0,o.Zp)(),n=(0,o.RQ)("/spaces/:spaceSlug/rooms/:roomSlug/:type/*"),a=(0,s._F)(),c=(0,s.xK)(),u=(0,s.NU)(),x=n?n.pathnameBase:"/spaces",{pathname:g}=(0,o.zy)(),m=(0,i.A)(e[g]&&g,!0),p=(0,r.useCallback)(((e,n)=>{if(!n)return c(e);const r=a[e-1],o=a[e+1],i=(n,r)=>{t(`${n}${r?`/${r}`:""}`),c(e)};return m?i(m):r?i(r.path,r.params):o?i(o.path,o.params):i(x)}),[a,c,x,m]);return[(0,r.useMemo)((()=>a.map((e=>({...e,children:e.id&&"nodes"===e.type?(0,d.jsx)(l.N,{nodeId:e.id}):"alerts"===e.type?(0,d.jsx)(h,{alertId:e.id}):null})))),[a]),(e,t)=>{-1===e&&-1===t||u({sourceIndex:e,destinationIndex:t})},p]}},48106:(e,t,n)=>{n.d(t,{A:()=>d});n(98992),n(72577);var r=n(96540),o=n(69457),i=n(4719),s=n(50239),l=n(66814);const a=e=>{const t=(0,r.useRef)();return(0,l.i7)(e,(e=>(t.current=e,!1))),t},c=(e,t)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.id===t)return n;if(r.children&&r.children.length>0){const e=c(r.children,t);if(-1!==e)return n+1+e}}return-1},d=(e,t)=>{const n=(0,o.NF)(),l=a(i.tu),d=a(o.i8),u=(0,s.Gr)(),h=(0,r.useMemo)((()=>({goToElement:function(n){let{leaf:r=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!(!t.length||!e)&&(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;new Promise((n=>{const r=t=>{if(0===t)return n();e(),setTimeout((()=>r(--t)))};r(t)}))}((()=>{let o=c(t,n);if(r)for(;t[o]?.level<(t[o+1]?.level??999999);)o+=1;if(-1!==o)return e.scrollToIndex(o,{align:"center"})}),5),!0)},goToLink:e=>{const t=Object.values(l.current).find((t=>t.link&&t.link===e));if(t)return h.goToElement(t.id,{leaf:!0});if(d.current){const t=Object.values(d.current).find((t=>t.link&&t.link.includes(e)));if(t)return h.goToElement(t.id,{leaf:!0})}}})),[n,t]);return(0,r.useLayoutEffect)((()=>{u(h)}),[h]),h}},48306:(e,t)=>{var n="arrow-down-1-9",r=["sort-numeric-asc","sort-numeric-down"],o="f162",i="M450.7 38c-8.3-6-19.1-7.7-28.8-4.4l-48 16c-16.8 5.6-25.8 23.7-20.2 40.5s23.7 25.8 40.5 20.2l5.9-2 0 51.6-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l48 0 48 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-16 0 0-96c0-10.3-4.9-19.9-13.3-26zM160 480c9 0 17.5-3.8 23.6-10.4l88-96c11.9-13 11.1-33.3-2-45.2s-33.3-11.1-45.2 2L192 365.7 192 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 301.7L95.6 330.4c-11.9-13-32.2-13.9-45.2-2s-13.9 32.2-2 45.2l88 96C142.5 476.2 151 480 160 480zM418.3 307a32 32 0 1 1 27.4 57.9A32 32 0 1 1 418.3 307zM405.1 419.8l-6.8 9.2c-10.5 14.2-7.5 34.2 6.7 44.8s34.2 7.5 44.8-6.7l48.8-65.8c14-18.9 21.5-41.7 21.5-65.2c0-48.6-39.4-88-88-88s-88 39.4-88 88c0 39.2 25.6 72.4 61.1 83.8z";t.mw={prefix:"fas",iconName:n,icon:[576,512,r,o,i]},t.v6=t.mw},50916:e=>{e.exports=(e,t,n,r,o)=>{const i=o-r;if(0===i)return[];const s=n*Math.cos(r)+e,l=n*Math.sin(r)+t,a=n*Math.cos(o)+e,c=n*Math.sin(o)+t;return[["M",s,l],["A",n,n,0,Math.abs(i)<=Math.PI?"0":"1",i<0?"0":"1",a,c]]}},51318:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(96540),o=n(61661),i=n(89942);const s=()=>{const e=(0,i.PP)(),[t,n]=(0,o.XL)(),{reset:s}=(0,o.b8)(),l=(0,r.useCallback)((()=>{s(),(0,i.Z8)({...e,integrationsModalOpen:"true"}),n("true")}),[s,n,e]);return{isIntegrationsVisible:t,hideIntegrations:(0,r.useCallback)((()=>{(0,i.Z8)({...e,integrationsModalOpen:""}),n("")}),[e,n]),onIntegrationsClick:l}}},54025:(e,t,n)=>{n.d(t,{t:()=>i});var r=n(63766),o=n(74848);const i=e=>{let{id:t,testId:n="chart-sub-menu-container",...i}=e;return(0,o.jsx)(r.Flex,{column:!0,gap:2,id:t,"data-testid":n,"data-menuid":t,...i})}},55048:(e,t,n)=>{n.d(t,{A:()=>c});n(98992),n(54520);var r=n(96540),o=n(46587),i=n(24609),s=n(19186),l=n(81685),a=n(79022);const c=()=>{const e=(0,o.NJ)(),t=(0,i.vt)(),n=(0,s.ID)(),[,c]=(0,l.x)(),d=(0,r.useCallback)((()=>{const r=(0,a.l8)({userId:e,spaceId:t,roomId:n});return c(r),r}),[e,t,n,c]),u=(0,r.useCallback)((r=>{(0,a.zz)({userId:e,spaceId:t,roomId:n},r),c(r)}),[e,t,n,c]),h=(0,r.useCallback)((e=>{const t=d();u(t.filter((t=>t!==e)))}),[e,t,n]);return[d,u,h]}},59215:(e,t)=>{var n="arrow-down-a-z",r=["sort-alpha-asc","sort-alpha-down"],o="f15d",i="M183.6 469.6C177.5 476.2 169 480 160 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L128 365.7 128 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 301.7 32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 320c0-17.7 14.3-32 32-32l128 0c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9L429.3 416l50.7 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-128 0c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9L402.7 352 352 352c-17.7 0-32-14.3-32-32zM416 32c12.1 0 23.2 6.8 28.6 17.7l64 128 16 32c7.9 15.8 1.5 35-14.3 42.9s-35 1.5-42.9-14.3L460.2 224l-88.4 0-7.2 14.3c-7.9 15.8-27.1 22.2-42.9 14.3s-22.2-27.1-14.3-42.9l16-32 64-128C392.8 38.8 403.9 32 416 32zM395.8 176l40.4 0L416 135.6 395.8 176z";t.mw={prefix:"fas",iconName:n,icon:[576,512,r,o,i]},t.Ye=t.mw},60602:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(96540),o=n(68531);const i=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const[i,s]=(0,r.useState)(e);return(0,o.A)((()=>s(e)),t,[e,...n]),i}},63996:(e,t,n)=>{n.d(t,{t:()=>h});var r=n(96540),o=n(63766),i=n(45087),s=n(4719),l=n(549),a=n(75144),c=n(74848);const d=e=>{let{name:t,level:n,descendantIds:i,enableFavourites:s,ref:l,...a}=e;const d=(0,r.useMemo)((()=>Array.from(Array(n)).fill("-").join("")),[n]),u=(0,r.useMemo)((()=>s?`${d} ${t}`:t),[s,d,t]),h=(0,r.useMemo)((()=>({...!s||i?.length&&!a?.selfChartIds?.length?{}:{color:"primary"},...a})),[i,a]);return"string"===typeof t?(0,c.jsx)(o.Text,{strong:!0,ref:l,...h,children:u}):t||null},u=(0,l.A)((e=>{let{hasTooltip:t,hasInfo:n,...r}=e;return t&&n?(0,c.jsx)(i.A,{content:(0,c.jsx)(a.X,{id:r.id}),isBasic:!0,children:(0,c.jsx)(d,{...r})}):(0,c.jsx)(d,{...r})})),h=(0,s.aV)(u,(e=>{let{name:t,info:n,...r}=e;return{name:t,hasInfo:!!n,...r}}))},69001:(e,t,n)=>{n.d(t,{h:()=>i});var r=n(63766),o=n(74848);const i=e=>{let{id:t,...n}=e;return(0,o.jsx)(r.Flex,{column:!0,"data-testid":"chart-menu-wrapper","data-menuid":t,...n})}},72060:(t,n,r)=>{r.d(n,{A:()=>o});const o=t=>{try{if(!t)return null;const e=document.createElement("a");return e.href=t,/https?/.test(e.protocol)?new URL(e.protocol+"//"+e.host+e.pathname+e.search+e.hash).toString():null}catch(e){return null}}},74193:(e,t)=>{var n="sort",r=["unsorted"],o="f0dc",i="M137.4 41.4c12.5-12.5 32.8-12.5 45.3 0l128 128c9.2 9.2 11.9 22.9 6.9 34.9s-16.6 19.8-29.6 19.8L32 224c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9l128-128zm0 429.3l-128-128c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8l256 0c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-128 128c-12.5 12.5-32.8 12.5-45.3 0z";t.mw={prefix:"fas",iconName:n,icon:[320,512,r,o,i]},t.OM=t.mw},74290:(e,t,n)=>{n.d(t,{A:()=>h});n(98992),n(23215),n(54520),n(81454),n(8872);var r=n(96540),o=n(24285),i=n(99728),s=n(24609),l=n(76571),a=n(56523),c=n(97926),d=n(17115),u=n(31246);const h=()=>{const{milestones:e,recordMilestones:t,markMilestonesSeen:n,settingsLoaded:h}=(0,a.A)(),x=(0,c.A)(),g=(0,d.Ay)(),m=(0,i.Sk)(),p=(0,d.Ex)(),f=(0,o.xd)("isLoaded"),j=(0,s.vt)(),b=(0,s.ap)("loaded"),v=(0,l.t5)(j,"channels"),y=(0,l.t5)(j,"loaded"),w=Array.isArray(v)?v.length:0;(0,r.useEffect)((()=>{if(!h||!x)return;const n=Object.entries(x).filter((t=>{let[n,r]=t;return r&&!e.completed[n]?.completedAt}));if(n.length>0){const e=n.map((e=>{let[t]=e;return t}));t(e)}}),[x,e.completed,t,h]),(0,r.useEffect)((()=>{if(!h||!y||!b||!f)return;const t={segment:g,permissions:m,isLargeTeam:p,channelCount:w},r=Object.entries(e.completed).reduce(((e,n)=>{let[r,o]=n;if(!o.completedAt||o.seenAt)return e;const i=((e,t)=>{let{segment:n,permissions:r,isLargeTeam:o,channelCount:i}=t;return(u.a7[e]||[]).filter((e=>!!e.segments.includes(n)&&!(e.permission&&!r[e.permission])&&!(e.requiresLargeTeam&&!o)&&!(void 0!==e.maxChannels&&i>e.maxChannels)))})(r,t);if(!i.length)return e;const s=o.tasks||{};return i.every((e=>s[e.id]))&&e.push(r),e}),[]);r.length&&n(r)}),[w,y,p,n,m,e.completed,g,h,b,f])}},75144:(e,t,n)=>{n.d(t,{X:()=>s});var r=n(4719),o=n(14963),i=n(74848);const s=(0,r.aV)((e=>e.children?(0,i.jsx)(o.A,{as:"p",role:"document",...e}):null),(e=>{let{info:t}=e;return{children:t}}))},77234:(e,t,n)=>{n.d(t,{x:()=>r});const r={home:"home",overview:"overview",nodes:"nodes",k8s:"k8s",top:"top",logs:"logs",dashboards:"dashboards",dashboard:"dashboard",alerts:"alerts",ar:"ar",events:"events",insights:"insights"}},80744:(e,t,n)=>{n.d(t,{Ay:()=>g,NA:()=>x});n(98992),n(72577),n(81454);var r=n(96540),o=n(40961),i=n(43375),s=n(67012),l=n(43305),a=n(71123),c=n(61710),d=n(45427),u=n(74848);const h={sideEffects(e){let{active:t}=e;t.node.animate([{opacity:0},{opacity:1}],{easing:"ease-in",duration:250})}},x=40,g=e=>{let{cacheId:t,rootId:n,items:g,onRemove:m,Item:p,containerWidth:f=800,rowHeight:j=x,gridTracks:b=12,gutter:v=4,allowOverlap:y=!1,compactType:w="vertical",maxRows:C=3e5,Container:I=l.A,onDragEnd:A,onDragCancel:k,containerId:S,itemProps:T,rearrangeable:M=!0,...F}=e;const N=(0,r.useRef)(),[L,$]=(0,r.useState)((()=>(0,a.oE)((0,a.Su)(g),w,b)));(0,s.A)((()=>{$((0,a.oE)((0,a.Su)(g),w,b))}),[b,t]);const[D,B]=(0,r.useState)(null),[P,R]=(0,r.useState)(null),V=(0,r.useRef)(null),{active:O}=(0,i.fF)();(0,i.E5)((0,r.useMemo)((()=>({onDragStart:e=>{let{active:t}=e;const{itemContainerId:n}=t.data.current||{};n===S&&(B((0,a.Su)(L)),R(L))},onDragMove:e=>{let{active:t,over:n}=e;R((e=>{const{isResizer:r,isContainer:o,itemId:i,itemContainerId:s}=t.data.current||{};if(o||s!==S)return e;const{initial:l,translated:d}=t.rect.current;let u=e;const h=(0,a.GN)(u,i);if(!h)return e;const x=n?.id;if(r){if(!x)return e;if(!d||!l)return e;const t=n.rect.width+(0,c.sd)(d.right-l.right),r=n.rect.height+(0,c.sd)(d.bottom-l.bottom);let{width:o,height:i}=(0,c.tr)({gutter:v,maxRows:C,gridTracks:b,rowHeight:j,containerWidth:f},t,r,h);return h.width===o&&h.height===i?e:(h.width=o,h.height=i,u=u.map((e=>e.id===h.id?{...h,width:o,height:i}:e)),u=(0,a.oE)(u,w,b),V.current=h,u)}if(!M)return e;const g=N.current.getBoundingClientRect();let{left:m,top:p}=(0,c.zA)({gutter:v,maxRows:C,gridTracks:b,rowHeight:j,containerWidth:f},d.top-g.top,d.left-g.left,h);return h.top===p&&h.left===m?e:(u=(0,a.Pe)(u,h,m,p,!0,!1,w,b,y),u=(0,a.oE)(u,w,b),V.current=h,u)}))},onDragEnd:e=>{let{active:t,over:n}=e;const{isResizer:r,isContainer:o,itemContainerId:i}=t.data.current;if(o||i!==S)return void R(null);const s=n?.id;return r?(P&&$(P),R(null),void A(P,V.current)):null===s||n?.data?.current?.itemContainerId!==S?(D&&$(D),void R(null)):(P&&$(P),R(null),void A(P,V.current))},onDragCancel:()=>{D&&$(D),V.current=null,B(null),R(null),k&&k()}})),[L,P]));const E=(0,a.Hp)(P||L),_=E*j+(E-1)*v+"px";return(0,u.jsxs)(I,{ref:N,style:{width:f,height:_},...F,children:[(P||L).map(((e,t)=>(0,u.jsx)(d.A,{...e,index:t,containerId:S,Item:p,onRemove:m,draggable:!0,containerWidth:f,rowHeight:j,gridTracks:b,gutter:v,transformed:null!==P?P[t]:null,draggableProps:e,itemProps:T,rootId:n},e.id))),(0,o.createPortal)((0,u.jsx)(i.Hd,{adjustScale:!1,dropAnimation:h,zIndex:9999,children:O&&O.data.current.rootId===n&&O.data.current.isItem?(e=>{const t=P||L;if(!t)return null;const r=t.find((t=>t.id===e.itemId));return r?(0,u.jsx)(d.A,{rootId:n,...r,containerId:e.itemContainerId,Item:p,onRemove:m,draggable:!0,containerWidth:f,rowHeight:j,gridTracks:b,gutter:v,dragOverlay:!0,itemProps:T}):null})(O.data.current):null}),document.body)]})}},81187:(e,t,n)=>{n.d(t,{A:()=>j});var r=n(96540),o=n(88934),i=n(34843),s=n(24609),l=n(41716),a=n(19186),c=n(67294),d=n(92726),u=n(14070),h=n(96859),x=n(51318),g=n(42318),m=n(61398),p=n(97394),f=n(56523);const j=function(){let{onBeforeAction:e,skipCompletedCheck:t=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=(0,o.Zp)(),j=(0,s.bq)(),b=(0,a.QW)(),{markTaskCompleted:v}=(0,f.A)(),{onIntegrationsClick:y}=(0,x.A)(),{setSearchTerm:w}=(0,g.A)(),{open:C}=(0,h.A)(),{handleOpenProfileModal:I}=(0,m.A)(),A=(0,i.Xr)(p.TZ),k=(0,l.s)("ids"),[,S]=(0,u.A)(),T=(0,c.q)(),M=(0,d.fz)(T?.[0],"slug"),F=(0,r.useCallback)((e=>t||!e.completed),[t]);return(0,r.useCallback)((t=>{let r={};if(t.openIntegrations)return e?.(),t.integrationsSearchTerm&&w(t.integrationsSearchTerm),y(),void(F(t)&&v(t.milestoneId,t.id));if(t.openAiPanel)return e?.(),C(),void(F(t)&&v(t.milestoneId,t.id));if(t.openProfileModal)return e?.(),I(t.openProfileModal),void(F(t)&&v(t.milestoneId,t.id));if(t.openFirstDashboard&&M){e?.();const r=`/spaces/${j}/rooms/${b}/dashboards/${M}`;return n(r),t.spotlight?void A({...t.spotlight,taskId:t.id,milestoneId:t.milestoneId,targetPath:r}):void(F(t)&&v(t.milestoneId,t.id))}if(t.route){e?.();const o=t.isSpaceRoute?`/spaces/${j}`:`/spaces/${j}/rooms/${b}`;void 0!==t.alertTabIndex&&(r.alertTabIndex=t.alertTabIndex);const i=`${o}/${t.route}`;if(n(i,{state:r}),t.openFirstAlert&&k?.[0]&&S({alertId:k[0]}),t.spotlight)return void A({...t.spotlight,taskId:t.id,milestoneId:t.milestoneId,targetPath:i});F(t)&&v(t.milestoneId,t.id)}}),[e,n,j,b,v,y,w,C,I,A,k,S,M,F])}},82507:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(33185),o=n(74848);const i=r.default.div.withConfig({displayName:"circuitLines__CircuitLinesContainer",componentId:"sc-18gzenn-0"})(["position:absolute;inset:0;z-index:1;opacity:0.8;& > svg{position:absolute;margin:auto;left:50%;transform:translateX(-50%);top:0;bottom:0;}"]),s=e=>{let{withOuties:t=!0}=e;return(0,o.jsx)(i,{children:(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"187",height:"202",viewBox:"0 0 187 202",fill:"none",children:[(0,o.jsxs)("defs",{children:[(0,o.jsxs)("linearGradient",{id:"flowGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,o.jsx)("stop",{offset:"0%",stopColor:"#005622",stopOpacity:"0.3",children:t&&(0,o.jsx)("animate",{attributeName:"stop-opacity",values:"0.3;0.8;0.3",dur:"3s",repeatCount:"indefinite"})}),(0,o.jsx)("stop",{offset:"50%",stopColor:"#00cd51",stopOpacity:t?"0.6":"0.3",children:t&&(0,o.jsx)("animate",{attributeName:"stop-opacity",values:"0.6;1;0.6",dur:"2.5s",repeatCount:"indefinite"})}),(0,o.jsx)("stop",{offset:"100%",stopColor:"#005622",stopOpacity:"0.3",children:t&&(0,o.jsx)("animate",{attributeName:"stop-opacity",values:"0.3;0.8;0.3",dur:"3.2s",repeatCount:"indefinite"})})]}),(0,o.jsxs)("filter",{id:"pulse",children:[(0,o.jsx)("feGaussianBlur",{stdDeviation:"1",result:"coloredBlur"}),(0,o.jsxs)("feMerge",{children:[(0,o.jsx)("feMergeNode",{in:"coloredBlur"}),(0,o.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})]}),(0,o.jsx)("g",{filter:"url(#filter0_f_847_10449)",children:(0,o.jsx)("path",{d:"M57 22.0207L91.5 2.10214M100.5 3.90192L137.043 25M148.5 30L175.347 45.5M91.5 10L67.6235 23.7851C66.5333 24.4145 66.2887 25.8826 67.116 26.8315L72.5 33.007M13.5 55.5L51 33.007L55.5147 30.7444C56.3757 30.3129 57.422 30.5563 58.0042 31.3237L68 44.5M9 48L48 26M4 55.5V87C4 88.1046 4.89543 89 6 89H23.5M13 64.5V82.5M23.5 61.5L52.4294 43.0042C53.3141 42.4385 54.4856 42.6534 55.112 43.4962L64.9195 56.693C65.2968 57.2007 65.8921 57.5 66.5247 57.5H92M51 55.5L24.471 71.4174C23.8686 71.7788 23.5 72.4299 23.5 73.1324V77.5C23.5 78.6046 24.3954 79.5 25.5 79.5H33C34.1046 79.5 35 80.3954 35 81.5V87C35 88.1046 35.8954 89 37 89H63.4914C64.6067 89 65.5066 89.9124 65.4912 91.0277L65 126.5M4 97.5H55C56.1046 97.5 57 98.3954 57 99.5V110.5M46 109H23.5M4 108H11.5C12.6046 108 13.5 108.895 13.5 110V120.5C13.5 121.605 12.6046 122.5 11.5 122.5H6C4.89543 122.5 4 123.395 4 124.5V142M100.5 13.5L114.488 21.4458C115.113 21.8012 115.5 22.4652 115.5 23.1848V37V50.5C115.5 51.6046 114.605 52.5 113.5 52.5H82.5M79 26L93.4828 18.9922C94.1141 18.6867 94.8591 18.7342 95.4465 19.1173L105.093 25.4082C105.659 25.7774 106 26.4075 106 27.0834V42M79 42H96C97.1046 42 98 41.1046 98 40V30M23.5 115.5H45C45.5523 115.5 46 115.948 46 116.5V116.5C46 117.052 46.4477 117.5 47 117.5H55C56.1046 117.5 57 118.395 57 119.5V124.5M19.5 122.5H40.5M9 126.5V135C9 136.105 9.89543 137 11 137H34M19.5 130.5H48M57 130.5V140C57 141.105 56.1046 142 55 142H40.5M4 152.5H11.5C12.6046 152.5 13.5 151.605 13.5 150.5V147C13.5 145.895 14.3954 145 15.5 145H29.5M23.5 152.5V157.5C23.5 158.605 22.6046 159.5 21.5 159.5H15C13.8954 159.5 13 160.395 13 161.5V161.905C13 162.587 13.3475 163.222 13.9219 163.59L38 179M29.5 152.5H63C64.1046 152.5 65 151.605 65 150.5V137M40.5 72L54 64.5M44.5 82V78.7227C44.5 77.9721 44.9202 77.2848 45.5882 76.9426L62.0882 68.4914C63.4191 67.8097 65 68.7762 65 70.2715V79.5M73 66.5H96C97.1046 66.5 98 65.6046 98 64.5V61.5M106 61.5H123C124.105 61.5 125 60.6046 125 59.5V37M125 26L146.5 40M134 42V55.5C134 56.6046 134.895 57.5 136 57.5H148.5M142 48H156M157 57.5H174.498C175.04 57.5 175.56 57.7205 175.937 58.111L184.439 66.9188C184.799 67.2916 185 67.7896 185 68.3078V89M76 77.5V87C76 88.1046 76.8954 89 78 89H89.5C90.6046 89 91.5 88.1046 91.5 87V79.5C91.5 78.3954 92.3954 77.5 93.5 77.5H106M106 70H119H128C129.105 70 130 69.1046 130 68V66.5C130 65.3954 130.895 64.5 132 64.5H148.5M113.5 77.5H130M135 87.5V70M175.347 81L162 90.5M142 70H153M72.5 95.5H82C83.1046 95.5 84 96.3954 84 97.5V103C84 104.105 83.1046 105 82 105H74.5816C73.4457 105 72.5378 105.945 72.5832 107.08L73 117.5M77.5 110.5H94.5M89.5 95.5H98C99.1046 95.5 100 96.3954 100 97.5V108M98 84.5H122.5M106.5 91.5H119M142 79.5H156M162 64.5H169.597C170.171 64.5 170.718 64.7469 171.097 65.1777L174.847 69.4332C175.169 69.7985 175.347 70.2686 175.347 70.7555V74.2906C175.347 75.0342 174.934 75.7164 174.276 76.0617L162 82.5M162 73.5L170.5 72M106.5 97.5H125.5C126.605 97.5 127.5 96.6046 127.5 95.5V89M142 87.5H152.5C153.605 87.5 154.5 88.3954 154.5 89.5V92.4296C154.5 93.0983 154.834 93.7228 155.391 94.0937L160.5 97.5M167.5 95.5L177.5 89M185 97.5V115.5M73 126.5H80.5C81.6046 126.5 82.5 125.605 82.5 124.5V119.5C82.5 118.395 83.3954 117.5 84.5 117.5H103M109.5 108H122.5M135 95.5V106C135 107.105 135.895 108 137 108H148.576C150.297 108 151.214 105.971 150.077 104.679L148.424 102.8C146.988 101.168 148.82 98.7394 150.784 99.6722L162 105M170.5 105V120.5C170.5 121.605 171.395 122.5 172.5 122.5H179.298C179.753 122.5 180.193 122.655 180.548 122.938L185 126.5M113.5 115.5H137.043M148.5 115.5H158.5C159.605 115.5 160.5 116.395 160.5 117.5V131C160.5 132.105 161.395 133 162.5 133H170.5M72.5 137H83.2539C83.7351 137 84.2002 136.827 84.5638 136.511L90.9362 130.989C91.2998 130.673 91.7649 130.5 92.2461 130.5H104C105.105 130.5 106 129.605 106 128.5V122.5M113.5 122.5H128C129.105 122.5 130 123.395 130 124.5V128.5C130 129.605 130.895 130.5 132 130.5H146.5M182.5 137V143C182.5 144.105 181.605 145 180.5 145H157M153 137H125M113.5 130.5V143C113.5 144.105 114.395 145 115.5 145H135M76 145H91.4689C91.8169 145 92.159 144.909 92.4611 144.736L106 137M34 159.5V165.012C34 165.635 34.2903 166.222 34.7851 166.6L51 179M46 159.5H73M51 166L64.6912 175.901C65.2113 176.277 65.5192 176.88 65.5192 177.522V184C65.5192 185.105 64.6238 186 63.5192 186H48M73 170V196M79 155H97.3333C97.7661 155 98.1871 154.86 98.5333 154.6L108 147.5M115.5 152.5H142M153 152.5L166.369 158.954C167.061 159.288 167.5 159.988 167.5 160.755V164.945C167.5 165.605 167.174 166.223 166.629 166.596L148.5 179M84 166H105.715C106.219 166 106.706 165.809 107.076 165.466L112.924 160.034C113.294 159.691 113.781 159.5 114.285 159.5H130M142 163V171.796C142 172.537 141.591 173.217 140.936 173.563L125 182M84 176.5H105.484C105.823 176.5 106.155 176.414 106.452 176.25L125 166M84 186H92.5C93.6046 186 94.5 186.895 94.5 188V199.5M103 186V195.795C103 197.386 104.767 198.34 106.097 197.467L119 189M112 182L135 168.721M151 159.5L157.498 162.533C158.122 162.823 158.552 163.414 158.637 164.097L158.833 165.667C158.934 166.473 158.537 167.26 157.829 167.658L151 171.5M169.5 151H183C184.105 151 185 151.895 185 153V153.982C185 154.621 184.694 155.223 184.176 155.599L174 163",stroke:"url(#flowGradient)",strokeLinecap:"round",children:(0,o.jsx)("animate",{attributeName:"stroke-opacity",values:"0.8;1;0.8",dur:"4s",repeatCount:"indefinite"})})}),(0,o.jsx)("defs",{children:(0,o.jsxs)("filter",{id:"filter0_f_847_10449",x:"3",y:"1.10205",width:"183",height:"199.398",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,o.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,o.jsx)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),(0,o.jsx)("feGaussianBlur",{stdDeviation:"0.25",result:"effect1_foregroundBlur_847_10449"})]})}),(0,o.jsxs)("g",{className:"nodes",children:[(0,o.jsxs)("circle",{cx:"8",cy:"48.5",r:"2",fill:"#005622",filter:"url(#pulse)",children:[(0,o.jsx)("animate",{attributeName:"r",values:"2;3;2",dur:"3s",repeatCount:"indefinite"}),(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.8;1;0.8",dur:"3s",repeatCount:"indefinite"})]}),(0,o.jsxs)("circle",{cx:"92",cy:"2.5",r:"2",fill:"#005622",filter:"url(#pulse)",children:[(0,o.jsx)("animate",{attributeName:"r",values:"2;3;2",dur:"2.5s",repeatCount:"indefinite"}),(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.8;1;0.8",dur:"2.5s",repeatCount:"indefinite"})]}),(0,o.jsxs)("circle",{cx:"185",cy:"90.5",r:"2",fill:"#005622",filter:"url(#pulse)",children:[(0,o.jsx)("animate",{attributeName:"r",values:"2;3;2",dur:"3.5s",repeatCount:"indefinite"}),(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.8;1;0.8",dur:"3.5s",repeatCount:"indefinite"})]}),(0,o.jsxs)("circle",{cx:"73",cy:"196.5",r:"2",fill:"#005622",filter:"url(#pulse)",children:[(0,o.jsx)("animate",{attributeName:"r",values:"2;3;2",dur:"2.8s",repeatCount:"indefinite"}),(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.8;1;0.8",dur:"2.8s",repeatCount:"indefinite"})]}),(0,o.jsx)("circle",{cx:"13",cy:"55.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.6;0.9;0.6",dur:"4s",repeatCount:"indefinite",begin:"0.5s"})}),(0,o.jsx)("circle",{cx:"4",cy:"55.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.6;0.9;0.6",dur:"3.8s",repeatCount:"indefinite",begin:"1s"})}),(0,o.jsx)("circle",{cx:"13",cy:"62.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.6;0.9;0.6",dur:"4.2s",repeatCount:"indefinite",begin:"1.5s"})}),(0,o.jsx)("circle",{cx:"23",cy:"62.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.6;0.9;0.6",dur:"3.6s",repeatCount:"indefinite",begin:"2s"})}),(0,o.jsx)("circle",{cx:"92",cy:"57.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.7;1;0.7",dur:"3.2s",repeatCount:"indefinite",begin:"0.8s"})}),(0,o.jsx)("circle",{cx:"106",cy:"77.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"r",values:"2;2.5;2",dur:"3.8s",repeatCount:"indefinite",begin:"1.2s"})}),(0,o.jsx)("circle",{cx:"162",cy:"90.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.6;0.95;0.6",dur:"4.5s",repeatCount:"indefinite",begin:"1.8s"})}),(0,o.jsx)("circle",{cx:"125",cy:"36.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.7;1;0.7",dur:"3.4s",repeatCount:"indefinite",begin:"2.2s"})}),(0,o.jsx)("circle",{cx:"98",cy:"60.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"72",cy:"66.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"76",cy:"76.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"73",cy:"95.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"73",cy:"116.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"79",cy:"110.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"95",cy:"110.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"91",cy:"95.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"100",cy:"107.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"99",cy:"84.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"124",cy:"84.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"118",cy:"91.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"108",cy:"91.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"108",cy:"97.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"128",cy:"90.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"113",cy:"77.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"130",cy:"77.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"106",cy:"69.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"106",cy:"61.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"134",cy:"40.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"149",cy:"57.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"156",cy:"57.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"156",cy:"47.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"141",cy:"47.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"147",cy:"40.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"125",cy:"26.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"135",cy:"69.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"141",cy:"69.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"154",cy:"69.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"150",cy:"64.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"176",cy:"80.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"135",cy:"87.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"82",cy:"52.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"80",cy:"41.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"98",cy:"28.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"106",cy:"42.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"79",cy:"26.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"99",cy:"12.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"99",cy:"3.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"138",cy:"25.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"148",cy:"29.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"177",cy:"46.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"53",cy:"54.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"53",cy:"64.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"40",cy:"72.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"44",cy:"82.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"65",cy:"81.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"65",cy:"127.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"13",cy:"82.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"23",cy:"88.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"3",cy:"97.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"57",cy:"110.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"47",cy:"108.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"57",cy:"124.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"57",cy:"130.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"47",cy:"130.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"17",cy:"130.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"9",cy:"127.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"34",cy:"136.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"41",cy:"141.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"31",cy:"144.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"2",cy:"152.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"23",cy:"152.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"39",cy:"179.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"30",cy:"152.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"34",cy:"159.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"51",cy:"179.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"48",cy:"185.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"50",cy:"165.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"47",cy:"159.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"74",cy:"159.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"73",cy:"169.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"83",cy:"185.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"94",cy:"199.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"103",cy:"186.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"120",cy:"187.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"125",cy:"181.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"142",cy:"162.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"152",cy:"152.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"148",cy:"178.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"157",cy:"144.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"170",cy:"150.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"173",cy:"163.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"183",cy:"137.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"185",cy:"126.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"170",cy:"104.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"160",cy:"104.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"135",cy:"94.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"124",cy:"107.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"109",cy:"107.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"104",cy:"117.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"74",cy:"126.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"74",cy:"136.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"106",cy:"123.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"106",cy:"136.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"76",cy:"144.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"79",cy:"154.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"109",cy:"146.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"114",cy:"130.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"114",cy:"122.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"137",cy:"115.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"146",cy:"130.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"147",cy:"115.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"170",cy:"132.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"153",cy:"136.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"124",cy:"136.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"134",cy:"144.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"144",cy:"152.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"150",cy:"159.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"150",cy:"171.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"114",cy:"152.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"129",cy:"159.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"83",cy:"165.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"83",cy:"176.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"113",cy:"181.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"135",cy:"168.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"124",cy:"166.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"114",cy:"115.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"65",cy:"137.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"18",cy:"122.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"41",cy:"122.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"23",cy:"108.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"23",cy:"115.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"3",cy:"107.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"4",cy:"141.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"48",cy:"25.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"56",cy:"22.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"68",cy:"44.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"73",cy:"33.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"92",cy:"9.5",r:"2",fill:"#005622"})]})]})})}},88038:(e,t)=>{var n="arrow-up-a-z",r=["sort-alpha-up"],o="f15e",i="M183.6 42.4C177.5 35.8 169 32 160 32s-17.5 3.8-23.6 10.4l-88 96c-11.9 13-11.1 33.3 2 45.2s33.3 11.1 45.2-2L128 146.3 128 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-301.7 32.4 35.4c11.9 13 32.2 13.9 45.2 2s13.9-32.2 2-45.2l-88-96zM320 320c0 17.7 14.3 32 32 32l50.7 0-73.4 73.4c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-50.7 0 73.4-73.4c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8l-128 0c-17.7 0-32 14.3-32 32zM416 32c-12.1 0-23.2 6.8-28.6 17.7l-64 128-16 32c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3l7.2-14.3 88.4 0 7.2 14.3c7.9 15.8 27.1 22.2 42.9 14.3s22.2-27.1 14.3-42.9l-16-32-64-128C439.2 38.8 428.1 32 416 32zM395.8 176L416 135.6 436.2 176l-40.4 0z";t.mw={prefix:"fas",iconName:n,icon:[576,512,r,o,i]},t.PE=t.mw},90901:(e,t,n)=>{n.d(t,{I:()=>c,q:()=>a});n(98992),n(8872);var r=n(96540),o=n(88934),i=n(24013),s=n(19186);const l=(e,t)=>t?e[t]:e,a=e=>{const t=(0,i.BU)(),n=(0,i.Gt)(t);return(0,r.useMemo)((()=>n.reduce(((t,n)=>{const{capabilities:{ml:r}}=n;return r?.enabled?t.predicting=[...t.predicting,l(n,e)]:t.incapable=[...t.incapable,l(n,e)],t}),{predicting:[],incapable:[]})),[t.length,e])},c=e=>{const t=(0,o.Zp)(),n=(()=>{const e=(0,s.r9)();return e&&`${e}/anomalies`})();return(0,r.useCallback)((function(){t(n,{state:{nodeId:arguments.length>0&&void 0!==arguments[0]?arguments[0]:e}})}),[n,t])}},91100:(e,t,n)=>{n.d(t,{A:()=>c});var r=n(63766),o=n(9962),i=n(19075),s=n(2626),l=n(74848);const a=e=>{let{critical:t,warning:n,error:i,testPrefix:s,...a}=e;const c=(0,o.I)({error:i,testPrefix:s,flavour:t?"error":"disabledError",value:t}),d=(0,o.I)({error:i,testPrefix:s,flavour:n?"warning":"disabledWarning",value:n});return(0,l.jsx)(r.Flex,{...a,children:(0,l.jsx)(r.MasterCard,{"data-testid":"alertsMastercard",pillLeft:c,pillRight:d,size:"small"})})},c=e=>{let{id:t,testPrefix:n,...r}=e;const o=(0,s.Xt)(t),{critical:c,warning:d}=(0,i.AO)(o);return(0,l.jsx)(a,{"data-testid":"alerts",testPrefix:n,critical:c,warning:d,...r})}},93335:(e,t,n)=>{n.d(t,{N:()=>d,W:()=>u});var r=n(19075),o=n(2626),i=n(87083),s=n(41716),l=n(91100),a=n(74848);const c=e=>{let{critical:t,warning:n,error:r}=e;return(0,a.jsx)(l.A,{critical:t,"data-testid":"tabAlerts",error:r,testPrefix:"tabAlerts-alert",warning:n,margin:[0,0,0,1]})},d=e=>{let{nodeId:t}=e;const n=(0,o.Xt)(t),{critical:i,warning:s}=(0,r.AO)(n);return(0,a.jsx)(c,{critical:i,warning:s})},u=()=>{const e=(0,i.w7)({emptyIfAll:!1}),t=(0,o.YS)(e),n=(0,s.s)("error"),{critical:l,warning:d}=(0,r.AO)(t);return(0,a.jsx)(c,{critical:l,warning:d,error:n})}},95836:(e,t,n)=>{n.d(t,{$:()=>u});var r=n(63766),o=n(45087),i=n(4719),s=n(549),l=n(27496),a=n(74848);const c=e=>{let{name:t,tiny:n,...o}=e;const i=n?r.Text:r.H3;return"string"===typeof t?(0,a.jsx)(i,{strong:!0,...o,children:t}):t||null},d=(0,s.A)((e=>{let{hasTooltip:t,hasInfo:n,...r}=e;return t&&n?(0,a.jsx)(o.A,{content:(0,a.jsx)(l.n,{id:r.id}),isBasic:!0,children:(0,a.jsx)(c,{...r})}):(0,a.jsx)(c,{...r})})),u=(0,i.aV)(d,(e=>{let{name:t,info:n,...r}=e;return{name:t,hasInfo:!!n,...r}}))},96026:(e,t,n)=>{n.d(t,{l:()=>h,q:()=>u});n(25509),n(65223),n(60321),n(41927),n(11632),n(64377),n(66771),n(12516),n(68931),n(52514),n(35694),n(52774),n(49536),n(21926),n(94483),n(16215);var r=n(96540),o=n(88934),i=n(42790),s=n(61841),l=n(24609),a=n(24013),c=n(19075),d=n(91421);const u=e=>{let{alertId:t,alertName:n,nodeIds:i=[]}=e;const l=(0,o.Zp)(),{setState:u}=(0,d.$h)(),[h]=(0,s.Ay)(),{name:x}=(0,c.JL)(t),g=n||x,{isParent:m}=(0,a.xY)(i[0]),{loaded:p,value:f,hasError:j,error:b}=(0,d.wd)({node:{value:i[0],isParent:m},path:"/health"}),v=!!f?.tree?.["/health/alerts/prototypes"]?.[`health:alert:prototype:${g}`],[,y]=(0,d.PJ)();return{canEdit:p&&!j&&v,goToEdit:(0,r.useCallback)((e=>{i=e?Array.from(new Set([e,...i])):i,u({alertName:g,isAlert:!0}),y(!0,{nodeId:i[0]})}),[g,i,h,u,l]),error:b?.errorMessage||b}},h=()=>{const e=(0,o.Zp)(),{slug:t}=(0,l.ap)(),n=(0,i.rI)();return(0,r.useCallback)((r=>{r&&(n((e=>({...e,dyncfgSearchTerm:r}))),e(`/spaces/${t}/settings/configurations`,{replace:!0}))}),[e,n,t])}},97926:(e,t,n)=>{n.d(t,{A:()=>h});var r=n(96540),o=n(41716),i=n(83268),s=n(67294),l=n(24609),a=n(86706),c=n(76571),d=n(41258),u=n(31246);const h=()=>{const e=(0,i.nj)(),t=(0,i.CK)(),n=(0,o.s)("ids")||[],h=(0,o.s)("loaded"),x=(0,l.vt)();(0,d.A)(x);const g=(0,c.t5)(x,"channels"),m=(0,c.t5)(x,"loaded"),p=(0,a.Gi)(),f=(0,a.gk)(),j=(0,s.q)(),b=(0,s.RQ)();return(0,r.useMemo)((()=>e&&h&&m&&f&&b?{[u.aL.welcome]:!0,[u.aL.firstNodeConnected]:t.length>=1,[u.aL.firstAlertTriggered]:n.length>=1,[u.aL.firstNotificationSent]:Array.isArray(g)&&g.length>0,[u.aL.secondNodeConnected]:t.length>=2,[u.aL.threeOrMoreNodes]:t.length>=3,[u.aL.firstTeamMemberInvited]:Array.isArray(p)&&p.length>1,[u.aL.firstDashboardCreated]:Array.isArray(j)&&j.length>=1}:null),[e,t.length,h,n.length,m,g,f,p,b,j])}}}]);