@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
@@ -1,2475 +0,0 @@
1
- import { jsx as f, jsxs as C, Fragment as sn } from "react/jsx-runtime";
2
- import { c as me } from "react/compiler-runtime";
3
- import { useState as Z, useMemo as pe, useEffect as ke, useCallback as tn, useRef as xi } from "react";
4
- import { Stack as _, Form as ce, TextField as ge, IconButton as Bn, Button as ae, Typography as H, MenuItem as hr, Select as yi, FormHelperText as mr, FormControl as vi, Switch as Ai, Chip as gr, Accordion as Sn, AccordionSummary as Tn, AccordionDetails as Fn, Box as Re, Card as xr, Skeleton as xe, Alert as yr, SearchBar as bi, CardContent as Ci, Avatar as wi, Tooltip as In, ListingTable as Ne } from "@wso2/oxygen-ui";
5
- import { Trash2 as vr, Plus as fn, ChevronDown as On, ShieldAlert as Nn, Check as Ei, Circle as _i, Search as Si, ArrowLeft as bn, ShieldCheck as Ti, Trash as Fi } from "@wso2/oxygen-ui-icons-react";
6
- import { bj as Ii, cm as Oi, q as Ni, n as Li, D as Di, m as ki, cn as Ri, N as ji } from "./index-B_Z0MwXk.js";
7
- import "@tanstack/react-query";
8
- function $n(e, n = "", r = 0, t = []) {
9
- const i = [];
10
- if (e.type === "object" && e.properties) {
11
- const o = e.required || [];
12
- Object.entries(e.properties).forEach(([l, a]) => {
13
- const c = n ? `${n}.${l}` : l, u = o.includes(l) || t.includes(l), p = {
14
- id: c,
15
- path: c,
16
- name: l,
17
- schema: a,
18
- depth: r,
19
- isRequired: u,
20
- isExpanded: !1
21
- };
22
- a.type === "object" && a.properties ? p.children = $n(a, c, r + 1, a.required || []) : a.type === "array" && (p.isArrayContainer = !0), i.push(p);
23
- });
24
- }
25
- return i;
26
- }
27
- function ue(e, n) {
28
- if (!n) return e;
29
- const r = n.split(".");
30
- let t = e;
31
- for (const i of r) {
32
- if (t == null) return;
33
- if (typeof t == "object")
34
- t = t[i];
35
- else
36
- return;
37
- }
38
- return t;
39
- }
40
- function Cn(e, n, r) {
41
- if (!n) return r;
42
- const t = n.split("."), i = {
43
- ...e
44
- };
45
- let o = i;
46
- for (let a = 0; a < t.length - 1; a++) {
47
- const c = t[a], u = t[a + 1], p = /^\d+$/.test(u), s = o[c];
48
- s == null || typeof s != "object" ? o[c] = p ? [] : {} : Array.isArray(s) ? o[c] = [...s] : o[c] = {
49
- ...s
50
- }, o = o[c];
51
- }
52
- const l = t[t.length - 1];
53
- return o[l] = r, i;
54
- }
55
- function Mi(e, n) {
56
- const r = n.anyOf ?? n.oneOf ?? [];
57
- return r.length === 0 ? !1 : r.some((t) => t.properties?.[e]?.const === !1 && t.required?.includes(e));
58
- }
59
- function Pi(e, n) {
60
- return (n.anyOf ?? n.oneOf ?? []).some((t) => t.required?.includes(e));
61
- }
62
- function je(e) {
63
- return e == null || e === "" || typeof e == "string" && e.trim().length === 0 ? !1 : Array.isArray(e) ? e.some(je) : typeof e == "object" ? Object.values(e).some(je) : !0;
64
- }
65
- function Ye(e, n) {
66
- const r = n ? {
67
- ...n
68
- } : {};
69
- return e.type === "object" && e.properties && Object.entries(e.properties).forEach(([t, i]) => {
70
- if (r[t] === void 0)
71
- if (t === "jsonPath")
72
- r[t] = "";
73
- else if (i.type === "boolean" && Mi(t, e))
74
- r[t] = !1;
75
- else if (i.default !== void 0)
76
- r[t] = i.default;
77
- else if (i.type === "object" && i.properties) {
78
- if (Pi(t, e))
79
- return;
80
- r[t] = Ye(i);
81
- } else i.type === "array" ? r[t] = [] : i.type === "boolean" ? r[t] = !1 : i.type === "number" || i.type === "integer" ? r[t] = i.minimum ?? i.maximum ?? "" : r[t] = "";
82
- else i.type === "object" && i.properties && typeof r[t] == "object" && (r[t] = Ye(i, r[t]));
83
- }), r;
84
- }
85
- function Gn(e, n) {
86
- if (e == null || typeof e == "string" && /\$\{.+\}/.test(e)) return e;
87
- switch (n.type) {
88
- case "boolean": {
89
- if (typeof e == "boolean") return e;
90
- if (typeof e == "string") {
91
- if (e.toLowerCase() === "true") return !0;
92
- if (e.toLowerCase() === "false") return !1;
93
- }
94
- return e;
95
- }
96
- case "number": {
97
- if (typeof e == "number") return e;
98
- if (typeof e == "string" && e !== "") {
99
- const r = parseFloat(e);
100
- if (!Number.isNaN(r)) return r;
101
- }
102
- return e;
103
- }
104
- case "integer": {
105
- if (typeof e == "number") return e;
106
- if (typeof e == "string" && e !== "") {
107
- const r = parseInt(e, 10);
108
- if (!Number.isNaN(r)) return r;
109
- }
110
- return e;
111
- }
112
- case "object":
113
- return typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" && e === "" ? {} : e;
114
- default:
115
- return e;
116
- }
117
- }
118
- function Bi(e, n) {
119
- if (e.length === 0) return;
120
- const r = e.map((i) => new Set(i.required ?? []));
121
- let t = -1;
122
- r.forEach((i, o) => {
123
- if (t >= 0) return;
124
- let l = i.size > 0;
125
- i.forEach((a) => {
126
- const c = n[a];
127
- je(c) || (l = !1);
128
- }), l && (t = o);
129
- }), r.forEach((i, o) => {
130
- o !== t && i.forEach((l) => {
131
- const a = n[l];
132
- je(a) || delete n[l];
133
- });
134
- });
135
- }
136
- function Ln(e, n) {
137
- if (e.type !== "object" || !e.properties) return n;
138
- const r = {
139
- ...n
140
- };
141
- Object.entries(e.properties).forEach(([i, o]) => {
142
- const l = r[i];
143
- l !== void 0 && (o.type === "object" && o.properties && typeof l == "object" && l !== null && !Array.isArray(l) ? r[i] = Ln(o, l) : o.type === "array" && Array.isArray(l) && o.items ? r[i] = l.map((a) => o.items.type === "object" && o.items.properties && typeof a == "object" && a !== null ? Ln(o.items, a) : Gn(a, o.items)) : r[i] = Gn(l, o));
144
- });
145
- const t = e.oneOf ?? e.anyOf ?? [];
146
- return t.length > 0 && Bi(t, r), r;
147
- }
148
- function $i(e) {
149
- return e.type === "object" && e.properties ? Ye(e) : e.type === "string" ? e.default ?? "" : e.type === "boolean" ? e.default ?? !1 : e.type === "number" || e.type === "integer" ? e.default !== void 0 ? e.default : e.minimum ?? e.maximum ?? "" : e.type === "array" ? [] : null;
150
- }
151
- /*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */
152
- function Ar(e) {
153
- return typeof e > "u" || e === null;
154
- }
155
- function Yi(e) {
156
- return typeof e == "object" && e !== null;
157
- }
158
- function Hi(e) {
159
- return Array.isArray(e) ? e : Ar(e) ? [] : [e];
160
- }
161
- function qi(e, n) {
162
- var r, t, i, o;
163
- if (n)
164
- for (o = Object.keys(n), r = 0, t = o.length; r < t; r += 1)
165
- i = o[r], e[i] = n[i];
166
- return e;
167
- }
168
- function zi(e, n) {
169
- var r = "", t;
170
- for (t = 0; t < n; t += 1)
171
- r += e;
172
- return r;
173
- }
174
- function Ui(e) {
175
- return e === 0 && Number.NEGATIVE_INFINITY === 1 / e;
176
- }
177
- var Ki = Ar, Wi = Yi, Vi = Hi, Gi = zi, Qi = Ui, Xi = qi, Y = {
178
- isNothing: Ki,
179
- isObject: Wi,
180
- toArray: Vi,
181
- repeat: Gi,
182
- isNegativeZero: Qi,
183
- extend: Xi
184
- };
185
- function br(e, n) {
186
- var r = "", t = e.reason || "(unknown reason)";
187
- return e.mark ? (e.mark.name && (r += 'in "' + e.mark.name + '" '), r += "(" + (e.mark.line + 1) + ":" + (e.mark.column + 1) + ")", !n && e.mark.snippet && (r += `
188
-
189
- ` + e.mark.snippet), t + " " + r) : t;
190
- }
191
- function He(e, n) {
192
- Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = n, this.message = br(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || "";
193
- }
194
- He.prototype = Object.create(Error.prototype);
195
- He.prototype.constructor = He;
196
- He.prototype.toString = function(n) {
197
- return this.name + ": " + br(this, n);
198
- };
199
- var X = He;
200
- function wn(e, n, r, t, i) {
201
- var o = "", l = "", a = Math.floor(i / 2) - 1;
202
- return t - n > a && (o = " ... ", n = t - a + o.length), r - t > a && (l = " ...", r = t + a - l.length), {
203
- str: o + e.slice(n, r).replace(/\t/g, "→") + l,
204
- pos: t - n + o.length
205
- // relative position
206
- };
207
- }
208
- function En(e, n) {
209
- return Y.repeat(" ", n - e.length) + e;
210
- }
211
- function Zi(e, n) {
212
- if (n = Object.create(n || null), !e.buffer) return null;
213
- n.maxLength || (n.maxLength = 79), typeof n.indent != "number" && (n.indent = 1), typeof n.linesBefore != "number" && (n.linesBefore = 3), typeof n.linesAfter != "number" && (n.linesAfter = 2);
214
- for (var r = /\r?\n|\r|\0/g, t = [0], i = [], o, l = -1; o = r.exec(e.buffer); )
215
- i.push(o.index), t.push(o.index + o[0].length), e.position <= o.index && l < 0 && (l = t.length - 2);
216
- l < 0 && (l = t.length - 1);
217
- var a = "", c, u, p = Math.min(e.line + n.linesAfter, i.length).toString().length, s = n.maxLength - (n.indent + p + 3);
218
- for (c = 1; c <= n.linesBefore && !(l - c < 0); c++)
219
- u = wn(
220
- e.buffer,
221
- t[l - c],
222
- i[l - c],
223
- e.position - (t[l] - t[l - c]),
224
- s
225
- ), a = Y.repeat(" ", n.indent) + En((e.line - c + 1).toString(), p) + " | " + u.str + `
226
- ` + a;
227
- for (u = wn(e.buffer, t[l], i[l], e.position, s), a += Y.repeat(" ", n.indent) + En((e.line + 1).toString(), p) + " | " + u.str + `
228
- `, a += Y.repeat("-", n.indent + p + 3 + u.pos) + `^
229
- `, c = 1; c <= n.linesAfter && !(l + c >= i.length); c++)
230
- u = wn(
231
- e.buffer,
232
- t[l + c],
233
- i[l + c],
234
- e.position - (t[l] - t[l + c]),
235
- s
236
- ), a += Y.repeat(" ", n.indent) + En((e.line + c + 1).toString(), p) + " | " + u.str + `
237
- `;
238
- return a.replace(/\n$/, "");
239
- }
240
- var Ji = Zi, et = [
241
- "kind",
242
- "multi",
243
- "resolve",
244
- "construct",
245
- "instanceOf",
246
- "predicate",
247
- "represent",
248
- "representName",
249
- "defaultStyle",
250
- "styleAliases"
251
- ], nt = [
252
- "scalar",
253
- "sequence",
254
- "mapping"
255
- ];
256
- function rt(e) {
257
- var n = {};
258
- return e !== null && Object.keys(e).forEach(function(r) {
259
- e[r].forEach(function(t) {
260
- n[String(t)] = r;
261
- });
262
- }), n;
263
- }
264
- function it(e, n) {
265
- if (n = n || {}, Object.keys(n).forEach(function(r) {
266
- if (et.indexOf(r) === -1)
267
- throw new X('Unknown option "' + r + '" is met in definition of "' + e + '" YAML type.');
268
- }), this.options = n, this.tag = e, this.kind = n.kind || null, this.resolve = n.resolve || function() {
269
- return !0;
270
- }, this.construct = n.construct || function(r) {
271
- return r;
272
- }, this.instanceOf = n.instanceOf || null, this.predicate = n.predicate || null, this.represent = n.represent || null, this.representName = n.representName || null, this.defaultStyle = n.defaultStyle || null, this.multi = n.multi || !1, this.styleAliases = rt(n.styleAliases || null), nt.indexOf(this.kind) === -1)
273
- throw new X('Unknown kind "' + this.kind + '" is specified for "' + e + '" YAML type.');
274
- }
275
- var W = it;
276
- function Qn(e, n) {
277
- var r = [];
278
- return e[n].forEach(function(t) {
279
- var i = r.length;
280
- r.forEach(function(o, l) {
281
- o.tag === t.tag && o.kind === t.kind && o.multi === t.multi && (i = l);
282
- }), r[i] = t;
283
- }), r;
284
- }
285
- function tt() {
286
- var e = {
287
- scalar: {},
288
- sequence: {},
289
- mapping: {},
290
- fallback: {},
291
- multi: {
292
- scalar: [],
293
- sequence: [],
294
- mapping: [],
295
- fallback: []
296
- }
297
- }, n, r;
298
- function t(i) {
299
- i.multi ? (e.multi[i.kind].push(i), e.multi.fallback.push(i)) : e[i.kind][i.tag] = e.fallback[i.tag] = i;
300
- }
301
- for (n = 0, r = arguments.length; n < r; n += 1)
302
- arguments[n].forEach(t);
303
- return e;
304
- }
305
- function Dn(e) {
306
- return this.extend(e);
307
- }
308
- Dn.prototype.extend = function(n) {
309
- var r = [], t = [];
310
- if (n instanceof W)
311
- t.push(n);
312
- else if (Array.isArray(n))
313
- t = t.concat(n);
314
- else if (n && (Array.isArray(n.implicit) || Array.isArray(n.explicit)))
315
- n.implicit && (r = r.concat(n.implicit)), n.explicit && (t = t.concat(n.explicit));
316
- else
317
- throw new X("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
318
- r.forEach(function(o) {
319
- if (!(o instanceof W))
320
- throw new X("Specified list of YAML types (or a single Type object) contains a non-Type object.");
321
- if (o.loadKind && o.loadKind !== "scalar")
322
- throw new X("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
323
- if (o.multi)
324
- throw new X("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
325
- }), t.forEach(function(o) {
326
- if (!(o instanceof W))
327
- throw new X("Specified list of YAML types (or a single Type object) contains a non-Type object.");
328
- });
329
- var i = Object.create(Dn.prototype);
330
- return i.implicit = (this.implicit || []).concat(r), i.explicit = (this.explicit || []).concat(t), i.compiledImplicit = Qn(i, "implicit"), i.compiledExplicit = Qn(i, "explicit"), i.compiledTypeMap = tt(i.compiledImplicit, i.compiledExplicit), i;
331
- };
332
- var Cr = Dn, wr = new W("tag:yaml.org,2002:str", {
333
- kind: "scalar",
334
- construct: function(e) {
335
- return e !== null ? e : "";
336
- }
337
- }), Er = new W("tag:yaml.org,2002:seq", {
338
- kind: "sequence",
339
- construct: function(e) {
340
- return e !== null ? e : [];
341
- }
342
- }), _r = new W("tag:yaml.org,2002:map", {
343
- kind: "mapping",
344
- construct: function(e) {
345
- return e !== null ? e : {};
346
- }
347
- }), Sr = new Cr({
348
- explicit: [
349
- wr,
350
- Er,
351
- _r
352
- ]
353
- });
354
- function lt(e) {
355
- if (e === null) return !0;
356
- var n = e.length;
357
- return n === 1 && e === "~" || n === 4 && (e === "null" || e === "Null" || e === "NULL");
358
- }
359
- function ot() {
360
- return null;
361
- }
362
- function at(e) {
363
- return e === null;
364
- }
365
- var Tr = new W("tag:yaml.org,2002:null", {
366
- kind: "scalar",
367
- resolve: lt,
368
- construct: ot,
369
- predicate: at,
370
- represent: {
371
- canonical: function() {
372
- return "~";
373
- },
374
- lowercase: function() {
375
- return "null";
376
- },
377
- uppercase: function() {
378
- return "NULL";
379
- },
380
- camelcase: function() {
381
- return "Null";
382
- },
383
- empty: function() {
384
- return "";
385
- }
386
- },
387
- defaultStyle: "lowercase"
388
- });
389
- function ct(e) {
390
- if (e === null) return !1;
391
- var n = e.length;
392
- return n === 4 && (e === "true" || e === "True" || e === "TRUE") || n === 5 && (e === "false" || e === "False" || e === "FALSE");
393
- }
394
- function ut(e) {
395
- return e === "true" || e === "True" || e === "TRUE";
396
- }
397
- function st(e) {
398
- return Object.prototype.toString.call(e) === "[object Boolean]";
399
- }
400
- var Fr = new W("tag:yaml.org,2002:bool", {
401
- kind: "scalar",
402
- resolve: ct,
403
- construct: ut,
404
- predicate: st,
405
- represent: {
406
- lowercase: function(e) {
407
- return e ? "true" : "false";
408
- },
409
- uppercase: function(e) {
410
- return e ? "TRUE" : "FALSE";
411
- },
412
- camelcase: function(e) {
413
- return e ? "True" : "False";
414
- }
415
- },
416
- defaultStyle: "lowercase"
417
- });
418
- function ft(e) {
419
- return 48 <= e && e <= 57 || 65 <= e && e <= 70 || 97 <= e && e <= 102;
420
- }
421
- function pt(e) {
422
- return 48 <= e && e <= 55;
423
- }
424
- function dt(e) {
425
- return 48 <= e && e <= 57;
426
- }
427
- function ht(e) {
428
- if (e === null) return !1;
429
- var n = e.length, r = 0, t = !1, i;
430
- if (!n) return !1;
431
- if (i = e[r], (i === "-" || i === "+") && (i = e[++r]), i === "0") {
432
- if (r + 1 === n) return !0;
433
- if (i = e[++r], i === "b") {
434
- for (r++; r < n; r++)
435
- if (i = e[r], i !== "_") {
436
- if (i !== "0" && i !== "1") return !1;
437
- t = !0;
438
- }
439
- return t && i !== "_";
440
- }
441
- if (i === "x") {
442
- for (r++; r < n; r++)
443
- if (i = e[r], i !== "_") {
444
- if (!ft(e.charCodeAt(r))) return !1;
445
- t = !0;
446
- }
447
- return t && i !== "_";
448
- }
449
- if (i === "o") {
450
- for (r++; r < n; r++)
451
- if (i = e[r], i !== "_") {
452
- if (!pt(e.charCodeAt(r))) return !1;
453
- t = !0;
454
- }
455
- return t && i !== "_";
456
- }
457
- }
458
- if (i === "_") return !1;
459
- for (; r < n; r++)
460
- if (i = e[r], i !== "_") {
461
- if (!dt(e.charCodeAt(r)))
462
- return !1;
463
- t = !0;
464
- }
465
- return !(!t || i === "_");
466
- }
467
- function mt(e) {
468
- var n = e, r = 1, t;
469
- if (n.indexOf("_") !== -1 && (n = n.replace(/_/g, "")), t = n[0], (t === "-" || t === "+") && (t === "-" && (r = -1), n = n.slice(1), t = n[0]), n === "0") return 0;
470
- if (t === "0") {
471
- if (n[1] === "b") return r * parseInt(n.slice(2), 2);
472
- if (n[1] === "x") return r * parseInt(n.slice(2), 16);
473
- if (n[1] === "o") return r * parseInt(n.slice(2), 8);
474
- }
475
- return r * parseInt(n, 10);
476
- }
477
- function gt(e) {
478
- return Object.prototype.toString.call(e) === "[object Number]" && e % 1 === 0 && !Y.isNegativeZero(e);
479
- }
480
- var Ir = new W("tag:yaml.org,2002:int", {
481
- kind: "scalar",
482
- resolve: ht,
483
- construct: mt,
484
- predicate: gt,
485
- represent: {
486
- binary: function(e) {
487
- return e >= 0 ? "0b" + e.toString(2) : "-0b" + e.toString(2).slice(1);
488
- },
489
- octal: function(e) {
490
- return e >= 0 ? "0o" + e.toString(8) : "-0o" + e.toString(8).slice(1);
491
- },
492
- decimal: function(e) {
493
- return e.toString(10);
494
- },
495
- /* eslint-disable max-len */
496
- hexadecimal: function(e) {
497
- return e >= 0 ? "0x" + e.toString(16).toUpperCase() : "-0x" + e.toString(16).toUpperCase().slice(1);
498
- }
499
- },
500
- defaultStyle: "decimal",
501
- styleAliases: {
502
- binary: [2, "bin"],
503
- octal: [8, "oct"],
504
- decimal: [10, "dec"],
505
- hexadecimal: [16, "hex"]
506
- }
507
- }), xt = new RegExp(
508
- // 2.5e4, 2.5 and integers
509
- "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
510
- );
511
- function yt(e) {
512
- return !(e === null || !xt.test(e) || // Quick hack to not allow integers end with `_`
513
- // Probably should update regexp & check speed
514
- e[e.length - 1] === "_");
515
- }
516
- function vt(e) {
517
- var n, r;
518
- return n = e.replace(/_/g, "").toLowerCase(), r = n[0] === "-" ? -1 : 1, "+-".indexOf(n[0]) >= 0 && (n = n.slice(1)), n === ".inf" ? r === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : n === ".nan" ? NaN : r * parseFloat(n, 10);
519
- }
520
- var At = /^[-+]?[0-9]+e/;
521
- function bt(e, n) {
522
- var r;
523
- if (isNaN(e))
524
- switch (n) {
525
- case "lowercase":
526
- return ".nan";
527
- case "uppercase":
528
- return ".NAN";
529
- case "camelcase":
530
- return ".NaN";
531
- }
532
- else if (Number.POSITIVE_INFINITY === e)
533
- switch (n) {
534
- case "lowercase":
535
- return ".inf";
536
- case "uppercase":
537
- return ".INF";
538
- case "camelcase":
539
- return ".Inf";
540
- }
541
- else if (Number.NEGATIVE_INFINITY === e)
542
- switch (n) {
543
- case "lowercase":
544
- return "-.inf";
545
- case "uppercase":
546
- return "-.INF";
547
- case "camelcase":
548
- return "-.Inf";
549
- }
550
- else if (Y.isNegativeZero(e))
551
- return "-0.0";
552
- return r = e.toString(10), At.test(r) ? r.replace("e", ".e") : r;
553
- }
554
- function Ct(e) {
555
- return Object.prototype.toString.call(e) === "[object Number]" && (e % 1 !== 0 || Y.isNegativeZero(e));
556
- }
557
- var Or = new W("tag:yaml.org,2002:float", {
558
- kind: "scalar",
559
- resolve: yt,
560
- construct: vt,
561
- predicate: Ct,
562
- represent: bt,
563
- defaultStyle: "lowercase"
564
- }), Nr = Sr.extend({
565
- implicit: [
566
- Tr,
567
- Fr,
568
- Ir,
569
- Or
570
- ]
571
- }), Lr = Nr, Dr = new RegExp(
572
- "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
573
- ), kr = new RegExp(
574
- "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
575
- );
576
- function wt(e) {
577
- return e === null ? !1 : Dr.exec(e) !== null || kr.exec(e) !== null;
578
- }
579
- function Et(e) {
580
- var n, r, t, i, o, l, a, c = 0, u = null, p, s, h;
581
- if (n = Dr.exec(e), n === null && (n = kr.exec(e)), n === null) throw new Error("Date resolve error");
582
- if (r = +n[1], t = +n[2] - 1, i = +n[3], !n[4])
583
- return new Date(Date.UTC(r, t, i));
584
- if (o = +n[4], l = +n[5], a = +n[6], n[7]) {
585
- for (c = n[7].slice(0, 3); c.length < 3; )
586
- c += "0";
587
- c = +c;
588
- }
589
- return n[9] && (p = +n[10], s = +(n[11] || 0), u = (p * 60 + s) * 6e4, n[9] === "-" && (u = -u)), h = new Date(Date.UTC(r, t, i, o, l, a, c)), u && h.setTime(h.getTime() - u), h;
590
- }
591
- function _t(e) {
592
- return e.toISOString();
593
- }
594
- var Rr = new W("tag:yaml.org,2002:timestamp", {
595
- kind: "scalar",
596
- resolve: wt,
597
- construct: Et,
598
- instanceOf: Date,
599
- represent: _t
600
- });
601
- function St(e) {
602
- return e === "<<" || e === null;
603
- }
604
- var jr = new W("tag:yaml.org,2002:merge", {
605
- kind: "scalar",
606
- resolve: St
607
- }), Yn = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
608
- \r`;
609
- function Tt(e) {
610
- if (e === null) return !1;
611
- var n, r, t = 0, i = e.length, o = Yn;
612
- for (r = 0; r < i; r++)
613
- if (n = o.indexOf(e.charAt(r)), !(n > 64)) {
614
- if (n < 0) return !1;
615
- t += 6;
616
- }
617
- return t % 8 === 0;
618
- }
619
- function Ft(e) {
620
- var n, r, t = e.replace(/[\r\n=]/g, ""), i = t.length, o = Yn, l = 0, a = [];
621
- for (n = 0; n < i; n++)
622
- n % 4 === 0 && n && (a.push(l >> 16 & 255), a.push(l >> 8 & 255), a.push(l & 255)), l = l << 6 | o.indexOf(t.charAt(n));
623
- return r = i % 4 * 6, r === 0 ? (a.push(l >> 16 & 255), a.push(l >> 8 & 255), a.push(l & 255)) : r === 18 ? (a.push(l >> 10 & 255), a.push(l >> 2 & 255)) : r === 12 && a.push(l >> 4 & 255), new Uint8Array(a);
624
- }
625
- function It(e) {
626
- var n = "", r = 0, t, i, o = e.length, l = Yn;
627
- for (t = 0; t < o; t++)
628
- t % 3 === 0 && t && (n += l[r >> 18 & 63], n += l[r >> 12 & 63], n += l[r >> 6 & 63], n += l[r & 63]), r = (r << 8) + e[t];
629
- return i = o % 3, i === 0 ? (n += l[r >> 18 & 63], n += l[r >> 12 & 63], n += l[r >> 6 & 63], n += l[r & 63]) : i === 2 ? (n += l[r >> 10 & 63], n += l[r >> 4 & 63], n += l[r << 2 & 63], n += l[64]) : i === 1 && (n += l[r >> 2 & 63], n += l[r << 4 & 63], n += l[64], n += l[64]), n;
630
- }
631
- function Ot(e) {
632
- return Object.prototype.toString.call(e) === "[object Uint8Array]";
633
- }
634
- var Mr = new W("tag:yaml.org,2002:binary", {
635
- kind: "scalar",
636
- resolve: Tt,
637
- construct: Ft,
638
- predicate: Ot,
639
- represent: It
640
- }), Nt = Object.prototype.hasOwnProperty, Lt = Object.prototype.toString;
641
- function Dt(e) {
642
- if (e === null) return !0;
643
- var n = [], r, t, i, o, l, a = e;
644
- for (r = 0, t = a.length; r < t; r += 1) {
645
- if (i = a[r], l = !1, Lt.call(i) !== "[object Object]") return !1;
646
- for (o in i)
647
- if (Nt.call(i, o))
648
- if (!l) l = !0;
649
- else return !1;
650
- if (!l) return !1;
651
- if (n.indexOf(o) === -1) n.push(o);
652
- else return !1;
653
- }
654
- return !0;
655
- }
656
- function kt(e) {
657
- return e !== null ? e : [];
658
- }
659
- var Pr = new W("tag:yaml.org,2002:omap", {
660
- kind: "sequence",
661
- resolve: Dt,
662
- construct: kt
663
- }), Rt = Object.prototype.toString;
664
- function jt(e) {
665
- if (e === null) return !0;
666
- var n, r, t, i, o, l = e;
667
- for (o = new Array(l.length), n = 0, r = l.length; n < r; n += 1) {
668
- if (t = l[n], Rt.call(t) !== "[object Object]" || (i = Object.keys(t), i.length !== 1)) return !1;
669
- o[n] = [i[0], t[i[0]]];
670
- }
671
- return !0;
672
- }
673
- function Mt(e) {
674
- if (e === null) return [];
675
- var n, r, t, i, o, l = e;
676
- for (o = new Array(l.length), n = 0, r = l.length; n < r; n += 1)
677
- t = l[n], i = Object.keys(t), o[n] = [i[0], t[i[0]]];
678
- return o;
679
- }
680
- var Br = new W("tag:yaml.org,2002:pairs", {
681
- kind: "sequence",
682
- resolve: jt,
683
- construct: Mt
684
- }), Pt = Object.prototype.hasOwnProperty;
685
- function Bt(e) {
686
- if (e === null) return !0;
687
- var n, r = e;
688
- for (n in r)
689
- if (Pt.call(r, n) && r[n] !== null)
690
- return !1;
691
- return !0;
692
- }
693
- function $t(e) {
694
- return e !== null ? e : {};
695
- }
696
- var $r = new W("tag:yaml.org,2002:set", {
697
- kind: "mapping",
698
- resolve: Bt,
699
- construct: $t
700
- }), Hn = Lr.extend({
701
- implicit: [
702
- Rr,
703
- jr
704
- ],
705
- explicit: [
706
- Mr,
707
- Pr,
708
- Br,
709
- $r
710
- ]
711
- }), he = Object.prototype.hasOwnProperty, ln = 1, Yr = 2, Hr = 3, on = 4, _n = 1, Yt = 2, Xn = 3, Ht = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, qt = /[\x85\u2028\u2029]/, zt = /[,\[\]\{\}]/, qr = /^(?:!|!!|![a-z\-]+!)$/i, zr = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
712
- function Zn(e) {
713
- return Object.prototype.toString.call(e);
714
- }
715
- function oe(e) {
716
- return e === 10 || e === 13;
717
- }
718
- function ye(e) {
719
- return e === 9 || e === 32;
720
- }
721
- function J(e) {
722
- return e === 9 || e === 32 || e === 10 || e === 13;
723
- }
724
- function Le(e) {
725
- return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
726
- }
727
- function Ut(e) {
728
- var n;
729
- return 48 <= e && e <= 57 ? e - 48 : (n = e | 32, 97 <= n && n <= 102 ? n - 97 + 10 : -1);
730
- }
731
- function Kt(e) {
732
- return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
733
- }
734
- function Wt(e) {
735
- return 48 <= e && e <= 57 ? e - 48 : -1;
736
- }
737
- function Jn(e) {
738
- return e === 48 ? "\0" : e === 97 ? "\x07" : e === 98 ? "\b" : e === 116 || e === 9 ? " " : e === 110 ? `
739
- ` : e === 118 ? "\v" : e === 102 ? "\f" : e === 114 ? "\r" : e === 101 ? "\x1B" : e === 32 ? " " : e === 34 ? '"' : e === 47 ? "/" : e === 92 ? "\\" : e === 78 ? "…" : e === 95 ? " " : e === 76 ? "\u2028" : e === 80 ? "\u2029" : "";
740
- }
741
- function Vt(e) {
742
- return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode(
743
- (e - 65536 >> 10) + 55296,
744
- (e - 65536 & 1023) + 56320
745
- );
746
- }
747
- function Ur(e, n, r) {
748
- n === "__proto__" ? Object.defineProperty(e, n, {
749
- configurable: !0,
750
- enumerable: !0,
751
- writable: !0,
752
- value: r
753
- }) : e[n] = r;
754
- }
755
- var Kr = new Array(256), Wr = new Array(256);
756
- for (var Ie = 0; Ie < 256; Ie++)
757
- Kr[Ie] = Jn(Ie) ? 1 : 0, Wr[Ie] = Jn(Ie);
758
- function Gt(e, n) {
759
- this.input = e, this.filename = n.filename || null, this.schema = n.schema || Hn, this.onWarning = n.onWarning || null, this.legacy = n.legacy || !1, this.json = n.json || !1, this.listener = n.listener || null, this.implicitTypes = this.schema.compiledImplicit, this.typeMap = this.schema.compiledTypeMap, this.length = e.length, this.position = 0, this.line = 0, this.lineStart = 0, this.lineIndent = 0, this.firstTabInLine = -1, this.documents = [];
760
- }
761
- function Vr(e, n) {
762
- var r = {
763
- name: e.filename,
764
- buffer: e.input.slice(0, -1),
765
- // omit trailing \0
766
- position: e.position,
767
- line: e.line,
768
- column: e.position - e.lineStart
769
- };
770
- return r.snippet = Ji(r), new X(n, r);
771
- }
772
- function v(e, n) {
773
- throw Vr(e, n);
774
- }
775
- function an(e, n) {
776
- e.onWarning && e.onWarning.call(null, Vr(e, n));
777
- }
778
- var er = {
779
- YAML: function(n, r, t) {
780
- var i, o, l;
781
- n.version !== null && v(n, "duplication of %YAML directive"), t.length !== 1 && v(n, "YAML directive accepts exactly one argument"), i = /^([0-9]+)\.([0-9]+)$/.exec(t[0]), i === null && v(n, "ill-formed argument of the YAML directive"), o = parseInt(i[1], 10), l = parseInt(i[2], 10), o !== 1 && v(n, "unacceptable YAML version of the document"), n.version = t[0], n.checkLineBreaks = l < 2, l !== 1 && l !== 2 && an(n, "unsupported YAML version of the document");
782
- },
783
- TAG: function(n, r, t) {
784
- var i, o;
785
- t.length !== 2 && v(n, "TAG directive accepts exactly two arguments"), i = t[0], o = t[1], qr.test(i) || v(n, "ill-formed tag handle (first argument) of the TAG directive"), he.call(n.tagMap, i) && v(n, 'there is a previously declared suffix for "' + i + '" tag handle'), zr.test(o) || v(n, "ill-formed tag prefix (second argument) of the TAG directive");
786
- try {
787
- o = decodeURIComponent(o);
788
- } catch {
789
- v(n, "tag prefix is malformed: " + o);
790
- }
791
- n.tagMap[i] = o;
792
- }
793
- };
794
- function de(e, n, r, t) {
795
- var i, o, l, a;
796
- if (n < r) {
797
- if (a = e.input.slice(n, r), t)
798
- for (i = 0, o = a.length; i < o; i += 1)
799
- l = a.charCodeAt(i), l === 9 || 32 <= l && l <= 1114111 || v(e, "expected valid JSON character");
800
- else Ht.test(a) && v(e, "the stream contains non-printable characters");
801
- e.result += a;
802
- }
803
- }
804
- function nr(e, n, r, t) {
805
- var i, o, l, a;
806
- for (Y.isObject(r) || v(e, "cannot merge mappings; the provided source object is unacceptable"), i = Object.keys(r), l = 0, a = i.length; l < a; l += 1)
807
- o = i[l], he.call(n, o) || (Ur(n, o, r[o]), t[o] = !0);
808
- }
809
- function De(e, n, r, t, i, o, l, a, c) {
810
- var u, p;
811
- if (Array.isArray(i))
812
- for (i = Array.prototype.slice.call(i), u = 0, p = i.length; u < p; u += 1)
813
- Array.isArray(i[u]) && v(e, "nested arrays are not supported inside keys"), typeof i == "object" && Zn(i[u]) === "[object Object]" && (i[u] = "[object Object]");
814
- if (typeof i == "object" && Zn(i) === "[object Object]" && (i = "[object Object]"), i = String(i), n === null && (n = {}), t === "tag:yaml.org,2002:merge")
815
- if (Array.isArray(o))
816
- for (u = 0, p = o.length; u < p; u += 1)
817
- nr(e, n, o[u], r);
818
- else
819
- nr(e, n, o, r);
820
- else
821
- !e.json && !he.call(r, i) && he.call(n, i) && (e.line = l || e.line, e.lineStart = a || e.lineStart, e.position = c || e.position, v(e, "duplicated mapping key")), Ur(n, i, o), delete r[i];
822
- return n;
823
- }
824
- function qn(e) {
825
- var n;
826
- n = e.input.charCodeAt(e.position), n === 10 ? e.position++ : n === 13 ? (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++) : v(e, "a line break is expected"), e.line += 1, e.lineStart = e.position, e.firstTabInLine = -1;
827
- }
828
- function B(e, n, r) {
829
- for (var t = 0, i = e.input.charCodeAt(e.position); i !== 0; ) {
830
- for (; ye(i); )
831
- i === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), i = e.input.charCodeAt(++e.position);
832
- if (n && i === 35)
833
- do
834
- i = e.input.charCodeAt(++e.position);
835
- while (i !== 10 && i !== 13 && i !== 0);
836
- if (oe(i))
837
- for (qn(e), i = e.input.charCodeAt(e.position), t++, e.lineIndent = 0; i === 32; )
838
- e.lineIndent++, i = e.input.charCodeAt(++e.position);
839
- else
840
- break;
841
- }
842
- return r !== -1 && t !== 0 && e.lineIndent < r && an(e, "deficient indentation"), t;
843
- }
844
- function pn(e) {
845
- var n = e.position, r;
846
- return r = e.input.charCodeAt(n), !!((r === 45 || r === 46) && r === e.input.charCodeAt(n + 1) && r === e.input.charCodeAt(n + 2) && (n += 3, r = e.input.charCodeAt(n), r === 0 || J(r)));
847
- }
848
- function zn(e, n) {
849
- n === 1 ? e.result += " " : n > 1 && (e.result += Y.repeat(`
850
- `, n - 1));
851
- }
852
- function Qt(e, n, r) {
853
- var t, i, o, l, a, c, u, p, s = e.kind, h = e.result, d;
854
- if (d = e.input.charCodeAt(e.position), J(d) || Le(d) || d === 35 || d === 38 || d === 42 || d === 33 || d === 124 || d === 62 || d === 39 || d === 34 || d === 37 || d === 64 || d === 96 || (d === 63 || d === 45) && (i = e.input.charCodeAt(e.position + 1), J(i) || r && Le(i)))
855
- return !1;
856
- for (e.kind = "scalar", e.result = "", o = l = e.position, a = !1; d !== 0; ) {
857
- if (d === 58) {
858
- if (i = e.input.charCodeAt(e.position + 1), J(i) || r && Le(i))
859
- break;
860
- } else if (d === 35) {
861
- if (t = e.input.charCodeAt(e.position - 1), J(t))
862
- break;
863
- } else {
864
- if (e.position === e.lineStart && pn(e) || r && Le(d))
865
- break;
866
- if (oe(d))
867
- if (c = e.line, u = e.lineStart, p = e.lineIndent, B(e, !1, -1), e.lineIndent >= n) {
868
- a = !0, d = e.input.charCodeAt(e.position);
869
- continue;
870
- } else {
871
- e.position = l, e.line = c, e.lineStart = u, e.lineIndent = p;
872
- break;
873
- }
874
- }
875
- a && (de(e, o, l, !1), zn(e, e.line - c), o = l = e.position, a = !1), ye(d) || (l = e.position + 1), d = e.input.charCodeAt(++e.position);
876
- }
877
- return de(e, o, l, !1), e.result ? !0 : (e.kind = s, e.result = h, !1);
878
- }
879
- function Xt(e, n) {
880
- var r, t, i;
881
- if (r = e.input.charCodeAt(e.position), r !== 39)
882
- return !1;
883
- for (e.kind = "scalar", e.result = "", e.position++, t = i = e.position; (r = e.input.charCodeAt(e.position)) !== 0; )
884
- if (r === 39)
885
- if (de(e, t, e.position, !0), r = e.input.charCodeAt(++e.position), r === 39)
886
- t = e.position, e.position++, i = e.position;
887
- else
888
- return !0;
889
- else oe(r) ? (de(e, t, i, !0), zn(e, B(e, !1, n)), t = i = e.position) : e.position === e.lineStart && pn(e) ? v(e, "unexpected end of the document within a single quoted scalar") : (e.position++, i = e.position);
890
- v(e, "unexpected end of the stream within a single quoted scalar");
891
- }
892
- function Zt(e, n) {
893
- var r, t, i, o, l, a;
894
- if (a = e.input.charCodeAt(e.position), a !== 34)
895
- return !1;
896
- for (e.kind = "scalar", e.result = "", e.position++, r = t = e.position; (a = e.input.charCodeAt(e.position)) !== 0; ) {
897
- if (a === 34)
898
- return de(e, r, e.position, !0), e.position++, !0;
899
- if (a === 92) {
900
- if (de(e, r, e.position, !0), a = e.input.charCodeAt(++e.position), oe(a))
901
- B(e, !1, n);
902
- else if (a < 256 && Kr[a])
903
- e.result += Wr[a], e.position++;
904
- else if ((l = Kt(a)) > 0) {
905
- for (i = l, o = 0; i > 0; i--)
906
- a = e.input.charCodeAt(++e.position), (l = Ut(a)) >= 0 ? o = (o << 4) + l : v(e, "expected hexadecimal character");
907
- e.result += Vt(o), e.position++;
908
- } else
909
- v(e, "unknown escape sequence");
910
- r = t = e.position;
911
- } else oe(a) ? (de(e, r, t, !0), zn(e, B(e, !1, n)), r = t = e.position) : e.position === e.lineStart && pn(e) ? v(e, "unexpected end of the document within a double quoted scalar") : (e.position++, t = e.position);
912
- }
913
- v(e, "unexpected end of the stream within a double quoted scalar");
914
- }
915
- function Jt(e, n) {
916
- var r = !0, t, i, o, l = e.tag, a, c = e.anchor, u, p, s, h, d, m = /* @__PURE__ */ Object.create(null), g, y, A, x;
917
- if (x = e.input.charCodeAt(e.position), x === 91)
918
- p = 93, d = !1, a = [];
919
- else if (x === 123)
920
- p = 125, d = !0, a = {};
921
- else
922
- return !1;
923
- for (e.anchor !== null && (e.anchorMap[e.anchor] = a), x = e.input.charCodeAt(++e.position); x !== 0; ) {
924
- if (B(e, !0, n), x = e.input.charCodeAt(e.position), x === p)
925
- return e.position++, e.tag = l, e.anchor = c, e.kind = d ? "mapping" : "sequence", e.result = a, !0;
926
- r ? x === 44 && v(e, "expected the node content, but found ','") : v(e, "missed comma between flow collection entries"), y = g = A = null, s = h = !1, x === 63 && (u = e.input.charCodeAt(e.position + 1), J(u) && (s = h = !0, e.position++, B(e, !0, n))), t = e.line, i = e.lineStart, o = e.position, Me(e, n, ln, !1, !0), y = e.tag, g = e.result, B(e, !0, n), x = e.input.charCodeAt(e.position), (h || e.line === t) && x === 58 && (s = !0, x = e.input.charCodeAt(++e.position), B(e, !0, n), Me(e, n, ln, !1, !0), A = e.result), d ? De(e, a, m, y, g, A, t, i, o) : s ? a.push(De(e, null, m, y, g, A, t, i, o)) : a.push(g), B(e, !0, n), x = e.input.charCodeAt(e.position), x === 44 ? (r = !0, x = e.input.charCodeAt(++e.position)) : r = !1;
927
- }
928
- v(e, "unexpected end of the stream within a flow collection");
929
- }
930
- function el(e, n) {
931
- var r, t, i = _n, o = !1, l = !1, a = n, c = 0, u = !1, p, s;
932
- if (s = e.input.charCodeAt(e.position), s === 124)
933
- t = !1;
934
- else if (s === 62)
935
- t = !0;
936
- else
937
- return !1;
938
- for (e.kind = "scalar", e.result = ""; s !== 0; )
939
- if (s = e.input.charCodeAt(++e.position), s === 43 || s === 45)
940
- _n === i ? i = s === 43 ? Xn : Yt : v(e, "repeat of a chomping mode identifier");
941
- else if ((p = Wt(s)) >= 0)
942
- p === 0 ? v(e, "bad explicit indentation width of a block scalar; it cannot be less than one") : l ? v(e, "repeat of an indentation width identifier") : (a = n + p - 1, l = !0);
943
- else
944
- break;
945
- if (ye(s)) {
946
- do
947
- s = e.input.charCodeAt(++e.position);
948
- while (ye(s));
949
- if (s === 35)
950
- do
951
- s = e.input.charCodeAt(++e.position);
952
- while (!oe(s) && s !== 0);
953
- }
954
- for (; s !== 0; ) {
955
- for (qn(e), e.lineIndent = 0, s = e.input.charCodeAt(e.position); (!l || e.lineIndent < a) && s === 32; )
956
- e.lineIndent++, s = e.input.charCodeAt(++e.position);
957
- if (!l && e.lineIndent > a && (a = e.lineIndent), oe(s)) {
958
- c++;
959
- continue;
960
- }
961
- if (e.lineIndent < a) {
962
- i === Xn ? e.result += Y.repeat(`
963
- `, o ? 1 + c : c) : i === _n && o && (e.result += `
964
- `);
965
- break;
966
- }
967
- for (t ? ye(s) ? (u = !0, e.result += Y.repeat(`
968
- `, o ? 1 + c : c)) : u ? (u = !1, e.result += Y.repeat(`
969
- `, c + 1)) : c === 0 ? o && (e.result += " ") : e.result += Y.repeat(`
970
- `, c) : e.result += Y.repeat(`
971
- `, o ? 1 + c : c), o = !0, l = !0, c = 0, r = e.position; !oe(s) && s !== 0; )
972
- s = e.input.charCodeAt(++e.position);
973
- de(e, r, e.position, !1);
974
- }
975
- return !0;
976
- }
977
- function rr(e, n) {
978
- var r, t = e.tag, i = e.anchor, o = [], l, a = !1, c;
979
- if (e.firstTabInLine !== -1) return !1;
980
- for (e.anchor !== null && (e.anchorMap[e.anchor] = o), c = e.input.charCodeAt(e.position); c !== 0 && (e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, v(e, "tab characters must not be used in indentation")), !(c !== 45 || (l = e.input.charCodeAt(e.position + 1), !J(l)))); ) {
981
- if (a = !0, e.position++, B(e, !0, -1) && e.lineIndent <= n) {
982
- o.push(null), c = e.input.charCodeAt(e.position);
983
- continue;
984
- }
985
- if (r = e.line, Me(e, n, Hr, !1, !0), o.push(e.result), B(e, !0, -1), c = e.input.charCodeAt(e.position), (e.line === r || e.lineIndent > n) && c !== 0)
986
- v(e, "bad indentation of a sequence entry");
987
- else if (e.lineIndent < n)
988
- break;
989
- }
990
- return a ? (e.tag = t, e.anchor = i, e.kind = "sequence", e.result = o, !0) : !1;
991
- }
992
- function nl(e, n, r) {
993
- var t, i, o, l, a, c, u = e.tag, p = e.anchor, s = {}, h = /* @__PURE__ */ Object.create(null), d = null, m = null, g = null, y = !1, A = !1, x;
994
- if (e.firstTabInLine !== -1) return !1;
995
- for (e.anchor !== null && (e.anchorMap[e.anchor] = s), x = e.input.charCodeAt(e.position); x !== 0; ) {
996
- if (!y && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, v(e, "tab characters must not be used in indentation")), t = e.input.charCodeAt(e.position + 1), o = e.line, (x === 63 || x === 58) && J(t))
997
- x === 63 ? (y && (De(e, s, h, d, m, null, l, a, c), d = m = g = null), A = !0, y = !0, i = !0) : y ? (y = !1, i = !0) : v(e, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), e.position += 1, x = t;
998
- else {
999
- if (l = e.line, a = e.lineStart, c = e.position, !Me(e, r, Yr, !1, !0))
1000
- break;
1001
- if (e.line === o) {
1002
- for (x = e.input.charCodeAt(e.position); ye(x); )
1003
- x = e.input.charCodeAt(++e.position);
1004
- if (x === 58)
1005
- x = e.input.charCodeAt(++e.position), J(x) || v(e, "a whitespace character is expected after the key-value separator within a block mapping"), y && (De(e, s, h, d, m, null, l, a, c), d = m = g = null), A = !0, y = !1, i = !1, d = e.tag, m = e.result;
1006
- else if (A)
1007
- v(e, "can not read an implicit mapping pair; a colon is missed");
1008
- else
1009
- return e.tag = u, e.anchor = p, !0;
1010
- } else if (A)
1011
- v(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
1012
- else
1013
- return e.tag = u, e.anchor = p, !0;
1014
- }
1015
- if ((e.line === o || e.lineIndent > n) && (y && (l = e.line, a = e.lineStart, c = e.position), Me(e, n, on, !0, i) && (y ? m = e.result : g = e.result), y || (De(e, s, h, d, m, g, l, a, c), d = m = g = null), B(e, !0, -1), x = e.input.charCodeAt(e.position)), (e.line === o || e.lineIndent > n) && x !== 0)
1016
- v(e, "bad indentation of a mapping entry");
1017
- else if (e.lineIndent < n)
1018
- break;
1019
- }
1020
- return y && De(e, s, h, d, m, null, l, a, c), A && (e.tag = u, e.anchor = p, e.kind = "mapping", e.result = s), A;
1021
- }
1022
- function rl(e) {
1023
- var n, r = !1, t = !1, i, o, l;
1024
- if (l = e.input.charCodeAt(e.position), l !== 33) return !1;
1025
- if (e.tag !== null && v(e, "duplication of a tag property"), l = e.input.charCodeAt(++e.position), l === 60 ? (r = !0, l = e.input.charCodeAt(++e.position)) : l === 33 ? (t = !0, i = "!!", l = e.input.charCodeAt(++e.position)) : i = "!", n = e.position, r) {
1026
- do
1027
- l = e.input.charCodeAt(++e.position);
1028
- while (l !== 0 && l !== 62);
1029
- e.position < e.length ? (o = e.input.slice(n, e.position), l = e.input.charCodeAt(++e.position)) : v(e, "unexpected end of the stream within a verbatim tag");
1030
- } else {
1031
- for (; l !== 0 && !J(l); )
1032
- l === 33 && (t ? v(e, "tag suffix cannot contain exclamation marks") : (i = e.input.slice(n - 1, e.position + 1), qr.test(i) || v(e, "named tag handle cannot contain such characters"), t = !0, n = e.position + 1)), l = e.input.charCodeAt(++e.position);
1033
- o = e.input.slice(n, e.position), zt.test(o) && v(e, "tag suffix cannot contain flow indicator characters");
1034
- }
1035
- o && !zr.test(o) && v(e, "tag name cannot contain such characters: " + o);
1036
- try {
1037
- o = decodeURIComponent(o);
1038
- } catch {
1039
- v(e, "tag name is malformed: " + o);
1040
- }
1041
- return r ? e.tag = o : he.call(e.tagMap, i) ? e.tag = e.tagMap[i] + o : i === "!" ? e.tag = "!" + o : i === "!!" ? e.tag = "tag:yaml.org,2002:" + o : v(e, 'undeclared tag handle "' + i + '"'), !0;
1042
- }
1043
- function il(e) {
1044
- var n, r;
1045
- if (r = e.input.charCodeAt(e.position), r !== 38) return !1;
1046
- for (e.anchor !== null && v(e, "duplication of an anchor property"), r = e.input.charCodeAt(++e.position), n = e.position; r !== 0 && !J(r) && !Le(r); )
1047
- r = e.input.charCodeAt(++e.position);
1048
- return e.position === n && v(e, "name of an anchor node must contain at least one character"), e.anchor = e.input.slice(n, e.position), !0;
1049
- }
1050
- function tl(e) {
1051
- var n, r, t;
1052
- if (t = e.input.charCodeAt(e.position), t !== 42) return !1;
1053
- for (t = e.input.charCodeAt(++e.position), n = e.position; t !== 0 && !J(t) && !Le(t); )
1054
- t = e.input.charCodeAt(++e.position);
1055
- return e.position === n && v(e, "name of an alias node must contain at least one character"), r = e.input.slice(n, e.position), he.call(e.anchorMap, r) || v(e, 'unidentified alias "' + r + '"'), e.result = e.anchorMap[r], B(e, !0, -1), !0;
1056
- }
1057
- function Me(e, n, r, t, i) {
1058
- var o, l, a, c = 1, u = !1, p = !1, s, h, d, m, g, y;
1059
- if (e.listener !== null && e.listener("open", e), e.tag = null, e.anchor = null, e.kind = null, e.result = null, o = l = a = on === r || Hr === r, t && B(e, !0, -1) && (u = !0, e.lineIndent > n ? c = 1 : e.lineIndent === n ? c = 0 : e.lineIndent < n && (c = -1)), c === 1)
1060
- for (; rl(e) || il(e); )
1061
- B(e, !0, -1) ? (u = !0, a = o, e.lineIndent > n ? c = 1 : e.lineIndent === n ? c = 0 : e.lineIndent < n && (c = -1)) : a = !1;
1062
- if (a && (a = u || i), (c === 1 || on === r) && (ln === r || Yr === r ? g = n : g = n + 1, y = e.position - e.lineStart, c === 1 ? a && (rr(e, y) || nl(e, y, g)) || Jt(e, g) ? p = !0 : (l && el(e, g) || Xt(e, g) || Zt(e, g) ? p = !0 : tl(e) ? (p = !0, (e.tag !== null || e.anchor !== null) && v(e, "alias node should not have any properties")) : Qt(e, g, ln === r) && (p = !0, e.tag === null && (e.tag = "?")), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : c === 0 && (p = a && rr(e, y))), e.tag === null)
1063
- e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
1064
- else if (e.tag === "?") {
1065
- for (e.result !== null && e.kind !== "scalar" && v(e, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + e.kind + '"'), s = 0, h = e.implicitTypes.length; s < h; s += 1)
1066
- if (m = e.implicitTypes[s], m.resolve(e.result)) {
1067
- e.result = m.construct(e.result), e.tag = m.tag, e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
1068
- break;
1069
- }
1070
- } else if (e.tag !== "!") {
1071
- if (he.call(e.typeMap[e.kind || "fallback"], e.tag))
1072
- m = e.typeMap[e.kind || "fallback"][e.tag];
1073
- else
1074
- for (m = null, d = e.typeMap.multi[e.kind || "fallback"], s = 0, h = d.length; s < h; s += 1)
1075
- if (e.tag.slice(0, d[s].tag.length) === d[s].tag) {
1076
- m = d[s];
1077
- break;
1078
- }
1079
- m || v(e, "unknown tag !<" + e.tag + ">"), e.result !== null && m.kind !== e.kind && v(e, "unacceptable node kind for !<" + e.tag + '> tag; it should be "' + m.kind + '", not "' + e.kind + '"'), m.resolve(e.result, e.tag) ? (e.result = m.construct(e.result, e.tag), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : v(e, "cannot resolve a node with !<" + e.tag + "> explicit tag");
1080
- }
1081
- return e.listener !== null && e.listener("close", e), e.tag !== null || e.anchor !== null || p;
1082
- }
1083
- function ll(e) {
1084
- var n = e.position, r, t, i, o = !1, l;
1085
- for (e.version = null, e.checkLineBreaks = e.legacy, e.tagMap = /* @__PURE__ */ Object.create(null), e.anchorMap = /* @__PURE__ */ Object.create(null); (l = e.input.charCodeAt(e.position)) !== 0 && (B(e, !0, -1), l = e.input.charCodeAt(e.position), !(e.lineIndent > 0 || l !== 37)); ) {
1086
- for (o = !0, l = e.input.charCodeAt(++e.position), r = e.position; l !== 0 && !J(l); )
1087
- l = e.input.charCodeAt(++e.position);
1088
- for (t = e.input.slice(r, e.position), i = [], t.length < 1 && v(e, "directive name must not be less than one character in length"); l !== 0; ) {
1089
- for (; ye(l); )
1090
- l = e.input.charCodeAt(++e.position);
1091
- if (l === 35) {
1092
- do
1093
- l = e.input.charCodeAt(++e.position);
1094
- while (l !== 0 && !oe(l));
1095
- break;
1096
- }
1097
- if (oe(l)) break;
1098
- for (r = e.position; l !== 0 && !J(l); )
1099
- l = e.input.charCodeAt(++e.position);
1100
- i.push(e.input.slice(r, e.position));
1101
- }
1102
- l !== 0 && qn(e), he.call(er, t) ? er[t](e, t, i) : an(e, 'unknown document directive "' + t + '"');
1103
- }
1104
- if (B(e, !0, -1), e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 ? (e.position += 3, B(e, !0, -1)) : o && v(e, "directives end mark is expected"), Me(e, e.lineIndent - 1, on, !1, !0), B(e, !0, -1), e.checkLineBreaks && qt.test(e.input.slice(n, e.position)) && an(e, "non-ASCII line breaks are interpreted as content"), e.documents.push(e.result), e.position === e.lineStart && pn(e)) {
1105
- e.input.charCodeAt(e.position) === 46 && (e.position += 3, B(e, !0, -1));
1106
- return;
1107
- }
1108
- if (e.position < e.length - 1)
1109
- v(e, "end of the stream or a document separator is expected");
1110
- else
1111
- return;
1112
- }
1113
- function Gr(e, n) {
1114
- e = String(e), n = n || {}, e.length !== 0 && (e.charCodeAt(e.length - 1) !== 10 && e.charCodeAt(e.length - 1) !== 13 && (e += `
1115
- `), e.charCodeAt(0) === 65279 && (e = e.slice(1)));
1116
- var r = new Gt(e, n), t = e.indexOf("\0");
1117
- for (t !== -1 && (r.position = t, v(r, "null byte is not allowed in input")), r.input += "\0"; r.input.charCodeAt(r.position) === 32; )
1118
- r.lineIndent += 1, r.position += 1;
1119
- for (; r.position < r.length - 1; )
1120
- ll(r);
1121
- return r.documents;
1122
- }
1123
- function ol(e, n, r) {
1124
- n !== null && typeof n == "object" && typeof r > "u" && (r = n, n = null);
1125
- var t = Gr(e, r);
1126
- if (typeof n != "function")
1127
- return t;
1128
- for (var i = 0, o = t.length; i < o; i += 1)
1129
- n(t[i]);
1130
- }
1131
- function al(e, n) {
1132
- var r = Gr(e, n);
1133
- if (r.length !== 0) {
1134
- if (r.length === 1)
1135
- return r[0];
1136
- throw new X("expected a single document in the stream, but found more");
1137
- }
1138
- }
1139
- var cl = ol, ul = al, Qr = {
1140
- loadAll: cl,
1141
- load: ul
1142
- }, Xr = Object.prototype.toString, Zr = Object.prototype.hasOwnProperty, Un = 65279, sl = 9, qe = 10, fl = 13, pl = 32, dl = 33, hl = 34, kn = 35, ml = 37, gl = 38, xl = 39, yl = 42, Jr = 44, vl = 45, cn = 58, Al = 61, bl = 62, Cl = 63, wl = 64, ei = 91, ni = 93, El = 96, ri = 123, _l = 124, ii = 125, Q = {};
1143
- Q[0] = "\\0";
1144
- Q[7] = "\\a";
1145
- Q[8] = "\\b";
1146
- Q[9] = "\\t";
1147
- Q[10] = "\\n";
1148
- Q[11] = "\\v";
1149
- Q[12] = "\\f";
1150
- Q[13] = "\\r";
1151
- Q[27] = "\\e";
1152
- Q[34] = '\\"';
1153
- Q[92] = "\\\\";
1154
- Q[133] = "\\N";
1155
- Q[160] = "\\_";
1156
- Q[8232] = "\\L";
1157
- Q[8233] = "\\P";
1158
- var Sl = [
1159
- "y",
1160
- "Y",
1161
- "yes",
1162
- "Yes",
1163
- "YES",
1164
- "on",
1165
- "On",
1166
- "ON",
1167
- "n",
1168
- "N",
1169
- "no",
1170
- "No",
1171
- "NO",
1172
- "off",
1173
- "Off",
1174
- "OFF"
1175
- ], Tl = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
1176
- function Fl(e, n) {
1177
- var r, t, i, o, l, a, c;
1178
- if (n === null) return {};
1179
- for (r = {}, t = Object.keys(n), i = 0, o = t.length; i < o; i += 1)
1180
- l = t[i], a = String(n[l]), l.slice(0, 2) === "!!" && (l = "tag:yaml.org,2002:" + l.slice(2)), c = e.compiledTypeMap.fallback[l], c && Zr.call(c.styleAliases, a) && (a = c.styleAliases[a]), r[l] = a;
1181
- return r;
1182
- }
1183
- function Il(e) {
1184
- var n, r, t;
1185
- if (n = e.toString(16).toUpperCase(), e <= 255)
1186
- r = "x", t = 2;
1187
- else if (e <= 65535)
1188
- r = "u", t = 4;
1189
- else if (e <= 4294967295)
1190
- r = "U", t = 8;
1191
- else
1192
- throw new X("code point within a string may not be greater than 0xFFFFFFFF");
1193
- return "\\" + r + Y.repeat("0", t - n.length) + n;
1194
- }
1195
- var Ol = 1, ze = 2;
1196
- function Nl(e) {
1197
- this.schema = e.schema || Hn, this.indent = Math.max(1, e.indent || 2), this.noArrayIndent = e.noArrayIndent || !1, this.skipInvalid = e.skipInvalid || !1, this.flowLevel = Y.isNothing(e.flowLevel) ? -1 : e.flowLevel, this.styleMap = Fl(this.schema, e.styles || null), this.sortKeys = e.sortKeys || !1, this.lineWidth = e.lineWidth || 80, this.noRefs = e.noRefs || !1, this.noCompatMode = e.noCompatMode || !1, this.condenseFlow = e.condenseFlow || !1, this.quotingType = e.quotingType === '"' ? ze : Ol, this.forceQuotes = e.forceQuotes || !1, this.replacer = typeof e.replacer == "function" ? e.replacer : null, this.implicitTypes = this.schema.compiledImplicit, this.explicitTypes = this.schema.compiledExplicit, this.tag = null, this.result = "", this.duplicates = [], this.usedDuplicates = null;
1198
- }
1199
- function ir(e, n) {
1200
- for (var r = Y.repeat(" ", n), t = 0, i = -1, o = "", l, a = e.length; t < a; )
1201
- i = e.indexOf(`
1202
- `, t), i === -1 ? (l = e.slice(t), t = a) : (l = e.slice(t, i + 1), t = i + 1), l.length && l !== `
1203
- ` && (o += r), o += l;
1204
- return o;
1205
- }
1206
- function Rn(e, n) {
1207
- return `
1208
- ` + Y.repeat(" ", e.indent * n);
1209
- }
1210
- function Ll(e, n) {
1211
- var r, t, i;
1212
- for (r = 0, t = e.implicitTypes.length; r < t; r += 1)
1213
- if (i = e.implicitTypes[r], i.resolve(n))
1214
- return !0;
1215
- return !1;
1216
- }
1217
- function un(e) {
1218
- return e === pl || e === sl;
1219
- }
1220
- function Ue(e) {
1221
- return 32 <= e && e <= 126 || 161 <= e && e <= 55295 && e !== 8232 && e !== 8233 || 57344 <= e && e <= 65533 && e !== Un || 65536 <= e && e <= 1114111;
1222
- }
1223
- function tr(e) {
1224
- return Ue(e) && e !== Un && e !== fl && e !== qe;
1225
- }
1226
- function lr(e, n, r) {
1227
- var t = tr(e), i = t && !un(e);
1228
- return (
1229
- // ns-plain-safe
1230
- (r ? (
1231
- // c = flow-in
1232
- t
1233
- ) : t && e !== Jr && e !== ei && e !== ni && e !== ri && e !== ii) && e !== kn && !(n === cn && !i) || tr(n) && !un(n) && e === kn || n === cn && i
1234
- );
1235
- }
1236
- function Dl(e) {
1237
- return Ue(e) && e !== Un && !un(e) && e !== vl && e !== Cl && e !== cn && e !== Jr && e !== ei && e !== ni && e !== ri && e !== ii && e !== kn && e !== gl && e !== yl && e !== dl && e !== _l && e !== Al && e !== bl && e !== xl && e !== hl && e !== ml && e !== wl && e !== El;
1238
- }
1239
- function kl(e) {
1240
- return !un(e) && e !== cn;
1241
- }
1242
- function Be(e, n) {
1243
- var r = e.charCodeAt(n), t;
1244
- return r >= 55296 && r <= 56319 && n + 1 < e.length && (t = e.charCodeAt(n + 1), t >= 56320 && t <= 57343) ? (r - 55296) * 1024 + t - 56320 + 65536 : r;
1245
- }
1246
- function ti(e) {
1247
- var n = /^\n* /;
1248
- return n.test(e);
1249
- }
1250
- var li = 1, jn = 2, oi = 3, ai = 4, Oe = 5;
1251
- function Rl(e, n, r, t, i, o, l, a) {
1252
- var c, u = 0, p = null, s = !1, h = !1, d = t !== -1, m = -1, g = Dl(Be(e, 0)) && kl(Be(e, e.length - 1));
1253
- if (n || l)
1254
- for (c = 0; c < e.length; u >= 65536 ? c += 2 : c++) {
1255
- if (u = Be(e, c), !Ue(u))
1256
- return Oe;
1257
- g = g && lr(u, p, a), p = u;
1258
- }
1259
- else {
1260
- for (c = 0; c < e.length; u >= 65536 ? c += 2 : c++) {
1261
- if (u = Be(e, c), u === qe)
1262
- s = !0, d && (h = h || // Foldable line = too long, and not more-indented.
1263
- c - m - 1 > t && e[m + 1] !== " ", m = c);
1264
- else if (!Ue(u))
1265
- return Oe;
1266
- g = g && lr(u, p, a), p = u;
1267
- }
1268
- h = h || d && c - m - 1 > t && e[m + 1] !== " ";
1269
- }
1270
- return !s && !h ? g && !l && !i(e) ? li : o === ze ? Oe : jn : r > 9 && ti(e) ? Oe : l ? o === ze ? Oe : jn : h ? ai : oi;
1271
- }
1272
- function jl(e, n, r, t, i) {
1273
- e.dump = (function() {
1274
- if (n.length === 0)
1275
- return e.quotingType === ze ? '""' : "''";
1276
- if (!e.noCompatMode && (Sl.indexOf(n) !== -1 || Tl.test(n)))
1277
- return e.quotingType === ze ? '"' + n + '"' : "'" + n + "'";
1278
- var o = e.indent * Math.max(1, r), l = e.lineWidth === -1 ? -1 : Math.max(Math.min(e.lineWidth, 40), e.lineWidth - o), a = t || e.flowLevel > -1 && r >= e.flowLevel;
1279
- function c(u) {
1280
- return Ll(e, u);
1281
- }
1282
- switch (Rl(
1283
- n,
1284
- a,
1285
- e.indent,
1286
- l,
1287
- c,
1288
- e.quotingType,
1289
- e.forceQuotes && !t,
1290
- i
1291
- )) {
1292
- case li:
1293
- return n;
1294
- case jn:
1295
- return "'" + n.replace(/'/g, "''") + "'";
1296
- case oi:
1297
- return "|" + or(n, e.indent) + ar(ir(n, o));
1298
- case ai:
1299
- return ">" + or(n, e.indent) + ar(ir(Ml(n, l), o));
1300
- case Oe:
1301
- return '"' + Pl(n) + '"';
1302
- default:
1303
- throw new X("impossible error: invalid scalar style");
1304
- }
1305
- })();
1306
- }
1307
- function or(e, n) {
1308
- var r = ti(e) ? String(n) : "", t = e[e.length - 1] === `
1309
- `, i = t && (e[e.length - 2] === `
1310
- ` || e === `
1311
- `), o = i ? "+" : t ? "" : "-";
1312
- return r + o + `
1313
- `;
1314
- }
1315
- function ar(e) {
1316
- return e[e.length - 1] === `
1317
- ` ? e.slice(0, -1) : e;
1318
- }
1319
- function Ml(e, n) {
1320
- for (var r = /(\n+)([^\n]*)/g, t = (function() {
1321
- var u = e.indexOf(`
1322
- `);
1323
- return u = u !== -1 ? u : e.length, r.lastIndex = u, cr(e.slice(0, u), n);
1324
- })(), i = e[0] === `
1325
- ` || e[0] === " ", o, l; l = r.exec(e); ) {
1326
- var a = l[1], c = l[2];
1327
- o = c[0] === " ", t += a + (!i && !o && c !== "" ? `
1328
- ` : "") + cr(c, n), i = o;
1329
- }
1330
- return t;
1331
- }
1332
- function cr(e, n) {
1333
- if (e === "" || e[0] === " ") return e;
1334
- for (var r = / [^ ]/g, t, i = 0, o, l = 0, a = 0, c = ""; t = r.exec(e); )
1335
- a = t.index, a - i > n && (o = l > i ? l : a, c += `
1336
- ` + e.slice(i, o), i = o + 1), l = a;
1337
- return c += `
1338
- `, e.length - i > n && l > i ? c += e.slice(i, l) + `
1339
- ` + e.slice(l + 1) : c += e.slice(i), c.slice(1);
1340
- }
1341
- function Pl(e) {
1342
- for (var n = "", r = 0, t, i = 0; i < e.length; r >= 65536 ? i += 2 : i++)
1343
- r = Be(e, i), t = Q[r], !t && Ue(r) ? (n += e[i], r >= 65536 && (n += e[i + 1])) : n += t || Il(r);
1344
- return n;
1345
- }
1346
- function Bl(e, n, r) {
1347
- var t = "", i = e.tag, o, l, a;
1348
- for (o = 0, l = r.length; o < l; o += 1)
1349
- a = r[o], e.replacer && (a = e.replacer.call(r, String(o), a)), (se(e, n, a, !1, !1) || typeof a > "u" && se(e, n, null, !1, !1)) && (t !== "" && (t += "," + (e.condenseFlow ? "" : " ")), t += e.dump);
1350
- e.tag = i, e.dump = "[" + t + "]";
1351
- }
1352
- function ur(e, n, r, t) {
1353
- var i = "", o = e.tag, l, a, c;
1354
- for (l = 0, a = r.length; l < a; l += 1)
1355
- c = r[l], e.replacer && (c = e.replacer.call(r, String(l), c)), (se(e, n + 1, c, !0, !0, !1, !0) || typeof c > "u" && se(e, n + 1, null, !0, !0, !1, !0)) && ((!t || i !== "") && (i += Rn(e, n)), e.dump && qe === e.dump.charCodeAt(0) ? i += "-" : i += "- ", i += e.dump);
1356
- e.tag = o, e.dump = i || "[]";
1357
- }
1358
- function $l(e, n, r) {
1359
- var t = "", i = e.tag, o = Object.keys(r), l, a, c, u, p;
1360
- for (l = 0, a = o.length; l < a; l += 1)
1361
- p = "", t !== "" && (p += ", "), e.condenseFlow && (p += '"'), c = o[l], u = r[c], e.replacer && (u = e.replacer.call(r, c, u)), se(e, n, c, !1, !1) && (e.dump.length > 1024 && (p += "? "), p += e.dump + (e.condenseFlow ? '"' : "") + ":" + (e.condenseFlow ? "" : " "), se(e, n, u, !1, !1) && (p += e.dump, t += p));
1362
- e.tag = i, e.dump = "{" + t + "}";
1363
- }
1364
- function Yl(e, n, r, t) {
1365
- var i = "", o = e.tag, l = Object.keys(r), a, c, u, p, s, h;
1366
- if (e.sortKeys === !0)
1367
- l.sort();
1368
- else if (typeof e.sortKeys == "function")
1369
- l.sort(e.sortKeys);
1370
- else if (e.sortKeys)
1371
- throw new X("sortKeys must be a boolean or a function");
1372
- for (a = 0, c = l.length; a < c; a += 1)
1373
- h = "", (!t || i !== "") && (h += Rn(e, n)), u = l[a], p = r[u], e.replacer && (p = e.replacer.call(r, u, p)), se(e, n + 1, u, !0, !0, !0) && (s = e.tag !== null && e.tag !== "?" || e.dump && e.dump.length > 1024, s && (e.dump && qe === e.dump.charCodeAt(0) ? h += "?" : h += "? "), h += e.dump, s && (h += Rn(e, n)), se(e, n + 1, p, !0, s) && (e.dump && qe === e.dump.charCodeAt(0) ? h += ":" : h += ": ", h += e.dump, i += h));
1374
- e.tag = o, e.dump = i || "{}";
1375
- }
1376
- function sr(e, n, r) {
1377
- var t, i, o, l, a, c;
1378
- for (i = r ? e.explicitTypes : e.implicitTypes, o = 0, l = i.length; o < l; o += 1)
1379
- if (a = i[o], (a.instanceOf || a.predicate) && (!a.instanceOf || typeof n == "object" && n instanceof a.instanceOf) && (!a.predicate || a.predicate(n))) {
1380
- if (r ? a.multi && a.representName ? e.tag = a.representName(n) : e.tag = a.tag : e.tag = "?", a.represent) {
1381
- if (c = e.styleMap[a.tag] || a.defaultStyle, Xr.call(a.represent) === "[object Function]")
1382
- t = a.represent(n, c);
1383
- else if (Zr.call(a.represent, c))
1384
- t = a.represent[c](n, c);
1385
- else
1386
- throw new X("!<" + a.tag + '> tag resolver accepts not "' + c + '" style');
1387
- e.dump = t;
1388
- }
1389
- return !0;
1390
- }
1391
- return !1;
1392
- }
1393
- function se(e, n, r, t, i, o, l) {
1394
- e.tag = null, e.dump = r, sr(e, r, !1) || sr(e, r, !0);
1395
- var a = Xr.call(e.dump), c = t, u;
1396
- t && (t = e.flowLevel < 0 || e.flowLevel > n);
1397
- var p = a === "[object Object]" || a === "[object Array]", s, h;
1398
- if (p && (s = e.duplicates.indexOf(r), h = s !== -1), (e.tag !== null && e.tag !== "?" || h || e.indent !== 2 && n > 0) && (i = !1), h && e.usedDuplicates[s])
1399
- e.dump = "*ref_" + s;
1400
- else {
1401
- if (p && h && !e.usedDuplicates[s] && (e.usedDuplicates[s] = !0), a === "[object Object]")
1402
- t && Object.keys(e.dump).length !== 0 ? (Yl(e, n, e.dump, i), h && (e.dump = "&ref_" + s + e.dump)) : ($l(e, n, e.dump), h && (e.dump = "&ref_" + s + " " + e.dump));
1403
- else if (a === "[object Array]")
1404
- t && e.dump.length !== 0 ? (e.noArrayIndent && !l && n > 0 ? ur(e, n - 1, e.dump, i) : ur(e, n, e.dump, i), h && (e.dump = "&ref_" + s + e.dump)) : (Bl(e, n, e.dump), h && (e.dump = "&ref_" + s + " " + e.dump));
1405
- else if (a === "[object String]")
1406
- e.tag !== "?" && jl(e, e.dump, n, o, c);
1407
- else {
1408
- if (a === "[object Undefined]")
1409
- return !1;
1410
- if (e.skipInvalid) return !1;
1411
- throw new X("unacceptable kind of an object to dump " + a);
1412
- }
1413
- e.tag !== null && e.tag !== "?" && (u = encodeURI(
1414
- e.tag[0] === "!" ? e.tag.slice(1) : e.tag
1415
- ).replace(/!/g, "%21"), e.tag[0] === "!" ? u = "!" + u : u.slice(0, 18) === "tag:yaml.org,2002:" ? u = "!!" + u.slice(18) : u = "!<" + u + ">", e.dump = u + " " + e.dump);
1416
- }
1417
- return !0;
1418
- }
1419
- function Hl(e, n) {
1420
- var r = [], t = [], i, o;
1421
- for (Mn(e, r, t), i = 0, o = t.length; i < o; i += 1)
1422
- n.duplicates.push(r[t[i]]);
1423
- n.usedDuplicates = new Array(o);
1424
- }
1425
- function Mn(e, n, r) {
1426
- var t, i, o;
1427
- if (e !== null && typeof e == "object")
1428
- if (i = n.indexOf(e), i !== -1)
1429
- r.indexOf(i) === -1 && r.push(i);
1430
- else if (n.push(e), Array.isArray(e))
1431
- for (i = 0, o = e.length; i < o; i += 1)
1432
- Mn(e[i], n, r);
1433
- else
1434
- for (t = Object.keys(e), i = 0, o = t.length; i < o; i += 1)
1435
- Mn(e[t[i]], n, r);
1436
- }
1437
- function ql(e, n) {
1438
- n = n || {};
1439
- var r = new Nl(n);
1440
- r.noRefs || Hl(e, r);
1441
- var t = e;
1442
- return r.replacer && (t = r.replacer.call({ "": t }, "", t)), se(r, 0, t, !0, !0) ? r.dump + `
1443
- ` : "";
1444
- }
1445
- var zl = ql, Ul = {
1446
- dump: zl
1447
- };
1448
- function Kn(e, n) {
1449
- return function() {
1450
- throw new Error("Function yaml." + e + " is removed in js-yaml 4. Use yaml." + n + " instead, which is now safe by default.");
1451
- };
1452
- }
1453
- var Kl = W, Wl = Cr, Vl = Sr, Gl = Nr, Ql = Lr, Xl = Hn, Zl = Qr.load, Jl = Qr.loadAll, eo = Ul.dump, no = X, ro = {
1454
- binary: Mr,
1455
- float: Or,
1456
- map: _r,
1457
- null: Tr,
1458
- pairs: Br,
1459
- set: $r,
1460
- timestamp: Rr,
1461
- bool: Fr,
1462
- int: Ir,
1463
- merge: jr,
1464
- omap: Pr,
1465
- seq: Er,
1466
- str: wr
1467
- }, io = Kn("safeLoad", "load"), to = Kn("safeLoadAll", "loadAll"), lo = Kn("safeDump", "dump"), oo = {
1468
- Type: Kl,
1469
- Schema: Wl,
1470
- FAILSAFE_SCHEMA: Vl,
1471
- JSON_SCHEMA: Gl,
1472
- CORE_SCHEMA: Ql,
1473
- DEFAULT_SCHEMA: Xl,
1474
- load: Zl,
1475
- loadAll: Jl,
1476
- dump: eo,
1477
- YAMLException: no,
1478
- types: ro,
1479
- safeLoad: io,
1480
- safeLoadAll: to,
1481
- safeDump: lo
1482
- };
1483
- const ao = /* @__PURE__ */ new Set(["object", "array", "string", "boolean", "number", "integer"]);
1484
- function ci(e) {
1485
- return typeof e == "object" && e !== null && !Array.isArray(e);
1486
- }
1487
- function co() {
1488
- return {
1489
- type: "object",
1490
- properties: {}
1491
- };
1492
- }
1493
- function Wn(e) {
1494
- if (!ci(e) || typeof e.type != "string" || !ao.has(e.type))
1495
- return;
1496
- const n = {
1497
- ...e,
1498
- type: e.type
1499
- };
1500
- if (e.properties !== void 0 || e.type === "object" ? n.properties = uo(e.properties) : delete n.properties, e.items !== void 0) {
1501
- const r = Wn(e.items);
1502
- r ? n.items = r : delete n.items;
1503
- }
1504
- return n;
1505
- }
1506
- function uo(e) {
1507
- return ci(e) ? Object.entries(e).reduce((n, [r, t]) => {
1508
- const i = Wn(t);
1509
- return i && (n[r] = i), n;
1510
- }, {}) : {};
1511
- }
1512
- function fr(e) {
1513
- return Wn(e) ?? co();
1514
- }
1515
- function so(e) {
1516
- const n = oo.load(e);
1517
- if (!n || typeof n != "object" || Array.isArray(n))
1518
- throw new Error("Policy definition YAML must be an object");
1519
- const r = n;
1520
- if (typeof r.name != "string" || !r.name)
1521
- throw new Error("Policy definition must have a name");
1522
- if (typeof r.version != "string" || !r.version)
1523
- throw new Error("Policy definition must have a version. eg: 1.0.0");
1524
- const t = fr(r.parameters), i = fr(r.systemParameters);
1525
- return {
1526
- name: r.name,
1527
- version: r.version,
1528
- description: typeof r.description == "string" ? r.description : "",
1529
- parameters: t,
1530
- systemParameters: i
1531
- };
1532
- }
1533
- function fo(e) {
1534
- return e.replace(/([A-Z])/g, " $1").replace(/[_-]+/g, " ").replace(/\s+/g, " ").trim().replace(/^./, (n) => n.toUpperCase());
1535
- }
1536
- function Ke(e) {
1537
- const n = fo(e.name);
1538
- return e.isRequired ? `* ${n}` : n;
1539
- }
1540
- const po = ({
1541
- value: e,
1542
- onChange: n,
1543
- placeholder: r,
1544
- disabled: t,
1545
- error: i,
1546
- helperText: o
1547
- }) => {
1548
- const [l, a] = Z(""), c = pe(() => e.map((s) => s.trim()).filter(Boolean), [e]), u = (s) => {
1549
- const h = s.trim();
1550
- !h || c.includes(h) || n([...c, h]);
1551
- }, p = (s) => {
1552
- if (s.key === "Enter" || s.key === ",") {
1553
- s.preventDefault(), u(l), a("");
1554
- return;
1555
- }
1556
- s.key === "Backspace" && l === "" && e.length > 0 && n(c.slice(0, -1));
1557
- };
1558
- return /* @__PURE__ */ C(_, { spacing: 0.75, pt: 1, children: [
1559
- c.length > 0 && /* @__PURE__ */ f(_, { direction: "row", flexWrap: "wrap", spacing: 0.5, useFlexGap: !0, children: c.map((s) => /* @__PURE__ */ f(gr, { label: s, size: "small", onDelete: t ? void 0 : () => n(c.filter((h) => h !== s)) }, s)) }),
1560
- /* @__PURE__ */ f(ge, { value: l, onChange: (s) => a(s.target.value), onKeyDown: p, disabled: t, placeholder: r, size: "small", error: !!i }),
1561
- o && /* @__PURE__ */ f(mr, { error: !!i, children: o })
1562
- ] });
1563
- }, pr = (e) => {
1564
- const n = me(38), {
1565
- node: r,
1566
- value: t,
1567
- onChange: i,
1568
- error: o,
1569
- disabled: l
1570
- } = e;
1571
- let a;
1572
- n[0] !== r ? (a = Ke(r), n[0] = r, n[1] = a) : a = n[1];
1573
- const c = a, u = o || r.schema.description;
1574
- if (r.schema.enum && r.schema.enum.length > 0) {
1575
- const y = r.path, A = !!o, x = t || "";
1576
- let F;
1577
- n[2] !== r.path || n[3] !== i ? (F = (I) => i(r.path, I.target.value), n[2] = r.path, n[3] = i, n[4] = F) : F = n[4];
1578
- let w;
1579
- n[5] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ f(hr, { value: "", children: /* @__PURE__ */ f("em", { children: "Select..." }) }), n[5] = w) : w = n[5];
1580
- let E;
1581
- n[6] !== r.schema.enum ? (E = r.schema.enum.map(vo), n[6] = r.schema.enum, n[7] = E) : E = n[7];
1582
- let S;
1583
- n[8] !== x || n[9] !== F || n[10] !== E ? (S = /* @__PURE__ */ C(yi, { value: x, onChange: F, displayEmpty: !0, variant: "outlined", children: [
1584
- w,
1585
- E
1586
- ] }), n[8] = x, n[9] = F, n[10] = E, n[11] = S) : S = n[11];
1587
- let D;
1588
- n[12] !== o || n[13] !== u ? (D = u && /* @__PURE__ */ f(mr, { error: !!o, children: u }), n[12] = o, n[13] = u, n[14] = D) : D = n[14];
1589
- let k;
1590
- n[15] !== l || n[16] !== A || n[17] !== S || n[18] !== D ? (k = /* @__PURE__ */ C(vi, { fullWidth: !0, size: "small", error: A, disabled: l, children: [
1591
- S,
1592
- D
1593
- ] }), n[15] = l, n[16] = A, n[17] = S, n[18] = D, n[19] = k) : k = n[19];
1594
- let U;
1595
- return n[20] !== c || n[21] !== r.path || n[22] !== k ? (U = /* @__PURE__ */ f(_, { pb: 2, children: /* @__PURE__ */ f(ce.ElementWrapper, { label: c, name: y, children: k }) }), n[20] = c, n[21] = r.path, n[22] = k, n[23] = U) : U = n[23], U;
1596
- }
1597
- const p = t || "";
1598
- let s;
1599
- n[24] !== r.path || n[25] !== i ? (s = (y) => i(r.path, y.target.value), n[24] = r.path, n[25] = i, n[26] = s) : s = n[26];
1600
- const h = !!o, d = r.schema.default ? String(r.schema.default) : "";
1601
- let m;
1602
- n[27] !== l || n[28] !== u || n[29] !== p || n[30] !== s || n[31] !== h || n[32] !== d ? (m = /* @__PURE__ */ f(ge, { value: p, onChange: s, disabled: l, error: h, helperText: u, fullWidth: !0, size: "small", placeholder: d }), n[27] = l, n[28] = u, n[29] = p, n[30] = s, n[31] = h, n[32] = d, n[33] = m) : m = n[33];
1603
- let g;
1604
- return n[34] !== c || n[35] !== r.path || n[36] !== m ? (g = /* @__PURE__ */ f(_, { spacing: 0.75, pb: 2, children: /* @__PURE__ */ f(ce.ElementWrapper, { label: c, name: r.path, children: m }) }), n[34] = c, n[35] = r.path, n[36] = m, n[37] = g) : g = n[37], g;
1605
- }, ho = (e) => {
1606
- const n = me(21), {
1607
- node: r,
1608
- value: t,
1609
- onChange: i,
1610
- error: o,
1611
- disabled: l
1612
- } = e;
1613
- let a;
1614
- n[0] !== r ? (a = Ke(r), n[0] = r, n[1] = a) : a = n[1];
1615
- const c = a, u = t === !0 || t === "true";
1616
- let p;
1617
- n[2] !== r.path || n[3] !== i ? (p = (y) => i(r.path, y.target.checked), n[2] = r.path, n[3] = i, n[4] = p) : p = n[4];
1618
- let s;
1619
- n[5] !== u || n[6] !== l || n[7] !== p ? (s = /* @__PURE__ */ f(Ai, { checked: u, onChange: p, disabled: l }), n[5] = u, n[6] = l, n[7] = p, n[8] = s) : s = n[8];
1620
- let h;
1621
- n[9] !== r.schema.description ? (h = r.schema.description && /* @__PURE__ */ f(H, { variant: "caption", color: "text.secondary", children: r.schema.description }), n[9] = r.schema.description, n[10] = h) : h = n[10];
1622
- let d;
1623
- n[11] !== s || n[12] !== h ? (d = /* @__PURE__ */ C(_, { direction: "row", alignItems: "center", spacing: 1, children: [
1624
- s,
1625
- h
1626
- ] }), n[11] = s, n[12] = h, n[13] = d) : d = n[13];
1627
- let m;
1628
- n[14] !== o ? (m = o && /* @__PURE__ */ f(H, { variant: "caption", color: "error", children: o }), n[14] = o, n[15] = m) : m = n[15];
1629
- let g;
1630
- return n[16] !== c || n[17] !== r.path || n[18] !== d || n[19] !== m ? (g = /* @__PURE__ */ f(_, { spacing: 0.75, pb: 2, children: /* @__PURE__ */ C(ce.ElementWrapper, { label: c, name: r.path, children: [
1631
- d,
1632
- m
1633
- ] }) }), n[16] = c, n[17] = r.path, n[18] = d, n[19] = m, n[20] = g) : g = n[20], g;
1634
- }, mo = (e) => {
1635
- const n = me(22), {
1636
- node: r,
1637
- value: t,
1638
- onChange: i,
1639
- error: o,
1640
- disabled: l
1641
- } = e;
1642
- let a;
1643
- n[0] !== r ? (a = Ke(r), n[0] = r, n[1] = a) : a = n[1];
1644
- const c = a, u = r.schema.type === "integer", p = o || r.schema.description;
1645
- let s;
1646
- n[2] !== u || n[3] !== r.path || n[4] !== i ? (s = (w) => {
1647
- const E = w.target.value;
1648
- if (E === "") {
1649
- i(r.path, "");
1650
- return;
1651
- }
1652
- const S = u ? parseInt(E, 10) : parseFloat(E);
1653
- Number.isNaN(S) || i(r.path, S);
1654
- }, n[2] = u, n[3] = r.path, n[4] = i, n[5] = s) : s = n[5];
1655
- const h = s, d = t !== void 0 && t !== "" ? String(t) : "", m = !!o, g = r.schema.default !== void 0 ? String(r.schema.default) : "", y = u ? 1 : "any";
1656
- let A;
1657
- n[6] !== r.schema.maximum || n[7] !== r.schema.minimum || n[8] !== y ? (A = {
1658
- htmlInput: {
1659
- min: r.schema.minimum,
1660
- max: r.schema.maximum,
1661
- step: y
1662
- }
1663
- }, n[6] = r.schema.maximum, n[7] = r.schema.minimum, n[8] = y, n[9] = A) : A = n[9];
1664
- let x;
1665
- n[10] !== l || n[11] !== h || n[12] !== p || n[13] !== d || n[14] !== m || n[15] !== g || n[16] !== A ? (x = /* @__PURE__ */ f(ge, { type: "number", value: d, onChange: h, disabled: l, error: m, helperText: p, fullWidth: !0, size: "small", placeholder: g, slotProps: A }), n[10] = l, n[11] = h, n[12] = p, n[13] = d, n[14] = m, n[15] = g, n[16] = A, n[17] = x) : x = n[17];
1666
- let F;
1667
- return n[18] !== c || n[19] !== r.path || n[20] !== x ? (F = /* @__PURE__ */ f(_, { spacing: 0.75, pb: 2, children: /* @__PURE__ */ f(ce.ElementWrapper, { label: c, name: r.path, children: x }) }), n[18] = c, n[19] = r.path, n[20] = x, n[21] = F) : F = n[21], F;
1668
- }, go = (e) => {
1669
- const n = me(18), {
1670
- node: r,
1671
- value: t,
1672
- onChange: i,
1673
- error: o,
1674
- disabled: l
1675
- } = e;
1676
- let a;
1677
- n[0] !== r ? (a = Ke(r), n[0] = r, n[1] = a) : a = n[1];
1678
- const c = a, u = r.schema.items?.type;
1679
- let p;
1680
- n[2] !== t ? (p = Array.isArray(t) ? t.map(String) : [], n[2] = t, n[3] = p) : p = n[3];
1681
- const s = p;
1682
- let h;
1683
- n[4] !== u || n[5] !== r.path || n[6] !== i ? (h = (x) => {
1684
- if (u === "number" || u === "integer") {
1685
- const F = x.map(Ao);
1686
- i(r.path, F);
1687
- return;
1688
- }
1689
- i(r.path, x);
1690
- }, n[4] = u, n[5] = r.path, n[6] = i, n[7] = h) : h = n[7];
1691
- const d = h, m = o || r.schema.description, g = !!o;
1692
- let y;
1693
- n[8] !== s || n[9] !== l || n[10] !== d || n[11] !== m || n[12] !== g ? (y = /* @__PURE__ */ f(po, { placeholder: "Type a value and press Enter", value: s, onChange: d, helperText: m, error: g, disabled: l }), n[8] = s, n[9] = l, n[10] = d, n[11] = m, n[12] = g, n[13] = y) : y = n[13];
1694
- let A;
1695
- return n[14] !== c || n[15] !== r.path || n[16] !== y ? (A = /* @__PURE__ */ f(_, { spacing: 0.75, pb: 2, children: /* @__PURE__ */ f(ce.ElementWrapper, { label: c, name: r.path, children: y }) }), n[14] = c, n[15] = r.path, n[16] = y, n[17] = A) : A = n[17], A;
1696
- }, xo = ({
1697
- node: e,
1698
- value: n,
1699
- onChange: r,
1700
- disabled: t
1701
- }) => {
1702
- const i = Ke(e), [o, l] = Z(""), [a, c] = Z(""), u = n && typeof n == "object" && !Array.isArray(n) ? n : {}, p = Object.entries(u), s = () => {
1703
- o.trim() && (r(e.path, {
1704
- ...u,
1705
- [o.trim()]: a
1706
- }), l(""), c(""));
1707
- }, h = (d) => {
1708
- d.key === "Enter" && (d.preventDefault(), s());
1709
- };
1710
- return /* @__PURE__ */ f(_, { spacing: 0.75, pb: 2, children: /* @__PURE__ */ f(ce.ElementWrapper, { label: i, name: e.path, children: /* @__PURE__ */ C(_, { spacing: 1, children: [
1711
- p.map(([d, m]) => /* @__PURE__ */ C(_, { direction: "row", spacing: 1, alignItems: "center", children: [
1712
- /* @__PURE__ */ f(ge, { value: d, disabled: t, size: "small", sx: {
1713
- width: "40%"
1714
- } }),
1715
- /* @__PURE__ */ f(ge, { value: m, onChange: (g) => r(e.path, {
1716
- ...u,
1717
- [d]: g.target.value
1718
- }), sx: {
1719
- width: "40%"
1720
- }, disabled: t, size: "small" }),
1721
- /* @__PURE__ */ f(Bn, { size: "small", color: "error", onClick: () => {
1722
- const g = {
1723
- ...u
1724
- };
1725
- delete g[d], r(e.path, g);
1726
- }, disabled: t, children: /* @__PURE__ */ f(vr, { size: 14 }) })
1727
- ] }, d)),
1728
- /* @__PURE__ */ C(_, { direction: "row", spacing: 1, alignItems: "center", children: [
1729
- /* @__PURE__ */ f(ge, { value: o, onChange: (d) => l(d.target.value), placeholder: "Key", disabled: t, size: "small", sx: {
1730
- width: "40%"
1731
- }, onKeyDown: h }),
1732
- /* @__PURE__ */ f(ge, { value: a, onChange: (d) => c(d.target.value), placeholder: "Value", disabled: t, size: "small", sx: {
1733
- width: "40%"
1734
- }, onKeyDown: h }),
1735
- /* @__PURE__ */ f(ae, { variant: "outlined", size: "small", onClick: s, disabled: t || !o.trim(), startIcon: /* @__PURE__ */ f(fn, { size: 14 }), children: "Add" })
1736
- ] }),
1737
- e.schema.description && /* @__PURE__ */ f(H, { variant: "caption", color: "text.secondary", children: e.schema.description })
1738
- ] }) }) });
1739
- }, yo = (e) => {
1740
- const {
1741
- schema: n
1742
- } = e;
1743
- switch (n.type) {
1744
- case "string":
1745
- return pr;
1746
- case "boolean":
1747
- return ho;
1748
- case "number":
1749
- case "integer":
1750
- return mo;
1751
- case "array":
1752
- return n.items?.type === "string" || n.items?.type === "number" || n.items?.type === "integer" ? go : null;
1753
- case "object":
1754
- return n.additionalProperties && !n.properties ? xo : null;
1755
- default:
1756
- return pr;
1757
- }
1758
- };
1759
- function vo(e) {
1760
- return /* @__PURE__ */ f(hr, { value: e, children: e }, e);
1761
- }
1762
- function Ao(e) {
1763
- const n = Number(e);
1764
- return Number.isNaN(n) ? e : n;
1765
- }
1766
- function ui(e) {
1767
- if (!e.some((i) => i.schema["x-wso2-policy-advanced-param"] !== void 0))
1768
- return {
1769
- mainNodes: e,
1770
- advancedNodes: []
1771
- };
1772
- const r = [], t = [];
1773
- return e.forEach((i) => {
1774
- const o = i.schema["x-wso2-policy-advanced-param"];
1775
- if (o === !1) {
1776
- r.push(i);
1777
- return;
1778
- }
1779
- if (o === !0) {
1780
- t.push(i);
1781
- return;
1782
- }
1783
- const l = i.schema.type === "object" && i.schema.properties !== void 0 && (i.schema.required?.length ?? 0) > 0;
1784
- i.isRequired || l ? r.push(i) : t.push(i);
1785
- }), {
1786
- mainNodes: r,
1787
- advancedNodes: t
1788
- };
1789
- }
1790
- const $e = ({
1791
- node: e,
1792
- values: n,
1793
- onChange: r,
1794
- onAddArrayItem: t,
1795
- onDeleteArrayItem: i,
1796
- errors: o,
1797
- disabled: l
1798
- }) => {
1799
- const a = ue(n, e.path), c = e.schema.type === "array" && e.schema.items?.type === "object", u = pe(() => Array.isArray(a) ? a : [], [a]), p = yo(e), s = p !== null, h = pe(() => {
1800
- const w = e.path + ".";
1801
- return Object.keys(o).some((E) => E.startsWith(w));
1802
- }, [o, e.path]), [d, m] = Z(e.isExpanded ?? !1);
1803
- ke(() => {
1804
- h && m(!0);
1805
- }, [h]);
1806
- const g = tn((w, E) => {
1807
- t(w, E);
1808
- }, [t]), y = xi(u.length), A = u.length > y.current ? u.length - 1 : -1, x = pe(() => c ? u.map((w, E) => {
1809
- const S = `${e.path}.${E}`;
1810
- return {
1811
- id: S,
1812
- path: S,
1813
- name: `Item ${E + 1}`,
1814
- schema: e.schema.items,
1815
- depth: e.depth + 1,
1816
- isRequired: !1,
1817
- isExpanded: E === A,
1818
- isArrayItem: !0,
1819
- arrayIndex: E,
1820
- parentArrayPath: e.path,
1821
- children: e.schema.items?.type === "object" && e.schema.items?.properties ? $n(e.schema.items, S, e.depth + 2, e.schema.items.required || []) : void 0
1822
- };
1823
- }) : [], [c, u, e, A]);
1824
- if (ke(() => {
1825
- y.current = u.length;
1826
- }), s)
1827
- return /* @__PURE__ */ f(p, { node: e, value: a, onChange: r, error: o[e.path], disabled: l });
1828
- const F = /* @__PURE__ */ C(_, { direction: "row", alignItems: "center", spacing: 1, sx: {
1829
- flex: 1
1830
- }, children: [
1831
- /* @__PURE__ */ f(H, { variant: "h6", children: e.name }),
1832
- !e.isRequired && /* @__PURE__ */ f(H, { variant: "caption", color: "text.secondary", children: "(Optional)" }),
1833
- e.isArrayItem && e.parentArrayPath !== void 0 && /* @__PURE__ */ f(Bn, { size: "small", color: "error", onClick: (w) => {
1834
- w.stopPropagation(), i(e.parentArrayPath, e.arrayIndex);
1835
- }, disabled: l, "aria-label": `Delete ${e.name}`, sx: {
1836
- ml: "auto"
1837
- }, children: /* @__PURE__ */ f(vr, { size: 14 }) })
1838
- ] });
1839
- return /* @__PURE__ */ C(Sn, { expanded: d, onChange: (w, E) => m(E), disableGutters: !0, children: [
1840
- /* @__PURE__ */ f(Tn, { expandIcon: /* @__PURE__ */ f(On, { size: 16 }), children: F }),
1841
- /* @__PURE__ */ C(Fn, { children: [
1842
- e.schema.description && /* @__PURE__ */ f(H, { variant: "body2", color: "text.secondary", sx: {
1843
- mb: 2
1844
- }, children: e.schema.description }),
1845
- e.children && e.children.length > 0 && !c && (() => {
1846
- const {
1847
- mainNodes: w,
1848
- advancedNodes: E
1849
- } = ui(e.children);
1850
- return /* @__PURE__ */ C(sn, { children: [
1851
- w.length > 0 && /* @__PURE__ */ f(_, { children: w.map((S) => /* @__PURE__ */ f($e, { node: S, values: n, onChange: r, onAddArrayItem: g, onDeleteArrayItem: i, errors: o, disabled: l }, S.id)) }),
1852
- E.length > 0 && /* @__PURE__ */ C(Sn, { disableGutters: !0, sx: {
1853
- mt: 1
1854
- }, children: [
1855
- /* @__PURE__ */ f(Tn, { expandIcon: /* @__PURE__ */ f(On, { size: 16 }), children: /* @__PURE__ */ f(H, { variant: "body2", children: "Advanced Settings" }) }),
1856
- /* @__PURE__ */ f(Fn, { children: /* @__PURE__ */ f(_, { children: E.map((S) => /* @__PURE__ */ f($e, { node: S, values: n, onChange: r, onAddArrayItem: g, onDeleteArrayItem: i, errors: o, disabled: l }, S.id)) }) })
1857
- ] })
1858
- ] });
1859
- })(),
1860
- c && /* @__PURE__ */ C(_, { spacing: 1.5, children: [
1861
- /* @__PURE__ */ f(Re, { children: /* @__PURE__ */ f(ae, { variant: "outlined", size: "small", startIcon: /* @__PURE__ */ f(fn, { size: 14 }), onClick: () => g(e.path, e.schema.items), disabled: l, children: "Add Item" }) }),
1862
- /* @__PURE__ */ f(_, { children: x.map((w) => /* @__PURE__ */ f($e, { node: w, values: n, onChange: r, onAddArrayItem: g, onDeleteArrayItem: i, errors: o, disabled: l }, w.id)) })
1863
- ] })
1864
- ] })
1865
- ] });
1866
- }, bo = ({
1867
- schema: e,
1868
- values: n,
1869
- onChange: r,
1870
- onAddArrayItem: t,
1871
- onDeleteArrayItem: i,
1872
- errors: o,
1873
- disabled: l
1874
- }) => {
1875
- const a = pe(() => $n(e, "", 0, e.required || []), [e]), {
1876
- mainNodes: c,
1877
- advancedNodes: u
1878
- } = pe(() => ui(a), [a]);
1879
- return /* @__PURE__ */ C(_, { spacing: 2, children: [
1880
- c.length > 0 && /* @__PURE__ */ C(sn, { children: [
1881
- /* @__PURE__ */ f(H, { variant: "h6", children: "Parameters" }),
1882
- /* @__PURE__ */ f(_, { children: c.map((p) => /* @__PURE__ */ f($e, { node: p, values: n, onChange: r, onAddArrayItem: t, onDeleteArrayItem: i, errors: o, disabled: l }, p.id)) })
1883
- ] }),
1884
- u.length > 0 && /* @__PURE__ */ f(_, { spacing: 4, children: /* @__PURE__ */ C(Sn, { children: [
1885
- /* @__PURE__ */ f(Tn, { expandIcon: /* @__PURE__ */ f(On, { size: 16 }), children: /* @__PURE__ */ f(H, { variant: "h6", children: "Advanced Settings" }) }),
1886
- /* @__PURE__ */ f(Fn, { children: /* @__PURE__ */ f(_, { children: u.map((p) => /* @__PURE__ */ f($e, { node: p, values: n, onChange: r, onAddArrayItem: t, onDeleteArrayItem: i, errors: o, disabled: l }, p.id)) }) })
1887
- ] }) })
1888
- ] });
1889
- }, dr = 5, Co = (e) => {
1890
- const n = me(23), {
1891
- text: r
1892
- } = e, [t, i] = Z(!1);
1893
- let o, l, a, c, u, p, s;
1894
- if (n[0] !== t || n[1] !== r) {
1895
- const g = r.trim().split(`
1896
- `);
1897
- l = g.length > dr;
1898
- const y = t ? g : g.slice(0, dr);
1899
- o = H, a = "body2", c = "text.secondary", u = "div", n[9] === Symbol.for("react.memo_cache_sentinel") ? (p = {
1900
- whiteSpace: "pre-wrap"
1901
- }, n[9] = p) : p = n[9], s = y.join(`
1902
- `), n[0] = t, n[1] = r, n[2] = o, n[3] = l, n[4] = a, n[5] = c, n[6] = u, n[7] = p, n[8] = s;
1903
- } else
1904
- o = n[2], l = n[3], a = n[4], c = n[5], u = n[6], p = n[7], s = n[8];
1905
- let h;
1906
- n[10] !== o || n[11] !== a || n[12] !== c || n[13] !== u || n[14] !== p || n[15] !== s ? (h = /* @__PURE__ */ f(o, { variant: a, color: c, component: u, sx: p, children: s }), n[10] = o, n[11] = a, n[12] = c, n[13] = u, n[14] = p, n[15] = s, n[16] = h) : h = n[16];
1907
- let d;
1908
- n[17] !== t || n[18] !== l ? (d = l && /* @__PURE__ */ f(ae, { variant: "text", size: "small", "aria-expanded": t, sx: {
1909
- alignSelf: "flex-start",
1910
- px: 0,
1911
- minWidth: 0
1912
- }, onClick: () => i(So), children: t ? "Show less" : "Show more" }), n[17] = t, n[18] = l, n[19] = d) : d = n[19];
1913
- let m;
1914
- return n[20] !== h || n[21] !== d ? (m = /* @__PURE__ */ C(sn, { children: [
1915
- h,
1916
- d
1917
- ] }), n[20] = h, n[21] = d, n[22] = m) : m = n[22], m;
1918
- };
1919
- function Pn(e, n, r = "") {
1920
- const t = [];
1921
- if (e.type === "object" && e.properties) {
1922
- const i = e.required || [];
1923
- Object.entries(e.properties).forEach(([l, a]) => {
1924
- const c = r ? `${r}.${l}` : l, u = ue(n, c);
1925
- i.includes(l) && (u == null || u === "" || Array.isArray(u) && u.length === 0) && t.push({
1926
- path: c,
1927
- message: "This field is required"
1928
- }), a.type === "object" && a.properties && (i.includes(l) || je(u)) && t.push(...Pn(a, n, c)), a.type === "array" && a.items && Array.isArray(u) && u.forEach((p, s) => {
1929
- const h = `${c}.${s}`;
1930
- a.items.type === "object" && t.push(...Pn(a.items, n, h));
1931
- });
1932
- });
1933
- const o = e.anyOf ?? e.oneOf ?? [];
1934
- if (o.length > 0 && !si(o, n, r)) {
1935
- const l = wo(o, n, r);
1936
- if (l)
1937
- for (const a of l.required || []) {
1938
- const c = r ? `${r}.${a}` : a, u = ue(n, c);
1939
- (u == null || u === "" || Array.isArray(u) && u.length === 0) && !t.find((s) => s.path === c) && t.push({
1940
- path: c,
1941
- message: "This field is required"
1942
- });
1943
- }
1944
- else {
1945
- const a = /* @__PURE__ */ new Set();
1946
- o.forEach((c) => {
1947
- (c.required || []).forEach((u) => a.add(u)), Object.keys(c.properties || {}).forEach((u) => a.add(u));
1948
- }), a.forEach((c) => {
1949
- const u = r ? `${r}.${c}` : c;
1950
- t.find((p) => p.path === u) || t.push({
1951
- path: u,
1952
- message: "At least one of these fields is required"
1953
- });
1954
- });
1955
- }
1956
- }
1957
- }
1958
- return t;
1959
- }
1960
- function wo(e, n, r = "") {
1961
- for (const t of e) {
1962
- const i = t.properties || {}, o = Object.entries(i).filter(([, a]) => a.const !== void 0);
1963
- if (o.length === 0) continue;
1964
- if (o.every(([a, c]) => {
1965
- const u = r ? `${r}.${a}` : a;
1966
- return ue(n, u) === c.const;
1967
- })) return t;
1968
- }
1969
- return e.find((t) => {
1970
- const i = t.properties || {};
1971
- return Object.values(i).every((o) => o.const === void 0);
1972
- }) ?? null;
1973
- }
1974
- function si(e, n, r = "") {
1975
- return e.length === 0 ? !0 : e.some((t) => {
1976
- for (const i of t.required || []) {
1977
- const o = r ? `${r}.${i}` : i, l = ue(n, o);
1978
- if (!je(l)) return !1;
1979
- const a = t.properties?.[i]?.const;
1980
- if (a !== void 0 && l !== a) return !1;
1981
- }
1982
- for (const [i, o] of Object.entries(t.properties || {}))
1983
- if (!(t.required || []).includes(i) && o.const !== void 0) {
1984
- const l = r ? `${r}.${i}` : i;
1985
- if (ue(n, l) !== o.const) return !1;
1986
- }
1987
- return !0;
1988
- });
1989
- }
1990
- function Eo(e, n) {
1991
- if (e.type !== "object" || !e.properties) return !0;
1992
- for (const t of e.required || []) {
1993
- const i = ue(n, t);
1994
- if (i == null || i === "" || Array.isArray(i) && i.length === 0) return !1;
1995
- }
1996
- const r = e.anyOf ?? e.oneOf ?? [];
1997
- return !!si(r, n);
1998
- }
1999
- const _o = (e) => {
2000
- const n = me(44), {
2001
- policyDefinition: r,
2002
- policyDisplayName: t,
2003
- existingValues: i,
2004
- onCancel: o,
2005
- onSubmit: l,
2006
- isEditMode: a,
2007
- disabled: c
2008
- } = e, u = a === void 0 ? !1 : a, p = c === void 0 ? !1 : c, {
2009
- name: s,
2010
- description: h,
2011
- parameters: d
2012
- } = r, m = t || s;
2013
- let g;
2014
- n[0] !== i || n[1] !== d ? (g = () => Ye(d, i), n[0] = i, n[1] = d, n[2] = g) : g = n[2];
2015
- const [y, A] = Z(g);
2016
- let x;
2017
- n[3] === Symbol.for("react.memo_cache_sentinel") ? (x = {}, n[3] = x) : x = n[3];
2018
- const [F, w] = Z(x), E = Eo(d, y);
2019
- let S, D;
2020
- n[4] !== i || n[5] !== d ? (S = () => {
2021
- i && A(Ye(d, i));
2022
- }, D = [i, d], n[4] = i, n[5] = d, n[6] = S, n[7] = D) : (S = n[6], D = n[7]), ke(S, D);
2023
- let k;
2024
- n[8] === Symbol.for("react.memo_cache_sentinel") ? (k = (N, ne) => {
2025
- A((G) => Cn(G, N, ne)), w((G) => {
2026
- if (!G[N])
2027
- return G;
2028
- const te = {
2029
- ...G
2030
- };
2031
- return delete te[N], te;
2032
- });
2033
- }, n[8] = k) : k = n[8];
2034
- const U = k;
2035
- let I;
2036
- n[9] === Symbol.for("react.memo_cache_sentinel") ? (I = (N, ne) => {
2037
- A((G) => {
2038
- const te = ue(G, N) || [];
2039
- return Cn(G, N, [...te, $i(ne)]);
2040
- });
2041
- }, n[9] = I) : I = n[9];
2042
- const j = I;
2043
- let O;
2044
- n[10] === Symbol.for("react.memo_cache_sentinel") ? (O = (N, ne) => {
2045
- A((G) => {
2046
- const te = ue(G, N) || [];
2047
- return Cn(G, N, te.filter((Vn, ve) => ve !== ne));
2048
- });
2049
- }, n[10] = O) : O = n[10];
2050
- const M = O;
2051
- let R;
2052
- n[11] !== l || n[12] !== d || n[13] !== y ? (R = () => {
2053
- const N = Pn(d, y);
2054
- if (N.length > 0) {
2055
- const ne = {};
2056
- N.forEach((G) => {
2057
- ne[G.path] = G.message;
2058
- }), w(ne);
2059
- return;
2060
- }
2061
- w({}), l(Ln(d, y));
2062
- }, n[11] = l, n[12] = d, n[13] = y, n[14] = R) : R = n[14];
2063
- const q = R;
2064
- let le;
2065
- n[15] !== m ? (le = /* @__PURE__ */ f(H, { variant: "h6", gutterBottom: !0, children: m }), n[15] = m, n[16] = le) : le = n[16];
2066
- let ie;
2067
- n[17] !== h ? (ie = h && /* @__PURE__ */ f(Co, { text: h }), n[17] = h, n[18] = ie) : ie = n[18];
2068
- let K;
2069
- n[19] !== le || n[20] !== ie ? (K = /* @__PURE__ */ C(Re, { children: [
2070
- le,
2071
- ie
2072
- ] }), n[19] = le, n[20] = ie, n[21] = K) : K = n[21];
2073
- let re;
2074
- n[22] !== p || n[23] !== F || n[24] !== d || n[25] !== y ? (re = /* @__PURE__ */ f(bo, { schema: d, values: y, onChange: U, onAddArrayItem: j, onDeleteArrayItem: M, errors: F, disabled: p }), n[22] = p, n[23] = F, n[24] = d, n[25] = y, n[26] = re) : re = n[26];
2075
- let V;
2076
- n[27] !== p || n[28] !== o ? (V = /* @__PURE__ */ f(ae, { variant: "outlined", onClick: o, disabled: p, children: "Cancel" }), n[27] = p, n[28] = o, n[29] = V) : V = n[29];
2077
- const $ = p || !E;
2078
- let ee;
2079
- n[30] !== u ? (ee = u ? void 0 : /* @__PURE__ */ f(fn, { size: 16 }), n[30] = u, n[31] = ee) : ee = n[31];
2080
- const z = u ? "Save" : "Add";
2081
- let b;
2082
- n[32] !== q || n[33] !== $ || n[34] !== ee || n[35] !== z ? (b = /* @__PURE__ */ f(ae, { variant: "contained", color: "primary", onClick: q, disabled: $, startIcon: ee, children: z }), n[32] = q, n[33] = $, n[34] = ee, n[35] = z, n[36] = b) : b = n[36];
2083
- let T;
2084
- n[37] !== V || n[38] !== b ? (T = /* @__PURE__ */ C(_, { direction: "row", justifyContent: "flex-end", spacing: 1, children: [
2085
- V,
2086
- b
2087
- ] }), n[37] = V, n[38] = b, n[39] = T) : T = n[39];
2088
- let fe;
2089
- return n[40] !== K || n[41] !== re || n[42] !== T ? (fe = /* @__PURE__ */ C(_, { spacing: 2.5, children: [
2090
- K,
2091
- re,
2092
- T
2093
- ] }), n[40] = K, n[41] = re, n[42] = T, n[43] = fe) : fe = n[43], fe;
2094
- };
2095
- function So(e) {
2096
- return !e;
2097
- }
2098
- const To = (e) => {
2099
- const n = me(41), {
2100
- policy: r,
2101
- existingSettings: t,
2102
- getPolicyDefinitionVersion: i,
2103
- policyNoun: o,
2104
- onBack: l,
2105
- onSubmit: a
2106
- } = e, c = o === void 0 ? "policy" : o;
2107
- let u;
2108
- n[0] !== i || n[1] !== r ? (u = i?.(r) ?? r.version, n[0] = i, n[1] = r, n[2] = u) : u = n[2];
2109
- const {
2110
- data: p,
2111
- isLoading: s,
2112
- error: h
2113
- } = Ri(r.name, u), [d, m] = Z(null), [g, y] = Z(null);
2114
- let A, x;
2115
- if (n[3] !== p ? (A = () => {
2116
- if (p)
2117
- try {
2118
- m(so(p)), y(null);
2119
- } catch {
2120
- y("Failed to parse policy definition.");
2121
- }
2122
- }, x = [p], n[3] = p, n[4] = A, n[5] = x) : (A = n[4], x = n[5]), ke(A, x), s) {
2123
- let I;
2124
- return n[6] === Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ C(_, { spacing: 2, sx: {
2125
- mt: 1
2126
- }, children: [
2127
- /* @__PURE__ */ f(H, { variant: "body2", color: "text.secondary", children: "Loading definition..." }),
2128
- /* @__PURE__ */ f(xe, { variant: "text", width: "60%", height: 28 }),
2129
- /* @__PURE__ */ f(xe, { variant: "text", width: "90%", height: 16 }),
2130
- /* @__PURE__ */ f(xe, { variant: "rounded", width: "100%", height: 48 }),
2131
- /* @__PURE__ */ f(xe, { variant: "rounded", width: "100%", height: 48 })
2132
- ] }), n[6] = I) : I = n[6], I;
2133
- }
2134
- if (h || g) {
2135
- let I;
2136
- n[7] === Symbol.for("react.memo_cache_sentinel") ? (I = {
2137
- py: 2
2138
- }, n[7] = I) : I = n[7];
2139
- const j = g || h?.message || `Failed to load ${c} definition.`;
2140
- let O;
2141
- n[8] !== j ? (O = /* @__PURE__ */ f(yr, { severity: "error", children: j }), n[8] = j, n[9] = O) : O = n[9];
2142
- let M;
2143
- n[10] === Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ f(bn, { size: 16 }), n[10] = M) : M = n[10];
2144
- let R;
2145
- n[11] !== l ? (R = /* @__PURE__ */ f(ae, { variant: "text", startIcon: M, onClick: l, children: "Back" }), n[11] = l, n[12] = R) : R = n[12];
2146
- let q;
2147
- return n[13] !== O || n[14] !== R ? (q = /* @__PURE__ */ C(_, { spacing: 2, sx: I, children: [
2148
- O,
2149
- R
2150
- ] }), n[13] = O, n[14] = R, n[15] = q) : q = n[15], q;
2151
- }
2152
- if (!d) {
2153
- let I;
2154
- n[16] === Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ f(Nn, { size: 64 }), n[16] = I) : I = n[16];
2155
- const j = `This ${c} does not have a configuration schema.`;
2156
- let O;
2157
- n[17] !== j ? (O = /* @__PURE__ */ f(Ne.Container, { children: /* @__PURE__ */ f(Ne.EmptyState, { illustration: I, title: "No definition available", description: j }) }), n[17] = j, n[18] = O) : O = n[18];
2158
- let M;
2159
- n[19] === Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ f(bn, { size: 16 }), n[19] = M) : M = n[19];
2160
- let R;
2161
- n[20] !== l ? (R = /* @__PURE__ */ f(ae, { variant: "text", startIcon: M, onClick: l, children: "Back" }), n[20] = l, n[21] = R) : R = n[21];
2162
- let q;
2163
- return n[22] !== O || n[23] !== R ? (q = /* @__PURE__ */ C(_, { spacing: 2, children: [
2164
- O,
2165
- R
2166
- ] }), n[22] = O, n[23] = R, n[24] = q) : q = n[24], q;
2167
- }
2168
- let F;
2169
- n[25] === Symbol.for("react.memo_cache_sentinel") ? (F = /* @__PURE__ */ f(bn, { size: 16 }), n[25] = F) : F = n[25];
2170
- let w;
2171
- n[26] !== l ? (w = /* @__PURE__ */ f(Re, { children: /* @__PURE__ */ f(ae, { variant: "text", size: "small", startIcon: F, onClick: l, children: "Back" }) }), n[26] = l, n[27] = w) : w = n[27];
2172
- const E = r.displayName || r.name, S = !!t;
2173
- let D;
2174
- n[28] !== a || n[29] !== r ? (D = (I) => a(r, I), n[28] = a, n[29] = r, n[30] = D) : D = n[30];
2175
- let k;
2176
- n[31] !== t || n[32] !== l || n[33] !== d || n[34] !== E || n[35] !== S || n[36] !== D ? (k = /* @__PURE__ */ f(_o, { policyDefinition: d, policyDisplayName: E, existingValues: t, isEditMode: S, onCancel: l, onSubmit: D }), n[31] = t, n[32] = l, n[33] = d, n[34] = E, n[35] = S, n[36] = D, n[37] = k) : k = n[37];
2177
- let U;
2178
- return n[38] !== k || n[39] !== w ? (U = /* @__PURE__ */ C(_, { spacing: 2, children: [
2179
- w,
2180
- k
2181
- ] }), n[38] = k, n[39] = w, n[40] = U) : U = n[40], U;
2182
- };
2183
- function Fo({
2184
- open: e,
2185
- onClose: n,
2186
- onSubmit: r,
2187
- catalogData: t,
2188
- isLoadingCatalog: i,
2189
- catalogError: o,
2190
- filterPolicies: l,
2191
- getPolicyDefinitionVersion: a,
2192
- disabledPolicyNames: c = [],
2193
- disabledPolicyKeys: u = [],
2194
- existingSettings: p,
2195
- editPolicyKey: s,
2196
- title: h = "Policies",
2197
- subtitle: d = "Choose a policy to configure advanced options.",
2198
- policyNoun: m = "policy",
2199
- loadingLabel: g = "Loading policies...",
2200
- searchPlaceholder: y = "Search policies...",
2201
- catalogErrorLabel: A = "Failed to load policies.",
2202
- emptySearchTitle: x = "No policies match your search",
2203
- emptySearchDescription: F = "Try a different keyword or clear the search filter.",
2204
- emptyCatalogTitle: w = "No policies available",
2205
- emptyCatalogDescription: E = "No policies are available in the catalog.",
2206
- minWidth: S = 600,
2207
- maxWidth: D = 800
2208
- }) {
2209
- const {
2210
- data: k,
2211
- isLoading: U,
2212
- error: I
2213
- } = Ii(!t && i === void 0 && o === void 0 && !l), [j, O] = Z(null), [M, R] = Z(""), q = t ?? k, le = i ?? U, ie = o ?? I, K = pe(() => {
2214
- const b = q?.data ?? [];
2215
- return l ? l(b) : Oi(b, Ni?.guardrailCapabilities);
2216
- }, [q, l]), re = tn((b, T) => u.length > 0 ? u.includes(`${b}@${T}`) : c.includes(b), [u, c]), V = pe(() => {
2217
- const b = M.trim().toLowerCase();
2218
- return b ? K.filter((T) => (T.displayName || T.name).toLowerCase().includes(b) || T.name.toLowerCase().includes(b) || T.description?.toLowerCase().includes(b)) : K;
2219
- }, [K, M]), $ = tn(() => {
2220
- O(null), R(""), n();
2221
- }, [n]), ee = tn((b, T) => {
2222
- r(b, T), O(null);
2223
- }, [r]);
2224
- ke(() => {
2225
- e || (O(null), R(""));
2226
- }, [e]), ke(() => {
2227
- if (e && s && K.length > 0) {
2228
- const b = K.find((T) => `${T.name}@${T.version}` === s);
2229
- b && O(b);
2230
- }
2231
- }, [e, s, K]);
2232
- const z = j ? j.displayName || j.name : h;
2233
- return /* @__PURE__ */ C(Li, { open: e, onClose: $, minWidth: S, maxWidth: D, children: [
2234
- /* @__PURE__ */ f(Di, { icon: /* @__PURE__ */ f(Nn, { size: 24 }), title: z, onClose: $ }),
2235
- /* @__PURE__ */ C(ki, { children: [
2236
- !j && /* @__PURE__ */ f(H, { variant: "body2", color: "text.secondary", sx: {
2237
- mb: 2
2238
- }, children: d }),
2239
- le ? /* @__PURE__ */ C(_, { spacing: 1.5, sx: {
2240
- mt: 1
2241
- }, children: [
2242
- /* @__PURE__ */ f(H, { variant: "body2", color: "text.secondary", children: g }),
2243
- Array.from({
2244
- length: 5
2245
- }).map((b, T) => /* @__PURE__ */ f(xr, { variant: "outlined", children: /* @__PURE__ */ f(Re, { sx: {
2246
- p: 1.5
2247
- }, children: /* @__PURE__ */ C(_, { spacing: 0.75, children: [
2248
- /* @__PURE__ */ f(xe, { variant: "text", width: "45%", height: 20 }),
2249
- /* @__PURE__ */ f(xe, { variant: "text", width: "85%", height: 16 }),
2250
- /* @__PURE__ */ f(xe, { variant: "text", width: "65%", height: 16 })
2251
- ] }) }) }, T))
2252
- ] }) : ie ? /* @__PURE__ */ C(yr, { severity: "error", sx: {
2253
- mt: 1
2254
- }, children: [
2255
- A,
2256
- " ",
2257
- ie?.message
2258
- ] }) : j ? /* @__PURE__ */ f(To, { policy: j, existingSettings: p, getPolicyDefinitionVersion: a, policyNoun: m, onBack: s ? $ : () => O(null), onSubmit: ee }) : /* @__PURE__ */ C(_, { spacing: 2, children: [
2259
- /* @__PURE__ */ f(bi, { placeholder: y, value: M, onChange: (b) => R(b.target.value), size: "small", fullWidth: !0 }),
2260
- /* @__PURE__ */ C(_, { spacing: 1.25, children: [
2261
- V.map((b) => {
2262
- const T = re(b.name, b.version);
2263
- return /* @__PURE__ */ f(ce.CardButton, { selected: T, disabled: T, onClick: () => !T && O(b), sx: {
2264
- width: "100%",
2265
- justifyContent: "flex-start"
2266
- }, children: /* @__PURE__ */ f(Ci, { children: /* @__PURE__ */ C(_, { spacing: 1, children: [
2267
- /* @__PURE__ */ C(_, { direction: "row", spacing: 0.5, alignItems: "center", children: [
2268
- /* @__PURE__ */ f(wi, { sx: {
2269
- height: 32,
2270
- width: 32,
2271
- backgroundColor: T ? "primary.main" : "secondary.main",
2272
- color: T ? "common.white" : "text.secondary"
2273
- }, children: T ? /* @__PURE__ */ f(Ei, { size: 16 }) : /* @__PURE__ */ f(_i, { size: 16 }) }),
2274
- /* @__PURE__ */ f(H, { variant: "body2", fontWeight: 500, children: b.displayName || b.name }),
2275
- /* @__PURE__ */ f(gr, { label: b.version, size: "small", variant: "outlined" })
2276
- ] }),
2277
- b.description && /* @__PURE__ */ f(In, { title: b.description, children: /* @__PURE__ */ C(H, { variant: "caption", color: "text.secondary", children: [
2278
- b.description.substring(0, 200),
2279
- b.description.length > 200 ? "..." : ""
2280
- ] }) })
2281
- ] }) }) }, `${b.name}@${b.version}`);
2282
- }),
2283
- V.length === 0 && M && /* @__PURE__ */ f(Ne.Container, { children: /* @__PURE__ */ f(Ne.EmptyState, { illustration: /* @__PURE__ */ f(Si, { size: 64 }), title: x, description: F }) }),
2284
- V.length === 0 && !M && /* @__PURE__ */ f(Ne.Container, { children: /* @__PURE__ */ f(Ne.EmptyState, { illustration: /* @__PURE__ */ f(Nn, { size: 64 }), title: w, description: E }) })
2285
- ] })
2286
- ] })
2287
- ] })
2288
- ] });
2289
- }
2290
- const Po = (e) => {
2291
- const n = me(73), {
2292
- policies: r,
2293
- onAdd: t,
2294
- onEdit: i,
2295
- onRemove: o,
2296
- onReorder: l,
2297
- catalogData: a,
2298
- isLoadingCatalog: c,
2299
- catalogError: u,
2300
- filterPolicies: p,
2301
- getPolicyDefinitionVersion: s,
2302
- title: h,
2303
- description: d,
2304
- addButtonLabel: m,
2305
- drawerAddTitle: g,
2306
- drawerEditTitle: y,
2307
- drawerAddSubtitle: A,
2308
- drawerEditSubtitle: x,
2309
- policyNoun: F,
2310
- loadingLabel: w,
2311
- searchPlaceholder: E,
2312
- catalogErrorLabel: S,
2313
- emptySearchTitle: D,
2314
- emptySearchDescription: k,
2315
- emptyCatalogTitle: U,
2316
- emptyCatalogDescription: I
2317
- } = e, j = h === void 0 ? "Policies" : h, O = d === void 0 ? "Add policies to enforce consistent protections." : d, M = m === void 0 ? "Add Policy" : m, R = g === void 0 ? "Add Policy" : g, q = y === void 0 ? "Edit Policy" : y, le = A === void 0 ? "Choose a policy to configure advanced options." : A, ie = x === void 0 ? "Update the policy configuration." : x, K = F === void 0 ? "policy" : F, [re, V] = Z(!1), [$, ee] = Z(null), [z, b] = Z(null), [T, fe] = Z(null), N = !!l;
2318
- let ne;
2319
- n[0] !== t ? (ne = (L, P) => {
2320
- t({
2321
- name: L.name,
2322
- version: L.version,
2323
- displayName: L.displayName,
2324
- settings: P
2325
- }), V(!1), ee(null);
2326
- }, n[0] = t, n[1] = ne) : ne = n[1];
2327
- const G = ne;
2328
- let te;
2329
- n[2] !== i ? (te = (L, P) => {
2330
- i({
2331
- name: L.name,
2332
- version: L.version,
2333
- displayName: L.displayName,
2334
- settings: P
2335
- }), V(!1), ee(null);
2336
- }, n[2] = i, n[3] = te) : te = n[3];
2337
- const Vn = te;
2338
- let ve;
2339
- n[4] === Symbol.for("react.memo_cache_sentinel") ? (ve = (L) => {
2340
- ee(L), V(!0);
2341
- }, n[4] = ve) : ve = n[4];
2342
- const fi = ve;
2343
- let We;
2344
- n[5] === Symbol.for("react.memo_cache_sentinel") ? (We = () => {
2345
- V(!1), ee(null);
2346
- }, n[5] = We) : We = n[5];
2347
- const pi = We;
2348
- let Ve;
2349
- n[6] !== N ? (Ve = (L) => (P) => {
2350
- N && (b(L), P.dataTransfer.effectAllowed = "move", P.dataTransfer.setData("text/plain", String(L)));
2351
- }, n[6] = N, n[7] = Ve) : Ve = n[7];
2352
- const dn = Ve;
2353
- let Ge;
2354
- n[8] !== T || n[9] !== z || n[10] !== N ? (Ge = (L) => (P) => {
2355
- !N || z === null || (P.preventDefault(), P.dataTransfer.dropEffect = "move", T !== L && fe(L));
2356
- }, n[8] = T, n[9] = z, n[10] = N, n[11] = Ge) : Ge = n[11];
2357
- const hn = Ge;
2358
- let Qe;
2359
- n[12] !== z || n[13] !== l || n[14] !== r || n[15] !== N ? (Qe = (L) => (P) => {
2360
- if (P.preventDefault(), !(!N || z === null)) {
2361
- if (z !== L) {
2362
- const Pe = [...r], [rn] = Pe.splice(z, 1);
2363
- Pe.splice(L, 0, rn), l?.(Pe);
2364
- }
2365
- b(null), fe(null);
2366
- }
2367
- }, n[12] = z, n[13] = l, n[14] = r, n[15] = N, n[16] = Qe) : Qe = n[16];
2368
- const mn = Qe;
2369
- let Xe;
2370
- n[17] === Symbol.for("react.memo_cache_sentinel") ? (Xe = () => {
2371
- b(null), fe(null);
2372
- }, n[17] = Xe) : Xe = n[17];
2373
- const di = Xe;
2374
- let Ze;
2375
- n[18] === Symbol.for("react.memo_cache_sentinel") ? (Ze = {
2376
- flex: 1,
2377
- minWidth: 0
2378
- }, n[18] = Ze) : Ze = n[18];
2379
- let Ae;
2380
- n[19] !== j ? (Ae = /* @__PURE__ */ f(ce.Subheader, { children: j }), n[19] = j, n[20] = Ae) : Ae = n[20];
2381
- let be;
2382
- n[21] !== O ? (be = /* @__PURE__ */ f(H, { variant: "body2", color: "text.secondary", children: O }), n[21] = O, n[22] = be) : be = n[22];
2383
- let Ce;
2384
- n[23] !== Ae || n[24] !== be ? (Ce = /* @__PURE__ */ C(_, { spacing: 0.5, sx: Ze, children: [
2385
- Ae,
2386
- be
2387
- ] }), n[23] = Ae, n[24] = be, n[25] = Ce) : Ce = n[25];
2388
- let Je, en;
2389
- n[26] === Symbol.for("react.memo_cache_sentinel") ? (Je = /* @__PURE__ */ f(fn, { size: 16 }), en = () => V(!0), n[26] = Je, n[27] = en) : (Je = n[26], en = n[27]);
2390
- let we;
2391
- n[28] !== M ? (we = /* @__PURE__ */ f(ae, { variant: "outlined", size: "small", startIcon: Je, onClick: en, children: M }), n[28] = M, n[29] = we) : we = n[29];
2392
- let Ee;
2393
- n[30] !== Ce || n[31] !== we ? (Ee = /* @__PURE__ */ C(_, { direction: "row", justifyContent: "space-between", alignItems: "flex-start", spacing: 2, children: [
2394
- Ce,
2395
- we
2396
- ] }), n[30] = Ce, n[31] = we, n[32] = Ee) : Ee = n[32];
2397
- let _e;
2398
- n[33] !== T || n[34] !== z || n[35] !== hn || n[36] !== dn || n[37] !== mn || n[38] !== o || n[39] !== r || n[40] !== N || n[41] !== j ? (_e = r.length === 0 ? /* @__PURE__ */ f(Re, { sx: {
2399
- mt: 2,
2400
- border: "1px dashed",
2401
- borderColor: "divider",
2402
- borderRadius: 1
2403
- }, children: /* @__PURE__ */ f(ji, { disableBackground: !0, icon: /* @__PURE__ */ f(Ti, { size: 48 }), message: `No ${j.toLowerCase()} added yet` }) }) : /* @__PURE__ */ f(_, { spacing: 1.25, mt: 2, children: r.map((L, P) => {
2404
- const Pe = `${L.name}@${L.version}`, rn = L.displayName || L.name, hi = z === P, mi = T === P && z !== P;
2405
- return /* @__PURE__ */ C(xr, { variant: "outlined", draggable: N, onDragStart: dn(P), onDragOver: hn(P), onDrop: mn(P), onDragEnd: di, onClick: () => fi(L), sx: {
2406
- display: "flex",
2407
- alignItems: "center",
2408
- gap: 1,
2409
- px: 1.5,
2410
- py: 1.25,
2411
- cursor: "pointer",
2412
- opacity: hi ? 0.5 : 1,
2413
- borderColor: mi ? "primary.main" : void 0,
2414
- transition: "border-color 120ms ease, opacity 120ms ease",
2415
- "&:hover": {
2416
- bgcolor: "action.hover"
2417
- }
2418
- }, children: [
2419
- N && /* @__PURE__ */ f(In, { title: "Drag to reorder", placement: "top", arrow: !0, children: /* @__PURE__ */ f(Re, { "aria-label": `Position ${P + 1}. Drag to reorder.`, onClick: Io, sx: {
2420
- flexShrink: 0,
2421
- width: 24,
2422
- height: 24,
2423
- borderRadius: 1,
2424
- display: "flex",
2425
- alignItems: "center",
2426
- justifyContent: "center",
2427
- bgcolor: "action.selected",
2428
- color: "text.secondary",
2429
- cursor: "grab",
2430
- "&:active": {
2431
- cursor: "grabbing"
2432
- }
2433
- }, children: /* @__PURE__ */ f(H, { variant: "caption", fontWeight: 700, sx: {
2434
- fontVariantNumeric: "tabular-nums"
2435
- }, children: P + 1 }) }) }),
2436
- /* @__PURE__ */ f(H, { variant: "body2", fontWeight: 600, sx: {
2437
- flex: 1,
2438
- minWidth: 0,
2439
- overflow: "hidden",
2440
- textOverflow: "ellipsis",
2441
- whiteSpace: "nowrap"
2442
- }, children: rn }),
2443
- /* @__PURE__ */ f(In, { title: "Remove", placement: "top", arrow: !0, children: /* @__PURE__ */ f(Bn, { size: "small", color: "error", "aria-label": `Remove ${rn}`, onClick: (gi) => {
2444
- gi.stopPropagation(), o(L.name, L.version);
2445
- }, children: /* @__PURE__ */ f(Fi, { size: 14 }) }) })
2446
- ] }, Pe);
2447
- }) }), n[33] = T, n[34] = z, n[35] = hn, n[36] = dn, n[37] = mn, n[38] = o, n[39] = r, n[40] = N, n[41] = j, n[42] = _e) : _e = n[42];
2448
- let Se;
2449
- n[43] !== Ee || n[44] !== _e ? (Se = /* @__PURE__ */ C(ce.Section, { children: [
2450
- Ee,
2451
- _e
2452
- ] }), n[43] = Ee, n[44] = _e, n[45] = Se) : Se = n[45];
2453
- const gn = $ ? Vn : G;
2454
- let Te;
2455
- n[46] !== $ || n[47] !== r ? (Te = $ ? [] : r.map(Oo), n[46] = $, n[47] = r, n[48] = Te) : Te = n[48];
2456
- const xn = $ ? $.settings : void 0, yn = $ ? `${$.name}@${$.version}` : void 0, vn = $ ? q : R, An = $ ? ie : le;
2457
- let Fe;
2458
- n[49] !== a || n[50] !== u || n[51] !== S || n[52] !== re || n[53] !== I || n[54] !== U || n[55] !== k || n[56] !== D || n[57] !== p || n[58] !== s || n[59] !== c || n[60] !== w || n[61] !== K || n[62] !== E || n[63] !== gn || n[64] !== Te || n[65] !== xn || n[66] !== yn || n[67] !== vn || n[68] !== An ? (Fe = /* @__PURE__ */ f(Fo, { open: re, onClose: pi, onSubmit: gn, catalogData: a, isLoadingCatalog: c, catalogError: u, filterPolicies: p, getPolicyDefinitionVersion: s, disabledPolicyKeys: Te, existingSettings: xn, editPolicyKey: yn, title: vn, subtitle: An, policyNoun: K, loadingLabel: w, searchPlaceholder: E, catalogErrorLabel: S, emptySearchTitle: D, emptySearchDescription: k, emptyCatalogTitle: U, emptyCatalogDescription: I, minWidth: 800, maxWidth: 800 }), n[49] = a, n[50] = u, n[51] = S, n[52] = re, n[53] = I, n[54] = U, n[55] = k, n[56] = D, n[57] = p, n[58] = s, n[59] = c, n[60] = w, n[61] = K, n[62] = E, n[63] = gn, n[64] = Te, n[65] = xn, n[66] = yn, n[67] = vn, n[68] = An, n[69] = Fe) : Fe = n[69];
2459
- let nn;
2460
- return n[70] !== Se || n[71] !== Fe ? (nn = /* @__PURE__ */ C(sn, { children: [
2461
- Se,
2462
- Fe
2463
- ] }), n[70] = Se, n[71] = Fe, n[72] = nn) : nn = n[72], nn;
2464
- };
2465
- function Io(e) {
2466
- return e.stopPropagation();
2467
- }
2468
- function Oo(e) {
2469
- return `${e.name}@${e.version}`;
2470
- }
2471
- export {
2472
- Po as P,
2473
- Fo as a,
2474
- oo as j
2475
- };