File: //opt/netdata/usr/share/netdata/web/v3/3677.ac284ac96be17d6ecca0.chunk.js
try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},o=(new e.Error).stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="b27208b1-1571-443f-8ac3-6657b7b8beef",e._sentryDebugIdIdentifier="sentry-dbid-b27208b1-1571-443f-8ac3-6657b7b8beef")}()}catch(e){}!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"6373460e5f04bd73e55c202d3cf288663eaae34a"}}catch(e){}}(),(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[3677,5187],{23677:(e,o,t)=>{t.r(o),t.d(o,{default:()=>io});var n=t(96540),l=t(92415),a=t(24285),s=t(33185),r=t(88934),i=t(92318),c=t(6304),d=t(32742),u=t(70140),g=(t(98992),t(81454),t(24655)),h=t(24609),p=t(74848);const x=e=>{let{spaceIds:o,colors:t}=e;const n=(0,h.vt)();return(0,p.jsx)(l.Flex,{width:"100%",column:!0,alignItems:"center","data-testid":"workspaceBar-spacesList",overflow:{vertical:"auto"},children:o.map((e=>{const o=t?.[e];return(0,p.jsx)(g.A,{testIdPrefix:"workspaceBar-space",spaceId:e,active:e===n,backgroundColor:o},e)}))})};var C=t(64156),m=t(63872);const b=()=>{const e=(0,n.useRef)(),[o,,t,l]=(0,c.A)(),[s,r]=(0,a.tF)("spacesList"),i=(0,u.A)(),[d,g]=(0,n.useState)(i),[h,,p,x]=(0,c.A)(),[C]=(0,m.A)(),b=(0,n.useCallback)((e=>{g((o=>({...o,spaceIds:e})))}),[g]),j=(0,n.useCallback)((e=>{let{id:o,color:t}=e;g((e=>({...e,colors:{...e.colors,[o]:t}})))}),[g]),f=(0,n.useCallback)((e=>{g((o=>({...o,colors:{...o.colors,[e]:i.colors?.[e]}})))}),[i,g]),v=(0,n.useCallback)((e=>{g((o=>({...o,colors:{...o.colors,[e]:void 0}})))}),[g]),k=(0,n.useCallback)((e=>{t(),r(d),l(),x(),C({header:"Success",text:"Your changes have been successfully saved."}),"function"===typeof e&&e()}),[d,r,x,C,t,l]),w=(0,n.useMemo)((()=>!!s),[s]),I=(0,n.useCallback)((()=>{t(),r(null),l(),C({header:"Success",text:"All settings have been successfully deleted."})}),[r,t,l]),y=(0,n.useCallback)((()=>{g(i),x()}),[i,g,x]);return(0,n.useEffect)((()=>{g(i)}),[i,g]),(0,n.useEffect)((()=>(e.current=Date.now(),()=>{e.current=0})),[]),(0,n.useEffect)((()=>{Date.now()-e.current>500&&p()}),[d,e]),{state:d,onOrderChange:b,onColorChange:j,onColorReset:f,onColorClear:v,onSave:k,onDelete:I,onReset:y,canDelete:w,isDirty:h,loading:o}};var j=t(43375),f=t(43627),v=t(74979),k=t(7542);const w=(0,s.default)(l.Flex).attrs((e=>({width:7,height:7,round:!0,border:{side:"all",color:"border"},cursor:"pointer",alignItems:"center",justifyContent:"center",...e}))).withConfig({displayName:"styled__StyledColorBox",componentId:"sc-1iqu0oz-0"})(["background-color:",";"],(e=>e.background)),I=(0,s.default)(l.Icon).attrs((e=>({color:(0,k.T4)(e.backgroundColor)?["neutral","black"]:["neutral","white"],...e}))).withConfig({displayName:"styled__StyledIcon",componentId:"sc-1iqu0oz-1"})([""]);var y=t(45087);t(8872);const A={green:["green50","green100","green150","green180"],red:["red50","red100","red150","red180"],yellow:["yellow50","yellow100","yellow150","yellow180"],blue:["blue50","blue100","blue150","blue180"],purple:["purple50","purple100","purple150","purple180"],violet:["violet50","violet100","violet150","violet180"]};var S=t(74891);const F=(0,S.A)(w),R=e=>{let{value:o,theme:t,onChange:a}=e;const s=(0,n.useMemo)((()=>Object.entries(A).reduce(((e,o)=>{let[n,a]=o;return[...e,...a.map((e=>(0,l.getColor)([n,e])({theme:t})))]}),[])),[t]),r=(0,n.useCallback)((()=>{const e=Math.floor(Math.random()*s.length-1),o=s[e];a({target:{value:o}})}),[s,a]);return(0,p.jsx)(F,{border:"none",background:o,onClick:r,tooltip:"Change to random color",children:(0,p.jsx)(I,{name:"refresh",backgroundColor:o})})},B=(0,n.memo)(R),T=e=>{let{theme:o,onChange:t}=e;return(0,p.jsx)(l.Flex,{gap:2,children:Object.entries(A).map((e=>{let[n,a]=e;return(0,p.jsx)(l.Flex,{column:!0,gap:2,children:a.map((e=>{const a=(0,l.getColor)([n,e])({theme:o});return(0,p.jsx)(w,{border:"none",background:a,onClick:()=>t({target:{value:a}})},e)}))},n)}))})},D=(0,n.memo)(T),P=e=>{let{value:o,onChange:t}=e;const a=(0,s.useTheme)(),[r,i]=(0,n.useState)();return(0,n.useEffect)((()=>{i((0,k.Bi)(o)?null:"Invalid color value.")}),[o]),(0,p.jsxs)(l.Flex,{column:!0,gap:2,padding:[4],children:[(0,p.jsxs)(l.Flex,{gap:2,children:[(0,p.jsx)(B,{value:o,theme:a,onChange:t}),(0,p.jsx)(l.TextInput,{height:7,value:o,onChange:t,error:r})]}),(0,p.jsx)(l.TextSmall,{children:"Choose from default colors."}),(0,p.jsx)(D,{theme:a,onChange:t})]})},M=e=>{let{value:o,tooltip:t,onChange:a}=e;const s=(0,n.useRef)(),[r,i,,d]=(0,c.A)(!1);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(y.A,{align:"bottom",content:t,children:(0,p.jsx)(l.Flex,{ref:s,children:(0,p.jsx)(w,{background:o,onClick:i})})}),s.current&&r?(0,p.jsx)(l.Drop,{width:60,target:s.current,align:{top:"bottom",right:"right"},background:"modalBackground",margin:[2,0,0],round:!0,onClickOutside:d,onEsc:d,children:(0,p.jsx)(P,{value:o,onChange:a})}):null]})},_=e=>{let{value:o,onChange:t}=e;const l=(0,s.useTheme)(),a=(0,n.useMemo)((()=>l?.colors?.spaceIdle),[l]);return(0,p.jsx)(M,{value:o||a,onChange:t,tooltip:"Change color"})},O=e=>{let{id:o,color:t,onColorChange:l,onColorReset:a,onColorClear:s}=e;const r=(0,u.A)(),i=(0,n.useMemo)((()=>r.colors?.[o]!=t),[r,t]),c=(0,n.useCallback)((e=>{l({id:o,color:e.target.value})}),[o,l]),d=(0,n.useCallback)((()=>{a(o)}),[o,a]),g=(0,n.useCallback)((()=>{s(o)}),[o,s]);return{isDirty:i,hasColor:!!t,onChange:c,onReset:d,onClear:g}},N=(0,S.A)(l.Icon),E=e=>{let{id:o,color:t,onColorChange:n,onColorReset:a,onColorClear:s}=e;const{attributes:r,listeners:i,setNodeRef:c,transform:d,transition:u}=(0,f.gl)({id:o}),g={transform:v.Ks.Transform.toString(d),transition:u},{name:x}=(0,h.ns)(o),{isDirty:C,hasColor:m,onChange:b,onReset:j,onClear:k}=O({id:o,color:t,onColorChange:n,onColorReset:a,onColorClear:s});return(0,p.jsx)("div",{ref:c,style:g,...r,children:(0,p.jsxs)(l.Flex,{gap:1,alignItems:"center",children:[(0,p.jsx)(l.Icon,{name:"nav_dots",color:"textLite",...i,cursor:"grab"}),(0,p.jsx)(_,{value:t,onChange:b}),(0,p.jsx)(l.TextBig,{padding:[0,0,0,2],children:x}),C?(0,p.jsx)(N,{name:"reload",color:"text",cursor:"pointer",onClick:j,tooltip:"Reset background color to previous value",noWrapper:!0}):null,m?(0,p.jsx)(N,{name:"x",color:"text",cursor:"pointer",onClick:k,tooltip:"Remove background color",noWrapper:!0}):null]},o)})},H=e=>{let{spaceIds:o,colors:t,onOrderChange:l,onColorChange:a,onColorReset:s,onColorClear:r}=e;const[i,c]=(0,n.useState)(o),d=(0,j.FR)((0,j.MS)(j.AN),(0,j.MS)(j.uN,{coordinateGetter:f.JR})),u=(0,n.useCallback)((e=>{const{active:o,over:t}=e;o?.id&&t?.id&&o.id!==t.id&&c((e=>{const n=e.indexOf(o.id),l=e.indexOf(t.id);return(0,f.be)(e,n,l)}))}),[f.be,c]);return(0,n.useEffect)((()=>{c(o)}),[o,c]),(0,n.useEffect)((()=>{l(i)}),[i,l]),(0,p.jsx)(j.Mp,{sensors:d,collisionDetection:j.fp,onDragEnd:u,children:(0,p.jsx)(f.gB,{items:i,strategy:f._G,children:i.map((e=>(0,p.jsx)(E,{id:e,color:t?.[e],onColorChange:a,onColorReset:s,onColorClear:r},e)))})})},L=e=>{let{spaceIds:o,colors:t,onOrderChange:n,onColorChange:a,onColorReset:s,onColorClear:r}=e;return(0,p.jsxs)(l.Flex,{column:!0,gap:4,children:[(0,p.jsx)(l.Text,{children:"Reorder spaces by dragging and customize their colors using the color picker."}),(0,p.jsx)(l.Flex,{column:!0,gap:4,children:(0,p.jsx)(H,{spaceIds:o,colors:t,onOrderChange:n,onColorChange:a,onColorReset:s,onColorClear:r})})]})},z="closeModal",W="deleteSettings",U=()=>(0,p.jsxs)(l.Flex,{column:!0,gap:2,children:[(0,p.jsx)(l.Text,{children:"There are some unsaved changes that will be lost after closing the modal window."}),(0,p.jsx)(l.Text,{children:"Are you sure you want to colse without saving your changes?"})]}),G=()=>(0,p.jsxs)(l.Flex,{column:!0,gap:2,children:[(0,p.jsx)(l.Text,{children:"You are about to delete all previously saved settings. This action cannot be reverted."}),(0,p.jsx)(l.Text,{children:"Are you sure you want to continue?"})]}),Y={[z]:{title:"Close modal",confirmLabel:"Close without saving",message:(0,p.jsx)(U,{})},[W]:{title:"Delete settings",confirmLabel:"Yes, delete settings",message:(0,p.jsx)(G,{})}},q=e=>{let{flavour:o,handleConfirm:t,handleDecline:a}=e;const s=(0,n.useMemo)((()=>Y[o]),[o]);return(0,p.jsx)(l.ConfirmationDialog,{"data-testid":"spacesListDialog",handleConfirm:t,handleDecline:a,...s})},J=(0,S.A)(l.Button),V=e=>{let{onClose:o}=e;const{state:t,onOrderChange:a,onColorChange:s,onColorReset:r,onColorClear:i,onSave:c,onDelete:d,onReset:u,canDelete:g,isDirty:h,loading:x}=b(),{spaceIds:m,colors:j}=t||{},f=(0,C.A)("(max-width: 767px)"),v=x,[k,w]=(0,n.useState)(),I=(0,n.useCallback)((()=>w()),[w]),y=(0,n.useMemo)((()=>({width:f?"90vw":{min:"400px",base:"30vw"},height:f?"90vh":{max:"90vh"}})),[f]),A=(0,n.useCallback)((()=>{h?w(z):o()}),[h,w,o]),S=(0,n.useCallback)((()=>{w(W)}),[w]),F=(0,n.useCallback)((()=>{if(k===z)return I(),void o();k===W&&(d(),o())}),[k,o,I]),R=(0,n.useCallback)((()=>{c(o)}),[c]);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(l.Modal,{backdropProps:{backdropBlur:!0},onEsc:A,children:(0,p.jsxs)(l.ModalContent,{...y,children:[(0,p.jsxs)(l.ModalHeader,{justifyContent:"between",padding:[4],round:!0,children:[(0,p.jsx)(l.Flex,{gap:3,alignItems:"center",children:(0,p.jsx)(l.H4,{children:"Configure spaces list"})}),(0,p.jsx)(l.ModalCloseButton,{onClose:A})]}),(0,p.jsx)(l.ModalBody,{overflow:{vertical:"auto"},children:(0,p.jsx)(L,{spaceIds:m,colors:j,onOrderChange:a,onColorChange:s,onColorReset:r,onColorClear:i})}),(0,p.jsxs)(l.ModalFooter,{gap:2,justifyContent:"between",children:[(0,p.jsx)(J,{label:"Delete all settings",flavour:"borderless",disabled:v||!g,onClick:S,danger:!0,tooltip:v||!g?null:"Delete any previously saved settings."}),(0,p.jsxs)(l.Flex,{gap:2,children:[(0,p.jsx)(l.Button,{label:"Close",flavour:"hollow",onClick:A,disabled:v}),(0,p.jsx)(l.Button,{label:"Reset",flavour:"hollow",onClick:u,disabled:v||!h}),(0,p.jsx)(l.Button,{label:"Save",onClick:R,disabled:v||!h})]})]})]})}),k?(0,p.jsx)(q,{flavour:k,handleConfirm:F,handleDecline:I}):null]})};var Z=t(46587);const $=(0,S.A)(l.Icon),K=()=>{const e=(0,Z.uW)("isAnonymous"),o=(0,u.A)(),{spaceIds:t,colors:n}=o||{},[a,s,,r]=(0,c.A)();return(0,p.jsxs)(l.Flex,{width:"100%",column:!0,gap:4,alignItems:"center",overflow:{vertical:"auto",horizontal:"hidden"},children:[(0,p.jsx)(x,{spaceIds:t,colors:n}),!e&&t.length>1?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)($,{name:"hamburger",color:"text",cursor:"pointer",tooltip:{title:"Customize Spaces",description:"Rearrange and color your spaces"},tooltipProps:{align:"right"},onClick:s}),a?(0,p.jsx)(V,{onClose:r}):null]}):null]})};var X=t(72679);const Q=e=>{let{...o}=e;const t=(0,X.A)(),n=(0,h.dg)();return(0,p.jsx)(l.Flex,{padding:[0,1],children:(0,p.jsx)(y.A,{content:{title:n?"Settings":"Space Settings",description:n?"Configure your Netdata settings and preferences":"Manage space members, permissions, and configurations"},align:"right",children:(0,p.jsx)(l.Button,{flavour:"borderless",icon:"gear",neutral:!0,onClick:t,small:!0,"data-ga":"left-sidebar::click-space-settings::global-view","data-testid":"workspaceBar-manageSpace",...o})})})};var ee=t(30582),oe=t(99746),te=t(41514),ne=t(51571),le=t(61337),ae=t(19186),se=t(45187),re=t(48464),ie=t(39175);const ce=(0,S.A)(l.IconButton),de=()=>{const e=(0,ae.ID)(),o=(0,ie.tB)(e),t=(0,Z.uW)("isAnonymous"),{isInitialized:n}=(0,se.R)();return!n||o||t?null:(0,p.jsx)(l.Flex,{position:"relative",children:(0,p.jsx)(ce,{className:re.zs,"data-testid":"open-referrer-modal",icon:"giftbox",neutral:!0,width:"20px",height:"20px",tooltip:{title:"Referral program",description:"Spread the word, earn up to $1000 with Netdata!"},tooltipProps:{align:"right"}})})};var ue=t(61398),ge=t(48301);const he=(0,S.A)(l.IconButton),pe=()=>{const e=(0,ge.Cu)(),{handleOpenProfileModal:o}=(0,ue.A)();return(0,p.jsx)(he,{"data-testid":"open-email-notification",cursor:"pointer",onClick:()=>o("notifications"),icon:e?.email?"notification_shortcut_enabled":"notification_shortcut_disabled","data-ga":"left-sidebar::click-user-notification-settings::global-view",neutral:!0,width:"20px",height:"20px",tooltip:{title:"Personal Notifications",description:"Manage all your notification preferences and settings"},tooltipProps:{align:"right"}})},xe=(0,n.memo)(pe),Ce=(0,S.A)(l.IconButton),me=()=>{const e=(0,h.vt)(),o=(0,ie.ES)(e);return(0,p.jsx)(l.News,{app:ie.Ay?o?"agent":["cloud","agent"]:"cloud",children:e=>{let{toggle:o,upToDate:t}=e;return(0,p.jsx)(Ce,{icon:"insights",iconColor:t?"text":"attention",onClick:o,"data-ga":"news::click-news::global-view","data-testid":"cloud-app-news",neutral:t,width:"20px",height:"20px",tooltip:{title:"News & Announcements",description:"Stay updated with the latest Netdata features and improvements"},tooltipProps:{align:"right"}})}})};var be=t(94404);const je=(0,S.A)(ne.A),fe=(0,be.A)(je),ve=(0,S.A)(l.IconButton),ke=s.default.div.withConfig({displayName:"spaces__Separator",componentId:"sc-1gbju6k-0"})(["height:1px;width:",";background:",";"],(0,l.getSizeBy)(3),(0,l.getColor)("border")),we={onClickOut:()=>(0,te.H)("header-help","click-out-modal","global-view"),onCloseClick:()=>(0,te.H)("header-help","click-close","global-view"),onOpenIssueClick:()=>(0,te.H)("header-help","click-\u03bfpen-issue","global-view"),onContributeClick:()=>(0,te.H)("header-help","click-contribute","global-view"),onOpenBugClick:()=>(0,te.H)("header-help","click-bug","global-view"),onSupportClick:()=>(0,te.H)("header-help","click-support","global-view"),onVisitDocumentClick:()=>(0,te.H)("header-help","click-visit-doc","global-view"),onGoToDemoClick:()=>(0,te.H)("header-help","click-go-to-demo","global-view")},Ie=e=>{let{spacePanelCollapsed:o,toggleSpacePanel:t}=e;const[a,,s,u]=(0,c.A)(),g=(0,r.Zp)(),h=(0,n.useCallback)((function(){let{slug:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return g(`/spaces/${e}`)}),[]);return(0,p.jsxs)(l.Flex,{height:"100vh",width:12,background:"sideBarMini","data-testid":"workspaceBar",padding:[3,0],column:!0,alignItems:"center",gap:6,justifyContent:"between",children:[(0,p.jsxs)(l.Flex,{width:"100%",column:!0,"data-testid":"workspaceBar-spaces-list",gap:4,alignItems:"center",overflow:"hidden",children:[(0,p.jsx)(d.A,{"data-testid":"workspaceBar-netdataLogo"}),o&&(0,p.jsx)(l.IconButton,{"data-testid":"workspaceBar-expandButton",onClick:t,icon:"chevron_right",neutral:!0,padding:[0],width:"20px",height:"20px"}),(0,p.jsx)(K,{}),(0,p.jsx)(le.A,{permission:"user:CreateSpace",children:(0,p.jsx)(ke,{"data-testid":"workspaceBar-separator"})}),(0,p.jsx)(fe,{permission:"user:CreateSpace",ifForbidden:"hide",icon:"plus",onClick:s,"data-testid":"workspaceBar-addSpace-button",feature:"CreateSpace",isStart:!0,tooltip:{title:"Create New Space",description:"Spaces isolate infrastructure, providing fully independent administration and user management"},tooltipProps:{align:"right"},iconWidth:"20px",iconHeight:"20px",padding:[.5]})]}),(0,p.jsxs)(l.Flex,{column:!0,"data-testid":"workspaceBar-actionsList",gap:4,alignItems:"center",children:[(0,p.jsxs)(l.Flex,{column:!0,gap:1,alignItems:"center",children:[(0,p.jsx)(de,{}),!window.envSettings.onprem&&(0,p.jsx)(n.Suspense,{fallback:"",children:(0,p.jsx)(me,{})}),(0,p.jsx)(n.Suspense,{fallback:"",children:(0,p.jsx)(le.A,{permission:"user:ChangeSpaceRoomNotifications",children:(0,p.jsx)(xe,{})})}),(0,p.jsx)(l.Documentation,{app:"cloud",demoUrl:i.A.demoUrl,...we,children:e=>(0,p.jsx)(ve,{icon:"question",onClick:e,"data-ga":"header-help::click-help::global-view","data-testid":"documentation-button",width:"18px",height:"18px",tooltip:{title:"Help & Resources",description:"Read documentation, engage with the community and let us know about any feature requests or bugs"},tooltipProps:{align:"right"}})}),(0,p.jsx)(Q,{})]}),(0,p.jsx)(oe.A,{})]}),a&&(0,p.jsx)(ee.A,{onClose:u,onDone:h})]})};var ye=t(85005),Ae=t(98595),Se=t(64602),Fe=t(99728);const Re=e=>o=>{const t=(0,h.vt)();return(0,n.createElement)(e,{...o,key:t})};var Be=t(31933);const Te={isSidebar:!0,padding:[1,2,1,4],textColor:"menuItem"},De=Re((()=>{const e=(0,Fe.JT)("room:Create"),o=(0,Fe.JT)("room:Read"),[t,a]=(0,c.A)(o),[s,,r,i]=(0,c.A)(!1),d=(0,n.useCallback)((o=>{o.stopPropagation(),e&&r()}),[e]);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Ae.A,{"data-testid":"workspaceRooms-menuList",disabled:!o,headerTestId:"workspaceRooms-warRooms",isOpen:t,label:(0,p.jsxs)(l.Flex,{padding:[1,0],margin:[0,0,1,0],flex:!0,justifyContent:"between",alignItems:"center",height:"24px",children:[(0,p.jsxs)(l.Flex,{alignItems:"center",gap:2,children:[(0,p.jsx)(l.Icon,{name:"space_new",color:"menuItem",width:"14px",height:"14px"}),(0,p.jsx)(l.Text,{color:"menuItem",children:"Rooms"})]}),(0,p.jsxs)(l.Flex,{alignItems:"center",gap:2,children:[(0,p.jsx)(y.A,{content:"Create a new room",align:"right",children:(0,p.jsx)(ne.A,{permission:"room:Create",icon:"plus",flavour:"hollow",onClick:d,"data-testid":"workspaceRooms-addWarRoom-button"})}),(0,p.jsx)(Se.v,{right:!t,name:"chevron_down",size:"small",color:"textLite"})]})]}),toggleOpen:a,children:(0,p.jsx)(l.Flex,{column:!0,"data-testid":"workspaceRooms-warRoomsList",padding:[0,0,1],children:(0,p.jsx)(Be.A,{...Te})})}),s&&(0,p.jsx)(ye.n,{onClose:i,isSubmodal:!1})]})}));var Pe=t(7960),Me=t(85720),_e=t(98591);const Oe=(0,s.default)(l.Flex).attrs({alignItems:"center",justifyContent:"center",width:10,height:4,round:.5,background:"sideBarMini"}).withConfig({displayName:"styled__AdminPill",componentId:"sc-1ps23b1-0"})(["opacity:0;",":hover &{opacity:1;}"],Me.G),Ne=(0,Pe.A)((()=>t.e(35).then(t.bind(t,70035))),"CurrentPlan"),Ee=e=>{let{children:o,onToggle:t}=e;return(0,p.jsxs)(l.Flex,{column:!0,gap:1,children:[(0,p.jsxs)(l.Flex,{justifyContent:"between",alignItems:"center",children:[(0,p.jsx)(l.Flex,{alignItems:"center",overflow:"hidden",children:o}),(0,p.jsx)(l.Button,{onClick:t,icon:"chevron_left",neutral:!0,flavour:"hollow",small:!0})]}),(0,p.jsx)(n.Suspense,{fallback:"",children:(0,p.jsx)(Ne,{})})]})};var He=t(89590),Le=t(1174),ze=t(61661),We=t(89942);const Ue=()=>{const e=(0,We.PP)(),[o,t]=(0,ze.XL)(),{reset:l}=(0,ze.b8)(),a=(0,n.useCallback)((()=>{l(),(0,We.Z8)({...e,integrationsModalOpen:"true"}),t("true")}),[l,t,e]);return{isIntegrationsVisible:o,hideIntegrations:(0,n.useCallback)((()=>{(0,We.Z8)({...e,integrationsModalOpen:""}),t("")}),[e,t]),onIntegrationsClick:a}};var Ge=t(56284);const Ye=(0,Pe.A)((()=>t.e(2201).then(t.bind(t,52201)).then((e=>({default:e.TrialWarning})))),"TrialWarning"),qe=(0,s.default)(Ae.N).attrs({padding:[2],color:"textLite"}).withConfig({displayName:"spacePanel__ListHeader",componentId:"sc-1275zgk-0"})([""]),Je=e=>(0,p.jsxs)(l.Flex,{alignItems:"center",gap:2,...e,children:[(0,p.jsx)(Oe,{children:(0,p.jsx)(l.TextFemto,{strong:!0,color:"text",children:"ADMIN"})}),(0,p.jsx)(l.Flex,{opacity:"medium",children:(0,p.jsx)(l.Icon,{name:"padlock",size:"small",width:"18px",height:"18px",color:"text"})})]}),Ve={iconWidth:"14px",iconHeight:"14px",padding:[1,2],gap:2,isSidebar:!0,textColor:"menuItem",iconColor:"menuItem"},Ze=e=>{let{toggleSpacePanel:o}=e;const t=(0,h.ap)(),[a,,s,r]=(0,c.A)(),[,i]=(0,_e.A)("manageInvitations"),d=(0,h.dg)(),{onIntegrationsClick:u}=Ue();return(0,p.jsxs)(p.Fragment,{children:[a&&(0,p.jsx)(He.A,{onClose:r}),(0,p.jsx)(Ae.A,{"data-testid":"spacesPanel",isOpen:!0,label:(0,p.jsx)(Ee,{onToggle:o,children:(0,p.jsx)(Ge.default,{maxFontSize:20,Component:l.TextSmall,strong:!0,title:t.name,lineHeight:"unset",children:t.name})}),headerTestId:"spacesPanel-activeSpaceHeader",Header:qe,children:(0,p.jsxs)(l.Flex,{column:!0,padding:[2,0,1],"data-testid":"spacesPanel-menuList",children:[(0,p.jsx)(n.Suspense,{fallback:"",children:(0,p.jsx)(Ye,{flavour:"sidebar"})}),(0,p.jsx)(Me.A,{onClick:u,testid:"agentDashboard-addIntegrations",dataGa:"integrations::click-add-integrations::sideMenu",icon:"integrations",...Ve,children:"Integrations"}),d?null:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Le.A,{permission:"node:Create",children:e=>(0,p.jsx)(Me.A,{actions:e?null:(0,p.jsx)(Je,{"data-testid":"adminWarning-notAdmin"}),disabled:!e,onClick:s,testid:"spacesPanel-claimNodes",icon:"nodes_hollow",...Ve,children:"Connect Nodes"})}),(0,p.jsx)(Le.A,{permission:"space:InviteUser",children:e=>(0,p.jsx)(Me.A,{actions:e?null:(0,p.jsx)(Je,{"data-testid":"adminWarning-cannotInvite"}),disabled:!e,onClick:i,testid:"spacesPanel-inviteUsers",icon:"user",...Ve,children:"Invite Users"})})]})]})})]})},$e=e=>{let{spacePanelCollapsed:o,toggleSpacePanel:t}=e;return(0,p.jsx)(l.Collapsible,{width:56,background:"sideBar",border:{side:"right",color:"borderSecondary"},open:!o,direction:"horizontal",children:(0,p.jsxs)(l.Flex,{flex:!0,width:56,column:!0,overflow:{vertical:"hidden"},padding:[2,0],position:"relative",children:[(0,p.jsx)(Ze,{toggleSpacePanel:t}),(0,p.jsx)(l.Flex,{overflow:{vertical:"auto"},flex:!0,column:!0,children:(0,p.jsx)(De,{})})]})})};var Ke=t(29263),Xe=t(32788),Qe=t(37846),eo=t(62718),oo=t(14815),to=t(60908);const no=(0,Pe.A)((()=>Promise.all([t.e(1220),t.e(3864),t.e(8791),t.e(3185),t.e(1861)]).then(t.bind(t,53185)))),lo={"data-testid":"addIntegrationModal"},ao={"data-testid":"addIntegration-header"},so={"data-testid":"addIntegration-content",overflow:"hidden",hasFooter:!1,padding:[0],hasModalTitle:!1},ro=e=>{let{title:o="Integrations",onClose:t}=e;return(0,p.jsx)(to.Ay,{feature:"IntegrationsModal",children:(0,p.jsxs)(Qe.GO,{right:!0,closeOnEsc:!0,closeOnOverlayClick:!0,onClose:t,...lo,children:[(0,p.jsx)(Ke.z,{title:(0,p.jsx)(l.TextBig,{color:"textLite",children:o}),onClose:t,...ao||{}}),(0,p.jsx)(Xe.Yv,{...so||{},children:(0,p.jsx)(n.Suspense,{fallback:(0,p.jsx)(eo.H$,{}),children:(0,p.jsx)(no,{flavour:oo.D_.addNodesModal})})})]})})},io=(0,n.memo)((()=>{const[e,o]=(0,a.tF)("spacePanelCollapsed"),{isIntegrationsVisible:t,hideIntegrations:s}=Ue(),r=(0,n.useCallback)((()=>o(!e)),[e,o]);return(0,n.useLayoutEffect)((()=>{const e=setTimeout((()=>window.dispatchEvent(new Event("resize"))),400);return()=>clearTimeout(e)}),[e]),(0,p.jsxs)(l.Flex,{children:[(0,p.jsx)(Ie,{spacePanelCollapsed:e,toggleSpacePanel:r}),(0,p.jsx)($e,{spacePanelCollapsed:e,toggleSpacePanel:r}),t&&(0,p.jsx)(ro,{onClose:s})]})}))},45187:(e,o,t)=>{t.d(o,{R:()=>i,H:()=>c});var n=t(34843),l=t(52035);const a=(0,l.eU)(!1),s=(0,l.eU)(!1);var r=t(96540);const i=()=>{const[e,o]=(0,n.fp)(a);return{isInitialized:e,init:(0,r.useCallback)((()=>o(!0)),[o])}},c=()=>{const[e,o]=(0,n.fp)(s);return{isActive:e,activate:(0,r.useCallback)((()=>o(!0)),[o]),deactivate:(0,r.useCallback)((()=>o(!1)),[o])}}}}]);