"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9277,7325],{27325:function(e,s,t){t.d(s,{Z:function(){return r}});/**
 * @license lucide-react v0.407.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,t(60998).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},6521:function(e,s,t){t.d(s,{Z:function(){return r}});/**
 * @license lucide-react v0.407.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,t(60998).Z)("FileSearch",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]])},88507:function(e,s,t){t.d(s,{Z:function(){return r}});/**
 * @license lucide-react v0.407.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,t(60998).Z)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},53610:function(e,s,t){t.d(s,{Z:function(){return r}});/**
 * @license lucide-react v0.407.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,t(60998).Z)("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]])},81260:function(e,s,t){t.d(s,{Z:function(){return r}});/**
 * @license lucide-react v0.407.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,t(60998).Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},23293:function(e,s,t){t.d(s,{Z:function(){return r}});/**
 * @license lucide-react v0.407.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,t(60998).Z)("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]])},47603:function(e,s,t){t.d(s,{Z:function(){return r}});/**
 * @license lucide-react v0.407.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,t(60998).Z)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},28586:function(e,s,t){t.d(s,{Z:function(){return r}});/**
 * @license lucide-react v0.407.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,t(60998).Z)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},43767:function(e,s,t){t.d(s,{Z:function(){return r}});/**
 * @license lucide-react v0.407.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,t(60998).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},1812:function(e,s,t){t.d(s,{X:function(){return l}});var r=t(85893),a=t(67294);let n=e=>{if(!(null==e?void 0:e.message))return"An unexpected error occurred.";let s=e.message;return s.includes("failed:")&&(s=s.split("failed:")[1].trim()),s},l=e=>{let{error:s,title:t="Error",onDismiss:l}=e,[i,c]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{s&&c(!1)},[s]),!s||i)return null;let o="string"==typeof s?s:n(s);return(0,r.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-md p-3 mb-4",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)("div",{className:"flex-shrink-0",children:(0,r.jsx)("svg",{className:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),(0,r.jsx)("div",{className:"ml-3",children:(0,r.jsxs)("div",{className:"text-sm text-red-800",children:[(0,r.jsxs)("strong",{children:[t,":"]})," ",o]})})]}),(0,r.jsx)("button",{onClick:()=>{c(!0),l&&l()},className:"flex-shrink-0 ml-4 text-red-400 hover:text-red-600 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 focus:ring-offset-red-50 rounded","aria-label":"Dismiss error",children:(0,r.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]})})}},82077:function(e,s,t){t.r(s),t.d(s,{Workspaces:function(){return D}});var r=t(85893),a=t(67294),n=t(11163),l=t(23266),i=t(68969),c=t(17324),o=t(37673),d=t(68764),u=t(30803),h=t(55739),m=t(1272),x=t(50326);t(53850);var p=t(1812),f=t(13626),g=t(81260);/**
 * @license lucide-react v0.407.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let j=(0,t(60998).Z)("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);var v=t(47603),y=t(23001),k=t(23015),w=t(6378),b=t(51214),N=t(36856),C=t(47145),M=t(94545),Z=t(93225),L=t(41664),S=t.n(L);let z=e=>{let{isPrivate:s}=e;return s?(0,r.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-gray-100 text-gray-700 border border-gray-300",children:"Private"}):(0,r.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-700 border border-green-300",children:"Public"})},E=b.nb.REFRESH_INTERVAL;function D(){let[e,s]=(0,a.useState)([]),[t,b]=(0,a.useState)({runningClusters:0,totalClusters:0,managedJobs:0}),[L,D]=(0,a.useState)(!0),[R,O]=(0,a.useState)(null),[J,P]=(0,a.useState)({key:"name",direction:"asc"}),[q,F]=(0,a.useState)(""),[T,W]=(0,a.useState)(!1),[A,V]=(0,a.useState)({confirmOpen:!1,workspaceToDelete:null,deleting:!1,error:null}),[X,B]=(0,a.useState)({open:!1,message:"",userName:""}),[H,I]=(0,a.useState)(null),[U,_]=(0,a.useState)(!1),[K,G]=(0,a.useState)(null),[$,Q]=(0,a.useState)(null),Y=(0,n.useRouter)(),ee=(0,y.X)(),es=async()=>{if(H&&Date.now()-H.timestamp<3e5)return H;_(!0);try{let e=await C.x.get("/users/role");if(!e.ok){let s=await e.json();throw Error(s.detail||"Failed to get user role")}let s=await e.json(),t={role:s.role,name:s.name,timestamp:Date.now()};return I(t),_(!1),t}catch(e){throw _(!1),e}},et=async(e,s)=>{try{let t=await es();if("admin"!==t.role)return B({open:!0,message:e,userName:t.name.toLowerCase()}),!1;return s(),!0}catch(e){return console.error("Failed to check user role:",e),B({open:!0,message:"Error: ".concat(e.message),userName:""}),!1}},er=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&D(!0);try{let[e,t,r]=await Promise.all([w.default.get(c.fX),w.default.get(l.getClusters),w.default.get(i.getManagedJobs,[{allUsers:!0}])]);O(e);let a=Object.keys(e),n=await Promise.all(a.map(e=>w.default.get(c.yz,[e]))),o=Object.fromEntries(a.map((e,s)=>[e,n[s]]));Object.fromEntries(t.map(e=>[e.cluster,e.workspace||"default"]));let d={};a.forEach(e=>{d[e]={name:e,totalClusterCount:0,runningClusterCount:0,managedJobsCount:0,clouds:new Set}});let u=0;t.forEach(e=>{let s=e.workspace||"default";d[s]||(d[s]={name:s,totalClusterCount:0,runningClusterCount:0,managedJobsCount:0,clouds:new Set}),d[s].totalClusterCount++,("RUNNING"===e.status||"LAUNCHING"===e.status)&&(d[s].runningClusterCount++,u++),e.cloud&&d[s].clouds.add(e.cloud)});let h=r.jobs||[],m=new Set(k.statusGroups.active),x=0;h.forEach(e=>{let s=e.workspace||"default";d[s]&&m.has(e.status)&&d[s].managedJobsCount++,m.has(e.status)&&x++});let p=Object.values(d).filter(e=>a.includes(e.name)).map(e=>({...e,clouds:Array.isArray(o[e.name])?o[e.name]:[]})).sort((e,s)=>e.name.localeCompare(s.name));s(p),b({runningClusters:u,totalClusters:t.length,managedJobs:x})}catch(e){console.error("Error fetching workspace data:",e),s([]),b({runningClusters:0,totalClusters:0,managedJobs:0})}e&&D(!1)};(0,a.useEffect)(()=>{(async()=>{await N.ZP.preloadForPage("workspaces"),er(!0)})();let e=setInterval(()=>{er(!1)},E);return()=>clearInterval(e)},[]);let ea=e=>{let s="asc";J.key===e&&"asc"===J.direction&&(s="desc"),P({key:e,direction:s})},en=e=>J.key===e?"asc"===J.direction?" ↑":" ↓":"",el=a.useMemo(()=>{if(!e)return[];let s=e;if(q&&""!==q.trim()){let t=q.toLowerCase().trim();s=e.filter(e=>!!(e.name.toLowerCase().includes(t)||e.clouds.some(e=>{let s=Z.Z2[e.toLowerCase()]||e;return e.toLowerCase().includes(t)||s.toLowerCase().includes(t)}))||!!(!0===((null==R?void 0:R[e.name])||{}).private?"private":"public").includes(t))}return(0,M.R0)(s,J.key,J.direction)},[e,J,q,R]),ei=e=>{et("cannot delete workspace",()=>{V({confirmOpen:!0,workspaceToDelete:e,deleting:!1,error:null})})},ec=async()=>{if(A.workspaceToDelete){V(e=>({...e,deleting:!0,error:null}));try{await (0,c.zl)(A.workspaceToDelete),Q('Workspace "'.concat(A.workspaceToDelete,'" deleted successfully!')),V({confirmOpen:!1,workspaceToDelete:null,deleting:!1,error:null}),w.default.invalidate(c.fX),await er(!0)}catch(e){console.error("Error deleting workspace:",e),V(e=>({...e,deleting:!1,error:null})),G(e)}}},eo=()=>{V({confirmOpen:!1,workspaceToDelete:null,deleting:!1,error:null})},ed=e=>{et("cannot edit workspace",()=>{Y.push("/workspaces/".concat(e))})};return L&&0===e.length?(0,r.jsxs)("div",{className:"flex justify-center items-center h-64",children:[(0,r.jsx)(h.Z,{}),(0,r.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading workspaces..."})]}):(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"fixed top-20 right-4 z-[9999] max-w-md",children:[$&&(0,r.jsx)("div",{className:"bg-green-50 border border-green-200 rounded p-4 mb-4",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("div",{className:"flex-shrink-0",children:(0,r.jsx)("svg",{className:"h-5 w-5 text-green-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})}),(0,r.jsx)("div",{className:"ml-3",children:(0,r.jsx)("p",{className:"text-sm font-medium text-green-800",children:$})})]}),(0,r.jsx)("div",{className:"ml-auto pl-3",children:(0,r.jsxs)("button",{type:"button",onClick:()=>Q(null),className:"inline-flex rounded-md bg-green-50 p-1.5 text-green-500 hover:bg-green-100",children:[(0,r.jsx)("span",{className:"sr-only",children:"Dismiss"}),(0,r.jsx)("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})]})})]})}),(0,r.jsx)(p.X,{error:K,title:"Error",onDismiss:()=>G(null)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2 h-5",children:[(0,r.jsx)("div",{className:"text-base flex items-center",children:(0,r.jsx)("span",{className:"text-sky-blue leading-none",children:"Workspaces"})}),(0,r.jsxs)("div",{className:"flex items-center",children:[L&&(0,r.jsxs)("div",{className:"flex items-center mr-2",children:[(0,r.jsx)(h.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"ml-2 text-gray-500 text-xs",children:"Refreshing..."})]}),(0,r.jsxs)("button",{onClick:()=>{w.default.invalidate(c.fX),w.default.invalidate(l.getClusters),w.default.invalidate(i.getManagedJobs,[{allUsers:!0}]),w.default.invalidateFunction(c.yz),er(!0)},disabled:L,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:[(0,r.jsx)(f.Z,{className:"h-4 w-4 mr-1.5"}),!ee&&(0,r.jsx)("span",{children:"Refresh"})]})]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsxs)("div",{className:"relative flex-1 max-w-md",children:[(0,r.jsx)("input",{type:"text",placeholder:"Filter workspaces",value:q,onChange:e=>F(e.target.value),className:"h-8 w-full px-3 pr-8 text-sm border border-gray-300 rounded-md focus:ring-1 focus:ring-sky-500 focus:border-sky-500 outline-none"}),q&&(0,r.jsx)("button",{onClick:()=>F(""),className:"absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",title:"Clear search",children:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("button",{onClick:()=>{et("cannot create workspace",()=>{Y.push("/workspace/new")})},disabled:U,className:"ml-4 bg-sky-600 hover:bg-sky-700 text-white flex items-center rounded-md px-3 py-1 text-sm font-medium transition-colors duration-200",title:"Create Workspace",children:U?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{size:12,className:"mr-2"}),(0,r.jsx)("span",{children:"Create Workspace"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g.Z,{className:"h-4 w-4 mr-2"}),"Create Workspace"]})})]}),0!==e.length||L?(0,r.jsx)(o.Zb,{children:(0,r.jsx)("div",{className:"overflow-x-auto rounded-lg",children:(0,r.jsxs)(d.iA,{className:"min-w-full",children:[(0,r.jsx)(d.xD,{children:(0,r.jsxs)(d.SC,{children:[(0,r.jsxs)(d.ss,{className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50",onClick:()=>ea("name"),children:["Workspace",en("name")]}),(0,r.jsxs)(d.ss,{className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50",onClick:()=>ea("totalClusterCount"),children:["Clusters ",en("totalClusterCount")]}),(0,r.jsxs)(d.ss,{className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50",onClick:()=>ea("managedJobsCount"),children:["Jobs",en("managedJobsCount")]}),(0,r.jsx)(d.ss,{className:"whitespace-nowrap",children:"Enabled infra"}),(0,r.jsx)(d.ss,{className:"whitespace-nowrap",children:"Actions"})]})}),(0,r.jsx)(d.RM,{children:L&&0===el.length?(0,r.jsx)(d.SC,{children:(0,r.jsx)(d.pj,{colSpan:5,className:"text-center py-6 text-gray-500",children:(0,r.jsxs)("div",{className:"flex justify-center items-center",children:[(0,r.jsx)(h.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]})})}):el.length>0?el.map(e=>{let s=!0===((null==R?void 0:R[e.name])||{}).private;return(0,r.jsxs)(d.SC,{className:"hover:bg-gray-50",children:[(0,r.jsxs)(d.pj,{className:"",children:[(0,r.jsx)("button",{onClick:()=>ed(e.name),disabled:U,className:"text-blue-600 hover:text-blue-600 hover:underline text-left",children:e.name}),(0,r.jsx)("span",{className:"ml-2",children:(0,r.jsx)(z,{isPrivate:s})})]}),(0,r.jsx)(d.pj,{children:(0,r.jsxs)("button",{onClick:()=>{Y.push({pathname:"/clusters",query:{workspace:e.name}})},className:"text-gray-700 hover:text-blue-600 hover:underline",children:[e.runningClusterCount," running,"," ",e.totalClusterCount," total"]})}),(0,r.jsx)(d.pj,{children:(0,r.jsx)("button",{onClick:()=>{Y.push({pathname:"/jobs",query:{workspace:e.name}})},className:"text-gray-700 hover:text-blue-600 hover:underline",children:e.managedJobsCount})}),(0,r.jsx)(d.pj,{children:e.clouds.length>0?[...e.clouds].sort().map((s,t)=>{let a=Z.Z2[s.toLowerCase()]||s;return(0,r.jsxs)("span",{children:[(0,r.jsx)(S(),{href:"/infra",className:"inline-flex items-center px-2 py-1 rounded text-sm bg-sky-100 text-sky-800 hover:bg-sky-200 hover:text-sky-900 transition-colors duration-200",children:a}),t<e.clouds.length-1&&" "]},s)}):(0,r.jsx)("span",{className:"text-gray-500 text-sm",children:"-"})}),(0,r.jsxs)(d.pj,{children:[(0,r.jsx)(u.z,{variant:"ghost",size:"sm",onClick:()=>ed(e.name),disabled:U,className:"text-gray-600 hover:text-gray-800 mr-1",children:(0,r.jsx)(j,{className:"w-4 h-4"})}),(0,r.jsx)(u.z,{variant:"ghost",size:"sm",onClick:()=>ei(e.name),disabled:"default"===e.name||U,title:"default"===e.name?"Cannot delete default workspace":"Delete workspace",className:"text-red-600 hover:text-red-700 hover:bg-red-50",children:(0,r.jsx)(v.Z,{className:"w-4 h-4"})})]})]},e.name)}):(0,r.jsx)(d.SC,{children:(0,r.jsx)(d.pj,{colSpan:5,className:"text-center py-6 text-gray-500",children:"No workspaces found"})})})]})})}):(0,r.jsxs)("div",{className:"text-center py-10",children:[(0,r.jsx)("p",{className:"text-lg text-gray-600",children:"No workspaces found."}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-2",children:"Create a cluster to see its workspace here."})]}),R&&(0,r.jsx)(x.Vq,{open:T,onOpenChange:W,children:(0,r.jsxs)(x.cZ,{className:"sm:max-w-md md:max-w-lg lg:max-w-xl xl:max-w-2xl w-full max-h-[90vh] flex flex-col",children:[(0,r.jsx)(x.fK,{children:(0,r.jsx)(x.$N,{className:"pr-10",children:"All Workspaces Configuration"})}),(0,r.jsx)("div",{className:"flex-grow overflow-y-auto py-4",children:(0,r.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",overflowX:"auto",whiteSpace:"pre",wordBreak:"normal"},children:m.ZP.dump(R,{indent:2})})})]})}),(0,r.jsx)(x.Vq,{open:X.open,onOpenChange:e=>{B(s=>({...s,open:e})),e||G(null)},children:(0,r.jsxs)(x.cZ,{className:"sm:max-w-md transition-all duration-200 ease-in-out",children:[(0,r.jsxs)(x.fK,{children:[(0,r.jsx)(x.$N,{children:"Permission Denied"}),(0,r.jsx)(x.Be,{children:U?(0,r.jsxs)("div",{className:"flex items-center py-2",children:[(0,r.jsx)(h.Z,{size:16,className:"mr-2"}),(0,r.jsx)("span",{children:"Checking permissions..."})]}):(0,r.jsx)(r.Fragment,{children:X.userName?(0,r.jsxs)(r.Fragment,{children:[X.userName," is logged in as non-admin and ",X.message,"."]}):X.message})})]}),(0,r.jsx)(x.cN,{children:(0,r.jsx)(u.z,{variant:"outline",onClick:()=>B(e=>({...e,open:!1})),disabled:U,children:"OK"})})]})}),(0,r.jsx)(x.Vq,{open:A.confirmOpen,onOpenChange:e=>{e||(eo(),G(null))},children:(0,r.jsxs)(x.cZ,{className:"sm:max-w-md",children:[(0,r.jsxs)(x.fK,{children:[(0,r.jsx)(x.$N,{children:"Delete Workspace"}),(0,r.jsxs)(x.Be,{children:['Are you sure you want to delete workspace "',A.workspaceToDelete,'"? This action cannot be undone.']})]}),(0,r.jsxs)(x.cN,{children:[(0,r.jsx)(u.z,{variant:"outline",onClick:eo,disabled:A.deleting,children:"Cancel"}),(0,r.jsx)(u.z,{variant:"destructive",onClick:ec,disabled:A.deleting,children:A.deleting?"Deleting...":"Delete"})]})]})})]})}},23001:function(e,s,t){t.d(s,{X:function(){return a}});var r=t(67294);function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:768,[s,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let s=()=>{t(window.innerWidth<e)};return s(),window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}},[e]),s}}}]);