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