@wso2/am-core-ui 0.0.18 → 0.0.19

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 (45) hide show
  1. package/dist/APIKeysManager-C0phJriD.js +241 -0
  2. package/dist/CatalogKindListing-DtFI2YMG.js +118 -0
  3. package/dist/CodeBlock-mB_Loq7I.js +21736 -0
  4. package/dist/EnvironmentCard-09h1XRxx.js +310 -0
  5. package/dist/EnvironmentSelector-B7Bl93s2.js +48 -0
  6. package/dist/MCPLogo-D9IJzzl7.js +30 -0
  7. package/dist/PolicyListSection-o4k9e8XO.js +2475 -0
  8. package/dist/ResourceListShell-Cx6mdeqv.js +463 -0
  9. package/dist/SwaggerSpecViewer-BvkhoKsi.js +106 -0
  10. package/dist/clipboard-YAzStmkw.js +23 -0
  11. package/dist/debounce-BV83M53b.js +208 -0
  12. package/dist/format-BEZZRyE2.js +29 -0
  13. package/dist/formatDistanceToNow-TErllcH8.js +100 -0
  14. package/dist/gatewayScripts-D8O45W8u.js +72 -0
  15. package/dist/highlight-BsUzxSR3.js +454 -0
  16. package/dist/index-B52h3RHg.js +1290 -0
  17. package/dist/index-BP5drcF2.js +1265 -0
  18. package/dist/index-BZ4vxviI.js +7981 -0
  19. package/dist/index-B_Z0MwXk.js +25012 -0
  20. package/dist/index-BfjzUWDa.js +1397 -0
  21. package/dist/{index-DYV1jEai.js → index-BnV-PkwM.js} +22 -20
  22. package/dist/index-CGDYgUCH.js +711 -0
  23. package/dist/index-COt7nJIf.js +2286 -0
  24. package/dist/index-CWZjOy1h.js +2247 -0
  25. package/dist/index-CezvogTQ.js +116 -0
  26. package/dist/index-CgCWbWzN.js +2342 -0
  27. package/dist/index-CjCkcuuI.js +322 -0
  28. package/dist/index-CjXvuf9m.js +1354 -0
  29. package/dist/index-DD4qF7gq.js +2340 -0
  30. package/dist/index-DeQ-9KTC.js +737 -0
  31. package/dist/index-Df6OBy4E.js +3041 -0
  32. package/dist/index-KRsV2L4V.js +1564 -0
  33. package/dist/index-PUuASE1F.js +2507 -0
  34. package/dist/index-PWsNvJB-.js +546 -0
  35. package/dist/index-UqDmyMSA.js +119 -0
  36. package/dist/index-_0Pj_ZtW.js +459 -0
  37. package/dist/{index-CnXsN5I3.js → index-sr-mWz4T.js} +31 -30
  38. package/dist/index.d.ts +496 -200
  39. package/dist/index.js +462 -439
  40. package/dist/llmProviderPayload-CzihkdNa.js +332 -0
  41. package/dist/schemas-DFScWdSL.js +2969 -0
  42. package/package.json +1 -1
  43. package/dist/index-B47EJCom.js +0 -236
  44. package/dist/index-Bl1Y7Sro.js +0 -3037
  45. package/dist/index-DlS9Lybj.js +0 -80691
@@ -0,0 +1,463 @@
1
+ import { jsx as t, jsxs as i } from "react/jsx-runtime";
2
+ import { useRef as Te, useState as ee, useMemo as V } from "react";
3
+ import { Typography as pe, Stack as d, Form as J, Chip as Ee, IconButton as te, Collapse as be, Skeleton as le, Box as O, ToggleButtonGroup as Ae, ToggleButton as ve, Tooltip as ce, Button as de, TextField as Ce, Alert as Se, Dialog as ze, DialogTitle as Oe, DialogContent as Re, DialogContentText as We, DialogActions as Ie, ListingTable as $, SearchBar as Le } from "@wso2/oxygen-ui";
4
+ import { ChevronUp as De, ChevronDown as Me, HelpCircle as we, Upload as Pe, ChevronsRight as Be, ChevronRight as $e, ChevronLeft as _e, ChevronsLeft as He, FileCode as je, Inbox as Ue, Plus as Fe, AlertTriangle as Ne, Search as Ge } from "@wso2/oxygen-ui-icons-react";
5
+ import { c as me } from "react/compiler-runtime";
6
+ import { S as qe } from "./SwaggerSpecViewer-BvkhoKsi.js";
7
+ function Ye(h) {
8
+ const e = me(63), {
9
+ resource: n,
10
+ isOpen: o,
11
+ selected: v,
12
+ operationSpec: g,
13
+ showSummary: s,
14
+ noSummaryText: y,
15
+ onRowClick: R,
16
+ onToggleOpen: W
17
+ } = h, m = s === void 0 ? !0 : s, I = y === void 0 ? "No summary available." : y;
18
+ let C;
19
+ e: {
20
+ const z = String(n.path ?? "").trim(), ne = String(n.method || "get");
21
+ let oe;
22
+ e[0] !== ne ? (oe = ne.toLowerCase().trim(), e[0] = ne, e[1] = oe) : oe = e[1];
23
+ const G = oe;
24
+ if (!z || !(/* @__PURE__ */ new Set(["get", "post", "put", "delete", "patch", "head", "options"])).has(G)) {
25
+ C = null;
26
+ break e;
27
+ }
28
+ let ae;
29
+ e[2] === Symbol.for("react.memo_cache_sentinel") ? (ae = {
30
+ default: {
31
+ description: "No response details available."
32
+ }
33
+ }, e[2] = ae) : ae = e[2];
34
+ let P;
35
+ e[3] !== n.summary ? (P = {
36
+ responses: ae
37
+ }, n.summary && (P.summary = n.summary), e[3] = n.summary, e[4] = P) : P = e[4];
38
+ const he = `${n.method?.toUpperCase() ?? "GET"} ${z}`;
39
+ let q;
40
+ e[5] !== he ? (q = {
41
+ title: he,
42
+ version: "1.0.0"
43
+ }, e[5] = he, e[6] = q) : q = e[6];
44
+ let Y;
45
+ e[7] !== G || e[8] !== P ? (Y = {
46
+ [G]: P
47
+ }, e[7] = G, e[8] = P, e[9] = Y) : Y = e[9];
48
+ let K;
49
+ e[10] !== z || e[11] !== Y ? (K = {
50
+ [z]: Y
51
+ }, e[10] = z, e[11] = Y, e[12] = K) : K = e[12];
52
+ let se;
53
+ e[13] !== K || e[14] !== q ? (se = {
54
+ openapi: "3.0.3",
55
+ info: q,
56
+ paths: K
57
+ }, e[13] = K, e[14] = q, e[15] = se) : se = e[15], C = se;
58
+ }
59
+ const E = g ?? C, L = String(n.method ?? "GET");
60
+ let w;
61
+ e[16] !== L ? (w = L.toUpperCase(), e[16] = L, e[17] = w) : w = e[17];
62
+ const a = w, p = String(n.path ?? ""), f = a === "GET" || a === "TOOL" ? "info" : a === "POST" || a === "RESOURCE" ? "success" : a === "DELETE" || a === "PROMPT" ? "error" : "default";
63
+ let c;
64
+ e[18] === Symbol.for("react.memo_cache_sentinel") ? (c = {
65
+ width: "100%",
66
+ justifyContent: "flex-start",
67
+ textAlign: "left"
68
+ }, e[18] = c) : c = e[18];
69
+ let b;
70
+ e[19] === Symbol.for("react.memo_cache_sentinel") ? (b = {
71
+ width: "100%",
72
+ minWidth: 0
73
+ }, e[19] = b) : b = e[19];
74
+ let u;
75
+ e[20] === Symbol.for("react.memo_cache_sentinel") ? (u = {
76
+ minWidth: 0
77
+ }, e[20] = u) : u = e[20];
78
+ let _;
79
+ e[21] === Symbol.for("react.memo_cache_sentinel") ? (_ = {
80
+ minWidth: 56,
81
+ justifyContent: "center",
82
+ flexShrink: 0
83
+ }, e[21] = _) : _ = e[21];
84
+ let H;
85
+ e[22] !== f || e[23] !== a ? (H = /* @__PURE__ */ t(Ee, { label: a, size: "small", variant: "outlined", color: f, sx: _ }), e[22] = f, e[23] = a, e[24] = H) : H = e[24];
86
+ let j;
87
+ e[25] === Symbol.for("react.memo_cache_sentinel") ? (j = {
88
+ flex: 1,
89
+ minWidth: 0
90
+ }, e[25] = j) : j = e[25];
91
+ let re;
92
+ e[26] === Symbol.for("react.memo_cache_sentinel") ? (re = {
93
+ fontFamily: "monospace",
94
+ fontWeight: 500,
95
+ minWidth: 0,
96
+ maxWidth: "100%",
97
+ overflow: "hidden",
98
+ textOverflow: "ellipsis",
99
+ whiteSpace: "nowrap"
100
+ }, e[26] = re) : re = e[26];
101
+ let S;
102
+ e[27] !== p ? (S = /* @__PURE__ */ t(pe, { variant: "body2", sx: re, children: p }), e[27] = p, e[28] = S) : S = e[28];
103
+ let A;
104
+ e[29] !== n.summary || e[30] !== m ? (A = m && n.summary && /* @__PURE__ */ t(pe, { variant: "caption", color: "text.secondary", sx: {
105
+ minWidth: 0,
106
+ maxWidth: "100%",
107
+ overflow: "hidden",
108
+ textOverflow: "ellipsis",
109
+ whiteSpace: "nowrap",
110
+ display: "block"
111
+ }, children: n.summary }), e[29] = n.summary, e[30] = m, e[31] = A) : A = e[31];
112
+ let k;
113
+ e[32] !== S || e[33] !== A ? (k = /* @__PURE__ */ i(d, { spacing: 0.25, sx: j, children: [
114
+ S,
115
+ A
116
+ ] }), e[32] = S, e[33] = A, e[34] = k) : k = e[34];
117
+ const X = o ? "Collapse details" : "Expand details";
118
+ let U;
119
+ e[35] !== W ? (U = (z) => {
120
+ z.stopPropagation(), W();
121
+ }, e[35] = W, e[36] = U) : U = e[36];
122
+ let F;
123
+ e[37] !== o ? (F = o ? /* @__PURE__ */ t(De, { size: 18 }) : /* @__PURE__ */ t(Me, { size: 18 }), e[37] = o, e[38] = F) : F = e[38];
124
+ let D;
125
+ e[39] !== X || e[40] !== U || e[41] !== F ? (D = /* @__PURE__ */ t(te, { size: "small", "aria-label": X, onClick: U, children: F }), e[39] = X, e[40] = U, e[41] = F, e[42] = D) : D = e[42];
126
+ let M;
127
+ e[43] !== H || e[44] !== k || e[45] !== D ? (M = /* @__PURE__ */ i(d, { direction: "row", spacing: 1, alignItems: "center", sx: u, children: [
128
+ H,
129
+ k,
130
+ D
131
+ ] }), e[43] = H, e[44] = k, e[45] = D, e[46] = M) : M = e[46];
132
+ let x;
133
+ e[47] !== a || e[48] !== I || e[49] !== p || e[50] !== E || e[51] !== n.summary ? (x = E ? /* @__PURE__ */ t(qe, { spec: E, hideInfoSection: !0, hideServers: !0, hideAuthorizeButton: !0, hideTagHeaders: !1, hideOperationHeader: !1, docExpansion: "full", defaultModelsExpandDepth: -1, displayRequestDuration: !1 }) : /* @__PURE__ */ i(d, { spacing: 0.5, sx: {
134
+ minWidth: 0
135
+ }, children: [
136
+ /* @__PURE__ */ i(pe, { variant: "body2", sx: {
137
+ fontWeight: 600,
138
+ minWidth: 0,
139
+ maxWidth: "100%",
140
+ whiteSpace: "nowrap",
141
+ overflow: "hidden",
142
+ textOverflow: "ellipsis"
143
+ }, children: [
144
+ a,
145
+ " ",
146
+ p
147
+ ] }),
148
+ /* @__PURE__ */ t(pe, { variant: "caption", color: "text.secondary", sx: {
149
+ minWidth: 0,
150
+ maxWidth: "100%",
151
+ whiteSpace: "nowrap",
152
+ overflow: "hidden",
153
+ textOverflow: "ellipsis",
154
+ display: "block"
155
+ }, children: n.summary || I })
156
+ ] }), e[47] = a, e[48] = I, e[49] = p, e[50] = E, e[51] = n.summary, e[52] = x) : x = e[52];
157
+ let T;
158
+ e[53] !== o || e[54] !== x ? (T = /* @__PURE__ */ t(be, { in: o, timeout: "auto", unmountOnExit: !0, children: x }), e[53] = o, e[54] = x, e[55] = T) : T = e[55];
159
+ let N;
160
+ e[56] !== M || e[57] !== T ? (N = /* @__PURE__ */ t(J.CardContent, { sx: b, children: /* @__PURE__ */ i(d, { spacing: 1, children: [
161
+ M,
162
+ T
163
+ ] }) }), e[56] = M, e[57] = T, e[58] = N) : N = e[58];
164
+ let ie;
165
+ return e[59] !== R || e[60] !== v || e[61] !== N ? (ie = /* @__PURE__ */ t(J.CardButton, { selected: v, onClick: R, sx: c, children: N }), e[59] = R, e[60] = v, e[61] = N, e[62] = ie) : ie = e[62], ie;
166
+ }
167
+ const Ke = "Allow all exposes every resource. Exceptions are hidden.", Ve = "Deny all hides every resource. Exceptions are exposed.", nt = ({
168
+ items: h,
169
+ mode: e,
170
+ onModeChange: n,
171
+ exceptionKeys: o,
172
+ onExceptionKeysChange: v,
173
+ isLoading: g = !1,
174
+ isSaving: s = !1,
175
+ isDirty: y,
176
+ onSave: R,
177
+ onDiscard: W,
178
+ status: m,
179
+ onClearStatus: I,
180
+ showImportButton: C = !1,
181
+ onImportSpec: Q,
182
+ availableEmptyTitle: E = "No available resources",
183
+ availableEmptyDescription: L = "Resources will appear here once they are loaded.",
184
+ exceptionsEmptyTitle: w = "No selected resources",
185
+ exceptionsEmptyDescription: a = "Use the arrow buttons to move resources between the lists."
186
+ }) => {
187
+ const p = Te(null), [f, c] = ee(null), [b, u] = ee(!1), [_, H] = ee(""), [j, re] = ee(""), [S, A] = ee([]), [k, X] = ee([]), [U, F] = ee(null), D = V(() => new Set(o), [o]), M = V(() => {
188
+ const l = /* @__PURE__ */ new Map();
189
+ return h.forEach((r) => l.set(r.key, r)), l;
190
+ }, [h]), x = V(() => h.filter((l) => !D.has(l.key)), [h, D]), T = V(() => o.map((l) => M.get(l)).filter((l) => !!l), [o, M]), N = V(() => {
191
+ const l = _.trim().toLowerCase();
192
+ return l ? x.filter((r) => `${r.method} ${r.path} ${r.summary ?? ""}`.toLowerCase().includes(l)) : x;
193
+ }, [x, _]), ie = V(() => {
194
+ const l = j.trim().toLowerCase();
195
+ return l ? T.filter((r) => `${r.method} ${r.path} ${r.summary ?? ""}`.toLowerCase().includes(l)) : T;
196
+ }, [T, j]), z = V(() => new Set(S), [S]), ne = V(() => new Set(k), [k]), oe = (l, r) => {
197
+ !r || r === e || (c(r), u(!0));
198
+ }, G = () => {
199
+ u(!1), c(null);
200
+ }, fe = () => {
201
+ if (!f || f === e) {
202
+ G();
203
+ return;
204
+ }
205
+ n(f), u(!1), c(null);
206
+ }, ae = (l) => {
207
+ A((r) => r.includes(l.key) ? r.filter((Z) => Z !== l.key) : [...r, l.key]);
208
+ }, P = (l) => {
209
+ X((r) => r.includes(l.key) ? r.filter((Z) => Z !== l.key) : [...r, l.key]);
210
+ }, he = () => {
211
+ if (!S.length) return;
212
+ const l = x.filter((r) => z.has(r.key)).map((r) => r.key);
213
+ l.length && (v([...o, ...l]), A([]));
214
+ }, q = () => {
215
+ k.length && (v(o.filter((l) => !ne.has(l))), X([]));
216
+ }, Y = () => {
217
+ v(h.map((l) => l.key)), A([]);
218
+ }, K = () => {
219
+ v([]), X([]);
220
+ }, se = () => p.current?.click(), ke = async (l) => {
221
+ const r = l.target.files?.[0];
222
+ r && Q && await Q(r), l.target.value = "";
223
+ }, ge = (l, r, Z, ue) => /* @__PURE__ */ t(O, { sx: {
224
+ flex: 1,
225
+ minHeight: 0,
226
+ overflowY: "auto",
227
+ pr: 0.5
228
+ }, children: /* @__PURE__ */ i(d, { spacing: 1.25, minHeight: "100%", children: [
229
+ l.map((B) => {
230
+ const xe = U === B.key;
231
+ return /* @__PURE__ */ t(Ye, { resource: {
232
+ method: B.method,
233
+ path: B.path,
234
+ summary: B.summary
235
+ }, isOpen: xe, operationSpec: B.operationSpec, selected: r.has(B.key), onRowClick: () => Z(B), onToggleOpen: () => F(xe ? null : B.key) }, B.key);
236
+ }),
237
+ !l.length && /* @__PURE__ */ t($.Container, { sx: {
238
+ flex: 1,
239
+ minHeight: 0
240
+ }, children: /* @__PURE__ */ t($.EmptyState, { illustration: ue.illustration, title: ue.title, description: ue.description }) })
241
+ ] }) });
242
+ if (g)
243
+ return /* @__PURE__ */ i(d, { spacing: 2, children: [
244
+ /* @__PURE__ */ t(le, { variant: "rounded", height: 48 }),
245
+ /* @__PURE__ */ i(O, { sx: {
246
+ display: "grid",
247
+ gridTemplateColumns: "1fr auto 1fr",
248
+ gap: 2
249
+ }, children: [
250
+ /* @__PURE__ */ t(le, { variant: "rounded", height: 400 }),
251
+ /* @__PURE__ */ t(le, { variant: "rounded", height: 200 }),
252
+ /* @__PURE__ */ t(le, { variant: "rounded", height: 400 })
253
+ ] })
254
+ ] });
255
+ const ye = !!m && (m.severity === "error" || !y);
256
+ return /* @__PURE__ */ i(O, { height: ye ? "calc(100vh - 370px)" : "calc(100vh - 420px)", children: [
257
+ /* @__PURE__ */ i(d, { spacing: 2, children: [
258
+ /* @__PURE__ */ i(O, { sx: {
259
+ display: "flex",
260
+ alignItems: "center",
261
+ justifyContent: "space-between",
262
+ flexWrap: "wrap",
263
+ gap: 2
264
+ }, children: [
265
+ /* @__PURE__ */ i(O, { sx: {
266
+ display: "flex",
267
+ alignItems: "center",
268
+ gap: 1.5
269
+ }, children: [
270
+ /* @__PURE__ */ t(pe, { variant: "body1", children: "Mode" }),
271
+ /* @__PURE__ */ i(Ae, { size: "small", value: e, exclusive: !0, onChange: oe, children: [
272
+ /* @__PURE__ */ i(ve, { color: "primary", value: "allow", sx: {
273
+ textTransform: "none"
274
+ }, children: [
275
+ "Allow all",
276
+ /* @__PURE__ */ t(ce, { arrow: !0, title: Ke, children: /* @__PURE__ */ t(te, { size: "small", children: /* @__PURE__ */ t(we, { size: 16 }) }) })
277
+ ] }),
278
+ /* @__PURE__ */ i(ve, { color: "primary", value: "deny", sx: {
279
+ textTransform: "none"
280
+ }, children: [
281
+ "Deny all",
282
+ /* @__PURE__ */ t(ce, { arrow: !0, title: Ve, children: /* @__PURE__ */ t(te, { size: "small", children: /* @__PURE__ */ t(we, { size: 16 }) }) })
283
+ ] })
284
+ ] })
285
+ ] }),
286
+ C && /* @__PURE__ */ i(O, { sx: {
287
+ display: "flex",
288
+ alignItems: "center",
289
+ gap: 1
290
+ }, children: [
291
+ /* @__PURE__ */ t(de, { variant: "outlined", size: "small", startIcon: /* @__PURE__ */ t(Pe, { size: 16 }), onClick: se, disabled: s, children: "Import from specification" }),
292
+ /* @__PURE__ */ t("input", { ref: p, type: "file", hidden: !0, accept: ".json,.yaml,.yml", onChange: ke })
293
+ ] })
294
+ ] }),
295
+ /* @__PURE__ */ i(O, { sx: {
296
+ display: "grid",
297
+ gridTemplateColumns: {
298
+ xs: "1fr",
299
+ md: "1fr auto 1fr"
300
+ },
301
+ gap: 2
302
+ }, children: [
303
+ /* @__PURE__ */ t(O, { sx: {
304
+ display: "flex",
305
+ flexDirection: "column",
306
+ overflow: "hidden",
307
+ overflowY: "scroll",
308
+ flex: 1,
309
+ minHeight: 0
310
+ }, children: /* @__PURE__ */ i(J.Section, { children: [
311
+ /* @__PURE__ */ t(J.Header, { children: e === "allow" ? "Allowed Resources" : "Denied Resources" }),
312
+ /* @__PURE__ */ i(J.Stack, { spacing: 1.5, height: "calc(100vh - 620px)", children: [
313
+ /* @__PURE__ */ t(Ce, { size: "small", placeholder: "Search resources", value: _, fullWidth: !0, onChange: (l) => H(l.target.value) }),
314
+ ge(N, z, ae, {
315
+ illustration: /* @__PURE__ */ t(je, { size: 64 }),
316
+ title: E,
317
+ description: L
318
+ })
319
+ ] })
320
+ ] }) }),
321
+ /* @__PURE__ */ t(O, { sx: {
322
+ display: "flex",
323
+ alignItems: "flex-start",
324
+ justifyContent: "center",
325
+ marginTop: 15
326
+ }, children: /* @__PURE__ */ i(d, { spacing: 1, children: [
327
+ /* @__PURE__ */ t(ce, { title: "Move all to exceptions", arrow: !0, children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(te, { size: "small", onClick: Y, disabled: !x.length || s, sx: {
328
+ border: "1px solid",
329
+ borderColor: "divider"
330
+ }, children: /* @__PURE__ */ t(Be, { size: 18 }) }) }) }),
331
+ /* @__PURE__ */ t(ce, { title: "Move selected to exceptions", arrow: !0, children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(te, { size: "small", onClick: he, disabled: !S.length || s, sx: {
332
+ border: "1px solid",
333
+ borderColor: "divider"
334
+ }, children: /* @__PURE__ */ t($e, { size: 18 }) }) }) }),
335
+ /* @__PURE__ */ t(ce, { title: "Move selected to available", arrow: !0, children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(te, { size: "small", onClick: q, disabled: !k.length || s, sx: {
336
+ border: "1px solid",
337
+ borderColor: "divider"
338
+ }, children: /* @__PURE__ */ t(_e, { size: 18 }) }) }) }),
339
+ /* @__PURE__ */ t(ce, { title: "Move all to available", arrow: !0, children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(te, { size: "small", onClick: K, disabled: !T.length || s, sx: {
340
+ border: "1px solid",
341
+ borderColor: "divider"
342
+ }, children: /* @__PURE__ */ t(He, { size: 18 }) }) }) })
343
+ ] }) }),
344
+ /* @__PURE__ */ i(J.Section, { children: [
345
+ /* @__PURE__ */ t(J.Header, { children: e === "allow" ? "Denied Resources" : "Allowed Resources" }),
346
+ /* @__PURE__ */ i(J.Stack, { spacing: 1.5, height: "calc(100vh - 620px)", children: [
347
+ /* @__PURE__ */ t(Ce, { size: "small", placeholder: "Search resources", value: j, fullWidth: !0, onChange: (l) => re(l.target.value) }),
348
+ ge(ie, ne, P, {
349
+ illustration: /* @__PURE__ */ t(Ue, { size: 64 }),
350
+ title: w,
351
+ description: a
352
+ })
353
+ ] })
354
+ ] })
355
+ ] }),
356
+ /* @__PURE__ */ i(d, { spacing: 1.5, width: "100%", children: [
357
+ /* @__PURE__ */ t(be, { in: ye, timeout: 300, children: m && /* @__PURE__ */ t(Se, { severity: m.severity, onClose: I, sx: {
358
+ width: "100%"
359
+ }, children: m.message }) }),
360
+ /* @__PURE__ */ i(d, { direction: "row", spacing: 1.5, justifyContent: "flex-end", children: [
361
+ /* @__PURE__ */ t(de, { variant: "outlined", onClick: W, disabled: !y || s, children: "Discard" }),
362
+ /* @__PURE__ */ t(de, { variant: "contained", onClick: R, disabled: !y || s, children: s ? "Saving..." : "Save" })
363
+ ] })
364
+ ] })
365
+ ] }),
366
+ /* @__PURE__ */ i(ze, { open: b, onClose: G, maxWidth: "sm", fullWidth: !0, children: [
367
+ /* @__PURE__ */ t(Oe, { children: "Confirm Resource Mode Change" }),
368
+ /* @__PURE__ */ t(Re, { children: /* @__PURE__ */ i(We, { children: [
369
+ "Change resource mode from ",
370
+ e === "allow" ? "Allow all" : "Deny all",
371
+ " to",
372
+ " ",
373
+ f === "allow" ? "Allow all" : "Deny all",
374
+ "?"
375
+ ] }) }),
376
+ /* @__PURE__ */ i(Ie, { children: [
377
+ /* @__PURE__ */ t(de, { onClick: G, children: "Cancel" }),
378
+ /* @__PURE__ */ t(de, { variant: "contained", onClick: fe, disabled: !f || s, children: "Apply" })
379
+ ] })
380
+ ] })
381
+ ] });
382
+ }, Je = 5;
383
+ function Qe() {
384
+ const h = me(1);
385
+ let e;
386
+ return h[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ t(d, { spacing: 1, mt: 1, children: Array.from({
387
+ length: Je
388
+ }).map(Xe) }), h[0] = e) : e = h[0], e;
389
+ }
390
+ function Xe(h, e) {
391
+ return /* @__PURE__ */ i(d, { direction: "row", alignItems: "center", spacing: 2, sx: {
392
+ px: 2,
393
+ py: 1.5,
394
+ borderRadius: 1,
395
+ border: "1px solid",
396
+ borderColor: "divider",
397
+ bgcolor: "background.paper"
398
+ }, children: [
399
+ /* @__PURE__ */ t(le, { variant: "circular", width: 36, height: 36 }),
400
+ /* @__PURE__ */ t(le, { variant: "text", width: 180, height: 20 }),
401
+ /* @__PURE__ */ t(le, { variant: "text", sx: {
402
+ flex: 1
403
+ }, height: 18 })
404
+ ] }, e);
405
+ }
406
+ const ot = (h) => {
407
+ const e = me(20), {
408
+ searchValue: n,
409
+ onSearchChange: o,
410
+ searchPlaceholder: v,
411
+ addButton: g,
412
+ toolbar: s,
413
+ error: y,
414
+ isLoading: R,
415
+ isEmpty: W,
416
+ isSearchEmpty: m,
417
+ loadingPlaceholder: I,
418
+ emptyState: C,
419
+ searchEmptyState: Q,
420
+ children: E
421
+ } = h, L = v === void 0 ? "Search..." : v;
422
+ let w;
423
+ e[0] !== g || e[1] !== o || e[2] !== L || e[3] !== n || e[4] !== s ? (w = s ?? /* @__PURE__ */ i(d, { direction: "row", spacing: 1, alignItems: "center", children: [
424
+ /* @__PURE__ */ t(O, { flexGrow: 1, children: /* @__PURE__ */ t(Le, { placeholder: L, size: "small", fullWidth: !0, value: n, onChange: (u) => o(u.target.value) }, "search-bar") }),
425
+ g && /* @__PURE__ */ t(de, { ...g.component ? {
426
+ component: g.component,
427
+ to: g.to
428
+ } : {}, onClick: g.onClick, variant: "contained", color: "primary", startIcon: /* @__PURE__ */ t(Fe, { size: 16 }), children: g.label })
429
+ ] }), e[0] = g, e[1] = o, e[2] = L, e[3] = n, e[4] = s, e[5] = w) : w = e[5];
430
+ const a = w;
431
+ let p;
432
+ e[6] !== E || e[7] !== C || e[8] !== y || e[9] !== W || e[10] !== R || e[11] !== m || e[12] !== I || e[13] !== Q ? (p = () => {
433
+ if (y)
434
+ return /* @__PURE__ */ t($.Container, { children: /* @__PURE__ */ t(Se, { severity: "error", icon: /* @__PURE__ */ t(Ne, { size: 18 }), sx: {
435
+ alignSelf: "stretch"
436
+ }, children: y instanceof Error ? y.message : "Failed to load. Please try again." }) });
437
+ if (R)
438
+ return /* @__PURE__ */ t($.Container, { disablePaper: !0, children: I ?? /* @__PURE__ */ t(Qe, {}) });
439
+ if (W)
440
+ return /* @__PURE__ */ t($.Container, { children: /* @__PURE__ */ t($.EmptyState, { illustration: C.illustration, title: C.title, description: C.description }) });
441
+ if (m) {
442
+ const u = Q ?? {
443
+ illustration: /* @__PURE__ */ t(Ge, { size: 64 }),
444
+ title: "No results match your search",
445
+ description: "Try a different keyword or clear the search filter."
446
+ };
447
+ return /* @__PURE__ */ t($.Container, { children: /* @__PURE__ */ t($.EmptyState, { illustration: u.illustration, title: u.title, description: u.description }) });
448
+ }
449
+ return /* @__PURE__ */ t($.Container, { disablePaper: !0, children: /* @__PURE__ */ t(d, { pt: 4, children: E }) });
450
+ }, e[6] = E, e[7] = C, e[8] = y, e[9] = W, e[10] = R, e[11] = m, e[12] = I, e[13] = Q, e[14] = p) : p = e[14];
451
+ const f = p;
452
+ let c;
453
+ e[15] !== f ? (c = f(), e[15] = f, e[16] = c) : c = e[16];
454
+ let b;
455
+ return e[17] !== a || e[18] !== c ? (b = /* @__PURE__ */ i(d, { spacing: 1, children: [
456
+ a,
457
+ c
458
+ ] }), e[17] = a, e[18] = c, e[19] = b) : b = e[19], b;
459
+ };
460
+ export {
461
+ nt as A,
462
+ ot as R
463
+ };
@@ -0,0 +1,106 @@
1
+ import { jsx as I } from "react/jsx-runtime";
2
+ import { c as $ } from "react/compiler-runtime";
3
+ import { Suspense as F, lazy as G } from "react";
4
+ const J = G(() => import("./index-BnV-PkwM.js")), K = J;
5
+ function ae(U) {
6
+ const e = $(39), {
7
+ spec: _,
8
+ url: c,
9
+ className: W,
10
+ docExpansion: O,
11
+ defaultModelsExpandDepth: M,
12
+ displayRequestDuration: N,
13
+ hideInfoSection: q,
14
+ hideServers: A,
15
+ hideAuthorizeButton: P,
16
+ hideTagHeaders: R,
17
+ hideOperationHeader: T
18
+ } = U, w = O === void 0 ? "list" : O, y = M === void 0 ? -1 : M, b = N === void 0 ? !0 : N, i = q === void 0 ? !1 : q, a = A === void 0 ? !1 : A, u = P === void 0 ? !1 : P, L = R === void 0 ? !1 : R, V = T === void 0 ? !1 : T;
19
+ let x;
20
+ e: {
21
+ let o, t;
22
+ e[0] !== u || e[1] !== a ? (t = {}, o = {}, a && (t.servers = ie), u && (o.authorizeBtn = ne, t.securityDefinitions = ee, t.schemes = Y), e[0] = u, e[1] = a, e[2] = o, e[3] = t) : (o = e[2], t = e[3]);
23
+ const g = Object.keys(t).length > 0, v = i || Object.keys(o).length > 0;
24
+ if (!g && !v) {
25
+ x = void 0;
26
+ break e;
27
+ }
28
+ let l;
29
+ if (e[4] !== v || e[5] !== g || e[6] !== i || e[7] !== o || e[8] !== t) {
30
+ if (l = {}, g) {
31
+ let n;
32
+ e[10] !== t ? (n = {
33
+ spec: {
34
+ wrapSelectors: t
35
+ }
36
+ }, e[10] = t, e[11] = n) : n = e[11], l.statePlugins = n;
37
+ }
38
+ if (v) {
39
+ let n;
40
+ e[12] !== i ? (n = i ? {
41
+ info: Q
42
+ } : {}, e[12] = i, e[13] = n) : n = e[13];
43
+ let S;
44
+ e[14] !== n || e[15] !== o ? (S = {
45
+ ...n,
46
+ ...o
47
+ }, e[14] = n, e[15] = o, e[16] = S) : S = e[16], l.wrapComponents = S;
48
+ }
49
+ e[4] = v, e[5] = g, e[6] = i, e[7] = o, e[8] = t, e[9] = l;
50
+ } else
51
+ l = e[9];
52
+ x = l;
53
+ }
54
+ const d = x;
55
+ let f;
56
+ e[17] !== d ? (f = d ? [d] : void 0, e[17] = d, e[18] = f) : f = e[18];
57
+ const z = f, C = i ? "hide-info-section" : "", D = a ? "hide-servers" : "", j = u ? "hide-authorize" : "", k = L ? "hide-tag-headers" : "", B = V ? "hide-operation-header" : "", E = W ?? "";
58
+ let p;
59
+ e[19] !== C || e[20] !== D || e[21] !== j || e[22] !== k || e[23] !== B || e[24] !== E ? (p = ["swagger-spec-viewer", C, D, j, k, B, E].filter(Boolean), e[19] = C, e[20] = D, e[21] = j, e[22] = k, e[23] = B, e[24] = E, e[25] = p) : p = e[25];
60
+ const H = p.join(" ");
61
+ let s;
62
+ e[26] !== _ || e[27] !== c ? (s = c ? {
63
+ url: c
64
+ } : {
65
+ spec: _
66
+ }, e[26] = _, e[27] = c, e[28] = s) : s = e[28];
67
+ let h;
68
+ e[29] === Symbol.for("react.memo_cache_sentinel") ? (h = [], e[29] = h) : h = e[29];
69
+ let r;
70
+ e[30] !== y || e[31] !== b || e[32] !== w || e[33] !== z || e[34] !== s ? (r = /* @__PURE__ */ I(K, { ...s, docExpansion: w, defaultModelsExpandDepth: y, displayRequestDuration: b, supportedSubmitMethods: h, plugins: z }), e[30] = y, e[31] = b, e[32] = w, e[33] = z, e[34] = s, e[35] = r) : r = e[35];
71
+ let m;
72
+ return e[36] !== H || e[37] !== r ? (m = /* @__PURE__ */ I(F, { fallback: null, children: /* @__PURE__ */ I("div", { className: H, children: r }) }), e[36] = H, e[37] = r, e[38] = m) : m = e[38], m;
73
+ }
74
+ function Q() {
75
+ return X;
76
+ }
77
+ function X() {
78
+ return null;
79
+ }
80
+ function Y() {
81
+ return Z;
82
+ }
83
+ function Z() {
84
+ return [];
85
+ }
86
+ function ee() {
87
+ return te;
88
+ }
89
+ function te() {
90
+ return null;
91
+ }
92
+ function ne() {
93
+ return oe;
94
+ }
95
+ function oe() {
96
+ return null;
97
+ }
98
+ function ie() {
99
+ return se;
100
+ }
101
+ function se() {
102
+ return [];
103
+ }
104
+ export {
105
+ ae as S
106
+ };
@@ -0,0 +1,23 @@
1
+ import { c } from "react/compiler-runtime";
2
+ async function o(t) {
3
+ if (typeof navigator > "u" || !navigator.clipboard?.writeText)
4
+ return !1;
5
+ try {
6
+ return await navigator.clipboard.writeText(t), !0;
7
+ } catch {
8
+ return !1;
9
+ }
10
+ }
11
+ function f(t) {
12
+ const r = c(2);
13
+ let e;
14
+ return r[0] !== t ? (e = (a, i) => {
15
+ o(a).then((n) => {
16
+ n && t(a, i);
17
+ });
18
+ }, r[0] = t, r[1] = e) : e = r[1], e;
19
+ }
20
+ export {
21
+ o as c,
22
+ f as u
23
+ };