@syncshio/kano-plugin-dsh 0.0.0-stage → 1.0.5

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.
package/dist/entry.js ADDED
@@ -0,0 +1,4459 @@
1
+ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, openBlock as c, ref as l, renderList as u, shallowRef as d, toDisplayString as f, unref as p, watch as m, withCtx as h } from "vue";
2
+ import { Button as g, DataList as _, DataRow as v, EmptyState as y, PageShell as b, Select as x, buildLocalWebviewUrl as S, resolvePath as C } from "@syncshio/kano-plugin-sdk/host";
3
+ //#region ../kano-plugin-sdk/src/api/contributions.ts
4
+ function ee(e) {
5
+ return Object.freeze({ id: e });
6
+ }
7
+ var te = ee("kano:llm-endpoints");
8
+ ee("kano:shared-model-directories");
9
+ //#endregion
10
+ //#region ../kano-plugin-sdk/src/contracts/launch.ts
11
+ var w = {
12
+ RefreshHostCapabilities: "refresh-host-capabilities",
13
+ OpenPythonSettings: "open-python-settings",
14
+ OpenLaunchSettings: "open-launch-settings",
15
+ OpenVersionManagement: "open-version-management",
16
+ OpenExtensionManagement: "open-extension-management",
17
+ ApplyLaunchParam: "apply-launch-param",
18
+ ApplyBackendSelection: "apply-backend-selection",
19
+ OpenUrl: "open-url"
20
+ };
21
+ ee("kano:output-gallery");
22
+ //#endregion
23
+ //#region ../kano-plugin-sdk/src/helpers/define-plugin.ts
24
+ function ne(e) {
25
+ return e;
26
+ }
27
+ //#endregion
28
+ //#region ../kano-plugin-sdk/src/versions.ts
29
+ var re = /* @__PURE__ */ new Set([
30
+ "",
31
+ "*",
32
+ "x",
33
+ "X"
34
+ ]);
35
+ function ie(e) {
36
+ let t = e.trim().replace(/^v/i, "").split("+")[0], [n, r = ""] = t.split("-", 2), i = n.split(".");
37
+ return !/^\d+(?:\.\d+){0,2}(?:-[0-9A-Za-z.-]+)?$/.test(t) || i.length > 3 || i.some((e) => e !== "" && !/^\d+$/.test(e)) ? null : {
38
+ major: Number(i[0] ?? 0),
39
+ minor: Number(i[1] ?? 0),
40
+ patch: Number(i[2] ?? 0),
41
+ prerelease: r
42
+ };
43
+ }
44
+ function T(e, t) {
45
+ for (let n of [
46
+ "major",
47
+ "minor",
48
+ "patch"
49
+ ]) {
50
+ if (e[n] > t[n]) return 1;
51
+ if (e[n] < t[n]) return -1;
52
+ }
53
+ if (e.prerelease === t.prerelease) return 0;
54
+ if (!e.prerelease) return 1;
55
+ if (!t.prerelease) return -1;
56
+ let n = e.prerelease.split("."), r = t.prerelease.split(".");
57
+ for (let e = 0; e < Math.max(n.length, r.length); e++) {
58
+ if (n[e] === r[e]) continue;
59
+ if (n[e] === void 0) return -1;
60
+ if (r[e] === void 0) return 1;
61
+ let t = /^\d+$/.test(n[e]), i = /^\d+$/.test(r[e]);
62
+ return t && i ? Number(n[e]) - Number(r[e]) : t === i ? n[e] < r[e] ? -1 : 1 : t ? -1 : 1;
63
+ }
64
+ return 0;
65
+ }
66
+ function E(e) {
67
+ return {
68
+ major: e.major + 1,
69
+ minor: 0,
70
+ patch: 0,
71
+ prerelease: ""
72
+ };
73
+ }
74
+ function ae(e) {
75
+ return {
76
+ major: e.major,
77
+ minor: e.minor + 1,
78
+ patch: 0,
79
+ prerelease: ""
80
+ };
81
+ }
82
+ function oe(e) {
83
+ return {
84
+ major: e.major,
85
+ minor: e.minor,
86
+ patch: e.patch + 1,
87
+ prerelease: ""
88
+ };
89
+ }
90
+ function se(e, t, n) {
91
+ let r = T(e, n);
92
+ switch (t) {
93
+ case ">": return r > 0;
94
+ case ">=": return r >= 0;
95
+ case "<": return r < 0;
96
+ case "<=": return r <= 0;
97
+ default: return r === 0;
98
+ }
99
+ }
100
+ function ce(e, t) {
101
+ let n = t.major > 0 ? E(t) : t.minor > 0 ? ae(t) : oe(t);
102
+ return T(e, t) >= 0 && T(e, n) < 0;
103
+ }
104
+ function le(e, t) {
105
+ let n = ae(t);
106
+ return T(e, t) >= 0 && T(e, n) < 0;
107
+ }
108
+ function ue(e, t) {
109
+ let n = t.trim().replace(/^v/i, "").split("."), r = n.findIndex((e) => e === "*" || /^x$/i.test(e));
110
+ if (r === -1) return !1;
111
+ let i = ie(n.map((e) => e === "*" || /^x$/i.test(e) ? "0" : e).join("."));
112
+ if (!i) return !1;
113
+ let a = r === 0 ? null : r === 1 ? E(i) : ae(i);
114
+ return T(e, i) >= 0 && (!a || T(e, a) < 0);
115
+ }
116
+ function de(e, t) {
117
+ let n = t.trim();
118
+ if (re.has(n)) return !0;
119
+ if (n.includes("*") || /(^|\.)x(\.|$)/i.test(n)) return ue(e, n);
120
+ let r = n.match(/^(\^|~)(.+)$/);
121
+ if (r) {
122
+ let t = ie(r[2]);
123
+ return t ? r[1] === "^" ? ce(e, t) : le(e, t) : !1;
124
+ }
125
+ let i = n.match(/^(>=|<=|>|<|=)?\s*(.+)$/);
126
+ if (!i) return !1;
127
+ let a = ie(i[2]);
128
+ return a ? se(e, i[1] ?? "=", a) : !1;
129
+ }
130
+ function fe(e, t) {
131
+ let n = ie(e);
132
+ return n ? t.split("||").map((e) => e.trim()).some((e) => e.split(/\s+/).every((e) => de(n, e))) : !1;
133
+ }
134
+ //#endregion
135
+ //#region node_modules/yaml/browser/dist/nodes/identity.js
136
+ var pe = Symbol.for("yaml.alias"), me = Symbol.for("yaml.document"), D = Symbol.for("yaml.map"), he = Symbol.for("yaml.pair"), O = Symbol.for("yaml.scalar"), k = Symbol.for("yaml.seq"), A = Symbol.for("yaml.node.type"), ge = (e) => !!e && typeof e == "object" && e[A] === pe, _e = (e) => !!e && typeof e == "object" && e[A] === me, j = (e) => !!e && typeof e == "object" && e[A] === D, M = (e) => !!e && typeof e == "object" && e[A] === he, N = (e) => !!e && typeof e == "object" && e[A] === O, P = (e) => !!e && typeof e == "object" && e[A] === k;
137
+ function F(e) {
138
+ if (e && typeof e == "object") switch (e[A]) {
139
+ case D:
140
+ case k: return !0;
141
+ }
142
+ return !1;
143
+ }
144
+ function I(e) {
145
+ if (e && typeof e == "object") switch (e[A]) {
146
+ case pe:
147
+ case D:
148
+ case O:
149
+ case k: return !0;
150
+ }
151
+ return !1;
152
+ }
153
+ var ve = (e) => (N(e) || F(e)) && !!e.anchor, L = Symbol("break visit"), ye = Symbol("skip children"), be = Symbol("remove node");
154
+ function R(e, t) {
155
+ let n = xe(t);
156
+ _e(e) ? z(null, e.contents, n, Object.freeze([e])) === be && (e.contents = null) : z(null, e, n, Object.freeze([]));
157
+ }
158
+ R.BREAK = L, R.SKIP = ye, R.REMOVE = be;
159
+ function z(e, t, n, r) {
160
+ let i = Se(e, t, n, r);
161
+ if (I(i) || M(i)) return Ce(e, r, i), z(e, i, n, r);
162
+ if (typeof i != "symbol") {
163
+ if (F(t)) {
164
+ r = Object.freeze(r.concat(t));
165
+ for (let e = 0; e < t.items.length; ++e) {
166
+ let i = z(e, t.items[e], n, r);
167
+ if (typeof i == "number") e = i - 1;
168
+ else if (i === L) return L;
169
+ else i === be && (t.items.splice(e, 1), --e);
170
+ }
171
+ } else if (M(t)) {
172
+ r = Object.freeze(r.concat(t));
173
+ let e = z("key", t.key, n, r);
174
+ if (e === L) return L;
175
+ e === be && (t.key = null);
176
+ let i = z("value", t.value, n, r);
177
+ if (i === L) return L;
178
+ i === be && (t.value = null);
179
+ }
180
+ }
181
+ return i;
182
+ }
183
+ function xe(e) {
184
+ return typeof e == "object" && (e.Collection || e.Node || e.Value) ? Object.assign({
185
+ Alias: e.Node,
186
+ Map: e.Node,
187
+ Scalar: e.Node,
188
+ Seq: e.Node
189
+ }, e.Value && {
190
+ Map: e.Value,
191
+ Scalar: e.Value,
192
+ Seq: e.Value
193
+ }, e.Collection && {
194
+ Map: e.Collection,
195
+ Seq: e.Collection
196
+ }, e) : e;
197
+ }
198
+ function Se(e, t, n, r) {
199
+ if (typeof n == "function") return n(e, t, r);
200
+ if (j(t)) return n.Map?.(e, t, r);
201
+ if (P(t)) return n.Seq?.(e, t, r);
202
+ if (M(t)) return n.Pair?.(e, t, r);
203
+ if (N(t)) return n.Scalar?.(e, t, r);
204
+ if (ge(t)) return n.Alias?.(e, t, r);
205
+ }
206
+ function Ce(e, t, n) {
207
+ let r = t[t.length - 1];
208
+ if (F(r)) r.items[e] = n;
209
+ else if (M(r)) e === "key" ? r.key = n : r.value = n;
210
+ else if (_e(r)) r.contents = n;
211
+ else {
212
+ let e = ge(r) ? "alias" : "scalar";
213
+ throw Error(`Cannot replace node with ${e} parent`);
214
+ }
215
+ }
216
+ //#endregion
217
+ //#region node_modules/yaml/browser/dist/doc/directives.js
218
+ var we = {
219
+ "!": "%21",
220
+ ",": "%2C",
221
+ "[": "%5B",
222
+ "]": "%5D",
223
+ "{": "%7B",
224
+ "}": "%7D"
225
+ }, Te = (e) => e.replace(/[!,[\]{}]/g, (e) => we[e]), B = class e {
226
+ constructor(t, n) {
227
+ this.docStart = null, this.docEnd = !1, this.yaml = Object.assign({}, e.defaultYaml, t), this.tags = Object.assign({}, e.defaultTags, n);
228
+ }
229
+ clone() {
230
+ let t = new e(this.yaml, this.tags);
231
+ return t.docStart = this.docStart, t;
232
+ }
233
+ atDocument() {
234
+ let t = new e(this.yaml, this.tags);
235
+ switch (this.yaml.version) {
236
+ case "1.1":
237
+ this.atNextDocument = !0;
238
+ break;
239
+ case "1.2": this.atNextDocument = !1, this.yaml = {
240
+ explicit: e.defaultYaml.explicit,
241
+ version: "1.2"
242
+ }, this.tags = Object.assign({}, e.defaultTags);
243
+ }
244
+ return t;
245
+ }
246
+ add(t, n) {
247
+ this.atNextDocument &&= (this.yaml = {
248
+ explicit: e.defaultYaml.explicit,
249
+ version: "1.1"
250
+ }, this.tags = Object.assign({}, e.defaultTags), !1);
251
+ let r = t.trim().split(/[ \t]+/), i = r.shift();
252
+ switch (i) {
253
+ case "%TAG": {
254
+ if (r.length !== 2 && (n(0, "%TAG directive should contain exactly two parts"), r.length < 2)) return !1;
255
+ let [e, t] = r;
256
+ return this.tags[e] = t, !0;
257
+ }
258
+ case "%YAML": {
259
+ if (this.yaml.explicit = !0, r.length !== 1) return n(0, "%YAML directive should contain exactly one part"), !1;
260
+ let [e] = r;
261
+ if (e === "1.1" || e === "1.2") return this.yaml.version = e, !0;
262
+ {
263
+ let t = /^\d+\.\d+$/.test(e);
264
+ return n(6, `Unsupported YAML version ${e}`, t), !1;
265
+ }
266
+ }
267
+ default: return n(0, `Unknown directive ${i}`, !0), !1;
268
+ }
269
+ }
270
+ tagName(e, t) {
271
+ if (e === "!") return "!";
272
+ if (e[0] !== "!") return t(`Not a valid tag: ${e}`), null;
273
+ if (e[1] === "<") {
274
+ let n = e.slice(2, -1);
275
+ return n === "!" || n === "!!" ? (t(`Verbatim tags aren't resolved, so ${e} is invalid.`), null) : (e[e.length - 1] !== ">" && t("Verbatim tags must end with a >"), n);
276
+ }
277
+ let [, n, r] = e.match(/^(.*!)([^!]*)$/s);
278
+ r || t(`The ${e} tag has no suffix`);
279
+ let i = this.tags[n];
280
+ if (i) try {
281
+ return i + decodeURIComponent(r);
282
+ } catch (e) {
283
+ return t(String(e)), null;
284
+ }
285
+ return n === "!" ? e : (t(`Could not resolve tag: ${e}`), null);
286
+ }
287
+ tagString(e) {
288
+ for (let [t, n] of Object.entries(this.tags)) if (e.startsWith(n)) return t + Te(e.substring(n.length));
289
+ return e[0] === "!" ? e : `!<${e}>`;
290
+ }
291
+ toString(e) {
292
+ let t = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : [], n = Object.entries(this.tags), r;
293
+ if (e && n.length > 0 && I(e.contents)) {
294
+ let t = {};
295
+ R(e.contents, (e, n) => {
296
+ I(n) && n.tag && (t[n.tag] = !0);
297
+ }), r = Object.keys(t);
298
+ } else r = [];
299
+ for (let [i, a] of n) (i !== "!!" || a !== "tag:yaml.org,2002:") && (!e || r.some((e) => e.startsWith(a))) && t.push(`%TAG ${i} ${a}`);
300
+ return t.join("\n");
301
+ }
302
+ };
303
+ B.defaultYaml = {
304
+ explicit: !1,
305
+ version: "1.2"
306
+ }, B.defaultTags = { "!!": "tag:yaml.org,2002:" };
307
+ //#endregion
308
+ //#region node_modules/yaml/browser/dist/doc/anchors.js
309
+ function Ee(e) {
310
+ if (/[\x00-\x19\s,[\]{}]/.test(e)) {
311
+ let t = `Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;
312
+ throw Error(t);
313
+ }
314
+ return !0;
315
+ }
316
+ function De(e) {
317
+ let t = /* @__PURE__ */ new Set();
318
+ return R(e, { Value(e, n) {
319
+ n.anchor && t.add(n.anchor);
320
+ } }), t;
321
+ }
322
+ function Oe(e, t) {
323
+ for (let n = 1;; ++n) {
324
+ let r = `${e}${n}`;
325
+ if (!t.has(r)) return r;
326
+ }
327
+ }
328
+ function ke(e, t) {
329
+ let n = [], r = /* @__PURE__ */ new Map(), i = null;
330
+ return {
331
+ onAnchor: (r) => {
332
+ n.push(r), i ||= De(e);
333
+ let a = Oe(t, i);
334
+ return i.add(a), a;
335
+ },
336
+ setAnchors: () => {
337
+ for (let e of n) {
338
+ let t = r.get(e);
339
+ if (typeof t == "object" && t.anchor && (N(t.node) || F(t.node))) t.node.anchor = t.anchor;
340
+ else {
341
+ let t = /* @__PURE__ */ Error("Failed to resolve repeated object (this should not happen)");
342
+ throw t.source = e, t;
343
+ }
344
+ }
345
+ },
346
+ sourceObjects: r
347
+ };
348
+ }
349
+ //#endregion
350
+ //#region node_modules/yaml/browser/dist/doc/applyReviver.js
351
+ function V(e, t, n, r) {
352
+ if (r && typeof r == "object") {
353
+ if (Array.isArray(r)) for (let t = 0, n = r.length; t < n; ++t) {
354
+ let n = r[t], i = V(e, r, String(t), n);
355
+ i === void 0 ? delete r[t] : i !== n && (r[t] = i);
356
+ }
357
+ else if (r instanceof Map) for (let t of Array.from(r.keys())) {
358
+ let n = r.get(t), i = V(e, r, t, n);
359
+ i === void 0 ? r.delete(t) : i !== n && r.set(t, i);
360
+ }
361
+ else if (r instanceof Set) for (let t of Array.from(r)) {
362
+ let n = V(e, r, t, t);
363
+ n === void 0 ? r.delete(t) : n !== t && (r.delete(t), r.add(n));
364
+ }
365
+ else for (let [t, n] of Object.entries(r)) {
366
+ let i = V(e, r, t, n);
367
+ i === void 0 ? delete r[t] : i !== n && (r[t] = i);
368
+ }
369
+ }
370
+ return e.call(t, n, r);
371
+ }
372
+ //#endregion
373
+ //#region node_modules/yaml/browser/dist/nodes/toJS.js
374
+ function H(e, t, n) {
375
+ if (Array.isArray(e)) return e.map((e, t) => H(e, String(t), n));
376
+ if (e && typeof e.toJSON == "function") {
377
+ if (!n || !ve(e)) return e.toJSON(t, n);
378
+ let r = {
379
+ aliasCount: 0,
380
+ count: 1,
381
+ res: void 0
382
+ };
383
+ n.anchors.set(e, r), n.onCreate = (e) => {
384
+ r.res = e, delete n.onCreate;
385
+ };
386
+ let i = e.toJSON(t, n);
387
+ return n.onCreate && n.onCreate(i), i;
388
+ }
389
+ return typeof e == "bigint" && !n?.keep ? Number(e) : e;
390
+ }
391
+ //#endregion
392
+ //#region node_modules/yaml/browser/dist/nodes/Node.js
393
+ var Ae = class {
394
+ constructor(e) {
395
+ Object.defineProperty(this, A, { value: e });
396
+ }
397
+ clone() {
398
+ let e = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
399
+ return this.range && (e.range = this.range.slice()), e;
400
+ }
401
+ toJS(e, { mapAsMap: t, maxAliasCount: n, onAnchor: r, reviver: i } = {}) {
402
+ if (!_e(e)) throw TypeError("A document argument is required");
403
+ let a = {
404
+ anchors: /* @__PURE__ */ new Map(),
405
+ doc: e,
406
+ keep: !0,
407
+ mapAsMap: t === !0,
408
+ mapKeyWarned: !1,
409
+ maxAliasCount: typeof n == "number" ? n : 100
410
+ }, o = H(this, "", a);
411
+ if (typeof r == "function") for (let { count: e, res: t } of a.anchors.values()) r(t, e);
412
+ return typeof i == "function" ? V(i, { "": o }, "", o) : o;
413
+ }
414
+ }, je = class extends Ae {
415
+ constructor(e) {
416
+ super(pe), this.source = e, Object.defineProperty(this, "tag", { set() {
417
+ throw Error("Alias nodes cannot have tags");
418
+ } });
419
+ }
420
+ resolve(e) {
421
+ let t;
422
+ return R(e, { Node: (e, n) => {
423
+ if (n === this) return R.BREAK;
424
+ n.anchor === this.source && (t = n);
425
+ } }), t;
426
+ }
427
+ toJSON(e, t) {
428
+ if (!t) return { source: this.source };
429
+ let { anchors: n, doc: r, maxAliasCount: i } = t, a = this.resolve(r);
430
+ if (!a) {
431
+ let e = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
432
+ throw ReferenceError(e);
433
+ }
434
+ let o = n.get(a);
435
+ /* istanbul ignore if */
436
+ if (o ||= (H(a, null, t), n.get(a)), !o || o.res === void 0) throw ReferenceError("This should not happen: Alias anchor was not resolved?");
437
+ if (i >= 0 && (o.count += 1, o.aliasCount === 0 && (o.aliasCount = Me(r, a, n)), o.count * o.aliasCount > i)) throw ReferenceError("Excessive alias count indicates a resource exhaustion attack");
438
+ return o.res;
439
+ }
440
+ toString(e, t, n) {
441
+ let r = `*${this.source}`;
442
+ if (e) {
443
+ if (Ee(this.source), e.options.verifyAliasOrder && !e.anchors.has(this.source)) {
444
+ let e = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
445
+ throw Error(e);
446
+ }
447
+ if (e.implicitKey) return `${r} `;
448
+ }
449
+ return r;
450
+ }
451
+ };
452
+ function Me(e, t, n) {
453
+ if (ge(t)) {
454
+ let r = t.resolve(e), i = n && r && n.get(r);
455
+ return i ? i.count * i.aliasCount : 0;
456
+ }
457
+ if (F(t)) {
458
+ let r = 0;
459
+ for (let i of t.items) {
460
+ let t = Me(e, i, n);
461
+ t > r && (r = t);
462
+ }
463
+ return r;
464
+ }
465
+ if (M(t)) {
466
+ let r = Me(e, t.key, n), i = Me(e, t.value, n);
467
+ return Math.max(r, i);
468
+ }
469
+ return 1;
470
+ }
471
+ //#endregion
472
+ //#region node_modules/yaml/browser/dist/nodes/Scalar.js
473
+ var Ne = (e) => !e || typeof e != "function" && typeof e != "object", U = class extends Ae {
474
+ constructor(e) {
475
+ super(O), this.value = e;
476
+ }
477
+ toJSON(e, t) {
478
+ return t?.keep ? this.value : H(this.value, e, t);
479
+ }
480
+ toString() {
481
+ return String(this.value);
482
+ }
483
+ };
484
+ U.BLOCK_FOLDED = "BLOCK_FOLDED", U.BLOCK_LITERAL = "BLOCK_LITERAL", U.PLAIN = "PLAIN", U.QUOTE_DOUBLE = "QUOTE_DOUBLE", U.QUOTE_SINGLE = "QUOTE_SINGLE";
485
+ //#endregion
486
+ //#region node_modules/yaml/browser/dist/doc/createNode.js
487
+ var Pe = "tag:yaml.org,2002:";
488
+ function Fe(e, t, n) {
489
+ if (t) {
490
+ let e = n.filter((e) => e.tag === t), r = e.find((e) => !e.format) ?? e[0];
491
+ if (!r) throw Error(`Tag ${t} not found`);
492
+ return r;
493
+ }
494
+ return n.find((t) => t.identify?.(e) && !t.format);
495
+ }
496
+ function Ie(e, t, n) {
497
+ if (_e(e) && (e = e.contents), I(e)) return e;
498
+ if (M(e)) {
499
+ let t = n.schema[D].createNode?.(n.schema, null, n);
500
+ return t.items.push(e), t;
501
+ }
502
+ (e instanceof String || e instanceof Number || e instanceof Boolean || typeof BigInt < "u" && e instanceof BigInt) && (e = e.valueOf());
503
+ let { aliasDuplicateObjects: r, onAnchor: i, onTagObj: a, schema: o, sourceObjects: s } = n, c;
504
+ if (r && e && typeof e == "object") {
505
+ if (c = s.get(e), c) return c.anchor || (c.anchor = i(e)), new je(c.anchor);
506
+ c = {
507
+ anchor: null,
508
+ node: null
509
+ }, s.set(e, c);
510
+ }
511
+ t?.startsWith("!!") && (t = Pe + t.slice(2));
512
+ let l = Fe(e, t, o.tags);
513
+ if (!l) {
514
+ if (e && typeof e.toJSON == "function" && (e = e.toJSON()), !e || typeof e != "object") {
515
+ let t = new U(e);
516
+ return c && (c.node = t), t;
517
+ }
518
+ l = e instanceof Map ? o[D] : Symbol.iterator in Object(e) ? o[k] : o[D];
519
+ }
520
+ a && (a(l), delete n.onTagObj);
521
+ let u = l?.createNode ? l.createNode(n.schema, e, n) : typeof l?.nodeClass?.from == "function" ? l.nodeClass.from(n.schema, e, n) : new U(e);
522
+ return t ? u.tag = t : l.default || (u.tag = l.tag), c && (c.node = u), u;
523
+ }
524
+ //#endregion
525
+ //#region node_modules/yaml/browser/dist/nodes/Collection.js
526
+ function Le(e, t, n) {
527
+ let r = n;
528
+ for (let e = t.length - 1; e >= 0; --e) {
529
+ let n = t[e];
530
+ if (typeof n == "number" && Number.isInteger(n) && n >= 0) {
531
+ let e = [];
532
+ e[n] = r, r = e;
533
+ } else r = /* @__PURE__ */ new Map([[n, r]]);
534
+ }
535
+ return Ie(r, void 0, {
536
+ aliasDuplicateObjects: !1,
537
+ keepUndefined: !1,
538
+ onAnchor: () => {
539
+ throw Error("This should not happen, please report a bug.");
540
+ },
541
+ schema: e,
542
+ sourceObjects: /* @__PURE__ */ new Map()
543
+ });
544
+ }
545
+ var Re = (e) => e == null || typeof e == "object" && !!e[Symbol.iterator]().next().done, ze = class extends Ae {
546
+ constructor(e, t) {
547
+ super(e), Object.defineProperty(this, "schema", {
548
+ value: t,
549
+ configurable: !0,
550
+ enumerable: !1,
551
+ writable: !0
552
+ });
553
+ }
554
+ clone(e) {
555
+ let t = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
556
+ return e && (t.schema = e), t.items = t.items.map((t) => I(t) || M(t) ? t.clone(e) : t), this.range && (t.range = this.range.slice()), t;
557
+ }
558
+ addIn(e, t) {
559
+ if (Re(e)) this.add(t);
560
+ else {
561
+ let [n, ...r] = e, i = this.get(n, !0);
562
+ if (F(i)) i.addIn(r, t);
563
+ else if (i === void 0 && this.schema) this.set(n, Le(this.schema, r, t));
564
+ else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);
565
+ }
566
+ }
567
+ deleteIn(e) {
568
+ let [t, ...n] = e;
569
+ if (n.length === 0) return this.delete(t);
570
+ let r = this.get(t, !0);
571
+ if (F(r)) return r.deleteIn(n);
572
+ throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`);
573
+ }
574
+ getIn(e, t) {
575
+ let [n, ...r] = e, i = this.get(n, !0);
576
+ return r.length === 0 ? !t && N(i) ? i.value : i : F(i) ? i.getIn(r, t) : void 0;
577
+ }
578
+ hasAllNullValues(e) {
579
+ return this.items.every((t) => {
580
+ if (!M(t)) return !1;
581
+ let n = t.value;
582
+ return n == null || e && N(n) && n.value == null && !n.commentBefore && !n.comment && !n.tag;
583
+ });
584
+ }
585
+ hasIn(e) {
586
+ let [t, ...n] = e;
587
+ if (n.length === 0) return this.has(t);
588
+ let r = this.get(t, !0);
589
+ return F(r) ? r.hasIn(n) : !1;
590
+ }
591
+ setIn(e, t) {
592
+ let [n, ...r] = e;
593
+ if (r.length === 0) this.set(n, t);
594
+ else {
595
+ let e = this.get(n, !0);
596
+ if (F(e)) e.setIn(r, t);
597
+ else if (e === void 0 && this.schema) this.set(n, Le(this.schema, r, t));
598
+ else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);
599
+ }
600
+ }
601
+ };
602
+ ze.maxFlowStringSingleLineLength = 60;
603
+ //#endregion
604
+ //#region node_modules/yaml/browser/dist/stringify/stringifyComment.js
605
+ var Be = (e) => e.replace(/^(?!$)(?: $)?/gm, "#");
606
+ function W(e, t) {
607
+ return /^\n+$/.test(e) ? e.substring(1) : t ? e.replace(/^(?! *$)/gm, t) : e;
608
+ }
609
+ var G = (e, t, n) => e.endsWith("\n") ? W(n, t) : n.includes("\n") ? "\n" + W(n, t) : (e.endsWith(" ") ? "" : " ") + n, Ve = "flow", He = "block", Ue = "quoted";
610
+ function We(e, t, n = "flow", { indentAtStart: r, lineWidth: i = 80, minContentWidth: a = 20, onFold: o, onOverflow: s } = {}) {
611
+ if (!i || i < 0) return e;
612
+ let c = Math.max(1 + a, 1 + i - t.length);
613
+ if (e.length <= c) return e;
614
+ let l = [], u = {}, d = i - t.length;
615
+ typeof r == "number" && (r > i - Math.max(2, a) ? l.push(0) : d = i - r);
616
+ let f, p, m = !1, h = -1, g = -1, _ = -1;
617
+ n === "block" && (h = Ge(e, h, t.length), h !== -1 && (d = h + c));
618
+ for (let r; r = e[h += 1];) {
619
+ if (n === "quoted" && r === "\\") {
620
+ switch (g = h, e[h + 1]) {
621
+ case "x":
622
+ h += 3;
623
+ break;
624
+ case "u":
625
+ h += 5;
626
+ break;
627
+ case "U":
628
+ h += 9;
629
+ break;
630
+ default: h += 1;
631
+ }
632
+ _ = h;
633
+ }
634
+ if (r === "\n") n === "block" && (h = Ge(e, h, t.length)), d = h + t.length + c, f = void 0;
635
+ else {
636
+ if (r === " " && p && p !== " " && p !== "\n" && p !== " ") {
637
+ let t = e[h + 1];
638
+ t && t !== " " && t !== "\n" && t !== " " && (f = h);
639
+ }
640
+ if (h >= d) {
641
+ if (f) l.push(f), d = f + c, f = void 0;
642
+ else if (n === "quoted") {
643
+ for (; p === " " || p === " ";) p = r, r = e[h += 1], m = !0;
644
+ let t = h > _ + 1 ? h - 2 : g - 1;
645
+ if (u[t]) return e;
646
+ l.push(t), u[t] = !0, d = t + c, f = void 0;
647
+ } else m = !0;
648
+ }
649
+ }
650
+ p = r;
651
+ }
652
+ if (m && s && s(), l.length === 0) return e;
653
+ o && o();
654
+ let v = e.slice(0, l[0]);
655
+ for (let r = 0; r < l.length; ++r) {
656
+ let i = l[r], a = l[r + 1] || e.length;
657
+ i === 0 ? v = `\n${t}${e.slice(0, a)}` : (n === "quoted" && u[i] && (v += `${e[i]}\\`), v += `\n${t}${e.slice(i + 1, a)}`);
658
+ }
659
+ return v;
660
+ }
661
+ function Ge(e, t, n) {
662
+ let r = t, i = t + 1, a = e[i];
663
+ for (; a === " " || a === " ";) if (t < i + n) a = e[++t];
664
+ else {
665
+ do
666
+ a = e[++t];
667
+ while (a && a !== "\n");
668
+ r = t, i = t + 1, a = e[i];
669
+ }
670
+ return r;
671
+ }
672
+ //#endregion
673
+ //#region node_modules/yaml/browser/dist/stringify/stringifyString.js
674
+ var Ke = (e, t) => ({
675
+ indentAtStart: t ? e.indent.length : e.indentAtStart,
676
+ lineWidth: e.options.lineWidth,
677
+ minContentWidth: e.options.minContentWidth
678
+ }), qe = (e) => /^(%|---|\.\.\.)/m.test(e);
679
+ function Je(e, t, n) {
680
+ if (!t || t < 0) return !1;
681
+ let r = t - n, i = e.length;
682
+ if (i <= r) return !1;
683
+ for (let t = 0, n = 0; t < i; ++t) if (e[t] === "\n") {
684
+ if (t - n > r) return !0;
685
+ if (n = t + 1, i - n <= r) return !1;
686
+ }
687
+ return !0;
688
+ }
689
+ function Ye(e, t) {
690
+ let n = JSON.stringify(e);
691
+ if (t.options.doubleQuotedAsJSON) return n;
692
+ let { implicitKey: r } = t, i = t.options.doubleQuotedMinMultiLineLength, a = t.indent || (qe(e) ? " " : ""), o = "", s = 0;
693
+ for (let e = 0, t = n[e]; t; t = n[++e]) if (t === " " && n[e + 1] === "\\" && n[e + 2] === "n" && (o += n.slice(s, e) + "\\ ", e += 1, s = e, t = "\\"), t === "\\") switch (n[e + 1]) {
694
+ case "u":
695
+ {
696
+ o += n.slice(s, e);
697
+ let t = n.substr(e + 2, 4);
698
+ switch (t) {
699
+ case "0000":
700
+ o += "\\0";
701
+ break;
702
+ case "0007":
703
+ o += "\\a";
704
+ break;
705
+ case "000b":
706
+ o += "\\v";
707
+ break;
708
+ case "001b":
709
+ o += "\\e";
710
+ break;
711
+ case "0085":
712
+ o += "\\N";
713
+ break;
714
+ case "00a0":
715
+ o += "\\_";
716
+ break;
717
+ case "2028":
718
+ o += "\\L";
719
+ break;
720
+ case "2029":
721
+ o += "\\P";
722
+ break;
723
+ default: t.substr(0, 2) === "00" ? o += "\\x" + t.substr(2) : o += n.substr(e, 6);
724
+ }
725
+ e += 5, s = e + 1;
726
+ }
727
+ break;
728
+ case "n":
729
+ if (r || n[e + 2] === "\"" || n.length < i) e += 1;
730
+ else {
731
+ for (o += n.slice(s, e) + "\n\n"; n[e + 2] === "\\" && n[e + 3] === "n" && n[e + 4] !== "\"";) o += "\n", e += 2;
732
+ o += a, n[e + 2] === " " && (o += "\\"), e += 1, s = e + 1;
733
+ }
734
+ break;
735
+ default: e += 1;
736
+ }
737
+ return o = s ? o + n.slice(s) : n, r ? o : We(o, a, Ue, Ke(t, !1));
738
+ }
739
+ function Xe(e, t) {
740
+ if (t.options.singleQuote === !1 || t.implicitKey && e.includes("\n") || /[ \t]\n|\n[ \t]/.test(e)) return Ye(e, t);
741
+ let n = t.indent || (qe(e) ? " " : ""), r = "'" + e.replace(/'/g, "''").replace(/\n+/g, `$&\n${n}`) + "'";
742
+ return t.implicitKey ? r : We(r, n, Ve, Ke(t, !1));
743
+ }
744
+ function K(e, t) {
745
+ let { singleQuote: n } = t.options, r;
746
+ if (n === !1) r = Ye;
747
+ else {
748
+ let t = e.includes("\""), i = e.includes("'");
749
+ r = t && !i ? Xe : i && !t ? Ye : n ? Xe : Ye;
750
+ }
751
+ return r(e, t);
752
+ }
753
+ var Ze;
754
+ try {
755
+ Ze = /* @__PURE__ */ RegExp("(^|(?<!\n))\n+(?!\n|$)", "g");
756
+ } catch {
757
+ Ze = /\n+(?!\n|$)/g;
758
+ }
759
+ function Qe({ comment: e, type: t, value: n }, r, i, a) {
760
+ let { blockQuote: o, commentString: s, lineWidth: c } = r.options;
761
+ if (!o || /\n[\t ]+$/.test(n) || /^\s*$/.test(n)) return K(n, r);
762
+ let l = r.indent || (r.forceBlockIndent || qe(n) ? " " : ""), u = o === "literal" ? !0 : o === "folded" || t === U.BLOCK_FOLDED ? !1 : t === U.BLOCK_LITERAL || !Je(n, c, l.length);
763
+ if (!n) return u ? "|\n" : ">\n";
764
+ let d, f;
765
+ for (f = n.length; f > 0; --f) {
766
+ let e = n[f - 1];
767
+ if (e !== "\n" && e !== " " && e !== " ") break;
768
+ }
769
+ let p = n.substring(f), m = p.indexOf("\n");
770
+ m === -1 ? d = "-" : n === p || m !== p.length - 1 ? (d = "+", a && a()) : d = "", p &&= (n = n.slice(0, -p.length), p[p.length - 1] === "\n" && (p = p.slice(0, -1)), p.replace(Ze, `$&${l}`));
771
+ let h = !1, g, _ = -1;
772
+ for (g = 0; g < n.length; ++g) {
773
+ let e = n[g];
774
+ if (e === " ") h = !0;
775
+ else if (e === "\n") _ = g;
776
+ else break;
777
+ }
778
+ let v = n.substring(0, _ < g ? _ + 1 : g);
779
+ v &&= (n = n.substring(v.length), v.replace(/\n+/g, `$&${l}`));
780
+ let y = (u ? "|" : ">") + (h ? l ? "2" : "1" : "") + d;
781
+ if (e && (y += " " + s(e.replace(/ ?[\r\n]+/g, " ")), i && i()), u) return n = n.replace(/\n+/g, `$&${l}`), `${y}\n${l}${v}${n}${p}`;
782
+ n = n.replace(/\n+/g, "\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${l}`);
783
+ let b = We(`${v}${n}${p}`, l, He, Ke(r, !0));
784
+ return `${y}\n${l}${b}`;
785
+ }
786
+ function $e(e, t, n, r) {
787
+ let { type: i, value: a } = e, { actualString: o, implicitKey: s, indent: c, indentStep: l, inFlow: u } = t;
788
+ if (s && a.includes("\n") || u && /[[\]{},]/.test(a)) return K(a, t);
789
+ if (!a || /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a)) return s || u || !a.includes("\n") ? K(a, t) : Qe(e, t, n, r);
790
+ if (!s && !u && i !== U.PLAIN && a.includes("\n")) return Qe(e, t, n, r);
791
+ if (qe(a)) {
792
+ if (c === "") return t.forceBlockIndent = !0, Qe(e, t, n, r);
793
+ if (s && c === l) return K(a, t);
794
+ }
795
+ let d = a.replace(/\n+/g, `$&\n${c}`);
796
+ if (o) {
797
+ let e = (e) => e.default && e.tag !== "tag:yaml.org,2002:str" && e.test?.test(d), { compat: n, tags: r } = t.doc.schema;
798
+ if (r.some(e) || n?.some(e)) return K(a, t);
799
+ }
800
+ return s ? d : We(d, c, Ve, Ke(t, !1));
801
+ }
802
+ function et(e, t, n, r) {
803
+ let { implicitKey: i, inFlow: a } = t, o = typeof e.value == "string" ? e : Object.assign({}, e, { value: String(e.value) }), { type: s } = e;
804
+ s !== U.QUOTE_DOUBLE && /[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value) && (s = U.QUOTE_DOUBLE);
805
+ let c = (e) => {
806
+ switch (e) {
807
+ case U.BLOCK_FOLDED:
808
+ case U.BLOCK_LITERAL: return i || a ? K(o.value, t) : Qe(o, t, n, r);
809
+ case U.QUOTE_DOUBLE: return Ye(o.value, t);
810
+ case U.QUOTE_SINGLE: return Xe(o.value, t);
811
+ case U.PLAIN: return $e(o, t, n, r);
812
+ default: return null;
813
+ }
814
+ }, l = c(s);
815
+ if (l === null) {
816
+ let { defaultKeyType: e, defaultStringType: n } = t.options, r = i && e || n;
817
+ if (l = c(r), l === null) throw Error(`Unsupported default string type ${r}`);
818
+ }
819
+ return l;
820
+ }
821
+ //#endregion
822
+ //#region node_modules/yaml/browser/dist/stringify/stringify.js
823
+ function tt(e, t) {
824
+ let n = Object.assign({
825
+ blockQuote: !0,
826
+ commentString: Be,
827
+ defaultKeyType: null,
828
+ defaultStringType: "PLAIN",
829
+ directives: null,
830
+ doubleQuotedAsJSON: !1,
831
+ doubleQuotedMinMultiLineLength: 40,
832
+ falseStr: "false",
833
+ flowCollectionPadding: !0,
834
+ indentSeq: !0,
835
+ lineWidth: 80,
836
+ minContentWidth: 20,
837
+ nullStr: "null",
838
+ simpleKeys: !1,
839
+ singleQuote: null,
840
+ trueStr: "true",
841
+ verifyAliasOrder: !0
842
+ }, e.schema.toStringOptions, t), r;
843
+ switch (n.collectionStyle) {
844
+ case "block":
845
+ r = !1;
846
+ break;
847
+ case "flow":
848
+ r = !0;
849
+ break;
850
+ default: r = null;
851
+ }
852
+ return {
853
+ anchors: /* @__PURE__ */ new Set(),
854
+ doc: e,
855
+ flowCollectionPadding: n.flowCollectionPadding ? " " : "",
856
+ indent: "",
857
+ indentStep: typeof n.indent == "number" ? " ".repeat(n.indent) : " ",
858
+ inFlow: r,
859
+ options: n
860
+ };
861
+ }
862
+ function nt(e, t) {
863
+ if (t.tag) {
864
+ let n = e.filter((e) => e.tag === t.tag);
865
+ if (n.length > 0) return n.find((e) => e.format === t.format) ?? n[0];
866
+ }
867
+ let n, r;
868
+ if (N(t)) {
869
+ r = t.value;
870
+ let i = e.filter((e) => e.identify?.(r));
871
+ n = i.find((e) => e.format === t.format) ?? i.find((e) => !e.format);
872
+ } else r = t, n = e.find((e) => e.nodeClass && r instanceof e.nodeClass);
873
+ if (!n) {
874
+ let e = r?.constructor?.name ?? typeof r;
875
+ throw Error(`Tag not resolved for ${e} value`);
876
+ }
877
+ return n;
878
+ }
879
+ function rt(e, t, { anchors: n, doc: r }) {
880
+ if (!r.directives) return "";
881
+ let i = [], a = (N(e) || F(e)) && e.anchor;
882
+ a && Ee(a) && (n.add(a), i.push(`&${a}`));
883
+ let o = e.tag ? e.tag : t.default ? null : t.tag;
884
+ return o && i.push(r.directives.tagString(o)), i.join(" ");
885
+ }
886
+ function it(e, t, n, r) {
887
+ if (M(e)) return e.toString(t, n, r);
888
+ if (ge(e)) {
889
+ if (t.doc.directives) return e.toString(t);
890
+ if (t.resolvedAliases?.has(e)) throw TypeError("Cannot stringify circular structure without alias nodes");
891
+ t.resolvedAliases ? t.resolvedAliases.add(e) : t.resolvedAliases = /* @__PURE__ */ new Set([e]), e = e.resolve(t.doc);
892
+ }
893
+ let i, a = I(e) ? e : t.doc.createNode(e, { onTagObj: (e) => i = e });
894
+ i ||= nt(t.doc.schema.tags, a);
895
+ let o = rt(a, i, t);
896
+ o.length > 0 && (t.indentAtStart = (t.indentAtStart ?? 0) + o.length + 1);
897
+ let s = typeof i.stringify == "function" ? i.stringify(a, t, n, r) : N(a) ? et(a, t, n, r) : a.toString(t, n, r);
898
+ return o ? N(a) || s[0] === "{" || s[0] === "[" ? `${o} ${s}` : `${o}\n${t.indent}${s}` : s;
899
+ }
900
+ //#endregion
901
+ //#region node_modules/yaml/browser/dist/stringify/stringifyPair.js
902
+ function at({ key: e, value: t }, n, r, i) {
903
+ let { allNullValues: a, doc: o, indent: s, indentStep: c, options: { commentString: l, indentSeq: u, simpleKeys: d } } = n, f = I(e) && e.comment || null;
904
+ if (d) {
905
+ if (f) throw Error("With simple keys, key nodes cannot have comments");
906
+ if (F(e) || !I(e) && typeof e == "object") throw Error("With simple keys, collection cannot be used as a key value");
907
+ }
908
+ let p = !d && (!e || f && t == null && !n.inFlow || F(e) || (N(e) ? e.type === U.BLOCK_FOLDED || e.type === U.BLOCK_LITERAL : typeof e == "object"));
909
+ n = Object.assign({}, n, {
910
+ allNullValues: !1,
911
+ implicitKey: !p && (d || !a),
912
+ indent: s + c
913
+ });
914
+ let m = !1, h = !1, g = it(e, n, () => m = !0, () => h = !0);
915
+ if (!p && !n.inFlow && g.length > 1024) {
916
+ if (d) throw Error("With simple keys, single line scalar must not span more than 1024 characters");
917
+ p = !0;
918
+ }
919
+ if (n.inFlow) {
920
+ if (a || t == null) return m && r && r(), g === "" ? "?" : p ? `? ${g}` : g;
921
+ } else if (a && !d || t == null && p) return g = `? ${g}`, f && !m ? g += G(g, n.indent, l(f)) : h && i && i(), g;
922
+ m && (f = null), p ? (f && (g += G(g, n.indent, l(f))), g = `? ${g}\n${s}:`) : (g = `${g}:`, f && (g += G(g, n.indent, l(f))));
923
+ let _, v, y;
924
+ I(t) ? (_ = !!t.spaceBefore, v = t.commentBefore, y = t.comment) : (_ = !1, v = null, y = null, t && typeof t == "object" && (t = o.createNode(t))), n.implicitKey = !1, !p && !f && N(t) && (n.indentAtStart = g.length + 1), h = !1, !u && c.length >= 2 && !n.inFlow && !p && P(t) && !t.flow && !t.tag && !t.anchor && (n.indent = n.indent.substring(2));
925
+ let b = !1, x = it(t, n, () => b = !0, () => h = !0), S = " ";
926
+ if (f || _ || v) {
927
+ if (S = _ ? "\n" : "", v) {
928
+ let e = l(v);
929
+ S += `\n${W(e, n.indent)}`;
930
+ }
931
+ x === "" && !n.inFlow ? S === "\n" && (S = "\n\n") : S += `\n${n.indent}`;
932
+ } else if (!p && F(t)) {
933
+ let e = x[0], r = x.indexOf("\n"), i = r !== -1, a = n.inFlow ?? t.flow ?? t.items.length === 0;
934
+ if (i || !a) {
935
+ let t = !1;
936
+ if (i && (e === "&" || e === "!")) {
937
+ let n = x.indexOf(" ");
938
+ e === "&" && n !== -1 && n < r && x[n + 1] === "!" && (n = x.indexOf(" ", n + 1)), (n === -1 || r < n) && (t = !0);
939
+ }
940
+ t || (S = `\n${n.indent}`);
941
+ }
942
+ } else (x === "" || x[0] === "\n") && (S = "");
943
+ return g += S + x, n.inFlow ? b && r && r() : y && !b ? g += G(g, n.indent, l(y)) : h && i && i(), g;
944
+ }
945
+ //#endregion
946
+ //#region node_modules/yaml/browser/dist/log.js
947
+ function ot(e, t) {
948
+ (e === "debug" || e === "warn") && (typeof process < "u" && process.emitWarning ? process.emitWarning(t) : console.warn(t));
949
+ }
950
+ //#endregion
951
+ //#region node_modules/yaml/browser/dist/nodes/addPairToJSMap.js
952
+ var st = "<<";
953
+ function ct(e, t, { key: n, value: r }) {
954
+ if (e?.doc.schema.merge && lt(n)) {
955
+ if (r = ge(r) ? r.resolve(e.doc) : r, P(r)) for (let n of r.items) ut(e, t, n);
956
+ else if (Array.isArray(r)) for (let n of r) ut(e, t, n);
957
+ else ut(e, t, r);
958
+ } else {
959
+ let i = H(n, "", e);
960
+ if (t instanceof Map) t.set(i, H(r, i, e));
961
+ else if (t instanceof Set) t.add(i);
962
+ else {
963
+ let a = dt(n, i, e), o = H(r, a, e);
964
+ a in t ? Object.defineProperty(t, a, {
965
+ value: o,
966
+ writable: !0,
967
+ enumerable: !0,
968
+ configurable: !0
969
+ }) : t[a] = o;
970
+ }
971
+ }
972
+ return t;
973
+ }
974
+ var lt = (e) => e === st || N(e) && e.value === st && (!e.type || e.type === U.PLAIN);
975
+ function ut(e, t, n) {
976
+ let r = e && ge(n) ? n.resolve(e.doc) : n;
977
+ if (!j(r)) throw Error("Merge sources must be maps or map aliases");
978
+ let i = r.toJSON(null, e, Map);
979
+ for (let [e, n] of i) t instanceof Map ? t.has(e) || t.set(e, n) : t instanceof Set ? t.add(e) : Object.prototype.hasOwnProperty.call(t, e) || Object.defineProperty(t, e, {
980
+ value: n,
981
+ writable: !0,
982
+ enumerable: !0,
983
+ configurable: !0
984
+ });
985
+ return t;
986
+ }
987
+ function dt(e, t, n) {
988
+ if (t === null) return "";
989
+ if (typeof t != "object") return String(t);
990
+ if (I(e) && n?.doc) {
991
+ let t = tt(n.doc, {});
992
+ t.anchors = /* @__PURE__ */ new Set();
993
+ for (let e of n.anchors.keys()) t.anchors.add(e.anchor);
994
+ t.inFlow = !0, t.inStringifyKey = !0;
995
+ let r = e.toString(t);
996
+ if (!n.mapKeyWarned) {
997
+ let e = JSON.stringify(r);
998
+ e.length > 40 && (e = e.substring(0, 36) + "...\""), ot(n.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`), n.mapKeyWarned = !0;
999
+ }
1000
+ return r;
1001
+ }
1002
+ return JSON.stringify(t);
1003
+ }
1004
+ //#endregion
1005
+ //#region node_modules/yaml/browser/dist/nodes/Pair.js
1006
+ function ft(e, t, n) {
1007
+ return new q(Ie(e, void 0, n), Ie(t, void 0, n));
1008
+ }
1009
+ var q = class e {
1010
+ constructor(e, t = null) {
1011
+ Object.defineProperty(this, A, { value: he }), this.key = e, this.value = t;
1012
+ }
1013
+ clone(t) {
1014
+ let { key: n, value: r } = this;
1015
+ return I(n) && (n = n.clone(t)), I(r) && (r = r.clone(t)), new e(n, r);
1016
+ }
1017
+ toJSON(e, t) {
1018
+ return ct(t, t?.mapAsMap ? /* @__PURE__ */ new Map() : {}, this);
1019
+ }
1020
+ toString(e, t, n) {
1021
+ return e?.doc ? at(this, e, t, n) : JSON.stringify(this);
1022
+ }
1023
+ };
1024
+ //#endregion
1025
+ //#region node_modules/yaml/browser/dist/stringify/stringifyCollection.js
1026
+ function pt(e, t, n) {
1027
+ return (t.inFlow ?? e.flow ? ht : mt)(e, t, n);
1028
+ }
1029
+ function mt({ comment: e, items: t }, n, { blockItemPrefix: r, flowChars: i, itemIndent: a, onChompKeep: o, onComment: s }) {
1030
+ let { indent: c, options: { commentString: l } } = n, u = Object.assign({}, n, {
1031
+ indent: a,
1032
+ type: null
1033
+ }), d = !1, f = [];
1034
+ for (let e = 0; e < t.length; ++e) {
1035
+ let i = t[e], o = null;
1036
+ if (I(i)) !d && i.spaceBefore && f.push(""), gt(n, f, i.commentBefore, d), i.comment && (o = i.comment);
1037
+ else if (M(i)) {
1038
+ let e = I(i.key) ? i.key : null;
1039
+ e && (!d && e.spaceBefore && f.push(""), gt(n, f, e.commentBefore, d));
1040
+ }
1041
+ d = !1;
1042
+ let s = it(i, u, () => o = null, () => d = !0);
1043
+ o && (s += G(s, a, l(o))), d && o && (d = !1), f.push(r + s);
1044
+ }
1045
+ let p;
1046
+ if (f.length === 0) p = i.start + i.end;
1047
+ else {
1048
+ p = f[0];
1049
+ for (let e = 1; e < f.length; ++e) {
1050
+ let t = f[e];
1051
+ p += t ? `\n${c}${t}` : "\n";
1052
+ }
1053
+ }
1054
+ return e ? (p += "\n" + W(l(e), c), s && s()) : d && o && o(), p;
1055
+ }
1056
+ function ht({ items: e }, t, { flowChars: n, itemIndent: r }) {
1057
+ let { indent: i, indentStep: a, flowCollectionPadding: o, options: { commentString: s } } = t;
1058
+ r += a;
1059
+ let c = Object.assign({}, t, {
1060
+ indent: r,
1061
+ inFlow: !0,
1062
+ type: null
1063
+ }), l = !1, u = 0, d = [];
1064
+ for (let n = 0; n < e.length; ++n) {
1065
+ let i = e[n], a = null;
1066
+ if (I(i)) i.spaceBefore && d.push(""), gt(t, d, i.commentBefore, !1), i.comment && (a = i.comment);
1067
+ else if (M(i)) {
1068
+ let e = I(i.key) ? i.key : null;
1069
+ e && (e.spaceBefore && d.push(""), gt(t, d, e.commentBefore, !1), e.comment && (l = !0));
1070
+ let n = I(i.value) ? i.value : null;
1071
+ n ? (n.comment && (a = n.comment), n.commentBefore && (l = !0)) : i.value == null && e?.comment && (a = e.comment);
1072
+ }
1073
+ a && (l = !0);
1074
+ let o = it(i, c, () => a = null);
1075
+ n < e.length - 1 && (o += ","), a && (o += G(o, r, s(a))), !l && (d.length > u || o.includes("\n")) && (l = !0), d.push(o), u = d.length;
1076
+ }
1077
+ let { start: f, end: p } = n;
1078
+ if (d.length === 0) return f + p;
1079
+ if (!l) {
1080
+ let e = d.reduce((e, t) => e + t.length + 2, 2);
1081
+ l = t.options.lineWidth > 0 && e > t.options.lineWidth;
1082
+ }
1083
+ if (l) {
1084
+ let e = f;
1085
+ for (let t of d) e += t ? `\n${a}${i}${t}` : "\n";
1086
+ return `${e}\n${i}${p}`;
1087
+ }
1088
+ return `${f}${o}${d.join(" ")}${o}${p}`;
1089
+ }
1090
+ function gt({ indent: e, options: { commentString: t } }, n, r, i) {
1091
+ if (r && i && (r = r.replace(/^\n+/, "")), r) {
1092
+ let i = W(t(r), e);
1093
+ n.push(i.trimStart());
1094
+ }
1095
+ }
1096
+ //#endregion
1097
+ //#region node_modules/yaml/browser/dist/nodes/YAMLMap.js
1098
+ function J(e, t) {
1099
+ let n = N(t) ? t.value : t;
1100
+ for (let r of e) if (M(r) && (r.key === t || r.key === n || N(r.key) && r.key.value === n)) return r;
1101
+ }
1102
+ var Y = class extends ze {
1103
+ static get tagName() {
1104
+ return "tag:yaml.org,2002:map";
1105
+ }
1106
+ constructor(e) {
1107
+ super(D, e), this.items = [];
1108
+ }
1109
+ static from(e, t, n) {
1110
+ let { keepUndefined: r, replacer: i } = n, a = new this(e), o = (e, o) => {
1111
+ if (typeof i == "function") o = i.call(t, e, o);
1112
+ else if (Array.isArray(i) && !i.includes(e)) return;
1113
+ (o !== void 0 || r) && a.items.push(ft(e, o, n));
1114
+ };
1115
+ if (t instanceof Map) for (let [e, n] of t) o(e, n);
1116
+ else if (t && typeof t == "object") for (let e of Object.keys(t)) o(e, t[e]);
1117
+ return typeof e.sortMapEntries == "function" && a.items.sort(e.sortMapEntries), a;
1118
+ }
1119
+ add(e, t) {
1120
+ let n;
1121
+ n = M(e) ? e : !e || typeof e != "object" || !("key" in e) ? new q(e, e?.value) : new q(e.key, e.value);
1122
+ let r = J(this.items, n.key), i = this.schema?.sortMapEntries;
1123
+ if (r) {
1124
+ if (!t) throw Error(`Key ${n.key} already set`);
1125
+ N(r.value) && Ne(n.value) ? r.value.value = n.value : r.value = n.value;
1126
+ } else if (i) {
1127
+ let e = this.items.findIndex((e) => i(n, e) < 0);
1128
+ e === -1 ? this.items.push(n) : this.items.splice(e, 0, n);
1129
+ } else this.items.push(n);
1130
+ }
1131
+ delete(e) {
1132
+ let t = J(this.items, e);
1133
+ return t ? this.items.splice(this.items.indexOf(t), 1).length > 0 : !1;
1134
+ }
1135
+ get(e, t) {
1136
+ let n = J(this.items, e)?.value;
1137
+ return (!t && N(n) ? n.value : n) ?? void 0;
1138
+ }
1139
+ has(e) {
1140
+ return !!J(this.items, e);
1141
+ }
1142
+ set(e, t) {
1143
+ this.add(new q(e, t), !0);
1144
+ }
1145
+ toJSON(e, t, n) {
1146
+ let r = n ? new n() : t?.mapAsMap ? /* @__PURE__ */ new Map() : {};
1147
+ t?.onCreate && t.onCreate(r);
1148
+ for (let e of this.items) ct(t, r, e);
1149
+ return r;
1150
+ }
1151
+ toString(e, t, n) {
1152
+ if (!e) return JSON.stringify(this);
1153
+ for (let e of this.items) if (!M(e)) throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);
1154
+ return !e.allNullValues && this.hasAllNullValues(!1) && (e = Object.assign({}, e, { allNullValues: !0 })), pt(this, e, {
1155
+ blockItemPrefix: "",
1156
+ flowChars: {
1157
+ start: "{",
1158
+ end: "}"
1159
+ },
1160
+ itemIndent: e.indent || "",
1161
+ onChompKeep: n,
1162
+ onComment: t
1163
+ });
1164
+ }
1165
+ }, _t = {
1166
+ collection: "map",
1167
+ default: !0,
1168
+ nodeClass: Y,
1169
+ tag: "tag:yaml.org,2002:map",
1170
+ resolve(e, t) {
1171
+ return j(e) || t("Expected a mapping for this tag"), e;
1172
+ },
1173
+ createNode: (e, t, n) => Y.from(e, t, n)
1174
+ }, X = class extends ze {
1175
+ static get tagName() {
1176
+ return "tag:yaml.org,2002:seq";
1177
+ }
1178
+ constructor(e) {
1179
+ super(k, e), this.items = [];
1180
+ }
1181
+ add(e) {
1182
+ this.items.push(e);
1183
+ }
1184
+ delete(e) {
1185
+ let t = vt(e);
1186
+ return typeof t == "number" && this.items.splice(t, 1).length > 0;
1187
+ }
1188
+ get(e, t) {
1189
+ let n = vt(e);
1190
+ if (typeof n != "number") return;
1191
+ let r = this.items[n];
1192
+ return !t && N(r) ? r.value : r;
1193
+ }
1194
+ has(e) {
1195
+ let t = vt(e);
1196
+ return typeof t == "number" && t < this.items.length;
1197
+ }
1198
+ set(e, t) {
1199
+ let n = vt(e);
1200
+ if (typeof n != "number") throw Error(`Expected a valid index, not ${e}.`);
1201
+ let r = this.items[n];
1202
+ N(r) && Ne(t) ? r.value = t : this.items[n] = t;
1203
+ }
1204
+ toJSON(e, t) {
1205
+ let n = [];
1206
+ t?.onCreate && t.onCreate(n);
1207
+ let r = 0;
1208
+ for (let e of this.items) n.push(H(e, String(r++), t));
1209
+ return n;
1210
+ }
1211
+ toString(e, t, n) {
1212
+ return e ? pt(this, e, {
1213
+ blockItemPrefix: "- ",
1214
+ flowChars: {
1215
+ start: "[",
1216
+ end: "]"
1217
+ },
1218
+ itemIndent: (e.indent || "") + " ",
1219
+ onChompKeep: n,
1220
+ onComment: t
1221
+ }) : JSON.stringify(this);
1222
+ }
1223
+ static from(e, t, n) {
1224
+ let { replacer: r } = n, i = new this(e);
1225
+ if (t && Symbol.iterator in Object(t)) {
1226
+ let e = 0;
1227
+ for (let a of t) {
1228
+ if (typeof r == "function") {
1229
+ let n = t instanceof Set ? a : String(e++);
1230
+ a = r.call(t, n, a);
1231
+ }
1232
+ i.items.push(Ie(a, void 0, n));
1233
+ }
1234
+ }
1235
+ return i;
1236
+ }
1237
+ };
1238
+ function vt(e) {
1239
+ let t = N(e) ? e.value : e;
1240
+ return t && typeof t == "string" && (t = Number(t)), typeof t == "number" && Number.isInteger(t) && t >= 0 ? t : null;
1241
+ }
1242
+ //#endregion
1243
+ //#region node_modules/yaml/browser/dist/schema/common/seq.js
1244
+ var yt = {
1245
+ collection: "seq",
1246
+ default: !0,
1247
+ nodeClass: X,
1248
+ tag: "tag:yaml.org,2002:seq",
1249
+ resolve(e, t) {
1250
+ return P(e) || t("Expected a sequence for this tag"), e;
1251
+ },
1252
+ createNode: (e, t, n) => X.from(e, t, n)
1253
+ }, bt = {
1254
+ identify: (e) => typeof e == "string",
1255
+ default: !0,
1256
+ tag: "tag:yaml.org,2002:str",
1257
+ resolve: (e) => e,
1258
+ stringify(e, t, n, r) {
1259
+ return t = Object.assign({ actualString: !0 }, t), et(e, t, n, r);
1260
+ }
1261
+ }, xt = {
1262
+ identify: (e) => e == null,
1263
+ createNode: () => new U(null),
1264
+ default: !0,
1265
+ tag: "tag:yaml.org,2002:null",
1266
+ test: /^(?:~|[Nn]ull|NULL)?$/,
1267
+ resolve: () => new U(null),
1268
+ stringify: ({ source: e }, t) => typeof e == "string" && xt.test.test(e) ? e : t.options.nullStr
1269
+ }, St = {
1270
+ identify: (e) => typeof e == "boolean",
1271
+ default: !0,
1272
+ tag: "tag:yaml.org,2002:bool",
1273
+ test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
1274
+ resolve: (e) => new U(e[0] === "t" || e[0] === "T"),
1275
+ stringify({ source: e, value: t }, n) {
1276
+ return e && St.test.test(e) && t === (e[0] === "t" || e[0] === "T") ? e : t ? n.options.trueStr : n.options.falseStr;
1277
+ }
1278
+ };
1279
+ //#endregion
1280
+ //#region node_modules/yaml/browser/dist/stringify/stringifyNumber.js
1281
+ function Z({ format: e, minFractionDigits: t, tag: n, value: r }) {
1282
+ if (typeof r == "bigint") return String(r);
1283
+ let i = typeof r == "number" ? r : Number(r);
1284
+ if (!isFinite(i)) return isNaN(i) ? ".nan" : i < 0 ? "-.inf" : ".inf";
1285
+ let a = JSON.stringify(r);
1286
+ if (!e && t && (!n || n === "tag:yaml.org,2002:float") && /^\d/.test(a)) {
1287
+ let e = a.indexOf(".");
1288
+ e < 0 && (e = a.length, a += ".");
1289
+ let n = t - (a.length - e - 1);
1290
+ for (; n-- > 0;) a += "0";
1291
+ }
1292
+ return a;
1293
+ }
1294
+ //#endregion
1295
+ //#region node_modules/yaml/browser/dist/schema/core/float.js
1296
+ var Ct = {
1297
+ identify: (e) => typeof e == "number",
1298
+ default: !0,
1299
+ tag: "tag:yaml.org,2002:float",
1300
+ test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
1301
+ resolve: (e) => e.slice(-3).toLowerCase() === "nan" ? NaN : e[0] === "-" ? -Infinity : Infinity,
1302
+ stringify: Z
1303
+ }, wt = {
1304
+ identify: (e) => typeof e == "number",
1305
+ default: !0,
1306
+ tag: "tag:yaml.org,2002:float",
1307
+ format: "EXP",
1308
+ test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,
1309
+ resolve: (e) => parseFloat(e),
1310
+ stringify(e) {
1311
+ let t = Number(e.value);
1312
+ return isFinite(t) ? t.toExponential() : Z(e);
1313
+ }
1314
+ }, Tt = {
1315
+ identify: (e) => typeof e == "number",
1316
+ default: !0,
1317
+ tag: "tag:yaml.org,2002:float",
1318
+ test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,
1319
+ resolve(e) {
1320
+ let t = new U(parseFloat(e)), n = e.indexOf(".");
1321
+ return n !== -1 && e[e.length - 1] === "0" && (t.minFractionDigits = e.length - n - 1), t;
1322
+ },
1323
+ stringify: Z
1324
+ }, Et = (e) => typeof e == "bigint" || Number.isInteger(e), Dt = (e, t, n, { intAsBigInt: r }) => r ? BigInt(e) : parseInt(e.substring(t), n);
1325
+ function Ot(e, t, n) {
1326
+ let { value: r } = e;
1327
+ return Et(r) && r >= 0 ? n + r.toString(t) : Z(e);
1328
+ }
1329
+ var kt = {
1330
+ identify: (e) => Et(e) && e >= 0,
1331
+ default: !0,
1332
+ tag: "tag:yaml.org,2002:int",
1333
+ format: "OCT",
1334
+ test: /^0o[0-7]+$/,
1335
+ resolve: (e, t, n) => Dt(e, 2, 8, n),
1336
+ stringify: (e) => Ot(e, 8, "0o")
1337
+ }, At = {
1338
+ identify: Et,
1339
+ default: !0,
1340
+ tag: "tag:yaml.org,2002:int",
1341
+ test: /^[-+]?[0-9]+$/,
1342
+ resolve: (e, t, n) => Dt(e, 0, 10, n),
1343
+ stringify: Z
1344
+ }, jt = {
1345
+ identify: (e) => Et(e) && e >= 0,
1346
+ default: !0,
1347
+ tag: "tag:yaml.org,2002:int",
1348
+ format: "HEX",
1349
+ test: /^0x[0-9a-fA-F]+$/,
1350
+ resolve: (e, t, n) => Dt(e, 2, 16, n),
1351
+ stringify: (e) => Ot(e, 16, "0x")
1352
+ }, Mt = [
1353
+ _t,
1354
+ yt,
1355
+ bt,
1356
+ xt,
1357
+ St,
1358
+ kt,
1359
+ At,
1360
+ jt,
1361
+ Ct,
1362
+ wt,
1363
+ Tt
1364
+ ];
1365
+ //#endregion
1366
+ //#region node_modules/yaml/browser/dist/schema/json/schema.js
1367
+ function Nt(e) {
1368
+ return typeof e == "bigint" || Number.isInteger(e);
1369
+ }
1370
+ var Pt = ({ value: e }) => JSON.stringify(e), Ft = [
1371
+ {
1372
+ identify: (e) => typeof e == "string",
1373
+ default: !0,
1374
+ tag: "tag:yaml.org,2002:str",
1375
+ resolve: (e) => e,
1376
+ stringify: Pt
1377
+ },
1378
+ {
1379
+ identify: (e) => e == null,
1380
+ createNode: () => new U(null),
1381
+ default: !0,
1382
+ tag: "tag:yaml.org,2002:null",
1383
+ test: /^null$/,
1384
+ resolve: () => null,
1385
+ stringify: Pt
1386
+ },
1387
+ {
1388
+ identify: (e) => typeof e == "boolean",
1389
+ default: !0,
1390
+ tag: "tag:yaml.org,2002:bool",
1391
+ test: /^true|false$/,
1392
+ resolve: (e) => e === "true",
1393
+ stringify: Pt
1394
+ },
1395
+ {
1396
+ identify: Nt,
1397
+ default: !0,
1398
+ tag: "tag:yaml.org,2002:int",
1399
+ test: /^-?(?:0|[1-9][0-9]*)$/,
1400
+ resolve: (e, t, { intAsBigInt: n }) => n ? BigInt(e) : parseInt(e, 10),
1401
+ stringify: ({ value: e }) => Nt(e) ? e.toString() : JSON.stringify(e)
1402
+ },
1403
+ {
1404
+ identify: (e) => typeof e == "number",
1405
+ default: !0,
1406
+ tag: "tag:yaml.org,2002:float",
1407
+ test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
1408
+ resolve: (e) => parseFloat(e),
1409
+ stringify: Pt
1410
+ }
1411
+ ], It = [_t, yt].concat(Ft, {
1412
+ default: !0,
1413
+ tag: "",
1414
+ test: /^/,
1415
+ resolve(e, t) {
1416
+ return t(`Unresolved plain scalar ${JSON.stringify(e)}`), e;
1417
+ }
1418
+ }), Lt = {
1419
+ identify: (e) => e instanceof Uint8Array,
1420
+ default: !1,
1421
+ tag: "tag:yaml.org,2002:binary",
1422
+ resolve(e, t) {
1423
+ if (typeof Buffer == "function") return Buffer.from(e, "base64");
1424
+ if (typeof atob == "function") {
1425
+ let t = atob(e.replace(/[\n\r]/g, "")), n = new Uint8Array(t.length);
1426
+ for (let e = 0; e < t.length; ++e) n[e] = t.charCodeAt(e);
1427
+ return n;
1428
+ }
1429
+ return t("This environment does not support reading binary tags; either Buffer or atob is required"), e;
1430
+ },
1431
+ stringify({ comment: e, type: t, value: n }, r, i, a) {
1432
+ let o = n, s;
1433
+ if (typeof Buffer == "function") s = o instanceof Buffer ? o.toString("base64") : Buffer.from(o.buffer).toString("base64");
1434
+ else if (typeof btoa == "function") {
1435
+ let e = "";
1436
+ for (let t = 0; t < o.length; ++t) e += String.fromCharCode(o[t]);
1437
+ s = btoa(e);
1438
+ } else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");
1439
+ if (t ||= U.BLOCK_LITERAL, t !== U.QUOTE_DOUBLE) {
1440
+ let e = Math.max(r.options.lineWidth - r.indent.length, r.options.minContentWidth), n = Math.ceil(s.length / e), i = Array(n);
1441
+ for (let t = 0, r = 0; t < n; ++t, r += e) i[t] = s.substr(r, e);
1442
+ s = i.join(t === U.BLOCK_LITERAL ? "\n" : " ");
1443
+ }
1444
+ return et({
1445
+ comment: e,
1446
+ type: t,
1447
+ value: s
1448
+ }, r, i, a);
1449
+ }
1450
+ };
1451
+ //#endregion
1452
+ //#region node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js
1453
+ function Rt(e, t) {
1454
+ if (P(e)) for (let n = 0; n < e.items.length; ++n) {
1455
+ let r = e.items[n];
1456
+ if (!M(r)) {
1457
+ if (j(r)) {
1458
+ r.items.length > 1 && t("Each pair must have its own sequence indicator");
1459
+ let e = r.items[0] || new q(new U(null));
1460
+ if (r.commentBefore && (e.key.commentBefore = e.key.commentBefore ? `${r.commentBefore}\n${e.key.commentBefore}` : r.commentBefore), r.comment) {
1461
+ let t = e.value ?? e.key;
1462
+ t.comment = t.comment ? `${r.comment}\n${t.comment}` : r.comment;
1463
+ }
1464
+ r = e;
1465
+ }
1466
+ e.items[n] = M(r) ? r : new q(r);
1467
+ }
1468
+ }
1469
+ else t("Expected a sequence for this tag");
1470
+ return e;
1471
+ }
1472
+ function zt(e, t, n) {
1473
+ let { replacer: r } = n, i = new X(e);
1474
+ i.tag = "tag:yaml.org,2002:pairs";
1475
+ let a = 0;
1476
+ if (t && Symbol.iterator in Object(t)) for (let e of t) {
1477
+ typeof r == "function" && (e = r.call(t, String(a++), e));
1478
+ let o, s;
1479
+ if (Array.isArray(e)) {
1480
+ if (e.length === 2) o = e[0], s = e[1];
1481
+ else throw TypeError(`Expected [key, value] tuple: ${e}`);
1482
+ } else if (e && e instanceof Object) {
1483
+ let t = Object.keys(e);
1484
+ if (t.length === 1) o = t[0], s = e[o];
1485
+ else throw TypeError(`Expected tuple with one key, not ${t.length} keys`);
1486
+ } else o = e;
1487
+ i.items.push(ft(o, s, n));
1488
+ }
1489
+ return i;
1490
+ }
1491
+ var Bt = {
1492
+ collection: "seq",
1493
+ default: !1,
1494
+ tag: "tag:yaml.org,2002:pairs",
1495
+ resolve: Rt,
1496
+ createNode: zt
1497
+ }, Vt = class e extends X {
1498
+ constructor() {
1499
+ super(), this.add = Y.prototype.add.bind(this), this.delete = Y.prototype.delete.bind(this), this.get = Y.prototype.get.bind(this), this.has = Y.prototype.has.bind(this), this.set = Y.prototype.set.bind(this), this.tag = e.tag;
1500
+ }
1501
+ toJSON(e, t) {
1502
+ if (!t) return super.toJSON(e);
1503
+ let n = /* @__PURE__ */ new Map();
1504
+ t?.onCreate && t.onCreate(n);
1505
+ for (let e of this.items) {
1506
+ let r, i;
1507
+ if (M(e) ? (r = H(e.key, "", t), i = H(e.value, r, t)) : r = H(e, "", t), n.has(r)) throw Error("Ordered maps must not include duplicate keys");
1508
+ n.set(r, i);
1509
+ }
1510
+ return n;
1511
+ }
1512
+ static from(e, t, n) {
1513
+ let r = zt(e, t, n), i = new this();
1514
+ return i.items = r.items, i;
1515
+ }
1516
+ };
1517
+ Vt.tag = "tag:yaml.org,2002:omap";
1518
+ var Ht = {
1519
+ collection: "seq",
1520
+ identify: (e) => e instanceof Map,
1521
+ nodeClass: Vt,
1522
+ default: !1,
1523
+ tag: "tag:yaml.org,2002:omap",
1524
+ resolve(e, t) {
1525
+ let n = Rt(e, t), r = [];
1526
+ for (let { key: e } of n.items) N(e) && (r.includes(e.value) ? t(`Ordered maps must not include duplicate keys: ${e.value}`) : r.push(e.value));
1527
+ return Object.assign(new Vt(), n);
1528
+ },
1529
+ createNode: (e, t, n) => Vt.from(e, t, n)
1530
+ };
1531
+ //#endregion
1532
+ //#region node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js
1533
+ function Ut({ value: e, source: t }, n) {
1534
+ return t && (e ? Wt : Gt).test.test(t) ? t : e ? n.options.trueStr : n.options.falseStr;
1535
+ }
1536
+ var Wt = {
1537
+ identify: (e) => e === !0,
1538
+ default: !0,
1539
+ tag: "tag:yaml.org,2002:bool",
1540
+ test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
1541
+ resolve: () => new U(!0),
1542
+ stringify: Ut
1543
+ }, Gt = {
1544
+ identify: (e) => e === !1,
1545
+ default: !0,
1546
+ tag: "tag:yaml.org,2002:bool",
1547
+ test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
1548
+ resolve: () => new U(!1),
1549
+ stringify: Ut
1550
+ }, Kt = {
1551
+ identify: (e) => typeof e == "number",
1552
+ default: !0,
1553
+ tag: "tag:yaml.org,2002:float",
1554
+ test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
1555
+ resolve: (e) => e.slice(-3).toLowerCase() === "nan" ? NaN : e[0] === "-" ? -Infinity : Infinity,
1556
+ stringify: Z
1557
+ }, qt = {
1558
+ identify: (e) => typeof e == "number",
1559
+ default: !0,
1560
+ tag: "tag:yaml.org,2002:float",
1561
+ format: "EXP",
1562
+ test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,
1563
+ resolve: (e) => parseFloat(e.replace(/_/g, "")),
1564
+ stringify(e) {
1565
+ let t = Number(e.value);
1566
+ return isFinite(t) ? t.toExponential() : Z(e);
1567
+ }
1568
+ }, Jt = {
1569
+ identify: (e) => typeof e == "number",
1570
+ default: !0,
1571
+ tag: "tag:yaml.org,2002:float",
1572
+ test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
1573
+ resolve(e) {
1574
+ let t = new U(parseFloat(e.replace(/_/g, ""))), n = e.indexOf(".");
1575
+ if (n !== -1) {
1576
+ let r = e.substring(n + 1).replace(/_/g, "");
1577
+ r[r.length - 1] === "0" && (t.minFractionDigits = r.length);
1578
+ }
1579
+ return t;
1580
+ },
1581
+ stringify: Z
1582
+ }, Yt = (e) => typeof e == "bigint" || Number.isInteger(e);
1583
+ function Xt(e, t, n, { intAsBigInt: r }) {
1584
+ let i = e[0];
1585
+ if ((i === "-" || i === "+") && (t += 1), e = e.substring(t).replace(/_/g, ""), r) {
1586
+ switch (n) {
1587
+ case 2:
1588
+ e = `0b${e}`;
1589
+ break;
1590
+ case 8:
1591
+ e = `0o${e}`;
1592
+ break;
1593
+ case 16: e = `0x${e}`;
1594
+ }
1595
+ let t = BigInt(e);
1596
+ return i === "-" ? BigInt(-1) * t : t;
1597
+ }
1598
+ let a = parseInt(e, n);
1599
+ return i === "-" ? -1 * a : a;
1600
+ }
1601
+ function Zt(e, t, n) {
1602
+ let { value: r } = e;
1603
+ if (Yt(r)) {
1604
+ let e = r.toString(t);
1605
+ return r < 0 ? "-" + n + e.substr(1) : n + e;
1606
+ }
1607
+ return Z(e);
1608
+ }
1609
+ var Qt = {
1610
+ identify: Yt,
1611
+ default: !0,
1612
+ tag: "tag:yaml.org,2002:int",
1613
+ format: "BIN",
1614
+ test: /^[-+]?0b[0-1_]+$/,
1615
+ resolve: (e, t, n) => Xt(e, 2, 2, n),
1616
+ stringify: (e) => Zt(e, 2, "0b")
1617
+ }, $t = {
1618
+ identify: Yt,
1619
+ default: !0,
1620
+ tag: "tag:yaml.org,2002:int",
1621
+ format: "OCT",
1622
+ test: /^[-+]?0[0-7_]+$/,
1623
+ resolve: (e, t, n) => Xt(e, 1, 8, n),
1624
+ stringify: (e) => Zt(e, 8, "0")
1625
+ }, en = {
1626
+ identify: Yt,
1627
+ default: !0,
1628
+ tag: "tag:yaml.org,2002:int",
1629
+ test: /^[-+]?[0-9][0-9_]*$/,
1630
+ resolve: (e, t, n) => Xt(e, 0, 10, n),
1631
+ stringify: Z
1632
+ }, tn = {
1633
+ identify: Yt,
1634
+ default: !0,
1635
+ tag: "tag:yaml.org,2002:int",
1636
+ format: "HEX",
1637
+ test: /^[-+]?0x[0-9a-fA-F_]+$/,
1638
+ resolve: (e, t, n) => Xt(e, 2, 16, n),
1639
+ stringify: (e) => Zt(e, 16, "0x")
1640
+ }, nn = class e extends Y {
1641
+ constructor(t) {
1642
+ super(t), this.tag = e.tag;
1643
+ }
1644
+ add(e) {
1645
+ let t;
1646
+ t = M(e) ? e : e && typeof e == "object" && "key" in e && "value" in e && e.value === null ? new q(e.key, null) : new q(e, null), J(this.items, t.key) || this.items.push(t);
1647
+ }
1648
+ get(e, t) {
1649
+ let n = J(this.items, e);
1650
+ return !t && M(n) ? N(n.key) ? n.key.value : n.key : n;
1651
+ }
1652
+ set(e, t) {
1653
+ if (typeof t != "boolean") throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);
1654
+ let n = J(this.items, e);
1655
+ n && !t ? this.items.splice(this.items.indexOf(n), 1) : !n && t && this.items.push(new q(e));
1656
+ }
1657
+ toJSON(e, t) {
1658
+ return super.toJSON(e, t, Set);
1659
+ }
1660
+ toString(e, t, n) {
1661
+ if (!e) return JSON.stringify(this);
1662
+ if (this.hasAllNullValues(!0)) return super.toString(Object.assign({}, e, { allNullValues: !0 }), t, n);
1663
+ throw Error("Set items must all have null values");
1664
+ }
1665
+ static from(e, t, n) {
1666
+ let { replacer: r } = n, i = new this(e);
1667
+ if (t && Symbol.iterator in Object(t)) for (let e of t) typeof r == "function" && (e = r.call(t, e, e)), i.items.push(ft(e, null, n));
1668
+ return i;
1669
+ }
1670
+ };
1671
+ nn.tag = "tag:yaml.org,2002:set";
1672
+ var rn = {
1673
+ collection: "map",
1674
+ identify: (e) => e instanceof Set,
1675
+ nodeClass: nn,
1676
+ default: !1,
1677
+ tag: "tag:yaml.org,2002:set",
1678
+ createNode: (e, t, n) => nn.from(e, t, n),
1679
+ resolve(e, t) {
1680
+ if (j(e)) {
1681
+ if (e.hasAllNullValues(!0)) return Object.assign(new nn(), e);
1682
+ t("Set items must all have null values");
1683
+ } else t("Expected a mapping for this tag");
1684
+ return e;
1685
+ }
1686
+ };
1687
+ //#endregion
1688
+ //#region node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js
1689
+ function an(e, t) {
1690
+ let n = e[0], r = n === "-" || n === "+" ? e.substring(1) : e, i = (e) => t ? BigInt(e) : Number(e), a = r.replace(/_/g, "").split(":").reduce((e, t) => e * i(60) + i(t), i(0));
1691
+ return n === "-" ? i(-1) * a : a;
1692
+ }
1693
+ function on(e) {
1694
+ let { value: t } = e, n = (e) => e;
1695
+ if (typeof t == "bigint") n = (e) => BigInt(e);
1696
+ else if (isNaN(t) || !isFinite(t)) return Z(e);
1697
+ let r = "";
1698
+ t < 0 && (r = "-", t *= n(-1));
1699
+ let i = n(60), a = [t % i];
1700
+ return t < 60 ? a.unshift(0) : (t = (t - a[0]) / i, a.unshift(t % i), t >= 60 && (t = (t - a[0]) / i, a.unshift(t))), r + a.map((e) => String(e).padStart(2, "0")).join(":").replace(/000000\d*$/, "");
1701
+ }
1702
+ var sn = {
1703
+ identify: (e) => typeof e == "bigint" || Number.isInteger(e),
1704
+ default: !0,
1705
+ tag: "tag:yaml.org,2002:int",
1706
+ format: "TIME",
1707
+ test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
1708
+ resolve: (e, t, { intAsBigInt: n }) => an(e, n),
1709
+ stringify: on
1710
+ }, cn = {
1711
+ identify: (e) => typeof e == "number",
1712
+ default: !0,
1713
+ tag: "tag:yaml.org,2002:float",
1714
+ format: "TIME",
1715
+ test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
1716
+ resolve: (e) => an(e, !1),
1717
+ stringify: on
1718
+ }, ln = {
1719
+ identify: (e) => e instanceof Date,
1720
+ default: !0,
1721
+ tag: "tag:yaml.org,2002:timestamp",
1722
+ test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),
1723
+ resolve(e) {
1724
+ let t = e.match(ln.test);
1725
+ if (!t) throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");
1726
+ let [, n, r, i, a, o, s] = t.map(Number), c = t[7] ? Number((t[7] + "00").substr(1, 3)) : 0, l = Date.UTC(n, r - 1, i, a || 0, o || 0, s || 0, c), u = t[8];
1727
+ if (u && u !== "Z") {
1728
+ let e = an(u, !1);
1729
+ Math.abs(e) < 30 && (e *= 60), l -= 6e4 * e;
1730
+ }
1731
+ return new Date(l);
1732
+ },
1733
+ stringify: ({ value: e }) => e.toISOString().replace(/((T00:00)?:00)?\.000Z$/, "")
1734
+ }, un = [
1735
+ _t,
1736
+ yt,
1737
+ bt,
1738
+ xt,
1739
+ Wt,
1740
+ Gt,
1741
+ Qt,
1742
+ $t,
1743
+ en,
1744
+ tn,
1745
+ Kt,
1746
+ qt,
1747
+ Jt,
1748
+ Lt,
1749
+ Ht,
1750
+ Bt,
1751
+ rn,
1752
+ sn,
1753
+ cn,
1754
+ ln
1755
+ ], dn = /* @__PURE__ */ new Map([
1756
+ ["core", Mt],
1757
+ ["failsafe", [
1758
+ _t,
1759
+ yt,
1760
+ bt
1761
+ ]],
1762
+ ["json", It],
1763
+ ["yaml11", un],
1764
+ ["yaml-1.1", un]
1765
+ ]), fn = {
1766
+ binary: Lt,
1767
+ bool: St,
1768
+ float: Tt,
1769
+ floatExp: wt,
1770
+ floatNaN: Ct,
1771
+ floatTime: cn,
1772
+ int: At,
1773
+ intHex: jt,
1774
+ intOct: kt,
1775
+ intTime: sn,
1776
+ map: _t,
1777
+ null: xt,
1778
+ omap: Ht,
1779
+ pairs: Bt,
1780
+ seq: yt,
1781
+ set: rn,
1782
+ timestamp: ln
1783
+ }, pn = {
1784
+ "tag:yaml.org,2002:binary": Lt,
1785
+ "tag:yaml.org,2002:omap": Ht,
1786
+ "tag:yaml.org,2002:pairs": Bt,
1787
+ "tag:yaml.org,2002:set": rn,
1788
+ "tag:yaml.org,2002:timestamp": ln
1789
+ };
1790
+ function mn(e, t) {
1791
+ let n = dn.get(t);
1792
+ if (!n) {
1793
+ if (Array.isArray(e)) n = [];
1794
+ else {
1795
+ let e = Array.from(dn.keys()).filter((e) => e !== "yaml11").map((e) => JSON.stringify(e)).join(", ");
1796
+ throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`);
1797
+ }
1798
+ }
1799
+ if (Array.isArray(e)) for (let t of e) n = n.concat(t);
1800
+ else typeof e == "function" && (n = e(n.slice()));
1801
+ return n.map((e) => {
1802
+ if (typeof e != "string") return e;
1803
+ let t = fn[e];
1804
+ if (t) return t;
1805
+ let n = Object.keys(fn).map((e) => JSON.stringify(e)).join(", ");
1806
+ throw Error(`Unknown custom tag "${e}"; use one of ${n}`);
1807
+ });
1808
+ }
1809
+ //#endregion
1810
+ //#region node_modules/yaml/browser/dist/schema/Schema.js
1811
+ var hn = (e, t) => e.key < t.key ? -1 : +(e.key > t.key), gn = class e {
1812
+ constructor({ compat: e, customTags: t, merge: n, resolveKnownTags: r, schema: i, sortMapEntries: a, toStringDefaults: o }) {
1813
+ this.compat = Array.isArray(e) ? mn(e, "compat") : e ? mn(null, e) : null, this.merge = !!n, this.name = typeof i == "string" && i || "core", this.knownTags = r ? pn : {}, this.tags = mn(t, this.name), this.toStringOptions = o ?? null, Object.defineProperty(this, D, { value: _t }), Object.defineProperty(this, O, { value: bt }), Object.defineProperty(this, k, { value: yt }), this.sortMapEntries = typeof a == "function" ? a : a === !0 ? hn : null;
1814
+ }
1815
+ clone() {
1816
+ let t = Object.create(e.prototype, Object.getOwnPropertyDescriptors(this));
1817
+ return t.tags = this.tags.slice(), t;
1818
+ }
1819
+ };
1820
+ //#endregion
1821
+ //#region node_modules/yaml/browser/dist/stringify/stringifyDocument.js
1822
+ function _n(e, t) {
1823
+ let n = [], r = t.directives === !0;
1824
+ if (t.directives !== !1 && e.directives) {
1825
+ let t = e.directives.toString(e);
1826
+ t ? (n.push(t), r = !0) : e.directives.docStart && (r = !0);
1827
+ }
1828
+ r && n.push("---");
1829
+ let i = tt(e, t), { commentString: a } = i.options;
1830
+ if (e.commentBefore) {
1831
+ n.length !== 1 && n.unshift("");
1832
+ let t = a(e.commentBefore);
1833
+ n.unshift(W(t, ""));
1834
+ }
1835
+ let o = !1, s = null;
1836
+ if (e.contents) {
1837
+ if (I(e.contents)) {
1838
+ if (e.contents.spaceBefore && r && n.push(""), e.contents.commentBefore) {
1839
+ let t = a(e.contents.commentBefore);
1840
+ n.push(W(t, ""));
1841
+ }
1842
+ i.forceBlockIndent = !!e.comment, s = e.contents.comment;
1843
+ }
1844
+ let t = s ? void 0 : () => o = !0, c = it(e.contents, i, () => s = null, t);
1845
+ s && (c += G(c, "", a(s))), (c[0] === "|" || c[0] === ">") && n[n.length - 1] === "---" ? n[n.length - 1] = `--- ${c}` : n.push(c);
1846
+ } else n.push(it(e.contents, i));
1847
+ if (e.directives?.docEnd) {
1848
+ if (e.comment) {
1849
+ let t = a(e.comment);
1850
+ t.includes("\n") ? (n.push("..."), n.push(W(t, ""))) : n.push(`... ${t}`);
1851
+ } else n.push("...");
1852
+ } else {
1853
+ let t = e.comment;
1854
+ t && o && (t = t.replace(/^\n+/, "")), t && ((!o || s) && n[n.length - 1] !== "" && n.push(""), n.push(W(a(t), "")));
1855
+ }
1856
+ return n.join("\n") + "\n";
1857
+ }
1858
+ //#endregion
1859
+ //#region node_modules/yaml/browser/dist/doc/Document.js
1860
+ var vn = class e {
1861
+ constructor(e, t, n) {
1862
+ this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, A, { value: me });
1863
+ let r = null;
1864
+ typeof t == "function" || Array.isArray(t) ? r = t : n === void 0 && t && (n = t, t = void 0);
1865
+ let i = Object.assign({
1866
+ intAsBigInt: !1,
1867
+ keepSourceTokens: !1,
1868
+ logLevel: "warn",
1869
+ prettyErrors: !0,
1870
+ strict: !0,
1871
+ uniqueKeys: !0,
1872
+ version: "1.2"
1873
+ }, n);
1874
+ this.options = i;
1875
+ let { version: a } = i;
1876
+ n?._directives ? (this.directives = n._directives.atDocument(), this.directives.yaml.explicit && (a = this.directives.yaml.version)) : this.directives = new B({ version: a }), this.setSchema(a, n), this.contents = e === void 0 ? null : this.createNode(e, r, n);
1877
+ }
1878
+ clone() {
1879
+ let t = Object.create(e.prototype, { [A]: { value: me } });
1880
+ return t.commentBefore = this.commentBefore, t.comment = this.comment, t.errors = this.errors.slice(), t.warnings = this.warnings.slice(), t.options = Object.assign({}, this.options), this.directives && (t.directives = this.directives.clone()), t.schema = this.schema.clone(), t.contents = I(this.contents) ? this.contents.clone(t.schema) : this.contents, this.range && (t.range = this.range.slice()), t;
1881
+ }
1882
+ add(e) {
1883
+ yn(this.contents) && this.contents.add(e);
1884
+ }
1885
+ addIn(e, t) {
1886
+ yn(this.contents) && this.contents.addIn(e, t);
1887
+ }
1888
+ createAlias(e, t) {
1889
+ if (!e.anchor) {
1890
+ let n = De(this);
1891
+ e.anchor = !t || n.has(t) ? Oe(t || "a", n) : t;
1892
+ }
1893
+ return new je(e.anchor);
1894
+ }
1895
+ createNode(e, t, n) {
1896
+ let r;
1897
+ if (typeof t == "function") e = t.call({ "": e }, "", e), r = t;
1898
+ else if (Array.isArray(t)) {
1899
+ let e = t.filter((e) => typeof e == "number" || e instanceof String || e instanceof Number).map(String);
1900
+ e.length > 0 && (t = t.concat(e)), r = t;
1901
+ } else n === void 0 && t && (n = t, t = void 0);
1902
+ let { aliasDuplicateObjects: i, anchorPrefix: a, flow: o, keepUndefined: s, onTagObj: c, tag: l } = n ?? {}, { onAnchor: u, setAnchors: d, sourceObjects: f } = ke(this, a || "a"), p = {
1903
+ aliasDuplicateObjects: i ?? !0,
1904
+ keepUndefined: s ?? !1,
1905
+ onAnchor: u,
1906
+ onTagObj: c,
1907
+ replacer: r,
1908
+ schema: this.schema,
1909
+ sourceObjects: f
1910
+ }, m = Ie(e, l, p);
1911
+ return o && F(m) && (m.flow = !0), d(), m;
1912
+ }
1913
+ createPair(e, t, n = {}) {
1914
+ return new q(this.createNode(e, null, n), this.createNode(t, null, n));
1915
+ }
1916
+ delete(e) {
1917
+ return yn(this.contents) ? this.contents.delete(e) : !1;
1918
+ }
1919
+ deleteIn(e) {
1920
+ return Re(e) ? this.contents != null && (this.contents = null, !0) : yn(this.contents) ? this.contents.deleteIn(e) : !1;
1921
+ }
1922
+ get(e, t) {
1923
+ return F(this.contents) ? this.contents.get(e, t) : void 0;
1924
+ }
1925
+ getIn(e, t) {
1926
+ return Re(e) ? !t && N(this.contents) ? this.contents.value : this.contents : F(this.contents) ? this.contents.getIn(e, t) : void 0;
1927
+ }
1928
+ has(e) {
1929
+ return F(this.contents) ? this.contents.has(e) : !1;
1930
+ }
1931
+ hasIn(e) {
1932
+ return Re(e) ? this.contents !== void 0 : F(this.contents) ? this.contents.hasIn(e) : !1;
1933
+ }
1934
+ set(e, t) {
1935
+ this.contents == null ? this.contents = Le(this.schema, [e], t) : yn(this.contents) && this.contents.set(e, t);
1936
+ }
1937
+ setIn(e, t) {
1938
+ Re(e) ? this.contents = t : this.contents == null ? this.contents = Le(this.schema, Array.from(e), t) : yn(this.contents) && this.contents.setIn(e, t);
1939
+ }
1940
+ setSchema(e, t = {}) {
1941
+ typeof e == "number" && (e = String(e));
1942
+ let n;
1943
+ switch (e) {
1944
+ case "1.1":
1945
+ this.directives ? this.directives.yaml.version = "1.1" : this.directives = new B({ version: "1.1" }), n = {
1946
+ merge: !0,
1947
+ resolveKnownTags: !1,
1948
+ schema: "yaml-1.1"
1949
+ };
1950
+ break;
1951
+ case "1.2":
1952
+ case "next":
1953
+ this.directives ? this.directives.yaml.version = e : this.directives = new B({ version: e }), n = {
1954
+ merge: !1,
1955
+ resolveKnownTags: !0,
1956
+ schema: "core"
1957
+ };
1958
+ break;
1959
+ case null:
1960
+ this.directives && delete this.directives, n = null;
1961
+ break;
1962
+ default: {
1963
+ let t = JSON.stringify(e);
1964
+ throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`);
1965
+ }
1966
+ }
1967
+ if (t.schema instanceof Object) this.schema = t.schema;
1968
+ else if (n) this.schema = new gn(Object.assign(n, t));
1969
+ else throw Error("With a null YAML version, the { schema: Schema } option is required");
1970
+ }
1971
+ toJS({ json: e, jsonArg: t, mapAsMap: n, maxAliasCount: r, onAnchor: i, reviver: a } = {}) {
1972
+ let o = {
1973
+ anchors: /* @__PURE__ */ new Map(),
1974
+ doc: this,
1975
+ keep: !e,
1976
+ mapAsMap: n === !0,
1977
+ mapKeyWarned: !1,
1978
+ maxAliasCount: typeof r == "number" ? r : 100
1979
+ }, s = H(this.contents, t ?? "", o);
1980
+ if (typeof i == "function") for (let { count: e, res: t } of o.anchors.values()) i(t, e);
1981
+ return typeof a == "function" ? V(a, { "": s }, "", s) : s;
1982
+ }
1983
+ toJSON(e, t) {
1984
+ return this.toJS({
1985
+ json: !0,
1986
+ jsonArg: e,
1987
+ mapAsMap: !1,
1988
+ onAnchor: t
1989
+ });
1990
+ }
1991
+ toString(e = {}) {
1992
+ if (this.errors.length > 0) throw Error("Document with errors cannot be stringified");
1993
+ if ("indent" in e && (!Number.isInteger(e.indent) || Number(e.indent) <= 0)) {
1994
+ let t = JSON.stringify(e.indent);
1995
+ throw Error(`"indent" option must be a positive integer, not ${t}`);
1996
+ }
1997
+ return _n(this, e);
1998
+ }
1999
+ };
2000
+ function yn(e) {
2001
+ if (F(e)) return !0;
2002
+ throw Error("Expected a YAML collection as document contents");
2003
+ }
2004
+ //#endregion
2005
+ //#region node_modules/yaml/browser/dist/errors.js
2006
+ var bn = class extends Error {
2007
+ constructor(e, t, n, r) {
2008
+ super(), this.name = e, this.code = n, this.message = r, this.pos = t;
2009
+ }
2010
+ }, xn = class extends bn {
2011
+ constructor(e, t, n) {
2012
+ super("YAMLParseError", e, t, n);
2013
+ }
2014
+ }, Sn = class extends bn {
2015
+ constructor(e, t, n) {
2016
+ super("YAMLWarning", e, t, n);
2017
+ }
2018
+ }, Cn = (e, t) => (n) => {
2019
+ if (n.pos[0] === -1) return;
2020
+ n.linePos = n.pos.map((e) => t.linePos(e));
2021
+ let { line: r, col: i } = n.linePos[0];
2022
+ n.message += ` at line ${r}, column ${i}`;
2023
+ let a = i - 1, o = e.substring(t.lineStarts[r - 1], t.lineStarts[r]).replace(/[\n\r]+$/, "");
2024
+ if (a >= 60 && o.length > 80) {
2025
+ let e = Math.min(a - 39, o.length - 79);
2026
+ o = "…" + o.substring(e), a -= e - 1;
2027
+ }
2028
+ if (o.length > 80 && (o = o.substring(0, 79) + "…"), r > 1 && /^ *$/.test(o.substring(0, a))) {
2029
+ let n = e.substring(t.lineStarts[r - 2], t.lineStarts[r - 1]);
2030
+ n.length > 80 && (n = n.substring(0, 79) + "…\n"), o = n + o;
2031
+ }
2032
+ if (/[^ ]/.test(o)) {
2033
+ let e = 1, t = n.linePos[1];
2034
+ t && t.line === r && t.col > i && (e = Math.max(1, Math.min(t.col - i, 80 - a)));
2035
+ let s = " ".repeat(a) + "^".repeat(e);
2036
+ n.message += `:\n\n${o}\n${s}\n`;
2037
+ }
2038
+ };
2039
+ //#endregion
2040
+ //#region node_modules/yaml/browser/dist/compose/resolve-props.js
2041
+ function wn(e, { flow: t, indicator: n, next: r, offset: i, onError: a, parentIndent: o, startOnNewline: s }) {
2042
+ let c = !1, l = s, u = s, d = "", f = "", p = !1, m = !1, h = !1, g = null, _ = null, v = null, y = null, b = null, x = null;
2043
+ for (let i of e) switch (h &&= (i.type !== "space" && i.type !== "newline" && i.type !== "comma" && a(i.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"), !1), g &&= (l && i.type !== "comment" && i.type !== "newline" && a(g, "TAB_AS_INDENT", "Tabs are not allowed as indentation"), null), i.type) {
2044
+ case "space":
2045
+ !t && (n !== "doc-start" || r?.type !== "flow-collection") && i.source.includes(" ") && (g = i), u = !0;
2046
+ break;
2047
+ case "comment": {
2048
+ u || a(i, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
2049
+ let e = i.source.substring(1) || " ";
2050
+ d ? d += f + e : d = e, f = "", l = !1;
2051
+ break;
2052
+ }
2053
+ case "newline":
2054
+ l ? d ? d += i.source : c = !0 : f += i.source, l = !0, p = !0, (_ || v) && (m = !0), u = !0;
2055
+ break;
2056
+ case "anchor":
2057
+ _ && a(i, "MULTIPLE_ANCHORS", "A node can have at most one anchor"), i.source.endsWith(":") && a(i.offset + i.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", !0), _ = i, x === null && (x = i.offset), l = !1, u = !1, h = !0;
2058
+ break;
2059
+ case "tag":
2060
+ v && a(i, "MULTIPLE_TAGS", "A node can have at most one tag"), v = i, x === null && (x = i.offset), l = !1, u = !1, h = !0;
2061
+ break;
2062
+ case n:
2063
+ (_ || v) && a(i, "BAD_PROP_ORDER", `Anchors and tags must be after the ${i.source} indicator`), b && a(i, "UNEXPECTED_TOKEN", `Unexpected ${i.source} in ${t ?? "collection"}`), b = i, l = n === "seq-item-ind" || n === "explicit-key-ind", u = !1;
2064
+ break;
2065
+ case "comma": if (t) {
2066
+ y && a(i, "UNEXPECTED_TOKEN", `Unexpected , in ${t}`), y = i, l = !1, u = !1;
2067
+ break;
2068
+ }
2069
+ default: a(i, "UNEXPECTED_TOKEN", `Unexpected ${i.type} token`), l = !1, u = !1;
2070
+ }
2071
+ let S = e[e.length - 1], C = S ? S.offset + S.source.length : i;
2072
+ return h && r && r.type !== "space" && r.type !== "newline" && r.type !== "comma" && (r.type !== "scalar" || r.source !== "") && a(r.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"), g && (l && g.indent <= o || r?.type === "block-map" || r?.type === "block-seq") && a(g, "TAB_AS_INDENT", "Tabs are not allowed as indentation"), {
2073
+ comma: y,
2074
+ found: b,
2075
+ spaceBefore: c,
2076
+ comment: d,
2077
+ hasNewline: p,
2078
+ hasNewlineAfterProp: m,
2079
+ anchor: _,
2080
+ tag: v,
2081
+ end: C,
2082
+ start: x ?? C
2083
+ };
2084
+ }
2085
+ //#endregion
2086
+ //#region node_modules/yaml/browser/dist/compose/util-contains-newline.js
2087
+ function Tn(e) {
2088
+ if (!e) return null;
2089
+ switch (e.type) {
2090
+ case "alias":
2091
+ case "scalar":
2092
+ case "double-quoted-scalar":
2093
+ case "single-quoted-scalar":
2094
+ if (e.source.includes("\n")) return !0;
2095
+ if (e.end) {
2096
+ for (let t of e.end) if (t.type === "newline") return !0;
2097
+ }
2098
+ return !1;
2099
+ case "flow-collection":
2100
+ for (let t of e.items) {
2101
+ for (let e of t.start) if (e.type === "newline") return !0;
2102
+ if (t.sep) {
2103
+ for (let e of t.sep) if (e.type === "newline") return !0;
2104
+ }
2105
+ if (Tn(t.key) || Tn(t.value)) return !0;
2106
+ }
2107
+ return !1;
2108
+ default: return !0;
2109
+ }
2110
+ }
2111
+ //#endregion
2112
+ //#region node_modules/yaml/browser/dist/compose/util-flow-indent-check.js
2113
+ function En(e, t, n) {
2114
+ if (t?.type === "flow-collection") {
2115
+ let r = t.end[0];
2116
+ r.indent === e && (r.source === "]" || r.source === "}") && Tn(t) && n(r, "BAD_INDENT", "Flow end indicator should be more indented than parent", !0);
2117
+ }
2118
+ }
2119
+ //#endregion
2120
+ //#region node_modules/yaml/browser/dist/compose/util-map-includes.js
2121
+ function Dn(e, t, n) {
2122
+ let { uniqueKeys: r } = e.options;
2123
+ if (r === !1) return !1;
2124
+ let i = typeof r == "function" ? r : (t, n) => t === n || N(t) && N(n) && t.value === n.value && !(t.value === "<<" && e.schema.merge);
2125
+ return t.some((e) => i(e.key, n));
2126
+ }
2127
+ //#endregion
2128
+ //#region node_modules/yaml/browser/dist/compose/resolve-block-map.js
2129
+ var On = "All mapping items must start at the same column";
2130
+ function kn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
2131
+ let o = new ((a?.nodeClass) ?? Y)(n.schema);
2132
+ n.atRoot &&= !1;
2133
+ let s = r.offset, c = null;
2134
+ for (let a of r.items) {
2135
+ let { start: l, key: u, sep: d, value: f } = a, p = wn(l, {
2136
+ indicator: "explicit-key-ind",
2137
+ next: u ?? d?.[0],
2138
+ offset: s,
2139
+ onError: i,
2140
+ parentIndent: r.indent,
2141
+ startOnNewline: !0
2142
+ }), m = !p.found;
2143
+ if (m) {
2144
+ if (u && (u.type === "block-seq" ? i(s, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key") : "indent" in u && u.indent !== r.indent && i(s, "BAD_INDENT", On)), !p.anchor && !p.tag && !d) {
2145
+ c = p.end, p.comment && (o.comment ? o.comment += "\n" + p.comment : o.comment = p.comment);
2146
+ continue;
2147
+ }
2148
+ (p.hasNewlineAfterProp || Tn(u)) && i(u ?? l[l.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
2149
+ } else p.found?.indent !== r.indent && i(s, "BAD_INDENT", On);
2150
+ let h = p.end, g = u ? e(n, u, p, i) : t(n, h, l, null, p, i);
2151
+ n.schema.compat && En(r.indent, u, i), Dn(n, o.items, g) && i(h, "DUPLICATE_KEY", "Map keys must be unique");
2152
+ let _ = wn(d ?? [], {
2153
+ indicator: "map-value-ind",
2154
+ next: f,
2155
+ offset: g.range[2],
2156
+ onError: i,
2157
+ parentIndent: r.indent,
2158
+ startOnNewline: !u || u.type === "block-scalar"
2159
+ });
2160
+ if (s = _.end, _.found) {
2161
+ m && (f?.type === "block-map" && !_.hasNewline && i(s, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"), n.options.strict && p.start < _.found.offset - 1024 && i(g.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));
2162
+ let c = f ? e(n, f, _, i) : t(n, s, d, null, _, i);
2163
+ n.schema.compat && En(r.indent, f, i), s = c.range[2];
2164
+ let l = new q(g, c);
2165
+ n.options.keepSourceTokens && (l.srcToken = a), o.items.push(l);
2166
+ } else {
2167
+ m && i(g.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values"), _.comment && (g.comment ? g.comment += "\n" + _.comment : g.comment = _.comment);
2168
+ let e = new q(g);
2169
+ n.options.keepSourceTokens && (e.srcToken = a), o.items.push(e);
2170
+ }
2171
+ }
2172
+ return c && c < s && i(c, "IMPOSSIBLE", "Map comment with trailing content"), o.range = [
2173
+ r.offset,
2174
+ s,
2175
+ c ?? s
2176
+ ], o;
2177
+ }
2178
+ //#endregion
2179
+ //#region node_modules/yaml/browser/dist/compose/resolve-block-seq.js
2180
+ function An({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
2181
+ let o = new ((a?.nodeClass) ?? X)(n.schema);
2182
+ n.atRoot &&= !1;
2183
+ let s = r.offset, c = null;
2184
+ for (let { start: a, value: l } of r.items) {
2185
+ let u = wn(a, {
2186
+ indicator: "seq-item-ind",
2187
+ next: l,
2188
+ offset: s,
2189
+ onError: i,
2190
+ parentIndent: r.indent,
2191
+ startOnNewline: !0
2192
+ });
2193
+ if (!u.found) {
2194
+ if (u.anchor || u.tag || l) l && l.type === "block-seq" ? i(u.end, "BAD_INDENT", "All sequence items must start at the same column") : i(s, "MISSING_CHAR", "Sequence item without - indicator");
2195
+ else {
2196
+ c = u.end, u.comment && (o.comment = u.comment);
2197
+ continue;
2198
+ }
2199
+ }
2200
+ let d = l ? e(n, l, u, i) : t(n, u.end, a, null, u, i);
2201
+ n.schema.compat && En(r.indent, l, i), s = d.range[2], o.items.push(d);
2202
+ }
2203
+ return o.range = [
2204
+ r.offset,
2205
+ s,
2206
+ c ?? s
2207
+ ], o;
2208
+ }
2209
+ //#endregion
2210
+ //#region node_modules/yaml/browser/dist/compose/resolve-end.js
2211
+ function jn(e, t, n, r) {
2212
+ let i = "";
2213
+ if (e) {
2214
+ let a = !1, o = "";
2215
+ for (let s of e) {
2216
+ let { source: e, type: c } = s;
2217
+ switch (c) {
2218
+ case "space":
2219
+ a = !0;
2220
+ break;
2221
+ case "comment": {
2222
+ n && !a && r(s, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
2223
+ let t = e.substring(1) || " ";
2224
+ i ? i += o + t : i = t, o = "";
2225
+ break;
2226
+ }
2227
+ case "newline":
2228
+ i && (o += e), a = !0;
2229
+ break;
2230
+ default: r(s, "UNEXPECTED_TOKEN", `Unexpected ${c} at node end`);
2231
+ }
2232
+ t += e.length;
2233
+ }
2234
+ }
2235
+ return {
2236
+ comment: i,
2237
+ offset: t
2238
+ };
2239
+ }
2240
+ //#endregion
2241
+ //#region node_modules/yaml/browser/dist/compose/resolve-flow-collection.js
2242
+ var Mn = "Block collections are not allowed within flow collections", Nn = (e) => e && (e.type === "block-map" || e.type === "block-seq");
2243
+ function Pn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
2244
+ let o = r.start.source === "{", s = o ? "flow map" : "flow sequence", c = new ((a?.nodeClass) ?? (o ? Y : X))(n.schema);
2245
+ c.flow = !0;
2246
+ let l = n.atRoot;
2247
+ l && (n.atRoot = !1);
2248
+ let u = r.offset + r.start.source.length;
2249
+ for (let a = 0; a < r.items.length; ++a) {
2250
+ let l = r.items[a], { start: d, key: f, sep: p, value: m } = l, h = wn(d, {
2251
+ flow: s,
2252
+ indicator: "explicit-key-ind",
2253
+ next: f ?? p?.[0],
2254
+ offset: u,
2255
+ onError: i,
2256
+ parentIndent: r.indent,
2257
+ startOnNewline: !1
2258
+ });
2259
+ if (!h.found) {
2260
+ if (!h.anchor && !h.tag && !p && !m) {
2261
+ a === 0 && h.comma ? i(h.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${s}`) : a < r.items.length - 1 && i(h.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${s}`), h.comment && (c.comment ? c.comment += "\n" + h.comment : c.comment = h.comment), u = h.end;
2262
+ continue;
2263
+ }
2264
+ !o && n.options.strict && Tn(f) && i(f, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line");
2265
+ }
2266
+ if (a === 0) h.comma && i(h.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${s}`);
2267
+ else if (h.comma || i(h.start, "MISSING_CHAR", `Missing , between ${s} items`), h.comment) {
2268
+ let e = "";
2269
+ loop: for (let t of d) switch (t.type) {
2270
+ case "comma":
2271
+ case "space": break;
2272
+ case "comment":
2273
+ e = t.source.substring(1);
2274
+ break loop;
2275
+ default: break loop;
2276
+ }
2277
+ if (e) {
2278
+ let t = c.items[c.items.length - 1];
2279
+ M(t) && (t = t.value ?? t.key), t.comment ? t.comment += "\n" + e : t.comment = e, h.comment = h.comment.substring(e.length + 1);
2280
+ }
2281
+ }
2282
+ if (!o && !p && !h.found) {
2283
+ let r = m ? e(n, m, h, i) : t(n, h.end, p, null, h, i);
2284
+ c.items.push(r), u = r.range[2], Nn(m) && i(r.range, "BLOCK_IN_FLOW", Mn);
2285
+ } else {
2286
+ let a = h.end, g = f ? e(n, f, h, i) : t(n, a, d, null, h, i);
2287
+ Nn(f) && i(g.range, "BLOCK_IN_FLOW", Mn);
2288
+ let _ = wn(p ?? [], {
2289
+ flow: s,
2290
+ indicator: "map-value-ind",
2291
+ next: m,
2292
+ offset: g.range[2],
2293
+ onError: i,
2294
+ parentIndent: r.indent,
2295
+ startOnNewline: !1
2296
+ });
2297
+ if (_.found) {
2298
+ if (!o && !h.found && n.options.strict) {
2299
+ if (p) for (let e of p) {
2300
+ if (e === _.found) break;
2301
+ if (e.type === "newline") {
2302
+ i(e, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line");
2303
+ break;
2304
+ }
2305
+ }
2306
+ h.start < _.found.offset - 1024 && i(_.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key");
2307
+ }
2308
+ } else m && ("source" in m && m.source && m.source[0] === ":" ? i(m, "MISSING_CHAR", `Missing space after : in ${s}`) : i(_.start, "MISSING_CHAR", `Missing , or : between ${s} items`));
2309
+ let v = m ? e(n, m, _, i) : _.found ? t(n, _.end, p, null, _, i) : null;
2310
+ v ? Nn(m) && i(v.range, "BLOCK_IN_FLOW", Mn) : _.comment && (g.comment ? g.comment += "\n" + _.comment : g.comment = _.comment);
2311
+ let y = new q(g, v);
2312
+ if (n.options.keepSourceTokens && (y.srcToken = l), o) {
2313
+ let e = c;
2314
+ Dn(n, e.items, g) && i(a, "DUPLICATE_KEY", "Map keys must be unique"), e.items.push(y);
2315
+ } else {
2316
+ let e = new Y(n.schema);
2317
+ e.flow = !0, e.items.push(y), c.items.push(e);
2318
+ }
2319
+ u = v ? v.range[2] : _.end;
2320
+ }
2321
+ }
2322
+ let d = o ? "}" : "]", [f, ...p] = r.end, m = u;
2323
+ if (f && f.source === d) m = f.offset + f.source.length;
2324
+ else {
2325
+ let e = s[0].toUpperCase() + s.substring(1), t = l ? `${e} must end with a ${d}` : `${e} in block collection must be sufficiently indented and end with a ${d}`;
2326
+ i(u, l ? "MISSING_CHAR" : "BAD_INDENT", t), f && f.source.length !== 1 && p.unshift(f);
2327
+ }
2328
+ if (p.length > 0) {
2329
+ let e = jn(p, m, n.options.strict, i);
2330
+ e.comment && (c.comment ? c.comment += "\n" + e.comment : c.comment = e.comment), c.range = [
2331
+ r.offset,
2332
+ m,
2333
+ e.offset
2334
+ ];
2335
+ } else c.range = [
2336
+ r.offset,
2337
+ m,
2338
+ m
2339
+ ];
2340
+ return c;
2341
+ }
2342
+ //#endregion
2343
+ //#region node_modules/yaml/browser/dist/compose/compose-collection.js
2344
+ function Fn(e, t, n, r, i, a) {
2345
+ let o = n.type === "block-map" ? kn(e, t, n, r, a) : n.type === "block-seq" ? An(e, t, n, r, a) : Pn(e, t, n, r, a), s = o.constructor;
2346
+ return i === "!" || i === s.tagName ? (o.tag = s.tagName, o) : (i && (o.tag = i), o);
2347
+ }
2348
+ function In(e, t, n, r, i) {
2349
+ let a = r ? t.directives.tagName(r.source, (e) => i(r, "TAG_RESOLVE_FAILED", e)) : null, o = n.type === "block-map" ? "map" : n.type === "block-seq" ? "seq" : n.start.source === "{" ? "map" : "seq";
2350
+ if (!r || !a || a === "!" || a === Y.tagName && o === "map" || a === X.tagName && o === "seq" || !o) return Fn(e, t, n, i, a);
2351
+ let s = t.schema.tags.find((e) => e.tag === a && e.collection === o);
2352
+ if (!s) {
2353
+ let c = t.schema.knownTags[a];
2354
+ if (c && c.collection === o) t.schema.tags.push(Object.assign({}, c, { default: !1 })), s = c;
2355
+ else return c?.collection ? i(r, "BAD_COLLECTION_TYPE", `${c.tag} used for ${o} collection, but expects ${c.collection}`, !0) : i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${a}`, !0), Fn(e, t, n, i, a);
2356
+ }
2357
+ let c = Fn(e, t, n, i, a, s), l = s.resolve?.(c, (e) => i(r, "TAG_RESOLVE_FAILED", e), t.options) ?? c, u = I(l) ? l : new U(l);
2358
+ return u.range = c.range, u.tag = a, s?.format && (u.format = s.format), u;
2359
+ }
2360
+ //#endregion
2361
+ //#region node_modules/yaml/browser/dist/compose/resolve-block-scalar.js
2362
+ function Ln(e, t, n) {
2363
+ let r = t.offset, i = Rn(t, e.options.strict, n);
2364
+ if (!i) return {
2365
+ value: "",
2366
+ type: null,
2367
+ comment: "",
2368
+ range: [
2369
+ r,
2370
+ r,
2371
+ r
2372
+ ]
2373
+ };
2374
+ let a = i.mode === ">" ? U.BLOCK_FOLDED : U.BLOCK_LITERAL, o = t.source ? zn(t.source) : [], s = o.length;
2375
+ for (let e = o.length - 1; e >= 0; --e) {
2376
+ let t = o[e][1];
2377
+ if (t === "" || t === "\r") s = e;
2378
+ else break;
2379
+ }
2380
+ if (s === 0) {
2381
+ let e = i.chomp === "+" && o.length > 0 ? "\n".repeat(Math.max(1, o.length - 1)) : "", n = r + i.length;
2382
+ return t.source && (n += t.source.length), {
2383
+ value: e,
2384
+ type: a,
2385
+ comment: i.comment,
2386
+ range: [
2387
+ r,
2388
+ n,
2389
+ n
2390
+ ]
2391
+ };
2392
+ }
2393
+ let c = t.indent + i.indent, l = t.offset + i.length, u = 0;
2394
+ for (let t = 0; t < s; ++t) {
2395
+ let [r, a] = o[t];
2396
+ if (a === "" || a === "\r") i.indent === 0 && r.length > c && (c = r.length);
2397
+ else {
2398
+ r.length < c && n(l + r.length, "MISSING_CHAR", "Block scalars with more-indented leading empty lines must use an explicit indentation indicator"), i.indent === 0 && (c = r.length), u = t, c === 0 && !e.atRoot && n(l, "BAD_INDENT", "Block scalar values in collections must be indented");
2399
+ break;
2400
+ }
2401
+ l += r.length + a.length + 1;
2402
+ }
2403
+ for (let e = o.length - 1; e >= s; --e) o[e][0].length > c && (s = e + 1);
2404
+ let d = "", f = "", p = !1;
2405
+ for (let e = 0; e < u; ++e) d += o[e][0].slice(c) + "\n";
2406
+ for (let e = u; e < s; ++e) {
2407
+ let [t, r] = o[e];
2408
+ l += t.length + r.length + 1;
2409
+ let s = r[r.length - 1] === "\r";
2410
+ /* istanbul ignore if already caught in lexer */
2411
+ if (s && (r = r.slice(0, -1)), r && t.length < c) {
2412
+ let e = `Block scalar lines must not be less indented than their ${i.indent ? "explicit indentation indicator" : "first line"}`;
2413
+ n(l - r.length - (s ? 2 : 1), "BAD_INDENT", e), t = "";
2414
+ }
2415
+ a === U.BLOCK_LITERAL ? (d += f + t.slice(c) + r, f = "\n") : t.length > c || r[0] === " " ? (f === " " ? f = "\n" : !p && f === "\n" && (f = "\n\n"), d += f + t.slice(c) + r, f = "\n", p = !0) : r === "" ? f === "\n" ? d += "\n" : f = "\n" : (d += f + r, f = " ", p = !1);
2416
+ }
2417
+ switch (i.chomp) {
2418
+ case "-": break;
2419
+ case "+":
2420
+ for (let e = s; e < o.length; ++e) d += "\n" + o[e][0].slice(c);
2421
+ d[d.length - 1] !== "\n" && (d += "\n");
2422
+ break;
2423
+ default: d += "\n";
2424
+ }
2425
+ let m = r + i.length + t.source.length;
2426
+ return {
2427
+ value: d,
2428
+ type: a,
2429
+ comment: i.comment,
2430
+ range: [
2431
+ r,
2432
+ m,
2433
+ m
2434
+ ]
2435
+ };
2436
+ }
2437
+ function Rn({ offset: e, props: t }, n, r) {
2438
+ /* istanbul ignore if should not happen */
2439
+ if (t[0].type !== "block-scalar-header") return r(t[0], "IMPOSSIBLE", "Block scalar header not found"), null;
2440
+ let { source: i } = t[0], a = i[0], o = 0, s = "", c = -1;
2441
+ for (let t = 1; t < i.length; ++t) {
2442
+ let n = i[t];
2443
+ if (!s && (n === "-" || n === "+")) s = n;
2444
+ else {
2445
+ let r = Number(n);
2446
+ !o && r ? o = r : c === -1 && (c = e + t);
2447
+ }
2448
+ }
2449
+ c !== -1 && r(c, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${i}`);
2450
+ let l = !1, u = "", d = i.length;
2451
+ for (let e = 1; e < t.length; ++e) {
2452
+ let i = t[e];
2453
+ switch (i.type) {
2454
+ case "space": l = !0;
2455
+ case "newline":
2456
+ d += i.source.length;
2457
+ break;
2458
+ case "comment":
2459
+ n && !l && r(i, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"), d += i.source.length, u = i.source.substring(1);
2460
+ break;
2461
+ case "error":
2462
+ r(i, "UNEXPECTED_TOKEN", i.message), d += i.source.length;
2463
+ break;
2464
+ /* istanbul ignore next should not happen */
2465
+ default: {
2466
+ r(i, "UNEXPECTED_TOKEN", `Unexpected token in block scalar header: ${i.type}`);
2467
+ let e = i.source;
2468
+ e && typeof e == "string" && (d += e.length);
2469
+ }
2470
+ }
2471
+ }
2472
+ return {
2473
+ mode: a,
2474
+ indent: o,
2475
+ chomp: s,
2476
+ comment: u,
2477
+ length: d
2478
+ };
2479
+ }
2480
+ function zn(e) {
2481
+ let t = e.split(/\n( *)/), n = t[0], r = n.match(/^( *)/), i = [r?.[1] ? [r[1], n.slice(r[1].length)] : ["", n]];
2482
+ for (let e = 1; e < t.length; e += 2) i.push([t[e], t[e + 1]]);
2483
+ return i;
2484
+ }
2485
+ //#endregion
2486
+ //#region node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js
2487
+ function Bn(e, t, n) {
2488
+ let { offset: r, type: i, source: a, end: o } = e, s, c, l = (e, t, i) => n(r + e, t, i);
2489
+ switch (i) {
2490
+ case "scalar":
2491
+ s = U.PLAIN, c = Vn(a, l);
2492
+ break;
2493
+ case "single-quoted-scalar":
2494
+ s = U.QUOTE_SINGLE, c = Hn(a, l);
2495
+ break;
2496
+ case "double-quoted-scalar":
2497
+ s = U.QUOTE_DOUBLE, c = Wn(a, l);
2498
+ break;
2499
+ /* istanbul ignore next should not happen */
2500
+ default: return n(e, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${i}`), {
2501
+ value: "",
2502
+ type: null,
2503
+ comment: "",
2504
+ range: [
2505
+ r,
2506
+ r + a.length,
2507
+ r + a.length
2508
+ ]
2509
+ };
2510
+ }
2511
+ let u = r + a.length, d = jn(o, u, t, n);
2512
+ return {
2513
+ value: c,
2514
+ type: s,
2515
+ comment: d.comment,
2516
+ range: [
2517
+ r,
2518
+ u,
2519
+ d.offset
2520
+ ]
2521
+ };
2522
+ }
2523
+ function Vn(e, t) {
2524
+ let n = "";
2525
+ switch (e[0]) {
2526
+ /* istanbul ignore next should not happen */
2527
+ case " ":
2528
+ n = "a tab character";
2529
+ break;
2530
+ case ",":
2531
+ n = "flow indicator character ,";
2532
+ break;
2533
+ case "%":
2534
+ n = "directive indicator character %";
2535
+ break;
2536
+ case "|":
2537
+ case ">":
2538
+ n = `block scalar indicator ${e[0]}`;
2539
+ break;
2540
+ case "@":
2541
+ case "`": n = `reserved character ${e[0]}`;
2542
+ }
2543
+ return n && t(0, "BAD_SCALAR_START", `Plain value cannot start with ${n}`), Un(e);
2544
+ }
2545
+ function Hn(e, t) {
2546
+ return (e[e.length - 1] !== "'" || e.length === 1) && t(e.length, "MISSING_CHAR", "Missing closing 'quote"), Un(e.slice(1, -1)).replace(/''/g, "'");
2547
+ }
2548
+ function Un(e) {
2549
+ let t, n;
2550
+ try {
2551
+ t = /* @__PURE__ */ RegExp("(.*?)(?<![ ])[ ]*\r?\n", "sy"), n = /* @__PURE__ */ RegExp("[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?\n", "sy");
2552
+ } catch {
2553
+ t = /(.*?)[ \t]*\r?\n/sy, n = /[ \t]*(.*?)[ \t]*\r?\n/sy;
2554
+ }
2555
+ let r = t.exec(e);
2556
+ if (!r) return e;
2557
+ let i = r[1], a = " ", o = t.lastIndex;
2558
+ for (n.lastIndex = o; r = n.exec(e);) r[1] === "" ? a === "\n" ? i += a : a = "\n" : (i += a + r[1], a = " "), o = n.lastIndex;
2559
+ let s = /[ \t]*(.*)/sy;
2560
+ return s.lastIndex = o, r = s.exec(e), i + a + (r?.[1] ?? "");
2561
+ }
2562
+ function Wn(e, t) {
2563
+ let n = "";
2564
+ for (let r = 1; r < e.length - 1; ++r) {
2565
+ let i = e[r];
2566
+ if (i !== "\r" || e[r + 1] !== "\n") {
2567
+ if (i === "\n") {
2568
+ let { fold: t, offset: i } = Gn(e, r);
2569
+ n += t, r = i;
2570
+ } else if (i === "\\") {
2571
+ let i = e[++r], a = Kn[i];
2572
+ if (a) n += a;
2573
+ else if (i === "\n") for (i = e[r + 1]; i === " " || i === " ";) i = e[++r + 1];
2574
+ else if (i === "\r" && e[r + 1] === "\n") for (i = e[++r + 1]; i === " " || i === " ";) i = e[++r + 1];
2575
+ else if (i === "x" || i === "u" || i === "U") {
2576
+ let a = {
2577
+ x: 2,
2578
+ u: 4,
2579
+ U: 8
2580
+ }[i];
2581
+ n += qn(e, r + 1, a, t), r += a;
2582
+ } else {
2583
+ let i = e.substr(r - 1, 2);
2584
+ t(r - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${i}`), n += i;
2585
+ }
2586
+ } else if (i === " " || i === " ") {
2587
+ let t = r, a = e[r + 1];
2588
+ for (; a === " " || a === " ";) a = e[++r + 1];
2589
+ a !== "\n" && (a !== "\r" || e[r + 2] !== "\n") && (n += r > t ? e.slice(t, r + 1) : i);
2590
+ } else n += i;
2591
+ }
2592
+ }
2593
+ return (e[e.length - 1] !== "\"" || e.length === 1) && t(e.length, "MISSING_CHAR", "Missing closing \"quote"), n;
2594
+ }
2595
+ function Gn(e, t) {
2596
+ let n = "", r = e[t + 1];
2597
+ for (; (r === " " || r === " " || r === "\n" || r === "\r") && (r !== "\r" || e[t + 2] === "\n");) r === "\n" && (n += "\n"), t += 1, r = e[t + 1];
2598
+ return n ||= " ", {
2599
+ fold: n,
2600
+ offset: t
2601
+ };
2602
+ }
2603
+ var Kn = {
2604
+ 0: "\0",
2605
+ a: "\x07",
2606
+ b: "\b",
2607
+ e: "\x1B",
2608
+ f: "\f",
2609
+ n: "\n",
2610
+ r: "\r",
2611
+ t: " ",
2612
+ v: "\v",
2613
+ N: "…",
2614
+ _: "\xA0",
2615
+ L: "\u2028",
2616
+ P: "\u2029",
2617
+ " ": " ",
2618
+ "\"": "\"",
2619
+ "/": "/",
2620
+ "\\": "\\",
2621
+ " ": " "
2622
+ };
2623
+ function qn(e, t, n, r) {
2624
+ let i = e.substr(t, n), a = i.length === n && /^[0-9a-fA-F]+$/.test(i) ? parseInt(i, 16) : NaN;
2625
+ if (isNaN(a)) {
2626
+ let i = e.substr(t - 2, n + 2);
2627
+ return r(t - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${i}`), i;
2628
+ }
2629
+ return String.fromCodePoint(a);
2630
+ }
2631
+ //#endregion
2632
+ //#region node_modules/yaml/browser/dist/compose/compose-scalar.js
2633
+ function Jn(e, t, n, r) {
2634
+ let { value: i, type: a, comment: o, range: s } = t.type === "block-scalar" ? Ln(e, t, r) : Bn(t, e.options.strict, r), c = n ? e.directives.tagName(n.source, (e) => r(n, "TAG_RESOLVE_FAILED", e)) : null, l = n && c ? Yn(e.schema, i, c, n, r) : t.type === "scalar" ? Xn(e, i, t, r) : e.schema[O], u;
2635
+ try {
2636
+ let a = l.resolve(i, (e) => r(n ?? t, "TAG_RESOLVE_FAILED", e), e.options);
2637
+ u = N(a) ? a : new U(a);
2638
+ } catch (e) {
2639
+ let a = e instanceof Error ? e.message : String(e);
2640
+ r(n ?? t, "TAG_RESOLVE_FAILED", a), u = new U(i);
2641
+ }
2642
+ return u.range = s, u.source = i, a && (u.type = a), c && (u.tag = c), l.format && (u.format = l.format), o && (u.comment = o), u;
2643
+ }
2644
+ function Yn(e, t, n, r, i) {
2645
+ if (n === "!") return e[O];
2646
+ let a = [];
2647
+ for (let t of e.tags) if (!t.collection && t.tag === n) {
2648
+ if (t.default && t.test) a.push(t);
2649
+ else return t;
2650
+ }
2651
+ for (let e of a) if (e.test?.test(t)) return e;
2652
+ let o = e.knownTags[n];
2653
+ return o && !o.collection ? (e.tags.push(Object.assign({}, o, {
2654
+ default: !1,
2655
+ test: void 0
2656
+ })), o) : (i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${n}`, n !== "tag:yaml.org,2002:str"), e[O]);
2657
+ }
2658
+ function Xn({ directives: e, schema: t }, n, r, i) {
2659
+ let a = t.tags.find((e) => e.default && e.test?.test(n)) || t[O];
2660
+ if (t.compat) {
2661
+ let o = t.compat.find((e) => e.default && e.test?.test(n)) ?? t[O];
2662
+ a.tag !== o.tag && i(r, "TAG_RESOLVE_FAILED", `Value may be parsed as either ${e.tagString(a.tag)} or ${e.tagString(o.tag)}`, !0);
2663
+ }
2664
+ return a;
2665
+ }
2666
+ //#endregion
2667
+ //#region node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js
2668
+ function Zn(e, t, n) {
2669
+ if (t) {
2670
+ n === null && (n = t.length);
2671
+ for (let r = n - 1; r >= 0; --r) {
2672
+ let n = t[r];
2673
+ switch (n.type) {
2674
+ case "space":
2675
+ case "comment":
2676
+ case "newline":
2677
+ e -= n.source.length;
2678
+ continue;
2679
+ }
2680
+ for (n = t[++r]; n?.type === "space";) e += n.source.length, n = t[++r];
2681
+ break;
2682
+ }
2683
+ }
2684
+ return e;
2685
+ }
2686
+ //#endregion
2687
+ //#region node_modules/yaml/browser/dist/compose/compose-node.js
2688
+ var Qn = {
2689
+ composeNode: $n,
2690
+ composeEmptyNode: er
2691
+ };
2692
+ function $n(e, t, n, r) {
2693
+ let { spaceBefore: i, comment: a, anchor: o, tag: s } = n, c, l = !0;
2694
+ switch (t.type) {
2695
+ case "alias":
2696
+ c = tr(e, t, r), (o || s) && r(t, "ALIAS_PROPS", "An alias node must not specify any properties");
2697
+ break;
2698
+ case "scalar":
2699
+ case "single-quoted-scalar":
2700
+ case "double-quoted-scalar":
2701
+ case "block-scalar":
2702
+ c = Jn(e, t, s, r), o && (c.anchor = o.source.substring(1));
2703
+ break;
2704
+ case "block-map":
2705
+ case "block-seq":
2706
+ case "flow-collection":
2707
+ c = In(Qn, e, t, s, r), o && (c.anchor = o.source.substring(1));
2708
+ break;
2709
+ default: r(t, "UNEXPECTED_TOKEN", t.type === "error" ? t.message : `Unsupported token (type: ${t.type})`), c = er(e, t.offset, void 0, null, n, r), l = !1;
2710
+ }
2711
+ return o && c.anchor === "" && r(o, "BAD_ALIAS", "Anchor cannot be an empty string"), i && (c.spaceBefore = !0), a && (t.type === "scalar" && t.source === "" ? c.comment = a : c.commentBefore = a), e.options.keepSourceTokens && l && (c.srcToken = t), c;
2712
+ }
2713
+ function er(e, t, n, r, { spaceBefore: i, comment: a, anchor: o, tag: s, end: c }, l) {
2714
+ let u = Jn(e, {
2715
+ type: "scalar",
2716
+ offset: Zn(t, n, r),
2717
+ indent: -1,
2718
+ source: ""
2719
+ }, s, l);
2720
+ return o && (u.anchor = o.source.substring(1), u.anchor === "" && l(o, "BAD_ALIAS", "Anchor cannot be an empty string")), i && (u.spaceBefore = !0), a && (u.comment = a, u.range[2] = c), u;
2721
+ }
2722
+ function tr({ options: e }, { offset: t, source: n, end: r }, i) {
2723
+ let a = new je(n.substring(1));
2724
+ a.source === "" && i(t, "BAD_ALIAS", "Alias cannot be an empty string"), a.source.endsWith(":") && i(t + n.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", !0);
2725
+ let o = t + n.length, s = jn(r, o, e.strict, i);
2726
+ return a.range = [
2727
+ t,
2728
+ o,
2729
+ s.offset
2730
+ ], s.comment && (a.comment = s.comment), a;
2731
+ }
2732
+ //#endregion
2733
+ //#region node_modules/yaml/browser/dist/compose/compose-doc.js
2734
+ function nr(e, t, { offset: n, start: r, value: i, end: a }, o) {
2735
+ let s = new vn(void 0, Object.assign({ _directives: t }, e)), c = {
2736
+ atRoot: !0,
2737
+ directives: s.directives,
2738
+ options: s.options,
2739
+ schema: s.schema
2740
+ }, l = wn(r, {
2741
+ indicator: "doc-start",
2742
+ next: i ?? a?.[0],
2743
+ offset: n,
2744
+ onError: o,
2745
+ parentIndent: 0,
2746
+ startOnNewline: !0
2747
+ });
2748
+ l.found && (s.directives.docStart = !0, i && (i.type === "block-map" || i.type === "block-seq") && !l.hasNewline && o(l.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker")), s.contents = i ? $n(c, i, l, o) : er(c, l.end, r, null, l, o);
2749
+ let u = s.contents.range[2], d = jn(a, u, !1, o);
2750
+ return d.comment && (s.comment = d.comment), s.range = [
2751
+ n,
2752
+ u,
2753
+ d.offset
2754
+ ], s;
2755
+ }
2756
+ //#endregion
2757
+ //#region node_modules/yaml/browser/dist/compose/composer.js
2758
+ function rr(e) {
2759
+ if (typeof e == "number") return [e, e + 1];
2760
+ if (Array.isArray(e)) return e.length === 2 ? e : [e[0], e[1]];
2761
+ let { offset: t, source: n } = e;
2762
+ return [t, t + (typeof n == "string" ? n.length : 1)];
2763
+ }
2764
+ function ir(e) {
2765
+ let t = "", n = !1, r = !1;
2766
+ for (let i = 0; i < e.length; ++i) {
2767
+ let a = e[i];
2768
+ switch (a[0]) {
2769
+ case "#":
2770
+ t += (t === "" ? "" : r ? "\n\n" : "\n") + (a.substring(1) || " "), n = !0, r = !1;
2771
+ break;
2772
+ case "%":
2773
+ e[i + 1]?.[0] !== "#" && (i += 1), n = !1;
2774
+ break;
2775
+ default: n || (r = !0), n = !1;
2776
+ }
2777
+ }
2778
+ return {
2779
+ comment: t,
2780
+ afterEmptyLine: r
2781
+ };
2782
+ }
2783
+ var ar = class {
2784
+ constructor(e = {}) {
2785
+ this.doc = null, this.atDirectives = !1, this.prelude = [], this.errors = [], this.warnings = [], this.onError = (e, t, n, r) => {
2786
+ let i = rr(e);
2787
+ r ? this.warnings.push(new Sn(i, t, n)) : this.errors.push(new xn(i, t, n));
2788
+ }, this.directives = new B({ version: e.version || "1.2" }), this.options = e;
2789
+ }
2790
+ decorate(e, t) {
2791
+ let { comment: n, afterEmptyLine: r } = ir(this.prelude);
2792
+ if (n) {
2793
+ let i = e.contents;
2794
+ if (t) e.comment = e.comment ? `${e.comment}\n${n}` : n;
2795
+ else if (r || e.directives.docStart || !i) e.commentBefore = n;
2796
+ else if (F(i) && !i.flow && i.items.length > 0) {
2797
+ let e = i.items[0];
2798
+ M(e) && (e = e.key);
2799
+ let t = e.commentBefore;
2800
+ e.commentBefore = t ? `${n}\n${t}` : n;
2801
+ } else {
2802
+ let e = i.commentBefore;
2803
+ i.commentBefore = e ? `${n}\n${e}` : n;
2804
+ }
2805
+ }
2806
+ t ? (Array.prototype.push.apply(e.errors, this.errors), Array.prototype.push.apply(e.warnings, this.warnings)) : (e.errors = this.errors, e.warnings = this.warnings), this.prelude = [], this.errors = [], this.warnings = [];
2807
+ }
2808
+ streamInfo() {
2809
+ return {
2810
+ comment: ir(this.prelude).comment,
2811
+ directives: this.directives,
2812
+ errors: this.errors,
2813
+ warnings: this.warnings
2814
+ };
2815
+ }
2816
+ *compose(e, t = !1, n = -1) {
2817
+ for (let t of e) yield* this.next(t);
2818
+ yield* this.end(t, n);
2819
+ }
2820
+ *next(e) {
2821
+ switch (e.type) {
2822
+ case "directive":
2823
+ this.directives.add(e.source, (t, n, r) => {
2824
+ let i = rr(e);
2825
+ i[0] += t, this.onError(i, "BAD_DIRECTIVE", n, r);
2826
+ }), this.prelude.push(e.source), this.atDirectives = !0;
2827
+ break;
2828
+ case "document": {
2829
+ let t = nr(this.options, this.directives, e, this.onError);
2830
+ this.atDirectives && !t.directives.docStart && this.onError(e, "MISSING_CHAR", "Missing directives-end/doc-start indicator line"), this.decorate(t, !1), this.doc && (yield this.doc), this.doc = t, this.atDirectives = !1;
2831
+ break;
2832
+ }
2833
+ case "byte-order-mark":
2834
+ case "space": break;
2835
+ case "comment":
2836
+ case "newline":
2837
+ this.prelude.push(e.source);
2838
+ break;
2839
+ case "error": {
2840
+ let t = e.source ? `${e.message}: ${JSON.stringify(e.source)}` : e.message, n = new xn(rr(e), "UNEXPECTED_TOKEN", t);
2841
+ this.atDirectives || !this.doc ? this.errors.push(n) : this.doc.errors.push(n);
2842
+ break;
2843
+ }
2844
+ case "doc-end": {
2845
+ if (!this.doc) {
2846
+ this.errors.push(new xn(rr(e), "UNEXPECTED_TOKEN", "Unexpected doc-end without preceding document"));
2847
+ break;
2848
+ }
2849
+ this.doc.directives.docEnd = !0;
2850
+ let t = jn(e.end, e.offset + e.source.length, this.doc.options.strict, this.onError);
2851
+ if (this.decorate(this.doc, !0), t.comment) {
2852
+ let e = this.doc.comment;
2853
+ this.doc.comment = e ? `${e}\n${t.comment}` : t.comment;
2854
+ }
2855
+ this.doc.range[2] = t.offset;
2856
+ break;
2857
+ }
2858
+ default: this.errors.push(new xn(rr(e), "UNEXPECTED_TOKEN", `Unsupported token ${e.type}`));
2859
+ }
2860
+ }
2861
+ *end(e = !1, t = -1) {
2862
+ if (this.doc) this.decorate(this.doc, !0), yield this.doc, this.doc = null;
2863
+ else if (e) {
2864
+ let e = new vn(void 0, Object.assign({ _directives: this.directives }, this.options));
2865
+ this.atDirectives && this.onError(t, "MISSING_CHAR", "Missing directives-end indicator line"), e.range = [
2866
+ 0,
2867
+ t,
2868
+ t
2869
+ ], this.decorate(e, !1), yield e;
2870
+ }
2871
+ }
2872
+ }, or = Symbol("break visit"), sr = Symbol("skip children"), cr = Symbol("remove item");
2873
+ function lr(e, t) {
2874
+ "type" in e && e.type === "document" && (e = {
2875
+ start: e.start,
2876
+ value: e.value
2877
+ }), ur(Object.freeze([]), e, t);
2878
+ }
2879
+ lr.BREAK = or, lr.SKIP = sr, lr.REMOVE = cr, lr.itemAtPath = (e, t) => {
2880
+ let n = e;
2881
+ for (let [e, r] of t) {
2882
+ let t = n?.[e];
2883
+ if (t && "items" in t) n = t.items[r];
2884
+ else return;
2885
+ }
2886
+ return n;
2887
+ }, lr.parentCollection = (e, t) => {
2888
+ let n = lr.itemAtPath(e, t.slice(0, -1)), r = t[t.length - 1][0], i = n?.[r];
2889
+ if (i && "items" in i) return i;
2890
+ throw Error("Parent collection not found");
2891
+ };
2892
+ function ur(e, t, n) {
2893
+ let r = n(t, e);
2894
+ if (typeof r == "symbol") return r;
2895
+ for (let i of ["key", "value"]) {
2896
+ let a = t[i];
2897
+ if (a && "items" in a) {
2898
+ for (let t = 0; t < a.items.length; ++t) {
2899
+ let r = ur(Object.freeze(e.concat([[i, t]])), a.items[t], n);
2900
+ if (typeof r == "number") t = r - 1;
2901
+ else if (r === or) return or;
2902
+ else r === cr && (a.items.splice(t, 1), --t);
2903
+ }
2904
+ typeof r == "function" && i === "key" && (r = r(t, e));
2905
+ }
2906
+ }
2907
+ return typeof r == "function" ? r(t, e) : r;
2908
+ }
2909
+ function dr(e) {
2910
+ switch (e) {
2911
+ case "": return "byte-order-mark";
2912
+ case "": return "doc-mode";
2913
+ case "": return "flow-error-end";
2914
+ case "": return "scalar";
2915
+ case "---": return "doc-start";
2916
+ case "...": return "doc-end";
2917
+ case "":
2918
+ case "\n":
2919
+ case "\r\n": return "newline";
2920
+ case "-": return "seq-item-ind";
2921
+ case "?": return "explicit-key-ind";
2922
+ case ":": return "map-value-ind";
2923
+ case "{": return "flow-map-start";
2924
+ case "}": return "flow-map-end";
2925
+ case "[": return "flow-seq-start";
2926
+ case "]": return "flow-seq-end";
2927
+ case ",": return "comma";
2928
+ }
2929
+ switch (e[0]) {
2930
+ case " ":
2931
+ case " ": return "space";
2932
+ case "#": return "comment";
2933
+ case "%": return "directive-line";
2934
+ case "*": return "alias";
2935
+ case "&": return "anchor";
2936
+ case "!": return "tag";
2937
+ case "'": return "single-quoted-scalar";
2938
+ case "\"": return "double-quoted-scalar";
2939
+ case "|":
2940
+ case ">": return "block-scalar-header";
2941
+ }
2942
+ return null;
2943
+ }
2944
+ //#endregion
2945
+ //#region node_modules/yaml/browser/dist/parse/lexer.js
2946
+ function Q(e) {
2947
+ switch (e) {
2948
+ case void 0:
2949
+ case " ":
2950
+ case "\n":
2951
+ case "\r":
2952
+ case " ": return !0;
2953
+ default: return !1;
2954
+ }
2955
+ }
2956
+ var fr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), pr = /* @__PURE__ */ new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"), mr = /* @__PURE__ */ new Set(",[]{}"), hr = /* @__PURE__ */ new Set(" ,[]{}\n\r "), gr = (e) => !e || hr.has(e), _r = class {
2957
+ constructor() {
2958
+ this.atEnd = !1, this.blockScalarIndent = -1, this.blockScalarKeep = !1, this.buffer = "", this.flowKey = !1, this.flowLevel = 0, this.indentNext = 0, this.indentValue = 0, this.lineEndPos = null, this.next = null, this.pos = 0;
2959
+ }
2960
+ *lex(e, t = !1) {
2961
+ if (e) {
2962
+ if (typeof e != "string") throw TypeError("source is not a string");
2963
+ this.buffer = this.buffer ? this.buffer + e : e, this.lineEndPos = null;
2964
+ }
2965
+ this.atEnd = !t;
2966
+ let n = this.next ?? "stream";
2967
+ for (; n && (t || this.hasChars(1));) n = yield* this.parseNext(n);
2968
+ }
2969
+ atLineEnd() {
2970
+ let e = this.pos, t = this.buffer[e];
2971
+ for (; t === " " || t === " ";) t = this.buffer[++e];
2972
+ return !t || t === "#" || t === "\n" || t === "\r" && this.buffer[e + 1] === "\n";
2973
+ }
2974
+ charAt(e) {
2975
+ return this.buffer[this.pos + e];
2976
+ }
2977
+ continueScalar(e) {
2978
+ let t = this.buffer[e];
2979
+ if (this.indentNext > 0) {
2980
+ let n = 0;
2981
+ for (; t === " ";) t = this.buffer[++n + e];
2982
+ if (t === "\r") {
2983
+ let t = this.buffer[n + e + 1];
2984
+ if (t === "\n" || !t && !this.atEnd) return e + n + 1;
2985
+ }
2986
+ return t === "\n" || n >= this.indentNext || !t && !this.atEnd ? e + n : -1;
2987
+ }
2988
+ if (t === "-" || t === ".") {
2989
+ let t = this.buffer.substr(e, 3);
2990
+ if ((t === "---" || t === "...") && Q(this.buffer[e + 3])) return -1;
2991
+ }
2992
+ return e;
2993
+ }
2994
+ getLine() {
2995
+ let e = this.lineEndPos;
2996
+ return (typeof e != "number" || e !== -1 && e < this.pos) && (e = this.buffer.indexOf("\n", this.pos), this.lineEndPos = e), e === -1 ? this.atEnd ? this.buffer.substring(this.pos) : null : (this.buffer[e - 1] === "\r" && --e, this.buffer.substring(this.pos, e));
2997
+ }
2998
+ hasChars(e) {
2999
+ return this.pos + e <= this.buffer.length;
3000
+ }
3001
+ setNext(e) {
3002
+ return this.buffer = this.buffer.substring(this.pos), this.pos = 0, this.lineEndPos = null, this.next = e, null;
3003
+ }
3004
+ peek(e) {
3005
+ return this.buffer.substr(this.pos, e);
3006
+ }
3007
+ *parseNext(e) {
3008
+ switch (e) {
3009
+ case "stream": return yield* this.parseStream();
3010
+ case "line-start": return yield* this.parseLineStart();
3011
+ case "block-start": return yield* this.parseBlockStart();
3012
+ case "doc": return yield* this.parseDocument();
3013
+ case "flow": return yield* this.parseFlowCollection();
3014
+ case "quoted-scalar": return yield* this.parseQuotedScalar();
3015
+ case "block-scalar": return yield* this.parseBlockScalar();
3016
+ case "plain-scalar": return yield* this.parsePlainScalar();
3017
+ }
3018
+ }
3019
+ *parseStream() {
3020
+ let e = this.getLine();
3021
+ if (e === null) return this.setNext("stream");
3022
+ if (e[0] === "" && (yield* this.pushCount(1), e = e.substring(1)), e[0] === "%") {
3023
+ let t = e.length, n = e.indexOf("#");
3024
+ for (; n !== -1;) {
3025
+ let r = e[n - 1];
3026
+ if (r === " " || r === " ") {
3027
+ t = n - 1;
3028
+ break;
3029
+ }
3030
+ n = e.indexOf("#", n + 1);
3031
+ }
3032
+ for (;;) {
3033
+ let n = e[t - 1];
3034
+ if (n === " " || n === " ") --t;
3035
+ else break;
3036
+ }
3037
+ let r = (yield* this.pushCount(t)) + (yield* this.pushSpaces(!0));
3038
+ return yield* this.pushCount(e.length - r), this.pushNewline(), "stream";
3039
+ }
3040
+ if (this.atLineEnd()) {
3041
+ let t = yield* this.pushSpaces(!0);
3042
+ return yield* this.pushCount(e.length - t), yield* this.pushNewline(), "stream";
3043
+ }
3044
+ return yield "", yield* this.parseLineStart();
3045
+ }
3046
+ *parseLineStart() {
3047
+ let e = this.charAt(0);
3048
+ if (!e && !this.atEnd) return this.setNext("line-start");
3049
+ if (e === "-" || e === ".") {
3050
+ if (!this.atEnd && !this.hasChars(4)) return this.setNext("line-start");
3051
+ let e = this.peek(3);
3052
+ if (e === "---" && Q(this.charAt(3))) return yield* this.pushCount(3), this.indentValue = 0, this.indentNext = 0, "doc";
3053
+ if (e === "..." && Q(this.charAt(3))) return yield* this.pushCount(3), "stream";
3054
+ }
3055
+ return this.indentValue = yield* this.pushSpaces(!1), this.indentNext > this.indentValue && !Q(this.charAt(1)) && (this.indentNext = this.indentValue), yield* this.parseBlockStart();
3056
+ }
3057
+ *parseBlockStart() {
3058
+ let [e, t] = this.peek(2);
3059
+ if (!t && !this.atEnd) return this.setNext("block-start");
3060
+ if ((e === "-" || e === "?" || e === ":") && Q(t)) {
3061
+ let e = (yield* this.pushCount(1)) + (yield* this.pushSpaces(!0));
3062
+ return this.indentNext = this.indentValue + 1, this.indentValue += e, yield* this.parseBlockStart();
3063
+ }
3064
+ return "doc";
3065
+ }
3066
+ *parseDocument() {
3067
+ yield* this.pushSpaces(!0);
3068
+ let e = this.getLine();
3069
+ if (e === null) return this.setNext("doc");
3070
+ let t = yield* this.pushIndicators();
3071
+ switch (e[t]) {
3072
+ case "#": yield* this.pushCount(e.length - t);
3073
+ case void 0: return yield* this.pushNewline(), yield* this.parseLineStart();
3074
+ case "{":
3075
+ case "[": return yield* this.pushCount(1), this.flowKey = !1, this.flowLevel = 1, "flow";
3076
+ case "}":
3077
+ case "]": return yield* this.pushCount(1), "doc";
3078
+ case "*": return yield* this.pushUntil(gr), "doc";
3079
+ case "\"":
3080
+ case "'": return yield* this.parseQuotedScalar();
3081
+ case "|":
3082
+ case ">": return t += yield* this.parseBlockScalarHeader(), t += yield* this.pushSpaces(!0), yield* this.pushCount(e.length - t), yield* this.pushNewline(), yield* this.parseBlockScalar();
3083
+ default: return yield* this.parsePlainScalar();
3084
+ }
3085
+ }
3086
+ *parseFlowCollection() {
3087
+ let e, t, n = -1;
3088
+ do
3089
+ e = yield* this.pushNewline(), e > 0 ? (t = yield* this.pushSpaces(!1), this.indentValue = n = t) : t = 0, t += yield* this.pushSpaces(!0);
3090
+ while (e + t > 0);
3091
+ let r = this.getLine();
3092
+ if (r === null) return this.setNext("flow");
3093
+ if ((n !== -1 && n < this.indentNext && r[0] !== "#" || n === 0 && (r.startsWith("---") || r.startsWith("...")) && Q(r[3])) && (n !== this.indentNext - 1 || this.flowLevel !== 1 || r[0] !== "]" && r[0] !== "}")) return this.flowLevel = 0, yield "", yield* this.parseLineStart();
3094
+ let i = 0;
3095
+ for (; r[i] === ",";) i += yield* this.pushCount(1), i += yield* this.pushSpaces(!0), this.flowKey = !1;
3096
+ switch (i += yield* this.pushIndicators(), r[i]) {
3097
+ case void 0: return "flow";
3098
+ case "#": return yield* this.pushCount(r.length - i), "flow";
3099
+ case "{":
3100
+ case "[": return yield* this.pushCount(1), this.flowKey = !1, this.flowLevel += 1, "flow";
3101
+ case "}":
3102
+ case "]": return yield* this.pushCount(1), this.flowKey = !0, --this.flowLevel, this.flowLevel ? "flow" : "doc";
3103
+ case "*": return yield* this.pushUntil(gr), "flow";
3104
+ case "\"":
3105
+ case "'": return this.flowKey = !0, yield* this.parseQuotedScalar();
3106
+ case ":": {
3107
+ let e = this.charAt(1);
3108
+ if (this.flowKey || Q(e) || e === ",") return this.flowKey = !1, yield* this.pushCount(1), yield* this.pushSpaces(!0), "flow";
3109
+ }
3110
+ default: return this.flowKey = !1, yield* this.parsePlainScalar();
3111
+ }
3112
+ }
3113
+ *parseQuotedScalar() {
3114
+ let e = this.charAt(0), t = this.buffer.indexOf(e, this.pos + 1);
3115
+ if (e === "'") for (; t !== -1 && this.buffer[t + 1] === "'";) t = this.buffer.indexOf("'", t + 2);
3116
+ else for (; t !== -1;) {
3117
+ let e = 0;
3118
+ for (; this.buffer[t - 1 - e] === "\\";) e += 1;
3119
+ if (e % 2 == 0) break;
3120
+ t = this.buffer.indexOf("\"", t + 1);
3121
+ }
3122
+ let n = this.buffer.substring(0, t), r = n.indexOf("\n", this.pos);
3123
+ if (r !== -1) {
3124
+ for (; r !== -1;) {
3125
+ let e = this.continueScalar(r + 1);
3126
+ if (e === -1) break;
3127
+ r = n.indexOf("\n", e);
3128
+ }
3129
+ r !== -1 && (t = r - (n[r - 1] === "\r" ? 2 : 1));
3130
+ }
3131
+ if (t === -1) {
3132
+ if (!this.atEnd) return this.setNext("quoted-scalar");
3133
+ t = this.buffer.length;
3134
+ }
3135
+ return yield* this.pushToIndex(t + 1, !1), this.flowLevel ? "flow" : "doc";
3136
+ }
3137
+ *parseBlockScalarHeader() {
3138
+ this.blockScalarIndent = -1, this.blockScalarKeep = !1;
3139
+ let e = this.pos;
3140
+ for (;;) {
3141
+ let t = this.buffer[++e];
3142
+ if (t === "+") this.blockScalarKeep = !0;
3143
+ else if (t > "0" && t <= "9") this.blockScalarIndent = Number(t) - 1;
3144
+ else if (t !== "-") break;
3145
+ }
3146
+ return yield* this.pushUntil((e) => Q(e) || e === "#");
3147
+ }
3148
+ *parseBlockScalar() {
3149
+ let e = this.pos - 1, t = 0, n;
3150
+ loop: for (let r = this.pos; n = this.buffer[r]; ++r) switch (n) {
3151
+ case " ":
3152
+ t += 1;
3153
+ break;
3154
+ case "\n":
3155
+ e = r, t = 0;
3156
+ break;
3157
+ case "\r": {
3158
+ let e = this.buffer[r + 1];
3159
+ if (!e && !this.atEnd) return this.setNext("block-scalar");
3160
+ if (e === "\n") break;
3161
+ }
3162
+ default: break loop;
3163
+ }
3164
+ if (!n && !this.atEnd) return this.setNext("block-scalar");
3165
+ if (t >= this.indentNext) {
3166
+ this.indentNext = this.blockScalarIndent === -1 ? t : this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext);
3167
+ do {
3168
+ let t = this.continueScalar(e + 1);
3169
+ if (t === -1) break;
3170
+ e = this.buffer.indexOf("\n", t);
3171
+ } while (e !== -1);
3172
+ if (e === -1) {
3173
+ if (!this.atEnd) return this.setNext("block-scalar");
3174
+ e = this.buffer.length;
3175
+ }
3176
+ }
3177
+ let r = e + 1;
3178
+ for (n = this.buffer[r]; n === " ";) n = this.buffer[++r];
3179
+ if (n === " ") {
3180
+ for (; n === " " || n === " " || n === "\r" || n === "\n";) n = this.buffer[++r];
3181
+ e = r - 1;
3182
+ } else if (!this.blockScalarKeep) do {
3183
+ let n = e - 1, r = this.buffer[n];
3184
+ r === "\r" && (r = this.buffer[--n]);
3185
+ let i = n;
3186
+ for (; r === " ";) r = this.buffer[--n];
3187
+ if (r === "\n" && n >= this.pos && n + 1 + t > i) e = n;
3188
+ else break;
3189
+ } while (1);
3190
+ return yield "", yield* this.pushToIndex(e + 1, !0), yield* this.parseLineStart();
3191
+ }
3192
+ *parsePlainScalar() {
3193
+ let e = this.flowLevel > 0, t = this.pos - 1, n = this.pos - 1, r;
3194
+ for (; r = this.buffer[++n];) if (r === ":") {
3195
+ let r = this.buffer[n + 1];
3196
+ if (Q(r) || e && mr.has(r)) break;
3197
+ t = n;
3198
+ } else if (Q(r)) {
3199
+ let i = this.buffer[n + 1];
3200
+ if (r === "\r" && (i === "\n" ? (n += 1, r = "\n", i = this.buffer[n + 1]) : t = n), i === "#" || e && mr.has(i)) break;
3201
+ if (r === "\n") {
3202
+ let e = this.continueScalar(n + 1);
3203
+ if (e === -1) break;
3204
+ n = Math.max(n, e - 2);
3205
+ }
3206
+ } else {
3207
+ if (e && mr.has(r)) break;
3208
+ t = n;
3209
+ }
3210
+ return !r && !this.atEnd ? this.setNext("plain-scalar") : (yield "", yield* this.pushToIndex(t + 1, !0), e ? "flow" : "doc");
3211
+ }
3212
+ *pushCount(e) {
3213
+ return e > 0 ? (yield this.buffer.substr(this.pos, e), this.pos += e, e) : 0;
3214
+ }
3215
+ *pushToIndex(e, t) {
3216
+ let n = this.buffer.slice(this.pos, e);
3217
+ return n ? (yield n, this.pos += n.length, n.length) : (t && (yield ""), 0);
3218
+ }
3219
+ *pushIndicators() {
3220
+ switch (this.charAt(0)) {
3221
+ case "!": return (yield* this.pushTag()) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
3222
+ case "&": return (yield* this.pushUntil(gr)) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
3223
+ case "-":
3224
+ case "?":
3225
+ case ":": {
3226
+ let e = this.flowLevel > 0, t = this.charAt(1);
3227
+ if (Q(t) || e && mr.has(t)) return e ? this.flowKey &&= !1 : this.indentNext = this.indentValue + 1, (yield* this.pushCount(1)) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
3228
+ }
3229
+ }
3230
+ return 0;
3231
+ }
3232
+ *pushTag() {
3233
+ if (this.charAt(1) === "<") {
3234
+ let e = this.pos + 2, t = this.buffer[e];
3235
+ for (; !Q(t) && t !== ">";) t = this.buffer[++e];
3236
+ return yield* this.pushToIndex(t === ">" ? e + 1 : e, !1);
3237
+ }
3238
+ {
3239
+ let e = this.pos + 1, t = this.buffer[e];
3240
+ for (; t;) if (pr.has(t)) t = this.buffer[++e];
3241
+ else if (t === "%" && fr.has(this.buffer[e + 1]) && fr.has(this.buffer[e + 2])) t = this.buffer[e += 3];
3242
+ else break;
3243
+ return yield* this.pushToIndex(e, !1);
3244
+ }
3245
+ }
3246
+ *pushNewline() {
3247
+ let e = this.buffer[this.pos];
3248
+ return e === "\n" ? yield* this.pushCount(1) : e === "\r" && this.charAt(1) === "\n" ? yield* this.pushCount(2) : 0;
3249
+ }
3250
+ *pushSpaces(e) {
3251
+ let t = this.pos - 1, n;
3252
+ do
3253
+ n = this.buffer[++t];
3254
+ while (n === " " || e && n === " ");
3255
+ let r = t - this.pos;
3256
+ return r > 0 && (yield this.buffer.substr(this.pos, r), this.pos = t), r;
3257
+ }
3258
+ *pushUntil(e) {
3259
+ let t = this.pos, n = this.buffer[t];
3260
+ for (; !e(n);) n = this.buffer[++t];
3261
+ return yield* this.pushToIndex(t, !1);
3262
+ }
3263
+ }, vr = class {
3264
+ constructor() {
3265
+ this.lineStarts = [], this.addNewLine = (e) => this.lineStarts.push(e), this.linePos = (e) => {
3266
+ let t = 0, n = this.lineStarts.length;
3267
+ for (; t < n;) {
3268
+ let r = t + n >> 1;
3269
+ this.lineStarts[r] < e ? t = r + 1 : n = r;
3270
+ }
3271
+ if (this.lineStarts[t] === e) return {
3272
+ line: t + 1,
3273
+ col: 1
3274
+ };
3275
+ if (t === 0) return {
3276
+ line: 0,
3277
+ col: e
3278
+ };
3279
+ let r = this.lineStarts[t - 1];
3280
+ return {
3281
+ line: t,
3282
+ col: e - r + 1
3283
+ };
3284
+ };
3285
+ }
3286
+ };
3287
+ //#endregion
3288
+ //#region node_modules/yaml/browser/dist/parse/parser.js
3289
+ function $(e, t) {
3290
+ for (let n = 0; n < e.length; ++n) if (e[n].type === t) return !0;
3291
+ return !1;
3292
+ }
3293
+ function yr(e) {
3294
+ for (let t = 0; t < e.length; ++t) switch (e[t].type) {
3295
+ case "space":
3296
+ case "comment":
3297
+ case "newline": break;
3298
+ default: return t;
3299
+ }
3300
+ return -1;
3301
+ }
3302
+ function br(e) {
3303
+ switch (e?.type) {
3304
+ case "alias":
3305
+ case "scalar":
3306
+ case "single-quoted-scalar":
3307
+ case "double-quoted-scalar":
3308
+ case "flow-collection": return !0;
3309
+ default: return !1;
3310
+ }
3311
+ }
3312
+ function xr(e) {
3313
+ switch (e.type) {
3314
+ case "document": return e.start;
3315
+ case "block-map": {
3316
+ let t = e.items[e.items.length - 1];
3317
+ return t.sep ?? t.start;
3318
+ }
3319
+ case "block-seq": return e.items[e.items.length - 1].start;
3320
+ /* istanbul ignore next should not happen */
3321
+ default: return [];
3322
+ }
3323
+ }
3324
+ function Sr(e) {
3325
+ if (e.length === 0) return [];
3326
+ let t = e.length;
3327
+ loop: for (; --t >= 0;) switch (e[t].type) {
3328
+ case "doc-start":
3329
+ case "explicit-key-ind":
3330
+ case "map-value-ind":
3331
+ case "seq-item-ind":
3332
+ case "newline": break loop;
3333
+ }
3334
+ for (; e[++t]?.type === "space";);
3335
+ return e.splice(t, e.length);
3336
+ }
3337
+ function Cr(e) {
3338
+ if (e.start.type === "flow-seq-start") for (let t of e.items) t.sep && !t.value && !$(t.start, "explicit-key-ind") && !$(t.sep, "map-value-ind") && (t.key && (t.value = t.key), delete t.key, br(t.value) ? t.value.end ? Array.prototype.push.apply(t.value.end, t.sep) : t.value.end = t.sep : Array.prototype.push.apply(t.start, t.sep), delete t.sep);
3339
+ }
3340
+ var wr = class {
3341
+ constructor(e) {
3342
+ this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new _r(), this.onNewLine = e;
3343
+ }
3344
+ *parse(e, t = !1) {
3345
+ this.onNewLine && this.offset === 0 && this.onNewLine(0);
3346
+ for (let n of this.lexer.lex(e, t)) yield* this.next(n);
3347
+ t || (yield* this.end());
3348
+ }
3349
+ *next(e) {
3350
+ if (this.source = e, this.atScalar) {
3351
+ this.atScalar = !1, yield* this.step(), this.offset += e.length;
3352
+ return;
3353
+ }
3354
+ let t = dr(e);
3355
+ if (!t) {
3356
+ let t = `Not a YAML token: ${e}`;
3357
+ yield* this.pop({
3358
+ type: "error",
3359
+ offset: this.offset,
3360
+ message: t,
3361
+ source: e
3362
+ }), this.offset += e.length;
3363
+ } else if (t === "scalar") this.atNewLine = !1, this.atScalar = !0, this.type = "scalar";
3364
+ else {
3365
+ switch (this.type = t, yield* this.step(), t) {
3366
+ case "newline":
3367
+ this.atNewLine = !0, this.indent = 0, this.onNewLine && this.onNewLine(this.offset + e.length);
3368
+ break;
3369
+ case "space":
3370
+ this.atNewLine && e[0] === " " && (this.indent += e.length);
3371
+ break;
3372
+ case "explicit-key-ind":
3373
+ case "map-value-ind":
3374
+ case "seq-item-ind":
3375
+ this.atNewLine && (this.indent += e.length);
3376
+ break;
3377
+ case "doc-mode":
3378
+ case "flow-error-end": return;
3379
+ default: this.atNewLine = !1;
3380
+ }
3381
+ this.offset += e.length;
3382
+ }
3383
+ }
3384
+ *end() {
3385
+ for (; this.stack.length > 0;) yield* this.pop();
3386
+ }
3387
+ get sourceToken() {
3388
+ return {
3389
+ type: this.type,
3390
+ offset: this.offset,
3391
+ indent: this.indent,
3392
+ source: this.source
3393
+ };
3394
+ }
3395
+ *step() {
3396
+ let e = this.peek(1);
3397
+ if (this.type === "doc-end" && (!e || e.type !== "doc-end")) {
3398
+ for (; this.stack.length > 0;) yield* this.pop();
3399
+ this.stack.push({
3400
+ type: "doc-end",
3401
+ offset: this.offset,
3402
+ source: this.source
3403
+ });
3404
+ return;
3405
+ }
3406
+ if (!e) return yield* this.stream();
3407
+ switch (e.type) {
3408
+ case "document": return yield* this.document(e);
3409
+ case "alias":
3410
+ case "scalar":
3411
+ case "single-quoted-scalar":
3412
+ case "double-quoted-scalar": return yield* this.scalar(e);
3413
+ case "block-scalar": return yield* this.blockScalar(e);
3414
+ case "block-map": return yield* this.blockMap(e);
3415
+ case "block-seq": return yield* this.blockSequence(e);
3416
+ case "flow-collection": return yield* this.flowCollection(e);
3417
+ case "doc-end": return yield* this.documentEnd(e);
3418
+ }
3419
+ /* istanbul ignore next should not happen */
3420
+ yield* this.pop();
3421
+ }
3422
+ peek(e) {
3423
+ return this.stack[this.stack.length - e];
3424
+ }
3425
+ *pop(e) {
3426
+ let t = e ?? this.stack.pop();
3427
+ /* istanbul ignore if should not happen */
3428
+ if (!t) yield {
3429
+ type: "error",
3430
+ offset: this.offset,
3431
+ source: "",
3432
+ message: "Tried to pop an empty stack"
3433
+ };
3434
+ else if (this.stack.length === 0) yield t;
3435
+ else {
3436
+ let e = this.peek(1);
3437
+ switch (t.type === "block-scalar" ? t.indent = "indent" in e ? e.indent : 0 : t.type === "flow-collection" && e.type === "document" && (t.indent = 0), t.type === "flow-collection" && Cr(t), e.type) {
3438
+ case "document":
3439
+ e.value = t;
3440
+ break;
3441
+ case "block-scalar":
3442
+ e.props.push(t);
3443
+ break;
3444
+ case "block-map": {
3445
+ let n = e.items[e.items.length - 1];
3446
+ if (n.value) {
3447
+ e.items.push({
3448
+ start: [],
3449
+ key: t,
3450
+ sep: []
3451
+ }), this.onKeyLine = !0;
3452
+ return;
3453
+ }
3454
+ if (n.sep) n.value = t;
3455
+ else {
3456
+ Object.assign(n, {
3457
+ key: t,
3458
+ sep: []
3459
+ }), this.onKeyLine = !n.explicitKey;
3460
+ return;
3461
+ }
3462
+ break;
3463
+ }
3464
+ case "block-seq": {
3465
+ let n = e.items[e.items.length - 1];
3466
+ n.value ? e.items.push({
3467
+ start: [],
3468
+ value: t
3469
+ }) : n.value = t;
3470
+ break;
3471
+ }
3472
+ case "flow-collection": {
3473
+ let n = e.items[e.items.length - 1];
3474
+ !n || n.value ? e.items.push({
3475
+ start: [],
3476
+ key: t,
3477
+ sep: []
3478
+ }) : n.sep ? n.value = t : Object.assign(n, {
3479
+ key: t,
3480
+ sep: []
3481
+ });
3482
+ return;
3483
+ }
3484
+ /* istanbul ignore next should not happen */
3485
+ default: yield* this.pop(), yield* this.pop(t);
3486
+ }
3487
+ if ((e.type === "document" || e.type === "block-map" || e.type === "block-seq") && (t.type === "block-map" || t.type === "block-seq")) {
3488
+ let n = t.items[t.items.length - 1];
3489
+ n && !n.sep && !n.value && n.start.length > 0 && yr(n.start) === -1 && (t.indent === 0 || n.start.every((e) => e.type !== "comment" || e.indent < t.indent)) && (e.type === "document" ? e.end = n.start : e.items.push({ start: n.start }), t.items.splice(-1, 1));
3490
+ }
3491
+ }
3492
+ }
3493
+ *stream() {
3494
+ switch (this.type) {
3495
+ case "directive-line":
3496
+ yield {
3497
+ type: "directive",
3498
+ offset: this.offset,
3499
+ source: this.source
3500
+ };
3501
+ return;
3502
+ case "byte-order-mark":
3503
+ case "space":
3504
+ case "comment":
3505
+ case "newline":
3506
+ yield this.sourceToken;
3507
+ return;
3508
+ case "doc-mode":
3509
+ case "doc-start": {
3510
+ let e = {
3511
+ type: "document",
3512
+ offset: this.offset,
3513
+ start: []
3514
+ };
3515
+ this.type === "doc-start" && e.start.push(this.sourceToken), this.stack.push(e);
3516
+ return;
3517
+ }
3518
+ }
3519
+ yield {
3520
+ type: "error",
3521
+ offset: this.offset,
3522
+ message: `Unexpected ${this.type} token in YAML stream`,
3523
+ source: this.source
3524
+ };
3525
+ }
3526
+ *document(e) {
3527
+ if (e.value) return yield* this.lineEnd(e);
3528
+ switch (this.type) {
3529
+ case "doc-start":
3530
+ yr(e.start) === -1 ? e.start.push(this.sourceToken) : (yield* this.pop(), yield* this.step());
3531
+ return;
3532
+ case "anchor":
3533
+ case "tag":
3534
+ case "space":
3535
+ case "comment":
3536
+ case "newline":
3537
+ e.start.push(this.sourceToken);
3538
+ return;
3539
+ }
3540
+ let t = this.startBlockValue(e);
3541
+ t ? this.stack.push(t) : yield {
3542
+ type: "error",
3543
+ offset: this.offset,
3544
+ message: `Unexpected ${this.type} token in YAML document`,
3545
+ source: this.source
3546
+ };
3547
+ }
3548
+ *scalar(e) {
3549
+ if (this.type === "map-value-ind") {
3550
+ let t = Sr(xr(this.peek(2))), n;
3551
+ e.end ? (n = e.end, n.push(this.sourceToken), delete e.end) : n = [this.sourceToken];
3552
+ let r = {
3553
+ type: "block-map",
3554
+ offset: e.offset,
3555
+ indent: e.indent,
3556
+ items: [{
3557
+ start: t,
3558
+ key: e,
3559
+ sep: n
3560
+ }]
3561
+ };
3562
+ this.onKeyLine = !0, this.stack[this.stack.length - 1] = r;
3563
+ } else yield* this.lineEnd(e);
3564
+ }
3565
+ *blockScalar(e) {
3566
+ switch (this.type) {
3567
+ case "space":
3568
+ case "comment":
3569
+ case "newline":
3570
+ e.props.push(this.sourceToken);
3571
+ return;
3572
+ case "scalar":
3573
+ if (e.source = this.source, this.atNewLine = !0, this.indent = 0, this.onNewLine) {
3574
+ let e = this.source.indexOf("\n") + 1;
3575
+ for (; e !== 0;) this.onNewLine(this.offset + e), e = this.source.indexOf("\n", e) + 1;
3576
+ }
3577
+ yield* this.pop();
3578
+ break;
3579
+ /* istanbul ignore next should not happen */
3580
+ default: yield* this.pop(), yield* this.step();
3581
+ }
3582
+ }
3583
+ *blockMap(e) {
3584
+ let t = e.items[e.items.length - 1];
3585
+ switch (this.type) {
3586
+ case "newline":
3587
+ if (this.onKeyLine = !1, t.value) {
3588
+ let n = "end" in t.value ? t.value.end : void 0;
3589
+ (Array.isArray(n) ? n[n.length - 1] : void 0)?.type === "comment" ? n?.push(this.sourceToken) : e.items.push({ start: [this.sourceToken] });
3590
+ } else t.sep ? t.sep.push(this.sourceToken) : t.start.push(this.sourceToken);
3591
+ return;
3592
+ case "space":
3593
+ case "comment":
3594
+ if (t.value) e.items.push({ start: [this.sourceToken] });
3595
+ else if (t.sep) t.sep.push(this.sourceToken);
3596
+ else {
3597
+ if (this.atIndentedComment(t.start, e.indent)) {
3598
+ let n = e.items[e.items.length - 2]?.value?.end;
3599
+ if (Array.isArray(n)) {
3600
+ Array.prototype.push.apply(n, t.start), n.push(this.sourceToken), e.items.pop();
3601
+ return;
3602
+ }
3603
+ }
3604
+ t.start.push(this.sourceToken);
3605
+ }
3606
+ return;
3607
+ }
3608
+ if (this.indent >= e.indent) {
3609
+ let n = !this.onKeyLine && this.indent === e.indent, r = n && (t.sep || t.explicitKey) && this.type !== "seq-item-ind", i = [];
3610
+ if (r && t.sep && !t.value) {
3611
+ let n = [];
3612
+ for (let r = 0; r < t.sep.length; ++r) {
3613
+ let i = t.sep[r];
3614
+ switch (i.type) {
3615
+ case "newline":
3616
+ n.push(r);
3617
+ break;
3618
+ case "space": break;
3619
+ case "comment":
3620
+ i.indent > e.indent && (n.length = 0);
3621
+ break;
3622
+ default: n.length = 0;
3623
+ }
3624
+ }
3625
+ n.length >= 2 && (i = t.sep.splice(n[1]));
3626
+ }
3627
+ switch (this.type) {
3628
+ case "anchor":
3629
+ case "tag":
3630
+ r || t.value ? (i.push(this.sourceToken), e.items.push({ start: i }), this.onKeyLine = !0) : t.sep ? t.sep.push(this.sourceToken) : t.start.push(this.sourceToken);
3631
+ return;
3632
+ case "explicit-key-ind":
3633
+ !t.sep && !t.explicitKey ? (t.start.push(this.sourceToken), t.explicitKey = !0) : r || t.value ? (i.push(this.sourceToken), e.items.push({
3634
+ start: i,
3635
+ explicitKey: !0
3636
+ })) : this.stack.push({
3637
+ type: "block-map",
3638
+ offset: this.offset,
3639
+ indent: this.indent,
3640
+ items: [{
3641
+ start: [this.sourceToken],
3642
+ explicitKey: !0
3643
+ }]
3644
+ }), this.onKeyLine = !0;
3645
+ return;
3646
+ case "map-value-ind":
3647
+ if (t.explicitKey) {
3648
+ if (!t.sep) {
3649
+ if ($(t.start, "newline")) Object.assign(t, {
3650
+ key: null,
3651
+ sep: [this.sourceToken]
3652
+ });
3653
+ else {
3654
+ let e = Sr(t.start);
3655
+ this.stack.push({
3656
+ type: "block-map",
3657
+ offset: this.offset,
3658
+ indent: this.indent,
3659
+ items: [{
3660
+ start: e,
3661
+ key: null,
3662
+ sep: [this.sourceToken]
3663
+ }]
3664
+ });
3665
+ }
3666
+ } else if (t.value) e.items.push({
3667
+ start: [],
3668
+ key: null,
3669
+ sep: [this.sourceToken]
3670
+ });
3671
+ else if ($(t.sep, "map-value-ind")) this.stack.push({
3672
+ type: "block-map",
3673
+ offset: this.offset,
3674
+ indent: this.indent,
3675
+ items: [{
3676
+ start: i,
3677
+ key: null,
3678
+ sep: [this.sourceToken]
3679
+ }]
3680
+ });
3681
+ else if (br(t.key) && !$(t.sep, "newline")) {
3682
+ let e = Sr(t.start), n = t.key, r = t.sep;
3683
+ r.push(this.sourceToken), delete t.key, delete t.sep, this.stack.push({
3684
+ type: "block-map",
3685
+ offset: this.offset,
3686
+ indent: this.indent,
3687
+ items: [{
3688
+ start: e,
3689
+ key: n,
3690
+ sep: r
3691
+ }]
3692
+ });
3693
+ } else i.length > 0 ? t.sep = t.sep.concat(i, this.sourceToken) : t.sep.push(this.sourceToken);
3694
+ } else t.sep ? t.value || r ? e.items.push({
3695
+ start: i,
3696
+ key: null,
3697
+ sep: [this.sourceToken]
3698
+ }) : $(t.sep, "map-value-ind") ? this.stack.push({
3699
+ type: "block-map",
3700
+ offset: this.offset,
3701
+ indent: this.indent,
3702
+ items: [{
3703
+ start: [],
3704
+ key: null,
3705
+ sep: [this.sourceToken]
3706
+ }]
3707
+ }) : t.sep.push(this.sourceToken) : Object.assign(t, {
3708
+ key: null,
3709
+ sep: [this.sourceToken]
3710
+ });
3711
+ this.onKeyLine = !0;
3712
+ return;
3713
+ case "alias":
3714
+ case "scalar":
3715
+ case "single-quoted-scalar":
3716
+ case "double-quoted-scalar": {
3717
+ let n = this.flowScalar(this.type);
3718
+ r || t.value ? (e.items.push({
3719
+ start: i,
3720
+ key: n,
3721
+ sep: []
3722
+ }), this.onKeyLine = !0) : t.sep ? this.stack.push(n) : (Object.assign(t, {
3723
+ key: n,
3724
+ sep: []
3725
+ }), this.onKeyLine = !0);
3726
+ return;
3727
+ }
3728
+ default: {
3729
+ let t = this.startBlockValue(e);
3730
+ if (t) {
3731
+ n && t.type !== "block-seq" && e.items.push({ start: i }), this.stack.push(t);
3732
+ return;
3733
+ }
3734
+ }
3735
+ }
3736
+ }
3737
+ yield* this.pop(), yield* this.step();
3738
+ }
3739
+ *blockSequence(e) {
3740
+ let t = e.items[e.items.length - 1];
3741
+ switch (this.type) {
3742
+ case "newline":
3743
+ if (t.value) {
3744
+ let n = "end" in t.value ? t.value.end : void 0;
3745
+ (Array.isArray(n) ? n[n.length - 1] : void 0)?.type === "comment" ? n?.push(this.sourceToken) : e.items.push({ start: [this.sourceToken] });
3746
+ } else t.start.push(this.sourceToken);
3747
+ return;
3748
+ case "space":
3749
+ case "comment":
3750
+ if (t.value) e.items.push({ start: [this.sourceToken] });
3751
+ else {
3752
+ if (this.atIndentedComment(t.start, e.indent)) {
3753
+ let n = e.items[e.items.length - 2]?.value?.end;
3754
+ if (Array.isArray(n)) {
3755
+ Array.prototype.push.apply(n, t.start), n.push(this.sourceToken), e.items.pop();
3756
+ return;
3757
+ }
3758
+ }
3759
+ t.start.push(this.sourceToken);
3760
+ }
3761
+ return;
3762
+ case "anchor":
3763
+ case "tag":
3764
+ if (t.value || this.indent <= e.indent) break;
3765
+ t.start.push(this.sourceToken);
3766
+ return;
3767
+ case "seq-item-ind":
3768
+ if (this.indent !== e.indent) break;
3769
+ t.value || $(t.start, "seq-item-ind") ? e.items.push({ start: [this.sourceToken] }) : t.start.push(this.sourceToken);
3770
+ return;
3771
+ }
3772
+ if (this.indent > e.indent) {
3773
+ let t = this.startBlockValue(e);
3774
+ if (t) {
3775
+ this.stack.push(t);
3776
+ return;
3777
+ }
3778
+ }
3779
+ yield* this.pop(), yield* this.step();
3780
+ }
3781
+ *flowCollection(e) {
3782
+ let t = e.items[e.items.length - 1];
3783
+ if (this.type === "flow-error-end") {
3784
+ let e;
3785
+ do
3786
+ yield* this.pop(), e = this.peek(1);
3787
+ while (e && e.type === "flow-collection");
3788
+ } else if (e.end.length === 0) {
3789
+ switch (this.type) {
3790
+ case "comma":
3791
+ case "explicit-key-ind":
3792
+ !t || t.sep ? e.items.push({ start: [this.sourceToken] }) : t.start.push(this.sourceToken);
3793
+ return;
3794
+ case "map-value-ind":
3795
+ !t || t.value ? e.items.push({
3796
+ start: [],
3797
+ key: null,
3798
+ sep: [this.sourceToken]
3799
+ }) : t.sep ? t.sep.push(this.sourceToken) : Object.assign(t, {
3800
+ key: null,
3801
+ sep: [this.sourceToken]
3802
+ });
3803
+ return;
3804
+ case "space":
3805
+ case "comment":
3806
+ case "newline":
3807
+ case "anchor":
3808
+ case "tag":
3809
+ !t || t.value ? e.items.push({ start: [this.sourceToken] }) : t.sep ? t.sep.push(this.sourceToken) : t.start.push(this.sourceToken);
3810
+ return;
3811
+ case "alias":
3812
+ case "scalar":
3813
+ case "single-quoted-scalar":
3814
+ case "double-quoted-scalar": {
3815
+ let n = this.flowScalar(this.type);
3816
+ !t || t.value ? e.items.push({
3817
+ start: [],
3818
+ key: n,
3819
+ sep: []
3820
+ }) : t.sep ? this.stack.push(n) : Object.assign(t, {
3821
+ key: n,
3822
+ sep: []
3823
+ });
3824
+ return;
3825
+ }
3826
+ case "flow-map-end":
3827
+ case "flow-seq-end":
3828
+ e.end.push(this.sourceToken);
3829
+ return;
3830
+ }
3831
+ let n = this.startBlockValue(e);
3832
+ /* istanbul ignore else should not happen */
3833
+ n ? this.stack.push(n) : (yield* this.pop(), yield* this.step());
3834
+ } else {
3835
+ let t = this.peek(2);
3836
+ if (t.type === "block-map" && (this.type === "map-value-ind" && t.indent === e.indent || this.type === "newline" && !t.items[t.items.length - 1].sep)) yield* this.pop(), yield* this.step();
3837
+ else if (this.type === "map-value-ind" && t.type !== "flow-collection") {
3838
+ let n = Sr(xr(t));
3839
+ Cr(e);
3840
+ let r = e.end.splice(1, e.end.length);
3841
+ r.push(this.sourceToken);
3842
+ let i = {
3843
+ type: "block-map",
3844
+ offset: e.offset,
3845
+ indent: e.indent,
3846
+ items: [{
3847
+ start: n,
3848
+ key: e,
3849
+ sep: r
3850
+ }]
3851
+ };
3852
+ this.onKeyLine = !0, this.stack[this.stack.length - 1] = i;
3853
+ } else yield* this.lineEnd(e);
3854
+ }
3855
+ }
3856
+ flowScalar(e) {
3857
+ if (this.onNewLine) {
3858
+ let e = this.source.indexOf("\n") + 1;
3859
+ for (; e !== 0;) this.onNewLine(this.offset + e), e = this.source.indexOf("\n", e) + 1;
3860
+ }
3861
+ return {
3862
+ type: e,
3863
+ offset: this.offset,
3864
+ indent: this.indent,
3865
+ source: this.source
3866
+ };
3867
+ }
3868
+ startBlockValue(e) {
3869
+ switch (this.type) {
3870
+ case "alias":
3871
+ case "scalar":
3872
+ case "single-quoted-scalar":
3873
+ case "double-quoted-scalar": return this.flowScalar(this.type);
3874
+ case "block-scalar-header": return {
3875
+ type: "block-scalar",
3876
+ offset: this.offset,
3877
+ indent: this.indent,
3878
+ props: [this.sourceToken],
3879
+ source: ""
3880
+ };
3881
+ case "flow-map-start":
3882
+ case "flow-seq-start": return {
3883
+ type: "flow-collection",
3884
+ offset: this.offset,
3885
+ indent: this.indent,
3886
+ start: this.sourceToken,
3887
+ items: [],
3888
+ end: []
3889
+ };
3890
+ case "seq-item-ind": return {
3891
+ type: "block-seq",
3892
+ offset: this.offset,
3893
+ indent: this.indent,
3894
+ items: [{ start: [this.sourceToken] }]
3895
+ };
3896
+ case "explicit-key-ind": {
3897
+ this.onKeyLine = !0;
3898
+ let t = Sr(xr(e));
3899
+ return t.push(this.sourceToken), {
3900
+ type: "block-map",
3901
+ offset: this.offset,
3902
+ indent: this.indent,
3903
+ items: [{
3904
+ start: t,
3905
+ explicitKey: !0
3906
+ }]
3907
+ };
3908
+ }
3909
+ case "map-value-ind": {
3910
+ this.onKeyLine = !0;
3911
+ let t = Sr(xr(e));
3912
+ return {
3913
+ type: "block-map",
3914
+ offset: this.offset,
3915
+ indent: this.indent,
3916
+ items: [{
3917
+ start: t,
3918
+ key: null,
3919
+ sep: [this.sourceToken]
3920
+ }]
3921
+ };
3922
+ }
3923
+ }
3924
+ return null;
3925
+ }
3926
+ atIndentedComment(e, t) {
3927
+ return this.type !== "comment" || this.indent <= t ? !1 : e.every((e) => e.type === "newline" || e.type === "space");
3928
+ }
3929
+ *documentEnd(e) {
3930
+ this.type !== "doc-mode" && (e.end ? e.end.push(this.sourceToken) : e.end = [this.sourceToken], this.type === "newline" && (yield* this.pop()));
3931
+ }
3932
+ *lineEnd(e) {
3933
+ switch (this.type) {
3934
+ case "comma":
3935
+ case "doc-start":
3936
+ case "doc-end":
3937
+ case "flow-seq-end":
3938
+ case "flow-map-end":
3939
+ case "map-value-ind":
3940
+ yield* this.pop(), yield* this.step();
3941
+ break;
3942
+ case "newline": this.onKeyLine = !1;
3943
+ default: e.end ? e.end.push(this.sourceToken) : e.end = [this.sourceToken], this.type === "newline" && (yield* this.pop());
3944
+ }
3945
+ }
3946
+ };
3947
+ //#endregion
3948
+ //#region node_modules/yaml/browser/dist/public-api.js
3949
+ function Tr(e) {
3950
+ let t = e.prettyErrors !== !1;
3951
+ return {
3952
+ lineCounter: e.lineCounter || t && new vr() || null,
3953
+ prettyErrors: t
3954
+ };
3955
+ }
3956
+ function Er(e, t = {}) {
3957
+ let { lineCounter: n, prettyErrors: r } = Tr(t), i = new wr(n?.addNewLine), a = new ar(t), o = null;
3958
+ for (let t of a.compose(i.parse(e), !0, e.length)) if (!o) o = t;
3959
+ else if (o.options.logLevel !== "silent") {
3960
+ o.errors.push(new xn(t.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
3961
+ break;
3962
+ }
3963
+ return r && n && (o.errors.forEach(Cn(e, n)), o.warnings.forEach(Cn(e, n))), o;
3964
+ }
3965
+ //#endregion
3966
+ //#region packages/plugins/dsh/endpoint-auth.ts
3967
+ function Dr(e) {
3968
+ return "kano-" + e.replace(/[^a-z0-9]/gu, (e) => "-" + e.codePointAt(0).toString(16) + "-");
3969
+ }
3970
+ function Or(e) {
3971
+ return Dr(e).replaceAll("-", "_").toUpperCase() + "_API_KEY";
3972
+ }
3973
+ function kr(e, t, n, r) {
3974
+ let i = "Bearer kano-local", a = Or(n), o = [...t, "apiKeyEnv"], s = [...t, "headers"], c = e.getIn(o), l = e.getIn(s, !0);
3975
+ if (l !== void 0 && !j(l)) throw Error("dsh 提供方的 headers 不是有效的映射");
3976
+ let u = j(l) ? l.items.map((e) => String(e.key)).find((e) => e.toLowerCase() === "authorization") : void 0, d = [...s, u || "Authorization"];
3977
+ if (r) {
3978
+ if (c && c !== a || u && e.getIn(d) !== i) throw Error("该提供方已有手动配置的认证,请在 dsh 模型设置中更新,以保留原有凭据。");
3979
+ u && e.deleteIn(d), e.setIn(o, a);
3980
+ } else c === a && e.deleteIn(o), !e.getIn(o) && !u && e.setIn(d, i);
3981
+ }
3982
+ async function Ar(e, t, n, r) {
3983
+ let i;
3984
+ try {
3985
+ i = new URL(t.webUrl || "");
3986
+ let e = new URL(S({
3987
+ host: t.params.host,
3988
+ port: t.params.port,
3989
+ defaultPort: 3080
3990
+ }));
3991
+ if (t.status !== "running" || i.origin !== e.origin || i.pathname !== "/" || !i.searchParams.get("token")) throw Error();
3992
+ } catch {
3993
+ throw Error("请先启动 dsh 并等待其 WebUI 就绪,以便保存模型访问凭据。");
3994
+ }
3995
+ let a;
3996
+ try {
3997
+ let t = await e.get(i.href, {
3998
+ no_redirect: !0,
3999
+ timeout: 10
4000
+ }), n = Object.entries(t.headers).find(([e]) => e.toLowerCase() === "set-cookie")?.[1];
4001
+ t.status_code >= 300 && t.status_code < 400 && (a = n?.split(";")[0]);
4002
+ } catch {}
4003
+ if (!a) throw Error("无法取得 dsh 登录会话,请重新启动 dsh 后再试。");
4004
+ try {
4005
+ let t = await e.postJson(i.origin + "/api/credentials/set", {
4006
+ type: "client-request",
4007
+ rpcId: crypto.randomUUID(),
4008
+ method: "credentials/set",
4009
+ payload: { args: {
4010
+ ref: Or(n),
4011
+ value: r
4012
+ } }
4013
+ }, {
4014
+ headers: {
4015
+ Origin: i.origin,
4016
+ Cookie: a
4017
+ },
4018
+ no_redirect: !0,
4019
+ timeout: 10
4020
+ });
4021
+ if (t.status_code === 200 && JSON.parse(t.body)?.result?.ok === !0) return;
4022
+ } catch {}
4023
+ throw Error("dsh 未能保存模型凭据,请检查其凭据存储及同名只读环境变量。");
4024
+ }
4025
+ //#endregion
4026
+ //#region packages/plugins/dsh/params.ts
4027
+ var jr = [
4028
+ {
4029
+ id: "server",
4030
+ label: "服务",
4031
+ order: 1
4032
+ },
4033
+ {
4034
+ id: "runtime",
4035
+ label: "运行环境",
4036
+ order: 2
4037
+ },
4038
+ {
4039
+ id: "advanced",
4040
+ label: "高级参数",
4041
+ order: 3,
4042
+ collapsed: !0
4043
+ }
4044
+ ];
4045
+ function Mr(e) {
4046
+ return /^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(e) && ![
4047
+ "node_modules",
4048
+ "desktop",
4049
+ "headless",
4050
+ "sdk",
4051
+ "sdk-minimal",
4052
+ "acp"
4053
+ ].includes(e);
4054
+ }
4055
+ var Nr = [
4056
+ {
4057
+ id: "profile",
4058
+ label: "Web 配置名称",
4059
+ type: "string",
4060
+ default: "web",
4061
+ group: "advanced",
4062
+ required: !0,
4063
+ cli: "--profile",
4064
+ description: "默认 web。自定义配置必须已存在且包含 Web 应用;模型和 API 密钥在 dsh 的 Settings → Models 中配置。",
4065
+ validate: (e) => Mr(String(e)) ? null : "请填写 web 或自定义 Web 配置名称"
4066
+ },
4067
+ {
4068
+ id: "patches",
4069
+ label: "配置补丁",
4070
+ type: "text",
4071
+ default: "",
4072
+ group: "advanced",
4073
+ cli: {
4074
+ arg: "--patch",
4075
+ format: "repeat",
4076
+ split: "lines",
4077
+ resolvePath: !0,
4078
+ when: "set"
4079
+ },
4080
+ description: "每行一个 Cordis 配置补丁文件,按顺序合并;相对路径以应用目录为基准。"
4081
+ },
4082
+ {
4083
+ id: "dataDir",
4084
+ label: "配置与会话目录",
4085
+ type: "path",
4086
+ pathKind: "directory",
4087
+ default: ".kano/dsh",
4088
+ group: "runtime",
4089
+ required: !0,
4090
+ env: {
4091
+ name: "DSH_HOME",
4092
+ format: "path"
4093
+ },
4094
+ description: "保存 dsh 配置、会话和凭据。工作目录在 dsh WebUI 中选择。"
4095
+ },
4096
+ {
4097
+ id: "host",
4098
+ label: "监听地址",
4099
+ type: "string",
4100
+ default: "127.0.0.1",
4101
+ required: !0,
4102
+ group: "server",
4103
+ cli: "--host",
4104
+ description: "默认仅本机访问。保留 dsh 自身对监听地址和可信主机的限制。",
4105
+ validate: (e) => String(e).trim() === "0.0.0.0" ? "dsh 不支持监听 0.0.0.0,请指定具体地址" : null
4106
+ },
4107
+ {
4108
+ id: "port",
4109
+ label: "端口",
4110
+ type: "port",
4111
+ default: 3080,
4112
+ min: 1,
4113
+ max: 65535,
4114
+ integer: !0,
4115
+ group: "server",
4116
+ cli: "--port"
4117
+ },
4118
+ {
4119
+ id: "noOpen",
4120
+ label: "不打开外部浏览器",
4121
+ type: "boolean",
4122
+ default: !0,
4123
+ group: "server",
4124
+ cli: "--no-open",
4125
+ description: "启动后可直接使用 Kano 的 WebUI 页面。"
4126
+ },
4127
+ {
4128
+ id: "trustedHosts",
4129
+ label: "额外可信主机",
4130
+ type: "text",
4131
+ default: "",
4132
+ group: "advanced",
4133
+ cli: {
4134
+ arg: "--trusted-host",
4135
+ format: "repeat",
4136
+ split: "lines",
4137
+ when: "set"
4138
+ },
4139
+ description: "可选,每行一个 host:port,用于访问 dsh 的明确主机地址。默认使用 dsh 的本机信任规则。"
4140
+ },
4141
+ {
4142
+ id: "nodeOptions",
4143
+ label: "Node 选项",
4144
+ type: "string",
4145
+ default: "",
4146
+ group: "advanced",
4147
+ env: "NODE_OPTIONS",
4148
+ placeholder: "--max-old-space-size=4096",
4149
+ description: "通过 NODE_OPTIONS 传递,例如限制 Node 堆内存。"
4150
+ },
4151
+ {
4152
+ id: "extraArgs",
4153
+ label: "额外 Web 参数",
4154
+ type: "text",
4155
+ default: "",
4156
+ group: "advanced",
4157
+ description: "传递给 dsh Web 应用的额外参数;不能覆盖上面已经配置的选项。"
4158
+ }
4159
+ ];
4160
+ //#endregion
4161
+ //#region packages/plugins/dsh/local-models.ts
4162
+ function Pr(e) {
4163
+ if (e.contents ||= e.createNode([]), !P(e.contents)) throw Error("dsh 配置补丁需要使用 YAML 列表");
4164
+ let t = e.contents.items, n = t.findLastIndex((e) => j(e) && e.get("id") === "llm-pi-ai");
4165
+ return n < 0 && (n = t.length, e.contents.add(e.createNode({ id: "llm-pi-ai" }))), [n, "config"];
4166
+ }
4167
+ function Fr(e, t, n, r, i, a = !1, o = !1) {
4168
+ let s = Er(e);
4169
+ if (s.errors.length || !o && s.contents && !j(s.contents)) throw Error("dsh 设置不是有效的 YAML 映射");
4170
+ let c = [
4171
+ ...o ? Pr(s) : ["llm-pi-ai"],
4172
+ "providers",
4173
+ Dr(t)
4174
+ ];
4175
+ for (let e = 1; e <= c.length; e++) {
4176
+ let t = s.getIn(c.slice(0, e), !0);
4177
+ if (t !== void 0 && !j(t)) throw Error("dsh 提供方配置格式无效");
4178
+ }
4179
+ kr(s, c, t, a);
4180
+ for (let [e, t] of Object.entries({
4181
+ displayName: i,
4182
+ api: "openai-completions",
4183
+ baseURL: n,
4184
+ models: r.map((e) => ({ id: e }))
4185
+ })) s.setIn([...c, e], t);
4186
+ return s.toString();
4187
+ }
4188
+ async function Ir({ fs: e, http: t }, n, r) {
4189
+ let i = await t.get(r.baseURL + "/models", {
4190
+ headers: r.apiKey ? { Authorization: "Bearer " + r.apiKey } : void 0,
4191
+ no_redirect: !0,
4192
+ timeout: 10
4193
+ });
4194
+ if (i.status_code !== 200) throw Error("模型服务返回 HTTP " + i.status_code);
4195
+ let a;
4196
+ try {
4197
+ a = JSON.parse(i.body)?.data;
4198
+ } catch {
4199
+ throw Error("模型服务未返回有效的模型列表");
4200
+ }
4201
+ let o = Array.isArray(a) ? a.map((e) => e?.id).filter((e) => typeof e == "string" && !!e) : [];
4202
+ if (!o.length) throw Error("该端点未返回可用模型");
4203
+ let s = C(n.path, String(n.params.dataDir || ".kano/dsh")), c = await e.exists(C(n.path, "node_modules/@deepseek-ai/dsh-config-editor/package.json")), l = String(n.params.profile || "web");
4204
+ if (c && !Mr(l)) throw Error("请检查 dsh 的 Web 配置名称");
4205
+ let u = c ? C(s, `profiles/${l}`) : s, d = C(u, c ? "cordis.patch.yml" : "settings.yaml"), f = await e.exists(d) ? await e.readTextFile(d) : void 0, p = (e) => Fr(e, r.id, r.baseURL, o, r.name, !!r.apiKey, c), m = p(f?.content || "");
4206
+ if (r.apiKey && await Ar(t, n, r.id, r.apiKey), !f) {
4207
+ await e.mkdir(u);
4208
+ try {
4209
+ await e.createFile(d);
4210
+ } catch (t) {
4211
+ if (!await e.exists(d)) throw t;
4212
+ }
4213
+ f = await e.readTextFile(d), m = p(f.content);
4214
+ }
4215
+ await e.saveTextFile(d, m, f.version);
4216
+ }
4217
+ //#endregion
4218
+ //#region packages/plugins/dsh/LocalModelsPage.vue?vue&type=script&setup=true&lang.ts
4219
+ var Lr = {
4220
+ key: 0,
4221
+ role: "alert",
4222
+ class: "mb-3 break-words text-sm text-danger"
4223
+ }, Rr = { class: "kano-field-label break-words" }, zr = { class: "break-all font-mono text-xs text-text-secondary" }, Br = {
4224
+ key: 0,
4225
+ class: "kano-field-hint"
4226
+ }, Vr = /* @__PURE__ */ s({
4227
+ __name: "LocalModelsPage",
4228
+ props: {
4229
+ app: {},
4230
+ api: {}
4231
+ },
4232
+ setup(s) {
4233
+ let S = s, C = d([]);
4234
+ m(() => S.api, (e, t, n) => {
4235
+ n(e.services.watch(te, (e) => {
4236
+ C.value = e;
4237
+ }).dispose);
4238
+ }, { immediate: !0 });
4239
+ let ee = t(() => C.value.flatMap((e) => e.list().filter((e) => e.status === "running").map((t) => ({
4240
+ ...t,
4241
+ key: e.providerId + ":" + t.id,
4242
+ provider: e
4243
+ })))), w = l(""), ne = l(""), re = t(() => S.api.apps.list("llamacpp").filter((e) => e.status === "stopped" || e.status === "error")), ie = l(""), T = t(() => re.value.find((e) => e.id === ie.value) ?? re.value[0]), E = l(!1);
4244
+ async function ae() {
4245
+ let e = T.value;
4246
+ if (!e || E.value) return;
4247
+ let { api: t } = S;
4248
+ E.value = !0;
4249
+ try {
4250
+ await t.apps.openTab(e.id, "launch-control"), await t.apps.start(e.id);
4251
+ } catch (n) {
4252
+ t.ui.toast.exception("启动 " + e.name + " 失败", n);
4253
+ } finally {
4254
+ E.value = !1;
4255
+ }
4256
+ }
4257
+ async function oe(e) {
4258
+ if (w.value) return;
4259
+ let { api: t, app: n } = S;
4260
+ w.value = e.key, ne.value = "";
4261
+ try {
4262
+ let r = e.requiresApiKey ? await e.provider.getApiKey?.(e.id) : void 0, i = e.provider.list().find((t) => t.id === e.id);
4263
+ if (i?.status !== "running" || i.baseURL !== e.baseURL || i.requiresApiKey !== e.requiresApiKey) throw Error("端点配置已变化,请重新选择。");
4264
+ if (i.requiresApiKey && !r) throw Error("端点需要凭据,请在提供方配置 API 密钥。");
4265
+ await Ir(t, n, {
4266
+ ...i,
4267
+ id: e.key,
4268
+ apiKey: r ?? ""
4269
+ }), t.ui.toast.success("已填入 dsh 模型设置");
4270
+ } catch (e) {
4271
+ ne.value = e instanceof Error ? e.message : String(e);
4272
+ } finally {
4273
+ w.value = "";
4274
+ }
4275
+ }
4276
+ return (t, s) => (c(), n(p(b), {
4277
+ title: "模型端点",
4278
+ "max-width": "prose"
4279
+ }, {
4280
+ default: h(() => [ne.value ? (c(), i("p", Lr, f(ne.value), 1)) : r("", !0), ee.value.length ? (c(), n(p(_), {
4281
+ key: 2,
4282
+ "aria-label": "运行中的推理端点"
4283
+ }, {
4284
+ default: h(() => [(c(!0), i(e, null, u(ee.value, (e) => (c(), n(p(v), {
4285
+ key: e.key,
4286
+ "always-show-actions": ""
4287
+ }, {
4288
+ actions: h(() => [o(p(g), {
4289
+ size: "small",
4290
+ class: "shrink-0",
4291
+ label: e.requiresApiKey ? "保存凭据并填入" : "填入 dsh",
4292
+ severity: "secondary",
4293
+ loading: w.value === e.key,
4294
+ disabled: !!w.value,
4295
+ onClick: (t) => oe(e)
4296
+ }, null, 8, [
4297
+ "label",
4298
+ "loading",
4299
+ "disabled",
4300
+ "onClick"
4301
+ ])]),
4302
+ default: h(() => [
4303
+ a("h2", Rr, f(e.name), 1),
4304
+ a("p", zr, f(e.baseURL), 1),
4305
+ e.requiresApiKey ? (c(), i("p", Br, " API 密钥将保存到当前执行机器的 dsh 凭据库。 ")) : r("", !0)
4306
+ ]),
4307
+ _: 2
4308
+ }, 1024))), 128))]),
4309
+ _: 1
4310
+ })) : (c(), n(p(y), {
4311
+ key: 1,
4312
+ icon: "i-lucide-network",
4313
+ title: "当前执行端没有运行中的模型端点"
4314
+ }, {
4315
+ default: h(() => [T.value ? (c(), i(e, { key: 0 }, [re.value.length > 1 ? (c(), n(p(x), {
4316
+ key: 0,
4317
+ "model-value": T.value.id,
4318
+ options: re.value,
4319
+ "option-label": "name",
4320
+ "option-value": "id",
4321
+ "aria-label": "要启动的 llama.cpp 实例",
4322
+ class: "kano-select-adaptive",
4323
+ disabled: E.value,
4324
+ "onUpdate:modelValue": s[0] ||= (e) => ie.value = String(e)
4325
+ }, null, 8, [
4326
+ "model-value",
4327
+ "options",
4328
+ "disabled"
4329
+ ])) : r("", !0), o(p(g), {
4330
+ label: "前往并启动 llama.cpp",
4331
+ icon: "i-lucide-play",
4332
+ loading: E.value,
4333
+ disabled: E.value,
4334
+ onClick: ae
4335
+ }, null, 8, ["loading", "disabled"])], 64)) : r("", !0)]),
4336
+ _: 1
4337
+ }))]),
4338
+ _: 1
4339
+ }));
4340
+ }
4341
+ }), Hr = "node_modules/@deepseek-ai/dsh/package.json";
4342
+ function Ur(e) {
4343
+ return S({
4344
+ host: e.host,
4345
+ port: e.port,
4346
+ defaultPort: 3080
4347
+ });
4348
+ }
4349
+ function Wr(e, t) {
4350
+ let n = /^dsh web:\s+(https?:\/\/\S+)/.exec(e.trim());
4351
+ if (!n) return null;
4352
+ try {
4353
+ let e = new URL(n[1]), r = new URL(Ur(t)), i = new URL(Ur({ port: t.port }));
4354
+ return ![r.origin, i.origin].includes(e.origin) || e.pathname !== "/" || !e.searchParams.get("token") ? null : (r.search = e.search, r.href);
4355
+ } catch {
4356
+ return null;
4357
+ }
4358
+ }
4359
+ //#endregion
4360
+ //#region packages/plugins/dsh/index.ts
4361
+ var Gr = ne({ app: {
4362
+ tabs: [{
4363
+ id: "dsh-local-models",
4364
+ label: "模型端点",
4365
+ icon: "i-lucide-network",
4366
+ order: 15,
4367
+ component: Vr
4368
+ }],
4369
+ icon: "i-lucide-terminal",
4370
+ color: "#64748b",
4371
+ identifiers: [{
4372
+ type: "file",
4373
+ pattern: Hr,
4374
+ weight: 50
4375
+ }],
4376
+ launchProvider: {
4377
+ entry: {
4378
+ type: "node",
4379
+ script: "node_modules/@deepseek-ai/dsh/lib/bin.js"
4380
+ },
4381
+ dependencies: !1,
4382
+ groups: jr,
4383
+ params: Nr,
4384
+ extraArgs: {
4385
+ param: "extraArgs",
4386
+ target: "argv"
4387
+ },
4388
+ ownedArgs: [
4389
+ "--help",
4390
+ "-h",
4391
+ "--version",
4392
+ "-V",
4393
+ "--dump-config",
4394
+ "--dump-default-config",
4395
+ "--from-default-profile",
4396
+ "--open"
4397
+ ],
4398
+ getWebViewUrl: Ur,
4399
+ strategy: {
4400
+ requirements: {},
4401
+ async preflight(e, t) {
4402
+ let n = await t.launch.checkPaths([...String(e.params.patches ?? "").split(/\r?\n/).map((e) => e.trim()).filter(Boolean).map((t, n) => ({
4403
+ id: `dsh-patch-${n}`,
4404
+ paths: [C(e.app.path, t)],
4405
+ successMessage: `配置补丁已找到:${t}`,
4406
+ failureMessage: `配置补丁不存在:${t}`,
4407
+ actions: [{
4408
+ id: w.OpenLaunchSettings,
4409
+ label: "启动参数"
4410
+ }]
4411
+ }))]), r = e.runtime.node?.version;
4412
+ if (r) {
4413
+ let i = await t.fs.readTextFile(C(e.app.path, Hr)), a = JSON.parse(i.content).engines?.node ?? "^22.19.0 || >=24.0.0", o = fe(r, a);
4414
+ n.push({
4415
+ id: "dsh-node-version",
4416
+ stage: "runtime",
4417
+ passed: o,
4418
+ severity: o ? "info" : "error",
4419
+ message: o ? `Node ${r}` : `当前 dsh 需要 Node ${a},已选择 ${r}`,
4420
+ actions: o ? void 0 : [{
4421
+ id: w.OpenLaunchSettings,
4422
+ label: "启动参数"
4423
+ }]
4424
+ });
4425
+ }
4426
+ let i = new URL(Ur(e.params));
4427
+ return n.push(...await t.launch.checkHttpPort(Number(i.port), "dsh-port", i.hostname.replace(/^\[|\]$/g, ""))), n;
4428
+ }
4429
+ }
4430
+ },
4431
+ versionProvider: {
4432
+ kind: "npm",
4433
+ packageName: "@deepseek-ai/dsh"
4434
+ },
4435
+ webview: {
4436
+ urlTemplate: "http://127.0.0.1:{port}",
4437
+ defaultPort: 3080,
4438
+ portParamId: "port",
4439
+ autoOpen: !1,
4440
+ getReadyUrlFromLog: Wr
4441
+ },
4442
+ actions: [{
4443
+ id: "webui",
4444
+ label: "WebUI",
4445
+ icon: "i-lucide-globe",
4446
+ kind: "tab",
4447
+ target: "webview",
4448
+ order: 1
4449
+ }, {
4450
+ id: "settings",
4451
+ label: "启动参数",
4452
+ icon: "i-lucide-settings",
4453
+ kind: "tab",
4454
+ target: "settings",
4455
+ order: 2
4456
+ }]
4457
+ } });
4458
+ //#endregion
4459
+ export { Gr as default };