@burdenoff/microfe-sandbox 2026.510.113

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 (173) hide show
  1. package/dist/dev/main.d.ts +2 -0
  2. package/dist/dev/main.d.ts.map +1 -0
  3. package/dist/generated/global-operations.d.ts +2 -0
  4. package/dist/generated/global-operations.d.ts.map +1 -0
  5. package/dist/generated/global-types.d.ts +21253 -0
  6. package/dist/generated/global-types.d.ts.map +1 -0
  7. package/dist/generated/wspace-operations.d.ts +1595 -0
  8. package/dist/generated/wspace-operations.d.ts.map +1 -0
  9. package/dist/generated/wspace-operations.js +692 -0
  10. package/dist/generated/wspace-operations.js.map +1 -0
  11. package/dist/generated/wspace-types.d.ts +55214 -0
  12. package/dist/generated/wspace-types.d.ts.map +1 -0
  13. package/dist/index.d.ts +6 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +6 -0
  16. package/dist/node_modules/clsx/dist/clsx.js +18 -0
  17. package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
  18. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +1674 -0
  19. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
  20. package/dist/sandbox/AdminRoutes.d.ts +12 -0
  21. package/dist/sandbox/AdminRoutes.d.ts.map +1 -0
  22. package/dist/sandbox/AdminRoutes.js +45 -0
  23. package/dist/sandbox/AdminRoutes.js.map +1 -0
  24. package/dist/sandbox/SandboxAdminRoot.d.ts +21 -0
  25. package/dist/sandbox/SandboxAdminRoot.d.ts.map +1 -0
  26. package/dist/sandbox/SandboxAdminRoot.js +55 -0
  27. package/dist/sandbox/SandboxAdminRoot.js.map +1 -0
  28. package/dist/sandbox/SandboxRoot.d.ts +31 -0
  29. package/dist/sandbox/SandboxRoot.d.ts.map +1 -0
  30. package/dist/sandbox/SandboxRoot.js +61 -0
  31. package/dist/sandbox/SandboxRoot.js.map +1 -0
  32. package/dist/sandbox/SandboxRoutes.d.ts +18 -0
  33. package/dist/sandbox/SandboxRoutes.d.ts.map +1 -0
  34. package/dist/sandbox/UserRoutes.d.ts +11 -0
  35. package/dist/sandbox/UserRoutes.d.ts.map +1 -0
  36. package/dist/sandbox/UserRoutes.js +57 -0
  37. package/dist/sandbox/UserRoutes.js.map +1 -0
  38. package/dist/sandbox/components/ContainerImagePicker.d.ts +24 -0
  39. package/dist/sandbox/components/ContainerImagePicker.d.ts.map +1 -0
  40. package/dist/sandbox/components/CountdownTimer.d.ts +9 -0
  41. package/dist/sandbox/components/CountdownTimer.d.ts.map +1 -0
  42. package/dist/sandbox/components/CountdownTimer.js +75 -0
  43. package/dist/sandbox/components/CountdownTimer.js.map +1 -0
  44. package/dist/sandbox/components/ExportSandboxesDialog.d.ts +8 -0
  45. package/dist/sandbox/components/ExportSandboxesDialog.d.ts.map +1 -0
  46. package/dist/sandbox/components/ExportSandboxesDialog.js +130 -0
  47. package/dist/sandbox/components/ExportSandboxesDialog.js.map +1 -0
  48. package/dist/sandbox/components/ExtendTTLModal.d.ts +10 -0
  49. package/dist/sandbox/components/ExtendTTLModal.d.ts.map +1 -0
  50. package/dist/sandbox/components/ExtendTTLModal.js +109 -0
  51. package/dist/sandbox/components/ExtendTTLModal.js.map +1 -0
  52. package/dist/sandbox/components/PageLayout.d.ts +39 -0
  53. package/dist/sandbox/components/PageLayout.d.ts.map +1 -0
  54. package/dist/sandbox/components/PageLayout.js +75 -0
  55. package/dist/sandbox/components/PageLayout.js.map +1 -0
  56. package/dist/sandbox/components/ResourceDisplay.d.ts +17 -0
  57. package/dist/sandbox/components/ResourceDisplay.d.ts.map +1 -0
  58. package/dist/sandbox/components/ResourceDisplay.js +69 -0
  59. package/dist/sandbox/components/ResourceDisplay.js.map +1 -0
  60. package/dist/sandbox/components/RouteUtils.d.ts +28 -0
  61. package/dist/sandbox/components/RouteUtils.d.ts.map +1 -0
  62. package/dist/sandbox/components/RouteUtils.js +68 -0
  63. package/dist/sandbox/components/RouteUtils.js.map +1 -0
  64. package/dist/sandbox/components/SandboxActivityTab.d.ts +14 -0
  65. package/dist/sandbox/components/SandboxActivityTab.d.ts.map +1 -0
  66. package/dist/sandbox/components/SandboxActivityTab.js +83 -0
  67. package/dist/sandbox/components/SandboxActivityTab.js.map +1 -0
  68. package/dist/sandbox/components/SandboxAgentAppPanel.d.ts +16 -0
  69. package/dist/sandbox/components/SandboxAgentAppPanel.d.ts.map +1 -0
  70. package/dist/sandbox/components/SandboxAgentAppPanel.js +103 -0
  71. package/dist/sandbox/components/SandboxAgentAppPanel.js.map +1 -0
  72. package/dist/sandbox/components/SandboxTypeIcon.d.ts +15 -0
  73. package/dist/sandbox/components/SandboxTypeIcon.d.ts.map +1 -0
  74. package/dist/sandbox/components/SandboxTypeIcon.js +52 -0
  75. package/dist/sandbox/components/SandboxTypeIcon.js.map +1 -0
  76. package/dist/sandbox/components/SandboxTypeSelector.d.ts +35 -0
  77. package/dist/sandbox/components/SandboxTypeSelector.d.ts.map +1 -0
  78. package/dist/sandbox/components/SandboxUsageBanner.d.ts +16 -0
  79. package/dist/sandbox/components/SandboxUsageBanner.d.ts.map +1 -0
  80. package/dist/sandbox/components/SandboxUsageBanner.js +37 -0
  81. package/dist/sandbox/components/SandboxUsageBanner.js.map +1 -0
  82. package/dist/sandbox/components/StatusBadge.d.ts +15 -0
  83. package/dist/sandbox/components/StatusBadge.d.ts.map +1 -0
  84. package/dist/sandbox/components/StatusBadge.js +86 -0
  85. package/dist/sandbox/components/StatusBadge.js.map +1 -0
  86. package/dist/sandbox/components/TagsInput.d.ts +14 -0
  87. package/dist/sandbox/components/TagsInput.d.ts.map +1 -0
  88. package/dist/sandbox/components/TagsInput.js +46 -0
  89. package/dist/sandbox/components/TagsInput.js.map +1 -0
  90. package/dist/sandbox/components/ui.d.ts +6 -0
  91. package/dist/sandbox/components/ui.d.ts.map +1 -0
  92. package/dist/sandbox/components/ui.js +2 -0
  93. package/dist/sandbox/hooks/useRemainingSeconds.d.ts +12 -0
  94. package/dist/sandbox/hooks/useRemainingSeconds.d.ts.map +1 -0
  95. package/dist/sandbox/hooks/useRemainingSeconds.js +23 -0
  96. package/dist/sandbox/hooks/useRemainingSeconds.js.map +1 -0
  97. package/dist/sandbox/index.d.ts +30 -0
  98. package/dist/sandbox/index.d.ts.map +1 -0
  99. package/dist/sandbox/index.js +4 -0
  100. package/dist/sandbox/pages/AdminLandingPage.d.ts +9 -0
  101. package/dist/sandbox/pages/AdminLandingPage.d.ts.map +1 -0
  102. package/dist/sandbox/pages/AdminLandingPage.js +40 -0
  103. package/dist/sandbox/pages/AdminLandingPage.js.map +1 -0
  104. package/dist/sandbox/pages/AdminPage.d.ts +2 -0
  105. package/dist/sandbox/pages/AdminPage.d.ts.map +1 -0
  106. package/dist/sandbox/pages/AdminPage.js +448 -0
  107. package/dist/sandbox/pages/AdminPage.js.map +1 -0
  108. package/dist/sandbox/pages/AdminTemplatesPage.d.ts +7 -0
  109. package/dist/sandbox/pages/AdminTemplatesPage.d.ts.map +1 -0
  110. package/dist/sandbox/pages/AdminTemplatesPage.js +155 -0
  111. package/dist/sandbox/pages/AdminTemplatesPage.js.map +1 -0
  112. package/dist/sandbox/pages/SandboxCreatePage.d.ts +2 -0
  113. package/dist/sandbox/pages/SandboxCreatePage.d.ts.map +1 -0
  114. package/dist/sandbox/pages/SandboxCreatePage.js +1121 -0
  115. package/dist/sandbox/pages/SandboxCreatePage.js.map +1 -0
  116. package/dist/sandbox/pages/SandboxDetailPage.d.ts +6 -0
  117. package/dist/sandbox/pages/SandboxDetailPage.d.ts.map +1 -0
  118. package/dist/sandbox/pages/SandboxDetailPage.js +822 -0
  119. package/dist/sandbox/pages/SandboxDetailPage.js.map +1 -0
  120. package/dist/sandbox/pages/SandboxLandingPage.d.ts +12 -0
  121. package/dist/sandbox/pages/SandboxLandingPage.d.ts.map +1 -0
  122. package/dist/sandbox/pages/SandboxListPage.d.ts +6 -0
  123. package/dist/sandbox/pages/SandboxListPage.d.ts.map +1 -0
  124. package/dist/sandbox/pages/SandboxListPage.js +820 -0
  125. package/dist/sandbox/pages/SandboxListPage.js.map +1 -0
  126. package/dist/sandbox/pages/TemplateDetailPage.d.ts +6 -0
  127. package/dist/sandbox/pages/TemplateDetailPage.d.ts.map +1 -0
  128. package/dist/sandbox/pages/TemplateDetailPage.js +691 -0
  129. package/dist/sandbox/pages/TemplateDetailPage.js.map +1 -0
  130. package/dist/sandbox/pages/TemplatesPage.d.ts +8 -0
  131. package/dist/sandbox/pages/TemplatesPage.d.ts.map +1 -0
  132. package/dist/sandbox/pages/UserLandingPage.d.ts +9 -0
  133. package/dist/sandbox/pages/UserLandingPage.d.ts.map +1 -0
  134. package/dist/sandbox/pages/UserLandingPage.js +52 -0
  135. package/dist/sandbox/pages/UserLandingPage.js.map +1 -0
  136. package/dist/sandbox/pages/UserTemplatesPage.d.ts +8 -0
  137. package/dist/sandbox/pages/UserTemplatesPage.d.ts.map +1 -0
  138. package/dist/sandbox/pages/UserTemplatesPage.js +121 -0
  139. package/dist/sandbox/pages/UserTemplatesPage.js.map +1 -0
  140. package/dist/sandbox/providers/SandboxProvider.d.ts +13 -0
  141. package/dist/sandbox/providers/SandboxProvider.d.ts.map +1 -0
  142. package/dist/sandbox/providers/SandboxProvider.js +78 -0
  143. package/dist/sandbox/providers/SandboxProvider.js.map +1 -0
  144. package/dist/sandbox/store/sandboxStore.d.ts +16 -0
  145. package/dist/sandbox/store/sandboxStore.d.ts.map +1 -0
  146. package/dist/sandbox/store/sandboxStore.js +24 -0
  147. package/dist/sandbox/store/sandboxStore.js.map +1 -0
  148. package/dist/sandbox/types/index.d.ts +238 -0
  149. package/dist/sandbox/types/index.d.ts.map +1 -0
  150. package/dist/sandbox/utils/cn.d.ts +8 -0
  151. package/dist/sandbox/utils/cn.d.ts.map +1 -0
  152. package/dist/sandbox/utils/cn.js +10 -0
  153. package/dist/sandbox/utils/cn.js.map +1 -0
  154. package/dist/sandbox/utils/formatters.d.ts +7 -0
  155. package/dist/sandbox/utils/formatters.d.ts.map +1 -0
  156. package/dist/sandbox/utils/formatters.js +10 -0
  157. package/dist/sandbox/utils/formatters.js.map +1 -0
  158. package/dist/sandbox/utils/i18n.d.ts +6 -0
  159. package/dist/sandbox/utils/i18n.d.ts.map +1 -0
  160. package/dist/sandbox/utils/i18n.js +15 -0
  161. package/dist/sandbox/utils/i18n.js.map +1 -0
  162. package/dist/sandbox/utils/navigation.d.ts +5 -0
  163. package/dist/sandbox/utils/navigation.d.ts.map +1 -0
  164. package/dist/sandbox/utils/navigation.js +8 -0
  165. package/dist/sandbox/utils/navigation.js.map +1 -0
  166. package/dist/sandbox/utils/sandboxEvents.d.ts +13 -0
  167. package/dist/sandbox/utils/sandboxEvents.d.ts.map +1 -0
  168. package/dist/sandbox/utils/sandboxEvents.js +20 -0
  169. package/dist/sandbox/utils/sandboxEvents.js.map +1 -0
  170. package/dist/utils/nativeBridge.d.ts +3 -0
  171. package/dist/utils/nativeBridge.d.ts.map +1 -0
  172. package/dist/utils/nativeBridge.js +2 -0
  173. package/package.json +107 -0
@@ -0,0 +1,820 @@
1
+ import { useSandbox as e } from "../providers/SandboxProvider.js";
2
+ import { joinPath as t } from "../utils/navigation.js";
3
+ import { Badge as n, Button as r, Card as i, CardContent as a, Checkbox as o, Input as ee, Select as s, SelectContent as te, SelectItem as c, SelectTrigger as ne, SelectValue as l, Skeleton as u } from "../components/ui.js";
4
+ import { cn as d } from "../utils/cn.js";
5
+ import { tWithFallback as f } from "../utils/i18n.js";
6
+ import { StatusBadge as re } from "../components/StatusBadge.js";
7
+ import { ResourceDisplay as ie } from "../components/ResourceDisplay.js";
8
+ import { SandboxTypeIcon as ae } from "../components/SandboxTypeIcon.js";
9
+ import { CountdownTimer as oe } from "../components/CountdownTimer.js";
10
+ import { useSandboxStore as se } from "../store/sandboxStore.js";
11
+ import { useSandboxEvents as ce } from "../utils/sandboxEvents.js";
12
+ import { EmptyState as le, PageLayout as ue } from "../components/PageLayout.js";
13
+ import { SandboxUsageBanner as de } from "../components/SandboxUsageBanner.js";
14
+ import { ExportSandboxesDialog as fe } from "../components/ExportSandboxesDialog.js";
15
+ import { ListSandboxesDocument as pe, useDeleteSandboxMutation as me, useExtendSandboxTtlMutation as he, useListSandboxesQuery as ge, useOnSandboxesChangedSubscription as _e, useStopSandboxMutation as ve } from "../../generated/wspace-operations.js";
16
+ import { nativeImpact as ye, nativeNotify as be } from "../../utils/nativeBridge.js";
17
+ import { useCallback as p, useMemo as m, useState as h } from "react";
18
+ import { PermissionGate as xe } from "@burdenoff/fe-libs/shared/components";
19
+ import { AlertCircle as g, Box as _, CheckCircle2 as Se, ChevronLeft as Ce, ChevronRight as we, Container as Te, Database as Ee, Filter as De, Loader2 as v, Plus as Oe, Search as ke, StopCircle as Ae, Timer as je, Trash2 as Me, X as y } from "lucide-react";
20
+ import { useApolloClient as Ne } from "@apollo/client/react";
21
+ import { useI18n as Pe } from "@burdenoff/fe-libs/shared/providers/shell";
22
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
23
+ //#region src/sandbox/pages/SandboxListPage.tsx
24
+ var C = ["RUNNING"], w = ["RUNNING", "PENDING"], T = [
25
+ "STOPPED",
26
+ "ERROR",
27
+ "EXPIRED",
28
+ "FAILED"
29
+ ], E = 5;
30
+ function Fe(e) {
31
+ let t = Date.now() - new Date(e).getTime(), n = Math.floor(t / 6e4);
32
+ if (n < 1) return "just now";
33
+ if (n < 60) return `${n}m ago`;
34
+ let r = Math.floor(n / 60);
35
+ return r < 24 ? `${r}h ago` : `${Math.floor(r / 24)}d ago`;
36
+ }
37
+ function Ie(e) {
38
+ return {
39
+ ...e.search?.trim() ? { search: e.search.trim() } : {},
40
+ ...e.template && e.template !== "all" ? { template: e.template } : {},
41
+ ...e.status && e.status !== "all" ? { status: e.status } : {}
42
+ };
43
+ }
44
+ function Le(e) {
45
+ return C.includes(e.status);
46
+ }
47
+ function Re(e) {
48
+ return w.includes(e.status);
49
+ }
50
+ function ze(e) {
51
+ return T.includes(e.status);
52
+ }
53
+ function D(e, t) {
54
+ return e instanceof Error && e.message.trim() ? e.message : t;
55
+ }
56
+ function Be(e, t, n, r) {
57
+ let i = [`${e} ${t} sandbox${t === 1 ? "" : "es"}`];
58
+ return n > 0 && i.push(`${n} failed`), r > 0 && i.push(`${r} skipped`), i.join(" • ");
59
+ }
60
+ async function Ve(e, t, n = E) {
61
+ let r = [];
62
+ for (let i = 0; i < e.length; i += n) {
63
+ let a = e.slice(i, i + n), o = await Promise.allSettled(a.map(t));
64
+ r.push(...o);
65
+ }
66
+ return r;
67
+ }
68
+ function O() {
69
+ let { basePath: C = "/", navigate: w } = e(), { sandboxFilter: T, updateFilter: E, resetFilter: O } = se(), He = Ne(), { t: k } = Pe(), [A, Ue] = h(!1), [j, M] = h(1), [N, P] = h(/* @__PURE__ */ new Map()), [F, I] = h(null), [L, R] = h(null), { workspaceId: z } = e(), B = Ie(T), { data: We, loading: Ge, refetch: V } = ge({
70
+ variables: {
71
+ context: { workspaceId: z },
72
+ filter: B,
73
+ pagination: {
74
+ page: j,
75
+ limit: 20
76
+ }
77
+ },
78
+ skip: !z
79
+ }), [H] = ve(), [U] = me(), [Ke] = he(), qe = ce(), [Je, Ye] = h(!1);
80
+ _e({
81
+ variables: { workspaceId: z },
82
+ skip: !z,
83
+ onData: ({ data: e }) => {
84
+ let t = e.data?.onSandboxesChanged;
85
+ t && (t.changeType === "CREATED" || t.changeType === "DELETED") && V();
86
+ }
87
+ });
88
+ let Xe = We?.listSandboxes?.items ?? [], W = We?.listSandboxes?.total ?? 0, Ze = Ge, Qe = Xe, G = Math.ceil(W / 20), K = Qe, q = T.search || T.template && T.template !== "all" || T.status && T.status !== "all", J = Xe.filter((e) => e.status === "RUNNING").length, $e = W, et = m(() => Array.from(N.keys()), [N]), Y = m(() => Array.from(N.values()), [N]), X = m(() => K.filter((e) => N.has(e.id)).length, [K, N]), Z = m(() => Y.filter(Le), [Y]), Q = m(() => Y.filter(ze), [Y]), tt = et.length > 0, nt = K.length > 0 && X === K.length, rt = X > 0 && X < K.length, $ = F !== null, it = F === "select-all", at = F === "stop", ot = F === "delete", st = p((e) => {
89
+ E({ search: e }), M(1);
90
+ }, [E]), ct = p(() => {
91
+ O(), M(1);
92
+ }, [O]), lt = () => {
93
+ w?.(t(C, "new"));
94
+ }, ut = (e) => {
95
+ w?.(t(C, e));
96
+ }, dt = p((e, t) => {
97
+ P((n) => {
98
+ let r = new Map(n);
99
+ return t ? r.set(e.id, e) : r.delete(e.id), r;
100
+ });
101
+ }, []), ft = p((e) => {
102
+ P((t) => {
103
+ let n = new Map(t);
104
+ for (let t of K) e ? n.set(t.id, t) : n.delete(t.id);
105
+ return n;
106
+ });
107
+ }, [K]), pt = p(() => {
108
+ P(/* @__PURE__ */ new Map());
109
+ }, []), mt = p((e) => {
110
+ P((t) => {
111
+ if (!t.has(e)) return t;
112
+ let n = new Map(t);
113
+ return n.delete(e), n;
114
+ });
115
+ }, []), ht = p((e) => {
116
+ P((t) => {
117
+ if (!t.has(e.id)) return t;
118
+ let n = new Map(t);
119
+ return n.set(e.id, e), n;
120
+ });
121
+ }, []), gt = p(async () => {
122
+ if (!z) return [];
123
+ let e = [], t = 1;
124
+ for (;;) {
125
+ let n = (await He.query({
126
+ query: pe,
127
+ variables: {
128
+ context: { workspaceId: z },
129
+ filter: B,
130
+ pagination: {
131
+ page: t,
132
+ limit: 100
133
+ }
134
+ },
135
+ fetchPolicy: "network-only"
136
+ })).data?.listSandboxes;
137
+ if (!n || (e.push(...n.items), !n.hasMore)) break;
138
+ t += 1;
139
+ }
140
+ return e;
141
+ }, [
142
+ He,
143
+ B,
144
+ z
145
+ ]), _t = p(async (e) => {
146
+ try {
147
+ let t = (await H({ variables: {
148
+ context: { workspaceId: z },
149
+ id: e.id
150
+ } })).data?.stopSandbox;
151
+ if (!t) throw Error(`Failed to stop sandbox "${e.name}".`);
152
+ ht({
153
+ ...e,
154
+ status: t.status,
155
+ stoppedAt: t.stoppedAt ?? e.stoppedAt
156
+ }), await V();
157
+ } catch (t) {
158
+ R({
159
+ kind: "error",
160
+ message: D(t, `Failed to stop sandbox "${e.name}".`)
161
+ });
162
+ }
163
+ }, [
164
+ V,
165
+ H,
166
+ ht,
167
+ z
168
+ ]), vt = p(async (e) => {
169
+ ye("medium");
170
+ try {
171
+ if (!(await U({ variables: {
172
+ context: { workspaceId: z },
173
+ id: e.id
174
+ } })).data?.deleteSandbox) throw Error(`Failed to delete sandbox "${e.name}".`);
175
+ be("success"), qe.sandboxDeleted({ sandboxId: e.id }), mt(e.id), await V();
176
+ } catch (t) {
177
+ be("error"), R({
178
+ kind: "error",
179
+ message: D(t, `Failed to delete sandbox "${e.name}".`)
180
+ });
181
+ }
182
+ }, [
183
+ U,
184
+ V,
185
+ mt,
186
+ z
187
+ ]), yt = p(async () => {
188
+ I("select-all");
189
+ try {
190
+ let e = await gt();
191
+ P(new Map(e.map((e) => [e.id, e]))), R({
192
+ kind: "success",
193
+ message: `Selected ${e.length} sandbox${e.length === 1 ? "" : "es"}.`
194
+ });
195
+ } catch (e) {
196
+ R({
197
+ kind: "error",
198
+ message: D(e, "Failed to select all matching sandboxes.")
199
+ });
200
+ } finally {
201
+ I(null);
202
+ }
203
+ }, [gt]), bt = p(async () => {
204
+ if (Z.length === 0) {
205
+ R({
206
+ kind: "error",
207
+ message: "Select at least one running sandbox to stop."
208
+ });
209
+ return;
210
+ }
211
+ let e = Y.length - Z.length;
212
+ I("stop");
213
+ try {
214
+ let t = await Ve(Z, async (e) => {
215
+ let t = await H({ variables: {
216
+ context: { workspaceId: z },
217
+ id: e.id
218
+ } });
219
+ if (!t.data?.stopSandbox) throw Error(`Failed to stop sandbox "${e.name}".`);
220
+ return t.data.stopSandbox;
221
+ }), n = t.filter((e) => e.status === "fulfilled").length, r = t.length - n;
222
+ P(/* @__PURE__ */ new Map()), await V(), R({
223
+ kind: r === 0 ? "success" : "error",
224
+ message: Be("Stopped", n, r, e)
225
+ });
226
+ } catch (e) {
227
+ R({
228
+ kind: "error",
229
+ message: D(e, "Failed to stop selected sandboxes.")
230
+ });
231
+ } finally {
232
+ I(null);
233
+ }
234
+ }, [
235
+ V,
236
+ Y.length,
237
+ Z,
238
+ H,
239
+ z
240
+ ]), xt = p(async () => {
241
+ if (Q.length === 0) {
242
+ R({
243
+ kind: "error",
244
+ message: "Select at least one stopped, failed, expired, or errored sandbox to delete."
245
+ });
246
+ return;
247
+ }
248
+ let e = Y.length - Q.length;
249
+ if (window.confirm(e > 0 ? `Delete ${Q.length} selected sandbox(es)? ${e} selected sandbox(es) cannot be deleted right now and will be skipped. This cannot be undone.` : `Delete ${Q.length} selected sandbox(es)? This cannot be undone.`)) {
250
+ I("delete");
251
+ try {
252
+ let t = await Ve(Q, async (e) => {
253
+ let t = await U({ variables: {
254
+ context: { workspaceId: z },
255
+ id: e.id
256
+ } });
257
+ if (!t.data?.deleteSandbox) throw Error(`Failed to delete sandbox "${e.name}".`);
258
+ return t.data.deleteSandbox;
259
+ }), n = t.filter((e) => e.status === "fulfilled").length, r = t.length - n;
260
+ P(/* @__PURE__ */ new Map()), await V(), R({
261
+ kind: r === 0 ? "success" : "error",
262
+ message: Be("Deleted", n, r, e)
263
+ });
264
+ } catch (e) {
265
+ R({
266
+ kind: "error",
267
+ message: D(e, "Failed to delete selected sandboxes.")
268
+ });
269
+ } finally {
270
+ I(null);
271
+ }
272
+ }
273
+ }, [
274
+ U,
275
+ V,
276
+ Q,
277
+ Y.length,
278
+ z
279
+ ]);
280
+ return /* @__PURE__ */ S(ue, {
281
+ title: f(k, "sandbox.list.title", "Sandboxes"),
282
+ subtitle: f(k, "sandbox.list.subtitle", "Manage ephemeral sandbox environments for development and testing"),
283
+ icon: /* @__PURE__ */ x(_, { size: 24 }),
284
+ headerActions: /* @__PURE__ */ x(xe, {
285
+ permission: "sandbox:create",
286
+ children: /* @__PURE__ */ S(r, {
287
+ onClick: lt,
288
+ size: "lg",
289
+ children: [/* @__PURE__ */ x(Oe, { size: 18 }), f(k, "sandbox.list.actions.create", "Create Sandbox")]
290
+ })
291
+ }),
292
+ headerContent: $e > 0 ? /* @__PURE__ */ S("div", {
293
+ className: "flex items-center gap-3",
294
+ children: [/* @__PURE__ */ x(n, {
295
+ variant: "secondary",
296
+ className: "gap-1.5",
297
+ children: f(k, "sandbox.list.header.total", "{count} total", { count: $e })
298
+ }), /* @__PURE__ */ x(n, {
299
+ variant: "default",
300
+ className: "gap-1.5 bg-status-success-bg-subtle text-status-success-text border-border-default",
301
+ children: f(k, "sandbox.list.header.running", "{count} running", { count: J })
302
+ })]
303
+ }) : null,
304
+ children: [
305
+ /* @__PURE__ */ x(de, {
306
+ runningCount: J,
307
+ maxConcurrent: Math.max(J, 10)
308
+ }),
309
+ /* @__PURE__ */ S("div", {
310
+ className: "space-y-4",
311
+ children: [
312
+ /* @__PURE__ */ S("div", {
313
+ className: "flex flex-col sm:flex-row gap-3",
314
+ children: [
315
+ /* @__PURE__ */ x(r, {
316
+ variant: "outline",
317
+ size: "sm",
318
+ onClick: () => Ye(!0),
319
+ "aria-label": f(k, "sandbox.list.actions.export.ariaLabel", "Export sandboxes"),
320
+ className: "self-start sm:self-auto",
321
+ children: f(k, "sandbox.list.actions.export.label", "Export")
322
+ }),
323
+ /* @__PURE__ */ S("div", {
324
+ className: "flex-1 relative group",
325
+ children: [/* @__PURE__ */ x(ke, {
326
+ size: 18,
327
+ className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground group-focus-within:text-primary transition-colors"
328
+ }), /* @__PURE__ */ x(ee, {
329
+ type: "text",
330
+ placeholder: f(k, "sandbox.list.search.placeholder", "Search sandboxes by name, description, or ID..."),
331
+ value: T.search,
332
+ onChange: (e) => st(e.target.value),
333
+ className: "pl-[3.25rem] h-10",
334
+ "aria-label": f(k, "sandbox.list.search.ariaLabel", "Search sandboxes")
335
+ })]
336
+ }),
337
+ /* @__PURE__ */ S(r, {
338
+ variant: A || q ? "default" : "outline",
339
+ onClick: () => Ue(!A),
340
+ "aria-label": f(k, "sandbox.list.filters.toggle.ariaLabel", "Toggle filters"),
341
+ children: [
342
+ /* @__PURE__ */ x(De, { size: 16 }),
343
+ A ? f(k, "sandbox.list.filters.toggle.hide", "Hide") : f(k, "sandbox.list.filters.toggle.show", "Filter"),
344
+ q && /* @__PURE__ */ x(n, {
345
+ variant: "secondary",
346
+ className: "ml-1 h-5 min-w-5 px-1.5",
347
+ children: [
348
+ T.search,
349
+ T.template !== "all" && T.template,
350
+ T.status !== "all" && T.status
351
+ ].filter(Boolean).length
352
+ })
353
+ ]
354
+ })
355
+ ]
356
+ }),
357
+ A && /* @__PURE__ */ x(i, {
358
+ className: "animate-in slide-in-from-top-2 duration-200",
359
+ children: /* @__PURE__ */ S(a, {
360
+ className: "p-4",
361
+ children: [/* @__PURE__ */ S("div", {
362
+ className: "flex items-center justify-between mb-4",
363
+ children: [/* @__PURE__ */ S("h3", {
364
+ className: "font-semibold text-foreground flex items-center gap-2",
365
+ children: [/* @__PURE__ */ x(De, {
366
+ size: 16,
367
+ className: "text-primary"
368
+ }), f(k, "sandbox.list.filters.panel.title", "Filter Sandboxes")]
369
+ }), q && /* @__PURE__ */ S(r, {
370
+ variant: "ghost",
371
+ size: "sm",
372
+ onClick: ct,
373
+ className: "text-muted-foreground hover:text-destructive",
374
+ children: [/* @__PURE__ */ x(y, { size: 16 }), f(k, "sandbox.list.filters.clearAll", "Clear All")]
375
+ })]
376
+ }), /* @__PURE__ */ S("div", {
377
+ className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
378
+ children: [/* @__PURE__ */ S("div", {
379
+ className: "space-y-2",
380
+ children: [/* @__PURE__ */ x("label", {
381
+ className: "block text-sm font-medium text-foreground",
382
+ children: f(k, "sandbox.list.filters.template.label", "Template")
383
+ }), /* @__PURE__ */ S(s, {
384
+ value: T.template || "all",
385
+ onValueChange: (e) => {
386
+ E({ template: e }), M(1);
387
+ },
388
+ children: [/* @__PURE__ */ x(ne, { children: /* @__PURE__ */ x(l, { placeholder: f(k, "sandbox.list.filters.template.all", "All Templates") }) }), /* @__PURE__ */ S(te, { children: [
389
+ /* @__PURE__ */ x(c, {
390
+ value: "all",
391
+ children: f(k, "sandbox.list.filters.template.all", "All Templates")
392
+ }),
393
+ /* @__PURE__ */ x(c, {
394
+ value: "AI_BUILDER",
395
+ children: f(k, "sandbox.list.filters.template.aiBuilder", "AI Builder")
396
+ }),
397
+ /* @__PURE__ */ x(c, {
398
+ value: "WORKFLOW_MULTI_NODE",
399
+ children: f(k, "sandbox.list.filters.template.workflowMultiNode", "Workflow Multi-Node")
400
+ }),
401
+ /* @__PURE__ */ x(c, {
402
+ value: "MISC_SHELL",
403
+ children: f(k, "sandbox.list.filters.template.miscShell", "Misc Shell")
404
+ }),
405
+ /* @__PURE__ */ x(c, {
406
+ value: "CUSTOM",
407
+ children: f(k, "sandbox.list.filters.template.custom", "Custom")
408
+ })
409
+ ] })]
410
+ })]
411
+ }), /* @__PURE__ */ S("div", {
412
+ className: "space-y-2",
413
+ children: [/* @__PURE__ */ x("label", {
414
+ className: "block text-sm font-medium text-foreground",
415
+ children: f(k, "sandbox.list.filters.status.label", "Status")
416
+ }), /* @__PURE__ */ S(s, {
417
+ value: T.status || "all",
418
+ onValueChange: (e) => {
419
+ E({ status: e }), M(1);
420
+ },
421
+ children: [/* @__PURE__ */ x(ne, { children: /* @__PURE__ */ x(l, { placeholder: f(k, "sandbox.list.filters.status.all", "All Statuses") }) }), /* @__PURE__ */ S(te, { children: [
422
+ /* @__PURE__ */ x(c, {
423
+ value: "all",
424
+ children: f(k, "sandbox.list.filters.status.all", "All Statuses")
425
+ }),
426
+ /* @__PURE__ */ x(c, {
427
+ value: "PENDING",
428
+ children: f(k, "sandbox.list.filters.status.pending", "Pending")
429
+ }),
430
+ /* @__PURE__ */ x(c, {
431
+ value: "PROVISIONING",
432
+ children: f(k, "sandbox.list.filters.status.provisioning", "Provisioning")
433
+ }),
434
+ /* @__PURE__ */ x(c, {
435
+ value: "RUNNING",
436
+ children: f(k, "sandbox.list.filters.status.running", "Running")
437
+ }),
438
+ /* @__PURE__ */ x(c, {
439
+ value: "STOPPING",
440
+ children: f(k, "sandbox.list.filters.status.stopping", "Stopping")
441
+ }),
442
+ /* @__PURE__ */ x(c, {
443
+ value: "STOPPED",
444
+ children: f(k, "sandbox.list.filters.status.stopped", "Stopped")
445
+ }),
446
+ /* @__PURE__ */ x(c, {
447
+ value: "ERROR",
448
+ children: f(k, "sandbox.list.filters.status.error", "Error")
449
+ }),
450
+ /* @__PURE__ */ x(c, {
451
+ value: "EXPIRED",
452
+ children: f(k, "sandbox.list.filters.status.expired", "Expired")
453
+ }),
454
+ /* @__PURE__ */ x(c, {
455
+ value: "FAILED",
456
+ children: f(k, "sandbox.list.filters.status.failed", "Failed")
457
+ })
458
+ ] })]
459
+ })]
460
+ })]
461
+ })]
462
+ })
463
+ }),
464
+ L && /* @__PURE__ */ x(i, {
465
+ className: d("border-l-4", L.kind === "success" ? "border-l-status-success-text bg-status-success-bg-subtle" : "border-l-destructive bg-destructive/5"),
466
+ children: /* @__PURE__ */ S(a, {
467
+ className: "p-4 flex items-start justify-between gap-3",
468
+ children: [/* @__PURE__ */ S("div", {
469
+ role: L.kind === "error" ? "alert" : "status",
470
+ className: "flex items-start gap-2 text-sm",
471
+ children: [L.kind === "success" ? /* @__PURE__ */ x(Se, {
472
+ size: 16,
473
+ className: "mt-0.5 text-status-success-text"
474
+ }) : /* @__PURE__ */ x(g, {
475
+ size: 16,
476
+ className: "mt-0.5 text-destructive"
477
+ }), /* @__PURE__ */ x("span", {
478
+ className: d("font-medium", L.kind === "success" ? "text-status-success-text" : "text-destructive"),
479
+ children: L.message
480
+ })]
481
+ }), /* @__PURE__ */ x(r, {
482
+ variant: "ghost",
483
+ size: "icon",
484
+ onClick: () => R(null),
485
+ "aria-label": f(k, "sandbox.list.bulk.feedback.dismiss.ariaLabel", "Dismiss bulk action message"),
486
+ children: /* @__PURE__ */ x(y, { size: 16 })
487
+ })]
488
+ })
489
+ })
490
+ ]
491
+ }),
492
+ Ze && /* @__PURE__ */ x("div", {
493
+ className: "space-y-4 animate-in fade-in-0 duration-300",
494
+ children: [...[
495
+ ,
496
+ ,
497
+ ,
498
+ ]].map((e, t) => /* @__PURE__ */ x(i, { children: /* @__PURE__ */ x(a, {
499
+ className: "p-5",
500
+ children: /* @__PURE__ */ S("div", {
501
+ className: "flex items-start gap-4",
502
+ children: [/* @__PURE__ */ x(u, { className: "h-12 w-12 rounded-lg" }), /* @__PURE__ */ S("div", {
503
+ className: "flex-1 space-y-2",
504
+ children: [
505
+ /* @__PURE__ */ x(u, { className: "h-5 w-1/3" }),
506
+ /* @__PURE__ */ x(u, { className: "h-4 w-2/3" }),
507
+ /* @__PURE__ */ S("div", {
508
+ className: "flex gap-2 pt-1",
509
+ children: [/* @__PURE__ */ x(u, { className: "h-5 w-20 rounded-full" }), /* @__PURE__ */ x(u, { className: "h-5 w-24 rounded-full" })]
510
+ })
511
+ ]
512
+ })]
513
+ })
514
+ }) }, t))
515
+ }),
516
+ !Ze && /* @__PURE__ */ x("div", {
517
+ className: "space-y-4",
518
+ children: K.length > 0 ? /* @__PURE__ */ S(b, { children: [
519
+ /* @__PURE__ */ x(i, {
520
+ className: "animate-in fade-in-0 duration-300",
521
+ children: /* @__PURE__ */ S(a, {
522
+ className: "p-4 space-y-3",
523
+ children: [/* @__PURE__ */ S("div", {
524
+ className: "flex flex-col gap-3 xl:flex-row xl:items-center xl:justify-between",
525
+ children: [/* @__PURE__ */ S("div", {
526
+ className: "flex flex-wrap items-center gap-3",
527
+ children: [
528
+ /* @__PURE__ */ S("label", {
529
+ className: "inline-flex items-center gap-2 text-sm font-medium text-foreground",
530
+ children: [/* @__PURE__ */ x(o, {
531
+ checked: nt ? !0 : rt ? "indeterminate" : !1,
532
+ onCheckedChange: (e) => ft(e === !0),
533
+ "aria-label": f(k, "sandbox.list.bulk.selectPage.ariaLabel", "Select all sandboxes on this page")
534
+ }), /* @__PURE__ */ x("span", { children: f(k, "sandbox.list.bulk.selectPage.label", "Select page") })]
535
+ }),
536
+ W > K.length && /* @__PURE__ */ S(r, {
537
+ variant: "ghost",
538
+ size: "sm",
539
+ onClick: yt,
540
+ disabled: $,
541
+ children: [it ? /* @__PURE__ */ x(v, {
542
+ size: 14,
543
+ className: "animate-spin"
544
+ }) : null, f(k, "sandbox.list.bulk.selectAll", "Select all {count}", { count: W })]
545
+ }),
546
+ tt && /* @__PURE__ */ x(r, {
547
+ variant: "ghost",
548
+ size: "sm",
549
+ onClick: pt,
550
+ disabled: $,
551
+ children: f(k, "sandbox.list.bulk.clearSelection", "Clear selection")
552
+ })
553
+ ]
554
+ }), /* @__PURE__ */ S("div", {
555
+ className: "flex flex-wrap items-center gap-2",
556
+ children: [
557
+ /* @__PURE__ */ x(n, {
558
+ variant: tt ? "default" : "secondary",
559
+ className: "gap-1.5",
560
+ children: f(k, "sandbox.list.bulk.selectedCount", "{count} selected", { count: et.length })
561
+ }),
562
+ /* @__PURE__ */ S(r, {
563
+ variant: "outline",
564
+ onClick: bt,
565
+ disabled: $ || Z.length === 0,
566
+ children: [
567
+ at ? /* @__PURE__ */ x(v, {
568
+ size: 16,
569
+ className: "animate-spin"
570
+ }) : /* @__PURE__ */ x(Ae, { size: 16 }),
571
+ f(k, "sandbox.list.bulk.stopSelected", "Stop Selected"),
572
+ Z.length > 0 ? ` (${Z.length})` : ""
573
+ ]
574
+ }),
575
+ /* @__PURE__ */ S(r, {
576
+ variant: "outline",
577
+ className: "text-destructive border-destructive/50 hover:bg-destructive/10",
578
+ onClick: xt,
579
+ disabled: $ || Q.length === 0,
580
+ children: [
581
+ ot ? /* @__PURE__ */ x(v, {
582
+ size: 16,
583
+ className: "animate-spin"
584
+ }) : /* @__PURE__ */ x(Me, { size: 16 }),
585
+ f(k, "sandbox.list.bulk.deleteSelected", "Delete Selected"),
586
+ Q.length > 0 ? ` (${Q.length})` : ""
587
+ ]
588
+ })
589
+ ]
590
+ })]
591
+ }), /* @__PURE__ */ x("p", {
592
+ className: "text-xs text-muted-foreground",
593
+ children: f(k, "sandbox.list.bulk.helpText", "Select one, many, or every sandbox on the current filter set. Only running sandboxes can be stopped, and only stopped, failed, expired, or errored sandboxes can be deleted.")
594
+ })]
595
+ })
596
+ }),
597
+ /* @__PURE__ */ x("div", {
598
+ className: "space-y-3",
599
+ children: K.map((e, t) => {
600
+ let n = N.has(e.id);
601
+ return /* @__PURE__ */ x(i, {
602
+ className: d("cursor-pointer overflow-hidden group", "hover:shadow-md hover:border-primary/30 transition-all duration-200", "animate-in fade-in-0 slide-in-from-bottom-2", n && "border-primary/60 bg-primary/5 shadow-sm"),
603
+ style: { animationDelay: `${t * 40}ms` },
604
+ onClick: () => ut(e.id),
605
+ tabIndex: 0,
606
+ onKeyDown: (t) => {
607
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), ut(e.id));
608
+ },
609
+ children: /* @__PURE__ */ x(a, {
610
+ className: "p-5",
611
+ children: /* @__PURE__ */ S("div", {
612
+ className: "flex items-start gap-4",
613
+ children: [
614
+ /* @__PURE__ */ x("div", {
615
+ className: "pt-1",
616
+ children: /* @__PURE__ */ x(o, {
617
+ checked: n,
618
+ onCheckedChange: (t) => dt(e, t === !0),
619
+ onClick: (e) => e.stopPropagation(),
620
+ "aria-label": f(k, "sandbox.list.item.select.ariaLabel", "Select sandbox {name}", { name: e.name })
621
+ })
622
+ }),
623
+ /* @__PURE__ */ x("div", {
624
+ className: "flex-shrink-0 p-3 rounded-lg bg-muted/50",
625
+ children: /* @__PURE__ */ x(ae, {
626
+ type: e.template,
627
+ size: 24
628
+ })
629
+ }),
630
+ /* @__PURE__ */ S("div", {
631
+ className: "flex-1 min-w-0",
632
+ children: [
633
+ /* @__PURE__ */ S("div", {
634
+ className: "flex items-start justify-between gap-3",
635
+ children: [/* @__PURE__ */ S("div", {
636
+ className: "min-w-0",
637
+ children: [/* @__PURE__ */ S("div", {
638
+ className: "flex items-center gap-2 mb-1",
639
+ children: [/* @__PURE__ */ x("h3", {
640
+ className: "font-semibold text-base truncate",
641
+ children: e.name
642
+ }), /* @__PURE__ */ x(re, { status: e.status })]
643
+ }), e.description && /* @__PURE__ */ x("p", {
644
+ className: "text-sm text-muted-foreground line-clamp-1 mb-2",
645
+ children: e.description
646
+ })]
647
+ }), /* @__PURE__ */ S("div", {
648
+ className: d("flex items-center gap-1 transition-opacity flex-shrink-0", n ? "opacity-100" : "opacity-0 group-hover:opacity-100"),
649
+ children: [
650
+ Le(e) && /* @__PURE__ */ x(r, {
651
+ variant: "ghost",
652
+ size: "icon",
653
+ onClick: (t) => {
654
+ t.stopPropagation(), _t(e);
655
+ },
656
+ "aria-label": f(k, "sandbox.list.item.actions.stop.ariaLabel", "Stop sandbox"),
657
+ children: /* @__PURE__ */ x(Ae, { size: 16 })
658
+ }),
659
+ Re(e) && /* @__PURE__ */ x(r, {
660
+ variant: "ghost",
661
+ size: "icon",
662
+ onClick: (t) => {
663
+ t.stopPropagation(), Ke({ variables: {
664
+ context: { workspaceId: z },
665
+ id: e.id,
666
+ additionalSeconds: 3600
667
+ } }).then(() => V());
668
+ },
669
+ "aria-label": f(k, "sandbox.list.item.actions.extendTtl.ariaLabel", "Extend TTL"),
670
+ children: /* @__PURE__ */ x(je, { size: 16 })
671
+ }),
672
+ ze(e) && /* @__PURE__ */ x(r, {
673
+ variant: "ghost",
674
+ size: "icon",
675
+ className: "text-destructive hover:text-destructive",
676
+ onClick: (t) => {
677
+ t.stopPropagation(), vt(e);
678
+ },
679
+ "aria-label": f(k, "sandbox.list.item.actions.delete.ariaLabel", "Delete sandbox"),
680
+ children: /* @__PURE__ */ x(Me, { size: 16 })
681
+ })
682
+ ]
683
+ })]
684
+ }),
685
+ /* @__PURE__ */ S("div", {
686
+ className: "flex flex-wrap items-center gap-x-4 gap-y-2 text-xs text-muted-foreground",
687
+ children: [
688
+ /* @__PURE__ */ x(ie, {
689
+ cpuRequest: e.resources?.cpuRequest ?? "0",
690
+ memoryRequest: e.resources?.memoryRequest ?? "0",
691
+ containerCount: e.containers?.length,
692
+ className: "text-xs"
693
+ }),
694
+ /* @__PURE__ */ x("span", {
695
+ className: "text-muted-foreground/40",
696
+ children: "|"
697
+ }),
698
+ /* @__PURE__ */ x(ae, {
699
+ type: e.template,
700
+ size: 12,
701
+ showLabel: !0
702
+ }),
703
+ e.storage?.mode && e.storage.mode !== "NONE" && /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("span", {
704
+ className: "text-muted-foreground/40",
705
+ children: "|"
706
+ }), /* @__PURE__ */ S("span", {
707
+ className: "inline-flex items-center gap-1",
708
+ children: [
709
+ /* @__PURE__ */ x(Ee, { size: 12 }),
710
+ e.storage.mode === "EPHEMERAL" ? f(k, "sandbox.list.item.storage.ephemeral", "Ephemeral") : f(k, "sandbox.list.item.storage.persistent", "Persistent"),
711
+ e.storage.sizeGi && ` ${e.storage.sizeGi}Gi`
712
+ ]
713
+ })] }),
714
+ e.containers?.length > 0 && /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("span", {
715
+ className: "text-muted-foreground/40",
716
+ children: "|"
717
+ }), /* @__PURE__ */ S("span", {
718
+ className: "inline-flex items-center gap-1",
719
+ children: [/* @__PURE__ */ x(Te, { size: 12 }), f(k, "sandbox.list.item.containers", "{count} container{count, plural, one {} other {s}}", { count: e.containers.length })]
720
+ })] }),
721
+ e.expiresAt && e.status === "RUNNING" && /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("span", {
722
+ className: "text-muted-foreground/40",
723
+ children: "|"
724
+ }), /* @__PURE__ */ x(oe, {
725
+ compact: !0,
726
+ expiresAt: e.expiresAt
727
+ })] }),
728
+ /* @__PURE__ */ x("span", {
729
+ className: "text-muted-foreground/40",
730
+ children: "|"
731
+ }),
732
+ /* @__PURE__ */ x("span", { children: f(k, "sandbox.list.item.created", "Created {time}", { time: Fe(e.createdAt) }) })
733
+ ]
734
+ }),
735
+ e.errorMessage && /* @__PURE__ */ S("div", {
736
+ className: "mt-2 flex items-start gap-1.5 text-xs text-status-error-text bg-status-error-bg-subtle px-2.5 py-1.5 rounded-md",
737
+ children: [/* @__PURE__ */ x(g, {
738
+ size: 12,
739
+ className: "flex-shrink-0 mt-0.5"
740
+ }), /* @__PURE__ */ x("span", {
741
+ className: "line-clamp-1",
742
+ children: e.errorMessage
743
+ })]
744
+ })
745
+ ]
746
+ })
747
+ ]
748
+ })
749
+ })
750
+ }, e.id);
751
+ })
752
+ }),
753
+ G > 1 && /* @__PURE__ */ x(i, {
754
+ className: "animate-in fade-in-0 duration-300",
755
+ children: /* @__PURE__ */ S(a, {
756
+ className: "p-4 flex flex-col sm:flex-row items-center justify-between gap-3",
757
+ children: [/* @__PURE__ */ x("p", {
758
+ className: "text-sm text-muted-foreground",
759
+ children: f(k, "sandbox.list.pagination.showing", "Showing {from}-{to} of {total}", {
760
+ from: (j - 1) * 20 + 1,
761
+ to: Math.min(j * 20, W),
762
+ total: W
763
+ })
764
+ }), /* @__PURE__ */ S("div", {
765
+ className: "flex items-center gap-2",
766
+ children: [
767
+ /* @__PURE__ */ x(r, {
768
+ variant: "outline",
769
+ size: "icon",
770
+ onClick: () => M((e) => Math.max(1, e - 1)),
771
+ disabled: j === 1,
772
+ "aria-label": f(k, "sandbox.list.pagination.previous.ariaLabel", "Previous page"),
773
+ children: /* @__PURE__ */ x(Ce, { size: 18 })
774
+ }),
775
+ /* @__PURE__ */ x(n, {
776
+ variant: "secondary",
777
+ className: "px-4 py-2 text-sm",
778
+ children: f(k, "sandbox.list.pagination.pageOf", "Page {current} of {total}", {
779
+ current: j,
780
+ total: G
781
+ })
782
+ }),
783
+ /* @__PURE__ */ x(r, {
784
+ variant: "outline",
785
+ size: "icon",
786
+ onClick: () => M((e) => Math.min(G, e + 1)),
787
+ disabled: j === G,
788
+ "aria-label": f(k, "sandbox.list.pagination.next.ariaLabel", "Next page"),
789
+ children: /* @__PURE__ */ x(we, { size: 18 })
790
+ })
791
+ ]
792
+ })]
793
+ })
794
+ })
795
+ ] }) : /* @__PURE__ */ x(le, {
796
+ icon: x(q ? ke : _, { size: 48 }),
797
+ title: q ? f(k, "sandbox.list.empty.filtered.title", "No matching sandboxes") : f(k, "sandbox.list.empty.title", "No sandboxes yet"),
798
+ description: q ? f(k, "sandbox.list.empty.filtered.description", "Try adjusting your search or filters to find what you're looking for.") : f(k, "sandbox.list.empty.description", "Create your first sandbox to start building and testing in isolated environments."),
799
+ action: q ? /* @__PURE__ */ S(r, {
800
+ variant: "outline",
801
+ onClick: ct,
802
+ children: [/* @__PURE__ */ x(y, { size: 16 }), f(k, "sandbox.list.empty.filtered.clearFilters", "Clear Filters")]
803
+ }) : /* @__PURE__ */ S(r, {
804
+ onClick: lt,
805
+ children: [/* @__PURE__ */ x(Oe, { size: 16 }), f(k, "sandbox.list.empty.createFirst", "Create First Sandbox")]
806
+ })
807
+ })
808
+ }),
809
+ /* @__PURE__ */ x(fe, {
810
+ workspaceId: z ?? "",
811
+ open: Je,
812
+ onClose: () => Ye(!1)
813
+ })
814
+ ]
815
+ });
816
+ }
817
+ //#endregion
818
+ export { O as SandboxListPage };
819
+
820
+ //# sourceMappingURL=SandboxListPage.js.map