@wso2/am-core-ui 0.0.19 → 0.0.20

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 (51) hide show
  1. package/dist/CatalogKindListing-DvUuZEpc.js +137 -0
  2. package/dist/{CodeBlock-mB_Loq7I.js → CodeBlock-B2Ecl916.js} +1 -1
  3. package/dist/EnvironmentCard-CIXhDhlZ.js +319 -0
  4. package/dist/{EnvironmentSelector-B7Bl93s2.js → EnvironmentSelector-D8S6nO9u.js} +1 -1
  5. package/dist/IsolationTierIndicator-cf90kgjL.js +81 -0
  6. package/dist/LabelChips-7rA7_yre.js +139 -0
  7. package/dist/PolicyListSection-D6aVSKwP.js +1143 -0
  8. package/dist/{ResourceListShell-Cx6mdeqv.js → ResourceListShell-DFisKftq.js} +1 -1
  9. package/dist/{SwaggerSpecViewer-BvkhoKsi.js → SwaggerSpecViewer-DzjR6U6W.js} +1 -1
  10. package/dist/{debounce-BV83M53b.js → debounce-D17ObVdG.js} +1 -1
  11. package/dist/{format-BEZZRyE2.js → format-wlHhWjGo.js} +1 -1
  12. package/dist/{formatDistanceToNow-TErllcH8.js → formatDistanceToNow-DyjnT7l9.js} +11 -11
  13. package/dist/{gatewayScripts-D8O45W8u.js → gatewayScripts-D4ZDEDPS.js} +1 -1
  14. package/dist/{index-sr-mWz4T.js → index-3K-zqdp-.js} +32 -32
  15. package/dist/{index-KRsV2L4V.js → index-6liAPSDn.js} +160 -160
  16. package/dist/{index-B52h3RHg.js → index-B3ASENUJ.js} +109 -109
  17. package/dist/index-B7Pf4oPq.js +3069 -0
  18. package/dist/index-BNO3FhZK.js +2304 -0
  19. package/dist/index-BUZSfCl5.js +335 -0
  20. package/dist/index-BXiG1r_o.js +1409 -0
  21. package/dist/{index-_0Pj_ZtW.js → index-BYy7Iaam.js} +40 -40
  22. package/dist/{index-BfjzUWDa.js → index-BbB_yx4V.js} +103 -103
  23. package/dist/index-BjWJ95lH.js +2728 -0
  24. package/dist/{index-B_Z0MwXk.js → index-ByEInFlf.js} +10916 -9520
  25. package/dist/index-C8WIhzyz.js +123 -0
  26. package/dist/index-CnzvaT6b.js +2368 -0
  27. package/dist/index-CrnCf-hJ.js +763 -0
  28. package/dist/{index-CgCWbWzN.js → index-Cvsho9xg.js} +381 -377
  29. package/dist/{index-UqDmyMSA.js → index-CxnAo1_c.js} +21 -21
  30. package/dist/{index-BnV-PkwM.js → index-Cz7-AZwE.js} +2 -2
  31. package/dist/{index-BP5drcF2.js → index-DBdRFjxm.js} +232 -233
  32. package/dist/{index-BZ4vxviI.js → index-DFsSvmMZ.js} +5 -5
  33. package/dist/index-DslzOSGN.js +2549 -0
  34. package/dist/{index-DD4qF7gq.js → index-DvpYvchM.js} +101 -100
  35. package/dist/index.d.ts +784 -163
  36. package/dist/index.js +532 -454
  37. package/dist/js-yaml-CvhD-clg.js +1335 -0
  38. package/dist/{llmProviderPayload-CzihkdNa.js → llmProviderPayload-BPzWDy7n.js} +2 -2
  39. package/package.json +1 -1
  40. package/dist/CatalogKindListing-DtFI2YMG.js +0 -118
  41. package/dist/EnvironmentCard-09h1XRxx.js +0 -310
  42. package/dist/PolicyListSection-o4k9e8XO.js +0 -2475
  43. package/dist/index-CGDYgUCH.js +0 -711
  44. package/dist/index-COt7nJIf.js +0 -2286
  45. package/dist/index-CWZjOy1h.js +0 -2247
  46. package/dist/index-CezvogTQ.js +0 -116
  47. package/dist/index-CjCkcuuI.js +0 -322
  48. package/dist/index-CjXvuf9m.js +0 -1354
  49. package/dist/index-DeQ-9KTC.js +0 -737
  50. package/dist/index-Df6OBy4E.js +0 -3041
  51. package/dist/index-PUuASE1F.js +0 -2507
@@ -0,0 +1,2728 @@
1
+ import { jsxs as g, Fragment as te, jsx as n } from "react/jsx-runtime";
2
+ import { c as K } from "react/compiler-runtime";
3
+ import { u as Zt, g as le, a as en, b as tn, f as nn, T as nt, c as ln, d as an, e as rn, h as Ue, N as lt, B as on, i as sn, j as cn, k as dn, l as mn, m as hn, n as Ee, o as at, p as pn, q as fn, r as un, D as rt, s as ot, t as st, v as gn, w as yn, x as bn, y as It, z as xn, A as Pt, P as ct, C as At, E as Ct, F as dt, G as kt, H as vn, I as Sn, J as wn, K as Nn, L as Dt, M as _n, O as In, Q as Pn, R as An } from "./index-ByEInFlf.js";
4
+ import "@tanstack/react-query";
5
+ import { useMemo as me, useState as Q, useEffect as Ne, useCallback as ge } from "react";
6
+ import { Box as N, Skeleton as U, Typography as A, IconButton as Re, Tooltip as _e, Card as ce, CardContent as de, Divider as J, useTheme as mt, Button as Z, Grid as Be, Stack as X, Chip as Me, CircularProgress as Xe, Alert as jt, MenuItem as xe, Select as ht, Form as $e, TextField as gt, DataGrid as Cn, SearchBar as Lt, Menu as kn, ListingTable as ie, Avatar as Tt, TablePagination as Dn, formatRelativeTime as jn } from "@wso2/oxygen-ui";
7
+ import { generatePath as se, Link as ue, useParams as ve, useSearchParams as Ln, useNavigate as Tn } from "react-router-dom";
8
+ import { ExternalLink as He, Tag as zn, ChevronRight as Ke, PauseCircle as Wn, XCircle as $n, CheckCircle as En, GitHub as Rn, AlertTriangle as Mn, RotateCcwKey as Gn, Settings as zt, Edit as Oe, Clock as Wt, Link as Bn, Rocket as On, GitBranch as $t, ArrowRight as Fn, Plus as it, Trash2 as Ve, User as yt, Package as Et, Home as Un } from "@wso2/oxygen-ui-icons-react";
9
+ import { f as pt } from "./formatDistanceToNow-DyjnT7l9.js";
10
+ import { AreaChart as Hn } from "@wso2/oxygen-ui-charts-react";
11
+ import { E as Rt } from "./EnvironmentCard-CIXhDhlZ.js";
12
+ import { C as Mt } from "./CodeBlock-B2Ecl916.js";
13
+ import { L as Kn, a as Gt } from "./LabelChips-7rA7_yre.js";
14
+ import { o as Bt, s as we } from "./schemas-DFScWdSL.js";
15
+ const Vn = (t) => {
16
+ const e = K(64), {
17
+ orgId: i,
18
+ kindName: l,
19
+ framework: a,
20
+ model: o
21
+ } = t;
22
+ let s;
23
+ e[0] !== l || e[1] !== i ? (s = {
24
+ orgName: i,
25
+ kindName: l
26
+ }, e[0] = l, e[1] = i, e[2] = s) : s = e[2];
27
+ const {
28
+ data: r,
29
+ isLoading: m
30
+ } = Zt(s);
31
+ let d;
32
+ e[3] !== l || e[4] !== i ? (d = se(le.children.org.children.catalog.children.kindDetails.path, {
33
+ orgId: i,
34
+ kindId: l
35
+ }), e[3] = l, e[4] = i, e[5] = d) : d = e[5];
36
+ const h = d;
37
+ let f, c, u, p, y, x, b, v, S, w, j, P, k, D, _, C, L;
38
+ if (e[6] !== a || e[7] !== m || e[8] !== r || e[9] !== h || e[10] !== l || e[11] !== o) {
39
+ const M = r?.versions?.find((G) => G.version === r.latestVersion) ?? r?.versions?.[0];
40
+ p = ce, w = "outlined", u = de, e[29] === Symbol.for("react.memo_cache_sentinel") ? (b = {
41
+ py: 1.5,
42
+ "&:last-child": {
43
+ pb: 1.5
44
+ }
45
+ }, e[29] = b) : b = e[29], e[30] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ n(N, { pb: 1, children: /* @__PURE__ */ n(A, { variant: "h6", children: "Kind Details" }) }), e[30] = v) : v = e[30], e[31] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ n(J, { sx: {
46
+ mb: 1.5
47
+ } }), e[31] = S) : S = e[31], c = N, _ = "flex", C = 2, L = 0;
48
+ let B;
49
+ e[32] === Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ n(A, { variant: "caption", color: "text.secondary", fontWeight: 600, sx: {
50
+ textTransform: "uppercase",
51
+ letterSpacing: "0.05em",
52
+ display: "block",
53
+ mb: 0.75
54
+ }, children: "Agent Kind" }), e[32] = B) : B = e[32], e[33] !== m || e[34] !== r || e[35] !== h || e[36] !== l ? (y = /* @__PURE__ */ g(N, { flex: 1, minWidth: 0, children: [
55
+ B,
56
+ m ? /* @__PURE__ */ g(te, { children: [
57
+ /* @__PURE__ */ n(U, { variant: "text", width: 160 }),
58
+ /* @__PURE__ */ n(U, { variant: "text", width: 200, sx: {
59
+ mt: 0.25
60
+ } })
61
+ ] }) : /* @__PURE__ */ g(te, { children: [
62
+ /* @__PURE__ */ g(N, { display: "flex", alignItems: "center", gap: 0.5, minWidth: 0, children: [
63
+ /* @__PURE__ */ n(A, { variant: "body2", noWrap: !0, children: r?.displayName ?? l }),
64
+ /* @__PURE__ */ n(Re, { size: "small", component: ue, to: h, sx: {
65
+ p: 0.25,
66
+ flexShrink: 0
67
+ }, children: /* @__PURE__ */ n(He, { size: 12 }) })
68
+ ] }),
69
+ r?.description && /* @__PURE__ */ n(_e, { title: r.description, placement: "bottom-start", children: /* @__PURE__ */ n(A, { variant: "caption", color: "text.secondary", mt: 0.25, sx: {
70
+ overflow: "hidden",
71
+ display: "-webkit-box",
72
+ WebkitLineClamp: 2,
73
+ WebkitBoxOrient: "vertical"
74
+ }, children: r.description }) })
75
+ ] })
76
+ ] }), e[33] = m, e[34] = r, e[35] = h, e[36] = l, e[37] = y) : y = e[37], e[38] === Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ n(J, { orientation: "vertical", flexItem: !0 }), e[38] = x) : x = e[38], f = N, j = 1, P = 0, e[39] === Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ n(A, { variant: "caption", color: "text.secondary", fontWeight: 600, sx: {
77
+ textTransform: "uppercase",
78
+ letterSpacing: "0.05em",
79
+ display: "block",
80
+ mb: 0.75
81
+ }, children: "Latest Release" }), e[39] = k) : k = e[39], D = m ? /* @__PURE__ */ n(U, { variant: "rounded", height: 28 }) : M ? /* @__PURE__ */ g(N, { display: "flex", alignItems: "center", gap: 1.5, minWidth: 0, children: [
82
+ /* @__PURE__ */ g(N, { display: "flex", alignItems: "center", gap: 0.5, sx: {
83
+ flexShrink: 0
84
+ }, children: [
85
+ /* @__PURE__ */ n(zn, { size: 13 }),
86
+ /* @__PURE__ */ g(A, { variant: "body2", color: "text.secondary", noWrap: !0, children: [
87
+ "v",
88
+ M.version
89
+ ] })
90
+ ] }),
91
+ /* @__PURE__ */ n(A, { variant: "body2", color: "text.secondary", noWrap: !0, flex: 1, children: pt(new Date(M.createdAt), {
92
+ addSuffix: !0
93
+ }) }),
94
+ (a || o) && /* @__PURE__ */ n(A, { variant: "caption", color: "text.secondary", noWrap: !0, sx: {
95
+ flexShrink: 0
96
+ }, children: `Agent Type: ${[a, o].filter(Boolean).join("/")}` }),
97
+ /* @__PURE__ */ n(Re, { size: "small", component: ue, to: h, children: /* @__PURE__ */ n(He, { size: 12 }) })
98
+ ] }) : /* @__PURE__ */ n(A, { variant: "body2", color: "text.secondary", children: "No versions yet." }), e[6] = a, e[7] = m, e[8] = r, e[9] = h, e[10] = l, e[11] = o, e[12] = f, e[13] = c, e[14] = u, e[15] = p, e[16] = y, e[17] = x, e[18] = b, e[19] = v, e[20] = S, e[21] = w, e[22] = j, e[23] = P, e[24] = k, e[25] = D, e[26] = _, e[27] = C, e[28] = L;
99
+ } else
100
+ f = e[12], c = e[13], u = e[14], p = e[15], y = e[16], x = e[17], b = e[18], v = e[19], S = e[20], w = e[21], j = e[22], P = e[23], k = e[24], D = e[25], _ = e[26], C = e[27], L = e[28];
101
+ let $;
102
+ e[40] !== f || e[41] !== j || e[42] !== P || e[43] !== k || e[44] !== D ? ($ = /* @__PURE__ */ g(f, { flex: j, minWidth: P, children: [
103
+ k,
104
+ D
105
+ ] }), e[40] = f, e[41] = j, e[42] = P, e[43] = k, e[44] = D, e[45] = $) : $ = e[45];
106
+ let E;
107
+ e[46] !== c || e[47] !== y || e[48] !== x || e[49] !== $ || e[50] !== _ || e[51] !== C || e[52] !== L ? (E = /* @__PURE__ */ g(c, { display: _, gap: C, minWidth: L, children: [
108
+ y,
109
+ x,
110
+ $
111
+ ] }), e[46] = c, e[47] = y, e[48] = x, e[49] = $, e[50] = _, e[51] = C, e[52] = L, e[53] = E) : E = e[53];
112
+ let R;
113
+ e[54] !== u || e[55] !== b || e[56] !== v || e[57] !== S || e[58] !== E ? (R = /* @__PURE__ */ g(u, { sx: b, children: [
114
+ v,
115
+ S,
116
+ E
117
+ ] }), e[54] = u, e[55] = b, e[56] = v, e[57] = S, e[58] = E, e[59] = R) : R = e[59];
118
+ let W;
119
+ return e[60] !== p || e[61] !== w || e[62] !== R ? (W = /* @__PURE__ */ n(p, { variant: w, children: R }), e[60] = p, e[61] = w, e[62] = R, e[63] = W) : W = e[63], W;
120
+ }, Ot = (t) => {
121
+ const e = K(19), {
122
+ percent: i,
123
+ color: l,
124
+ size: a
125
+ } = t, o = a === void 0 ? 30 : a, s = mt(), r = o / 2, m = o * 0.43, d = o * 0.117, h = 2 * Math.PI * m, f = Number.isFinite(i) ? Math.min(Math.max(i, 0), 100) : 0, c = h * (1 - f / 100), u = `0 0 ${o} ${o}`;
126
+ let p;
127
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (p = {
128
+ display: "block"
129
+ }, e[0] = p) : p = e[0];
130
+ const y = s.vars?.palette?.action?.selected;
131
+ let x;
132
+ e[1] !== r || e[2] !== m || e[3] !== d || e[4] !== y ? (x = /* @__PURE__ */ n("circle", { cx: r, cy: r, r: m, fill: "none", stroke: y, strokeWidth: d }), e[1] = r, e[2] = m, e[3] = d, e[4] = y, e[5] = x) : x = e[5];
133
+ const b = s.vars?.palette?.[l]?.main, v = `rotate(-90 ${r} ${r})`;
134
+ let S;
135
+ e[6] !== h || e[7] !== r || e[8] !== c || e[9] !== m || e[10] !== d || e[11] !== b || e[12] !== v ? (S = /* @__PURE__ */ n("circle", { cx: r, cy: r, r: m, fill: "none", stroke: b, strokeWidth: d, strokeDasharray: h, strokeDashoffset: c, strokeLinecap: "round", transform: v }), e[6] = h, e[7] = r, e[8] = c, e[9] = m, e[10] = d, e[11] = b, e[12] = v, e[13] = S) : S = e[13];
136
+ let w;
137
+ return e[14] !== o || e[15] !== u || e[16] !== x || e[17] !== S ? (w = /* @__PURE__ */ g("svg", { width: o, height: o, viewBox: u, style: p, children: [
138
+ x,
139
+ S
140
+ ] }), e[14] = o, e[15] = u, e[16] = x, e[17] = S, e[18] = w) : w = e[18], w;
141
+ }, qn = (t) => {
142
+ const e = t.map((i) => i.aggregations?.mean).filter((i) => typeof i == "number");
143
+ return e.length === 0 ? null : e.reduce((i, l) => i + l, 0) / e.length;
144
+ }, Xn = (t) => !t || t <= 0 ? null : t < 60 ? `Runs every ${t} min${t === 1 ? "" : "s"}` : t === 60 ? "Runs hourly" : t === 1440 ? "Runs daily" : t % 1440 === 0 ? `Runs every ${t / 1440} days` : t % 60 === 0 ? `Runs every ${t / 60} hours` : `Runs every ${Math.floor(t / 60)}h ${t % 60}m`, Yn = (t) => t === null ? "primary" : t >= 70 ? "success" : t >= 40 ? "warning" : "error", Jn = (t) => {
145
+ const e = K(50), {
146
+ monitor: i,
147
+ orgId: l,
148
+ projectId: a,
149
+ agentId: o,
150
+ envId: s
151
+ } = t;
152
+ let r;
153
+ e[0] !== o || e[1] !== i.name || e[2] !== l || e[3] !== a ? (r = {
154
+ orgName: l,
155
+ projName: a,
156
+ agentName: o,
157
+ monitorName: i.name
158
+ }, e[0] = o, e[1] = i.name, e[2] = l, e[3] = a, e[4] = r) : r = e[4];
159
+ let m;
160
+ e[5] === Symbol.for("react.memo_cache_sentinel") ? (m = {
161
+ timeRange: nt.SEVEN_DAYS
162
+ }, e[5] = m) : m = e[5];
163
+ const {
164
+ data: d,
165
+ isLoading: h
166
+ } = tn(r, m);
167
+ let f;
168
+ e: {
169
+ if (!d) {
170
+ f = null;
171
+ break e;
172
+ }
173
+ const G = qn(d.evaluators);
174
+ f = G !== null ? G * 100 : null;
175
+ }
176
+ const c = f;
177
+ let u;
178
+ e[6] !== o || e[7] !== s || e[8] !== i.name || e[9] !== l || e[10] !== a ? (u = se(le.children.org.children.projects.children.agents.children.environment.children.evaluation.children.monitor.children.view.path, {
179
+ orgId: l,
180
+ projectId: a,
181
+ agentId: o,
182
+ envId: s,
183
+ monitorId: i.name
184
+ }), e[6] = o, e[7] = s, e[8] = i.name, e[9] = l, e[10] = a, e[11] = u) : u = e[11];
185
+ const p = u;
186
+ let y;
187
+ e[12] !== i.evaluators ? (y = i.evaluators.map(Qn).join(" · "), e[12] = i.evaluators, e[13] = y) : y = e[13];
188
+ const x = y;
189
+ let b;
190
+ e[14] !== c ? (b = Yn(c), e[14] = c, e[15] = b) : b = e[15];
191
+ const v = b;
192
+ let S;
193
+ e: {
194
+ if (i.type === "past") {
195
+ if (!i.traceStart || !i.traceEnd) {
196
+ S = null;
197
+ break e;
198
+ }
199
+ let H;
200
+ e[16] !== i.traceEnd || e[17] !== i.traceStart ? (H = nn(i.traceStart, i.traceEnd), e[16] = i.traceEnd, e[17] = i.traceStart, e[18] = H) : H = e[18], S = H;
201
+ break e;
202
+ }
203
+ let G;
204
+ e[19] !== i.intervalMinutes ? (G = Xn(i.intervalMinutes), e[19] = i.intervalMinutes, e[20] = G) : G = e[20], S = G;
205
+ }
206
+ const w = S;
207
+ let j;
208
+ e[21] === Symbol.for("react.memo_cache_sentinel") ? (j = {
209
+ display: "flex",
210
+ alignItems: "center",
211
+ gap: 2,
212
+ "&:last-child": {
213
+ pb: 1.5
214
+ }
215
+ }, e[21] = j) : j = e[21];
216
+ let P;
217
+ e[22] !== v || e[23] !== h || e[24] !== c ? (P = h ? /* @__PURE__ */ n(U, { variant: "circular", width: 52, height: 52 }) : /* @__PURE__ */ n(Ot, { percent: c ?? 0, color: v, size: 72 }), e[22] = v, e[23] = h, e[24] = c, e[25] = P) : P = e[25];
218
+ let k;
219
+ e[26] !== h || e[27] !== c ? (k = h ? /* @__PURE__ */ n(U, { variant: "text", width: 48 }) : /* @__PURE__ */ n(A, { variant: "h6", lineHeight: 1.2, children: c !== null ? `${c.toFixed(2)}%` : "—" }), e[26] = h, e[27] = c, e[28] = k) : k = e[28];
220
+ const D = i.displayName || i.name;
221
+ let _;
222
+ e[29] !== D ? (_ = /* @__PURE__ */ n(A, { variant: "body2", noWrap: !0, fontWeight: 500, children: D }), e[29] = D, e[30] = _) : _ = e[30];
223
+ let C, L;
224
+ e[31] === Symbol.for("react.memo_cache_sentinel") ? (C = {
225
+ p: 0.25,
226
+ flexShrink: 0
227
+ }, L = /* @__PURE__ */ n(He, { size: 12 }), e[31] = C, e[32] = L) : (C = e[31], L = e[32]);
228
+ let $;
229
+ e[33] !== p ? ($ = /* @__PURE__ */ n(Re, { size: "small", component: ue, to: p, sx: C, children: L }), e[33] = p, e[34] = $) : $ = e[34];
230
+ let E;
231
+ e[35] !== _ || e[36] !== $ ? (E = /* @__PURE__ */ g(N, { display: "flex", alignItems: "center", gap: 0.5, minWidth: 0, children: [
232
+ _,
233
+ $
234
+ ] }), e[35] = _, e[36] = $, e[37] = E) : E = e[37];
235
+ let R;
236
+ e[38] !== x ? (R = x && /* @__PURE__ */ n(A, { variant: "caption", color: "text.secondary", noWrap: !0, display: "block", title: x, children: x }), e[38] = x, e[39] = R) : R = e[39];
237
+ let W;
238
+ e[40] !== w ? (W = w && /* @__PURE__ */ n(A, { variant: "caption", color: "text.disabled", noWrap: !0, display: "block", title: w, children: w }), e[40] = w, e[41] = W) : W = e[41];
239
+ let M;
240
+ e[42] !== k || e[43] !== E || e[44] !== R || e[45] !== W ? (M = /* @__PURE__ */ g(N, { minWidth: 0, flex: 1, overflow: "hidden", children: [
241
+ k,
242
+ E,
243
+ R,
244
+ W
245
+ ] }), e[42] = k, e[43] = E, e[44] = R, e[45] = W, e[46] = M) : M = e[46];
246
+ let B;
247
+ return e[47] !== M || e[48] !== P ? (B = /* @__PURE__ */ n(ce, { variant: "outlined", children: /* @__PURE__ */ g(de, { sx: j, children: [
248
+ P,
249
+ M
250
+ ] }) }), e[47] = M, e[48] = P, e[49] = B) : B = e[49], B;
251
+ }, Ft = (t) => {
252
+ const e = K(30), {
253
+ orgId: i,
254
+ projectId: l,
255
+ agentId: a,
256
+ envId: o
257
+ } = t;
258
+ let s;
259
+ e[0] !== a || e[1] !== i || e[2] !== l ? (s = {
260
+ orgName: i,
261
+ projName: l,
262
+ agentName: a
263
+ }, e[0] = a, e[1] = i, e[2] = l, e[3] = s) : s = e[3];
264
+ let r;
265
+ e[4] !== o ? (r = {
266
+ environmentName: o
267
+ }, e[4] = o, e[5] = r) : r = e[5];
268
+ const {
269
+ data: m,
270
+ isLoading: d
271
+ } = en(s, r);
272
+ let h;
273
+ e[6] !== m?.monitors ? (h = m?.monitors ?? [], e[6] = m?.monitors, e[7] = h) : h = e[7];
274
+ const f = h;
275
+ if (!d && f.length === 0)
276
+ return null;
277
+ let c;
278
+ e[8] !== a || e[9] !== o || e[10] !== i || e[11] !== l ? (c = se(le.children.org.children.projects.children.agents.children.environment.children.evaluation.children.monitor.path, {
279
+ orgId: i,
280
+ projectId: l,
281
+ agentId: a,
282
+ envId: o
283
+ }), e[8] = a, e[9] = o, e[10] = i, e[11] = l, e[12] = c) : c = e[12];
284
+ const u = c;
285
+ let p;
286
+ e[13] === Symbol.for("react.memo_cache_sentinel") ? (p = {
287
+ display: "grid",
288
+ gridTemplateColumns: {
289
+ xs: "1fr",
290
+ sm: "repeat(2, 1fr)",
291
+ md: "repeat(3, 1fr)"
292
+ },
293
+ gap: 1.5
294
+ }, e[13] = p) : p = e[13];
295
+ const y = p;
296
+ let x;
297
+ e[14] === Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ n(J, { sx: {
298
+ mt: 2,
299
+ mb: 1
300
+ } }), e[14] = x) : x = e[14];
301
+ let b;
302
+ e[15] === Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ n(A, { variant: "caption", color: "text.secondary", fontWeight: 600, sx: {
303
+ textTransform: "uppercase",
304
+ letterSpacing: "0.05em"
305
+ }, children: "Agent Performance" }), e[15] = b) : b = e[15];
306
+ let v;
307
+ e[16] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ n(Ke, { size: 14 }), e[16] = v) : v = e[16];
308
+ let S;
309
+ e[17] === Symbol.for("react.memo_cache_sentinel") ? (S = {
310
+ minWidth: 0,
311
+ fontSize: "0.75rem"
312
+ }, e[17] = S) : S = e[17];
313
+ let w;
314
+ e[18] !== u ? (w = /* @__PURE__ */ g(N, { display: "flex", justifyContent: "space-between", alignItems: "center", mb: 0.5, children: [
315
+ b,
316
+ /* @__PURE__ */ n(Z, { size: "small", variant: "text", endIcon: v, component: ue, to: u, sx: S, children: "View all" })
317
+ ] }), e[18] = u, e[19] = w) : w = e[19];
318
+ let j;
319
+ e[20] !== a || e[21] !== o || e[22] !== d || e[23] !== f || e[24] !== i || e[25] !== l ? (j = d ? /* @__PURE__ */ n(N, { sx: y, children: [1, 2, 3].map(Zn) }) : /* @__PURE__ */ n(N, { sx: y, children: f.map((k) => /* @__PURE__ */ n(Jn, { monitor: k, orgId: i, projectId: l, agentId: a, envId: o }, k.name)) }), e[20] = a, e[21] = o, e[22] = d, e[23] = f, e[24] = i, e[25] = l, e[26] = j) : j = e[26];
320
+ let P;
321
+ return e[27] !== w || e[28] !== j ? (P = /* @__PURE__ */ g(te, { children: [
322
+ x,
323
+ w,
324
+ j
325
+ ] }), e[27] = w, e[28] = j, e[29] = P) : P = e[29], P;
326
+ };
327
+ function Qn(t) {
328
+ return t.displayName;
329
+ }
330
+ function Zn(t) {
331
+ return /* @__PURE__ */ n(U, { variant: "rounded", height: 96 }, t);
332
+ }
333
+ const bt = (t) => {
334
+ const e = Math.round(t * 1e3);
335
+ return e >= 1e3 ? `${(e / 1e3).toFixed(2)} cores` : `${e}m`;
336
+ }, xt = (t) => t >= 1024 ** 3 ? `${(t / 1024 ** 3).toFixed(1)} GB` : t >= 1024 ** 2 ? `${(t / 1024 ** 2).toFixed(0)} MB` : `${Math.round(t / 1024)} KB`, ei = (t) => t >= 1e3 ? `${(t / 1e3).toFixed(1)}k` : `${t}`, ti = (t) => {
337
+ const e = t / 1e6;
338
+ return e < 1e3 ? `${Math.round(e)}ms` : `${(e / 1e3).toFixed(1)}s`;
339
+ }, Ze = (t) => {
340
+ const e = K(17), {
341
+ label: i,
342
+ value: l,
343
+ points: a,
344
+ color: o,
345
+ isLoading: s
346
+ } = t, r = o === void 0 ? "currentColor" : o;
347
+ let m;
348
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (m = {
349
+ width: "100%"
350
+ }, e[0] = m) : m = e[0];
351
+ let d;
352
+ e[1] === Symbol.for("react.memo_cache_sentinel") ? (d = {
353
+ py: 1,
354
+ px: 1.5,
355
+ "&:last-child": {
356
+ pb: 1
357
+ },
358
+ display: "flex",
359
+ alignItems: "center",
360
+ justifyContent: "space-between",
361
+ gap: 1
362
+ }, e[1] = d) : d = e[1];
363
+ let h;
364
+ e[2] !== s || e[3] !== l ? (h = s ? /* @__PURE__ */ n(U, { variant: "text", width: 48, height: 28 }) : /* @__PURE__ */ n(A, { variant: "h6", lineHeight: 1.2, children: l }), e[2] = s, e[3] = l, e[4] = h) : h = e[4];
365
+ let f;
366
+ e[5] !== i ? (f = /* @__PURE__ */ n(A, { variant: "caption", color: "text.secondary", children: i }), e[5] = i, e[6] = f) : f = e[6];
367
+ let c;
368
+ e[7] !== h || e[8] !== f ? (c = /* @__PURE__ */ g(N, { children: [
369
+ h,
370
+ f
371
+ ] }), e[7] = h, e[8] = f, e[9] = c) : c = e[9];
372
+ let u;
373
+ e[10] !== r || e[11] !== s || e[12] !== a ? (u = s ? /* @__PURE__ */ n(U, { variant: "rounded", width: 120, height: 48 }) : /* @__PURE__ */ n(Hn, { data: a, xAxisDataKey: "time", height: 48, width: 120, xAxis: {
374
+ show: !1
375
+ }, yAxis: {
376
+ show: !1
377
+ }, grid: {
378
+ show: !1
379
+ }, tooltip: {
380
+ show: !1
381
+ }, legend: {
382
+ show: !1
383
+ }, margin: {
384
+ top: 4,
385
+ right: 0,
386
+ bottom: 0,
387
+ left: 0
388
+ }, areas: [{
389
+ dataKey: "value",
390
+ stroke: r,
391
+ fill: r,
392
+ fillOpacity: 0.15,
393
+ dot: !1,
394
+ activeDot: !1,
395
+ connectNulls: !0,
396
+ isAnimationActive: !1,
397
+ type: "monotone"
398
+ }] }), e[10] = r, e[11] = s, e[12] = a, e[13] = u) : u = e[13];
399
+ let p;
400
+ return e[14] !== c || e[15] !== u ? (p = /* @__PURE__ */ n(ce, { variant: "outlined", sx: m, children: /* @__PURE__ */ g(de, { sx: d, children: [
401
+ c,
402
+ u
403
+ ] }) }), e[14] = c, e[15] = u, e[16] = p) : p = e[16], p;
404
+ }, ni = (t) => {
405
+ const e = K(17), {
406
+ label: i,
407
+ value: l,
408
+ percent: a,
409
+ color: o,
410
+ isLoading: s
411
+ } = t;
412
+ let r;
413
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (r = {
414
+ width: "100%"
415
+ }, e[0] = r) : r = e[0];
416
+ let m;
417
+ e[1] === Symbol.for("react.memo_cache_sentinel") ? (m = {
418
+ py: 1,
419
+ px: 1.5,
420
+ "&:last-child": {
421
+ pb: 1
422
+ },
423
+ display: "flex",
424
+ alignItems: "center",
425
+ justifyContent: "space-between",
426
+ gap: 1
427
+ }, e[1] = m) : m = e[1];
428
+ let d;
429
+ e[2] !== s || e[3] !== l ? (d = s ? /* @__PURE__ */ n(U, { variant: "text", width: 48, height: 28 }) : /* @__PURE__ */ n(A, { variant: "h6", lineHeight: 1.2, children: l }), e[2] = s, e[3] = l, e[4] = d) : d = e[4];
430
+ let h;
431
+ e[5] !== i ? (h = /* @__PURE__ */ n(A, { variant: "caption", color: "text.secondary", children: i }), e[5] = i, e[6] = h) : h = e[6];
432
+ let f;
433
+ e[7] !== d || e[8] !== h ? (f = /* @__PURE__ */ g(N, { children: [
434
+ d,
435
+ h
436
+ ] }), e[7] = d, e[8] = h, e[9] = f) : f = e[9];
437
+ let c;
438
+ e[10] !== o || e[11] !== s || e[12] !== a ? (c = s ? /* @__PURE__ */ n(U, { variant: "circular", width: 48, height: 48 }) : /* @__PURE__ */ n(Ot, { percent: a, color: o, size: 48 }), e[10] = o, e[11] = s, e[12] = a, e[13] = c) : c = e[13];
439
+ let u;
440
+ return e[14] !== f || e[15] !== c ? (u = /* @__PURE__ */ n(ce, { variant: "outlined", sx: r, children: /* @__PURE__ */ g(de, { sx: m, children: [
441
+ f,
442
+ c
443
+ ] }) }), e[14] = f, e[15] = c, e[16] = u) : u = e[16], u;
444
+ }, vt = (t) => {
445
+ const e = K(20), {
446
+ label: i,
447
+ value: l,
448
+ limit: a,
449
+ percent: o,
450
+ isLoading: s
451
+ } = t, r = mt(), m = Math.min(o ?? 0, 100), d = m >= 85 ? r.vars?.palette?.error?.main : m >= 60 ? r.vars?.palette?.warning?.main : r.vars?.palette?.success?.main;
452
+ let h;
453
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (h = {
454
+ width: "100%"
455
+ }, e[0] = h) : h = e[0];
456
+ let f;
457
+ e[1] === Symbol.for("react.memo_cache_sentinel") ? (f = {
458
+ py: 0.75,
459
+ px: 1.5,
460
+ "&:last-child": {
461
+ pb: 0.75
462
+ }
463
+ }, e[1] = f) : f = e[1];
464
+ let c;
465
+ e[2] !== i ? (c = /* @__PURE__ */ n(A, { variant: "caption", color: "text.secondary", children: i }), e[2] = i, e[3] = c) : c = e[3];
466
+ let u;
467
+ e[4] !== d || e[5] !== s || e[6] !== a || e[7] !== o || e[8] !== l ? (u = s ? /* @__PURE__ */ n(U, { variant: "text", width: 60, height: 18 }) : /* @__PURE__ */ g(N, { display: "flex", alignItems: "baseline", gap: 0.5, children: [
468
+ /* @__PURE__ */ n(A, { variant: "caption", fontWeight: 600, color: "text.primary", children: l }),
469
+ a && /* @__PURE__ */ g(A, { variant: "caption", color: "text.disabled", children: [
470
+ "/ ",
471
+ a
472
+ ] }),
473
+ o !== null && /* @__PURE__ */ g(A, { variant: "caption", fontWeight: 600, sx: {
474
+ color: d
475
+ }, children: [
476
+ Math.round(o),
477
+ "%"
478
+ ] })
479
+ ] }), e[4] = d, e[5] = s, e[6] = a, e[7] = o, e[8] = l, e[9] = u) : u = e[9];
480
+ let p;
481
+ e[10] !== c || e[11] !== u ? (p = /* @__PURE__ */ g(N, { display: "flex", justifyContent: "space-between", alignItems: "baseline", mb: 0.5, children: [
482
+ c,
483
+ u
484
+ ] }), e[10] = c, e[11] = u, e[12] = p) : p = e[12];
485
+ let y;
486
+ e[13] !== d || e[14] !== s || e[15] !== m ? (y = s ? /* @__PURE__ */ n(U, { variant: "rounded", height: 4 }) : /* @__PURE__ */ n(N, { sx: {
487
+ height: 4,
488
+ borderRadius: 2,
489
+ bgcolor: "action.selected",
490
+ overflow: "hidden"
491
+ }, children: /* @__PURE__ */ n(N, { sx: {
492
+ height: "100%",
493
+ width: `${m}%`,
494
+ bgcolor: d,
495
+ borderRadius: 2,
496
+ transition: "width 0.4s ease"
497
+ } }) }), e[13] = d, e[14] = s, e[15] = m, e[16] = y) : y = e[16];
498
+ let x;
499
+ return e[17] !== p || e[18] !== y ? (x = /* @__PURE__ */ n(ce, { variant: "outlined", sx: h, children: /* @__PURE__ */ g(de, { sx: f, children: [
500
+ p,
501
+ y
502
+ ] }) }), e[17] = p, e[18] = y, e[19] = x) : x = e[19], x;
503
+ }, Ut = ({
504
+ orgId: t,
505
+ projectId: e,
506
+ agentId: i,
507
+ envId: l,
508
+ hideMetrics: a = !1,
509
+ external: o = !1
510
+ }) => {
511
+ const s = mt(), {
512
+ data: r
513
+ } = ln({
514
+ orgName: t,
515
+ projName: e,
516
+ agentName: i
517
+ }, {
518
+ enabled: !o
519
+ }), m = r?.[l]?.status, d = !o && m === "suspended", f = !o && !(m === "active" || m === "error" || m === "failed" || m === "suspended"), {
520
+ data: c,
521
+ isLoading: u
522
+ } = an({
523
+ agentName: i,
524
+ orgName: t,
525
+ projName: e
526
+ }, {
527
+ environmentName: l
528
+ }, {
529
+ enabled: !a && !d && !f,
530
+ enableAutoRefresh: !0,
531
+ timeRange: nt.ONE_HOUR
532
+ }), {
533
+ traceList: p,
534
+ isLoading: y
535
+ } = rn(t, e, i, l, nt.ONE_DAY, 10, "desc", void 0, void 0, {
536
+ enableAutoRefresh: !0,
537
+ enabled: !f
538
+ }), x = c?.cpuUsage ?? [], b = x.length ? x[x.length - 1].value : null, v = c?.cpuLimits ?? [], S = v.length ? v[v.length - 1].value : null, w = b !== null && S ? b / S * 100 : null, j = c?.memory ?? [], P = j.length ? j[j.length - 1].value : null, k = c?.memoryLimits ?? [], D = k.length ? k[k.length - 1].value : null, _ = P !== null && D ? P / D * 100 : null, C = me(() => p?.traces ?? [], [p]), L = me(() => [...C].reverse().map((T) => ({
539
+ time: Ue(new Date(T.startTime), "HH:mm"),
540
+ value: Math.round(T.durationInNanos / 1e6)
541
+ })), [C]), $ = C.length ? C.reduce((T, O) => T + O.durationInNanos, 0) / C.length : null, E = me(() => [...C].reverse().filter((T) => T.tokenUsage?.totalTokens != null).map((T) => ({
542
+ time: Ue(new Date(T.startTime), "HH:mm"),
543
+ value: T.tokenUsage.totalTokens
544
+ })), [C]), R = (() => {
545
+ const T = C.filter((O) => O.tokenUsage?.totalTokens != null);
546
+ return T.length ? Math.round(T.reduce((O, I) => O + (I.tokenUsage?.totalTokens ?? 0), 0) / T.length) : null;
547
+ })(), W = me(() => [...C].reverse().filter((T) => T.score?.score != null).map((T) => ({
548
+ time: Ue(new Date(T.startTime), "HH:mm"),
549
+ value: Math.round(T.score.score * 100)
550
+ })), [C]), M = (() => {
551
+ const T = C.filter((O) => O.score?.score != null);
552
+ return T.length ? T.reduce((O, I) => O + (I.score?.score ?? 0), 0) / T.length : null;
553
+ })(), B = C.length ? C.filter((T) => (T.status?.errorCount ?? 0) === 0).length / C.length * 100 : null, G = B === null ? "primary" : B >= 70 ? "success" : B >= 40 ? "warning" : "error", H = se(le.children.org.children.projects.children.agents.children.environment.children.observability.children.traces.path, {
554
+ orgId: t,
555
+ projectId: e,
556
+ agentId: i,
557
+ envId: l
558
+ }), F = se(le.children.org.children.projects.children.agents.children.environment.children.observability.children.metrics.path, {
559
+ orgId: t,
560
+ projectId: e,
561
+ agentId: i,
562
+ envId: l
563
+ });
564
+ return f ? null : /* @__PURE__ */ g(te, { children: [
565
+ /* @__PURE__ */ n(J, { sx: {
566
+ mt: 2,
567
+ mb: 1
568
+ } }),
569
+ /* @__PURE__ */ g(N, { display: "flex", justifyContent: "space-between", alignItems: "center", mb: 0.5, children: [
570
+ /* @__PURE__ */ n(A, { variant: "caption", color: "text.secondary", fontWeight: 600, sx: {
571
+ textTransform: "uppercase",
572
+ letterSpacing: "0.05em"
573
+ }, children: "Recent Traces" }),
574
+ /* @__PURE__ */ n(Z, { size: "small", variant: "text", endIcon: /* @__PURE__ */ n(Ke, { size: 14 }), component: ue, to: H, sx: {
575
+ minWidth: 0,
576
+ fontSize: "0.75rem"
577
+ }, children: "View all" })
578
+ ] }),
579
+ /* @__PURE__ */ g(Be, { container: !0, spacing: 1.5, children: [
580
+ /* @__PURE__ */ n(Be, { size: {
581
+ xs: 12,
582
+ sm: 6,
583
+ lg: 3
584
+ }, children: /* @__PURE__ */ n(Ze, { label: "Avg Latency", value: $ !== null ? ti($) : "—", points: L, color: s.vars?.palette?.info?.main, isLoading: y }) }),
585
+ /* @__PURE__ */ n(Be, { size: {
586
+ xs: 12,
587
+ sm: 6,
588
+ lg: 3
589
+ }, children: /* @__PURE__ */ n(Ze, { label: "Avg Tokens", value: R !== null ? ei(R) : "—", points: E, color: s.vars?.palette?.warning?.main, isLoading: y }) }),
590
+ M !== null && /* @__PURE__ */ n(Be, { size: {
591
+ xs: 12,
592
+ sm: 6,
593
+ lg: 3
594
+ }, children: /* @__PURE__ */ n(Ze, { label: "Avg Score", value: `${(M * 100).toFixed(1)}%`, points: W, color: s.vars?.palette?.success?.main, isLoading: y }) }),
595
+ /* @__PURE__ */ n(Be, { size: {
596
+ xs: 12,
597
+ sm: 6,
598
+ lg: 3
599
+ }, children: /* @__PURE__ */ n(ni, { label: "Success Rate", value: B !== null ? `${B.toFixed(1)}%` : "—", percent: B ?? 0, color: G, isLoading: y }) })
600
+ ] }),
601
+ !a && (d ? /* @__PURE__ */ n(lt, { icon: /* @__PURE__ */ n(Wn, { size: 32 }), message: "Environment Suspended", subtitle: "Metrics are unavailable while the environment is suspended.", disableBackground: !0 }) : /* @__PURE__ */ g(te, { children: [
602
+ /* @__PURE__ */ n(J, { sx: {
603
+ mt: 1.5,
604
+ mb: 1
605
+ } }),
606
+ /* @__PURE__ */ g(N, { display: "flex", justifyContent: "space-between", alignItems: "center", mb: 1, children: [
607
+ /* @__PURE__ */ n(A, { variant: "caption", color: "text.secondary", fontWeight: 600, sx: {
608
+ textTransform: "uppercase",
609
+ letterSpacing: "0.05em"
610
+ }, children: "System Metrics" }),
611
+ /* @__PURE__ */ n(Z, { size: "small", variant: "text", endIcon: /* @__PURE__ */ n(Ke, { size: 14 }), component: ue, to: F, sx: {
612
+ minWidth: 0,
613
+ fontSize: "0.75rem"
614
+ }, children: "View all" })
615
+ ] }),
616
+ /* @__PURE__ */ g(X, { direction: "row", spacing: 0.75, sx: {
617
+ maxWidth: 400
618
+ }, children: [
619
+ /* @__PURE__ */ n(vt, { label: "CPU", value: b !== null ? bt(b) : "—", limit: S !== null ? bt(S) : null, percent: w, isLoading: u }),
620
+ /* @__PURE__ */ n(vt, { label: "Memory", value: P !== null ? xt(P) : "—", limit: D !== null ? xt(D) : null, percent: _, isLoading: u })
621
+ ] })
622
+ ] }))
623
+ ] });
624
+ }, ii = (t) => {
625
+ const e = K(39), {
626
+ orgId: i,
627
+ projectId: l,
628
+ agentId: a,
629
+ repository: o,
630
+ latestBuild: s,
631
+ isBuildsLoading: r,
632
+ framework: m,
633
+ model: d,
634
+ build: h
635
+ } = t;
636
+ let f;
637
+ e: {
638
+ if (!h) {
639
+ f = null;
640
+ break e;
641
+ }
642
+ if (h.type === "buildpack") {
643
+ const {
644
+ language: F,
645
+ languageVersion: T
646
+ } = h.buildpack;
647
+ f = T ? `${F} ${T}` : F;
648
+ break e;
649
+ }
650
+ f = "Docker";
651
+ }
652
+ const c = f;
653
+ let u;
654
+ e[0] !== a || e[1] !== i || e[2] !== l ? (u = se(le.children.org.children.projects.children.agents.children.build.path, {
655
+ orgId: i,
656
+ projectId: l,
657
+ agentId: a
658
+ }), e[0] = a, e[1] = i, e[2] = l, e[3] = u) : u = e[3];
659
+ const p = u;
660
+ let y;
661
+ e[4] !== o ? (y = o ? (() => {
662
+ const {
663
+ url: F,
664
+ branch: T,
665
+ appPath: O
666
+ } = o;
667
+ if (O && O !== "/") {
668
+ const I = O.startsWith("/") ? O.substring(1) : O;
669
+ return `${F}/tree/${T}/${I}`;
670
+ }
671
+ return `${F}/tree/${T}`;
672
+ })() : null, e[4] = o, e[5] = y) : y = e[5];
673
+ const x = y, b = li;
674
+ let v;
675
+ e[6] === Symbol.for("react.memo_cache_sentinel") ? (v = {
676
+ py: 1.5,
677
+ "&:last-child": {
678
+ pb: 1.5
679
+ }
680
+ }, e[6] = v) : v = e[6];
681
+ let S;
682
+ e[7] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ n(N, { pb: 1, children: /* @__PURE__ */ n(A, { variant: "h6", children: "Source & Build" }) }), e[7] = S) : S = e[7];
683
+ let w;
684
+ e[8] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ n(J, { sx: {
685
+ mb: 1.5
686
+ } }), e[8] = w) : w = e[8];
687
+ let j;
688
+ e[9] === Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ n(A, { variant: "caption", color: "text.secondary", fontWeight: 600, sx: {
689
+ textTransform: "uppercase",
690
+ letterSpacing: "0.05em",
691
+ display: "block",
692
+ mb: 0.75
693
+ }, children: "Repository" }), e[9] = j) : j = e[9];
694
+ let P;
695
+ e[10] === Symbol.for("react.memo_cache_sentinel") ? (P = /* @__PURE__ */ n(Rn, { size: 14, style: {
696
+ flexShrink: 0
697
+ } }), e[10] = P) : P = e[10];
698
+ const k = x ?? "—";
699
+ let D;
700
+ e[11] !== k ? (D = /* @__PURE__ */ n(A, { variant: "body2", noWrap: !0, children: k }), e[11] = k, e[12] = D) : D = e[12];
701
+ let _;
702
+ e[13] !== x ? (_ = x && /* @__PURE__ */ n(Re, { size: "small", component: "a", href: x, target: "_blank", rel: "noopener noreferrer", sx: {
703
+ p: 0.25,
704
+ flexShrink: 0
705
+ }, children: /* @__PURE__ */ n(He, { size: 12 }) }), e[13] = x, e[14] = _) : _ = e[14];
706
+ let C;
707
+ e[15] !== D || e[16] !== _ ? (C = /* @__PURE__ */ g(N, { display: "flex", alignItems: "center", gap: 0.5, minWidth: 0, children: [
708
+ P,
709
+ D,
710
+ _
711
+ ] }), e[15] = D, e[16] = _, e[17] = C) : C = e[17];
712
+ let L;
713
+ e[18] !== c || e[19] !== m || e[20] !== d ? (L = (m || d || c) && /* @__PURE__ */ n(A, { variant: "caption", color: "text.secondary", noWrap: !0, display: "block", mt: 0.25, children: [(m || d) && `Agent Type: ${[m, d].filter(Boolean).join("/")}`, c && `Language: ${c}`].filter(Boolean).join(" · ") }), e[18] = c, e[19] = m, e[20] = d, e[21] = L) : L = e[21];
714
+ let $;
715
+ e[22] !== C || e[23] !== L ? ($ = /* @__PURE__ */ g(N, { flex: 1, minWidth: 0, children: [
716
+ j,
717
+ C,
718
+ L
719
+ ] }), e[22] = C, e[23] = L, e[24] = $) : $ = e[24];
720
+ let E;
721
+ e[25] === Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ n(J, { orientation: "vertical", flexItem: !0 }), e[25] = E) : E = e[25];
722
+ let R;
723
+ e[26] === Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ n(A, { variant: "caption", color: "text.secondary", fontWeight: 600, sx: {
724
+ textTransform: "uppercase",
725
+ letterSpacing: "0.05em"
726
+ }, children: "Latest Build" }), e[26] = R) : R = e[26];
727
+ let W;
728
+ e[27] === Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ n(Ke, { size: 12 }), e[27] = W) : W = e[27];
729
+ let M;
730
+ e[28] !== p ? (M = /* @__PURE__ */ g(N, { display: "flex", justifyContent: "space-between", alignItems: "center", mb: 0.75, children: [
731
+ R,
732
+ /* @__PURE__ */ n(Z, { size: "small", variant: "text", endIcon: W, component: ue, to: p, children: "View all" })
733
+ ] }), e[28] = p, e[29] = M) : M = e[29];
734
+ let B;
735
+ e[30] !== r || e[31] !== s ? (B = r ? /* @__PURE__ */ n(U, { variant: "rounded", height: 28 }) : s ? /* @__PURE__ */ g(N, { display: "flex", alignItems: "center", gap: 1.5, minWidth: 0, children: [
736
+ /* @__PURE__ */ g(A, { variant: "body2", color: "text.secondary", noWrap: !0, sx: {
737
+ flexShrink: 0
738
+ }, children: [
739
+ s.buildParameters?.branch,
740
+ " :"
741
+ ] }),
742
+ /* @__PURE__ */ n(A, { variant: "body2", noWrap: !0, flex: 1, children: s.buildName }),
743
+ /* @__PURE__ */ n(A, { variant: "body2", color: "text.secondary", noWrap: !0, sx: {
744
+ flexShrink: 0
745
+ }, children: Ue(new Date(s.startedAt), "dd/MM/yyyy HH:mm:ss") }),
746
+ /* @__PURE__ */ n(Me, { label: s.status, size: "small", color: on[s.status] ?? "default", variant: "outlined", icon: b(s.status), sx: {
747
+ flexShrink: 0
748
+ } })
749
+ ] }) : /* @__PURE__ */ n(A, { variant: "body2", color: "text.secondary", children: "No builds yet." }), e[30] = r, e[31] = s, e[32] = B) : B = e[32];
750
+ let G;
751
+ e[33] !== M || e[34] !== B ? (G = /* @__PURE__ */ g(N, { flex: 1, minWidth: 0, children: [
752
+ M,
753
+ B
754
+ ] }), e[33] = M, e[34] = B, e[35] = G) : G = e[35];
755
+ let H;
756
+ return e[36] !== $ || e[37] !== G ? (H = /* @__PURE__ */ n(ce, { variant: "outlined", children: /* @__PURE__ */ g(de, { sx: v, children: [
757
+ S,
758
+ w,
759
+ /* @__PURE__ */ g(N, { display: "flex", gap: 2, minWidth: 0, children: [
760
+ $,
761
+ E,
762
+ G
763
+ ] })
764
+ ] }) }), e[36] = $, e[37] = G, e[38] = H) : H = e[38], H;
765
+ };
766
+ function li(t) {
767
+ if (t)
768
+ return t === "Running" || t === "Pending" ? /* @__PURE__ */ n(Xe, { size: 12, color: "inherit" }) : t === "Failed" ? /* @__PURE__ */ n($n, { size: 14 }) : /* @__PURE__ */ n(En, { size: 14 });
769
+ }
770
+ function ft(t) {
771
+ const e = K(10), {
772
+ orgId: i,
773
+ projectId: l,
774
+ agentId: a,
775
+ envId: o
776
+ } = t;
777
+ let s;
778
+ e[0] !== a || e[1] !== i || e[2] !== l ? (s = {
779
+ orgName: i,
780
+ projName: l,
781
+ agentName: a
782
+ }, e[0] = a, e[1] = i, e[2] = l, e[3] = s) : s = e[3];
783
+ let r;
784
+ e[4] !== o ? (r = {
785
+ environment: o
786
+ }, e[4] = o, e[5] = r) : r = e[5];
787
+ const {
788
+ data: m,
789
+ isLoading: d
790
+ } = sn(s, r), h = m?.[0], f = h?.status === "completed";
791
+ let c;
792
+ return e[6] !== h || e[7] !== d || e[8] !== f ? (c = {
793
+ binding: h,
794
+ provisioned: f,
795
+ isLoading: d
796
+ }, e[6] = h, e[7] = d, e[8] = f, e[9] = c) : c = e[9], c;
797
+ }
798
+ const St = (t) => {
799
+ const e = K(8), {
800
+ label: i,
801
+ items: l,
802
+ emptyText: a
803
+ } = t;
804
+ let o;
805
+ e[0] !== i ? (o = /* @__PURE__ */ n(A, { variant: "body2", color: "text.secondary", mb: 0.5, children: i }), e[0] = i, e[1] = o) : o = e[1];
806
+ let s;
807
+ e[2] !== a || e[3] !== l ? (s = l.length === 0 ? /* @__PURE__ */ n(A, { variant: "body2", color: "text.disabled", children: a }) : /* @__PURE__ */ n(X, { direction: "row", flexWrap: "wrap", gap: 1, children: l.map(ri) }), e[2] = a, e[3] = l, e[4] = s) : s = e[4];
808
+ let r;
809
+ return e[5] !== o || e[6] !== s ? (r = /* @__PURE__ */ g(N, { children: [
810
+ o,
811
+ s
812
+ ] }), e[5] = o, e[6] = s, e[7] = r) : r = e[7], r;
813
+ };
814
+ function Ht(t) {
815
+ const e = K(24), {
816
+ orgId: i,
817
+ projectId: l,
818
+ agentId: a,
819
+ envId: o,
820
+ enabled: s
821
+ } = t;
822
+ let r;
823
+ e[0] !== a || e[1] !== i || e[2] !== l ? (r = {
824
+ orgName: i,
825
+ projName: l,
826
+ agentName: a
827
+ }, e[0] = a, e[1] = i, e[2] = l, e[3] = r) : r = e[3];
828
+ let m;
829
+ e[4] !== o ? (m = {
830
+ environment: o
831
+ }, e[4] = o, e[5] = m) : m = e[5];
832
+ let d;
833
+ e[6] !== s ? (d = {
834
+ enabled: s
835
+ }, e[6] = s, e[7] = d) : d = e[7];
836
+ const {
837
+ data: h,
838
+ isLoading: f
839
+ } = cn(r, m, d);
840
+ let c;
841
+ e[8] !== a || e[9] !== i || e[10] !== l ? (c = {
842
+ orgName: i,
843
+ projName: l,
844
+ agentName: a
845
+ }, e[8] = a, e[9] = i, e[10] = l, e[11] = c) : c = e[11];
846
+ let u;
847
+ e[12] !== o ? (u = {
848
+ environment: o
849
+ }, e[12] = o, e[13] = u) : u = e[13];
850
+ let p;
851
+ e[14] !== s ? (p = {
852
+ enabled: s
853
+ }, e[14] = s, e[15] = p) : p = e[15];
854
+ const {
855
+ data: y,
856
+ isLoading: x
857
+ } = dn(c, u, p);
858
+ let b;
859
+ e[16] !== h?.roles ? (b = h?.roles ?? [], e[16] = h?.roles, e[17] = b) : b = e[17];
860
+ let v;
861
+ e[18] !== y?.groups ? (v = y?.groups ?? [], e[18] = y?.groups, e[19] = v) : v = e[19];
862
+ const S = f || x;
863
+ let w;
864
+ return e[20] !== b || e[21] !== v || e[22] !== S ? (w = {
865
+ roles: b,
866
+ groups: v,
867
+ isLoading: S
868
+ }, e[20] = b, e[21] = v, e[22] = S, e[23] = w) : w = e[23], w;
869
+ }
870
+ const Kt = (t) => {
871
+ const e = K(4), {
872
+ roles: i,
873
+ groups: l,
874
+ isLoading: a
875
+ } = t;
876
+ let o;
877
+ return e[0] !== l || e[1] !== a || e[2] !== i ? (o = a ? /* @__PURE__ */ g(X, { spacing: 1.5, children: [
878
+ /* @__PURE__ */ n(U, { variant: "rounded", height: 32 }),
879
+ /* @__PURE__ */ n(U, { variant: "rounded", height: 32 })
880
+ ] }) : /* @__PURE__ */ g(X, { spacing: 1.5, children: [
881
+ /* @__PURE__ */ n(St, { label: "Roles", items: i, emptyText: "No roles assigned." }),
882
+ /* @__PURE__ */ n(St, { label: "Groups", items: l, emptyText: "Not a member of any groups." })
883
+ ] }), e[0] = l, e[1] = a, e[2] = i, e[3] = o) : o = e[3], o;
884
+ }, ai = (t) => {
885
+ const e = K(19), {
886
+ orgId: i,
887
+ projectId: l,
888
+ agentId: a,
889
+ envId: o
890
+ } = t;
891
+ let s;
892
+ e[0] !== a || e[1] !== o || e[2] !== i || e[3] !== l ? (s = {
893
+ orgId: i,
894
+ projectId: l,
895
+ agentId: a,
896
+ envId: o
897
+ }, e[0] = a, e[1] = o, e[2] = i, e[3] = l, e[4] = s) : s = e[4];
898
+ const {
899
+ provisioned: r,
900
+ isLoading: m
901
+ } = ft(s);
902
+ let d;
903
+ e[5] !== a || e[6] !== o || e[7] !== i || e[8] !== l || e[9] !== r ? (d = {
904
+ orgId: i,
905
+ projectId: l,
906
+ agentId: a,
907
+ envId: o,
908
+ enabled: r
909
+ }, e[5] = a, e[6] = o, e[7] = i, e[8] = l, e[9] = r, e[10] = d) : d = e[10];
910
+ const {
911
+ roles: h,
912
+ groups: f,
913
+ isLoading: c
914
+ } = Ht(d);
915
+ if (m) {
916
+ let b;
917
+ return e[11] === Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ n(U, { variant: "rounded", height: 56, sx: {
918
+ mt: 2
919
+ } }), e[11] = b) : b = e[11], b;
920
+ }
921
+ if (!r)
922
+ return null;
923
+ let u;
924
+ e[12] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ n(J, { sx: {
925
+ mt: 2,
926
+ mb: 1
927
+ } }), e[12] = u) : u = e[12];
928
+ let p;
929
+ e[13] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ n(A, { variant: "caption", color: "text.secondary", fontWeight: 600, sx: {
930
+ textTransform: "uppercase",
931
+ letterSpacing: "0.05em"
932
+ }, children: "Agent Identity" }), e[13] = p) : p = e[13];
933
+ let y;
934
+ e[14] === Symbol.for("react.memo_cache_sentinel") ? (y = {
935
+ mt: 1
936
+ }, e[14] = y) : y = e[14];
937
+ let x;
938
+ return e[15] !== f || e[16] !== c || e[17] !== h ? (x = /* @__PURE__ */ g(te, { children: [
939
+ u,
940
+ p,
941
+ /* @__PURE__ */ n(N, { sx: y, children: /* @__PURE__ */ n(Kt, { roles: h, groups: f, isLoading: c }) })
942
+ ] }), e[15] = f, e[16] = c, e[17] = h, e[18] = x) : x = e[18], x;
943
+ };
944
+ function ri(t) {
945
+ return /* @__PURE__ */ n(Me, { label: t.name, size: "small" }, t.id);
946
+ }
947
+ const qe = {
948
+ "& .MuiInputBase-input": {
949
+ fontFamily: "monospace"
950
+ }
951
+ };
952
+ function Vt(t, e, i) {
953
+ const [l, a] = Q(null), {
954
+ mutateAsync: o
955
+ } = mn();
956
+ return {
957
+ regeneratingEnv: l,
958
+ regenerate: async (r, m) => {
959
+ if (!(!t || !e || !i)) {
960
+ a(r);
961
+ try {
962
+ const d = await o({
963
+ params: {
964
+ orgName: t,
965
+ projName: e,
966
+ agentName: i
967
+ },
968
+ body: {
969
+ environment: r
970
+ }
971
+ });
972
+ m?.({
973
+ clientId: d.clientId,
974
+ clientSecret: d.clientSecret
975
+ });
976
+ } catch {
977
+ } finally {
978
+ a((d) => d === r ? null : d);
979
+ }
980
+ }
981
+ }
982
+ };
983
+ }
984
+ const qt = (t) => {
985
+ const e = K(16), {
986
+ clientId: i,
987
+ clientSecret: l,
988
+ message: a
989
+ } = t;
990
+ let o, s;
991
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ n(Mn, { size: 18 }), s = {
992
+ width: "100%"
993
+ }, e[0] = o, e[1] = s) : (o = e[0], s = e[1]);
994
+ let r;
995
+ e[2] !== a ? (r = /* @__PURE__ */ n(A, { variant: "body2", fontWeight: 600, children: a }), e[2] = a, e[3] = r) : r = e[3];
996
+ let m;
997
+ e[4] === Symbol.for("react.memo_cache_sentinel") ? (m = {
998
+ input: {
999
+ readOnly: !0
1000
+ }
1001
+ }, e[4] = m) : m = e[4];
1002
+ let d;
1003
+ e[5] !== i ? (d = /* @__PURE__ */ n(Ee, { slotProps: m, label: "Client ID", value: i, copyable: !0, fullWidth: !0, sx: qe }), e[5] = i, e[6] = d) : d = e[6];
1004
+ let h;
1005
+ e[7] === Symbol.for("react.memo_cache_sentinel") ? (h = {
1006
+ input: {
1007
+ readOnly: !0
1008
+ }
1009
+ }, e[7] = h) : h = e[7];
1010
+ let f;
1011
+ e[8] !== l ? (f = /* @__PURE__ */ n(Ee, { slotProps: h, label: "Client Secret", value: l, copyable: !0, fullWidth: !0, sx: qe }), e[8] = l, e[9] = f) : f = e[9];
1012
+ let c;
1013
+ e[10] !== d || e[11] !== f ? (c = /* @__PURE__ */ g(X, { spacing: 1, mt: 1, width: "100%", children: [
1014
+ d,
1015
+ f
1016
+ ] }), e[10] = d, e[11] = f, e[12] = c) : c = e[12];
1017
+ let u;
1018
+ return e[13] !== r || e[14] !== c ? (u = /* @__PURE__ */ g(jt, { severity: "warning", icon: o, sx: s, children: [
1019
+ r,
1020
+ c
1021
+ ] }), e[13] = r, e[14] = c, e[15] = u) : u = e[15], u;
1022
+ }, Xt = (t) => {
1023
+ const e = K(10), {
1024
+ orgId: i,
1025
+ projectId: l,
1026
+ agentId: a,
1027
+ envId: o,
1028
+ isRegenerating: s,
1029
+ onRegenerate: r
1030
+ } = t;
1031
+ let m;
1032
+ e[0] !== a || e[1] !== o || e[2] !== i || e[3] !== l ? (m = {
1033
+ orgId: i,
1034
+ projectId: l,
1035
+ agentId: a,
1036
+ envId: o
1037
+ }, e[0] = a, e[1] = o, e[2] = i, e[3] = l, e[4] = m) : m = e[4];
1038
+ const {
1039
+ provisioned: d
1040
+ } = ft(m);
1041
+ if (!d)
1042
+ return null;
1043
+ let h;
1044
+ e[5] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ n(Gn, { size: 16 }), e[5] = h) : h = e[5];
1045
+ const f = s ? "Regenerating..." : "Regenerate ID";
1046
+ let c;
1047
+ return e[6] !== s || e[7] !== r || e[8] !== f ? (c = /* @__PURE__ */ n(Z, { variant: "text", size: "small", startIcon: h, onClick: r, disabled: s, children: f }), e[6] = s, e[7] = r, e[8] = f, e[9] = c) : c = e[9], c;
1048
+ }, wt = (t) => {
1049
+ const e = K(8), {
1050
+ left: i,
1051
+ rolesAndGroups: l
1052
+ } = t;
1053
+ let a;
1054
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = {
1055
+ xs: "column",
1056
+ md: "row"
1057
+ }, e[0] = a) : a = e[0];
1058
+ let o;
1059
+ e[1] !== i ? (o = /* @__PURE__ */ n(N, { flex: 1, children: i }), e[1] = i, e[2] = o) : o = e[2];
1060
+ let s;
1061
+ e[3] !== l ? (s = /* @__PURE__ */ n(N, { flex: 1, children: /* @__PURE__ */ n(Kt, { ...l }) }), e[3] = l, e[4] = s) : s = e[4];
1062
+ let r;
1063
+ return e[5] !== o || e[6] !== s ? (r = /* @__PURE__ */ g(X, { direction: a, spacing: 3, children: [
1064
+ o,
1065
+ s
1066
+ ] }), e[5] = o, e[6] = s, e[7] = r) : r = e[7], r;
1067
+ }, oi = (t) => {
1068
+ const e = K(33), {
1069
+ orgId: i,
1070
+ projectId: l,
1071
+ agentId: a,
1072
+ envId: o
1073
+ } = t;
1074
+ let s;
1075
+ e[0] !== a || e[1] !== o || e[2] !== i || e[3] !== l ? (s = {
1076
+ orgId: i,
1077
+ projectId: l,
1078
+ agentId: a,
1079
+ envId: o
1080
+ }, e[0] = a, e[1] = o, e[2] = i, e[3] = l, e[4] = s) : s = e[4];
1081
+ const {
1082
+ binding: r,
1083
+ provisioned: m,
1084
+ isLoading: d
1085
+ } = ft(s), {
1086
+ mutateAsync: h,
1087
+ isPending: f
1088
+ } = hn(), [c, u] = Q(null), p = m && !r?.hasUnclaimedSecret, y = p && !r?.clientId, x = m && !c && !y;
1089
+ let b;
1090
+ e[5] !== a || e[6] !== o || e[7] !== i || e[8] !== l || e[9] !== x ? (b = {
1091
+ orgId: i,
1092
+ projectId: l,
1093
+ agentId: a,
1094
+ envId: o,
1095
+ enabled: x
1096
+ }, e[5] = a, e[6] = o, e[7] = i, e[8] = l, e[9] = x, e[10] = b) : b = e[10];
1097
+ const v = Ht(b);
1098
+ let S;
1099
+ e[11] !== a || e[12] !== h || e[13] !== o || e[14] !== i || e[15] !== l ? (S = async () => {
1100
+ try {
1101
+ const _ = await h({
1102
+ params: {
1103
+ orgName: i,
1104
+ projName: l,
1105
+ agentName: a
1106
+ },
1107
+ query: {
1108
+ environment: o
1109
+ }
1110
+ });
1111
+ u({
1112
+ clientId: _.clientId,
1113
+ clientSecret: _.clientSecret
1114
+ });
1115
+ } catch {
1116
+ }
1117
+ }, e[11] = a, e[12] = h, e[13] = o, e[14] = i, e[15] = l, e[16] = S) : S = e[16];
1118
+ const w = S;
1119
+ if (d) {
1120
+ let _;
1121
+ return e[17] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ n(U, { variant: "rounded", height: 56, sx: {
1122
+ mt: 2
1123
+ } }), e[17] = _) : _ = e[17], _;
1124
+ }
1125
+ if (!r || r.provisioningType !== "external")
1126
+ return null;
1127
+ if (c) {
1128
+ let _;
1129
+ e[18] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ n(J, { sx: {
1130
+ mb: 1
1131
+ } }), e[18] = _) : _ = e[18];
1132
+ let C;
1133
+ return e[19] !== c.clientId || e[20] !== c.clientSecret ? (C = /* @__PURE__ */ g(te, { children: [
1134
+ _,
1135
+ /* @__PURE__ */ n(qt, { clientId: c.clientId, clientSecret: c.clientSecret, message: "This secret will not be shown again — save it securely now." })
1136
+ ] }), e[19] = c.clientId, e[20] = c.clientSecret, e[21] = C) : C = e[21], C;
1137
+ }
1138
+ if (y)
1139
+ return null;
1140
+ let j;
1141
+ e[22] === Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ n(J, { sx: {
1142
+ mb: 1
1143
+ } }), e[22] = j) : j = e[22];
1144
+ let P;
1145
+ e[23] === Symbol.for("react.memo_cache_sentinel") ? (P = /* @__PURE__ */ n(A, { variant: "caption", color: "text.secondary", fontWeight: 600, sx: {
1146
+ textTransform: "uppercase",
1147
+ letterSpacing: "0.05em"
1148
+ }, children: "Agent Identity" }), e[23] = P) : P = e[23];
1149
+ let k;
1150
+ e[24] === Symbol.for("react.memo_cache_sentinel") ? (k = {
1151
+ mt: 1
1152
+ }, e[24] = k) : k = e[24];
1153
+ let D;
1154
+ return e[25] !== p || e[26] !== r.clientId || e[27] !== r.hasUnclaimedSecret || e[28] !== r.status || e[29] !== w || e[30] !== f || e[31] !== v ? (D = /* @__PURE__ */ g(te, { children: [
1155
+ j,
1156
+ P,
1157
+ /* @__PURE__ */ n(N, { sx: k, children: r.hasUnclaimedSecret ? /* @__PURE__ */ n(wt, { rolesAndGroups: v, left: /* @__PURE__ */ g(X, { spacing: 1.5, children: [
1158
+ r.clientId && /* @__PURE__ */ n(Ee, { slotProps: {
1159
+ input: {
1160
+ readOnly: !0
1161
+ }
1162
+ }, label: "Client ID", value: r.clientId, copyable: !0, fullWidth: !0, sx: qe }),
1163
+ /* @__PURE__ */ g(X, { direction: "row", alignItems: "center", gap: 1.5, children: [
1164
+ /* @__PURE__ */ n(A, { variant: "body2", color: "text.secondary", children: "This agent's identity secret hasn't been claimed yet." }),
1165
+ /* @__PURE__ */ n(Z, { variant: "outlined", size: "small", onClick: () => void w(), disabled: f, children: f ? "Claiming..." : "Reveal Secret" })
1166
+ ] })
1167
+ ] }) }) : p ? /* @__PURE__ */ n(wt, { rolesAndGroups: v, left: /* @__PURE__ */ n(Ee, { slotProps: {
1168
+ input: {
1169
+ readOnly: !0
1170
+ }
1171
+ }, label: "Client ID", value: r.clientId, copyable: !0, fullWidth: !0, sx: qe }) }) : r.status === "failed" ? /* @__PURE__ */ n(A, { variant: "body2", color: "text.secondary", children: "Provisioning failed — check the identity settings for details." }) : /* @__PURE__ */ g(X, { direction: "row", alignItems: "center", gap: 1, children: [
1172
+ /* @__PURE__ */ n(Xe, { size: 14 }),
1173
+ /* @__PURE__ */ n(A, { variant: "body2", color: "text.secondary", children: "Provisioning in progress…" })
1174
+ ] }) })
1175
+ ] }), e[25] = p, e[26] = r.clientId, e[27] = r.hasUnclaimedSecret, e[28] = r.status, e[29] = w, e[30] = f, e[31] = v, e[32] = D) : D = e[32], D;
1176
+ }, si = () => {
1177
+ const t = K(34), {
1178
+ orgId: e,
1179
+ agentId: i,
1180
+ projectId: l
1181
+ } = ve();
1182
+ let a;
1183
+ t[0] !== i || t[1] !== e || t[2] !== l ? (a = {
1184
+ orgName: e,
1185
+ projName: l,
1186
+ agentName: i
1187
+ }, t[0] = i, t[1] = e, t[2] = l, t[3] = a) : a = t[3];
1188
+ const {
1189
+ data: o
1190
+ } = at(a);
1191
+ let s;
1192
+ t[4] !== i || t[5] !== e || t[6] !== l ? (s = {
1193
+ orgName: e,
1194
+ projName: l,
1195
+ agentName: i
1196
+ }, t[4] = i, t[5] = e, t[6] = l, t[7] = s) : s = t[7];
1197
+ const {
1198
+ data: r,
1199
+ isLoading: m
1200
+ } = pn(s), d = fn(e, l), h = !!o?.kindName, {
1201
+ regeneratingEnv: f,
1202
+ regenerate: c
1203
+ } = Vt(e, l, i);
1204
+ let u;
1205
+ t[8] !== o || t[9] !== i || t[10] !== r?.builds || t[11] !== m || t[12] !== h || t[13] !== e || t[14] !== l ? (u = h ? /* @__PURE__ */ n(Vn, { orgId: e ?? "", kindName: o.kindName, framework: o?.agentType?.type, model: o?.agentType?.subType }) : e && l && i && /* @__PURE__ */ n(ii, { orgId: e, projectId: l, agentId: i, repository: o?.provisioning?.repository, latestBuild: r?.builds[0], isBuildsLoading: m, framework: o?.agentType?.type, model: o?.agentType?.subType, build: o?.build }), t[8] = o, t[9] = i, t[10] = r?.builds, t[11] = m, t[12] = h, t[13] = e, t[14] = l, t[15] = u) : u = t[15];
1206
+ let p;
1207
+ if (t[16] !== i || t[17] !== c || t[18] !== e || t[19] !== l || t[20] !== f || t[21] !== d) {
1208
+ let b;
1209
+ t[23] !== i || t[24] !== c || t[25] !== e || t[26] !== l || t[27] !== f ? (b = (v, S) => v && e && l && i && /* @__PURE__ */ n(Rt, { orgId: e, projectId: l, agentId: i, environment: v, isFirstEnvironment: S === 0, actions: /* @__PURE__ */ n(Xt, { orgId: e, projectId: l, agentId: i, envId: v.name, isRegenerating: f === v.name, onRegenerate: () => void c(v.name) }), bottomContent: /* @__PURE__ */ g(te, { children: [
1210
+ /* @__PURE__ */ n(ai, { orgId: e, projectId: l, agentId: i, envId: v.name }),
1211
+ /* @__PURE__ */ n(Ut, { orgId: e, projectId: l, agentId: i, envId: v.name }),
1212
+ /* @__PURE__ */ n(Ft, { orgId: e, projectId: l, agentId: i, envId: v.name })
1213
+ ] }) }, v.name), t[23] = i, t[24] = c, t[25] = e, t[26] = l, t[27] = f, t[28] = b) : b = t[28], p = d.map(b), t[16] = i, t[17] = c, t[18] = e, t[19] = l, t[20] = f, t[21] = d, t[22] = p;
1214
+ } else
1215
+ p = t[22];
1216
+ let y;
1217
+ t[29] !== p ? (y = /* @__PURE__ */ n(X, { spacing: 2, children: p }), t[29] = p, t[30] = y) : y = t[30];
1218
+ let x;
1219
+ return t[31] !== u || t[32] !== y ? (x = /* @__PURE__ */ g(N, { display: "flex", flexDirection: "column", gap: 2, children: [
1220
+ u,
1221
+ y
1222
+ ] }), t[31] = u, t[32] = y, t[33] = x) : x = t[33], x;
1223
+ }, Se = (t) => {
1224
+ const e = K(18), {
1225
+ stepNumber: i,
1226
+ title: l,
1227
+ description: a,
1228
+ code: o,
1229
+ language: s,
1230
+ fieldId: r
1231
+ } = t, m = s === void 0 ? "bash" : s;
1232
+ let d;
1233
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (d = {
1234
+ gap: 2,
1235
+ width: 20,
1236
+ height: 20,
1237
+ borderRadius: "50%",
1238
+ display: "flex",
1239
+ alignItems: "center",
1240
+ justifyContent: "center",
1241
+ bgcolor: ci,
1242
+ color: "primary.contrastText",
1243
+ fontWeight: 600
1244
+ }, e[0] = d) : d = e[0];
1245
+ let h;
1246
+ e[1] !== i ? (h = /* @__PURE__ */ n(N, { sx: d, children: /* @__PURE__ */ n(A, { variant: "body2", fontWeight: 600, children: i }) }), e[1] = i, e[2] = h) : h = e[2];
1247
+ let f;
1248
+ e[3] !== l ? (f = /* @__PURE__ */ n(A, { variant: "body1", children: l }), e[3] = l, e[4] = f) : f = e[4];
1249
+ let c;
1250
+ e[5] !== h || e[6] !== f ? (c = /* @__PURE__ */ g(N, { display: "flex", alignItems: "center", gap: 1, children: [
1251
+ h,
1252
+ f
1253
+ ] }), e[5] = h, e[6] = f, e[7] = c) : c = e[7];
1254
+ let u;
1255
+ e[8] !== o || e[9] !== r || e[10] !== m ? (u = /* @__PURE__ */ n(N, { children: /* @__PURE__ */ n(Mt, { code: o, language: m, fieldId: r }) }), e[8] = o, e[9] = r, e[10] = m, e[11] = u) : u = e[11];
1256
+ let p;
1257
+ e[12] !== a ? (p = a && /* @__PURE__ */ n(A, { variant: "body2", color: "textSecondary", children: a }), e[12] = a, e[13] = p) : p = e[13];
1258
+ let y;
1259
+ return e[14] !== c || e[15] !== u || e[16] !== p ? (y = /* @__PURE__ */ g(N, { display: "flex", gap: 1, flexDirection: "column", children: [
1260
+ c,
1261
+ u,
1262
+ p
1263
+ ] }), e[14] = c, e[15] = u, e[16] = p, e[17] = y) : y = e[17], y;
1264
+ };
1265
+ function ci(t) {
1266
+ return t.palette.primary.main;
1267
+ }
1268
+ const di = [{
1269
+ label: "30 days",
1270
+ value: "720h"
1271
+ }, {
1272
+ label: "90 days",
1273
+ value: "2160h"
1274
+ }, {
1275
+ label: "6 months",
1276
+ value: "4320h"
1277
+ }, {
1278
+ label: "1 year",
1279
+ value: "8760h"
1280
+ }, {
1281
+ label: "2 years",
1282
+ value: "17520h"
1283
+ }], Nt = (t) => {
1284
+ const e = K(55), {
1285
+ stepNumber: i,
1286
+ orgName: l,
1287
+ projName: a,
1288
+ agentName: o,
1289
+ environment: s,
1290
+ onTokenGenerated: r
1291
+ } = t, [m, d] = Q("8760h");
1292
+ let h;
1293
+ e[0] !== o || e[1] !== l || e[2] !== a ? (h = {
1294
+ agentName: o,
1295
+ projName: a,
1296
+ orgName: l
1297
+ }, e[0] = o, e[1] = l, e[2] = a, e[3] = h) : h = e[3];
1298
+ let f;
1299
+ e[4] !== m ? (f = {
1300
+ expires_in: m
1301
+ }, e[4] = m, e[5] = f) : f = e[5];
1302
+ let c;
1303
+ e[6] !== s ? (c = s ? {
1304
+ environment: s
1305
+ } : void 0, e[6] = s, e[7] = c) : c = e[7];
1306
+ const {
1307
+ data: u,
1308
+ isFetching: p,
1309
+ error: y,
1310
+ refetch: x
1311
+ } = un(h, f, c);
1312
+ let b;
1313
+ e[8] !== u || e[9] !== r ? (b = () => {
1314
+ u?.token && r(u.token);
1315
+ }, e[8] = u, e[9] = r, e[10] = b) : b = e[10];
1316
+ const v = u?.token;
1317
+ let S;
1318
+ e[11] !== r || e[12] !== v ? (S = [v, r], e[11] = r, e[12] = v, e[13] = S) : S = e[13], Ne(b, S);
1319
+ const j = `${u?.token || "ey***"}`;
1320
+ let P;
1321
+ e[14] === Symbol.for("react.memo_cache_sentinel") ? (P = {
1322
+ gap: 2,
1323
+ width: 20,
1324
+ height: 20,
1325
+ borderRadius: "50%",
1326
+ display: "flex",
1327
+ alignItems: "center",
1328
+ justifyContent: "center",
1329
+ bgcolor: mi,
1330
+ color: "primary.contrastText",
1331
+ fontWeight: 600
1332
+ }, e[14] = P) : P = e[14];
1333
+ let k;
1334
+ e[15] !== i ? (k = /* @__PURE__ */ n(N, { sx: P, children: /* @__PURE__ */ n(A, { variant: "body2", fontWeight: 600, children: i }) }), e[15] = i, e[16] = k) : k = e[16];
1335
+ let D;
1336
+ e[17] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ n(A, { variant: "body1", children: "Generate API Key" }), e[17] = D) : D = e[17];
1337
+ let _;
1338
+ e[18] !== k ? (_ = /* @__PURE__ */ g(N, { display: "flex", alignItems: "center", gap: 1, children: [
1339
+ k,
1340
+ D
1341
+ ] }), e[18] = k, e[19] = _) : _ = e[19];
1342
+ let C;
1343
+ e[20] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ n(A, { variant: "body2", color: "textSecondary", children: "Token Duration" }), e[20] = C) : C = e[20];
1344
+ let L;
1345
+ e[21] === Symbol.for("react.memo_cache_sentinel") ? (L = (ee) => d(ee.target.value), e[21] = L) : L = e[21];
1346
+ let $, E;
1347
+ e[22] === Symbol.for("react.memo_cache_sentinel") ? ($ = {
1348
+ minWidth: 100
1349
+ }, E = di.map(hi), e[22] = $, e[23] = E) : ($ = e[22], E = e[23]);
1350
+ let R;
1351
+ e[24] !== m || e[25] !== p ? (R = /* @__PURE__ */ n(ht, { value: m, onChange: L, size: "small", disabled: p, sx: $, children: E }), e[24] = m, e[25] = p, e[26] = R) : R = e[26];
1352
+ let W;
1353
+ e[27] !== x ? (W = () => x(), e[27] = x, e[28] = W) : W = e[28];
1354
+ let M;
1355
+ e[29] !== p ? (M = p ? /* @__PURE__ */ n(Xe, { size: 16 }) : void 0, e[29] = p, e[30] = M) : M = e[30];
1356
+ const B = p ? "Generating..." : u?.token ? "Generated" : "Generate";
1357
+ let G;
1358
+ e[31] !== p || e[32] !== W || e[33] !== M || e[34] !== B ? (G = /* @__PURE__ */ n(Z, { variant: "contained", onClick: W, disabled: p, startIcon: M, size: "small", children: B }), e[31] = p, e[32] = W, e[33] = M, e[34] = B, e[35] = G) : G = e[35];
1359
+ let H;
1360
+ e[36] !== R || e[37] !== G ? (H = /* @__PURE__ */ g(N, { display: "flex", gap: 1, alignItems: "center", children: [
1361
+ C,
1362
+ R,
1363
+ G
1364
+ ] }), e[36] = R, e[37] = G, e[38] = H) : H = e[38];
1365
+ let F;
1366
+ e[39] !== _ || e[40] !== H ? (F = /* @__PURE__ */ g(N, { display: "flex", alignItems: "center", gap: 1, justifyContent: "space-between", children: [
1367
+ _,
1368
+ H
1369
+ ] }), e[39] = _, e[40] = H, e[41] = F) : F = e[41];
1370
+ let T;
1371
+ e[42] !== y ? (T = y ? /* @__PURE__ */ n(A, { variant: "body2", color: "error", children: "Failed to generate token. Please try again." }) : null, e[42] = y, e[43] = T) : T = e[43];
1372
+ let O;
1373
+ e[44] !== j ? (O = /* @__PURE__ */ n(Mt, { code: j, language: "bash", fieldId: "api-key" }), e[44] = j, e[45] = O) : O = e[45];
1374
+ const I = u?.token ? "Token generated successfully. Copy it now as you won't be able to see it again." : "Generate a token to authenticate your traces.";
1375
+ let z;
1376
+ e[46] !== I ? (z = /* @__PURE__ */ n(A, { variant: "body2", color: "textSecondary", children: I }), e[46] = I, e[47] = z) : z = e[47];
1377
+ let V;
1378
+ e[48] !== T || e[49] !== O || e[50] !== z ? (V = /* @__PURE__ */ g(N, { display: "flex", flexDirection: "column", gap: 1, children: [
1379
+ T,
1380
+ O,
1381
+ z
1382
+ ] }), e[48] = T, e[49] = O, e[50] = z, e[51] = V) : V = e[51];
1383
+ let q;
1384
+ return e[52] !== F || e[53] !== V ? (q = /* @__PURE__ */ g(N, { display: "flex", gap: 1, flexDirection: "column", children: [
1385
+ F,
1386
+ V
1387
+ ] }), e[52] = F, e[53] = V, e[54] = q) : q = e[54], q;
1388
+ };
1389
+ function mi(t) {
1390
+ return t.palette.primary.main;
1391
+ }
1392
+ function hi(t) {
1393
+ return /* @__PURE__ */ n(xe, { value: t.value, children: t.label }, t.value);
1394
+ }
1395
+ const pi = (t) => {
1396
+ const e = K(27), {
1397
+ open: i,
1398
+ onClose: l,
1399
+ orgName: a,
1400
+ projName: o,
1401
+ agentName: s,
1402
+ environment: r,
1403
+ instrumentationUrl: m,
1404
+ apiKey: d
1405
+ } = t, [h, f] = Q(null), [c, u] = Q("python"), p = h || d;
1406
+ let y;
1407
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (y = ($) => {
1408
+ u($.target.value);
1409
+ }, e[0] = y) : y = e[0];
1410
+ const x = y;
1411
+ let b;
1412
+ e[1] === Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ n(zt, { size: 24 }), e[1] = b) : b = e[1];
1413
+ let v;
1414
+ e[2] !== l ? (v = /* @__PURE__ */ n(rt, { icon: b, title: "Setup Agent", onClose: l }), e[2] = l, e[3] = v) : v = e[3];
1415
+ let S;
1416
+ e[4] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ n(A, { variant: "h5", children: "Zero-code Instrumentation Guide" }), e[4] = S) : S = e[4];
1417
+ let w;
1418
+ e[5] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ n(A, { variant: "body2", children: "Language:" }), e[5] = w) : w = e[5];
1419
+ let j, P;
1420
+ e[6] === Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ n(xe, { value: "python", children: "Python" }), P = /* @__PURE__ */ n(xe, { value: "ballerina", children: "Ballerina" }), e[6] = j, e[7] = P) : (j = e[6], P = e[7]);
1421
+ let k;
1422
+ e[8] !== c ? (k = /* @__PURE__ */ g(X, { direction: "row", justifyContent: "space-between", alignItems: "center", children: [
1423
+ S,
1424
+ /* @__PURE__ */ g(X, { direction: "row", alignItems: "center", gap: 1, children: [
1425
+ w,
1426
+ /* @__PURE__ */ g(ht, { value: c, onChange: x, children: [
1427
+ j,
1428
+ P
1429
+ ] })
1430
+ ] })
1431
+ ] }), e[8] = c, e[9] = k) : k = e[9];
1432
+ let D;
1433
+ e[10] === Symbol.for("react.memo_cache_sentinel") ? (D = {
1434
+ display: "flex",
1435
+ flexDirection: "column",
1436
+ gap: 2,
1437
+ pt: 1,
1438
+ width: "100%"
1439
+ }, e[10] = D) : D = e[10];
1440
+ let _;
1441
+ e[11] !== s || e[12] !== p || e[13] !== r || e[14] !== m || e[15] !== a || e[16] !== o || e[17] !== c ? (_ = /* @__PURE__ */ n(N, { sx: D, children: c === "python" ? /* @__PURE__ */ g(te, { children: [
1442
+ /* @__PURE__ */ n(Se, { stepNumber: 1, title: "Install AMP Instrumentation Package", code: "pip install amp-instrumentation", language: "bash", fieldId: "install", description: "Provides the ability to instrument your agent and export traces." }),
1443
+ /* @__PURE__ */ n(Nt, { stepNumber: 2, orgName: a, projName: o, agentName: s, environment: r, onTokenGenerated: f }),
1444
+ /* @__PURE__ */ n(Se, { stepNumber: 3, title: "Set environment variables", code: `export AMP_OTEL_ENDPOINT="${m}"
1445
+ export AMP_AGENT_API_KEY="${p}"`, language: "bash", fieldId: "env", description: "Sets the agent endpoint and agent-specific API key so traces can be exported securely." }),
1446
+ /* @__PURE__ */ n(Se, { stepNumber: 4, title: "Run Agent with Instrumentation Enabled", code: "amp-instrument <run_command>", language: "bash", fieldId: "run", description: "Replace <run_command> with your agent's start command. For example: amp-instrument python app.py" })
1447
+ ] }) : /* @__PURE__ */ g(te, { children: [
1448
+ /* @__PURE__ */ n(Se, { stepNumber: 1, title: "Import Amp Module", code: "import ballerinax/amp as _;", language: "ballerina", fieldId: "import", description: "Add the import to your Ballerina program." }),
1449
+ /* @__PURE__ */ n(Se, { stepNumber: 2, title: "Add the following configuration to Ballerina.toml", code: `[build-options]
1450
+ observabilityIncluded = true`, language: "toml", fieldId: "ballerina-toml", description: "Ensure the following configuration is present when building the program." }),
1451
+ /* @__PURE__ */ n(Se, { stepNumber: 3, title: "Update Config.toml", code: `[ballerina.observe]
1452
+ tracingEnabled = true
1453
+ tracingProvider = "amp"`, language: "toml", fieldId: "config-toml", description: "Enable tracing and set the provider to Amp." }),
1454
+ /* @__PURE__ */ n(Nt, { stepNumber: 4, orgName: a, projName: o, agentName: s, environment: r, onTokenGenerated: f }),
1455
+ /* @__PURE__ */ n(Se, { stepNumber: 5, title: "Set Environment Variables", code: `export BAL_CONFIG_VAR_BALLERINAX_AMP_OTELENDPOINT="${m}"
1456
+ export BAL_CONFIG_VAR_BALLERINAX_AMP_APIKEY="${p}"`, language: "bash", fieldId: "env-vars", description: "Configure the exporter using environment variables." })
1457
+ ] }) }), e[11] = s, e[12] = p, e[13] = r, e[14] = m, e[15] = a, e[16] = o, e[17] = c, e[18] = _) : _ = e[18];
1458
+ let C;
1459
+ e[19] !== _ || e[20] !== k ? (C = /* @__PURE__ */ g(ot, { children: [
1460
+ k,
1461
+ _
1462
+ ] }), e[19] = _, e[20] = k, e[21] = C) : C = e[21];
1463
+ let L;
1464
+ return e[22] !== l || e[23] !== i || e[24] !== C || e[25] !== v ? (L = /* @__PURE__ */ g(st, { open: i, onClose: l, maxWidth: 700, children: [
1465
+ v,
1466
+ C
1467
+ ] }), e[22] = l, e[23] = i, e[24] = C, e[25] = v, e[26] = L) : L = e[26], L;
1468
+ }, fi = () => {
1469
+ const t = K(47), {
1470
+ agentId: e,
1471
+ orgId: i,
1472
+ projectId: l
1473
+ } = ve(), [a, o] = Ln(), [s, r] = Q("");
1474
+ let m;
1475
+ t[0] !== e || t[1] !== i || t[2] !== l ? (m = {
1476
+ orgName: i,
1477
+ projName: l,
1478
+ agentName: e
1479
+ }, t[0] = e, t[1] = i, t[2] = l, t[3] = m) : m = t[3];
1480
+ const {
1481
+ data: d
1482
+ } = at(m), {
1483
+ environments: h,
1484
+ isLoading: f
1485
+ } = gn(i, l), c = i ?? "";
1486
+ let u;
1487
+ t[4] !== c ? (u = {
1488
+ orgName: c
1489
+ }, t[4] = c, t[5] = u) : u = t[5];
1490
+ let p;
1491
+ t[6] !== s ? (p = {
1492
+ environment: s
1493
+ }, t[6] = s, t[7] = p) : p = t[7];
1494
+ const {
1495
+ data: y
1496
+ } = yn(u, p), x = y?.gateways?.[0]?.vhost, b = x ? `${x.replace(/\/$/, "")}/otel` : bn.instrumentationUrl || "http://default-default.gateway.localhost:19080/otel";
1497
+ let v;
1498
+ t[8] !== o ? (v = (z) => {
1499
+ r(z), o({
1500
+ setup: "true"
1501
+ });
1502
+ }, t[8] = o, t[9] = v) : v = t[9];
1503
+ const S = v;
1504
+ let w;
1505
+ t[10] === Symbol.for("react.memo_cache_sentinel") ? (w = {}, t[10] = w) : w = t[10];
1506
+ const [j, P] = Q(w), {
1507
+ regeneratingEnv: k,
1508
+ regenerate: D
1509
+ } = Vt(i, l, e);
1510
+ let _;
1511
+ t[11] !== D ? (_ = (z) => D(z, (V) => P((q) => ({
1512
+ ...q,
1513
+ [z]: V
1514
+ }))), t[11] = D, t[12] = _) : _ = t[12];
1515
+ const C = _;
1516
+ let L, $;
1517
+ t[13] !== f || t[14] !== s || t[15] !== h ? (L = () => {
1518
+ !f && !s && r(h.length > 0 ? h[0].id ?? "" : "");
1519
+ }, $ = [h, f, s], t[13] = f, t[14] = s, t[15] = h, t[16] = L, t[17] = $) : (L = t[16], $ = t[17]), Ne(L, $);
1520
+ let E;
1521
+ t[18] !== e || t[19] !== C || t[20] !== S || t[21] !== f || t[22] !== i || t[23] !== l || t[24] !== j || t[25] !== k || t[26] !== h ? (E = /* @__PURE__ */ n(N, { display: "flex", flexDirection: "column", gap: 2, children: f ? /* @__PURE__ */ g(N, { display: "flex", flexDirection: "column", gap: 2, children: [
1522
+ /* @__PURE__ */ n(U, { variant: "rounded", height: 100 }),
1523
+ /* @__PURE__ */ n(U, { variant: "rounded", height: 100 })
1524
+ ] }) : h.length === 0 ? /* @__PURE__ */ n(lt, { message: "No environments found", subtitle: "Environments will appear here once they are created" }) : /* @__PURE__ */ n(X, { spacing: 2, children: h.map((z) => z && i && l && e && /* @__PURE__ */ n(Rt, { orgId: i, projectId: l, agentId: e, environment: z, actions: /* @__PURE__ */ g(te, { children: [
1525
+ /* @__PURE__ */ n(Xt, { orgId: i, projectId: l, agentId: e, envId: z.name, isRegenerating: k === z.name, onRegenerate: () => void C(z.name) }),
1526
+ /* @__PURE__ */ n(Z, { variant: "text", size: "small", startIcon: /* @__PURE__ */ n(zt, { size: 16 }), onClick: () => S(z.id ?? ""), children: "Setup Agent" })
1527
+ ] }), bottomContent: /* @__PURE__ */ g(te, { children: [
1528
+ j[z.name] ? /* @__PURE__ */ g(te, { children: [
1529
+ /* @__PURE__ */ n(J, { sx: {
1530
+ mb: 1
1531
+ } }),
1532
+ /* @__PURE__ */ n(qt, { clientId: j[z.name].clientId, clientSecret: j[z.name].clientSecret, message: "This is the new secret after regenerating — save it securely now." })
1533
+ ] }) : /* @__PURE__ */ n(oi, { orgId: i, projectId: l, agentId: e, envId: z.name }),
1534
+ /* @__PURE__ */ n(Ut, { orgId: i, projectId: l, agentId: e, envId: z.name, hideMetrics: !0, external: !0 }),
1535
+ /* @__PURE__ */ n(Ft, { orgId: i, projectId: l, agentId: e, envId: z.name })
1536
+ ] }) }, z.name)) }) }), t[18] = e, t[19] = C, t[20] = S, t[21] = f, t[22] = i, t[23] = l, t[24] = j, t[25] = k, t[26] = h, t[27] = E) : E = t[27];
1537
+ const R = a.get("setup") === "true" && s !== "";
1538
+ let W;
1539
+ t[28] !== o ? (W = () => o({}), t[28] = o, t[29] = W) : W = t[29];
1540
+ const M = e ?? "", B = i ?? "default", G = l ?? "default", H = e ?? "";
1541
+ let F;
1542
+ t[30] !== s || t[31] !== h ? (F = h?.find((z) => z.id === s)?.name, t[30] = s, t[31] = h, t[32] = F) : F = t[32];
1543
+ const T = d?.uuid;
1544
+ let O;
1545
+ t[33] !== b || t[34] !== s || t[35] !== R || t[36] !== W || t[37] !== M || t[38] !== B || t[39] !== G || t[40] !== H || t[41] !== F || t[42] !== T ? (O = /* @__PURE__ */ n(pi, { open: R, onClose: W, agentId: M, orgName: B, projName: G, agentName: H, environment: F, instrumentationUrl: b, componentUid: T, environmentUid: s }), t[33] = b, t[34] = s, t[35] = R, t[36] = W, t[37] = M, t[38] = B, t[39] = G, t[40] = H, t[41] = F, t[42] = T, t[43] = O) : O = t[43];
1546
+ let I;
1547
+ return t[44] !== O || t[45] !== E ? (I = /* @__PURE__ */ g(te, { children: [
1548
+ E,
1549
+ O
1550
+ ] }), t[44] = O, t[45] = E, t[46] = I) : I = t[46], I;
1551
+ }, ui = Bt({
1552
+ displayName: we().trim().min(1, "Display name is required").min(3, "Display name must be at least 3 characters").max(100, "Display name must be at most 100 characters"),
1553
+ name: we().trim().min(1, "Name is required").regex(/^[a-z0-9-]+$/, "Name must be lowercase letters, numbers, and hyphens only (no spaces)").min(3, "Name must be at least 3 characters").max(50, "Name must be at most 50 characters"),
1554
+ description: we().trim().optional()
1555
+ });
1556
+ function gi(t) {
1557
+ const e = K(79), {
1558
+ open: i,
1559
+ onClose: l,
1560
+ agent: a,
1561
+ orgId: o,
1562
+ projectId: s
1563
+ } = t, r = a.description || "";
1564
+ let m;
1565
+ e[0] !== a.displayName || e[1] !== a.name || e[2] !== r ? (m = {
1566
+ name: a.name,
1567
+ displayName: a.displayName,
1568
+ description: r
1569
+ }, e[0] = a.displayName, e[1] = a.name, e[2] = r, e[3] = m) : m = e[3];
1570
+ const [d, h] = Q(m);
1571
+ let f;
1572
+ e[4] !== a.labels ? (f = a.labels ?? {}, e[4] = a.labels, e[5] = f) : f = e[5];
1573
+ const [c, u] = Q(f), {
1574
+ errors: p,
1575
+ validateField: y,
1576
+ validateForm: x,
1577
+ clearErrors: b,
1578
+ setFieldError: v
1579
+ } = It(ui), {
1580
+ mutate: S,
1581
+ isPending: w
1582
+ } = xn();
1583
+ let j;
1584
+ e[6] !== a.description || e[7] !== a.displayName || e[8] !== a.labels || e[9] !== a.name || e[10] !== b || e[11] !== i ? (j = () => {
1585
+ i && (h({
1586
+ name: a.name,
1587
+ displayName: a.displayName,
1588
+ description: a.description || ""
1589
+ }), u(a.labels ?? {}), b());
1590
+ }, e[6] = a.description, e[7] = a.displayName, e[8] = a.labels, e[9] = a.name, e[10] = b, e[11] = i, e[12] = j) : j = e[12];
1591
+ let P;
1592
+ e[13] !== a || e[14] !== b || e[15] !== i ? (P = [a, i, b], e[13] = a, e[14] = b, e[15] = i, e[16] = P) : P = e[16], Ne(j, P);
1593
+ let k;
1594
+ e[17] !== v || e[18] !== y ? (k = (ne, ye) => {
1595
+ const Ge = y(ne, ye);
1596
+ v(ne, Ge), h((be) => ({
1597
+ ...be,
1598
+ [ne]: ye
1599
+ }));
1600
+ }, e[17] = v, e[18] = y, e[19] = k) : k = e[19];
1601
+ const D = k;
1602
+ let _;
1603
+ e[20] !== a.name || e[21] !== b || e[22] !== d || e[23] !== c || e[24] !== l || e[25] !== o || e[26] !== s || e[27] !== S || e[28] !== x ? (_ = (ne) => {
1604
+ if (ne.preventDefault(), !x(d))
1605
+ return;
1606
+ const ye = {
1607
+ displayName: d.displayName,
1608
+ description: d.description,
1609
+ labels: c
1610
+ };
1611
+ S({
1612
+ params: {
1613
+ orgName: o,
1614
+ projName: s,
1615
+ agentName: a.name
1616
+ },
1617
+ body: ye
1618
+ }, {
1619
+ onSuccess: () => {
1620
+ b(), l();
1621
+ }
1622
+ });
1623
+ }, e[20] = a.name, e[21] = b, e[22] = d, e[23] = c, e[24] = l, e[25] = o, e[26] = s, e[27] = S, e[28] = x, e[29] = _) : _ = e[29];
1624
+ const C = _, L = !p.displayName && !p.description && d.displayName.trim().length > 0;
1625
+ let $;
1626
+ e[30] === Symbol.for("react.memo_cache_sentinel") ? ($ = /* @__PURE__ */ n(Oe, { size: 24 }), e[30] = $) : $ = e[30];
1627
+ let E;
1628
+ e[31] !== l ? (E = /* @__PURE__ */ n(rt, { icon: $, title: "Edit Agent", onClose: l }), e[31] = l, e[32] = E) : E = e[32];
1629
+ let R, W;
1630
+ e[33] === Symbol.for("react.memo_cache_sentinel") ? (R = {
1631
+ gap: 1,
1632
+ display: "flex",
1633
+ flexDirection: "column"
1634
+ }, W = /* @__PURE__ */ n(A, { variant: "h5", children: "Agent Details" }), e[33] = R, e[34] = W) : (R = e[33], W = e[34]);
1635
+ let M;
1636
+ e[35] !== D ? (M = (ne) => D("displayName", ne.target.value), e[35] = D, e[36] = M) : M = e[36];
1637
+ const B = !!p.displayName;
1638
+ let G;
1639
+ e[37] !== p.displayName || e[38] !== d.displayName || e[39] !== w || e[40] !== M || e[41] !== B ? (G = /* @__PURE__ */ n(Ee, { placeholder: "e.g., Customer Support Agent", label: "Name", fullWidth: !0, size: "small", value: d.displayName, onChange: M, error: B, helperText: p.displayName, disabled: w }), e[37] = p.displayName, e[38] = d.displayName, e[39] = w, e[40] = M, e[41] = B, e[42] = G) : G = e[42];
1640
+ const H = d.description || "";
1641
+ let F;
1642
+ e[43] !== D ? (F = (ne) => D("description", ne.target.value), e[43] = D, e[44] = F) : F = e[44];
1643
+ const T = !!p.description;
1644
+ let O;
1645
+ e[45] !== p.description || e[46] !== w || e[47] !== H || e[48] !== F || e[49] !== T ? (O = /* @__PURE__ */ n(Ee, { placeholder: "Short description of what this agent does", label: "Description (optional)", fullWidth: !0, size: "small", multiline: !0, minRows: 2, maxRows: 6, value: H, onChange: F, error: T, helperText: p.description, disabled: w }), e[45] = p.description, e[46] = w, e[47] = H, e[48] = F, e[49] = T, e[50] = O) : O = e[50];
1646
+ let I;
1647
+ e[51] !== G || e[52] !== O ? (I = /* @__PURE__ */ n(ce, { variant: "outlined", children: /* @__PURE__ */ g(de, { sx: R, children: [
1648
+ W,
1649
+ /* @__PURE__ */ g(N, { display: "flex", flexDirection: "column", gap: 1, children: [
1650
+ G,
1651
+ O
1652
+ ] })
1653
+ ] }) }), e[51] = G, e[52] = O, e[53] = I) : I = e[53];
1654
+ let z;
1655
+ e[54] === Symbol.for("react.memo_cache_sentinel") ? (z = {
1656
+ gap: 1,
1657
+ display: "flex",
1658
+ flexDirection: "column"
1659
+ }, e[54] = z) : z = e[54];
1660
+ let V;
1661
+ e[55] !== w || e[56] !== c ? (V = /* @__PURE__ */ n(ce, { variant: "outlined", children: /* @__PURE__ */ n(de, { sx: z, children: /* @__PURE__ */ n(Kn, { value: c, onChange: u, disabled: w }) }) }), e[55] = w, e[56] = c, e[57] = V) : V = e[57];
1662
+ let q;
1663
+ e[58] !== w || e[59] !== l ? (q = /* @__PURE__ */ n(Z, { variant: "outlined", color: "inherit", onClick: l, disabled: w, children: "Cancel" }), e[58] = w, e[59] = l, e[60] = q) : q = e[60];
1664
+ const ee = !L || w, pe = w ? "Updating..." : "Update Agent";
1665
+ let ae;
1666
+ e[61] !== ee || e[62] !== pe ? (ae = /* @__PURE__ */ n(Z, { type: "submit", variant: "contained", color: "primary", disabled: ee, children: pe }), e[61] = ee, e[62] = pe, e[63] = ae) : ae = e[63];
1667
+ let re;
1668
+ e[64] !== q || e[65] !== ae ? (re = /* @__PURE__ */ g(N, { display: "flex", justifyContent: "flex-end", gap: 1, mt: 2, children: [
1669
+ q,
1670
+ ae
1671
+ ] }), e[64] = q, e[65] = ae, e[66] = re) : re = e[66];
1672
+ let fe;
1673
+ e[67] !== I || e[68] !== V || e[69] !== re ? (fe = /* @__PURE__ */ g(N, { display: "flex", flexDirection: "column", gap: 2, flexGrow: 1, children: [
1674
+ I,
1675
+ V,
1676
+ re
1677
+ ] }), e[67] = I, e[68] = V, e[69] = re, e[70] = fe) : fe = e[70];
1678
+ let oe;
1679
+ e[71] !== C || e[72] !== fe ? (oe = /* @__PURE__ */ n(ot, { children: /* @__PURE__ */ n("form", { onSubmit: C, children: fe }) }), e[71] = C, e[72] = fe, e[73] = oe) : oe = e[73];
1680
+ let Ie;
1681
+ return e[74] !== l || e[75] !== i || e[76] !== oe || e[77] !== E ? (Ie = /* @__PURE__ */ g(st, { open: i, onClose: l, children: [
1682
+ E,
1683
+ oe
1684
+ ] }), e[74] = l, e[75] = i, e[76] = oe, e[77] = E, e[78] = Ie) : Ie = e[78], Ie;
1685
+ }
1686
+ function yi() {
1687
+ const t = K(1);
1688
+ let e;
1689
+ return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ n(N, { display: "flex", flexDirection: "column", gap: 4, width: "100%", children: /* @__PURE__ */ n(U, { variant: "rounded", width: "100%", height: "40vh" }) }), t[0] = e) : e = t[0], e;
1690
+ }
1691
+ const bi = (t) => {
1692
+ const e = K(8), {
1693
+ icon: i,
1694
+ label: l,
1695
+ value: a
1696
+ } = t;
1697
+ let o;
1698
+ e[0] !== l ? (o = /* @__PURE__ */ g(A, { variant: "caption", color: "text.secondary", children: [
1699
+ l,
1700
+ ":"
1701
+ ] }), e[0] = l, e[1] = o) : o = e[1];
1702
+ let s;
1703
+ e[2] !== a ? (s = /* @__PURE__ */ n(A, { variant: "caption", fontWeight: 500, children: a }), e[2] = a, e[3] = s) : s = e[3];
1704
+ let r;
1705
+ return e[4] !== i || e[5] !== o || e[6] !== s ? (r = /* @__PURE__ */ g(N, { display: "flex", alignItems: "center", gap: 0.5, children: [
1706
+ i,
1707
+ o,
1708
+ s
1709
+ ] }), e[4] = i, e[5] = o, e[6] = s, e[7] = r) : r = e[7], r;
1710
+ }, xi = (t) => {
1711
+ const e = K(9), {
1712
+ agent: i
1713
+ } = t;
1714
+ let l;
1715
+ e[0] !== i.createdAt ? (l = i.createdAt ? pt(new Date(i.createdAt), {
1716
+ addSuffix: !0
1717
+ }) : null, e[0] = i.createdAt, e[1] = l) : l = e[1];
1718
+ const a = l;
1719
+ let o;
1720
+ e[2] !== i.description ? (o = i.description && /* @__PURE__ */ n(_e, { title: i.description, placement: "bottom-start", children: /* @__PURE__ */ n(A, { variant: "body2", color: "text.secondary", sx: {
1721
+ overflow: "hidden",
1722
+ display: "-webkit-box",
1723
+ WebkitLineClamp: 2,
1724
+ WebkitBoxOrient: "vertical",
1725
+ maxWidth: "50%"
1726
+ }, children: i.description }) }), e[2] = i.description, e[3] = o) : o = e[3];
1727
+ let s;
1728
+ e[4] !== a ? (s = a && /* @__PURE__ */ n(bi, { icon: /* @__PURE__ */ n(Wt, { size: 12 }), label: "Created", value: a }), e[4] = a, e[5] = s) : s = e[5];
1729
+ let r;
1730
+ return e[6] !== o || e[7] !== s ? (r = /* @__PURE__ */ g(X, { spacing: 0.75, children: [
1731
+ o,
1732
+ s
1733
+ ] }), e[6] = o, e[7] = s, e[8] = r) : r = e[8], r;
1734
+ };
1735
+ function vi() {
1736
+ const t = K(39), {
1737
+ orgId: e,
1738
+ agentId: i,
1739
+ projectId: l
1740
+ } = ve(), [a, o] = Q(!1);
1741
+ let s;
1742
+ t[0] !== i || t[1] !== e || t[2] !== l ? (s = {
1743
+ orgName: e,
1744
+ projName: l,
1745
+ agentName: i
1746
+ }, t[0] = i, t[1] = e, t[2] = l, t[3] = s) : s = t[3];
1747
+ const {
1748
+ data: r,
1749
+ isLoading: m
1750
+ } = at(s), d = r?.displayName ?? "Agent";
1751
+ let h;
1752
+ t[4] !== r ? (h = r ? /* @__PURE__ */ n(xi, { agent: r }) : void 0, t[4] = r, t[5] = h) : h = t[5];
1753
+ let f;
1754
+ t[6] === Symbol.for("react.memo_cache_sentinel") ? (f = {
1755
+ width: "100%",
1756
+ minWidth: 0
1757
+ }, t[6] = f) : f = t[6];
1758
+ const c = r?.provisioning?.type;
1759
+ let u;
1760
+ t[7] !== c ? (u = Pt(c), t[7] = c, t[8] = u) : u = t[8];
1761
+ let p;
1762
+ t[9] === Symbol.for("react.memo_cache_sentinel") ? (p = {
1763
+ flexShrink: 0
1764
+ }, t[9] = p) : p = t[9];
1765
+ let y;
1766
+ t[10] !== u ? (y = /* @__PURE__ */ n(Me, { label: u, color: "default", size: "small", variant: "outlined", sx: p }), t[10] = u, t[11] = y) : y = t[11];
1767
+ const x = r?.labels;
1768
+ let b;
1769
+ t[12] !== x ? (b = /* @__PURE__ */ n(Gt, { labels: x }), t[12] = x, t[13] = b) : b = t[13];
1770
+ let v;
1771
+ t[14] !== y || t[15] !== b ? (v = /* @__PURE__ */ g(X, { direction: "row", spacing: 0.5, alignItems: "center", sx: f, children: [
1772
+ y,
1773
+ b
1774
+ ] }), t[14] = y, t[15] = b, t[16] = v) : v = t[16];
1775
+ let S, w;
1776
+ t[17] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ n(Oe, { size: 16 }), w = () => o(!0), t[17] = S, t[18] = w) : (S = t[17], w = t[18]);
1777
+ const j = !r;
1778
+ let P;
1779
+ t[19] !== j ? (P = /* @__PURE__ */ n(Z, { variant: "outlined", size: "small", startIcon: S, onClick: w, disabled: j, children: "Edit Agent" }), t[19] = j, t[20] = P) : P = t[20];
1780
+ let k;
1781
+ t[21] !== r?.provisioning?.type || t[22] !== m ? (k = m ? /* @__PURE__ */ n(yi, {}) : /* @__PURE__ */ g(N, { display: "flex", flexDirection: "column", gap: 4, children: [
1782
+ r?.provisioning?.type === "internal" && /* @__PURE__ */ n(si, {}),
1783
+ r?.provisioning?.type === "external" && /* @__PURE__ */ n(fi, {})
1784
+ ] }), t[21] = r?.provisioning?.type, t[22] = m, t[23] = k) : k = t[23];
1785
+ let D;
1786
+ t[24] !== m || t[25] !== d || t[26] !== v || t[27] !== P || t[28] !== k || t[29] !== h ? (D = /* @__PURE__ */ n(ct, { title: d, description: h, isLoading: m, titleTail: v, actions: P, children: k }), t[24] = m, t[25] = d, t[26] = v, t[27] = P, t[28] = k, t[29] = h, t[30] = D) : D = t[30];
1787
+ let _;
1788
+ t[31] !== r || t[32] !== a || t[33] !== e || t[34] !== l ? (_ = r && /* @__PURE__ */ n(gi, { open: a, onClose: () => o(!1), agent: r, orgId: e || "default", projectId: l || "default" }), t[31] = r, t[32] = a, t[33] = e, t[34] = l, t[35] = _) : _ = t[35];
1789
+ let C;
1790
+ return t[36] !== D || t[37] !== _ ? (C = /* @__PURE__ */ g(te, { children: [
1791
+ D,
1792
+ _
1793
+ ] }), t[36] = D, t[37] = _, t[38] = C) : C = t[38], C;
1794
+ }
1795
+ const _t = () => {
1796
+ const t = K(1);
1797
+ let e;
1798
+ return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ n(vi, {}), t[0] = e) : e = t[0], e;
1799
+ }, et = (t) => {
1800
+ const e = K(10), i = t.bold ? "bold" : "normal", l = t?.icon;
1801
+ let a;
1802
+ e[0] !== t.label || e[1] !== i || e[2] !== l ? (a = /* @__PURE__ */ g(A, { variant: "body2", fontWeight: i, children: [
1803
+ l,
1804
+ "  ",
1805
+ t.label
1806
+ ] }), e[0] = t.label, e[1] = i, e[2] = l, e[3] = a) : a = e[3];
1807
+ const o = t.bold ? "bold" : "normal";
1808
+ let s;
1809
+ e[4] !== t.value || e[5] !== o ? (s = /* @__PURE__ */ n(A, { variant: "body2", fontWeight: o, children: t.value }), e[4] = t.value, e[5] = o, e[6] = s) : s = e[6];
1810
+ let r;
1811
+ return e[7] !== a || e[8] !== s ? (r = /* @__PURE__ */ g(N, { display: "flex", flexDirection: "row", justifyContent: "space-between", gap: 2, children: [
1812
+ a,
1813
+ s
1814
+ ] }), e[7] = a, e[8] = s, e[9] = r) : r = e[9], r;
1815
+ };
1816
+ function Si() {
1817
+ const t = K(26), {
1818
+ orgId: e,
1819
+ projectId: i
1820
+ } = ve();
1821
+ let l;
1822
+ t[0] !== e || t[1] !== i ? (l = {
1823
+ orgName: e,
1824
+ projName: i
1825
+ }, t[0] = e, t[1] = i, t[2] = l) : l = t[2];
1826
+ const {
1827
+ data: a
1828
+ } = At(l);
1829
+ let o;
1830
+ t[3] !== a?.agents ? (o = a?.agents?.filter(Ni)?.length ?? 0, t[3] = a?.agents, t[4] = o) : o = t[4];
1831
+ let s;
1832
+ t[5] !== a?.agents ? (s = a?.agents?.filter(wi)?.length ?? 0, t[5] = a?.agents, t[6] = s) : s = t[6];
1833
+ let r;
1834
+ t[7] !== o || t[8] !== s ? (r = [o, s], t[7] = o, t[8] = s, t[9] = r) : r = t[9];
1835
+ const [m, d] = r;
1836
+ let h;
1837
+ t[10] === Symbol.for("react.memo_cache_sentinel") ? (h = {
1838
+ minWidth: 300,
1839
+ flexGrow: 1
1840
+ }, t[10] = h) : h = t[10];
1841
+ let f;
1842
+ t[11] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ n(A, { variant: "h6", children: "Agent Deployments" }), t[11] = f) : f = t[11];
1843
+ let c;
1844
+ t[12] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ n(Bn, { size: 16 }), t[12] = c) : c = t[12];
1845
+ let u;
1846
+ t[13] !== m ? (u = /* @__PURE__ */ n(et, { label: "External", value: m, icon: c }), t[13] = m, t[14] = u) : u = t[14];
1847
+ let p;
1848
+ t[15] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ n(J, {}), t[15] = p) : p = t[15];
1849
+ let y;
1850
+ t[16] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ n(On, { size: 16 }), t[16] = y) : y = t[16];
1851
+ let x;
1852
+ t[17] !== d ? (x = /* @__PURE__ */ n(et, { label: "Platform", value: d, icon: y }), t[17] = d, t[18] = x) : x = t[18];
1853
+ let b;
1854
+ t[19] === Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ n(J, {}), t[19] = b) : b = t[19];
1855
+ const v = a?.agents?.length ?? 0;
1856
+ let S;
1857
+ t[20] !== v ? (S = /* @__PURE__ */ n(et, { label: "Total", bold: !0, value: v }), t[20] = v, t[21] = S) : S = t[21];
1858
+ let w;
1859
+ return t[22] !== x || t[23] !== S || t[24] !== u ? (w = /* @__PURE__ */ n(ce, { variant: "outlined", sx: h, children: /* @__PURE__ */ n(de, { children: /* @__PURE__ */ g(N, { display: "flex", flexDirection: "column", gap: 1.5, children: [
1860
+ f,
1861
+ u,
1862
+ p,
1863
+ x,
1864
+ b,
1865
+ S
1866
+ ] }) }) }), t[22] = x, t[23] = S, t[24] = u, t[25] = w) : w = t[25], w;
1867
+ }
1868
+ function wi(t) {
1869
+ return t.provisioning.type === "internal";
1870
+ }
1871
+ function Ni(t) {
1872
+ return t.provisioning.type === "external";
1873
+ }
1874
+ const tt = {
1875
+ minWidth: 300,
1876
+ flexGrow: 1
1877
+ };
1878
+ function _i(t) {
1879
+ if (!t.length) return [];
1880
+ const e = new Set(t.flatMap((r) => r.targetEnvironmentRefs.map((m) => m.name))), i = new Map(t.map((r) => [r.sourceEnvironmentRef, r.targetEnvironmentRefs.map((m) => m.name)])), l = [...new Set(t.map((r) => r.sourceEnvironmentRef))].filter((r) => !e.has(r)), a = [], o = /* @__PURE__ */ new Set();
1881
+ let s = l[0];
1882
+ for (; s && !o.has(s); )
1883
+ a.push(s), o.add(s), s = (i.get(s) ?? [])[0];
1884
+ return e.forEach((r) => {
1885
+ o.has(r) || a.push(r);
1886
+ }), a;
1887
+ }
1888
+ function Ii() {
1889
+ const {
1890
+ orgId: t,
1891
+ projectId: e
1892
+ } = ve(), {
1893
+ data: i,
1894
+ isLoading: l
1895
+ } = Ct({
1896
+ orgName: t,
1897
+ projName: e
1898
+ }), {
1899
+ data: a,
1900
+ isLoading: o
1901
+ } = dt({
1902
+ orgName: t
1903
+ }), {
1904
+ data: s
1905
+ } = kt({
1906
+ orgName: t
1907
+ }), r = me(() => a?.deploymentPipelines?.find((c) => c.name === i?.deploymentPipeline), [a, i?.deploymentPipeline]), m = me(() => new Map(s?.map((c) => [c.name, c]) ?? []), [s]), d = me(() => _i(r?.promotionPaths ?? []), [r]), h = l || o, f = !!i?.deploymentPipeline;
1908
+ return h ? /* @__PURE__ */ n(ce, { variant: "outlined", sx: tt, children: /* @__PURE__ */ n(de, { children: /* @__PURE__ */ g(N, { display: "flex", flexDirection: "column", gap: 1.5, children: [
1909
+ /* @__PURE__ */ g(N, { display: "flex", alignItems: "center", gap: 1, children: [
1910
+ /* @__PURE__ */ n(U, { variant: "circular", width: 18, height: 18 }),
1911
+ /* @__PURE__ */ n(U, { variant: "text", width: "60%", height: 28 })
1912
+ ] }),
1913
+ /* @__PURE__ */ n(U, { variant: "text", width: "85%", height: 16 }),
1914
+ /* @__PURE__ */ n(J, {}),
1915
+ /* @__PURE__ */ n(U, { variant: "text", width: "45%", height: 12 }),
1916
+ /* @__PURE__ */ g(N, { display: "flex", alignItems: "center", gap: 1, children: [
1917
+ /* @__PURE__ */ n(U, { variant: "rounded", width: 64, height: 24, sx: {
1918
+ borderRadius: 4
1919
+ } }),
1920
+ /* @__PURE__ */ n(U, { variant: "text", width: 14, height: 14 }),
1921
+ /* @__PURE__ */ n(U, { variant: "rounded", width: 72, height: 24, sx: {
1922
+ borderRadius: 4
1923
+ } }),
1924
+ /* @__PURE__ */ n(U, { variant: "text", width: 14, height: 14 }),
1925
+ /* @__PURE__ */ n(U, { variant: "rounded", width: 80, height: 24, sx: {
1926
+ borderRadius: 4
1927
+ } })
1928
+ ] })
1929
+ ] }) }) }) : !f || !r ? /* @__PURE__ */ n(ce, { variant: "outlined", sx: tt, children: /* @__PURE__ */ n(de, { children: /* @__PURE__ */ g(N, { display: "flex", flexDirection: "column", gap: 1.5, children: [
1930
+ /* @__PURE__ */ n(A, { variant: "h6", children: "Deployment Environments" }),
1931
+ /* @__PURE__ */ n(J, {}),
1932
+ /* @__PURE__ */ n(A, { variant: "body2", color: "text.secondary", sx: {
1933
+ fontStyle: "italic"
1934
+ }, children: "No deployment pipeline configured for this project." })
1935
+ ] }) }) }) : /* @__PURE__ */ n(ce, { variant: "outlined", sx: tt, children: /* @__PURE__ */ n(de, { children: /* @__PURE__ */ g(N, { display: "flex", flexDirection: "column", gap: 1.5, children: [
1936
+ /* @__PURE__ */ n(A, { variant: "h6", children: "Project Environments" }),
1937
+ /* @__PURE__ */ n(J, {}),
1938
+ /* @__PURE__ */ g(N, { display: "flex", flexDirection: "column", gap: 0.5, children: [
1939
+ /* @__PURE__ */ g(N, { display: "flex", alignItems: "center", gap: 0.75, children: [
1940
+ /* @__PURE__ */ n($t, { size: 14, style: {
1941
+ opacity: 0.6,
1942
+ flexShrink: 0
1943
+ } }),
1944
+ /* @__PURE__ */ n(A, { variant: "body2", fontWeight: 500, children: r.displayName || r.name })
1945
+ ] }),
1946
+ r.description && /* @__PURE__ */ n(A, { variant: "body2", color: "text.disabled", sx: {
1947
+ pl: 2.75
1948
+ }, children: r.description })
1949
+ ] }),
1950
+ /* @__PURE__ */ n(J, {}),
1951
+ /* @__PURE__ */ g(N, { display: "flex", flexWrap: "wrap", alignItems: "center", gap: 0.75, children: [
1952
+ d.length > 0 ? d.map((c, u) => {
1953
+ const p = m.get(c), y = p?.displayName || c, x = p?.isProduction ?? !1;
1954
+ return /* @__PURE__ */ g(N, { display: "flex", alignItems: "center", gap: 0.75, children: [
1955
+ /* @__PURE__ */ n(_e, { title: x ? "Production" : "", disableHoverListener: !x, children: /* @__PURE__ */ n(Me, { label: y, size: "small", color: x ? "primary" : "default", variant: "outlined" }) }),
1956
+ u < d.length - 1 && /* @__PURE__ */ n(Fn, { size: 14, style: {
1957
+ opacity: 0.45,
1958
+ flexShrink: 0
1959
+ } })
1960
+ ] }, c);
1961
+ }) : /* @__PURE__ */ n(A, { variant: "body2", color: "text.disabled", sx: {
1962
+ fontStyle: "italic"
1963
+ }, children: "No promotion paths defined." }),
1964
+ /* @__PURE__ */ n(_e, { title: "Edit Promotion Chain", children: /* @__PURE__ */ n(Z, { size: "small", startIcon: /* @__PURE__ */ n(Oe, { size: 14 }), component: ue, to: se(le.children.org.children.deploymentPipelines.path, {
1965
+ orgId: t
1966
+ }) + `?edit=${r.name}`, children: "Edit" }) })
1967
+ ] })
1968
+ ] }) }) });
1969
+ }
1970
+ function Yt(t, e) {
1971
+ return t.promotionPaths.length ? [...t.promotionPaths.map((l) => l.sourceEnvironmentRef), t.promotionPaths[t.promotionPaths.length - 1]?.targetEnvironmentRefs[0]?.name].filter(Boolean).map((l) => e.get(l) ?? l).join(" → ") : null;
1972
+ }
1973
+ function Pi(t) {
1974
+ const e = K(10), {
1975
+ pipeline: i,
1976
+ envDisplayNameMap: l
1977
+ } = t;
1978
+ let a;
1979
+ e[0] !== l || e[1] !== i ? (a = Yt(i, l), e[0] = l, e[1] = i, e[2] = a) : a = e[2];
1980
+ const o = a;
1981
+ let s;
1982
+ e[3] !== i.displayName ? (s = /* @__PURE__ */ n(A, { variant: "body2", children: i.displayName }), e[3] = i.displayName, e[4] = s) : s = e[4];
1983
+ let r;
1984
+ e[5] !== o ? (r = o && /* @__PURE__ */ n(A, { variant: "caption", color: "text.disabled", children: o }), e[5] = o, e[6] = r) : r = e[6];
1985
+ let m;
1986
+ return e[7] !== s || e[8] !== r ? (m = /* @__PURE__ */ g(X, { direction: "row", alignItems: "center", spacing: 1, children: [
1987
+ s,
1988
+ r
1989
+ ] }), e[7] = s, e[8] = r, e[9] = m) : m = e[9], m;
1990
+ }
1991
+ function Ai(t) {
1992
+ const e = K(10), {
1993
+ pipeline: i,
1994
+ envDisplayNameMap: l
1995
+ } = t;
1996
+ let a;
1997
+ e[0] !== l || e[1] !== i ? (a = Yt(i, l), e[0] = l, e[1] = i, e[2] = a) : a = e[2];
1998
+ const o = a;
1999
+ let s;
2000
+ e[3] !== i.displayName ? (s = /* @__PURE__ */ n(A, { variant: "body2", children: i.displayName }), e[3] = i.displayName, e[4] = s) : s = e[4];
2001
+ let r;
2002
+ e[5] !== o ? (r = o && /* @__PURE__ */ n(A, { variant: "caption", color: "text.disabled", children: o }), e[5] = o, e[6] = r) : r = e[6];
2003
+ let m;
2004
+ return e[7] !== s || e[8] !== r ? (m = /* @__PURE__ */ g(X, { children: [
2005
+ s,
2006
+ r
2007
+ ] }), e[7] = s, e[8] = r, e[9] = m) : m = e[9], m;
2008
+ }
2009
+ const Ci = Bt({
2010
+ displayName: we().trim().min(3, "Display name must be at least 3 characters").max(100, "Display name must be at most 100 characters"),
2011
+ name: we().trim().min(3, "Name must be at least 3 characters").regex(/^[a-z0-9-]+$/, "Name must be lowercase letters, numbers, and hyphens only (no spaces)").max(50, "Name must be at most 50 characters"),
2012
+ description: we().trim().optional(),
2013
+ deploymentPipeline: we().trim().min(1, "Deployment pipeline is required")
2014
+ });
2015
+ function ki(t) {
2016
+ const e = K(116), {
2017
+ open: i,
2018
+ onClose: l,
2019
+ project: a,
2020
+ orgId: o
2021
+ } = t, s = a.description || "", r = a.deploymentPipeline || "";
2022
+ let m;
2023
+ e[0] !== a.displayName || e[1] !== a.name || e[2] !== s || e[3] !== r ? (m = {
2024
+ name: a.name,
2025
+ displayName: a.displayName,
2026
+ description: s,
2027
+ deploymentPipeline: r
2028
+ }, e[0] = a.displayName, e[1] = a.name, e[2] = s, e[3] = r, e[4] = m) : m = e[4];
2029
+ const [d, h] = Q(m), {
2030
+ errors: f,
2031
+ validateField: c,
2032
+ validateForm: u,
2033
+ clearErrors: p,
2034
+ setFieldError: y
2035
+ } = It(Ci), {
2036
+ checkDirty: x,
2037
+ resetDirty: b
2038
+ } = vn(d);
2039
+ let v;
2040
+ e[5] !== x || e[6] !== y || e[7] !== c ? (v = (Y, he) => {
2041
+ h((Qe) => {
2042
+ const ut = {
2043
+ ...Qe,
2044
+ [Y]: he
2045
+ };
2046
+ x(ut);
2047
+ const Qt = c(Y, he);
2048
+ return y(Y, Qt), ut;
2049
+ });
2050
+ }, e[5] = x, e[6] = y, e[7] = c, e[8] = v) : v = e[8];
2051
+ const S = v;
2052
+ let w;
2053
+ e[9] !== o || e[10] !== a.name ? (w = {
2054
+ orgName: o,
2055
+ projName: a.name
2056
+ }, e[9] = o, e[10] = a.name, e[11] = w) : w = e[11];
2057
+ const {
2058
+ mutate: j,
2059
+ isPending: P
2060
+ } = Sn(w);
2061
+ let k;
2062
+ e[12] !== o ? (k = {
2063
+ orgName: o
2064
+ }, e[12] = o, e[13] = k) : k = e[13];
2065
+ const {
2066
+ data: D,
2067
+ isLoading: _
2068
+ } = dt(k);
2069
+ D?.deploymentPipelines;
2070
+ let C;
2071
+ e[14] !== D?.deploymentPipelines ? (C = D?.deploymentPipelines ?? [], e[14] = D?.deploymentPipelines, e[15] = C) : C = e[15];
2072
+ const L = C;
2073
+ let $;
2074
+ e[16] !== o ? ($ = {
2075
+ orgName: o
2076
+ }, e[16] = o, e[17] = $) : $ = e[17];
2077
+ const {
2078
+ data: E
2079
+ } = kt($);
2080
+ let R;
2081
+ e[18] !== E ? (R = /* @__PURE__ */ new Map(), (E ?? []).forEach((Y) => R.set(Y.name, Y.displayName ?? Y.name)), e[18] = E, e[19] = R) : R = e[19];
2082
+ const W = R;
2083
+ let M;
2084
+ e[20] !== d.deploymentPipeline || e[21] !== L[0] || e[22] !== L.length ? (M = () => {
2085
+ !d.deploymentPipeline && L.length > 0 && h((Y) => ({
2086
+ ...Y,
2087
+ deploymentPipeline: L[0].name
2088
+ }));
2089
+ }, e[20] = d.deploymentPipeline, e[21] = L[0], e[22] = L.length, e[23] = M) : M = e[23];
2090
+ let B;
2091
+ e[24] !== d.deploymentPipeline || e[25] !== L ? (B = [L, d.deploymentPipeline], e[24] = d.deploymentPipeline, e[25] = L, e[26] = B) : B = e[26], Ne(M, B);
2092
+ let G;
2093
+ e[27] !== p || e[28] !== i || e[29] !== a.deploymentPipeline || e[30] !== a.description || e[31] !== a.displayName || e[32] !== a.name || e[33] !== b ? (G = () => {
2094
+ i && (h({
2095
+ name: a.name,
2096
+ displayName: a.displayName,
2097
+ description: a.description || "",
2098
+ deploymentPipeline: a.deploymentPipeline || ""
2099
+ }), p(), b());
2100
+ }, e[27] = p, e[28] = i, e[29] = a.deploymentPipeline, e[30] = a.description, e[31] = a.displayName, e[32] = a.name, e[33] = b, e[34] = G) : G = e[34];
2101
+ let H;
2102
+ e[35] !== p || e[36] !== i || e[37] !== a || e[38] !== b ? (H = [a, i, p, b], e[35] = p, e[36] = i, e[37] = a, e[38] = b, e[39] = H) : H = e[39], Ne(G, H);
2103
+ let F;
2104
+ e[40] !== p || e[41] !== d || e[42] !== l || e[43] !== b || e[44] !== j || e[45] !== u ? (F = (Y) => {
2105
+ if (Y.preventDefault(), !u(d))
2106
+ return;
2107
+ const he = {
2108
+ name: d.name,
2109
+ displayName: d.displayName,
2110
+ description: d.description,
2111
+ deploymentPipeline: d.deploymentPipeline
2112
+ };
2113
+ j(he, {
2114
+ onSuccess: () => {
2115
+ p(), b(), l();
2116
+ }
2117
+ });
2118
+ }, e[40] = p, e[41] = d, e[42] = l, e[43] = b, e[44] = j, e[45] = u, e[46] = F) : F = e[46];
2119
+ const T = F, O = d.displayName.trim().length >= 3 && d.name.trim().length >= 3 && Object.keys(f).length === 0;
2120
+ let I;
2121
+ e[47] === Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ n(Oe, { size: 24 }), e[47] = I) : I = e[47];
2122
+ let z;
2123
+ e[48] !== l ? (z = /* @__PURE__ */ n(rt, { icon: I, title: "Edit Project", onClose: l }), e[48] = l, e[49] = z) : z = e[49];
2124
+ let V;
2125
+ e[50] === Symbol.for("react.memo_cache_sentinel") ? (V = {
2126
+ gap: 1,
2127
+ display: "flex",
2128
+ flexDirection: "column"
2129
+ }, e[50] = V) : V = e[50];
2130
+ let q;
2131
+ e[51] === Symbol.for("react.memo_cache_sentinel") ? (q = /* @__PURE__ */ n(N, { display: "flex", flexDirection: "column", gap: 1, children: /* @__PURE__ */ n(A, { variant: "h5", children: "Project Details" }) }), e[51] = q) : q = e[51];
2132
+ let ee;
2133
+ e[52] !== S ? (ee = (Y) => S("displayName", Y.target.value), e[52] = S, e[53] = ee) : ee = e[53];
2134
+ const pe = !!f.displayName;
2135
+ let ae;
2136
+ e[54] !== f.displayName || e[55] !== d.displayName || e[56] !== P || e[57] !== ee || e[58] !== pe ? (ae = /* @__PURE__ */ n($e.ElementWrapper, { label: "Name", name: "displayName", children: /* @__PURE__ */ n(gt, { id: "displayName", placeholder: "e.g., Customer Support Platform", size: "small", fullWidth: !0, disabled: P, value: d.displayName, onChange: ee, error: pe, helperText: f.displayName }) }), e[54] = f.displayName, e[55] = d.displayName, e[56] = P, e[57] = ee, e[58] = pe, e[59] = ae) : ae = e[59];
2137
+ let re;
2138
+ e[60] !== S ? (re = (Y) => S("description", Y.target.value), e[60] = S, e[61] = re) : re = e[61];
2139
+ const fe = !!f.description;
2140
+ let oe;
2141
+ e[62] !== f.description || e[63] !== d.description || e[64] !== P || e[65] !== re || e[66] !== fe ? (oe = /* @__PURE__ */ n($e.ElementWrapper, { label: "Description (optional)", name: "description", children: /* @__PURE__ */ n(gt, { id: "description", placeholder: "Short description of this project", fullWidth: !0, size: "small", multiline: !0, minRows: 2, maxRows: 6, disabled: P, value: d.description, onChange: re, error: fe, helperText: f.description }) }), e[62] = f.description, e[63] = d.description, e[64] = P, e[65] = re, e[66] = fe, e[67] = oe) : oe = e[67];
2142
+ const Ie = d.deploymentPipeline;
2143
+ let ne;
2144
+ e[68] !== S ? (ne = (Y) => S("deploymentPipeline", Y.target.value), e[68] = S, e[69] = ne) : ne = e[69];
2145
+ const ye = !!f.deploymentPipeline, Ge = _ || P;
2146
+ let be;
2147
+ e[70] !== W || e[71] !== L ? (be = (Y) => {
2148
+ const he = L.find((Qe) => Qe.name === Y);
2149
+ return he ? /* @__PURE__ */ n(Pi, { pipeline: he, envDisplayNameMap: W }) : /* @__PURE__ */ n(A, { variant: "body2", color: "text.disabled", children: "Select a pipeline" });
2150
+ }, e[70] = W, e[71] = L, e[72] = be) : be = e[72];
2151
+ let Pe;
2152
+ e[73] !== _ ? (Pe = _ && /* @__PURE__ */ n(xe, { value: "", disabled: !0, children: /* @__PURE__ */ g(X, { direction: "row", alignItems: "center", gap: 1, children: [
2153
+ /* @__PURE__ */ n(Xe, { size: 12 }),
2154
+ /* @__PURE__ */ n(A, { variant: "caption", children: "Loading pipelines..." })
2155
+ ] }) }), e[73] = _, e[74] = Pe) : Pe = e[74];
2156
+ let Ae;
2157
+ e[75] !== _ || e[76] !== L.length ? (Ae = !_ && L.length === 0 && /* @__PURE__ */ n(xe, { value: "", disabled: !0, children: "No deployment pipelines available" }), e[75] = _, e[76] = L.length, e[77] = Ae) : Ae = e[77];
2158
+ let Ce;
2159
+ if (e[78] !== W || e[79] !== L) {
2160
+ let Y;
2161
+ e[81] !== W ? (Y = (he) => /* @__PURE__ */ n(xe, { value: he.name, children: /* @__PURE__ */ n(Ai, { pipeline: he, envDisplayNameMap: W }) }, he.name), e[81] = W, e[82] = Y) : Y = e[82], Ce = L.map(Y), e[78] = W, e[79] = L, e[80] = Ce;
2162
+ } else
2163
+ Ce = e[80];
2164
+ let ke;
2165
+ e[83] !== d.deploymentPipeline || e[84] !== ne || e[85] !== ye || e[86] !== Ge || e[87] !== be || e[88] !== Pe || e[89] !== Ae || e[90] !== Ce ? (ke = /* @__PURE__ */ n($e.ElementWrapper, { label: "Deployment Pipeline", name: "deploymentPipeline", children: /* @__PURE__ */ g(ht, { id: "deploymentPipeline", value: Ie, onChange: ne, error: ye, disabled: Ge, displayEmpty: !0, renderValue: be, fullWidth: !0, size: "small", children: [
2166
+ Pe,
2167
+ Ae,
2168
+ Ce
2169
+ ] }) }), e[83] = d.deploymentPipeline, e[84] = ne, e[85] = ye, e[86] = Ge, e[87] = be, e[88] = Pe, e[89] = Ae, e[90] = Ce, e[91] = ke) : ke = e[91];
2170
+ let De;
2171
+ e[92] !== ae || e[93] !== oe || e[94] !== ke ? (De = /* @__PURE__ */ n(ce, { variant: "outlined", children: /* @__PURE__ */ g(de, { sx: V, children: [
2172
+ q,
2173
+ /* @__PURE__ */ g(N, { display: "flex", flexDirection: "column", gap: 1, children: [
2174
+ ae,
2175
+ oe,
2176
+ ke
2177
+ ] })
2178
+ ] }) }), e[92] = ae, e[93] = oe, e[94] = ke, e[95] = De) : De = e[95];
2179
+ let je;
2180
+ e[96] !== P || e[97] !== l ? (je = /* @__PURE__ */ n(Z, { variant: "outlined", color: "inherit", onClick: l, disabled: P, children: "Cancel" }), e[96] = P, e[97] = l, e[98] = je) : je = e[98];
2181
+ const Ye = !O || P, Je = P ? "Updating..." : "Update Project";
2182
+ let Le;
2183
+ e[99] !== Ye || e[100] !== Je ? (Le = /* @__PURE__ */ n(Z, { type: "submit", variant: "contained", color: "primary", disabled: Ye, children: Je }), e[99] = Ye, e[100] = Je, e[101] = Le) : Le = e[101];
2184
+ let Te;
2185
+ e[102] !== je || e[103] !== Le ? (Te = /* @__PURE__ */ g(N, { display: "flex", justifyContent: "flex-end", gap: 1, mt: 2, children: [
2186
+ je,
2187
+ Le
2188
+ ] }), e[102] = je, e[103] = Le, e[104] = Te) : Te = e[104];
2189
+ let ze;
2190
+ e[105] !== De || e[106] !== Te ? (ze = /* @__PURE__ */ g(N, { display: "flex", flexDirection: "column", gap: 2, flexGrow: 1, children: [
2191
+ De,
2192
+ Te
2193
+ ] }), e[105] = De, e[106] = Te, e[107] = ze) : ze = e[107];
2194
+ let We;
2195
+ e[108] !== T || e[109] !== ze ? (We = /* @__PURE__ */ n(ot, { children: /* @__PURE__ */ n("form", { onSubmit: T, children: ze }) }), e[108] = T, e[109] = ze, e[110] = We) : We = e[110];
2196
+ let Fe;
2197
+ return e[111] !== l || e[112] !== i || e[113] !== z || e[114] !== We ? (Fe = /* @__PURE__ */ g(st, { open: i, onClose: l, children: [
2198
+ z,
2199
+ We
2200
+ ] }), e[111] = l, e[112] = i, e[113] = z, e[114] = We, e[115] = Fe) : Fe = e[115], Fe;
2201
+ }
2202
+ const {
2203
+ DataGrid: Di
2204
+ } = Cn;
2205
+ function ji() {
2206
+ const t = K(5);
2207
+ let e;
2208
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
2209
+ flexGrow: 1
2210
+ }, t[0] = e) : e = t[0];
2211
+ let i;
2212
+ t[1] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ g(X, { direction: "row", spacing: 1, children: [
2213
+ /* @__PURE__ */ n(N, { flexGrow: 1, children: /* @__PURE__ */ n(U, { variant: "rounded", width: "100%", height: 40 }) }),
2214
+ /* @__PURE__ */ n(U, { variant: "rounded", width: 120, height: 40 })
2215
+ ] }), t[1] = i) : i = t[1];
2216
+ let l;
2217
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ g(N, { display: "flex", flexDirection: "column", gap: 1, children: [
2218
+ /* @__PURE__ */ n(U, { variant: "rounded", width: "100%", height: 48 }),
2219
+ Array.from({
2220
+ length: 5
2221
+ }).map(Li)
2222
+ ] }), t[2] = l) : l = t[2];
2223
+ let a;
2224
+ t[3] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ g(X, { direction: "column", sx: e, spacing: 4, children: [
2225
+ i,
2226
+ l,
2227
+ /* @__PURE__ */ n(N, { display: "flex", justifyContent: "flex-end", children: /* @__PURE__ */ n(U, { variant: "rounded", width: 300, height: 40 }) })
2228
+ ] }), t[3] = a) : a = t[3];
2229
+ let o;
2230
+ return t[4] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ g(X, { direction: "row", justifyContent: "space-between", gap: 4, children: [
2231
+ a,
2232
+ /* @__PURE__ */ n(N, { width: 250, children: /* @__PURE__ */ n(U, { variant: "rounded", width: "100%", height: 200 }) })
2233
+ ] }), t[4] = o) : o = t[4], o;
2234
+ }
2235
+ function Li(t, e) {
2236
+ return /* @__PURE__ */ n(U, { variant: "rounded", width: "100%", height: 72 }, e);
2237
+ }
2238
+ const Ti = () => {
2239
+ const [t, e] = Q(""), [i, l] = Q(null), [a, o] = Q(0), [s, r] = Q(5), [m, d] = Q(!1), [h, f] = Q(null), c = typeof window < "u" && ("ontouchstart" in window || navigator.maxTouchPoints > 0), {
2240
+ orgId: u,
2241
+ projectId: p
2242
+ } = ve(), y = Tn(), {
2243
+ data: x,
2244
+ isLoading: b,
2245
+ error: v,
2246
+ isRefetching: S
2247
+ } = At({
2248
+ orgName: u,
2249
+ projName: p
2250
+ }), {
2251
+ mutate: w,
2252
+ isPending: j
2253
+ } = wn(), {
2254
+ data: P,
2255
+ isLoading: k
2256
+ } = Ct({
2257
+ orgName: u,
2258
+ projName: p
2259
+ }), {
2260
+ data: D
2261
+ } = Nn({
2262
+ orgName: u
2263
+ }), _ = me(() => {
2264
+ const I = {};
2265
+ return D?.kinds?.forEach((z) => {
2266
+ I[z.name] = z.displayName;
2267
+ }), I;
2268
+ }, [D?.kinds]), {
2269
+ addConfirmation: C
2270
+ } = Dt(), L = ge((I) => {
2271
+ w({
2272
+ orgName: u,
2273
+ projName: p,
2274
+ agentName: I
2275
+ });
2276
+ }, [w, u, p]), $ = ge((I) => {
2277
+ l(I.id);
2278
+ }, []), E = ge(() => {
2279
+ l(null);
2280
+ }, []), R = ge((I) => {
2281
+ f(I.currentTarget);
2282
+ }, []), W = ge(() => {
2283
+ f(null);
2284
+ }, []), M = ge(() => {
2285
+ W(), y(se(le.children.org.children.projects.children.newAgent.children.connect.path, {
2286
+ orgId: u ?? "",
2287
+ projectId: p ?? ""
2288
+ }));
2289
+ }, [W, y, u, p]), B = ge(() => {
2290
+ W(), y(se(le.children.org.children.projects.children.newAgent.children.create.path, {
2291
+ orgId: u ?? "",
2292
+ projectId: p ?? ""
2293
+ }));
2294
+ }, [W, y, u, p]), G = ge((I) => I ? pt(new Date(I), {
2295
+ addSuffix: !0
2296
+ }) : "—", []), H = (I) => {
2297
+ let z = le.children.org.children.projects.children.agents.path;
2298
+ return I && (z = le.children.org.children.projects.children.agents.path), z;
2299
+ };
2300
+ Ne(() => {
2301
+ u && p && !x?.agents?.length && !b && !S && y(se(le.children.org.children.projects.children.newAgent.path, {
2302
+ orgId: u ?? "",
2303
+ projectId: p ?? ""
2304
+ }));
2305
+ }, [u, p, x?.agents, b, S, y]);
2306
+ const F = me(() => x?.agents?.filter((I) => {
2307
+ const z = t.toLowerCase();
2308
+ return I.displayName.toLowerCase().includes(z) || I.name.toLowerCase().includes(z) || // Labels match as `key:value`, so typing "env:prod" (or a
2309
+ // fragment of it) filters by label.
2310
+ Object.entries(I.labels ?? {}).some(([V, q]) => `${V}:${q}`.toLowerCase().includes(z));
2311
+ }).map((I) => ({
2312
+ ...I,
2313
+ href: se(H(I.provisioning.type === "internal"), {
2314
+ orgId: u ?? "",
2315
+ projectId: I.projectName,
2316
+ agentId: I.name
2317
+ }),
2318
+ id: I.name,
2319
+ agentInfo: {
2320
+ name: I.name,
2321
+ displayName: I.displayName,
2322
+ description: I.description
2323
+ }
2324
+ })) ?? [], [x?.agents, t, u]);
2325
+ Ne(() => {
2326
+ o(0);
2327
+ }, [F]);
2328
+ const T = me(() => F.slice(a * s, a * s + s), [F, a, s]), O = k || S && !x?.agents?.length || j;
2329
+ return /* @__PURE__ */ g(te, { children: [
2330
+ /* @__PURE__ */ n(ct, { title: P?.displayName ?? "Agents", description: P?.description ?? "Manage and monitor all your AI agents across environments", isLoading: O, actions: /* @__PURE__ */ n(Z, { variant: "outlined", color: "primary", size: "small", startIcon: /* @__PURE__ */ n(Oe, { size: 16 }), onClick: () => d(!0), disabled: !P, children: "Edit Project" }), children: b ? /* @__PURE__ */ n(ji, {}) : /* @__PURE__ */ g(X, { direction: "row", justifyContent: "space-between", gap: 4, children: [
2331
+ /* @__PURE__ */ g(X, { direction: "column", sx: {
2332
+ flexGrow: 1
2333
+ }, spacing: 4, children: [
2334
+ /* @__PURE__ */ g(X, { direction: "row", spacing: 1, children: [
2335
+ /* @__PURE__ */ n(N, { flexGrow: 1, children: /* @__PURE__ */ n(Lt, { placeholder: "Search agents", size: "small", fullWidth: !0, onChange: (I) => e(I.target.value), value: t, disabled: !x?.agents?.length }) }),
2336
+ /* @__PURE__ */ n(Z, { variant: "contained", color: "primary", size: "small", startIcon: /* @__PURE__ */ n(it, { size: 16 }), onClick: R, "aria-controls": h ? "add-agent-menu" : void 0, "aria-haspopup": "true", "aria-expanded": !!h, children: "Add Agent" }),
2337
+ /* @__PURE__ */ g(kn, { id: "add-agent-menu", anchorEl: h, open: !!h, onClose: W, anchorOrigin: {
2338
+ vertical: "bottom",
2339
+ horizontal: "right"
2340
+ }, transformOrigin: {
2341
+ vertical: "top",
2342
+ horizontal: "right"
2343
+ }, children: [
2344
+ /* @__PURE__ */ n(xe, { onClick: M, children: "External Agent" }),
2345
+ /* @__PURE__ */ n(xe, { onClick: B, children: "Platform-Hosted Agent" })
2346
+ ] })
2347
+ ] }),
2348
+ v ? /* @__PURE__ */ n(jt, { severity: "error", variant: "outlined", children: _n(v) }) : null,
2349
+ b ? /* @__PURE__ */ n(Di, { rows: [], columns: [{
2350
+ field: "name",
2351
+ headerName: "Agent Name",
2352
+ flex: 1
2353
+ }, {
2354
+ field: "description",
2355
+ headerName: "Description",
2356
+ flex: 2
2357
+ }, {
2358
+ field: "lastUpdated",
2359
+ headerName: "Last Updated",
2360
+ flex: 1
2361
+ }], loading: !0, hideFooter: !0 }) : x?.agents?.length && F.length > 0 ? /* @__PURE__ */ g(ie.Container, { sx: {
2362
+ minWidth: 600
2363
+ }, disablePaper: !0, children: [
2364
+ /* @__PURE__ */ g(ie, { variant: "card", children: [
2365
+ /* @__PURE__ */ n(ie.Head, { children: /* @__PURE__ */ g(ie.Row, { children: [
2366
+ /* @__PURE__ */ n(ie.Cell, { children: "Agent Name" }),
2367
+ /* @__PURE__ */ n(ie.Cell, { children: "Description" }),
2368
+ /* @__PURE__ */ n(ie.Cell, { align: "right", children: "Last Updated" })
2369
+ ] }) }),
2370
+ /* @__PURE__ */ n(ie.Body, { children: T.map((I) => /* @__PURE__ */ g(ie.Row, { variant: "card", hover: !0, clickable: !0, onClick: () => y(I.href), onMouseEnter: () => $(I), onMouseLeave: E, onFocus: () => $(I), onBlur: E, children: [
2371
+ /* @__PURE__ */ n(ie.Cell, { children: /* @__PURE__ */ g(X, { direction: "row", alignItems: "center", spacing: 2, sx: {
2372
+ width: "100%",
2373
+ minWidth: 0
2374
+ }, children: [
2375
+ /* @__PURE__ */ n(Tt, { sx: {
2376
+ bgcolor: "primary.main",
2377
+ fontSize: 16,
2378
+ height: 32,
2379
+ width: 32,
2380
+ color: "primary.contrastText",
2381
+ flexShrink: 0
2382
+ }, children: I.displayName.charAt(0).toUpperCase() }),
2383
+ /* @__PURE__ */ g(X, { direction: "row", alignItems: "flex-start", spacing: 1, sx: {
2384
+ minWidth: 0,
2385
+ flex: 1
2386
+ }, children: [
2387
+ /* @__PURE__ */ n(A, { variant: "body1", sx: {
2388
+ flexShrink: 0
2389
+ }, children: I.displayName }),
2390
+ I.provisioning.type !== "internal" && /* @__PURE__ */ n(Me, { label: Pt(I.provisioning.type), size: "small", variant: "outlined", sx: {
2391
+ flexShrink: 0
2392
+ } }),
2393
+ I.kindName && /* @__PURE__ */ n(Me, { size: "small", label: _[I.kindName] ?? I.kindName, sx: {
2394
+ flexShrink: 0
2395
+ } }),
2396
+ /* @__PURE__ */ n(Gt, { labels: I.labels })
2397
+ ] })
2398
+ ] }) }),
2399
+ /* @__PURE__ */ n(ie.Cell, { children: /* @__PURE__ */ n(A, { variant: "body2", noWrap: !0, textOverflow: "ellipsis", overflow: "hidden", children: I.description.substring(0, 40) + (I.description.length > 40 ? "..." : "") }) }),
2400
+ /* @__PURE__ */ n(ie.Cell, { align: "right", children: /* @__PURE__ */ n(X, { direction: "row", alignItems: "center", spacing: 1, justifyContent: "flex-end", sx: {
2401
+ minWidth: 150
2402
+ }, children: i === I.id || c ? /* @__PURE__ */ n(In, { children: /* @__PURE__ */ n(_e, { title: "Delete Agent", children: /* @__PURE__ */ n(Re, { color: "error", size: "small", onClick: (z) => {
2403
+ z.stopPropagation(), C({
2404
+ title: "Delete Agent?",
2405
+ description: `Are you sure you want to delete the agent "${I.displayName}"? This action cannot be undone.`,
2406
+ onConfirm: () => {
2407
+ L(I.name);
2408
+ },
2409
+ confirmButtonColor: "error",
2410
+ confirmButtonIcon: /* @__PURE__ */ n(Ve, { size: 16 }),
2411
+ confirmButtonText: "Delete"
2412
+ });
2413
+ }, children: /* @__PURE__ */ n(Ve, { size: 14 }) }) }) }) : /* @__PURE__ */ n(A, { variant: "body2", color: "text.secondary", noWrap: !0, children: G(I.createdAt) }) }) })
2414
+ ] }, I.id)) })
2415
+ ] }),
2416
+ /* @__PURE__ */ n(Dn, { rowsPerPageOptions: [5, 10, 25], component: "div", count: F.length, rowsPerPage: s, page: a, onPageChange: (I, z) => o(z), onRowsPerPageChange: (I) => {
2417
+ r(parseInt(I.target.value, 10)), o(0);
2418
+ } })
2419
+ ] }) : x?.agents?.length && F.length === 0 ? /* @__PURE__ */ n(ie.Container, { children: /* @__PURE__ */ n(ie.EmptyState, { illustration: /* @__PURE__ */ n(yt, { size: 64 }), title: "No agents found", description: "No agents match your search criteria. Try adjusting your search." }) }) : !x?.agents?.length && !S ? /* @__PURE__ */ n(ie.Container, { children: /* @__PURE__ */ n(ie.EmptyState, { illustration: /* @__PURE__ */ n(yt, { size: 64 }), title: "No agents found", description: "Create a new agent to get started", action: /* @__PURE__ */ n(Z, { variant: "contained", color: "primary", startIcon: /* @__PURE__ */ n(it, {}), onClick: R, "aria-controls": h ? "add-agent-menu" : void 0, "aria-haspopup": "true", "aria-expanded": !!h, children: "Add New Agent" }) }) }) : null
2420
+ ] }),
2421
+ /* @__PURE__ */ g(N, { display: "flex", flexDirection: "column", gap: 2, width: 450, height: "fit-content", children: [
2422
+ /* @__PURE__ */ n(Si, {}),
2423
+ /* @__PURE__ */ n(Ii, {})
2424
+ ] })
2425
+ ] }) }),
2426
+ P && /* @__PURE__ */ n(ki, { open: m, onClose: () => d(!1), project: P, orgId: u || "default" })
2427
+ ] });
2428
+ }, zi = () => {
2429
+ const t = K(1);
2430
+ let e;
2431
+ return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ n(Ti, {}), t[0] = e) : e = t[0], e;
2432
+ }, Jt = 148, Wi = {
2433
+ xs: "repeat(1, minmax(0, 1fr))",
2434
+ md: "repeat(2, minmax(0, 1fr))",
2435
+ lg: "repeat(3, minmax(0, 1fr))",
2436
+ xl: "repeat(4, minmax(0, 1fr))",
2437
+ xxl: "repeat(5, minmax(0, 1fr))"
2438
+ };
2439
+ function $i(t) {
2440
+ const e = K(55), {
2441
+ project: i,
2442
+ pipeline: l,
2443
+ handleDeleteProject: a
2444
+ } = t, {
2445
+ orgId: o
2446
+ } = ve();
2447
+ let s;
2448
+ e[0] !== o || e[1] !== i.name ? (s = se(le.children.org.children.projects.path, {
2449
+ orgId: o,
2450
+ projectId: i.name
2451
+ }), e[0] = o, e[1] = i.name, e[2] = s) : s = e[2];
2452
+ const r = s;
2453
+ let m;
2454
+ e[3] !== i.description ? (m = i.description?.trim() ?? "", e[3] = i.description, e[4] = m) : m = e[4];
2455
+ const d = m;
2456
+ let h;
2457
+ e[5] !== i.createdAt ? (h = i.createdAt ? jn(new Date(i.createdAt)) : "—", e[5] = i.createdAt, e[6] = h) : h = e[6];
2458
+ const f = h;
2459
+ let c;
2460
+ e[7] !== a || e[8] !== i ? (c = (pe) => {
2461
+ pe.preventDefault(), pe.stopPropagation(), a(i);
2462
+ }, e[7] = a, e[8] = i, e[9] = c) : c = e[9];
2463
+ const u = c;
2464
+ let p;
2465
+ e[10] === Symbol.for("react.memo_cache_sentinel") ? (p = {
2466
+ textDecoration: "none"
2467
+ }, e[10] = p) : p = e[10];
2468
+ let y;
2469
+ e[11] === Symbol.for("react.memo_cache_sentinel") ? (y = {
2470
+ position: "relative",
2471
+ width: "100%",
2472
+ height: Jt,
2473
+ textAlign: "left",
2474
+ display: "flex",
2475
+ flexDirection: "column",
2476
+ p: 2,
2477
+ boxSizing: "border-box"
2478
+ }, e[11] = y) : y = e[11];
2479
+ let x;
2480
+ e[12] === Symbol.for("react.memo_cache_sentinel") ? (x = {
2481
+ display: "flex",
2482
+ alignItems: "flex-start",
2483
+ gap: 1.5,
2484
+ minWidth: 0
2485
+ }, e[12] = x) : x = e[12];
2486
+ let b;
2487
+ e[13] === Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ n(Tt, { sx: {
2488
+ bgcolor: "secondary.main",
2489
+ color: "primary.light",
2490
+ height: 44,
2491
+ width: 44,
2492
+ flexShrink: 0
2493
+ }, children: /* @__PURE__ */ n(Et, { size: 26 }) }), e[13] = b) : b = e[13];
2494
+ let v;
2495
+ e[14] === Symbol.for("react.memo_cache_sentinel") ? (v = {
2496
+ flex: 1,
2497
+ minWidth: 0
2498
+ }, e[14] = v) : v = e[14];
2499
+ let S;
2500
+ e[15] === Symbol.for("react.memo_cache_sentinel") ? (S = {
2501
+ lineHeight: 1.3,
2502
+ mb: 0.4
2503
+ }, e[15] = S) : S = e[15];
2504
+ let w;
2505
+ e[16] !== i.displayName ? (w = /* @__PURE__ */ n(A, { variant: "h5", noWrap: !0, sx: S, children: i.displayName }), e[16] = i.displayName, e[17] = w) : w = e[17];
2506
+ const j = d || "", P = !d, k = d ? "text.secondary" : "text.disabled", D = d ? "normal" : "italic";
2507
+ let _;
2508
+ e[18] !== D ? (_ = {
2509
+ display: "-webkit-box",
2510
+ WebkitLineClamp: 2,
2511
+ WebkitBoxOrient: "vertical",
2512
+ overflow: "hidden",
2513
+ fontStyle: D,
2514
+ lineHeight: 1.5
2515
+ }, e[18] = D, e[19] = _) : _ = e[19];
2516
+ const C = d || "No description";
2517
+ let L;
2518
+ e[20] !== k || e[21] !== _ || e[22] !== C ? (L = /* @__PURE__ */ n(A, { variant: "caption", color: k, sx: _, children: C }), e[20] = k, e[21] = _, e[22] = C, e[23] = L) : L = e[23];
2519
+ let $;
2520
+ e[24] !== j || e[25] !== P || e[26] !== L ? ($ = /* @__PURE__ */ n(_e, { title: j, placement: "bottom-start", disableHoverListener: P, children: L }), e[24] = j, e[25] = P, e[26] = L, e[27] = $) : $ = e[27];
2521
+ let E;
2522
+ e[28] !== w || e[29] !== $ ? (E = /* @__PURE__ */ g(N, { sx: x, children: [
2523
+ b,
2524
+ /* @__PURE__ */ g(N, { sx: v, children: [
2525
+ w,
2526
+ $
2527
+ ] })
2528
+ ] }), e[28] = w, e[29] = $, e[30] = E) : E = e[30];
2529
+ let R;
2530
+ e[31] === Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ n(J, { sx: {
2531
+ mb: 1
2532
+ } }), e[31] = R) : R = e[31];
2533
+ let W;
2534
+ e[32] === Symbol.for("react.memo_cache_sentinel") ? (W = {
2535
+ display: "flex",
2536
+ flexDirection: "column",
2537
+ gap: 0.5,
2538
+ minWidth: 0
2539
+ }, e[32] = W) : W = e[32];
2540
+ let M;
2541
+ e[33] === Symbol.for("react.memo_cache_sentinel") ? (M = {
2542
+ display: "flex",
2543
+ alignItems: "center",
2544
+ gap: 0.5,
2545
+ overflow: "hidden"
2546
+ }, e[33] = M) : M = e[33];
2547
+ let B;
2548
+ e[34] === Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ n($t, { size: 13, style: {
2549
+ opacity: 0.5,
2550
+ flexShrink: 0
2551
+ } }), e[34] = B) : B = e[34];
2552
+ let G;
2553
+ e[35] !== l ? (G = /* @__PURE__ */ g(N, { sx: M, children: [
2554
+ B,
2555
+ l ? /* @__PURE__ */ n(A, { variant: "caption", color: "text.secondary", noWrap: !0, children: l.displayName || l.name }) : /* @__PURE__ */ n(A, { variant: "caption", color: "text.disabled", sx: {
2556
+ fontStyle: "italic"
2557
+ }, children: "No pipeline" })
2558
+ ] }), e[35] = l, e[36] = G) : G = e[36];
2559
+ let H, F;
2560
+ e[37] === Symbol.for("react.memo_cache_sentinel") ? (H = {
2561
+ display: "flex",
2562
+ alignItems: "center",
2563
+ gap: 0.4
2564
+ }, F = /* @__PURE__ */ n(Wt, { size: 12 }), e[37] = H, e[38] = F) : (H = e[37], F = e[38]);
2565
+ let T;
2566
+ e[39] !== f ? (T = /* @__PURE__ */ g(A, { variant: "caption", color: "text.disabled", sx: H, children: [
2567
+ F,
2568
+ f
2569
+ ] }), e[39] = f, e[40] = T) : T = e[40];
2570
+ let O;
2571
+ e[41] !== G || e[42] !== T ? (O = /* @__PURE__ */ g(N, { sx: W, children: [
2572
+ G,
2573
+ T
2574
+ ] }), e[41] = G, e[42] = T, e[43] = O) : O = e[43];
2575
+ let I;
2576
+ e[44] === Symbol.for("react.memo_cache_sentinel") ? (I = {
2577
+ position: "absolute",
2578
+ bottom: 8,
2579
+ right: 8
2580
+ }, e[44] = I) : I = e[44];
2581
+ let z;
2582
+ e[45] === Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ n(Ve, { size: 15 }), e[45] = z) : z = e[45];
2583
+ let V;
2584
+ e[46] !== u ? (V = /* @__PURE__ */ n($e.DisappearingCardButtonContent, { sx: I, children: /* @__PURE__ */ n(_e, { title: "Delete Project", children: /* @__PURE__ */ n(Re, { size: "small", color: "error", onClick: u, children: z }) }) }), e[46] = u, e[47] = V) : V = e[47];
2585
+ let q;
2586
+ e[48] !== E || e[49] !== O || e[50] !== V ? (q = /* @__PURE__ */ g($e.CardButton, { sx: y, children: [
2587
+ E,
2588
+ R,
2589
+ O,
2590
+ V
2591
+ ] }), e[48] = E, e[49] = O, e[50] = V, e[51] = q) : q = e[51];
2592
+ let ee;
2593
+ return e[52] !== r || e[53] !== q ? (ee = /* @__PURE__ */ n(ue, { to: r, style: p, children: q }), e[52] = r, e[53] = q, e[54] = ee) : ee = e[54], ee;
2594
+ }
2595
+ function Ei() {
2596
+ const t = K(8);
2597
+ let e;
2598
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
2599
+ width: "100%",
2600
+ height: Jt,
2601
+ textAlign: "left",
2602
+ display: "flex",
2603
+ flexDirection: "column",
2604
+ p: 2,
2605
+ boxSizing: "border-box",
2606
+ pointerEvents: "none"
2607
+ }, t[0] = e) : e = t[0];
2608
+ let i, l;
2609
+ t[1] === Symbol.for("react.memo_cache_sentinel") ? (i = {
2610
+ display: "flex",
2611
+ alignItems: "flex-start",
2612
+ width: "100%",
2613
+ gap: 1.5
2614
+ }, l = /* @__PURE__ */ n(U, { variant: "circular", width: 44, height: 44 }), t[1] = i, t[2] = l) : (i = t[1], l = t[2]);
2615
+ let a;
2616
+ t[3] === Symbol.for("react.memo_cache_sentinel") ? (a = {
2617
+ flex: 1
2618
+ }, t[3] = a) : a = t[3];
2619
+ let o;
2620
+ t[4] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ g(N, { sx: i, children: [
2621
+ l,
2622
+ /* @__PURE__ */ g(N, { sx: a, children: [
2623
+ /* @__PURE__ */ n(U, { variant: "text", width: "55%", height: 22, sx: {
2624
+ mb: 0.5
2625
+ } }),
2626
+ /* @__PURE__ */ n(U, { variant: "text", width: "90%", height: 14 }),
2627
+ /* @__PURE__ */ n(U, { variant: "text", width: "70%", height: 14 })
2628
+ ] })
2629
+ ] }), t[4] = o) : o = t[4];
2630
+ let s;
2631
+ t[5] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ n(N, { sx: {
2632
+ flex: 1
2633
+ } }), t[5] = s) : s = t[5];
2634
+ let r;
2635
+ t[6] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ n(J, { sx: {
2636
+ mb: 1
2637
+ } }), t[6] = r) : r = t[6];
2638
+ let m;
2639
+ return t[7] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ g($e.CardButton, { tabIndex: -1, sx: e, children: [
2640
+ o,
2641
+ s,
2642
+ r,
2643
+ /* @__PURE__ */ g(N, { sx: {
2644
+ display: "flex",
2645
+ alignItems: "center",
2646
+ gap: 2
2647
+ }, children: [
2648
+ /* @__PURE__ */ n(U, { variant: "text", width: 90, height: 16 }),
2649
+ /* @__PURE__ */ n(U, { variant: "text", width: 70, height: 16 })
2650
+ ] })
2651
+ ] }), t[7] = m) : m = t[7], m;
2652
+ }
2653
+ function Ri() {
2654
+ const {
2655
+ orgId: t
2656
+ } = ve(), {
2657
+ data: e,
2658
+ isPending: i
2659
+ } = Pn({
2660
+ orgName: t
2661
+ }), {
2662
+ data: l
2663
+ } = dt({
2664
+ orgName: t
2665
+ }), a = me(() => new Map(l?.deploymentPipelines?.map((c) => [c.name, c]) ?? []), [l]), {
2666
+ addConfirmation: o
2667
+ } = Dt(), {
2668
+ mutate: s,
2669
+ isPending: r
2670
+ } = An(), m = ge((c) => {
2671
+ o({
2672
+ title: "Delete Project?",
2673
+ description: `Are you sure you want to delete the project "${c.displayName}"? This action cannot be undone.`,
2674
+ onConfirm: () => {
2675
+ s({
2676
+ orgName: t,
2677
+ projName: c.name
2678
+ });
2679
+ },
2680
+ confirmButtonColor: "error",
2681
+ confirmButtonIcon: /* @__PURE__ */ n(Ve, { size: 16 }),
2682
+ confirmButtonText: "Delete"
2683
+ });
2684
+ }, [o, s, t]), [d, h] = Q(""), f = me(() => e?.projects?.filter((c) => c.displayName.toLowerCase().includes(d.toLowerCase())) ?? [], [e, d]);
2685
+ return /* @__PURE__ */ n(ct, { title: "All Projects", disableIcon: !0, children: /* @__PURE__ */ g(N, { sx: {
2686
+ display: "flex",
2687
+ flexDirection: "column",
2688
+ gap: 4
2689
+ }, children: [
2690
+ /* @__PURE__ */ g(N, { display: "flex", gap: 2, children: [
2691
+ /* @__PURE__ */ n(N, { flexGrow: 1, children: /* @__PURE__ */ n(Lt, { value: d, onChange: (c) => h(c.target.value), placeholder: "Search Projects", disabled: !e?.projects?.length, size: "small", fullWidth: !0 }) }),
2692
+ /* @__PURE__ */ n(Z, { variant: "contained", color: "primary", size: "small", startIcon: /* @__PURE__ */ n(it, { size: 16 }), component: ue, to: se(le.children.org.children.newProject.path, {
2693
+ orgId: t
2694
+ }), children: "Add Project" })
2695
+ ] }),
2696
+ f.length === 0 && !i && /* @__PURE__ */ n(lt, { message: "No Projects Found", subtitle: d ? "Looks like there are no projects matching your search." : "Create a New Project to Get Started", iconElement: Et }),
2697
+ /* @__PURE__ */ n(N, { sx: {
2698
+ display: "grid",
2699
+ gridTemplateColumns: Wi,
2700
+ gap: 2,
2701
+ width: "100%"
2702
+ }, children: i || r ? Array.from({
2703
+ length: 4
2704
+ }).map((c, u) => /* @__PURE__ */ n(Ei, {}, u)) : f.map((c) => /* @__PURE__ */ n($i, { project: c, pipeline: c.deploymentPipeline ? a.get(c.deploymentPipeline) : void 0, handleDeleteProject: m }, c.name)) })
2705
+ ] }) });
2706
+ }
2707
+ const Mi = () => {
2708
+ const t = K(1);
2709
+ let e;
2710
+ return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ n(Ri, {}), t[0] = e) : e = t[0], e;
2711
+ }, el = {
2712
+ title: "Overview",
2713
+ description: "A page component for Overview",
2714
+ icon: Un,
2715
+ path: "/overview",
2716
+ component: _t,
2717
+ levels: {
2718
+ component: _t,
2719
+ project: zi,
2720
+ organization: Mi
2721
+ }
2722
+ };
2723
+ export {
2724
+ _t as OverviewComponent,
2725
+ Mi as OverviewOrganization,
2726
+ zi as OverviewProject,
2727
+ el as metaData
2728
+ };