@wso2/am-core-ui 0.0.18 → 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 (48) hide show
  1. package/dist/APIKeysManager-C0phJriD.js +241 -0
  2. package/dist/CatalogKindListing-DvUuZEpc.js +137 -0
  3. package/dist/CodeBlock-B2Ecl916.js +21736 -0
  4. package/dist/EnvironmentCard-CIXhDhlZ.js +319 -0
  5. package/dist/EnvironmentSelector-D8S6nO9u.js +48 -0
  6. package/dist/IsolationTierIndicator-cf90kgjL.js +81 -0
  7. package/dist/LabelChips-7rA7_yre.js +139 -0
  8. package/dist/MCPLogo-D9IJzzl7.js +30 -0
  9. package/dist/PolicyListSection-D6aVSKwP.js +1143 -0
  10. package/dist/ResourceListShell-DFisKftq.js +463 -0
  11. package/dist/SwaggerSpecViewer-DzjR6U6W.js +106 -0
  12. package/dist/clipboard-YAzStmkw.js +23 -0
  13. package/dist/debounce-D17ObVdG.js +208 -0
  14. package/dist/format-wlHhWjGo.js +29 -0
  15. package/dist/formatDistanceToNow-DyjnT7l9.js +100 -0
  16. package/dist/gatewayScripts-D4ZDEDPS.js +72 -0
  17. package/dist/highlight-BsUzxSR3.js +454 -0
  18. package/dist/{index-CnXsN5I3.js → index-3K-zqdp-.js} +34 -33
  19. package/dist/index-6liAPSDn.js +1564 -0
  20. package/dist/index-B3ASENUJ.js +1290 -0
  21. package/dist/index-B7Pf4oPq.js +3069 -0
  22. package/dist/index-BNO3FhZK.js +2304 -0
  23. package/dist/index-BUZSfCl5.js +335 -0
  24. package/dist/index-BXiG1r_o.js +1409 -0
  25. package/dist/index-BYy7Iaam.js +459 -0
  26. package/dist/index-BbB_yx4V.js +1397 -0
  27. package/dist/index-BjWJ95lH.js +2728 -0
  28. package/dist/index-ByEInFlf.js +26408 -0
  29. package/dist/index-C8WIhzyz.js +123 -0
  30. package/dist/index-CnzvaT6b.js +2368 -0
  31. package/dist/index-CrnCf-hJ.js +763 -0
  32. package/dist/index-Cvsho9xg.js +2346 -0
  33. package/dist/index-CxnAo1_c.js +119 -0
  34. package/dist/{index-DYV1jEai.js → index-Cz7-AZwE.js} +22 -20
  35. package/dist/index-DBdRFjxm.js +1264 -0
  36. package/dist/index-DFsSvmMZ.js +7981 -0
  37. package/dist/index-DslzOSGN.js +2549 -0
  38. package/dist/index-DvpYvchM.js +2341 -0
  39. package/dist/index-PWsNvJB-.js +546 -0
  40. package/dist/index.d.ts +1398 -481
  41. package/dist/index.js +539 -438
  42. package/dist/js-yaml-CvhD-clg.js +1335 -0
  43. package/dist/llmProviderPayload-BPzWDy7n.js +332 -0
  44. package/dist/schemas-DFScWdSL.js +2969 -0
  45. package/package.json +1 -1
  46. package/dist/index-B47EJCom.js +0 -236
  47. package/dist/index-Bl1Y7Sro.js +0 -3037
  48. package/dist/index-DlS9Lybj.js +0 -80691
@@ -0,0 +1,241 @@
1
+ import { jsx as t, jsxs as _ } from "react/jsx-runtime";
2
+ import { c as M } from "react/compiler-runtime";
3
+ import { useState as W } from "react";
4
+ import { Alert as Y, Box as K, Typography as j, Button as $, Chip as te, Tooltip as H, IconButton as J, Skeleton as le, Stack as Q, DialogTitle as ie, TextField as q, DialogContent as ne, CircularProgress as se, DialogActions as oe, Dialog as re } from "@wso2/oxygen-ui";
5
+ import { Key as U, Plus as G, Trash2 as ae, Copy as ce } from "@wso2/oxygen-ui-icons-react";
6
+ function be(C) {
7
+ return C?.enabled !== !1 && C?.apiKey?.enabled === !0;
8
+ }
9
+ function de(C) {
10
+ const e = M(44), {
11
+ open: l,
12
+ onClose: b,
13
+ isCreating: f,
14
+ onCreate: h,
15
+ onCreated: m
16
+ } = C, g = fe, [r, y] = W(""), [n, a] = W(g);
17
+ let p;
18
+ e[0] !== r ? (p = r.trim(), e[0] = r, e[1] = p) : p = e[1];
19
+ const c = p, s = c.length > 0 && n.length > 0;
20
+ let d;
21
+ e[2] !== b ? (d = () => {
22
+ y(""), a(g()), b();
23
+ }, e[2] = b, e[3] = d) : d = e[3];
24
+ const i = d;
25
+ let o;
26
+ e[4] !== s || e[5] !== n || e[6] !== i || e[7] !== h || e[8] !== m || e[9] !== c ? (o = async () => {
27
+ if (!s)
28
+ return;
29
+ const [E, X, Z] = n.split("-").map(Number), ee = new Date(E, X - 1, Z, 23, 59, 59, 999).toISOString();
30
+ try {
31
+ const V = await h({
32
+ displayName: c,
33
+ expiresAt: ee
34
+ });
35
+ V && m(V), i();
36
+ } catch {
37
+ }
38
+ }, e[4] = s, e[5] = n, e[6] = i, e[7] = h, e[8] = m, e[9] = c, e[10] = o) : o = e[10];
39
+ const u = o;
40
+ let k;
41
+ e[11] === Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ t(ie, { children: "Create API Key" }), e[11] = k) : k = e[11];
42
+ let A;
43
+ e[12] === Symbol.for("react.memo_cache_sentinel") ? (A = {
44
+ pt: 1
45
+ }, e[12] = A) : A = e[12];
46
+ let S;
47
+ e[13] === Symbol.for("react.memo_cache_sentinel") ? (S = (E) => y(E.target.value), e[13] = S) : S = e[13];
48
+ let x;
49
+ e[14] !== r ? (x = /* @__PURE__ */ t(q, { label: "Display name", value: r, onChange: S, fullWidth: !0, required: !0, size: "small", placeholder: "production key" }), e[14] = r, e[15] = x) : x = e[15];
50
+ let I;
51
+ e[16] === Symbol.for("react.memo_cache_sentinel") ? (I = (E) => a(E.target.value), e[16] = I) : I = e[16];
52
+ const v = n.length === 0;
53
+ let B;
54
+ e[17] === Symbol.for("react.memo_cache_sentinel") ? (B = {
55
+ inputLabel: {
56
+ shrink: !0
57
+ }
58
+ }, e[17] = B) : B = e[17];
59
+ let D;
60
+ e[18] !== n || e[19] !== v ? (D = /* @__PURE__ */ t(q, { label: "Expires", type: "date", value: n, onChange: I, fullWidth: !0, required: !0, size: "small", error: v, slotProps: B, helperText: "Key expires at end of the selected day" }), e[18] = n, e[19] = v, e[20] = D) : D = e[20];
61
+ let w;
62
+ e[21] !== D || e[22] !== x ? (w = /* @__PURE__ */ t(ne, { children: /* @__PURE__ */ _(Q, { spacing: 2, sx: A, children: [
63
+ x,
64
+ D
65
+ ] }) }), e[21] = D, e[22] = x, e[23] = w) : w = e[23];
66
+ let P;
67
+ e[24] !== i || e[25] !== f ? (P = /* @__PURE__ */ t($, { variant: "outlined", onClick: i, disabled: f, children: "Cancel" }), e[24] = i, e[25] = f, e[26] = P) : P = e[26];
68
+ let z;
69
+ e[27] !== u ? (z = () => void u(), e[27] = u, e[28] = z) : z = e[28];
70
+ const F = f || !s;
71
+ let R;
72
+ e[29] !== f ? (R = f ? /* @__PURE__ */ t(se, { size: 16 }) : void 0, e[29] = f, e[30] = R) : R = e[30];
73
+ const L = f ? "Creating..." : "Create";
74
+ let N;
75
+ e[31] !== z || e[32] !== F || e[33] !== R || e[34] !== L ? (N = /* @__PURE__ */ t($, { variant: "contained", onClick: z, disabled: F, startIcon: R, children: L }), e[31] = z, e[32] = F, e[33] = R, e[34] = L, e[35] = N) : N = e[35];
76
+ let T;
77
+ e[36] !== P || e[37] !== N ? (T = /* @__PURE__ */ _(oe, { children: [
78
+ P,
79
+ N
80
+ ] }), e[36] = P, e[37] = N, e[38] = T) : T = e[38];
81
+ let O;
82
+ return e[39] !== i || e[40] !== l || e[41] !== w || e[42] !== T ? (O = /* @__PURE__ */ _(re, { open: l, onClose: i, maxWidth: "sm", fullWidth: !0, children: [
83
+ k,
84
+ w,
85
+ T
86
+ ] }), e[39] = i, e[40] = l, e[41] = w, e[42] = T, e[43] = O) : O = e[43], O;
87
+ }
88
+ function fe() {
89
+ const C = /* @__PURE__ */ new Date();
90
+ return C.setMonth(C.getMonth() + 1), C.toISOString().slice(0, 10);
91
+ }
92
+ function me(C) {
93
+ const e = M(19), {
94
+ apiKey: l,
95
+ onDismiss: b
96
+ } = C, [f, h] = W(!1);
97
+ let m;
98
+ e[0] !== l ? (m = () => {
99
+ navigator.clipboard.writeText(l).then(() => {
100
+ h(!0), setTimeout(() => h(!1), 2e3);
101
+ });
102
+ }, e[0] = l, e[1] = m) : m = e[1];
103
+ const g = m;
104
+ let r;
105
+ e[2] === Symbol.for("react.memo_cache_sentinel") ? (r = {
106
+ mb: 2,
107
+ "& .MuiAlert-message": {
108
+ flexGrow: 1
109
+ }
110
+ }, e[2] = r) : r = e[2];
111
+ let y;
112
+ e[3] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ t(j, { variant: "subtitle2", sx: {
113
+ mb: 0.5
114
+ }, children: "You will only see this key once. Copy it now." }), e[3] = y) : y = e[3];
115
+ let n;
116
+ e[4] === Symbol.for("react.memo_cache_sentinel") ? (n = {
117
+ input: {
118
+ readOnly: !0
119
+ }
120
+ }, e[4] = n) : n = e[4];
121
+ let a;
122
+ e[5] !== l ? (a = /* @__PURE__ */ t(q, { size: "small", fullWidth: !0, value: l, slotProps: n }), e[5] = l, e[6] = a) : a = e[6];
123
+ const p = f ? "Copied!" : "Copy";
124
+ let c;
125
+ e[7] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ t(ce, { size: 16 }), e[7] = c) : c = e[7];
126
+ let s;
127
+ e[8] !== g ? (s = /* @__PURE__ */ t(J, { size: "small", onClick: g, "aria-label": "Copy API key", children: c }), e[8] = g, e[9] = s) : s = e[9];
128
+ let d;
129
+ e[10] !== p || e[11] !== s ? (d = /* @__PURE__ */ t(H, { title: p, children: s }), e[10] = p, e[11] = s, e[12] = d) : d = e[12];
130
+ let i;
131
+ e[13] !== a || e[14] !== d ? (i = /* @__PURE__ */ _(K, { display: "flex", alignItems: "center", gap: 1, children: [
132
+ a,
133
+ d
134
+ ] }), e[13] = a, e[14] = d, e[15] = i) : i = e[15];
135
+ let o;
136
+ return e[16] !== b || e[17] !== i ? (o = /* @__PURE__ */ _(Y, { severity: "success", onClose: b, sx: r, children: [
137
+ y,
138
+ i
139
+ ] }), e[16] = b, e[17] = i, e[18] = o) : o = e[18], o;
140
+ }
141
+ function pe(C) {
142
+ const e = M(26), {
143
+ apiKey: l,
144
+ onRevoke: b,
145
+ isRevoking: f
146
+ } = C;
147
+ let h;
148
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (h = {
149
+ borderBottom: "1px solid",
150
+ borderColor: "divider"
151
+ }, e[0] = h) : h = e[0];
152
+ let m;
153
+ e[1] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ t(U, { size: 18 }), e[1] = m) : m = e[1];
154
+ const g = l.displayName || l.name;
155
+ let r;
156
+ e[2] !== g ? (r = /* @__PURE__ */ t(j, { variant: "body2", fontWeight: 500, children: g }), e[2] = g, e[3] = r) : r = e[3];
157
+ const y = l.expiresAt && ` · Expires ${new Date(l.expiresAt).toLocaleDateString()}`;
158
+ let n;
159
+ e[4] !== l.maskedApiKey || e[5] !== y ? (n = /* @__PURE__ */ _(j, { variant: "caption", color: "text.secondary", children: [
160
+ l.maskedApiKey,
161
+ y
162
+ ] }), e[4] = l.maskedApiKey, e[5] = y, e[6] = n) : n = e[6];
163
+ let a;
164
+ e[7] !== r || e[8] !== n ? (a = /* @__PURE__ */ _(K, { display: "flex", alignItems: "center", gap: 2, children: [
165
+ m,
166
+ /* @__PURE__ */ _(K, { children: [
167
+ r,
168
+ n
169
+ ] })
170
+ ] }), e[7] = r, e[8] = n, e[9] = a) : a = e[9];
171
+ const p = l.status === "active" ? "success" : "default";
172
+ let c;
173
+ e[10] !== l.status || e[11] !== p ? (c = /* @__PURE__ */ t(te, { label: l.status, size: "small", color: p }), e[10] = l.status, e[11] = p, e[12] = c) : c = e[12];
174
+ let s;
175
+ e[13] !== l.name || e[14] !== b ? (s = () => b(l.name), e[13] = l.name, e[14] = b, e[15] = s) : s = e[15];
176
+ let d;
177
+ e[16] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ t(ae, { size: 16 }), e[16] = d) : d = e[16];
178
+ let i;
179
+ e[17] !== f || e[18] !== s ? (i = /* @__PURE__ */ t(H, { title: "Revoke", children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(J, { size: "small", color: "error", onClick: s, disabled: f, "aria-label": "Revoke API key", children: d }) }) }), e[17] = f, e[18] = s, e[19] = i) : i = e[19];
180
+ let o;
181
+ e[20] !== i || e[21] !== c ? (o = /* @__PURE__ */ _(K, { display: "flex", alignItems: "center", gap: 1, children: [
182
+ c,
183
+ i
184
+ ] }), e[20] = i, e[21] = c, e[22] = o) : o = e[22];
185
+ let u;
186
+ return e[23] !== o || e[24] !== a ? (u = /* @__PURE__ */ _(K, { display: "flex", alignItems: "center", justifyContent: "space-between", px: 2, py: 1.5, sx: h, children: [
187
+ a,
188
+ o
189
+ ] }), e[23] = o, e[24] = a, e[25] = u) : u = e[25], u;
190
+ }
191
+ function xe(C) {
192
+ const e = M(23), {
193
+ keys: l,
194
+ isLoading: b,
195
+ isError: f,
196
+ isCreating: h,
197
+ isRevoking: m,
198
+ emptyDescription: g,
199
+ onCreate: r,
200
+ onRevoke: y
201
+ } = C, n = f === void 0 ? !1 : f, a = m === void 0 ? !1 : m, [p, c] = W(!1), [s, d] = W(null);
202
+ if (b) {
203
+ let v;
204
+ return e[0] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ t(le, { variant: "rectangular", width: "100%", height: 200 }), e[0] = v) : v = e[0], v;
205
+ }
206
+ const i = !!l && l.length > 0;
207
+ let o;
208
+ e[1] !== i ? (o = i && /* @__PURE__ */ t(Q, { direction: "row", justifyContent: "flex-end", sx: {
209
+ mb: 2
210
+ }, children: /* @__PURE__ */ t($, { variant: "contained", startIcon: /* @__PURE__ */ t(G, { size: 16 }), onClick: () => c(!0), children: "Create" }) }), e[1] = i, e[2] = o) : o = e[2];
211
+ let u;
212
+ e[3] !== s ? (u = s && /* @__PURE__ */ t(me, { apiKey: s, onDismiss: () => d(null) }), e[3] = s, e[4] = u) : u = e[4];
213
+ let k;
214
+ e[5] !== g || e[6] !== i || e[7] !== n || e[8] !== a || e[9] !== l || e[10] !== y ? (k = n ? /* @__PURE__ */ t(Y, { severity: "error", children: "Failed to load API keys. Please refresh the page." }) : i ? /* @__PURE__ */ t(K, { sx: {
215
+ border: "1px solid",
216
+ borderColor: "divider",
217
+ borderRadius: 1
218
+ }, children: l.map((v) => /* @__PURE__ */ t(pe, { apiKey: v, onRevoke: y, isRevoking: a }, v.name)) }) : /* @__PURE__ */ _(K, { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", py: 8, gap: 2, children: [
219
+ /* @__PURE__ */ t(U, { size: 48 }),
220
+ /* @__PURE__ */ t(j, { variant: "h6", children: "No API keys" }),
221
+ /* @__PURE__ */ t(j, { variant: "body2", color: "text.secondary", children: g }),
222
+ /* @__PURE__ */ t($, { variant: "contained", startIcon: /* @__PURE__ */ t(G, { size: 16 }), onClick: () => c(!0), children: "Create API Key" })
223
+ ] }), e[5] = g, e[6] = i, e[7] = n, e[8] = a, e[9] = l, e[10] = y, e[11] = k) : k = e[11];
224
+ let A;
225
+ e[12] === Symbol.for("react.memo_cache_sentinel") ? (A = () => c(!1), e[12] = A) : A = e[12];
226
+ let S;
227
+ e[13] === Symbol.for("react.memo_cache_sentinel") ? (S = (v) => d(v), e[13] = S) : S = e[13];
228
+ let x;
229
+ e[14] !== p || e[15] !== h || e[16] !== r ? (x = /* @__PURE__ */ t(de, { open: p, onClose: A, isCreating: h, onCreate: r, onCreated: S }), e[14] = p, e[15] = h, e[16] = r, e[17] = x) : x = e[17];
230
+ let I;
231
+ return e[18] !== o || e[19] !== u || e[20] !== k || e[21] !== x ? (I = /* @__PURE__ */ _(K, { children: [
232
+ o,
233
+ u,
234
+ k,
235
+ x
236
+ ] }), e[18] = o, e[19] = u, e[20] = k, e[21] = x, e[22] = I) : I = e[22], I;
237
+ }
238
+ export {
239
+ xe as A,
240
+ be as i
241
+ };
@@ -0,0 +1,137 @@
1
+ import { jsx as t, jsxs as v, Fragment as j } from "react/jsx-runtime";
2
+ import { useState as L, useRef as B, useEffect as H, useCallback as I, useMemo as O } from "react";
3
+ import { Typography as k, Form as E, Tooltip as D, Box as T, Stack as R, SearchBar as W, Skeleton as $, ListingTable as N, TablePagination as z } from "@wso2/oxygen-ui";
4
+ import { CircleIcon as F, Search as G } from "@wso2/oxygen-ui-icons-react";
5
+ import { c as K } from "react/compiler-runtime";
6
+ import { Link as M } from "react-router-dom";
7
+ import { a as U } from "./LabelChips-7rA7_yre.js";
8
+ const V = (g) => {
9
+ const e = K(33), {
10
+ item: l,
11
+ viewPath: d
12
+ } = g, s = l.description ?? "", i = l.latestVersion ? `Latest: ${l.latestVersion}` : null;
13
+ let u;
14
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (u = {
15
+ textDecoration: "none"
16
+ }, e[0] = u) : u = e[0];
17
+ let x;
18
+ e[1] === Symbol.for("react.memo_cache_sentinel") ? (x = {
19
+ width: "100%",
20
+ textAlign: "left",
21
+ textDecoration: "none",
22
+ height: 160,
23
+ display: "flex",
24
+ flexDirection: "column",
25
+ justifyContent: "flex-start"
26
+ }, e[1] = x) : x = e[1];
27
+ let y;
28
+ e[2] === Symbol.for("react.memo_cache_sentinel") ? (y = {
29
+ pb: 0.5
30
+ }, e[2] = y) : y = e[2];
31
+ let c;
32
+ e[3] !== l.displayName ? (c = /* @__PURE__ */ t(k, { variant: "h6", textOverflow: "ellipsis", overflow: "hidden", whiteSpace: "nowrap", children: l.displayName }), e[3] = l.displayName, e[4] = c) : c = e[4];
33
+ let m;
34
+ e[5] !== l.displayName || e[6] !== c ? (m = /* @__PURE__ */ t(E.CardHeader, { sx: y, title: /* @__PURE__ */ t(D, { title: l.displayName, placement: "top", children: c }) }), e[5] = l.displayName, e[6] = c, e[7] = m) : m = e[7];
35
+ let r;
36
+ e[8] === Symbol.for("react.memo_cache_sentinel") ? (r = {
37
+ width: "100%",
38
+ display: "flex",
39
+ flexDirection: "column",
40
+ flexGrow: 1,
41
+ minHeight: 0,
42
+ pt: 0
43
+ }, e[8] = r) : r = e[8];
44
+ const w = !s;
45
+ let o;
46
+ e[9] === Symbol.for("react.memo_cache_sentinel") ? (o = {
47
+ display: "-webkit-box",
48
+ WebkitBoxOrient: "vertical",
49
+ WebkitLineClamp: 2,
50
+ overflow: "hidden"
51
+ }, e[9] = o) : o = e[9];
52
+ const P = s || "No description provided.";
53
+ let h;
54
+ e[10] !== P ? (h = /* @__PURE__ */ t(k, { variant: "caption", color: "text.secondary", sx: o, children: P }), e[10] = P, e[11] = h) : h = e[11];
55
+ let p;
56
+ e[12] !== s || e[13] !== h || e[14] !== w ? (p = /* @__PURE__ */ t(T, { children: /* @__PURE__ */ t(D, { title: s, placement: "top", disableHoverListener: w, children: h }) }), e[12] = s, e[13] = h, e[14] = w, e[15] = p) : p = e[15];
57
+ let a;
58
+ e[16] !== i ? (a = i && /* @__PURE__ */ t(k, { variant: "caption", color: "text.secondary", children: i }), e[16] = i, e[17] = a) : a = e[17];
59
+ let n;
60
+ e[18] !== p || e[19] !== a ? (n = /* @__PURE__ */ v(R, { spacing: 0.5, minHeight: 0, children: [
61
+ p,
62
+ a
63
+ ] }), e[18] = p, e[19] = a, e[20] = n) : n = e[20];
64
+ let C;
65
+ e[21] === Symbol.for("react.memo_cache_sentinel") ? (C = {
66
+ mt: "auto",
67
+ pt: 1
68
+ }, e[21] = C) : C = e[21];
69
+ let f;
70
+ e[22] !== l.labels ? (f = /* @__PURE__ */ t(T, { sx: C, children: /* @__PURE__ */ t(U, { labels: l.labels }) }), e[22] = l.labels, e[23] = f) : f = e[23];
71
+ let b;
72
+ e[24] !== n || e[25] !== f ? (b = /* @__PURE__ */ v(E.CardContent, { sx: r, children: [
73
+ n,
74
+ f
75
+ ] }), e[24] = n, e[25] = f, e[26] = b) : b = e[26];
76
+ let S;
77
+ e[27] !== b || e[28] !== m ? (S = /* @__PURE__ */ v(E.CardButton, { sx: x, children: [
78
+ m,
79
+ b
80
+ ] }), e[27] = b, e[28] = m, e[29] = S) : S = e[29];
81
+ let _;
82
+ return e[30] !== S || e[31] !== d ? (_ = /* @__PURE__ */ t(M, { to: d, style: u, children: S }), e[30] = S, e[31] = d, e[32] = _) : _ = e[32], _;
83
+ }, A = 6, q = [6, 12, 24], J = 300, ne = ({
84
+ items: g,
85
+ getViewPath: e,
86
+ isLoading: l
87
+ }) => {
88
+ const [d, s] = L(0), [i, u] = L(A), [x, y] = L(""), [c, m] = L(""), r = B(null);
89
+ H(() => () => {
90
+ r.current && clearTimeout(r.current);
91
+ }, []);
92
+ const w = I((a) => {
93
+ const n = a.target.value;
94
+ y(n), r.current && clearTimeout(r.current), r.current = setTimeout(() => {
95
+ m(n), s(0);
96
+ }, J);
97
+ }, []), o = O(() => {
98
+ const a = c.trim().toLowerCase();
99
+ return a ? g.filter((n) => n.displayName.toLowerCase().includes(a) || n.name.toLowerCase().includes(a) || (n.description ?? "").toLowerCase().includes(a) || // Labels match as `key:value`, so typing "env:prod" (or a fragment
100
+ // of it) filters by label.
101
+ Object.entries(n.labels ?? {}).some(([C, f]) => `${C}:${f}`.toLowerCase().includes(a))) : g;
102
+ }, [g, c]), P = O(() => o.slice(d * i, d * i + i), [o, d, i]), h = (a, n) => {
103
+ s(n);
104
+ }, p = (a) => {
105
+ u(parseInt(a.target.value, 10)), s(0);
106
+ };
107
+ return /* @__PURE__ */ v(R, { spacing: 2, children: [
108
+ /* @__PURE__ */ t(R, { direction: "row", justifyContent: "flex-end", children: /* @__PURE__ */ t(W, { placeholder: "Search agent kinds", size: "small", value: x, onChange: w }) }),
109
+ l ? /* @__PURE__ */ t(T, { sx: {
110
+ display: "grid",
111
+ gridTemplateColumns: {
112
+ xs: "repeat(auto-fill, minmax(260px, 1fr))",
113
+ md: "repeat(auto-fill, minmax(300px, 1fr))"
114
+ },
115
+ gap: 2
116
+ }, children: Array.from({
117
+ length: 6
118
+ }).map((a, n) => /* @__PURE__ */ t($, { variant: "rounded", height: 160 }, n)) }) : g.length === 0 ? /* @__PURE__ */ t(N.Container, { sx: {
119
+ my: 3
120
+ }, children: /* @__PURE__ */ t(N.EmptyState, { illustration: /* @__PURE__ */ t(F, { size: 64 }), title: "No agent kinds available", description: "No agent kinds have been added to the catalog yet." }) }) : o.length === 0 ? /* @__PURE__ */ t(N.Container, { sx: {
121
+ my: 3
122
+ }, children: /* @__PURE__ */ t(N.EmptyState, { illustration: /* @__PURE__ */ t(G, { size: 64 }), title: "No agent kinds match your search", description: "Try a different keyword or clear the search filter." }) }) : /* @__PURE__ */ v(j, { children: [
123
+ /* @__PURE__ */ t(T, { sx: {
124
+ display: "grid",
125
+ gridTemplateColumns: {
126
+ xs: "repeat(auto-fill, minmax(260px, 1fr))",
127
+ md: "repeat(auto-fill, minmax(300px, 1fr))"
128
+ },
129
+ gap: 2
130
+ }, children: P.map((a) => /* @__PURE__ */ t(V, { item: a, viewPath: e(a) }, a.name)) }),
131
+ o.length > A && /* @__PURE__ */ t(z, { component: "div", count: o.length, page: d, rowsPerPage: i, onPageChange: h, onRowsPerPageChange: p, rowsPerPageOptions: q })
132
+ ] })
133
+ ] });
134
+ };
135
+ export {
136
+ ne as C
137
+ };