@restura/core 0.1.0-alpha.6 → 0.1.0-alpha.7

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.
@@ -0,0 +1,4230 @@
1
+ import {
2
+ __publicField,
3
+ __spreadProps,
4
+ __spreadValues
5
+ } from "./chunk-TL4KRYOF.mjs";
6
+
7
+ // ../../node_modules/.pnpm/prettier@3.3.3/node_modules/prettier/plugins/yaml.mjs
8
+ var Ai = Object.create;
9
+ var nn = Object.defineProperty;
10
+ var Ti = Object.getOwnPropertyDescriptor;
11
+ var Ci = Object.getOwnPropertyNames;
12
+ var Mi = Object.getPrototypeOf;
13
+ var ki = Object.prototype.hasOwnProperty;
14
+ var ee = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);
15
+ var nr = (t, e) => {
16
+ for (var n in e) nn(t, n, { get: e[n], enumerable: true });
17
+ };
18
+ var vi = (t, e, n, r) => {
19
+ if (e && typeof e == "object" || typeof e == "function") for (let s of Ci(e)) !ki.call(t, s) && s !== n && nn(t, s, { get: () => e[s], enumerable: !(r = Ti(e, s)) || r.enumerable });
20
+ return t;
21
+ };
22
+ var rr = (t, e, n) => (n = t != null ? Ai(Mi(t)) : {}, vi(e || !t || !t.__esModule ? nn(n, "default", { value: t, enumerable: true }) : n, t));
23
+ var le = ee((U) => {
24
+ "use strict";
25
+ var re = { ANCHOR: "&", COMMENT: "#", TAG: "!", DIRECTIVES_END: "-", DOCUMENT_END: "." }, lt = { ALIAS: "ALIAS", BLANK_LINE: "BLANK_LINE", BLOCK_FOLDED: "BLOCK_FOLDED", BLOCK_LITERAL: "BLOCK_LITERAL", COMMENT: "COMMENT", DIRECTIVE: "DIRECTIVE", DOCUMENT: "DOCUMENT", FLOW_MAP: "FLOW_MAP", FLOW_SEQ: "FLOW_SEQ", MAP: "MAP", MAP_KEY: "MAP_KEY", MAP_VALUE: "MAP_VALUE", PLAIN: "PLAIN", QUOTE_DOUBLE: "QUOTE_DOUBLE", QUOTE_SINGLE: "QUOTE_SINGLE", SEQ: "SEQ", SEQ_ITEM: "SEQ_ITEM" }, Oo = "tag:yaml.org,2002:", Lo = { MAP: "tag:yaml.org,2002:map", SEQ: "tag:yaml.org,2002:seq", STR: "tag:yaml.org,2002:str" };
26
+ function Is(t) {
27
+ let e = [0], n = t.indexOf(`
28
+ `);
29
+ for (; n !== -1; ) n += 1, e.push(n), n = t.indexOf(`
30
+ `, n);
31
+ return e;
32
+ }
33
+ function Ps(t) {
34
+ let e, n;
35
+ return typeof t == "string" ? (e = Is(t), n = t) : (Array.isArray(t) && (t = t[0]), t && t.context && (t.lineStarts || (t.lineStarts = Is(t.context.src)), e = t.lineStarts, n = t.context.src)), { lineStarts: e, src: n };
36
+ }
37
+ function An(t, e) {
38
+ if (typeof t != "number" || t < 0) return null;
39
+ let { lineStarts: n, src: r } = Ps(e);
40
+ if (!n || !r || t > r.length) return null;
41
+ for (let i = 0; i < n.length; ++i) {
42
+ let o = n[i];
43
+ if (t < o) return { line: i, col: t - n[i - 1] + 1 };
44
+ if (t === o) return { line: i + 1, col: 1 };
45
+ }
46
+ let s = n.length;
47
+ return { line: s, col: t - n[s - 1] + 1 };
48
+ }
49
+ function Ao(t, e) {
50
+ let { lineStarts: n, src: r } = Ps(e);
51
+ if (!n || !(t >= 1) || t > n.length) return null;
52
+ let s = n[t - 1], i = n[t];
53
+ for (; i && i > s && r[i - 1] === `
54
+ `; ) --i;
55
+ return r.slice(s, i);
56
+ }
57
+ function To({ start: t, end: e }, n, r = 80) {
58
+ let s = Ao(t.line, n);
59
+ if (!s) return null;
60
+ let { col: i } = t;
61
+ if (s.length > r) if (i <= r - 10) s = s.substr(0, r - 1) + "\u2026";
62
+ else {
63
+ let f = Math.round(r / 2);
64
+ s.length > i + f && (s = s.substr(0, i + f - 1) + "\u2026"), i -= s.length - r, s = "\u2026" + s.substr(1 - r);
65
+ }
66
+ let o = 1, a = "";
67
+ e && (e.line === t.line && i + (e.col - t.col) <= r + 1 ? o = e.col - t.col : (o = Math.min(s.length + 1, r) - i, a = "\u2026"));
68
+ let c = i > 1 ? " ".repeat(i - 1) : "", l = "^".repeat(o);
69
+ return `${s}
70
+ ${c}${l}${a}`;
71
+ }
72
+ var Ye = class t {
73
+ static copy(e) {
74
+ return new t(e.start, e.end);
75
+ }
76
+ constructor(e, n) {
77
+ this.start = e, this.end = n || e;
78
+ }
79
+ isEmpty() {
80
+ return typeof this.start != "number" || !this.end || this.end <= this.start;
81
+ }
82
+ setOrigRange(e, n) {
83
+ let { start: r, end: s } = this;
84
+ if (e.length === 0 || s <= e[0]) return this.origStart = r, this.origEnd = s, n;
85
+ let i = n;
86
+ for (; i < e.length && !(e[i] > r); ) ++i;
87
+ this.origStart = r + i;
88
+ let o = i;
89
+ for (; i < e.length && !(e[i] >= s); ) ++i;
90
+ return this.origEnd = s + i, o;
91
+ }
92
+ }, se = class t {
93
+ static addStringTerminator(e, n, r) {
94
+ if (r[r.length - 1] === `
95
+ `) return r;
96
+ let s = t.endOfWhiteSpace(e, n);
97
+ return s >= e.length || e[s] === `
98
+ ` ? r + `
99
+ ` : r;
100
+ }
101
+ static atDocumentBoundary(e, n, r) {
102
+ let s = e[n];
103
+ if (!s) return true;
104
+ let i = e[n - 1];
105
+ if (i && i !== `
106
+ `) return false;
107
+ if (r) {
108
+ if (s !== r) return false;
109
+ } else if (s !== re.DIRECTIVES_END && s !== re.DOCUMENT_END) return false;
110
+ let o = e[n + 1], a = e[n + 2];
111
+ if (o !== s || a !== s) return false;
112
+ let c = e[n + 3];
113
+ return !c || c === `
114
+ ` || c === " " || c === " ";
115
+ }
116
+ static endOfIdentifier(e, n) {
117
+ let r = e[n], s = r === "<", i = s ? [`
118
+ `, " ", " ", ">"] : [`
119
+ `, " ", " ", "[", "]", "{", "}", ","];
120
+ for (; r && i.indexOf(r) === -1; ) r = e[n += 1];
121
+ return s && r === ">" && (n += 1), n;
122
+ }
123
+ static endOfIndent(e, n) {
124
+ let r = e[n];
125
+ for (; r === " "; ) r = e[n += 1];
126
+ return n;
127
+ }
128
+ static endOfLine(e, n) {
129
+ let r = e[n];
130
+ for (; r && r !== `
131
+ `; ) r = e[n += 1];
132
+ return n;
133
+ }
134
+ static endOfWhiteSpace(e, n) {
135
+ let r = e[n];
136
+ for (; r === " " || r === " "; ) r = e[n += 1];
137
+ return n;
138
+ }
139
+ static startOfLine(e, n) {
140
+ let r = e[n - 1];
141
+ if (r === `
142
+ `) return n;
143
+ for (; r && r !== `
144
+ `; ) r = e[n -= 1];
145
+ return n + 1;
146
+ }
147
+ static endOfBlockIndent(e, n, r) {
148
+ let s = t.endOfIndent(e, r);
149
+ if (s > r + n) return s;
150
+ {
151
+ let i = t.endOfWhiteSpace(e, s), o = e[i];
152
+ if (!o || o === `
153
+ `) return i;
154
+ }
155
+ return null;
156
+ }
157
+ static atBlank(e, n, r) {
158
+ let s = e[n];
159
+ return s === `
160
+ ` || s === " " || s === " " || r && !s;
161
+ }
162
+ static nextNodeIsIndented(e, n, r) {
163
+ return !e || n < 0 ? false : n > 0 ? true : r && e === "-";
164
+ }
165
+ static normalizeOffset(e, n) {
166
+ let r = e[n];
167
+ return r ? r !== `
168
+ ` && e[n - 1] === `
169
+ ` ? n - 1 : t.endOfWhiteSpace(e, n) : n;
170
+ }
171
+ static foldNewline(e, n, r) {
172
+ let s = 0, i = false, o = "", a = e[n + 1];
173
+ for (; a === " " || a === " " || a === `
174
+ `; ) {
175
+ switch (a) {
176
+ case `
177
+ `:
178
+ s = 0, n += 1, o += `
179
+ `;
180
+ break;
181
+ case " ":
182
+ s <= r && (i = true), n = t.endOfWhiteSpace(e, n + 2) - 1;
183
+ break;
184
+ case " ":
185
+ s += 1, n += 1;
186
+ break;
187
+ }
188
+ a = e[n + 1];
189
+ }
190
+ return o || (o = " "), a && s <= r && (i = true), { fold: o, offset: n, error: i };
191
+ }
192
+ constructor(e, n, r) {
193
+ Object.defineProperty(this, "context", { value: r || null, writable: true }), this.error = null, this.range = null, this.valueRange = null, this.props = n || [], this.type = e, this.value = null;
194
+ }
195
+ getPropValue(e, n, r) {
196
+ if (!this.context) return null;
197
+ let { src: s } = this.context, i = this.props[e];
198
+ return i && s[i.start] === n ? s.slice(i.start + (r ? 1 : 0), i.end) : null;
199
+ }
200
+ get anchor() {
201
+ for (let e = 0; e < this.props.length; ++e) {
202
+ let n = this.getPropValue(e, re.ANCHOR, true);
203
+ if (n != null) return n;
204
+ }
205
+ return null;
206
+ }
207
+ get comment() {
208
+ let e = [];
209
+ for (let n = 0; n < this.props.length; ++n) {
210
+ let r = this.getPropValue(n, re.COMMENT, true);
211
+ r != null && e.push(r);
212
+ }
213
+ return e.length > 0 ? e.join(`
214
+ `) : null;
215
+ }
216
+ commentHasRequiredWhitespace(e) {
217
+ let { src: n } = this.context;
218
+ if (this.header && e === this.header.end || !this.valueRange) return false;
219
+ let { end: r } = this.valueRange;
220
+ return e !== r || t.atBlank(n, r - 1);
221
+ }
222
+ get hasComment() {
223
+ if (this.context) {
224
+ let { src: e } = this.context;
225
+ for (let n = 0; n < this.props.length; ++n) if (e[this.props[n].start] === re.COMMENT) return true;
226
+ }
227
+ return false;
228
+ }
229
+ get hasProps() {
230
+ if (this.context) {
231
+ let { src: e } = this.context;
232
+ for (let n = 0; n < this.props.length; ++n) if (e[this.props[n].start] !== re.COMMENT) return true;
233
+ }
234
+ return false;
235
+ }
236
+ get includesTrailingLines() {
237
+ return false;
238
+ }
239
+ get jsonLike() {
240
+ return [lt.FLOW_MAP, lt.FLOW_SEQ, lt.QUOTE_DOUBLE, lt.QUOTE_SINGLE].indexOf(this.type) !== -1;
241
+ }
242
+ get rangeAsLinePos() {
243
+ if (!this.range || !this.context) return;
244
+ let e = An(this.range.start, this.context.root);
245
+ if (!e) return;
246
+ let n = An(this.range.end, this.context.root);
247
+ return { start: e, end: n };
248
+ }
249
+ get rawValue() {
250
+ if (!this.valueRange || !this.context) return null;
251
+ let { start: e, end: n } = this.valueRange;
252
+ return this.context.src.slice(e, n);
253
+ }
254
+ get tag() {
255
+ for (let e = 0; e < this.props.length; ++e) {
256
+ let n = this.getPropValue(e, re.TAG, false);
257
+ if (n != null) {
258
+ if (n[1] === "<") return { verbatim: n.slice(2, -1) };
259
+ {
260
+ let [r, s, i] = n.match(/^(.*!)([^!]*)$/);
261
+ return { handle: s, suffix: i };
262
+ }
263
+ }
264
+ }
265
+ return null;
266
+ }
267
+ get valueRangeContainsNewline() {
268
+ if (!this.valueRange || !this.context) return false;
269
+ let { start: e, end: n } = this.valueRange, { src: r } = this.context;
270
+ for (let s = e; s < n; ++s) if (r[s] === `
271
+ `) return true;
272
+ return false;
273
+ }
274
+ parseComment(e) {
275
+ let { src: n } = this.context;
276
+ if (n[e] === re.COMMENT) {
277
+ let r = t.endOfLine(n, e + 1), s = new Ye(e, r);
278
+ return this.props.push(s), r;
279
+ }
280
+ return e;
281
+ }
282
+ setOrigRanges(e, n) {
283
+ return this.range && (n = this.range.setOrigRange(e, n)), this.valueRange && this.valueRange.setOrigRange(e, n), this.props.forEach((r) => r.setOrigRange(e, n)), n;
284
+ }
285
+ toString() {
286
+ let { context: { src: e }, range: n, value: r } = this;
287
+ if (r != null) return r;
288
+ let s = e.slice(n.start, n.end);
289
+ return t.addStringTerminator(e, n.end, s);
290
+ }
291
+ }, de = class extends Error {
292
+ constructor(e, n, r) {
293
+ if (!r || !(n instanceof se)) throw new Error(`Invalid arguments for new ${e}`);
294
+ super(), this.name = e, this.message = r, this.source = n;
295
+ }
296
+ makePretty() {
297
+ if (!this.source) return;
298
+ this.nodeType = this.source.type;
299
+ let e = this.source.context && this.source.context.root;
300
+ if (typeof this.offset == "number") {
301
+ this.range = new Ye(this.offset, this.offset + 1);
302
+ let n = e && An(this.offset, e);
303
+ if (n) {
304
+ let r = { line: n.line, col: n.col + 1 };
305
+ this.linePos = { start: n, end: r };
306
+ }
307
+ delete this.offset;
308
+ } else this.range = this.source.range, this.linePos = this.source.rangeAsLinePos;
309
+ if (this.linePos) {
310
+ let { line: n, col: r } = this.linePos.start;
311
+ this.message += ` at line ${n}, column ${r}`;
312
+ let s = e && To(this.linePos, e);
313
+ s && (this.message += `:
314
+
315
+ ${s}
316
+ `);
317
+ }
318
+ delete this.source;
319
+ }
320
+ }, Tn = class extends de {
321
+ constructor(e, n) {
322
+ super("YAMLReferenceError", e, n);
323
+ }
324
+ }, ft = class extends de {
325
+ constructor(e, n) {
326
+ super("YAMLSemanticError", e, n);
327
+ }
328
+ }, Cn = class extends de {
329
+ constructor(e, n) {
330
+ super("YAMLSyntaxError", e, n);
331
+ }
332
+ }, Mn = class extends de {
333
+ constructor(e, n) {
334
+ super("YAMLWarning", e, n);
335
+ }
336
+ };
337
+ function Co(t, e, n) {
338
+ return e in t ? Object.defineProperty(t, e, { value: n, enumerable: true, configurable: true, writable: true }) : t[e] = n, t;
339
+ }
340
+ var kn = class t extends se {
341
+ static endOfLine(e, n, r) {
342
+ let s = e[n], i = n;
343
+ for (; s && s !== `
344
+ ` && !(r && (s === "[" || s === "]" || s === "{" || s === "}" || s === ",")); ) {
345
+ let o = e[i + 1];
346
+ if (s === ":" && (!o || o === `
347
+ ` || o === " " || o === " " || r && o === ",") || (s === " " || s === " ") && o === "#") break;
348
+ i += 1, s = o;
349
+ }
350
+ return i;
351
+ }
352
+ get strValue() {
353
+ if (!this.valueRange || !this.context) return null;
354
+ let { start: e, end: n } = this.valueRange, { src: r } = this.context, s = r[n - 1];
355
+ for (; e < n && (s === `
356
+ ` || s === " " || s === " "); ) s = r[--n - 1];
357
+ let i = "";
358
+ for (let a = e; a < n; ++a) {
359
+ let c = r[a];
360
+ if (c === `
361
+ `) {
362
+ let { fold: l, offset: f } = se.foldNewline(r, a, -1);
363
+ i += l, a = f;
364
+ } else if (c === " " || c === " ") {
365
+ let l = a, f = r[a + 1];
366
+ for (; a < n && (f === " " || f === " "); ) a += 1, f = r[a + 1];
367
+ f !== `
368
+ ` && (i += a > l ? r.slice(l, a + 1) : c);
369
+ } else i += c;
370
+ }
371
+ let o = r[e];
372
+ switch (o) {
373
+ case " ": {
374
+ let a = "Plain value cannot start with a tab character";
375
+ return { errors: [new ft(this, a)], str: i };
376
+ }
377
+ case "@":
378
+ case "`": {
379
+ let a = `Plain value cannot start with reserved character ${o}`;
380
+ return { errors: [new ft(this, a)], str: i };
381
+ }
382
+ default:
383
+ return i;
384
+ }
385
+ }
386
+ parseBlockValue(e) {
387
+ let { indent: n, inFlow: r, src: s } = this.context, i = e, o = e;
388
+ for (let a = s[i]; a === `
389
+ ` && !se.atDocumentBoundary(s, i + 1); a = s[i]) {
390
+ let c = se.endOfBlockIndent(s, n, i + 1);
391
+ if (c === null || s[c] === "#") break;
392
+ s[c] === `
393
+ ` ? i = c : (o = t.endOfLine(s, c, r), i = o);
394
+ }
395
+ return this.valueRange.isEmpty() && (this.valueRange.start = e), this.valueRange.end = o, o;
396
+ }
397
+ parse(e, n) {
398
+ this.context = e;
399
+ let { inFlow: r, src: s } = e, i = n, o = s[i];
400
+ return o && o !== "#" && o !== `
401
+ ` && (i = t.endOfLine(s, n, r)), this.valueRange = new Ye(n, i), i = se.endOfWhiteSpace(s, i), i = this.parseComment(i), (!this.hasComment || this.valueRange.isEmpty()) && (i = this.parseBlockValue(i)), i;
402
+ }
403
+ };
404
+ U.Char = re;
405
+ U.Node = se;
406
+ U.PlainValue = kn;
407
+ U.Range = Ye;
408
+ U.Type = lt;
409
+ U.YAMLError = de;
410
+ U.YAMLReferenceError = Tn;
411
+ U.YAMLSemanticError = ft;
412
+ U.YAMLSyntaxError = Cn;
413
+ U.YAMLWarning = Mn;
414
+ U._defineProperty = Co;
415
+ U.defaultTagPrefix = Oo;
416
+ U.defaultTags = Lo;
417
+ });
418
+ var xs = ee((_s) => {
419
+ "use strict";
420
+ var u = le(), Ee = class extends u.Node {
421
+ constructor() {
422
+ super(u.Type.BLANK_LINE);
423
+ }
424
+ get includesTrailingLines() {
425
+ return true;
426
+ }
427
+ parse(e, n) {
428
+ return this.context = e, this.range = new u.Range(n, n + 1), n + 1;
429
+ }
430
+ }, ut = class extends u.Node {
431
+ constructor(e, n) {
432
+ super(e, n), this.node = null;
433
+ }
434
+ get includesTrailingLines() {
435
+ return !!this.node && this.node.includesTrailingLines;
436
+ }
437
+ parse(e, n) {
438
+ this.context = e;
439
+ let { parseNode: r, src: s } = e, { atLineStart: i, lineStart: o } = e;
440
+ !i && this.type === u.Type.SEQ_ITEM && (this.error = new u.YAMLSemanticError(this, "Sequence items must not have preceding content on the same line"));
441
+ let a = i ? n - o : e.indent, c = u.Node.endOfWhiteSpace(s, n + 1), l = s[c], f = l === "#", m = [], d = null;
442
+ for (; l === `
443
+ ` || l === "#"; ) {
444
+ if (l === "#") {
445
+ let h = u.Node.endOfLine(s, c + 1);
446
+ m.push(new u.Range(c, h)), c = h;
447
+ } else {
448
+ i = true, o = c + 1;
449
+ let h = u.Node.endOfWhiteSpace(s, o);
450
+ s[h] === `
451
+ ` && m.length === 0 && (d = new Ee(), o = d.parse({ src: s }, o)), c = u.Node.endOfIndent(s, o);
452
+ }
453
+ l = s[c];
454
+ }
455
+ if (u.Node.nextNodeIsIndented(l, c - (o + a), this.type !== u.Type.SEQ_ITEM) ? this.node = r({ atLineStart: i, inCollection: false, indent: a, lineStart: o, parent: this }, c) : l && o > n + 1 && (c = o - 1), this.node) {
456
+ if (d) {
457
+ let h = e.parent.items || e.parent.contents;
458
+ h && h.push(d);
459
+ }
460
+ m.length && Array.prototype.push.apply(this.props, m), c = this.node.range.end;
461
+ } else if (f) {
462
+ let h = m[0];
463
+ this.props.push(h), c = h.end;
464
+ } else c = u.Node.endOfLine(s, n + 1);
465
+ let y = this.node ? this.node.valueRange.end : c;
466
+ return this.valueRange = new u.Range(n, y), c;
467
+ }
468
+ setOrigRanges(e, n) {
469
+ return n = super.setOrigRanges(e, n), this.node ? this.node.setOrigRanges(e, n) : n;
470
+ }
471
+ toString() {
472
+ let { context: { src: e }, node: n, range: r, value: s } = this;
473
+ if (s != null) return s;
474
+ let i = n ? e.slice(r.start, n.range.start) + String(n) : e.slice(r.start, r.end);
475
+ return u.Node.addStringTerminator(e, r.end, i);
476
+ }
477
+ }, ye = class extends u.Node {
478
+ constructor() {
479
+ super(u.Type.COMMENT);
480
+ }
481
+ parse(e, n) {
482
+ this.context = e;
483
+ let r = this.parseComment(n);
484
+ return this.range = new u.Range(n, r), r;
485
+ }
486
+ };
487
+ function vn(t) {
488
+ let e = t;
489
+ for (; e instanceof ut; ) e = e.node;
490
+ if (!(e instanceof $t)) return null;
491
+ let n = e.items.length, r = -1;
492
+ for (let o = n - 1; o >= 0; --o) {
493
+ let a = e.items[o];
494
+ if (a.type === u.Type.COMMENT) {
495
+ let { indent: c, lineStart: l } = a.context;
496
+ if (c > 0 && a.range.start >= l + c) break;
497
+ r = o;
498
+ } else if (a.type === u.Type.BLANK_LINE) r = o;
499
+ else break;
500
+ }
501
+ if (r === -1) return null;
502
+ let s = e.items.splice(r, n - r), i = s[0].range.start;
503
+ for (; e.range.end = i, e.valueRange && e.valueRange.end > i && (e.valueRange.end = i), e !== t; ) e = e.context.parent;
504
+ return s;
505
+ }
506
+ var $t = class t extends u.Node {
507
+ static nextContentHasIndent(e, n, r) {
508
+ let s = u.Node.endOfLine(e, n) + 1;
509
+ n = u.Node.endOfWhiteSpace(e, s);
510
+ let i = e[n];
511
+ return i ? n >= s + r ? true : i !== "#" && i !== `
512
+ ` ? false : t.nextContentHasIndent(e, n, r) : false;
513
+ }
514
+ constructor(e) {
515
+ super(e.type === u.Type.SEQ_ITEM ? u.Type.SEQ : u.Type.MAP);
516
+ for (let r = e.props.length - 1; r >= 0; --r) if (e.props[r].start < e.context.lineStart) {
517
+ this.props = e.props.slice(0, r + 1), e.props = e.props.slice(r + 1);
518
+ let s = e.props[0] || e.valueRange;
519
+ e.range.start = s.start;
520
+ break;
521
+ }
522
+ this.items = [e];
523
+ let n = vn(e);
524
+ n && Array.prototype.push.apply(this.items, n);
525
+ }
526
+ get includesTrailingLines() {
527
+ return this.items.length > 0;
528
+ }
529
+ parse(e, n) {
530
+ this.context = e;
531
+ let { parseNode: r, src: s } = e, i = u.Node.startOfLine(s, n), o = this.items[0];
532
+ o.context.parent = this, this.valueRange = u.Range.copy(o.valueRange);
533
+ let a = o.range.start - o.context.lineStart, c = n;
534
+ c = u.Node.normalizeOffset(s, c);
535
+ let l = s[c], f = u.Node.endOfWhiteSpace(s, i) === c, m = false;
536
+ for (; l; ) {
537
+ for (; l === `
538
+ ` || l === "#"; ) {
539
+ if (f && l === `
540
+ ` && !m) {
541
+ let h = new Ee();
542
+ if (c = h.parse({ src: s }, c), this.valueRange.end = c, c >= s.length) {
543
+ l = null;
544
+ break;
545
+ }
546
+ this.items.push(h), c -= 1;
547
+ } else if (l === "#") {
548
+ if (c < i + a && !t.nextContentHasIndent(s, c, a)) return c;
549
+ let h = new ye();
550
+ if (c = h.parse({ indent: a, lineStart: i, src: s }, c), this.items.push(h), this.valueRange.end = c, c >= s.length) {
551
+ l = null;
552
+ break;
553
+ }
554
+ }
555
+ if (i = c + 1, c = u.Node.endOfIndent(s, i), u.Node.atBlank(s, c)) {
556
+ let h = u.Node.endOfWhiteSpace(s, c), g = s[h];
557
+ (!g || g === `
558
+ ` || g === "#") && (c = h);
559
+ }
560
+ l = s[c], f = true;
561
+ }
562
+ if (!l) break;
563
+ if (c !== i + a && (f || l !== ":")) {
564
+ if (c < i + a) {
565
+ i > n && (c = i);
566
+ break;
567
+ } else if (!this.error) {
568
+ let h = "All collection items must start at the same column";
569
+ this.error = new u.YAMLSyntaxError(this, h);
570
+ }
571
+ }
572
+ if (o.type === u.Type.SEQ_ITEM) {
573
+ if (l !== "-") {
574
+ i > n && (c = i);
575
+ break;
576
+ }
577
+ } else if (l === "-" && !this.error) {
578
+ let h = s[c + 1];
579
+ if (!h || h === `
580
+ ` || h === " " || h === " ") {
581
+ let g = "A collection cannot be both a mapping and a sequence";
582
+ this.error = new u.YAMLSyntaxError(this, g);
583
+ }
584
+ }
585
+ let d = r({ atLineStart: f, inCollection: true, indent: a, lineStart: i, parent: this }, c);
586
+ if (!d) return c;
587
+ if (this.items.push(d), this.valueRange.end = d.valueRange.end, c = u.Node.normalizeOffset(s, d.range.end), l = s[c], f = false, m = d.includesTrailingLines, l) {
588
+ let h = c - 1, g = s[h];
589
+ for (; g === " " || g === " "; ) g = s[--h];
590
+ g === `
591
+ ` && (i = h + 1, f = true);
592
+ }
593
+ let y = vn(d);
594
+ y && Array.prototype.push.apply(this.items, y);
595
+ }
596
+ return c;
597
+ }
598
+ setOrigRanges(e, n) {
599
+ return n = super.setOrigRanges(e, n), this.items.forEach((r) => {
600
+ n = r.setOrigRanges(e, n);
601
+ }), n;
602
+ }
603
+ toString() {
604
+ let { context: { src: e }, items: n, range: r, value: s } = this;
605
+ if (s != null) return s;
606
+ let i = e.slice(r.start, n[0].range.start) + String(n[0]);
607
+ for (let o = 1; o < n.length; ++o) {
608
+ let a = n[o], { atLineStart: c, indent: l } = a.context;
609
+ if (c) for (let f = 0; f < l; ++f) i += " ";
610
+ i += String(a);
611
+ }
612
+ return u.Node.addStringTerminator(e, r.end, i);
613
+ }
614
+ }, In = class extends u.Node {
615
+ constructor() {
616
+ super(u.Type.DIRECTIVE), this.name = null;
617
+ }
618
+ get parameters() {
619
+ let e = this.rawValue;
620
+ return e ? e.trim().split(/[ \t]+/) : [];
621
+ }
622
+ parseName(e) {
623
+ let { src: n } = this.context, r = e, s = n[r];
624
+ for (; s && s !== `
625
+ ` && s !== " " && s !== " "; ) s = n[r += 1];
626
+ return this.name = n.slice(e, r), r;
627
+ }
628
+ parseParameters(e) {
629
+ let { src: n } = this.context, r = e, s = n[r];
630
+ for (; s && s !== `
631
+ ` && s !== "#"; ) s = n[r += 1];
632
+ return this.valueRange = new u.Range(e, r), r;
633
+ }
634
+ parse(e, n) {
635
+ this.context = e;
636
+ let r = this.parseName(n + 1);
637
+ return r = this.parseParameters(r), r = this.parseComment(r), this.range = new u.Range(n, r), r;
638
+ }
639
+ }, Pn = class t extends u.Node {
640
+ static startCommentOrEndBlankLine(e, n) {
641
+ let r = u.Node.endOfWhiteSpace(e, n), s = e[r];
642
+ return s === "#" || s === `
643
+ ` ? r : n;
644
+ }
645
+ constructor() {
646
+ super(u.Type.DOCUMENT), this.directives = null, this.contents = null, this.directivesEndMarker = null, this.documentEndMarker = null;
647
+ }
648
+ parseDirectives(e) {
649
+ let { src: n } = this.context;
650
+ this.directives = [];
651
+ let r = true, s = false, i = e;
652
+ for (; !u.Node.atDocumentBoundary(n, i, u.Char.DIRECTIVES_END); ) switch (i = t.startCommentOrEndBlankLine(n, i), n[i]) {
653
+ case `
654
+ `:
655
+ if (r) {
656
+ let o = new Ee();
657
+ i = o.parse({ src: n }, i), i < n.length && this.directives.push(o);
658
+ } else i += 1, r = true;
659
+ break;
660
+ case "#":
661
+ {
662
+ let o = new ye();
663
+ i = o.parse({ src: n }, i), this.directives.push(o), r = false;
664
+ }
665
+ break;
666
+ case "%":
667
+ {
668
+ let o = new In();
669
+ i = o.parse({ parent: this, src: n }, i), this.directives.push(o), s = true, r = false;
670
+ }
671
+ break;
672
+ default:
673
+ return s ? this.error = new u.YAMLSemanticError(this, "Missing directives-end indicator line") : this.directives.length > 0 && (this.contents = this.directives, this.directives = []), i;
674
+ }
675
+ return n[i] ? (this.directivesEndMarker = new u.Range(i, i + 3), i + 3) : (s ? this.error = new u.YAMLSemanticError(this, "Missing directives-end indicator line") : this.directives.length > 0 && (this.contents = this.directives, this.directives = []), i);
676
+ }
677
+ parseContents(e) {
678
+ let { parseNode: n, src: r } = this.context;
679
+ this.contents || (this.contents = []);
680
+ let s = e;
681
+ for (; r[s - 1] === "-"; ) s -= 1;
682
+ let i = u.Node.endOfWhiteSpace(r, e), o = s === e;
683
+ for (this.valueRange = new u.Range(i); !u.Node.atDocumentBoundary(r, i, u.Char.DOCUMENT_END); ) {
684
+ switch (r[i]) {
685
+ case `
686
+ `:
687
+ if (o) {
688
+ let a = new Ee();
689
+ i = a.parse({ src: r }, i), i < r.length && this.contents.push(a);
690
+ } else i += 1, o = true;
691
+ s = i;
692
+ break;
693
+ case "#":
694
+ {
695
+ let a = new ye();
696
+ i = a.parse({ src: r }, i), this.contents.push(a), o = false;
697
+ }
698
+ break;
699
+ default: {
700
+ let a = u.Node.endOfIndent(r, i), l = n({ atLineStart: o, indent: -1, inFlow: false, inCollection: false, lineStart: s, parent: this }, a);
701
+ if (!l) return this.valueRange.end = a;
702
+ this.contents.push(l), i = l.range.end, o = false;
703
+ let f = vn(l);
704
+ f && Array.prototype.push.apply(this.contents, f);
705
+ }
706
+ }
707
+ i = t.startCommentOrEndBlankLine(r, i);
708
+ }
709
+ if (this.valueRange.end = i, r[i] && (this.documentEndMarker = new u.Range(i, i + 3), i += 3, r[i])) {
710
+ if (i = u.Node.endOfWhiteSpace(r, i), r[i] === "#") {
711
+ let a = new ye();
712
+ i = a.parse({ src: r }, i), this.contents.push(a);
713
+ }
714
+ switch (r[i]) {
715
+ case `
716
+ `:
717
+ i += 1;
718
+ break;
719
+ case void 0:
720
+ break;
721
+ default:
722
+ this.error = new u.YAMLSyntaxError(this, "Document end marker line cannot have a non-comment suffix");
723
+ }
724
+ }
725
+ return i;
726
+ }
727
+ parse(e, n) {
728
+ e.root = this, this.context = e;
729
+ let { src: r } = e, s = r.charCodeAt(n) === 65279 ? n + 1 : n;
730
+ return s = this.parseDirectives(s), s = this.parseContents(s), s;
731
+ }
732
+ setOrigRanges(e, n) {
733
+ return n = super.setOrigRanges(e, n), this.directives.forEach((r) => {
734
+ n = r.setOrigRanges(e, n);
735
+ }), this.directivesEndMarker && (n = this.directivesEndMarker.setOrigRange(e, n)), this.contents.forEach((r) => {
736
+ n = r.setOrigRanges(e, n);
737
+ }), this.documentEndMarker && (n = this.documentEndMarker.setOrigRange(e, n)), n;
738
+ }
739
+ toString() {
740
+ let { contents: e, directives: n, value: r } = this;
741
+ if (r != null) return r;
742
+ let s = n.join("");
743
+ return e.length > 0 && ((n.length > 0 || e[0].type === u.Type.COMMENT) && (s += `---
744
+ `), s += e.join("")), s[s.length - 1] !== `
745
+ ` && (s += `
746
+ `), s;
747
+ }
748
+ }, _n = class extends u.Node {
749
+ parse(e, n) {
750
+ this.context = e;
751
+ let { src: r } = e, s = u.Node.endOfIdentifier(r, n + 1);
752
+ return this.valueRange = new u.Range(n + 1, s), s = u.Node.endOfWhiteSpace(r, s), s = this.parseComment(s), s;
753
+ }
754
+ }, fe = { CLIP: "CLIP", KEEP: "KEEP", STRIP: "STRIP" }, xn = class extends u.Node {
755
+ constructor(e, n) {
756
+ super(e, n), this.blockIndent = null, this.chomping = fe.CLIP, this.header = null;
757
+ }
758
+ get includesTrailingLines() {
759
+ return this.chomping === fe.KEEP;
760
+ }
761
+ get strValue() {
762
+ if (!this.valueRange || !this.context) return null;
763
+ let { start: e, end: n } = this.valueRange, { indent: r, src: s } = this.context;
764
+ if (this.valueRange.isEmpty()) return "";
765
+ let i = null, o = s[n - 1];
766
+ for (; o === `
767
+ ` || o === " " || o === " "; ) {
768
+ if (n -= 1, n <= e) {
769
+ if (this.chomping === fe.KEEP) break;
770
+ return "";
771
+ }
772
+ o === `
773
+ ` && (i = n), o = s[n - 1];
774
+ }
775
+ let a = n + 1;
776
+ i && (this.chomping === fe.KEEP ? (a = i, n = this.valueRange.end) : n = i);
777
+ let c = r + this.blockIndent, l = this.type === u.Type.BLOCK_FOLDED, f = true, m = "", d = "", y = false;
778
+ for (let h = e; h < n; ++h) {
779
+ for (let w = 0; w < c && s[h] === " "; ++w) h += 1;
780
+ let g = s[h];
781
+ if (g === `
782
+ `) d === `
783
+ ` ? m += `
784
+ ` : d = `
785
+ `;
786
+ else {
787
+ let w = u.Node.endOfLine(s, h), C = s.slice(h, w);
788
+ h = w, l && (g === " " || g === " ") && h < a ? (d === " " ? d = `
789
+ ` : !y && !f && d === `
790
+ ` && (d = `
791
+
792
+ `), m += d + C, d = w < n && s[w] || "", y = true) : (m += d + C, d = l && h < a ? " " : `
793
+ `, y = false), f && C !== "" && (f = false);
794
+ }
795
+ }
796
+ return this.chomping === fe.STRIP ? m : m + `
797
+ `;
798
+ }
799
+ parseBlockHeader(e) {
800
+ let { src: n } = this.context, r = e + 1, s = "";
801
+ for (; ; ) {
802
+ let i = n[r];
803
+ switch (i) {
804
+ case "-":
805
+ this.chomping = fe.STRIP;
806
+ break;
807
+ case "+":
808
+ this.chomping = fe.KEEP;
809
+ break;
810
+ case "0":
811
+ case "1":
812
+ case "2":
813
+ case "3":
814
+ case "4":
815
+ case "5":
816
+ case "6":
817
+ case "7":
818
+ case "8":
819
+ case "9":
820
+ s += i;
821
+ break;
822
+ default:
823
+ return this.blockIndent = Number(s) || null, this.header = new u.Range(e, r), r;
824
+ }
825
+ r += 1;
826
+ }
827
+ }
828
+ parseBlockValue(e) {
829
+ let { indent: n, src: r } = this.context, s = !!this.blockIndent, i = e, o = e, a = 1;
830
+ for (let c = r[i]; c === `
831
+ ` && (i += 1, !u.Node.atDocumentBoundary(r, i)); c = r[i]) {
832
+ let l = u.Node.endOfBlockIndent(r, n, i);
833
+ if (l === null) break;
834
+ let f = r[l], m = l - (i + n);
835
+ if (this.blockIndent) {
836
+ if (f && f !== `
837
+ ` && m < this.blockIndent) {
838
+ if (r[l] === "#") break;
839
+ if (!this.error) {
840
+ let y = `Block scalars must not be less indented than their ${s ? "explicit indentation indicator" : "first line"}`;
841
+ this.error = new u.YAMLSemanticError(this, y);
842
+ }
843
+ }
844
+ } else if (r[l] !== `
845
+ `) {
846
+ if (m < a) {
847
+ let d = "Block scalars with more-indented leading empty lines must use an explicit indentation indicator";
848
+ this.error = new u.YAMLSemanticError(this, d);
849
+ }
850
+ this.blockIndent = m;
851
+ } else m > a && (a = m);
852
+ r[l] === `
853
+ ` ? i = l : i = o = u.Node.endOfLine(r, l);
854
+ }
855
+ return this.chomping !== fe.KEEP && (i = r[o] ? o + 1 : o), this.valueRange = new u.Range(e + 1, i), i;
856
+ }
857
+ parse(e, n) {
858
+ this.context = e;
859
+ let { src: r } = e, s = this.parseBlockHeader(n);
860
+ return s = u.Node.endOfWhiteSpace(r, s), s = this.parseComment(s), s = this.parseBlockValue(s), s;
861
+ }
862
+ setOrigRanges(e, n) {
863
+ return n = super.setOrigRanges(e, n), this.header ? this.header.setOrigRange(e, n) : n;
864
+ }
865
+ }, Rn = class extends u.Node {
866
+ constructor(e, n) {
867
+ super(e, n), this.items = null;
868
+ }
869
+ prevNodeIsJsonLike(e = this.items.length) {
870
+ let n = this.items[e - 1];
871
+ return !!n && (n.jsonLike || n.type === u.Type.COMMENT && this.prevNodeIsJsonLike(e - 1));
872
+ }
873
+ parse(e, n) {
874
+ this.context = e;
875
+ let { parseNode: r, src: s } = e, { indent: i, lineStart: o } = e, a = s[n];
876
+ this.items = [{ char: a, offset: n }];
877
+ let c = u.Node.endOfWhiteSpace(s, n + 1);
878
+ for (a = s[c]; a && a !== "]" && a !== "}"; ) {
879
+ switch (a) {
880
+ case `
881
+ `:
882
+ {
883
+ o = c + 1;
884
+ let l = u.Node.endOfWhiteSpace(s, o);
885
+ if (s[l] === `
886
+ `) {
887
+ let f = new Ee();
888
+ o = f.parse({ src: s }, o), this.items.push(f);
889
+ }
890
+ if (c = u.Node.endOfIndent(s, o), c <= o + i && (a = s[c], c < o + i || a !== "]" && a !== "}")) {
891
+ let f = "Insufficient indentation in flow collection";
892
+ this.error = new u.YAMLSemanticError(this, f);
893
+ }
894
+ }
895
+ break;
896
+ case ",":
897
+ this.items.push({ char: a, offset: c }), c += 1;
898
+ break;
899
+ case "#":
900
+ {
901
+ let l = new ye();
902
+ c = l.parse({ src: s }, c), this.items.push(l);
903
+ }
904
+ break;
905
+ case "?":
906
+ case ":": {
907
+ let l = s[c + 1];
908
+ if (l === `
909
+ ` || l === " " || l === " " || l === "," || a === ":" && this.prevNodeIsJsonLike()) {
910
+ this.items.push({ char: a, offset: c }), c += 1;
911
+ break;
912
+ }
913
+ }
914
+ default: {
915
+ let l = r({ atLineStart: false, inCollection: false, inFlow: true, indent: -1, lineStart: o, parent: this }, c);
916
+ if (!l) return this.valueRange = new u.Range(n, c), c;
917
+ this.items.push(l), c = u.Node.normalizeOffset(s, l.range.end);
918
+ }
919
+ }
920
+ c = u.Node.endOfWhiteSpace(s, c), a = s[c];
921
+ }
922
+ return this.valueRange = new u.Range(n, c + 1), a && (this.items.push({ char: a, offset: c }), c = u.Node.endOfWhiteSpace(s, c + 1), c = this.parseComment(c)), c;
923
+ }
924
+ setOrigRanges(e, n) {
925
+ return n = super.setOrigRanges(e, n), this.items.forEach((r) => {
926
+ if (r instanceof u.Node) n = r.setOrigRanges(e, n);
927
+ else if (e.length === 0) r.origOffset = r.offset;
928
+ else {
929
+ let s = n;
930
+ for (; s < e.length && !(e[s] > r.offset); ) ++s;
931
+ r.origOffset = r.offset + s, n = s;
932
+ }
933
+ }), n;
934
+ }
935
+ toString() {
936
+ let { context: { src: e }, items: n, range: r, value: s } = this;
937
+ if (s != null) return s;
938
+ let i = n.filter((c) => c instanceof u.Node), o = "", a = r.start;
939
+ return i.forEach((c) => {
940
+ let l = e.slice(a, c.range.start);
941
+ a = c.range.end, o += l + String(c), o[o.length - 1] === `
942
+ ` && e[a - 1] !== `
943
+ ` && e[a] === `
944
+ ` && (a += 1);
945
+ }), o += e.slice(a, r.end), u.Node.addStringTerminator(e, r.end, o);
946
+ }
947
+ }, Dn = class t extends u.Node {
948
+ static endOfQuote(e, n) {
949
+ let r = e[n];
950
+ for (; r && r !== '"'; ) n += r === "\\" ? 2 : 1, r = e[n];
951
+ return n + 1;
952
+ }
953
+ get strValue() {
954
+ if (!this.valueRange || !this.context) return null;
955
+ let e = [], { start: n, end: r } = this.valueRange, { indent: s, src: i } = this.context;
956
+ i[r - 1] !== '"' && e.push(new u.YAMLSyntaxError(this, 'Missing closing "quote'));
957
+ let o = "";
958
+ for (let a = n + 1; a < r - 1; ++a) {
959
+ let c = i[a];
960
+ if (c === `
961
+ `) {
962
+ u.Node.atDocumentBoundary(i, a + 1) && e.push(new u.YAMLSemanticError(this, "Document boundary indicators are not allowed within string values"));
963
+ let { fold: l, offset: f, error: m } = u.Node.foldNewline(i, a, s);
964
+ o += l, a = f, m && e.push(new u.YAMLSemanticError(this, "Multi-line double-quoted string needs to be sufficiently indented"));
965
+ } else if (c === "\\") switch (a += 1, i[a]) {
966
+ case "0":
967
+ o += "\0";
968
+ break;
969
+ case "a":
970
+ o += "\x07";
971
+ break;
972
+ case "b":
973
+ o += "\b";
974
+ break;
975
+ case "e":
976
+ o += "\x1B";
977
+ break;
978
+ case "f":
979
+ o += "\f";
980
+ break;
981
+ case "n":
982
+ o += `
983
+ `;
984
+ break;
985
+ case "r":
986
+ o += "\r";
987
+ break;
988
+ case "t":
989
+ o += " ";
990
+ break;
991
+ case "v":
992
+ o += "\v";
993
+ break;
994
+ case "N":
995
+ o += "\x85";
996
+ break;
997
+ case "_":
998
+ o += "\xA0";
999
+ break;
1000
+ case "L":
1001
+ o += "\u2028";
1002
+ break;
1003
+ case "P":
1004
+ o += "\u2029";
1005
+ break;
1006
+ case " ":
1007
+ o += " ";
1008
+ break;
1009
+ case '"':
1010
+ o += '"';
1011
+ break;
1012
+ case "/":
1013
+ o += "/";
1014
+ break;
1015
+ case "\\":
1016
+ o += "\\";
1017
+ break;
1018
+ case " ":
1019
+ o += " ";
1020
+ break;
1021
+ case "x":
1022
+ o += this.parseCharCode(a + 1, 2, e), a += 2;
1023
+ break;
1024
+ case "u":
1025
+ o += this.parseCharCode(a + 1, 4, e), a += 4;
1026
+ break;
1027
+ case "U":
1028
+ o += this.parseCharCode(a + 1, 8, e), a += 8;
1029
+ break;
1030
+ case `
1031
+ `:
1032
+ for (; i[a + 1] === " " || i[a + 1] === " "; ) a += 1;
1033
+ break;
1034
+ default:
1035
+ e.push(new u.YAMLSyntaxError(this, `Invalid escape sequence ${i.substr(a - 1, 2)}`)), o += "\\" + i[a];
1036
+ }
1037
+ else if (c === " " || c === " ") {
1038
+ let l = a, f = i[a + 1];
1039
+ for (; f === " " || f === " "; ) a += 1, f = i[a + 1];
1040
+ f !== `
1041
+ ` && (o += a > l ? i.slice(l, a + 1) : c);
1042
+ } else o += c;
1043
+ }
1044
+ return e.length > 0 ? { errors: e, str: o } : o;
1045
+ }
1046
+ parseCharCode(e, n, r) {
1047
+ let { src: s } = this.context, i = s.substr(e, n), a = i.length === n && /^[0-9a-fA-F]+$/.test(i) ? parseInt(i, 16) : NaN;
1048
+ return isNaN(a) ? (r.push(new u.YAMLSyntaxError(this, `Invalid escape sequence ${s.substr(e - 2, n + 2)}`)), s.substr(e - 2, n + 2)) : String.fromCodePoint(a);
1049
+ }
1050
+ parse(e, n) {
1051
+ this.context = e;
1052
+ let { src: r } = e, s = t.endOfQuote(r, n + 1);
1053
+ return this.valueRange = new u.Range(n, s), s = u.Node.endOfWhiteSpace(r, s), s = this.parseComment(s), s;
1054
+ }
1055
+ }, Yn = class t extends u.Node {
1056
+ static endOfQuote(e, n) {
1057
+ let r = e[n];
1058
+ for (; r; ) if (r === "'") {
1059
+ if (e[n + 1] !== "'") break;
1060
+ r = e[n += 2];
1061
+ } else r = e[n += 1];
1062
+ return n + 1;
1063
+ }
1064
+ get strValue() {
1065
+ if (!this.valueRange || !this.context) return null;
1066
+ let e = [], { start: n, end: r } = this.valueRange, { indent: s, src: i } = this.context;
1067
+ i[r - 1] !== "'" && e.push(new u.YAMLSyntaxError(this, "Missing closing 'quote"));
1068
+ let o = "";
1069
+ for (let a = n + 1; a < r - 1; ++a) {
1070
+ let c = i[a];
1071
+ if (c === `
1072
+ `) {
1073
+ u.Node.atDocumentBoundary(i, a + 1) && e.push(new u.YAMLSemanticError(this, "Document boundary indicators are not allowed within string values"));
1074
+ let { fold: l, offset: f, error: m } = u.Node.foldNewline(i, a, s);
1075
+ o += l, a = f, m && e.push(new u.YAMLSemanticError(this, "Multi-line single-quoted string needs to be sufficiently indented"));
1076
+ } else if (c === "'") o += c, a += 1, i[a] !== "'" && e.push(new u.YAMLSyntaxError(this, "Unescaped single quote? This should not happen."));
1077
+ else if (c === " " || c === " ") {
1078
+ let l = a, f = i[a + 1];
1079
+ for (; f === " " || f === " "; ) a += 1, f = i[a + 1];
1080
+ f !== `
1081
+ ` && (o += a > l ? i.slice(l, a + 1) : c);
1082
+ } else o += c;
1083
+ }
1084
+ return e.length > 0 ? { errors: e, str: o } : o;
1085
+ }
1086
+ parse(e, n) {
1087
+ this.context = e;
1088
+ let { src: r } = e, s = t.endOfQuote(r, n + 1);
1089
+ return this.valueRange = new u.Range(n, s), s = u.Node.endOfWhiteSpace(r, s), s = this.parseComment(s), s;
1090
+ }
1091
+ };
1092
+ function Mo(t, e) {
1093
+ switch (t) {
1094
+ case u.Type.ALIAS:
1095
+ return new _n(t, e);
1096
+ case u.Type.BLOCK_FOLDED:
1097
+ case u.Type.BLOCK_LITERAL:
1098
+ return new xn(t, e);
1099
+ case u.Type.FLOW_MAP:
1100
+ case u.Type.FLOW_SEQ:
1101
+ return new Rn(t, e);
1102
+ case u.Type.MAP_KEY:
1103
+ case u.Type.MAP_VALUE:
1104
+ case u.Type.SEQ_ITEM:
1105
+ return new ut(t, e);
1106
+ case u.Type.COMMENT:
1107
+ case u.Type.PLAIN:
1108
+ return new u.PlainValue(t, e);
1109
+ case u.Type.QUOTE_DOUBLE:
1110
+ return new Dn(t, e);
1111
+ case u.Type.QUOTE_SINGLE:
1112
+ return new Yn(t, e);
1113
+ default:
1114
+ return null;
1115
+ }
1116
+ }
1117
+ var Bn = class t {
1118
+ static parseType(e, n, r) {
1119
+ switch (e[n]) {
1120
+ case "*":
1121
+ return u.Type.ALIAS;
1122
+ case ">":
1123
+ return u.Type.BLOCK_FOLDED;
1124
+ case "|":
1125
+ return u.Type.BLOCK_LITERAL;
1126
+ case "{":
1127
+ return u.Type.FLOW_MAP;
1128
+ case "[":
1129
+ return u.Type.FLOW_SEQ;
1130
+ case "?":
1131
+ return !r && u.Node.atBlank(e, n + 1, true) ? u.Type.MAP_KEY : u.Type.PLAIN;
1132
+ case ":":
1133
+ return !r && u.Node.atBlank(e, n + 1, true) ? u.Type.MAP_VALUE : u.Type.PLAIN;
1134
+ case "-":
1135
+ return !r && u.Node.atBlank(e, n + 1, true) ? u.Type.SEQ_ITEM : u.Type.PLAIN;
1136
+ case '"':
1137
+ return u.Type.QUOTE_DOUBLE;
1138
+ case "'":
1139
+ return u.Type.QUOTE_SINGLE;
1140
+ default:
1141
+ return u.Type.PLAIN;
1142
+ }
1143
+ }
1144
+ constructor(e = {}, { atLineStart: n, inCollection: r, inFlow: s, indent: i, lineStart: o, parent: a } = {}) {
1145
+ u._defineProperty(this, "parseNode", (c, l) => {
1146
+ if (u.Node.atDocumentBoundary(this.src, l)) return null;
1147
+ let f = new t(this, c), { props: m, type: d, valueStart: y } = f.parseProps(l), h = Mo(d, m), g = h.parse(f, y);
1148
+ if (h.range = new u.Range(l, g), g <= l && (h.error = new Error("Node#parse consumed no characters"), h.error.parseEnd = g, h.error.source = h, h.range.end = l + 1), f.nodeStartsCollection(h)) {
1149
+ !h.error && !f.atLineStart && f.parent.type === u.Type.DOCUMENT && (h.error = new u.YAMLSyntaxError(h, "Block collection must not have preceding content here (e.g. directives-end indicator)"));
1150
+ let w = new $t(h);
1151
+ return g = w.parse(new t(f), g), w.range = new u.Range(l, g), w;
1152
+ }
1153
+ return h;
1154
+ }), this.atLineStart = n != null ? n : e.atLineStart || false, this.inCollection = r != null ? r : e.inCollection || false, this.inFlow = s != null ? s : e.inFlow || false, this.indent = i != null ? i : e.indent, this.lineStart = o != null ? o : e.lineStart, this.parent = a != null ? a : e.parent || {}, this.root = e.root, this.src = e.src;
1155
+ }
1156
+ nodeStartsCollection(e) {
1157
+ let { inCollection: n, inFlow: r, src: s } = this;
1158
+ if (n || r) return false;
1159
+ if (e instanceof ut) return true;
1160
+ let i = e.range.end;
1161
+ return s[i] === `
1162
+ ` || s[i - 1] === `
1163
+ ` ? false : (i = u.Node.endOfWhiteSpace(s, i), s[i] === ":");
1164
+ }
1165
+ parseProps(e) {
1166
+ let { inFlow: n, parent: r, src: s } = this, i = [], o = false;
1167
+ e = this.atLineStart ? u.Node.endOfIndent(s, e) : u.Node.endOfWhiteSpace(s, e);
1168
+ let a = s[e];
1169
+ for (; a === u.Char.ANCHOR || a === u.Char.COMMENT || a === u.Char.TAG || a === `
1170
+ `; ) {
1171
+ if (a === `
1172
+ `) {
1173
+ let l = e, f;
1174
+ do
1175
+ f = l + 1, l = u.Node.endOfIndent(s, f);
1176
+ while (s[l] === `
1177
+ `);
1178
+ let m = l - (f + this.indent), d = r.type === u.Type.SEQ_ITEM && r.context.atLineStart;
1179
+ if (s[l] !== "#" && !u.Node.nextNodeIsIndented(s[l], m, !d)) break;
1180
+ this.atLineStart = true, this.lineStart = f, o = false, e = l;
1181
+ } else if (a === u.Char.COMMENT) {
1182
+ let l = u.Node.endOfLine(s, e + 1);
1183
+ i.push(new u.Range(e, l)), e = l;
1184
+ } else {
1185
+ let l = u.Node.endOfIdentifier(s, e + 1);
1186
+ a === u.Char.TAG && s[l] === "," && /^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+,\d\d\d\d(-\d\d){0,2}\/\S/.test(s.slice(e + 1, l + 13)) && (l = u.Node.endOfIdentifier(s, l + 5)), i.push(new u.Range(e, l)), o = true, e = u.Node.endOfWhiteSpace(s, l);
1187
+ }
1188
+ a = s[e];
1189
+ }
1190
+ o && a === ":" && u.Node.atBlank(s, e + 1, true) && (e -= 1);
1191
+ let c = t.parseType(s, e, n);
1192
+ return { props: i, type: c, valueStart: e };
1193
+ }
1194
+ };
1195
+ function ko(t) {
1196
+ let e = [];
1197
+ t.indexOf("\r") !== -1 && (t = t.replace(/\r\n?/g, (s, i) => (s.length > 1 && e.push(i), `
1198
+ `)));
1199
+ let n = [], r = 0;
1200
+ do {
1201
+ let s = new Pn(), i = new Bn({ src: t });
1202
+ r = s.parse(i, r), n.push(s);
1203
+ } while (r < t.length);
1204
+ return n.setOrigRanges = () => {
1205
+ if (e.length === 0) return false;
1206
+ for (let i = 1; i < e.length; ++i) e[i] -= i;
1207
+ let s = 0;
1208
+ for (let i = 0; i < n.length; ++i) s = n[i].setOrigRanges(e, s);
1209
+ return e.splice(0, e.length), true;
1210
+ }, n.toString = () => n.join(`...
1211
+ `), n;
1212
+ }
1213
+ _s.parse = ko;
1214
+ });
1215
+ var $e = ee((k) => {
1216
+ "use strict";
1217
+ var p = le();
1218
+ function vo(t, e, n) {
1219
+ return n ? `#${n.replace(/[\s\S]^/gm, `$&${e}#`)}
1220
+ ${e}${t}` : t;
1221
+ }
1222
+ function Be(t, e, n) {
1223
+ return n ? n.indexOf(`
1224
+ `) === -1 ? `${t} #${n}` : `${t}
1225
+ ` + n.replace(/^/gm, `${e || ""}#`) : t;
1226
+ }
1227
+ var V = class {
1228
+ };
1229
+ function ue(t, e, n) {
1230
+ if (Array.isArray(t)) return t.map((r, s) => ue(r, String(s), n));
1231
+ if (t && typeof t.toJSON == "function") {
1232
+ let r = n && n.anchors && n.anchors.get(t);
1233
+ r && (n.onCreate = (i) => {
1234
+ r.res = i, delete n.onCreate;
1235
+ });
1236
+ let s = t.toJSON(e, n);
1237
+ return r && n.onCreate && n.onCreate(s), s;
1238
+ }
1239
+ return (!n || !n.keep) && typeof t == "bigint" ? Number(t) : t;
1240
+ }
1241
+ var P = class extends V {
1242
+ constructor(e) {
1243
+ super(), this.value = e;
1244
+ }
1245
+ toJSON(e, n) {
1246
+ return n && n.keep ? this.value : ue(this.value, e, n);
1247
+ }
1248
+ toString() {
1249
+ return String(this.value);
1250
+ }
1251
+ };
1252
+ function Rs(t, e, n) {
1253
+ let r = n;
1254
+ for (let s = e.length - 1; s >= 0; --s) {
1255
+ let i = e[s];
1256
+ if (Number.isInteger(i) && i >= 0) {
1257
+ let o = [];
1258
+ o[i] = r, r = o;
1259
+ } else {
1260
+ let o = {};
1261
+ Object.defineProperty(o, i, { value: r, writable: true, enumerable: true, configurable: true }), r = o;
1262
+ }
1263
+ }
1264
+ return t.createNode(r, false);
1265
+ }
1266
+ var Bs = (t) => t == null || typeof t == "object" && t[Symbol.iterator]().next().done, W = class t extends V {
1267
+ constructor(e) {
1268
+ super(), p._defineProperty(this, "items", []), this.schema = e;
1269
+ }
1270
+ addIn(e, n) {
1271
+ if (Bs(e)) this.add(n);
1272
+ else {
1273
+ let [r, ...s] = e, i = this.get(r, true);
1274
+ if (i instanceof t) i.addIn(s, n);
1275
+ else if (i === void 0 && this.schema) this.set(r, Rs(this.schema, s, n));
1276
+ else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`);
1277
+ }
1278
+ }
1279
+ deleteIn([e, ...n]) {
1280
+ if (n.length === 0) return this.delete(e);
1281
+ let r = this.get(e, true);
1282
+ if (r instanceof t) return r.deleteIn(n);
1283
+ throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`);
1284
+ }
1285
+ getIn([e, ...n], r) {
1286
+ let s = this.get(e, true);
1287
+ return n.length === 0 ? !r && s instanceof P ? s.value : s : s instanceof t ? s.getIn(n, r) : void 0;
1288
+ }
1289
+ hasAllNullValues() {
1290
+ return this.items.every((e) => {
1291
+ if (!e || e.type !== "PAIR") return false;
1292
+ let n = e.value;
1293
+ return n == null || n instanceof P && n.value == null && !n.commentBefore && !n.comment && !n.tag;
1294
+ });
1295
+ }
1296
+ hasIn([e, ...n]) {
1297
+ if (n.length === 0) return this.has(e);
1298
+ let r = this.get(e, true);
1299
+ return r instanceof t ? r.hasIn(n) : false;
1300
+ }
1301
+ setIn([e, ...n], r) {
1302
+ if (n.length === 0) this.set(e, r);
1303
+ else {
1304
+ let s = this.get(e, true);
1305
+ if (s instanceof t) s.setIn(n, r);
1306
+ else if (s === void 0 && this.schema) this.set(e, Rs(this.schema, n, r));
1307
+ else throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`);
1308
+ }
1309
+ }
1310
+ toJSON() {
1311
+ return null;
1312
+ }
1313
+ toString(e, { blockItem: n, flowChars: r, isMap: s, itemIndent: i }, o, a) {
1314
+ let { indent: c, indentStep: l, stringify: f } = e, m = this.type === p.Type.FLOW_MAP || this.type === p.Type.FLOW_SEQ || e.inFlow;
1315
+ m && (i += l);
1316
+ let d = s && this.hasAllNullValues();
1317
+ e = Object.assign({}, e, { allNullValues: d, indent: i, inFlow: m, type: null });
1318
+ let y = false, h = false, g = this.items.reduce((C, L, M) => {
1319
+ let A;
1320
+ L && (!y && L.spaceBefore && C.push({ type: "comment", str: "" }), L.commentBefore && L.commentBefore.match(/^.*$/gm).forEach((Li) => {
1321
+ C.push({ type: "comment", str: `#${Li}` });
1322
+ }), L.comment && (A = L.comment), m && (!y && L.spaceBefore || L.commentBefore || L.comment || L.key && (L.key.commentBefore || L.key.comment) || L.value && (L.value.commentBefore || L.value.comment)) && (h = true)), y = false;
1323
+ let _ = f(L, e, () => A = null, () => y = true);
1324
+ return m && !h && _.includes(`
1325
+ `) && (h = true), m && M < this.items.length - 1 && (_ += ","), _ = Be(_, i, A), y && (A || m) && (y = false), C.push({ type: "item", str: _ }), C;
1326
+ }, []), w;
1327
+ if (g.length === 0) w = r.start + r.end;
1328
+ else if (m) {
1329
+ let { start: C, end: L } = r, M = g.map((A) => A.str);
1330
+ if (h || M.reduce((A, _) => A + _.length + 2, 2) > t.maxFlowStringSingleLineLength) {
1331
+ w = C;
1332
+ for (let A of M) w += A ? `
1333
+ ${l}${c}${A}` : `
1334
+ `;
1335
+ w += `
1336
+ ${c}${L}`;
1337
+ } else w = `${C} ${M.join(" ")} ${L}`;
1338
+ } else {
1339
+ let C = g.map(n);
1340
+ w = C.shift();
1341
+ for (let L of C) w += L ? `
1342
+ ${c}${L}` : `
1343
+ `;
1344
+ }
1345
+ return this.comment ? (w += `
1346
+ ` + this.comment.replace(/^/gm, `${c}#`), o && o()) : y && a && a(), w;
1347
+ }
1348
+ };
1349
+ p._defineProperty(W, "maxFlowStringSingleLineLength", 60);
1350
+ function Ft(t) {
1351
+ let e = t instanceof P ? t.value : t;
1352
+ return e && typeof e == "string" && (e = Number(e)), Number.isInteger(e) && e >= 0 ? e : null;
1353
+ }
1354
+ var pe = class extends W {
1355
+ add(e) {
1356
+ this.items.push(e);
1357
+ }
1358
+ delete(e) {
1359
+ let n = Ft(e);
1360
+ return typeof n != "number" ? false : this.items.splice(n, 1).length > 0;
1361
+ }
1362
+ get(e, n) {
1363
+ let r = Ft(e);
1364
+ if (typeof r != "number") return;
1365
+ let s = this.items[r];
1366
+ return !n && s instanceof P ? s.value : s;
1367
+ }
1368
+ has(e) {
1369
+ let n = Ft(e);
1370
+ return typeof n == "number" && n < this.items.length;
1371
+ }
1372
+ set(e, n) {
1373
+ let r = Ft(e);
1374
+ if (typeof r != "number") throw new Error(`Expected a valid index, not ${e}.`);
1375
+ this.items[r] = n;
1376
+ }
1377
+ toJSON(e, n) {
1378
+ let r = [];
1379
+ n && n.onCreate && n.onCreate(r);
1380
+ let s = 0;
1381
+ for (let i of this.items) r.push(ue(i, String(s++), n));
1382
+ return r;
1383
+ }
1384
+ toString(e, n, r) {
1385
+ return e ? super.toString(e, { blockItem: (s) => s.type === "comment" ? s.str : `- ${s.str}`, flowChars: { start: "[", end: "]" }, isMap: false, itemIndent: (e.indent || "") + " " }, n, r) : JSON.stringify(this);
1386
+ }
1387
+ }, Io = (t, e, n) => e === null ? "" : typeof e != "object" ? String(e) : t instanceof V && n && n.doc ? t.toString({ anchors: /* @__PURE__ */ Object.create(null), doc: n.doc, indent: "", indentStep: n.indentStep, inFlow: true, inStringifyKey: true, stringify: n.stringify }) : JSON.stringify(e), T = class t extends V {
1388
+ constructor(e, n = null) {
1389
+ super(), this.key = e, this.value = n, this.type = t.Type.PAIR;
1390
+ }
1391
+ get commentBefore() {
1392
+ return this.key instanceof V ? this.key.commentBefore : void 0;
1393
+ }
1394
+ set commentBefore(e) {
1395
+ if (this.key == null && (this.key = new P(null)), this.key instanceof V) this.key.commentBefore = e;
1396
+ else {
1397
+ let n = "Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.";
1398
+ throw new Error(n);
1399
+ }
1400
+ }
1401
+ addToJSMap(e, n) {
1402
+ let r = ue(this.key, "", e);
1403
+ if (n instanceof Map) {
1404
+ let s = ue(this.value, r, e);
1405
+ n.set(r, s);
1406
+ } else if (n instanceof Set) n.add(r);
1407
+ else {
1408
+ let s = Io(this.key, r, e), i = ue(this.value, s, e);
1409
+ s in n ? Object.defineProperty(n, s, { value: i, writable: true, enumerable: true, configurable: true }) : n[s] = i;
1410
+ }
1411
+ return n;
1412
+ }
1413
+ toJSON(e, n) {
1414
+ let r = n && n.mapAsMap ? /* @__PURE__ */ new Map() : {};
1415
+ return this.addToJSMap(n, r);
1416
+ }
1417
+ toString(e, n, r) {
1418
+ if (!e || !e.doc) return JSON.stringify(this);
1419
+ let { indent: s, indentSeq: i, simpleKeys: o } = e.doc.options, { key: a, value: c } = this, l = a instanceof V && a.comment;
1420
+ if (o) {
1421
+ if (l) throw new Error("With simple keys, key nodes cannot have comments");
1422
+ if (a instanceof W) {
1423
+ let _ = "With simple keys, collection cannot be used as a key value";
1424
+ throw new Error(_);
1425
+ }
1426
+ }
1427
+ let f = !o && (!a || l || (a instanceof V ? a instanceof W || a.type === p.Type.BLOCK_FOLDED || a.type === p.Type.BLOCK_LITERAL : typeof a == "object")), { doc: m, indent: d, indentStep: y, stringify: h } = e;
1428
+ e = Object.assign({}, e, { implicitKey: !f, indent: d + y });
1429
+ let g = false, w = h(a, e, () => l = null, () => g = true);
1430
+ if (w = Be(w, e.indent, l), !f && w.length > 1024) {
1431
+ if (o) throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
1432
+ f = true;
1433
+ }
1434
+ if (e.allNullValues && !o) return this.comment ? (w = Be(w, e.indent, this.comment), n && n()) : g && !l && r && r(), e.inFlow && !f ? w : `? ${w}`;
1435
+ w = f ? `? ${w}
1436
+ ${d}:` : `${w}:`, this.comment && (w = Be(w, e.indent, this.comment), n && n());
1437
+ let C = "", L = null;
1438
+ if (c instanceof V) {
1439
+ if (c.spaceBefore && (C = `
1440
+ `), c.commentBefore) {
1441
+ let _ = c.commentBefore.replace(/^/gm, `${e.indent}#`);
1442
+ C += `
1443
+ ${_}`;
1444
+ }
1445
+ L = c.comment;
1446
+ } else c && typeof c == "object" && (c = m.schema.createNode(c, true));
1447
+ e.implicitKey = false, !f && !this.comment && c instanceof P && (e.indentAtStart = w.length + 1), g = false, !i && s >= 2 && !e.inFlow && !f && c instanceof pe && c.type !== p.Type.FLOW_SEQ && !c.tag && !m.anchors.getName(c) && (e.indent = e.indent.substr(2));
1448
+ let M = h(c, e, () => L = null, () => g = true), A = " ";
1449
+ return C || this.comment ? A = `${C}
1450
+ ${e.indent}` : !f && c instanceof W ? (!(M[0] === "[" || M[0] === "{") || M.includes(`
1451
+ `)) && (A = `
1452
+ ${e.indent}`) : M[0] === `
1453
+ ` && (A = ""), g && !L && r && r(), Be(w + A + M, e.indent, L);
1454
+ }
1455
+ };
1456
+ p._defineProperty(T, "Type", { PAIR: "PAIR", MERGE_PAIR: "MERGE_PAIR" });
1457
+ var qt = (t, e) => {
1458
+ if (t instanceof we) {
1459
+ let n = e.get(t.source);
1460
+ return n.count * n.aliasCount;
1461
+ } else if (t instanceof W) {
1462
+ let n = 0;
1463
+ for (let r of t.items) {
1464
+ let s = qt(r, e);
1465
+ s > n && (n = s);
1466
+ }
1467
+ return n;
1468
+ } else if (t instanceof T) {
1469
+ let n = qt(t.key, e), r = qt(t.value, e);
1470
+ return Math.max(n, r);
1471
+ }
1472
+ return 1;
1473
+ }, we = class t extends V {
1474
+ static stringify({ range: e, source: n }, { anchors: r, doc: s, implicitKey: i, inStringifyKey: o }) {
1475
+ let a = Object.keys(r).find((l) => r[l] === n);
1476
+ if (!a && o && (a = s.anchors.getName(n) || s.anchors.newName()), a) return `*${a}${i ? " " : ""}`;
1477
+ let c = s.anchors.getName(n) ? "Alias node must be after source node" : "Source node not found for alias node";
1478
+ throw new Error(`${c} [${e}]`);
1479
+ }
1480
+ constructor(e) {
1481
+ super(), this.source = e, this.type = p.Type.ALIAS;
1482
+ }
1483
+ set tag(e) {
1484
+ throw new Error("Alias nodes cannot have tags");
1485
+ }
1486
+ toJSON(e, n) {
1487
+ if (!n) return ue(this.source, e, n);
1488
+ let { anchors: r, maxAliasCount: s } = n, i = r.get(this.source);
1489
+ if (!i || i.res === void 0) {
1490
+ let o = "This should not happen: Alias anchor was not resolved?";
1491
+ throw this.cstNode ? new p.YAMLReferenceError(this.cstNode, o) : new ReferenceError(o);
1492
+ }
1493
+ if (s >= 0 && (i.count += 1, i.aliasCount === 0 && (i.aliasCount = qt(this.source, r)), i.count * i.aliasCount > s)) {
1494
+ let o = "Excessive alias count indicates a resource exhaustion attack";
1495
+ throw this.cstNode ? new p.YAMLReferenceError(this.cstNode, o) : new ReferenceError(o);
1496
+ }
1497
+ return i.res;
1498
+ }
1499
+ toString(e) {
1500
+ return t.stringify(this, e);
1501
+ }
1502
+ };
1503
+ p._defineProperty(we, "default", true);
1504
+ function pt(t, e) {
1505
+ let n = e instanceof P ? e.value : e;
1506
+ for (let r of t) if (r instanceof T && (r.key === e || r.key === n || r.key && r.key.value === n)) return r;
1507
+ }
1508
+ var mt = class extends W {
1509
+ add(e, n) {
1510
+ e ? e instanceof T || (e = new T(e.key || e, e.value)) : e = new T(e);
1511
+ let r = pt(this.items, e.key), s = this.schema && this.schema.sortMapEntries;
1512
+ if (r) if (n) r.value = e.value;
1513
+ else throw new Error(`Key ${e.key} already set`);
1514
+ else if (s) {
1515
+ let i = this.items.findIndex((o) => s(e, o) < 0);
1516
+ i === -1 ? this.items.push(e) : this.items.splice(i, 0, e);
1517
+ } else this.items.push(e);
1518
+ }
1519
+ delete(e) {
1520
+ let n = pt(this.items, e);
1521
+ return n ? this.items.splice(this.items.indexOf(n), 1).length > 0 : false;
1522
+ }
1523
+ get(e, n) {
1524
+ let r = pt(this.items, e), s = r && r.value;
1525
+ return !n && s instanceof P ? s.value : s;
1526
+ }
1527
+ has(e) {
1528
+ return !!pt(this.items, e);
1529
+ }
1530
+ set(e, n) {
1531
+ this.add(new T(e, n), true);
1532
+ }
1533
+ toJSON(e, n, r) {
1534
+ let s = r ? new r() : n && n.mapAsMap ? /* @__PURE__ */ new Map() : {};
1535
+ n && n.onCreate && n.onCreate(s);
1536
+ for (let i of this.items) i.addToJSMap(n, s);
1537
+ return s;
1538
+ }
1539
+ toString(e, n, r) {
1540
+ if (!e) return JSON.stringify(this);
1541
+ for (let s of this.items) if (!(s instanceof T)) throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);
1542
+ return super.toString(e, { blockItem: (s) => s.str, flowChars: { start: "{", end: "}" }, isMap: true, itemIndent: e.indent || "" }, n, r);
1543
+ }
1544
+ }, $s = "<<", Vt = class extends T {
1545
+ constructor(e) {
1546
+ if (e instanceof T) {
1547
+ let n = e.value;
1548
+ n instanceof pe || (n = new pe(), n.items.push(e.value), n.range = e.value.range), super(e.key, n), this.range = e.range;
1549
+ } else super(new P($s), new pe());
1550
+ this.type = T.Type.MERGE_PAIR;
1551
+ }
1552
+ addToJSMap(e, n) {
1553
+ for (let { source: r } of this.value.items) {
1554
+ if (!(r instanceof mt)) throw new Error("Merge sources must be maps");
1555
+ let s = r.toJSON(null, e, Map);
1556
+ for (let [i, o] of s) n instanceof Map ? n.has(i) || n.set(i, o) : n instanceof Set ? n.add(i) : Object.prototype.hasOwnProperty.call(n, i) || Object.defineProperty(n, i, { value: o, writable: true, enumerable: true, configurable: true });
1557
+ }
1558
+ return n;
1559
+ }
1560
+ toString(e, n) {
1561
+ let r = this.value;
1562
+ if (r.items.length > 1) return super.toString(e, n);
1563
+ this.value = r.items[0];
1564
+ let s = super.toString(e, n);
1565
+ return this.value = r, s;
1566
+ }
1567
+ }, Po = { defaultType: p.Type.BLOCK_LITERAL, lineWidth: 76 }, _o = { trueStr: "true", falseStr: "false" }, xo = { asBigInt: false }, Ro = { nullStr: "null" }, be = { defaultType: p.Type.PLAIN, doubleQuoted: { jsonEncoding: false, minMultiLineLength: 40 }, fold: { lineWidth: 80, minContentWidth: 20 } };
1568
+ function Fn(t, e, n) {
1569
+ for (let { format: r, test: s, resolve: i } of e) if (s) {
1570
+ let o = t.match(s);
1571
+ if (o) {
1572
+ let a = i.apply(null, o);
1573
+ return a instanceof P || (a = new P(a)), r && (a.format = r), a;
1574
+ }
1575
+ }
1576
+ return n && (t = n(t)), new P(t);
1577
+ }
1578
+ var Fs = "flow", $n = "block", Ut = "quoted", Ds = (t, e) => {
1579
+ let n = t[e + 1];
1580
+ for (; n === " " || n === " "; ) {
1581
+ do
1582
+ n = t[e += 1];
1583
+ while (n && n !== `
1584
+ `);
1585
+ n = t[e + 1];
1586
+ }
1587
+ return e;
1588
+ };
1589
+ function Wt(t, e, n, { indentAtStart: r, lineWidth: s = 80, minContentWidth: i = 20, onFold: o, onOverflow: a }) {
1590
+ if (!s || s < 0) return t;
1591
+ let c = Math.max(1 + i, 1 + s - e.length);
1592
+ if (t.length <= c) return t;
1593
+ let l = [], f = {}, m = s - e.length;
1594
+ typeof r == "number" && (r > s - Math.max(2, i) ? l.push(0) : m = s - r);
1595
+ let d, y, h = false, g = -1, w = -1, C = -1;
1596
+ n === $n && (g = Ds(t, g), g !== -1 && (m = g + c));
1597
+ for (let M; M = t[g += 1]; ) {
1598
+ if (n === Ut && M === "\\") {
1599
+ switch (w = g, t[g + 1]) {
1600
+ case "x":
1601
+ g += 3;
1602
+ break;
1603
+ case "u":
1604
+ g += 5;
1605
+ break;
1606
+ case "U":
1607
+ g += 9;
1608
+ break;
1609
+ default:
1610
+ g += 1;
1611
+ }
1612
+ C = g;
1613
+ }
1614
+ if (M === `
1615
+ `) n === $n && (g = Ds(t, g)), m = g + c, d = void 0;
1616
+ else {
1617
+ if (M === " " && y && y !== " " && y !== `
1618
+ ` && y !== " ") {
1619
+ let A = t[g + 1];
1620
+ A && A !== " " && A !== `
1621
+ ` && A !== " " && (d = g);
1622
+ }
1623
+ if (g >= m) if (d) l.push(d), m = d + c, d = void 0;
1624
+ else if (n === Ut) {
1625
+ for (; y === " " || y === " "; ) y = M, M = t[g += 1], h = true;
1626
+ let A = g > C + 1 ? g - 2 : w - 1;
1627
+ if (f[A]) return t;
1628
+ l.push(A), f[A] = true, m = A + c, d = void 0;
1629
+ } else h = true;
1630
+ }
1631
+ y = M;
1632
+ }
1633
+ if (h && a && a(), l.length === 0) return t;
1634
+ o && o();
1635
+ let L = t.slice(0, l[0]);
1636
+ for (let M = 0; M < l.length; ++M) {
1637
+ let A = l[M], _ = l[M + 1] || t.length;
1638
+ A === 0 ? L = `
1639
+ ${e}${t.slice(0, _)}` : (n === Ut && f[A] && (L += `${t[A]}\\`), L += `
1640
+ ${e}${t.slice(A + 1, _)}`);
1641
+ }
1642
+ return L;
1643
+ }
1644
+ var qn = ({ indentAtStart: t }) => t ? Object.assign({ indentAtStart: t }, be.fold) : be.fold, jt = (t) => /^(%|---|\.\.\.)/m.test(t);
1645
+ function Do(t, e, n) {
1646
+ if (!e || e < 0) return false;
1647
+ let r = e - n, s = t.length;
1648
+ if (s <= r) return false;
1649
+ for (let i = 0, o = 0; i < s; ++i) if (t[i] === `
1650
+ `) {
1651
+ if (i - o > r) return true;
1652
+ if (o = i + 1, s - o <= r) return false;
1653
+ }
1654
+ return true;
1655
+ }
1656
+ function Se(t, e) {
1657
+ let { implicitKey: n } = e, { jsonEncoding: r, minMultiLineLength: s } = be.doubleQuoted, i = JSON.stringify(t);
1658
+ if (r) return i;
1659
+ let o = e.indent || (jt(t) ? " " : ""), a = "", c = 0;
1660
+ for (let l = 0, f = i[l]; f; f = i[++l]) if (f === " " && i[l + 1] === "\\" && i[l + 2] === "n" && (a += i.slice(c, l) + "\\ ", l += 1, c = l, f = "\\"), f === "\\") switch (i[l + 1]) {
1661
+ case "u":
1662
+ {
1663
+ a += i.slice(c, l);
1664
+ let m = i.substr(l + 2, 4);
1665
+ switch (m) {
1666
+ case "0000":
1667
+ a += "\\0";
1668
+ break;
1669
+ case "0007":
1670
+ a += "\\a";
1671
+ break;
1672
+ case "000b":
1673
+ a += "\\v";
1674
+ break;
1675
+ case "001b":
1676
+ a += "\\e";
1677
+ break;
1678
+ case "0085":
1679
+ a += "\\N";
1680
+ break;
1681
+ case "00a0":
1682
+ a += "\\_";
1683
+ break;
1684
+ case "2028":
1685
+ a += "\\L";
1686
+ break;
1687
+ case "2029":
1688
+ a += "\\P";
1689
+ break;
1690
+ default:
1691
+ m.substr(0, 2) === "00" ? a += "\\x" + m.substr(2) : a += i.substr(l, 6);
1692
+ }
1693
+ l += 5, c = l + 1;
1694
+ }
1695
+ break;
1696
+ case "n":
1697
+ if (n || i[l + 2] === '"' || i.length < s) l += 1;
1698
+ else {
1699
+ for (a += i.slice(c, l) + `
1700
+
1701
+ `; i[l + 2] === "\\" && i[l + 3] === "n" && i[l + 4] !== '"'; ) a += `
1702
+ `, l += 2;
1703
+ a += o, i[l + 2] === " " && (a += "\\"), l += 1, c = l + 1;
1704
+ }
1705
+ break;
1706
+ default:
1707
+ l += 1;
1708
+ }
1709
+ return a = c ? a + i.slice(c) : i, n ? a : Wt(a, o, Ut, qn(e));
1710
+ }
1711
+ function qs(t, e) {
1712
+ if (e.implicitKey) {
1713
+ if (/\n/.test(t)) return Se(t, e);
1714
+ } else if (/[ \t]\n|\n[ \t]/.test(t)) return Se(t, e);
1715
+ let n = e.indent || (jt(t) ? " " : ""), r = "'" + t.replace(/'/g, "''").replace(/\n+/g, `$&
1716
+ ${n}`) + "'";
1717
+ return e.implicitKey ? r : Wt(r, n, Fs, qn(e));
1718
+ }
1719
+ function Kt({ comment: t, type: e, value: n }, r, s, i) {
1720
+ if (/\n[\t ]+$/.test(n) || /^\s*$/.test(n)) return Se(n, r);
1721
+ let o = r.indent || (r.forceBlockIndent || jt(n) ? " " : ""), a = o ? "2" : "1", c = e === p.Type.BLOCK_FOLDED ? false : e === p.Type.BLOCK_LITERAL ? true : !Do(n, be.fold.lineWidth, o.length), l = c ? "|" : ">";
1722
+ if (!n) return l + `
1723
+ `;
1724
+ let f = "", m = "";
1725
+ if (n = n.replace(/[\n\t ]*$/, (y) => {
1726
+ let h = y.indexOf(`
1727
+ `);
1728
+ return h === -1 ? l += "-" : (n === y || h !== y.length - 1) && (l += "+", i && i()), m = y.replace(/\n$/, ""), "";
1729
+ }).replace(/^[\n ]*/, (y) => {
1730
+ y.indexOf(" ") !== -1 && (l += a);
1731
+ let h = y.match(/ +$/);
1732
+ return h ? (f = y.slice(0, -h[0].length), h[0]) : (f = y, "");
1733
+ }), m && (m = m.replace(/\n+(?!\n|$)/g, `$&${o}`)), f && (f = f.replace(/\n+/g, `$&${o}`)), t && (l += " #" + t.replace(/ ?[\r\n]+/g, " "), s && s()), !n) return `${l}${a}
1734
+ ${o}${m}`;
1735
+ if (c) return n = n.replace(/\n+/g, `$&${o}`), `${l}
1736
+ ${o}${f}${n}${m}`;
1737
+ n = n.replace(/\n+/g, `
1738
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${o}`);
1739
+ let d = Wt(`${f}${n}${m}`, o, $n, be.fold);
1740
+ return `${l}
1741
+ ${o}${d}`;
1742
+ }
1743
+ function Yo(t, e, n, r) {
1744
+ let { comment: s, type: i, value: o } = t, { actualString: a, implicitKey: c, indent: l, inFlow: f } = e;
1745
+ if (c && /[\n[\]{},]/.test(o) || f && /[[\]{},]/.test(o)) return Se(o, e);
1746
+ if (!o || /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o)) return c || f || o.indexOf(`
1747
+ `) === -1 ? o.indexOf('"') !== -1 && o.indexOf("'") === -1 ? qs(o, e) : Se(o, e) : Kt(t, e, n, r);
1748
+ if (!c && !f && i !== p.Type.PLAIN && o.indexOf(`
1749
+ `) !== -1) return Kt(t, e, n, r);
1750
+ if (l === "" && jt(o)) return e.forceBlockIndent = true, Kt(t, e, n, r);
1751
+ let m = o.replace(/\n+/g, `$&
1752
+ ${l}`);
1753
+ if (a) {
1754
+ let { tags: y } = e.doc.schema;
1755
+ if (typeof Fn(m, y, y.scalarFallback).value != "string") return Se(o, e);
1756
+ }
1757
+ let d = c ? m : Wt(m, l, Fs, qn(e));
1758
+ return s && !f && (d.indexOf(`
1759
+ `) !== -1 || s.indexOf(`
1760
+ `) !== -1) ? (n && n(), vo(d, l, s)) : d;
1761
+ }
1762
+ function Bo(t, e, n, r) {
1763
+ let { defaultType: s } = be, { implicitKey: i, inFlow: o } = e, { type: a, value: c } = t;
1764
+ typeof c != "string" && (c = String(c), t = Object.assign({}, t, { value: c }));
1765
+ let l = (m) => {
1766
+ switch (m) {
1767
+ case p.Type.BLOCK_FOLDED:
1768
+ case p.Type.BLOCK_LITERAL:
1769
+ return Kt(t, e, n, r);
1770
+ case p.Type.QUOTE_DOUBLE:
1771
+ return Se(c, e);
1772
+ case p.Type.QUOTE_SINGLE:
1773
+ return qs(c, e);
1774
+ case p.Type.PLAIN:
1775
+ return Yo(t, e, n, r);
1776
+ default:
1777
+ return null;
1778
+ }
1779
+ };
1780
+ (a !== p.Type.QUOTE_DOUBLE && /[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(c) || (i || o) && (a === p.Type.BLOCK_FOLDED || a === p.Type.BLOCK_LITERAL)) && (a = p.Type.QUOTE_DOUBLE);
1781
+ let f = l(a);
1782
+ if (f === null && (f = l(s), f === null)) throw new Error(`Unsupported default string type ${s}`);
1783
+ return f;
1784
+ }
1785
+ function $o({ format: t, minFractionDigits: e, tag: n, value: r }) {
1786
+ if (typeof r == "bigint") return String(r);
1787
+ if (!isFinite(r)) return isNaN(r) ? ".nan" : r < 0 ? "-.inf" : ".inf";
1788
+ let s = JSON.stringify(r);
1789
+ if (!t && e && (!n || n === "tag:yaml.org,2002:float") && /^\d/.test(s)) {
1790
+ let i = s.indexOf(".");
1791
+ i < 0 && (i = s.length, s += ".");
1792
+ let o = e - (s.length - i - 1);
1793
+ for (; o-- > 0; ) s += "0";
1794
+ }
1795
+ return s;
1796
+ }
1797
+ function Us(t, e) {
1798
+ let n, r;
1799
+ switch (e.type) {
1800
+ case p.Type.FLOW_MAP:
1801
+ n = "}", r = "flow map";
1802
+ break;
1803
+ case p.Type.FLOW_SEQ:
1804
+ n = "]", r = "flow sequence";
1805
+ break;
1806
+ default:
1807
+ t.push(new p.YAMLSemanticError(e, "Not a flow collection!?"));
1808
+ return;
1809
+ }
1810
+ let s;
1811
+ for (let i = e.items.length - 1; i >= 0; --i) {
1812
+ let o = e.items[i];
1813
+ if (!o || o.type !== p.Type.COMMENT) {
1814
+ s = o;
1815
+ break;
1816
+ }
1817
+ }
1818
+ if (s && s.char !== n) {
1819
+ let i = `Expected ${r} to end with ${n}`, o;
1820
+ typeof s.offset == "number" ? (o = new p.YAMLSemanticError(e, i), o.offset = s.offset + 1) : (o = new p.YAMLSemanticError(s, i), s.range && s.range.end && (o.offset = s.range.end - s.range.start)), t.push(o);
1821
+ }
1822
+ }
1823
+ function Ks(t, e) {
1824
+ let n = e.context.src[e.range.start - 1];
1825
+ if (n !== `
1826
+ ` && n !== " " && n !== " ") {
1827
+ let r = "Comments must be separated from other tokens by white space characters";
1828
+ t.push(new p.YAMLSemanticError(e, r));
1829
+ }
1830
+ }
1831
+ function Vs(t, e) {
1832
+ let n = String(e), r = n.substr(0, 8) + "..." + n.substr(-8);
1833
+ return new p.YAMLSemanticError(t, `The "${r}" key is too long`);
1834
+ }
1835
+ function Ws(t, e) {
1836
+ for (let { afterKey: n, before: r, comment: s } of e) {
1837
+ let i = t.items[r];
1838
+ i ? (n && i.value && (i = i.value), s === void 0 ? (n || !i.commentBefore) && (i.spaceBefore = true) : i.commentBefore ? i.commentBefore += `
1839
+ ` + s : i.commentBefore = s) : s !== void 0 && (t.comment ? t.comment += `
1840
+ ` + s : t.comment = s);
1841
+ }
1842
+ }
1843
+ function Un(t, e) {
1844
+ let n = e.strValue;
1845
+ return n ? typeof n == "string" ? n : (n.errors.forEach((r) => {
1846
+ r.source || (r.source = e), t.errors.push(r);
1847
+ }), n.str) : "";
1848
+ }
1849
+ function Fo(t, e) {
1850
+ let { handle: n, suffix: r } = e.tag, s = t.tagPrefixes.find((i) => i.handle === n);
1851
+ if (!s) {
1852
+ let i = t.getDefaults().tagPrefixes;
1853
+ if (i && (s = i.find((o) => o.handle === n)), !s) throw new p.YAMLSemanticError(e, `The ${n} tag handle is non-default and was not declared.`);
1854
+ }
1855
+ if (!r) throw new p.YAMLSemanticError(e, `The ${n} tag has no suffix.`);
1856
+ if (n === "!" && (t.version || t.options.version) === "1.0") {
1857
+ if (r[0] === "^") return t.warnings.push(new p.YAMLWarning(e, "YAML 1.0 ^ tag expansion is not supported")), r;
1858
+ if (/[:/]/.test(r)) {
1859
+ let i = r.match(/^([a-z0-9-]+)\/(.*)/i);
1860
+ return i ? `tag:${i[1]}.yaml.org,2002:${i[2]}` : `tag:${r}`;
1861
+ }
1862
+ }
1863
+ return s.prefix + decodeURIComponent(r);
1864
+ }
1865
+ function qo(t, e) {
1866
+ let { tag: n, type: r } = e, s = false;
1867
+ if (n) {
1868
+ let { handle: i, suffix: o, verbatim: a } = n;
1869
+ if (a) {
1870
+ if (a !== "!" && a !== "!!") return a;
1871
+ let c = `Verbatim tags aren't resolved, so ${a} is invalid.`;
1872
+ t.errors.push(new p.YAMLSemanticError(e, c));
1873
+ } else if (i === "!" && !o) s = true;
1874
+ else try {
1875
+ return Fo(t, e);
1876
+ } catch (c) {
1877
+ t.errors.push(c);
1878
+ }
1879
+ }
1880
+ switch (r) {
1881
+ case p.Type.BLOCK_FOLDED:
1882
+ case p.Type.BLOCK_LITERAL:
1883
+ case p.Type.QUOTE_DOUBLE:
1884
+ case p.Type.QUOTE_SINGLE:
1885
+ return p.defaultTags.STR;
1886
+ case p.Type.FLOW_MAP:
1887
+ case p.Type.MAP:
1888
+ return p.defaultTags.MAP;
1889
+ case p.Type.FLOW_SEQ:
1890
+ case p.Type.SEQ:
1891
+ return p.defaultTags.SEQ;
1892
+ case p.Type.PLAIN:
1893
+ return s ? p.defaultTags.STR : null;
1894
+ default:
1895
+ return null;
1896
+ }
1897
+ }
1898
+ function Ys(t, e, n) {
1899
+ let { tags: r } = t.schema, s = [];
1900
+ for (let o of r) if (o.tag === n) if (o.test) s.push(o);
1901
+ else {
1902
+ let a = o.resolve(t, e);
1903
+ return a instanceof W ? a : new P(a);
1904
+ }
1905
+ let i = Un(t, e);
1906
+ return typeof i == "string" && s.length > 0 ? Fn(i, s, r.scalarFallback) : null;
1907
+ }
1908
+ function Uo({ type: t }) {
1909
+ switch (t) {
1910
+ case p.Type.FLOW_MAP:
1911
+ case p.Type.MAP:
1912
+ return p.defaultTags.MAP;
1913
+ case p.Type.FLOW_SEQ:
1914
+ case p.Type.SEQ:
1915
+ return p.defaultTags.SEQ;
1916
+ default:
1917
+ return p.defaultTags.STR;
1918
+ }
1919
+ }
1920
+ function Ko(t, e, n) {
1921
+ try {
1922
+ let r = Ys(t, e, n);
1923
+ if (r) return n && e.tag && (r.tag = n), r;
1924
+ } catch (r) {
1925
+ return r.source || (r.source = e), t.errors.push(r), null;
1926
+ }
1927
+ try {
1928
+ let r = Uo(e);
1929
+ if (!r) throw new Error(`The tag ${n} is unavailable`);
1930
+ let s = `The tag ${n} is unavailable, falling back to ${r}`;
1931
+ t.warnings.push(new p.YAMLWarning(e, s));
1932
+ let i = Ys(t, e, r);
1933
+ return i.tag = n, i;
1934
+ } catch (r) {
1935
+ let s = new p.YAMLReferenceError(e, r.message);
1936
+ return s.stack = r.stack, t.errors.push(s), null;
1937
+ }
1938
+ }
1939
+ var Vo = (t) => {
1940
+ if (!t) return false;
1941
+ let { type: e } = t;
1942
+ return e === p.Type.MAP_KEY || e === p.Type.MAP_VALUE || e === p.Type.SEQ_ITEM;
1943
+ };
1944
+ function Wo(t, e) {
1945
+ let n = { before: [], after: [] }, r = false, s = false, i = Vo(e.context.parent) ? e.context.parent.props.concat(e.props) : e.props;
1946
+ for (let { start: o, end: a } of i) switch (e.context.src[o]) {
1947
+ case p.Char.COMMENT: {
1948
+ if (!e.commentHasRequiredWhitespace(o)) {
1949
+ let m = "Comments must be separated from other tokens by white space characters";
1950
+ t.push(new p.YAMLSemanticError(e, m));
1951
+ }
1952
+ let { header: c, valueRange: l } = e;
1953
+ (l && (o > l.start || c && o > c.start) ? n.after : n.before).push(e.context.src.slice(o + 1, a));
1954
+ break;
1955
+ }
1956
+ case p.Char.ANCHOR:
1957
+ if (r) {
1958
+ let c = "A node can have at most one anchor";
1959
+ t.push(new p.YAMLSemanticError(e, c));
1960
+ }
1961
+ r = true;
1962
+ break;
1963
+ case p.Char.TAG:
1964
+ if (s) {
1965
+ let c = "A node can have at most one tag";
1966
+ t.push(new p.YAMLSemanticError(e, c));
1967
+ }
1968
+ s = true;
1969
+ break;
1970
+ }
1971
+ return { comments: n, hasAnchor: r, hasTag: s };
1972
+ }
1973
+ function jo(t, e) {
1974
+ let { anchors: n, errors: r, schema: s } = t;
1975
+ if (e.type === p.Type.ALIAS) {
1976
+ let o = e.rawValue, a = n.getNode(o);
1977
+ if (!a) {
1978
+ let l = `Aliased anchor not found: ${o}`;
1979
+ return r.push(new p.YAMLReferenceError(e, l)), null;
1980
+ }
1981
+ let c = new we(a);
1982
+ return n._cstAliases.push(c), c;
1983
+ }
1984
+ let i = qo(t, e);
1985
+ if (i) return Ko(t, e, i);
1986
+ if (e.type !== p.Type.PLAIN) {
1987
+ let o = `Failed to resolve ${e.type} node here`;
1988
+ return r.push(new p.YAMLSyntaxError(e, o)), null;
1989
+ }
1990
+ try {
1991
+ let o = Un(t, e);
1992
+ return Fn(o, s.tags, s.tags.scalarFallback);
1993
+ } catch (o) {
1994
+ return o.source || (o.source = e), r.push(o), null;
1995
+ }
1996
+ }
1997
+ function me(t, e) {
1998
+ if (!e) return null;
1999
+ e.error && t.errors.push(e.error);
2000
+ let { comments: n, hasAnchor: r, hasTag: s } = Wo(t.errors, e);
2001
+ if (r) {
2002
+ let { anchors: o } = t, a = e.anchor, c = o.getNode(a);
2003
+ c && (o.map[o.newName(a)] = c), o.map[a] = e;
2004
+ }
2005
+ if (e.type === p.Type.ALIAS && (r || s)) {
2006
+ let o = "An alias node must not specify any properties";
2007
+ t.errors.push(new p.YAMLSemanticError(e, o));
2008
+ }
2009
+ let i = jo(t, e);
2010
+ if (i) {
2011
+ i.range = [e.range.start, e.range.end], t.options.keepCstNodes && (i.cstNode = e), t.options.keepNodeTypes && (i.type = e.type);
2012
+ let o = n.before.join(`
2013
+ `);
2014
+ o && (i.commentBefore = i.commentBefore ? `${i.commentBefore}
2015
+ ${o}` : o);
2016
+ let a = n.after.join(`
2017
+ `);
2018
+ a && (i.comment = i.comment ? `${i.comment}
2019
+ ${a}` : a);
2020
+ }
2021
+ return e.resolved = i;
2022
+ }
2023
+ function Qo(t, e) {
2024
+ if (e.type !== p.Type.MAP && e.type !== p.Type.FLOW_MAP) {
2025
+ let o = `A ${e.type} node cannot be resolved as a mapping`;
2026
+ return t.errors.push(new p.YAMLSyntaxError(e, o)), null;
2027
+ }
2028
+ let { comments: n, items: r } = e.type === p.Type.FLOW_MAP ? Xo(t, e) : Ho(t, e), s = new mt();
2029
+ s.items = r, Ws(s, n);
2030
+ let i = false;
2031
+ for (let o = 0; o < r.length; ++o) {
2032
+ let { key: a } = r[o];
2033
+ if (a instanceof W && (i = true), t.schema.merge && a && a.value === $s) {
2034
+ r[o] = new Vt(r[o]);
2035
+ let c = r[o].value.items, l = null;
2036
+ c.some((f) => {
2037
+ if (f instanceof we) {
2038
+ let { type: m } = f.source;
2039
+ return m === p.Type.MAP || m === p.Type.FLOW_MAP ? false : l = "Merge nodes aliases can only point to maps";
2040
+ }
2041
+ return l = "Merge nodes can only have Alias nodes as values";
2042
+ }), l && t.errors.push(new p.YAMLSemanticError(e, l));
2043
+ } else for (let c = o + 1; c < r.length; ++c) {
2044
+ let { key: l } = r[c];
2045
+ if (a === l || a && l && Object.prototype.hasOwnProperty.call(a, "value") && a.value === l.value) {
2046
+ let f = `Map keys must be unique; "${a}" is repeated`;
2047
+ t.errors.push(new p.YAMLSemanticError(e, f));
2048
+ break;
2049
+ }
2050
+ }
2051
+ }
2052
+ if (i && !t.options.mapAsMap) {
2053
+ let o = "Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";
2054
+ t.warnings.push(new p.YAMLWarning(e, o));
2055
+ }
2056
+ return e.resolved = s, s;
2057
+ }
2058
+ var Jo = ({ context: { lineStart: t, node: e, src: n }, props: r }) => {
2059
+ if (r.length === 0) return false;
2060
+ let { start: s } = r[0];
2061
+ if (e && s > e.valueRange.start || n[s] !== p.Char.COMMENT) return false;
2062
+ for (let i = t; i < s; ++i) if (n[i] === `
2063
+ `) return false;
2064
+ return true;
2065
+ };
2066
+ function Go(t, e) {
2067
+ if (!Jo(t)) return;
2068
+ let n = t.getPropValue(0, p.Char.COMMENT, true), r = false, s = e.value.commentBefore;
2069
+ if (s && s.startsWith(n)) e.value.commentBefore = s.substr(n.length + 1), r = true;
2070
+ else {
2071
+ let i = e.value.comment;
2072
+ !t.node && i && i.startsWith(n) && (e.value.comment = i.substr(n.length + 1), r = true);
2073
+ }
2074
+ r && (e.comment = n);
2075
+ }
2076
+ function Ho(t, e) {
2077
+ let n = [], r = [], s, i = null;
2078
+ for (let o = 0; o < e.items.length; ++o) {
2079
+ let a = e.items[o];
2080
+ switch (a.type) {
2081
+ case p.Type.BLANK_LINE:
2082
+ n.push({ afterKey: !!s, before: r.length });
2083
+ break;
2084
+ case p.Type.COMMENT:
2085
+ n.push({ afterKey: !!s, before: r.length, comment: a.comment });
2086
+ break;
2087
+ case p.Type.MAP_KEY:
2088
+ s !== void 0 && r.push(new T(s)), a.error && t.errors.push(a.error), s = me(t, a.node), i = null;
2089
+ break;
2090
+ case p.Type.MAP_VALUE:
2091
+ {
2092
+ if (s === void 0 && (s = null), a.error && t.errors.push(a.error), !a.context.atLineStart && a.node && a.node.type === p.Type.MAP && !a.node.context.atLineStart) {
2093
+ let f = "Nested mappings are not allowed in compact mappings";
2094
+ t.errors.push(new p.YAMLSemanticError(a.node, f));
2095
+ }
2096
+ let c = a.node;
2097
+ if (!c && a.props.length > 0) {
2098
+ c = new p.PlainValue(p.Type.PLAIN, []), c.context = { parent: a, src: a.context.src };
2099
+ let f = a.range.start + 1;
2100
+ if (c.range = { start: f, end: f }, c.valueRange = { start: f, end: f }, typeof a.range.origStart == "number") {
2101
+ let m = a.range.origStart + 1;
2102
+ c.range.origStart = c.range.origEnd = m, c.valueRange.origStart = c.valueRange.origEnd = m;
2103
+ }
2104
+ }
2105
+ let l = new T(s, me(t, c));
2106
+ Go(a, l), r.push(l), s && typeof i == "number" && a.range.start > i + 1024 && t.errors.push(Vs(e, s)), s = void 0, i = null;
2107
+ }
2108
+ break;
2109
+ default:
2110
+ s !== void 0 && r.push(new T(s)), s = me(t, a), i = a.range.start, a.error && t.errors.push(a.error);
2111
+ e: for (let c = o + 1; ; ++c) {
2112
+ let l = e.items[c];
2113
+ switch (l && l.type) {
2114
+ case p.Type.BLANK_LINE:
2115
+ case p.Type.COMMENT:
2116
+ continue e;
2117
+ case p.Type.MAP_VALUE:
2118
+ break e;
2119
+ default: {
2120
+ let f = "Implicit map keys need to be followed by map values";
2121
+ t.errors.push(new p.YAMLSemanticError(a, f));
2122
+ break e;
2123
+ }
2124
+ }
2125
+ }
2126
+ if (a.valueRangeContainsNewline) {
2127
+ let c = "Implicit map keys need to be on a single line";
2128
+ t.errors.push(new p.YAMLSemanticError(a, c));
2129
+ }
2130
+ }
2131
+ }
2132
+ return s !== void 0 && r.push(new T(s)), { comments: n, items: r };
2133
+ }
2134
+ function Xo(t, e) {
2135
+ let n = [], r = [], s, i = false, o = "{";
2136
+ for (let a = 0; a < e.items.length; ++a) {
2137
+ let c = e.items[a];
2138
+ if (typeof c.char == "string") {
2139
+ let { char: l, offset: f } = c;
2140
+ if (l === "?" && s === void 0 && !i) {
2141
+ i = true, o = ":";
2142
+ continue;
2143
+ }
2144
+ if (l === ":") {
2145
+ if (s === void 0 && (s = null), o === ":") {
2146
+ o = ",";
2147
+ continue;
2148
+ }
2149
+ } else if (i && (s === void 0 && l !== "," && (s = null), i = false), s !== void 0 && (r.push(new T(s)), s = void 0, l === ",")) {
2150
+ o = ":";
2151
+ continue;
2152
+ }
2153
+ if (l === "}") {
2154
+ if (a === e.items.length - 1) continue;
2155
+ } else if (l === o) {
2156
+ o = ":";
2157
+ continue;
2158
+ }
2159
+ let m = `Flow map contains an unexpected ${l}`, d = new p.YAMLSyntaxError(e, m);
2160
+ d.offset = f, t.errors.push(d);
2161
+ } else c.type === p.Type.BLANK_LINE ? n.push({ afterKey: !!s, before: r.length }) : c.type === p.Type.COMMENT ? (Ks(t.errors, c), n.push({ afterKey: !!s, before: r.length, comment: c.comment })) : s === void 0 ? (o === "," && t.errors.push(new p.YAMLSemanticError(c, "Separator , missing in flow map")), s = me(t, c)) : (o !== "," && t.errors.push(new p.YAMLSemanticError(c, "Indicator : missing in flow map entry")), r.push(new T(s, me(t, c))), s = void 0, i = false);
2162
+ }
2163
+ return Us(t.errors, e), s !== void 0 && r.push(new T(s)), { comments: n, items: r };
2164
+ }
2165
+ function zo(t, e) {
2166
+ if (e.type !== p.Type.SEQ && e.type !== p.Type.FLOW_SEQ) {
2167
+ let i = `A ${e.type} node cannot be resolved as a sequence`;
2168
+ return t.errors.push(new p.YAMLSyntaxError(e, i)), null;
2169
+ }
2170
+ let { comments: n, items: r } = e.type === p.Type.FLOW_SEQ ? ea(t, e) : Zo(t, e), s = new pe();
2171
+ if (s.items = r, Ws(s, n), !t.options.mapAsMap && r.some((i) => i instanceof T && i.key instanceof W)) {
2172
+ let i = "Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";
2173
+ t.warnings.push(new p.YAMLWarning(e, i));
2174
+ }
2175
+ return e.resolved = s, s;
2176
+ }
2177
+ function Zo(t, e) {
2178
+ let n = [], r = [];
2179
+ for (let s = 0; s < e.items.length; ++s) {
2180
+ let i = e.items[s];
2181
+ switch (i.type) {
2182
+ case p.Type.BLANK_LINE:
2183
+ n.push({ before: r.length });
2184
+ break;
2185
+ case p.Type.COMMENT:
2186
+ n.push({ comment: i.comment, before: r.length });
2187
+ break;
2188
+ case p.Type.SEQ_ITEM:
2189
+ if (i.error && t.errors.push(i.error), r.push(me(t, i.node)), i.hasProps) {
2190
+ let o = "Sequence items cannot have tags or anchors before the - indicator";
2191
+ t.errors.push(new p.YAMLSemanticError(i, o));
2192
+ }
2193
+ break;
2194
+ default:
2195
+ i.error && t.errors.push(i.error), t.errors.push(new p.YAMLSyntaxError(i, `Unexpected ${i.type} node in sequence`));
2196
+ }
2197
+ }
2198
+ return { comments: n, items: r };
2199
+ }
2200
+ function ea(t, e) {
2201
+ let n = [], r = [], s = false, i, o = null, a = "[", c = null;
2202
+ for (let l = 0; l < e.items.length; ++l) {
2203
+ let f = e.items[l];
2204
+ if (typeof f.char == "string") {
2205
+ let { char: m, offset: d } = f;
2206
+ if (m !== ":" && (s || i !== void 0) && (s && i === void 0 && (i = a ? r.pop() : null), r.push(new T(i)), s = false, i = void 0, o = null), m === a) a = null;
2207
+ else if (!a && m === "?") s = true;
2208
+ else if (a !== "[" && m === ":" && i === void 0) {
2209
+ if (a === ",") {
2210
+ if (i = r.pop(), i instanceof T) {
2211
+ let y = "Chaining flow sequence pairs is invalid", h = new p.YAMLSemanticError(e, y);
2212
+ h.offset = d, t.errors.push(h);
2213
+ }
2214
+ if (!s && typeof o == "number") {
2215
+ let y = f.range ? f.range.start : f.offset;
2216
+ y > o + 1024 && t.errors.push(Vs(e, i));
2217
+ let { src: h } = c.context;
2218
+ for (let g = o; g < y; ++g) if (h[g] === `
2219
+ `) {
2220
+ let w = "Implicit keys of flow sequence pairs need to be on a single line";
2221
+ t.errors.push(new p.YAMLSemanticError(c, w));
2222
+ break;
2223
+ }
2224
+ }
2225
+ } else i = null;
2226
+ o = null, s = false, a = null;
2227
+ } else if (a === "[" || m !== "]" || l < e.items.length - 1) {
2228
+ let y = `Flow sequence contains an unexpected ${m}`, h = new p.YAMLSyntaxError(e, y);
2229
+ h.offset = d, t.errors.push(h);
2230
+ }
2231
+ } else if (f.type === p.Type.BLANK_LINE) n.push({ before: r.length });
2232
+ else if (f.type === p.Type.COMMENT) Ks(t.errors, f), n.push({ comment: f.comment, before: r.length });
2233
+ else {
2234
+ if (a) {
2235
+ let d = `Expected a ${a} in flow sequence`;
2236
+ t.errors.push(new p.YAMLSemanticError(f, d));
2237
+ }
2238
+ let m = me(t, f);
2239
+ i === void 0 ? (r.push(m), c = f) : (r.push(new T(i, m)), i = void 0), o = f.range.start, a = ",";
2240
+ }
2241
+ }
2242
+ return Us(t.errors, e), i !== void 0 && r.push(new T(i)), { comments: n, items: r };
2243
+ }
2244
+ k.Alias = we;
2245
+ k.Collection = W;
2246
+ k.Merge = Vt;
2247
+ k.Node = V;
2248
+ k.Pair = T;
2249
+ k.Scalar = P;
2250
+ k.YAMLMap = mt;
2251
+ k.YAMLSeq = pe;
2252
+ k.addComment = Be;
2253
+ k.binaryOptions = Po;
2254
+ k.boolOptions = _o;
2255
+ k.findPair = pt;
2256
+ k.intOptions = xo;
2257
+ k.isEmptyPath = Bs;
2258
+ k.nullOptions = Ro;
2259
+ k.resolveMap = Qo;
2260
+ k.resolveNode = me;
2261
+ k.resolveSeq = zo;
2262
+ k.resolveString = Un;
2263
+ k.strOptions = be;
2264
+ k.stringifyNumber = $o;
2265
+ k.stringifyString = Bo;
2266
+ k.toJSON = ue;
2267
+ });
2268
+ var jn = ee((z) => {
2269
+ "use strict";
2270
+ var j = le(), O = $e(), ta = { identify: (t) => t instanceof Uint8Array, default: false, tag: "tag:yaml.org,2002:binary", resolve: (t, e) => {
2271
+ let n = O.resolveString(t, e);
2272
+ if (typeof Buffer == "function") return Buffer.from(n, "base64");
2273
+ if (typeof atob == "function") {
2274
+ let r = atob(n.replace(/[\n\r]/g, "")), s = new Uint8Array(r.length);
2275
+ for (let i = 0; i < r.length; ++i) s[i] = r.charCodeAt(i);
2276
+ return s;
2277
+ } else {
2278
+ let r = "This environment does not support reading binary tags; either Buffer or atob is required";
2279
+ return t.errors.push(new j.YAMLReferenceError(e, r)), null;
2280
+ }
2281
+ }, options: O.binaryOptions, stringify: ({ comment: t, type: e, value: n }, r, s, i) => {
2282
+ let o;
2283
+ if (typeof Buffer == "function") o = n instanceof Buffer ? n.toString("base64") : Buffer.from(n.buffer).toString("base64");
2284
+ else if (typeof btoa == "function") {
2285
+ let a = "";
2286
+ for (let c = 0; c < n.length; ++c) a += String.fromCharCode(n[c]);
2287
+ o = btoa(a);
2288
+ } else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");
2289
+ if (e || (e = O.binaryOptions.defaultType), e === j.Type.QUOTE_DOUBLE) n = o;
2290
+ else {
2291
+ let { lineWidth: a } = O.binaryOptions, c = Math.ceil(o.length / a), l = new Array(c);
2292
+ for (let f = 0, m = 0; f < c; ++f, m += a) l[f] = o.substr(m, a);
2293
+ n = l.join(e === j.Type.BLOCK_LITERAL ? `
2294
+ ` : " ");
2295
+ }
2296
+ return O.stringifyString({ comment: t, type: e, value: n }, r, s, i);
2297
+ } };
2298
+ function Qs(t, e) {
2299
+ let n = O.resolveSeq(t, e);
2300
+ for (let r = 0; r < n.items.length; ++r) {
2301
+ let s = n.items[r];
2302
+ if (!(s instanceof O.Pair)) {
2303
+ if (s instanceof O.YAMLMap) {
2304
+ if (s.items.length > 1) {
2305
+ let o = "Each pair must have its own sequence indicator";
2306
+ throw new j.YAMLSemanticError(e, o);
2307
+ }
2308
+ let i = s.items[0] || new O.Pair();
2309
+ s.commentBefore && (i.commentBefore = i.commentBefore ? `${s.commentBefore}
2310
+ ${i.commentBefore}` : s.commentBefore), s.comment && (i.comment = i.comment ? `${s.comment}
2311
+ ${i.comment}` : s.comment), s = i;
2312
+ }
2313
+ n.items[r] = s instanceof O.Pair ? s : new O.Pair(s);
2314
+ }
2315
+ }
2316
+ return n;
2317
+ }
2318
+ function Js(t, e, n) {
2319
+ let r = new O.YAMLSeq(t);
2320
+ r.tag = "tag:yaml.org,2002:pairs";
2321
+ for (let s of e) {
2322
+ let i, o;
2323
+ if (Array.isArray(s)) if (s.length === 2) i = s[0], o = s[1];
2324
+ else throw new TypeError(`Expected [key, value] tuple: ${s}`);
2325
+ else if (s && s instanceof Object) {
2326
+ let c = Object.keys(s);
2327
+ if (c.length === 1) i = c[0], o = s[i];
2328
+ else throw new TypeError(`Expected { key: value } tuple: ${s}`);
2329
+ } else i = s;
2330
+ let a = t.createPair(i, o, n);
2331
+ r.items.push(a);
2332
+ }
2333
+ return r;
2334
+ }
2335
+ var na = { default: false, tag: "tag:yaml.org,2002:pairs", resolve: Qs, createNode: Js }, Fe = class t extends O.YAMLSeq {
2336
+ constructor() {
2337
+ super(), j._defineProperty(this, "add", O.YAMLMap.prototype.add.bind(this)), j._defineProperty(this, "delete", O.YAMLMap.prototype.delete.bind(this)), j._defineProperty(this, "get", O.YAMLMap.prototype.get.bind(this)), j._defineProperty(this, "has", O.YAMLMap.prototype.has.bind(this)), j._defineProperty(this, "set", O.YAMLMap.prototype.set.bind(this)), this.tag = t.tag;
2338
+ }
2339
+ toJSON(e, n) {
2340
+ let r = /* @__PURE__ */ new Map();
2341
+ n && n.onCreate && n.onCreate(r);
2342
+ for (let s of this.items) {
2343
+ let i, o;
2344
+ if (s instanceof O.Pair ? (i = O.toJSON(s.key, "", n), o = O.toJSON(s.value, i, n)) : i = O.toJSON(s, "", n), r.has(i)) throw new Error("Ordered maps must not include duplicate keys");
2345
+ r.set(i, o);
2346
+ }
2347
+ return r;
2348
+ }
2349
+ };
2350
+ j._defineProperty(Fe, "tag", "tag:yaml.org,2002:omap");
2351
+ function ra(t, e) {
2352
+ let n = Qs(t, e), r = [];
2353
+ for (let { key: s } of n.items) if (s instanceof O.Scalar) if (r.includes(s.value)) {
2354
+ let i = "Ordered maps must not include duplicate keys";
2355
+ throw new j.YAMLSemanticError(e, i);
2356
+ } else r.push(s.value);
2357
+ return Object.assign(new Fe(), n);
2358
+ }
2359
+ function sa(t, e, n) {
2360
+ let r = Js(t, e, n), s = new Fe();
2361
+ return s.items = r.items, s;
2362
+ }
2363
+ var ia = { identify: (t) => t instanceof Map, nodeClass: Fe, default: false, tag: "tag:yaml.org,2002:omap", resolve: ra, createNode: sa }, qe = class t extends O.YAMLMap {
2364
+ constructor() {
2365
+ super(), this.tag = t.tag;
2366
+ }
2367
+ add(e) {
2368
+ let n = e instanceof O.Pair ? e : new O.Pair(e);
2369
+ O.findPair(this.items, n.key) || this.items.push(n);
2370
+ }
2371
+ get(e, n) {
2372
+ let r = O.findPair(this.items, e);
2373
+ return !n && r instanceof O.Pair ? r.key instanceof O.Scalar ? r.key.value : r.key : r;
2374
+ }
2375
+ set(e, n) {
2376
+ if (typeof n != "boolean") throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);
2377
+ let r = O.findPair(this.items, e);
2378
+ r && !n ? this.items.splice(this.items.indexOf(r), 1) : !r && n && this.items.push(new O.Pair(e));
2379
+ }
2380
+ toJSON(e, n) {
2381
+ return super.toJSON(e, n, Set);
2382
+ }
2383
+ toString(e, n, r) {
2384
+ if (!e) return JSON.stringify(this);
2385
+ if (this.hasAllNullValues()) return super.toString(e, n, r);
2386
+ throw new Error("Set items must all have null values");
2387
+ }
2388
+ };
2389
+ j._defineProperty(qe, "tag", "tag:yaml.org,2002:set");
2390
+ function oa(t, e) {
2391
+ let n = O.resolveMap(t, e);
2392
+ if (!n.hasAllNullValues()) throw new j.YAMLSemanticError(e, "Set items must all have null values");
2393
+ return Object.assign(new qe(), n);
2394
+ }
2395
+ function aa(t, e, n) {
2396
+ let r = new qe();
2397
+ for (let s of e) r.items.push(t.createPair(s, null, n));
2398
+ return r;
2399
+ }
2400
+ var ca = { identify: (t) => t instanceof Set, nodeClass: qe, default: false, tag: "tag:yaml.org,2002:set", resolve: oa, createNode: aa }, Kn = (t, e) => {
2401
+ let n = e.split(":").reduce((r, s) => r * 60 + Number(s), 0);
2402
+ return t === "-" ? -n : n;
2403
+ }, Gs = ({ value: t }) => {
2404
+ if (isNaN(t) || !isFinite(t)) return O.stringifyNumber(t);
2405
+ let e = "";
2406
+ t < 0 && (e = "-", t = Math.abs(t));
2407
+ let n = [t % 60];
2408
+ return t < 60 ? n.unshift(0) : (t = Math.round((t - n[0]) / 60), n.unshift(t % 60), t >= 60 && (t = Math.round((t - n[0]) / 60), n.unshift(t))), e + n.map((r) => r < 10 ? "0" + String(r) : String(r)).join(":").replace(/000000\d*$/, "");
2409
+ }, la = { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:int", format: "TIME", test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/, resolve: (t, e, n) => Kn(e, n.replace(/_/g, "")), stringify: Gs }, fa = { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", format: "TIME", test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/, resolve: (t, e, n) => Kn(e, n.replace(/_/g, "")), stringify: Gs }, ua = { identify: (t) => t instanceof Date, default: true, tag: "tag:yaml.org,2002:timestamp", 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})?))?)?)$"), resolve: (t, e, n, r, s, i, o, a, c) => {
2410
+ a && (a = (a + "00").substr(1, 3));
2411
+ let l = Date.UTC(e, n - 1, r, s || 0, i || 0, o || 0, a || 0);
2412
+ if (c && c !== "Z") {
2413
+ let f = Kn(c[0], c.slice(1));
2414
+ Math.abs(f) < 30 && (f *= 60), l -= 6e4 * f;
2415
+ }
2416
+ return new Date(l);
2417
+ }, stringify: ({ value: t }) => t.toISOString().replace(/((T00:00)?:00)?\.000Z$/, "") };
2418
+ function Vn(t) {
2419
+ let e = {};
2420
+ return t ? typeof YAML_SILENCE_DEPRECATION_WARNINGS < "u" ? !YAML_SILENCE_DEPRECATION_WARNINGS : !e.YAML_SILENCE_DEPRECATION_WARNINGS : typeof YAML_SILENCE_WARNINGS < "u" ? !YAML_SILENCE_WARNINGS : !e.YAML_SILENCE_WARNINGS;
2421
+ }
2422
+ function Wn(t, e) {
2423
+ Vn(false) && console.warn(e ? `${e}: ${t}` : t);
2424
+ }
2425
+ function pa(t) {
2426
+ if (Vn(true)) {
2427
+ let e = t.replace(/.*yaml[/\\]/i, "").replace(/\.js$/, "").replace(/\\/g, "/");
2428
+ Wn(`The endpoint 'yaml/${e}' will be removed in a future release.`, "DeprecationWarning");
2429
+ }
2430
+ }
2431
+ var js = {};
2432
+ function ma(t, e) {
2433
+ if (!js[t] && Vn(true)) {
2434
+ js[t] = true;
2435
+ let n = `The option '${t}' will be removed in a future release`;
2436
+ n += e ? `, use '${e}' instead.` : ".", Wn(n, "DeprecationWarning");
2437
+ }
2438
+ }
2439
+ z.binary = ta;
2440
+ z.floatTime = fa;
2441
+ z.intTime = la;
2442
+ z.omap = ia;
2443
+ z.pairs = na;
2444
+ z.set = ca;
2445
+ z.timestamp = ua;
2446
+ z.warn = Wn;
2447
+ z.warnFileDeprecation = pa;
2448
+ z.warnOptionDeprecation = ma;
2449
+ });
2450
+ var Hn = ee((ci) => {
2451
+ "use strict";
2452
+ var Gt = le(), E = $e(), D = jn();
2453
+ function ha(t, e, n) {
2454
+ let r = new E.YAMLMap(t);
2455
+ if (e instanceof Map) for (let [s, i] of e) r.items.push(t.createPair(s, i, n));
2456
+ else if (e && typeof e == "object") for (let s of Object.keys(e)) r.items.push(t.createPair(s, e[s], n));
2457
+ return typeof t.sortMapEntries == "function" && r.items.sort(t.sortMapEntries), r;
2458
+ }
2459
+ var gt = { createNode: ha, default: true, nodeClass: E.YAMLMap, tag: "tag:yaml.org,2002:map", resolve: E.resolveMap };
2460
+ function ga(t, e, n) {
2461
+ let r = new E.YAMLSeq(t);
2462
+ if (e && e[Symbol.iterator]) for (let s of e) {
2463
+ let i = t.createNode(s, n.wrapScalars, null, n);
2464
+ r.items.push(i);
2465
+ }
2466
+ return r;
2467
+ }
2468
+ var Ht = { createNode: ga, default: true, nodeClass: E.YAMLSeq, tag: "tag:yaml.org,2002:seq", resolve: E.resolveSeq }, da = { identify: (t) => typeof t == "string", default: true, tag: "tag:yaml.org,2002:str", resolve: E.resolveString, stringify(t, e, n, r) {
2469
+ return e = Object.assign({ actualString: true }, e), E.stringifyString(t, e, n, r);
2470
+ }, options: E.strOptions }, Jn = [gt, Ht, da], Xt = (t) => typeof t == "bigint" || Number.isInteger(t), Gn = (t, e, n) => E.intOptions.asBigInt ? BigInt(t) : parseInt(e, n);
2471
+ function zs(t, e, n) {
2472
+ let { value: r } = t;
2473
+ return Xt(r) && r >= 0 ? n + r.toString(e) : E.stringifyNumber(t);
2474
+ }
2475
+ var Zs = { identify: (t) => t == null, createNode: (t, e, n) => n.wrapScalars ? new E.Scalar(null) : null, default: true, tag: "tag:yaml.org,2002:null", test: /^(?:~|[Nn]ull|NULL)?$/, resolve: () => null, options: E.nullOptions, stringify: () => E.nullOptions.nullStr }, ei = { identify: (t) => typeof t == "boolean", default: true, tag: "tag:yaml.org,2002:bool", test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/, resolve: (t) => t[0] === "t" || t[0] === "T", options: E.boolOptions, stringify: ({ value: t }) => t ? E.boolOptions.trueStr : E.boolOptions.falseStr }, ti = { identify: (t) => Xt(t) && t >= 0, default: true, tag: "tag:yaml.org,2002:int", format: "OCT", test: /^0o([0-7]+)$/, resolve: (t, e) => Gn(t, e, 8), options: E.intOptions, stringify: (t) => zs(t, 8, "0o") }, ni = { identify: Xt, default: true, tag: "tag:yaml.org,2002:int", test: /^[-+]?[0-9]+$/, resolve: (t) => Gn(t, t, 10), options: E.intOptions, stringify: E.stringifyNumber }, ri = { identify: (t) => Xt(t) && t >= 0, default: true, tag: "tag:yaml.org,2002:int", format: "HEX", test: /^0x([0-9a-fA-F]+)$/, resolve: (t, e) => Gn(t, e, 16), options: E.intOptions, stringify: (t) => zs(t, 16, "0x") }, si = { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", test: /^(?:[-+]?\.inf|(\.nan))$/i, resolve: (t, e) => e ? NaN : t[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, stringify: E.stringifyNumber }, ii = { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", format: "EXP", test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/, resolve: (t) => parseFloat(t), stringify: ({ value: t }) => Number(t).toExponential() }, oi = { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", test: /^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/, resolve(t, e, n) {
2476
+ let r = e || n, s = new E.Scalar(parseFloat(t));
2477
+ return r && r[r.length - 1] === "0" && (s.minFractionDigits = r.length), s;
2478
+ }, stringify: E.stringifyNumber }, ya = Jn.concat([Zs, ei, ti, ni, ri, si, ii, oi]), Hs = (t) => typeof t == "bigint" || Number.isInteger(t), Qt = ({ value: t }) => JSON.stringify(t), ai = [gt, Ht, { identify: (t) => typeof t == "string", default: true, tag: "tag:yaml.org,2002:str", resolve: E.resolveString, stringify: Qt }, { identify: (t) => t == null, createNode: (t, e, n) => n.wrapScalars ? new E.Scalar(null) : null, default: true, tag: "tag:yaml.org,2002:null", test: /^null$/, resolve: () => null, stringify: Qt }, { identify: (t) => typeof t == "boolean", default: true, tag: "tag:yaml.org,2002:bool", test: /^true|false$/, resolve: (t) => t === "true", stringify: Qt }, { identify: Hs, default: true, tag: "tag:yaml.org,2002:int", test: /^-?(?:0|[1-9][0-9]*)$/, resolve: (t) => E.intOptions.asBigInt ? BigInt(t) : parseInt(t, 10), stringify: ({ value: t }) => Hs(t) ? t.toString() : JSON.stringify(t) }, { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/, resolve: (t) => parseFloat(t), stringify: Qt }];
2479
+ ai.scalarFallback = (t) => {
2480
+ throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(t)}`);
2481
+ };
2482
+ var Xs = ({ value: t }) => t ? E.boolOptions.trueStr : E.boolOptions.falseStr, ht = (t) => typeof t == "bigint" || Number.isInteger(t);
2483
+ function Jt(t, e, n) {
2484
+ let r = e.replace(/_/g, "");
2485
+ if (E.intOptions.asBigInt) {
2486
+ switch (n) {
2487
+ case 2:
2488
+ r = `0b${r}`;
2489
+ break;
2490
+ case 8:
2491
+ r = `0o${r}`;
2492
+ break;
2493
+ case 16:
2494
+ r = `0x${r}`;
2495
+ break;
2496
+ }
2497
+ let i = BigInt(r);
2498
+ return t === "-" ? BigInt(-1) * i : i;
2499
+ }
2500
+ let s = parseInt(r, n);
2501
+ return t === "-" ? -1 * s : s;
2502
+ }
2503
+ function Qn(t, e, n) {
2504
+ let { value: r } = t;
2505
+ if (ht(r)) {
2506
+ let s = r.toString(e);
2507
+ return r < 0 ? "-" + n + s.substr(1) : n + s;
2508
+ }
2509
+ return E.stringifyNumber(t);
2510
+ }
2511
+ var Ea = Jn.concat([{ identify: (t) => t == null, createNode: (t, e, n) => n.wrapScalars ? new E.Scalar(null) : null, default: true, tag: "tag:yaml.org,2002:null", test: /^(?:~|[Nn]ull|NULL)?$/, resolve: () => null, options: E.nullOptions, stringify: () => E.nullOptions.nullStr }, { identify: (t) => typeof t == "boolean", default: true, tag: "tag:yaml.org,2002:bool", test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/, resolve: () => true, options: E.boolOptions, stringify: Xs }, { identify: (t) => typeof t == "boolean", default: true, tag: "tag:yaml.org,2002:bool", test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i, resolve: () => false, options: E.boolOptions, stringify: Xs }, { identify: ht, default: true, tag: "tag:yaml.org,2002:int", format: "BIN", test: /^([-+]?)0b([0-1_]+)$/, resolve: (t, e, n) => Jt(e, n, 2), stringify: (t) => Qn(t, 2, "0b") }, { identify: ht, default: true, tag: "tag:yaml.org,2002:int", format: "OCT", test: /^([-+]?)0([0-7_]+)$/, resolve: (t, e, n) => Jt(e, n, 8), stringify: (t) => Qn(t, 8, "0") }, { identify: ht, default: true, tag: "tag:yaml.org,2002:int", test: /^([-+]?)([0-9][0-9_]*)$/, resolve: (t, e, n) => Jt(e, n, 10), stringify: E.stringifyNumber }, { identify: ht, default: true, tag: "tag:yaml.org,2002:int", format: "HEX", test: /^([-+]?)0x([0-9a-fA-F_]+)$/, resolve: (t, e, n) => Jt(e, n, 16), stringify: (t) => Qn(t, 16, "0x") }, { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", test: /^(?:[-+]?\.inf|(\.nan))$/i, resolve: (t, e) => e ? NaN : t[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, stringify: E.stringifyNumber }, { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", format: "EXP", test: /^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/, resolve: (t) => parseFloat(t.replace(/_/g, "")), stringify: ({ value: t }) => Number(t).toExponential() }, { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", test: /^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/, resolve(t, e) {
2512
+ let n = new E.Scalar(parseFloat(t.replace(/_/g, "")));
2513
+ if (e) {
2514
+ let r = e.replace(/_/g, "");
2515
+ r[r.length - 1] === "0" && (n.minFractionDigits = r.length);
2516
+ }
2517
+ return n;
2518
+ }, stringify: E.stringifyNumber }], D.binary, D.omap, D.pairs, D.set, D.intTime, D.floatTime, D.timestamp), Sa = { core: ya, failsafe: Jn, json: ai, yaml11: Ea }, wa = { binary: D.binary, bool: ei, float: oi, floatExp: ii, floatNaN: si, floatTime: D.floatTime, int: ni, intHex: ri, intOct: ti, intTime: D.intTime, map: gt, null: Zs, omap: D.omap, pairs: D.pairs, seq: Ht, set: D.set, timestamp: D.timestamp };
2519
+ function ba(t, e, n) {
2520
+ if (e) {
2521
+ let r = n.filter((i) => i.tag === e), s = r.find((i) => !i.format) || r[0];
2522
+ if (!s) throw new Error(`Tag ${e} not found`);
2523
+ return s;
2524
+ }
2525
+ return n.find((r) => (r.identify && r.identify(t) || r.class && t instanceof r.class) && !r.format);
2526
+ }
2527
+ function Na(t, e, n) {
2528
+ if (t instanceof E.Node) return t;
2529
+ let { defaultPrefix: r, onTagObj: s, prevObjects: i, schema: o, wrapScalars: a } = n;
2530
+ e && e.startsWith("!!") && (e = r + e.slice(2));
2531
+ let c = ba(t, e, o.tags);
2532
+ if (!c) {
2533
+ if (typeof t.toJSON == "function" && (t = t.toJSON()), !t || typeof t != "object") return a ? new E.Scalar(t) : t;
2534
+ c = t instanceof Map ? gt : t[Symbol.iterator] ? Ht : gt;
2535
+ }
2536
+ s && (s(c), delete n.onTagObj);
2537
+ let l = { value: void 0, node: void 0 };
2538
+ if (t && typeof t == "object" && i) {
2539
+ let f = i.get(t);
2540
+ if (f) {
2541
+ let m = new E.Alias(f);
2542
+ return n.aliasNodes.push(m), m;
2543
+ }
2544
+ l.value = t, i.set(t, l);
2545
+ }
2546
+ return l.node = c.createNode ? c.createNode(n.schema, t, n) : a ? new E.Scalar(t) : t, e && l.node instanceof E.Node && (l.node.tag = e), l.node;
2547
+ }
2548
+ function Oa(t, e, n, r) {
2549
+ let s = t[r.replace(/\W/g, "")];
2550
+ if (!s) {
2551
+ let i = Object.keys(t).map((o) => JSON.stringify(o)).join(", ");
2552
+ throw new Error(`Unknown schema "${r}"; use one of ${i}`);
2553
+ }
2554
+ if (Array.isArray(n)) for (let i of n) s = s.concat(i);
2555
+ else typeof n == "function" && (s = n(s.slice()));
2556
+ for (let i = 0; i < s.length; ++i) {
2557
+ let o = s[i];
2558
+ if (typeof o == "string") {
2559
+ let a = e[o];
2560
+ if (!a) {
2561
+ let c = Object.keys(e).map((l) => JSON.stringify(l)).join(", ");
2562
+ throw new Error(`Unknown custom tag "${o}"; use one of ${c}`);
2563
+ }
2564
+ s[i] = a;
2565
+ }
2566
+ }
2567
+ return s;
2568
+ }
2569
+ var La = (t, e) => t.key < e.key ? -1 : t.key > e.key ? 1 : 0, dt = class t {
2570
+ constructor({ customTags: e, merge: n, schema: r, sortMapEntries: s, tags: i }) {
2571
+ this.merge = !!n, this.name = r, this.sortMapEntries = s === true ? La : s || null, !e && i && D.warnOptionDeprecation("tags", "customTags"), this.tags = Oa(Sa, wa, e || i, r);
2572
+ }
2573
+ createNode(e, n, r, s) {
2574
+ let i = { defaultPrefix: t.defaultPrefix, schema: this, wrapScalars: n }, o = s ? Object.assign(s, i) : i;
2575
+ return Na(e, r, o);
2576
+ }
2577
+ createPair(e, n, r) {
2578
+ r || (r = { wrapScalars: true });
2579
+ let s = this.createNode(e, r.wrapScalars, null, r), i = this.createNode(n, r.wrapScalars, null, r);
2580
+ return new E.Pair(s, i);
2581
+ }
2582
+ };
2583
+ Gt._defineProperty(dt, "defaultPrefix", Gt.defaultTagPrefix);
2584
+ Gt._defineProperty(dt, "defaultTags", Gt.defaultTags);
2585
+ ci.Schema = dt;
2586
+ });
2587
+ var pi = ee((tn) => {
2588
+ "use strict";
2589
+ var Y = le(), S = $e(), li = Hn(), Aa = { anchorPrefix: "a", customTags: null, indent: 2, indentSeq: true, keepCstNodes: false, keepNodeTypes: true, keepBlobsInJSON: true, mapAsMap: false, maxAliasCount: 100, prettyErrors: false, simpleKeys: false, version: "1.2" }, Ta = { get binary() {
2590
+ return S.binaryOptions;
2591
+ }, set binary(t) {
2592
+ Object.assign(S.binaryOptions, t);
2593
+ }, get bool() {
2594
+ return S.boolOptions;
2595
+ }, set bool(t) {
2596
+ Object.assign(S.boolOptions, t);
2597
+ }, get int() {
2598
+ return S.intOptions;
2599
+ }, set int(t) {
2600
+ Object.assign(S.intOptions, t);
2601
+ }, get null() {
2602
+ return S.nullOptions;
2603
+ }, set null(t) {
2604
+ Object.assign(S.nullOptions, t);
2605
+ }, get str() {
2606
+ return S.strOptions;
2607
+ }, set str(t) {
2608
+ Object.assign(S.strOptions, t);
2609
+ } }, ui = { "1.0": { schema: "yaml-1.1", merge: true, tagPrefixes: [{ handle: "!", prefix: Y.defaultTagPrefix }, { handle: "!!", prefix: "tag:private.yaml.org,2002:" }] }, 1.1: { schema: "yaml-1.1", merge: true, tagPrefixes: [{ handle: "!", prefix: "!" }, { handle: "!!", prefix: Y.defaultTagPrefix }] }, 1.2: { schema: "core", merge: false, tagPrefixes: [{ handle: "!", prefix: "!" }, { handle: "!!", prefix: Y.defaultTagPrefix }] } };
2610
+ function fi(t, e) {
2611
+ if ((t.version || t.options.version) === "1.0") {
2612
+ let s = e.match(/^tag:private\.yaml\.org,2002:([^:/]+)$/);
2613
+ if (s) return "!" + s[1];
2614
+ let i = e.match(/^tag:([a-zA-Z0-9-]+)\.yaml\.org,2002:(.*)/);
2615
+ return i ? `!${i[1]}/${i[2]}` : `!${e.replace(/^tag:/, "")}`;
2616
+ }
2617
+ let n = t.tagPrefixes.find((s) => e.indexOf(s.prefix) === 0);
2618
+ if (!n) {
2619
+ let s = t.getDefaults().tagPrefixes;
2620
+ n = s && s.find((i) => e.indexOf(i.prefix) === 0);
2621
+ }
2622
+ if (!n) return e[0] === "!" ? e : `!<${e}>`;
2623
+ let r = e.substr(n.prefix.length).replace(/[!,[\]{}]/g, (s) => ({ "!": "%21", ",": "%2C", "[": "%5B", "]": "%5D", "{": "%7B", "}": "%7D" })[s]);
2624
+ return n.handle + r;
2625
+ }
2626
+ function Ca(t, e) {
2627
+ if (e instanceof S.Alias) return S.Alias;
2628
+ if (e.tag) {
2629
+ let s = t.filter((i) => i.tag === e.tag);
2630
+ if (s.length > 0) return s.find((i) => i.format === e.format) || s[0];
2631
+ }
2632
+ let n, r;
2633
+ if (e instanceof S.Scalar) {
2634
+ r = e.value;
2635
+ let s = t.filter((i) => i.identify && i.identify(r) || i.class && r instanceof i.class);
2636
+ n = s.find((i) => i.format === e.format) || s.find((i) => !i.format);
2637
+ } else r = e, n = t.find((s) => s.nodeClass && r instanceof s.nodeClass);
2638
+ if (!n) {
2639
+ let s = r && r.constructor ? r.constructor.name : typeof r;
2640
+ throw new Error(`Tag not resolved for ${s} value`);
2641
+ }
2642
+ return n;
2643
+ }
2644
+ function Ma(t, e, { anchors: n, doc: r }) {
2645
+ let s = [], i = r.anchors.getName(t);
2646
+ return i && (n[i] = t, s.push(`&${i}`)), t.tag ? s.push(fi(r, t.tag)) : e.default || s.push(fi(r, e.tag)), s.join(" ");
2647
+ }
2648
+ function zt(t, e, n, r) {
2649
+ let { anchors: s, schema: i } = e.doc, o;
2650
+ if (!(t instanceof S.Node)) {
2651
+ let l = { aliasNodes: [], onTagObj: (f) => o = f, prevObjects: /* @__PURE__ */ new Map() };
2652
+ t = i.createNode(t, true, null, l);
2653
+ for (let f of l.aliasNodes) {
2654
+ f.source = f.source.node;
2655
+ let m = s.getName(f.source);
2656
+ m || (m = s.newName(), s.map[m] = f.source);
2657
+ }
2658
+ }
2659
+ if (t instanceof S.Pair) return t.toString(e, n, r);
2660
+ o || (o = Ca(i.tags, t));
2661
+ let a = Ma(t, o, e);
2662
+ a.length > 0 && (e.indentAtStart = (e.indentAtStart || 0) + a.length + 1);
2663
+ let c = typeof o.stringify == "function" ? o.stringify(t, e, n, r) : t instanceof S.Scalar ? S.stringifyString(t, e, n, r) : t.toString(e, n, r);
2664
+ return a ? t instanceof S.Scalar || c[0] === "{" || c[0] === "[" ? `${a} ${c}` : `${a}
2665
+ ${e.indent}${c}` : c;
2666
+ }
2667
+ var Xn = class t {
2668
+ static validAnchorNode(e) {
2669
+ return e instanceof S.Scalar || e instanceof S.YAMLSeq || e instanceof S.YAMLMap;
2670
+ }
2671
+ constructor(e) {
2672
+ Y._defineProperty(this, "map", /* @__PURE__ */ Object.create(null)), this.prefix = e;
2673
+ }
2674
+ createAlias(e, n) {
2675
+ return this.setAnchor(e, n), new S.Alias(e);
2676
+ }
2677
+ createMergePair(...e) {
2678
+ let n = new S.Merge();
2679
+ return n.value.items = e.map((r) => {
2680
+ if (r instanceof S.Alias) {
2681
+ if (r.source instanceof S.YAMLMap) return r;
2682
+ } else if (r instanceof S.YAMLMap) return this.createAlias(r);
2683
+ throw new Error("Merge sources must be Map nodes or their Aliases");
2684
+ }), n;
2685
+ }
2686
+ getName(e) {
2687
+ let { map: n } = this;
2688
+ return Object.keys(n).find((r) => n[r] === e);
2689
+ }
2690
+ getNames() {
2691
+ return Object.keys(this.map);
2692
+ }
2693
+ getNode(e) {
2694
+ return this.map[e];
2695
+ }
2696
+ newName(e) {
2697
+ e || (e = this.prefix);
2698
+ let n = Object.keys(this.map);
2699
+ for (let r = 1; ; ++r) {
2700
+ let s = `${e}${r}`;
2701
+ if (!n.includes(s)) return s;
2702
+ }
2703
+ }
2704
+ resolveNodes() {
2705
+ let { map: e, _cstAliases: n } = this;
2706
+ Object.keys(e).forEach((r) => {
2707
+ e[r] = e[r].resolved;
2708
+ }), n.forEach((r) => {
2709
+ r.source = r.source.resolved;
2710
+ }), delete this._cstAliases;
2711
+ }
2712
+ setAnchor(e, n) {
2713
+ if (e != null && !t.validAnchorNode(e)) throw new Error("Anchors may only be set for Scalar, Seq and Map nodes");
2714
+ if (n && /[\x00-\x19\s,[\]{}]/.test(n)) throw new Error("Anchor names must not contain whitespace or control characters");
2715
+ let { map: r } = this, s = e && Object.keys(r).find((i) => r[i] === e);
2716
+ if (s) if (n) s !== n && (delete r[s], r[n] = e);
2717
+ else return s;
2718
+ else {
2719
+ if (!n) {
2720
+ if (!e) return null;
2721
+ n = this.newName();
2722
+ }
2723
+ r[n] = e;
2724
+ }
2725
+ return n;
2726
+ }
2727
+ }, Zt = (t, e) => {
2728
+ if (t && typeof t == "object") {
2729
+ let { tag: n } = t;
2730
+ t instanceof S.Collection ? (n && (e[n] = true), t.items.forEach((r) => Zt(r, e))) : t instanceof S.Pair ? (Zt(t.key, e), Zt(t.value, e)) : t instanceof S.Scalar && n && (e[n] = true);
2731
+ }
2732
+ return e;
2733
+ }, ka = (t) => Object.keys(Zt(t, {}));
2734
+ function va(t, e) {
2735
+ let n = { before: [], after: [] }, r, s = false;
2736
+ for (let i of e) if (i.valueRange) {
2737
+ if (r !== void 0) {
2738
+ let a = "Document contains trailing content not separated by a ... or --- line";
2739
+ t.errors.push(new Y.YAMLSyntaxError(i, a));
2740
+ break;
2741
+ }
2742
+ let o = S.resolveNode(t, i);
2743
+ s && (o.spaceBefore = true, s = false), r = o;
2744
+ } else i.comment !== null ? (r === void 0 ? n.before : n.after).push(i.comment) : i.type === Y.Type.BLANK_LINE && (s = true, r === void 0 && n.before.length > 0 && !t.commentBefore && (t.commentBefore = n.before.join(`
2745
+ `), n.before = []));
2746
+ if (t.contents = r || null, !r) t.comment = n.before.concat(n.after).join(`
2747
+ `) || null;
2748
+ else {
2749
+ let i = n.before.join(`
2750
+ `);
2751
+ if (i) {
2752
+ let o = r instanceof S.Collection && r.items[0] ? r.items[0] : r;
2753
+ o.commentBefore = o.commentBefore ? `${i}
2754
+ ${o.commentBefore}` : i;
2755
+ }
2756
+ t.comment = n.after.join(`
2757
+ `) || null;
2758
+ }
2759
+ }
2760
+ function Ia({ tagPrefixes: t }, e) {
2761
+ let [n, r] = e.parameters;
2762
+ if (!n || !r) {
2763
+ let s = "Insufficient parameters given for %TAG directive";
2764
+ throw new Y.YAMLSemanticError(e, s);
2765
+ }
2766
+ if (t.some((s) => s.handle === n)) {
2767
+ let s = "The %TAG directive must only be given at most once per handle in the same document.";
2768
+ throw new Y.YAMLSemanticError(e, s);
2769
+ }
2770
+ return { handle: n, prefix: r };
2771
+ }
2772
+ function Pa(t, e) {
2773
+ let [n] = e.parameters;
2774
+ if (e.name === "YAML:1.0" && (n = "1.0"), !n) {
2775
+ let r = "Insufficient parameters given for %YAML directive";
2776
+ throw new Y.YAMLSemanticError(e, r);
2777
+ }
2778
+ if (!ui[n]) {
2779
+ let s = `Document will be parsed as YAML ${t.version || t.options.version} rather than YAML ${n}`;
2780
+ t.warnings.push(new Y.YAMLWarning(e, s));
2781
+ }
2782
+ return n;
2783
+ }
2784
+ function _a(t, e, n) {
2785
+ let r = [], s = false;
2786
+ for (let i of e) {
2787
+ let { comment: o, name: a } = i;
2788
+ switch (a) {
2789
+ case "TAG":
2790
+ try {
2791
+ t.tagPrefixes.push(Ia(t, i));
2792
+ } catch (c) {
2793
+ t.errors.push(c);
2794
+ }
2795
+ s = true;
2796
+ break;
2797
+ case "YAML":
2798
+ case "YAML:1.0":
2799
+ if (t.version) {
2800
+ let c = "The %YAML directive must only be given at most once per document.";
2801
+ t.errors.push(new Y.YAMLSemanticError(i, c));
2802
+ }
2803
+ try {
2804
+ t.version = Pa(t, i);
2805
+ } catch (c) {
2806
+ t.errors.push(c);
2807
+ }
2808
+ s = true;
2809
+ break;
2810
+ default:
2811
+ if (a) {
2812
+ let c = `YAML only supports %TAG and %YAML directives, and not %${a}`;
2813
+ t.warnings.push(new Y.YAMLWarning(i, c));
2814
+ }
2815
+ }
2816
+ o && r.push(o);
2817
+ }
2818
+ if (n && !s && (t.version || n.version || t.options.version) === "1.1") {
2819
+ let i = ({ handle: o, prefix: a }) => ({ handle: o, prefix: a });
2820
+ t.tagPrefixes = n.tagPrefixes.map(i), t.version = n.version;
2821
+ }
2822
+ t.commentBefore = r.join(`
2823
+ `) || null;
2824
+ }
2825
+ function Ue(t) {
2826
+ if (t instanceof S.Collection) return true;
2827
+ throw new Error("Expected a YAML collection as document contents");
2828
+ }
2829
+ var en = class t {
2830
+ constructor(e) {
2831
+ this.anchors = new Xn(e.anchorPrefix), this.commentBefore = null, this.comment = null, this.contents = null, this.directivesEndMarker = null, this.errors = [], this.options = e, this.schema = null, this.tagPrefixes = [], this.version = null, this.warnings = [];
2832
+ }
2833
+ add(e) {
2834
+ return Ue(this.contents), this.contents.add(e);
2835
+ }
2836
+ addIn(e, n) {
2837
+ Ue(this.contents), this.contents.addIn(e, n);
2838
+ }
2839
+ delete(e) {
2840
+ return Ue(this.contents), this.contents.delete(e);
2841
+ }
2842
+ deleteIn(e) {
2843
+ return S.isEmptyPath(e) ? this.contents == null ? false : (this.contents = null, true) : (Ue(this.contents), this.contents.deleteIn(e));
2844
+ }
2845
+ getDefaults() {
2846
+ return t.defaults[this.version] || t.defaults[this.options.version] || {};
2847
+ }
2848
+ get(e, n) {
2849
+ return this.contents instanceof S.Collection ? this.contents.get(e, n) : void 0;
2850
+ }
2851
+ getIn(e, n) {
2852
+ return S.isEmptyPath(e) ? !n && this.contents instanceof S.Scalar ? this.contents.value : this.contents : this.contents instanceof S.Collection ? this.contents.getIn(e, n) : void 0;
2853
+ }
2854
+ has(e) {
2855
+ return this.contents instanceof S.Collection ? this.contents.has(e) : false;
2856
+ }
2857
+ hasIn(e) {
2858
+ return S.isEmptyPath(e) ? this.contents !== void 0 : this.contents instanceof S.Collection ? this.contents.hasIn(e) : false;
2859
+ }
2860
+ set(e, n) {
2861
+ Ue(this.contents), this.contents.set(e, n);
2862
+ }
2863
+ setIn(e, n) {
2864
+ S.isEmptyPath(e) ? this.contents = n : (Ue(this.contents), this.contents.setIn(e, n));
2865
+ }
2866
+ setSchema(e, n) {
2867
+ if (!e && !n && this.schema) return;
2868
+ typeof e == "number" && (e = e.toFixed(1)), e === "1.0" || e === "1.1" || e === "1.2" ? (this.version ? this.version = e : this.options.version = e, delete this.options.schema) : e && typeof e == "string" && (this.options.schema = e), Array.isArray(n) && (this.options.customTags = n);
2869
+ let r = Object.assign({}, this.getDefaults(), this.options);
2870
+ this.schema = new li.Schema(r);
2871
+ }
2872
+ parse(e, n) {
2873
+ this.options.keepCstNodes && (this.cstNode = e), this.options.keepNodeTypes && (this.type = "DOCUMENT");
2874
+ let { directives: r = [], contents: s = [], directivesEndMarker: i, error: o, valueRange: a } = e;
2875
+ if (o && (o.source || (o.source = this), this.errors.push(o)), _a(this, r, n), i && (this.directivesEndMarker = true), this.range = a ? [a.start, a.end] : null, this.setSchema(), this.anchors._cstAliases = [], va(this, s), this.anchors.resolveNodes(), this.options.prettyErrors) {
2876
+ for (let c of this.errors) c instanceof Y.YAMLError && c.makePretty();
2877
+ for (let c of this.warnings) c instanceof Y.YAMLError && c.makePretty();
2878
+ }
2879
+ return this;
2880
+ }
2881
+ listNonDefaultTags() {
2882
+ return ka(this.contents).filter((e) => e.indexOf(li.Schema.defaultPrefix) !== 0);
2883
+ }
2884
+ setTagPrefix(e, n) {
2885
+ if (e[0] !== "!" || e[e.length - 1] !== "!") throw new Error("Handle must start and end with !");
2886
+ if (n) {
2887
+ let r = this.tagPrefixes.find((s) => s.handle === e);
2888
+ r ? r.prefix = n : this.tagPrefixes.push({ handle: e, prefix: n });
2889
+ } else this.tagPrefixes = this.tagPrefixes.filter((r) => r.handle !== e);
2890
+ }
2891
+ toJSON(e, n) {
2892
+ let { keepBlobsInJSON: r, mapAsMap: s, maxAliasCount: i } = this.options, o = r && (typeof e != "string" || !(this.contents instanceof S.Scalar)), a = { doc: this, indentStep: " ", keep: o, mapAsMap: o && !!s, maxAliasCount: i, stringify: zt }, c = Object.keys(this.anchors.map);
2893
+ c.length > 0 && (a.anchors = new Map(c.map((f) => [this.anchors.map[f], { alias: [], aliasCount: 0, count: 1 }])));
2894
+ let l = S.toJSON(this.contents, e, a);
2895
+ if (typeof n == "function" && a.anchors) for (let { count: f, res: m } of a.anchors.values()) n(m, f);
2896
+ return l;
2897
+ }
2898
+ toString() {
2899
+ if (this.errors.length > 0) throw new Error("Document with errors cannot be stringified");
2900
+ let e = this.options.indent;
2901
+ if (!Number.isInteger(e) || e <= 0) {
2902
+ let c = JSON.stringify(e);
2903
+ throw new Error(`"indent" option must be a positive integer, not ${c}`);
2904
+ }
2905
+ this.setSchema();
2906
+ let n = [], r = false;
2907
+ if (this.version) {
2908
+ let c = "%YAML 1.2";
2909
+ this.schema.name === "yaml-1.1" && (this.version === "1.0" ? c = "%YAML:1.0" : this.version === "1.1" && (c = "%YAML 1.1")), n.push(c), r = true;
2910
+ }
2911
+ let s = this.listNonDefaultTags();
2912
+ this.tagPrefixes.forEach(({ handle: c, prefix: l }) => {
2913
+ s.some((f) => f.indexOf(l) === 0) && (n.push(`%TAG ${c} ${l}`), r = true);
2914
+ }), (r || this.directivesEndMarker) && n.push("---"), this.commentBefore && ((r || !this.directivesEndMarker) && n.unshift(""), n.unshift(this.commentBefore.replace(/^/gm, "#")));
2915
+ let i = { anchors: /* @__PURE__ */ Object.create(null), doc: this, indent: "", indentStep: " ".repeat(e), stringify: zt }, o = false, a = null;
2916
+ if (this.contents) {
2917
+ this.contents instanceof S.Node && (this.contents.spaceBefore && (r || this.directivesEndMarker) && n.push(""), this.contents.commentBefore && n.push(this.contents.commentBefore.replace(/^/gm, "#")), i.forceBlockIndent = !!this.comment, a = this.contents.comment);
2918
+ let c = a ? null : () => o = true, l = zt(this.contents, i, () => a = null, c);
2919
+ n.push(S.addComment(l, "", a));
2920
+ } else this.contents !== void 0 && n.push(zt(this.contents, i));
2921
+ return this.comment && ((!o || a) && n[n.length - 1] !== "" && n.push(""), n.push(this.comment.replace(/^/gm, "#"))), n.join(`
2922
+ `) + `
2923
+ `;
2924
+ }
2925
+ };
2926
+ Y._defineProperty(en, "defaults", ui);
2927
+ tn.Document = en;
2928
+ tn.defaultOptions = Aa;
2929
+ tn.scalarOptions = Ta;
2930
+ });
2931
+ var gi = ee((hi) => {
2932
+ "use strict";
2933
+ var zn = xs(), Ne = pi(), xa = Hn(), Ra = le(), Da = jn();
2934
+ $e();
2935
+ function Ya(t, e = true, n) {
2936
+ n === void 0 && typeof e == "string" && (n = e, e = true);
2937
+ let r = Object.assign({}, Ne.Document.defaults[Ne.defaultOptions.version], Ne.defaultOptions);
2938
+ return new xa.Schema(r).createNode(t, e, n);
2939
+ }
2940
+ var Ke = class extends Ne.Document {
2941
+ constructor(e) {
2942
+ super(Object.assign({}, Ne.defaultOptions, e));
2943
+ }
2944
+ };
2945
+ function Ba(t, e) {
2946
+ let n = [], r;
2947
+ for (let s of zn.parse(t)) {
2948
+ let i = new Ke(e);
2949
+ i.parse(s, r), n.push(i), r = i;
2950
+ }
2951
+ return n;
2952
+ }
2953
+ function mi(t, e) {
2954
+ let n = zn.parse(t), r = new Ke(e).parse(n[0]);
2955
+ if (n.length > 1) {
2956
+ let s = "Source contains multiple documents; please use YAML.parseAllDocuments()";
2957
+ r.errors.unshift(new Ra.YAMLSemanticError(n[1], s));
2958
+ }
2959
+ return r;
2960
+ }
2961
+ function $a(t, e) {
2962
+ let n = mi(t, e);
2963
+ if (n.warnings.forEach((r) => Da.warn(r)), n.errors.length > 0) throw n.errors[0];
2964
+ return n.toJSON();
2965
+ }
2966
+ function Fa(t, e) {
2967
+ let n = new Ke(e);
2968
+ return n.contents = t, String(n);
2969
+ }
2970
+ var qa = { createNode: Ya, defaultOptions: Ne.defaultOptions, Document: Ke, parse: $a, parseAllDocuments: Ba, parseCST: zn.parse, parseDocument: mi, scalarOptions: Ne.scalarOptions, stringify: Fa };
2971
+ hi.YAML = qa;
2972
+ });
2973
+ var yi = ee((Rm, di) => {
2974
+ di.exports = gi().YAML;
2975
+ });
2976
+ var Ei = ee((Q) => {
2977
+ "use strict";
2978
+ var Ve = $e(), We = le();
2979
+ Q.findPair = Ve.findPair;
2980
+ Q.parseMap = Ve.resolveMap;
2981
+ Q.parseSeq = Ve.resolveSeq;
2982
+ Q.stringifyNumber = Ve.stringifyNumber;
2983
+ Q.stringifyString = Ve.stringifyString;
2984
+ Q.toJSON = Ve.toJSON;
2985
+ Q.Type = We.Type;
2986
+ Q.YAMLError = We.YAMLError;
2987
+ Q.YAMLReferenceError = We.YAMLReferenceError;
2988
+ Q.YAMLSemanticError = We.YAMLSemanticError;
2989
+ Q.YAMLSyntaxError = We.YAMLSyntaxError;
2990
+ Q.YAMLWarning = We.YAMLWarning;
2991
+ });
2992
+ var tr = {};
2993
+ nr(tr, { languages: () => Pr, options: () => _r, parsers: () => er, printers: () => Ja });
2994
+ var Ii = (t, e, n, r) => {
2995
+ if (!(t && e == null)) return e.replaceAll ? e.replaceAll(n, r) : n.global ? e.replace(n, r) : e.split(n).join(r);
2996
+ };
2997
+ var yt = Ii;
2998
+ var je = "string";
2999
+ var Qe = "array";
3000
+ var Je = "cursor";
3001
+ var Ge = "indent";
3002
+ var Oe = "align";
3003
+ var He = "trim";
3004
+ var Le = "group";
3005
+ var Ae = "fill";
3006
+ var Te = "if-break";
3007
+ var Xe = "indent-if-break";
3008
+ var Ce = "line-suffix";
3009
+ var ze = "line-suffix-boundary";
3010
+ var te = "line";
3011
+ var Ze = "label";
3012
+ var Me = "break-parent";
3013
+ var Et = /* @__PURE__ */ new Set([Je, Ge, Oe, He, Le, Ae, Te, Xe, Ce, ze, te, Ze, Me]);
3014
+ function Pi(t) {
3015
+ if (typeof t == "string") return je;
3016
+ if (Array.isArray(t)) return Qe;
3017
+ if (!t) return;
3018
+ let { type: e } = t;
3019
+ if (Et.has(e)) return e;
3020
+ }
3021
+ var et = Pi;
3022
+ var _i = (t) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(t);
3023
+ function xi(t) {
3024
+ let e = t === null ? "null" : typeof t;
3025
+ if (e !== "string" && e !== "object") return `Unexpected doc '${e}',
3026
+ Expected it to be 'string' or 'object'.`;
3027
+ if (et(t)) throw new Error("doc is valid.");
3028
+ let n = Object.prototype.toString.call(t);
3029
+ if (n !== "[object Object]") return `Unexpected doc '${n}'.`;
3030
+ let r = _i([...Et].map((s) => `'${s}'`));
3031
+ return `Unexpected doc.type '${t.type}'.
3032
+ Expected it to be ${r}.`;
3033
+ }
3034
+ var rn = class extends Error {
3035
+ constructor(e) {
3036
+ super(xi(e));
3037
+ __publicField(this, "name", "InvalidDocError");
3038
+ this.doc = e;
3039
+ }
3040
+ };
3041
+ var sn = rn;
3042
+ var sr = () => {
3043
+ };
3044
+ var he = sr;
3045
+ var St = sr;
3046
+ function tt(t, e) {
3047
+ return he(e), { type: Oe, contents: e, n: t };
3048
+ }
3049
+ function ke(t, e = {}) {
3050
+ return he(t), St(e.expandedStates, true), { type: Le, id: e.id, contents: t, break: !!e.shouldBreak, expandedStates: e.expandedStates };
3051
+ }
3052
+ function on(t) {
3053
+ return tt(Number.NEGATIVE_INFINITY, t);
3054
+ }
3055
+ function ir(t) {
3056
+ return tt({ type: "root" }, t);
3057
+ }
3058
+ function or(t) {
3059
+ return tt(-1, t);
3060
+ }
3061
+ function an(t, e) {
3062
+ return ke(t[0], __spreadProps(__spreadValues({}, e), { expandedStates: t }));
3063
+ }
3064
+ function wt(t) {
3065
+ return St(t), { type: Ae, parts: t };
3066
+ }
3067
+ function nt(t, e = "", n = {}) {
3068
+ return he(t), e !== "" && he(e), { type: Te, breakContents: t, flatContents: e, groupId: n.groupId };
3069
+ }
3070
+ function ar(t) {
3071
+ return he(t), { type: Ce, contents: t };
3072
+ }
3073
+ var bt = { type: Me };
3074
+ var Ri = { type: te, hard: true };
3075
+ var Di = { type: te, hard: true, literal: true };
3076
+ var ne = { type: te };
3077
+ var Nt = { type: te, soft: true };
3078
+ var N = [Ri, bt];
3079
+ var rt = [Di, bt];
3080
+ function v(t, e) {
3081
+ he(t), St(e);
3082
+ let n = [];
3083
+ for (let r = 0; r < e.length; r++) r !== 0 && n.push(t), n.push(e[r]);
3084
+ return n;
3085
+ }
3086
+ var Yi = (t, e, n) => {
3087
+ if (!(t && e == null)) return Array.isArray(e) || typeof e == "string" ? e[n < 0 ? e.length + n : n] : e.at(n);
3088
+ };
3089
+ var x = Yi;
3090
+ function Bi(t, e) {
3091
+ if (typeof t == "string") return e(t);
3092
+ let n = /* @__PURE__ */ new Map();
3093
+ return r(t);
3094
+ function r(i) {
3095
+ if (n.has(i)) return n.get(i);
3096
+ let o = s(i);
3097
+ return n.set(i, o), o;
3098
+ }
3099
+ function s(i) {
3100
+ switch (et(i)) {
3101
+ case Qe:
3102
+ return e(i.map(r));
3103
+ case Ae:
3104
+ return e(__spreadProps(__spreadValues({}, i), { parts: i.parts.map(r) }));
3105
+ case Te:
3106
+ return e(__spreadProps(__spreadValues({}, i), { breakContents: r(i.breakContents), flatContents: r(i.flatContents) }));
3107
+ case Le: {
3108
+ let { expandedStates: o, contents: a } = i;
3109
+ return o ? (o = o.map(r), a = o[0]) : a = r(a), e(__spreadProps(__spreadValues({}, i), { contents: a, expandedStates: o }));
3110
+ }
3111
+ case Oe:
3112
+ case Ge:
3113
+ case Xe:
3114
+ case Ze:
3115
+ case Ce:
3116
+ return e(__spreadProps(__spreadValues({}, i), { contents: r(i.contents) }));
3117
+ case je:
3118
+ case Je:
3119
+ case He:
3120
+ case ze:
3121
+ case te:
3122
+ case Me:
3123
+ return e(i);
3124
+ default:
3125
+ throw new sn(i);
3126
+ }
3127
+ }
3128
+ }
3129
+ function cr(t, e = rt) {
3130
+ return Bi(t, (n) => typeof n == "string" ? v(e, n.split(`
3131
+ `)) : n);
3132
+ }
3133
+ function Ot(t) {
3134
+ return (e, n, r) => {
3135
+ let s = !!(r != null && r.backwards);
3136
+ if (n === false) return false;
3137
+ let { length: i } = e, o = n;
3138
+ for (; o >= 0 && o < i; ) {
3139
+ let a = e.charAt(o);
3140
+ if (t instanceof RegExp) {
3141
+ if (!t.test(a)) return o;
3142
+ } else if (!t.includes(a)) return o;
3143
+ s ? o-- : o++;
3144
+ }
3145
+ return o === -1 || o === i ? o : false;
3146
+ };
3147
+ }
3148
+ var Nc = Ot(/\s/u);
3149
+ var cn = Ot(" ");
3150
+ var Oc = Ot(",; ");
3151
+ var Lc = Ot(/[^\n\r]/u);
3152
+ function $i(t, e, n) {
3153
+ let r = !!(n != null && n.backwards);
3154
+ if (e === false) return false;
3155
+ let s = t.charAt(e);
3156
+ if (r) {
3157
+ if (t.charAt(e - 1) === "\r" && s === `
3158
+ `) return e - 2;
3159
+ if (s === `
3160
+ ` || s === "\r" || s === "\u2028" || s === "\u2029") return e - 1;
3161
+ } else {
3162
+ if (s === "\r" && t.charAt(e + 1) === `
3163
+ `) return e + 2;
3164
+ if (s === `
3165
+ ` || s === "\r" || s === "\u2028" || s === "\u2029") return e + 1;
3166
+ }
3167
+ return e;
3168
+ }
3169
+ var ln = $i;
3170
+ function Fi(t, e) {
3171
+ let n = e - 1;
3172
+ n = cn(t, n, { backwards: true }), n = ln(t, n, { backwards: true }), n = cn(t, n, { backwards: true });
3173
+ let r = ln(t, n, { backwards: true });
3174
+ return n !== r;
3175
+ }
3176
+ var lr = Fi;
3177
+ var fn = class extends Error {
3178
+ constructor(e, n, r = "type") {
3179
+ super(`Unexpected ${n} node ${r}: ${JSON.stringify(e[r])}.`);
3180
+ __publicField(this, "name", "UnexpectedNodeError");
3181
+ this.node = e;
3182
+ }
3183
+ };
3184
+ var fr = fn;
3185
+ function ur(t, e) {
3186
+ let { node: n } = t;
3187
+ if (n.type === "root" && e.filepath && /(?:[/\\]|^)\.(?:prettier|stylelint|lintstaged)rc$/u.test(e.filepath)) return async (r) => {
3188
+ let s = await r(e.originalText, { parser: "json" });
3189
+ return s ? [s, N] : void 0;
3190
+ };
3191
+ }
3192
+ ur.getVisitorKeys = () => [];
3193
+ var pr = ur;
3194
+ var st = null;
3195
+ function it(t) {
3196
+ if (st !== null && typeof st.property) {
3197
+ let e = st;
3198
+ return st = it.prototype = null, e;
3199
+ }
3200
+ return st = it.prototype = t != null ? t : /* @__PURE__ */ Object.create(null), new it();
3201
+ }
3202
+ var qi = 10;
3203
+ for (let t = 0; t <= qi; t++) it();
3204
+ function un(t) {
3205
+ return it(t);
3206
+ }
3207
+ function Ui(t, e = "type") {
3208
+ un(t);
3209
+ function n(r) {
3210
+ let s = r[e], i = t[s];
3211
+ if (!Array.isArray(i)) throw Object.assign(new Error(`Missing visitor keys for '${s}'.`), { node: r });
3212
+ return i;
3213
+ }
3214
+ return n;
3215
+ }
3216
+ var mr = Ui;
3217
+ var Ki = Object.fromEntries(Object.entries({ root: ["children"], document: ["head", "body", "children"], documentHead: ["children"], documentBody: ["children"], directive: [], alias: [], blockLiteral: [], blockFolded: ["children"], plain: ["children"], quoteSingle: [], quoteDouble: [], mapping: ["children"], mappingItem: ["key", "value", "children"], mappingKey: ["content", "children"], mappingValue: ["content", "children"], sequence: ["children"], sequenceItem: ["content", "children"], flowMapping: ["children"], flowMappingItem: ["key", "value", "children"], flowSequence: ["children"], flowSequenceItem: ["content", "children"], comment: [], tag: [], anchor: [] }).map(([t, e]) => [t, [...e, "anchor", "tag", "indicatorComment", "leadingComments", "middleComments", "trailingComment", "endComments"]]));
3218
+ var hr = Ki;
3219
+ var Vi = mr(hr);
3220
+ var gr = Vi;
3221
+ function ve(t) {
3222
+ return t.position.start.offset;
3223
+ }
3224
+ function dr(t) {
3225
+ return t.position.end.offset;
3226
+ }
3227
+ function yr(t) {
3228
+ return /^\s*@(?:prettier|format)\s*$/u.test(t);
3229
+ }
3230
+ function Er(t) {
3231
+ return /^\s*#[^\S\n]*@(?:prettier|format)\s*?(?:\n|$)/u.test(t);
3232
+ }
3233
+ function Sr(t) {
3234
+ return `# @format
3235
+
3236
+ ${t}`;
3237
+ }
3238
+ function Wi(t) {
3239
+ return Array.isArray(t) && t.length > 0;
3240
+ }
3241
+ var Ie = Wi;
3242
+ function G(t, e) {
3243
+ return typeof (t == null ? void 0 : t.type) == "string" && (!e || e.includes(t.type));
3244
+ }
3245
+ function pn(t, e, n) {
3246
+ return e("children" in t ? __spreadProps(__spreadValues({}, t), { children: t.children.map((r) => pn(r, e, t)) }) : t, n);
3247
+ }
3248
+ function Pe(t, e, n) {
3249
+ Object.defineProperty(t, e, { get: n, enumerable: false });
3250
+ }
3251
+ function br(t, e) {
3252
+ let n = 0, r = e.length;
3253
+ for (let s = t.position.end.offset - 1; s < r; s++) {
3254
+ let i = e[s];
3255
+ if (i === `
3256
+ ` && n++, n === 1 && /\S/u.test(i)) return false;
3257
+ if (n === 2) return true;
3258
+ }
3259
+ return false;
3260
+ }
3261
+ function Lt(t) {
3262
+ let { node: e } = t;
3263
+ switch (e.type) {
3264
+ case "tag":
3265
+ case "anchor":
3266
+ case "comment":
3267
+ return false;
3268
+ }
3269
+ let n = t.stack.length;
3270
+ for (let r = 1; r < n; r++) {
3271
+ let s = t.stack[r], i = t.stack[r - 1];
3272
+ if (Array.isArray(i) && typeof s == "number" && s !== i.length - 1) return false;
3273
+ }
3274
+ return true;
3275
+ }
3276
+ function At(t) {
3277
+ return Ie(t.children) ? At(x(false, t.children, -1)) : t;
3278
+ }
3279
+ function wr(t) {
3280
+ return t.value.trim() === "prettier-ignore";
3281
+ }
3282
+ function Nr(t) {
3283
+ let { node: e } = t;
3284
+ if (e.type === "documentBody") {
3285
+ let n = t.parent.head;
3286
+ return R(n) && wr(x(false, n.endComments, -1));
3287
+ }
3288
+ return Z(e) && wr(x(false, e.leadingComments, -1));
3289
+ }
3290
+ function _e(t) {
3291
+ return !Ie(t.children) && !ji(t);
3292
+ }
3293
+ function ji(t) {
3294
+ return Z(t) || ie(t) || mn(t) || H(t) || R(t);
3295
+ }
3296
+ function Z(t) {
3297
+ return Ie(t == null ? void 0 : t.leadingComments);
3298
+ }
3299
+ function ie(t) {
3300
+ return Ie(t == null ? void 0 : t.middleComments);
3301
+ }
3302
+ function mn(t) {
3303
+ return t == null ? void 0 : t.indicatorComment;
3304
+ }
3305
+ function H(t) {
3306
+ return t == null ? void 0 : t.trailingComment;
3307
+ }
3308
+ function R(t) {
3309
+ return Ie(t == null ? void 0 : t.endComments);
3310
+ }
3311
+ function Or(t) {
3312
+ let e = [], n;
3313
+ for (let r of t.split(/( +)/u)) r !== " " ? n === " " ? e.push(r) : e.push((e.pop() || "") + r) : n === void 0 && e.unshift(""), n = r;
3314
+ return n === " " && e.push((e.pop() || "") + " "), e[0] === "" && (e.shift(), e.unshift(" " + (e.shift() || ""))), e;
3315
+ }
3316
+ function Lr(t, e, n) {
3317
+ let r = e.split(`
3318
+ `).map((s, i, o) => i === 0 && i === o.length - 1 ? s : i !== 0 && i !== o.length - 1 ? s.trim() : i === 0 ? s.trimEnd() : s.trimStart());
3319
+ return n.proseWrap === "preserve" ? r.map((s) => s.length === 0 ? [] : [s]) : r.map((s) => s.length === 0 ? [] : Or(s)).reduce((s, i, o) => o !== 0 && r[o - 1].length > 0 && i.length > 0 && !(t === "quoteDouble" && x(false, x(false, s, -1), -1).endsWith("\\")) ? [...s.slice(0, -1), [...x(false, s, -1), ...i]] : [...s, i], []).map((s) => n.proseWrap === "never" ? [s.join(" ")] : s);
3320
+ }
3321
+ function Ar(t, { parentIndent: e, isLastDescendant: n, options: r }) {
3322
+ let s = t.position.start.line === t.position.end.line ? "" : r.originalText.slice(t.position.start.offset, t.position.end.offset).match(new RegExp("^[^\\n]*\\n(.*)$", "su"))[1], i;
3323
+ if (t.indent === null) {
3324
+ let c = s.match(new RegExp("^(?<leadingSpace> *)[^\\n\\r ]", "mu"));
3325
+ i = c ? c.groups.leadingSpace.length : Number.POSITIVE_INFINITY;
3326
+ } else i = t.indent - 1 + e;
3327
+ let o = s.split(`
3328
+ `).map((c) => c.slice(i));
3329
+ if (r.proseWrap === "preserve" || t.type === "blockLiteral") return a(o.map((c) => c.length === 0 ? [] : [c]));
3330
+ return a(o.map((c) => c.length === 0 ? [] : Or(c)).reduce((c, l, f) => f !== 0 && o[f - 1].length > 0 && l.length > 0 && !/^\s/u.test(l[0]) && !/^\s|\s$/u.test(x(false, c, -1)) ? [...c.slice(0, -1), [...x(false, c, -1), ...l]] : [...c, l], []).map((c) => c.reduce((l, f) => l.length > 0 && /\s$/u.test(x(false, l, -1)) ? [...l.slice(0, -1), x(false, l, -1) + " " + f] : [...l, f], [])).map((c) => r.proseWrap === "never" ? [c.join(" ")] : c));
3331
+ function a(c) {
3332
+ if (t.chomping === "keep") return x(false, c, -1).length === 0 ? c.slice(0, -1) : c;
3333
+ let l = 0;
3334
+ for (let f = c.length - 1; f >= 0 && c[f].length === 0; f--) l++;
3335
+ return l === 0 ? c : l >= 2 && !n ? c.slice(0, -(l - 1)) : c.slice(0, -l);
3336
+ }
3337
+ }
3338
+ function ot(t) {
3339
+ if (!t) return true;
3340
+ switch (t.type) {
3341
+ case "plain":
3342
+ case "quoteDouble":
3343
+ case "quoteSingle":
3344
+ case "alias":
3345
+ case "flowMapping":
3346
+ case "flowSequence":
3347
+ return true;
3348
+ default:
3349
+ return false;
3350
+ }
3351
+ }
3352
+ var hn = /* @__PURE__ */ new WeakMap();
3353
+ function Tt(t, e) {
3354
+ let { node: n, root: r } = t, s;
3355
+ return hn.has(r) ? s = hn.get(r) : (s = /* @__PURE__ */ new Set(), hn.set(r, s)), !s.has(n.position.end.line) && (s.add(n.position.end.line), br(n, e) && !gn(t.parent)) ? Nt : "";
3356
+ }
3357
+ function gn(t) {
3358
+ return R(t) && !G(t, ["documentHead", "documentBody", "flowMapping", "flowSequence"]);
3359
+ }
3360
+ function I(t, e) {
3361
+ return tt(" ".repeat(t), e);
3362
+ }
3363
+ function Qi(t, e, n) {
3364
+ let { node: r } = t, s = t.ancestors.filter((l) => l.type === "sequence" || l.type === "mapping").length, i = Lt(t), o = [r.type === "blockFolded" ? ">" : "|"];
3365
+ r.indent !== null && o.push(r.indent.toString()), r.chomping !== "clip" && o.push(r.chomping === "keep" ? "+" : "-"), mn(r) && o.push(" ", e("indicatorComment"));
3366
+ let a = Ar(r, { parentIndent: s, isLastDescendant: i, options: n }), c = [];
3367
+ for (let [l, f] of a.entries()) l === 0 && c.push(N), c.push(wt(v(ne, f))), l !== a.length - 1 ? c.push(f.length === 0 ? N : ir(rt)) : r.chomping === "keep" && i && c.push(on(f.length === 0 ? N : rt));
3368
+ return r.indent === null ? o.push(or(I(n.tabWidth, c))) : o.push(on(I(r.indent - 1 + s, c))), o;
3369
+ }
3370
+ var Tr = Qi;
3371
+ function Ct(t, e, n) {
3372
+ let { node: r } = t, s = r.type === "flowMapping", i = s ? "{" : "[", o = s ? "}" : "]", a = Nt;
3373
+ s && r.children.length > 0 && n.bracketSpacing && (a = ne);
3374
+ let c = x(false, r.children, -1), l = (c == null ? void 0 : c.type) === "flowMappingItem" && _e(c.key) && _e(c.value);
3375
+ return [i, I(n.tabWidth, [a, Ji(t, e, n), n.trailingComma === "none" ? "" : nt(","), R(r) ? [N, v(N, t.map(e, "endComments"))] : ""]), l ? "" : a, o];
3376
+ }
3377
+ function Ji(t, e, n) {
3378
+ return t.map(({ isLast: r, node: s, next: i }) => [e(), r ? "" : [",", ne, s.position.start.line !== i.position.start.line ? Tt(t, n.originalText) : ""]], "children");
3379
+ }
3380
+ function Gi(t, e, n) {
3381
+ var C;
3382
+ let { node: r, parent: s } = t, { key: i, value: o } = r, a = _e(i), c = _e(o);
3383
+ if (a && c) return ": ";
3384
+ let l = e("key"), f = Hi(r) ? " " : "";
3385
+ if (c) return r.type === "flowMappingItem" && s.type === "flowMapping" ? l : r.type === "mappingItem" && dn(i.content, n) && !H(i.content) && ((C = s.tag) == null ? void 0 : C.value) !== "tag:yaml.org,2002:set" ? [l, f, ":"] : ["? ", I(2, l)];
3386
+ let m = e("value");
3387
+ if (a) return [": ", I(2, m)];
3388
+ if (Z(o) || !ot(i.content)) return ["? ", I(2, l), N, ...t.map(() => [e(), N], "value", "leadingComments"), ": ", I(2, m)];
3389
+ if (Xi(i.content) && !Z(i.content) && !ie(i.content) && !H(i.content) && !R(i) && !Z(o.content) && !ie(o.content) && !R(o) && dn(o.content, n)) return [l, f, ": ", m];
3390
+ let d = Symbol("mappingKey"), y = ke([nt("? "), ke(I(2, l), { id: d })]), h = [N, ": ", I(2, m)], g = [f, ":"];
3391
+ Z(o.content) || R(o) && o.content && !G(o.content, ["mapping", "sequence"]) || s.type === "mapping" && H(i.content) && ot(o.content) || G(o.content, ["mapping", "sequence"]) && o.content.tag === null && o.content.anchor === null ? g.push(N) : o.content && g.push(ne), g.push(m);
3392
+ let w = I(n.tabWidth, g);
3393
+ return dn(i.content, n) && !Z(i.content) && !ie(i.content) && !R(i) ? an([[l, w]]) : an([[y, nt(h, w, { groupId: d })]]);
3394
+ }
3395
+ function dn(t, e) {
3396
+ if (!t) return true;
3397
+ switch (t.type) {
3398
+ case "plain":
3399
+ case "quoteSingle":
3400
+ case "quoteDouble":
3401
+ break;
3402
+ case "alias":
3403
+ return true;
3404
+ default:
3405
+ return false;
3406
+ }
3407
+ if (e.proseWrap === "preserve") return t.position.start.line === t.position.end.line;
3408
+ if (/\\$/mu.test(e.originalText.slice(t.position.start.offset, t.position.end.offset))) return false;
3409
+ switch (e.proseWrap) {
3410
+ case "never":
3411
+ return !t.value.includes(`
3412
+ `);
3413
+ case "always":
3414
+ return !/[\n ]/u.test(t.value);
3415
+ default:
3416
+ return false;
3417
+ }
3418
+ }
3419
+ function Hi(t) {
3420
+ var e;
3421
+ return ((e = t.key.content) == null ? void 0 : e.type) === "alias";
3422
+ }
3423
+ function Xi(t) {
3424
+ if (!t) return true;
3425
+ switch (t.type) {
3426
+ case "plain":
3427
+ case "quoteDouble":
3428
+ case "quoteSingle":
3429
+ return t.position.start.line === t.position.end.line;
3430
+ case "alias":
3431
+ return true;
3432
+ default:
3433
+ return false;
3434
+ }
3435
+ }
3436
+ var Cr = Gi;
3437
+ function zi(t) {
3438
+ return pn(t, Zi);
3439
+ }
3440
+ function Zi(t) {
3441
+ switch (t.type) {
3442
+ case "document":
3443
+ Pe(t, "head", () => t.children[0]), Pe(t, "body", () => t.children[1]);
3444
+ break;
3445
+ case "documentBody":
3446
+ case "sequenceItem":
3447
+ case "flowSequenceItem":
3448
+ case "mappingKey":
3449
+ case "mappingValue":
3450
+ Pe(t, "content", () => t.children[0]);
3451
+ break;
3452
+ case "mappingItem":
3453
+ case "flowMappingItem":
3454
+ Pe(t, "key", () => t.children[0]), Pe(t, "value", () => t.children[1]);
3455
+ break;
3456
+ }
3457
+ return t;
3458
+ }
3459
+ var Mr = zi;
3460
+ function eo(t, e, n) {
3461
+ let { node: r } = t, s = [];
3462
+ r.type !== "mappingValue" && Z(r) && s.push([v(N, t.map(n, "leadingComments")), N]);
3463
+ let { tag: i, anchor: o } = r;
3464
+ i && s.push(n("tag")), i && o && s.push(" "), o && s.push(n("anchor"));
3465
+ let a = "";
3466
+ return G(r, ["mapping", "sequence", "comment", "directive", "mappingItem", "sequenceItem"]) && !Lt(t) && (a = Tt(t, e.originalText)), (i || o) && (G(r, ["sequence", "mapping"]) && !ie(r) ? s.push(N) : s.push(" ")), ie(r) && s.push([r.middleComments.length === 1 ? "" : N, v(N, t.map(n, "middleComments")), N]), Nr(t) ? s.push(cr(e.originalText.slice(r.position.start.offset, r.position.end.offset).trimEnd())) : s.push(ke(to(t, e, n))), H(r) && !G(r, ["document", "documentHead"]) && s.push(ar([r.type === "mappingValue" && !r.content ? "" : " ", t.parent.type === "mappingKey" && t.getParentNode(2).type === "mapping" && ot(r) ? "" : bt, n("trailingComment")])), gn(r) && s.push(I(r.type === "sequenceItem" ? 2 : 0, [N, v(N, t.map(({ node: c }) => [lr(e.originalText, ve(c)) ? N : "", n()], "endComments"))])), s.push(a), s;
3467
+ }
3468
+ function to(t, e, n) {
3469
+ let { node: r } = t;
3470
+ switch (r.type) {
3471
+ case "root": {
3472
+ let s = [];
3473
+ t.each(({ node: o, next: a, isFirst: c }) => {
3474
+ c || s.push(N), s.push(n()), kr(o, a) ? (s.push(N, "..."), H(o) && s.push(" ", n("trailingComment"))) : a && !H(a.head) && s.push(N, "---");
3475
+ }, "children");
3476
+ let i = At(r);
3477
+ return (!G(i, ["blockLiteral", "blockFolded"]) || i.chomping !== "keep") && s.push(N), s;
3478
+ }
3479
+ case "document": {
3480
+ let s = [];
3481
+ return ro(t, e) === "head" && ((r.head.children.length > 0 || r.head.endComments.length > 0) && s.push(n("head")), H(r.head) ? s.push(["---", " ", n(["head", "trailingComment"])]) : s.push("---")), no(r) && s.push(n("body")), v(N, s);
3482
+ }
3483
+ case "documentHead":
3484
+ return v(N, [...t.map(n, "children"), ...t.map(n, "endComments")]);
3485
+ case "documentBody": {
3486
+ let { children: s, endComments: i } = r, o = "";
3487
+ if (s.length > 0 && i.length > 0) {
3488
+ let a = At(r);
3489
+ G(a, ["blockFolded", "blockLiteral"]) ? a.chomping !== "keep" && (o = [N, N]) : o = N;
3490
+ }
3491
+ return [v(N, t.map(n, "children")), o, v(N, t.map(n, "endComments"))];
3492
+ }
3493
+ case "directive":
3494
+ return ["%", v(" ", [r.name, ...r.parameters])];
3495
+ case "comment":
3496
+ return ["#", r.value];
3497
+ case "alias":
3498
+ return ["*", r.value];
3499
+ case "tag":
3500
+ return e.originalText.slice(r.position.start.offset, r.position.end.offset);
3501
+ case "anchor":
3502
+ return ["&", r.value];
3503
+ case "plain":
3504
+ return at(r.type, e.originalText.slice(r.position.start.offset, r.position.end.offset), e);
3505
+ case "quoteDouble":
3506
+ case "quoteSingle": {
3507
+ let s = "'", i = '"', o = e.originalText.slice(r.position.start.offset + 1, r.position.end.offset - 1);
3508
+ if (r.type === "quoteSingle" && o.includes("\\") || r.type === "quoteDouble" && /\\[^"]/u.test(o)) {
3509
+ let c = r.type === "quoteDouble" ? i : s;
3510
+ return [c, at(r.type, o, e), c];
3511
+ }
3512
+ if (o.includes(i)) return [s, at(r.type, r.type === "quoteDouble" ? yt(false, yt(false, o, String.raw`\"`, i), "'", s.repeat(2)) : o, e), s];
3513
+ if (o.includes(s)) return [i, at(r.type, r.type === "quoteSingle" ? yt(false, o, "''", s) : o, e), i];
3514
+ let a = e.singleQuote ? s : i;
3515
+ return [a, at(r.type, o, e), a];
3516
+ }
3517
+ case "blockFolded":
3518
+ case "blockLiteral":
3519
+ return Tr(t, n, e);
3520
+ case "mapping":
3521
+ case "sequence":
3522
+ return v(N, t.map(n, "children"));
3523
+ case "sequenceItem":
3524
+ return ["- ", I(2, r.content ? n("content") : "")];
3525
+ case "mappingKey":
3526
+ case "mappingValue":
3527
+ return r.content ? n("content") : "";
3528
+ case "mappingItem":
3529
+ case "flowMappingItem":
3530
+ return Cr(t, n, e);
3531
+ case "flowMapping":
3532
+ return Ct(t, n, e);
3533
+ case "flowSequence":
3534
+ return Ct(t, n, e);
3535
+ case "flowSequenceItem":
3536
+ return n("content");
3537
+ default:
3538
+ throw new fr(r, "YAML");
3539
+ }
3540
+ }
3541
+ function no(t) {
3542
+ return t.body.children.length > 0 || R(t.body);
3543
+ }
3544
+ function kr(t, e) {
3545
+ return H(t) || e && (e.head.children.length > 0 || R(e.head));
3546
+ }
3547
+ function ro(t, e) {
3548
+ let n = t.node;
3549
+ if (t.isFirst && /---(?:\s|$)/u.test(e.originalText.slice(ve(n), ve(n) + 4)) || n.head.children.length > 0 || R(n.head) || H(n.head)) return "head";
3550
+ let r = t.next;
3551
+ return kr(n, r) ? false : r ? "root" : false;
3552
+ }
3553
+ function at(t, e, n) {
3554
+ let r = Lr(t, e, n);
3555
+ return v(N, r.map((s) => wt(v(ne, s))));
3556
+ }
3557
+ function vr(t, e) {
3558
+ if (G(t)) switch (t.type) {
3559
+ case "comment":
3560
+ if (yr(t.value)) return null;
3561
+ break;
3562
+ case "quoteDouble":
3563
+ case "quoteSingle":
3564
+ e.type = "quote";
3565
+ break;
3566
+ }
3567
+ }
3568
+ vr.ignoredProperties = /* @__PURE__ */ new Set(["position"]);
3569
+ var so = { preprocess: Mr, embed: pr, print: eo, massageAstNode: vr, insertPragma: Sr, getVisitorKeys: gr };
3570
+ var Ir = so;
3571
+ var Pr = [{ linguistLanguageId: 407, name: "YAML", type: "data", color: "#cb171e", tmScope: "source.yaml", aliases: ["yml"], extensions: [".yml", ".mir", ".reek", ".rviz", ".sublime-syntax", ".syntax", ".yaml", ".yaml-tmlanguage", ".yaml.sed", ".yml.mysql"], filenames: [".clang-format", ".clang-tidy", ".gemrc", "CITATION.cff", "glide.lock", ".prettierrc", ".stylelintrc", ".lintstagedrc"], aceMode: "yaml", codemirrorMode: "yaml", codemirrorMimeType: "text/x-yaml", parsers: ["yaml"], vscodeLanguageIds: ["yaml", "ansible", "home-assistant"] }];
3572
+ var Mt = { bracketSpacing: { category: "Common", type: "boolean", default: true, description: "Print spaces between brackets.", oppositeDescription: "Do not print spaces between brackets." }, singleQuote: { category: "Common", type: "boolean", default: false, description: "Use single quotes instead of double quotes." }, proseWrap: { category: "Common", type: "choice", default: "preserve", description: "How to wrap prose.", choices: [{ value: "always", description: "Wrap prose if it exceeds the print width." }, { value: "never", description: "Do not wrap prose." }, { value: "preserve", description: "Wrap prose as-is." }] }, bracketSameLine: { category: "Common", type: "boolean", default: false, description: "Put > of opening tags on the last line instead of on a new line." }, singleAttributePerLine: { category: "Common", type: "boolean", default: false, description: "Enforce single attribute per line in HTML, Vue and JSX." } };
3573
+ var io = { bracketSpacing: Mt.bracketSpacing, singleQuote: Mt.singleQuote, proseWrap: Mt.proseWrap };
3574
+ var _r = io;
3575
+ var er = {};
3576
+ nr(er, { yaml: () => Qa });
3577
+ var kt = `
3578
+ `;
3579
+ var xr = "\r";
3580
+ var Rr = function() {
3581
+ function t(e) {
3582
+ this.length = e.length;
3583
+ for (var n = [0], r = 0; r < e.length; ) switch (e[r]) {
3584
+ case kt:
3585
+ r += kt.length, n.push(r);
3586
+ break;
3587
+ case xr:
3588
+ r += xr.length, e[r] === kt && (r += kt.length), n.push(r);
3589
+ break;
3590
+ default:
3591
+ r++;
3592
+ break;
3593
+ }
3594
+ this.offsets = n;
3595
+ }
3596
+ return t.prototype.locationForIndex = function(e) {
3597
+ if (e < 0 || e > this.length) return null;
3598
+ for (var n = 0, r = this.offsets; r[n + 1] <= e; ) n++;
3599
+ var s = e - r[n];
3600
+ return { line: n, column: s };
3601
+ }, t.prototype.indexForLocation = function(e) {
3602
+ var n = e.line, r = e.column;
3603
+ return n < 0 || n >= this.offsets.length || r < 0 || r > this.lengthOfLine(n) ? null : this.offsets[n] + r;
3604
+ }, t.prototype.lengthOfLine = function(e) {
3605
+ var n = this.offsets[e], r = e === this.offsets.length - 1 ? this.length : this.offsets[e + 1];
3606
+ return r - n;
3607
+ }, t;
3608
+ }();
3609
+ function B(t, e = null) {
3610
+ "children" in t && t.children.forEach((n) => B(n, t)), "anchor" in t && t.anchor && B(t.anchor, t), "tag" in t && t.tag && B(t.tag, t), "leadingComments" in t && t.leadingComments.forEach((n) => B(n, t)), "middleComments" in t && t.middleComments.forEach((n) => B(n, t)), "indicatorComment" in t && t.indicatorComment && B(t.indicatorComment, t), "trailingComment" in t && t.trailingComment && B(t.trailingComment, t), "endComments" in t && t.endComments.forEach((n) => B(n, t)), Object.defineProperty(t, "_parent", { value: e, enumerable: false });
3611
+ }
3612
+ function ge(t) {
3613
+ return `${t.line}:${t.column}`;
3614
+ }
3615
+ function Dr(t) {
3616
+ B(t);
3617
+ let e = oo(t), n = t.children.slice();
3618
+ t.comments.sort((r, s) => r.position.start.offset - s.position.end.offset).filter((r) => !r._parent).forEach((r) => {
3619
+ for (; n.length > 1 && r.position.start.line > n[0].position.end.line; ) n.shift();
3620
+ ao(r, e, n[0]);
3621
+ });
3622
+ }
3623
+ function oo(t) {
3624
+ let e = Array.from(new Array(t.position.end.line), () => ({}));
3625
+ for (let n of t.comments) e[n.position.start.line - 1].comment = n;
3626
+ return Yr(e, t), e;
3627
+ }
3628
+ function Yr(t, e) {
3629
+ if (e.position.start.offset !== e.position.end.offset) {
3630
+ if ("leadingComments" in e) {
3631
+ let { start: n } = e.position, { leadingAttachableNode: r } = t[n.line - 1];
3632
+ (!r || n.column < r.position.start.column) && (t[n.line - 1].leadingAttachableNode = e);
3633
+ }
3634
+ if ("trailingComment" in e && e.position.end.column > 1 && e.type !== "document" && e.type !== "documentHead") {
3635
+ let { end: n } = e.position, { trailingAttachableNode: r } = t[n.line - 1];
3636
+ (!r || n.column >= r.position.end.column) && (t[n.line - 1].trailingAttachableNode = e);
3637
+ }
3638
+ if (e.type !== "root" && e.type !== "document" && e.type !== "documentHead" && e.type !== "documentBody") {
3639
+ let { start: n, end: r } = e.position, s = [r.line].concat(n.line === r.line ? [] : n.line);
3640
+ for (let i of s) {
3641
+ let o = t[i - 1].trailingNode;
3642
+ (!o || r.column >= o.position.end.column) && (t[i - 1].trailingNode = e);
3643
+ }
3644
+ }
3645
+ "children" in e && e.children.forEach((n) => {
3646
+ Yr(t, n);
3647
+ });
3648
+ }
3649
+ }
3650
+ function ao(t, e, n) {
3651
+ let r = t.position.start.line, { trailingAttachableNode: s } = e[r - 1];
3652
+ if (s) {
3653
+ if (s.trailingComment) throw new Error(`Unexpected multiple trailing comment at ${ge(t.position.start)}`);
3654
+ B(t, s), s.trailingComment = t;
3655
+ return;
3656
+ }
3657
+ for (let o = r; o >= n.position.start.line; o--) {
3658
+ let { trailingNode: a } = e[o - 1], c;
3659
+ if (a) c = a;
3660
+ else if (o !== r && e[o - 1].comment) c = e[o - 1].comment._parent;
3661
+ else continue;
3662
+ if ((c.type === "sequence" || c.type === "mapping") && (c = c.children[0]), c.type === "mappingItem") {
3663
+ let [l, f] = c.children;
3664
+ c = Br(l) ? l : f;
3665
+ }
3666
+ for (; ; ) {
3667
+ if (co(c, t)) {
3668
+ B(t, c), c.endComments.push(t);
3669
+ return;
3670
+ }
3671
+ if (!c._parent) break;
3672
+ c = c._parent;
3673
+ }
3674
+ break;
3675
+ }
3676
+ for (let o = r + 1; o <= n.position.end.line; o++) {
3677
+ let { leadingAttachableNode: a } = e[o - 1];
3678
+ if (a) {
3679
+ B(t, a), a.leadingComments.push(t);
3680
+ return;
3681
+ }
3682
+ }
3683
+ let i = n.children[1];
3684
+ B(t, i), i.endComments.push(t);
3685
+ }
3686
+ function co(t, e) {
3687
+ if (t.position.start.offset < e.position.start.offset && t.position.end.offset > e.position.end.offset) switch (t.type) {
3688
+ case "flowMapping":
3689
+ case "flowSequence":
3690
+ return t.children.length === 0 || e.position.start.line > t.children[t.children.length - 1].position.end.line;
3691
+ }
3692
+ if (e.position.end.offset < t.position.end.offset) return false;
3693
+ switch (t.type) {
3694
+ case "sequenceItem":
3695
+ return e.position.start.column > t.position.start.column;
3696
+ case "mappingKey":
3697
+ case "mappingValue":
3698
+ return e.position.start.column > t._parent.position.start.column && (t.children.length === 0 || t.children.length === 1 && t.children[0].type !== "blockFolded" && t.children[0].type !== "blockLiteral") && (t.type === "mappingValue" || Br(t));
3699
+ default:
3700
+ return false;
3701
+ }
3702
+ }
3703
+ function Br(t) {
3704
+ return t.position.start !== t.position.end && (t.children.length === 0 || t.position.start.offset !== t.children[0].position.start.offset);
3705
+ }
3706
+ function b(t, e) {
3707
+ return { type: t, position: e };
3708
+ }
3709
+ function $r(t, e, n) {
3710
+ return __spreadProps(__spreadValues({}, b("root", t)), { children: e, comments: n });
3711
+ }
3712
+ function ct(t) {
3713
+ switch (t.type) {
3714
+ case "DOCUMENT":
3715
+ for (let e = t.contents.length - 1; e >= 0; e--) t.contents[e].type === "BLANK_LINE" ? t.contents.splice(e, 1) : ct(t.contents[e]);
3716
+ for (let e = t.directives.length - 1; e >= 0; e--) t.directives[e].type === "BLANK_LINE" && t.directives.splice(e, 1);
3717
+ break;
3718
+ case "FLOW_MAP":
3719
+ case "FLOW_SEQ":
3720
+ case "MAP":
3721
+ case "SEQ":
3722
+ for (let e = t.items.length - 1; e >= 0; e--) {
3723
+ let n = t.items[e];
3724
+ "char" in n || (n.type === "BLANK_LINE" ? t.items.splice(e, 1) : ct(n));
3725
+ }
3726
+ break;
3727
+ case "MAP_KEY":
3728
+ case "MAP_VALUE":
3729
+ case "SEQ_ITEM":
3730
+ t.node && ct(t.node);
3731
+ break;
3732
+ case "ALIAS":
3733
+ case "BLANK_LINE":
3734
+ case "BLOCK_FOLDED":
3735
+ case "BLOCK_LITERAL":
3736
+ case "COMMENT":
3737
+ case "DIRECTIVE":
3738
+ case "PLAIN":
3739
+ case "QUOTE_DOUBLE":
3740
+ case "QUOTE_SINGLE":
3741
+ break;
3742
+ default:
3743
+ throw new Error(`Unexpected node type ${JSON.stringify(t.type)}`);
3744
+ }
3745
+ }
3746
+ function X() {
3747
+ return { leadingComments: [] };
3748
+ }
3749
+ function oe(t = null) {
3750
+ return { trailingComment: t };
3751
+ }
3752
+ function $() {
3753
+ return __spreadValues(__spreadValues({}, X()), oe());
3754
+ }
3755
+ function Fr(t, e, n) {
3756
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, b("alias", t)), $()), e), { value: n });
3757
+ }
3758
+ function qr(t, e) {
3759
+ let n = t.cstNode;
3760
+ return Fr(e.transformRange({ origStart: n.valueRange.origStart - 1, origEnd: n.valueRange.origEnd }), e.transformContent(t), n.rawValue);
3761
+ }
3762
+ function Ur(t) {
3763
+ return __spreadProps(__spreadValues({}, t), { type: "blockFolded" });
3764
+ }
3765
+ function Kr(t, e, n, r, s, i) {
3766
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, b("blockValue", t)), X()), e), { chomping: n, indent: r, value: s, indicatorComment: i });
3767
+ }
3768
+ var ae;
3769
+ (function(t) {
3770
+ t.Tag = "!", t.Anchor = "&", t.Comment = "#";
3771
+ })(ae || (ae = {}));
3772
+ function Vr(t, e) {
3773
+ return __spreadProps(__spreadValues({}, b("anchor", t)), { value: e });
3774
+ }
3775
+ function xe(t, e) {
3776
+ return __spreadProps(__spreadValues({}, b("comment", t)), { value: e });
3777
+ }
3778
+ function Wr(t, e, n) {
3779
+ return { anchor: e, tag: t, middleComments: n };
3780
+ }
3781
+ function jr(t, e) {
3782
+ return __spreadProps(__spreadValues({}, b("tag", t)), { value: e });
3783
+ }
3784
+ function vt(t, e, n = () => false) {
3785
+ let r = t.cstNode, s = [], i = null, o = null, a = null;
3786
+ for (let c of r.props) {
3787
+ let l = e.text[c.origStart];
3788
+ switch (l) {
3789
+ case ae.Tag:
3790
+ i = i || c, o = jr(e.transformRange(c), t.tag);
3791
+ break;
3792
+ case ae.Anchor:
3793
+ i = i || c, a = Vr(e.transformRange(c), r.anchor);
3794
+ break;
3795
+ case ae.Comment: {
3796
+ let f = xe(e.transformRange(c), e.text.slice(c.origStart + 1, c.origEnd));
3797
+ e.comments.push(f), !n(f) && i && i.origEnd <= c.origStart && c.origEnd <= r.valueRange.origStart && s.push(f);
3798
+ break;
3799
+ }
3800
+ default:
3801
+ throw new Error(`Unexpected leading character ${JSON.stringify(l)}`);
3802
+ }
3803
+ }
3804
+ return Wr(o, a, s);
3805
+ }
3806
+ var yn;
3807
+ (function(t) {
3808
+ t.CLIP = "clip", t.STRIP = "strip", t.KEEP = "keep";
3809
+ })(yn || (yn = {}));
3810
+ function It(t, e) {
3811
+ let n = t.cstNode, r = 1, s = n.chomping === "CLIP" ? 0 : 1, o = n.header.origEnd - n.header.origStart - r - s !== 0, a = e.transformRange({ origStart: n.header.origStart, origEnd: n.valueRange.origEnd }), c = null, l = vt(t, e, (f) => {
3812
+ if (!(a.start.offset < f.position.start.offset && f.position.end.offset < a.end.offset)) return false;
3813
+ if (c) throw new Error(`Unexpected multiple indicator comments at ${ge(f.position.start)}`);
3814
+ return c = f, true;
3815
+ });
3816
+ return Kr(a, l, yn[n.chomping], o ? n.blockIndent : null, n.strValue, c);
3817
+ }
3818
+ function Qr(t, e) {
3819
+ return Ur(It(t, e));
3820
+ }
3821
+ function Jr(t) {
3822
+ return __spreadProps(__spreadValues({}, t), { type: "blockLiteral" });
3823
+ }
3824
+ function Gr(t, e) {
3825
+ return Jr(It(t, e));
3826
+ }
3827
+ function Hr(t, e) {
3828
+ return xe(e.transformRange(t.range), t.comment);
3829
+ }
3830
+ function Xr(t, e, n) {
3831
+ return __spreadProps(__spreadValues(__spreadValues({}, b("directive", t)), $()), { name: e, parameters: n });
3832
+ }
3833
+ function Re(t, e) {
3834
+ for (let n of t.props) {
3835
+ let r = e.text[n.origStart];
3836
+ switch (r) {
3837
+ case ae.Comment:
3838
+ e.comments.push(xe(e.transformRange(n), e.text.slice(n.origStart + 1, n.origEnd)));
3839
+ break;
3840
+ default:
3841
+ throw new Error(`Unexpected leading character ${JSON.stringify(r)}`);
3842
+ }
3843
+ }
3844
+ }
3845
+ function zr(t, e) {
3846
+ return Re(t, e), Xr(e.transformRange(t.range), t.name, t.parameters);
3847
+ }
3848
+ function Zr(t, e, n, r) {
3849
+ return __spreadProps(__spreadValues(__spreadValues({}, b("document", t)), oe(r)), { children: [e, n] });
3850
+ }
3851
+ function K(t, e) {
3852
+ return { start: t, end: e };
3853
+ }
3854
+ function En(t) {
3855
+ return { start: t, end: t };
3856
+ }
3857
+ function F(t = []) {
3858
+ return { endComments: t };
3859
+ }
3860
+ function es(t, e, n) {
3861
+ return __spreadProps(__spreadValues(__spreadValues({}, b("documentBody", t)), F(n)), { children: e ? [e] : [] });
3862
+ }
3863
+ function q(t) {
3864
+ return t[t.length - 1];
3865
+ }
3866
+ function Pt(t, e) {
3867
+ let n = t.match(e);
3868
+ return n ? n.index : -1;
3869
+ }
3870
+ function ts(t, e, n) {
3871
+ let r = t.cstNode, { comments: s, endComments: i, documentTrailingComment: o, documentHeadTrailingComment: a } = lo(r, e, n), c = e.transformNode(t.contents), { position: l, documentEndPoint: f } = fo(r, c, e);
3872
+ return e.comments.push(...s, ...i), { documentBody: es(l, c, i), documentEndPoint: f, documentTrailingComment: o, documentHeadTrailingComment: a };
3873
+ }
3874
+ function lo(t, e, n) {
3875
+ let r = [], s = [], i = [], o = [], a = false;
3876
+ for (let c = t.contents.length - 1; c >= 0; c--) {
3877
+ let l = t.contents[c];
3878
+ if (l.type === "COMMENT") {
3879
+ let f = e.transformNode(l);
3880
+ n && n.line === f.position.start.line ? o.unshift(f) : a ? r.unshift(f) : f.position.start.offset >= t.valueRange.origEnd ? i.unshift(f) : r.unshift(f);
3881
+ } else a = true;
3882
+ }
3883
+ if (i.length > 1) throw new Error(`Unexpected multiple document trailing comments at ${ge(i[1].position.start)}`);
3884
+ if (o.length > 1) throw new Error(`Unexpected multiple documentHead trailing comments at ${ge(o[1].position.start)}`);
3885
+ return { comments: r, endComments: s, documentTrailingComment: q(i) || null, documentHeadTrailingComment: q(o) || null };
3886
+ }
3887
+ function fo(t, e, n) {
3888
+ let r = Pt(n.text.slice(t.valueRange.origEnd), /^\.\.\./), s = r === -1 ? t.valueRange.origEnd : Math.max(0, t.valueRange.origEnd - 1);
3889
+ n.text[s - 1] === "\r" && s--;
3890
+ let i = n.transformRange({ origStart: e !== null ? e.position.start.offset : s, origEnd: s }), o = r === -1 ? i.end : n.transformOffset(t.valueRange.origEnd + 3);
3891
+ return { position: i, documentEndPoint: o };
3892
+ }
3893
+ function ns(t, e, n, r) {
3894
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, b("documentHead", t)), F(n)), oe(r)), { children: e });
3895
+ }
3896
+ function rs(t, e) {
3897
+ let n = t.cstNode, { directives: r, comments: s, endComments: i } = uo(n, e), { position: o, endMarkerPoint: a } = po(n, r, e);
3898
+ return e.comments.push(...s, ...i), { createDocumentHeadWithTrailingComment: (l) => (l && e.comments.push(l), ns(o, r, i, l)), documentHeadEndMarkerPoint: a };
3899
+ }
3900
+ function uo(t, e) {
3901
+ let n = [], r = [], s = [], i = false;
3902
+ for (let o = t.directives.length - 1; o >= 0; o--) {
3903
+ let a = e.transformNode(t.directives[o]);
3904
+ a.type === "comment" ? i ? r.unshift(a) : s.unshift(a) : (i = true, n.unshift(a));
3905
+ }
3906
+ return { directives: n, comments: r, endComments: s };
3907
+ }
3908
+ function po(t, e, n) {
3909
+ let r = Pt(n.text.slice(0, t.valueRange.origStart), /---\s*$/);
3910
+ r > 0 && !/[\r\n]/.test(n.text[r - 1]) && (r = -1);
3911
+ let s = r === -1 ? { origStart: t.valueRange.origStart, origEnd: t.valueRange.origStart } : { origStart: r, origEnd: r + 3 };
3912
+ return e.length !== 0 && (s.origStart = e[0].position.start.offset), { position: n.transformRange(s), endMarkerPoint: r === -1 ? null : n.transformOffset(r) };
3913
+ }
3914
+ function ss(t, e) {
3915
+ let { createDocumentHeadWithTrailingComment: n, documentHeadEndMarkerPoint: r } = rs(t, e), { documentBody: s, documentEndPoint: i, documentTrailingComment: o, documentHeadTrailingComment: a } = ts(t, e, r), c = n(a);
3916
+ return o && e.comments.push(o), Zr(K(c.position.start, i), c, s, o);
3917
+ }
3918
+ function _t(t, e, n) {
3919
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, b("flowCollection", t)), $()), F()), e), { children: n });
3920
+ }
3921
+ function is(t, e, n) {
3922
+ return __spreadProps(__spreadValues({}, _t(t, e, n)), { type: "flowMapping" });
3923
+ }
3924
+ function xt(t, e, n) {
3925
+ return __spreadProps(__spreadValues(__spreadValues({}, b("flowMappingItem", t)), X()), { children: [e, n] });
3926
+ }
3927
+ function ce(t, e) {
3928
+ let n = [];
3929
+ for (let r of t) r && "type" in r && r.type === "COMMENT" ? e.comments.push(e.transformNode(r)) : n.push(r);
3930
+ return n;
3931
+ }
3932
+ function Rt(t) {
3933
+ let [e, n] = ["?", ":"].map((r) => {
3934
+ let s = t.find((i) => "char" in i && i.char === r);
3935
+ return s ? { origStart: s.origOffset, origEnd: s.origOffset + 1 } : null;
3936
+ });
3937
+ return { additionalKeyRange: e, additionalValueRange: n };
3938
+ }
3939
+ function Dt(t, e) {
3940
+ let n = e;
3941
+ return (r) => t.slice(n, n = r);
3942
+ }
3943
+ function Yt(t) {
3944
+ let e = [], n = Dt(t, 1), r = false;
3945
+ for (let s = 1; s < t.length - 1; s++) {
3946
+ let i = t[s];
3947
+ if ("char" in i && i.char === ",") {
3948
+ e.push(n(s)), n(s + 1), r = false;
3949
+ continue;
3950
+ }
3951
+ r = true;
3952
+ }
3953
+ return r && e.push(n(t.length - 1)), e;
3954
+ }
3955
+ function Sn(t, e) {
3956
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, b("mappingKey", t)), oe()), F()), { children: e ? [e] : [] });
3957
+ }
3958
+ function wn(t, e) {
3959
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, b("mappingValue", t)), $()), F()), { children: e ? [e] : [] });
3960
+ }
3961
+ function De(t, e, n, r, s) {
3962
+ let i = e.transformNode(t.key), o = e.transformNode(t.value), a = i || r ? Sn(e.transformRange({ origStart: r ? r.origStart : i.position.start.offset, origEnd: i ? i.position.end.offset : r.origStart + 1 }), i) : null, c = o || s ? wn(e.transformRange({ origStart: s ? s.origStart : o.position.start.offset, origEnd: o ? o.position.end.offset : s.origStart + 1 }), o) : null;
3963
+ return n(K(a ? a.position.start : c.position.start, c ? c.position.end : a.position.end), a || Sn(En(c.position.start), null), c || wn(En(a.position.end), null));
3964
+ }
3965
+ function os(t, e) {
3966
+ let n = ce(t.cstNode.items, e), r = Yt(n), s = t.items.map((a, c) => {
3967
+ let l = r[c], { additionalKeyRange: f, additionalValueRange: m } = Rt(l);
3968
+ return De(a, e, xt, f, m);
3969
+ }), i = n[0], o = q(n);
3970
+ return is(e.transformRange({ origStart: i.origOffset, origEnd: o.origOffset + 1 }), e.transformContent(t), s);
3971
+ }
3972
+ function as(t, e, n) {
3973
+ return __spreadProps(__spreadValues({}, _t(t, e, n)), { type: "flowSequence" });
3974
+ }
3975
+ function cs(t, e) {
3976
+ return __spreadProps(__spreadValues({}, b("flowSequenceItem", t)), { children: [e] });
3977
+ }
3978
+ function ls(t, e) {
3979
+ let n = ce(t.cstNode.items, e), r = Yt(n), s = t.items.map((a, c) => {
3980
+ if (a.type !== "PAIR") {
3981
+ let l = e.transformNode(a);
3982
+ return cs(K(l.position.start, l.position.end), l);
3983
+ } else {
3984
+ let l = r[c], { additionalKeyRange: f, additionalValueRange: m } = Rt(l);
3985
+ return De(a, e, xt, f, m);
3986
+ }
3987
+ }), i = n[0], o = q(n);
3988
+ return as(e.transformRange({ origStart: i.origOffset, origEnd: o.origOffset + 1 }), e.transformContent(t), s);
3989
+ }
3990
+ function fs(t, e, n) {
3991
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, b("mapping", t)), X()), e), { children: n });
3992
+ }
3993
+ function us(t, e, n) {
3994
+ return __spreadProps(__spreadValues(__spreadValues({}, b("mappingItem", t)), X()), { children: [e, n] });
3995
+ }
3996
+ function ps(t, e) {
3997
+ let n = t.cstNode;
3998
+ n.items.filter((o) => o.type === "MAP_KEY" || o.type === "MAP_VALUE").forEach((o) => Re(o, e));
3999
+ let r = ce(n.items, e), s = mo(r), i = t.items.map((o, a) => {
4000
+ let c = s[a], [l, f] = c[0].type === "MAP_VALUE" ? [null, c[0].range] : [c[0].range, c.length === 1 ? null : c[1].range];
4001
+ return De(o, e, us, l, f);
4002
+ });
4003
+ return fs(K(i[0].position.start, q(i).position.end), e.transformContent(t), i);
4004
+ }
4005
+ function mo(t) {
4006
+ let e = [], n = Dt(t, 0), r = false;
4007
+ for (let s = 0; s < t.length; s++) {
4008
+ if (t[s].type === "MAP_VALUE") {
4009
+ e.push(n(s + 1)), r = false;
4010
+ continue;
4011
+ }
4012
+ r && e.push(n(s)), r = true;
4013
+ }
4014
+ return r && e.push(n(1 / 0)), e;
4015
+ }
4016
+ function ms(t, e, n) {
4017
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, b("plain", t)), $()), e), { value: n });
4018
+ }
4019
+ function hs(t, e, n) {
4020
+ for (let r = e; r >= 0; r--) if (n.test(t[r])) return r;
4021
+ return -1;
4022
+ }
4023
+ function gs(t, e) {
4024
+ let n = t.cstNode;
4025
+ return ms(e.transformRange({ origStart: n.valueRange.origStart, origEnd: hs(e.text, n.valueRange.origEnd - 1, /\S/) + 1 }), e.transformContent(t), n.strValue);
4026
+ }
4027
+ function ds(t) {
4028
+ return __spreadProps(__spreadValues({}, t), { type: "quoteDouble" });
4029
+ }
4030
+ function ys(t, e, n) {
4031
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, b("quoteValue", t)), e), $()), { value: n });
4032
+ }
4033
+ function Bt(t, e) {
4034
+ let n = t.cstNode;
4035
+ return ys(e.transformRange(n.valueRange), e.transformContent(t), n.strValue);
4036
+ }
4037
+ function Es(t, e) {
4038
+ return ds(Bt(t, e));
4039
+ }
4040
+ function Ss(t) {
4041
+ return __spreadProps(__spreadValues({}, t), { type: "quoteSingle" });
4042
+ }
4043
+ function ws(t, e) {
4044
+ return Ss(Bt(t, e));
4045
+ }
4046
+ function bs(t, e, n) {
4047
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, b("sequence", t)), X()), F()), e), { children: n });
4048
+ }
4049
+ function Ns(t, e) {
4050
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, b("sequenceItem", t)), $()), F()), { children: e ? [e] : [] });
4051
+ }
4052
+ function Os(t, e) {
4053
+ let r = ce(t.cstNode.items, e).map((s, i) => {
4054
+ Re(s, e);
4055
+ let o = e.transformNode(t.items[i]);
4056
+ return Ns(K(e.transformOffset(s.valueRange.origStart), o === null ? e.transformOffset(s.valueRange.origStart + 1) : o.position.end), o);
4057
+ });
4058
+ return bs(K(r[0].position.start, q(r).position.end), e.transformContent(t), r);
4059
+ }
4060
+ function Ls(t, e) {
4061
+ if (t === null || t.type === void 0 && t.value === null) return null;
4062
+ switch (t.type) {
4063
+ case "ALIAS":
4064
+ return qr(t, e);
4065
+ case "BLOCK_FOLDED":
4066
+ return Qr(t, e);
4067
+ case "BLOCK_LITERAL":
4068
+ return Gr(t, e);
4069
+ case "COMMENT":
4070
+ return Hr(t, e);
4071
+ case "DIRECTIVE":
4072
+ return zr(t, e);
4073
+ case "DOCUMENT":
4074
+ return ss(t, e);
4075
+ case "FLOW_MAP":
4076
+ return os(t, e);
4077
+ case "FLOW_SEQ":
4078
+ return ls(t, e);
4079
+ case "MAP":
4080
+ return ps(t, e);
4081
+ case "PLAIN":
4082
+ return gs(t, e);
4083
+ case "QUOTE_DOUBLE":
4084
+ return Es(t, e);
4085
+ case "QUOTE_SINGLE":
4086
+ return ws(t, e);
4087
+ case "SEQ":
4088
+ return Os(t, e);
4089
+ default:
4090
+ throw new Error(`Unexpected node type ${t.type}`);
4091
+ }
4092
+ }
4093
+ function As(t, e, n) {
4094
+ let r = new SyntaxError(t);
4095
+ return r.name = "YAMLSyntaxError", r.source = e, r.position = n, r;
4096
+ }
4097
+ function Ts(t, e) {
4098
+ let n = t.source.range || t.source.valueRange;
4099
+ return As(t.message, e.text, e.transformRange(n));
4100
+ }
4101
+ function Cs(t, e, n) {
4102
+ return { offset: t, line: e, column: n };
4103
+ }
4104
+ function Ms(t, e) {
4105
+ t < 0 ? t = 0 : t > e.text.length && (t = e.text.length);
4106
+ let n = e.locator.locationForIndex(t);
4107
+ return Cs(t, n.line + 1, n.column + 1);
4108
+ }
4109
+ function ks(t, e) {
4110
+ return K(e.transformOffset(t.origStart), e.transformOffset(t.origEnd));
4111
+ }
4112
+ function vs(t) {
4113
+ if (!t.setOrigRanges()) {
4114
+ let e = (n) => {
4115
+ if (ho(n)) return n.origStart = n.start, n.origEnd = n.end, true;
4116
+ if (go(n)) return n.origOffset = n.offset, true;
4117
+ };
4118
+ t.forEach((n) => bn(n, e));
4119
+ }
4120
+ }
4121
+ function bn(t, e) {
4122
+ if (!(!t || typeof t != "object") && e(t) !== true) for (let n of Object.keys(t)) {
4123
+ if (n === "context" || n === "error") continue;
4124
+ let r = t[n];
4125
+ Array.isArray(r) ? r.forEach((s) => bn(s, e)) : bn(r, e);
4126
+ }
4127
+ }
4128
+ function ho(t) {
4129
+ return typeof t.start == "number";
4130
+ }
4131
+ function go(t) {
4132
+ return typeof t.offset == "number";
4133
+ }
4134
+ function Nn(t) {
4135
+ if ("children" in t) {
4136
+ if (t.children.length === 1) {
4137
+ let e = t.children[0];
4138
+ if (e.type === "plain" && e.tag === null && e.anchor === null && e.value === "") return t.children.splice(0, 1), t;
4139
+ }
4140
+ t.children.forEach(Nn);
4141
+ }
4142
+ return t;
4143
+ }
4144
+ function On(t, e, n, r) {
4145
+ let s = e(t);
4146
+ return (i) => {
4147
+ r(s, i) && n(t, s = i);
4148
+ };
4149
+ }
4150
+ function Ln(t) {
4151
+ if (t === null || !("children" in t)) return;
4152
+ let e = t.children;
4153
+ if (e.forEach(Ln), t.type === "document") {
4154
+ let [i, o] = t.children;
4155
+ i.position.start.offset === i.position.end.offset ? i.position.start = i.position.end = o.position.start : o.position.start.offset === o.position.end.offset && (o.position.start = o.position.end = i.position.end);
4156
+ }
4157
+ let n = On(t.position, yo, Eo, bo), r = On(t.position, So, wo, No);
4158
+ "endComments" in t && t.endComments.length !== 0 && (n(t.endComments[0].position.start), r(q(t.endComments).position.end));
4159
+ let s = e.filter((i) => i !== null);
4160
+ if (s.length !== 0) {
4161
+ let i = s[0], o = q(s);
4162
+ n(i.position.start), r(o.position.end), "leadingComments" in i && i.leadingComments.length !== 0 && n(i.leadingComments[0].position.start), "tag" in i && i.tag && n(i.tag.position.start), "anchor" in i && i.anchor && n(i.anchor.position.start), "trailingComment" in o && o.trailingComment && r(o.trailingComment.position.end);
4163
+ }
4164
+ }
4165
+ function yo(t) {
4166
+ return t.start;
4167
+ }
4168
+ function Eo(t, e) {
4169
+ t.start = e;
4170
+ }
4171
+ function So(t) {
4172
+ return t.end;
4173
+ }
4174
+ function wo(t, e) {
4175
+ t.end = e;
4176
+ }
4177
+ function bo(t, e) {
4178
+ return e.offset < t.offset;
4179
+ }
4180
+ function No(t, e) {
4181
+ return e.offset > t.offset;
4182
+ }
4183
+ var Si = rr(yi(), 1);
4184
+ var J = rr(Ei(), 1);
4185
+ var Ym = J.default.findPair;
4186
+ var Bm = J.default.toJSON;
4187
+ var $m = J.default.parseMap;
4188
+ var Fm = J.default.parseSeq;
4189
+ var qm = J.default.stringifyNumber;
4190
+ var Um = J.default.stringifyString;
4191
+ var Km = J.default.Type;
4192
+ var Ua = J.default.YAMLError;
4193
+ var Vm = J.default.YAMLReferenceError;
4194
+ var Zn = J.default.YAMLSemanticError;
4195
+ var Ka = J.default.YAMLSyntaxError;
4196
+ var Wm = J.default.YAMLWarning;
4197
+ var { Document: wi, parseCST: bi } = Si.default;
4198
+ function Ni(t) {
4199
+ let e = bi(t);
4200
+ vs(e);
4201
+ let n = e.map((a) => new wi({ merge: false, keepCstNodes: true }).parse(a)), r = new Rr(t), s = [], i = { text: t, locator: r, comments: s, transformOffset: (a) => Ms(a, i), transformRange: (a) => ks(a, i), transformNode: (a) => Ls(a, i), transformContent: (a) => vt(a, i) };
4202
+ for (let a of n) for (let c of a.errors) if (!(c instanceof Zn && c.message === 'Map keys must be unique; "<<" is repeated')) throw Ts(c, i);
4203
+ n.forEach((a) => ct(a.cstNode));
4204
+ let o = $r(i.transformRange({ origStart: 0, origEnd: i.text.length }), n.map(i.transformNode), s);
4205
+ return Dr(o), Ln(o), Nn(o), o;
4206
+ }
4207
+ function Wa(t, e) {
4208
+ let n = new SyntaxError(t + " (" + e.loc.start.line + ":" + e.loc.start.column + ")");
4209
+ return Object.assign(n, e);
4210
+ }
4211
+ var Oi = Wa;
4212
+ function ja(t) {
4213
+ try {
4214
+ let e = Ni(t);
4215
+ return delete e.comments, e;
4216
+ } catch (e) {
4217
+ throw e != null && e.position ? Oi(e.message, { loc: e.position, cause: e }) : e;
4218
+ }
4219
+ }
4220
+ var Qa = { astFormat: "yaml", parse: ja, hasPragma: Er, locStart: ve, locEnd: dr };
4221
+ var Ja = { yaml: Ir };
4222
+ var yh = tr;
4223
+ export {
4224
+ yh as default,
4225
+ Pr as languages,
4226
+ _r as options,
4227
+ er as parsers,
4228
+ Ja as printers
4229
+ };
4230
+ //# sourceMappingURL=yaml-DB2OVPLH.mjs.map