@prismicio/cli 0.0.1 → 0.0.2-alpha.xru-fix-npx-install-warnings.2

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