MOON
Server: Apache
System: Linux server1.studioinfinity.com.br 2.6.32-954.3.5.lve1.4.90.el6.x86_64 #1 SMP Tue Feb 21 12:26:30 UTC 2023 x86_64
User: artinside (517)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/netdata/usr/local/share/netdata/web/v3/4424.8e61237a9c4e2fb30b7f.chunk.js
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"aeeb2702d6a0b41e7dabfc313b63e720f0845c35"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7346a71c-fe14-4f7e-b222-acd3372794ae",e._sentryDebugIdIdentifier="sentry-dbid-7346a71c-fe14-4f7e-b222-acd3372794ae")}catch(e){}}(),(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[4424],{79868(e,t,a){a.d(t,{D7:()=>s,Jp:()=>d,NT:()=>u,N_:()=>b,iS:()=>c,vE:()=>i,v_:()=>r,xI:()=>l,z6:()=>h});var n=a(51510),o=a(68978);const r=n.default.img.withConfig({displayName:"styled__Illustration",componentId:"sc-1yhntgl-0"})(["margin:0 auto;"]),s=(0,n.default)(o.Text).withConfig({displayName:"styled__StyledText",componentId:"sc-1yhntgl-1"})(["display:block;"]),d=n.default.div.withConfig({displayName:"styled__TextHeader",componentId:"sc-1yhntgl-2"})(["margin-bottom:",";font-weight:700;"],(0,o.getSizeBy)(2)),l=n.default.div.withConfig({displayName:"styled__StaticCheckmarks",componentId:"sc-1yhntgl-3"})(["margin-top:",";margin-bottom:",";"],(0,o.getSizeBy)(2),(0,o.getSizeBy)(5)),c=n.default.div.withConfig({displayName:"styled__CheckmarkLine",componentId:"sc-1yhntgl-4"})(["display:flex;align-items:center;"]),i=(0,n.default)(o.Icon).withConfig({displayName:"styled__StyledIcon",componentId:"sc-1yhntgl-5"})(["margin-right:4px;height:18px;> use{fill:",";}"],(0,o.getColor)("primary")),u=(0,n.default)(i).withConfig({displayName:"styled__HelpIcon",componentId:"sc-1yhntgl-6"})(["vertical-align:middle;"]),h=n.default.div.withConfig({displayName:"styled__LearnMoreSection",componentId:"sc-1yhntgl-7"})(["margin-top:",";"],(0,o.getSizeBy)(4)),b=n.default.a.withConfig({displayName:"styled__Link",componentId:"sc-1yhntgl-8"})(["text-decoration:underline;color:",";&:visited{color:",";}"],(0,o.getColor)("success"),(0,o.getColor)("success"))},40910(e,t,a){a.d(t,{J:()=>Ze,A:()=>$e});a(62953);var n=a(96540),o=a(98591),r=a(85660),s=a(92726),d=a(57068),l=a(6393),c=a(19186),i=a(87083),u=a(24013),h=a(64467),b=a(80045),g=(a(98992),a(54520),a(3949),a(68978)),p=a(82418),m=a(74848);const f=["compact"];function x(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function j(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?x(Object(a),!0).forEach((function(t){(0,h.A)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):x(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}const y=e=>{let{compact:t}=e,a=(0,b.A)(e,f);const[,n]=(0,o.A)("addChartModal"),r=(0,u.TG)().length>0;return(0,m.jsxs)(g.Flex,j(j({column:!0,alignItems:"center",justifyContent:"center",overflow:{vertical:"auto"},flex:!0,basis:0,"data-testid":"dashboardBlankSlate"},a),{},{children:[!t&&(0,m.jsx)(g.Flex,{as:"img",src:p.$,height:"35%"}),(0,m.jsx)(g.H3,{margin:[6,0,2],children:"Empty Dashboard"}),r?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(g.Text,{textAlign:"center",children:"Let\u2019s fill your dashboard."}),(0,m.jsx)(g.Text,{textAlign:"center",children:"Go to a node view or node list and add one chart to this Dashboard or just use"})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(g.Text,{textAlign:"center",children:"You don't have any available node to retrieve charts from."}),(0,m.jsx)(g.Text,{textAlign:"center",children:"Please verify your nodes' state and/or connect a new node to Netdata"})]}),!t&&(0,m.jsx)(g.Button,{margin:[8,0,0,0],onClick:n,disabled:!r,label:"Add chart","data-testid":"dashboardBlankSlate-addChart"})]}))};a(26910),a(72577),a(81454);var v=a(32788),O=a(29263),C=a(47410),w=a(10602),A=a(25291),k=a(24582),I=a(23226),D=a(24609),S=a(5907),T=a(21e3),P=a(87733),N=a(67012),_=a(28657),F=a(19371),M=a(13752),E=a(92815),L=a(72582),B=a(78072),z=a(91832),R=a(23565),U=a(52795),H=a(54251),V=a(45087);const G=()=>(0,m.jsxs)(g.Flex,{column:!0,width:"300px",gap:1,children:[(0,m.jsx)(g.TextSmall,{strong:!0,children:"Not finding a chart?"}),(0,m.jsxs)(g.TextSmall,{children:["When selecting",(0,m.jsx)(g.TextSmall,{strong:!0,margin:[0,1],children:"All Nodes"}),"you search and add charts using their context. The outcome will be a composite chart over All Nodes, like on the Overview tab."]}),(0,m.jsxs)(g.TextSmall,{children:["When you select a",(0,m.jsx)(g.TextSmall,{strong:!0,margin:[0,1],children:"specific Node"}),"you search and add charts using their name. The result is a specific chart over the node selected, like on Single Node tab."]})]}),K=()=>(0,m.jsx)(V.A,{isBasic:!0,plain:!0,content:G,align:"bottom",children:(0,m.jsx)(g.Icon,{name:"question",color:"textDescription",size:"small"})});function Y(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function J(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(a),!0).forEach((function(t){(0,h.A)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Y(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}const W=e=>{let{spaceId:t,roomId:a,value:o,onChange:r,options:s,testid:d,selectedNodeIds:l}=e;const[c,i]=(0,n.useState)(),u=null===o||void 0===o?void 0:o.value,h=(0,F.eg)(),b=(0,k.R7)(u&&a,u),p=(0,R.CS)({type:"chart",entity:u,path:"/"}),f=(0,P.K)({spaceId:t,roomId:a}),x=(0,n.useMemo)((()=>{h.getNodes({id:"newDashboardChart"}).forEach((e=>e.destroy()));const{info:e,valueRange:t,height:n,colors:o}=(0,T.Ay)(b),r=h.makeChart({attributes:J(J({id:"newDashboardChart",contextScope:[u],host:f,roomId:a,info:e,valueRange:t,height:n+207,enabledNavigation:!1,nodesScope:l},o&&{colors:o}),{},{toolboxElements:[B.default,L.default,M.default,E.default,z.A]})});h.getRoot().appendChild(r),i((0,U.A)(r.getAttributes()));const s=r.getAttribute("chartLibrary");return r.setAttributes(J(J({},c),(0,U.A)(p,!0))),(0,H.A)(r,s,r.getAttribute("chartLibrary")),r}),[h,u]);return(0,N.A)((()=>{if(!x||!p)return;const e=x.getAttribute("chartLibrary");x.updateAttributes(J(J({},c),(0,U.A)(p,!0))),(0,H.A)(x,e,x.getAttribute("chartLibrary")),x.trigger("fetch")}),[x,a,u,p,c]),(0,n.useLayoutEffect)((()=>()=>x.destroy()),[]),(0,m.jsxs)(g.Flex,{gap:6,column:!0,children:[(0,m.jsxs)(g.Flex,{gap:2,column:!0,"data-testid":d,children:[(0,m.jsxs)(g.Flex,{gap:2,children:[(0,m.jsx)(g.H5,{children:"Chart context"}),(0,m.jsx)(K,{})]}),(0,m.jsx)(g.Select,{options:s,value:o,onChange:r,isClearable:!0,form:d})]}),o&&(0,m.jsx)(g.Flex,{height:{min:"320px"},column:!0,children:(0,m.jsx)(_.A,{chart:x,margin:[2,0,0]})})]})};var q=a(43116);const X={label:"All Nodes",value:"all-nodes"},Z={label:"All Nodes (no reachable nodes)",value:"all-nodes",isDisabled:!0},$=e=>{let{id:t,isLive:a,nodeStatus:n,name:o}=e;return{label:a?o:"".concat(o," (").concat(n,")"),value:t,isDisabled:!a}},Q=e=>({value:e,label:e}),ee=e=>{let{id:t,onClose:a}=e;const o=(0,D.vt)(),r=(0,c.ID)(),d=(0,s.fz)(t,"name"),l=(0,c.XA)("name"),i=(0,w.CK)(),h=(0,u.BU)().length>0,b=(0,w.nj)(),p=(0,u.Gt)(i),f=(0,S.nM)(t),x=h?X:Z,[j,y]=(0,n.useState)(x.value),[T,P]=(0,n.useState)(null),N=(0,n.useMemo)((()=>[x,...p.map($)]),[p]),_=(0,n.useMemo)((()=>N.find((e=>{let{value:t}=e;return t===j}))),[N,j]),M=(0,n.useCallback)((e=>{y((null===e||void 0===e?void 0:e.value)||x.value),P(null)}),[]),E=(0,n.useMemo)((()=>j===x.value?[]:[j]),[j]),L=(0,A.A)(r,E,{spaceId:o}),B=(0,k.R7)(r),z=(0,n.useMemo)((()=>Object.keys(B).sort(((e,t)=>e.localeCompare(t,void 0,{sensitivity:"accent",ignorePunctuation:!0}))).map(Q)),[B]);(0,n.useEffect)((()=>{z.length&&_&&P((e=>e||z[0].value))}),[T,z,_]);const R=(0,n.useMemo)((()=>T&&Q(T)),[T]),H=(0,n.useCallback)((e=>P(null===e||void 0===e?void 0:e.value)),[]),V=B[T],G=(0,F.eg)(),K=(0,n.useCallback)((()=>{const e=G.getNode({id:"newDashboardChart"}),t=(0,U.h)(e.getAttributes());f(t.contextScope,t,(()=>setTimeout(a)))}),[j,V]),Y=!T,[,J]=(0,I.A)();return(0,n.useEffect)((()=>(J(!0),()=>J(!1)))),(0,m.jsx)(v.GO,{onClose:a,children:L?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(O.z,{onClose:a,title:"Add Chart to Dashboard"}),(0,m.jsx)(v.Yv,{height:"100%",padding:[0,8],children:(0,m.jsx)(q.A,{error:L})})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(O.z,{onClose:a,title:"Add Chart to Dashboard",children:(0,m.jsx)(g.Button,{label:"Add chart",icon:"plus",onClick:K,disabled:Y,"data-testid":"addChartModal-addChart-button"})}),(0,m.jsxs)(C.U,{children:["Add Charts to ",d]}),(0,m.jsx)(v.Yv,{overflow:"visible",children:(0,m.jsxs)(g.Flex,{gap:6,column:!0,children:[(0,m.jsxs)(g.Flex,{gap:2,column:!0,"data-testid":"addChartModal-selectNodes",children:[(0,m.jsxs)(g.H5,{children:["Nodes in ",l]}),(0,m.jsx)(g.Select,{options:N,value:_,onChange:M,isLoading:!b,isClearable:!0,form:"addChartModal-selectNodes"})]}),R&&(0,m.jsx)(W,{id:t,spaceId:o,roomId:r,value:R,onChange:H,options:z,testid:"addChartModal-selectChart",selectedNodeIds:E})]})})]})})};var te=a(88255),ae=a(65380),ne=a(42790),oe=a(39906),re=a(60908),se=(a(8872),a(85163)),de=a(71123);function le(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function ce(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?le(Object(a),!0).forEach((function(t){(0,h.A)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):le(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}const ie=function(e,t){let{containerIds:a,containers:n,layout:o}=e,{extraKey:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s={},d=a.reduce(((e,a)=>{const d=(0,de.bj)(o[a],"vertical");return e[a]=ce(ce({},n[a]),{},{level:0,id:a,subMenuIds:d.reduce(((e,n)=>{let{id:o}=n;return"text"!==t(o).type&&e.push("".concat(a,"|").concat(o)),e}),[]),subMenuChartIds:[],link:"".concat((0,se.A)("menu_".concat(a))),forceVisibility:!0,arFlavour:"anomaly",extraKey:r}),d.forEach((e=>{const n="".concat(a,"|").concat(e.id),o=t(e.id);"text"!==o.type&&(s[n]={name:o.title,level:1,id:n,menuId:a,chartIds:[],link:"".concat((0,se.A)("menu_".concat(a,"_submenu_").concat(n))),arFlavour:"anomaly",showAR:!1,extraKey:r})})),e}),{});return{menuIds:a,menuById:d,subMenuById:s}};var ue=a(74518);const he=e=>{let{id:t}=e;const a=(0,s.fz)(t,"name");return(0,m.jsx)(ue.A,{TextComponent:g.H0,text:a})};var be=a(99728);const ge=()=>{const[,e]=(0,o.A)("addChartModal"),t=(0,be.JT)("dashboard:Update");return(0,u.TG)().length>0?(0,m.jsx)(g.Button,{neutral:!0,flavour:"hollow",label:"Add chart",icon:"chart_added",onClick:e,"data-testid":"dashboardHeaderActionBar-addChart-button","data-ga":"action-bar::click-add-chart::cust-dashboard",disabled:!t}):null},pe=e=>{let{id:t}=e;const a=(0,S.Kv)(t),n=(0,be.JT)("dashboard:Update");return(0,m.jsx)(g.Button,{neutral:!0,flavour:"hollow",label:"Add text",icon:"text_add",onClick:a,"data-testid":"dashboardHeaderActionBar-addText-button","data-ga":"action-bar::click-add-text::cust-dashboard",disabled:!n})};var me=a(63872),fe=a(28864),xe=a(51571);const je=e=>{let{id:t}=e;const[,a]=(0,me.A)(),n=(0,fe.DH)(t,{onFail:a}),o=(0,s.fz)(t,"processing"),r=(0,s.fz)(t,"isOwner"),d=(0,s.zN)(t);return(0,m.jsx)(xe.A,{permission:r?"dashboard:UpdateSelf":"dashboard:Update",flavour:"hollow",label:"Save",icon:"save",onClick:()=>n(),disabled:d,isLoading:o,"data-testid":"dashboardHeaderActionBar-save-button","data-ga":"action-bar::click-save::cust-dashboard"})},ye=["id"];function ve(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function Oe(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(a),!0).forEach((function(t){(0,h.A)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ve(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}const Ce=e=>{let{id:t}=e,a=(0,b.A)(e,ye);const[o,r]=(0,s.TN)({id:t,key:"respectNodesScope"}),d=(0,fe.DH)(t),l=(0,n.useCallback)((()=>{r(!o),d()}),[o,r]);return(0,m.jsx)(g.Toggle,Oe(Oe({},a),{},{colored:!0,onChange:l,checked:!o,margin:[0],labelRight:"Apply global filters"}))};a(27495),a(48408);var we=a(67916),Ae=a(12273),ke=a(81214);const Ie=e=>{let{dashboardId:t,spaceId:a,roomId:o,onClose:r}=e;const[s,d]=(0,n.useState)(!1),[l,c]=(0,n.useState)(null),[i,u]=(0,n.useState)(!1),[{after:h,before:b}]=(0,ne.N9)();return(0,m.jsx)(g.Modal,{backdropProps:{backdropBlur:!0},onClickOutside:r,onEsc:r,children:(0,m.jsxs)(g.ModalContent,{width:"600px",children:[(0,m.jsxs)(g.ModalHeader,{children:["TV Mode URL",(0,m.jsx)(g.ModalCloseButton,{onClose:r})]}),(0,m.jsx)(g.ModalBody,{column:!0,gap:4,children:l?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Ae.FU,{children:l}),(0,m.jsxs)(g.Flex,{alignItems:"center",background:"warningBackground",gap:4,padding:[3,3],round:!0,children:[(0,m.jsx)(g.Text,{color:"warning",children:"\u26a0\ufe0f"}),(0,m.jsx)(g.Text,{children:"This URL contains a unique access token. Keep it secure and only share with trusted users."})]})]}):(0,m.jsx)(g.Text,{children:"Generate a shareable TV mode URL for this dashboard. A new access token will be created automatically."})}),(0,m.jsxs)(g.ModalFooter,{gap:2,children:[(0,m.jsx)(g.Button,{flavour:"hollow",onClick:r,children:"Cancel"}),l?(0,m.jsx)(g.Button,{onClick:async()=>{if(l)try{await(0,ke.A)(l)&&(u(!0),setTimeout((()=>u(!1)),2e3))}catch(e){console.error("Failed to copy URL:",e)}},children:i?"Copied!":"Copy URL"}):(0,m.jsx)(g.Button,{onClick:async()=>{d(!0);try{const e=function(e,t,a,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;const s=window.location.origin,d=new URLSearchParams(location.search).get("agent"),l=d?"&agent=".concat(d):"";return"".concat(s,"/webviews/dashboards/").concat(t,"?space_id=").concat(a,"&room_id=").concat(n).concat(l,"#token=").concat(e,"&after=").concat(o,"&before=").concat(r)}((await(0,we.Ey)({description:"TV Mode - Dashboard ".concat(t),scope:"scope:all"})).data.token,t,a,o,h,b);c(e)}catch(e){console.error("Failed to create token:",e)}finally{d(!1)}},disabled:s,children:s?"Generating...":"Generate a new URL"})]})]})})};var De=a(46587);const Se=(0,a(74891).A)(g.Button),Te=e=>{let{dashboardId:t,spaceId:a,roomId:o}=e;const r=(0,De.uW)("isAnonymous"),[s,d]=(0,n.useState)(!1),l=(0,n.useMemo)((()=>r?"Sign in first to generate a TV mode URL":"Generate TV Mode URL"),[r]);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Se,{flavour:"hollow",icon:"monitoring",tooltip:l,onClick:()=>d(!0),"data-testid":"tv-button",textTransform:"none",disabled:r,noWrapper:!0,children:"TV mode"}),s&&(0,m.jsx)(Ie,{dashboardId:t,spaceId:a,roomId:o,onClose:()=>d(!1)})]})},Pe=e=>{let{id:t}=e;const{spaceId:a,roomId:n}=(0,s.fz)(t);return(0,m.jsxs)(g.Flex,{gap:2,children:[(0,m.jsx)(Ce,{id:t}),(0,m.jsx)(ge,{}),(0,m.jsx)(pe,{id:t}),(0,m.jsx)(je,{id:t}),(0,m.jsx)(Te,{dashboardId:t,spaceId:a,roomId:n})]})},Ne=(0,n.memo)(Pe);var _e=a(35570),Fe=a(64981),Me=a(6304),Ee=a(39175),Le=a(16866),Be=a(1817),ze=a(44245),Re=a(38757),Ue=a(79868);const He=e=>{let{close:t}=e;const[a,o]=(0,n.useState)(!0),r=(0,s.zi)(),[d,l]=(0,s.TN)({id:r,key:"name"}),i=(0,s.oj)("slug"),u=(0,Be.A)(i),[h,b]=(0,n.useState)(d),f=(0,fe.DH)(r),x=(0,ze.DF)(),j=(0,_e.Zp)(),y=(0,c.r9)(),w=h.length>0,A=a&&w&&h!==d,k=(0,n.useCallback)((()=>{l(h),f().then((e=>{let{data:a}=e;const{slug:n}=a;if(u===n)return void t();const o="".concat(y,"/dashboards/").concat(n);x({id:r,slug:n,path:o}),j(o,{replace:!0}),t()}))}),[t,h,r,y,u]);return(0,m.jsxs)(v.GO,{onClose:t,"data-testid":"renameDashboard-modal",children:[(0,m.jsx)(O.z,{onClose:t,title:"Rename Dashboard",children:(0,m.jsx)(g.Button,{label:"Save Changes",onClick:k,disabled:!A})}),(0,m.jsxs)(C.U,{"data-testid":"renameDashboard-title",children:["Rename dashboard ",d]}),(0,m.jsxs)(v.Yv,{children:[(0,m.jsx)(Re.A,{value:h,label:"Name",onChange:e=>{b(e.target.value)},isValid:a,setIsValid:o,isDirty:w,instantFeedback:"all",onKeyDown:e=>e.keyCode===Le.I7&&A&&k(),"data-testid":"renameDashboard-input"}),(0,m.jsxs)(g.Flex,{column:!0,justifyContent:"between",height:"100%",margin:[8,0,16],"data-testid":"renameDashboard-learnMoreSection",children:[(0,m.jsxs)(Ue.z6,{children:[(0,m.jsx)(Ue.NT,{name:"help"}),(0,m.jsx)(g.Text,{children:"Learn more about Dashboards"})," ",(0,m.jsx)(Ue.N_,{href:"https://learn.netdata.cloud/docs/dashboards-and-charts/",target:"_blank",rel:"noopener noreferrer",children:"In our documentation"})]}),(0,m.jsx)(Ue.v_,{src:p.$})]})]})]})},Ve=()=>{const e=(0,_e.Zp)(),t=(0,D.bq)(),a=(0,c.QW)(),o=(0,s.zi)(),{name:r}=(0,s.fz)(o),d=(0,c.XA)("name"),[l,,i,u]=(0,Me.A)(),[h,,b,p]=(0,Me.A)(),f=(0,n.useCallback)((()=>{e("/spaces/".concat(t,"/rooms/").concat(a,"/dashboards"))}),[t,a]),x=(0,S.A_)(o,{onSuccess:f}),j=(0,be.JT)("dashboard:Update"),y=(0,be.JT)("dashboard:Delete")&&o!==Ee.LA;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Fe.A,{category:"dashboard",context:"title",testId:"dashboardDropdown",children:e=>{let{close:t}=e;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Fe.t,{icon:"pencilOutline",onClick:()=>{t(),b()},"data-testid":"renameDashboard-option","data-ga":"dropdown-item::click-rename-dashboard::cust-dashboard",disabled:!j,children:"Rename Dashboard"}),(0,m.jsx)(Fe.t,{icon:"trashcan",color:"errorText",onClick:()=>{t(),i()},"data-testid":"removeDashboard-option","data-ga":"dropdown-item::click-remove-dashboard::cust-dashboard",disabled:!y,children:"Delete Dashboard"})]})}}),h&&(0,m.jsx)(He,{close:p}),l&&(0,m.jsx)(g.ConfirmationDialog,{confirmLabel:"Yes, delete","data-ga":"delete-dashboard-dialog","data-testid":"deleteDashboardDialog",handleConfirm:x,handleDecline:u,message:(0,m.jsxs)(m.Fragment,{children:["You are about to delete ",(0,m.jsx)("strong",{children:r})," from ",(0,m.jsx)("strong",{children:d}),".",(0,m.jsx)("br",{}),"Are you sure you want to continue?"]}),title:"Delete ".concat(r)})]})},Ge=e=>{let{id:t}=e;return(0,m.jsxs)(g.Flex,{justifyContent:"between",padding:[3],"data-testid":"dashboardHeader",children:[(0,m.jsxs)(g.Flex,{alignItems:"center",children:[(0,m.jsx)(Ve,{}),(0,m.jsx)(he,{id:t})]}),(0,m.jsx)(Ne,{id:t})]})},Ke=(0,n.memo)(Ge);var Ye=a(97799);function Je(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function We(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?Je(Object(a),!0).forEach((function(t){(0,h.A)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Je(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}const qe=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];!function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{navigator:a}=(0,n.useContext)(_e._3),o=(0,_e.zy)();(0,n.useEffect)((()=>{if(!t)return;const n=a.block((t=>{const a=We(We({},t),{},{retry(){n(),t.retry()}});e(a)}));return n}),[a,e,t,o])}((0,n.useCallback)((t=>{"REPLACE"!==t.action?window.confirm(e)&&t.retry():t.retry()}),[e]),t)},Xe=()=>((0,ae.A)(),null),Ze=(0,n.memo)((e=>{let{id:t,roomId:a,nodeIds:n=[],isOnTV:c}=e;const[i,,,u]=(0,o.A)("addChartModal"),{fullyLoaded:h,cardIds:b,name:g}=(0,s.fz)(t);(e=>{const t=(0,s.zN)(e);qe("Are you sure you want to leave this dashboard?\nChanges will be lost.",!t)})(t);const[p,{width:f}]=(0,r.A)(),[x,j]=(0,ne.N9)("chartName",{key:a,extraKey:t,flavour:"val"}),v=(0,d.Xc)(t),O=(0,l.T6)(t);return(0,m.jsx)(re.Ay,{feature:"custom-dashboard",children:(0,m.jsxs)(oe.A,{getObject:O,ids:v,getMenu:ie,extraKey:t,children:[(0,m.jsx)(Xe,{}),(0,m.jsxs)(te.A,{ref:p,overflow:"hidden",background:"mainBackground",children:[!c&&(0,m.jsx)(Ke,{id:t}),h&&b.length>0&&(0,m.jsx)(Ye.A,{id:t,containerWidth:f,initialChartName:x,onChartNameChange:j,isOnTV:c}),h&&0===b.length&&!c&&(0,m.jsx)(y,{}),i&&!c&&(0,m.jsx)(ee,{id:t,onClose:u})]})]})})})),$e=(0,n.memo)((e=>{let{id:t,isOnTV:a}=e;const n=(0,c.ID)(),o=(0,i.w7)({extraKey:"dashboard",merge:!1,scoped:!0}),r=(0,u.TG)(o);return(0,m.jsx)(Ze,{id:t,roomId:n,nodeIds:r,isOnTV:a})}))},1623(e,t,a){a.d(t,{A:()=>r});var n=a(63474),o=a(74848);const r=()=>(0,o.jsx)(n.O2,{"data-testid":"dashboardLoading"})}}]);