skypilot-nightly 1.0.0.dev20251210__py3-none-any.whl → 1.0.0.dev20260112__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. sky/__init__.py +4 -2
  2. sky/adaptors/slurm.py +159 -72
  3. sky/backends/backend_utils.py +52 -10
  4. sky/backends/cloud_vm_ray_backend.py +192 -32
  5. sky/backends/task_codegen.py +40 -2
  6. sky/catalog/data_fetchers/fetch_gcp.py +9 -1
  7. sky/catalog/data_fetchers/fetch_nebius.py +1 -1
  8. sky/catalog/data_fetchers/fetch_vast.py +4 -2
  9. sky/catalog/seeweb_catalog.py +30 -15
  10. sky/catalog/shadeform_catalog.py +5 -2
  11. sky/catalog/slurm_catalog.py +0 -7
  12. sky/catalog/vast_catalog.py +30 -6
  13. sky/check.py +11 -8
  14. sky/client/cli/command.py +106 -54
  15. sky/client/interactive_utils.py +190 -0
  16. sky/client/sdk.py +8 -0
  17. sky/client/sdk_async.py +9 -0
  18. sky/clouds/aws.py +60 -2
  19. sky/clouds/azure.py +2 -0
  20. sky/clouds/kubernetes.py +2 -0
  21. sky/clouds/runpod.py +38 -7
  22. sky/clouds/slurm.py +44 -12
  23. sky/clouds/ssh.py +1 -1
  24. sky/clouds/vast.py +30 -17
  25. sky/core.py +69 -1
  26. sky/dashboard/out/404.html +1 -1
  27. sky/dashboard/out/_next/static/3nu-b8raeKRNABZ2d4GAG/_buildManifest.js +1 -0
  28. sky/dashboard/out/_next/static/chunks/1871-0565f8975a7dcd10.js +6 -0
  29. sky/dashboard/out/_next/static/chunks/2109-55a1546d793574a7.js +11 -0
  30. sky/dashboard/out/_next/static/chunks/2521-099b07cd9e4745bf.js +26 -0
  31. sky/dashboard/out/_next/static/chunks/2755.a636e04a928a700e.js +31 -0
  32. sky/dashboard/out/_next/static/chunks/3495.05eab4862217c1a5.js +6 -0
  33. sky/dashboard/out/_next/static/chunks/3785.cfc5dcc9434fd98c.js +1 -0
  34. sky/dashboard/out/_next/static/chunks/3981.645d01bf9c8cad0c.js +21 -0
  35. sky/dashboard/out/_next/static/chunks/4083-0115d67c1fb57d6c.js +21 -0
  36. sky/dashboard/out/_next/static/chunks/{8640.5b9475a2d18c5416.js → 429.a58e9ba9742309ed.js} +2 -2
  37. sky/dashboard/out/_next/static/chunks/4555.8e221537181b5dc1.js +6 -0
  38. sky/dashboard/out/_next/static/chunks/4725.937865b81fdaaebb.js +6 -0
  39. sky/dashboard/out/_next/static/chunks/6082-edabd8f6092300ce.js +25 -0
  40. sky/dashboard/out/_next/static/chunks/6989-49cb7dca83a7a62d.js +1 -0
  41. sky/dashboard/out/_next/static/chunks/6990-630bd2a2257275f8.js +1 -0
  42. sky/dashboard/out/_next/static/chunks/7248-a99800d4db8edabd.js +1 -0
  43. sky/dashboard/out/_next/static/chunks/754-cfc5d4ad1b843d29.js +18 -0
  44. sky/dashboard/out/_next/static/chunks/8050-dd8aa107b17dce00.js +16 -0
  45. sky/dashboard/out/_next/static/chunks/8056-d4ae1e0cb81e7368.js +1 -0
  46. sky/dashboard/out/_next/static/chunks/8555.011023e296c127b3.js +6 -0
  47. sky/dashboard/out/_next/static/chunks/8821-93c25df904a8362b.js +1 -0
  48. sky/dashboard/out/_next/static/chunks/8969-0662594b69432ade.js +1 -0
  49. sky/dashboard/out/_next/static/chunks/9025.f15c91c97d124a5f.js +6 -0
  50. sky/dashboard/out/_next/static/chunks/{9353-8369df1cf105221c.js → 9353-7ad6bd01858556f1.js} +1 -1
  51. sky/dashboard/out/_next/static/chunks/pages/_app-5a86569acad99764.js +34 -0
  52. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-8297476714acb4ac.js +6 -0
  53. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-337c3ba1085f1210.js +1 -0
  54. sky/dashboard/out/_next/static/chunks/pages/{clusters-9e5d47818b9bdadd.js → clusters-57632ff3684a8b5c.js} +1 -1
  55. sky/dashboard/out/_next/static/chunks/pages/infra/[context]-5fd3a453c079c2ea.js +1 -0
  56. sky/dashboard/out/_next/static/chunks/pages/infra-9f85c02c9c6cae9e.js +1 -0
  57. sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-90f16972cbecf354.js +1 -0
  58. sky/dashboard/out/_next/static/chunks/pages/jobs/pools/[pool]-2dd42fc37aad427a.js +16 -0
  59. sky/dashboard/out/_next/static/chunks/pages/jobs-ed806aeace26b972.js +1 -0
  60. sky/dashboard/out/_next/static/chunks/pages/users-bec34706b36f3524.js +1 -0
  61. sky/dashboard/out/_next/static/chunks/pages/{volumes-ef19d49c6d0e8500.js → volumes-a83ba9b38dff7ea9.js} +1 -1
  62. sky/dashboard/out/_next/static/chunks/pages/workspaces/{[name]-96e0f298308da7e2.js → [name]-c781e9c3e52ef9fc.js} +1 -1
  63. sky/dashboard/out/_next/static/chunks/pages/workspaces-91e0942f47310aae.js +1 -0
  64. sky/dashboard/out/_next/static/chunks/webpack-cfe59cf684ee13b9.js +1 -0
  65. sky/dashboard/out/_next/static/css/b0dbca28f027cc19.css +3 -0
  66. sky/dashboard/out/clusters/[cluster]/[job].html +1 -1
  67. sky/dashboard/out/clusters/[cluster].html +1 -1
  68. sky/dashboard/out/clusters.html +1 -1
  69. sky/dashboard/out/config.html +1 -1
  70. sky/dashboard/out/index.html +1 -1
  71. sky/dashboard/out/infra/[context].html +1 -1
  72. sky/dashboard/out/infra.html +1 -1
  73. sky/dashboard/out/jobs/[job].html +1 -1
  74. sky/dashboard/out/jobs/pools/[pool].html +1 -1
  75. sky/dashboard/out/jobs.html +1 -1
  76. sky/dashboard/out/plugins/[...slug].html +1 -1
  77. sky/dashboard/out/users.html +1 -1
  78. sky/dashboard/out/volumes.html +1 -1
  79. sky/dashboard/out/workspace/new.html +1 -1
  80. sky/dashboard/out/workspaces/[name].html +1 -1
  81. sky/dashboard/out/workspaces.html +1 -1
  82. sky/data/data_utils.py +26 -12
  83. sky/data/mounting_utils.py +29 -4
  84. sky/global_user_state.py +108 -16
  85. sky/jobs/client/sdk.py +8 -3
  86. sky/jobs/controller.py +191 -31
  87. sky/jobs/recovery_strategy.py +109 -11
  88. sky/jobs/server/core.py +81 -4
  89. sky/jobs/server/server.py +14 -0
  90. sky/jobs/state.py +417 -19
  91. sky/jobs/utils.py +73 -80
  92. sky/models.py +9 -0
  93. sky/optimizer.py +2 -1
  94. sky/provision/__init__.py +11 -9
  95. sky/provision/kubernetes/utils.py +122 -15
  96. sky/provision/kubernetes/volume.py +52 -17
  97. sky/provision/provisioner.py +2 -1
  98. sky/provision/runpod/instance.py +3 -1
  99. sky/provision/runpod/utils.py +13 -1
  100. sky/provision/runpod/volume.py +25 -9
  101. sky/provision/slurm/instance.py +75 -29
  102. sky/provision/slurm/utils.py +213 -107
  103. sky/provision/vast/utils.py +1 -0
  104. sky/resources.py +135 -13
  105. sky/schemas/api/responses.py +4 -0
  106. sky/schemas/db/global_user_state/010_save_ssh_key.py +1 -1
  107. sky/schemas/db/spot_jobs/008_add_full_resources.py +34 -0
  108. sky/schemas/db/spot_jobs/009_job_events.py +32 -0
  109. sky/schemas/db/spot_jobs/010_job_events_timestamp_with_timezone.py +43 -0
  110. sky/schemas/db/spot_jobs/011_add_links.py +34 -0
  111. sky/schemas/generated/jobsv1_pb2.py +9 -5
  112. sky/schemas/generated/jobsv1_pb2.pyi +12 -0
  113. sky/schemas/generated/jobsv1_pb2_grpc.py +44 -0
  114. sky/schemas/generated/managed_jobsv1_pb2.py +32 -28
  115. sky/schemas/generated/managed_jobsv1_pb2.pyi +11 -2
  116. sky/serve/serve_utils.py +232 -40
  117. sky/server/common.py +17 -0
  118. sky/server/constants.py +1 -1
  119. sky/server/metrics.py +6 -3
  120. sky/server/plugins.py +16 -0
  121. sky/server/requests/payloads.py +18 -0
  122. sky/server/requests/request_names.py +2 -0
  123. sky/server/requests/requests.py +28 -10
  124. sky/server/requests/serializers/encoders.py +5 -0
  125. sky/server/requests/serializers/return_value_serializers.py +14 -4
  126. sky/server/server.py +434 -107
  127. sky/server/uvicorn.py +5 -0
  128. sky/setup_files/MANIFEST.in +1 -0
  129. sky/setup_files/dependencies.py +21 -10
  130. sky/sky_logging.py +2 -1
  131. sky/skylet/constants.py +22 -5
  132. sky/skylet/executor/slurm.py +4 -6
  133. sky/skylet/job_lib.py +89 -4
  134. sky/skylet/services.py +18 -3
  135. sky/ssh_node_pools/deploy/tunnel/cleanup-tunnel.sh +62 -0
  136. sky/ssh_node_pools/deploy/tunnel/ssh-tunnel.sh +379 -0
  137. sky/templates/kubernetes-ray.yml.j2 +4 -6
  138. sky/templates/slurm-ray.yml.j2 +32 -2
  139. sky/templates/websocket_proxy.py +18 -41
  140. sky/users/permission.py +61 -51
  141. sky/utils/auth_utils.py +42 -0
  142. sky/utils/cli_utils/status_utils.py +19 -5
  143. sky/utils/cluster_utils.py +10 -3
  144. sky/utils/command_runner.py +256 -94
  145. sky/utils/command_runner.pyi +16 -0
  146. sky/utils/common_utils.py +30 -29
  147. sky/utils/context.py +32 -0
  148. sky/utils/db/db_utils.py +36 -6
  149. sky/utils/db/migration_utils.py +41 -21
  150. sky/utils/infra_utils.py +5 -1
  151. sky/utils/instance_links.py +139 -0
  152. sky/utils/interactive_utils.py +49 -0
  153. sky/utils/kubernetes/generate_kubeconfig.sh +42 -33
  154. sky/utils/kubernetes/rsync_helper.sh +5 -1
  155. sky/utils/plugin_extensions/__init__.py +14 -0
  156. sky/utils/plugin_extensions/external_failure_source.py +176 -0
  157. sky/utils/resources_utils.py +10 -8
  158. sky/utils/rich_utils.py +9 -11
  159. sky/utils/schemas.py +63 -20
  160. sky/utils/status_lib.py +7 -0
  161. sky/utils/subprocess_utils.py +17 -0
  162. sky/volumes/client/sdk.py +6 -3
  163. sky/volumes/server/core.py +65 -27
  164. sky_templates/ray/start_cluster +8 -4
  165. {skypilot_nightly-1.0.0.dev20251210.dist-info → skypilot_nightly-1.0.0.dev20260112.dist-info}/METADATA +53 -57
  166. {skypilot_nightly-1.0.0.dev20251210.dist-info → skypilot_nightly-1.0.0.dev20260112.dist-info}/RECORD +172 -162
  167. sky/dashboard/out/_next/static/KYAhEFa3FTfq4JyKVgo-s/_buildManifest.js +0 -1
  168. sky/dashboard/out/_next/static/chunks/1141-9c810f01ff4f398a.js +0 -11
  169. sky/dashboard/out/_next/static/chunks/1871-7e202677c42f43fe.js +0 -6
  170. sky/dashboard/out/_next/static/chunks/2260-7703229c33c5ebd5.js +0 -1
  171. sky/dashboard/out/_next/static/chunks/2350.fab69e61bac57b23.js +0 -1
  172. sky/dashboard/out/_next/static/chunks/2369.fc20f0c2c8ed9fe7.js +0 -15
  173. sky/dashboard/out/_next/static/chunks/2755.edd818326d489a1d.js +0 -26
  174. sky/dashboard/out/_next/static/chunks/3294.ddda8c6c6f9f24dc.js +0 -1
  175. sky/dashboard/out/_next/static/chunks/3785.7e245f318f9d1121.js +0 -1
  176. sky/dashboard/out/_next/static/chunks/3800-b589397dc09c5b4e.js +0 -1
  177. sky/dashboard/out/_next/static/chunks/4725.172ede95d1b21022.js +0 -1
  178. sky/dashboard/out/_next/static/chunks/4937.a2baa2df5572a276.js +0 -15
  179. sky/dashboard/out/_next/static/chunks/6212-7bd06f60ba693125.js +0 -13
  180. sky/dashboard/out/_next/static/chunks/6856-da20c5fd999f319c.js +0 -1
  181. sky/dashboard/out/_next/static/chunks/6989-01359c57e018caa4.js +0 -1
  182. sky/dashboard/out/_next/static/chunks/6990-09cbf02d3cd518c3.js +0 -1
  183. sky/dashboard/out/_next/static/chunks/7359-c8d04e06886000b3.js +0 -30
  184. sky/dashboard/out/_next/static/chunks/7411-b15471acd2cba716.js +0 -41
  185. sky/dashboard/out/_next/static/chunks/7615-019513abc55b3b47.js +0 -1
  186. sky/dashboard/out/_next/static/chunks/8969-452f9d5cbdd2dc73.js +0 -1
  187. sky/dashboard/out/_next/static/chunks/9025.fa408f3242e9028d.js +0 -6
  188. sky/dashboard/out/_next/static/chunks/9360.a536cf6b1fa42355.js +0 -31
  189. sky/dashboard/out/_next/static/chunks/9847.3aaca6bb33455140.js +0 -30
  190. sky/dashboard/out/_next/static/chunks/pages/_app-68b647e26f9d2793.js +0 -34
  191. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-33f525539665fdfd.js +0 -16
  192. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-a7565f586ef86467.js +0 -1
  193. sky/dashboard/out/_next/static/chunks/pages/infra/[context]-12c559ec4d81fdbd.js +0 -1
  194. sky/dashboard/out/_next/static/chunks/pages/infra-d187cd0413d72475.js +0 -1
  195. sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-895847b6cf200b04.js +0 -16
  196. sky/dashboard/out/_next/static/chunks/pages/jobs/pools/[pool]-8d0f4655400b4eb9.js +0 -21
  197. sky/dashboard/out/_next/static/chunks/pages/jobs-e5a98f17f8513a96.js +0 -1
  198. sky/dashboard/out/_next/static/chunks/pages/users-2f7646eb77785a2c.js +0 -1
  199. sky/dashboard/out/_next/static/chunks/pages/workspaces-cb4da3abe08ebf19.js +0 -1
  200. sky/dashboard/out/_next/static/chunks/webpack-fba3de387ff6bb08.js +0 -1
  201. sky/dashboard/out/_next/static/css/c5a4cfd2600fc715.css +0 -3
  202. /sky/dashboard/out/_next/static/{KYAhEFa3FTfq4JyKVgo-s → 3nu-b8raeKRNABZ2d4GAG}/_ssgManifest.js +0 -0
  203. /sky/dashboard/out/_next/static/chunks/pages/plugins/{[...slug]-4f46050ca065d8f8.js → [...slug]-449a9f5a3bb20fb3.js} +0 -0
  204. {skypilot_nightly-1.0.0.dev20251210.dist-info → skypilot_nightly-1.0.0.dev20260112.dist-info}/WHEEL +0 -0
  205. {skypilot_nightly-1.0.0.dev20251210.dist-info → skypilot_nightly-1.0.0.dev20260112.dist-info}/entry_points.txt +0 -0
  206. {skypilot_nightly-1.0.0.dev20251210.dist-info → skypilot_nightly-1.0.0.dev20260112.dist-info}/licenses/LICENSE +0 -0
  207. {skypilot_nightly-1.0.0.dev20251210.dist-info → skypilot_nightly-1.0.0.dev20260112.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,21 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3981,8555],{27325:function(e,s,r){r.d(s,{Z:function(){return t}});/**
2
+ * @license lucide-react v0.407.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */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}});/**
7
+ * @license lucide-react v0.407.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */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}});/**
12
+ * @license lucide-react v0.407.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */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 M},getWorkspaceClusters:function(){return z},getWorkspaceManagedJobs:function(){return D}});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 x=r(1812),h=r(13626),p=r(81260);/**
17
+ * @license lucide-react v0.407.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */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),v=r(23001),w=r(2109),k=r(6378),y=r(51214),b=r(36856),N=r(47145),C=r(94545),Z=r(93225),E=r(23266),S=r(68969),L=r(41664),P=r.n(L);async function z(e){try{return(await k.ZP.get(E.getClusters)||[]).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 D(e){try{let s=await k.ZP.get(S.getManagedJobs,[{allUsers:!0,skipFinished:!0}]);return{jobs:((null==s?void 0:s.jobs)||[]).filter(s=>s.workspace===e)}}catch(r){let s="Error fetching managed jobs for workspace ".concat(e,": ").concat(r);throw console.error(s),Error(s)}}let R=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 M(){let[e,s]=(0,a.useState)([]),[r,E]=(0,a.useState)({runningClusters:0,totalClusters:0,managedJobs:0}),[S,L]=(0,a.useState)(!0),[M,F]=(0,a.useState)(null),[O,W]=(0,a.useState)(null),[J,T]=(0,a.useState)({key:"name",direction:"asc"}),[A,V]=(0,a.useState)(""),[B,q]=(0,a.useState)(!1),[I,_]=(0,a.useState)({confirmOpen:!1,workspaceToDelete:null,deleting:!1,error:null}),[H,$]=(0,a.useState)({open:!1,message:"",userName:""}),[K,X]=(0,a.useState)(null),[G,U]=(0,a.useState)(!1),[Q,Y]=(0,a.useState)(null),[ee,es]=(0,a.useState)(null),er=(0,n.useRouter)(),et=(0,v.X)(),ea=async()=>{if(K&&Date.now()-K.timestamp<3e5)return K;U(!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),U(!1),r}catch(e){throw U(!1),e}},en=async(e,s)=>{try{let r=await ea();if("admin"!==r.role)return $({open:!0,message:e,userName:r.name.toLowerCase()}),!1;return s(),!0}catch(e){return console.error("Failed to check user role:",e),$({open:!0,message:"Error: ".concat(e.message),userName:""}),!1}},el=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&L(!0);try{let e=await k.ZP.get(l.getWorkspaces);F(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(D,[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(w.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 x=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(x),E({runningClusters:d,totalClusters:n.length,managedJobs:m})}catch(e){console.error("Error fetching workspace data:",e),s([]),E({runningClusters:0,totalClusters:0,managedJobs:0})}e&&L(!1)};(0,a.useEffect)(()=>{(async()=>{await b.ZP.preloadForPage("workspaces"),await el(!0),W(new Date)})();let e=setInterval(()=>{"visible"===window.document.visibilityState&&el(!1)},y.nb.REFRESH_INTERVAL);return()=>clearInterval(e)},[]);let eo=e=>{let s="asc";J.key===e&&"asc"===J.direction&&(s="desc"),T({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=Z.Z2[e.toLowerCase()]||e;return e.toLowerCase().includes(r)||s.toLowerCase().includes(r)}))||!!(!0===((null==M?void 0:M[e.name])||{}).private?"private":"public").includes(r))}return(0,C.R0)(s,J.key,J.direction)},[e,J,A,M]),ed=e=>{en("cannot delete workspace",()=>{_({confirmOpen:!0,workspaceToDelete:e,deleting:!1,error:null})})},eu=async()=>{if(I.workspaceToDelete){_(e=>({...e,deleting:!0,error:null}));try{await (0,l.zl)(I.workspaceToDelete),es('Workspace "'.concat(I.workspaceToDelete,'" deleted successfully!')),_({confirmOpen:!1,workspaceToDelete:null,deleting:!1,error:null}),k.ZP.invalidate(l.getWorkspaces),k.ZP.invalidateFunction(z),k.ZP.invalidateFunction(D),await el(!0)}catch(e){console.error("Error deleting workspace:",e),_(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(D),L(!0);try{await N.x.fetch("/check",{},"POST"),await el(!1),W(new Date)}catch(e){console.error("Error during sky check refresh:",e)}finally{L(!1)}},ex=()=>{_({confirmOpen:!1,workspaceToDelete:null,deleting:!1,error:null})},eh=e=>{en("cannot edit workspace",()=>{er.push("/workspaces/".concat(e))})};return S&&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)(x.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:[S&&(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..."})]}),!S&&O&&(0,t.jsx)(j.$3,{timestamp:O,className:"mr-2"}),(0,t.jsxs)("button",{onClick:em,disabled:S,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:[(0,t.jsx)(h.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=>V(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:()=>V(""),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:G,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:G?(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||S?(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:S&&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==M?void 0:M[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:()=>eh(e.name),disabled:G,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)(R,{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=Z.Z2[s.toLowerCase()]||s;return(0,t.jsxs)("span",{children:[(0,t.jsx)(P(),{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:()=>eh(e.name),disabled:G,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||G,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."})]}),M&&(0,t.jsx)(m.Vq,{open:B,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(M,{indent:2})})})]})}),(0,t.jsx)(m.Vq,{open:H.open,onOpenChange:e=>{$(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:G?(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:()=>$(e=>({...e,open:!1})),disabled:G,children:"OK"})})]})}),(0,t.jsx)(m.Vq,{open:I.confirmOpen,onOpenChange:e=>{e||(ex(),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 "',I.workspaceToDelete,'"? This action cannot be undone.']})]}),(0,t.jsxs)(m.cN,{children:[(0,t.jsx)(i.z,{variant:"outline",onClick:ex,disabled:I.deleting,children:"Cancel"}),(0,t.jsx)(i.z,{variant:"destructive",onClick:eu,disabled:I.deleting,children:I.deleting?"Deleting...":"Delete"})]})]})})]})}y.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)}}}]);
@@ -0,0 +1,21 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4083],{16826:function(e,r,t){t.d(r,{Z:function(){return n}});/**
2
+ * @license lucide-react v0.407.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */let n=(0,t(60998).Z)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},88507:function(e,r,t){t.d(r,{Z:function(){return n}});/**
7
+ * @license lucide-react v0.407.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */let n=(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"}]])},13626:function(e,r,t){t.d(r,{Z:function(){return n}});/**
12
+ * @license lucide-react v0.407.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */let n=(0,t(60998).Z)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])},28586:function(e,r,t){t.d(r,{Z:function(){return n}});/**
17
+ * @license lucide-react v0.407.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */let n=(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"}]])},99307:function(e,r,t){t.d(r,{Cl:function(){return u},OE:function(){return o}});var n=t(85893);t(67294);var s=t(55739),c=t(36989),a=t(53850);let u=e=>{switch(e){case"LAUNCHING":return"bg-blue-100 text-sky-blue";case"RUNNING":case"IN_USE":case"READY":return"bg-green-50 text-green-700";case"STOPPED":return"bg-yellow-100 text-yellow-800";case"TERMINATED":case"PENDING":case"UNKNOWN":default:return"bg-gray-100 text-gray-800";case"SUCCEEDED":case"PROVISIONING":case"CONTROLLER_INIT":case"REPLICA_INIT":return"bg-blue-50 text-blue-700";case"FAILED":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":case"FAILED_INITIAL_DELAY":case"FAILED_PROBING":case"FAILED_PROVISION":case"FAILED_CLEANUP":case"CONTROLLER_FAILED":return"bg-red-50 text-red-700";case"CANCELLED":case"CANCELLING":case"NOT_READY":return"bg-yellow-50 text-yellow-700";case"RECOVERING":case"SHUTTING_DOWN":return"bg-orange-50 text-orange-700";case"SUBMITTED":return"bg-indigo-50 text-indigo-700";case"STARTING":return"bg-cyan-50 text-cyan-700";case"FAILED_SETUP":return"bg-pink-50 text-pink-700";case"PREEMPTED":case"NO_REPLICA":return"bg-purple-50 text-purple-700"}},l=e=>{switch(e){case"LAUNCHING":case"STARTING":case"PROVISIONING":case"SHUTTING_DOWN":return(0,n.jsx)(s.Z,{size:12,className:"w-3 h-3 mr-1"});case"RUNNING":case"IN_USE":default:return(0,n.jsx)(a.W2,{className:"w-3 h-3 mr-1"});case"STOPPED":case"PREEMPTED":return(0,n.jsx)(a.fp,{className:"w-3 h-3 mr-1"});case"TERMINATED":case"FAILED":case"CANCELLED":case"FAILED_INITIAL_DELAY":case"FAILED_PROBING":case"FAILED_PROVISION":case"FAILED_CLEANUP":case"CONTROLLER_FAILED":case"UNKNOWN":return(0,n.jsx)(a.Ps,{className:"w-3 h-3 mr-1"});case"SUCCEEDED":return(0,n.jsx)(a.Ye,{className:"w-3 h-3 mr-1"});case"PENDING":case"RECOVERING":case"SUBMITTED":case"CANCELLING":case"FAILED_SETUP":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":case"READY":case"NOT_READY":case"CONTROLLER_INIT":case"REPLICA_INIT":case"NO_REPLICA":return(0,n.jsx)(a.J$,{className:"w-3 h-3 mr-1"})}},i=e=>{let r=u(e),t=l(e);return(0,n.jsxs)("span",{className:"".concat("inline-flex items-center px-2 py-1 rounded-full text-sm"," ").concat(r),children:[t,e]})},o=e=>{let{status:r,statusTooltip:t}=e,s=t||r;return(0,n.jsx)(c.WH,{content:s,className:"text-muted-foreground text-sm",children:(0,n.jsx)("span",{children:i(r)})})}},20546:function(e,r,t){t.d(r,{H:function(){return o}});var n=t(85893);t(67294);var s=t(41664),c=t.n(s),a=t(45697),u=t.n(a);function l(e){return!!e&&"string"==typeof e&&e.toLowerCase().startsWith("sa-")}let i=()=>(0,n.jsx)("span",{className:"px-2 py-0.5 text-xs bg-blue-100 text-blue-700 rounded font-medium ml-1",children:"SA"}),o=e=>{let{username:r,userHash:t,className:s="flex items-center gap-1",linkClassName:a="text-gray-700 hover:text-blue-600 hover:underline",showBadge:u=!0}=e,o=l(t),d=l(t)?"/users?tab=service-accounts":"/users";return(0,n.jsxs)("div",{className:s,children:[(0,n.jsx)(c(),{href:d,className:a,children:r}),u&&o&&(0,n.jsx)(i,{})]})};o.propTypes={username:u().string.isRequired,userHash:u().string,className:u().string,linkClassName:u().string,showBadge:u().bool}},37673:function(e,r,t){t.d(r,{Ol:function(){return i},Zb:function(){return l},aY:function(){return N},ll:function(){return o}});var n=t(85893),s=t(67294),c=t(45697),a=t.n(c),u=t(32350);let l=s.forwardRef((e,r)=>{let{className:t,children:s,...c}=e;return(0,n.jsx)("div",{ref:r,className:(0,u.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",t),...c,children:s})});l.displayName="Card",l.propTypes={className:a().string,children:a().node};let i=s.forwardRef((e,r)=>{let{className:t,children:s,...c}=e;return(0,n.jsx)("div",{ref:r,className:(0,u.cn)("flex flex-col space-y-1.5 p-6",t),...c,children:s})});i.displayName="CardHeader",i.propTypes={className:a().string,children:a().node};let o=s.forwardRef((e,r)=>{let{className:t,children:s,...c}=e;return(0,n.jsx)("h3",{ref:r,className:(0,u.cn)("text-2xl font-semibold leading-none tracking-tight",t),...c,children:s})});o.displayName="CardTitle",o.propTypes={className:a().string,children:a().node};let d=s.forwardRef((e,r)=>{let{className:t,children:s,...c}=e;return(0,n.jsx)("p",{ref:r,className:(0,u.cn)("text-sm text-muted-foreground",t),...c,children:s})});d.displayName="CardDescription",d.propTypes={className:a().string,children:a().node};let N=s.forwardRef((e,r)=>{let{className:t,children:s,...c}=e;return(0,n.jsx)("div",{ref:r,className:(0,u.cn)("p-6 pt-0",t),...c,children:s})});N.displayName="CardContent",N.propTypes={className:a().string,children:a().node};let E=s.forwardRef((e,r)=>{let{className:t,children:s,...c}=e;return(0,n.jsx)("div",{ref:r,className:(0,u.cn)("flex items-center p-6 pt-0",t),...c,children:s})});E.displayName="CardFooter",E.propTypes={className:a().string,children:a().node}},21494:function(e,r,t){t.d(r,{V:function(){return c}});var n=t(67294),s=t(36989);function c(e){let{streamFn:r,streamArgs:t,enabled:c=!0,refreshTrigger:a=0,maxLineChars:u=2e3,maxRenderLines:l=5e3,flushIntervalMs:i=100,onError:o=e=>{}}=e,[d,N]=(0,n.useState)([]),[E,f]=(0,n.useState)(!1),[p,h]=(0,n.useState)(!1),[I,g]=(0,n.useState)(0),m=(0,n.useRef)([]),R=(0,n.useRef)(""),L=(0,n.useRef)(new Map),x=(0,n.useRef)(null),C=(0,n.useRef)(null),A=(0,n.useRef)(!1),y=(0,n.useRef)(o);(0,n.useEffect)(()=>{y.current=o},[o]);let D=(0,n.useCallback)(()=>{m.current=[],R.current="",L.current=new Map,A.current=!1,N([]),h(!1)},[]),T=(0,n.useMemo)(()=>[...d,...Array.from(L.current.values())],[d,I]),O=(0,n.useCallback)(()=>{0!==m.current.length&&N(e=>{let r=[...e,...m.current];return m.current=[],r.length>l?r.slice(r.length-l):r})},[l]);return(0,n.useEffect)(()=>{let e=!0;if(D(),!c||!r)return f(!1),()=>{};let n=new AbortController;C.current=n;let a=()=>{x.current||(x.current=setTimeout(()=>{x.current=null,O()},i))},o=e=>{let r=e.match(/^\(([^)]+)\)/);if(r){L.current.set(r[1],e),g(e=>e+1);return}m.current.push(e),m.current.length>2*l&&(m.current=m.current.slice(m.current.length-l))},d=e=>{let r=e.split("\n");r[0]=R.current+r[0];let t=e.endsWith("\n");R.current=t?"":r.pop()||"";let n=r.filter(e=>e.trim());for(let e of(!A.current&&n.length>0&&(A.current=!0,h(!0)),n)){let r=(0,s.Zn)(e);!(0,s.Zt)(r)&&(r.length>u&&(r=r.slice(0,u)+" … [truncated]"),/\d+%\s*\|/.test(r)?o(r):(m.current.push(r),m.current.length>2*l&&(m.current=m.current.slice(m.current.length-l))))}a()};return f(!0),r({...t,onNewLog:r=>{e&&d(r)},signal:n.signal}).then(()=>{e&&(R.current&&(m.current.push(R.current),R.current=""),O(),f(!1))}).catch(r=>{if(!e||"AbortError"===r.name)return;let t=y.current;t&&t(r),N(e=>[...e,"Error fetching logs: ".concat(r.message)]),f(!1)}),()=>{e=!1,x.current&&(clearTimeout(x.current),x.current=null),C.current&&(C.current.abort(),C.current=null),m.current=[],R.current="",L.current.clear()}},[r,t,c,a,O,i,u,l,D]),{lines:T,isLoading:E,hasReceivedFirstChunk:p}}},23001:function(e,r,t){t.d(r,{X:function(){return s}});var n=t(67294);function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:768,[r,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let r=()=>{t(window.innerWidth<e)};return r(),window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[e]),r}},32350:function(e,r,t){t.d(r,{cn:function(){return c}});var n=t(90512),s=t(98388);function c(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return(0,s.m6)((0,n.W)(r))}}}]);
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8640],{88507:function(e,n,t){t.d(n,{Z:function(){return r}});/**
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[429],{88507:function(e,n,t){t.d(n,{Z:function(){return r}});/**
2
2
  * @license lucide-react v0.407.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -13,4 +13,4 @@
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */let r=(0,t(60998).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},23001:function(e,n,t){t.d(n,{X:function(){return l}});var r=t(67294);function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:768,[n,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let n=()=>{t(window.innerWidth<e)};return n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}},[e]),n}},12003:function(e,n,t){t.d(n,{j:function(){return i}});var r=t(90512);let l=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,u=r.W,i=(e,n)=>t=>{var r;if((null==n?void 0:n.variants)==null)return u(e,null==t?void 0:t.class,null==t?void 0:t.className);let{variants:i,defaultVariants:a}=n,d=Object.keys(i).map(e=>{let n=null==t?void 0:t[e],r=null==a?void 0:a[e];if(null===n)return null;let u=l(n)||l(r);return i[e][u]}),s=t&&Object.entries(t).reduce((e,n)=>{let[t,r]=n;return void 0===r||(e[t]=r),e},{});return u(e,d,null==n?void 0:null===(r=n.compoundVariants)||void 0===r?void 0:r.reduce((e,n)=>{let{class:t,className:r,...l}=n;return Object.entries(l).every(e=>{let[n,t]=e;return Array.isArray(t)?t.includes({...a,...s}[n]):({...a,...s})[n]===t})?[...e,t,r]:e},[]),null==t?void 0:t.class,null==t?void 0:t.className)}}}]);
16
+ */let r=(0,t(60998).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},23001:function(e,n,t){t.d(n,{X:function(){return u}});var r=t(67294);function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:768,[n,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let n=()=>{t(window.innerWidth<e)};return n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}},[e]),n}},32350:function(e,n,t){t.d(n,{cn:function(){return i}});var r=t(90512),u=t(98388);function i(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];return(0,u.m6)((0,r.W)(n))}}}]);
@@ -0,0 +1,6 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4555],{27325:function(e,s,n){n.d(s,{Z:function(){return t}});/**
2
+ * @license lucide-react v0.407.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */let t=(0,n(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"}]])},20546:function(e,s,n){n.d(s,{H:function(){return d}});var t=n(85893);n(67294);var c=n(41664),r=n.n(c),a=n(45697),l=n.n(a);function i(e){return!!e&&"string"==typeof e&&e.toLowerCase().startsWith("sa-")}let o=()=>(0,t.jsx)("span",{className:"px-2 py-0.5 text-xs bg-blue-100 text-blue-700 rounded font-medium ml-1",children:"SA"}),d=e=>{let{username:s,userHash:n,className:c="flex items-center gap-1",linkClassName:a="text-gray-700 hover:text-blue-600 hover:underline",showBadge:l=!0}=e,d=i(n),m=i(n)?"/users?tab=service-accounts":"/users";return(0,t.jsxs)("div",{className:c,children:[(0,t.jsx)(r(),{href:m,className:a,children:s}),l&&d&&(0,t.jsx)(o,{})]})};d.propTypes={username:l().string.isRequired,userHash:l().string,className:l().string,linkClassName:l().string,showBadge:l().bool}},92128:function(e,s,n){n.d(s,{Oh:function(){return h},_R:function(){return x},cV:function(){return u}});var t=n(85893),c=n(67294),r=n(50326),a=n(30803),l=n(37673),i=n(27325),o=n(36989),d=n(93225),m=n(23001);function h(e){let{isOpen:s,onClose:n,cluster:d}=e,[m,h]=c.useState(!1),x=e=>{navigator.clipboard.writeText(e),h(!0),setTimeout(()=>h(!1),2e3)},u=["sky status ".concat(d),"ssh ".concat(d)],j=u.join("\n");return(0,t.jsx)(r.Vq,{open:s,onOpenChange:n,children:(0,t.jsxs)(r.cZ,{className:"sm:max-w-md",children:[(0,t.jsxs)(r.fK,{children:[(0,t.jsxs)(r.$N,{children:["Connect to: ",(0,t.jsx)("span",{className:"font-light",children:d})]}),(0,t.jsx)(r.Be,{children:"Use these instructions to connect to your cluster via SSH."})]}),(0,t.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-medium mb-2",children:"SSH Command"}),(0,t.jsx)(l.Zb,{className:"p-3 bg-gray-50",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("pre",{className:"text-sm w-full whitespace-pre-wrap",children:u.map((e,s)=>(0,t.jsx)("code",{className:"block",children:e},s))}),(0,t.jsx)(o.WH,{content:m?"Copied!":"Copy command",children:(0,t.jsx)(a.z,{variant:"ghost",size:"icon",onClick:()=>x(j),className:"h-8 w-8 rounded-full",children:(0,t.jsx)(i.Z,{className:"h-4 w-4"})})})]})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-medium mb-2",children:"Additional Information"}),(0,t.jsxs)("p",{className:"text-sm text-secondary-foreground",children:["Make sure to run"," ",(0,t.jsxs)("code",{className:"text-sm",children:["sky status ",d]})," first to have SkyPilot set up the SSH access."]})]})]})]})})}function x(e){let{isOpen:s,onClose:n,cluster:c}=e,h=(0,m.X)();return(0,t.jsx)(r.Vq,{open:s,onOpenChange:n,children:(0,t.jsx)(r.cZ,{className:"sm:max-w-3xl",children:(0,t.jsxs)(r.fK,{children:[(0,t.jsxs)(r.$N,{children:["Connect to: ",(0,t.jsx)("span",{className:"font-light",children:c})]}),(0,t.jsx)(r.Be,{children:(0,t.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-medium mb-2 my-2",children:"Setup SSH access"}),(0,t.jsx)(l.Zb,{className:"p-3 bg-gray-50",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("pre",{className:"text-sm",children:(0,t.jsxs)("code",{children:["sky status ",c]})}),(0,t.jsx)(o.WH,{content:"Copy command",children:(0,t.jsx)(a.z,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText("sky status ".concat(c)),className:"h-8 w-8 rounded-full",children:(0,t.jsx)(i.Z,{className:"h-4 w-4"})})})]})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-medium mb-2 my-2",children:"Connect with VSCode/Cursor"}),(0,t.jsx)(l.Zb,{className:"p-3 bg-gray-50",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("pre",{className:"text-sm",children:(0,t.jsxs)("code",{children:["code --remote ssh-remote+",c,' "/home"']})}),(0,t.jsx)(o.WH,{content:"Copy command",children:(0,t.jsx)(a.z,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText("code --remote ssh-remote+".concat(c,' "/home"')),className:"h-8 w-8 rounded-full",children:(0,t.jsx)(i.Z,{className:"h-4 w-4"})})})]})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:"Or use the GUI to connect"}),(0,t.jsx)("div",{className:"relative ".concat(h?"-mt-5":"-mt-10"),style:{paddingBottom:"70%"},children:(0,t.jsxs)("video",{className:"absolute top-0 left-0 w-full h-full rounded-lg",controls:!0,autoPlay:!0,muted:!0,preload:"metadata",children:[(0,t.jsx)("source",{src:"".concat(d.GW,"/videos/cursor-small.mp4"),type:"video/mp4"}),"Your browser does not support the video tag."]})})]})]})})]})})})}function u(e){let{isOpen:s,onClose:n,onConfirm:c,title:l,message:i,confirmText:o="Confirm",confirmVariant:d="destructive",confirmClassName:m=null}=e;return(0,t.jsx)(r.Vq,{open:s,onOpenChange:n,children:(0,t.jsxs)(r.cZ,{className:"sm:max-w-md",children:[(0,t.jsxs)(r.fK,{children:[(0,t.jsx)(r.$N,{children:l}),(0,t.jsx)(r.Be,{children:i})]}),(0,t.jsxs)(r.cN,{className:"flex justify-end gap-2 pt-4",children:[(0,t.jsx)(a.z,{variant:"outline",onClick:n,children:"Cancel"}),(0,t.jsx)(a.z,{variant:m?void 0:d,className:m,onClick:()=>{c(),n()},children:o})]})]})})}},55988:function(e,s,n){n.d(s,{j:function(){return r}});var t=n(85893);n(67294);var c=n(23800);function r(e){let{name:s,context:n={},fallback:r=null,wrapperClassName:a=""}=e,l=(0,c.dL)(s);return 0===l.length?r:(0,t.jsx)("div",{className:a||void 0,children:l.map(e=>{let s=e.component;return(0,t.jsx)(s,{...n},e.id)})})}}}]);
@@ -0,0 +1,6 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4725],{47603:function(e,s,r){r.d(s,{Z:function(){return t}});/**
2
+ * @license lucide-react v0.407.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */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,[c,i]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{s&&i(!1)},[s]),!s||c)return null;let o="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,":"]})," ",o]})})]}),(0,t.jsx)("button",{onClick:()=>{i(!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"})})})]})})}},99307:function(e,s,r){r.d(s,{Cl:function(){return c},OE:function(){return d}});var t=r(85893);r(67294);var a=r(55739),n=r(36989),l=r(53850);let c=e=>{switch(e){case"LAUNCHING":return"bg-blue-100 text-sky-blue";case"RUNNING":case"IN_USE":case"READY":return"bg-green-50 text-green-700";case"STOPPED":return"bg-yellow-100 text-yellow-800";case"TERMINATED":case"PENDING":case"UNKNOWN":default:return"bg-gray-100 text-gray-800";case"SUCCEEDED":case"PROVISIONING":case"CONTROLLER_INIT":case"REPLICA_INIT":return"bg-blue-50 text-blue-700";case"FAILED":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":case"FAILED_INITIAL_DELAY":case"FAILED_PROBING":case"FAILED_PROVISION":case"FAILED_CLEANUP":case"CONTROLLER_FAILED":return"bg-red-50 text-red-700";case"CANCELLED":case"CANCELLING":case"NOT_READY":return"bg-yellow-50 text-yellow-700";case"RECOVERING":case"SHUTTING_DOWN":return"bg-orange-50 text-orange-700";case"SUBMITTED":return"bg-indigo-50 text-indigo-700";case"STARTING":return"bg-cyan-50 text-cyan-700";case"FAILED_SETUP":return"bg-pink-50 text-pink-700";case"PREEMPTED":case"NO_REPLICA":return"bg-purple-50 text-purple-700"}},i=e=>{switch(e){case"LAUNCHING":case"STARTING":case"PROVISIONING":case"SHUTTING_DOWN":return(0,t.jsx)(a.Z,{size:12,className:"w-3 h-3 mr-1"});case"RUNNING":case"IN_USE":default:return(0,t.jsx)(l.W2,{className:"w-3 h-3 mr-1"});case"STOPPED":case"PREEMPTED":return(0,t.jsx)(l.fp,{className:"w-3 h-3 mr-1"});case"TERMINATED":case"FAILED":case"CANCELLED":case"FAILED_INITIAL_DELAY":case"FAILED_PROBING":case"FAILED_PROVISION":case"FAILED_CLEANUP":case"CONTROLLER_FAILED":case"UNKNOWN":return(0,t.jsx)(l.Ps,{className:"w-3 h-3 mr-1"});case"SUCCEEDED":return(0,t.jsx)(l.Ye,{className:"w-3 h-3 mr-1"});case"PENDING":case"RECOVERING":case"SUBMITTED":case"CANCELLING":case"FAILED_SETUP":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":case"READY":case"NOT_READY":case"CONTROLLER_INIT":case"REPLICA_INIT":case"NO_REPLICA":return(0,t.jsx)(l.J$,{className:"w-3 h-3 mr-1"})}},o=e=>{let s=c(e),r=i(e);return(0,t.jsxs)("span",{className:"".concat("inline-flex items-center px-2 py-1 rounded-full text-sm"," ").concat(s),children:[r,e]})},d=e=>{let{status:s,statusTooltip:r}=e,a=r||s;return(0,t.jsx)(n.WH,{content:a,className:"text-muted-foreground text-sm",children:(0,t.jsx)("span",{children:o(s)})})}},68764:function(e,s,r){r.d(s,{RM:function(){return i},SC:function(){return o},iA:function(){return l},pj:function(){return u},ss:function(){return d},xD:function(){return c}});var t=r(85893),a=r(67294),n=r(32350);let l=a.forwardRef((e,s)=>{let{className:r,...a}=e;return(0,t.jsx)("div",{className:"relative w-full overflow-auto",children:(0,t.jsx)("table",{ref:s,className:(0,n.cn)("w-full caption-bottom text-base",r),...a})})});l.displayName="Table";let c=a.forwardRef((e,s)=>{let{className:r,...a}=e;return(0,t.jsx)("thead",{ref:s,className:(0,n.cn)("[&_tr]:border-b",r),...a})});c.displayName="TableHeader";let i=a.forwardRef((e,s)=>{let{className:r,...a}=e;return(0,t.jsx)("tbody",{ref:s,className:(0,n.cn)("[&_tr:last-child]:border-0",r),...a})});i.displayName="TableBody",a.forwardRef((e,s)=>{let{className:r,...a}=e;return(0,t.jsx)("tfoot",{ref:s,className:(0,n.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",r),...a})}).displayName="TableFooter";let o=a.forwardRef((e,s)=>{let{className:r,...a}=e;return(0,t.jsx)("tr",{ref:s,className:(0,n.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",r),...a})});o.displayName="TableRow";let d=a.forwardRef((e,s)=>{let{className:r,...a}=e;return(0,t.jsx)("th",{ref:s,className:(0,n.cn)("h-12 px-4 text-left align-middle font-medium text-[hsl(var(--text-strong))] [&:has([role=checkbox])]:pr-0",r),...a})});d.displayName="TableHead";let u=a.forwardRef((e,s)=>{let{className:r,...a}=e;return(0,t.jsx)("td",{ref:s,className:(0,n.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...a})});u.displayName="TableCell",a.forwardRef((e,s)=>{let{className:r,...a}=e;return(0,t.jsx)("caption",{ref:s,className:(0,n.cn)("mt-4 text-base text-muted-foreground",r),...a})}).displayName="TableCaption"},54725:function(e,s,r){r.r(s),r.d(s,{Volumes:function(){return R}});var t=r(85893),a=r(67294),n=r(45697),l=r.n(n),c=r(55739),i=r(65168),o=r(30803),d=r(68764),u=r(19238),h=r(51214),x=r(94545),m=r(13626),N=r(47603),p=r(23001),f=r(37673),j=r(50326),g=r(1812),v=r(41664),b=r.n(v),E=r(36989),y=r(99307),w=r(6378),I=r(36856);let C=h.nb.REFRESH_INTERVAL;function R(){let[e,s]=(0,a.useState)(!1),r=(0,a.useRef)(null),n=(0,p.X)(),[l,i]=(0,a.useState)(!1),[d,h]=(0,a.useState)(null),[x,N]=(0,a.useState)(null),[f,v]=(0,a.useState)(!1),[y,R]=(0,a.useState)(!1),[A,D]=(0,a.useState)(null),k=()=>{w.ZP.invalidate(u.C),R(!1),I.ZP.preloadForPage("volumes",{force:!0}).then(()=>{R(!0),D(new Date),r.current&&r.current()})},_=async()=>{if(d){v(!0),N(null);try{let e=await (0,u.w)(d.name);if(!e.success)throw Error(e.msg);i(!1),h(null),k()}catch(e){N(e)}finally{v(!1)}}},T=()=>{i(!1),h(null),N(null)};return(0,a.useEffect)(()=>{(async()=>{try{await I.ZP.preloadForPage("volumes")}catch(e){console.error("Error preloading volumes data:",e)}finally{R(!0),D(new Date)}})()},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,t.jsx)("div",{className:"text-base",children:(0,t.jsx)(b(),{href:"/volumes",className:"text-sky-blue hover:underline leading-none",children:"Volumes"})}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[e&&(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(c.Z,{size:15,className:"mt-0"}),(0,t.jsx)("span",{className:"ml-2 text-gray-500 text-sm",children:"Loading..."})]}),!e&&A&&(0,t.jsx)(E.$3,{timestamp:A}),(0,t.jsxs)("button",{onClick:k,disabled:e,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:[(0,t.jsx)(m.Z,{className:"h-4 w-4 mr-1.5"}),!n&&(0,t.jsx)("span",{children:"Refresh"})]})]})]}),(0,t.jsx)(L,{refreshInterval:C,setLoading:s,refreshDataRef:r,onDeleteVolume:e=>{h(e),i(!0),N(null)},preloadingComplete:y},"volumes"),(0,t.jsx)(j.Vq,{open:l,onOpenChange:T,children:(0,t.jsxs)(j.cZ,{className:"sm:max-w-md",children:[(0,t.jsxs)(j.fK,{children:[(0,t.jsx)(j.$N,{children:"Delete Volume"}),(0,t.jsxs)(j.Be,{children:['Are you sure you want to delete volume "',(null==d?void 0:d.name)||"this volume",'"? This action cannot be undone.']})]}),(0,t.jsx)(g.X,{error:x,title:"Deletion Failed",onDismiss:()=>N(null)}),(0,t.jsxs)(j.cN,{children:[(0,t.jsx)(o.z,{variant:"outline",onClick:T,disabled:f,children:"Cancel"}),(0,t.jsx)(o.z,{variant:"destructive",onClick:_,disabled:f,children:f?"Deleting...":"Delete"})]})]})})]})}function L(e){let{refreshInterval:s,setLoading:r,refreshDataRef:n,onDeleteVolume:l,preloadingComplete:i}=e,[h,m]=(0,a.useState)([]),[p,j]=(0,a.useState)({key:null,direction:"ascending"}),[g,v]=(0,a.useState)(!1),[b,I]=(0,a.useState)(!0),[C,R]=(0,a.useState)(1),[L,D]=(0,a.useState)(10),k=(0,a.useCallback)(async()=>{r(!0),v(!0);try{let e=await w.ZP.get(u.C);m(e)}catch(e){console.error("Failed to fetch volumes:",e),m([])}finally{r(!1),v(!1),I(!1)}},[r]),_=(0,a.useMemo)(()=>(0,x.R0)(h,p.key,p.direction),[h,p]);(0,a.useEffect)(()=>{n&&(n.current=k)},[n,k]),(0,a.useEffect)(()=>{m([]);let e=!0;if(i){k();let r=setInterval(()=>{e&&"visible"===window.document.visibilityState&&k()},s);return()=>{e=!1,clearInterval(r)}}return()=>{e=!1}},[s,k,i]),(0,a.useEffect)(()=>{R(1)},[h.length]);let T=e=>{let s="ascending";p.key===e&&"ascending"===p.direction&&(s="descending"),j({key:e,direction:s})},S=e=>p.key===e?"ascending"===p.direction?" ↑":" ↓":"",O=Math.ceil(_.length/L),P=(C-1)*L,F=P+L,U=_.slice(P,F),M=e=>e||"-",z=e=>{if(!e)return"N/A";try{let s=new Date(1e3*e);return(0,t.jsx)(E.Zg,{date:s})}catch(e){return"Invalid Date"}};return(0,t.jsxs)("div",{children:[(0,t.jsx)(f.Zb,{children:(0,t.jsx)("div",{className:"overflow-x-auto rounded-lg",children:(0,t.jsxs)(d.iA,{className:"min-w-full",children:[(0,t.jsx)(d.xD,{children:(0,t.jsxs)(d.SC,{children:[(0,t.jsxs)(d.ss,{className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50",onClick:()=>T("name"),children:["Name",S("name")]}),(0,t.jsxs)(d.ss,{className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50",onClick:()=>T("infra"),children:["Infra",S("infra")]}),(0,t.jsxs)(d.ss,{className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50",onClick:()=>T("status"),children:["Status",S("status")]}),(0,t.jsxs)(d.ss,{className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50",onClick:()=>T("size"),children:["Size",S("size")]}),(0,t.jsxs)(d.ss,{className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50",onClick:()=>T("user_name"),children:["User",S("user_name")]}),(0,t.jsxs)(d.ss,{className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50",onClick:()=>T("last_attached_at"),children:["Last Use",S("last_attached_at")]}),(0,t.jsxs)(d.ss,{className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50",onClick:()=>T("type"),children:["Type",S("type")]}),(0,t.jsxs)(d.ss,{className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50",onClick:()=>T("usedby_clusters"),children:["Used By",S("usedby_clusters")]}),(0,t.jsx)(d.ss,{children:"Actions"})]})}),(0,t.jsx)(d.RM,{children:g||!i?(0,t.jsx)(d.SC,{children:(0,t.jsx)(d.pj,{colSpan:11,className:"text-center py-6 text-gray-500",children:(0,t.jsxs)("div",{className:"flex justify-center items-center",children:[(0,t.jsx)(c.Z,{size:20,className:"mr-2"}),(0,t.jsx)("span",{children:"Loading..."})]})})}):U.length>0?U.map(e=>(0,t.jsxs)(d.SC,{children:[(0,t.jsx)(d.pj,{className:"font-medium",children:e.name}),(0,t.jsx)(d.pj,{children:e.infra||"N/A"}),(0,t.jsx)(d.pj,{children:(0,t.jsx)(y.OE,{status:e.status})}),(0,t.jsx)(d.pj,{children:M(e.size)}),(0,t.jsx)(d.pj,{children:e.user_name||"N/A"}),(0,t.jsx)(d.pj,{children:z(e.last_attached_at)}),(0,t.jsx)(d.pj,{children:e.type||"N/A"}),(0,t.jsx)(d.pj,{children:(0,t.jsx)(A,{clusters:e.usedby_clusters,pods:e.usedby_pods})}),(0,t.jsx)(d.pj,{children:(0,t.jsx)(o.z,{variant:"ghost",size:"sm",onClick:()=>l(e),className:"text-red-600 hover:text-red-700 hover:bg-red-50",title:"Delete volume",children:(0,t.jsx)(N.Z,{className:"w-4 h-4"})})})]},e.name)):(0,t.jsx)(d.SC,{children:(0,t.jsx)(d.pj,{colSpan:11,className:"text-center py-6 text-gray-500",children:"No volumes found"})})})]})})}),h.length>0&&(0,t.jsx)("div",{className:"flex justify-end items-center py-2 px-4 text-sm text-gray-700",children:(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("span",{className:"mr-2",children:"Rows per page:"}),(0,t.jsxs)("div",{className:"relative inline-block",children:[(0,t.jsxs)("select",{value:L,onChange:e=>{D(parseInt(e.target.value,10)),R(1)},className:"py-1 pl-2 pr-6 appearance-none outline-none cursor-pointer border-none bg-transparent",style:{minWidth:"40px"},children:[(0,t.jsx)("option",{value:10,children:"10"}),(0,t.jsx)("option",{value:30,children:"30"}),(0,t.jsx)("option",{value:50,children:"50"}),(0,t.jsx)("option",{value:100,children:"100"}),(0,t.jsx)("option",{value:200,children:"200"})]}),(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-500 absolute right-0 top-1/2 transform -translate-y-1/2 pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),(0,t.jsxs)("div",{children:[P+1," – ",Math.min(F,h.length)," of"," ",h.length]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{R(e=>Math.max(e-1,1))},disabled:1===C,className:"text-gray-500 h-8 w-8 p-0",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-left",children:(0,t.jsx)("path",{d:"M15 18l-6-6 6-6"})})}),(0,t.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{R(e=>Math.min(e+1,O))},disabled:C===O||0===O,className:"text-gray-500 h-8 w-8 p-0",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-right",children:(0,t.jsx)("path",{d:"M9 18l6-6-6-6"})})})]})]})})]})}function A(e){let{clusters:s,pods:r}=e,[n,l]=(0,a.useState)(null),c=Array.isArray(s)&&s.length>0?s:Array.isArray(r)&&r.length>0?r:[],o=Array.isArray(s)&&s.length>0;if(!c||0===c.length)return"N/A";let d=c.slice(0,2),u=c.slice(2);return(0,t.jsxs)(t.Fragment,{children:[d.map((e,s)=>(0,t.jsxs)("span",{children:[o?(0,t.jsx)(b(),{href:"/clusters/".concat(encodeURIComponent(e)),className:"text-sky-blue hover:underline",children:e}):(0,t.jsx)("span",{children:e}),s<d.length-1?", ":""]},e)),u.length>0&&(0,t.jsxs)(t.Fragment,{children:[","," ",(0,t.jsxs)("span",{className:"text-sky-blue cursor-pointer underline",onClick:e=>{l(e.currentTarget)},style:{userSelect:"none"},children:["+",u.length," more"]}),(0,t.jsx)(i.ZP,{open:!!n,anchorEl:n,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,t.jsx)("div",{style:{padding:12,maxWidth:300},children:u.map(e=>(0,t.jsx)("div",{style:{marginBottom:4},children:o?(0,t.jsx)(b(),{href:"/clusters/".concat(encodeURIComponent(e)),className:"text-sky-blue hover:underline",children:e}):(0,t.jsx)("span",{children:e})},e))})})]})]})}L.propTypes={refreshInterval:l().number.isRequired,setLoading:l().func.isRequired,refreshDataRef:l().shape({current:l().func}).isRequired,onDeleteVolume:l().func.isRequired,preloadingComplete:l().bool.isRequired}}}]);
@@ -0,0 +1,25 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6082],{88507:function(e,t,n){n.d(t,{Z:function(){return r}});/**
2
+ * @license lucide-react v0.407.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */let r=(0,n(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"}]])},13626:function(e,t,n){n.d(t,{Z:function(){return r}});/**
7
+ * @license lucide-react v0.407.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */let r=(0,n(60998).Z)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])},28586:function(e,t,n){n.d(t,{Z:function(){return r}});/**
12
+ * @license lucide-react v0.407.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */let r=(0,n(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,t,n){n.d(t,{Z:function(){return r}});/**
17
+ * @license lucide-react v0.407.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */let r=(0,n(60998).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},6327:function(e,t,n){n.d(t,{x8:function(){return eu},VY:function(){return eo},dk:function(){return ea},aV:function(){return er},h_:function(){return en},fC:function(){return ee},Dx:function(){return ei},xz:function(){return et}});var r=n(67294),o=n(36206),i=n(28771),a=n(25360),u=n(91276),l=n(77342),s=n(46063),d=n(95420),c=n(42651),f=n(9981),p=e=>{let t,n;let{present:o,children:a}=e,u=function(e){var t,n;let[o,i]=r.useState(),a=r.useRef(null),u=r.useRef(e),l=r.useRef("none"),[s,d]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,t)=>n[e][t]??e,t));return r.useEffect(()=>{let e=m(a.current);l.current="mounted"===s?e:"none"},[s]),(0,f.b)(()=>{let t=a.current,n=u.current;if(n!==e){let r=l.current,o=m(t);e?d("MOUNT"):"none"===o||t?.display==="none"?d("UNMOUNT"):n&&r!==o?d("ANIMATION_OUT"):d("UNMOUNT"),u.current=e}},[e,d]),(0,f.b)(()=>{if(o){let e;let t=o.ownerDocument.defaultView??window,n=n=>{let r=m(a.current).includes(n.animationName);if(n.target===o&&r&&(d("ANIMATION_END"),!u.current)){let n=o.style.animationFillMode;o.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===o.style.animationFillMode&&(o.style.animationFillMode=n)})}},r=e=>{e.target===o&&(l.current=m(a.current))};return o.addEventListener("animationstart",r),o.addEventListener("animationcancel",n),o.addEventListener("animationend",n),()=>{t.clearTimeout(e),o.removeEventListener("animationstart",r),o.removeEventListener("animationcancel",n),o.removeEventListener("animationend",n)}}d("ANIMATION_END")},[o,d]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:r.useCallback(e=>{a.current=e?getComputedStyle(e):null,i(e)},[])}}(o),l="function"==typeof a?a({present:u.isPresent}):r.Children.only(a),s=(0,i.e)(u.ref,(t=Object.getOwnPropertyDescriptor(l.props,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning?l.ref:(t=Object.getOwnPropertyDescriptor(l,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning?l.props.ref:l.props.ref||l.ref);return"function"==typeof a||u.isPresent?r.cloneElement(l,{ref:s}):null};function m(e){return e?.animationName||"none"}p.displayName="Presence";var g=n(75320),y=n(27552),v=n(6223),h=n(23541),N=n(88426),M=n(85893),D="Dialog",[R,O]=(0,a.b)(D),[b,w]=R(D),x=e=>{let{__scopeDialog:t,children:n,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,d=r.useRef(null),c=r.useRef(null),[f,p]=(0,l.T)({prop:o,defaultProp:i??!1,onChange:a,caller:D});return(0,M.jsx)(b,{scope:t,triggerRef:d,contentRef:c,contentId:(0,u.M)(),titleId:(0,u.M)(),descriptionId:(0,u.M)(),open:f,onOpenChange:p,onOpenToggle:r.useCallback(()=>p(e=>!e),[p]),modal:s,children:n})};x.displayName=D;var I="DialogTrigger",j=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,a=w(I,n),u=(0,i.e)(t,a.triggerRef);return(0,M.jsx)(g.WV.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":X(a.open),...r,ref:u,onClick:(0,o.M)(e.onClick,a.onOpenToggle)})});j.displayName=I;var C="DialogPortal",[E,k]=R(C,{forceMount:void 0}),_=e=>{let{__scopeDialog:t,forceMount:n,children:o,container:i}=e,a=w(C,t);return(0,M.jsx)(E,{scope:t,forceMount:n,children:r.Children.map(o,e=>(0,M.jsx)(p,{present:n||a.open,children:(0,M.jsx)(c.h,{asChild:!0,container:i,children:e})}))})};_.displayName=C;var T="DialogOverlay",A=r.forwardRef((e,t)=>{let n=k(T,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=w(T,e.__scopeDialog);return i.modal?(0,M.jsx)(p,{present:r||i.open,children:(0,M.jsx)(P,{...o,ref:t})}):null});A.displayName=T;var F=(0,N.Z8)("DialogOverlay.RemoveScroll"),P=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=w(T,n);return(0,M.jsx)(v.Z,{as:F,allowPinchZoom:!0,shards:[o.contentRef],children:(0,M.jsx)(g.WV.div,{"data-state":X(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),U="DialogContent",W=r.forwardRef((e,t)=>{let n=k(U,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=w(U,e.__scopeDialog);return(0,M.jsx)(p,{present:r||i.open,children:i.modal?(0,M.jsx)(Z,{...o,ref:t}):(0,M.jsx)(V,{...o,ref:t})})});W.displayName=U;var Z=r.forwardRef((e,t)=>{let n=w(U,e.__scopeDialog),a=r.useRef(null),u=(0,i.e)(t,n.contentRef,a);return r.useEffect(()=>{let e=a.current;if(e)return(0,h.Ry)(e)},[]),(0,M.jsx)(S,{...e,ref:u,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,o.M)(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:(0,o.M)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:(0,o.M)(e.onFocusOutside,e=>e.preventDefault())})}),V=r.forwardRef((e,t)=>{let n=w(U,e.__scopeDialog),o=r.useRef(!1),i=r.useRef(!1);return(0,M.jsx)(S,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||n.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"!==t.detail.originalEvent.type||(i.current=!0));let r=t.target;n.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),S=r.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:u,...l}=e,c=w(U,n),f=r.useRef(null),p=(0,i.e)(t,f);return(0,y.EW)(),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(d.M,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:u,children:(0,M.jsx)(s.XB,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":X(c.open),...l,ref:p,onDismiss:()=>c.onOpenChange(!1)})}),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(J,{titleId:c.titleId}),(0,M.jsx)(Q,{contentRef:f,descriptionId:c.descriptionId})]})]})}),L="DialogTitle",$=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=w(L,n);return(0,M.jsx)(g.WV.h2,{id:o.titleId,...r,ref:t})});$.displayName=L;var q="DialogDescription",z=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=w(q,n);return(0,M.jsx)(g.WV.p,{id:o.descriptionId,...r,ref:t})});z.displayName=q;var B="DialogClose",H=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(B,n);return(0,M.jsx)(g.WV.button,{type:"button",...r,ref:t,onClick:(0,o.M)(e.onClick,()=>i.onOpenChange(!1))})});function X(e){return e?"open":"closed"}H.displayName=B;var K="DialogTitleWarning",[Y,G]=(0,a.k)(K,{contentName:U,titleName:L,docsSlug:"dialog"}),J=({titleId:e})=>{let t=G(K),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
22
+
23
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
24
+
25
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return r.useEffect(()=>{e&&!document.getElementById(e)&&console.error(n)},[n,e]),null},Q=({contentRef:e,descriptionId:t})=>{let n=G("DialogDescriptionWarning"),o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${n.contentName}}.`;return r.useEffect(()=>{let n=e.current?.getAttribute("aria-describedby");t&&n&&!document.getElementById(t)&&console.warn(o)},[o,e,t]),null},ee=x,et=j,en=_,er=A,eo=W,ei=$,ea=z,eu=H}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6989],{88950:function(e,t,n){n.d(t,{Bw:function(){return p},Ph:function(){return d},Ql:function(){return x},i4:function(){return f},ki:function(){return u}});var r=n(85893),a=n(67294),o=n(2067),s=n(45895),l=n(7242),i=n(70282),c=n(32350);let d=o.fC;o.ZA;let u=o.B4,f=a.forwardRef((e,t)=>{let{className:n,children:a,...l}=e;return(0,r.jsxs)(o.xz,{ref:t,className:(0,c.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",n),...l,children:[a,(0,r.jsx)(o.JO,{asChild:!0,children:(0,r.jsx)(s.Z,{className:"h-4 w-4 opacity-50"})})]})});f.displayName=o.xz.displayName;let m=a.forwardRef((e,t)=>{let{className:n,...a}=e;return(0,r.jsx)(o.u_,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",n),...a,children:(0,r.jsx)(l.Z,{className:"h-4 w-4"})})});m.displayName=o.u_.displayName;let h=a.forwardRef((e,t)=>{let{className:n,...a}=e;return(0,r.jsx)(o.$G,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",n),...a,children:(0,r.jsx)(s.Z,{className:"h-4 w-4"})})});h.displayName=o.$G.displayName;let p=a.forwardRef((e,t)=>{let{className:n,children:a,position:s="popper",...l}=e;return(0,r.jsx)(o.h_,{children:(0,r.jsxs)(o.VY,{ref:t,className:(0,c.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===s&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:s,...l,children:[(0,r.jsx)(m,{}),(0,r.jsx)(o.l_,{className:(0,c.cn)("p-1","popper"===s&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),(0,r.jsx)(h,{})]})})});p.displayName=o.VY.displayName,a.forwardRef((e,t)=>{let{className:n,...a}=e;return(0,r.jsx)(o.__,{ref:t,className:(0,c.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",n),...a})}).displayName=o.__.displayName;let x=a.forwardRef((e,t)=>{let{className:n,children:a,...s}=e;return(0,r.jsxs)(o.ck,{ref:t,className:(0,c.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...s,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(o.wU,{children:(0,r.jsx)(i.Z,{className:"h-4 w-4"})})}),(0,r.jsx)(o.eT,{children:a})]})});x.displayName=o.ck.displayName,a.forwardRef((e,t)=>{let{className:n,...a}=e;return(0,r.jsx)(o.Z0,{ref:t,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",n),...a})}).displayName=o.Z0.displayName},36989:function(e,t,n){n.d(t,{$3:function(){return p},$B:function(){return b},Kl:function(){return S},LU:function(){return x},Md:function(){return h},WH:function(){return m},Zg:function(){return w},Zn:function(){return g},Zt:function(){return y},os:function(){return _},sY:function(){return N},x9:function(){return k},xn:function(){return j},yc:function(){return u}});var r=n(85893),a=n(67294),o=n(53302),s=n(11886),l=n(88950),i=n(51214),c=n(41664),d=n.n(c);let u=i.nb.REFRESH_INTERVAL,f={placement:"bottom",color:"default"},m=e=>{let{children:t,...n}=e,a=n.content;return n.content=void 0,(0,r.jsx)(o.e,{...f,...n,content:(0,r.jsx)("span",{className:"left-full w-max px-2 py-1 text-sm text-gray-100 bg-gray-500 text-sm capitalize rounded",children:a}),children:t})},h=e=>{let{children:t,...n}=e,a=n.content;return n.content=void 0,(0,r.jsx)(o.e,{...f,...n,content:(0,r.jsx)("span",{className:"left-full w-max px-2 py-1 text-sm text-gray-100 bg-gray-500 text-sm rounded whitespace-pre-line",children:a}),children:t})},p=e=>{let t,{timestamp:n,className:o=""}=e,[,s]=(0,a.useState)(0);if((0,a.useEffect)(()=>{if(!n)return;let e=setInterval(()=>{s(e=>e+1)},1e4);return()=>clearInterval(e)},[n]),!n)return null;let l=new Date-n;return t=l<5e3?"just now":l<6e4?"".concat(Math.floor(l/1e3),"s ago"):l<36e5?"".concat(Math.floor(l/6e4),"m ago"):l<864e5?"".concat(Math.floor(l/36e5),"h ago"):"".concat(Math.floor(l/864e5),"d ago"),(0,r.jsx)(h,{content:"Last updated: ".concat(n.toLocaleString("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!1,timeZoneName:"short"}).replace(",","")),className:"text-sm text-muted-foreground",children:(0,r.jsxs)("span",{className:"text-xs text-gray-500 ".concat(o),children:["Updated ",t]})})};function x(e){if(!e&&0!==e)return"-";let t=e=Math.floor(e),n="",r=0;for(let e of[{value:31536e3,label:"y"},{value:2592e3,label:"mo"},{value:86400,label:"d"},{value:3600,label:"h"},{value:60,label:"m"},{value:1,label:"s"}])if(t>=e.value&&r<2){let a=Math.floor(t/e.value);n+="".concat(a).concat(e.label," "),t%=e.value,r++}return n.trim()||"0s"}function g(e){return e.replace(/\x1b\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGKH]/g,"")}function y(e){return!!(!e||e.includes("<sky-payload")||/rich_(init|update|start|exit)/i.test(e)||/<rich_.*?>.*<\/rich_.*?>/i.test(e)||/^├──/.test(e)||/^└──/.test(e))}function b(e){let{logs:t,controller:n=!1}=e,[o,s]=(0,a.useState)("all"),i=t?Array.isArray(t)?t:"string"==typeof t?t.split("\n").filter(e=>""!==e):[]:[],[c,d]=(0,a.useState)(i),[u,f]=(0,a.useState)([]);return(0,a.useEffect)(()=>{f(function(e){let t;let n=/\((head|worker\d+),/g,r=new Set;for(;null!==(t=n.exec(e));)r.add(t[1]);return Array.from(r).sort((e,t)=>"head"===e?-1:"head"===t?1:e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"}))}(i.join("\n")))},[i]),(0,a.useEffect)(()=>{"all"===o?d(i):d(i.filter(e=>e.includes("(".concat(o,","))))},[o,i]),(0,r.jsxs)("div",{children:[(0,r.jsx)("style",{children:'\n .logs-container {\n background-color: #f7f7f7;\n padding: 16px;\n max-height: calc(100vh - 300px);\n overflow-y: auto;\n overflow-x: hidden;\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;\n line-height: 1.5;\n border-radius: 6px;\n min-height: fit-content;\n }\n\n .log-line {\n display: block;\n white-space: pre-wrap;\n margin: 2px 0;\n }\n\n .log-line .level {\n display: inline;\n width: 1ch;\n margin-right: 1ch;\n font-weight: bold;\n }\n\n .log-line.INFO .level {\n color: #2563eb;\n }\n\n .log-line.WARNING .level {\n color: #d97706;\n }\n\n .log-line.ERROR .level {\n color: #dc2626;\n }\n\n .log-line.DEBUG .level {\n color: #6b7280;\n }\n\n .log-line .timestamp {\n color: #059669;\n margin-right: 1ch;\n white-space: nowrap;\n }\n\n .log-line .location {\n color: #6366f1;\n margin-right: 1ch;\n white-space: nowrap;\n }\n\n .log-line .message {\n color: #111827;\n word-break: break-word;\n white-space: pre-wrap;\n }\n\n .log-line .log-prefix {\n color: #6366f1;\n font-weight: 500;\n }\n\n .log-line .log-rest {\n color: #111827;\n word-break: break-word;\n white-space: pre-wrap;\n }\n'}),!n&&(0,r.jsx)("div",{style:{marginBottom:"1rem"},children:(0,r.jsxs)(l.Ph,{onValueChange:e=>s(e),value:o,children:[(0,r.jsx)(l.i4,{"aria-label":"Node",className:"focus:ring-0 focus:ring-offset-0",children:(0,r.jsx)(l.ki,{placeholder:"Select Node"})}),(0,r.jsxs)(l.Bw,{children:[(0,r.jsx)(l.Ql,{value:"all",children:"All Nodes"}),u.map(e=>(0,r.jsx)(l.Ql,{value:e,children:e},e))]})]})}),(0,r.jsx)("div",{className:"logs-container whitespace-pre-wrap break-all font-mono text-sm text-gray-900","aria-label":"job-logs",children:c.join("\n")})]})}function w(e){let t,{date:n}=e;if(!n)return"N/A";let a=new Date,o=n.getFullYear()+"-"+String(n.getMonth()+1).padStart(2,"0")+"-"+String(n.getDate()).padStart(2,"0"),l=n.toLocaleString("en-US",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0,timeZoneName:"short"});return t=function(e){if(!e||"string"!=typeof e)return e;if("just now"===e)return"now";if("less than a minute ago"===e.toLowerCase())return"Less than 1m ago";let t=e.match(/^about\s+(\d+)\s+(\w+)\s+ago$/i);if(t){let e=t[1],n=t[2],r={second:"s",seconds:"s",minute:"m",minutes:"m",hour:"h",hours:"h",day:"d",days:"d",month:"mo",months:"mo",year:"yr",years:"yr"};if(r[n])return"".concat(e).concat(r[n]," ago")}let n=e.match(/^a[n]?\s+(\w+)\s+ago$/i);if(n){let e=n[1],t={second:"s",minute:"m",hour:"h",day:"d",month:"mo",year:"yr"};if(t[e])return"1".concat(t[e]," ago")}let r=e.match(/^(\d+)\s+(\w+)\s+ago$/i);if(r){let e=r[1],t=r[2],n={second:"s",seconds:"s",minute:"m",minutes:"m",hour:"h",hours:"h",day:"d",days:"d",month:"mo",months:"mo",year:"yr",years:"yr"};if(n[t])return"".concat(e).concat(n[t]," ago")}return e}((0,s.B)(n,a,{addSuffix:!0})),(0,r.jsx)(m,{content:o+" "+l,className:"text-sm text-muted-foreground",children:(0,r.jsx)("span",{className:"border-b border-dotted border-gray-400 cursor-help",children:t})})}function j(e){return e?e.getFullYear()+"-"+String(e.getMonth()+1).padStart(2,"0")+"-"+String(e.getDate()).padStart(2,"0")+" "+e.toLocaleString("en-US",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0,timeZoneName:"short"}):"N/A"}let N=e=>e&&e.jobCounts?e.jobCounts:{},v=e=>{if(!e||0===e.length)return{};let t=e.filter(e=>"READY"===e.status),n={};t.forEach(e=>{try{let t=e.cloud&&""!==e.cloud.trim()&&"undefined"!==e.cloud,r=e.region&&"undefined"!==e.region&&null!==e.region&&""!==e.region.trim();if(!t&&!r)return;let a=t?e.cloud:"Unknown",o=r?e.region:null;n[a]||(n[a]={count:0,regions:new Set}),n[a].count+=1,o&&n[a].regions.add(o)}catch(e){n.Unknown||(n.Unknown={count:0,regions:new Set}),n.Unknown.count+=1}});let r={};return Object.entries(n).forEach(e=>{let[t,n]=e,a=n.regions.size,o=t.toLowerCase().includes("kubernetes")||t.toLowerCase().includes("k8s")?"context":"region",s=1===a?"1 ".concat(o):"".concat(a," ").concat(o,"s");r[a>0?"".concat(t," (").concat(s,")"):t]=n.count}),r},k=e=>{let{jobCounts:t,getStatusStyle:n}=e;return t&&0!==Object.keys(t).length?(0,r.jsx)("div",{className:"flex flex-wrap gap-1",children:Object.entries(t).map(e=>{let[t,a]=e,o=n(t);return(0,r.jsxs)("span",{className:"px-2 py-1 rounded-full flex items-center space-x-2 text-xs font-medium ".concat(o),children:[(0,r.jsx)("span",{children:t}),(0,r.jsx)("span",{className:"text-xs bg-white/50 px-1.5 py-0.5 rounded",children:a})]},t)})}):(0,r.jsx)("span",{className:"text-gray-1000",children:"No active jobs"})},S=e=>{let{replicaInfo:t}=e,n=v(t);if(0===Object.keys(n).length)return(0,r.jsx)("span",{className:"text-gray-500 text-sm",children:"-"});let a=i.MO.NAME_TRUNCATE_LENGTH,o=e=>{let t=e.indexOf("(");if(-1===t)return e;let n=e.substring(0,t).trim(),r=e.substring(t+1,e.length-1);if(r.length<=a)return e;let o="".concat(r.substring(0,Math.floor((a-3)/2)),"...").concat(r.substring(r.length-Math.ceil((a-3)/2)));return"".concat(n," (").concat(o,")")};return(0,r.jsx)("div",{className:"flex flex-wrap gap-1",children:Object.entries(n).map(e=>{let[t,n]=e,a=o(t),s=a!==t;return(0,r.jsxs)("span",{className:"px-2 py-1 rounded-full flex items-center space-x-2 text-xs font-medium bg-blue-50 text-blue-700",children:[s?(0,r.jsx)(h,{content:t,className:"text-sm text-muted-foreground",children:(0,r.jsx)("span",{children:a})}):(0,r.jsx)("span",{children:t}),(0,r.jsx)("span",{className:"text-xs bg-white/50 px-1.5 py-0.5 rounded",children:n})]},t)})})},_=(e,t,n)=>{if(!e)return"-";if(n.find(n=>n.name===e&&n.hash===t)&&t)return(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(h,{content:"This pool is running",placement:"top",children:(0,r.jsx)("div",{className:"w-2 h-2 bg-green-700 rounded-full"})}),(0,r.jsx)(d(),{href:"/jobs/pools/".concat(e),className:"text-gray-700 hover:text-blue-600 hover:underline",children:e})]});let a=t?t.substring(0,4):"";return(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(h,{content:"This pool is terminated",placement:"top",children:(0,r.jsx)("div",{className:"w-2 h-2 bg-gray-800"})}),(0,r.jsxs)("span",{children:[e," (",a,")"]})]})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6990],{30803:function(e,r,t){t.d(r,{z:function(){return i}});var o=t(85893),a=t(67294),s=t(88426),n=t(12003),c=t(32350);let l=(0,n.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),i=a.forwardRef((e,r)=>{let{className:t,variant:a,size:n,asChild:i=!1,...u}=e,d=i?s.g7:"button";return(0,o.jsx)(d,{className:(0,c.cn)(l({variant:a,size:n,className:t})),ref:r,...u})});i.displayName="Button"},37673:function(e,r,t){t.d(r,{Ol:function(){return i},Zb:function(){return l},aY:function(){return f},ll:function(){return u}});var o=t(85893),a=t(67294),s=t(45697),n=t.n(s),c=t(32350);let l=a.forwardRef((e,r)=>{let{className:t,children:a,...s}=e;return(0,o.jsx)("div",{ref:r,className:(0,c.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",t),...s,children:a})});l.displayName="Card",l.propTypes={className:n().string,children:n().node};let i=a.forwardRef((e,r)=>{let{className:t,children:a,...s}=e;return(0,o.jsx)("div",{ref:r,className:(0,c.cn)("flex flex-col space-y-1.5 p-6",t),...s,children:a})});i.displayName="CardHeader",i.propTypes={className:n().string,children:n().node};let u=a.forwardRef((e,r)=>{let{className:t,children:a,...s}=e;return(0,o.jsx)("h3",{ref:r,className:(0,c.cn)("text-2xl font-semibold leading-none tracking-tight",t),...s,children:a})});u.displayName="CardTitle",u.propTypes={className:n().string,children:n().node};let d=a.forwardRef((e,r)=>{let{className:t,children:a,...s}=e;return(0,o.jsx)("p",{ref:r,className:(0,c.cn)("text-sm text-muted-foreground",t),...s,children:a})});d.displayName="CardDescription",d.propTypes={className:n().string,children:n().node};let f=a.forwardRef((e,r)=>{let{className:t,children:a,...s}=e;return(0,o.jsx)("div",{ref:r,className:(0,c.cn)("p-6 pt-0",t),...s,children:a})});f.displayName="CardContent",f.propTypes={className:n().string,children:n().node};let p=a.forwardRef((e,r)=>{let{className:t,children:a,...s}=e;return(0,o.jsx)("div",{ref:r,className:(0,c.cn)("flex items-center p-6 pt-0",t),...s,children:a})});p.displayName="CardFooter",p.propTypes={className:n().string,children:n().node}},17324:function(e,r,t){t.d(r,{LD:function(){return f},MB:function(){return l},eA:function(){return c},getEnabledClouds:function(){return s},getWorkspaces:function(){return a},iE:function(){return u},rF:function(){return d},zl:function(){return i}});var o=t(47145);async function a(){try{let e=await o.x.get("/workspaces");if(!e.ok)throw Error("Error scheduling getWorkspaces: ".concat(e.statusText," (status ").concat(e.status,")"));let r=e.headers.get("X-Skypilot-Request-ID");if(!r){console.warn("X-Skypilot-Request-ID header not found in /workspaces response. Attempting to find request_id in response body as a fallback.");try{let t=await e.json();if(t&&t.request_id)r=t.request_id,console.log("Found request_id in /workspaces response body (fallback):",r);else throw Error("X-Skypilot-Request-ID header not found AND request_id not found in parsed response body from /workspaces.")}catch(r){let e=r.message||"Error processing fallback for request_id from /workspaces response body.";throw console.error("Error in /workspaces request_id fallback logic:",e),Error("X-Skypilot-Request-ID header not found, and fallback to read request_id from body failed: ".concat(e))}}if(!r)throw Error("Failed to obtain X-Skypilot-Request-ID from /workspaces response (checked header and attempted body fallback, but ID is still missing).");console.log("Fetching workspace data with request_id: ".concat(r));let t=await o.x.get("/api/get?request_id=".concat(r));if(!t.ok){let e="Error fetching workspace data for request ID ".concat(r,": ").concat(t.statusText," (status ").concat(t.status,")");try{let o=await t.json();if(o&&o.detail){let t=o.detail;try{let e=JSON.parse(t);e&&e.error?t=e.error:e&&e.result&&e.result.error&&(t=e.result.error)}catch(e){}e="Error fetching workspace data for request ID ".concat(r,": ").concat(t)}}catch(e){}throw Error(e)}let a=await t.json();if(console.log("[Connector Debug] Full resultData from /api/get:",a),"FAILED"===a.status){let e="Unknown error during task execution";if(a.error)"string"==typeof a.error?e=a.error:"object"==typeof a.error&&(e=a.error.message||a.error.detail||JSON.stringify(a.error));else if(a.result&&a.result.error)"string"==typeof a.result.error?e=a.result.error:"object"==typeof a.result.error&&(e=a.result.error.message||a.result.error.detail||JSON.stringify(a.result.error));else if(a.return_value)try{let r=JSON.parse(a.return_value);r.error&&(e="string"==typeof r.error?r.error:r.error.message||r.error.detail||JSON.stringify(r.error))}catch(r){(a.return_value.includes("Error")||a.return_value.includes("Cannot"))&&(e=a.return_value)}throw Error(e)}let s={};if("SUCCEEDED"===a.status&&a.return_value)try{s=JSON.parse(a.return_value),console.log("Successfully parsed workspace data from return_value:",s)}catch(e){throw console.error("Failed to parse workspace data from return_value:",e,"Raw return_value:",a.return_value),Error("Failed to parse workspace data for request ID ".concat(r,": ").concat(e.message))}else a.result&&(console.warn("Using resultData.result as fallback for status ".concat(a.status)),s=a.result);return console.log("Effectively fetched workspace data (to be returned):",s),s||{}}catch(e){throw console.error("Failed to fetch workspaces (in getWorkspaces function):",e.message,e.stack),e}}async function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{let t="/enabled_clouds",a=new URLSearchParams;e&&a.append("workspace",e),r&&a.append("expand","true"),a.toString()&&(t+="?".concat(a.toString()));let s=await o.x.get(t);if(!s.ok)throw Error("Error scheduling getEnabledClouds: ".concat(s.statusText," (status ").concat(s.status,")"));let n=s.headers.get("X-Skypilot-Request-ID");if(!n){console.warn("X-Skypilot-Request-ID header not found in /enabled_clouds response. Attempting to find request_id in response body as a fallback.");try{let e=await s.json();if(e&&e.request_id)n=e.request_id,console.log("Found request_id in /enabled_clouds response body (fallback):",n);else throw Error("X-Skypilot-Request-ID header not found AND request_id not found in parsed response body from /enabled_clouds.")}catch(r){let e=r.message||"Error processing fallback for request_id from /enabled_clouds response body.";throw console.error("Error in /enabled_clouds request_id fallback logic:",e),Error("X-Skypilot-Request-ID header not found, and fallback to read request_id from body failed: ".concat(e))}}if(!n)throw Error("Failed to obtain X-Skypilot-Request-ID from /enabled_clouds response (checked header and attempted body fallback, but ID is still missing).");console.log("Fetching enabled_clouds data with request_id: ".concat(n));let c=await o.x.get("/api/get?request_id=".concat(n));if(!c.ok){let e="Error fetching enabled_clouds data for request ID ".concat(n,": ").concat(c.statusText," (status ").concat(c.status,")");try{let r=await c.json();if(r&&r.detail){let t=r.detail;try{let e=JSON.parse(t);e&&e.error?t=e.error:e&&e.result&&e.result.error&&(t=e.result.error)}catch(e){}e="Error fetching enabled_clouds data for request ID ".concat(n,": ").concat(t)}}catch(e){}throw Error(e)}let l=await c.json();if(console.log("[Connector Debug] Full resultData from /api/get for enabled_clouds:",l),"FAILED"===l.status){let e=l.error||l.result&&l.result.error||"Unknown error during task execution for enabled_clouds";throw Error("Fetching enabled_clouds data failed for request ID ".concat(n,": ").concat(e))}let i=[];if("SUCCEEDED"===l.status&&l.return_value)try{i=JSON.parse(l.return_value),console.log("Successfully parsed enabled_clouds data for workspace ".concat(e,":"),i)}catch(e){throw console.error("Failed to parse enabled_clouds data from return_value:",e,"Raw return_value:",l.return_value),Error("Failed to parse enabled_clouds data for request ID ".concat(n,": ").concat(e.message))}else l.result&&(console.warn("Using resultData.result as fallback for enabled_clouds status ".concat(l.status)),i=l.result);return Array.isArray(i)?i:[]}catch(e){throw console.error("Failed to fetch enabled_clouds (in getEnabledClouds function):",e.message,e.stack),e}}async function n(e,r){console.log("Polling for ".concat(r," task completion with request_id: ").concat(e));let t=await o.x.get("/api/get?request_id=".concat(e));if(!t.ok){let o="Error fetching ".concat(r," data for request ID ").concat(e,": ").concat(t.statusText," (status ").concat(t.status,")");try{let e=await t.json();if(console.error("[Error Debug] ".concat(r," HTTP error response:"),JSON.stringify(e,null,2)),e&&e.detail){if("object"==typeof e.detail&&e.detail.error)try{let t=JSON.parse(e.detail.error);if(t&&t.message)o="".concat(r," failed: ").concat(t.message);else if(t&&"object"==typeof t){let e=t.type||JSON.stringify(t);o="".concat(r," failed: ").concat(e)}}catch(t){o="".concat(r," failed: ").concat(e.detail.error)}else if("string"==typeof e.detail)o="".concat(r," failed: ").concat(e.detail);else{let t=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("string"==typeof e&&(e.includes("Cannot")||e.includes("Error")||e.includes("Failed")))return e;if("object"==typeof e&&null!==e)for(let[o,a]of Object.entries(e)){let e=t(a,r?"".concat(r,".").concat(o):o);if(e)return e}return null},a=t(e.detail);a&&(o="".concat(r," failed: ").concat(a))}}}catch(e){console.error("[Error Debug] Failed to parse error response:",e)}throw Error(o)}let a=await t.json();if(console.log("[Connector Debug] ".concat(r," resultData:"),a),"FAILED"===a.status){console.error("[Error Debug] ".concat(r," failed. Full resultData:"),JSON.stringify(a,null,2)),console.error("[Error Debug] resultData.error:",a.error),console.error("[Error Debug] resultData.result:",a.result),console.error("[Error Debug] resultData.return_value:",a.return_value);let e="Unknown error during ".concat(r," task execution");if(a.error)"string"==typeof a.error?e=a.error:"object"==typeof a.error&&(e=a.error.message||a.error.detail||JSON.stringify(a.error));else if(a.result&&a.result.error)"string"==typeof a.result.error?e=a.result.error:"object"==typeof a.result.error&&(e=a.result.error.message||a.result.error.detail||JSON.stringify(a.result.error));else if(a.return_value)try{let r=JSON.parse(a.return_value);r.error&&(e="string"==typeof r.error?r.error:r.error.message||r.error.detail||JSON.stringify(r.error))}catch(r){a.return_value&&(a.return_value.includes("Error")||a.return_value.includes("Cannot"))&&(e=a.return_value)}if(e==="Unknown error during ".concat(r," task execution")){let r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("string"==typeof e&&(e.includes("Cannot")||e.includes("Error")||e.includes("Failed")))return e;if("object"==typeof e&&null!==e)for(let[o,a]of Object.entries(e)){let e=r(a,t?"".concat(t,".").concat(o):o);if(e)return e}return null},t=r(a);t&&(e=t)}throw Error(e)}let s={};if("SUCCEEDED"===a.status&&a.return_value)try{s=JSON.parse(a.return_value),console.log("Successfully parsed ".concat(r," data:"),s)}catch(t){throw console.error("Failed to parse ".concat(r," data from return_value:"),t,"Raw return_value:",a.return_value),Error("Failed to parse ".concat(r," data for request ID ").concat(e,": ").concat(t.message))}else a.result&&(console.warn("Using resultData.result as fallback for ".concat(r," status ").concat(a.status)),s=a.result);return s}async function c(e,r){try{console.log("Updating workspace ".concat(e," with config:"),r);let t=await o.x.post("/workspaces/update",{workspace_name:e,config:r});if(!t.ok)throw Error("Error scheduling updateWorkspace: ".concat(t.statusText," (status ").concat(t.status,")"));let a=t.headers.get("X-Skypilot-Request-ID");if(!a)throw Error("Failed to obtain request ID for updateWorkspace");return await n(a,"updateWorkspace")}catch(e){throw console.error("Failed to update workspace:",e),e}}let l=async(e,r)=>{try{let t=await o.x.post("/workspaces/create",{workspace_name:e,config:r});if(!t.ok)throw await t.text(),Error("Error scheduling createWorkspace: ".concat(t.statusText," (status ").concat(t.status,")"));let a=t.headers.get("X-Skypilot-Request-ID");if(!a)throw Error("Failed to obtain request ID for createWorkspace");return await n(a,"createWorkspace")}catch(e){throw console.error("Failed to create workspace:",e),e}};async function i(e){try{console.log("Deleting workspace ".concat(e));let r=await o.x.post("/workspaces/delete",{workspace_name:e});if(!r.ok)throw Error("Error scheduling deleteWorkspace: ".concat(r.statusText," (status ").concat(r.status,")"));let t=r.headers.get("X-Skypilot-Request-ID");if(!t)throw Error("Failed to obtain request ID for deleteWorkspace");console.log("[Delete Debug] Got request ID for deleteWorkspace: ".concat(t));try{let e=await n(t,"deleteWorkspace");return console.log("[Delete Debug] deleteWorkspace completed successfully:",e),e}catch(e){throw console.error("[Delete Debug] deleteWorkspace failed with error:",e),console.error("[Delete Debug] Error message:",e.message),e}}catch(e){throw console.error("Failed to delete workspace:",e),e}}async function u(){try{console.log("Getting entire SkyPilot configuration");let e=await o.x.get("/workspaces/config");if(!e.ok)throw Error("Error scheduling getConfig: ".concat(e.statusText," (status ").concat(e.status,")"));let r=e.headers.get("X-Skypilot-Request-ID");if(!r)throw Error("Failed to obtain request ID for getConfig");return await n(r,"getConfig")}catch(e){throw console.error("Failed to get config:",e),e}}async function d(e){try{console.log("Updating entire SkyPilot configuration with config:",e);let r=await o.x.post("/workspaces/config",{config:e});if(!r.ok)throw Error("Error scheduling updateConfig: ".concat(r.statusText," (status ").concat(r.status,")"));let t=r.headers.get("X-Skypilot-Request-ID");if(!t)throw Error("Failed to obtain request ID for updateConfig");return await n(t,"updateConfig")}catch(e){throw console.error("Failed to update config:",e),e}}async function f(){try{console.log("Running sky check to refresh cloud credentials");let e=await o.x.fetch("/check",{},"POST");if(!e.ok)throw Error("Sky check failed: ".concat(e.statusText," (status ").concat(e.status,")"));return{success:!0}}catch(e){throw console.error("Failed to run sky check:",e),e}}},32350:function(e,r,t){t.d(r,{cn:function(){return s}});var o=t(90512),a=t(98388);function s(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return(0,a.m6)((0,o.W)(r))}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7248],{99307:function(e,r,t){t.d(r,{Cl:function(){return o},OE:function(){return i}});var a=t(85893);t(67294);var s=t(55739),l=t(36989),n=t(53850);let o=e=>{switch(e){case"LAUNCHING":return"bg-blue-100 text-sky-blue";case"RUNNING":case"IN_USE":case"READY":return"bg-green-50 text-green-700";case"STOPPED":return"bg-yellow-100 text-yellow-800";case"TERMINATED":case"PENDING":case"UNKNOWN":default:return"bg-gray-100 text-gray-800";case"SUCCEEDED":case"PROVISIONING":case"CONTROLLER_INIT":case"REPLICA_INIT":return"bg-blue-50 text-blue-700";case"FAILED":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":case"FAILED_INITIAL_DELAY":case"FAILED_PROBING":case"FAILED_PROVISION":case"FAILED_CLEANUP":case"CONTROLLER_FAILED":return"bg-red-50 text-red-700";case"CANCELLED":case"CANCELLING":case"NOT_READY":return"bg-yellow-50 text-yellow-700";case"RECOVERING":case"SHUTTING_DOWN":return"bg-orange-50 text-orange-700";case"SUBMITTED":return"bg-indigo-50 text-indigo-700";case"STARTING":return"bg-cyan-50 text-cyan-700";case"FAILED_SETUP":return"bg-pink-50 text-pink-700";case"PREEMPTED":case"NO_REPLICA":return"bg-purple-50 text-purple-700"}},c=e=>{switch(e){case"LAUNCHING":case"STARTING":case"PROVISIONING":case"SHUTTING_DOWN":return(0,a.jsx)(s.Z,{size:12,className:"w-3 h-3 mr-1"});case"RUNNING":case"IN_USE":default:return(0,a.jsx)(n.W2,{className:"w-3 h-3 mr-1"});case"STOPPED":case"PREEMPTED":return(0,a.jsx)(n.fp,{className:"w-3 h-3 mr-1"});case"TERMINATED":case"FAILED":case"CANCELLED":case"FAILED_INITIAL_DELAY":case"FAILED_PROBING":case"FAILED_PROVISION":case"FAILED_CLEANUP":case"CONTROLLER_FAILED":case"UNKNOWN":return(0,a.jsx)(n.Ps,{className:"w-3 h-3 mr-1"});case"SUCCEEDED":return(0,a.jsx)(n.Ye,{className:"w-3 h-3 mr-1"});case"PENDING":case"RECOVERING":case"SUBMITTED":case"CANCELLING":case"FAILED_SETUP":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":case"READY":case"NOT_READY":case"CONTROLLER_INIT":case"REPLICA_INIT":case"NO_REPLICA":return(0,a.jsx)(n.J$,{className:"w-3 h-3 mr-1"})}},u=e=>{let r=o(e),t=c(e);return(0,a.jsxs)("span",{className:"".concat("inline-flex items-center px-2 py-1 rounded-full text-sm"," ").concat(r),children:[t,e]})},i=e=>{let{status:r,statusTooltip:t}=e,s=t||r;return(0,a.jsx)(l.WH,{content:s,className:"text-muted-foreground text-sm",children:(0,a.jsx)("span",{children:u(r)})})}},10546:function(e,r,t){t.d(r,{Fu:function(){return u},ML:function(){return d},P2:function(){return i},cm:function(){return o},eG:function(){return c},mu:function(){return n},x$:function(){return f}});var a=t(85893),s=t(67294),l=t(88950);let n=(e,r)=>{var t;let{property:a,operator:s,value:l}=r;if(!l)return!0;if(!a){let r=l.toLowerCase();return Object.values(e).some(e=>null==e?void 0:e.toString().toLowerCase().includes(r))}let n=a.toLowerCase();if("labels"===n){let r=e.labels||{},t=l.toString().toLowerCase();if(!t.includes(":"))return Object.values(r).some(e=>null==e?void 0:e.toString().toLowerCase().includes(t));{let[e,...a]=t.split(":"),s=a.join(":").trim();return r[e.trim()]===s}}let o=null===(t=e[n])||void 0===t?void 0:t.toString().toLowerCase(),c=l.toString().toLowerCase();switch(s){case"=":return o===c;case":":return null==o?void 0:o.includes(c);default:return!0}},o=(e,r)=>0===r.length?e:e.filter(e=>{let t=null;for(let a=0;a<r.length;a++){let s=n(e,r[a]);t=null===t?s:t&&s}return t}),c=(e,r)=>{let t={...e.query},a=[],s=[],l=[];r.map((e,r)=>{var t;a.push(null!==(t=e.property.toLowerCase())&&void 0!==t?t:""),s.push(e.operator),l.push(e.value)}),t.property=a,t.operator=s,t.value=l,e.replace({pathname:e.pathname,query:t},void 0,{shallow:!0})},u=(e,r)=>{let t={...e.query},a=t.property,s=t.operator,l=t.value;if(void 0===a)return[];let n=[],o=Array.isArray(a)?a.length:1;if(1===o)n.push({property:r.get(a),operator:s,value:l});else for(let e=0;e<o;e++)n.push({property:r.get(a[e]),operator:s[e],value:l[e]});return n},i=(e,r,t,a)=>{if(!a)return e;let s=new URLSearchParams({property:r.toLowerCase(),operator:t,value:a});return"".concat(e,"?").concat(s.toString())},d=e=>{var r,t;let{propertyList:n=[],valueList:o,setFilters:c,updateURLParams:u,placeholder:i="Filter items"}=e,d=(0,s.useRef)(null),f=(0,s.useRef)(null),[m,x]=(0,s.useState)(!1),[N,p]=(0,s.useState)(""),[h,E]=(0,s.useState)((null===(r=n[0])||void 0===r?void 0:r.value)||"status"),[b,g]=(0,s.useState)([]);(0,s.useEffect)(()=>{let e=e=>{f.current&&!f.current.contains(e.target)&&d.current&&!d.current.contains(e.target)&&x(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),(0,s.useEffect)(()=>{let e=[];if(o&&"object"==typeof o&&h){let r;e=Array.isArray(r="labels"===h&&o.labels?o.labels:o[h])?r:null!=r?[r]:[]}""!==N.trim()&&(e=e.filter(e=>e&&e.toString().toLowerCase().includes(N.toLowerCase()))),g(e)},[h,o,N]);let L=e=>{let r=n.find(r=>r.value===e);return r?r.label:e},I=e=>{c(r=>{let t=[...r,{property:L(h),operator:":",value:e}];return u(t),t}),x(!1),p(""),d.current.focus()};return(0,a.jsxs)("div",{className:"flex flex-row border border-gray-300 rounded-md overflow-visible bg-white",children:[(0,a.jsx)("div",{className:"border-r border-gray-300 flex-shrink-0",children:(0,a.jsxs)(l.Ph,{onValueChange:e=>{E(e),p("")},value:h,children:[(0,a.jsx)(l.i4,{"aria-label":"Filter Property",className:"focus:ring-0 focus:ring-offset-0 border-none rounded-l-md rounded-r-none w-20 sm:w-24 md:w-32 h-8 text-xs sm:text-sm bg-white",children:(0,a.jsx)(l.ki,{placeholder:(null===(t=n[0])||void 0===t?void 0:t.label)||"Status"})}),(0,a.jsx)(l.Bw,{children:n.map((e,r)=>(0,a.jsx)(l.Ql,{value:e.value,children:e.label},"property-item-".concat(r)))})]})}),(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)("input",{type:"text",ref:d,placeholder:i,value:N,onChange:e=>{p(e.target.value),m||x(!0)},onFocus:()=>{x(!0)},onKeyDown:e=>{"Enter"===e.key&&""!==N.trim()?(c(e=>{let r=[...e,{property:L(h),operator:":",value:N}];return u(r),r}),p(""),x(!1)):"Escape"===e.key&&(x(!1),d.current.blur())},className:"h-8 w-full px-3 pr-8 text-sm border-none rounded-l-none rounded-r-md focus:ring-0 focus:outline-none",autoComplete:"off"}),N&&(0,a.jsx)("button",{onClick:()=>{p(""),x(!1)},className:"absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",title:"Clear filter",tabIndex:-1,children:(0,a.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),m&&b.length>0&&(0,a.jsx)("div",{ref:f,className:"absolute z-50 mt-1 w-full bg-white border border-gray-200 rounded-md shadow-lg max-h-60 overflow-y-auto",style:{zIndex:9999},children:b.map((e,r)=>(0,a.jsx)("div",{className:"px-3 py-2 cursor-pointer hover:bg-gray-50 text-sm ".concat(r!==b.length-1?"border-b border-gray-100":""),onClick:()=>I(e),children:(0,a.jsx)("span",{className:"text-sm text-gray-700",children:e})},"".concat(e,"-").concat(r)))})]})]})},f=e=>{let{filters:r=[],setFilters:t,updateURLParams:s}=e,l=e=>{t(r=>{let t=r.filter((r,t)=>t!==e);return s(t),t})};return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"flex items-center gap-4 py-2 px-2",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-content gap-2",children:[r.map((e,r)=>(0,a.jsx)(m,{filter:e,onRemove:()=>l(r)},"filteritem-".concat(r))),r.length>0&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("button",{onClick:()=>{s([]),t([])},className:"rounded-full px-4 py-1 text-sm text-gray-700 bg-gray-200 hover:bg-gray-300",children:"Clear filters"})})]})})})},m=e=>{let{filter:r,onRemove:t}=e;return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex items-center text-blue-600 bg-blue-100 px-1 py-1 rounded-full text-sm",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1 px-2",children:[(0,a.jsx)("span",{children:"".concat(r.property," ")}),(0,a.jsx)("span",{children:"".concat(r.operator," ")}),(0,a.jsx)("span",{children:" ".concat(r.value)})]}),(0,a.jsx)("button",{onClick:()=>t(),className:"p-0.5 ml-1 transform text-gray-400 hover:text-gray-600 bg-blue-500 hover:bg-blue-600 rounded-full flex flex-col items-center",title:"Clear filter",children:(0,a.jsx)("svg",{className:"h-3 w-3",fill:"none",stroke:"white",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:5,d:"M6 18L18 6M6 6l12 12"})})})]})})}},68764:function(e,r,t){t.d(r,{RM:function(){return c},SC:function(){return u},iA:function(){return n},pj:function(){return d},ss:function(){return i},xD:function(){return o}});var a=t(85893),s=t(67294),l=t(32350);let n=s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,a.jsx)("div",{className:"relative w-full overflow-auto",children:(0,a.jsx)("table",{ref:r,className:(0,l.cn)("w-full caption-bottom text-base",t),...s})})});n.displayName="Table";let o=s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,a.jsx)("thead",{ref:r,className:(0,l.cn)("[&_tr]:border-b",t),...s})});o.displayName="TableHeader";let c=s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,a.jsx)("tbody",{ref:r,className:(0,l.cn)("[&_tr:last-child]:border-0",t),...s})});c.displayName="TableBody",s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,a.jsx)("tfoot",{ref:r,className:(0,l.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...s})}).displayName="TableFooter";let u=s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,a.jsx)("tr",{ref:r,className:(0,l.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...s})});u.displayName="TableRow";let i=s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,a.jsx)("th",{ref:r,className:(0,l.cn)("h-12 px-4 text-left align-middle font-medium text-[hsl(var(--text-strong))] [&:has([role=checkbox])]:pr-0",t),...s})});i.displayName="TableHead";let d=s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,a.jsx)("td",{ref:r,className:(0,l.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...s})});d.displayName="TableCell",s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,a.jsx)("caption",{ref:r,className:(0,l.cn)("mt-4 text-base text-muted-foreground",t),...s})}).displayName="TableCaption"}}]);