@voidagency/skills 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2801 @@
1
+ import { n as __require, t as __commonJSMin } from "../rolldown-runtime.mjs";
2
+ import { t as require_extend_shallow } from "./extend-shallow.mjs";
3
+ import { t as require_esprima } from "./esprima.mjs";
4
+ //#region ../../node_modules/kind-of/index.js
5
+ var require_kind_of = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6
+ var toString = Object.prototype.toString;
7
+ module.exports = function kindOf(val) {
8
+ if (val === void 0) return "undefined";
9
+ if (val === null) return "null";
10
+ var type = typeof val;
11
+ if (type === "boolean") return "boolean";
12
+ if (type === "string") return "string";
13
+ if (type === "number") return "number";
14
+ if (type === "symbol") return "symbol";
15
+ if (type === "function") return isGeneratorFn(val) ? "generatorfunction" : "function";
16
+ if (isArray(val)) return "array";
17
+ if (isBuffer(val)) return "buffer";
18
+ if (isArguments(val)) return "arguments";
19
+ if (isDate(val)) return "date";
20
+ if (isError(val)) return "error";
21
+ if (isRegexp(val)) return "regexp";
22
+ switch (ctorName(val)) {
23
+ case "Symbol": return "symbol";
24
+ case "Promise": return "promise";
25
+ case "WeakMap": return "weakmap";
26
+ case "WeakSet": return "weakset";
27
+ case "Map": return "map";
28
+ case "Set": return "set";
29
+ case "Int8Array": return "int8array";
30
+ case "Uint8Array": return "uint8array";
31
+ case "Uint8ClampedArray": return "uint8clampedarray";
32
+ case "Int16Array": return "int16array";
33
+ case "Uint16Array": return "uint16array";
34
+ case "Int32Array": return "int32array";
35
+ case "Uint32Array": return "uint32array";
36
+ case "Float32Array": return "float32array";
37
+ case "Float64Array": return "float64array";
38
+ }
39
+ if (isGeneratorObj(val)) return "generator";
40
+ type = toString.call(val);
41
+ switch (type) {
42
+ case "[object Object]": return "object";
43
+ case "[object Map Iterator]": return "mapiterator";
44
+ case "[object Set Iterator]": return "setiterator";
45
+ case "[object String Iterator]": return "stringiterator";
46
+ case "[object Array Iterator]": return "arrayiterator";
47
+ }
48
+ return type.slice(8, -1).toLowerCase().replace(/\s/g, "");
49
+ };
50
+ function ctorName(val) {
51
+ return typeof val.constructor === "function" ? val.constructor.name : null;
52
+ }
53
+ function isArray(val) {
54
+ if (Array.isArray) return Array.isArray(val);
55
+ return val instanceof Array;
56
+ }
57
+ function isError(val) {
58
+ return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
59
+ }
60
+ function isDate(val) {
61
+ if (val instanceof Date) return true;
62
+ return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
63
+ }
64
+ function isRegexp(val) {
65
+ if (val instanceof RegExp) return true;
66
+ return typeof val.flags === "string" && typeof val.ignoreCase === "boolean" && typeof val.multiline === "boolean" && typeof val.global === "boolean";
67
+ }
68
+ function isGeneratorFn(name, val) {
69
+ return ctorName(name) === "GeneratorFunction";
70
+ }
71
+ function isGeneratorObj(val) {
72
+ return typeof val.throw === "function" && typeof val.return === "function" && typeof val.next === "function";
73
+ }
74
+ function isArguments(val) {
75
+ try {
76
+ if (typeof val.length === "number" && typeof val.callee === "function") return true;
77
+ } catch (err) {
78
+ if (err.message.indexOf("callee") !== -1) return true;
79
+ }
80
+ return false;
81
+ }
82
+ /**
83
+ * If you need to support Safari 5-7 (8-10 yr-old browser),
84
+ * take a look at https://github.com/feross/is-buffer
85
+ */
86
+ function isBuffer(val) {
87
+ if (val.constructor && typeof val.constructor.isBuffer === "function") return val.constructor.isBuffer(val);
88
+ return false;
89
+ }
90
+ }));
91
+ //#endregion
92
+ //#region ../../node_modules/section-matter/index.js
93
+ var require_section_matter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
94
+ var typeOf = require_kind_of();
95
+ var extend = require_extend_shallow();
96
+ /**
97
+ * Parse sections in `input` with the given `options`.
98
+ *
99
+ * ```js
100
+ * var sections = require('{%= name %}');
101
+ * var result = sections(input, options);
102
+ * // { content: 'Content before sections', sections: [] }
103
+ * ```
104
+ * @param {String|Buffer|Object} `input` If input is an object, it's `content` property must be a string or buffer.
105
+ * @param {Object} options
106
+ * @return {Object} Returns an object with a `content` string and an array of `sections` objects.
107
+ * @api public
108
+ */
109
+ module.exports = function(input, options) {
110
+ if (typeof options === "function") options = { parse: options };
111
+ var file = toObject(input);
112
+ var opts = extend({}, {
113
+ section_delimiter: "---",
114
+ parse: identity
115
+ }, options);
116
+ var delim = opts.section_delimiter;
117
+ var lines = file.content.split(/\r?\n/);
118
+ var sections = null;
119
+ var section = createSection();
120
+ var content = [];
121
+ var stack = [];
122
+ function initSections(val) {
123
+ file.content = val;
124
+ sections = [];
125
+ content = [];
126
+ }
127
+ function closeSection(val) {
128
+ if (stack.length) {
129
+ section.key = getKey(stack[0], delim);
130
+ section.content = val;
131
+ opts.parse(section, sections);
132
+ sections.push(section);
133
+ section = createSection();
134
+ content = [];
135
+ stack = [];
136
+ }
137
+ }
138
+ for (var i = 0; i < lines.length; i++) {
139
+ var line = lines[i];
140
+ var len = stack.length;
141
+ var ln = line.trim();
142
+ if (isDelimiter(ln, delim)) {
143
+ if (ln.length === 3 && i !== 0) {
144
+ if (len === 0 || len === 2) {
145
+ content.push(line);
146
+ continue;
147
+ }
148
+ stack.push(ln);
149
+ section.data = content.join("\n");
150
+ content = [];
151
+ continue;
152
+ }
153
+ if (sections === null) initSections(content.join("\n"));
154
+ if (len === 2) closeSection(content.join("\n"));
155
+ stack.push(ln);
156
+ continue;
157
+ }
158
+ content.push(line);
159
+ }
160
+ if (sections === null) initSections(content.join("\n"));
161
+ else closeSection(content.join("\n"));
162
+ file.sections = sections;
163
+ return file;
164
+ };
165
+ function isDelimiter(line, delim) {
166
+ if (line.slice(0, delim.length) !== delim) return false;
167
+ if (line.charAt(delim.length + 1) === delim.slice(-1)) return false;
168
+ return true;
169
+ }
170
+ function toObject(input) {
171
+ if (typeOf(input) !== "object") input = { content: input };
172
+ if (typeof input.content !== "string" && !isBuffer(input.content)) throw new TypeError("expected a buffer or string");
173
+ input.content = input.content.toString();
174
+ input.sections = [];
175
+ return input;
176
+ }
177
+ function getKey(val, delim) {
178
+ return val ? val.slice(delim.length).trim() : "";
179
+ }
180
+ function createSection() {
181
+ return {
182
+ key: "",
183
+ data: "",
184
+ content: ""
185
+ };
186
+ }
187
+ function identity(val) {
188
+ return val;
189
+ }
190
+ function isBuffer(val) {
191
+ if (val && val.constructor && typeof val.constructor.isBuffer === "function") return val.constructor.isBuffer(val);
192
+ return false;
193
+ }
194
+ }));
195
+ //#endregion
196
+ //#region ../../node_modules/js-yaml/lib/js-yaml/common.js
197
+ var require_common = /* @__PURE__ */ __commonJSMin(((exports, module) => {
198
+ function isNothing(subject) {
199
+ return typeof subject === "undefined" || subject === null;
200
+ }
201
+ function isObject(subject) {
202
+ return typeof subject === "object" && subject !== null;
203
+ }
204
+ function toArray(sequence) {
205
+ if (Array.isArray(sequence)) return sequence;
206
+ else if (isNothing(sequence)) return [];
207
+ return [sequence];
208
+ }
209
+ function extend(target, source) {
210
+ var index, length, key, sourceKeys;
211
+ if (source) {
212
+ sourceKeys = Object.keys(source);
213
+ for (index = 0, length = sourceKeys.length; index < length; index += 1) {
214
+ key = sourceKeys[index];
215
+ target[key] = source[key];
216
+ }
217
+ }
218
+ return target;
219
+ }
220
+ function repeat(string, count) {
221
+ var result = "", cycle;
222
+ for (cycle = 0; cycle < count; cycle += 1) result += string;
223
+ return result;
224
+ }
225
+ function isNegativeZero(number) {
226
+ return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
227
+ }
228
+ module.exports.isNothing = isNothing;
229
+ module.exports.isObject = isObject;
230
+ module.exports.toArray = toArray;
231
+ module.exports.repeat = repeat;
232
+ module.exports.isNegativeZero = isNegativeZero;
233
+ module.exports.extend = extend;
234
+ }));
235
+ //#endregion
236
+ //#region ../../node_modules/js-yaml/lib/js-yaml/exception.js
237
+ var require_exception = /* @__PURE__ */ __commonJSMin(((exports, module) => {
238
+ function YAMLException(reason, mark) {
239
+ Error.call(this);
240
+ this.name = "YAMLException";
241
+ this.reason = reason;
242
+ this.mark = mark;
243
+ this.message = (this.reason || "(unknown reason)") + (this.mark ? " " + this.mark.toString() : "");
244
+ if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor);
245
+ else this.stack = (/* @__PURE__ */ new Error()).stack || "";
246
+ }
247
+ YAMLException.prototype = Object.create(Error.prototype);
248
+ YAMLException.prototype.constructor = YAMLException;
249
+ YAMLException.prototype.toString = function toString(compact) {
250
+ var result = this.name + ": ";
251
+ result += this.reason || "(unknown reason)";
252
+ if (!compact && this.mark) result += " " + this.mark.toString();
253
+ return result;
254
+ };
255
+ module.exports = YAMLException;
256
+ }));
257
+ //#endregion
258
+ //#region ../../node_modules/js-yaml/lib/js-yaml/mark.js
259
+ var require_mark = /* @__PURE__ */ __commonJSMin(((exports, module) => {
260
+ var common = require_common();
261
+ function Mark(name, buffer, position, line, column) {
262
+ this.name = name;
263
+ this.buffer = buffer;
264
+ this.position = position;
265
+ this.line = line;
266
+ this.column = column;
267
+ }
268
+ Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
269
+ var head, start, tail, end, snippet;
270
+ if (!this.buffer) return null;
271
+ indent = indent || 4;
272
+ maxLength = maxLength || 75;
273
+ head = "";
274
+ start = this.position;
275
+ while (start > 0 && "\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(start - 1)) === -1) {
276
+ start -= 1;
277
+ if (this.position - start > maxLength / 2 - 1) {
278
+ head = " ... ";
279
+ start += 5;
280
+ break;
281
+ }
282
+ }
283
+ tail = "";
284
+ end = this.position;
285
+ while (end < this.buffer.length && "\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(end)) === -1) {
286
+ end += 1;
287
+ if (end - this.position > maxLength / 2 - 1) {
288
+ tail = " ... ";
289
+ end -= 5;
290
+ break;
291
+ }
292
+ }
293
+ snippet = this.buffer.slice(start, end);
294
+ return common.repeat(" ", indent) + head + snippet + tail + "\n" + common.repeat(" ", indent + this.position - start + head.length) + "^";
295
+ };
296
+ Mark.prototype.toString = function toString(compact) {
297
+ var snippet, where = "";
298
+ if (this.name) where += "in \"" + this.name + "\" ";
299
+ where += "at line " + (this.line + 1) + ", column " + (this.column + 1);
300
+ if (!compact) {
301
+ snippet = this.getSnippet();
302
+ if (snippet) where += ":\n" + snippet;
303
+ }
304
+ return where;
305
+ };
306
+ module.exports = Mark;
307
+ }));
308
+ //#endregion
309
+ //#region ../../node_modules/js-yaml/lib/js-yaml/type.js
310
+ var require_type = /* @__PURE__ */ __commonJSMin(((exports, module) => {
311
+ var YAMLException = require_exception();
312
+ var TYPE_CONSTRUCTOR_OPTIONS = [
313
+ "kind",
314
+ "resolve",
315
+ "construct",
316
+ "instanceOf",
317
+ "predicate",
318
+ "represent",
319
+ "defaultStyle",
320
+ "styleAliases"
321
+ ];
322
+ var YAML_NODE_KINDS = [
323
+ "scalar",
324
+ "sequence",
325
+ "mapping"
326
+ ];
327
+ function compileStyleAliases(map) {
328
+ var result = {};
329
+ if (map !== null) Object.keys(map).forEach(function(style) {
330
+ map[style].forEach(function(alias) {
331
+ result[String(alias)] = style;
332
+ });
333
+ });
334
+ return result;
335
+ }
336
+ function Type(tag, options) {
337
+ options = options || {};
338
+ Object.keys(options).forEach(function(name) {
339
+ if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) throw new YAMLException("Unknown option \"" + name + "\" is met in definition of \"" + tag + "\" YAML type.");
340
+ });
341
+ this.tag = tag;
342
+ this.kind = options["kind"] || null;
343
+ this.resolve = options["resolve"] || function() {
344
+ return true;
345
+ };
346
+ this.construct = options["construct"] || function(data) {
347
+ return data;
348
+ };
349
+ this.instanceOf = options["instanceOf"] || null;
350
+ this.predicate = options["predicate"] || null;
351
+ this.represent = options["represent"] || null;
352
+ this.defaultStyle = options["defaultStyle"] || null;
353
+ this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
354
+ if (YAML_NODE_KINDS.indexOf(this.kind) === -1) throw new YAMLException("Unknown kind \"" + this.kind + "\" is specified for \"" + tag + "\" YAML type.");
355
+ }
356
+ module.exports = Type;
357
+ }));
358
+ //#endregion
359
+ //#region ../../node_modules/js-yaml/lib/js-yaml/schema.js
360
+ var require_schema = /* @__PURE__ */ __commonJSMin(((exports, module) => {
361
+ var common = require_common();
362
+ var YAMLException = require_exception();
363
+ var Type = require_type();
364
+ function compileList(schema, name, result) {
365
+ var exclude = [];
366
+ schema.include.forEach(function(includedSchema) {
367
+ result = compileList(includedSchema, name, result);
368
+ });
369
+ schema[name].forEach(function(currentType) {
370
+ result.forEach(function(previousType, previousIndex) {
371
+ if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) exclude.push(previousIndex);
372
+ });
373
+ result.push(currentType);
374
+ });
375
+ return result.filter(function(type, index) {
376
+ return exclude.indexOf(index) === -1;
377
+ });
378
+ }
379
+ function compileMap() {
380
+ var result = {
381
+ scalar: {},
382
+ sequence: {},
383
+ mapping: {},
384
+ fallback: {}
385
+ }, index, length;
386
+ function collectType(type) {
387
+ result[type.kind][type.tag] = result["fallback"][type.tag] = type;
388
+ }
389
+ for (index = 0, length = arguments.length; index < length; index += 1) arguments[index].forEach(collectType);
390
+ return result;
391
+ }
392
+ function Schema(definition) {
393
+ this.include = definition.include || [];
394
+ this.implicit = definition.implicit || [];
395
+ this.explicit = definition.explicit || [];
396
+ this.implicit.forEach(function(type) {
397
+ if (type.loadKind && type.loadKind !== "scalar") throw new YAMLException("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
398
+ });
399
+ this.compiledImplicit = compileList(this, "implicit", []);
400
+ this.compiledExplicit = compileList(this, "explicit", []);
401
+ this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);
402
+ }
403
+ Schema.DEFAULT = null;
404
+ Schema.create = function createSchema() {
405
+ var schemas, types;
406
+ switch (arguments.length) {
407
+ case 1:
408
+ schemas = Schema.DEFAULT;
409
+ types = arguments[0];
410
+ break;
411
+ case 2:
412
+ schemas = arguments[0];
413
+ types = arguments[1];
414
+ break;
415
+ default: throw new YAMLException("Wrong number of arguments for Schema.create function");
416
+ }
417
+ schemas = common.toArray(schemas);
418
+ types = common.toArray(types);
419
+ if (!schemas.every(function(schema) {
420
+ return schema instanceof Schema;
421
+ })) throw new YAMLException("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");
422
+ if (!types.every(function(type) {
423
+ return type instanceof Type;
424
+ })) throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object.");
425
+ return new Schema({
426
+ include: schemas,
427
+ explicit: types
428
+ });
429
+ };
430
+ module.exports = Schema;
431
+ }));
432
+ //#endregion
433
+ //#region ../../node_modules/js-yaml/lib/js-yaml/type/str.js
434
+ var require_str = /* @__PURE__ */ __commonJSMin(((exports, module) => {
435
+ module.exports = new (require_type())("tag:yaml.org,2002:str", {
436
+ kind: "scalar",
437
+ construct: function(data) {
438
+ return data !== null ? data : "";
439
+ }
440
+ });
441
+ }));
442
+ //#endregion
443
+ //#region ../../node_modules/js-yaml/lib/js-yaml/type/seq.js
444
+ var require_seq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
445
+ module.exports = new (require_type())("tag:yaml.org,2002:seq", {
446
+ kind: "sequence",
447
+ construct: function(data) {
448
+ return data !== null ? data : [];
449
+ }
450
+ });
451
+ }));
452
+ //#endregion
453
+ //#region ../../node_modules/js-yaml/lib/js-yaml/type/map.js
454
+ var require_map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
455
+ module.exports = new (require_type())("tag:yaml.org,2002:map", {
456
+ kind: "mapping",
457
+ construct: function(data) {
458
+ return data !== null ? data : {};
459
+ }
460
+ });
461
+ }));
462
+ //#endregion
463
+ //#region ../../node_modules/js-yaml/lib/js-yaml/schema/failsafe.js
464
+ var require_failsafe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
465
+ module.exports = new (require_schema())({ explicit: [
466
+ require_str(),
467
+ require_seq(),
468
+ require_map()
469
+ ] });
470
+ }));
471
+ //#endregion
472
+ //#region ../../node_modules/js-yaml/lib/js-yaml/type/null.js
473
+ var require_null = /* @__PURE__ */ __commonJSMin(((exports, module) => {
474
+ var Type = require_type();
475
+ function resolveYamlNull(data) {
476
+ if (data === null) return true;
477
+ var max = data.length;
478
+ return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
479
+ }
480
+ function constructYamlNull() {
481
+ return null;
482
+ }
483
+ function isNull(object) {
484
+ return object === null;
485
+ }
486
+ module.exports = new Type("tag:yaml.org,2002:null", {
487
+ kind: "scalar",
488
+ resolve: resolveYamlNull,
489
+ construct: constructYamlNull,
490
+ predicate: isNull,
491
+ represent: {
492
+ canonical: function() {
493
+ return "~";
494
+ },
495
+ lowercase: function() {
496
+ return "null";
497
+ },
498
+ uppercase: function() {
499
+ return "NULL";
500
+ },
501
+ camelcase: function() {
502
+ return "Null";
503
+ }
504
+ },
505
+ defaultStyle: "lowercase"
506
+ });
507
+ }));
508
+ //#endregion
509
+ //#region ../../node_modules/js-yaml/lib/js-yaml/type/bool.js
510
+ var require_bool = /* @__PURE__ */ __commonJSMin(((exports, module) => {
511
+ var Type = require_type();
512
+ function resolveYamlBoolean(data) {
513
+ if (data === null) return false;
514
+ var max = data.length;
515
+ return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
516
+ }
517
+ function constructYamlBoolean(data) {
518
+ return data === "true" || data === "True" || data === "TRUE";
519
+ }
520
+ function isBoolean(object) {
521
+ return Object.prototype.toString.call(object) === "[object Boolean]";
522
+ }
523
+ module.exports = new Type("tag:yaml.org,2002:bool", {
524
+ kind: "scalar",
525
+ resolve: resolveYamlBoolean,
526
+ construct: constructYamlBoolean,
527
+ predicate: isBoolean,
528
+ represent: {
529
+ lowercase: function(object) {
530
+ return object ? "true" : "false";
531
+ },
532
+ uppercase: function(object) {
533
+ return object ? "TRUE" : "FALSE";
534
+ },
535
+ camelcase: function(object) {
536
+ return object ? "True" : "False";
537
+ }
538
+ },
539
+ defaultStyle: "lowercase"
540
+ });
541
+ }));
542
+ //#endregion
543
+ //#region ../../node_modules/js-yaml/lib/js-yaml/type/int.js
544
+ var require_int = /* @__PURE__ */ __commonJSMin(((exports, module) => {
545
+ var common = require_common();
546
+ var Type = require_type();
547
+ function isHexCode(c) {
548
+ return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
549
+ }
550
+ function isOctCode(c) {
551
+ return 48 <= c && c <= 55;
552
+ }
553
+ function isDecCode(c) {
554
+ return 48 <= c && c <= 57;
555
+ }
556
+ function resolveYamlInteger(data) {
557
+ if (data === null) return false;
558
+ var max = data.length, index = 0, hasDigits = false, ch;
559
+ if (!max) return false;
560
+ ch = data[index];
561
+ if (ch === "-" || ch === "+") ch = data[++index];
562
+ if (ch === "0") {
563
+ if (index + 1 === max) return true;
564
+ ch = data[++index];
565
+ if (ch === "b") {
566
+ index++;
567
+ for (; index < max; index++) {
568
+ ch = data[index];
569
+ if (ch === "_") continue;
570
+ if (ch !== "0" && ch !== "1") return false;
571
+ hasDigits = true;
572
+ }
573
+ return hasDigits && ch !== "_";
574
+ }
575
+ if (ch === "x") {
576
+ index++;
577
+ for (; index < max; index++) {
578
+ ch = data[index];
579
+ if (ch === "_") continue;
580
+ if (!isHexCode(data.charCodeAt(index))) return false;
581
+ hasDigits = true;
582
+ }
583
+ return hasDigits && ch !== "_";
584
+ }
585
+ for (; index < max; index++) {
586
+ ch = data[index];
587
+ if (ch === "_") continue;
588
+ if (!isOctCode(data.charCodeAt(index))) return false;
589
+ hasDigits = true;
590
+ }
591
+ return hasDigits && ch !== "_";
592
+ }
593
+ if (ch === "_") return false;
594
+ for (; index < max; index++) {
595
+ ch = data[index];
596
+ if (ch === "_") continue;
597
+ if (ch === ":") break;
598
+ if (!isDecCode(data.charCodeAt(index))) return false;
599
+ hasDigits = true;
600
+ }
601
+ if (!hasDigits || ch === "_") return false;
602
+ if (ch !== ":") return true;
603
+ return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
604
+ }
605
+ function constructYamlInteger(data) {
606
+ var value = data, sign = 1, ch, base, digits = [];
607
+ if (value.indexOf("_") !== -1) value = value.replace(/_/g, "");
608
+ ch = value[0];
609
+ if (ch === "-" || ch === "+") {
610
+ if (ch === "-") sign = -1;
611
+ value = value.slice(1);
612
+ ch = value[0];
613
+ }
614
+ if (value === "0") return 0;
615
+ if (ch === "0") {
616
+ if (value[1] === "b") return sign * parseInt(value.slice(2), 2);
617
+ if (value[1] === "x") return sign * parseInt(value, 16);
618
+ return sign * parseInt(value, 8);
619
+ }
620
+ if (value.indexOf(":") !== -1) {
621
+ value.split(":").forEach(function(v) {
622
+ digits.unshift(parseInt(v, 10));
623
+ });
624
+ value = 0;
625
+ base = 1;
626
+ digits.forEach(function(d) {
627
+ value += d * base;
628
+ base *= 60;
629
+ });
630
+ return sign * value;
631
+ }
632
+ return sign * parseInt(value, 10);
633
+ }
634
+ function isInteger(object) {
635
+ return Object.prototype.toString.call(object) === "[object Number]" && object % 1 === 0 && !common.isNegativeZero(object);
636
+ }
637
+ module.exports = new Type("tag:yaml.org,2002:int", {
638
+ kind: "scalar",
639
+ resolve: resolveYamlInteger,
640
+ construct: constructYamlInteger,
641
+ predicate: isInteger,
642
+ represent: {
643
+ binary: function(obj) {
644
+ return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
645
+ },
646
+ octal: function(obj) {
647
+ return obj >= 0 ? "0" + obj.toString(8) : "-0" + obj.toString(8).slice(1);
648
+ },
649
+ decimal: function(obj) {
650
+ return obj.toString(10);
651
+ },
652
+ hexadecimal: function(obj) {
653
+ return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
654
+ }
655
+ },
656
+ defaultStyle: "decimal",
657
+ styleAliases: {
658
+ binary: [2, "bin"],
659
+ octal: [8, "oct"],
660
+ decimal: [10, "dec"],
661
+ hexadecimal: [16, "hex"]
662
+ }
663
+ });
664
+ }));
665
+ //#endregion
666
+ //#region ../../node_modules/js-yaml/lib/js-yaml/type/float.js
667
+ var require_float = /* @__PURE__ */ __commonJSMin(((exports, module) => {
668
+ var common = require_common();
669
+ var Type = require_type();
670
+ var YAML_FLOAT_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
671
+ function resolveYamlFloat(data) {
672
+ if (data === null) return false;
673
+ if (!YAML_FLOAT_PATTERN.test(data) || data[data.length - 1] === "_") return false;
674
+ return true;
675
+ }
676
+ function constructYamlFloat(data) {
677
+ var value = data.replace(/_/g, "").toLowerCase(), sign = value[0] === "-" ? -1 : 1, base, digits = [];
678
+ if ("+-".indexOf(value[0]) >= 0) value = value.slice(1);
679
+ if (value === ".inf") return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
680
+ else if (value === ".nan") return NaN;
681
+ else if (value.indexOf(":") >= 0) {
682
+ value.split(":").forEach(function(v) {
683
+ digits.unshift(parseFloat(v, 10));
684
+ });
685
+ value = 0;
686
+ base = 1;
687
+ digits.forEach(function(d) {
688
+ value += d * base;
689
+ base *= 60;
690
+ });
691
+ return sign * value;
692
+ }
693
+ return sign * parseFloat(value, 10);
694
+ }
695
+ var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
696
+ function representYamlFloat(object, style) {
697
+ var res;
698
+ if (isNaN(object)) switch (style) {
699
+ case "lowercase": return ".nan";
700
+ case "uppercase": return ".NAN";
701
+ case "camelcase": return ".NaN";
702
+ }
703
+ else if (Number.POSITIVE_INFINITY === object) switch (style) {
704
+ case "lowercase": return ".inf";
705
+ case "uppercase": return ".INF";
706
+ case "camelcase": return ".Inf";
707
+ }
708
+ else if (Number.NEGATIVE_INFINITY === object) switch (style) {
709
+ case "lowercase": return "-.inf";
710
+ case "uppercase": return "-.INF";
711
+ case "camelcase": return "-.Inf";
712
+ }
713
+ else if (common.isNegativeZero(object)) return "-0.0";
714
+ res = object.toString(10);
715
+ return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
716
+ }
717
+ function isFloat(object) {
718
+ return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object));
719
+ }
720
+ module.exports = new Type("tag:yaml.org,2002:float", {
721
+ kind: "scalar",
722
+ resolve: resolveYamlFloat,
723
+ construct: constructYamlFloat,
724
+ predicate: isFloat,
725
+ represent: representYamlFloat,
726
+ defaultStyle: "lowercase"
727
+ });
728
+ }));
729
+ //#endregion
730
+ //#region ../../node_modules/js-yaml/lib/js-yaml/schema/json.js
731
+ var require_json = /* @__PURE__ */ __commonJSMin(((exports, module) => {
732
+ module.exports = new (require_schema())({
733
+ include: [require_failsafe()],
734
+ implicit: [
735
+ require_null(),
736
+ require_bool(),
737
+ require_int(),
738
+ require_float()
739
+ ]
740
+ });
741
+ }));
742
+ //#endregion
743
+ //#region ../../node_modules/js-yaml/lib/js-yaml/schema/core.js
744
+ var require_core = /* @__PURE__ */ __commonJSMin(((exports, module) => {
745
+ module.exports = new (require_schema())({ include: [require_json()] });
746
+ }));
747
+ //#endregion
748
+ //#region ../../node_modules/js-yaml/lib/js-yaml/type/timestamp.js
749
+ var require_timestamp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
750
+ var Type = require_type();
751
+ var YAML_DATE_REGEXP = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$");
752
+ var YAML_TIMESTAMP_REGEXP = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");
753
+ function resolveYamlTimestamp(data) {
754
+ if (data === null) return false;
755
+ if (YAML_DATE_REGEXP.exec(data) !== null) return true;
756
+ if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
757
+ return false;
758
+ }
759
+ function constructYamlTimestamp(data) {
760
+ var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
761
+ match = YAML_DATE_REGEXP.exec(data);
762
+ if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
763
+ if (match === null) throw new Error("Date resolve error");
764
+ year = +match[1];
765
+ month = +match[2] - 1;
766
+ day = +match[3];
767
+ if (!match[4]) return new Date(Date.UTC(year, month, day));
768
+ hour = +match[4];
769
+ minute = +match[5];
770
+ second = +match[6];
771
+ if (match[7]) {
772
+ fraction = match[7].slice(0, 3);
773
+ while (fraction.length < 3) fraction += "0";
774
+ fraction = +fraction;
775
+ }
776
+ if (match[9]) {
777
+ tz_hour = +match[10];
778
+ tz_minute = +(match[11] || 0);
779
+ delta = (tz_hour * 60 + tz_minute) * 6e4;
780
+ if (match[9] === "-") delta = -delta;
781
+ }
782
+ date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
783
+ if (delta) date.setTime(date.getTime() - delta);
784
+ return date;
785
+ }
786
+ function representYamlTimestamp(object) {
787
+ return object.toISOString();
788
+ }
789
+ module.exports = new Type("tag:yaml.org,2002:timestamp", {
790
+ kind: "scalar",
791
+ resolve: resolveYamlTimestamp,
792
+ construct: constructYamlTimestamp,
793
+ instanceOf: Date,
794
+ represent: representYamlTimestamp
795
+ });
796
+ }));
797
+ //#endregion
798
+ //#region ../../node_modules/js-yaml/lib/js-yaml/type/merge.js
799
+ var require_merge = /* @__PURE__ */ __commonJSMin(((exports, module) => {
800
+ var Type = require_type();
801
+ function resolveYamlMerge(data) {
802
+ return data === "<<" || data === null;
803
+ }
804
+ module.exports = new Type("tag:yaml.org,2002:merge", {
805
+ kind: "scalar",
806
+ resolve: resolveYamlMerge
807
+ });
808
+ }));
809
+ //#endregion
810
+ //#region ../../node_modules/js-yaml/lib/js-yaml/type/binary.js
811
+ var require_binary = /* @__PURE__ */ __commonJSMin(((exports, module) => {
812
+ var NodeBuffer;
813
+ try {
814
+ NodeBuffer = __require("buffer").Buffer;
815
+ } catch (__) {}
816
+ var Type = require_type();
817
+ var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
818
+ function resolveYamlBinary(data) {
819
+ if (data === null) return false;
820
+ var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
821
+ for (idx = 0; idx < max; idx++) {
822
+ code = map.indexOf(data.charAt(idx));
823
+ if (code > 64) continue;
824
+ if (code < 0) return false;
825
+ bitlen += 6;
826
+ }
827
+ return bitlen % 8 === 0;
828
+ }
829
+ function constructYamlBinary(data) {
830
+ var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map = BASE64_MAP, bits = 0, result = [];
831
+ for (idx = 0; idx < max; idx++) {
832
+ if (idx % 4 === 0 && idx) {
833
+ result.push(bits >> 16 & 255);
834
+ result.push(bits >> 8 & 255);
835
+ result.push(bits & 255);
836
+ }
837
+ bits = bits << 6 | map.indexOf(input.charAt(idx));
838
+ }
839
+ tailbits = max % 4 * 6;
840
+ if (tailbits === 0) {
841
+ result.push(bits >> 16 & 255);
842
+ result.push(bits >> 8 & 255);
843
+ result.push(bits & 255);
844
+ } else if (tailbits === 18) {
845
+ result.push(bits >> 10 & 255);
846
+ result.push(bits >> 2 & 255);
847
+ } else if (tailbits === 12) result.push(bits >> 4 & 255);
848
+ if (NodeBuffer) return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result);
849
+ return result;
850
+ }
851
+ function representYamlBinary(object) {
852
+ var result = "", bits = 0, idx, tail, max = object.length, map = BASE64_MAP;
853
+ for (idx = 0; idx < max; idx++) {
854
+ if (idx % 3 === 0 && idx) {
855
+ result += map[bits >> 18 & 63];
856
+ result += map[bits >> 12 & 63];
857
+ result += map[bits >> 6 & 63];
858
+ result += map[bits & 63];
859
+ }
860
+ bits = (bits << 8) + object[idx];
861
+ }
862
+ tail = max % 3;
863
+ if (tail === 0) {
864
+ result += map[bits >> 18 & 63];
865
+ result += map[bits >> 12 & 63];
866
+ result += map[bits >> 6 & 63];
867
+ result += map[bits & 63];
868
+ } else if (tail === 2) {
869
+ result += map[bits >> 10 & 63];
870
+ result += map[bits >> 4 & 63];
871
+ result += map[bits << 2 & 63];
872
+ result += map[64];
873
+ } else if (tail === 1) {
874
+ result += map[bits >> 2 & 63];
875
+ result += map[bits << 4 & 63];
876
+ result += map[64];
877
+ result += map[64];
878
+ }
879
+ return result;
880
+ }
881
+ function isBinary(object) {
882
+ return NodeBuffer && NodeBuffer.isBuffer(object);
883
+ }
884
+ module.exports = new Type("tag:yaml.org,2002:binary", {
885
+ kind: "scalar",
886
+ resolve: resolveYamlBinary,
887
+ construct: constructYamlBinary,
888
+ predicate: isBinary,
889
+ represent: representYamlBinary
890
+ });
891
+ }));
892
+ //#endregion
893
+ //#region ../../node_modules/js-yaml/lib/js-yaml/type/omap.js
894
+ var require_omap = /* @__PURE__ */ __commonJSMin(((exports, module) => {
895
+ var Type = require_type();
896
+ var _hasOwnProperty = Object.prototype.hasOwnProperty;
897
+ var _toString = Object.prototype.toString;
898
+ function resolveYamlOmap(data) {
899
+ if (data === null) return true;
900
+ var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
901
+ for (index = 0, length = object.length; index < length; index += 1) {
902
+ pair = object[index];
903
+ pairHasKey = false;
904
+ if (_toString.call(pair) !== "[object Object]") return false;
905
+ for (pairKey in pair) if (_hasOwnProperty.call(pair, pairKey)) if (!pairHasKey) pairHasKey = true;
906
+ else return false;
907
+ if (!pairHasKey) return false;
908
+ if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
909
+ else return false;
910
+ }
911
+ return true;
912
+ }
913
+ function constructYamlOmap(data) {
914
+ return data !== null ? data : [];
915
+ }
916
+ module.exports = new Type("tag:yaml.org,2002:omap", {
917
+ kind: "sequence",
918
+ resolve: resolveYamlOmap,
919
+ construct: constructYamlOmap
920
+ });
921
+ }));
922
+ //#endregion
923
+ //#region ../../node_modules/js-yaml/lib/js-yaml/type/pairs.js
924
+ var require_pairs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
925
+ var Type = require_type();
926
+ var _toString = Object.prototype.toString;
927
+ function resolveYamlPairs(data) {
928
+ if (data === null) return true;
929
+ var index, length, pair, keys, result, object = data;
930
+ result = new Array(object.length);
931
+ for (index = 0, length = object.length; index < length; index += 1) {
932
+ pair = object[index];
933
+ if (_toString.call(pair) !== "[object Object]") return false;
934
+ keys = Object.keys(pair);
935
+ if (keys.length !== 1) return false;
936
+ result[index] = [keys[0], pair[keys[0]]];
937
+ }
938
+ return true;
939
+ }
940
+ function constructYamlPairs(data) {
941
+ if (data === null) return [];
942
+ var index, length, pair, keys, result, object = data;
943
+ result = new Array(object.length);
944
+ for (index = 0, length = object.length; index < length; index += 1) {
945
+ pair = object[index];
946
+ keys = Object.keys(pair);
947
+ result[index] = [keys[0], pair[keys[0]]];
948
+ }
949
+ return result;
950
+ }
951
+ module.exports = new Type("tag:yaml.org,2002:pairs", {
952
+ kind: "sequence",
953
+ resolve: resolveYamlPairs,
954
+ construct: constructYamlPairs
955
+ });
956
+ }));
957
+ //#endregion
958
+ //#region ../../node_modules/js-yaml/lib/js-yaml/type/set.js
959
+ var require_set = /* @__PURE__ */ __commonJSMin(((exports, module) => {
960
+ var Type = require_type();
961
+ var _hasOwnProperty = Object.prototype.hasOwnProperty;
962
+ function resolveYamlSet(data) {
963
+ if (data === null) return true;
964
+ var key, object = data;
965
+ for (key in object) if (_hasOwnProperty.call(object, key)) {
966
+ if (object[key] !== null) return false;
967
+ }
968
+ return true;
969
+ }
970
+ function constructYamlSet(data) {
971
+ return data !== null ? data : {};
972
+ }
973
+ module.exports = new Type("tag:yaml.org,2002:set", {
974
+ kind: "mapping",
975
+ resolve: resolveYamlSet,
976
+ construct: constructYamlSet
977
+ });
978
+ }));
979
+ //#endregion
980
+ //#region ../../node_modules/js-yaml/lib/js-yaml/schema/default_safe.js
981
+ var require_default_safe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
982
+ module.exports = new (require_schema())({
983
+ include: [require_core()],
984
+ implicit: [require_timestamp(), require_merge()],
985
+ explicit: [
986
+ require_binary(),
987
+ require_omap(),
988
+ require_pairs(),
989
+ require_set()
990
+ ]
991
+ });
992
+ }));
993
+ //#endregion
994
+ //#region ../../node_modules/js-yaml/lib/js-yaml/type/js/undefined.js
995
+ var require_undefined = /* @__PURE__ */ __commonJSMin(((exports, module) => {
996
+ var Type = require_type();
997
+ function resolveJavascriptUndefined() {
998
+ return true;
999
+ }
1000
+ function constructJavascriptUndefined() {}
1001
+ function representJavascriptUndefined() {
1002
+ return "";
1003
+ }
1004
+ function isUndefined(object) {
1005
+ return typeof object === "undefined";
1006
+ }
1007
+ module.exports = new Type("tag:yaml.org,2002:js/undefined", {
1008
+ kind: "scalar",
1009
+ resolve: resolveJavascriptUndefined,
1010
+ construct: constructJavascriptUndefined,
1011
+ predicate: isUndefined,
1012
+ represent: representJavascriptUndefined
1013
+ });
1014
+ }));
1015
+ //#endregion
1016
+ //#region ../../node_modules/js-yaml/lib/js-yaml/type/js/regexp.js
1017
+ var require_regexp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1018
+ var Type = require_type();
1019
+ function resolveJavascriptRegExp(data) {
1020
+ if (data === null) return false;
1021
+ if (data.length === 0) return false;
1022
+ var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = "";
1023
+ if (regexp[0] === "/") {
1024
+ if (tail) modifiers = tail[1];
1025
+ if (modifiers.length > 3) return false;
1026
+ if (regexp[regexp.length - modifiers.length - 1] !== "/") return false;
1027
+ }
1028
+ return true;
1029
+ }
1030
+ function constructJavascriptRegExp(data) {
1031
+ var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = "";
1032
+ if (regexp[0] === "/") {
1033
+ if (tail) modifiers = tail[1];
1034
+ regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
1035
+ }
1036
+ return new RegExp(regexp, modifiers);
1037
+ }
1038
+ function representJavascriptRegExp(object) {
1039
+ var result = "/" + object.source + "/";
1040
+ if (object.global) result += "g";
1041
+ if (object.multiline) result += "m";
1042
+ if (object.ignoreCase) result += "i";
1043
+ return result;
1044
+ }
1045
+ function isRegExp(object) {
1046
+ return Object.prototype.toString.call(object) === "[object RegExp]";
1047
+ }
1048
+ module.exports = new Type("tag:yaml.org,2002:js/regexp", {
1049
+ kind: "scalar",
1050
+ resolve: resolveJavascriptRegExp,
1051
+ construct: constructJavascriptRegExp,
1052
+ predicate: isRegExp,
1053
+ represent: representJavascriptRegExp
1054
+ });
1055
+ }));
1056
+ //#endregion
1057
+ //#region ../../node_modules/js-yaml/lib/js-yaml/type/js/function.js
1058
+ var require_function = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1059
+ var esprima;
1060
+ try {
1061
+ esprima = require_esprima();
1062
+ } catch (_) {
1063
+ if (typeof window !== "undefined") esprima = window.esprima;
1064
+ }
1065
+ var Type = require_type();
1066
+ function resolveJavascriptFunction(data) {
1067
+ if (data === null) return false;
1068
+ try {
1069
+ var source = "(" + data + ")", ast = esprima.parse(source, { range: true });
1070
+ if (ast.type !== "Program" || ast.body.length !== 1 || ast.body[0].type !== "ExpressionStatement" || ast.body[0].expression.type !== "ArrowFunctionExpression" && ast.body[0].expression.type !== "FunctionExpression") return false;
1071
+ return true;
1072
+ } catch (err) {
1073
+ return false;
1074
+ }
1075
+ }
1076
+ function constructJavascriptFunction(data) {
1077
+ var source = "(" + data + ")", ast = esprima.parse(source, { range: true }), params = [], body;
1078
+ if (ast.type !== "Program" || ast.body.length !== 1 || ast.body[0].type !== "ExpressionStatement" || ast.body[0].expression.type !== "ArrowFunctionExpression" && ast.body[0].expression.type !== "FunctionExpression") throw new Error("Failed to resolve function");
1079
+ ast.body[0].expression.params.forEach(function(param) {
1080
+ params.push(param.name);
1081
+ });
1082
+ body = ast.body[0].expression.body.range;
1083
+ if (ast.body[0].expression.body.type === "BlockStatement") return new Function(params, source.slice(body[0] + 1, body[1] - 1));
1084
+ return new Function(params, "return " + source.slice(body[0], body[1]));
1085
+ }
1086
+ function representJavascriptFunction(object) {
1087
+ return object.toString();
1088
+ }
1089
+ function isFunction(object) {
1090
+ return Object.prototype.toString.call(object) === "[object Function]";
1091
+ }
1092
+ module.exports = new Type("tag:yaml.org,2002:js/function", {
1093
+ kind: "scalar",
1094
+ resolve: resolveJavascriptFunction,
1095
+ construct: constructJavascriptFunction,
1096
+ predicate: isFunction,
1097
+ represent: representJavascriptFunction
1098
+ });
1099
+ }));
1100
+ //#endregion
1101
+ //#region ../../node_modules/js-yaml/lib/js-yaml/schema/default_full.js
1102
+ var require_default_full = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1103
+ var Schema = require_schema();
1104
+ module.exports = Schema.DEFAULT = new Schema({
1105
+ include: [require_default_safe()],
1106
+ explicit: [
1107
+ require_undefined(),
1108
+ require_regexp(),
1109
+ require_function()
1110
+ ]
1111
+ });
1112
+ }));
1113
+ //#endregion
1114
+ //#region ../../node_modules/js-yaml/lib/js-yaml/loader.js
1115
+ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1116
+ var common = require_common();
1117
+ var YAMLException = require_exception();
1118
+ var Mark = require_mark();
1119
+ var DEFAULT_SAFE_SCHEMA = require_default_safe();
1120
+ var DEFAULT_FULL_SCHEMA = require_default_full();
1121
+ var _hasOwnProperty = Object.prototype.hasOwnProperty;
1122
+ var CONTEXT_FLOW_IN = 1;
1123
+ var CONTEXT_FLOW_OUT = 2;
1124
+ var CONTEXT_BLOCK_IN = 3;
1125
+ var CONTEXT_BLOCK_OUT = 4;
1126
+ var CHOMPING_CLIP = 1;
1127
+ var CHOMPING_STRIP = 2;
1128
+ var CHOMPING_KEEP = 3;
1129
+ var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
1130
+ var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
1131
+ var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
1132
+ var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
1133
+ var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
1134
+ function _class(obj) {
1135
+ return Object.prototype.toString.call(obj);
1136
+ }
1137
+ function is_EOL(c) {
1138
+ return c === 10 || c === 13;
1139
+ }
1140
+ function is_WHITE_SPACE(c) {
1141
+ return c === 9 || c === 32;
1142
+ }
1143
+ function is_WS_OR_EOL(c) {
1144
+ return c === 9 || c === 32 || c === 10 || c === 13;
1145
+ }
1146
+ function is_FLOW_INDICATOR(c) {
1147
+ return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
1148
+ }
1149
+ function fromHexCode(c) {
1150
+ var lc;
1151
+ if (48 <= c && c <= 57) return c - 48;
1152
+ lc = c | 32;
1153
+ if (97 <= lc && lc <= 102) return lc - 97 + 10;
1154
+ return -1;
1155
+ }
1156
+ function escapedHexLen(c) {
1157
+ if (c === 120) return 2;
1158
+ if (c === 117) return 4;
1159
+ if (c === 85) return 8;
1160
+ return 0;
1161
+ }
1162
+ function fromDecimalCode(c) {
1163
+ if (48 <= c && c <= 57) return c - 48;
1164
+ return -1;
1165
+ }
1166
+ function simpleEscapeSequence(c) {
1167
+ return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "\x1B" : c === 32 ? " " : c === 34 ? "\"" : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "…" : c === 95 ? "\xA0" : c === 76 ? "\u2028" : c === 80 ? "\u2029" : "";
1168
+ }
1169
+ function charFromCodepoint(c) {
1170
+ if (c <= 65535) return String.fromCharCode(c);
1171
+ return String.fromCharCode((c - 65536 >> 10) + 55296, (c - 65536 & 1023) + 56320);
1172
+ }
1173
+ function setProperty(object, key, value) {
1174
+ if (key === "__proto__") Object.defineProperty(object, key, {
1175
+ configurable: true,
1176
+ enumerable: true,
1177
+ writable: true,
1178
+ value
1179
+ });
1180
+ else object[key] = value;
1181
+ }
1182
+ var simpleEscapeCheck = new Array(256);
1183
+ var simpleEscapeMap = new Array(256);
1184
+ for (var i = 0; i < 256; i++) {
1185
+ simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
1186
+ simpleEscapeMap[i] = simpleEscapeSequence(i);
1187
+ }
1188
+ function State(input, options) {
1189
+ this.input = input;
1190
+ this.filename = options["filename"] || null;
1191
+ this.schema = options["schema"] || DEFAULT_FULL_SCHEMA;
1192
+ this.onWarning = options["onWarning"] || null;
1193
+ this.legacy = options["legacy"] || false;
1194
+ this.json = options["json"] || false;
1195
+ this.listener = options["listener"] || null;
1196
+ this.implicitTypes = this.schema.compiledImplicit;
1197
+ this.typeMap = this.schema.compiledTypeMap;
1198
+ this.length = input.length;
1199
+ this.position = 0;
1200
+ this.line = 0;
1201
+ this.lineStart = 0;
1202
+ this.lineIndent = 0;
1203
+ this.documents = [];
1204
+ }
1205
+ function generateError(state, message) {
1206
+ return new YAMLException(message, new Mark(state.filename, state.input, state.position, state.line, state.position - state.lineStart));
1207
+ }
1208
+ function throwError(state, message) {
1209
+ throw generateError(state, message);
1210
+ }
1211
+ function throwWarning(state, message) {
1212
+ if (state.onWarning) state.onWarning.call(null, generateError(state, message));
1213
+ }
1214
+ var directiveHandlers = {
1215
+ YAML: function handleYamlDirective(state, name, args) {
1216
+ var match, major, minor;
1217
+ if (state.version !== null) throwError(state, "duplication of %YAML directive");
1218
+ if (args.length !== 1) throwError(state, "YAML directive accepts exactly one argument");
1219
+ match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
1220
+ if (match === null) throwError(state, "ill-formed argument of the YAML directive");
1221
+ major = parseInt(match[1], 10);
1222
+ minor = parseInt(match[2], 10);
1223
+ if (major !== 1) throwError(state, "unacceptable YAML version of the document");
1224
+ state.version = args[0];
1225
+ state.checkLineBreaks = minor < 2;
1226
+ if (minor !== 1 && minor !== 2) throwWarning(state, "unsupported YAML version of the document");
1227
+ },
1228
+ TAG: function handleTagDirective(state, name, args) {
1229
+ var handle, prefix;
1230
+ if (args.length !== 2) throwError(state, "TAG directive accepts exactly two arguments");
1231
+ handle = args[0];
1232
+ prefix = args[1];
1233
+ if (!PATTERN_TAG_HANDLE.test(handle)) throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
1234
+ if (_hasOwnProperty.call(state.tagMap, handle)) throwError(state, "there is a previously declared suffix for \"" + handle + "\" tag handle");
1235
+ if (!PATTERN_TAG_URI.test(prefix)) throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
1236
+ state.tagMap[handle] = prefix;
1237
+ }
1238
+ };
1239
+ function captureSegment(state, start, end, checkJson) {
1240
+ var _position, _length, _character, _result;
1241
+ if (start < end) {
1242
+ _result = state.input.slice(start, end);
1243
+ if (checkJson) for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
1244
+ _character = _result.charCodeAt(_position);
1245
+ if (!(_character === 9 || 32 <= _character && _character <= 1114111)) throwError(state, "expected valid JSON character");
1246
+ }
1247
+ else if (PATTERN_NON_PRINTABLE.test(_result)) throwError(state, "the stream contains non-printable characters");
1248
+ state.result += _result;
1249
+ }
1250
+ }
1251
+ function mergeMappings(state, destination, source, overridableKeys) {
1252
+ var sourceKeys, key, index, quantity;
1253
+ if (!common.isObject(source)) throwError(state, "cannot merge mappings; the provided source object is unacceptable");
1254
+ sourceKeys = Object.keys(source);
1255
+ for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
1256
+ key = sourceKeys[index];
1257
+ if (!_hasOwnProperty.call(destination, key)) {
1258
+ setProperty(destination, key, source[key]);
1259
+ overridableKeys[key] = true;
1260
+ }
1261
+ }
1262
+ }
1263
+ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) {
1264
+ var index, quantity;
1265
+ if (Array.isArray(keyNode)) {
1266
+ keyNode = Array.prototype.slice.call(keyNode);
1267
+ for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
1268
+ if (Array.isArray(keyNode[index])) throwError(state, "nested arrays are not supported inside keys");
1269
+ if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") keyNode[index] = "[object Object]";
1270
+ }
1271
+ }
1272
+ if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") keyNode = "[object Object]";
1273
+ keyNode = String(keyNode);
1274
+ if (_result === null) _result = {};
1275
+ if (keyTag === "tag:yaml.org,2002:merge") if (Array.isArray(valueNode)) for (index = 0, quantity = valueNode.length; index < quantity; index += 1) mergeMappings(state, _result, valueNode[index], overridableKeys);
1276
+ else mergeMappings(state, _result, valueNode, overridableKeys);
1277
+ else {
1278
+ if (!state.json && !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) {
1279
+ state.line = startLine || state.line;
1280
+ state.position = startPos || state.position;
1281
+ throwError(state, "duplicated mapping key");
1282
+ }
1283
+ setProperty(_result, keyNode, valueNode);
1284
+ delete overridableKeys[keyNode];
1285
+ }
1286
+ return _result;
1287
+ }
1288
+ function readLineBreak(state) {
1289
+ var ch = state.input.charCodeAt(state.position);
1290
+ if (ch === 10) state.position++;
1291
+ else if (ch === 13) {
1292
+ state.position++;
1293
+ if (state.input.charCodeAt(state.position) === 10) state.position++;
1294
+ } else throwError(state, "a line break is expected");
1295
+ state.line += 1;
1296
+ state.lineStart = state.position;
1297
+ }
1298
+ function skipSeparationSpace(state, allowComments, checkIndent) {
1299
+ var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
1300
+ while (ch !== 0) {
1301
+ while (is_WHITE_SPACE(ch)) ch = state.input.charCodeAt(++state.position);
1302
+ if (allowComments && ch === 35) do
1303
+ ch = state.input.charCodeAt(++state.position);
1304
+ while (ch !== 10 && ch !== 13 && ch !== 0);
1305
+ if (is_EOL(ch)) {
1306
+ readLineBreak(state);
1307
+ ch = state.input.charCodeAt(state.position);
1308
+ lineBreaks++;
1309
+ state.lineIndent = 0;
1310
+ while (ch === 32) {
1311
+ state.lineIndent++;
1312
+ ch = state.input.charCodeAt(++state.position);
1313
+ }
1314
+ } else break;
1315
+ }
1316
+ if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) throwWarning(state, "deficient indentation");
1317
+ return lineBreaks;
1318
+ }
1319
+ function testDocumentSeparator(state) {
1320
+ var _position = state.position, ch = state.input.charCodeAt(_position);
1321
+ if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
1322
+ _position += 3;
1323
+ ch = state.input.charCodeAt(_position);
1324
+ if (ch === 0 || is_WS_OR_EOL(ch)) return true;
1325
+ }
1326
+ return false;
1327
+ }
1328
+ function writeFoldedLines(state, count) {
1329
+ if (count === 1) state.result += " ";
1330
+ else if (count > 1) state.result += common.repeat("\n", count - 1);
1331
+ }
1332
+ function readPlainScalar(state, nodeIndent, withinFlowCollection) {
1333
+ var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch = state.input.charCodeAt(state.position);
1334
+ if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) return false;
1335
+ if (ch === 63 || ch === 45) {
1336
+ following = state.input.charCodeAt(state.position + 1);
1337
+ if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) return false;
1338
+ }
1339
+ state.kind = "scalar";
1340
+ state.result = "";
1341
+ captureStart = captureEnd = state.position;
1342
+ hasPendingContent = false;
1343
+ while (ch !== 0) {
1344
+ if (ch === 58) {
1345
+ following = state.input.charCodeAt(state.position + 1);
1346
+ if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) break;
1347
+ } else if (ch === 35) {
1348
+ preceding = state.input.charCodeAt(state.position - 1);
1349
+ if (is_WS_OR_EOL(preceding)) break;
1350
+ } else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) break;
1351
+ else if (is_EOL(ch)) {
1352
+ _line = state.line;
1353
+ _lineStart = state.lineStart;
1354
+ _lineIndent = state.lineIndent;
1355
+ skipSeparationSpace(state, false, -1);
1356
+ if (state.lineIndent >= nodeIndent) {
1357
+ hasPendingContent = true;
1358
+ ch = state.input.charCodeAt(state.position);
1359
+ continue;
1360
+ } else {
1361
+ state.position = captureEnd;
1362
+ state.line = _line;
1363
+ state.lineStart = _lineStart;
1364
+ state.lineIndent = _lineIndent;
1365
+ break;
1366
+ }
1367
+ }
1368
+ if (hasPendingContent) {
1369
+ captureSegment(state, captureStart, captureEnd, false);
1370
+ writeFoldedLines(state, state.line - _line);
1371
+ captureStart = captureEnd = state.position;
1372
+ hasPendingContent = false;
1373
+ }
1374
+ if (!is_WHITE_SPACE(ch)) captureEnd = state.position + 1;
1375
+ ch = state.input.charCodeAt(++state.position);
1376
+ }
1377
+ captureSegment(state, captureStart, captureEnd, false);
1378
+ if (state.result) return true;
1379
+ state.kind = _kind;
1380
+ state.result = _result;
1381
+ return false;
1382
+ }
1383
+ function readSingleQuotedScalar(state, nodeIndent) {
1384
+ var ch = state.input.charCodeAt(state.position), captureStart, captureEnd;
1385
+ if (ch !== 39) return false;
1386
+ state.kind = "scalar";
1387
+ state.result = "";
1388
+ state.position++;
1389
+ captureStart = captureEnd = state.position;
1390
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) if (ch === 39) {
1391
+ captureSegment(state, captureStart, state.position, true);
1392
+ ch = state.input.charCodeAt(++state.position);
1393
+ if (ch === 39) {
1394
+ captureStart = state.position;
1395
+ state.position++;
1396
+ captureEnd = state.position;
1397
+ } else return true;
1398
+ } else if (is_EOL(ch)) {
1399
+ captureSegment(state, captureStart, captureEnd, true);
1400
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
1401
+ captureStart = captureEnd = state.position;
1402
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, "unexpected end of the document within a single quoted scalar");
1403
+ else {
1404
+ state.position++;
1405
+ captureEnd = state.position;
1406
+ }
1407
+ throwError(state, "unexpected end of the stream within a single quoted scalar");
1408
+ }
1409
+ function readDoubleQuotedScalar(state, nodeIndent) {
1410
+ var captureStart, captureEnd, hexLength, hexResult, tmp, ch = state.input.charCodeAt(state.position);
1411
+ if (ch !== 34) return false;
1412
+ state.kind = "scalar";
1413
+ state.result = "";
1414
+ state.position++;
1415
+ captureStart = captureEnd = state.position;
1416
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) if (ch === 34) {
1417
+ captureSegment(state, captureStart, state.position, true);
1418
+ state.position++;
1419
+ return true;
1420
+ } else if (ch === 92) {
1421
+ captureSegment(state, captureStart, state.position, true);
1422
+ ch = state.input.charCodeAt(++state.position);
1423
+ if (is_EOL(ch)) skipSeparationSpace(state, false, nodeIndent);
1424
+ else if (ch < 256 && simpleEscapeCheck[ch]) {
1425
+ state.result += simpleEscapeMap[ch];
1426
+ state.position++;
1427
+ } else if ((tmp = escapedHexLen(ch)) > 0) {
1428
+ hexLength = tmp;
1429
+ hexResult = 0;
1430
+ for (; hexLength > 0; hexLength--) {
1431
+ ch = state.input.charCodeAt(++state.position);
1432
+ if ((tmp = fromHexCode(ch)) >= 0) hexResult = (hexResult << 4) + tmp;
1433
+ else throwError(state, "expected hexadecimal character");
1434
+ }
1435
+ state.result += charFromCodepoint(hexResult);
1436
+ state.position++;
1437
+ } else throwError(state, "unknown escape sequence");
1438
+ captureStart = captureEnd = state.position;
1439
+ } else if (is_EOL(ch)) {
1440
+ captureSegment(state, captureStart, captureEnd, true);
1441
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
1442
+ captureStart = captureEnd = state.position;
1443
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, "unexpected end of the document within a double quoted scalar");
1444
+ else {
1445
+ state.position++;
1446
+ captureEnd = state.position;
1447
+ }
1448
+ throwError(state, "unexpected end of the stream within a double quoted scalar");
1449
+ }
1450
+ function readFlowCollection(state, nodeIndent) {
1451
+ var readNext = true, _line, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = {}, keyNode, keyTag, valueNode, ch = state.input.charCodeAt(state.position);
1452
+ if (ch === 91) {
1453
+ terminator = 93;
1454
+ isMapping = false;
1455
+ _result = [];
1456
+ } else if (ch === 123) {
1457
+ terminator = 125;
1458
+ isMapping = true;
1459
+ _result = {};
1460
+ } else return false;
1461
+ if (state.anchor !== null) state.anchorMap[state.anchor] = _result;
1462
+ ch = state.input.charCodeAt(++state.position);
1463
+ while (ch !== 0) {
1464
+ skipSeparationSpace(state, true, nodeIndent);
1465
+ ch = state.input.charCodeAt(state.position);
1466
+ if (ch === terminator) {
1467
+ state.position++;
1468
+ state.tag = _tag;
1469
+ state.anchor = _anchor;
1470
+ state.kind = isMapping ? "mapping" : "sequence";
1471
+ state.result = _result;
1472
+ return true;
1473
+ } else if (!readNext) throwError(state, "missed comma between flow collection entries");
1474
+ keyTag = keyNode = valueNode = null;
1475
+ isPair = isExplicitPair = false;
1476
+ if (ch === 63) {
1477
+ following = state.input.charCodeAt(state.position + 1);
1478
+ if (is_WS_OR_EOL(following)) {
1479
+ isPair = isExplicitPair = true;
1480
+ state.position++;
1481
+ skipSeparationSpace(state, true, nodeIndent);
1482
+ }
1483
+ }
1484
+ _line = state.line;
1485
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
1486
+ keyTag = state.tag;
1487
+ keyNode = state.result;
1488
+ skipSeparationSpace(state, true, nodeIndent);
1489
+ ch = state.input.charCodeAt(state.position);
1490
+ if ((isExplicitPair || state.line === _line) && ch === 58) {
1491
+ isPair = true;
1492
+ ch = state.input.charCodeAt(++state.position);
1493
+ skipSeparationSpace(state, true, nodeIndent);
1494
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
1495
+ valueNode = state.result;
1496
+ }
1497
+ if (isMapping) storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode);
1498
+ else if (isPair) _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode));
1499
+ else _result.push(keyNode);
1500
+ skipSeparationSpace(state, true, nodeIndent);
1501
+ ch = state.input.charCodeAt(state.position);
1502
+ if (ch === 44) {
1503
+ readNext = true;
1504
+ ch = state.input.charCodeAt(++state.position);
1505
+ } else readNext = false;
1506
+ }
1507
+ throwError(state, "unexpected end of the stream within a flow collection");
1508
+ }
1509
+ function readBlockScalar(state, nodeIndent) {
1510
+ var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch = state.input.charCodeAt(state.position);
1511
+ if (ch === 124) folding = false;
1512
+ else if (ch === 62) folding = true;
1513
+ else return false;
1514
+ state.kind = "scalar";
1515
+ state.result = "";
1516
+ while (ch !== 0) {
1517
+ ch = state.input.charCodeAt(++state.position);
1518
+ if (ch === 43 || ch === 45) if (CHOMPING_CLIP === chomping) chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
1519
+ else throwError(state, "repeat of a chomping mode identifier");
1520
+ else if ((tmp = fromDecimalCode(ch)) >= 0) if (tmp === 0) throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
1521
+ else if (!detectedIndent) {
1522
+ textIndent = nodeIndent + tmp - 1;
1523
+ detectedIndent = true;
1524
+ } else throwError(state, "repeat of an indentation width identifier");
1525
+ else break;
1526
+ }
1527
+ if (is_WHITE_SPACE(ch)) {
1528
+ do
1529
+ ch = state.input.charCodeAt(++state.position);
1530
+ while (is_WHITE_SPACE(ch));
1531
+ if (ch === 35) do
1532
+ ch = state.input.charCodeAt(++state.position);
1533
+ while (!is_EOL(ch) && ch !== 0);
1534
+ }
1535
+ while (ch !== 0) {
1536
+ readLineBreak(state);
1537
+ state.lineIndent = 0;
1538
+ ch = state.input.charCodeAt(state.position);
1539
+ while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) {
1540
+ state.lineIndent++;
1541
+ ch = state.input.charCodeAt(++state.position);
1542
+ }
1543
+ if (!detectedIndent && state.lineIndent > textIndent) textIndent = state.lineIndent;
1544
+ if (is_EOL(ch)) {
1545
+ emptyLines++;
1546
+ continue;
1547
+ }
1548
+ if (state.lineIndent < textIndent) {
1549
+ if (chomping === CHOMPING_KEEP) state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
1550
+ else if (chomping === CHOMPING_CLIP) {
1551
+ if (didReadContent) state.result += "\n";
1552
+ }
1553
+ break;
1554
+ }
1555
+ if (folding) if (is_WHITE_SPACE(ch)) {
1556
+ atMoreIndented = true;
1557
+ state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
1558
+ } else if (atMoreIndented) {
1559
+ atMoreIndented = false;
1560
+ state.result += common.repeat("\n", emptyLines + 1);
1561
+ } else if (emptyLines === 0) {
1562
+ if (didReadContent) state.result += " ";
1563
+ } else state.result += common.repeat("\n", emptyLines);
1564
+ else state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
1565
+ didReadContent = true;
1566
+ detectedIndent = true;
1567
+ emptyLines = 0;
1568
+ captureStart = state.position;
1569
+ while (!is_EOL(ch) && ch !== 0) ch = state.input.charCodeAt(++state.position);
1570
+ captureSegment(state, captureStart, state.position, false);
1571
+ }
1572
+ return true;
1573
+ }
1574
+ function readBlockSequence(state, nodeIndent) {
1575
+ var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
1576
+ if (state.anchor !== null) state.anchorMap[state.anchor] = _result;
1577
+ ch = state.input.charCodeAt(state.position);
1578
+ while (ch !== 0) {
1579
+ if (ch !== 45) break;
1580
+ following = state.input.charCodeAt(state.position + 1);
1581
+ if (!is_WS_OR_EOL(following)) break;
1582
+ detected = true;
1583
+ state.position++;
1584
+ if (skipSeparationSpace(state, true, -1)) {
1585
+ if (state.lineIndent <= nodeIndent) {
1586
+ _result.push(null);
1587
+ ch = state.input.charCodeAt(state.position);
1588
+ continue;
1589
+ }
1590
+ }
1591
+ _line = state.line;
1592
+ composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
1593
+ _result.push(state.result);
1594
+ skipSeparationSpace(state, true, -1);
1595
+ ch = state.input.charCodeAt(state.position);
1596
+ if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) throwError(state, "bad indentation of a sequence entry");
1597
+ else if (state.lineIndent < nodeIndent) break;
1598
+ }
1599
+ if (detected) {
1600
+ state.tag = _tag;
1601
+ state.anchor = _anchor;
1602
+ state.kind = "sequence";
1603
+ state.result = _result;
1604
+ return true;
1605
+ }
1606
+ return false;
1607
+ }
1608
+ function readBlockMapping(state, nodeIndent, flowIndent) {
1609
+ var following, allowCompact, _line, _pos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = {}, keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
1610
+ if (state.anchor !== null) state.anchorMap[state.anchor] = _result;
1611
+ ch = state.input.charCodeAt(state.position);
1612
+ while (ch !== 0) {
1613
+ following = state.input.charCodeAt(state.position + 1);
1614
+ _line = state.line;
1615
+ _pos = state.position;
1616
+ if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
1617
+ if (ch === 63) {
1618
+ if (atExplicitKey) {
1619
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
1620
+ keyTag = keyNode = valueNode = null;
1621
+ }
1622
+ detected = true;
1623
+ atExplicitKey = true;
1624
+ allowCompact = true;
1625
+ } else if (atExplicitKey) {
1626
+ atExplicitKey = false;
1627
+ allowCompact = true;
1628
+ } else throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
1629
+ state.position += 1;
1630
+ ch = following;
1631
+ } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) if (state.line === _line) {
1632
+ ch = state.input.charCodeAt(state.position);
1633
+ while (is_WHITE_SPACE(ch)) ch = state.input.charCodeAt(++state.position);
1634
+ if (ch === 58) {
1635
+ ch = state.input.charCodeAt(++state.position);
1636
+ if (!is_WS_OR_EOL(ch)) throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
1637
+ if (atExplicitKey) {
1638
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
1639
+ keyTag = keyNode = valueNode = null;
1640
+ }
1641
+ detected = true;
1642
+ atExplicitKey = false;
1643
+ allowCompact = false;
1644
+ keyTag = state.tag;
1645
+ keyNode = state.result;
1646
+ } else if (detected) throwError(state, "can not read an implicit mapping pair; a colon is missed");
1647
+ else {
1648
+ state.tag = _tag;
1649
+ state.anchor = _anchor;
1650
+ return true;
1651
+ }
1652
+ } else if (detected) throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
1653
+ else {
1654
+ state.tag = _tag;
1655
+ state.anchor = _anchor;
1656
+ return true;
1657
+ }
1658
+ else break;
1659
+ if (state.line === _line || state.lineIndent > nodeIndent) {
1660
+ if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) if (atExplicitKey) keyNode = state.result;
1661
+ else valueNode = state.result;
1662
+ if (!atExplicitKey) {
1663
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos);
1664
+ keyTag = keyNode = valueNode = null;
1665
+ }
1666
+ skipSeparationSpace(state, true, -1);
1667
+ ch = state.input.charCodeAt(state.position);
1668
+ }
1669
+ if (state.lineIndent > nodeIndent && ch !== 0) throwError(state, "bad indentation of a mapping entry");
1670
+ else if (state.lineIndent < nodeIndent) break;
1671
+ }
1672
+ if (atExplicitKey) storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
1673
+ if (detected) {
1674
+ state.tag = _tag;
1675
+ state.anchor = _anchor;
1676
+ state.kind = "mapping";
1677
+ state.result = _result;
1678
+ }
1679
+ return detected;
1680
+ }
1681
+ function readTagProperty(state) {
1682
+ var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch = state.input.charCodeAt(state.position);
1683
+ if (ch !== 33) return false;
1684
+ if (state.tag !== null) throwError(state, "duplication of a tag property");
1685
+ ch = state.input.charCodeAt(++state.position);
1686
+ if (ch === 60) {
1687
+ isVerbatim = true;
1688
+ ch = state.input.charCodeAt(++state.position);
1689
+ } else if (ch === 33) {
1690
+ isNamed = true;
1691
+ tagHandle = "!!";
1692
+ ch = state.input.charCodeAt(++state.position);
1693
+ } else tagHandle = "!";
1694
+ _position = state.position;
1695
+ if (isVerbatim) {
1696
+ do
1697
+ ch = state.input.charCodeAt(++state.position);
1698
+ while (ch !== 0 && ch !== 62);
1699
+ if (state.position < state.length) {
1700
+ tagName = state.input.slice(_position, state.position);
1701
+ ch = state.input.charCodeAt(++state.position);
1702
+ } else throwError(state, "unexpected end of the stream within a verbatim tag");
1703
+ } else {
1704
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
1705
+ if (ch === 33) if (!isNamed) {
1706
+ tagHandle = state.input.slice(_position - 1, state.position + 1);
1707
+ if (!PATTERN_TAG_HANDLE.test(tagHandle)) throwError(state, "named tag handle cannot contain such characters");
1708
+ isNamed = true;
1709
+ _position = state.position + 1;
1710
+ } else throwError(state, "tag suffix cannot contain exclamation marks");
1711
+ ch = state.input.charCodeAt(++state.position);
1712
+ }
1713
+ tagName = state.input.slice(_position, state.position);
1714
+ if (PATTERN_FLOW_INDICATORS.test(tagName)) throwError(state, "tag suffix cannot contain flow indicator characters");
1715
+ }
1716
+ if (tagName && !PATTERN_TAG_URI.test(tagName)) throwError(state, "tag name cannot contain such characters: " + tagName);
1717
+ if (isVerbatim) state.tag = tagName;
1718
+ else if (_hasOwnProperty.call(state.tagMap, tagHandle)) state.tag = state.tagMap[tagHandle] + tagName;
1719
+ else if (tagHandle === "!") state.tag = "!" + tagName;
1720
+ else if (tagHandle === "!!") state.tag = "tag:yaml.org,2002:" + tagName;
1721
+ else throwError(state, "undeclared tag handle \"" + tagHandle + "\"");
1722
+ return true;
1723
+ }
1724
+ function readAnchorProperty(state) {
1725
+ var _position, ch = state.input.charCodeAt(state.position);
1726
+ if (ch !== 38) return false;
1727
+ if (state.anchor !== null) throwError(state, "duplication of an anchor property");
1728
+ ch = state.input.charCodeAt(++state.position);
1729
+ _position = state.position;
1730
+ while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) ch = state.input.charCodeAt(++state.position);
1731
+ if (state.position === _position) throwError(state, "name of an anchor node must contain at least one character");
1732
+ state.anchor = state.input.slice(_position, state.position);
1733
+ return true;
1734
+ }
1735
+ function readAlias(state) {
1736
+ var _position, alias, ch = state.input.charCodeAt(state.position);
1737
+ if (ch !== 42) return false;
1738
+ ch = state.input.charCodeAt(++state.position);
1739
+ _position = state.position;
1740
+ while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) ch = state.input.charCodeAt(++state.position);
1741
+ if (state.position === _position) throwError(state, "name of an alias node must contain at least one character");
1742
+ alias = state.input.slice(_position, state.position);
1743
+ if (!_hasOwnProperty.call(state.anchorMap, alias)) throwError(state, "unidentified alias \"" + alias + "\"");
1744
+ state.result = state.anchorMap[alias];
1745
+ skipSeparationSpace(state, true, -1);
1746
+ return true;
1747
+ }
1748
+ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
1749
+ var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, type, flowIndent, blockIndent;
1750
+ if (state.listener !== null) state.listener("open", state);
1751
+ state.tag = null;
1752
+ state.anchor = null;
1753
+ state.kind = null;
1754
+ state.result = null;
1755
+ allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
1756
+ if (allowToSeek) {
1757
+ if (skipSeparationSpace(state, true, -1)) {
1758
+ atNewLine = true;
1759
+ if (state.lineIndent > parentIndent) indentStatus = 1;
1760
+ else if (state.lineIndent === parentIndent) indentStatus = 0;
1761
+ else if (state.lineIndent < parentIndent) indentStatus = -1;
1762
+ }
1763
+ }
1764
+ if (indentStatus === 1) while (readTagProperty(state) || readAnchorProperty(state)) if (skipSeparationSpace(state, true, -1)) {
1765
+ atNewLine = true;
1766
+ allowBlockCollections = allowBlockStyles;
1767
+ if (state.lineIndent > parentIndent) indentStatus = 1;
1768
+ else if (state.lineIndent === parentIndent) indentStatus = 0;
1769
+ else if (state.lineIndent < parentIndent) indentStatus = -1;
1770
+ } else allowBlockCollections = false;
1771
+ if (allowBlockCollections) allowBlockCollections = atNewLine || allowCompact;
1772
+ if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
1773
+ if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) flowIndent = parentIndent;
1774
+ else flowIndent = parentIndent + 1;
1775
+ blockIndent = state.position - state.lineStart;
1776
+ if (indentStatus === 1) if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) hasContent = true;
1777
+ else {
1778
+ if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) hasContent = true;
1779
+ else if (readAlias(state)) {
1780
+ hasContent = true;
1781
+ if (state.tag !== null || state.anchor !== null) throwError(state, "alias node should not have any properties");
1782
+ } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
1783
+ hasContent = true;
1784
+ if (state.tag === null) state.tag = "?";
1785
+ }
1786
+ if (state.anchor !== null) state.anchorMap[state.anchor] = state.result;
1787
+ }
1788
+ else if (indentStatus === 0) hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
1789
+ }
1790
+ if (state.tag !== null && state.tag !== "!") if (state.tag === "?") {
1791
+ if (state.result !== null && state.kind !== "scalar") throwError(state, "unacceptable node kind for !<?> tag; it should be \"scalar\", not \"" + state.kind + "\"");
1792
+ for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
1793
+ type = state.implicitTypes[typeIndex];
1794
+ if (type.resolve(state.result)) {
1795
+ state.result = type.construct(state.result);
1796
+ state.tag = type.tag;
1797
+ if (state.anchor !== null) state.anchorMap[state.anchor] = state.result;
1798
+ break;
1799
+ }
1800
+ }
1801
+ } else if (_hasOwnProperty.call(state.typeMap[state.kind || "fallback"], state.tag)) {
1802
+ type = state.typeMap[state.kind || "fallback"][state.tag];
1803
+ if (state.result !== null && type.kind !== state.kind) throwError(state, "unacceptable node kind for !<" + state.tag + "> tag; it should be \"" + type.kind + "\", not \"" + state.kind + "\"");
1804
+ if (!type.resolve(state.result)) throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
1805
+ else {
1806
+ state.result = type.construct(state.result);
1807
+ if (state.anchor !== null) state.anchorMap[state.anchor] = state.result;
1808
+ }
1809
+ } else throwError(state, "unknown tag !<" + state.tag + ">");
1810
+ if (state.listener !== null) state.listener("close", state);
1811
+ return state.tag !== null || state.anchor !== null || hasContent;
1812
+ }
1813
+ function readDocument(state) {
1814
+ var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
1815
+ state.version = null;
1816
+ state.checkLineBreaks = state.legacy;
1817
+ state.tagMap = {};
1818
+ state.anchorMap = {};
1819
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
1820
+ skipSeparationSpace(state, true, -1);
1821
+ ch = state.input.charCodeAt(state.position);
1822
+ if (state.lineIndent > 0 || ch !== 37) break;
1823
+ hasDirectives = true;
1824
+ ch = state.input.charCodeAt(++state.position);
1825
+ _position = state.position;
1826
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) ch = state.input.charCodeAt(++state.position);
1827
+ directiveName = state.input.slice(_position, state.position);
1828
+ directiveArgs = [];
1829
+ if (directiveName.length < 1) throwError(state, "directive name must not be less than one character in length");
1830
+ while (ch !== 0) {
1831
+ while (is_WHITE_SPACE(ch)) ch = state.input.charCodeAt(++state.position);
1832
+ if (ch === 35) {
1833
+ do
1834
+ ch = state.input.charCodeAt(++state.position);
1835
+ while (ch !== 0 && !is_EOL(ch));
1836
+ break;
1837
+ }
1838
+ if (is_EOL(ch)) break;
1839
+ _position = state.position;
1840
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) ch = state.input.charCodeAt(++state.position);
1841
+ directiveArgs.push(state.input.slice(_position, state.position));
1842
+ }
1843
+ if (ch !== 0) readLineBreak(state);
1844
+ if (_hasOwnProperty.call(directiveHandlers, directiveName)) directiveHandlers[directiveName](state, directiveName, directiveArgs);
1845
+ else throwWarning(state, "unknown document directive \"" + directiveName + "\"");
1846
+ }
1847
+ skipSeparationSpace(state, true, -1);
1848
+ if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) {
1849
+ state.position += 3;
1850
+ skipSeparationSpace(state, true, -1);
1851
+ } else if (hasDirectives) throwError(state, "directives end mark is expected");
1852
+ composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
1853
+ skipSeparationSpace(state, true, -1);
1854
+ if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) throwWarning(state, "non-ASCII line breaks are interpreted as content");
1855
+ state.documents.push(state.result);
1856
+ if (state.position === state.lineStart && testDocumentSeparator(state)) {
1857
+ if (state.input.charCodeAt(state.position) === 46) {
1858
+ state.position += 3;
1859
+ skipSeparationSpace(state, true, -1);
1860
+ }
1861
+ return;
1862
+ }
1863
+ if (state.position < state.length - 1) throwError(state, "end of the stream or a document separator is expected");
1864
+ else return;
1865
+ }
1866
+ function loadDocuments(input, options) {
1867
+ input = String(input);
1868
+ options = options || {};
1869
+ if (input.length !== 0) {
1870
+ if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) input += "\n";
1871
+ if (input.charCodeAt(0) === 65279) input = input.slice(1);
1872
+ }
1873
+ var state = new State(input, options);
1874
+ var nullpos = input.indexOf("\0");
1875
+ if (nullpos !== -1) {
1876
+ state.position = nullpos;
1877
+ throwError(state, "null byte is not allowed in input");
1878
+ }
1879
+ state.input += "\0";
1880
+ while (state.input.charCodeAt(state.position) === 32) {
1881
+ state.lineIndent += 1;
1882
+ state.position += 1;
1883
+ }
1884
+ while (state.position < state.length - 1) readDocument(state);
1885
+ return state.documents;
1886
+ }
1887
+ function loadAll(input, iterator, options) {
1888
+ if (iterator !== null && typeof iterator === "object" && typeof options === "undefined") {
1889
+ options = iterator;
1890
+ iterator = null;
1891
+ }
1892
+ var documents = loadDocuments(input, options);
1893
+ if (typeof iterator !== "function") return documents;
1894
+ for (var index = 0, length = documents.length; index < length; index += 1) iterator(documents[index]);
1895
+ }
1896
+ function load(input, options) {
1897
+ var documents = loadDocuments(input, options);
1898
+ if (documents.length === 0) return;
1899
+ else if (documents.length === 1) return documents[0];
1900
+ throw new YAMLException("expected a single document in the stream, but found more");
1901
+ }
1902
+ function safeLoadAll(input, iterator, options) {
1903
+ if (typeof iterator === "object" && iterator !== null && typeof options === "undefined") {
1904
+ options = iterator;
1905
+ iterator = null;
1906
+ }
1907
+ return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
1908
+ }
1909
+ function safeLoad(input, options) {
1910
+ return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
1911
+ }
1912
+ module.exports.loadAll = loadAll;
1913
+ module.exports.load = load;
1914
+ module.exports.safeLoadAll = safeLoadAll;
1915
+ module.exports.safeLoad = safeLoad;
1916
+ }));
1917
+ //#endregion
1918
+ //#region ../../node_modules/js-yaml/lib/js-yaml/dumper.js
1919
+ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1920
+ var common = require_common();
1921
+ var YAMLException = require_exception();
1922
+ var DEFAULT_FULL_SCHEMA = require_default_full();
1923
+ var DEFAULT_SAFE_SCHEMA = require_default_safe();
1924
+ var _toString = Object.prototype.toString;
1925
+ var _hasOwnProperty = Object.prototype.hasOwnProperty;
1926
+ var CHAR_TAB = 9;
1927
+ var CHAR_LINE_FEED = 10;
1928
+ var CHAR_CARRIAGE_RETURN = 13;
1929
+ var CHAR_SPACE = 32;
1930
+ var CHAR_EXCLAMATION = 33;
1931
+ var CHAR_DOUBLE_QUOTE = 34;
1932
+ var CHAR_SHARP = 35;
1933
+ var CHAR_PERCENT = 37;
1934
+ var CHAR_AMPERSAND = 38;
1935
+ var CHAR_SINGLE_QUOTE = 39;
1936
+ var CHAR_ASTERISK = 42;
1937
+ var CHAR_COMMA = 44;
1938
+ var CHAR_MINUS = 45;
1939
+ var CHAR_COLON = 58;
1940
+ var CHAR_EQUALS = 61;
1941
+ var CHAR_GREATER_THAN = 62;
1942
+ var CHAR_QUESTION = 63;
1943
+ var CHAR_COMMERCIAL_AT = 64;
1944
+ var CHAR_LEFT_SQUARE_BRACKET = 91;
1945
+ var CHAR_RIGHT_SQUARE_BRACKET = 93;
1946
+ var CHAR_GRAVE_ACCENT = 96;
1947
+ var CHAR_LEFT_CURLY_BRACKET = 123;
1948
+ var CHAR_VERTICAL_LINE = 124;
1949
+ var CHAR_RIGHT_CURLY_BRACKET = 125;
1950
+ var ESCAPE_SEQUENCES = {};
1951
+ ESCAPE_SEQUENCES[0] = "\\0";
1952
+ ESCAPE_SEQUENCES[7] = "\\a";
1953
+ ESCAPE_SEQUENCES[8] = "\\b";
1954
+ ESCAPE_SEQUENCES[9] = "\\t";
1955
+ ESCAPE_SEQUENCES[10] = "\\n";
1956
+ ESCAPE_SEQUENCES[11] = "\\v";
1957
+ ESCAPE_SEQUENCES[12] = "\\f";
1958
+ ESCAPE_SEQUENCES[13] = "\\r";
1959
+ ESCAPE_SEQUENCES[27] = "\\e";
1960
+ ESCAPE_SEQUENCES[34] = "\\\"";
1961
+ ESCAPE_SEQUENCES[92] = "\\\\";
1962
+ ESCAPE_SEQUENCES[133] = "\\N";
1963
+ ESCAPE_SEQUENCES[160] = "\\_";
1964
+ ESCAPE_SEQUENCES[8232] = "\\L";
1965
+ ESCAPE_SEQUENCES[8233] = "\\P";
1966
+ var DEPRECATED_BOOLEANS_SYNTAX = [
1967
+ "y",
1968
+ "Y",
1969
+ "yes",
1970
+ "Yes",
1971
+ "YES",
1972
+ "on",
1973
+ "On",
1974
+ "ON",
1975
+ "n",
1976
+ "N",
1977
+ "no",
1978
+ "No",
1979
+ "NO",
1980
+ "off",
1981
+ "Off",
1982
+ "OFF"
1983
+ ];
1984
+ function compileStyleMap(schema, map) {
1985
+ var result, keys, index, length, tag, style, type;
1986
+ if (map === null) return {};
1987
+ result = {};
1988
+ keys = Object.keys(map);
1989
+ for (index = 0, length = keys.length; index < length; index += 1) {
1990
+ tag = keys[index];
1991
+ style = String(map[tag]);
1992
+ if (tag.slice(0, 2) === "!!") tag = "tag:yaml.org,2002:" + tag.slice(2);
1993
+ type = schema.compiledTypeMap["fallback"][tag];
1994
+ if (type && _hasOwnProperty.call(type.styleAliases, style)) style = type.styleAliases[style];
1995
+ result[tag] = style;
1996
+ }
1997
+ return result;
1998
+ }
1999
+ function encodeHex(character) {
2000
+ var string = character.toString(16).toUpperCase(), handle, length;
2001
+ if (character <= 255) {
2002
+ handle = "x";
2003
+ length = 2;
2004
+ } else if (character <= 65535) {
2005
+ handle = "u";
2006
+ length = 4;
2007
+ } else if (character <= 4294967295) {
2008
+ handle = "U";
2009
+ length = 8;
2010
+ } else throw new YAMLException("code point within a string may not be greater than 0xFFFFFFFF");
2011
+ return "\\" + handle + common.repeat("0", length - string.length) + string;
2012
+ }
2013
+ function State(options) {
2014
+ this.schema = options["schema"] || DEFAULT_FULL_SCHEMA;
2015
+ this.indent = Math.max(1, options["indent"] || 2);
2016
+ this.noArrayIndent = options["noArrayIndent"] || false;
2017
+ this.skipInvalid = options["skipInvalid"] || false;
2018
+ this.flowLevel = common.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"];
2019
+ this.styleMap = compileStyleMap(this.schema, options["styles"] || null);
2020
+ this.sortKeys = options["sortKeys"] || false;
2021
+ this.lineWidth = options["lineWidth"] || 80;
2022
+ this.noRefs = options["noRefs"] || false;
2023
+ this.noCompatMode = options["noCompatMode"] || false;
2024
+ this.condenseFlow = options["condenseFlow"] || false;
2025
+ this.implicitTypes = this.schema.compiledImplicit;
2026
+ this.explicitTypes = this.schema.compiledExplicit;
2027
+ this.tag = null;
2028
+ this.result = "";
2029
+ this.duplicates = [];
2030
+ this.usedDuplicates = null;
2031
+ }
2032
+ function indentString(string, spaces) {
2033
+ var ind = common.repeat(" ", spaces), position = 0, next = -1, result = "", line, length = string.length;
2034
+ while (position < length) {
2035
+ next = string.indexOf("\n", position);
2036
+ if (next === -1) {
2037
+ line = string.slice(position);
2038
+ position = length;
2039
+ } else {
2040
+ line = string.slice(position, next + 1);
2041
+ position = next + 1;
2042
+ }
2043
+ if (line.length && line !== "\n") result += ind;
2044
+ result += line;
2045
+ }
2046
+ return result;
2047
+ }
2048
+ function generateNextLine(state, level) {
2049
+ return "\n" + common.repeat(" ", state.indent * level);
2050
+ }
2051
+ function testImplicitResolving(state, str) {
2052
+ var index, length, type;
2053
+ for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
2054
+ type = state.implicitTypes[index];
2055
+ if (type.resolve(str)) return true;
2056
+ }
2057
+ return false;
2058
+ }
2059
+ function isWhitespace(c) {
2060
+ return c === CHAR_SPACE || c === CHAR_TAB;
2061
+ }
2062
+ function isPrintable(c) {
2063
+ return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== 65279 || 65536 <= c && c <= 1114111;
2064
+ }
2065
+ function isNsChar(c) {
2066
+ return isPrintable(c) && !isWhitespace(c) && c !== 65279 && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
2067
+ }
2068
+ function isPlainSafe(c, prev) {
2069
+ return isPrintable(c) && c !== 65279 && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_COLON && (c !== CHAR_SHARP || prev && isNsChar(prev));
2070
+ }
2071
+ function isPlainSafeFirst(c) {
2072
+ return isPrintable(c) && c !== 65279 && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT;
2073
+ }
2074
+ function needIndentIndicator(string) {
2075
+ return /^\n* /.test(string);
2076
+ }
2077
+ var STYLE_PLAIN = 1, STYLE_SINGLE = 2, STYLE_LITERAL = 3, STYLE_FOLDED = 4, STYLE_DOUBLE = 5;
2078
+ function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {
2079
+ var i;
2080
+ var char, prev_char;
2081
+ var hasLineBreak = false;
2082
+ var hasFoldableLine = false;
2083
+ var shouldTrackWidth = lineWidth !== -1;
2084
+ var previousLineBreak = -1;
2085
+ var plain = isPlainSafeFirst(string.charCodeAt(0)) && !isWhitespace(string.charCodeAt(string.length - 1));
2086
+ if (singleLineOnly) for (i = 0; i < string.length; i++) {
2087
+ char = string.charCodeAt(i);
2088
+ if (!isPrintable(char)) return STYLE_DOUBLE;
2089
+ prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
2090
+ plain = plain && isPlainSafe(char, prev_char);
2091
+ }
2092
+ else {
2093
+ for (i = 0; i < string.length; i++) {
2094
+ char = string.charCodeAt(i);
2095
+ if (char === CHAR_LINE_FEED) {
2096
+ hasLineBreak = true;
2097
+ if (shouldTrackWidth) {
2098
+ hasFoldableLine = hasFoldableLine || i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
2099
+ previousLineBreak = i;
2100
+ }
2101
+ } else if (!isPrintable(char)) return STYLE_DOUBLE;
2102
+ prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
2103
+ plain = plain && isPlainSafe(char, prev_char);
2104
+ }
2105
+ hasFoldableLine = hasFoldableLine || shouldTrackWidth && i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
2106
+ }
2107
+ if (!hasLineBreak && !hasFoldableLine) return plain && !testAmbiguousType(string) ? STYLE_PLAIN : STYLE_SINGLE;
2108
+ if (indentPerLevel > 9 && needIndentIndicator(string)) return STYLE_DOUBLE;
2109
+ return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
2110
+ }
2111
+ function writeScalar(state, string, level, iskey) {
2112
+ state.dump = function() {
2113
+ if (string.length === 0) return "''";
2114
+ if (!state.noCompatMode && DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) return "'" + string + "'";
2115
+ var indent = state.indent * Math.max(1, level);
2116
+ var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
2117
+ var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
2118
+ function testAmbiguity(string) {
2119
+ return testImplicitResolving(state, string);
2120
+ }
2121
+ switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) {
2122
+ case STYLE_PLAIN: return string;
2123
+ case STYLE_SINGLE: return "'" + string.replace(/'/g, "''") + "'";
2124
+ case STYLE_LITERAL: return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));
2125
+ case STYLE_FOLDED: return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
2126
+ case STYLE_DOUBLE: return "\"" + escapeString(string, lineWidth) + "\"";
2127
+ default: throw new YAMLException("impossible error: invalid scalar style");
2128
+ }
2129
+ }();
2130
+ }
2131
+ function blockHeader(string, indentPerLevel) {
2132
+ var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
2133
+ var clip = string[string.length - 1] === "\n";
2134
+ return indentIndicator + (clip && (string[string.length - 2] === "\n" || string === "\n") ? "+" : clip ? "" : "-") + "\n";
2135
+ }
2136
+ function dropEndingNewline(string) {
2137
+ return string[string.length - 1] === "\n" ? string.slice(0, -1) : string;
2138
+ }
2139
+ function foldString(string, width) {
2140
+ var lineRe = /(\n+)([^\n]*)/g;
2141
+ var result = function() {
2142
+ var nextLF = string.indexOf("\n");
2143
+ nextLF = nextLF !== -1 ? nextLF : string.length;
2144
+ lineRe.lastIndex = nextLF;
2145
+ return foldLine(string.slice(0, nextLF), width);
2146
+ }();
2147
+ var prevMoreIndented = string[0] === "\n" || string[0] === " ";
2148
+ var moreIndented;
2149
+ var match;
2150
+ while (match = lineRe.exec(string)) {
2151
+ var prefix = match[1], line = match[2];
2152
+ moreIndented = line[0] === " ";
2153
+ result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
2154
+ prevMoreIndented = moreIndented;
2155
+ }
2156
+ return result;
2157
+ }
2158
+ function foldLine(line, width) {
2159
+ if (line === "" || line[0] === " ") return line;
2160
+ var breakRe = / [^ ]/g;
2161
+ var match;
2162
+ var start = 0, end, curr = 0, next = 0;
2163
+ var result = "";
2164
+ while (match = breakRe.exec(line)) {
2165
+ next = match.index;
2166
+ if (next - start > width) {
2167
+ end = curr > start ? curr : next;
2168
+ result += "\n" + line.slice(start, end);
2169
+ start = end + 1;
2170
+ }
2171
+ curr = next;
2172
+ }
2173
+ result += "\n";
2174
+ if (line.length - start > width && curr > start) result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
2175
+ else result += line.slice(start);
2176
+ return result.slice(1);
2177
+ }
2178
+ function escapeString(string) {
2179
+ var result = "";
2180
+ var char, nextChar;
2181
+ var escapeSeq;
2182
+ for (var i = 0; i < string.length; i++) {
2183
+ char = string.charCodeAt(i);
2184
+ if (char >= 55296 && char <= 56319) {
2185
+ nextChar = string.charCodeAt(i + 1);
2186
+ if (nextChar >= 56320 && nextChar <= 57343) {
2187
+ result += encodeHex((char - 55296) * 1024 + nextChar - 56320 + 65536);
2188
+ i++;
2189
+ continue;
2190
+ }
2191
+ }
2192
+ escapeSeq = ESCAPE_SEQUENCES[char];
2193
+ result += !escapeSeq && isPrintable(char) ? string[i] : escapeSeq || encodeHex(char);
2194
+ }
2195
+ return result;
2196
+ }
2197
+ function writeFlowSequence(state, level, object) {
2198
+ var _result = "", _tag = state.tag, index, length;
2199
+ for (index = 0, length = object.length; index < length; index += 1) if (writeNode(state, level, object[index], false, false)) {
2200
+ if (index !== 0) _result += "," + (!state.condenseFlow ? " " : "");
2201
+ _result += state.dump;
2202
+ }
2203
+ state.tag = _tag;
2204
+ state.dump = "[" + _result + "]";
2205
+ }
2206
+ function writeBlockSequence(state, level, object, compact) {
2207
+ var _result = "", _tag = state.tag, index, length;
2208
+ for (index = 0, length = object.length; index < length; index += 1) if (writeNode(state, level + 1, object[index], true, true)) {
2209
+ if (!compact || index !== 0) _result += generateNextLine(state, level);
2210
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) _result += "-";
2211
+ else _result += "- ";
2212
+ _result += state.dump;
2213
+ }
2214
+ state.tag = _tag;
2215
+ state.dump = _result || "[]";
2216
+ }
2217
+ function writeFlowMapping(state, level, object) {
2218
+ var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer;
2219
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
2220
+ pairBuffer = "";
2221
+ if (index !== 0) pairBuffer += ", ";
2222
+ if (state.condenseFlow) pairBuffer += "\"";
2223
+ objectKey = objectKeyList[index];
2224
+ objectValue = object[objectKey];
2225
+ if (!writeNode(state, level, objectKey, false, false)) continue;
2226
+ if (state.dump.length > 1024) pairBuffer += "? ";
2227
+ pairBuffer += state.dump + (state.condenseFlow ? "\"" : "") + ":" + (state.condenseFlow ? "" : " ");
2228
+ if (!writeNode(state, level, objectValue, false, false)) continue;
2229
+ pairBuffer += state.dump;
2230
+ _result += pairBuffer;
2231
+ }
2232
+ state.tag = _tag;
2233
+ state.dump = "{" + _result + "}";
2234
+ }
2235
+ function writeBlockMapping(state, level, object, compact) {
2236
+ var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer;
2237
+ if (state.sortKeys === true) objectKeyList.sort();
2238
+ else if (typeof state.sortKeys === "function") objectKeyList.sort(state.sortKeys);
2239
+ else if (state.sortKeys) throw new YAMLException("sortKeys must be a boolean or a function");
2240
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
2241
+ pairBuffer = "";
2242
+ if (!compact || index !== 0) pairBuffer += generateNextLine(state, level);
2243
+ objectKey = objectKeyList[index];
2244
+ objectValue = object[objectKey];
2245
+ if (!writeNode(state, level + 1, objectKey, true, true, true)) continue;
2246
+ explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024;
2247
+ if (explicitPair) if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer += "?";
2248
+ else pairBuffer += "? ";
2249
+ pairBuffer += state.dump;
2250
+ if (explicitPair) pairBuffer += generateNextLine(state, level);
2251
+ if (!writeNode(state, level + 1, objectValue, true, explicitPair)) continue;
2252
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer += ":";
2253
+ else pairBuffer += ": ";
2254
+ pairBuffer += state.dump;
2255
+ _result += pairBuffer;
2256
+ }
2257
+ state.tag = _tag;
2258
+ state.dump = _result || "{}";
2259
+ }
2260
+ function detectType(state, object, explicit) {
2261
+ var _result, typeList = explicit ? state.explicitTypes : state.implicitTypes, index, length, type, style;
2262
+ for (index = 0, length = typeList.length; index < length; index += 1) {
2263
+ type = typeList[index];
2264
+ if ((type.instanceOf || type.predicate) && (!type.instanceOf || typeof object === "object" && object instanceof type.instanceOf) && (!type.predicate || type.predicate(object))) {
2265
+ state.tag = explicit ? type.tag : "?";
2266
+ if (type.represent) {
2267
+ style = state.styleMap[type.tag] || type.defaultStyle;
2268
+ if (_toString.call(type.represent) === "[object Function]") _result = type.represent(object, style);
2269
+ else if (_hasOwnProperty.call(type.represent, style)) _result = type.represent[style](object, style);
2270
+ else throw new YAMLException("!<" + type.tag + "> tag resolver accepts not \"" + style + "\" style");
2271
+ state.dump = _result;
2272
+ }
2273
+ return true;
2274
+ }
2275
+ }
2276
+ return false;
2277
+ }
2278
+ function writeNode(state, level, object, block, compact, iskey) {
2279
+ state.tag = null;
2280
+ state.dump = object;
2281
+ if (!detectType(state, object, false)) detectType(state, object, true);
2282
+ var type = _toString.call(state.dump);
2283
+ if (block) block = state.flowLevel < 0 || state.flowLevel > level;
2284
+ var objectOrArray = type === "[object Object]" || type === "[object Array]", duplicateIndex, duplicate;
2285
+ if (objectOrArray) {
2286
+ duplicateIndex = state.duplicates.indexOf(object);
2287
+ duplicate = duplicateIndex !== -1;
2288
+ }
2289
+ if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) compact = false;
2290
+ if (duplicate && state.usedDuplicates[duplicateIndex]) state.dump = "*ref_" + duplicateIndex;
2291
+ else {
2292
+ if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) state.usedDuplicates[duplicateIndex] = true;
2293
+ if (type === "[object Object]") if (block && Object.keys(state.dump).length !== 0) {
2294
+ writeBlockMapping(state, level, state.dump, compact);
2295
+ if (duplicate) state.dump = "&ref_" + duplicateIndex + state.dump;
2296
+ } else {
2297
+ writeFlowMapping(state, level, state.dump);
2298
+ if (duplicate) state.dump = "&ref_" + duplicateIndex + " " + state.dump;
2299
+ }
2300
+ else if (type === "[object Array]") {
2301
+ var arrayLevel = state.noArrayIndent && level > 0 ? level - 1 : level;
2302
+ if (block && state.dump.length !== 0) {
2303
+ writeBlockSequence(state, arrayLevel, state.dump, compact);
2304
+ if (duplicate) state.dump = "&ref_" + duplicateIndex + state.dump;
2305
+ } else {
2306
+ writeFlowSequence(state, arrayLevel, state.dump);
2307
+ if (duplicate) state.dump = "&ref_" + duplicateIndex + " " + state.dump;
2308
+ }
2309
+ } else if (type === "[object String]") {
2310
+ if (state.tag !== "?") writeScalar(state, state.dump, level, iskey);
2311
+ } else {
2312
+ if (state.skipInvalid) return false;
2313
+ throw new YAMLException("unacceptable kind of an object to dump " + type);
2314
+ }
2315
+ if (state.tag !== null && state.tag !== "?") state.dump = "!<" + state.tag + "> " + state.dump;
2316
+ }
2317
+ return true;
2318
+ }
2319
+ function getDuplicateReferences(object, state) {
2320
+ var objects = [], duplicatesIndexes = [], index, length;
2321
+ inspectNode(object, objects, duplicatesIndexes);
2322
+ for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) state.duplicates.push(objects[duplicatesIndexes[index]]);
2323
+ state.usedDuplicates = new Array(length);
2324
+ }
2325
+ function inspectNode(object, objects, duplicatesIndexes) {
2326
+ var objectKeyList, index, length;
2327
+ if (object !== null && typeof object === "object") {
2328
+ index = objects.indexOf(object);
2329
+ if (index !== -1) {
2330
+ if (duplicatesIndexes.indexOf(index) === -1) duplicatesIndexes.push(index);
2331
+ } else {
2332
+ objects.push(object);
2333
+ if (Array.isArray(object)) for (index = 0, length = object.length; index < length; index += 1) inspectNode(object[index], objects, duplicatesIndexes);
2334
+ else {
2335
+ objectKeyList = Object.keys(object);
2336
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
2337
+ }
2338
+ }
2339
+ }
2340
+ }
2341
+ function dump(input, options) {
2342
+ options = options || {};
2343
+ var state = new State(options);
2344
+ if (!state.noRefs) getDuplicateReferences(input, state);
2345
+ if (writeNode(state, 0, input, true, true)) return state.dump + "\n";
2346
+ return "";
2347
+ }
2348
+ function safeDump(input, options) {
2349
+ return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
2350
+ }
2351
+ module.exports.dump = dump;
2352
+ module.exports.safeDump = safeDump;
2353
+ }));
2354
+ //#endregion
2355
+ //#region ../../node_modules/js-yaml/lib/js-yaml.js
2356
+ var require_js_yaml$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2357
+ var loader = require_loader();
2358
+ var dumper = require_dumper();
2359
+ function deprecated(name) {
2360
+ return function() {
2361
+ throw new Error("Function " + name + " is deprecated and cannot be used.");
2362
+ };
2363
+ }
2364
+ module.exports.Type = require_type();
2365
+ module.exports.Schema = require_schema();
2366
+ module.exports.FAILSAFE_SCHEMA = require_failsafe();
2367
+ module.exports.JSON_SCHEMA = require_json();
2368
+ module.exports.CORE_SCHEMA = require_core();
2369
+ module.exports.DEFAULT_SAFE_SCHEMA = require_default_safe();
2370
+ module.exports.DEFAULT_FULL_SCHEMA = require_default_full();
2371
+ module.exports.load = loader.load;
2372
+ module.exports.loadAll = loader.loadAll;
2373
+ module.exports.safeLoad = loader.safeLoad;
2374
+ module.exports.safeLoadAll = loader.safeLoadAll;
2375
+ module.exports.dump = dumper.dump;
2376
+ module.exports.safeDump = dumper.safeDump;
2377
+ module.exports.YAMLException = require_exception();
2378
+ module.exports.MINIMAL_SCHEMA = require_failsafe();
2379
+ module.exports.SAFE_SCHEMA = require_default_safe();
2380
+ module.exports.DEFAULT_SCHEMA = require_default_full();
2381
+ module.exports.scan = deprecated("scan");
2382
+ module.exports.parse = deprecated("parse");
2383
+ module.exports.compose = deprecated("compose");
2384
+ module.exports.addConstructor = deprecated("addConstructor");
2385
+ }));
2386
+ //#endregion
2387
+ //#region ../../node_modules/js-yaml/index.js
2388
+ var require_js_yaml = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2389
+ module.exports = require_js_yaml$1();
2390
+ }));
2391
+ //#endregion
2392
+ //#region ../../node_modules/gray-matter/lib/engines.js
2393
+ var require_engines = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2394
+ const yaml = require_js_yaml();
2395
+ /**
2396
+ * Default engines
2397
+ */
2398
+ const engines = exports = module.exports;
2399
+ /**
2400
+ * YAML
2401
+ */
2402
+ engines.yaml = {
2403
+ parse: yaml.safeLoad.bind(yaml),
2404
+ stringify: yaml.safeDump.bind(yaml)
2405
+ };
2406
+ /**
2407
+ * JSON
2408
+ */
2409
+ engines.json = {
2410
+ parse: JSON.parse.bind(JSON),
2411
+ stringify: function(obj, options) {
2412
+ const opts = Object.assign({
2413
+ replacer: null,
2414
+ space: 2
2415
+ }, options);
2416
+ return JSON.stringify(obj, opts.replacer, opts.space);
2417
+ }
2418
+ };
2419
+ /**
2420
+ * JavaScript
2421
+ */
2422
+ engines.javascript = {
2423
+ parse: function parse(str, options, wrap) {
2424
+ try {
2425
+ if (wrap !== false) str = "(function() {\nreturn " + str.trim() + ";\n}());";
2426
+ return eval(str) || {};
2427
+ } catch (err) {
2428
+ if (wrap !== false && /(unexpected|identifier)/i.test(err.message)) return parse(str, options, false);
2429
+ throw new SyntaxError(err);
2430
+ }
2431
+ },
2432
+ stringify: function() {
2433
+ throw new Error("stringifying JavaScript is not supported");
2434
+ }
2435
+ };
2436
+ }));
2437
+ //#endregion
2438
+ //#region ../../node_modules/strip-bom-string/index.js
2439
+ /*!
2440
+ * strip-bom-string <https://github.com/jonschlinkert/strip-bom-string>
2441
+ *
2442
+ * Copyright (c) 2015, 2017, Jon Schlinkert.
2443
+ * Released under the MIT License.
2444
+ */
2445
+ var require_strip_bom_string = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2446
+ module.exports = function(str) {
2447
+ if (typeof str === "string" && str.charAt(0) === "") return str.slice(1);
2448
+ return str;
2449
+ };
2450
+ }));
2451
+ //#endregion
2452
+ //#region ../../node_modules/gray-matter/lib/utils.js
2453
+ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
2454
+ const stripBom = require_strip_bom_string();
2455
+ const typeOf = require_kind_of();
2456
+ exports.define = function(obj, key, val) {
2457
+ Reflect.defineProperty(obj, key, {
2458
+ enumerable: false,
2459
+ configurable: true,
2460
+ writable: true,
2461
+ value: val
2462
+ });
2463
+ };
2464
+ /**
2465
+ * Returns true if `val` is a buffer
2466
+ */
2467
+ exports.isBuffer = function(val) {
2468
+ return typeOf(val) === "buffer";
2469
+ };
2470
+ /**
2471
+ * Returns true if `val` is an object
2472
+ */
2473
+ exports.isObject = function(val) {
2474
+ return typeOf(val) === "object";
2475
+ };
2476
+ /**
2477
+ * Cast `input` to a buffer
2478
+ */
2479
+ exports.toBuffer = function(input) {
2480
+ return typeof input === "string" ? Buffer.from(input) : input;
2481
+ };
2482
+ /**
2483
+ * Cast `val` to a string.
2484
+ */
2485
+ exports.toString = function(input) {
2486
+ if (exports.isBuffer(input)) return stripBom(String(input));
2487
+ if (typeof input !== "string") throw new TypeError("expected input to be a string or buffer");
2488
+ return stripBom(input);
2489
+ };
2490
+ /**
2491
+ * Cast `val` to an array.
2492
+ */
2493
+ exports.arrayify = function(val) {
2494
+ return val ? Array.isArray(val) ? val : [val] : [];
2495
+ };
2496
+ /**
2497
+ * Returns true if `str` starts with `substr`.
2498
+ */
2499
+ exports.startsWith = function(str, substr, len) {
2500
+ if (typeof len !== "number") len = substr.length;
2501
+ return str.slice(0, len) === substr;
2502
+ };
2503
+ }));
2504
+ //#endregion
2505
+ //#region ../../node_modules/gray-matter/lib/defaults.js
2506
+ var require_defaults = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2507
+ const engines = require_engines();
2508
+ const utils = require_utils();
2509
+ module.exports = function(options) {
2510
+ const opts = Object.assign({}, options);
2511
+ opts.delimiters = utils.arrayify(opts.delims || opts.delimiters || "---");
2512
+ if (opts.delimiters.length === 1) opts.delimiters.push(opts.delimiters[0]);
2513
+ opts.language = (opts.language || opts.lang || "yaml").toLowerCase();
2514
+ opts.engines = Object.assign({}, engines, opts.parsers, opts.engines);
2515
+ return opts;
2516
+ };
2517
+ }));
2518
+ //#endregion
2519
+ //#region ../../node_modules/gray-matter/lib/engine.js
2520
+ var require_engine = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2521
+ module.exports = function(name, options) {
2522
+ let engine = options.engines[name] || options.engines[aliase(name)];
2523
+ if (typeof engine === "undefined") throw new Error("gray-matter engine \"" + name + "\" is not registered");
2524
+ if (typeof engine === "function") engine = { parse: engine };
2525
+ return engine;
2526
+ };
2527
+ function aliase(name) {
2528
+ switch (name.toLowerCase()) {
2529
+ case "js":
2530
+ case "javascript": return "javascript";
2531
+ case "coffee":
2532
+ case "coffeescript":
2533
+ case "cson": return "coffee";
2534
+ case "yaml":
2535
+ case "yml": return "yaml";
2536
+ default: return name;
2537
+ }
2538
+ }
2539
+ }));
2540
+ //#endregion
2541
+ //#region ../../node_modules/gray-matter/lib/stringify.js
2542
+ var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2543
+ const typeOf = require_kind_of();
2544
+ const getEngine = require_engine();
2545
+ const defaults = require_defaults();
2546
+ module.exports = function(file, data, options) {
2547
+ if (data == null && options == null) switch (typeOf(file)) {
2548
+ case "object":
2549
+ data = file.data;
2550
+ options = {};
2551
+ break;
2552
+ case "string": return file;
2553
+ default: throw new TypeError("expected file to be a string or object");
2554
+ }
2555
+ const str = file.content;
2556
+ const opts = defaults(options);
2557
+ if (data == null) {
2558
+ if (!opts.data) return file;
2559
+ data = opts.data;
2560
+ }
2561
+ const language = file.language || opts.language;
2562
+ const engine = getEngine(language, opts);
2563
+ if (typeof engine.stringify !== "function") throw new TypeError("expected \"" + language + ".stringify\" to be a function");
2564
+ data = Object.assign({}, file.data, data);
2565
+ const open = opts.delimiters[0];
2566
+ const close = opts.delimiters[1];
2567
+ const matter = engine.stringify(data, options).trim();
2568
+ let buf = "";
2569
+ if (matter !== "{}") buf = newline(open) + newline(matter) + newline(close);
2570
+ if (typeof file.excerpt === "string" && file.excerpt !== "") {
2571
+ if (str.indexOf(file.excerpt.trim()) === -1) buf += newline(file.excerpt) + newline(close);
2572
+ }
2573
+ return buf + newline(str);
2574
+ };
2575
+ function newline(str) {
2576
+ return str.slice(-1) !== "\n" ? str + "\n" : str;
2577
+ }
2578
+ }));
2579
+ //#endregion
2580
+ //#region ../../node_modules/gray-matter/lib/excerpt.js
2581
+ var require_excerpt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2582
+ const defaults = require_defaults();
2583
+ module.exports = function(file, options) {
2584
+ const opts = defaults(options);
2585
+ if (file.data == null) file.data = {};
2586
+ if (typeof opts.excerpt === "function") return opts.excerpt(file, opts);
2587
+ const sep = file.data.excerpt_separator || opts.excerpt_separator;
2588
+ if (sep == null && (opts.excerpt === false || opts.excerpt == null)) return file;
2589
+ const delimiter = typeof opts.excerpt === "string" ? opts.excerpt : sep || opts.delimiters[0];
2590
+ const idx = file.content.indexOf(delimiter);
2591
+ if (idx !== -1) file.excerpt = file.content.slice(0, idx);
2592
+ return file;
2593
+ };
2594
+ }));
2595
+ //#endregion
2596
+ //#region ../../node_modules/gray-matter/lib/to-file.js
2597
+ var require_to_file = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2598
+ const typeOf = require_kind_of();
2599
+ const stringify = require_stringify();
2600
+ const utils = require_utils();
2601
+ /**
2602
+ * Normalize the given value to ensure an object is returned
2603
+ * with the expected properties.
2604
+ */
2605
+ module.exports = function(file) {
2606
+ if (typeOf(file) !== "object") file = { content: file };
2607
+ if (typeOf(file.data) !== "object") file.data = {};
2608
+ if (file.contents && file.content == null) file.content = file.contents;
2609
+ utils.define(file, "orig", utils.toBuffer(file.content));
2610
+ utils.define(file, "language", file.language || "");
2611
+ utils.define(file, "matter", file.matter || "");
2612
+ utils.define(file, "stringify", function(data, options) {
2613
+ if (options && options.language) file.language = options.language;
2614
+ return stringify(file, data, options);
2615
+ });
2616
+ file.content = utils.toString(file.content);
2617
+ file.isEmpty = false;
2618
+ file.excerpt = "";
2619
+ return file;
2620
+ };
2621
+ }));
2622
+ //#endregion
2623
+ //#region ../../node_modules/gray-matter/lib/parse.js
2624
+ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2625
+ const getEngine = require_engine();
2626
+ const defaults = require_defaults();
2627
+ module.exports = function(language, str, options) {
2628
+ const opts = defaults(options);
2629
+ const engine = getEngine(language, opts);
2630
+ if (typeof engine.parse !== "function") throw new TypeError("expected \"" + language + ".parse\" to be a function");
2631
+ return engine.parse(str, opts);
2632
+ };
2633
+ }));
2634
+ //#endregion
2635
+ //#region ../../node_modules/gray-matter/index.js
2636
+ var require_gray_matter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2637
+ const fs = __require("fs");
2638
+ const sections = require_section_matter();
2639
+ const defaults = require_defaults();
2640
+ const stringify = require_stringify();
2641
+ const excerpt = require_excerpt();
2642
+ const engines = require_engines();
2643
+ const toFile = require_to_file();
2644
+ const parse = require_parse();
2645
+ const utils = require_utils();
2646
+ /**
2647
+ * Takes a string or object with `content` property, extracts
2648
+ * and parses front-matter from the string, then returns an object
2649
+ * with `data`, `content` and other [useful properties](#returned-object).
2650
+ *
2651
+ * ```js
2652
+ * const matter = require('gray-matter');
2653
+ * console.log(matter('---\ntitle: Home\n---\nOther stuff'));
2654
+ * //=> { data: { title: 'Home'}, content: 'Other stuff' }
2655
+ * ```
2656
+ * @param {Object|String} `input` String, or object with `content` string
2657
+ * @param {Object} `options`
2658
+ * @return {Object}
2659
+ * @api public
2660
+ */
2661
+ function matter(input, options) {
2662
+ if (input === "") return {
2663
+ data: {},
2664
+ content: input,
2665
+ excerpt: "",
2666
+ orig: input
2667
+ };
2668
+ let file = toFile(input);
2669
+ const cached = matter.cache[file.content];
2670
+ if (!options) {
2671
+ if (cached) {
2672
+ file = Object.assign({}, cached);
2673
+ file.orig = cached.orig;
2674
+ return file;
2675
+ }
2676
+ matter.cache[file.content] = file;
2677
+ }
2678
+ return parseMatter(file, options);
2679
+ }
2680
+ /**
2681
+ * Parse front matter
2682
+ */
2683
+ function parseMatter(file, options) {
2684
+ const opts = defaults(options);
2685
+ const open = opts.delimiters[0];
2686
+ const close = "\n" + opts.delimiters[1];
2687
+ let str = file.content;
2688
+ if (opts.language) file.language = opts.language;
2689
+ const openLen = open.length;
2690
+ if (!utils.startsWith(str, open, openLen)) {
2691
+ excerpt(file, opts);
2692
+ return file;
2693
+ }
2694
+ if (str.charAt(openLen) === open.slice(-1)) return file;
2695
+ str = str.slice(openLen);
2696
+ const len = str.length;
2697
+ const language = matter.language(str, opts);
2698
+ if (language.name) {
2699
+ file.language = language.name;
2700
+ str = str.slice(language.raw.length);
2701
+ }
2702
+ let closeIndex = str.indexOf(close);
2703
+ if (closeIndex === -1) closeIndex = len;
2704
+ file.matter = str.slice(0, closeIndex);
2705
+ if (file.matter.replace(/^\s*#[^\n]+/gm, "").trim() === "") {
2706
+ file.isEmpty = true;
2707
+ file.empty = file.content;
2708
+ file.data = {};
2709
+ } else file.data = parse(file.language, file.matter, opts);
2710
+ if (closeIndex === len) file.content = "";
2711
+ else {
2712
+ file.content = str.slice(closeIndex + close.length);
2713
+ if (file.content[0] === "\r") file.content = file.content.slice(1);
2714
+ if (file.content[0] === "\n") file.content = file.content.slice(1);
2715
+ }
2716
+ excerpt(file, opts);
2717
+ if (opts.sections === true || typeof opts.section === "function") sections(file, opts.section);
2718
+ return file;
2719
+ }
2720
+ /**
2721
+ * Expose engines
2722
+ */
2723
+ matter.engines = engines;
2724
+ /**
2725
+ * Stringify an object to YAML or the specified language, and
2726
+ * append it to the given string. By default, only YAML and JSON
2727
+ * can be stringified. See the [engines](#engines) section to learn
2728
+ * how to stringify other languages.
2729
+ *
2730
+ * ```js
2731
+ * console.log(matter.stringify('foo bar baz', {title: 'Home'}));
2732
+ * // results in:
2733
+ * // ---
2734
+ * // title: Home
2735
+ * // ---
2736
+ * // foo bar baz
2737
+ * ```
2738
+ * @param {String|Object} `file` The content string to append to stringified front-matter, or a file object with `file.content` string.
2739
+ * @param {Object} `data` Front matter to stringify.
2740
+ * @param {Object} `options` [Options](#options) to pass to gray-matter and [js-yaml].
2741
+ * @return {String} Returns a string created by wrapping stringified yaml with delimiters, and appending that to the given string.
2742
+ * @api public
2743
+ */
2744
+ matter.stringify = function(file, data, options) {
2745
+ if (typeof file === "string") file = matter(file, options);
2746
+ return stringify(file, data, options);
2747
+ };
2748
+ /**
2749
+ * Synchronously read a file from the file system and parse
2750
+ * front matter. Returns the same object as the [main function](#matter).
2751
+ *
2752
+ * ```js
2753
+ * const file = matter.read('./content/blog-post.md');
2754
+ * ```
2755
+ * @param {String} `filepath` file path of the file to read.
2756
+ * @param {Object} `options` [Options](#options) to pass to gray-matter.
2757
+ * @return {Object} Returns [an object](#returned-object) with `data` and `content`
2758
+ * @api public
2759
+ */
2760
+ matter.read = function(filepath, options) {
2761
+ const file = matter(fs.readFileSync(filepath, "utf8"), options);
2762
+ file.path = filepath;
2763
+ return file;
2764
+ };
2765
+ /**
2766
+ * Returns true if the given `string` has front matter.
2767
+ * @param {String} `string`
2768
+ * @param {Object} `options`
2769
+ * @return {Boolean} True if front matter exists.
2770
+ * @api public
2771
+ */
2772
+ matter.test = function(str, options) {
2773
+ return utils.startsWith(str, defaults(options).delimiters[0]);
2774
+ };
2775
+ /**
2776
+ * Detect the language to use, if one is defined after the
2777
+ * first front-matter delimiter.
2778
+ * @param {String} `string`
2779
+ * @param {Object} `options`
2780
+ * @return {Object} Object with `raw` (actual language string), and `name`, the language with whitespace trimmed
2781
+ */
2782
+ matter.language = function(str, options) {
2783
+ const open = defaults(options).delimiters[0];
2784
+ if (matter.test(str)) str = str.slice(open.length);
2785
+ const language = str.slice(0, str.search(/\r?\n/));
2786
+ return {
2787
+ raw: language,
2788
+ name: language ? language.trim() : ""
2789
+ };
2790
+ };
2791
+ /**
2792
+ * Expose `matter`
2793
+ */
2794
+ matter.cache = {};
2795
+ matter.clearCache = function() {
2796
+ matter.cache = {};
2797
+ };
2798
+ module.exports = matter;
2799
+ }));
2800
+ //#endregion
2801
+ export { require_gray_matter as t };