"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3981,8555,7325],{27325:function(e,s,r){r.d(s,{Z:function(){return t}});/**
 * @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 t=(0,r(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"}]])},81260:function(e,s,r){r.d(s,{Z:function(){return t}});/**
 * @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 t=(0,r(60998).Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},47603:function(e,s,r){r.d(s,{Z:function(){return t}});/**
 * @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 t=(0,r(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"}]])},1812:function(e,s,r){r.d(s,{X:function(){return l}});var t=r(85893),a=r(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:r="Error",onDismiss:l}=e,[o,c]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{s&&c(!1)},[s]),!s||o)return null;let i="string"==typeof s?s:n(s);return(0,t.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-md p-3 mb-4",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)("svg",{className:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,t.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,t.jsx)("div",{className:"ml-3",children:(0,t.jsxs)("div",{className:"text-sm text-red-800",children:[(0,t.jsxs)("strong",{children:[r,":"]})," ",i]})})]}),(0,t.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,t.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:(0,t.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,r){r.r(s),r.d(s,{Workspaces:function(){return D},getWorkspaceClusters:function(){return Z},getWorkspaceManagedJobs:function(){return L}});var t=r(85893),a=r(67294),n=r(11163),l=r(17324),o=r(37673),c=r(68764),i=r(30803),d=r(55739),u=r(1272),m=r(50326);r(53850);var h=r(1812),x=r(13626),p=r(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 g=(0,r(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 f=r(47603),j=r(36989),w=r(23001),v=r(2109),k=r(6378),b=r(51214),y=r(36856),N=r(47145),C=r(94545),E=r(93225),S=r(41664),_=r.n(S);async function Z(e){try{return(await N.x.fetch("/status",{cluster_names:null,all_users:!0,include_credentials:!1,include_handle:!1,override_skypilot_config:{active_workspace:e}})).map(e=>({status:"UP"===e.status?"RUNNING":"STOPPED"===e.status?"STOPPED":"INIT"===e.status?"LAUNCHING":"TERMINATED",cluster:e.name,user:e.user_name,user_hash:e.user_hash,cluster_hash:e.cluster_hash,cloud:e.cloud,region:e.region,zone:e.zone,launched_at:e.launched_at,handle:e.handle,last_use:e.last_use,autostop:e.autostop,to_down:e.to_down,resources_str:e.resources_str,workspace:e.workspace||"default"})).filter(s=>s.workspace===e)}catch(r){let s="Error fetching clusters for workspace ".concat(e,": ").concat(r);throw console.error(s),Error(s)}}async function L(e){try{let s=await N.x.post("/jobs/queue/v2",{all_users:!0,verbose:!0,skip_finished:!0,workspace_match:e,fields:["workspace","status"],override_skypilot_config:{active_workspace:e}});if(!s.ok){let r="Initial API request to get managed jobs failed with status ".concat(s.status," for workspace ").concat(e);throw Error(r)}let r=s.headers.get("X-Skypilot-Request-ID");if(!r){let s="No request ID received from server for getting managed jobs for workspace ".concat(e);throw Error(s)}let t=await N.x.get("/api/get?request_id=".concat(r)),a=t.statusText;if(500===t.status)try{let e=await t.json();if(e.detail&&e.detail.error)try{let s=JSON.parse(e.detail.error);if(s.type&&s.type===E.iW)return{jobs:[]};a=s.message||String(e.detail.error)}catch(s){console.error("Error parsing JSON from data.detail.error:",s),a=String(e.detail.error)}}catch(e){console.error("Error parsing response JSON:",e),a=String(e)}if(!t.ok){let s="API request to get managed jobs result failed with status ".concat(t.status,", error: ").concat(a," for workspace ").concat(e);throw Error(s)}let n=await t.json(),l=n.return_value?JSON.parse(n.return_value):{jobs:[]};return l.jobs&&(l.jobs=l.jobs.map(e=>({...e,workspace:e.workspace||"default"})),l.jobs=l.jobs.filter(s=>s.workspace===e)),l}catch(r){let s="Error fetching managed jobs for workspace ".concat(e,": ").concat(r);throw console.error(s),Error(s)}}let P=e=>{let{isPrivate:s}=e;return s?(0,t.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,t.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"})};function D(){let[e,s]=(0,a.useState)([]),[r,S]=(0,a.useState)({runningClusters:0,totalClusters:0,managedJobs:0}),[D,R]=(0,a.useState)(!0),[z,O]=(0,a.useState)(null),[M,T]=(0,a.useState)(null),[J,W]=(0,a.useState)({key:"name",direction:"asc"}),[A,I]=(0,a.useState)(""),[F,q]=(0,a.useState)(!1),[V,B]=(0,a.useState)({confirmOpen:!1,workspaceToDelete:null,deleting:!1,error:null}),[H,G]=(0,a.useState)({open:!1,message:"",userName:""}),[U,X]=(0,a.useState)(null),[$,K]=(0,a.useState)(!1),[Q,Y]=(0,a.useState)(null),[ee,es]=(0,a.useState)(null),er=(0,n.useRouter)(),et=(0,w.X)(),ea=async()=>{if(U&&Date.now()-U.timestamp<3e5)return U;K(!0);try{let e=await N.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(),r={role:s.role,name:s.name,timestamp:Date.now()};return X(r),K(!1),r}catch(e){throw K(!1),e}},en=async(e,s)=>{try{let r=await ea();if("admin"!==r.role)return G({open:!0,message:e,userName:r.name.toLowerCase()}),!1;return s(),!0}catch(e){return console.error("Failed to check user role:",e),G({open:!0,message:"Error: ".concat(e.message),userName:""}),!1}},el=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&R(!0);try{let e=await k.ZP.get(l.getWorkspaces);O(e);let r=Object.keys(e),t=r.map(async e=>{try{let[s,r,t]=await Promise.all([k.ZP.get(l.getEnabledClouds,[e]),k.ZP.get(Z,[e]),k.ZP.get(L,[e])]);return{workspaceName:e,enabledClouds:s,clusters:r||[],managedJobs:t||{jobs:[]}}}catch(s){return console.error("Error fetching workspace data:",s),{workspaceName:e,enabledClouds:[],clusters:[],managedJobs:{jobs:[]}}}}),a=await Promise.all(t),n=[],o=[],c={};a.forEach(e=>{let{workspaceName:s,enabledClouds:r,clusters:t,managedJobs:a}=e;t.forEach(e=>{n.push(e)}),a.jobs.forEach(e=>{o.push(e)}),c[s]=r}),Object.fromEntries(n.map(e=>[e.cluster,e.workspace||"default"]));let i={};r.forEach(e=>{i[e]={name:e,totalClusterCount:0,runningClusterCount:0,managedJobsCount:0,clouds:new Set}});let d=0;n.forEach(e=>{let s=e.workspace||"default";i[s]||(i[s]={name:s,totalClusterCount:0,runningClusterCount:0,managedJobsCount:0,clouds:new Set}),i[s].totalClusterCount++,("RUNNING"===e.status||"LAUNCHING"===e.status)&&(i[s].runningClusterCount++,d++),e.cloud&&i[s].clouds.add(e.cloud)});let u=new Set(v.statusGroups.active),m=0;(o||[]).forEach(e=>{let s=e.workspace||"default";i[s]&&u.has(e.status)&&i[s].managedJobsCount++,u.has(e.status)&&m++});let h=Object.values(i).filter(e=>r.includes(e.name)).map(e=>{let s=Array.isArray(c[e.name])?c[e.name]:[];return{...e,clouds:s}}).sort((e,s)=>e.name.localeCompare(s.name));s(h),S({runningClusters:d,totalClusters:n.length,managedJobs:m})}catch(e){console.error("Error fetching workspace data:",e),s([]),S({runningClusters:0,totalClusters:0,managedJobs:0})}e&&R(!1)};(0,a.useEffect)(()=>{(async()=>{await y.ZP.preloadForPage("workspaces"),await el(!0),T(new Date)})();let e=setInterval(()=>{"visible"===window.document.visibilityState&&el(!1)},b.nb.REFRESH_INTERVAL);return()=>clearInterval(e)},[]);let eo=e=>{let s="asc";J.key===e&&"asc"===J.direction&&(s="desc"),W({key:e,direction:s})},ec=e=>J.key===e?"asc"===J.direction?" ↑":" ↓":"",ei=a.useMemo(()=>{if(!e)return[];let s=e;if(A&&""!==A.trim()){let r=A.toLowerCase().trim();s=e.filter(e=>!!(e.name.toLowerCase().includes(r)||e.clouds.some(e=>{let s=E.Z2[e.toLowerCase()]||e;return e.toLowerCase().includes(r)||s.toLowerCase().includes(r)}))||!!(!0===((null==z?void 0:z[e.name])||{}).private?"private":"public").includes(r))}return(0,C.R0)(s,J.key,J.direction)},[e,J,A,z]),ed=e=>{en("cannot delete workspace",()=>{B({confirmOpen:!0,workspaceToDelete:e,deleting:!1,error:null})})},eu=async()=>{if(V.workspaceToDelete){B(e=>({...e,deleting:!0,error:null}));try{await (0,l.zl)(V.workspaceToDelete),es('Workspace "'.concat(V.workspaceToDelete,'" deleted successfully!')),B({confirmOpen:!1,workspaceToDelete:null,deleting:!1,error:null}),k.ZP.invalidate(l.getWorkspaces),k.ZP.invalidateFunction(Z),k.ZP.invalidateFunction(L),await el(!0)}catch(e){console.error("Error deleting workspace:",e),B(e=>({...e,deleting:!1,error:null})),Y(e)}}},em=async()=>{k.ZP.invalidate(l.getWorkspaces),k.ZP.invalidateFunction(l.getEnabledClouds),k.ZP.invalidateFunction(Z),k.ZP.invalidateFunction(L),await el(!0),T(new Date)},eh=()=>{B({confirmOpen:!1,workspaceToDelete:null,deleting:!1,error:null})},ex=e=>{en("cannot edit workspace",()=>{er.push("/workspaces/".concat(e))})};return D&&0===e.length?(0,t.jsxs)("div",{className:"flex justify-center items-center h-64",children:[(0,t.jsx)(d.Z,{}),(0,t.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading workspaces..."})]}):(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"fixed top-20 right-4 z-[9999] max-w-md",children:[ee&&(0,t.jsx)("div",{className:"bg-green-50 border border-green-200 rounded p-4 mb-4",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)("svg",{className:"h-5 w-5 text-green-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,t.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,t.jsx)("div",{className:"ml-3",children:(0,t.jsx)("p",{className:"text-sm font-medium text-green-800",children:ee})})]}),(0,t.jsx)("div",{className:"ml-auto pl-3",children:(0,t.jsxs)("button",{type:"button",onClick:()=>es(null),className:"inline-flex rounded-md bg-green-50 p-1.5 text-green-500 hover:bg-green-100",children:[(0,t.jsx)("span",{className:"sr-only",children:"Dismiss"}),(0,t.jsx)("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:(0,t.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,t.jsx)(h.X,{error:Q,title:"Error",onDismiss:()=>Y(null)})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2 h-5",children:[(0,t.jsx)("div",{className:"text-base flex items-center",children:(0,t.jsx)("span",{className:"text-sky-blue leading-none",children:"Workspaces"})}),(0,t.jsxs)("div",{className:"flex items-center",children:[D&&(0,t.jsxs)("div",{className:"flex items-center mr-2",children:[(0,t.jsx)(d.Z,{size:15,className:"mt-0"}),(0,t.jsx)("span",{className:"ml-2 text-gray-500 text-xs",children:"Refreshing..."})]}),!D&&M&&(0,t.jsx)(j.$3,{timestamp:M,className:"mr-2"}),(0,t.jsxs)("button",{onClick:em,disabled:D,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:[(0,t.jsx)(x.Z,{className:"h-4 w-4 mr-1.5"}),!et&&(0,t.jsx)("span",{children:"Refresh"})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{className:"relative flex-1 max-w-md",children:[(0,t.jsx)("input",{type:"text",placeholder:"Filter workspaces",value:A,onChange:e=>I(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"}),A&&(0,t.jsx)("button",{onClick:()=>I(""),className:"absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",title:"Clear search",children:(0,t.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,t.jsx)("button",{onClick:()=>{en("cannot create workspace",()=>{er.push("/workspace/new")})},disabled:$,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:$?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.Z,{size:12,className:"mr-2"}),(0,t.jsx)("span",{children:"Create Workspace"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Z,{className:"h-4 w-4 mr-2"}),"Create Workspace"]})})]}),0!==e.length||D?(0,t.jsx)(o.Zb,{children:(0,t.jsx)("div",{className:"overflow-x-auto rounded-lg",children:(0,t.jsxs)(c.iA,{className:"min-w-full",children:[(0,t.jsx)(c.xD,{children:(0,t.jsxs)(c.SC,{children:[(0,t.jsxs)(c.ss,{className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50",onClick:()=>eo("name"),children:["Workspace",ec("name")]}),(0,t.jsxs)(c.ss,{className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50",onClick:()=>eo("totalClusterCount"),children:["Clusters ",ec("totalClusterCount")]}),(0,t.jsxs)(c.ss,{className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50",onClick:()=>eo("managedJobsCount"),children:["Jobs",ec("managedJobsCount")]}),(0,t.jsx)(c.ss,{className:"whitespace-nowrap",children:"Enabled infra"}),(0,t.jsx)(c.ss,{className:"whitespace-nowrap",children:"Actions"})]})}),(0,t.jsx)(c.RM,{children:D&&0===ei.length?(0,t.jsx)(c.SC,{children:(0,t.jsx)(c.pj,{colSpan:5,className:"text-center py-6 text-gray-500",children:(0,t.jsxs)("div",{className:"flex justify-center items-center",children:[(0,t.jsx)(d.Z,{size:20,className:"mr-2"}),(0,t.jsx)("span",{children:"Loading..."})]})})}):ei.length>0?ei.map(e=>{let s=!0===((null==z?void 0:z[e.name])||{}).private;return(0,t.jsxs)(c.SC,{className:"hover:bg-gray-50",children:[(0,t.jsxs)(c.pj,{className:"",children:[(0,t.jsx)("button",{onClick:()=>ex(e.name),disabled:$,className:"text-blue-600 hover:text-blue-600 hover:underline text-left",children:e.name}),(0,t.jsx)("span",{className:"ml-2",children:(0,t.jsx)(P,{isPrivate:s})})]}),(0,t.jsx)(c.pj,{children:(0,t.jsxs)("button",{onClick:()=>{er.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,t.jsx)(c.pj,{children:(0,t.jsx)("button",{onClick:()=>{er.push({pathname:"/jobs",query:{workspace:e.name}})},className:"text-gray-700 hover:text-blue-600 hover:underline",children:e.managedJobsCount})}),(0,t.jsx)(c.pj,{children:e.clouds.length>0?[...e.clouds].sort().map((s,r)=>{let a=E.Z2[s.toLowerCase()]||s;return(0,t.jsxs)("span",{children:[(0,t.jsx)(_(),{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}),r<e.clouds.length-1&&" "]},s)}):(0,t.jsx)("span",{className:"text-gray-500 text-sm",children:"-"})}),(0,t.jsxs)(c.pj,{children:[(0,t.jsx)(i.z,{variant:"ghost",size:"sm",onClick:()=>ex(e.name),disabled:$,className:"text-gray-600 hover:text-gray-800 mr-1",children:(0,t.jsx)(g,{className:"w-4 h-4"})}),(0,t.jsx)(i.z,{variant:"ghost",size:"sm",onClick:()=>ed(e.name),disabled:"default"===e.name||$,title:"default"===e.name?"Cannot delete default workspace":"Delete workspace",className:"text-red-600 hover:text-red-700 hover:bg-red-50",children:(0,t.jsx)(f.Z,{className:"w-4 h-4"})})]})]},e.name)}):(0,t.jsx)(c.SC,{children:(0,t.jsx)(c.pj,{colSpan:5,className:"text-center py-6 text-gray-500",children:"No workspaces found"})})})]})})}):(0,t.jsxs)("div",{className:"text-center py-10",children:[(0,t.jsx)("p",{className:"text-lg text-gray-600",children:"No workspaces found."}),(0,t.jsx)("p",{className:"text-sm text-gray-500 mt-2",children:"Create a cluster to see its workspace here."})]}),z&&(0,t.jsx)(m.Vq,{open:F,onOpenChange:q,children:(0,t.jsxs)(m.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,t.jsx)(m.fK,{children:(0,t.jsx)(m.$N,{className:"pr-10",children:"All Workspaces Configuration"})}),(0,t.jsx)("div",{className:"flex-grow overflow-y-auto py-4",children:(0,t.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",overflowX:"auto",whiteSpace:"pre",wordBreak:"normal"},children:u.ZP.dump(z,{indent:2})})})]})}),(0,t.jsx)(m.Vq,{open:H.open,onOpenChange:e=>{G(s=>({...s,open:e})),e||Y(null)},children:(0,t.jsxs)(m.cZ,{className:"sm:max-w-md transition-all duration-200 ease-in-out",children:[(0,t.jsxs)(m.fK,{children:[(0,t.jsx)(m.$N,{children:"Permission Denied"}),(0,t.jsx)(m.Be,{children:$?(0,t.jsxs)("div",{className:"flex items-center py-2",children:[(0,t.jsx)(d.Z,{size:16,className:"mr-2"}),(0,t.jsx)("span",{children:"Checking permissions..."})]}):(0,t.jsx)(t.Fragment,{children:H.userName?(0,t.jsxs)(t.Fragment,{children:[H.userName," is logged in as non-admin and ",H.message,"."]}):H.message})})]}),(0,t.jsx)(m.cN,{children:(0,t.jsx)(i.z,{variant:"outline",onClick:()=>G(e=>({...e,open:!1})),disabled:$,children:"OK"})})]})}),(0,t.jsx)(m.Vq,{open:V.confirmOpen,onOpenChange:e=>{e||(eh(),Y(null))},children:(0,t.jsxs)(m.cZ,{className:"sm:max-w-md",children:[(0,t.jsxs)(m.fK,{children:[(0,t.jsx)(m.$N,{children:"Delete Workspace"}),(0,t.jsxs)(m.Be,{children:['Are you sure you want to delete workspace "',V.workspaceToDelete,'"? This action cannot be undone.']})]}),(0,t.jsxs)(m.cN,{children:[(0,t.jsx)(i.z,{variant:"outline",onClick:eh,disabled:V.deleting,children:"Cancel"}),(0,t.jsx)(i.z,{variant:"destructive",onClick:eu,disabled:V.deleting,children:V.deleting?"Deleting...":"Delete"})]})]})})]})}b.nb.REFRESH_INTERVAL},12003:function(e,s,r){r.d(s,{j:function(){return l}});var t=r(90512);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=t.W,l=(e,s)=>r=>{var t;if((null==s?void 0:s.variants)==null)return n(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:l,defaultVariants:o}=s,c=Object.keys(l).map(e=>{let s=null==r?void 0:r[e],t=null==o?void 0:o[e];if(null===s)return null;let n=a(s)||a(t);return l[e][n]}),i=r&&Object.entries(r).reduce((e,s)=>{let[r,t]=s;return void 0===t||(e[r]=t),e},{});return n(e,c,null==s?void 0:null===(t=s.compoundVariants)||void 0===t?void 0:t.reduce((e,s)=>{let{class:r,className:t,...a}=s;return Object.entries(a).every(e=>{let[s,r]=e;return Array.isArray(r)?r.includes({...o,...i}[s]):({...o,...i})[s]===r})?[...e,r,t]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}}}]);