File: //proc/self/root/opt/netdata/usr/share/netdata/web/v3/2327.83285a3952ce1e4b7a65.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]="0b488763-da42-4f2a-a9cf-6217c17d90c8",e._sentryDebugIdIdentifier="sentry-dbid-0b488763-da42-4f2a-a9cf-6217c17d90c8")}()}catch(e){}!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"71e6cd07d3b7cc35c33cc0937670fa3dc3e40c07"}}catch(e){}}(),(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[2327,6026],{549:(e,t,n)=>{n.d(t,{G:()=>z,A:()=>_});var r=n(33185),o=n(63766),s=n(78152),i=(n(98992),n(72577),n(81454),n(37550),n(96540)),a=n(6304),l=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,i.memo)((e=>{let{matchType:t,value:n,sublabel:r,onRemove:s}=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:s,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"],C=(e,t,n)=>{const[r,o]=(0,i.useState)(""),s=(0,v.A)(r,300),[a,l]=(0,i.useState)(null),[c,d]=(0,i.useState)(!1),u=(0,p.ID)(),h=(0,j.vt)(),x=(0,f.w7)({extraKey:n,merge:!1,scoped:!0}),g=(0,i.useMemo)((()=>{if(e?.contexts)return e.contexts}),[e]);(0,i.useEffect)((()=>{if(!s.trim())return l(null),void d(!1);d(!0),(0,b.Xx)(u,s,{selectedNodes:x,scopeContexts:g,spaceId:h}).then((e=>{const t=e?.data?.contexts;if(!t)return void l(null);const n={},r={dimensions:new Map},o=new Map,s=new Map,i={dimensions:0,instances:0,labels:0},a=/^\.\.\.\s+(\d+)\s+(values?|instances?|dimensions?)\s+more$/i;Object.entries(t).forEach((e=>{let[t,n]=e;const l=n.title||t;n.dimensions&&n.dimensions.forEach((e=>{const n=e.match(a);n?i.dimensions+=parseInt(n[1],10):(r.dimensions.has(e)||r.dimensions.set(e,[]),r.dimensions.get(e).push({title:l,contextId:t}))})),n.instances&&n.instances.forEach((e=>{const n=e.match(a);if(n)return void(i.instances+=parseInt(n[1],10));const r=e.split("."),s=r[r.length-1];o.has(s)||o.set(s,{contextIds:[],contextToInstance:{},contexts:[]});const c=o.get(s);c.contextIds.push(t),c.contextToInstance[t]=e,c.contexts.push({title:l,contextId:t})})),n.labels&&Object.entries(n.labels).forEach((e=>{let[n,r]=e;if(Array.isArray(r)){s.has(n)||s.set(n,new Map);const e=s.get(n);r.forEach((n=>{const r=n.match(a);r?i.labels+=parseInt(r[1],10):(e.has(n)||e.set(n,[]),e.get(n).push({title:l,contextId:t}))}))}}))})),Object.entries(r).forEach((e=>{let[t,r]=e;(r.size>0||i[t]>0)&&(n[t]=[],r.forEach(((e,r)=>{const o=e.map((e=>e.contextId)),s=e.map((e=>e.title));let i;i=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:i,contextIds:o,allContextTitles:s})})),n[t].sort(((e,t)=>e.label.localeCompare(t.label))),i[t]>0&&n[t].push({value:null,label:`+${i[t]} more`,sublabel:"Keep typing to narrow results",contextIds:[],isTruncationNotice:!0}))})),(o.size>0||i.instances>0)&&(n.instances=[],o.forEach(((e,t)=>{const{contextIds:r,contextToInstance:o,contexts:s}=e,i=s.map((e=>e.title));let a;a=1===s.length?s[0].title:2===s.length?`${s[0].title}, ${s[1].title}`:`${s[0].title}, ${s[1].title} and ${s.length-2} more`,n.instances.push({value:t,label:t,sublabel:a,contextIds:r,contextToInstance:o,allContextTitles:i})})),n.instances.sort(((e,t)=>e.label.localeCompare(t.label))),i.instances>0&&n.instances.push({value:null,label:`+${i.instances} more`,sublabel:"Keep typing to narrow results",contextIds:[],isTruncationNotice:!0})),s.size>0&&(n.labels=[],s.forEach(((e,t)=>{const r=[];e.forEach(((e,n)=>{const o=e.map((e=>e.contextId)),s=e.map((e=>e.title));let i;i=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:i,contextIds:o,allContextTitles:s})})),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)),i.labels>0&&n.labels.push({labelKey:null,items:[{value:null,label:`+${i.labels} more`,sublabel:"Keep typing to narrow results",contextIds:[],isTruncationNotice:!0}]})),l(n),d(!1)})).catch((e=>{console.error("Context search error:",e),l(null),d(!1)}))}),[s,u,h,x,g]);const m=(0,i.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:s,searchResults:a,isLoading:c,onSelectResult:m}},w=(0,i.memo)((e=>{let{children:t,...n}=e;const r=(0,i.useRef)(null);return(0,i.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,i.memo)((e=>{let{parentIds:t,allFilters:n,onGoToParent:r}=e;const s=(0,i.useMemo)((()=>t?.find((e=>n[e]&&Object.keys(n[e]).length>0))||null),[t,n]),a=(0,h.b)(s);if(!s||!a)return null;const l=a.shortName||a.name||"parent section";return(0,g.jsx)(I.A,{content:`Go to ${l}`,align:"bottom",children:(0,g.jsx)(o.IconButton,{icon:"arrowUp",flavour:"borderless",onClick:()=>r(s),padding:[0],small:!0})})})),k=(0,i.memo)((e=>{let{menuId:t,parentIds:n,activeMenuId:r,onMenuChange:s}=e;const a=((e,t)=>{const n=(0,h.b)(e),r=(0,h.yy)(),o=(t||[]).map((e=>r[e])).filter(Boolean);return(0,i.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:a,onChange:s,dropProps:{align:{top:"bottom",left:"left"}},dropdownProps:{width:"200px"},caret:!0,padding:[0],small:!0})})),S=(0,i.memo)((e=>{let{menuId:t,onClose:n,flavour:r,parentIds:s,onGoToParent:a}=e;const[l,d]=(0,i.useState)(t),u=(0,h.b)(l),p=(0,x.X)(),{filters:f,addFilter:j,removeFilter:b,clearFilters:v}=(0,x.w)(u?.contexts,l),{searchValue:S,setSearchValue:T,debouncedSearchValue:F,searchResults:M,isLoading:N,onSelectResult:L}=C(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"}),s?.length>0?(0,g.jsx)(k,{menuId:t,parentIds:s,activeMenuId:l,onMenuChange:d}):(0,g.jsx)(o.TextSmall,{children:u?.name||"this section"})]}),(0,g.jsxs)(o.Flex,{alignItems:"center",gap:2,children:[a&&(0,g.jsx)(A,{parentIds:s,allFilters:p,onGoToParent:a}),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===M?"152px":M&&Object.keys(M).length>0?"400px":"199px",children:[null===M&&(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"]})]})]})}),M&&Object.keys(M).length>0&&(0,g.jsx)(o.Flex,{column:!0,gap:3,padding:[2,0],flex:!0,children:y.map((e=>{const t=M[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&&""!==F.trim()&&null!==M&&0===Object.keys(M).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)(w,{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),F=n(49163),M=n(63928),N=n(95565),L=n(1444);const $=(0,d.A)((0,l.A)(o.Flex)),D=(0,u.A)((0,l.A)(o.IconButton)),B=(0,i.memo)((e=>{let{menuId:t,menuName:n,contexts:r}=e;const{filters:s}=(0,x.w)(r,t);return s&&0!==s.length?(0,g.jsxs)(o.Flex,{column:!0,children:[(0,g.jsxs)(o.TextMicro,{color:"textLite",children:["Filters in ",n," (",s.length,")"]}),(0,g.jsx)(o.Flex,{column:!0,children:s.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,i.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,i.memo)((e=>{let{menuId:t,menuName:n,flavour:r,parentIds:s}=e;const l=(0,h.b)(t),d=(0,x.X)(),u=(0,T.Ud)(),[m,,p,f]=(0,a.A)(),j=!!(d[t]&&Object.keys(d[t]).length>0),b=!(!s||!s.some((e=>d[e]&&Object.keys(d[e]).length>0))),v=(0,i.useCallback)((e=>{u(e),f()}),[u,f]),y=(0,i.useMemo)((()=>j||b?(0,g.jsxs)(c.A,{column:!0,gap:2,children:[(0,g.jsx)(B,{menuId:t,menuName:n,contexts:l?.contexts}),(0,g.jsx)(P,{parentIds:s})]}):`Search in ${n}`),[j,b,t,n,l?.contexts,s]);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:s,onGoToParent:v})]})})),O={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},V=(0,i.memo)((e=>{let{menuId:t,menuName:n,flavour:r}=e;const[o,,s,l]=(0,a.A)(),c=(0,F._)({params:{type:["favourites"],path:[`/${r}`],entity:t}}),d=c.find((e=>{let{entity:n}=e;return n===t}))?.id,u=!!d,h=(0,M.yK)({onResolve:l}),x=(0,M.z2)(d,{onResolve:l}),{disabled:m,reason:p}=(0,L.A)(),f=(0,i.useCallback)((()=>{m||(s(),u?x():h({type:"favourites",entity:t,path:`/${r}`,value:{menuId:t,sortOrder:Date.now()}}))}),[m,u,x,h,t,r,s]),j=(0,i.useMemo)((()=>({tooltip:m&&p?O[p]||O.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")),z=e=>{let{children:t,menuId:n,menuName:r,flavour:i,parentIds:a,hasCharts:l,hasFilters:c=s.af}=e;return(0,g.jsxs)(E,{alignItems:"center",justifyContent:"between",hasCharts:l,gap:1,children:[t,(0,g.jsxs)(o.Flex,{alignItems:"center",gap:1,children:[c&&(0,g.jsx)(R,{menuId:n,menuName:r,flavour:i,parentIds:a}),(0,g.jsx)(V,{menuId:n,menuName:r,flavour:i})]})]})},_=e=>t=>t.enableFavourites&&t.contexts?.length?(0,g.jsx)(z,{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),s=n(74891),i=n(74848);const a=(0,s.A)(o.IconButton),l=(0,r.default)(a).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"),l),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:s,children:a}=e;return(0,i.jsxs)(c,{completed:n,onClick:r,children:[(0,i.jsx)(d,{completed:n,children:n&&(0,i.jsx)(o.Icon,{name:"check",color:"primary",width:"32px",height:"32px"})}),(0,i.jsxs)(o.Flex,{column:!0,gap:1,flex:!0,children:[(0,i.jsx)(o.Text,{strong:!0,color:n?"textLite":void 0,children:t.title}),(0,i.jsx)(o.TextSmall,{color:n?"textNoFocus":"textLite",children:a||t.description})]}),!n&&s&&(0,i.jsx)(l,{onClick:e=>{e.stopPropagation(),s?.()}})]})}},5020:(e,t,n)=>{n.d(t,{Oq:()=>o,Q:()=>s,bP:()=>i,ml:()=>r});const r=(e,t)=>e.on("sizeChanged",((e,n,r)=>{if(e.getParent()!==t)return;const o=e.getAttribute("id"),s=t.getAttribute("host"),i=`chart_height.${s}/${o}`;localStorage.setItem(i,n);const a=`chart_width.${s}/${o}`;localStorage.setItem(a,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},s=e=>{e?.id&&localStorage.setItem(`chart_layout/${e.id}`,JSON.stringify(e))},i=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:s,top:i=s,w:a,width:l=a,h:c,height:d=c,expanded:u=!1}=e;return{id:n,width:l,height:d,left:o,top:i,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:s}=e;return{"data-testid":n?`${n}-${o}`:o,flavour:o,...r&&{onClick:r},text:t?"-":`${s}`}}},14963:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(96540),o=n(63766),s=n(50239),i=n(74848);const a=e=>{let{children:t,onClick:n,...a}=e;const l=(0,s.UH)(),c=(0,r.useCallback)((e=>{const{hash:t=""}=e.target;t.startsWith("#menu")&&(e.preventDefault(),l.goToLink(t.substr(1))),n&&n(e)}),[l]);return"string"===typeof t?(0,i.jsx)(o.TextSmall,{color:"textDescription",dangerouslySetInnerHTML:{__html:t},onClick:c,...a}):t||null}},17115:(e,t,n)=>{n.d(t,{Ay:()=>c,Ex:()=>l});var r=n(96540),o=n(24285),s=n(19186),i=n(31246);const a=()=>{const e=(0,o.xd)("onboardingFormData"),t=(0,s.XA)("memberCount")||0,n=(0,s.XA)("nodeCount")||0;return(0,r.useMemo)((()=>{const r=e?.usageType;return"Personal (homelab)"===r?i.JF.homelabber:"Work"===r?t>2||n>=50?i.JF.largeOrg:i.JF.smallOrg:i.JF.homelabber}),[e?.usageType,t,n])},l=()=>{const e=a(),t=(0,s.XA)("memberCount")||0;return e===i.JF.largeOrg&&t>10},c=a},17178:(e,t,n)=>{n.d(t,{A:()=>p});var r=n(96540),o=n(88934),s=n(19186),i=n(24609),a=n(93335),l=n(41716),c=n(93883),d=n(93912),u=n(74848);const h=()=>{const e=(0,l.s)("error"),t=(0,l.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,s.r9)(),t=(0,o.RQ)("/spaces/:spaceSlug/rooms/:roomSlug/insights/report-preview/:reportId"),n=(0,x.JT)("dashboard:ReadAll"),l=(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)(a.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,i.dg)(),d=(0,s.GJ)();var p,f;return[(0,r.useMemo)((()=>[!c&&!d&&l.home,l.nodes,l.overview,l.top,l.logs,!c&&!window.envSettings.onprem&&l.k8s,!c&&n&&l.dashboards,c&&n&&l.dashboard,l.alerts,l.events,l.ar,l.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),s=n(31141),i=n(32788),a=n(29263),l=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),C=n(45706),w=n(28864),I=n(52795),A=n(74848);const k=(0,r.memo)((e=>{let{id:t,spaceId:n,roomId:s,chartId:i,name:a}=e;const[l,,c,h]=(0,v.A)(),{fullyLoaded:g,processing:f}=(0,p.fz)(t),j=(0,w.DH)(t,{onSuccess:()=>{(0,y.jE)(`Chart added to ${a}`),h()}}),b=l&&g,k=(0,d.ns)(n,"slug"),S=(0,x.wz)(s,"slug"),T=(0,m.nM)(t),F=(0,C.A)(l&&t,{spaceId:n,spaceSlug:k,roomId:s,roomSlug:S}),M=(0,u.eg)();(0,r.useEffect)((()=>{if(F||!b)return;const e=M.getNode({id:i}),t=(0,I.h)(e.getAttributes());T(t.contextScope,t,(()=>setTimeout(j,100)))}),[b,F]);const N=l&&(f||F);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:s}=e;return(0,A.jsx)(k,{id:o(),spaceId:t,roomId:n,chartId:r,name:s.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:C={},params:{chartId:w}}=(0,s.A)("addToDashboardModal"),I=(0,g.q)(),k=(0,p.Sf)(I),[T,F]=(0,r.useState)(""),[M,N]=(0,r.useState)(!1),L=T.length>0,$=(0,m.W6)(y,n,{onSuccess:t}),D=(0,u.eg)().getNode({id:w}),B=(0,r.useMemo)((()=>S({spaceId:y,roomId:n,chartId:w})),[y,n,w]),P=()=>{if(!D)return;const{aggregationMethod:e,selectedDimensions:t,groupBy:n,groupByLabel:r,groupingMethod:o,chartType:s,selectedLabels:i,nodesScope:a,selectedInstances:l,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:s,selectedLabels:i,nodesScope:a,selectedInstances:l,selectedNodes:c})},R=(0,g.RQ)();return(0,A.jsxs)(i.GO,{onClose:t,children:[(0,A.jsx)(a.z,{onClose:t,title:"Add to Dashboard"}),(0,A.jsx)(l.U,{children:"Select Dashboard"}),(0,A.jsxs)(i.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 ",w," to it"]}),(0,A.jsx)(b.A,{value:T,label:"Name",onChange:e=>F(e.target.value),isValid:M,setIsValid:N,isDirty:L,instantFeedback:"all",onKeyDown:e=>e.keyCode===c.I7&&M&&P}),(0,A.jsx)(o.Button,{label:"Create & add",onClick:P,disabled:!D||!T})]})]})]})}},27496:(e,t,n)=>{n.d(t,{n:()=>i});var r=n(14963),o=n(4719),s=n(74848);const i=(0,o.aV)((e=>e.children?(0,s.jsx)(r.A,{as:"p",role:"document",...e}):null),(e=>{let{info:t}=e;return{children:t}}))},30863:(e,t,n)=>{n.d(t,{A:()=>D});n(98992),n(54520),n(81454);var r=n(96540),o=n(63766),s=n(73700),i=n(69457),a=n(51220),l=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:s,isLast:i}=e;const{onMenuClick:a}=(0,j.A)(),l=(0,r.useCallback)((()=>{a({id:t})}),[t,a]),c=(0,r.useMemo)((()=>({alignItems:"center",gap:1,...i?{}:{cursor:"pointer",onClick:l}})),[i,l]);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(o.Flex,{...c,children:[s?(0,v.jsx)(m.o,{icon:s,active:!0,containerProps:{width:"auto"}}):null,(0,v.jsx)(o.Text,{color:"primary",strong:!0,children:n})]}),i?null:(0,v.jsx)(o.Text,{color:"primary",strong:!0,children:">"})]})})),C=(0,r.memo)((e=>{let{menu:t}=e;const{id:n,shortName:s,name:i,icon:a,parentMenus:l}=t||{},c=(0,r.useMemo)((()=>[...l||[],{id:n,name:s||i,icon:a}]),[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})),w=(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:s}=e;const i=(0,p.W2)(),a=(0,f.b)(i),l=(0,r.useContext)(g.ThemeContext);return!I.includes(t)&&a?(0,v.jsxs)(w,{background:(0,o.getRgbColor)("mainBackground",.8)({theme:l}),children:[(0,v.jsx)(C,{menu:a}),(0,v.jsx)(b.G,{menuId:i,menuName:a.shortName||a.name,hasFilters:s,flavour:t,parentIds:a.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",F={root:T,submenu:T,default:S},M=[{flavour:"root",id:"System-0"}],N=(0,r.memo)((e=>{let{getComponent:t,element:n,index:o,...s}=e;const i=(0,r.useMemo)((()=>n&&t(n)),[n?.id,o]),a=(0,r.useMemo)((()=>!!M.find((e=>{let{id:t,flavour:r}=e;return t===n.id&&r===n.flavour}))),[n]);return!i||a?null:(0,v.jsx)(i,{...n,index:o,...s,isVisible:!0},n.id)})),L=(0,r.memo)((e=>{let{flavour:t,elements:n,onScroll:i,dashboardOptions:l,getComponent:d,stickyBg:g="mainBackground",stickyRef:m,nextStickyRef:p,stickyIndexes:f,tmpStickyRef:j,containerWidth:b,headerProps:y={},ref:C}=e;const w=(e=>{const t=(0,r.useRef)(),n=(0,r.useRef)(),o=(0,r.useRef)(0),s=(0,r.useRef)(0);return(0,r.useCallback)((r=>{if(t.current!==e.length&&(s.current=0),n.current&&(s.current<5||t.current!==e.length)){s.current=s.current+1,t.current=e.length;const i=e.findIndex((e=>e.id===n.current.id));if(-1===i)return;const{start:a}=r.getMeasurements()[i];return r.scrollToOffset(a+o.current),clearTimeout(u),void(u=setTimeout((()=>s.current=5),200))}t.current=e.length;const i=r.scrollOffset;let a=0;const l=r.getMeasurements().find((e=>(a+=e.size,a>i)));l&&(n.current=e[l.index],o.current=i-l.start)}),[e])})(n),I=(0,r.useRef)(),[A,T]=(0,r.useState)(0),M=((e,t,n)=>{let{stickyRef:o,nextStickyRef:s,tmpStickyRef:i}=n;const a=(0,r.useRef)(),{active:l}=(0,x.fF)(),c=(0,r.useRef)();return c.current=l,(0,r.useCallback)((e=>{if(c.current&&c.current.data.current.isResizer)return a.current;if(!t)return a.current=(0,h.vp)(e),a.current;s.current=Number(Object.keys(t).find((t=>e.startIndex<t))),o.current=Number(Object.keys(t).reverse().find((t=>e.startIndex>=t))),s.current-e.startIndex===1&&(o.current=NaN);let n=(0,h.vp)(e);return null!==i.current&&(n=[...n,i.current]),isNaN(o.current)?a.current=[...new Set(n)].sort(((e,t)=>e-t)):a.current=[...new Set([o.current,...n])].sort(((e,t)=>e-t)),a.current}),[e,t])})(n,f,{stickyRef:m,nextStickyRef:p,tmpStickyRef:j}),L=(0,a.Te)({count:n.length,getScrollElement:()=>C.current,overscan:2,enableSmoothScroll:!1,estimateSize:e=>n[e].size,onChange:w,rangeExtractor:M,scrollPaddingStart:0});I.current=L,(0,c.A)(L,n);const $=(0,r.useCallback)((0,s.n)(100,(function(){i(...arguments),C.current&&T(C.current.scrollTop)})),[i]);return(0,v.jsxs)("div",{ref:C,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,{...l,element:n[m.current],index:m.current,getComponent:d})},m.current),L.getVirtualItems().map((e=>{const t=F[n[e.index].flavour]||F.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,{...l,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:s,initialChartName:a,checkVisibility:c,...u}=e;const h=(0,l.bD)(),x=(0,i.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,i.Tg)(),n=(0,r.useRef)(null),o=(0,r.useMemo)((()=>e.reduce(((e,n,r)=>{let{id:o,sticky:s}=n;return t[o]&&"undefined"!==typeof s&&s&&(e[r]=!0),e}),{})),[e]),s=(0,r.useRef)(),a=(0,r.useRef)(),l=(0,r.useCallback)((e=>!!o[e]),[o]),c=(0,r.useCallback)((e=>s.current===e),[]);return[{stickyRef:s,nextStickyRef:a,isSticky:l,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,a]),(0,v.jsx)(L,{flavour:t,elements:x,onScroll:y,dashboardOptions:s,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),s=n(97940),i=n(24609),a=n(77389),l=n(63231),c=n(86706),d=n(82505),u=n(99728);const h=e=>`spaces.${e}.members`,x=e=>{const t=(0,i.vt)(),n=(0,o.yF)((0,r.useCallback)(((n,r,o)=>{let{results:s}=o;r((0,c.jX)({id:e,spaceId:t}),s)}),[e,t])),x=(0,u.JT)("user:ReadAll");(0,s.A)((()=>({key:h(e),autorun:!!e&&x,fetch:()=>(0,a.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,l.m)({id:e}),getResourcesInitializer:()=>l.WJ,onReceive:n,pollingOptions:{pollingInterval:315e3}})),[e,x])}},32755:(e,t)=>{var n="arrow-up-1-9",r=["sort-numeric-up"],o="f163",s="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,s]},t.ut=t.mw},36979:(e,t,n)=>{n.r(t),n.d(t,{SettingsContainer:()=>Td,default:()=>Md});var r=n(96540),o=n(39175),s=n(7960),i=n(19707),a=n(72060),l=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),C=n(58247),w=n(16922),I=n(81685),A=n(22068),k=n(55048),S=n(63872),T=n(44245),F=n(77234),M=n(95428);const N=()=>document.querySelectorAll(`[data-testid='${M.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"),[s,i]=(0,A.A)(),[a,l]=(0,k.A)(),[c,d]=(0,S.A)(),{pathname:u}=(0,f.zy)(),h=u.includes(F.x.insights)&&!u.includes(m.p9),[,,,x]=(0,I.W5)(),[,M]=(0,T.m0)({tabId:F.x.insights}),[$]=(0,I.ly)(),D=(0,p.yF)((0,r.useCallback)(((r,o,u)=>{let{data:g}=u;const p=g?.reports||[],f=s(),j=a(),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:C,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&&(C.length&&c({header:"New report",text:"A new report has been generated!"}),I.length&&(i(f.filter((e=>!I.includes(e)))),d({header:"Error",text:"Failed to generate report."})),l(Array.from(new Set([...j,...y.filter((e=>!I.includes(e)))]))),(C.length||I.length)&&(x(),n()),!h&&C.length+I.length>0)){const e=C.length>0?"success":"error";M({color:e})}o((0,w.Tj)({spaceId:e,roomId:t}),(e=>({...e,loaded:!0,reports:p.map((e=>({...e,isUnread:v.includes(e.id)})))})))}),[e,t,s,i,a,l,x,n,c,d,h,M])),B=(0,p.yF)((0,r.useCallback)(((n,r,o)=>{r((0,w.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,C.eF)({spaceId:t,roomId:n}),o=(0,C.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),O=n(88255),V=n(50271),E=n(24013),z=n(87083),_=n(49435),H=n(42790),K=n(34843),G=n(52035),W=n(84929);const U={filteredNodesIds:[],filteredNodesCount:0,nodesCount:0},q=(0,W.Iz)((()=>(0,G.eU)(U))),J=()=>{const e=(0,v.ID)();return(0,K.md)(q(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:s="nodesView"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=(0,E.Gt)(e),a=function(){const e=X(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView");return"string"!==typeof e?"":e.trim().toLowerCase()}(s),[l,c,d]=(0,r.useMemo)((()=>{let e=0,t=0;const r=i.filter((e=>!n(e)));t=r.length;const o=r.map((t=>{let n=0,r=0,o=0;if(a){const{name:e,...s}=t;r=t.name?(0,_.pe)(e,a):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)),{})}(s),(e=>(0,_.pe)(String(e),a,{scoreFactor:.6,minScore:.6})));n=("Live"===t.nodeStatus?100:"Stale"===t.nodeStatus?50:0)+10*r+o}const s=!!a&&!(r>.3||o>.3);return s||(e+=1),{id:t.id,searchScore:n,included:!s}})).filter((e=>e.included));return[o,t,e]}),[a,i,o]),u=(()=>{const e=(0,v.ID)();return(0,K.Xr)(q(e))})(),h=(0,r.useMemo)((()=>l.map((e=>{let{id:t}=e;return t}))),[l]),x=(0,r.useMemo)((()=>l.reduce(((e,t)=>{let{id:n,searchScore:r}=t;return r>0&&(e[n]=r),e}),{})),[l]);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),se=n(68531),ie=n(74848);const ae=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),[s,i]=(0,r.useState)(n||"");return(0,se.A)((()=>{o(s),(0,oe.H)("toc-search","search-automatic-trigger","nodes-view",s)}),300,[s]),(0,r.useEffect)((()=>{n!==s&&i(n)}),[n]),(0,ie.jsx)(re.TextInput,{iconLeft:(0,ie.jsx)(re.Icon,{name:"search",color:s?"textFocus":"textLite",width:"14px",height:"14px"}),iconRight:!!s&&(0,ie.jsx)(re.IconButton,{icon:"x",iconColor:s?"textFocus":"textLite",width:"14px",height:"14px",onClick:()=>{i(""),(0,oe.H)("toc-search","clear-search-button","nodes-view")},padding:[0],neutral:!0,"data-testid":"filterNodesInput-clearButton"}),value:s,onChange:e=>i(e.target.value),size:"small",placeholder:"Search nodes",name:"Search nodes","data-testid":"filterNodesInput",containerStyles:{width:"100%"}})};var le=n(73700);const ce=(0,le.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,ie.jsx)(ie.Fragment,{children:(0,ie.jsxs)(re.TextMicro,{alignSelf:"end",color:"textLite",margin:[1,0,0],"data-testid":"numberOfNodesIndication",children:["Showing"," ",(0,ie.jsx)(re.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfNodesIndication-filteredNodesCount",children:t})," ","of total"," ",(0,ie.jsx)(re.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfNodesIndication-nodesCount",children:n})," ","nodes"]})})},ue=()=>{const{filteredNodesCount:e}=J();return e?null:(0,ie.jsxs)(re.Flex,{width:"100%",gap:1,margin:[4,0,0],padding:[2],alignItems:"center","data-testid":"noResultsWereFound",children:[(0,ie.jsx)(re.Icon,{name:"information",color:"textDescription"}),(0,ie.jsx)(re.TextMicro,{strong:!0,color:"textDescription",children:"No results were found"})]})},he=e=>{let{extraKey:t}=e;return(0,ie.jsxs)(re.Flex,{column:!0,alignItems:"center",children:[(0,ie.jsx)(ae,{extraKey:t}),(0,ie.jsx)(de,{}),(0,ie.jsx)(ue,{})]})};var xe=n(79748);const ge=()=>(0,ie.jsxs)(re.Flex,{padding:[6],round:1,width:"600px",background:"modalInfoBackground",children:[(0,ie.jsx)(re.Box,{margin:[0,4,0,0],children:(0,ie.jsx)(re.Box,{as:re.Icon,width:10,height:10,name:"nodes_update"})}),(0,ie.jsxs)(re.Flex,{column:!0,gap:2,children:[(0,ie.jsx)(re.Text,{strong:!0,children:"Couldn't find the node you were looking for? "}),(0,ie.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,ie.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,ie.jsxs)(re.Flex,{column:!0,flex:!0,justifyContent:"center",alignItems:"center",alignSelf:"center",children:[(0,ie.jsxs)(re.Flex,{column:!0,justifyContent:"center",alignItems:"center",width:"300px",margin:[0,0,6],children:[(0,ie.jsx)(re.H3,{margin:[0,0,4],children:"No nodes to display"}),(0,ie.jsx)(re.Text,{color:"textDescription",textAlign:"center",children:"Double-check your search or filters and dates and try again with different conditions."})]}),t,(0,ie.jsx)(ge,{})]})};var pe=n(6304),fe=n(63589),je=n(89590),be=n(51571),ve=n(32788),ye=n(29263),Ce=n(47410),we=n(32052),Ie=n(22871),Ae=n(25291),ke=n(53749);const Se=()=>{},Te=e=>{let{roomId:t,id:n,onRemove:r=Se}=e;const o=(0,v.wz)(t,"name"),s=(0,Ie.e6)(t,n,"title"),i=(0,Ie.gV)(t),[a,,l,c]=(0,pe.A)();return(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(re.Button,{danger:!0,flavour:"hollow",onClick:l,label:"Delete metric","data-testid":"remove-metric"}),a&&(0,ie.jsx)(re.ConfirmationDialog,{"data-ga":"remove-metric-dialog","data-testid":"removeMetricDialog",handleConfirm:async()=>{await i(n),r()},handleDecline:c,message:(0,ie.jsxs)(ie.Fragment,{children:["You are about to remove ",(0,ie.jsx)("strong",{children:s})," metric.",(0,ie.jsx)("br",{}),"Are you sure you want to continue?"]}),title:`Remove metric from ${o}`})]})},Fe=e=>{let{link:t,children:n}=e;return(0,ie.jsxs)(re.Flex,{as:"a",target:"_blank",href:t,gap:1,alignItems:"end",children:[(0,ie.jsx)(re.TextNano,{textDecoration:"undeline",children:n}),(0,ie.jsx)(re.Icon,{color:"text",name:"question",width:"16px",height:"16px"})]})},Me=e=>{let{title:t,help:n,link:r,disclaimer:o,children:s,...i}=e;return(0,ie.jsxs)(re.Flex,{gap:1,column:!0,...i,children:[(0,ie.jsxs)(re.Flex,{justifyContent:"between",alignItems:"baseline",children:[(0,ie.jsx)(re.Text,{as:"label",margin:[0],children:t}),n&&(0,ie.jsx)(Fe,{link:r,children:n})]}),s,o&&(0,ie.jsx)(re.TextSmall,{children:o})]})};var Ne=n(91130),Le=n(16866);const $e=e=>{let{dimensions:t}=e;return{dimensions:t.map((e=>{let{name:t}=e;return{value:t,label:t}}))}},De=e=>{let{isNew:t}=e;return(0,ie.jsxs)(re.Flex,{as:"span",gap:1,children:["Manage room",(0,ie.jsx)(re.TextBig,{color:"textLite",children:"/"}),(0,ie.jsxs)(re.TextBig,{color:"textLite",children:[t?"Add":"Edit"," Metric"]})]})},Be=[{value:"value",label:"Value"},{value:"progressBar",label:"Progress Bar"}],Pe=[{value:"sum",label:"Sum"},{value:"avg",label:"Average"},{value:"min",label:"Minimum"},{value:"max",label:"Maximum"}],Re=[{value:"left",label:"Left"},{value:"center",label:"Center"},{value:"right",label:"Right"}],Oe=e=>{let{spaceId:t,roomId:n,id:o,onClose:s,tabId:i,...a}=e;const l="new"===o,c=(0,Ie.uB)(n,o),d=(0,Ie.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:C="center"}=u;(0,r.useEffect)((()=>{l&&c()}),[]);const w=(0,z.w7)({extraKey:"nodesView",merge:!1,scoped:!0}),I=(0,Ae.A)(n,w,{spaceId:t});if(I)throw I;const A=(0,ke.OL)(n),k=(0,r.useMemo)((()=>A.map((e=>({value:e,label:e})))),[A]),S=(0,ke._0)(n),T=(0,r.useMemo)((()=>g&&{value:g,label:g}),[g]),[{dimensions:F},M]=(0,we.A)((()=>({enabled:!!g,fetch:()=>((e,t,n)=>Ne.A.get(`${Le.P8}/spaces/${e}/rooms/${t}/contexts/${encodeURIComponent(n)}`,{transform:$e}))(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)((()=>F?0===m.length?[]:m.map((e=>({value:e,label:e}))):[]),[m,F]),$=(0,r.useMemo)((()=>F?0===p.length?[]:p.map((e=>({value:e,label:e}))):[]),[p,F]),D=(0,r.useCallback)((e=>{M||h((t=>({...t,dimensions:e.map((e=>{let{label:t}=e;return t}))})))}),[M]),B=(0,Ie.tQ)(n),P=(0,r.useCallback)((()=>B({...u,id:o,type:i}).then(s)),[u,o,i,s,B]),R=(0,r.useCallback)((e=>{let{target:{value:t}}=e;t.length<=30&&h((e=>({...e,title:t,header:t,headerString:t})))}),[]),O=(0,r.useCallback)((e=>{M||h((t=>({...t,totalDimensions:e.map((e=>{let{label:t}=e;return t}))})))}),[M]),V=(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})))}),[]),_=(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})))}),[]),G=(0,r.useCallback)((e=>{let{target:{checked:t}}=e;h((e=>({...e,calculateTotal:t,totalDimensions:t?e.totalDimensions:[]})))}),[]),W=!x||!g;return(0,ie.jsxs)(ve.GO,{onClose:s,...a,children:[(0,ie.jsx)(ye.z,{onClose:s,title:(0,ie.jsx)(De,{isNew:l}),children:(0,ie.jsx)(re.Button,{label:"Save",onClick:P,disabled:W})}),(0,ie.jsx)(Ce.U,{children:l?"Add a new metric (column)":"Edit metric"}),(0,ie.jsx)(ve.Yv,{children:(0,ie.jsxs)(re.Flex,{gap:6,column:!0,children:[(0,ie.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,ie.jsx)(re.Select,{options:k,value:T,onChange:N,isLoading:!S,"data-testid":"manageMetrics-contextSelect"})}),(0,ie.jsx)(Me,{title:"Metric Title","data-testid":"manageMetrics-title",children:(0,ie.jsx)(re.TextInput,{name:"title",placeholder:"Type name",value:x,onChange:R})}),(0,ie.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,ie.jsx)(re.Select,{isMulti:!0,options:F,value:L,onChange:D,isLoading:M,isDisabled:!T,"data-testid":"manageMetrics-dimensionSelect"})}),(0,ie.jsx)(Me,{title:"Display Type","data-testid":"manageMetrics-columnFlavour",children:(0,ie.jsx)(re.Select,{options:Be,value:{value:j,label:"value"===j?"Value":"Progress Bar"},onChange:V,"data-testid":"manageMetrics-columnFlavourSelect"})}),(0,ie.jsx)(re.Toggle,{labelRight:"Calculate as percentage of total",checked:f,onChange:G,"data-testid":"manageMetrics-calculateTotalToggle",colored:!0}),f&&(0,ie.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,ie.jsx)(re.Select,{isMulti:!0,options:F,value:$,onChange:O,isLoading:M,isDisabled:!T,"data-testid":"manageMetrics-totalDimensionSelect"})}),(0,ie.jsx)(Me,{title:"Aggregation","data-testid":"manageMetrics-aggregation",children:(0,ie.jsx)(re.Select,{options:Pe,value:(0,r.useMemo)((()=>Pe.find((e=>e.value===(b||"sum")))),[b]),onChange:E,"data-testid":"manageMetrics-aggregationSelect"})}),(0,ie.jsx)(Me,{title:"Decimal Places","data-testid":"manageMetrics-fractionDigits",children:(0,ie.jsx)(re.TextInput,{type:"number",name:"fractionDigits",min:"0",max:"3",value:v,onChange:H})}),(0,ie.jsx)(Me,{title:"Hide Units","data-testid":"manageMetrics-hideUnits",children:(0,ie.jsx)(re.Toggle,{checked:y,onChange:K,"data-testid":"manageMetrics-hideUnitsToggle"})}),(0,ie.jsx)(Me,{title:"Text Alignment","data-testid":"manageMetrics-align",children:(0,ie.jsx)(re.Select,{options:Re,value:{value:C,label:Re.find((e=>e.value===C))?.label},onChange:_,"data-testid":"manageMetrics-alignSelect"})}),!l&&(0,ie.jsx)(re.Flex,{justifyContent:"end",children:(0,ie.jsx)(Te,{roomId:n,id:o,onRemove:s})})]})})]})};var Ve=n(49163),Ee=n(45087),ze=n(43375),_e=n(43627),He=n(74979);const Ke=e=>{let{metric:t,onToggle:n,onEdit:r,disabled:o}=e;const{attributes:s,listeners:i,setNodeRef:a,transform:l,transition:c}=(0,_e.gl)({id:t.id}),d={transform:He.Ks.Transform.toString(l),transition:c};return(0,ie.jsx)("div",{ref:a,style:d,...s,children:(0,ie.jsxs)(re.Flex,{"data-testid":`metricsMenu-metric-${t.title}`,justifyContent:"between",alignItems:"center",padding:[1,0],children:[(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:1,children:[!o&&(0,ie.jsx)(re.Icon,{name:"nav_dots",color:"textLite",cursor:"grab",size:"small",...i}),(0,ie.jsx)(re.Checkbox,{checked:!t.hidden,"data-testid":"metricsMenu-metricCheckbox",label:t.title,onChange:n})]}),(0,ie.jsx)(re.IconButton,{"data-testid":"metricsMenu-editMetric",flavour:"borderless",icon:"pencilSolid",padding:[0],onClick:r,width:"10px",height:"10px"})]})})},Ge=e=>{let{isOpen:t,onClose:n,onEdit:o,roomId:s,targetRef:i,tabId:a}=e;const[l,c]=(0,Ie.tY)(s),d=(0,r.useMemo)((()=>l.filter((e=>e.type===a))),[a,l]),[u,h]=(0,r.useState)(d.map((e=>e.id)));(0,r.useEffect)((()=>{h(d.map((e=>e.id)))}),[d]);const x=(0,ze.FR)((0,ze.MS)(ze.AN),(0,ze.MS)(ze.uN,{coordinateGetter:_e.JR})),g=(0,Ie._E)(s,a),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:s,params:{type:"roomMetrics",entity:"metrics",path:"/nodes"}})[0],f=(0,Ie.Ul)(s,a);if(!i.current||!t)return null;const j=e=>{o(e),n()};return(0,ie.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:i.current,gap:1,children:[(0,ie.jsx)(re.Button,{"data-testid":"metricsMenu-addMetricButton",label:"Add new metric",icon:"plus",onClick:()=>j("new"),small:!0,alignSelf:"end"}),(0,ie.jsx)(ze.Mp,{sensors:x,collisionDetection:ze.fp,onDragEnd:m,children:(0,ie.jsx)(_e.gB,{items:u,strategy:_e._G,children:(0,ie.jsx)(re.Flex,{column:!0,children:u.map((e=>{const t=d.find((t=>t.id===e));return t?(0,ie.jsx)(Ke,{metric:t,onToggle:()=>c(t.id,(e=>({...e,hidden:!e.hidden,type:a}))),onEdit:()=>j(t.id),disabled:!1},t.id):null}))})})}),p&&(0,ie.jsx)(Ee.A,{content:"All metrics will be reset to defaults",children:(0,ie.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[s,,i,a]=(0,pe.A)(),[l,c]=(0,r.useState)(null),d=(0,r.useRef)();return(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(be.A,{permission:"space:UpdateSettings",ifForbidden:"hide","data-ga":"metric-setting::click-metric-setting::hm-nodes","data-testid":"metricSettings-button",flavour:"hollow",icon:"gear",neutral:!0,onClick:i,ref:d,label:"Metrics",small:!0}),(0,ie.jsx)(Ge,{isOpen:s,onClose:a,onEdit:c,roomId:n,tabId:o,targetRef:d}),l&&(0,ie.jsx)(Oe,{"data-testid":"metricsManagement",spaceId:t,roomId:n,tabId:o,id:l,onClose:()=>c(null)})]})};var Ue=n(94404);const qe=()=>(0,oe.H)("grouping","click-grouping","hm-nodes"),Je=(0,Ue.A)(fe.A),Xe=[{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"}],Ye=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),[n,,o,s]=(0,pe.A)(),[i,a]=(0,V.TS)(t,"groupMode"),l=(0,r.useMemo)((()=>Xe.find((e=>e.value===i))||Xe[0]),[i]),c=(0,r.useCallback)((e=>{let{value:t}=e;return a(t)}),[a]);return(0,ie.jsxs)(re.Flex,{alignItems:"center","data-testid":"agentsHead-actions",flexWrap:!1,gap:3,children:[(0,ie.jsx)(re.Select,{label:"Group by",onChange:c,onMenuOpen:qe,options:Xe,value:l}),(0,ie.jsx)(We,{roomId:t,spaceId:e}),n&&(0,ie.jsx)(je.A,{onClose:s}),(0,ie.jsx)(Je,{"data-ga":"add-nodes::click-add-nodes::hm-nodes","data-testid":"agentsHead-addNode",icon:"nodes_hollow",label:"Add Nodes",onClick:o,small:!0})]})},Ze=()=>(0,ie.jsx)(re.Flex,{width:"100%",justifyContent:"end",background:"mainBackground",padding:[2],children:(0,ie.jsx)(Ye,{})});n(3949);var Qe=n(85163),et=n(84535),tt=n(78152);const nt="clear",rt="warning",ot="critical",st="unreachable";var it=n(49181);const at={alertStatus:{[ot]:1,[rt]:2,[nt]:3,[st]: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 ct=n(56876),dt=n(30863),ut=n(69001),ht=n(95836),xt=n(27496);const gt=e=>{let{id:t,...n}=e;return(0,ie.jsxs)(ut.h,{id:t,...n,children:[(0,ie.jsx)(ht.$,{id:t}),(0,ie.jsx)(xt.n,{id:t})]})},mt=(0,r.memo)(gt);var pt=n(16373),ft=n(90901),jt=n(82103),bt=n(55759),vt=n(77186),yt=n(59400);const Ct=e=>{let{connectivity:t,id:n,name:r,...o}=e;const s=(0,g.JT)("node:Delete"),i=!(0,v.XA)().untouchable,[a,,l,c]=(0,pe.A)(),[d,,u,h]=(0,pe.A)();return(0,ie.jsxs)(yt.SS,{alignSelf:"end",gap:1,"data-testid":"node-actions",...o,children:[i&&(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(jt.A,{badge:"actionRemove","data-testid":"remove-node-action",children:(0,ie.jsx)(yt.d0,{"data-ga":"nodes-table-row::click-remove-node::nodes-view",onClick:u})}),d&&(0,ie.jsx)(vt.Ay,{ids:[n],name:r,onClose:h})]}),s&&"Offline"===t&&(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(jt.A,{badge:"actionObsolete","data-testid":"obsolete-node-action",children:(0,ie.jsx)(yt.AS,{"data-ga":"nodes-table-row::click-obsolete-node::nodes-view",onClick:l})}),a&&(0,ie.jsx)(bt.Ay,{ids:[n],name:r,onClose:c})]})]})};var wt=n(97336);const It=e=>{let{instanceType:t,name:n,providerType:r,...o}=e;return(0,ie.jsx)(jt.A,{badge:"cloudInfo","data-testid":"node-cloud-info",nodeName:n,...o,children:(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(re.Icon,{color:"textDescription","data-testid":"node-cloud-info-icon",name:"ipNetworking",width:"18px",height:"18px"}),(0,ie.jsxs)(re.TextSmall,{color:"textDescription","data-testid":"node-cloud-info-text",children:[(0,it.ws)(r)," \u2022 ",(0,it.ws)(t)]})]})})},At=e=>{let{connectivity:t,name:n,...r}=e;return(0,ie.jsx)(jt.A,{badge:"connectivity",connectivityState:t,"data-testid":"node-connectivity",nodeName:n,...r,children:(0,ie.jsx)(re.Icon,{name:`connectivityStatus${t}`,width:"18px",height:"18px"})})},kt=e=>{let{onClick:t,...n}=e;return(0,ie.jsx)(jt.A,{badge:"info","data-testid":"node-info-cta",...n,children:(0,ie.jsx)(re.Icon,{color:"textDescription",cursor:"pointer",height:"18px",width:"18px",name:"information",onClick:t})})},St=e=>{let{name:t,...n}=e;return(0,ie.jsx)(jt.A,{badge:"k8s","data-testid":"node-kubernetes",nodeName:t,...n,children:(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(re.Icon,{color:"textDescription","data-testid":"node-kubernetes-icon",name:"serviceKubernetes",width:"18px",height:"18px"}),(0,ie.jsx)(re.TextSmall,{color:"textDescription","data-testid":"node-kubernetes-text",children:"k8s"})]})})},Tt=e=>{let{kernelName:t,kernelVersion:n,name:r,...o}=e;return(0,ie.jsx)(jt.A,{badge:"kernel","data-testid":"node-kernel",nodeName:r,...o,children:(0,ie.jsx)(re.TextSmall,{color:"textDescription",children:(0,it.Ud)(t,n)})})};var Ft=n(52253),Mt=n(41708),Nt=n(92834);const Lt=e=>{let{architecture:t,cpuFrequency:n,cpus:r,diskSpace:o,memory:s,name:i,os:a,osName:l,timezone:c,...d}=e;return(0,ie.jsx)(jt.A,{badge:"systemInfo","data-testid":"node-system-info",nodeName:i,...d,children:(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(re.Icon,{color:"textDescription","data-testid":"node-system-info-icon",name:et.u[l]?.iconName||et.U[a]?.iconName||"os",width:"16px",height:"16px"}),(0,ie.jsxs)(re.TextSmall,{color:"textDescription","data-testid":"node-system-info-text",children:[(0,it.ws)(l)," \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)(s),"RAM")," \u2022"," ",(0,it.ws)((0,it.RI)(o),"HD"),!!c&&(0,ie.jsxs)(ie.Fragment,{children:[" ","\u2022 ",(0,ie.jsx)(Nt.A,{timezone:c})]})]})]})})},$t=e=>{let{container:t,name:n,virtualization:r,...o}=e;const s=(0,it.Pg)(t,r);return(0,ie.jsx)(jt.A,{badge:"type","data-testid":"node-type",nodeName:n,nodeType:s.label,...o,children:(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(re.Icon,{color:"textDescription","data-testid":"node-type-icon",name:s.icon,height:s.iconSize,width:s.iconSize}),(0,ie.jsx)(re.TextSmall,{color:"textDescription","data-testid":"node-type-text",children:s.label})]})})};var Dt=n(71236);const Bt=e=>{let{health:t={}}=e;const{silencingState:n}=t.alerts||{},{state:r}=n||{};return"NONE"!=r?(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(yt.K,{"data-testid":"nodeRow-separator"}),(0,ie.jsx)(re.Flex,{children:(0,ie.jsx)(Dt.A,{flavour:"node",silencing:n})})]}):null};var Pt=n(74891);const Rt=(0,Pt.A)((0,Ue.A)(re.Button)),Ot=e=>{let{id:t}=e;const n=(0,f.Zp)(),o=(0,b.bq)(),s=(0,r.useCallback)((()=>{const e={nodeId:t};n(`/spaces/${o}/settings/notifications#notificationsActiveTab=1&silencingRulePrefill=${JSON.stringify(e)}`)}),[]);return(0,ie.jsx)(Rt,{feature:"SilencingNode",payload:{nodeId:""},tooltip:"Create a new silencing rule for this node",flavour:"hollow",icon:"alarm_off",iconWidth:"12px",onClick:s})};var Vt=n(36504),Et=n(92942),zt=n(19371),_t=n(63928);const Ht=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]),s=(0,r.useMemo)((()=>n.reduce(((e,t)=>({...e,...t.value?.nodeId?{[t.value.nodeId]:t}:{}})),{})),[n]),i=(0,_t.xS)(),a=(0,r.useCallback)((async e=>{const t=e.map(((e,t)=>{const n=s[e];if(n)return i({...n,value:{...n.value,sortOrder:t}})}));await Promise.all(t.filter(Boolean))}),[s,i]);return{favoriteNodeIds:o,settingsByNodeId:s,handleOrderChange:a}},Kt=(e,t)=>e&&e.getRoot().getChildren().find((e=>e.match({id:`nodes-${t}`}))),Gt=(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=Kt(e,t);if(!o)return null;const s=Gt(n,r);return o.getNode({id:s})};var Ut=n(28657);const qt=e=>{let{id:t,roomId:n,nodeId:o,context:s,dimensions:i}=e;const a=(0,zt.eg)(),l=(0,r.useMemo)((()=>{const e=Kt(a,n),r=[t,o,s].join("-");if(!e)return null;let l=e.getNode({id:r});return l?(l.updateAttribute("selectedDimensions",i),l):(l=a.makeChart({attributes:{id:r,nodesScope:[o],contextScope:[s],pixelsPerPoint:20,selectedDimensions:i}}),e.appendChild(l),l)}),[s,t,o,n,a]);return l?(0,ie.jsx)(Ut.A,{chart:l,hasHeader:!1,hasFooter:!1,hasFilters:!1,height:100}):null},Jt=(0,r.memo)(qt);var Xt=n(74518);const Yt=e=>{let{id:t,context:n,nodeId:r,isLive:o,hidden:s,title:i,dimensions:a}=e;const l=(0,v.ID)();return s||!o?null:(0,ie.jsxs)(re.Flex,{column:!0,"data-testid":`metrics-chart-${n}`,flex:"grow",basis:"174px",children:[(0,ie.jsx)(Xt.A,{text:i||n,TextComponent:re.TextSmall,color:"textDescription",margin:[1,0,1,2],as:"div"}),(0,ie.jsx)(Jt,{id:t,context:n,nodeId:r,roomId:l,dimensions:a})]})};var Zt=n(91421),Qt=n(3319);const en=e=>{let{node:t,...n}=e;const[,o]=(0,Zt.PJ)(),{sendButtonClickedLog:s}=(0,Qt.A)(),i=t.capabilities?.dyncfg?.enabled,a=t.isLive&&i,l=a?"Configure this node":t.isLive?"Node cannot be configured":"Cannot configure a non live node",c=(0,r.useCallback)((()=>{a&&(o(!0,{nodeId:t.id}),s({feature:"DyncfgNode",description:"Configure node",nodeId:t?.id,nodeName:t?.name}))}),[a,t,o,s]),d=(0,r.useMemo)((()=>({name:"gear",size:"small",color:a?"text":"disabled",cursor:a?"pointer":"auto",onClick:c})),[a,c]);return(0,ie.jsx)(jt.A,{content:l,children:(0,ie.jsx)(re.Flex,{...n,children:(0,ie.jsx)(re.Icon,{...d})})})};var tn=n(51262);const nn=(rn=en,e=>(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(yt.K,{"data-testid":"nodeRow-separator"}),(0,ie.jsx)(rn,{...e})]}));var rn;const on=e=>{let{id:t,name:n,hw:o,os:s,ni:i,capabilities:a,container:l,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)(),C=(0,v.ID)(),w=a.funcs?.enabled,I=a.ml?.enabled,A=(0,it.GM)(x),{isNodeRestricted:k}=(0,tn.A)(),{restricted:S}=k(t),{_cloud_instance_type:T,_cloud_provider_type:F,_timezone:M}=u||{},N="true"===u?._is_k8s_node,L=!(0,it.Po)(T)||!(0,it.Po)(F),$=(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]),O=(0,r.useCallback)((()=>P("info")),[P]),V=(0,pt.Id)(),E=(0,ft.I)(),z=(0,Ie.Vw)(C);return(0,ie.jsxs)(re.Flex,{"data-testid":`nodeRow-${n}`,"data-menuid":f||t,padding:[1],column:!0,gap:1,round:!0,children:[(0,ie.jsxs)(re.Flex,{alignItems:"center","data-testid":"nodeRow-basic-info",gap:2,height:{min:6},children:[(0,ie.jsx)(At,{connectivity:A,"data-testid":`nodeRow-connectivity-${A.toLowerCase()}`,name:n}),(0,ie.jsx)(yt.K,{"data-testid":"nodeRow-separator"}),(0,ie.jsx)(Mt.A,{"data-testid":"nodeRow-name",id:t,name:n,isLive:h,state:x,eligibility:j}),(0,ie.jsx)(yt.K,{"data-testid":"nodeRow-separator"}),(0,ie.jsx)(kt,{onClick:O,"data-testid":"nodeRow-more-info-cta"}),(0,ie.jsx)(yt.K,{"data-testid":"nodeRow-separator"}),(0,ie.jsx)(wt.A,{id:t,isLive:h,"data-testid":"nodeRow-alerts",name:n,onClick:R}),(0,ie.jsx)(yt.K,{"data-testid":"nodeRow-separator"}),(0,ie.jsx)(Ft.A,{badge:"ml","data-testid":"nodeRow-machine-learning-status",enabled:I,name:n,onClick:()=>E(t),children:(0,ie.jsx)(re.Icon,{name:"anomaliesLens",size:"small",color:"text"})}),(0,ie.jsx)(yt.K,{"data-testid":"nodeRow-separator"}),(0,ie.jsx)(Ft.A,{badge:"fn","data-testid":"nodeRow-fn-status",enabled:w,name:n,onClick:()=>V(t),children:(0,ie.jsx)(re.Icon,{name:"functions",size:"small",color:"text"})}),c&&(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(yt.K,{"data-testid":"nodeRow-separator"}),(0,ie.jsx)(Vt.A,{name:n,os:s.id,container:l,warningLevel:c,labels:u,version:g,text:c,"data-testid":"nodeRow-needs-update"})]}),!!(d||[]).length&&(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(yt.K,{"data-testid":"nodeRow-separator"}),(0,ie.jsx)(Et.A,{bugs:d,"data-testid":"nodeRow-bugs"})]}),(0,ie.jsx)(nn,{node:{id:t,name:n,isLive:h,ni:i,capabilities:a}}),(0,ie.jsx)(Ct,{"data-testid":"nodeRow-node-actions",id:t,name:n,connectivity:A}),y?null:(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(Bt,{health:p}),(0,ie.jsx)(Ot,{id:t})]})]}),(0,ie.jsxs)(re.Flex,{alignItems:"center","data-testid":"nodeRow-detailed-info",gap:2,children:[(0,ie.jsx)(Lt,{architecture:o.architecture,cpuFrequency:o.cpuFrequency,cpus:o.cpus,"data-testid":"nodeRow-system-info",diskSpace:o.diskSpace,memory:o.memory,name:n,osName:s.nm,os:s.id,timezone:M}),(0,ie.jsx)(yt.K,{"data-testid":"nodeRow-separator"}),!!s?.kernel&&(0,ie.jsx)(Tt,{"data-testid":"nodeRow-kernel",kernelName:s.kernel.nm,kernelVersion:s.kernel.v,name:n}),(0,ie.jsx)(yt.K,{"data-testid":"nodeRow-separator"}),N&&(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(St,{"data-testid":"nodeRow-kubernetes",name:n}),(0,ie.jsx)(yt.K,{"data-testid":"nodeRow-separator"})]}),(0,ie.jsx)($t,{container:o.container,"data-testid":"nodeRow-type",name:n,virtualization:o.virtualization}),L&&(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(yt.K,{"data-testid":"nodeRow-separator"}),(0,ie.jsx)(It,{"data-testid":"nodeRow-cloud-info",instanceType:T,name:n,providerType:F})]})]}),!S&&!!z?.length&&(0,ie.jsx)(re.Flex,{"data-testid":"nodeRow-charts",gap:1,children:z.map((e=>(0,ie.jsx)(Yt,{...e,nodeId:t,isLive:h},e.id)))})]})},sn=e=>{switch(e.level){case 0:return mt;case 1:return on;default:return null}},an=e=>{let{onChartNameChange:t,initialChartName:n,dashboardOptions:r,linkToGo:o,contextToGo:s,...i}=e;const{setActiveMenuId:a}=(0,ct.A)({onChartNameChange:t,initialChartName:n,linkToGo:o,contextToGo:s});return(0,ie.jsx)(te.H,{...i,children:(0,ie.jsx)(dt.A,{flavour:"nodes",onActiveMenuId:a,getComponent:sn,dashboardOptions:r,initialChartName:n,checkVisibility:()=>!0})})};var ln=n(69457),cn=n(20871),dn=n(48106),un=n(33185),hn=n(24155);const xn=(0,un.default)(re.Box).attrs((e=>({...e}))).withConfig({displayName:"loader__Grid",componentId:"sc-yd9b7n-0"})(["display:grid;grid-template-columns:1fr 6fr 1fr;gap:8px;"]),gn=()=>(0,ie.jsxs)(re.Flex,{column:!0,gap:2,children:[(0,ie.jsx)(hn.A,{height:"38px"}),(0,ie.jsx)(xn,{children:Array.from(Array(15).keys()).map((e=>(0,ie.jsxs)(r.Fragment,{children:[(0,ie.jsx)(hn.A,{height:"32px"}),(0,ie.jsx)(hn.A,{height:"32px"}),(0,ie.jsx)(hn.A,{height:"32px"})]},e)))})]});var mn=n(9962),pn=(n(30670),n(36310)),fn=n(39483);const jn=e=>{let{children:t,contextName:n,dimensions:r,aggregationMethod:o="sum",fractionDigits:s,totalDimensions:i,calculateTotal:a}=e;const{chart:l,state:c}=(0,pn.useHeadlessChart)(),{contextGroups:d}=(0,fn.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=l.getPayload()?.data?.length-1||0;if(a){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=i&&i.length>0?i.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+(l.getDimensionValue(t,h)||0)),0),a=n.reduce(((e,t)=>e+(l.getDimensionValue(t,h)||0)),0),d=a>0?o/a*100:0,x=e[0];return t({data:{value:o,convertedValue:l.getConvertedValue(o,{fractionDigits:s,dimensionId:x}),total:l.getConvertedValue(a,{fractionDigits:s,dimensionId:x}),percentage:d,units:l.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=l.getAggregatedDimensionValue(p,h,{aggregationMethod:o}),g=l.getConvertedValue(x,{dimensionId:f,fractionDigits:s})}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=l.getAggregatedDimensionValue(p,h,{aggregationMethod:o}),g=l.getConvertedValue(x,{dimensionId:f,fractionDigits:s}),m=l.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=l.getAggregatedDimensionValue(p,h,{aggregationMethod:o}),g=l.getConvertedValue(x,{dimensionId:f,fractionDigits:s})}return t({data:{value:parseFloat(x)||0,convertedValue:g||"0",dimensionId:f,units:f?l.getUnitSign({dimensionId:f}):"",...m&&{color:m}},loading:!c.loaded&&c.loading,error:null})},bn=e=>{let{nodeId:t,contextName:n,dimensions:o,aggregationMethod:s="sum",fractionDigits:i,totalDimensions:a,calculateTotal:l,children:c}=e;const d=(0,zt.eg)(),u=(0,v.ID)(),[h,x]=(0,r.useState)((()=>Wt(d,u,t,s)));return(0,r.useEffect)((()=>{if(h)return;const e=(e,n)=>{n.getId()!==Gt(t,s)&&n.getId()!==h?.getId()&&x(n)},n=()=>x(Wt(d,u,t,s));return d.on("nodeAdded",e),d.on("nodesContainerUpdated",n),n(),()=>{d.off("nodeAdded",e),d.off("nodesContainerUpdated",n)}}),[d,h]),h?(0,ie.jsx)(pn.default,{chart:h,children:(0,ie.jsx)(jn,{contextName:n,dimensions:o,aggregationMethod:s,fractionDigits:i,totalDimensions:a,calculateTotal:l,children:c})}):c({data:null,loading:!0,error:"Chart not found"})},vn=()=>(0,ie.jsx)(hn.A,{width:"80%",height:"8px"}),yn={value:e=>({id:e.columnId,header:(0,ie.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,ie.jsx)(bn,{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,ie.jsx)(re.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,ie.jsx)(vn,{})});if(!n)return(0,ie.jsx)(re.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,ie.jsx)(re.Text,{children:"-"})});const o=n.convertedValue&&n.total;return(0,ie.jsxs)(re.Flex,{alignItems:"end",justifyContent:"end",width:"100%",gap:.5,children:[(0,ie.jsx)(re.Text,{textAlign:"right",children:o?(0,ie.jsxs)(ie.Fragment,{children:[n.convertedValue,"/",n.total]}):n.convertedValue}),!e.hideUnits&&n.units&&(0,ie.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,ie.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,ie.jsx)(bn,{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,ie.jsx)(re.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,ie.jsx)(vn,{})});if(!n)return(0,ie.jsx)(re.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,ie.jsx)(re.Text,{children:"-"})});const o="undefined"!==typeof n.convertedValue&&"undefined"!==typeof n.total,s=o?n.percentage:parseFloat(n.convertedValue)||0,i=Math.min(s,100);return(0,ie.jsxs)(re.Flex,{column:!0,width:"100%",alignItems:o?"center":"end",gap:2,children:[(0,ie.jsxs)(re.Flex,{alignItems:"end",justifyContent:o?"between":"end",width:"100%",children:[o&&(0,ie.jsxs)(re.Flex,{alignItems:"end",gap:.5,children:[(0,ie.jsxs)(re.Text,{children:[n.convertedValue,"/",n.total]}),!e.hideUnits&&n.units&&(0,ie.jsx)(re.TextMicro,{color:"textLite",strong:!0,textAlign:"right",children:n.units})]}),(0,ie.jsxs)(re.Flex,{alignItems:"end",children:[(0,ie.jsx)(re.Text,{children:Math.round(s)}),(0,ie.jsx)(re.TextMicro,{color:"textLite",strong:!0,children:"%"})]})]}),(0,ie.jsx)(re.ProgressBar,{background:"panelBg",color:"textLite",height:.5,width:`${i}%`,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,ie.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 s=r;for(const e of o)if(s=s?.[e],void 0===s)break;if(e.fallbackKeys)for(const i of e.fallbackKeys){if(!(0,it.Po)(s))break;const e=i.split(".");let t=r;for(const n of e)if(t=t?.[n],void 0===t)break;s=t}return(0,it.Po)(s)?(0,ie.jsx)(re.Flex,{alignItems:"end",width:"100%",children:(0,ie.jsx)(re.Text,{children:"-"})}):(0,ie.jsx)(re.Flex,{alignItems:"center",width:"100%",children:(0,ie.jsx)(re.Text,{children:s})})},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 s of e.fallbackKeys){if(!(0,it.Po)(o))break;const e=s.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 Cn=n(71341);const wn=e=>{let{osEntry:t}=e;if(!t)return(0,ie.jsx)(re.Icon,{name:"os",width:"18px",height:"18px",color:"textDescription"});if(t.iconName)return(0,ie.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,ie.jsx)("img",{src:e,width:"18px",height:"18px",alt:t.title})}return(0,ie.jsx)(re.Icon,{name:"os",width:"18px",height:"18px",color:"textDescription"})},In=e=>{let{headerText:t="Server"}=e;return{id:"server",header:(0,ie.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,s=n.os?.id,i=n.labels?.vendor,a=et.u[o]||et.U[s]||et.u[i],l="Live"===r?Cn.P.live.indicatorWrapperColor:"Stale"===r?Cn.P.stale.indicatorWrapperColor:Cn.P.offline.indicatorWrapperColor;return(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:2,width:"100%",children:[(0,ie.jsx)(re.Flex,{width:2,height:2,round:"50%",background:l,flex:!1}),(0,ie.jsx)(re.Flex,{width:5,height:5,flex:!1,alignItems:"center",justifyContent:"center",children:(0,ie.jsx)(wn,{osEntry:a})}),(0,ie.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"}},An=e=>({id:"alerts",header:(0,ie.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:s=0,critical:i=0}=o.health?.alerts||{},a=s+i>0,l=(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),l("alerts"),d(o.id)}),[o.id,d,c,l]),h=(0,mn.I)({flavour:i>0?"error":"disabledError",value:i||" "}),x=(0,mn.I)({flavour:s>0?"warning":"disabledWarning",value:s||" "});return(0,ie.jsx)(re.Flex,{alignItems:"center",justifyContent:"center",opacity:a?1:.3,children:(0,ie.jsx)(re.MasterCard,{"data-testid":"alertsMastercard",onClick:a?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"}),kn=(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=yn[e.columnFlavour];return t?t(e):(console.warn(`Unknown column flavour: ${e.columnFlavour}`),yn.value(e))})))(e)||[],s=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:[In({headerText:t}),An(n)],notFlex:!0},...Object.entries(s).map((e=>{let[t,n]=e;return{id:t,header:"",columns:n,notFlex:!0}}))]}),[e,n,o])};var Sn=n(1444),Tn=n(95565);const Fn={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,ie.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,ie.jsx)(re.Text,{children:"Favourites can be saved only on a paid plan."}),(0,ie.jsx)(Tn.A,{children:(0,ie.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,s]=(0,pe.A)(),i=(0,_t.yK)({onResolve:s}),a=(0,_t.z2)(null,{onResolve:s}),{disabled:l,reason:c}=(0,Sn.A)(),d=(0,r.useCallback)((async function(n,r){let{tabId:s=t,flavour:c=e}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!l&&n&&(o(),r?await a(r.id):await i({type:"favourites",entity:n,path:`/${c}/${s}`,value:{nodeId:n,sortOrder:Date.now()}}))}),[l,i,a,o,e,t]);return{isLoading:n,disabled:l,reason:Fn[c]||Fn.default,toggleFavorite:d}},Nn={[ot]:"error",[rt]:"warning",[nt]:"success",[st]:"textLite"},Ln={Live:"live",Stale:"stale",Offline:"offline",critical:"live",warning:"live",clear:"live"},$n={nodeStatus:!0,critical:!0,warning:!0,clear:!0},Dn=e=>{let{rows:t,name:n,groupMode:r}=e;const o=$n[r]||$n[n],s=t.map((e=>e.original.id)),i=(0,E.BU)(s).length,a=(0,E.Ig)(s).length,l=(0,E.GE)(s).length;return(0,ie.jsx)(Ee.A,{content:(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:4,background:"dropdown",round:!0,padding:[2,3],children:[(!o||Ln[n]===Ln.Live)&&(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:2,children:[(0,ie.jsx)(re.Flex,{width:2,height:2,round:"50%",background:Cn.P.live.indicatorWrapperColor}),(0,ie.jsxs)(re.Text,{children:["Live: ",i]})]}),(!o||Ln[n]===Ln.Stale)&&(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:2,children:[(0,ie.jsx)(re.Flex,{width:2,height:2,round:"50%",background:Cn.P.stale.indicatorWrapperColor}),(0,ie.jsxs)(re.Text,{children:["Stale: ",a]})]}),(!o||Ln[n]===Ln.Offline)&&(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:2,children:[(0,ie.jsx)(re.Flex,{width:2,height:2,round:"50%",background:Cn.P.offline.indicatorWrapperColor}),(0,ie.jsxs)(re.Text,{children:["Offline: ",l]})]})]}),align:"right",children:(0,ie.jsxs)(re.Text,{color:"textLite",children:["(",(!o||Ln[n]===Ln.Live)&&(0,ie.jsx)(re.Text,{color:Cn.P.live.statusTextColor,children:i}),!o&&"/",(!o||Ln[n]===Ln.Stale)&&(0,ie.jsx)(re.Text,{color:Cn.P.stale.statusTextColor,children:a}),!o&&"/",(!o||Ln[n]===Ln.Offline)&&(0,ie.jsx)(re.Text,{color:Cn.P.offline.statusTextColor,children:l}),")"]})})},Bn=e=>{let{row:t,name:n,groupMode:r,...o}=e;const s=t.getIsExpanded(),i=(a=n,Cn.P[a?.toLowerCase?.()]?.statusTextColor||Nn[a]||"text");var a;return(0,ie.jsx)(re.Flex,{height:"44px",alignItems:"center",flex:!0,width:"100%",background:"tableRowBg2",_hover:{background:"tableRowBg2Hover"},...o,children:(0,ie.jsxs)(re.Flex,{position:"sticky",left:"0px",width:"auto",padding:[2,3],gap:2,children:[(0,ie.jsx)(re.Icon,{name:"chevron_left",size:"small",color:"textLite",rotate:s?1:3}),(0,ie.jsx)(re.Text,{color:i,strong:!0,children:n}),(0,ie.jsx)(Dn,{rows:t.subRows,groupMode:r,name:n})]})})},Pn=e=>{let{tabId:t,flavour:n,onClickRow:r,columnPinning:o,columnVisibility:s,columnSizing:i,onColumnSizingChange:a,sortBy:l,onSortingChange:c,rowActions:d,columns:u}=e;const{favoriteNodeIds:h}=Ht(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,ie.jsx)(ie.Fragment,{children:(0,ie.jsxs)("div",{children:[(0,ie.jsx)(Bn,{row:p,name:"Favourites",onClick:g}),(0,ie.jsx)(re.Collapsible,{open:x,children:(0,ie.jsx)(re.Table,{data:m,dataColumns:u,rowActions:d,onClickRow:r,enableSorting:!0,sortBy:l,onSortingChange:c,enableColumnPinning:!0,enableResizing:!0,columnVisibility:s,columnSizing:i,onColumnSizingChange:a,background:"tableRowBg2",columnPinning:o})})]})}):null};var Rn=n(28388);const On={right:["actions"],left:["server"]},Vn={nodeStatus:{Live:!0},default:!0},En=e=>{let{id:t}=e;return t},zn=(e=>t=>{let{nodeIdsLoaded:n,...r}=t;return(0,v.XA)("fullyLoaded")&&!!n?(0,ie.jsx)(e,{...r}):(0,ie.jsx)(gn,{})})((e=>{let{nodeIds:t,tabNodeIds:n,onChartNameChange:o,initialChartName:s,tabId:i="servers",flavour:a="nodesView"}=e;const l=(0,ln.qR)(),c=(0,v.ID)(),d=(0,V.Cq)(c,i),u=(0,V.A3)(c,i),h=(0,Ie.vh)(c,i),[x,m]=(0,H.r$)("expanded",{extraKey:`${a}-${i}-${d||"ungrouped"}`,flavour:"obj",defaultValue:Vn[d]||Vn.default}),[p,f]=(0,r.useState)(null),[j,y]=(0,r.useState)(null),C=(0,r.useCallback)(((e,t)=>{f({ids:[e],name:t})}),[]),w=(0,r.useCallback)(((e,t)=>{y({ids:[e],name:t})}),[]),I=kn(h,{extraKey:a,tabId:i}),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})(i)),[i]),k=(0,r.useMemo)((()=>h.reduce(((e,t)=>(t.hidden&&(e[t.columnId]=!1),e)),{})),[h]),[S,T]=(0,H.r$)("columnVisibility",{extraKey:`${a}-${i}`,flavour:"obj",defaultValue:k}),[F,M]=(0,H.r$)("columnSizing",{extraKey:`${a}-${i}`,flavour:"obj",defaultValue:{}}),[N,L]=(0,H.r$)("sortBy",{extraKey:`${a}-${i}`,flavour:"arrobj",defaultValue:[]}),$=(0,H.Fw)("sidebarTab",{flavour:"val",extraKey:a}),D=(0,H.Fw)("sidebarOpen",{flavour:"bool"}),B=(0,H.Fw)("sidebarNodeId",{flavour:"val",extraKey:a}),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]),O=((e,t)=>{let{flavour:n,onRemoveNode:o,onObsoleteNode:s,onClickNode:i}=t;const a=(0,g.JT)("node:Delete"),l=(0,v.XA)(),c=(0,b.dg)(),d=!l.untouchable,{isLoading:u,toggleFavorite:h,disabled:x,reason:m}=Mn(n,e),{settingsByNodeId:p}=Ht(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=>s(e.id,e.name),confirmation:!0,confirmationText:e=>`Delete ${e.name} permanently?`,isDisabled:e=>{const t=(0,it.GM)(e.state);return a&&"Offline"!==t}}},info:{handleAction:e=>i({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..."}})),[a,c,d,o,s,u,x,p,i])})(i,{flavour:a,onRemoveNode:C,onObsoleteNode:w,onClickNode:R}),{setActiveMenuId:E}=(0,ct.A)({onChartNameChange:o,initialChartName:s}),z=(0,r.useRef)(),_=(0,r.useRef)(),K=(0,r.useMemo)((()=>(z.current&&z.current.cancel(),z.current=(0,cn.A)({elementQueryParam:"[data-id]",dataMenuId:"data-id"}),()=>z.current(_.current?.scrollElement,E))),[l.length,E]);(0,r.useLayoutEffect)((()=>{l.length&&K()}),[l.length,s]);const G=(0,r.useRef)(),W=(0,r.useMemo)((()=>({overscan:30,virtualRef:_,onScroll:K})),[K]),U=(0,r.useMemo)((()=>l.filter(Boolean)),[l]);(0,dn.A)(_.current,U);const q=(0,r.useMemo)((()=>e=>(0,ie.jsx)(Bn,{groupMode:d,...e})),[d]);return(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(Pn,{tabId:i,flavour:a,onRemoveNode:C,onObsoleteNode:w,onClickRow:R,columnPinning:On,columnVisibility:S,columnSizing:F,onColumnSizingChange:M,sortBy:N,onSortingChange:L,rowActions:O,columns:I}),t.length?(0,ie.jsx)(re.Table,{title:(0,ie.jsx)(Rn.A,{extraKey:`${a}-${i}`,nodeIds:n,tabId:i}),data:U,dataColumns:I,rowActions:O,onClickRow:R,enableSorting:!0,sortBy:N,onSortingChange:L,enableColumnVisibility:!0,enableColumnPinning:!0,enableResizing:!0,columnPinning:On,columnVisibility:S,onColumnVisibilityChange:T,columnSizing:F,onColumnSizingChange:M,groupByColumns:A,grouping:d||"",onGroupByChange:u,getSubRows:e=>e.children,enableExpanding:!0,getRowId:En,expanded:x,onExpandedChange:m,GroupRow:q,virtualizeOptions:W,tableRef:G,background:"tableRowBg2"}):(0,ie.jsx)(me,{children:(0,ie.jsx)(Rn.A,{extraKey:`${a}-${i}`,nodeIds:n,tabId:i})}),p&&(0,ie.jsx)(vt.Ay,{ids:p.ids,name:p.name,onClose:()=>f(null)}),j&&(0,ie.jsx)(bt.Ay,{ids:j.ids,name:j.name,onClose:()=>y(null)})]})}));var _n=n(25279),Hn=n(57377),Kn=n(41061);const Gn={id:null,name:"",filters:{},metricsType:"servers",hidden:!1},Wn={tabOrder:[],hiddenTabs:[],groups:[]},Un=(0,W.Iz)((()=>(0,G.eU)([])),Hn.Ay),qn=(0,W.Iz)((e=>{let{roomId:t,id:n}=e;return(0,G.eU)(Gn)}),Hn.Ay),Jn=(0,W.Iz)((()=>(0,G.eU)([])),Hn.Ay),Xn=(0,W.Iz)((()=>(0,G.eU)([])),Hn.Ay),Yn={type:"nodeGroups",entity:"groups",path:"/nodes"},Zn=(0,W.Iz)((e=>{let{spaceId:t,roomId:n}=e;return(0,G.eU)(null,((e,r)=>{const o=e((0,Ve.h)({spaceId:t,roomId:n,params:Yn}))[0],s=o?.value||Wn,i=s.groups||[],a=s.tabOrder||[],l=s.hiddenTabs||[];r(Un(n),i.map((e=>e.id))),i.forEach((e=>{r(qn({roomId:n,id:e.id}),{...Gn,...e})})),r(Jn(n),a),r(Xn(n),l)}))}),Hn.Ay),Qn=(0,W.Iz)((e=>{let{roomId:t,id:n}=e;return(0,G.eU)((e=>e(qn({roomId:t,id:n}))),((e,r,o)=>{const s=e(qn({roomId:t,id:n})),i="function"===typeof o?o(s):o;r(qn({roomId:t,id:n}),{...Gn,...i})}))}),Hn.Ay),er=(0,W.Iz)((e=>(0,G.eU)((t=>t(Un(e)).map((n=>t(qn({roomId:e,id:n})))))))),tr=(e,t)=>(0,K.md)(Qn({roomId:e,id:t})),nr=e=>[...Kn.E9.map((e=>e.id)),...e.map((e=>e.id))],rr=(e,t)=>{const n=(e=>(0,K.md)(er(e)))(e),o=(e=>(0,K.md)(Jn(e)))(e),s=(e=>(0,K.md)(Xn(e)))(e);return(0,r.useMemo)((()=>{const e=o.length?o:nr(n),r={...Kn.E9.reduce(((e,t)=>(e[t.id]={...t,isDefault:!0},e)),{}),...n.reduce(((e,t)=>(e[t.id]={...t,isDefault:!1},e)),{})};return e.filter((e=>r[e])).map((e=>{const n=r[e],o=n.isDefault?s.includes(e):n.hidden,i=n.isDefault?n.isVisible(t)&&!o:!o;return{...n,isHidden:o,isVisible:i}}))}),[n,o,s,t])},or=(e,t)=>!(!e||"string"!==typeof e)&&!t.includes(e),sr=e=>{const t=(0,_t.yK)(),n=(0,_t.xS)(),o=(0,b.vt)();return(0,p.yF)((0,r.useCallback)((async(r,s,i)=>{let{groups:a,tabOrder:l,hiddenTabs:c}=i;const d=r((0,Ve.h)({spaceId:o,roomId:e,params:Yn}))[0]||null,u={...Yn,scope:"room",name:"default",value:{groups:a,tabOrder:l,hiddenTabs:c}};d?await n({id:d.id,...u}):await t(u),s(Un(e),a.map((e=>e.id))),a.forEach((t=>{s(qn({roomId:e,id:t.id}),t)})),s(Jn(e),l),s(Xn(e),c)}),[e,t,n,o]))},ir=e=>{const t=sr(e);return(0,p.yF)((0,r.useCallback)((async(n,r,o)=>{const s=n(er(e)),i=n(Jn(e)),a=n(Xn(e)),l=(e=>{let t;do{t=(0,_n.A)()}while(!or(t,[...Kn.se,...e]));return t})(s.map((e=>e.id))),c={...Gn,...o,id:l},d=[...s,c],u=i.length?[...i,l]:[...nr(s),l];return await t({groups:d,tabOrder:u,hiddenTabs:a}),c}),[e,t]))},ar=e=>{let{tab:t,onToggle:n,onEdit:r,onDelete:o}=e;const{attributes:s,listeners:i,setNodeRef:a,transform:l,transition:c}=(0,_e.gl)({id:t.id}),d={transform:He.Ks.Transform.toString(l),transition:c},u=t.isDefault,h=t.label||t.name;return(0,ie.jsx)("div",{ref:a,style:d,...s,children:(0,ie.jsxs)(re.Flex,{"data-testid":`groupsMenu-tab-${t.id}`,justifyContent:"between",alignItems:"center",padding:[1,0],children:[(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(re.Icon,{name:"nav_dots",color:"textLite",cursor:"grab",size:"small",...i}),(0,ie.jsx)(re.Checkbox,{checked:!t.isHidden,"data-testid":`groupsMenu-tabCheckbox-${t.id}`,label:h,onChange:n})]}),!u&&(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(re.IconButton,{"data-testid":`groupsMenu-editTab-${t.id}`,flavour:"borderless",icon:"pencilSolid",padding:[0],onClick:r,width:"10px",height:"10px"}),(0,ie.jsx)(re.IconButton,{"data-testid":`groupsMenu-deleteTab-${t.id}`,flavour:"borderless",icon:"trashcan",padding:[0],onClick:o,width:"10px",height:"10px"})]})]})})},lr=e=>{let{isOpen:t,onClose:n,onEdit:o,onCreate:s,allNodes:i,targetRef:a}=e;const l=(0,v.ID)(),c=rr(l,i),d=(e=>{const t=sr(e);return(0,p.yF)((0,r.useCallback)((async(n,r,o)=>{const s=n(er(e)),i=n(Xn(e)),a=[...new Set(o)];await t({groups:s,tabOrder:a,hiddenTabs:i})}),[e,t]))})(l),u=(e=>{const t=sr(e);return(0,p.yF)((0,r.useCallback)((async(n,r,o)=>{const s=n(er(e)),i=n(Jn(e)),a=n(Xn(e));if(Kn.se.includes(o)){const e=a.includes(o)?a.filter((e=>e!==o)):[...a,o];await t({groups:s,tabOrder:i,hiddenTabs:e})}else{const e=s.map((e=>e.id===o?{...e,hidden:!e.hidden}:e));await t({groups:e,tabOrder:i,hiddenTabs:a})}}),[e,t]))})(l),h=(e=>{const t=sr(e);return(0,p.yF)((0,r.useCallback)((async(n,r,o)=>{const s=n(er(e)),i=n(Jn(e)),a=n(Xn(e)),l=s.filter((e=>e.id!==o)),c=i.filter((e=>e!==o));await t({groups:l,tabOrder:c,hiddenTabs:a})}),[e,t]))})(l),[x,g]=(0,r.useState)((()=>c.map((e=>e.id))));(0,r.useEffect)((()=>{g(c.map((e=>e.id)))}),[c]);const m=(0,ze.FR)((0,ze.MS)(ze.AN),(0,ze.MS)(ze.uN,{coordinateGetter:_e.JR})),f=(0,r.useCallback)((e=>{const{active:t,over:n}=e;if(t?.id&&n?.id&&t.id!==n.id){const e=x.indexOf(t.id),r=x.indexOf(n.id),o=(0,_e.be)(x,e,r);g(o),d(o)}}),[x,d]),j=(0,r.useCallback)((e=>{u(e)}),[u]),b=(0,r.useCallback)((e=>{o(e),n()}),[o,n]),y=(0,r.useCallback)((e=>{h(e)}),[h]),C=(0,r.useCallback)((()=>{s(),n()}),[s,n]),w=(0,r.useMemo)((()=>c.reduce(((e,t)=>({...e,[t.id]:t})),{})),[c]);return a.current&&t?(0,ie.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":"groupsMenu",onClickOutside:n,onEsc:n,target:a.current,gap:1,children:[(0,ie.jsx)(ze.Mp,{sensors:m,collisionDetection:ze.fp,onDragEnd:f,children:(0,ie.jsx)(_e.gB,{items:x,strategy:_e._G,children:(0,ie.jsx)(re.Flex,{column:!0,children:x.map((e=>{const t=w[e];return t?(0,ie.jsx)(ar,{tab:t,onToggle:()=>j(t.id),onEdit:()=>b(t.id),onDelete:()=>y(t.id)},t.id):null}))})})}),(0,ie.jsx)(re.Button,{"data-testid":"groupsMenu-createGroup",label:"Create group",icon:"plus",onClick:C,small:!0,alignSelf:"end"})]}):null};n(23215);const cr=e=>e&&Object.keys(e).length>0,dr=(e,t)=>{if(!cr(t))return!1;const n=Object.entries(t),r=(0,z.Pt)(n);return n.every((t=>{let[n,o]=t;return!o?.length||(n.startsWith("label.")?(0,z.Pd)(e,o):!z.P6[n]||z.P6[n](e,o,{byLabel:r}))}))},ur=e=>{let{title:t,disclaimer:n,children:r,...o}=e;return(0,ie.jsxs)(re.Flex,{gap:1,column:!0,...o,children:[(0,ie.jsx)(re.Text,{as:"label",margin:[0],children:t}),r,n&&(0,ie.jsx)(re.TextSmall,{color:"textLite",children:n})]})};var hr=n(26848);const xr={nodeStatuses:{name:"Node status",category:"Core"},nodeVersions:{name:"Node version",category:"Core"},nodeCapabilities:{name:"Capabilities",category:"Core"},"os.nm":{name:"Operating System",category:"System"},"hw.cpuFrequency":{name:"CPU Frequency",category:"Hardware"},"hw.cpus":{name:"CPU Cores",category:"Hardware"},"hw.memory":{name:"Memory",category:"Hardware"},"hw.diskSpace":{name:"Disk Space",category:"Hardware"}},gr=(0,r.memo)((e=>{let{filters:t,onFiltersChange:n,nodes:o}=e;const[s,i]=(0,r.useState)(""),a=(0,r.useMemo)((()=>{const e=Object.entries(xr).map((e=>{let[t,n]=e;return{id:t,name:n.name,category:n.category}})),t=new Set;o.forEach((e=>{e.labels&&Object.keys(e.labels).forEach((e=>t.add(e)))}));return[...e,...Array.from(t).map((e=>({id:`label.${e}`,name:e,category:"Labels"})))]}),[o]),l=(0,r.useMemo)((()=>Object.keys(t||{})),[t]),c=(0,r.useMemo)((()=>{const e={searchAction:null,topFilters:[],groupedValues:{}},n=s.toLowerCase().trim(),r=a.filter((e=>!l.includes(e.id))).map((e=>{let t=1;if(n){const r=e.name.toLowerCase().includes(n),o=e.id.toLowerCase().includes(n);r&&(t+=10),o&&(t+=5),e.name.toLowerCase().startsWith(n)&&(t+=15),r||o||(t=0)}return{...e,score:t}})).filter((e=>e.score>0)).sort(((e,t)=>t.score-e.score));return e.topFilters=n?r.slice(0,5):r.slice(0,10),a.forEach((r=>{const s=[];if("nodeStatuses"===r.id){const e={live:"Live",stale:"Stale",offline:"Offline"},i=o.reduce(((e,t)=>{const n=t.isLive?"live":"stale"===t.state?"stale":"offline";return e[n]=(e[n]||0)+1,e}),{});Object.entries(i).forEach((o=>{let[i,a]=o;const l=e[i]||i;n&&!l.toLowerCase().includes(n)||s.push({value:i,label:l,count:a,isSelected:t?.[r.id]?.includes(i)})}))}else if("nodeVersions"===r.id){const e=o.reduce(((e,t)=>(t.version&&(e[t.version]=(e[t.version]||0)+1),e)),{});Object.entries(e).forEach((e=>{let[o,i]=e;n&&!o.toLowerCase().includes(n)||s.push({value:o,label:o,count:i,isSelected:t?.[r.id]?.includes(o)})}))}else if("nodeCapabilities"===r.id){const e={};o.forEach((t=>{t.capabilities&&Object.keys(t.capabilities).forEach((t=>{e[t]=(e[t]||0)+1}))})),Object.entries(e).forEach((e=>{let[o,i]=e;n&&!o.toLowerCase().includes(n)||s.push({value:o,label:o,count:i,isSelected:t?.[r.id]?.includes(o)})}))}else if("os.nm"===r.id){const e=o.reduce(((e,t)=>(t.os?.nm&&(e[t.os.nm]=(e[t.os.nm]||0)+1),e)),{});Object.entries(e).forEach((e=>{let[o,i]=e;n&&!o.toLowerCase().includes(n)||s.push({value:o,label:o,count:i,isSelected:t?.[r.id]?.includes(o)})}))}else if(r.id.startsWith("label.")){const e=r.id.replace("label.",""),i=o.reduce(((t,n)=>{if(n.labels?.[e]){const r=n.labels[e];t[r]=(t[r]||0)+1}return t}),{});Object.entries(i).forEach((o=>{let[i,a]=o;const l=`${e}|${i}`;n&&!i.toLowerCase().includes(n)||s.push({value:l,label:i,count:a,isSelected:t?.[r.id]?.includes(l)})}))}s.length>0&&(s.sort(((e,t)=>t.count-e.count)),e.groupedValues[r.id]={filterName:r.name,values:s.slice(0,n?10:5)})})),e}),[s,o,t,a,l]),d=(0,r.useCallback)((e=>{n((t=>({...t,[e]:[]})))}),[n]),u=(0,r.useCallback)(((e,t)=>{n((n=>{const r=n[e]||[],o=r.includes(t)?r.filter((e=>e!==t)):[...r,t];if(0===o.length){const{[e]:t,...r}=n;return r}return{...n,[e]:o}}))}),[n]),h=(0,r.useCallback)((()=>{}),[]);return(0,ie.jsx)(hr.A,{searchValue:s,setSearchValue:i,setSearchQuery:h,searchResults:c,onAddFilter:d,onAddFilterWithValue:u,placeholder:"Search filters..."})})),mr=gr,pr=e=>{let{isNew:t}=e;return(0,ie.jsxs)(re.Flex,{as:"span",gap:1,children:["Manage room",(0,ie.jsx)(re.TextBig,{color:"textLite",children:"/"}),(0,ie.jsxs)(re.TextBig,{color:"textLite",children:[t?"Create":"Edit"," Group"]})]})},fr=[{value:"servers",label:"Servers"},{value:"snmp",label:"Network Devices"}],jr=(e,t)=>{if(e.startsWith("label.")){return`${e.replace("label.","")}: ${t.map((e=>e.split("|")[1])).join(", ")}`}const n={nodeStatuses:"Status",nodeVersions:"Version",nodeCapabilities:"Capabilities","os.nm":"OS","hw.cpuFrequency":"CPU Freq","hw.cpus":"CPU Cores","hw.memory":"Memory","hw.diskSpace":"Disk"}[e]||e;return Array.isArray(t)&&2===t.length&&e.startsWith("hw.")?`${n}: ${t[0]} - ${t[1]}`:`${n}: ${t.join(", ")}`},br=e=>{let{filterId:t,values:n,onRemove:r}=e;return(0,ie.jsx)(re.Pill,{flavour:"neutral",hollow:!0,children:(0,ie.jsxs)(re.Flex,{gap:1,alignItems:"center",children:[(0,ie.jsx)(re.Text,{children:jr(t,n)}),(0,ie.jsx)(re.Flex,{as:"button",onClick:()=>r(t),cursor:"pointer",background:"transparent",border:"none",padding:[0],children:(0,ie.jsx)(re.Icon,{name:"x",width:"12px",height:"12px",color:"textLite"})})]})})},vr=e=>{let{id:t,onClose:n,allNodes:o,initialFilters:s,...i}=e;const a=(0,v.ID)(),l="new"===t,c=tr(a,l?null:t),d=ir(a),u=(e=>{const t=sr(e);return(0,p.yF)((0,r.useCallback)((async(n,r,o)=>{const s=n(er(e)),i=n(Jn(e)),a=n(Xn(e)),l=s.map((e=>e.id===o.id?{...e,...o}:e));await t({groups:l,tabOrder:i,hiddenTabs:a})}),[e,t]))})(a),[h,x]=(0,r.useState)((()=>l?{...Gn,filters:s||{}}:{...Gn,...c}));(0,r.useEffect)((()=>{!l&&c?.id&&x({...Gn,...c})}),[l,c]);const{name:g,metricsType:m,filters:f}=h,j=(0,r.useMemo)((()=>cr(f)?o.filter((e=>dr(e,f))).length:0),[o,f]),b=(0,r.useCallback)((e=>{let{target:{value:t}}=e;t.length<=30&&x((e=>({...e,name:t})))}),[]),y=(0,r.useCallback)((e=>{x((t=>({...t,metricsType:e?.value||"servers"})))}),[]),C=(0,r.useCallback)((e=>{x((t=>{const n={...t.filters};return delete n[e],{...t,filters:n}}))}),[]),w=(0,r.useCallback)((e=>{x((t=>({...t,filters:"function"===typeof e?e(t.filters):e})))}),[]),I=(0,r.useCallback)((async()=>{const e={...h,name:h.name.trim()};l?await d(e):await u({...e,id:t}),n()}),[h,l,t,d,u,n]),A=g.trim().length>0&&cr(f),k=(0,r.useMemo)((()=>fr.find((e=>e.value===m))||fr[0]),[m]),S=(0,r.useMemo)((()=>Object.entries(f||{})),[f]);return(0,ie.jsxs)(ve.GO,{onClose:n,...i,children:[(0,ie.jsx)(ye.z,{onClose:n,title:(0,ie.jsx)(pr,{isNew:l}),children:(0,ie.jsx)(re.Button,{label:"Save",onClick:I,disabled:!A,"data-testid":"groupForm-save"})}),(0,ie.jsx)(Ce.U,{children:l?"Create a new node group":"Edit node group"}),(0,ie.jsx)(ve.Yv,{children:(0,ie.jsxs)(re.Flex,{gap:6,column:!0,children:[(0,ie.jsx)(ur,{title:"Group Name","data-testid":"groupForm-name",children:(0,ie.jsx)(re.TextInput,{name:"name",placeholder:"Enter group name",value:g,onChange:b})}),(0,ie.jsx)(ur,{title:"Column Configuration",disclaimer:"Choose which column set to display for nodes in this group","data-testid":"groupForm-metricsType",children:(0,ie.jsx)(re.Select,{options:fr,value:k,onChange:y,"data-testid":"groupForm-metricsTypeSelect"})}),(0,ie.jsx)(ur,{title:"Filters",disclaimer:"Nodes matching these filters will appear in this group","data-testid":"groupForm-filters",children:(0,ie.jsxs)(re.Flex,{gap:2,column:!0,children:[S.length>0&&(0,ie.jsx)(re.Flex,{gap:2,wrap:!0,children:S.map((e=>{let[t,n]=e;return(0,ie.jsx)(br,{filterId:t,values:n,onRemove:C},t)}))}),(0,ie.jsx)(mr,{filters:f,onFiltersChange:w,nodes:o})]})}),(0,ie.jsx)(re.Flex,{padding:[3],background:j>0?"successBackground":"warningBackground",round:1,justifyContent:"center",children:(0,ie.jsx)(re.Text,{children:cr(f)?0===j?"No nodes match the current filters":`${j} node${1===j?"":"s"} match${1===j?"es":""} the current filters`:"Add at least one filter to create a group"})})]})})]})};var yr=n(24798);const Cr=e=>{const t=(0,v.ID)(),n=`nodesView-${e}`,o=(0,H.l6)("addedFilters",{extraKey:n,flavour:"arr",defaultValue:[]});return(0,p.yF)((0,r.useCallback)((e=>{const r={},s=[...yr.RT,...o];return[...new Set(s)].forEach((o=>{const s=e((0,H.GA)({key:t,extraKey:n,param:o,flavour:"arr"}));s?.length&&(r[o]=s)})),r}),[t,n,o]))},wr=e=>{let{allNodes:t,tabId:n}=e;const[o,,s,i]=(0,pe.A)(),[a,l]=(0,r.useState)(null),[c,d]=(0,r.useState)(null),u=(0,r.useRef)(),h=Cr(n);return(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(be.A,{permission:"space:UpdateSettings",ifForbidden:"hide","data-ga":"group-setting::click-group-setting::hm-nodes","data-testid":"groupSettings-button",flavour:"hollow",icon:"navVertical_s",neutral:!0,onClick:s,ref:u,label:"Groups",small:!0}),(0,ie.jsx)(lr,{isOpen:o,onClose:i,onEdit:e=>{d(null),l(e)},onCreate:()=>{const e=h();d(e),l("new")},allNodes:t,targetRef:u}),a&&(0,ie.jsx)(vr,{id:a,onClose:()=>{l(null),d(null)},allNodes:t,initialFilters:c,"data-testid":"groupForm"})]})},Ir=(0,Ue.A)(fe.A),Ar=e=>{let{children:t,tabId:n,allNodes:r,...o}=e;const[s,,i,a]=(0,pe.A)(),l=(0,b.vt)(),c=(0,v.ID)();return(0,ie.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"},...o,children:[t,(0,ie.jsxs)(re.Flex,{alignItems:"center",padding:[2,3],gap:2,children:[s&&(0,ie.jsx)(je.A,{onClose:a}),tt.xH&&(0,ie.jsx)(wr,{allNodes:r,tabId:n}),(0,ie.jsx)(We,{spaceId:l,roomId:c,tabId:n}),(0,ie.jsx)(Ir,{"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"})]})]})},kr=e=>{let{allNodes:t,activeTabId:n,onTabChange:o,children:s}=e;const i=((e,t)=>{const n=rr(e,t);return(0,r.useMemo)((()=>n.filter((e=>e.isVisible))),[n])})((0,v.ID)(),t),a=(0,r.useMemo)((()=>{const e=i.findIndex((e=>e.id===n));return e>=0?e:0}),[n,i]),l=(0,r.useCallback)((e=>{const t=i[e];t&&o&&o(t.id)}),[i,o]),c=(0,r.useMemo)((()=>({tabId:n,allNodes:t})),[n,t]);return(0,ie.jsx)(re.Tabs,{selected:a,onChange:l,height:"100%",padding:[4,4,2],TabsHeader:Ar,tabHeaderProps:c,gap:4,children:i.map(((e,t)=>(0,ie.jsx)(re.Tab,{label:(0,ie.jsx)(re.Text,{color:t===a?"primary":"menuItem",children:e.label||e.name}),"data-testid":`nodes-tab-${e.id}`,padding:[2,4],maxWidth:"100%",green:!0,children:s},e.id)))})},Sr=e=>{let{tabId:t,filteredIds:n,totalCount:r}=e;const o=(0,Kn.K3)(t),s=o?.label||"Nodes",i=(0,E.BU)(n).length,a=(0,E.Ig)(n).length,l=(0,E.GE)(n).length;return(0,ie.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,ie.jsxs)(re.Text,{strong:!0,children:["Total ",s,": ",r]}),(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:4,children:[(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:2,children:[(0,ie.jsx)(re.Flex,{width:2,height:2,round:"50%",background:Cn.P.live.indicatorWrapperColor}),(0,ie.jsxs)(re.Text,{children:["Live: ",i]})]}),(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:2,children:[(0,ie.jsx)(re.Flex,{width:2,height:2,round:"50%",background:Cn.P.stale.indicatorWrapperColor}),(0,ie.jsxs)(re.Text,{children:["Stale: ",a]})]}),(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:2,children:[(0,ie.jsx)(re.Flex,{width:2,height:2,round:"50%",background:Cn.P.offline.indicatorWrapperColor}),(0,ie.jsxs)(re.Text,{children:["Offline: ",l]})]})]})]})},Tr=(e,t)=>{const n=(0,Kn.b5)(e),o=tr(t,n?null:e);return(0,r.useMemo)((()=>{if(n){const t=(0,Kn.K3)(e),n=t?.showFn||(()=>!0);return e=>!n(e)}if(cr(o?.filters)){const e=(e=>t=>dr(t,e.filters))(o);return t=>!e(t)}return()=>!1}),[e,n,o])},Fr=["config"],Mr=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),n=(0,D.nj)(),o=(0,E.dG)(),s=(e=>{const t=(0,v.ID)(),n=(0,V.Cq)(t,e),o=lt[n];return(0,r.useCallback)((e=>{const t=o?.(e);return{name:t,priority:at[n]?.[t],icon:"nodeStatus"===n?`connectivityStatus${t}`:null}}),[n,o])})(o),i=(0,V.Cq)(t,o),a=(0,E.TL)(),l=(0,z.w7)({extraKey:`nodesView-${o}`,merge:!1,scoped:!0}),c=(0,E.Gt)(),d=Tr(o,t),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(l,t,{shouldHide:tt.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:s="servers",flavour:i="nodesView"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(0,zt.eg)(),l=(0,r.useMemo)((()=>{if(!a)return;let r=Kt(a,e);if(r)return r;o&&(r=a.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}}),a.appendChild(r))}),[e,s,o]),{favoriteNodeIds:c}=Ht(i,s),d=(0,Ie.vh)(e,s);(0,r.useMemo)((()=>{if(!tt.f9)return;if(!l||!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 s=l.getNode({id:o});if(s&&(i=new Set(s.getAttribute("contextScope")),c=r,i.size===c.size&&[...i].every((e=>c.has(e)))))return;var i,c;s?.destroy();const d=Array.from(r);0!==d.length&&(s=a.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}}),l.appendChild(s))}))})),a.trigger("nodesContainerUpdated")}),[l,t,c,n,a,s,o,d])}(t,f,{host:p,width:m,tabId:o,flavour:"nodesView"});const[C,w]=(0,H.N9)("nodeIdToGo",{key:t,extraKey:"nodesView",flavour:"val"}),I=(0,r.useCallback)((e=>{a(e)}),[a]),A=(0,r.useCallback)((function(e,t){return function(e,t){let{getGrouping:n,extraKey:r,searchScores:o,groupMode:s}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={},a={};((e,t)=>{let{getNode:n,getGrouping:r,nodeMenus:o,menusById:s,searchScores:i}=t;e.forEach((e=>{const t=n(e);if(!t)return;const{name:s,priority:i,icon:a}=r(t);o[e]={...t,groupId:s,subMenuId:e,priority:i,groupIcon:a}})),[...e].sort(((e,t)=>{const n=i?.[e]||0,r=i?.[t]||0;if(r!==n)return r-n;const s=(o[e]?.priority||0)-(o[t]?.priority||0);if(0!==s)return s;const a=(o[e]?.groupId||"").localeCompare(o[t]?.groupId||"",void 0,{sensitivity:"accent",ignorePunctuation:!0});return 0!==a?a:(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}`;s[t.groupId]||(s[t.groupId]={byId:{},nodeIds:[]}),s[t.groupId].byId[n]||(s[t.groupId].byId[n]={byId:{},nodeIds:[]}),s[t.groupId].byId[n].nodeIds.push(t.id),s[t.groupId].nodeIds.push(t.id)}))})(e,{getNode:t,getGrouping:n,nodeMenus:i,menusById:a,searchScores:o});const l=Object.keys(a).reduce(((e,t)=>{const{nodeIds:n}=a[t],o=i[n[0]];return e[t]={level:0,name:o.groupId,id:t,childrenIds:n,link:`${(0,Qe.A)(`menu_${t}`)}`,size:24,forceVisibility:!0,icon:o.groupIcon,extraKey:r,styleProps:{important:!1,grouping:!0}},n.forEach((n=>{const o=i[n],s=et.u[o.os?.nm||o.labels?.os_name]||et.U[o.os?.id]||et.u[o.labels?.vendor];e[n]={...o,level:1,id:n,menuId:t,link:`${(0,Qe.A)(`menu_${t}_submenu_${n}`)}`,size:24,forceVisibility:!0,icon:s?.iconName||s?.logoFilename&&`${x.A.assetsBaseURL}/img/logos/os/${s.logoFilename}`||"os",extraKey:r}})),e}),{}),c=Object.keys(a);let d=-1;const u=c.reduce(((e,t)=>{if(d+=1,!tt.f9){const n={...l[t],sticky:!0};return[...e,n,...l[t].childrenIds.reduce(((e,t)=>(d+=1,[...e,l[t]])),[])]}return s?[...e,{...l[t],isGroup:!0,children:l[t].childrenIds.reduce(((e,t)=>(d+=1,[...e,l[t]])),[])}]:[...e,...l[t].childrenIds.reduce(((e,t)=>(d+=1,[...e,l[t]])),[])]}),[]);return i=null,a=null,{stickyIds:{},allElements:u,menuIds:c,menuById:l}}(e,t,{...arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},searchScores:j})}),[j]);return(0,ie.jsx)(te.A,{getObject:h,ids:f,getMenu:A,getGrouping:s,groupMode:i,deps:[s,j,o,i],extraKey:"nodesView",children:(0,ie.jsx)(O.A,{ref:g,position:"relative",sidebar:(0,ie.jsx)(ne.Ay,{hiddenTabs:Fr,nodeIds:u,title:"Nodes",initialChartName:C,viewFlavour:"nodesView",flavour:`nodesView-${o}`,loaded:!0,FilterInputContainer:he,extraKey:`nodesView-${o}`}),children:!!m&&(0,ie.jsxs)(ie.Fragment,{children:[!tt.f9&&(0,ie.jsx)(Ze,{}),!tt.f9&&n&&!f.length&&l.length?(0,ie.jsx)(me,{}):tt.f9?(0,ie.jsxs)(kr,{allNodes:c,activeTabId:o,onTabChange:I,nodesCount:y,children:[(0,ie.jsx)(Sr,{tabId:o,filteredIds:f,totalCount:y}),(0,ie.jsx)(zn,{nodeIdsLoaded:n,nodeIds:f,tabNodeIds:u,initialChartName:C,onChartNameChange:w,tabId:o,flavour:"nodesView"})]}):(0,ie.jsx)(an,{initialChartName:C,onChartNameChange:w})]})})})},Nr=()=>{const e=(0,v.ID)(),t=(0,D.CK)();return(0,D.gr)(e,"loaded")&&!t.length?(0,ie.jsx)(P.Ay,{feature:"NodesView",mode:"NoNodesView",children:(0,ie.jsx)(B.A,{})}):(0,ie.jsx)(P.Ay,{feature:"NodesView",children:(0,ie.jsx)(Mr,{})})},Lr=()=>{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 $r=n(258);var Dr=n(98545),Br=n(6196),Pr=n(1705),Rr=n(2626),Or=n(41716),Vr=n(65448);const Er=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,Or.t)({id:t,key:"ids"}),r.map((e=>e.id))),n((0,Or.t)({id:t,key:"loaded"}),!0),n((0,Or.t)({id:t,key:"updatedAt"}),(new Date).toISOString()),n((0,Or.t)({id:t,key:"error"}),null),n(Br.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(Rr.l3,o)}),[e,t])),s=(0,p.yF)((0,r.useCallback)(((e,n,r)=>{n((0,Or.t)({id:t,key:"error"}),(0,Vr.A)(r))}),[]));(0,j.A)((()=>({enabled:!!e&&!!t,polling:n,pollingOptions:{checkPauseCondition:N},fetch:()=>(0,Pr.l1)(e,t),onFail:s,onReceive:o,force:!0})),[e,t])},zr=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,Br.xz)({spaceId:e,roomId:t}),(e=>({...e,loaded:!0,value:o,updatedAt:(new Date).toISOString(),error:null})))}),[e,t])),s=(0,p.yF)((0,r.useCallback)(((n,r,o)=>{r((0,Br.xz)({spaceId:e,roomId:t}),(e=>({...e,loaded:!0,error:(0,Vr.A)(o)})))}),[]));(0,j.A)((()=>({enabled:!!e&&!!t,polling:n,pollingOptions:{checkPauseCondition:N},fetch:()=>(0,Pr.qM)(e,t),onFail:s,onReceive:o,force:!0})),[e,t])};var _r=n(6387),Hr=n(65380);const Kr=e=>t=>`histogram::${e.getAttribute("id")}::${t}`,Gr=e=>{let{container:t,...n}=e;const o=(0,zt.eg)(),s=(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:Kr}),t.appendChild(e),e)}),[t]);return(0,r.useEffect)((()=>()=>s&&s.destroy()),[s]),(0,ie.jsx)(re.Flex,{flex:!1,width:"100%",height:5,position:"sticky",bottom:"0",left:"0",right:"0",children:(0,ie.jsx)(Ut.A,{"data-chartid":"dummy-chart",chart:s,overflow:"hidden",hasHeader:!1,hasFooter:!1,hasFilters:!1,tile:!1,...n,round:0})})};var Wr=n(55093),Ur=n(77148),qr=n(38773);const Jr=()=>(0,ie.jsxs)(re.Flex,{padding:[6],round:1,width:"600px",background:"modalInfoBackground",children:[(0,ie.jsx)(re.Box,{margin:[0,4,0,0],children:(0,ie.jsx)(re.Box,{as:re.Icon,width:10,height:10,name:"nodes_update"})}),(0,ie.jsxs)(re.Flex,{column:!0,gap:2,children:[(0,ie.jsx)(re.Text,{strong:!0,children:"Couldn't find the chart you were looking for? "}),(0,ie.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,ie.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,ie.jsxs)(re.Flex,{width:"100%",column:!0,gap:6,margin:[8,0,0,0],children:[(0,ie.jsx)(Ur.A,{}),(0,ie.jsxs)(re.Flex,{gap:1,alignItems:"center",justifyContent:"center",padding:[2],background:"successSemi",children:[(0,ie.jsx)(Tn.A,{children:(0,ie.jsx)(re.Text,{color:"primary",children:"Upgrade to Business for unlimited access"})}),(0,ie.jsx)(re.Text,{children:"or"}),(0,ie.jsx)(qr.A,{children:(0,ie.jsx)(re.Text,{color:"primary",children:"review your Space active Nodes"})})]})]}),Yr=e=>{let{noPreferredNodesError:t,children:n}=e;return(0,ie.jsxs)(re.Flex,{column:!0,flex:!0,justifyContent:"center",alignItems:"center",alignSelf:"center",children:[(0,ie.jsxs)(re.Flex,{column:!0,justifyContent:"center",alignItems:"center",width:"300px",margin:[0,0,6],children:[(0,ie.jsx)(re.H3,{margin:[0,0,4],children:"No charts to display"}),(0,ie.jsx)(re.Text,{color:"textDescription",textAlign:"center",children:"Double-check your search or filters and dates and try again with different conditions."})]}),(0,ie.jsx)(Jr,{}),t&&(0,ie.jsx)(Xr,{}),n]})};var Zr=n(93997);const Qr=()=>{const[e,t]=(0,Zr.sK)(),n=(0,v.ID)(),o=(0,b.vt)(),s=(0,z.w7)(),i=(0,r.useCallback)((0,le.s)(300,(e=>{const r=e.target.value;t(r),(0,oe.H)("toc-search","search-automatic-trigger","charts-view",r),r&&(0,$r.Xx)(n,r,{selectedNodes:s,spaceId:o}).then((e=>{console.log("Context search results:",e)})).catch((e=>{console.error("Context search error:",e)}))})),[n,o,s]),[a,l,,,{resetValue:c}]=(0,re.useInputValue)({value:e,onChange:i}),d=(0,r.useCallback)((()=>{t(""),c(),(0,oe.H)("toc-search","clear-search-button","charts-view")}),[]);return(0,ie.jsx)(re.TextInput,{value:a,onChange:l,size:"small",iconRight:a&&(0,ie.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 eo=n(61841);const to=(0,le.s)(300,((e,t)=>(0,oe.H)("toc-search","search-results","charts-view",e,`${t} -- charts`))),no=()=>{const e=(0,f.Zp)(),[t]=(0,eo.Ay)(),n=(0,Zr.Um)(),{filteredChartsCount:o,chartsCount:s}=(0,Zr.Ad)();(0,r.useEffect)((()=>{n&&to(n,o)}),[n,o]);const i=(0,r.useCallback)((n=>{n.preventDefault(),e(`/spaces/${t}/settings/configurations`,{replace:!0})}),[t,e]);return(0,ie.jsxs)(re.Flex,{alignItems:"center",justifyContent:"between",width:"100%",children:[(0,ie.jsxs)(re.TextMicro,{color:"textLite",margin:[1,0,0],"data-testid":"numberOfChartsIndication",children:["Showing"," ",(0,ie.jsx)(re.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfChartsIndication-filteredChartsCount",children:o})," ","of total"," ",(0,ie.jsx)(re.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfChartsIndication-chartsCount",children:s})," ","charts"]}),(0,ie.jsx)(xe.A,{Component:re.TextMicro,margin:[1,0,0],"data-ga":`toc-search::click-link-collectors::${name}`,onClick:i,target:"_blank",rel:"noopener noreferrer",children:"Add more charts"})]})},ro=()=>{const{filteredChartsCount:e}=(0,Zr.Ad)();return e||null===e?null:(0,ie.jsxs)(re.Flex,{width:"100%",gap:1,margin:[4,0,0],padding:[2],alignItems:"center","data-testid":"noResultsWereFound",children:[(0,ie.jsx)(re.Icon,{name:"information",color:"textDescription"}),(0,ie.jsx)(re.TextMicro,{strong:!0,color:"textDescription",children:"No results were found"})]})};var oo=n(14512);const so=()=>(0,ie.jsxs)(re.Flex,{column:!0,alignItems:"center",children:[(0,ie.jsx)(Qr,{}),(0,ie.jsx)(no,{}),(0,ie.jsx)(oo.A,{}),(0,ie.jsx)(ro,{})]}),io=e=>{let{width:t=443,height:n=249,videoId:r,...o}=e;return(0,ie.jsx)(re.Flex,{...o,children:(0,ie.jsx)(re.Box,{className:"video-responsive",children:(0,ie.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 ao=n(58218),lo=n(14815);const co=()=>{const e=(0,v.ID)(),t=(0,g.JT)("node:Create");return(0,ie.jsxs)(O.A,{column:!1,"data-testid":"noNodesViewPage",gap:12,padding:[6],children:[(0,ie.jsxs)(re.Flex,{column:!0,gap:5,flex:{shrink:0,grow:0},"data-testid":"noKubernetesView-videoSection",children:[(0,ie.jsx)(io,{"data-testid":"noNodesView-onboardingVideo",height:350,width:850,videoId:Le.BX[0]}),(0,ie.jsx)(io,{"data-testid":"noNodesView-onboardingVideo",height:350,width:850,videoId:Le.BX[1]})]}),(0,ie.jsxs)(re.Flex,{column:!0,gap:4,children:[(0,ie.jsxs)(re.Box,{border:{side:"bottom",color:"borderSecondary"},children:[(0,ie.jsx)(re.Box,{margin:[0,0,2,0],children:(0,ie.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,ie.jsx)(re.TextBig,{color:"primary",children:"Kubernetes monitoring with Netdata: Overview and visualizations"})})}),(0,ie.jsx)(re.Box,{margin:[0,0,2,0],children:(0,ie.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,ie.jsx)(re.TextBig,{color:"primary",children:"Kubernetes visualizations"})})})]}),(0,ie.jsx)(re.Flex,{column:!0,gap:4,children:t?(0,ie.jsx)(ao.A,{integrationId:lo.v2,rooms:[e]}):(0,ie.jsx)(B.S,{})})]})]})};var uo=n(67012),ho=n(77611);const xo=un.default.div.withConfig({displayName:"selections__Separator",componentId:"sc-1cc7y18-0"})(["width:1px;height:",";background:",";"],(0,re.getSizeBy)(2.5),(0,re.getColor)("borderSecondary")),go=[{label:"Volume",value:"volume"},{label:"KS2",value:"ks2"}],mo=[{label:"Average",value:"average"},{label:"Median",value:"median"},{label:"Min",value:"min"},{label:"Max",value:"max"},{label:"Stddev",value:"stddev"}],po=[{label:"Metrics",value:""},{label:"Anomaly Rate",value:"anomaly-bit"}],fo=()=>(0,ie.jsxs)(re.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:[(0,ie.jsx)(re.TextMicro,{children:"Choose the algorithm you want to be used to identify correlations across metrics:"}),(0,ie.jsxs)(re.TextMicro,{children:[(0,ie.jsx)(re.TextMicro,{strong:!0,children:"KS2:"})," A statistical test comparing the distribution of the highlighted window to the baseline."]}),(0,ie.jsxs)(re.TextMicro,{children:[(0,ie.jsx)(re.TextMicro,{strong:!0,children:"Volume:"})," Percentage change in averages between highlighted window and baseline."]})]}),jo=()=>(0,ie.jsx)(re.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:(0,ie.jsx)(re.TextMicro,{children:"What aggregation function do you want to apply when aggregating multiple datapoints for metric correlations."})}),bo=()=>(0,ie.jsx)(re.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:(0,ie.jsx)(re.TextMicro,{children:"Do you want to find correlations over the metric values or the anomaly rates of each metric."})}),vo=e=>{let{runGetWeights:t,nodeIds:n,flavour:o}=e;const{method:s,options:i,group:a}=(0,ho.G9)({nodeIds:n,flavour:o}),l=i?.includes(po[1].value)?po[1].value:"",c=(0,r.useCallback)((e=>n=>{let{value:r}=n;r="options"!==e?r:r?[r]:[];t({method:s,options:[i],group:a,[e]:r})}),[s,i,a]),d=(0,r.useMemo)((()=>({method:go.find((e=>e.value===s)),group:mo.find((e=>e.value===a)),option:po.find((e=>e.value===l))})),[s,a,l]);return a?(0,ie.jsxs)(re.Flex,{gap:2,children:[(0,ie.jsxs)(re.Flex,{gap:1,alignItems:"center",children:[(0,ie.jsx)(re.TextSmall,{color:"textLite",children:"Method:"}),(0,ie.jsx)(re.Select,{options:go,value:d.method,onChange:c("method")}),(0,ie.jsx)(Ee.A,{isBasic:!0,plain:!0,content:fo,align:"bottom",children:(0,ie.jsx)(re.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,ie.jsx)(xo,{}),(0,ie.jsxs)(re.Flex,{gap:1,alignItems:"center",children:[(0,ie.jsx)(re.TextSmall,{color:"textLite",children:"Aggregation:"}),(0,ie.jsx)(re.Select,{options:mo,value:d.group,onChange:c("group")}),(0,ie.jsx)(Ee.A,{isBasic:!0,plain:!0,content:jo,align:"bottom",children:(0,ie.jsx)(re.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,ie.jsx)(xo,{}),(0,ie.jsxs)(re.Flex,{gap:1,alignItems:"center",children:[(0,ie.jsx)(re.TextSmall,{color:"textLite",children:"Data:"}),(0,ie.jsx)(re.Select,{options:po,value:d.option,onChange:c("options")}),(0,ie.jsx)(Ee.A,{isBasic:!0,plain:!0,content:bo,align:"bottom",children:(0,ie.jsx)(re.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,ie.jsx)(xo,{})]}):null};var yo=n(64587);const Co=e=>{let{highlightAfter:t,highlightBefore:n,baseline:r}=e;const{localeDateString:o,localeTimeString:s}=(0,yo.$j)(),i=new Date(t),a=new Date(n),l=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,ie.jsxs)(re.Flex,{gap:4,alignItems:"center",children:[(0,ie.jsxs)(re.Flex,{gap:2,children:[(0,ie.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,ie.jsx)(re.TextSmall,{color:"textLite",children:"Selected area:"}),(0,ie.jsx)(re.TextSmall,{color:"textLite",children:"Reference baseline:"})]}),(0,ie.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,ie.jsxs)(re.TextSmall,{"data-testid":"metricCorrelation-selectedArea",children:[o(i,{long:!1}),","," ",s(i),"\xa0->\xa0",o(a,{long:!1}),","," ",s(a)]}),(0,ie.jsxs)(re.TextSmall,{"data-testid":"metricCorrelation-referenceBaseline",children:[o(l,{long:!1}),","," ",s(l),"\xa0->\xa0",o(c,{long:!1}),","," ",s(c)]})]}),(0,ie.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,ie.jsx)(re.TextSmall,{color:"textLite",children:"Duration:"}),(0,ie.jsx)(re.TextSmall,{color:"textLite",children:"Duration:"})]}),(0,ie.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,ie.jsxs)(re.TextSmall,{"data-testid":"metricCorrelation-selecteArea-duration",children:[d,"\xa0secs"]}),(0,ie.jsxs)(re.TextSmall,{"data-testid":"metricCorrelation-referenceBaseline-duration",children:[u,"\xa0secs"]})]})]}),(0,ie.jsx)(Ee.A,{content:"Clear selection",align:"bottom",isBasic:!0,children:(0,ie.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"})})]})},wo=(0,Ue.A)(re.Button),Io=(0,un.default)(re.Button).withConfig({displayName:"correlation__LogoButton",componentId:"sc-15d72m3-0"})(["&&{pointer-events:none;}"]),Ao=(0,un.default)(re.Button).withConfig({displayName:"correlation__CloseButton",componentId:"sc-15d72m3-1"})(["position:absolute !important;top:-3px;right:-3px;"]),ko=(0,Ue.A)(Ao),So=(0,un.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;}"]),To=e=>{let{flavour:t}=e;const n=(0,b.vt)(),o=(0,v.ID)(),s=(0,E.nl)(),i=(0,r.useMemo)((()=>s?[s]:[]),[s]),a=(0,z.w7)({extraKey:"nodesView",merge:!1,scoped:!0}),l="singleNode"===t?i:a,[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,ho.Yy)({nodeIds:l,flavour:t},n,o),{method:C,options:w,group:I}=(0,ho.G9)({nodeIds:l,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=w?.includes("anomaly-bit")?"anomaly-bit":"metrics";e=`default-result-${C}-${I}-${t}`}return(0,oe.H)("metrics-correlation",e,"charts-view",m.toString())}}),[p]),(0,uo.A)((()=>{A&&d(!0)}),[A]);const F=(0,H.rI)("correlation"),M=(0,H.rI)("threshold"),N=(0,H.rI)("highlight"),L=(0,r.useCallback)((()=>{F(!1),N({after:null,before:null}),M(ho.UG),y(),(0,oe.H)("metrics-correlation","click-close","charts-view",""+(p?"finish":"start"))}),[F,N,M,y,p]),$=(0,r.useCallback)((()=>{M(ho.UG),y(),(0,oe.H)("metrics-correlation","click-delete","charts-view",""+(p?"finish":"start"))}),[M,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:C,options:w,group:I,nodeIds:l,...e}).then((()=>M(ho.UG)))},B=!T||f;return(0,uo.A)((()=>{p&&c&&T&&D()}),[p,T,c]),(0,r.useEffect)((()=>()=>y()),[]),(0,ie.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,ie.jsx)(P._0,{feature:"MetricCorrelations",totalDimensionsCount:g,dimensionsCount:m,children:(0,ie.jsxs)(re.Flex,{"data-testid":"metricCorrelation-resultsContainer",column:!0,width:"100%",children:[(0,ie.jsxs)(re.Flex,{justifyContent:"between",alignItems:"center",gap:1,children:[(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(re.Icon,{name:"correlation",color:"primary",width:"16px",height:"16px"}),(0,ie.jsxs)(re.TextSmall,{children:["Analysed"," ",(0,ie.jsx)(re.TextSmall,{color:"primary","data-testid":"metricCorrelation-resultsAnalyzed",children:g})," ","and found"," ",(0,ie.jsx)(re.TextSmall,{color:"primary","data-testid":"metricCorrelation-resultsFound",children:m})," ","correlated metrics."]}),(0,ie.jsx)(Ee.A,{content:"Clear results",children:(0,ie.jsx)(So,{flavour:"borderless",neutral:!0,disabled:f||!p&&!T,onClick:$,"data-testid":"metricCorrelation-clear",small:!0,icon:"reload"})})]}),(0,ie.jsx)(vo,{runGetWeights:D,nodeIds:l,flavour:t})]}),(0,ie.jsxs)(re.Flex,{width:"100%",children:[(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:3,margin:[0,2,0,5],width:"100%",children:[(0,ie.jsx)(re.TextNano,{whiteSpace:"nowrap",color:"textDescription",children:"Show less"}),(0,ie.jsx)(re.InputRange,{"data-testid":"metricCorrelation-resultsSlider",min:0,max:1,onChange:e=>M(e.target.value.toString()),onClick:()=>(0,oe.H)("metric-correlation","click-slider","charts-view"),step:.01,value:x}),(0,ie.jsx)(re.TextNano,{whiteSpace:"nowrap",color:"textDescription",children:"Show more"})]}),(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsx)(Ee.A,{content:"Give us your feedback! Was it useful?",align:"bottom",enterDelay:200,showArrow:!0,activateOn:"hover",children:(0,ie.jsxs)(re.Flex,{children:[(0,ie.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,ie.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,ie.jsxs)(re.Flex,{alignItems:"center","data-testid":"correlationView-timePeriod-container",gap:4,children:[(0,ie.jsx)(Io,{icon:"logo_s",isLoading:f}),f?(0,ie.jsx)(re.H5,{"data-testid":"metricCorrelation-loadingCalculation",children:"Calculating metric correlations..."}):(0,ie.jsx)(Co,{highlightAfter:A,highlightBefore:k,baseline:S})]}):(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(re.Icon,{name:"correlation",color:"primary"}),(0,ie.jsx)(re.Text,{children:"Select a timeframe on any chart and find correlated metrics. Visit documentation"}),(0,ie.jsx)("a",{href:"https://learn.netdata.cloud/docs/cloud/insights/metric-correlations",target:"_blank",rel:"noreferrer",children:(0,ie.jsx)(re.Icon,{name:"nav_arrow_goto",color:"primary",width:"12px",height:"12px"})})]}),(0,ie.jsxs)(re.Flex,{alignItems:"center",children:[(!p||f)&&(0,ie.jsx)(Ee.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,ie.jsx)(wo,{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,ie.jsx)(Ee.A,{content:"Close",align:"bottom",children:(0,ie.jsx)(ko,{neutral:!0,flavour:"borderless",onClick:L,"data-ga":"metric-correlation::click-close::charts-view","data-testid":"metricCorrelation-close",icon:"x",feature:"MetricCorrelations"})})]})]})},Fo=e=>{let{children:t}=e;return(0,ie.jsxs)(re.Flex,{"data-testid":"selected-nodes-container",gap:1,alignItems:"center",width:"100%",children:[(0,ie.jsx)(re.Flex,{alignItems:"center",children:(0,ie.jsx)(re.TextSmall,{whiteSpace:"nowrap","data-testid":"selected-nodes-container-message",color:"primary",children:"Selected filters:"})}),(0,ie.jsx)(re.Flex,{height:{max:50},overflow:{vertical:"auto"},padding:[1],gap:1,alignItems:"center",flexWrap:!0,children:t})]})},Mo=(0,r.memo)(Fo),No=e=>{let{onRemove:t}=e;return(0,ie.jsx)(re.Box,{"data-testid":"remove-button",as:re.Icon,name:"close_circle",onClick:t,cursor:"pointer",width:3,height:3,color:"textLite"})},Lo=e=>{let{removeFilter:t,group:n,id:r,value:o,isAnchorDisabled:s,onClick:i,ref:a}=e;const[l,c]=o.split("|"),d=c?`${l} > ${c}`:l;return(0,ie.jsx)(re.Flex,{ref:a,"data-testid":`selected-node-item-${r}`,children:(0,ie.jsx)(re.Pill,{flavour:"neutral",hollow:!0,children:(0,ie.jsxs)(re.Flex,{position:"relative",gap:2,alignItems:"center",children:[i?(0,ie.jsx)(xe.A,{Component:re.TextSmall,disabled:s,onClick:i,cursor:"pointer",color:"text",hoverColor:"primary",visitedColor:"accent",disabledColor:"textLite",children:d}):(0,ie.jsx)(re.TextSmall,{children:d}),(0,ie.jsx)(No,{onRemove:()=>t({param:n,removedValue:r}),id:r})]})})})},$o=(0,r.memo)(Lo),Do={selectedNodeIds:"Node",nodeStatuses:"Status",nodeLabels:"Host label",nodeCapabilities:"Capability",nodeVersions:"Version"},Bo=e=>{let{group:t,subGroup:n,groupLabel:o,values:s,filtersByLabel:i={},hasUnion:a,union:l="AND",removeFilter:c,Component:d=$o}=e;const u=o||Do[t];if(!Array.isArray(s)||!s.length)return null;const h="nodeLabels"!==t||n?{}:i,x=Object.entries(h);return x.length?x.map(((e,n)=>{let[r,o]=e;return(0,ie.jsx)(Bo,{group:t,subGroup:r,groupLabel:`${Do[t]} ${r}`,values:o,hasUnion:n>0,removeFilter:c},n)})):(0,ie.jsxs)(r.Fragment,{children:[a&&(0,ie.jsx)(re.TextSmall,{strong:!0,children:l}),(0,ie.jsxs)(re.Pill,{flavour:"neutral",hollow:!0,gap:1,TextComponent:re.Flex,textProps:{alignItems:"center",gap:1},flexWrap:!0,children:[(0,ie.jsxs)(re.TextNano,{strong:!0,children:[u,":"]}),s.map(((e,o)=>(0,ie.jsxs)(r.Fragment,{children:[o>0&&(0,ie.jsx)(re.TextSmall,{strong:!0,children:"OR"}),(0,ie.jsx)(d,{removeFilter:c,id:n?`${n}|${e}`:e,value:e,group:t})]},e)))]})]},"filter")},Po=e=>{let{removeFilter:t,value:n,ref:r}=e;const o=(0,E.xY)(n,"name"),s=(0,E.xY)(n,"isOffline"),i=(0,E.d3)(n);return(0,ie.jsx)($o,{ref:r,removeFilter:t,group:"selectedNodeIds",id:n,value:o,isAnchorDisabled:s,onClick:i})},Ro=(0,r.memo)((e=>{let{flavour:t}=e;const[[n,r=[]],o]=(0,z._e)({extraKey:t,merge:!1});if(!n.length&&!r.length)return(0,ie.jsx)("div",{});const s=(0,z.Pt)(n);return(0,ie.jsx)(re.Flex,{width:"100%",overflow:"hidden",padding:[2,0],children:(0,ie.jsxs)(Mo,{children:[n.map(((e,t)=>{let[n,r]=e;return(0,ie.jsx)(Bo,{group:n,values:r,filtersByLabel:s,hasUnion:t>0,removeFilter:o},n)})),(0,ie.jsx)(Bo,{group:"selectedNodeIds",values:r,hasUnion:!!n.length&&!!r.length,union:"OR",removeFilter:o,Component:Po})]})})}));var Oo=n(88434);const Vo={overview:Ro,default:null},Eo=(0,r.memo)((e=>{let{flavour:t,...n}=e;const{showCorrelation:r}=(0,Oo.A)(),o=Vo[t]||Vo.default;return(0,ie.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,ie.jsx)(To,{flavour:t}):!!o&&(0,ie.jsx)(o,{...n,flavour:t})})})),zo=Eo;var _o=n(27024),Ho=n(98591),Ko=n(47213);const Go=e=>{let{id:t,contexts:n,menuId:r,parentIds:o,...s}=e;const i=(0,ke.bD)();return(0,Ko.q)(i)(n,r||t,o)?(0,ie.jsx)(ut.h,{id:t,...s,children:(0,ie.jsx)(ht.$,{id:t,hasTooltip:!0,flavour:s.extraKey,enableFavourites:!0,level:s.level,descendantIds:s.descendantIds,selfChartIds:s.selfChartIds})}):null},Wo=(0,r.memo)(Go);var Uo=n(5020),qo=n(80744),Jo=n(64156),Xo=n(28973),Yo=n(1817),Zo=n(2404),Qo=n.n(Zo),es=n(52795),ts=n(23565);const ns=(0,G.eU)(null),rs=()=>{const e=(0,zt.eg)(),t=(0,K.md)(ns);return e&&e.getRoot().getChildren().find((e=>e.match({id:t})))},os=e=>t=>`overview-page::${e.getAttribute("id")}::${t}`;var ss=n(54251),is=n(77679);const as={},ls=(e,t,n)=>{const o=(0,v.ID)(),[s,i]=(0,is.w)(),a=s?i:o,l=(0,H.rW)("contextSearchFilters",{key:a,extraKey:"chartFilters",flavour:"obj",defaultValue:as});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 s={dimensions:[],instances:[],labels:[]};o.forEach((e=>{const t=l[e];t&&r.forEach((e=>{const n=t[e];if(!n)return;(Array.isArray(n)?n:[n]).forEach((e=>{switch(e.matchType){case"dimensions":s.dimensions.includes(e.value)||s.dimensions.push(e.value);break;case"instances":e.instanceName&&(s.instances.includes(e.instanceName)||s.instances.push(e.instanceName));break;case"labels":s.labels.includes(e.value)||s.labels.push(e.value)}}))}))}));return s.dimensions.length>0||s.instances.length>0||s.labels.length>0?s:null}),[l,e,t,n])},cs=[],ds=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{selectedDimensions:e.dimensions?Object.keys(e.dimensions):cs,selectedInstances:e.instances?Object.keys(e.instances):cs,selectedNodes:e.nodes?Object.keys(e.nodes):cs,weight:e.weight}},us=e=>{let{style:t,handleProps:n,attributes:o,listeners:s,dragging:i,dragOverlay:a,id:l,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=rs(),{contextScope:C,...w}=(0,ln.aA)(l),I=(0,zt.eg)(),{sendLog:A,isReady:k}=(0,Qt.A)(),S=(0,ts.CS)({type:"chart",entity:C?C.join(","):l,path:"/"}),T=ls(C,m||g,p),F=(0,r.useMemo)((()=>{if(!y)return null;let e=y.getNode({id:a?`dragOverlay-${l}`:l});const t=(0,es.A)(S,!0);if(e)return j.current=(0,es.A)({...e.getAttributes(),...e.getAttribute("pristine"),pristine:{}}),T&&!Qo()(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:a?`dragOverlay-${l}`:l,roomId:b,expandable:!0,...w,contextScope:C,expanded:h,toolboxProps:{drag:{...n,...s,...o}}},makeTrack:os}),y.appendChild(e),j.current=(0,es.A)(e.getAttributes());const r=e.getAttribute("chartLibrary");return e.setAttributes({...j.current,...t,...T&&!Qo()(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,ss.A)(e,r,e.getAttribute("chartLibrary")),e}),[y,b,l,a]);(0,r.useLayoutEffect)((()=>{F&&k&&"function"===typeof A&&F.updateAttribute("logOptions",{sendLog:A,payload:{feature:"Overview"}})}),[F,A,k]);const{weight:M,selectedDimensions:N,selectedInstances:L,selectedNodes:$}=(0,ln.uy)(C.join("|"),ds),D=(0,Yo.A)(S),B=(0,Yo.A)(T,!0),P=(0,Yo.A)(N.length),R=(0,Yo.A)(L.length),O=(0,Yo.A)($.length);return(0,uo.A)((()=>{if(!F)return;const e=F.getAttribute("chartLibrary"),t={};if(!M||P===N.length&&R===L.length&&O===$.length?S&&!Qo()(D,S)&&Object.assign(t,{...j.current,...(0,es.A)(S,!0)}):Object.assign(t,{selectedDimensions:N,selectedInstances:L,selectedNodes:$}),T&&!Qo()(B,T)){const e=F.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&&(F.updateAttributes(t),(0,ss.A)(F,e,F.getAttribute("chartLibrary")),F.trigger("fetch"))}),[F,b,l,S,T,M,N.length,L.length,$.length]),(0,r.useLayoutEffect)((()=>{F&&t&&(F.updateAttributes({height:t.height,width:t.width}),F.trigger("resize"))}),[F,t.height,t.width]),(0,r.useLayoutEffect)((()=>{if(F)return(0,Xo.unregister)(F.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}=F.getAttributes();d(l,(e?1:-1)*t)})))}),[F]),(0,uo.A)((()=>{F&&F.updateAttributes({toolboxProps:{drag:{...n,...s,...o,dragging:i}}})}),[F,i]),F?(0,ie.jsxs)(re.Box,{ref:x,style:t,children:[(0,ie.jsx)(Ut.A,{chart:F,"data-chartid":a?`dragOverlay-${l}`:l,"data-track":F.track("container"),height:t.height,width:"100%"}),c]},y&&y.getId()):null},hs=(0,r.memo)(us,((e,t)=>e.id===t.id&&e.style===t.style)),xs=function(){let{id:e,layout:t={},contextScope:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,Uo.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})},gs=e=>{let{id:t,menuId:n,subMenuId:o,parentIds:s,containerWidth:i,...a}=e;const l=(0,ln.aA)(t,xs),c=(0,ke.bD)(),d=(0,Ko.q)(c),[u,h]=(0,r.useState)((()=>[l])),x=(e,t)=>{(0,Uo.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/qo.NA,expanded:t>0},x([...u],u[n]),g.current+=1)},p=(0,Jo.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,s)})))),[u,d,o,n,s]),j=(0,r.useMemo)((()=>e=>{let{id:t,...r}=e;return(0,ie.jsx)(hs,{id:t,role:"graphics-object","aria-roledescription":"chart","data-menuid":o||n,menuId:n,subMenuId:o,onChangeHeight:m,parentIds:s,...r},t)}),[o,n,s]);return(0,ie.jsx)(qo.Ay,{cacheId:g.current,rootId:t,containerId:t,onDragEnd:x,items:f,containerWidth:i-(p?16:26),"data-menuid":o||n,...a,Item:j,rearrangeable:!0})},ms=(0,r.memo)(gs);var ps=n(54025),fs=n(63996);const js=e=>{let{id:t,contexts:n,menuId:r,parentIds:o,extraKey:s,descendantIds:i,level:a,selfChartIds:l}=e;const c=(0,ke.bD)();return(0,Ko.q)(c)(n,r||t,o)?(0,ie.jsx)(ps.t,{gap:0,id:t,testId:"chart-sub-menu-container-overview",children:(0,ie.jsx)(fs.t,{id:t,margin:[1,0,0],hasTooltip:!0,flavour:s,enableFavourites:!0,level:a,descendantIds:i,selfChartIds:l})}):null},bs=(0,r.memo)(js);var vs=n(4719);const ys=e=>{let{id:t}=e;const n=(0,v.ID)(),o=(0,zt.eg)(),s=(0,ln.Vt)(),{chartIds:i}=(0,vs.b)(t),a=rs(),l=(0,r.useMemo)((()=>{const[e]=i;let r=a.getChildren().find((e=>e.match({id:t})));if(r)return r;const l=i.map((e=>({value:e,label:s(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:l,toolboxElements:[]},makeTrack:os}),a.appendChild(r),r}),[t,a]);return(0,ie.jsx)(Ut.A,{margin:[0,0,2],chart:l,"data-chartid":t,"data-track":l.track("container")},a.getId())},Cs=e=>{let{id:t,...n}=e;return(0,ie.jsxs)(ut.h,{id:t,padding:[6,0,0],children:[(0,ie.jsx)(ht.$,{id:t}),(0,ie.jsx)(xt.n,{id:t,padding:[2,0,0]}),(0,ie.jsx)(ys,{id:t,...n})]})},ws=(0,r.memo)(Cs);n(37550);const Is=[],As=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{selectedDimensions:e.dimensions?Object.keys(e.dimensions):Is,selectedInstances:e.instances?Object.keys(e.instances):Is,selectedNodes:e.nodes?Object.keys(e.nodes):Is,weight:e.weight}},ks=(0,ln.BK)((e=>{let{style:t,id:n,menuChartAttributes:o,resizeHandle:s,handleProps:i,listeners:a,dragging:l,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,zt.eg)(),b=rs(),y=(0,ts.CS)({type:"chart",entity:n,path:"/"}),C=ls(o.contextScope,g||x,m),w=(0,r.useMemo)((()=>{let e=b.getChildren().find((e=>e.match({id:c?`dragOverlay-${n}`:n})));const t=(0,es.A)(y,!0);if(e)p.current=(0,es.A)({...e.getAttributes(),...e.getAttribute("pristine")}),C&&!Qo()(e.getAttribute("prevMatches"),C)&&e.setAttributes({selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...C.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...C.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...C.labels||[]])),prevMatches:C});else{e=j.makeChart({attributes:{expandable:!0,...o,roomId:f,id:c?`dragOverlay-${n}`:n,isHead:!0,expanded:u},makeTrack:os,toolboxProps:{drag:{...i,...a}}}),p.current=(0,es.A)(e.getAttributes());const r=e.getAttribute("chartLibrary");e.setAttributes({...p.current,...t,...C&&Qo()(e.getAttribute("prevMatches"),C)&&{selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...C.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...C.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...C.labels||[]])),prevMatches:C}}),(0,ss.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("|"),As),T=(0,Yo.A)(y),F=(0,Yo.A)(C,!0,Qo()),M=(0,Yo.A)(A.length),N=(0,Yo.A)(k.length),L=(0,Yo.A)(S.length);(0,uo.A)((()=>{if(!w)return;const e={},t=w.getAttribute("chartLibrary");if(!I||M===A.length&&N===k.length&&L===S.length?y&&!Qo()(T,y)&&Object.assign(e,{...p.current,...(0,es.A)(y,!0)}):Object.assign(e,{selectedDimensions:A,selectedInstances:k,selectedNodes:S}),C&&!Qo()(F,C)){const t=w.getAttributes();Object.assign(e,{selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...e.selectedDimensions||[],...C.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...e.selectedInstances||[],...C.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...e.selectedLabels||[],...C.labels||[]])),prevMatches:C})}Object.keys(e).length>0&&(w.updateAttributes(e),(0,ss.A)(w,t,w.getAttribute("chartLibrary")),w.trigger("fetch"))}),[w,f,n,y,C,I,A.length,k.length,S.length]),(0,r.useLayoutEffect)((()=>{w.updateAttributes({toolboxProps:{drag:{...i,...a,dragging:l}}})}),[w,l]),(0,r.useLayoutEffect)((()=>{if(w)return(0,Xo.unregister)(w.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}=w.getAttributes();d(n,(e?1:-1)*t)})))}),[w]),(0,uo.A)((()=>{if(!w)return;const e=parseFloat(t.height);e&&!isNaN(e)&&(w.updateAttribute("height",e),w.trigger("resize"))}),[t.height]);return(0,ke.Bu)(o.contextScope)?(0,ie.jsxs)("div",{ref:h,style:t,children:[(0,ie.jsx)(Ut.A,{chart:w,"data-track":w.track("container"),"data-chartid":c?`dragOverlay-${n}`:n,height:t.height,width:"100%"}),s]},b.getId()):null})),Ss=(e,t,n)=>(e.layout||console.warn(t,"has no layout set, default values will be used."),(0,Uo.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})),Ts=(0,r.memo)((e=>{let{itemIds:t,containerWidth:n,id:o,subMenuId:s,menuId:i,parentIds:a}=e;const l=(0,ln.dd)(t,Ss),{filteredChartsCount:c}=(0,Zr.Ad)(),d=(0,Jo.A)("(max-width: 767px)"),u=(0,ke.bD)(),h=(0,Ko.q)(u),[x,g]=(0,r.useState)((()=>l)),m=(e,t)=>{(0,Uo.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(l)}),[t,l]);(0,r.useEffect)((()=>{const e=()=>{p.current+=1,g(l)};return window.addEventListener("resetChartLayout",e),()=>window.removeEventListener("resetChartLayout",e)}),[l,d]);const y=(0,r.useMemo)((()=>(p.current+=1,x.filter((e=>!!e&&(!!e.contextScope&&h(e.contextScope,i,a)))))),[t,x,c,h,i,a]);return y.length?(0,ie.jsxs)(re.Flex,{position:"relative",width:"100%",onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),children:[f&&b&&(0,ie.jsx)(re.Flex,{position:"absolute",top:2,right:2,zIndex:10,background:"dropdown",round:1,padding:[1],border:!0,children:(0,ie.jsx)(Ee.A,{content:"Reset all charts to default layout",align:"left",children:(0,ie.jsx)(re.IconButton,{icon:"refresh",onClick:v,flavour:"borderless",padding:[1],"data-testid":"grid-reset-layout-button"})})}),(0,ie.jsx)(qo.Ay,{cacheId:p.current,rootId:o,containerId:o,"data-chartid":o,"data-menuid":s||i,onDragEnd:m,items:y,containerWidth:n-(d?16:26),gridTracks:d?1:12,Item:ks,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/qo.NA,expanded:t>0},m([...x],x[n]),p.current+=1)},menuId:i,subMenuId:s,parentIds:a},compactType:"vertical"})]}):null}),((e,t)=>e.itemIds===t.itemIds&&e.containerWidth===t.containerWidth)),Fs={k8s:ws,root:Wo,submenu:bs,chart:ms,grid:Ts},Ms=e=>{if(Fs[e.flavour])return Fs[e.flavour];switch(e.level){case 0:return Wo;case 1:return bs;case 2:return ms;default:return null}},Ns=e=>{let{flavour:t,onChartNameChange:n,initialChartName:r,dashboardOptions:o,linkToGo:s,contextToGo:i,containerWidth:a}=e;const[l,,,c]=(0,Ho.A)("addToDashboardModal"),{setActiveMenuId:d}=(0,ct.A)({onChartNameChange:n,initialChartName:r,linkToGo:s,contextToGo:i}),u=(0,ke.bD)(),h=(0,Ko.q)(u);return(0,ie.jsxs)(te.H,{children:[(0,ie.jsx)(dt.A,{flavour:t,onActiveMenuId:d,getComponent:Ms,dashboardOptions:o,initialChartName:r,containerWidth:a,checkVisibility:h}),l&&(0,ie.jsx)(_o.A,{onClose:c})]})};var Ls=n(19075);const $s=(0,r.memo)((()=>{const[e,t]=(0,Ls.KB)(),n=(0,zt.eg)(),o=!!e&&!!n&&n.getNode({id:e.context}),s=()=>{if(t(null),!e?.context||!o)return;const n={...o.getAttribute("overlays")};delete n.alert,o.updateAttribute("overlays",n),history.replaceState({},"")};(0,r.useEffect)((()=>s),[]);const i=(0,v.ID)(),a=(0,ke.R7)(e?.context&&i,e?.context);if(!e||!a?.loaded)return null;const{firstEntry:l}=a;return(0,ie.jsx)(re.Layer,{backdrop:!1,position:"top",margin:[26,0,0],padding:[26,0,0],children:(0,ie.jsxs)(re.Flex,{background:"tooltip",padding:[1,2],gap:2,children:[(0,ie.jsxs)(re.TextSmall,{children:["Showing alert in ",(0,ie.jsx)(re.TextSmall,{strong:!0,children:e.instance})," on"," ",(0,ie.jsx)(re.TextSmall,{strong:!0,children:new Date(1e3*e.lastStatusChange).toLocaleString()}),!l&&" doesn't exist on the node anymore",!!l&&l>e.lastStatusChange&&" exceeds agent data retention settings"]}),(0,ie.jsx)(re.Flex,{flex:!1,children:(0,ie.jsx)(re.Icon,{name:"x",color:"tooltipText",onClick:s,size:"small"})})]})})})),Ds=$s;var Bs=n(14070);const Ps={NoChartsView:Yr,NoNodesView:B.A,sidebar:{title:"Filters",hiddenTabs:["info"],Component:ne.Ay,props:{}},dashboardOptions:{},loadingMessage:"Loading charts...",Header:zo},Rs={overview:{...Ps,sidebar:{...Ps.sidebar,title:"Metrics"},feature:"Overview"},k8s:{...Ps,NoChartsView:co,NoNodesView:co,sidebar:{...Ps.sidebar,title:"Kubernetes"},loadingMessage:"Loading k8s charts...",feature:"Kubernetes"},singleNode:{...Ps,sidebar:{...Ps.sidebar,title:"Single Node",hiddenTabs:["filters"],props:{showCollapsed:!0}},feature:"SingleNode"}},Os=()=>((0,Hr.A)(),null),Vs=(0,r.memo)((e=>{let{flavour:t="overview",invalidationKey:n,nodeIds:r,loaded:o,getChart:s,chartIds:i,areChartsIdsEmpty:a,showNoChartsView:l,showNoNodesView:d,initializing:u,chartName:h,setChartName:x,chartsLoaded:g,widthRef:m,containerWidth:p,nodesKey:j,blurred:b,blurProps:v={},BlurredContent:y,noPreferredNodesError:C}=e;const{dashboardOptions:w,NoChartsView:I,NoNodesView:A,sidebar:k,Header:S,feature:T="Overview"}=Rs[t],{state:F}=(0,f.zy)(),[M,,,N]=(0,Bs.A)(),L=rs();return d?(0,ie.jsx)(P.Ay,{feature:T,mode:"NoNodesView",children:(0,ie.jsx)(A,{})}):u?(0,ie.jsx)(Wr.A,{title:"Please wait while charts are being initialized.",body:"Thank you for your patience!"}):o?(0,ie.jsx)(P.Ay,{feature:T,children:(0,ie.jsxs)(te.A,{getObject:s,ids:i,linkToGo:F?.chartName,extraKey:t,deps:[j],children:[(0,ie.jsx)(Os,{}),(0,ie.jsx)(Ds,{}),(0,ie.jsxs)(O.A,{ref:m,sidebar:(0,ie.jsx)(k.Component,{nodeIds:r,title:k.title,initialChartName:h,hiddenTabs:k.hiddenTabs,flavour:t,loaded:g,FilterInputContainer:so,...k.props}),blurred:b,blurProps:v,BlurredContent:y,children:[(0,ie.jsx)(S,{flavour:t}),g||C?l||a?(0,ie.jsx)(I,{noPreferredNodesError:C}):(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(Ns,{flavour:t,dashboardOptions:w,initialChartName:h,onChartNameChange:x,linkToGo:F?.chartName,contextToGo:F?.contextToGo,containerWidth:p}),M&&N]}):(0,ie.jsx)(c.O2,{}),(0,ie.jsx)(Gr,{container:L})]})]},n)}):(0,ie.jsx)(c.O2,{})})),Es=Vs,zs=e=>t=>{const n=(0,E.nl)(),o=(0,r.useMemo)((()=>[n]),[n]);return(0,ie.jsx)(e,{flavour:"singleNode",nodeIds:o,nodeId:n,...t},n)};var _s=n(64867),Hs=n(12407),Ks=n(17829);var Gs=n(13752),Ws=n(92815),Us=n(72582),qs=n(82650),Js=n(78072),Xs=n(95980),Ys=n(91832),Zs=n(6504),Qs=n(22332),ei=n(12897),ti=n.n(ei),ni=n(55042),ri=n.n(ni),oi=new(ti())({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>'});ri().add(oi);const si=oi,ii=(0,un.default)(re.Icon).withConfig({displayName:"styled__StyledAlertDot",componentId:"sc-12w0ym-0"})(["position:absolute;top:0;right:-1px;width:6px;height:6px;"]);var ai=n(96026);const li=(0,Pt.A)((e=>{let{alertName:t,close:n,tooltip:o,...s}=e;const[,i]=(0,Bs.A)(),{sendLog:a}=(0,Qt.A)(),l=(0,r.useCallback)((e=>{e.stopPropagation(),i({alertName:t}),a({feature:"MetricsChartManageAlerts",description:"Show alert",alertName:t}),n()}),[t,i,n,a]);return(0,ie.jsx)(re.IconButton,{icon:"goToNode",iconColor:"textLite",onClick:l,neutral:!0,padding:[0],width:"16px",height:"16px",...s})})),ci=(0,Pt.A)((e=>{let{alertName:t,nodes:n,close:o,tooltip:s,...i}=e;const{goToEdit:a}=(0,ai.q)({alertName:t,nodeIds:n}),{sendLog:l}=(0,Qt.A)(),c=(0,r.useCallback)((e=>{e.stopPropagation(),l({feature:"MetricsChartManageAlerts",description:"Edit alert",alertName:t}),a(),o()}),[n,o,a,l]);return(0,ie.jsx)(re.IconButton,{icon:"pencilOutline",iconColor:"textLite",onClick:c,neutral:!0,padding:[0],width:"12px",height:"12px",...i})})),di=e=>{let{item:{value:t,label:n,alerts:r={},nodes:o,onClick:s,...i},index:a,style:l,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,ie.jsxs)(re.MenuItemContainer,{"data-index":a,onClick:e=>{s&&s(e)},...i,...u,style:l,alignItems:"center",justifyContent:"between",gap:2,padding:[1,2],overflow:"hidden",cursor:"default",children:[(0,ie.jsx)(re.Flex,{width:{max:"180px"},alignItems:"center",children:(0,ie.jsx)(Xt.A,{text:n,TextComponent:re.Text})}),(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(re.MasterCard,{pillLeft:m,pillRight:p,pillEnd:f}),(0,ie.jsx)(li,{alertName:t,close:c,tooltip:"Show alert instances",tooltipProps:{align:"bottom"}}),(0,ie.jsx)(ci,{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 ui=n(39423);const hi={events:{extraKey:"feedFilters",page:"events",alertNamesKey:"alert_names",period:{after:-n(71336).d_,before:0}},alerts:{extraKey:"alerts",page:"alerts",alertNamesKey:"alertNames"}},xi=function(){let{flavour:e="events"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,v.ID)(),n=(0,f.Zp)(),[o,s]=(0,eo.Ay)(),i=(0,Ls.le)(),[,a]=(0,Ls.DV)(),l=(0,H.rI)(),{extraKey:c,page:d,alertNamesKey:u,period:h}=hi[e]||hi.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;i(1),a({alertName:t,nodeId:null}),n(`/spaces/${o}/rooms/${s}/alerts`,{replace:!0})}),[n,o,s,i,a]),b=(0,r.useCallback)((e=>{let{context:t,name:r,instance:i}=e;h&&l((e=>({...e,...h}))),t&&g([t]),r&&m([r]),i&&p([i]),n(`/spaces/${o}/rooms/${s}/${d}`)}),[n,d,h,o,s,l,g,m,p]);return{goToAlerts:b,goToAlertConfigurations:j}},gi=(0,Ue.A)((0,Pt.A)(re.Button)),mi=e=>{let{loaded:t,contexts:n=[],close:o,onAddAlertClick:s}=e;const i=(0,Qs.useChart)().getId(),a=n?.[0],{setSelectedTab:l}=(0,ui.A)(),[c,d]=(0,eo.Ay)(),{goToAlerts:u}=xi({flavour:"alerts"}),h=(0,r.useMemo)((()=>a?`View the active alerts for ${a} context`:"View the active alerts for this context"),[a]),x=(0,r.useCallback)((()=>{a&&(l(0),o(),u({context:a}))}),[a,u,l,c,d,o]),g=(0,r.useCallback)((()=>{s(),o()}),[s,o]);return(0,ie.jsxs)(re.Flex,{gap:2,padding:[2],border:{side:"top"},justifyContent:"center",children:[(0,ie.jsx)(gi,{feature:"MetricsChartManageAlerts",label:"Go to alerts",small:!0,flavour:"hollow",icon:"goToNode",onClick:x,tooltip:h,tooltipProps:{align:"bottom"},payload:{chartId:i},disabled:!a||!t}),(0,ie.jsx)(gi,{feature:"MetricsChartManageAlerts",label:"Add alert",small:!0,icon:"plus",onClick:g,tooltip:`Start adding a new alert on ${a} context`,tooltipProps:{align:"bottom"},payload:{chartId:i},disabled:!a||!t})]})};var pi=n(11520);const fi=e=>{let{disabled:t}=e;const n=(0,Qs.useChart)(),o=(0,E.ss)(),{loaded:s,items:i,status:a}=(e=>{const[t,n]=(0,r.useState)(),[o,s]=(0,r.useState)([]),[i,a]=(0,r.useState)([]),[l,c]=(0,r.useState)(),d=(0,Ls.SU)();return(0,r.useEffect)((()=>{const t=()=>{const t=e.getAttribute("alerts"),r=Object.values(t||{}),o=Object.keys(e.getAttribute("nodes")||{});n(!0),s(r),a(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,s,a,c]),{loaded:t,items:(0,r.useMemo)((()=>[...o.map((e=>{let{nm:t,cl:n,wr:r,cr:o}=e;const s=(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:s}}))]),[o,i]),status:l}})(n),l=n.getAttribute("contextScope"),[,c]=(0,pi.A)(),d=(0,r.useCallback)((()=>{const{selectedNodes:e,selectedInstances:t,labels:r,selectedLabels:o,contextScope:s}=n.getAttributes(),i=n.getUnitSign(),a=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:s[0],viewUnits:i,...(t||[]).length?{instances:t}:{},...(e||[]).length?{nodes:e}:{},...a?{labels:a}:{}})}),[n,o,c]);return n?(0,ie.jsx)(re.Menu,{dropProps:{align:{top:"bottom",right:"right"},"data-toolbox":n.getId()},dropdownProps:{width:"360px"},Item:di,items:i,Footer:e=>{let{close:t}=e;return(0,ie.jsx)(mi,{loaded:s,contexts:l,close:t,onAddAlertClick:d})},children:(0,ie.jsxs)(re.Flex,{alignItems:"center",position:"relative",children:[a?(0,ie.jsx)(ii,{name:"dot",color:a}):null,(0,ie.jsx)(Zs.Button,{icon:(0,ie.jsx)(Zs.default,{svg:si,size:"16px"}),title:"Manage alerts",disabled:t,"data-testid":"chartHeaderToolbox-manageAlerts"})]})}):null},ji=(e,t,n)=>{let{width:o,host:s}=n;if(!s)throw"No host provided";const i=(0,zt.eg)(),a=(0,r.useRef)(),l=(0,ke.aZ)(e,"error"),[{correlation:c},d]=(0,H.N9)(),{state:u,pathname:h}=(0,f.zy)(),x=(0,K.Xr)(ns),g=(0,ke.jI)(e),m=(0,ke.DQ)(e);(0,r.useLayoutEffect)((()=>{if(!e||!i||l)return;let n=i.getRoot().getChildren().find((e=>e.match({id:h})));if(!n)return n=i.makeContainer({attributes:{id:h,roomId:e,host:s,navigation:c?"highlight":"pan",overlays:{proceeded:{type:"proceeded"}},composite:!0,nodesScope:t,hasCorrelation:!0,versions:g,containerWidth:o,toolboxElements:[...tt.Dm?[fi]:[],Js.default,Us.default,Gs.default,Ws.default,qs.default,Ys.A,Xs.A]}}),i.appendChild(n),x(h),a.current=n,(0,Xo.unregister)(i.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,l,h,s]),(0,r.useMemo)((()=>{a.current&&(a.current.setAttribute("containerWidth",o),a.current.getNodes().forEach((e=>e.updateAttribute("containerWidth",o))))}),[a.current,o]),(0,uo.A)((()=>{a.current&&a.current.setAttribute("host",s)}),[a.current,s]),(0,uo.A)((()=>{a.current&&a.current.getNodes().forEach((e=>{e.updateAttribute("nodesScope",t);e.getAttribute("active")&&"chart"===e.type&&e.fetch()}))}),[a.current,t]),(0,r.useEffect)((()=>{a.current&&a.current.getApplicableNodes({syncHighlight:!0}).forEach((e=>{e.updateAttribute("navigation",c?"highlight":"pan")}))}),[a.current,c]),(0,r.useEffect)((()=>()=>a.current&&a.current.destroy()),[]),(0,r.useEffect)((()=>{if(!a.current)return;if(!u||!u.context)return;const{context:e,chartId:t,nodeId:n}=u,r=a.current.getNode({id:e});r&&r.updateAttributes({selectedInstances:[`${t}@${n}`],selectedNodes:[n]});const o=t&&n&&a.current.on("chartLoaded",(r=>{const s=r.getAttribute("id");e===s&&(r.updateAttributes({selectedInstances:[`${t}@${n}`],selectedNodes:[n]}),o())}));return()=>u&&(0,Xo.unregister)(o)}),[a.current,u])};var bi=n(43116);const vi={default:{shouldHide:()=>!1},k8s:{shouldHide:e=>{let{context:t}=e;return!t.includes("k8s")}}},yi=[],Ci="ErrNoPreferredNodeRequested",wi=e=>(0,r.memo)((t=>{let{flavour:n="overview",nodeIds:o=yi,nodeId:s,...i}=t;const a=(0,b.vt)(),l=(0,v.ID)(),c=(0,v.XA)("nodeId");s=s||c;let d=(0,z.w7)({extraKey:n,merge:!1,scoped:!0});d=o.length?o:d;const{isNodeRestricted:u,loaded:h}=(0,tn.A)();d=(0,r.useMemo)((()=>d.filter((e=>!u(e).restricted))),[d,h]);const x=(0,D.nj)(),g=(0,ke._0)(l),{state:m}=(0,f.zy)(),p=(0,ke.R7)(l),j=(0,E.TG)(d),y=(0,Ae.A)(l,d,{spaceId:a}),{contexts:C,metadata:w,loaded:I,dimensionsCount:A}=(0,ho.Yy)({nodeIds:d,flavour:n},a,l),[,k]=(()=>{const{state:e={}}=(0,f.zy)(),{alertId:t=null}=e||{},[n,o]=(0,Ls.KB)(),s=t||n?.id,i=(0,Ls.JL)(s);(0,Ls.yk)(i.id),(0,r.useEffect)((()=>{(i.fullyLoaded||i.id)&&o({...i,formattedLastStatusChangeValue:(0,Ks.m3)(i.lastStatusChangeValue,i.units),linkToGo:(0,Qe.A)(i.context)})}),[i.id,i.fullyLoaded]);const a=n?.id?(0,Qe.A)(n.context):null;return[i.id,a]})(),S=o?o.join():n,T=(0,ee.K)({spaceId:a,roomId:l}),[F,{width:M}]=(0,R.A)();ji(l,d,{host:T,width:M});const N=(0,ke.OL)(l),L=(0,ke.rx)(l),$=I?w:p,B=vi[n]||vi.default,P=(0,ke.bo)(l),O=(0,Yo.A)(P),V=(0,Zr.rq)(N,p,l,{...B,shouldHide:I?e=>{let{context:t}=e;return!C.includes(t)}:B.shouldHide,force:I||P!==O,cacheKey:`${n}-${A}-${S}`}),_=(0,ke.yO)(l,w),K=(0,Yo.A)(y,!0),G=V<1,[W,U]=(0,H.N9)("chartName",{key:l,extraKey:S,flavour:"val"});(0,r.useEffect)((()=>{l&&U(k||m?.chartName||W)}),[l,k]);const q=rs(),J=Object.keys($).length<1&&g||d.length&&!j.length,X=(0,D.CK)(),Y=L?.errorMsgKey==Ci;if(!J&&!1!==K&&y&&"No data for this period"!==y&&y!==Ci&&!Object.keys($).length)return(0,ie.jsx)(bi.A,{error:y});const Z=!!l&&x&&(!!q||Y),{restricted:Q}=u(s);return(0,ie.jsx)(e,{nodeIds:j,loaded:Z,getChart:_,areChartsIdsEmpty:G,showNoNodesView:x&&!X.length,showNoChartsView:J,initializing:y&&(0,_s.O)(y),chartName:W,setChartName:U,chartsLoaded:g&&!!M,invalidationKey:l,flavour:n,chartIds:I?C:N,widthRef:F,containerWidth:M,nodesKey:S,noPreferredNodesError:Y,blurred:Q,blurProps:{value:"12px"},BlurredContent:()=>(0,ie.jsx)(Hs.A,{flavour:c?"room":"node"}),...i})}));var Ii=n(21785),Ai=n(39870),ki=n(7761);const Si=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),n=(0,ki.N3)();(0,j.A)((()=>({enabled:!(!e||!t),force:!0,fetch:()=>(0,$r.hn)(e,t),onReceive:e=>{let{data:t}=e;return n({...Ai.jf,loaded:!0,...t})},onFail:e=>n({...Ai.jf,loaded:!0,error:e}),pollingOptions:{pollingInterval:588e3}})),[e,t])};var Ti=n(75669);const Fi=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),n=(0,z.w7)({extraKey:"home",merge:!1,scoped:!0}),r=(0,ki.kf)();(0,j.A)((()=>({enabled:!(!e||!t),force:!0,fetch:()=>(0,$r.TM)(e,t,n),onReceive:e=>{let{data:t}=e;return r({...Ai.ul,loaded:!0,...t})},onFail:e=>r({...Ai.ul,loaded:!0,error:e}),pollingOptions:{pollingInterval:588e3}})),[e,t])},Mi=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),n=(0,z.w7)({extraKey:"home",merge:!1,scoped:!0}),r=(0,ki.xs)();(0,j.A)((()=>({enabled:!(!e||!t),force:!0,fetch:()=>(0,$r.jt)(e,t,n),onReceive:e=>{let{data:t}=e;return r({...Ai.ve,loaded:!0,...t})},onFail:e=>r({...Ai.ve,loaded:!0,error:e}),pollingOptions:{pollingInterval:588e3}})),[e,t,n])};var Ni=n(74290),Li=n(56473),$i=n(56523),Di=n(24285),Bi=n(76571),Pi=n(97926),Ri=n(17115),Oi=n(31246);const Vi=()=>{const{milestones:e,settingsLoaded:t}=(0,$i.A)(),{completed:n}=e,o=(0,Pi.A)(),s=(0,Ri.Ay)(),i=(0,g.Sk)(),a=(0,Ri.Ex)(),l=(0,Di.xd)("isLoaded"),c=(0,Di.xd)("onboardingFormData"),d=(0,b.vt)(),u=(0,b.ap)("loaded"),h=(0,Bi.t5)(d,"channels"),x=(0,Bi.t5)(d,"loaded"),m=Array.isArray(h)?h.length:0;return(0,r.useMemo)((()=>{if(!t||!x||!u||!l||!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=>(Oi.a7[e]||[]).map((t=>({...t,milestoneId:e}))))).filter((e=>{if(!e.segments.includes(s))return!1;if(e.permission&&!i[e.permission])return!1;if(e.requiresLargeTeam&&!a)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,s,i,a,m,t,x,u,l,c])};var Ei=n(81187),zi=n(4703);const _i=e=>{let{description:t}=e;return`${(0,Li.PP)({extraKey:"runningAlerts"}).length} ${t}`},Hi=e=>{let{onDismiss:t}=e;const{dismissOnboarding:n,resetOnboarding:o,markTaskCompleted:s}=(0,$i.A)(),i=Vi(),a=(0,Ei.A)(),l=(0,r.useCallback)((e=>s(e.milestoneId,e.id)),[s]),c=(0,r.useCallback)((()=>{n(),t?.()}),[n,t]);return i.length?(0,ie.jsx)(re.Flex,{column:!0,gap:4,children:(0,ie.jsxs)(re.Flex,{column:!0,gap:4,background:"panelBg",border:!0,round:2,padding:[6],position:"relative",children:[(0,ie.jsx)(re.IconButton,{icon:"x",neutral:!0,onClick:c,position:"absolute",top:"8px",right:"8px"}),(0,ie.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,ie.jsxs)(re.Flex,{gap:2,alignItems:"center",children:[(0,ie.jsx)(re.Icon,{name:"checkmark_partial_s",color:"success"}),(0,ie.jsx)(re.Text,{strong:!0,children:"Continue your journey"})]}),(0,ie.jsx)(re.TextSmall,{color:"textLite",children:"Here's what you can explore next"})]}),(0,ie.jsx)(re.Flex,{column:!0,gap:2,children:i.map((e=>(0,ie.jsx)(zi.A,{task:e,onClick:()=>a(e),onSkip:()=>l(e),children:e.dynamicDescription?(0,ie.jsx)(r.Suspense,{fallback:e.description,children:(0,ie.jsx)(_i,{description:e.description})}):e.description},`${e.milestoneId}-${e.id}`)))}),!1]})}):null};var Ki=n(56171);const Gi=[{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"}],Wi=e=>{let{item:t,onNavigate:n}=e;return(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:2,width:"100%",children:[(0,ie.jsx)(re.Icon,{name:t.icon,color:"main"}),(0,ie.jsxs)(re.Text,{color:"main",children:[t.text," ",(0,ie.jsx)(xe.A,{color:"main",onClick:n,style:{textDecoration:"underline"},children:t.linkText})]})]})},Ui=()=>{const e=(0,f.Zp)(),t=(0,b.bq)(),n=(0,v.QW)(),{dismissedBanners:o,dismissBanner:s}=(0,$i.A)(),i=(0,r.useMemo)((()=>Gi.find((e=>!o[e.id]))),[o]),a=(0,r.useCallback)((()=>{i&&s(i.id)}),[i,s]),l=(0,r.useCallback)((()=>{i?.route&&e(`/spaces/${t}/rooms/${n}/${i.route}`)}),[e,t,n,i]);return i?(0,ie.jsx)(Ki.A,{background:i.background,onClose:a,children:(0,ie.jsx)(Wi,{item:i,onNavigate:l})}):null};var qi=n(58618),Ji=n(42964),Xi=n(82507);const Yi={Live:"live",Stale:"stale",Offline:"offline",Unseen:"unseen"},Zi=(0,un.default)(re.Flex).withConfig({displayName:"nodeHero__Container",componentId:"sc-t1z79b-0"})(["position:relative;width:320px;height:320px;"]),Qi=(0,un.default)(re.Flex).withConfig({displayName:"nodeHero__ContentContainer",componentId:"sc-t1z79b-1"})(["position:absolute;inset:0;z-index:2;"]),ea=e=>{let{nodeId:t}=e;const n=(0,f.Zp)(),r=(0,E.xY)(t),{loaded:o,metricsCollected:s=0}=(0,ki.P9)(),i=(0,b.bq)(),a=(0,v.QW)(),l=(0,it.GM)(r.state),c=Yi[l]||"offline";return(0,ie.jsxs)(Zi,{children:[(0,ie.jsx)(Ji.A,{withOuties:!1}),(0,ie.jsx)(Xi.A,{withOuties:!1}),(0,ie.jsxs)(Qi,{column:!0,justifyContent:"center",alignItems:"center",gap:3,children:[(0,ie.jsx)(re.TextBig,{color:"primary",children:r.nm}),(0,ie.jsxs)(re.Flex,{gap:1,alignItems:"center",children:[(0,ie.jsx)(re.Box,{width:"8px",height:"8px",round:"50%",background:c}),(0,ie.jsx)(re.TextBig,{color:c,children:l})]})]}),(0,ie.jsxs)(re.Flex,{column:!0,alignItems:"center",gap:2,position:"absolute",width:"100%",style:{bottom:"-60px"},children:[(0,ie.jsxs)(re.TextBig,{children:[o?(0,qi.$t)(s):"..."," metrics collected"]}),(0,ie.jsx)(re.Button,{label:"View your metrics",icon:(0,ie.jsx)(re.Icon,{name:"arrow_right"}),iconSide:"right",onClick:()=>{n(`/spaces/${i}/rooms/${a}/overview`)}})]})]})},ta=(0,Pt.A)(re.Icon),na=e=>{let{title:t,icon:n,iconColor:r,...o}=e;return(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:2,...o,children:[n&&(0,ie.jsx)(re.Icon,{name:n,...r?{color:r}:{}}),(0,ie.jsx)(re.TextBig,{children:t})]})},ra={ErrNoEligibleNodeRequested:"There are no eligible nodes.",default:"Something went wrong."},oa=e=>{let{titleProps:t,loading:n,error:r,children:o,...s}=e;const i={padding:[4],gap:4,background:"panelBg",...t?{column:!0}:{}},a=r?ra[r.errorMsgKey]||ra.default:null;return(0,ie.jsxs)(re.Flex,{...i,...s,children:[t?(0,ie.jsx)(na,{...t}):null,n?(0,ie.jsx)(re.Text,{textAlign:"center",children:"Loading..."}):r?null:(0,ie.jsx)(ie.Fragment,{children:o}),a?(0,ie.jsx)(re.Flex,{width:"100%",justifyContent:"center",children:(0,ie.jsx)(ta,{name:"warning_triangle",size:"large",color:"text",tooltip:a})}):null]})},sa=e=>{let{title:t,value:n,loading:r}=e;return(0,ie.jsxs)(oa,{column:!0,alignItems:"center",justifyContent:"center",gap:2,padding:[4],width:"180px",children:[(0,ie.jsx)(re.TextSmall,{color:"textLite",children:t}),(0,ie.jsx)(re.TextHuge,{strong:!0,children:r?"...":(0,qi.$t)(n)})]})},ia=()=>{const e=(0,v.ID)(),t=(0,ke._0)(e),n=(0,ke.R7)(e),r=Object.keys(n||{}).length;return(0,ie.jsx)(sa,{title:"Charts Visualised",value:r,loading:!t})},aa=()=>(0,ie.jsx)(re.Flex,{column:!0,gap:4,children:(0,ie.jsx)(ia,{})}),la=()=>{const e=(0,Li.PP)({extraKey:"runningAlerts"});return(0,ie.jsx)(sa,{title:"Running Alerts",value:e.length,loading:!1})},ca=()=>(0,ie.jsx)(re.Flex,{column:!0,gap:4,children:(0,ie.jsx)(r.Suspense,{fallback:(0,ie.jsx)(sa,{title:"Running Alerts",value:"...",loading:!0}),children:(0,ie.jsx)(la,{})})}),da=e=>{let{position:t}=e;return"left"===t?(0,ie.jsx)(aa,{}):(0,ie.jsx)(ca,{})},ua=()=>((0,Ii.A)(),Si(),(0,Ti.A)(),Fi(),Mi(),(0,Ni.A)(),null),ha=e=>{let{nodeId:t}=e;return(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(ua,{}),(0,ie.jsx)(Ui,{}),(0,ie.jsxs)(O.A,{gap:4,padding:[4],overflow:"auto",children:[(0,ie.jsxs)(re.Flex,{gap:4,justifyContent:"center",alignItems:"center",children:[(0,ie.jsx)(da,{position:"left"}),(0,ie.jsx)(ea,{nodeId:t}),(0,ie.jsx)(da,{position:"right"})]}),tt.OH&&(0,ie.jsx)(Hi,{})]})]})},xa=e=>function(){let{title:t="",headerInfo:n,containerProps:r={},TitleComponent:o=re.TextBigger,...s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,ie.jsxs)(re.Flex,{column:!0,gap:2,alignItems:"center",justifyContent:"center",...r,children:[t&&(0,ie.jsxs)(re.Flex,{gap:2,alignItems:"center",children:[(0,ie.jsx)(o,{children:t}),n]}),(0,ie.jsx)(e,{...s})]})},ga=xa((e=>{let{number:t=0,NumberComponent:n=re.TextHuge}=e;return(0,ie.jsx)(n,{strong:!0,children:t})})),ma=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)}%`})))},pa=function(){let{data:e=[],testId:t="",numberIndicatorProps:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,ie.jsxs)(re.Flex,{width:"100%",column:!0,gap:2,children:[(0,ie.jsx)(re.Flex,{justifyContent:"around",children:e.map((e=>{let{label:t,value:r}=e;return(0,ie.jsx)(ga,{title:t,number:r,...n},`${t}-${r}`)}))}),(0,ie.jsx)(re.ProgressBar,{background:"borderSecondary",border:"none",containerWidth:"100%","data-testid":t,height:2,value:ma(e.filter((e=>{let{omit:t}=e;return!t})))})]})},fa=xa((e=>{let{nodesLoaded:t,total:n,count:o,live:s,offline:i,stale:a,unseen:l,...c}=e;const d=(0,r.useMemo)((()=>[...[{label:"Live",value:s,color:"success"},{label:"Offline",value:i,color:"offline"},{label:"Stale",value:a,color:"stale"}],...l?[{label:"Unseen",value:l,color:"unseen"}]:[]]),[s,i,a,l]);return(0,ie.jsxs)(re.Flex,{width:"100%",column:!0,alignItems:"center",gap:4,children:[(0,ie.jsxs)(re.Flex,{gap:2,alignItems:"baseline",children:[t?(0,ie.jsx)(re.TextHuge,{strong:!0,...c,children:o}):(0,ie.jsx)(re.Text,{children:"Loading..."}),t&&n!==o&&(0,ie.jsxs)(re.Text,{children:["of ",n]})]}),(0,ie.jsx)(pa,{data:d,numberIndicatorProps:{TitleComponent:re.TextBig,NumberComponent:re.TextBigger}})]})})),ja=e=>{const t=(0,D.nj)(),n=(0,D.CK)(),o=n.length,s=(0,z.eO)({keepAll:!1}),i=(0,r.useMemo)((()=>s.reduce(((e,t)=>{let{isLive:n,isOffline:r,isUnseen:o,state:s}=t;return{live:n?e.live+1:e.live,offline:r?e.offline+1:e.offline,stale:"stale"===s?e.stale+1:e.stale,unseen:o?e.unseen+1:e.unseen}}),{live:0,offline:0,stale:0,unseen:0})),[s]),a=(0,r.useMemo)((()=>{const e=s?.length||"-";return{nodesLoaded:t,total:o,count:e,title:t&&s&&o!==e?"Selected nodes":"Total nodes",...i}}),[t,n,s,o,i]);return(0,ie.jsx)(fa,{...a,...e})};var ba=n(50916),va=n.n(ba);function ya(e){return e*Math.PI/180}function Ca(e,t,n){return e>n?n:e<t?t:e}function wa(e,t){return t/100*e}function Ia(e,t){return e+t/2}function Aa(e,t){const n=ya(e);return{dx:t*Math.cos(n),dy:t*Math.sin(n)}}function ka(e){return"number"===typeof e}function Sa(e,t){return"function"===typeof e?e(t):e}function Ta({renderLabel:e,labelProps:t}){const n=e(t);if("string"===typeof n||"number"===typeof n){const{dataEntry:e,dataIndex:o,...s}=t;return r.createElement("text",{dominantBaseline:"central",...s},n)}return r.isValidElement(n)?n:null}function Fa({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 Ma(e,t){const{label:n}=t;if(n)return function(e,t){return e.map(((e,n)=>{const r=Sa(t.segmentsShift,n)??0,o=wa(t.radius,t.labelPosition)+r,{dx:s,dy:i}=Aa(Ia(e.startAngle,e.degrees),o);return{x:t.center[0],y:t.center[1],dx:s,dy:i,textAnchor:Fa({labelPosition:t.labelPosition,lineWidth:t.lineWidth,labelHorizontalShift:s}),dataEntry:e,dataIndex:n,style:Sa(t.labelStyle,n)}}))}(e,t).map(((e,t)=>r.createElement(Ta,{key:`label-${e.dataEntry.key||t}`,renderLabel:n,labelProps:e})))}function Na({cx:e,cy:t,lengthAngle:n,lineWidth:o,radius:s,shift:i=0,reveal:a,rounded:l,startAngle:c,title:d,...u}){const h=s-o/2,{dx:x,dy:g}=Aa(Ia(c,n),i),m=function(e,t,n,r,o){const s=Ca(r,-359.999,359.999);return va()(e,t,o,ya(n),ya(n+s)).map((e=>e.join(" "))).join(" ")}(e+x,t+g,c,n,h);let p,f;if(ka(a)){const e=ya(h)*n;p=Math.abs(e),f=p-wa(p,a)}return r.createElement("path",{d:m,fill:"none",strokeWidth:o,strokeDasharray:p,strokeDashoffset:f,strokeLinecap:l?"round":void 0,...u},d&&r.createElement("title",null,d))}function La(e,t,n){let r=`stroke-dashoffset ${e}ms ${t}`;return n&&n.transition&&(r=`${r},${n.transition}`),{transition:r}}function $a(e,t){return e&&(n=>{e(n,t)})}function Da(e,t,n){const o=n??function({reveal:e,animate:t}){return t&&!ka(e)?100:e}(t),{radius:s,center:[i,a]}=t,l=wa(s,t.lineWidth),c=e.map(((e,n)=>{const c=Sa(t.segmentsStyle,n);return r.createElement(Na,{cx:i,cy:a,key:e.key||n,lengthAngle:e.degrees,lineWidth:l,radius:s,rounded:t.rounded,reveal:o,shift:Sa(t.segmentsShift,n),startAngle:e.startAngle,title:e.title,style:Object.assign({},c,t.animate&&La(t.animationDuration,t.animationEasing,c)),stroke:e.color,tabIndex:t.segmentsTabIndex,onBlur:$a(t.onBlur,n),onClick:$a(t.onClick,n),onFocus:$a(t.onFocus,n),onKeyDown:$a(t.onKeyDown,n),onMouseOver:$a(t.onMouseOver,n),onMouseOut:$a(t.onMouseOut,n)})}));return t.background&&c.unshift(r.createElement(Na,{cx:i,cy:a,key:"bg",lengthAngle:t.lengthAngle,lineWidth:l,radius:s,rounded:t.rounded,startAngle:t.startAngle,stroke:t.background})),c}const Ba={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 Pa(e){const t=function(e){const t=Object.assign({},Ba,e);let n;for(n in Ba)void 0===e[n]&&(t[n]=Ba[n]);return t}(e),[n,o]=(0,r.useState)(t.animate?0:null);(0,r.useEffect)((()=>{t.animate&&o(null)}),[]);const s=function({data:e,lengthAngle:t,totalValue:n,paddingAngle:r,startAngle:o}){const s=n||function(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].value;return t}(e),i=Ca(t,-360,360),a=360===Math.abs(i)?e.length:e.length-1,l=Math.abs(r)*Math.sign(t),c=i-l*a;let d=0;const u=[];for(let h=0;h<e.length;h++){const t=e[h],n=0===s?0:t.value/s*100,r=wa(c,n),i=d+o;d=d+r+l,u.push(Object.assign({percentage:n,startAngle:i,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},Da(s,t,n),Ma(s,t),t.children)}const Ra=(0,un.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"})),Oa=(0,r.memo)((e=>{let{title:t,value:n,color:r,onClick:o=null}=e;return(0,ie.jsxs)(re.Flex,{alignItems:"center",justifyContent:"between",width:"100%",gap:4,flex:{grow:1,shrink:0},children:[(0,ie.jsxs)(re.Flex,{gap:1,children:[(0,ie.jsx)(re.Flex,{width:"4px",height:"16px",background:r}),(0,ie.jsxs)(Ra,{whiteSpace:"nowrap",onClick:o,children:[t,o&&(0,ie.jsx)(re.Icon,{color:"textLite",margin:[0,0,0,1],name:"nav_arrow_goto",height:"10px",width:"10px"})]})]}),(0,ie.jsx)(re.Text,{strong:!0,children:n??"-"})]})})),Va=e=>{let{data:t}=e;return(0,ie.jsx)(re.Flex,{column:!0,alignItems:"start",justifyContent:"center",gap:5,children:t.map(((e,t)=>{let{title:n,value:r,color:o,onClick:s}=e;return(0,ie.jsx)(Oa,{title:n,value:r,color:o,onClick:s},`${n}-${r}-${t}`)}))})},Ea=e=>{let{data:t,theme:n}=e;return t.map((e=>({...e,color:(0,re.getColor)(e.color)({theme:n})})))},za=e=>{let{chartData:t=[],lineWidth:n=15,animate:o=!0,label:s,hasData:i}=e;const a=(0,r.useContext)(un.ThemeContext);return(0,ie.jsxs)(re.Flex,{gap:4,margin:[0,4],height:{min:"70px",max:"130px"},alignItems:"center",children:[(0,ie.jsx)(re.Flex,{height:"70px",flex:{grow:1,shrink:1},children:i?(0,ie.jsx)(Pa,{label:()=>s,labelStyle:{fontSize:"34px",fontWeight:700,lineHeight:"38px",fill:(0,re.getColor)("textDescription")({theme:a})},labelPosition:0,data:Ea({data:t,theme:a}),lineWidth:n,animate:o}):(0,ie.jsx)(re.Icon,{color:"border",name:"pie_chart_skeleton",width:"70px",height:"70px",alignSelf:"center"})}),(0,ie.jsx)(Va,{data:t})]})},_a=xa((e=>(0,ie.jsx)(re.Flex,{gap:2,justifyContent:"between",padding:[2,0,0,0],children:(0,ie.jsx)(za,{...e})}))),Ha=e=>{const t=(0,Li.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}),s=(0,Ks.x7)(),i=(0,r.useMemo)((()=>({chartData:[{title:"Critical",value:n,color:"errorText",onClick:()=>s("critical")},{title:"Warning",value:o,color:"warningText",onClick:()=>s("warning")}],hasData:!!t?.length,label:t?.length})),[n,o,s]);return(0,ie.jsx)(_a,{title:"Active alerts",...i,...e})},Ka=()=>(0,ie.jsxs)(re.Flex,{"data-testid":"home-nodes-overview-left-section",column:!0,gap:4,basis:"205px",children:[(0,ie.jsx)(ja,{}),(0,ie.jsx)(Ur.A,{}),(0,ie.jsx)(Ha,{})]});var Ga=n(63950),Wa=n.n(Ga),Ua=n(31522),qa=n(41395);const Ja=e=>{let{label:t,color:n}=e;return(0,ie.jsxs)(re.Flex,{height:"24px",gap:1,alignItems:"center",children:[(0,ie.jsx)(re.Flex,{width:"12px",height:"12px",background:n}),(0,ie.jsx)(re.Text,{children:(0,qa.Zr)(t)})]})},Xa=e=>{let{colorBy:t}=e;const n=Object.entries(Ua.Cc[t?.value]||{}),r=Ua.Ug[t?.value]||{};return n.length?(0,ie.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,ie.jsx)(Ja,{label:r[t]||t,color:n},t)}))}):null},Ya=(0,Pt.A)(re.Icon),Za=e=>{let{nodes:t=[],groupBy:n,setGroupBy:o=Wa(),colorBy:s,setColorBy:i=Wa(),onAddNode:a}=e;const l=(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}`})))}(l).sort(((e,t)=>e.value.localeCompare(t.value,void 0,{sensitivity:"accent",ignorePunctuation:!0})))),[l]),d=(0,r.useMemo)((()=>[...Ua.XJ,...c]),[c]);return(0,ie.jsxs)(re.Flex,{"data-testid":"home-nodes-overview-main-section-header",alignItems:"end",justifyContent:"between",children:[(0,ie.jsxs)(re.Flex,{gap:3,alignItems:"end",children:[(0,ie.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,ie.jsxs)(re.Flex,{alignItems:"center",gap:1,children:[(0,ie.jsx)(re.Text,{color:"menuItem",children:"Group by"}),(0,ie.jsx)(Ya,{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,ie.jsx)(re.Select,{isMulti:!0,options:d,value:n,onChange:o,...c?.length>0?{styles:{minWidth:"250px"}}:{}})]}),(0,ie.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,ie.jsx)(re.Text,{color:"menuItem",children:"Color by"}),(0,ie.jsx)(re.Select,{options:Ua.Hn,value:s,onChange:i})]}),(0,ie.jsx)(Xa,{colorBy:s})]}),(0,ie.jsx)(fe.A,{flavour:"borderless",icon:"add_node",iconColor:"text",onClick:a})]})},Qa=(0,un.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"})),el=(0,un.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"})),tl=(0,un.default)(re.Icon).withConfig({displayName:"styled__AddNodeIcon",componentId:"sc-9bx1cv-2"})(["position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);"]),nl=(0,un.default)(re.Box).withConfig({displayName:"styled__Groups",componentId:"sc-9bx1cv-3"})(["width:100%;display:grid;grid-template-columns:repeat(2,1fr);gap:16px;"]),rl=(0,un.default)(re.Flex).withConfig({displayName:"styled__NodeContainer",componentId:"sc-9bx1cv-4"})(["opacity:",";"],(e=>{let{isActive:t}=e;return t?"1":".3"})),ol=(0,Pt.A)((e=>{let{children:t,innerProps:n={},containerProps:r={},...o}=e;return(0,ie.jsx)(rl,{margin:[0,0,.5,0],...o,children:(0,ie.jsx)(Qa,{...r,children:(0,ie.jsx)(el,{...n,children:t})})})})),sl=e=>{let{type:t,onClick:n}=e;const o=(0,v.XA)(),s=(0,b.dg)(),i=(0,g.JT)("node:Create"),a=(0,r.useMemo)((()=>({background:"success",isDisabled:!i,...i?{onClick:()=>n({type:t})}:{}})),[i]),l=i?"Add node":s?"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,ie.jsx)(ie.Fragment,{children:(0,ie.jsx)(ol,{containerProps:a,innerProps:{background:"panelBg"},tooltip:l,isActive:!0,children:(0,ie.jsx)(tl,{name:"plus",color:"success"})})})},il=ol;var al=n(89284),ll=n(91100);const cl=e=>{let{architecture:t,cpuFrequency:n,cpus:r,diskSpace:o,memory:s,os:i,osName:a}=e;const l=[(0,it.O)(n),(0,it.ws)(r,1===r?"Core":"Cores"),(0,it.ws)(t),(0,it.ws)((0,it.RI)(s),"RAM"),(0,it.ws)((0,it.RI)(o),"HD")];return(0,ie.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,ie.jsxs)(re.Flex,{gap:1,children:[(0,ie.jsx)(re.Icon,{"data-testid":"node-system-info-icon",name:et.u[a]?.iconName||et.U[i]?.iconName||"os",width:"16px",height:"16px",color:"text"}),(0,ie.jsx)(re.Flex,{children:(0,it.ws)(a)})]}),l.map(((e,t)=>(0,ie.jsxs)(re.Text,{children:["\u2022 ",e]},t)))]})};var dl=n(23208);const ul=e=>{let{isStable:t}=e;const n=t?{icon:"checkmark_s",color:"primary",borderColor:"primary"}:{icon:"warning_triangle",color:"stale",borderColor:"stale"};return(0,ie.jsx)(re.Pill,{hollow:!0,...n,children:t?"Stable":"Unstable"})},hl=function(){let{id:e,name:t,state:n,hw:o,os:s,isStable:i,setActiveNodes:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=(0,ki.c8)(),{nodes:c}=l||{},d=c?.[e];return(0,r.useEffect)((()=>{if("function"===typeof a){const{children:t,parents:n}=d||{},r=d?[...[...n,...t].map((e=>{let{id:t}=e;return t}))||[],e]:[e];a({isHover:!0,nodes:r})}return()=>{"function"===typeof a&&a(Ua.vd)}}),[e,d]),(0,ie.jsxs)(re.Flex,{column:!0,gap:3,width:{min:40},background:"mainBackground",padding:[2,4],children:[(0,ie.jsx)(re.TextBig,{strong:!0,children:t}),(0,ie.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,ie.jsx)(re.Text,{children:"Status"}),(0,ie.jsx)(re.Flex,{children:(0,ie.jsx)(al.A,{state:n})})]}),(0,ie.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,ie.jsx)(re.Text,{children:"Connection"}),(0,ie.jsx)(re.Flex,{children:(0,ie.jsx)(ul,{isStable:i})})]}),(0,ie.jsxs)(re.Flex,{column:!0,gap:1,children:[(0,ie.jsx)(re.Text,{children:"Alerts"}),(0,ie.jsx)(ll.A,{id:e})]}),(0,ie.jsx)(Ur.A,{color:"textLite"}),(0,ie.jsx)(cl,{architecture:o.architecture,cpuFrequency:o.cpuFrequency,cpus:o.cpus,"data-testid":"nodeRow-system-info",diskSpace:o.diskSpace,memory:o.memory,name:t,osName:s.nm,os:s.id}),(0,ie.jsx)(Ur.A,{color:"textLite"}),(0,ie.jsx)(dl.A,{id:e})]})},xl=function(){let{colorBy:e={},node:t={},isStable:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{value:o}=e,s=Ua.AZ[o],i=(0,Rr.Xt)(t.id),{critical:a,warning:l}=(0,Ls.AO)(i),c=Ua.Cc[o];let d=c[s?.(t)?.group?.toLowerCase()];if(o==Ua.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:a,warning:l})||d),[d,a,l]),background:d}},gl=e=>{let{colorBy:t,stability:n={},setActiveNodes:o,...s}=e;const{isStable:i}=n[s.id]||{},{borderColor:a,background:l}=xl({colorBy:t,node:s,isStable:i}),[,c]=(0,ki.A$)(),d=(0,r.useCallback)((()=>c(s.id)),[s.id,c]);return(0,ie.jsx)(il,{containerProps:{background:a,onClick:d},innerProps:{background:l},tooltip:(0,ie.jsx)(hl,{isStable:i,setActiveNodes:o,...s}),...s})};var ml=n(67462);const pl=e=>t=>{let{title:n,...o}=t;const s=(0,r.useMemo)((()=>"nolabel"===n?`${o.groupBy} (No value)`:`${o.groupBy}=${n}`),[n,o.groupBy]);return n?(0,ie.jsxs)(re.Flex,{width:"100%",column:!0,gap:2,children:[(0,ie.jsxs)(re.Flex,{justifyContent:"between",border:{side:"bottom",color:"border"},children:[(0,ie.jsx)(re.Text,{strong:!0,color:"menuItem",children:s}),o.nodes?.length?(0,ie.jsx)(re.Text,{color:"menuItem",children:`${o.nodes.length} ${(0,ml.su)(o.nodes.length)}`}):null]}),(0,ie.jsx)(e,{...o})]}):(0,ie.jsx)(e,{...o})},fl=(0,r.memo)((e=>{let{nodes:t=[],type:n,stability:o={},groupBy:s,colorBy:i,onAddNode:a,...l}=e;const[c,d]=(0,r.useState)(Ua.vd),{isHover:u,nodes:h}=c,x=s?.canAddNodes;return(0,ie.jsxs)(re.Flex,{flexWrap:!0,...l,children:[t.map((e=>(0,ie.jsx)(gl,{colorBy:i,stability:o,isActive:!u||h.includes(e.id),setActiveNodes:d,...e},e.id))),x?(0,ie.jsx)(sl,{type:n,onClick:a}):null]})})),jl=pl((e=>t=>{const{stability:n}=(0,ki.SW)();return(0,ie.jsx)(e,{stability:n,...t})})(fl)),bl=e=>t=>{const n=Ua.AZ[e],r=(0,Ua.Hl)(e);return t.reduce(((e,t)=>{const{group:o="unknown",type:s}=n(t);return e[o]?e[o].nodes=[...e[o].nodes,t]:e[o]={title:r(o)||"unknown",type:s,nodes:[t]},e}),{})},vl={os:bl("os"),version:bl("version"),status:bl("status"),technology:bl("technology"),replication:bl("replication"),cloudProvider:bl("cloudProvider"),cloudRegion:bl("cloudRegion"),instanceType:bl("instanceType"),none:e=>({none:{nodes:e}})},yl=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):vl[t]?.(n);var r},Cl=()=>(0,ie.jsx)(re.Flex,{children:(0,ie.jsx)(re.TextBig,{color:"menuItem",children:"No nodes found"})}),wl=e=>{let{nodes:t,groupBy:n,title:o,groupByValue:s,children:i}=e;const{value:a}=Array.isArray(n)&&n.length>0?n[0]:Ua.nv,l=yl({value:a,nodes:t}),c=(0,r.useMemo)((()=>Object.keys(l).length),[l]);return(0,ie.jsxs)(re.Flex,{"data-testid":`nodes-group-${s}-${o}`,column:!0,gap:2,padding:[2,4],round:2,border:{side:"all",color:"border"},children:[(0,ie.jsxs)(re.Flex,{alignItems:"center",justifyContent:"between",children:[(0,ie.jsxs)(re.Text,{strong:!0,color:"menuItem",children:[s,": ",o]}),c>1?(0,ie.jsxs)(re.Text,{color:"menuItem",children:[t.length," ",(0,ml.su)(t.length)]}):null]}),i]},o)},Il=e=>{let{nodes:t,groupBy:n,colorBy:o,onAddNode:s}=e;const{value:i}=Array.isArray(n)&&n.length>0?n[0]:Ua.nv,a=yl({value:i,nodes:t}),l=(0,r.useMemo)((()=>Object.values(a)),[a]);if(!a)return(0,ie.jsx)(Cl,{});if(!l.length)return(0,ie.jsx)(Cl,{});if(n?.value===Ua.nv.value){const{nodes:e}=l[0];return(0,ie.jsx)(jl,{nodes:e,groupBy:n,colorBy:o,onAddNode:s})}if(n.length>1)return(0,ie.jsx)(re.Flex,{column:!0,gap:4,children:l.map((e=>{let{title:t,nodes:r}=e;return(0,ie.jsx)(wl,{groupBy:n.slice(1),nodes:r,title:t,groupByValue:i,children:(0,ie.jsx)(Il,{nodes:r,groupBy:n.slice(1),colorBy:o,onAddNode:s})},t)}))});const c=1===l.length||n.length>1?re.Flex:nl;return(0,ie.jsx)(c,{children:l.map(((e,t)=>{let{title:n,type:r,nodes:a}=e;return(0,ie.jsx)(jl,{title:n,type:r,nodes:a,groupBy:i,colorBy:o,onAddNode:s,margin:[0,0,2,0]},n||t)}))})},Al=Il,kl=()=>(0,ie.jsxs)(re.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,ie.jsxs)(re.Flex,{gap:2,children:[(0,ie.jsx)(hn.A,{width:"22px",height:"22px",round:2}),(0,ie.jsx)(hn.A,{width:"22px",height:"22px",round:2}),(0,ie.jsx)(hn.A,{width:"22px",height:"22px",round:2}),(0,ie.jsx)(hn.A,{width:"22px",height:"22px",round:2}),(0,ie.jsx)(hn.A,{width:"22px",height:"22px",round:2}),(0,ie.jsx)(hn.A,{width:"22px",height:"22px",round:2})]}),(0,ie.jsxs)(re.Flex,{gap:2,children:[(0,ie.jsx)(hn.A,{width:"22px",height:"22px",round:2}),(0,ie.jsx)(hn.A,{width:"22px",height:"22px",round:2}),(0,ie.jsx)(hn.A,{width:"22px",height:"22px",round:2}),(0,ie.jsx)(hn.A,{width:"22px",height:"22px",round:2}),(0,ie.jsx)(hn.A,{width:"22px",height:"22px",round:2}),(0,ie.jsx)(hn.A,{width:"22px",height:"22px",round:2})]})]}),Sl=()=>{const[e,t]=(0,r.useState)([]),[n,o]=(0,r.useState)(Ua.jZ),[s,i]=(0,r.useState)(),a=(0,v.ID)(),l=(0,D.gr)(a,"loaded"),c=(0,z.eO)({keepAll:!1}),d=(0,r.useCallback)((e=>{i(e)}),[i]),u=(0,r.useCallback)((()=>i()),[i]);return(0,ie.jsxs)(re.Flex,{"data-testid":"home-nodes-overview-main-section",column:!0,gap:4,basis:"calc(100% - 410px)",children:[(0,ie.jsx)(Za,{nodes:c,groupBy:e,setGroupBy:t,colorBy:n,setColorBy:o,onAddNode:d}),(0,ie.jsx)(re.Flex,{height:{max:150},overflow:{vertical:"auto"},children:l?(0,ie.jsx)(Al,{nodes:c,groupBy:e,colorBy:n,onAddNode:d}):(0,ie.jsx)(kl,{})}),s&&(0,ie.jsx)(je.A,{nodeType:s?.type,onClose:u})]})},Tl=()=>(0,ie.jsxs)(re.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,ie.jsxs)(re.Flex,{justifyContent:"between",children:[(0,ie.jsx)(hn.A,{width:"30%"}),(0,ie.jsx)(hn.A,{width:"30%"}),(0,ie.jsx)(hn.A,{width:"30%"})]}),(0,ie.jsxs)(re.Flex,{justifyContent:"between",children:[(0,ie.jsx)(hn.A,{width:"30%"}),(0,ie.jsx)(hn.A,{width:"30%"}),(0,ie.jsx)(hn.A,{width:"30%"})]}),(0,ie.jsx)(hn.A,{})]}),Fl=()=>{const{loaded:e,totalChildren:t,totalParents:n,totalStandalone:o}=(0,ki.c8)(),s=(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,ie.jsx)(pa,{numberIndicatorProps:{TitleComponent:re.Text},data:s}):(0,ie.jsx)(Tl,{height:"58px"})},Ml=()=>(0,ie.jsxs)(re.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,ie.jsxs)(re.Flex,{justifyContent:"between",children:[(0,ie.jsx)(hn.A,{width:"30%"}),(0,ie.jsx)(hn.A,{width:"30%"}),(0,ie.jsx)(hn.A,{width:"30%"})]}),(0,ie.jsxs)(re.Flex,{justifyContent:"between",children:[(0,ie.jsx)(hn.A,{width:"30%"}),(0,ie.jsx)(hn.A,{width:"30%"}),(0,ie.jsx)(hn.A,{width:"30%"})]}),(0,ie.jsx)(hn.A,{})]}),Nl=()=>(0,ie.jsxs)(re.Flex,{column:!0,gap:1,alignItems:"center",width:"220px","data-testid":"nodesByDataReplication-information-text",overflow:"hidden",children:[(0,ie.jsxs)(re.TextMicro,{children:[(0,ie.jsx)(re.TextMicro,{strong:!0,children:"None:"})," The node's data are only on the node itself. Lose the node, lose the data!"]}),(0,ie.jsxs)(re.TextMicro,{children:[(0,ie.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,ie.jsxs)(re.TextMicro,{children:[(0,ie.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,ie.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."})]}),Ll=()=>(0,ie.jsx)(Ee.A,{isBasic:!0,plain:!0,content:Nl,align:"bottom",children:(0,ie.jsx)(re.Icon,{name:"information",color:"textDescription",size:"small"})}),$l=xa((()=>{const e=(0,ki.c8)(),{loaded:t,replicationFactor:n}=e||{},o=(0,r.useMemo)((()=>[{label:"None",value:n?.r_1||0,color:Ua.q5.r_1},{label:"Single",value:n?.r_2||0,color:Ua.q5.r_2},{label:"Multi",value:n?.["r_*"]||0,color:Ua.q5["r_*"]}]),[n]);return t?(0,ie.jsx)(pa,{data:o}):(0,ie.jsx)(Ml,{})})),Dl=()=>(0,ie.jsx)($l,{title:"Data Replication",headerInfo:(0,ie.jsx)(Ll,{})}),Bl=()=>(0,ie.jsxs)(re.Flex,{"data-testid":"home-nodes-overview-right-section",column:!0,gap:4,basis:"205px",children:[(0,ie.jsx)(Fl,{}),(0,ie.jsx)(Ur.A,{}),(0,ie.jsx)(Dl,{})]}),Pl=()=>(0,ie.jsxs)(oa,{children:[(0,ie.jsx)(Ka,{}),(0,ie.jsx)(Ur.A,{vertical:!0}),(0,ie.jsx)(Sl,{}),(0,ie.jsx)(Ur.A,{vertical:!0}),(0,ie.jsx)(Bl,{})]});var Rl=n(66118),Ol=n(44731);Rl.t1.register(Rl.PP,Rl.kc,Rl.A6,Rl.E8,Rl.m_,Rl.s$);const Vl={borderWidth:0,maxBarThickness:15,minBarLength:0},El=function(){let{alertsStats:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.useContext)(un.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=s.labels[t];if(!n)return;let r=0;for(;n?.length>20;)n=(0,qa.P3)(n,r),r+=1;return n}}},y:{stacked:!0,grid:{color:(0,re.getColor)("borderSecondary")({theme:t})},afterSetDimensions:e=>{e.maxWidth=50}}}},s=(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{...Vl,backgroundColor:"critical"===t?"#DB162F":"#FF9700",data:n,label:t}})),labels:e}}),[n]);return s.datasets?(0,ie.jsx)(re.Flex,{width:"100%",height:40,children:(0,ie.jsx)(Ol.yP,{data:s,options:o})}):null},zl=e=>{let{alertsStats:t}=e;const{nodes:n}=t||{},{critical:o,warning:s,total:i}=n||{},a=(0,r.useMemo)((()=>[{label:"Warning",value:s,color:["yellow","yellow80"]},{label:"Critical",value:o,color:["red","red100"]},{label:"Total",value:i,color:["purple","lilacFocus"],omit:!0}]),[o,s,i]);return n?(0,ie.jsx)(pa,{data:a}):null},_l=[{id:"name",accessorKey:"name",header:"Alert name",fullWidth:!0,cell:e=>{let{getValue:t,row:n}=e;const o=t(),{goToAlerts:s}=xi(),i=(0,r.useCallback)((e=>{e.preventDefault(),s({name:o,instance:n?.original?.chart})}),[s]);return(0,ie.jsx)(Ee.A,{content:"Go to events tab. Timeframe will be set to the last 24 hours.",isBasic:!0,children:(0,ie.jsx)(re.Box,{children:(0,ie.jsx)(xe.A,{onClick:i,children:o})})})}},{id:"chart",name:"chart",fullWidth:!0,header:"Instance"},{id:"occurrences",name:"occurrences",header:"Occurrences"},{id:"duration",name:"duration",header:"Duration (seconds)"}],Hl=function(){let{data:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.length?(0,ie.jsx)(re.Flex,{height:{max:50},overflow:{vertical:"auto"},children:(0,ie.jsx)(re.Table,{data:e,dataColumns:_l,sortBy:[{id:"occurrences",desc:!0}],enableResizing:!0})}):null},Kl={title:"Nodes with the most alerts in the last 24h"},Gl=e=>{const t=(0,ki.jg)();return t.loaded?(0,ie.jsxs)(oa,{"data-testid":"home-alert-nodes",titleProps:Kl,...e,children:[(0,ie.jsx)(El,{alertsStats:t}),(0,ie.jsx)(zl,{alertsStats:t}),(0,ie.jsxs)(re.Flex,{column:!0,gap:4,children:[(0,ie.jsx)(re.TextBig,{children:"Top alerts in the last 24 h"}),(0,ie.jsx)(Hl,{data:t?.alerts})]})]}):(0,ie.jsx)(d.nl,{})},Wl={title:"Metrics available",justifyContent:"center"},Ul=e=>{const{loaded:t,metricsCollected:n=0,error:r}=(0,ki.P9)();return t?(0,ie.jsx)(oa,{"data-testid":"home-metrics",titleProps:Wl,error:r?.response?.data,...e,children:(0,ie.jsx)(re.Flex,{width:"100%",justifyContent:"center",children:(0,ie.jsx)(re.TextHuge,{strong:!0,children:(0,qi.$t)(n)})})}):(0,ie.jsx)(d.Tr,{title:"Metrics available",...e})},ql={title:"Charts visualized",justifyContent:"center"},Jl=e=>{const t=(0,v.ID)(),n=(0,ke._0)(t),r=(0,ke.rx)(t),o=(0,ke.R7)(t),s=Object.keys(o||{}).length;return n||r?(0,ie.jsx)(oa,{"data-testid":"home-charts-data",titleProps:ql,error:r,...e,children:(0,ie.jsx)(re.Flex,{width:"100%",justifyContent:"center",children:(0,ie.jsx)(re.TextHuge,{strong:!0,children:(0,qi.$t)(s)})})}):(0,ie.jsx)(d.Tr,{...e})},Xl={title:"Alerts configured",justifyContent:"center"},Yl=e=>{const{loaded:t,value:n}=(0,Ls.oU)();return t?(0,ie.jsx)(oa,{"data-testid":"home-alerts-data",titleProps:Xl,...e,children:(0,ie.jsx)(re.Flex,{width:"100%",justifyContent:"center",children:(0,ie.jsx)(re.TextHuge,{strong:!0,children:(0,qi.$t)(n?.length||0)})})}):(0,ie.jsx)(d.Tr,{...e})};Rl.t1.register(Rl.PP,Rl.kc,Rl.A6,Rl.E8,Rl.m_,Rl.s$);const Zl=function(){let{dataRetention:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.useContext)(un.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,qa.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,ie.jsx)(re.Flex,{width:"100%",height:"100%",children:(0,ie.jsx)(Ol.yP,{data:o,options:n})}):null},Ql={title:"Data retention per Nodes"},ec=e=>{const{dataRetention:t}=(0,ki.P9)();return(0,ie.jsx)(oa,{"data-testid":"home-data-retention",titleProps:Ql,...e,children:(0,ie.jsx)(Zl,{dataRetention:t})})},tc=()=>((0,Ii.A)(),Si(),(0,Ti.A)(),Fi(),Mi(),(0,Ni.A)(),null),nc=new Date("2025-12-01").getTime(),rc=()=>{const e=(0,D.CK)(),t=(0,D.nj)(),n=(0,b.ap)("createdAt");if(!t)return(0,ie.jsx)(d.WV,{});if(!e.length)return(0,ie.jsx)(P.Ay,{feature:"Home",mode:"NoNodesView",children:(0,ie.jsx)(B.A,{})});const r=new Date(n).getTime()>nc;return tt.OH&&1===e.length&&r?(0,ie.jsx)(P.Ay,{feature:"Home",mode:"SingleNodeHome",children:(0,ie.jsx)(ha,{nodeId:e[0]})}):(0,ie.jsxs)(P.Ay,{feature:"Home",children:[(0,ie.jsx)(tc,{}),(0,ie.jsxs)(O.A,{gap:4,padding:[4],overflow:"auto",children:[tt.OH&&(0,ie.jsx)(Hi,{}),(0,ie.jsx)(Pl,{}),(0,ie.jsxs)(re.Flex,{gap:4,children:[(0,ie.jsx)(Gl,{width:"60%"}),(0,ie.jsxs)(re.Flex,{column:!0,gap:4,height:"100%",width:"calc(40% - 16px)",children:[(0,ie.jsxs)(re.Flex,{gap:4,children:[(0,ie.jsx)(Ul,{flex:{grow:"1",shrink:"0"}}),(0,ie.jsx)(Jl,{flex:{grow:"1",shrink:"0"}}),(0,ie.jsx)(Yl,{flex:{grow:"1",shrink:"0"}})]}),(0,ie.jsx)(ec,{flex:"grow"})]})]})]})]})};var oc=n(7234),sc=n(89711);var ic=n(84060),ac=n(31035),lc=n(2863),cc=n(49916);var dc=n(46587);const uc=()=>{const e=(0,b.vt)(),t=(0,E.nl)(),n=(0,o.ES)(e),r=(0,dc.uW)("isAnonymous"),{value:s}=(0,E.BQ)(t),i=s?.agents?.[0]||{},a="windows"==(i.application?.os?.kernel||"").toLowerCase();return{hasAccess:!(n&&r&&a),reason:"windowsAgent"}};var hc=n(14457),xc=n(93933),gc=n(15524);const mc=un.default.div.withConfig({displayName:"styled__Separator",componentId:"sc-1fhfk7c-0"})(["background:",";height:20px;width:1px;"],(0,re.getColor)("border")),pc=e=>{let{flavour:t,...n}=e;const o=(0,E.nl)(),s=(0,Rr.Xt)(o),{critical:i,warning:a}=(0,Ls.AO)(s),l=(0,H.Fw)("sidebarTab",{flavour:"val",extraKey:t}),c=(0,H.Fw)("sidebarOpen",{flavour:"bool"}),d=(0,r.useCallback)((e=>{c(!0),l(e)}),[c,l]),{id:u,hw:h={},cpus:x,isLive:g,name:m,os:p={},state:f,updateSeverity:j,labels:b,version:v,health:y,capabilities:C}=(0,E.xY)(o),{silencingState:w}=y?.alerts||{},I={dataTestId:"singleNode",isLive:g},A=(0,it.t3)({count:i,type:"critical",...I}),k=(0,it.t3)({count:a,type:"warning",...I}),S=(0,it.GM)(f),T=(0,it.Pg)(h.container,h.virtualization),F=(0,Jo.A)("(min-width: 1760px)"),M=(0,E.TC)();return(0,ie.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,ie.jsx)(re.TextSmall,{"data-testid":`singleNode-${m}`,strong:!0,children:m}),(0,ie.jsx)(jt.A,{badge:"info","data-testid":"singleNode-nodeInfo-cta",children:(0,ie.jsx)(re.IconButton,{flavour:"borderless",cursor:"pointer",onClick:()=>{M(u),d("info")},icon:"information",iconColor:"nodeBadgeColor",width:"18px",height:"18px"})}),(0,ie.jsx)(mc,{"data-testid":"singleNode-separator"}),(0,ie.jsx)(jt.A,{badge:"alerts",nodeName:m,children:(0,ie.jsx)(re.AlertMasterCard,{onClick:A.text||k.text?()=>M(u,{},"/alerts"):null,pillLeft:A,pillRight:k})}),(0,ie.jsx)(mc,{"data-testid":"singleNode-separator"}),(0,ie.jsx)(en,{node:{id:u,name:m,isLive:g,capabilities:C},padding:[0,1]}),j&&(0,ie.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,ie.jsx)(mc,{"data-testid":"singleNode-separator"}),(0,ie.jsx)(jt.A,{badge:"connectivity",connectivityState:S,"data-testid":"singleNode-connectivityStateInfo",nodeName:m,children:(0,ie.jsx)(re.Pill,{flavour:"neutral",hollow:!0,children:S})}),(0,ie.jsx)(jt.A,{badge:"type","data-testid":"singleNode-nodeTypeInfo",nodeName:m,nodeType:T.label,children:(0,ie.jsx)(re.Pill,{flavour:"neutral",hollow:!0,icon:T.icon,children:T.label})}),F&&(0,ie.jsx)(jt.A,{badge:"systemInfo","data-testid":"singleNode-systemInfo",nodeName:m,children:(0,ie.jsxs)(re.Pill,{flavour:"neutral",hollow:!0,icon:et.u[p.nm]?.iconName||et.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,ie.jsx)(Dt.A,{flavour:"node",silencing:w})]})},fc=()=>{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 jc=n(10444);const bc=(0,un.default)(re.Box).attrs((e=>({width:"6px",height:"6px",round:"50%",...e}))).withConfig({displayName:"withNotification__NotificationDot",componentId:"sc-ka7a4g-0"})([""]),vc=e=>t=>{let{notificationBg:n,...r}=t;return n?(0,ie.jsxs)(re.Flex,{position:"relative",gap:1,padding:[0,0,0,1.5],children:[(0,ie.jsx)(bc,{background:n,position:"absolute",top:-2,left:0}),(0,ie.jsx)(e,{...r})]}):(0,ie.jsx)(e,{...r})},yc=(0,un.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);}"]),Cc=(0,un.default)(re.Icon).attrs({name:"long_arrow_up",color:"successText"}).withConfig({displayName:"tabLink__DropHereIcon",componentId:"sc-1h4dha1-0"})(["animation:"," 1s ease-in infinite;"],yc),wc=e=>{let{active:t,highlight:n,iconColor:r}=e;return r||(n||t?"primary":"textDescription")},Ic=vc(re.Icon),Ac=e=>{let{id:t,to:n,params:o,exact:s,icon:i,iconColor:a,title:l,fixed:c,dataGa:d,testId:u,children:h,type:x,tooltip:g,showBorderLeft:m,droppable:p,droppableProps:j={},ref:b,isDynamic:v,highlight:y,...C}=e;const{sendLog:w}=(0,Qt.A)(),{setNodeRef:I,active:A}=(0,ze.zM)({id:`droppable-tab-${t}`,disabled:!p,data:j}),k=(0,f.RQ)(s?n:`${n}/*`),S=(0,f.Zp)(),F=(0,jc.J)(),M=!!k,N="nodes"!==x||M,L=(0,r.useCallback)((()=>{if(M)return;const e=`${n}${o?`/${o}`:""}`;S(e),w({feature:"Navigation",description:"Single page navigation using static tabs",tab:t,path:e})}),[t,n,M,o,w]),$=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 C.onRemove&&C.onRemove(C.index,M)}),[v,C.index,M,C.onRemove]);return(0,ie.jsx)(Ee.A,{content:g||l,align:g?"bottom":"top",isBasic:"string"===typeof(g||l),...y?{color:"primary"}:{},children:(0,ie.jsxs)(re.NavigationTab,{ref:(0,re.mergeRefs)(I,b,D),fixed:c,active:M,showBorderLeft:m,icon:(0,ie.jsx)(Ic,{name:i,size:"small",color:wc({active:M,highlight:y,iconColor:a}),notificationBg:B?.color}),onActivate:L,"data-ga":d,"data-testid":u,"aria-selected":M,...$&&{rootProps:{background:"successSemi",cursor:"alias"}},onMouseUp:P,...C,children:[!F&&!!l&&(0,ie.jsx)(re.Text,{alignSelf:"center",strong:y,color:wc({active:M,highlight:y,iconColor:a}),whiteSpace:"nowrap",children:l}),D.current&&$&&(0,ie.jsx)(re.Drop,{target:D.current,align:{top:"bottom"},stretch:!1,hideShadow:!0,zIndex:1,children:(0,ie.jsx)(Cc,{})}),N&&h]})})},kc={singleNode:"singleNode",logs:"logs",top:"fn",feed:"feed",anomalies:"anomalies",default:"singleNode",alerts:"alerts"},Sc=(0,r.memo)((()=>{const e=fc(),t=(0,f.RQ)("/spaces/:spaceSlug/rooms/:roomSlug/nodes/:nodeId/:path"),n=t&&kc[t.params.path]||kc.default;return(0,ie.jsxs)(re.Flex,{justifyContent:"start",alignSelf:"start",alignItems:"end",width:"100%",height:"100%",overflow:"auto",background:"mainBackground",children:[(0,ie.jsx)(pc,{flavour:n,background:"mainBackground",border:void 0}),(0,ie.jsx)(re.TabSeparator,{}),e.map(((e,t)=>{let{id:n,icon:r,title:o,path:s,...i}=e;return(0,ie.jsx)(Ac,{exact:!0,fixed:!0,to:s,icon:r,title:o,id:n,rootProps:{background:"mainBackground"},showBorderLeft:0===t,...i},`${n}-${t}`)}))]})})),Tc=Sc;var Fc=n(47413),Mc=n(17178),Nc=n(5722);const Lc=()=>{const{active:e}=(0,ze.fF)(),t=(0,g.JT)("dashboard:Create"),n=(0,b.dg)();return t&&e&&!n?(0,ie.jsx)(Ac,{to:"",id:"plus",icon:"plus",fixed:!0,droppable:!0,droppableProps:{dropArea:!0,dashboardId:"new"},testid:"roomDropdownMenu-roomOptions",disabled:!t||n}):null},$c=e=>{let{title:t,path:n,children:o,index:s,ref:i,tooltip:a,type:l,id:c,...d}=e;const u=(0,Ls.JL)("alerts"===l?c:null,"name"),h=(0,Ls.JL)("alerts"===l?c:null,"instanceName"),x=(0,Ls.JL)("alerts"===l?c:null,"nodeId"),g=(0,E.xY)("alerts"===l?x:null,"name"),m=(0,E.xY)("nodes"===l?c:null,"name"),p=(0,r.useMemo)((()=>{if("alerts"===l){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"===l?{title:`Node: ${m||t||"Unknown"}`,description:"View node metrics, logs, top consumers, anomalies, and more."}:"dashboards"===l?{title:`Dashboard: ${t||"Unknown"}`,description:"View custom dashboard"}:a}),[l,a,t,u,h,g,m]);return(0,ie.jsx)(Ac,{ref:i,isDynamic:!0,showBorderLeft:0===s,to:n,title:t,tooltip:p,"data-testid":`navigation-dynamicTab-${t}`,index:s,type:l,id:c,...d,children:o})},Dc=e=>{let{staticPaths:t,...n}=e;const[r,o,s]=(0,Fc.A)(t),i=(0,gc.A)("horizontal");return(0,ie.jsx)(re.BaseDraggableTabs,{onDragEnd:o,onTabClose:s,items:r,Item:$c,...n,ref:i})},Bc=()=>(0,ie.jsx)(f.BV,{children:(0,ie.jsx)(f.qh,{path:"/spaces/:spaceSlug/rooms/:roomSlug/nodes/:nodeId/*",element:(0,ie.jsx)(Tc,{})})}),Pc=(0,r.memo)((()=>{const[e,t]=(0,Mc.A)();return(0,Nc.A)()?(0,ie.jsxs)(re.NavigationTabs,{subTabs:(0,ie.jsx)(Bc,{}),children:[e.map(((e,t)=>{let{id:n,icon:r,title:o,path:s,...i}=e;return(0,ie.jsx)(Ac,{fixed:!0,to:s,icon:r,title:o,id:n,...i},`${n}-${t}`)})),(0,ie.jsx)(re.TabSeparator,{}),(0,ie.jsx)(Dc,{staticPaths:t}),(0,ie.jsx)(Lc,{})]}):null})),Rc=Pc,Oc=()=>{const e=(0,zt.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])},Vc=()=>(Oc(),null);var Ec=n(73937),zc=n(21885),_c=n(65637),Hc=n(55177),Kc=n(73980),Gc=n(45026);const Wc=`dyncfg-edit-alet-warning-dismiss-${window.envSettings?.visitor}`,Uc={lineHeight:1.6},qc=e=>{let{alertName:t,nodeIds:n=[]}=e;const s="true"===localStorage.getItem(Wc),[i,,,a]=(0,pe.A)(!s),[l,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)((()=>{l&&localStorage.setItem(Wc,!0),a()}),[l,a]);return i?(0,ie.jsx)(re.Modal,{backdropContainerProps:{zIndex:"60"},backdropProps:{backdropBlur:!0},children:(0,ie.jsxs)(re.ModalContent,{children:[(0,ie.jsx)(re.ModalHeader,{children:(0,ie.jsx)(re.H4,{children:"Editing Alerts"})}),(0,ie.jsx)(re.ModalBody,{children:(0,ie.jsxs)(re.Flex,{column:!0,gap:2,width:{max:120},children:[(0,ie.jsxs)(re.TextBig,{...Uc,children:["You are about to edit the alert ",(0,ie.jsx)(re.TextBig,{color:"primary",children:t}),d?(0,ie.jsxs)(ie.Fragment,{children:[" ","on node ",(0,ie.jsx)(re.TextBig,{color:"primary",children:d}),h]}):null,"."]}),(0,ie.jsx)(re.TextBig,{...Uc,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,ie.jsx)(re.TextBig,{...Uc,children:'To apply an alert on all your currently connected nodes, edit it and select "Submit to Multiple Nodes".'}):(0,ie.jsx)(re.TextBig,{...Uc,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,ie.jsxs)(re.ModalFooter,{justifyContent:"between",children:[(0,ie.jsxs)(re.Flex,{gap:2,alignItems:"center",children:[(0,ie.jsx)(re.Checkbox,{checked:l,onChange:x}),(0,ie.jsx)(re.TextBig,{children:"Don't show this again"})]}),(0,ie.jsx)(re.Button,{type:"button",flavour:"hollow",label:"OK",textTransform:"uppercase",onClick:g})]})]})}):null},Jc=(0,r.memo)((()=>{const{node:e}=(0,Ec.Z)(),{alertName:t,nodeIds:n,title:o}=(0,Gc.A)(),{loaded:s,tree:i}=(0,_c.A)(n?{value:n?.[0]}:e),a=(0,r.useMemo)((()=>i?.[zc.$7]?.[o]||{}),[i,o]),l=(0,r.useMemo)((()=>!!Object.keys(a||{}).length),[a]);return s&&t?(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(Kc.A,{flavour:"entity",title:o,entityProps:a,isOpen:l,isEditFromState:!0,renderChildren:e=>(0,ie.jsx)(Hc.A,{id:o,...a,...e})},JSON.stringify({loaded:s,alertName:t,alertItemExists:l})),a?(0,ie.jsx)(qc,{alertName:t,nodeIds:n}):null]}):null})),Xc=Jc,Yc=(0,r.memo)((()=>{const{node:e}=(0,Ec.Z)(),{path:t}=(0,_c.A)(e),n=(0,Zt.sh)({node:e,path:t}),{entityProps:r,...o}=n||{};return n?(0,ie.jsx)(Kc.A,{id:n.template,flavour:"entity",title:`${n.template}:placeholder`,entityProps:{...r,...o},isNewItem:!0,formData:n.formData,renderChildren:e=>(0,ie.jsx)(Hc.A,{...r,...e,id:n.template,isNewItem:!0})}):null})),Zc=Yc,Qc=(0,s.A)((()=>Promise.all([n.e(5638),n.e(3864),n.e(3457)]).then(n.bind(n,93457))),"ManageSpaceRoute"),ed=(0,s.A)((()=>n.e(2201).then(n.bind(n,52201))),"Trial"),td=(0,s.A)((()=>n.e(5302).then(n.bind(n,5302))),"PreferredNodesModal"),nd=(0,s.A)((()=>Promise.resolve().then(n.bind(n,61314))),"JoinSpace"),rd=(0,s.A)((()=>n.e(7530).then(n.bind(n,17530))),"NoSpaceAccess"),od=(0,s.A)((()=>n.e(6333).then(n.bind(n,96333))),"EmptyRoom"),sd=(0,s.A)((()=>n.e(1910).then(n.bind(n,11910))),"AlertView"),id=(0,s.A)((()=>n.e(7316).then(n.bind(n,74935))),"Anomalies"),ad=(0,s.A)((()=>Promise.resolve().then(n.bind(n,19440))),"AlertsSmartboard"),ld=(0,s.A)((()=>n.e(7214).then(n.bind(n,27214))),"DashboardsOverview"),cd=(0,s.A)((()=>Promise.all([n.e(180),n.e(4424),n.e(5297)]).then(n.bind(n,95297))),"DashboardView"),dd=(0,s.A)((()=>Promise.all([n.e(5638),n.e(5388),n.e(7791)]).then(n.bind(n,47791))),"FunctionsView"),ud=(0,s.A)((()=>Promise.all([n.e(687),n.e(3864),n.e(2439),n.e(4209)]).then(n.bind(n,24209))),"Insights"),hd=(0,s.A)((()=>Promise.all([n.e(687),n.e(3864),n.e(2439),n.e(3808)]).then(n.bind(n,43808))),"InsightsReport"),xd=(0,s.A)((()=>n.e(2792).then(n.bind(n,32792))),"Onboarding"),gd=(0,s.A)((()=>Promise.all([n.e(3864),n.e(8791),n.e(9462),n.e(5187)]).then(n.bind(n,89462))),"Integrations"),md=(0,s.A)((()=>Promise.all([n.e(180),n.e(2003)]).then(n.bind(n,92003))),"DropInDashboard"),pd=(0,s.A)((()=>n.e(3185).then(n.bind(n,73185))),"Marketplace"),fd=(0,s.A)((()=>n.e(3675).then(n.bind(n,33675))),"AlertConfigAiModal"),{demoSlug:jd,demoDefaultRoomViews:bd,defaultRoomView:vd,onboardingView:yd,integrationsView:Cd}=x.A,wd=zs(wi(Es)),Id=wi(Es),Ad=(0,r.memo)((()=>{const[e,t]=(0,eo.Ay)(),n=jd===e?bd[t]||bd.default:o.Ay&&t===o.Iy?o.kG:vd;return(0,ie.jsxs)(r.Suspense,{fallback:(0,ie.jsx)(d.zj,{}),children:[(0,ie.jsx)(r.Suspense,{fallback:"",children:(0,ie.jsx)(md,{})}),(0,ie.jsx)(f.BV,{children:(0,ie.jsx)(f.qh,{path:"nodes/:nodeId/*",element:(0,ie.jsx)(Lr,{})})}),(0,ie.jsxs)(f.BV,{children:[(0,ie.jsx)(f.qh,{path:yd,element:(0,ie.jsx)(r.Suspense,{fallback:(0,ie.jsx)(d.NP,{}),children:(0,ie.jsx)(xd,{})})}),(0,ie.jsx)(f.qh,{path:Cd,element:(0,ie.jsx)(r.Suspense,{fallback:(0,ie.jsx)(d.H$,{}),children:(0,ie.jsx)(gd,{flavour:"settingsPage"})})}),(0,ie.jsx)(f.qh,{path:"nodes/:nodeId",element:(0,ie.jsx)(wd,{})}),(0,ie.jsx)(f.qh,{path:"nodes/:nodeId/alerts",element:(0,ie.jsx)(ad,{})}),(0,ie.jsx)(f.qh,{path:"nodes/:nodeId/anomalies",element:(0,ie.jsx)(r.Suspense,{fallback:(0,ie.jsx)(d.Bm,{}),children:(0,ie.jsx)(id,{})})}),(0,ie.jsx)(f.qh,{path:"nodes/:nodeId/top",element:(0,ie.jsx)(dd,{flavour:"fn"},"fn")}),(0,ie.jsx)(f.qh,{path:"nodes/:nodeId/logs",element:(0,ie.jsx)(dd,{flavour:"logs"},"logs")}),(0,ie.jsx)(f.qh,{path:"nodes/:nodeId/events",element:(0,ie.jsx)(dd,{flavour:"feed"},"feed")}),(0,ie.jsx)(f.qh,{path:"nodes",element:(0,ie.jsx)(Nr,{})}),(0,ie.jsx)(f.qh,{path:"home",element:(0,ie.jsx)(rc,{})}),(0,ie.jsx)(f.qh,{path:"overview",element:(0,ie.jsx)(Id,{})}),(0,ie.jsx)(f.qh,{path:"alerts/:alertId",element:(0,ie.jsx)(r.Suspense,{fallback:(0,ie.jsx)(d.xh,{}),children:(0,ie.jsx)(sd,{})})}),(0,ie.jsx)(f.qh,{path:"alerts",element:(0,ie.jsx)(ad,{})}),(0,ie.jsx)(f.qh,{path:"alarms/:alertId",element:(0,ie.jsx)(sd,{})}),(0,ie.jsx)(f.qh,{path:"alarms",element:(0,ie.jsx)(f.C5,{replace:!0,to:`/spaces/${e}/rooms/${t}/alerts`})}),(0,ie.jsx)(f.qh,{path:"functions",element:(0,ie.jsx)(f.C5,{replace:!0,to:`/spaces/${e}/rooms/${t}/top`})}),(0,ie.jsx)(f.qh,{path:"dashboard",element:(0,ie.jsx)(cd,{customDashboardId:o.LA})}),(0,ie.jsx)(f.qh,{path:"dashboards/:dashboardSlug",element:(0,ie.jsx)(r.Suspense,{fallback:(0,ie.jsx)(c.O2,{}),children:(0,ie.jsx)(cd,{})})}),(0,ie.jsx)(f.qh,{path:"dashboards",element:(0,ie.jsx)(ld,{})}),(0,ie.jsx)(f.qh,{path:"kubernetes",element:(0,ie.jsx)(Id,{flavour:"k8s"})}),(0,ie.jsx)(f.qh,{path:"anomalies",element:(0,ie.jsx)(r.Suspense,{fallback:(0,ie.jsx)(d.Bm,{}),children:(0,ie.jsx)(id,{})})}),(0,ie.jsx)(f.qh,{path:"top",element:(0,ie.jsx)(dd,{flavour:"fn"},"fn")}),(0,ie.jsx)(f.qh,{path:"logs",element:(0,ie.jsx)(dd,{flavour:"logs"},"logs")}),(0,ie.jsx)(f.qh,{path:"events",element:(0,ie.jsx)(dd,{flavour:"feed"},"feed")}),(0,ie.jsx)(f.qh,{path:`${m.p9}/:reportId`,element:(0,ie.jsx)(hd,{})}),(0,ie.jsx)(f.qh,{path:"insights/*",element:(0,ie.jsx)(r.Suspense,{fallback:(0,ie.jsx)(d.BJ,{}),children:(0,ie.jsx)(ud,{})})}),(0,ie.jsx)(f.qh,{path:"/",element:(0,ie.jsx)(f.C5,{replace:!0,to:`/spaces/${e}/rooms/${t}/${n}`})})]})]})})),kd=()=>{const{isOnboardingPath:e,path:t}=(0,u.A)(),{isIntegrationsPath:n}=(0,hc.Q)(),[s,a]=(0,hc.A)(),l=(0,b.vt)(),c=(0,v.ID)(),h=(0,i.I)(),x=(0,D.gr)(c,"ids"),g=(0,D.gr)(c,"loaded"),m=(0,b.bE)(l,"isEmpty"),j=(0,r.useMemo)((()=>!0===g&&!x.length),[g,x]),y=(0,o.Az)(l);return((e,t)=>{const n=(0,p.yF)((0,r.useCallback)((async(n,r)=>{await n((0,v.LS)({id:t,key:"fullyLoaded"}))||(0,$r.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])})(l,c),(0,Dr.A)({spaceId:l,id:c,pollingInterval:63e3}),Er(l,c),zr(l,c),(0,_r.A)(l,c),function(e,t){let{types:n,entities:o,paths:s,names:i}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(0,p.yF)(((r,a)=>{(0,sc.Uc)(e,t,{types:n,entities:o,paths:s,names:i}).then((n=>{let{data:r}=n;a((0,ts.Mg)({spaceId:e,roomId:t}),r),a((0,Ie.n_)({spaceId:e,roomId:t})),a(Zn({spaceId:e,roomId:t})),a((0,oc.w7)({spaceId:e,roomId:t}),!0)}))}));(0,r.useEffect)((()=>{e&&t&&a()}),[e,t,n,o,s,i])}(l,c),$(),(0,r.useEffect)((()=>{y||a||h||m(s)}),[y,s,h,a,m]),h?(0,ie.jsx)(r.Suspense,{fallback:"",children:(0,ie.jsx)(pd,{subCallback:h})}):a?(0,ie.jsx)(d.Qk,{}):y||!s||!t||e||n?!j||e||n?(0,ie.jsx)(Ad,{}):(0,ie.jsx)(od,{}):(0,ie.jsx)(f.C5,{to:t,replace:!0})},Sd=(0,l.Xc)((0,r.memo)((()=>{const e=(0,g.JT)("space:Read"),t=(0,g.JT)("room:Read"),{hasAccess:n,reason:o}=uc();return e?n?(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(Rc,{}),(0,ie.jsx)(r.Suspense,{fallback:(0,ie.jsx)(d.Qk,{}),children:(0,ie.jsxs)(f.BV,{children:[(0,ie.jsx)(f.qh,{path:"spaces/:spaceSlug/join-space",element:(0,ie.jsx)(nd,{})}),(0,ie.jsx)(f.qh,{path:"spaces/:spaceSlug/no-rooms",element:(0,ie.jsx)(rd,{reason:"noRooms"})}),(0,ie.jsx)(f.qh,{path:"spaces/:spaceSlug/settings/*",element:(0,ie.jsx)(Td,{})}),(0,ie.jsx)(f.qh,{path:"spaces/:spaceSlug/rooms/:roomSlug/*",element:t?(0,ie.jsx)(kd,{}):(0,ie.jsx)(rd,{reason:"noRoomPermission"})})]})})]}):(0,ie.jsx)(rd,{reason:o}):(0,ie.jsx)(rd,{reason:"noSpacePermission"})}))),Td=()=>((0,eo.KI)(),(0,ie.jsx)(Qc,{})),Fd=()=>{const e=(0,b.vt)();return(0,ic.A)(e),(0,ac.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,lc.S)({id:e}),r)}),[e])),n=(0,p.yF)((0,r.useCallback)(((t,n,r)=>{n((0,lc.S)({id:e,key:"error"}),r)}),[e])),o=(0,cc.sC)(e,"loaded"),s=(0,g.JT)("alert:ReadAll");(0,j.A)((()=>({enabled:s&&!!e&&o,fetch:()=>(0,Pr.C2)(e),onFail:n,onReceive:t,pollingOptions:{pollingInterval:15e4}})),[e,!!o,s])})(e),null},Md=(0,l.Xc)((()=>{const e=(0,b.vt)();return(0,xc.Ay)(),(0,r.useEffect)((()=>{const e=(0,a.A)(new URL(window.location.href).searchParams.get("join_callback"));e&&(window.location.href=e)}),[]),e?(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(Fd,{}),(0,ie.jsx)(h.A,{permission:"space:Read",children:t=>t?(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(f.BV,{children:(0,ie.jsx)(f.qh,{path:"/*",element:(0,ie.jsx)(Vc,{})})}),(0,ie.jsx)(r.Suspense,{fallback:(0,ie.jsx)(d.Qk,{}),children:(0,ie.jsx)(Sd,{})})]}):(0,ie.jsx)(rd,{reason:"noSpacePermission"},e)}),(0,ie.jsx)(r.Suspense,{fallback:"",children:(0,ie.jsx)(ed,{})}),(0,ie.jsxs)(r.Suspense,{fallback:"",children:[(0,ie.jsx)(td,{}),(0,ie.jsx)(Zc,{}),(0,ie.jsx)(Xc,{}),(0,ie.jsx)(fd,{})]})]}):(0,ie.jsx)(d.Qk,{})}))},41579:(e,t,n)=>{n.d(t,{A:()=>u});n(98992),n(3949),n(81454);var r=n(96540),o=n(30569),s=n(92726),i=n(91539),a=n(24609),l=n(19186),c=n(258),d=n(67294);const u=()=>{const e=(0,a.vt)(),t=(0,l.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,s._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,i.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:()=>a});var r=n(96540),o=n(61661),s=n(6988),i=n(32465);const a=()=>{const e=(0,o.AR)(),t=(0,i.A)(),[n,a]=(0,o.oE)(),l=(0,o.WB)(),c=(0,r.useMemo)((()=>(0,s.Cj)({searchTerm:n,integrations:e})),[n,e]),d=n?(0,s.M6)(c,t):l;return{integrations:(0,s.Fd)((0,s.xM)(d)),setSearchTerm:a}}},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),s=n(1817),i=n(44245),a=n(93335),l=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)(l.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/*"),l=(0,i._F)(),c=(0,i.xK)(),u=(0,i.NU)(),x=n?n.pathnameBase:"/spaces",{pathname:g}=(0,o.zy)(),m=(0,s.A)(e[g]&&g,!0),p=(0,r.useCallback)(((e,n)=>{if(!n)return c(e);const r=l[e-1],o=l[e+1],s=(n,r)=>{t(`${n}${r?`/${r}`:""}`),c(e)};return m?s(m):r?s(r.path,r.params):o?s(o.path,o.params):s(x)}),[l,c,x,m]);return[(0,r.useMemo)((()=>l.map((e=>({...e,children:e.id&&"nodes"===e.type?(0,d.jsx)(a.N,{nodeId:e.id}):"alerts"===e.type?(0,d.jsx)(h,{alertId:e.id}):null})))),[l]),(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),s=n(4719),i=n(50239),a=n(66814);const l=e=>{const t=(0,r.useRef)();return(0,a.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)(),a=l(s.tu),d=l(o.i8),u=(0,i.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(a.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",s="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,s]},t.v6=t.mw},50916:e=>{e.exports=(e,t,n,r,o)=>{const s=o-r;if(0===s)return[];const i=n*Math.cos(r)+e,a=n*Math.sin(r)+t,l=n*Math.cos(o)+e,c=n*Math.sin(o)+t;return[["M",i,a],["A",n,n,0,Math.abs(s)<=Math.PI?"0":"1",s<0?"0":"1",l,c]]}},51318:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(96540),o=n(61661),s=n(89942);const i=()=>{const e=(0,s.PP)(),[t,n]=(0,o.XL)(),{reset:i}=(0,o.b8)(),a=(0,r.useCallback)((()=>{i(),(0,s.Z8)({...e,integrationsModalOpen:"true"}),n("true")}),[i,n,e]);return{isIntegrationsVisible:t,hideIntegrations:(0,r.useCallback)((()=>{(0,s.Z8)({...e,integrationsModalOpen:""}),n("")}),[e,n]),onIntegrationsClick:a}}},54025:(e,t,n)=>{n.d(t,{t:()=>s});var r=n(63766),o=n(74848);const s=e=>{let{id:t,testId:n="chart-sub-menu-container",...s}=e;return(0,o.jsx)(r.Flex,{column:!0,gap:2,id:t,"data-testid":n,"data-menuid":t,...s})}},55048:(e,t,n)=>{n.d(t,{A:()=>c});n(98992),n(54520);var r=n(96540),o=n(46587),s=n(24609),i=n(19186),a=n(81685),l=n(79022);const c=()=>{const e=(0,o.NJ)(),t=(0,s.vt)(),n=(0,i.ID)(),[,c]=(0,a.x)(),d=(0,r.useCallback)((()=>{const r=(0,l.l8)({userId:e,spaceId:t,roomId:n});return c(r),r}),[e,t,n,c]),u=(0,r.useCallback)((r=>{(0,l.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",s="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,s]},t.Ye=t.mw},60602:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(96540),o=n(68531);const s=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const[s,i]=(0,r.useState)(e);return(0,o.A)((()=>i(e)),t,[e,...n]),s}},63996:(e,t,n)=>{n.d(t,{t:()=>h});var r=n(96540),o=n(63766),s=n(45087),i=n(4719),a=n(549),l=n(75144),c=n(74848);const d=e=>{let{name:t,level:n,descendantIds:s,enableFavourites:i,ref:a,...l}=e;const d=(0,r.useMemo)((()=>Array.from(Array(n)).fill("-").join("")),[n]),u=(0,r.useMemo)((()=>i?`${d} ${t}`:t),[i,d,t]),h=(0,r.useMemo)((()=>({...!i||s?.length&&!l?.selfChartIds?.length?{}:{color:"primary"},...l})),[s,l]);return"string"===typeof t?(0,c.jsx)(o.Text,{strong:!0,ref:a,...h,children:u}):t||null},u=(0,a.A)((e=>{let{hasTooltip:t,hasInfo:n,...r}=e;return t&&n?(0,c.jsx)(s.A,{content:(0,c.jsx)(l.X,{id:r.id}),isBasic:!0,children:(0,c.jsx)(d,{...r})}):(0,c.jsx)(d,{...r})})),h=(0,i.aV)(u,(e=>{let{name:t,info:n,...r}=e;return{name:t,hasInfo:!!n,...r}}))},69001:(e,t,n)=>{n.d(t,{h:()=>s});var r=n(63766),o=n(74848);const s=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",s="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,s]},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),s=n(99728),i=n(24609),a=n(76571),l=n(56523),c=n(97926),d=n(17115),u=n(31246);const h=()=>{const{milestones:e,recordMilestones:t,markMilestonesSeen:n,settingsLoaded:h}=(0,l.A)(),x=(0,c.A)(),g=(0,d.Ay)(),m=(0,s.Sk)(),p=(0,d.Ex)(),f=(0,o.xd)("isLoaded"),j=(0,i.vt)(),b=(0,i.ap)("loaded"),v=(0,a.t5)(j,"channels"),y=(0,a.t5)(j,"loaded"),C=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:C},r=Object.entries(e.completed).reduce(((e,n)=>{let[r,o]=n;if(!o.completedAt||o.seenAt)return e;const s=((e,t)=>{let{segment:n,permissions:r,isLargeTeam:o,channelCount:s}=t;return(u.a7[e]||[]).filter((e=>!!e.segments.includes(n)&&!(e.permission&&!r[e.permission])&&!(e.requiresLargeTeam&&!o)&&!(void 0!==e.maxChannels&&s>e.maxChannels)))})(r,t);if(!s.length)return e;const i=o.tasks||{};return s.every((e=>i[e.id]))&&e.push(r),e}),[]);r.length&&n(r)}),[C,y,p,n,m,e.completed,g,h,b,f])}},75144:(e,t,n)=>{n.d(t,{X:()=>i});var r=n(4719),o=n(14963),s=n(74848);const i=(0,r.aV)((e=>e.children?(0,s.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),s=n(43375),i=n(67012),a=n(43305),l=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:C="vertical",maxRows:w=3e5,Container:I=a.A,onDragEnd:A,onDragCancel:k,containerId:S,itemProps:T,rearrangeable:F=!0,...M}=e;const N=(0,r.useRef)(),[L,$]=(0,r.useState)((()=>(0,l.oE)((0,l.Su)(g),C,b)));(0,i.A)((()=>{$((0,l.oE)((0,l.Su)(g),C,b))}),[b,t]);const[D,B]=(0,r.useState)(null),[P,R]=(0,r.useState)(null),O=(0,r.useRef)(null),{active:V}=(0,s.fF)();(0,s.E5)((0,r.useMemo)((()=>({onDragStart:e=>{let{active:t}=e;const{itemContainerId:n}=t.data.current||{};n===S&&(B((0,l.Su)(L)),R(L))},onDragMove:e=>{let{active:t,over:n}=e;R((e=>{const{isResizer:r,isContainer:o,itemId:s,itemContainerId:i}=t.data.current||{};if(o||i!==S)return e;const{initial:a,translated:d}=t.rect.current;let u=e;const h=(0,l.GN)(u,s);if(!h)return e;const x=n?.id;if(r){if(!x)return e;if(!d||!a)return e;const t=n.rect.width+(0,c.sd)(d.right-a.right),r=n.rect.height+(0,c.sd)(d.bottom-a.bottom);let{width:o,height:s}=(0,c.tr)({gutter:v,maxRows:w,gridTracks:b,rowHeight:j,containerWidth:f},t,r,h);return h.width===o&&h.height===s?e:(h.width=o,h.height=s,u=u.map((e=>e.id===h.id?{...h,width:o,height:s}:e)),u=(0,l.oE)(u,C,b),O.current=h,u)}if(!F)return e;const g=N.current.getBoundingClientRect();let{left:m,top:p}=(0,c.zA)({gutter:v,maxRows:w,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,l.Pe)(u,h,m,p,!0,!1,C,b,y),u=(0,l.oE)(u,C,b),O.current=h,u)}))},onDragEnd:e=>{let{active:t,over:n}=e;const{isResizer:r,isContainer:o,itemContainerId:s}=t.data.current;if(o||s!==S)return void R(null);const i=n?.id;if(r)return P&&$(P),R(null),void A(P,O.current);null!==i?(P&&$(P),R(null),A(P,O.current)):R(null)},onDragCancel:()=>{D&&$(D),O.current=null,B(null),R(null),k&&k()}})),[L,P]));const E=(0,l.Hp)(P||L),z=E*j+(E-1)*v+"px";return(0,u.jsxs)(I,{ref:N,style:{width:f,height:z},...M,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)(s.Hd,{adjustScale:!1,dropAnimation:h,zIndex:9999,children:V&&V.data.current.rootId===n&&V.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})(V.data.current):null}),document.body)]})}},81187:(e,t,n)=>{n.d(t,{A:()=>j});var r=n(96540),o=n(88934),s=n(34843),i=n(24609),a=n(41716),l=n(19186),c=n(67294),d=n(92726),u=n(14070),h=n(96859),x=n(51318),g=n(42318),m=n(43074),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,i.bq)(),b=(0,l.QW)(),{markTaskCompleted:v}=(0,f.A)(),{onIntegrationsClick:y}=(0,x.A)(),{setSearchTerm:C}=(0,g.A)(),{open:w}=(0,h.A)(),{handleOpenProfileModal:I}=(0,m.A)(),A=(0,s.Xr)(p.TZ),k=(0,a.s)("ids"),[,S]=(0,u.A)(),T=(0,c.q)(),F=(0,d.fz)(T?.[0],"slug"),M=(0,r.useCallback)((e=>t||!e.completed),[t]);return(0,r.useCallback)((t=>{let r={};if(t.openIntegrations)return e?.(),t.integrationsSearchTerm&&C(t.integrationsSearchTerm),y(),void(M(t)&&v(t.milestoneId,t.id));if(t.openAiPanel)return e?.(),w(),void(M(t)&&v(t.milestoneId,t.id));if(t.openProfileModal)return e?.(),I(t.openProfileModal),void(M(t)&&v(t.milestoneId,t.id));if(t.openFirstDashboard&&F){e?.();const r=`/spaces/${j}/rooms/${b}/dashboards/${F}`;return n(r),t.spotlight?void A({...t.spotlight,taskId:t.id,milestoneId:t.milestoneId,targetPath:r}):void(M(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 s=`${o}/${t.route}`;if(n(s,{state:r}),t.openFirstAlert&&k?.[0]&&S({alertId:k[0]}),t.spotlight)return void A({...t.spotlight,taskId:t.id,milestoneId:t.milestoneId,targetPath:s});M(t)&&v(t.milestoneId,t.id)}}),[e,n,j,b,v,y,C,w,I,A,k,S,F,M])}},82507:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(33185),o=n(74848);const s=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;}"]),i=e=>{let{withOuties:t=!0}=e;return(0,o.jsx)(s,{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",s="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,s]},t.PE=t.mw},90901:(e,t,n)=>{n.d(t,{I:()=>c,q:()=>l});n(98992),n(8872);var r=n(96540),o=n(88934),s=n(24013),i=n(19186);const a=(e,t)=>t?e[t]:e,l=e=>{const t=(0,s.BU)(),n=(0,s.Gt)(t);return(0,r.useMemo)((()=>n.reduce(((t,n)=>{const{capabilities:{ml:r}}=n;return r?.enabled?t.predicting=[...t.predicting,a(n,e)]:t.incapable=[...t.incapable,a(n,e)],t}),{predicting:[],incapable:[]})),[t.length,e])},c=e=>{const t=(0,o.Zp)(),n=(()=>{const e=(0,i.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),s=n(19075),i=n(2626),a=n(74848);const l=e=>{let{critical:t,warning:n,error:s,testPrefix:i,...l}=e;const c=(0,o.I)({error:s,testPrefix:i,flavour:t?"error":"disabledError",value:t}),d=(0,o.I)({error:s,testPrefix:i,flavour:n?"warning":"disabledWarning",value:n});return(0,a.jsx)(r.Flex,{...l,children:(0,a.jsx)(r.MasterCard,{"data-testid":"alertsMastercard",pillLeft:c,pillRight:d,size:"small"})})},c=e=>{let{id:t,testPrefix:n,...r}=e;const o=(0,i.Xt)(t),{critical:c,warning:d}=(0,s.AO)(o);return(0,a.jsx)(l,{"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),s=n(87083),i=n(41716),a=n(91100),l=n(74848);const c=e=>{let{critical:t,warning:n,error:r}=e;return(0,l.jsx)(a.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:s,warning:i}=(0,r.AO)(n);return(0,l.jsx)(c,{critical:s,warning:i})},u=()=>{const e=(0,s.w7)({emptyIfAll:!1}),t=(0,o.YS)(e),n=(0,i.s)("error"),{critical:a,warning:d}=(0,r.AO)(t);return(0,l.jsx)(c,{critical:a,warning:d,error:n})}},95836:(e,t,n)=>{n.d(t,{$:()=>u});var r=n(63766),o=n(45087),s=n(4719),i=n(549),a=n(27496),l=n(74848);const c=e=>{let{name:t,tiny:n,...o}=e;const s=n?r.Text:r.H3;return"string"===typeof t?(0,l.jsx)(s,{strong:!0,...o,children:t}):t||null},d=(0,i.A)((e=>{let{hasTooltip:t,hasInfo:n,...r}=e;return t&&n?(0,l.jsx)(o.A,{content:(0,l.jsx)(a.n,{id:r.id}),isBasic:!0,children:(0,l.jsx)(c,{...r})}):(0,l.jsx)(c,{...r})})),u=(0,s.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),s=n(42790),i=n(61841),a=n(24609),l=n(24013),c=n(19075),d=n(91421);const u=e=>{let{alertId:t,alertName:n,nodeIds:s=[]}=e;const a=(0,o.Zp)(),{setState:u}=(0,d.$h)(),[h]=(0,i.Ay)(),{name:x}=(0,c.JL)(t),g=n||x,{isParent:m}=(0,l.xY)(s[0]),{loaded:p,value:f,hasError:j,error:b}=(0,d.wd)({node:{value:s[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=>{s=e?Array.from(new Set([e,...s])):s,u({alertName:g,isAlert:!0}),y(!0,{nodeId:s[0]})}),[g,s,h,u,a]),error:b?.errorMessage||b}},h=()=>{const e=(0,o.Zp)(),{slug:t}=(0,a.ap)(),n=(0,s.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),s=n(83268),i=n(67294),a=n(24609),l=n(86706),c=n(76571),d=n(41258),u=n(31246);const h=()=>{const e=(0,s.nj)(),t=(0,s.CK)(),n=(0,o.s)("ids")||[],h=(0,o.s)("loaded"),x=(0,a.vt)();(0,d.A)(x);const g=(0,c.t5)(x,"channels"),m=(0,c.t5)(x,"loaded"),p=(0,l.Gi)(),f=(0,l.gk)(),j=(0,i.q)(),b=(0,i.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])}}}]);